Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)
You are not logged in.
I'm writing an emulator and I've noticed that Tetris and Super Marioland wait for ff85 (in HRAM) to become non-zero. I've read some reddit threads that say that ff85 gets set by the vblank interrupt but all the memory map documentation I look at say it's just another HRAM register, nothing special. Is there a good place to read about how this part of the Game Boy works? Are there any other interrupts that write to HRAM? Thanks
Offline
You need to emulate the interrupts.
http://gbdev.gg8.se/wiki/articles/Interrupts
Offline
Thanks, but your link doesn't mention how the interrupts should affect HRAM. It would be helpful to know this so that a) I can emulate it accurately and b) I'd like to write my own game, so I need to know which parts of HRAM aren't going to be overwritten by the CPU.
Offline
Interrupt handlers are code. The interrupt handler may modify HRAM, read WRAM, etc.
HRAM is just RAM, the game does whatever it wants with it.
Offline
When VBL starts, the IRQ handler is triggered. Your current execution is interrupted and the CPU jumps to the handler. The handler can do anything, including modifying HRAM to set a flag in any address there. Then, when you exit the handler, the original execution sees that the HRAM address has magically changed.
Offline