I am having trouble getting the screen to display right if I increment vram address after a $2007 read.
If not increment vram address after read:
If increment vram address after read:
I know both screens are not right but it is worse if I increment vram address. Has anyone run into the same issue before?
$2007 read help
Moderator: Moderators
Re: $2007 read help
Did you ensure to be incremented by 1 or 32 correctly? (I don't know if that will cause the problem here or not, but that is what I can think of right now.)
(Free Hero Mesh - FOSS puzzle game engine)
- rainwarrior
- Posts: 8732
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
- Contact:
Re: $2007 read help
Not directly about incrementing, but do you know that reads from $2007 (except the palette) are buffered? There is one byte of storage between the $2007 read and the result that gets loaded into your register, so you get the byte from the previous PPU address read, not the current one.
Some info here: Wiki: PPU registers
Some info here: Wiki: PPU registers
Re: $2007 read help
That... and probably wrong palette mirroring.rainwarrior wrote:Not directly about incrementing, but do you know that reads from $2007 (except the palette) are buffered? There is one byte of storage between the $2007 read and the result that gets loaded into your register, so you get the byte from the previous PPU address read, not the current one.
Some info here: Wiki: PPU registers
Re: $2007 read help
It may look worse at first glance, but you can at least make out some of the game's title, which is completely absent in the other shot.JSBryan wrote:I know both screens are not right but it is worse if I increment vram address.
SMB is known for reading the title screen data from the CHR-ROM, and people get wrong at first for not implementing the 1-byte delay that exists when reading $2007. When the CPU reads $2007, it gets a buffered value, and the value at the location indicated by the VRAM address register gets loaded into the buffer, so it will be returned to the CPU on the *next* read. The only exception to this is when reading from the palette area, in which case values are returned immediately (the value in the mirrored name table underneath is still loaded into the buffer, though).
Another thing this game is famous for relying on is palette mirroring. If you don't get this right, you get those black boxes around stuff.
Re: $2007 read help
The first one is missing the "SUPER MARIO BROS" logo, hinting that the reads are not working correctly.
Second one has a space after each character, hinting that the writes are incrementing the PPU address twice.
Second one has a space after each character, hinting that the writes are incrementing the PPU address twice.
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
Re: $2007 read help
Thank you all for your helps. It turns out and correct me if I am wrong. We are supposed to increment VRAM address only once PER instruction. Before the fix I incremented VRAM address after each read or write. So I actually incremented it twice in one instruction. I also fixed the palette issue and now it looks fine.
- rainwarrior
- Posts: 8732
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
- Contact: