Gameboy Development Forum

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.

Ads

#1 2018-07-24 02:46:22

RobinW
New member
Registered: 2018-07-24
Posts: 2

Lack of documentation on vblank interrupts

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

 

#2 2018-07-24 04:40:13

ISSOtm
Member
From: Somewhere in Echo RAM
Registered: 2017-04-18
Posts: 160
Website

Re: Lack of documentation on vblank interrupts

You need to emulate the interrupts.
http://gbdev.gg8.se/wiki/articles/Interrupts


The French Lord Of Laziness.
Legend of Zelda and Undertale fan, I also tend to break Pokémon R/B/Y a little too much.

Twitter | Me on GCL | Discord : ISSOtm#9015 | Skype : isso.tm (I don't login anymore)

Offline

 

#3 2018-07-24 05:38:45

RobinW
New member
Registered: 2018-07-24
Posts: 2

Re: Lack of documentation on vblank interrupts

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

 

#4 2018-07-24 09:56:50

ISSOtm
Member
From: Somewhere in Echo RAM
Registered: 2017-04-18
Posts: 160
Website

Re: Lack of documentation on vblank interrupts

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.


The French Lord Of Laziness.
Legend of Zelda and Undertale fan, I also tend to break Pokémon R/B/Y a little too much.

Twitter | Me on GCL | Discord : ISSOtm#9015 | Skype : isso.tm (I don't login anymore)

Offline

 

#5 2018-07-25 15:22:37

AntonioND
Member
Registered: 2014-06-17
Posts: 134
Website

Re: Lack of documentation on vblank interrupts

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

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson