From 274cc6a5961cf3668b8fb2f32f026b3b9edd8a7a Mon Sep 17 00:00:00 2001 From: Seth Barberee Date: Fri, 25 Apr 2025 23:33:11 -0700 Subject: [PATCH] moving more data to src --- data/data.s | 578 ++---------------------------------------- ld_script.txt | 1 + src/data/event_flag.h | 180 +++++++++++++ src/event_flag.c | 33 +-- 4 files changed, 211 insertions(+), 581 deletions(-) create mode 100644 src/data/event_flag.h diff --git a/data/data.s b/data/data.s index abae1473c..b63d243ec 100644 --- a/data/data.s +++ b/data/data.s @@ -1,568 +1,34 @@ .section .rodata .align 2, 0 -@ event_flag.c -.string "pksdir0\0" - .align 2, 0 - .global gLocalScriptVarInfo -gLocalScriptVarInfo: - .2byte 5, 7, 0, 0, 1, 0; .4byte gUnknown_80B6D88 - .2byte 5, 7, 2, 0, 1, 0; .4byte gUnknown_80B6D80 - .2byte 5, 7, 4, 0, 1, 0; .4byte gUnknown_80B6D78 - .2byte 5, 7, 6, 0, 1, 0; .4byte gUnknown_80B6D70 + @ event_flag.c -gUnknown_80B6D70: - .string "LOCAL3\0" - .align 2, 0 + .global EventFlagFile_Text + EventFlagFile_Text: + .string "../main/event_flag.c\0" + .align 2,0 -gUnknown_80B6D78: - .string "LOCAL2\0" - .align 2, 0 + .global FlagCalc_Text + FlagCalc_Text: + .string "_FlagCalc\0" + .align 2,0 -gUnknown_80B6D80: - .string "LOCAL1\0" - .align 2, 0 + .global gUnknown_80B7318 + gUnknown_80B7318: @ 80B7318 + .4byte EventFlagFile_Text + .byte 0x51, 0x05, 0x00, 0x00 + .4byte FlagCalc_Text -gUnknown_80B6D88: - .string "LOCAL0\0" - .align 2, 0 + .global gUnknown_80B7324 + gUnknown_80B7324: @ 80B7324 + .string "event flag expansion error %d\0" + .align 2,0 - .global gUnknown_80B6D90 -gUnknown_80B6D90: @ 80B6D90 - .4byte gUnknown_80B7144 - .byte 0x00, 0x00, 0x00, 0x00 - .4byte gUnknown_80B713C - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B7134 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B712C - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B7124 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B711C - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B7114 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B710C - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B7104 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B70FC - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B70F4 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B70EC - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B70E4 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B70DC - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B70D4 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B70CC - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B70C4 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B70BC - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B70B4 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B70AC - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B70A4 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B709C - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B7094 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B708C - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B7084 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B707C - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B7074 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B706C - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B7064 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B705C - .byte 0x01, 0x00, 0x00, 0x00 - .4byte gUnknown_80B7054 - .byte 0x01, 0x00, 0x00, 0x00 - .4byte gUnknown_80B704C - .byte 0x01, 0x00, 0x00, 0x00 - .4byte gUnknown_80B7044 - .byte 0x02, 0x00, 0x00, 0x00 - .4byte gUnknown_80B703C - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B7034 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B702C - .byte 0x03, 0x00, 0x00, 0x00 - .4byte gUnknown_80B7024 - .byte 0x01, 0x00, 0x00, 0x00 - .4byte gUnknown_80B701C - .byte 0x03, 0x00, 0x00, 0x00 - .4byte gUnknown_80B7014 - .byte 0x01, 0x00, 0x00, 0x00 - .4byte gUnknown_80B700C - .byte 0x01, 0x00, 0x00, 0x00 - .4byte gUnknown_80B7004 - .byte 0x01, 0x00, 0x00, 0x00 - .4byte gUnknown_80B6FFC - .byte 0x01, 0x00, 0x00, 0x00 - .4byte gUnknown_80B6FF4 - .byte 0x01, 0x00, 0x00, 0x00 - .4byte gUnknown_80B6FEC - .byte 0x02, 0x00, 0x00, 0x00 - .4byte gUnknown_80B6FE4 - .byte 0x01, 0x00, 0x00, 0x00 - .4byte gUnknown_80B6FDC - .byte 0x03, 0x00, 0x00, 0x00 - .4byte gUnknown_80B6FD4 - .byte 0x01, 0x00, 0x00, 0x00 - .4byte gUnknown_80B6FCC - .byte 0x01, 0x00, 0x00, 0x00 - .4byte gUnknown_80B6FC4 - .byte 0x03, 0x00, 0x00, 0x00 - .4byte gUnknown_80B6FBC - .byte 0x01, 0x00, 0x00, 0x00 - .4byte gUnknown_80B6FB4 - .byte 0x03, 0x00, 0x00, 0x00 - .4byte gUnknown_80B6FAC - .byte 0x01, 0x00, 0x00, 0x00 - .4byte gUnknown_80B6FA4 - .byte 0x03, 0x00, 0x00, 0x00 - .4byte gUnknown_80B6F9C - .byte 0x01, 0x00, 0x00, 0x00 - .4byte gUnknown_80B6F94 - .byte 0x01, 0x00, 0x00, 0x00 - .4byte gUnknown_80B6F8C - .byte 0x02, 0x00, 0x00, 0x00 - .4byte gUnknown_80B6F84 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B6F78 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B6F68 - .byte 0xff, 0xff, 0xff, 0xff - - .global gUnknown_80B6F68 - gUnknown_80B6F68: - .string "DEBUG GROUND\0" - .align 2,0 - .global gUnknown_80B6F78 - gUnknown_80B6F78: - .string "NEXT DAY\0" - .align 2,0 - .global gUnknown_80B6F84 - gUnknown_80B6F84: - .string "R00E01A\0" - .align 2,0 - .global gUnknown_80B6F8C - gUnknown_80B6F8C: - .string "S09E01C\0" - .align 2,0 - .global gUnknown_80B6F94 - gUnknown_80B6F94: - .string "S09E01B\0" - .align 2,0 - .global gUnknown_80B6F9C - gUnknown_80B6F9C: - .string "S09E01A\0" - .align 2,0 - .global gUnknown_80B6FA4 - gUnknown_80B6FA4: - .string "S08E01B\0" - .align 2,0 - .global gUnknown_80B6FAC - gUnknown_80B6FAC: - .string "S08E01A\0" - .align 2,0 - .global gUnknown_80B6FB4 - gUnknown_80B6FB4: - .string "S07E01B\0" - .align 2,0 - .global gUnknown_80B6FBC - gUnknown_80B6FBC: - .string "S07E01A\0" - .align 2,0 - .global gUnknown_80B6FC4 - gUnknown_80B6FC4: - .string "S06E01C\0" - .align 2,0 - .global gUnknown_80B6FCC - gUnknown_80B6FCC: - .string "S06E01B\0" - .align 2,0 - .global gUnknown_80B6FD4 - gUnknown_80B6FD4: - .string "S06E01A\0" - .align 2,0 - .global gUnknown_80B6FDC - gUnknown_80B6FDC: - .string "S05E01B\0" - .align 2,0 - .global gUnknown_80B6FE4 - gUnknown_80B6FE4: - .string "S05E01A\0" - .align 2,0 - .global gUnknown_80B6FEC - gUnknown_80B6FEC: - .string "S04E01F\0" - .align 2,0 - .global gUnknown_80B6FF4 - gUnknown_80B6FF4: - .string "S04E01E\0" - .align 2,0 - .global gUnknown_80B6FFC - gUnknown_80B6FFC: - .string "S04E01D\0" - .align 2,0 - .global gUnknown_80B7004 - gUnknown_80B7004: - .string "S04E01C\0" - .align 2,0 - .global gUnknown_80B700C - gUnknown_80B700C: - .string "S04E01B\0" - .align 2,0 - .global gUnknown_80B7014 - gUnknown_80B7014: - .string "S04E01A\0" - .align 2,0 - .global gUnknown_80B701C - gUnknown_80B701C: - .string "S03E01B\0" - .align 2,0 - .global gUnknown_80B7024 - gUnknown_80B7024: - .string "S03E01A\0" - .align 2,0 - .global gUnknown_80B702C - gUnknown_80B702C: - .string "S02E02B\0" - .align 2,0 - .global gUnknown_80B7034 - gUnknown_80B7034: - .string "S02E02A\0" - .align 2,0 - .global gUnknown_80B703C - gUnknown_80B703C: - .string "S02E01A\0" - .align 2,0 - .global gUnknown_80B7044 - gUnknown_80B7044: - .string "S01E02B\0" - .align 2,0 - .global gUnknown_80B704C - gUnknown_80B704C: - .string "S01E02A\0" - .align 2,0 - .global gUnknown_80B7054 - gUnknown_80B7054: - .string "S01E01B\0" - .align 2,0 - .global gUnknown_80B705C - gUnknown_80B705C: - .string "S01E01A\0" - .align 2,0 - .global gUnknown_80B7064 - gUnknown_80B7064: - .string "S00E01A\0" - .align 2,0 - .global gUnknown_80B706C - gUnknown_80B706C: - .string "M02END\0" - .align 2,0 - .global gUnknown_80B7074 - gUnknown_80B7074: - .string "M02E02H\0" - .align 2,0 - .global gUnknown_80B707C - gUnknown_80B707C: - .string "M02E02G\0" - .align 2,0 - .global gUnknown_80B7084 - gUnknown_80B7084: - .string "M02E02F\0" - .align 2,0 - .global gUnknown_80B708C - gUnknown_80B708C: - .string "M02E02E\0" - .align 2,0 - .global gUnknown_80B7094 - gUnknown_80B7094: - .string "M02E02D\0" - .align 2,0 - .global gUnknown_80B709C - gUnknown_80B709C: - .string "M02E02C\0" - .align 2,0 - .global gUnknown_80B70A4 - gUnknown_80B70A4: - .string "M02E02B\0" - .align 2,0 - .global gUnknown_80B70AC - gUnknown_80B70AC: - .string "M02E02A\0" - .align 2,0 - .global gUnknown_80B70B4 - gUnknown_80B70B4: - .string "M02E01A\0" - .align 2,0 - .global gUnknown_80B70BC - gUnknown_80B70BC: - .string "M01END\0" - .align 2,0 - .global gUnknown_80B70C4 - gUnknown_80B70C4: - .string "M01E10A\0" - .align 2,0 - .global gUnknown_80B70CC - gUnknown_80B70CC: - .string "M01E09A\0" - .align 2,0 - .global gUnknown_80B70D4 - gUnknown_80B70D4: - .string "M01E08B\0" - .align 2,0 - .global gUnknown_80B70DC - gUnknown_80B70DC: - .string "M01E08A\0" - .align 2,0 - .global gUnknown_80B70E4 - gUnknown_80B70E4: - .string "M01E07B\0" - .align 2,0 - .global gUnknown_80B70EC - gUnknown_80B70EC: - .string "M01E07A\0" - .align 2,0 - .global gUnknown_80B70F4 - gUnknown_80B70F4: - .string "M01E06A\0" - .align 2,0 - .global gUnknown_80B70FC - gUnknown_80B70FC: - .string "M01E05B\0" - .align 2,0 - .global gUnknown_80B7104 - gUnknown_80B7104: - .string "M01E05A\0" - .align 2,0 - .global gUnknown_80B710C - gUnknown_80B710C: - .string "M01E04B\0" - .align 2,0 - .global gUnknown_80B7114 - gUnknown_80B7114: - .string "M01E04A\0" - .align 2,0 - .global gUnknown_80B711C - gUnknown_80B711C: - .string "M01E03A\0" - .align 2,0 - .global gUnknown_80B7124 - gUnknown_80B7124: - .string "M01E02B\0" - .align 2,0 - .global gUnknown_80B712C - gUnknown_80B712C: - .string "M01E02A\0" - .align 2,0 - .global gUnknown_80B7134 - gUnknown_80B7134: - .string "M01E01A\0" - .align 2,0 - .global gUnknown_80B713C - gUnknown_80B713C: - .string "M00E01A\0" - .align 2,0 - - .global gUnknown_80B7144 -gUnknown_80B7144: @ 80B7144 - .string "NONE\0" - .align 2,0 - - .global gUnknown_80B714C -gUnknown_80B714C: @ 80B714C - .4byte TwoOneText - .4byte TwoOneText - .4byte OneTwoSevenText - .4byte FourText - .4byte FiveText - .4byte SixText - .4byte TwoTwoEightText - .4byte ThreeText - .4byte NineText - .4byte EndText - - .global EndText - EndText: - .string "END\0" - - .global NineText - NineText: - .string "9\0" - .align 2,0 - - .global ThreeText - ThreeText: - .string "3\0" - .align 2,0 - - .global TwoTwoEightText - TwoTwoEightText: - .string "2-2 8\0" - .align 2,0 - - .global SixText - SixText: - .string "6\0" - .align 2,0 - - .global FiveText - FiveText: - .string "5\0" - .align 2,0 - - .global FourText - FourText: - .string "4\0" - .align 2,0 - - .global OneTwoSevenText - OneTwoSevenText: - .string "1-2 7\0" - .align 2,0 - - .global TwoOneText - TwoOneText: - .string "2-1\0" - .align 2,0 - - .global gUnknown_80B71A0 -gUnknown_80B71A0: @ 80B71A0 - .4byte CISTART_text - .4byte CECONTINUE_text - .4byte CNLAST_text - .4byte CWEND_text - - .global CWEND_text - CWEND_text: - .string "{COLOR RED_W}END{RESET}\0" - .align 2,0 - - .global CNLAST_text - CNLAST_text: - .string "{COLOR YELLOW_N}LAST{RESET}\0" - .align 2,0 - - .global CECONTINUE_text - CECONTINUE_text: - .string "{COLOR GENDER_COLOR}CONTINUE{RESET}\0" - .align 2,0 - - .global CISTART_text - CISTART_text: - .string "{COLOR GREEN_I}START{RESET}\0" - .align 2,0 - - .global gGroundEnterLookupTable -gGroundEnterLookupTable: @ 80B71E4 - @ [struct unkEventStruct] - .2byte 105, 1 - .2byte 106, 2 - .2byte 107, 3 - .2byte 108, 4 - .2byte 109, 5 - .2byte 110, 6 - .2byte 111, 7 - .2byte 112, 8 - .2byte 113, 9 - .2byte 114, 10 - .2byte 115, 11 - .2byte 116, 12 - .2byte 117, 13 - .2byte 118, 14 - .2byte 119, 15 - .2byte 120, 16 - .2byte 121, 17 - .2byte 122, 18 - .2byte 123, 19 - .2byte 124, 20 - .2byte 125, 21 - .2byte 126, 22 - .2byte 127, 23 - .2byte 128, 24 - .2byte 129, 25 - .2byte 130, 26 - .2byte 131, 27 - .2byte 132, 28 - .2byte 133, 29 - .2byte 134, 30 - .2byte 135, 31 - .2byte 136, 32 - .2byte 137, 33 - .2byte 138, 34 - .2byte 139, 35 - .2byte 140, 36 - .2byte 141, 37 - .2byte 142, 38 - .2byte 143, 39 - .2byte 144, 40 - .2byte 145, 41 - .2byte 146, 42 - .2byte 147, 43 - .2byte 148, 44 - .2byte 149, 45 - .2byte 150, 46 - .2byte 151, 47 - .2byte 152, 48 - .2byte 153, 49 - .2byte 154, 50 - .2byte 155, 51 - .2byte 156, 52 - .2byte 157, 53 - .2byte 158, 54 - .2byte 159, 55 - .2byte 160, 56 - .2byte 161, 57 - .2byte -1, 0 - - .global gUnknown_80B72CC -gUnknown_80B72CC: @ 80B72CC - .string "SCENARIO CALC [%3d] %4d %4d -> %4d %4d\0" - .align 2,0 - - .global EventFlagFile_Text - EventFlagFile_Text: - .string "../main/event_flag.c\0" - .align 2,0 - - .global FlagCalc_Text - FlagCalc_Text: - .string "_FlagCalc\0" - .align 2,0 - - .global gUnknown_80B7318 -gUnknown_80B7318: @ 80B7318 - .4byte EventFlagFile_Text - .byte 0x51, 0x05, 0x00, 0x00 - .4byte FlagCalc_Text - - .global gUnknown_80B7324 -gUnknown_80B7324: @ 80B7324 - .string "event flag expansion error %d\0" - .align 2,0 - - .global FlagJudge_Text - FlagJudge_Text: - .string "_FlagJudge\0" - .align 2,0 + .global FlagJudge_Text + FlagJudge_Text: + .string "_FlagJudge\0" + .align 2,0 .global gUnknown_80B7350 gUnknown_80B7350: @ 80B7350 diff --git a/ld_script.txt b/ld_script.txt index d4e849ecb..4f1c5abd4 100755 --- a/ld_script.txt +++ b/ld_script.txt @@ -426,6 +426,7 @@ SECTIONS { ALIGN(4) { src/main_loops.o(.rodata); + src/event_flag.o(.rodata); data/data.o(.rodata); src/code_8002774.o(.rodata); data/pksdir_5.o(.rodata); diff --git a/src/data/event_flag.h b/src/data/event_flag.h new file mode 100644 index 000000000..4b8d53329 --- /dev/null +++ b/src/data/event_flag.h @@ -0,0 +1,180 @@ +struct LocalScriptVarInfo +{ + s16 unk0; + s16 unk2; + s16 unk4; + s16 unk6; + s16 unk8; + s16 unkA; + const u8 *text; +}; + +const struct LocalScriptVarInfo sLocalScriptVarInfo[4] = { + 5, 7, 0, 0, 1, 0, "LOCAL0", + 5, 7, 2, 0, 1, 0, "LOCAL1", + 5, 7, 4, 0, 1, 0, "LOCAL2", + 5, 7, 6, 0, 1, 0, "LOCAL3", +}; + +struct unkStruct_80B6D90 +{ + const u8 *text; + s32 num; +}; + +const u8 gUnknown_80B7144[]; + +const struct unkStruct_80B6D90 gUnknown_80B6D90[59] = { + {gUnknown_80B7144, 0}, + {"M00E01A", -1}, + {"M01E01A", -1}, + {"M01E02A", -1}, + {"M01E02B", -1}, + {"M01E03A", -1}, + {"M01E04A", -1}, + {"M01E04B", -1}, + {"M01E05A", -1}, + {"M01E05B", -1}, + {"M01E06A", -1}, + {"M01E07A", -1}, + {"M01E07B", -1}, + {"M01E08A", -1}, + {"M01E08B", -1}, + {"M01E09A", -1}, + {"M01E10A", -1}, + {"M01END", -1}, + {"M02E01A", -1}, + {"M02E02A", -1}, + {"M02E02B", -1}, + {"M02E02C", -1}, + {"M02E02D", -1}, + {"M02E02E", -1}, + {"M02E02F", -1}, + {"M02E02G", -1}, + {"M02E02H", -1}, + {"M02END", -1}, + {"S00E01A", -1}, + {"S01E01A", 1}, + {"S01E01B", 1}, + {"S01E02A", 1}, + {"S01E02B", 2}, + {"S02E01A", -1}, + {"S02E02A", -1}, + {"S02E02B", 3}, + {"S03E01A", 1}, + {"S03E01B", 3}, + {"S04E01A", 1}, + {"S04E01B", 1}, + {"S04E01C", 1}, + {"S04E01D", 1}, + {"S04E01E", 1}, + {"S04E01F", 2}, + {"S05E01A", 1}, + {"S05E01B", 3}, + {"S06E01A", 1}, + {"S06E01B", 1}, + {"S06E01C", 3}, + {"S07E01A", 1}, + {"S07E01B", 3}, + {"S08E01A", 1}, + {"S08E01B", 3}, + {"S09E01A", 1}, + {"S09E01B",1}, + {"S09E01C", 2}, + {"R00E01A", -1}, + {"NEXT DAY", -1}, + {"DEBUG GROUND", -1}, +}; + +ALIGNED(4) const u8 gUnknown_80B7144[] = "NONE"; + +const u8 *const gUnknown_80B714C[10] = { + "2-1", + "2-1", + "1-2 7", + "4", + "5", + "6", + "2-2 8", + "3", + "9", + "END", +}; + +const u8 *const gUnknown_80B71A0[4] = { + _("{COLOR GREEN_I}START{RESET}"), + _("{COLOR GENDER_COLOR}CONTINUE{RESET}"), + _("{COLOR YELLOW_N}LAST{RESET}"), + _("{COLOR RED_W}END{RESET}"), +}; + +struct GroundEventTableEntry +{ + // size: 0x4 + s16 groundEnterId; + u8 value; // Seems like friend area number +}; + +const struct GroundEventTableEntry gGroundEnterLookupTable[58] = { + {105, 1 }, + {106, 2 }, + {107, 3 }, + {108, 4 }, + {109, 5 }, + {110, 6 }, + {111, 7 }, + {112, 8 }, + {113, 9 }, + {114, 10}, + {115, 11}, + {116, 12}, + {117, 13}, + {118, 14}, + {119, 15}, + {120, 16}, + {121, 17}, + {122, 18}, + {123, 19}, + {124, 20}, + {125, 21}, + {126, 22}, + {127, 23}, + {128, 24}, + {129, 25}, + {130, 26}, + {131, 27}, + {132, 28}, + {133, 29}, + {134, 30}, + { 135, 31}, + { 136, 32}, + { 137, 33}, + { 138, 34}, + { 139, 35}, + { 140, 36}, + { 141, 37}, + { 142, 38}, + { 143, 39}, + { 144, 40}, + { 145, 41}, + { 146, 42}, + { 147, 43}, + { 148, 44}, + { 149, 45}, + { 150, 46}, + { 151, 47}, + { 152, 48}, + { 153, 49}, + { 154, 50}, + { 155, 51}, + { 156, 52}, + { 157, 53}, + { 158, 54}, + { 159, 55}, + { 160, 56}, + { 161, 57}, + { -1, 0}, +}; + +ALIGNED(4) const u8 gScenarioCalcLogString[] = "SCENARIO CALC [%3d] %4d %4d -> %4d %4d"; + diff --git a/src/event_flag.c b/src/event_flag.c index 7b9e324c1..66cb219ff 100644 --- a/src/event_flag.c +++ b/src/event_flag.c @@ -1,4 +1,5 @@ #include "global.h" +#include "globaldata.h" #include "constants/friend_area.h" #include "constants/item.h" #include "items.h" @@ -16,26 +17,8 @@ EWRAM_DATA u8 gScriptVarBuffer[0x400] = {0}; // NDS=020876DC -struct GroundEventTableEntry -{ - // size: 0x4 - s16 groundEnterId; - u8 value; // Seems like friend area number -}; +#include "data/event_flag.h" -extern struct GroundEventTableEntry gGroundEnterLookupTable[58]; - -struct unkStruct_80B6D90 -{ - u8 *text; - s32 num; -}; -extern struct unkStruct_80B6D90 gUnknown_80B6D90[]; - -extern u8 gUnknown_80B7144[]; -extern u8 *gUnknown_80B714C[]; -extern u8 *gUnknown_80B71A0[]; -extern u8 gUnknown_80B72CC[]; extern DebugLocation gUnknown_80B7318; extern u8 gUnknown_80B7324[]; extern DebugLocation gUnknown_80B7350; @@ -487,7 +470,7 @@ void ScenarioCalc(s16 param_1,s32 param_2,s32 param_3) param_1_s32 = param_1; GetScriptVarScenario(param_1_s32,&local_18,&local_14); - Log(6,gUnknown_80B72CC,param_1_s32,local_18,local_14,param_2,param_3); // SCENARIO CALC [%3d] %4d %4d -> %4d %4d + Log(6,gScenarioCalcLogString,param_1_s32,local_18,local_14,param_2,param_3); // SCENARIO CALC [%3d] %4d %4d -> %4d %4d if ((param_1_s32 == 3) && ((param_2 != local_18 || (param_3 != local_14)))) { SetScriptVarValue(NULL,CLEAR_COUNT,0); } @@ -812,7 +795,7 @@ UNUSED s32 sub_8002354(u32 param_1) } } -UNUSED u8 *sub_8002374(u32 param_1) +UNUSED const u8 *sub_8002374(u32 param_1) { if (param_1 < 0x3b) { return gUnknown_80B6D90[param_1].text; @@ -822,7 +805,7 @@ UNUSED u8 *sub_8002374(u32 param_1) } } -UNUSED u8 *sub_8002394(u32 param_1) +UNUSED const u8 *sub_8002394(u32 param_1) { if (param_1 - 0x12 < 9) { return gUnknown_80B714C[param_1 - 0x12]; @@ -835,7 +818,7 @@ UNUSED u8 *sub_8002394(u32 param_1) } } -UNUSED u8 *sub_80023C4(u32 param_1) +UNUSED const u8 *sub_80023C4(u32 param_1) { if (param_1 < 4) { return gUnknown_80B71A0[param_1]; // CISTART, CECONTINUE, CNLAST, CWEND @@ -921,7 +904,7 @@ u8 sub_8002658(s16 param_1) { short sVar1; s32 param_1_s32; - struct GroundEventTableEntry *ptr; + const struct GroundEventTableEntry *ptr; param_1_s32 = param_1; @@ -942,7 +925,7 @@ u8 sub_8002658(s16 param_1) // arm9.bin::0200E5E8 s16 sub_8002694(u8 param_1) { - struct GroundEventTableEntry *puVar2 = gGroundEnterLookupTable; + const struct GroundEventTableEntry *puVar2 = gGroundEnterLookupTable; while (puVar2->groundEnterId != -1) { if (puVar2->value == param_1) {