From 30e86961a16087ddac569a0865a337011f24cd38 Mon Sep 17 00:00:00 2001 From: andymcca Date: Thu, 27 Jul 2023 15:35:27 +0100 Subject: [PATCH] Don't update background scanline params in mode 0 Noticed that an issue with Rayman 3 Hoodlum Havoc was reported on one of the gpsp compatability lists. Cross-checked against mgba and revealed the same issue reported as being present in an earlier version - https://github.com/mgba-emu/mgba/issues/377 This PR applies the same fix as used in mgba. Could affect other games also. --- video.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/video.c b/video.c index b41f6e7..1dd4d21 100644 --- a/video.c +++ b/video.c @@ -4530,11 +4530,14 @@ void update_scanline(void) render_scanline_bitmap(screen_offset, dispcnt); } } - - affine_reference_x[0] += (s16)read_ioreg(REG_BG2PB); - affine_reference_y[0] += (s16)read_ioreg(REG_BG2PD); - affine_reference_x[1] += (s16)read_ioreg(REG_BG3PB); - affine_reference_y[1] += (s16)read_ioreg(REG_BG3PD); + // Don't update background scanline params in mode 0 + if(video_mode != 0) + { + affine_reference_x[0] += (s16)read_ioreg(REG_BG2PB); + affine_reference_y[0] += (s16)read_ioreg(REG_BG2PD); + affine_reference_x[1] += (s16)read_ioreg(REG_BG3PB); + affine_reference_y[1] += (s16)read_ioreg(REG_BG3PD); + } }