|
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 |
| -## Building |
| 6 | +## Build |
7 | 7 |
|
8 | 8 | Download MSYS2. Run build.sh in MSYS2 MINGW64 environment.
|
9 | 9 |
|
10 | 10 | Only supports x64 architecture for now.
|
11 | 11 |
|
12 |
| -## Options |
| 12 | +## Usage |
13 | 13 |
|
14 |
| -#### mandatory |
| 14 | +Run the generated binary `casioemu32.exe` or `casioemu64.exe` |
15 | 15 |
|
16 |
| -`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) |
| 16 | +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). |
17 | 17 |
|
18 |
| -#### optional |
| 18 | +The dlls needed by the program (SDL2.dll, SDL2_image.dll) are in the `dlls` directory. |
19 | 19 |
|
20 |
| -`script=<lua script path>` the lua script that runs on startup |
| 20 | +## Command-line arguments |
21 | 21 |
|
22 |
| -`exit_on_console_shutdown` shutdown the entire emulator when console reads EOF |
| 22 | +Each argument should have one of these two formats: |
23 | 23 |
|
24 |
| -`history=<history file path>` the file that stores input history |
| 24 | +* `key=value` where `key` does not contain any equal signs. |
| 25 | +* `path`: equivalent to `model=path`. |
25 | 26 |
|
26 |
| -`width=<xxx>`, `height=<xxx>` the width of height of the calculator window |
| 27 | +Supported values of `key` are: (if `value` is not mentioned then it does not matter) |
27 | 28 |
|
28 |
| -`paused` pause the emulator after startup |
| 29 | +* `paused`: Pause the emulator on start. |
| 30 | +* `model`: Specify the path to model folder. Example `value`: `models/fx570esplus`. |
| 31 | +* `ram`: Load RAM dump from the path specified in `value`. |
| 32 | +* `clean_ram`: If `ram` is specified, this prevents the calculator from loading the file, instead starting from a *clean* RAM state. |
| 33 | +* `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. |
| 34 | +* `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) |
| 35 | +* `pause_on_mem_error`: Pause the emulator when a memory error message is printed. |
| 36 | +* `history`: Path to a file to load/save command history. |
| 37 | +* `script`: Specify a path to Lua file to be executed on program startup (using `value` parameter). |
| 38 | +* `width`, `height`: Initial window width/height on program start. The values can be in hexadecimal (prefix `0x`), octal (prefix `0`) or decimal. |
| 39 | +* `exit_on_console_shutdown`: Exit the emulator when the console thread is shut down. |
29 | 40 |
|
30 |
| -`pause_on_mem_error` pause the emulator when there's memory error |
| 41 | +## Available Lua functions |
31 | 42 |
|
32 |
| -`ram=<ram iamge path>` the file that stores ram iamge |
| 43 | +Those Lua functions and variables can be used at the Lua prompt of the emulator. |
33 | 44 |
|
34 |
| -`preserve_ram` save the ram into the ram image file after exit |
| 45 | +* `emu:set_paused(-)`: Set emulator state. Called with a boolean value. |
| 46 | +* `emu:tick()`: Execute one command. |
| 47 | +* `emu:shutdown()`: Shutdown the emulator. |
35 | 48 |
|
36 |
| -`clean_ram` do not load the ram image on startup |
| 49 | +* `cpu.xxx`: Get register value. `xxx` should be one of |
| 50 | + * `r0` to `r15` |
| 51 | + * One of the register names. See `register_record_sources` array in `emulator\src\Chipset\CPU.cpp`. |
| 52 | + * `erN`, `xrN`, `qrN` are **not** supported. |
| 53 | +* `cpu.bt`: A string containing the current stack trace. |
37 | 54 |
|
38 |
| -`strict_memory` treat writes to the rom as memory errors |
| 55 | +* `code[address]`: Access code. (By words, only use even address, otherwise program will panic) |
| 56 | +* `data[address]`: Access data. (By bytes) |
| 57 | +* `data:watch(offset, fn)`: Set watchpoint at address `offset` - `fn` is called whenever |
| 58 | +data is written to. If `fn` is `nil`, clear the watchpoint. |
| 59 | +* `data:rwatch(offset, fn)`: Set watchpoint at address `offset` - `fn` is called whenever |
| 60 | +data is read from as data. If `fn` is `nil`, clear the watchpoint. |
| 61 | + |
| 62 | +Some additional functions are available in `lua-common.lua` file. |
| 63 | +To use those, it's necessary to pass the flag `script=emulator/lua-common.lua`. |
0 commit comments