diff --git a/asm/emerald.s b/asm/emerald.s index 82b5bab04..b218d186c 100644 --- a/asm/emerald.s +++ b/asm/emerald.s @@ -342,7 +342,7 @@ ConvertIntToDecimalString: ; 8008CC0 adds r5, r0, 0 cmp r5, 0 ble @08008D60 - ldr r0, =gUnknown_082EC7D4 + ldr r0, =gDigits mov r8, r0 @08008CEE: adds r0, r6, 0 @@ -442,7 +442,7 @@ ConvertUnsignedIntToDecimalString: ; 8008D70 adds r5, r0, 0 cmp r5, 0 ble @08008E10 - ldr r0, =gUnknown_082EC7D4 + ldr r0, =gDigits mov r8, r0 @08008D9E: adds r0, r6, 0 @@ -552,7 +552,7 @@ ConvertIntToHexString: ; 8008E20 adds r5, r1, 0 cmp r5, 0 ble @08008ECA - ldr r0, =gUnknown_082EC7D4 + ldr r0, =gDigits mov r9, r0 @08008E5E: mov r0, r8 @@ -943,7 +943,7 @@ GetExpandedStringRef: ; 80090D8 push {lr} cmp r0, 0xD bhi @080090F0 - ldr r1, =gUnknown_082EC818 + ldr r1, =gStringRefFunctionTable lsls r0, 2 adds r0, r1 ldr r0, [r0] @@ -1224,7 +1224,7 @@ GetExtendedControlCodeLength: ; 800927C movs r0, 0 cmp r1, 0x18 bhi @0800928E - ldr r0, =gUnknown_082EC850 + ldr r0, =gExtendedControlCodeLengths adds r0, r1, r0 ldrb r0, [r0] @0800928E: diff --git a/data/data2.s b/data/data2.s index a5d53cbd4..02f387c78 100644 --- a/data/data2.s +++ b/data/data2.s @@ -194,32 +194,10 @@ gUnknown_82EC7CC: ; 82EC7CC .2byte 0x0004 .2byte 0x0008 -gUnknown_082EC7D4: ; 82EC7D4 - .incbin "base_emerald.gba", 0x2ec7d4, 0x10 +; 82EC7D4 + .include "data/string_util.s" -gPowersOfTen: ; 82EC7E4 - .4byte 1 - .4byte 10 - .4byte 100 - .4byte 1000 - .4byte 10000 - .4byte 100000 - .4byte 1000000 - .4byte 10000000 - .4byte 100000000 - .4byte 1000000000 - -gUnknown_082EC80C: ; 82EC80C - .incbin "base_emerald.gba", 0x2ec80c, 0x4 - -gUnknown_082EC810: ; 82EC810 - .incbin "base_emerald.gba", 0x2ec810, 0x8 - -gUnknown_082EC818: ; 82EC818 - .incbin "base_emerald.gba", 0x2ec818, 0x38 - -gUnknown_082EC850: ; 82EC850 - .incbin "base_emerald.gba", 0x2ec850, 0x1c + .align 2, 0 gUnknown_082EC86C: ; 82EC86C .incbin "base_emerald.gba", 0x2ec86c, 0x20 diff --git a/data/string_util.s b/data/string_util.s new file mode 100644 index 000000000..e6ee59d12 --- /dev/null +++ b/data/string_util.s @@ -0,0 +1,67 @@ +gDigits: ; 82EC7D4 + .charmapstr "0123456789ABCDEF" + + .align 2, 0 + +gPowersOfTen: ; 82EC7E4 + .4byte 1 + .4byte 10 + .4byte 100 + .4byte 1000 + .4byte 10000 + .4byte 100000 + .4byte 1000000 + .4byte 10000000 + .4byte 100000000 + .4byte 1000000000 + +gUnknown_082EC80C: ; 82EC80C + .incbin "base_emerald.gba", 0x2ec80c, 0x4 + +gUnknown_082EC810: ; 82EC810 + .incbin "base_emerald.gba", 0x2ec810, 0x8 + + .align 2, 0 + +gStringRefFunctionTable: ; 82EC818 + .4byte StringRef_GetPossiblyUnusedStringVar + .4byte StringRef_GetPlayerName + .4byte StringRef_GetStringVar1 + .4byte StringRef_GetStringVar2 + .4byte StringRef_GetStringVar3 + .4byte StringRef_GetDummiedOutGenderDependentString + .4byte StringRef_GetRivalName + .4byte StringRef_GetEmeraldString + .4byte StringRef_GetAquaString + .4byte StringRef_GetMagmaString + .4byte StringRef_GetArchieString + .4byte StringRef_GetMaxieString + .4byte StringRef_GetKyogreString + .4byte StringRef_GetGroudonString + +gExtendedControlCodeLengths: ; 82EC850 + .byte 1 + .byte 2 + .byte 2 + .byte 2 + .byte 4 + .byte 2 + .byte 2 + .byte 1 + .byte 2 + .byte 1 + .byte 1 + .byte 3 + .byte 2 + .byte 2 + .byte 2 + .byte 1 + .byte 3 + .byte 2 + .byte 2 + .byte 2 + .byte 2 + .byte 1 + .byte 1 + .byte 1 + .byte 1