Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Horizontal Blanking Bug
#1
What I am trying to do.
Drawing a hexagonal grid looks better with a 7x8 tile, so during the horizontal blanking interval I am trying to skip the 8th row of every tile. There are 7 drawn rows on each tile and the 8th row that is completely black to make it obvious if something isn't working. The horizontal blanking code is not running as the tiles and background are setup. Once everything is setup the horizontal blanking code is active.

Description of the Symptom.
It reliably skips the 8th row on a Gameboy Advance SP and the visual boy advance emulator, but on mGBA it is showing the 8th row on some tiles on the right edge of the screen. For some reason the row that the cursor is on never has the problem.

My thought.
The thing that would make sense to me is that the horizontal blanking is being triggered early. This is supported by the line the cursor is on never having the issue. The cursor being drawn would delay the horizontal blanking trigger by just a hair preventing it from running the horizontal blanking code early. I tried to see if my code was the issue but I didn't find anything to try to do differently.

Relevant Source Code Pseudo Code:
Setup
0xFF40 |= 0x02
0xFF41 = 0x08
0xFFFF = 0x03
Horizontal Blanking
shift_counter = shift_counter + 1
if(shift_counter == 7) {
shift_counter = 0
horizontal_shift = horizontal_shift + 4
vertical_shift = vertical_shift + 1
0xFF42 = vertical_shift
0xFF43 = horizontal_shift
}


Specifications
mGBA: 0.10.5 flathub system-wide flatpak
OS: Pop!_OS 22.04 LTS (64-bit)
GNOME Version: 42.9
Windowing System: X11
CPU: Intel® Core™ i7-9750H CPU @ 2.60GHz × 12
Graphics Card: Mesa Intel® UHD Graphics 630 (CFL GT2)

Rom and Symptom Image are Attached.
It didn't let me load the rom directly so I changed the file type to txt. Change it back to .gb before using.


Attached Files
.txt   code_rom.txt (Size: 32 KB / Downloads: 2)
.png   Screenshot from 2025-07-05 16-11-47.png (Size: 15.19 KB / Downloads: 2)
Reply

#2
I can reproduce the issue. On mGBA 0.10.5 on Arch Linux the result looks the same as your screenshot. My knowledge of the LCD control stuff isn't deep enough to know why that would happen.
Reply

#3
Please report bugs on the Github issue tracker. They're too easily forgotten about here.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

Powered By MyBB, © 2002-2025 Melroy van den Berg.