Initial commit:
Created outline of emulator:
The emulator has a Bus, which attaches a CPU to some Memory (Mapped Devices)
The design isn't particularly efficient, but the interpreter only needs to
run at ~500Hz or so. It's Rust. It can do that.
Instructions yet to be implemented:
Cxbb: "Store a random number, masked by bitmask bb, into vX"
Dxyn: "Draw an 8 by n sprite to the screen at coordinates (x, y)"
Fx0A: "Wait for a key, then set vX to the value of the pressed key"
Fx33: "BCD convert X, storing the results in &I[0..3]"
Thoughts going forward:
- It's probably a good idea to parse instructions out into an enum.
I had this in an earlier design, but it didn't really look that good.
However, I haven't read many other emulators before, so I don't know the
style people generally go for.
- I haven't used a native graphics library before, and my cg class was done
entirely in a web browser. That kinda sucks, honestly. Sure the skill
might transfer well, but, >JS
2023-03-08 12:07:33 +00:00
|
|
|
[package]
|
I/O: KISS the bus, attach a screen, plug in a controller
Chip-8 has no ROM, nor memory management.
- It's much easier to just use contiguous memory.
- Then we can return references to slices of that memory
- ~3x speed increase
Screen exists now, uses 24-bit framebuffer
- We have a 1-bit framebuffer
- I chose colors that look good to me
Controller exists as well, has 16 buttons
- Mapped "0 123 456 789 ab cdef" to (QWERTY) "X 123 QWE ASD zC 4RFV"
- Other chip-8 interpreters may use a different layout
- This is good enough for now.
- F1-F9 map to control functions
- F1, F2: Dump CPU registers/screen contents
- F3, F4: Toggle disassembly/pause
- F5: Single-step the CPU, pausing after
- F6, F7: Set/Unset breakpoint
- F8, F9: Soft/Hard Reset CPU
2023-03-22 20:03:53 +00:00
|
|
|
name = "chirp"
|
Initial commit:
Created outline of emulator:
The emulator has a Bus, which attaches a CPU to some Memory (Mapped Devices)
The design isn't particularly efficient, but the interpreter only needs to
run at ~500Hz or so. It's Rust. It can do that.
Instructions yet to be implemented:
Cxbb: "Store a random number, masked by bitmask bb, into vX"
Dxyn: "Draw an 8 by n sprite to the screen at coordinates (x, y)"
Fx0A: "Wait for a key, then set vX to the value of the pressed key"
Fx33: "BCD convert X, storing the results in &I[0..3]"
Thoughts going forward:
- It's probably a good idea to parse instructions out into an enum.
I had this in an earlier design, but it didn't really look that good.
However, I haven't read many other emulators before, so I don't know the
style people generally go for.
- I haven't used a native graphics library before, and my cg class was done
entirely in a web browser. That kinda sucks, honestly. Sure the skill
might transfer well, but, >JS
2023-03-08 12:07:33 +00:00
|
|
|
version = "0.1.0"
|
|
|
|
edition = "2021"
|
|
|
|
|
2023-03-27 22:23:41 +00:00
|
|
|
[features]
|
|
|
|
default = []
|
|
|
|
rhexdump = ["dep:rhexdump"]
|
|
|
|
serde = ["dep:serde"]
|
|
|
|
|
Initial commit:
Created outline of emulator:
The emulator has a Bus, which attaches a CPU to some Memory (Mapped Devices)
The design isn't particularly efficient, but the interpreter only needs to
run at ~500Hz or so. It's Rust. It can do that.
Instructions yet to be implemented:
Cxbb: "Store a random number, masked by bitmask bb, into vX"
Dxyn: "Draw an 8 by n sprite to the screen at coordinates (x, y)"
Fx0A: "Wait for a key, then set vX to the value of the pressed key"
Fx33: "BCD convert X, storing the results in &I[0..3]"
Thoughts going forward:
- It's probably a good idea to parse instructions out into an enum.
I had this in an earlier design, but it didn't really look that good.
However, I haven't read many other emulators before, so I don't know the
style people generally go for.
- I haven't used a native graphics library before, and my cg class was done
entirely in a web browser. That kinda sucks, honestly. Sure the skill
might transfer well, but, >JS
2023-03-08 12:07:33 +00:00
|
|
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
2023-03-25 23:17:55 +00:00
|
|
|
[profile.release]
|
|
|
|
opt-level = 'z'
|
|
|
|
debug = false
|
|
|
|
rpath = false
|
|
|
|
lto = true
|
|
|
|
debug-assertions = false
|
|
|
|
codegen-units = 1
|
|
|
|
panic = 'unwind'
|
|
|
|
incremental = true
|
|
|
|
overflow-checks = false
|
|
|
|
|
Initial commit:
Created outline of emulator:
The emulator has a Bus, which attaches a CPU to some Memory (Mapped Devices)
The design isn't particularly efficient, but the interpreter only needs to
run at ~500Hz or so. It's Rust. It can do that.
Instructions yet to be implemented:
Cxbb: "Store a random number, masked by bitmask bb, into vX"
Dxyn: "Draw an 8 by n sprite to the screen at coordinates (x, y)"
Fx0A: "Wait for a key, then set vX to the value of the pressed key"
Fx33: "BCD convert X, storing the results in &I[0..3]"
Thoughts going forward:
- It's probably a good idea to parse instructions out into an enum.
I had this in an earlier design, but it didn't really look that good.
However, I haven't read many other emulators before, so I don't know the
style people generally go for.
- I haven't used a native graphics library before, and my cg class was done
entirely in a web browser. That kinda sucks, honestly. Sure the skill
might transfer well, but, >JS
2023-03-08 12:07:33 +00:00
|
|
|
|
|
|
|
[dependencies]
|
2023-03-27 22:23:41 +00:00
|
|
|
gumdrop = "^0.8.1"
|
|
|
|
minifb = { version = "^0.24.0", features = ["wayland"] }
|
Initial commit:
Created outline of emulator:
The emulator has a Bus, which attaches a CPU to some Memory (Mapped Devices)
The design isn't particularly efficient, but the interpreter only needs to
run at ~500Hz or so. It's Rust. It can do that.
Instructions yet to be implemented:
Cxbb: "Store a random number, masked by bitmask bb, into vX"
Dxyn: "Draw an 8 by n sprite to the screen at coordinates (x, y)"
Fx0A: "Wait for a key, then set vX to the value of the pressed key"
Fx33: "BCD convert X, storing the results in &I[0..3]"
Thoughts going forward:
- It's probably a good idea to parse instructions out into an enum.
I had this in an earlier design, but it didn't really look that good.
However, I haven't read many other emulators before, so I don't know the
style people generally go for.
- I haven't used a native graphics library before, and my cg class was done
entirely in a web browser. That kinda sucks, honestly. Sure the skill
might transfer well, but, >JS
2023-03-08 12:07:33 +00:00
|
|
|
owo-colors = "^3"
|
2023-03-27 22:23:41 +00:00
|
|
|
rand = "^0.8.5"
|
|
|
|
rhexdump = {version = "^0.1.1", optional = true }
|
|
|
|
serde = { version = "^1.0", features = ["derive"], optional = true }
|
|
|
|
thiserror = "^1.0.39"
|