nestress menu frozen

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
nestress menu frozen
by on (#140843)
When I run nestress in my emulator, the menu is frozen and unusable. The title at the top does not appear wavy. It's frozen too.

Which features does nestress rely on to be properly emulated to make the menu screen work?
Re: nestress menu frozen
by on (#140848)
I don't know off the top of my head, just make sure sprite 0 hit works? This includes clearing the bit when rendering starts.
Re: nestress menu frozen
by on (#140879)
Dwedit wrote:
I don't know off the top of my head, just make sure sprite 0 hit works? This includes clearing the bit when rendering starts.


Dwedit, thanks for the suggestion, but my emulator passes all of Blarg's sprite 0 hit tests and I have not seen sprite 0 hit issues with other game ROMs.
Re: nestress menu frozen
by on (#140885)
I resolved the issue after some debugging. It was stuck in this loop indefinitely:

Code:
 00:80C0:AD 02 20  LDA $2002
 00:80C3:29 10     AND #$10
 00:80C5:D0 F9     BNE $80C0


From the doc, the lower 5 bits of $2002 are the "least significant bits previously written into a PPU register."

In my implementation, I'm actually capturing the last write to any PPU register into the PPUDATA ($2007) read buffer. I'm not sure if that's correct. But, it let's the NEStress menu work.
Re: nestress menu frozen
by on (#141153)
zeroone wrote:
In my implementation, I'm actually capturing the last write to any PPU register into the PPUDATA ($2007) read buffer. I'm not sure if that's correct. But, it let's the NEStress menu work.

Technically, those are two separate values - the $2007 read buffer is an explicit 8-bit data register, while the 'undefined' bits from $2002 (as well as any write-only register) are merely whatever's floating on the internal I/O data bus (which also happens to be what the PPU uses for the $2007 write buffer).
Re: nestress menu frozen
by on (#141175)
I wonder if such code would mean... this:
Code:
00:80C0:AD 02 20  LDA $2002
 00:80C3:29 10     AND #$80    ;wait for vblank
 00:80C5:D0 F9     BNE $80C0


Makes no sense "AND #$10" on $2002.
Yup, I know this is a poor version of a "wait for vblank" code. ;)