|
3 | 3 | An emulator and disassembler for the CASIO calculator series using the nX-U8/100 core ported to windows.
|
4 | 4 | With debuggers.
|
5 | 5 |
|
| 6 | +## Build |
| 7 | + |
6 | 8 | To build it, install tdm-gcc and run build32.bat or build64.bat (depending on your machine's architecture).
|
7 | 9 |
|
| 10 | +## Usage |
| 11 | + |
| 12 | +Run the generated binary `casioemu32.exe` or `casioemu64.exe` |
| 13 | + |
| 14 | +To interact with the calculator keyboard, use the mouse (left click to press, right click to stick) or the keyboard (see `models/*/model.lua` for keyboard configuration). |
| 15 | + |
8 | 16 | The dlls needed by the program (SDL2.dll, SDL2_image.dll) are in the `dlls` directory.
|
9 | 17 |
|
10 |
| -## Syntax |
| 18 | +## Command-line arguments |
| 19 | + |
| 20 | +Each argument should have one of these two formats: |
| 21 | + |
| 22 | +* `key=value` where `key` does not contain any equal signs. |
| 23 | +* `path`: equivalent to `model=path`. |
11 | 24 |
|
12 |
| -`casioemu <key1>=<value1> <key2>=<value2> ...` |
| 25 | +Supported values of `key` are: (if `value` is not mentioned then it does not matter) |
13 | 26 |
|
14 |
| -`model=<directory>` model directory, which should contain interface.png, model.lua, rom.bin(you can find it elsewhere) and _disas.txt(use disas-cpp on rom.bin to obtain this file) |
| 27 | +* `paused`: Pause the emulator on start. |
| 28 | +* `model`: Specify the path to model folder. Example `value`: `models/fx570esplus`. |
| 29 | +* `ram`: Load RAM dump from the path specified in `value`. |
| 30 | +* `clean_ram`: If `ram` is specified, this prevents the calculator from loading the file, instead starting from a *clean* RAM state. |
| 31 | +* `preserve_ram`: Specify that the RAM should **not** be dumped (to the value associated with the `ram` key) on program exit, in other words, *preserve* the existing RAM dump in the file. |
| 32 | +* `strict_memory`: Print an error message if the program attempt to write to unwritable memory regions corresponding to ROM. (writing to unmapped memory regions always print an error message) |
| 33 | +* `pause_on_mem_error`: Pause the emulator when a memory error message is printed. |
| 34 | +* `history`: Path to a file to load/save command history. |
| 35 | +* `script`: Specify a path to Lua file to be executed on program startup (using `value` parameter). |
| 36 | +* `width`, `height`: Initial window width/height on program start. The values can be in hexadecimal (prefix `0x`), octal (prefix `0`) or decimal. |
| 37 | +* `exit_on_console_shutdown`: Exit the emulator when the console thread is shut down. |
15 | 38 |
|
16 |
| -these arguments are optional: |
| 39 | +## Available Lua functions |
17 | 40 |
|
18 |
| -`script=<xxx.lua>` the supplied lua script will run on startup |
| 41 | +Those Lua functions and variables can be used at the Lua prompt of the emulator. |
19 | 42 |
|
20 |
| -`exit_on_console_shutdown=true/false` pretty self-evident, default to false |
| 43 | +* `emu:set_paused(-)`: Set emulator state. Called with a boolean value. |
| 44 | +* `emu:tick()`: Execute one command. |
| 45 | +* `emu:shutdown()`: Shutdown the emulator. |
21 | 46 |
|
22 |
| -`history=<history file path>` the file that stores your input history |
| 47 | +* `cpu.xxx`: Get register value. `xxx` should be one of |
| 48 | + * `r0` to `r15` |
| 49 | + * One of the register names. See `register_record_sources` array in `emulator\src\Chipset\CPU.cpp`. |
| 50 | + * `erN`, `xrN`, `qrN` are **not** supported. |
| 51 | +* `cpu.bt`: A string containing the current stack trace. |
23 | 52 |
|
24 |
| -`width=<xxx>`, `height=<xxx>` the width of height of the emulator window |
| 53 | +* `code[address]`: Access code. (By words, only use even address, otherwise program will panic) |
| 54 | +* `data[address]`: Access data. (By bytes) |
| 55 | +* `data:watch(offset, fn)`: Set watchpoint at address `offset` - `fn` is called whenever |
| 56 | +data is written to. If `fn` is `nil`, clear the watchpoint. |
| 57 | +* `data:rwatch(offset, fn)`: Set watchpoint at address `offset` - `fn` is called whenever |
| 58 | +data is read from as data. If `fn` is `nil`, clear the watchpoint. |
25 | 59 |
|
26 |
| -`paused` if supplied, the emulator will pause on startup |
| 60 | +Some additional functions are available in `lua-common.lua` file. |
| 61 | +To use those, it's necessary to pass the flag `script=emulator/lua-common.lua`. |
0 commit comments