Wizards and Warriors split screen glitch

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Wizards and Warriors split screen glitch
by on (#107230)
I accidentally introduced a bug in my emulator and I'm having a hell of a time tracking it down. There is a glitch around where it splits the screen when your playing the game. I'm pretty sure its due to the game setting 2006 durring rendering which is interacting with rendering very oddly.

Here is a dump:
Code:
I/EMUya   ( 6235): Sprite 0 hit 184:8
I/EMUya   ( 6235): $2006 = 20, 185:22
I/EMUya   ( 6235): $2006 = CE, 185:40
I/EMUya   ( 6235): $2006 = 20, 185:142
I/EMUya   ( 6235): $2006 = EE, 185:160
I/EMUya   ( 6235): $2006 = 3F, 185:259
I/EMUya   ( 6235): $2006 = 01, 185:277
I/EMUya   ( 6235): $2006 = 20, 185:337
I/EMUya   ( 6235): $2006 = F0, 186:14
I/EMUya   ( 6235): $2006 = 20, 186:152
I/EMUya   ( 6235): $2006 = D2, 186:170
I/EMUya   ( 6235): $2006 = 3F, 186:260
I/EMUya   ( 6235): $2006 = 05, 186:278
I/EMUya   ( 6235): $2006 = 20, 186:338
I/EMUya   ( 6235): $2006 = D6, 187:15
I/EMUya   ( 6235): $2006 = 20, 187:105
I/EMUya   ( 6235): $2006 = F6, 187:123
I/EMUya   ( 6235): $2006 = 3F, 187:261
I/EMUya   ( 6235): $2006 = 09, 187:279
I/EMUya   ( 6235): $2006 = 21, 188:19
I/EMUya   ( 6235): $2006 = 29, 188:40
I/EMUya   ( 6235): $2006 = 20, 188:229
I/EMUya   ( 6235): $2006 = 60, 188:247
I/EMUya   ( 6235): $2005 = 08, 188:265
I/EMUya   ( 6235): $2006 = 20, 246:269
I/EMUya   ( 6235): $2006 = DA, 246:287
I/EMUya   ( 6235): $2006 = 21, 247:180
I/EMUya   ( 6235): $2006 = 20, 247:201
I/EMUya   ( 6235): $2006 = 23, 250:228
I/EMUya   ( 6235): $2006 = D0, 250:249
I/EMUya   ( 6235): $2006 = 20, 251:76
I/EMUya   ( 6235): $2006 = 08, 251:97
I/EMUya   ( 6235): $2006 = 3F, 253:81
I/EMUya   ( 6235): $2006 = 1D, 253:99
I/EMUya   ( 6235): $2006 = 3F, 253:180
I/EMUya   ( 6235): $2006 = 01, 253:198
I/EMUya   ( 6235): $2006 = 21, 255:224
I/EMUya   ( 6235): $2006 = 29, 255:299
I/EMUya   ( 6235): $2006 = 21, 256:144
I/EMUya   ( 6235): $2006 = 29, 256:165
I/EMUya   ( 6235): $2006 = 10, 256:204
I/EMUya   ( 6235): $2006 = A0, 256:216
I/EMUya   ( 6235): $2006 = 1B, 258:326
I/EMUya   ( 6235): $2006 = 80, 259:3
I/EMUya   ( 6235): $2006 = 20, -1:14
I/EMUya   ( 6235): $2006 = 00, -1:32
I/EMUya   ( 6235): $2005 = 40, -1:53
I/EMUya   ( 6235): $2005 = 86, -1:74


The format of the debug info is:
register = value, y:x

This has to be a timing issue, right?
Re: Wizards and Warriors split screen glitch
by on (#107238)
Screenshot?
Re: Wizards and Warriors split screen glitch
by on (#107242)
http://imgur.com/jPW8uu4
Re: Wizards and Warriors split screen glitch
by on (#107246)
PPU rendering is disabled on those lines, so be sure that you're outputting the correct value (PPU palette entry 0, unless vram address = $3F00-$3FFF; see http://wiki.nesdev.com/w/index.php/PPU_palettes).

My guess is that you're outputting color 0 here instead of the value of palette entry 0.
Re: Wizards and Warriors split screen glitch
by on (#107275)
Yup, right on. When I optimized part of the code I forgot to take into account the 0x3F00 part and accidentally introduced a bug! Thanks! :)