CHIP8 machine typedef, emulating enough instructions for a company logo to display correctly, and printing debug output for instructions.
Errata:
- handle_input(), when pausing/unpausing, prints PAUSED when resuming, not when pausing. That is fixed sometime in the future.
- print_debug_info(), for 0x2NNN calling a subroutine, has the code for setting the PC, not printing debug info. That is fixed later, way later...
- init_chip8(), using %zu for rom_size and max_size gives errors on windows. I later casted these to (unsigned long long) and used %llu so it works on both linux & windows.
Git Repos:
~queso_fuego/chip8_emulator_c
Links:
(for )
(COSMAC VIP instruction manual)
Join the Community Discord:
Contact:
email: fuegoqueso@
twitter: @Queso_Fuego
twitch (if I stream again, may be on youtube idk):
Notes:
- Emulating instructions could be simpler/easier to read by using separate values for registers and an instruction_t type in emulate_instruction(), instead of attaching it to the chip8 struct.
That would remove most of the chip8 dereferencing line noise, but it wouldn’t have the data attached to the chip8 struct allowing 1 single parm to pass all of its associated info. But that isn’t really needed out side of emulating the instructions anyway.
- Another way to print debug info per instruction could be adding a string to the instruction_t type that is filled out and printed at runtime with current instruction and chip8 register data.
That might still need extra code per instruction, but shouldn’t need a full duplicated switch statement in print_debug_info().
Questions about setup/software/etc.?
Check the FAQ:
0:00 getting test roms
3:49 chip8_t typedef & init function
29:42 set paused/resumed state
34:35 instruction_t typedef and start emulating instructions
55:28 print debug output for instructions, continue emulating more things incl. DXYN to draw sprites
1:24:52 update_screen() to draw chip8 pixels
1:39:55 finish instructions to draw logo correctly
1:47:20 add pixel outlines
1:49:30 coming up & outro
Music:
Downtown Glow by Ghostrifter & Devyzed
Creative Commons — Attribution-NoDerivs 3.0 Unported — CC BY-ND 3.0
Music promoted by
#chip8 #emulator #programming
1 view
33
7
2 months ago 00:20:45 1
C64 - SD2IEC Setup including Multi Disk Games
2 months ago 00:19:00 1
ТАНК 300 и ТАНК 500 - РЖАВЧИНА, МЕТАЛЛИЧЕСКАЯ СТРУЖКА и ЭМУЛЬСИЯ В МОСТАХ.ВНИМАНИЕ МАССОВАЯ ПРОБЛЕМА
2 months ago 00:09:24 35
Chip ’n Dale Rescue Rangers 2 (NES) All secret levels
4 months ago 00:31:07 1
NES Chip ’n Dale Rescue Rangers 2 (FULL GAME COMPLETE)
4 months ago 00:03:44 1
ARCHSPIRE - Drone Corpse Aviator - 8-Bit Cover
4 months ago 00:09:05 4
ТАНК 300 ЭМУЛЬСИЯ В МОСТАХ УЖЕ С ЗАВОДА! СРОЧНО НА ЗАМЕНУ, НЕ ЗАВИСИМО ОТ ПРОБЕГА!
5 months ago 00:00:24 1
CRAB8 | Chip-8 emulator in Rust
5 months ago 01:50:21 2
Super Mario NES Bootlegs & Hacks ULTIMATE Collection||56 Ports