From 71131ac86a3caf99d7d3285e7af894b8721e8c4d Mon Sep 17 00:00:00 2001 From: Matthew Berry Date: Tue, 25 May 2021 00:23:34 -0700 Subject: [PATCH] increment affine reference points before hdma This alone seems to fix Golden Sun. Many games like Gadget Racers still don't work, but this seems to be a closer approximation of "correct". Finally, the best game for the GBA is playable... I'm sad that this was all it took to "fix" lol. --- src/crab/gba/ppu.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crab/gba/ppu.cr b/src/crab/gba/ppu.cr index 366aed9..4d3531a 100644 --- a/src/crab/gba/ppu.cr +++ b/src/crab/gba/ppu.cr @@ -47,11 +47,11 @@ module GBA end if @vcount < 160 scanline - @gba.dma.trigger_hdma @bgref_int.each_with_index do |bgrefs, bg_num| bgrefs[0] &+= @bgaff[bg_num][1].num # bgx += dmx bgrefs[1] &+= @bgaff[bg_num][3].num # bgy += dmy end + @gba.dma.trigger_hdma end end