0.2.0 • Published 3 years ago

boone8 v0.2.0

Weekly downloads
-
License
-
Repository
github
Last release
3 years ago

Example Usage

You can get a Chip8 interface up and running by using the example under the examples folder. However, if wrestling with WASM doesn't seem like your cup of tea, the example is also hosted at https://jarrodboone.info/Projects/Chip8

About the JavaScript API

The API exposed by the WASM module allows any form of JavaScript to import the memory and methods of the Chip8 structure created in the rust code!

API Methods

NameParamsUsage
tickExecute a cycle in the Chip8's CPU. You'd want to call this in a loop in order to start processing the opcodes from the loaded ROM.
resetResets the Chip8's memory back to it's original state.
get_memoryReturns a pointer to the storage memory. You'd want to store this in a new Uint8Array in order to retrieve it from the WASM memory.
get_videoReturns a pointer to the video memory. Same as get_memory(), you'd want to use a Uint8Array for storage.
get_indexReturns the 16-bit index register used to store memory locations that are used in operations.
get_pcReturns the 16-bit program counter that holds the address to the next instruction that the Chip8 will execute.
get_registersReturns a pointer to the 16 8-bit registers used to store memory used in operations
get_stack_ptrReturns a pointer to the 16 16-bit stack array, used to keep track of the order of execution of the CPU
get_stack_indexGet the index that keeps track of where we are in the CPU's stack
get_opcodeReturns the 16-bit opcode that is being executed
get_delay_timerReturns the 8-bit timer used to signal delays when it !== 0
get_sound_timerReturns the 8-bit timer used to signal that a sound should be played when it !== 0
set_key_downkey: usizeSignals that the key address specified should be set to true
set_key_upkey: usizeSignals that the key address specified should be set to false
0.2.0

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago