{"id":13830233,"url":"https://github.com/taviso/timex","last_synced_at":"2025-10-30T19:39:27.266Z","repository":{"id":192280086,"uuid":"686417190","full_name":"taviso/timex","owner":"taviso","description":"A hello world for the timex m851","archived":false,"fork":false,"pushed_at":"2023-09-08T18:59:02.000Z","size":63,"stargazers_count":33,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-06T14:07:22.047Z","etag":null,"topics":["retrocomputing"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/taviso.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-02T18:10:18.000Z","updated_at":"2024-11-24T23:11:50.000Z","dependencies_parsed_at":"2023-09-03T23:45:42.549Z","dependency_job_id":"f5c0a9be-a6a5-48f4-a64f-eb7b112fdfee","html_url":"https://github.com/taviso/timex","commit_stats":null,"previous_names":["taviso/timex"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/taviso/timex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taviso%2Ftimex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taviso%2Ftimex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taviso%2Ftimex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taviso%2Ftimex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taviso","download_url":"https://codeload.github.com/taviso/timex/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taviso%2Ftimex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281870575,"owners_count":26576245,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-30T02:00:06.501Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["retrocomputing"],"created_at":"2024-08-04T10:00:57.617Z","updated_at":"2025-10-30T19:39:27.235Z","avatar_url":"https://github.com/taviso.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# timex\n\nThis is a \"hello world\" for the Timex m851 written in C.\n\nI ported the official SDK to C, I wrote a brief article about it [here](https://lock.cmpxchg8b.com/timex.html).\n\nI hope this can be a useful template for building your own WristApp!\n\n![crown](https://github.com/taviso/timex/assets/123814/8b04b788-d304-48cf-8239-009a207597c9)\n\n# Requirements\n\nYou need `wine`, `unshield` and `msitools`.\n\n\u003e Note that on fedora, you will need `wine.i686`.\n\n# Usage\n\nFirst, run `buildenv.sh` to download the toolchain and headers.\n\n\u003e Note: It doesn't install anything, it just places them in the build directory.\n\n## Setup\n\nYou must create a `.app` file that describes where the code goes.\n\nHere is a minimal example:\n\n```ini\n[WristApp]\nName=Hello World\nDescription=Test Application\nLine1=\nLine2=\nVersion Required=018\nPAR=hello_par_018.bin\nCODE=hello_code_018.bin\nDB=\nPassword Support=\n```\n\nNow you need to create a base file for each of your states, name them\n`state0.c`, `state1.c` and so on.\n\nThe first function in each `state?.c` file should be your event handler.\n\nYou can place variables wherever you like.\n\n```c\n#include \u003ctimex.h\u003e\n\nvoid banner_state_manager (void)\n{\n        switch (CORECurrentEvent) {\n            case COREEVENT_STATEENTRY:\n                coreSetPopDownState(COREDEFAULTSTATE);\n                break;\n            default:\n                // Use the default handler for all other events.\n                coreCommonBannerStateHandler();\n                break;\n        }\n\n        return;\n}\n```\n\n\u003e Note: If you want your state to be written in assembly, you can do that too!\n\u003e Just call it `state3.asm` and the `Makefile` will understand.\n\nPut your background event handler in `common.c`, this is also where you will\nput any common code that all states need to access.\n\nYou will also need a `param.asm` file that contains the application control\nblock.\n\n## Makefile\n\nThe simplest Makefile will just contain this:\n\n```Makefile\ninclude etc/rules.mk\n```\n\nThis assumes you just have a few `state?.c` files and that's it!\n\nIf you want more `.c` files linked into a state, specify that you want them\ncompiled and linked in like this:\n\n```Makefile\n# Add any additional object dependencies here.\nstate1.out: banner.obj data.obj extra.obj\n```\n\nYou can also adjust toolchain flags, for example to disable warnings or enable\ndebugging options:\n\n```Makefile\nC88FLAGS=-s -w123\n```\n\nIf you want to append commands to a target, just use double colons.\n\nFor example:\n\n```Makefile\nclean::\n\trm -f my_extra_file\n```\n\n### Databases\n\nIf you want to create a database, first add a `DB=` section to your `.app` file.\n\nCreate records called `*.rec` in the `db` directory.\n\nYou can call the records `00_foo.rec`, `02_bar.rec`, `03_baz.rec` and so on.\nThey will be added to the database in filename order.\n\n\u003e Note: Currently it will always be a random access, variable record size\n\u003e database.\n\nUse code like this to access it:\n\n```c\n    dbOpenFile();\n    dbReadRecordRandomVar(\u0026rec, num, sizeof(rec));\n    dbCloseFile();\n```\n\n### Pre-processing\n\nThe `c88` compiler is sometimes finicky. A recommended step is to pre-process\nyour files with the GNU C Pre-processor, this way you can use modern features\nand workaround buggy macro syntax.\n\nTo enable this feature, just do this:\n\n```Makefile\n# You can optionally request that all your .c file be pre-processed with GNU\n# cpp before being compiled with c88.\n#\nUSE_GNU_CPP = 1\n```\n\n# Building\n\nOnce your `Makefile` is complete, just type `make`!\n\n![make](https://github.com/taviso/timex/assets/123814/46cc947b-dbc6-4cb3-b0fa-e9dc412eab49)\n\nYou can upload your app to your watch using `libdlusb`.\n\n## Windows\n\nIf you are using Windows, copy the `.app` and `.bin` files to your\n`C:\\Program Files (x86)\\Timex\\App` directory.\n\nAlternatively, just run `bin/wristappdl.exe` for a simple upload tool.\n\n\u003e Note: I needed to run it with Administrator priviliges and in compatability mode.\n\n## Errors\n\n##### `lc88 E200 (0): Absolute address xyz occupied`\n\nThis means the locator couldn't find a way to fit your code into the available\nspace. You can try splitting your code into more states, or reducing the amount\nof code in your common section to free up space.\n\nIf you're accessing lots of static data (strings, tables, etc), try putting that\ndata into a database instead, that will make more room for code.\n\n## Debugging\n\nThere is an simulator with debugging support (breakpoints, disassembler, save states, etc).\n\nIt is Windows only, but very handy for development.\n\n![datalink](https://github.com/taviso/timex/assets/123814/cdafffec-f685-462a-9ed6-cf3638000a62)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaviso%2Ftimex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaviso%2Ftimex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaviso%2Ftimex/lists"}