diff options
author | GriffinR <griffin.g.richards@gmail.com> | 2021-03-18 15:25:46 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-18 15:25:46 -0400 |
commit | ed16a7409ae9c808a110975dec1930f9f949a6d6 (patch) | |
tree | 662be8b474b9c50264fc49262cbaf21769479516 /src/main.c | |
parent | 5075067ecd8718ab96a063946662c71fe3ef5369 (diff) | |
parent | c5aa5d37229e5692355e4b3979b6cafbcad7caee (diff) |
Merge pull request #403 from PikalaxALT/battle_multi_buffer
Battle documentation (14032021)
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/src/main.c b/src/main.c index 1573a2c5b..2f039c23b 100644 --- a/src/main.c +++ b/src/main.c @@ -67,9 +67,15 @@ IntrFunc gIntrTable[INTR_COUNT]; bool8 gLinkVSyncDisabled; u32 IntrMain_Buffer[0x200]; u8 gPcmDmaCounter; -u8 gUnknown_3003578; -u8 gUnknown_3003D80; -u8 gUnknown_3003D84; + +// These variables are not defined in RS or Emerald, and are never read. +// They were likely used to debug the audio engine and VCount interrupt. +// Define NDEBUG in include/config.h to remove these variables. +#ifndef NDEBUG +u8 sVcountAfterSound; +u8 sVcountAtIntr; +u8 sVcountBeforeSound; +#endif static IntrFunc * const sTimerIntrFunc = gIntrTable + 0x7; @@ -369,11 +375,15 @@ static void VBlankIntr(void) gPcmDmaCounter = gSoundInfo.pcmDmaCounter; - gUnknown_3003D84 = REG_VCOUNT; +#ifndef NDEBUG + sVcountBeforeSound = REG_VCOUNT; +#endif m4aSoundMain(); - gUnknown_3003578 = REG_VCOUNT; +#ifndef NDEBUG + sVcountAfterSound = REG_VCOUNT; +#endif - sub_800DD28(); + TryReceiveLinkBattleData(); Random(); UpdateWirelessStatusIndicatorSprite(); @@ -398,7 +408,9 @@ static void HBlankIntr(void) static void VCountIntr(void) { - gUnknown_3003D80 = REG_VCOUNT; +#ifndef NDEBUG + sVcountAtIntr = REG_VCOUNT; +#endif m4aSoundVSync(); INTR_CHECK |= INTR_FLAG_VCOUNT; gMain.intrCheck |= INTR_FLAG_VCOUNT; |