Skip to content

Commit 53260dd

Browse files
committed
revised README
1 parent 4da3e1d commit 53260dd

File tree

2 files changed

+536
-508
lines changed

2 files changed

+536
-508
lines changed

emulator/README.md

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,61 @@
33
An emulator and disassembler for the CASIO calculator series using the nX-U8/100 core ported to windows.
44
With debuggers.
55

6-
## Building
6+
## Build
77

88
Download MSYS2. Run build.sh in MSYS2 MINGW64 environment.
99

1010
Only supports x64 architecture for now.
1111

12-
## Options
12+
## Usage
1313

14-
#### mandatory
14+
Run the generated binary `casioemu32.exe` or `casioemu64.exe`
1515

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).
1717

18-
#### optional
18+
The dlls needed by the program (SDL2.dll, SDL2_image.dll) are in the `dlls` directory.
1919

20-
`script=<lua script path>` the lua script that runs on startup
20+
## Command-line arguments
2121

22-
`exit_on_console_shutdown` shutdown the entire emulator when console reads EOF
22+
Each argument should have one of these two formats:
2323

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`.
2526

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)
2728

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.
2940

30-
`pause_on_mem_error` pause the emulator when there's memory error
41+
## Available Lua functions
3142

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.
3344

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.
3548

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.
3754

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

Comments
 (0)