Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System Div (no BIOS) does not match BIOS System Div #1396

felixjones opened this issue Apr 25, 2019 · 1 comment

System Div (no BIOS) does not match BIOS System Div #1396

felixjones opened this issue Apr 25, 2019 · 1 comment


Copy link

felixjones commented Apr 25, 2019

Attached is a ROM I created that demonstrates a difference between mGBA and hardware no BIOS and with BIOS system division.
VisualBoy Advance closely mimics the result I see on hardware (AGB-001 with AGS-101 backlight). (My BIOS was being used in VBA).

mGBA (no BIOS)

mGBA (with BIOS)

Original ROM information below - feel free to ignore

I had replaced the division calls in my code with the BIOS Div function, before I did this the ROM worked on hardware and mGBA perfectly fine, but after replacing divisions with the BIOS Div this is the result I get.

This uses Mode 1 display with a single affine background.
DMA channel 3 is used with hblank to copy the affine transformation parameters. Channel 0 also demonstrates this same issue.
There is a BIOS IntrWait for VBlank each frame.
The DMA is restarted on VBlank interrupt and the matrices updated immediately after.
Reading and writing occurs on different areas of memory; there is no overlap.

The affine parameters are generated during the interrupt routine, this kind of flickering is what I see when this process takes too long (missing VSync), but it was fine before adding in the BIOS division, using BIOS divisions seems to have caused this.
Divides by zero has been accounted for, even when aggressively checking for them this still occurs.

To clarify: My ROM and code are incorrect and buggy, just that mGBA does not display the bug that hardware (and sort of VBA) displays.

@felixjones felixjones changed the title Mode 1 HBlank DMA + BIOS Div does not match hardware System Div (no BIOS) does not match BIOS System Div Apr 25, 2019
Copy link
Contributor Author

Updated issue now that the problem has been tracked down to System Div without BIOS vs with BIOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

1 participant