Alleyway disappearing background and sprites [solved]

Discussion of programming and development for the original Game Boy and Game Boy Color.
Post Reply
User avatar
zeroone
Posts: 939
Joined: Mon Dec 29, 2014 1:46 pm
Location: New York, NY
Contact:

Alleyway disappearing background and sprites [solved]

Post by zeroone »

After partially implementing Serial Data Transfer to simulate no attached link cable, Alleyway and Yoshi start up properly. Yoshi works perfectly, but Alleyway exhibits an unusual graphical glitch. When the ball bounces off of the side walls and when it strikes bricks horizontally, the background and sprites disappear for one frame. Only the tiles in the Window remain. It looks like a white flash and it is not present in other emulators. Logging shows that the OAM sprite coordinates are all set to 0, hiding them during the flash. Anyone else seen this issue before or have suggestions on how to track down the cause? Thanks.

Edit: During gameplay, once per frame, it writes $E3 to the LCD Control Register ($FF40). It does not deviate from that constant value even during the flashes; the background and sprites are vanishing from some other means.

Edit 2: The background tiles are not disappearing and reappearing as a consequence of VRAM writes. I.e. the game is not clearing and restoring the background to induce flashes. Either, some flag is being set that turns the background off completely. Or, there is a bug in my PPU that makes it not display background tiles for entire frame. I'll keep investigating.

Edit 3: It turns out that the background is not disappearing. Only the sprites are vanishing for a frame. The left wall of the playfield is made up of sprites, not background tiles. This was done because on higher levels, the breakable tiles scroll while the left wall remains stationary. Consequentially, they had to make the stationary layer out of non-background material. Since the OAM sprite coordinates are all set to 0 during the vanish, there might be something wrong with my OAM transfer code.

Edit 4: I finally traced the cause of the issue: It's a bug in my corrupt OAM logic.
Post Reply