nesdev.com
http://forums.nesdev.com/

Difference (Unl) shakes in my emulator
http://forums.nesdev.com/viewtopic.php?f=3&t=15484
Page 5 of 6

Author:  Zepper [ Mon Feb 20, 2017 4:23 pm ]
Post subject:  Re: Difference (Unl) shakes in my emulator

@fred - I added a delay of 3 PPU cycles, there's no flickering scores in those games. By the way, your test displays correct triangles if I press down and right a few times. Is this correct or... should be fine since the startup?

Author:  fred [ Mon Feb 20, 2017 5:19 pm ]
Post subject:  Re: Difference (Unl) shakes in my emulator

Pressing down and right makes the 2006 write happen later so it's likely it should be that way, yes. I don't know what an actual nes shows.

tepples: Neato image! Too bad i placed the tiles on row 0. I'll try to lower them, but adjusting any timing is a real pain, haha. Adjusting just about anything is a pain - I'd remove up/down and make left/right smarter and display the current dot offset if I could simply add it.

Author:  Zepper [ Mon Feb 20, 2017 6:06 pm ]
Post subject:  Re: Difference (Unl) shakes in my emulator

fred wrote:
Pressing down and right makes the 2006 write happen later so it's likely it should be that way, yes. I don't know what an actual nes shows.

I got bad triangles in older versions of my emulator. I believe to be in the right way. ^_^;;

Author:  zeroone [ Tue Feb 21, 2017 7:48 am ]
Post subject:  Re: Difference (Unl) shakes in my emulator

fred wrote:
Pressing down and right makes the 2006 write happen later so it's likely it should be that way, yes. I don't know what an actual nes shows.


Thanks for getting the ball rolling on this test ROM. Can we get it onto real hardware to see if the PPU v-register write delay actually exists? And, possibly to measure that delay?

Author:  fred [ Tue Feb 21, 2017 9:05 am ]
Post subject:  Re: Difference (Unl) shakes in my emulator

Turns out it wasn't too bad to simplify the controls! Phew. Also managed to print the current offset. I'd still like to add an explanation in there and move the tiles down, but that's for another time.

Press right or left to increase or decrease the dot offset by one, respectively.

For example, in nintedulator: the second "sta 0x2006" starts at dots 236-237 at offset 0, and dots 244-245 at offset 8 (max).
Offset 0-5: t->v happens before the Y inc.
Offset 6: t->v happens both before and after the Y inc. (shakes)
Offset 7-8: t->v happens after the Y inc.

Do note that this is simply what nintendulator does, other emulators and hardware might differ.

As per usual, you can get the latest version from github (direct link to the rom).

Author:  Zepper [ Tue Feb 21, 2017 9:58 am ]
Post subject:  Re: Difference (Unl) shakes in my emulator

fred wrote:
For example, in nintedulator: the second "sta 0x2006" starts at dots 236-237 at offset 0, and dots 244-245 at offset 8 (max).
Offset 0-5: t->v happens before the Y inc.
Offset 6: t->v happens both before and after the Y inc. (shakes)
Offset 7-8: t->v happens after the Y inc.

Triangles are OK on offset 7 here.

Author:  Sour [ Tue Feb 21, 2017 3:05 pm ]
Post subject:  Re: Difference (Unl) shakes in my emulator

I made the change on Mesen to see the impact it could have.
It seems to fix Bart vs. the Space Mutants (USA), and doesn't break anything that I have noticed.

Out of the 223 automatic test roms I run on Mesen, only the following had a different visual output after the change:
Code:
50) full_palette failed (477)
51) full_palette_smooth failed (325)
206) NEStress failed (80)
218) test_ppu_read_buffer failed (19)
Number in parenthesis = number of frames that do not match the original recording for the test.
Note that all 4 tests still pass, it's just that some frames have been affected by the change.

