Hi people, I'm writting an nes emu in Golang. The CPU already works nice; but I'm facing some problems to test the PPU emulation. Actually I wrote a basic ppu code trying to make the minium enough to have tiles in scren (no scrolling, no attributes) just background tiles with 4 colors (pattern A + pattern B) (ignoring the color palette).
Now, I just have some static "noise" on screen; I expected to have some dynamic titles (even wrong). The 0x2000 (PPUCTRL) is never called by ROM with NMI_OUTPUT on, so there are no NMI interruptions during VBLANK.
Well, you know more than I how hard it's debug an emulator. I reached in a point that I can't understand whats going on.
Can you guys look my code and try to figure out what I'm doing wrong? This is the repository: https://github.com/jonathandasilvasanto ... rc/zerojnt
The most important files are: cpu.go, ppu.go, ioports.go
Thank you. I'm looking forward any tips or suggestions
This is the github repository:
PPU Emulation O_O
Moderator: Moderators
Re: PPU Emulation O_O
Obvious tests including logging the output of writes to $2006 and $2007.
Feel free to skip the "real" renderer altogether, and just display the contents of PPU memory.
Feel free to skip the "real" renderer altogether, and just display the contents of PPU memory.
Re: PPU Emulation O_O
Thank you. Your answer help me to realize that 2007 and 2006 are never called The problem is something before it.
At this moment the unique registers accessed are 2000 (once) and 2002 (many times)
At this moment the unique registers accessed are 2000 (once) and 2002 (many times)
Re: PPU Emulation O_O
Most games have a delay loop at the beginning, waiting for [$2002] & $80 to be set twice before anything else happens.
(This is because the PPU rejects all writes to most registers after /RESET has been released until 262 total scanlines have been rendered by it)
(This is because the PPU rejects all writes to most registers after /RESET has been released until 262 total scanlines have been rendered by it)
Re: PPU Emulation O_O
The $2000 write is probably turning rendering off, and the $2002 reads are waiting for the vblank flag to get set. All NES programs are supposed to wait a couple of frames before using the PPU. If you don't set this flag, the game will be such in this loop forever.zerojnt wrote:At this moment the unique registers accessed are 2000 (once) and 2002 (many times)
Re: PPU Emulation O_O
Spot-on! You're right The problem was the NMI_OCCURRED update.
Now I have new problems, but I'm not blocked
Thank you.
Now I have new problems, but I'm not blocked
Thank you.