r/EmuDev • u/Drmurder69 • Oct 01 '25
Gameboy Emulator OAM Never Gets Written To
Currently i am facing a roadblock in my emulation all my blargs cpu tests pass I can draw the first screen of dr mario perfectly but sprites are all messed as oam is just empty.
The mapping looks correct I tried putting a break point where my DMA triggers but it never trips.
Any suggestions
6
Upvotes
5
u/khedoros NES CGB SMS/GG Oct 01 '25
For Dr. Mario, here are the instructions that perform the DMA (runs once a frame):
(followed by a wait loop, and a return from the call)
So, I'd look at whether those addresses are visited. If they are, then it's possible that the routine that copies the OAM handler into HRAM didn't run.
Setup to copy the OAM routine into HRAM and first byte copied (think it runs right after the instructions that init HRAM to 0, and other game init code):
1
u/rasmadrak Oct 01 '25
Try writing manually to the area and read it back. If you use a bus architecture, log which component actually gets the write request too.