On top of the test roms, I also have 49 game test scenarios, a few of them have changes:
Code:
10) Dragon Ball 3 - Gokuu Den (J) [!] failed (114)
17) Crisis Force (J) [!] failed (1)
29) Megaman III (U) [!] failed (293)
33) Super Mario Bros. 3 (J) (PRG1) [!] failed (3)
34) Castlevania III - Dracula's Curse (U) [!] failed (1)
36) Laser Invasion (U) [!] failed (1)
38) Klax (Tengen) [!] failed (2)
39) Skull & Crossbones (Tengen) [!] failed (178)
46) Fantastic Adventures of Dizzy, The (USA) failed (42)
48) MiG 29 - Soviet Fighter (USA) failed (222)
(Also: The Battletoads test is not affected by this change, but my test only covers the loading of level 1, it doesn't test the potential freezes on level 2)

I've checked all the games with a large amount of changed frames (>10) and visually, they appear to be no better or worse than before. All of these games have "glitches" on the screen due to imperfect screen splits, so I am assuming that the way the glitch displays may be slightly affected by this change.

Pre-fix, Mesen only displays the test's triangles properly at offset 7 & 8. (Offset 6 = unstable picture)
Post-fix, the triangles display properly for offsets 5, 6, 7 & 8. (Offset 4 = unstable picture)

So, this would still need to be validated on a NES, but it seems like the delay on the VRAM update after a $2006 write may actually be a thing.

Edit: It also fixes the screen shaking during the introduction sequence in Wizards & Warriors III (USA).

Author:  zeroone [ Wed Feb 22, 2017 9:31 pm ]
Post subject:  Re: Difference (Unl) shakes in my emulator

Related to this discussion, does NMI suppression suggest that asserting NMI is actually delayed by a few PPU cycles? Meaning, the suppression is just a consequence of the delay (i.e. the flag is changed before the delay expired; so, it had no effect).

Author:  Zepper [ Thu Feb 23, 2017 2:52 pm ]
Post subject:  Re: Difference (Unl) shakes in my emulator

zeroone wrote:
Related to this discussion, does NMI suppression suggest that asserting NMI is actually delayed by a few PPU cycles? Meaning, the suppression is just a consequence of the delay (i.e. the flag is changed before the delay expired; so, it had no effect).

What's the relationship between $2006 delay and... NMIs? What?

Author:  Sour [ Sat Feb 25, 2017 1:51 pm ]
Post subject:  Re: Difference (Unl) shakes in my emulator

Is there any chance someone could run fred's test on a NES and see what the results are? (i.e how are the triangles displayed for each of the 8 offset values)
The actual result is probably hidden on CRTs due to overscan, but I'm assuming capture cards should still be able to record it?

At the moment, (in Mesen) this change fixes Bart vs. the Space Mutants and Wizards & Warriors III. It also lets me remove an old patch I had implemented for Kick Master (and Kick Master still works correctly). Also, it makes blargg's full palette demo perfectly centered, instead of left aligned (and sometimes having 1 pixel cut off on the left side of the screen).

Author:  zeroone [ Sat Feb 25, 2017 3:11 pm ]
Post subject:  Re: Difference (Unl) shakes in my emulator

The status bar in Bart vs. the Space Mutants and the castle scene in the intro of Wizards & Warriors III shake in Nintendulator 975, but they do not shake in Nintendulator 970. The primary difference between them is that version 970 contains a hack in which the X and Y increments occur 4 PPU cycles earlier than their actual scheduled times. It sounds likely that the delayed v-register write may fix that problem there also.

What was the Kick Master issue?

Author:  Zepper [ Sat Feb 25, 2017 3:21 pm ]
Post subject:  Re: Difference (Unl) shakes in my emulator

zeroone wrote:
What was the Kick Master issue?

viewtopic.php?p=172287#p172287

Author:  zeroone [ Sat Feb 25, 2017 3:38 pm ]
Post subject:  Re: Difference (Unl) shakes in my emulator

That link does not describe the Kick Masters issue. Was the title screen shaking?

Incredible Crash Dummies shakes in Nintendulator 975, but not in 970. The 970 hack actually seems to solve a lot of problems.

Author:  Zepper [ Sat Feb 25, 2017 4:34 pm ]
Post subject:  Re: Difference (Unl) shakes in my emulator

zeroone wrote:
That link does not describe the Kick Masters issue. Was the title screen shaking?

Incredible Crash Dummies shakes in Nintendulator 975, but not in 970. The 970 hack actually seems to solve a lot of problems.

How so?
The Kick Master issue was caused by a race condition (write to $2006 at the same time as the cycle 256 Y scrolling increment). The game expects the $2006 value to win and the scrolling increment to be ignored (but it wasn't), which produced the weird effect on the title screen.


And... Crash Dummies is NOT a MMC3, but a submapper with a different IRQ behaviour.

Author:  zeroone [ Sat Feb 25, 2017 4:40 pm ]
Post subject:  Re: Difference (Unl) shakes in my emulator

Zepper wrote:
How so?
The Kick Master issue was caused by a race condition (write to $2006 at the same time as the cycle 256 Y scrolling increment). The game expects the $2006 value to win and the scrolling increment to be ignored (but it wasn't), which produced the weird effect on the title screen.


And... Crash Dummies is NOT a MMC3, but a submapper with a different IRQ behaviour.


Thanks. But, that describes the cause. I'm still unclear of the observed symptoms. Was the title screen shaking?

Page 5 of 6 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/