aquova / chip8-book Goto Github PK
View Code? Open in Web Editor NEWAn introduction to Chip-8 emulation using Rust
Home Page: https://aquova.net/chip8/chip8.pdf
License: Creative Commons Zero v1.0 Universal
An introduction to Chip-8 emulation using Rust
Home Page: https://aquova.net/chip8/chip8.pdf
License: Creative Commons Zero v1.0 Universal
Sorry to contact you like this, but I couldn't find another way.
I've just read your book on making a chip8 emulator in rust, and I've really enjoyed it.
Will you consider doing the same thing with space invaders ? (the Midway 8080 arcade machine, not a clone of the game)
It is generally considered to be the next step in emulation programming after the chip8, but I couldn't find a tutorial that explains things clearly to me.
When executing Cargo run
on Desktop folder:
error: linking with `cc` failed: exit status: 1
= note: ld: library not found for -lSDL2
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The provided Chip-8 games are supplied from Zophar's Domain. Original author unknown.
The games in your repo were created by David Winter: https://www.pong-story.com/chip8/
Note that these games were made for Winter's own CHIP-8 interpreter, which in turn was based on CHIP-48, which contains many incompatibilities with other interpreters. If your emulator, and book, are based on that, it's probably incompatible with many games made both before and after the early 90s.
On the Setup chapter, there should be a section mentioning how keys / the keypad is represented on this implementation.
Up to the Stack section, keys are not mentioned. Then, the section that comes right after which is the Timers already includes the keys
as part of the Emu
struct with no explanation. I actually missed it until my code editor complained of missing keys
afterwards in the process.
From section 4.2 of the book:
Each character is made up of eight rows of five pixels, with each row using a byte of data, meaning that each letter altogether takes up five bytes of data.
This should either be "five rows of eight pixels" or "eight columns of five pixels".
It might be worth making a note in the book about instructions 8XY6 and 8XYE.
It turns out the these instruction's meaning somehow got changed with time. Since the idea about the implementation of these is so widespread these days, this leaves the emulator implementor with a dilemma, support the original way (for original ROMs), or support the new way?
Generally it's likely a good idea to support both ways, seeing as its possible one may run into older ROMs which rely on the original correct behavior.
https://web.archive.org/web/20170213223712/http://laurencescotford.co.uk/?p=266
Only the first five of these instructions were officially documented by RCA. 8XY6, 8XY7 and 8XYE are all undocumented. Unfortunately an erroneous assumption about 8XY6 and 8XYE, the two shift instructions, seems to have crept into Chip-8 lore at some point. Most recent documentation on Chip-8 suggests these instructions shift VX rather than VY. Some documents suggest that the correct format for them is 8X06 and 8X0E. However, when these instructions are run on the original Chip-8 interpreter, they will shift VY not VX! An instruction of the form 8X06 or 8X0E will not work as expected. The programmer would be expecting this to shift VX and store the result back in VX. What would actually happen is that V0 would be shifted and the result stored back in VX. This leaves the programmer of a contemporary interpreter with a bit of a dilemma. Do you make these instructions function as they would have done in the original interpreter or do you make them function in accordance with the erroneous assumption? Or do you offer both modes and a way to switch between them? This post documents the way the instructions worked in the original Chip-8 interpreter.
Edit: Also, here's a chip8 test suite. It revealed a few problems with the book's implementation, particularly this one
https://github.com/Timendus/chip8-test-suite
I got to the finished desktop build part, and space invaders for example runs fine. But when I try pong it completely glitches out without doing anything. Any fix?
First of all I'd like to say thanks to aquova for making this very extensive manuell on the chip8 emulator. This has helped me with setting sdl up and the opcodes of course. I also implemented sound into the emulator (just an oscillator that produces a sine wave when the sound timer hits 0). The sound runs on the same thread as the main emulator but that shouldn't be to much of a problem when the sound is very short.
You can take a look [here] (https://github.com/MalekDeKalem/Rust-Chip8-Emulator)
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.