Yet Another CHIP-8 Interpreter (YACI) Project
Root / Talk About Programs / [.]
hakkeCreated:
Just because we are in great faulty of CHIP-8 interpreters (sarcasm), I proposed myself to write a (Super) CHIP-8 from scratch as a project to help me gain knowledge about emulators and that stuff. The cool thing? I'm not writing it right now. I plan to bundle with it a functional (Super) CHIP-8 assembler as a program to tinker with.
So... progress? I've already implemented some of the opcodes (with a big, ugly giant mess of IFs) and they output correctly (as far as my reference sheet can tell). By keeping the coding pace I've been keeping this days (except today), I plan to get it to a usable stage and release it by next week. I'll post some updates and screenshots in this thread of the assembler (and the emulator aswell).
Be careful, there is a lot of incorrect documentation (particularly the 2 most popular: http://devernay.free.fr/hacks/chip8/C8TECH10.HTM and http://mattmik.com/files/chip8/mastering/chip8.html)
The most accurate I've found is http://laurencescotford.co.uk/?p=242
Be careful about left/right shift, and any instruction that uses the I register as input (some of them modify its value, others don't)
would be possible if we add an instruction (λ) which calls SB code, the accumulator points to a SB instruction pointer, and the stack is actually the combination of HQ9 commands before a λ and after the last call of λand the output would be the normal hq9 output and the sb code output would be outputted to an output file aaaa i feel nausea i need to sleep
Be careful, there is a lot of incorrect documentation (particularly the 2 most popular: http://devernay.free.fr/hacks/chip8/C8TECH10.HTM and http://mattmik.com/files/chip8/mastering/chip8.html) The most accurate I've found is http://laurencescotford.co.uk/?p=242 Be careful about left/right shift, and any instruction that uses the I register as input (some of them modify its value, others don't)Luckily, didn't use any of those pages :p The one you linked as accurate seems indeed pretty accurate (lol), I'll be definitely saving it in my bookmarks. Thanks!
It's definitely worth adding emulator settings/quirksmodes because a lot of modern ROMs may have been written assuming inaccurate emulation (and it increases the versatility and use of the emulator as it is.)Be careful, there is a lot of incorrect documentation (particularly the 2 most popular: http://devernay.free.fr/hacks/chip8/C8TECH10.HTM and http://mattmik.com/files/chip8/mastering/chip8.html) The most accurate I've found is http://laurencescotford.co.uk/?p=242 Be careful about left/right shift, and any instruction that uses the I register as input (some of them modify its value, others don't)Luckily, didn't use any of those pages :p The one you linked as accurate seems indeed pretty accurate (lol), I'll be definitely saving it in my bookmarks. Thanks!
Perhaps, but that basically just encourages people to continue writing broken software.It's definitely worth adding emulator settings/quirksmodes because a lot of modern ROMs may have been written assuming inaccurate emulation (and it increases the versatility and use of the emulator as it is.)Be careful, there is a lot of incorrect documentation (particularly the 2 most popular: http://devernay.free.fr/hacks/chip8/C8TECH10.HTM and http://mattmik.com/files/chip8/mastering/chip8.html) The most accurate I've found is http://laurencescotford.co.uk/?p=242 Be careful about left/right shift, and any instruction that uses the I register as input (some of them modify its value, others don't)Luckily, didn't use any of those pages :p The one you linked as accurate seems indeed pretty accurate (lol), I'll be definitely saving it in my bookmarks. Thanks!
I just noticed something about the call stack that I hadn't thought about before.
From http://laurencescotford.co.uk/?p=75:
First up is the stack. This occupies the 48 bytes from 0x06A0 to 0x06CF. This is sufficient to allow 12 levels of nested subroutines. The stack is filled from 0x6CF downwards.If you try to call more than 12 nested subroutines, the stack will just extend into the program space. As long as the code isn't too long, that will normally be fine. though I suppose technically this should be considered "undefined behavior" (and besides, when would you ever need more than 12 nested calls?), so it probably isn't important.