From 9681d71c924db5481323882f47d7644bbb97ff54 Mon Sep 17 00:00:00 2001 From: Kaz Date: Sun, 13 Sep 2020 04:08:13 -0400 Subject: shop.c: The do {} is actually a fakematch. Turns out we were using the wrong macro the whole time. --- src/shop.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'src') diff --git a/src/shop.c b/src/shop.c index 3e399f0da..d5c5e55c5 100644 --- a/src/shop.c +++ b/src/shop.c @@ -265,21 +265,7 @@ static void BuyMenuDrawGraphics(void) REG_BG3VOFS = 0; gPaletteFade.bufferTransferDisabled = 1; - /* - THEORY: This seemingly useless loop is required in order to match this - function without hacks. The reason is because it alters the 0 optimization - of a later assignment into using 2 different 0s instead of the same register. - It is speculated that at some point Game Freak insert an artificial - breakpoint here in order to look at the contents of OAM before it is cleared, - possibly because a programmer made a mistake in shop.c which corrupted its - contents. There may have been a macro here which at one point idled on the - while(1) but was changed to 0 for release due to a define somewhere. A - while(0) also matches, but it is more correct to use do {} while(0) as it - was a fix to prevent compiler warnings on older compilers. - */ - do {} while(0); - - DmaFill32Defvars(3, 0, (void*)OAM, OAM_SIZE); + Dma3FillLarge32_(0, (void*)OAM, OAM_SIZE); LZDecompressVram(gBuyMenuFrame_Gfx, (void*)(VRAM + 0x7C00)); LZDecompressWram(gBuyMenuFrame_Tilemap, ewram18000_2); LoadCompressedPalette(gMenuMoneyPal, 0xC0, sizeof(gMenuMoneyPal)); -- cgit v1.2.3