V Palette Corruption Test ROM

Discuss emulation of the Nintendo Entertainment System and Famicom.
User avatar
CutterCross
Posts: 4
Joined: Tue Jun 28, 2022 8:30 pm

V Palette Corruption Test ROM

Post by CutterCross »

I've recently been helping Fiskbit in the NESdev Discord server with his palette corruption research. I've made a test ROM for analyzing palette corruption behavior from disabling rendering midframe. [NTSC only]

https://www.youtube.com/watch?v=izKX3KgAMX0

This test lets you specify a value to write to the internal PPU register v immediately before disabling rendering midframe. [Note: v has time to increment 1x or 2x in the 4 CPU cycles between the 2nd $2006 write and the $2001 write to disable rendering. Keep this in mind when observing behavior.]

You can adjust the timing of the $2001 disable write with dot-level granularity. This test uses blaarg's NMI sync library combined with alternating the target scanline every frame so that the timing jitter for the $2001 writes is completely removed. You can optionally select a target BG color or sprite color to overlap the $2001 disable write for different corruption behavior.

You can also control the timing of the render re-enable write independently, also at a dot-level granularity.

CONTROLS:

LEFT / RIGHT:
If "SET V" is selected, selects which digit of v to modify.
If "$2001 DISABLE WR." or "$2001 REENABLE WR." is selected, increments / decrements the target dot.

UP / DOWN:
If "SET V" is selected, changes the selected digit of v.
If "$2001 DISABLE WR." is selected, changes the overlap BG color.
If "$2001 REENABLE WR." is selected, changes the overlap Sprite color.

SELECT:
Selects the next parameter to modify.

START:
Refreshes the palette.

B:
Toggles backdrop override color bar display.

A:
Toggles parameter on / off. [Except for "SET V"]

*EDIT: Uploaded V2.6 ROM which fixes a really nasty timing issue when modifying the $2001 disable write target dot with the $2001 disable write OFF but the $2001 re-enable write ON.
You do not have the required permissions to view the files attached to this post.