Small changes

This commit is contained in:
Garrett Dickinson 2024-03-28 23:48:43 -05:00
parent 4d81f2b32b
commit 808d51918f
5 changed files with 16 additions and 7 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
/target
Cargo.lock

7
Cargo.lock generated
View File

@ -1,7 +0,0 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "salt-n-vinegar"
version = "0.1.0"

8
notes/registers.txt Normal file
View File

@ -0,0 +1,8 @@
16 8-bit general registers, V0 -> VF
1 16-bit register I, only 12 bits are used
Program counter (PC) should be 16-bit, and is used to store the currently executing address.
The stack pointer (SP) can be 8-bit, it is used to point to the topmost level of the stack.
The stack is an array of 16 16-bit values, used to store the address that the interpreter shoud return to when finished with a subroutine.
Chip-8 allows for up to 16 levels of nested subroutines.

7
src/chip8.rs Normal file
View File

@ -0,0 +1,7 @@
// Miscellanious registers
static mut program_counter: u16 = 0;
static mut stack_ptr: u8 = 0;
// General purpose registers
static mut registers: [u8; 16] = [0; 16];