https://github.com/commandblockguy/cemscripten
Compiles TI-84+CE CEdev C programs to WebAssembly with minimal source modifications.
https://github.com/commandblockguy/cemscripten
Last synced: 9 months ago
JSON representation
Compiles TI-84+CE CEdev C programs to WebAssembly with minimal source modifications.
- Host: GitHub
- URL: https://github.com/commandblockguy/cemscripten
- Owner: commandblockguy
- License: mit
- Created: 2020-11-06T06:23:33.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-12-18T20:16:04.000Z (over 5 years ago)
- Last Synced: 2025-07-27T00:31:04.633Z (10 months ago)
- Language: C++
- Size: 79.1 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CEmscripten
A toolchain to compile C programs originally designed for the TI-84+CE calculator using [CEdev](https://github.com/CE-Programming/toolchain) to WebAssembly with minimal source modifications.
Currently, it is extremely incomplete - do not expect it to compile much of anything besides [Taxi Simulator](https://commandblockguy.xyz/demos/taxi/) without implementing many functions yourself.
Contributions are highly welcome - not just PRs, but also issues for bugs or feature requests, so that I can have some idea of what needs to be implemented.
This probably won't run on Windows.
## Usage
1. Clone this repository to your computer.
2. Set the CEMSCRIPTEN environment variable to the path to the repo.
3. Add this line to the end of your project's makefile: `include $(CEMSCRIPTEN)/makefile.mk`
4. Build the project with `make web`
## Limitations
- Currently, most functions are not implemented.
- There is no 24-bit type in WebAssembly. You should replace all instances of `uint24_t` and `int24_t` with `int` and `unsigned int`, respectively. If your program uses hardcoded sizes, this will likely break it, so just don't do that.
- Assembly functions will not compile, as this is not an emulator.
- Direct access to any hardware registers, besides vram, the LCD palette, or kb_Data will not work.
- The web browser uses an asynchronous model, while almost all C programs use a synchronous model. CEmscripten attempts to work around this by adding a short delay during some IO-related functions to allow the browser to process other events. You may also do this yourself by calling the delay() function.