r/EmuDev • u/Creepy_Sherbert_1179 • 13d ago
Extended my GB emulator built in pygame, python to GBC
AI disclaimer: AI was used only for debugging and disassembly, no AI generated code was used ever, and no agentic code as well
Hello everyone, today I wanted to showcase my GBC emulator that I derived from my earlier GB implementation: https://github.com/atifcodesalot/hazelnut-gb-emu. It was a fun (and buggy) experience. The pypy runtime gracefully shouldered the double speed mode! It is also backwards compatible with the GameBoy. Did you know that the DMG compatibility mode introduces actual three new palettes for the original DMG games? Anyways it currently supports MBC 1, 2, 3 and 5. I have no idea how to implement MBC7 for the Kirby Tilt 'n' Tumble 😠not because of the EEPROM but also the accelerometer emulation. Also, still working on the sound! I also plan on implementing serial functions for LAN play (hopefully). What do you think? Would love to discuss technical stuff and implementation details! Enjoy. Oh, and don't forget to clone the repo and play some stuff yourself I recommend Pokemon Yellow
2
u/HowziCanReddit 13d ago
Are you implementing the APU from scratch, or porting a known-good mixing model?
Also, the accelerometer is the hard part. It relies on the cartridge’s PHI clock, and if the CPU enters HALT during a latch read, the clock stops and the sensor returns garbage data. This means your emulator can’t just treat it as a simple memory-mapped register—you’d need to model the latching timing and keep the clock running for at least ~1.2 ms after a latch trigger.