fokoid / chipper8 Goto Github PK
View Code? Open in Web Editor NEWCHIP-8 interpreter in Rust
License: Apache License 2.0
CHIP-8 interpreter in Rust
License: Apache License 2.0
program counter row format should be exactly the same as stack: name, address value, pointed value (hex word), parsed instruction. should use the same code to format both. maybe some kind of row struct that takes a name and address and handles the rest.
Add fixed bottom bar with:
for example the font instruction sets the index to the memory location of the appropriate font glyph. currently it directly sets the index but it could instead invoke the index set command.
one potential advantage would be the ability to split commands into those that directly mutate state and those that don't. this would make any future refactors of the VM internal state easier.
This will require turning the enumeration types from tuples to structs in their own right (which is good for semantics anyway)
can we do this with codegen and a grammar file or something?
Implement the instructions required by IBM logo ROM in the VM
Rough prototype of VM visualizer GUI:
e.g. simplify sets
set <register> <value>
index set <value>
timer sound <value>
timer set <value>
could become
set <register|index|sound|timer> <value>
this will also allow making the (currently hand coded) parsing logic easier
.step
to run current instruction and increment program counter.run
to resume normal execution from current instructioncurrently there's a hard coded list of windows. figure out a way to register available windows and just have them all displayed. (in python I'd do this with a decorator on the method responsible for drawing each window, but not sure what I'll do in rust. probably has to be a macro.)
Implement REPL parsing of the commands required by the IBM logo ROM
this should wrap the usize register index, enforce bounds checking, provide pretty formatting like VX
index should probably go in its own window since it's structurally different to the program counter. we should display:
Load rom into memory at <address>
and set program counter to <address>
:
.load IBM.rom <address>
Start execution loop
.play
Pause execution loop and back to repl
.pause
Given the retro nature of CHIP-8 let's go hard on the tape metaphors
.load
.play
.pause
Meta command to 'reboot' VM, resetting it to initial state on boot
need to read the specs on this. but for example what happens if we try to execute an invalid instruction? should we crash entirely? does VF get set to something?
extend bottom bar with repl text entry across entire window. use the additional space to display error messages
if the same instruction is sent consecutively, don't spam rows in the REPL history. instead add a new column with a number (maybe max 99) to indicate the number of times sent consecutively
try to figure out a way to set monospace globally instead of using the MonoLabel
widget
Add a window with clickable keypad buttons for sending button presses direct to the VM. We should also figure out a way to send GUI keypresses 0-9 A-F direct to the VM (e.g. when the display window is focused) but the keypad window would be a simpler first step. Additionally, when keypresses are being captured and sent to the VM we could indicate this by highlighting the relevant key in the keypad window.
At the moment the number of hex digits shown in various displays is hard coded and non semantic. Let's extract formatting structs so it's configured in one place and has semantic meaning. All of the below wrap a single u16
(maybe u8
in a few cases) and implement the Display
trait.
When I hard coded some stack entries in the machine demo state I used AAAA
and BBBB
which are out of range for the 12 bit 4kb of memory.
the row highlighting doesn't place nice with current pattern for building tables. we don't really need it anyway so let's drop it.
at the moment there's a lot of casts between integer types (especially various unsigned ints to/from sizes/pointers)
meta commands may be better served by GUI elements
Command field, submit on , and command history. Barebones command parsing needed but only for placeholder unknown command.
The REPL history table was breaking when I added headers to tables. But the other tables were fine. The difference? The REPL history table sits within a bottom to top layout.
Need to figure out exactly what's going wrong and file an upstream bug report if appropriate. My guess is that when the header is allocated in bottom to top layout it consumes the whole space since we start at the bottom and the top is hard coded as the top of the current view.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.