summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCameron Hall <cameronghall@cox.net>2018-01-21 18:14:47 -0600
committerCameron Hall <cameronghall@cox.net>2018-01-21 18:14:47 -0600
commitffb74a0211f750506650b66fe2bcdf7ddf770668 (patch)
tree525a894d2d65ffe7b94b499c040ecc5fe84b401b
parent608e06126acdc8b6d32a0aa71fdc57bc188b8d7b (diff)
match debug ROM
-rw-r--r--sound/music_player_table.inc9
-rw-r--r--src/battle/battle_2.c6
-rw-r--r--src/debug/watanabe_debug_menu.c8
-rw-r--r--src/engine/link.c18
-rw-r--r--src/pokemon/mail.c11
-rw-r--r--sym_bss.txt3
-rw-r--r--sym_common.txt21
-rw-r--r--sym_ewram.txt4
8 files changed, 64 insertions, 16 deletions
diff --git a/sound/music_player_table.inc b/sound/music_player_table.inc
index eadcfc90a..6249a30e1 100644
--- a/sound/music_player_table.inc
+++ b/sound/music_player_table.inc
@@ -1,6 +1,15 @@
+@ TODO: remove the raw pointers
+
.align 2
gMPlayTable:: @ 845545C
+.if DEBUG
+ music_player gMPlay_BGM, 0x3000878, 10, 0
+ music_player gMPlay_SE1, 0x3000B98, 3, 1
+ music_player gMPlay_SE2, 0x3000C88, 9, 1
+ music_player gMPlay_SE3, 0x3000F58, 1, 0
+.else
music_player gMPlay_BGM, 0x30007F8, 10, 0
music_player gMPlay_SE1, 0x3000B18, 3, 1
music_player gMPlay_SE2, 0x3000C08, 9, 1
music_player gMPlay_SE3, 0x3000ED8, 1, 0
+.endif
diff --git a/src/battle/battle_2.c b/src/battle/battle_2.c
index 696f1fde0..03391cf92 100644
--- a/src/battle/battle_2.c
+++ b/src/battle/battle_2.c
@@ -12104,6 +12104,12 @@ void SetActionsAndBanksTurnOrder(void)
}
}
}
+ // Debug ROM has a register swap from the retail ROM.
+ // And doing this seems to fix it.
+#if DEBUG
+ asm("");asm("");asm("");asm("");asm("");asm("");asm("");asm("");asm("");
+ asm("");asm("");asm("");asm("");asm("");asm("");asm("");asm("");
+#endif
gBattleMainFunc = CheckFocusPunch_ClearVarsBeforeTurnStarts;
eFocusPunchBank = 0;
}
diff --git a/src/debug/watanabe_debug_menu.c b/src/debug/watanabe_debug_menu.c
index b0fbebac1..ff6f97933 100644
--- a/src/debug/watanabe_debug_menu.c
+++ b/src/debug/watanabe_debug_menu.c
@@ -7813,7 +7813,7 @@ void debug_80C6FA8()
" ldrh r0, [r1]\n"
" mov r1, #0x0\n"
" mov r2, #0x0\n"
- " bl GetMonSpritePal\n"
+ " bl GetMonSpritePalFromOtIdPersonality\n"
" ldr r1, [r4]\n"
" ldrb r1, [r1, #0x6]\n"
" lsl r1, r1, #0x14\n"
@@ -7832,7 +7832,7 @@ void debug_80C6FA8()
" ldrh r0, [r1]\n"
" mov r1, #0x0\n"
" mov r2, #0x9\n"
- " bl GetMonSpritePal\n"
+ " bl GetMonSpritePalFromOtIdPersonality\n"
" ldr r1, [r4]\n"
" ldrb r1, [r1, #0x6]\n"
" lsl r1, r1, #0x14\n"
@@ -9268,7 +9268,7 @@ void debug_80C7B14()
" ldrh r0, [r1]\n"
" mov r1, #0x0\n"
" mov r2, #0x0\n"
- " bl GetMonSpritePal\n"
+ " bl GetMonSpritePalFromOtIdPersonality\n"
" ldr r1, [r4]\n"
" ldrb r1, [r1, #0x6]\n"
" lsl r1, r1, #0x14\n"
@@ -9287,7 +9287,7 @@ void debug_80C7B14()
" ldrh r0, [r1]\n"
" mov r1, #0x0\n"
" mov r2, #0x9\n"
- " bl GetMonSpritePal\n"
+ " bl GetMonSpritePalFromOtIdPersonality\n"
" ldr r1, [r4]\n"
" ldrb r1, [r1, #0x6]\n"
" lsl r1, r1, #0x14\n"
diff --git a/src/engine/link.c b/src/engine/link.c
index f800f4aad..5785a5a56 100644
--- a/src/engine/link.c
+++ b/src/engine/link.c
@@ -81,7 +81,7 @@ static void sub_80084C8(void);
static void sub_80084F4(void);
static void CheckErrorStatus(void);
-static void CB2_PrintErrorMessage(void);
+void CB2_PrintErrorMessage(void);
static u8 IsSioMultiMaster(void);
static void DisableSerial(void);
static void EnableSerial(void);
@@ -191,9 +191,19 @@ const struct BlockRequest sBlockRequestLookupTable[5] =
static const u8 sTestString[] = _("テストな");
-ALIGNED(4) static const u8 sMagic[] = "GameFreak inc.";
+// TODO: fix the alignment here
-ALIGNED(4) static const u8 sEmptyString[] = _("");
+ALIGNED(4) const u8 sMagic[] = "GameFreak inc.";
+
+#if DEBUG
+const u8 sEmptyString[] = _(" ");
+#else
+ALIGNED(4) const u8 sEmptyString[] = _("");
+#endif
+
+#if DEBUG
+const u8 linkDebugFillerPleaseRemove[2] = {0};
+#endif
void Task_DestroySelf(u8 taskId)
{
@@ -1395,7 +1405,7 @@ void CB2_LinkError(void)
SetMainCallback2(CB2_PrintErrorMessage);
}
-static void CB2_PrintErrorMessage(void)
+void CB2_PrintErrorMessage(void)
{
u8 array[32] __attribute__((unused)); // unused
u8 array2[32] __attribute__((unused)); // unused
diff --git a/src/pokemon/mail.c b/src/pokemon/mail.c
index 3187fef9f..11851410b 100644
--- a/src/pokemon/mail.c
+++ b/src/pokemon/mail.c
@@ -68,11 +68,6 @@ struct MailGraphics
u16 color12;
};
-#if DEBUG
-// should be static
-__attribute__((section(".bss"))) u8 unk_debug_bss_2;
-#endif
-
const u16 gUnknown_083E562C[][2] =
{
{0x6ACD, 0x51A5},
@@ -977,7 +972,7 @@ void debug_sub_810C910()
" .align 2, 0\n"
"._143:\n"
" .word gPaletteFade\n"
- " .word unk_debug_bss_2\n"
+ " .word gUnknown_0300074C\n"
" .word gSaveBlock1\n"
" .word gSpecialVar_0x8005\n"
" .word 0x2b6c\n"
@@ -1529,7 +1524,7 @@ void debug_sub_810CD9C()
"._192:\n"
" .align 2, 0\n"
"._191:\n"
- " .word unk_debug_bss_2\n"
+ " .word gUnknown_0300074C\n"
" .word gSpecialVar_0x8004\n"
" .word gSpecialVar_0x8005\n"
" .word gSpecialVar_0x8006\n"
@@ -2372,7 +2367,7 @@ void debug_sub_810D388()
"._300:\n"
" .align 2, 0\n"
"._299:\n"
- " .word unk_debug_bss_2\n"
+ " .word gUnknown_0300074C\n"
" .word 0x43c\n"
"._297:\n"
" bl ScanlineEffect_Stop\n"
diff --git a/sym_bss.txt b/sym_bss.txt
index 16f8c7874..a00532ec7 100644
--- a/sym_bss.txt
+++ b/sym_bss.txt
@@ -15,6 +15,9 @@
. = ALIGN(4); src/engine/text_window.o(.bss);
. = ALIGN(4); src/engine/script.o(.bss);
. = ALIGN(4); src/field/start_menu.o(.bss);
+#if DEBUG
+. += 0x18;
+#endif
. = ALIGN(4); src/engine/menu.o(.bss);
. = ALIGN(4); src/engine/tileset_anim.o(.bss);
. = ALIGN(4); src/engine/sound.o(.bss);
diff --git a/sym_common.txt b/sym_common.txt
index 1297b83b0..366036c9c 100644
--- a/sym_common.txt
+++ b/sym_common.txt
@@ -6,8 +6,14 @@
// main.c
+#if DEBUG
+/*. += 0x18;*/
+#endif
SYMBOL(gKeyRepeatStartDelay, 4)
SYMBOL(gLinkTransferringData, 4)
+#if DEBUG
+. += 0x8;
+#endif
SYMBOL(gMain, 1088)
SYMBOL(gKeyRepeatContinueDelay, 4)
SYMBOL(gSoftResetDisabled, 4)
@@ -272,7 +278,11 @@ SYMBOL(gSoundTestCryNum, 4)
// tv.c
SYMBOL(gUnknown_03005D38, 4)
+#if DEBUG
+. += 0x54;
+#else
. += 0x64; // huge gap?
+#endif
// ???
SYMBOL(gUnknown_03005DA0, 0x48)
@@ -315,7 +325,11 @@ SYMBOL(gFastSaveSection, 4)
SYMBOL(gUnknown_03005EB4, 4)
SYMBOL(gSaveFileStatus, 4)
SYMBOL(gGameContinueCallback, 4)
+#if DEBUG
+. += 0xC;
+#else
. += 0x10;
+#endif
// intro.c
SYMBOL(gIntroFrameCounter, 4)
@@ -339,9 +353,16 @@ SYMBOL(gUnknown_03005F3C, 4)
SYMBOL(gUnknown_03005F40, 4)
SYMBOL(gPokeblockFeedPokeSpriteCopy, 68)
SYMBOL(gUnknown_03005F94, 4)
+#if DEBUG
+SYMBOL(gUnknown_03005FA0, 32)
+#else
SYMBOL(gUnknown_03005FA0, 48)
+#endif
// m4a_2.c
+#if DEBUG
+. += 0x10;
+#endif
SYMBOL(gSoundInfo, 4016)
SYMBOL(gPokemonCrySongs, 104)
SYMBOL(gPokemonCryMusicPlayers, 128)
diff --git a/sym_ewram.txt b/sym_ewram.txt
index 59e3c1e1f..38df657f3 100644
--- a/sym_ewram.txt
+++ b/sym_ewram.txt
@@ -490,7 +490,11 @@ gUnknown_0203926A = .; /* 203926A */
/* ??? */
+#if DEBUG
+ . = ALIGN(8);
+#else
. = ALIGN(16);
+#endif
gTileBuffer = .; /* 2039360 */
. += 0x100;