diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0a438e7d..8b9e3fe5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -182,7 +182,7 @@ typedef struct Entity u32 * field_0x4; EntityType entityType; u8 action; - u8 previousActionFlag; + u8 subAction; u8 actionDelay; u8 field_0xf; u8 flags; @@ -199,7 +199,7 @@ What's the 12th byte in this struct? u32 * field_0x4; //4-7 EntityType entityType; //8-11 u8 action; //12 - u8 previousActionFlag; //13 + u8 subAction; //13 ``` --- diff --git a/Jenkinsfile b/Jenkinsfile index d55b94e4..fbfe89ef 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,16 +5,12 @@ pipeline { stage('Setup') { steps { echo 'Setting up...' - sh 'cp /usr/local/etc/roms/baserom_tmc.gba baserom.gba' + sh 'cd ${AGBCC} && ./install.sh ${WORKSPACE} && cd ${WORKSPACE}' + sh 'cp /usr/local/etc/roms/tmc.us.gba baserom.gba' sh 'make -j setup' } } stage('Build') { - when { - not { - branch 'master' - } - } steps { sh 'make -j' } @@ -24,8 +20,8 @@ pipeline { branch 'master' } steps { - sh 'python3 progress.py -c >> /var/www/html/reports/progress.csv' - sh 'python3 progress.py -mc >> /var/www/html/reports/progress_matching.csv' + sh 'python3 progress.py >> /var/www/html/reports/progress_tmc.csv' + sh 'python3 progress.py -m >> /var/www/html/reports/progress_tmc_matching.csv' } } } @@ -34,4 +30,4 @@ pipeline { cleanWs() } } -} \ No newline at end of file +} diff --git a/Makefile b/Makefile index f243bea8..e17925d4 100644 --- a/Makefile +++ b/Makefile @@ -84,6 +84,7 @@ endif #$(C_BUILDDIR)/need_interworking_file_name.o: CFLAGS += -mthumb-interwork $(C_BUILDDIR)/arm_proxy.o: CFLAGS += -mthumb-interwork +$(C_BUILDDIR)/eeprom.o: CFLAGS = -O1 -mthumb-interwork -Wimplicit -Wparentheses -Werror -Wno-multichar C_SRCS := $(wildcard $(C_SUBDIR)/*.c $(C_SUBDIR)/*/*.c) C_OBJS := $(patsubst $(C_SUBDIR)/%.c,$(C_BUILDDIR)/%.o,$(C_SRCS)) diff --git a/README.md b/README.md index fe1c53c2..02008aaa 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # The Legend of Zelda: The Minish Cap -**Progress:** [⬛⬛⬛⬛⬛⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜] 25% +**Progress:** [⬛⬛⬛⬛⬛⬛⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜] 30% ```diff - WARNING! - diff --git a/asm/bigBarrel.s b/asm/bigBarrel.s index e7390c31..f721b772 100644 --- a/asm/bigBarrel.s +++ b/asm/bigBarrel.s @@ -176,7 +176,7 @@ _08088B82: subs r1, #0x50 movs r2, #0xa0 movs r3, #0x30 - bl sub_0806FBFC + bl CheckPlayerProximity cmp r0, #0 beq _08088BBA ldrb r0, [r5] @@ -194,7 +194,7 @@ _08088BBA: adds r1, #0x30 movs r2, #0xa0 movs r3, #0x30 - bl sub_0806FBFC + bl CheckPlayerProximity cmp r0, #0 beq _08088BDE ldrb r0, [r5] diff --git a/asm/bigGoron.s b/asm/bigGoron.s index a83c056b..8e59000e 100644 --- a/asm/bigGoron.s +++ b/asm/bigGoron.s @@ -95,7 +95,7 @@ sub_0806D0B0: @ 0x0806D0B0 movs r1, #0x80 lsls r1, r1, #6 adds r0, r5, #0 - bl MemClear32 + bl MemClear cmp r4, #0 beq _0806D0DA adds r0, r4, #0 @@ -120,7 +120,7 @@ sub_0806D0F8: @ 0x0806D0F8 movs r0, #7 movs r1, #0x4c movs r2, #7 - bl FindEntityInListBySubtype + bl FindEntityByID cmp r0, #0 beq _0806D10C bl sub_0806D0B0 @@ -517,9 +517,9 @@ _0806D3F4: strh r0, [r4, #0x2e] adds r0, r4, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity adds r0, r4, #0 - bl sub_0807DDE4 + bl HandleEntity0x82Actions _0806D408: pop {r4, pc} .align 2, 0 @@ -566,9 +566,9 @@ sub_0806D41C: @ 0x0806D41C _0806D45E: adds r0, r4, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity adds r0, r4, #0 - bl sub_0807DDE4 + bl HandleEntity0x82Actions _0806D46C: ldr r0, _0806D4A8 @ =gScreenTransition ldr r0, [r0] @@ -583,7 +583,7 @@ _0806D46C: ldrsh r1, [r4, r2] movs r2, #0x40 movs r3, #0x40 - bl sub_0806FBFC + bl CheckPlayerProximity cmp r0, #0 beq _0806D4AC adds r2, r4, #0 @@ -724,7 +724,7 @@ _0806D540: ldrsh r1, [r4, r2] movs r2, #0x18 movs r3, #0x40 - bl sub_0806FBFC + bl CheckPlayerProximity cmp r0, #0 beq _0806D5B4 _0806D590: @@ -928,7 +928,7 @@ sub_0806D6D0: @ 0x0806D6D0 movs r1, #0x4c movs r2, #7 movs r3, #2 - bl FindEntityInListByForm + bl FindEntity adds r1, r0, #0 cmp r1, #0 beq _0806D6EE @@ -940,7 +940,7 @@ _0806D6EE: movs r1, #0x4c movs r2, #7 movs r3, #1 - bl FindEntityInListByForm + bl FindEntity adds r1, r0, #0 cmp r1, #0 beq _0806D706 @@ -961,7 +961,7 @@ sub_0806D70C: @ 0x0806D70C movs r1, #0x4c movs r2, #7 movs r3, #2 - bl FindEntityInListByForm + bl FindEntity adds r2, r0, #0 cmp r2, #0 beq _0806D728 @@ -972,7 +972,7 @@ _0806D728: movs r1, #0x4c movs r2, #7 movs r3, #1 - bl FindEntityInListByForm + bl FindEntity adds r2, r0, #0 cmp r2, #0 beq _0806D746 @@ -996,7 +996,7 @@ sub_0806D74C: @ 0x0806D74C movs r1, #0x4c movs r2, #7 movs r3, #2 - bl FindEntityInListByForm + bl FindEntity adds r1, r0, #0 cmp r1, #0 beq _0806D76A @@ -1008,7 +1008,7 @@ _0806D76A: movs r1, #0x4c movs r2, #7 movs r3, #1 - bl FindEntityInListByForm + bl FindEntity adds r1, r0, #0 cmp r1, #0 beq _0806D782 @@ -1029,7 +1029,7 @@ sub_0806D788: @ 0x0806D788 movs r1, #0x4c movs r2, #7 movs r3, #2 - bl FindEntityInListByForm + bl FindEntity adds r1, r0, #0 cmp r1, #0 beq _0806D7A6 @@ -1041,7 +1041,7 @@ _0806D7A6: movs r1, #0x4c movs r2, #7 movs r3, #1 - bl FindEntityInListByForm + bl FindEntity adds r1, r0, #0 cmp r1, #0 beq _0806D7BE @@ -1070,7 +1070,7 @@ sub_0806D7C4: @ 0x0806D7C4 movs r1, #0x4c movs r2, #7 movs r3, #2 - bl FindEntityInListByForm + bl FindEntity cmp r0, #0 beq _0806D7FC movs r1, #0x2e @@ -1098,7 +1098,7 @@ sub_0806D804: @ 0x0806D804 movs r1, #0x4c movs r2, #7 movs r3, #2 - bl FindEntityInListByForm + bl FindEntity adds r1, r0, #0 cmp r1, #0 beq _0806D83A diff --git a/asm/bird.s b/asm/bird.s index 7d16e5f0..a6c53b75 100644 --- a/asm/bird.s +++ b/asm/bird.s @@ -515,7 +515,7 @@ _0809D5E6: adds r4, r0, #0 cmp r4, #0 beq _0809D62E - ldr r1, _0809D668 @ =gUnk_0800B0AC + ldr r1, _0809D668 @ =script_0800B0AC bl StartCutscene adds r1, r4, #0 adds r1, #0x84 @@ -545,7 +545,7 @@ _0809D658: .4byte gPlayerEntity _0809D65C: .4byte 0xFFF80000 _0809D660: .4byte gRoomControls _0809D664: .4byte gUnk_02034490 -_0809D668: .4byte gUnk_0800B0AC +_0809D668: .4byte script_0800B0AC thumb_func_start sub_0809D66C sub_0809D66C: @ 0x0809D66C @@ -639,7 +639,7 @@ CreateBird: @ 0x0809D700 movs r1, #0x95 movs r2, #6 movs r3, #8 - bl FindEntityInListByForm + bl FindEntity adds r4, r0, #0 cmp r4, #0 bne _0809D732 diff --git a/asm/book.s b/asm/book.s index 325205d1..fe75a238 100644 --- a/asm/book.s +++ b/asm/book.s @@ -327,7 +327,7 @@ _0809B606: movs r0, #7 movs r1, #0x1a movs r2, #7 - bl FindEntityInListBySubtype + bl FindEntityByID adds r2, r0, #0 cmp r2, #0 beq _0809B682 diff --git a/asm/brocco.s b/asm/brocco.s index a8893593..80ac6909 100644 --- a/asm/brocco.s +++ b/asm/brocco.s @@ -208,9 +208,9 @@ _080636A0: .4byte gPlayerEntity _080636A4: adds r0, r4, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity adds r0, r4, #0 - bl sub_0807DDE4 + bl HandleEntity0x82Actions adds r0, r4, #0 bl UpdateAnimationSingleFrame b _080636D4 diff --git a/asm/businessScrubPrologue.s b/asm/businessScrubPrologue.s index deb98135..f1e8909d 100644 --- a/asm/businessScrubPrologue.s +++ b/asm/businessScrubPrologue.s @@ -142,14 +142,14 @@ sub_08045C3C: @ 0x08045C3C bl sub_08046030 adds r0, r4, #0 bl sub_08095C48 - ldr r1, _08045CA0 @ =gUnk_08015AC4 + ldr r1, _08045CA0 @ =script_08015AC4 adds r0, r4, #0 bl StartCutscene adds r0, r4, #0 bl sub_0807DD50 pop {r4, pc} .align 2, 0 -_08045CA0: .4byte gUnk_08015AC4 +_08045CA0: .4byte script_08015AC4 thumb_func_start sub_08045CA4 sub_08045CA4: @ 0x08045CA4 diff --git a/asm/castleMaid.s b/asm/castleMaid.s index 51f71954..f8f6d720 100644 --- a/asm/castleMaid.s +++ b/asm/castleMaid.s @@ -343,10 +343,10 @@ _08064776: lsls r0, r0, #0x10 cmp r0, #0 beq _08064788 - ldr r1, _0806478C @ =gUnk_02033280 + ldr r1, _0806478C @ =gActiveScriptInfo movs r0, #0 strb r0, [r1, #6] _08064788: pop {r4, r5, r6, pc} .align 2, 0 -_0806478C: .4byte gUnk_02033280 +_0806478C: .4byte gActiveScriptInfo diff --git a/asm/castorWildsStatue.s b/asm/castorWildsStatue.s index b08602c1..957ac56c 100644 --- a/asm/castorWildsStatue.s +++ b/asm/castorWildsStatue.s @@ -503,13 +503,13 @@ _08067734: cmp r0, #0 beq _08067748 _08067742: - ldr r1, _0806774C @ =gUnk_02033280 + ldr r1, _0806774C @ =gActiveScriptInfo movs r0, #0 strb r0, [r1, #6] _08067748: pop {pc} .align 2, 0 -_0806774C: .4byte gUnk_02033280 +_0806774C: .4byte gActiveScriptInfo thumb_func_start CastorWildsStatue_Fusion CastorWildsStatue_Fusion: @ 0x08067750 diff --git a/asm/code_08000108.s b/asm/code_08000108.s index 7fb9b84d..b54a3d0a 100644 --- a/asm/code_08000108.s +++ b/asm/code_08000108.s @@ -33,7 +33,7 @@ _08000136: pop {r4, pc} _08000138: _08000138: .4byte gUnk_030056F1 -_0800013C: .4byte sub_0807D280 +_0800013C: .4byte sub_0807D280 @ layer 1, 2, 3? _08000140: .4byte sub_0807D46C _08000144: .4byte sub_0807D6D8 @@ -55,8 +55,8 @@ sub_08000152: @ 0x08000152 lsrs r2, r2, #2 non_word_aligned_thumb_func_start SetTile -SetTile: @ 0x0800015E - push {r4, r5, r6, r7, lr} +SetTile: @ r0 = tile type, r1, = tile position, r2 = layer + push {r4-r7, lr} lsls r3, r2, #3 ldr r4, _08000208 @ =gUnk_08000228 ldr r5, [r4, r3] @@ -75,7 +75,7 @@ SetTile: @ 0x0800015E ldrb r0, [r3, r4] lsrs r2, r2, #2 bl sub_08000148 - pop {r0, r1} + pop {r0, r1} @ tilepos, layer push {r0, r1} bl DeleteLoadedTileEntity adds r0, r7, #0 @@ -170,8 +170,8 @@ gUnk_08000278:: @ call 0x80B19CC @ ======== @ Unused? Doesn't seem to be called by anything in Ghidra. - thumb_func_start sub_08000288 -sub_08000288: @ 0x08000288 + thumb_func_start GetTileAtEntityPos +GetTileAtEntityPos: @ 0x08000288 ldr r3, _080002F4 @ =gUnk_03005740 bx r3 diff --git a/asm/code_080011C4.s b/asm/code_080011C4.s index 94684d6e..b050d9e8 100644 --- a/asm/code_080011C4.s +++ b/asm/code_080011C4.s @@ -1238,7 +1238,7 @@ _08002812: cmp r0, #0 beq _08002834 adds r6, #1 - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #8 _08002834: adds r4, r0, #0 @@ -1256,7 +1256,7 @@ _0800283E: cmp r0, #0 beq _08002856 adds r6, #2 - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #8 _08002856: adds r4, r0, #0 diff --git a/asm/code_080043E8.s b/asm/code_080043E8.s index da9ba967..4fb457b0 100644 --- a/asm/code_080043E8.s +++ b/asm/code_080043E8.s @@ -378,10 +378,16 @@ gUnk_0800476A:: @ 0800476A .incbin "baserom.gba", 0x00476A, 0x000008C gUnk_080047F6:: @ 080047F6 - .incbin "baserom.gba", 0x0047F6, 0x0000200 + .incbin "baserom.gba", 0x0047F6, 0x00001E0 + +gUnk_080049D6:: @ 080049D6 + .incbin "baserom.gba", 0x0049D6, 0x0000020 gUnk_080049F6:: @ 080049F6 - .incbin "baserom.gba", 0x0049F6, 0x000000A + .incbin "baserom.gba", 0x0049F6, 0x0000008 + +gUnk_080049FE:: @ gUnk_080049FE + .incbin "baserom.gba", 0x0049FE, 0x0000002 gUnk_08004A00:: @ 08004A00 .incbin "baserom.gba", 0x004A00, 0x000000C diff --git a/asm/code_0800857C.s b/asm/code_0800857C.s index cb5c54a0..c4a611b9 100644 --- a/asm/code_0800857C.s +++ b/asm/code_0800857C.s @@ -719,7 +719,7 @@ sub_08008AC6: @ 0x08008AC6 movs r3, #0xe2 movs r2, #0x3d strb r3, [r0, r2] - bl sub_08079458 + bl RespawnPlayer _08008AEC: pop {r0, pc} @@ -782,3347 +782,5 @@ _08008B50: .4byte 0x00004000 _08008B54: .4byte gUnk_08007CAC _08008B58: .4byte gPlayerEntity -gUnk_08008B5C:: @ 08008B5C - .incbin "baserom.gba", 0x008B5C, 0x0000034 -gUnk_08008B90:: @ 08008B90 - .incbin "baserom.gba", 0x008B90, 0x0000030 - -gUnk_08008BC0:: @ 08008BC0 - .incbin "baserom.gba", 0x008BC0, 0x000008E - -gUnk_08008C4E:: @ 08008C4E - .incbin "baserom.gba", 0x008C4E, 0x0000016 - -gUnk_08008C64:: @ 08008C64 - .incbin "baserom.gba", 0x008C64, 0x0000009 - -gUnk_08008C6D:: @ 08008C6D - .incbin "baserom.gba", 0x008C6D, 0x0000011 - -gUnk_08008C7E:: @ 08008C7E - .incbin "baserom.gba", 0x008C7E, 0x000003B - -gUnk_08008CB9:: @ 08008CB9 - .incbin "baserom.gba", 0x008CB9, 0x0000097 - -gUnk_08008D50:: @ 08008D50 - .incbin "baserom.gba", 0x008D50, 0x000003C - -gUnk_08008D8C:: @ 08008D8C - .incbin "baserom.gba", 0x008D8C, 0x0000034 - -gUnk_08008DC0:: @ 08008DC0 - .incbin "baserom.gba", 0x008DC0, 0x0000048 - -gUnk_08008E08:: @ 08008E08 - .incbin "baserom.gba", 0x008E08, 0x0000002 - -gUnk_08008E0A:: @ 08008E0A - .incbin "baserom.gba", 0x008E0A, 0x0000102 - -gUnk_08008F0C:: @ 08008F0C - .incbin "baserom.gba", 0x008F0C, 0x000000A - -gUnk_08008F16:: @ 08008F16 - .incbin "baserom.gba", 0x008F16, 0x0000010 - -gUnk_08008F26:: @ 08008F26 - .incbin "baserom.gba", 0x008F26, 0x000006A - -gUnk_08008F90:: @ 08008F90 - .incbin "baserom.gba", 0x008F90, 0x0000030 - -gUnk_08008FC0:: @ 08008FC0 - .incbin "baserom.gba", 0x008FC0, 0x0000011 - -gUnk_08008FD1:: @ 08008FD1 - .incbin "baserom.gba", 0x008FD1, 0x000002B - -gUnk_08008FFC:: @ 08008FFC - .incbin "baserom.gba", 0x008FFC, 0x000000C - -gUnk_08009008:: @ 08009008 - .incbin "baserom.gba", 0x009008, 0x0000017 - -gUnk_0800901F:: @ 0800901F - .incbin "baserom.gba", 0x00901F, 0x000001D - -gUnk_0800903C:: @ 0800903C - .incbin "baserom.gba", 0x00903C, 0x0000044 - -gUnk_08009080:: @ 08009080 - .incbin "baserom.gba", 0x009080, 0x000005B - -gUnk_080090DB:: @ 080090DB - .incbin "baserom.gba", 0x0090DB, 0x00000BD - -gUnk_08009198:: @ 08009198 - .incbin "baserom.gba", 0x009198, 0x000006F - -gUnk_08009207:: @ 08009207 - .incbin "baserom.gba", 0x009207, 0x000006D - -gUnk_08009274:: @ 08009274 - .incbin "baserom.gba", 0x009274, 0x0000034 - -gUnk_080092A8:: @ 080092A8 - .incbin "baserom.gba", 0x0092A8, 0x000002C - -gUnk_080092D4:: @ 080092D4 - .incbin "baserom.gba", 0x0092D4, 0x000001C - -gUnk_080092F0:: @ 080092F0 - .incbin "baserom.gba", 0x0092F0, 0x0000018 - -gUnk_08009308:: @ 08009308 - .incbin "baserom.gba", 0x009308, 0x0000010 - -gUnk_08009318:: @ 08009318 - .incbin "baserom.gba", 0x009318, 0x0000008 - -gUnk_08009320:: @ 08009320 - .incbin "baserom.gba", 0x009320, 0x0000020 - -gUnk_08009340:: @ 08009340 - .incbin "baserom.gba", 0x009340, 0x0000008 - -gUnk_08009348:: @ 08009348 - .incbin "baserom.gba", 0x009348, 0x000004B - -gUnk_08009393:: @ 08009393 - .incbin "baserom.gba", 0x009393, 0x0000044 - -gUnk_080093D7:: @ 080093D7 - .incbin "baserom.gba", 0x0093D7, 0x0000030 - -gUnk_08009407:: @ 08009407 - .incbin "baserom.gba", 0x009407, 0x000007F - -gUnk_08009486:: @ 08009486 - .incbin "baserom.gba", 0x009486, 0x000001E - -gUnk_080094A4:: @ 080094A4 - .incbin "baserom.gba", 0x0094A4, 0x0000028 - -gUnk_080094CC:: @ 080094CC - .incbin "baserom.gba", 0x0094CC, 0x000000B - -gUnk_080094D7:: @ 080094D7 - .incbin "baserom.gba", 0x0094D7, 0x0000025 - -gUnk_080094FC:: @ 080094FC - .incbin "baserom.gba", 0x0094FC, 0x0000007 - -gUnk_08009503:: @ 08009503 - .incbin "baserom.gba", 0x009503, 0x0000005 - -gUnk_08009508:: @ 08009508 - .incbin "baserom.gba", 0x009508, 0x0000030 - -gUnk_08009538:: @ 08009538 - .incbin "baserom.gba", 0x009538, 0x000003C - -gUnk_08009574:: @ 08009574 - .incbin "baserom.gba", 0x009574, 0x0000058 - -gUnk_080095CC:: @ 080095CC - .incbin "baserom.gba", 0x0095CC, 0x0000060 - -gUnk_0800962C:: @ 0800962C - .incbin "baserom.gba", 0x00962C, 0x000006C - -gUnk_08009698:: @ 08009698 - .incbin "baserom.gba", 0x009698, 0x000006C - -gUnk_08009704:: @ 08009704 - .incbin "baserom.gba", 0x009704, 0x0000002 - -gUnk_08009706:: @ 08009706 - .incbin "baserom.gba", 0x009706, 0x000003A - -gUnk_08009740:: @ 08009740 - .incbin "baserom.gba", 0x009740, 0x0000038 - -gUnk_08009778:: @ 08009778 - .incbin "baserom.gba", 0x009778, 0x000000E - -gUnk_08009786:: @ 08009786 - .incbin "baserom.gba", 0x009786, 0x000001B - -gUnk_080097A1:: @ 080097A1 - .incbin "baserom.gba", 0x0097A1, 0x000004F - -gUnk_080097F0:: @ 080097F0 - .incbin "baserom.gba", 0x0097F0, 0x0000048 - -gUnk_08009838:: @ 08009838 - .incbin "baserom.gba", 0x009838, 0x000009C - -gUnk_080098D4:: @ 080098D4 - .incbin "baserom.gba", 0x0098D4, 0x0000044 - -gUnk_08009918:: @ 08009918 - .incbin "baserom.gba", 0x009918, 0x0000028 - -gUnk_08009940:: @ 08009940 - .incbin "baserom.gba", 0x009940, 0x0000010 - -gUnk_08009950:: @ 08009950 - .incbin "baserom.gba", 0x009950, 0x000008C - -gUnk_080099DC:: @ 080099DC - .incbin "baserom.gba", 0x0099DC, 0x0000028 - -gUnk_08009A04:: @ 08009A04 - .incbin "baserom.gba", 0x009A04, 0x0000003 - -gUnk_08009A07:: @ 08009A07 - .incbin "baserom.gba", 0x009A07, 0x0000025 - -gUnk_08009A2C:: @ 08009A2C - .incbin "baserom.gba", 0x009A2C, 0x0000008 - -gUnk_08009A34:: @ 08009A34 - .incbin "baserom.gba", 0x009A34, 0x000001C - -gUnk_08009A50:: @ 08009A50 - .incbin "baserom.gba", 0x009A50, 0x0000027 - -gUnk_08009A77:: @ 08009A77 - .incbin "baserom.gba", 0x009A77, 0x000000A - -gUnk_08009A81:: @ 08009A81 - .incbin "baserom.gba", 0x009A81, 0x0000003 - -gUnk_08009A84:: @ 08009A84 - .incbin "baserom.gba", 0x009A84, 0x0000037 - -gUnk_08009ABB:: @ 08009ABB - .incbin "baserom.gba", 0x009ABB, 0x000003D - -gUnk_08009AF8:: @ 08009AF8 - .incbin "baserom.gba", 0x009AF8, 0x0000038 - -gUnk_08009B30:: @ 08009B30 - .incbin "baserom.gba", 0x009B30, 0x0000033 - -gUnk_08009B63:: @ 08009B63 - .incbin "baserom.gba", 0x009B63, 0x0000015 - -gUnk_08009B78:: @ 08009B78 - .incbin "baserom.gba", 0x009B78, 0x00000F0 - -gUnk_08009C68:: @ 08009C68 - .incbin "baserom.gba", 0x009C68, 0x0000017 - -gUnk_08009C7F:: @ 08009C7F - .incbin "baserom.gba", 0x009C7F, 0x000001F - -gUnk_08009C9E:: @ 08009C9E - .incbin "baserom.gba", 0x009C9E, 0x0000062 - -gUnk_08009D00:: @ 08009D00 - .incbin "baserom.gba", 0x009D00, 0x000006C - -gUnk_08009D6C:: @ 08009D6C - .incbin "baserom.gba", 0x009D6C, 0x000000B - -gUnk_08009D77:: @ 08009D77 - .incbin "baserom.gba", 0x009D77, 0x0000039 - -gUnk_08009DB0:: @ 08009DB0 - .incbin "baserom.gba", 0x009DB0, 0x000003C - -gUnk_08009DEC:: @ 08009DEC - .incbin "baserom.gba", 0x009DEC, 0x000004C - -gUnk_08009E38:: @ 08009E38 - .incbin "baserom.gba", 0x009E38, 0x0000020 - -gUnk_08009E58:: @ 08009E58 - .incbin "baserom.gba", 0x009E58, 0x0000030 - -gUnk_08009E88:: @ 08009E88 - .incbin "baserom.gba", 0x009E88, 0x0000016 - -gUnk_08009E9E:: @ 08009E9E - .incbin "baserom.gba", 0x009E9E, 0x000000B - -gUnk_08009EA9:: @ 08009EA9 - .incbin "baserom.gba", 0x009EA9, 0x000000E - -gUnk_08009EB7:: @ 08009EB7 - .incbin "baserom.gba", 0x009EB7, 0x0000015 - -gUnk_08009ECC:: @ 08009ECC - .incbin "baserom.gba", 0x009ECC, 0x0000024 - -gUnk_08009EF0:: @ 08009EF0 - .incbin "baserom.gba", 0x009EF0, 0x0000017 - -gUnk_08009F07:: @ 08009F07 - .incbin "baserom.gba", 0x009F07, 0x000000D - -gUnk_08009F14:: @ 08009F14 - .incbin "baserom.gba", 0x009F14, 0x0000025 - -gUnk_08009F39:: @ 08009F39 - .incbin "baserom.gba", 0x009F39, 0x0000039 - -gUnk_08009F72:: @ 08009F72 - .incbin "baserom.gba", 0x009F72, 0x00000F2 - -gUnk_0800A064:: @ 0800A064 - .incbin "baserom.gba", 0x00A064, 0x000001D - -gUnk_0800A081:: @ 0800A081 - .incbin "baserom.gba", 0x00A081, 0x0000033 - -gUnk_0800A0B4:: @ 0800A0B4 - .incbin "baserom.gba", 0x00A0B4, 0x0000048 - -gUnk_0800A0FC:: @ 0800A0FC - .incbin "baserom.gba", 0x00A0FC, 0x000000E - -gUnk_0800A10A:: @ 0800A10A - .incbin "baserom.gba", 0x00A10A, 0x0000005 - -gUnk_0800A10F:: @ 0800A10F - .incbin "baserom.gba", 0x00A10F, 0x0000015 - -gUnk_0800A124:: @ 0800A124 - .incbin "baserom.gba", 0x00A124, 0x0000010 - -gUnk_0800A134:: @ 0800A134 - .incbin "baserom.gba", 0x00A134, 0x0000080 - -gUnk_0800A1B4:: @ 0800A1B4 - .incbin "baserom.gba", 0x00A1B4, 0x0000024 - -gUnk_0800A1D8:: @ 0800A1D8 - .incbin "baserom.gba", 0x00A1D8, 0x000004C - -gUnk_0800A224:: @ 0800A224 - .incbin "baserom.gba", 0x00A224, 0x000003C - -gUnk_0800A260:: @ 0800A260 - .incbin "baserom.gba", 0x00A260, 0x00000E0 - -gUnk_0800A340:: @ 0800A340 - .incbin "baserom.gba", 0x00A340, 0x0000063 - -gUnk_0800A3A3:: @ 0800A3A3 - .incbin "baserom.gba", 0x00A3A3, 0x0000006 - -gUnk_0800A3A9:: @ 0800A3A9 - .incbin "baserom.gba", 0x00A3A9, 0x0000001 - -gUnk_0800A3AA:: @ 0800A3AA - .incbin "baserom.gba", 0x00A3AA, 0x000002E - -gUnk_0800A3D8:: @ 0800A3D8 - .incbin "baserom.gba", 0x00A3D8, 0x0000128 - -gUnk_0800A500:: @ 0800A500 - .incbin "baserom.gba", 0x00A500, 0x0000090 - -gUnk_0800A590:: @ 0800A590 - .incbin "baserom.gba", 0x00A590, 0x0000016 - -gUnk_0800A5A6:: @ 0800A5A6 - .incbin "baserom.gba", 0x00A5A6, 0x00000B6 - -gUnk_0800A65C:: @ 0800A65C - .incbin "baserom.gba", 0x00A65C, 0x0000022 - -gUnk_0800A67E:: @ 0800A67E - .incbin "baserom.gba", 0x00A67E, 0x0000002 - -gUnk_0800A680:: @ 0800A680 - .incbin "baserom.gba", 0x00A680, 0x0000024 - -gUnk_0800A6A4:: @ 0800A6A4 - .incbin "baserom.gba", 0x00A6A4, 0x0000007 - -gUnk_0800A6AB:: @ 0800A6AB - .incbin "baserom.gba", 0x00A6AB, 0x0000029 - -gUnk_0800A6D4:: @ 0800A6D4 - .incbin "baserom.gba", 0x00A6D4, 0x0000030 - -gUnk_0800A704:: @ 0800A704 - .incbin "baserom.gba", 0x00A704, 0x0000030 - -gUnk_0800A734:: @ 0800A734 - .incbin "baserom.gba", 0x00A734, 0x0000016 - -gUnk_0800A74A:: @ 0800A74A - .incbin "baserom.gba", 0x00A74A, 0x000001A - -gUnk_0800A764:: @ 0800A764 - .incbin "baserom.gba", 0x00A764, 0x0000080 - -gUnk_0800A7E4:: @ 0800A7E4 - .incbin "baserom.gba", 0x00A7E4, 0x0000004 - -gUnk_0800A7E8:: @ 0800A7E8 - .incbin "baserom.gba", 0x00A7E8, 0x000002E - -gUnk_0800A816:: @ 0800A816 - .incbin "baserom.gba", 0x00A816, 0x000000A - -gUnk_0800A820:: @ 0800A820 - .incbin "baserom.gba", 0x00A820, 0x000003C - -gUnk_0800A85C:: @ 0800A85C - .incbin "baserom.gba", 0x00A85C, 0x000003C - -gUnk_0800A898:: @ 0800A898 - .incbin "baserom.gba", 0x00A898, 0x000003C - -gUnk_0800A8D4:: @ 0800A8D4 - .incbin "baserom.gba", 0x00A8D4, 0x0000034 - -gUnk_0800A908:: @ 0800A908 - .incbin "baserom.gba", 0x00A908, 0x0000008 - -gUnk_0800A910:: @ 0800A910 - .incbin "baserom.gba", 0x00A910, 0x0000054 - -gUnk_0800A964:: @ 0800A964 - .incbin "baserom.gba", 0x00A964, 0x0000024 - -gUnk_0800A988:: @ 0800A988 - .incbin "baserom.gba", 0x00A988, 0x0000024 - -gUnk_0800A9AC:: @ 0800A9AC - .incbin "baserom.gba", 0x00A9AC, 0x0000024 - -gUnk_0800A9D0:: @ 0800A9D0 - .incbin "baserom.gba", 0x00A9D0, 0x0000024 - -gUnk_0800A9F4:: @ 0800A9F4 - .incbin "baserom.gba", 0x00A9F4, 0x000000F - -gUnk_0800AA03:: @ 0800AA03 - .incbin "baserom.gba", 0x00AA03, 0x0000045 - -gUnk_0800AA48:: @ 0800AA48 - .incbin "baserom.gba", 0x00AA48, 0x0000024 - -gUnk_0800AA6C:: @ 0800AA6C - .incbin "baserom.gba", 0x00AA6C, 0x0000024 - -gUnk_0800AA90:: @ 0800AA90 - .incbin "baserom.gba", 0x00AA90, 0x0000024 - -gUnk_0800AAB4:: @ 0800AAB4 - .incbin "baserom.gba", 0x00AAB4, 0x0000024 - -gUnk_0800AAD8:: @ 0800AAD8 - .incbin "baserom.gba", 0x00AAD8, 0x0000030 - -gUnk_0800AB08:: @ 0800AB08 - .incbin "baserom.gba", 0x00AB08, 0x000001B - -gUnk_0800AB23:: @ 0800AB23 - .incbin "baserom.gba", 0x00AB23, 0x000002C - -gUnk_0800AB4F:: @ 0800AB4F - .incbin "baserom.gba", 0x00AB4F, 0x00000A1 - -gUnk_0800ABF0:: @ 0800ABF0 - .incbin "baserom.gba", 0x00ABF0, 0x0000034 - -gUnk_0800AC24:: @ 0800AC24 - .incbin "baserom.gba", 0x00AC24, 0x0000049 - -gUnk_0800AC6D:: @ 0800AC6D - .incbin "baserom.gba", 0x00AC6D, 0x0000048 - -gUnk_0800ACB5:: @ 0800ACB5 - .incbin "baserom.gba", 0x00ACB5, 0x0000007 - -gUnk_0800ACBC:: @ 0800ACBC - .incbin "baserom.gba", 0x00ACBC, 0x0000024 - -gUnk_0800ACE0:: @ 0800ACE0 - .incbin "baserom.gba", 0x00ACE0, 0x0000074 - -gUnk_0800AD54:: @ 0800AD54 - .incbin "baserom.gba", 0x00AD54, 0x0000020 - -gUnk_0800AD74:: @ 0800AD74 - .incbin "baserom.gba", 0x00AD74, 0x0000033 - -gUnk_0800ADA7:: @ 0800ADA7 - .incbin "baserom.gba", 0x00ADA7, 0x000000D - -gUnk_0800ADB4:: @ 0800ADB4 - .incbin "baserom.gba", 0x00ADB4, 0x00000F0 - -gUnk_0800AEA4:: @ 0800AEA4 - .incbin "baserom.gba", 0x00AEA4, 0x0000038 - -gUnk_0800AEDC:: @ 0800AEDC - .incbin "baserom.gba", 0x00AEDC, 0x000003C - -gUnk_0800AF18:: @ 0800AF18 - .incbin "baserom.gba", 0x00AF18, 0x000002C - -gUnk_0800AF44:: @ 0800AF44 - .incbin "baserom.gba", 0x00AF44, 0x0000024 - -gUnk_0800AF68:: @ 0800AF68 - .incbin "baserom.gba", 0x00AF68, 0x0000016 - -gUnk_0800AF7E:: @ 0800AF7E - .incbin "baserom.gba", 0x00AF7E, 0x000000E - -gUnk_0800AF8C:: @ 0800AF8C - .incbin "baserom.gba", 0x00AF8C, 0x000001B - -gUnk_0800AFA7:: @ 0800AFA7 - .incbin "baserom.gba", 0x00AFA7, 0x0000009 - -gUnk_0800AFB0:: @ 0800AFB0 - .incbin "baserom.gba", 0x00AFB0, 0x0000038 - -gUnk_0800AFE8:: @ 0800AFE8 - .incbin "baserom.gba", 0x00AFE8, 0x0000024 - -gUnk_0800B00C:: @ 0800B00C - .incbin "baserom.gba", 0x00B00C, 0x00000A0 - -gUnk_0800B0AC:: @ 0800B0AC - .incbin "baserom.gba", 0x00B0AC, 0x0000004 - -gUnk_0800B0B0:: @ 0800B0B0 - .incbin "baserom.gba", 0x00B0B0, 0x0000020 - -gUnk_0800B0D0:: @ 0800B0D0 - .incbin "baserom.gba", 0x00B0D0, 0x00000A7 - -gUnk_0800B177:: @ 0800B177 - .incbin "baserom.gba", 0x00B177, 0x0000005 - -gUnk_0800B17C:: @ 0800B17C - .incbin "baserom.gba", 0x00B17C, 0x0000044 - -gUnk_0800B1C0:: @ 0800B1C0 - .incbin "baserom.gba", 0x00B1C0, 0x0000040 - -gUnk_0800B200:: @ 0800B200 - .incbin "baserom.gba", 0x00B200, 0x0000054 - -gUnk_0800B254:: @ 0800B254 - .incbin "baserom.gba", 0x00B254, 0x0000030 - -gUnk_0800B284:: @ 0800B284 - .incbin "baserom.gba", 0x00B284, 0x0000030 - -gUnk_0800B2B4:: @ 0800B2B4 - .incbin "baserom.gba", 0x00B2B4, 0x0000054 - -gUnk_0800B308:: @ 0800B308 - .incbin "baserom.gba", 0x00B308, 0x000001A - -gUnk_0800B322:: @ 0800B322 - .incbin "baserom.gba", 0x00B322, 0x0000007 - -gUnk_0800B329:: @ 0800B329 - .incbin "baserom.gba", 0x00B329, 0x000001F - -gUnk_0800B348:: @ 0800B348 - .incbin "baserom.gba", 0x00B348, 0x0000014 - -gUnk_0800B35C:: @ 0800B35C - .incbin "baserom.gba", 0x00B35C, 0x0000018 - -gUnk_0800B374:: @ 0800B374 - .incbin "baserom.gba", 0x00B374, 0x0000030 - -gUnk_0800B3A4:: @ 0800B3A4 - .incbin "baserom.gba", 0x00B3A4, 0x000006B - -gUnk_0800B40F:: @ 0800B40F - .incbin "baserom.gba", 0x00B40F, 0x000000D - -gUnk_0800B41C:: @ 0800B41C - .incbin "baserom.gba", 0x00B41C, 0x0000090 - -gUnk_0800B4AC:: @ 0800B4AC - .incbin "baserom.gba", 0x00B4AC, 0x000005C - -gUnk_0800B508:: @ 0800B508 - .incbin "baserom.gba", 0x00B508, 0x0000007 - -gUnk_0800B50F:: @ 0800B50F - .incbin "baserom.gba", 0x00B50F, 0x000003D - -gUnk_0800B54C:: @ 0800B54C - .incbin "baserom.gba", 0x00B54C, 0x0000028 - -gUnk_0800B574:: @ 0800B574 - .incbin "baserom.gba", 0x00B574, 0x0000050 - -gUnk_0800B5C4:: @ 0800B5C4 - .incbin "baserom.gba", 0x00B5C4, 0x0000028 - -gUnk_0800B5EC:: @ 0800B5EC - .incbin "baserom.gba", 0x00B5EC, 0x0000028 - -gUnk_0800B614:: @ 0800B614 - .incbin "baserom.gba", 0x00B614, 0x00000B4 - -gUnk_0800B6C8:: @ 0800B6C8 - .incbin "baserom.gba", 0x00B6C8, 0x0000040 - -gUnk_0800B708:: @ 0800B708 - .incbin "baserom.gba", 0x00B708, 0x0000017 - -gUnk_0800B71F:: @ 0800B71F - .incbin "baserom.gba", 0x00B71F, 0x0000011 - -gUnk_0800B730:: @ 0800B730 - .incbin "baserom.gba", 0x00B730, 0x0000094 - -gUnk_0800B7C4:: @ 0800B7C4 - .incbin "baserom.gba", 0x00B7C4, 0x000008B - -gUnk_0800B84F:: @ 0800B84F - .incbin "baserom.gba", 0x00B84F, 0x0000012 - -gUnk_0800B861:: @ 0800B861 - .incbin "baserom.gba", 0x00B861, 0x0000027 - -gUnk_0800B888:: @ 0800B888 - .incbin "baserom.gba", 0x00B888, 0x0000018 - -gUnk_0800B8A0:: @ 0800B8A0 - .incbin "baserom.gba", 0x00B8A0, 0x0000018 - -gUnk_0800B8B8:: @ 0800B8B8 - .incbin "baserom.gba", 0x00B8B8, 0x000002C - -gUnk_0800B8E4:: @ 0800B8E4 - .incbin "baserom.gba", 0x00B8E4, 0x0000022 - -gUnk_0800B906:: @ 0800B906 - .incbin "baserom.gba", 0x00B906, 0x0000016 - -gUnk_0800B91C:: @ 0800B91C - .incbin "baserom.gba", 0x00B91C, 0x0000048 - -gUnk_0800B964:: @ 0800B964 - .incbin "baserom.gba", 0x00B964, 0x0000050 - -gUnk_0800B9B4:: @ 0800B9B4 - .incbin "baserom.gba", 0x00B9B4, 0x0000088 - -gUnk_0800BA3C:: @ 0800BA3C - .incbin "baserom.gba", 0x00BA3C, 0x000003C - -gUnk_0800BA78:: @ 0800BA78 - .incbin "baserom.gba", 0x00BA78, 0x0000054 - -gUnk_0800BACC:: @ 0800BACC - .incbin "baserom.gba", 0x00BACC, 0x0000034 - -gUnk_0800BB00:: @ 0800BB00 - .incbin "baserom.gba", 0x00BB00, 0x0000008 - -gUnk_0800BB08:: @ 0800BB08 - .incbin "baserom.gba", 0x00BB08, 0x0000012 - -gUnk_0800BB1A:: @ 0800BB1A - .incbin "baserom.gba", 0x00BB1A, 0x0000016 - -gUnk_0800BB30:: @ 0800BB30 - .incbin "baserom.gba", 0x00BB30, 0x0000034 - -gUnk_0800BB64:: @ 0800BB64 - .incbin "baserom.gba", 0x00BB64, 0x0000010 - -gUnk_0800BB74:: @ 0800BB74 - .incbin "baserom.gba", 0x00BB74, 0x0000030 - -gUnk_0800BBA4:: @ 0800BBA4 - .incbin "baserom.gba", 0x00BBA4, 0x0000037 - -gUnk_0800BBDB:: @ 0800BBDB - .incbin "baserom.gba", 0x00BBDB, 0x0000001 - -gUnk_0800BBDC:: @ 0800BBDC - .incbin "baserom.gba", 0x00BBDC, 0x000002C - -gUnk_0800BC08:: @ 0800BC08 - .incbin "baserom.gba", 0x00BC08, 0x000001A - -gUnk_0800BC22:: @ 0800BC22 - .incbin "baserom.gba", 0x00BC22, 0x000002E - -gUnk_0800BC50:: @ 0800BC50 - .incbin "baserom.gba", 0x00BC50, 0x000005E - -gUnk_0800BCAE:: @ 0800BCAE - .incbin "baserom.gba", 0x00BCAE, 0x0000009 - -gUnk_0800BCB7:: @ 0800BCB7 - .incbin "baserom.gba", 0x00BCB7, 0x0000007 - -gUnk_0800BCBE:: @ 0800BCBE - .incbin "baserom.gba", 0x00BCBE, 0x000002A - -gUnk_0800BCE8:: @ 0800BCE8 - .incbin "baserom.gba", 0x00BCE8, 0x0000020 - -gUnk_0800BD08:: @ 0800BD08 - .incbin "baserom.gba", 0x00BD08, 0x0000068 - -gUnk_0800BD70:: @ 0800BD70 - .incbin "baserom.gba", 0x00BD70, 0x0000008 - -gUnk_0800BD78:: @ 0800BD78 - .incbin "baserom.gba", 0x00BD78, 0x0000034 - -gUnk_0800BDAC:: @ 0800BDAC - .incbin "baserom.gba", 0x00BDAC, 0x0000018 - -gUnk_0800BDC4:: @ 0800BDC4 - .incbin "baserom.gba", 0x00BDC4, 0x0000058 - -gUnk_0800BE1C:: @ 0800BE1C - .incbin "baserom.gba", 0x00BE1C, 0x0000038 - -gUnk_0800BE54:: @ 0800BE54 - .incbin "baserom.gba", 0x00BE54, 0x0000078 - -gUnk_0800BECC:: @ 0800BECC - .incbin "baserom.gba", 0x00BECC, 0x0000048 - -gUnk_0800BF14:: @ 0800BF14 - .incbin "baserom.gba", 0x00BF14, 0x0000024 - -gUnk_0800BF38:: @ 0800BF38 - .incbin "baserom.gba", 0x00BF38, 0x0000012 - -gUnk_0800BF4A:: @ 0800BF4A - .incbin "baserom.gba", 0x00BF4A, 0x0000026 - -gUnk_0800BF70:: @ 0800BF70 - .incbin "baserom.gba", 0x00BF70, 0x000004F - -gUnk_0800BFBF:: @ 0800BFBF - .incbin "baserom.gba", 0x00BFBF, 0x0000022 - -gUnk_0800BFE1:: @ 0800BFE1 - .incbin "baserom.gba", 0x00BFE1, 0x0000002 - -gUnk_0800BFE3:: @ 0800BFE3 - .incbin "baserom.gba", 0x00BFE3, 0x0000021 - -gUnk_0800C004:: @ 0800C004 - .incbin "baserom.gba", 0x00C004, 0x0000003 - -gUnk_0800C007:: @ 0800C007 - .incbin "baserom.gba", 0x00C007, 0x000001D - -gUnk_0800C024:: @ 0800C024 - .incbin "baserom.gba", 0x00C024, 0x0000057 - -gUnk_0800C07B:: @ 0800C07B - .incbin "baserom.gba", 0x00C07B, 0x0000035 - -gUnk_0800C0B0:: @ 0800C0B0 - .incbin "baserom.gba", 0x00C0B0, 0x0000017 - -gUnk_0800C0C7:: @ 0800C0C7 - .incbin "baserom.gba", 0x00C0C7, 0x000000C - -gUnk_0800C0D3:: @ 0800C0D3 - .incbin "baserom.gba", 0x00C0D3, 0x0000015 - -gUnk_0800C0E8:: @ 0800C0E8 - .incbin "baserom.gba", 0x00C0E8, 0x000002B - -gUnk_0800C113:: @ 0800C113 - .incbin "baserom.gba", 0x00C113, 0x0000034 - -gUnk_0800C147:: @ 0800C147 - .incbin "baserom.gba", 0x00C147, 0x0000019 - -gUnk_0800C160:: @ 0800C160 - .incbin "baserom.gba", 0x00C160, 0x0000078 - -gUnk_0800C1D8:: @ 0800C1D8 - .incbin "baserom.gba", 0x00C1D8, 0x000002C - -gUnk_0800C204:: @ 0800C204 - .incbin "baserom.gba", 0x00C204, 0x0000003 - -gUnk_0800C207:: @ 0800C207 - .incbin "baserom.gba", 0x00C207, 0x0000001 - -gUnk_0800C208:: @ 0800C208 - .incbin "baserom.gba", 0x00C208, 0x0000008 - -gUnk_0800C210:: @ 0800C210 - .incbin "baserom.gba", 0x00C210, 0x0000053 - -gUnk_0800C263:: @ 0800C263 - .incbin "baserom.gba", 0x00C263, 0x0000041 - -gUnk_0800C2A4:: @ 0800C2A4 - .incbin "baserom.gba", 0x00C2A4, 0x0000003 - -gUnk_0800C2A7:: @ 0800C2A7 - .incbin "baserom.gba", 0x00C2A7, 0x0000027 - -gUnk_0800C2CE:: @ 0800C2CE - .incbin "baserom.gba", 0x00C2CE, 0x0000082 - -gUnk_0800C350:: @ 0800C350 - .incbin "baserom.gba", 0x00C350, 0x0000046 - -gUnk_0800C396:: @ 0800C396 - .incbin "baserom.gba", 0x00C396, 0x0000036 - -gUnk_0800C3CC:: @ 0800C3CC - .incbin "baserom.gba", 0x00C3CC, 0x000003C - -gUnk_0800C408:: @ 0800C408 - .incbin "baserom.gba", 0x00C408, 0x0000008 - -gUnk_0800C410:: @ 0800C410 - .incbin "baserom.gba", 0x00C410, 0x000004C - -gUnk_0800C45C:: @ 0800C45C - .incbin "baserom.gba", 0x00C45C, 0x0000038 - -gUnk_0800C494:: @ 0800C494 - .incbin "baserom.gba", 0x00C494, 0x000003C - -gUnk_0800C4D0:: @ 0800C4D0 - .incbin "baserom.gba", 0x00C4D0, 0x000000B - -gUnk_0800C4DB:: @ 0800C4DB - .incbin "baserom.gba", 0x00C4DB, 0x0000031 - -gUnk_0800C50C:: @ 0800C50C - .incbin "baserom.gba", 0x00C50C, 0x0000015 - -gUnk_0800C521:: @ 0800C521 - .incbin "baserom.gba", 0x00C521, 0x000002F - -gUnk_0800C550:: @ 0800C550 - .incbin "baserom.gba", 0x00C550, 0x0000006 - -gUnk_0800C556:: @ 0800C556 - .incbin "baserom.gba", 0x00C556, 0x000002E - -gUnk_0800C584:: @ 0800C584 - .incbin "baserom.gba", 0x00C584, 0x0000016 - -gUnk_0800C59A:: @ 0800C59A - .incbin "baserom.gba", 0x00C59A, 0x000002E - -gUnk_0800C5C8:: @ 0800C5C8 - .incbin "baserom.gba", 0x00C5C8, 0x0000034 - -gUnk_0800C5FC:: @ 0800C5FC - .incbin "baserom.gba", 0x00C5FC, 0x0000004 - -gUnk_0800C600:: @ 0800C600 - .incbin "baserom.gba", 0x00C600, 0x0000007 - -gUnk_0800C607:: @ 0800C607 - .incbin "baserom.gba", 0x00C607, 0x000002D - -gUnk_0800C634:: @ 0800C634 - .incbin "baserom.gba", 0x00C634, 0x0000092 - -gUnk_0800C6C6:: @ 0800C6C6 - .incbin "baserom.gba", 0x00C6C6, 0x00000AE - -gUnk_0800C774:: @ 0800C774 - .incbin "baserom.gba", 0x00C774, 0x0000005 - -gUnk_0800C779:: @ 0800C779 - .incbin "baserom.gba", 0x00C779, 0x000008F - -gUnk_0800C808:: @ 0800C808 - .incbin "baserom.gba", 0x00C808, 0x0000059 - -gUnk_0800C861:: @ 0800C861 - .incbin "baserom.gba", 0x00C861, 0x000004F - -gUnk_0800C8B0:: @ 0800C8B0 - .incbin "baserom.gba", 0x00C8B0, 0x000002A - -gUnk_0800C8DA:: @ 0800C8DA - .incbin "baserom.gba", 0x00C8DA, 0x0000016 - -gUnk_0800C8F0:: @ 0800C8F0 - .incbin "baserom.gba", 0x00C8F0, 0x000002C - -gUnk_0800C91C:: @ 0800C91C - .incbin "baserom.gba", 0x00C91C, 0x0000015 - -gUnk_0800C931:: @ 0800C931 - .incbin "baserom.gba", 0x00C931, 0x0000032 - -gUnk_0800C963:: @ 0800C963 - .incbin "baserom.gba", 0x00C963, 0x00000A5 - -gUnk_0800CA08:: @ 0800CA08 - .incbin "baserom.gba", 0x00CA08, 0x0000084 - -gUnk_0800CA8C:: @ 0800CA8C - .incbin "baserom.gba", 0x00CA8C, 0x000001E - -gUnk_0800CAAA:: @ 0800CAAA - .incbin "baserom.gba", 0x00CAAA, 0x0000012 - -gUnk_0800CABC:: @ 0800CABC - .incbin "baserom.gba", 0x00CABC, 0x000004B - -gUnk_0800CB07:: @ 0800CB07 - .incbin "baserom.gba", 0x00CB07, 0x000004D - -gUnk_0800CB54:: @ 0800CB54 - .incbin "baserom.gba", 0x00CB54, 0x000004F - -gUnk_0800CBA3:: @ 0800CBA3 - .incbin "baserom.gba", 0x00CBA3, 0x0000031 - -gUnk_0800CBD4:: @ 0800CBD4 - .incbin "baserom.gba", 0x00CBD4, 0x0000034 - -gUnk_0800CC08:: @ 0800CC08 - .incbin "baserom.gba", 0x00CC08, 0x0000005 - -gUnk_0800CC0D:: @ 0800CC0D - .incbin "baserom.gba", 0x00CC0D, 0x0000035 - -gUnk_0800CC42:: @ 0800CC42 - .incbin "baserom.gba", 0x00CC42, 0x000002A - -gUnk_0800CC6C:: @ 0800CC6C - .incbin "baserom.gba", 0x00CC6C, 0x0000061 - -gUnk_0800CCCD:: @ 0800CCCD - .incbin "baserom.gba", 0x00CCCD, 0x0000010 - -gUnk_0800CCDD:: @ 0800CCDD - .incbin "baserom.gba", 0x00CCDD, 0x0000027 - -gUnk_0800CD04:: @ 0800CD04 - .incbin "baserom.gba", 0x00CD04, 0x0000004 - -gUnk_0800CD08:: @ 0800CD08 - .incbin "baserom.gba", 0x00CD08, 0x000005F - -gUnk_0800CD67:: @ 0800CD67 - .incbin "baserom.gba", 0x00CD67, 0x0000015 - -gUnk_0800CD7C:: @ 0800CD7C - .incbin "baserom.gba", 0x00CD7C, 0x000008B - -gUnk_0800CE07:: @ 0800CE07 - .incbin "baserom.gba", 0x00CE07, 0x00000FD - -gUnk_0800CF04:: @ 0800CF04 - .incbin "baserom.gba", 0x00CF04, 0x0000012 - -gUnk_0800CF16:: @ 0800CF16 - .incbin "baserom.gba", 0x00CF16, 0x0000035 - -gUnk_0800CF4B:: @ 0800CF4B - .incbin "baserom.gba", 0x00CF4B, 0x0000005 - -gUnk_0800CF50:: @ 0800CF50 - .incbin "baserom.gba", 0x00CF50, 0x000002B - -gUnk_0800CF7B:: @ 0800CF7B - .incbin "baserom.gba", 0x00CF7B, 0x000000D - -gUnk_0800CF88:: @ 0800CF88 - .incbin "baserom.gba", 0x00CF88, 0x000000D - -gUnk_0800CF95:: @ 0800CF95 - .incbin "baserom.gba", 0x00CF95, 0x0000014 - -gUnk_0800CFA9:: @ 0800CFA9 - .incbin "baserom.gba", 0x00CFA9, 0x0000003 - -gUnk_0800CFAC:: @ 0800CFAC - .incbin "baserom.gba", 0x00CFAC, 0x0000065 - -gUnk_0800D011:: @ 0800D011 - .incbin "baserom.gba", 0x00D011, 0x000004E - -gUnk_0800D05F:: @ 0800D05F - .incbin "baserom.gba", 0x00D05F, 0x000006F - -gUnk_0800D0CE:: @ 0800D0CE - .incbin "baserom.gba", 0x00D0CE, 0x0000059 - -gUnk_0800D127:: @ 0800D127 - .incbin "baserom.gba", 0x00D127, 0x0000069 - -gUnk_0800D190:: @ 0800D190 - .incbin "baserom.gba", 0x00D190, 0x0000024 - -gUnk_0800D1B4:: @ 0800D1B4 - .incbin "baserom.gba", 0x00D1B4, 0x0000010 - -gUnk_0800D1C4:: @ 0800D1C4 - .incbin "baserom.gba", 0x00D1C4, 0x0000010 - -gUnk_0800D1D4:: @ 0800D1D4 - .incbin "baserom.gba", 0x00D1D4, 0x000000C - -gUnk_0800D1E0:: @ 0800D1E0 - .incbin "baserom.gba", 0x00D1E0, 0x0000027 - -gUnk_0800D207:: @ 0800D207 - .incbin "baserom.gba", 0x00D207, 0x0000011 - -gUnk_0800D218:: @ 0800D218 - .incbin "baserom.gba", 0x00D218, 0x000003C - -gUnk_0800D254:: @ 0800D254 - .incbin "baserom.gba", 0x00D254, 0x0000024 - -gUnk_0800D278:: @ 0800D278 - .incbin "baserom.gba", 0x00D278, 0x0000056 - -gUnk_0800D2CE:: @ 0800D2CE - .incbin "baserom.gba", 0x00D2CE, 0x0000038 - -gUnk_0800D306:: @ 0800D306 - .incbin "baserom.gba", 0x00D306, 0x0000002 - -gUnk_0800D308:: @ 0800D308 - .incbin "baserom.gba", 0x00D308, 0x0000007 - -gUnk_0800D30F:: @ 0800D30F - .incbin "baserom.gba", 0x00D30F, 0x0000041 - -gUnk_0800D350:: @ 0800D350 - .incbin "baserom.gba", 0x00D350, 0x000009C - -gUnk_0800D3EC:: @ 0800D3EC - .incbin "baserom.gba", 0x00D3EC, 0x0000028 - -gUnk_0800D414:: @ 0800D414 - .incbin "baserom.gba", 0x00D414, 0x0000038 - -gUnk_0800D44C:: @ 0800D44C - .incbin "baserom.gba", 0x00D44C, 0x0000073 - -gUnk_0800D4BF:: @ 0800D4BF - .incbin "baserom.gba", 0x00D4BF, 0x000001D - -gUnk_0800D4DC:: @ 0800D4DC - .incbin "baserom.gba", 0x00D4DC, 0x00000C0 - -gUnk_0800D59C:: @ 0800D59C - .incbin "baserom.gba", 0x00D59C, 0x0000049 - -gUnk_0800D5E5:: @ 0800D5E5 - .incbin "baserom.gba", 0x00D5E5, 0x0000027 - -gUnk_0800D60C:: @ 0800D60C - .incbin "baserom.gba", 0x00D60C, 0x000001F - -gUnk_0800D62B:: @ 0800D62B - .incbin "baserom.gba", 0x00D62B, 0x0000089 - -gUnk_0800D6B4:: @ 0800D6B4 - .incbin "baserom.gba", 0x00D6B4, 0x0000006 - -gUnk_0800D6BA:: @ 0800D6BA - .incbin "baserom.gba", 0x00D6BA, 0x0000016 - -gUnk_0800D6D0:: @ 0800D6D0 - .incbin "baserom.gba", 0x00D6D0, 0x0000020 - -gUnk_0800D6F0:: @ 0800D6F0 - .incbin "baserom.gba", 0x00D6F0, 0x0000012 - -gUnk_0800D702:: @ 0800D702 - .incbin "baserom.gba", 0x00D702, 0x0000001 - -gUnk_0800D703:: @ 0800D703 - .incbin "baserom.gba", 0x00D703, 0x000000D - -gUnk_0800D710:: @ 0800D710 - .incbin "baserom.gba", 0x00D710, 0x0000015 - -gUnk_0800D725:: @ 0800D725 - .incbin "baserom.gba", 0x00D725, 0x0000003 - -gUnk_0800D728:: @ 0800D728 - .incbin "baserom.gba", 0x00D728, 0x0000044 - -gUnk_0800D76C:: @ 0800D76C - .incbin "baserom.gba", 0x00D76C, 0x0000063 - -gUnk_0800D7CF:: @ 0800D7CF - .incbin "baserom.gba", 0x00D7CF, 0x000000D - -gUnk_0800D7DC:: @ 0800D7DC - .incbin "baserom.gba", 0x00D7DC, 0x0000098 - -gUnk_0800D874:: @ 0800D874 - .incbin "baserom.gba", 0x00D874, 0x0000070 - -gUnk_0800D8E4:: @ 0800D8E4 - .incbin "baserom.gba", 0x00D8E4, 0x0000022 - -gUnk_0800D906:: @ 0800D906 - .incbin "baserom.gba", 0x00D906, 0x000004E - -gUnk_0800D954:: @ 0800D954 - .incbin "baserom.gba", 0x00D954, 0x0000029 - -gUnk_0800D97D:: @ 0800D97D - .incbin "baserom.gba", 0x00D97D, 0x0000004 - -gUnk_0800D981:: @ 0800D981 - .incbin "baserom.gba", 0x00D981, 0x0000090 - -gUnk_0800DA11:: @ 0800DA11 - .incbin "baserom.gba", 0x00DA11, 0x0000017 - -gUnk_0800DA28:: @ 0800DA28 - .incbin "baserom.gba", 0x00DA28, 0x0000024 - -gUnk_0800DA4C:: @ 0800DA4C - .incbin "baserom.gba", 0x00DA4C, 0x0000001 - -gUnk_0800DA4D:: @ 0800DA4D - .incbin "baserom.gba", 0x00DA4D, 0x0000013 - -gUnk_0800DA60:: @ 0800DA60 - .incbin "baserom.gba", 0x00DA60, 0x00000AE - -gUnk_0800DB0E:: @ 0800DB0E - .incbin "baserom.gba", 0x00DB0E, 0x000000A - -gUnk_0800DB18:: @ 0800DB18 - .incbin "baserom.gba", 0x00DB18, 0x0000010 - -gUnk_0800DB28:: @ 0800DB28 - .incbin "baserom.gba", 0x00DB28, 0x0000022 - -gUnk_0800DB4A:: @ 0800DB4A - .incbin "baserom.gba", 0x00DB4A, 0x000002E - -gUnk_0800DB78:: @ 0800DB78 - .incbin "baserom.gba", 0x00DB78, 0x0000010 - -gUnk_0800DB88:: @ 0800DB88 - .incbin "baserom.gba", 0x00DB88, 0x0000088 - -gUnk_0800DC10:: @ 0800DC10 - .incbin "baserom.gba", 0x00DC10, 0x0000009 - -gUnk_0800DC19:: @ 0800DC19 - .incbin "baserom.gba", 0x00DC19, 0x0000078 - -gUnk_0800DC91:: @ 0800DC91 - .incbin "baserom.gba", 0x00DC91, 0x000001B - -gUnk_0800DCAC:: @ 0800DCAC - .incbin "baserom.gba", 0x00DCAC, 0x0000030 - -gUnk_0800DCDC:: @ 0800DCDC - .incbin "baserom.gba", 0x00DCDC, 0x0000028 - -gUnk_0800DD04:: @ 0800DD04 - .incbin "baserom.gba", 0x00DD04, 0x000000C - -gUnk_0800DD10:: @ 0800DD10 - .incbin "baserom.gba", 0x00DD10, 0x0000009 - -gUnk_0800DD19:: @ 0800DD19 - .incbin "baserom.gba", 0x00DD19, 0x0000009 - -gUnk_0800DD22:: @ 0800DD22 - .incbin "baserom.gba", 0x00DD22, 0x000006B - -gUnk_0800DD8D:: @ 0800DD8D - .incbin "baserom.gba", 0x00DD8D, 0x000001D - -gUnk_0800DDAA:: @ 0800DDAA - .incbin "baserom.gba", 0x00DDAA, 0x000003E - -gUnk_0800DDE8:: @ 0800DDE8 - .incbin "baserom.gba", 0x00DDE8, 0x0000014 - -gUnk_0800DDFC:: @ 0800DDFC - .incbin "baserom.gba", 0x00DDFC, 0x0000004 - -gUnk_0800DE00:: @ 0800DE00 - .incbin "baserom.gba", 0x00DE00, 0x0000078 - -gUnk_0800DE78:: @ 0800DE78 - .incbin "baserom.gba", 0x00DE78, 0x0000038 - -gUnk_0800DEB0:: @ 0800DEB0 - .incbin "baserom.gba", 0x00DEB0, 0x0000024 - -gUnk_0800DED4:: @ 0800DED4 - .incbin "baserom.gba", 0x00DED4, 0x0000022 - -gUnk_0800DEF6:: @ 0800DEF6 - .incbin "baserom.gba", 0x00DEF6, 0x0000011 - -gUnk_0800DF07:: @ 0800DF07 - .incbin "baserom.gba", 0x00DF07, 0x000001D - -gUnk_0800DF24:: @ 0800DF24 - .incbin "baserom.gba", 0x00DF24, 0x0000090 - -gUnk_0800DFB4:: @ 0800DFB4 - .incbin "baserom.gba", 0x00DFB4, 0x000001C - -gUnk_0800DFD0:: @ 0800DFD0 - .incbin "baserom.gba", 0x00DFD0, 0x0000007 - -gUnk_0800DFD7:: @ 0800DFD7 - .incbin "baserom.gba", 0x00DFD7, 0x0000007 - -gUnk_0800DFDE:: @ 0800DFDE - .incbin "baserom.gba", 0x00DFDE, 0x0000006 - -gUnk_0800DFE4:: @ 0800DFE4 - .incbin "baserom.gba", 0x00DFE4, 0x000006C - -gUnk_0800E050:: @ 0800E050 - .incbin "baserom.gba", 0x00E050, 0x000006C - -gUnk_0800E0BC:: @ 0800E0BC - .incbin "baserom.gba", 0x00E0BC, 0x000003A - -gUnk_0800E0F6:: @ 0800E0F6 - .incbin "baserom.gba", 0x00E0F6, 0x000004A - -gUnk_0800E140:: @ 0800E140 - .incbin "baserom.gba", 0x00E140, 0x0000013 - -gUnk_0800E153:: @ 0800E153 - .incbin "baserom.gba", 0x00E153, 0x0000001 - -gUnk_0800E154:: @ 0800E154 - .incbin "baserom.gba", 0x00E154, 0x0000071 - -gUnk_0800E1C5:: @ 0800E1C5 - .incbin "baserom.gba", 0x00E1C5, 0x000003B - -gUnk_0800E200:: @ 0800E200 - .incbin "baserom.gba", 0x00E200, 0x0000100 - -gUnk_0800E300:: @ 0800E300 - .incbin "baserom.gba", 0x00E300, 0x0000005 - -gUnk_0800E305:: @ 0800E305 - .incbin "baserom.gba", 0x00E305, 0x0000002 - -gUnk_0800E307:: @ 0800E307 - .incbin "baserom.gba", 0x00E307, 0x0000005 - -gUnk_0800E30C:: @ 0800E30C - .incbin "baserom.gba", 0x00E30C, 0x000001D - -gUnk_0800E329:: @ 0800E329 - .incbin "baserom.gba", 0x00E329, 0x0000027 - -gUnk_0800E350:: @ 0800E350 - .incbin "baserom.gba", 0x00E350, 0x000009E - -gUnk_0800E3EE:: @ 0800E3EE - .incbin "baserom.gba", 0x00E3EE, 0x000000B - -gUnk_0800E3F9:: @ 0800E3F9 - .incbin "baserom.gba", 0x00E3F9, 0x0000001 - -gUnk_0800E3FA:: @ 0800E3FA - .incbin "baserom.gba", 0x00E3FA, 0x0000002 - -gUnk_0800E3FC:: @ 0800E3FC - .incbin "baserom.gba", 0x00E3FC, 0x0000004 - -gUnk_0800E400:: @ 0800E400 - .incbin "baserom.gba", 0x00E400, 0x0000008 - -gUnk_0800E408:: @ 0800E408 - .incbin "baserom.gba", 0x00E408, 0x0000003 - -gUnk_0800E40B:: @ 0800E40B - .incbin "baserom.gba", 0x00E40B, 0x0000006 - -gUnk_0800E411:: @ 0800E411 - .incbin "baserom.gba", 0x00E411, 0x000001F - -gUnk_0800E430:: @ 0800E430 - .incbin "baserom.gba", 0x00E430, 0x0000004 - -gUnk_0800E434:: @ 0800E434 - .incbin "baserom.gba", 0x00E434, 0x0000038 - -gUnk_0800E46C:: @ 0800E46C - .incbin "baserom.gba", 0x00E46C, 0x000001D - -gUnk_0800E489:: @ 0800E489 - .incbin "baserom.gba", 0x00E489, 0x0000010 - -gUnk_0800E499:: @ 0800E499 - .incbin "baserom.gba", 0x00E499, 0x000000B - -gUnk_0800E4A4:: @ 0800E4A4 - .incbin "baserom.gba", 0x00E4A4, 0x000003F - -gUnk_0800E4E3:: @ 0800E4E3 - .incbin "baserom.gba", 0x00E4E3, 0x0000021 - -gUnk_0800E504:: @ 0800E504 - .incbin "baserom.gba", 0x00E504, 0x0000008 - -gUnk_0800E50C:: @ 0800E50C - .incbin "baserom.gba", 0x00E50C, 0x0000038 - -gUnk_0800E544:: @ 0800E544 - .incbin "baserom.gba", 0x00E544, 0x0000048 - -gUnk_0800E58C:: @ 0800E58C - .incbin "baserom.gba", 0x00E58C, 0x0000038 - -gUnk_0800E5C4:: @ 0800E5C4 - .incbin "baserom.gba", 0x00E5C4, 0x000003C - -gUnk_0800E600:: @ 0800E600 - .incbin "baserom.gba", 0x00E600, 0x000000E - -gUnk_0800E60E:: @ 0800E60E - .incbin "baserom.gba", 0x00E60E, 0x000001E - -gUnk_0800E62C:: @ 0800E62C - .incbin "baserom.gba", 0x00E62C, 0x000002C - -gUnk_0800E658:: @ 0800E658 - .incbin "baserom.gba", 0x00E658, 0x000002C - -gUnk_0800E684:: @ 0800E684 - .incbin "baserom.gba", 0x00E684, 0x000002C - -gUnk_0800E6B0:: @ 0800E6B0 - .incbin "baserom.gba", 0x00E6B0, 0x0000038 - -gUnk_0800E6E8:: @ 0800E6E8 - .incbin "baserom.gba", 0x00E6E8, 0x000001F - -gUnk_0800E707:: @ 0800E707 - .incbin "baserom.gba", 0x00E707, 0x0000003 - -gUnk_0800E70A:: @ 0800E70A - .incbin "baserom.gba", 0x00E70A, 0x000002A - -gUnk_0800E734:: @ 0800E734 - .incbin "baserom.gba", 0x00E734, 0x000002C - -gUnk_0800E760:: @ 0800E760 - .incbin "baserom.gba", 0x00E760, 0x0000079 - -gUnk_0800E7D9:: @ 0800E7D9 - .incbin "baserom.gba", 0x00E7D9, 0x000001B - -gUnk_0800E7F4:: @ 0800E7F4 - .incbin "baserom.gba", 0x00E7F4, 0x0000006 - -gUnk_0800E7FA:: @ 0800E7FA - .incbin "baserom.gba", 0x00E7FA, 0x0000029 - -gUnk_0800E823:: @ 0800E823 - .incbin "baserom.gba", 0x00E823, 0x0000001 - -gUnk_0800E824:: @ 0800E824 - .incbin "baserom.gba", 0x00E824, 0x00000B7 - -gUnk_0800E8DB:: @ 0800E8DB - .incbin "baserom.gba", 0x00E8DB, 0x0000045 - -gUnk_0800E920:: @ 0800E920 - .incbin "baserom.gba", 0x00E920, 0x0000044 - -gUnk_0800E964:: @ 0800E964 - .incbin "baserom.gba", 0x00E964, 0x0000072 - -gUnk_0800E9D6:: @ 0800E9D6 - .incbin "baserom.gba", 0x00E9D6, 0x000001E - -gUnk_0800E9F4:: @ 0800E9F4 - .incbin "baserom.gba", 0x00E9F4, 0x0000028 - -gUnk_0800EA1C:: @ 0800EA1C - .incbin "baserom.gba", 0x00EA1C, 0x0000038 - -gUnk_0800EA54:: @ 0800EA54 - .incbin "baserom.gba", 0x00EA54, 0x0000050 - -gUnk_0800EAA4:: @ 0800EAA4 - .incbin "baserom.gba", 0x00EAA4, 0x0000047 - -gUnk_0800EAEB:: @ 0800EAEB - .incbin "baserom.gba", 0x00EAEB, 0x000000D - -gUnk_0800EAF8:: @ 0800EAF8 - .incbin "baserom.gba", 0x00EAF8, 0x0000034 - -gUnk_0800EB2C:: @ 0800EB2C - .incbin "baserom.gba", 0x00EB2C, 0x0000038 - -gUnk_0800EB64:: @ 0800EB64 - .incbin "baserom.gba", 0x00EB64, 0x000005C - -gUnk_0800EBC0:: @ 0800EBC0 - .incbin "baserom.gba", 0x00EBC0, 0x000001C - -gUnk_0800EBDC:: @ 0800EBDC - .incbin "baserom.gba", 0x00EBDC, 0x0000004 - -gUnk_0800EBE0:: @ 0800EBE0 - .incbin "baserom.gba", 0x00EBE0, 0x0000010 - -gUnk_0800EBF0:: @ 0800EBF0 - .incbin "baserom.gba", 0x00EBF0, 0x0000018 - -gUnk_0800EC08:: @ 0800EC08 - .incbin "baserom.gba", 0x00EC08, 0x000000C - -gUnk_0800EC14:: @ 0800EC14 - .incbin "baserom.gba", 0x00EC14, 0x0000040 - -gUnk_0800EC54:: @ 0800EC54 - .incbin "baserom.gba", 0x00EC54, 0x000000D - -gUnk_0800EC61:: @ 0800EC61 - .incbin "baserom.gba", 0x00EC61, 0x000002B - -gUnk_0800EC8C:: @ 0800EC8C - .incbin "baserom.gba", 0x00EC8C, 0x0000065 - -gUnk_0800ECF1:: @ 0800ECF1 - .incbin "baserom.gba", 0x00ECF1, 0x0000013 - -gUnk_0800ED04:: @ 0800ED04 - .incbin "baserom.gba", 0x00ED04, 0x0000008 - -gUnk_0800ED0C:: @ 0800ED0C - .incbin "baserom.gba", 0x00ED0C, 0x0000001 - -gUnk_0800ED0D:: @ 0800ED0D - .incbin "baserom.gba", 0x00ED0D, 0x000004F - -gUnk_0800ED5C:: @ 0800ED5C - .incbin "baserom.gba", 0x00ED5C, 0x0000034 - -gUnk_0800ED90:: @ 0800ED90 - .incbin "baserom.gba", 0x00ED90, 0x0000049 - -gUnk_0800EDD9:: @ 0800EDD9 - .incbin "baserom.gba", 0x00EDD9, 0x0000007 - -gUnk_0800EDE0:: @ 0800EDE0 - .incbin "baserom.gba", 0x00EDE0, 0x0000029 - -gUnk_0800EE09:: @ 0800EE09 - .incbin "baserom.gba", 0x00EE09, 0x0000047 - -gUnk_0800EE50:: @ 0800EE50 - .incbin "baserom.gba", 0x00EE50, 0x000003C - -gUnk_0800EE8C:: @ 0800EE8C - .incbin "baserom.gba", 0x00EE8C, 0x0000054 - -gUnk_0800EEE0:: @ 0800EEE0 - .incbin "baserom.gba", 0x00EEE0, 0x000001D - -gUnk_0800EEFD:: @ 0800EEFD - .incbin "baserom.gba", 0x00EEFD, 0x000000A - -gUnk_0800EF07:: @ 0800EF07 - .incbin "baserom.gba", 0x00EF07, 0x000000B - -gUnk_0800EF12:: @ 0800EF12 - .incbin "baserom.gba", 0x00EF12, 0x000002E - -gUnk_0800EF40:: @ 0800EF40 - .incbin "baserom.gba", 0x00EF40, 0x0000053 - -gUnk_0800EF93:: @ 0800EF93 - .incbin "baserom.gba", 0x00EF93, 0x000002D - -gUnk_0800EFC0:: @ 0800EFC0 - .incbin "baserom.gba", 0x00EFC0, 0x0000020 - -gUnk_0800EFE0:: @ 0800EFE0 - .incbin "baserom.gba", 0x00EFE0, 0x0000004 - -gUnk_0800EFE4:: @ 0800EFE4 - .incbin "baserom.gba", 0x00EFE4, 0x00000AC - -gUnk_0800F090:: @ 0800F090 - .incbin "baserom.gba", 0x00F090, 0x0000004 - -gUnk_0800F094:: @ 0800F094 - .incbin "baserom.gba", 0x00F094, 0x0000042 - -gUnk_0800F0D6:: @ 0800F0D6 - .incbin "baserom.gba", 0x00F0D6, 0x000000C - -gUnk_0800F0E2:: @ 0800F0E2 - .incbin "baserom.gba", 0x00F0E2, 0x0000010 - -gUnk_0800F0F2:: @ 0800F0F2 - .incbin "baserom.gba", 0x00F0F2, 0x0000001 - -gUnk_0800F0F3:: @ 0800F0F3 - .incbin "baserom.gba", 0x00F0F3, 0x0000001 - -gUnk_0800F0F4:: @ 0800F0F4 - .incbin "baserom.gba", 0x00F0F4, 0x0000058 - -gUnk_0800F14C:: @ 0800F14C - .incbin "baserom.gba", 0x00F14C, 0x0000038 - -gUnk_0800F184:: @ 0800F184 - .incbin "baserom.gba", 0x00F184, 0x000005A - -gUnk_0800F1DE:: @ 0800F1DE - .incbin "baserom.gba", 0x00F1DE, 0x0000003 - -gUnk_0800F1E1:: @ 0800F1E1 - .incbin "baserom.gba", 0x00F1E1, 0x0000004 - -gUnk_0800F1E5:: @ 0800F1E5 - .incbin "baserom.gba", 0x00F1E5, 0x0000002 - -gUnk_0800F1E7:: @ 0800F1E7 - .incbin "baserom.gba", 0x00F1E7, 0x0000006 - -gUnk_0800F1ED:: @ 0800F1ED - .incbin "baserom.gba", 0x00F1ED, 0x000000E - -gUnk_0800F1FB:: @ 0800F1FB - .incbin "baserom.gba", 0x00F1FB, 0x0000002 - -gUnk_0800F1FD:: @ 0800F1FD - .incbin "baserom.gba", 0x00F1FD, 0x0000006 - -gUnk_0800F203:: @ 0800F203 - .incbin "baserom.gba", 0x00F203, 0x0000004 - -gUnk_0800F207:: @ 0800F207 - .incbin "baserom.gba", 0x00F207, 0x0000009 - -gUnk_0800F210:: @ 0800F210 - .incbin "baserom.gba", 0x00F210, 0x00000DB - -gUnk_0800F2EB:: @ 0800F2EB - .incbin "baserom.gba", 0x00F2EB, 0x0000005 - -gUnk_0800F2F0:: @ 0800F2F0 - .incbin "baserom.gba", 0x00F2F0, 0x0000002 - -gUnk_0800F2F2:: @ 0800F2F2 - .incbin "baserom.gba", 0x00F2F2, 0x0000011 - -gUnk_0800F303:: @ 0800F303 - .incbin "baserom.gba", 0x00F303, 0x0000099 - -gUnk_0800F39C:: @ 0800F39C - .incbin "baserom.gba", 0x00F39C, 0x000003F - -gUnk_0800F3DB:: @ 0800F3DB - .incbin "baserom.gba", 0x00F3DB, 0x000000A - -gUnk_0800F3E5:: @ 0800F3E5 - .incbin "baserom.gba", 0x00F3E5, 0x0000001 - -gUnk_0800F3E6:: @ 0800F3E6 - .incbin "baserom.gba", 0x00F3E6, 0x0000002 - -gUnk_0800F3E8:: @ 0800F3E8 - .incbin "baserom.gba", 0x00F3E8, 0x0000003 - -gUnk_0800F3EB:: @ 0800F3EB - .incbin "baserom.gba", 0x00F3EB, 0x0000002 - -gUnk_0800F3ED:: @ 0800F3ED - .incbin "baserom.gba", 0x00F3ED, 0x0000008 - -gUnk_0800F3F5:: @ 0800F3F5 - .incbin "baserom.gba", 0x00F3F5, 0x0000004 - -gUnk_0800F3F9:: @ 0800F3F9 - .incbin "baserom.gba", 0x00F3F9, 0x0000007 - -gUnk_0800F400:: @ 0800F400 - .incbin "baserom.gba", 0x00F400, 0x0000008 - -gUnk_0800F408:: @ 0800F408 - .incbin "baserom.gba", 0x00F408, 0x0000001 - -gUnk_0800F409:: @ 0800F409 - .incbin "baserom.gba", 0x00F409, 0x0000007 - -gUnk_0800F410:: @ 0800F410 - .incbin "baserom.gba", 0x00F410, 0x0000016 - -gUnk_0800F426:: @ 0800F426 - .incbin "baserom.gba", 0x00F426, 0x000000A - -gUnk_0800F430:: @ 0800F430 - .incbin "baserom.gba", 0x00F430, 0x0000094 - -gUnk_0800F4C4:: @ 0800F4C4 - .incbin "baserom.gba", 0x00F4C4, 0x0000026 - -gUnk_0800F4EA:: @ 0800F4EA - .incbin "baserom.gba", 0x00F4EA, 0x0000001 - -gUnk_0800F4EB:: @ 0800F4EB - .incbin "baserom.gba", 0x00F4EB, 0x0000004 - -gUnk_0800F4EF:: @ 0800F4EF - .incbin "baserom.gba", 0x00F4EF, 0x0000001 - -gUnk_0800F4F0:: @ 0800F4F0 - .incbin "baserom.gba", 0x00F4F0, 0x0000001 - -gUnk_0800F4F1:: @ 0800F4F1 - .incbin "baserom.gba", 0x00F4F1, 0x0000002 - -gUnk_0800F4F3:: @ 0800F4F3 - .incbin "baserom.gba", 0x00F4F3, 0x0000004 - -gUnk_0800F4F7:: @ 0800F4F7 - .incbin "baserom.gba", 0x00F4F7, 0x0000002 - -gUnk_0800F4F9:: @ 0800F4F9 - .incbin "baserom.gba", 0x00F4F9, 0x0000008 - -gUnk_0800F501:: @ 0800F501 - .incbin "baserom.gba", 0x00F501, 0x000000D - -gUnk_0800F50E:: @ 0800F50E - .incbin "baserom.gba", 0x00F50E, 0x0000046 - -gUnk_0800F554:: @ 0800F554 - .incbin "baserom.gba", 0x00F554, 0x0000030 - -gUnk_0800F584:: @ 0800F584 - .incbin "baserom.gba", 0x00F584, 0x000000B - -gUnk_0800F58F:: @ 0800F58F - .incbin "baserom.gba", 0x00F58F, 0x0000021 - -gUnk_0800F5B0:: @ 0800F5B0 - .incbin "baserom.gba", 0x00F5B0, 0x0000039 - -gUnk_0800F5E9:: @ 0800F5E9 - .incbin "baserom.gba", 0x00F5E9, 0x0000003 - -gUnk_0800F5EC:: @ 0800F5EC - .incbin "baserom.gba", 0x00F5EC, 0x0000001 - -gUnk_0800F5ED:: @ 0800F5ED - .incbin "baserom.gba", 0x00F5ED, 0x0000001 - -gUnk_0800F5EE:: @ 0800F5EE - .incbin "baserom.gba", 0x00F5EE, 0x0000001 - -gUnk_0800F5EF:: @ 0800F5EF - .incbin "baserom.gba", 0x00F5EF, 0x0000001 - -gUnk_0800F5F0:: @ 0800F5F0 - .incbin "baserom.gba", 0x00F5F0, 0x0000002 - -gUnk_0800F5F2:: @ 0800F5F2 - .incbin "baserom.gba", 0x00F5F2, 0x0000002 - -gUnk_0800F5F4:: @ 0800F5F4 - .incbin "baserom.gba", 0x00F5F4, 0x0000008 - -gUnk_0800F5FC:: @ 0800F5FC - .incbin "baserom.gba", 0x00F5FC, 0x0000003 - -gUnk_0800F5FF:: @ 0800F5FF - .incbin "baserom.gba", 0x00F5FF, 0x0000007 - -gUnk_0800F606:: @ 0800F606 - .incbin "baserom.gba", 0x00F606, 0x0000001 - -gUnk_0800F607:: @ 0800F607 - .incbin "baserom.gba", 0x00F607, 0x0000001 - -gUnk_0800F608:: @ 0800F608 - .incbin "baserom.gba", 0x00F608, 0x0000002 - -gUnk_0800F60A:: @ 0800F60A - .incbin "baserom.gba", 0x00F60A, 0x000001E - -gUnk_0800F628:: @ 0800F628 - .incbin "baserom.gba", 0x00F628, 0x0000028 - -gUnk_0800F650:: @ 0800F650 - .incbin "baserom.gba", 0x00F650, 0x0000038 - -gUnk_0800F688:: @ 0800F688 - .incbin "baserom.gba", 0x00F688, 0x0000018 - -gUnk_0800F6A0:: @ 0800F6A0 - .incbin "baserom.gba", 0x00F6A0, 0x0000028 - -gUnk_0800F6C8:: @ 0800F6C8 - .incbin "baserom.gba", 0x00F6C8, 0x0000018 - -gUnk_0800F6E0:: @ 0800F6E0 - .incbin "baserom.gba", 0x00F6E0, 0x0000009 - -gUnk_0800F6E9:: @ 0800F6E9 - .incbin "baserom.gba", 0x00F6E9, 0x0000003 - -gUnk_0800F6EC:: @ 0800F6EC - .incbin "baserom.gba", 0x00F6EC, 0x0000001 - -gUnk_0800F6ED:: @ 0800F6ED - .incbin "baserom.gba", 0x00F6ED, 0x0000001 - -gUnk_0800F6EE:: @ 0800F6EE - .incbin "baserom.gba", 0x00F6EE, 0x0000001 - -gUnk_0800F6EF:: @ 0800F6EF - .incbin "baserom.gba", 0x00F6EF, 0x0000001 - -gUnk_0800F6F0:: @ 0800F6F0 - .incbin "baserom.gba", 0x00F6F0, 0x0000001 - -gUnk_0800F6F1:: @ 0800F6F1 - .incbin "baserom.gba", 0x00F6F1, 0x0000001 - -gUnk_0800F6F2:: @ 0800F6F2 - .incbin "baserom.gba", 0x00F6F2, 0x0000001 - -gUnk_0800F6F3:: @ 0800F6F3 - .incbin "baserom.gba", 0x00F6F3, 0x0000001 - -gUnk_0800F6F4:: @ 0800F6F4 - .incbin "baserom.gba", 0x00F6F4, 0x0000005 - -gUnk_0800F6F9:: @ 0800F6F9 - .incbin "baserom.gba", 0x00F6F9, 0x0000005 - -gUnk_0800F6FE:: @ 0800F6FE - .incbin "baserom.gba", 0x00F6FE, 0x0000004 - -gUnk_0800F702:: @ 0800F702 - .incbin "baserom.gba", 0x00F702, 0x0000004 - -gUnk_0800F706:: @ 0800F706 - .incbin "baserom.gba", 0x00F706, 0x0000018 - -gUnk_0800F71E:: @ 0800F71E - .incbin "baserom.gba", 0x00F71E, 0x0000006 - -gUnk_0800F724:: @ 0800F724 - .incbin "baserom.gba", 0x00F724, 0x0000010 - -gUnk_0800F734:: @ 0800F734 - .incbin "baserom.gba", 0x00F734, 0x0000008 - -gUnk_0800F73C:: @ 0800F73C - .incbin "baserom.gba", 0x00F73C, 0x00000AA - -gUnk_0800F7E6:: @ 0800F7E6 - .incbin "baserom.gba", 0x00F7E6, 0x0000005 - -gUnk_0800F7EB:: @ 0800F7EB - .incbin "baserom.gba", 0x00F7EB, 0x0000003 - -gUnk_0800F7EE:: @ 0800F7EE - .incbin "baserom.gba", 0x00F7EE, 0x0000001 - -gUnk_0800F7EF:: @ 0800F7EF - .incbin "baserom.gba", 0x00F7EF, 0x0000001 - -gUnk_0800F7F0:: @ 0800F7F0 - .incbin "baserom.gba", 0x00F7F0, 0x0000004 - -gUnk_0800F7F4:: @ 0800F7F4 - .incbin "baserom.gba", 0x00F7F4, 0x0000001 - -gUnk_0800F7F5:: @ 0800F7F5 - .incbin "baserom.gba", 0x00F7F5, 0x0000002 - -gUnk_0800F7F7:: @ 0800F7F7 - .incbin "baserom.gba", 0x00F7F7, 0x0000005 - -gUnk_0800F7FC:: @ 0800F7FC - .incbin "baserom.gba", 0x00F7FC, 0x0000001 - -gUnk_0800F7FD:: @ 0800F7FD - .incbin "baserom.gba", 0x00F7FD, 0x0000002 - -gUnk_0800F7FF:: @ 0800F7FF - .incbin "baserom.gba", 0x00F7FF, 0x0000001 - -gUnk_0800F800:: @ 0800F800 - .incbin "baserom.gba", 0x00F800, 0x0000005 - -gUnk_0800F805:: @ 0800F805 - .incbin "baserom.gba", 0x00F805, 0x0000003 - -gUnk_0800F808:: @ 0800F808 - .incbin "baserom.gba", 0x00F808, 0x00000E7 - -gUnk_0800F8EF:: @ 0800F8EF - .incbin "baserom.gba", 0x00F8EF, 0x0000001 - -gUnk_0800F8F0:: @ 0800F8F0 - .incbin "baserom.gba", 0x00F8F0, 0x0000001 - -gUnk_0800F8F1:: @ 0800F8F1 - .incbin "baserom.gba", 0x00F8F1, 0x0000001 - -gUnk_0800F8F2:: @ 0800F8F2 - .incbin "baserom.gba", 0x00F8F2, 0x0000001 - -gUnk_0800F8F3:: @ 0800F8F3 - .incbin "baserom.gba", 0x00F8F3, 0x0000001 - -gUnk_0800F8F4:: @ 0800F8F4 - .incbin "baserom.gba", 0x00F8F4, 0x0000001 - -gUnk_0800F8F5:: @ 0800F8F5 - .incbin "baserom.gba", 0x00F8F5, 0x0000003 - -gUnk_0800F8F8:: @ 0800F8F8 - .incbin "baserom.gba", 0x00F8F8, 0x0000001 - -gUnk_0800F8F9:: @ 0800F8F9 - .incbin "baserom.gba", 0x00F8F9, 0x0000007 - -gUnk_0800F900:: @ 0800F900 - .incbin "baserom.gba", 0x00F900, 0x0000002 - -gUnk_0800F902:: @ 0800F902 - .incbin "baserom.gba", 0x00F902, 0x0000014 - -gUnk_0800F916:: @ 0800F916 - .incbin "baserom.gba", 0x00F916, 0x00000DA - -gUnk_0800F9F0:: @ 0800F9F0 - .incbin "baserom.gba", 0x00F9F0, 0x0000002 - -gUnk_0800F9F2:: @ 0800F9F2 - .incbin "baserom.gba", 0x00F9F2, 0x0000001 - -gUnk_0800F9F3:: @ 0800F9F3 - .incbin "baserom.gba", 0x00F9F3, 0x0000001 - -gUnk_0800F9F4:: @ 0800F9F4 - .incbin "baserom.gba", 0x00F9F4, 0x0000002 - -gUnk_0800F9F6:: @ 0800F9F6 - .incbin "baserom.gba", 0x00F9F6, 0x0000001 - -gUnk_0800F9F7:: @ 0800F9F7 - .incbin "baserom.gba", 0x00F9F7, 0x0000001 - -gUnk_0800F9F8:: @ 0800F9F8 - .incbin "baserom.gba", 0x00F9F8, 0x000000A - -gUnk_0800FA02:: @ 0800FA02 - .incbin "baserom.gba", 0x00FA02, 0x0000005 - -gUnk_0800FA07:: @ 0800FA07 - .incbin "baserom.gba", 0x00FA07, 0x0000001 - -gUnk_0800FA08:: @ 0800FA08 - .incbin "baserom.gba", 0x00FA08, 0x0000001 - -gUnk_0800FA09:: @ 0800FA09 - .incbin "baserom.gba", 0x00FA09, 0x0000004 - -gUnk_0800FA0D:: @ 0800FA0D - .incbin "baserom.gba", 0x00FA0D, 0x000006B - -gUnk_0800FA78:: @ 0800FA78 - .incbin "baserom.gba", 0x00FA78, 0x0000048 - -gUnk_0800FAC0:: @ 0800FAC0 - .incbin "baserom.gba", 0x00FAC0, 0x0000024 - -gUnk_0800FAE4:: @ 0800FAE4 - .incbin "baserom.gba", 0x00FAE4, 0x000000F - -gUnk_0800FAF3:: @ 0800FAF3 - .incbin "baserom.gba", 0x00FAF3, 0x0000002 - -gUnk_0800FAF5:: @ 0800FAF5 - .incbin "baserom.gba", 0x00FAF5, 0x0000001 - -gUnk_0800FAF6:: @ 0800FAF6 - .incbin "baserom.gba", 0x00FAF6, 0x0000001 - -gUnk_0800FAF7:: @ 0800FAF7 - .incbin "baserom.gba", 0x00FAF7, 0x0000001 - -gUnk_0800FAF8:: @ 0800FAF8 - .incbin "baserom.gba", 0x00FAF8, 0x0000005 - -gUnk_0800FAFD:: @ 0800FAFD - .incbin "baserom.gba", 0x00FAFD, 0x0000001 - -gUnk_0800FAFE:: @ 0800FAFE - .incbin "baserom.gba", 0x00FAFE, 0x0000001 - -gUnk_0800FAFF:: @ 0800FAFF - .incbin "baserom.gba", 0x00FAFF, 0x0000001 - -gUnk_0800FB00:: @ 0800FB00 - .incbin "baserom.gba", 0x00FB00, 0x0000001 - -gUnk_0800FB01:: @ 0800FB01 - .incbin "baserom.gba", 0x00FB01, 0x0000001 - -gUnk_0800FB02:: @ 0800FB02 - .incbin "baserom.gba", 0x00FB02, 0x0000002 - -gUnk_0800FB04:: @ 0800FB04 - .incbin "baserom.gba", 0x00FB04, 0x0000004 - -gUnk_0800FB08:: @ 0800FB08 - .incbin "baserom.gba", 0x00FB08, 0x0000002 - -gUnk_0800FB0A:: @ 0800FB0A - .incbin "baserom.gba", 0x00FB0A, 0x0000027 - -gUnk_0800FB31:: @ 0800FB31 - .incbin "baserom.gba", 0x00FB31, 0x0000013 - -gUnk_0800FB44:: @ 0800FB44 - .incbin "baserom.gba", 0x00FB44, 0x0000077 - -gUnk_0800FBBB:: @ 0800FBBB - .incbin "baserom.gba", 0x00FBBB, 0x0000035 - -gUnk_0800FBF0:: @ 0800FBF0 - .incbin "baserom.gba", 0x00FBF0, 0x0000003 - -gUnk_0800FBF3:: @ 0800FBF3 - .incbin "baserom.gba", 0x00FBF3, 0x0000002 - -gUnk_0800FBF5:: @ 0800FBF5 - .incbin "baserom.gba", 0x00FBF5, 0x0000001 - -gUnk_0800FBF6:: @ 0800FBF6 - .incbin "baserom.gba", 0x00FBF6, 0x0000002 - -gUnk_0800FBF8:: @ 0800FBF8 - .incbin "baserom.gba", 0x00FBF8, 0x0000001 - -gUnk_0800FBF9:: @ 0800FBF9 - .incbin "baserom.gba", 0x00FBF9, 0x0000001 - -gUnk_0800FBFA:: @ 0800FBFA - .incbin "baserom.gba", 0x00FBFA, 0x0000001 - -gUnk_0800FBFB:: @ 0800FBFB - .incbin "baserom.gba", 0x00FBFB, 0x0000001 - -gUnk_0800FBFC:: @ 0800FBFC - .incbin "baserom.gba", 0x00FBFC, 0x0000003 - -gUnk_0800FBFF:: @ 0800FBFF - .incbin "baserom.gba", 0x00FBFF, 0x0000001 - -gUnk_0800FC00:: @ 0800FC00 - .incbin "baserom.gba", 0x00FC00, 0x0000001 - -gUnk_0800FC01:: @ 0800FC01 - .incbin "baserom.gba", 0x00FC01, 0x0000004 - -gUnk_0800FC05:: @ 0800FC05 - .incbin "baserom.gba", 0x00FC05, 0x0000001 - -gUnk_0800FC06:: @ 0800FC06 - .incbin "baserom.gba", 0x00FC06, 0x0000002 - -gUnk_0800FC08:: @ 0800FC08 - .incbin "baserom.gba", 0x00FC08, 0x0000001 - -gUnk_0800FC09:: @ 0800FC09 - .incbin "baserom.gba", 0x00FC09, 0x0000005 - -gUnk_0800FC0E:: @ 0800FC0E - .incbin "baserom.gba", 0x00FC0E, 0x0000016 - -gUnk_0800FC24:: @ 0800FC24 - .incbin "baserom.gba", 0x00FC24, 0x00000C6 - -gUnk_0800FCEA:: @ 0800FCEA - .incbin "baserom.gba", 0x00FCEA, 0x0000004 - -gUnk_0800FCEE:: @ 0800FCEE - .incbin "baserom.gba", 0x00FCEE, 0x0000004 - -gUnk_0800FCF2:: @ 0800FCF2 - .incbin "baserom.gba", 0x00FCF2, 0x0000001 - -gUnk_0800FCF3:: @ 0800FCF3 - .incbin "baserom.gba", 0x00FCF3, 0x0000002 - -gUnk_0800FCF5:: @ 0800FCF5 - .incbin "baserom.gba", 0x00FCF5, 0x0000002 - -gUnk_0800FCF7:: @ 0800FCF7 - .incbin "baserom.gba", 0x00FCF7, 0x0000001 - -gUnk_0800FCF8:: @ 0800FCF8 - .incbin "baserom.gba", 0x00FCF8, 0x0000002 - -gUnk_0800FCFA:: @ 0800FCFA - .incbin "baserom.gba", 0x00FCFA, 0x0000001 - -gUnk_0800FCFB:: @ 0800FCFB - .incbin "baserom.gba", 0x00FCFB, 0x0000001 - -gUnk_0800FCFC:: @ 0800FCFC - .incbin "baserom.gba", 0x00FCFC, 0x0000002 - -gUnk_0800FCFE:: @ 0800FCFE - .incbin "baserom.gba", 0x00FCFE, 0x0000001 - -gUnk_0800FCFF:: @ 0800FCFF - .incbin "baserom.gba", 0x00FCFF, 0x0000001 - -gUnk_0800FD00:: @ 0800FD00 - .incbin "baserom.gba", 0x00FD00, 0x0000001 - -gUnk_0800FD01:: @ 0800FD01 - .incbin "baserom.gba", 0x00FD01, 0x0000003 - -gUnk_0800FD04:: @ 0800FD04 - .incbin "baserom.gba", 0x00FD04, 0x0000001 - -gUnk_0800FD05:: @ 0800FD05 - .incbin "baserom.gba", 0x00FD05, 0x0000007 - -gUnk_0800FD0C:: @ 0800FD0C - .incbin "baserom.gba", 0x00FD0C, 0x000000A - -gUnk_0800FD16:: @ 0800FD16 - .incbin "baserom.gba", 0x00FD16, 0x000000B - -gUnk_0800FD21:: @ 0800FD21 - .incbin "baserom.gba", 0x00FD21, 0x000005F - -gUnk_0800FD80:: @ 0800FD80 - .incbin "baserom.gba", 0x00FD80, 0x0000020 - -gUnk_0800FDA0:: @ 0800FDA0 - .incbin "baserom.gba", 0x00FDA0, 0x000002C - -gUnk_0800FDCC:: @ 0800FDCC - .incbin "baserom.gba", 0x00FDCC, 0x0000026 - -gUnk_0800FDF2:: @ 0800FDF2 - .incbin "baserom.gba", 0x00FDF2, 0x0000001 - -gUnk_0800FDF3:: @ 0800FDF3 - .incbin "baserom.gba", 0x00FDF3, 0x0000007 - -gUnk_0800FDFA:: @ 0800FDFA - .incbin "baserom.gba", 0x00FDFA, 0x0000002 - -gUnk_0800FDFC:: @ 0800FDFC - .incbin "baserom.gba", 0x00FDFC, 0x0000002 - -gUnk_0800FDFE:: @ 0800FDFE - .incbin "baserom.gba", 0x00FDFE, 0x0000001 - -gUnk_0800FDFF:: @ 0800FDFF - .incbin "baserom.gba", 0x00FDFF, 0x0000001 - -gUnk_0800FE00:: @ 0800FE00 - .incbin "baserom.gba", 0x00FE00, 0x0000001 - -gUnk_0800FE01:: @ 0800FE01 - .incbin "baserom.gba", 0x00FE01, 0x0000001 - -gUnk_0800FE02:: @ 0800FE02 - .incbin "baserom.gba", 0x00FE02, 0x0000002 - -gUnk_0800FE04:: @ 0800FE04 - .incbin "baserom.gba", 0x00FE04, 0x0000002 - -gUnk_0800FE06:: @ 0800FE06 - .incbin "baserom.gba", 0x00FE06, 0x0000001 - -gUnk_0800FE07:: @ 0800FE07 - .incbin "baserom.gba", 0x00FE07, 0x0000001 - -gUnk_0800FE08:: @ 0800FE08 - .incbin "baserom.gba", 0x00FE08, 0x0000001 - -gUnk_0800FE09:: @ 0800FE09 - .incbin "baserom.gba", 0x00FE09, 0x0000037 - -gUnk_0800FE40:: @ 0800FE40 - .incbin "baserom.gba", 0x00FE40, 0x0000004 - -gUnk_0800FE44:: @ 0800FE44 - .incbin "baserom.gba", 0x00FE44, 0x0000020 - -gUnk_0800FE64:: @ 0800FE64 - .incbin "baserom.gba", 0x00FE64, 0x0000024 - -gUnk_0800FE88:: @ 0800FE88 - .incbin "baserom.gba", 0x00FE88, 0x0000034 - -gUnk_0800FEBC:: @ 0800FEBC - .incbin "baserom.gba", 0x00FEBC, 0x0000034 - -gUnk_0800FEF0:: @ 0800FEF0 - .incbin "baserom.gba", 0x00FEF0, 0x0000002 - -gUnk_0800FEF2:: @ 0800FEF2 - .incbin "baserom.gba", 0x00FEF2, 0x0000007 - -gUnk_0800FEF9:: @ 0800FEF9 - .incbin "baserom.gba", 0x00FEF9, 0x0000003 - -gUnk_0800FEFC:: @ 0800FEFC - .incbin "baserom.gba", 0x00FEFC, 0x0000002 - -gUnk_0800FEFE:: @ 0800FEFE - .incbin "baserom.gba", 0x00FEFE, 0x0000003 - -gUnk_0800FF01:: @ 0800FF01 - .incbin "baserom.gba", 0x00FF01, 0x0000002 - -gUnk_0800FF03:: @ 0800FF03 - .incbin "baserom.gba", 0x00FF03, 0x0000001 - -gUnk_0800FF04:: @ 0800FF04 - .incbin "baserom.gba", 0x00FF04, 0x0000001 - -gUnk_0800FF05:: @ 0800FF05 - .incbin "baserom.gba", 0x00FF05, 0x0000001 - -gUnk_0800FF06:: @ 0800FF06 - .incbin "baserom.gba", 0x00FF06, 0x0000002 - -gUnk_0800FF08:: @ 0800FF08 - .incbin "baserom.gba", 0x00FF08, 0x0000010 - -gUnk_0800FF18:: @ 0800FF18 - .incbin "baserom.gba", 0x00FF18, 0x0000012 - -gUnk_0800FF2A:: @ 0800FF2A - .incbin "baserom.gba", 0x00FF2A, 0x000004A - -gUnk_0800FF74:: @ 0800FF74 - .incbin "baserom.gba", 0x00FF74, 0x000003C - -gUnk_0800FFB0:: @ 0800FFB0 - .incbin "baserom.gba", 0x00FFB0, 0x000000B - -gUnk_0800FFBB:: @ 0800FFBB - .incbin "baserom.gba", 0x00FFBB, 0x000001B - -gUnk_0800FFD6:: @ 0800FFD6 - .incbin "baserom.gba", 0x00FFD6, 0x0000018 - -gUnk_0800FFEE:: @ 0800FFEE - .incbin "baserom.gba", 0x00FFEE, 0x0000008 - -gUnk_0800FFF6:: @ 0800FFF6 - .incbin "baserom.gba", 0x00FFF6, 0x0000006 - -gUnk_0800FFFC:: @ 0800FFFC - .incbin "baserom.gba", 0x00FFFC, 0x0000001 - -gUnk_0800FFFD:: @ 0800FFFD - .incbin "baserom.gba", 0x00FFFD, 0x0000002 - -gUnk_0800FFFF:: @ 0800FFFF - .incbin "baserom.gba", 0x00FFFF, 0x0000001 - -gUnk_08010000:: @ 08010000 - .incbin "baserom.gba", 0x010000, 0x0000001 - -gUnk_08010001:: @ 08010001 - .incbin "baserom.gba", 0x010001, 0x0000001 - -gUnk_08010002:: @ 08010002 - .incbin "baserom.gba", 0x010002, 0x0000001 - -gUnk_08010003:: @ 08010003 - .incbin "baserom.gba", 0x010003, 0x0000002 - -gUnk_08010005:: @ 08010005 - .incbin "baserom.gba", 0x010005, 0x0000002 - -gUnk_08010007:: @ 08010007 - .incbin "baserom.gba", 0x010007, 0x0000001 - -gUnk_08010008:: @ 08010008 - .incbin "baserom.gba", 0x010008, 0x0000001 - -gUnk_08010009:: @ 08010009 - .incbin "baserom.gba", 0x010009, 0x0000001 - -gUnk_0801000A:: @ 0801000A - .incbin "baserom.gba", 0x01000A, 0x0000002 - -gUnk_0801000C:: @ 0801000C - .incbin "baserom.gba", 0x01000C, 0x0000001 - -gUnk_0801000D:: @ 0801000D - .incbin "baserom.gba", 0x01000D, 0x0000001 - -gUnk_0801000E:: @ 0801000E - .incbin "baserom.gba", 0x01000E, 0x0000001 - -gUnk_0801000F:: @ 0801000F - .incbin "baserom.gba", 0x01000F, 0x0000009 - -gUnk_08010018:: @ 08010018 - .incbin "baserom.gba", 0x010018, 0x0000003 - -gUnk_0801001B:: @ 0801001B - .incbin "baserom.gba", 0x01001B, 0x0000002 - -gUnk_0801001D:: @ 0801001D - .incbin "baserom.gba", 0x01001D, 0x0000006 - -gUnk_08010023:: @ 08010023 - .incbin "baserom.gba", 0x010023, 0x0000021 - -gUnk_08010044:: @ 08010044 - .incbin "baserom.gba", 0x010044, 0x0000054 - -gUnk_08010098:: @ 08010098 - .incbin "baserom.gba", 0x010098, 0x0000001 - -gUnk_08010099:: @ 08010099 - .incbin "baserom.gba", 0x010099, 0x0000028 - -gUnk_080100C1:: @ 080100C1 - .incbin "baserom.gba", 0x0100C1, 0x0000007 - -gUnk_080100C8:: @ 080100C8 - .incbin "baserom.gba", 0x0100C8, 0x000002D - -gUnk_080100F5:: @ 080100F5 - .incbin "baserom.gba", 0x0100F5, 0x0000007 - -gUnk_080100FC:: @ 080100FC - .incbin "baserom.gba", 0x0100FC, 0x0000002 - -gUnk_080100FE:: @ 080100FE - .incbin "baserom.gba", 0x0100FE, 0x0000001 - -gUnk_080100FF:: @ 080100FF - .incbin "baserom.gba", 0x0100FF, 0x0000001 - -gUnk_08010100:: @ 08010100 - .incbin "baserom.gba", 0x010100, 0x0000002 - -gUnk_08010102:: @ 08010102 - .incbin "baserom.gba", 0x010102, 0x0000001 - -gUnk_08010103:: @ 08010103 - .incbin "baserom.gba", 0x010103, 0x0000002 - -gUnk_08010105:: @ 08010105 - .incbin "baserom.gba", 0x010105, 0x0000001 - -gUnk_08010106:: @ 08010106 - .incbin "baserom.gba", 0x010106, 0x0000004 - -gUnk_0801010A:: @ 0801010A - .incbin "baserom.gba", 0x01010A, 0x0000007 - -gUnk_08010111:: @ 08010111 - .incbin "baserom.gba", 0x010111, 0x000000F - -gUnk_08010120:: @ 08010120 - .incbin "baserom.gba", 0x010120, 0x0000010 - -gUnk_08010130:: @ 08010130 - .incbin "baserom.gba", 0x010130, 0x0000018 - -gUnk_08010148:: @ 08010148 - .incbin "baserom.gba", 0x010148, 0x00000B2 - -gUnk_080101FA:: @ 080101FA - .incbin "baserom.gba", 0x0101FA, 0x0000003 - -gUnk_080101FD:: @ 080101FD - .incbin "baserom.gba", 0x0101FD, 0x0000002 - -gUnk_080101FF:: @ 080101FF - .incbin "baserom.gba", 0x0101FF, 0x0000001 - -gUnk_08010200:: @ 08010200 - .incbin "baserom.gba", 0x010200, 0x0000003 - -gUnk_08010203:: @ 08010203 - .incbin "baserom.gba", 0x010203, 0x0000004 - -gUnk_08010207:: @ 08010207 - .incbin "baserom.gba", 0x010207, 0x0000001 - -gUnk_08010208:: @ 08010208 - .incbin "baserom.gba", 0x010208, 0x0000004 - -gUnk_0801020C:: @ 0801020C - .incbin "baserom.gba", 0x01020C, 0x0000014 - -gUnk_08010220:: @ 08010220 - .incbin "baserom.gba", 0x010220, 0x0000016 - -gUnk_08010236:: @ 08010236 - .incbin "baserom.gba", 0x010236, 0x000002E - -gUnk_08010264:: @ 08010264 - .incbin "baserom.gba", 0x010264, 0x0000030 - -gUnk_08010294:: @ 08010294 - .incbin "baserom.gba", 0x010294, 0x000004C - -gUnk_080102E0:: @ 080102E0 - .incbin "baserom.gba", 0x0102E0, 0x000001B - -gUnk_080102FB:: @ 080102FB - .incbin "baserom.gba", 0x0102FB, 0x0000002 - -gUnk_080102FD:: @ 080102FD - .incbin "baserom.gba", 0x0102FD, 0x0000001 - -gUnk_080102FE:: @ 080102FE - .incbin "baserom.gba", 0x0102FE, 0x0000005 - -gUnk_08010303:: @ 08010303 - .incbin "baserom.gba", 0x010303, 0x0000001 - -gUnk_08010304:: @ 08010304 - .incbin "baserom.gba", 0x010304, 0x0000001 - -gUnk_08010305:: @ 08010305 - .incbin "baserom.gba", 0x010305, 0x0000005 - -gUnk_0801030A:: @ 0801030A - .incbin "baserom.gba", 0x01030A, 0x0000002 - -gUnk_0801030C:: @ 0801030C - .incbin "baserom.gba", 0x01030C, 0x0000014 - -gUnk_08010320:: @ 08010320 - .incbin "baserom.gba", 0x010320, 0x0000090 - -gUnk_080103B0:: @ 080103B0 - .incbin "baserom.gba", 0x0103B0, 0x0000020 - -gUnk_080103D0:: @ 080103D0 - .incbin "baserom.gba", 0x0103D0, 0x0000028 - -gUnk_080103F8:: @ 080103F8 - .incbin "baserom.gba", 0x0103F8, 0x0000005 - -gUnk_080103FD:: @ 080103FD - .incbin "baserom.gba", 0x0103FD, 0x0000003 - -gUnk_08010400:: @ 08010400 - .incbin "baserom.gba", 0x010400, 0x0000006 - -gUnk_08010406:: @ 08010406 - .incbin "baserom.gba", 0x010406, 0x0000001 - -gUnk_08010407:: @ 08010407 - .incbin "baserom.gba", 0x010407, 0x0000003 - -gUnk_0801040A:: @ 0801040A - .incbin "baserom.gba", 0x01040A, 0x000001E - -gUnk_08010428:: @ 08010428 - .incbin "baserom.gba", 0x010428, 0x000002C - -gUnk_08010454:: @ 08010454 - .incbin "baserom.gba", 0x010454, 0x000002C - -gUnk_08010480:: @ 08010480 - .incbin "baserom.gba", 0x010480, 0x0000020 - -gUnk_080104A0:: @ 080104A0 - .incbin "baserom.gba", 0x0104A0, 0x000004C - -gUnk_080104EC:: @ 080104EC - .incbin "baserom.gba", 0x0104EC, 0x0000013 - -gUnk_080104FF:: @ 080104FF - .incbin "baserom.gba", 0x0104FF, 0x0000002 - -gUnk_08010501:: @ 08010501 - .incbin "baserom.gba", 0x010501, 0x0000001 - -gUnk_08010502:: @ 08010502 - .incbin "baserom.gba", 0x010502, 0x0000001 - -gUnk_08010503:: @ 08010503 - .incbin "baserom.gba", 0x010503, 0x0000007 - -gUnk_0801050A:: @ 0801050A - .incbin "baserom.gba", 0x01050A, 0x0000001 - -gUnk_0801050B:: @ 0801050B - .incbin "baserom.gba", 0x01050B, 0x000001B - -gUnk_08010526:: @ 08010526 - .incbin "baserom.gba", 0x010526, 0x0000079 - -gUnk_0801059F:: @ 0801059F - .incbin "baserom.gba", 0x01059F, 0x000002A - -gUnk_080105C9:: @ 080105C9 - .incbin "baserom.gba", 0x0105C9, 0x0000032 - -gUnk_080105FB:: @ 080105FB - .incbin "baserom.gba", 0x0105FB, 0x0000004 - -gUnk_080105FF:: @ 080105FF - .incbin "baserom.gba", 0x0105FF, 0x0000001 - -gUnk_08010600:: @ 08010600 - .incbin "baserom.gba", 0x010600, 0x000000A - -gUnk_0801060A:: @ 0801060A - .incbin "baserom.gba", 0x01060A, 0x0000003 - -gUnk_0801060D:: @ 0801060D - .incbin "baserom.gba", 0x01060D, 0x000000A - -gUnk_08010617:: @ 08010617 - .incbin "baserom.gba", 0x010617, 0x0000005 - -gUnk_0801061C:: @ 0801061C - .incbin "baserom.gba", 0x01061C, 0x0000028 - -gUnk_08010644:: @ 08010644 - .incbin "baserom.gba", 0x010644, 0x000000C - -gUnk_08010650:: @ 08010650 - .incbin "baserom.gba", 0x010650, 0x0000024 - -gUnk_08010674:: @ 08010674 - .incbin "baserom.gba", 0x010674, 0x0000038 - -gUnk_080106AC:: @ 080106AC - .incbin "baserom.gba", 0x0106AC, 0x0000054 - -gUnk_08010700:: @ 08010700 - .incbin "baserom.gba", 0x010700, 0x0000001 - -gUnk_08010701:: @ 08010701 - .incbin "baserom.gba", 0x010701, 0x0000004 - -gUnk_08010705:: @ 08010705 - .incbin "baserom.gba", 0x010705, 0x0000009 - -gUnk_0801070E:: @ 0801070E - .incbin "baserom.gba", 0x01070E, 0x0000026 - -gUnk_08010734:: @ 08010734 - .incbin "baserom.gba", 0x010734, 0x0000060 - -gUnk_08010794:: @ 08010794 - .incbin "baserom.gba", 0x010794, 0x000003C - -gUnk_080107D0:: @ 080107D0 - .incbin "baserom.gba", 0x0107D0, 0x000003A - -gUnk_0801080A:: @ 0801080A - .incbin "baserom.gba", 0x01080A, 0x0000001 - -gUnk_0801080B:: @ 0801080B - .incbin "baserom.gba", 0x01080B, 0x000000A - -gUnk_08010815:: @ 08010815 - .incbin "baserom.gba", 0x010815, 0x0000006 - -gUnk_0801081B:: @ 0801081B - .incbin "baserom.gba", 0x01081B, 0x00000B5 - -gUnk_080108D0:: @ 080108D0 - .incbin "baserom.gba", 0x0108D0, 0x000002F - -gUnk_080108FF:: @ 080108FF - .incbin "baserom.gba", 0x0108FF, 0x000000D - -gUnk_0801090C:: @ 0801090C - .incbin "baserom.gba", 0x01090C, 0x0000003 - -gUnk_0801090F:: @ 0801090F - .incbin "baserom.gba", 0x01090F, 0x0000008 - -gUnk_08010917:: @ 08010917 - .incbin "baserom.gba", 0x010917, 0x000004D - -gUnk_08010964:: @ 08010964 - .incbin "baserom.gba", 0x010964, 0x000003C - -gUnk_080109A0:: @ 080109A0 - .incbin "baserom.gba", 0x0109A0, 0x0000050 - -gUnk_080109F0:: @ 080109F0 - .incbin "baserom.gba", 0x0109F0, 0x0000006 - -gUnk_080109F6:: @ 080109F6 - .incbin "baserom.gba", 0x0109F6, 0x000001E - -gUnk_08010A14:: @ 08010A14 - .incbin "baserom.gba", 0x010A14, 0x000000B - -gUnk_08010A1F:: @ 08010A1F - .incbin "baserom.gba", 0x010A1F, 0x0000019 - -gUnk_08010A38:: @ 08010A38 - .incbin "baserom.gba", 0x010A38, 0x0000024 - -gUnk_08010A5C:: @ 08010A5C - .incbin "baserom.gba", 0x010A5C, 0x000003C - -gUnk_08010A98:: @ 08010A98 - .incbin "baserom.gba", 0x010A98, 0x000004C - -gUnk_08010AE4:: @ 08010AE4 - .incbin "baserom.gba", 0x010AE4, 0x0000020 - -gUnk_08010B04:: @ 08010B04 - .incbin "baserom.gba", 0x010B04, 0x0000064 - -gUnk_08010B68:: @ 08010B68 - .incbin "baserom.gba", 0x010B68, 0x000004C - -gUnk_08010BB4:: @ 08010BB4 - .incbin "baserom.gba", 0x010BB4, 0x0000038 - -gUnk_08010BEC:: @ 08010BEC - .incbin "baserom.gba", 0x010BEC, 0x000000D - -gUnk_08010BF9:: @ 08010BF9 - .incbin "baserom.gba", 0x010BF9, 0x0000005 - -gUnk_08010BFE:: @ 08010BFE - .incbin "baserom.gba", 0x010BFE, 0x000001C - -gUnk_08010C1A:: @ 08010C1A - .incbin "baserom.gba", 0x010C1A, 0x00000E9 - -gUnk_08010D03:: @ 08010D03 - .incbin "baserom.gba", 0x010D03, 0x00000FD - -gUnk_08010E00:: @ 08010E00 - .incbin "baserom.gba", 0x010E00, 0x000000D - -gUnk_08010E0D:: @ 08010E0D - .incbin "baserom.gba", 0x010E0D, 0x00000F3 - -gUnk_08010F00:: @ 08010F00 - .incbin "baserom.gba", 0x010F00, 0x00000FF - -gUnk_08010FFF:: @ 08010FFF - .incbin "baserom.gba", 0x010FFF, 0x0000001 - -gUnk_08011000:: @ 08011000 - .incbin "baserom.gba", 0x011000, 0x0000001 - -gUnk_08011001:: @ 08011001 - .incbin "baserom.gba", 0x011001, 0x000001E - -gUnk_0801101F:: @ 0801101F - .incbin "baserom.gba", 0x01101F, 0x0000055 - -gUnk_08011074:: @ 08011074 - .incbin "baserom.gba", 0x011074, 0x000000F - -gUnk_08011083:: @ 08011083 - .incbin "baserom.gba", 0x011083, 0x0000059 - -gUnk_080110DC:: @ 080110DC - .incbin "baserom.gba", 0x0110DC, 0x000000C - -gUnk_080110E8:: @ 080110E8 - .incbin "baserom.gba", 0x0110E8, 0x0000040 - -gUnk_08011128:: @ 08011128 - .incbin "baserom.gba", 0x011128, 0x00000A4 - -gUnk_080111CC:: @ 080111CC - .incbin "baserom.gba", 0x0111CC, 0x000003C - -gUnk_08011208:: @ 08011208 - .incbin "baserom.gba", 0x011208, 0x0000015 - -gUnk_0801121D:: @ 0801121D - .incbin "baserom.gba", 0x01121D, 0x00000A7 - -gUnk_080112C4:: @ 080112C4 - .incbin "baserom.gba", 0x0112C4, 0x000004B - -gUnk_0801130F:: @ 0801130F - .incbin "baserom.gba", 0x01130F, 0x0000019 - -gUnk_08011328:: @ 08011328 - .incbin "baserom.gba", 0x011328, 0x00000DB - -gUnk_08011403:: @ 08011403 - .incbin "baserom.gba", 0x011403, 0x00001CD - -gUnk_080115D0:: @ 080115D0 - .incbin "baserom.gba", 0x0115D0, 0x0000038 - -gUnk_08011608:: @ 08011608 - .incbin "baserom.gba", 0x011608, 0x0000038 - -gUnk_08011640:: @ 08011640 - .incbin "baserom.gba", 0x011640, 0x0000068 - -gUnk_080116A8:: @ 080116A8 - .incbin "baserom.gba", 0x0116A8, 0x0000161 - -gUnk_08011809:: @ 08011809 - .incbin "baserom.gba", 0x011809, 0x0000033 - -gUnk_0801183C:: @ 0801183C - .incbin "baserom.gba", 0x01183C, 0x0000098 - -gUnk_080118D4:: @ 080118D4 - .incbin "baserom.gba", 0x0118D4, 0x000005C - -gUnk_08011930:: @ 08011930 - .incbin "baserom.gba", 0x011930, 0x0000010 - -gUnk_08011940:: @ 08011940 - .incbin "baserom.gba", 0x011940, 0x000000C - -gUnk_0801194C:: @ 0801194C - .incbin "baserom.gba", 0x01194C, 0x000000C - -gUnk_08011958:: @ 08011958 - .incbin "baserom.gba", 0x011958, 0x000000C - -gUnk_08011964:: @ 08011964 - .incbin "baserom.gba", 0x011964, 0x000004C - -gUnk_080119B0:: @ 080119B0 - .incbin "baserom.gba", 0x0119B0, 0x0000028 - -gUnk_080119D8:: @ 080119D8 - .incbin "baserom.gba", 0x0119D8, 0x000000C - -gUnk_080119E4:: @ 080119E4 - .incbin "baserom.gba", 0x0119E4, 0x000000C - -gUnk_080119F0:: @ 080119F0 - .incbin "baserom.gba", 0x0119F0, 0x0000014 - -gUnk_08011A04:: @ 08011A04 - .incbin "baserom.gba", 0x011A04, 0x0000028 - -gUnk_08011A2C:: @ 08011A2C - .incbin "baserom.gba", 0x011A2C, 0x0000038 - -gUnk_08011A64:: @ 08011A64 - .incbin "baserom.gba", 0x011A64, 0x0000080 - -gUnk_08011AE4:: @ 08011AE4 - .incbin "baserom.gba", 0x011AE4, 0x0000020 - -gUnk_08011B04:: @ 08011B04 - .incbin "baserom.gba", 0x011B04, 0x000001C - -gUnk_08011B20:: @ 08011B20 - .incbin "baserom.gba", 0x011B20, 0x0000020 - -gUnk_08011B40:: @ 08011B40 - .incbin "baserom.gba", 0x011B40, 0x00000A4 - -gUnk_08011BE4:: @ 08011BE4 - .incbin "baserom.gba", 0x011BE4, 0x0000020 - -gUnk_08011C04:: @ 08011C04 - .incbin "baserom.gba", 0x011C04, 0x000004C - -gUnk_08011C50:: @ 08011C50 - .incbin "baserom.gba", 0x011C50, 0x000002C - -gUnk_08011C7C:: @ 08011C7C - .incbin "baserom.gba", 0x011C7C, 0x00000AC - -gUnk_08011D28:: @ 08011D28 - .incbin "baserom.gba", 0x011D28, 0x00000AC - -gUnk_08011DD4:: @ 08011DD4 - .incbin "baserom.gba", 0x011DD4, 0x0000030 - -gUnk_08011E04:: @ 08011E04 - .incbin "baserom.gba", 0x011E04, 0x000007C - -gUnk_08011E80:: @ 08011E80 - .incbin "baserom.gba", 0x011E80, 0x000008C - -gUnk_08011F0C:: @ 08011F0C - .incbin "baserom.gba", 0x011F0C, 0x000008C - -gUnk_08011F98:: @ 08011F98 - .incbin "baserom.gba", 0x011F98, 0x000008C - -gUnk_08012024:: @ 08012024 - .incbin "baserom.gba", 0x012024, 0x000006D - -gUnk_08012091:: @ 08012091 - .incbin "baserom.gba", 0x012091, 0x000001F - -gUnk_080120B0:: @ 080120B0 - .incbin "baserom.gba", 0x0120B0, 0x000003D - -gUnk_080120ED:: @ 080120ED - .incbin "baserom.gba", 0x0120ED, 0x000000E - -gUnk_080120FB:: @ 080120FB - .incbin "baserom.gba", 0x0120FB, 0x0000041 - -gUnk_0801213C:: @ 0801213C - .incbin "baserom.gba", 0x01213C, 0x000008C - -gUnk_080121C8:: @ 080121C8 - .incbin "baserom.gba", 0x0121C8, 0x0000038 - -gUnk_08012200:: @ 08012200 - .incbin "baserom.gba", 0x012200, 0x0000038 - -gUnk_08012238:: @ 08012238 - .incbin "baserom.gba", 0x012238, 0x0000038 - -gUnk_08012270:: @ 08012270 - .incbin "baserom.gba", 0x012270, 0x00000BC - -gUnk_0801232C:: @ 0801232C - .incbin "baserom.gba", 0x01232C, 0x0000034 - -gUnk_08012360:: @ 08012360 - .incbin "baserom.gba", 0x012360, 0x00000B0 - -gUnk_08012410:: @ 08012410 - .incbin "baserom.gba", 0x012410, 0x0000020 - -gUnk_08012430:: @ 08012430 - .incbin "baserom.gba", 0x012430, 0x0000050 - -gUnk_08012480:: @ 08012480 - .incbin "baserom.gba", 0x012480, 0x000027C - -gUnk_080126FC:: @ 080126FC - .incbin "baserom.gba", 0x0126FC, 0x00003B4 - -gUnk_08012AB0:: @ 08012AB0 - .incbin "baserom.gba", 0x012AB0, 0x00000F8 - -gUnk_08012BA8:: @ 08012BA8 - .incbin "baserom.gba", 0x012BA8, 0x0000050 - -gUnk_08012BF8:: @ 08012BF8 - .incbin "baserom.gba", 0x012BF8, 0x0000014 - -gUnk_08012C0C:: @ 08012C0C - .incbin "baserom.gba", 0x012C0C, 0x000003C - -gUnk_08012C48:: @ 08012C48 - .incbin "baserom.gba", 0x012C48, 0x0000050 - -gUnk_08012C98:: @ 08012C98 - .incbin "baserom.gba", 0x012C98, 0x0000040 - -gUnk_08012CD8:: @ 08012CD8 - .incbin "baserom.gba", 0x012CD8, 0x0000040 - -gUnk_08012D18:: @ 08012D18 - .incbin "baserom.gba", 0x012D18, 0x0000058 - -gUnk_08012D70:: @ 08012D70 - .incbin "baserom.gba", 0x012D70, 0x0000031 - -gUnk_08012DA1:: @ 08012DA1 - .incbin "baserom.gba", 0x012DA1, 0x000000F - -gUnk_08012DB0:: @ 08012DB0 - .incbin "baserom.gba", 0x012DB0, 0x0000028 - -gUnk_08012DD8:: @ 08012DD8 - .incbin "baserom.gba", 0x012DD8, 0x0000048 - -gUnk_08012E20:: @ 08012E20 - .incbin "baserom.gba", 0x012E20, 0x0000024 - -gUnk_08012E44:: @ 08012E44 - .incbin "baserom.gba", 0x012E44, 0x0000044 - -gUnk_08012E88:: @ 08012E88 - .incbin "baserom.gba", 0x012E88, 0x0000038 - -gUnk_08012EC0:: @ 08012EC0 - .incbin "baserom.gba", 0x012EC0, 0x000004C - -gUnk_08012F0C:: @ 08012F0C - .incbin "baserom.gba", 0x012F0C, 0x00000F5 - -gUnk_08013001:: @ 08013001 - .incbin "baserom.gba", 0x013001, 0x0000002 - -gUnk_08013003:: @ 08013003 - .incbin "baserom.gba", 0x013003, 0x0000008 - -gUnk_0801300B:: @ 0801300B - .incbin "baserom.gba", 0x01300B, 0x0000031 - -gUnk_0801303C:: @ 0801303C - .incbin "baserom.gba", 0x01303C, 0x0000034 - -gUnk_08013070:: @ 08013070 - .incbin "baserom.gba", 0x013070, 0x0000011 - -gUnk_08013081:: @ 08013081 - .incbin "baserom.gba", 0x013081, 0x000000F - -gUnk_08013090:: @ 08013090 - .incbin "baserom.gba", 0x013090, 0x0000084 - -gUnk_08013114:: @ 08013114 - .incbin "baserom.gba", 0x013114, 0x0000074 - -gUnk_08013188:: @ 08013188 - .incbin "baserom.gba", 0x013188, 0x0000024 - -gUnk_080131AC:: @ 080131AC - .incbin "baserom.gba", 0x0131AC, 0x0000138 - -gUnk_080132E4:: @ 080132E4 - .incbin "baserom.gba", 0x0132E4, 0x000004C - -gUnk_08013330:: @ 08013330 - .incbin "baserom.gba", 0x013330, 0x000001C - -gUnk_0801334C:: @ 0801334C - .incbin "baserom.gba", 0x01334C, 0x000002C - -gUnk_08013378:: @ 08013378 - .incbin "baserom.gba", 0x013378, 0x000004C - -gUnk_080133C4:: @ 080133C4 - .incbin "baserom.gba", 0x0133C4, 0x0000034 - -gUnk_080133F8:: @ 080133F8 - .incbin "baserom.gba", 0x0133F8, 0x00000E4 - -gUnk_080134DC:: @ 080134DC - .incbin "baserom.gba", 0x0134DC, 0x00001FC - -gUnk_080136D8:: @ 080136D8 - .incbin "baserom.gba", 0x0136D8, 0x0000048 - -gUnk_08013720:: @ 08013720 - .incbin "baserom.gba", 0x013720, 0x00000BA - -gUnk_080137DA:: @ 080137DA - .incbin "baserom.gba", 0x0137DA, 0x00000DA - -gUnk_080138B4:: @ 080138B4 - .incbin "baserom.gba", 0x0138B4, 0x0000264 - -gUnk_08013B18:: @ 08013B18 - .incbin "baserom.gba", 0x013B18, 0x0000058 - -gUnk_08013B70:: @ 08013B70 - .incbin "baserom.gba", 0x013B70, 0x0000038 - -gUnk_08013BA8:: @ 08013BA8 - .incbin "baserom.gba", 0x013BA8, 0x0000040 - -gUnk_08013BE8:: @ 08013BE8 - .incbin "baserom.gba", 0x013BE8, 0x00000BC - -gUnk_08013CA4:: @ 08013CA4 - .incbin "baserom.gba", 0x013CA4, 0x0000160 - -gUnk_08013E04:: @ 08013E04 - .incbin "baserom.gba", 0x013E04, 0x0000048 - -gUnk_08013E4C:: @ 08013E4C - .incbin "baserom.gba", 0x013E4C, 0x0000024 - -gUnk_08013E70:: @ 08013E70 - .incbin "baserom.gba", 0x013E70, 0x0000024 - -gUnk_08013E94:: @ 08013E94 - .incbin "baserom.gba", 0x013E94, 0x000001C - -gUnk_08013EB0:: @ 08013EB0 - .incbin "baserom.gba", 0x013EB0, 0x000001C - -gUnk_08013ECC:: @ 08013ECC - .incbin "baserom.gba", 0x013ECC, 0x000001C - -gUnk_08013EE8:: @ 08013EE8 - .incbin "baserom.gba", 0x013EE8, 0x000001C - -gUnk_08013F04:: @ 08013F04 - .incbin "baserom.gba", 0x013F04, 0x0000030 - -gUnk_08013F34:: @ 08013F34 - .incbin "baserom.gba", 0x013F34, 0x0000030 - -gUnk_08013F64:: @ 08013F64 - .incbin "baserom.gba", 0x013F64, 0x0000030 - -gUnk_08013F94:: @ 08013F94 - .incbin "baserom.gba", 0x013F94, 0x0000054 - -gUnk_08013FE8:: @ 08013FE8 - .incbin "baserom.gba", 0x013FE8, 0x000006C - -gUnk_08014054:: @ 08014054 - .incbin "baserom.gba", 0x014054, 0x0000020 - -gUnk_08014074:: @ 08014074 - .incbin "baserom.gba", 0x014074, 0x0000020 - -gUnk_08014094:: @ 08014094 - .incbin "baserom.gba", 0x014094, 0x0000048 - -gUnk_080140DC:: @ 080140DC - .incbin "baserom.gba", 0x0140DC, 0x000001C - -gUnk_080140F8:: @ 080140F8 - .incbin "baserom.gba", 0x0140F8, 0x0000020 - -gUnk_08014118:: @ 08014118 - .incbin "baserom.gba", 0x014118, 0x000003C - -gUnk_08014154:: @ 08014154 - .incbin "baserom.gba", 0x014154, 0x0000088 - -gUnk_080141DC:: @ 080141DC - .incbin "baserom.gba", 0x0141DC, 0x0000034 - -gUnk_08014210:: @ 08014210 - .incbin "baserom.gba", 0x014210, 0x0000064 - -gUnk_08014274:: @ 08014274 - .incbin "baserom.gba", 0x014274, 0x000003C - -gUnk_080142B0:: @ 080142B0 - .incbin "baserom.gba", 0x0142B0, 0x00000D4 - -gUnk_08014384:: @ 08014384 - .incbin "baserom.gba", 0x014384, 0x000003C - -gUnk_080143C0:: @ 080143C0 - .incbin "baserom.gba", 0x0143C0, 0x0000042 - -gUnk_08014402:: @ 08014402 - .incbin "baserom.gba", 0x014402, 0x000004E - -gUnk_08014450:: @ 08014450 - .incbin "baserom.gba", 0x014450, 0x00000BC - -gUnk_0801450C:: @ 0801450C - .incbin "baserom.gba", 0x01450C, 0x000003C - -gUnk_08014548:: @ 08014548 - .incbin "baserom.gba", 0x014548, 0x0000058 - -gUnk_080145A0:: @ 080145A0 - .incbin "baserom.gba", 0x0145A0, 0x0000010 - -gUnk_080145B0:: @ 080145B0 - .incbin "baserom.gba", 0x0145B0, 0x0000038 - -gUnk_080145E8:: @ 080145E8 - .incbin "baserom.gba", 0x0145E8, 0x0000040 - -gUnk_08014628:: @ 08014628 - .incbin "baserom.gba", 0x014628, 0x00001DC - -gUnk_08014804:: @ 08014804 - .incbin "baserom.gba", 0x014804, 0x00000EC - -gUnk_080148F0:: @ 080148F0 - .incbin "baserom.gba", 0x0148F0, 0x0000068 - -gUnk_08014958:: @ 08014958 - .incbin "baserom.gba", 0x014958, 0x000003C - -gUnk_08014994:: @ 08014994 - .incbin "baserom.gba", 0x014994, 0x0000038 - -gUnk_080149CC:: @ 080149CC - .incbin "baserom.gba", 0x0149CC, 0x000005C - -gUnk_08014A28:: @ 08014A28 - .incbin "baserom.gba", 0x014A28, 0x000002C - -gUnk_08014A54:: @ 08014A54 - .incbin "baserom.gba", 0x014A54, 0x000002C - -gUnk_08014A80:: @ 08014A80 - .incbin "baserom.gba", 0x014A80, 0x0000044 - -gUnk_08014AC4:: @ 08014AC4 - .incbin "baserom.gba", 0x014AC4, 0x0000070 - -gUnk_08014B34:: @ 08014B34 - .incbin "baserom.gba", 0x014B34, 0x00000F8 - -gUnk_08014C2C:: @ 08014C2C - .incbin "baserom.gba", 0x014C2C, 0x0000068 - -gUnk_08014C94:: @ 08014C94 - .incbin "baserom.gba", 0x014C94, 0x0000048 - -gUnk_08014CDC:: @ 08014CDC - .incbin "baserom.gba", 0x014CDC, 0x00000F0 - -gUnk_08014DCC:: @ 08014DCC - .incbin "baserom.gba", 0x014DCC, 0x0000048 - -gUnk_08014E14:: @ 08014E14 - .incbin "baserom.gba", 0x014E14, 0x000003C - -gUnk_08014E50:: @ 08014E50 - .incbin "baserom.gba", 0x014E50, 0x000007C - -gUnk_08014ECC:: @ 08014ECC - .incbin "baserom.gba", 0x014ECC, 0x000002C - -gUnk_08014EF8:: @ 08014EF8 - .incbin "baserom.gba", 0x014EF8, 0x0000038 - -gUnk_08014F30:: @ 08014F30 - .incbin "baserom.gba", 0x014F30, 0x000008C - -gUnk_08014FBC:: @ 08014FBC - .incbin "baserom.gba", 0x014FBC, 0x0000045 - -gUnk_08015001:: @ 08015001 - .incbin "baserom.gba", 0x015001, 0x0000086 - -gUnk_08015087:: @ 08015087 - .incbin "baserom.gba", 0x015087, 0x0000068 - -gUnk_080150EF:: @ 080150EF - .incbin "baserom.gba", 0x0150EF, 0x0000145 - -gUnk_08015234:: @ 08015234 - .incbin "baserom.gba", 0x015234, 0x0000080 - -gUnk_080152B4:: @ 080152B4 - .incbin "baserom.gba", 0x0152B4, 0x00000DC - -gUnk_08015390:: @ 08015390 - .incbin "baserom.gba", 0x015390, 0x000005C - -gUnk_080153EC:: @ 080153EC - .incbin "baserom.gba", 0x0153EC, 0x0000120 - -gUnk_0801550C:: @ 0801550C - .incbin "baserom.gba", 0x01550C, 0x000010C - -gUnk_08015618:: @ 08015618 - .incbin "baserom.gba", 0x015618, 0x000006C - -gUnk_08015684:: @ 08015684 - .incbin "baserom.gba", 0x015684, 0x000001C - -gUnk_080156A0:: @ 080156A0 - .incbin "baserom.gba", 0x0156A0, 0x00000B4 - -gUnk_08015754:: @ 08015754 - .incbin "baserom.gba", 0x015754, 0x0000058 - -gUnk_080157AC:: @ 080157AC - .incbin "baserom.gba", 0x0157AC, 0x000014C - -gUnk_080158F8:: @ 080158F8 - .incbin "baserom.gba", 0x0158F8, 0x0000040 - -gUnk_08015938:: @ 08015938 - .incbin "baserom.gba", 0x015938, 0x0000020 - -gUnk_08015958:: @ 08015958 - .incbin "baserom.gba", 0x015958, 0x000016C - -gUnk_08015AC4:: @ 08015AC4 - .incbin "baserom.gba", 0x015AC4, 0x0000050 - -gUnk_08015B14:: @ 08015B14 - .incbin "baserom.gba", 0x015B14, 0x0000020 - -gUnk_08015B34:: @ 08015B34 - .incbin "baserom.gba", 0x015B34, 0x0000050 - -gUnk_08015B84:: @ 08015B84 - .incbin "baserom.gba", 0x015B84, 0x0000024 - -gUnk_08015BA8:: @ 08015BA8 - .incbin "baserom.gba", 0x015BA8, 0x0000040 - -gUnk_08015BE8:: @ 08015BE8 - .incbin "baserom.gba", 0x015BE8, 0x00000EC - -gUnk_08015CD4:: @ 08015CD4 - .incbin "baserom.gba", 0x015CD4, 0x000011C - -gUnk_08015DF0:: @ 08015DF0 - .incbin "baserom.gba", 0x015DF0, 0x0000068 - -gUnk_08015E58:: @ 08015E58 - .incbin "baserom.gba", 0x015E58, 0x00000B0 - -gUnk_08015F08:: @ 08015F08 - .incbin "baserom.gba", 0x015F08, 0x0000034 - -gUnk_08015F3C:: @ 08015F3C - .incbin "baserom.gba", 0x015F3C, 0x0000068 - -gUnk_08015FA4:: @ 08015FA4 - .incbin "baserom.gba", 0x015FA4, 0x000001C - -gUnk_08015FC0:: @ 08015FC0 - .incbin "baserom.gba", 0x015FC0, 0x0000061 - -gUnk_08016021:: @ 08016021 - .incbin "baserom.gba", 0x016021, 0x000000F - -gUnk_08016030:: @ 08016030 - .incbin "baserom.gba", 0x016030, 0x000003C - -gUnk_0801606C:: @ 0801606C - .incbin "baserom.gba", 0x01606C, 0x000003C - -gUnk_080160A8:: @ 080160A8 - .incbin "baserom.gba", 0x0160A8, 0x0000042 - -gUnk_080160EA:: @ 080160EA - .incbin "baserom.gba", 0x0160EA, 0x0000052 - -gUnk_0801613C:: @ 0801613C - .incbin "baserom.gba", 0x01613C, 0x0000054 - -gUnk_08016190:: @ 08016190 - .incbin "baserom.gba", 0x016190, 0x0000058 - -gUnk_080161E8:: @ 080161E8 - .incbin "baserom.gba", 0x0161E8, 0x0000174 - -gUnk_0801635C:: @ 0801635C - .incbin "baserom.gba", 0x01635C, 0x0000021 - -gUnk_0801637D:: @ 0801637D - .incbin "baserom.gba", 0x01637D, 0x0000007 - -gUnk_08016384:: @ 08016384 - .incbin "baserom.gba", 0x016384, 0x0000084 - -gUnk_08016408:: @ 08016408 - .incbin "baserom.gba", 0x016408, 0x00001F0 - -gUnk_080165F8:: @ 080165F8 - .incbin "baserom.gba", 0x0165F8, 0x0000014 - -gUnk_0801660C:: @ 0801660C - .incbin "baserom.gba", 0x01660C, 0x000001C - -gUnk_08016628:: @ 08016628 - .incbin "baserom.gba", 0x016628, 0x000001C - -gUnk_08016644:: @ 08016644 - .incbin "baserom.gba", 0x016644, 0x0000028 - -gUnk_0801666C:: @ 0801666C - .incbin "baserom.gba", 0x01666C, 0x000004C - -gUnk_080166B8:: @ 080166B8 - .incbin "baserom.gba", 0x0166B8, 0x0000044 - -gUnk_080166FC:: @ 080166FC - .incbin "baserom.gba", 0x0166FC, 0x000009C - -gUnk_08016798:: @ 08016798 - .incbin "baserom.gba", 0x016798, 0x00000AC - -gUnk_08016844:: @ 08016844 - .incbin "baserom.gba", 0x016844, 0x000009C - -gUnk_080168E0:: @ 080168E0 - .incbin "baserom.gba", 0x0168E0, 0x0000014 - -gUnk_080168F4:: @ 080168F4 - .incbin "baserom.gba", 0x0168F4, 0x0000090 - -gUnk_08016984:: @ 08016984 - .incbin "baserom.gba", 0x016984, 0x0000002 - - .text - - non_word_aligned_thumb_func_start GetNextScriptCommandHalfword -GetNextScriptCommandHalfword: @ 0x08016986 - ldrh r0, [r0] - bx lr - - non_word_aligned_thumb_func_start GetNextScriptCommandHalfwordAfterCommandMetadata -GetNextScriptCommandHalfwordAfterCommandMetadata: @ 0x0801698A - ldrh r0, [r0, #2] - bx lr - - non_word_aligned_thumb_func_start GetNextScriptCommandWord -GetNextScriptCommandWord: @ 0x0801698E - ldrh r1, [r0] - ldrh r0, [r0, #2] - lsls r0, r0, #0x10 - orrs r0, r1 - bx lr - - thumb_func_start GetNextScriptCommandWordAfterCommandMetadata -GetNextScriptCommandWordAfterCommandMetadata: @ 0x08016998 - ldrh r1, [r0, #2] - ldrh r0, [r0, #4] - lsls r0, r0, #0x10 - orrs r0, r1 - bx lr - .align 2, 0 - -gUnk_080169A4:: - .byte 0x01, 0xFF, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0x01, 0x00 - .byte 0xFF, 0x01, 0x00, 0x00, 0x02, 0xFF, 0x01, 0xFE, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0x01, 0xFF, 0x02 - .byte 0x00, 0x00, 0x01, 0x01, 0x02, 0xFF, 0x02, 0xFE, 0xFE, 0x02, 0xFF, 0x03, 0xFD, 0xFF, 0xFE, 0x01 - .byte 0x01, 0xFD, 0xFF, 0xFF, 0x03, 0xFE, 0x02, 0x00, 0x00, 0xFF, 0xFE, 0x03, 0xFD, 0x02, 0xFF, 0x00 - .byte 0x00, 0xFD, 0x02, 0x00, 0x00, 0xFF, 0x00, 0xFE, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02 - .byte 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00 - .byte 0x00, 0x00, 0x01, 0x00 - - thumb_func_start UpdateSpriteForCollisionLayer -UpdateSpriteForCollisionLayer: @ 0x08016A04 - movs r1, #0x38 - ldrb r1, [r0, r1] - lsls r1, r1, #1 - add r3, pc, #0x1C - adds r1, r1, r3 - movs r3, #0xc0 - ldrb r2, [r0, #0x19] - bics r2, r3 - ldrb r3, [r1] - orrs r2, r3 - strb r2, [r0, #0x19] - movs r3, #0xc0 - ldrb r2, [r0, #0x1b] - bics r2, r3 - ldrb r3, [r1, #1] - orrs r2, r3 - strb r2, [r0, #0x1b] - bx lr -_08016A28: - .byte 0x80, 0x80, 0x80, 0x80, 0x40, 0x40, 0x40, 0x40 - - thumb_func_start sub_08016A30 -sub_08016A30: @ 0x08016A30 - push {r4, r5, lr} - adds r4, r0, #0 - movs r5, #0x38 - ldrb r0, [r4, r5] - cmp r0, #0 - bne _08016A64 - ldrh r0, [r4, #0x2e] - ldrh r1, [r4, #0x32] - movs r2, #2 - bl GetTileTypeByPos - movs r3, #1 - cmp r0, #0 - beq _08016A62 - bl sub_080002E4 - movs r3, #2 - add r1, pc, #0x40 -_08016A54: - adds r1, #4 - ldrh r2, [r1] - cmp r2, #0 - beq _08016A62 - cmp r0, r2 - bne _08016A54 - ldrb r3, [r1, #3] -_08016A62: - strb r3, [r4, r5] -_08016A64: - adds r0, r4, #0 - bl UpdateSpriteForCollisionLayer - pop {r4, r5, pc} - - thumb_func_start sub_08016A6C -sub_08016A6C: @ 0x08016A6C - push {r4, r5, lr} - adds r4, r0, #0 - bl sub_080002B8 - add r1, pc, #0x38 -_08016A76: - adds r1, #4 - ldrh r2, [r1] - cmp r2, #0 - beq _08016A90 - cmp r2, r0 - bne _08016A76 - movs r2, #0x38 - ldrb r3, [r4, r2] - ldrb r5, [r1, #2] - cmp r3, r5 - beq _08016A90 - ldrb r5, [r1, #3] - strb r5, [r4, r2] -_08016A90: - pop {r4, r5, pc} - .align 2, 0 -_08016A94: - .byte 0x2A, 0x00, 0x03, 0x03, 0x2D, 0x00, 0x03, 0x03, 0x2B, 0x00, 0x03, 0x03 - .byte 0x2C, 0x00, 0x03, 0x03, 0x4C, 0x00, 0x03, 0x03, 0x4E, 0x00, 0x03, 0x03, 0x4D, 0x00, 0x03, 0x03 - .byte 0x4F, 0x00, 0x03, 0x03, 0x0A, 0x00, 0x02, 0x01, 0x09, 0x00, 0x02, 0x01, 0x0C, 0x00, 0x01, 0x02 - .byte 0x0B, 0x00, 0x01, 0x02, 0x52, 0x00, 0x03, 0x03, 0x27, 0x00, 0x03, 0x03, 0x26, 0x00, 0x03, 0x03 - .byte 0x00, 0x00 - - non_word_aligned_thumb_func_start sub_08016AD2 -sub_08016AD2: @ 0x08016AD2 - push {r4, lr} - adds r4, r0, #0 - bl sub_08016A6C - push {r0} - adds r0, r4, #0 - bl UpdateSpriteForCollisionLayer - pop {r0, r4, pc} diff --git a/asm/code_08016984.s b/asm/code_08016984.s new file mode 100644 index 00000000..bfdfa728 --- /dev/null +++ b/asm/code_08016984.s @@ -0,0 +1,144 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .syntax unified + + .text + +gUnk_08016984:: @ 08016984 + .incbin "baserom.gba", 0x016984, 0x0000002 + + .text + + non_word_aligned_thumb_func_start GetNextScriptCommandHalfword +GetNextScriptCommandHalfword: @ 0x08016986 + ldrh r0, [r0] + bx lr + + non_word_aligned_thumb_func_start GetNextScriptCommandHalfwordAfterCommandMetadata +GetNextScriptCommandHalfwordAfterCommandMetadata: @ 0x0801698A + ldrh r0, [r0, #2] + bx lr + + non_word_aligned_thumb_func_start GetNextScriptCommandWord +GetNextScriptCommandWord: @ 0x0801698E + ldrh r1, [r0] + ldrh r0, [r0, #2] + lsls r0, r0, #0x10 + orrs r0, r1 + bx lr + + thumb_func_start GetNextScriptCommandWordAfterCommandMetadata +GetNextScriptCommandWordAfterCommandMetadata: @ 0x08016998 + ldrh r1, [r0, #2] + ldrh r0, [r0, #4] + lsls r0, r0, #0x10 + orrs r0, r1 + bx lr + .align 2, 0 + +gUnk_080169A4:: + .byte 0x01, 0xFF, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0x01, 0x00 + .byte 0xFF, 0x01, 0x00, 0x00, 0x02, 0xFF, 0x01, 0xFE, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0x01, 0xFF, 0x02 + .byte 0x00, 0x00, 0x01, 0x01, 0x02, 0xFF, 0x02, 0xFE, 0xFE, 0x02, 0xFF, 0x03, 0xFD, 0xFF, 0xFE, 0x01 + .byte 0x01, 0xFD, 0xFF, 0xFF, 0x03, 0xFE, 0x02, 0x00, 0x00, 0xFF, 0xFE, 0x03, 0xFD, 0x02, 0xFF, 0x00 + .byte 0x00, 0xFD, 0x02, 0x00, 0x00, 0xFF, 0x00, 0xFE, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02 + .byte 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00 + .byte 0x00, 0x00, 0x01, 0x00 + + thumb_func_start UpdateSpriteForCollisionLayer +UpdateSpriteForCollisionLayer: @ 0x08016A04 + movs r1, #0x38 + ldrb r1, [r0, r1] + lsls r1, r1, #1 + add r3, pc, #0x1C + adds r1, r1, r3 + movs r3, #0xc0 + ldrb r2, [r0, #0x19] + bics r2, r3 + ldrb r3, [r1] + orrs r2, r3 + strb r2, [r0, #0x19] + movs r3, #0xc0 + ldrb r2, [r0, #0x1b] + bics r2, r3 + ldrb r3, [r1, #1] + orrs r2, r3 + strb r2, [r0, #0x1b] + bx lr +_08016A28: + .byte 0x80, 0x80, 0x80, 0x80, 0x40, 0x40, 0x40, 0x40 + + thumb_func_start sub_08016A30 +sub_08016A30: @ 0x08016A30 + push {r4, r5, lr} + adds r4, r0, #0 + movs r5, #0x38 + ldrb r0, [r4, r5] + cmp r0, #0 + bne _08016A64 + ldrh r0, [r4, #0x2e] + ldrh r1, [r4, #0x32] + movs r2, #2 + bl GetTileTypeByPos + movs r3, #1 + cmp r0, #0 + beq _08016A62 + bl sub_080002E4 + movs r3, #2 + add r1, pc, #0x40 +_08016A54: + adds r1, #4 + ldrh r2, [r1] + cmp r2, #0 + beq _08016A62 + cmp r0, r2 + bne _08016A54 + ldrb r3, [r1, #3] +_08016A62: + strb r3, [r4, r5] +_08016A64: + adds r0, r4, #0 + bl UpdateSpriteForCollisionLayer + pop {r4, r5, pc} + + thumb_func_start sub_08016A6C +sub_08016A6C: @ 0x08016A6C + push {r4, r5, lr} + adds r4, r0, #0 + bl sub_080002B8 + add r1, pc, #0x38 +_08016A76: + adds r1, #4 + ldrh r2, [r1] + cmp r2, #0 + beq _08016A90 + cmp r2, r0 + bne _08016A76 + movs r2, #0x38 + ldrb r3, [r4, r2] + ldrb r5, [r1, #2] + cmp r3, r5 + beq _08016A90 + ldrb r5, [r1, #3] + strb r5, [r4, r2] +_08016A90: + pop {r4, r5, pc} + .align 2, 0 +_08016A94: + .byte 0x2A, 0x00, 0x03, 0x03, 0x2D, 0x00, 0x03, 0x03, 0x2B, 0x00, 0x03, 0x03 + .byte 0x2C, 0x00, 0x03, 0x03, 0x4C, 0x00, 0x03, 0x03, 0x4E, 0x00, 0x03, 0x03, 0x4D, 0x00, 0x03, 0x03 + .byte 0x4F, 0x00, 0x03, 0x03, 0x0A, 0x00, 0x02, 0x01, 0x09, 0x00, 0x02, 0x01, 0x0C, 0x00, 0x01, 0x02 + .byte 0x0B, 0x00, 0x01, 0x02, 0x52, 0x00, 0x03, 0x03, 0x27, 0x00, 0x03, 0x03, 0x26, 0x00, 0x03, 0x03 + .byte 0x00, 0x00 + + non_word_aligned_thumb_func_start sub_08016AD2 +sub_08016AD2: @ 0x08016AD2 + push {r4, lr} + adds r4, r0, #0 + bl sub_08016A6C + push {r0} + adds r0, r4, #0 + bl UpdateSpriteForCollisionLayer + pop {r0, r4, pc} + diff --git a/asm/code_08016B30.s b/asm/code_08016B30.s index 4b1079c9..059e1c4c 100644 --- a/asm/code_08016B30.s +++ b/asm/code_08016B30.s @@ -13,7 +13,7 @@ sub_08016B30: @ 0x08016B30 thumb_func_start sub_08016B34 sub_08016B34: @ 0x08016B34 ldr r1, _08016B54 @ =0x03007FFC - ldr r0, _08016B58 @ =gUnk_03005D90 + ldr r0, _08016B58 @ =IntrMain str r0, [r1] ldr r1, _08016B5C @ =0x04000004 ldr r2, _08016B60 @ =0x00005028 @@ -29,7 +29,7 @@ sub_08016B34: @ 0x08016B34 bx lr .align 2, 0 _08016B54: .4byte 0x03007FFC -_08016B58: .4byte gUnk_03005D90 +_08016B58: .4byte IntrMain _08016B5C: .4byte 0x04000004 _08016B60: .4byte 0x00005028 _08016B64: .4byte 0x04000200 diff --git a/asm/code_08018500.s b/asm/code_08018500.s index 182c60f8..bec8ac59 100644 --- a/asm/code_08018500.s +++ b/asm/code_08018500.s @@ -58,7 +58,7 @@ sub_0801855C: @ 0x0801855C ldr r4, _08018570 @ =gUnk_02033AB8 adds r0, r4, #0 movs r1, #0x14 - bl MemClear32 + bl MemClear adds r5, r4, #0 ldr r4, _08018574 @ =gUnk_080B3D20 movs r6, #0 diff --git a/asm/code_0801C370.s b/asm/code_0801C370.s index 8ca381af..88b5614f 100644 --- a/asm/code_0801C370.s +++ b/asm/code_0801C370.s @@ -32,7 +32,7 @@ _0801C398: movs r1, #0xcd lsls r1, r1, #2 adds r0, r5, #0 - bl MemClear32 + bl MemClear strb r6, [r5, #3] strh r4, [r5, #0xe] ldr r0, _0801C474 @ =gSave @@ -48,7 +48,7 @@ _0801C398: movs r1, #0x80 lsls r1, r1, #4 adds r0, r4, #0 - bl MemClear32 + bl MemClear ldr r1, _0801C47C @ =gScreen str r4, [r1, #0x10] ldr r0, _0801C480 @ =0x00001F0C @@ -93,7 +93,7 @@ _0801C398: adds r0, #0x34 movs r1, #0xc0 lsls r1, r1, #2 - bl MemClear32 + bl MemClear movs r0, #5 movs r1, #9 bl sub_0801CA6C diff --git a/asm/code_0801CEC0.s b/asm/code_0801CEC0.s index 95184820..bfdab8a3 100644 --- a/asm/code_0801CEC0.s +++ b/asm/code_0801CEC0.s @@ -12,7 +12,7 @@ sub_0801CFA8: @ 0x0801CFA8 adds r5, r0, #0 ldr r0, _0801CFCC @ =gUnk_02001A00 movs r1, #0x40 - bl MemClear32 + bl MemClear movs r4, #0 _0801CFB6: adds r0, r4, #0 diff --git a/asm/code_0801D79C.s b/asm/code_0801D79C.s index 6ac7a011..4cbc3a6f 100644 --- a/asm/code_0801D79C.s +++ b/asm/code_0801D79C.s @@ -203,7 +203,7 @@ _0801D9D8: strh r0, [r3] adds r0, r4, #0 mov r1, ip - bl MemClear32 + bl MemClear adds r0, r4, #0 b _0801DA02 .align 2, 0 @@ -217,8 +217,8 @@ _0801DA02: mov sl, r5 pop {r4, r5, r6, r7, pc} - thumb_func_start sub_0801DA0C -sub_0801DA0C: @ 0x0801DA0C + thumb_func_start zFree +zFree: @ 0x0801DA0C push {r4, r5, lr} ldr r3, _0801DA44 @ =gzHeap subs r1, r0, r3 @@ -282,13 +282,13 @@ zMallocInit: @ 0x0801DA7C ldr r0, _0801DA8C @ =gzHeap movs r1, #0x80 lsls r1, r1, #5 - bl MemClear32 + bl MemClear pop {pc} .align 2, 0 _0801DA8C: .4byte gzHeap - thumb_func_start sub_0801DA90 -sub_0801DA90: @ 0x0801DA90 + thumb_func_start DispReset +DispReset: @ 0x0801DA90 push {r4, r5, lr} adds r4, r0, #0 ldr r1, _0801DAEC @ =gMain @@ -319,15 +319,15 @@ sub_0801DA90: @ 0x0801DA90 movs r0, #0x80 lsls r0, r0, #0x13 strh r3, [r0] - bl sub_0801DB10 + bl ClearOAM bl sub_0801DB34 ldr r0, _0801DB08 @ =0x0600C000 movs r1, #0x20 - bl MemClear32 + bl MemClear ldr r0, _0801DB0C @ =gBG0Buffer movs r1, #0x80 lsls r1, r1, #4 - bl MemClear32 + bl MemClear strh r4, [r5, #0xe] pop {r4, r5, pc} .align 2, 0 @@ -341,8 +341,8 @@ _0801DB04: .4byte 0x00007FFF _0801DB08: .4byte 0x0600C000 _0801DB0C: .4byte gBG0Buffer - thumb_func_start sub_0801DB10 -sub_0801DB10: @ 0x0801DB10 + thumb_func_start ClearOAM +ClearOAM: @ 0x0801DB10 push {r4, lr} ldr r3, _0801DB30 @ =gUnk_03000020 movs r1, #0xe0 @@ -369,7 +369,7 @@ sub_0801DB34: @ 0x0801DB34 ldr r4, _0801DB6C @ =gScreen adds r0, r4, #0 movs r1, #0x7c - bl MemClear32 + bl MemClear ldr r0, _0801DB70 @ =gBG0Buffer str r0, [r4, #0x10] ldr r0, _0801DB74 @ =0x00001F0C @@ -424,7 +424,7 @@ sub_0801DBA0: @ 0x0801DBA0 adds r5, r1, #0 adds r1, r2, #0 adds r0, r5, #0 - bl MemClear32 + bl MemClear movs r0, #1 strb r0, [r5] ldr r2, _0801DBE4 @ =gScreenTransition @@ -699,7 +699,7 @@ _0801DDB8: ldr r0, _0801DDE0 @ =gUnk_02019EE0 movs r1, #0x80 lsls r1, r1, #8 - bl MemClear32 + bl MemClear b _0801DEE2 .align 2, 0 _0801DDD8: .4byte gUnk_080C9C50 @@ -968,7 +968,7 @@ sub_0801DFB4: @ 0x0801DFB4 ldr r7, _0801E004 @ =gUnk_02022740 adds r0, r7, #0 movs r1, #0x10 - bl MemClear32 + bl MemClear strh r4, [r7, #6] strh r5, [r7, #8] strh r6, [r7, #0xa] @@ -1209,7 +1209,7 @@ sub_0801E160: @ 0x0801E160 adds r0, r0, r4 movs r1, #0xa0 lsls r1, r1, #4 - bl MemClear32 + bl MemClear adds r0, r6, #0 mov r1, r8 mov r2, sb @@ -1279,7 +1279,7 @@ sub_0801E1EC: @ 0x0801E1EC adds r0, r0, r5 movs r1, #0xa0 lsls r1, r1, #4 - bl MemClear32 + bl MemClear adds r0, r4, #0 movs r1, #0 bl sub_0801E24C @@ -1443,7 +1443,7 @@ sub_0801E31C: @ 0x0801E31C adds r0, r0, r1 movs r1, #0xa0 lsls r1, r1, #4 - bl MemClear32 + bl MemClear cmp sl, sb bge _0801E3DC movs r6, #0 @@ -1738,7 +1738,7 @@ sub_0801E49C: @ 0x0801E49C adds r0, r0, r6 movs r1, #0xa0 lsls r1, r1, #4 - bl MemClear32 + bl MemClear ldr r2, _0801E5E8 @ =gUnk_02018EE0 ldrb r1, [r5] lsls r0, r1, #2 diff --git a/asm/code_0804AA84.s b/asm/code_0804AA84.s index c6424780..3174946c 100644 --- a/asm/code_0804AA84.s +++ b/asm/code_0804AA84.s @@ -9,7 +9,7 @@ sub_0804AB70: @ 0x0804AB70 push {r4, r5, lr} movs r0, #0 - bl sub_0801DA90 + bl DispReset ldr r1, _0804ABF8 @ =gScreen movs r2, #0 movs r0, #0x92 diff --git a/asm/code_0804B9F8.s b/asm/code_0804B9F8.s index 6ee254e6..a564376f 100644 --- a/asm/code_0804B9F8.s +++ b/asm/code_0804B9F8.s @@ -50,10 +50,10 @@ sub_0804FFE4: @ 0x0804FFE4 ldr r4, _08050000 @ =gFadeControl adds r0, r4, #0 movs r1, #0x1c - bl MemClear32 + bl MemClear ldr r0, _08050004 @ =gUnk_020354C0 movs r1, #0x80 - bl MemClear32 + bl MemClear movs r0, #1 rsbs r0, r0, #0 str r0, [r4, #4] diff --git a/asm/code_080526F8.s b/asm/code_080526F8.s index 9f1662ed..150d4fea 100644 --- a/asm/code_080526F8.s +++ b/asm/code_080526F8.s @@ -791,7 +791,7 @@ sub_08052CFC: @ 0x08052CFC ldr r4, _08052D44 @ =gArea ldr r1, _08052D48 @ =0x00000894 adds r0, r4, #0 - bl MemClear32 + bl MemClear ldr r0, _08052D4C @ =gRoomControls ldrb r1, [r0, #4] lsls r1, r1, #2 @@ -996,7 +996,7 @@ sub_08052EA0: @ 0x08052EA0 ldr r4, _08052EE4 @ =gRoomVars adds r0, r4, #0 movs r1, #0xcc - bl MemClear32 + bl MemClear movs r0, #0xff strb r0, [r4, #0x10] strb r0, [r4, #0x11] @@ -1013,7 +1013,7 @@ sub_08052EA0: @ 0x08052EA0 ldrb r0, [r0, #1] strb r0, [r2, #1] bl sub_08049D30 - bl sub_0807DA70 + bl InitScriptData bl sub_08054524 bl sub_080186D4 bl sub_0806F364 @@ -1178,7 +1178,7 @@ sub_08052FF4: @ 0x08052FF4 ldr r5, _08053074 @ =gUnk_020342CC adds r0, r5, #0 movs r1, #0x20 - bl MemClear32 + bl MemClear str r5, [r5, #0x20] ldr r0, _08053078 @ =gAreaRoomHeaders lsls r6, r6, #2 @@ -1570,17 +1570,17 @@ sub_08053320: @ 0x08053320 movs r4, #0x80 lsls r4, r4, #4 adds r1, r4, #0 - bl MemClear32 + bl MemClear ldr r0, _08053380 @ =gBG1Buffer adds r1, r4, #0 - bl MemClear32 + bl MemClear ldr r0, _08053384 @ =gBG2Buffer adds r1, r4, #0 - bl MemClear32 + bl MemClear ldr r0, _08053388 @ =gBG3Buffer movs r1, #0x80 lsls r1, r1, #5 - bl MemClear32 + bl MemClear movs r0, #0x10 bl LoadGfxGroup movs r0, #0x17 @@ -2013,7 +2013,7 @@ sub_0805368C: @ 0x0805368C movs r0, #6 movs r1, #0x5d movs r2, #6 - bl FindEntityInListBySubtype + bl FindEntityByID cmp r0, #0 beq _080536A6 bl DeleteEntity @@ -2139,7 +2139,7 @@ sub_08053758: @ 0x08053758 strh r2, [r0, #0xa] bl sub_0801B170 movs r0, #0 - bl sub_0801DA90 + bl DispReset ldr r2, _080537F0 @ =gScreen movs r0, #0x99 lsls r0, r0, #6 @@ -2222,7 +2222,7 @@ sub_08053800: @ 0x08053800 ldr r0, _08053888 @ =gBG1Buffer movs r1, #0x80 lsls r1, r1, #4 - bl MemClear32 + bl MemClear ldr r0, _0805388C @ =0x00000F01 adds r5, r5, r0 ldr r1, [r4] @@ -2380,7 +2380,7 @@ sub_08053974: @ 0x08053974 bne _080539A8 bl sub_0804FFE4 movs r0, #1 - bl sub_0801DA90 + bl DispReset bl sub_080197AC bl sub_08051F78 ldr r0, _080539B0 @ =gUnk_080FCBC4 @@ -2437,7 +2437,7 @@ sub_080539F4: @ 0x080539F4 cmp r0, #0 bne _08053A10 movs r0, #1 - bl sub_0801DA90 + bl DispReset ldr r0, _08053A18 @ =gMenu ldrb r1, [r0, #6] adds r1, #1 @@ -2587,7 +2587,7 @@ sub_08053B10: @ 0x08053B10 adds r1, #1 strb r1, [r0, #5] movs r0, #1 - bl sub_0801DA90 + bl DispReset movs r1, #0x80 lsls r1, r1, #1 movs r0, #4 @@ -2673,7 +2673,7 @@ sub_08053BBC: @ 0x08053BBC adds r1, #1 strb r1, [r0, #5] movs r0, #1 - bl sub_0801DA90 + bl DispReset movs r1, #0x80 lsls r1, r1, #1 movs r0, #4 @@ -3187,8 +3187,8 @@ GetSaleItemConfirmMessageID: @ 0x08053FD0 .align 2, 0 _08053FDC: .4byte gUnk_080FD964 - thumb_func_start sub_08053FE0 -sub_08053FE0: @ 0x08053FE0 + thumb_func_start GetItemPrice +GetItemPrice: @ 0x08053FE0 lsls r0, r0, #3 ldr r1, _08053FEC @ =gUnk_080FD964 adds r0, r0, r1 diff --git a/asm/code_0805436C.s b/asm/code_0805436C.s index 8b559fc7..6e6c053a 100644 --- a/asm/code_0805436C.s +++ b/asm/code_0805436C.s @@ -33,7 +33,7 @@ sub_0805488C: @ 0x0805488C lsls r0, r0, #1 strh r0, [r2, #8] movs r0, #0 - bl sub_0801DA90 + bl DispReset ldrb r0, [r4, #3] movs r1, #1 bl sub_08054974 @@ -875,7 +875,7 @@ _08054F60: .4byte 0x00004074 sub_08054F64: @ 0x08054F64 push {lr} ldrb r0, [r0, #0xb] - ldr r3, _08054F7C @ =gUnk_02033280 + ldr r3, _08054F7C @ =gActiveScriptInfo ldr r2, [r3] adds r1, r2, #0 ands r1, r0 @@ -885,7 +885,7 @@ sub_08054F64: @ 0x08054F64 strb r0, [r3, #6] b _08054F8C .align 2, 0 -_08054F7C: .4byte gUnk_02033280 +_08054F7C: .4byte gActiveScriptInfo _08054F80: bics r2, r1 str r2, [r3] @@ -2571,7 +2571,7 @@ _08055C6C: movs r1, #0x9e movs r2, #6 movs r3, #0 - bl FindEntityInListByForm + bl FindEntity adds r4, r0, #0 cmp r4, #0 beq _08055C8C diff --git a/asm/code_08056418.s b/asm/code_08056418.s index 97457697..144005f4 100644 --- a/asm/code_08056418.s +++ b/asm/code_08056418.s @@ -267,11 +267,11 @@ _080568B2: beq _080568D2 adds r0, r6, #0 movs r1, #4 - bl MemClear32 + bl MemClear ldr r4, _08056910 @ =gUnk_02024030 adds r0, r4, #0 movs r1, #0x18 - bl MemClear32 + bl MemClear movs r0, #1 strb r0, [r4] strb r0, [r6] @@ -472,7 +472,7 @@ _08056A30: movs r1, #3 strb r1, [r2] movs r1, #0x18 - bl MemClear32 + bl MemClear movs r0, #0x6a bl SoundReq adds r1, r6, #0 diff --git a/asm/code_0805E3B0.s b/asm/code_0805E3B0.s index ba150ef6..5a0336df 100644 --- a/asm/code_0805E3B0.s +++ b/asm/code_0805E3B0.s @@ -360,15 +360,15 @@ EraseAllEntities: @ 0x0805E60C bl DeleteAllEntities ldr r0, _0805E654 @ =gUnk_03003DC0 movs r1, #0xc - bl MemClear32 + bl MemClear ldr r0, _0805E658 @ =gPlayerEntity movs r1, #0xaa lsls r1, r1, #6 - bl MemClear32 + bl MemClear ldr r0, _0805E65C @ =gUnk_02033290 movs r1, #0x80 lsls r1, r1, #4 - bl MemClear32 + bl MemClear bl sub_0805E98C ldr r0, _0805E660 @ =gEntCount movs r1, #0 diff --git a/asm/code_0805EC04.s b/asm/code_0805EC04.s index 45cad29a..6c8dc59f 100644 --- a/asm/code_0805EC04.s +++ b/asm/code_0805EC04.s @@ -751,7 +751,7 @@ _0805F2D0: bne _0805F2F0 adds r0, r5, #0 movs r1, #0xc - bl MemClear32 + bl MemClear ldrb r0, [r4] movs r1, #1 orrs r0, r1 @@ -781,7 +781,7 @@ _0805F308: cmp r0, r2 bne _0805F318 movs r1, #0xc - bl MemClear32 + bl MemClear b _0805F320 .align 2, 0 _0805F314: .4byte gUnk_02036540 @@ -944,7 +944,7 @@ sub_0805F440: @ 0x0805F440 adds r4, r0, #0 adds r5, r1, #0 movs r1, #0x30 - bl MemClear32 + bl MemClear ldr r0, _0805F45C @ =0x0000FFFF cmp r5, r0 bls _0805F460 @@ -1122,7 +1122,7 @@ _0805F596: _0805F59E: ldr r0, _0805F5C8 @ =gUnk_02034330 movs r1, #0x18 - bl MemClear32 + bl MemClear _0805F5A6: mov r0, sb mov r1, sp diff --git a/asm/code_0806EC20.s b/asm/code_0806EC20.s index 293d4e87..ff7f71a1 100644 --- a/asm/code_0806EC20.s +++ b/asm/code_0806EC20.s @@ -27,7 +27,7 @@ sub_0806EC38: @ 0x0806EC38 movs r0, #7 movs r1, #0x58 movs r2, #7 - bl FindEntityInListBySubtype + bl FindEntityByID cmp r0, #0 beq _0806EC4C bl DeleteEntity diff --git a/asm/code_0806ED78.s b/asm/code_0806ED78.s index 264756c7..d6735892 100644 --- a/asm/code_0806ED78.s +++ b/asm/code_0806ED78.s @@ -842,7 +842,7 @@ sub_0806F364: @ 0x0806F364 adds r1, r2, r3 adds r0, r0, r1 movs r1, #0x10 - bl MemClear32 + bl MemClear pop {pc} .align 2, 0 _0806F384: .4byte gArea @@ -1193,13 +1193,13 @@ sub_0806F5BC: @ 0x0806F5BC lsls r5, r1, #0x10 asrs r5, r5, #0x10 adds r1, r5, #0 - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #0x10 asrs r0, r0, #0x10 movs r6, #0x80 lsls r6, r6, #1 adds r1, r6, #0 - bl sub_0806FA04 + bl FixedDiv lsls r0, r0, #0x10 asrs r0, r0, #8 ldr r1, [r7, #0x2c] @@ -1211,11 +1211,11 @@ sub_0806F5BC: @ 0x0806F5BC movs r1, #0 ldrsh r0, [r4, r1] adds r1, r5, #0 - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #0x10 asrs r0, r0, #0x10 adds r1, r6, #0 - bl sub_0806FA04 + bl FixedDiv lsls r0, r0, #0x10 asrs r0, r0, #8 ldr r1, [r7, #0x30] @@ -1248,13 +1248,13 @@ sub_0806F62C: @ 0x0806F62C lsls r5, r5, #0x10 asrs r5, r5, #0x10 adds r1, r5, #0 - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #0x10 asrs r0, r0, #0x10 movs r1, #0x80 lsls r1, r1, #1 mov r8, r1 - bl sub_0806FA04 + bl FixedDiv lsls r0, r0, #0x10 asrs r0, r0, #8 ldr r1, [r6, #0x2c] @@ -1266,11 +1266,11 @@ sub_0806F62C: @ 0x0806F62C movs r1, #0 ldrsh r0, [r4, r1] adds r1, r5, #0 - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #0x10 asrs r0, r0, #0x10 mov r1, r8 - bl sub_0806FA04 + bl FixedDiv lsls r0, r0, #0x10 asrs r0, r0, #8 ldr r1, [r6, #0x30] @@ -1300,13 +1300,13 @@ sub_0806F69C: @ 0x0806F69C ldrsh r0, [r0, r1] movs r2, #0x24 ldrsh r1, [r6, r2] - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #0x10 asrs r0, r0, #0x10 movs r4, #0x80 lsls r4, r4, #1 adds r1, r4, #0 - bl sub_0806FA04 + bl FixedDiv lsls r0, r0, #0x10 asrs r0, r0, #8 ldr r1, [r6, #0x2c] @@ -1320,11 +1320,11 @@ sub_0806F69C: @ 0x0806F69C ldrsh r0, [r0, r1] movs r2, #0x24 ldrsh r1, [r6, r2] - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #0x10 asrs r0, r0, #0x10 adds r1, r4, #0 - bl sub_0806FA04 + bl FixedDiv lsls r0, r0, #0x10 asrs r0, r0, #8 ldr r1, [r6, #0x30] diff --git a/asm/code_0806FA6C.s b/asm/code_0806FA6C.s index 81ff4789..f006651f 100644 --- a/asm/code_0806FA6C.s +++ b/asm/code_0806FA6C.s @@ -139,13 +139,13 @@ UnloadHitbox: @ 0x0806FBEC push {r4, lr} adds r4, r0, #0 ldr r0, [r4, #0x48] - bl sub_0801DA0C + bl zFree movs r0, #0 str r0, [r4, #0x48] pop {r4, pc} - thumb_func_start sub_0806FBFC -sub_0806FBFC: @ 0x0806FBFC + thumb_func_start CheckPlayerProximity +CheckPlayerProximity: @ 0x0806FBFC push {r4, r5, r6, lr} adds r5, r3, #0 ldr r4, _0806FC20 @ =gPlayerEntity @@ -385,7 +385,7 @@ sub_0806FD8C: @ 0x0806FD8C ldr r0, _0806FD9C @ =gUnk_020000C0 movs r1, #0xc0 lsls r1, r1, #4 - bl MemClear32 + bl MemClear pop {pc} .align 2, 0 _0806FD9C: .4byte gUnk_020000C0 @@ -534,7 +534,7 @@ _0806FE9E: bls _0806FE9E adds r0, r6, #0 movs r1, #0x40 - bl MemClear32 + bl MemClear _0806FEB4: pop {r4, r5, r6, pc} .align 2, 0 @@ -1454,7 +1454,7 @@ sub_0807059C: @ 0x0807059C push {lr} ldr r0, _080705A8 @ =gUnk_02034490 movs r1, #0x18 - bl MemClear32 + bl MemClear pop {pc} .align 2, 0 _080705A8: .4byte gUnk_02034490 diff --git a/asm/code_08070698.s b/asm/code_08070698.s index 10b20c3e..69452e1c 100644 --- a/asm/code_08070698.s +++ b/asm/code_08070698.s @@ -6,1322 +6,9 @@ .text - thumb_func_start sub_080714A8 -sub_080714A8: @ 0x080714A8 - push {r4, lr} - adds r4, r0, #0 - ldr r0, _08071524 @ =gArea - ldrb r0, [r0, #0x17] - cmp r0, #5 - bgt _080714BE - cmp r0, #4 - blt _080714BE - ldr r0, _08071528 @ =gPlayerEntity - bl sub_0806F948 -_080714BE: - ldr r3, _0807152C @ =gPlayerState - ldrb r1, [r3, #0xd] - movs r0, #0x84 - ands r0, r1 - cmp r0, #0 - bne _0807153E - ldrb r0, [r4, #0x15] - cmp r0, r1 - beq _080714D4 - movs r0, #8 - strb r0, [r4, #0xe] -_080714D4: - ldrb r0, [r4, #0xe] - subs r0, #1 - strb r0, [r4, #0xe] - lsls r0, r0, #0x18 - lsrs r0, r0, #0x18 - cmp r0, #0xff - bne _08071538 - ldrb r0, [r3, #0xd] - strb r0, [r4, #0x15] - lsls r0, r0, #0x18 - lsrs r0, r0, #0x1a - strb r0, [r4, #0x14] - movs r0, #0x80 - lsls r0, r0, #0xa - str r0, [r4, #0x20] - movs r1, #0 - movs r0, #0x80 - lsls r0, r0, #1 - strh r0, [r4, #0x24] - movs r0, #9 - strb r0, [r4, #0xc] - movs r0, #7 - strb r0, [r4, #0xd] - strb r1, [r4, #0xf] - ldr r1, [r3, #0x30] - movs r0, #8 - ands r0, r1 - ldr r4, _08071530 @ =0x0000080C - adds r2, r4, #0 - cmp r0, #0 - beq _08071516 - ldr r0, _08071534 @ =0x0000041C - adds r2, r0, #0 -_08071516: - strh r2, [r3, #8] - movs r0, #0x21 - rsbs r0, r0, #0 - ands r1, r0 - str r1, [r3, #0x30] - b _0807156A - .align 2, 0 -_08071524: .4byte gArea -_08071528: .4byte gPlayerEntity -_0807152C: .4byte gPlayerState -_08071530: .4byte 0x0000080C -_08071534: .4byte 0x0000041C -_08071538: - ldrb r0, [r3, #0xd] - strb r0, [r4, #0x15] - b _08071542 -_0807153E: - movs r0, #8 - strb r0, [r4, #0xe] -_08071542: - ldr r0, _0807155C @ =gArea - ldrb r0, [r0, #0x17] - cmp r0, #4 - bne _08071560 - adds r0, r4, #0 - adds r0, #0x5a - ldrb r0, [r0] - cmp r0, #0 - bne _08071566 - adds r0, r4, #0 - bl UpdateAnimationSingleFrame - b _0807156A - .align 2, 0 -_0807155C: .4byte gArea -_08071560: - adds r0, r4, #0 - bl sub_08077698 -_08071566: - bl sub_08079938 -_0807156A: - pop {r4, pc} - thumb_func_start sub_0807156C -sub_0807156C: @ 0x0807156C - push {lr} - ldr r2, _080715A0 @ =gRoomControls - movs r1, #0 - str r1, [r2, #0x30] - ldr r2, _080715A4 @ =gUnk_02034490 - movs r1, #1 - strb r1, [r2] - movs r1, #3 - strb r1, [r0, #0xd] - movs r1, #0x1e - strb r1, [r0, #0xf] - ldr r2, _080715A8 @ =gPlayerState - movs r1, #0xe7 - lsls r1, r1, #3 - strh r1, [r2, #8] - movs r1, #6 - movs r2, #1 - movs r3, #0 - bl CreateObjectWithParent - bl sub_08077B20 - bl sub_0805E544 - pop {pc} - .align 2, 0 -_080715A0: .4byte gRoomControls -_080715A4: .4byte gUnk_02034490 -_080715A8: .4byte gPlayerState - - thumb_func_start sub_080715AC -sub_080715AC: @ 0x080715AC - push {r4, lr} - adds r4, r0, #0 - ldrb r0, [r4, #0xf] - cmp r0, #0 - bne _080715CC - adds r0, r4, #0 - bl UpdateAnimationSingleFrame - ldr r0, _080715D0 @ =gPlayerState - ldr r0, [r0, #0x30] - movs r1, #0x80 - ands r0, r1 - cmp r0, #0 - beq _080715CC - movs r0, #4 - strb r0, [r4, #0xd] -_080715CC: - pop {r4, pc} - .align 2, 0 -_080715D0: .4byte gPlayerState - - thumb_func_start sub_080715D4 -sub_080715D4: @ 0x080715D4 - push {lr} - adds r3, r0, #0 - movs r2, #0 - movs r0, #5 - strb r0, [r3, #0xd] - movs r0, #0x29 - adds r0, r0, r3 - mov ip, r0 - ldrb r1, [r0] - movs r0, #0x39 - rsbs r0, r0, #0 - ands r0, r1 - mov r1, ip - strb r0, [r1] - strb r2, [r3, #0xf] - ldrb r0, [r3, #0x19] - movs r1, #3 - orrs r0, r1 - strb r0, [r3, #0x19] - adds r0, r3, #0 - adds r0, #0x80 - movs r2, #0x80 - lsls r2, r2, #1 - str r2, [r0] - adds r0, #4 - str r2, [r0] - adds r0, r3, #0 - adds r1, r2, #0 - movs r3, #0 - bl sub_0805EC9C - ldr r2, _08071628 @ =gPlayerState - ldr r0, _0807162C @ =0x000002C3 - strh r0, [r2, #8] - ldr r0, [r2, #0x30] - movs r1, #0x80 - orrs r0, r1 - str r0, [r2, #0x30] - ldr r0, _08071630 @ =0x0000016F - bl SoundReq - pop {pc} - .align 2, 0 -_08071628: .4byte gPlayerState -_0807162C: .4byte 0x000002C3 -_08071630: .4byte 0x0000016F - - thumb_func_start sub_08071634 -sub_08071634: @ 0x08071634 - push {r4, r5, r6, r7, lr} - mov r7, r8 - push {r7} - adds r5, r0, #0 - adds r0, #0x81 - ldrb r0, [r0] - cmp r0, #0 - beq _08071654 - adds r1, r5, #0 - adds r1, #0x80 - ldr r0, [r1] - adds r0, #0x80 - lsls r0, r0, #0x14 - lsrs r7, r0, #0x17 - adds r4, r1, #0 - b _0807166A -_08071654: - adds r4, r5, #0 - adds r4, #0x80 - ldrb r1, [r4] - lsrs r1, r1, #6 - movs r0, #3 - eors r1, r0 - adds r1, #1 - movs r0, #0x10 - bl __divsi3 - asrs r7, r0, #1 -_0807166A: - adds r0, r5, #0 - adds r0, #0x84 - ldr r3, [r0] - movs r1, #0x80 - lsls r1, r1, #1 - adds r2, r0, #0 - cmp r3, r1 - bls _08071684 - adds r0, r3, #0 - adds r0, #0x80 - lsls r0, r0, #0x14 - lsrs r3, r0, #0x17 - b _08071694 -_08071684: - cmp r3, r1 - bne _0807168C - movs r3, #0x10 - b _08071694 -_0807168C: - ldr r1, _080716B0 @ =gUnk_0811BABC - lsrs r0, r3, #5 - adds r0, r0, r1 - ldrb r3, [r0] -_08071694: - movs r0, #0x80 - lsls r0, r0, #9 - mov r8, r0 - adds r0, r5, #0 - adds r0, #0x5a - ldrb r0, [r0] - cmp r0, #2 - beq _080716EA - cmp r0, #2 - bgt _080716B4 - cmp r0, #1 - beq _080716BA - b _08071754 - .align 2, 0 -_080716B0: .4byte gUnk_0811BABC -_080716B4: - cmp r0, #3 - beq _0807171E - b _08071754 -_080716BA: - movs r1, #0x29 - adds r1, r1, r5 - mov ip, r1 - ldrb r1, [r1] - movs r0, #0x39 - rsbs r0, r0, #0 - ands r0, r1 - mov r1, ip - strb r0, [r1] - ldr r0, [r4] - cmp r0, #0x80 - bls _080716D6 - subs r0, r0, r7 - str r0, [r4] -_080716D6: - lsls r1, r3, #1 - ldr r0, [r2] - adds r0, r0, r1 - str r0, [r2] - mov r0, r8 - lsls r1, r0, #1 - ldr r0, [r5, #0x30] - adds r0, r0, r1 - str r0, [r5, #0x30] - b _08071754 -_080716EA: - ldr r0, [r4] - adds r0, r0, r7 - str r0, [r4] - ldr r1, [r2] - movs r6, #0x80 - lsls r6, r6, #1 - cmp r1, r6 - bls _08071710 - ldr r0, _0807170C @ =0x0000017F - cmp r1, r0 - bhi _08071702 - lsrs r3, r3, #1 -_08071702: - subs r0, r1, r3 - cmp r0, #0xff - bhi _08071716 - str r6, [r2] - b _08071718 - .align 2, 0 -_0807170C: .4byte 0x0000017F -_08071710: - cmp r1, #0x80 - bls _08071718 - subs r0, r1, r3 -_08071716: - str r0, [r2] -_08071718: - ldr r0, [r5, #0x34] - mov r1, r8 - b _08071750 -_0807171E: - ldr r0, [r4] - ldr r6, _08071740 @ =0x0000033F - cmp r0, r6 - bhi _0807172A - adds r0, r0, r7 - str r0, [r4] -_0807172A: - ldr r1, [r2] - cmp r1, r6 - bls _08071744 - movs r0, #8 - strb r0, [r5, #0xe] - movs r0, #0x1e - strb r0, [r5, #0xf] - movs r0, #6 - strb r0, [r5, #0xd] - b _0807174A - .align 2, 0 -_08071740: .4byte 0x0000033F -_08071744: - lsls r0, r3, #1 - adds r0, r1, r0 - str r0, [r2] -_0807174A: - mov r0, r8 - lsls r1, r0, #1 - ldr r0, [r5, #0x34] -_08071750: - subs r0, r0, r1 - str r0, [r5, #0x34] -_08071754: - ldr r1, [r4] - ldr r2, [r2] - adds r0, r5, #0 - movs r3, #0 - bl sub_0805EC9C - adds r0, r5, #0 - bl UpdateAnimationSingleFrame - pop {r3} - mov r8, r3 - pop {r4, r5, r6, r7, pc} - - thumb_func_start sub_0807176C -sub_0807176C: @ 0x0807176C - push {r4, lr} - adds r4, r0, #0 - ldrb r0, [r4, #0xe] - cmp r0, #0 - bne _080717C6 - movs r1, #0x80 - lsls r1, r1, #6 - adds r0, r4, #0 - bl sub_08003FC4 - cmp r0, #0 - bne _080717CA - ldrb r1, [r4, #0x18] - movs r0, #4 - rsbs r0, r0, #0 - ands r0, r1 - strb r0, [r4, #0x18] - ldr r1, _080717AC @ =gArea - ldrb r0, [r1, #0x17] - cmp r0, #3 - bne _080717B0 - ldrb r0, [r4, #0xf] - subs r0, #1 - strb r0, [r4, #0xf] - lsls r0, r0, #0x18 - cmp r0, #0 - bne _080717CA - adds r0, r4, #0 - bl sub_080717F8 - b _080717CA - .align 2, 0 -_080717AC: .4byte gArea -_080717B0: - cmp r0, #6 - bne _080717C0 - ldr r0, _080717BC @ =gUnk_0813AB58 - bl DoExitTransition - b _080717CA - .align 2, 0 -_080717BC: .4byte gUnk_0813AB58 -_080717C0: - movs r0, #1 - strb r0, [r1, #0x19] - b _080717CA -_080717C6: - subs r0, #1 - strb r0, [r4, #0xe] -_080717CA: - pop {r4, pc} - - thumb_func_start sub_080717CC -sub_080717CC: @ 0x080717CC - push {lr} - adds r1, r0, #0 - ldr r0, _080717E4 @ =gFadeControl - ldrb r0, [r0] - cmp r0, #0 - bne _080717F4 - ldrb r0, [r1, #0xe] - cmp r0, #0 - beq _080717E8 - subs r0, #1 - strb r0, [r1, #0xe] - b _080717F4 - .align 2, 0 -_080717E4: .4byte gFadeControl -_080717E8: - adds r0, r1, #0 - bl sub_080717F8 - movs r0, #0x10 - bl sub_080500F4 -_080717F4: - pop {pc} - .align 2, 0 - - thumb_func_start sub_080717F8 -sub_080717F8: @ 0x080717F8 - push {r4, lr} - ldr r2, _08071850 @ =gArea - ldrb r1, [r2, #0x16] - lsls r1, r1, #1 - strb r1, [r0, #0x14] - ldr r3, _08071854 @ =gUnk_0811BAC4 - ldrb r1, [r2, #0x16] - lsls r1, r1, #2 - adds r1, r1, r3 - ldrh r1, [r1] - ldrh r4, [r2, #0x12] - adds r1, r1, r4 - movs r4, #0 - strh r1, [r0, #0x2e] - ldrb r1, [r2, #0x16] - lsls r1, r1, #1 - adds r1, #1 - lsls r1, r1, #1 - adds r1, r1, r3 - ldrh r1, [r1] - ldrh r3, [r2, #0x14] - adds r1, r1, r3 - strh r1, [r0, #0x32] - movs r1, #0xb4 - strb r1, [r2, #0x1a] - ldr r1, _08071858 @ =gUnk_02034490 - strb r4, [r1] - movs r1, #9 - strb r1, [r0, #0xc] - strb r4, [r0, #0xd] - ldr r3, _0807185C @ =gPlayerState - ldr r1, [r3, #0x30] - movs r2, #0x21 - rsbs r2, r2, #0 - ands r1, r2 - movs r2, #0x80 - orrs r1, r2 - str r1, [r3, #0x30] - bl sub_0805EC60 - bl UnfreezeTime - pop {r4, pc} - .align 2, 0 -_08071850: .4byte gArea -_08071854: .4byte gUnk_0811BAC4 -_08071858: .4byte gUnk_02034490 -_0807185C: .4byte gPlayerState - - thumb_func_start sub_08071860 -sub_08071860: @ 0x08071860 - push {r4, lr} - adds r4, r0, #0 - bl sub_08078EFC - cmp r0, #0 - beq _08071876 - bl sub_08056360 - bl sub_08071A6C - b _08071896 -_08071876: - ldr r0, _08071898 @ =gPlayerState - adds r0, #0xa8 - movs r1, #0x13 - strb r1, [r0] - ldrb r1, [r4, #0x10] - movs r0, #0x7f - ands r0, r1 - strb r0, [r4, #0x10] - ldr r1, _0807189C @ =gUnk_0811BAD4 - ldrb r0, [r4, #0xd] - lsls r0, r0, #2 - adds r0, r0, r1 - ldr r1, [r0] - adds r0, r4, #0 - bl _call_via_r1 -_08071896: - pop {r4, pc} - .align 2, 0 -_08071898: .4byte gPlayerState -_0807189C: .4byte gUnk_0811BAD4 - - thumb_func_start sub_080718A0 -sub_080718A0: @ 0x080718A0 - push {r4, r5, lr} - adds r4, r0, #0 - bl ResetPlayer - ldr r0, _080718EC @ =gUnk_03000B80 - adds r0, #0x63 - movs r1, #0 - strb r1, [r0] - adds r0, r4, #0 - adds r0, #0x3d - strb r1, [r0] - ldr r1, _080718F0 @ =gUnk_03003DC0 - movs r2, #6 - movs r0, #6 - strb r0, [r1] - ldrb r1, [r4, #0x11] - subs r0, #0x16 - ands r0, r1 - orrs r0, r2 - strb r0, [r4, #0x11] - ldr r5, _080718F4 @ =gPlayerState - ldr r0, [r5, #0x30] - movs r1, #0x80 - ands r0, r1 - cmp r0, #0 - beq _080718F8 - movs r0, #2 - strb r0, [r4, #0xd] - adds r2, r4, #0 - adds r2, #0x29 - ldrb r1, [r2] - subs r0, #0x3b - ands r0, r1 - strb r0, [r2] - bl sub_08052BB8 - b _08071938 - .align 2, 0 -_080718EC: .4byte gUnk_03000B80 -_080718F0: .4byte gUnk_03003DC0 -_080718F4: .4byte gPlayerState -_080718F8: - ldrb r0, [r5, #2] - cmp r0, #0 - bne _08071928 - ldrb r0, [r4, #0xd] - adds r0, #1 - strb r0, [r4, #0xd] - ldrb r0, [r4, #0x14] - cmp r0, #2 - bne _08071914 - ldr r0, _08071910 @ =0x000003CA - b _08071916 - .align 2, 0 -_08071910: .4byte 0x000003CA -_08071914: - ldr r0, _08071924 @ =0x000003C6 -_08071916: - strh r0, [r5, #8] - ldrb r1, [r4, #0x18] - movs r0, #0x41 - rsbs r0, r0, #0 - ands r0, r1 - strb r0, [r4, #0x18] - b _08071938 - .align 2, 0 -_08071924: .4byte 0x000003C6 -_08071928: - movs r1, #0x80 - lsls r1, r1, #6 - adds r0, r4, #0 - bl sub_08003FC4 - cmp r0, #0 - bne _08071938 - strb r0, [r5, #2] -_08071938: - pop {r4, r5, pc} - .align 2, 0 - - thumb_func_start sub_0807193C -sub_0807193C: @ 0x0807193C - push {r4, lr} - adds r4, r0, #0 - bl UpdateAnimationSingleFrame - adds r0, r4, #0 - adds r0, #0x5a - ldrb r1, [r0] - movs r0, #0x80 - ands r0, r1 - cmp r0, #0 - beq _08071986 - ldrb r0, [r4, #0xd] - adds r0, #1 - strb r0, [r4, #0xd] - adds r0, r4, #0 - movs r1, #6 - movs r2, #0 - movs r3, #0 - bl CreateObjectWithParent - str r0, [r4, #0x54] - cmp r0, #0 - beq _08071986 - ldrb r0, [r4, #0x14] - cmp r0, #2 - bne _0807197C - ldr r1, _08071978 @ =gPlayerState - movs r0, #0xf3 - lsls r0, r0, #2 - b _08071980 - .align 2, 0 -_08071978: .4byte gPlayerState -_0807197C: - ldr r1, _08071988 @ =gPlayerState - ldr r0, _0807198C @ =0x000003C7 -_08071980: - strh r0, [r1, #8] - bl sub_08052BB8 -_08071986: - pop {r4, pc} - .align 2, 0 -_08071988: .4byte gPlayerState -_0807198C: .4byte 0x000003C7 - - thumb_func_start sub_08071990 -sub_08071990: @ 0x08071990 - push {r4, lr} - adds r2, r0, #0 - ldr r0, _080719C0 @ =gTextBox - ldrb r1, [r0] - movs r0, #0x7f - ands r0, r1 - cmp r0, #0 - bne _080719E2 - ldrb r0, [r2, #0xd] - adds r0, #1 - strb r0, [r2, #0xd] - ldr r3, _080719C4 @ =gPlayerState - ldr r0, [r3, #0x30] - movs r1, #0x80 - ands r0, r1 - cmp r0, #0 - bne _080719D8 - ldrb r0, [r2, #0x14] - cmp r0, #2 - bne _080719CC - ldr r0, _080719C8 @ =0x000003CD - strh r0, [r3, #8] - b _08071A4A - .align 2, 0 -_080719C0: .4byte gTextBox -_080719C4: .4byte gPlayerState -_080719C8: .4byte 0x000003CD -_080719CC: - ldr r0, _080719D4 @ =0x000003C9 - strh r0, [r3, #8] - b _08071A4A - .align 2, 0 -_080719D4: .4byte 0x000003C9 -_080719D8: - bl sub_08071A6C - bl sub_08079258 - b _08071A4A -_080719E2: - ldr r4, _08071A20 @ =gPlayerState - ldr r0, [r4, #0x30] - movs r1, #0x80 - ands r0, r1 - cmp r0, #0 - bne _08071A4A - ldrb r0, [r2, #0x14] - movs r3, #0 - cmp r0, #2 - bne _080719F8 - movs r3, #4 -_080719F8: - ldr r0, [r2, #0x54] - ldrb r0, [r0, #0xe] - cmp r0, #0 - beq _08071A24 - adds r0, r3, #0 - adds r0, #0xc8 - adds r1, r2, #0 - adds r1, #0x58 - lsls r0, r0, #0x18 - lsrs r0, r0, #0x18 - ldrb r1, [r1] - cmp r0, r1 - beq _08071A44 - movs r1, #0xf2 - lsls r1, r1, #2 - adds r0, r1, #0 - adds r0, r3, r0 - strh r0, [r4, #8] - b _08071A4A - .align 2, 0 -_08071A20: .4byte gPlayerState -_08071A24: - adds r0, r3, #0 - adds r0, #0xc7 - adds r1, r2, #0 - adds r1, #0x58 - lsls r0, r0, #0x18 - lsrs r0, r0, #0x18 - ldrb r1, [r1] - cmp r0, r1 - beq _08071A44 - ldr r1, _08071A40 @ =0x000003C7 - adds r0, r3, r1 - strh r0, [r4, #8] - b _08071A4A - .align 2, 0 -_08071A40: .4byte 0x000003C7 -_08071A44: - adds r0, r2, #0 - bl UpdateAnimationSingleFrame -_08071A4A: - pop {r4, pc} - - thumb_func_start sub_08071A4C -sub_08071A4C: @ 0x08071A4C - push {r4, lr} - adds r4, r0, #0 - bl UpdateAnimationSingleFrame - adds r4, #0x5a - ldrb r1, [r4] - movs r0, #0x80 - ands r0, r1 - cmp r0, #0 - beq _08071A68 - bl sub_08071A6C - bl sub_0807921C -_08071A68: - pop {r4, pc} - .align 2, 0 - - thumb_func_start sub_08071A6C -sub_08071A6C: @ 0x08071A6C - ldr r1, _08071A84 @ =gUnk_03003DC0 - movs r0, #0 - strb r0, [r1] - ldr r3, _08071A88 @ =gPlayerEntity - ldrb r1, [r3, #0x11] - lsrs r2, r1, #4 - subs r0, #0x10 - ands r0, r1 - orrs r0, r2 - strb r0, [r3, #0x11] - bx lr - .align 2, 0 -_08071A84: .4byte gUnk_03003DC0 -_08071A88: .4byte gPlayerEntity - - thumb_func_start sub_08071A8C -sub_08071A8C: @ 0x08071A8C - push {lr} - ldr r1, _08071AA8 @ =gPlayerState - adds r1, #0xa8 - movs r2, #0x19 - strb r2, [r1] - ldr r2, _08071AAC @ =gUnk_0811BAE4 - ldrb r1, [r0, #0xd] - lsls r1, r1, #2 - adds r1, r1, r2 - ldr r1, [r1] - bl _call_via_r1 - pop {pc} - .align 2, 0 -_08071AA8: .4byte gPlayerState -_08071AAC: .4byte gUnk_0811BAE4 - - thumb_func_start sub_08071AB0 -sub_08071AB0: @ 0x08071AB0 - push {r4, lr} - adds r3, r0, #0 - ldrb r0, [r3, #0xd] - adds r0, #1 - strb r0, [r3, #0xd] - ldr r1, _08071AD8 @ =gPlayerState - ldr r2, [r1, #0x30] - movs r0, #1 - orrs r2, r0 - str r2, [r1, #0x30] - ldrb r4, [r3, #0xa] - cmp r4, #1 - bne _08071ADC - movs r1, #0 - movs r0, #0 - strh r0, [r3, #0x24] - strb r1, [r3, #0xe] - strb r4, [r3, #0xf] - b _08071AE8 - .align 2, 0 -_08071AD8: .4byte gPlayerState -_08071ADC: - movs r0, #0x80 - ands r2, r0 - cmp r2, #0 - beq _08071AE6 - movs r0, #0x40 -_08071AE6: - strh r0, [r3, #0x24] -_08071AE8: - adds r0, r3, #0 - bl sub_08071AF0 - pop {r4, pc} - - thumb_func_start sub_08071AF0 -sub_08071AF0: @ 0x08071AF0 - push {r4, r5, lr} - adds r4, r0, #0 - ldr r5, _08071B34 @ =gPlayerState - adds r0, r5, #0 - adds r0, #0x80 - movs r1, #0 - strh r1, [r0] - adds r0, r4, #0 - bl UpdateAnimationSingleFrame - ldrb r0, [r4, #0xa] - cmp r0, #1 - bne _08071B44 - ldrb r0, [r4, #0xf] - subs r0, #1 - strb r0, [r4, #0xf] - lsls r0, r0, #0x18 - cmp r0, #0 - bne _08071B58 - ldr r0, _08071B38 @ =gUnk_0811BAF0 - ldrb r1, [r4, #0xe] - lsls r1, r1, #2 - adds r1, r1, r0 - ldrb r2, [r1] - adds r0, r2, #0 - cmp r0, #0xff - beq _08071B3C - strb r2, [r4, #0xf] - ldrh r0, [r1, #2] - strh r0, [r4, #0x24] - ldrb r0, [r4, #0xe] - adds r0, #1 - strb r0, [r4, #0xe] - b _08071B58 - .align 2, 0 -_08071B34: .4byte gPlayerState -_08071B38: .4byte gUnk_0811BAF0 -_08071B3C: - ldrb r0, [r4, #0xd] - adds r0, #1 - strb r0, [r4, #0xd] - b _08071B5C -_08071B44: - ldrb r0, [r5, #6] - subs r0, #1 - strb r0, [r5, #6] - movs r1, #0x7f - ands r0, r1 - cmp r0, #0 - bne _08071B58 - ldrb r0, [r4, #0xd] - adds r0, #1 - strb r0, [r4, #0xd] -_08071B58: - bl sub_08079E08 -_08071B5C: - pop {r4, r5, pc} - .align 2, 0 - - thumb_func_start sub_08071B60 -sub_08071B60: @ 0x08071B60 - push {r4, r5, lr} - adds r4, r0, #0 - ldr r5, _08071BAC @ =gPlayerState - movs r2, #0 - movs r0, #2 - strb r0, [r5, #6] - ldr r0, [r5, #0x30] - movs r1, #2 - rsbs r1, r1, #0 - ands r0, r1 - str r0, [r5, #0x30] - strb r2, [r4, #0xa] - adds r0, r4, #0 - adds r0, #0x42 - strb r2, [r0] - adds r0, r4, #0 - bl sub_080728AC - movs r0, #6 - strb r0, [r4, #0xf] - ldr r0, [r5, #0x30] - movs r1, #0x80 - ands r0, r1 - cmp r0, #0 - bne _08071BA8 - movs r0, #0x82 - lsls r0, r0, #1 - strh r0, [r5, #8] - movs r0, #3 - strh r0, [r4, #0x12] - ldrb r1, [r4, #0x14] - lsrs r1, r1, #1 - adds r1, #0x3c - adds r0, r4, #0 - bl InitAnimationForceUpdate -_08071BA8: - pop {r4, r5, pc} - .align 2, 0 -_08071BAC: .4byte gPlayerState - - thumb_func_start sub_08071BB0 -sub_08071BB0: @ 0x08071BB0 - push {lr} - ldrb r2, [r0, #0x10] - movs r1, #0x7f - ands r1, r2 - strb r1, [r0, #0x10] - ldr r2, _08071BD4 @ =gUnk_0811BB2C - ldrb r1, [r0, #0xd] - lsls r1, r1, #2 - adds r1, r1, r2 - ldr r1, [r1] - bl _call_via_r1 - ldr r0, _08071BD8 @ =gPlayerState - adds r0, #0xa8 - movs r1, #0x12 - strb r1, [r0] - pop {pc} - .align 2, 0 -_08071BD4: .4byte gUnk_0811BB2C -_08071BD8: .4byte gPlayerState - - thumb_func_start sub_08071BDC -sub_08071BDC: @ 0x08071BDC - push {r4, r5, lr} - adds r4, r0, #0 - ldr r5, _08071C10 @ =gPlayerState - ldr r0, [r5, #0x30] - movs r1, #0x88 - lsls r1, r1, #1 - ands r0, r1 - cmp r0, #0 - bne _08071C9C - movs r1, #0x80 - lsls r1, r1, #6 - adds r0, r4, #0 - bl sub_08003FC4 - cmp r0, #0 - beq _08071C1C - ldr r0, [r5, #0x30] - movs r1, #8 - ands r0, r1 - cmp r0, #0 - beq _08071C14 - movs r0, #0x84 - lsls r0, r0, #3 - strh r0, [r5, #8] - b _08071C9C - .align 2, 0 -_08071C10: .4byte gPlayerState -_08071C14: - movs r0, #0x81 - lsls r0, r0, #4 - strh r0, [r5, #8] - b _08071C9C -_08071C1C: - strb r0, [r5, #0xc] - ldr r1, [r5, #0x30] - movs r0, #0x80 - ands r0, r1 - cmp r0, #0 - beq _08071C4C - ldrb r0, [r5, #0x12] - subs r0, #8 - lsls r0, r0, #0x18 - lsrs r0, r0, #0x18 - cmp r0, #2 - bhi _08071C42 - adds r0, r4, #0 - bl sub_0807A298 - bl sub_08079458 - movs r0, #0xa - strb r0, [r4, #0xc] -_08071C42: - ldr r0, _08071C48 @ =0x00000C1A - b _08071C5A - .align 2, 0 -_08071C48: .4byte 0x00000C1A -_08071C4C: - movs r0, #8 - ands r1, r0 - movs r0, #0xde - lsls r0, r0, #1 - cmp r1, #0 - beq _08071C5A - ldr r0, _08071CA0 @ =0x00000459 -_08071C5A: - ldr r2, _08071CA4 @ =gPlayerState - movs r3, #0 - strh r0, [r2, #8] - ldr r0, [r2, #0x30] - ldr r1, _08071CA8 @ =0xFEDBF2FE - ands r0, r1 - str r0, [r2, #0x30] - movs r0, #1 - strb r0, [r4, #0xd] - movs r0, #4 - strb r0, [r4, #0x14] - adds r5, r4, #0 - adds r5, #0x29 - ldrb r1, [r5] - subs r0, #0x3d - ands r0, r1 - movs r1, #8 - orrs r0, r1 - strb r0, [r5] - ldrb r0, [r4, #0x18] - movs r1, #3 - orrs r0, r1 - strb r0, [r4, #0x18] - strb r3, [r2, #2] - strb r3, [r2, #6] - adds r0, r4, #0 - bl sub_0800451C - bl ResetPlayer - movs r0, #0x87 - bl SoundReq -_08071C9C: - pop {r4, r5, pc} - .align 2, 0 -_08071CA0: .4byte 0x00000459 -_08071CA4: .4byte gPlayerState -_08071CA8: .4byte 0xFEDBF2FE - - thumb_func_start sub_08071CAC -sub_08071CAC: @ 0x08071CAC - push {r4, lr} - adds r4, r0, #0 - bl UpdateAnimationSingleFrame - adds r0, r4, #0 - adds r0, #0x5a - ldrb r1, [r0] - movs r3, #0x80 - adds r0, r3, #0 - ands r0, r1 - cmp r0, #0 - beq _08071CFE - ldr r1, _08071CE0 @ =gPlayerState - ldr r2, [r1, #0x30] - adds r0, r2, #0 - ands r0, r3 - cmp r0, #0 - bne _08071CEC - movs r0, #8 - ands r2, r0 - ldr r0, _08071CE4 @ =0x000002BD - cmp r2, #0 - beq _08071CEE - ldr r0, _08071CE8 @ =0x0000045A - b _08071CEE - .align 2, 0 -_08071CE0: .4byte gPlayerState -_08071CE4: .4byte 0x000002BD -_08071CE8: .4byte 0x0000045A -_08071CEC: - ldr r0, _08071D00 @ =0x00000C1B -_08071CEE: - strh r0, [r1, #8] - movs r0, #2 - strb r0, [r4, #0xd] - movs r0, #0xf0 - strb r0, [r4, #0xe] - movs r0, #0x7b - bl SoundReq -_08071CFE: - pop {r4, pc} - .align 2, 0 -_08071D00: .4byte 0x00000C1B - - thumb_func_start sub_08071D04 -sub_08071D04: @ 0x08071D04 - push {r4, r5, lr} - adds r5, r0, #0 - bl UpdateAnimationSingleFrame - adds r0, r5, #0 - adds r0, #0x5a - ldrb r0, [r0] - cmp r0, #0 - beq _08071D7A - movs r4, #0 - movs r0, #0x28 - bl sub_080544DC - adds r1, r0, #0 - cmp r1, #0 - beq _08071D3A - ldr r0, _08071D6C @ =gSave - adds r0, r0, r1 - adds r0, #0xb5 - movs r1, #0x20 - strb r1, [r0] - movs r0, #0x40 - movs r1, #0x60 - movs r2, #2 - bl CreateObject - movs r4, #0x20 -_08071D3A: - cmp r4, #0 - beq _08071D74 - adds r0, r4, #0 - bl ModHealth - movs r2, #0 - movs r0, #3 - strb r0, [r5, #0xd] - ldr r1, _08071D70 @ =gPlayerState - adds r0, r1, #0 - adds r0, #0x3c - strb r2, [r0] - movs r0, #0xff - strb r0, [r5, #0x15] - movs r3, #0 - strh r2, [r5, #0x24] - movs r0, #0xc0 - lsls r0, r0, #9 - str r0, [r5, #0x20] - movs r0, #1 - strb r0, [r1, #2] - adds r1, #0x26 - strb r3, [r1] - b _08071D7A - .align 2, 0 -_08071D6C: .4byte gSave -_08071D70: .4byte gPlayerState -_08071D74: - ldr r1, _08071D7C @ =gScreenTransition - movs r0, #1 - strb r0, [r1, #5] -_08071D7A: - pop {r4, r5, pc} - .align 2, 0 -_08071D7C: .4byte gScreenTransition - - thumb_func_start sub_08071D80 -sub_08071D80: @ 0x08071D80 - push {r4, r5, lr} - adds r4, r0, #0 - bl UpdateAnimationSingleFrame - ldr r5, _08071DB4 @ =gPlayerState - movs r0, #1 - strb r0, [r5, #0x14] - adds r0, r4, #0 - bl sub_08073904 - ldrb r1, [r5, #2] - movs r0, #7 - ands r0, r1 - cmp r0, #3 - bne _08071DB2 - movs r0, #0 - strb r0, [r5, #2] - adds r1, r4, #0 - adds r1, #0x3d - movs r0, #0xe2 - strb r0, [r1] - bl UnfreezeTime - bl sub_080791D0 -_08071DB2: - pop {r4, r5, pc} - .align 2, 0 -_08071DB4: .4byte gPlayerState - - thumb_func_start sub_08071DB8 -sub_08071DB8: @ 0x08071DB8 - push {lr} - ldr r2, _08071DCC @ =gUnk_0811BB3C - ldrb r1, [r0, #0xd] - lsls r1, r1, #2 - adds r1, r1, r2 - ldr r1, [r1] - bl _call_via_r1 - pop {pc} - .align 2, 0 -_08071DCC: .4byte gUnk_0811BB3C - - thumb_func_start sub_08071DD0 -sub_08071DD0: @ 0x08071DD0 - push {lr} - adds r2, r0, #0 - ldr r1, _08071DF4 @ =gPlayerState - adds r0, r1, #0 - adds r0, #0x38 - ldrb r0, [r0] - strb r0, [r2, #0xe] - adds r3, r1, #0 - adds r3, #0x39 - ldrb r0, [r3] - cmp r0, #0 - beq _08071DF8 - movs r0, #0 - strb r0, [r3] - movs r0, #2 - strb r0, [r2, #0xd] - adds r0, #0xfe - b _08071E00 - .align 2, 0 -_08071DF4: .4byte gPlayerState -_08071DF8: - movs r0, #1 - strb r0, [r2, #0xd] - movs r0, #0x8a - lsls r0, r0, #1 -_08071E00: - strh r0, [r1, #8] - pop {pc} - - thumb_func_start sub_08071E04 -sub_08071E04: @ 0x08071E04 - push {r4, r5, lr} - adds r4, r0, #0 - ldr r0, [r4, #0x34] - cmp r0, #0 - beq _08071E38 - ldr r5, _08071E34 @ =gPlayerState - ldrb r0, [r5, #0x14] - cmp r0, #0 - bne _08071E38 - bl sub_0807A1B8 - ldrb r0, [r5, #0x12] - cmp r0, #1 - bne _08071E38 - movs r0, #7 - strb r0, [r5, #0x11] - ldr r0, [r5, #0x30] - movs r1, #0x80 - lsls r1, r1, #2 - orrs r0, r1 - str r0, [r5, #0x30] - bl sub_080791BC - b _08071E72 - .align 2, 0 -_08071E34: .4byte gPlayerState -_08071E38: - adds r0, r4, #0 - bl UpdateAnimationSingleFrame - bl sub_08079B24 - cmp r0, #0 - bne _08071E4E - adds r0, r4, #0 - bl sub_08079708 - b _08071E72 -_08071E4E: - bl sub_080792D8 - bl sub_0807953C - cmp r0, #0 - beq _08071E60 - ldrb r0, [r4, #0xe] - subs r0, #2 - b _08071E64 -_08071E60: - ldrb r0, [r4, #0xe] - subs r0, #1 -_08071E64: - strb r0, [r4, #0xe] - movs r0, #0xe - ldrsb r0, [r4, r0] - cmp r0, #0 - bgt _08071E72 - bl sub_080791BC -_08071E72: - pop {r4, r5, pc} - - thumb_func_start sub_08071E74 -sub_08071E74: @ 0x08071E74 - push {r4, lr} - adds r4, r0, #0 - movs r1, #0x80 - lsls r1, r1, #6 - bl sub_08003FC4 - bl sub_08079E08 - ldrb r0, [r4, #0xe] - adds r1, r0, #0 - adds r1, #0xff - strb r1, [r4, #0xe] - lsls r0, r0, #0x18 - cmp r0, #0 - bne _08071E96 - bl sub_080791BC -_08071E96: - pop {r4, pc} - - thumb_func_start sub_08071E98 -sub_08071E98: @ 0x08071E98 + thumb_func_start PlayerEmptyBottle +PlayerEmptyBottle: @ 0x08071E98 push {lr} ldr r2, _08071EAC @ =gUnk_0811BB48 ldrb r1, [r0, #0xd] @@ -1403,8 +90,8 @@ _08071F32: .align 2, 0 _08071F34: .4byte gPlayerState - thumb_func_start sub_08071F38 -sub_08071F38: @ 0x08071F38 + thumb_func_start PlayerFrozen +PlayerFrozen: @ 0x08071F38 push {lr} ldr r2, _08071F4C @ =gUnk_0811BB50 ldrb r1, [r0, #0xd] @@ -1754,8 +441,8 @@ _080721DE: .align 2, 0 _080721E0: .4byte gPlayerState - thumb_func_start sub_080721E4 -sub_080721E4: @ 0x080721E4 + thumb_func_start PlayerPull +PlayerPull: @ 0x080721E4 push {lr} ldr r1, _08072208 @ =gPlayerState adds r1, #0xa8 @@ -1865,8 +552,8 @@ _080722B0: .align 2, 0 _080722B4: .4byte 0x00000944 - thumb_func_start sub_080722B8 -sub_080722B8: @ 0x080722B8 + thumb_func_start PlayerLava +PlayerLava: @ 0x080722B8 push {lr} ldr r1, _080722D4 @ =gPlayerState adds r1, #0xa8 @@ -2026,7 +713,7 @@ sub_080723D0: @ 0x080723D0 strb r0, [r1] subs r0, #0x16 bl ModHealth - bl sub_08079458 + bl RespawnPlayer _0807240A: pop {r4, pc} @@ -2059,7 +746,7 @@ sub_0807240C: @ 0x0807240C movs r0, #2 rsbs r0, r0, #0 bl ModHealth - bl sub_08079458 + bl RespawnPlayer _08072448: pop {pc} .align 2, 0 @@ -2125,8 +812,8 @@ _080724AE: _080724C2: pop {pc} - thumb_func_start sub_080724C4 -sub_080724C4: @ 0x080724C4 + thumb_func_start PlayerRoomTransition +PlayerRoomTransition: @ 0x080724C4 push {lr} ldr r2, _080724D8 @ =gUnk_0811BB88 ldrb r1, [r0, #0xd] @@ -2303,8 +990,8 @@ _08072620: _08072624: .4byte gPlayerState _08072628: .4byte gPlayerEntity - thumb_func_start sub_0807262C -sub_0807262C: @ 0x0807262C + thumb_func_start PlayerRoll +PlayerRoll: @ 0x0807262C push {lr} ldr r1, _08072648 @ =gPlayerState adds r1, #0xa8 @@ -2714,8 +1401,8 @@ _08072940: .4byte gPlayerState _08072944: .4byte gPlayerEntity _08072948: .4byte gRoomControls - thumb_func_start sub_0807294C -sub_0807294C: @ 0x0807294C + thumb_func_start PlayerInHole +PlayerInHole: @ 0x0807294C push {lr} ldr r1, _08072968 @ =gPlayerState adds r1, #0xa8 @@ -3776,8 +2463,8 @@ _080731A4: pop {r4, pc} .align 2, 0 - thumb_func_start sub_080731A8 -sub_080731A8: @ 0x080731A8 + thumb_func_start PlayerUseEntrance +PlayerUseEntrance: @ 0x080731A8 push {r4, lr} adds r4, r0, #0 ldr r0, _080731D0 @ =gPlayerState diff --git a/asm/code_080732D0.s b/asm/code_080732D0.s index 9ce6bf12..f2e7f6fa 100644 --- a/asm/code_080732D0.s +++ b/asm/code_080732D0.s @@ -175,8 +175,8 @@ _08073418: .align 2, 0 _0807341C: .4byte gRoomControls - thumb_func_start sub_08073420 -sub_08073420: @ 0x08073420 + thumb_func_start PlayerParachute +PlayerParachute: @ 0x08073420 push {r4, lr} adds r4, r0, #0 bl sub_08078EFC @@ -1280,8 +1280,8 @@ _08073C58: _08073C66: pop {pc} - thumb_func_start sub_08073C68 -sub_08073C68: @ 0x08073C68 + thumb_func_start PlayerMinish +PlayerMinish: @ 0x08073C68 push {lr} ldr r2, _08073C7C @ =gUnk_0811BC60 ldrb r1, [r0, #0xd] @@ -2760,7 +2760,7 @@ _0807476C: strb r0, [r1] subs r0, #0x24 bl ModHealth - bl sub_08079458 + bl RespawnPlayer _08074792: pop {r4, pc} .align 2, 0 @@ -3501,7 +3501,7 @@ sub_08074CF8: @ 0x08074CF8 adds r4, r5, #0 adds r4, #0x84 ldr r1, [r4] - bl ExecuteScriptCommandSet + bl ExecuteScript ldr r1, [r4] adds r0, r5, #0 bl sub_08074D34 @@ -3818,7 +3818,7 @@ sub_08074F2C: @ 0x08074F2C adds r5, r4, #0 adds r5, #0x84 ldr r1, [r5] - bl ExecuteScriptCommandSet + bl ExecuteScript ldr r1, [r5] adds r0, r4, #0 bl sub_08074D34 @@ -3874,7 +3874,7 @@ sub_08074F8C: @ 0x08074F8C bne _08074FAC movs r0, #0 strb r0, [r3] - ldr r2, _08074FDC @ =gUnk_02033280 + ldr r2, _08074FDC @ =gActiveScriptInfo ldr r0, [r2] movs r1, #4 orrs r0, r1 @@ -3904,7 +3904,7 @@ _08074FAC: lsls r0, r0, #3 b _08074FE8 .align 2, 0 -_08074FDC: .4byte gUnk_02033280 +_08074FDC: .4byte gActiveScriptInfo _08074FE0: .4byte gPlayerState _08074FE4: movs r0, #0x80 @@ -4198,7 +4198,7 @@ sub_080751E8: @ 0x080751E8 ldr r4, _08075230 @ =gPlayerScriptExecutionContext adds r0, r4, #0 movs r1, #0x24 - bl MemClear32 + bl MemClear str r6, [r4] ldr r0, _08075234 @ =gPlayerEntity adds r0, #0x84 @@ -4223,16 +4223,16 @@ sub_080751E8: @ 0x080751E8 cmp r7, #0 bne _08075240 strb r7, [r3] - ldr r6, _0807523C @ =gUnk_08009ECC + ldr r6, _0807523C @ =script_08009ECC b _08075244 .align 2, 0 _08075230: .4byte gPlayerScriptExecutionContext _08075234: .4byte gPlayerEntity _08075238: .4byte gPlayerState -_0807523C: .4byte gUnk_08009ECC +_0807523C: .4byte script_08009ECC _08075240: strb r4, [r3] - ldr r6, _08075290 @ =gUnk_08009EF0 + ldr r6, _08075290 @ =script_08009EF0 _08075244: ldr r0, _08075294 @ =gPlayerState adds r0, #0x39 @@ -4270,7 +4270,7 @@ _08075270: _0807528C: pop {r4, r5, r6, r7, pc} .align 2, 0 -_08075290: .4byte gUnk_08009EF0 +_08075290: .4byte script_08009EF0 _08075294: .4byte gPlayerState _08075298: .4byte gPlayerEntity @@ -4310,13 +4310,13 @@ _080752D0: cmp r0, #0 beq _080752E2 _080752DC: - ldr r1, _080752E4 @ =gUnk_02033280 + ldr r1, _080752E4 @ =gActiveScriptInfo movs r0, #0 strb r0, [r1, #6] _080752E2: pop {r4, r5, pc} .align 2, 0 -_080752E4: .4byte gUnk_02033280 +_080752E4: .4byte gActiveScriptInfo thumb_func_start sub_080752E8 sub_080752E8: @ 0x080752E8 @@ -4592,7 +4592,7 @@ _080754F2: movs r0, #8 movs r1, #0xf movs r2, #2 - bl FindEntityInListBySubtype + bl FindEntityByID cmp r0, #0 bne _08075538 adds r0, r4, #0 @@ -6017,7 +6017,7 @@ sub_08075FF8: @ 0x08075FF8 movs r0, #8 movs r1, #2 movs r2, #2 - bl FindEntityInListBySubtype + bl FindEntityByID b _08076026 .align 2, 0 _08076018: .4byte gPlayerState @@ -6025,7 +6025,7 @@ _0807601C: adds r5, #1 adds r0, r4, #0 movs r1, #2 - bl FindNextEntityOfSameSubtype + bl FindNextDuplicateID _08076026: adds r4, r0, #0 cmp r4, #0 diff --git a/asm/code_08077B98.s b/asm/code_08077B98.s index b6c78cf4..75eb2a4b 100644 --- a/asm/code_08077B98.s +++ b/asm/code_08077B98.s @@ -642,7 +642,7 @@ sub_080784C8: @ 0x080784C8 movs r1, #0xc4 lsls r1, r1, #1 adds r0, r4, #0 - bl MemClear32 + bl MemClear ldr r0, _080784E0 @ =gUnk_0811C000 str r0, [r4, #4] pop {r4, pc} diff --git a/asm/code_08078778.s b/asm/code_08078778.s index e1ddb07e..323f2c4f 100644 --- a/asm/code_08078778.s +++ b/asm/code_08078778.s @@ -44,7 +44,7 @@ _080788BA: movs r0, #6 movs r1, #9 movs r2, #6 - bl FindEntityInListBySubtype + bl FindEntityByID cmp r0, #0 bne _080788D6 movs r0, #9 @@ -70,7 +70,7 @@ sub_080788E0: @ 0x080788E0 ldr r1, _08078900 @ =gUnk_03003DF8 adds r0, r0, r1 movs r1, #0xc - bl MemClear32 + bl MemClear _080788FC: pop {pc} .align 2, 0 @@ -542,7 +542,7 @@ sub_08078C24: @ 0x08078C24 ldr r0, _08078CB0 @ =gUnk_03003DF0 movs r1, #0xc4 lsls r1, r1, #1 - bl MemClear32 + bl MemClear pop {pc} .align 2, 0 _08078CAC: .4byte gPlayerState @@ -866,7 +866,7 @@ sub_08078EFC: @ 0x08078EFC strb r2, [r0, #0xc] strb r1, [r0, #0xd] strb r1, [r3, #0xc] - bl sub_08070680 + bl DoPlayerAction movs r0, #1 b _08078F22 .align 2, 0 @@ -1583,8 +1583,8 @@ _08079454: _08079456: pop {r4, r5, pc} - thumb_func_start sub_08079458 -sub_08079458: @ 0x08079458 + thumb_func_start RespawnPlayer +RespawnPlayer: @ 0x08079458 push {r4, r5, lr} ldr r4, _08079498 @ =gPlayerEntity movs r1, #0 @@ -1915,7 +1915,7 @@ _080796C8: strb r1, [r0, #0x10] movs r1, #0x81 strb r1, [r4, #2] - bl sub_08070680 + bl DoPlayerAction movs r0, #1 b _080796FE .align 2, 0 @@ -2537,7 +2537,7 @@ sub_08079B24: @ 0x08079B24 ldrb r0, [r0] cmp r0, #0 beq _08079B6C - bl sub_08079458 + bl RespawnPlayer b _08079BC0 .align 2, 0 _08079B60: .4byte gPlayerEntity @@ -5401,8 +5401,8 @@ sub_0807B0C8: @ 0x0807B0C8 .align 2, 0 _0807B0F8: .4byte gPlayerEntity - thumb_func_start sub_0807B0FC -sub_0807B0FC: @ 0x0807B0FC + thumb_func_start PlayerWarp +PlayerWarp: @ 0x0807B0FC push {lr} ldr r2, _0807B110 @ =gUnk_0811C27C ldrb r1, [r0, #0xd] diff --git a/asm/code_0807B9B8.s b/asm/code_0807B9B8.s index 393c255c..59896509 100644 --- a/asm/code_0807B9B8.s +++ b/asm/code_0807B9B8.s @@ -948,19 +948,19 @@ sub_0807C0DC: @ 0x0807C0DC lsls r6, r6, #6 adds r0, r5, #0 adds r1, r6, #0 - bl MemClear32 + bl MemClear adds r0, r5, r6 movs r1, #0x80 lsls r1, r1, #5 - bl MemClear32 + bl MemClear ldr r0, _0807C160 @ =gUnk_02019EE0 movs r4, #0x80 lsls r4, r4, #8 adds r1, r4, #0 - bl MemClear32 + bl MemClear ldr r0, _0807C164 @ =gMapDataTopSpecial adds r1, r4, #0 - bl MemClear32 + bl MemClear ldr r0, _0807C168 @ =gArea ldr r1, _0807C16C @ =0x0000085C adds r0, r0, r1 @@ -999,7 +999,7 @@ _0807C174: .4byte 0x0000FFFF _0807C178: adds r0, r2, #4 adds r1, r6, #0 - bl MemClear32 + bl MemClear movs r3, #1 mov sb, r3 _0807C184: @@ -1167,7 +1167,7 @@ _0807C2E4: bl sub_0807C5F4 adds r0, r5, #0 adds r1, r6, #0 - bl MemClear32 + bl MemClear ldr r4, _0807C350 @ =gMapDataTopSpecial adds r5, r4, r6 adds r0, r4, #0 @@ -1179,7 +1179,7 @@ _0807C2E4: bl sub_0807C5F4 adds r0, r5, #0 adds r1, r6, #0 - bl MemClear32 + bl MemClear _0807C326: mov r1, sb cmp r1, #0 @@ -1406,10 +1406,10 @@ sub_0807C4F8: @ 0x0807C4F8 movs r4, #0x80 lsls r4, r4, #8 adds r1, r4, #0 - bl MemClear32 + bl MemClear ldr r0, _0807C59C @ =gMapDataTopSpecial adds r1, r4, #0 - bl MemClear32 + bl MemClear ldr r5, _0807C5A0 @ =gUnk_02022830 ldr r0, _0807C5A4 @ =gArea ldr r1, _0807C5A8 @ =0x0000085C @@ -1455,7 +1455,7 @@ _0807C54A: bl sub_0807C5F4 adds r0, r5, #0 adds r1, r6, #0 - bl MemClear32 + bl MemClear ldr r4, _0807C59C @ =gMapDataTopSpecial adds r5, r4, r6 adds r0, r4, #0 @@ -1467,7 +1467,7 @@ _0807C54A: bl sub_0807C5F4 adds r0, r5, #0 adds r1, r6, #0 - bl MemClear32 + bl MemClear _0807C592: pop {r4, r5, r6, pc} .align 2, 0 @@ -1694,7 +1694,7 @@ _0807C710: _0807C726: adds r0, r4, #0 movs r1, #0x40 - bl MemClear32 + bl MemClear adds r4, #0x40 adds r5, #1 cmp r5, r7 @@ -1984,7 +1984,7 @@ _0807C92E: _0807C946: adds r0, r4, #0 movs r1, #0x80 - bl MemClear32 + bl MemClear adds r4, #0x80 adds r5, #1 cmp r5, r6 diff --git a/asm/code_0807F0D8.s b/asm/code_0807F0D8.s index 11f24fbc..22e915bf 100644 --- a/asm/code_0807F0D8.s +++ b/asm/code_0807F0D8.s @@ -125,7 +125,7 @@ sub_0807F1A0: @ 0x0807F1A0 movs r4, #0x32 ldrsh r3, [r3, r4] bl sub_0807DEDC - ldr r2, _0807F1C0 @ =gUnk_02033280 + ldr r2, _0807F1C0 @ =gActiveScriptInfo ldrb r1, [r2, #7] movs r0, #1 orrs r0, r1 @@ -133,7 +133,7 @@ sub_0807F1A0: @ 0x0807F1A0 pop {r4, pc} .align 2, 0 _0807F1BC: .4byte gPlayerEntity -_0807F1C0: .4byte gUnk_02033280 +_0807F1C0: .4byte gActiveScriptInfo thumb_func_start sub_0807F1C4 sub_0807F1C4: @ 0x0807F1C4 @@ -271,7 +271,7 @@ sub_0807F2A8: @ 0x0807F2A8 ldr r0, [r0] cmp r0, #0 bne _0807F2C8 - ldr r2, _0807F2C4 @ =gUnk_02033280 + ldr r2, _0807F2C4 @ =gActiveScriptInfo ldrb r1, [r2, #7] movs r0, #1 orrs r0, r1 @@ -279,15 +279,15 @@ sub_0807F2A8: @ 0x0807F2A8 b _0807F2CE .align 2, 0 _0807F2C0: .4byte gPlayerState -_0807F2C4: .4byte gUnk_02033280 +_0807F2C4: .4byte gActiveScriptInfo _0807F2C8: - ldr r1, _0807F2D0 @ =gUnk_02033280 + ldr r1, _0807F2D0 @ =gActiveScriptInfo movs r0, #0 strb r0, [r1, #6] _0807F2CE: pop {pc} .align 2, 0 -_0807F2D0: .4byte gUnk_02033280 +_0807F2D0: .4byte gActiveScriptInfo thumb_func_start sub_0807F2D4 sub_0807F2D4: @ 0x0807F2D4 @@ -300,21 +300,21 @@ sub_0807F2D4: @ 0x0807F2D4 lsrs r1, r0, #0x18 cmp r1, #0 beq _0807F2F8 - ldr r2, _0807F2F4 @ =gUnk_02033280 + ldr r2, _0807F2F4 @ =gActiveScriptInfo ldrb r1, [r2, #7] movs r0, #1 orrs r0, r1 strb r0, [r2, #7] b _0807F2FC .align 2, 0 -_0807F2F4: .4byte gUnk_02033280 +_0807F2F4: .4byte gActiveScriptInfo _0807F2F8: - ldr r0, _0807F300 @ =gUnk_02033280 + ldr r0, _0807F300 @ =gActiveScriptInfo strb r1, [r0, #6] _0807F2FC: pop {pc} .align 2, 0 -_0807F300: .4byte gUnk_02033280 +_0807F300: .4byte gActiveScriptInfo thumb_func_start sub_0807F304 sub_0807F304: @ 0x0807F304 @@ -328,7 +328,7 @@ sub_0807F304: @ 0x0807F304 lsrs r1, r0, #0x18 cmp r1, #0 beq _0807F32C - ldr r2, _0807F328 @ =gUnk_02033280 + ldr r2, _0807F328 @ =gActiveScriptInfo ldrb r1, [r2, #7] movs r0, #1 orrs r0, r1 @@ -336,14 +336,14 @@ sub_0807F304: @ 0x0807F304 b _0807F330 .align 2, 0 _0807F324: .4byte gPlayerEntity -_0807F328: .4byte gUnk_02033280 +_0807F328: .4byte gActiveScriptInfo _0807F32C: - ldr r0, _0807F334 @ =gUnk_02033280 + ldr r0, _0807F334 @ =gActiveScriptInfo strb r1, [r0, #6] _0807F330: pop {pc} .align 2, 0 -_0807F334: .4byte gUnk_02033280 +_0807F334: .4byte gActiveScriptInfo thumb_func_start sub_0807F338 sub_0807F338: @ 0x0807F338 @@ -509,14 +509,14 @@ _0807F44C: strb r0, [r3] str r2, [r1, #4] _0807F452: - ldr r2, _0807F460 @ =gUnk_02033280 + ldr r2, _0807F460 @ =gActiveScriptInfo ldrb r1, [r2, #7] movs r0, #1 orrs r0, r1 strb r0, [r2, #7] pop {pc} .align 2, 0 -_0807F460: .4byte gUnk_02033280 +_0807F460: .4byte gActiveScriptInfo thumb_func_start sub_0807F464 sub_0807F464: @ 0x0807F464 @@ -589,13 +589,13 @@ _0807F4BC: strh r0, [r4, #0x2e] b _0807F4F0 _0807F4EA: - ldr r1, _0807F4F4 @ =gUnk_02033280 + ldr r1, _0807F4F4 @ =gActiveScriptInfo movs r0, #0 strb r0, [r1, #6] _0807F4F0: pop {r4, r5, r6, pc} .align 2, 0 -_0807F4F4: .4byte gUnk_02033280 +_0807F4F4: .4byte gActiveScriptInfo thumb_func_start sub_0807F4F8 sub_0807F4F8: @ 0x0807F4F8 @@ -665,13 +665,13 @@ _0807F548: strh r0, [r4, #0x32] b _0807F57C _0807F576: - ldr r1, _0807F580 @ =gUnk_02033280 + ldr r1, _0807F580 @ =gActiveScriptInfo movs r0, #0 strb r0, [r1, #6] _0807F57C: pop {r4, r5, pc} .align 2, 0 -_0807F580: .4byte gUnk_02033280 +_0807F580: .4byte gActiveScriptInfo thumb_func_start sub_0807F584 sub_0807F584: @ 0x0807F584 @@ -691,14 +691,14 @@ sub_0807F594: @ 0x0807F594 ldrb r0, [r0] cmp r0, #0 beq _0807F5A6 - ldr r1, _0807F5AC @ =gUnk_02033280 + ldr r1, _0807F5AC @ =gActiveScriptInfo movs r0, #0 strb r0, [r1, #6] _0807F5A6: pop {pc} .align 2, 0 _0807F5A8: .4byte gPlayerState -_0807F5AC: .4byte gUnk_02033280 +_0807F5AC: .4byte gActiveScriptInfo thumb_func_start sub_0807F5B0 sub_0807F5B0: @ 0x0807F5B0 @@ -757,7 +757,7 @@ _0807F602: ldrsh r0, [r4, r2] cmp r3, r0 bne _0807F628 - ldr r2, _0807F624 @ =gUnk_02033280 + ldr r2, _0807F624 @ =gActiveScriptInfo ldrb r1, [r2, #7] movs r0, #1 orrs r0, r1 @@ -765,15 +765,15 @@ _0807F602: b _0807F62E .align 2, 0 _0807F620: .4byte gRoomControls -_0807F624: .4byte gUnk_02033280 +_0807F624: .4byte gActiveScriptInfo _0807F628: - ldr r1, _0807F630 @ =gUnk_02033280 + ldr r1, _0807F630 @ =gActiveScriptInfo movs r0, #0 strb r0, [r1, #6] _0807F62E: pop {r4, pc} .align 2, 0 -_0807F630: .4byte gUnk_02033280 +_0807F630: .4byte gActiveScriptInfo thumb_func_start sub_0807F634 sub_0807F634: @ 0x0807F634 @@ -831,7 +831,7 @@ sub_0807F680: @ 0x0807F680 movs r3, #1 _0807F69A: str r3, [r2, #0x14] - ldr r2, _0807F6B0 @ =gUnk_02033280 + ldr r2, _0807F6B0 @ =gActiveScriptInfo ldrb r1, [r2, #7] movs r0, #1 orrs r0, r1 @@ -840,7 +840,7 @@ _0807F69A: .align 2, 0 _0807F6A8: .4byte gPlayerEntity _0807F6AC: .4byte gRoomControls -_0807F6B0: .4byte gUnk_02033280 +_0807F6B0: .4byte gActiveScriptInfo thumb_func_start sub_0807F6B4 sub_0807F6B4: @ 0x0807F6B4 @@ -859,7 +859,7 @@ sub_0807F6B4: @ 0x0807F6B4 movs r3, #1 _0807F6CE: str r3, [r2, #0x14] - ldr r2, _0807F6E4 @ =gUnk_02033280 + ldr r2, _0807F6E4 @ =gActiveScriptInfo ldrb r1, [r2, #7] movs r0, #1 orrs r0, r1 @@ -868,7 +868,7 @@ _0807F6CE: .align 2, 0 _0807F6DC: .4byte gPlayerEntity _0807F6E0: .4byte gRoomControls -_0807F6E4: .4byte gUnk_02033280 +_0807F6E4: .4byte gActiveScriptInfo thumb_func_start sub_0807F6E8 sub_0807F6E8: @ 0x0807F6E8 @@ -984,7 +984,7 @@ _0807F79A: bl GetSaleItemConfirmMessageID adds r4, r0, #0 adds r0, r5, #0 - bl sub_08053FE0 + bl GetItemPrice adds r5, r0, #0 adds r0, r4, #0 adds r1, r6, #0 @@ -1008,7 +1008,7 @@ sub_0807F7C4: @ 0x0807F7C4 ldr r0, _0807F7F4 @ =gRoomVars ldrb r0, [r0, #6] _0807F7D2: - bl sub_08053FE0 + bl GetItemPrice movs r2, #0 ldr r1, _0807F7F8 @ =gSave adds r1, #0xc0 @@ -1018,7 +1018,7 @@ _0807F7D2: movs r2, #1 _0807F7E4: str r2, [r4, #0x14] - ldr r2, _0807F7FC @ =gUnk_02033280 + ldr r2, _0807F7FC @ =gActiveScriptInfo ldrb r1, [r2, #7] movs r0, #1 orrs r0, r1 @@ -1027,7 +1027,7 @@ _0807F7E4: .align 2, 0 _0807F7F4: .4byte gRoomVars _0807F7F8: .4byte gSave -_0807F7FC: .4byte gUnk_02033280 +_0807F7FC: .4byte gActiveScriptInfo thumb_func_start sub_0807F800 sub_0807F800: @ 0x0807F800 @@ -1039,7 +1039,7 @@ sub_0807F800: @ 0x0807F800 ldrb r4, [r0, #6] _0807F80C: adds r0, r4, #0 - bl sub_08053FE0 + bl GetItemPrice rsbs r0, r0, #0 bl ModRupees adds r0, r4, #0 @@ -1049,7 +1049,7 @@ _0807F80C: ldr r1, _0807F834 @ =gRoomVars movs r0, #0 strb r0, [r1, #6] - ldr r2, _0807F838 @ =gUnk_02033280 + ldr r2, _0807F838 @ =gActiveScriptInfo ldrb r1, [r2, #7] movs r0, #1 orrs r0, r1 @@ -1057,7 +1057,7 @@ _0807F80C: pop {r4, pc} .align 2, 0 _0807F834: .4byte gRoomVars -_0807F838: .4byte gUnk_02033280 +_0807F838: .4byte gActiveScriptInfo thumb_func_start sub_0807F83C sub_0807F83C: @ 0x0807F83C @@ -1144,14 +1144,14 @@ sub_0807F8D0: @ 0x0807F8D0 push {lr} ldr r1, [r1, #4] bl sub_08003FC4 - ldr r2, _0807F8E4 @ =gUnk_02033280 + ldr r2, _0807F8E4 @ =gActiveScriptInfo ldrb r1, [r2, #7] movs r0, #1 orrs r0, r1 strb r0, [r2, #7] pop {pc} .align 2, 0 -_0807F8E4: .4byte gUnk_02033280 +_0807F8E4: .4byte gActiveScriptInfo thumb_func_start sub_0807F8E8 sub_0807F8E8: @ 0x0807F8E8 @@ -1228,7 +1228,7 @@ sub_0807F950: @ 0x0807F950 movs r1, #0x56 movs r2, #6 movs r3, #0 - bl FindEntityInListByForm + bl FindEntity cmp r0, #0 beq _0807F96C bl DeleteEntity @@ -1314,14 +1314,14 @@ _0807F9C4: @ jump table .4byte _0807FA24 @ case 22 .4byte _0807FA24 @ case 23 _0807FA24: - ldr r1, _0807FA2C @ =gUnk_02033280 + ldr r1, _0807FA2C @ =gActiveScriptInfo movs r0, #0 strb r0, [r1, #6] b _0807FA3A .align 2, 0 -_0807FA2C: .4byte gUnk_02033280 +_0807FA2C: .4byte gActiveScriptInfo _0807FA30: - ldr r2, _0807FA3C @ =gUnk_02033280 + ldr r2, _0807FA3C @ =gActiveScriptInfo ldrb r1, [r2, #7] movs r0, #1 orrs r0, r1 @@ -1329,7 +1329,7 @@ _0807FA30: _0807FA3A: pop {pc} .align 2, 0 -_0807FA3C: .4byte gUnk_02033280 +_0807FA3C: .4byte gActiveScriptInfo thumb_func_start sub_0807FA40 sub_0807FA40: @ 0x0807FA40 @@ -1374,14 +1374,14 @@ _0807FA60: @ jump table .4byte _0807FAC0 @ case 22 .4byte _0807FAC0 @ case 23 _0807FAC0: - ldr r1, _0807FAC8 @ =gUnk_02033280 + ldr r1, _0807FAC8 @ =gActiveScriptInfo movs r0, #0 strb r0, [r1, #6] b _0807FAD6 .align 2, 0 -_0807FAC8: .4byte gUnk_02033280 +_0807FAC8: .4byte gActiveScriptInfo _0807FACC: - ldr r2, _0807FAD8 @ =gUnk_02033280 + ldr r2, _0807FAD8 @ =gActiveScriptInfo ldrb r1, [r2, #7] movs r0, #1 orrs r0, r1 @@ -1389,7 +1389,7 @@ _0807FACC: _0807FAD6: pop {pc} .align 2, 0 -_0807FAD8: .4byte gUnk_02033280 +_0807FAD8: .4byte gActiveScriptInfo thumb_func_start sub_0807FADC sub_0807FADC: @ 0x0807FADC @@ -1427,13 +1427,13 @@ _0807FB16: bl sub_0808C688 b _0807FB22 _0807FB1C: - ldr r1, _0807FB24 @ =gUnk_02033280 + ldr r1, _0807FB24 @ =gActiveScriptInfo movs r0, #0 strb r0, [r1, #6] _0807FB22: pop {r4, pc} .align 2, 0 -_0807FB24: .4byte gUnk_02033280 +_0807FB24: .4byte gActiveScriptInfo thumb_func_start sub_0807FB28 sub_0807FB28: @ 0x0807FB28 @@ -1460,13 +1460,13 @@ _0807FB3A: .align 2, 0 _0807FB54: .4byte 0x00007FFF _0807FB58: - ldr r1, _0807FB60 @ =gUnk_02033280 + ldr r1, _0807FB60 @ =gActiveScriptInfo movs r0, #0 strb r0, [r1, #6] _0807FB5E: pop {r4, pc} .align 2, 0 -_0807FB60: .4byte gUnk_02033280 +_0807FB60: .4byte gActiveScriptInfo thumb_func_start sub_0807FB64 sub_0807FB64: @ 0x0807FB64 @@ -1552,13 +1552,13 @@ sub_0807FBD4: @ 0x0807FBD4 bl sub_080040A8 cmp r0, #0 beq _0807FBF4 - ldr r1, _0807FBF8 @ =gUnk_02033280 + ldr r1, _0807FBF8 @ =gActiveScriptInfo movs r0, #0 strb r0, [r1, #6] _0807FBF4: pop {r4, pc} .align 2, 0 -_0807FBF8: .4byte gUnk_02033280 +_0807FBF8: .4byte gActiveScriptInfo thumb_func_start sub_0807FBFC sub_0807FBFC: @ 0x0807FBFC @@ -2934,11 +2934,11 @@ sub_08080668: @ 0x08080668 ldr r5, _080806A4 @ =gRoomControls adds r0, r5, #0 movs r1, #0x38 - bl MemClear32 + bl MemClear ldr r4, _080806A8 @ =gUnk_03004030 adds r0, r4, #0 movs r1, #0xc - bl MemClear32 + bl MemClear ldr r0, _080806AC @ =0x0000FFFF strh r0, [r5, #0x22] movs r0, #0xff @@ -2950,10 +2950,10 @@ sub_08080668: @ 0x08080668 movs r4, #0x80 lsls r4, r4, #8 adds r1, r4, #0 - bl MemClear32 + bl MemClear ldr r0, _080806B8 @ =gMapDataTopSpecial adds r1, r4, #0 - bl MemClear32 + bl MemClear pop {r4, r5, pc} .align 2, 0 _080806A4: .4byte gRoomControls diff --git a/asm/code_080A29BC.s b/asm/code_080A29BC.s index e5f4bf59..c0b7228f 100644 --- a/asm/code_080A29BC.s +++ b/asm/code_080A29BC.s @@ -96,13 +96,13 @@ sub_080A2AF4: @ 0x080A2AF4 lsls r4, r4, #0x18 asrs r4, r4, #0x10 adds r1, r4, #0 - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #0x10 asrs r0, r0, #0x10 movs r5, #0x80 lsls r5, r5, #1 adds r1, r5, #0 - bl sub_0806FA04 + bl FixedDiv lsls r0, r0, #0x10 asrs r0, r0, #8 ldr r1, [r6, #0x2c] @@ -115,11 +115,11 @@ sub_080A2AF4: @ 0x080A2AF4 movs r1, #0 ldrsh r0, [r0, r1] adds r1, r4, #0 - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #0x10 asrs r0, r0, #0x10 adds r1, r5, #0 - bl sub_0806FA04 + bl FixedDiv lsls r0, r0, #0x10 asrs r0, r0, #8 ldr r1, [r6, #0x30] @@ -995,7 +995,7 @@ sub_080A3210: @ 0x080A3210 ldr r4, _080A3230 @ =gUnk_02021EE0 adds r0, r4, #0 movs r1, #0x18 - bl MemClear32 + bl MemClear bl sub_080A35C8 movs r0, #0x80 lsls r0, r0, #1 diff --git a/asm/code_080A3480.s b/asm/code_080A3480.s index 9cf47673..879e0852 100644 --- a/asm/code_080A3480.s +++ b/asm/code_080A3480.s @@ -266,7 +266,7 @@ _080A365C: _080A365E: str r0, [r2, #0xc] movs r0, #0 - bl sub_0801DA90 + bl DispReset movs r0, #0xb bl LoadPaletteGroup movs r0, #0xc @@ -354,7 +354,7 @@ sub_080A36F8: @ 0x080A36F8 ldr r0, _080A3760 @ =gBG1Buffer movs r1, #0x80 lsls r1, r1, #4 - bl MemClear32 + bl MemClear ldr r1, _080A3764 @ =gScreen movs r2, #0 movs r0, #1 @@ -410,7 +410,7 @@ _080A378A: ldr r0, _080A37B8 @ =gBG1Buffer movs r1, #0x80 lsls r1, r1, #4 - bl MemClear32 + bl MemClear movs r1, #0x10 ldrsh r0, [r4, r1] ldr r2, _080A37BC @ =gUnk_081272E0 @@ -580,7 +580,7 @@ sub_080A38D0: @ 0x080A38D0 movs r6, #0x80 lsls r6, r6, #4 adds r1, r6, #0 - bl MemClear32 + bl MemClear ldr r4, _080A3924 @ =gScreen movs r0, #0 mov r8, r0 @@ -588,7 +588,7 @@ sub_080A38D0: @ 0x080A38D0 strh r5, [r4, #0x1a] ldr r0, _080A3928 @ =gBG2Buffer adds r1, r6, #0 - bl MemClear32 + bl MemClear strh r5, [r4, #0x26] adds r4, #0x68 movs r0, #0x80 @@ -699,7 +699,7 @@ _080A39C8: strh r0, [r2, #8] strb r4, [r2, #3] movs r0, #1 - bl sub_0801DA90 + bl DispReset bl sub_080A3210 bl sub_080A4D34 movs r0, #0xa @@ -712,7 +712,7 @@ _080A39C8: movs r0, #0xc0 lsls r0, r0, #0x13 movs r1, #0x20 - bl MemClear32 + bl MemClear movs r0, #0 movs r1, #0 bl sub_08052418 @@ -807,7 +807,7 @@ _080A3A9A: _080A3AB4: .4byte gMenu _080A3AB8: movs r0, #0 - bl sub_0807CDA4 + bl HandleSave adds r1, r0, #0 ldr r4, _080A3AD8 @ =gMenu strb r1, [r4] diff --git a/asm/code_080A3BD0.s b/asm/code_080A3BD0.s index 18beb360..08159cb0 100644 --- a/asm/code_080A3BD0.s +++ b/asm/code_080A3BD0.s @@ -935,7 +935,7 @@ sub_080A4398: @ 0x080A4398 push {lr} ldr r0, _080A43A4 @ =gUnk_02019EE0 movs r1, #0x40 - bl MemClear32 + bl MemClear pop {pc} .align 2, 0 _080A43A4: .4byte gUnk_02019EE0 @@ -1119,7 +1119,7 @@ sub_080A44E0: @ 0x080A44E0 mov r8, r0 ldr r0, [r4, #8] mov r1, r8 - bl MemClear32 + bl MemClear adds r0, r6, #0 adds r1, r4, #0 bl sub_0805F76C @@ -1269,11 +1269,11 @@ sub_080A4608: @ 0x080A4608 ldr r0, _080A46A4 @ =gBG0Buffer movs r1, #0x80 lsls r1, r1, #4 - bl MemClear32 + bl MemClear ldr r0, _080A46A8 @ =gBG3Buffer movs r1, #0x80 lsls r1, r1, #5 - bl MemClear32 + bl MemClear ldr r2, _080A46AC @ =gScreen adds r1, r2, #0 adds r1, #0x58 @@ -1976,7 +1976,7 @@ sub_080A4BA0: @ 0x080A4BA0 adds r6, r1, #0 add r0, sp, #0x18 movs r1, #0x30 - bl MemClear32 + bl MemClear ldr r0, _080A4C08 @ =gUnk_0812816C mov r1, sp movs r2, #0x18 @@ -2123,7 +2123,7 @@ sub_080A4CBC: @ 0x080A4CBC lsls r5, r5, #4 adds r0, r4, #0 adds r1, r5, #0 - bl MemClear32 + bl MemClear ldr r1, _080A4D14 @ =0x0600E000 adds r0, r4, #0 adds r2, r5, #0 @@ -2217,7 +2217,7 @@ sub_080A4D88: @ 0x080A4D88 push {lr} ldr r0, _080A4DA4 @ =gUnk_020344A0 movs r1, #8 - bl MemClear32 + bl MemClear movs r0, #1 movs r1, #0 bl MenuFadeIn @@ -2245,21 +2245,21 @@ sub_080A4DB8: @ 0x080A4DB8 movs r4, #0x80 lsls r4, r4, #4 adds r1, r4, #0 - bl MemClear32 + bl MemClear ldr r0, _080A4E5C @ =gBG1Buffer adds r1, r4, #0 - bl MemClear32 + bl MemClear ldr r0, _080A4E60 @ =gBG2Buffer adds r1, r4, #0 - bl MemClear32 + bl MemClear ldr r0, _080A4E64 @ =gUnk_0200AF34 movs r1, #0xc0 lsls r1, r1, #2 - bl MemClear32 + bl MemClear ldr r4, _080A4E68 @ =gMenu adds r0, r4, #0 movs r1, #0x30 - bl MemClear32 + bl MemClear ldr r0, _080A4E6C @ =0x0000FFFF strh r0, [r4, #0x2e] ldr r0, _080A4E70 @ =gUnk_02034490 @@ -2580,7 +2580,7 @@ _080A5080: ldr r0, _080A5098 @ =gBG0Buffer movs r1, #0x80 lsls r1, r1, #4 - bl MemClear32 + bl MemClear ldr r1, _080A509C @ =gScreen movs r0, #1 strh r0, [r1, #0xe] diff --git a/asm/code_080A5574.s b/asm/code_080A5574.s index 0700fdd6..05b47ec9 100644 --- a/asm/code_080A5574.s +++ b/asm/code_080A5574.s @@ -631,7 +631,7 @@ _080A5A52: sub_080A5A54: @ 0x080A5A54 push {lr} movs r0, #0 - bl sub_0807CDA4 + bl HandleSave adds r1, r0, #0 cmp r1, #0 beq _080A5A8A @@ -2442,7 +2442,7 @@ _080A6886: ldr r0, _080A68D0 @ =gUnk_02019EE0 movs r1, #0x80 lsls r1, r1, #3 - bl MemClear32 + bl MemClear pop {r4, r5, r6, r7, pc} .align 2, 0 _080A68AC: .4byte gUnk_02032EC0 @@ -3307,7 +3307,7 @@ sub_080A6F6C: @ 0x080A6F6C ldr r0, _080A6FA8 @ =gUnk_020350F0 movs r1, #0x80 lsls r1, r1, #1 - bl MemClear32 + bl MemClear movs r0, #0xff ands r0, r4 cmp r0, #0 @@ -3376,7 +3376,7 @@ _080A6FFA: ldr r0, _080A7038 @ =gUnk_020350F0 movs r1, #0x80 lsls r1, r1, #1 - bl MemClear32 + bl MemClear movs r0, #0xff ands r0, r4 cmp r0, #0 @@ -3413,7 +3413,7 @@ sub_080A7040: @ 0x080A7040 movs r1, #0xc0 lsls r1, r1, #2 adds r0, r4, #0 - bl MemClear32 + bl MemClear ldr r0, _080A7098 @ =0xFFFFFE00 adds r4, r4, r0 ldr r1, _080A709C @ =0x0600E000 @@ -3456,7 +3456,7 @@ sub_080A70AC: @ 0x080A70AC movs r1, #0xc0 lsls r1, r1, #2 adds r0, r4, #0 - bl MemClear32 + bl MemClear adds r2, r4, #0 subs r2, #0x34 movs r0, #0x7f @@ -3519,7 +3519,7 @@ sub_080A7124: @ 0x080A7124 ldr r0, _080A7134 @ =gUnk_02032EC0 movs r1, #0xed lsls r1, r1, #2 - bl MemClear32 + bl MemClear pop {pc} .align 2, 0 _080A7134: .4byte gUnk_02032EC0 @@ -3536,7 +3536,7 @@ MenuFadeIn: @ 0x080A7138 movs r1, #0xed lsls r1, r1, #2 adds r0, r4, #0 - bl MemClear32 + bl MemClear strb r5, [r4, #2] strb r6, [r4, #3] ldr r0, _080A7160 @ =gMain @@ -3709,7 +3709,7 @@ sub_080A7250: @ 0x080A7250 movs r2, #0x80 lsls r2, r2, #1 bl MemCopy - ldr r0, _080A7310 @ =gUnk_02033280 + ldr r0, _080A7310 @ =gActiveScriptInfo movs r2, #0xd5 lsls r2, r2, #2 adds r1, r4, r2 @@ -3750,7 +3750,7 @@ _080A7300: .4byte gUnk_02032F14 _080A7304: .4byte gUnk_02001A00 _080A7308: .4byte gRoomControls _080A730C: .4byte gUnk_03000420 -_080A7310: .4byte gUnk_02033280 +_080A7310: .4byte gActiveScriptInfo _080A7314: .4byte gScreenTransition _080A7318: .4byte gPlayerState _080A731C: .4byte gUnk_02017654 @@ -3767,22 +3767,22 @@ sub_080A7328: @ 0x080A7328 bl DeleteAllEntities ldr r0, _080A738C @ =gMenu movs r1, #0x30 - bl MemClear32 + bl MemClear ldr r0, _080A7390 @ =gRoomControls movs r1, #0x38 - bl MemClear32 + bl MemClear ldr r0, _080A7394 @ =gUnk_03000420 movs r1, #0x80 lsls r1, r1, #1 - bl MemClear32 - ldr r4, _080A7398 @ =gUnk_02033280 + bl MemClear + ldr r4, _080A7398 @ =gActiveScriptInfo adds r0, r4, #0 movs r1, #0xc - bl MemClear32 + bl MemClear movs r0, #8 strb r0, [r4, #8] movs r0, #1 - bl sub_0801DA90 + bl DispReset bl MessageInitialize bl sub_080ADD30 movs r0, #0 @@ -3803,7 +3803,7 @@ _080A7388: .4byte gFadeControl _080A738C: .4byte gMenu _080A7390: .4byte gRoomControls _080A7394: .4byte gUnk_03000420 -_080A7398: .4byte gUnk_02033280 +_080A7398: .4byte gActiveScriptInfo _080A739C: .4byte gUnk_02024490 _080A73A0: .4byte gUnk_02032EC0 _080A73A4: .4byte gScreenTransition @@ -3836,7 +3836,7 @@ _080A73B4: movs r1, #0xea lsls r1, r1, #2 adds r0, r5, r1 - ldr r1, _080A7480 @ =gUnk_02033280 + ldr r1, _080A7480 @ =gActiveScriptInfo movs r2, #0xc bl MemCopy movs r1, #0xaa @@ -3899,7 +3899,7 @@ _080A7470: .4byte gUnk_02032EC0 _080A7474: .4byte gPlayerState _080A7478: .4byte gUnk_02025EB0 _080A747C: .4byte gUnk_0200B650 -_080A7480: .4byte gUnk_02033280 +_080A7480: .4byte gActiveScriptInfo _080A7484: .4byte gUnk_03000420 _080A7488: .4byte gUnk_02001A00 _080A748C: .4byte gUnk_02024490 @@ -4943,7 +4943,7 @@ sub_080A7C7C: @ 0x080A7C7C push {lr} ldr r0, _080A7C88 @ =gUnk_02017660 movs r1, #0x40 - bl MemClear32 + bl MemClear pop {pc} .align 2, 0 _080A7C88: .4byte gUnk_02017660 diff --git a/asm/code_080AD90C.s b/asm/code_080AD90C.s index d08c7ef4..54509736 100644 --- a/asm/code_080AD90C.s +++ b/asm/code_080AD90C.s @@ -567,7 +567,7 @@ sub_080ADD30: @ 0x080ADD30 movs r1, #0x85 lsls r1, r1, #2 adds r0, r4, #0 - bl MemClear32 + bl MemClear movs r5, #0 adds r4, #4 movs r0, #0x10 @@ -718,7 +718,7 @@ _080ADE54: .4byte gUnk_02024494 _080ADE58: adds r0, r1, #0 movs r1, #0xc - bl MemClear32 + bl MemClear _080ADE60: adds r5, #0xc adds r4, #1 @@ -1084,7 +1084,7 @@ sub_080AE104: @ 0x080AE104 adds r1, r1, r5 lsls r1, r1, #2 adds r0, r4, #0 - bl MemClear32 + bl MemClear strb r5, [r4, #1] strh r6, [r4, #4] adds r0, r4, #0 @@ -1396,7 +1396,7 @@ _080AE350: stm r0!, {r2, r3, r7} adds r0, r6, #0 movs r1, #0xc - bl MemClear32 + bl MemClear adds r6, #0xc adds r5, #0xc movs r0, #0xc diff --git a/asm/code_080B1520.s b/asm/code_080B1520.s deleted file mode 100644 index 9ecbe88a..00000000 --- a/asm/code_080B1520.s +++ /dev/null @@ -1,551 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start sub_080B1520 -sub_080B1520: @ 0x080B1520 - push {lr} - lsls r0, r0, #0x10 - lsrs r0, r0, #0x10 - movs r2, #0 - cmp r0, #4 - bne _080B153C - ldr r1, _080B1534 @ =gUnk_02036A50 - ldr r0, _080B1538 @ =gUnk_08DE7D40 - str r0, [r1] - b _080B1558 - .align 2, 0 -_080B1534: .4byte gUnk_02036A50 -_080B1538: .4byte gUnk_08DE7D40 -_080B153C: - cmp r0, #0x40 - bne _080B1550 - ldr r1, _080B1548 @ =gUnk_02036A50 - ldr r0, _080B154C @ =gUnk_08DE7D4C - str r0, [r1] - b _080B1558 - .align 2, 0 -_080B1548: .4byte gUnk_02036A50 -_080B154C: .4byte gUnk_08DE7D4C -_080B1550: - ldr r1, _080B1560 @ =gUnk_02036A50 - ldr r0, _080B1564 @ =gUnk_08DE7D40 - str r0, [r1] - movs r2, #1 -_080B1558: - adds r0, r2, #0 - pop {r1} - bx r1 - .align 2, 0 -_080B1560: .4byte gUnk_02036A50 -_080B1564: .4byte gUnk_08DE7D40 - - thumb_func_start sub_080B1568 -sub_080B1568: @ 0x080B1568 - push {r4, r5, r6, lr} - lsls r2, r2, #0x10 - lsrs r2, r2, #0x10 - ldr r4, _080B15C8 @ =0x04000208 - ldrh r3, [r4] - adds r6, r3, #0 - movs r3, #0 - strh r3, [r4] - ldr r5, _080B15CC @ =0x04000204 - ldrh r4, [r5] - ldr r3, _080B15D0 @ =0x0000F8FF - ands r4, r3 - ldr r3, _080B15D4 @ =gUnk_02036A50 - ldr r3, [r3] - ldrh r3, [r3, #6] - orrs r4, r3 - strh r4, [r5] - ldr r3, _080B15D8 @ =0x040000D4 - str r0, [r3] - ldr r0, _080B15DC @ =0x040000D8 - str r1, [r0] - ldr r1, _080B15E0 @ =0x040000DC - movs r0, #0x80 - lsls r0, r0, #0x18 - orrs r2, r0 - str r2, [r1] - adds r1, #2 - movs r2, #0x80 - lsls r2, r2, #8 - adds r0, r2, #0 - ldrh r1, [r1] - ands r0, r1 - cmp r0, #0 - beq _080B15BC - ldr r2, _080B15E4 @ =0x040000DE - movs r0, #0x80 - lsls r0, r0, #8 - adds r1, r0, #0 -_080B15B4: - ldrh r0, [r2] - ands r0, r1 - cmp r0, #0 - bne _080B15B4 -_080B15BC: - ldr r0, _080B15C8 @ =0x04000208 - strh r6, [r0] - pop {r4, r5, r6} - pop {r0} - bx r0 - .align 2, 0 -_080B15C8: .4byte 0x04000208 -_080B15CC: .4byte 0x04000204 -_080B15D0: .4byte 0x0000F8FF -_080B15D4: .4byte gUnk_02036A50 -_080B15D8: .4byte 0x040000D4 -_080B15DC: .4byte 0x040000D8 -_080B15E0: .4byte 0x040000DC -_080B15E4: .4byte 0x040000DE - - thumb_func_start sub_080B15E8 -sub_080B15E8: @ 0x080B15E8 - push {r4, r5, r6, lr} - sub sp, #0x88 - adds r5, r1, #0 - lsls r0, r0, #0x10 - lsrs r3, r0, #0x10 - ldr r0, _080B1600 @ =gUnk_02036A50 - ldr r0, [r0] - ldrh r0, [r0, #4] - cmp r3, r0 - blo _080B1608 - ldr r0, _080B1604 @ =0x000080FF - b _080B168A - .align 2, 0 -_080B1600: .4byte gUnk_02036A50 -_080B1604: .4byte 0x000080FF -_080B1608: - ldr r0, _080B1694 @ =gUnk_02036A50 - adds r6, r0, #0 - ldr r0, [r0] - ldrb r1, [r0, #8] - lsls r0, r1, #1 - mov r4, sp - adds r2, r0, r4 - adds r2, #2 - movs r4, #0 - cmp r4, r1 - bhs _080B1632 -_080B161E: - strh r3, [r2] - subs r2, #2 - lsrs r3, r3, #1 - adds r0, r4, #1 - lsls r0, r0, #0x18 - lsrs r4, r0, #0x18 - ldr r0, [r6] - ldrb r0, [r0, #8] - cmp r4, r0 - blo _080B161E -_080B1632: - movs r0, #1 - strh r0, [r2] - subs r2, #2 - strh r0, [r2] - movs r4, #0xd0 - lsls r4, r4, #0x14 - ldr r0, _080B1694 @ =gUnk_02036A50 - ldr r0, [r0] - ldrb r2, [r0, #8] - adds r2, #3 - mov r0, sp - adds r1, r4, #0 - bl sub_080B1568 - adds r0, r4, #0 - mov r1, sp - movs r2, #0x44 - bl sub_080B1568 - add r2, sp, #8 - adds r5, #6 - movs r4, #0 - movs r6, #1 -_080B1660: - movs r1, #0 - movs r3, #0 -_080B1664: - lsls r1, r1, #0x11 - ldrh r0, [r2] - ands r0, r6 - lsrs r1, r1, #0x10 - orrs r1, r0 - adds r2, #2 - adds r0, r3, #1 - lsls r0, r0, #0x18 - lsrs r3, r0, #0x18 - cmp r3, #0xf - bls _080B1664 - strh r1, [r5] - subs r5, #2 - adds r0, r4, #1 - lsls r0, r0, #0x18 - lsrs r4, r0, #0x18 - cmp r4, #3 - bls _080B1660 - movs r0, #0 -_080B168A: - add sp, #0x88 - pop {r4, r5, r6} - pop {r1} - bx r1 - .align 2, 0 -_080B1694: .4byte gUnk_02036A50 - - thumb_func_start sub_080B1698 -sub_080B1698: @ 0x080B1698 - push {lr} - lsls r0, r0, #0x10 - lsrs r0, r0, #0x10 - movs r2, #1 - bl sub_080B16AC - lsls r0, r0, #0x10 - lsrs r0, r0, #0x10 - pop {r1} - bx r1 - - thumb_func_start sub_080B16AC -sub_080B16AC: @ 0x080B16AC - push {r4, r5, r6, r7, lr} - sub sp, #0xb0 - adds r5, r1, #0 - lsls r0, r0, #0x10 - lsrs r1, r0, #0x10 - lsls r2, r2, #0x18 - lsrs r7, r2, #0x18 - ldr r0, _080B16C8 @ =gUnk_02036A50 - ldr r0, [r0] - ldrh r0, [r0, #4] - cmp r1, r0 - blo _080B16D0 - ldr r0, _080B16CC @ =0x000080FF - b _080B1804 - .align 2, 0 -_080B16C8: .4byte gUnk_02036A50 -_080B16CC: .4byte 0x000080FF -_080B16D0: - ldr r0, _080B1710 @ =gUnk_02036A50 - ldr r0, [r0] - ldrb r0, [r0, #8] - lsls r0, r0, #1 - mov r2, sp - adds r3, r0, r2 - adds r3, #0x84 - movs r0, #0 - strh r0, [r3] - subs r3, #2 - movs r4, #0 -_080B16E6: - ldrh r2, [r5] - adds r5, #2 - movs r0, #0 -_080B16EC: - strh r2, [r3] - subs r3, #2 - lsrs r2, r2, #1 - adds r0, #1 - lsls r0, r0, #0x18 - lsrs r0, r0, #0x18 - cmp r0, #0xf - bls _080B16EC - adds r0, r4, #1 - lsls r0, r0, #0x18 - lsrs r4, r0, #0x18 - cmp r4, #3 - bls _080B16E6 - movs r4, #0 - ldr r0, _080B1710 @ =gUnk_02036A50 - adds r2, r0, #0 - ldr r0, [r0] - b _080B1722 - .align 2, 0 -_080B1710: .4byte gUnk_02036A50 -_080B1714: - strh r1, [r3] - subs r3, #2 - lsrs r1, r1, #1 - adds r0, r4, #1 - lsls r0, r0, #0x18 - lsrs r4, r0, #0x18 - ldr r0, [r2] -_080B1722: - ldrb r0, [r0, #8] - cmp r4, r0 - blo _080B1714 - movs r0, #0 - strh r0, [r3] - subs r3, #2 - movs r6, #1 - strh r6, [r3] - movs r4, #0xd0 - lsls r4, r4, #0x14 - ldr r0, _080B1794 @ =gUnk_02036A50 - ldr r0, [r0] - ldrb r2, [r0, #8] - adds r2, #0x43 - mov r0, sp - adds r1, r4, #0 - bl sub_080B1568 - movs r5, #0 - add r2, sp, #0xa4 - strh r5, [r2] - mov r1, sp - adds r1, #0xa6 - ldr r0, _080B1798 @ =0x04000006 - ldrh r0, [r0] - strh r0, [r1] - add r0, sp, #0xac - str r5, [r0] - ldrh r0, [r2] - cmp r0, #0 - bne _080B1768 - ldrh r0, [r4] - ands r0, r6 - cmp r0, #0 - bne _080B17F8 -_080B1768: - add r3, sp, #0xa8 - ldr r0, _080B1798 @ =0x04000006 - ldrh r0, [r0] - strh r0, [r3] - mov r4, sp - adds r4, #0xa6 - ldrh r1, [r3] - ldrh r0, [r4] - cmp r1, r0 - beq _080B17E2 - ldrh r1, [r3] - ldrh r0, [r4] - cmp r1, r0 - bls _080B179C - add r2, sp, #0xac - ldrh r1, [r3] - ldrh r0, [r4] - subs r1, r1, r0 - ldr r0, [r2] - adds r1, r1, r0 - str r1, [r2] - b _080B17B2 - .align 2, 0 -_080B1794: .4byte gUnk_02036A50 -_080B1798: .4byte 0x04000006 -_080B179C: - add r2, sp, #0xac - add r0, sp, #0xa8 - ldrh r0, [r0] - adds r0, #0xe4 - mov r1, sp - adds r1, #0xa6 - ldrh r1, [r1] - subs r0, r0, r1 - ldr r1, [r2] - adds r0, r0, r1 - str r0, [r2] -_080B17B2: - add r0, sp, #0xac - ldr r0, [r0] - cmp r0, #0x88 - bls _080B17D8 - add r0, sp, #0xa4 - ldrh r0, [r0] - cmp r0, #0 - bne _080B1802 - movs r0, #0xd0 - lsls r0, r0, #0x14 - ldrh r0, [r0] - movs r1, #1 - ands r0, r1 - cmp r0, #0 - bne _080B1802 - ldr r5, _080B17D4 @ =0x0000C001 - b _080B1802 - .align 2, 0 -_080B17D4: .4byte 0x0000C001 -_080B17D8: - mov r0, sp - adds r0, #0xa6 - add r1, sp, #0xa8 - ldrh r1, [r1] - strh r1, [r0] -_080B17E2: - add r2, sp, #0xa4 - ldrh r0, [r2] - cmp r0, #0 - bne _080B1768 - movs r0, #0xd0 - lsls r0, r0, #0x14 - movs r1, #1 - ldrh r0, [r0] - ands r1, r0 - cmp r1, #0 - beq _080B1768 -_080B17F8: - ldrh r0, [r2] - adds r0, #1 - strh r0, [r2] - cmp r7, #0 - bne _080B1768 -_080B1802: - adds r0, r5, #0 -_080B1804: - add sp, #0xb0 - pop {r4, r5, r6, r7} - pop {r1} - bx r1 - - thumb_func_start sub_080B180C -sub_080B180C: @ 0x080B180C - push {r4, r5, lr} - sub sp, #8 - adds r4, r1, #0 - lsls r0, r0, #0x10 - lsrs r1, r0, #0x10 - movs r5, #0 - ldr r0, _080B1828 @ =gUnk_02036A50 - ldr r0, [r0] - ldrh r0, [r0, #4] - cmp r1, r0 - blo _080B1830 - ldr r0, _080B182C @ =0x000080FF - b _080B185A - .align 2, 0 -_080B1828: .4byte gUnk_02036A50 -_080B182C: .4byte 0x000080FF -_080B1830: - adds r0, r1, #0 - mov r1, sp - bl sub_080B15E8 - mov r2, sp - movs r3, #0 - b _080B1848 -_080B183E: - adds r0, r3, #1 - lsls r0, r0, #0x18 - lsrs r3, r0, #0x18 - cmp r3, #3 - bhi _080B1858 -_080B1848: - ldrh r1, [r4] - ldrh r0, [r2] - adds r2, #2 - adds r4, #2 - cmp r1, r0 - beq _080B183E - movs r5, #0x80 - lsls r5, r5, #8 -_080B1858: - adds r0, r5, #0 -_080B185A: - add sp, #8 - pop {r4, r5} - pop {r1} - bx r1 - .align 2, 0 - - thumb_func_start sub_080B1864 -sub_080B1864: @ 0x080B1864 - push {r4, r5, r6, lr} - adds r5, r1, #0 - lsls r0, r0, #0x10 - lsrs r4, r0, #0x10 - movs r6, #0 - b _080B1876 -_080B1870: - adds r0, r6, #1 - lsls r0, r0, #0x18 - lsrs r6, r0, #0x18 -_080B1876: - cmp r6, #2 - bhi _080B189A - adds r0, r4, #0 - adds r1, r5, #0 - bl sub_080B1698 - lsls r0, r0, #0x10 - lsrs r2, r0, #0x10 - cmp r2, #0 - bne _080B1870 - adds r0, r4, #0 - adds r1, r5, #0 - bl sub_080B180C - lsls r0, r0, #0x10 - lsrs r2, r0, #0x10 - cmp r2, #0 - bne _080B1870 -_080B189A: - adds r0, r2, #0 - pop {r4, r5, r6} - pop {r1} - bx r1 - .align 2, 0 - - thumb_func_start sub_080B18A4 -sub_080B18A4: @ 0x080B18A4 - push {lr} - adds r3, r1, #0 - lsls r0, r0, #0x10 - lsrs r2, r0, #0x10 - ldr r0, _080B18CC @ =gUnk_02036A50 - ldr r0, [r0] - ldr r1, [r0] - movs r0, #0x80 - lsls r0, r0, #2 - cmp r1, r0 - beq _080B18D0 - adds r0, r2, #0 - adds r1, r3, #0 - movs r2, #0 - bl sub_080B16AC - lsls r0, r0, #0x10 - lsrs r0, r0, #0x10 - b _080B18D2 - .align 2, 0 -_080B18CC: .4byte gUnk_02036A50 -_080B18D0: - ldr r0, _080B18D8 @ =0x00008080 -_080B18D2: - pop {r1} - bx r1 - .align 2, 0 -_080B18D8: .4byte 0x00008080 - - thumb_func_start sub_080B18DC -sub_080B18DC: @ 0x080B18DC - push {r4, r5, r6, lr} - adds r5, r1, #0 - lsls r0, r0, #0x10 - lsrs r4, r0, #0x10 - movs r6, #0 - b _080B18EE -_080B18E8: - adds r0, r6, #1 - lsls r0, r0, #0x18 - lsrs r6, r0, #0x18 -_080B18EE: - cmp r6, #2 - bhi _080B1912 - adds r0, r4, #0 - adds r1, r5, #0 - bl sub_080B18A4 - lsls r0, r0, #0x10 - lsrs r2, r0, #0x10 - cmp r2, #0 - bne _080B18E8 - adds r0, r4, #0 - adds r1, r5, #0 - bl sub_080B180C - lsls r0, r0, #0x10 - lsrs r2, r0, #0x10 - cmp r2, #0 - bne _080B18E8 -_080B1912: - adds r0, r2, #0 - pop {r4, r5, r6} - pop {r1} - bx r1 - .align 2, 0 - diff --git a/asm/crt0.s b/asm/crt0.s index aa94b6fd..73578ef5 100644 --- a/asm/crt0.s +++ b/asm/crt0.s @@ -1,32 +1,31 @@ .include "asm/macros.inc" .include "constants/constants.inc" - .syntax unified - .text arm_func_start __start -__start: @ 0x08000000 - b _080000C0 -_08000004: +__start: + b start_vector + +header: .include "asm/rom_header.inc" -_080000C0: + +start_vector: mov r0, #0x12 msr cpsr_fc, r0 - ldr sp, _080000F4 @ =gUnk_03007FA0 + ldr sp, sp_irq mov r0, #0x1f msr cpsr_fc, r0 - ldr sp, _080000F8 @ =gUnk_03007F00 - ldr r1, _080000FC @ =0x03007FFC - ldr r0, _08000100 @ =gUnk_03005D90 + ldr sp, sp_usr + ldr r1, INTR_VECTOR_BUF + ldr r0, intr_main str r0, [r1] - ldr r1, _08000104 @ =MainLoop + ldr r1, =AgbMain mov lr, pc bx r1 _080000F0: - b _080000C0 -_080000F4: .4byte gUnk_03007FA0 -_080000F8: .4byte gUnk_03007F00 -_080000FC: .4byte 0x03007FFC -_08000100: .4byte gUnk_03005D90 -_08000104: .4byte MainLoop + b start_vector +sp_irq: .4byte gUnk_03007FA0 +sp_usr: .4byte gUnk_03007F00 +INTR_VECTOR_BUF: .4byte 0x03007FFC +intr_main: .4byte IntrMain diff --git a/asm/drLeft.s b/asm/drLeft.s index 6027b73f..b575c71b 100644 --- a/asm/drLeft.s +++ b/asm/drLeft.s @@ -26,9 +26,9 @@ DrLeft: @ 0x0806BF80 _0806BFA2: adds r0, r4, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity adds r0, r4, #0 - bl sub_0807DDE4 + bl HandleEntity0x82Actions adds r0, r4, #0 bl GetNextFrame adds r0, r4, #0 diff --git a/asm/dust.s b/asm/dust.s index 2a5392c6..f010f3dc 100644 --- a/asm/dust.s +++ b/asm/dust.s @@ -160,7 +160,7 @@ _080441F2: cmp r2, #0 bne _08044248 ldr r0, [r4, #0x64] - bl sub_0801DA0C + bl zFree b _0804429A .align 2, 0 _08044244: .4byte 0x000001EB diff --git a/asm/evilSpirit.s b/asm/evilSpirit.s index 79a69521..1baea3de 100644 --- a/asm/evilSpirit.s +++ b/asm/evilSpirit.s @@ -341,13 +341,13 @@ _080864EE: ldrsh r0, [r0, r1] movs r1, #0x80 lsls r1, r1, #6 - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #0x10 asrs r0, r0, #0x10 movs r4, #0x80 lsls r4, r4, #1 adds r1, r4, #0 - bl sub_0806FA04 + bl FixedDiv adds r1, r6, #0 adds r1, #0x80 lsls r0, r0, #0x10 @@ -363,11 +363,11 @@ _080864EE: ldrsh r0, [r0, r3] movs r1, #0x80 lsls r1, r1, #5 - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #0x10 asrs r0, r0, #0x10 adds r1, r4, #0 - bl sub_0806FA04 + bl FixedDiv adds r1, r6, #0 adds r1, #0x84 lsls r0, r0, #0x10 @@ -520,13 +520,13 @@ _0808663A: ldrsh r0, [r0, r1] movs r1, #0x80 lsls r1, r1, #6 - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #0x10 asrs r0, r0, #0x10 movs r5, #0x80 lsls r5, r5, #1 adds r1, r5, #0 - bl sub_0806FA04 + bl FixedDiv adds r1, r7, #0 adds r1, #0x80 lsls r0, r0, #0x10 @@ -541,11 +541,11 @@ _0808663A: ldrsh r0, [r0, r1] movs r1, #0x80 lsls r1, r1, #5 - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #0x10 asrs r0, r0, #0x10 adds r1, r5, #0 - bl sub_0806FA04 + bl FixedDiv adds r1, r7, #0 adds r1, #0x84 lsls r0, r0, #0x10 diff --git a/asm/farmers.s b/asm/farmers.s index f8c4e133..485c065c 100644 --- a/asm/farmers.s +++ b/asm/farmers.s @@ -57,9 +57,9 @@ _0806BC2E: _0806BC40: adds r0, r4, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity adds r0, r4, #0 - bl sub_0807DDE4 + bl HandleEntity0x82Actions adds r0, r4, #0 bl GetNextFrame _0806BC54: diff --git a/asm/festari.s b/asm/festari.s index d0677807..ea917d79 100644 --- a/asm/festari.s +++ b/asm/festari.s @@ -71,7 +71,7 @@ _0805FF90: _0805FF94: adds r0, r4, #0 adds r1, r5, #0 - bl sub_0807DB98 + bl HandlePostScriptActions pop {r4, r5, r6, pc} .align 2, 0 diff --git a/asm/figurineDevice.s b/asm/figurineDevice.s index bf0213bb..9d02534e 100644 --- a/asm/figurineDevice.s +++ b/asm/figurineDevice.s @@ -1386,7 +1386,7 @@ _0808863E: movs r0, #0 str r0, [r4, #0x14] _08088642: - ldr r2, _08088654 @ =gUnk_02033280 + ldr r2, _08088654 @ =gActiveScriptInfo ldrb r1, [r2, #7] movs r0, #1 orrs r0, r1 @@ -1394,7 +1394,7 @@ _08088642: pop {r4, pc} .align 2, 0 _08088650: .4byte gPlayerEntity -_08088654: .4byte gUnk_02033280 +_08088654: .4byte gActiveScriptInfo thumb_func_start sub_08088658 sub_08088658: @ 0x08088658 @@ -1414,7 +1414,7 @@ sub_08088658: @ 0x08088658 movs r0, #0 str r0, [r4, #0x14] _08088678: - ldr r2, _08088688 @ =gUnk_02033280 + ldr r2, _08088688 @ =gActiveScriptInfo ldrb r1, [r2, #7] movs r0, #1 orrs r0, r1 @@ -1422,4 +1422,4 @@ _08088678: pop {r4, pc} .align 2, 0 _08088684: .4byte gPlayerEntity -_08088688: .4byte gUnk_02033280 +_08088688: .4byte gActiveScriptInfo diff --git a/asm/fileScreen.s b/asm/fileScreen.s index 341bfde7..ba7813d0 100755 --- a/asm/fileScreen.s +++ b/asm/fileScreen.s @@ -33,7 +33,7 @@ sub_080519B0: @ 0x080519B0 cmp r5, #0 bne _08051A02 movs r0, #1 - bl sub_0801DA90 + bl DispReset bl sub_080A3210 bl zMallocInit bl sub_080A7124 @@ -41,7 +41,7 @@ sub_080519B0: @ 0x080519B0 ldr r4, _08051A08 @ =gScreenTransition adds r0, r4, #0 movs r1, #0xb0 - bl MemClear32 + bl MemClear bl sub_08049CD4 bl sub_080300AC bl sub_0807CA18 @@ -69,18 +69,18 @@ _08051A10: .4byte gMain sub_08051A14: @ 0x08051A14 push {lr} movs r0, #1 - bl sub_0801DA90 + bl DispReset ldr r1, _08051A70 @ =gFadeControl movs r0, #1 rsbs r0, r0, #0 str r0, [r1, #4] ldr r0, _08051A74 @ =gUnk_03000000 ldr r1, _08051A78 @ =0x00000B74 - bl MemClear32 + bl MemClear ldr r0, _08051A7C @ =gUnk_02032EC0 movs r1, #0xed lsls r1, r1, #2 - bl MemClear32 + bl MemClear bl EraseAllEntities bl sub_080197AC bl sub_08080668 @@ -368,7 +368,7 @@ sub_08051CF0: @ 0x08051CF0 cmp r4, #0 bne _08051D1E movs r0, #1 - bl sub_0801DA90 + bl DispReset strb r6, [r5, #3] strb r4, [r5, #4] ldr r0, _08051D28 @ =gScreenTransition @@ -729,15 +729,15 @@ sub_08052010: @ 0x08052010 bl sub_080A3210 bl MessageInitialize movs r0, #1 - bl sub_0801DA90 + bl DispReset ldr r0, _0805207C @ =gBG1Buffer movs r4, #0x80 lsls r4, r4, #4 adds r1, r4, #0 - bl MemClear32 + bl MemClear ldr r0, _08052080 @ =gBG2Buffer adds r1, r4, #0 - bl MemClear32 + bl MemClear bl sub_080A4D34 movs r0, #0xa bl LoadPaletteGroup @@ -749,10 +749,10 @@ sub_08052010: @ 0x08052010 movs r0, #0xc0 lsls r0, r0, #0x13 movs r1, #0x20 - bl MemClear32 + bl MemClear ldr r0, _08052084 @ =gMenu movs r1, #0x30 - bl MemClear32 + bl MemClear ldr r1, _08052088 @ =gScreen ldrh r2, [r1] movs r3, #0x80 diff --git a/asm/fourElements.s b/asm/fourElements.s index 63271cb5..dd5ffa82 100644 --- a/asm/fourElements.s +++ b/asm/fourElements.s @@ -78,7 +78,7 @@ sub_080A01E0: @ 0x080A01E0 adds r0, #0x38 strb r3, [r0] _080A0246: - ldr r0, _080A028C @ =gUnk_0800A0B4 + ldr r0, _080A028C @ =script_0800A0B4 bl StartPlayerScript ldr r1, _080A0284 @ =gScreen adds r2, r1, #0 @@ -108,13 +108,13 @@ _080A027C: .4byte gUnk_080FD1A0 _080A0280: .4byte 0x0000FF40 _080A0284: .4byte gScreen _080A0288: .4byte 0x0000FDFF -_080A028C: .4byte gUnk_0800A0B4 +_080A028C: .4byte script_0800A0B4 thumb_func_start sub_080A0290 sub_080A0290: @ 0x080A0290 push {r4, r5, lr} adds r4, r0, #0 - ldr r5, _080A02BC @ =gUnk_02033280 + ldr r5, _080A02BC @ =gActiveScriptInfo ldr r0, [r5] movs r1, #4 ands r0, r1 @@ -133,7 +133,7 @@ sub_080A0290: @ 0x080A0290 strh r0, [r4, #0x36] b _080A02CA .align 2, 0 -_080A02BC: .4byte gUnk_02033280 +_080A02BC: .4byte gActiveScriptInfo _080A02C0: movs r1, #2 strb r1, [r4, #0xc] @@ -355,7 +355,7 @@ sub_080A0464: @ 0x080A0464 movs r0, #6 movs r1, #0xac movs r2, #6 - bl FindEntityInListBySubtype + bl FindEntityByID cmp r0, #0 beq _080A048A movs r1, #0x2e diff --git a/asm/gleerok.s b/asm/gleerok.s index d6272ec5..d8709272 100644 --- a/asm/gleerok.s +++ b/asm/gleerok.s @@ -2824,11 +2824,11 @@ _0802E580: ldrb r1, [r6] lsls r1, r1, #0x18 asrs r1, r1, #0x10 - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #0x10 asrs r0, r0, #0x10 adds r1, r7, #0 - bl sub_0806FA04 + bl FixedDiv adds r1, r0, #0 ldrb r0, [r4, #1] lsls r0, r0, #4 @@ -2838,11 +2838,11 @@ _0802E580: ldrsh r0, [r0, r2] lsls r1, r1, #0x10 asrs r1, r1, #0x10 - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #0x10 asrs r0, r0, #0x10 adds r1, r7, #0 - bl sub_0806FA04 + bl FixedDiv ldr r2, [r5] lsls r0, r0, #0x10 asrs r0, r0, #8 @@ -2859,11 +2859,11 @@ _0802E580: ldrb r1, [r6] lsls r1, r1, #0x18 asrs r1, r1, #0x10 - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #0x10 asrs r0, r0, #0x10 adds r1, r7, #0 - bl sub_0806FA04 + bl FixedDiv ldr r2, [r5] lsls r0, r0, #0x10 asrs r0, r0, #8 diff --git a/asm/gorman.s b/asm/gorman.s index 753e767c..9760e2f9 100644 --- a/asm/gorman.s +++ b/asm/gorman.s @@ -272,7 +272,7 @@ sub_0806991C: @ 0x0806991C ldrb r0, [r0] orrs r1, r0 strb r1, [r5, #0x14] - ldr r2, _080699A8 @ =gUnk_02033280 + ldr r2, _080699A8 @ =gActiveScriptInfo ldrb r1, [r2, #7] movs r0, #1 orrs r0, r1 @@ -282,7 +282,7 @@ sub_0806991C: @ 0x0806991C _0806999C: .4byte gUnk_08111C5C _080699A0: .4byte gRoomControls _080699A4: .4byte gUnk_08111C74 -_080699A8: .4byte gUnk_02033280 +_080699A8: .4byte gActiveScriptInfo thumb_func_start sub_080699AC sub_080699AC: @ 0x080699AC @@ -342,7 +342,7 @@ sub_080699AC: @ 0x080699AC ldrb r0, [r0] orrs r1, r0 strb r1, [r5, #0x14] - ldr r2, _08069A38 @ =gUnk_02033280 + ldr r2, _08069A38 @ =gActiveScriptInfo ldrb r1, [r2, #7] movs r0, #1 orrs r0, r1 @@ -352,7 +352,7 @@ sub_080699AC: @ 0x080699AC _08069A2C: .4byte gUnk_08111C84 _08069A30: .4byte gRoomControls _08069A34: .4byte gUnk_08111C8C -_08069A38: .4byte gUnk_02033280 +_08069A38: .4byte gActiveScriptInfo thumb_func_start sub_08069A3C sub_08069A3C: @ 0x08069A3C diff --git a/asm/goronMerchant.s b/asm/goronMerchant.s index 80e01bd6..6f9d3259 100644 --- a/asm/goronMerchant.s +++ b/asm/goronMerchant.s @@ -50,7 +50,7 @@ _08069766: movs r0, #0 _0806976E: str r0, [r7, #0x14] - ldr r2, _08069780 @ =gUnk_02033280 + ldr r2, _08069780 @ =gActiveScriptInfo ldrb r1, [r2, #7] movs r0, #1 orrs r0, r1 @@ -58,4 +58,4 @@ _0806976E: pop {r4, r5, r6, r7, pc} .align 2, 0 _0806977C: .4byte 0x00002C1E -_08069780: .4byte gUnk_02033280 +_08069780: .4byte gActiveScriptInfo diff --git a/asm/gregal.s b/asm/gregal.s index 9bd9bd63..65a0271b 100644 --- a/asm/gregal.s +++ b/asm/gregal.s @@ -74,9 +74,9 @@ _0806CB4E: _0806CB66: adds r0, r5, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity adds r0, r5, #0 - bl sub_0807DDE4 + bl HandleEntity0x82Actions adds r0, r5, #0 bl GetNextFrame pop {r4, r5, pc} @@ -219,9 +219,9 @@ _0806CC7C: .4byte gPlayerEntity _0806CC80: adds r0, r4, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity adds r0, r4, #0 - bl sub_0807DDE4 + bl HandleEntity0x82Actions adds r0, r4, #0 bl GetNextFrame b _0806CCB0 diff --git a/asm/guardWithSpear.s b/asm/guardWithSpear.s index 18957b2c..4d328260 100644 --- a/asm/guardWithSpear.s +++ b/asm/guardWithSpear.s @@ -139,13 +139,13 @@ _08064168: lsls r0, r0, #0x10 cmp r0, #0 beq _0806417A - ldr r1, _0806417C @ =gUnk_02033280 + ldr r1, _0806417C @ =gActiveScriptInfo movs r0, #0 strb r0, [r1, #6] _0806417A: pop {r4, r5, r6, pc} .align 2, 0 -_0806417C: .4byte gUnk_02033280 +_0806417C: .4byte gActiveScriptInfo thumb_func_start sub_08064180 sub_08064180: @ 0x08064180 @@ -153,7 +153,7 @@ sub_08064180: @ 0x08064180 movs r0, #7 movs r1, #0x15 movs r2, #7 - bl FindEntityInListBySubtype + bl FindEntityByID cmp r0, #0 beq _08064194 bl DeleteEntity diff --git a/asm/gyorgFemale.s b/asm/gyorgFemale.s index 14d08573..daba4aa9 100644 --- a/asm/gyorgFemale.s +++ b/asm/gyorgFemale.s @@ -112,10 +112,10 @@ sub_0804614C: @ 0x0804614C movs r4, #0x80 lsls r4, r4, #8 adds r1, r4, #0 - bl MemClear32 + bl MemClear ldr r0, _08046250 @ =gMapDataTopSpecial adds r1, r4, #0 - bl MemClear32 + bl MemClear adds r0, r6, #0 movs r1, #0 bl sub_0804660C @@ -445,10 +445,10 @@ sub_08046498: @ 0x08046498 movs r4, #0x80 lsls r4, r4, #8 adds r1, r4, #0 - bl MemClear32 + bl MemClear ldr r0, _080464BC @ =gMapDataTopSpecial adds r1, r4, #0 - bl MemClear32 + bl MemClear adds r0, r5, #0 bl sub_080464C0 pop {r4, r5, pc} @@ -486,7 +486,7 @@ _080464DE: ldr r0, _0804650C @ =gUnk_02019EE0 movs r1, #0x80 lsls r1, r1, #4 - bl MemClear32 + bl MemClear ldr r1, _08046514 @ =gUnk_02000070 movs r0, #1 strb r0, [r1] diff --git a/asm/intr.s b/asm/intr.s index 388274a3..3332c380 100644 --- a/asm/intr.s +++ b/asm/intr.s @@ -49,16 +49,17 @@ _080B19C0: .4byte gRoomControls _080B19C4: .4byte 0x80000020 _080B19C8: .4byte 0x040000D4 - arm_func_start sub_080B19CC -sub_080B19CC: @ 0x080B19CC - ldrb r2, [r0, #0x38] - ldrh r1, [r0, #0x32] - ldrh r0, [r0, #0x2e] +@ r0 = entity* + arm_func_start _GetTileAtEntityPos +_GetTileAtEntityPos: @ 0x080B19CC + ldrb r2, [r0, #0x38] @ obj layer + ldrh r1, [r0, #0x32] @ obj y + ldrh r0, [r0, #0x2e] @ obj x ldr ip, _080B1C10 @ =gRoomControls ldrh r3, [ip, #6] - sub r0, r0, r3 + sub r0, r0, r3 @ obj x - room x ldrh r3, [ip, #8] - sub r1, r1, r3 + sub r1, r1, r3 @ obj y - room y lsl r0, r0, #0x16 lsr r0, r0, #0x1a lsl r1, r1, #0x16 @@ -102,7 +103,7 @@ _080B1A64: ldr r1, [r2] lsl r0, r0, #1 ldrh r0, [r1, r0] - cmp r0, #0x4000 + cmp r0, #0x4000 @ return tile index is OOB bxhs lr ldr r1, [r2, #4] lsl r0, r0, #1 diff --git a/asm/jarPortal.s b/asm/jarPortal.s index 09c48e54..8b057fc8 100644 --- a/asm/jarPortal.s +++ b/asm/jarPortal.s @@ -230,7 +230,7 @@ sub_0808C01C: @ 0x0808C01C subs r1, #0x18 movs r2, #0x30 movs r3, #0x30 - bl sub_0806FBFC + bl CheckPlayerProximity cmp r0, #0 beq _0808C0A6 ldr r2, _0808C06C @ =gArea diff --git a/asm/kid.s b/asm/kid.s index 88f596e0..59d6b6e7 100644 --- a/asm/kid.s +++ b/asm/kid.s @@ -656,7 +656,7 @@ sub_0806252C: @ 0x0806252C lsls r0, r1, #0x10 asrs r0, r0, #0x10 movs r1, #0x14 - bl sub_0806FA04 + bl FixedDiv lsls r0, r0, #0x10 asrs r0, r0, #0x10 mov sl, r0 @@ -664,7 +664,7 @@ sub_0806252C: @ 0x0806252C lsls r0, r2, #0x10 asrs r0, r0, #0x10 movs r1, #0x14 - bl sub_0806FA04 + bl FixedDiv lsls r0, r0, #0x10 asrs r0, r0, #0x10 mov r8, r0 @@ -897,13 +897,13 @@ _0806274A: .align 2, 0 _08062778: .4byte gRoomControls _0806277C: - ldr r1, _08062784 @ =gUnk_02033280 + ldr r1, _08062784 @ =gActiveScriptInfo movs r0, #0 strb r0, [r1, #6] _08062782: pop {r4, r5, pc} .align 2, 0 -_08062784: .4byte gUnk_02033280 +_08062784: .4byte gActiveScriptInfo thumb_func_start sub_08062788 sub_08062788: @ 0x08062788 @@ -1228,13 +1228,13 @@ _08062A30: lsls r0, r0, #0x10 cmp r0, #0 beq _08062A42 - ldr r1, _08062A44 @ =gUnk_02033280 + ldr r1, _08062A44 @ =gActiveScriptInfo movs r0, #0 strb r0, [r1, #6] _08062A42: pop {r4, r5, r6, pc} .align 2, 0 -_08062A44: .4byte gUnk_02033280 +_08062A44: .4byte gActiveScriptInfo thumb_func_start sub_08062A48 sub_08062A48: @ 0x08062A48 diff --git a/asm/librarians.s b/asm/librarians.s index 0545aeac..f80ef358 100644 --- a/asm/librarians.s +++ b/asm/librarians.s @@ -31,9 +31,9 @@ Librarians: @ 0x0806B9F0 _0806BA18: adds r0, r4, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity adds r0, r4, #0 - bl sub_0807DDE4 + bl HandleEntity0x82Actions adds r0, r4, #0 bl GetNextFrame pop {r4, pc} diff --git a/asm/lilypadLarge.s b/asm/lilypadLarge.s index 5202438a..4d2e643d 100644 --- a/asm/lilypadLarge.s +++ b/asm/lilypadLarge.s @@ -73,7 +73,7 @@ _08085566: b _0808557A _0808556C: adds r0, r4, #0 - bl DoesSimilarEntityExist + bl EntityHasDuplicateID cmp r0, #0 beq _0808557A bl DeleteThisEntity @@ -349,13 +349,13 @@ _08085774: lsls r4, r4, #0x10 asrs r4, r4, #0x18 adds r1, r4, #0 - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #0x10 asrs r0, r0, #0x10 movs r5, #0x80 lsls r5, r5, #1 adds r1, r5, #0 - bl sub_0806FA04 + bl FixedDiv lsls r0, r0, #0x10 asrs r0, r0, #8 ldr r1, [r7, #0x6c] @@ -368,11 +368,11 @@ _08085774: movs r2, #0 ldrsh r0, [r0, r2] adds r1, r4, #0 - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #0x10 asrs r0, r0, #0x10 adds r1, r5, #0 - bl sub_0806FA04 + bl FixedDiv lsls r0, r0, #0x10 asrs r0, r0, #8 ldr r1, [r7, #0x70] @@ -441,7 +441,7 @@ _0808581A: movs r4, #0x80 lsls r4, r4, #1 adds r1, r4, #0 - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #0x10 asrs r0, r0, #0x10 ldr r5, _080858A8 @ =gSineTable @@ -450,13 +450,13 @@ _0808581A: adds r1, r1, r5 movs r2, #0 ldrsh r1, [r1, r2] - bl sub_0806FA04 + bl FixedDiv strh r0, [r7, #0x24] ldr r0, [r7, #0x70] lsls r0, r0, #8 asrs r0, r0, #0x10 adds r1, r4, #0 - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #0x10 asrs r0, r0, #0x10 ldrb r1, [r7, #0x15] @@ -465,7 +465,7 @@ _0808581A: adds r1, r1, r5 movs r2, #0 ldrsh r1, [r1, r2] - bl sub_0806FA04 + bl FixedDiv lsls r0, r0, #0x10 asrs r0, r0, #0x10 rsbs r4, r0, #0 @@ -1072,7 +1072,7 @@ _08085D0C: sub_08085D10: @ 0x08085D10 push {r4, lr} adds r4, r0, #0 - bl DoesSimilarEntityExist + bl EntityHasDuplicateID cmp r0, #0 beq _08085D26 ldrb r0, [r4, #0xb] diff --git a/asm/loadRoomEntity.s b/asm/loadRoomEntity.s index 81a81688..50933176 100644 --- a/asm/loadRoomEntity.s +++ b/asm/loadRoomEntity.s @@ -19,14 +19,14 @@ LoadRoomEntity: @ 0x0804ADF8 bne _0804AE1C ldrb r1, [r4, #2] adds r0, r6, #0 - bl FindEntityBySubtype + bl DeepFindEntityByID cmp r0, #0 beq _0804AE1C movs r0, #0 b _0804AEAC _0804AE1C: adds r0, r6, #0 - bl GetEmptyEntityByType + bl GetEmptyEntityByKind adds r5, r0, #0 cmp r5, #0 beq _0804AEAA diff --git a/asm/macroBook.s b/asm/macroBook.s index 7836e99b..654f182a 100644 --- a/asm/macroBook.s +++ b/asm/macroBook.s @@ -360,7 +360,7 @@ sub_0809AA00: @ 0x0809AA00 movs r0, #7 movs r1, #0x38 movs r2, #7 - bl FindEntityInListBySubtype + bl FindEntityByID adds r4, r0, #0 adds r7, r5, #0 adds r7, #0x78 @@ -380,7 +380,7 @@ _0809AA30: _0809AA3A: adds r0, r4, #0 movs r1, #7 - bl FindNextEntityOfSameSubtype + bl FindNextDuplicateID adds r4, r0, #0 cmp r4, #0 bne _0809AA30 diff --git a/asm/macros/scripts.inc b/asm/macros/scripts.inc new file mode 100644 index 00000000..f9206713 --- /dev/null +++ b/asm/macros/scripts.inc @@ -0,0 +1,734 @@ +@ All the macro functions for scripts + +@ helper macros + +.macro RecursiveOpcodeN count:req, opcode:req, size:req, arg:req, args:vararg + .ifnb \args + RecursiveOpcodeN \count + 1 \opcode \size \args + .else + .2byte 0x400 * (((\count) * \size) + 1) + \opcode + .endif +.endm + +.macro RecursiveOpcode opcode:req, size:req, args:vararg + RecursiveOpcodeN 1 \opcode \size \args +.endm + +.macro RecursiveArgs size:req, arg:req, args:vararg + \size \arg + .ifnb \args + RecursiveArgs \size \args + .endif +.endm + +@ script macros + +.macro SCRIPT_START name + .globl \name + .section .text +\name: +.endm + +.macro SCRIPT_END + .2byte 0xffff +.endm + +.macro Nop + .2byte 0x0400 +.endm + +.macro BeginBlock + .2byte 0x0401 +.endm + +.macro EndBlock + .2byte 0x0402 +.endm + +.macro Jump label:req + .2byte 0x0803 +1: .2byte \label - 1b +.endm + +.macro JumpIf label:req + .2byte 0x0804 +1: .2byte \label - 1b +.endm + +.macro JumpIfNot label:req + .2byte 0x0805 +1: .2byte \label - 1b +.endm + +.macro JumpTableLabel temp:req, label:req, labels:vararg + .2byte \label - \temp + .ifnb \labels + JumpTableLabel \temp - 2 \labels + .endif +.endm + +.macro JumpTable labels:vararg + RecursiveOpcode 0x6 1 \labels +1: + JumpTableLabel 1b \labels +.endm + +.macro JumpAbsolute label:req + .2byte 0x0c07 + .4byte \label +.endm + +.macro JumpAbsoluteIf label:req + .2byte 0x0c08 + .4byte \label +.endm + +.macro JumpAbsoluteIfNot label:req + .2byte 0x0c09 + .4byte \label +.endm + +.macro JumpAbsoluteTable labels:vararg + RecursiveOpcode 0xa 2 \labels + RecursiveArgs .4byte \labels +.endm + +.macro Call function:req + .2byte 0x0c0b + .4byte \function +.endm + +@this shouldn't be use without an argument +.macro CallWithArg function:req, argument + .ifnb \argument + .2byte 0x140c + .4byte \function + .4byte \argument + .else + .2byte 0x0c0c + .4byte \function + .endif +.endm + +.macro LoadRoomEntityList entityDataList:req + .2byte 0x0c0d + .4byte \entityDataList +.endm + +.macro TestBit bitmask:req + .2byte 0x0c0e + .4byte \bitmask +.endm + +.macro CheckInventory1 s:req + .2byte 0x080f + .2byte \s +.endm + +.macro CheckInventory2 s:req + .2byte 0x0810 + .2byte \s +.endm + +.macro HasRoomItemForSale + .2byte 0x0411 +.endm + +.macro CheckLocalFlag s:req + .2byte 0x0812 + .2byte \s +.endm + +.macro CheckLocalFlagByOffset a:req, b:req + .2byte 0x0c13 + .2byte \a + .2byte \b +.endm + +.macro CheckGlobalFlag s:req + .2byte 0x0814 + .2byte \s +.endm + +.macro CheckRoomFlag s:req + .2byte 0x0815 + .2byte \s +.endm + +.macro CheckPlayerInRegion x:req, y:req, dimension:req + .2byte 0x1016 + .2byte \x + .2byte \y + .2byte \dimension +.endm + +.macro CheckPlayerInRegion2 dimension:req + .2byte 0x0817 + .2byte \dimension +.endm + +.macro CheckEntityInteractType + .2byte 0x0418 +.endm + +.macro _0807E30C + .2byte 0x0419 +.endm + +.macro HasRupees amount:req + .2byte 0x081a + .2byte \amount +.endm + +.macro _0807E3BC s:req + .2byte 0x081b + .2byte \s +.endm + +.macro _0807E3E8 + .2byte 0x041c +.endm + +.macro CheckKinstoneFused s:req + .2byte 0x081d + .2byte \s +.endm + +.macro BuyItem item, b + .2byte 0x0c1e + .ifnb \item + .2byte \item + .2byte \b + .else + .4byte 0 + .endif +.endm + +.macro _0807E48C s:req + .2byte 0x081f + .2byte \s +.endm + +.macro _0807E4CC w:req + .2byte 0x0c20 + .4byte \w +.endm + +.macro _0807E4EC w:req + .2byte 0x0c21 + .4byte \w +.endm + +.macro _0807E514 w:req + .2byte 0x0c22 + .4byte \w +.endm + +.macro CheckPlayerFlags w:req + .2byte 0x0c23 + .4byte \w +.endm + +.macro _0807E564 + .2byte 0x0424 +.endm + +.macro EntityHasHeight + .2byte 0x0425 +.endm + +.macro ComparePlayerAction s:req + .2byte 0x0826 + .2byte \s +.endm + +.macro ComparePlayerAnimationState s:req + .2byte 0x0827 + .2byte \s +.endm + +.macro _0807E5F8 w:req + .2byte 0x0c28 + .4byte \w +.endm + +.macro _0807E610 w:req + .2byte 0x0c29 + .4byte \w +.endm + +.macro SetLocalFlag s:req + .2byte 0x082a + .2byte \s +.endm + +.macro SetLocalFlagByOffset a:req, b:req + .2byte 0x0c2b + .2byte \a + .2byte \b +.endm + +.macro ClearLocalFlag s:req + .2byte 0x082c + .2byte \s +.endm + +.macro SetGlobalFlag s:req + .2byte 0x082d + .2byte \s +.endm + +.macro ClearGlobalFlag s:req + .2byte 0x082e + .2byte \s +.endm + +.macro SetRoomFlag s:req + .2byte 0x082f + .2byte \s +.endm + +.macro ClearRoomFlag s:req + .2byte 0x0830 + .2byte \s +.endm + +.macro Wait frames:req + .2byte 0x0831 + .2byte \frames +.endm + +.macro WaitForSomething w:req + .2byte 0x0c32 + .4byte \w +.endm + +.macro WaitForSomething2 w:req + .2byte 0x0c33 + .4byte \w +.endm + +.macro WaitPlayerAction8 + .2byte 0x0434 +.endm + +.macro WaitForPlayerAction0x17 + .2byte 0x0435 +.endm + +.macro WaitFor_1 + .2byte 0x0436 +.endm + +.macro WaitFor_2 + .2byte 0x0437 +.endm + +.macro _0807E778 s:req + .2byte 0x0838 + .2byte \s +.endm + +.macro _0807E788 w:req + .2byte 0x0c39 + .4byte \w +.endm + +.macro _0807E79C + .2byte 0x043a +.endm + +.macro Nop2 s:req + .2byte 0x083b + .2byte \s +.endm + +.macro DoFade4 + .2byte 0x043c +.endm + +.macro DoFade5 + .2byte 0x043d +.endm + +.macro DoFade6 + .2byte 0x043e +.endm + +.macro DoFade7 + .2byte 0x043f +.endm + +.macro _0807E800 w:req + .2byte 0x0c40 + .4byte \w +.endm + +.macro _0807E80C w:req + .2byte 0x0c41 + .4byte \w +.endm + +.macro _0807E858 s:req + .2byte 0x0842 + .2byte \s +.endm + +.macro _0807E858_0 + .2byte 0x0442 +.endm + +.macro _0807E864 + .2byte 0x0443 +.endm + +.macro _0807E878 + .2byte 0x0444 +.endm + +.macro _0807E888 + .2byte 0x0445 +.endm + +.macro SetPlayerAction w:req + .2byte 0x0c46 + .4byte \w +.endm + +.macro StartPlayerScript script:req + .2byte 0x0c47 + .4byte \script +.endm + +.macro _0807E8D4 s:req + .2byte 0x0848 + .2byte \s +.endm + +.macro _0807E8E4_0 + .2byte 0x0449 +.endm + +.macro _0807E8E4_1 + .2byte 0x044a +.endm + +.macro _0807E8E4_2 + .2byte 0x044b +.endm + +.macro _0807E8E4_3 + .2byte 0x044c +.endm + +.macro _0807E908 s:req + .2byte 0x084d + .2byte \s +.endm + +.macro SetIntVariable value:req + .2byte 0x0c4e + .4byte \value +.endm + +.macro _0807E924 + .2byte 0x044f +.endm + +.macro _0807E930 s:req + .2byte 0x0850 + .2byte \s +.endm + +.macro _0807E944 + .2byte 0x0451 +.endm + +.macro _0807E974 s:req + .2byte 0x0852 + .2byte \s +.endm + +.macro _0807E9D4 + .2byte 0x0453 +.endm + +.macro _0807E9DC + .2byte 0x0454 +.endm + +.macro _0807E9E4 s:req + .2byte 0x0855 + .2byte \s +.endm + +.macro _0807E9F0 + .2byte 0x0456 +.endm + +.macro _0807EA4C + .2byte 0x0457 +.endm + +.macro _0807EA88 s:req + .2byte 0x0858 + .2byte \s +.endm + +.macro _0807EA94 + .2byte 0x0459 +.endm + +.macro TextboxNoOverlapFollow s:req + .2byte 0x085a + .2byte \s +.endm + +.macro TextboxNoOverlap s:req + .2byte 0x085b + .2byte \s +.endm + +.macro TextboxNoOverlapFollowPos a:req, b:req + .2byte 0x0c5c + .2byte \a + .2byte \b +.endm + +.macro TextboxNoOverlapFollowPos_1 s:req + .2byte 0x085c + .2byte \s +.endm + +.macro TextboxNoOverlapFollowTable labels:vararg + RecursiveOpcode 0x5d 1 \labels + RecursiveArgs .2byte \labels +.endm + +.macro TextboxNoOverlapVar + .2byte 0x045e +.endm + +.macro _0807EB28 s:req + .2byte 0x085f + .2byte \s +.endm + +.macro _0807EB38 + .2byte 0x0460 +.endm + +.macro _0807EB44 s:req + .2byte 0x0861 + .2byte \s +.endm + +.macro _0807EB4C a:req, b:req + .2byte 0x0c62 + .2byte \a + .2byte \b +.endm + +.macro _0807EB74 + .2byte 0x0463 +.endm + +.macro _0807EB8C + .2byte 0x0464 +.endm + +.macro SetEntityDirection direction:req + .2byte 0x0865 + .2byte \direction +.endm + +.macro SetEntityDirectionWithAnimationState direction:req + .2byte 0x0866 + .2byte \direction +.endm + +.macro SetEntitySpeed speed:req + .2byte 0x0867 + .2byte \speed +.endm + +.macro SetEntity0x20 value:req + .2byte 0x0c68 + .4byte \value +.endm + +.macro SetEntityPositionRelative xOffset:req, yOffset:req + .2byte 0x0c69 + .2byte \xOffset + .2byte \yOffset +.endm + +.macro SetEntityPosition x:req, y:req + .2byte 0x0c6a + .2byte \x + .2byte \y +.endm + +.macro MoveEntityToPlayer + .2byte 0x046b +.endm + +.macro Nop3 + .2byte 0x046c +.endm + +.macro _0807EC1C s:req + .2byte 0x086d + .2byte \s +.endm + +.macro _0807EC64 s:req + .2byte 0x086e + .2byte \s +.endm + +.macro _0807EC94 s:req + .2byte 0x086f + .2byte \s +.endm + +.macro _0807ECC4 s:req + .2byte 0x0870 + .2byte \s +.endm + +.macro _0807ECF4 s:req + .2byte 0x0871 + .2byte \s +.endm + +.macro _0807ED24 a:req, b:req, c:req + .2byte 0x1072 + .2byte \a + .2byte \b + .2byte \c +.endm + +.macro _0807EDD4 a:req, b:req + .2byte 0x0c73 + .2byte \a + .2byte \b +.endm + +.macro _0807EE04 a:req, b:req + .2byte 0x0c74 + .2byte \a + .2byte \b +.endm + +.macro _0807EE30 + .2byte 0x0475 +.endm + +.macro _0807EEB4 + .2byte 0x0476 +.endm + +.macro _0807EEF4 a:req, b:req + .2byte 0x0c77 + .2byte \a + .2byte \b +.endm + +.macro _0807EF3C a:req, b:req + .2byte 0x0c78 + .2byte \a + .2byte \b +.endm + +.macro DoPostScriptAction action:req + .2byte 0x0879 + .2byte \action +.endm + +.macro DoPostScriptAction2 action:req + .2byte 0x087a + .2byte \action +.endm + +.macro SoundReq s:req + .2byte 0x087b + .2byte \s +.endm + +.macro SoundReq2 s:req + .2byte 0x087c + .2byte \s +.endm + +.macro SoundReq3 w:req + .2byte 0x0c7d + .4byte \w +.endm + +.macro SoundReq0x80100000 + .2byte 0x047e +.endm + +.macro ModRupees amount:req + .2byte 0x087f + .2byte \amount +.endm + +.macro ModHealth amount:req + .2byte 0x0880 + .2byte \amount +.endm + +@ this command doesn't actually take an argument +.macro IncreaseMaxHealth + .2byte 0x0881 + .2byte 8 +.endm + +.macro _0807F034 s:req + .2byte 0x0882 + .2byte \s +.endm + +.macro _0807F050 s:req + .2byte 0x0883 + .2byte \s +.endm + +.macro GetInventoryValue s:req + .2byte 0x0884 + .2byte \s +.endm + +.macro _0807F078 a:req, b:req + .2byte 0x0c85 + .2byte \a + .2byte \b +.endm + +.macro _0807F088 s:req + .2byte 0x0886 + .2byte \s +.endm + +.macro CameraTargetEntity + .2byte 0x0487 +.endm + +.macro CameraTargetPlayer + .2byte 0x0488 +.endm + +.macro _0807F0B4 s:req + .2byte 0x0889 + .2byte \s +.endm + +.macro _0807F0C8 a:req, b:req + .2byte 0x0c8a + .2byte \a + .2byte \b +.endm + + diff --git a/asm/mama.s b/asm/mama.s index 048f5f7e..252b21e6 100644 --- a/asm/mama.s +++ b/asm/mama.s @@ -75,9 +75,9 @@ _0806C41C: .4byte gPlayerEntity _0806C420: adds r0, r4, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity adds r0, r4, #0 - bl sub_0807DDE4 + bl HandleEntity0x82Actions adds r0, r4, #0 bl GetNextFrame b _0806C450 diff --git a/asm/manager10.s b/asm/manager10.s index 2826845f..f0d19df0 100644 --- a/asm/manager10.s +++ b/asm/manager10.s @@ -338,7 +338,7 @@ _08059800: lsls r5, r5, #4 adds r0, r4, #0 adds r1, r5, #0 - bl MemClear32 + bl MemClear ldr r1, _08059820 @ =0x0600E800 adds r0, r4, #0 adds r2, r5, #0 diff --git a/asm/manager14.s b/asm/manager14.s index cfdf3e17..cae54bf4 100644 --- a/asm/manager14.s +++ b/asm/manager14.s @@ -30,7 +30,7 @@ _08059E7C: .4byte gUnk_081085A4 sub_08059E80: @ 0x08059E80 push {r4, r5, lr} adds r4, r0, #0 - bl DoesSimilarEntityExist + bl EntityHasDuplicateID cmp r0, #0 beq _08059E90 bl DeleteThisEntity diff --git a/asm/manager16.s b/asm/manager16.s index 25cd6698..f1f6c5d9 100644 --- a/asm/manager16.s +++ b/asm/manager16.s @@ -175,7 +175,7 @@ _0805AC6A: beq _0805ACA6 adds r0, r3, #0 mov r1, sb - bl sub_0807DAF0 + bl InitScriptForEntity _0805ACA6: adds r4, #0x10 adds r5, #1 diff --git a/asm/manager1B.s b/asm/manager1B.s index c591eaa4..31e610bc 100644 --- a/asm/manager1B.s +++ b/asm/manager1B.s @@ -10,7 +10,7 @@ sub_0805B3B4: @ 0x0805B3B4 push {r4, r5, lr} adds r4, r0, #0 - bl DoesSimilarEntityExist + bl EntityHasDuplicateID cmp r0, #0 beq _0805B3C4 bl DeleteThisEntity diff --git a/asm/manager22.s b/asm/manager22.s index 4159a42b..aae066dc 100644 --- a/asm/manager22.s +++ b/asm/manager22.s @@ -342,7 +342,7 @@ _0805BB82: strh r1, [r2, #0xc] movs r0, #9 movs r1, #0x22 - bl FindEntityBySubtype + bl DeepFindEntityByID cmp r0, #0 beq _0805BBAE bl sub_0805B8EC diff --git a/asm/manager2C.s b/asm/manager2C.s index 4da87eb7..123784c0 100644 --- a/asm/manager2C.s +++ b/asm/manager2C.s @@ -44,7 +44,7 @@ _0805D184: ldr r4, _0805D1F8 @ =gUnk_030010AC adds r0, r4, #0 movs r1, #0x20 - bl MemClear32 + bl MemClear subs r4, #0xc movs r1, #0 movs r0, #1 diff --git a/asm/manager36.s b/asm/manager36.s index 5245d37b..e4fae5aa 100644 --- a/asm/manager36.s +++ b/asm/manager36.s @@ -72,7 +72,7 @@ sub_0805DE18: @ 0x0805DE18 movs r0, #9 movs r1, #0x36 movs r2, #6 - bl FindEntityInListByForm + bl FindEntity cmp r0, #0 beq _0805DE34 bl DeleteEntityAny diff --git a/asm/managerF.s b/asm/managerF.s index b9d9444a..1e268250 100644 --- a/asm/managerF.s +++ b/asm/managerF.s @@ -492,7 +492,7 @@ sub_08059278: @ 0x08059278 movs r0, #9 movs r1, #0xf movs r2, #6 - bl FindEntityInListBySubtype + bl FindEntityByID cmp r0, #0 beq _0805928C bl sub_08058ECC diff --git a/asm/mazaalMacro.s b/asm/mazaalMacro.s index 063718d6..1f0cef9a 100644 --- a/asm/mazaalMacro.s +++ b/asm/mazaalMacro.s @@ -300,7 +300,7 @@ _08034E8A: beq _08034EBC movs r0, #3 strb r0, [r4, #0xc] - ldr r1, _08034EB4 @ =gUnk_08012E20 + ldr r1, _08034EB4 @ =script_08012E20 adds r0, r4, #0 bl StartCutscene adds r1, r4, #0 @@ -309,7 +309,7 @@ _08034E8A: b _08034EBC .align 2, 0 _08034EB0: .4byte gScreenTransition -_08034EB4: .4byte gUnk_08012E20 +_08034EB4: .4byte script_08012E20 _08034EB8: bl DeleteThisEntity _08034EBC: @@ -334,7 +334,7 @@ _08034ED6: sub_08034ED8: @ 0x08034ED8 push {lr} movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity pop {pc} .align 2, 0 @@ -389,7 +389,7 @@ sub_08034EE4: @ 0x08034EE4 _08034F46: adds r0, r5, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity pop {r4, r5, pc} .align 2, 0 _08034F50: .4byte gUnk_080CEEC8 diff --git a/asm/minishEzlo.s b/asm/minishEzlo.s index 39185631..e6c2ea60 100644 --- a/asm/minishEzlo.s +++ b/asm/minishEzlo.s @@ -33,9 +33,9 @@ MinishEzlo: @ 0x08062F70 _08062FA0: adds r0, r4, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity adds r0, r4, #0 - bl sub_0807DDE4 + bl HandleEntity0x82Actions adds r0, r4, #0 bl GetNextFrame adds r4, #0x5b @@ -300,7 +300,7 @@ _08063186: adds r1, #0x80 movs r0, #0x11 strh r0, [r1] - ldr r2, _080631B8 @ =gUnk_02033280 + ldr r2, _080631B8 @ =gActiveScriptInfo ldrb r1, [r2, #7] movs r0, #1 orrs r0, r1 @@ -308,7 +308,7 @@ _08063186: b _080631DC .align 2, 0 _080631B4: .4byte 0x0000033F -_080631B8: .4byte gUnk_02033280 +_080631B8: .4byte gActiveScriptInfo _080631BC: lsls r0, r3, #1 adds r0, r2, r0 @@ -324,11 +324,11 @@ _080631CA: adds r0, r4, #0 movs r3, #0 bl sub_0805EC9C - ldr r1, _080631E4 @ =gUnk_02033280 + ldr r1, _080631E4 @ =gActiveScriptInfo movs r0, #0 strb r0, [r1, #6] _080631DC: pop {r4, r5, r6, pc} .align 2, 0 _080631E0: .4byte 0xFFFE0000 -_080631E4: .4byte gUnk_02033280 +_080631E4: .4byte gActiveScriptInfo diff --git a/asm/minishSizedArchway.s b/asm/minishSizedArchway.s deleted file mode 100644 index cc3b1074..00000000 --- a/asm/minishSizedArchway.s +++ /dev/null @@ -1,40 +0,0 @@ - .include "asm/macros.inc" - - .include "constants/constants.inc" - - .syntax unified - - .text - - - thumb_func_start MinishSizedArchway -MinishSizedArchway: @ 0x080973E4 - push {r4, lr} - adds r4, r0, #0 - ldrb r0, [r4, #0xc] - cmp r0, #0 - bne _0809741E - movs r0, #1 - strb r0, [r4, #0xc] - ldrb r0, [r4, #0xa] - strb r0, [r4, #0x1e] - adds r1, r4, #0 - adds r1, #0x38 - movs r0, #2 - strb r0, [r1] - adds r0, r4, #0 - bl UpdateSpriteForCollisionLayer - bl CheckIsDungeon - cmp r0, #0 - beq _0809741E - adds r2, r4, #0 - adds r2, #0x29 - ldrb r1, [r2] - movs r0, #8 - rsbs r0, r0, #0 - ands r0, r1 - movs r1, #1 - orrs r0, r1 - strb r0, [r2] -_0809741E: - pop {r4, pc} diff --git a/asm/minishSizedEntrance.s b/asm/minishSizedEntrance.s deleted file mode 100644 index aa4edc0d..00000000 --- a/asm/minishSizedEntrance.s +++ /dev/null @@ -1,62 +0,0 @@ - .include "asm/macros.inc" - - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start sub_08090F00 -sub_08090F00: @ 0x08090F00 - push {r4, r5, r6, lr} - adds r4, r0, #0 - ldrb r1, [r4, #0xa] - cmp r1, #1 - bne _08090F1C - ldr r0, [r4, #0x50] - ldrb r2, [r4, #0xf] - lsls r1, r2 - ldr r0, [r0, #0x20] - ands r0, r1 - cmp r0, #0 - bne _08090F1C - bl DeleteThisEntity -_08090F1C: - ldr r6, _08090F64 @ =gPlayerState - ldr r0, [r6, #0x30] - movs r1, #0x80 - ands r0, r1 - cmp r0, #0 - beq _08090F62 - ldr r5, _08090F68 @ =gPlayerEntity - adds r0, r4, #0 - adds r1, r5, #0 - movs r2, #4 - movs r3, #4 - bl sub_080041A0 - cmp r0, #0 - beq _08090F62 - movs r1, #0x36 - ldrsh r0, [r5, r1] - cmp r0, #0 - bne _08090F62 - adds r2, r6, #0 - adds r2, #0x90 - ldr r1, _08090F6C @ =gUnk_0812225C - ldrb r0, [r4, #0xb] - lsls r0, r0, #1 - adds r0, r0, r1 - ldrh r1, [r2] - ldrh r0, [r0] - ands r0, r1 - cmp r0, #0 - beq _08090F62 - ldrb r0, [r4, #0xe] - bl GetCurrentRoomProperty - bl DoExitTransition -_08090F62: - pop {r4, r5, r6, pc} - .align 2, 0 -_08090F64: .4byte gPlayerState -_08090F68: .4byte gPlayerEntity -_08090F6C: .4byte gUnk_0812225C diff --git a/asm/mountainMinish.s b/asm/mountainMinish.s index 916c1f91..3b8e7e7f 100644 --- a/asm/mountainMinish.s +++ b/asm/mountainMinish.s @@ -199,9 +199,9 @@ _08067F94: .4byte gPlayerEntity _08067F98: adds r0, r5, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity adds r0, r5, #0 - bl sub_0807DDE4 + bl HandleEntity0x82Actions ldrb r0, [r5, #0xb] cmp r0, #3 bne _0806801A diff --git a/asm/non_matching/arm_proxy/ItemInit.inc b/asm/non_matching/arm_proxy/ItemInit.inc index e48870ae..efdae83e 100644 --- a/asm/non_matching/arm_proxy/ItemInit.inc +++ b/asm/non_matching/arm_proxy/ItemInit.inc @@ -127,4 +127,4 @@ _08017438: .align 2, 0 _0801749C: .4byte 0x000003FF _080174A0: .4byte gPlayerEntity - .syntax divided \ No newline at end of file + .syntax divided diff --git a/asm/non_matching/arm_proxy/sub_08017530.inc b/asm/non_matching/arm_proxy/sub_08017530.inc index 4c2b9134..278daa48 100644 --- a/asm/non_matching/arm_proxy/sub_08017530.inc +++ b/asm/non_matching/arm_proxy/sub_08017530.inc @@ -87,4 +87,4 @@ _080175D8: .4byte gUnk_020342F8 _080175DC: .4byte gNPCFunctions _080175E0: .4byte gUnk_02031EC0 _080175E4: .4byte gRoomControls - .syntax divided \ No newline at end of file + .syntax divided diff --git a/asm/non_matching/arm_proxy/sub_0801766C.inc b/asm/non_matching/arm_proxy/sub_0801766C.inc index 6ef38554..239a6506 100644 --- a/asm/non_matching/arm_proxy/sub_0801766C.inc +++ b/asm/non_matching/arm_proxy/sub_0801766C.inc @@ -65,4 +65,4 @@ _080176DE: pop {r4} pop {r1} bx r1 - .syntax divided \ No newline at end of file + .syntax divided diff --git a/asm/non_matching/arm_proxy/sub_080176E4.inc b/asm/non_matching/arm_proxy/sub_080176E4.inc index 5000774e..e8a48278 100644 --- a/asm/non_matching/arm_proxy/sub_080176E4.inc +++ b/asm/non_matching/arm_proxy/sub_080176E4.inc @@ -51,4 +51,4 @@ _0801773A: bx r1 .align 2, 0 _08017740: .4byte gUnk_03003C70 - .syntax divided \ No newline at end of file + .syntax divided diff --git a/asm/non_matching/arm_proxy/sub_08017744.inc b/asm/non_matching/arm_proxy/sub_08017744.inc index 2d47df2c..e5e245ec 100644 --- a/asm/non_matching/arm_proxy/sub_08017744.inc +++ b/asm/non_matching/arm_proxy/sub_08017744.inc @@ -47,4 +47,4 @@ _0801779A: pop {r4, r5, r6, r7} pop {r0} bx r0 - .syntax divided \ No newline at end of file + .syntax divided diff --git a/asm/non_matching/arm_proxy/sub_080177A0.inc b/asm/non_matching/arm_proxy/sub_080177A0.inc index 99962e08..da64049f 100644 --- a/asm/non_matching/arm_proxy/sub_080177A0.inc +++ b/asm/non_matching/arm_proxy/sub_080177A0.inc @@ -92,4 +92,4 @@ _0801784A: pop {r4, r5, r6} pop {r1} bx r1 - .syntax divided \ No newline at end of file + .syntax divided diff --git a/asm/non_matching/code_080B1520/EEPROMWrite.inc b/asm/non_matching/code_080B1520/EEPROMWrite.inc new file mode 100644 index 00000000..6803eef0 --- /dev/null +++ b/asm/non_matching/code_080B1520/EEPROMWrite.inc @@ -0,0 +1,192 @@ + + .syntax unified + .text + + push {r4, r5, r6, r7, lr} + sub sp, #0xb0 + adds r5, r1, #0 + lsls r0, r0, #0x10 + lsrs r1, r0, #0x10 + lsls r2, r2, #0x18 + lsrs r7, r2, #0x18 + ldr r0, _080B16C8 @ =gEEPROMConfig + ldr r0, [r0] + ldrh r0, [r0, #4] + cmp r1, r0 + blo _080B16D0 + ldr r0, _080B16CC @ =0x000080FF + b _080B1804 + .align 2, 0 +_080B16C8: .4byte gEEPROMConfig +_080B16CC: .4byte 0x000080FF +_080B16D0: + ldr r0, _080B1710 @ =gEEPROMConfig + ldr r0, [r0] + ldrb r0, [r0, #8] + lsls r0, r0, #1 + mov r2, sp + adds r3, r0, r2 + adds r3, #0x84 + movs r0, #0 + strh r0, [r3] + subs r3, #2 + movs r4, #0 +_080B16E6: + ldrh r2, [r5] + adds r5, #2 + movs r0, #0 +_080B16EC: + strh r2, [r3] + subs r3, #2 + lsrs r2, r2, #1 + adds r0, #1 + lsls r0, r0, #0x18 + lsrs r0, r0, #0x18 + cmp r0, #0xf + bls _080B16EC + adds r0, r4, #1 + lsls r0, r0, #0x18 + lsrs r4, r0, #0x18 + cmp r4, #3 + bls _080B16E6 + movs r4, #0 + ldr r0, _080B1710 @ =gEEPROMConfig + adds r2, r0, #0 + ldr r0, [r0] + b _080B1722 + .align 2, 0 +_080B1710: .4byte gEEPROMConfig +_080B1714: + strh r1, [r3] + subs r3, #2 + lsrs r1, r1, #1 + adds r0, r4, #1 + lsls r0, r0, #0x18 + lsrs r4, r0, #0x18 + ldr r0, [r2] +_080B1722: + ldrb r0, [r0, #8] + cmp r4, r0 + blo _080B1714 + movs r0, #0 + strh r0, [r3] + subs r3, #2 + movs r6, #1 + strh r6, [r3] + movs r4, #0xd0 + lsls r4, r4, #0x14 + ldr r0, _080B1794 @ =gEEPROMConfig + ldr r0, [r0] + ldrb r2, [r0, #8] + adds r2, #0x43 + mov r0, sp + adds r1, r4, #0 + bl DMA3Transfer + movs r5, #0 + add r2, sp, #0xa4 + strh r5, [r2] + mov r1, sp + adds r1, #0xa6 + ldr r0, _080B1798 @ =0x04000006 + ldrh r0, [r0] + strh r0, [r1] + add r0, sp, #0xac + str r5, [r0] + ldrh r0, [r2] + cmp r0, #0 + bne _080B1768 + ldrh r0, [r4] + ands r0, r6 + cmp r0, #0 + bne _080B17F8 +_080B1768: + add r3, sp, #0xa8 + ldr r0, _080B1798 @ =0x04000006 + ldrh r0, [r0] + strh r0, [r3] + mov r4, sp + adds r4, #0xa6 + ldrh r1, [r3] + ldrh r0, [r4] + cmp r1, r0 + beq _080B17E2 + ldrh r1, [r3] + ldrh r0, [r4] + cmp r1, r0 + bls _080B179C + add r2, sp, #0xac + ldrh r1, [r3] + ldrh r0, [r4] + subs r1, r1, r0 + ldr r0, [r2] + adds r1, r1, r0 + str r1, [r2] + b _080B17B2 + .align 2, 0 +_080B1794: .4byte gEEPROMConfig +_080B1798: .4byte 0x04000006 +_080B179C: + add r2, sp, #0xac + add r0, sp, #0xa8 + ldrh r0, [r0] + adds r0, #0xe4 + mov r1, sp + adds r1, #0xa6 + ldrh r1, [r1] + subs r0, r0, r1 + ldr r1, [r2] + adds r0, r0, r1 + str r0, [r2] +_080B17B2: + add r0, sp, #0xac + ldr r0, [r0] + cmp r0, #0x88 + bls _080B17D8 + add r0, sp, #0xa4 + ldrh r0, [r0] + cmp r0, #0 + bne _080B1802 + movs r0, #0xd0 + lsls r0, r0, #0x14 + ldrh r0, [r0] + movs r1, #1 + ands r0, r1 + cmp r0, #0 + bne _080B1802 + ldr r5, _080B17D4 @ =0x0000C001 + b _080B1802 + .align 2, 0 +_080B17D4: .4byte 0x0000C001 +_080B17D8: + mov r0, sp + adds r0, #0xa6 + add r1, sp, #0xa8 + ldrh r1, [r1] + strh r1, [r0] +_080B17E2: + add r2, sp, #0xa4 + ldrh r0, [r2] + cmp r0, #0 + bne _080B1768 + movs r0, #0xd0 + lsls r0, r0, #0x14 + movs r1, #1 + ldrh r0, [r0] + ands r1, r0 + cmp r1, #0 + beq _080B1768 +_080B17F8: + ldrh r0, [r2] + adds r0, #1 + strh r0, [r2] + cmp r7, #0 + bne _080B1768 +_080B1802: + adds r0, r5, #0 +_080B1804: + add sp, #0xb0 + pop {r4, r5, r6, r7} + pop {r1} + bx r1 + + .syntax divided diff --git a/asm/non_matching/ezloCap/sub_0806D8A0.inc b/asm/non_matching/ezloCap/sub_0806D8A0.inc deleted file mode 100644 index 64c18349..00000000 --- a/asm/non_matching/ezloCap/sub_0806D8A0.inc +++ /dev/null @@ -1,55 +0,0 @@ - .syntax unified - - .text - - push {r4, r5, lr} - adds r4, r0, #0 - adds r3, r1, #0 - movs r2, #0 - movs r0, #8 - strb r0, [r3, #0x19] - ldr r0, [r3, #8] - movs r1, #2 - orrs r0, r1 - str r0, [r3, #8] - str r2, [r3, #0x14] - movs r2, #0x10 - ldrb r0, [r4, #0x18] - lsls r0, r0, #0x19 - cmp r0, #0 - bge _0806D8C2 - rsbs r2, r2, #0 -_0806D8C2: - ldr r1, _0806D900 @ =gPlayerEntity - movs r5, #0x2e - ldrsh r0, [r1, r5] - adds r2, r2, r0 - movs r0, #0x32 - ldrsh r1, [r1, r0] - adds r1, #2 - strh r2, [r3, #0x1e] - strh r1, [r3, #0x22] - movs r3, #0x2e - ldrsh r0, [r4, r3] - subs r2, r2, r0 - movs r5, #0x32 - ldrsh r0, [r4, r5] - subs r1, r1, r0 - adds r0, r2, #0 - bl sub_080045DA - strb r0, [r4, #0x15] - ldrb r2, [r4, #0x14] - movs r1, #0x80 - ands r1, r2 - ldr r2, _0806D904 @ =gUnk_08114134 - lsls r0, r0, #0x18 - lsrs r0, r0, #0x1c - adds r0, r0, r2 - ldrb r0, [r0] - orrs r1, r0 - strb r1, [r4, #0x14] - pop {r4, r5, pc} - .align 2, 0 -_0806D900: .4byte gPlayerEntity -_0806D904: .4byte gUnk_08114134 - .syntax divided diff --git a/asm/non_matching/ezloCap/sub_0806D908.inc b/asm/non_matching/ezloCap/sub_0806D908.inc deleted file mode 100644 index d8e1a399..00000000 --- a/asm/non_matching/ezloCap/sub_0806D908.inc +++ /dev/null @@ -1,32 +0,0 @@ - .syntax unified - - .text - - push {r4, r5, lr} - adds r4, r0, #0 - movs r1, #0x2e - ldrsh r0, [r4, r1] - movs r2, #0x32 - ldrsh r1, [r4, r2] - ldr r3, _0806D93C @ =gPlayerEntity - movs r5, #0x2e - ldrsh r2, [r3, r5] - movs r5, #0x32 - ldrsh r3, [r3, r5] - bl sub_080045D4 - strb r0, [r4, #0x15] - ldrb r2, [r4, #0x14] - movs r1, #0x80 - ands r1, r2 - ldr r2, _0806D940 @ =gUnk_08114144 - lsls r0, r0, #0x18 - lsrs r0, r0, #0x19 - adds r0, r0, r2 - ldrb r0, [r0] - orrs r1, r0 - strb r1, [r4, #0x14] - pop {r4, r5, pc} - .align 2, 0 -_0806D93C: .4byte gPlayerEntity -_0806D940: .4byte gUnk_08114144 - .syntax divided diff --git a/asm/non_matching/ezloCap/sub_0806DA04.inc b/asm/non_matching/ezloCap/sub_0806DA04.inc deleted file mode 100644 index 4b0ae7b6..00000000 --- a/asm/non_matching/ezloCap/sub_0806DA04.inc +++ /dev/null @@ -1,15 +0,0 @@ - .syntax unified - .text - - push {lr} - ldr r3, [r1, #4] - lsls r3, r3, #3 - ldr r1, _0806DA18 @ =gUnk_0811415C - adds r3, r3, r1 - ldrb r2, [r3, #4] - movs r1, #1 - bl sub_08078850 - pop {pc} - .align 2, 0 -_0806DA18: .4byte gUnk_0811415C - .syntax divided \ No newline at end of file diff --git a/asm/non_matching/fileScreen/sub_08050EF4.inc b/asm/non_matching/fileScreen/sub_08050EF4.inc index 1ef73ae0..dbad9f1e 100644 --- a/asm/non_matching/fileScreen/sub_08050EF4.inc +++ b/asm/non_matching/fileScreen/sub_08050EF4.inc @@ -135,4 +135,4 @@ _08050FF4: mov r8, r3 pop {r4, r5, r6, r7, pc} .align 2, 0 - .syntax divided \ No newline at end of file + .syntax divided diff --git a/asm/non_matching/fileScreen/sub_08051738.inc b/asm/non_matching/fileScreen/sub_08051738.inc index bde5ca42..16ca61e3 100644 --- a/asm/non_matching/fileScreen/sub_08051738.inc +++ b/asm/non_matching/fileScreen/sub_08051738.inc @@ -62,4 +62,4 @@ _080517A2: pop {r4, r5, r6, r7, pc} .align 2, 0 _080517B0: .4byte gMenu - .syntax divided \ No newline at end of file + .syntax divided diff --git a/asm/non_matching/fileScreen/sub_080517B4.inc b/asm/non_matching/fileScreen/sub_080517B4.inc index 45bc25e3..f9bef9e7 100644 --- a/asm/non_matching/fileScreen/sub_080517B4.inc +++ b/asm/non_matching/fileScreen/sub_080517B4.inc @@ -29,4 +29,4 @@ _080517DE: .align 2, 0 _080517E4: .4byte gUnk_02019EE0 _080517E8: .4byte gUnk_02000090 - .syntax divided \ No newline at end of file + .syntax divided diff --git a/asm/non_matching/fileScreen/sub_080610B8.inc b/asm/non_matching/fileScreen/sub_080610B8.inc index f7b6721c..037a8765 100644 --- a/asm/non_matching/fileScreen/sub_080610B8.inc +++ b/asm/non_matching/fileScreen/sub_080610B8.inc @@ -345,4 +345,4 @@ _0805134C: .align 2, 0 _08051350: .4byte gSave _08051354: .4byte gMenu - .syntax divided \ No newline at end of file + .syntax divided diff --git a/asm/non_matching/game/sub_08052418.inc b/asm/non_matching/game/sub_08052418.inc index 179cce1d..bd30db21 100644 --- a/asm/non_matching/game/sub_08052418.inc +++ b/asm/non_matching/game/sub_08052418.inc @@ -6,7 +6,7 @@ ldr r0, _08052494 @ =gBG1Buffer movs r1, #0x80 lsls r1, r1, #4 - bl MemClear32 + bl MemClear ldr r0, _08052498 @ =gUnk_020227E8 movs r1, #0xf str r1, [r0] @@ -63,4 +63,4 @@ _08052498: .4byte gUnk_020227E8 _0805249C: .4byte gUnk_080FCA8C _080524A0: .4byte gUnk_080FCAA4 _080524A4: .4byte gScreen - .syntax divided \ No newline at end of file + .syntax divided diff --git a/asm/non_matching/gibdo/sub_080376D0.inc b/asm/non_matching/gibdo/sub_080376D0.inc index c6c76bd6..8c07e3dc 100644 --- a/asm/non_matching/gibdo/sub_080376D0.inc +++ b/asm/non_matching/gibdo/sub_080376D0.inc @@ -54,4 +54,4 @@ _0803772C: _0803773A: pop {r4, pc} - .syntax divided \ No newline at end of file + .syntax divided diff --git a/asm/non_matching/gibdo/sub_08037810.inc b/asm/non_matching/gibdo/sub_08037810.inc index 42f4ed8c..b4ce2803 100644 --- a/asm/non_matching/gibdo/sub_08037810.inc +++ b/asm/non_matching/gibdo/sub_08037810.inc @@ -83,4 +83,4 @@ _080378AC: _080378AE: pop {r4, r5, r6, pc} - .syntax divided \ No newline at end of file + .syntax divided diff --git a/asm/non_matching/gibdo/sub_0803797C.inc b/asm/non_matching/gibdo/sub_0803797C.inc index 47da634a..4e0ecf7a 100644 --- a/asm/non_matching/gibdo/sub_0803797C.inc +++ b/asm/non_matching/gibdo/sub_0803797C.inc @@ -36,4 +36,4 @@ _080379BA: pop {r4, r5, pc} - .syntax divided \ No newline at end of file + .syntax divided diff --git a/asm/non_matching/player/sub_08071634.s b/asm/non_matching/player/sub_08071634.s new file mode 100644 index 00000000..3c377521 --- /dev/null +++ b/asm/non_matching/player/sub_08071634.s @@ -0,0 +1,172 @@ + .syntax unified + push {r4, r5, r6, r7, lr} + mov r7, r8 + push {r7} + adds r5, r0, #0 + adds r0, #0x81 + ldrb r0, [r0] + cmp r0, #0 + beq _08071654 + adds r1, r5, #0 + adds r1, #0x80 + ldr r0, [r1] + adds r0, #0x80 + lsls r0, r0, #0x14 + lsrs r7, r0, #0x17 + adds r4, r1, #0 + b _0807166A +_08071654: + adds r4, r5, #0 + adds r4, #0x80 + ldrb r1, [r4] + lsrs r1, r1, #6 + movs r0, #3 + eors r1, r0 + adds r1, #1 + movs r0, #0x10 + bl __divsi3 + asrs r7, r0, #1 +_0807166A: + adds r0, r5, #0 + adds r0, #0x84 + ldr r3, [r0] + movs r1, #0x80 + lsls r1, r1, #1 + adds r2, r0, #0 + cmp r3, r1 + bls _08071684 + adds r0, r3, #0 + adds r0, #0x80 + lsls r0, r0, #0x14 + lsrs r3, r0, #0x17 + b _08071694 +_08071684: + cmp r3, r1 + bne _0807168C + movs r3, #0x10 + b _08071694 +_0807168C: + ldr r1, _080716B0 @ =gUnk_0811BABC + lsrs r0, r3, #5 + adds r0, r0, r1 + ldrb r3, [r0] +_08071694: + movs r0, #0x80 + lsls r0, r0, #9 + mov r8, r0 + adds r0, r5, #0 + adds r0, #0x5a + ldrb r0, [r0] + cmp r0, #2 + beq _080716EA + cmp r0, #2 + bgt _080716B4 + cmp r0, #1 + beq _080716BA + b _08071754 + .align 2, 0 +_080716B0: .4byte gUnk_0811BABC +_080716B4: + cmp r0, #3 + beq _0807171E + b _08071754 +_080716BA: + movs r1, #0x29 + adds r1, r1, r5 + mov ip, r1 + ldrb r1, [r1] + movs r0, #0x39 + rsbs r0, r0, #0 + ands r0, r1 + mov r1, ip + strb r0, [r1] + ldr r0, [r4] + cmp r0, #0x80 + bls _080716D6 + subs r0, r0, r7 + str r0, [r4] +_080716D6: + lsls r1, r3, #1 + ldr r0, [r2] + adds r0, r0, r1 + str r0, [r2] + mov r0, r8 + lsls r1, r0, #1 + ldr r0, [r5, #0x30] + adds r0, r0, r1 + str r0, [r5, #0x30] + b _08071754 +_080716EA: + ldr r0, [r4] + adds r0, r0, r7 + str r0, [r4] + ldr r1, [r2] + movs r6, #0x80 + lsls r6, r6, #1 + cmp r1, r6 + bls _08071710 + ldr r0, _0807170C @ =0x0000017F + cmp r1, r0 + bhi _08071702 + lsrs r3, r3, #1 +_08071702: + subs r0, r1, r3 + cmp r0, #0xff + bhi _08071716 + str r6, [r2] + b _08071718 + .align 2, 0 +_0807170C: .4byte 0x0000017F +_08071710: + cmp r1, #0x80 + bls _08071718 + subs r0, r1, r3 +_08071716: + str r0, [r2] +_08071718: + ldr r0, [r5, #0x34] + mov r1, r8 + b _08071750 +_0807171E: + ldr r0, [r4] + ldr r6, _08071740 @ =0x0000033F + cmp r0, r6 + bhi _0807172A + adds r0, r0, r7 + str r0, [r4] +_0807172A: + ldr r1, [r2] + cmp r1, r6 + bls _08071744 + movs r0, #8 + strb r0, [r5, #0xe] + movs r0, #0x1e + strb r0, [r5, #0xf] + movs r0, #6 + strb r0, [r5, #0xd] + b _0807174A + .align 2, 0 +_08071740: .4byte 0x0000033F +_08071744: + lsls r0, r3, #1 + adds r0, r1, r0 + str r0, [r2] +_0807174A: + mov r0, r8 + lsls r1, r0, #1 + ldr r0, [r5, #0x34] +_08071750: + subs r0, r0, r1 + str r0, [r5, #0x34] +_08071754: + ldr r1, [r4] + ldr r2, [r2] + adds r0, r5, #0 + movs r3, #0 + bl sub_0805EC9C + adds r0, r5, #0 + bl UpdateAnimationSingleFrame + pop {r3} + mov r8, r3 + pop {r4, r5, r6, r7, pc} + .syntax divided diff --git a/asm/non_matching/save/sub_08050B3C.inc b/asm/non_matching/save/sub_08050B3C.inc index a3b5b6b3..356b8a6c 100644 --- a/asm/non_matching/save/sub_08050B3C.inc +++ b/asm/non_matching/save/sub_08050B3C.inc @@ -122,4 +122,4 @@ _08050C1C: .4byte 0x0000F24C _08050C20: .4byte 0x040000D4 _08050C24: .4byte gUnk_080FC914 _08050C28: .4byte 0xFFFFF24D - .syntax divided \ No newline at end of file + .syntax divided diff --git a/asm/non_matching/save/sub_0807D008.inc b/asm/non_matching/save/sub_0807D008.inc deleted file mode 100644 index d5d00ffd..00000000 --- a/asm/non_matching/save/sub_0807D008.inc +++ /dev/null @@ -1,81 +0,0 @@ - - .syntax unified - - .text - - push {r4, r5, r6, r7, lr} - mov r7, r8 - push {r7} - sub sp, #0xc - adds r7, r1, #0 - bl sub_0807D1C4 - adds r5, r0, #0 - ldrh r0, [r5, #2] - add r4, sp, #4 - adds r1, r4, #0 - bl sub_0807D0EC - adds r6, r0, #0 - mov r8, r4 - cmp r6, #2 - bne _0807D048 - ldrh r0, [r5, #6] - ldrh r2, [r5] - adds r1, r7, #0 - bl sub_0807D1D8 - cmp r0, #0 - beq _0807D046 - ldrh r2, [r5] - mov r0, r8 - adds r1, r7, #0 - bl sub_0807D0A0 - cmp r0, #0 - bne _0807D072 -_0807D046: - movs r6, #0 -_0807D048: - ldrh r0, [r5, #4] - mov r1, r8 - bl sub_0807D0EC - adds r4, r0, #0 - cmp r4, #2 - bne _0807D078 - ldrh r0, [r5, #8] - ldrh r2, [r5] - adds r1, r7, #0 - bl sub_0807D1D8 - cmp r0, #0 - beq _0807D076 - ldrh r2, [r5] - mov r0, r8 - adds r1, r7, #0 - bl sub_0807D0A0 - cmp r0, #0 - beq _0807D076 -_0807D072: - movs r0, #1 - b _0807D098 -_0807D076: - movs r4, #0 -_0807D078: - movs r0, #0 - str r0, [sp] - ldrh r2, [r5] - lsrs r2, r2, #2 - movs r0, #0xa0 - lsls r0, r0, #0x13 - orrs r2, r0 - mov r0, sp - adds r1, r7, #0 - bl CpuSet - orrs r6, r4 - movs r0, #0 - cmp r6, #0 - bne _0807D098 - subs r0, #1 -_0807D098: - add sp, #0xc - pop {r3} - mov r8, r3 - pop {r4, r5, r6, r7, pc} - - .syntax divided diff --git a/asm/non_matching/save/sub_0807D0A0.inc b/asm/non_matching/save/sub_0807D0A0.inc deleted file mode 100644 index 9bec41a8..00000000 --- a/asm/non_matching/save/sub_0807D0A0.inc +++ /dev/null @@ -1,45 +0,0 @@ - - .syntax unified - - .text - - push {r4, r5, r6, r7, lr} - adds r7, r0, #0 - adds r5, r1, #0 - adds r6, r2, #0 - adds r0, r7, #4 - movs r1, #4 - bl sub_0807D1A4 - adds r4, r0, #0 - lsls r4, r4, #0x10 - lsrs r4, r4, #0x10 - adds r0, r5, #0 - adds r1, r6, #0 - bl sub_0807D1A4 - adds r4, r4, r0 - lsls r4, r4, #0x10 - lsrs r4, r4, #0x10 - ldrh r0, [r7] - cmp r0, r4 - bne _0807D0DE - lsls r0, r0, #0x10 - ldrh r1, [r7, #2] - rsbs r0, r0, #0 - lsrs r0, r0, #0x10 - cmp r1, r0 - bne _0807D0DE - ldr r1, [r7, #4] - ldr r0, _0807D0E4 @ =0x4D435A33 - cmp r1, r0 - beq _0807D0E8 -_0807D0DE: - movs r0, #0 - b _0807D0EA - .align 2, 0 -_0807D0E4: .4byte 0x4D435A33 -_0807D0E8: - movs r0, #1 -_0807D0EA: - pop {r4, r5, r6, r7, pc} - - .syntax divided diff --git a/asm/non_matching/save/sub_0807D1D8.inc b/asm/non_matching/save/sub_0807D1D8.inc deleted file mode 100644 index f9b81bde..00000000 --- a/asm/non_matching/save/sub_0807D1D8.inc +++ /dev/null @@ -1,36 +0,0 @@ - - .syntax unified - - .text - - push {r4, r5, r6, lr} - adds r5, r0, #0 - adds r6, r1, #0 - lsrs r4, r2, #3 - adds r0, r4, #0 - lsrs r5, r5, #3 - b _0807D200 -_0807D1E6: - lsls r0, r5, #0x10 - lsrs r0, r0, #0x10 - adds r1, r6, #0 - bl sub_080B15E8 - lsls r0, r0, #0x10 - cmp r0, #0 - beq _0807D1FA - movs r0, #0 - b _0807D208 -_0807D1FA: - adds r5, #1 - adds r6, #8 - adds r0, r4, #0 -_0807D200: - subs r4, #1 - cmp r0, #0 - bne _0807D1E6 - movs r0, #1 -_0807D208: - pop {r4, r5, r6, pc} - .align 2, 0 - - .syntax divided diff --git a/asm/non_matching/save/sub_0807D20C.inc b/asm/non_matching/save/sub_0807D20C.inc deleted file mode 100644 index 954ad823..00000000 --- a/asm/non_matching/save/sub_0807D20C.inc +++ /dev/null @@ -1,41 +0,0 @@ - - .syntax unified - - .text - - push {r4, r5, r6, r7, lr} - adds r6, r0, #0 - adds r7, r1, #0 - lsrs r5, r2, #3 - adds r0, r5, #0 - lsrs r6, r6, #3 - b _0807D242 -_0807D21A: - lsls r0, r6, #0x10 - lsrs r4, r0, #0x10 - adds r0, r4, #0 - adds r1, r7, #0 - bl sub_080B18DC - lsls r0, r0, #0x10 - cmp r0, #0 - beq _0807D23C - adds r0, r4, #0 - ldr r1, _0807D238 @ =gUnk_0811E4B4 - bl sub_080B18DC - movs r0, #0 - b _0807D24A - .align 2, 0 -_0807D238: .4byte gUnk_0811E4B4 -_0807D23C: - adds r6, #1 - adds r7, #8 - adds r0, r5, #0 -_0807D242: - subs r5, #1 - cmp r0, #0 - bne _0807D21A - movs r0, #1 -_0807D24A: - pop {r4, r5, r6, r7, pc} - - .syntax divided diff --git a/asm/non_matching/save/sub_0807D24C.inc b/asm/non_matching/save/sub_0807D24C.inc deleted file mode 100644 index 7761d787..00000000 --- a/asm/non_matching/save/sub_0807D24C.inc +++ /dev/null @@ -1,36 +0,0 @@ - - .syntax unified - - .text - - push {r4, r5, r6, lr} - adds r5, r0, #0 - adds r6, r1, #0 - lsrs r4, r2, #3 - adds r0, r4, #0 - lsrs r5, r5, #3 - b _0807D274 -_0807D25A: - lsls r0, r5, #0x10 - lsrs r0, r0, #0x10 - adds r1, r6, #0 - bl sub_080B180C - lsls r0, r0, #0x10 - cmp r0, #0 - beq _0807D26E - movs r0, #0 - b _0807D27C -_0807D26E: - adds r5, #1 - adds r6, #8 - adds r0, r4, #0 -_0807D274: - subs r4, #1 - cmp r0, #0 - bne _0807D25A - movs r0, #1 -_0807D27C: - pop {r4, r5, r6, pc} - .align 2, 0 - - .syntax divided diff --git a/asm/non_matching/sub_080560B8.inc b/asm/non_matching/sub_080560B8.inc index 68ee7bcd..73872d2a 100644 --- a/asm/non_matching/sub_080560B8.inc +++ b/asm/non_matching/sub_080560B8.inc @@ -12,7 +12,7 @@ bne _080560F8 movs r0, #0x80 lsls r0, r0, #0x12 - bl sub_0807CF30 + bl Read_02000000 adds r1, r0, #0 movs r0, #1 rsbs r0, r0, #0 @@ -33,7 +33,7 @@ _080560E4: movs r2, #0x10 bl MemCopy adds r0, r4, #0 - bl sub_0807CF10 + bl Write_02000000 _080560F8: ldr r2, _0805612C @ =gUnk_02000010 ldr r1, [r2] @@ -54,7 +54,7 @@ _08056112: ldr r4, _0805612C @ =gUnk_02000010 adds r0, r4, #0 movs r1, #0x20 - bl MemClear32 + bl MemClear ldr r0, _08056130 @ =0x4D435A33 str r0, [r4] _08056124: diff --git a/asm/non_matching/textbox/sub_080564EC.inc b/asm/non_matching/textbox/sub_080564EC.inc index 4c3fdf84..e76e5fa6 100644 --- a/asm/non_matching/textbox/sub_080564EC.inc +++ b/asm/non_matching/textbox/sub_080564EC.inc @@ -2,14 +2,14 @@ push {r4, lr} ldr r0, _08056598 @ =gUnk_02036A40 movs r1, #8 - bl MemClear32 + bl MemClear ldr r0, _0805659C @ =gUnk_02024030 movs r1, #0x18 - bl MemClear32 + bl MemClear ldr r4, _080565A0 @ =gUnk_02022780 adds r0, r4, #0 movs r1, #0xa8 - bl MemClear32 + bl MemClear ldr r0, _080565A4 @ =gTextBox adds r1, r4, #0 movs r2, #0x20 @@ -87,4 +87,4 @@ _080565A4: .4byte gTextBox _080565A8: .4byte gSave _080565AC: .4byte gUnk_08107BE0 _080565B0: .4byte gUnk_02000D00 - .syntax divided \ No newline at end of file + .syntax divided diff --git a/asm/object3D.s b/asm/object3D.s index a6dbf01d..07297cfa 100644 --- a/asm/object3D.s +++ b/asm/object3D.s @@ -170,7 +170,7 @@ sub_0808D030: @ 0x0808D030 adds r0, r4, #0 subs r0, #0x20 ldr r1, _0808D05C @ =0x00000B74 - bl MemClear32 + bl MemClear movs r1, #0xa8 lsls r1, r1, #2 adds r0, r1, #0 diff --git a/asm/object3E.s b/asm/object3E.s index 87dc86a0..ee4b5d42 100644 --- a/asm/object3E.s +++ b/asm/object3E.s @@ -247,7 +247,7 @@ sub_0808D280: @ 0x0808D280 movs r1, #0x3e movs r2, #6 movs r3, #9 - bl FindEntityInListByForm + bl FindEntity adds r2, r0, #0 cmp r2, #0 beq _0808D2C4 @@ -287,7 +287,7 @@ sub_0808D2CC: @ 0x0808D2CC movs r1, #0x3e movs r2, #6 movs r3, #1 - bl FindEntityInListByForm + bl FindEntity adds r1, r0, #0 cmp r1, #0 beq _0808D2F2 @@ -328,9 +328,9 @@ _0808D31C: ldrsh r5, [r4, r0] adds r0, r4, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity adds r0, r4, #0 - bl sub_0807DDE4 + bl HandleEntity0x82Actions ldr r0, _0808D354 @ =gRoomControls ldrh r0, [r0, #0x16] cmp r0, #0 @@ -375,9 +375,9 @@ sub_0808D360: @ 0x0808D360 _0808D382: adds r0, r4, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity adds r0, r4, #0 - bl sub_0807DDE4 + bl HandleEntity0x82Actions pop {r4, pc} .align 2, 0 diff --git a/asm/object5B.s b/asm/object5B.s index 5cd3f85a..a80ba72b 100644 --- a/asm/object5B.s +++ b/asm/object5B.s @@ -116,7 +116,7 @@ sub_08092940: @ 0x08092940 adds r5, r4, #0 adds r5, #0x84 ldr r1, [r5] - bl ExecuteScriptCommandSet + bl ExecuteScript ldr r1, [r5] adds r0, r4, #0 bl sub_08092958 diff --git a/asm/object6.s b/asm/object6.s index 2f89320b..af416ed0 100644 --- a/asm/object6.s +++ b/asm/object6.s @@ -426,7 +426,7 @@ sub_08082B9C: @ 0x08082B9C adds r4, #0x84 ldr r1, [r4] adds r0, r6, #0 - bl ExecuteScriptCommandSet + bl ExecuteScript ldr r1, [r4] adds r0, r6, #0 bl sub_08082D20 @@ -451,7 +451,7 @@ sub_08082C38: @ 0x08082C38 adds r4, r5, #0 adds r4, #0x84 ldr r1, [r4] - bl ExecuteScriptCommandSet + bl ExecuteScript ldr r1, [r4] adds r0, r5, #0 bl sub_08082D20 @@ -705,7 +705,7 @@ sub_08082E14: @ 0x08082E14 adds r0, #0x84 ldr r1, [r0] adds r0, r4, #0 - bl ExecuteScriptCommandSet + bl ExecuteScript movs r1, #0xc0 lsls r1, r1, #5 adds r0, r4, #0 @@ -730,7 +730,7 @@ _08082E44: rsbs r0, r0, #0 cmp r1, r0 ble _08082E5E - ldr r0, _08082E68 @ =gUnk_02033280 + ldr r0, _08082E68 @ =gActiveScriptInfo ldr r1, [r0] movs r2, #2 orrs r1, r2 @@ -741,7 +741,7 @@ _08082E5E: bl UpdateAnimationSingleFrame pop {r4, pc} .align 2, 0 -_08082E68: .4byte gUnk_02033280 +_08082E68: .4byte gActiveScriptInfo thumb_func_start sub_08082E6C sub_08082E6C: @ 0x08082E6C diff --git a/asm/object6A.s b/asm/object6A.s index f6cde33d..fb464dcb 100644 --- a/asm/object6A.s +++ b/asm/object6A.s @@ -37,9 +37,9 @@ sub_08094A5C: @ 0x08094A5C _08094A78: adds r0, r4, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity adds r0, r4, #0 - bl sub_0807DDE4 + bl HandleEntity0x82Actions adds r0, r4, #0 bl GetNextFrame pop {r4, pc} @@ -78,9 +78,9 @@ sub_08094A90: @ 0x08094A90 _08094ACE: adds r0, r4, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity adds r0, r4, #0 - bl sub_0807DDE4 + bl HandleEntity0x82Actions adds r0, r4, #0 bl UpdateAnimationSingleFrame pop {r4, pc} @@ -127,12 +127,12 @@ sub_08094B0C: @ 0x08094B0C .align 2, 0 _08094B2C: .4byte 0x0000FFE0 _08094B30: - ldr r0, _08094B38 @ =gUnk_02033280 + ldr r0, _08094B38 @ =gActiveScriptInfo strb r3, [r0, #6] _08094B34: pop {pc} .align 2, 0 -_08094B38: .4byte gUnk_02033280 +_08094B38: .4byte gActiveScriptInfo thumb_func_start sub_08094B3C sub_08094B3C: @ 0x08094B3C @@ -155,13 +155,13 @@ sub_08094B3C: @ 0x08094B3C .align 2, 0 _08094B5C: .4byte 0x0000FFF3 _08094B60: - ldr r1, _08094B68 @ =gUnk_02033280 + ldr r1, _08094B68 @ =gActiveScriptInfo movs r0, #0 strb r0, [r1, #6] _08094B66: pop {pc} .align 2, 0 -_08094B68: .4byte gUnk_02033280 +_08094B68: .4byte gActiveScriptInfo thumb_func_start sub_08094B6C sub_08094B6C: @ 0x08094B6C @@ -204,7 +204,7 @@ sub_08094B94: @ 0x08094B94 bl CopyPosition ldr r0, _08094BD8 @ =0x0000FFD0 strh r0, [r4, #0x36] - ldr r1, _08094BDC @ =gUnk_0800AEDC + ldr r1, _08094BDC @ =script_0800AEDC adds r0, r4, #0 bl StartCutscene adds r1, r4, #0 @@ -223,7 +223,7 @@ _08094BD2: .align 2, 0 _08094BD4: .4byte gPlayerEntity _08094BD8: .4byte 0x0000FFD0 -_08094BDC: .4byte gUnk_0800AEDC +_08094BDC: .4byte script_0800AEDC thumb_func_start sub_08094BE0 sub_08094BE0: @ 0x08094BE0 @@ -235,7 +235,7 @@ sub_08094BE0: @ 0x08094BE0 movs r1, #0x6a movs r2, #6 movs r3, #0x22 - bl FindEntityInListByForm + bl FindEntity adds r4, r0, #0 cmp r4, #0 beq _08094C22 @@ -390,7 +390,7 @@ sub_08094D10: @ 0x08094D10 movs r1, #0x6a movs r2, #6 movs r3, #3 - bl FindEntityInListByForm + bl FindEntity adds r1, r0, #0 cmp r1, #0 beq _08094D2E @@ -442,7 +442,7 @@ sub_08094D70: @ 0x08094D70 movs r1, #0x6a movs r2, #6 movs r3, #0x15 - bl FindEntityInListByForm + bl FindEntity adds r1, r0, #0 cmp r1, #0 beq _08094D8E @@ -527,7 +527,7 @@ sub_08094E0C: @ 0x08094E0C movs r1, #0x6a movs r2, #6 movs r3, #4 - bl FindEntityInListByForm + bl FindEntity adds r1, r0, #0 cmp r1, #0 beq _08094E2A @@ -933,9 +933,9 @@ sub_08095120: @ 0x08095120 _0809514C: adds r0, r4, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity adds r0, r4, #0 - bl sub_0807DDE4 + bl HandleEntity0x82Actions adds r0, r4, #0 bl UpdateAnimationSingleFrame pop {r4, pc} @@ -951,7 +951,7 @@ sub_08095164: @ 0x08095164 movs r1, #0x6a movs r2, #6 movs r3, #8 - bl FindEntityInListByForm + bl FindEntity cmp r0, #0 beq _08095182 movs r1, #3 @@ -984,9 +984,9 @@ sub_08095188: @ 0x08095188 _080951B4: adds r0, r4, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity adds r0, r4, #0 - bl sub_0807DDE4 + bl HandleEntity0x82Actions pop {r4, pc} thumb_func_start sub_080951C4 @@ -1010,9 +1010,9 @@ sub_080951C4: @ 0x080951C4 _080951E8: adds r0, r4, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity adds r0, r4, #0 - bl sub_0807DDE4 + bl HandleEntity0x82Actions adds r0, r4, #0 bl GetNextFrame movs r1, #0x36 @@ -1073,7 +1073,7 @@ sub_08095244: @ 0x08095244 adds r0, r5, #0 adds r1, r4, #0 bl PositionRelative - ldr r1, _08095284 @ =gUnk_0801183C + ldr r1, _08095284 @ =script_0801183C adds r0, r4, #0 bl StartCutscene adds r1, r4, #0 @@ -1083,7 +1083,7 @@ _0809527C: pop {r4, r5, pc} .align 2, 0 _08095280: .4byte 0xFFF00000 -_08095284: .4byte gUnk_0801183C +_08095284: .4byte script_0801183C thumb_func_start sub_08095288 sub_08095288: @ 0x08095288 @@ -1261,9 +1261,9 @@ sub_080953A4: @ 0x080953A4 _080953E0: adds r0, r4, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity adds r0, r4, #0 - bl sub_0807DDE4 + bl HandleEntity0x82Actions adds r0, r4, #0 bl GetNextFrame ldrb r0, [r4, #0xa] @@ -1374,7 +1374,7 @@ sub_080954AC: @ 0x080954AC adds r0, r5, #0 adds r1, r4, #0 bl CopyPosition - ldr r1, _080954D8 @ =gUnk_08015B14 + ldr r1, _080954D8 @ =script_08015B14 adds r0, r4, #0 bl StartCutscene adds r1, r4, #0 @@ -1383,7 +1383,7 @@ sub_080954AC: @ 0x080954AC _080954D6: pop {r4, r5, pc} .align 2, 0 -_080954D8: .4byte gUnk_08015B14 +_080954D8: .4byte script_08015B14 thumb_func_start sub_080954DC sub_080954DC: @ 0x080954DC @@ -1588,9 +1588,9 @@ _08095664: strb r0, [r4, #0x18] adds r0, r4, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity adds r0, r4, #0 - bl sub_0807DDE4 + bl HandleEntity0x82Actions adds r0, r4, #0 bl GetNextFrame pop {r4, r5, pc} @@ -1795,9 +1795,9 @@ sub_080957DC: @ 0x080957DC _080957F8: adds r0, r4, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity adds r0, r4, #0 - bl sub_0807DDE4 + bl HandleEntity0x82Actions adds r0, r4, #0 bl UpdateAnimationSingleFrame pop {r4, pc} @@ -1821,7 +1821,7 @@ sub_08095810: @ 0x08095810 adds r0, r5, #0 adds r1, r4, #0 bl ResolveEntityOnTop - ldr r1, _08095848 @ =gUnk_08011940 + ldr r1, _08095848 @ =script_08011940 adds r0, r4, #0 bl StartCutscene adds r1, r4, #0 @@ -1830,7 +1830,7 @@ sub_08095810: @ 0x08095810 _08095844: pop {r4, r5, pc} .align 2, 0 -_08095848: .4byte gUnk_08011940 +_08095848: .4byte script_08011940 thumb_func_start sub_0809584C sub_0809584C: @ 0x0809584C @@ -1884,9 +1884,9 @@ _08095880: _080958B2: adds r0, r5, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity adds r0, r5, #0 - bl sub_0807DDE4 + bl HandleEntity0x82Actions ldrb r4, [r5, #0xa] movs r0, #0x5c strb r0, [r5, #0xa] @@ -1912,9 +1912,9 @@ sub_080958D8: @ 0x080958D8 _080958EC: adds r0, r4, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity adds r0, r4, #0 - bl sub_0807DDE4 + bl HandleEntity0x82Actions adds r0, r4, #0 bl GetNextFrame adds r0, r4, #0 @@ -1950,9 +1950,9 @@ sub_08095918: @ 0x08095918 _0809593C: adds r0, r4, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity adds r0, r4, #0 - bl sub_0807DDE4 + bl HandleEntity0x82Actions adds r0, r4, #0 bl GetNextFrame pop {r4, pc} @@ -1984,7 +1984,7 @@ sub_08095954: @ 0x08095954 bl PositionRelative ldr r0, _080959B0 @ =0x0000FFFD strh r0, [r4, #0x36] - ldr r1, _080959B4 @ =gUnk_08012C48 + ldr r1, _080959B4 @ =script_08012C48 adds r0, r4, #0 bl StartCutscene adds r1, r4, #0 @@ -2003,9 +2003,9 @@ sub_08095954: @ 0x08095954 .align 2, 0 _080959AC: .4byte gUnk_08122AF8 _080959B0: .4byte 0x0000FFFD -_080959B4: .4byte gUnk_08012C48 +_080959B4: .4byte script_08012C48 _080959B8: - ldr r0, _080959C8 @ =gUnk_02033280 + ldr r0, _080959C8 @ =gActiveScriptInfo ldr r1, [r0] movs r2, #0x80 lsls r2, r2, #1 @@ -2014,7 +2014,7 @@ _080959B8: _080959C4: pop {r4, r5, pc} .align 2, 0 -_080959C8: .4byte gUnk_02033280 +_080959C8: .4byte gActiveScriptInfo thumb_func_start sub_080959CC sub_080959CC: @ 0x080959CC @@ -2038,9 +2038,9 @@ sub_080959CC: @ 0x080959CC _080959F2: adds r0, r4, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity adds r0, r4, #0 - bl sub_0807DDE4 + bl HandleEntity0x82Actions adds r0, r4, #0 bl UpdateAnimationSingleFrame adds r0, r4, #0 @@ -2103,7 +2103,7 @@ sub_08095A68: @ 0x08095A68 movs r1, #0x6a movs r2, #6 movs r3, #0x16 - bl FindEntityInListByForm + bl FindEntity adds r1, r0, #0 cmp r1, #0 beq _08095A86 @@ -2146,9 +2146,9 @@ _08095ABC: _08095ACC: adds r0, r4, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity adds r0, r4, #0 - bl sub_0807DDE4 + bl HandleEntity0x82Actions b _08095B44 _08095ADC: ldrb r0, [r4, #0xc] @@ -2455,9 +2455,9 @@ sub_08095CE0: @ 0x08095CE0 _08095D06: adds r0, r4, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity adds r0, r4, #0 - bl sub_0807DDE4 + bl HandleEntity0x82Actions adds r0, r4, #0 bl UpdateAnimationSingleFrame adds r0, r4, #0 @@ -2550,7 +2550,7 @@ _08095DB8: sub_08095DBC: @ 0x08095DBC push {r4, r5, lr} adds r4, r0, #0 - ldr r5, _08095DF0 @ =gUnk_02033280 + ldr r5, _08095DF0 @ =gActiveScriptInfo ldr r0, [r5] movs r1, #0x10 ands r0, r1 @@ -2571,10 +2571,10 @@ _08095DD0: _08095DE6: adds r0, r4, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity b _08095E74 .align 2, 0 -_08095DF0: .4byte gUnk_02033280 +_08095DF0: .4byte gActiveScriptInfo _08095DF4: ldrb r0, [r4, #0xc] cmp r0, #0 @@ -2904,9 +2904,9 @@ sub_08096058: @ 0x08096058 _0809606C: adds r0, r4, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity adds r0, r4, #0 - bl sub_0807DDE4 + bl HandleEntity0x82Actions adds r0, r4, #0 bl GetNextFrame pop {r4, pc} @@ -2929,9 +2929,9 @@ sub_08096084: @ 0x08096084 _080960A0: adds r0, r4, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity adds r0, r4, #0 - bl sub_0807DDE4 + bl HandleEntity0x82Actions adds r0, r4, #0 bl GetNextFrame ldr r0, [r4, #0x50] @@ -3204,9 +3204,9 @@ sub_0809629C: @ 0x0809629C _080962B2: adds r0, r5, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity adds r0, r5, #0 - bl sub_0807DDE4 + bl HandleEntity0x82Actions movs r1, #0x80 lsls r1, r1, #5 adds r0, r5, #0 diff --git a/asm/object87.s b/asm/object87.s index f4bf6ed0..2af555eb 100644 --- a/asm/object87.s +++ b/asm/object87.s @@ -968,13 +968,13 @@ sub_0809A648: @ 0x0809A648 lsls r5, r5, #8 asrs r5, r5, #0x10 adds r1, r5, #0 - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #0x10 asrs r0, r0, #0x10 movs r4, #0x80 lsls r4, r4, #1 adds r1, r4, #0 - bl sub_0806FA04 + bl FixedDiv ldr r1, [r7, #0x50] lsls r0, r0, #0x10 asrs r0, r0, #8 @@ -989,11 +989,11 @@ sub_0809A648: @ 0x0809A648 movs r2, #0 ldrsh r0, [r0, r2] adds r1, r5, #0 - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #0x10 asrs r0, r0, #0x10 adds r1, r4, #0 - bl sub_0806FA04 + bl FixedDiv ldr r1, [r7, #0x50] lsls r0, r0, #0x10 asrs r0, r0, #8 diff --git a/asm/object89.s b/asm/object89.s index 4dce01fc..69ca1913 100644 --- a/asm/object89.s +++ b/asm/object89.s @@ -85,7 +85,7 @@ _0809AB70: adds r1, #0x63 movs r0, #0x20 strb r0, [r1] - ldr r1, _0809ABA0 @ =gUnk_08012DD8 + ldr r1, _0809ABA0 @ =script_08012DD8 adds r0, r5, #0 bl StartCutscene adds r1, r5, #0 @@ -94,13 +94,13 @@ _0809AB70: _0809AB9C: pop {r4, r5, pc} .align 2, 0 -_0809ABA0: .4byte gUnk_08012DD8 +_0809ABA0: .4byte script_08012DD8 thumb_func_start sub_0809ABA4 sub_0809ABA4: @ 0x0809ABA4 push {lr} movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity pop {pc} .align 2, 0 diff --git a/asm/object91.s b/asm/object91.s index 80fbd82d..35eb581d 100644 --- a/asm/object91.s +++ b/asm/object91.s @@ -1024,13 +1024,13 @@ sub_0809CB70: @ 0x0809CB70 lsls r5, r5, #0x10 asrs r5, r5, #0x10 adds r1, r5, #0 - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #0x10 asrs r0, r0, #0x10 movs r1, #0x80 lsls r1, r1, #1 mov r8, r1 - bl sub_0806FA04 + bl FixedDiv ldr r1, [r6, #0x50] lsls r0, r0, #0x10 asrs r0, r0, #8 @@ -1043,11 +1043,11 @@ sub_0809CB70: @ 0x0809CB70 movs r1, #0 ldrsh r0, [r4, r1] adds r1, r5, #0 - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #0x10 asrs r0, r0, #0x10 mov r1, r8 - bl sub_0806FA04 + bl FixedDiv ldr r2, [r6, #0x50] lsls r0, r0, #0x10 asrs r0, r0, #8 diff --git a/asm/object97.s b/asm/object97.s index c597b8ea..380c921b 100644 --- a/asm/object97.s +++ b/asm/object97.s @@ -62,7 +62,7 @@ sub_0809D9D8: @ 0x0809D9D8 bl InitAnimationForceUpdate adds r0, r4, #0 movs r1, #6 - bl FindNextEntityOfSameSubtype + bl FindNextDuplicateID cmp r0, #0 beq _0809DA1E str r4, [r0, #0x50] @@ -436,7 +436,7 @@ sub_0809DC80: @ 0x0809DC80 bl InitAnimationForceUpdate adds r0, r4, #0 movs r1, #6 - bl FindNextEntityOfSameSubtype + bl FindNextDuplicateID cmp r0, #0 beq _0809DD00 str r4, [r0, #0x50] @@ -901,9 +901,9 @@ sub_0809E088: @ 0x0809E088 push {r4, lr} adds r4, r0, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity adds r0, r4, #0 - bl sub_0807DDE4 + bl HandleEntity0x82Actions adds r0, r4, #0 bl UpdateAnimationSingleFrame pop {r4, pc} @@ -950,11 +950,11 @@ sub_0809E0D4: @ 0x0809E0D4 ldrb r0, [r1, #0xc] cmp r0, #1 bhi _0809E0FE - ldr r0, _0809E0F8 @ =gUnk_02033280 + ldr r0, _0809E0F8 @ =gActiveScriptInfo strb r2, [r0, #6] b _0809E1BC .align 2, 0 -_0809E0F8: .4byte gUnk_02033280 +_0809E0F8: .4byte gActiveScriptInfo _0809E0FC: ldr r1, _0809E124 @ =gPlayerEntity _0809E0FE: @@ -971,13 +971,13 @@ _0809E0FE: bl sub_0807DEDC ldr r0, _0809E128 @ =0x00000123 bl SoundReq - ldr r0, _0809E12C @ =gUnk_02033280 + ldr r0, _0809E12C @ =gActiveScriptInfo strb r4, [r0, #6] b _0809E1BC .align 2, 0 _0809E124: .4byte gPlayerEntity _0809E128: .4byte 0x00000123 -_0809E12C: .4byte gUnk_02033280 +_0809E12C: .4byte gActiveScriptInfo _0809E130: ldr r1, [r5, #0x54] cmp r1, #0 @@ -1047,7 +1047,7 @@ _0809E170: bl SoundReq b _0809E1BC _0809E1B6: - ldr r1, _0809E1C4 @ =gUnk_02033280 + ldr r1, _0809E1C4 @ =gActiveScriptInfo movs r0, #0 strb r0, [r1, #6] _0809E1BC: @@ -1055,7 +1055,7 @@ _0809E1BC: mov r8, r3 pop {r4, r5, r6, r7, pc} .align 2, 0 -_0809E1C4: .4byte gUnk_02033280 +_0809E1C4: .4byte gActiveScriptInfo thumb_func_start sub_0809E1C8 sub_0809E1C8: @ 0x0809E1C8 @@ -1141,7 +1141,7 @@ sub_0809E238: @ 0x0809E238 adds r5, #0x6c movs r2, #0 ldrsh r1, [r5, r2] - bl sub_0806F9EC + bl FixedMul adds r4, r0, #0 lsls r4, r4, #0x10 asrs r4, r4, #0x10 @@ -1154,7 +1154,7 @@ sub_0809E238: @ 0x0809E238 ldrsh r0, [r0, r2] movs r2, #0 ldrsh r1, [r5, r2] - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #0x10 asrs r0, r0, #0x10 adds r1, r7, #0 diff --git a/asm/objectB.s b/asm/objectB.s index e7f17d89..cfb07492 100644 --- a/asm/objectB.s +++ b/asm/objectB.s @@ -281,7 +281,7 @@ _08083DA0: _08083DA8: .4byte gSave _08083DAC: ldrb r0, [r4, #0xa] - bl sub_080544DC + bl GetBottleContaining adds r1, r0, #0 cmp r1, #0 beq _08083DC8 diff --git a/asm/objectB3.s b/asm/objectB3.s index 91fd1641..158006ad 100644 --- a/asm/objectB3.s +++ b/asm/objectB3.s @@ -103,7 +103,7 @@ sub_080A0ADC: @ 0x080A0ADC bl sub_0807DD64 adds r0, r4, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity pop {r4, pc} .align 2, 0 @@ -112,7 +112,7 @@ sub_080A0AF0: @ 0x080A0AF0 push {r4, lr} adds r4, r0, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity adds r0, r4, #0 bl GetNextFrame adds r0, r4, #0 diff --git a/asm/objectB9.s b/asm/objectB9.s index bf5cd9ec..fcebb4f0 100644 --- a/asm/objectB9.s +++ b/asm/objectB9.s @@ -193,7 +193,7 @@ _080A132E: .align 2, 0 _080A136C: .4byte gPlayerState _080A1370: - ldr r1, _080A1384 @ =gUnk_02033280 + ldr r1, _080A1384 @ =gActiveScriptInfo movs r0, #0 strb r0, [r1, #6] _080A1376: @@ -204,7 +204,7 @@ _080A1376: mov sl, r5 pop {r4, r5, r6, r7, pc} .align 2, 0 -_080A1384: .4byte gUnk_02033280 +_080A1384: .4byte gActiveScriptInfo thumb_func_start sub_080A1388 sub_080A1388: @ 0x080A1388 diff --git a/asm/octorokBoss.s b/asm/octorokBoss.s index 419c15ac..e9a21351 100644 --- a/asm/octorokBoss.s +++ b/asm/octorokBoss.s @@ -597,13 +597,13 @@ _08035616: adds r1, r4, #0 ands r1, r2 lsls r1, r1, #8 - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #0x10 asrs r0, r0, #0x10 movs r5, #0x80 lsls r5, r5, #1 adds r1, r5, #0 - bl sub_0806FA04 + bl FixedDiv lsrs r0, r0, #8 adds r1, r7, #0 adds r1, #0x62 @@ -619,11 +619,11 @@ _08035616: ands r4, r1 lsls r4, r4, #8 adds r1, r4, #0 - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #0x10 asrs r0, r0, #0x10 adds r1, r5, #0 - bl sub_0806FA04 + bl FixedDiv lsls r0, r0, #0x10 asrs r0, r0, #8 rsbs r0, r0, #0 @@ -3086,13 +3086,13 @@ sub_08036914: @ 0x08036914 lsls r6, r6, #0x10 asrs r6, r6, #0x10 adds r1, r6, #0 - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #0x10 asrs r0, r0, #0x10 movs r1, #0x80 lsls r1, r1, #1 mov r8, r1 - bl sub_0806FA04 + bl FixedDiv ldr r1, [r5, #0x50] lsls r0, r0, #0x10 asrs r0, r0, #8 @@ -3105,11 +3105,11 @@ sub_08036914: @ 0x08036914 movs r1, #0 ldrsh r0, [r4, r1] adds r1, r6, #0 - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #0x10 asrs r0, r0, #0x10 mov r1, r8 - bl sub_0806FA04 + bl FixedDiv ldr r2, [r5, #0x50] lsls r0, r0, #0x10 asrs r0, r0, #8 @@ -3270,11 +3270,11 @@ _08036A78: movs r1, #0 ldrsh r0, [r0, r1] adds r1, r6, #0 - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #0x10 asrs r0, r0, #0x10 adds r1, r7, #0 - bl sub_0806FA04 + bl FixedDiv ldr r2, [r5] ldr r1, [r5, #4] lsls r0, r0, #0x10 @@ -3293,11 +3293,11 @@ _08036A78: movs r1, #0 ldrsh r0, [r0, r1] adds r1, r6, #0 - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #0x10 asrs r0, r0, #0x10 adds r1, r7, #0 - bl sub_0806FA04 + bl FixedDiv ldr r2, [r5] ldr r1, [r5, #4] lsls r0, r0, #0x10 @@ -3386,12 +3386,12 @@ _08036B48: movs r3, #0 ldrsh r0, [r0, r3] mov r1, sl - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #0x10 asrs r0, r0, #0x10 movs r1, #0x80 lsls r1, r1, #1 - bl sub_0806FA04 + bl FixedDiv ldr r2, [r5] ldr r1, [r6] lsls r0, r0, #0x10 @@ -3409,12 +3409,12 @@ _08036B48: movs r2, #0 ldrsh r0, [r0, r2] mov r1, sl - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #0x10 asrs r0, r0, #0x10 movs r1, #0x80 lsls r1, r1, #1 - bl sub_0806FA04 + bl FixedDiv ldr r2, [r5] ldr r1, [r6] b _08036C6E @@ -3475,12 +3475,12 @@ _08036C0E: movs r2, #0 ldrsh r0, [r0, r2] mov r1, sl - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #0x10 asrs r0, r0, #0x10 movs r1, #0x80 lsls r1, r1, #1 - bl sub_0806FA04 + bl FixedDiv ldr r2, [r4] adds r5, r6, r7 ldr r1, [r5] @@ -3499,12 +3499,12 @@ _08036C0E: movs r1, #0 ldrsh r0, [r0, r1] mov r1, sl - bl sub_0806F9EC + bl FixedMul lsls r0, r0, #0x10 asrs r0, r0, #0x10 movs r1, #0x80 lsls r1, r1, #1 - bl sub_0806FA04 + bl FixedDiv ldr r2, [r4] ldr r1, [r5] _08036C6E: diff --git a/asm/percy.s b/asm/percy.s index 08ec140c..d00ceec6 100644 --- a/asm/percy.s +++ b/asm/percy.s @@ -100,13 +100,13 @@ _0806B5EE: .align 2, 0 _0806B5FC: .4byte gPlayerEntity _0806B600: - ldr r1, _0806B608 @ =gUnk_02033280 + ldr r1, _0806B608 @ =gActiveScriptInfo movs r0, #0 strb r0, [r1, #6] _0806B606: pop {r4, pc} .align 2, 0 -_0806B608: .4byte gUnk_02033280 +_0806B608: .4byte gActiveScriptInfo thumb_func_start sub_0806B60C sub_0806B60C: @ 0x0806B60C diff --git a/asm/phonograph.s b/asm/phonograph.s index 962139ae..dc6a64f8 100644 --- a/asm/phonograph.s +++ b/asm/phonograph.s @@ -36,9 +36,9 @@ Phonograph: @ 0x0806E91C _0806E950: adds r0, r5, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity adds r0, r5, #0 - bl sub_0807DDE4 + bl HandleEntity0x82Actions pop {r4, r5, pc} .align 2, 0 _0806E960: .4byte 0x0000FFFF @@ -214,7 +214,7 @@ _0806EA86: strh r1, [r0] strh r1, [r6] _0806EAA4: - ldr r1, _0806EAB8 @ =gUnk_02033280 + ldr r1, _0806EAB8 @ =gActiveScriptInfo movs r0, #0 strb r0, [r1, #6] _0806EAAA: @@ -224,7 +224,7 @@ _0806EAAA: pop {r4, r5, r6, r7, pc} .align 2, 0 _0806EAB4: .4byte 0x80010000 -_0806EAB8: .4byte gUnk_02033280 +_0806EAB8: .4byte gActiveScriptInfo thumb_func_start sub_0806EABC sub_0806EABC: @ 0x0806EABC diff --git a/asm/picolyteBottles.s b/asm/picolyteBottles.s index 158b7a27..0930627e 100644 --- a/asm/picolyteBottles.s +++ b/asm/picolyteBottles.s @@ -392,7 +392,7 @@ _0806E1C0: ldr r1, _0806E1D8 @ =gScreenTransition ldrh r0, [r4] strh r0, [r1, #6] - ldr r2, _0806E1DC @ =gUnk_02033280 + ldr r2, _0806E1DC @ =gActiveScriptInfo ldrb r1, [r2, #7] movs r0, #1 orrs r0, r1 @@ -401,7 +401,7 @@ _0806E1C0: .align 2, 0 _0806E1D4: .4byte 0x0000421C _0806E1D8: .4byte gScreenTransition -_0806E1DC: .4byte gUnk_02033280 +_0806E1DC: .4byte gActiveScriptInfo thumb_func_start sub_0806E1E0 sub_0806E1E0: @ 0x0806E1E0 @@ -476,11 +476,11 @@ sub_0806E250: @ 0x0806E250 movs r0, #1 str r0, [r4, #0x14] _0806E266: - ldr r2, _0806E274 @ =gUnk_02033280 + ldr r2, _0806E274 @ =gActiveScriptInfo ldrb r1, [r2, #7] movs r0, #1 orrs r0, r1 strb r0, [r2, #7] pop {r4, pc} .align 2, 0 -_0806E274: .4byte gUnk_02033280 +_0806E274: .4byte gActiveScriptInfo diff --git a/asm/pina.s b/asm/pina.s index 5d4927ac..c92b8889 100644 --- a/asm/pina.s +++ b/asm/pina.s @@ -208,9 +208,9 @@ _08063BDC: .4byte gPlayerEntity _08063BE0: adds r0, r4, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity adds r0, r4, #0 - bl sub_0807DDE4 + bl HandleEntity0x82Actions adds r0, r4, #0 bl UpdateAnimationSingleFrame b _08063C10 @@ -235,7 +235,7 @@ sub_08063C14: @ 0x08063C14 push {lr} movs r0, #7 movs r1, #0x14 - bl FindEntityBySubtype + bl DeepFindEntityByID cmp r0, #0 beq _08063C28 movs r1, #8 @@ -249,7 +249,7 @@ sub_08063C2C: @ 0x08063C2C push {lr} movs r0, #7 movs r1, #0x14 - bl FindEntityBySubtype + bl DeepFindEntityByID cmp r0, #0 beq _08063C40 movs r1, #4 @@ -263,7 +263,7 @@ sub_08063C44: @ 0x08063C44 push {lr} movs r0, #7 movs r1, #0x14 - bl FindEntityBySubtype + bl DeepFindEntityByID cmp r0, #0 beq _08063C58 movs r1, #0 @@ -277,7 +277,7 @@ sub_08063C5C: @ 0x08063C5C push {lr} movs r0, #7 movs r1, #0x14 - bl FindEntityBySubtype + bl DeepFindEntityByID cmp r0, #0 beq _08063C70 movs r1, #9 @@ -291,7 +291,7 @@ sub_08063C74: @ 0x08063C74 push {lr} movs r0, #7 movs r1, #0x14 - bl FindEntityBySubtype + bl DeepFindEntityByID cmp r0, #0 beq _08063C8C movs r2, #0x18 diff --git a/asm/postman.s b/asm/postman.s index 86ce9e54..98732474 100644 --- a/asm/postman.s +++ b/asm/postman.s @@ -19,12 +19,12 @@ sub_0806076C: @ 0x0806076C ldr r0, [r7, #0x34] cmp r0, #0 bge _08060790 - ldr r1, _0806078C @ =gUnk_02033280 + ldr r1, _0806078C @ =gActiveScriptInfo movs r0, #0 strb r0, [r1, #6] b _080608D8 .align 2, 0 -_0806078C: .4byte gUnk_02033280 +_0806078C: .4byte gActiveScriptInfo _08060790: adds r4, r7, #0 adds r4, #0x69 diff --git a/asm/rem.s b/asm/rem.s index 1389ec91..4f86ff07 100644 --- a/asm/rem.s +++ b/asm/rem.s @@ -201,7 +201,7 @@ _0806A568: movs r0, #8 movs r1, #2 bl sub_08080964 - ldr r2, _0806A5B4 @ =gUnk_02033280 + ldr r2, _0806A5B4 @ =gActiveScriptInfo ldr r0, [r2] movs r1, #0x80 lsls r1, r1, #1 @@ -227,7 +227,7 @@ _0806A590: _0806A5B0: pop {r4, r5, pc} .align 2, 0 -_0806A5B4: .4byte gUnk_02033280 +_0806A5B4: .4byte gActiveScriptInfo _0806A5B8: .4byte 0x0000011B thumb_func_start nullsub_503 @@ -305,7 +305,7 @@ sub_0806A630: @ 0x0806A630 movs r1, #0x12 bl InitializeAnimation _0806A646: - ldr r0, _0806A670 @ =gUnk_02033280 + ldr r0, _0806A670 @ =gActiveScriptInfo ldr r0, [r0] movs r1, #0x80 lsls r1, r1, #1 @@ -327,7 +327,7 @@ _0806A65A: _0806A66E: pop {r4, pc} .align 2, 0 -_0806A670: .4byte gUnk_02033280 +_0806A670: .4byte gActiveScriptInfo thumb_func_start sub_0806A674 sub_0806A674: @ 0x0806A674 @@ -370,7 +370,7 @@ _0806A6A0: bl InitializeAnimation b _0806A82A _0806A6BE: - ldr r0, _0806A6E0 @ =gUnk_02033280 + ldr r0, _0806A6E0 @ =gActiveScriptInfo ldr r0, [r0] movs r1, #0x80 lsls r1, r1, #1 @@ -387,7 +387,7 @@ _0806A6BE: strb r0, [r1] b _0806A82A .align 2, 0 -_0806A6E0: .4byte gUnk_02033280 +_0806A6E0: .4byte gActiveScriptInfo _0806A6E4: ldr r0, [r4, #0x50] adds r0, #0x58 @@ -581,7 +581,7 @@ sub_0806A830: @ 0x0806A830 movs r1, #2 bl sub_0805E3A0 _0806A84E: - ldr r0, _0806A88C @ =gUnk_02033280 + ldr r0, _0806A88C @ =gActiveScriptInfo ldr r0, [r0] movs r1, #0x80 lsls r1, r1, #2 @@ -611,7 +611,7 @@ _0806A860: _0806A88A: pop {r4, pc} .align 2, 0 -_0806A88C: .4byte gUnk_02033280 +_0806A88C: .4byte gActiveScriptInfo thumb_func_start sub_0806A890 sub_0806A890: @ 0x0806A890 @@ -721,13 +721,13 @@ sub_0806A958: @ 0x0806A958 ldrb r0, [r0, #0xc] cmp r0, #5 beq _0806A966 - ldr r1, _0806A968 @ =gUnk_02033280 + ldr r1, _0806A968 @ =gActiveScriptInfo movs r0, #0 strb r0, [r1, #6] _0806A966: pop {pc} .align 2, 0 -_0806A968: .4byte gUnk_02033280 +_0806A968: .4byte gActiveScriptInfo thumb_func_start sub_0806A96C sub_0806A96C: @ 0x0806A96C @@ -758,14 +758,14 @@ _0806A992: strb r3, [r4] movs r0, #1 str r0, [r1, #0x14] - ldr r2, _0806A9AC @ =gUnk_02033280 + ldr r2, _0806A9AC @ =gActiveScriptInfo ldrb r1, [r2, #7] orrs r0, r1 strb r0, [r2, #7] _0806A9A8: pop {r4, pc} .align 2, 0 -_0806A9AC: .4byte gUnk_02033280 +_0806A9AC: .4byte gActiveScriptInfo thumb_func_start sub_0806A9B0 sub_0806A9B0: @ 0x0806A9B0 @@ -938,7 +938,7 @@ _0806AAEE: adds r0, #0xac ldr r0, [r0] movs r1, #7 - bl FindNextEntityOfSameSubtype + bl FindNextDuplicateID adds r1, r0, #0 adds r0, r4, #0 adds r0, #0xb0 @@ -948,7 +948,7 @@ _0806AB02: adds r0, #0xb0 ldr r0, [r0] movs r1, #7 - bl FindNextEntityOfSameSubtype + bl FindNextDuplicateID adds r1, r0, #0 mov r0, r8 adds r0, #0xb4 @@ -996,7 +996,7 @@ _0806AB5C: cmp r0, #0 bge _0806AB6A _0806AB64: - ldr r1, _0806AB70 @ =gUnk_02033280 + ldr r1, _0806AB70 @ =gActiveScriptInfo movs r0, #0 strb r0, [r1, #6] _0806AB6A: @@ -1004,7 +1004,7 @@ _0806AB6A: mov r8, r3 pop {r4, r5, r6, r7, pc} .align 2, 0 -_0806AB70: .4byte gUnk_02033280 +_0806AB70: .4byte gActiveScriptInfo thumb_func_start sub_0806AB74 sub_0806AB74: @ 0x0806AB74 @@ -1041,7 +1041,7 @@ sub_0806AB9C: @ 0x0806AB9C movs r1, #0x37 movs r2, #7 movs r3, #1 - bl FindEntityInListByForm + bl FindEntity cmp r0, #0 beq _0806ABBC bl DeleteEntity diff --git a/asm/sittingPerson.s b/asm/sittingPerson.s index 29d3221c..74e7db0e 100644 --- a/asm/sittingPerson.s +++ b/asm/sittingPerson.s @@ -110,9 +110,9 @@ _08063800: .4byte gPlayerEntity _08063804: adds r0, r4, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity adds r0, r4, #0 - bl sub_0807DDE4 + bl HandleEntity0x82Actions adds r5, r4, #0 adds r5, #0x59 ldrb r0, [r5] diff --git a/asm/stockwell.s b/asm/stockwell.s index 074ada57..6d91bf82 100644 --- a/asm/stockwell.s +++ b/asm/stockwell.s @@ -22,7 +22,7 @@ Stockwell: @ 0x08065054 adds r0, #0x84 ldr r1, [r0] adds r0, r4, #0 - bl ExecuteScriptCommandSet + bl ExecuteScript adds r0, r4, #0 bl sub_0806ED78 pop {r4, pc} @@ -54,7 +54,7 @@ sub_08065080: @ 0x08065080 movs r1, #0 movs r2, #0 bl sub_08078850 - ldr r1, _080650C8 @ =gUnk_080142B0 + ldr r1, _080650C8 @ =script_080142B0 adds r0, r4, #0 bl StartCutscene adds r4, #0x84 @@ -62,7 +62,7 @@ sub_08065080: @ 0x08065080 pop {r4, pc} .align 2, 0 _080650C4: .4byte gUnk_0810FDA0 -_080650C8: .4byte gUnk_080142B0 +_080650C8: .4byte script_080142B0 thumb_func_start sub_080650CC sub_080650CC: @ 0x080650CC @@ -83,12 +83,12 @@ sub_080650CC: @ 0x080650CC adds r0, r5, #0 adds r0, #0x84 ldr r0, [r0] - ldr r1, _080650FC @ =gUnk_080143C0 - bl sub_0807DB88 + ldr r1, _080650FC @ =script_080143C0 + bl InitScriptExecutionContext b _080651A6 .align 2, 0 _080650F8: .4byte gRoomVars -_080650FC: .4byte gUnk_080143C0 +_080650FC: .4byte script_080143C0 _08065100: adds r2, r5, #0 adds r2, #0x5a @@ -124,7 +124,7 @@ _0806513C: bl GetSaleItemConfirmMessageID adds r7, r0, #0 ldrb r0, [r6, #6] - bl sub_08053FE0 + bl GetItemPrice mov r8, r0 movs r0, #4 strb r0, [r5, #0xc] @@ -132,8 +132,8 @@ _0806513C: adds r0, r5, #0 adds r0, #0x84 ldr r0, [r0] - ldr r1, _08065174 @ =gUnk_08014384 - bl sub_0807DB88 + ldr r1, _08065174 @ =script_08014384 + bl InitScriptExecutionContext _0806515E: adds r0, r7, #0 adds r1, r5, #0 @@ -145,7 +145,7 @@ _0806515E: str r0, [r1, #0x10] b _080651A6 .align 2, 0 -_08065174: .4byte gUnk_08014384 +_08065174: .4byte script_08014384 _08065178: .4byte gTextBox _0806517C: ldrb r1, [r2] @@ -529,7 +529,7 @@ _0806543C: cmp r6, #0 beq _080654C8 adds r0, r5, #0 - bl sub_08053FE0 + bl GetItemPrice adds r6, r0, #0 ldr r7, _08065494 @ =gSave adds r0, r7, #0 @@ -635,14 +635,14 @@ sub_080654FC: @ 0x080654FC ands r0, r1 cmp r0, #0 beq _08065518 - ldr r1, _08065514 @ =gUnk_02033280 + ldr r1, _08065514 @ =gActiveScriptInfo movs r0, #0 strb r0, [r1, #6] b _08065522 .align 2, 0 -_08065514: .4byte gUnk_02033280 +_08065514: .4byte gActiveScriptInfo _08065518: - ldr r2, _08065524 @ =gUnk_02033280 + ldr r2, _08065524 @ =gActiveScriptInfo ldrb r1, [r2, #7] movs r0, #1 orrs r0, r1 @@ -650,7 +650,7 @@ _08065518: _08065522: pop {pc} .align 2, 0 -_08065524: .4byte gUnk_02033280 +_08065524: .4byte gActiveScriptInfo thumb_func_start sub_08065528 sub_08065528: @ 0x08065528 diff --git a/asm/vaati.s b/asm/vaati.s index 982a913c..a9f5bf86 100644 --- a/asm/vaati.s +++ b/asm/vaati.s @@ -313,7 +313,7 @@ _08066C86: adds r0, #0x84 ldr r1, [r0] mov r0, ip - bl sub_0807DB98 + bl HandlePostScriptActions pop {r4, r5, r6, pc} thumb_func_start sub_08066C94 diff --git a/asm/whirlwind.s b/asm/whirlwind.s index f5ed706c..2d7befb7 100644 --- a/asm/whirlwind.s +++ b/asm/whirlwind.s @@ -108,7 +108,7 @@ _08092D5C: bl sub_0807DD64 adds r0, r4, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity _08092D74: pop {r4, pc} .align 2, 0 @@ -125,7 +125,7 @@ sub_08092D7C: @ 0x08092D7C beq _08092D92 adds r0, r5, #0 movs r1, #0 - bl sub_0807DDAC + bl ExecuteScriptForEntity _08092D92: ldrb r0, [r5, #0x18] lsls r0, r0, #0x1e diff --git a/asm/windTribespeople.s b/asm/windTribespeople.s index 97aab657..0c4770e5 100644 --- a/asm/windTribespeople.s +++ b/asm/windTribespeople.s @@ -152,14 +152,14 @@ _0806CA7E: ldrh r0, [r4, #0x10] cmp r0, #0 beq _0806CA8A - ldr r1, _0806CA90 @ =gUnk_02033280 + ldr r1, _0806CA90 @ =gActiveScriptInfo movs r0, #0 strb r0, [r1, #6] _0806CA8A: pop {r4, pc} .align 2, 0 _0806CA8C: .4byte gUnk_08113B38 -_0806CA90: .4byte gUnk_02033280 +_0806CA90: .4byte gActiveScriptInfo thumb_func_start WindTribespeople_Fusion WindTribespeople_Fusion: @ 0x0806CA94 diff --git a/asm/zeldaFollower.s b/asm/zeldaFollower.s index 34f0cbf1..51994bf1 100644 --- a/asm/zeldaFollower.s +++ b/asm/zeldaFollower.s @@ -378,7 +378,7 @@ sub_08068578: @ 0x08068578 lsls r0, r1, #0x10 asrs r0, r0, #0x10 movs r1, #0x14 - bl sub_0806FA04 + bl FixedDiv lsls r0, r0, #0x10 asrs r0, r0, #0x10 mov sl, r0 @@ -386,7 +386,7 @@ sub_08068578: @ 0x08068578 lsls r0, r2, #0x10 asrs r0, r0, #0x10 movs r1, #0x14 - bl sub_0806FA04 + bl FixedDiv lsls r0, r0, #0x10 asrs r0, r0, #0x10 mov r8, r0 diff --git a/data/data_080D5360.s b/data/data_080D5360.s index 95021411..eca8e4f9 100644 --- a/data/data_080D5360.s +++ b/data/data_080D5360.s @@ -386,7 +386,10 @@ gUnk_080D6714:: @ 080D6714 .incbin "baserom.gba", 0x0D6714, 0x0000020 gUnk_080D6734:: @ 080D6734 - .incbin "baserom.gba", 0x0D6734, 0x0000080 + .incbin "baserom.gba", 0x0D6734, 0x0000050 + +gUnk_080D6784:: @ 080D6784 + .incbin "baserom.gba", 0x0D6784, 0x0000030 gUnk_080D67B4:: @ 080D67B4 .incbin "baserom.gba", 0x0D67B4, 0x00000F0 @@ -1445,7 +1448,10 @@ gUnk_080DA210:: @ 080DA210 .incbin "baserom.gba", 0x0DA210, 0x0000020 gUnk_080DA230:: @ 080DA230 - .incbin "baserom.gba", 0x0DA230, 0x0000070 + .incbin "baserom.gba", 0x0DA230, 0x0000030 + +gUnk_080DA260:: @ 080DA260 + .incbin "baserom.gba", 0x0DA260, 0x0000040 gUnk_080DA2A0:: @ 080DA2A0 .incbin "baserom.gba", 0x0DA2A0, 0x0000010 @@ -2630,7 +2636,10 @@ gUnk_080DD6CC:: @ 080DD6CC .incbin "baserom.gba", 0x0DD6CC, 0x0000040 gUnk_080DD70C:: @ 080DD70C - .incbin "baserom.gba", 0x0DD70C, 0x0000044 + .incbin "baserom.gba", 0x0DD70C, 0x0000024 + +gUnk_080DD730:: @ 080DD730 + .incbin "baserom.gba", 0x0DD730, 0x0000020 gUnk_080DD750:: @ 080DD750 .incbin "baserom.gba", 0x0DD750, 0x0000040 @@ -4448,7 +4457,10 @@ gUnk_080E3790:: @ 080E3790 .incbin "baserom.gba", 0x0E3790, 0x0000020 gUnk_080E37B0:: @ 080E37B0 - .incbin "baserom.gba", 0x0E37B0, 0x00000A0 + .incbin "baserom.gba", 0x0E37B0, 0x0000080 + +gUnk_080E3830:: @ 080E3830 + .incbin "baserom.gba", 0x0E3830, 0x0000020 gUnk_080E3850:: @ 080E3850 .incbin "baserom.gba", 0x0E3850, 0x0000020 @@ -7019,7 +7031,10 @@ gUnk_080EE80C:: @ 080EE80C .incbin "baserom.gba", 0x0EE80C, 0x0000080 gUnk_080EE88C:: @ 080EE88C - .incbin "baserom.gba", 0x0EE88C, 0x0000070 + .incbin "baserom.gba", 0x0EE88C, 0x0000020 + +gUnk_080EE8AC:: @ 080EE8AC + .incbin "baserom.gba", 0x0EE8AC, 0x0000050 gUnk_080EE8FC:: @ 080EE8FC .incbin "baserom.gba", 0x0EE8FC, 0x0000020 @@ -7592,13 +7607,19 @@ gUnk_080F0630:: @ 080F0630 .incbin "baserom.gba", 0x0F0630, 0x0000020 gUnk_080F0650:: @ 080F0650 - .incbin "baserom.gba", 0x0F0650, 0x0000090 + .incbin "baserom.gba", 0x0F0650, 0x0000060 + +gUnk_080F06B0:: @ 080F06B0 + .incbin "baserom.gba", 0x0F06B0, 0x0000030 gUnk_080F06E0:: @ 080F06E0 .incbin "baserom.gba", 0x0F06E0, 0x0000025 gUnk_080F0705:: @ 080F0705 - .incbin "baserom.gba", 0x0F0705, 0x00000FB + .incbin "baserom.gba", 0x0F0705, 0x000006B + +gUnk_080F0770:: @ 080F0770 + .incbin "baserom.gba", 0x0F0770, 0x0000090 gUnk_080F0800:: @ 080F0800 .incbin "baserom.gba", 0x0F0800, 0x0000006 @@ -8982,7 +9003,10 @@ gEntityList0_MinishWoods_0:: @ 080F4D00 entity_list_end gUnk_080F4D50:: @ 080F4D50 - .incbin "baserom.gba", 0x0F4D50, 0x0000060 + .incbin "baserom.gba", 0x0F4D50, 0x0000020 + +gUnk_080F4D70:: @080F4D70 + .incbin "baserom.gba", 0x0F4D70, 0x0000040 gUnk_080F4DB0:: @ 080F4DB0 .incbin "baserom.gba", 0x0F4DB0, 0x0000020 @@ -9066,7 +9090,10 @@ gUnk_080F5194:: @ 080F5194 .incbin "baserom.gba", 0x0F5194, 0x000001E gUnk_080F51B2:: @ 080F51B2 - .incbin "baserom.gba", 0x0F51B2, 0x000003E + .incbin "baserom.gba", 0x0F51B2, 0x000001E + +gUnk_080F51D0:: @ 080F51D0 + .incbin "baserom.gba", 0x0F51D0, 0x0000020 gUnk_080F51F0:: @ 080F51F0 .incbin "baserom.gba", 0x0F51F0, 0x0000030 @@ -9178,7 +9205,10 @@ gUnk_080F5630:: @ 080F5630 .incbin "baserom.gba", 0x0F5630, 0x0000030 gUnk_080F5660:: @ 080F5660 - .incbin "baserom.gba", 0x0F5660, 0x0000050 + .incbin "baserom.gba", 0x0F5660, 0x0000020 + +gUnk_080F5680:: @ 080F5680 + .incbin "baserom.gba", 0x0F5680, 0x0000030 gUnk_080F56B0:: @ 080F56B0 .incbin "baserom.gba", 0x0F56B0, 0x0000050 @@ -9835,7 +9865,10 @@ gUnk_080F7C00:: @ 080F7C00 .incbin "baserom.gba", 0x0F7C00, 0x0000080 gUnk_080F7C80:: @ 080F7C80 - .incbin "baserom.gba", 0x0F7C80, 0x0000050 + .incbin "baserom.gba", 0x0F7C80, 0x0000030 + +gUnk_080F7CB0:: @ 080F7CB0 + .incbin "baserom.gba", 0x0F7CB0, 0x0000020 gUnk_080F7CD0:: @ 080F7CD0 .incbin "baserom.gba", 0x0F7CD0, 0x0000020 diff --git a/data/data_08108D30.s b/data/data_08108D30.s index 492d4aa5..445dfc43 100644 --- a/data/data_08108D30.s +++ b/data/data_08108D30.s @@ -4692,867 +4692,3 @@ gUnk_08114100:: @ 08114100 gUnk_08114104:: @ 08114104 .incbin "baserom.gba", 0x114104, 0x0000030 - -gUnk_08114134:: @ 08114134 - .incbin "baserom.gba", 0x114134, 0x0000010 - -gUnk_08114144:: @ 08114144 - .incbin "baserom.gba", 0x114144, 0x0000010 - -gUnk_08114154:: @ 08114154 - .incbin "baserom.gba", 0x114154, 0x0000008 - -gUnk_0811415C:: @ 0811415C - .incbin "baserom.gba", 0x11415C, 0x0000048 - -gUnk_081141A4:: @ 081141A4 - .incbin "baserom.gba", 0x1141A4, 0x0000040 - -gUnk_081141E4:: @ 081141E4 - .incbin "baserom.gba", 0x1141E4, 0x0000010 - -gUnk_081141F4:: @ 081141F4 - .incbin "baserom.gba", 0x1141F4, 0x0000014 - -gUnk_08114208:: @ 08114208 - .incbin "baserom.gba", 0x114208, 0x0000005 - -gUnk_0811420D:: @ 0811420D - .incbin "baserom.gba", 0x11420D, 0x0000004 - -gUnk_08114211:: @ 08114211 - .incbin "baserom.gba", 0x114211, 0x0000005 - -gUnk_08114216:: @ 08114216 - .incbin "baserom.gba", 0x114216, 0x0000009 - -gUnk_0811421F:: @ 0811421F - .incbin "baserom.gba", 0x11421F, 0x0000009 - -gUnk_08114228:: @ 08114228 - .incbin "baserom.gba", 0x114228, 0x0000014 - -gUnk_0811423C:: @ 0811423C - .incbin "baserom.gba", 0x11423C, 0x0000008 - -gUnk_08114244:: @ 08114244 - .incbin "baserom.gba", 0x114244, 0x0000019 - -gUnk_0811425D:: @ 0811425D - .incbin "baserom.gba", 0x11425D, 0x0000019 - -gUnk_08114276:: @ 08114276 - .incbin "baserom.gba", 0x114276, 0x0000019 - -gUnk_0811428F:: @ 0811428F - .incbin "baserom.gba", 0x11428F, 0x0000019 - -gUnk_081142A8:: @ 081142A8 - .incbin "baserom.gba", 0x1142A8, 0x0000014 - -gUnk_081142BC:: @ 081142BC - .incbin "baserom.gba", 0x1142BC, 0x0000010 - -gUnk_081142CC:: @ 081142CC - .incbin "baserom.gba", 0x1142CC, 0x0000010 - -gUnk_081142DC:: @ 081142DC - .incbin "baserom.gba", 0x1142DC, 0x0000020 - -gUnk_081142FC:: @ 081142FC - .incbin "baserom.gba", 0x1142FC, 0x0000008 - -gUnk_08114304:: @ 08114304 - .incbin "baserom.gba", 0x114304, 0x0000004 - -gUnk_08114308:: @ 08114308 - .incbin "baserom.gba", 0x114308, 0x0000128 - -gUnk_08114430:: @ 08114430 - .incbin "baserom.gba", 0x114430, 0x0000002 - -gUnk_08114432:: @ 08114432 - .incbin "baserom.gba", 0x114432, 0x0000012 - -gUnk_08114444:: @ 08114444 - .incbin "baserom.gba", 0x114444, 0x0000084 - -gUnk_081144C8:: @ 081144C8 - .incbin "baserom.gba", 0x1144C8, 0x0000005 - -gUnk_081144CD:: @ 081144CD - .incbin "baserom.gba", 0x1144CD, 0x0000005 - -gUnk_081144D2:: @ 081144D2 - .incbin "baserom.gba", 0x1144D2, 0x0000005 - -gUnk_081144D7:: @ 081144D7 - .incbin "baserom.gba", 0x1144D7, 0x0000005 - -gUnk_081144DC:: @ 081144DC - .incbin "baserom.gba", 0x1144DC, 0x0000014 - -gUnk_081144F0:: @ 081144F0 - .incbin "baserom.gba", 0x1144F0, 0x000000C - -gUnk_081144FC:: @ 081144FC - .incbin "baserom.gba", 0x1144FC, 0x0000035 - -gUnk_08114531:: @ 08114531 - .incbin "baserom.gba", 0x114531, 0x000000B - -gUnk_0811453C:: @ 0811453C - .incbin "baserom.gba", 0x11453C, 0x0000011 - -gUnk_0811454D:: @ 0811454D - .incbin "baserom.gba", 0x11454D, 0x0000011 - -gUnk_0811455E:: @ 0811455E - .incbin "baserom.gba", 0x11455E, 0x0000011 - -gUnk_0811456F:: @ 0811456F - .incbin "baserom.gba", 0x11456F, 0x0000005 - -gUnk_08114574:: @ 08114574 - .incbin "baserom.gba", 0x114574, 0x0000005 - -gUnk_08114579:: @ 08114579 - .incbin "baserom.gba", 0x114579, 0x0000007 - -gUnk_08114580:: @ 08114580 - .incbin "baserom.gba", 0x114580, 0x0000034 - -gUnk_081145B4:: @ 081145B4 - .incbin "baserom.gba", 0x1145B4, 0x0000014 - -gUnk_081145C8:: @ 081145C8 - .incbin "baserom.gba", 0x1145C8, 0x0000008 - -gUnk_081145D0:: @ 081145D0 - .incbin "baserom.gba", 0x1145D0, 0x0000004 - -gUnk_081145D4:: @ 081145D4 - .incbin "baserom.gba", 0x1145D4, 0x0000010 - -gUnk_081145E4:: @ 081145E4 - .incbin "baserom.gba", 0x1145E4, 0x00000D4 - -gUnk_081146B8:: @ 081146B8 - .incbin "baserom.gba", 0x1146B8, 0x0000018 - -gUnk_081146D0:: @ 081146D0 - .incbin "baserom.gba", 0x1146D0, 0x0000014 - -gUnk_081146E4:: @ 081146E4 - .incbin "baserom.gba", 0x1146E4, 0x0000010 - -gUnk_081146F4:: @ 081146F4 - .incbin "baserom.gba", 0x1146F4, 0x00000A8 - -gUnk_0811479C:: @ 0811479C - .incbin "baserom.gba", 0x11479C, 0x0000048 - -gUnk_081147E4:: @ 081147E4 - .incbin "baserom.gba", 0x1147E4, 0x0000020 - -gUnk_08114804:: @ 08114804 - .incbin "baserom.gba", 0x114804, 0x0000010 - -gUnk_08114814:: @ 08114814 - .incbin "baserom.gba", 0x114814, 0x0000010 - -gUnk_08114824:: @ 08114824 - .incbin "baserom.gba", 0x114824, 0x0000040 - -gUnk_08114864:: @ 08114864 - .incbin "baserom.gba", 0x114864, 0x0000010 - -gUnk_08114874:: @ 08114874 - .incbin "baserom.gba", 0x114874, 0x0000030 - -gUnk_081148A4:: @ 081148A4 - .incbin "baserom.gba", 0x1148A4, 0x0000020 - -gUnk_081148C4:: @ 081148C4 - .incbin "baserom.gba", 0x1148C4, 0x0000020 - -gUnk_081148E4:: @ 081148E4 - .incbin "baserom.gba", 0x1148E4, 0x0000030 - -gUnk_08114914:: @ 08114914 - .incbin "baserom.gba", 0x114914, 0x0000030 - -gUnk_08114944:: @ 08114944 - .incbin "baserom.gba", 0x114944, 0x0000030 - -gUnk_08114974:: @ 08114974 - .incbin "baserom.gba", 0x114974, 0x0000010 - -gUnk_08114984:: @ 08114984 - .incbin "baserom.gba", 0x114984, 0x0000010 - -gUnk_08114994:: @ 08114994 - .incbin "baserom.gba", 0x114994, 0x0000010 - -gUnk_081149A4:: @ 081149A4 - .incbin "baserom.gba", 0x1149A4, 0x0000010 - -gUnk_081149B4:: @ 081149B4 - .incbin "baserom.gba", 0x1149B4, 0x0000010 - -gUnk_081149C4:: @ 081149C4 - .incbin "baserom.gba", 0x1149C4, 0x0000030 - -gUnk_081149F4:: @ 081149F4 - .incbin "baserom.gba", 0x1149F4, 0x0000020 - -gUnk_08114A14:: @ 08114A14 - .incbin "baserom.gba", 0x114A14, 0x0000058 - -gUnk_08114A6C:: @ 08114A6C - .incbin "baserom.gba", 0x114A6C, 0x0000020 - -gUnk_08114A8C:: @ 08114A8C - .incbin "baserom.gba", 0x114A8C, 0x0000030 - -gUnk_08114ABC:: @ 08114ABC - .incbin "baserom.gba", 0x114ABC, 0x0000028 - -gUnk_08114AE4:: @ 08114AE4 - .incbin "baserom.gba", 0x114AE4, 0x0000400 - -gUnk_08114EE4:: @ 08114EE4 - .incbin "baserom.gba", 0x114EE4, 0x0000018 - -gUnk_08114EFC:: @ 08114EFC - .incbin "baserom.gba", 0x114EFC, 0x0000010 - -gUnk_08114F0C:: @ 08114F0C - .incbin "baserom.gba", 0x114F0C, 0x0000024 - -gUnk_08114F30:: @ 08114F30 - .incbin "baserom.gba", 0x114F30, 0x0000004 - -gUnk_08114F34:: @ 08114F34 - .incbin "baserom.gba", 0x114F34, 0x0000004 - -gUnk_08114F38:: @ 08114F38 - .incbin "baserom.gba", 0x114F38, 0x0000020 - -gUnk_08114F58:: @ 08114F58 - .incbin "baserom.gba", 0x114F58, 0x0000020 - -gUnk_08114F78:: @ 08114F78 - .incbin "baserom.gba", 0x114F78, 0x0000008 - -gUnk_08114F80:: @ 08114F80 - .incbin "baserom.gba", 0x114F80, 0x0000008 - -gUnk_08114F88:: @ 08114F88 - .incbin "baserom.gba", 0x114F88, 0x0000010 - -gUnk_08114F98:: @ 08114F98 - .incbin "baserom.gba", 0x114F98, 0x00003F4 - -gUnk_0811538C:: @ 0811538C - .incbin "baserom.gba", 0x11538C, 0x0000153 - -gUnk_081154DF:: @ 081154DF - .incbin "baserom.gba", 0x1154DF, 0x0000042 - -gUnk_08115521:: @ 08115521 - .incbin "baserom.gba", 0x115521, 0x0000002 - -gUnk_08115523:: @ 08115523 - .incbin "baserom.gba", 0x115523, 0x0000003 - -gUnk_08115526:: @ 08115526 - .incbin "baserom.gba", 0x115526, 0x00001FE - -gUnk_08115724:: @ 08115724 - .incbin "baserom.gba", 0x115724, 0x00003D4 - -gUnk_08115AF8:: @ 08115AF8 - .incbin "baserom.gba", 0x115AF8, 0x00003A4 - -gUnk_08115E9C:: @ 08115E9C - .incbin "baserom.gba", 0x115E9C, 0x0000176 - -gUnk_08116012:: @ 08116012 - .incbin "baserom.gba", 0x116012, 0x000026E - -gUnk_08116280:: @ 08116280 - .incbin "baserom.gba", 0x116280, 0x00002B0 - -gUnk_08116530:: @ 08116530 - .incbin "baserom.gba", 0x116530, 0x00001D3 - -gUnk_08116703:: @ 08116703 - .incbin "baserom.gba", 0x116703, 0x0000085 - -gUnk_08116788:: @ 08116788 - .incbin "baserom.gba", 0x116788, 0x0000100 - -gUnk_08116888:: @ 08116888 - .incbin "baserom.gba", 0x116888, 0x0000017 - -gUnk_0811689F:: @ 0811689F - .incbin "baserom.gba", 0x11689F, 0x00001FD - -gUnk_08116A9C:: @ 08116A9C - .incbin "baserom.gba", 0x116A9C, 0x0000270 - -gUnk_08116D0C:: @ 08116D0C - .incbin "baserom.gba", 0x116D0C, 0x00000C8 - -gUnk_08116DD4:: @ 08116DD4 - .incbin "baserom.gba", 0x116DD4, 0x0000071 - -gUnk_08116E45:: @ 08116E45 - .incbin "baserom.gba", 0x116E45, 0x000011F - -gUnk_08116F64:: @ 08116F64 - .incbin "baserom.gba", 0x116F64, 0x00002A4 - -gUnk_08117208:: @ 08117208 - .incbin "baserom.gba", 0x117208, 0x0000038 - -gUnk_08117240:: @ 08117240 - .incbin "baserom.gba", 0x117240, 0x000039C - -gUnk_081175DC:: @ 081175DC - .incbin "baserom.gba", 0x1175DC, 0x00002D4 - -gUnk_081178B0:: @ 081178B0 - .incbin "baserom.gba", 0x1178B0, 0x00002D4 - -gUnk_08117B84:: @ 08117B84 - .incbin "baserom.gba", 0x117B84, 0x00001E0 - -gUnk_08117D64:: @ 08117D64 - .incbin "baserom.gba", 0x117D64, 0x00000DC - -gUnk_08117E40:: @ 08117E40 - .incbin "baserom.gba", 0x117E40, 0x0000128 - -gUnk_08117F68:: @ 08117F68 - .incbin "baserom.gba", 0x117F68, 0x000006C - -gUnk_08117FD4:: @ 08117FD4 - .incbin "baserom.gba", 0x117FD4, 0x00001AD - -gUnk_08118181:: @ 08118181 - .incbin "baserom.gba", 0x118181, 0x0000033 - -gUnk_081181B4:: @ 081181B4 - .incbin "baserom.gba", 0x1181B4, 0x0000030 - -gUnk_081181E4:: @ 081181E4 - .incbin "baserom.gba", 0x1181E4, 0x0000054 - -gUnk_08118238:: @ 08118238 - .incbin "baserom.gba", 0x118238, 0x000002C - -gUnk_08118264:: @ 08118264 - .incbin "baserom.gba", 0x118264, 0x0000034 - -gUnk_08118298:: @ 08118298 - .incbin "baserom.gba", 0x118298, 0x0000100 - -gUnk_08118398:: @ 08118398 - .incbin "baserom.gba", 0x118398, 0x0000024 - -gUnk_081183BC:: @ 081183BC - .incbin "baserom.gba", 0x1183BC, 0x00000B0 - -gUnk_0811846C:: @ 0811846C - .incbin "baserom.gba", 0x11846C, 0x000003C - -gUnk_081184A8:: @ 081184A8 - .incbin "baserom.gba", 0x1184A8, 0x00000B0 - -gUnk_08118558:: @ 08118558 - .incbin "baserom.gba", 0x118558, 0x00001C8 - -gUnk_08118720:: @ 08118720 - .incbin "baserom.gba", 0x118720, 0x0000048 - -gUnk_08118768:: @ 08118768 - .incbin "baserom.gba", 0x118768, 0x0000018 - -gUnk_08118780:: @ 08118780 - .incbin "baserom.gba", 0x118780, 0x0000008 - -gUnk_08118788:: @ 08118788 - .incbin "baserom.gba", 0x118788, 0x000000C - -gUnk_08118794:: @ 08118794 - .incbin "baserom.gba", 0x118794, 0x000012C - -gUnk_081188C0:: @ 081188C0 - .incbin "baserom.gba", 0x1188C0, 0x0000088 - -gUnk_08118948:: @ 08118948 - .incbin "baserom.gba", 0x118948, 0x0000018 - -gUnk_08118960:: @ 08118960 - .incbin "baserom.gba", 0x118960, 0x0000014 - -gUnk_08118974:: @ 08118974 - .incbin "baserom.gba", 0x118974, 0x0000014 - -gUnk_08118988:: @ 08118988 - .incbin "baserom.gba", 0x118988, 0x0000278 - -gUnk_08118C00:: @ 08118C00 - .incbin "baserom.gba", 0x118C00, 0x0000138 - -gUnk_08118D38:: @ 08118D38 - .incbin "baserom.gba", 0x118D38, 0x000006C - -gUnk_08118DA4:: @ 08118DA4 - .incbin "baserom.gba", 0x118DA4, 0x000002C - -gUnk_08118DD0:: @ 08118DD0 - .incbin "baserom.gba", 0x118DD0, 0x000000C - -gUnk_08118DDC:: @ 08118DDC - .incbin "baserom.gba", 0x118DDC, 0x0000080 - -gUnk_08118E5C:: @ 08118E5C - .incbin "baserom.gba", 0x118E5C, 0x00000A8 - -gUnk_08118F04:: @ 08118F04 - .incbin "baserom.gba", 0x118F04, 0x0000038 - -gUnk_08118F3C:: @ 08118F3C - .incbin "baserom.gba", 0x118F3C, 0x0000028 - -gUnk_08118F64:: @ 08118F64 - .incbin "baserom.gba", 0x118F64, 0x0000034 - -gUnk_08118F98:: @ 08118F98 - .incbin "baserom.gba", 0x118F98, 0x0000108 - -gUnk_081190A0:: @ 081190A0 - .incbin "baserom.gba", 0x1190A0, 0x0000044 - -gUnk_081190E4:: @ 081190E4 - .incbin "baserom.gba", 0x1190E4, 0x0000038 - -gUnk_0811911C:: @ 0811911C - .incbin "baserom.gba", 0x11911C, 0x0000010 - -gUnk_0811912C:: @ 0811912C - .incbin "baserom.gba", 0x11912C, 0x000005C - -gUnk_08119188:: @ 08119188 - .incbin "baserom.gba", 0x119188, 0x0000120 - -gUnk_081192A8:: @ 081192A8 - .incbin "baserom.gba", 0x1192A8, 0x00002A0 - -gUnk_08119548:: @ 08119548 - .incbin "baserom.gba", 0x119548, 0x000027C - -gUnk_081197C4:: @ 081197C4 - .incbin "baserom.gba", 0x1197C4, 0x0000030 - -gUnk_081197F4:: @ 081197F4 - .incbin "baserom.gba", 0x1197F4, 0x00000D0 - -gUnk_081198C4:: @ 081198C4 - .incbin "baserom.gba", 0x1198C4, 0x0000028 - -gUnk_081198EC:: @ 081198EC - .incbin "baserom.gba", 0x1198EC, 0x00000B8 - -gUnk_081199A4:: @ 081199A4 - .incbin "baserom.gba", 0x1199A4, 0x0000054 - -gUnk_081199F8:: @ 081199F8 - .incbin "baserom.gba", 0x1199F8, 0x000007C - -gUnk_08119A74:: @ 08119A74 - .incbin "baserom.gba", 0x119A74, 0x000007C - -gUnk_08119AF0:: @ 08119AF0 - .incbin "baserom.gba", 0x119AF0, 0x000008C - -gUnk_08119B7C:: @ 08119B7C - .incbin "baserom.gba", 0x119B7C, 0x0000074 - -gUnk_08119BF0:: @ 08119BF0 - .incbin "baserom.gba", 0x119BF0, 0x0000074 - -gUnk_08119C64:: @ 08119C64 - .incbin "baserom.gba", 0x119C64, 0x0000090 - -gUnk_08119CF4:: @ 08119CF4 - .incbin "baserom.gba", 0x119CF4, 0x0000060 - -gUnk_08119D54:: @ 08119D54 - .incbin "baserom.gba", 0x119D54, 0x0000054 - -gUnk_08119DA8:: @ 08119DA8 - .incbin "baserom.gba", 0x119DA8, 0x0000054 - -gUnk_08119DFC:: @ 08119DFC - .incbin "baserom.gba", 0x119DFC, 0x000001C - -gUnk_08119E18:: @ 08119E18 - .incbin "baserom.gba", 0x119E18, 0x000002C - -gUnk_08119E44:: @ 08119E44 - .incbin "baserom.gba", 0x119E44, 0x000006C - -gUnk_08119EB0:: @ 08119EB0 - .incbin "baserom.gba", 0x119EB0, 0x0000028 - -gUnk_08119ED8:: @ 08119ED8 - .incbin "baserom.gba", 0x119ED8, 0x00000A8 - -gUnk_08119F80:: @ 08119F80 - .incbin "baserom.gba", 0x119F80, 0x0000024 - -gUnk_08119FA4:: @ 08119FA4 - .incbin "baserom.gba", 0x119FA4, 0x0000024 - -gUnk_08119FC8:: @ 08119FC8 - .incbin "baserom.gba", 0x119FC8, 0x000000C - -gUnk_08119FD4:: @ 08119FD4 - .incbin "baserom.gba", 0x119FD4, 0x0000048 - -gUnk_0811A01C:: @ 0811A01C - .incbin "baserom.gba", 0x11A01C, 0x0000030 - -gUnk_0811A04C:: @ 0811A04C - .incbin "baserom.gba", 0x11A04C, 0x000001C - -gUnk_0811A068:: @ 0811A068 - .incbin "baserom.gba", 0x11A068, 0x000003C - -gUnk_0811A0A4:: @ 0811A0A4 - .incbin "baserom.gba", 0x11A0A4, 0x0000028 - -gUnk_0811A0CC:: @ 0811A0CC - .incbin "baserom.gba", 0x11A0CC, 0x0000018 - -gUnk_0811A0E4:: @ 0811A0E4 - .incbin "baserom.gba", 0x11A0E4, 0x0000040 - -gUnk_0811A124:: @ 0811A124 - .incbin "baserom.gba", 0x11A124, 0x0000020 - -gUnk_0811A144:: @ 0811A144 - .incbin "baserom.gba", 0x11A144, 0x0000038 - -gUnk_0811A17C:: @ 0811A17C - .incbin "baserom.gba", 0x11A17C, 0x000004C - -gUnk_0811A1C8:: @ 0811A1C8 - .incbin "baserom.gba", 0x11A1C8, 0x0000030 - -gUnk_0811A1F8:: @ 0811A1F8 - .incbin "baserom.gba", 0x11A1F8, 0x0000030 - -gUnk_0811A228:: @ 0811A228 - .incbin "baserom.gba", 0x11A228, 0x0000058 - -gUnk_0811A280:: @ 0811A280 - .incbin "baserom.gba", 0x11A280, 0x000000C - -gUnk_0811A28C:: @ 0811A28C - .incbin "baserom.gba", 0x11A28C, 0x000001C - -gUnk_0811A2A8:: @ 0811A2A8 - .incbin "baserom.gba", 0x11A2A8, 0x0000028 - -gUnk_0811A2D0:: @ 0811A2D0 - .incbin "baserom.gba", 0x11A2D0, 0x000002C - -gUnk_0811A2FC:: @ 0811A2FC - .incbin "baserom.gba", 0x11A2FC, 0x0000214 - -gUnk_0811A510:: @ 0811A510 - .incbin "baserom.gba", 0x11A510, 0x000024C - -gUnk_0811A75C:: @ 0811A75C - .incbin "baserom.gba", 0x11A75C, 0x000004C - -gUnk_0811A7A8:: @ 0811A7A8 - .incbin "baserom.gba", 0x11A7A8, 0x00000C4 - -gUnk_0811A86C:: @ 0811A86C - .incbin "baserom.gba", 0x11A86C, 0x0000060 - -gUnk_0811A8CC:: @ 0811A8CC - .incbin "baserom.gba", 0x11A8CC, 0x00000E8 - -gUnk_0811A9B4:: @ 0811A9B4 - .incbin "baserom.gba", 0x11A9B4, 0x0000078 - -gUnk_0811AA2C:: @ 0811AA2C - .incbin "baserom.gba", 0x11AA2C, 0x0000050 - -gUnk_0811AA7C:: @ 0811AA7C - .incbin "baserom.gba", 0x11AA7C, 0x000009C - -gUnk_0811AB18:: @ 0811AB18 - .incbin "baserom.gba", 0x11AB18, 0x00000E0 - -gUnk_0811ABF8:: @ 0811ABF8 - .incbin "baserom.gba", 0x11ABF8, 0x0000019 - -gUnk_0811AC11:: @ 0811AC11 - .incbin "baserom.gba", 0x11AC11, 0x0000113 - -gUnk_0811AD24:: @ 0811AD24 - .incbin "baserom.gba", 0x11AD24, 0x00000A8 - -gUnk_0811ADCC:: @ 0811ADCC - .incbin "baserom.gba", 0x11ADCC, 0x00000E4 - -gUnk_0811AEB0:: @ 0811AEB0 - .incbin "baserom.gba", 0x11AEB0, 0x0000028 - -gUnk_0811AED8:: @ 0811AED8 - .incbin "baserom.gba", 0x11AED8, 0x000004C - -gUnk_0811AF24:: @ 0811AF24 - .incbin "baserom.gba", 0x11AF24, 0x0000010 - -gUnk_0811AF34:: @ 0811AF34 - .incbin "baserom.gba", 0x11AF34, 0x0000030 - -gUnk_0811AF64:: @ 0811AF64 - .incbin "baserom.gba", 0x11AF64, 0x0000028 - -gUnk_0811AF8C:: @ 0811AF8C - .incbin "baserom.gba", 0x11AF8C, 0x0000030 - -gUnk_0811AFBC:: @ 0811AFBC - .incbin "baserom.gba", 0x11AFBC, 0x0000014 - -gUnk_0811AFD0:: @ 0811AFD0 - .incbin "baserom.gba", 0x11AFD0, 0x0000030 - -gUnk_0811B000:: @ 0811B000 - .incbin "baserom.gba", 0x11B000, 0x000001C - -gUnk_0811B01C:: @ 0811B01C - .incbin "baserom.gba", 0x11B01C, 0x0000010 - -gUnk_0811B02C:: @ 0811B02C - .incbin "baserom.gba", 0x11B02C, 0x0000084 - -gUnk_0811B0B0:: @ 0811B0B0 - .incbin "baserom.gba", 0x11B0B0, 0x0000080 - -gUnk_0811B130:: @ 0811B130 - .incbin "baserom.gba", 0x11B130, 0x0000048 - -gUnk_0811B178:: @ 0811B178 - .incbin "baserom.gba", 0x11B178, 0x0000018 - -gUnk_0811B190:: @ 0811B190 - .incbin "baserom.gba", 0x11B190, 0x0000084 - -gUnk_0811B214:: @ 0811B214 - .incbin "baserom.gba", 0x11B214, 0x0000044 - -gUnk_0811B258:: @ 0811B258 - .incbin "baserom.gba", 0x11B258, 0x000003C - -gUnk_0811B294:: @ 0811B294 - .incbin "baserom.gba", 0x11B294, 0x0000068 - -gUnk_0811B2FC:: @ 0811B2FC - .incbin "baserom.gba", 0x11B2FC, 0x0000050 - -gUnk_0811B34C:: @ 0811B34C - .incbin "baserom.gba", 0x11B34C, 0x0000048 - -gUnk_0811B394:: @ 0811B394 - .incbin "baserom.gba", 0x11B394, 0x0000010 - -gUnk_0811B3A4:: @ 0811B3A4 - .incbin "baserom.gba", 0x11B3A4, 0x0000010 - -gUnk_0811B3B4:: @ 0811B3B4 - .incbin "baserom.gba", 0x11B3B4, 0x0000014 - -gUnk_0811B3C8:: @ 0811B3C8 - .incbin "baserom.gba", 0x11B3C8, 0x0000040 - -gUnk_0811B408:: @ 0811B408 - .incbin "baserom.gba", 0x11B408, 0x0000138 - -gUnk_0811B540:: @ 0811B540 - .incbin "baserom.gba", 0x11B540, 0x0000024 - -gUnk_0811B564:: @ 0811B564 - .incbin "baserom.gba", 0x11B564, 0x0000014 - -gUnk_0811B578:: @ 0811B578 - .incbin "baserom.gba", 0x11B578, 0x00003C8 - -gUnk_0811B940:: @ 0811B940 - .incbin "baserom.gba", 0x11B940, 0x000004C - -gUnk_0811B98C:: @ 0811B98C - .incbin "baserom.gba", 0x11B98C, 0x0000014 - -gUnk_0811B9A0:: @ 0811B9A0 - .incbin "baserom.gba", 0x11B9A0, 0x0000008 - -gUnk_0811B9A8:: @ 0811B9A8 - .incbin "baserom.gba", 0x11B9A8, 0x0000020 - -gUnk_0811B9C8:: @ 0811B9C8 - .incbin "baserom.gba", 0x11B9C8, 0x0000008 - -gUnk_0811B9D0:: @ 0811B9D0 - .incbin "baserom.gba", 0x11B9D0, 0x0000008 - -gUnk_0811B9D8:: @ 0811B9D8 - .incbin "baserom.gba", 0x11B9D8, 0x0000008 - -gUnk_0811B9E0:: @ 0811B9E0 - .incbin "baserom.gba", 0x11B9E0, 0x0000080 - -gUnk_0811BA60:: @ 0811BA60 - .incbin "baserom.gba", 0x11BA60, 0x0000008 - -gUnk_0811BA68:: @ 0811BA68 - .incbin "baserom.gba", 0x11BA68, 0x000000C - -gUnk_0811BA74:: @ 0811BA74 - .incbin "baserom.gba", 0x11BA74, 0x0000008 - -gUnk_0811BA7C:: @ 0811BA7C - .incbin "baserom.gba", 0x11BA7C, 0x000000C - -gUnk_0811BA88:: @ 0811BA88 - .incbin "baserom.gba", 0x11BA88, 0x000000C - -gUnk_0811BA94:: @ 0811BA94 - .incbin "baserom.gba", 0x11BA94, 0x0000008 - -gUnk_0811BA9C:: @ 0811BA9C - .incbin "baserom.gba", 0x11BA9C, 0x0000020 - -gUnk_0811BABC:: @ 0811BABC - .incbin "baserom.gba", 0x11BABC, 0x0000008 - -gUnk_0811BAC4:: @ 0811BAC4 - .incbin "baserom.gba", 0x11BAC4, 0x0000010 - -gUnk_0811BAD4:: @ 0811BAD4 - .incbin "baserom.gba", 0x11BAD4, 0x0000010 - -gUnk_0811BAE4:: @ 0811BAE4 - .incbin "baserom.gba", 0x11BAE4, 0x000000C - -gUnk_0811BAF0:: @ 0811BAF0 - .incbin "baserom.gba", 0x11BAF0, 0x000003C - -gUnk_0811BB2C:: @ 0811BB2C - .incbin "baserom.gba", 0x11BB2C, 0x000000C - -gUnk_0811BB38:: @ 0811BB38 - .incbin "baserom.gba", 0x11BB38, 0x0000004 - -gUnk_0811BB3C:: @ 0811BB3C - .incbin "baserom.gba", 0x11BB3C, 0x000000C - -gUnk_0811BB48:: @ 0811BB48 - .incbin "baserom.gba", 0x11BB48, 0x0000008 - -gUnk_0811BB50:: @ 0811BB50 - .incbin "baserom.gba", 0x11BB50, 0x0000008 - -gUnk_0811BB58:: @ 0811BB58 - .incbin "baserom.gba", 0x11BB58, 0x0000008 - -gUnk_0811BB60:: @ 0811BB60 - .incbin "baserom.gba", 0x11BB60, 0x0000008 - -gUnk_0811BB68:: @ 0811BB68 - .incbin "baserom.gba", 0x11BB68, 0x0000008 - -gUnk_0811BB70:: @ 0811BB70 - .incbin "baserom.gba", 0x11BB70, 0x0000010 - -gUnk_0811BB80:: @ 0811BB80 - .incbin "baserom.gba", 0x11BB80, 0x0000008 - -gUnk_0811BB88:: @ 0811BB88 - .incbin "baserom.gba", 0x11BB88, 0x0000008 - -gUnk_0811BB90:: @ 0811BB90 - .incbin "baserom.gba", 0x11BB90, 0x0000008 - -gUnk_0811BB98:: @ 0811BB98 - .incbin "baserom.gba", 0x11BB98, 0x0000014 - -gUnk_0811BBAC:: @ 0811BBAC - .incbin "baserom.gba", 0x11BBAC, 0x0000010 - -gUnk_0811BBBC:: @ 0811BBBC - .incbin "baserom.gba", 0x11BBBC, 0x0000006 - -gUnk_0811BBC2:: @ 0811BBC2 - .incbin "baserom.gba", 0x11BBC2, 0x0000006 - -gUnk_0811BBC8:: @ 0811BBC8 - .incbin "baserom.gba", 0x11BBC8, 0x0000006 - -gUnk_0811BBCE:: @ 0811BBCE - .incbin "baserom.gba", 0x11BBCE, 0x0000006 - -gUnk_0811BBD4:: @ 0811BBD4 - .incbin "baserom.gba", 0x11BBD4, 0x0000010 - -gUnk_0811BBE4:: @ 0811BBE4 - .incbin "baserom.gba", 0x11BBE4, 0x0000008 - -gUnk_0811BBEC:: @ 0811BBEC - .incbin "baserom.gba", 0x11BBEC, 0x000000C - -gUnk_0811BBF8:: @ 0811BBF8 - .incbin "baserom.gba", 0x11BBF8, 0x0000010 - -gUnk_0811BC08:: @ 0811BC08 - .incbin "baserom.gba", 0x11BC08, 0x0000020 - -gUnk_0811BC28:: @ 0811BC28 - .incbin "baserom.gba", 0x11BC28, 0x0000008 - -gUnk_0811BC30:: @ 0811BC30 - .incbin "baserom.gba", 0x11BC30, 0x0000008 - -gUnk_0811BC38:: @ 0811BC38 - .incbin "baserom.gba", 0x11BC38, 0x0000008 - -gUnk_0811BC40:: @ 0811BC40 - .incbin "baserom.gba", 0x11BC40, 0x0000008 - -gUnk_0811BC48:: @ 0811BC48 - .incbin "baserom.gba", 0x11BC48, 0x0000018 - -gUnk_0811BC60:: @ 0811BC60 - .incbin "baserom.gba", 0x11BC60, 0x0000020 - -gUnk_0811BC80:: @ 0811BC80 - .incbin "baserom.gba", 0x11BC80, 0x0000008 - -gUnk_0811BC88:: @ 0811BC88 - .incbin "baserom.gba", 0x11BC88, 0x0000010 - -gUnk_0811BC98:: @ 0811BC98 - .incbin "baserom.gba", 0x11BC98, 0x000001C - -gUnk_0811BCB4:: @ 0811BCB4 - .incbin "baserom.gba", 0x11BCB4, 0x0000010 diff --git a/data/data_08114208.s b/data/data_08114208.s new file mode 100644 index 00000000..fc5876e7 --- /dev/null +++ b/data/data_08114208.s @@ -0,0 +1,710 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + .align 2 + +gUnk_08114208:: @ 08114208 + .incbin "baserom.gba", 0x114208, 0x0000005 + +gUnk_0811420D:: @ 0811420D + .incbin "baserom.gba", 0x11420D, 0x0000004 + +gUnk_08114211:: @ 08114211 + .incbin "baserom.gba", 0x114211, 0x0000005 + +gUnk_08114216:: @ 08114216 + .incbin "baserom.gba", 0x114216, 0x0000009 + +gUnk_0811421F:: @ 0811421F + .incbin "baserom.gba", 0x11421F, 0x0000009 + +gUnk_08114228:: @ 08114228 + .incbin "baserom.gba", 0x114228, 0x0000014 + +gUnk_0811423C:: @ 0811423C + .incbin "baserom.gba", 0x11423C, 0x0000008 + +gUnk_08114244:: @ 08114244 + .incbin "baserom.gba", 0x114244, 0x0000019 + +gUnk_0811425D:: @ 0811425D + .incbin "baserom.gba", 0x11425D, 0x0000019 + +gUnk_08114276:: @ 08114276 + .incbin "baserom.gba", 0x114276, 0x0000019 + +gUnk_0811428F:: @ 0811428F + .incbin "baserom.gba", 0x11428F, 0x0000019 + +gUnk_081142A8:: @ 081142A8 + .incbin "baserom.gba", 0x1142A8, 0x0000014 + +gUnk_081142BC:: @ 081142BC + .incbin "baserom.gba", 0x1142BC, 0x0000010 + +gUnk_081142CC:: @ 081142CC + .incbin "baserom.gba", 0x1142CC, 0x0000010 + +gUnk_081142DC:: @ 081142DC + .incbin "baserom.gba", 0x1142DC, 0x0000020 + +gUnk_081142FC:: @ 081142FC + .incbin "baserom.gba", 0x1142FC, 0x0000008 + +gUnk_08114304:: @ 08114304 + .incbin "baserom.gba", 0x114304, 0x0000004 + +gUnk_08114308:: @ 08114308 + .incbin "baserom.gba", 0x114308, 0x0000128 + +gUnk_08114430:: @ 08114430 + .incbin "baserom.gba", 0x114430, 0x0000002 + +gUnk_08114432:: @ 08114432 + .incbin "baserom.gba", 0x114432, 0x0000012 + +gUnk_08114444:: @ 08114444 + .incbin "baserom.gba", 0x114444, 0x0000084 + +gUnk_081144C8:: @ 081144C8 + .incbin "baserom.gba", 0x1144C8, 0x0000005 + +gUnk_081144CD:: @ 081144CD + .incbin "baserom.gba", 0x1144CD, 0x0000005 + +gUnk_081144D2:: @ 081144D2 + .incbin "baserom.gba", 0x1144D2, 0x0000005 + +gUnk_081144D7:: @ 081144D7 + .incbin "baserom.gba", 0x1144D7, 0x0000005 + +gUnk_081144DC:: @ 081144DC + .incbin "baserom.gba", 0x1144DC, 0x0000014 + +gUnk_081144F0:: @ 081144F0 + .incbin "baserom.gba", 0x1144F0, 0x000000C + +gUnk_081144FC:: @ 081144FC + .incbin "baserom.gba", 0x1144FC, 0x0000035 + +gUnk_08114531:: @ 08114531 + .incbin "baserom.gba", 0x114531, 0x000000B + +gUnk_0811453C:: @ 0811453C + .incbin "baserom.gba", 0x11453C, 0x0000011 + +gUnk_0811454D:: @ 0811454D + .incbin "baserom.gba", 0x11454D, 0x0000011 + +gUnk_0811455E:: @ 0811455E + .incbin "baserom.gba", 0x11455E, 0x0000011 + +gUnk_0811456F:: @ 0811456F + .incbin "baserom.gba", 0x11456F, 0x0000005 + +gUnk_08114574:: @ 08114574 + .incbin "baserom.gba", 0x114574, 0x0000005 + +gUnk_08114579:: @ 08114579 + .incbin "baserom.gba", 0x114579, 0x0000007 + +gUnk_08114580:: @ 08114580 + .incbin "baserom.gba", 0x114580, 0x0000034 + +gUnk_081145B4:: @ 081145B4 + .incbin "baserom.gba", 0x1145B4, 0x0000014 + +gUnk_081145C8:: @ 081145C8 + .incbin "baserom.gba", 0x1145C8, 0x0000008 + +gUnk_081145D0:: @ 081145D0 + .incbin "baserom.gba", 0x1145D0, 0x0000004 + +gUnk_081145D4:: @ 081145D4 + .incbin "baserom.gba", 0x1145D4, 0x0000010 + +gUnk_081145E4:: @ 081145E4 + .incbin "baserom.gba", 0x1145E4, 0x00000D4 + +gUnk_081146B8:: @ 081146B8 + .incbin "baserom.gba", 0x1146B8, 0x0000018 + +gUnk_081146D0:: @ 081146D0 + .incbin "baserom.gba", 0x1146D0, 0x0000014 + +gUnk_081146E4:: @ 081146E4 + .incbin "baserom.gba", 0x1146E4, 0x0000010 + +gUnk_081146F4:: @ 081146F4 + .incbin "baserom.gba", 0x1146F4, 0x00000A8 + +gUnk_0811479C:: @ 0811479C + .incbin "baserom.gba", 0x11479C, 0x0000048 + +gUnk_081147E4:: @ 081147E4 + .incbin "baserom.gba", 0x1147E4, 0x0000020 + +gUnk_08114804:: @ 08114804 + .incbin "baserom.gba", 0x114804, 0x0000010 + +gUnk_08114814:: @ 08114814 + .incbin "baserom.gba", 0x114814, 0x0000010 + +gUnk_08114824:: @ 08114824 + .incbin "baserom.gba", 0x114824, 0x0000040 + +gUnk_08114864:: @ 08114864 + .incbin "baserom.gba", 0x114864, 0x0000010 + +gUnk_08114874:: @ 08114874 + .incbin "baserom.gba", 0x114874, 0x0000030 + +gUnk_081148A4:: @ 081148A4 + .incbin "baserom.gba", 0x1148A4, 0x0000020 + +gUnk_081148C4:: @ 081148C4 + .incbin "baserom.gba", 0x1148C4, 0x0000020 + +gUnk_081148E4:: @ 081148E4 + .incbin "baserom.gba", 0x1148E4, 0x0000030 + +gUnk_08114914:: @ 08114914 + .incbin "baserom.gba", 0x114914, 0x0000030 + +gUnk_08114944:: @ 08114944 + .incbin "baserom.gba", 0x114944, 0x0000030 + +gUnk_08114974:: @ 08114974 + .incbin "baserom.gba", 0x114974, 0x0000010 + +gUnk_08114984:: @ 08114984 + .incbin "baserom.gba", 0x114984, 0x0000010 + +gUnk_08114994:: @ 08114994 + .incbin "baserom.gba", 0x114994, 0x0000010 + +gUnk_081149A4:: @ 081149A4 + .incbin "baserom.gba", 0x1149A4, 0x0000010 + +gUnk_081149B4:: @ 081149B4 + .incbin "baserom.gba", 0x1149B4, 0x0000010 + +gUnk_081149C4:: @ 081149C4 + .incbin "baserom.gba", 0x1149C4, 0x0000030 + +gUnk_081149F4:: @ 081149F4 + .incbin "baserom.gba", 0x1149F4, 0x0000020 + +gUnk_08114A14:: @ 08114A14 + .incbin "baserom.gba", 0x114A14, 0x0000058 + +gUnk_08114A6C:: @ 08114A6C + .incbin "baserom.gba", 0x114A6C, 0x0000020 + +gUnk_08114A8C:: @ 08114A8C + .incbin "baserom.gba", 0x114A8C, 0x0000030 + +gUnk_08114ABC:: @ 08114ABC + .incbin "baserom.gba", 0x114ABC, 0x0000028 + +gUnk_08114AE4:: @ 08114AE4 + .incbin "baserom.gba", 0x114AE4, 0x0000400 + +gUnk_08114EE4:: @ 08114EE4 + .incbin "baserom.gba", 0x114EE4, 0x0000018 + +gUnk_08114EFC:: @ 08114EFC + .incbin "baserom.gba", 0x114EFC, 0x0000010 + +gUnk_08114F0C:: @ 08114F0C + .incbin "baserom.gba", 0x114F0C, 0x0000024 + +gUnk_08114F30:: @ 08114F30 + .incbin "baserom.gba", 0x114F30, 0x0000004 + +gUnk_08114F34:: @ 08114F34 + .incbin "baserom.gba", 0x114F34, 0x0000004 + +gUnk_08114F38:: @ 08114F38 + .incbin "baserom.gba", 0x114F38, 0x0000020 + +gUnk_08114F58:: @ 08114F58 + .incbin "baserom.gba", 0x114F58, 0x0000020 + +gUnk_08114F78:: @ 08114F78 + .incbin "baserom.gba", 0x114F78, 0x0000008 + +gUnk_08114F80:: @ 08114F80 + .incbin "baserom.gba", 0x114F80, 0x0000008 + +gUnk_08114F88:: @ 08114F88 + .incbin "baserom.gba", 0x114F88, 0x0000010 + +gUnk_08114F98:: @ 08114F98 + .incbin "baserom.gba", 0x114F98, 0x00003F4 + +gUnk_0811538C:: @ 0811538C + .incbin "baserom.gba", 0x11538C, 0x0000153 + +gUnk_081154DF:: @ 081154DF + .incbin "baserom.gba", 0x1154DF, 0x0000042 + +gUnk_08115521:: @ 08115521 + .incbin "baserom.gba", 0x115521, 0x0000002 + +gUnk_08115523:: @ 08115523 + .incbin "baserom.gba", 0x115523, 0x0000003 + +gUnk_08115526:: @ 08115526 + .incbin "baserom.gba", 0x115526, 0x00001FE + +gUnk_08115724:: @ 08115724 + .incbin "baserom.gba", 0x115724, 0x00003D4 + +gUnk_08115AF8:: @ 08115AF8 + .incbin "baserom.gba", 0x115AF8, 0x00003A4 + +gUnk_08115E9C:: @ 08115E9C + .incbin "baserom.gba", 0x115E9C, 0x0000176 + +gUnk_08116012:: @ 08116012 + .incbin "baserom.gba", 0x116012, 0x000026E + +gUnk_08116280:: @ 08116280 + .incbin "baserom.gba", 0x116280, 0x00002B0 + +gUnk_08116530:: @ 08116530 + .incbin "baserom.gba", 0x116530, 0x00001D3 + +gUnk_08116703:: @ 08116703 + .incbin "baserom.gba", 0x116703, 0x0000085 + +gUnk_08116788:: @ 08116788 + .incbin "baserom.gba", 0x116788, 0x0000100 + +gUnk_08116888:: @ 08116888 + .incbin "baserom.gba", 0x116888, 0x0000017 + +gUnk_0811689F:: @ 0811689F + .incbin "baserom.gba", 0x11689F, 0x00001FD + +gUnk_08116A9C:: @ 08116A9C + .incbin "baserom.gba", 0x116A9C, 0x0000270 + +gUnk_08116D0C:: @ 08116D0C + .incbin "baserom.gba", 0x116D0C, 0x00000C8 + +gUnk_08116DD4:: @ 08116DD4 + .incbin "baserom.gba", 0x116DD4, 0x0000071 + +gUnk_08116E45:: @ 08116E45 + .incbin "baserom.gba", 0x116E45, 0x000011F + +gUnk_08116F64:: @ 08116F64 + .incbin "baserom.gba", 0x116F64, 0x00002A4 + +gUnk_08117208:: @ 08117208 + .incbin "baserom.gba", 0x117208, 0x0000038 + +gUnk_08117240:: @ 08117240 + .incbin "baserom.gba", 0x117240, 0x000039C + +gUnk_081175DC:: @ 081175DC + .incbin "baserom.gba", 0x1175DC, 0x00002D4 + +gUnk_081178B0:: @ 081178B0 + .incbin "baserom.gba", 0x1178B0, 0x00002D4 + +gUnk_08117B84:: @ 08117B84 + .incbin "baserom.gba", 0x117B84, 0x00001E0 + +gUnk_08117D64:: @ 08117D64 + .incbin "baserom.gba", 0x117D64, 0x00000DC + +gUnk_08117E40:: @ 08117E40 + .incbin "baserom.gba", 0x117E40, 0x0000128 + +gUnk_08117F68:: @ 08117F68 + .incbin "baserom.gba", 0x117F68, 0x000006C + +gUnk_08117FD4:: @ 08117FD4 + .incbin "baserom.gba", 0x117FD4, 0x00001AD + +gUnk_08118181:: @ 08118181 + .incbin "baserom.gba", 0x118181, 0x0000033 + +gUnk_081181B4:: @ 081181B4 + .incbin "baserom.gba", 0x1181B4, 0x0000030 + +gUnk_081181E4:: @ 081181E4 + .incbin "baserom.gba", 0x1181E4, 0x0000054 + +gUnk_08118238:: @ 08118238 + .incbin "baserom.gba", 0x118238, 0x000002C + +gUnk_08118264:: @ 08118264 + .incbin "baserom.gba", 0x118264, 0x0000034 + +gUnk_08118298:: @ 08118298 + .incbin "baserom.gba", 0x118298, 0x0000100 + +gUnk_08118398:: @ 08118398 + .incbin "baserom.gba", 0x118398, 0x0000024 + +gUnk_081183BC:: @ 081183BC + .incbin "baserom.gba", 0x1183BC, 0x00000B0 + +gUnk_0811846C:: @ 0811846C + .incbin "baserom.gba", 0x11846C, 0x000003C + +gUnk_081184A8:: @ 081184A8 + .incbin "baserom.gba", 0x1184A8, 0x00000B0 + +gUnk_08118558:: @ 08118558 + .incbin "baserom.gba", 0x118558, 0x00001C8 + +gUnk_08118720:: @ 08118720 + .incbin "baserom.gba", 0x118720, 0x0000048 + +gUnk_08118768:: @ 08118768 + .incbin "baserom.gba", 0x118768, 0x0000018 + +gUnk_08118780:: @ 08118780 + .incbin "baserom.gba", 0x118780, 0x0000008 + +gUnk_08118788:: @ 08118788 + .incbin "baserom.gba", 0x118788, 0x000000C + +gUnk_08118794:: @ 08118794 + .incbin "baserom.gba", 0x118794, 0x000012C + +gUnk_081188C0:: @ 081188C0 + .incbin "baserom.gba", 0x1188C0, 0x0000088 + +gUnk_08118948:: @ 08118948 + .incbin "baserom.gba", 0x118948, 0x0000018 + +gUnk_08118960:: @ 08118960 + .incbin "baserom.gba", 0x118960, 0x0000014 + +gUnk_08118974:: @ 08118974 + .incbin "baserom.gba", 0x118974, 0x0000014 + +gUnk_08118988:: @ 08118988 + .incbin "baserom.gba", 0x118988, 0x0000278 + +gUnk_08118C00:: @ 08118C00 + .incbin "baserom.gba", 0x118C00, 0x0000138 + +gUnk_08118D38:: @ 08118D38 + .incbin "baserom.gba", 0x118D38, 0x000006C + +gUnk_08118DA4:: @ 08118DA4 + .incbin "baserom.gba", 0x118DA4, 0x000002C + +gUnk_08118DD0:: @ 08118DD0 + .incbin "baserom.gba", 0x118DD0, 0x000000C + +gUnk_08118DDC:: @ 08118DDC + .incbin "baserom.gba", 0x118DDC, 0x0000080 + +gUnk_08118E5C:: @ 08118E5C + .incbin "baserom.gba", 0x118E5C, 0x00000A8 + +gUnk_08118F04:: @ 08118F04 + .incbin "baserom.gba", 0x118F04, 0x0000038 + +gUnk_08118F3C:: @ 08118F3C + .incbin "baserom.gba", 0x118F3C, 0x0000028 + +gUnk_08118F64:: @ 08118F64 + .incbin "baserom.gba", 0x118F64, 0x0000034 + +gUnk_08118F98:: @ 08118F98 + .incbin "baserom.gba", 0x118F98, 0x0000108 + +gUnk_081190A0:: @ 081190A0 + .incbin "baserom.gba", 0x1190A0, 0x0000044 + +gUnk_081190E4:: @ 081190E4 + .incbin "baserom.gba", 0x1190E4, 0x0000038 + +gUnk_0811911C:: @ 0811911C + .incbin "baserom.gba", 0x11911C, 0x0000010 + +gUnk_0811912C:: @ 0811912C + .incbin "baserom.gba", 0x11912C, 0x000005C + +gUnk_08119188:: @ 08119188 + .incbin "baserom.gba", 0x119188, 0x0000120 + +gUnk_081192A8:: @ 081192A8 + .incbin "baserom.gba", 0x1192A8, 0x00002A0 + +gUnk_08119548:: @ 08119548 + .incbin "baserom.gba", 0x119548, 0x000027C + +gUnk_081197C4:: @ 081197C4 + .incbin "baserom.gba", 0x1197C4, 0x0000030 + +gUnk_081197F4:: @ 081197F4 + .incbin "baserom.gba", 0x1197F4, 0x00000D0 + +gUnk_081198C4:: @ 081198C4 + .incbin "baserom.gba", 0x1198C4, 0x0000028 + +gUnk_081198EC:: @ 081198EC + .incbin "baserom.gba", 0x1198EC, 0x00000B8 + +gUnk_081199A4:: @ 081199A4 + .incbin "baserom.gba", 0x1199A4, 0x0000054 + +gUnk_081199F8:: @ 081199F8 + .incbin "baserom.gba", 0x1199F8, 0x000007C + +gUnk_08119A74:: @ 08119A74 + .incbin "baserom.gba", 0x119A74, 0x000007C + +gUnk_08119AF0:: @ 08119AF0 + .incbin "baserom.gba", 0x119AF0, 0x000008C + +gUnk_08119B7C:: @ 08119B7C + .incbin "baserom.gba", 0x119B7C, 0x0000074 + +gUnk_08119BF0:: @ 08119BF0 + .incbin "baserom.gba", 0x119BF0, 0x0000074 + +gUnk_08119C64:: @ 08119C64 + .incbin "baserom.gba", 0x119C64, 0x0000090 + +gUnk_08119CF4:: @ 08119CF4 + .incbin "baserom.gba", 0x119CF4, 0x0000060 + +gUnk_08119D54:: @ 08119D54 + .incbin "baserom.gba", 0x119D54, 0x0000054 + +gUnk_08119DA8:: @ 08119DA8 + .incbin "baserom.gba", 0x119DA8, 0x0000054 + +gUnk_08119DFC:: @ 08119DFC + .incbin "baserom.gba", 0x119DFC, 0x000001C + +gUnk_08119E18:: @ 08119E18 + .incbin "baserom.gba", 0x119E18, 0x000002C + +gUnk_08119E44:: @ 08119E44 + .incbin "baserom.gba", 0x119E44, 0x000006C + +gUnk_08119EB0:: @ 08119EB0 + .incbin "baserom.gba", 0x119EB0, 0x0000028 + +gUnk_08119ED8:: @ 08119ED8 + .incbin "baserom.gba", 0x119ED8, 0x00000A8 + +gUnk_08119F80:: @ 08119F80 + .incbin "baserom.gba", 0x119F80, 0x0000024 + +gUnk_08119FA4:: @ 08119FA4 + .incbin "baserom.gba", 0x119FA4, 0x0000024 + +gUnk_08119FC8:: @ 08119FC8 + .incbin "baserom.gba", 0x119FC8, 0x000000C + +gUnk_08119FD4:: @ 08119FD4 + .incbin "baserom.gba", 0x119FD4, 0x0000048 + +gUnk_0811A01C:: @ 0811A01C + .incbin "baserom.gba", 0x11A01C, 0x0000030 + +gUnk_0811A04C:: @ 0811A04C + .incbin "baserom.gba", 0x11A04C, 0x000001C + +gUnk_0811A068:: @ 0811A068 + .incbin "baserom.gba", 0x11A068, 0x000003C + +gUnk_0811A0A4:: @ 0811A0A4 + .incbin "baserom.gba", 0x11A0A4, 0x0000028 + +gUnk_0811A0CC:: @ 0811A0CC + .incbin "baserom.gba", 0x11A0CC, 0x0000018 + +gUnk_0811A0E4:: @ 0811A0E4 + .incbin "baserom.gba", 0x11A0E4, 0x0000040 + +gUnk_0811A124:: @ 0811A124 + .incbin "baserom.gba", 0x11A124, 0x0000020 + +gUnk_0811A144:: @ 0811A144 + .incbin "baserom.gba", 0x11A144, 0x0000038 + +gUnk_0811A17C:: @ 0811A17C + .incbin "baserom.gba", 0x11A17C, 0x000004C + +gUnk_0811A1C8:: @ 0811A1C8 + .incbin "baserom.gba", 0x11A1C8, 0x0000030 + +gUnk_0811A1F8:: @ 0811A1F8 + .incbin "baserom.gba", 0x11A1F8, 0x0000030 + +gUnk_0811A228:: @ 0811A228 + .incbin "baserom.gba", 0x11A228, 0x0000058 + +gUnk_0811A280:: @ 0811A280 + .incbin "baserom.gba", 0x11A280, 0x000000C + +gUnk_0811A28C:: @ 0811A28C + .incbin "baserom.gba", 0x11A28C, 0x000001C + +gUnk_0811A2A8:: @ 0811A2A8 + .incbin "baserom.gba", 0x11A2A8, 0x0000028 + +gUnk_0811A2D0:: @ 0811A2D0 + .incbin "baserom.gba", 0x11A2D0, 0x000002C + +gUnk_0811A2FC:: @ 0811A2FC + .incbin "baserom.gba", 0x11A2FC, 0x0000214 + +gUnk_0811A510:: @ 0811A510 + .incbin "baserom.gba", 0x11A510, 0x000024C + +gUnk_0811A75C:: @ 0811A75C + .incbin "baserom.gba", 0x11A75C, 0x000004C + +gUnk_0811A7A8:: @ 0811A7A8 + .incbin "baserom.gba", 0x11A7A8, 0x00000C4 + +gUnk_0811A86C:: @ 0811A86C + .incbin "baserom.gba", 0x11A86C, 0x0000060 + +gUnk_0811A8CC:: @ 0811A8CC + .incbin "baserom.gba", 0x11A8CC, 0x00000E8 + +gUnk_0811A9B4:: @ 0811A9B4 + .incbin "baserom.gba", 0x11A9B4, 0x0000078 + +gUnk_0811AA2C:: @ 0811AA2C + .incbin "baserom.gba", 0x11AA2C, 0x0000050 + +gUnk_0811AA7C:: @ 0811AA7C + .incbin "baserom.gba", 0x11AA7C, 0x000009C + +gUnk_0811AB18:: @ 0811AB18 + .incbin "baserom.gba", 0x11AB18, 0x00000E0 + +gUnk_0811ABF8:: @ 0811ABF8 + .incbin "baserom.gba", 0x11ABF8, 0x0000019 + +gUnk_0811AC11:: @ 0811AC11 + .incbin "baserom.gba", 0x11AC11, 0x0000113 + +gUnk_0811AD24:: @ 0811AD24 + .incbin "baserom.gba", 0x11AD24, 0x00000A8 + +gUnk_0811ADCC:: @ 0811ADCC + .incbin "baserom.gba", 0x11ADCC, 0x00000E4 + +gUnk_0811AEB0:: @ 0811AEB0 + .incbin "baserom.gba", 0x11AEB0, 0x0000028 + +gUnk_0811AED8:: @ 0811AED8 + .incbin "baserom.gba", 0x11AED8, 0x000004C + +gUnk_0811AF24:: @ 0811AF24 + .incbin "baserom.gba", 0x11AF24, 0x0000010 + +gUnk_0811AF34:: @ 0811AF34 + .incbin "baserom.gba", 0x11AF34, 0x0000030 + +gUnk_0811AF64:: @ 0811AF64 + .incbin "baserom.gba", 0x11AF64, 0x0000028 + +gUnk_0811AF8C:: @ 0811AF8C + .incbin "baserom.gba", 0x11AF8C, 0x0000030 + +gUnk_0811AFBC:: @ 0811AFBC + .incbin "baserom.gba", 0x11AFBC, 0x0000014 + +gUnk_0811AFD0:: @ 0811AFD0 + .incbin "baserom.gba", 0x11AFD0, 0x0000030 + +gUnk_0811B000:: @ 0811B000 + .incbin "baserom.gba", 0x11B000, 0x000001C + +gUnk_0811B01C:: @ 0811B01C + .incbin "baserom.gba", 0x11B01C, 0x0000010 + +gUnk_0811B02C:: @ 0811B02C + .incbin "baserom.gba", 0x11B02C, 0x0000084 + +gUnk_0811B0B0:: @ 0811B0B0 + .incbin "baserom.gba", 0x11B0B0, 0x0000080 + +gUnk_0811B130:: @ 0811B130 + .incbin "baserom.gba", 0x11B130, 0x0000048 + +gUnk_0811B178:: @ 0811B178 + .incbin "baserom.gba", 0x11B178, 0x0000018 + +gUnk_0811B190:: @ 0811B190 + .incbin "baserom.gba", 0x11B190, 0x0000084 + +gUnk_0811B214:: @ 0811B214 + .incbin "baserom.gba", 0x11B214, 0x0000044 + +gUnk_0811B258:: @ 0811B258 + .incbin "baserom.gba", 0x11B258, 0x000003C + +gUnk_0811B294:: @ 0811B294 + .incbin "baserom.gba", 0x11B294, 0x0000068 + +gUnk_0811B2FC:: @ 0811B2FC + .incbin "baserom.gba", 0x11B2FC, 0x0000050 + +gUnk_0811B34C:: @ 0811B34C + .incbin "baserom.gba", 0x11B34C, 0x0000048 + +gUnk_0811B394:: @ 0811B394 + .incbin "baserom.gba", 0x11B394, 0x0000010 + +gUnk_0811B3A4:: @ 0811B3A4 + .incbin "baserom.gba", 0x11B3A4, 0x0000010 + +gUnk_0811B3B4:: @ 0811B3B4 + .incbin "baserom.gba", 0x11B3B4, 0x0000014 + +gUnk_0811B3C8:: @ 0811B3C8 + .incbin "baserom.gba", 0x11B3C8, 0x0000040 + +gUnk_0811B408:: @ 0811B408 + .incbin "baserom.gba", 0x11B408, 0x0000138 + +gUnk_0811B540:: @ 0811B540 + .incbin "baserom.gba", 0x11B540, 0x0000024 + +gUnk_0811B564:: @ 0811B564 + .incbin "baserom.gba", 0x11B564, 0x0000014 + +gUnk_0811B578:: @ 0811B578 + .incbin "baserom.gba", 0x11B578, 0x00003C8 + +gUnk_0811B940:: @ 0811B940 + .incbin "baserom.gba", 0x11B940, 0x000004C + +gUnk_0811B98C:: @ 0811B98C + .incbin "baserom.gba", 0x11B98C, 0x0000014 + +gUnk_0811B9A0:: @ 0811B9A0 + .incbin "baserom.gba", 0x11B9A0, 0x0000008 + +gUnk_0811B9A8:: @ 0811B9A8 + .incbin "baserom.gba", 0x11B9A8, 0x0000020 + +gUnk_0811B9C8:: @ 0811B9C8 + .incbin "baserom.gba", 0x11B9C8, 0x0000008 + +gUnk_0811B9D0:: @ 0811B9D0 + .incbin "baserom.gba", 0x11B9D0, 0x0000008 + +gUnk_0811B9D8:: @ 0811B9D8 + .incbin "baserom.gba", 0x11B9D8, 0x0000008 diff --git a/data/data_0811B9E0.s b/data/data_0811B9E0.s new file mode 100644 index 00000000..62216140 --- /dev/null +++ b/data/data_0811B9E0.s @@ -0,0 +1,140 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + .align 2 + +gUnk_0811BA60:: @ 0811BA60 + .incbin "baserom.gba", 0x11BA60, 0x0000008 + +gUnk_0811BA68:: @ 0811BA68 + .incbin "baserom.gba", 0x11BA68, 0x000000C + +gUnk_0811BA74:: @ 0811BA74 + .incbin "baserom.gba", 0x11BA74, 0x0000008 + +gUnk_0811BA7C:: @ 0811BA7C + .incbin "baserom.gba", 0x11BA7C, 0x000000C + +gUnk_0811BA88:: @ 0811BA88 + .incbin "baserom.gba", 0x11BA88, 0x000000C + +gUnk_0811BA94:: @ 0811BA94 + .incbin "baserom.gba", 0x11BA94, 0x0000008 + +gUnk_0811BA9C:: @ 0811BA9C + .incbin "baserom.gba", 0x11BA9C, 0x0000020 + +gUnk_0811BABC:: @ 0811BABC + .incbin "baserom.gba", 0x11BABC, 0x0000008 + +gUnk_0811BAC4:: @ 0811BAC4 + .incbin "baserom.gba", 0x11BAC4, 0x0000010 + +gUnk_0811BAD4:: @ 0811BAD4 + .incbin "baserom.gba", 0x11BAD4, 0x0000010 + +gUnk_0811BAE4:: @ 0811BAE4 + .incbin "baserom.gba", 0x11BAE4, 0x000000C + +gUnk_0811BAF0:: @ 0811BAF0 + .incbin "baserom.gba", 0x11BAF0, 0x000003C + +gUnk_0811BB2C:: @ 0811BB2C + .incbin "baserom.gba", 0x11BB2C, 0x000000C + +gUnk_0811BB38:: @ 0811BB38 + .incbin "baserom.gba", 0x11BB38, 0x0000004 + +gUnk_0811BB3C:: @ 0811BB3C + .incbin "baserom.gba", 0x11BB3C, 0x000000C + +gUnk_0811BB48:: @ 0811BB48 + .incbin "baserom.gba", 0x11BB48, 0x0000008 + +gUnk_0811BB50:: @ 0811BB50 + .incbin "baserom.gba", 0x11BB50, 0x0000008 + +gUnk_0811BB58:: @ 0811BB58 + .incbin "baserom.gba", 0x11BB58, 0x0000008 + +gUnk_0811BB60:: @ 0811BB60 + .incbin "baserom.gba", 0x11BB60, 0x0000008 + +gUnk_0811BB68:: @ 0811BB68 + .incbin "baserom.gba", 0x11BB68, 0x0000008 + +gUnk_0811BB70:: @ 0811BB70 + .incbin "baserom.gba", 0x11BB70, 0x0000010 + +gUnk_0811BB80:: @ 0811BB80 + .incbin "baserom.gba", 0x11BB80, 0x0000008 + +gUnk_0811BB88:: @ 0811BB88 + .incbin "baserom.gba", 0x11BB88, 0x0000008 + +gUnk_0811BB90:: @ 0811BB90 + .incbin "baserom.gba", 0x11BB90, 0x0000008 + +gUnk_0811BB98:: @ 0811BB98 + .incbin "baserom.gba", 0x11BB98, 0x0000014 + +gUnk_0811BBAC:: @ 0811BBAC + .incbin "baserom.gba", 0x11BBAC, 0x0000010 + +gUnk_0811BBBC:: @ 0811BBBC + .incbin "baserom.gba", 0x11BBBC, 0x0000006 + +gUnk_0811BBC2:: @ 0811BBC2 + .incbin "baserom.gba", 0x11BBC2, 0x0000006 + +gUnk_0811BBC8:: @ 0811BBC8 + .incbin "baserom.gba", 0x11BBC8, 0x0000006 + +gUnk_0811BBCE:: @ 0811BBCE + .incbin "baserom.gba", 0x11BBCE, 0x0000006 + +gUnk_0811BBD4:: @ 0811BBD4 + .incbin "baserom.gba", 0x11BBD4, 0x0000010 + +gUnk_0811BBE4:: @ 0811BBE4 + .incbin "baserom.gba", 0x11BBE4, 0x0000008 + +gUnk_0811BBEC:: @ 0811BBEC + .incbin "baserom.gba", 0x11BBEC, 0x000000C + +gUnk_0811BBF8:: @ 0811BBF8 + .incbin "baserom.gba", 0x11BBF8, 0x0000010 + +gUnk_0811BC08:: @ 0811BC08 + .incbin "baserom.gba", 0x11BC08, 0x0000020 + +gUnk_0811BC28:: @ 0811BC28 + .incbin "baserom.gba", 0x11BC28, 0x0000008 + +gUnk_0811BC30:: @ 0811BC30 + .incbin "baserom.gba", 0x11BC30, 0x0000008 + +gUnk_0811BC38:: @ 0811BC38 + .incbin "baserom.gba", 0x11BC38, 0x0000008 + +gUnk_0811BC40:: @ 0811BC40 + .incbin "baserom.gba", 0x11BC40, 0x0000008 + +gUnk_0811BC48:: @ 0811BC48 + .incbin "baserom.gba", 0x11BC48, 0x0000018 + +gUnk_0811BC60:: @ 0811BC60 + .incbin "baserom.gba", 0x11BC60, 0x0000020 + +gUnk_0811BC80:: @ 0811BC80 + .incbin "baserom.gba", 0x11BC80, 0x0000008 + +gUnk_0811BC88:: @ 0811BC88 + .incbin "baserom.gba", 0x11BC88, 0x0000010 + +gUnk_0811BC98:: @ 0811BC98 + .incbin "baserom.gba", 0x11BC98, 0x000001C + +gUnk_0811BCB4:: @ 0811BCB4 + .incbin "baserom.gba", 0x11BCB4, 0x0000010 diff --git a/data/data_0811E454.s b/data/data_0811E454.s index e1d26604..6c777193 100755 --- a/data/data_0811E454.s +++ b/data/data_0811E454.s @@ -4,9 +4,6 @@ .section .rodata .align 2 -gUnk_0811E4BC:: @ 0811E4BC - .incbin "baserom.gba", 0x11E4BC, 0x0000054 - gUnk_0811E510:: @ 0811E510 .incbin "baserom.gba", 0x11E510, 0x0000004 diff --git a/data/data_089FC6C4.s b/data/data_089FC6C4.s index 4b69eaea..fb6fb436 100644 --- a/data/data_089FC6C4.s +++ b/data/data_089FC6C4.s @@ -10301,10 +10301,4 @@ gUnk_08DE7D18:: @ 08DE7D18 .incbin "baserom.gba", 0xDE7D18, 0x0000010 gUnk_08DE7D28:: @ 08DE7D28 - .incbin "baserom.gba", 0xDE7D28, 0x0000018 - -gUnk_08DE7D40:: @ 08DE7D40 - .incbin "baserom.gba", 0xDE7D40, 0x000000C - -gUnk_08DE7D4C:: @ 08DE7D4C - .incbin "baserom.gba", 0xDE7D4C, 0x0000058 + .incbin "baserom.gba", 0xDE7D28, 0x000000C diff --git a/data/scripts.s b/data/scripts.s new file mode 100644 index 00000000..3d208c56 --- /dev/null +++ b/data/scripts.s @@ -0,0 +1,411 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .include "asm/macros/scripts.inc" + + .syntax unified + + .text + + .include "data/scripts/script_08008B5C.inc" + .include "data/scripts/script_08008D50.inc" + .include "data/scripts/script_08008D8C.inc" + .include "data/scripts/script_08008F74.inc" + .include "data/scripts/script_08008FC0.inc" + .include "data/scripts/script_08008FFC.inc" + .include "data/scripts/script_0800903C.inc" + .include "data/scripts/script_08009320.inc" + .include "data/scripts/script_08009340.inc" + .include "data/scripts/script_08009348.inc" + .include "data/scripts/script_0800939A.inc" + .include "data/scripts/script_08009464.inc" + .include "data/scripts/script_080094CC.inc" + .include "data/scripts/script_080094FC.inc" + .include "data/scripts/script_080095F2.inc" + .include "data/scripts/script_08009704.inc" + .include "data/scripts/script_08009740.inc" + .include "data/scripts/script_080097F0.inc" + .include "data/scripts/script_08009838.inc" + .include "data/scripts/script_0800987C.inc" + .include "data/scripts/script_080098D4.inc" + .include "data/scripts/script_08009918.inc" + .include "data/scripts/script_08009950.inc" + .include "data/scripts/script_080099DC.inc" + .include "data/scripts/script_08009A34.inc" + .include "data/scripts/script_08009A84.inc" + .include "data/scripts/script_08009AF8.inc" + .include "data/scripts/script_08009B30.inc" + .include "data/scripts/script_08009B78.inc" + .include "data/scripts/script_08009C68.inc" + .include "data/scripts/script_08009CFC.inc" + .include "data/scripts/script_08009D6C.inc" + .include "data/scripts/script_08009DB0.inc" + .include "data/scripts/script_08009E4E.inc" + .include "data/scripts/script_08009E58.inc" + .include "data/scripts/script_08009E80.inc" + .include "data/scripts/script_08009E88.inc" + .include "data/scripts/script_08009ECC.inc" + .include "data/scripts/script_08009EF0.inc" + .include "data/scripts/script_08009F14.inc" + .include "data/scripts/script_0800A088.inc" + .include "data/scripts/script_0800A0B4.inc" + .include "data/scripts/script_0800A0FC.inc" + .include "data/scripts/script_0800A160.inc" + .include "data/scripts/script_0800A1B4.inc" + .include "data/scripts/script_0800A1D8.inc" + .include "data/scripts/script_0800A310.inc" + .include "data/scripts/script_0800A3D8.inc" + .include "data/scripts/script_0800A500.inc" + .include "data/scripts/script_0800A590.inc" + .include "data/scripts/script_0800A638.inc" + .include "data/scripts/script_0800A65C.inc" + .include "data/scripts/script_0800A680.inc" + .include "data/scripts/script_0800A6A4.inc" + .include "data/scripts/script_0800A6D4.inc" + .include "data/scripts/script_0800A704.inc" + .include "data/scripts/script_0800A734.inc" + .include "data/scripts/script_0800A764.inc" + .include "data/scripts/script_0800A7E4.inc" + .include "data/scripts/script_0800A964.inc" + .include "data/scripts/script_0800A988.inc" + .include "data/scripts/script_0800A9AC.inc" + .include "data/scripts/script_0800A9D0.inc" + .include "data/scripts/script_0800A9F4.inc" + .include "data/scripts/script_0800AA48.inc" + .include "data/scripts/script_0800AA6C.inc" + .include "data/scripts/script_0800AA90.inc" + .include "data/scripts/script_0800AAB4.inc" + .include "data/scripts/script_0800AAD8.inc" + .include "data/scripts/script_0800AB08.inc" + .include "data/scripts/script_0800AB6E.inc" + .include "data/scripts/script_0800ACBC.inc" + .include "data/scripts/script_0800ACE0.inc" + .include "data/scripts/script_0800AD54.inc" + .include "data/scripts/script_0800AEA4.inc" + .include "data/scripts/script_0800AEDC.inc" + .include "data/scripts/script_0800AF18.inc" + .include "data/scripts/script_0800AF44.inc" + .include "data/scripts/script_0800AF68.inc" + .include "data/scripts/script_0800AF8C.inc" + .include "data/scripts/script_0800AFB0.inc" + .include "data/scripts/script_0800AFE8.inc" + .include "data/scripts/script_0800B00C.inc" + .include "data/scripts/script_0800B0AC.inc" + .include "data/scripts/script_0800B0D0.inc" + .include "data/scripts/script_0800B1C0.inc" + .include "data/scripts/script_0800B200.inc" + .include "data/scripts/script_0800B254.inc" + .include "data/scripts/script_0800B308.inc" + .include "data/scripts/script_0800B3A4.inc" + .include "data/scripts/script_0800B41C.inc" + .include "data/scripts/script_0800B4AC.inc" + .include "data/scripts/script_0800B54C.inc" + .include "data/scripts/script_0800B574.inc" + .include "data/scripts/script_0800B5C4.inc" + .include "data/scripts/script_0800B5EC.inc" + .include "data/scripts/script_0800B6C8.inc" + .include "data/scripts/script_0800B7C4.inc" + .include "data/scripts/script_0800B7FC.inc" + .include "data/scripts/script_0800B828.inc" + .include "data/scripts/script_0800B9B4.inc" + .include "data/scripts/script_0800BACC.inc" + .include "data/scripts/script_0800BB00.inc" + .include "data/scripts/script_0800BB30.inc" + .include "data/scripts/script_0800BB64.inc" + .include "data/scripts/script_0800BBA4.inc" + .include "data/scripts/script_0800BBDC.inc" + .include "data/scripts/script_0800BC08.inc" + .include "data/scripts/script_0800BC50.inc" + .include "data/scripts/script_0800BCE8.inc" + .include "data/scripts/script_0800BD78.inc" + .include "data/scripts/script_0800BE1C.inc" + .include "data/scripts/script_0800BECC.inc" + .include "data/scripts/script_0800BF38.inc" + .include "data/scripts/script_0800C004.inc" + .include "data/scripts/script_0800C0B0.inc" + .include "data/scripts/script_0800C160.inc" + .include "data/scripts/script_0800C1D8.inc" + .include "data/scripts/script_0800C2A4.inc" + .include "data/scripts/script_0800C350.inc" + .include "data/scripts/script_0800C370.inc" + .include "data/scripts/script_0800C3B0.inc" + .include "data/scripts/script_0800C3CC.inc" + .include "data/scripts/script_0800C410.inc" + .include "data/scripts/script_0800C45C.inc" + .include "data/scripts/script_0800C494.inc" + .include "data/scripts/script_0800C4D0.inc" + .include "data/scripts/script_0800C50C.inc" + .include "data/scripts/script_0800C550.inc" + .include "data/scripts/script_0800C8C8.inc" + .include "data/scripts/script_0800C8F0.inc" + .include "data/scripts/script_0800C91C.inc" + .include "data/scripts/script_0800CA8C.inc" + .include "data/scripts/script_0800CABC.inc" + .include "data/scripts/script_0800CB54.inc" + .include "data/scripts/script_0800CBD4.inc" + .include "data/scripts/script_0800CC6C.inc" + .include "data/scripts/script_0800CD04.inc" + .include "data/scripts/script_0800CD7C.inc" + .include "data/scripts/script_0800D190.inc" + .include "data/scripts/script_0800D1B4.inc" + .include "data/scripts/script_0800D1E0.inc" + .include "data/scripts/script_0800D218.inc" + .include "data/scripts/script_0800D242.inc" + .include "data/scripts/script_0800D24C.inc" + .include "data/scripts/script_0800D254.inc" + .include "data/scripts/script_0800D278.inc" + .include "data/scripts/script_0800D3EC.inc" + .include "data/scripts/script_0800D414.inc" + .include "data/scripts/script_0800D698.inc" + .include "data/scripts/script_0800D6B4.inc" + .include "data/scripts/script_0800D6D0.inc" + .include "data/scripts/script_0800D6F0.inc" + .include "data/scripts/script_0800D710.inc" + .include "data/scripts/script_0800D76C.inc" + .include "data/scripts/script_0800D84C.inc" + .include "data/scripts/script_0800D874.inc" + .include "data/scripts/script_0800D92C.inc" + .include "data/scripts/script_0800D954.inc" + .include "data/scripts/script_0800DA00.inc" + .include "data/scripts/script_0800DA28.inc" + .include "data/scripts/script_0800DA60.inc" + .include "data/scripts/script_0800DB18.inc" + .include "data/scripts/script_0800DB28.inc" + .include "data/scripts/script_0800DB78.inc" + .include "data/scripts/script_0800DC4C.inc" + .include "data/scripts/script_0800DCAC.inc" + .include "data/scripts/script_0800DDD0.inc" + .include "data/scripts/script_0800DE00.inc" + .include "data/scripts/script_0800DE2C.inc" + .include "data/scripts/script_0800DE50.inc" + .include "data/scripts/script_0800DE78.inc" + .include "data/scripts/script_0800DEB0.inc" + .include "data/scripts/script_0800DED4.inc" + .include "data/scripts/script_0800DF24.inc" + .include "data/scripts/script_0800DFB4.inc" + .include "data/scripts/script_0800DFE4.inc" + .include "data/scripts/script_0800E050.inc" + .include "data/scripts/script_0800E094.inc" + .include "data/scripts/script_0800E0BC.inc" + .include "data/scripts/script_0800E504.inc" + .include "data/scripts/script_0800E544.inc" + .include "data/scripts/script_0800E58C.inc" + .include "data/scripts/script_0800E5C4.inc" + .include "data/scripts/script_0800E5D6.inc" + .include "data/scripts/script_0800E600.inc" + .include "data/scripts/script_0800E62C.inc" + .include "data/scripts/script_0800E658.inc" + .include "data/scripts/script_0800E684.inc" + .include "data/scripts/script_0800E6B0.inc" + .include "data/scripts/script_0800E8A4.inc" + .include "data/scripts/script_0800E8D6.inc" + .include "data/scripts/script_0800E908.inc" + .include "data/scripts/script_0800E9F4.inc" + .include "data/scripts/script_0800EA1C.inc" + .include "data/scripts/script_0800EA54.inc" + .include "data/scripts/script_0800EF40.inc" + .include "data/scripts/script_0800EF9C.inc" + .include "data/scripts/script_0800EFC0.inc" + .include "data/scripts/script_0800F14C.inc" + .include "data/scripts/script_0800F184.inc" + .include "data/scripts/script_0800F33C.inc" + .include "data/scripts/script_0800F354.inc" + .include "data/scripts/script_0800F36C.inc" + .include "data/scripts/script_0800F384.inc" + .include "data/scripts/script_0800F39C.inc" + .include "data/scripts/script_0800F430.inc" + .include "data/scripts/script_0800F4C4.inc" + .include "data/scripts/script_0800F554.inc" + .include "data/scripts/script_0800F724.inc" + .include "data/scripts/script_0800FA54.inc" + .include "data/scripts/script_0800FA78.inc" + .include "data/scripts/script_0800FA9C.inc" + .include "data/scripts/script_0800FAC0.inc" + .include "data/scripts/script_0800FAE4.inc" + .include "data/scripts/script_0800FB2C.inc" + .include "data/scripts/script_0800FB44.inc" + .include "data/scripts/script_0800FD0C.inc" + .include "data/scripts/script_0800FD80.inc" + .include "data/scripts/script_0800FDA0.inc" + .include "data/scripts/script_0800FF18.inc" + .include "data/scripts/script_0800FF74.inc" + .include "data/scripts/script_080100C8.inc" + .include "data/scripts/script_08010264.inc" + .include "data/scripts/script_08010964.inc" + .include "data/scripts/script_080109F0.inc" + .include "data/scripts/script_08010A14.inc" + .include "data/scripts/script_08010A38.inc" + .include "data/scripts/script_08010A5C.inc" + .include "data/scripts/script_08010A98.inc" + .include "data/scripts/script_08010B68.inc" + .include "data/scripts/script_08010BB4.inc" + .include "data/scripts/script_08010E5A.inc" + .include "data/scripts/script_08010F84.inc" + .include "data/scripts/script_08011074.inc" + .include "data/scripts/script_08011098.inc" + .include "data/scripts/script_080110BC.inc" + .include "data/scripts/script_080110E8.inc" + .include "data/scripts/script_08011128.inc" + .include "data/scripts/script_080111CC.inc" + .include "data/scripts/script_080112C4.inc" + .include "data/scripts/script_080113AA.inc" + .include "data/scripts/script_08011442.inc" + .include "data/scripts/script_08011508.inc" + .include "data/scripts/script_080115D0.inc" + .include "data/scripts/script_08011608.inc" + .include "data/scripts/script_08011640.inc" + .include "data/scripts/script_080116A8.inc" + .include "data/scripts/script_0801183C.inc" + .include "data/scripts/script_08011890.inc" + .include "data/scripts/script_080118D4.inc" + .include "data/scripts/script_08011930.inc" + .include "data/scripts/script_08011940.inc" + .include "data/scripts/script_0801194C.inc" + .include "data/scripts/script_08011B20.inc" + .include "data/scripts/script_08011B40.inc" + .include "data/scripts/script_08011C50.inc" + .include "data/scripts/script_08011C7C.inc" + .include "data/scripts/script_0801232C.inc" + .include "data/scripts/script_08012410.inc" + .include "data/scripts/script_08012430.inc" + .include "data/scripts/script_080126FC.inc" + .include "data/scripts/script_08012AB0.inc" + .include "data/scripts/script_08012AC8.inc" + .include "data/scripts/script_08012AF0.inc" + .include "data/scripts/script_08012B18.inc" + .include "data/scripts/script_08012B24.inc" + .include "data/scripts/script_08012B50.inc" + .include "data/scripts/script_08012B7C.inc" + .include "data/scripts/script_08012BA8.inc" + .include "data/scripts/script_08012BF8.inc" + .include "data/scripts/script_08012C48.inc" + .include "data/scripts/script_08012C68.inc" + .include "data/scripts/script_08012CD8.inc" + .include "data/scripts/script_08012D18.inc" + .include "data/scripts/script_08012D70.inc" + .include "data/scripts/script_08012DB0.inc" + .include "data/scripts/script_08012DD8.inc" + .include "data/scripts/script_08012DF8.inc" + .include "data/scripts/script_08012E20.inc" + .include "data/scripts/script_08012E44.inc" + .include "data/scripts/script_08012E88.inc" + .include "data/scripts/script_08012F0C.inc" + .include "data/scripts/script_08012F86.inc" + .include "data/scripts/script_080130E4.inc" + .include "data/scripts/script_08013114.inc" + .include "data/scripts/script_0801319A.inc" + .include "data/scripts/script_080132E4.inc" + .include "data/scripts/script_0801330C.inc" + .include "data/scripts/script_08013330.inc" + .include "data/scripts/script_0801334C.inc" + .include "data/scripts/script_08013378.inc" + .include "data/scripts/script_080133C4.inc" + .include "data/scripts/script_080133F8.inc" + .include "data/scripts/script_08013494.inc" + .include "data/scripts/script_080134DC.inc" + .include "data/scripts/script_08013650.inc" + .include "data/scripts/script_080136B4.inc" + .include "data/scripts/script_080136D8.inc" + .include "data/scripts/script_08013720.inc" + .include "data/scripts/script_080138B4.inc" + .include "data/scripts/script_08013AA6.inc" + .include "data/scripts/script_08013B18.inc" + .include "data/scripts/script_08013B70.inc" + .include "data/scripts/script_08013BA8.inc" + .include "data/scripts/script_08013BE8.inc" + .include "data/scripts/script_08013CA4.inc" + .include "data/scripts/script_08013D04.inc" + .include "data/scripts/script_08013D44.inc" + .include "data/scripts/script_08013D84.inc" + .include "data/scripts/script_08013DC4.inc" + .include "data/scripts/script_08013E04.inc" + .include "data/scripts/script_08013E28.inc" + .include "data/scripts/script_08013E4C.inc" + .include "data/scripts/script_08013E70.inc" + .include "data/scripts/script_08013E94.inc" + .include "data/scripts/script_08013EB0.inc" + .include "data/scripts/script_08013ECC.inc" + .include "data/scripts/script_08013EE8.inc" + .include "data/scripts/script_08013F04.inc" + .include "data/scripts/script_08013F34.inc" + .include "data/scripts/script_08013F64.inc" + .include "data/scripts/script_08013F94.inc" + .include "data/scripts/script_08013FE8.inc" + .include "data/scripts/script_08014054.inc" + .include "data/scripts/script_08014074.inc" + .include "data/scripts/script_08014094.inc" + .include "data/scripts/script_080140B8.inc" + .include "data/scripts/script_080140DC.inc" + .include "data/scripts/script_08014118.inc" + .include "data/scripts/script_08014154.inc" + .include "data/scripts/script_08014198.inc" + .include "data/scripts/script_080141DC.inc" + .include "data/scripts/script_08014210.inc" + .include "data/scripts/script_08014248.inc" + .include "data/scripts/script_080142B0.inc" + .include "data/scripts/script_08014384.inc" + .include "data/scripts/script_080143C0.inc" + .include "data/scripts/script_08014450.inc" + .include "data/scripts/script_0801450C.inc" + .include "data/scripts/script_08014588.inc" + .include "data/scripts/script_080145B0.inc" + .include "data/scripts/script_080145E8.inc" + .include "data/scripts/script_080147DC.inc" + .include "data/scripts/script_08014804.inc" + .include "data/scripts/script_08014958.inc" + .include "data/scripts/script_080149CC.inc" + .include "data/scripts/script_08014A80.inc" + .include "data/scripts/script_08014B10.inc" + .include "data/scripts/script_08014B34.inc" + .include "data/scripts/script_08014CDC.inc" + .include "data/scripts/script_08014DCC.inc" + .include "data/scripts/script_08014E14.inc" + .include "data/scripts/script_08015234.inc" + .include "data/scripts/script_080152B4.inc" + .include "data/scripts/script_080152DC.inc" + .include "data/scripts/script_08015304.inc" + .include "data/scripts/script_08015338.inc" + .include "data/scripts/script_08015360.inc" + .include "data/scripts/script_08015384.inc" + .include "data/scripts/script_08015390.inc" + .include "data/scripts/script_080153EC.inc" + .include "data/scripts/script_0801548E.inc" + .include "data/scripts/script_0801550C.inc" + .include "data/scripts/script_080155F4.inc" + .include "data/scripts/script_08015618.inc" + .include "data/scripts/script_08015684.inc" + .include "data/scripts/script_08015754.inc" + .include "data/scripts/script_080157AC.inc" + .include "data/scripts/script_080158F8.inc" + .include "data/scripts/script_08015918.inc" + .include "data/scripts/script_08015938.inc" + .include "data/scripts/script_08015958.inc" + .include "data/scripts/script_08015A7C.inc" + .include "data/scripts/script_08015AA0.inc" + .include "data/scripts/script_08015AC4.inc" + .include "data/scripts/script_08015B14.inc" + .include "data/scripts/script_08015B34.inc" + .include "data/scripts/script_08015B84.inc" + .include "data/scripts/script_08015BA8.inc" + .include "data/scripts/script_08015BE8.inc" + .include "data/scripts/script_08015C7C.inc" + .include "data/scripts/script_08015CD4.inc" + .include "data/scripts/script_08015DF0.inc" + .include "data/scripts/script_08015E58.inc" + .include "data/scripts/script_08015F08.inc" + .include "data/scripts/script_08015F3C.inc" + .include "data/scripts/script_08015F80.inc" + .include "data/scripts/script_08015FA4.inc" + .include "data/scripts/script_08015FC0.inc" + .include "data/scripts/script_08016004.inc" + .include "data/scripts/script_08016030.inc" + .include "data/scripts/script_08016062.inc" + .include "data/scripts/script_0801606C.inc" + .include "data/scripts/script_0801609E.inc" + .include "data/scripts/script_080160A8.inc" + .include "data/scripts/script_0801635C.inc" + .include "data/scripts/script_0801637C.inc" + .include "data/scripts/script_08016384.inc" + .include "data/scripts/script_08016482.inc" + .include "data/scripts/script_080165A4.inc" + .include "data/scripts/script_080165D8.inc" diff --git a/data/scripts/script_08008B5C.inc b/data/scripts/script_08008B5C.inc new file mode 100644 index 00000000..4ba55575 --- /dev/null +++ b/data/scripts/script_08008B5C.inc @@ -0,0 +1,129 @@ +SCRIPT_START script_08008B5C + BeginBlock + _0807E9D4 + _0807EB44 0x0004 + _0807E930 0x0000 + DoPostScriptAction 0x000a + EndBlock +script_08008B6E: + _0807E944 + _0807E864 + _0807E930 0x0004 + Call sub_0807F2D4 + Call sub_0806BBB0 + _0807EA94 + _0807E930 0x0008 + _0807E878 + Jump script_08008B6E + .2byte 0x0000 + BeginBlock + _0807E9D4 + _0807EB44 0x0004 + DoPostScriptAction 0x000a + _0807E930 0x0000 + EndBlock +script_08008BA2: + _0807E944 + _0807E864 + _0807E930 0x0004 + Call sub_0807F2D4 + TextboxNoOverlapFollow 0x4912 + _0807EA94 + _0807E930 0x0008 + _0807E878 + Jump script_08008BA2 + BeginBlock + _0807E9D4 + _0807EB44 0x0004 + DoPostScriptAction 0x000a + _0807E930 0x0000 + EndBlock +script_08008BD2: + _0807E944 + _0807E864 + SetGlobalFlag 0x0061 + _0807E930 0x0004 + Call sub_0807F2D4 + _0807EA94 + Call sub_0806BA34 + JumpIfNot script_08008C54 + _0807EA94 + CallWithArg sub_0806BB1C, 0x00000000 + Call sub_0807F2D4 + CallWithArg sub_0806BB1C, 0x00000001 + Call sub_0806BB7C + JumpIfNot script_08008C5C + TextboxNoOverlap 0x490c + _0807EA94 + LoadRoomEntityList gUnk_080D6784 + WaitForSomething 0x00000001 + WaitForSomething 0x00000004 + Wait 0x000f + SoundReq 0x0072 + _0807E930 0x0004 + Call sub_0807F2D4 + TextboxNoOverlap 0x4913 + _0807EA94 + _0807E930 0x0008 + Call sub_0807F2D4 + Jump script_08008C5C +script_08008C54: + _0807E930 0x0008 + Wait 0x000f +script_08008C5C: + _0807EA94 + _0807E878 + Jump script_08008BD2 + BeginBlock + SetEntityPositionRelative 0x0068, 0x0018 + DoPostScriptAction 0x000f + _0807EB44 0x0004 + _0807E930 0x0004 + SetEntitySpeed 0x0300 + SoundReq 0x0121 + EndBlock + WaitForSomething 0x00000002 + TextboxNoOverlap 0x490d + _0807EA94 + DoPostScriptAction 0x0007 + Call sub_08064D08 + _0807EDD4 0x0068, 0x0078 + Call sub_08064D10 + Wait 0x000f + _0807EB44 0x0002 + Wait 0x000f + Call sub_08064D08 + _0807EDD4 0x0098, 0x0078 + Call sub_08064D10 + Wait 0x000f + _0807EB44 0x0004 + SoundReq 0x007f + Wait 0x000f + _0807EB44 0x0002 + _0807EDD4 0x00ac, 0x0078 + Wait 0x000f + _0807EB44 0x0004 + SoundReq 0x007f + Wait 0x000f + _0807EB44 0x0002 + _0807EDD4 0x00c0, 0x0078 + Wait 0x000f + _0807EB44 0x0004 + SoundReq 0x007f + Wait 0x000f + _0807EB44 0x0006 + Wait 0x001e + Call sub_08064D08 + _0807EDD4 0x0068, 0x0078 + Call sub_08064D10 + Wait 0x000f + _0807EB44 0x0000 + Wait 0x000f + Call sub_08064D08 + _0807EDD4 0x0068, 0x0018 + Call sub_08064D10 + SoundReq 0x0121 + _0807E5F8 0x00000001 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08008D50.inc b/data/scripts/script_08008D50.inc new file mode 100644 index 00000000..1b90b9f7 --- /dev/null +++ b/data/scripts/script_08008D50.inc @@ -0,0 +1,17 @@ +SCRIPT_START script_08008D50 + BeginBlock + SetEntityPositionRelative 0x0068, 0x0068 + _0807F0B4 0x0004 + CameraTargetEntity + EndBlock + Wait 0x001e + _0807E5F8 0x00000002 + WaitForSomething 0x00000001 + Wait 0x000f + _0807F0B4 0x0004 + CameraTargetPlayer + Wait 0x001e + _0807E5F8 0x00000004 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08008D8C.inc b/data/scripts/script_08008D8C.inc new file mode 100644 index 00000000..6f419bac --- /dev/null +++ b/data/scripts/script_08008D8C.inc @@ -0,0 +1,110 @@ +SCRIPT_START script_08008D8C + BeginBlock + Call sub_08061FD8 + Call sub_08061E70 + DoPostScriptAction 0x000a + EndBlock +script_08008DA0: + CheckEntityInteractType + JumpIfNot script_08008DA0 + _0807E864 + _0807EB74 + Call sub_08061FD8 + Call sub_08062048 + _0807EA94 + _0807E878 + Jump script_08008DA0 + .2byte 0x0000 + BeginBlock + _0807E9D4 + DoPostScriptAction 0x000a + _0807EB44 0x0004 + CallWithArg sub_0807F3D8, 0x00000000 + EndBlock +script_08008DD8: + CheckEntityInteractType + JumpIfNot script_08008DD8 + _0807E864 + _0807EB74 + CallWithArg sub_0807F3D8, 0x00000000 + Call sub_080643D8 + _0807EA94 + _0807E878 + _0807EB44 0x0004 + CallWithArg sub_0807F3D8, 0x00000000 + Jump script_08008DD8 + BeginBlock + SetEntityPositionRelative 0x0088, 0x0078 + EndBlock +script_08008E12: + CheckPlayerInRegion 0x00d8, 0x0098, 0x4020 + JumpIfNot script_08008E12 + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 + _0807F0B4 0x0001 + CameraTargetEntity + WaitForPlayerAction0x17 + Wait 0x003c + StartPlayerScript script_08008F74 + WaitForSomething2 0x00000020 + _0807E5F8 0x00000001 + WaitForSomething2 0x00000002 + _0807E5F8 0x00000001 + WaitForSomething2 0x00000002 + Wait 0x003c + _0807E5F8 0x00000080 + WaitForSomething2 0x00000100 + _0807E5F8 0x00000001 + WaitForSomething2 0x00000002 + Wait 0x000f + _0807E5F8 0x00000080 + WaitForSomething2 0x00000100 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000008 + TextboxNoOverlapFollowPos 0x1053, 0x000e + _0807EA94 + _0807E5F8 0x00000080 + WaitForSomething2 0x00000100 + _0807E5F8 0x00000080 + WaitForSomething2 0x00000100 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000008 + _0807E5F8 0x00000001 + WaitForSomething2 0x00000002 + _0807E5F8 0x00000080 + WaitForSomething2 0x00000100 + _0807E5F8 0x00000040 + WaitForSomething2 0x00000020 + _0807E5F8 0x00000001 + WaitForSomething2 0x00000002 + _0807F034 0x0035 + WaitPlayerAction8 + StartPlayerScript script_08008FC0 + WaitForSomething2 0x00000020 + _0807E8E4_0 + _0807E5F8 0x00000080 + WaitForSomething2 0x00000100 + _0807E5F8 0x00000010 + Wait 0x0078 + _0807E5F8 0x00000080 + WaitForSomething2 0x00000100 + _0807E8E4_1 + _0807E5F8 0x00000001 + WaitForSomething2 0x00000002 + _0807F034 0x0047 + WaitPlayerAction8 + SetIntVariable 0x00000003 + Call sub_0807F420 + _0807E8E4_0 + _0807E5F8 0x00000080 + WaitForSomething2 0x00000100 + _0807F0B4 0x0004 + CameraTargetPlayer + SetGlobalFlag 0x0015 + Call sub_0806DCC0 + Call sub_0807DF50 + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08008F74.inc b/data/scripts/script_08008F74.inc new file mode 100644 index 00000000..959a01c1 --- /dev/null +++ b/data/scripts/script_08008F74.inc @@ -0,0 +1,19 @@ +SCRIPT_START script_08008F74 + BeginBlock + SetEntitySpeed 0x0100 + EndBlock + DoPostScriptAction 0x0001 + _0807EDD4 0x00b8, 0x0090 + _0807EB44 0x0006 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000020 + WaitForSomething2 0x00000040 + DoPostScriptAction 0x0001 + _0807EDD4 0x0088, 0x0078 + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + Wait 0x000f + _0807E5F8 0x00000020 + Call sub_080791BC +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08008FC0.inc b/data/scripts/script_08008FC0.inc new file mode 100644 index 00000000..dd2791f8 --- /dev/null +++ b/data/scripts/script_08008FC0.inc @@ -0,0 +1,12 @@ +SCRIPT_START script_08008FC0 + _0807F078 0x0001, 0x0001 + CallWithArg sub_0807F918, 0x00000001 + SoundReq 0x0109 + CallWithArg sub_0807F238, 0x0000045f + Call sub_0807F304 + TextboxNoOverlapFollowPos 0x0501, 0x000e + _0807EA94 + _0807E5F8 0x00000020 + Call sub_080791BC +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08008FFC.inc b/data/scripts/script_08008FFC.inc new file mode 100644 index 00000000..318ebf1f --- /dev/null +++ b/data/scripts/script_08008FFC.inc @@ -0,0 +1,18 @@ +SCRIPT_START script_08008FFC + BeginBlock + _0807EB44 0x0000 + _0807E930 0x0000 + EndBlock + WaitForSomething 0x00000010 + SoundReq 0x011c + _0807E930 0x0001 + Wait 0x0010 + SoundReq 0x011c + _0807EB44 0x0004 + _0807E930 0x0006 + Wait 0x0010 + DoPostScriptAction 0x000f + SetEntitySpeed 0x0200 + _0807ECC4 0x1c20 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_0800903C.inc b/data/scripts/script_0800903C.inc new file mode 100644 index 00000000..ba813a3f --- /dev/null +++ b/data/scripts/script_0800903C.inc @@ -0,0 +1,199 @@ +SCRIPT_START script_0800903C + BeginBlock + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + EndBlock + WaitForSomething2 0x00000004 + SoundReq 0x007c + _0807EF3C 0x0180, 0x0030 + _0807EB44 0x0002 + _0807E5F8 0x00000008 + WaitForSomething2 0x00000004 + _0807EB44 0x0004 + _0807E5F8 0x00000008 + BeginBlock + _0807E9D4 + DoPostScriptAction 0x000a + Jump script_0800927E + .2byte 0x0000 + BeginBlock + Call sub_0807F348 + SetEntitySpeed 0x0100 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + _0807E9D4 + DoPostScriptAction 0x000a + EndBlock + WaitForSomething2 0x00000080 + _0807EB44 0x0004 + _0807ECC4 0x0008 + _0807E930 0x0004 + TextboxNoOverlapFollowPos 0x1050, 0x000e + _0807EA94 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000100 + WaitForSomething2 0x00000080 + _0807E930 0x0004 + TextboxNoOverlapFollowPos 0x1052, 0x000e + _0807EA94 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000100 + WaitForSomething2 0x00000080 + _0807EB44 0x0006 + _0807E930 0x0005 + TextboxNoOverlapFollowPos 0x1054, 0x000e + _0807EA94 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000100 + WaitForSomething2 0x00000080 + _0807EB44 0x0004 + _0807E5F8 0x00000100 + WaitForSomething2 0x00000080 + _0807E930 0x0004 + TextboxNoOverlapFollowPos 0x1056, 0x000e + _0807EA94 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000100 + WaitForSomething2 0x00000080 + _0807E930 0x0004 + TextboxNoOverlapFollowPos 0x1057, 0x000e + _0807EA94 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000100 + WaitForSomething2 0x00000080 + _0807E930 0x0004 + TextboxNoOverlapFollowPos 0x1058, 0x000e + _0807EA94 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000100 + WaitForSomething2 0x00000080 + _0807E930 0x0004 + TextboxNoOverlapFollowPos 0x105c, 0x000e + _0807EA94 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000100 +script_0800917C: + CheckEntityInteractType + JumpIfNot script_0800917C + _0807E864 + _0807EB74 + Call sub_0806673C + _0807EA94 + Wait 0x000f + _0807E878 + Jump script_0800917C + BeginBlock + Call sub_0807F348 + _0807EB44 0x0006 + DoPostScriptAction 0x0000 + EndBlock + WaitForSomething2 0x00000001 + _0807EB74 + DoPostScriptAction 0x0001 + TextboxNoOverlapFollowPos 0x105b, 0x0000 + _0807EA94 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000001 + _0807EB44 0x0006 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000001 + DoPostScriptAction 0x0005 + Wait 0x003c + DoPostScriptAction 0x0001 + TextboxNoOverlapFollowPos 0x1051, 0x0000 + _0807EA94 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000001 + DoPostScriptAction 0x0004 + Wait 0x003c + _0807EB74 + _0807EB8C + DoPostScriptAction 0x0001 + TextboxNoOverlapFollowPos 0x1055, 0x0000 + _0807EA94 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000001 + _0807EB74 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000001 + SetEntitySpeed 0x0080 + DoPostScriptAction 0x0001 + _0807EDD4 0x0098, 0x0078 + _0807EB74 + DoPostScriptAction 0x0000 + DoPostScriptAction 0x0001 + TextboxNoOverlapFollowPos 0x1059, 0x0000 + _0807EA94 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000002 + BeginBlock + _0807E9D4 + DoPostScriptAction 0x000a + Jump script_080092B2 + .2byte 0x0000 + BeginBlock + _0807EB44 0x0004 + DoPostScriptAction 0x0000 +script_0800927E: + Call sub_080668F0 + DoPostScriptAction 0x000a + EndBlock +script_0800928A: + CheckEntityInteractType + JumpIfNot script_0800928A + _0807E864 + _0807EB74 + Call sub_08066904 + _0807EA94 + Wait 0x000f + _0807E878 + Jump script_0800928A + .2byte 0x0000 + BeginBlock + _0807EB44 0x0006 + DoPostScriptAction 0x0000 +script_080092B2: + _0807E9D4 + DoPostScriptAction 0x000a + EndBlock +script_080092BA: + CheckEntityInteractType + JumpIfNot script_080092BA + _0807E864 + _0807EB74 + TextboxNoOverlap 0x105e + _0807EA94 + Wait 0x000f + _0807E878 + Jump script_080092BA + BeginBlock + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + Call sub_0806672C + DoPostScriptAction 0x000a + EndBlock + Jump script_0800917C + .2byte 0x0000 + BeginBlock + DoPostScriptAction 0x000a + Call sub_08066E38 + _0807E9D4 + EndBlock +script_08009300: + CheckEntityInteractType + JumpIfNot script_08009300 + _0807E864 + _0807EB74 + TextboxNoOverlap 0x1071 + _0807EA94 + _0807E878 + Jump script_08009300 + .2byte 0x0000 + BeginBlock + EndBlock +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08009320.inc b/data/scripts/script_08009320.inc new file mode 100644 index 00000000..6b99a817 --- /dev/null +++ b/data/scripts/script_08009320.inc @@ -0,0 +1,10 @@ +SCRIPT_START script_08009320 + BeginBlock + Call sub_0806D650 + SetEntitySpeed 0x0010 + EndBlock +script_0800932E: + _0807EEF4 0xfff8, 0x0000 + _0807EEF4 0x0008, 0x0000 + Jump script_0800932E +SCRIPT_END diff --git a/data/scripts/script_08009340.inc b/data/scripts/script_08009340.inc new file mode 100644 index 00000000..9f5907f4 --- /dev/null +++ b/data/scripts/script_08009340.inc @@ -0,0 +1,5 @@ +SCRIPT_START script_08009340 + BeginBlock + EndBlock +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08009348.inc b/data/scripts/script_08009348.inc new file mode 100644 index 00000000..9cddae5f --- /dev/null +++ b/data/scripts/script_08009348.inc @@ -0,0 +1,27 @@ +SCRIPT_START script_08009348 + BeginBlock + _0807E9D4 + EndBlock +script_0800934E: + CheckEntityInteractType + JumpIfNot script_0800934E + _0807E864 + Call sub_0807DF28 + Call sub_0806D638 + _0807F0B4 0x0001 + CameraTargetEntity + CheckGlobalFlag 0x0055 + JumpIf script_0800939A + TextboxNoOverlap 0x1d01 + _0807EA94 +script_08009376: + _0807EA94 + Call sub_0806D640 + _0807F0B4 0x0001 + CameraTargetPlayer + Wait 0x002d + _0807F0B4 0x0004 + _0807E878 + Call sub_0807DF50 + Jump script_0800934E +SCRIPT_END diff --git a/data/scripts/script_0800939A.inc b/data/scripts/script_0800939A.inc new file mode 100644 index 00000000..060c412b --- /dev/null +++ b/data/scripts/script_0800939A.inc @@ -0,0 +1,56 @@ +SCRIPT_START script_0800939A + CheckLocalFlag 0x00ae + JumpIf script_0800943E + CheckInventory1 0x000d + JumpIf script_080093BC + CheckInventory1 0x000e + JumpIf script_080093BC + TextboxNoOverlap 0x1d02 + _0807EA94 + Jump script_08009376 +script_080093BC: + CheckInventory1 0x000e + JumpIfNot script_080093DA + Call sub_0806D788 + TextboxNoOverlap 0x1d03 + _0807EA94 + Call sub_0806D70C + Jump script_08009376 +script_080093DA: + SetIntVariable 0x00001d05 + CheckLocalFlag 0x00ad + JumpIf script_080093EE + SetIntVariable 0x00001d04 +script_080093EE: + TextboxNoOverlapVar + _0807EA94 + _0807E3E8 + JumpIfNot script_08009376 + Wait 0x001e + TextboxNoOverlap 0x1d08 + _0807EA94 + LoadRoomEntityList gUnk_080F9C38 + Wait 0x0078 + Call sub_0806D6D0 + Wait 0x00b4 + Call sub_0806D70C + Wait 0x0078 + SetLocalFlag 0x00ae + SetLocalFlag 0x00ad + Call sub_0806D5D4 + _0807EB8C + TextboxNoOverlap 0x1d09 + _0807EA94 + Wait 0x000a + Jump script_08009376 +script_0800943E: + Call sub_0806D600 + JumpIf script_08009452 + TextboxNoOverlap 0x1d0a + _0807EA94 + JumpIfNot script_08009376 +script_08009452: + TextboxNoOverlap 0x1d0b + _0807EA94 + Call sub_0806D74C + _0807F0C8 0xffff, 0x0000 diff --git a/data/scripts/script_08009464.inc b/data/scripts/script_08009464.inc new file mode 100644 index 00000000..25a70cb1 --- /dev/null +++ b/data/scripts/script_08009464.inc @@ -0,0 +1,29 @@ +SCRIPT_START script_08009464 + Wait 0x003c + _0807F0C8 0x0000, 0x0000 + LoadRoomEntityList gUnk_080F9C58 + Wait 0x003c + Call sub_0806D70C + Wait 0x003c + ClearLocalFlag 0x00ae + Call sub_0806D620 + Wait 0x003c + WaitPlayerAction8 + _0807EB8C + TextboxNoOverlap 0x1d0c + _0807EA94 + Wait 0x000a + Jump script_08009376 + .2byte 0x0000 + BeginBlock + Call sub_0806D7C4 + SetEntitySpeed 0x0080 + EndBlock + Wait 0x003c + SetEntity0x20 0x00018000 +script_080094BC: + _0807EE30 + JumpIfNot script_080094BC + Wait 0x003c + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_080094CC.inc b/data/scripts/script_080094CC.inc new file mode 100644 index 00000000..8d269a34 --- /dev/null +++ b/data/scripts/script_080094CC.inc @@ -0,0 +1,15 @@ +SCRIPT_START script_080094CC + BeginBlock + Call sub_0806D804 + SetEntitySpeed 0x0180 + EndBlock + Wait 0x003c + SetEntity0x20 0x00018000 + Call sub_0806D858 +script_080094EA: + _0807EE30 + JumpIfNot script_080094EA + Wait 0x001e + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_080094FC.inc b/data/scripts/script_080094FC.inc new file mode 100644 index 00000000..6c0e9858 --- /dev/null +++ b/data/scripts/script_080094FC.inc @@ -0,0 +1,73 @@ +SCRIPT_START script_080094FC + BeginBlock + Call sub_08067100 + DoPostScriptAction 0x000a + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + EndBlock +script_08009512: + CheckEntityInteractType + JumpIfNot script_08009512 + _0807E864 + DoPostScriptAction 0x0001 + _0807EB74 + Call sub_080670B4 + _0807EA94 + _0807E878 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + Jump script_08009512 + .2byte 0x0000 + BeginBlock + Call sub_08067100 + DoPostScriptAction 0x000a + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + EndBlock +script_0800954E: + CheckEntityInteractType + JumpIfNot script_0800954E + _0807E864 + DoPostScriptAction 0x0001 + _0807EB74 + Call sub_080670E4 + _0807EA94 + _0807E878 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + Jump script_0800954E + .2byte 0x0000 + BeginBlock + Call sub_08067314 + DoPostScriptAction 0x000a + _0807EB44 0x0004 + SetIntVariable 0x00000000 + Call sub_080672B0 + EndBlock +script_08009592: + CheckEntityInteractType + JumpIfNot script_08009592 + _0807E864 + _0807EB74 + SetIntVariable 0x00000004 + Call sub_080672B0 + Call sub_080672C8 + _0807EA94 + Wait 0x000f + _0807E878 + _0807EB44 0x0004 + SetIntVariable 0x00000000 + Call sub_080672B0 + Jump script_08009592 + .2byte 0x0000 + BeginBlock + Call sub_0806BE3C + DoPostScriptAction 0x000a + DoPostScriptAction 0x0007 + EndBlock +script_080095DE: + Call sub_0806BF44 + JumpIf script_080095F2 + DoPostScriptAction 0x000b + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_080095F2.inc b/data/scripts/script_080095F2.inc new file mode 100644 index 00000000..c16c4201 --- /dev/null +++ b/data/scripts/script_080095F2.inc @@ -0,0 +1,81 @@ +SCRIPT_START script_080095F2 + CheckEntityInteractType + JumpIfNot script_080095DE + _0807E864 + _0807EB74 + DoPostScriptAction 0x0001 + Call sub_0806BE84 + _0807EA94 + JumpIfNot script_08009622 + SoundReq 0x0109 + _0807F088 0x003c + TextboxNoOverlapFollow 0x053c + WaitPlayerAction8 + _0807EA94 + _0807F078 0x003c, 0x0001 +script_08009622: + _0807E878 + DoPostScriptAction 0x0000 + Jump script_080095DE + BeginBlock + DoPostScriptAction 0x000b + DoPostScriptAction 0x0008 + EndBlock +script_08009638: + EndBlock + BeginBlock + CheckGlobalFlag 0x0020 + JumpIfNot script_08009638 + EndBlock +script_08009646: + Call sub_0806BF44 + JumpIf script_08009646 + EndBlock + Call sub_0806BE3C + DoPostScriptAction 0x000a + DoPostScriptAction 0x0007 +script_08009660: + CheckEntityInteractType + JumpIfNot script_08009660 + _0807E864 + _0807EB74 + DoPostScriptAction 0x0001 + Call sub_0806BEC8 + _0807EA94 + JumpIfNot script_0800968E + SoundReq 0x0111 + SoundReq 0x0072 + _0807F078 0x003c, 0x0002 + Call sub_0806BEFC +script_0800968E: + _0807E878 + DoPostScriptAction 0x0000 + Jump script_08009660 + BeginBlock + DoPostScriptAction 0x0007 + Jump script_080096FC + CheckGlobalFlag 0x0020 + JumpIf script_080096FC + EndBlock +script_080096AC: + CheckPlayerInRegion 0x0188, 0x01c0, 0x1020 + JumpIfNot script_080096AC + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 + StartPlayerScript script_08009704 + WaitForSomething2 0x00000001 + SoundReq 0x0111 + DoPostScriptAction 0x0008 + LoadRoomEntityList gUnk_080D9048 + Wait 0x000f + SoundReq 0x0111 + DoPostScriptAction 0x0007 +script_080096EC: + CheckGlobalFlag 0x0020 + JumpIfNot script_080096EC + Call sub_0807DF50 + _0807E878 +script_080096FC: + Call sub_0808692C +SCRIPT_END diff --git a/data/scripts/script_08009704.inc b/data/scripts/script_08009704.inc new file mode 100644 index 00000000..a37836bb --- /dev/null +++ b/data/scripts/script_08009704.inc @@ -0,0 +1,15 @@ +SCRIPT_START script_08009704 + SetEntitySpeed 0x0080 + DoPostScriptAction 0x0001 + _0807EDD4 0x01a0, 0x01b0 + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + Wait 0x000a + DoPostScriptAction 0x0004 + Wait 0x003c + _0807E5F8 0x00000001 + DoPostScriptAction 0x000d + SetEntitySpeed 0x0100 + _0807ECC4 0x0010 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_08009740.inc b/data/scripts/script_08009740.inc new file mode 100644 index 00000000..707cc5e4 --- /dev/null +++ b/data/scripts/script_08009740.inc @@ -0,0 +1,46 @@ +SCRIPT_START script_08009740 + BeginBlock + Call sub_08065D00 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + DoPostScriptAction 0x000a + DoPostScriptAction 0x0007 + EndBlock +script_0800975A: + CheckEntityInteractType + JumpIfNot script_0800975A + _0807E864 + _0807EB74 + DoPostScriptAction 0x0000 + Call sub_08065F64 + _0807EA94 + _0807E878 + Jump script_0800975A + .2byte 0x0000 + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 + SoundReq 0x01f3 + Call sub_0807F40C + _0807E8E4_1 + Wait 0x000a + _0807E8E4_3 + Wait 0x0032 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000004 + StartPlayerScript script_0800987C + WaitForSomething2 0x00000040 + _0807E5F8 0x00000008 + WaitForSomething2 0x00000010 + _0807E5F8 0x00000020 + WaitForSomething2 0x00000040 + _0807F078 0x003c, 0x0000 + SetGlobalFlag 0x0020 + _0807E8E4_3 + Wait 0x001e + _0807EB28 0x2809 + _0807EA94 + Call sub_0807DF50 + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_080097F0.inc b/data/scripts/script_080097F0.inc new file mode 100644 index 00000000..85d253ee --- /dev/null +++ b/data/scripts/script_080097F0.inc @@ -0,0 +1,21 @@ +SCRIPT_START script_080097F0 + BeginBlock + _0807E930 0x0003 + DoPostScriptAction 0x0007 + SetEntitySpeed 0x0300 + Call sub_0807F348 + EndBlock + WaitForSomething2 0x00000002 + SoundReq 0x0123 + Call sub_0807F1A0 +script_08009816: + EndBlock + BeginBlock + _0807EE30 + JumpIfNot script_08009816 + EndBlock + _0807E5F8 0x00000004 + Call sub_0807FBD4 + SoundReq 0x01f3 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_08009838.inc b/data/scripts/script_08009838.inc new file mode 100644 index 00000000..144383f8 --- /dev/null +++ b/data/scripts/script_08009838.inc @@ -0,0 +1,17 @@ +SCRIPT_START script_08009838 + BeginBlock + _0807E930 0x0003 + DoPostScriptAction 0x0007 + SetEntitySpeed 0x0300 + Call sub_0807F348 + EndBlock + WaitForSomething2 0x00000008 + Call sub_0809E0A0 + Call sub_0809E0D4 + SoundReq 0x01f3 + Call sub_0807FBD4 + SoundReq 0x01f3 + _0807E5F8 0x00000010 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800987C.inc b/data/scripts/script_0800987C.inc new file mode 100644 index 00000000..d0cc3325 --- /dev/null +++ b/data/scripts/script_0800987C.inc @@ -0,0 +1,20 @@ +SCRIPT_START script_0800987C + SoundReq 0x007a + _0807EB44 0x0004 + SoundReq 0x0086 + Call sub_0807F36C + SetEntitySpeed 0x0400 + _0807ECF4 0x0004 + Call sub_0807F1E8 + Wait 0x001e + _0807E5F8 0x00000040 + WaitForSomething2 0x00000020 + SoundReq 0x007c + _0807EB44 0x0004 + Call sub_0807F210 + _0807EF3C 0x0200, 0x0020 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000040 + Call sub_080791BC +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_080098D4.inc b/data/scripts/script_080098D4.inc new file mode 100644 index 00000000..d87a79bd --- /dev/null +++ b/data/scripts/script_080098D4.inc @@ -0,0 +1,23 @@ +SCRIPT_START script_080098D4 + BeginBlock + EndBlock +script_080098D8: + CheckGlobalFlag 0x0020 + JumpIfNot script_080098D8 +script_080098E0: + CheckInventory1 0x003c + JumpIfNot script_080098E0 + CheckLocalFlag 0x005d + JumpIf script_08009910 + SetLocalFlag 0x005d + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 + _0807EB28 0x280a + _0807EA94 + Call sub_0807DF50 + _0807E878 +script_08009910: + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08009918.inc b/data/scripts/script_08009918.inc new file mode 100644 index 00000000..79d4cbd7 --- /dev/null +++ b/data/scripts/script_08009918.inc @@ -0,0 +1,15 @@ +SCRIPT_START script_08009918 + BeginBlock + Call sub_0807DF28 + _0807E864 + _0807E5F8 0x00000000 + EndBlock + WaitFor_2 + Wait 0x0078 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000001 + SetGlobalFlag 0x001c + Call sub_0807DF50 + _0807E878 + Call sub_0807921C +SCRIPT_END diff --git a/data/scripts/script_08009950.inc b/data/scripts/script_08009950.inc new file mode 100644 index 00000000..9a01e6c3 --- /dev/null +++ b/data/scripts/script_08009950.inc @@ -0,0 +1,37 @@ +SCRIPT_START script_08009950 + BeginBlock + Call sub_0807F348 + SetEntitySpeed 0x0040 + _0807EB44 0x0004 + _0807E930 0x000c + _0807E908 0x0003 + EndBlock + Wait 0x001e + CameraTargetEntity + _0807E778 0x0004 + _0807E800 0x00000000 + WaitFor_2 + WaitForSomething2 0x00000008 + DoPostScriptAction 0x0004 + Wait 0x001e + _0807E930 0x000b + Wait 0x001e + TextboxNoOverlapFollow 0x1002 + _0807EA94 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000008 + _0807E908 0x0001 + _0807EB44 0x0004 + _0807EDD4 0x00b8, 0x005c + _0807EB44 0x0006 + DoPostScriptAction 0x0001 + TextboxNoOverlapFollow 0x1004 + _0807EA94 + DoPostScriptAction 0x0000 + Wait 0x001e + _0807E778 0x0002 + DoFade5 + WaitFor_2 + Call sub_08053634 +SCRIPT_END diff --git a/data/scripts/script_080099DC.inc b/data/scripts/script_080099DC.inc new file mode 100644 index 00000000..5d6dcffb --- /dev/null +++ b/data/scripts/script_080099DC.inc @@ -0,0 +1,23 @@ +SCRIPT_START script_080099DC + BeginBlock + Call sub_0807F348 + SetEntitySpeed 0x00c0 + _0807EB44 0x0002 + DoPostScriptAction 0x0008 + EndBlock + WaitForSomething2 0x00000004 + DoPostScriptAction 0x0007 + _0807EDD4 0x0068, 0x0060 + Wait 0x000f + TextboxNoOverlapFollow 0x1001 + _0807EA94 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000008 + WaitForSomething2 0x00000004 + DoPostScriptAction 0x0001 + TextboxNoOverlapFollow 0x1003 + _0807EA94 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000008 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08009A34.inc b/data/scripts/script_08009A34.inc new file mode 100644 index 00000000..d70c103a --- /dev/null +++ b/data/scripts/script_08009A34.inc @@ -0,0 +1,21 @@ +SCRIPT_START script_08009A34 + Wait 0x003c +script_08009A38: + Call sub_08066258 + Wait 0x001e + Call sub_08066258 + Wait 0x005a + Jump script_08009A38 + SetEntityPositionRelative 0x0240, 0x0178 + CameraTargetEntity + SetEntitySpeed 0x0080 + Wait 0x0078 + SoundReq2 0x0036 + _0807E778 0x0002 + DoFade4 + WaitFor_2 + Wait 0x0078 + _0807E5F8 0x00000004 + Call sub_08053648 + _0807EDD4 0x0240, 0x0228 +SCRIPT_END diff --git a/data/scripts/script_08009A84.inc b/data/scripts/script_08009A84.inc new file mode 100644 index 00000000..b6d926af --- /dev/null +++ b/data/scripts/script_08009A84.inc @@ -0,0 +1,26 @@ +SCRIPT_START script_08009A84 + BeginBlock + SetEntityPositionRelative 0x01e8, 0x0110 + SetEntitySpeed 0x00c0 + DoPostScriptAction 0x0008 + EndBlock + WaitForSomething2 0x00000004 + DoPostScriptAction 0x0007 + _0807EDD4 0x01e8, 0x0200 + _0807EDD4 0x01f8, 0x0218 + _0807EDD4 0x0220, 0x0228 + _0807EDD4 0x0240, 0x0228 + CameraTargetEntity + _0807EDD4 0x0290, 0x0228 + _0807EDD4 0x0290, 0x01f8 + SetEntitySpeed 0x0080 + _0807EDD4 0x0290, 0x01c8 + SetEntitySpeed 0x00c0 + _0807EDD4 0x0290, 0x0198 + Wait 0x001e + _0807E5F8 0x00000010 + _0807EDD4 0x0290, 0x0190 + DoPostScriptAction 0x0008 + _0807EDD4 0x0290, 0x0188 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08009AF8.inc b/data/scripts/script_08009AF8.inc new file mode 100644 index 00000000..8e1ae84a --- /dev/null +++ b/data/scripts/script_08009AF8.inc @@ -0,0 +1,16 @@ +SCRIPT_START script_08009AF8 + BeginBlock + EndBlock + WaitForSomething2 0x00000010 + SoundReq 0x00f0 + DoPostScriptAction 0x0008 + Wait 0x001e + SoundReq 0x00f1 + DoPostScriptAction 0x0007 + Wait 0x005a + _0807E778 0x0004 + _0807E80C 0x00000000 + WaitFor_2 + Call sub_0805367C +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08009B30.inc b/data/scripts/script_08009B30.inc new file mode 100644 index 00000000..bacab8e4 --- /dev/null +++ b/data/scripts/script_08009B30.inc @@ -0,0 +1,20 @@ +SCRIPT_START script_08009B30 + BeginBlock + Call sub_0807DF28 + _0807E864 + SetLocalFlag 0x0046 + EndBlock + WaitFor_2 + Wait 0x001e + TextboxNoOverlapFollow 0x1005 + _0807EA94 + Wait 0x003c + Call sub_0807529C + Wait 0x003c + DoPostScriptAction 0x0014 + Wait 0x001e + Call sub_08053250 + _0807E878 + Call sub_0807DF50 + Call sub_080791D0 +SCRIPT_END diff --git a/data/scripts/script_08009B78.inc b/data/scripts/script_08009B78.inc new file mode 100644 index 00000000..8fd0b8b8 --- /dev/null +++ b/data/scripts/script_08009B78.inc @@ -0,0 +1,63 @@ +SCRIPT_START script_08009B78 + BeginBlock + _0807EB44 0x0006 + SetEntitySpeed 0x0080 + _0807E9D4 + Call sub_0807F348 + EndBlock + CheckGlobalFlag 0x0013 + JumpIf script_08009C4C + _0807E888 + Wait 0x000a + _0807E864 + StartPlayerScript script_08009CFC + Call sub_0807DF28 + WaitForSomething2 0x00000008 + _0807EDD4 0x0080, 0x005c + _0807EB44 0x0006 + DoPostScriptAction 0x0000 + Wait 0x000f + DoPostScriptAction 0x0001 + TextboxNoOverlapFollowPos 0x1009, 0x0000 + _0807E8E4_1 + _0807EA94 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000008 + _0807EB8C + DoPostScriptAction 0x0001 + TextboxNoOverlapFollowPos 0x100b, 0x0000 + _0807EA94 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000008 + _0807EDD4 0x007c, 0x005c + Wait 0x000f + DoPostScriptAction 0x000d + _0807EDD4 0x0084, 0x005c + _0807EB44 0x0006 + DoPostScriptAction 0x000c + DoPostScriptAction 0x0000 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000008 + Call sub_08053250 + _0807F034 0x0034 + WaitPlayerAction8 + _0807E8E4_1 + DoPostScriptAction 0x0001 + TextboxNoOverlapFollowPos 0x100c, 0x0000 + _0807EA94 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000004 +script_08009C4C: + DoPostScriptAction 0x000a +script_08009C50: + CheckEntityInteractType + JumpIfNot script_08009C50 + _0807E864 + _0807EB74 + TextboxNoOverlap 0x100e + _0807E878 + Jump script_08009C50 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08009C68.inc b/data/scripts/script_08009C68.inc new file mode 100644 index 00000000..c9162bc6 --- /dev/null +++ b/data/scripts/script_08009C68.inc @@ -0,0 +1,39 @@ +SCRIPT_START script_08009C68 + BeginBlock + _0807EB44 0x0002 + SetEntitySpeed 0x0100 + Call sub_0807F348 + EndBlock + WaitForSomething2 0x00000004 + DoPostScriptAction 0x0004 + _0807EB74 + WaitForSomething2 0x00000004 + _0807EB74 + WaitForSomething2 0x00000004 + _0807EB74 + _0807EB8C + DoPostScriptAction 0x0001 + TextboxNoOverlapFollowPos 0x100a, 0x0000 + _0807EA94 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000008 + WaitForSomething2 0x00000004 + _0807EB8C + DoPostScriptAction 0x0001 + _0807EB8C + _0807EB44 0x0002 + TextboxNoOverlapFollowPos 0x100d, 0x0000 + _0807EA94 + DoPostScriptAction 0x0000 + _0807EDD4 0x0028, 0x0060 + _0807EDD4 0x0000, 0x0060 + Call sub_080536A8 + Wait 0x001e + BeginBlock + SetGlobalFlag 0x0013 + Call sub_0807DF50 + Call sub_080791D0 + _0807E878 + EndBlock +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08009CFC.inc b/data/scripts/script_08009CFC.inc new file mode 100644 index 00000000..aa448258 --- /dev/null +++ b/data/scripts/script_08009CFC.inc @@ -0,0 +1,27 @@ +SCRIPT_START script_08009CFC + BeginBlock + _0807E8E4_1 + SetEntitySpeed 0x00c0 + EndBlock + _0807E5F8 0x00000004 + DoPostScriptAction 0x0004 + Wait 0x003c + _0807EDD4 0x0040, 0x0060 + _0807EDD4 0x0060, 0x0068 + _0807E5F8 0x00000004 + DoPostScriptAction 0x0000 + _0807E8E4_0 + Wait 0x000f + SoundReq 0x0094 + DoPostScriptAction 0x0000 + Wait 0x001e + _0807E5F8 0x00000008 + WaitForSomething2 0x00000002 + _0807EDD4 0x0070, 0x005c + _0807E8E4_1 + DoPostScriptAction 0x0000 + Wait 0x000f + _0807E5F8 0x00000008 + WaitForSomething2 0x00000002 + _0807E5F8 0x00000008 +SCRIPT_END diff --git a/data/scripts/script_08009D6C.inc b/data/scripts/script_08009D6C.inc new file mode 100644 index 00000000..4b1a4832 --- /dev/null +++ b/data/scripts/script_08009D6C.inc @@ -0,0 +1,18 @@ +SCRIPT_START script_08009D6C + BeginBlock + SetEntitySpeed 0x0100 + _0807EB44 0x0006 + EndBlock + _0807EDD4 0x0078, 0x0060 + _0807EDD4 0x0078, 0x007c + Wait 0x001e + Call sub_0805368C + Wait 0x0008 + _0807EDD4 0x0078, 0x0098 + DoPostScriptAction 0x0008 + _0807E778 0x0010 + DoFade5 + WaitFor_2 + Call sub_08053634 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_08009DB0.inc b/data/scripts/script_08009DB0.inc new file mode 100644 index 00000000..51f47a09 --- /dev/null +++ b/data/scripts/script_08009DB0.inc @@ -0,0 +1,43 @@ +SCRIPT_START script_08009DB0 + BeginBlock + Call sub_0807F348 + Call sub_08066288 + Call sub_08066274 + DoPostScriptAction 0x000a + _0807E930 0x000c + _0807E908 0x0003 + EndBlock +script_08009DD2: + _0807E944 + _0807E908 0x0002 + Call sub_0806622C + _0807EA94 + _0807E908 0x0003 + _0807E930 0x000c + Jump script_08009DD2 + BeginBlock + EndBlock +script_08009DF0: + CheckPlayerInRegion 0x00a0, 0x0038, 0x1830 + JumpIfNot script_08009DF0 + _0807E864 + Call sub_0807F9A4 + Wait 0x0008 + _0807EB28 0x3207 + _0807E3E8 + JumpIfNot script_08009E4E + Call sub_0807DF28 + _0807E778 0x0002 + DoFade5 + WaitFor_2 + Call sub_0804E864 + Wait 0x001e + _0807E5F8 0x00000002 + WaitForSomething2 0x00000001 + _0807EB28 0x3209 + Wait 0x000f + _0807EA94 + _0807E878 + Call sub_0807DF50 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_08009E4E.inc b/data/scripts/script_08009E4E.inc new file mode 100644 index 00000000..8174277e --- /dev/null +++ b/data/scripts/script_08009E4E.inc @@ -0,0 +1,5 @@ +SCRIPT_START script_08009E4E + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08009E58.inc b/data/scripts/script_08009E58.inc new file mode 100644 index 00000000..fb9c9b00 --- /dev/null +++ b/data/scripts/script_08009E58.inc @@ -0,0 +1,12 @@ +SCRIPT_START script_08009E58 + BeginBlock + Call sub_0807DF28 + EndBlock + WaitForSomething2 0x00000002 + _0807E778 0x0002 + DoFade4 + WaitFor_2 + DoPostScriptAction 0x0014 + Wait 0x001e + _0807E5F8 0x00000001 +SCRIPT_END diff --git a/data/scripts/script_08009E80.inc b/data/scripts/script_08009E80.inc new file mode 100644 index 00000000..bb82f0fd --- /dev/null +++ b/data/scripts/script_08009E80.inc @@ -0,0 +1,5 @@ +SCRIPT_START script_08009E80 + BeginBlock + EndBlock +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08009E88.inc b/data/scripts/script_08009E88.inc new file mode 100644 index 00000000..d21a9d8e --- /dev/null +++ b/data/scripts/script_08009E88.inc @@ -0,0 +1,20 @@ +SCRIPT_START script_08009E88 + BeginBlock + Call sub_0807DF28 + _0807E864 + SetLocalFlag 0x009f + EndBlock + Wait 0x003c + _0807E778 0x0004 + DoFade4 + WaitFor_2 +script_08009EA4: + Call sub_0807F0D8 + JumpIfNot script_08009EA4 + DoPostScriptAction 0x0014 + Wait 0x000a + Call sub_08053250 + _0807E878 + Call sub_0807DF50 + Call sub_080791D0 +SCRIPT_END diff --git a/data/scripts/script_08009ECC.inc b/data/scripts/script_08009ECC.inc new file mode 100644 index 00000000..8ef940d1 --- /dev/null +++ b/data/scripts/script_08009ECC.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_08009ECC + BeginBlock + SetIntVariable 0x00000002 + DoPostScriptAction 0x0001 + EndBlock + WaitForSomething2 0x00000004 + BeginBlock + SetIntVariable 0x00000003 + DoPostScriptAction 0x0001 + EndBlock +SCRIPT_END diff --git a/data/scripts/script_08009EF0.inc b/data/scripts/script_08009EF0.inc new file mode 100644 index 00000000..632f0d1e --- /dev/null +++ b/data/scripts/script_08009EF0.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_08009EF0 + BeginBlock + SetIntVariable 0x00000000 + DoPostScriptAction 0x0001 + EndBlock + WaitForSomething2 0x00000004 + BeginBlock + SetIntVariable 0x00000001 + DoPostScriptAction 0x0001 + EndBlock +SCRIPT_END diff --git a/data/scripts/script_08009F14.inc b/data/scripts/script_08009F14.inc new file mode 100644 index 00000000..828f4cf9 --- /dev/null +++ b/data/scripts/script_08009F14.inc @@ -0,0 +1,118 @@ +SCRIPT_START script_08009F14 + BeginBlock + _0807EB44 0x0004 + Call sub_08060090 + DoPostScriptAction 0x000a + CheckKinstoneFused 0x001c + JumpIf script_08009FD2 + CheckInventory1 0x0007 + JumpIf script_08009F84 + EndBlock +script_08009F36: + EndBlock + BeginBlock + Call sub_08060158 + CheckEntityInteractType + JumpIfNot script_08009F36 + EndBlock + _0807E864 + Call sub_0807DF28 + DoPostScriptAction 0x000b + StartPlayerScript script_0800A088 + WaitForSomething2 0x00000002 + Call sub_0806014C + TextboxNoOverlapFollowPos 0x1f01, 0x0000 + _0807EA94 + Wait 0x001e + _0807F034 0x0065 + WaitPlayerAction8 + DoPostScriptAction 0x000a + Call sub_0807DF50 + _0807E878 +script_08009F84: + EndBlock +script_08009F86: + EndBlock + BeginBlock + Call sub_08060158 + CheckEntityInteractType + JumpIfNot script_08009F86 + EndBlock + _0807E864 + Call sub_080602BC + _0807EA94 + CallWithArg sub_0807F970, 0x00001f03 + JumpIf script_08009FB6 + _0807E878 + Jump script_08009F86 +script_08009FB6: + Wait 0x0008 + SoundReq 0x0103 + CallWithArg sub_0806030C, 0x00000063 + Wait 0x0008 + _0807E878 + Jump script_08009F86 +script_08009FD2: + EndBlock + CheckLocalFlag 0x00b0 + JumpIf script_0800A024 +script_08009FDC: + EndBlock + BeginBlock + Call sub_08060158 + CheckEntityInteractType + JumpIfNot script_08009FDC + EndBlock + _0807E864 + TextboxNoOverlap 0x1f0e + _0807EA94 + _0807E3E8 + JumpIf script_0800A002 + _0807E878 + Jump script_08009FDC +script_0800A002: + Wait 0x0008 + _0807F034 0x0008 + Call sub_08060318 + WaitPlayerAction8 + Wait 0x0008 + _0807EB8C + TextboxNoOverlapFollow 0x1f13 + _0807EA94 + SetLocalFlag 0x00b0 + _0807E878 +script_0800A024: + EndBlock + BeginBlock + Call sub_08060158 + CheckEntityInteractType + JumpIfNot script_0800A024 + EndBlock + _0807E864 + CheckInventory1 0x0008 + JumpIf script_0800A052 + TextboxNoOverlap 0x1f14 + _0807EA94 + _0807E3E8 + JumpIf script_0800A002 + _0807E878 + Jump script_0800A024 +script_0800A052: + TextboxNoOverlap 0x1f11 + _0807EA94 + _0807E3E8 + JumpIf script_0800A064 + _0807E878 + Jump script_0800A024 +script_0800A064: + Wait 0x0008 + _0807F034 0x0007 + Call sub_08060318 + WaitPlayerAction8 + Wait 0x0008 + _0807EB8C + TextboxNoOverlapFollow 0x1f10 + _0807EA94 + _0807E878 + Jump script_0800A024 + .2byte 0x0000 diff --git a/data/scripts/script_0800A088.inc b/data/scripts/script_0800A088.inc new file mode 100644 index 00000000..d24fdd74 --- /dev/null +++ b/data/scripts/script_0800A088.inc @@ -0,0 +1,12 @@ +SCRIPT_START script_0800A088 + BeginBlock + SetEntitySpeed 0x0100 + EndBlock + _0807ECC4 0x0010 + _0807EDD4 0x0078, 0x0060 + _0807EB44 0x0000 + Wait 0x000f + DoPostScriptAction 0x0000 + _0807E5F8 0x00000002 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_0800A0B4.inc b/data/scripts/script_0800A0B4.inc new file mode 100644 index 00000000..5585c44b --- /dev/null +++ b/data/scripts/script_0800A0B4.inc @@ -0,0 +1,21 @@ +SCRIPT_START script_0800A0B4 + BeginBlock + SetEntitySpeed 0x0140 + _0807E864 + Call sub_0807DF28 + EndBlock + Wait 0x0078 + SoundReq2 0x0018 + Call sub_080A0464 +script_0800A0D2: + _0807EE30 + JumpIfNot script_0800A0D2 + _0807E8E4_0 + Wait 0x0008 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000002 + Wait 0x003c + SetEntitySpeed 0x0080 + _0807EC64 0x0030 +SCRIPT_END diff --git a/data/scripts/script_0800A0FC.inc b/data/scripts/script_0800A0FC.inc new file mode 100644 index 00000000..c7e7f59c --- /dev/null +++ b/data/scripts/script_0800A0FC.inc @@ -0,0 +1,25 @@ +SCRIPT_START script_0800A0FC + EndBlock +script_0800A0FE: + CheckGlobalFlag 0x0051 + JumpIfNot script_0800A0FE + BeginBlock + _0807E864 + Call sub_0807DF28 + SoundReq0x80100000 + Call sub_0807FBFC + SetEntityPositionRelative 0x00b0, 0x0058 + Call sub_0807F844 + _0807E8E4_3 + CallWithArg sub_0807F75C, 0x00d00060 + CallWithArg sub_08094AE8, script_0800A160 + SoundReq 0x00f7 + _0807E778 0x0002 + DoFade6 + EndBlock + WaitFor_2 + WaitForSomething2 0x00000004 + CallWithArg sub_0806DA1C, 0x00000006 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800A160.inc b/data/scripts/script_0800A160.inc new file mode 100644 index 00000000..52e561c8 --- /dev/null +++ b/data/scripts/script_0800A160.inc @@ -0,0 +1,19 @@ +SCRIPT_START script_0800A160 + BeginBlock + SetEntitySpeed 0x0080 + DoPostScriptAction 0x0007 + DoPostScriptAction 0x000b + _0807E930 0x0002 + SetEntityPositionRelative 0x00b0, 0x0080 + CallWithArg sub_0807F98C, 0xff800000 + CallWithArg sub_080960C4, script_0800A1B4 + EndBlock + SoundReq 0x0142 + _0807EF3C 0xff80, 0x0000 + SoundReq 0x0143 + _0807E930 0x0004 + _0807E5F8 0x00000002 + Wait 0x003c + _0807E5F8 0x00000004 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800A1B4.inc b/data/scripts/script_0800A1B4.inc new file mode 100644 index 00000000..9ea82fa3 --- /dev/null +++ b/data/scripts/script_0800A1B4.inc @@ -0,0 +1,10 @@ +SCRIPT_START script_0800A1B4 + BeginBlock + DoPostScriptAction 0x0007 + DoPostScriptAction 0x000b + CallWithArg sub_0807F994, 0x0000fff8 + EndBlock + WaitForSomething 0x00000002 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800A1D8.inc b/data/scripts/script_0800A1D8.inc new file mode 100644 index 00000000..96faa56d --- /dev/null +++ b/data/scripts/script_0800A1D8.inc @@ -0,0 +1,63 @@ +SCRIPT_START script_0800A1D8 + BeginBlock + _0807E864 + Call sub_0807DF28 + SetEntityPositionRelative 0x0088, 0x0080 + Call sub_0807F844 + _0807E8E4_3 + CallWithArg sub_0807F75C, 0x00a80088 + EndBlock + Wait 0x003c + StartPlayerScript script_0800A310 + WaitForSomething2 0x00000001 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000080 + TextboxNoOverlapFollowPos 0x1659, 0x0000 + _0807EA94 + Wait 0x003c + _0807E5F8 0x00000010 + WaitForSomething2 0x00000200 + _0807E5F8 0x00000004 + _0807E8E4_0 + WaitForSomething2 0x00000080 + _0807E5F8 0x00000010 + WaitForSomething2 0x00000200 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000040 + _0807E5F8 0x00000004 + Call sub_0807F3F8 + WaitForSomething2 0x00000080 + TextboxNoOverlapFollowPos 0x165a, 0x000e + _0807EA94 + Wait 0x003c + TextboxNoOverlapFollowPos 0x165b, 0x000e + _0807EA94 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000040 + _0807E5F8 0x00000008 + WaitForSomething2 0x00000100 + Wait 0x003c + _0807E8E4_3 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000080 + Wait 0x003c + _0807E5F8 0x00000008 + WaitForSomething2 0x00000100 + _0807E5F8 0x00000006 + WaitForSomething2 0x000000c0 + TextboxNoOverlapFollowPos 0x165c, 0x000e + _0807EA94 + SoundReq0x80100000 + TextboxNoOverlapFollowPos 0x165d, 0x000e + _0807EA94 + _0807E5F8 0x00000006 + WaitForSomething2 0x000000c0 + _0807E5F8 0x00000006 + WaitForSomething2 0x00000080 + _0807E5F8 0x00000008 + WaitForSomething2 0x00000100 + SoundReq2 0x0008 + SoundReq 0x00f7 + CallWithArg sub_0806DA1C, 0x00000007 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_0800A310.inc b/data/scripts/script_0800A310.inc new file mode 100644 index 00000000..50a0bc11 --- /dev/null +++ b/data/scripts/script_0800A310.inc @@ -0,0 +1,43 @@ +SCRIPT_START script_0800A310 + EndBlock + _0807EB44 0x0002 + Wait 0x000a + _0807EB44 0x0006 + Wait 0x000a + _0807EB44 0x0002 + Wait 0x000a + _0807EB44 0x0006 + Wait 0x000a + _0807E5F8 0x00000001 + Call sub_080791BC + .2byte 0x0000 + BeginBlock + DoPostScriptAction 0x0008 + SetEntitySpeed 0x0080 + DoPostScriptAction 0x000b + _0807EB44 0x0004 + CallWithArg sub_0807F3D8, 0x00000000 + EndBlock + WaitForSomething2 0x00000002 + _0807E930 0x000e + DoPostScriptAction 0x0007 + Call sub_0807F2D4 + DoPostScriptAction 0x0004 + _0807E5F8 0x00000040 + WaitForSomething2 0x00000002 + _0807E930 0x000c + Call sub_0807F2D4 + _0807E5F8 0x00000040 + WaitForSomething2 0x00000002 + _0807E930 0x000f + Call sub_0807F2D4 + _0807E5F8 0x00000040 + WaitForSomething2 0x00000002 + _0807E930 0x000c + Call sub_0807F2D4 + _0807E5F8 0x00000040 + WaitForSomething2 0x00000002 + CallWithArg sub_080960C4, script_0800A680 + _0807E5F8 0x00000040 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800A3D8.inc b/data/scripts/script_0800A3D8.inc new file mode 100644 index 00000000..114943d5 --- /dev/null +++ b/data/scripts/script_0800A3D8.inc @@ -0,0 +1,60 @@ +SCRIPT_START script_0800A3D8 + BeginBlock + SetEntitySpeed 0x0100 + DoPostScriptAction 0x0007 + DoPostScriptAction 0x000b + _0807EB44 0x0002 + DoPostScriptAction 0x0000 + EndBlock + WaitForSomething2 0x00000004 + BeginBlock + DoPostScriptAction 0x0004 + Call sub_0807F3F8 + EndBlock + Wait 0x003c + _0807EC94 0x0010 + _0807EB44 0x0002 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000080 + WaitForSomething2 0x00000004 + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000080 + WaitForSomething2 0x00000004 + DoPostScriptAction 0x0004 + Wait 0x003c + _0807E5F8 0x00000080 + WaitForSomething2 0x00000004 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + SoundReq 0x0142 + CallWithArg sub_080960C4, script_0800A638 + _0807E5F8 0x00000080 + WaitForSomething2 0x00000004 + SoundReq 0x0143 + _0807E5F8 0x00001000 + _0807E5F8 0x00000080 + WaitForSomething2 0x00000004 + Call sub_08066E68 + _0807E5F8 0x00000080 + WaitForSomething2 0x00000004 + SoundReq 0x0142 + CallWithArg sub_080960C4, script_0800A680 + Wait 0x0078 + SoundReq 0x0153 + CallWithArg sub_0807FADC, 0x00000003 + Wait 0x000f + SoundReq 0x0153 + CallWithArg sub_0807FADC, 0x00000003 + Wait 0x000f + SoundReq 0x0153 + CallWithArg sub_0807FADC, 0x00000003 + Wait 0x003c + SoundReq 0x0153 + CallWithArg sub_0807FADC, 0x00000001 + SoundReq 0x0143 + _0807E5F8 0x00000080 + WaitForSomething2 0x00000004 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800A500.inc b/data/scripts/script_0800A500.inc new file mode 100644 index 00000000..d9f29737 --- /dev/null +++ b/data/scripts/script_0800A500.inc @@ -0,0 +1,30 @@ +SCRIPT_START script_0800A500 + BeginBlock + SetEntitySpeed 0x0080 + DoPostScriptAction 0x0007 + DoPostScriptAction 0x000b + _0807E930 0x0005 + Call sub_0807F348 + EndBlock + WaitForSomething2 0x00000008 + SoundReq 0x0142 + _0807E610 0x00000800 + CallWithArg sub_080960C4, script_0800A65C + _0807E930 0x0002 + Call sub_08094B0C + _0807EDD4 0x0068, 0x0088 + Call sub_08094B80 + _0807E5F8 0x00000100 + WaitForSomething2 0x00000008 + Call sub_08094B3C + _0807E930 0x0004 + _0807E5F8 0x00000800 + SoundReq 0x0143 + _0807E5F8 0x00000100 + WaitForSomething2 0x00000008 + DoPostScriptAction 0x0008 + Call sub_080961B0 + SoundReq 0x00fa + Wait 0x003c + _0807E5F8 0x00000100 +SCRIPT_END diff --git a/data/scripts/script_0800A590.inc b/data/scripts/script_0800A590.inc new file mode 100644 index 00000000..4a6dd099 --- /dev/null +++ b/data/scripts/script_0800A590.inc @@ -0,0 +1,35 @@ +SCRIPT_START script_0800A590 + BeginBlock + SetEntitySpeed 0x0080 + SetEntity0x20 0x00000000 + DoPostScriptAction 0x0008 + _0807EB44 0x0000 + Call sub_0807F714 + MoveEntityToPlayer + CallWithArg sub_0807F98C, 0xfff00000 + EndBlock + _0807E930 0x0023 + WaitForSomething2 0x00000010 + CallWithArg sub_0807F6E8, 0x00000008 + DoPostScriptAction 0x0007 + SoundReq 0x0142 + _0807E610 0x00000800 + CallWithArg sub_080960C4, script_0800A65C + Wait 0x003c + _0807EDD4 0x0088, 0x0068 + Wait 0x0078 + _0807E5F8 0x00000800 + SoundReq 0x0143 + _0807EF3C 0x0000, 0x0020 + _0807E930 0x001f + _0807E5F8 0x00000200 + WaitForSomething2 0x00000010 + Wait 0x0078 + DoPostScriptAction 0x0004 + Wait 0x003c + _0807E5F8 0x00000200 + Wait 0x0001 + DoPostScriptAction 0x0008 + WaitForSomething2 0x00000010 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_0800A638.inc b/data/scripts/script_0800A638.inc new file mode 100644 index 00000000..1f099721 --- /dev/null +++ b/data/scripts/script_0800A638.inc @@ -0,0 +1,10 @@ +SCRIPT_START script_0800A638 + BeginBlock + DoPostScriptAction 0x0007 + DoPostScriptAction 0x000b + CallWithArg sub_0807F994, 0x0000fff8 + EndBlock + WaitForSomething 0x00001000 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800A65C.inc b/data/scripts/script_0800A65C.inc new file mode 100644 index 00000000..78eb79bf --- /dev/null +++ b/data/scripts/script_0800A65C.inc @@ -0,0 +1,10 @@ +SCRIPT_START script_0800A65C + BeginBlock + DoPostScriptAction 0x0007 + DoPostScriptAction 0x000b + CallWithArg sub_0807F994, 0x0000fff8 + EndBlock + WaitForSomething 0x00000800 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800A680.inc b/data/scripts/script_0800A680.inc new file mode 100644 index 00000000..7112b6da --- /dev/null +++ b/data/scripts/script_0800A680.inc @@ -0,0 +1,10 @@ +SCRIPT_START script_0800A680 + BeginBlock + DoPostScriptAction 0x0007 + DoPostScriptAction 0x000b + CallWithArg sub_0807F994, 0x0000fff8 + EndBlock + WaitForSomething 0x00000020 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800A6A4.inc b/data/scripts/script_0800A6A4.inc new file mode 100644 index 00000000..b59a7fdf --- /dev/null +++ b/data/scripts/script_0800A6A4.inc @@ -0,0 +1,12 @@ +SCRIPT_START script_0800A6A4 + BeginBlock + _0807E864 + Call sub_0807DF28 + SetEntityPositionRelative 0x0088, 0x0068 + Call sub_0807F844 + EndBlock + Wait 0x003c + SoundReq 0x00f6 + CallWithArg sub_0806DA1C, 0x00000008 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_0800A6D4.inc b/data/scripts/script_0800A6D4.inc new file mode 100644 index 00000000..0c4d8409 --- /dev/null +++ b/data/scripts/script_0800A6D4.inc @@ -0,0 +1,12 @@ +SCRIPT_START script_0800A6D4 + BeginBlock + _0807E864 + Call sub_0807DF28 + SetEntityPositionRelative 0x0088, 0x0070 + Call sub_0807F844 + SoundReq 0x00f7 + EndBlock + Wait 0x003c + CallWithArg sub_0806DA1C, 0x00000009 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_0800A704.inc b/data/scripts/script_0800A704.inc new file mode 100644 index 00000000..ad6120c2 --- /dev/null +++ b/data/scripts/script_0800A704.inc @@ -0,0 +1,12 @@ +SCRIPT_START script_0800A704 + BeginBlock + _0807E864 + Call sub_0807DF28 + SetEntityPositionRelative 0x0198, 0x01c8 + Call sub_0807F844 + EndBlock + Wait 0x003c + SoundReq 0x00f6 + CallWithArg sub_0806DA1C, 0x0000000a + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_0800A734.inc b/data/scripts/script_0800A734.inc new file mode 100644 index 00000000..1bbc5b98 --- /dev/null +++ b/data/scripts/script_0800A734.inc @@ -0,0 +1,12 @@ +SCRIPT_START script_0800A734 + BeginBlock + _0807E864 + Call sub_0807DF28 + SetEntityPositionRelative 0x00d8, 0x01c8 + Call sub_0807F844 + SoundReq 0x00f7 + EndBlock + Wait 0x003c + CallWithArg sub_0806DA1C, 0x0000000b + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_0800A764.inc b/data/scripts/script_0800A764.inc new file mode 100644 index 00000000..e89ebe2c --- /dev/null +++ b/data/scripts/script_0800A764.inc @@ -0,0 +1,31 @@ +SCRIPT_START script_0800A764 + BeginBlock + _0807E864 + Call sub_0807DF28 + SetEntityPositionRelative 0x00f8, 0x01b8 + Call sub_0807F844 + EndBlock + Wait 0x003c + SoundReq 0x00f6 + _0807E778 0x0004 + DoFade7 + WaitFor_2 + _0807E5F8 0x00000001 + SoundReq 0x00f7 + _0807E778 0x0002 + DoFade6 + WaitFor_2 + Wait 0x001e + _0807E5F8 0x00000002 + Wait 0x0014 + _0807E5F8 0x00000004 + Wait 0x000a + _0807E5F8 0x00000008 + Wait 0x0005 + _0807E5F8 0x00000010 + Wait 0x0002 + _0807E5F8 0x00000020 + Wait 0x0078 + CallWithArg sub_0806DA1C, 0x0000000c + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_0800A7E4.inc b/data/scripts/script_0800A7E4.inc new file mode 100644 index 00000000..bb2a3700 --- /dev/null +++ b/data/scripts/script_0800A7E4.inc @@ -0,0 +1,99 @@ +SCRIPT_START script_0800A7E4 + BeginBlock + DoPostScriptAction 0x0007 + _0807EB44 0x0004 + _0807E930 0x0010 + EndBlock + WaitForSomething 0x00000001 + _0807E930 0x0002 + WaitForSomething2 0x00000002 + DoPostScriptAction 0x0004 + Wait 0x003c +script_0800A80C: + _0807E930 0x0001 + Wait 0x001e + _0807E930 0x0003 + Wait 0x001e + Jump script_0800A80C + BeginBlock + DoPostScriptAction 0x0007 + _0807EB44 0x0004 + _0807E930 0x0010 + EndBlock + WaitForSomething 0x00000001 + _0807E930 0x0002 + WaitForSomething2 0x00000004 + DoPostScriptAction 0x0004 + Wait 0x003c +script_0800A848: + _0807E930 0x0001 + Wait 0x0014 + _0807E930 0x0003 + Wait 0x0014 + Jump script_0800A848 + BeginBlock + DoPostScriptAction 0x0007 + _0807EB44 0x0004 + _0807E930 0x0010 + EndBlock + WaitForSomething 0x00000001 + _0807E930 0x0002 + WaitForSomething2 0x00000008 + DoPostScriptAction 0x0004 + Wait 0x003c +script_0800A884: + _0807E930 0x0001 + Wait 0x000a + _0807E930 0x0003 + Wait 0x000a + Jump script_0800A884 + BeginBlock + DoPostScriptAction 0x0007 + _0807EB44 0x0004 + _0807E930 0x0008 + EndBlock + WaitForSomething 0x00000001 + DoPostScriptAction 0x0000 + WaitForSomething2 0x00000010 + DoPostScriptAction 0x0004 + Wait 0x003c +script_0800A8C0: + _0807EB44 0x0002 + Wait 0x0019 + _0807EB44 0x0006 + Wait 0x0019 + Jump script_0800A8C0 + BeginBlock + DoPostScriptAction 0x0007 + _0807EB44 0x0004 + _0807E930 0x0008 + EndBlock + WaitForSomething 0x00000001 + DoPostScriptAction 0x0000 + WaitForSomething2 0x00000020 + DoPostScriptAction 0x0004 + Wait 0x003c +script_0800A8FC: + _0807EB44 0x0002 + Wait 0x000f + _0807EB44 0x0006 + Wait 0x000f + Jump script_0800A8FC + BeginBlock + _0807E864 + Call sub_0807DF28 + SetEntityPositionRelative 0x0378, 0x0178 + Call sub_0807F844 + EndBlock + Wait 0x003c + _0807E5F8 0x00000001 + Wait 0x001e + _0807E5F8 0x00000002 + Wait 0x0014 + _0807E5F8 0x00000004 + Wait 0x000a + _0807E5F8 0x00000008 + Wait 0x003c + CallWithArg sub_0806DA1C, 0x0000000d + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_0800A964.inc b/data/scripts/script_0800A964.inc new file mode 100644 index 00000000..d00269a5 --- /dev/null +++ b/data/scripts/script_0800A964.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_0800A964 + BeginBlock + _0807EB44 0x0002 + DoPostScriptAction 0x0007 + _0807E930 0x0001 + EndBlock + WaitForSomething2 0x00000001 + Call CreateDust + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800A988.inc b/data/scripts/script_0800A988.inc new file mode 100644 index 00000000..f0b9135c --- /dev/null +++ b/data/scripts/script_0800A988.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_0800A988 + BeginBlock + _0807EB44 0x0004 + DoPostScriptAction 0x0007 + _0807E930 0x0002 + EndBlock + WaitForSomething2 0x00000002 + Call CreateDust + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800A9AC.inc b/data/scripts/script_0800A9AC.inc new file mode 100644 index 00000000..9a235bcf --- /dev/null +++ b/data/scripts/script_0800A9AC.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_0800A9AC + BeginBlock + _0807EB44 0x0000 + DoPostScriptAction 0x0007 + _0807E930 0x0000 + EndBlock + WaitForSomething2 0x00000004 + Call CreateDust + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800A9D0.inc b/data/scripts/script_0800A9D0.inc new file mode 100644 index 00000000..2f385317 --- /dev/null +++ b/data/scripts/script_0800A9D0.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_0800A9D0 + BeginBlock + _0807EB44 0x0006 + DoPostScriptAction 0x0007 + _0807E930 0x0003 + EndBlock + WaitForSomething2 0x00000008 + Call CreateDust + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800A9F4.inc b/data/scripts/script_0800A9F4.inc new file mode 100644 index 00000000..e9a1788a --- /dev/null +++ b/data/scripts/script_0800A9F4.inc @@ -0,0 +1,19 @@ +SCRIPT_START script_0800A9F4 + BeginBlock + _0807E864 + Call sub_0807DF28 + SetEntityPositionRelative 0x0128, 0x0058 + Call sub_0807F844 + EndBlock + Wait 0x003c + _0807E5F8 0x00000001 + Wait 0x000a + _0807E5F8 0x00000002 + Wait 0x0014 + _0807E5F8 0x00000004 + Wait 0x001e + _0807E5F8 0x00000008 + Wait 0x003c + CallWithArg sub_0806DA1C, 0x0000000e + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_0800AA48.inc b/data/scripts/script_0800AA48.inc new file mode 100644 index 00000000..e992d04f --- /dev/null +++ b/data/scripts/script_0800AA48.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_0800AA48 + BeginBlock + _0807EB44 0x0002 + DoPostScriptAction 0x0007 + _0807E930 0x0000 + EndBlock + WaitForSomething2 0x00000001 + Call CreateDust + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800AA6C.inc b/data/scripts/script_0800AA6C.inc new file mode 100644 index 00000000..e9bbd201 --- /dev/null +++ b/data/scripts/script_0800AA6C.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_0800AA6C + BeginBlock + _0807EB44 0x0004 + DoPostScriptAction 0x0007 + _0807E930 0x0000 + EndBlock + WaitForSomething2 0x00000002 + Call CreateDust + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800AA90.inc b/data/scripts/script_0800AA90.inc new file mode 100644 index 00000000..0a55246e --- /dev/null +++ b/data/scripts/script_0800AA90.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_0800AA90 + BeginBlock + _0807EB44 0x0000 + DoPostScriptAction 0x0007 + _0807E930 0x0000 + EndBlock + WaitForSomething2 0x00000004 + Call CreateDust + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800AAB4.inc b/data/scripts/script_0800AAB4.inc new file mode 100644 index 00000000..bc7bf8ad --- /dev/null +++ b/data/scripts/script_0800AAB4.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_0800AAB4 + BeginBlock + _0807EB44 0x0006 + DoPostScriptAction 0x0007 + _0807E930 0x0000 + EndBlock + WaitForSomething2 0x00000008 + Call CreateDust + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800AAD8.inc b/data/scripts/script_0800AAD8.inc new file mode 100644 index 00000000..869e2aec --- /dev/null +++ b/data/scripts/script_0800AAD8.inc @@ -0,0 +1,12 @@ +SCRIPT_START script_0800AAD8 + BeginBlock + _0807E864 + Call sub_0807DF28 + SetEntityPositionRelative 0x0088, 0x0148 + Call sub_0807F844 + EndBlock + Wait 0x003c + SoundReq 0x00f6 + CallWithArg sub_0806DA1C, 0x0000000f + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_0800AB08.inc b/data/scripts/script_0800AB08.inc new file mode 100644 index 00000000..2c38aa99 --- /dev/null +++ b/data/scripts/script_0800AB08.inc @@ -0,0 +1,21 @@ +SCRIPT_START script_0800AB08 + BeginBlock + _0807E864 + Call sub_0807DF28 + SetEntityPositionRelative 0x0088, 0x0148 + Call sub_0807F844 + _0807E8E4_3 + CallWithArg sub_0807F6E8, 0x00000008 + CallWithArg sub_0807F75C, 0x00a80088 + SoundReq 0x00f7 + EndBlock + Wait 0x0078 + _0807F0B4 0x0001 + SetEntityPositionRelative 0x0088, 0x0078 + Call sub_0807F5C0 + TextboxNoOverlapFollowPos 0x1664, 0x0000 + _0807EA94 + TextboxNoOverlapFollowPos 0x165e, 0x000e + _0807EA94 + CallWithArg sub_0805DDEC, 0x00000001 + _0807F0C8 0xffff, 0x0000 diff --git a/data/scripts/script_0800AB6E.inc b/data/scripts/script_0800AB6E.inc new file mode 100644 index 00000000..1f8e3217 --- /dev/null +++ b/data/scripts/script_0800AB6E.inc @@ -0,0 +1,69 @@ +SCRIPT_START script_0800AB6E + Call sub_0808D2CC + _0807E5F8 0x00000002 + WaitForSomething2 0x00000004 + _0807E8E4_0 + _0807E5F8 0x00000040 + WaitForSomething2 0x00000080 + SetEntityPosition 0x0000, 0xffe0 + Call sub_0807F5C0 + Wait 0x003c + CallWithArg sub_0805DE18, 0x00000001 + _0807F0C8 0x0000, 0x0000 + Wait 0x003c + _0807E5F8 0x00000002 + WaitForSomething2 0x00000004 + TextboxNoOverlapFollowPos 0x165f, 0x000e + _0807EA94 + StartPlayerScript script_0800ACBC + WaitForSomething2 0x00000001 + TextboxNoOverlapFollowPos 0x1660, 0x000e + _0807EA94 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000004 + TextboxNoOverlapFollowPos 0x1661, 0x000e + _0807EA94 + _0807E5F8 0x00000008 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000004 + SetEntityPosition 0x0000, 0x0020 + Call sub_0807F5C0 + WaitForSomething2 0x00000010 + StartPlayerScript script_0800ACE0 + WaitForSomething2 0x00000001 + Wait 0x003c + TextboxNoOverlapFollowPos 0x1662, 0x000e + _0807EA94 + TextboxNoOverlapFollowPos 0x1663, 0x000e + _0807EA94 + SetEntityPosition 0x0000, 0xffe0 + Call sub_0807F5C0 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000004 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000004 + StartPlayerScript script_0800AD54 + WaitForSomething2 0x00000001 + Wait 0x003c + TextboxNoOverlapFollowPos 0x1665, 0x000e + _0807EA94 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000004 + Wait 0x0078 + Call sub_0808D280 + Wait 0x0078 + _0807E778 0x0004 + DoFade5 + WaitFor_2 + Call sub_0807FB94 + MoveEntityToPlayer + Call sub_0807F844 + _0807F0B4 0x0004 + CameraTargetPlayer + _0807E5F8 0x80000000 + DoFade4 + WaitFor_2 + Call sub_0807DF50 + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_0800ACBC.inc b/data/scripts/script_0800ACBC.inc new file mode 100644 index 00000000..8b08a0c0 --- /dev/null +++ b/data/scripts/script_0800ACBC.inc @@ -0,0 +1,10 @@ +SCRIPT_START script_0800ACBC + BeginBlock + SetEntitySpeed 0x0100 + EndBlock + _0807EDD4 0x0088, 0x0080 + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000001 + Call sub_080791BC + .2byte 0x0000 diff --git a/data/scripts/script_0800ACE0.inc b/data/scripts/script_0800ACE0.inc new file mode 100644 index 00000000..7f22b9cf --- /dev/null +++ b/data/scripts/script_0800ACE0.inc @@ -0,0 +1,25 @@ +SCRIPT_START script_0800ACE0 + BeginBlock + Call sub_08094BE0 + CallWithArg sub_0807F238, 0x0000045b + SoundReq 0x0109 + EndBlock + Call sub_0807F304 + Wait 0x005a + _0807E5F8 0x00000008 + BeginBlock + CallWithArg sub_0807F6F8, 0x00000008 + CallWithArg sub_0807F238, 0x000008e4 + EndBlock + Call sub_0807F304 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + Wait 0x003c + _0807EB44 0x0002 + DoPostScriptAction 0x0000 + Wait 0x0004 + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000001 + Call sub_080791BC + .2byte 0x0000 diff --git a/data/scripts/script_0800AD54.inc b/data/scripts/script_0800AD54.inc new file mode 100644 index 00000000..03b12d66 --- /dev/null +++ b/data/scripts/script_0800AD54.inc @@ -0,0 +1,65 @@ +SCRIPT_START script_0800AD54 + BeginBlock + SetEntitySpeed 0x0080 + EndBlock + _0807EC64 0x0020 + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000001 + Call sub_080791BC + BeginBlock + SetEntitySpeed 0x0080 + DoPostScriptAction 0x0007 + DoPostScriptAction 0x000b + _0807EB44 0x0004 + CallWithArg sub_0807F3D8, 0x00000000 + EndBlock + WaitForSomething2 0x00000002 + DoPostScriptAction 0x0004 + Wait 0x001e + _0807EB44 0x0002 + CallWithArg sub_0807F3D8, 0x00000000 + Wait 0x0006 + _0807EB44 0x0000 + CallWithArg sub_0807F3D8, 0x00000000 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000002 + _0807EB44 0x0002 + CallWithArg sub_0807F3D8, 0x00000000 + Wait 0x0014 + _0807EB44 0x0004 + CallWithArg sub_0807F3D8, 0x00000000 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000002 + _0807E930 0x000c + Call sub_0807F2D4 + Call sub_08094B94 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000002 + _0807E930 0x000f + Call sub_0807F2D4 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000002 + CallWithArg sub_080960C4, script_0800AF18 + _0807E930 0x0012 + Call sub_0807F2D4 + Wait 0x001e + _0807E5F8 0x00000020 + SoundReq0x80100000 + Call CreateDust + Call sub_0806305C + Call sub_080630A4 + _0807EF3C 0x0000, 0x0020 + Wait 0x001e + _0807E5F8 0x00000004 + WaitForSomething2 0x00000002 + SetEntitySpeed 0x0080 + _0807EEF4 0x0000, 0xfff0 + Wait 0x003c + _0807EEF4 0x0000, 0xfff0 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000002 + _0807EDD4 0x0088, 0x0040 + _0807E5F8 0x00000004 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_0800AEA4.inc b/data/scripts/script_0800AEA4.inc new file mode 100644 index 00000000..07fc508d --- /dev/null +++ b/data/scripts/script_0800AEA4.inc @@ -0,0 +1,15 @@ +SCRIPT_START script_0800AEA4 + BeginBlock + SetEntitySpeed 0x0080 + DoPostScriptAction 0x0007 + DoPostScriptAction 0x000b + _0807EB44 0x0002 + DoPostScriptAction 0x0000 + EndBlock + WaitForSomething2 0x00000040 + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000080 + WaitForSomething2 0x80000000 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_0800AEDC.inc b/data/scripts/script_0800AEDC.inc new file mode 100644 index 00000000..15b0a526 --- /dev/null +++ b/data/scripts/script_0800AEDC.inc @@ -0,0 +1,15 @@ +SCRIPT_START script_0800AEDC + BeginBlock + SetEntitySpeed 0x0080 + DoPostScriptAction 0x0007 + DoPostScriptAction 0x000b + _0807E930 0x0000 + EndBlock + WaitForSomething2 0x00000008 + Call sub_08094B80 + _0807EF3C 0x0000, 0x0001 + _0807E5F8 0x00000010 + WaitForSomething2 0x00000008 + DoPostScriptAction 0x0008 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_0800AF18.inc b/data/scripts/script_0800AF18.inc new file mode 100644 index 00000000..71358dea --- /dev/null +++ b/data/scripts/script_0800AF18.inc @@ -0,0 +1,12 @@ +SCRIPT_START script_0800AF18 + BeginBlock + DoPostScriptAction 0x0007 + DoPostScriptAction 0x000b + CallWithArg sub_0807F994, 0x0000fff8 + SoundReq 0x0142 + EndBlock + WaitForSomething 0x00000020 + SoundReq 0x0143 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800AF44.inc b/data/scripts/script_0800AF44.inc new file mode 100644 index 00000000..9a6fe0ff --- /dev/null +++ b/data/scripts/script_0800AF44.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_0800AF44 + _0807E864 + Call sub_0807DF28 + _0807EB28 0x1c01 + _0807EA94 + SetLocalFlagByOffset 0x0100, 0x0001 + Call sub_0807DF50 + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800AF68.inc b/data/scripts/script_0800AF68.inc new file mode 100644 index 00000000..17d3b4c5 --- /dev/null +++ b/data/scripts/script_0800AF68.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_0800AF68 + _0807E864 + Call sub_0807DF28 + _0807EB28 0x1c02 + _0807EA94 + SetLocalFlagByOffset 0x0100, 0x0002 + Call sub_0807DF50 + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800AF8C.inc b/data/scripts/script_0800AF8C.inc new file mode 100644 index 00000000..2966dc38 --- /dev/null +++ b/data/scripts/script_0800AF8C.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_0800AF8C + _0807E864 + Call sub_0807DF28 + _0807EB28 0x1c03 + _0807EA94 + SetLocalFlagByOffset 0x0100, 0x0003 + Call sub_0807DF50 + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800AFB0.inc b/data/scripts/script_0800AFB0.inc new file mode 100644 index 00000000..21e9510d --- /dev/null +++ b/data/scripts/script_0800AFB0.inc @@ -0,0 +1,18 @@ +SCRIPT_START script_0800AFB0 + _0807E864 +script_0800AFB2: + EndBlock + BeginBlock + Call sub_0807FBB4 + ComparePlayerAction 0x0001 + JumpIfNot script_0800AFB2 + EndBlock + Call sub_0807DF28 + _0807EB28 0x1c04 + _0807EA94 + SetLocalFlagByOffset 0x0100, 0x0004 + Call sub_0807DF50 + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800AFE8.inc b/data/scripts/script_0800AFE8.inc new file mode 100644 index 00000000..7cf12c3d --- /dev/null +++ b/data/scripts/script_0800AFE8.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_0800AFE8 + _0807E864 + Call sub_0807DF28 + _0807EB28 0x1c05 + _0807EA94 + SetLocalFlagByOffset 0x0100, 0x0005 + Call sub_0807DF50 + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800B00C.inc b/data/scripts/script_0800B00C.inc new file mode 100644 index 00000000..0d1b013e --- /dev/null +++ b/data/scripts/script_0800B00C.inc @@ -0,0 +1,48 @@ +SCRIPT_START script_0800B00C + BeginBlock + Call sub_0807F934 + Call sub_080A2124 + DoPostScriptAction 0x000a + DoPostScriptAction 0x0007 + EndBlock +script_0800B024: + CheckEntityInteractType + JumpIfNot script_0800B024 + _0807E864 + Call sub_0807DF28 + CheckGlobalFlag 0x0052 + JumpIf script_0800B082 + CheckGlobalFlag 0x0053 + JumpIf script_0800B064 + TextboxNoOverlap 0x3f32 + _0807EA94 + DoPostScriptAction 0x0008 + Call Windcrest_Unlock + Wait 0x003c + _0807EB28 0x0b5c + _0807EA94 + SetGlobalFlag 0x0053 + Jump script_0800B09C +script_0800B064: + TextboxNoOverlap 0x3f32 + _0807EA94 + DoPostScriptAction 0x0008 + Call Windcrest_Unlock + Wait 0x003c + _0807EB28 0x0b5d + _0807EA94 + Jump script_0800B09C +script_0800B082: + TextboxNoOverlap 0x3f32 + _0807EA94 + DoPostScriptAction 0x0008 + Call Windcrest_Unlock + Wait 0x003c + _0807EB28 0x0b5e + _0807EA94 +script_0800B09C: + Call sub_0807DF50 + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800B0AC.inc b/data/scripts/script_0800B0AC.inc new file mode 100644 index 00000000..d89cc551 --- /dev/null +++ b/data/scripts/script_0800B0AC.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_0800B0AC + EndBlock + _0807E864 + Call sub_0807FA40 + Call sub_0807DF28 + _0807EB28 0x0b5f + _0807EA94 + Call sub_0807DF50 + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_0800B0D0.inc b/data/scripts/script_0800B0D0.inc new file mode 100644 index 00000000..c4687bdc --- /dev/null +++ b/data/scripts/script_0800B0D0.inc @@ -0,0 +1,56 @@ +SCRIPT_START script_0800B0D0 + BeginBlock + Call sub_0806BCD4 + DoPostScriptAction 0x000a + CallWithArg sub_0806BC94, 0x00000000 + EndBlock +script_0800B0E8: + Call sub_0807F434 + JumpTable script_0800B0E8, script_0800B0F6, script_0800B134 +script_0800B0F6: + _0807E864 + Call sub_0807DF28 + Call sub_0807F2D4 + _0807EB74 + CallWithArg sub_0806BC94, 0x00000004 + Call sub_0806BCE8 + _0807EA94 + Call sub_0807DF50 + _0807E878 + Call sub_0806BCB8 + CallWithArg sub_0806BC94, 0x00000000 + Jump script_0800B0E8 +script_0800B134: + _0807E864 + Call sub_0807DF28 + Call sub_0807F2D4 + _0807EB74 + CallWithArg sub_0806BC94, 0x00000004 + Call sub_0807F650 + _0807E9F0 + JumpIfNot script_0800B160 + Call sub_0806BCC0 +script_0800B160: + Call sub_0807DF50 + _0807E878 + Call sub_0806BCB8 + CallWithArg sub_0806BC94, 0x00000000 + Jump script_0800B0E8 + BeginBlock + Call sub_0807DF28 + SetLocalFlag 0x0039 + _0807E864 + EndBlock + WaitForPlayerAction0x17 + StartPlayerScript script_0800B1C0 + Wait 0x0018 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000001 + SetRoomFlag 0x0000 + Wait 0x0010 + SoundReq2 0x002d + _0807EB28 0x2701 + _0807E878 + Call sub_0807DF50 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800B1C0.inc b/data/scripts/script_0800B1C0.inc new file mode 100644 index 00000000..429afa66 --- /dev/null +++ b/data/scripts/script_0800B1C0.inc @@ -0,0 +1,16 @@ +SCRIPT_START script_0800B1C0 + BeginBlock + DoPostScriptAction 0x0000 + EndBlock + WaitForSomething2 0x00000002 + SetEntitySpeed 0x00e0 + _0807EDD4 0x0088, 0x0090 + ClearLocalFlag 0x0039 + DoPostScriptAction 0x0000 + DoPostScriptAction 0x0004 + Wait 0x002c + LoadRoomEntityList gUnk_080DA260 + Wait 0x001e + _0807E5F8 0x00000001 + Call sub_0807921C +SCRIPT_END diff --git a/data/scripts/script_0800B200.inc b/data/scripts/script_0800B200.inc new file mode 100644 index 00000000..3dfffa93 --- /dev/null +++ b/data/scripts/script_0800B200.inc @@ -0,0 +1,24 @@ +SCRIPT_START script_0800B200 + BeginBlock + _0807E5F8 0x00000000 + CheckLocalFlag 0x001d + JumpIf script_0800B252 + SetEntitySpeed 0x00c0 + EndBlock +script_0800B216: + WaitForSomething2 0x00000001 + Call sub_0807DF28 + MoveEntityToPlayer + CameraTargetEntity + _0807EDD4 0x0068, 0x0380 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000001 + Call sub_0807DF50 + Wait 0x000c + CameraTargetPlayer + Wait 0x0008 + _0807E878 + CheckLocalFlag 0x001d + JumpIfNot script_0800B216 +script_0800B252: +SCRIPT_END diff --git a/data/scripts/script_0800B254.inc b/data/scripts/script_0800B254.inc new file mode 100644 index 00000000..3686156d --- /dev/null +++ b/data/scripts/script_0800B254.inc @@ -0,0 +1,60 @@ +SCRIPT_START script_0800B254 + BeginBlock + CheckKinstoneFused 0x0006 + JumpIf script_0800B302 + _0807EA88 0x0006 + _0807EB44 0x0002 + EndBlock +script_0800B268: + _0807EA4C + _0807E9F0 + _0807E864 + CheckKinstoneFused 0x0006 + JumpIf script_0800B2E2 + Call sub_0807DF50 + _0807E878 + Jump script_0800B268 + .2byte 0x0000 + BeginBlock + CheckKinstoneFused 0x0007 + JumpIf script_0800B302 + _0807EA88 0x0007 + _0807EB44 0x0002 + EndBlock +script_0800B298: + _0807EA4C + _0807E9F0 + _0807E864 + CheckKinstoneFused 0x0007 + JumpIf script_0800B2E2 + Call sub_0807DF50 + _0807E878 + Jump script_0800B298 + .2byte 0x0000 + BeginBlock + CheckKinstoneFused 0x0008 + JumpIf script_0800B302 + _0807EA88 0x0008 + _0807EB44 0x0002 + EndBlock +script_0800B2C8: + _0807EA4C + _0807E9F0 + _0807E864 + CheckKinstoneFused 0x0008 + JumpIf script_0800B2E2 + Call sub_0807DF50 + _0807E878 + Jump script_0800B2C8 +script_0800B2E2: + DoPostScriptAction 0x0013 + _0807EB44 0x0004 + _0807E9DC + Call sub_080676E0 + Call sub_08067534 + DoPostScriptAction 0x0012 + _0807E5F8 0x00000001 +script_0800B302: + EndBlock +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800B308.inc b/data/scripts/script_0800B308.inc new file mode 100644 index 00000000..4163885a --- /dev/null +++ b/data/scripts/script_0800B308.inc @@ -0,0 +1,44 @@ +SCRIPT_START script_0800B308 + BeginBlock + CheckLocalFlag 0x001d + JumpIf script_0800B39C + DoPostScriptAction 0x0001 + SetEntitySpeed 0x0040 + SetEntityDirection 0x0010 + CheckKinstoneFused 0x0006 + JumpIfNot script_0800B32C + Call sub_080676D8 +script_0800B32C: + CheckKinstoneFused 0x0007 + JumpIfNot script_0800B33A + Call sub_080676D8 +script_0800B33A: + CheckKinstoneFused 0x0008 + JumpIfNot script_0800B348 + Call sub_080676D8 +script_0800B348: + EndBlock + Call sub_0806757C +script_0800B350: + EndBlock + WaitForSomething2 0x00000002 + SoundReq 0x00fd + Call sub_080676D8 + Call sub_0806757C + Call sub_080675D4 + Wait 0x0014 + BeginBlock + _0807E5F8 0x00000001 + CheckKinstoneFused 0x0006 + JumpIfNot script_0800B350 + CheckKinstoneFused 0x0007 + JumpIfNot script_0800B350 + CheckKinstoneFused 0x0008 + JumpIfNot script_0800B350 + EndBlock + SetLocalFlag 0x001d + SoundReq 0x0072 +script_0800B39C: + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800B3A4.inc b/data/scripts/script_0800B3A4.inc new file mode 100644 index 00000000..29a0db43 --- /dev/null +++ b/data/scripts/script_0800B3A4.inc @@ -0,0 +1,25 @@ +SCRIPT_START script_0800B3A4 + BeginBlock + DoPostScriptAction 0x000a + Call sub_0807F158 + SetEntitySpeed 0x0120 + _0807EB44 0x0004 + _0807E908 0x0002 + SetIntVariable 0x0000200a + EndBlock +script_0800B3C4: + _0807EDD4 0x0158, 0x0290 + Call sub_08065780 + Call sub_08065780 + Call sub_08065780 + Call sub_08065780 + Call sub_08065780 + Call sub_08065780 + _0807EDD4 0x0128, 0x0290 + Call sub_08065780 + Call sub_08065780 + Call sub_08065780 + Call sub_08065780 + Call sub_08065780 + Call sub_08065780 + Jump script_0800B3C4 diff --git a/data/scripts/script_0800B41C.inc b/data/scripts/script_0800B41C.inc new file mode 100644 index 00000000..6af14ec8 --- /dev/null +++ b/data/scripts/script_0800B41C.inc @@ -0,0 +1,36 @@ +SCRIPT_START script_0800B41C + BeginBlock + SetEntitySpeed 0x00c0 + _0807E908 0x0001 + DoPostScriptAction 0x000b + _0807E864 + Call sub_0807FBC4 + EndBlock + Wait 0x000a + DoPostScriptAction 0x0004 + _0807E5F8 0x00000008 + StartPlayerScript script_0800B54C + _0807EDD4 0x0140, 0x0298 + _0807EB74 + WaitForSomething2 0x00000004 + _0807EB74 + Wait 0x003c + SoundReq 0x00cd + _0807F088 0x0037 + WaitPlayerAction8 + _0807EB8C + TextboxNoOverlapFollow 0x200c + _0807EA94 + Wait 0x0014 + _0807EDD4 0x0158, 0x0290 + Wait 0x000a + _0807EDD4 0x0158, 0x0288 + Wait 0x0014 + _0807E5F8 0x00000010 + _0807EDD4 0x0158, 0x0280 + Wait 0x000a + DoPostScriptAction 0x0008 + _0807E5F8 0x00000010 + _0807E5F8 0x00000008 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_0800B4AC.inc b/data/scripts/script_0800B4AC.inc new file mode 100644 index 00000000..26fc3d9a --- /dev/null +++ b/data/scripts/script_0800B4AC.inc @@ -0,0 +1,46 @@ +SCRIPT_START script_0800B4AC + BeginBlock + DoPostScriptAction 0x000a + DoPostScriptAction 0x0001 + SetEntitySpeed 0x00c0 + _0807E9D4 +script_0800B4BC: + EndBlock + BeginBlock + CheckEntityInteractType + JumpIf script_0800B4D4 + TestBit 0x00000008 + JumpIf script_0800B4F0 + Jump script_0800B4BC +script_0800B4D4: + _0807E864 + _0807EB74 + DoPostScriptAction 0x0000 + TextboxNoOverlapFollow 0x200b + EndBlock + _0807E878 + _0807EB44 0x0004 + DoPostScriptAction 0x0001 + Jump script_0800B4BC +script_0800B4F0: + EndBlock + _0807E610 0x00000008 + _0807EDD4 0x0134, 0x0288 + _0807EB44 0x0004 + WaitForSomething2 0x00000008 + TextboxNoOverlapFollow 0x2016 + _0807EA94 + _0807EDD4 0x0158, 0x0288 + DoPostScriptAction 0x0000 + _0807EB44 0x0000 + Wait 0x000a + _0807E5F8 0x00000010 + DoPostScriptAction 0x0008 + Wait 0x001e + _0807E5F8 0x00000010 + SetGlobalFlag 0x001d + Call sub_0807921C + _0807E878 + Call sub_0807FBCC + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_0800B54C.inc b/data/scripts/script_0800B54C.inc new file mode 100644 index 00000000..cb550b60 --- /dev/null +++ b/data/scripts/script_0800B54C.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_0800B54C + BeginBlock + SetEntitySpeed 0x0100 + EndBlock + _0807EDD4 0x0128, 0x0298 + Wait 0x000a + _0807EB44 0x0002 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000002 +SCRIPT_END diff --git a/data/scripts/script_0800B574.inc b/data/scripts/script_0800B574.inc new file mode 100644 index 00000000..c42e9417 --- /dev/null +++ b/data/scripts/script_0800B574.inc @@ -0,0 +1,21 @@ +SCRIPT_START script_0800B574 + BeginBlock + DoPostScriptAction 0x0007 + CheckGlobalFlag 0x001d + JumpIf script_0800B5BC + EndBlock + WaitForSomething2 0x00000010 + DoPostScriptAction 0x0008 + SoundReq 0x0111 + WaitForSomething2 0x00000010 + DoPostScriptAction 0x0007 + SoundReq 0x0111 + WaitForSomething2 0x00000010 + DoPostScriptAction 0x0008 + SoundReq 0x0111 + WaitForSomething2 0x00000010 + DoPostScriptAction 0x0007 + SoundReq 0x0111 +script_0800B5BC: + Call sub_0808692C +SCRIPT_END diff --git a/data/scripts/script_0800B5C4.inc b/data/scripts/script_0800B5C4.inc new file mode 100644 index 00000000..45c39e1e --- /dev/null +++ b/data/scripts/script_0800B5C4.inc @@ -0,0 +1,12 @@ +SCRIPT_START script_0800B5C4 + BeginBlock + SetEntitySpeed 0x0100 + _0807EB44 0x0004 + EndBlock + Wait 0x001e + SoundReq 0x00d1 + _0807EDD4 0x008a, 0x005a + Wait 0x000a + Call sub_08069EE8 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800B5EC.inc b/data/scripts/script_0800B5EC.inc new file mode 100644 index 00000000..e549b811 --- /dev/null +++ b/data/scripts/script_0800B5EC.inc @@ -0,0 +1,67 @@ +SCRIPT_START script_0800B5EC + BeginBlock + DoPostScriptAction 0x000a + DoPostScriptAction 0x0001 + _0807E9D4 + EndBlock +script_0800B5FA: + CheckEntityInteractType + JumpIfNot script_0800B5FA + _0807E864 + _0807EB74 + TextboxNoOverlap 0x2009 + _0807EA94 + _0807E878 + _0807EB44 0x0004 + Jump script_0800B5FA + BeginBlock + EndBlock +script_0800B618: + CheckPlayerInRegion 0x0078, 0x00b8, 0x1060 + JumpIfNot script_0800B618 + Call sub_08079184 + _0807E864 + Call sub_0807F9A4 + StartPlayerScript script_0800B7C4 + WaitForSomething2 0x00000004 + SetRoomFlag 0x0000 + WaitForSomething2 0x00000004 + CheckLocalFlag 0x009e + JumpIf script_0800B7A2 + TextboxNoOverlap 0x0583 + _0807EA94 + _0807E3E8 + JumpIfNot script_0800B684 + Wait 0x000f + TextboxNoOverlap 0x0584 + CallWithArg sub_0807F970, 0x0000058b + JumpIf script_0800B68E + CallWithArg sub_08087424, 0x00000000 + Wait 0x00b4 + Jump script_0800B6A6 +script_0800B684: + TextboxNoOverlap 0x057d + _0807EA94 + Jump script_0800B6A6 +script_0800B68E: + _0807EA94 + SetLocalFlag 0x009e + _0807F034 0x0066 +script_0800B698: + WaitPlayerAction8 + _0807EB8C + Wait 0x001e + TextboxNoOverlap 0x057f + _0807EA94 +script_0800B6A6: + _0807E778 0x0004 + DoFade7 + WaitFor_2 + Call sub_080873FC + DoFade6 + WaitFor_2 + CameraTargetPlayer + Wait 0x001e + Call sub_0807DF50 + _0807E878 +SCRIPT_END diff --git a/data/scripts/script_0800B6C8.inc b/data/scripts/script_0800B6C8.inc new file mode 100644 index 00000000..18560a5c --- /dev/null +++ b/data/scripts/script_0800B6C8.inc @@ -0,0 +1,67 @@ +SCRIPT_START script_0800B6C8 + BeginBlock + EndBlock +script_0800B6CC: + HasRupees 0x0001 + JumpIfNot script_0800B6CC +script_0800B6D4: + CheckPlayerInRegion 0x0078, 0x00b8, 0x1060 + JumpIfNot script_0800B6D4 + Call sub_08079184 + _0807E864 + Call sub_0807F9A4 + StartPlayerScript script_0800B7C4 + WaitForSomething2 0x00000004 + SetRoomFlag 0x0000 + WaitForSomething2 0x00000004 + CheckLocalFlag 0x009f + JumpIf script_0800B7A2 + TextboxNoOverlap 0x057b + _0807EA94 + CallWithArg sub_0807F970, 0x0000057d + JumpIf script_0800B6A6 + _0807EA94 + SetLocalFlag 0x009f + _0807F034 0x0064 + Jump script_0800B698 + .2byte 0x0000 + BeginBlock + EndBlock +script_0800B734: + Call sub_0808747C + JumpIfNot script_0800B734 + Call sub_08079184 + _0807E864 + Wait 0x000a + Call sub_0807F9A4 + StartPlayerScript script_0800B7C4 + WaitForSomething2 0x00000004 + SetRoomFlag 0x0000 + WaitForSomething2 0x00000004 + CheckLocalFlag 0x00a0 + JumpIf script_0800B7A2 + TextboxNoOverlap 0x0580 + _0807EA94 + CallWithArg sub_0807F970, 0x00000582 + JumpIf script_0800B794 + CallWithArg sub_08087424, 0x00000001 + Wait 0x00b4 + Jump script_0800B6A6 +script_0800B794: + _0807EA94 + SetLocalFlag 0x00a0 + _0807F034 0x0065 + Jump script_0800B698 +script_0800B7A2: + TextboxNoOverlap 0x0590 + _0807EA94 + _0807E778 0x0010 + DoFade7 + WaitFor_2 + ModHealth 0x00a0 + DoFade6 + WaitFor_2 + TextboxNoOverlap 0x057f + _0807EA94 + Jump script_0800B6A6 + .2byte 0x0000 diff --git a/data/scripts/script_0800B7C4.inc b/data/scripts/script_0800B7C4.inc new file mode 100644 index 00000000..b9f32d34 --- /dev/null +++ b/data/scripts/script_0800B7C4.inc @@ -0,0 +1,13 @@ +SCRIPT_START script_0800B7C4 + BeginBlock + SetEntitySpeed 0x0100 + EndBlock + CallWithArg sub_0807F6B4, 0x00000090 + JumpIfNot script_0800B7FC + CallWithArg sub_0807F464, 0x00000078 + CallWithArg sub_0807F4F8, 0x00000090 +script_0800B7EE: + _0807E8E4_0 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000004 +SCRIPT_END diff --git a/data/scripts/script_0800B7FC.inc b/data/scripts/script_0800B7FC.inc new file mode 100644 index 00000000..e2a45b4a --- /dev/null +++ b/data/scripts/script_0800B7FC.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_0800B7FC + CallWithArg sub_0807F4F8, 0x00000090 + CallWithArg sub_0807F464, 0x00000078 + Jump script_0800B7EE + BeginBlock + DoPostScriptAction 0x0007 + _0807EB44 0x0004 + _0807E930 0x0000 + EndBlock +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800B828.inc b/data/scripts/script_0800B828.inc new file mode 100644 index 00000000..4bf415cf --- /dev/null +++ b/data/scripts/script_0800B828.inc @@ -0,0 +1,129 @@ +SCRIPT_START script_0800B828 + BeginBlock + _0807E9D4 + _0807EB44 0x0000 + DoPostScriptAction 0x000a + EndBlock +script_0800B836: + _0807E944 + _0807E864 + TextboxNoOverlapFollow 0x0a01 + _0807EA94 + Wait 0x000f + _0807E878 + Jump script_0800B836 + .2byte 0x0000 + BeginBlock + _0807E9D4 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + DoPostScriptAction 0x000a + EndBlock +script_0800B85E: + Wait 0x003c + Call sub_080646A4 + Jump script_0800B85E + BeginBlock + _0807E9D4 + _0807EB44 0x0004 + _0807E930 0x0000 + DoPostScriptAction 0x000a + EndBlock +script_0800B87E: + Wait 0x003c + Call sub_0806407C + Jump script_0800B87E + BeginBlock + _0807E9D4 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + DoPostScriptAction 0x000a + EndBlock +script_0800B89E: + CheckEntityInteractType + JumpIfNot script_0800B89E + _0807E864 + _0807EB74 + TextboxNoOverlapFollow 0x0a01 + _0807EA94 + Wait 0x000f + _0807E878 + Jump script_0800B89E + BeginBlock + _0807E9D4 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + DoPostScriptAction 0x000a + CallWithArg sub_08064644, sub_0806464C + EndBlock +script_0800B8D4: + Wait 0x003c + Call sub_080646A4 + Jump script_0800B8D4 + .2byte 0x0000 + BeginBlock + Call sub_08061E70 + DoPostScriptAction 0x000a + _0807EB44 0x0004 + Call sub_08061FD8 + EndBlock +script_0800B8FC: + CheckEntityInteractType + JumpIfNot script_0800B8FC + _0807E864 + _0807EB74 + Call sub_08061FD8 + Call sub_08062048 + _0807EA94 + _0807E878 + Jump script_0800B8FC + .2byte 0x0000 + BeginBlock + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + DoPostScriptAction 0x000a + EndBlock + CheckLocalFlag 0x005f + JumpIf script_0800B94E +script_0800B934: + CheckEntityInteractType + JumpIfNot script_0800B934 + _0807E864 + _0807EB74 + TextboxNoOverlapFollow 0x3f19 + _0807EA94 + SetLocalFlag 0x005f + _0807E878 + Jump script_0800B934 +script_0800B94E: + CheckEntityInteractType + JumpIfNot script_0800B94E + _0807E864 + _0807EB74 + TextboxNoOverlapFollow 0x3f1a + _0807EA94 + _0807E878 + Jump script_0800B94E + BeginBlock + DoPostScriptAction 0x000b + DoPostScriptAction 0x0008 + Call sub_0806DAAC + JumpIf script_0800B9AC + Call sub_0806DAD0 + CallWithArg sub_0806DA04, 0x00000005 + EndBlock +script_0800B98A: + _0807EA4C + _0807E9F0 + JumpIf script_0800B99E + Call sub_0807DF50 + _0807E878 + Jump script_0800B98A +script_0800B99E: + Call sub_0806F188 + Call sub_0807DF50 + _0807E878 +script_0800B9AC: + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800B9B4.inc b/data/scripts/script_0800B9B4.inc new file mode 100644 index 00000000..1a1519f2 --- /dev/null +++ b/data/scripts/script_0800B9B4.inc @@ -0,0 +1,82 @@ +SCRIPT_START script_0800B9B4 + BeginBlock + _0807E9D4 + Call sub_080694EC + DoPostScriptAction 0x000a + Call sub_080694B0 + EndBlock +script_0800B9CA: + Call sub_0807F434 + JumpTable script_0800B9CA, script_0800B9D8, script_0800B9F4 +script_0800B9D8: + _0807E864 + _0807EB74 + DoPostScriptAction 0x0000 + Call sub_080694D8 + _0807EA94 + Call sub_080694EC + _0807E878 + Jump script_0800B9CA +script_0800B9F4: + _0807E864 + _0807EB74 + DoPostScriptAction 0x0000 + Call sub_0807F650 + _0807E9F0 + _0807E864 + Call sub_0806948C + JumpIf script_0800BA24 + _0807EA94 + Call sub_080694EC + Call sub_0807DF50 + _0807E878 + Jump script_0800B9CA +script_0800BA24: + _0807EA94 + _0807E9DC + _0807E9D4 + Call sub_080694EC + Call sub_0807DF50 + _0807E878 + Jump script_0800B9CA + BeginBlock + Call sub_0807F934 + EndBlock +script_0800BA46: + CheckEntityInteractType + JumpIfNot script_0800BA46 + _0807E864 + Call sub_0807DF28 + TextboxNoOverlapFollow 0x3301 + _0807EA94 + _0807E3E8 + JumpIfNot script_0800BA6C + SoundReq0x80100000 + Call sub_0806E964 + SoundReq2 0xffff +script_0800BA6C: + Call sub_0807DF50 + _0807E878 + Jump script_0800BA46 + BeginBlock + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + SetEntitySpeed 0x0040 + Call sub_0807F348 + EndBlock +script_0800BA8E: + CheckRoomFlag 0x00ff + JumpIfNot script_0800BA8E + _0807EDD4 0x02f8, 0x0350 + Wait 0x001e + DoPostScriptAction 0x0004 + Wait 0x003c + _0807EB44 0x0006 + Wait 0x001e + _0807EDD4 0x02f0, 0x0350 + Wait 0x001e + TextboxNoOverlap 0x0e00 + _0807EA94 + Wait 0x0078 + Call sub_08054968 +SCRIPT_END diff --git a/data/scripts/script_0800BACC.inc b/data/scripts/script_0800BACC.inc new file mode 100644 index 00000000..df7c4e03 --- /dev/null +++ b/data/scripts/script_0800BACC.inc @@ -0,0 +1,16 @@ +SCRIPT_START script_0800BACC + BeginBlock + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + Call sub_0807F348 + EndBlock +script_0800BADE: + CheckRoomFlag 0x00ff + JumpIfNot script_0800BADE + DoPostScriptAction 0x0004 + Wait 0x003c + TextboxNoOverlap 0x0e01 + _0807EA94 + Wait 0x0078 + Call sub_08054968 +SCRIPT_END diff --git a/data/scripts/script_0800BB00.inc b/data/scripts/script_0800BB00.inc new file mode 100644 index 00000000..3f992005 --- /dev/null +++ b/data/scripts/script_0800BB00.inc @@ -0,0 +1,16 @@ +SCRIPT_START script_0800BB00 + BeginBlock + EndBlock +script_0800BB04: + CheckRoomFlag 0x00ff + JumpIfNot script_0800BB04 + DoPostScriptAction 0x0004 + Wait 0x003c + TextboxNoOverlap 0x0e02 + _0807EA94 + Wait 0x003c + DoPostScriptAction 0x000f + Wait 0x00b4 + Call sub_08054968 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800BB30.inc b/data/scripts/script_0800BB30.inc new file mode 100644 index 00000000..072d935e --- /dev/null +++ b/data/scripts/script_0800BB30.inc @@ -0,0 +1,16 @@ +SCRIPT_START script_0800BB30 + BeginBlock + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + Call sub_0807F348 + EndBlock +script_0800BB42: + CheckRoomFlag 0x00ff + JumpIfNot script_0800BB42 + DoPostScriptAction 0x0004 + Wait 0x003c + TextboxNoOverlap 0x0e05 + _0807EA94 + Wait 0x0078 + Call sub_08054968 +SCRIPT_END diff --git a/data/scripts/script_0800BB64.inc b/data/scripts/script_0800BB64.inc new file mode 100644 index 00000000..8bc8cba9 --- /dev/null +++ b/data/scripts/script_0800BB64.inc @@ -0,0 +1,18 @@ +SCRIPT_START script_0800BB64 + BeginBlock + _0807EB44 0x0006 + DoPostScriptAction 0x0000 + SetEntitySpeed 0x0040 + Call sub_0807F348 + EndBlock +script_0800BB7A: + CheckRoomFlag 0x00ff + JumpIfNot script_0800BB7A + _0807EDD4 0x03a0, 0x00f8 + Wait 0x001e + TextboxNoOverlap 0x0e06 + _0807EA94 + Wait 0x000f + _0807EDD4 0x0380, 0x00f8 + Call sub_08054968 +SCRIPT_END diff --git a/data/scripts/script_0800BBA4.inc b/data/scripts/script_0800BBA4.inc new file mode 100644 index 00000000..58a0884d --- /dev/null +++ b/data/scripts/script_0800BBA4.inc @@ -0,0 +1,17 @@ +SCRIPT_START script_0800BBA4 + BeginBlock + DoPostScriptAction 0x0007 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + Call sub_0807F348 + EndBlock +script_0800BBBA: + CheckRoomFlag 0x00ff + JumpIfNot script_0800BBBA + DoPostScriptAction 0x0004 + Wait 0x003c + TextboxNoOverlap 0x0e04 + _0807EA94 + Wait 0x0078 + Call sub_08054968 +SCRIPT_END diff --git a/data/scripts/script_0800BBDC.inc b/data/scripts/script_0800BBDC.inc new file mode 100644 index 00000000..a9b2b676 --- /dev/null +++ b/data/scripts/script_0800BBDC.inc @@ -0,0 +1,15 @@ +SCRIPT_START script_0800BBDC + BeginBlock + _0807E930 0x0000 + EndBlock +script_0800BBE4: + CheckRoomFlag 0x00ff + JumpIfNot script_0800BBE4 + DoPostScriptAction 0x0004 + Wait 0x003c + TextboxNoOverlap 0x0e03 + _0807EA94 + Wait 0x0078 + Call sub_08054968 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800BC08.inc b/data/scripts/script_0800BC08.inc new file mode 100644 index 00000000..52f34b61 --- /dev/null +++ b/data/scripts/script_0800BC08.inc @@ -0,0 +1,22 @@ +SCRIPT_START script_0800BC08 + BeginBlock + DoPostScriptAction 0x0007 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + EndBlock +script_0800BC18: + CheckRoomFlag 0x00ff + JumpIfNot script_0800BC18 + DoPostScriptAction 0x0004 + Wait 0x003c + TextboxNoOverlap 0x0e07 + _0807EA94 + BeginBlock + _0807EB44 0x0000 + _0807E930 0x0004 + EndBlock + Wait 0x003c + Call sub_08065CCC + Wait 0x0078 + Call sub_08054968 +SCRIPT_END diff --git a/data/scripts/script_0800BC50.inc b/data/scripts/script_0800BC50.inc new file mode 100644 index 00000000..2cc1a6d6 --- /dev/null +++ b/data/scripts/script_0800BC50.inc @@ -0,0 +1,38 @@ +SCRIPT_START script_0800BC50 + BeginBlock + _0807EB44 0x0004 + _0807E930 0x0008 + Call sub_08054EB8 + EndBlock +script_0800BC62: + CheckRoomFlag 0x00ff + JumpIfNot script_0800BC62 + _0807E930 0x0000 + Wait 0x001e + DoPostScriptAction 0x0004 + Wait 0x003c + TextboxNoOverlap 0x0e08 + _0807EA94 + DoPostScriptAction 0x000f + _0807E930 0x0008 + Wait 0x00f0 + Call sub_08054EFC + _0807EB44 0x0000 + _0807E930 0x0000 + SetEntitySpeed 0x0040 + DoPostScriptAction 0x000d + CallWithArg sub_0807F4F8, 0x00000378 + Wait 0x003c + DoPostScriptAction 0x000c + Wait 0x003c + TextboxNoOverlap 0x0e09 + _0807EA94 + Call sub_0807F158 + CallWithArg sub_0807F4F8, 0x0000035c + Wait 0x001e + SoundReq 0x0188 + DoPostScriptAction 0x0008 + Wait 0x0078 + Call sub_08054968 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800BCE8.inc b/data/scripts/script_0800BCE8.inc new file mode 100644 index 00000000..1d4a66b4 --- /dev/null +++ b/data/scripts/script_0800BCE8.inc @@ -0,0 +1,37 @@ +SCRIPT_START script_0800BCE8 + BeginBlock + _0807EB44 0x0004 + _0807E930 0x0008 + Call sub_0807F348 + EndBlock + WaitFor_2 + Wait 0x00f0 + _0807E930 0x0000 + Wait 0x003c + TextboxNoOverlap 0x0e0a + _0807EA94 + _0807E930 0x0008 + Wait 0x003c + _0807E5F8 0x00000001 +script_0800BD1C: + CheckRoomFlag 0x00ff + JumpIfNot script_0800BD1C + _0807E5F8 0x00000002 + WaitForSomething2 0x00000004 + _0807E930 0x0000 + DoPostScriptAction 0x0004 + Wait 0x003c + TextboxNoOverlap 0x0e0c + _0807EA94 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000004 + DoPostScriptAction 0x000f + _0807E930 0x0008 + Wait 0x0168 + _0807E930 0x0000 + Wait 0x003c + _0807EB44 0x0002 + WaitForSomething2 0x00000004 + SetEntitySpeed 0x0080 + _0807EEF4 0x0000, 0xffe0 +SCRIPT_END diff --git a/data/scripts/script_0800BD78.inc b/data/scripts/script_0800BD78.inc new file mode 100644 index 00000000..3b4f628f --- /dev/null +++ b/data/scripts/script_0800BD78.inc @@ -0,0 +1,35 @@ +SCRIPT_START script_0800BD78 + BeginBlock + _0807EB44 0x0000 + _0807E930 0x0000 + DoPostScriptAction 0x0008 + SetEntitySpeed 0x0080 + Call sub_0807F348 + EndBlock + WaitForSomething2 0x00000002 + DoPostScriptAction 0x0007 + CallWithArg sub_0807F4F8, 0x00000270 + Wait 0x001e + TextboxNoOverlap 0x0e0b + _0807EA94 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000002 + SetEntitySpeed 0x0100 + _0807EDD4 0x0088, 0x0228 + Wait 0x000f + _0807E5F8 0x00000004 + DoPostScriptAction 0x000f + _0807E930 0x0008 + Wait 0x00b4 + CallWithArg sub_0804BF38, 0x00000000 + Wait 0x00b4 + CallWithArg sub_0804BF38, 0x00000003 + _0807EB44 0x0004 + _0807E930 0x0000 + Wait 0x003c + _0807EB44 0x0006 + _0807E5F8 0x00000004 + SetEntitySpeed 0x0080 + _0807EEF4 0x0000, 0xffe0 + Call sub_08054968 +SCRIPT_END diff --git a/data/scripts/script_0800BE1C.inc b/data/scripts/script_0800BE1C.inc new file mode 100644 index 00000000..ef5f897c --- /dev/null +++ b/data/scripts/script_0800BE1C.inc @@ -0,0 +1,49 @@ +SCRIPT_START script_0800BE1C + BeginBlock + _0807EB44 0x0004 + _0807E930 0x0008 + Call sub_0807F348 + EndBlock + WaitFor_2 + Wait 0x00f0 + _0807E930 0x0000 + _0807EB44 0x0002 + Wait 0x003c + TextboxNoOverlap 0x0e0d + _0807EA94 + _0807E930 0x0008 + Wait 0x003c + Jump script_0800BE88 + .2byte 0x0000 + BeginBlock + _0807EB44 0x0004 + _0807E930 0x0008 + Call sub_0807F348 + EndBlock + WaitFor_2 + Wait 0x00f0 + _0807E930 0x0000 + _0807EB44 0x0006 + Wait 0x003c + _0807EA94 + _0807E930 0x0008 + Wait 0x003c + _0807E5F8 0x00000001 +script_0800BE88: + _0807EB44 0x0004 +script_0800BE8C: + CheckRoomFlag 0x00ff + JumpIfNot script_0800BE8C + _0807E5F8 0x00000002 + Call sub_08054F64 + _0807E930 0x0000 + DoPostScriptAction 0x0004 + Wait 0x003c + TextboxNoOverlap 0x0e0f + _0807EA94 + _0807E5F8 0x00000002 + Call sub_08054F64 + DoPostScriptAction 0x000f + _0807E930 0x0008 + Wait 0x00f0 +SCRIPT_END diff --git a/data/scripts/script_0800BECC.inc b/data/scripts/script_0800BECC.inc new file mode 100644 index 00000000..a57fbd89 --- /dev/null +++ b/data/scripts/script_0800BECC.inc @@ -0,0 +1,25 @@ +SCRIPT_START script_0800BECC + BeginBlock + _0807EB44 0x0000 + _0807E930 0x0000 + DoPostScriptAction 0x0008 + SetEntitySpeed 0x0080 + Call sub_0807F348 + EndBlock + WaitForSomething2 0x00000002 + DoPostScriptAction 0x0007 + CallWithArg sub_0807F4F8, 0x000001b8 + Wait 0x001e + TextboxNoOverlap 0x0e0e + _0807EA94 + _0807E5F8 0x0000000c + WaitForSomething2 0x00000002 + SetEntitySpeed 0x0100 + _0807EDD4 0x0088, 0x0178 + Wait 0x000f + _0807E5F8 0x0000000c + DoPostScriptAction 0x000f + _0807E930 0x0008 + Wait 0x00f0 + Call sub_08054968 +SCRIPT_END diff --git a/data/scripts/script_0800BF38.inc b/data/scripts/script_0800BF38.inc new file mode 100644 index 00000000..c136745f --- /dev/null +++ b/data/scripts/script_0800BF38.inc @@ -0,0 +1,55 @@ +SCRIPT_START script_0800BF38 + BeginBlock + _0807EB44 0x0004 + _0807E930 0x0008 + Call sub_0807F348 + EndBlock + WaitFor_2 + Wait 0x00f0 + _0807E930 0x0000 + _0807EB44 0x0002 + Wait 0x003c + TextboxNoOverlap 0x0e10 + _0807EA94 + _0807E930 0x0008 + Wait 0x003c + Jump script_0800BFA4 + .2byte 0x0000 + BeginBlock + _0807EB44 0x0004 + _0807E930 0x0008 + Call sub_0807F348 + EndBlock + WaitFor_2 + Wait 0x00f0 + _0807E930 0x0000 + _0807EB44 0x0006 + Wait 0x003c + _0807EA94 + _0807E930 0x0008 + Wait 0x003c + _0807E5F8 0x00000001 +script_0800BFA4: + _0807EB44 0x0004 +script_0800BFA8: + CheckRoomFlag 0x00ff + JumpIfNot script_0800BFA8 + _0807E5F8 0x00000002 + Call sub_08054F64 + _0807E930 0x0000 + DoPostScriptAction 0x0004 + Wait 0x003c + TextboxNoOverlap 0x0e12 + _0807EA94 + _0807E5F8 0x00000002 + Call sub_08054F64 + DoPostScriptAction 0x000f + _0807E930 0x0008 + Wait 0x0168 + _0807EB44 0x0004 + _0807E930 0x0000 + Wait 0x003c + Call sub_08054F64 + SetEntitySpeed 0x0080 + _0807EEF4 0x0000, 0xffe0 +SCRIPT_END diff --git a/data/scripts/script_0800C004.inc b/data/scripts/script_0800C004.inc new file mode 100644 index 00000000..da82fbf0 --- /dev/null +++ b/data/scripts/script_0800C004.inc @@ -0,0 +1,36 @@ +SCRIPT_START script_0800C004 + BeginBlock + _0807EB44 0x0000 + _0807E930 0x0000 + DoPostScriptAction 0x0008 + SetEntitySpeed 0x0080 + Call sub_0807F348 + EndBlock + WaitForSomething2 0x00000002 + DoPostScriptAction 0x0007 + CallWithArg sub_0807F4F8, 0x000001b8 + Wait 0x001e + TextboxNoOverlap 0x0e11 + _0807EA94 + _0807E5F8 0x0000001c + WaitForSomething2 0x00000002 + SetEntitySpeed 0x0100 + _0807EDD4 0x0088, 0x0188 + _0807EDD4 0x00a8, 0x0188 + _0807EDD4 0x00a8, 0x0178 + Wait 0x000f + _0807E5F8 0x0000001c + DoPostScriptAction 0x000f + _0807E930 0x0008 + Wait 0x00b4 + CallWithArg sub_0804BF38, 0x00000001 + Wait 0x00b4 + CallWithArg sub_0804BF38, 0x00000004 + _0807EB44 0x0004 + _0807E930 0x0000 + Wait 0x003c + _0807E5F8 0x0000001c + SetEntitySpeed 0x0080 + _0807EEF4 0x0000, 0xffe0 + Call sub_08054968 +SCRIPT_END diff --git a/data/scripts/script_0800C0B0.inc b/data/scripts/script_0800C0B0.inc new file mode 100644 index 00000000..04950467 --- /dev/null +++ b/data/scripts/script_0800C0B0.inc @@ -0,0 +1,49 @@ +SCRIPT_START script_0800C0B0 + BeginBlock + _0807EB44 0x0004 + _0807E930 0x0008 + Call sub_0807F348 + EndBlock + WaitFor_2 + Wait 0x00f0 + _0807E930 0x0000 + _0807EB44 0x0002 + Wait 0x003c + TextboxNoOverlap 0x0e13 + _0807EA94 + _0807E930 0x0008 + Wait 0x003c + Jump script_0800C11C + .2byte 0x0000 + BeginBlock + _0807EB44 0x0004 + _0807E930 0x0008 + Call sub_0807F348 + EndBlock + WaitFor_2 + Wait 0x00f0 + _0807E930 0x0000 + _0807EB44 0x0006 + Wait 0x003c + _0807EA94 + _0807E930 0x0008 + Wait 0x003c + _0807E5F8 0x00000001 +script_0800C11C: + _0807EB44 0x0004 +script_0800C120: + CheckRoomFlag 0x00ff + JumpIfNot script_0800C120 + _0807E5F8 0x00000002 + Call sub_08054F64 + _0807E930 0x0000 + DoPostScriptAction 0x0004 + Wait 0x003c + TextboxNoOverlap 0x0e15 + _0807EA94 + _0807E5F8 0x00000002 + Call sub_08054F64 + DoPostScriptAction 0x000f + _0807E930 0x0008 + Wait 0x00f0 +SCRIPT_END diff --git a/data/scripts/script_0800C160.inc b/data/scripts/script_0800C160.inc new file mode 100644 index 00000000..3df5f2f1 --- /dev/null +++ b/data/scripts/script_0800C160.inc @@ -0,0 +1,27 @@ +SCRIPT_START script_0800C160 + BeginBlock + _0807EB44 0x0000 + _0807E930 0x0000 + DoPostScriptAction 0x0008 + SetEntitySpeed 0x0080 + Call sub_0807F348 + EndBlock + WaitForSomething2 0x00000002 + DoPostScriptAction 0x0007 + CallWithArg sub_0807F4F8, 0x00000128 + Wait 0x001e + TextboxNoOverlap 0x0e14 + _0807EA94 + _0807E5F8 0x0000003c + WaitForSomething2 0x00000002 + SetEntitySpeed 0x0100 + _0807EDD4 0x0098, 0x00e8 + _0807EDD4 0x00a8, 0x00e8 + _0807EDD4 0x00a8, 0x00d8 + Wait 0x000f + _0807E5F8 0x0000003c + DoPostScriptAction 0x000f + _0807E930 0x0008 + Wait 0x00f0 + Call sub_08054968 +SCRIPT_END diff --git a/data/scripts/script_0800C1D8.inc b/data/scripts/script_0800C1D8.inc new file mode 100644 index 00000000..9eaf26a5 --- /dev/null +++ b/data/scripts/script_0800C1D8.inc @@ -0,0 +1,55 @@ +SCRIPT_START script_0800C1D8 + BeginBlock + _0807EB44 0x0004 + _0807E930 0x0008 + Call sub_0807F348 + EndBlock + WaitFor_2 + Wait 0x00f0 + _0807E930 0x0000 + _0807EB44 0x0002 + Wait 0x003c + TextboxNoOverlap 0x0e16 + _0807EA94 + _0807E930 0x0008 + Wait 0x003c + Jump script_0800C244 + .2byte 0x0000 + BeginBlock + _0807EB44 0x0004 + _0807E930 0x0008 + Call sub_0807F348 + EndBlock + WaitFor_2 + Wait 0x00f0 + _0807E930 0x0000 + _0807EB44 0x0006 + Wait 0x003c + _0807EA94 + _0807E930 0x0008 + Wait 0x003c + _0807E5F8 0x00000001 +script_0800C244: + _0807EB44 0x0004 +script_0800C248: + CheckRoomFlag 0x00ff + JumpIfNot script_0800C248 + _0807E5F8 0x00000002 + Call sub_08054F64 + _0807E930 0x0000 + DoPostScriptAction 0x0004 + Wait 0x003c + TextboxNoOverlap 0x0e18 + _0807EA94 + _0807E5F8 0x00000002 + Call sub_08054F64 + DoPostScriptAction 0x000f + _0807E930 0x0008 + Wait 0x0168 + _0807EB44 0x0004 + _0807E930 0x0000 + Wait 0x003c + Call sub_08054F64 + SetEntitySpeed 0x0080 + _0807EEF4 0x0000, 0xffe0 +SCRIPT_END diff --git a/data/scripts/script_0800C2A4.inc b/data/scripts/script_0800C2A4.inc new file mode 100644 index 00000000..02d68b9c --- /dev/null +++ b/data/scripts/script_0800C2A4.inc @@ -0,0 +1,36 @@ +SCRIPT_START script_0800C2A4 + BeginBlock + _0807EB44 0x0000 + _0807E930 0x0000 + DoPostScriptAction 0x0008 + SetEntitySpeed 0x0080 + Call sub_0807F348 + EndBlock + WaitForSomething2 0x00000002 + DoPostScriptAction 0x0007 + CallWithArg sub_0807F4F8, 0x00000128 + Wait 0x001e + TextboxNoOverlap 0x0e17 + _0807EA94 + _0807E5F8 0x0000007c + WaitForSomething2 0x00000002 + SetEntitySpeed 0x0100 + _0807EDD4 0x0098, 0x00e8 + _0807EDD4 0x00c8, 0x00e8 + _0807EDD4 0x00c8, 0x00d8 + Wait 0x000f + _0807E5F8 0x0000007c + DoPostScriptAction 0x000f + _0807E930 0x0008 + Wait 0x00b4 + CallWithArg sub_0804BF38, 0x00000002 + Wait 0x00b4 + CallWithArg sub_0804BF38, 0x00000005 + _0807EB44 0x0004 + _0807E930 0x0000 + Wait 0x003c + _0807E5F8 0x0000007c + SetEntitySpeed 0x0080 + _0807EEF4 0x0000, 0xffe0 + Call sub_08054968 +SCRIPT_END diff --git a/data/scripts/script_0800C350.inc b/data/scripts/script_0800C350.inc new file mode 100644 index 00000000..fd0d06d5 --- /dev/null +++ b/data/scripts/script_0800C350.inc @@ -0,0 +1,9 @@ +SCRIPT_START script_0800C350 + BeginBlock + CallWithArg sub_0806D658, 0x00000003 + SetEntitySpeed 0x0200 + EndBlock +script_0800C362: + CheckRoomFlag 0x00ff + JumpIfNot script_0800C362 + _0807F0C8 0xffff, 0x0000 diff --git a/data/scripts/script_0800C370.inc b/data/scripts/script_0800C370.inc new file mode 100644 index 00000000..a19ec82a --- /dev/null +++ b/data/scripts/script_0800C370.inc @@ -0,0 +1,13 @@ +SCRIPT_START script_0800C370 + _0807EEF4 0xfff8, 0x0000 + _0807EEF4 0x0010, 0x0000 + _0807EEF4 0xfff0, 0x0000 + _0807EEF4 0x0010, 0x0000 + _0807EEF4 0xfff8, 0x0000 + _0807F0C8 0x0000, 0x0000 + Wait 0x001e + TextboxNoOverlap 0x1d00 + _0807EA94 + _0807E5F8 0x00000006 + WaitForSomething2 0x00000001 + _0807F0C8 0xffff, 0x0000 diff --git a/data/scripts/script_0800C3B0.inc b/data/scripts/script_0800C3B0.inc new file mode 100644 index 00000000..7c2582f8 --- /dev/null +++ b/data/scripts/script_0800C3B0.inc @@ -0,0 +1,7 @@ +SCRIPT_START script_0800C3B0 + SetEntitySpeed 0x0080 + _0807EEF4 0x0000, 0xff30 + _0807F0C8 0x0000, 0x0000 + Wait 0x00b4 + Call sub_08054968 +SCRIPT_END diff --git a/data/scripts/script_0800C3CC.inc b/data/scripts/script_0800C3CC.inc new file mode 100644 index 00000000..54d6aa9b --- /dev/null +++ b/data/scripts/script_0800C3CC.inc @@ -0,0 +1,14 @@ +SCRIPT_START script_0800C3CC + BeginBlock + Call sub_0806D660 + SetEntitySpeed 0x0080 + EndBlock + WaitForSomething2 0x00000002 + CallWithArg sub_0807F4F8, 0x00000048 + Call sub_0806D66C + Wait 0x000f + CallWithArg sub_0807F4F8, 0x00000068 + Call sub_0806D67C + _0807F0C8 0x001e, 0x0000 + SoundReq 0x010b +SCRIPT_END diff --git a/data/scripts/script_0800C410.inc b/data/scripts/script_0800C410.inc new file mode 100644 index 00000000..4e3767b4 --- /dev/null +++ b/data/scripts/script_0800C410.inc @@ -0,0 +1,16 @@ +SCRIPT_START script_0800C410 + BeginBlock + Call sub_0806D660 + SetEntitySpeed 0x0080 + EndBlock + WaitForSomething2 0x00000004 + CallWithArg sub_0807F4F8, 0x00000048 + Call sub_0806D66C + Wait 0x000f + CallWithArg sub_0807F4F8, 0x00000068 + Call sub_0806D67C + _0807F0C8 0x001e, 0x0000 + SoundReq 0x010b + _0807E5F8 0x00000001 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800C45C.inc b/data/scripts/script_0800C45C.inc new file mode 100644 index 00000000..5c8767cc --- /dev/null +++ b/data/scripts/script_0800C45C.inc @@ -0,0 +1,18 @@ +SCRIPT_START script_0800C45C + BeginBlock + SetEntitySpeed 0x0180 + _0807E930 0x0004 + Call sub_080A0B28 + EndBlock + Wait 0x000a + DoPostScriptAction 0x0007 + SoundReq 0x0136 +script_0800C47A: + _0807EE30 + JumpIfNot script_0800C47A + Wait 0x003c + SetRoomFlag 0x00ff + _0807E930 0x0005 + Wait 0x000f +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800C494.inc b/data/scripts/script_0800C494.inc new file mode 100644 index 00000000..f35af231 --- /dev/null +++ b/data/scripts/script_0800C494.inc @@ -0,0 +1,17 @@ +SCRIPT_START script_0800C494 + BeginBlock + SetEntitySpeed 0x0120 + _0807E930 0x0004 + EndBlock + Wait 0x000a + DoPostScriptAction 0x0007 + SoundReq 0x0136 + _0807EEF4 0x0000, 0xff90 + Wait 0x001e + _0807EEF4 0x0000, 0xffb0 + Wait 0x003c + SetRoomFlag 0x00ff + _0807E930 0x0005 + Wait 0x000f +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800C4D0.inc b/data/scripts/script_0800C4D0.inc new file mode 100644 index 00000000..6365aa7e --- /dev/null +++ b/data/scripts/script_0800C4D0.inc @@ -0,0 +1,17 @@ +SCRIPT_START script_0800C4D0 + BeginBlock + SetEntitySpeed 0x0180 + _0807E930 0x0004 + EndBlock + Wait 0x000a + DoPostScriptAction 0x0007 + SoundReq 0x0136 + _0807EEF4 0x00c0, 0x0000 + Wait 0x001e + _0807EEF4 0x0070, 0x0000 + Wait 0x003c + SetRoomFlag 0x00ff + _0807E930 0x0005 + Wait 0x000f +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800C50C.inc b/data/scripts/script_0800C50C.inc new file mode 100644 index 00000000..0c8bc2b1 --- /dev/null +++ b/data/scripts/script_0800C50C.inc @@ -0,0 +1,18 @@ +SCRIPT_START script_0800C50C + BeginBlock + SetEntitySpeed 0x0100 + _0807E930 0x0004 + DoPostScriptAction 0x0008 + EndBlock + WaitForSomething2 0x00000001 + Wait 0x000a + DoPostScriptAction 0x0007 + SoundReq 0x0136 + _0807EEF4 0x0000, 0x0060 + Wait 0x003c + _0807EEF4 0x0000, 0x0060 + Wait 0x001e + SetRoomFlag 0x00ff + _0807E930 0x0005 + Wait 0x000f +SCRIPT_END diff --git a/data/scripts/script_0800C550.inc b/data/scripts/script_0800C550.inc new file mode 100644 index 00000000..bcd1f208 --- /dev/null +++ b/data/scripts/script_0800C550.inc @@ -0,0 +1,269 @@ +SCRIPT_START script_0800C550 + BeginBlock + Call sub_08060090 + DoPostScriptAction 0x000a + EndBlock +script_0800C55E: + BeginBlock + CheckEntityInteractType + JumpIf script_0800C572 + Call sub_08060158 + EndBlock + Jump script_0800C55E +script_0800C572: + EndBlock + _0807E864 + Call sub_08060208 + _0807EA94 + _0807E878 + Jump script_0800C55E + BeginBlock + Call sub_08060090 + DoPostScriptAction 0x000a + EndBlock +script_0800C592: + BeginBlock + CheckEntityInteractType + JumpIf script_0800C5A6 + Call sub_08060158 + EndBlock + Jump script_0800C592 +script_0800C5A6: + EndBlock + _0807E864 + CheckInventory1 0x0067 + JumpIfNot script_0800C5BC + Call sub_08060208 + Jump script_0800C5C0 +script_0800C5BC: + TextboxNoOverlap 0x4710 +script_0800C5C0: + _0807EA94 + _0807E878 + Jump script_0800C592 + BeginBlock + Call sub_08060090 + DoPostScriptAction 0x000a + EndBlock +script_0800C5D6: + BeginBlock + CheckEntityInteractType + JumpIf script_0800C5EA + Call sub_08060158 + EndBlock + Jump script_0800C5D6 +script_0800C5EA: + EndBlock + _0807E864 + Call sub_08060270 + _0807EA94 + _0807E878 + Jump script_0800C5D6 + BeginBlock +script_0800C5FE: + Call sub_08060090 + DoPostScriptAction 0x000a + EndBlock +script_0800C60A: + BeginBlock + CheckEntityInteractType + JumpIf script_0800C61E + Call sub_08060158 + EndBlock + Jump script_0800C60A +script_0800C61E: + EndBlock + _0807E864 + Call sub_0806021C + _0807EA94 + Wait 0x000f + _0807E878 + Jump script_0800C60A + BeginBlock + DoPostScriptAction 0x000a + SetEntitySpeed 0x0080 + _0807EB44 0x0004 + CheckLocalFlag 0x0082 + JumpIfNot script_0800C650 + SetEntityPosition 0x0010, 0x0000 +script_0800C650: + EndBlock +script_0800C652: + _0807E944 + _0807E864 + Call sub_0807DF28 + CheckLocalFlag 0x0082 + JumpIf script_0800C684 + CheckPlayerInRegion 0x00e8, 0x0028, 0x1810 + JumpIfNot script_0800C674 + DoPostScriptAction 0x000b +script_0800C674: + StartPlayerScript script_0800C8C8 + WaitForSomething2 0x00000001 + DoPostScriptAction 0x000a +script_0800C684: + CheckInventory1 0x0040 + JumpIf script_0800C730 + CheckInventory1 0x005b + JumpIf script_0800C6B6 + DoPostScriptAction 0x0002 + TextboxNoOverlapFollow 0x1f16 + _0807EA94 + DoPostScriptAction 0x0015 + Wait 0x000a + SetLocalFlag 0x0080 + Call sub_0807DF50 + _0807E878 + Jump script_0800C652 +script_0800C6B6: + CheckLocalFlag 0x0081 + JumpIf script_0800C6DC + DoPostScriptAction 0x0002 + TextboxNoOverlapFollow 0x1f1b + _0807EA94 + DoPostScriptAction 0x0015 + Wait 0x000a + Call sub_0807DF50 + _0807E878 + Jump script_0800C652 +script_0800C6DC: + CheckLocalFlag 0x0082 + JumpIf script_0800C712 + DoPostScriptAction 0x0002 + TextboxNoOverlapFollow 0x1f17 + _0807EA94 + DoPostScriptAction 0x0015 + Wait 0x000a + _0807EB44 0x0002 + DoPostScriptAction 0x0001 + _0807EC94 0x0020 + _0807EB44 0x0004 + Wait 0x000f + SoundReq 0x0072 + SetLocalFlag 0x0082 +script_0800C712: + DoPostScriptAction 0x0002 + TextboxNoOverlapFollow 0x1f18 + _0807EA94 + DoPostScriptAction 0x0015 + Wait 0x000a + Call sub_0807DF50 + _0807E878 + Jump script_0800C652 +script_0800C730: + CheckLocalFlag 0x0083 + JumpIf script_0800C756 + DoPostScriptAction 0x0002 + TextboxNoOverlapFollow 0x1f19 + _0807EA94 + DoPostScriptAction 0x0015 + Wait 0x000a + Call sub_0807DF50 + _0807E878 + Jump script_0800C652 +script_0800C756: + DoPostScriptAction 0x0002 + TextboxNoOverlapFollow 0x1f1a + _0807EA94 + DoPostScriptAction 0x0015 + Wait 0x000a + Call sub_0807DF50 + _0807E878 + Jump script_0800C652 + BeginBlock + DoPostScriptAction 0x000a + _0807EB44 0x0004 + EndBlock +script_0800C780: + _0807E944 + _0807E864 + Call sub_0807DF28 + StartPlayerScript script_0800C8F0 + WaitForSomething2 0x00000001 + CheckInventory1 0x0040 + JumpIf script_0800C824 + CheckInventory1 0x005b + JumpIf script_0800C7C0 + _0807E930 0x0008 + TextboxNoOverlapFollow 0x2122 + _0807EA94 + DoPostScriptAction 0x0000 + Call sub_0807DF50 + _0807E878 + Jump script_0800C780 +script_0800C7C0: + _0807E930 0x0008 + CheckLocalFlag 0x0081 + JumpIf script_0800C80A + TextboxNoOverlapFollow 0x1130 + _0807EA94 + _0807EB28 0x1131 + _0807EA94 + _0807EB8C + TextboxNoOverlapFollow 0x1132 + _0807EA94 + SetIntVariable 0x00000103 + Call sub_0807F420 + TextboxNoOverlapFollow 0x1133 + _0807EA94 + Wait 0x000a + DoPostScriptAction 0x0000 + SetLocalFlag 0x0081 + Call sub_0807DF50 + _0807E878 + Jump script_0800C780 +script_0800C80A: + TextboxNoOverlapFollow 0x1133 + _0807EA94 + Wait 0x000a + _0807E930 0x0000 + Call sub_0807DF50 + _0807E878 + Jump script_0800C780 +script_0800C824: + _0807E930 0x0008 + CheckLocalFlag 0x0083 + JumpIf script_0800C8AE + TextboxNoOverlapFollow 0x1135 + _0807EA94 + SetEntitySpeed 0x0040 + _0807EDD4 0x0038, 0x0044 + DoPostScriptAction 0x0000 + Wait 0x000f + SetLocalFlag 0x0083 + Wait 0x003c + SoundReq 0x0072 + Wait 0x003c + _0807EB74 + _0807EB8C + TextboxNoOverlapFollow 0x1136 + _0807EA94 + _0807EB28 0x1137 + _0807EA94 + Wait 0x000a + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + Call sub_0807DF50 + _0807E878 +script_0800C87C: + _0807E944 + _0807E864 + Call sub_0807DF28 + _0807EB74 + SetIntVariable 0x00000008 + Call sub_0807F3D8 + TextboxNoOverlapFollow 0x1136 + _0807EA94 + Wait 0x000a + DoPostScriptAction 0x0000 + Call sub_0807DF50 + _0807E878 + Jump script_0800C87C +script_0800C8AE: + TextboxNoOverlapFollow 0x1136 + _0807EA94 + Wait 0x000a + DoPostScriptAction 0x0000 + Call sub_0807DF50 + _0807E878 + Jump script_0800C780 diff --git a/data/scripts/script_0800C8C8.inc b/data/scripts/script_0800C8C8.inc new file mode 100644 index 00000000..b5a97320 --- /dev/null +++ b/data/scripts/script_0800C8C8.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_0800C8C8 + BeginBlock + SetEntitySpeed 0x0100 + EndBlock + _0807EDD4 0x00e8, 0x0068 + _0807EB44 0x0000 + Wait 0x000f + DoPostScriptAction 0x0000 + _0807E5F8 0x00000001 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_0800C8F0.inc b/data/scripts/script_0800C8F0.inc new file mode 100644 index 00000000..4cfdb12b --- /dev/null +++ b/data/scripts/script_0800C8F0.inc @@ -0,0 +1,12 @@ +SCRIPT_START script_0800C8F0 + BeginBlock + SetEntitySpeed 0x0100 + EndBlock + _0807ECC4 0x0010 + _0807EDD4 0x0078, 0x0058 + _0807EB44 0x0000 + Wait 0x000f + DoPostScriptAction 0x0000 + _0807E5F8 0x00000001 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_0800C91C.inc b/data/scripts/script_0800C91C.inc new file mode 100644 index 00000000..3c5d833e --- /dev/null +++ b/data/scripts/script_0800C91C.inc @@ -0,0 +1,82 @@ +SCRIPT_START script_0800C91C + BeginBlock + _0807EB44 0x0004 + SetEntitySpeed 0x0300 + EndBlock +script_0800C928: + CheckPlayerInRegion 0x0208, 0x0360, 0x2040 + JumpIfNot script_0800C928 + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 + StartPlayerScript script_0800CA8C + WaitForSomething2 0x00000002 + Wait 0x003c + _0807EB28 0x1125 + _0807EA94 + _0807E5F8 0x00000800 + _0807E8E4_3 + Wait 0x003c + _0807E5F8 0x00000200 + _0807E8E4_0 + Wait 0x001e + _0807E5F8 0x00002000 + _0807E8E4_1 + Wait 0x0014 + _0807E5F8 0x00020000 + _0807E8E4_1 + Wait 0x000a + _0807E5F8 0x00008000 + _0807E8E4_3 + Wait 0x001e + WaitForSomething2 0x00000400 + WaitForSomething2 0x00001000 + WaitForSomething2 0x00004000 + WaitForSomething2 0x00010000 + WaitForSomething2 0x00040000 + _0807E8E4_0 + Wait 0x003c + _0807E5F8 0x00000200 + WaitForSomething2 0x00000400 + _0807E8E4_0 + TextboxNoOverlapFollow 0x1126 + Call sub_0807F40C + _0807EA94 + _0807E5F8 0x00000200 + _0807E5F8 0x00000800 + _0807E5F8 0x00002000 + _0807E5F8 0x00008000 + _0807E5F8 0x00020000 + WaitForSomething2 0x00000400 + WaitForSomething2 0x00001000 + WaitForSomething2 0x00004000 + WaitForSomething2 0x00010000 + WaitForSomething2 0x00040000 + _0807E5F8 0x00008000 + WaitForSomething2 0x00010000 + _0807E8E4_3 + TextboxNoOverlapFollow 0x1127 + _0807EA94 + _0807E5F8 0x00002000 + WaitForSomething2 0x00004000 + _0807E8E4_1 + TextboxNoOverlapFollow 0x1128 + _0807EA94 + _0807E5F8 0x00000200 + _0807E5F8 0x00000800 + _0807E5F8 0x00002000 + _0807E5F8 0x00008000 + _0807E5F8 0x00020000 + WaitForSomething2 0x00000400 + WaitForSomething2 0x00001000 + WaitForSomething2 0x00004000 + WaitForSomething2 0x00010000 + WaitForSomething2 0x00040000 + _0807E8E4_0 + _0807EB28 0x1129 + _0807EA94 + SetLocalFlag 0x008d + Call sub_0807DF50 + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_0800CA8C.inc b/data/scripts/script_0800CA8C.inc new file mode 100644 index 00000000..bccf4699 --- /dev/null +++ b/data/scripts/script_0800CA8C.inc @@ -0,0 +1,13 @@ +SCRIPT_START script_0800CA8C + BeginBlock + SetEntitySpeed 0x0100 + EndBlock + DoPostScriptAction 0x0001 + _0807EDD4 0x0208, 0x0358 + SetEntitySpeed 0x0080 + _0807EDD4 0x0208, 0x0340 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000002 + Call sub_080791BC +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800CABC.inc b/data/scripts/script_0800CABC.inc new file mode 100644 index 00000000..0387d84e --- /dev/null +++ b/data/scripts/script_0800CABC.inc @@ -0,0 +1,34 @@ +SCRIPT_START script_0800CABC + BeginBlock + DoPostScriptAction 0x0000 + DoPostScriptAction 0x0008 + SetEntitySpeed 0x0100 + DoPostScriptAction 0x000f + Call sub_0807F338 + EndBlock + WaitForSomething2 0x00000200 + DoPostScriptAction 0x0007 + _0807EDD4 0x0208, 0x0308 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000400 + WaitForSomething2 0x00000200 + SoundReq 0x007c + _0807EF3C 0x0180, 0x0030 + SoundReq 0x007c + _0807EF3C 0x0180, 0x0030 + _0807E5F8 0x00000400 + WaitForSomething2 0x00000200 + SetEntitySpeed 0x0200 + DoPostScriptAction 0x000f + _0807EDD4 0x0208, 0x0328 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000400 + WaitForSomething2 0x00000200 + SetEntitySpeed 0x0300 + DoPostScriptAction 0x000f + _0807EDD4 0x0208, 0x02b0 + _0807E5F8 0x00000400 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800CB54.inc b/data/scripts/script_0800CB54.inc new file mode 100644 index 00000000..b94d1c74 --- /dev/null +++ b/data/scripts/script_0800CB54.inc @@ -0,0 +1,30 @@ +SCRIPT_START script_0800CB54 + BeginBlock + DoPostScriptAction 0x0000 + DoPostScriptAction 0x0008 + SetEntitySpeed 0x0100 + DoPostScriptAction 0x000f + Call sub_0807F338 + EndBlock + WaitForSomething2 0x00000800 + DoPostScriptAction 0x0007 + _0807EB44 0x0002 + DoPostScriptAction 0x0001 + _0807EDD4 0x01a8, 0x0330 + _0807EB44 0x0002 + DoPostScriptAction 0x0000 + _0807E5F8 0x00001000 + WaitForSomething2 0x00000800 + SetEntitySpeed 0x0200 + DoPostScriptAction 0x000f + _0807EDD4 0x01f8, 0x0348 + DoPostScriptAction 0x0000 + _0807E5F8 0x00001000 + WaitForSomething2 0x00000800 + SetEntitySpeed 0x0300 + DoPostScriptAction 0x000f + _0807EDD4 0x0178, 0x0328 + _0807E5F8 0x00001000 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800CBD4.inc b/data/scripts/script_0800CBD4.inc new file mode 100644 index 00000000..1ba664af --- /dev/null +++ b/data/scripts/script_0800CBD4.inc @@ -0,0 +1,34 @@ +SCRIPT_START script_0800CBD4 + BeginBlock + DoPostScriptAction 0x0000 + DoPostScriptAction 0x0008 + SetEntitySpeed 0x0100 + DoPostScriptAction 0x000f + Call sub_0807F338 + EndBlock + WaitForSomething2 0x00002000 + DoPostScriptAction 0x0007 + _0807EDD4 0x0258, 0x0330 + _0807EB44 0x0006 + DoPostScriptAction 0x0000 + _0807E5F8 0x00004000 + WaitForSomething2 0x00002000 + SetEntitySpeed 0x0200 + DoPostScriptAction 0x000f + _0807EDD4 0x0218, 0x0340 + DoPostScriptAction 0x0000 + _0807E5F8 0x00004000 + WaitForSomething2 0x00002000 + SoundReq 0x007c + _0807EF3C 0x0180, 0x0030 + SoundReq 0x007c + _0807EF3C 0x0180, 0x0030 + _0807E5F8 0x00004000 + WaitForSomething2 0x00002000 + SetEntitySpeed 0x0300 + DoPostScriptAction 0x000f + _0807EDD4 0x0288, 0x02d8 + _0807E5F8 0x00004000 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800CC6C.inc b/data/scripts/script_0800CC6C.inc new file mode 100644 index 00000000..81dde4c6 --- /dev/null +++ b/data/scripts/script_0800CC6C.inc @@ -0,0 +1,34 @@ +SCRIPT_START script_0800CC6C + BeginBlock + DoPostScriptAction 0x0008 + DoPostScriptAction 0x0000 + SetEntitySpeed 0x0100 + DoPostScriptAction 0x000f + Call sub_0807F338 + EndBlock + WaitForSomething2 0x00008000 + DoPostScriptAction 0x0007 + _0807EDD4 0x01b8, 0x0320 + _0807EB44 0x0002 + DoPostScriptAction 0x0000 + _0807E5F8 0x00010000 + WaitForSomething2 0x00008000 + SetEntitySpeed 0x0200 + DoPostScriptAction 0x000f + _0807EDD4 0x01f8, 0x0330 + DoPostScriptAction 0x0000 + _0807E5F8 0x00010000 + WaitForSomething2 0x00008000 + SoundReq 0x007c + _0807EF3C 0x0180, 0x0030 + SoundReq 0x007c + _0807EF3C 0x0180, 0x0030 + _0807E5F8 0x00010000 + WaitForSomething2 0x00008000 + SetEntitySpeed 0x0300 + DoPostScriptAction 0x000f + _0807EDD4 0x0188, 0x02d8 + _0807E5F8 0x00010000 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800CD04.inc b/data/scripts/script_0800CD04.inc new file mode 100644 index 00000000..78b981d4 --- /dev/null +++ b/data/scripts/script_0800CD04.inc @@ -0,0 +1,28 @@ +SCRIPT_START script_0800CD04 + BeginBlock + DoPostScriptAction 0x0000 + DoPostScriptAction 0x0008 + SetEntitySpeed 0x0100 + DoPostScriptAction 0x000f + Call sub_0807F338 + EndBlock + WaitForSomething2 0x00020000 + DoPostScriptAction 0x0007 + _0807EDD4 0x0268, 0x0338 + _0807EB44 0x0006 + DoPostScriptAction 0x0000 + _0807E5F8 0x00040000 + WaitForSomething2 0x00020000 + SetEntitySpeed 0x0200 + DoPostScriptAction 0x000f + _0807EDD4 0x0218, 0x0350 + DoPostScriptAction 0x0000 + _0807E5F8 0x00040000 + WaitForSomething2 0x00020000 + SetEntitySpeed 0x0300 + DoPostScriptAction 0x000f + _0807EDD4 0x02a8, 0x0328 + _0807E5F8 0x00040000 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800CD7C.inc b/data/scripts/script_0800CD7C.inc new file mode 100644 index 00000000..bac529fa --- /dev/null +++ b/data/scripts/script_0800CD7C.inc @@ -0,0 +1,293 @@ +SCRIPT_START script_0800CD7C + BeginBlock + CheckInventory1 0x005b + JumpIfNot script_0800C5FE + Call sub_08060090 + DoPostScriptAction 0x000a + EndBlock +script_0800CD92: + EndBlock + BeginBlock + CheckEntityInteractType + JumpIf script_0800CDA6 + Call sub_08060158 + Jump script_0800CD92 +script_0800CDA6: + EndBlock + _0807E864 + Call sub_0807DF28 + CheckLocalFlag 0x009d + JumpIf script_0800CDC4 + SetLocalFlag 0x009d + TextboxNoOverlap 0x213d + Jump script_0800CF40 +script_0800CDC4: + CheckGlobalFlag 0x003b + JumpIf script_0800CE46 + CheckGlobalFlag 0x0054 + JumpIfNot script_0800CDEC + CheckRoomFlag 0x0000 + JumpIfNot script_0800CF2A + SetGlobalFlag 0x003b + ClearGlobalFlag 0x0054 + TextboxNoOverlap 0x2141 + Jump script_0800CF40 +script_0800CDEC: + TextboxNoOverlap 0x213e + _0807EA94 + _0807E48C 0x0023 + JumpIfNot script_0800CE14 + TextboxNoOverlap 0x214b + _0807EA94 + _0807E3E8 + JumpIfNot script_0800CF40 + SoundReq 0x00cd + _0807F088 0x0023 + WaitPlayerAction8 + Jump script_0800CE32 +script_0800CE14: + _0807E48C 0x0022 + JumpIfNot script_0800CF40 + TextboxNoOverlap 0x214b + _0807EA94 + _0807E3E8 + JumpIfNot script_0800CF40 + SoundReq 0x00cd + _0807F088 0x0022 + WaitPlayerAction8 +script_0800CE32: + _0807EB8C + SetGlobalFlag 0x0054 + Call sub_08060340 + TextboxNoOverlap 0x213f + Jump script_0800CF02 +script_0800CE46: + CheckGlobalFlag 0x003c + JumpIf script_0800CEA6 + CheckGlobalFlag 0x0054 + JumpIfNot script_0800CE6E + CheckRoomFlag 0x0000 + JumpIfNot script_0800CF2A + SetGlobalFlag 0x003c + ClearGlobalFlag 0x0054 + TextboxNoOverlap 0x2145 + Jump script_0800CF40 +script_0800CE6E: + TextboxNoOverlap 0x2142 + _0807EA94 + _0807E48C 0x0027 + JumpIfNot script_0800CF40 + TextboxNoOverlap 0x214c + _0807EA94 + _0807E3E8 + JumpIfNot script_0800CF40 + SoundReq 0x00cd + _0807F088 0x0027 + WaitPlayerAction8 + _0807EB8C + SetGlobalFlag 0x0054 + Call sub_08060340 + TextboxNoOverlap 0x2143 + Jump script_0800CF02 +script_0800CEA6: + CheckGlobalFlag 0x003d + JumpIf script_0800CF3C + CheckGlobalFlag 0x0054 + JumpIfNot script_0800CECE + CheckRoomFlag 0x0000 + JumpIfNot script_0800CF2A + SetGlobalFlag 0x003d + ClearGlobalFlag 0x0054 + TextboxNoOverlap 0x2149 + Jump script_0800CF40 +script_0800CECE: + TextboxNoOverlap 0x2146 + _0807EA94 + _0807E48C 0x0024 + JumpIfNot script_0800CF40 + TextboxNoOverlap 0x214d + _0807EA94 + _0807E3E8 + JumpIfNot script_0800CF40 + SoundReq 0x00cd + _0807F088 0x0024 + WaitPlayerAction8 + _0807EB8C + SetGlobalFlag 0x0054 + Call sub_08060340 + TextboxNoOverlap 0x2147 +script_0800CF02: + _0807EA94 + Call sub_0807DF50 + _0807E878 +script_0800CF0C: + EndBlock + BeginBlock + CheckEntityInteractType + JumpIf script_0800CF20 + Call sub_08060158 + Jump script_0800CF0C +script_0800CF20: + EndBlock + _0807E864 + Call sub_0807DF28 +script_0800CF2A: + TextboxNoOverlap 0x2140 + _0807EA94 + Call sub_0807DF50 + _0807E878 + Jump script_0800CF0C +script_0800CF3C: + TextboxNoOverlap 0x214a +script_0800CF40: + _0807EA94 + Call sub_0807DF50 + _0807E878 + Jump script_0800CD92 + .2byte 0x0000 + BeginBlock + Call sub_08068104 + DoPostScriptAction 0x000a + EndBlock +script_0800CF5E: + BeginBlock + CheckEntityInteractType + JumpIf script_0800CF72 + Call sub_0806811C + EndBlock + Jump script_0800CF5E +script_0800CF72: + EndBlock + _0807E864 + Call sub_08068190 + _0807EA94 + Wait 0x000f + _0807E878 + Jump script_0800CF5E + BeginBlock + Call sub_08068104 + DoPostScriptAction 0x000a + EndBlock +script_0800CF96: + _0807E944 + _0807E864 + Call sub_08068190 + _0807EA94 + Wait 0x000f + _0807E878 + Jump script_0800CF96 + BeginBlock + _0807E9D4 + DoPostScriptAction 0x000a + _0807EB44 0x0004 + _0807E930 0x0000 + EndBlock + CheckInventory1 0x0041 + JumpIf script_0800CFD2 + CheckLocalFlag 0x007e + JumpIfNot script_0800CFD2 + _0807E930 0x0008 +script_0800CFD2: + CheckInventory1 0x0002 + JumpIf script_0800CFFA + CheckInventory1 0x0041 + JumpIfNot script_0800CFEC + _0807E5F8 0x00000020 + Jump script_0800CFFA +script_0800CFEC: + CheckLocalFlag 0x007e + JumpIfNot script_0800CFFA + _0807E5F8 0x00000010 +script_0800CFFA: + EndBlock + BeginBlock + Call sub_08068910 + CheckEntityInteractType + JumpIfNot script_0800CFFA + EndBlock + _0807E864 + Call sub_0807DF28 + CheckInventory1 0x0002 + JumpIfNot script_0800D032 + _0807EB74 + SetIntVariable 0x00000000 + Call sub_0806C028 + TextboxNoOverlap 0x1219 + Jump script_0800D17C +script_0800D032: + CheckInventory1 0x0041 + JumpIfNot script_0800D098 + StartPlayerScript script_0800D190 + WaitForSomething2 0x00000008 + _0807EB74 + SetIntVariable 0x00000000 + Call sub_0806C028 + TextboxNoOverlapFollowPos 0x125c, 0x0002 + _0807EA94 + StartPlayerScript script_0800D1B4 + WaitForSomething2 0x00000008 + _0807EB44 0x0002 + SetIntVariable 0x00000000 + Call sub_0806C028 + Wait 0x000f + _0807E5F8 0x00000020 + StartPlayerScript script_0800D1E0 + WaitForSomething2 0x00000008 + TextboxNoOverlapFollowPos 0x125d, 0x0002 + Jump script_0800D17C +script_0800D098: + CheckLocalFlag 0x007e + JumpIfNot script_0800D0A8 + TextboxNoOverlapFollow 0x123e + Jump script_0800D17C +script_0800D0A8: + StartPlayerScript script_0800D190 + WaitForSomething2 0x00000008 + _0807E5F8 0x00000001 + WaitForSomething2 0x00000004 + _0807E5F8 0x00000001 + WaitForSomething2 0x00000004 + _0807EB74 + SetIntVariable 0x00000000 + Call sub_0806C028 + TextboxNoOverlapFollowPos 0x123d, 0x0002 + _0807EA94 + StartPlayerScript script_0800D1B4 + WaitForSomething2 0x00000008 + _0807EB44 0x0002 + SetIntVariable 0x00000000 + Call sub_0806C028 + SoundReq 0x00cd + Call sub_08068964 +script_0800D108: + ComparePlayerAction 0x0008 + JumpIf script_0800D108 + SoundReq 0x00f8 + _0807E5F8 0x00000010 + SetLocalFlag 0x007e + TextboxNoOverlapFollowPos 0x123e, 0x0002 + _0807EA94 + Wait 0x000f + _0807E930 0x0009 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000004 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000004 + Wait 0x001e + TextboxNoOverlapFollowPos 0x123f, 0x0002 + _0807EA94 + _0807E5F8 0x00000001 + WaitForSomething2 0x00000004 + _0807E5F8 0x00000001 + WaitForSomething2 0x00000004 + _0807E930 0x0008 + Wait 0x003c + Call sub_08095164 + _0807EB28 0x1240 +script_0800D17C: + _0807EA94 + Wait 0x000f + _0807E878 + Call sub_0807DF50 + Jump script_0800CFFA + .2byte 0x0000 diff --git a/data/scripts/script_0800D190.inc b/data/scripts/script_0800D190.inc new file mode 100644 index 00000000..e280400d --- /dev/null +++ b/data/scripts/script_0800D190.inc @@ -0,0 +1,10 @@ +SCRIPT_START script_0800D190 + BeginBlock + SetEntitySpeed 0x0100 + EndBlock + _0807EDD4 0x0170, 0x0140 + _0807EB44 0x0002 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000008 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_0800D1B4.inc b/data/scripts/script_0800D1B4.inc new file mode 100644 index 00000000..4a7bb3c8 --- /dev/null +++ b/data/scripts/script_0800D1B4.inc @@ -0,0 +1,12 @@ +SCRIPT_START script_0800D1B4 + BeginBlock + SetEntitySpeed 0x0100 + EndBlock + _0807EDD4 0x0170, 0x0120 + _0807EDD4 0x01a8, 0x0120 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000008 + Call sub_080791BC +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800D1E0.inc b/data/scripts/script_0800D1E0.inc new file mode 100644 index 00000000..2ff93e40 --- /dev/null +++ b/data/scripts/script_0800D1E0.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_0800D1E0 + _0807F078 0x0002, 0x0001 + CallWithArg sub_0807F918, 0x00000002 + SoundReq 0x0109 + CallWithArg sub_0807F238, 0x000001e2 + Call sub_0807F304 + TextboxNoOverlap 0x0502 + _0807EA94 + _0807E5F8 0x00000008 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_0800D218.inc b/data/scripts/script_0800D218.inc new file mode 100644 index 00000000..50f35779 --- /dev/null +++ b/data/scripts/script_0800D218.inc @@ -0,0 +1,12 @@ +SCRIPT_START script_0800D218 + BeginBlock + CheckInventory1 0x0041 + JumpIf script_0800D24C + CheckLocalFlag 0x007e + JumpIf script_0800D242 + DoPostScriptAction 0x0008 + EndBlock + WaitForSomething2 0x00000010 + DoPostScriptAction 0x0007 + WaitForSomething2 0x00000010 +SCRIPT_END diff --git a/data/scripts/script_0800D242.inc b/data/scripts/script_0800D242.inc new file mode 100644 index 00000000..c441c743 --- /dev/null +++ b/data/scripts/script_0800D242.inc @@ -0,0 +1,4 @@ +SCRIPT_START script_0800D242 + DoPostScriptAction 0x0007 + _0807E930 0x0003 +SCRIPT_END diff --git a/data/scripts/script_0800D24C.inc b/data/scripts/script_0800D24C.inc new file mode 100644 index 00000000..f56e72d8 --- /dev/null +++ b/data/scripts/script_0800D24C.inc @@ -0,0 +1,4 @@ +SCRIPT_START script_0800D24C + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800D254.inc b/data/scripts/script_0800D254.inc new file mode 100644 index 00000000..27de55ab --- /dev/null +++ b/data/scripts/script_0800D254.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_0800D254 + BeginBlock + DoPostScriptAction 0x0008 + EndBlock + WaitForSomething2 0x00000020 + DoPostScriptAction 0x0007 + WaitForSomething2 0x00000020 + DoPostScriptAction 0x0008 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800D278.inc b/data/scripts/script_0800D278.inc new file mode 100644 index 00000000..16ef4204 --- /dev/null +++ b/data/scripts/script_0800D278.inc @@ -0,0 +1,111 @@ +SCRIPT_START script_0800D278 + BeginBlock + _0807E9D4 + DoPostScriptAction 0x000a + EndBlock +script_0800D282: + CheckInventory1 0x0041 + JumpIf script_0800D292 + CheckLocalFlag 0x007e + JumpIf script_0800D2EA +script_0800D292: + BeginBlock + TestBit 0x00000001 + JumpIf script_0800D2C6 + CheckEntityInteractType + JumpIf script_0800D2B0 + Call sub_0806811C + EndBlock + Jump script_0800D282 +script_0800D2B0: + EndBlock + _0807E864 + Call sub_08068190 + _0807EA94 + Wait 0x000f + _0807E878 + Jump script_0800D282 +script_0800D2C6: + EndBlock + _0807E5F8 0x00000004 + WaitForSomething2 0x00000002 + _0807E5F8 0x00000004 + _0807E930 0x000c + WaitForSomething2 0x00000001 + _0807E5F8 0x00000004 +script_0800D2EA: + _0807E930 0x000b +script_0800D2EE: + CheckEntityInteractType + JumpIfNot script_0800D2EE + _0807E864 + Call sub_08068190 + _0807EA94 + Wait 0x000f + _0807E878 + Jump script_0800D2EE + BeginBlock + Call sub_08068884 + DoPostScriptAction 0x000a + _0807EB44 0x0004 + _0807E930 0x0000 + EndBlock +script_0800D31E: + EndBlock + BeginBlock + Call sub_08068910 + CheckEntityInteractType + JumpIfNot script_0800D31E + EndBlock + _0807E864 + _0807EB74 + SetIntVariable 0x00000000 + Call sub_0806C028 + TextboxNoOverlapFollow 0x1219 + _0807EA94 + Wait 0x000f + _0807E878 + Jump script_0800D31E + BeginBlock + Call sub_08068104 + DoPostScriptAction 0x000a + EndBlock +script_0800D35E: + BeginBlock + CheckEntityInteractType + JumpIf script_0800D372 + Call sub_0806811C + EndBlock + Jump script_0800D35E +script_0800D372: + EndBlock + _0807E864 + Call sub_08068190 + _0807EA94 + Wait 0x000f + CheckLocalFlag 0x007f + JumpIf script_0800D3E4 + CheckLocalFlag 0x007e + JumpIfNot script_0800D3E4 + DoPostScriptAction 0x000b + SetEntitySpeed 0x0100 + CheckPlayerInRegion 0x0090, 0x0130, 0x0810 + JumpIfNot script_0800D3B2 + StartPlayerScript script_0800D3EC + WaitForSomething2 0x00000001 +script_0800D3B2: + _0807EB44 0x0002 + _0807E930 0x0005 + _0807EDD4 0x00a0, 0x0130 + _0807EB44 0x0006 + _0807E930 0x0003 + SetIntVariable 0x00000004 + Call sub_080681D8 + SoundReq 0x00cd + Wait 0x001e + DoPostScriptAction 0x000a + SetLocalFlag 0x007f +script_0800D3E4: + _0807E878 + Jump script_0800D35E + .2byte 0x0000 diff --git a/data/scripts/script_0800D3EC.inc b/data/scripts/script_0800D3EC.inc new file mode 100644 index 00000000..ed99e4a7 --- /dev/null +++ b/data/scripts/script_0800D3EC.inc @@ -0,0 +1,12 @@ +SCRIPT_START script_0800D3EC + BeginBlock + SetEntitySpeed 0x0080 + EndBlock + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + DoPostScriptAction 0x000d + _0807ECC4 0x0020 + _0807E5F8 0x00000001 + Call sub_080791BC +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800D414.inc b/data/scripts/script_0800D414.inc new file mode 100644 index 00000000..d1901242 --- /dev/null +++ b/data/scripts/script_0800D414.inc @@ -0,0 +1,161 @@ +SCRIPT_START script_0800D414 + BeginBlock + SetEntitySpeed 0x0100 + Call sub_08068104 + DoPostScriptAction 0x000a + EndBlock +script_0800D426: + _0807EB44 0x0002 + SetIntVariable 0x00000000 + Call sub_0806AF60 + Wait 0x0014 + _0807EB44 0x0004 + SetIntVariable 0x00000000 + Call sub_0806AF60 + Wait 0x0014 + _0807EB44 0x0006 + SetIntVariable 0x00000000 + Call sub_0806AF60 + Wait 0x0014 + _0807EB44 0x0006 + SetIntVariable 0x00000004 + Call sub_0806AF60 + _0807EDD4 0x00a8, 0x01e8 + _0807EB44 0x0006 + SetIntVariable 0x00000000 + Call sub_0806AF60 + Wait 0x0014 + _0807EB44 0x0004 + SetIntVariable 0x00000000 + Call sub_0806AF60 + Wait 0x0014 + _0807EB44 0x0002 + SetIntVariable 0x00000000 + Call sub_0806AF60 + Wait 0x0014 + _0807EB44 0x0002 + SetIntVariable 0x00000004 + Call sub_0806AF60 + _0807EDD4 0x0228, 0x01e8 + Jump script_0800D426 + .2byte 0x0000 + BeginBlock + DoPostScriptAction 0x000a + Call sub_08062A48 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 +script_0800D4E4: + EndBlock + Call sub_08062698 + Call sub_080626AC + CallWithArg sub_0807F0EC, 0x00000009 + JumpTable script_0800D510, script_0800D51A, script_0800D524, script_0800D52E, script_0800D538, script_0800D542, script_0800D54C, script_0800D556, script_0800D560 +script_0800D510: + _0807EE04 0x0038, 0x0068 + Jump script_0800D566 +script_0800D51A: + _0807EE04 0x0078, 0x0068 + Jump script_0800D566 +script_0800D524: + _0807EE04 0x00b8, 0x0068 + Jump script_0800D566 +script_0800D52E: + _0807EE04 0x0038, 0x0090 + Jump script_0800D566 +script_0800D538: + _0807EE04 0x0078, 0x0090 + Jump script_0800D566 +script_0800D542: + _0807EE04 0x00b8, 0x0090 + Jump script_0800D566 +script_0800D54C: + _0807EE04 0x0038, 0x00b8 + Jump script_0800D566 +script_0800D556: + _0807EE04 0x0078, 0x00b8 + Jump script_0800D566 +script_0800D560: + _0807EE04 0x00b8, 0x00b8 +script_0800D566: + EndBlock + BeginBlock + Call sub_080626C0 + JumpIf script_0800D4E4 + CheckEntityInteractType + JumpIf script_0800D584 + _0807EE30 + JumpIfNot script_0800D566 + Jump script_0800D4E4 +script_0800D584: + EndBlock + _0807E864 + _0807EB74 + Call sub_0806265C + _0807EA94 + Wait 0x000f + _0807E878 + Jump script_0800D4E4 + BeginBlock + DoPostScriptAction 0x000a + Call sub_08062A48 + DoPostScriptAction 0x0000 +script_0800D5AC: + EndBlock + Call sub_08062698 + Call sub_080626AC + CallWithArg sub_0807F0EC, 0x00000004 + JumpTable script_0800D5CE, script_0800D5D8, script_0800D5E2, script_0800D5EC +script_0800D5CE: + _0807EE04 0x0038, 0x0098 + Jump script_0800D5F2 +script_0800D5D8: + _0807EE04 0x0058, 0x0098 + Jump script_0800D5F2 +script_0800D5E2: + _0807EE04 0x0038, 0x00c8 + Jump script_0800D5F2 +script_0800D5EC: + _0807EE04 0x0058, 0x00c8 +script_0800D5F2: + EndBlock + BeginBlock + Call sub_080626C0 + JumpIf script_0800D5AC + _0807EE30 + JumpIfNot script_0800D5F2 + Jump script_0800D5AC + .2byte 0x0000 + BeginBlock + _0807EB44 0x0004 + DoPostScriptAction 0x000b + DoPostScriptAction 0x0008 + Call sub_0806DAAC + JumpIf script_0800D6AE + Call sub_0806DAD0 + CallWithArg sub_0806DA04, 0x00000002 + EndBlock +script_0800D636: + _0807EA4C + _0807E9F0 + Call sub_0806DAAC + JumpIf script_0800D650 + Call sub_0807DF50 + _0807E878 + Jump script_0800D636 +script_0800D650: + _0807E864 + Call sub_0807DF28 + Call sub_0807FBC4 + Call sub_0807FBA0 + SetEntitySpeed 0x0700 + _0807F0B4 0x0007 + CameraTargetEntity + _0807EDD4 0x01e8, 0x01b8 + Wait 0x003c + Call sub_0806DAE8 + Wait 0x0078 + Call sub_0806DB44 + JumpIfNot script_0800D698 + LoadRoomEntityList gUnk_080DD730 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_0800D698.inc b/data/scripts/script_0800D698.inc new file mode 100644 index 00000000..297e34b2 --- /dev/null +++ b/data/scripts/script_0800D698.inc @@ -0,0 +1,10 @@ +SCRIPT_START script_0800D698 + _0807EEB4 + _0807F0B4 0x0004 + CameraTargetPlayer + Call sub_0807FBCC + _0807E878 + Call sub_0807DF50 +script_0800D6AE: + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_0800D6B4.inc b/data/scripts/script_0800D6B4.inc new file mode 100644 index 00000000..5ecafb12 --- /dev/null +++ b/data/scripts/script_0800D6B4.inc @@ -0,0 +1,9 @@ +SCRIPT_START script_0800D6B4 + BeginBlock + DoPostScriptAction 0x0007 + DoPostScriptAction 0x0011 + Call sub_0807F158 + Call sub_0807F738 + EndBlock +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800D6D0.inc b/data/scripts/script_0800D6D0.inc new file mode 100644 index 00000000..40d9c3a4 --- /dev/null +++ b/data/scripts/script_0800D6D0.inc @@ -0,0 +1,13 @@ +SCRIPT_START script_0800D6D0 + BeginBlock + CheckLocalFlag 0x00f3 + JumpIf script_0800D6E8 + DoPostScriptAction 0x0008 + EndBlock +script_0800D6E0: + CheckLocalFlag 0x00f3 + JumpIfNot script_0800D6E0 +script_0800D6E8: + DoPostScriptAction 0x0007 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800D6F0.inc b/data/scripts/script_0800D6F0.inc new file mode 100644 index 00000000..fb84a2c7 --- /dev/null +++ b/data/scripts/script_0800D6F0.inc @@ -0,0 +1,12 @@ +SCRIPT_START script_0800D6F0 + BeginBlock + CheckLocalFlag 0x00f5 + JumpIf script_0800D6E8 + DoPostScriptAction 0x0008 + EndBlock +script_0800D700: + CheckLocalFlag 0x00f5 + JumpIfNot script_0800D700 + DoPostScriptAction 0x0007 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800D710.inc b/data/scripts/script_0800D710.inc new file mode 100644 index 00000000..b2ce1c33 --- /dev/null +++ b/data/scripts/script_0800D710.inc @@ -0,0 +1,23 @@ +SCRIPT_START script_0800D710 + BeginBlock + Call sub_0807F360 + SetEntitySpeed 0x0700 + _0807F0B4 0x0007 + CameraTargetEntity + Call sub_0807FBC4 + EndBlock + _0807E5F8 0x00000008 + WaitForSomething2 0x00000010 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000004 + _0807E5F8 0x0000000a + WaitForSomething2 0x00000004 + _0807EEB4 + _0807F0B4 0x0004 + CameraTargetPlayer + Call sub_0807FBCC + _0807E878 + Call sub_0807DF50 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800D76C.inc b/data/scripts/script_0800D76C.inc new file mode 100644 index 00000000..e81cc3d9 --- /dev/null +++ b/data/scripts/script_0800D76C.inc @@ -0,0 +1,50 @@ +SCRIPT_START script_0800D76C + BeginBlock + Call sub_0807F360 + DoPostScriptAction 0x000b + SetEntitySpeed 0x0200 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + EndBlock + WaitForSomething2 0x00000008 + DoPostScriptAction 0x0004 + Wait 0x003c + SoundReq 0x0123 + CallWithArg sub_0807F464, 0x000001e0 + _0807EDD4 0x01e0, 0x01d8 + _0807EB44 0x0002 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000010 + SoundReq 0x007c + _0807EF3C 0x0180, 0x0030 + SoundReq 0x007c + _0807EF3C 0x0180, 0x0030 + _0807EB44 0x0002 + DoPostScriptAction 0x0001 + WaitForSomething2 0x00000008 + Jump script_0800D80C + BeginBlock + Call sub_0807F360 + DoPostScriptAction 0x000b + SetEntityPositionRelative 0x0268, 0x01d8 + SetEntitySpeed 0x0100 + EndBlock + WaitForSomething2 0x00000002 + _0807EDD4 0x01f0, 0x01d8 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000002 +script_0800D80C: + SetEntitySpeed 0x0100 + _0807EEF4 0x0000, 0xffe0 + DoPostScriptAction 0x000e + Call sub_0806CA5C + SetEntity0x20 0x00040000 + SoundReq 0x00f5 +script_0800D82A: + CallWithArg sub_0807F8D0, 0xffffe000 + Call sub_0807F8BC + JumpIf script_0800D82A + _0807E5F8 0x00000004 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800D84C.inc b/data/scripts/script_0800D84C.inc new file mode 100644 index 00000000..8b2968e9 --- /dev/null +++ b/data/scripts/script_0800D84C.inc @@ -0,0 +1,14 @@ +SCRIPT_START script_0800D84C + BeginBlock + EndBlock +script_0800D850: + CheckRoomFlag 0x0000 + JumpIfNot script_0800D850 + _0807E864 + Call sub_0807DF28 + Wait 0x003c + Call sub_0807DF50 + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800D874.inc b/data/scripts/script_0800D874.inc new file mode 100644 index 00000000..f16e938f --- /dev/null +++ b/data/scripts/script_0800D874.inc @@ -0,0 +1,55 @@ +SCRIPT_START script_0800D874 + BeginBlock + Call sub_0807F934 + DoPostScriptAction 0x0008 + SetIntVariable 0x00000001 + Call sub_0806DA04 + EndBlock +script_0800D88E: + CheckEntityInteractType + JumpIfNot script_0800D88E + _0807E864 + Call sub_0807DF28 + CheckLocalFlag 0x0045 + JumpIf script_0800D8B0 + StartPlayerScript script_0800D92C + WaitForSomething2 0x00000001 +script_0800D8B0: + _0807E8E4_0 + TextboxNoOverlap 0x1324 + _0807EA94 + CheckInventory1 0x0017 + JumpIf script_0800D8D6 + CheckLocalFlag 0x0045 + JumpIf script_0800D8D6 + LoadRoomEntityList gUnk_080E3830 +script_0800D8CE: + CheckLocalFlag 0x0045 + JumpIfNot script_0800D8CE +script_0800D8D6: + Call sub_0807DF50 + _0807E878 + Jump script_0800D88E + .2byte 0x0000 + BeginBlock + DoPostScriptAction 0x0008 + CheckInventory1 0x0017 + JumpIf script_0800D924 + EndBlock +script_0800D8F4: + CheckInventory1 0x0017 + JumpIfNot script_0800D8F4 + Call sub_0807DF28 + _0807E864 + WaitPlayerAction8 + _0807EB28 0x1325 + _0807EA94 + SoundReq 0x0113 + SetIntVariable 0x00000000 + Call sub_0806DA1C + _0807E878 + Call sub_0807DF50 +script_0800D924: + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800D92C.inc b/data/scripts/script_0800D92C.inc new file mode 100644 index 00000000..2ad1c0b1 --- /dev/null +++ b/data/scripts/script_0800D92C.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_0800D92C + BeginBlock + SetEntitySpeed 0x0080 + EndBlock + DoPostScriptAction 0x0001 + _0807EDD4 0x00a0, 0x0078 + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000001 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_0800D954.inc b/data/scripts/script_0800D954.inc new file mode 100644 index 00000000..b745268a --- /dev/null +++ b/data/scripts/script_0800D954.inc @@ -0,0 +1,42 @@ +SCRIPT_START script_0800D954 + BeginBlock + DoPostScriptAction 0x0008 + Call sub_0807F180 + EndBlock +script_0800D962: + CheckPlayerInRegion 0x0118, 0x0038, 0x3050 + JumpIfNot script_0800D962 + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 + StartPlayerScript script_0800DA00 + WaitForSomething2 0x00000001 + Wait 0x003c + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + DoPostScriptAction 0x0007 + SoundReq 0x01ce + SetEntity0x20 0xffff8000 + TextboxNoOverlap 0x1701 + _0807EA94 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000002 + TextboxNoOverlap 0x1702 + _0807EA94 + SetEntity0x20 0x00010000 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000002 + _0807F050 0x006d + WaitPlayerAction8 + _0807EB28 0x1703 + _0807EA94 + Wait 0x003c + SetLocalFlag 0x0032 + SoundReq 0x0113 + SetIntVariable 0x00000001 + Call sub_0806DA1C + Call sub_0807DF50 + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800DA00.inc b/data/scripts/script_0800DA00.inc new file mode 100644 index 00000000..9f15202c --- /dev/null +++ b/data/scripts/script_0800DA00.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_0800DA00 + BeginBlock + SetEntitySpeed 0x0080 + EndBlock + DoPostScriptAction 0x0001 + _0807EDD4 0x0118, 0x0060 + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000001 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_0800DA28.inc b/data/scripts/script_0800DA28.inc new file mode 100644 index 00000000..042eae3c --- /dev/null +++ b/data/scripts/script_0800DA28.inc @@ -0,0 +1,14 @@ +SCRIPT_START script_0800DA28 + BeginBlock + DoPostScriptAction 0x0008 + SetEntitySpeed 0x0080 + EndBlock + WaitForSomething2 0x00000004 + DoPostScriptAction 0x0007 + Wait 0x003c + _0807E5F8 0x00000002 + WaitForSomething2 0x00000004 + _0807EDD4 0x0118, 0x0060 + _0807E5F8 0x00000002 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_0800DA60.inc b/data/scripts/script_0800DA60.inc new file mode 100644 index 00000000..7b451f6c --- /dev/null +++ b/data/scripts/script_0800DA60.inc @@ -0,0 +1,46 @@ +SCRIPT_START script_0800DA60 + BeginBlock + EndBlock +script_0800DA64: + CheckPlayerInRegion 0x0078, 0x0148, 0x4040 + JumpIfNot script_0800DA64 + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 + _0807E8E4_0 + Call sub_0807F3F8 + Wait 0x003c + _0807F0B4 0x0004 + SetEntityPositionRelative 0x0078, 0x0080 + CameraTargetEntity + Call sub_0807F5C0 + _0807E5F8 0x00000001 + WaitForSomething2 0x00000002 + TextboxNoOverlapFollowPos 0x162d, 0x0002 + _0807EA94 + _0807E5F8 0x00000001 + Wait 0x001e + TextboxNoOverlapFollowPos 0x162e, 0x0002 + _0807EA94 + _0807E8E4_0 + CallWithArg sub_0807F75C, 0x00780138 + _0807F0B4 0x0004 + CameraTargetPlayer + Call sub_0807F5C0 + SetRoomFlag 0x0000 + Call sub_0807F40C + Wait 0x001e + _0807E8E4_1 + Wait 0x000a + _0807E8E4_3 + Wait 0x000a + _0807E8E4_2 + Call sub_0807F3F8 + Wait 0x003c + SetRoomFlag 0x0001 + SetLocalFlag 0x0077 + Call sub_0807DF50 + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800DB18.inc b/data/scripts/script_0800DB18.inc new file mode 100644 index 00000000..3cf5e35c --- /dev/null +++ b/data/scripts/script_0800DB18.inc @@ -0,0 +1,6 @@ +SCRIPT_START script_0800DB18 + BeginBlock + DoPostScriptAction 0x000a + Call sub_08066E38 + EndBlock +SCRIPT_END diff --git a/data/scripts/script_0800DB28.inc b/data/scripts/script_0800DB28.inc new file mode 100644 index 00000000..5dd5e987 --- /dev/null +++ b/data/scripts/script_0800DB28.inc @@ -0,0 +1,21 @@ +SCRIPT_START script_0800DB28 + BeginBlock + DoPostScriptAction 0x0007 + _0807EB44 0x0000 + DoPostScriptAction 0x0014 + EndBlock + WaitForSomething2 0x00000001 + Wait 0x003c + DoPostScriptAction 0x0004 + Wait 0x003c + _0807EB44 0x0004 + DoPostScriptAction 0x001c + Call sub_0807F2D4 + DoPostScriptAction 0x0000 + Wait 0x003c + _0807E5F8 0x00000002 + WaitForSomething2 0x00000001 + _0807EB44 0x0004 + DoPostScriptAction 0x0014 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800DB78.inc b/data/scripts/script_0800DB78.inc new file mode 100644 index 00000000..c810df2f --- /dev/null +++ b/data/scripts/script_0800DB78.inc @@ -0,0 +1,46 @@ +SCRIPT_START script_0800DB78 + BeginBlock + EndBlock +script_0800DB7C: + CallWithArg sub_0807F6B4, 0x000000a0 + JumpIf script_0800DB7C + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 + _0807F0B4 0x0001 + SetEntityPositionRelative 0x0078, 0x0078 + CameraTargetEntity + Call sub_0807F5C0 + _0807EB28 0x1648 + _0807EA94 + Call sub_0804D7EC + _0807E5F8 0x00000001 + WaitForSomething2 0x00000002 + Call sub_0807DF50 + _0807E878 +script_0800DBCA: + CheckRoomFlag 0x0000 + JumpIfNot script_0800DBCA + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 + Call sub_0804D810 + Call sub_0807F3F8 + Wait 0x003c + StartPlayerScript script_0800DDD0 + WaitForSomething2 0x00000004 + _0807E5F8 0x00000001 + WaitForSomething2 0x00000002 + _0807E5F8 0x00000001 + StartPlayerScript script_0800DE00 + WaitForSomething2 0x00000006 + TextboxNoOverlapFollowPos 0x1643, 0x0002 + _0807EA94 + _0807EB28 0x1645 + _0807EA94 + Call sub_0807F3F8 + _0807E5F8 0x00000001 + SoundReq0x80100000 + Call sub_08094F98 + CallWithArg sub_0805DDEC, 0x00000001 + _0807F0C8 0xffff, 0x0000 diff --git a/data/scripts/script_0800DC4C.inc b/data/scripts/script_0800DC4C.inc new file mode 100644 index 00000000..305493d4 --- /dev/null +++ b/data/scripts/script_0800DC4C.inc @@ -0,0 +1,21 @@ +SCRIPT_START script_0800DC4C + Wait 0x003c + SoundReq2 0x0031 + StartPlayerScript script_0800DE50 + WaitForSomething2 0x00000006 + _0807EB28 0x1646 + _0807EA94 + _0807E5F8 0x00000001 + StartPlayerScript script_0800DE2C + CameraTargetPlayer + _0807E778 0x0004 + _0807E80C 0x00000000 + WaitFor_2 + CallWithArg sub_0805DE18, 0x00000001 + _0807F0C8 0x0000, 0x0000 + SetLocalFlag 0x0079 + CallWithArg sub_0806DA1C, 0x00000002 + Call sub_0807DF50 + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_0800DCAC.inc b/data/scripts/script_0800DCAC.inc new file mode 100644 index 00000000..c3bef3db --- /dev/null +++ b/data/scripts/script_0800DCAC.inc @@ -0,0 +1,68 @@ +SCRIPT_START script_0800DCAC + BeginBlock + DoPostScriptAction 0x000a + Call sub_08066E38 + EndBlock + WaitForSomething2 0x00000001 + CallWithArg sub_0807F8E8, 0x00000000 + _0807E5F8 0x00000002 +script_0800DCD0: + CheckRoomFlag 0x0000 + JumpIfNot script_0800DCD0 + DoPostScriptAction 0x0010 + Wait 0x003c + DoPostScriptAction 0x0010 + SetEntityPositionRelative 0x0078, 0x0068 + WaitForSomething2 0x00000001 + SoundReq0x80100000 + Call sub_08066E50 + SoundReq 0x01c9 + Call sub_0807F2D4 + SoundReq 0x01ca + Wait 0x003c + DoPostScriptAction 0x0004 + SoundReq2 0x000b + Wait 0x0078 + _0807EB44 0x0002 + DoPostScriptAction 0x0000 + Wait 0x000a + _0807EB44 0x0006 + Wait 0x000a + _0807EB44 0x0002 + Wait 0x000a + _0807EB44 0x0006 + Wait 0x000a + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + Wait 0x003c + _0807E5F8 0x00000002 + WaitForSomething2 0x00000001 + SetEntitySpeed 0x0100 + _0807EEF4 0x0000, 0x0008 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + Wait 0x001e + Call sub_08066E80 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000001 + DoPostScriptAction 0x0004 + Wait 0x003c + _0807EB44 0x0002 + DoPostScriptAction 0x0000 + Wait 0x000a + _0807EB44 0x0006 + Wait 0x000a + _0807EB44 0x0002 + Wait 0x000a + _0807EB44 0x0006 + Wait 0x000a + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000001 + SetEntitySpeed 0x0100 + _0807EEF4 0x0000, 0x0080 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800DDD0.inc b/data/scripts/script_0800DDD0.inc new file mode 100644 index 00000000..c8ca954c --- /dev/null +++ b/data/scripts/script_0800DDD0.inc @@ -0,0 +1,12 @@ +SCRIPT_START script_0800DDD0 + BeginBlock + SetEntitySpeed 0x0100 + EndBlock + CallWithArg sub_0807F4F8, 0x000000a0 + _0807EDD4 0x0078, 0x00a0 + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000004 + Call sub_080791BC +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800DE00.inc b/data/scripts/script_0800DE00.inc new file mode 100644 index 00000000..e8c74e5f --- /dev/null +++ b/data/scripts/script_0800DE00.inc @@ -0,0 +1,13 @@ +SCRIPT_START script_0800DE00 + BeginBlock + SetEntitySpeed 0x0100 + EndBlock + _0807EB44 0x0000 + DoPostScriptAction 0x000d + DoPostScriptAction 0x0000 + _0807ECC4 0x0010 + DoPostScriptAction 0x000c + _0807E5F8 0x00000004 + Call sub_080791BC +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800DE2C.inc b/data/scripts/script_0800DE2C.inc new file mode 100644 index 00000000..125cf382 --- /dev/null +++ b/data/scripts/script_0800DE2C.inc @@ -0,0 +1,10 @@ +SCRIPT_START script_0800DE2C + BeginBlock + SetEntitySpeed 0x0100 + EndBlock + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + _0807EEF4 0x0000, 0x0080 + _0807E5F8 0x00000004 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_0800DE50.inc b/data/scripts/script_0800DE50.inc new file mode 100644 index 00000000..afed1ce2 --- /dev/null +++ b/data/scripts/script_0800DE50.inc @@ -0,0 +1,9 @@ +SCRIPT_START script_0800DE50 + EndBlock + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + CallWithArg sub_0807F238, 0x000003c5 + Call sub_0807F304 + _0807E5F8 0x00000004 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_0800DE78.inc b/data/scripts/script_0800DE78.inc new file mode 100644 index 00000000..eda4b452 --- /dev/null +++ b/data/scripts/script_0800DE78.inc @@ -0,0 +1,14 @@ +SCRIPT_START script_0800DE78 + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 + StartPlayerScript script_0800DEB0 + WaitForSomething2 0x00000001 + WaitForSomething2 0x00000002 + _0807EB28 0x1647 + _0807EA94 + SetLocalFlag 0x007a + Call sub_0807DF50 + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_0800DEB0.inc b/data/scripts/script_0800DEB0.inc new file mode 100644 index 00000000..5ae10991 --- /dev/null +++ b/data/scripts/script_0800DEB0.inc @@ -0,0 +1,10 @@ +SCRIPT_START script_0800DEB0 + BeginBlock + SetEntitySpeed 0x0100 + EndBlock + _0807EDD4 0x0198, 0x01c8 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000001 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_0800DED4.inc b/data/scripts/script_0800DED4.inc new file mode 100644 index 00000000..8a4dc2fd --- /dev/null +++ b/data/scripts/script_0800DED4.inc @@ -0,0 +1,21 @@ +SCRIPT_START script_0800DED4 + BeginBlock + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + SetEntitySpeed 0x0100 + DoPostScriptAction 0x000b + Call sub_08066D04 + EndBlock + BeginBlock + Call sub_08066D14 + SetEntityPositionRelative 0x0198, 0x0148 + DoPostScriptAction 0x0007 + EndBlock + _0807EDD4 0x0198, 0x01a8 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000002 + Call sub_08066D4C + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800DF24.inc b/data/scripts/script_0800DF24.inc new file mode 100644 index 00000000..1bbcf592 --- /dev/null +++ b/data/scripts/script_0800DF24.inc @@ -0,0 +1,38 @@ +SCRIPT_START script_0800DF24 + BeginBlock + DoPostScriptAction 0x0008 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + EndBlock + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 + SoundReq0x80100000 + _0807E8E4_2 + Wait 0x005a + Call sub_0807F3F8 + Wait 0x003c + _0807E8E4_0 + _0807F0B4 0x0001 + CameraTargetEntity + Call sub_0807F5C0 + Call sub_08066C94 + Wait 0x00e9 + DoPostScriptAction 0x0007 + TextboxNoOverlapFollowPos 0x162f, 0x0002 + _0807EA94 + SoundReq2 0x002f + DoPostScriptAction 0x0019 + SoundReq 0x0198 + Call sub_0807F2D4 + SetRoomFlag 0x0000 + DoPostScriptAction 0x0008 + Wait 0x0080 + _0807F0B4 0x0004 + CameraTargetPlayer + Call sub_0807F5C0 + SetLocalFlag 0x0078 + Call sub_0807DF50 + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_0800DFB4.inc b/data/scripts/script_0800DFB4.inc new file mode 100644 index 00000000..1a66bdab --- /dev/null +++ b/data/scripts/script_0800DFB4.inc @@ -0,0 +1,14 @@ +SCRIPT_START script_0800DFB4 + EndBlock +script_0800DFB6: + CheckRoomFlag 0x0001 + JumpIfNot script_0800DFB6 + SoundReq0x80100000 + _0807E864 + Call sub_0807DF28 + SoundReq 0x00f6 + CallWithArg sub_0806DA1C, 0x00000004 + Call sub_0807DF50 + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_0800DFE4.inc b/data/scripts/script_0800DFE4.inc new file mode 100644 index 00000000..d1de2e0b --- /dev/null +++ b/data/scripts/script_0800DFE4.inc @@ -0,0 +1,31 @@ +SCRIPT_START script_0800DFE4 + BeginBlock + Call sub_0807DF28 + _0807E864 + EndBlock + SoundReq0x80100000 + TextboxNoOverlapFollowPos 0x1632, 0x0002 + _0807EA94 + SetRoomFlag 0x0003 +script_0800DFFE: + CheckRoomFlag 0x0000 + JumpIfNot script_0800DFFE + SoundReq2 0x0030 + Call sub_0807DF50 + _0807E878 +script_0800E012: + CheckRoomFlag 0x0002 + JumpIfNot script_0800E012 + _0807E864 + Call sub_0807DF28 + SetLocalFlag 0x007b + TextboxNoOverlapFollowPos 0x1639, 0x000c + _0807EA94 + Wait 0x0096 + SoundReq 0x00f6 + CallWithArg sub_0806DA1C, 0x00000005 + Call sub_0807DF50 + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800E050.inc b/data/scripts/script_0800E050.inc new file mode 100644 index 00000000..f44b8f44 --- /dev/null +++ b/data/scripts/script_0800E050.inc @@ -0,0 +1,20 @@ +SCRIPT_START script_0800E050 + BeginBlock + Call sub_0807DF28 + _0807E864 + EndBlock + SoundReq0x80100000 + SoundReq0x80100000 + Wait 0x0078 + _0807EB28 0x1638 + _0807EA94 + SetRoomFlag 0x0000 + Wait 0x001e + _0807E5F8 0x00000001 + StartPlayerScript script_0800E094 + WaitForSomething2 0x00000002 + Call sub_0807DF50 + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800E094.inc b/data/scripts/script_0800E094.inc new file mode 100644 index 00000000..a3891eab --- /dev/null +++ b/data/scripts/script_0800E094.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_0800E094 + BeginBlock + SetEntitySpeed 0x00c0 + EndBlock + WaitForSomething2 0x00000001 + DoPostScriptAction 0x0001 + _0807EDD4 0x00a8, 0x002c + _0807E5F8 0x00000002 + Call sub_080791BC +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800E0BC.inc b/data/scripts/script_0800E0BC.inc new file mode 100644 index 00000000..8ca8ff20 --- /dev/null +++ b/data/scripts/script_0800E0BC.inc @@ -0,0 +1,320 @@ +SCRIPT_START script_0800E0BC + BeginBlock + _0807EB44 0x0004 + DoPostScriptAction 0x000a + CheckLocalFlag 0x0093 + JumpIf script_0800E12E + _0807E930 0x0008 + CallWithArg sub_0807F8E8, 0x00000000 + EndBlock +script_0800E0DE: + CheckRoomFlag 0x0000 + JumpIfNot script_0800E0DE + _0807E864 + Wait 0x001e + DoPostScriptAction 0x0010 + SoundReq 0x01c9 + _0807E930 0x0009 + Wait 0x003c + SoundReq 0x01ca + DoPostScriptAction 0x0010 + Wait 0x001e + SoundReq 0x0072 + Wait 0x0078 + DoPostScriptAction 0x0004 + Wait 0x001e + DoPostScriptAction 0x0000 + _0807EB8C + _0807EB74 + Wait 0x000a + TextboxNoOverlap 0x2402 + _0807EA94 + SetLocalFlag 0x0093 +script_0800E12E: + Call sub_080668F0 + _0807E878 + EndBlock +script_0800E138: + CheckEntityInteractType + JumpIfNot script_0800E138 + _0807E864 + _0807EB74 + TextboxNoOverlap 0x2402 + _0807EA94 + Wait 0x000f + _0807E878 + Jump script_0800E138 + .2byte 0x0000 + BeginBlock + _0807EB44 0x0004 + DoPostScriptAction 0x000a + CheckLocalFlag 0x0094 + JumpIf script_0800E1D0 + _0807E930 0x0010 + CallWithArg sub_0807F8E8, 0x00000001 + EndBlock +script_0800E176: + CheckRoomFlag 0x0001 + JumpIfNot script_0800E176 + _0807E864 + Wait 0x001e + DoPostScriptAction 0x0010 + SoundReq 0x01c9 + _0807E930 0x0015 + Wait 0x003c + SoundReq 0x01ca + DoPostScriptAction 0x0010 + Wait 0x001e + SoundReq 0x0072 + Wait 0x0078 + DoPostScriptAction 0x0004 + Wait 0x001e + DoPostScriptAction 0x0000 + _0807EB8C + _0807EB74 + CallWithArg sub_0807F3D8, 0x00000000 + Wait 0x000a + TextboxNoOverlap 0x2401 + _0807EA94 + SetLocalFlag 0x0094 +script_0800E1D0: + CallWithArg sub_0807F3D8, 0x00000000 + _0807E9D4 + _0807E878 + EndBlock +script_0800E1E0: + CheckEntityInteractType + JumpIfNot script_0800E1E0 + _0807E864 + _0807EB74 + CallWithArg sub_0807F3D8, 0x00000000 + TextboxNoOverlap 0x2401 + _0807EA94 + _0807E878 + Jump script_0800E1E0 + BeginBlock + SetEntitySpeed 0x0100 + _0807EB44 0x0004 + DoPostScriptAction 0x000a + CheckLocalFlag 0x0073 + JumpIfNot script_0800E232 + _0807E9D4 + SetEntityPositionRelative 0x0070, 0x0168 + _0807EB44 0x0002 + CallWithArg sub_0807F3D8, 0x00000000 + EndBlock + Jump script_0800E32E +script_0800E232: + CheckLocalFlag 0x0095 + JumpIf script_0800E29A + _0807E930 0x0010 + CallWithArg sub_0807F8E8, 0x00000002 + EndBlock +script_0800E24A: + CheckRoomFlag 0x0002 + JumpIfNot script_0800E24A + _0807E864 + Wait 0x001e + DoPostScriptAction 0x0010 + SoundReq 0x01c9 + _0807E930 0x0015 + Wait 0x003c + SoundReq 0x01ca + DoPostScriptAction 0x0010 + Wait 0x001e + SoundReq 0x0072 + Wait 0x0078 + DoPostScriptAction 0x0004 + Wait 0x001e + DoPostScriptAction 0x0000 + _0807EB8C + _0807EB74 + CallWithArg sub_0807F3D8, 0x00000000 + SetLocalFlag 0x0095 +script_0800E29A: + DoPostScriptAction 0x0000 + CallWithArg sub_0807F3D8, 0x00000000 + _0807E9D4 + _0807E878 + EndBlock +script_0800E2AE: + EndBlock + BeginBlock + CheckEntityInteractType + JumpIf script_0800E312 + CheckLocalFlag 0x0093 + JumpIfNot script_0800E2AE + CheckLocalFlag 0x0094 + JumpIfNot script_0800E2AE + CheckLocalFlag 0x0095 + JumpIfNot script_0800E2AE + _0807E9DC + SetLocalFlag 0x0073 + EndBlock + _0807EB44 0x0000 + CallWithArg sub_0807F3D8, 0x00000004 + _0807EDD4 0x0088, 0x0168 + _0807EB44 0x0006 + CallWithArg sub_0807F3D8, 0x00000004 + _0807EDD4 0x0070, 0x0168 + _0807EB74 + CallWithArg sub_0807F3D8, 0x00000000 + _0807E9D4 + Jump script_0800E32E +script_0800E312: + _0807E864 + _0807EB74 + CallWithArg sub_0807F3D8, 0x00000000 + EndBlock + TextboxNoOverlap 0x2404 + _0807EA94 + _0807E878 + Jump script_0800E2AE +script_0800E32E: + CheckEntityInteractType + JumpIfNot script_0800E32E + _0807E864 + _0807EB74 + CallWithArg sub_0807F3D8, 0x00000000 + TextboxNoOverlap 0x2403 + _0807EA94 + _0807E878 + Jump script_0800E32E + .2byte 0x0000 + BeginBlock + _0807EB44 0x0004 + DoPostScriptAction 0x000a + CheckLocalFlag 0x0071 + JumpIf script_0800E3E8 + CheckLocalFlag 0x0096 + JumpIf script_0800E3BE + _0807E930 0x000c + CallWithArg sub_0807F8E8, 0x00000000 + EndBlock +script_0800E37A: + CheckRoomFlag 0x0000 + JumpIfNot script_0800E37A + _0807E864 + Wait 0x001e + DoPostScriptAction 0x0010 + SoundReq 0x01c9 + _0807E930 0x000d + Wait 0x003c + SoundReq 0x01ca + DoPostScriptAction 0x0010 + Wait 0x001e + SoundReq 0x0072 + Wait 0x0078 + DoPostScriptAction 0x0004 + Wait 0x001e + DoPostScriptAction 0x0000 + _0807EB74 + SetLocalFlag 0x0096 +script_0800E3BE: + DoPostScriptAction 0x0000 + _0807E9D4 + _0807E878 + EndBlock +script_0800E3C8: + CheckEntityInteractType + JumpIfNot script_0800E3C8 + _0807E864 + _0807EB74 + TextboxNoOverlap 0x240c + _0807EA94 + Wait 0x000f + _0807F034 0x0053 + WaitPlayerAction8 + SetLocalFlag 0x0071 + _0807E878 +script_0800E3E8: + _0807E9D4 + _0807E878 + EndBlock +script_0800E3EE: + CheckEntityInteractType + JumpIfNot script_0800E3EE + _0807E864 + _0807EB74 + TextboxNoOverlap 0x240d + _0807EA94 + Wait 0x000f + _0807E878 + Jump script_0800E3EE + BeginBlock + _0807EB44 0x0002 + DoPostScriptAction 0x000a + Call sub_080668F0 + EndBlock +script_0800E41A: + CheckEntityInteractType + JumpIfNot script_0800E41A + _0807E864 + _0807EB74 + TextboxNoOverlap 0x2406 + _0807EA94 + Wait 0x000f + _0807E878 + Jump script_0800E41A + BeginBlock + _0807EB44 0x0002 + CallWithArg sub_0807F3D8, 0x00000000 + DoPostScriptAction 0x000a + _0807E9D4 + EndBlock +script_0800E44C: + CheckEntityInteractType + JumpIfNot script_0800E44C + _0807E864 + _0807EB74 + CallWithArg sub_0807F3D8, 0x00000000 + TextboxNoOverlap 0x2405 + _0807EA94 + _0807E878 + Jump script_0800E44C + BeginBlock + _0807EB44 0x0004 + CallWithArg sub_0807F3D8, 0x00000000 + DoPostScriptAction 0x000a + _0807E9D4 + EndBlock +script_0800E484: + CheckEntityInteractType + JumpIfNot script_0800E484 + _0807E864 + _0807EB74 + CallWithArg sub_0807F3D8, 0x00000000 + TextboxNoOverlap 0x2407 + _0807EA94 + _0807E878 + Jump script_0800E484 + BeginBlock + Call sub_0807F354 + EndBlock + CheckLocalFlag 0x007c + JumpIf script_0800E4FA +script_0800E4B6: + CheckPlayerInRegion 0x0088, 0x00f8, 0x0820 + JumpIfNot script_0800E4B6 + BeginBlock + _0807E864 + EndBlock + Call sub_0807F3F8 + Wait 0x003c + TextboxNoOverlapFollow 0x160c + _0807EA94 + Wait 0x001e + TextboxNoOverlapFollow 0x160d + _0807EA94 + Wait 0x001e + _0807EB28 0x160e + Wait 0x003c + _0807EA94 + BeginBlock + SoundReq2 0x0033 + SetLocalFlag 0x007c +script_0800E4FA: + _0807E878 + DoPostScriptAction 0x0006 + EndBlock +SCRIPT_END diff --git a/data/scripts/script_0800E504.inc b/data/scripts/script_0800E504.inc new file mode 100644 index 00000000..aa6d96c5 --- /dev/null +++ b/data/scripts/script_0800E504.inc @@ -0,0 +1,20 @@ +SCRIPT_START script_0800E504 + BeginBlock + EndBlock + CheckLocalFlag 0x007d + JumpIf script_0800E53C +script_0800E510: + CheckPlayerInRegion 0x00a8, 0x0178, 0x1080 + JumpIfNot script_0800E510 + _0807E864 + Wait 0x001e + Call sub_0807F3F8 + Wait 0x003c + SoundReq 0x0105 + Wait 0x001e + _0807EB28 0x1617 + SetLocalFlag 0x007d +script_0800E53C: + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_0800E544.inc b/data/scripts/script_0800E544.inc new file mode 100644 index 00000000..7b085256 --- /dev/null +++ b/data/scripts/script_0800E544.inc @@ -0,0 +1,22 @@ +SCRIPT_START script_0800E544 + BeginBlock + EndBlock + CheckLocalFlag 0x007e + JumpIf script_0800E582 +script_0800E550: + CheckPlayerInRegion 0x00a8, 0x00c0, 0x0880 + JumpIfNot script_0800E550 + _0807E864 + Wait 0x001e + Call sub_0807F3F8 + Wait 0x003c + SoundReq 0x0105 + Wait 0x001e + _0807EB28 0x1622 + Call sub_08053494 + SetLocalFlag 0x007e +script_0800E582: + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800E58C.inc b/data/scripts/script_0800E58C.inc new file mode 100644 index 00000000..54971859 --- /dev/null +++ b/data/scripts/script_0800E58C.inc @@ -0,0 +1,17 @@ +SCRIPT_START script_0800E58C + BeginBlock + DoPostScriptAction 0x0007 + _0807EB44 0x0000 + DoPostScriptAction 0x0014 + EndBlock + Wait 0x003c + SoundReq 0x0105 + Wait 0x003c + SoundReq 0x009b + Wait 0x001e + TextboxNoOverlap 0x1625 + _0807EA94 + Wait 0x003c + Call sub_08053C84 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800E5C4.inc b/data/scripts/script_0800E5C4.inc new file mode 100644 index 00000000..04160a36 --- /dev/null +++ b/data/scripts/script_0800E5C4.inc @@ -0,0 +1,7 @@ +SCRIPT_START script_0800E5C4 + BeginBlock + CheckLocalFlag 0x0086 + JumpIfNot script_0800E5D6 + DoPostScriptAction 0x0006 + EndBlock +SCRIPT_END diff --git a/data/scripts/script_0800E5D6.inc b/data/scripts/script_0800E5D6.inc new file mode 100644 index 00000000..c1219cee --- /dev/null +++ b/data/scripts/script_0800E5D6.inc @@ -0,0 +1,14 @@ +SCRIPT_START script_0800E5D6 + EndBlock +script_0800E5D8: + CheckLocalFlag 0x0086 + JumpIfNot script_0800E5D8 + _0807E864 + Wait 0x003c + SetIntVariable 0x00000905 + Call sub_0807F420 + SetRoomFlag 0x0001 + Wait 0x001e + _0807E878 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800E600.inc b/data/scripts/script_0800E600.inc new file mode 100644 index 00000000..282b2a6d --- /dev/null +++ b/data/scripts/script_0800E600.inc @@ -0,0 +1,14 @@ +SCRIPT_START script_0800E600 + BeginBlock + SetEntitySpeed 0x0140 + SetEntityDirection 0x0000 + _0807E864 + Call sub_0807F354 + EndBlock + WaitForPlayerAction0x17 + _0807E8E4_0 + DoPostScriptAction 0x0001 + Call sub_080752AC + _0807E878 + Call sub_080791D0 +SCRIPT_END diff --git a/data/scripts/script_0800E62C.inc b/data/scripts/script_0800E62C.inc new file mode 100644 index 00000000..1e325aeb --- /dev/null +++ b/data/scripts/script_0800E62C.inc @@ -0,0 +1,14 @@ +SCRIPT_START script_0800E62C + BeginBlock + SetEntitySpeed 0x0140 + SetEntityDirection 0x0008 + _0807E864 + Call sub_0807F354 + EndBlock + WaitForPlayerAction0x17 + _0807E8E4_1 + DoPostScriptAction 0x0001 + Call sub_080752AC + _0807E878 + Call sub_080791D0 +SCRIPT_END diff --git a/data/scripts/script_0800E658.inc b/data/scripts/script_0800E658.inc new file mode 100644 index 00000000..3368222f --- /dev/null +++ b/data/scripts/script_0800E658.inc @@ -0,0 +1,14 @@ +SCRIPT_START script_0800E658 + BeginBlock + SetEntitySpeed 0x0140 + SetEntityDirection 0x0010 + _0807E864 + Call sub_0807F354 + EndBlock + WaitForPlayerAction0x17 + _0807E8E4_2 + DoPostScriptAction 0x0001 + Call sub_080752AC + _0807E878 + Call sub_080791D0 +SCRIPT_END diff --git a/data/scripts/script_0800E684.inc b/data/scripts/script_0800E684.inc new file mode 100644 index 00000000..1f12e319 --- /dev/null +++ b/data/scripts/script_0800E684.inc @@ -0,0 +1,14 @@ +SCRIPT_START script_0800E684 + BeginBlock + SetEntitySpeed 0x0140 + SetEntityDirection 0x0018 + _0807E864 + Call sub_0807F354 + EndBlock + WaitForPlayerAction0x17 + _0807E8E4_3 + DoPostScriptAction 0x0001 + Call sub_080752AC + _0807E878 + Call sub_080791D0 +SCRIPT_END diff --git a/data/scripts/script_0800E6B0.inc b/data/scripts/script_0800E6B0.inc new file mode 100644 index 00000000..049dc195 --- /dev/null +++ b/data/scripts/script_0800E6B0.inc @@ -0,0 +1,156 @@ +SCRIPT_START script_0800E6B0 + BeginBlock + Call sub_08060090 + DoPostScriptAction 0x000a + EndBlock +script_0800E6BE: + BeginBlock + CheckEntityInteractType + JumpIf script_0800E6D2 + Call sub_08060158 + EndBlock + Jump script_0800E6BE +script_0800E6D2: + EndBlock + _0807E864 + Call sub_0806025C + _0807EA94 + Wait 0x000f + _0807E878 + Jump script_0800E6BE + BeginBlock + Call sub_0806ADFC + DoPostScriptAction 0x000a +script_0800E6F4: + EndBlock + BeginBlock + CheckEntityInteractType + JumpIf script_0800E708 + Call sub_0806AEE4 + Jump script_0800E6F4 +script_0800E708: + EndBlock + _0807E864 + Call sub_0806AFE8 + JumpIf script_0800E722 + _0807EA94 + Wait 0x000f + _0807E878 + Jump script_0800E6F4 +script_0800E722: + _0807EA94 + _0807F034 0x0057 + WaitPlayerAction8 + _0807EA94 + _0807E878 + Jump script_0800E6F4 + .2byte 0x0000 + BeginBlock + _0807E9D4 + DoPostScriptAction 0x000a + EndBlock +script_0800E73E: + CheckEntityInteractType + JumpIfNot script_0800E73E + _0807E864 + _0807EB74 + CallWithArg sub_0806AF60, 0x00000000 + Call sub_0806AFE8 + _0807EA94 + _0807E878 + Jump script_0800E73E + BeginBlock + _0807E9D4 + DoPostScriptAction 0x000a + SetEntitySpeed 0x0200 + CheckGlobalFlag 0x0029 + JumpIfNot script_0800E77C + CheckGlobalFlag 0x002a + JumpIfNot script_0800E786 +script_0800E77C: + SetEntityPositionRelative 0x0188, 0x0098 + Jump script_0800E6F4 +script_0800E786: + EndBlock +script_0800E788: + BeginBlock + CheckGlobalFlag 0x002a + JumpIf script_0800E7BA + CheckEntityInteractType + JumpIf script_0800E7A4 + Call sub_0806AEE4 + EndBlock + Jump script_0800E788 +script_0800E7A4: + EndBlock + _0807E864 + Call sub_0806AFE8 + _0807EA94 + Wait 0x000f + _0807E878 + Jump script_0800E788 +script_0800E7BA: + DoPostScriptAction 0x000f + _0807EB44 0x0002 + CallWithArg sub_0806AF60, 0x00000004 + Call sub_0806AF70 + _0807EE04 0x0188, 0x0058 +script_0800E7D8: + EndBlock + BeginBlock + Call sub_0806AF78 + _0807EE30 + JumpIfNot script_0800E7D8 + EntityHasHeight + JumpIf script_0800E7D8 + EndBlock + Jump script_0800E6F4 + BeginBlock + Call sub_0806C674 + DoPostScriptAction 0x000a + _0807EB44 0x0004 + EndBlock +script_0800E806: + CheckEntityInteractType + JumpIfNot script_0800E806 + _0807E864 + _0807EB74 + Call sub_0806C70C + _0807EA94 + _0807E878 + _0807EB44 0x0004 + Jump script_0800E806 + .2byte 0x0000 + BeginBlock + _0807E9D4 + DoPostScriptAction 0x000a + _0807EB44 0x0000 + EndBlock +script_0800E832: + CheckEntityInteractType + JumpIfNot script_0800E832 + _0807E864 + _0807EB44 0x0004 + BeginBlock + TextboxNoOverlapFollow 0x4501 + CallWithArg sub_0807F854, 0x00010032 + CallWithArg sub_0807F854, 0x000200c8 + CallWithArg sub_0807F854, 0x00030190 + EndBlock + _0807EA94 + _0807EB38 + JumpTable script_0800E910, script_0800E8D6, script_0800E8A4, script_0800E872 +script_0800E872: + BeginBlock + TextboxNoOverlapFollow 0x4505 + CallWithArg sub_0807F854, 0x00010190 + EndBlock + _0807EA94 + HasRupees 0x0190 + JumpIfNot script_0800E908 + ModRupees 0xfe70 + SetLocalFlag 0x0091 + TextboxNoOverlapFollow 0x4508 + _0807EA94 + Call sub_0806C578 +SCRIPT_END diff --git a/data/scripts/script_0800E8A4.inc b/data/scripts/script_0800E8A4.inc new file mode 100644 index 00000000..c357c472 --- /dev/null +++ b/data/scripts/script_0800E8A4.inc @@ -0,0 +1,14 @@ +SCRIPT_START script_0800E8A4 + BeginBlock + TextboxNoOverlapFollow 0x4504 + CallWithArg sub_0807F854, 0x000100c8 + EndBlock + _0807EA94 + HasRupees 0x00c8 + JumpIfNot script_0800E908 + ModRupees 0xff38 + SetLocalFlag 0x0091 + TextboxNoOverlapFollow 0x4508 + _0807EA94 + Call sub_0806C588 +SCRIPT_END diff --git a/data/scripts/script_0800E8D6.inc b/data/scripts/script_0800E8D6.inc new file mode 100644 index 00000000..a288f654 --- /dev/null +++ b/data/scripts/script_0800E8D6.inc @@ -0,0 +1,14 @@ +SCRIPT_START script_0800E8D6 + BeginBlock + TextboxNoOverlapFollow 0x4503 + CallWithArg sub_0807F854, 0x00010032 + EndBlock + _0807EA94 + HasRupees 0x0032 + JumpIfNot script_0800E908 + ModRupees 0xffce + SetLocalFlag 0x0091 + TextboxNoOverlapFollow 0x4508 + _0807EA94 + Call sub_0806C598 +SCRIPT_END diff --git a/data/scripts/script_0800E908.inc b/data/scripts/script_0800E908.inc new file mode 100644 index 00000000..84d61ce1 --- /dev/null +++ b/data/scripts/script_0800E908.inc @@ -0,0 +1,71 @@ +SCRIPT_START script_0800E908 + TextboxNoOverlapFollow 0x4507 + Jump script_0800E914 +script_0800E910: + TextboxNoOverlapFollow 0x4509 +script_0800E914: + _0807EA94 + _0807E878 + _0807EB44 0x0000 + Jump script_0800E832 + BeginBlock + Call sub_0806C4F8 + DoPostScriptAction 0x000a + _0807EB44 0x0000 + EndBlock +script_0800E932: + CheckEntityInteractType + JumpIfNot script_0800E932 + _0807E864 + _0807EB44 0x0004 + _0807E930 0x0004 +script_0800E942: + Call sub_0806C4A8 + JumpIfNot script_0800E942 + Call sub_0806C4DC + _0807EA94 + _0807E878 + _0807EB44 0x0000 + _0807E930 0x0000 + Jump script_0800E932 + .2byte 0x0000 + BeginBlock + DoPostScriptAction 0x000a + _0807EB44 0x0004 + _0807E930 0x0000 + EndBlock +script_0800E974: + CheckEntityInteractType + JumpIfNot script_0800E974 + _0807E864 + _0807E930 0x0008 + Call sub_0807F2D4 + _0807E930 0x0009 + Call sub_0806B260 + JumpIfNot script_0800E9E4 + _0807EA94 + DoPostScriptAction 0x000b + StartPlayerScript script_0800E9F4 + WaitForSomething2 0x00000001 + DoPostScriptAction 0x000a + TextboxNoOverlapFollow 0x4a24 + _0807EA94 + _0807E930 0x000a + Wait 0x0014 + TextboxNoOverlapFollow 0x4a25 + _0807EA94 + _0807E930 0x0000 + StartPlayerScript script_0800EA1C + WaitForSomething2 0x00000001 + SetLocalFlag 0x0074 + SoundReq 0x0072 + Wait 0x00f0 + TextboxNoOverlapFollow 0x4a26 + _0807EA94 + SetLocalFlag 0x0075 +script_0800E9E4: + _0807EA94 + Wait 0x000f + _0807E878 + _0807E930 0x0000 + Jump script_0800E974 diff --git a/data/scripts/script_0800E9F4.inc b/data/scripts/script_0800E9F4.inc new file mode 100644 index 00000000..1c1b1d22 --- /dev/null +++ b/data/scripts/script_0800E9F4.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_0800E9F4 + BeginBlock + _0807EB44 0x0004 + SetEntitySpeed 0x0100 + EndBlock + DoPostScriptAction 0x0001 + _0807EDD4 0x0078, 0x0080 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000001 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_0800EA1C.inc b/data/scripts/script_0800EA1C.inc new file mode 100644 index 00000000..57360433 --- /dev/null +++ b/data/scripts/script_0800EA1C.inc @@ -0,0 +1,15 @@ +SCRIPT_START script_0800EA1C + _0807EB44 0x0006 + DoPostScriptAction 0x0000 + Wait 0x0014 + _0807EB44 0x0002 + DoPostScriptAction 0x0000 + Wait 0x0014 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + DoPostScriptAction 0x0005 + Wait 0x003c + _0807E5F8 0x00000001 + Call sub_080791BC +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800EA54.inc b/data/scripts/script_0800EA54.inc new file mode 100644 index 00000000..f432b00a --- /dev/null +++ b/data/scripts/script_0800EA54.inc @@ -0,0 +1,347 @@ +SCRIPT_START script_0800EA54 + BeginBlock + Call sub_0806CE5C + DoPostScriptAction 0x000a + _0807EB44 0x0004 + _0807E930 0x0008 + EndBlock +script_0800EA6A: + CheckEntityInteractType + JumpIfNot script_0800EA6A + _0807E864 + _0807EB74 + CallWithArg sub_0807F3D8, 0x00000004 + Call sub_0807F2D4 + _0807E930 0x0009 + Call sub_0806CE80 + _0807EA94 + _0807E878 + _0807E930 0x000a + Call sub_0807F2D4 + _0807E930 0x0008 + Jump script_0800EA6A + BeginBlock + _0807E9D4 + Call sub_0806C09C + DoPostScriptAction 0x000a + _0807E930 0x0000 + _0807EB44 0x0004 + EndBlock +script_0800EABC: + CheckEntityInteractType + JumpIfNot script_0800EABC + BeginBlock + _0807E864 + _0807EB74 + CallWithArg sub_0806C028, 0x00000004 + EndBlock +script_0800EAD4: + Call sub_0806C00C + JumpIfNot script_0800EAD4 + _0807E930 0x0008 + Call sub_0806C038 + _0807EA94 + Wait 0x000f + _0807E878 + _0807E930 0x0000 + Jump script_0800EABC + BeginBlock + Call sub_0806C870 + DoPostScriptAction 0x000a + _0807EB44 0x0004 + _0807E930 0x0000 + EndBlock +script_0800EB0E: + _0807E30C + JumpIfNot script_0800EB0E + _0807E864 + _0807EB74 + Call sub_0806C90C + _0807EA94 + Wait 0x000f + _0807E878 + Jump script_0800EB0E + .2byte 0x0000 + BeginBlock + Call sub_08061E70 + DoPostScriptAction 0x000a + _0807EB44 0x0004 + Call sub_08061FD8 + EndBlock +script_0800EB44: + CheckEntityInteractType + JumpIfNot script_0800EB44 + _0807E864 + _0807EB74 + Call sub_08061FD8 + Call sub_08062048 + _0807EA94 + _0807E878 + Jump script_0800EB44 + .2byte 0x0000 + BeginBlock + Call sub_08061E70 + DoPostScriptAction 0x000a + _0807EB44 0x0006 + Call sub_08061FD8 + EndBlock +script_0800EB7C: + CheckEntityInteractType + JumpIfNot script_0800EB7C + _0807E864 + _0807EB74 + Call sub_08061FD8 + Call sub_08062048 + _0807EA94 + _0807E878 + _0807EB44 0x0006 + Call sub_08061FD8 + Jump script_0800EB7C + BeginBlock + Call sub_08061E70 + DoPostScriptAction 0x000a + _0807EB44 0x0002 + Call sub_08061FD8 + EndBlock + Jump script_0800EBF4 + BeginBlock + Call sub_08061E70 + DoPostScriptAction 0x000a + _0807EB44 0x0004 + Call sub_08061FD8 + EndBlock + Jump script_0800EBF4 + BeginBlock + Call sub_08061E70 + DoPostScriptAction 0x000a + _0807EB44 0x0006 + Call sub_08061FD8 + EndBlock +script_0800EBF4: + CheckEntityInteractType + JumpIfNot script_0800EBF4 + _0807E864 + _0807EB74 + Call sub_08061FD8 + Call sub_08062048 + _0807EA94 + _0807E878 + Jump script_0800EBF4 + .2byte 0x0000 + BeginBlock + Call sub_08061E70 + DoPostScriptAction 0x000a + _0807EB44 0x0002 + Call sub_08061FD8 + EndBlock +script_0800EC2C: + CheckEntityInteractType + JumpIfNot script_0800EC2C + _0807E864 + _0807EB74 + Call sub_08061FD8 + Call sub_08062048 + _0807EA94 + _0807E878 + _0807EB44 0x0002 + Call sub_08061FD8 + Jump script_0800EC2C + BeginBlock + Call sub_08061E70 + DoPostScriptAction 0x000a + _0807EB44 0x0004 + Call sub_08061FD8 + EndBlock +script_0800EC6C: + CheckEntityInteractType + JumpIfNot script_0800EC6C + _0807E864 + _0807EB74 + Call sub_08061FD8 + Call sub_08062048 + _0807EA94 + _0807E878 + Jump script_0800EC6C + .2byte 0x0000 + BeginBlock + _0807E9D4 + CallWithArg sub_08061FB8, 0x00000001 + SetEntitySpeed 0x0040 + DoPostScriptAction 0x000a + _0807EB44 0x0004 + _0807E930 0x0002 + EndBlock +script_0800ECAC: + _0807EB44 0x0006 + _0807E930 0x0007 + _0807EDD4 0x0028, 0x0050 + Wait 0x001e + _0807EB44 0x0004 + _0807E930 0x0002 + Wait 0x001e + _0807EB44 0x0002 + _0807E930 0x0001 + Wait 0x001e + _0807EB44 0x0002 + _0807E930 0x0005 + _0807EDD4 0x0048, 0x0050 + Wait 0x001e + _0807EB44 0x0004 + _0807E930 0x0002 + Wait 0x001e + _0807EB44 0x0006 + _0807E930 0x0003 + Wait 0x001e + Jump script_0800ECAC + BeginBlock + Call sub_080639D0 + DoPostScriptAction 0x000a + EndBlock + BeginBlock + CallWithArg sub_08063850, 0x00000000 + EndBlock +script_0800ED20: + CheckEntityInteractType + JumpIfNot script_0800ED20 + _0807E864 + _0807EB74 + CallWithArg sub_08063850, 0x00000000 + Call sub_08063944 + _0807EA94 + JumpIfNot script_0800ED46 + _0807F050 0x0070 + WaitPlayerAction8 +script_0800ED46: + _0807E878 + Call sub_08063874 + CallWithArg sub_08063850, 0x00000000 + Jump script_0800ED20 + BeginBlock + Call sub_08064CC0 + DoPostScriptAction 0x000a + DoPostScriptAction 0x0007 + _0807EB44 0x0002 + _0807E930 0x0000 + EndBlock +script_0800ED76: + _0807E944 + _0807E864 + _0807EB74 + Call sub_08064CD8 + _0807EA94 + Wait 0x000f + _0807E878 + Jump script_0800ED76 + .2byte 0x0000 + BeginBlock + _0807E9D4 + DoPostScriptAction 0x000a +script_0800ED98: + EndBlock + BeginBlock + CheckEntityInteractType + JumpIf script_0800EDB6 + TestBit 0x00000001 + JumpIf script_0800EE12 + Call sub_0806AEE4 + Jump script_0800ED98 +script_0800EDB6: + EndBlock + _0807E864 + Call sub_0807DF28 + CheckLocalFlag 0x00ae + JumpIf script_0800EE3E + Wait 0x000a + _0807E5F8 0x00000001 + TextboxNoOverlapFollow 0x4c07 + _0807EA94 + _0807E5F8 0x00000010 + TextboxNoOverlapFollow 0x4c08 + _0807EA94 + _0807E5F8 0x00000020 + TextboxNoOverlapFollow 0x4c09 + _0807EA94 + SetIntVariable 0x00000503 + Call sub_0807F420 + _0807E5F8 0x00000040 + Call sub_0807DF50 + _0807E878 + SetLocalFlag 0x00ae + Jump script_0800ED98 +script_0800EE12: + EndBlock + WaitForSomething2 0x00000002 + _0807EB44 0x0002 + CallWithArg sub_0806AF60, 0x00000008 + WaitForSomething2 0x00000004 + Call sub_0806AED8 + WaitForSomething2 0x00000008 + Jump script_0800ED98 +script_0800EE3E: + TextboxNoOverlapFollow 0x4c16 + _0807EA94 + Call sub_0807DF50 + _0807E878 + Jump script_0800ED98 + BeginBlock + _0807E9D4 + DoPostScriptAction 0x000a +script_0800EE58: + EndBlock + BeginBlock + CheckEntityInteractType + JumpIf script_0800EE76 + TestBit 0x00000001 + JumpIf script_0800EED2 + Call sub_0806AEE4 + Jump script_0800EE58 +script_0800EE76: + EndBlock + _0807E864 + Call sub_0807DF28 + CheckLocalFlag 0x00ae + JumpIf script_0800EEFE + Wait 0x000a + _0807E5F8 0x00000001 + TextboxNoOverlapFollow 0x4c07 + _0807EA94 + _0807E5F8 0x00000002 + TextboxNoOverlapFollow 0x4c08 + _0807EA94 + _0807E5F8 0x00000004 + TextboxNoOverlapFollow 0x4c09 + _0807EA94 + SetIntVariable 0x00000503 + Call sub_0807F420 + _0807E5F8 0x00000008 + Call sub_0807DF50 + _0807E878 + SetLocalFlag 0x00ae + Jump script_0800EE58 +script_0800EED2: + EndBlock + WaitForSomething2 0x00000010 + _0807EB44 0x0006 + CallWithArg sub_0806AF60, 0x00000008 + WaitForSomething2 0x00000020 + Call sub_0806AED8 + WaitForSomething2 0x00000040 + Jump script_0800EE58 +script_0800EEFE: + TextboxNoOverlapFollow 0x4c15 + _0807EA94 + Call sub_0807DF50 + _0807E878 + Jump script_0800EE58 + TextboxNoOverlapFollow 0x4c07 + _0807EA94 + _0807E5F8 0x00000012 + Wait 0x000a + TextboxNoOverlapFollow 0x4c08 + _0807EA94 + _0807E5F8 0x00000024 + TextboxNoOverlapFollow 0x4c09 + _0807EA94 + _0807E5F8 0x00000048 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_0800EF40.inc b/data/scripts/script_0800EF40.inc new file mode 100644 index 00000000..74e61575 --- /dev/null +++ b/data/scripts/script_0800EF40.inc @@ -0,0 +1,29 @@ +SCRIPT_START script_0800EF40 + BeginBlock + DoPostScriptAction 0x0007 + CheckGlobalFlag 0x001f + JumpIf script_0800EF92 + EndBlock +script_0800EF50: + Call sub_080869A4 + JumpIfNot script_0800EF50 + _0807E864 + CheckLocalFlagByOffset 0x0200, 0x006d + JumpIf script_0800EF82 + TextboxNoOverlapFollow 0x4d01 + _0807EA94 + StartPlayerScript script_0800EF9C + WaitForSomething2 0x00000001 + Wait 0x000f + _0807E878 + Jump script_0800EF50 +script_0800EF82: + SetGlobalFlag 0x001f + TextboxNoOverlapFollow 0x4d02 + _0807EA94 + Wait 0x000f + _0807E878 +script_0800EF92: + Call sub_0808692C +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800EF9C.inc b/data/scripts/script_0800EF9C.inc new file mode 100644 index 00000000..6e1be5e2 --- /dev/null +++ b/data/scripts/script_0800EF9C.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_0800EF9C + BeginBlock + SetEntitySpeed 0x0100 + EndBlock + _0807EB44 0x0004 + DoPostScriptAction 0x0001 + _0807ECC4 0x0008 + _0807E5F8 0x00000001 + Call sub_080791BC +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800EFC0.inc b/data/scripts/script_0800EFC0.inc new file mode 100644 index 00000000..bec9c5ec --- /dev/null +++ b/data/scripts/script_0800EFC0.inc @@ -0,0 +1,91 @@ +SCRIPT_START script_0800EFC0 + BeginBlock + SetEntitySpeed 0x0080 + _0807E9D4 + DoPostScriptAction 0x000a + CheckLocalFlag 0x007b + JumpIf script_0800F082 + EndBlock + Jump script_0800EFFE +script_0800EFDA: + _0807EB44 0x0006 + CallWithArg sub_0806AF60, 0x00000008 + Wait 0x0004 + _0807EB44 0x0004 + CallWithArg sub_0806AF60, 0x00000008 + Wait 0x0004 +script_0800EFFE: + _0807EB44 0x0002 + CallWithArg sub_0806AF60, 0x00000008 + Wait 0x0004 + _0807EB44 0x0002 + CallWithArg sub_0806AF60, 0x00000004 + _0807EDD4 0x0088, 0x0040 + DoPostScriptAction 0x000a + _0807EB44 0x0002 + CallWithArg sub_0806AF60, 0x00000008 + Wait 0x0004 + _0807EB44 0x0004 + CallWithArg sub_0806AF60, 0x00000008 + Wait 0x0004 + _0807EB44 0x0006 + CallWithArg sub_0806AF60, 0x00000008 + Wait 0x0004 + _0807EB44 0x0006 + CallWithArg sub_0806AF60, 0x00000004 + _0807EDD4 0x0068, 0x0040 + DoPostScriptAction 0x000a + CheckLocalFlag 0x007b + JumpIf script_0800F082 + Jump script_0800EFDA +script_0800F082: + EndBlock + Call sub_0806AEE4 + Jump script_0800F082 + .2byte 0x0000 + BeginBlock + _0807F0B4 0x0001 + CameraTargetPlayer + EndBlock +script_0800F09A: + CheckPlayerInRegion 0x01f8, 0x0338, 0x1030 + JumpIfNot script_0800F09A + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 + LoadRoomEntityList gUnk_080EE8AC + StartPlayerScript script_0800F14C + WaitForSomething2 0x00000001 + _0807E5F8 0x0000001e + WaitForSomething2 0x00000040 + TextboxNoOverlapFollowPos 0x1201, 0x000c + _0807EA94 + WaitForSomething2 0x000003c0 + _0807E8E4_0 + TextboxNoOverlapFollowPos 0x1202, 0x000c + _0807EA94 + _0807F034 0x0067 + WaitPlayerAction8 + _0807E8E4_0 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000040 + TextboxNoOverlapFollowPos 0x1203, 0x000c + _0807EA94 + _0807E5F8 0x00000002 + Call sub_0807DF50 + _0807E878 + WaitForSomething2 0x00000040 +script_0800F11A: + CheckKinstoneFused 0x0032 + JumpIfNot script_0800F11A + _0807E864 + Call sub_0807DF28 + _0807E5F8 0x0000001e + Wait 0x003c + _0807E8E4_1 + WaitForSomething2 0x000003c0 + Call sub_0807DF50 + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800F14C.inc b/data/scripts/script_0800F14C.inc new file mode 100644 index 00000000..30be825a --- /dev/null +++ b/data/scripts/script_0800F14C.inc @@ -0,0 +1,15 @@ +SCRIPT_START script_0800F14C + BeginBlock + SetEntitySpeed 0x0080 + EndBlock + DoPostScriptAction 0x0000 + _0807EB44 0x0006 + DoPostScriptAction 0x0004 + Wait 0x003c + DoPostScriptAction 0x0001 + _0807EDD4 0x01f8, 0x0338 + _0807EB44 0x0006 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000001 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_0800F184.inc b/data/scripts/script_0800F184.inc new file mode 100644 index 00000000..b9ef9e66 --- /dev/null +++ b/data/scripts/script_0800F184.inc @@ -0,0 +1,113 @@ +SCRIPT_START script_0800F184 + BeginBlock + SetEntitySpeed 0x0080 + DoPostScriptAction 0x0008 + DoPostScriptAction 0x000a + EndBlock + Call sub_0807F348 + _0807EB44 0x0002 + WaitForSomething2 0x00000002 + DoPostScriptAction 0x0007 + _0807EDD4 0x01b8, 0x0328 + _0807E5F8 0x00000040 + _0807EDD4 0x01f8, 0x0328 + _0807EB44 0x0004 + _0807E930 0x0008 + _0807E8E4_0 + _0807E5F8 0x00000040 + WaitForSomething2 0x00000002 + Call sub_0806E440 + Wait 0x0078 + _0807E5F8 0x00000040 + WaitForSomething2 0x00000002 +script_0800F1E6: + EndBlock + BeginBlock + CallWithArg sub_0807F680, 0x000001c0 + JumpIf script_0800F22A + EndBlock + _0807E864 + Call sub_0807F9A4 + _0807EB74 + _0807E930 0x0008 + DoPostScriptAction 0x0004 + Wait 0x003c + TextboxNoOverlapFollowPos 0x1206, 0x000c + _0807EA94 + StartPlayerScript script_0800F33C + WaitForSomething2 0x00000400 + _0807E878 + Jump script_0800F1E6 +script_0800F22A: + CallWithArg sub_0807F680, 0x00000230 + JumpIfNot script_0800F26A + EndBlock + _0807E864 + Call sub_0807F9A4 + _0807EB74 + _0807E930 0x0008 + DoPostScriptAction 0x0004 + Wait 0x003c + TextboxNoOverlapFollowPos 0x1206, 0x000c + _0807EA94 + StartPlayerScript script_0800F354 + WaitForSomething2 0x00000400 + _0807E878 + Jump script_0800F1E6 +script_0800F26A: + CallWithArg sub_0807F6B4, 0x00000310 + JumpIf script_0800F2AA + EndBlock + _0807E864 + Call sub_0807F9A4 + _0807EB74 + _0807E930 0x0008 + DoPostScriptAction 0x0004 + Wait 0x003c + TextboxNoOverlapFollowPos 0x1206, 0x000c + _0807EA94 + StartPlayerScript script_0800F36C + WaitForSomething2 0x00000400 + _0807E878 + Jump script_0800F1E6 +script_0800F2AA: + CallWithArg sub_0807F6B4, 0x00000340 + JumpIfNot script_0800F2EA + EndBlock + _0807E864 + Call sub_0807F9A4 + _0807EB74 + _0807E930 0x0008 + DoPostScriptAction 0x0004 + Wait 0x003c + TextboxNoOverlapFollowPos 0x1206, 0x000c + _0807EA94 + StartPlayerScript script_0800F384 + WaitForSomething2 0x00000400 + _0807E878 + Jump script_0800F1E6 +script_0800F2EA: + EndBlock + BeginBlock + CheckKinstoneFused 0x0032 + JumpIf script_0800F314 + CheckEntityInteractType + JumpIfNot script_0800F2EA + EndBlock + _0807E864 + _0807EB74 + _0807E930 0x0008 + TextboxNoOverlapFollowPos 0x1208, 0x000c + _0807EA94 + _0807E878 + Jump script_0800F1E6 +script_0800F314: + EndBlock + _0807E5F8 0x00000040 + WaitForSomething2 0x00000002 + SetEntitySpeed 0x0100 + _0807EB44 0x0002 + _0807EEF4 0x00c0, 0x0000 + _0807E5F8 0x00000040 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_0800F33C.inc b/data/scripts/script_0800F33C.inc new file mode 100644 index 00000000..11c63b10 --- /dev/null +++ b/data/scripts/script_0800F33C.inc @@ -0,0 +1,7 @@ +SCRIPT_START script_0800F33C + SetEntitySpeed 0x0100 + _0807EC94 0x0008 + _0807E5F8 0x00000400 + Call sub_080791BC +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800F354.inc b/data/scripts/script_0800F354.inc new file mode 100644 index 00000000..4a43ec65 --- /dev/null +++ b/data/scripts/script_0800F354.inc @@ -0,0 +1,7 @@ +SCRIPT_START script_0800F354 + SetEntitySpeed 0x0100 + _0807ECF4 0x0008 + _0807E5F8 0x00000400 + Call sub_080791BC +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800F36C.inc b/data/scripts/script_0800F36C.inc new file mode 100644 index 00000000..7fb077c6 --- /dev/null +++ b/data/scripts/script_0800F36C.inc @@ -0,0 +1,7 @@ +SCRIPT_START script_0800F36C + SetEntitySpeed 0x0100 + _0807ECC4 0x0008 + _0807E5F8 0x00000400 + Call sub_080791BC +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800F384.inc b/data/scripts/script_0800F384.inc new file mode 100644 index 00000000..488420ce --- /dev/null +++ b/data/scripts/script_0800F384.inc @@ -0,0 +1,7 @@ +SCRIPT_START script_0800F384 + SetEntitySpeed 0x0100 + _0807EC64 0x0008 + _0807E5F8 0x00000400 + Call sub_080791BC +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800F39C.inc b/data/scripts/script_0800F39C.inc new file mode 100644 index 00000000..d492c9ee --- /dev/null +++ b/data/scripts/script_0800F39C.inc @@ -0,0 +1,42 @@ +SCRIPT_START script_0800F39C + BeginBlock + _0807E9D4 + _0807EB44 0x0002 + DoPostScriptAction 0x0001 + DoPostScriptAction 0x0008 + SetEntitySpeed 0x0080 + DoPostScriptAction 0x000b + EndBlock + Call sub_0807F348 + WaitForSomething2 0x00000004 + DoPostScriptAction 0x0007 + _0807EDD4 0x01f8, 0x0318 + _0807EDD4 0x0208, 0x0318 + _0807EDD4 0x0208, 0x0338 + _0807EB44 0x0006 + DoPostScriptAction 0x0000 + DoPostScriptAction 0x000a + _0807E5F8 0x00000080 +script_0800F3EA: + EndBlock + BeginBlock + CheckEntityInteractType + JumpIfNot script_0800F402 + EndBlock + _0807E864 + _0807EB74 + TextboxNoOverlap 0x1237 + _0807EA94 + _0807E878 +script_0800F402: + TestBit 0x00000004 + JumpIfNot script_0800F3EA + EndBlock + DoPostScriptAction 0x000b + Wait 0x0010 + SetEntitySpeed 0x0100 + _0807EC64 0x0010 + _0807EDD4 0x0288, 0x0328 + _0807E5F8 0x00000080 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_0800F430.inc b/data/scripts/script_0800F430.inc new file mode 100644 index 00000000..3f822589 --- /dev/null +++ b/data/scripts/script_0800F430.inc @@ -0,0 +1,43 @@ +SCRIPT_START script_0800F430 + BeginBlock + _0807E9D4 + _0807EB44 0x0002 + DoPostScriptAction 0x0001 + DoPostScriptAction 0x0008 + SetEntitySpeed 0x0080 + DoPostScriptAction 0x000b + EndBlock + Call sub_0807F348 + WaitForSomething2 0x00000008 + DoPostScriptAction 0x0007 + _0807EDD4 0x01d8, 0x0328 + _0807EDD4 0x01f8, 0x0348 + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + DoPostScriptAction 0x000a + _0807E5F8 0x00000100 +script_0800F478: + EndBlock + BeginBlock + CheckEntityInteractType + JumpIfNot script_0800F490 + EndBlock + _0807E864 + _0807EB74 + TextboxNoOverlap 0x1238 + _0807EA94 + _0807E878 +script_0800F490: + TestBit 0x00000008 + JumpIfNot script_0800F478 + EndBlock + DoPostScriptAction 0x000b + Wait 0x0018 + SetEntitySpeed 0x0100 + _0807EC94 0x0010 + _0807EC64 0x0020 + _0807EDD4 0x0288, 0x0328 + _0807E5F8 0x00000100 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800F4C4.inc b/data/scripts/script_0800F4C4.inc new file mode 100644 index 00000000..958ffa77 --- /dev/null +++ b/data/scripts/script_0800F4C4.inc @@ -0,0 +1,42 @@ +SCRIPT_START script_0800F4C4 + BeginBlock + _0807E9D4 + _0807EB44 0x0002 + DoPostScriptAction 0x0001 + DoPostScriptAction 0x0008 + SetEntitySpeed 0x0080 + DoPostScriptAction 0x000b + EndBlock + Call sub_0807F348 + WaitForSomething2 0x00000010 + DoPostScriptAction 0x0007 + _0807EDD4 0x01c8, 0x0328 + _0807EDD4 0x01e8, 0x0338 + _0807EB44 0x0002 + DoPostScriptAction 0x0000 + DoPostScriptAction 0x000a + _0807E5F8 0x00000200 +script_0800F50C: + EndBlock + BeginBlock + CheckEntityInteractType + JumpIfNot script_0800F524 + EndBlock + _0807E864 + _0807EB74 + TextboxNoOverlap 0x1239 + _0807EA94 + _0807E878 +script_0800F524: + TestBit 0x00000010 + JumpIfNot script_0800F50C + EndBlock + DoPostScriptAction 0x000b + Wait 0x0028 + SetEntitySpeed 0x0100 + _0807EC64 0x0010 + _0807EDD4 0x0288, 0x0328 + _0807E5F8 0x00000200 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800F554.inc b/data/scripts/script_0800F554.inc new file mode 100644 index 00000000..e8de87fb --- /dev/null +++ b/data/scripts/script_0800F554.inc @@ -0,0 +1,151 @@ +SCRIPT_START script_0800F554 + BeginBlock + Call sub_08061FE4 + _0807E9D4 + DoPostScriptAction 0x000a + EndBlock +script_0800F564: + CheckEntityInteractType + JumpIfNot script_0800F564 + _0807E864 + _0807EB74 + Call sub_08061FE4 + Call sub_08061FF4 + _0807EA94 + _0807E878 + Jump script_0800F564 + .2byte 0x0000 +script_0800F584: + BeginBlock + DoPostScriptAction 0x0001 + _0807E9D4 + DoPostScriptAction 0x000a + EndBlock +script_0800F592: + CheckEntityInteractType + JumpIfNot script_0800F592 + _0807E864 + _0807EB74 + Call sub_0806265C + _0807EA94 + _0807E878 + DoPostScriptAction 0x0001 + Jump script_0800F592 + .2byte 0x0000 + BeginBlock + _0807EB44 0x0006 + _0807E9D4 + DoPostScriptAction 0x000a + CallWithArg sub_0807F3D8, 0x00000008 + EndBlock +script_0800F5C8: + CheckEntityInteractType + JumpIfNot script_0800F5C8 + _0807E864 + _0807EB74 + CallWithArg sub_0807F3D8, 0x00000008 + Call sub_08064428 + _0807EA94 + _0807E878 + Jump script_0800F5C8 + .2byte 0x0000 + BeginBlock + _0807EB44 0x0004 + _0807E930 0x0000 + _0807E9D4 + DoPostScriptAction 0x000a + Call sub_0807F348 + EndBlock +script_0800F604: + CheckEntityInteractType + JumpIfNot script_0800F604 + _0807E864 + _0807EB74 + CallWithArg sub_0807F3D8, 0x00000008 + TextboxNoOverlap 0x2511 + _0807EA94 + Wait 0x000f + _0807E878 + Jump script_0800F604 + BeginBlock + _0807E9D4 + DoPostScriptAction 0x000a + DoPostScriptAction 0x0001 + EndBlock +script_0800F636: + _0807E30C + JumpIfNot script_0800F636 + _0807E864 + _0807EB74 + Call sub_0806C90C + _0807EA94 + _0807E878 + Jump script_0800F636 + .2byte 0x0000 + BeginBlock + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + DoPostScriptAction 0x000a + _0807E9D4 + EndBlock +script_0800F662: + CheckEntityInteractType + JumpIfNot script_0800F662 + _0807E864 + _0807EB74 + DoPostScriptAction 0x0001 + Call sub_0806B4F0 + _0807EA94 + Wait 0x000f + _0807E878 + DoPostScriptAction 0x0000 + Jump script_0800F662 + .2byte 0x0000 + BeginBlock + _0807EB44 0x0004 + _0807E930 0x0000 + _0807E9D4 + DoPostScriptAction 0x000a + Call sub_0807F348 + EndBlock +script_0800F6A0: + CheckEntityInteractType + JumpIfNot script_0800F6A0 + _0807E864 + _0807EB74 + CallWithArg sub_0807F3D8, 0x00000004 + CheckLocalFlag 0x00cd + JumpIf script_0800F6C4 + TextboxNoOverlap 0x2512 + Jump script_0800F6C8 +script_0800F6C4: + TextboxNoOverlap 0x251f +script_0800F6C8: + _0807EA94 + Wait 0x000f + _0807E878 + CallWithArg sub_0807F3D8, 0x00000000 + Jump script_0800F6A0 + .2byte 0x0000 + BeginBlock + DoPostScriptAction 0x0001 + _0807E9D4 + DoPostScriptAction 0x000a + Call sub_08062788 + EndBlock +script_0800F6F4: + CheckLocalFlag 0x00cd + JumpIf script_0800F718 + CheckEntityInteractType + JumpIfNot script_0800F6F4 + _0807E864 + _0807EB74 + Call sub_0806265C + _0807EA94 + _0807E878 + DoPostScriptAction 0x0001 + Jump script_0800F6F4 +script_0800F718: + Call sub_080627E8 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_0800F724.inc b/data/scripts/script_0800F724.inc new file mode 100644 index 00000000..6a89a421 --- /dev/null +++ b/data/scripts/script_0800F724.inc @@ -0,0 +1,176 @@ +SCRIPT_START script_0800F724 + BeginBlock + DoPostScriptAction 0x0008 + EndBlock +script_0800F72C: + CheckLocalFlag 0x00cd + JumpIfNot script_0800F72C + DoPostScriptAction 0x0007 + Jump script_0800F584 + CheckLocalFlag 0x00cd + JumpIf script_0800FA4C + _0807E864 + Call sub_0807DF28 + SetEntityPositionRelative 0x00c8, 0x0148 + Call sub_0807F844 + _0807E778 0x0002 + DoFade6 + WaitFor_2 + StartPlayerScript script_0800FA54 + _0807E5F8 0x00000002 + _0807F0B4 0x0001 + SetEntityPositionRelative 0x00c8, 0x0218 + Call sub_0807F5C0 + Wait 0x0064 + _0807F0B4 0x0002 + SetEntityPositionRelative 0x00c8, 0x0368 + Call sub_0807F5C0 + WaitForSomething2 0x00000001 + WaitForSomething2 0x00000004 + TextboxNoOverlapFollowPos 0x2501, 0x0000 + _0807EA94 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000004 + _0807F0B4 0x0004 + CameraTargetPlayer + Call sub_0807DF50 + _0807E878 + _0807E5F8 0x00000010 + WaitForSomething2 0x00000004 + _0807E864 + Call sub_0807DF28 + StartPlayerScript script_0800FA78 + WaitForSomething2 0x00000001 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000004 + TextboxNoOverlapFollowPos 0x2503, 0x000e + _0807EA94 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000004 + Call sub_0807DF50 + _0807E878 + WaitForSomething2 0x00000004 + _0807E864 + Call sub_0807DF28 + StartPlayerScript script_0800FA9C + WaitForSomething2 0x00000001 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000004 + TextboxNoOverlapFollowPos 0x2504, 0x000e + _0807EA94 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000004 + Call sub_0807DF50 + _0807E878 + WaitForSomething2 0x00000004 + _0807E864 + Call sub_0807DF28 + StartPlayerScript script_0800FAC0 + WaitForSomething2 0x00000001 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000004 + TextboxNoOverlapFollowPos 0x2505, 0x000e + _0807EA94 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000004 + Call sub_0807DF50 + _0807E878 + WaitForSomething2 0x00000004 + _0807E864 + Call sub_0807DF28 + Call sub_08063C5C + SoundReq 0x00e2 + Wait 0x001e + _0807E8E4_0 + Call sub_0807F3F8 + Wait 0x003c + TextboxNoOverlapFollowPos 0x1021, 0x000e + _0807EA94 + StartPlayerScript script_0800FAE4 + SetEntityPositionRelative 0x00f0, 0x0258 + _0807F0B4 0x0001 + CameraTargetEntity + Wait 0x001e + Call sub_08063C2C + WaitForSomething2 0x00000001 + TextboxNoOverlapFollowPos 0x1022, 0x000e + _0807EA94 + _0807E8E4_0 + Call sub_08063C14 + Call sub_08094CDC + Wait 0x001e + TextboxNoOverlapFollowPos 0x1023, 0x000e + _0807EA94 + Call sub_08063C14 + Call sub_08094DD8 + Wait 0x001e + TextboxNoOverlapFollowPos 0x1024, 0x000e + _0807EA94 + Call sub_08063C14 + Call sub_08094D34 + Wait 0x001e + TextboxNoOverlapFollowPos 0x1025, 0x000e + _0807EA94 + Call sub_08063C5C + TextboxNoOverlapFollowPos 0x1026, 0x000e + _0807EA94 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000004 + _0807E8E4_1 + Call sub_08063C2C + TextboxNoOverlapFollowPos 0x1027, 0x0000 + _0807EA94 + Call sub_08063C74 + Wait 0x003c + Call sub_08063C14 + _0807E8E4_0 + TextboxNoOverlapFollowPos 0x1028, 0x000e + _0807EA94 + _0807E8E4_1 + TextboxNoOverlapFollowPos 0x1029, 0x0000 + _0807EA94 + _0807E8E4_0 + TextboxNoOverlapFollowPos 0x102a, 0x000e + _0807EA94 + Call sub_08063C14 + Call sub_08094D70 + SoundReq 0x0103 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000004 + Call sub_08063C14 + Call sub_08094D10 + Wait 0x001e + Call sub_08094E0C + Wait 0x001e + _0807E8E4_1 + Call sub_0807F3F8 + Wait 0x003c + TextboxNoOverlapFollowPos 0x102b, 0x0000 + _0807EA94 + _0807F034 0x000d + WaitPlayerAction8 + Call sub_0806DC3C + Call sub_080791BC + CallWithArg sub_0807F244, 0x0000000d + SetIntVariable 0x000000ff + Call sub_0807F5B0 + CallWithArg sub_0807F29C, gUnk_080049D6 + Wait 0x00b7 + SetIntVariable 0x00000000 + Call sub_0807F5B0 + TextboxNoOverlapFollowPos 0x102c, 0x0000 + _0807EA94 + CallWithArg sub_0807F29C, 0x00000000 + Call sub_0806DC58 + _0807F0B4 0x0004 + CameraTargetPlayer + Wait 0x000a + _0807E5F8 0x00000002 + Call sub_08063C44 + SetLocalFlag 0x00cd + Call sub_0807DF50 + _0807E878 +script_0800FA4C: + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800FA54.inc b/data/scripts/script_0800FA54.inc new file mode 100644 index 00000000..bb03b3ad --- /dev/null +++ b/data/scripts/script_0800FA54.inc @@ -0,0 +1,10 @@ +SCRIPT_START script_0800FA54 + BeginBlock + SetEntitySpeed 0x0100 + EndBlock + SetEntityPositionRelative 0x00d8, 0x0398 + _0807EB44 0x0006 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000001 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_0800FA78.inc b/data/scripts/script_0800FA78.inc new file mode 100644 index 00000000..6da1cdb1 --- /dev/null +++ b/data/scripts/script_0800FA78.inc @@ -0,0 +1,10 @@ +SCRIPT_START script_0800FA78 + BeginBlock + SetEntitySpeed 0x0100 + EndBlock + _0807EDD4 0x00a0, 0x0278 + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000001 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_0800FA9C.inc b/data/scripts/script_0800FA9C.inc new file mode 100644 index 00000000..32d80aea --- /dev/null +++ b/data/scripts/script_0800FA9C.inc @@ -0,0 +1,10 @@ +SCRIPT_START script_0800FA9C + BeginBlock + SetEntitySpeed 0x0100 + EndBlock + _0807EDD4 0x0078, 0x01c0 + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000001 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_0800FAC0.inc b/data/scripts/script_0800FAC0.inc new file mode 100644 index 00000000..9ca12a8a --- /dev/null +++ b/data/scripts/script_0800FAC0.inc @@ -0,0 +1,10 @@ +SCRIPT_START script_0800FAC0 + BeginBlock + SetEntitySpeed 0x0100 + EndBlock + _0807EDD4 0x0108, 0x01c8 + _0807EB44 0x0002 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000001 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_0800FAE4.inc b/data/scripts/script_0800FAE4.inc new file mode 100644 index 00000000..0db32cf2 --- /dev/null +++ b/data/scripts/script_0800FAE4.inc @@ -0,0 +1,17 @@ +SCRIPT_START script_0800FAE4 + BeginBlock + SetEntitySpeed 0x0100 + EndBlock + Call sub_0807F584 + JumpTable script_0800FB06, script_0800FB10, script_0800FB06, script_0800FAFC +script_0800FAFC: + CallWithArg sub_0807F4F8, 0x0000027c +script_0800FB06: + CallWithArg sub_0807F464, 0x000000e8 +script_0800FB10: + _0807EDD4 0x00e8, 0x0270 + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000001 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_0800FB2C.inc b/data/scripts/script_0800FB2C.inc new file mode 100644 index 00000000..6f074f03 --- /dev/null +++ b/data/scripts/script_0800FB2C.inc @@ -0,0 +1,7 @@ +SCRIPT_START script_0800FB2C + _0807EB44 0x0002 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000001 + Call sub_080791BC +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800FB44.inc b/data/scripts/script_0800FB44.inc new file mode 100644 index 00000000..cfc3e949 --- /dev/null +++ b/data/scripts/script_0800FB44.inc @@ -0,0 +1,105 @@ +SCRIPT_START script_0800FB44 + BeginBlock + DoPostScriptAction 0x0008 + DoPostScriptAction 0x000b + SetEntitySpeed 0x0080 + Call sub_08066D04 + EndBlock + WaitForSomething2 0x00000002 + Call sub_08066D14 + JumpIf script_0800FB6C + MoveEntityToPlayer +script_0800FB6C: + DoPostScriptAction 0x0007 + SetEntityPositionRelative 0x00b8, 0x0398 + _0807EB44 0x0002 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000002 + SetEntitySpeed 0x0200 + _0807EDD4 0x00b8, 0x0318 + SetEntityPositionRelative 0x00a0, 0x0260 + _0807EB44 0x0000 + DoPostScriptAction 0x0001 + _0807E5F8 0x00000004 + DoPostScriptAction 0x000a + _0807E9D4 +script_0800FBAE: + _0807E30C + JumpIfNot script_0800FBAE + DoPostScriptAction 0x000b + _0807E5F8 0x00000004 + WaitForSomething2 0x00000002 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000002 + SetEntitySpeed 0x0200 + _0807EDD4 0x00a0, 0x0268 + _0807EDD4 0x0070, 0x0268 + _0807EDD4 0x0070, 0x0208 + SetEntityPositionRelative 0x0078, 0x01a8 + _0807EB44 0x0000 + DoPostScriptAction 0x0001 + _0807E5F8 0x00000004 + DoPostScriptAction 0x000a +script_0800FC06: + _0807E30C + JumpIfNot script_0800FC06 + DoPostScriptAction 0x000b + _0807E5F8 0x00000004 + WaitForSomething2 0x00000002 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000002 + SetEntitySpeed 0x0200 + _0807EDD4 0x00f8, 0x01a8 + SetEntityPositionRelative 0x0118, 0x01c8 + _0807EB44 0x0002 + DoPostScriptAction 0x0001 + _0807E5F8 0x00000004 + DoPostScriptAction 0x000a +script_0800FC52: + _0807E30C + JumpIfNot script_0800FC52 + DoPostScriptAction 0x000b + _0807E5F8 0x00000004 + WaitForSomething2 0x00000002 + _0807EB44 0x0006 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000002 + SetEntitySpeed 0x0200 + _0807EDD4 0x0118, 0x0260 + SetEntityPositionRelative 0x00f8, 0x0270 + _0807EB44 0x0000 + DoPostScriptAction 0x0001 + _0807E5F8 0x00000004 + DoPostScriptAction 0x000a +script_0800FC9E: + CheckEntityInteractType + JumpIfNot script_0800FC9E + DoPostScriptAction 0x000b + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000004 + DoPostScriptAction 0x0004 + WaitForSomething2 0x00000002 + DoPostScriptAction 0x000d + SetEntitySpeed 0x0040 + _0807EC94 0x0020 + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000002 + DoPostScriptAction 0x000c + SetEntitySpeed 0x0040 + _0807ECF4 0x0020 + _0807EB44 0x0006 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000002 + Call sub_08066D4C + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_0800FD0C.inc b/data/scripts/script_0800FD0C.inc new file mode 100644 index 00000000..0720943c --- /dev/null +++ b/data/scripts/script_0800FD0C.inc @@ -0,0 +1,30 @@ +SCRIPT_START script_0800FD0C + CheckLocalFlag 0x00cd + JumpIf script_0800FD50 + WaitForSomething2 0x00000010 +script_0800FD1A: + CheckPlayerInRegion 0x00c8, 0x03c0, 0x1040 + JumpIfNot script_0800FD1A + CheckLocalFlag 0x00cd + JumpIf script_0800FD5C + _0807E864 + Call sub_0807F9A4 + TextboxNoOverlapFollowPos 0x2506, 0x0000 + _0807EA94 + StartPlayerScript script_0800FD80 + WaitForSomething2 0x00000008 + _0807E878 + Jump script_0800FD1A +script_0800FD50: + CheckPlayerInRegion 0x00c8, 0x03c0, 0x1040 + JumpIfNot script_0800FD50 +script_0800FD5C: + _0807E864 + Call sub_0807F9A4 + TextboxNoOverlapFollowPos 0x106c, 0x0000 + _0807EA94 + StartPlayerScript script_0800FD80 + WaitForSomething2 0x00000008 + _0807E878 + Jump script_0800FD50 + .2byte 0x0000 diff --git a/data/scripts/script_0800FD80.inc b/data/scripts/script_0800FD80.inc new file mode 100644 index 00000000..2d707a67 --- /dev/null +++ b/data/scripts/script_0800FD80.inc @@ -0,0 +1,9 @@ +SCRIPT_START script_0800FD80 + SetEntitySpeed 0x0080 + _0807EC64 0x0020 + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000008 + Call sub_080791BC +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0800FDA0.inc b/data/scripts/script_0800FDA0.inc new file mode 100644 index 00000000..fd161ece --- /dev/null +++ b/data/scripts/script_0800FDA0.inc @@ -0,0 +1,116 @@ +SCRIPT_START script_0800FDA0 + BeginBlock + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + DoPostScriptAction 0x000a + _0807E9D4 + EndBlock +script_0800FDB2: + CheckEntityInteractType + JumpIfNot script_0800FDB2 + _0807E864 + _0807EB74 + Call sub_08069888 + _0807EA94 + _0807E878 + Jump script_0800FDB2 + .2byte 0x0000 + BeginBlock + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + DoPostScriptAction 0x000a + _0807E9D4 + SetEntitySpeed 0x0040 + EndBlock +script_0800FDE2: + Call sub_08069A60 +script_0800FDE8: + Call sub_0806991C +script_0800FDEE: + EndBlock + BeginBlock + Call sub_08069ACC + JumpIf script_0800FE06 + _0807EE30 + JumpIfNot script_0800FDEE + Jump script_0800FDE2 +script_0800FE06: + EndBlock + _0807EB44 0x0002 + DoPostScriptAction 0x0000 + Wait 0x001e + _0807EB44 0x0006 + DoPostScriptAction 0x0000 + Wait 0x001e + _0807EB44 0x0002 + DoPostScriptAction 0x0000 + Wait 0x001e + _0807EB44 0x0006 + DoPostScriptAction 0x0000 + Wait 0x003c + Call sub_08069A3C + Jump script_0800FDE8 + .2byte 0x0000 + BeginBlock + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + DoPostScriptAction 0x000a + _0807E9D4 + SetEntitySpeed 0x0040 + EndBlock +script_0800FE5A: + Call sub_08069AA8 +script_0800FE60: + Call sub_080699AC +script_0800FE66: + EndBlock + BeginBlock + Call sub_08069ACC + JumpIf script_0800FE7E + _0807EE30 + JumpIfNot script_0800FE66 + Jump script_0800FE5A +script_0800FE7E: + EndBlock + _0807EB44 0x0002 + DoPostScriptAction 0x0000 + Wait 0x001e + _0807EB44 0x0006 + DoPostScriptAction 0x0000 + Wait 0x001e + _0807EB44 0x0002 + DoPostScriptAction 0x0000 + Wait 0x001e + _0807EB44 0x0006 + DoPostScriptAction 0x0000 + Wait 0x003c + Call sub_08069A84 + Jump script_0800FE60 + .2byte 0x0000 + BeginBlock + CheckInventory1 0x0012 + JumpIf script_0800FF0E + _0807EB44 0x0006 + _0807E9D4 + CallWithArg sub_0807F3D8, 0x00000008 + EndBlock +script_0800FED8: + EndBlock + BeginBlock + DoPostScriptAction 0x000b + Call sub_080642B8 + CheckEntityInteractType + JumpIfNot script_0800FED8 + EndBlock + _0807E864 + _0807EB74 + CallWithArg sub_0807F3D8, 0x00000008 + Call sub_08064428 + _0807EA94 + Wait 0x000f + _0807E878 + Jump script_0800FED8 +script_0800FF0E: + DoPostScriptAction 0x0008 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_0800FF18.inc b/data/scripts/script_0800FF18.inc new file mode 100644 index 00000000..33b87618 --- /dev/null +++ b/data/scripts/script_0800FF18.inc @@ -0,0 +1,28 @@ +SCRIPT_START script_0800FF18 + BeginBlock + CheckInventory1 0x0012 + JumpIf script_0800FF6A + _0807EB44 0x0006 + _0807E9D4 + CallWithArg sub_0807F3D8, 0x00000008 + EndBlock +script_0800FF34: + EndBlock + BeginBlock + DoPostScriptAction 0x000b + Call sub_08064198 + CheckEntityInteractType + JumpIfNot script_0800FF34 + EndBlock + _0807E864 + _0807EB74 + CallWithArg sub_0807F3D8, 0x00000008 + Call sub_08064428 + _0807EA94 + Wait 0x000f + _0807E878 + Jump script_0800FF34 +script_0800FF6A: + DoPostScriptAction 0x0008 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_0800FF74.inc b/data/scripts/script_0800FF74.inc new file mode 100644 index 00000000..c74dadee --- /dev/null +++ b/data/scripts/script_0800FF74.inc @@ -0,0 +1,90 @@ +SCRIPT_START script_0800FF74 + BeginBlock + _0807EB44 0x0002 + _0807E9D4 + CallWithArg sub_0807F3D8, 0x00000008 + Call sub_080644A4 + ClearLocalFlag 0x00c7 + EndBlock +script_0800FF92: + EndBlock + BeginBlock + DoPostScriptAction 0x000a + CheckLocalFlag 0x00ce + JumpIf script_0800FFCC + DoPostScriptAction 0x000b + Call sub_08064198 + CheckLocalFlag 0x00c7 + JumpIfNot script_0800FFCC + Call sub_08064488 + CheckPlayerInRegion2 0x4040 + JumpIfNot script_0800FFCC + Call sub_08064470 + JumpIf script_08010014 +script_0800FFCC: + CheckEntityInteractType + JumpIfNot script_0800FF92 + EndBlock + SetLocalFlag 0x00c7 + _0807E864 + _0807EB74 + CallWithArg sub_0807F3D8, 0x00000008 + CheckInventory1 0x0048 + JumpIf script_0800FFF8 + TextboxNoOverlap 0x3401 + _0807EA94 + Jump script_08010060 +script_0800FFF8: + CheckLocalFlag 0x00ce + JumpIfNot script_0801000A + TextboxNoOverlap 0x340b + _0807EA94 + Jump script_08010060 +script_0801000A: + TextboxNoOverlap 0x3402 + _0807EA94 + Jump script_08010060 +script_08010014: + EndBlock + _0807E888 + Call sub_0807F594 + _0807E864 + _0807EB74 + CallWithArg sub_0807F3D8, 0x00000008 + SoundReq 0x00cd + TextboxNoOverlap 0x340a + _0807EA94 + _0807EB44 0x0004 + CallWithArg sub_0807F3D8, 0x0000000c + SetEntitySpeed 0x0100 + _0807EDD4 0x0018, 0x0108 + _0807EB44 0x0002 + CallWithArg sub_0807F3D8, 0x00000008 + SetLocalFlag 0x00ce +script_08010060: + Call sub_080644A4 + CallWithArg sub_0807F5B0, 0x0000000a + _0807E878 + Jump script_0800FF92 + .2byte 0x0000 + BeginBlock + _0807E9D4 + DoPostScriptAction 0x000a + _0807EB44 0x0004 + CallWithArg sub_080672B0, 0x00000000 + EndBlock +script_08010090: + CheckEntityInteractType + JumpIfNot script_08010090 + _0807E864 + _0807EB74 + CallWithArg sub_080672B0, 0x00000004 + TextboxNoOverlapFollow 0x0a01 + _0807EA94 + Wait 0x000f + _0807E878 + _0807EB44 0x0004 + CallWithArg sub_080672B0, 0x00000000 + Jump script_08010090 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_080100C8.inc b/data/scripts/script_080100C8.inc new file mode 100644 index 00000000..fd50b2f9 --- /dev/null +++ b/data/scripts/script_080100C8.inc @@ -0,0 +1,119 @@ +SCRIPT_START script_080100C8 + BeginBlock + Call sub_08061FE4 + Call sub_08061E70 + DoPostScriptAction 0x000a + EndBlock +script_080100DC: + CheckEntityInteractType + JumpIfNot script_080100DC + _0807E864 + _0807EB74 + Call sub_08061FE4 + Call sub_08062048 + _0807EA94 + _0807E878 + Jump script_080100DC + .2byte 0x0000 + BeginBlock + Call sub_08061FE4 + Call sub_08061E70 + DoPostScriptAction 0x000a + EndBlock +script_08010110: + Wait 0x003c + Call sub_08061E90 + Jump script_08010110 + .2byte 0x0000 + BeginBlock + _0807E9D4 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + DoPostScriptAction 0x000a + EndBlock +script_08010132: + CheckEntityInteractType + JumpIfNot script_08010132 + _0807E864 + _0807EB74 + TextboxNoOverlapFollow 0x4f22 + _0807EA94 + _0807E878 + Jump script_08010132 + BeginBlock + DoPostScriptAction 0x0001 + Call sub_0806C354 + DoPostScriptAction 0x000a + EndBlock +script_0801015A: + CheckEntityInteractType + JumpIfNot script_0801015A + _0807E864 + _0807EB74 + CheckRoomFlag 0x0001 + JumpIf script_0801019E + TextboxNoOverlapFollowPos 0x3001, 0x0000 + _0807EA94 + _0807E3E8 + JumpIfNot script_080101A6 + Call sub_080A1608 + _0807EA94 + _0807E878 + CallWithArg sub_080A1550, script_080101AC + JumpIfNot script_0801015A + SoundReq2 0x0015 + SetRoomFlag 0x0001 + Jump script_0801015A +script_0801019E: + Call sub_080A1608 + _0807EA94 +script_080101A6: + _0807E878 + Jump script_0801015A +script_080101AC: + BeginBlock + DoPostScriptAction 0x0008 + Call sub_080A1648 + EndBlock + Call sub_080A1270 + _0807E864 + Call sub_0807DF28 + TextboxNoOverlapFollowPos 0x3004, 0x0007 + _0807EA94 + SoundReq0x80100000 + _0807E778 0x0004 + DoFade5 + WaitFor_2 + CallWithArg sub_0807F75C, 0x03400378 + Call sub_080791BC + Call sub_0807FB74 + _0807E8E4_1 + Call sub_0807F168 + Call sub_080A1388 + Call sub_0806EC38 + BeginBlock + MoveEntityToPlayer + Call sub_0807F844 + CameraTargetPlayer + EndBlock + _0807E778 0x0004 + DoFade4 + WaitFor_2 + SoundReq2 0xffff + Call sub_080A13B4 + _0807EA94 + JumpIfNot script_08010240 + Call sub_080A13E8 + WaitPlayerAction8 + Call sub_080A1460 + _0807EA94 + Call sub_080A14A8 +script_08010240: + Call sub_0807DF50 + _0807E878 + CallWithArg sub_0807F5B0, 0x00000000 + ClearRoomFlag 0x0001 + Call sub_080A169C + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08010264.inc b/data/scripts/script_08010264.inc new file mode 100644 index 00000000..eac67e79 --- /dev/null +++ b/data/scripts/script_08010264.inc @@ -0,0 +1,537 @@ +SCRIPT_START script_08010264 + BeginBlock + DoPostScriptAction 0x0007 + _0807E9D4 + DoPostScriptAction 0x000a + _0807EB44 0x0006 + DoPostScriptAction 0x0000 + EndBlock +script_0801027A: + CheckEntityInteractType + JumpIfNot script_0801027A + _0807E864 + _0807EB74 + Call sub_08065F64 + _0807EA94 + _0807E878 + Jump script_0801027A + .2byte 0x0000 + BeginBlock + DoPostScriptAction 0x0000 + Call sub_08062A48 + DoPostScriptAction 0x000a + EndBlock +script_080102A6: + CheckEntityInteractType + JumpIfNot script_080102A6 + CheckRoomFlag 0x0009 + JumpIfNot script_080102CC + _0807E864 + _0807EB74 + Call sub_0806265C + _0807EA94 + _0807E878 + Call sub_08062500 + Jump script_080102A6 +script_080102CC: + _0807E864 + _0807EB74 + Call sub_0806265C + _0807EA94 + _0807E878 + Jump script_080102A6 + .2byte 0x0000 + BeginBlock + DoPostScriptAction 0x0000 + Call sub_08062A48 + DoPostScriptAction 0x000a + EndBlock +script_080102F2: + CheckEntityInteractType + JumpIfNot script_080102F2 + _0807E864 + _0807EB74 + Call sub_0806265C + _0807EA94 + _0807E878 + Jump script_080102F2 + .2byte 0x0000 + BeginBlock + DoPostScriptAction 0x0000 + EndBlock +script_08010314: + EndBlock + Call sub_08062698 + Call sub_080626AC + CallWithArg sub_0807F0EC, 0x00000009 + JumpTable script_08010340, script_0801034A, script_08010354, script_0801035E, script_08010368, script_08010372, script_0801037C, script_08010386, script_08010390 +script_08010340: + _0807EE04 0x0358, 0x0078 + Jump script_08010396 +script_0801034A: + _0807EE04 0x0390, 0x0078 + Jump script_08010396 +script_08010354: + _0807EE04 0x03c8, 0x0078 + Jump script_08010396 +script_0801035E: + _0807EE04 0x0358, 0x0098 + Jump script_08010396 +script_08010368: + _0807EE04 0x0390, 0x0098 + Jump script_08010396 +script_08010372: + _0807EE04 0x03c8, 0x0098 + Jump script_08010396 +script_0801037C: + _0807EE04 0x0358, 0x00b8 + Jump script_08010396 +script_08010386: + _0807EE04 0x0390, 0x00b8 + Jump script_08010396 +script_08010390: + _0807EE04 0x03c8, 0x00b8 +script_08010396: + EndBlock + BeginBlock + Call sub_080626C0 + JumpIf script_08010314 + _0807EE30 + JumpIfNot script_08010396 + Jump script_08010314 + .2byte 0x0000 + BeginBlock + DoPostScriptAction 0x0000 + Call sub_08062A48 + DoPostScriptAction 0x000a + EndBlock +script_080103C2: + Wait 0x001e + Call sub_08062948 + Jump script_080103C2 + BeginBlock + _0807E9D4 + _0807EB44 0x0004 + DoPostScriptAction 0x000a + CallWithArg sub_0807F3D8, 0x00000004 + EndBlock +script_080103E8: + Wait 0x003c + Call sub_0806407C + Jump script_080103E8 + .2byte 0x0000 + BeginBlock + _0807E9D4 + _0807EB44 0x0004 + DoPostScriptAction 0x000a + CallWithArg sub_0807F3D8, 0x00000000 + EndBlock +script_08010410: + CheckEntityInteractType + JumpIfNot script_08010410 + _0807E864 + _0807EB74 + Call sub_08064428 + _0807EA94 + _0807E878 + Jump script_08010410 + BeginBlock + _0807E9D4 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + DoPostScriptAction 0x000a + SetIntVariable sub_08064688 + Call sub_08064644 + EndBlock +script_08010446: + Wait 0x003c + Call sub_080646A4 + Jump script_08010446 + BeginBlock + _0807EB44 0x0004 + _0807E930 0x0000 + Call sub_080636F4 + DoPostScriptAction 0x000a + Call sub_0807F348 + EndBlock +script_08010470: + CheckEntityInteractType + JumpIfNot script_08010470 + _0807E864 + _0807EB74 + CallWithArg sub_0807F3D8, 0x00000004 + Call sub_080636D8 + _0807EA94 + Wait 0x000f + _0807E878 + CallWithArg sub_0807F3D8, 0x00000000 + Jump script_08010470 + BeginBlock + _0807EB44 0x0004 + _0807E930 0x0000 + Call sub_08063CAC + DoPostScriptAction 0x000a + Call sub_0807F348 + EndBlock +script_080104BC: + CheckEntityInteractType + JumpIfNot script_080104BC + _0807E864 + _0807EB74 + CallWithArg sub_0807F3D8, 0x00000004 + Call sub_08063C90 + _0807EA94 + Wait 0x000f + _0807E878 + CallWithArg sub_0807F3D8, 0x00000000 + Jump script_080104BC + BeginBlock + _0807EB44 0x0004 + _0807E930 0x0000 + DoPostScriptAction 0x000a + Call sub_0807F348 + EndBlock +script_08010502: + CheckEntityInteractType + JumpIfNot script_08010502 + _0807E864 + Call sub_0807DF28 + _0807EB74 + CallWithArg sub_0807F3D8, 0x00000008 + CheckRoomFlag 0x000e + JumpIf script_0801052E + SetRoomFlag 0x000e + TextboxNoOverlap 0x2b10 + _0807EA94 +script_0801052E: + Call sub_080634E4 + JumpTable script_08010544, script_08010558, script_08010570, script_08010570, script_0801054C, script_08010564, script_08010570 +script_08010544: + TextboxNoOverlap 0x2b0d + Jump script_080105E0 +script_0801054C: + CheckGlobalFlag 0x003d + JumpIfNot script_080105DC + Jump script_08010570 +script_08010558: + CheckGlobalFlag 0x003c + JumpIfNot script_080105DC + Jump script_08010570 +script_08010564: + CheckGlobalFlag 0x003b + JumpIfNot script_080105DC + Jump script_08010570 +script_08010570: + Call sub_080634EC + CallWithArg sub_0807F78C, 0x00000000 + _0807EA94 + _0807E3E8 + JumpIfNot script_080105E0 + CallWithArg sub_0807F7C4, 0x00000000 + JumpIfNot script_080105C4 + _0807E48C 0x0020 + JumpIfNot script_080105CC + Call sub_08063504 + JumpIf script_080105D4 + TextboxNoOverlap 0x2b07 + _0807EA94 + CallWithArg sub_0807F800, 0x00000000 + WaitPlayerAction8 + _0807EA94 + TextboxNoOverlap 0x2b0c + Jump script_080105E0 +script_080105C4: + TextboxNoOverlap 0x2b09 + Jump script_080105E0 +script_080105CC: + TextboxNoOverlap 0x2b0a + Jump script_080105E0 +script_080105D4: + TextboxNoOverlap 0x2b0b + Jump script_080105E0 +script_080105DC: + TextboxNoOverlap 0x2b0e +script_080105E0: + _0807EA94 + Call sub_0807DF50 + _0807E878 + Jump script_08010502 + .2byte 0x0000 + BeginBlock + _0807E9D4 + DoPostScriptAction 0x000a + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + EndBlock +script_08010602: + CheckEntityInteractType + JumpIfNot script_08010602 + _0807E864 + _0807EB74 + TextboxNoOverlapFollow 0x0a01 + _0807EA94 + _0807E878 + _0807EB44 0x0004 + Jump script_08010602 + BeginBlock + _0807E930 0x0008 +script_08010622: + Call sub_08062A48 + DoPostScriptAction 0x000a + EndBlock +script_0801062E: + CheckEntityInteractType + JumpIfNot script_0801062E + _0807E864 + Call sub_0806265C + _0807EA94 + _0807E878 + Jump script_0801062E + BeginBlock + _0807E930 0x0009 + Jump script_08010622 + .2byte 0x0000 + BeginBlock + _0807E930 0x000b + Jump script_08010622 + .2byte 0x0000 + BeginBlock + _0807E930 0x000c + Jump script_08010622 + .2byte 0x0000 + BeginBlock + _0807E930 0x000d + Jump script_08010622 + .2byte 0x0000 + BeginBlock + _0807E9D4 + DoPostScriptAction 0x000a + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + EndBlock +script_08010686: + CheckEntityInteractType + JumpIfNot script_08010686 + _0807E864 + _0807EB74 + HasRoomItemForSale + Call sub_0807F77C + TextboxNoOverlapFollowTable 0x3c08, 0x3c09 + _0807EA94 + _0807E878 + _0807EB44 0x0004 + Jump script_08010686 + .2byte 0x0000 + BeginBlock + _0807E9D4 + DoPostScriptAction 0x000a + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + EndBlock +script_080106BE: + CheckEntityInteractType + JumpIfNot script_080106BE + _0807E864 + _0807EB74 + Call sub_0807F2D4 + DoPostScriptAction 0x0000 + HasRoomItemForSale + JumpIf script_080106E0 + TextboxNoOverlap 0x3c07 + Jump script_08010726 +script_080106E0: + Call sub_08062EB8 + CallWithArg sub_0807F78C, 0x00000000 + _0807EA94 + _0807E3E8 + JumpIfNot script_08010726 + _0807EA94 + BuyItem 0x0000, 0x0000 + JumpIf script_0801070C + TextboxNoOverlap 0x3c04 + Jump script_08010726 +script_0801070C: + WaitPlayerAction8 + ModHealth 0x0008 + Call sub_08062EDC + JumpIf script_08010724 + TextboxNoOverlap 0x3c06 + Jump script_08010726 +script_08010724: + WaitPlayerAction8 +script_08010726: + _0807EA94 + _0807E878 + DoPostScriptAction 0x0001 + Jump script_080106BE + .2byte 0x0000 + BeginBlock + DoPostScriptAction 0x0007 + _0807E9D4 + DoPostScriptAction 0x000a + _0807E930 0x0000 + EndBlock +script_08010746: + CheckEntityInteractType + JumpIfNot script_08010746 + _0807E864 + _0807E930 0x0004 + BeginBlock + Call sub_08062D18 + JumpIfNot script_08010786 + EndBlock + _0807EA94 + _0807E3E8 + JumpIfNot script_08010786 + HasRupees 0x00c8 + JumpIf script_08010778 + TextboxNoOverlap 0x4008 + Jump script_08010786 +script_08010778: + ModRupees 0xff38 + Call sub_08062E14 + TextboxNoOverlap 0x4007 +script_08010786: + EndBlock + _0807EA94 + _0807E878 + _0807E930 0x0008 + Jump script_08010746 + BeginBlock + DoPostScriptAction 0x0007 + _0807E9D4 + DoPostScriptAction 0x000a + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + EndBlock +script_080107AA: + CheckEntityInteractType + JumpIfNot script_080107AA + _0807E864 + Call sub_0807F2D4 + DoPostScriptAction 0x0001 + Call sub_08062CBC + _0807EA94 + _0807E878 + DoPostScriptAction 0x0000 + Jump script_080107AA + .2byte 0x0000 + BeginBlock + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + DoPostScriptAction 0x000a + DoPostScriptAction 0x0007 + _0807E9D4 + Call sub_0807F348 + Call sub_08069684 + EndBlock +script_080107F2: + EndBlock + BeginBlock + CheckPlayerInRegion2 0x3030 + JumpIfNot script_080107F2 + Call sub_080696B0 +script_08010804: + EndBlock + BeginBlock + CheckPlayerInRegion2 0x3030 + JumpIfNot script_080107F2 + HasRoomItemForSale + JumpIf script_08010860 + CheckEntityInteractType + JumpIfNot script_08010804 + EndBlock + _0807E864 + Call sub_0807DF28 + _0807EB74 + CheckGlobalFlag 0x0042 + JumpIfNot script_08010858 + CheckGlobalFlag 0x0043 + JumpIfNot script_08010858 + CheckGlobalFlag 0x0044 + JumpIfNot script_08010858 + CheckGlobalFlag 0x0041 + JumpIfNot script_08010850 + TextboxNoOverlap 0x3f39 + Jump script_080108BA +script_08010850: + TextboxNoOverlap 0x2c1b + Jump script_080108BA +script_08010858: + TextboxNoOverlap 0x2c1a + Jump script_080108BA +script_08010860: + EndBlock + _0807E864 + Call sub_0807DF38 + _0807EB74 + Call sub_08069660 + _0807EA94 + _0807E3E8 + JumpIfNot script_080108B2 + Call sub_08069718 + JumpIfNot script_080108B2 + WaitPlayerAction8 + _0807EA94 + _0807EB8C + CheckGlobalFlag 0x0042 + JumpIfNot script_080108AA + CheckGlobalFlag 0x0043 + JumpIfNot script_080108AA + CheckGlobalFlag 0x0044 + JumpIfNot script_080108AA + TextboxNoOverlap 0x2c21 + Jump script_080108B2 +script_080108AA: + SetLocalFlag 0x00fa + TextboxNoOverlap 0x2c20 +script_080108B2: + _0807EA94 + Call sub_0807F83C +script_080108BA: + _0807EA94 + Call sub_0807DF50 + _0807E878 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + Jump script_08010804 +script_080108D0: + CheckPlayerInRegion2 0x0808 + JumpIfNot script_080108D0 + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 + StartPlayerScript script_080109F0 + WaitForSomething2 0x00000001 + CheckRoomFlag 0x0001 + JumpIf script_08010900 + _0807EB28 0x0b63 + _0807EA94 +script_08010900: + Call sub_0807DF50 + _0807E878 + Jump script_080108D0 + BeginBlock + DoPostScriptAction 0x0007 + CheckKinstoneFused 0x001b + JumpIf script_0800EF92 + EndBlock +script_0801091C: + Call sub_080869A4 + JumpIfNot script_0801091C + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 + CheckRoomFlag 0x0001 + JumpIf script_08010942 + _0807EB28 0x0b62 + _0807EA94 +script_08010942: + StartPlayerScript script_080109F0 + WaitForSomething2 0x00000001 + Call sub_0807DF50 + _0807E878 + Jump script_0801091C + Call sub_0808692C +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08010964.inc b/data/scripts/script_08010964.inc new file mode 100644 index 00000000..46a97af4 --- /dev/null +++ b/data/scripts/script_08010964.inc @@ -0,0 +1,40 @@ +SCRIPT_START script_08010964 + CheckPlayerInRegion2 0x0808 + JumpIfNot script_08010964 + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 + StartPlayerScript script_08010A38 + WaitForSomething2 0x00000001 + CheckRoomFlag 0x0001 + JumpIf script_08010994 + _0807EB28 0x0b63 + _0807EA94 +script_08010994: + Call sub_0807DF50 + _0807E878 + Jump script_08010964 +script_080109A0: + BeginBlock + EndBlock + CheckLocalFlag 0x00d1 + JumpIf script_080109EA + CheckPlayerInRegion2 0x0808 + JumpIfNot script_080109A0 + EndBlock + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 + StartPlayerScript script_08010A38 + WaitForSomething2 0x00000001 + CheckRoomFlag 0x0001 + JumpIf script_080109DE + _0807EB28 0x0b64 + _0807EA94 +script_080109DE: + Call sub_0807DF50 + _0807E878 + Jump script_080109A0 +script_080109EA: + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_080109F0.inc b/data/scripts/script_080109F0.inc new file mode 100644 index 00000000..dd5e7093 --- /dev/null +++ b/data/scripts/script_080109F0.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_080109F0 + BeginBlock + SetEntitySpeed 0x0100 + EndBlock + _0807ECC4 0x0010 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000001 + Call sub_080791BC +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08010A14.inc b/data/scripts/script_08010A14.inc new file mode 100644 index 00000000..6d0a7712 --- /dev/null +++ b/data/scripts/script_08010A14.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_08010A14 + BeginBlock + SetEntitySpeed 0x0100 + EndBlock + _0807EC64 0x0010 + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000001 + Call sub_080791BC +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08010A38.inc b/data/scripts/script_08010A38.inc new file mode 100644 index 00000000..36c00b7c --- /dev/null +++ b/data/scripts/script_08010A38.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_08010A38 + BeginBlock + SetEntitySpeed 0x0100 + EndBlock + _0807EC94 0x0010 + _0807EB44 0x0002 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000001 + Call sub_080791BC +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08010A5C.inc b/data/scripts/script_08010A5C.inc new file mode 100644 index 00000000..2cdf5764 --- /dev/null +++ b/data/scripts/script_08010A5C.inc @@ -0,0 +1,19 @@ +SCRIPT_START script_08010A5C + BeginBlock + Call sub_0807DF28 + _0807E864 + ModHealth 0x00a0 + EndBlock + Wait 0x003c + _0807E778 0x0004 + DoFade4 + WaitFor_2 +script_08010A78: + Call sub_0807F0D8 + JumpIfNot script_08010A78 + DoPostScriptAction 0x0014 + _0807E878 + Call sub_0807DF50 + Call sub_080791D0 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08010A98.inc b/data/scripts/script_08010A98.inc new file mode 100644 index 00000000..78022f8b --- /dev/null +++ b/data/scripts/script_08010A98.inc @@ -0,0 +1,60 @@ +SCRIPT_START script_08010A98 + BeginBlock + _0807EB44 0x0004 + CallWithArg sub_080672B0, 0x00000000 + DoPostScriptAction 0x000a + Call sub_08067314 + EndBlock +script_08010AB4: + CheckEntityInteractType + JumpIfNot script_08010AB4 + _0807E864 + _0807EB74 + CallWithArg sub_080672B0, 0x00000004 + Call sub_08067304 + _0807EA94 + _0807E878 + _0807EB44 0x0004 + CallWithArg sub_080672B0, 0x00000000 + Jump script_08010AB4 + BeginBlock + CheckInventory1 0x0067 + JumpIfNot script_08010B62 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + SetEntitySpeed 0x0180 + CallWithArg sub_0807F348 + Call sub_0806075C + EndBlock + _0807EA94 + Call sub_080606C0 +script_08010B10: + EndBlock + Call sub_0806076C + DoPostScriptAction 0x0007 +script_08010B1C: + Call sub_08060700 +script_08010B22: + EndBlock + BeginBlock + _0807E564 + JumpIf script_08010B3A + CallWithArg sub_080608E4, 0x00000000 + JumpIf script_08010B44 +script_08010B3A: + _0807EE30 + JumpIfNot script_08010B22 + Jump script_08010B10 +script_08010B44: + EndBlock + DoPostScriptAction 0x0000 +script_08010B4A: + EndBlock + BeginBlock + CallWithArg sub_080608E4, 0x00000001 + JumpIf script_08010B4A + EndBlock + Jump script_08010B1C +script_08010B62: + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_08010B68.inc b/data/scripts/script_08010B68.inc new file mode 100644 index 00000000..44727354 --- /dev/null +++ b/data/scripts/script_08010B68.inc @@ -0,0 +1,28 @@ +SCRIPT_START script_08010B68 + BeginBlock + _0807E564 + JumpIfNot script_08010BAC + Call sub_0807F924 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + DoPostScriptAction 0x0007 + DoPostScriptAction 0x000a + EndBlock +script_08010B88: + EndBlock + BeginBlock + _0807E564 + JumpIfNot script_08010BAC + CheckEntityInteractType + JumpIfNot script_08010B88 + EndBlock + _0807E864 + _0807EB74 + Call sub_0806E2DC + _0807EA94 + _0807E878 + Jump script_08010B88 +script_08010BAC: + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08010BB4.inc b/data/scripts/script_08010BB4.inc new file mode 100644 index 00000000..34745b7b --- /dev/null +++ b/data/scripts/script_08010BB4.inc @@ -0,0 +1,138 @@ +SCRIPT_START script_08010BB4 + BeginBlock + DoPostScriptAction 0x000a + _0807EB44 0x0004 + _0807E930 0x0008 + Call sub_0806E440 + EndBlock +script_08010BCA: + CheckEntityInteractType + JumpIfNot script_08010BCA + _0807E864 + _0807EB74 + DoPostScriptAction 0x0000 + Call sub_0806E418 + _0807EA94 + _0807E878 + _0807E930 0x0008 + Jump script_08010BCA + .2byte 0x0000 + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 + StartPlayerScript script_08011074 + WaitForSomething2 0x00000400 + _0807F078 0x0034, 0x0002 + TextboxNoOverlapFollowPos 0x1036, 0x000c + _0807EA94 + _0807E5F8 0x00000010 + WaitForSomething2 0x00000020 + TextboxNoOverlapFollowPos 0x1037, 0x0002 + _0807EA94 + _0807E5F8 0x00000010 + WaitForSomething2 0x00000020 + TextboxNoOverlapFollowPos 0x1038, 0x000c + _0807EA94 + SoundReq0x80100000 + _0807E778 0x0004 + DoFade5 + WaitFor_2 + Call sub_08064180 + Call sub_08064180 + Call sub_08064180 + Call sub_08064180 + Call sub_08064180 + Call sub_08064180 + Call sub_08064180 + Call sub_08064180 + LoadRoomEntityList gUnk_080F06E0 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000008 + StartPlayerScript script_08011098 + WaitForSomething2 0x00000400 + SetEntityPositionRelative 0x01f8, 0x0050 + _0807F0B4 0x0007 + CameraTargetEntity + Wait 0x000a + _0807F0B4 0x0001 + _0807E778 0x0001 + DoFade4 + _0807E5F8 0x0002a800 + WaitForSomething2 0x00055000 + SetEntityPositionRelative 0x01f8, 0x0078 + Wait 0x003c + _0807E5F8 0x00800000 + WaitForSomething2 0x01000000 + _0807E5F8 0x0002a800 + WaitForSomething2 0x00055000 + _0807E8E4_1 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000008 + TextboxNoOverlapFollowPos 0x1039, 0x000c + _0807EA94 + SoundReq2 0x0001 + _0807E8E4_2 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000008 + _0807E5F8 0x00000010 + _0807E5F8 0x00000040 + WaitForSomething2 0x00000020 + WaitForSomething2 0x00000080 + Wait 0x012c + _0807E5F8 0x00000004 + WaitForSomething2 0x00000008 + TextboxNoOverlapFollowPos 0x103a, 0x000c + _0807EA94 + SetEntityPositionRelative 0x01f8, 0x01c0 + _0807F0B4 0x0004 + Wait 0x0078 + _0807E5F8 0x00280000 + WaitForSomething2 0x00500000 + _0807E5F8 0x00000100 + SetEntityPositionRelative 0x01f8, 0x0220 + SetEntitySpeed 0x0100 + _0807EDD4 0x01f8, 0x0098 + Wait 0x003c + WaitForSomething2 0x00000200 + _0807E5F8 0x00280000 + SoundReq0x80100000 + SoundReq 0x009b + _0807E5F8 0x00000100 + WaitForSomething2 0x00000200 + TextboxNoOverlapFollowPos 0x1043, 0x0000 + _0807EA94 + SoundReq2 0x000d + _0807E5F8 0x00000100 + WaitForSomething2 0x00000200 + _0807E5F8 0x0002a800 + WaitForSomething2 0x00055000 + SoundReq 0x01c7 + SoundReq 0x00e5 + _0807E5F8 0x00000100 + _0807E5F8 0x00002800 + CallWithArg sub_0807FB28, 0x00000003 + WaitForSomething2 0x00000200 + WaitForSomething2 0x00005000 + _0807E5F8 0x00028000 + WaitForSomething2 0x00050000 + TextboxNoOverlapFollowPos 0x1044, 0x0000 + _0807EA94 + SetEntityPositionRelative 0x01f8, 0x0098 + SoundReq0x80100000 + Wait 0x003c + SoundReq2 0x002f + _0807E5F8 0x00028000 + _0807E5F8 0x00000100 + WaitForSomething2 0x00000200 + WaitForSomething2 0x00050000 + CallWithArg sub_0807FB28, 0x00000003 + SoundReq 0x00e5 + _0807E5F8 0x00028000 + WaitForSomething2 0x00050000 + SoundReq 0x0125 + CallWithArg sub_0807FB28, 0x00000003 + _0807E5F8 0x08000000 + _0807E5F8 0x00800000 + WaitForSomething2 0x01000000 + CallWithArg sub_0805DDEC, 0x00000002 + _0807F0C8 0xffff, 0x0000 diff --git a/data/scripts/script_08010E5A.inc b/data/scripts/script_08010E5A.inc new file mode 100644 index 00000000..7c9cb0f8 --- /dev/null +++ b/data/scripts/script_08010E5A.inc @@ -0,0 +1,55 @@ +SCRIPT_START script_08010E5A + Wait 0x001e + SoundReq 0x0125 + CallWithArg sub_0807FB28, 0x00000003 + Wait 0x003c + SoundReq 0x0125 + CallWithArg sub_0807FB28, 0x00000003 + Wait 0x0004 + SoundReq 0x0125 + CallWithArg sub_0807FB28, 0x00000003 + Wait 0x001e + SoundReq 0x012c + _0807E5F8 0x00800000 + WaitForSomething2 0x01000000 + _0807E778 0x0004 + DoFade7 + WaitFor_2 + Wait 0x003c + SoundReq 0x00ab + SoundReq 0x01c2 + LoadRoomEntityList gUnk_080F0770 + _0807E5F8 0x00000010 + WaitForSomething2 0x00000020 + _0807E778 0x0002 + DoFade6 + WaitFor_2 + CallWithArg sub_0805DE18, 0x00000002 + _0807F0C8 0x0000, 0x0000 + Call sub_0806DC3C + Call sub_080791BC + CallWithArg sub_0807F244, 0x0000000d + CallWithArg sub_0807F29C, gUnk_080049F6 + _0807F0B4 0x0001 + SetEntityPositionRelative 0x01f8, 0x0068 + _0807E5F8 0x00000004 + Wait 0x001e + _0807E5F8 0x00000040 + WaitForSomething2 0x00000008 + WaitForSomething2 0x00000080 + SoundReq 0x01c3 + _0807E5F8 0x20000000 + Wait 0x0078 + CallWithArg sub_0807F29C, 0x00000000 + Call sub_0806DC58 + _0807E5F8 0x40000000 + _0807E5F8 0x00000010 + _0807E5F8 0x00000100 + WaitForSomething2 0x00000020 + WaitForSomething2 0x00000200 + TextboxNoOverlapFollowPos 0x1045, 0x000c + _0807EA94 + TextboxNoOverlapFollowPos 0x1046, 0x0000 + _0807EA94 + CallWithArg sub_0805DDEC, 0x00000002 + _0807F0C8 0xffff, 0x0000 diff --git a/data/scripts/script_08010F84.inc b/data/scripts/script_08010F84.inc new file mode 100644 index 00000000..ef33d17d --- /dev/null +++ b/data/scripts/script_08010F84.inc @@ -0,0 +1,44 @@ +SCRIPT_START script_08010F84 + Wait 0x003c + _0807E5F8 0x00000100 + WaitForSomething2 0x00000200 + StartPlayerScript script_080110BC + WaitForSomething2 0x00000400 + TextboxNoOverlapFollowPos 0x1047, 0x0000 + _0807EA94 + Call sub_0806DC3C + Call sub_080791BC + CallWithArg sub_0807F244, 0x0000000d + CallWithArg sub_0807F29C, gUnk_080049F6 + Wait 0x001e + _0807E5F8 0x00000100 + WaitForSomething2 0x00000200 + CallWithArg sub_0807F29C, 0x00000000 + Call sub_0806DC58 + Wait 0x003c + _0807E5F8 0x08000000 + SoundReq 0x0125 + CallWithArg sub_0807FB28, 0x00000003 + Wait 0x000f + SoundReq 0x0125 + CallWithArg sub_0807FB28, 0x00000003 + CallWithArg sub_0805DE18, 0x00000002 + _0807F0C8 0x0000, 0x0000 + _0807E5F8 0x00000010 + WaitForSomething2 0x00000020 + SoundReq0x80100000 + Wait 0x003c + TextboxNoOverlapFollowPos 0x104a, 0x0000 + _0807EA94 + _0807E5F8 0x00000100 + WaitForSomething2 0x00000200 + TextboxNoOverlapFollowPos 0x1049, 0x0000 + _0807EA94 + SetEntityPositionRelative 0x01f8, 0x0098 + Wait 0x0078 + _0807E5F8 0x00000100 + WaitForSomething2 0x00000200 + Call sub_0804BCDC + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08011074.inc b/data/scripts/script_08011074.inc new file mode 100644 index 00000000..43df8c6b --- /dev/null +++ b/data/scripts/script_08011074.inc @@ -0,0 +1,10 @@ +SCRIPT_START script_08011074 + BeginBlock + SetEntitySpeed 0x0080 + EndBlock + _0807EDD4 0x01e8, 0x0050 + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000400 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_08011098.inc b/data/scripts/script_08011098.inc new file mode 100644 index 00000000..ae79a2e7 --- /dev/null +++ b/data/scripts/script_08011098.inc @@ -0,0 +1,9 @@ +SCRIPT_START script_08011098 + SetEntityPositionRelative 0x01a8, 0x0058 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000400 + _0807E610 0x00000002 + EndBlock + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_080110BC.inc b/data/scripts/script_080110BC.inc new file mode 100644 index 00000000..7ca7f0c1 --- /dev/null +++ b/data/scripts/script_080110BC.inc @@ -0,0 +1,12 @@ +SCRIPT_START script_080110BC + BeginBlock + SetEntitySpeed 0x0040 + EndBlock + SetEntitySpeed 0x0200 + DoPostScriptAction 0x0001 + _0807EDD4 0x01d8, 0x0068 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000400 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_080110E8.inc b/data/scripts/script_080110E8.inc new file mode 100644 index 00000000..03f283c4 --- /dev/null +++ b/data/scripts/script_080110E8.inc @@ -0,0 +1,16 @@ +SCRIPT_START script_080110E8 + SoundReq 0x007a + _0807EB44 0x0004 + DoPostScriptAction 0x000d + SoundReq 0x0086 + Call sub_0807F36C + SetEntitySpeed 0x0400 + _0807ECF4 0x0008 + BeginBlock + Call sub_0807F1E8 + DoPostScriptAction 0x0011 + EndBlock + Call sub_0807F2D4 + WaitForSomething 0x80000000 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_08011128.inc b/data/scripts/script_08011128.inc new file mode 100644 index 00000000..c8e34389 --- /dev/null +++ b/data/scripts/script_08011128.inc @@ -0,0 +1,37 @@ +SCRIPT_START script_08011128 + BeginBlock + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + EndBlock +script_08011134: + CheckPlayerInRegion 0x01f8, 0x0048, 0x1040 + JumpIfNot script_08011134 + LoadRoomEntityList gUnk_080F06B0 + DoPostScriptAction 0x000b + WaitForSomething2 0x00000004 + SetEntityPositionRelative 0x01b8, 0x0058 + _0807EB44 0x0004 + _0807E5F8 0x00000008 + WaitForSomething2 0x00000004 + _0807EB44 0x0006 + _0807E5F8 0x00000008 + WaitForSomething2 0x00000004 + _0807EB44 0x0004 + _0807E5F8 0x00000008 + WaitForSomething2 0x00000004 + SetEntitySpeed 0x0100 + DoPostScriptAction 0x0001 + _0807ECC4 0x0010 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000008 + WaitForSomething2 0x00000004 + DoPostScriptAction 0x0010 + Wait 0x001e + DoPostScriptAction 0x0010 + Call sub_0807F3C8 + SetEntitySpeed 0x0400 + SetEntityDirection 0x001c + _0807EC1C 0x003c + _0807E5F8 0x00000008 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_080111CC.inc b/data/scripts/script_080111CC.inc new file mode 100644 index 00000000..8756d389 --- /dev/null +++ b/data/scripts/script_080111CC.inc @@ -0,0 +1,55 @@ +SCRIPT_START script_080111CC + BeginBlock + DoPostScriptAction 0x0008 + SetEntitySpeed 0x0100 + Call sub_08066D04 + EndBlock + Call sub_0807F338 + WaitForSomething2 0x00000010 + Call sub_08066D14 + JumpIf script_080111F6 + MoveEntityToPlayer +script_080111F6: + Call sub_0807F8BC + JumpIf script_08011206 + SetEntityPositionRelative 0x01f8, 0x00b8 +script_08011206: + DoPostScriptAction 0x0007 + DoPostScriptAction 0x0001 + _0807EDD4 0x01f8, 0x0050 + _0807EB74 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000020 + WaitForSomething2 0x00000010 + DoPostScriptAction 0x0001 + _0807EDD4 0x01f8, 0x0020 + DoPostScriptAction 0x0008 + _0807E5F8 0x00000020 + WaitForSomething2 0x00000010 + DoPostScriptAction 0x0007 + DoPostScriptAction 0x0001 + SetEntitySpeed 0x0040 + _0807EDD4 0x01e8, 0x0040 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000020 + WaitForSomething2 0x00000010 + Call sub_08095810 + _0807E5F8 0x00000020 + WaitForSomething2 0x00000010 + DoPostScriptAction 0x0001 + _0807EDD4 0x01d8, 0x0058 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000020 + WaitForSomething2 0x00000010 + SoundReq 0x01c9 + DoPostScriptAction 0x0010 + Wait 0x0014 + Call sub_08066E20 + Wait 0x0014 + DoPostScriptAction 0x0010 + Call sub_0807F2D4 + SoundReq 0x01ca + _0807E5F8 0x00000020 + WaitForSomething2 0x00000010 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_080112C4.inc b/data/scripts/script_080112C4.inc new file mode 100644 index 00000000..2fa640e4 --- /dev/null +++ b/data/scripts/script_080112C4.inc @@ -0,0 +1,52 @@ +SCRIPT_START script_080112C4 + BeginBlock + DoPostScriptAction 0x0008 + SetEntitySpeed 0x0100 + Call sub_08095244 + Call sub_0807F338 + EndBlock + WaitForSomething 0x0002a800 + DoPostScriptAction 0x0007 + _0807E930 0x0006 + _0807ECC4 0x0010 + Wait 0x003c + _0807ECC4 0x0010 + Wait 0x003c + _0807ECC4 0x0010 + _0807E930 0x0002 + Call sub_08064050 + JumpTable script_08011312, script_080113AA, script_08011442, script_08011508 +script_08011312: + _0807E610 0x00000800 + _0807E5F8 0x00001000 + WaitForSomething2 0x00000800 + _0807E930 0x0007 + _0807EB44 0x0006 + _0807ECF4 0x0010 + _0807EB44 0x0004 + _0807E930 0x0002 + _0807E5F8 0x00001000 + WaitForSomething2 0x00000800 + DoPostScriptAction 0x0004 + Wait 0x003c + _0807E930 0x0012 + SoundReq 0x011e + Wait 0x003c + _0807E930 0x0014 + SetEntitySpeed 0x0100 + _0807EDD4 0x01f0, 0x0098 + _0807EDD4 0x01f0, 0x00c8 + _0807E930 0x0013 + _0807E5F8 0x00001000 + WaitForSomething2 0x00000800 + DoPostScriptAction 0x0010 + Wait 0x000a + DoPostScriptAction 0x0010 + Call sub_0807F3C8 + _0807E930 0x0014 + SetEntitySpeed 0x0400 + SetEntityDirection 0x001e + _0807EC1C 0x003c + _0807E5F8 0x00001000 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_080113AA.inc b/data/scripts/script_080113AA.inc new file mode 100644 index 00000000..847d0cf9 --- /dev/null +++ b/data/scripts/script_080113AA.inc @@ -0,0 +1,34 @@ +SCRIPT_START script_080113AA + _0807E610 0x00002000 + _0807E5F8 0x00004000 + WaitForSomething2 0x00002000 + _0807E930 0x0005 + _0807EB44 0x0002 + _0807EC94 0x0010 + _0807EB44 0x0004 + _0807E930 0x0002 + _0807E5F8 0x00004000 + WaitForSomething2 0x00002000 + DoPostScriptAction 0x0004 + Wait 0x003c + _0807E930 0x0012 + SoundReq 0x011e + Wait 0x003c + _0807E930 0x0014 + SetEntitySpeed 0x0100 + _0807EDD4 0x0200, 0x0098 + _0807EDD4 0x0200, 0x00c8 + _0807E930 0x0013 + _0807E5F8 0x00004000 + WaitForSomething2 0x00002000 + DoPostScriptAction 0x0010 + Wait 0x000a + DoPostScriptAction 0x0010 + Call sub_0807F3C8 + _0807E930 0x0014 + SetEntitySpeed 0x0400 + SetEntityDirection 0x0002 + _0807EC1C 0x003c + _0807E5F8 0x00004000 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_08011442.inc b/data/scripts/script_08011442.inc new file mode 100644 index 00000000..f2eb4214 --- /dev/null +++ b/data/scripts/script_08011442.inc @@ -0,0 +1,43 @@ +SCRIPT_START script_08011442 + _0807E610 0x00008000 + _0807E5F8 0x00010000 + WaitForSomething2 0x00008000 + _0807E930 0x0007 + _0807EB44 0x0006 + _0807ECF4 0x0020 + _0807EB44 0x0004 + _0807E930 0x0006 + _0807ECC4 0x0010 + _0807E930 0x0002 + _0807E5F8 0x00010000 + WaitForSomething2 0x00008000 + DoPostScriptAction 0x0004 + Wait 0x003c + _0807E930 0x0012 + SoundReq 0x011e + _0807E5F8 0x00010000 + WaitForSomething2 0x00008000 + _0807E930 0x0014 + SetEntitySpeed 0x0100 + _0807EDD4 0x01e8, 0x0098 + SetEntitySpeed 0x0040 + _0807EEF4 0x0000, 0x0010 + _0807E930 0x0013 + _0807E5F8 0x00010000 + WaitForSomething2 0x00008000 + DoPostScriptAction 0x000d + _0807E930 0x0014 + SetEntitySpeed 0x0020 + _0807EEF4 0x0000, 0xfff0 + _0807E930 0x0013 + DoPostScriptAction 0x0010 + _0807E5F8 0x00010000 + WaitForSomething2 0x00008000 + Call sub_0807F3C8 + _0807E930 0x0014 + SetEntitySpeed 0x0400 + SetEntityDirection 0x001e + _0807EC1C 0x003c + _0807E5F8 0x00010000 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_08011508.inc b/data/scripts/script_08011508.inc new file mode 100644 index 00000000..bc282731 --- /dev/null +++ b/data/scripts/script_08011508.inc @@ -0,0 +1,44 @@ +SCRIPT_START script_08011508 + _0807E610 0x00020000 + _0807E5F8 0x00040000 + WaitForSomething2 0x00020000 + _0807E930 0x0005 + _0807EB44 0x0002 + _0807EC94 0x0020 + _0807EB44 0x0004 + _0807E930 0x0006 + _0807ECC4 0x0010 + _0807E930 0x0002 + _0807E5F8 0x00040000 + WaitForSomething2 0x00020000 + DoPostScriptAction 0x0004 + Wait 0x003c + _0807E930 0x0012 + SoundReq 0x011e + _0807E5F8 0x00040000 + WaitForSomething2 0x00020000 + _0807E930 0x0014 + SetEntitySpeed 0x0100 + _0807EDD4 0x0208, 0x0098 + SetEntitySpeed 0x0040 + _0807EEF4 0x0000, 0x0010 + _0807E930 0x0013 + _0807E5F8 0x00040000 + WaitForSomething2 0x00020000 + DoPostScriptAction 0x000d + _0807E930 0x0014 + SetEntitySpeed 0x0020 + _0807EEF4 0x0000, 0xfff0 + _0807E930 0x0013 + DoPostScriptAction 0x0010 + _0807E5F8 0x00040000 + WaitForSomething2 0x00020000 + Call sub_0807F3C8 + _0807E930 0x0014 + SetEntitySpeed 0x0400 + SetEntityDirection 0x0002 + _0807EC1C 0x003c + _0807E5F8 0x00040000 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_080115D0.inc b/data/scripts/script_080115D0.inc new file mode 100644 index 00000000..ee570b92 --- /dev/null +++ b/data/scripts/script_080115D0.inc @@ -0,0 +1,15 @@ +SCRIPT_START script_080115D0 + BeginBlock + SetEntitySpeed 0x0100 + _0807EB44 0x0002 + _0807E930 0x0001 + EndBlock + WaitForSomething2 0x00080000 + _0807E930 0x0005 + SoundReq 0x011c + _0807ECF4 0x0010 + _0807E930 0x0001 + _0807E5F8 0x00100000 + WaitForSomething2 0x00080000 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_08011608.inc b/data/scripts/script_08011608.inc new file mode 100644 index 00000000..957a381c --- /dev/null +++ b/data/scripts/script_08011608.inc @@ -0,0 +1,15 @@ +SCRIPT_START script_08011608 + BeginBlock + SetEntitySpeed 0x0100 + _0807EB44 0x0006 + _0807E930 0x0003 + EndBlock + WaitForSomething2 0x00200000 + _0807E930 0x0007 + SoundReq 0x011c + _0807EC94 0x0010 + _0807E930 0x0003 + _0807E5F8 0x00400000 + WaitForSomething2 0x00200000 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_08011640.inc b/data/scripts/script_08011640.inc new file mode 100644 index 00000000..13deb024 --- /dev/null +++ b/data/scripts/script_08011640.inc @@ -0,0 +1,25 @@ +SCRIPT_START script_08011640 + BeginBlock + DoPostScriptAction 0x0008 + _0807EB44 0x0004 + SetEntitySpeed 0x0100 + EndBlock + Call sub_0807F338 + WaitForSomething2 0x00000040 + DoPostScriptAction 0x0007 + DoPostScriptAction 0x0001 + SetEntitySpeed 0x0040 + _0807EDD4 0x01f8, 0x0048 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000080 + WaitForSomething2 0x00000040 + DoPostScriptAction 0x0010 + Wait 0x001e + DoPostScriptAction 0x0010 + Call sub_0807F3C8 + SetEntitySpeed 0x0400 + SetEntityDirection 0x0008 + _0807EC1C 0x003c + _0807E5F8 0x00000080 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_080116A8.inc b/data/scripts/script_080116A8.inc new file mode 100644 index 00000000..f931651a --- /dev/null +++ b/data/scripts/script_080116A8.inc @@ -0,0 +1,85 @@ +SCRIPT_START script_080116A8 + BeginBlock + _0807EB44 0x0000 + SetEntitySpeed 0x0100 + EndBlock + Call sub_0807F338 + WaitForSomething2 0x00000100 + DoPostScriptAction 0x0001 + _0807EDD4 0x01f8, 0x00d0 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000200 + WaitForSomething2 0x00000100 + _0807EB44 0x0004 + DoPostScriptAction 0x001c + Call sub_0807F2D4 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000200 + WaitForSomething2 0x00000100 + _0807EB44 0x0000 + DoPostScriptAction 0x001c + Call sub_0807F2D4 + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000200 + WaitForSomething2 0x00000100 + _0807EB44 0x0000 + DoPostScriptAction 0x001a + Call sub_0807F2D4 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000200 + WaitForSomething2 0x00000100 + _0807EB44 0x0000 + DoPostScriptAction 0x0014 + SoundReq 0x0120 + CallWithArg sub_08095420, script_08011890 + Wait 0x00f0 + DoPostScriptAction 0x0016 + SoundReq 0x01cb + WaitForSomething2 0x10000000 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000200 + WaitForSomething2 0x00000100 + SetEntitySpeed 0x0080 + DoPostScriptAction 0x0001 + _0807EDD4 0x01d8, 0x00a8 + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000200 + WaitForSomething2 0x00000100 + DoPostScriptAction 0x0014 + SoundReq 0x01c4 + CallWithArg sub_0809545C, script_080118D4 + _0807E5F8 0x00000200 + WaitForSomething2 0x00000100 + Wait 0x003c + DoPostScriptAction 0x0016 + SoundReq 0x01c5 + _0807E5F8 0x08000000 + WaitForSomething2 0x10000000 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000200 + WaitForSomething2 0x00000100 + SetEntitySpeed 0x0100 + DoPostScriptAction 0x0001 + _0807EDD4 0x01f8, 0x0098 + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + DoPostScriptAction 0x0004 + Wait 0x005a + _0807EB44 0x0004 + DoPostScriptAction 0x001c + Call sub_0807F2D4 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + Wait 0x001e + _0807E5F8 0x00000200 + WaitForSomething2 0x00000100 + Call sub_08066CA4 + DoPostScriptAction 0x0008 + Wait 0x0078 + _0807E5F8 0x00000200 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0801183C.inc b/data/scripts/script_0801183C.inc new file mode 100644 index 00000000..09d8d177 --- /dev/null +++ b/data/scripts/script_0801183C.inc @@ -0,0 +1,19 @@ +SCRIPT_START script_0801183C + BeginBlock + Call sub_08095330 + EndBlock + WaitForSomething2 0x00800000 + _0807EF3C 0x0000, 0x0020 + _0807E5F8 0x01000000 + WaitForSomething2 0x00800000 + Call sub_08095364 + SoundReq 0x0122 + Wait 0x003c + _0807E5F8 0x01000000 + WaitForSomething2 0x00800000 + _0807E930 0x0002 + _0807E5F8 0x01000000 + WaitForSomething2 0x00800000 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08011890.inc b/data/scripts/script_08011890.inc new file mode 100644 index 00000000..3c6c2c90 --- /dev/null +++ b/data/scripts/script_08011890.inc @@ -0,0 +1,16 @@ +SCRIPT_START script_08011890 + BeginBlock + _0807E930 0x0000 + SetEntitySpeed 0x0200 + Call nullsub_527 + Call sub_08094B80 + EndBlock + Wait 0x00f0 + Call sub_08094B6C + _0807EDD4 0x01f8, 0x0088 + Call sub_08094B80 + SoundReq 0x01cc + _0807E5F8 0x10000000 + WaitForSomething2 0x08000000 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_080118D4.inc b/data/scripts/script_080118D4.inc new file mode 100644 index 00000000..5c14c403 --- /dev/null +++ b/data/scripts/script_080118D4.inc @@ -0,0 +1,21 @@ +SCRIPT_START script_080118D4 + BeginBlock + _0807E930 0x0000 + SetEntitySpeed 0x0200 + Call nullsub_527 + Call sub_08094B80 + EndBlock + WaitForSomething2 0x08000000 + Call sub_08094B6C + _0807EDD4 0x01d8, 0x0078 + StartPlayerScript script_080110E8 + _0807EDD4 0x01d8, 0x0058 + Call sub_08094B80 + SoundReq 0x009a + SoundReq 0x01c6 + _0807E5F8 0x10000000 + WaitForSomething2 0x08000000 + SoundReq 0x011d + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08011930.inc b/data/scripts/script_08011930.inc new file mode 100644 index 00000000..2dcc1588 --- /dev/null +++ b/data/scripts/script_08011930.inc @@ -0,0 +1,5 @@ +SCRIPT_START script_08011930 + WaitForSomething 0x20000000 + Call sub_0809567C +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08011940.inc b/data/scripts/script_08011940.inc new file mode 100644 index 00000000..0fdf418f --- /dev/null +++ b/data/scripts/script_08011940.inc @@ -0,0 +1,4 @@ +SCRIPT_START script_08011940 + WaitForSomething 0x40000000 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_0801194C.inc b/data/scripts/script_0801194C.inc new file mode 100644 index 00000000..7d19a55f --- /dev/null +++ b/data/scripts/script_0801194C.inc @@ -0,0 +1,137 @@ +SCRIPT_START script_0801194C + BeginBlock + _0807EB44 0x0002 + Jump script_0801196A + .2byte 0x0000 + BeginBlock + _0807EB44 0x0006 + Jump script_0801196A + .2byte 0x0000 + BeginBlock + _0807EB44 0x0004 +script_0801196A: + _0807E9D4 + DoPostScriptAction 0x000a + CallWithArg sub_0807F3D8, 0x00000000 + EndBlock +script_0801197C: + CheckEntityInteractType + JumpIfNot script_0801197C + _0807E864 + _0807EB74 + CallWithArg sub_0807F3D8, 0x00000000 + CheckGlobalFlag 0x0015 + JumpIf script_080119A0 + TextboxNoOverlapFollow 0x103d + Jump script_080119A4 +script_080119A0: + TextboxNoOverlapFollow 0x103f +script_080119A4: + _0807EA94 + Wait 0x000f + _0807E878 + Jump script_0801197C + BeginBlock + _0807E9D4 + _0807EB44 0x0004 + DoPostScriptAction 0x000a + CallWithArg sub_0807F3D8, 0x0000000c + EndBlock +script_080119C8: + Wait 0x003c + Call sub_0806407C + Jump script_080119C8 + .2byte 0x0000 + BeginBlock + _0807EB44 0x0002 + Jump script_080119F6 + .2byte 0x0000 + BeginBlock + _0807EB44 0x0004 + Jump script_080119F6 + .2byte 0x0000 + BeginBlock + _0807EB44 0x0006 +script_080119F6: + _0807E9D4 + DoPostScriptAction 0x000a + CallWithArg sub_0807F3D8, 0x00000000 + EndBlock +script_08011A08: + CheckEntityInteractType + JumpIfNot script_08011A08 + _0807E864 + _0807EB74 + CallWithArg sub_0807F3D8, 0x00000000 + Call sub_08064428 + _0807EA94 + _0807E878 + Jump script_08011A08 + .2byte 0x0000 + BeginBlock + _0807EB44 0x0004 + _0807E9D4 + DoPostScriptAction 0x000a + CallWithArg sub_0807F3D8, 0x00000000 + EndBlock +script_08011A44: + CheckEntityInteractType + JumpIfNot script_08011A44 + _0807E864 + _0807EB74 + CallWithArg sub_0807F3D8, 0x00000000 + TextboxNoOverlapFollow 0x1320 + _0807EA94 + _0807E878 + Jump script_08011A44 + BeginBlock + _0807EB44 0x0002 + _0807E9D4 + DoPostScriptAction 0x000a + CallWithArg sub_0807F3D8, 0x00000000 + EndBlock +script_08011A7C: + CheckEntityInteractType + JumpIfNot script_08011A7C + _0807E864 + _0807EB74 + CallWithArg sub_0807F3D8, 0x00000000 + CallWithArg sub_080644B4, 0x00000006 + JumpIf script_08011AFA + TextboxNoOverlapFollow 0x1320 + _0807EA94 + _0807E878 + Jump script_08011A7C + .2byte 0x0000 + BeginBlock + _0807EB44 0x0004 + _0807E9D4 + DoPostScriptAction 0x000a + CallWithArg sub_0807F3D8, 0x00000000 + EndBlock +script_08011AC4: + CheckEntityInteractType + JumpIfNot script_08011AC4 + _0807E864 + _0807EB74 + CallWithArg sub_0807F3D8, 0x00000000 + TextboxNoOverlapFollow 0x1322 + _0807EA94 + _0807E878 + Jump script_08011AC4 +script_08011AE4: + CheckRoomFlag 0x000f + JumpIfNot script_08011AE4 + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 +script_08011AFA: + TextboxNoOverlapFollowPos 0x1321, 0x0007 + _0807EA94 + SetLocalFlag 0x0010 + CallWithArg sub_0806DA1C, 0x00000003 + _0807E878 + Call sub_0807DF50 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08011B20.inc b/data/scripts/script_08011B20.inc new file mode 100644 index 00000000..0e870c50 --- /dev/null +++ b/data/scripts/script_08011B20.inc @@ -0,0 +1,10 @@ +SCRIPT_START script_08011B20 + _0807E864 + Call sub_0807DF28 + TextboxNoOverlapFollowPos 0x1320, 0x000c + _0807EA94 + _0807E878 + Call sub_0807DF50 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08011B40.inc b/data/scripts/script_08011B40.inc new file mode 100644 index 00000000..435cfc37 --- /dev/null +++ b/data/scripts/script_08011B40.inc @@ -0,0 +1,82 @@ +SCRIPT_START script_08011B40 + BeginBlock + _0807E9D4 + DoPostScriptAction 0x000a + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + EndBlock + CheckGlobalFlag 0x0050 + JumpIfNot script_08011B84 + WaitForSomething2 0x00000004 + _0807EB44 0x0006 + DoPostScriptAction 0x0004 + Wait 0x003c + _0807EB8C + TextboxNoOverlap 0x3d07 + _0807EA94 + _0807EB44 0x0004 + ClearGlobalFlag 0x0050 + Call sub_0807DF50 + _0807E878 +script_08011B84: + CheckEntityInteractType + JumpIfNot script_08011B84 + _0807E864 + _0807EB74 + TextboxNoOverlap 0x3d01 + _0807EA94 + _0807E3E8 + JumpIf script_08011BA4 +script_08011B9A: + _0807E878 + _0807EB44 0x0004 + Jump script_08011B84 +script_08011BA4: + HasRupees 0x000a + JumpIf script_08011BBC + DoPostScriptAction 0x0004 + Wait 0x003c + TextboxNoOverlap 0x3d05 + Jump script_08011B9A +script_08011BBC: + ModRupees 0xfff6 + Wait 0x001e + TextboxNoOverlap 0x3d06 + _0807EA94 + CallWithArg sub_0806C2A0, 0x00000000 + WaitFor_2 + Wait 0x003c + Call sub_0806C224 + Jump script_08011B9A + BeginBlock + _0807E888 + EndBlock + CallWithArg sub_0806C2A0, 0x00000001 + WaitFor_2 + Wait 0x003c + _0807E878 + SetRoomFlag 0x0000 + SoundReq2 0x0033 +script_08011C04: + CheckRoomFlag 0x0064 + JumpIfNot script_08011C04 + SoundReq0x80100000 + _0807E864 + Wait 0x003c + CameraTargetEntity + Wait 0x003c + Call Simon_CreateChest + Wait 0x003c + CameraTargetPlayer + _0807E878 +script_08011C28: + CheckLocalFlag 0x0001 + JumpIfNot script_08011C28 + _0807E888 + WaitPlayerAction8 + Wait 0x001e + CallWithArg sub_0806C2A0, 0x00000000 + WaitFor_2 + Wait 0x003c + Call sub_0806C280 +SCRIPT_END diff --git a/data/scripts/script_08011C50.inc b/data/scripts/script_08011C50.inc new file mode 100644 index 00000000..c74be3e5 --- /dev/null +++ b/data/scripts/script_08011C50.inc @@ -0,0 +1,13 @@ +SCRIPT_START script_08011C50 + BeginBlock + _0807E864 + EndBlock + Wait 0x003c + CallWithArg sub_0806C2A0, 0x00000001 + WaitFor_2 + Wait 0x003c + DoPostScriptAction 0x0014 + Wait 0x001e + _0807E5F8 0x00000004 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08011C7C.inc b/data/scripts/script_08011C7C.inc new file mode 100644 index 00000000..bd6a73f6 --- /dev/null +++ b/data/scripts/script_08011C7C.inc @@ -0,0 +1,575 @@ +SCRIPT_START script_08011C7C + BeginBlock + Call sub_08064828 + _0807EB44 0x0004 + DoPostScriptAction 0x0001 + DoPostScriptAction 0x000a + CheckGlobalFlag 0x0047 + JumpIf script_08011CC2 + EndBlock +script_08011C9A: + EndBlock + BeginBlock + CheckEntityInteractType + JumpIfNot script_08011C9A + EndBlock + _0807E864 + _0807EB74 + DoPostScriptAction 0x0000 + TextboxNoOverlap 0x4515 + _0807EA94 + _0807E878 + _0807EB44 0x0004 + DoPostScriptAction 0x0001 + Jump script_08011C9A +script_08011CC2: + EndBlock + BeginBlock + CheckGlobalFlag 0x002c + JumpIf script_08011C9A + CheckGlobalFlag 0x002d + JumpIf script_08011C9A + CheckEntityInteractType + JumpIfNot script_08011CC2 + EndBlock + _0807E864 + _0807EB74 + DoPostScriptAction 0x0000 + TextboxNoOverlap 0x3105 + _0807EA94 + _0807E3E8 + JumpIf script_08011D0E + _0807E878 + _0807EB44 0x0004 + DoPostScriptAction 0x0001 + Jump script_08011CC2 +script_08011D00: + CheckEntityInteractType + JumpIfNot script_08011D00 + _0807E864 + _0807EB74 + DoPostScriptAction 0x0000 +script_08011D0E: + TextboxNoOverlap 0x3108 + _0807EA94 + SetGlobalFlag 0x002b + _0807E878 + _0807EB44 0x0004 + DoPostScriptAction 0x0001 + Jump script_08011D00 + .2byte 0x0000 + BeginBlock + Call sub_08064928 + _0807EB44 0x0004 + DoPostScriptAction 0x0001 + DoPostScriptAction 0x000a + CheckGlobalFlag 0x0047 + JumpIf script_08011D6E + EndBlock +script_08011D46: + EndBlock + BeginBlock + CheckEntityInteractType + JumpIfNot script_08011D46 + EndBlock + _0807E864 + _0807EB74 + DoPostScriptAction 0x0000 + TextboxNoOverlap 0x4513 + _0807EA94 + _0807E878 + _0807EB44 0x0004 + DoPostScriptAction 0x0001 + Jump script_08011D46 +script_08011D6E: + EndBlock + BeginBlock + CheckGlobalFlag 0x002b + JumpIf script_08011D46 + CheckGlobalFlag 0x002d + JumpIf script_08011D46 + CheckEntityInteractType + JumpIfNot script_08011D6E + EndBlock + _0807E864 + _0807EB74 + DoPostScriptAction 0x0000 + TextboxNoOverlap 0x3103 + _0807EA94 + _0807E3E8 + JumpIf script_08011DBA + _0807E878 + _0807EB44 0x0004 + DoPostScriptAction 0x0001 + Jump script_08011D6E +script_08011DAC: + CheckEntityInteractType + JumpIfNot script_08011DAC + _0807E864 + _0807EB74 + DoPostScriptAction 0x0000 +script_08011DBA: + TextboxNoOverlap 0x3106 + _0807EA94 + SetGlobalFlag 0x002c + _0807E878 + _0807EB44 0x0004 + DoPostScriptAction 0x0001 + Jump script_08011DAC + .2byte 0x0000 + BeginBlock + Call sub_08064A28 + _0807EB44 0x0004 + DoPostScriptAction 0x0001 + DoPostScriptAction 0x000a + CheckGlobalFlag 0x0047 + JumpIf script_08011E1A + EndBlock +script_08011DF2: + EndBlock + BeginBlock + CheckEntityInteractType + JumpIfNot script_08011DF2 + EndBlock + _0807E864 + _0807EB74 + DoPostScriptAction 0x0000 + TextboxNoOverlap 0x4514 + _0807EA94 + _0807E878 + _0807EB44 0x0004 + DoPostScriptAction 0x0001 + Jump script_08011DF2 +script_08011E1A: + EndBlock + BeginBlock + CheckGlobalFlag 0x002b + JumpIf script_08011DF2 + CheckGlobalFlag 0x002c + JumpIf script_08011DF2 + CheckEntityInteractType + JumpIfNot script_08011E1A + EndBlock + _0807E864 + _0807EB74 + DoPostScriptAction 0x0000 + TextboxNoOverlap 0x3104 + _0807EA94 + _0807E3E8 + JumpIf script_08011E66 + _0807E878 + _0807EB44 0x0004 + DoPostScriptAction 0x0001 + Jump script_08011E1A +script_08011E58: + CheckEntityInteractType + JumpIfNot script_08011E58 + _0807E864 + _0807EB74 + DoPostScriptAction 0x0000 +script_08011E66: + TextboxNoOverlap 0x3107 + _0807EA94 + SetGlobalFlag 0x002d + _0807E878 + _0807EB44 0x0004 + DoPostScriptAction 0x0001 + Jump script_08011E58 + .2byte 0x0000 + BeginBlock + Call sub_08064828 + _0807EB44 0x0004 + DoPostScriptAction 0x0001 + DoPostScriptAction 0x000a + EndBlock +script_08011E96: + EndBlock + BeginBlock + CheckGlobalFlag 0x002f + JumpIf script_08011C9A + CheckGlobalFlag 0x0030 + JumpIf script_08011C9A + CheckEntityInteractType + JumpIfNot script_08011E96 + EndBlock + _0807E864 + _0807EB74 + DoPostScriptAction 0x0000 + CheckGlobalFlag 0x0048 + JumpIf script_08011ECC + TextboxNoOverlap 0x4524 + _0807EA94 + Jump script_08011ED8 +script_08011ECC: + TextboxNoOverlap 0x3111 + _0807EA94 + _0807E3E8 + JumpIf script_08011EF4 +script_08011ED8: + _0807E878 + _0807EB44 0x0004 + DoPostScriptAction 0x0001 + Jump script_08011E96 +script_08011EE6: + CheckEntityInteractType + JumpIfNot script_08011EE6 + _0807E864 + _0807EB74 + DoPostScriptAction 0x0000 +script_08011EF4: + TextboxNoOverlap 0x3114 + _0807EA94 + SetGlobalFlag 0x002e + _0807E878 + _0807EB44 0x0004 + DoPostScriptAction 0x0001 + Jump script_08011EE6 + BeginBlock + Call sub_08064928 + _0807EB44 0x0004 + DoPostScriptAction 0x0001 + DoPostScriptAction 0x000a + EndBlock +script_08011F22: + EndBlock + BeginBlock + CheckGlobalFlag 0x002e + JumpIf script_08011D46 + CheckGlobalFlag 0x0030 + JumpIf script_08011D46 + CheckEntityInteractType + JumpIfNot script_08011F22 + EndBlock + _0807E864 + _0807EB74 + DoPostScriptAction 0x0000 + CheckGlobalFlag 0x0048 + JumpIf script_08011F58 + TextboxNoOverlap 0x4522 + _0807EA94 + Jump script_08011F64 +script_08011F58: + TextboxNoOverlap 0x310f + _0807EA94 + _0807E3E8 + JumpIf script_08011F80 +script_08011F64: + _0807E878 + _0807EB44 0x0004 + DoPostScriptAction 0x0001 + Jump script_08011F22 +script_08011F72: + CheckEntityInteractType + JumpIfNot script_08011F72 + _0807E864 + _0807EB74 + DoPostScriptAction 0x0000 +script_08011F80: + TextboxNoOverlap 0x3112 + _0807EA94 + SetGlobalFlag 0x002f + _0807E878 + _0807EB44 0x0004 + DoPostScriptAction 0x0001 + Jump script_08011F72 + BeginBlock + Call sub_08064A28 + _0807EB44 0x0004 + DoPostScriptAction 0x0001 + DoPostScriptAction 0x000a + EndBlock +script_08011FAE: + EndBlock + BeginBlock + CheckGlobalFlag 0x002e + JumpIf script_08011DF2 + CheckGlobalFlag 0x002f + JumpIf script_08011DF2 + CheckEntityInteractType + JumpIfNot script_08011FAE + EndBlock + _0807E864 + _0807EB74 + DoPostScriptAction 0x0000 + CheckGlobalFlag 0x0048 + JumpIf script_08011FE4 + TextboxNoOverlap 0x4523 + _0807EA94 + Jump script_08011FF0 +script_08011FE4: + TextboxNoOverlap 0x3110 + _0807EA94 + _0807E3E8 + JumpIf script_0801200C +script_08011FF0: + _0807E878 + _0807EB44 0x0004 + DoPostScriptAction 0x0001 + Jump script_08011FAE +script_08011FFE: + CheckEntityInteractType + JumpIfNot script_08011FFE + _0807E864 + _0807EB74 + DoPostScriptAction 0x0000 +script_0801200C: + TextboxNoOverlap 0x3113 + _0807EA94 + SetGlobalFlag 0x0030 + _0807E878 + _0807EB44 0x0004 + DoPostScriptAction 0x0001 + Jump script_08011FFE + BeginBlock + Call sub_08064828 + _0807EB44 0x0004 + DoPostScriptAction 0x0001 + DoPostScriptAction 0x000a + EndBlock +script_0801203A: + CheckEntityInteractType + JumpIfNot script_0801203A + _0807E864 + _0807EB74 + DoPostScriptAction 0x0000 + CheckLocalFlag 0x0094 + JumpIf script_0801205E + TextboxNoOverlap 0x3122 + _0807EA94 + SetLocalFlag 0x0094 + Jump script_0801209E +script_0801205E: + _0807E48C 0x0031 + JumpIfNot script_08012070 + TextboxNoOverlap 0x3123 + _0807EA94 + Jump script_0801209E +script_08012070: + TextboxNoOverlap 0x3124 + _0807EA94 + _0807E3E8 + JumpIfNot script_0801209E + _0807E48C 0x0020 + JumpIfNot script_0801209A + TextboxNoOverlap 0x3125 + _0807EA94 + _0807F034 0x0031 + WaitPlayerAction8 + Call sub_0807FC24 + Jump script_0801209E +script_0801209A: + TextboxNoOverlap 0x3127 +script_0801209E: + _0807EA94 + _0807E878 + _0807EB44 0x0004 + DoPostScriptAction 0x0001 + Jump script_0801203A + .2byte 0x0000 + BeginBlock + Call sub_08064928 + _0807EB44 0x0004 + DoPostScriptAction 0x0001 + DoPostScriptAction 0x000a + EndBlock +script_080120C6: + CheckEntityInteractType + JumpIfNot script_080120C6 + _0807E864 + _0807EB74 + DoPostScriptAction 0x0000 + CheckLocalFlag 0x0095 + JumpIf script_080120EA + TextboxNoOverlap 0x3116 + _0807EA94 + SetLocalFlag 0x0095 + Jump script_0801212A +script_080120EA: + _0807E48C 0x002f + JumpIfNot script_080120FC + TextboxNoOverlap 0x3117 + _0807EA94 + Jump script_0801212A +script_080120FC: + TextboxNoOverlap 0x3118 + _0807EA94 + _0807E3E8 + JumpIfNot script_0801212A + _0807E48C 0x0020 + JumpIfNot script_08012126 + TextboxNoOverlap 0x3119 + _0807EA94 + _0807F034 0x002f + WaitPlayerAction8 + Call sub_0807FC24 + Jump script_0801212A +script_08012126: + TextboxNoOverlap 0x311b +script_0801212A: + _0807EA94 + _0807E878 + _0807EB44 0x0004 + DoPostScriptAction 0x0001 + Jump script_080120C6 + .2byte 0x0000 + BeginBlock + Call sub_08064A28 + _0807EB44 0x0004 + DoPostScriptAction 0x0001 + DoPostScriptAction 0x000a + EndBlock +script_08012152: + CheckEntityInteractType + JumpIfNot script_08012152 + _0807E864 + _0807EB74 + DoPostScriptAction 0x0000 + CheckLocalFlag 0x0096 + JumpIf script_08012176 + TextboxNoOverlap 0x311c + _0807EA94 + SetLocalFlag 0x0096 + Jump script_080121B6 +script_08012176: + _0807E48C 0x0030 + JumpIfNot script_08012188 + TextboxNoOverlap 0x311d + _0807EA94 + Jump script_080121B6 +script_08012188: + TextboxNoOverlap 0x311e + _0807EA94 + _0807E3E8 + JumpIfNot script_080121B6 + _0807E48C 0x0020 + JumpIfNot script_080121B2 + TextboxNoOverlap 0x311f + _0807EA94 + _0807F034 0x0030 + WaitPlayerAction8 + Call sub_0807FC24 + Jump script_080121B6 +script_080121B2: + TextboxNoOverlap 0x3121 +script_080121B6: + _0807EA94 + _0807E878 + _0807EB44 0x0004 + DoPostScriptAction 0x0001 + Jump script_08012152 + .2byte 0x0000 + BeginBlock + Call sub_08064828 + _0807EB44 0x0004 + DoPostScriptAction 0x0001 + DoPostScriptAction 0x000a + EndBlock +script_080121DE: + CheckEntityInteractType + JumpIfNot script_080121DE + _0807E864 + _0807EB74 + DoPostScriptAction 0x0000 + TextboxNoOverlap 0x4527 + _0807EA94 + _0807E878 + _0807EB44 0x0004 + DoPostScriptAction 0x0001 + Jump script_080121DE + BeginBlock + Call sub_08064928 + _0807EB44 0x0004 + DoPostScriptAction 0x0001 + DoPostScriptAction 0x000a + EndBlock +script_08012216: + CheckEntityInteractType + JumpIfNot script_08012216 + _0807E864 + _0807EB74 + DoPostScriptAction 0x0000 + TextboxNoOverlap 0x4525 + _0807EA94 + _0807E878 + _0807EB44 0x0004 + DoPostScriptAction 0x0001 + Jump script_08012216 + BeginBlock + Call sub_08064A28 + _0807EB44 0x0004 + DoPostScriptAction 0x0001 + DoPostScriptAction 0x000a + EndBlock +script_0801224E: + CheckEntityInteractType + JumpIfNot script_0801224E + _0807E864 + _0807EB74 + DoPostScriptAction 0x0000 + TextboxNoOverlap 0x4526 + _0807EA94 + _0807E878 + _0807EB44 0x0004 + DoPostScriptAction 0x0001 + Jump script_0801224E + BeginBlock + _0807EB44 0x0004 + Call sub_08061FD8 + _0807E9D4 + DoPostScriptAction 0x000a + EndBlock +script_08012284: + EndBlock + BeginBlock + CheckGlobalFlag 0x001e + JumpIfNot script_08012298 + CheckInventory1 0x0015 + JumpIf script_080122BA +script_08012298: + CheckEntityInteractType + JumpIfNot script_08012284 + EndBlock + _0807EB74 + _0807E864 + Call sub_08061FD8 + TextboxNoOverlapFollow 0x2302 + _0807EA94 + _0807E878 + SetGlobalFlag 0x001e + Jump script_08012284 +script_080122BA: + EndBlock + BeginBlock + CheckRoomFlag 0x0000 + JumpIfNot script_080122CE + CheckRoomFlag 0x0001 + JumpIf script_080122EC +script_080122CE: + CheckEntityInteractType + JumpIfNot script_080122BA + EndBlock + _0807EB74 + _0807E864 + Call sub_08061FD8 + TextboxNoOverlapFollow 0x2303 + _0807EA94 + _0807E878 + Jump script_080122BA +script_080122EC: + EndBlock + _0807EB74 + _0807E864 + Call sub_08061FD8 + DoPostScriptAction 0x000b + Call sub_08061FB0 + Call sub_08061F94 + LoadRoomEntityList gUnk_080F2758 + DoPostScriptAction 0x0008 + Wait 0x003c + SoundReq 0x0072 + SetLocalFlag 0x0043 + Wait 0x001e + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0801232C.inc b/data/scripts/script_0801232C.inc new file mode 100644 index 00000000..08b3dd09 --- /dev/null +++ b/data/scripts/script_0801232C.inc @@ -0,0 +1,71 @@ +SCRIPT_START script_0801232C + BeginBlock + _0807EB74 + _0807E9D4 + DoPostScriptAction 0x000a + EndBlock +script_08012338: + CheckEntityInteractType + JumpIfNot script_08012338 + _0807EB74 + _0807E864 + TextboxNoOverlapFollow 0x2304 + _0807EA94 + CheckLocalFlag 0x0042 + JumpIf script_0801235A + SetLocalFlag 0x0042 + _0807F034 0x0057 + WaitPlayerAction8 +script_0801235A: + _0807E878 + Jump script_08012338 + BeginBlock + DoPostScriptAction 0x0008 + EndBlock +script_08012368: + CheckLocalFlag 0x0004 + JumpIfNot script_08012368 + Call sub_0807DF28 + _0807E864 + SoundReq0x80100000 + BeginBlock + _0807E778 0x0004 + _0807E788 0x00007fff + DoFade5 + _0807E858 0x0080 + EndBlock + WaitFor_2 + SoundReq2 0x002c + _0807EB28 0x1401 + _0807EA94 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + DoPostScriptAction 0x0007 + SoundReq 0x01ce + SetEntity0x20 0xffff8000 + Wait 0x003c + _0807E8E4_0 + StartPlayerScript script_08012410 + WaitForSomething2 0x00000001 + TextboxNoOverlap 0x1402 + _0807EA94 + SoundReq0x80100000 + SetEntity0x20 0x00010000 + Wait 0x003c + BeginBlock + _0807E778 0x0004 + _0807E788 0xffffffff + DoFade4 + _0807E858 0x0080 + EndBlock + WaitFor_2 + SoundReq2 0xffff + _0807EB28 0x1403 + _0807EA94 + SetIntVariable 0x00000203 + Call sub_0807F420 + Call sub_0807DF50 + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08012410.inc b/data/scripts/script_08012410.inc new file mode 100644 index 00000000..089683a3 --- /dev/null +++ b/data/scripts/script_08012410.inc @@ -0,0 +1,10 @@ +SCRIPT_START script_08012410 + BeginBlock + SetEntitySpeed 0x0080 + EndBlock + DoPostScriptAction 0x0004 + Wait 0x003c + _0807E5F8 0x00000001 + Call sub_080791BC +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08012430.inc b/data/scripts/script_08012430.inc new file mode 100644 index 00000000..4827856a --- /dev/null +++ b/data/scripts/script_08012430.inc @@ -0,0 +1,159 @@ +SCRIPT_START script_08012430 + BeginBlock + DoPostScriptAction 0x000a + _0807EB44 0x0004 + _0807E930 0x0000 + EndBlock +script_08012440: + CheckEntityInteractType + JumpIfNot script_08012440 + _0807E864 + _0807E930 0x0008 + Call sub_0807F2D4 + _0807E930 0x0009 + Call sub_0806B2B4 + _0807EA94 + CheckLocalFlag 0x00b3 + JumpIf script_08012474 + SetLocalFlag 0x00b3 + _0807F034 0x0062 + WaitPlayerAction8 + SetLocalFlag 0x00d0 +script_08012474: + _0807E878 + _0807E930 0x0000 + Jump script_08012440 + .2byte 0x0000 + BeginBlock + Call sub_08054564 + EndBlock +script_0801248A: + CheckPlayerInRegion 0x0208, 0x02c8, 0x4020 + JumpIfNot script_0801248A + SoundReq0x80100000 + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 + StartPlayerScript script_08012AB0 + TextboxNoOverlapFollowPos 0x1101, 0x0007 + _0807EA94 + CameraTargetPlayer + _0807E778 0x0004 + _0807E80C 0x00000000 + WaitFor_2 + _0807E858 0x0000 + Call sub_080791BC + LoadRoomEntityList gUnk_080F4D70 + Call DeleteAllEnemies + SetEntityPositionRelative 0x0388, 0x0168 + Call sub_0807F844 + _0807E778 0x0004 + _0807E800 0x00000000 + WaitFor_2 + SoundReq2 0x000e + _0807E5F8 0x00000010 + WaitForSomething2 0x00000020 + WaitForSomething2 0x00000100 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000008 + _0807E5F8 0x00000040 + WaitForSomething2 0x00000080 + WaitForSomething2 0x00000100 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000008 + SoundReq0x80100000 + _0807E778 0x0004 + _0807E80C 0x00000000 + WaitFor_2 + MoveEntityToPlayer + Call sub_0807F844 + CameraTargetPlayer + _0807E788 0xffffffff + _0807E778 0x0004 + _0807E800 0x00000000 + WaitFor_2 + Call sub_0807DF50 + _0807E878 + SoundReq2 0xffff +script_08012566: + CheckPlayerInRegion 0x03a0, 0x01a0, 0x1020 + JumpIfNot script_08012566 + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 + Call sub_0806DC7C + SoundReq0x80100000 + StartPlayerScript script_08012AC8 + WaitForSomething2 0x00000001 + SetEntityPositionRelative 0x0388, 0x0168 + _0807F0B4 0x0001 + CameraTargetEntity + Wait 0x005a + _0807E5F8 0x00000004 + WaitForSomething2 0x00000008 + SoundReq2 0x000e + _0807E5F8 0x00000004 + WaitForSomething2 0x00000008 + _0807E5F8 0x00000040 + WaitForSomething2 0x00000080 + WaitForSomething2 0x00000100 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000008 + _0807E5F8 0x00000010 + WaitForSomething2 0x00000020 + WaitForSomething2 0x00000100 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000008 + SoundReq0x80100000 + SoundReq2 0x0033 + Call sub_0807DF50 + _0807E878 + _0807E5F8 0x00000050 + LoadRoomEntityList gUnk_080F51D0 + WaitForSomething2 0x00000008 + _0807E864 + Call sub_0807FA40 + Call sub_0807DF28 + SoundReq 0x0072 + SoundReq0x80100000 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000008 + StartPlayerScript script_08012AF0 + WaitForSomething2 0x00000001 + _0807E8E4_0 + SoundReq2 0x000e + Wait 0x001e + _0807E5F8 0x00000004 + WaitForSomething2 0x00000008 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000008 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000008 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000008 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000008 + SoundReq0x80100000 + Wait 0x003c + SoundReq2 0xffff + Call sub_0806DCA0 + _0807F0B4 0x0004 + CameraTargetPlayer + Call sub_0807DF50 + _0807E878 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000008 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000008 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000008 + SoundReq0x80100000 + Wait 0x003c + SoundReq2 0xffff + Call sub_08054570 + SetGlobalFlag 0x0014 + CallWithArg sub_0807F6F8, 0x00000008 + Call sub_0807DF50 + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_080126FC.inc b/data/scripts/script_080126FC.inc new file mode 100644 index 00000000..90957ad6 --- /dev/null +++ b/data/scripts/script_080126FC.inc @@ -0,0 +1,243 @@ +SCRIPT_START script_080126FC + BeginBlock + SetEntitySpeed 0x0040 + DoPostScriptAction 0x0007 + EndBlock + _0807E930 0x0020 + WaitForSomething2 0x00000004 + _0807E930 0x0022 + Call sub_0807F3C8 + TextboxNoOverlapFollowPos 0x1102, 0x000c + _0807EA94 + _0807E930 0x0020 + _0807E5F8 0x00000008 + WaitForSomething2 0x00000004 + _0807E930 0x0021 + Call sub_0807F3C8 + TextboxNoOverlapFollowPos 0x1103, 0x000c + _0807EA94 + _0807E930 0x0020 + _0807E5F8 0x00000008 + WaitForSomething2 0x00000004 + DoPostScriptAction 0x0004 + Wait 0x003c + _0807E5F8 0x00000008 + WaitForSomething2 0x00000004 + DoPostScriptAction 0x0011 + _0807E930 0x001c + TextboxNoOverlapFollowPos 0x1105, 0x000c + _0807EA94 + _0807E930 0x0020 + _0807E5F8 0x00000008 + WaitForSomething2 0x00000004 + _0807E930 0x0022 + Call sub_0807F3C8 + TextboxNoOverlapFollowPos 0x1106, 0x000c + _0807EA94 + _0807E930 0x001c + Call sub_0806D96C + TextboxNoOverlapFollowPos 0x1107, 0x000c + _0807EA94 + _0807E930 0x0020 + _0807E5F8 0x00000008 + WaitForSomething2 0x00000004 + _0807E930 0x0021 + Call sub_0807F3C8 + TextboxNoOverlapFollowPos 0x1108, 0x000c + _0807EA94 + _0807E930 0x001c + Call sub_0806D96C + TextboxNoOverlapFollowPos 0x1109, 0x000c + _0807EA94 + _0807E930 0x0020 + DoPostScriptAction 0x000a + _0807E9D4 + _0807E5F8 0x00000008 +script_080127F2: + EndBlock + BeginBlock + CheckRoomFlag 0x0000 + JumpIf script_08012824 + CheckEntityInteractType + JumpIfNot script_080127F2 + EndBlock + _0807E864 + Call sub_0806D944 + _0807E930 0x0010 + TextboxNoOverlapFollowPos 0x1114, 0x000c + _0807EA94 + _0807E930 0x0020 + _0807E878 + Jump script_080127F2 +script_08012824: + _0807E864 + _0807E9DC + CallWithArg sub_0807F5B0, 0x0000003c + Call sub_080791D0 + EndBlock + _0807E5F8 0x00000008 + WaitForSomething2 0x00000004 + DoPostScriptAction 0x000b + _0807E5F8 0x00000008 + WaitForSomething2 0x00000004 + Call sub_0806D944 + _0807E930 0x0010 + TextboxNoOverlapFollowPos 0x110a, 0x000c + _0807EA94 + _0807E930 0x001f + _0807E5F8 0x00000008 + WaitForSomething2 0x00000004 + _0807E930 0x0010 + TextboxNoOverlapFollowPos 0x110b, 0x000c + _0807EA94 + _0807E930 0x001f + _0807E5F8 0x00000008 + WaitForSomething2 0x00000004 + DoPostScriptAction 0x0004 + Wait 0x003c + _0807E930 0x0010 + TextboxNoOverlapFollowPos 0x110c, 0x000c + _0807EA94 + _0807E930 0x001f + _0807E5F8 0x00000008 + WaitForSomething2 0x00000004 + _0807E930 0x0010 + TextboxNoOverlapFollowPos 0x110d, 0x000c + _0807EA94 + _0807E930 0x001f + _0807E5F8 0x00000008 + WaitForSomething2 0x00000004 + _0807E930 0x0010 + TextboxNoOverlapFollowPos 0x110e, 0x000c + _0807EA94 + _0807E930 0x0018 + SetEntitySpeed 0x0080 + Call sub_0806D908 + _0807EC1C 0x0010 + DoPostScriptAction 0x000a + _0807E9D4 + _0807E5F8 0x00000008 + WaitForSomething2 0x00000004 +script_08012904: + EndBlock + BeginBlock + Call sub_0806D944 + CheckEntityInteractType + JumpIf script_08012920 + CheckPlayerInRegion2 0x3030 + JumpIfNot script_0801293A + Jump script_08012904 +script_08012920: + _0807E864 + _0807E930 0x0010 + EndBlock + TextboxNoOverlapFollowPos 0x1115, 0x000c + _0807EA94 + _0807E930 0x0018 + _0807E878 + Jump script_08012904 +script_0801293A: + EndBlock + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 + _0807EB8C + Call sub_0806D944 + _0807E930 0x0010 + TextboxNoOverlapFollowPos 0x110f, 0x000c + _0807E930 0x0018 + SetEntitySpeed 0x0080 + Call sub_0806D908 + _0807EC1C 0x0050 + _0807EA94 + Call sub_0807DF50 + _0807E878 + _0807E5F8 0x00000008 + WaitForSomething2 0x00000004 +script_08012984: + EndBlock + BeginBlock + Call sub_0806D944 + CheckEntityInteractType + JumpIf script_080129A0 + CheckPlayerInRegion2 0x3030 + JumpIfNot script_080129BA + Jump script_08012984 +script_080129A0: + _0807E864 + _0807E930 0x0010 + EndBlock + TextboxNoOverlapFollowPos 0x1115, 0x000c + _0807EA94 + _0807E930 0x0018 + _0807E878 + Jump script_08012984 +script_080129BA: + EndBlock + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 + _0807EB8C + Call sub_0806D944 + _0807E930 0x0010 + TextboxNoOverlapFollowPos 0x1110, 0x000c + _0807E930 0x0018 + SetEntitySpeed 0x0080 + Call sub_0806D908 + _0807EC1C 0x0050 + _0807E930 0x0018 + _0807EA94 + Call sub_0807DF50 + _0807E878 + _0807E5F8 0x00000008 + WaitForSomething2 0x00000004 +script_08012A08: + EndBlock + BeginBlock + Call sub_0806D944 + CheckEntityInteractType + JumpIf script_08012A24 + CheckPlayerInRegion2 0x3030 + JumpIfNot script_08012A3E + Jump script_08012A08 +script_08012A24: + _0807E864 + _0807E930 0x0010 + EndBlock + TextboxNoOverlapFollowPos 0x1115, 0x000c + _0807EA94 + _0807E930 0x0018 + _0807E878 + Jump script_08012A08 +script_08012A3E: + EndBlock + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 + SoundReq0x80100000 + DoPostScriptAction 0x000b + _0807EB8C + Call sub_0806D944 + _0807E930 0x0010 + TextboxNoOverlapFollowPos 0x1111, 0x000c + _0807E930 0x0018 + SetEntitySpeed 0x0080 + Call sub_0806D8A0 +script_08012A74: + _0807EE30 + JumpIfNot script_08012A74 + _0807E930 0x001f + _0807EA94 + StartPlayerScript script_08012B18 + Call sub_0806D9A4 + DoPostScriptAction 0x0008 + Wait 0x0078 + SoundReq2 0x000e + BeginBlock + _0807E8E4_2 + _0807EB28 0x1112 + EndBlock + _0807EA94 + _0807E5F8 0x00000008 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_08012AB0.inc b/data/scripts/script_08012AB0.inc new file mode 100644 index 00000000..d88f3c06 --- /dev/null +++ b/data/scripts/script_08012AB0.inc @@ -0,0 +1,9 @@ +SCRIPT_START script_08012AB0 + EndBlock +script_08012AB2: + _0807EB44 0x0002 + Wait 0x000a + _0807EB44 0x0006 + Wait 0x000a + Jump script_08012AB2 + .2byte 0x0000 diff --git a/data/scripts/script_08012AC8.inc b/data/scripts/script_08012AC8.inc new file mode 100644 index 00000000..9600c570 --- /dev/null +++ b/data/scripts/script_08012AC8.inc @@ -0,0 +1,12 @@ +SCRIPT_START script_08012AC8 + BeginBlock + SetEntitySpeed 0x0080 + EndBlock + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + DoPostScriptAction 0x0004 + Wait 0x003c + _0807E5F8 0x00000001 + Call sub_080791BC +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08012AF0.inc b/data/scripts/script_08012AF0.inc new file mode 100644 index 00000000..3e4b36e6 --- /dev/null +++ b/data/scripts/script_08012AF0.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_08012AF0 + BeginBlock + SetEntitySpeed 0x0100 + EndBlock + DoPostScriptAction 0x0001 + _0807EDD4 0x0388, 0x0180 + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000001 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_08012B18.inc b/data/scripts/script_08012B18.inc new file mode 100644 index 00000000..c317235e --- /dev/null +++ b/data/scripts/script_08012B18.inc @@ -0,0 +1,4 @@ +SCRIPT_START script_08012B18 + DoPostScriptAction 0x0015 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_08012B24.inc b/data/scripts/script_08012B24.inc new file mode 100644 index 00000000..4790ca98 --- /dev/null +++ b/data/scripts/script_08012B24.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_08012B24 + BeginBlock + SetEntitySpeed 0x0100 + _0807EB44 0x0004 + EndBlock + DoPostScriptAction 0x0001 + _0807ECC4 0x0008 + _0807E5F8 0x00000002 + CallWithArg sub_0807FB64, 0xffffffe2 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_08012B50.inc b/data/scripts/script_08012B50.inc new file mode 100644 index 00000000..13cd72a9 --- /dev/null +++ b/data/scripts/script_08012B50.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_08012B50 + BeginBlock + SetEntitySpeed 0x0100 + _0807EB44 0x0000 + EndBlock + DoPostScriptAction 0x0001 + _0807EC64 0x0008 + _0807E5F8 0x00000002 + CallWithArg sub_0807FB64, 0xffffffe2 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_08012B7C.inc b/data/scripts/script_08012B7C.inc new file mode 100644 index 00000000..015962e2 --- /dev/null +++ b/data/scripts/script_08012B7C.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_08012B7C + BeginBlock + SetEntitySpeed 0x0100 + _0807EB44 0x0002 + EndBlock + DoPostScriptAction 0x0001 + _0807EC94 0x0008 + _0807E5F8 0x00000002 + CallWithArg sub_0807FB64, 0xffffffe2 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_08012BA8.inc b/data/scripts/script_08012BA8.inc new file mode 100644 index 00000000..071ced29 --- /dev/null +++ b/data/scripts/script_08012BA8.inc @@ -0,0 +1,20 @@ +SCRIPT_START script_08012BA8 + BeginBlock + _0807EB44 0x0002 + DoPostScriptAction 0x0007 + _0807E930 0x0001 + EndBlock + WaitForSomething2 0x00000040 + _0807E930 0x0005 + Wait 0x001e + _0807E5F8 0x00000080 + _0807E930 0x0001 + WaitForSomething2 0x00000040 + _0807E930 0x0005 + Wait 0x001e + _0807E5F8 0x00000080 + _0807E930 0x0001 + WaitForSomething2 0x00000040 + Wait 0x0001 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_08012BF8.inc b/data/scripts/script_08012BF8.inc new file mode 100644 index 00000000..97cea951 --- /dev/null +++ b/data/scripts/script_08012BF8.inc @@ -0,0 +1,20 @@ +SCRIPT_START script_08012BF8 + BeginBlock + _0807EB44 0x0006 + DoPostScriptAction 0x0007 + _0807E930 0x0003 + EndBlock + WaitForSomething2 0x00000010 + _0807E930 0x0007 + Wait 0x001e + _0807E5F8 0x00000020 + _0807E930 0x0003 + WaitForSomething2 0x00000010 + _0807E930 0x0007 + Wait 0x001e + _0807E5F8 0x00000020 + _0807E930 0x0003 + WaitForSomething2 0x00000010 + Wait 0x0001 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_08012C48.inc b/data/scripts/script_08012C48.inc new file mode 100644 index 00000000..7d27437b --- /dev/null +++ b/data/scripts/script_08012C48.inc @@ -0,0 +1,10 @@ +SCRIPT_START script_08012C48 + BeginBlock + DoPostScriptAction 0x0007 + SetEntitySpeed 0x0280 + EndBlock + _0807EDD4 0x0388, 0x0168 + _0807E5F8 0x00000100 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08012C68.inc b/data/scripts/script_08012C68.inc new file mode 100644 index 00000000..30fa7e4c --- /dev/null +++ b/data/scripts/script_08012C68.inc @@ -0,0 +1,38 @@ +SCRIPT_START script_08012C68 + BeginBlock + _0807E9D4 + DoPostScriptAction 0x0008 + SetIntVariable 0x00000000 + Call sub_0806DA04 + EndBlock +script_08012C7E: + CheckEntityInteractType + JumpIfNot script_08012C7E + _0807E864 + _0807E8E4_0 + TextboxNoOverlapFollow 0x111d + _0807EA94 + SetGlobalFlag 0x0022 + _0807E878 + Jump script_08012C7E +script_08012C98: + CheckGlobalFlag 0x0014 + JumpIfNot script_08012C98 +script_08012CA0: + EndBlock + BeginBlock + CheckPlayerInRegion 0x0398, 0x03b0, 0x2040 + JumpIfNot script_08012CA0 + _0807E564 + JumpIf script_08012CD2 + EndBlock + _0807E864 + Call sub_0807DF28 + _0807EB28 0x2202 + _0807EA94 + SetLocalFlag 0x003b + Call sub_0807DF50 + _0807E878 +script_08012CD2: + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_08012CD8.inc b/data/scripts/script_08012CD8.inc new file mode 100644 index 00000000..59f22008 --- /dev/null +++ b/data/scripts/script_08012CD8.inc @@ -0,0 +1,19 @@ +SCRIPT_START script_08012CD8 + EndBlock + BeginBlock + _0807E564 + JumpIfNot script_08012CD8 + CheckPlayerInRegion 0x0380, 0x03b0, 0x4040 + JumpIfNot script_08012CD8 + ComparePlayerAction 0x0015 + JumpIf script_08012CD8 + _0807E864 + Call sub_0807DF28 + EndBlock + _0807EB28 0x2203 + _0807EA94 + SetLocalFlag 0x003e + Call sub_0807DF50 + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_08012D18.inc b/data/scripts/script_08012D18.inc new file mode 100644 index 00000000..73cb0ac9 --- /dev/null +++ b/data/scripts/script_08012D18.inc @@ -0,0 +1,24 @@ +SCRIPT_START script_08012D18 + EndBlock + BeginBlock + CheckGlobalFlag 0x0014 + JumpIfNot script_08012D18 + CheckLocalFlagByOffset 0x0200, 0x008d + JumpIf script_08012D68 + CheckPlayerInRegion 0x0000, 0x01a8, 0x2010 + JumpIfNot script_08012D18 + EndBlock + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 + _0807EB28 0x111a + _0807EA94 + StartPlayerScript script_08010A38 + WaitForSomething2 0x00000001 + Call sub_0807DF50 + _0807E878 + Jump script_08012D18 +script_08012D68: + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08012D70.inc b/data/scripts/script_08012D70.inc new file mode 100644 index 00000000..1f0dfcfe --- /dev/null +++ b/data/scripts/script_08012D70.inc @@ -0,0 +1,16 @@ +SCRIPT_START script_08012D70 + CheckPlayerInRegion 0x0088, 0x0048, 0x3030 + JumpIfNot script_08012D70 + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 + StartPlayerScript script_08012DB0 + WaitForSomething2 0x00000001 + _0807EB28 0x132d + _0807EA94 + SetLocalFlag 0x0014 + Call sub_0807DF50 + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08012DB0.inc b/data/scripts/script_08012DB0.inc new file mode 100644 index 00000000..09eef4e2 --- /dev/null +++ b/data/scripts/script_08012DB0.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_08012DB0 + BeginBlock + SetEntitySpeed 0x0100 + EndBlock + _0807EDD4 0x0088, 0x0068 + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + Wait 0x001e + _0807E5F8 0x00000001 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_08012DD8.inc b/data/scripts/script_08012DD8.inc new file mode 100644 index 00000000..d7874822 --- /dev/null +++ b/data/scripts/script_08012DD8.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_08012DD8 + BeginBlock + EndBlock + _0807E888 + Wait 0x0018 + _0807E864 + StartPlayerScript script_08012DF8 + WaitForSomething2 0x00000001 + _0807E908 0x0002 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08012DF8.inc b/data/scripts/script_08012DF8.inc new file mode 100644 index 00000000..21ed79e5 --- /dev/null +++ b/data/scripts/script_08012DF8.inc @@ -0,0 +1,12 @@ +SCRIPT_START script_08012DF8 + BeginBlock + _0807EB44 0x0000 + SetEntitySpeed 0x0140 + EndBlock + _0807EDD4 0x00b8, 0x0094 + Wait 0x0008 + DoPostScriptAction 0x0000 + Wait 0x0008 + _0807E5F8 0x00000001 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08012E20.inc b/data/scripts/script_08012E20.inc new file mode 100644 index 00000000..3bae5d40 --- /dev/null +++ b/data/scripts/script_08012E20.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_08012E20 + BeginBlock + _0807E864 + EndBlock + Wait 0x0078 + _0807E908 0x0004 + StartPlayerScript script_08012E44 + WaitForSomething2 0x00000002 + Wait 0x000c + _0807E908 0x0005 +SCRIPT_END diff --git a/data/scripts/script_08012E44.inc b/data/scripts/script_08012E44.inc new file mode 100644 index 00000000..4d929371 --- /dev/null +++ b/data/scripts/script_08012E44.inc @@ -0,0 +1,19 @@ +SCRIPT_START script_08012E44 + BeginBlock + SetEntitySpeed 0x0140 + EndBlock + Wait 0x003c + _0807EB44 0x0004 + Wait 0x000f + _0807EB44 0x0002 + Wait 0x0012 + _0807EB44 0x0006 + Wait 0x000c + _0807EB44 0x0000 + Wait 0x0015 + _0807EB44 0x0004 + Wait 0x0008 + _0807E5F8 0x00000002 + _0807EDD4 0x0088, 0x0158 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08012E88.inc b/data/scripts/script_08012E88.inc new file mode 100644 index 00000000..bf393c4d --- /dev/null +++ b/data/scripts/script_08012E88.inc @@ -0,0 +1,37 @@ +SCRIPT_START script_08012E88 + BeginBlock + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + DoPostScriptAction 0x000a + Call sub_0806B60C + EndBlock +script_08012E9E: + CheckEntityInteractType + JumpIfNot script_08012E9E + _0807E864 + _0807EB74 + DoPostScriptAction 0x0001 + Call sub_0806B4F0 + _0807EA94 + _0807E878 + DoPostScriptAction 0x0000 + Jump script_08012E9E + .2byte 0x0000 + BeginBlock + _0807EB44 0x0004 + CallWithArg sub_0807F3D8, 0x00000008 + DoPostScriptAction 0x000a + Call sub_0806B60C + EndBlock +script_08012EDC: + CheckEntityInteractType + JumpIfNot script_08012EDC + _0807E864 + _0807EB74 + CallWithArg sub_0807F3D8, 0x0000000c + Call sub_0806B4F0 + _0807EA94 + Wait 0x000f + _0807E878 + CallWithArg sub_0807F3D8, 0x00000008 + Jump script_08012EDC diff --git a/data/scripts/script_08012F0C.inc b/data/scripts/script_08012F0C.inc new file mode 100644 index 00000000..1b76edf7 --- /dev/null +++ b/data/scripts/script_08012F0C.inc @@ -0,0 +1,35 @@ +SCRIPT_START script_08012F0C + BeginBlock + CallWithArg sub_0806A93C, 0x12345678 + _0807EB44 0x0004 + _0807E930 0x0002 + CheckInventory1 0x0015 + JumpIf script_080130B6 + CheckLocalFlag 0x0060 + JumpIf script_08012FD2 + CheckGlobalFlag 0x001e + JumpIf script_08012F86 + EndBlock + CheckLocalFlag 0x0062 + JumpIfNot script_08012F48 + Call sub_0806A9B0 +script_08012F48: + CheckLocalFlag 0x0061 + JumpIf script_08012F6C +script_08012F50: + Call sub_0806A96C + JumpIfNot script_08012F50 + _0807E864 + TextboxNoOverlap 0x4401 + _0807EA94 + SetLocalFlag 0x0061 + _0807E878 + _0807E908 0x0001 +script_08012F6C: + Call sub_0806A96C + JumpIfNot script_08012F6C + TextboxNoOverlap 0x4402 + _0807EA94 + _0807E908 0x0001 + Jump script_08012F6C +SCRIPT_END diff --git a/data/scripts/script_08012F86.inc b/data/scripts/script_08012F86.inc new file mode 100644 index 00000000..2a5ea045 --- /dev/null +++ b/data/scripts/script_08012F86.inc @@ -0,0 +1,99 @@ +SCRIPT_START script_08012F86 + BeginBlock + CheckLocalFlag 0x0060 + JumpIf script_08012FD2 + _0807E864 + Call sub_0807DF28 + StartPlayerScript script_080130E4 + SetLocalFlag 0x0060 + ClearLocalFlag 0x0061 + EndBlock + WaitForSomething2 0x00000004 + _0807E908 0x0004 + Call sub_0806A958 + CallWithArg sub_0807F93C, 0x0000f2f4 + Call sub_0807DF50 + _0807E878 + SetLocalFlag 0x0062 + Jump script_08012FFA +script_08012FD2: + BeginBlock + _0807E930 0x000d + _0807E908 0x0005 + SetLocalFlag 0x0062 + CallWithArg sub_0807F93C, 0x0000f2f4 + Call sub_0806AA10 + EndBlock + CheckInventory1 0x0038 + JumpIf script_08013006 +script_08012FFA: + _0807E944 + TextboxNoOverlap 0x4403 + _0807EA94 + Jump script_08012FFA +script_08013006: + _0807E944 + BeginBlock + _0807E864 + Call sub_0807DF28 + EndBlock + SoundReq 0x00cd + _0807F088 0x0038 + WaitPlayerAction8 + Wait 0x001e + _0807E8E4_0 + Call sub_0806AB9C + _0807E930 0x000b + Wait 0x003c + DoPostScriptAction 0x0004 + Wait 0x003c + TextboxNoOverlap 0x4404 + _0807EA94 + Wait 0x001e + DoPostScriptAction 0x0004 + Wait 0x003c + TextboxNoOverlap 0x440e + _0807EA94 + Wait 0x001e + Call sub_0806A9E8 + _0807E930 0x000f + Wait 0x00f0 + TextboxNoOverlap 0x4405 + _0807EA94 + _0807E5F8 0x00000200 + _0807F034 0x0015 + WaitPlayerAction8 + _0807EB8C + TextboxNoOverlap 0x4406 + _0807EA94 + _0807E908 0x0001 + Call sub_0807DF50 + _0807E878 +script_0801308A: + Call sub_0806A96C + JumpIfNot script_0801308A + TextboxNoOverlap 0x4407 + _0807EA94 + _0807E908 0x0001 +script_0801309E: + Call sub_0806A96C + JumpIfNot script_0801309E + TextboxNoOverlap 0x440d + _0807EA94 + _0807E908 0x0001 + Jump script_0801308A +script_080130B6: + CheckLocalFlag 0x0062 + JumpIfNot script_080130C4 + Call sub_0806A9B0 +script_080130C4: + EndBlock +script_080130C6: + Call sub_0806A96C + JumpIfNot script_080130C6 + _0807E864 + Call sub_0806AA18 + _0807EA94 + _0807E878 + _0807E908 0x0001 + Jump script_080130C6 diff --git a/data/scripts/script_080130E4.inc b/data/scripts/script_080130E4.inc new file mode 100644 index 00000000..154a90ed --- /dev/null +++ b/data/scripts/script_080130E4.inc @@ -0,0 +1,14 @@ +SCRIPT_START script_080130E4 + BeginBlock + _0807EB44 0x0006 + SetEntitySpeed 0x0140 + EndBlock + _0807EDD4 0x00a8, 0x0060 + Wait 0x0008 + DoPostScriptAction 0x0000 + Wait 0x0008 + DoPostScriptAction 0x0004 + Wait 0x000f + _0807E5F8 0x00000004 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08013114.inc b/data/scripts/script_08013114.inc new file mode 100644 index 00000000..8173e078 --- /dev/null +++ b/data/scripts/script_08013114.inc @@ -0,0 +1,39 @@ +SCRIPT_START script_08013114 + BeginBlock + _0807E9D4 + DoPostScriptAction 0x000a + DoPostScriptAction 0x0012 + Call sub_0807F348 + EndBlock +script_08013128: + EndBlock + BeginBlock + CheckEntityInteractType + JumpIf script_0801313C + Call sub_0806AEE4 + Jump script_08013128 +script_0801313C: + _0807E864 + EndBlock + _0807EB74 + Call sub_0806AED8 + CallWithArg sub_0806AA50, 0x00000000 + _0807EA94 + CallWithArg sub_0806AA50, 0x00000001 + _0807EA94 + CallWithArg sub_0806AA50, 0x00000002 + _0807EA94 + JumpIf script_08013176 + _0807E878 + Jump script_08013128 +script_08013176: + SetIntVariable 0x00000403 + Call sub_0807F420 + _0807E878 + Jump script_08013128 + BeginBlock + CheckLocalFlag 0x0062 + JumpIfNot script_0801319A + DoPostScriptAction 0x0006 + EndBlock +SCRIPT_END diff --git a/data/scripts/script_0801319A.inc b/data/scripts/script_0801319A.inc new file mode 100644 index 00000000..5d272cf2 --- /dev/null +++ b/data/scripts/script_0801319A.inc @@ -0,0 +1,78 @@ +SCRIPT_START script_0801319A + EndBlock + BeginBlock + CameraTargetEntity + MoveEntityToPlayer + Call sub_0806AB74 + Jump script_0801319A +script_080131AC: + CheckPlayerInRegion 0x0098, 0x0038, 0x2060 + JumpIfNot script_080131AC + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 + StartPlayerScript script_080132E4 + WaitForSomething2 0x00000002 + _0807EB28 0x1601 + _0807EA94 + StartPlayerScript script_0801330C + WaitForSomething2 0x00000002 + _0807E778 0x0004 + DoFade5 + WaitFor_2 + LoadRoomEntityList gUnk_080F5680 + StartPlayerScript script_08013330 + WaitForSomething2 0x00000002 + MoveEntityToPlayer + SetEntityPosition 0x0000, 0xfff0 + Call sub_0807F844 + CameraTargetEntity + Call sub_080536B8 + _0807E864 + Call sub_0807DF28 + WaitFor_2 + TextboxNoOverlapFollowPos 0x1602, 0x000c + _0807EA94 + _0807E5F8 0x00000008 + WaitForSomething2 0x00000010 + _0807E5F8 0x00000020 + WaitForSomething2 0x00000040 + SoundReq2 0x000d + StartPlayerScript script_0801334C + WaitForSomething2 0x00000002 + _0807E5F8 0x00000020 + WaitForSomething2 0x00000040 + StartPlayerScript script_08013378 + _0807E5F8 0x00000020 + WaitForSomething2 0x00000042 + TextboxNoOverlapFollowPos 0x1603, 0x000c + _0807EA94 + _0807E5F8 0x00000020 + WaitForSomething2 0x00000040 + _0807E788 0xffff7fff + _0807E778 0x0004 + DoFade5 + WaitFor_2 + SoundReq0x80100000 + _0807E858 0x0000 + Wait 0x003c + CameraTargetPlayer + Call sub_0807F5C0 + TextboxNoOverlapFollowPos 0x1604, 0x0007 + _0807EA94 + _0807E788 0xffffffff + _0807E778 0x0004 + DoFade4 + WaitFor_2 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000002 + _0807EB28 0x1605 + _0807EA94 + SetLocalFlag 0x0078 + SoundReq2 0x0031 + SetGlobalFlag 0x005d + Call sub_0807DF50 + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_080132E4.inc b/data/scripts/script_080132E4.inc new file mode 100644 index 00000000..61f3f5ea --- /dev/null +++ b/data/scripts/script_080132E4.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_080132E4 + BeginBlock + SetEntitySpeed 0x0080 + EndBlock + DoPostScriptAction 0x0001 + _0807EDD4 0x0098, 0x0058 + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000002 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_0801330C.inc b/data/scripts/script_0801330C.inc new file mode 100644 index 00000000..7963871e --- /dev/null +++ b/data/scripts/script_0801330C.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_0801330C + BeginBlock + SetEntitySpeed 0x0080 + EndBlock + DoPostScriptAction 0x0001 + _0807EC64 0x0020 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000002 + Call sub_080791BC +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08013330.inc b/data/scripts/script_08013330.inc new file mode 100644 index 00000000..082f3afb --- /dev/null +++ b/data/scripts/script_08013330.inc @@ -0,0 +1,8 @@ +SCRIPT_START script_08013330 + BeginBlock + _0807EB44 0x0000 + SetEntityPositionRelative 0x0098, 0x0070 + EndBlock + _0807E5F8 0x00000002 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_0801334C.inc b/data/scripts/script_0801334C.inc new file mode 100644 index 00000000..d210e38e --- /dev/null +++ b/data/scripts/script_0801334C.inc @@ -0,0 +1,13 @@ +SCRIPT_START script_0801334C + BeginBlock + SetEntitySpeed 0x0080 + DoPostScriptAction 0x000d + EndBlock + DoPostScriptAction 0x0001 + _0807ECC4 0x0020 + DoPostScriptAction 0x0000 + DoPostScriptAction 0x000c + _0807E5F8 0x00000002 + Call sub_080791BC +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08013378.inc b/data/scripts/script_08013378.inc new file mode 100644 index 00000000..e6a8ec58 --- /dev/null +++ b/data/scripts/script_08013378.inc @@ -0,0 +1,16 @@ +SCRIPT_START script_08013378 + Call sub_0807F1C4 + Call sub_0807F2D4 + Call sub_0807F1E8 + Call sub_0807F2D4 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000004 + SoundReq 0x007c + _0807EB44 0x0004 + Call sub_0807F210 + _0807EF3C 0x0200, 0x0020 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000002 + Call sub_080791BC +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_080133C4.inc b/data/scripts/script_080133C4.inc new file mode 100644 index 00000000..52231159 --- /dev/null +++ b/data/scripts/script_080133C4.inc @@ -0,0 +1,14 @@ +SCRIPT_START script_080133C4 + BeginBlock + _0807EB44 0x0004 + DoPostScriptAction 0x0007 + DoPostScriptAction 0x000b + Call sub_0807F338 + EndBlock + WaitForSomething2 0x00000008 + Call sub_08061F94 + Wait 0x000a + _0807E5F8 0x00000010 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_080133F8.inc b/data/scripts/script_080133F8.inc new file mode 100644 index 00000000..1e720d3b --- /dev/null +++ b/data/scripts/script_080133F8.inc @@ -0,0 +1,34 @@ +SCRIPT_START script_080133F8 + BeginBlock + _0807EB44 0x0004 + DoPostScriptAction 0x0008 + DoPostScriptAction 0x000b + Call sub_0807F338 + EndBlock + WaitForSomething2 0x00000020 + SetEntityPositionRelative 0x0098, 0x0048 + Call sub_08066C94 + Wait 0x00e9 + DoPostScriptAction 0x0007 + _0807E5F8 0x00000040 + WaitForSomething2 0x00000020 + Wait 0x003c + DoPostScriptAction 0x0014 + SoundReq 0x0120 + CallWithArg sub_08095420, script_08013494 + Wait 0x005a + DoPostScriptAction 0x0016 + WaitForSomething2 0x00000080 + _0807E5F8 0x00000040 + WaitForSomething2 0x00000020 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000040 + WaitForSomething2 0x00000020 + Call sub_08066CA4 + DoPostScriptAction 0x0008 + Wait 0x0078 + _0807E5F8 0x00000040 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08013494.inc b/data/scripts/script_08013494.inc new file mode 100644 index 00000000..d0722887 --- /dev/null +++ b/data/scripts/script_08013494.inc @@ -0,0 +1,18 @@ +SCRIPT_START script_08013494 + BeginBlock + _0807E930 0x0000 + SetEntitySpeed 0x0200 + Call nullsub_527 + Call sub_08094B80 + EndBlock + Wait 0x005a + Call sub_08094B6C + _0807EDD4 0x0098, 0x0080 + BeginBlock + Call sub_08094B80 + SoundReq 0x01cc + Call sub_0807F36C + _0807E5F8 0x00000080 + EndBlock + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_080134DC.inc b/data/scripts/script_080134DC.inc new file mode 100644 index 00000000..702550f2 --- /dev/null +++ b/data/scripts/script_080134DC.inc @@ -0,0 +1,73 @@ +SCRIPT_START script_080134DC + BeginBlock + DoPostScriptAction 0x0008 + EndBlock + BeginBlock + Call sub_0807F92C + CallWithArg sub_0806DA04, 0x00000003 + EndBlock +script_080134F8: + CheckEntityInteractType + JumpIfNot script_080134F8 + _0807E864 + Call sub_0807DF28 + StartPlayerScript script_080136D8 + WaitForSomething2 0x00000001 + CallWithArg sub_08095A1C, script_08013F04 + SoundReq 0x01cd + Wait 0x005a + BeginBlock + SoundReq 0x01ce + CallWithArg sub_08095D54, script_08013E04 + CallWithArg sub_08095D54, script_08013E28 + EndBlock + WaitForSomething2 0x18000000 + BeginBlock + SoundReq 0x01cf + CallWithArg sub_08095D8C, script_08014054 + CallWithArg sub_08095D8C, script_08014074 + EndBlock + Wait 0x001e + BeginBlock + SoundReq 0x01d0 + CallWithArg sub_08095D8C, script_080140DC + CallWithArg sub_08095D8C, script_08014118 + EndBlock + Wait 0x003c + CallWithArg sub_0805DDEC, 0x00000000 + _0807E5F8 0x00000200 + WaitForSomething2 0x00002000 + SoundReq 0x01d2 + CallWithArg sub_08095D8C, script_080141DC + CallWithArg sub_08095D8C, script_08014210 + _0807E5F8 0x00000400 + WaitForSomething2 0x00004000 + Wait 0x0078 + _0807E5F8 0x00000060 + CallWithArg sub_0805DE18, 0x00000000 + Wait 0x0078 + _0807E5F8 0x00000080 + WaitForSomething2 0x00000100 + Wait 0x003c + StartPlayerScript script_08013B70 + _0807E5F8 0x00000080 + _0807F078 0x0003, 0x0001 + Call sub_0806DC3C + Call sub_0806DC58 + Call sub_0807F304 + Wait 0x003c + _0807E778 0x0004 + DoFade7 + SoundReq 0x00f6 + WaitFor_2 + Wait 0x003c + _0807E5F8 0x00000010 + _0807E778 0x0002 + DoFade6 + WaitFor_2 + SoundReq 0x0109 + TextboxNoOverlapFollowPos 0x0503, 0x000c + _0807EA94 + _0807E5F8 0x00040000 + CallWithArg sub_0805DDEC, 0x00000001 + _0807F0C8 0xffff, 0x0000 diff --git a/data/scripts/script_08013650.inc b/data/scripts/script_08013650.inc new file mode 100644 index 00000000..0b142523 --- /dev/null +++ b/data/scripts/script_08013650.inc @@ -0,0 +1,23 @@ +SCRIPT_START script_08013650 + Call sub_0807F3F8 + Wait 0x003c + _0807F0B4 0x0007 + SetEntityPositionRelative 0x00e8, 0x00a8 + CameraTargetEntity + Wait 0x003c + _0807E5F8 0x00000004 + Wait 0x0078 + CallWithArg sub_0805DE18, 0x00000001 + _0807F0C8 0x0000, 0x0000 + StartPlayerScript script_080136B4 + WaitForSomething2 0x00000002 + _0807EB28 0x1501 + _0807EA94 + _0807F0B4 0x0004 + CameraTargetPlayer + SetLocalFlag 0x007a + Call sub_08053250 + Call sub_0807DF50 + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_080136B4.inc b/data/scripts/script_080136B4.inc new file mode 100644 index 00000000..da761630 --- /dev/null +++ b/data/scripts/script_080136B4.inc @@ -0,0 +1,10 @@ +SCRIPT_START script_080136B4 + BeginBlock + SetEntitySpeed 0x0100 + EndBlock + _0807EDD4 0x00e8, 0x00a8 + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000002 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_080136D8.inc b/data/scripts/script_080136D8.inc new file mode 100644 index 00000000..989c33ee --- /dev/null +++ b/data/scripts/script_080136D8.inc @@ -0,0 +1,17 @@ +SCRIPT_START script_080136D8 + BeginBlock + SetEntitySpeed 0x0100 + EndBlock + Call sub_0807F584 + JumpTable script_080136F0, script_080136FA, script_08013704, script_080136FA +script_080136F0: + CallWithArg sub_0807F464, 0x000000d0 +script_080136FA: + CallWithArg sub_0807F4F8, 0x00000124 +script_08013704: + _0807EDD4 0x00e8, 0x0124 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000001 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_08013720.inc b/data/scripts/script_08013720.inc new file mode 100644 index 00000000..e3ef357e --- /dev/null +++ b/data/scripts/script_08013720.inc @@ -0,0 +1,81 @@ +SCRIPT_START script_08013720 + BeginBlock + DoPostScriptAction 0x0008 + EndBlock + BeginBlock + Call sub_0807F92C + CallWithArg sub_0806DA04, 0x00000003 + EndBlock +script_0801373C: + CheckEntityInteractType + JumpIfNot script_0801373C + _0807E864 + Call sub_0807DF28 + StartPlayerScript script_080136D8 + WaitForSomething2 0x00000001 + CallWithArg sub_08095A1C, script_08013F34 + SoundReq 0x01cd + Wait 0x005a + BeginBlock + SoundReq 0x01ce + CallWithArg sub_08095D54, script_08013E4C + EndBlock + WaitForSomething2 0x20000000 + BeginBlock + SoundReq 0x01cf + CallWithArg sub_08095D8C, script_08014054 + CallWithArg sub_08095D8C, script_08014074 + CallWithArg sub_08095D8C, script_08014094 + EndBlock + Wait 0x001e + BeginBlock + SoundReq 0x01d0 + CallWithArg sub_08095D8C, script_080140DC + CallWithArg sub_08095D8C, script_08014118 + CallWithArg sub_08095D8C, script_08014154 + EndBlock + Wait 0x003c + CallWithArg sub_0805DDEC, 0x00000000 + _0807E5F8 0x00000200 + WaitForSomething2 0x00002000 + SoundReq 0x01d2 + CallWithArg sub_08095D8C, script_080141DC + CallWithArg sub_08095D8C, script_08014210 + _0807E5F8 0x00000400 + WaitForSomething2 0x00004000 + _0807E5F8 0x00000800 + WaitForSomething2 0x00008000 + Wait 0x0078 + _0807E5F8 0x00000060 + CallWithArg sub_0805DE18, 0x00000000 + Wait 0x0078 + _0807E5F8 0x00000080 + WaitForSomething2 0x00000100 + Wait 0x003c + StartPlayerScript script_08013B70 + _0807E5F8 0x00000080 + _0807F078 0x0004, 0x0001 + Call sub_0806DC3C + Call sub_0806DC58 + Call sub_0807F304 + Wait 0x003c + _0807E778 0x0004 + DoFade7 + SoundReq 0x00f6 + WaitFor_2 + Wait 0x003c + _0807E5F8 0x00000010 + _0807E778 0x0002 + DoFade6 + WaitFor_2 + SoundReq 0x0109 + TextboxNoOverlapFollowPos 0x0504, 0x000c + _0807EA94 + _0807E5F8 0x00040000 + SetLocalFlag 0x007b + Call sub_08053250 + Call sub_0807DF50 + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_080138B4.inc b/data/scripts/script_080138B4.inc new file mode 100644 index 00000000..0d496673 --- /dev/null +++ b/data/scripts/script_080138B4.inc @@ -0,0 +1,93 @@ +SCRIPT_START script_080138B4 + BeginBlock + DoPostScriptAction 0x0008 + EndBlock + BeginBlock + Call sub_0807F92C + CallWithArg sub_0806DA04, 0x00000003 + EndBlock +script_080138D0: + CheckEntityInteractType + JumpIfNot script_080138D0 + _0807E864 + Call sub_0807DF28 + StartPlayerScript script_080136D8 + WaitForSomething2 0x00000001 + CallWithArg sub_08095A1C, script_08013F64 + SoundReq 0x01cd + Wait 0x005a + BeginBlock + SoundReq 0x01ce + CallWithArg sub_08095D54, script_08013E70 + EndBlock + WaitForSomething2 0x40000000 + BeginBlock + SoundReq 0x01cf + CallWithArg sub_08095D8C, script_08014054 + CallWithArg sub_08095D8C, script_08014074 + CallWithArg sub_08095D8C, script_08014094 + CallWithArg sub_08095D8C, script_080140B8 + EndBlock + Wait 0x001e + BeginBlock + SoundReq 0x01d0 + CallWithArg sub_08095D8C, script_080140DC + CallWithArg sub_08095D8C, script_08014118 + CallWithArg sub_08095D8C, script_08014154 + CallWithArg sub_08095D8C, script_08014198 + EndBlock + Wait 0x003c + CallWithArg sub_0805DDEC, 0x00000000 + _0807E5F8 0x00000200 + WaitForSomething2 0x00002000 + SoundReq 0x01d2 + CallWithArg sub_08095D8C, script_080141DC + CallWithArg sub_08095D8C, script_08014210 + _0807E5F8 0x00000400 + WaitForSomething2 0x00004000 + _0807E5F8 0x00000800 + WaitForSomething2 0x00008000 + _0807E5F8 0x00001000 + WaitForSomething2 0x00010000 + Wait 0x0078 + _0807E5F8 0x00000060 + CallWithArg sub_0805DE18, 0x00000000 + Wait 0x0078 + _0807E5F8 0x00000080 + WaitForSomething2 0x00000100 + Wait 0x003c + StartPlayerScript script_08013BA8 + _0807E5F8 0x00000080 + _0807F078 0x0006, 0x0001 + Call sub_0807AEE4 + Call sub_0806DC3C + Call sub_0806DC58 + Call sub_0807F304 + Wait 0x003c + _0807E778 0x0004 + DoFade7 + SoundReq 0x00f6 + WaitFor_2 + Wait 0x003c + _0807E5F8 0x00000010 + _0807E778 0x0002 + DoFade6 + WaitFor_2 + SoundReq 0x0109 + TextboxNoOverlapFollowPos 0x0505, 0x000c + _0807EA94 + _0807E5F8 0x00040000 + _0807F0B4 0x0002 + SetEntityPositionRelative 0x00e8, 0x00d8 + CameraTargetEntity + Call sub_0806DC3C + CallWithArg sub_0807F244, 0x00010001 + CallWithArg sub_0807F29C, gUnk_080049FE + Wait 0x00c8 + CallWithArg sub_0807F29C, 0x00000000 + Call sub_0806DC58 +script_08013A8E: + CheckRoomFlag 0x0004 + JumpIfNot script_08013A8E + CallWithArg sub_0805DDEC, 0x00000001 + _0807F0C8 0xffff, 0x0000 diff --git a/data/scripts/script_08013AA6.inc b/data/scripts/script_08013AA6.inc new file mode 100644 index 00000000..484789c1 --- /dev/null +++ b/data/scripts/script_08013AA6.inc @@ -0,0 +1,28 @@ +SCRIPT_START script_08013AA6 + Call sub_0807F3F8 + Wait 0x003c + _0807E5F8 0x00000008 + Wait 0x0078 + CallWithArg sub_0805DE18, 0x00000001 + _0807F0C8 0x0000, 0x0000 + Wait 0x003c + _0807F0B4 0x0004 + SetEntityPositionRelative 0x00e8, 0x0050 + CameraTargetEntity + Wait 0x003c + LoadRoomEntityList gUnk_080F55D8 + Wait 0x0078 + _0807F0B4 0x0007 + MoveEntityToPlayer + CameraTargetEntity + Wait 0x003c + _0807EB28 0x1502 + _0807EA94 + _0807F0B4 0x0004 + CameraTargetPlayer + SetLocalFlag 0x007c + Call sub_08053250 + Call sub_0807DF50 + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_08013B18.inc b/data/scripts/script_08013B18.inc new file mode 100644 index 00000000..e1b11b09 --- /dev/null +++ b/data/scripts/script_08013B18.inc @@ -0,0 +1,24 @@ +SCRIPT_START script_08013B18 + BeginBlock + DoPostScriptAction 0x0008 +script_08013B1E: + EndBlock + BeginBlock + CallWithArg sub_0807F6B4, 0x000001c8 + JumpIfNot script_08013B1E + CheckInventory1 0x0006 + JumpIfNot script_08013B1E + CheckLocalFlag 0x0078 + JumpIf script_08013B1E + EndBlock + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 + _0807EB28 0x1507 + _0807EA94 + StartPlayerScript script_08010A14 + WaitForSomething2 0x00000001 + Call sub_0807DF50 + _0807E878 + Jump script_08013B1E + .2byte 0x0000 diff --git a/data/scripts/script_08013B70.inc b/data/scripts/script_08013B70.inc new file mode 100644 index 00000000..76310119 --- /dev/null +++ b/data/scripts/script_08013B70.inc @@ -0,0 +1,12 @@ +SCRIPT_START script_08013B70 + SoundReq 0x01d3 + CallWithArg sub_0807F238, 0x000008bf + Call sub_08096028 + Wait 0x003c + _0807E5F8 0x00020000 + Call sub_0807F304 + Wait 0x0078 + WaitForSomething2 0x00040000 + Call sub_080791BC +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08013BA8.inc b/data/scripts/script_08013BA8.inc new file mode 100644 index 00000000..d171c4fb --- /dev/null +++ b/data/scripts/script_08013BA8.inc @@ -0,0 +1,12 @@ +SCRIPT_START script_08013BA8 + CallWithArg sub_08095E7C, script_08014248 + SoundReq 0x01d3 + CallWithArg sub_0807F238, 0x000008e3 + Call sub_08096028 + Wait 0x0078 + _0807E5F8 0x00020000 + Call sub_0807F304 + Wait 0x0078 + WaitForSomething2 0x00040000 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_08013BE8.inc b/data/scripts/script_08013BE8.inc new file mode 100644 index 00000000..a49ba76f --- /dev/null +++ b/data/scripts/script_08013BE8.inc @@ -0,0 +1,58 @@ +SCRIPT_START script_08013BE8 + BeginBlock + CheckLocalFlag 0x007a + JumpIf script_08013C2A + CheckInventory1 0x0003 + JumpIf script_08013C2A + CheckInventory1 0x0002 + JumpIfNot script_08013C98 + CheckInventory1 0x0040 + JumpIfNot script_08013C98 + CheckInventory1 0x0041 + JumpIfNot script_08013C98 + EndBlock + DoPostScriptAction 0x0008 + WaitForSomething2 0x00000004 + _0807E908 0x0002 + SoundReq 0x0134 + Jump script_08013C32 +script_08013C2A: + CheckLocalFlag 0x007c + JumpIf script_08013C98 +script_08013C32: + BeginBlock + DoPostScriptAction 0x0007 + Call sub_0807F934 + DoPostScriptAction 0x000a + CallWithArg sub_080962F8, 0x00000000 + CallWithArg sub_0807F8E8, 0x00000004 + EndBlock +script_08013C58: + EndBlock + BeginBlock + TestBit 0x00000008 + JumpIf script_08013C92 + CheckEntityInteractType + JumpIfNot script_08013C58 + EndBlock + _0807E864 + _0807EB74 + CheckLocalFlag 0x007d + JumpIf script_08013C82 + _0807EB28 0x1501 + Jump script_08013C86 +script_08013C82: + _0807EB28 0x1506 +script_08013C86: + _0807EA94 + Wait 0x000f + _0807E878 + Jump script_08013C58 +script_08013C92: + EndBlock + _0807E908 0x0004 +script_08013C98: + DoPostScriptAction 0x0008 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08013CA4.inc b/data/scripts/script_08013CA4.inc new file mode 100644 index 00000000..923f7045 --- /dev/null +++ b/data/scripts/script_08013CA4.inc @@ -0,0 +1,25 @@ +SCRIPT_START script_08013CA4 + EndBlock +script_08013CA6: + CheckPlayerInRegion 0x00e8, 0x01e8, 0x4080 + JumpIfNot script_08013CA6 + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 + Call sub_0807F3F8 + Wait 0x003c + _0807F0B4 0x0001 + SetEntityPositionRelative 0x00e8, 0x0138 + CameraTargetEntity + Call sub_0807F5C0 + Wait 0x0078 + _0807F0B4 0x0004 + CameraTargetPlayer + Call sub_0807F5C0 + _0807EB28 0x1504 + _0807EA94 + SetLocalFlag 0x0079 + Call sub_0807DF50 + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_08013D04.inc b/data/scripts/script_08013D04.inc new file mode 100644 index 00000000..025d0eb7 --- /dev/null +++ b/data/scripts/script_08013D04.inc @@ -0,0 +1,16 @@ +SCRIPT_START script_08013D04 + BeginBlock + Call sub_0807F92C + DoPostScriptAction 0x0008 + CallWithArg sub_0806DA04, 0x00000004 + EndBlock +script_08013D1C: + CheckEntityInteractType + JumpIfNot script_08013D1C + CallWithArg sub_08095D54, 0x00000000 + SoundReq 0x01cd + _0807E5F8 0x08000000 + Call sub_080791BC + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08013D44.inc b/data/scripts/script_08013D44.inc new file mode 100644 index 00000000..0dfb9d8c --- /dev/null +++ b/data/scripts/script_08013D44.inc @@ -0,0 +1,16 @@ +SCRIPT_START script_08013D44 + BeginBlock + Call sub_0807F92C + DoPostScriptAction 0x0008 + CallWithArg sub_0806DA04, 0x00000004 + EndBlock +script_08013D5C: + CheckEntityInteractType + JumpIfNot script_08013D5C + CallWithArg sub_08095D54, 0x00000001 + SoundReq 0x01cd + _0807E5F8 0x10000000 + Call sub_080791BC + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08013D84.inc b/data/scripts/script_08013D84.inc new file mode 100644 index 00000000..b61269d4 --- /dev/null +++ b/data/scripts/script_08013D84.inc @@ -0,0 +1,16 @@ +SCRIPT_START script_08013D84 + BeginBlock + Call sub_0807F92C + DoPostScriptAction 0x0008 + CallWithArg sub_0806DA04, 0x00000004 + EndBlock +script_08013D9C: + CheckEntityInteractType + JumpIfNot script_08013D9C + CallWithArg sub_08095D54, 0x00000002 + SoundReq 0x01cd + _0807E5F8 0x20000000 + Call sub_080791BC + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08013DC4.inc b/data/scripts/script_08013DC4.inc new file mode 100644 index 00000000..fa1c2572 --- /dev/null +++ b/data/scripts/script_08013DC4.inc @@ -0,0 +1,16 @@ +SCRIPT_START script_08013DC4 + BeginBlock + Call sub_0807F92C + DoPostScriptAction 0x0008 + CallWithArg sub_0806DA04, 0x00000004 + EndBlock +script_08013DDC: + CheckEntityInteractType + JumpIfNot script_08013DDC + CallWithArg sub_08095D54, 0x00000003 + SoundReq 0x01cd + _0807E5F8 0x40000000 + Call sub_080791BC + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08013E04.inc b/data/scripts/script_08013E04.inc new file mode 100644 index 00000000..bc6bb9c4 --- /dev/null +++ b/data/scripts/script_08013E04.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_08013E04 + BeginBlock + DoPostScriptAction 0x0007 + _0807E930 0x0000 + EndBlock + SetEntitySpeed 0x0080 + _0807EDD4 0x00b0, 0x00f8 + _0807E930 0x0001 + _0807E5F8 0x08000000 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08013E28.inc b/data/scripts/script_08013E28.inc new file mode 100644 index 00000000..ebdbe6ce --- /dev/null +++ b/data/scripts/script_08013E28.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_08013E28 + BeginBlock + DoPostScriptAction 0x0007 + _0807E930 0x0002 + EndBlock + SetEntitySpeed 0x0080 + _0807EDD4 0x0120, 0x00f8 + _0807E930 0x0003 + _0807E5F8 0x10000000 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08013E4C.inc b/data/scripts/script_08013E4C.inc new file mode 100644 index 00000000..4cf5047d --- /dev/null +++ b/data/scripts/script_08013E4C.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_08013E4C + BeginBlock + DoPostScriptAction 0x0007 + _0807E930 0x0004 + EndBlock + SetEntitySpeed 0x0080 + _0807EDD4 0x0120, 0x0168 + _0807E930 0x0005 + _0807E5F8 0x20000000 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08013E70.inc b/data/scripts/script_08013E70.inc new file mode 100644 index 00000000..f74c3644 --- /dev/null +++ b/data/scripts/script_08013E70.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_08013E70 + BeginBlock + DoPostScriptAction 0x0007 + _0807E930 0x0006 + EndBlock + SetEntitySpeed 0x0080 + _0807EDD4 0x00b0, 0x0168 + _0807E930 0x0007 + _0807E5F8 0x40000000 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08013E94.inc b/data/scripts/script_08013E94.inc new file mode 100644 index 00000000..a01fcca2 --- /dev/null +++ b/data/scripts/script_08013E94.inc @@ -0,0 +1,9 @@ +SCRIPT_START script_08013E94 + BeginBlock + DoPostScriptAction 0x0007 + Call sub_0807F180 + SetEntityPositionRelative 0x00b0, 0x00f8 + _0807E930 0x0001 + EndBlock +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08013EB0.inc b/data/scripts/script_08013EB0.inc new file mode 100644 index 00000000..777ce0e7 --- /dev/null +++ b/data/scripts/script_08013EB0.inc @@ -0,0 +1,9 @@ +SCRIPT_START script_08013EB0 + BeginBlock + DoPostScriptAction 0x0007 + Call sub_0807F180 + SetEntityPositionRelative 0x0120, 0x00f8 + _0807E930 0x0003 + EndBlock +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08013ECC.inc b/data/scripts/script_08013ECC.inc new file mode 100644 index 00000000..daeb7eb8 --- /dev/null +++ b/data/scripts/script_08013ECC.inc @@ -0,0 +1,9 @@ +SCRIPT_START script_08013ECC + BeginBlock + DoPostScriptAction 0x0007 + Call sub_0807F180 + SetEntityPositionRelative 0x0120, 0x0168 + _0807E930 0x0005 + EndBlock +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08013EE8.inc b/data/scripts/script_08013EE8.inc new file mode 100644 index 00000000..081cdfbb --- /dev/null +++ b/data/scripts/script_08013EE8.inc @@ -0,0 +1,9 @@ +SCRIPT_START script_08013EE8 + BeginBlock + DoPostScriptAction 0x0007 + Call sub_0807F180 + SetEntityPositionRelative 0x00b0, 0x0168 + _0807E930 0x0007 + EndBlock +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08013F04.inc b/data/scripts/script_08013F04.inc new file mode 100644 index 00000000..8e99a3ff --- /dev/null +++ b/data/scripts/script_08013F04.inc @@ -0,0 +1,13 @@ +SCRIPT_START script_08013F04 + BeginBlock + DoPostScriptAction 0x0007 + _0807E930 0x0008 + EndBlock + WaitForSomething2 0x00000080 + _0807E930 0x000b + Call sub_0807F2D4 + _0807E5F8 0x00000100 + WaitForSomething2 0x00000080 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08013F34.inc b/data/scripts/script_08013F34.inc new file mode 100644 index 00000000..18a770a5 --- /dev/null +++ b/data/scripts/script_08013F34.inc @@ -0,0 +1,13 @@ +SCRIPT_START script_08013F34 + BeginBlock + DoPostScriptAction 0x0007 + _0807E930 0x0009 + EndBlock + WaitForSomething2 0x00000080 + _0807E930 0x000c + Call sub_0807F2D4 + _0807E5F8 0x00000100 + WaitForSomething2 0x00000080 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08013F64.inc b/data/scripts/script_08013F64.inc new file mode 100644 index 00000000..5dbd9cdb --- /dev/null +++ b/data/scripts/script_08013F64.inc @@ -0,0 +1,13 @@ +SCRIPT_START script_08013F64 + BeginBlock + DoPostScriptAction 0x0007 + _0807E930 0x000a + EndBlock + WaitForSomething2 0x00000080 + _0807E930 0x000d + Call sub_0807F2D4 + _0807E5F8 0x00000100 + WaitForSomething2 0x00000080 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08013F94.inc b/data/scripts/script_08013F94.inc new file mode 100644 index 00000000..b34394a6 --- /dev/null +++ b/data/scripts/script_08013F94.inc @@ -0,0 +1,27 @@ +SCRIPT_START script_08013F94 + BeginBlock + DoPostScriptAction 0x0008 + EndBlock + CheckLocalFlag 0x007d + JumpIf script_08013FE0 +script_08013FA4: + EndBlock + BeginBlock + CheckInventory1 0x0003 + JumpIfNot script_08013FA4 + CheckPlayerFlags 0x00400000 + JumpIfNot script_08013FA4 + EndBlock + Call sub_0807FA40 + _0807E888 + Call sub_0807DF38 + Wait 0x0078 + _0807EB28 0x1505 + _0807EA94 + SetLocalFlag 0x007d + Call sub_0807DF50 + _0807E878 +script_08013FE0: + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08013FE8.inc b/data/scripts/script_08013FE8.inc new file mode 100644 index 00000000..605788ba --- /dev/null +++ b/data/scripts/script_08013FE8.inc @@ -0,0 +1,32 @@ +SCRIPT_START script_08013FE8 + BeginBlock + DoPostScriptAction 0x0008 + EndBlock +script_08013FF0: + EndBlock + BeginBlock + CheckLocalFlag 0x007d + JumpIf script_0801404C + CheckLocalFlag 0x007a + JumpIfNot script_08013FF0 + CheckInventory1 0x0003 + JumpIfNot script_08013FF0 + CallWithArg sub_0807F6B4, 0x000000d0 + JumpIfNot script_08013FF0 + EndBlock + Call sub_0807F9A4 + BeginBlock + _0807E864 + Call sub_0807DF28 + EndBlock + _0807EB28 0x1508 + _0807EA94 + StartPlayerScript script_08010A14 + WaitForSomething2 0x00000001 + Call sub_0807DF50 + _0807E878 + Jump script_08013FF0 +script_0801404C: + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08014054.inc b/data/scripts/script_08014054.inc new file mode 100644 index 00000000..b00a8e67 --- /dev/null +++ b/data/scripts/script_08014054.inc @@ -0,0 +1,10 @@ +SCRIPT_START script_08014054 + BeginBlock + DoPostScriptAction 0x0007 + _0807E930 0x0000 + Call sub_0807F738 + EndBlock + WaitForSomething 0x00000040 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08014074.inc b/data/scripts/script_08014074.inc new file mode 100644 index 00000000..33a943f1 --- /dev/null +++ b/data/scripts/script_08014074.inc @@ -0,0 +1,10 @@ +SCRIPT_START script_08014074 + BeginBlock + DoPostScriptAction 0x0007 + _0807E930 0x0001 + Call sub_0807F738 + EndBlock + WaitForSomething 0x00000040 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08014094.inc b/data/scripts/script_08014094.inc new file mode 100644 index 00000000..6160fb05 --- /dev/null +++ b/data/scripts/script_08014094.inc @@ -0,0 +1,10 @@ +SCRIPT_START script_08014094 + BeginBlock + DoPostScriptAction 0x0007 + _0807E930 0x0002 + Call sub_0807F738 + SetEntityPosition 0x0000, 0xfff0 + EndBlock + WaitForSomething 0x00000040 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_080140B8.inc b/data/scripts/script_080140B8.inc new file mode 100644 index 00000000..8fb4d8e0 --- /dev/null +++ b/data/scripts/script_080140B8.inc @@ -0,0 +1,10 @@ +SCRIPT_START script_080140B8 + BeginBlock + DoPostScriptAction 0x0007 + _0807E930 0x0003 + Call sub_0807F738 + SetEntityPosition 0x0000, 0xfff0 + EndBlock + WaitForSomething 0x00000040 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_080140DC.inc b/data/scripts/script_080140DC.inc new file mode 100644 index 00000000..2cce09f5 --- /dev/null +++ b/data/scripts/script_080140DC.inc @@ -0,0 +1,15 @@ +SCRIPT_START script_080140DC + BeginBlock + DoPostScriptAction 0x0007 + _0807E930 0x0004 + EndBlock + WaitForSomething2 0x00000200 + _0807E930 0x0008 + Call sub_0807F2D4 + _0807E930 0x000c + _0807E5F8 0x00002000 + WaitForSomething 0x00000020 + _0807E930 0x0010 + Call sub_0807F2D4 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_08014118.inc b/data/scripts/script_08014118.inc new file mode 100644 index 00000000..350984a1 --- /dev/null +++ b/data/scripts/script_08014118.inc @@ -0,0 +1,15 @@ +SCRIPT_START script_08014118 + BeginBlock + DoPostScriptAction 0x0007 + _0807E930 0x0005 + EndBlock + WaitForSomething2 0x00000400 + _0807E930 0x0009 + Call sub_0807F2D4 + _0807E930 0x000d + _0807E5F8 0x00004000 + WaitForSomething 0x00000020 + _0807E930 0x0011 + Call sub_0807F2D4 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_08014154.inc b/data/scripts/script_08014154.inc new file mode 100644 index 00000000..898e3180 --- /dev/null +++ b/data/scripts/script_08014154.inc @@ -0,0 +1,17 @@ +SCRIPT_START script_08014154 + BeginBlock + DoPostScriptAction 0x0007 + _0807E930 0x0006 + SetEntityPosition 0x0000, 0xfff0 + EndBlock + WaitForSomething2 0x00000800 + _0807E930 0x000a + Call sub_0807F2D4 + _0807E930 0x000e + _0807E5F8 0x00008000 + WaitForSomething 0x00000020 + _0807E930 0x0012 + Call sub_0807F2D4 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08014198.inc b/data/scripts/script_08014198.inc new file mode 100644 index 00000000..a7e84754 --- /dev/null +++ b/data/scripts/script_08014198.inc @@ -0,0 +1,17 @@ +SCRIPT_START script_08014198 + BeginBlock + DoPostScriptAction 0x0007 + _0807E930 0x0007 + SetEntityPosition 0x0000, 0xfff0 + EndBlock + WaitForSomething2 0x00001000 + _0807E930 0x000b + Call sub_0807F2D4 + _0807E930 0x000f + _0807E5F8 0x00010000 + WaitForSomething 0x00000020 + _0807E930 0x0013 + Call sub_0807F2D4 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_080141DC.inc b/data/scripts/script_080141DC.inc new file mode 100644 index 00000000..e80ffd66 --- /dev/null +++ b/data/scripts/script_080141DC.inc @@ -0,0 +1,13 @@ +SCRIPT_START script_080141DC + BeginBlock + DoPostScriptAction 0x0007 + _0807E930 0x0014 + Call sub_0807F714 + CallWithArg sub_0807F994, 0x0000fffc + EndBlock + WaitForSomething 0x00000020 + Wait 0x0078 + Call sub_0807F2D4 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08014210.inc b/data/scripts/script_08014210.inc new file mode 100644 index 00000000..73c8e186 --- /dev/null +++ b/data/scripts/script_08014210.inc @@ -0,0 +1,13 @@ +SCRIPT_START script_08014210 + BeginBlock + DoPostScriptAction 0x0007 + _0807E930 0x0015 + Call sub_0807F714 + Call sub_0807F714 + CallWithArg sub_0807F994, 0x0000fffc + EndBlock + WaitForSomething 0x00000020 + Wait 0x0078 + Call sub_0807F2D4 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_08014248.inc b/data/scripts/script_08014248.inc new file mode 100644 index 00000000..c49a5bc0 --- /dev/null +++ b/data/scripts/script_08014248.inc @@ -0,0 +1,29 @@ +SCRIPT_START script_08014248 + TestBit 0x00020000 + JumpIf script_08014264 + Wait 0x0008 + CallWithArg sub_08095EAC, 0x00000000 + Jump script_08014248 +script_08014264: + CallWithArg sub_08095EAC, 0x00000001 + Jump script_08014264 + .2byte 0x0000 + BeginBlock + DoPostScriptAction 0x0008 + EndBlock +script_0801427C: + CheckLocalFlag 0x0078 + JumpIfNot script_0801427C + BeginBlock + Call sub_0807F934 + CallWithArg sub_0806DA04, 0x00000008 + EndBlock +script_08014298: + CheckEntityInteractType + JumpIfNot script_08014298 + _0807E864 + TextboxNoOverlapFollowPos 0x0647, 0x000c + _0807EA94 + _0807E878 + Jump script_08014298 + .2byte 0x0000 diff --git a/data/scripts/script_080142B0.inc b/data/scripts/script_080142B0.inc new file mode 100644 index 00000000..44a7709f --- /dev/null +++ b/data/scripts/script_080142B0.inc @@ -0,0 +1,63 @@ +SCRIPT_START script_080142B0 + BeginBlock + CheckLocalFlag 0x0054 + JumpIf script_08014382 + CheckLocalFlag 0x0053 + JumpIf script_08014330 + EndBlock +script_080142C4: + EndBlock + BeginBlock + _0807E564 + JumpIfNot script_080142C4 + CheckPlayerInRegion 0x0098, 0x0058, 0x1818 + JumpIfNot script_080142C4 + EndBlock + _0807E864 + SetLocalFlag 0x0053 + Wait 0x0014 + _0807E908 0x0004 + Call sub_080654DC + Wait 0x001e + _0807E930 0x0001 + Wait 0x000a + _0807E930 0x0003 + Wait 0x000a + _0807E930 0x0001 + Wait 0x000a + _0807E930 0x0003 + Wait 0x000a + _0807E930 0x0002 + Wait 0x001e + TextboxNoOverlap 0x2c12 + _0807EA94 + Wait 0x0014 + _0807E930 0x0004 + _0807E878 + _0807E908 0x0001 +script_08014330: + EndBlock + BeginBlock + _0807E564 + JumpIf script_08014330 + EntityHasHeight + JumpIf script_08014330 + CheckPlayerInRegion 0x00c0, 0x0068, 0x1010 + JumpIfNot script_08014330 + EndBlock + _0807E864 + SetLocalFlag 0x0054 + Wait 0x005a + _0807E908 0x0004 + Call sub_080654EC + Wait 0x001e + _0807E930 0x0001 + Wait 0x001e + TextboxNoOverlap 0x2c13 + _0807EA94 + Wait 0x0014 + _0807E930 0x0004 + _0807E908 0x0001 + _0807E878 +script_08014382: +SCRIPT_END diff --git a/data/scripts/script_08014384.inc b/data/scripts/script_08014384.inc new file mode 100644 index 00000000..7689da1c --- /dev/null +++ b/data/scripts/script_08014384.inc @@ -0,0 +1,22 @@ +SCRIPT_START script_08014384 + EndBlock + _0807E864 + _0807EA94 + _0807E3E8 + JumpIfNot script_080143AC + Wait 0x001e + Call sub_08065370 + JumpIfNot script_080143AC + Wait 0x003c + _0807EA94 + _0807EB8C + Wait 0x001e + TextboxNoOverlapVar +script_080143AC: + _0807EA94 + Wait 0x001e + _0807E930 0x0004 + _0807E908 0x0001 + _0807E878 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_080143C0.inc b/data/scripts/script_080143C0.inc new file mode 100644 index 00000000..1f682585 --- /dev/null +++ b/data/scripts/script_080143C0.inc @@ -0,0 +1,39 @@ +SCRIPT_START script_080143C0 + EndBlock + _0807E864 + Call sub_0807DF28 + Call sub_080654FC + _0807E930 0x0001 + Call sub_080654EC + Wait 0x003c + TextboxNoOverlap 0x2c16 + _0807EA94 + _0807E3E8 + JumpIf script_080143FA + SetIntVariable 0x00000002 + Call sub_08065528 + Jump script_0801443E +script_080143FA: + Call sub_080654EC + Wait 0x001e + TextboxNoOverlap 0x2c18 + _0807EA94 + Wait 0x000a + SetIntVariable 0x00000000 + Call sub_08065528 + _0807F034 0x0036 + WaitPlayerAction8 + TextboxNoOverlap 0x2c19 + _0807EA94 + SetIntVariable 0x00000303 + Call sub_0807F420 + Wait 0x001e + _0807EB8C + TextboxNoOverlap 0x2c22 + _0807EA94 +script_0801443E: + _0807E930 0x0004 + _0807E908 0x0001 + Call sub_0807DF50 + _0807E878 +SCRIPT_END diff --git a/data/scripts/script_08014450.inc b/data/scripts/script_08014450.inc new file mode 100644 index 00000000..ad470edd --- /dev/null +++ b/data/scripts/script_08014450.inc @@ -0,0 +1,59 @@ +SCRIPT_START script_08014450 + BeginBlock + _0807E9D4 + _0807EB44 0x0000 + SetEntitySpeed 0x01c0 + DoPostScriptAction 0x000a + EndBlock +script_08014462: + _0807E30C + JumpIfNot script_08014462 + _0807E864 + _0807E930 0x0008 + Wait 0x0020 + _0807E930 0x0002 + TextboxNoOverlapFollow 0x4202 + TextboxNoOverlapFollow 0x4203 + _0807EA94 + _0807E3E8 + JumpIfNot script_080144F0 + DoPostScriptAction 0x0001 + Wait 0x008c + DoPostScriptAction 0x0000 + HasRupees 0x000a + JumpIf script_080144A2 + TextboxNoOverlapFollow 0x4204 + Jump script_080144FC +script_080144A2: + Call sub_0806E250 + JumpIfNot script_080144B8 + TextboxNoOverlapFollow 0x420b + _0807EB38 + JumpTable script_080144B8, script_080144C0 +script_080144B8: + ClearLocalFlag 0x0093 + Jump script_080144C8 +script_080144C0: + SetLocalFlag 0x0093 + SetLocalFlag 0x00d3 +script_080144C8: + ModRupees 0xfff6 + TextboxNoOverlapFollow 0x420c + SoundReq 0x010c + Wait 0x0018 + SetRoomFlag 0x0000 + SetLocalFlag 0x0092 + _0807EEF4 0x0000, 0xffa0 + Call sub_0807DF38 + Jump script_080144FC +script_080144F0: + _0807E930 0x0009 + Wait 0x003c + _0807E930 0x0002 +script_080144FC: + _0807E878 + CheckRoomFlag 0x0000 + JumpIfNot script_08014462 + _0807E9DC +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0801450C.inc b/data/scripts/script_0801450C.inc new file mode 100644 index 00000000..9965924d --- /dev/null +++ b/data/scripts/script_0801450C.inc @@ -0,0 +1,35 @@ +SCRIPT_START script_0801450C + BeginBlock + _0807E9D4 + _0807EB44 0x0000 + SetEntitySpeed 0x01c0 + DoPostScriptAction 0x000a + EndBlock + _0807E864 + Call sub_0807DF28 + Call sub_0806E20C + _0807EA94 + Call sub_0806E23C + ClearLocalFlag 0x0093 + ClearLocalFlag 0x0092 + Call sub_0807DF50 + Jump script_080144FC + .2byte 0x0000 + BeginBlock + EndBlock +script_0801454C: + CheckPlayerInRegion 0x0078, 0x0088, 0x0810 + JumpIfNot script_0801454C + CheckRoomFlag 0x0000 + JumpIfNot script_0801454C + _0807E864 + _0807EB28 0x4217 + _0807EA94 + StartPlayerScript script_08014588 + Wait 0x0010 + _0807E5F8 0x00000001 + WaitForSomething2 0x00000002 + _0807E878 + Jump script_0801454C +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08014588.inc b/data/scripts/script_08014588.inc new file mode 100644 index 00000000..35e475e0 --- /dev/null +++ b/data/scripts/script_08014588.inc @@ -0,0 +1,10 @@ +SCRIPT_START script_08014588 + EndBlock + WaitForSomething2 0x00000001 + SetEntitySpeed 0x00e0 + _0807EDD4 0x0078, 0x0078 + DoPostScriptAction 0x0000 + Wait 0x0010 + _0807E5F8 0x00000002 + Call sub_0807921C +SCRIPT_END diff --git a/data/scripts/script_080145B0.inc b/data/scripts/script_080145B0.inc new file mode 100644 index 00000000..8cc995b4 --- /dev/null +++ b/data/scripts/script_080145B0.inc @@ -0,0 +1,20 @@ +SCRIPT_START script_080145B0 + BeginBlock + SetEntityPositionRelative 0x01f8, 0x00e0 + CheckLocalFlag 0x005e + JumpIf script_080145E4 + EndBlock +script_080145C2: + CheckRoomFlag 0x0005 + JumpIfNot script_080145C2 + _0807E864 + ClearRoomFlag 0x0005 + Wait 0x000c + _0807EB8C + TextboxNoOverlapFollowPos 0x432e, 0x000c + _0807EA94 + _0807E878 + Jump script_080145C2 +script_080145E4: + EndBlock +SCRIPT_END diff --git a/data/scripts/script_080145E8.inc b/data/scripts/script_080145E8.inc new file mode 100644 index 00000000..4bd860cd --- /dev/null +++ b/data/scripts/script_080145E8.inc @@ -0,0 +1,146 @@ +SCRIPT_START script_080145E8 + BeginBlock + DoPostScriptAction 0x0008 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + EndBlock +script_080145F8: + CheckRoomFlag 0x0000 + JumpIfNot script_080145F8 + _0807E864 + Call sub_0807DF28 +script_08014608: + CheckRoomFlag 0x0004 + JumpIf script_08014608 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000008 + Call sub_0807DF50 + _0807E878 + Jump script_080145F8 + BeginBlock + _0807E9D4 + _0807EB44 0x0004 + SetEntityDirection 0x0000 + DoPostScriptAction 0x000a + EndBlock +script_0801463A: + _0807E30C + JumpIf script_080146A0 + TestBit 0x00000004 + JumpIf script_0801477A + CheckRoomFlag 0x0004 + JumpIf script_08014672 + Call sub_0808861C + JumpIfNot script_0801463A + CheckLocalFlag 0x005e + JumpIf script_080146A0 + _0807E864 + _0807EB8C + TextboxNoOverlapFollowPos 0x432b, 0x000c + Jump script_080147CE +script_08014672: + Call sub_08088658 + JumpIfNot script_0801463A + _0807E864 + _0807EB28 0x431f + _0807EA94 + StartPlayerScript script_080147DC + Wait 0x0010 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000001 + _0807E878 + Jump script_0801463A +script_080146A0: + _0807E864 + _0807E930 0x0008 + Wait 0x0010 + _0807EB8C + Wait 0x0010 + _0807E930 0x0002 + CheckGlobalFlag 0x0059 + JumpIfNot script_080146C6 + TextboxNoOverlapFollowPos 0x432f, 0x000c + Jump script_080147CE +script_080146C6: + CheckRoomFlag 0x0004 + JumpIf script_080146F4 + CheckLocalFlag 0x005e + JumpIfNot script_080146FE + CheckRoomFlag 0x0006 + JumpIf script_0801472E + CheckLocalFlag 0x005f + JumpIf script_08014720 + Call sub_08088574 + SetRoomFlag 0x0009 + Jump script_0801473C +script_080146F4: + TextboxNoOverlapFollowPos 0x431e, 0x000c + Jump script_080147CE +script_080146FE: + SetRoomFlag 0x0009 + SetLocalFlag 0x005c + TextboxNoOverlapFollowPos 0x4305, 0x000c + _0807EA94 + _0807E3BC 0x0001 + JumpIfNot script_080147C4 + TextboxNoOverlapFollowPos 0x4306, 0x000c + Jump script_0801473C +script_08014720: + SetRoomFlag 0x0009 + Call sub_08088504 + Jump script_0801473C +script_0801472E: + SetRoomFlag 0x0009 + ClearRoomFlag 0x0006 + Call sub_08088544 +script_0801473C: + _0807E3E8 + JumpIfNot script_08014770 + _0807EA94 + _0807E3BC 0x0001 + JumpIfNot script_080147C4 + SetRoomFlag 0x0001 + Wait 0x0014 +script_08014754: + CheckRoomFlag 0x0003 + JumpIfNot script_08014754 + ClearRoomFlag 0x0003 + _0807EA94 + SetRoomFlag 0x0004 + TextboxNoOverlapFollowPos 0x431e, 0x000c + Jump script_080147CE +script_08014770: + SetRoomFlag 0x0009 + _0807EA94 + Jump script_080147CE +script_0801477A: + CheckRoomFlag 0x0008 + JumpIf script_080147B4 + CheckRoomFlag 0x0007 + JumpIf script_080147A4 +script_0801478A: + Call sub_08088478 + _0807EA94 + Call sub_080885B0 + WaitPlayerAction8 + _0807E5F8 0x00000008 + Jump script_080147CE +script_080147A4: + _0807E930 0x0009 + Wait 0x003c + _0807E930 0x0002 + Jump script_0801478A +script_080147B4: + _0807E930 0x000a + Wait 0x008c + _0807E930 0x0002 + Jump script_0801478A +script_080147C4: + SetRoomFlag 0x0009 + TextboxNoOverlapFollowPos 0x4307, 0x000c +script_080147CE: + _0807EA94 + Wait 0x0004 + _0807E878 + Jump script_0801463A + .2byte 0x0000 diff --git a/data/scripts/script_080147DC.inc b/data/scripts/script_080147DC.inc new file mode 100644 index 00000000..c6e83402 --- /dev/null +++ b/data/scripts/script_080147DC.inc @@ -0,0 +1,10 @@ +SCRIPT_START script_080147DC + EndBlock + WaitForSomething2 0x00000002 + SetEntitySpeed 0x00e0 + _0807EDD4 0x0078, 0x0068 + DoPostScriptAction 0x0000 + Wait 0x0010 + _0807E5F8 0x00000001 + Call sub_0807921C +SCRIPT_END diff --git a/data/scripts/script_08014804.inc b/data/scripts/script_08014804.inc new file mode 100644 index 00000000..26b288d3 --- /dev/null +++ b/data/scripts/script_08014804.inc @@ -0,0 +1,97 @@ +SCRIPT_START script_08014804 + BeginBlock + _0807E9D4 + _0807EB44 0x0000 + DoPostScriptAction 0x000a + EndBlock + _0807E864 + Call sub_0807DF38 + Wait 0x0010 + CheckLocalFlag 0x0093 + JumpIf script_080148B6 + TextboxNoOverlapFollowPos 0x4215, 0x000c + _0807E878 +script_0801482E: + TestBit 0x00000001 + JumpIf script_08014862 + TestBit 0x00000004 + JumpIf script_08014878 + _0807E30C + JumpIfNot script_0801482E + _0807E864 + _0807E930 0x0008 + Wait 0x0020 + _0807E930 0x0002 + TextboxNoOverlapFollowPos 0x4215, 0x000c + _0807E878 + Jump script_0801482E +script_08014862: + _0807E930 0x0008 + Wait 0x0020 + _0807E930 0x0002 + _0807E5F8 0x00000002 + Jump script_0801482E +script_08014878: + _0807E930 0x0009 + Wait 0x003c + _0807E930 0x0002 + _0807E5F8 0x00000008 + Jump script_0801482E +script_0801488E: + TestBit 0x00000001 + JumpIf script_080148C2 + TestBit 0x00000004 + JumpIf script_080148D8 + _0807E30C + JumpIfNot script_0801488E + _0807E864 + _0807E930 0x0008 + Wait 0x0020 + _0807E930 0x0002 +script_080148B6: + TextboxNoOverlapFollowPos 0x4216, 0x000c + _0807E878 + Jump script_0801488E +script_080148C2: + _0807E930 0x0008 + Wait 0x0020 + _0807E930 0x0002 + _0807E5F8 0x00000002 + Jump script_0801488E +script_080148D8: + _0807E930 0x0009 + Wait 0x003c + _0807E930 0x0002 + _0807E5F8 0x00000008 + Jump script_0801488E + .2byte 0x0000 + BeginBlock + EndBlock +script_080148F4: + CheckRoomFlag 0x0000 + JumpIfNot script_080148F4 + ClearRoomFlag 0x0000 + Call sub_0806E140 + JumpIfNot script_08014932 + _0807EA94 + _0807E3E8 + JumpIfNot script_08014938 + _0807E864 + _0807E5F8 0x00000001 + WaitForSomething2 0x00000002 + Call sub_0806E1E0 + _0807EA94 + Wait 0x0018 + _0807E878 + Jump script_080148F4 +script_08014932: + _0807EA94 + Jump script_08014938 +script_08014938: + _0807E5F8 0x00000004 + WaitForSomething2 0x00000008 + Call sub_0806E1FC + Wait 0x001e + Call sub_0807DF50 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08014958.inc b/data/scripts/script_08014958.inc new file mode 100644 index 00000000..8dffa2f0 --- /dev/null +++ b/data/scripts/script_08014958.inc @@ -0,0 +1,39 @@ +SCRIPT_START script_08014958 + BeginBlock + Call sub_0806C870 + DoPostScriptAction 0x000a + CheckGlobalFlag 0x0058 + JumpIf script_08014976 + _0807EB44 0x0004 + SetEntityPositionRelative 0x0078, 0x0128 +script_08014976: + EndBlock +script_08014978: + _0807E30C + JumpIfNot script_08014978 + _0807E864 + _0807EB74 + Call sub_0806C90C + _0807EA94 + Wait 0x000f + _0807E878 + Jump script_08014978 + BeginBlock + Call sub_0806C870 + DoPostScriptAction 0x000a + CheckGlobalFlag 0x0058 + JumpIfNot script_080149C6 + EndBlock +script_080149AA: + _0807E30C + JumpIfNot script_080149AA + _0807E864 + _0807EB74 + Call sub_0806C90C + _0807EA94 + Wait 0x000f + _0807E878 + Jump script_080149AA +script_080149C6: + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_080149CC.inc b/data/scripts/script_080149CC.inc new file mode 100644 index 00000000..46812d26 --- /dev/null +++ b/data/scripts/script_080149CC.inc @@ -0,0 +1,59 @@ +SCRIPT_START script_080149CC + BeginBlock + SetEntitySpeed 0x0080 + Call sub_0806C870 + DoPostScriptAction 0x000a + EndBlock +script_080149DE: + _0807E30C + JumpIfNot script_080149DE + _0807E864 + _0807EB74 + Call sub_0806C90C + _0807EA94 + CheckLocalFlag 0x0064 + JumpIfNot script_08014A20 + CheckLocalFlag 0x00b1 + JumpIf script_08014A20 + SetLocalFlag 0x00b1 + DoPostScriptAction 0x000b + DoPostScriptAction 0x0001 + _0807EDD4 0x0068, 0x00f8 + SoundReq 0x0072 + _0807EB74 + DoPostScriptAction 0x0000 + DoPostScriptAction 0x000a +script_08014A20: + _0807E878 + Jump script_080149DE + .2byte 0x0000 + BeginBlock + Call sub_0806C870 + DoPostScriptAction 0x000a + EndBlock +script_08014A36: + _0807E30C + JumpIfNot script_08014A36 + _0807E864 + _0807EB74 + Call sub_0806C90C + _0807EA94 + Wait 0x000f + _0807E878 + Jump script_08014A36 + .2byte 0x0000 + BeginBlock + Call sub_0806C870 + DoPostScriptAction 0x000a + EndBlock +script_08014A62: + _0807E30C + JumpIfNot script_08014A62 + _0807E864 + _0807EB74 + Call sub_0806C90C + _0807EA94 + Wait 0x000f + _0807E878 + Jump script_08014A62 + .2byte 0x0000 diff --git a/data/scripts/script_08014A80.inc b/data/scripts/script_08014A80.inc new file mode 100644 index 00000000..ff503803 --- /dev/null +++ b/data/scripts/script_08014A80.inc @@ -0,0 +1,47 @@ +SCRIPT_START script_08014A80 + BeginBlock + DoPostScriptAction 0x000a + EndBlock + WaitForSomething2 0x00000001 + _0807EB74 + DoPostScriptAction 0x0004 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000001 + TextboxNoOverlap 0x2f0a + _0807EA94 + _0807E5F8 0x00000002 +script_08014AAC: + _0807E30C + JumpIfNot script_08014AAC + _0807E864 + _0807EB74 + TextboxNoOverlap 0x2f0a + _0807EA94 + _0807E878 + Jump script_08014AAC + .2byte 0x0000 + BeginBlock + Call sub_0806C870 + DoPostScriptAction 0x000a + EndBlock +script_08014AD2: + _0807E30C + JumpIfNot script_08014AD2 + _0807E864 + _0807EB74 + StartPlayerScript script_08014B10 + WaitForSomething2 0x00000001 + _0807EB74 + CheckLocalFlag 0x0064 + JumpIf script_08014AFE + SetLocalFlag 0x0064 + TextboxNoOverlap 0x2f0b + Jump script_08014B02 +script_08014AFE: + TextboxNoOverlap 0x2f0c +script_08014B02: + _0807EA94 + Wait 0x000f + _0807E878 + Jump script_08014AD2 + .2byte 0x0000 diff --git a/data/scripts/script_08014B10.inc b/data/scripts/script_08014B10.inc new file mode 100644 index 00000000..45c292eb --- /dev/null +++ b/data/scripts/script_08014B10.inc @@ -0,0 +1,10 @@ +SCRIPT_START script_08014B10 + BeginBlock + SetEntitySpeed 0x0100 + EndBlock + _0807EDD4 0x0078, 0x0040 + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000001 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_08014B34.inc b/data/scripts/script_08014B34.inc new file mode 100644 index 00000000..03c382c6 --- /dev/null +++ b/data/scripts/script_08014B34.inc @@ -0,0 +1,130 @@ +SCRIPT_START script_08014B34 + BeginBlock + DoPostScriptAction 0x000a + _0807E930 0x0000 + EndBlock + CheckLocalFlag 0x0063 + JumpIf script_08014BE8 +script_08014B48: + EndBlock + BeginBlock + CheckRoomFlag 0x0000 + JumpIf script_08014B70 + CheckEntityInteractType + JumpIfNot script_08014B48 + EndBlock + _0807E864 + _0807EB74 + TextboxNoOverlap 0x2f01 + _0807EA94 + Wait 0x000f + _0807E878 + Jump script_08014B48 +script_08014B70: + EndBlock + _0807E864 + Call sub_0807DF28 + _0807E5F8 0x00000001 + DoPostScriptAction 0x0004 + WaitForSomething2 0x00000002 + _0807E930 0x0010 + Call sub_0806CCF8 + Wait 0x0014 + Call sub_0806CD04 + Wait 0x0014 + Call sub_0806CD14 + Wait 0x0014 + Call sub_0806CD20 + Wait 0x0014 + Call sub_0806CD30 + Wait 0x0014 + Call sub_0806CD3C + Wait 0x0014 + Call sub_0806CD4C + SoundReq 0x0072 + _0807E5F8 0x00000001 + WaitForSomething2 0x00000002 + Call sub_0807DF50 + _0807E878 +script_08014BE8: + _0807E930 0x0010 + Call sub_0806CD4C +script_08014BF2: + CheckEntityInteractType + JumpIfNot script_08014BF2 + _0807E864 + CheckLocalFlag 0x0065 + JumpIf script_08014C1C + SetLocalFlag 0x0065 + TextboxNoOverlap 0x2f07 + _0807EA94 + SetIntVariable 0x00000064 + _0807F034 0x003f + WaitPlayerAction8 + Jump script_08014C22 +script_08014C1C: + TextboxNoOverlap 0x2f08 + _0807EA94 +script_08014C22: + Wait 0x000f + _0807E878 + Jump script_08014BF2 + BeginBlock + Call sub_0806CD58 + DoPostScriptAction 0x000a + _0807EB44 0x0004 + _0807E930 0x0006 + EndBlock +script_08014C42: + CheckEntityInteractType + JumpIfNot script_08014C42 + _0807E864 + _0807EB74 +script_08014C4C: + Call sub_0806CCD0 + JumpIfNot script_08014C4C +script_08014C56: + Call sub_0806CCB4 + JumpIfNot script_08014C56 + CheckLocalFlag 0x0066 + JumpIf script_08014C7C + SetLocalFlag 0x0066 + TextboxNoOverlap 0x2f0d + _0807EA94 + _0807F034 0x000a + WaitPlayerAction8 + Jump script_08014C82 +script_08014C7C: + TextboxNoOverlap 0x2f09 + _0807EA94 +script_08014C82: + Wait 0x000f + _0807E878 + _0807EB44 0x0004 + _0807E930 0x0006 + Jump script_08014C42 + BeginBlock + CheckGlobalFlag 0x0024 + JumpIf script_08014CD4 + Call sub_0806C870 + DoPostScriptAction 0x000a + DoPostScriptAction 0x0000 + EndBlock +script_08014CAE: + EndBlock + BeginBlock + CheckGlobalFlag 0x0024 + JumpIf script_08014CD4 + _0807E30C + JumpIfNot script_08014CAE + EndBlock + _0807E864 + _0807EB74 + Call sub_0806C90C + _0807EA94 + _0807E878 + Jump script_08014CAE +script_08014CD4: + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08014CDC.inc b/data/scripts/script_08014CDC.inc new file mode 100644 index 00000000..4cb6b657 --- /dev/null +++ b/data/scripts/script_08014CDC.inc @@ -0,0 +1,60 @@ +SCRIPT_START script_08014CDC + BeginBlock + SetEntitySpeed 0x0180 + DoPostScriptAction 0x000a + Call sub_08066D04 + Call sub_08066D14 + SetEntityPositionRelative 0x01e8, 0x0180 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + EndBlock + WaitForSomething2 0x00000001 + Call sub_08066E08 + _0807E864 + TextboxNoOverlapFollowPos 0x1010, 0x000c + _0807EA94 + _0807E5F8 0x00000002 +script_08014D1E: + EndBlock + BeginBlock + CheckPlayerInRegion 0x01d8, 0x0160, 0x3050 + JumpIfNot script_08014D1E + EndBlock + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 + TextboxNoOverlap 0x1012 + _0807EA94 + _0807EC64 0x0040 + _0807EB44 0x0004 + Call sub_08066E08 + SetEntityPositionRelative 0x01f8, 0x00c8 + Call sub_0807DF50 + _0807E878 +script_08014D60: + CallWithArg sub_0807F6B4, 0x000000e8 + JumpIf script_08014D60 + _0807E864 + Call sub_0807DF28 + TextboxNoOverlap 0x1013 + _0807EA94 + _0807EC64 0x0040 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + SetEntityPositionRelative 0x01e8, 0x0028 + Call sub_0807DF50 + _0807E878 +script_08014D96: + CheckPlayerInRegion 0x01f8, 0x0028, 0x2040 + JumpIfNot script_08014D96 + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 + TextboxNoOverlap 0x1014 + _0807EA94 + _0807EC64 0x0018 + SetLocalFlag 0x006d + Call sub_0807DF50 + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_08014DCC.inc b/data/scripts/script_08014DCC.inc new file mode 100644 index 00000000..f8df2393 --- /dev/null +++ b/data/scripts/script_08014DCC.inc @@ -0,0 +1,20 @@ +SCRIPT_START script_08014DCC + BeginBlock + SetEntityPositionRelative 0x0238, 0x01a8 + Call sub_0807F844 + Call sub_0807F348 + _0807E864 + Call sub_0807DF28 + EndBlock + _0807E778 0x0010 + DoFade6 + WaitFor_2 + _0807E5F8 0x00000001 + WaitForSomething2 0x00000002 + _0807F0B4 0x0004 + CameraTargetPlayer + Call sub_0807DF50 + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08014E14.inc b/data/scripts/script_08014E14.inc new file mode 100644 index 00000000..f6497d3c --- /dev/null +++ b/data/scripts/script_08014E14.inc @@ -0,0 +1,275 @@ +SCRIPT_START script_08014E14 + BeginBlock + _0807EB44 0x0004 + _0807E9D4 + DoPostScriptAction 0x000a + CallWithArg sub_0807F3D8, 0x00000000 + EndBlock +script_08014E2C: + CheckEntityInteractType + JumpIfNot script_08014E2C + _0807E864 + _0807EB74 + CallWithArg sub_0807F3D8, 0x00000000 + Call sub_08064428 + _0807EA94 + _0807E878 + Jump script_08014E2C + .2byte 0x0000 + BeginBlock + DoPostScriptAction 0x000a + DoPostScriptAction 0x0007 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + EndBlock +script_08014E64: + CheckEntityInteractType + JumpIfNot script_08014E64 + _0807E864 + Call sub_0807DF28 + _0807EB74 + CallWithArg sub_0807F78C, 0x00000022 + _0807EA94 + _0807E3E8 + JumpIfNot script_08014EBC + CallWithArg sub_0807F7C4, 0x00000022 + JumpIfNot script_08014EB0 + _0807E48C 0x0020 + JumpIfNot script_08014EB8 + CallWithArg sub_0807F800, 0x00000022 + WaitPlayerAction8 + TextboxNoOverlap 0x0a04 + Jump script_08014EBC +script_08014EB0: + TextboxNoOverlap 0x0a03 + Jump script_08014EBC +script_08014EB8: + TextboxNoOverlap 0x0a02 +script_08014EBC: + _0807EA94 + Call sub_0807DF50 + _0807E878 + Jump script_08014E64 + .2byte 0x0000 + BeginBlock + DoPostScriptAction 0x000a + DoPostScriptAction 0x0007 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + EndBlock +script_08014EE0: + CheckEntityInteractType + JumpIfNot script_08014EE0 + _0807E864 + _0807EB74 + TextboxNoOverlap 0x200d + _0807EA94 + _0807E878 + Jump script_08014EE0 + .2byte 0x0000 + BeginBlock + DoPostScriptAction 0x000a + DoPostScriptAction 0x0007 + _0807EB44 0x0004 + _0807E930 0x000a + EndBlock +script_08014F0C: + CheckEntityInteractType + JumpIfNot script_08014F0C + _0807E864 + _0807EB74 + DoPostScriptAction 0x0000 + TextboxNoOverlap 0x200e + _0807EA94 + _0807E878 + _0807EB44 0x0004 + _0807E930 0x000a + Jump script_08014F0C + .2byte 0x0000 + BeginBlock + DoPostScriptAction 0x000a + DoPostScriptAction 0x0007 + _0807EB44 0x0004 + _0807E930 0x000e + EndBlock + Call sub_08065914 +script_08014F4A: + CheckEntityInteractType + JumpIfNot script_08014F4A + _0807E864 + Call sub_0807DF28 + _0807EB74 + DoPostScriptAction 0x0000 + BeginBlock + TextboxNoOverlap 0x3b0b + CallWithArg sub_0807F854, 0x00010064 + EndBlock + _0807EA94 + _0807E3E8 + JumpIfNot script_08014FA6 + HasRupees 0x0064 + JumpIfNot script_08014F9A + _0807E48C 0x0020 + JumpIfNot script_08014FA2 + ModRupees 0xff9c + _0807F034 0x0022 + WaitPlayerAction8 + TextboxNoOverlap 0x3b11 + Jump script_08014FA6 +script_08014F9A: + TextboxNoOverlap 0x3b0e + Jump script_08014FA6 +script_08014FA2: + TextboxNoOverlap 0x3b0f +script_08014FA6: + _0807EA94 + Call sub_0807DF50 + _0807E878 + _0807EB44 0x0004 + _0807E930 0x000e + Jump script_08014F4A + BeginBlock + SetEntityPositionRelative 0x01f8, 0x00e0 + Call sub_08054564 + EndBlock +script_08014FCC: + CheckPlayerInRegion 0x01f8, 0x00a0, 0x2040 + JumpIfNot script_08014FCC + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 + SoundReq0x80100000 + _0807F0B4 0x0001 + CameraTargetEntity + StartPlayerScript script_080152B4 + WaitForSomething2 0x00000001 + TextboxNoOverlapFollowPos 0x1301, 0x0002 + _0807EA94 + Call sub_0807F3F8 + Wait 0x003c + _0807E5F8 0x00000002 + WaitForSomething2 0x00000004 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000004 + SoundReq2 0x000d + _0807EB28 0x1302 + _0807EA94 + TextboxNoOverlapFollowPos 0x1303, 0x0002 + _0807EA94 + _0807EB28 0x1304 + _0807EA94 + TextboxNoOverlapFollowPos 0x1305, 0x0002 + _0807EA94 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000004 + _0807EB28 0x1306 + _0807EA94 + SoundReq0x80100000 + StartPlayerScript script_080152DC + CameraTargetEntity + _0807F0B4 0x0003 + SetEntityPositionRelative 0x01f8, 0x0148 + WaitForSomething2 0x00000001 + Call sub_0804F6A8 + Wait 0x0004 + Call sub_0804F808 + SoundReq 0x010b + StartPlayerScript script_08015304 + Call sub_0804F6C8 + Wait 0x0004 + Call sub_0804F830 + SoundReq 0x010b + Call sub_0804F6E8 + Wait 0x0004 + Call sub_0804F854 + SoundReq 0x010b + Call sub_0804F724 + Wait 0x0004 + Call sub_0804F89C + SoundReq 0x010b + Call sub_0804F760 + Wait 0x0004 + Call sub_0804F8E0 + SoundReq 0x010b + Wait 0x003c + WaitForSomething2 0x00000001 + SoundReq 0x01b0 + Call sub_0804F79C + Wait 0x000a + LoadRoomEntityList gUnk_080F7FC0 + SoundReq2 0x002d + Call sub_0807DF50 + _0807E878 +script_08015104: + CheckRoomFlag 0x0000 + JumpIfNot script_08015104 + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 + SoundReq0x80100000 + StartPlayerScript script_08015338 + WaitForSomething2 0x00000001 + Wait 0x003c + Call sub_0804F6A8 + Wait 0x0004 + Call sub_0804F928 + SoundReq 0x010b + Call sub_0804F6C8 + Wait 0x0004 + Call sub_0804F944 + SoundReq 0x010b + Call sub_0804F6E8 + Wait 0x0004 + Call sub_0804F960 + SoundReq 0x010b + Call sub_0804F724 + Wait 0x0004 + Call sub_0804F994 + SoundReq 0x010b + Call sub_0804F760 + Wait 0x0004 + Call sub_0804F9C8 + SoundReq 0x010b + Wait 0x003c + SoundReq 0x0072 + _0807F0B4 0x0004 + CameraTargetPlayer + SetLocalFlag 0x008c + _0807EB28 0x130c + _0807EA94 + CameraTargetPlayer + _0807E778 0x0004 + _0807E80C 0x00000000 + WaitFor_2 + Call sub_08053B3C + BeginBlock + _0807E864 + CallWithArg sub_0807F6E8, 0x00000008 + MoveEntityToPlayer + _0807F0B4 0x0004 + CameraTargetEntity + _0807E778 0x0100 + DoFade4 + _0807E80C 0x00000000 + EndBlock + StartPlayerScript script_08015360 + WaitForSomething2 0x00000001 + LoadRoomEntityList gUnk_080F7CB0 + _0807E778 0x0004 + _0807E800 0x00000000 + WaitFor_2 + _0807E5F8 0x00000008 + WaitForSomething2 0x00000010 + BeginBlock + _0807E8E4_2 + _0807EB28 0x1315 + EndBlock + _0807EA94 + _0807F0B4 0x0004 + CameraTargetPlayer + Call sub_08054570 + SoundReq2 0xffff + Call sub_0807DF50 + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_08015234.inc b/data/scripts/script_08015234.inc new file mode 100644 index 00000000..600e376d --- /dev/null +++ b/data/scripts/script_08015234.inc @@ -0,0 +1,30 @@ +SCRIPT_START script_08015234 + BeginBlock + DoPostScriptAction 0x0008 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + Call sub_0807F354 + EndBlock + WaitForSomething2 0x00000002 + Call sub_08066C94 + Wait 0x00e9 + DoPostScriptAction 0x0007 + DoPostScriptAction 0x001e + _0807E5F8 0x00000004 + WaitForSomething2 0x00000002 + Wait 0x0014 + _0807EB44 0x0000 + DoPostScriptAction 0x001c + Call sub_0807F2D4 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000002 + SoundReq 0x00f5 + DoPostScriptAction 0x001f + SetEntitySpeed 0x0200 + DoPostScriptAction 0x000d + DoPostScriptAction 0x0000 + _0807ECC4 0x0030 + _0807E5F8 0x00000004 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_080152B4.inc b/data/scripts/script_080152B4.inc new file mode 100644 index 00000000..e29fae3e --- /dev/null +++ b/data/scripts/script_080152B4.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_080152B4 + BeginBlock + SetEntitySpeed 0x0080 + EndBlock + DoPostScriptAction 0x0001 + _0807EDD4 0x01f8, 0x00b8 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000001 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_080152DC.inc b/data/scripts/script_080152DC.inc new file mode 100644 index 00000000..c16d1795 --- /dev/null +++ b/data/scripts/script_080152DC.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_080152DC + BeginBlock + SetEntitySpeed 0x0200 + EndBlock + DoPostScriptAction 0x0001 + _0807EDD4 0x01f8, 0x0148 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000001 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_08015304.inc b/data/scripts/script_08015304.inc new file mode 100644 index 00000000..85133e67 --- /dev/null +++ b/data/scripts/script_08015304.inc @@ -0,0 +1,14 @@ +SCRIPT_START script_08015304 + _0807EB44 0x0002 + Wait 0x000a + _0807EB44 0x0006 + Wait 0x000a + _0807EB44 0x0002 + Wait 0x000a + _0807EB44 0x0006 + Wait 0x000a + _0807EB44 0x0004 + _0807E5F8 0x00000001 + Call sub_080791BC +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08015338.inc b/data/scripts/script_08015338.inc new file mode 100644 index 00000000..786e3cf2 --- /dev/null +++ b/data/scripts/script_08015338.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_08015338 + BeginBlock + SetEntitySpeed 0x0100 + EndBlock + DoPostScriptAction 0x0001 + _0807EDD4 0x01f8, 0x0148 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000001 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_08015360.inc b/data/scripts/script_08015360.inc new file mode 100644 index 00000000..73b67bde --- /dev/null +++ b/data/scripts/script_08015360.inc @@ -0,0 +1,10 @@ +SCRIPT_START script_08015360 + BeginBlock + SetEntitySpeed 0x0100 + SetEntityPositionRelative 0x0208, 0x0148 + EndBlock + _0807EB44 0x0006 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000001 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_08015384.inc b/data/scripts/script_08015384.inc new file mode 100644 index 00000000..a46df80e --- /dev/null +++ b/data/scripts/script_08015384.inc @@ -0,0 +1,4 @@ +SCRIPT_START script_08015384 + DoPostScriptAction 0x0015 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_08015390.inc b/data/scripts/script_08015390.inc new file mode 100644 index 00000000..6f8a7d4f --- /dev/null +++ b/data/scripts/script_08015390.inc @@ -0,0 +1,24 @@ +SCRIPT_START script_08015390 + BeginBlock + SetEntitySpeed 0x0080 + DoPostScriptAction 0x0007 + EndBlock + _0807E930 0x001f + Call sub_0806D944 + WaitForSomething2 0x00000008 + _0807E930 0x0010 + TextboxNoOverlapFollowPos 0x1314, 0x000c + _0807EA94 + _0807E930 0x0018 + Call sub_0806D8A0 +script_080153C2: + _0807EE30 + JumpIfNot script_080153C2 + _0807E930 0x001f + StartPlayerScript script_08015384 + Call sub_0806D9A4 + DoPostScriptAction 0x0008 + Wait 0x0078 + _0807E5F8 0x00000010 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_080153EC.inc b/data/scripts/script_080153EC.inc new file mode 100644 index 00000000..4d1bc1ee --- /dev/null +++ b/data/scripts/script_080153EC.inc @@ -0,0 +1,36 @@ +SCRIPT_START script_080153EC + BeginBlock + _0807F0B4 0x0007 + SetEntityPositionRelative 0x0078, 0x0068 + CameraTargetEntity + EndBlock + SoundReq2 0x002a + _0807E778 0x0004 + DoFade4 + WaitFor_2 + Wait 0x003c + _0807E5F8 0x00000080 + WaitForSomething2 0x00000100 + _0807E5F8 0x00000800 + WaitForSomething2 0x00001000 + _0807E5F8 0x00000880 + WaitForSomething2 0x00001100 + _0807F0B4 0x0004 + SetEntityPositionRelative 0x0078, 0x0090 + TextboxNoOverlapFollowPos 0x1330, 0x0002 + _0807EA94 + _0807E5F8 0x00008000 + WaitForSomething2 0x00010000 + _0807E5F8 0x00000880 + WaitForSomething2 0x00001000 + Wait 0x003c + TextboxNoOverlapFollowPos 0x130d, 0x0002 + _0807EA94 + TextboxNoOverlapFollowPos 0x130e, 0x000c + _0807EA94 + TextboxNoOverlapFollowPos 0x130f, 0x0002 + _0807EA94 + TextboxNoOverlapFollowPos 0x1310, 0x000c + _0807EA94 + CallWithArg sub_0805DDEC, 0x00000001 + _0807F0C8 0xffff, 0x0000 diff --git a/data/scripts/script_0801548E.inc b/data/scripts/script_0801548E.inc new file mode 100644 index 00000000..5b27435f --- /dev/null +++ b/data/scripts/script_0801548E.inc @@ -0,0 +1,26 @@ +SCRIPT_START script_0801548E + _0807E5F8 0x00000800 + WaitForSomething2 0x00001000 + SoundReq 0x0125 + CallWithArg sub_0807FB28, 0x00000003 + _0807E5F8 0x00048000 + WaitForSomething2 0x00090000 + TextboxNoOverlapFollowPos 0x1311, 0x0002 + _0807EA94 + _0807E5F8 0x00008000 + WaitForSomething2 0x00010000 + _0807E5F8 0x00048000 + WaitForSomething2 0x00010000 + CallWithArg sub_0805DE18, 0x00000001 + _0807F0C8 0x0000, 0x0000 + TextboxNoOverlapFollowPos 0x1312, 0x000c + _0807EA94 + _0807E5F8 0x00000800 + WaitForSomething2 0x00001000 + SoundReq0x80100000 + _0807E778 0x0004 + DoFade5 + WaitFor_2 + SetRoomFlag 0x0001 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_0801550C.inc b/data/scripts/script_0801550C.inc new file mode 100644 index 00000000..60940bdc --- /dev/null +++ b/data/scripts/script_0801550C.inc @@ -0,0 +1,45 @@ +SCRIPT_START script_0801550C + BeginBlock + SetEntitySpeed 0x0080 + DoPostScriptAction 0x0007 + _0807EB44 0x0000 + Call sub_0807F338 + EndBlock + CallWithArg sub_0806AF60, 0x00000000 + WaitForSomething2 0x00008000 + CallWithArg sub_0806AF60, 0x00000004 + _0807EDD4 0x0078, 0x00b8 + _0807EB44 0x0000 + CallWithArg sub_0806AF60, 0x00000000 + _0807E5F8 0x00010000 + WaitForSomething2 0x00008000 + DoPostScriptAction 0x000d + _0807EB44 0x0000 + CallWithArg sub_0806AF60, 0x00000004 + _0807EDD4 0x0078, 0x00c8 + _0807E5F8 0x00010000 + WaitForSomething2 0x00008000 + _0807EB44 0x0000 + CallWithArg sub_0806AF60, 0x00000000 + DoPostScriptAction 0x0010 + Wait 0x0028 + SoundReq 0x0125 + CallWithArg sub_0807FB28, 0x00000003 + Wait 0x000a + SoundReq 0x0125 + CallWithArg sub_0807FB28, 0x00000003 + Wait 0x000a + DoPostScriptAction 0x0010 + _0807E5F8 0x00010000 + WaitForSomething2 0x00008000 + _0807E930 0x000d + Call sub_0807F2D4 + _0807E5F8 0x00010000 + Wait 0x003c + DoPostScriptAction 0x0005 + Wait 0x003c +script_080155E6: + CheckRoomFlag 0x0001 + JumpIfNot script_080155E6 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_080155F4.inc b/data/scripts/script_080155F4.inc new file mode 100644 index 00000000..8d2bae15 --- /dev/null +++ b/data/scripts/script_080155F4.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_080155F4 + WaitForSomething2 0x00000020 + _0807E930 0x0000 + Wait 0x0014 + _0807E5F8 0x00000040 +script_08015608: + CheckRoomFlag 0x0001 + JumpIfNot script_08015608 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08015618.inc b/data/scripts/script_08015618.inc new file mode 100644 index 00000000..399b1b33 --- /dev/null +++ b/data/scripts/script_08015618.inc @@ -0,0 +1,22 @@ +SCRIPT_START script_08015618 + BeginBlock + DoPostScriptAction 0x0007 + SetEntitySpeed 0x0040 + Call sub_08094B80 + EndBlock + WaitForSomething2 0x00000080 + CallWithArg sub_0805DDEC, 0x00000003 + Call sub_08094B0C + _0807EDD4 0x0078, 0x0068 + _0807E5F8 0x00000100 + WaitForSomething2 0x00000080 + _0807EF3C 0xff80, 0x0000 + CallWithArg sub_0805DE18, 0x00000003 + Wait 0x003c + _0807E5F8 0x00000100 + WaitForSomething2 0x00000080 + _0807E930 0x0001 + Call sub_0807F2D4 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08015684.inc b/data/scripts/script_08015684.inc new file mode 100644 index 00000000..8c4ca549 --- /dev/null +++ b/data/scripts/script_08015684.inc @@ -0,0 +1,46 @@ +SCRIPT_START script_08015684 + BeginBlock + DoPostScriptAction 0x0007 + DoPostScriptAction 0x000b + _0807EB44 0x0000 + DoPostScriptAction 0x0017 + Call sub_0807F180 + EndBlock + WaitForSomething2 0x00000800 + _0807EB44 0x0002 + DoPostScriptAction 0x0017 + Wait 0x000a + _0807EB44 0x0004 + DoPostScriptAction 0x0017 + _0807EB44 0x0004 + DoPostScriptAction 0x001b + _0807E5F8 0x00001000 + WaitForSomething2 0x00000800 + Wait 0x0078 + DoPostScriptAction 0x0004 + Wait 0x0014 + _0807E5F8 0x00001000 + WaitForSomething2 0x00000800 + DoPostScriptAction 0x0018 + Call sub_0807F2D4 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + _0807E5F8 0x00001000 + WaitForSomething2 0x00000800 + _0807EB44 0x0004 + DoPostScriptAction 0x0014 + CallWithArg sub_0809545C, script_08015754 + SoundReq 0x01c4 + Wait 0x0078 + DoPostScriptAction 0x0016 + WaitForSomething2 0x00020000 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + _0807E5F8 0x00001000 + WaitForSomething2 0x00000800 + Call sub_08066CA4 + DoPostScriptAction 0x0008 + Wait 0x0078 + _0807E5F8 0x00001000 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_08015754.inc b/data/scripts/script_08015754.inc new file mode 100644 index 00000000..4dbe2747 --- /dev/null +++ b/data/scripts/script_08015754.inc @@ -0,0 +1,20 @@ +SCRIPT_START script_08015754 + BeginBlock + _0807E930 0x0000 + SetEntitySpeed 0x0200 + Call sub_08094B80 + EndBlock + Wait 0x0078 + SoundReq 0x01c5 + Call sub_08094B6C + _0807EDD4 0x0078, 0x00b8 + SoundReq 0x01c6 + Call sub_08094B80 + _0807E5F8 0x00020000 + SetEntitySpeed 0x0080 + WaitForSomething2 0x00040000 + _0807EDD4 0x0078, 0x00c8 + _0807E5F8 0x00080000 + WaitForSomething2 0x00040000 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_080157AC.inc b/data/scripts/script_080157AC.inc new file mode 100644 index 00000000..b4482406 --- /dev/null +++ b/data/scripts/script_080157AC.inc @@ -0,0 +1,73 @@ +SCRIPT_START script_080157AC + CheckPlayerInRegion 0x01f8, 0x0310, 0x2020 + JumpIfNot script_080157AC + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 + _0807E5F8 0x00000001 + WaitForSomething2 0x00000002 + Call sub_0807DF50 + _0807E878 +script_080157DA: + CheckPlayerInRegion 0x0250, 0x0230, 0x3040 + JumpIfNot script_080157DA + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 + Call sub_0807F3F8 + Wait 0x003c + _0807E5F8 0x00000001 + WaitForSomething2 0x00000002 + StartPlayerScript script_080158F8 + _0807F0B4 0x0001 + SetEntityPositionRelative 0x0248, 0x0218 + CameraTargetEntity + Call sub_0807F5C0 + WaitForSomething2 0x00000010 + _0807E5F8 0x00000008 + WaitForSomething2 0x00000020 + _0807E5F8 0x00000001 + WaitForSomething2 0x00000002 + StartPlayerScript script_08015918 + WaitForSomething2 0x00000010 + _0807E5F8 0x00000001 + WaitForSomething2 0x00000002 + TextboxNoOverlapFollowPos 0x1066, 0x0002 + _0807EA94 + _0807E5F8 0x00000001 + WaitForSomething2 0x00000002 + Call sub_0807DF50 + _0807E878 + Call sub_08066F94 + _0807E5F8 0x00000008 +script_08015880: + CheckRoomFlag 0x0000 + JumpIfNot script_08015880 +script_08015888: + _0807EA94 + ComparePlayerAction 0x001c + JumpIf script_08015888 + _0807E864 + Call sub_0807DF28 + _0807F0B4 0x0002 + SetEntityPositionRelative 0x0248, 0x0208 + CameraTargetEntity + StartPlayerScript script_08015938 + WaitForSomething2 0x00000010 + TextboxNoOverlapFollowPos 0x106a, 0x000c + _0807EA94 + _0807E5F8 0x00000008 + Wait 0x0078 + _0807E8E4_2 + TextboxNoOverlapFollowPos 0x1068, 0x0002 + _0807EA94 + _0807E5F8 0x00000001 + WaitForSomething2 0x00000002 + SetLocalFlag 0x008b + Call sub_08066FB8 + Call sub_0807DF50 + _0807E878 + _0807F0B4 0x0004 + CameraTargetPlayer + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_080158F8.inc b/data/scripts/script_080158F8.inc new file mode 100644 index 00000000..0c4d7f69 --- /dev/null +++ b/data/scripts/script_080158F8.inc @@ -0,0 +1,8 @@ +SCRIPT_START script_080158F8 + SetEntitySpeed 0x0100 + _0807EDD4 0x0218, 0x0238 + _0807EB44 0x0002 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000010 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_08015918.inc b/data/scripts/script_08015918.inc new file mode 100644 index 00000000..2c49a5c5 --- /dev/null +++ b/data/scripts/script_08015918.inc @@ -0,0 +1,8 @@ +SCRIPT_START script_08015918 + SetEntitySpeed 0x0100 + _0807EDD4 0x0238, 0x0228 + _0807EB44 0x0002 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000010 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_08015938.inc b/data/scripts/script_08015938.inc new file mode 100644 index 00000000..df0c766b --- /dev/null +++ b/data/scripts/script_08015938.inc @@ -0,0 +1,8 @@ +SCRIPT_START script_08015938 + SetEntitySpeed 0x0100 + _0807EDD4 0x0248, 0x0208 + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000010 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_08015958.inc b/data/scripts/script_08015958.inc new file mode 100644 index 00000000..362d76c9 --- /dev/null +++ b/data/scripts/script_08015958.inc @@ -0,0 +1,73 @@ +SCRIPT_START script_08015958 + BeginBlock + SetEntitySpeed 0x0180 + DoPostScriptAction 0x0008 + DoPostScriptAction 0x000b + Call sub_08066D04 + EndBlock + WaitForSomething2 0x00000001 + BeginBlock + Call sub_08066D14 + MoveEntityToPlayer + EndBlock + DoPostScriptAction 0x0007 + _0807EB74 + _0807EDD4 0x01f8, 0x02f8 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + TextboxNoOverlapFollowPos 0x1011, 0x0002 + _0807EA94 + _0807EDD4 0x01f8, 0x0268 + SetEntityPositionRelative 0x0248, 0x0218 + _0807EB44 0x0006 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000001 + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000001 + Call sub_0807F3C8 + SoundReq 0x0096 + SetEntitySpeed 0x0200 + _0807ECC4 0x0008 + _0807E930 0x0040 + Call sub_0807F2D4 + _0807EB44 0x0006 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000001 + _0807EB44 0x0006 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000002 + WaitForSomething2 0x00000001 + SetEntitySpeed 0x0100 + _0807EDD4 0x0238, 0x0238 + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + DoPostScriptAction 0x000a + _0807E9D4 + _0807E5F8 0x00000002 +script_08015A32: + EndBlock + BeginBlock + _0807EB74 + CheckRoomFlag 0x0000 + JumpIf script_08015A54 + CheckEntityInteractType + JumpIfNot script_08015A32 + EndBlock + TextboxNoOverlapFollowPos 0x1067, 0x0002 + _0807EA94 + Jump script_08015A32 +script_08015A54: + EndBlock + DoPostScriptAction 0x000b + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + WaitForSomething2 0x00000001 + Call sub_08066D4C + _0807E5F8 0x00000002 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08015A7C.inc b/data/scripts/script_08015A7C.inc new file mode 100644 index 00000000..ade0dcff --- /dev/null +++ b/data/scripts/script_08015A7C.inc @@ -0,0 +1,10 @@ +SCRIPT_START script_08015A7C + SetEntitySpeed 0x0100 + DoPostScriptAction 0x0001 + _0807EC64 0x0010 + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000004 + Call sub_080791BC +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08015AA0.inc b/data/scripts/script_08015AA0.inc new file mode 100644 index 00000000..24b46093 --- /dev/null +++ b/data/scripts/script_08015AA0.inc @@ -0,0 +1,10 @@ +SCRIPT_START script_08015AA0 + SetEntitySpeed 0x0100 + DoPostScriptAction 0x0001 + _0807EC94 0x0010 + _0807EB44 0x0002 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000004 + Call sub_080791BC +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08015AC4.inc b/data/scripts/script_08015AC4.inc new file mode 100644 index 00000000..f2de00b5 --- /dev/null +++ b/data/scripts/script_08015AC4.inc @@ -0,0 +1,21 @@ +SCRIPT_START script_08015AC4 + BeginBlock + DoPostScriptAction 0x0007 + DoPostScriptAction 0x000a + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + EndBlock + WaitForSomething2 0x00000008 + _0807E908 0x0007 + WaitForSomething2 0x00000008 + _0807E908 0x0006 + SetRoomFlag 0x0000 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + WaitForSomething2 0x00000008 + Wait 0x003c + SoundReq 0x0072 + Call sub_08046078 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08015B14.inc b/data/scripts/script_08015B14.inc new file mode 100644 index 00000000..fced2034 --- /dev/null +++ b/data/scripts/script_08015B14.inc @@ -0,0 +1,10 @@ +SCRIPT_START script_08015B14 + BeginBlock + _0807E930 0x0018 + SetEntitySpeed 0x0300 + EndBlock + _0807EDD4 0x0248, 0x0218 + _0807E5F8 0x00000020 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08015B34.inc b/data/scripts/script_08015B34.inc new file mode 100644 index 00000000..3b383a11 --- /dev/null +++ b/data/scripts/script_08015B34.inc @@ -0,0 +1,21 @@ +SCRIPT_START script_08015B34 + EndBlock + BeginBlock + CheckLocalFlag 0x008b + JumpIf script_08015B7E + CallWithArg sub_0807F6B4, 0x00000318 + JumpIfNot script_08015B34 + EndBlock + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 + TextboxNoOverlapFollowPos 0x2506, 0x0002 + _0807EA94 + StartPlayerScript script_08015B84 + WaitForSomething2 0x00000004 + Call sub_0807DF50 + _0807E878 + Jump script_08015B34 +script_08015B7E: + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_08015B84.inc b/data/scripts/script_08015B84.inc new file mode 100644 index 00000000..afe2682a --- /dev/null +++ b/data/scripts/script_08015B84.inc @@ -0,0 +1,10 @@ +SCRIPT_START script_08015B84 + SetEntitySpeed 0x0100 + DoPostScriptAction 0x0001 + _0807EC64 0x0010 + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000004 + Call sub_080791BC +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08015BA8.inc b/data/scripts/script_08015BA8.inc new file mode 100644 index 00000000..0798902d --- /dev/null +++ b/data/scripts/script_08015BA8.inc @@ -0,0 +1,21 @@ +SCRIPT_START script_08015BA8 + BeginBlock + SetLocalFlag 0x008e + _0807E864 + MoveEntityToPlayer + CameraTargetEntity + SetEntitySpeed 0x0200 + EndBlock + Wait 0x000f + _0807E8E4_2 + Call sub_0807F3F8 + Wait 0x001e + _0807EDD4 0x00b8, 0x0258 + Wait 0x001e + SetRoomFlag 0x0065 + Wait 0x0078 + _0807EEB4 + CameraTargetPlayer + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_08015BE8.inc b/data/scripts/script_08015BE8.inc new file mode 100644 index 00000000..afbdefbc --- /dev/null +++ b/data/scripts/script_08015BE8.inc @@ -0,0 +1,40 @@ +SCRIPT_START script_08015BE8 + BeginBlock + SetEntitySpeed 0x0080 + EndBlock +script_08015BF0: + CheckPlayerInRegion 0x0160, 0x0020, 0x3040 + JumpIfNot script_08015BF0 + _0807E864 + Call sub_0807F9A4 + Call sub_0807DF28 + Call sub_0807FBC4 + StartPlayerScript script_08015C7C + WaitForSomething2 0x00000100 + CameraTargetPlayer + _0807E778 0x0004 + _0807E80C 0x00000000 + WaitFor_2 + SoundReq0x80100000 + Call sub_08053BE8 + BeginBlock + _0807E864 + Call sub_0807FBC4 + CameraTargetPlayer + _0807E778 0x0100 + DoFade4 + _0807E80C 0x00000000 + EndBlock + _0807E778 0x0004 + _0807E800 0x00000000 + WaitFor_2 + SoundReq2 0xffff + _0807EB28 0x131f + _0807EA94 + SetLocalFlag 0x009c + Call sub_0807FBCC + Call sub_0807DF50 + _0807E878 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08015C7C.inc b/data/scripts/script_08015C7C.inc new file mode 100644 index 00000000..966109fa --- /dev/null +++ b/data/scripts/script_08015C7C.inc @@ -0,0 +1,19 @@ +SCRIPT_START script_08015C7C + BeginBlock + SetEntitySpeed 0x0080 + EndBlock + DoPostScriptAction 0x0001 + _0807EDD4 0x0168, 0x0058 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + CallWithArg sub_0807F238, 0x000003c5 + Call sub_0807F304 + TextboxNoOverlapFollowPos 0x1318, 0x000c + _0807EA94 + CallWithArg sub_0807F238, 0x000003c9 + Call sub_0807F304 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000100 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_08015CD4.inc b/data/scripts/script_08015CD4.inc new file mode 100644 index 00000000..118b74bc --- /dev/null +++ b/data/scripts/script_08015CD4.inc @@ -0,0 +1,67 @@ +SCRIPT_START script_08015CD4 + BeginBlock + _0807F0B4 0x0007 + SetEntityPositionRelative 0x0088, 0x0068 + CameraTargetEntity + EndBlock + _0807E778 0x0004 + DoFade4 + WaitFor_2 + Wait 0x003c + _0807F0B4 0x0004 + SetEntityPositionRelative 0x0088, 0x00e0 + CameraTargetEntity + Wait 0x003c + SoundReq2 0x000d + _0807E5F8 0x00000010 + WaitForSomething2 0x00000020 + _0807F0B4 0x0004 + SetEntityPositionRelative 0x0088, 0x0070 + CameraTargetEntity + Wait 0x003c + _0807E5F8 0x00000004 + WaitForSomething2 0x00000008 + _0807F0B4 0x0004 + SetEntityPositionRelative 0x0088, 0x00e0 + CameraTargetEntity + Wait 0x003c + _0807E5F8 0x00000010 + WaitForSomething2 0x00000020 + _0807F0B4 0x0004 + SetEntityPositionRelative 0x0088, 0x0070 + CameraTargetEntity + Wait 0x003c + _0807E5F8 0x00000010 + WaitForSomething2 0x00000020 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000008 + _0807E5F8 0x00000010 + WaitForSomething2 0x00000020 + _0807E778 0x0004 + DoFade5 + WaitFor_2 + _0807E5F8 0x00000010 + LoadRoomEntityList gUnk_080FCE30 + SoundReq0x80100000 + Wait 0x0078 + _0807E778 0x0004 + DoFade4 + WaitFor_2 + SoundReq2 0x0034 + _0807E5F8 0x00000040 + WaitForSomething2 0x00000080 + _0807E5F8 0x00000001 + WaitForSomething2 0x00000002 + _0807E5F8 0x00000004 + WaitForSomething2 0x00000008 + _0807E5F8 0x00000200 + Wait 0x003c + _0807E5F8 0x00000004 + WaitForSomething2 0x00000008 + _0807E778 0x0004 + DoFade5 + WaitFor_2 + SoundReq0x80100000 + SetRoomFlag 0x0000 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_08015DF0.inc b/data/scripts/script_08015DF0.inc new file mode 100644 index 00000000..660f818c --- /dev/null +++ b/data/scripts/script_08015DF0.inc @@ -0,0 +1,26 @@ +SCRIPT_START script_08015DF0 + BeginBlock + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + EndBlock + WaitForSomething2 0x00000004 + DoPostScriptAction 0x0004 + Wait 0x003c + TextboxNoOverlap 0x1319 + _0807EA94 + _0807E5F8 0x00000008 + WaitForSomething2 0x00000004 + TextboxNoOverlap 0x131a + _0807EA94 + _0807E5F8 0x00000008 + WaitForSomething2 0x00000004 + TextboxNoOverlap 0x131d + _0807EA94 + _0807E5F8 0x00000008 + WaitForSomething2 0x00000004 + TextboxNoOverlap 0x131e + _0807EA94 + _0807E5F8 0x00000008 + WaitForSomething 0x00000400 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_08015E58.inc b/data/scripts/script_08015E58.inc new file mode 100644 index 00000000..1f4a3001 --- /dev/null +++ b/data/scripts/script_08015E58.inc @@ -0,0 +1,40 @@ +SCRIPT_START script_08015E58 + BeginBlock + DoPostScriptAction 0x0008 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + DoPostScriptAction 0x001d + EndBlock + WaitForSomething2 0x00000010 + Call sub_08066C94 + Wait 0x00e9 + DoPostScriptAction 0x0007 + DoPostScriptAction 0x001e + Wait 0x0014 + _0807EB44 0x0000 + DoPostScriptAction 0x001c + Call sub_0807F2D4 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000020 + WaitForSomething2 0x00000010 + Call sub_08066CA4 + DoPostScriptAction 0x0008 + Wait 0x00bc + _0807E5F8 0x00000020 + WaitForSomething2 0x00000010 + SetEntityPositionRelative 0x0088, 0x0068 + Call sub_08066C94 + Wait 0x00e8 + DoPostScriptAction 0x0007 + DoPostScriptAction 0x001e + Wait 0x0014 + _0807E5F8 0x00000020 + WaitForSomething2 0x00000010 + DoPostScriptAction 0x0014 + Wait 0x001e + TextboxNoOverlap 0x131b + _0807EA94 + _0807E5F8 0x00000020 + WaitForSomething2 0x00000010 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_08015F08.inc b/data/scripts/script_08015F08.inc new file mode 100644 index 00000000..29fc1626 --- /dev/null +++ b/data/scripts/script_08015F08.inc @@ -0,0 +1,14 @@ +SCRIPT_START script_08015F08 + BeginBlock + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + EndBlock + WaitForSomething2 0x00000001 + TextboxNoOverlap 0x131c + _0807EA94 + _0807E5F8 0x00000002 + WaitForSomething 0x00000200 + DoPostScriptAction 0x0005 + WaitForSomething 0x00000400 + DoPostScriptAction 0x0006 +SCRIPT_END diff --git a/data/scripts/script_08015F3C.inc b/data/scripts/script_08015F3C.inc new file mode 100644 index 00000000..6cb4e64b --- /dev/null +++ b/data/scripts/script_08015F3C.inc @@ -0,0 +1,18 @@ +SCRIPT_START script_08015F3C + BeginBlock + SetEntitySpeed 0x0080 + _0807EB44 0x0000 + _0807E930 0x0000 + EndBlock + WaitForSomething 0x00000040 + _0807E930 0x0004 + _0807EC64 0x00c0 + _0807E930 0x0000 + Wait 0x003c + _0807E5F8 0x00000080 + WaitForSomething 0x00000200 + DoPostScriptAction 0x0005 + WaitForSomething 0x00000400 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08015F80.inc b/data/scripts/script_08015F80.inc new file mode 100644 index 00000000..754f1236 --- /dev/null +++ b/data/scripts/script_08015F80.inc @@ -0,0 +1,11 @@ +SCRIPT_START script_08015F80 + BeginBlock + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + EndBlock + WaitForSomething 0x00000200 + DoPostScriptAction 0x0005 + WaitForSomething 0x00000400 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08015FA4.inc b/data/scripts/script_08015FA4.inc new file mode 100644 index 00000000..b33a121f --- /dev/null +++ b/data/scripts/script_08015FA4.inc @@ -0,0 +1,9 @@ +SCRIPT_START script_08015FA4 + BeginBlock + DoPostScriptAction 0x000a + Call sub_08066E38 + EndBlock + WaitForSomething 0x00000400 + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08015FC0.inc b/data/scripts/script_08015FC0.inc new file mode 100644 index 00000000..0182664e --- /dev/null +++ b/data/scripts/script_08015FC0.inc @@ -0,0 +1,20 @@ +SCRIPT_START script_08015FC0 + BeginBlock + Call sub_0806DB84 + CheckKinstoneFused 0x0009 + JumpIf script_08016028 + _0807EA88 0x0009 + CallWithArg sub_0806DA04, 0x00000007 + DoPostScriptAction 0x000a + EndBlock +script_08015FE4: + _0807EA4C + _0807E9F0 + _0807E864 + CheckKinstoneFused 0x0009 + JumpIf script_08015FFE + Call sub_0807DF50 + _0807E878 + Jump script_08015FE4 +script_08015FFE: + _0807F0C8 0xffff, 0x0000 diff --git a/data/scripts/script_08016004.inc b/data/scripts/script_08016004.inc new file mode 100644 index 00000000..7bcdb876 --- /dev/null +++ b/data/scripts/script_08016004.inc @@ -0,0 +1,13 @@ +SCRIPT_START script_08016004 + _0807E5F8 0x00000003 + WaitForSomething2 0x0000000c + _0807F0C8 0x0000, 0x0000 + SoundReq 0x0072 + _0807EB28 0x0b1f + _0807EA94 + Call sub_0807DF50 + _0807E878 +script_08016028: + DoPostScriptAction 0x0006 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_08016030.inc b/data/scripts/script_08016030.inc new file mode 100644 index 00000000..91553bd0 --- /dev/null +++ b/data/scripts/script_08016030.inc @@ -0,0 +1,14 @@ +SCRIPT_START script_08016030 + BeginBlock + CheckKinstoneFused 0x0009 + JumpIf script_08016062 + EndBlock + WaitForSomething2 0x00000001 + DoPostScriptAction 0x0010 + Wait 0x003c + SetEntitySpeed 0x0020 + _0807ECF4 0x0080 + Wait 0x001e + DoPostScriptAction 0x0010 + _0807E5F8 0x00000008 +SCRIPT_END diff --git a/data/scripts/script_08016062.inc b/data/scripts/script_08016062.inc new file mode 100644 index 00000000..d3b89b6b --- /dev/null +++ b/data/scripts/script_08016062.inc @@ -0,0 +1,4 @@ +SCRIPT_START script_08016062 + SetEntityPosition 0xfff0, 0x0000 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_0801606C.inc b/data/scripts/script_0801606C.inc new file mode 100644 index 00000000..b700d7ba --- /dev/null +++ b/data/scripts/script_0801606C.inc @@ -0,0 +1,14 @@ +SCRIPT_START script_0801606C + BeginBlock + CheckKinstoneFused 0x0009 + JumpIf script_0801609E + EndBlock + WaitForSomething2 0x00000002 + DoPostScriptAction 0x0010 + Wait 0x003c + SetEntitySpeed 0x0020 + _0807EC94 0x0080 + Wait 0x001e + DoPostScriptAction 0x0010 + _0807E5F8 0x00000004 +SCRIPT_END diff --git a/data/scripts/script_0801609E.inc b/data/scripts/script_0801609E.inc new file mode 100644 index 00000000..22853136 --- /dev/null +++ b/data/scripts/script_0801609E.inc @@ -0,0 +1,4 @@ +SCRIPT_START script_0801609E + SetEntityPosition 0x0010, 0x0000 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_080160A8.inc b/data/scripts/script_080160A8.inc new file mode 100644 index 00000000..bcd54937 --- /dev/null +++ b/data/scripts/script_080160A8.inc @@ -0,0 +1,207 @@ +SCRIPT_START script_080160A8 + BeginBlock + _0807E9D4 + _0807E930 0x0008 +script_080160B0: + EndBlock + BeginBlock + CheckEntityInteractType + JumpIf script_080160E0 + TestBit 0x00000008 + JumpIf script_080160D2 + TestBit 0x00000010 + JumpIf script_080160D2 + Jump script_080160B0 +script_080160D2: + EndBlock + _0807EB74 + WaitForSomething2 0x00000004 + Jump script_080160B0 +script_080160E0: + _0807E864 + _0807EB74 + EndBlock + HasRoomItemForSale + JumpIfNot script_0801611A + TextboxNoOverlapFollow 0x2d07 + _0807EA94 + _0807E3E8 + JumpIfNot script_08016132 + BuyItem 0x0000, 0x0000 + JumpIf script_0801610C + TextboxNoOverlapFollow 0x2d0b + _0807EA94 + Jump script_08016132 +script_0801610C: + WaitPlayerAction8 + _0807EB8C + TextboxNoOverlapFollow 0x2d0d + _0807EA94 + Jump script_08016132 +script_0801611A: + CheckKinstoneFused 0x0014 + JumpIfNot script_0801612C + TextboxNoOverlapFollow 0x2d09 + _0807EA94 + Jump script_08016132 +script_0801612C: + TextboxNoOverlapFollow 0x2d01 + _0807EA94 +script_08016132: + _0807E878 + _0807EB44 0x0004 + Jump script_080160B0 + BeginBlock + Call sub_080787B4 + EndBlock +script_08016146: + CheckEntityInteractType + JumpIfNot script_08016146 + _0807E864 + GetInventoryValue 0x0025 + TextboxNoOverlapFollowTable 0x2d03, 0x2d02, 0x2d02, 0x2d02 + _0807E3E8 + JumpIfNot script_0801618A + _0807E48C 0x0020 + JumpIf script_08016172 + TextboxNoOverlapFollow 0x2d0c + Jump script_0801618A +script_08016172: + BuyItem 0x0025, 0x0000 + JumpIf script_08016184 + TextboxNoOverlapFollow 0x2d0b + Jump script_0801618A +script_08016184: + WaitPlayerAction8 + TextboxNoOverlapFollow 0x2d06 +script_0801618A: + _0807E878 + Jump script_08016146 + BeginBlock + Call sub_080787B4 + EndBlock +script_0801619A: + CheckEntityInteractType + JumpIfNot script_0801619A + _0807E864 + GetInventoryValue 0x0024 + TextboxNoOverlapFollowTable 0x2d05, 0x2d04, 0x2d04, 0x2d04 + _0807E3E8 + JumpIfNot script_080161E2 + _0807E48C 0x0020 + JumpIf script_080161C6 + TextboxNoOverlapFollow 0x2d0c + Jump script_080161E2 +script_080161C6: + BuyItem 0x0024, 0x0000 + JumpIf script_080161D8 + TextboxNoOverlapFollow 0x2d0b + Jump script_080161E2 +script_080161D8: + WaitPlayerAction8 + _0807EA94 + _0807EB8C + TextboxNoOverlap 0x2d06 +script_080161E2: + _0807E878 + Jump script_0801619A + BeginBlock + Call sub_0807F348 + DoPostScriptAction 0x000a + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + EndBlock +script_080161FE: + Call sub_08068C28 +script_08016204: + CheckEntityInteractType + JumpIfNot script_08016204 + _0807E864 + Call sub_0807DF28 + _0807EB74 + Call sub_08068CA0 + JumpIf script_0801633E + Call sub_08068CFC + JumpIfNot script_08016332 + Call sub_08068DB8 + _0807EA94 + Call sub_08068DD0 + _0807EA94 + _0807E3E8 + JumpIfNot script_08016346 + StartPlayerScript script_0801635C + WaitForSomething2 0x00000001 + _0807EB74 + Call sub_08068C8C + JumpIf script_08016262 + Call sub_08068DE8 + _0807EA94 + Wait 0x001e +script_08016262: + Call sub_08068E00 + _0807EA94 + DoPostScriptAction 0x0001 + Call sub_0807F2D4 + Call sub_08068E90 + Call sub_08068C8C + JumpIf script_0801631C + Call sub_08068F00 + Call sub_08068F14 + Call sub_08068BB4 + CallWithArg sub_0807F244, 0x00010001 + Call sub_08068B84 + Call sub_0807F2A8 + Call sub_08068BD0 + Wait 0x001e + Call sub_08068E18 + _0807EA94 + Call sub_08068EB4 + Call sub_0807DF50 + _0807E878 +script_080162CC: + EndBlock + BeginBlock + Call sub_08068EC4 + JumpIf script_080162F6 + CheckEntityInteractType + JumpIf script_080162E4 + Jump script_080162CC +script_080162E4: + EndBlock + _0807E864 + Call sub_08068E78 + _0807EA94 + _0807E878 + Jump script_080162CC +script_080162F6: + EndBlock + _0807E888 + Call sub_0807F594 + Call sub_0807DF28 + _0807E864 + SoundReq0x80100000 + SoundReq 0x00cd + Wait 0x003c + SoundReq2 0x005e + Call sub_08068F3C +script_0801631C: + Call sub_08068E30 + _0807EA94 + Call sub_08068C6C + WaitPlayerAction8 + _0807EA94 + Jump script_08016346 +script_08016332: + Call sub_08068E60 + _0807EA94 + Jump script_08016346 +script_0801633E: + Call sub_08068E48 + _0807EA94 +script_08016346: + Call sub_0807DF50 + _0807E878 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + Jump script_080161FE + .2byte 0x0000 diff --git a/data/scripts/script_0801635C.inc b/data/scripts/script_0801635C.inc new file mode 100644 index 00000000..002227b9 --- /dev/null +++ b/data/scripts/script_0801635C.inc @@ -0,0 +1,8 @@ +SCRIPT_START script_0801635C + SetEntitySpeed 0x0100 + _0807EDD4 0x0078, 0x0050 + _0807EB44 0x0000 + DoPostScriptAction 0x0000 + _0807E5F8 0x00000001 + Call sub_080791BC +SCRIPT_END diff --git a/data/scripts/script_0801637C.inc b/data/scripts/script_0801637C.inc new file mode 100644 index 00000000..0f1c6a03 --- /dev/null +++ b/data/scripts/script_0801637C.inc @@ -0,0 +1,5 @@ +thumb_func_start script_0801637C +script_0801637C: + push {lr} + bl CreateDust + pop {pc} diff --git a/data/scripts/script_08016384.inc b/data/scripts/script_08016384.inc new file mode 100644 index 00000000..f1d84660 --- /dev/null +++ b/data/scripts/script_08016384.inc @@ -0,0 +1,57 @@ +SCRIPT_START script_08016384 + BeginBlock + EndBlock + Jump script_08016384 + JumpIf script_08016384 + JumpIfNot script_08016384 + JumpTable script_08016384, script_08016384 + JumpAbsolute script_08016384 + JumpAbsoluteIf script_08016384 + JumpAbsoluteIfNot script_08016384 + JumpAbsoluteTable script_08016384, script_08016384 + Call script_08016384 + CallWithArg script_08016384, 0x12345678 + LoadRoomEntityList script_08016384 + TestBit 0x00000001 + CheckInventory1 0x0001 + CheckInventory2 0x0001 + HasRoomItemForSale + CheckLocalFlag 0x0067 + CheckLocalFlagByOffset 0x0100, 0x006b + CheckGlobalFlag 0x0013 + CheckRoomFlag 0x0000 + CheckPlayerInRegion 0x0000, 0x0000, 0x0000 + CheckPlayerInRegion2 0x0000 + CheckEntityInteractType + _0807E30C + HasRupees 0x00c8 + _0807E3E8 + CheckKinstoneFused 0x0001 + BuyItem 0x006c, 0x0000 + _0807E48C 0x0020 + _0807E4CC 0x00000000 + _0807E4EC 0x00000000 + _0807E514 0x00000000 + CheckPlayerFlags 0x00000080 + _0807E564 + EntityHasHeight + ComparePlayerAction 0x0001 + ComparePlayerAnimationState 0x0004 + _0807E5F8 0x00000001 + _0807E610 0x00000002 + SetLocalFlag 0x0067 + SetLocalFlagByOffset 0x0100, 0x0001 + ClearLocalFlag 0x0067 + SetGlobalFlag 0x0013 + ClearGlobalFlag 0x0013 + SetRoomFlag 0x0000 + ClearRoomFlag 0x0000 + Wait 0x001e + WaitForSomething 0x00000001 + WaitForSomething2 0x00000002 + WaitPlayerAction8 + WaitForPlayerAction0x17 + WaitFor_1 + WaitFor_2 + _0807E778 0x0004 + _0807E788 0x0000ffff diff --git a/data/scripts/script_08016482.inc b/data/scripts/script_08016482.inc new file mode 100644 index 00000000..b55e1150 --- /dev/null +++ b/data/scripts/script_08016482.inc @@ -0,0 +1,80 @@ +SCRIPT_START script_08016482 + _0807E79C + Nop2 0x0080 + DoFade4 + DoFade5 + DoFade6 + DoFade7 + _0807E800 0x00000000 + _0807E80C 0x00000000 + _0807E858_0 + _0807E864 + _0807E878 + _0807E888 + SetPlayerAction 0x00005408 + StartPlayerScript script_08016384 + _0807E8D4 0x03a0 + _0807E8E4_0 + _0807E8E4_1 + _0807E8E4_2 + _0807E8E4_3 + _0807E908 0x0004 + SetIntVariable 0x00000000 + _0807E924 + _0807E930 0x0000 + _0807E944 + _0807E974 0x0600 + _0807E9D4 + _0807E9DC + _0807E9E4 0x0000 + _0807EA88 0x0001 + _0807EA94 + TextboxNoOverlapFollow 0x0601 + TextboxNoOverlap 0x0601 + TextboxNoOverlapFollowPos_1 0x0601 + TextboxNoOverlapFollowTable 0x0601, 0x0602, 0x0603 + TextboxNoOverlapVar + _0807EB28 0x0602 + _0807EB38 + _0807EB44 0x0000 + _0807EB4C 0x0000, 0x0000 + _0807EB74 + _0807EB8C + SetEntityDirection 0x0000 + SetEntityDirectionWithAnimationState 0x0000 + SetEntitySpeed 0x0100 + SetEntity0x20 0x00018000 + SetEntityPositionRelative 0x0000, 0x0000 + MoveEntityToPlayer + Nop3 + _0807EC1C 0x0010 + _0807EC64 0x0020 + _0807EC94 0x0030 + _0807ECC4 0x0040 + _0807ECF4 0x0050 + _0807ED24 0x0000, 0x0000, 0x0000 + _0807EDD4 0x0000, 0x0000 + _0807EE04 0x0000, 0x0000 + _0807EE30 + _0807EEB4 + _0807EEF4 0xfff0, 0x0014 + DoPostScriptAction 0x0000 + DoPostScriptAction2 0x0001 + SoundReq 0x0074 + SoundReq2 0x001d + SoundReq3 0x00000074 + SoundReq0x80100000 + ModRupees 0xff38 + ModHealth 0x0010 + IncreaseMaxHealth + _0807F050 0x0001 + _0807F034 0x0001 + GetInventoryValue 0x0001 + _0807F078 0x0001, 0x0002 + _0807F088 0x0001 + CameraTargetEntity + CameraTargetPlayer + _0807F0B4 0x0007 + _0807F0C8 0x003c, 0x0003 +SCRIPT_END + .2byte 0x0000 diff --git a/data/scripts/script_080165A4.inc b/data/scripts/script_080165A4.inc new file mode 100644 index 00000000..c8af0ba1 --- /dev/null +++ b/data/scripts/script_080165A4.inc @@ -0,0 +1,18 @@ +SCRIPT_START script_080165A4 + BeginBlock + DoPostScriptAction 0x000a + _0807EB44 0x0004 + _0807E9D4 + EndBlock +script_080165B2: + _0807E974 0x0601 + Jump script_080165B2 + .2byte 0x0000 +script_080165BC: + Wait 0x001e + CheckPlayerInRegion2 0x2020 + JumpIfNot script_080165BC + DoPostScriptAction 0x0003 + Call script_0801637C+1 + Jump script_080165BC + .2byte 0x0000 diff --git a/data/scripts/script_080165D8.inc b/data/scripts/script_080165D8.inc new file mode 100644 index 00000000..8577e4f6 --- /dev/null +++ b/data/scripts/script_080165D8.inc @@ -0,0 +1,253 @@ +SCRIPT_START script_080165D8 + Wait 0x001e + CheckPlayerInRegion2 0x2020 + JumpAbsoluteIfNot script_080165D8 + DoPostScriptAction 0x0003 + Call script_0801637C+1 + JumpAbsolute script_080165D8 + .2byte 0x0000 + BeginBlock + _0807E9D4 + EndBlock +script_080165FE: + _0807E30C + JumpIfNot script_080165FE + TextboxNoOverlapFollow 0x0601 + Jump script_080165FE + BeginBlock + _0807E9D4 + EndBlock +script_08016612: + _0807E944 + _0807E864 + TextboxNoOverlapFollow 0x0602 + _0807EA94 + Wait 0x000f + _0807E878 + Jump script_08016612 + .2byte 0x0000 + BeginBlock + _0807E9D4 + EndBlock +script_0801662E: + _0807E944 + _0807E864 + _0807EB28 0x0603 + _0807EA94 + Wait 0x000f + _0807E878 + Jump script_0801662E + .2byte 0x0000 + SetEntitySpeed 0x0100 +script_08016648: + _0807ECF4 0x0030 + Wait 0x0008 + _0807ECC4 0x0030 + Wait 0x0008 + _0807EC94 0x0030 + Wait 0x0008 + _0807EC64 0x0030 + Wait 0x0008 + Jump script_08016648 +script_0801666C: + _0807ED24 0x0055, 0x0039, 0x00b4 + Wait 0x0008 + _0807ED24 0x0075, 0x0076, 0x003c + Wait 0x0008 + _0807ED24 0x0105, 0x006c, 0x0078 + Wait 0x0008 + _0807ED24 0x018e, 0x007a, 0x0078 + Wait 0x0008 + _0807ED24 0x0173, 0x0023, 0x003c + Wait 0x0008 + _0807ED24 0x00d8, 0x003f, 0x003c + Wait 0x0008 + Jump script_0801666C + SetEntitySpeed 0x0100 +script_080166BC: + _0807EDD4 0x0055, 0x0039 + Wait 0x0008 + _0807EDD4 0x0075, 0x0076 + Wait 0x0008 + _0807EDD4 0x0105, 0x006c + Wait 0x0008 + _0807EDD4 0x018e, 0x007a + Wait 0x0008 + _0807EDD4 0x0173, 0x0023 + Wait 0x0008 + _0807EDD4 0x00d8, 0x003f + Wait 0x0008 + Jump script_080166BC + SetEntitySpeed 0x0100 +script_08016700: + _0807EC94 0x0030 + _0807E5F8 0x00000002 + Wait 0x000f + DoPostScriptAction 0x0000 + _0807EB44 0x0004 + WaitForSomething 0x00000001 + _0807E610 0x00000001 + DoPostScriptAction 0x0003 + Wait 0x0002 + _0807EB44 0x0006 + Wait 0x0002 + _0807EB44 0x0000 + Wait 0x0002 + _0807EB44 0x0002 + Wait 0x0002 + _0807EB44 0x0004 + WaitForSomething 0x00000001 + _0807E610 0x00000001 + _0807ECF4 0x0030 + Wait 0x000f + DoPostScriptAction 0x0000 + _0807EB44 0x0004 + Wait 0x001e + _0807E5F8 0x00000006 + DoPostScriptAction 0x0003 + Wait 0x0002 + _0807EB44 0x0006 + Wait 0x0002 + _0807EB44 0x0000 + Wait 0x0002 + _0807EB44 0x0002 + Wait 0x0002 + _0807EB44 0x0004 + Wait 0x003c + Jump script_08016700 + SetEntitySpeed 0x0100 +script_0801679C: + WaitForSomething 0x00000002 + _0807E610 0x00000002 + _0807EC94 0x0030 + _0807E5F8 0x00000004 + Wait 0x000f + DoPostScriptAction 0x0000 + _0807EB44 0x0004 + WaitForSomething 0x00000002 + _0807E610 0x00000002 + DoPostScriptAction 0x0003 + Wait 0x0002 + _0807EB44 0x0006 + Wait 0x0002 + _0807EB44 0x0000 + Wait 0x0002 + _0807EB44 0x0002 + Wait 0x0002 + _0807EB44 0x0004 + WaitForSomething 0x00000002 + _0807E610 0x00000002 + _0807ECF4 0x0030 + _0807E5F8 0x00000001 + Wait 0x000f + DoPostScriptAction 0x0000 + _0807EB44 0x0004 + WaitForSomething 0x00000002 + _0807E610 0x00000002 + DoPostScriptAction 0x0003 + Wait 0x0002 + _0807EB44 0x0006 + Wait 0x0002 + _0807EB44 0x0000 + Wait 0x0002 + _0807EB44 0x0002 + Wait 0x0002 + _0807EB44 0x0004 + Jump script_0801679C + SetEntitySpeed 0x0100 +script_08016848: + WaitForSomething 0x00000004 + _0807E610 0x00000004 + _0807EC94 0x0030 + Wait 0x000f + DoPostScriptAction 0x0000 + _0807EB44 0x0004 + Wait 0x001e + _0807E5F8 0x00000003 + DoPostScriptAction 0x0003 + Wait 0x0002 + _0807EB44 0x0006 + Wait 0x0002 + _0807EB44 0x0000 + Wait 0x0002 + _0807EB44 0x0002 + Wait 0x0002 + _0807EB44 0x0004 + Wait 0x003c + _0807ECF4 0x0030 + _0807E5F8 0x00000002 + Wait 0x000f + DoPostScriptAction 0x0000 + _0807EB44 0x0004 + WaitForSomething 0x00000004 + _0807E610 0x00000004 + DoPostScriptAction 0x0003 + Wait 0x0002 + _0807EB44 0x0006 + Wait 0x0002 + _0807EB44 0x0000 + Wait 0x0002 + _0807EB44 0x0002 + Wait 0x0002 + _0807EB44 0x0004 + Jump script_08016848 + BeginBlock + _0807E9D4 + EndBlock +script_080168E6: + _0807E944 + _0807E864 + Wait 0x000f + _0807E878 + Jump script_080168E6 + BeginBlock + Call sub_08064EA4 + _0807EB44 0x0004 + DoPostScriptAction 0x0000 + DoPostScriptAction 0x000a + EndBlock +script_0801690A: + _0807E30C + JumpIfNot script_0801690A + _0807E864 + _0807EB74 + Call sub_08064F28 + _0807EA94 + JumpIfNot script_08016926 + _0807F034 0x003d + WaitPlayerAction8 +script_08016926: + _0807E878 + SetGlobalFlag 0x005c + Jump script_0801690A + BeginBlock + _0807E9D4 + _0807EB44 0x0000 + DoPostScriptAction 0x000a + EndBlock +script_0801693E: + _0807E944 + _0807E864 + Wait 0x0018 + TextboxNoOverlapFollow 0x0a01 + _0807EA94 + Wait 0x000f + _0807E878 + Jump script_0801693E + .2byte 0x0000 + BeginBlock + _0807E9D4 + _0807EB44 0x0000 + DoPostScriptAction 0x000a + _0807E930 0x0000 + EndBlock +script_0801696A: + _0807E944 + _0807E864 + Wait 0x0018 + TextboxNoOverlapFollow 0x0a01 + _0807EA94 + Wait 0x000f + _0807E878 + Jump script_0801696A + .2byte 0x0000 diff --git a/include/area.h b/include/area.h index 4d363a31..1c2ef424 100644 --- a/include/area.h +++ b/include/area.h @@ -11,14 +11,15 @@ typedef struct { u16 localFlagOffset; u8 filler[10]; u16 field_0x10; - u16 field_0x12; - u16 field_0x14; - u8 field_0x16; - u8 field_0x17; + u16 curPortalX; + u16 curPortalY; + u8 curPortalExitDirection; + u8 curPortalType; u8 field_0x18; // u8 filler3[7]; - u8 fadeOut; - u8 filler2[14]; + bool8 playShrinkSeq; + u8 unk1A; + u8 filler2[13]; u8 filler4[0x835]; u32 musicIndex; u32 pMusicIndex; diff --git a/include/arm_proxy.h b/include/arm_proxy.h new file mode 100644 index 00000000..c07a649e --- /dev/null +++ b/include/arm_proxy.h @@ -0,0 +1,6 @@ +#ifndef ARM_PROXY_H +#define ARM_PROXY_H + +extern void PrepNextFrame(void); + +#endif diff --git a/include/position.h b/include/coord.h similarity index 65% rename from include/position.h rename to include/coord.h index 4635a097..b91c97b2 100644 --- a/include/position.h +++ b/include/coord.h @@ -4,11 +4,18 @@ #include "global.h" #include "entity.h" +s16 FixedMul(s16 r0, s16 r1); +s16 FixedDiv(s16 r0, s16 r1); + void CopyPosition(Entity*, Entity*); void PositionEntityOnTop(Entity*, Entity*); void PositionRelative(Entity*, Entity*, s32, s32); +void CopyPositionAndSpriteOffset(Entity* param_1, Entity* param_2); void sub_0806FA90(Entity*, Entity*, s32, s32); void ResolveEntityOnTop(Entity*, Entity*); void sub_0806FAD8(Entity*, Entity*); +const s16 gSineTable[64]; +const s16 gCosineTable[256]; + #endif diff --git a/include/createObject.h b/include/createObject.h new file mode 100644 index 00000000..03f3632e --- /dev/null +++ b/include/createObject.h @@ -0,0 +1,8 @@ +#ifndef CREATEOBJECT_H +#define CREATEOBJECT_H + +// maybe a dedicated (create)Effect.h/c +void CreateDust(Entity* parent); +void CreateDustSmall(Entity* parent); + +#endif // CREATEOBJECT_H diff --git a/include/enemy.h b/include/enemy.h index b12a54e8..0b3e8ecb 100644 --- a/include/enemy.h +++ b/include/enemy.h @@ -89,7 +89,6 @@ extern void VaatiWrath(Entity*); extern void VaatiArm(Entity*); extern void Dust(Entity*); extern void VaatiBall(Entity*); -extern void Octorok(Entity*); extern void Slime(Entity*); extern void MiniSlime(Entity*); extern void FireballGuy(Entity*); @@ -110,6 +109,5 @@ extern void Enemy66(Entity*); extern u32 GetNextFunction(Entity*); extern void EnemyFunctionHandler(Entity*, void (*const func[])(Entity*)); -extern void sub_0804AA30(Entity*, void (*const func[])(Entity*)); extern void sub_08001324(Entity*); #endif diff --git a/include/entity.h b/include/entity.h index a1dd6d93..f19e0876 100644 --- a/include/entity.h +++ b/include/entity.h @@ -47,7 +47,7 @@ typedef struct Entity { /*0x0a*/ u8 type; // was: form /*0x0b*/ u8 type2; // was: parameter /*0x0c*/ u8 action; - /*0x0d*/ u8 previousActionFlag; + /*0x0d*/ u8 subAction; /*0x0e*/ u8 actionDelay; /*0x0f*/ u8 field_0xf; /*0x10*/ u8 flags; @@ -92,7 +92,7 @@ typedef struct Entity { /*0x1e*/ u8 frameIndex; /*0x1f*/ u8 lastFrameIndex; /*0x20*/ s32 field_0x20; - /*0x24*/ s16 nonPlanarMovement; + /*0x24*/ s16 speed; /*0x26*/ u8 spriteAnimation[3]; /*0x29*/ struct { /* */ u8 b0 : 3; // 1-4 @@ -108,7 +108,7 @@ typedef struct Entity { /*0x3a*/ u8 field_0x3a; /*0x3b*/ u8 flags2; /*0x3c*/ u8 field_0x3c; - /*0x3d*/ s8 hurtBlinkTime; + /*0x3d*/ s8 iframes; /*0x3e*/ u8 field_0x3e; /*0x3f*/ u8 damageType; /*0x40*/ u8 field_0x40; @@ -166,37 +166,14 @@ extern LinkedList gUnk_03003D90; extern LinkedList gUnk_03003DA0; #define TILE(x, y) \ - ((((x - gRoomControls.roomOriginX) >> 4) & 0x3fU) | \ - (((y - gRoomControls.roomOriginY) >> 4) & 0x3fU) << 6) + (((((x) - gRoomControls.roomOriginX) >> 4) & 0x3fU) | \ + ((((y) - gRoomControls.roomOriginY) >> 4) & 0x3fU) << 6) #define COORD_TO_TILE(entity) \ - TILE(entity->x.HALF.HI, entity->y.HALF.HI) + TILE((entity)->x.HALF.HI, (entity)->y.HALF.HI) #define COORD_TO_TILE_OFFSET(entity, xOff, yOff) \ - TILE(entity->x.HALF.HI - xOff, entity->y.HALF.HI - yOff) - -extern Entity* CreateEnemy(u32 subtype, u32 form); -extern Entity* CreateObject(u32 subtype, u32 form, u32 parameter); -extern Entity* CreateNPC(u32 subtype, u32 form, u32 parameter); -extern Entity* CreateObjectWithParent(Entity* parent, u32 subtype, u32 form, u32 parameter); -extern Entity* CreateFx(Entity* parent, u32 form, u32 parameter); - -extern void InitializeAnimation(Entity*, u32); -extern void InitAnimationForceUpdate(Entity*, u32); -extern void UpdateAnimationSingleFrame(Entity*); -extern void UpdateSpriteForCollisionLayer(Entity*); -extern void GetNextFrame(Entity*); -extern u32 LoadExtraSpriteData(Entity*, SpriteLoadData*); -extern void SetExtraSpriteFrame(Entity*, u32, u32); -extern void SetSpriteSubEntryOffsetData1(Entity*, u32, u32); -extern void SetSpriteSubEntryOffsetData2(Entity*, u32, u32); - -extern u32 GetFacingDirection(Entity*, Entity*); - -extern void DeleteThisEntity(void); -extern void CopyPosition(Entity*, Entity*); -extern void DeleteEntity(Entity*); -extern void PositionRelative(Entity*, Entity*, s32, s32); + TILE((entity)->x.HALF.HI - (xOff), (entity)->y.HALF.HI - (yOff)) enum { DirectionNorth = 0x00, @@ -211,12 +188,81 @@ enum { #define DirectionIsVertical(expr) ((expr) & 0x10) #define DirectionTurnAround(expr) (DirectionRoundUp(expr) ^ 0x10) #define DirectionToAnimationState(expr) (DirectionRoundUp(expr) >> 3) -#define DirectionFromAnimationState(expr) (expr << 3) +#define DirectionFromAnimationState(expr) ((expr) << 3) #define Direction8Round(expr) ((expr) & 0x1c) #define Direction8RoundUp(expr) Direction8Round((expr) + 2) #define Direction8TurnAround(expr) (Direction8RoundUp(expr) ^ 0x10) #define Direction8ToAnimationState(expr) (Direction8RoundUp(expr) >> 2) -#define Direction8FromAnimationState(expr) (expr << 2) +#define Direction8FromAnimationState(expr) (((expr) << 2) + +Entity* GetEmptyEntity(void); +extern Entity* CreateEnemy(u32 id, u32 type); +extern Entity* CreateNPC(u32 id, u32 type, u32 type2); +extern Entity* CreateObject(u32 id, u32 type, u32 type2); +extern Entity* CreateObjectWithParent(Entity* parent, u32 id, u32 type, u32 type2); +extern Entity* CreateFx(Entity* parent, u32 type, u32 type2); + +extern void InitializeAnimation(Entity*, u32); +extern void InitAnimationForceUpdate(Entity*, u32); +extern void UpdateAnimationSingleFrame(Entity*); +extern void UpdateSpriteForCollisionLayer(Entity*); +extern void GetNextFrame(Entity*); +extern u32 LoadExtraSpriteData(Entity*, SpriteLoadData*); +extern void SetExtraSpriteFrame(Entity*, u32, u32); +extern void SetSpriteSubEntryOffsetData1(Entity*, u32, u32); +extern void SetSpriteSubEntryOffsetData2(Entity*, u32, u32); + +extern u32 GetFacingDirection(Entity*, Entity*); + +/** + * @brief Delete the entity currently in execution. + */ +void DeleteThisEntity(void); + +/** + * @brief Delete an entity. + */ +void DeleteEntity(Entity*); + +/** + * @brief Append entity to linked list. + */ +void AppendEntityToList(Entity* entity, u32 listIndex); + +/** + * @brief Prepend entity to linked list. + */ +void PrependEntityToList(Entity* entity, u32 listIndex); + +/** + * @brief Find an entity for a given kind and ID. + * @return Entity* First result or NULL if none found + */ +Entity* FindEntityByID(u32 kind, u32 id, u32 listIndex); + +/** + * @brief Search all lists for an entity of same kind and id. + * @return Entity* First result or NULL if none found + */ +Entity* DeepFindEntityByID(u32 kind, u32 id); + +/** + * @brief Search all lists for entity of same kind and id. + * @return bool32 Duplicate was entity found + */ +bool32 EntityHasDuplicateID(Entity* ent); + +/** + * @brief Find an entity of same kind and id in list. + * @return Entity* First result or NULL if none found + */ +Entity* FindNextDuplicateID(Entity* ent, int listIndex); + +/** + * @brief Find Entity with full identifiers. + * @return Entity* First result or NULL if none found + */ +Entity* FindEntity(u32 kind, u32 id, u32 listIndex, u32 type, u32 type2); #endif diff --git a/include/fileScreen.h b/include/fileScreen.h index 629dae40..3ec9b15b 100644 --- a/include/fileScreen.h +++ b/include/fileScreen.h @@ -3,12 +3,6 @@ #include "audio.h" #include "global.h" -#include "functions.h" -#include "main.h" -#include "player.h" -#include "readKeyInput.h" -#include "screen.h" -#include "menu.h" #include "save.h" typedef struct { diff --git a/include/functions.h b/include/functions.h index 2c91bdd9..5c62cced 100644 --- a/include/functions.h +++ b/include/functions.h @@ -5,72 +5,50 @@ #include "global.h" #include "entity.h" #include "manager.h" -#include "position.h" +#include "coord.h" #include "player.h" -#include "structures.h" #include "room.h" +#include "structures.h" // Identified - to be sorted into header files -extern u32 Random(void); extern void SoundReq(u32); extern void ShowNPCDialogue(Entity*, Dialog*); -extern u32 UpdateFuseInteraction(); -extern void DeleteEntity(Entity*); -extern u32 __modsi3(u32, u32); extern void DoFade(u32, u32); -extern u32 GetInventoryValue(u32); extern u32 CheckKinstoneFused(u32); extern void ForceEquipItem(u32, u8); -extern void LoadRoomEntityList(); -void CopyPosition(Entity*, Entity*); -extern void ResolveEntityOnTop(Entity*, Entity*); -extern void EnemyFunctionHandler(Entity*, void (*const funcs[])(Entity*)); +extern void LoadRoomEntityList(EntityData* listPtr); extern u32 GetAnimationState(Entity*); extern void SetChildOffset(Entity*, s32, s32, s32); -extern u32 GetFacingDirection(Entity*, Entity*); extern Entity* CreatePlayerItem(u32, u32, u32, u32); -extern Entity* GetEmptyEntity(void); extern u32 GetTileTypeByPos(s32 x, s32 y, u32 layer); extern u32 GetTileType(u32 pos, u32 layer); -extern void MemClear32(void* src, u32 count); extern void EraseAllEntities(void); extern void SetTile(u32, u32, u32); extern void SetDirtTile(u32); extern void LoadRoomTileEntities(); // tba extern Entity* CreateDeathFx(Entity*, u32, u32); extern void UpdateAnimationVariableFrames(Entity*, u32); -extern void CopyPositionAndSpriteOffset(Entity*, Entity*); extern u8* GetSpriteSubEntryOffsetDataPointer(u32, u32); extern u32 LoadFixedGFX(Entity*, u32); -extern void MemFill32(u32, void*, u32); extern Entity* CreateItemEntity(u32, u32, u32); -void MemCopy(const void* src, void* dst, u32 size); extern u32 ProcessMovement(Entity*); -extern Entity* FindEntityInListBySubtype(u32, u32, u32); -extern Entity* FindEntityInListByForm(u32, u32, u32, u32, u32); -extern void MemClear32(void*, u32); extern void MenuFadeIn(u32, u32); extern void LoadResourceAsync(const void*, u32, u32); extern void LoadPaletteGroup(u32); extern void TryLoadPrologueHyruleTown(void); extern Manager* GetEmptyManager(void); -extern void AppendEntityToList(void*, u32); extern void LoadGfxGroup(u32); extern void EnqueueSFX(u32); extern void ResetPlayer(void); -extern void CreateDust(Entity*); extern u32 IsItemEquipped(u32); extern void DeleteManager(Manager*); extern bool32 CheckPlayerInRegion(u32 centerX, u32 centerY, u32 radiusX, u32 radiusY); -extern u32 CheckIsDungeon(); extern u32 GetTileTypeByEntity(Entity*); // Unidentified extern u32 sub_0806ED78(Entity*); -extern void sub_0806920C(Entity*); extern u32 sub_0805ACC0(Entity*); extern u32 sub_0801E99C(Entity*); -extern void sub_0806924C(Entity*); extern Entity* sub_080873AC(Entity*, u32, u32); extern void sub_08078778(Entity*); extern void sub_080787A8(Entity*, u32); @@ -78,33 +56,23 @@ extern void sub_0806F118(Entity*); extern void sub_080791D0(); extern void sub_0805EC9C(); extern void sub_0805EC60(); -extern void sub_080873D0(); -extern u8 sub_080045D4(s16, s16, u32, u32); +extern u32 sub_080045D4(s16, s16, u32, u32); extern void sub_0806F69C(Entity*); extern void sub_0805E3A0(void*, u32); extern void sub_0806D0B0(Entity*); -extern void sub_0807DD64(Entity*); -extern void sub_0807DDE4(Entity*); extern void sub_0806D02C(Entity*); extern u32 sub_0806F5A4(u32); extern void sub_08078784(Entity*, u32); -extern void sub_0807DD50(Entity*); extern s32 sub_0806ED9C(Entity*, u32, u32); extern void sub_0807000C(Entity*); extern void sub_0805E47C(Entity*); extern void sub_0805E584(Entity*); extern void sub_08068BEC(Entity*, u32); -extern void sub_08078778(Entity*); -extern s32 sub_0806ED9C(Entity*, u32, u32); extern s32 sub_0806F078(Entity*, s32); extern void sub_0801D2B4(Entity*, u32); extern void sub_0806FD3C(Entity*); -extern u32 sub_0801E99C(Entity*); -extern void sub_0807DD50(Entity*); -extern void sub_0806F118(Entity*); extern void sub_0805ED14(u32*); extern void sub_080A7C18(u32, u32, u32); -extern void sub_08068BEC(Entity*, u32); extern void sub_0804AA30(Entity*, void (*const funcs[])(Entity*)); extern Entity* sub_0804A9FC(Entity*, u32); extern void sub_0804A720(Entity*); @@ -114,7 +82,7 @@ extern u32 sub_08049FDC(Entity*, u32); extern u32 sub_080041A0(Entity*, Entity*, u32, u32); extern u32 sub_08049EE4(Entity*); extern Entity* sub_0804A98C(Entity*, u8, u8); -extern u32 sub_080544DC(u32); +extern u32 GetBottleContaining(u32); extern void sub_08077E54(Entity*); extern void sub_080042BA(Entity*, u32); extern void sub_08077F24(ItemBehavior*, u32); @@ -151,7 +119,7 @@ extern u32 sub_08060354(void); extern void sub_08057E64(void); extern void sub_0809F814(u32); extern void sub_080300E8(void); -extern void sub_0801DA90(u32); +extern void DispReset(u32); extern void sub_08058D34(void); extern void sub_0807AABC(Entity*); extern void sub_08078A90(u32); @@ -159,8 +127,6 @@ extern void sub_080530C8(void); extern void sub_0805B4D0(u32); extern void sub_0804D0B4(void); extern void sub_0805308C(u32); -extern void sub_0805AF60(); -extern void sub_0805D3C8(u32); extern void sub_080534AC(); extern void sub_0807BA8C(u32, u32); extern void sub_0804D9B0(); @@ -174,7 +140,6 @@ extern void sub_08054564(); extern void sub_0801DD58(u32, u32); extern void sub_0804ED18(); extern void sub_080AF2E4(void); -extern void sub_0805ADD8(u32); extern void sub_0804F578(void); extern void sub_08059994(void); extern s32 sub_0801CFA8(u32); @@ -208,18 +173,8 @@ extern u32 sub_0801766C(Entity*); extern void sub_08004168(Entity*); extern u32 sub_08052638(u32); extern void InitDMA(void); -extern u32 sub_0807CF08(u32, u8*); -extern void sub_0807CF48(u32); -extern u32 sub_0807CF10(u8*); extern void sub_08056208(void); extern void sub_08050384(); -extern void sub_080B1520(u32); -extern struct_0807D1C4* sub_0807D1C4(u32); -extern u32 sub_0807D24C(u32, const char*, u32); -extern void sub_0807CF68(u32); -extern u32 sub_0807D20C(u32, const char*, u32); -extern u32 sub_0807CF88(u32, u8*); -extern u32 sub_0807D184(u32, const char*); extern u32 sub_0806F520(); extern void sub_0806F4E8(Entity*); extern u32 sub_0806F3E4(Entity*); @@ -276,7 +231,6 @@ u32 sub_0806FCB8(Entity*, u32, u32, u32); extern Entity* sub_080A7EE0(u32); extern void sub_080A1D70(Entity*, u32); extern void sub_0806F62C(Entity*, u32, u32); -extern u32 sub_08079F8C(void); extern void sub_080A1ED0(u32, u32, u32); extern u32 sub_0806F5B0(u32); extern void sub_0801DFB4(Entity*, u32, u32, u32); @@ -288,7 +242,7 @@ extern u32 sub_08052734(); // has Dungeon Map? extern u32 sub_08052764(); // has Dungeon Compass? extern u32 sub_0805279C(); // has Dungeon Big Key? extern u32 sub_080527CC(); // num Dungeon small keys? -extern u32 sub_08053FE0(); +extern u32 GetItemPrice(); extern void sub_08078790(Entity*, u32); extern void sub_080788E0(Entity*); extern void sub_08078AA8(u32, u32); @@ -302,7 +256,6 @@ extern void sub_080791BC9(); extern void sub_080791BC(); extern void sub_08056360(); extern u32 sub_080542AC(u32); -extern void sub_0807A108(); extern u32 sub_08079FC4(u32); extern void sub_0800455E(Entity*); extern void sub_08008790(Entity*, u32); diff --git a/include/game.h b/include/game.h new file mode 100644 index 00000000..dec15e21 --- /dev/null +++ b/include/game.h @@ -0,0 +1,6 @@ +#ifndef GAME_H +#define GAME_H + +u32 CheckIsDungeon(void); + +#endif // GAME_H diff --git a/include/gba/eeprom.h b/include/gba/eeprom.h new file mode 100644 index 00000000..46c7e35c --- /dev/null +++ b/include/gba/eeprom.h @@ -0,0 +1,21 @@ +#ifndef GUARD_GBA_EEPROM +#define GUARD_GBA_EEPROM + +// error codes +#define EEPROM_OUT_OF_RANGE 0x80ff +#define EEPROM_COMPARE_FAILED 0x8000 +#define EEPROM_UNSUPPORTED_TYPE 0x8080 + +/** + * selects EEPROM type + * selects 512byte on invalid argument + * + * @param unk_1 4 for 512 byte, 0x40 for 8k + * @return 1 on invalid argument, 0 otherwise + */ +u16 EEPROMConfigure(u16 unk_1); +u16 EEPROMRead(u16 address, u16* data); +u16 EEPROMCompare(u16 address, const u16* data); +u16 EEPROMWrite0_8k_Check(u16 address, const u16* data); + +#endif // GUARD_GBA_EEPROM diff --git a/include/gba/macro.h b/include/gba/macro.h index b08ed921..f142d5c0 100644 --- a/include/gba/macro.h +++ b/include/gba/macro.h @@ -1,16 +1,16 @@ #ifndef GUARD_GBA_MACRO_H #define GUARD_GBA_MACRO_H -#define CPU_FILL(value, dest, size, bit) \ - { \ - vu##bit tmp = (vu##bit)(value); \ - CpuSet((void*)&tmp, dest, CPU_SET_##bit##BIT | CPU_SET_SRC_FIXED | ((size) / (bit / 8) & 0x1FFFFF)); \ +#define CPU_FILL(value, dest, size, bit) \ + { \ + vu##bit tmp = (vu##bit)(value); \ + CpuSet((void*)&tmp, dest, CPU_SET_##bit##BIT | CPU_SET_SRC_FIXED | ((size) / ((bit) / 8) & 0x1FFFFF)); \ } #define CpuFill16(value, dest, size) CPU_FILL(value, dest, size, 16) #define CpuFill32(value, dest, size) CPU_FILL(value, dest, size, 32) -#define CPU_COPY(src, dest, size, bit) CpuSet(src, dest, CPU_SET_##bit##BIT | ((size) / (bit / 8) & 0x1FFFFF)) +#define CPU_COPY(src, dest, size, bit) CpuSet(src, dest, CPU_SET_##bit##BIT | ((size) / ((bit) / 8) & 0x1FFFFF)) #define CpuCopy16(src, dest, size) CPU_COPY(src, dest, size, 16) #define CpuCopy32(src, dest, size) CPU_COPY(src, dest, size, 32) @@ -42,7 +42,7 @@ vu##bit tmp = (vu##bit)(value); \ DmaSet(dmaNum, &tmp, dest, \ (DMA_ENABLE | DMA_START_NOW | DMA_##bit##BIT | DMA_SRC_FIXED | DMA_DEST_INC) << 16 | \ - ((size) / (bit / 8))); \ + ((size) / ((bit) / 8))); \ } #define DmaFill16(dmaNum, value, dest, size) DMA_FILL(dmaNum, value, dest, size, 16) @@ -65,7 +65,7 @@ #define DMA_COPY(dmaNum, src, dest, size, bit) \ DmaSet(dmaNum, src, dest, \ - (DMA_ENABLE | DMA_START_NOW | DMA_##bit##BIT | DMA_SRC_INC | DMA_DEST_INC) << 16 | ((size) / (bit / 8))) + (DMA_ENABLE | DMA_START_NOW | DMA_##bit##BIT | DMA_SRC_INC | DMA_DEST_INC) << 16 | ((size) / ((bit) / 8))) #define DmaCopy16(dmaNum, src, dest, size) DMA_COPY(dmaNum, src, dest, size, 16) #define DmaCopy32(dmaNum, src, dest, size) DMA_COPY(dmaNum, src, dest, size, 32) @@ -112,7 +112,7 @@ #define DmaFillLarge(dmaNum, value, dest, size, block, bit) \ { \ - void* _dest = (void*)dest; \ + void* _dest = (void*)(dest); \ u32 _size = size; \ while (1) { \ DmaFill##bit(dmaNum, value, _dest, (block)); \ @@ -149,7 +149,7 @@ #define DmaFillDefvars(dmaNum, value, dest, size, bit) \ { \ - void* _dest = (void*)dest; \ + void* _dest = (void*)(dest); \ u32 _size = size; \ DmaFill##bit(dmaNum, value, _dest, _size); \ } @@ -180,7 +180,7 @@ \ imeTemp = REG_IME; \ REG_IME = 0; \ - REG_IE |= flags; \ + REG_IE |= (flags); \ REG_IME = imeTemp; \ } diff --git a/include/global.h b/include/global.h index de47c6ac..489f276d 100644 --- a/include/global.h +++ b/include/global.h @@ -31,9 +31,9 @@ #define SWAP(a, b, temp) \ { \ - temp = a; \ - a = b; \ - b = temp; \ + (temp) = a; \ + (a) = b; \ + (b) = temp; \ } // useful math macros @@ -47,25 +47,25 @@ #define min(a, b) ((a) < (b) ? (a) : (b)) #define max(a, b) ((a) >= (b) ? (a) : (b)) -#define BOOLCAST(x) ((-x | x) >> 31) +#define BOOLCAST(x) ((-(x) | (x)) >> 31) #define static_assert(cond) extern char assertion[(cond) ? 1 : -1] #if NON_MATCHING -#define asmfunc(prologue, path) +#define ASM_FUNC(path, decl) #else -#define asmfunc(prologue, path) \ - NAKED prologue { \ +#define ASM_FUNC(path, decl) \ + NAKED decl { \ asm(".include " #path); \ } #endif #if NON_MATCHING -#define NONMATCH(prologue, path) prologue +#define NONMATCH(path, decl) decl #define END_NONMATCH #else -#define NONMATCH(path, prologue) \ - NAKED prologue { \ - asm(".include " #path); \ +#define NONMATCH(path, decl) \ + NAKED decl { \ + asm(".include " #path); \ if (0) #define END_NONMATCH } #endif diff --git a/include/greatFairy.h b/include/greatFairy.h index 31a37c99..fd325b6c 100644 --- a/include/greatFairy.h +++ b/include/greatFairy.h @@ -3,23 +3,9 @@ #include "screen.h" -extern u32 __modsi3(u32, u32); -extern void InitializeAnimation(Entity*, u32); -extern void GreatFairy_InitializeAnimation(Entity*); -extern u32 CheckRoomFlag(); -extern Entity* GreatFairy_CreateForm(Entity*, u32, u32); -extern void PositionRelative(); -extern void CopyPosition(); -extern void DoFade(); -extern void SoundReq(); -extern void GetNextFrame(); -extern void sub_0805EC9C(); -extern void sub_0805EC60(); -extern void sub_080873D0(); -extern void DeleteEntity(); -extern void sub_0806F69C(); -extern Entity* FindEntityInListBySubtype(u32, u32, u32); -extern void sub_080791D0(); +void GreatFairy_InitializeAnimation(Entity*); +Entity* GreatFairy_CreateForm(Entity*, u32, u32); +void sub_080873D0(); extern void (*const GreatFairy_Main[])(Entity*); extern void (*const GreatFairy_Behaviors[])(Entity*); extern void (*const GreatFairy_WingsBehaviors[])(Entity*); @@ -35,20 +21,9 @@ extern void (*const GreatFairy_Form2Behaviors[])(Entity*); extern void (*const gUnk_081207A4[])(Entity*); extern u32 gUnk_0810C2E4; -extern RoomControls gRoomControls; -extern Entity gPlayerEntity; extern const s16 GreatFairy_RippleOffsets[10]; extern u32 gUnk_02034350; -extern RoomVars gRoomVars; -extern Screen gScreen; -extern struct_02033280 gUnk_02033280; extern u8 gUnk_0812079C[8]; -extern s16 gSineTable[]; extern s8 gUnk_081207AC[]; -typedef struct { - s32 unk0; - s32 unk4; -} struct_08087424; - #endif diff --git a/include/item.h b/include/item.h index e0dc4bbb..0f9fd6f2 100644 --- a/include/item.h +++ b/include/item.h @@ -7,36 +7,19 @@ extern void DebugItem(ItemBehavior*, u32); extern void Sword(ItemBehavior*, u32); -extern void Sword(ItemBehavior*, u32); -extern void Sword(ItemBehavior*, u32); -extern void Sword(ItemBehavior*, u32); -extern void Sword(ItemBehavior*, u32); -extern void Sword(ItemBehavior*, u32); -extern void Bomb(ItemBehavior*, u32); extern void Bomb(ItemBehavior*, u32); extern void Bow(ItemBehavior*, u32); -extern void Bow(ItemBehavior*, u32); -extern void sub_08075D14(ItemBehavior*, u32); extern void sub_08075D14(ItemBehavior*, u32); extern void Shield(ItemBehavior*, u32); -extern void Shield(ItemBehavior*, u32); -extern void Lantern(ItemBehavior*, u32); extern void Lantern(ItemBehavior*, u32); extern void GustJar(ItemBehavior*, u32); extern void PacciCane(ItemBehavior*, u32); extern void MoleMitts(ItemBehavior*, u32); extern void RocsCape(ItemBehavior*, u32); extern void sub_08076800(ItemBehavior*, u32); -extern void DebugItem(ItemBehavior*, u32); extern void Ocarina(ItemBehavior*, u32); -extern void DebugItem(ItemBehavior*, u32); -extern void DebugItem(ItemBehavior*, u32); -extern void DebugItem(ItemBehavior*, u32); extern void TryPickupObject(ItemBehavior*, u32); extern void JarEmpty(ItemBehavior*, u32); -extern void JarEmpty(ItemBehavior*, u32); -extern void JarEmpty(ItemBehavior*, u32); -extern void JarEmpty(ItemBehavior*, u32); /* On hold until naming conflicts are resolved */ /* diff --git a/include/main.h b/include/main.h index 6ab823a6..1653a40e 100644 --- a/include/main.h +++ b/include/main.h @@ -77,19 +77,13 @@ static_assert(sizeof(UI) == 0x3b4); extern Main gMain; extern UI gUnk_02032EC0; -void InitScreen(); +void InitScreen(u32 screen); extern void InitSound(void); -extern void sub_0807CE90(void); -extern void sub_080560B8(void); extern void sub_08056208(void); extern void sub_0804FFE4(void); -extern void MessageInitialize(void); extern void sub_080ADD30(void); -extern void InitScreen(u32); -extern void PrepNextFrame(void); -extern void ReadKeyInput(void); extern void DoSoftReset(void); extern void sub_08056260(void); extern void VBlankIntrWait(); diff --git a/include/manager.h b/include/manager.h index f292baf2..d86f203c 100644 --- a/include/manager.h +++ b/include/manager.h @@ -26,7 +26,7 @@ typedef struct Manager { /*0x11*/ u8 unk_11[3]; /*0x14*/ struct Manager* parent; /*0x18*/ u8 unk_18[0x8]; - // union SplitHWord unk_20; + // union SplitHWord y; // u16 unk_22; // u16 unk_24; // u16 unk_26; diff --git a/include/npc.h b/include/npc.h index b27a82f9..ec7fc861 100644 --- a/include/npc.h +++ b/include/npc.h @@ -42,10 +42,6 @@ extern void SittingPerson_Head(Entity*); extern void SittingPerson_Fusion(Entity*); extern void Pina(Entity*); extern void Pina_Fusion(Entity*); -extern void Guard(Entity*); -extern void Guard_Head(Entity*); -extern void Maid(Entity*); -extern void Maid_Head(Entity*); extern void Din(Entity*); extern void Din_Fusion(Entity*); extern void Nayru(Entity*); diff --git a/include/player.h b/include/player.h index e9d96665..da6f324b 100644 --- a/include/player.h +++ b/include/player.h @@ -6,6 +6,41 @@ #include "global.h" #include "entity.h" +enum { + PLAYER_INIT, + PLAYER_NORMAL, + PLAYER_DUMMY, + PLAYER_FALL, + PLAYER_JUMP, + PLAYER_PUSH, + PLAYER_BOUNCE, + PLAYER_08070E9C, + PLAYER_ITEMGET, + PLAYER_MINISH, + PLAYER_MINISHDIE, + PLAYER_08071DB8, + PLAYER_EMPTYBOTTLE, + PLAYER_FROZEN, + PLAYER_0807204C, + PLAYER_080720DC, + PLAYER_PULL, + PLAYER_LAVA, + PLAYER_WARP, + PLAYER_08072454, + PLAYER_DROWN, + PLAYER_USEPORTAL, + PLAYER_TALKEZLO, + PLAYER_ROOMTRANSITION, + PLAYER_ROLL, + PLAYER_080728AC, + PLAYER_INHOLE, + PLAYER_08072C9C, + PLAYER_08074C44, + PLAYER_08072F34, + PLAYER_USEENTRANCE, + PLAYER_PARACHUTE, +}; + typedef struct { /*0x00*/ u8 field_0x0[2]; /*0x02*/ u8 jumpStatus; @@ -17,12 +52,14 @@ typedef struct { /*0x0a*/ u8 field_0xa; /*0x0b*/ u8 keepFacing; /*0x0c*/ u8 playerAction; - /*0x0d*/ u8 field_0xd[2]; + /*0x0d*/ u8 field_0xd; + /*0x0e*/ u8 field_0xe; /*0x0f*/ u8 hurtBlinkSpeed; /*0x10*/ u8 field_0x10[4]; /*0x11*/ u8 field_0x14; /*0x11*/ u8 field_0x15; - /*0x14*/ u16 field_0x16[2]; + /*0x14*/ u16 startPosX; + /*0x16*/ u16 startPosY; /*0x1a*/ u8 field_0x1a[2]; /*0x1c*/ u8 field_0x1c; /*0x1d*/ u8 field_0x1d[5]; diff --git a/include/readKeyInput.h b/include/readKeyInput.h deleted file mode 100644 index 7961c2b6..00000000 --- a/include/readKeyInput.h +++ /dev/null @@ -1,9 +0,0 @@ -typedef struct { - u16 heldKeys; - u16 newKeys; - u16 unk4; - u8 unk6; - u8 unk7; -} Input; - -extern Input gInput; diff --git a/include/save.h b/include/save.h index eaf1eaf5..6dea6212 100644 --- a/include/save.h +++ b/include/save.h @@ -21,7 +21,7 @@ typedef enum { SAVE_DONE, } SaveState; -extern SaveResult sub_0807CDA4(SaveState state); +extern SaveResult HandleSave(u32 arg0); typedef struct { /*0x000*/ u8 filler0[0x2]; @@ -46,7 +46,11 @@ typedef struct { extern SaveFile gSave; -s32 sub_0807CF28(u32, SaveFile*); -u32 sub_0807CF30(SaveFile*); +u32 InitSaveData(void); + +u32 Write_02000000(struct_02000000*); +s32 ReadSaveFile(u32, SaveFile*); +u32 Read_02000000(struct_02000000*); +void SetFileStatusDeleted(u32 index); #endif \ No newline at end of file diff --git a/include/script.h b/include/script.h index 9abc5291..cfc2c180 100644 --- a/include/script.h +++ b/include/script.h @@ -3,34 +3,39 @@ #include "global.h" -typedef struct { - u16* unk_00; - u32 unk_04; - u32 unk_08; +typedef struct ScriptExecutionContext { + u16* scriptInstructionPointer; + u32 intVariable; + u32 postScriptActions; u8 unk_0C[0x4]; // unused - u16 unk_10; + u16 wait; u16 unk_12; - u32 unk_14; + u32 condition; u8 unk_18; u8 unk_19; u8 unk_1A; u8 unk_1B; // unused - union SplitWord unk_1C; - union SplitWord unk_20; + union SplitWord x; + union SplitWord y; } ScriptExecutionContext; -extern void ExecuteScriptCommandSet(Entity*, ScriptExecutionContext*); +void ExecuteScript(Entity* entity, ScriptExecutionContext* context); extern u32 GetNextScriptCommandHalfword(u16*); extern u32 GetNextScriptCommandWord(u16*); extern u32 GetNextScriptCommandWordAfterCommandMetadata(u16*); extern u32 GetNextScriptCommandHalfwordAfterCommandMetadata(u16*); -extern void StartPlayerScript(u16*); +void UnloadCutsceneData(Entity* entity); +void StartPlayerScript(u16*); -extern void sub_0807DEDC(Entity*, ScriptExecutionContext*, u32, u32); +void sub_0807DD50(Entity* entity); +void sub_0807DD64(Entity* entity); +void sub_0807DD80(Entity* entity, u16* script); +void sub_0807DEDC(Entity*, ScriptExecutionContext*, u32, u32); -extern ScriptExecutionContext* StartCutscene(Entity*, u16*); -extern void sub_0807DDAC(Entity*, void (*function)(Entity*, ScriptExecutionContext*)); -extern void sub_0807DD94(Entity*, void (*function)(Entity*, ScriptExecutionContext*)); +ScriptExecutionContext* StartCutscene(Entity* entity, u16* script); +void ExecuteScriptForEntity(Entity* entity, void (*postScriptCallback)(Entity*, ScriptExecutionContext*)); +void HandleEntity0x82Actions(Entity* entity); +void sub_0807DD94(Entity*, void (*function)(Entity*, ScriptExecutionContext*)); #endif diff --git a/include/structures.h b/include/structures.h index f1758ae5..d47ee7a1 100644 --- a/include/structures.h +++ b/include/structures.h @@ -26,15 +26,6 @@ typedef struct { extern struct_02000040 gUnk_02000040; -typedef struct { - u16 field_0x0; - u16 field_0x2; - u16 field_0x4; - u16 field_0x6; - u16 field_0x8; - u16 field_0xa; -} struct_0807D1C4; - typedef struct { s32 signature; u8 field_0x4; @@ -48,8 +39,7 @@ typedef struct { u8 field_0x4[0x4]; bool8 transitioningOut; u8 transitionType; // transition when changing areas - u8 field_0xa; // seems to be a tile type - u8 field_0xb; + u16 field_0xa; // seems to be a tile type u8 areaID; u8 roomID; u8 playerState; @@ -130,13 +120,13 @@ extern struct_02024490 gUnk_02024490; typedef struct { u32 unk_00; - u16 unk_04; - u8 unk_06; - u8 unk_07; + u16 commandIndex; + u8 commandSize; + u8 flags; u8 unk_08; } struct_02033280; -extern struct_02033280 gUnk_02033280; +extern struct_02033280 gActiveScriptInfo; typedef struct { u16 unk_00; @@ -176,6 +166,22 @@ extern BG3Buffer gBG3Buffer; static_assert(sizeof(BG3Buffer) == 0x1000); */ +struct { + u8 filler[0x70]; +} extern gUnk_03000B80; +static_assert(sizeof(gUnk_03000B80) == 0x70); + +typedef struct { + u8 unk0; + u8 unk1; + u8 unk2; + u8 unk3; + u8 freezeTime; + u8 unk9; +} EntityHandler; + +extern EntityHandler gUnk_03003DC0; + extern u8 gUnk_02022740[]; extern u8 gUnk_02034490[]; diff --git a/include/textbox.h b/include/textbox.h index 4b0333a5..817d50a0 100644 --- a/include/textbox.h +++ b/include/textbox.h @@ -56,9 +56,40 @@ typedef struct { extern struct_02022780 gUnk_02022780; static_assert(sizeof(struct_02022780) == 0xa8); +/** + * @brief Initialize the message system. + */ +void MessageInitialize(void); + +/** + * @brief Show a message on screen. + * + * @param index u32 Message index + */ void ShowTextbox(u32 index); + +/** + * @brief Show a message at screen posiiton. + * + * @param index u32 Message index + * @param x u32 Screen x + * @param y u32 Screen y + */ void TextboxAtPosition(u32 index, u32 x, u32 y); + +/** + * @brief Show a message that attempts not to obscure the entity. + * + * @param index u32 Message index + * @param ent Entity* Your important entity + */ void TextboxNoOverlap(u32 index, Entity* ent); + +/** + * @brief Show a message that attempts not to obscure the camera target. + * + * @param index u32 Message index + */ void TextboxNoOverlapFollow(u32 index); #endif diff --git a/include/trig.h b/include/trig.h deleted file mode 100644 index 0e6e44a9..00000000 --- a/include/trig.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef TRIG_H -#define TRIG_H - -extern const s16 gSineTable[]; -extern const s16 gCosineTable[]; - -#endif diff --git a/include/utils.h b/include/utils.h new file mode 100644 index 00000000..040eacee --- /dev/null +++ b/include/utils.h @@ -0,0 +1,64 @@ +typedef struct { + u16 heldKeys; + u16 newKeys; + u16 unk4; + u8 unk6; + u8 unk7; +} Input; + +extern Input gInput; + +/** + * Fill memory with 16 bit value. + */ +void MemFill16(u32 value, void* dest, u32 size); + +/** + * Fill memory with 32 bit value. + */ +void MemFill32(u32 value, void* dest, u32 size); + +/** + * Clear memory. + */ +void MemClear(void* dest, u32 size); + +/** + * Copy memory. + */ +void MemCopy(const void* src, void* dest, u32 size); + +/** + * Refresh gInput from hardware registers. + */ +void ReadKeyInput(void); + +void LoadPalettes(const u8*, int, int); +void LoadPaletteGroup(u32 group); + +/** + * Allocate memory on heap. + * + * The heap size is 0x1000 bytes and should be used sparingly. + * It is customary for entities store the returned handle in their 'myHeap' field. + * + * @param size u32 Size to be allocated + * @return void* Pointer to allocated memory + */ +void* zMalloc(u32 size); + +/** + * Free memory from heap. + * + * The entity system will automatically free the address stored in the 'myHeap' field. + * + * @param ptr void* Handle to be freed + */ +void zFree(void* ptr); + +/** + * Reset All display hardware registers. + * + * @param updateHUD bool32 Request refresh of HUD layer (bg 0) + */ +void DispReset(bool32 updateHUD); diff --git a/linker.ld b/linker.ld index 80ec99ed..a6c4c24d 100644 --- a/linker.ld +++ b/linker.ld @@ -112,7 +112,7 @@ SECTIONS { . = 0x00032EC0; gUnk_02032EC0 = .; . = 0x00032EDC; gUnk_02032EDC = .; . = 0x00032F14; gUnk_02032F14 = .; - . = 0x00033280; gUnk_02033280 = .; + . = 0x00033280; gActiveScriptInfo = .; . = 0x00033290; gUnk_02033290 = .; . = 0x00033A90; gArea = .; . = 0x00033AB8; gUnk_02033AB8 = .; @@ -148,7 +148,7 @@ SECTIONS { . = 0x000369F0; gUnk_020369F0 = .; . = 0x00036A38; gUnk_02036A38 = .; . = 0x00036A40; gUnk_02036A40 = .; - . = 0x00036A50; gUnk_02036A50 = .; + . = 0x00036A50; gEEPROMConfig = .; . = 0x00036A58; gUnk_02036A58 = .; . = 0x00036AD8; gUnk_02036AD8 = .; . = 0x00036BB8; gUnk_02036BB8 = .; @@ -258,7 +258,7 @@ SECTIONS { . = 0x00005D24; gUnk_03005D24 = .; . = 0x00005D58; gUnk_03005D58 = .; . = 0x00005D5C; gUnk_03005D5C = .; - . = 0x00005D90; gUnk_03005D90 = .; + . = 0x00005D90; IntrMain = .; . = 0x00005E60; gUnk_03005E60 = .; . = 0x00005E98; gUnk_03005E98 = .; . = 0x00005F24; _EntUpdate = .; @@ -295,6 +295,9 @@ SECTIONS { asm/code_080043E8.o(.text); data/data_08007DF4.o(.rodata); asm/code_0800857C.o(.text); + /* scripts */ + data/scripts.o(.text); + asm/code_08016984.o(.text); asm/sub_08016AE4.o(.text); @@ -324,10 +327,7 @@ SECTIONS { asm/code_0801C85C.o(.text); src/ezloNag.o(.text); asm/code_0801CEC0.o(.text); - src/dma.o(.text); - src/input.o(.text); - src/code_0801D714.o(.text); - src/code_0801D79C.o(.text); + src/utils.o(.text); asm/code_0801D79C.o(.text); /* enemies */ src/enemy/octorok.o(.text); @@ -448,13 +448,12 @@ SECTIONS { src/loadRoomEntityList.o(.text); asm/loadRoomEntity.o(.text); asm/code_0804AEB0.o(.text); - src/sub_0804AFF4.o(.text); src/loadRoom.o(.text); asm/code_0804B058.o(.text); src/room.o(.text); asm/code_0804B9F8.o(.text); src/sub_08050008.o(.text); - src/sub_08050024.o(.text); + src/fade.o(.text); asm/code_08050038.o(.text); src/fileScreen.o(.text); asm/fileScreen.o(.text); @@ -537,7 +536,7 @@ SECTIONS { src/code_0805EC04.o(.text); asm/code_0805EC04.o(.text); src/code_0805F9A0.o(.text); - src/screenDebug.o(.text); + src/debugScreen.o(.text); src/item14.o(.text); /* npcs */ src/npc/gentari.o(.text); @@ -627,7 +626,7 @@ SECTIONS { src/npc/mayorHagen.o(.text); src/npc/bigGoron.o(.text); asm/bigGoron.o(.text); - src/ezloCap.o(.text); + src/npc/ezloCap.o(.text); asm/npc4E.o(.text); src/npc/clothesRack.o(.text); asm/clothesRack.o(.text); @@ -643,9 +642,7 @@ SECTIONS { asm/code_0806EC20.o(.text); src/createNPC.o(.text); asm/code_0806ED78.o(.text); - src/sub_0806F9EC.o(.text); - src/sub_0806FA04.o(.text); - src/position.o(.text); + src/coord.o(.text); asm/code_0806FA6C.o(.text); src/player.o(.text); asm/code_08070698.o(.text); @@ -660,13 +657,9 @@ SECTIONS { asm/code_08077B98.o(.text); src/code_08078778.o(.text); asm/code_08078778.o(.text); - src/sub_0807B7D8.o(.text); src/sub_0807B820.o(.text); - src/sub_0807B8A8.o(.text); - src/sub_0807B930.o(.text); asm/code_0807B9B8.o(.text); src/sub_0807C998.o(.text); - src/sub_0801D754.o(.text); /* ??? */ asm/sub_0807CA18.o(.text); asm/getInventoryValue.o(.text); asm/code_0807CAA0.o(.text); @@ -762,7 +755,6 @@ SECTIONS { asm/pushableFurniture.o(.text); asm/furniture.o(.text); src/object/minishSizedEntrance.o(.text); - asm/minishSizedEntrance.o(.text); src/object/archway.o(.text); asm/giantRock.o(.text); asm/object51.o(.text); @@ -796,7 +788,7 @@ SECTIONS { asm/minecartDoor.o(.text); asm/objectOnPillar.o(.text); src/object/mineralWaterSource.o(.text); - asm/minishSizedArchway.o(.text); + src/object/minishSizedArchway.o(.text); asm/object70.o(.text); asm/pushableGrave.o(.text); asm/object72.o(.text); @@ -900,7 +892,7 @@ SECTIONS { asm/m4a_asm.o(.text); asm/m4a.o(.text); asm/libagbsyscall.o(.text); - asm/code_080B1520.o(.text); + src/eeprom.o(.text); *libc.a:memcpy.o(.text); /* handwritten assembly in arm mode */ @@ -912,7 +904,7 @@ SECTIONS { src/manager.o(.rodata); src/npc.o(.rodata); data/data_080B3740.o(.rodata); - src/trig.o(.rodata); + src/coord.o(.rodata); data/data_080C93E0.o(.rodata); src/enemy/octorok.o(.rodata); data/animations/octorok.o(.rodata); @@ -1014,6 +1006,10 @@ SECTIONS { src/manager/manager27.o(.rodata); src/manager/manager28.o(.rodata); data/data_08108D30.o(.rodata); + src/npc/ezloCap.o(.rodata); + data/data_08114208.o(.rodata); + src/player.o(.rodata); + data/data_0811B9E0.o(.rodata); src/item.o(.rodata); data/data_0811BD44.o(.rodata); data/room_headers.o(.rodata); @@ -1033,6 +1029,7 @@ SECTIONS { data/strings.o(.rodata); data/sprite_table.o(.rodata); data/data_089FC6C4.o(.rodata); + src/eeprom.o(.rodata); } >rom /* DWARF 2 sections */ diff --git a/progress.py b/progress.py index e7a9956b..f2e83eb0 100644 --- a/progress.py +++ b/progress.py @@ -1,6 +1,6 @@ -import csv, git, re - +import csv, git, re, argparse, os +from itertools import chain map = open("tmc.map", "r") src = 0 @@ -8,6 +8,63 @@ asm = 0 srcData = 0 data = 0 +parser = argparse.ArgumentParser() +parser.add_argument("-m", "--matching", dest='matching', action='store_true', help="Output matching progress instead of decompilation progress") +args = parser.parse_args() +matching = args.matching + +NON_MATCHING_PATTERN = r'((?<=NONMATCH\(")asm/non_matching/.*\.inc)|((?<=NONMATCH\(")asm/non_matching/.*\.s)' +NON_ASM_PATTERN = r'(^\w+:)|(^\s@)|(^\s*\.)|(^\s*thumb_func_start)' + +#def remInvalid(x): + +def GetNonMatchingFunctions(files): + functions = [] + + for file in files: + with open(file) as f: + functions += re.findall(NON_MATCHING_PATTERN, f.read()) + + #functions = map(lambda x: x != "", functions) + return functions + +def ReadAllLines(fileName): + lineList = list() + with open(fileName) as f: + lineList = f.readlines() + + return lineList + +def GetFiles(path, ext): + files = [] + for r, d, f in os.walk(path): + for file in f: + if file.endswith(ext): + files.append(os.path.join(r, file)) + + return files + +nonMatchingFunctions = GetNonMatchingFunctions(GetFiles("src", ".c")) if not args.matching else [] + +# this is actually the size of all non matching asm, not (total - non matching) +def GetNonMatchingSize(path): + size = 0 + + asmFiles = GetFiles(path, ".s") + GetFiles(path, ".inc") + + for asmFilePath in asmFiles: + for x in nonMatchingFunctions: # stupid tuple + if asmFilePath in x: + asmLines = ReadAllLines(asmFilePath) + + for asmLine in asmLines: + if len(re.findall(NON_ASM_PATTERN, asmLine, re.DOTALL)) == 0: + size += 4 + + return size + +nonMatchingASM = GetNonMatchingSize("asm/non_matching") + for line in map: reg = re.compile(r"^ \.(\w+)\s+0x[0-9a-f]+\s+(0x[0-9a-f]+) (\w+)\/(.+)\.o") matches = reg.split(line) @@ -20,7 +77,7 @@ for line in map: direc = matches[3] basename = matches[4] - # From original script, not sure what this is doing... + # alignment? idk if (size & 3): size += 4 - (size % 3) @@ -38,8 +95,13 @@ for line in map: total = src + asm dataTotal = srcData + data -srcPct = "%.4f" % (100 * src / total) -asmPct = "%.4f" % (100 * asm / total) +if matching: + srcPct = "%.4f" % (100 * (src) / total) + asmPct = "%.4f" % (100 * (asm) / total) +else: + srcPct = "%.4f" % (100 * (src + nonMatchingASM) / total) + asmPct = "%.4f" % (100 * (asm - nonMatchingASM) / total) + srcDataPct = "%.4f" % (100 * srcData / dataTotal) dataPct = "%.4f" % (100 * data / dataTotal) @@ -53,4 +115,4 @@ git_hash = git_object.hexsha csv_list = [str(version), timestamp, git_hash, str(srcPct), str(asmPct), str(srcDataPct), str(dataPct)] -print(",".join(csv_list)) \ No newline at end of file +print(",".join(csv_list)) diff --git a/src/arm_proxy.c b/src/arm_proxy.c index e18e4a1c..4e153936 100644 --- a/src/arm_proxy.c +++ b/src/arm_proxy.c @@ -8,6 +8,7 @@ #include "functions.h" #include "object.h" #include "manager.h" +#include "utils.h" #include "npc.h" extern u8 gUnk_03003DE0; @@ -30,7 +31,7 @@ extern void LoadResources(); extern void FadeMain(); extern u32 sub_0805E3B0(); extern void HandlePlayerLife(); -extern void sub_08070680(); +extern void DoPlayerAction(); extern void sub_080171F0(); extern void sub_08078FB0(); extern void DrawEntity(); @@ -68,17 +69,6 @@ typedef struct { } NPCStruct; extern NPCStruct gUnk_02031EC0[100]; -typedef struct { - u8 unk0; - u8 unk1; - u8 unk2; - u8 unk3; - u8 freezeTime; - u8 unk9; -} EntityHandler; - -extern EntityHandler gUnk_03003DC0; - typedef struct { void* last; void* first; @@ -156,7 +146,7 @@ void PlayerUpdate(Entity* this) { } } HandlePlayerLife(this); - sub_08070680(this); + DoPlayerAction(this); if ((this->height.WORD == 0) && (this->action == 1 || this->action == 9)) sub_08008790(this, 8); sub_080171F0(); @@ -174,7 +164,7 @@ void HandlePlayerLife(Entity* this) { gUnk_0200AF00.filler25[8] = 0; gUnk_0200AF00.filler25[9] = 0; - if ((gPlayerEntity.bitfield & 0x80) && (gPlayerEntity.hurtBlinkTime > 0)) + if ((gPlayerEntity.bitfield & 0x80) && (gPlayerEntity.iframes > 0)) SoundReq(SFX_86); gPlayerState.flags.all &= ~(0x2000000 | 0x200); @@ -263,7 +253,7 @@ void sub_080171F0(void) { gPlayerState.field_0x1a[0] = 0; gPlayerState.field_0x80 = 0; gPlayerState.field_0xaa = 0; - MemClear32(&gUnk_03003BE0, 0x8c); + MemClear(&gUnk_03003BE0, 0x8c); gPlayerEntity.spriteOffsetY = gPlayerState.field_0x3f; gPlayerState.field_0x3f = 0; sub_0807B0C8(); @@ -278,7 +268,7 @@ void sub_080171F0(void) { sub_0807A8D8(&gPlayerEntity); if (gPlayerState.jumpStatus & 0xc0) - gPlayerEntity.hurtBlinkTime = 0xfe; + gPlayerEntity.iframes = 0xfe; if (gPlayerEntity.action != 0x17) { sub_08077FEC(gPlayerEntity.action); @@ -286,17 +276,17 @@ void sub_080171F0(void) { } void ItemUpdate(Entity* this) { - if ((this->flags & 1) == 0 && this->action == 0 && this->previousActionFlag == 0) + if ((this->flags & 1) == 0 && this->action == 0 && this->subAction == 0) ItemInit(this); if (!sub_0805E3B0(this)) { gPlayerItemFunctions[this->id](this); this->bitfield &= ~0x80; - if (this->hurtBlinkTime != 0) { - if (this->hurtBlinkTime > 0) - this->hurtBlinkTime--; + if (this->iframes != 0) { + if (this->iframes > 0) + this->iframes--; else - this->hurtBlinkTime++; + this->iframes++; } } DrawEntity(this); @@ -340,8 +330,8 @@ void ObjectUpdate(Entity* this) { if (((this->flags & 1) == 0) && (this->action == 0)) sub_080A2838(this); - if (this->hurtBlinkTime != 0) - this->hurtBlinkTime++; + if (this->iframes != 0) + this->iframes++; if (!sub_0805E3B0(this)) { gObjectFunctions[this->id](this); this->bitfield &= ~0x80; @@ -403,7 +393,7 @@ void CollisionMain(void) { } void RegisterPlayerHitbox(void) { - MemClear32(&gUnk_03003C70, sizeof(gUnk_03003C70)); + MemClear(&gUnk_03003C70, sizeof(gUnk_03003C70)); gUnk_02018EA0 = (LinkedList2*)&gUnk_03003C70[0].last; gUnk_03003C70[0].last = &gUnk_03003C70[0].last; gUnk_03003C70[0].first = &gUnk_03003C70[0].last; diff --git a/src/code_08018C58.c b/src/code_08018C58.c index fd918e31..14caf9cd 100644 --- a/src/code_08018C58.c +++ b/src/code_08018C58.c @@ -1,5 +1,4 @@ #include "global.h" -#include "entity.h" extern u32 SetTileType(u32 tileID, u32 tilePos, u32 layerID); diff --git a/src/code_0801D714.c b/src/code_0801D714.c deleted file mode 100755 index f3e59253..00000000 --- a/src/code_0801D714.c +++ /dev/null @@ -1,43 +0,0 @@ -#include "global.h" - -extern void LoadPalettes(const u8*, int, int); - -extern u32 gUsedPalettes; -extern u16 gPaletteBuffer[]; - -typedef struct { - u16 paletteId; - u8 destPaletteNum; - u8 numPalettes; -} PaletteGroup; - -extern const PaletteGroup* gPaletteGroups[]; -extern const u8 gGlobalGfxAndPalettes[]; - -void LoadPaletteGroup(u32 group) { - const PaletteGroup* paletteGroup = gPaletteGroups[group]; - while (1) { - u32 destPaletteNum = paletteGroup->destPaletteNum; - u32 numPalettes = paletteGroup->numPalettes & 0xF; - if (numPalettes == 0) { - numPalettes = 16; - } - LoadPalettes(&gGlobalGfxAndPalettes[paletteGroup->paletteId * 32], destPaletteNum, numPalettes); - if ((paletteGroup->numPalettes & 0x80) == 0) { - break; - } - paletteGroup++; - } -} - -void LoadPalettes(const u8* src, int destPaletteNum, int numPalettes) { - u16* dest; - u32 size = numPalettes * 32; - u32 usedPalettesMask = 1 << destPaletteNum; - while (--numPalettes > 0) { - usedPalettesMask |= (usedPalettesMask << 1); - } - gUsedPalettes |= usedPalettesMask; - dest = &gPaletteBuffer[destPaletteNum * 16]; - DmaCopy32(3, src, dest, size); -} diff --git a/src/code_0801D79C.c b/src/code_0801D79C.c deleted file mode 100644 index 8f085aae..00000000 --- a/src/code_0801D79C.c +++ /dev/null @@ -1,96 +0,0 @@ -#include "global.h" -#include "screen.h" -#include "structures.h" - -extern u16 gPaletteBuffer[]; -extern u32 gUsedPalettes; - -typedef struct { - union { - int raw; - struct { - u8 filler0[0x3]; - u8 unk3; - } bytes; - } unk0; - u32 dest; - u32 unk8; -} GfxItem; - -extern const GfxItem* gUnk_08100AA8[]; -extern const u8 gGlobalGfxAndPalettes[]; - -void sub_0801D79C(u32 colorIndex, u32 color) { - gPaletteBuffer[colorIndex] = color; - gUsedPalettes |= 1 << (colorIndex / 16); -} - -void sub_0801D7BC(u32 color, u32 arg1) { - if (arg1) { - gScreen.lcd.unk6 = 0xE0FF; - } else { - gScreen.lcd.unk6 = 0xFFFF; - } - sub_0801D79C(0, color); -} - -void LoadGfxGroup(u32 group) { - u32 terminator; - u32 dmaCtrl; - int gfxOffset; - const u8* src; - u32 dest; - int size; - const GfxItem* gfxItem = gUnk_08100AA8[group]; - while (1) { - u32 loadGfx = FALSE; - u32 ctrl = gfxItem->unk0.bytes.unk3; - ctrl &= 0xF; - switch (ctrl) { - case 0x7: - loadGfx = TRUE; - break; - case 0xD: - return; - case 0xE: - if (((struct_02000000*)0x2000000)->gameLanguage > 1) { - loadGfx = TRUE; - } - break; - case 0xF: - if (((struct_02000000*)0x2000000)->gameLanguage != 0) { - loadGfx = TRUE; - } - break; - default: - if (ctrl == ((struct_02000000*)0x2000000)->gameLanguage) { - loadGfx = TRUE; - } - break; - } - - if (loadGfx) { - gfxOffset = gfxItem->unk0.raw & 0xFFFFFF; - src = &gGlobalGfxAndPalettes[gfxOffset]; - dest = gfxItem->dest; - size = gfxItem->unk8; - dmaCtrl = 0x80000000; - if (size < 0) { - if (dest >= VRAM) { - LZ77UnCompVram(src, (void*)dest); - } else { - LZ77UnCompWram(src, (void*)dest); - } - } else { - DmaSet(3, src, dest, dmaCtrl | ((u32)size >> 1)); - } - } - - terminator = gfxItem->unk0.bytes.unk3; - terminator &= 0x80; - gfxItem++; - if (!terminator) { - break; - } - } -} diff --git a/src/code_080300AC.c b/src/code_080300AC.c index 12564596..993de6ee 100644 --- a/src/code_080300AC.c +++ b/src/code_080300AC.c @@ -1,9 +1,7 @@ #include "global.h" -#include "entity.h" +#include "utils.h" #include "functions.h" -// extern void DmaZero(void*, u32); - typedef struct { u16 unk0; u16 filler2[32]; @@ -13,13 +11,13 @@ typedef struct { extern struct_0300110C gUnk_0300110C; void sub_080300AC(void) { - MemClear32(&gUnk_0300110C.unk0, 0x44); + MemClear(&gUnk_0300110C.unk0, 0x44); gUnk_0300110C.unk66 = 0xff; } void sub_080300C4(void) { if (gScreenTransition.field_0xae == 0xff) { gScreenTransition.field_0xac = 0; - MemClear32(&gScreenTransition.field_0x4c[32], 0x40); + MemClear(&gScreenTransition.field_0x4c[32], 0x40); } } diff --git a/src/code_0804AA84.c b/src/code_0804AA84.c index 59485d74..cdc00c3f 100644 --- a/src/code_0804AA84.c +++ b/src/code_0804AA84.c @@ -2,6 +2,7 @@ #include "entity.h" #include "area.h" #include "main.h" +#include "utils.h" #include "functions.h" #include "screen.h" @@ -10,15 +11,13 @@ typedef struct { u32 unk; } struct_02018EB0; -extern void sub_0805E5A8(); - extern void (*const gUnk_080D4120[])(); extern void (*const gUnk_080D412C[])(); extern struct_02018EB0 gUnk_02018EB0; u32 sub_0804AA84(void) { - if (gArea.fadeOut != 0) { + if (gArea.playShrinkSeq) { gMain.transition = 4; gArea.filler[8] = 0; gArea.filler[9] = 0; @@ -26,8 +25,8 @@ u32 sub_0804AA84(void) { sub_0805E5A8(); return 1; } else { - gArea.filler[18] = gArea.fadeOut; - *(vu8*)&gArea.fadeOut = gArea.fadeOut; + gArea.filler[18] = gArea.playShrinkSeq; + *(vu8*)&gArea.playShrinkSeq = gArea.playShrinkSeq; return 0; } } @@ -37,10 +36,10 @@ void sub_0804AAB8(void) { } void sub_0804AAD4(void) { - MemClear32((void*)&gUnk_02018EB0, 0x28); + MemClear(&gUnk_02018EB0, 0x28); gUnk_02018EB0.unk = 0; EraseAllEntities(); - CreateObject(0x3d, gArea.field_0x17, 0); + CreateObject(0x3d, gArea.curPortalType, 0); gArea.filler[8]++; } diff --git a/src/code_0805436C.c b/src/code_0805436C.c index 76a9b18c..2e12b6b0 100644 --- a/src/code_0805436C.c +++ b/src/code_0805436C.c @@ -1,5 +1,4 @@ #include "global.h" -#include "entity.h" #include "player.h" #include "room.h" #include "menu.h" @@ -133,7 +132,7 @@ u32 sub_080544C8(u32 arg0) { } } -u32 sub_080544DC(u32 arg0) { +u32 GetBottleContaining(u32 arg0) { if (arg0 == gSave.stats.bottles[0]) { return 1; } else if (arg0 == gSave.stats.bottles[1]) { @@ -255,7 +254,7 @@ u32 CreateItemDrop(Entity* arg0, u32 itemID, u32 itemParameter) { arg0->attachedEntity = itemEntity; } else if (arg0->id == 0x1e) { itemEntity->direction = arg0->animationState << 3 | 0x80; - itemEntity->nonPlanarMovement = 0xc0; + itemEntity->speed = 0xc0; itemEntity->field_0x20 = 0x18000; } } diff --git a/src/code_0805EC04.c b/src/code_0805EC04.c index 1981f507..6c847707 100644 --- a/src/code_0805EC04.c +++ b/src/code_0805EC04.c @@ -104,4 +104,4 @@ void sub_0805ED14(u32 param_1) { gPlayerState.field_0x9c = param_1; gPlayerState.field_0x98 = 0; gPlayerState.field_0x9a = 0; -} \ No newline at end of file +} diff --git a/src/code_0805F9A0.c b/src/code_0805F9A0.c index 33f037ad..66ac2ba9 100644 --- a/src/code_0805F9A0.c +++ b/src/code_0805F9A0.c @@ -1,6 +1,7 @@ #include "global.h" -#include "functions.h" +#include "utils.h" #include "structures.h" +#include "functions.h" extern u16 gUnk_081092D4; extern u8 gUnk_02036AD8; diff --git a/src/code_08077B98.c b/src/code_08077B98.c index c3fbf5dd..856dc44b 100644 --- a/src/code_08077B98.c +++ b/src/code_08077B98.c @@ -82,7 +82,7 @@ void* sub_08077C54(UnkItemStruct* unk) { Entity* sub_08077C94(ItemBehavior* arg0, u32 arg1) { Entity* iVar1; - iVar1 = FindEntityInListBySubtype(8, gUnk_0811BE48[arg1].unk[3], 2); + iVar1 = FindEntityByID(8, gUnk_0811BE48[arg1].unk[3], 2); if (iVar1 == NULL) { return NULL; } diff --git a/src/code_08077DF4.c b/src/code_08077DF4.c index 1697ecb0..c25aa18e 100644 --- a/src/code_08077DF4.c +++ b/src/code_08077DF4.c @@ -1,6 +1,7 @@ #include "global.h" #include "entity.h" #include "player.h" +#include "utils.h" #include "functions.h" typedef struct { @@ -35,7 +36,7 @@ void sub_08077E3C(Entity* ent, u32 idx) { void sub_08077E54(Entity* ent) { ent->action = gPlayerEntity.animIndex; *(u8*)&ent->spriteIndex = gPlayerEntity.frameIndex; - ent->previousActionFlag = gPlayerEntity.frameDuration; + ent->subAction = gPlayerEntity.frameDuration; ent->actionDelay = gPlayerEntity.frames.all; } @@ -57,7 +58,7 @@ void sub_08077E78(void* arg0, u32 bits) { not = ~not ; gPlayerState.field_0xa &= not ; gPlayerState.keepFacing &= not ; - MemClear32(arg0, 0x1c); + MemClear(arg0, 0x1c); } u32 sub_08077EC8(Unk_struct* arg0) { diff --git a/src/code_0808091C.c b/src/code_0808091C.c index 1916869c..0ea3dbcf 100644 --- a/src/code_0808091C.c +++ b/src/code_0808091C.c @@ -4,16 +4,13 @@ #include "functions.h" #include "room.h" -extern void sub_0805E5A8(); extern void sub_08080BC4(void); -extern RoomControls gRoomControls; extern u32 gUnk_0200B650; extern u32 gUnk_02025EB0; extern u8 gUnk_02000070; extern void DoExitTransition(ScreenTransitionData*); -extern void sub_080809D4(); void sub_080808D8(void) { gScreenTransition.transitionType = 0; diff --git a/src/code_080A29BC.c b/src/code_080A29BC.c index d33d3b94..c8476217 100644 --- a/src/code_080A29BC.c +++ b/src/code_080A29BC.c @@ -2,7 +2,7 @@ #include "entity.h" #include "room.h" -void sub_080A29BC(Entity* parent) { +void sub_080A29BC(Entity* parent) { // TODO this is CreateDust, why is it here again? Fogot to delete file? CreateFx(parent, 2, 0); } diff --git a/src/trig.c b/src/coord.c similarity index 88% rename from src/trig.c rename to src/coord.c index bb53c2fe..28dda7c6 100644 --- a/src/trig.c +++ b/src/coord.c @@ -1,7 +1,71 @@ #include "global.h" +#include "entity.h" +#include "coord.h" + +extern u8 gUnk_08114F78[]; +extern u8 gUnk_08114F80[]; + +s16 FixedMul(s16 r0, s16 r1) { + s32 temp = r0 * r1; + if (temp < 0) + return (temp + 255) >> 8; + else + return temp >> 8; +} + +s16 FixedDiv(s16 r0, s16 r1) { + if (r1 == 0) + return 0; + else + return (r0 * 256) / r1; +} + +void CopyPosition(Entity* param_1, Entity* param_2) { + PositionRelative(param_1, param_2, 0, 0); +} + +void PositionEntityOnTop(Entity* ent, Entity* ent2) { + PositionRelative(ent, ent2, 0, 0); + ResolveEntityOnTop(ent, ent2); +} + +void PositionRelative(Entity* source, Entity* target, s32 offsetX, s32 offsetY) { // r0, r1, r2, r3 + s32 x; + s32 y; + + x = source->x.WORD; + target->x.WORD = x + offsetX; + + y = source->y.WORD; + target->y.WORD = y + offsetY; + + target->height = source->height; // ldr + target->collisionLayer = source->collisionLayer; + UpdateSpriteForCollisionLayer(target); +} + +void CopyPositionAndSpriteOffset(Entity* param_1, Entity* param_2) { + param_2->spriteOffsetX = param_1->spriteOffsetX; + param_2->spriteOffsetY = param_1->spriteOffsetY; + PositionRelative(param_1, param_2, 0, 0); +} + +void sub_0806FA90(Entity* param_1, Entity* param_2, s32 offsetX, s32 offsetY) { + param_2->spriteOffsetX = param_1->spriteOffsetX; + param_2->spriteOffsetY = param_1->spriteOffsetY; + PositionRelative(param_1, param_2, offsetX * 64 * 32 * 32, offsetY * 64 * 32 * 32); +} + +void ResolveEntityOnTop(Entity* param_1, Entity* param_2) { + param_2->spritePriority.b0 = gUnk_08114F78[param_1->spritePriority.b0]; +} + +void sub_0806FAD8(Entity* param_1, Entity* param_2) { + param_2->spritePriority.b0 = gUnk_08114F80[param_1->spritePriority.b0]; +} // Values of sin(x*(π/128)) as Q8.8 fixed-point numbers from x = 0 to x = 319 -const s16 gSineTable[] = { +const s16 gSineTable[64] = { Q_8_8(0), // sin(0*(π/128)) Q_8_8(0.0234375), // sin(1*(π/128)) Q_8_8(0.046875), // sin(2*(π/128)) @@ -68,8 +132,7 @@ const s16 gSineTable[] = { Q_8_8(0.99609375), // sin(63*(π/128)) }; -const s16 gCosineTable[] = { - +const s16 gCosineTable[256] = { Q_8_8(1), // sin(64*(π/128)) Q_8_8(0.99609375), // sin(65*(π/128)) Q_8_8(0.99609375), // sin(66*(π/128)) diff --git a/src/createEnemy.c b/src/createEnemy.c index 5ce7af89..73eb5e5c 100644 --- a/src/createEnemy.c +++ b/src/createEnemy.c @@ -1,8 +1,5 @@ -#include "entity.h" #include "global.h" - -extern Entity* GetEmptyEntity(); -extern void AppendEntityToList(Entity*, u8); +#include "entity.h" Entity* CreateEnemy(u32 subtype, u32 form) { Entity* enemy; diff --git a/src/createEntity.c b/src/createEntity.c index e83312a1..9948a780 100644 --- a/src/createEntity.c +++ b/src/createEntity.c @@ -2,8 +2,8 @@ // #include "entityData.h" // #include "global.h" -// extern Entity * FindEntityBySubtype(u32, u32); -// extern Entity * GetEmptyEntityByType(); +// extern Entity * DeepFindEntityByID(u32, u32); +// extern Entity * GetEmptyEntityByKind(); // extern void RegisterRoomEntity(Entity *, EntityData *); // extern u32 sub_0804AF0C(Entity *, EntityData *); // extern void sub_08016A30(Entity *); @@ -17,11 +17,11 @@ // type = param_1->entityType & 15; // if (((param_1->field_0x1 & 240) == 80) && -// (preexisting = FindEntityBySubtype(type,param_1->entitySubtype), preexisting != NULL)) { +// (preexisting = DeepFindEntityByID(type,param_1->entitySubtype), preexisting != NULL)) { // entity = NULL; // } // else { -// entity = GetEmptyEntityByType(); //Get empty entity +// entity = GetEmptyEntityByKind(); //Get empty entity // if (entity != NULL) { // (entity->entityType).type = type; // (entity->entityType).subtype = param_1->entitySubtype; diff --git a/src/createNPC.c b/src/createNPC.c index b8a30fdf..7e57e92e 100644 --- a/src/createNPC.c +++ b/src/createNPC.c @@ -1,19 +1,16 @@ #include "global.h" #include "entity.h" -extern Entity* GetEmptyEntity(); -extern void AppendEntityToList(Entity*, u8); - Entity* CreateNPC(u32 subtype, u32 form, u32 parameter) { - Entity* pEVar1; + Entity* entity; - pEVar1 = GetEmptyEntity(); - if (pEVar1 != NULL) { - pEVar1->kind = 7; - pEVar1->id = subtype; - pEVar1->type = form; - pEVar1->type2 = parameter; - AppendEntityToList(pEVar1, 7); + entity = GetEmptyEntity(); + if (entity != NULL) { + entity->kind = 7; + entity->id = subtype; + entity->type = form; + entity->type2 = parameter; + AppendEntityToList(entity, 7); } - return pEVar1; + return entity; } diff --git a/src/createObject.c b/src/createObject.c index 62c67062..16f5df16 100644 --- a/src/createObject.c +++ b/src/createObject.c @@ -1,22 +1,21 @@ #include "global.h" #include "entity.h" +#include "coord.h" #include "room.h" - -extern Entity* GetEmptyEntity(); -extern void AppendEntityToList(Entity*, u8); +#include "createObject.h" Entity* CreateObject(u32 subtype, u32 form, u32 parameter) { - Entity* ent; + Entity* entity; - ent = GetEmptyEntity(); - if (ent != NULL) { - ent->kind = 6; - ent->id = subtype; - ent->type = form; - ent->type2 = parameter; - AppendEntityToList(ent, 6); + entity = GetEmptyEntity(); + if (entity != NULL) { + entity->kind = 6; + entity->id = subtype; + entity->type = form; + entity->type2 = parameter; + AppendEntityToList(entity, 6); } - return ent; + return entity; } Entity* CreateObjectWithParent(Entity* parentEnt, u32 subtype, u32 form, u32 parameter) { diff --git a/src/screenDebug.c b/src/debugScreen.c similarity index 87% rename from src/screenDebug.c rename to src/debugScreen.c index 2271e2b7..bc034e8e 100644 --- a/src/screenDebug.c +++ b/src/debugScreen.c @@ -1,4 +1,5 @@ #include "global.h" +#include "utils.h" #include "functions.h" #include "main.h" #include "menu.h" @@ -6,13 +7,6 @@ #include "structures.h" #include "textbox.h" -typedef struct { - u16 unk0; - u16 unk2; - u16 unk4; -} VStruct; - -extern VStruct gInput; extern u8 gBG3Buffer[]; extern void (*const gUnk_08109A30[])(); @@ -22,9 +16,9 @@ void HandleDebugTextScreen() { } void sub_0805FA04(void) { - sub_0801DA90(1); - MemClear32((void*)&gBG0Buffer, sizeof(BGBuffer)); - MemClear32((void*)&gBG3Buffer, 0x1000); + DispReset(1); + MemClear(&gBG0Buffer, sizeof(BGBuffer)); + MemClear(&gBG3Buffer, 0x1000); gScreen.lcd.displayControl = 0x940; gScreen.bg.bg0xOffset = 0; gScreen.bg.bg0yOffset = 0; @@ -33,8 +27,8 @@ void sub_0805FA04(void) { gScreen.affine.bg3Control = 0x1e0f; gScreen.affine.bg3Updated = 1; MessageInitialize(); - MemClear32((void*)&gUnk_02032EC0, sizeof(UI)); - MemClear32((void*)&gMenu, sizeof(Menu)); + MemClear((void*)&gUnk_02032EC0, sizeof(UI)); + MemClear((void*)&gMenu, sizeof(Menu)); gMenu.unk16 = gUnk_02000000->gameLanguage; sub_08053320(); sub_0801D79C(0, 0x1144); @@ -46,7 +40,7 @@ void sub_0805FA04(void) { void sub_0805FA98(void) { int iVar1; - switch (gInput.unk2) { + switch (gInput.newKeys) { case 0x40: gMenu.focusCoords[1] -= 1; break; diff --git a/src/dma.c b/src/dma.c deleted file mode 100644 index 4c79f72e..00000000 --- a/src/dma.c +++ /dev/null @@ -1,49 +0,0 @@ -#include "global.h" -#include "entity.h" - -void MemFill32(u32, u8*, u32); -void MemFill16(u32, u8*, u32); - -void MemFill16(u32 value, u8* dest, u32 size) { - DmaFill16(3, value, dest, size); -} - -void MemFill32(u32 value, u8* dest, u32 size) { - DmaFill32(3, value, dest, size); -} - -void MemClear32(u8* src, u32 size) { - u32 zero = 0; - - switch (((u32)src | size) & 3) { - case 0: - MemFill32(0, src, size); - break; - case 2: - MemFill16(0, src, size); - break; - default: - do { - *src = zero; - src++; - size--; - } while (size != 0); - } -} - -void MemCopy(const u8* src, u8* dst, u32 size) { - switch (((u32)src | (u32)dst | size) & 3) { - case 0: - DmaCopy32(3, src, dst, size); - break; - case 2: - DmaCopy16(3, src, dst, size); - break; - default: - do { - *dst = *src; - src++; - dst++; - } while (--size); - } -} diff --git a/src/eeprom.c b/src/eeprom.c new file mode 100644 index 00000000..4ea218b3 --- /dev/null +++ b/src/eeprom.c @@ -0,0 +1,250 @@ +#include "global.h" +#include "gba/eeprom.h" + +typedef struct EEPROMConfig { + u32 unk_00; + u16 size; + u16 waitcnt; + u8 address_width; + // u8 filler[3]; +} EEPROMConfig; + +const char EEPROM_V124[] = "EEPROM_V124"; +extern const EEPROMConfig* gEEPROMConfig; +const EEPROMConfig gEEPROMConfig512 = { 0x200, 0x40, 0x300, 0x6 }; +const EEPROMConfig gEEPROMConfig8k = { 0x2000, 0x400, 0x300, 0xe }; + +u16 EEPROMWrite(u16, const u16*, u8); + +u16 EEPROMConfigure(u16 unk_1) { + u16 ret; + + ret = 0; + if (unk_1 == 4) { + gEEPROMConfig = &gEEPROMConfig512; + } else { + if (unk_1 == 0x40) { + gEEPROMConfig = &gEEPROMConfig8k; + } else { + gEEPROMConfig = &gEEPROMConfig512; + ret = 1; + } + } + return ret; +} + +static void DMA3Transfer(const void* src, void* dest, u16 count) { + u32 temp; + + u16 IME_save; + + IME_save = REG_IME; + REG_IME = 0; // disable all interrupts + temp = REG_WAITCNT & 0xf8ff; + temp |= gEEPROMConfig->waitcnt; // configure wait state 2 + REG_WAITCNT = temp; + REG_DMA3SAD = (u32)src; + REG_DMA3DAD = (u32)dest; + REG_DMA3CNT = count | 0x80000000; // enable dma + while ((REG_DMA3CNT_H & 0x8000) != 0) {} // wait for dma to finish + REG_IME = IME_save; +} + +/** + * reads 64 bit (8 byte) from eeprom + * + * @param address 6/14 bit depending on eeprom size + * @param data u16[4] + * @return errorcode, 0 on success + */ +u16 EEPROMRead(u16 address, u16* data) { + u16 buffer[0x44]; + + u16* ptr; + u8 t1, t2; + u16 value; + + if (address >= gEEPROMConfig->size) { + return EEPROM_OUT_OF_RANGE; + } else { + ptr = buffer; + // setup address + (u8*)ptr += (gEEPROMConfig->address_width << 1) + 1; + ((u8*)ptr)++; + for (t1 = 0; t1 < gEEPROMConfig->address_width; t1++) { + *(ptr--) = address; + address >>= 1; + } + // read request + *(ptr--) = 1; + *ptr = 1; + // send address to eeprom + DMA3Transfer(buffer, (u16*)0xd000000, gEEPROMConfig->address_width + 3); + // recieve data + DMA3Transfer((u16*)0xd000000, buffer, 0x44); + // 4 bit junk + ptr = buffer + 4; + data += 3; + // copy data into output buffer + for (t1 = 0; t1 < 4; t1++) { + value = 0; + for (t2 = 0; t2 < 0x10; t2++) { + value <<= 1; + value |= (*ptr++) & 1; + } + *(data--) = value; + } + return 0; + } +} + +u16 EEPROMWrite1(u16 address, const u16* data) { + return EEPROMWrite(address, data, 1); +} + +// reading from EEPROM like a status register +#define REG_EEPROM (*(u16*)0xd000000) +// this is the furthest I could get +// 0x080B16AC +NONMATCH("asm/non_matching/code_080B1520/EEPROMWrite.inc", u16 EEPROMWrite(u16 address, const u16* data, u8 unk_3)) { + u16 buffer[0x52]; // this is one too large? + vu16 stack_a4; + vu16 prev_vcount; // stack + a6 + vu16 current_vcount; // stack + a6 + vu32 passed_scanlines; // stack + ac + + u32 r2; + + u8 i, j; + u16* ptr; + + if (address >= gEEPROMConfig->size) + return EEPROM_OUT_OF_RANGE; + + ptr = buffer + gEEPROMConfig->address_width + 0x42; + *ptr = 0; + ptr--; + // copy data into buffer + for (i = 0; i <= 3; i++) { + r2 = *data; + data++; + for (j = 0; j <= 0xf; j++) { + *ptr = r2; + ptr--; + r2 = r2 >> 1; + } + } + // copy address to buffer + for (i = 0; i < gEEPROMConfig->address_width; i++) { + *ptr = address; + ptr--; + address = address >> 1; + } + *ptr = 0; + ptr--; + *ptr = 1; + DMA3Transfer(buffer, (u16*)0xd000000, gEEPROMConfig->address_width + 0x43); + stack_a4 = 0; + prev_vcount = REG_VCOUNT; + passed_scanlines = 0; + if (stack_a4 == 0) { + if ((REG_EEPROM & 1) != 0) + goto bad; + } + // before here its only regalloc, but after I cant get it to work + do { + do { + do { + current_vcount = REG_VCOUNT; + if (current_vcount != prev_vcount) { + if (current_vcount >= prev_vcount) { + passed_scanlines += current_vcount - prev_vcount; + } else { + passed_scanlines += (current_vcount + 0xe4) - prev_vcount; + } + if (passed_scanlines > 0x88) { + if (stack_a4 != 0) + return 0; + if ((REG_EEPROM & 1) != 0) + return 0; + return 0xc001; + } + prev_vcount = current_vcount; + } + } while (stack_a4 != 0); + } while ((REG_EEPROM & 1) != 0); + bad: + stack_a4++; + } while (unk_3 != 0); + return 0; +} +END_NONMATCH + +u16 EEPROMCompare(u16 address, const u16* data) { + u16 ret; + + u16 buffer[4]; + u16* ptr; + + u8 i; + + ret = 0; + if (address >= gEEPROMConfig->size) { + return EEPROM_OUT_OF_RANGE; + } + EEPROMRead(address, buffer); + ptr = buffer; + for (i = 0; i < ARRAY_COUNT(buffer); i++) { + if (*data++ != *ptr++) { + ret = EEPROM_COMPARE_FAILED; + break; + } + } + return ret; +} + +const char EEPROM_NOWAIT[] = "EEPROM_NOWAIT"; + +u16 EEPROMWrite1_check(u16 address, const u16* data) { + u8 i; + u16 ret; + + for (i = 0; i < 3; i++) { + ret = EEPROMWrite1(address, data); + if (ret == 0) { + ret = EEPROMCompare(address, data); + if (ret == 0) + break; + } + } + return ret; +} + +u16 EEPROMWrite0_8k(u16 address, const u16* data) { + u16 ret; + + if (gEEPROMConfig->unk_00 != 0x200) { + ret = EEPROMWrite(address, data, 0); + } else { + ret = EEPROM_UNSUPPORTED_TYPE; + } + return ret; +} + +u16 EEPROMWrite0_8k_Check(u16 address, const u16* data) { + u8 i; + u16 ret; + + for (i = 0; i < 3; i++) { + ret = EEPROMWrite0_8k(address, data); + if (ret == 0) { + ret = EEPROMCompare(address, data); + if (ret == 0) { + break; + } + } + } + return ret; +} + +const char thing[0x1c] = "\xff\xff\xff\xff"; diff --git a/src/enemy/acroBandits.c b/src/enemy/acroBandits.c index 3344b5b5..8b3c977f 100644 --- a/src/enemy/acroBandits.c +++ b/src/enemy/acroBandits.c @@ -1,10 +1,10 @@ #include "global.h" #include "entity.h" +#include "random.h" #include "functions.h" extern u32 sub_080002D4(s32, s32, u32); extern s32 sub_080012DC(Entity*); -extern u32 sub_080044EC(Entity*, u32); extern u32 sub_08031E04(Entity*); extern void sub_08031E48(Entity*, Entity*); extern void sub_08032290(Entity*); @@ -12,10 +12,7 @@ extern u32 sub_080322A4(Entity*); void sub_080322E8(Entity*); extern void sub_08032338(Entity*); extern Entity* sub_08049DF4(u32); -extern void sub_0804AA30(Entity*, void (*const funcs[])(Entity*)); -extern u32 sub_0806FCB8(Entity*, u32, u32, u32); extern u32 GetNextFunction(Entity*); -extern void SetChildOffset(Entity*, s32, s32, s32); extern Entity* gUnk_020000B0; extern u8 gEntCount; @@ -62,8 +59,8 @@ void sub_080318DC(Entity* this) { do { brother->action = 5; brother->spritePriority.b1 = 1; - if (brother->hurtBlinkTime == 0) - brother->hurtBlinkTime = -12; + if (brother->iframes == 0) + brother->iframes = -12; } while (brother = brother->attachedEntity, brother != NULL); } if (this->parent) { @@ -113,7 +110,7 @@ void sub_080318DC(Entity* this) { } void sub_08031A60(Entity* this) { - if (this->hurtBlinkTime > 0) + if (this->iframes > 0) sub_08003FC4(this, 0x1800); sub_08001324(this); @@ -452,7 +449,7 @@ void sub_08032160(Entity* this) { } else { this->spriteSettings.b.flipX = 0; } - this->nonPlanarMovement = 0xf0; + this->speed = 0xf0; this->field_0x20 = 0x12000; this->spritePriority.b1 = 1; InitializeAnimation(this, 12); diff --git a/src/enemy/beetle.c b/src/enemy/beetle.c index 6f888658..8ce4858b 100644 --- a/src/enemy/beetle.c +++ b/src/enemy/beetle.c @@ -1,11 +1,13 @@ #include "entity.h" -#include "functions.h" +#include "enemy.h" #include "player.h" +#include "random.h" +#include "functions.h" extern u32 PlayerInRange(Entity*, u32, u32); u32 sub_08021D00(); -void sub_08021D44(Entity* this, u32 param_2); +void sub_08021D44(Entity* this, u32 direction); extern void (*const gUnk_080CB590[])(Entity*); extern void (*const gUnk_080CB5A8[])(Entity*); @@ -66,7 +68,7 @@ void sub_08021818(Entity* this) { void sub_08021848(Entity* this) { if (sub_0806F520(this)) { - gUnk_080CB5C8[this->previousActionFlag](this); + gUnk_080CB5C8[this->subAction](this); } else { this->action = 3; this->height.HALF.HI = 0; @@ -75,7 +77,7 @@ void sub_08021848(Entity* this) { } void sub_0802187C(Entity* this) { - this->previousActionFlag = 2; + this->subAction = 2; } void nullsub_130(Entity* this) { @@ -98,11 +100,11 @@ void sub_080218B4(Entity* this) { } void sub_080218CC(Entity* this) { - if (this->previousActionFlag == 0) { - this->previousActionFlag = 1; + if (this->subAction == 0) { + this->subAction = 1; this->spriteSettings.b.draw = 1; this->direction = ((sub_08049F84(this, 1) ^ 0x10) + gUnk_080CB5DC[Random() & 7]) & 0x1f; - this->nonPlanarMovement = 0x100; + this->speed = 0x100; this->field_0x20 = 0x12000; } @@ -118,14 +120,14 @@ void sub_080218CC(Entity* this) { this->actionDelay = (Random() & 0x38) + 8; this->field_0xf = 1; this->flags |= 0x80; - this->nonPlanarMovement = 0x180; + this->speed = 0x180; InitializeAnimation(this, 0); } } void sub_08021984(Entity* this) { - if (this->previousActionFlag == 0) { - this->previousActionFlag = 1; + if (this->subAction == 0) { + this->subAction = 1; this->flags |= 0x80; this->spriteSettings.b.draw = 3; this->height.HALF.HI = -0x80; @@ -139,7 +141,7 @@ void sub_08021984(Entity* this) { this->actionDelay = 16; this->field_0xf = 1; this->spriteSettings.b.draw = 1; - this->nonPlanarMovement = 0x180; + this->speed = 0x180; ((u8*)&this->field_0x86)[0] = 60; InitializeAnimation(this, 0); UpdateSpriteForCollisionLayer(this); @@ -309,9 +311,9 @@ void sub_08021D44(Entity* this, u32 direction) { direction = DirectionRoundUp(direction); this->direction = direction; if (DirectionIsHorizontal(direction)) { - this->nonPlanarMovement = 0x180; + this->speed = 0x180; } else { - this->nonPlanarMovement = 0xc0; + this->speed = 0xc0; } } diff --git a/src/enemy/bladeTrap.c b/src/enemy/bladeTrap.c index 95d2d8d4..9f89f8f0 100644 --- a/src/enemy/bladeTrap.c +++ b/src/enemy/bladeTrap.c @@ -1,10 +1,9 @@ #include "global.h" #include "entity.h" #include "room.h" +#include "functions.h" extern void sub_080A2CC0(); -extern void sub_0806F69C(); -extern void EnqueueSFX(); void BladeTrap(Entity* this) { if (this->action == 0) { diff --git a/src/enemy/bobomb.c b/src/enemy/bobomb.c index bf4b4372..0e465090 100644 --- a/src/enemy/bobomb.c +++ b/src/enemy/bobomb.c @@ -1,7 +1,8 @@ #include "enemy.h" +#include "random.h" +#include "createObject.h" #include "functions.h" -extern void CreateDustSmall(Entity*); extern void sub_08078930(Entity*); extern void sub_08078954(Entity*); @@ -53,7 +54,7 @@ void sub_0802C688(Entity* this) { this->damageType = 0x6e; this->field_0xf = 1; this->field_0x20 = 0x18000; - this->nonPlanarMovement = 0; + this->speed = 0; this->field_0x80.HALF.HI = 1; InitializeAnimation(this, this->direction >> 4 | 6); break; @@ -63,19 +64,19 @@ void sub_0802C688(Entity* this) { } void sub_0802C7AC(Entity* this) { - if (this->previousActionFlag < 3 && !sub_0806F520(this)) { - this->previousActionFlag = 0; + if (this->subAction < 3 && !sub_0806F520(this)) { + this->subAction = 0; this->field_0xf = 1; this->height.HALF.HI = 0; if (this->field_0x82.HALF.LO != 2) { - this->nonPlanarMovement = this->field_0x82.HALF.LO ? 0x200 : 0x80; + this->speed = this->field_0x82.HALF.LO ? 0x200 : 0x80; } this->field_0x20 = 0x18000; this->field_0x82.HALF.HI = 0; this->field_0x80.HALF.HI = 0; } else { this->height.HALF.HI = -1; - gUnk_080CD600[this->previousActionFlag](this); + gUnk_080CD600[this->subAction](this); if (this->actionDelay != 0) { GetNextFrame(this); } @@ -83,7 +84,7 @@ void sub_0802C7AC(Entity* this) { } void sub_0802C820(Entity* this) { - this->previousActionFlag = 1; + this->subAction = 1; this->field_0x1d = 60; } @@ -180,11 +181,11 @@ void sub_0802C91C(Entity* this) { } void sub_0802C9B8(Entity* this) { - gUnk_080CD618[this->previousActionFlag](this); + gUnk_080CD618[this->subAction](this); } void sub_0802C9D0(Entity* this) { - this->previousActionFlag = 1; + this->subAction = 1; this->flags &= ~0x80; this->spritePriority.b1 = 0; this->field_0x82.HALF.HI = 1; @@ -224,7 +225,7 @@ void sub_0802CA94(Entity* this) { this->field_0xf = 1; this->spritePriority.b1 = 1; this->field_0x20 = 0x18000; - this->nonPlanarMovement = 0; + this->speed = 0; this->field_0x82.HALF.HI = 0; this->field_0x80.HALF.HI = 0; this->direction = ((gPlayerEntity.animationState << 2) | 4) & 0x1c; @@ -255,17 +256,17 @@ void nullsub_150(Entity* this) { void sub_0802CB68(Entity* this) { this->action = 1; - this->previousActionFlag = 0; + this->subAction = 0; this->direction = Random() & 0x18; this->direction |= 4; this->flags |= 0x80; if (this->field_0x82.HALF.LO) { this->actionDelay = 200; - this->nonPlanarMovement = 0x200; + this->speed = 0x200; InitializeAnimation(this, (this->direction >> 4) | 2); } else { this->actionDelay = 0x3c; - this->nonPlanarMovement = 0x80; + this->speed = 0x80; InitializeAnimation(this, this->direction >> 4); } } diff --git a/src/enemy/bombPeahat.c b/src/enemy/bombPeahat.c index b8dc9575..b57cfd81 100644 --- a/src/enemy/bombPeahat.c +++ b/src/enemy/bombPeahat.c @@ -1,17 +1,15 @@ #include "global.h" #include "entity.h" -#include "functions.h" #include "player.h" +#include "random.h" +#include "functions.h" extern void sub_08078954(Entity*); -extern u32 sub_0800442E(Entity*); extern void sub_08078930(Entity*); extern s32 sub_080012DC(Entity*); extern u32 GetNextFunction(Entity*); -extern void sub_0806F4E8(Entity*); extern Entity* sub_08049DF4(u32); extern void sub_08079BD8(Entity*); -extern u32 GetTileTypeByEntity(Entity*); void sub_0802AD1C(Entity*, u32); void sub_0802AD54(Entity*); @@ -70,11 +68,11 @@ void sub_0802A8AC(Entity* this) { } void sub_0802A8C8(Entity* this) { - gUnk_080CD140[this->previousActionFlag](this); + gUnk_080CD140[this->subAction](this); } void sub_0802A8E0(Entity* this) { - this->previousActionFlag = 1; + this->subAction = 1; this->field_0x1d = 60; } @@ -102,7 +100,7 @@ void sub_0802A91C(Entity* this) { void sub_0802A924(Entity* this) { this->action = 1; - this->previousActionFlag = 0; + this->subAction = 0; this->actionDelay = 0; this->field_0xf = 0; this->hitbox = (Hitbox*)&gUnk_080CD16C; @@ -128,7 +126,7 @@ void sub_0802A9A8(Entity* this) { if (this->actionDelay) { if (--this->actionDelay == 0) { this->action = 2; - this->previousActionFlag = 0; + this->subAction = 0; this->actionDelay = 0x40; sub_0802ACDC(this, 8); } @@ -174,7 +172,7 @@ void sub_0802AA40(Entity* this) { } if (this->direction == direction) { this->action = 3; - this->nonPlanarMovement = 0x180; + this->speed = 0x180; this->field_0x7a.HALF.HI = 0; ent->field_0x80.HALF.LO = 1; ent->actionDelay = 0x96; @@ -244,7 +242,7 @@ void sub_0802AB40(Entity* this) { } } else { this->action = 5; - this->nonPlanarMovement = 0; + this->speed = 0; InitializeAnimation(this, this->type + 1); } break; @@ -254,9 +252,9 @@ void sub_0802AB40(Entity* this) { void sub_0802AC08(Entity* this) { if (this->frames.all & 0x80) { this->action = 2; - this->previousActionFlag = 0; + this->subAction = 0; this->actionDelay = 0x40; - this->nonPlanarMovement = 0xc0; + this->speed = 0xc0; sub_0802ACDC(this, 8); sub_0802ADDC(this); } @@ -386,7 +384,7 @@ void sub_0802AE68(Entity* this) { } void sub_0802AEBC(Entity* this) { - gUnk_080CD158[this->previousActionFlag](this); + gUnk_080CD158[this->subAction](this); } void sub_0802AED4(Entity* this) { @@ -407,7 +405,7 @@ void sub_0802AED4(Entity* this) { } void sub_0802AF28(Entity* this) { - this->previousActionFlag = 1; + this->subAction = 1; sub_08079BD8(this); this->spritePriority.b1 = 2; GetNextFrame(this); @@ -424,7 +422,7 @@ void sub_0802AF58(Entity* this) { void sub_0802AF74(Entity* this) { this->action = 3; - this->previousActionFlag = 0; + this->subAction = 0; if (this->actionDelay > 60) { this->actionDelay = 60; } @@ -510,7 +508,7 @@ void sub_0802B048(Entity* this) { } else { if (this->field_0xf) { if (--this->field_0xf == 0) { - if (action == 2 && this->previousActionFlag == 1) { + if (action == 2 && this->subAction == 1) { gPlayerState.heldObject = 0; } sub_0805EC60(this); diff --git a/src/enemy/bowMoblin.c b/src/enemy/bowMoblin.c index e29d6177..893d7618 100644 --- a/src/enemy/bowMoblin.c +++ b/src/enemy/bowMoblin.c @@ -1,10 +1,8 @@ #include "global.h" #include "entity.h" +#include "enemy.h" +#include "functions.h" -extern void EnemyFunctionHandler(Entity*, void (*const funcs[])(Entity*)); -extern void SetChildOffset(Entity*, u32, u32, u32); -extern void sub_0804A9FC(Entity*, u32); -extern void sub_0804AA30(Entity*, void (*const funcs[][])(Entity*)); extern void sub_0803C5F0(Entity*); extern void (*const gUnk_080CFF78[])(Entity*); @@ -25,7 +23,7 @@ void sub_0803C198(Entity* this) { if (this->field_0x43 != 0) { sub_0804A9FC(this, 0x1c); } - sub_0804AA30(this, &gUnk_080CFF78); + sub_0804AA30(this, gUnk_080CFF78); if ((this->bitfield & 0x80) != 0) { sub_0803C5F0(this); pEVar1 = this->attachedEntity; diff --git a/src/enemy/businessScrub.c b/src/enemy/businessScrub.c index 49ba9ea1..30f0000e 100644 --- a/src/enemy/businessScrub.c +++ b/src/enemy/businessScrub.c @@ -1,9 +1,11 @@ #include "enemy.h" #include "entity.h" #include "flags.h" -#include "functions.h" #include "textbox.h" #include "save.h" +#include "random.h" +#include "npc.h" +#include "functions.h" extern void sub_0801D040(Entity*, u32); extern Entity* sub_08049DF4(u32); @@ -54,7 +56,7 @@ void sub_08028934(Entity* this) { if (this->damageType == 1 && (this->bitfield & 0x7f) == 0x42) { this->action = 3; - this->previousActionFlag = 0; + this->subAction = 0; this->actionDelay = 0x28; this->flags &= ~0x80; sub_080290E0(this, 4); @@ -97,7 +99,7 @@ void sub_08028A48(Entity* this) { this->actionDelay--; } else if (sub_08028F98(this, 0)) { sub_08029078(this); - this->previousActionFlag = 0; + this->subAction = 0; this->field_0xf = 1; } } @@ -106,11 +108,11 @@ void sub_08028A74(Entity* this) { u32 unk; GetNextFrame(this); - switch (this->previousActionFlag) { + switch (this->subAction) { case 0: unk = 1; if (this->frames.all & 0x80) { - this->previousActionFlag = 1; + this->subAction = 1; this->actionDelay = 0x3c; this->field_0xf = 0x10; sub_08028FDC(this); @@ -120,7 +122,7 @@ void sub_08028A74(Entity* this) { case 1: unk = 1; if (--this->actionDelay == 0) { - this->previousActionFlag = 2; + this->subAction = 2; this->actionDelay = 0x20; this->field_0xf = 0; sub_08028FDC(this); @@ -141,14 +143,14 @@ void sub_08028A74(Entity* this) { ent->parent = this; ent->direction = this->direction; this->frames.all &= ~1; - this->previousActionFlag = 3; + this->subAction = 3; } } break; case 3: unk = 2; if (this->frames.all & 0x80) { - this->previousActionFlag = 4; + this->subAction = 4; this->actionDelay = 0x50; sub_080290E0(this, 1); } @@ -157,13 +159,13 @@ void sub_08028A74(Entity* this) { unk = 2; if (--this->actionDelay == 0) { if (sub_08028F98(this, 0)) { - this->previousActionFlag = 1; + this->subAction = 1; this->actionDelay = 0x3c; this->field_0xf = 0x10; sub_08028FDC(this); } else { sub_08028FFC(this); - this->previousActionFlag = 0; + this->subAction = 0; this->actionDelay = 0x50; this->field_0xf = 0; } @@ -174,7 +176,7 @@ void sub_08028A74(Entity* this) { if (!sub_08028F98(this, unk)) { sub_08028FFC(this); - this->previousActionFlag = 0; + this->subAction = 0; this->actionDelay = 0x50; this->field_0xf = 0; } @@ -183,11 +185,11 @@ void sub_08028A74(Entity* this) { void sub_08028BC4(Entity* this) { Entity* iVar1; - switch (this->previousActionFlag) { + switch (this->subAction) { case 0: if (this->actionDelay == 0) { if (this->frames.all & 0x80) { - this->previousActionFlag = 1; + this->subAction = 1; sub_08028FDC(this); sub_080290E0(this, 5); this->spritePriority.b1 = 1; @@ -199,7 +201,7 @@ void sub_08028BC4(Entity* this) { case 1: if (this->frames.all & 0x80) { this->action = 4; - this->previousActionFlag = 0; + this->subAction = 0; this->actionDelay = 0x1e; this->field_0xf = 5; sub_080290E0(this, 0); @@ -314,7 +316,7 @@ void sub_08028E40(Entity* this) { struct SalesOffering* offer = (struct SalesOffering*)this->field_0x7c.WORD; this->action = 4; - this->previousActionFlag = gTextBox.doTextBox & 0x7f; + this->subAction = gTextBox.doTextBox & 0x7f; this->actionDelay = 1; if (CheckLocalFlag(offer->field_0xa) == 0) { SetLocalFlag(offer->field_0xa); @@ -326,7 +328,7 @@ void sub_08028E40(Entity* this) { } void sub_08028E84(Entity* this) { - if (UpdateFuseInteraction()) { + if (UpdateFuseInteraction(this)) { this->action = 4; this->actionDelay = 1; } diff --git a/src/enemy/chaser.c b/src/enemy/chaser.c index 00d99937..7e0ac960 100644 --- a/src/enemy/chaser.c +++ b/src/enemy/chaser.c @@ -36,7 +36,7 @@ void sub_0802B540(Entity* this) { u32 direction = sub_0804A024(this, 1, 0xc); if (direction != 0xff) { this->action = 2; - this->nonPlanarMovement = 0x40; + this->speed = 0x40; this->direction = direction; } } @@ -45,15 +45,15 @@ void sub_0802B540(Entity* this) { void sub_0802B56C(Entity* this) { GetNextFrame(this); if (this->bitfield & 0x80) { - this->nonPlanarMovement = 0x40; + this->speed = 0x40; } if (sub_080AF038(this)) { if (this->animIndex != 1) { InitializeAnimation(this, 1); } - if (this->nonPlanarMovement < 0x220) { - this->nonPlanarMovement += 4; + if (this->speed < 0x220) { + this->speed += 4; } } else { this->action = 3; diff --git a/src/enemy/chuchu.c b/src/enemy/chuchu.c index 99a9160a..4f8d86d0 100644 --- a/src/enemy/chuchu.c +++ b/src/enemy/chuchu.c @@ -1,5 +1,6 @@ #include "enemy.h" #include "entity.h" +#include "random.h" #include "functions.h" extern s32 sub_080012DC(Entity*); @@ -54,7 +55,7 @@ void Chuchu(Entity* this) { if (this->flags & 0x80) { this->action = 6; this->flags &= ~0x80; - this->nonPlanarMovement = 0x20; + this->speed = 0x20; this->damageType = 0x5c; InitializeAnimation(this, 5); } @@ -293,7 +294,7 @@ void sub_0801F328(Entity* this) { void sub_0801F340(Entity* this) { this->action = 5; this->actionDelay = 60; - this->nonPlanarMovement = 0x20; + this->speed = 0x20; this->damageType = 92; InitializeAnimation(this, 2); } @@ -417,7 +418,7 @@ void sub_0801F584(Entity* this) { } else { this->action = 6; this->field_0xf = 60; - this->nonPlanarMovement = 0x20; + this->speed = 0x20; this->damageType = 92; InitializeAnimation(this, 2); } @@ -469,7 +470,7 @@ void sub_0801F6F8(Entity* this) { GetNextFrame(this); if (this->frames.all & 0x80) { this->action = 4; - this->nonPlanarMovement = 0x20; + this->speed = 0x20; sub_0804AA1C(this); InitializeAnimation(this, 2); } @@ -592,7 +593,7 @@ void sub_0801F940(Entity* this) { } else { this->action = 6; this->field_0xf = 60; - this->nonPlanarMovement = 0x20; + this->speed = 0x20; InitializeAnimation(this, 2); } } @@ -644,7 +645,7 @@ void sub_0801FAAC(Entity* this) { GetNextFrame(this); if (this->frames.all & 0x80) { sub_0801FB14(this); - this->nonPlanarMovement = 0x20; + this->speed = 0x20; sub_0804AA1C(this); } } @@ -705,7 +706,7 @@ u32 sub_0801FBD0(Entity* this) { } void Chuchu_JumpAtPlayer(Entity* this) { - this->nonPlanarMovement = 0x180; + this->speed = 0x180; this->field_0x20 = 0x20000; this->direction = sub_08049F84(this, 1); InitializeAnimation(this, 3); diff --git a/src/enemy/chuchuBoss.c b/src/enemy/chuchuBoss.c index 674e8774..4127be53 100644 --- a/src/enemy/chuchuBoss.c +++ b/src/enemy/chuchuBoss.c @@ -2,8 +2,6 @@ #include "entity.h" #include "functions.h" -extern void sub_08078B48(void); - void sub_08027870(Entity*); extern void (*const gUnk_080CC19C[])(Entity*); @@ -36,13 +34,11 @@ void sub_08025CBC(Entity* this) { void sub_08025DC0(Entity*); void sub_08025CD4(Entity*); -void sub_08001242(Entity*); void sub_08025DD8(Entity*); void sub_08026060(Entity*); void sub_08026110(Entity*); void sub_080272D4(Entity*); void sub_0802720C(Entity*); -void sub_0802720C(Entity*); void sub_08026090(Entity*); void sub_0802626C(Entity*); void sub_08026580(Entity*); diff --git a/src/enemy/cuccoChickAggr.c b/src/enemy/cuccoChickAggr.c index de87165a..683ba4b8 100644 --- a/src/enemy/cuccoChickAggr.c +++ b/src/enemy/cuccoChickAggr.c @@ -1,5 +1,6 @@ #include "enemy.h" #include "entity.h" +#include "random.h" #include "functions.h" extern Entity* sub_08049DF4(u32); @@ -71,7 +72,7 @@ void sub_080229F8(Entity* this) { this->actionDelay = 6; this->field_0xf = 8; this->frameIndex = 0; - this->nonPlanarMovement = 0xc0; + this->speed = 0xc0; sub_08022B44(this); } else { this->field_0x20 = 0x10000; @@ -110,7 +111,7 @@ void sub_08022AA4(Entity* this) { this->action = 2; this->actionDelay = (rand & 3) + 1; this->field_0xf = 1; - this->nonPlanarMovement = 0x80; + this->speed = 0x80; if (!sub_08049FA0(this) && (rand >> 8) & 3) { this->direction = sub_08049EE4(this); diff --git a/src/enemy/darkNut.c b/src/enemy/darkNut.c index 49acb71d..96585a58 100644 --- a/src/enemy/darkNut.c +++ b/src/enemy/darkNut.c @@ -1,4 +1,6 @@ #include "entity.h" +#include "enemy.h" +#include "random.h" #include "functions.h" typedef struct { @@ -241,7 +243,7 @@ void sub_08020FAC(Entity* this) { if (this->field_0x7a.HALF.LO) { this->field_0x7a.HALF.LO--; } else { - this->hurtBlinkTime = -8; + this->iframes = -8; sub_08021390(this); } } else { @@ -428,7 +430,7 @@ void sub_08021328(Entity* this) { void sub_0802134C(Entity* this) { this->action = 15; this->direction = DirectionFromAnimationState(this->animationState); - this->nonPlanarMovement = 0x200; + this->speed = 0x200; this->field_0x76.HWORD = 0x78; sub_08021218(this, 0xe, this->animationState); } @@ -445,7 +447,7 @@ void sub_08021380(Entity* this) { void sub_08021390(Entity* this) { this->action = 7; - this->nonPlanarMovement = 0x200; + this->speed = 0x200; this->damageType = 0x56; sub_08021218(this, 6, this->animationState); } @@ -453,7 +455,7 @@ void sub_08021390(Entity* this) { void sub_080213B0(Entity* this) { this->action = 3; this->actionDelay = 1; - this->nonPlanarMovement = 0xc0; + this->speed = 0xc0; this->field_0x76.HWORD = 0xf0; sub_08021218(this, 3, this->animationState); } @@ -472,7 +474,7 @@ void sub_080213F0(Entity* this) { void sub_08021400(Entity* this) { this->action = 9; - this->nonPlanarMovement = 0x60; + this->speed = 0x60; sub_08021218(this, 10, this->animationState); } diff --git a/src/enemy/doorMimic.c b/src/enemy/doorMimic.c index 27357c08..2bfc1fc4 100644 --- a/src/enemy/doorMimic.c +++ b/src/enemy/doorMimic.c @@ -4,7 +4,7 @@ extern s16 sub_080001DA(u32, u32); // ? extern void sub_08049CF4(); -extern u32 sub_0806FBFC(u32, u32, u32, u32); +extern u32 CheckPlayerProximity(u32, u32, u32, u32); void sub_080221C0(); typedef struct { @@ -54,7 +54,7 @@ void sub_08022034(Entity* this) { void sub_0802209C(Entity* this) { if (this->actionDelay == 0) { - if (sub_0806FBFC(this->field_0x78.HWORD, this->field_0x7a.HWORD, 0x10, 0x10)) { + if (CheckPlayerProximity(this->field_0x78.HWORD, this->field_0x7a.HWORD, 0x10, 0x10)) { this->action = 2; this->actionDelay = 0x12; InitializeAnimation(this, this->type2 + 4); diff --git a/src/enemy/fallingBoulder.c b/src/enemy/fallingBoulder.c index 4b469258..29076b1c 100644 --- a/src/enemy/fallingBoulder.c +++ b/src/enemy/fallingBoulder.c @@ -1,4 +1,5 @@ #include "enemy.h" +#include "random.h" #include "functions.h" void sub_0802C4B0(Entity*); @@ -156,15 +157,15 @@ void sub_0802C4B0(Entity* this) { rand = Random() & 7; if (rand & 4) { if (rand & 3) { - this->nonPlanarMovement = gUnk_080CD568[offset | 2]; + this->speed = gUnk_080CD568[offset | 2]; } else { - this->nonPlanarMovement = gUnk_080CD568[offset | 0]; + this->speed = gUnk_080CD568[offset | 0]; } } else { if (rand & 3) { - this->nonPlanarMovement = gUnk_080CD568[offset | 1]; + this->speed = gUnk_080CD568[offset | 1]; } else { - this->nonPlanarMovement = gUnk_080CD568[offset | 3]; + this->speed = gUnk_080CD568[offset | 3]; } } diff --git a/src/enemy/fireballGuy.c b/src/enemy/fireballGuy.c index 3a4e4148..d551c54d 100644 --- a/src/enemy/fireballGuy.c +++ b/src/enemy/fireballGuy.c @@ -1,5 +1,7 @@ #include "global.h" #include "entity.h" +#include "enemy.h" +#include "random.h" #include "functions.h" typedef struct { @@ -39,7 +41,7 @@ void sub_080453E8(Entity* this) { this->action = 1; this->actionDelay = 0; this->spriteSettings.b.draw = 1; - this->nonPlanarMovement = 0x80; + this->speed = 0x80; this->cutsceneBeh.HALF.LO = this->currentHealth; this->field_0x3c |= 0x10; sub_0804A720(this); @@ -79,7 +81,7 @@ void sub_08045454(Entity* this) { tmp = 0; ent->type2 = 1; ent->height.HALF.HI = tmp; - ent->hurtBlinkTime = -0x10; + ent->iframes = -0x10; /* Set MiniFireballGuy offset relative to killed slime. */ sub_08045178(this, ent, off->h, off->v); diff --git a/src/enemy/gibdo.c b/src/enemy/gibdo.c index a1a9833d..f9792c8a 100644 --- a/src/enemy/gibdo.c +++ b/src/enemy/gibdo.c @@ -1,8 +1,9 @@ #include "global.h" #include "entity.h" #include "sprite.h" -#include "functions.h" #include "enemy.h" +#include "random.h" +#include "functions.h" // Gibudo void sub_08037794(); void sub_08037B10(); @@ -211,7 +212,7 @@ void sub_080377B0(Entity* this) { this->field_0xf = 8; r1 = Random(); this->field_0x74.HWORD = (r1 & 0x38) + 0x78; - this->nonPlanarMovement = 0x40; + this->speed = 0x40; r2 = Random(); if (!sub_08049FA0(this) && (r2 & 3)) { this->direction = DirectionRoundUp(sub_08049EE4(this)); @@ -233,7 +234,7 @@ NONMATCH("asm/non_matching/gibdo/sub_08037810.inc", u32 sub_08037810(Entity* thi this->action = 3; this->actionDelay = 0x18; this->field_0xf = 0x8; - this->nonPlanarMovement = 0xc0; + this->speed = 0xc0; y = DirectionRoundUp(GetFacingDirection(this, gUnk_020000B0)); this->direction = y; this->animationState = y / 8; @@ -258,7 +259,7 @@ u32 sub_080378B0(Entity* this) { if (sub_0804A044(this, gUnk_020000B0, 0xa) == this->direction) if (sub_0806FCB8(this, gUnk_020000B0->x.HALF.HI, gUnk_020000B0->y.HALF.HI, 0x18) != 0) { this->action = 5; - this->nonPlanarMovement = 0x100; + this->speed = 0x100; InitAnimationForceUpdate(this, this->animationState + 8); return 1; } @@ -337,12 +338,12 @@ NONMATCH("asm/non_matching/gibdo/sub_08037A58.inc", void sub_08037A58(Entity* th sub_08037ACC(this); this->action = 7; this->spritePriority.b0 = (this->spritePriority.b0 & 0xf8) | 4; - if (this->hurtBlinkTime == 0) { - this->hurtBlinkTime = 0xec; + if (this->iframes == 0) { + this->iframes = 0xec; } this->damageType = 0x26; this->flags2 |= 1; - this->hurtBlinkTime = 0xf4; + this->iframes = 0xf4; this->field_0x3e = (this->animationState << 3) ^ 0x10; this->field_0x42 = 8; this->field_0x46 = 0x180; @@ -354,7 +355,7 @@ END_NONMATCH void sub_08037ACC(Entity* this) { gPlayerState.flags.all &= 0xFFFFFEFF; gPlayerEntity.flags |= 0x80; - gPlayerEntity.hurtBlinkTime = 0x1e; + gPlayerEntity.iframes = 0x1e; gPlayerEntity.field_0x3e = DirectionFromAnimationState(this->animationState); gPlayerEntity.field_0x42 = 4; gPlayerEntity.field_0x46 = 0x180; @@ -362,7 +363,7 @@ void sub_08037ACC(Entity* this) { // Damage player maybe? void sub_08037B10(Entity* this) { u32 h; - gPlayerEntity.hurtBlinkTime = 0xc; + gPlayerEntity.iframes = 0xc; h = ModHealth(-8); sub_0800449C(&gPlayerEntity, 0x7a); if (h == 0) { diff --git a/src/enemy/gyorgMale.c b/src/enemy/gyorgMale.c index c37838f9..4b73349a 100644 --- a/src/enemy/gyorgMale.c +++ b/src/enemy/gyorgMale.c @@ -2,10 +2,10 @@ #include "enemy.h" #include "player.h" #include "room.h" -#include "trig.h" -#include "structures.h" -#include "functions.h" +#include "coord.h" #include "fileScreen.h" +#include "random.h" +#include "functions.h" void (*const gUnk_080D1AFC[8])(Entity*); void (*const gUnk_080D1B1C[7])(Entity*); @@ -26,57 +26,56 @@ const u8 gUnk_080D1C44[0xC]; const u16 gUnk_080D1C50[8]; const u16 gUnk_080D1C60[8]; -void GyorgMale(Entity*); void sub_08046898(Entity*); // action 0 void sub_08046910(Entity*); // action 1 -void sub_08046930(Entity*); // action 1 previousActionFlag 0 -void sub_0804696C(Entity*); // action 1 previousActionFlag 1 -void sub_080469CC(Entity*); // action 1 previousActionFlag 2 -void sub_080469F4(Entity*); // action 1 previousActionFlag 3 -void sub_08046A30(Entity*); // action 1 previousActionFlag 4 -void sub_08046A54(Entity*); // action 1 previousActionFlag 5 -void sub_08046A78(Entity*); // action 1 previousActionFlag 6 +void sub_08046930(Entity*); // action 1 subAction 0 +void sub_0804696C(Entity*); // action 1 subAction 1 +void sub_080469CC(Entity*); // action 1 subAction 2 +void sub_080469F4(Entity*); // action 1 subAction 3 +void sub_08046A30(Entity*); // action 1 subAction 4 +void sub_08046A54(Entity*); // action 1 subAction 5 +void sub_08046A78(Entity*); // action 1 subAction 6 void sub_08046A9C(Entity*); // action 2 -void sub_08046AE8(Entity*); // action 2 previousActionFlag 0 -void sub_08046B18(Entity*); // action 2 previousActionFlag 1 -void sub_08046B8C(Entity*); // action 2 previousActionFlag 2 -void sub_08046C04(Entity*); // action 2 previousActionFlag 3 -void sub_08046C88(Entity*); // action 2 previousActionFlag 4 +void sub_08046AE8(Entity*); // action 2 subAction 0 +void sub_08046B18(Entity*); // action 2 subAction 1 +void sub_08046B8C(Entity*); // action 2 subAction 2 +void sub_08046C04(Entity*); // action 2 subAction 3 +void sub_08046C88(Entity*); // action 2 subAction 4 void sub_08046CEC(Entity*); // action 3 -void sub_08046D44(Entity*); // action 3 previousActionFlag 0 -void sub_08046D98(Entity*); // action 3 previousActionFlag 1 -void sub_08046E0C(Entity*); // action 3 previousActionFlag 2 -void sub_08046E68(Entity*); // action 3 previousActionFlag 3 -void sub_08046EF4(Entity*); // action 3 previousActionFlag 4 +void sub_08046D44(Entity*); // action 3 subAction 0 +void sub_08046D98(Entity*); // action 3 subAction 1 +void sub_08046E0C(Entity*); // action 3 subAction 2 +void sub_08046E68(Entity*); // action 3 subAction 3 +void sub_08046EF4(Entity*); // action 3 subAction 4 void sub_08046F64(Entity*); // action 4 -void sub_08046FE8(Entity*); // action 4 previousActionFlag 0 -void sub_0804702C(Entity*); // action 4 previousActionFlag 1 -void sub_080470B4(Entity*); // action 4 previousActionFlag 2 -void sub_08047140(Entity*); // action 4 previousActionFlag 3 -void sub_0804717C(Entity*); // action 4 previousActionFlag 4 -void sub_080471C8(Entity*); // action 4 previousActionFlag 5 -void sub_0804723C(Entity*); // action 4 previousActionFlag 6 -void sub_08047284(Entity*); // action 4 previousActionFlag 7 -void sub_080472BC(Entity*); // action 4 previousActionFlag 8 -void sub_08047310(Entity*); // action 4 previousActionFlag 9 +void sub_08046FE8(Entity*); // action 4 subAction 0 +void sub_0804702C(Entity*); // action 4 subAction 1 +void sub_080470B4(Entity*); // action 4 subAction 2 +void sub_08047140(Entity*); // action 4 subAction 3 +void sub_0804717C(Entity*); // action 4 subAction 4 +void sub_080471C8(Entity*); // action 4 subAction 5 +void sub_0804723C(Entity*); // action 4 subAction 6 +void sub_08047284(Entity*); // action 4 subAction 7 +void sub_080472BC(Entity*); // action 4 subAction 8 +void sub_08047310(Entity*); // action 4 subAction 9 void sub_0804736C(Entity*); // action 5 -void sub_080473B8(Entity*); // action 5 previousActionFlag 0 -void sub_080473F0(Entity*); // action 5 previousActionFlag 1 -void sub_08047484(Entity*); // action 5 previousActionFlag 2 -void sub_08047508(Entity*); // action 5 previousActionFlag 3 -void sub_080475F4(Entity*); // action 5 previousActionFlag 4 -void sub_0804763C(Entity*); // action 5 previousActionFlag 5 -void sub_0804772C(Entity*); // action 5 previousActionFlag 6 +void sub_080473B8(Entity*); // action 5 subAction 0 +void sub_080473F0(Entity*); // action 5 subAction 1 +void sub_08047484(Entity*); // action 5 subAction 2 +void sub_08047508(Entity*); // action 5 subAction 3 +void sub_080475F4(Entity*); // action 5 subAction 4 +void sub_0804763C(Entity*); // action 5 subAction 5 +void sub_0804772C(Entity*); // action 5 subAction 6 void sub_08047778(Entity*); // action 6 -void sub_08047798(Entity*); // action 6 previousActionFlag 0 -void sub_080477F0(Entity*); // action 6 previousActionFlag 1 -void sub_08047914(Entity*); // action 6 previousActionFlag 2 -void sub_08047978(Entity*); // action 6 previousActionFlag 3 -void sub_08047B08(Entity*); // action 6 previousActionFlag 4 +void sub_08047798(Entity*); // action 6 subAction 0 +void sub_080477F0(Entity*); // action 6 subAction 1 +void sub_08047914(Entity*); // action 6 subAction 2 +void sub_08047978(Entity*); // action 6 subAction 3 +void sub_08047B08(Entity*); // action 6 subAction 4 void sub_08047B84(Entity*); // action 7 -void sub_08047BA4(Entity*); // action 7 previousActionFlag 0 -void sub_08047BF0(Entity*); // action 7 previousActionFlag 1, also called elsewhere -void sub_08047D24(Entity*); // action 7 previousActionFlag 2 +void sub_08047BA4(Entity*); // action 7 subAction 0 +void sub_08047BF0(Entity*); // action 7 subAction 1, also called elsewhere +void sub_08047D24(Entity*); // action 7 subAction 2 void sub_08047D88(Entity*); // void sub_08047DF0(Entity*, u32); void sub_08047E48(Entity*); // @@ -118,7 +117,7 @@ void sub_08046898(Entity* this) { tmp->parent = this; this->attachedEntity = tmp; this->action = 1; - this->previousActionFlag = 0; + this->subAction = 0; this->spriteRendering.b0 = 3; this->spriteSettings.b.draw = 1; this->spriteOrientation.flipY = 2; @@ -136,32 +135,32 @@ void (*const gUnk_080D1B1C[7])(Entity*) = { sub_08046930, sub_0804696C, sub_0804 sub_08046A30, sub_08046A54, sub_08046A78 }; void sub_08046910(Entity* this) { - gUnk_080D1B1C[this->previousActionFlag](this); + gUnk_080D1B1C[this->subAction](this); UpdateAnimationSingleFrame(this); } void sub_08046930(Entity* this) { if (this->type) { - this->previousActionFlag = 5; + this->subAction = 5; this->direction = 0x20; - this->nonPlanarMovement = 0x280; + this->speed = 0x280; } sub_08047D88(this); if (this->field_0x7c.BYTES.byte0 == 0) return; - this->previousActionFlag = 1; + this->subAction = 1; this->actionDelay = 1; this->animationState = 0; this->direction = 0; - this->nonPlanarMovement = 0x280; + this->speed = 0x280; } void sub_0804696C(Entity* this) { sub_08047E48(this); if (gRoomControls.roomOriginY + 0x130 > this->y.HALF.HI) { - this->previousActionFlag = 2; + this->subAction = 2; this->direction = 0x80; - this->nonPlanarMovement = 0x100; + this->speed = 0x100; this->spriteOrientation.flipY = 3; this->spriteRendering.b3 = 3; SoundReq(BGM_BOSS_THEME); @@ -177,7 +176,7 @@ void sub_0804696C(Entity* this) { void sub_080469CC(Entity* this) { sub_08047E48(this); if (gRoomControls.roomOriginY + 0x210 < this->y.HALF.HI) { - this->previousActionFlag = 3; + this->subAction = 3; this->direction = 0x90; } } @@ -185,7 +184,7 @@ void sub_080469CC(Entity* this) { void sub_080469F4(Entity* this) { sub_08047E48(this); if (gRoomControls.roomOriginY + 0x290 < this->y.HALF.HI) { - this->previousActionFlag = 4; + this->subAction = 4; this->spriteOrientation.flipY = 2; this->spriteRendering.b3 = 2; } @@ -195,14 +194,14 @@ void sub_08046A30(Entity* this) { sub_08047D88(this); if (((Entity*)this->myHeap)->prev->field_0x6c.HWORD & 1) { this->action = 2; - this->previousActionFlag = 0; + this->subAction = 0; } } void sub_08046A54(Entity* this) { sub_08047E48(this); if (gRoomControls.roomOriginX + 0x380 < this->x.HALF.HI) { - this->previousActionFlag = 6; + this->subAction = 6; } } @@ -210,7 +209,7 @@ void sub_08046A78(Entity* this) { sub_08047D88(this); if (((Entity*)this->myHeap)->prev->field_0x6c.HWORD & 0x10) { this->action = 3; - this->previousActionFlag = 0; + this->subAction = 0; } } @@ -222,17 +221,17 @@ void sub_08046A9C(Entity* this) { InitAnimationForceUpdate(this, 0); } } - gUnk_080D1B38[this->previousActionFlag](this); + gUnk_080D1B38[this->subAction](this); UpdateAnimationSingleFrame(this); if (this->field_0x7c.BYTES.byte0) { this->action = 6; - this->previousActionFlag = 0; + this->subAction = 0; } } void sub_08046AE8(Entity* this) { - this->previousActionFlag = 1; - this->nonPlanarMovement = 0x180; + this->subAction = 1; + this->speed = 0x180; sub_08048178(this, ((Entity*)this->myHeap)->next->animationState >> 5); this->field_0x76.HWORD = this->direction << 8; sub_08047D88(this); @@ -248,7 +247,7 @@ void sub_08046B18(Entity* this) { } this->direction = this->field_0x76.HWORD >> 8; } else { - this->previousActionFlag = 2; + this->subAction = 2; } sub_08047D88(this); sub_08047EA4(this, ((0x100 - this->direction) & 0xFF) << 8); @@ -256,7 +255,7 @@ void sub_08046B18(Entity* this) { void sub_08046B8C(Entity* this) { if (sub_0806FCB8(this, this->field_0x80.HWORD, this->field_0x82.HWORD, 4)) { - this->previousActionFlag = 3; + this->subAction = 3; this->field_0x76.HWORD = this->direction << 8; this->field_0x80.HWORD = gRoomControls.roomOriginX + 0x200; this->field_0x82.HWORD = gRoomControls.roomOriginY + 0x210; @@ -278,7 +277,7 @@ void sub_08046C04(Entity* this) { } this->direction = this->field_0x76.HWORD >> 8; } else { - this->previousActionFlag = 4; + this->subAction = 4; this->field_0x70.HALF.LO = ((tmp + 0x20) & 0xC0) >> 6; } sub_08047D88(this); @@ -287,7 +286,7 @@ void sub_08046C04(Entity* this) { void sub_08046C88(Entity* this) { if (sub_0806FCB8(this, this->field_0x80.HWORD, this->field_0x82.HWORD, 4)) { - this->previousActionFlag = 1; + this->subAction = 1; sub_08048178(this, sub_08048158(this->field_0x70.HALF_U.LO)); sub_08047D88(this); } else { @@ -305,12 +304,12 @@ void sub_08046CEC(Entity* this) { InitAnimationForceUpdate(this, 1); } } - gUnk_080D1B4C[this->previousActionFlag](this); + gUnk_080D1B4C[this->subAction](this); UpdateAnimationSingleFrame(this); if (((Entity*)this->myHeap)->prev->field_0x6c.HWORD & 2) { this->action = 2; - this->previousActionFlag = 0; - this->animationState = this->nonPlanarMovement; + this->subAction = 0; + this->animationState = this->speed; } } @@ -318,8 +317,8 @@ const u16 gUnk_080D1B60[8] = { 0x200, 0x184, 0x28C, 0x210, 0x200, 0x29C, 0x174, void sub_08046D44(Entity* this) { const u16* tmp; - this->previousActionFlag = 1; - this->nonPlanarMovement = 0x200; + this->subAction = 1; + this->speed = 0x200; tmp = gUnk_080D1B60 + (((Entity*)this->myHeap)->next->animationState >> 5); this->field_0x80.HWORD = tmp[0] + gRoomControls.roomOriginX; this->field_0x82.HWORD = tmp[1] + gRoomControls.roomOriginY; @@ -337,7 +336,7 @@ void sub_08046D98(Entity* this) { } this->direction = this->field_0x76.HWORD >> 8; } else { - this->previousActionFlag = 2; + this->subAction = 2; } sub_08047D88(this); sub_08047EA4(this, ((0x100 - this->direction) & 0xFF) << 8); @@ -345,7 +344,7 @@ void sub_08046D98(Entity* this) { void sub_08046E0C(Entity* this) { if (sub_0806FCB8(this, this->field_0x80.HWORD, this->field_0x82.HWORD, 4)) { - this->previousActionFlag = 3; + this->subAction = 3; this->field_0x76.HWORD = this->direction << 8; sub_08047D88(this); } else { @@ -369,7 +368,7 @@ void sub_08046E68(Entity* this) { sub_08047D88(this); sub_08047EA4(this, ((0x100 - this->direction) & 0xFF) << 8); } else { - this->previousActionFlag = 4; + this->subAction = 4; this->actionDelay = 0x3F; this->field_0xf = 1; this->direction = (gUnk_080D1B70[Random() & 1] + tmp) & 0xC0; @@ -385,7 +384,7 @@ void sub_08046EF4(Entity* this) { this->actionDelay = 0x7F; this->direction ^= 0x80; } - this->nonPlanarMovement = gUnk_080D1B74[(this->actionDelay >> 3) & 0xF]; + this->speed = gUnk_080D1B74[(this->actionDelay >> 3) & 0xF]; if ((--this->field_0xf & 0xFF) == 0) { Entity* tmp; this->field_0xf = (Random() & 0x38) + 0x78; @@ -408,7 +407,7 @@ void sub_08046F64(Entity* this) { InitAnimationForceUpdate(this, 1); } } - gUnk_080D1B94[this->previousActionFlag](this); + gUnk_080D1B94[this->subAction](this); UpdateAnimationSingleFrame(this); if (--this->field_0x7c.HALF.HI == 0) { Entity* tmp; @@ -422,13 +421,13 @@ void sub_08046F64(Entity* this) { } if (((Entity*)this->myHeap)->prev->field_0x6c.HWORD & 4) { this->action = 5; - this->previousActionFlag = 0; + this->subAction = 0; } } void sub_08046FE8(Entity* this) { - this->previousActionFlag = 1; - this->nonPlanarMovement = 0x1c0; + this->subAction = 1; + this->speed = 0x1c0; this->field_0x7c.HALF.HI = 0x1e; this->field_0x80.HWORD = gRoomControls.roomOriginX + 0x290; this->field_0x82.HWORD = gRoomControls.roomOriginY + 0x190; @@ -445,10 +444,10 @@ void sub_0804702C(Entity* this) { } } sub_08047DF0(this, ((0x100 - this->direction) & 0xFF) << 8); - if (sub_0806FCB8(this, this->field_0x80.HWORD, this->field_0x82.HWORD, (this->nonPlanarMovement >> 0x10) + 0x10)) { - this->previousActionFlag = 2; + if (sub_0806FCB8(this, this->field_0x80.HWORD, this->field_0x82.HWORD, (this->speed >> 0x10) + 0x10)) { + this->subAction = 2; this->field_0x76.HWORD = this->direction << 8; - this->nonPlanarMovement = 0x280; + this->speed = 0x280; } } @@ -466,8 +465,8 @@ void sub_080470B4(Entity* this) { sub_08047D88(this); sub_08047EA4(this, ((0x100 - this->direction) & 0xFF) << 8); } else { - this->previousActionFlag = 3; - this->nonPlanarMovement = 0x200; + this->subAction = 3; + this->speed = 0x200; this->field_0x76.HWORD = this->direction << 8; this->field_0x74.HWORD = gUnk_080D1BBC[Random() & 1]; sub_08047D88(this); @@ -479,24 +478,24 @@ void sub_08047140(Entity* this) { this->direction = this->field_0x76.HWORD >> 8; if (this->direction > 0xbf) { this->direction = 0xC0; - this->previousActionFlag = 4; + this->subAction = 4; } sub_08047DF0(this, ((0x100 - this->direction) & 0xFF) << 8); } void sub_0804717C(Entity* this) { - if (this->nonPlanarMovement < 0x280) { - this->nonPlanarMovement += 8; + if (this->speed < 0x280) { + this->speed += 8; } sub_08047DF0(this, ((0x100 - this->direction) & 0xFF) << 8); if (gRoomControls.roomOriginX + 0x200 > this->x.HALF.HI) { - this->previousActionFlag = 5; + this->subAction = 5; } } void sub_080471C8(Entity* this) { - if (this->nonPlanarMovement > 0x180) { - this->nonPlanarMovement -= 0x10; + if (this->speed > 0x180) { + this->speed -= 0x10; } if (this->direction < 0xe0) { this->direction++; @@ -506,20 +505,20 @@ void sub_080471C8(Entity* this) { return; if (this->field_0x74.HWORD > 0x100) { if (Random() & 1) { - this->previousActionFlag = 6; + this->subAction = 6; } else { - this->previousActionFlag = 0; + this->subAction = 0; } } else { - this->previousActionFlag = 0; + this->subAction = 0; } } void sub_0804723C(Entity* this) { this->direction -= 2; if (this->direction < 0xc0) { - this->previousActionFlag = 7; - this->nonPlanarMovement = 0x200; + this->subAction = 7; + this->speed = 0x200; this->direction = 0xc0; this->field_0x76.HWORD = 0xc000; } @@ -532,31 +531,31 @@ void sub_08047284(Entity* this) { this->direction = this->field_0x76.HWORD >> 8; if (this->direction < 0x40) { this->direction = 0x40; - this->previousActionFlag = 8; + this->subAction = 8; } sub_08047DF0(this, ((0x100 - this->direction) & 0xFF) << 8); } void sub_080472BC(Entity* this) { - if (this->nonPlanarMovement < 0x300) { - this->nonPlanarMovement += 8; + if (this->speed < 0x300) { + this->speed += 8; } sub_08047DF0(this, ((0x100 - this->direction) & 0xFF) << 8); if (gRoomControls.roomOriginX + 0x2B0 >= this->x.HALF.HI) return; - this->previousActionFlag = 9; + this->subAction = 9; this->field_0x76.HWORD = this->direction << 8; } void sub_08047310(Entity* this) { - if (this->nonPlanarMovement < 0x180) { - this->nonPlanarMovement -= 0x10; + if (this->speed < 0x180) { + this->speed -= 0x10; } this->field_0x76.HWORD -= 0x1D0; this->direction = this->field_0x76.HWORD >> 8; if ((u8)(this->direction + 0x7F) < 0x40) { this->direction = 0xC0; - this->previousActionFlag = 4; + this->subAction = 4; } sub_08047DF0(this, ((0x100 - this->direction) & 0xFF) << 8); } @@ -570,17 +569,17 @@ void sub_0804736C(Entity* this) { InitAnimationForceUpdate(this, 0); } } - gUnk_080D1BC0[this->previousActionFlag](this); + gUnk_080D1BC0[this->subAction](this); UpdateAnimationSingleFrame(this); if (this->currentHealth == 0) { this->action = 7; - this->previousActionFlag = 0; + this->subAction = 0; } } void sub_080473B8(Entity* this) { - this->previousActionFlag = 1; - this->nonPlanarMovement = 0x120; + this->subAction = 1; + this->speed = 0x120; this->field_0x80.HWORD = gRoomControls.roomOriginX + 0x200; this->field_0x82.HWORD = gRoomControls.roomOriginY + 0x1D0; sub_08047D88(this); @@ -606,9 +605,9 @@ void sub_080473F0(Entity* this) { } sub_08047DF0(this, ((0x100 - this->direction) & 0xFF) << 8); if (sub_0806FCB8(this, this->field_0x80.HWORD, this->field_0x82.HWORD, 8)) { - this->previousActionFlag = 2; + this->subAction = 2; this->field_0x76.HWORD = this->direction << 8; - this->nonPlanarMovement = 0x180; + this->speed = 0x180; } } @@ -624,8 +623,8 @@ void sub_08047484(Entity* this) { sub_08047D88(this); sub_08047EA4(this, ((0x100 - this->direction) & 0xFF) << 8); } else { - this->previousActionFlag = 3; - this->nonPlanarMovement = 0x200; + this->subAction = 3; + this->speed = 0x200; this->direction = 0x40; this->field_0x76.HWORD = 0x4000; this->field_0x74.HWORD = 0x180; @@ -664,8 +663,8 @@ void sub_08047508(Entity* this) { } sub_08047E48(this); if (gRoomControls.roomOriginX + 0x280 < this->x.HALF.HI) { - this->previousActionFlag = 4; - this->nonPlanarMovement = 0x200; + this->subAction = 4; + this->speed = 0x200; this->animationState = this->direction; this->field_0x76.HWORD = this->direction << 8; } @@ -682,8 +681,8 @@ void sub_080475F4(Entity* this) { this->direction = this->field_0x76.HWORD >> 8; if (this->direction >= 0xc0) { this->direction = 0xc0; - this->previousActionFlag = 5; - this->nonPlanarMovement = 0x200; + this->subAction = 5; + this->speed = 0x200; this->field_0x7c.HALF.HI = 0x3c; } sub_08047DF0(this, ((0x100 - this->direction) & 0xFF) << 8); @@ -719,8 +718,8 @@ void sub_0804763C(Entity* this) { } sub_08047E48(this); if (gRoomControls.roomOriginX + 0x180 > this->x.HALF.HI) { - this->previousActionFlag = 6; - this->nonPlanarMovement = 0x200; + this->subAction = 6; + this->speed = 0x200; this->animationState = this->direction; this->field_0x76.HWORD = this->direction << 8; } @@ -737,8 +736,8 @@ void sub_0804772C(Entity* this) { this->direction = this->field_0x76.HWORD >> 8; if (this->direction <= 0x40) { this->direction = 0x40; - this->previousActionFlag = 3; - this->nonPlanarMovement = 0x200; + this->subAction = 3; + this->speed = 0x200; this->field_0x7c.HALF.HI = 0x1e; } sub_08047DF0(this, ((0x100 - this->direction) & 0xFF) << 8); @@ -747,13 +746,13 @@ void sub_0804772C(Entity* this) { void (*const gUnk_080D1BDC[5])(Entity*) = { sub_08047798, sub_080477F0, sub_08047914, sub_08047978, sub_08047B08 }; void sub_08047778(Entity* this) { - gUnk_080D1BDC[this->previousActionFlag](this); + gUnk_080D1BDC[this->subAction](this); UpdateAnimationSingleFrame(this); } void sub_08047798(Entity* this) { - this->previousActionFlag = 1; - this->nonPlanarMovement = 0x80; + this->subAction = 1; + this->speed = 0x80; if (this->x.HALF.HI - gRoomControls.roomOriginX < 0x1F8) { this->field_0x80.HWORD = 0xa8; } else { @@ -767,14 +766,14 @@ void sub_08047798(Entity* this) { const s16 gUnk_080D1BF0[2] = { 0x80, -0x80 }; void sub_080477F0(Entity* this) { - if (this->nonPlanarMovement < 0x300) { - this->nonPlanarMovement += 8; + if (this->speed < 0x300) { + this->speed += 8; } this->direction = sub_080045DA(this->field_0x80.HWORD - this->x.HALF.HI, this->field_0x82.HWORD - this->y.HALF.HI); sub_08047E48(this); if (!sub_0806FCB8(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x80)) { this->action = 2; - this->previousActionFlag = 0; + this->subAction = 0; this->spriteOrientation.flipY = 2; this->spriteRendering.b3 = 2; this->direction = this->animationState; @@ -785,7 +784,7 @@ void sub_080477F0(Entity* this) { this->spriteRendering.b3 = 3; } if (sub_0806FCB8(this, this->field_0x80.HWORD, this->field_0x82.HWORD, 4)) { - this->previousActionFlag = 2; + this->subAction = 2; this->field_0x76.HWORD = this->animationState << 8; this->field_0x74.HWORD = gUnk_080D1BF0[Random() & 1]; if (((Entity*)this->myHeap)->prev->field_0x6c.HWORD & 1) { @@ -804,7 +803,7 @@ void sub_08047914(Entity* this) { this->animationState = this->field_0x76.HWORD >> 8; sub_08047EA4(this, ((0x100 - this->animationState) & 0xFF) << 8); } else { - this->previousActionFlag = 3; + this->subAction = 3; this->field_0x70.HALF.LO = 0x3C; this->field_0x7c.HALF.HI = ((this->type * 0xF) << 2) + 0x78; sub_080A1D70(((Entity*)this->myHeap)->prev, this->animationState); @@ -839,7 +838,7 @@ void sub_08047978(Entity* this) { } if (!sub_0806FCB8(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x80)) { this->action = 2; - this->previousActionFlag = 0; + this->subAction = 0; this->spriteOrientation.flipY = 2; this->spriteRendering.b3 = 2; this->direction = this->animationState; @@ -848,7 +847,7 @@ void sub_08047978(Entity* this) { return; if (this->attachedEntity->action != 1) return; - this->previousActionFlag = 4; + this->subAction = 4; if (this->type == 0) { if ((((Entity*)this->myHeap)->next->animationState >> 6) == 1) { this->field_0x80.HWORD = gRoomControls.roomOriginX + 0x1C0; @@ -876,17 +875,17 @@ void sub_08047978(Entity* this) { void sub_08047B08(Entity* this) { sub_08047D88(this); this->direction = sub_080045DA(this->field_0x80.HWORD - this->x.HALF.HI, this->field_0x82.HWORD - this->y.HALF.HI); - this->nonPlanarMovement = 0x200; + this->speed = 0x200; sub_08047E58(this); if (!sub_0806FCB8(this, this->field_0x80.HWORD, this->field_0x82.HWORD, 4)) return; if (this->type == 0) { this->action = 7; - this->previousActionFlag = 0; + this->subAction = 0; this->direction ^= 0x80; } else { this->action = 4; - this->previousActionFlag = 0; + this->subAction = 0; this->spriteOrientation.flipY = 2; this->spriteRendering.b3 = 2; this->direction = this->animationState; @@ -896,12 +895,12 @@ void sub_08047B08(Entity* this) { void (*const gUnk_080D1BF4[3])(Entity*) = { sub_08047BA4, sub_08047BF0, sub_08047D24 }; void sub_08047B84(Entity* this) { - gUnk_080D1BF4[this->previousActionFlag](this); + gUnk_080D1BF4[this->subAction](this); UpdateAnimationSingleFrame(this); } void sub_08047BA4(Entity* this) { - this->previousActionFlag = 1; + this->subAction = 1; this->actionDelay = 0x78; this->field_0xf = 0; if (gRoomControls.roomOriginX + 0x200 < this->x.HALF.HI) { @@ -918,7 +917,7 @@ const s8 gUnk_080D1C00[4] = { 0x40, -0x40, -0x40, 0x40 }; void sub_08047BF0(Entity* this) { Entity* tmp; this->direction = gUnk_080D1C00[this->actionDelay & 3]; - this->nonPlanarMovement = 0x100; + this->speed = 0x100; sub_08047E48(this); if (this->actionDelay == 0) { if ((this->field_0xf++ & 0xF) == 0) { @@ -934,10 +933,10 @@ void sub_08047BF0(Entity* this) { } } this->direction = this->field_0x76.HWORD; - this->nonPlanarMovement = 0x140; + this->speed = 0x140; sub_08047E48(this); if (this->y.HALF.HI > gRoomControls.roomOriginY + 0x270) { - this->previousActionFlag = 2; + this->subAction = 2; this->field_0x7c.HALF.HI = 0xAA; SoundReq(0x12D); InitAnimationForceUpdate(this, 1); @@ -1009,7 +1008,7 @@ void sub_08047DF0(Entity* this, u32 unk1) { sub_08047EA4(this, unk1); oldX = this->x.HALF.HI; oldY = this->y.HALF.HI; - sub_0806F62C(this, this->nonPlanarMovement, this->direction); + sub_0806F62C(this, this->speed, this->direction); if (this->field_0x7c.BYTES.byte0 & 1) { if (sub_08079F8C()) { gPlayerEntity.x.HALF.HI += this->x.HALF.HI - oldX; @@ -1027,7 +1026,7 @@ void sub_08047E58(Entity* this) { u32 oldX, oldY; oldX = this->x.HALF.HI; oldY = this->y.HALF.HI; - sub_0806F62C(this, this->nonPlanarMovement, this->direction); + sub_0806F62C(this, this->speed, this->direction); if (this->field_0x7c.BYTES.byte0 & 1) { if (sub_08079F8C()) { gPlayerEntity.x.HALF.HI += this->x.HALF.HI - oldX; diff --git a/src/enemy/hangingSeed.c b/src/enemy/hangingSeed.c index fc09db31..fe6fe0fc 100644 --- a/src/enemy/hangingSeed.c +++ b/src/enemy/hangingSeed.c @@ -1,4 +1,5 @@ #include "entity.h" +#include "enemy.h" #include "functions.h" extern void (*const gHangingSeedFunctions[])(Entity*); diff --git a/src/enemy/helmasaur.c b/src/enemy/helmasaur.c index 64a97b39..5d4302df 100644 --- a/src/enemy/helmasaur.c +++ b/src/enemy/helmasaur.c @@ -1,4 +1,5 @@ #include "enemy.h" +#include "random.h" #include "functions.h" extern void sub_08008796(Entity*, u32, u32, u32); @@ -62,16 +63,16 @@ void sub_0802BBC4(Entity* this) { void sub_0802BC20(Entity* this) { if (this->damageType != 0x19) { if (sub_0806F520(this)) { - gUnk_080CD42C[this->previousActionFlag](this); + gUnk_080CD42C[this->subAction](this); } - } else if (2 < this->previousActionFlag || sub_0806F520(this)) { - gUnk_080CD438[this->previousActionFlag](this); + } else if (2 < this->subAction || sub_0806F520(this)) { + gUnk_080CD438[this->subAction](this); } } void sub_0802BC74(Entity* this) { sub_0802C1C0(this); - this->previousActionFlag = 1; + this->subAction = 1; this->field_0x1d = 60; this->animationState = (gPlayerEntity.animationState >> 1) ^ 2; InitializeAnimation(this, this->animationState); @@ -101,7 +102,7 @@ void sub_0802BCA8(Entity* this) { } void sub_0802BCFC(Entity* this) { - this->previousActionFlag = 1; + this->subAction = 1; this->field_0x1d = 60; } @@ -176,7 +177,7 @@ void sub_0802BE18(Entity* this) { if (--this->actionDelay == 0) { this->action = 4; this->actionDelay = 0x1e; - this->nonPlanarMovement = 0x300; + this->speed = 0x300; } else { sub_0802C18C(this); } @@ -196,12 +197,12 @@ void sub_0802BE48(Entity* this) { } void sub_0802BE80(Entity* this) { - this->nonPlanarMovement -= 0x20; - if (0xff < this->nonPlanarMovement) { + this->speed -= 0x20; + if (0xff < this->speed) { sub_0802C1CC(this); } - if (this->nonPlanarMovement > 0) { + if (this->speed > 0) { sub_080AEFE0(this); sub_0802C18C(this); } else { @@ -229,7 +230,7 @@ void sub_0802BEEC(Entity* this) { } else if (!sub_08003FC4(this, 0x1c00)) { this->action = 8; this->actionDelay = 30; - this->nonPlanarMovement = 0x120; + this->speed = 0x120; } } @@ -259,7 +260,7 @@ void sub_0802BF78(Entity* this) { void sub_0802BF98(Entity* this) { if (sub_0806F520(this)) { - gUnk_080CD450[this->previousActionFlag](this); + gUnk_080CD450[this->subAction](this); } else { this->action = 2; this->actionDelay = 30; @@ -268,7 +269,7 @@ void sub_0802BF98(Entity* this) { } void sub_0802BFD0(Entity* this) { - this->previousActionFlag = 2; + this->subAction = 2; } void sub_0802BFD8(Entity* this) { @@ -366,7 +367,7 @@ void sub_0802C1CC(Entity* this) { void sub_0802C218(Entity* this) { this->action = 6; - this->nonPlanarMovement = 0xe0; + this->speed = 0xe0; this->field_0x20 = 0x18000; } diff --git a/src/enemy/keaton.c b/src/enemy/keaton.c index 18b4f87e..79e98065 100644 --- a/src/enemy/keaton.c +++ b/src/enemy/keaton.c @@ -1,5 +1,7 @@ #include "global.h" #include "entity.h" +#include "enemy.h" +#include "random.h" #include "functions.h" extern Entity* gUnk_020000B0; @@ -102,7 +104,7 @@ void sub_080324FC(Entity* this) { this->field_0xf--; if (this->field_0xf == 0) { this->action = 4; - this->nonPlanarMovement = 0x1E0; + this->speed = 0x1E0; this->field_0x76.HWORD = 0x46; this->field_0x78.HWORD = 0; *(((u8*)&this->field_0x7a) + 1) = 0; @@ -164,17 +166,17 @@ void sub_08032650(Entity* this) { sub_0803269C(this, this->direction); } -void sub_0803269C(Entity* this, u32 param_2) { +void sub_0803269C(Entity* this, u32 direction) { u32 uVar1; - if (((param_2 - 3) & 7) < 3) { - uVar1 = DirectionToAnimationState(param_2); + if (((direction - 3) & 7) < 3) { + uVar1 = DirectionToAnimationState(direction); if (((this->animationState - uVar1) & 3) > 1) { this->animationState = uVar1; InitAnimationForceUpdate(this, (this->animIndex & 0xFC) + uVar1); } } else { - uVar1 = DirectionToAnimationState(param_2); + uVar1 = DirectionToAnimationState(direction); if (uVar1 != this->animationState) { this->animationState = uVar1; InitAnimationForceUpdate(this, (this->animIndex & 0xFC) + uVar1); @@ -197,7 +199,7 @@ u32 sub_0803271C(Entity* this) { void sub_08032740(Entity* this) { this->action = 1; - this->nonPlanarMovement = 0x80; + this->speed = 0x80; InitializeAnimation(this, this->animationState); sub_08032650(this); } @@ -205,7 +207,7 @@ void sub_08032740(Entity* this) { void sub_0803275C(Entity* this) { this->action = 5; this->actionDelay = 0x2D; - this->nonPlanarMovement = 0x80; + this->speed = 0x80; InitAnimationForceUpdate(this, this->animationState); sub_0803269C(this, this->direction); sub_080327E0(this); diff --git a/src/enemy/keese.c b/src/enemy/keese.c index 0462b254..26c1a938 100644 --- a/src/enemy/keese.c +++ b/src/enemy/keese.c @@ -2,19 +2,13 @@ #include "entity.h" #include "enemy.h" #include "player.h" +#include "random.h" #include "functions.h" extern void sub_08001328(Entity*); -extern u32 sub_0806F520(Entity*); -extern void sub_0806F4E8(Entity*); -extern u32 sub_0806F3E4(Entity*); -extern void sub_0804A7D4(Entity*); -extern void sub_0804A720(Entity*); extern void Keese_StartFly(Entity*); extern void sub_080AEFB4(Entity*); extern void sub_08021F24(Entity*); -extern u32 sub_08049FA0(Entity*); -extern u32 sub_08049EE4(Entity*); extern void (*const gKeeseFunctions[])(Entity*); extern void (*const gKeeseActions[])(Entity*); @@ -43,12 +37,12 @@ void sub_08021d98(Entity* this) { void sub_08021DA8(Entity* this) { if (sub_0806F520(this)) { - gUnk_080CB6C4[this->previousActionFlag](this); + gUnk_080CB6C4[this->subAction](this); } } void sub_08021DCC(Entity* this) { - this->previousActionFlag = 2; + this->subAction = 2; } void sub_08021DD4(Entity* this) { diff --git a/src/enemy/lakitu.c b/src/enemy/lakitu.c index 163ec9e1..cd9ce2b2 100644 --- a/src/enemy/lakitu.c +++ b/src/enemy/lakitu.c @@ -1,57 +1,13 @@ #include "global.h" #include "entity.h" +#include "enemy.h" #include "functions.h" -#include "trig.h" +#include "coord.h" #include "random.h" #include "player.h" extern void (*const LakituActionFuncs[])(Entity*); -// Lakitu -extern void EnemyFunctionHandler(Entity*, void (*const funcs[])(Entity*)); - -// sub_0803C784 -extern void sub_0804AA30(Entity*, void (*const funcs[])(Entity*)); - -// sub_0803C820 -extern u32 sub_0806F520(Entity*); - -// sub_0803C850 -extern void sub_0806F4E8(Entity*); - -// Lakitu_Initialize -extern void sub_0804A720(Entity*); - -// Lakitu_Cloudless -extern u32 sub_08003FC4(Entity*, u32); - -// sub_0803CA4C -extern u32 sub_080041A0(Entity*, Entity*, u32, u32); - -// sub_0803CAD0 -extern u32 sub_080AEFE0(Entity*); - -// Lakitu_SpawnLightning -void PositionRelative(Entity*, Entity*, s32, s32); -extern void EnqueueSFX(u32); - -// sub_0803CC08 -extern void DeleteEntity(Entity*); - -// Part of function tables -extern void sub_08001324(Entity*); -extern void sub_0804A7D4(Entity*); -extern void sub_08001242(Entity*); - -// Used in multiple functions -extern Entity* CreateFx(Entity*, u32, u32); -extern Entity* sub_0804A98C(Entity* positionEntity, u8 subtype, - u8 form); // Creates a projectile positioned at the given entity -extern void UpdateAnimationSingleFrame(Entity*); -extern void InitAnimationForceUpdate(Entity*, u32); -extern u32 sub_0806FCB8(Entity*, u32, u32, u32); -extern u32 GetFacingDirection(Entity*, Entity*); - // Forward references to functions in lakitu.c extern void sub_0803CAD0(Entity*); extern void sub_0803CBAC(Entity*); @@ -78,9 +34,6 @@ typedef struct { s8 y; } PACKED OffsetCoords; -// sub_0803CC08 -extern void DeleteEntity(Entity*); - // Variables extern void (*const gUnk_080D0110[])(Entity*); extern void (*const gUnk_080D0128[])(Entity*); @@ -140,12 +93,12 @@ void sub_0803C784(Entity* this) { void sub_0803C820(Entity* this) { if (sub_0806F520(this)) { - gUnk_080D0148[this->previousActionFlag](this); + gUnk_080D0148[this->subAction](this); } } void sub_0803C844(Entity* this) { - this->previousActionFlag = 1; + this->subAction = 1; this->field_0x1d = 0x3c; } diff --git a/src/enemy/lakituCloud.c b/src/enemy/lakituCloud.c index 80679029..5ce140c5 100644 --- a/src/enemy/lakituCloud.c +++ b/src/enemy/lakituCloud.c @@ -1,25 +1,17 @@ #include "global.h" #include "entity.h" #include "player.h" +#include "functions.h" extern u32 GetNextFunction(Entity*); -extern void sub_0804A7D4(Entity*); -extern void sub_08001242(Entity*); - extern void (*const gUnk_080D0418[6])(Entity*); extern void (*const gUnk_080D0430[3])(Entity*); extern void (*const gUnk_080D043C[3])(Entity*); -extern bool32 sub_0806F3E4(Entity*); -extern bool32 sub_0806F520(Entity*); - extern void sub_0800449C(Entity*, u32); extern void sub_0803CE14(Entity*); extern void sub_0803CE3C(Entity*); -extern Entity* GetCurrentRoomProperty(u8); -extern void sub_0806F4E8(Entity*); -extern void sub_0806F69C(Entity*); extern void sub_08079D84(void); extern void sub_080A2CC0(Entity*, Entity**, u16*); @@ -38,16 +30,16 @@ void sub_0803CCEC(Entity* this) { void sub_0803CCFC(Entity* this) { if (sub_0806F520(this) == 0) { - if (this->previousActionFlag == 2) { + if (this->subAction == 2) { sub_0803CE3C(this); } } else { - gUnk_080D043C[this->previousActionFlag](this); + gUnk_080D043C[this->subAction](this); } } void sub_0803CD2C(Entity* this) { - this->previousActionFlag = 1; + this->subAction = 1; this->field_0x1d = 0x3c; } diff --git a/src/enemy/leever.c b/src/enemy/leever.c index 5ce12ee5..d92e1d26 100644 --- a/src/enemy/leever.c +++ b/src/enemy/leever.c @@ -1,19 +1,14 @@ #include "global.h" #include "entity.h" #include "enemy.h" +#include "random.h" #include "functions.h" +#include "coord.h" -extern void SetChildOffset(Entity*, s32, s32, s32); -extern void sub_0804AA30(Entity*, void (*const func[])(Entity*)); -extern void sub_0804A7D4(Entity*); -extern Entity* CreateDeathFx(Entity*, u32, u32); -extern void sub_0804A720(Entity*); extern u32 sub_080002D4(s32, s32, u32); extern u32 sub_080002BC(s32, s32, u32); -extern u32 sub_08049FDC(Entity*, u32); extern Entity* gUnk_020000B0; -extern s16 gSineTable[]; bool32 Leever_PlayerInRange(Entity*, s32); void Leever_Move(Entity*); @@ -172,13 +167,13 @@ void Leever_Move(Entity* this) { this->field_0x74.HWORD = 1; } - this->nonPlanarMovement = (this->frames.all & 0xf) * 0x20; + this->speed = (this->frames.all & 0xf) * 0x20; if (this->type == LeeverForm_Red) { if ((this->field_0xf++ & 0xf) == 0) { sub_08004596(this, sub_0800132C(this, gUnk_020000B0)); } } else { - this->nonPlanarMovement += 0x40; + this->speed += 0x40; if ((this->field_0xf++ & 0x7) == 0) { sub_08004596(this, sub_0800132C(this, gUnk_020000B0)); } diff --git a/src/enemy/likeLike.c b/src/enemy/likeLike.c index 60a7b7b7..f04073d3 100644 --- a/src/enemy/likeLike.c +++ b/src/enemy/likeLike.c @@ -1,11 +1,12 @@ #include "enemy.h" #include "entity.h" -#include "functions.h" #include "textbox.h" #include "save.h" +#include "random.h" +#include "createObject.h" +#include "functions.h" extern bool32 sub_080544B4(u32); -extern void sub_0807CAA0(u32, u32); void sub_0802810C(Entity*); void sub_080281A0(Entity*); @@ -210,7 +211,7 @@ void sub_0802810C(Entity* this) { gPlayerState.flags.all &= 0xffffffef; gPlayerEntity.flags |= 0x80; gPlayerEntity.field_0x20 = 0x18000; - gPlayerEntity.hurtBlinkTime = -60; + gPlayerEntity.iframes = -60; gPlayerEntity.direction = gPlayerEntity.animationState << 2; gPlayerEntity.spritePriority.b1 = this->field_0x82.HALF.HI; gPlayerEntity.height.HALF.HI = gPlayerEntity.spriteOffsetY; @@ -219,8 +220,8 @@ void sub_0802810C(Entity* this) { this->actionDelay = 0x50; this->field_0xf = 0; this->flags2 |= 2; - if (this->hurtBlinkTime == 0) { - this->hurtBlinkTime = -18; + if (this->iframes == 0) { + this->iframes = -18; } } #else diff --git a/src/enemy/madderpillar.c b/src/enemy/madderpillar.c index cea511b4..0679a87d 100644 --- a/src/enemy/madderpillar.c +++ b/src/enemy/madderpillar.c @@ -1,5 +1,6 @@ #include "enemy.h" #include "entity.h" +#include "random.h" #include "functions.h" extern u8 gEntCount; @@ -115,7 +116,7 @@ void sub_0802999C(Entity* this) { this->action = 1; this->flags |= 0x80; this->direction = DirectionRound(Random()); - this->nonPlanarMovement = 0xa0; + this->speed = 0xa0; this->animationState = 0xff; this->y.WORD += 6; this->parent = this; @@ -135,7 +136,7 @@ void sub_08029A94(Entity* this) { void sub_08029AA4(Entity* this) { if (this->field_0x76.HALF.HI != 0) { this->action = 3; - this->nonPlanarMovement = 0x108; + this->speed = 0x108; this->damageType = 0x6a; this->field_0x7a.HWORD = 0x168; this->field_0x74.HALF.HI = 4; @@ -150,7 +151,7 @@ void sub_08029AE0(Entity* this) { sub_0802A098(this); if (--this->field_0x7a.HWORD == 0) { this->action = 1; - this->nonPlanarMovement = 0xa0; + this->speed = 0xa0; this->field_0x74.HALF.HI = 0; sub_08029EEC(this); sub_0801D2B4(this, 0x77); @@ -460,12 +461,12 @@ void sub_0802A098(Entity* this) { void sub_0802A0F8(Entity* this) { if (this->currentHealth != 0) { - if ((this->bitfield & 0x80) && this->hurtBlinkTime != 0) { + if ((this->bitfield & 0x80) && this->iframes != 0) { Entity* ent = this; u32 i; for (i = 0; i < 6; i++) { ent = ent->attachedEntity; - ent->hurtBlinkTime = this->hurtBlinkTime; + ent->iframes = this->iframes; } } } else { diff --git a/src/enemy/miniFireballGuy.c b/src/enemy/miniFireballGuy.c index d5d7b0e6..3210aeeb 100644 --- a/src/enemy/miniFireballGuy.c +++ b/src/enemy/miniFireballGuy.c @@ -1,11 +1,9 @@ #include "global.h" #include "entity.h" +#include "enemy.h" +#include "random.h" #include "functions.h" -extern void EnemyFunctionHandler(Entity*, void (*const func[])(Entity*)); -extern void sub_0804A7D4(Entity*); -extern void sub_0804A720(Entity*); -extern void sub_08045678(Entity*); extern void sub_08045678(Entity*); extern void (*const gUnk_080D1868[])(Entity*); @@ -38,7 +36,7 @@ void nullsub_23(Entity* this) { void sub_08045618(Entity* this) { this->action = 1; this->spriteSettings.b.draw = 1; - this->nonPlanarMovement = 0x80; + this->speed = 0x80; this->field_0x3c = this->field_0x3c | 0x10; sub_0804A720(this); InitializeAnimation(this, 1); diff --git a/src/enemy/miniSlime.c b/src/enemy/miniSlime.c index 08c94fa7..68c1303a 100644 --- a/src/enemy/miniSlime.c +++ b/src/enemy/miniSlime.c @@ -1,16 +1,13 @@ #include "global.h" #include "entity.h" -#include "room.h" +#include "enemy.h" +#include "random.h" #include "functions.h" void sub_08045374(Entity*); -extern u32 sub_0806FA04(u32, u32); -extern void sub_0804A720(); extern void sub_080452E4(); -extern void sub_0804AA30(); extern void ReplaceMonitoredEntity(Entity*, Entity*); -extern void sub_0804A7D4(Entity*); extern void (*const gUnk_080D17C0[])(Entity*); extern void (*const gUnk_080D17D8[])(Entity*); @@ -49,7 +46,7 @@ void nullsub_22(void) { void sub_080452A4(Entity* this) { this->action = 1; this->spriteSettings.b.draw = 1; - this->nonPlanarMovement = 0x100; + this->speed = 0x100; sub_0804A720(this); InitializeAnimation(this, 6); if (this->type2) { @@ -71,8 +68,8 @@ void sub_080452FC(Entity* this) { if (--this->actionDelay == 0) { this->action = 3; this->actionDelay = 1; - if (0 < this->nonPlanarMovement) - this->actionDelay = sub_0806FA04(0x1000, this->nonPlanarMovement) >> 0x8; + if (0 < this->speed) + this->actionDelay = FixedDiv(0x1000, this->speed) >> 0x8; if (sub_08049FA0(this) == 0 && (Random() & 3)) { cVar2 = sub_08049EE4(this); diff --git a/src/enemy/moldorm.c b/src/enemy/moldorm.c index 186bee30..f7ed8161 100644 --- a/src/enemy/moldorm.c +++ b/src/enemy/moldorm.c @@ -1,5 +1,6 @@ #include "enemy.h" #include "entity.h" +#include "random.h" #include "functions.h" void sub_08022EAC(Entity*); @@ -40,9 +41,9 @@ void sub_08022BEC(Entity* this) { this->animationState = ((this->direction + 2) & 0x1c) >> 2; this->frameIndex = this->animationState; - this->attachedEntity->hurtBlinkTime = this->hurtBlinkTime; - (*(Entity**)&this->field_0x7c)->hurtBlinkTime = this->hurtBlinkTime; - (*(Entity**)&this->field_0x80)->hurtBlinkTime = this->hurtBlinkTime; + this->attachedEntity->iframes = this->iframes; + (*(Entity**)&this->field_0x7c)->iframes = this->iframes; + (*(Entity**)&this->field_0x80)->iframes = this->iframes; sub_0804AA30(this, gUnk_080CBBA0); } diff --git a/src/enemy/moldworm.c b/src/enemy/moldworm.c index 3bf68715..11d5166e 100644 --- a/src/enemy/moldworm.c +++ b/src/enemy/moldworm.c @@ -1,5 +1,6 @@ #include "enemy.h" #include "entity.h" +#include "random.h" #include "functions.h" extern void sub_0800449C(Entity*, u32); @@ -67,12 +68,12 @@ void sub_080230CC(Entity* this) { } void sub_080230E4(Entity* this) { - if (this->previousActionFlag == 0xff) { + if (this->subAction == 0xff) { this->action = 7; this->actionDelay = 1; - this->previousActionFlag = 0; + this->subAction = 0; this->damageType = 0x85; - this->hurtBlinkTime = -8; + this->iframes = -8; this->field_0x7c.BYTES.byte3 = 0; this->field_0x7a.HALF.HI = 0; if (this->bitfield == 0x80 || this->bitfield == 0x9e) { @@ -90,7 +91,7 @@ void sub_080230E4(Entity* this) { gPlayerEntity.spriteSettings.b.draw = 1; gPlayerEntity.field_0x20 = 0x18000; gPlayerEntity.direction = 0xff; - gPlayerEntity.hurtBlinkTime = -0x14; + gPlayerEntity.iframes = -0x14; gPlayerState.jumpStatus = 0x41; gPlayerState.flags.all &= 0xfff7ffff; } @@ -410,7 +411,7 @@ void sub_08023894(Entity* this) { gPlayerEntity.y.HALF.HI = this->y.HALF.HI; gPlayerEntity.direction = DirectionRoundUp(GetFacingDirection(*(Entity**)&this->field_0x74, this)); gPlayerEntity.animationState = gPlayerEntity.direction >> 2; - gPlayerEntity.hurtBlinkTime = 12; + gPlayerEntity.iframes = 12; ModHealth(-0x10); sub_0800449C(&gPlayerEntity, 0x7a); } @@ -421,7 +422,7 @@ void sub_0802390C(Entity* this) { if (this->bitfield & 0x80) { Entity* ent = this->attachedEntity; do { - ent->hurtBlinkTime = this->hurtBlinkTime; + ent->iframes = this->iframes; } while (ent = ent->attachedEntity, ent != NULL); } else { Entity* ent = this->attachedEntity; @@ -431,7 +432,7 @@ void sub_0802390C(Entity* this) { if (bVar2 != 0) { u32 tmp; ent->currentHealth = 0xff; - tmp = (u8)ent->hurtBlinkTime; + tmp = (u8)ent->iframes; if (this->currentHealth >= bVar2) { this->currentHealth -= bVar2; } else { @@ -440,7 +441,7 @@ void sub_0802390C(Entity* this) { ent = this; do { - ent->hurtBlinkTime = tmp; + ent->iframes = tmp; } while (ent = ent->attachedEntity, ent != NULL); break; } diff --git a/src/enemy/octorok.c b/src/enemy/octorok.c index d89e4e65..565ed259 100644 --- a/src/enemy/octorok.c +++ b/src/enemy/octorok.c @@ -1,15 +1,9 @@ #include "global.h" #include "entity.h" +#include "enemy.h" +#include "random.h" #include "functions.h" -extern void EnemyFunctionHandler(); -extern void SetChildOffset(); -extern void sub_0804AA30(); -extern void sub_0804A7D4(); -extern u32 sub_0806F520(); -extern void sub_0806F4E8(); -extern void UpdateAnimationVariableFrames(); -extern void sub_0804A720(); extern Entity* sub_08049DF4(u32); void Octorok_Pause(); @@ -55,16 +49,16 @@ void sub_0801EB0C(Entity* this) { } void sub_0801EB2C(Entity* this) { - if (this->previousActionFlag < 3 && !sub_0806F520(this)) { + if (this->subAction < 3 && !sub_0806F520(this)) { Octorok_Pause(this); InitializeAnimation(this, this->animationState); } else { - gUnk_080CA158[this->previousActionFlag](this); + gUnk_080CA158[this->subAction](this); } } void sub_0801EB68(Entity* this) { - this->previousActionFlag = 1; + this->subAction = 1; this->field_0x1d = 60; } diff --git a/src/enemy/peahat.c b/src/enemy/peahat.c index 165bf1eb..5c134ed8 100644 --- a/src/enemy/peahat.c +++ b/src/enemy/peahat.c @@ -1,4 +1,6 @@ #include "entity.h" +#include "enemy.h" +#include "random.h" #include "functions.h" extern void (*const gPeahatFunctions[])(Entity*); @@ -57,22 +59,22 @@ void sub_0801FFDC(Entity* this) { this->field_0x82.HALF.LO = 0; this->animationState = PeahatAnimation_SlicedPropeller; this->action = 5; - this->nonPlanarMovement = 0x80; - this->hurtBlinkTime = -30; + this->speed = 0x80; + this->iframes = -30; this->field_0x80.HALF.HI = 0; InitializeAnimation(this, this->animationState); } else if (this->bitfield == 0x9b) { this->animationState = PeahatAnimation_BrokenPropeller; this->action = 5; - this->nonPlanarMovement = 0x80; - this->hurtBlinkTime = -30; + this->speed = 0x80; + this->iframes = -30; this->field_0x80.HALF.HI = 0; InitializeAnimation(this, this->animationState); } else if (this->bitfield == 0x80) { if (this->animationState == PeahatAnimation_Flying) { this->action = 1; this->actionDelay = 30; - this->nonPlanarMovement = 0x80; + this->speed = 0x80; this->direction = -1; this->field_0x82.HALF.HI = 0x78; GetNextFrame(this); @@ -87,14 +89,14 @@ void sub_0801FFDC(Entity* this) { } void sub_08020088(Entity* this) { - if (2 >= this->previousActionFlag && !sub_0806F520(this)) + if (2 >= this->subAction && !sub_0806F520(this)) return; - gUnk_080CA5BC[this->previousActionFlag](this); + gUnk_080CA5BC[this->subAction](this); } void sub_080200B4(Entity* this) { - this->previousActionFlag = 1; + this->subAction = 1; this->field_0x1d = 60; if (this->animationState == PeahatAnimation_Flying) { this->animationState = PeahatAnimation_BrokenPropeller; @@ -150,9 +152,9 @@ void Peahat_Fly(Entity* this) { if (sub_08049FDC(this, 1)) { if (this->field_0x82.HALF.HI == 0 && (this->field_0xf & 0xf) == 0 && sub_08049F1C(this, gUnk_020000B0, 0x30)) { this->action = 2; - this->previousActionFlag = Random() & 3; + this->subAction = Random() & 3; this->actionDelay = 60; - this->nonPlanarMovement = 160; + this->speed = 160; } } @@ -176,7 +178,7 @@ void Peahat_ChargeStart(Entity* this) { } else { this->action = 3; this->actionDelay = 120; - this->nonPlanarMovement = 192; + this->speed = 192; this->direction = (GetFacingDirection(this, gUnk_020000B0) + gUnk_080CA5D4[Random() & 1]) & 0x1f; } } else { @@ -193,7 +195,7 @@ void Peahat_ChargeTarget(Entity* this) { } if (60 < this->actionDelay) { if (this->actionDelay & 1) - this->nonPlanarMovement += 4; + this->speed += 4; if ((gScreenTransition.frameCount & 3) == 0) sub_08004596(this, GetFacingDirection(this, gUnk_020000B0)); @@ -209,12 +211,12 @@ void Peahat_ChargeEnd(Entity* this) { if (--this->actionDelay == 0) { this->action = 1; this->actionDelay = 1; - this->nonPlanarMovement = 128; + this->speed = 128; this->field_0x82.HALF.HI = 120; GetNextFrame(this); } else { if (this->actionDelay & 1) - this->nonPlanarMovement -= 8; + this->speed -= 8; sub_080AEFE0(this); UpdateAnimationVariableFrames(this, 4); @@ -329,7 +331,7 @@ void PeahatPropeller_Initialize(Entity* this) { this->spriteRendering.b3 = 1; this->spriteOrientation.flipY = 1; this->spriteSettings.b.shadow = 0; - this->nonPlanarMovement = 0x20; + this->speed = 0x20; this->direction = (Random() & 0x10) + 8; InitializeAnimation(this, PeahatAnimation_Propeller); } diff --git a/src/enemy/pesto.c b/src/enemy/pesto.c index c3e67cc8..3eeda562 100644 --- a/src/enemy/pesto.c +++ b/src/enemy/pesto.c @@ -1,15 +1,16 @@ #include "enemy.h" #include "entity.h" +#include "random.h" +#include "createObject.h" +#include "game.h" #include "functions.h" extern u32 sub_080002E0(u16, u32); -extern u32 CheckIsDungeon(void); extern void sub_0800449C(Entity*, u32); extern u32 sub_08049F1C(Entity*, Entity*, u32); -extern void sub_0804AA30(Entity*, void (*const funcs[])(Entity*)); extern u32 PlayerInRange(Entity*, u32, u32); extern void sub_080AEFB4(Entity*); -extern Entity* FindNextEntityOfSameSubtype(Entity* ent, int listIndex); +extern Entity* FindNextDuplicateID(Entity* ent, int listIndex); void sub_080249F4(Entity*); void sub_08024940(Entity*); @@ -78,20 +79,20 @@ void sub_08023FE0(Entity* this) { } void sub_08023FF0(Entity* this) { - if (this->previousActionFlag < 3 && !sub_0806F520(this)) { + if (this->subAction < 3 && !sub_0806F520(this)) { this->action = 1; - this->previousActionFlag = 0; + this->subAction = 0; this->flags |= 0x80; this->damageType = 0x77; this->actionDelay = 1; - this->nonPlanarMovement = 0x40; + this->speed = 0x40; } else { - gUnk_080CBEF8[this->previousActionFlag](this); + gUnk_080CBEF8[this->subAction](this); } } void sub_08024038(Entity* this) { - this->previousActionFlag = 1; + this->subAction = 1; this->field_0x1d = 60; GetNextFrame(this); } @@ -129,7 +130,7 @@ void sub_080240B8(Entity* this) { u32 direction = (Random() & 0xc0) >> 3; sub_0804A720(this); this->action = 1; - this->previousActionFlag = 0; + this->subAction = 0; this->field_0x80.HALF.LO = 0; if (direction & 8) { this->y.HALF.HI += (direction & 0x10) ? -0x20 : 0x20; @@ -184,7 +185,7 @@ void sub_080241C0(Entity* this) { if (PlayerInRange(this, 3, (gPlayerState.hurtBlinkSpeed != 0) ? 0xa0 : 0x40) && sub_08049FDC(this, 3) && gPlayerEntity.action != 0x1e) { this->field_0x80.HALF.LO++; - this->nonPlanarMovement = 0; + this->speed = 0; sub_08024A14(this, 3, 10); } else if (--this->field_0xf == 0) { sub_08024A14(this, 0, 0x20); @@ -223,8 +224,8 @@ void sub_080242A0(Entity* this) { if (--this->actionDelay == 0) { this->direction = GetFacingDirection(this, gUnk_020000B0); sub_08024E00(this, 1); - if (this->nonPlanarMovement != 0) { - this->nonPlanarMovement = 0; + if (this->speed != 0) { + this->speed = 0; } else { sub_08024E1C(this); } @@ -236,7 +237,7 @@ void sub_080242A0(Entity* this) { this->action = 4; this->field_0x80.HALF.LO = 0; this->actionDelay = 0x10; - this->nonPlanarMovement = 0; + this->speed = 0; } } } @@ -247,7 +248,7 @@ void sub_0802433C(Entity* this) { case 0: if (--this->actionDelay == 0) { this->field_0x80.HALF.LO++; - this->nonPlanarMovement = 0x100; + this->speed = 0x100; this->field_0xf = 8; sub_08024E00(this, 1); } @@ -256,7 +257,7 @@ void sub_0802433C(Entity* this) { if (--this->actionDelay == 0) { this->action = 5; this->field_0x80.HALF.LO = 0; - this->nonPlanarMovement = 0x140; + this->speed = 0x140; this->actionDelay = 0xc0; this->field_0xf = 8; } else { @@ -275,12 +276,12 @@ void sub_080243B8(Entity* this) { if (this->attachedEntity == NULL || this->attachedEntity->next == NULL) { this->field_0x80.HALF.LO = 2; this->actionDelay = 0x20; - this->nonPlanarMovement = 0x80; + this->speed = 0x80; this->field_0x82.HALF.HI = 0x80; } else if (sub_08049F1C(this, gUnk_020000B0, 0xe)) { this->field_0x80.HALF.LO++; this->actionDelay = 0x1e; - this->nonPlanarMovement = 0x100; + this->speed = 0x100; this->field_0x82.HALF.HI = 0x80; this->attachedEntity->action = 2; } else if (--this->actionDelay) { @@ -298,14 +299,14 @@ void sub_080243B8(Entity* this) { if (--this->actionDelay == 0) { this->field_0x80.HALF.LO++; this->actionDelay = 0x20; - this->nonPlanarMovement = 0x80; + this->speed = 0x80; } break; case 2: if (--this->actionDelay == 0) { this->action = 6; this->field_0x80.HALF.LO = 0; - this->nonPlanarMovement = 0x80; + this->speed = 0x80; sub_08024B38(this); if ((this->field_0x82.HALF.HI & 0x40) == 0) { @@ -339,7 +340,7 @@ void sub_080244E8(Entity* this) { this->field_0x80.HALF.LO += 1; this->field_0x82.HALF.LO += 1; this->field_0xf = 0; - this->nonPlanarMovement = 0; + this->speed = 0; } else { this->actionDelay = 0x30; this->field_0xf = 4; @@ -368,8 +369,8 @@ void sub_080244E8(Entity* this) { u32 tmp; if (--this->actionDelay == 0) { - if (this->nonPlanarMovement) { - this->nonPlanarMovement = 0; + if (this->speed) { + this->speed = 0; } else { sub_08024E1C(this); } @@ -387,7 +388,7 @@ void sub_080244E8(Entity* this) { this->field_0x80.HALF.LO++; this->actionDelay = 0xc; this->direction = 0x10; - this->nonPlanarMovement = tmp; + this->speed = tmp; this->cutsceneBeh.HALF.LO = 0; this->flags2 &= 0xfc; sub_080249DC(this); @@ -453,7 +454,7 @@ void sub_080244E8(Entity* this) { if (--this->actionDelay == 0) { this->field_0x80.HALF.LO++; this->field_0xf = 0; - this->nonPlanarMovement = 0; + this->speed = 0; this->field_0x82.HALF.LO++; } break; @@ -482,7 +483,7 @@ void sub_080244E8(Entity* this) { this->field_0x80.HALF.LO += 1; this->actionDelay = 0xc0; this->field_0xf = 8; - this->nonPlanarMovement = 0x80; + this->speed = 0x80; sub_080249DC(this); break; default: @@ -496,7 +497,7 @@ void sub_080244E8(Entity* this) { if (this->field_0x82.HALF.HI & 0x80) { this->field_0x82.HALF.HI = 0xc0; this->field_0x80.HALF.LO = 0; - this->nonPlanarMovement = 0x40; + this->speed = 0x40; this->actionDelay = 0x40; this->field_0xf = 8; sub_08024A14(this, 0, 8); @@ -511,7 +512,7 @@ void sub_080244E8(Entity* this) { case 7: if (gPlayerEntity.height.HALF.HI == 0) { this->field_0x80.HALF.LO = 0; - this->nonPlanarMovement = 0x80; + this->speed = 0x80; sub_08024B38(this); } } @@ -665,7 +666,7 @@ bool32 sub_08024B38(Entity* this) { } } - ent = FindEntityInListBySubtype(8, 2, 2); + ent = FindEntityByID(8, 2, 2); if (ent) { do { if (ent->action != 2 && ent->height.HALF.HI == 0 && sub_08049F1C(this, ent, 0xa0)) { @@ -675,14 +676,14 @@ bool32 sub_08024B38(Entity* this) { this->field_0x82.HALF.HI &= ~0x40; break; } - } while (ent = FindNextEntityOfSameSubtype(ent, 2), ent != NULL); + } while (ent = FindNextDuplicateID(ent, 2), ent != NULL); } if (iVar4 != 0) { return iVar4; } - ent = FindEntityInListBySubtype(6, 5, 6); + ent = FindEntityByID(6, 5, 6); if (ent) { do { if (ent->action == 1 && sub_08049F1C(this, ent, 0xa0)) { @@ -692,7 +693,7 @@ bool32 sub_08024B38(Entity* this) { this->field_0x82.HALF.HI &= ~0x40; break; } - } while (ent = FindNextEntityOfSameSubtype(ent, 6), ent != NULL); + } while (ent = FindNextDuplicateID(ent, 6), ent != NULL); } if (iVar4 == 0) { @@ -709,7 +710,7 @@ bool32 sub_08024C48(Entity* this, bool32 unk) { void sub_08024C7C(Entity* this) { this->action = 1; - this->nonPlanarMovement = 0x40; + this->speed = 0x40; this->actionDelay = 0; sub_08024A14(this, 0, 0x20); } @@ -719,7 +720,7 @@ void sub_08024C94(Entity* this) { this->field_0x80.HALF.LO = 0; this->actionDelay = 0x40; this->field_0xf = 0; - this->nonPlanarMovement = 0xc0; + this->speed = 0xc0; this->field_0x82.HALF.HI = 0x80; sub_08024A14(this, 3, this->field_0xf); } @@ -785,7 +786,7 @@ void sub_08024E00(Entity* this, u32 unk) { } void sub_08024E1C(Entity* this) { - this->nonPlanarMovement = gUnk_080CBF18[sub_08024E34()]; + this->speed = gUnk_080CBF18[sub_08024E34()]; } u32 sub_08024E34(void) { @@ -809,7 +810,7 @@ void sub_08024E4C(Entity* this) { this->field_0x86.HALF.HI = 0; sub_08024F50(this); this->field_0x80.HALF.LO = 0; - this->nonPlanarMovement = 0x40; + this->speed = 0x40; this->actionDelay = 0x40; this->field_0xf = 8; sub_08024A14(this, 0, 8); @@ -829,7 +830,7 @@ void sub_08024E4C(Entity* this) { player->spritePriority.b1 = 0; if (this->field_0xf == 0) { (this->field_0x86.HALF.HI++; - player->hurtBlinkTime = 8; + player->iframes = 8; ModHealth(-2); sub_0800449C(player, 0x7a); } @@ -849,9 +850,9 @@ void sub_08024F50(Entity* this) { CopyPosition(this, &gPlayerEntity); gPlayerEntity.action = 1; gPlayerEntity.flags |= 0x80; - gPlayerEntity.hurtBlinkTime = -0x3c; + gPlayerEntity.iframes = -0x3c; gPlayerEntity.direction = gPlayerEntity.animationState << 2; - gPlayerEntity.nonPlanarMovement = 0; + gPlayerEntity.speed = 0; gPlayerEntity.spritePriority.b1 = this->cutsceneBeh.HALF.HI; gPlayerEntity.height.HALF.HI = gPlayerEntity.spriteOffsetY; gPlayerEntity.spriteOffsetY = 0; @@ -859,7 +860,7 @@ void sub_08024F50(Entity* this) { this->field_0x82.HALF.HI = 0xc0; this->field_0x80.HALF.LO += 2; this->cutsceneBeh.HALF.LO = 0; - this->nonPlanarMovement = 0x80; + this->speed = 0x80; } // clang-format off diff --git a/src/enemy/puffstool.c b/src/enemy/puffstool.c index 08908191..4a47b4b7 100644 --- a/src/enemy/puffstool.c +++ b/src/enemy/puffstool.c @@ -1,5 +1,6 @@ #include "enemy.h" #include "entity.h" +#include "random.h" #include "functions.h" extern u32 sub_080002E0(u32, u32); @@ -8,7 +9,6 @@ extern u16 sub_080002A8(u32, u32, u32); extern u16 sub_080002D4(u32, u32, u32); extern void sub_0804AA1C(Entity*); extern Entity* sub_08049DF4(u32); -extern void sub_0807B7D8(u32, u32, u32); extern u8 gUnk_080B37A0[]; extern u8 gUnk_080B3E80[]; @@ -74,7 +74,7 @@ void sub_08025020(Entity* this) { if (0 < this->field_0x20) { this->field_0x20 = 0; } - this->hurtBlinkTime = -0xc; + this->iframes = -0xc; this->field_0x42 = 0; if (this->field_0x80.HALF.LO == 0) { this->animationState = (*(Entity**)&this->field_0x4c)->direction >> 3; @@ -84,7 +84,7 @@ void sub_08025020(Entity* this) { } break; default: - if (this->damageType == 0x82 && this->hurtBlinkTime < 0) { + if (this->damageType == 0x82 && this->iframes < 0) { Entity* ent = CreateObject(0x21, 2, 0); if (ent != NULL) { ent->spritePriority.b0 = 3; @@ -108,14 +108,14 @@ void sub_0802511C(Entity* this) { void sub_0802514C(Entity* this) { sub_08003FC4(this, 0x2000); if (sub_0806F520(this)) { - gUnk_080CBFEC[this->previousActionFlag](this); + gUnk_080CBFEC[this->subAction](this); } else { sub_08025C2C(this); } } void sub_08025180(Entity* this) { - this->previousActionFlag = 1; + this->subAction = 1; this->actionDelay = Random(); this->animationState = (((*(Entity**)&this->field_0x4c)->direction ^ 0x10) >> 3); InitializeAnimation(this, this->animationState + 4); diff --git a/src/enemy/rockChuchu.c b/src/enemy/rockChuchu.c index 01a0c9c7..977257bd 100644 --- a/src/enemy/rockChuchu.c +++ b/src/enemy/rockChuchu.c @@ -1,5 +1,6 @@ #include "enemy.h" #include "entity.h" +#include "random.h" #include "functions.h" extern void sub_0804A4E4(Entity*, Entity*); @@ -43,7 +44,7 @@ void sub_08022254(Entity* this) { ent = CreateEnemy(1, 1); if (ent) { ent->type2 = 1; - ent->hurtBlinkTime = -8; + ent->iframes = -8; sub_0804A4E4(this, ent); this->action = 2; this->flags &= ~0x80; @@ -96,7 +97,7 @@ void sub_080223E4(Entity* this) { ent = this->attachedEntity; if (ent) { ent->bitfield = 0x94; - ent->hurtBlinkTime = 0x10; + ent->iframes = 0x10; ent->field_0x42 = 0xc; ent->field_0x3e = this->direction; } diff --git a/src/enemy/rollobite.c b/src/enemy/rollobite.c index 7ef108b4..0e6ee1bb 100644 --- a/src/enemy/rollobite.c +++ b/src/enemy/rollobite.c @@ -1,4 +1,6 @@ #include "entity.h" +#include "enemy.h" +#include "random.h" #include "functions.h" extern void (*const gRollobiteFunctions[])(Entity*); @@ -63,18 +65,18 @@ void sub_080206E0(Entity* this) { } void sub_08020734(Entity* this) { - if (this->previousActionFlag < 3 && !sub_0806F520(this)) { + if (this->subAction < 3 && !sub_0806F520(this)) { this->action = 4; this->flags |= 0x80; this->direction = 0xff; InitializeAnimation(this, this->animationState + 0x10); } else { - gUnk_080CA6A4[this->previousActionFlag](this); + gUnk_080CA6A4[this->subAction](this); } } void sub_0802077C(Entity* this) { - this->previousActionFlag = 1; + this->subAction = 1; this->field_0x1d = 60; } @@ -101,7 +103,7 @@ void sub_080207A8(Entity* this) { this->field_0x3a &= 0xfb; this->direction ^= 0x10; this->field_0x20 = 0x18000; - this->nonPlanarMovement = 0x80; + this->speed = 0x80; InitializeAnimation(this, this->animationState + 0x10); } @@ -132,11 +134,11 @@ void Rollobite_Walk(Entity* this) { } void sub_08020874(Entity* this) { - gUnk_080CA6BC[this->previousActionFlag](this); + gUnk_080CA6BC[this->subAction](this); } void sub_0802088C(Entity* this) { - this->previousActionFlag = 1; + this->subAction = 1; this->flags &= ~0x80; this->cutsceneBeh.HALF.HI = gPlayerEntity.animationState; this->spritePriority.b1 = 0; @@ -194,7 +196,7 @@ void Rollobite_Unroll(Entity* this) { GetNextFrame(this); if (this->frames.all & 0x80) { this->flags |= 0x80; - this->nonPlanarMovement = 0x100; + this->speed = 0x100; this->damageType = 34; sub_08020A30(this); this->direction = DirectionFromAnimationState(this->animationState); diff --git a/src/enemy/rope.c b/src/enemy/rope.c index e76f8ec1..0859bae6 100644 --- a/src/enemy/rope.c +++ b/src/enemy/rope.c @@ -1,8 +1,8 @@ #include "global.h" #include "entity.h" -#include "sprite.h" -#include "functions.h" #include "enemy.h" +#include "random.h" +#include "functions.h" extern void (*const gRope[6])(Entity*); extern void (*const gUnk_080CE460[4])(Entity*); @@ -36,12 +36,12 @@ void sub_080313AC(Entity* this) { void sub_080313E8(Entity* this) { if (sub_0806F520()) { - gUnk_080CE470[this->previousActionFlag](this); + gUnk_080CE470[this->subAction](this); } } void sub_0803140C(Entity* this) { - this->previousActionFlag = 1; + this->subAction = 1; this->field_0x1d = 0x3c; } @@ -60,12 +60,12 @@ void sub_08031434(Entity* this) { sub_0804A720(this); this->animationState = 0xff; this->field_0x1c = 1; - this->field_0x7a.HWORD = this->nonPlanarMovement; + this->field_0x7a.HWORD = this->speed; if (!(this->type)) { sub_08031600(this); } else { this->action = 1; - this->previousActionFlag = 0; + this->subAction = 0; this->spriteSettings.b.draw = (this->spriteSettings.b.draw & 0xfc); this->height.HALF.HI = -0x80; this->frameIndex = 0xff; @@ -73,13 +73,13 @@ void sub_08031434(Entity* this) { } void sub_08031480(Entity* this) { - if (this->previousActionFlag == 0) { + if (this->subAction == 0) { if (this->actionDelay != 0) { this->actionDelay--; } else { sub_08031600(this); this->action = 1; - this->previousActionFlag = 1; + this->subAction = 1; this->spriteSettings.b.draw = 3; this->spriteRendering.b3 = 1; this->spriteOrientation.flipY = 1; @@ -112,7 +112,7 @@ void sub_080314FC(Entity* this) { if (u != 0xff) { this->action = 3; this->actionDelay = 0x1e; - this->field_0x7a.HWORD = this->nonPlanarMovement = 0x1a0; + this->field_0x7a.HWORD = this->speed = 0x1a0; this->direction = u; this->animationState = this->direction >> 3; InitializeAnimation(this, this->animationState + 4); @@ -157,7 +157,7 @@ void sub_08031600(Entity* this) { u32 r; this->action = 2; this->actionDelay = (Random() & 0x30) + 0x3c; - this->nonPlanarMovement = 0x80; + this->speed = 0x80; this->field_0x7a.HWORD = 0x80; r = Random() & 0x18; this->direction = r; @@ -175,6 +175,6 @@ u32 sub_0803163C(Entity* this) { } else { h = this->field_0x7a.HWORD; } - this->nonPlanarMovement = h; + this->speed = h; return ProcessMovement(this); } diff --git a/src/enemy/RopeGolden.c b/src/enemy/ropeGolden.c similarity index 97% rename from src/enemy/RopeGolden.c rename to src/enemy/ropeGolden.c index b36b9635..606e2c9f 100644 --- a/src/enemy/RopeGolden.c +++ b/src/enemy/ropeGolden.c @@ -88,7 +88,7 @@ void sub_080383AC(Entity* this) { u32 v; this->action = 1; this->actionDelay = 0x8; - this->nonPlanarMovement = 0x100; + this->speed = 0x100; this->direction = DirectionRoundUp(GetFacingDirection(this, &gPlayerEntity)); v = this->direction >> 3; if (v != this->animationState) { @@ -101,7 +101,7 @@ void sub_080383E4(Entity* this) { u32 v; this->action = 2; this->actionDelay = 0x8; - this->nonPlanarMovement = 0x280; + this->speed = 0x280; v = DirectionRoundUp(GetFacingDirection(this, &gPlayerEntity)); this->direction = v; this->field_0x78.HALF.LO = v; diff --git a/src/enemy/rupeeLike.c b/src/enemy/rupeeLike.c index 74775cab..10984c27 100644 --- a/src/enemy/rupeeLike.c +++ b/src/enemy/rupeeLike.c @@ -1,11 +1,11 @@ #include "global.h" #include "entity.h" #include "enemy.h" -#include "functions.h" #include "npc.h" -#include "structures.h" #include "player.h" #include "save.h" +#include "createObject.h" +#include "functions.h" extern void sub_080293DC(Entity*); extern void sub_080296D8(Entity*); @@ -234,17 +234,17 @@ void sub_080296D8(Entity* this) { gPlayerState.flags.all &= 0xffffffef; gPlayerEntity.flags |= 0x80; gPlayerEntity.field_0x20 = 0x18000; - gPlayerEntity.hurtBlinkTime = 0xa6; + gPlayerEntity.iframes = 0xa6; gPlayerEntity.height.HALF.HI = -2; gPlayerEntity.direction = gPlayerEntity.animationState << 2; gPlayerEntity.spritePriority.b1 = this->field_0x80.HALF.LO; gPlayerEntity.spriteOffsetY = 0; - gPlayerEntity.nonPlanarMovement = 0x140; + gPlayerEntity.speed = 0x140; this->action = 5; this->field_0xf = 0x3c; this->flags2 |= 3; - if ((s8)this->hurtBlinkTime == 0) { - this->hurtBlinkTime = 0xf4; + if ((s8)this->iframes == 0) { + this->iframes = 0xf4; } } diff --git a/src/enemy/sensorBladeTrap.c b/src/enemy/sensorBladeTrap.c index d1bfd125..0aae18f1 100644 --- a/src/enemy/sensorBladeTrap.c +++ b/src/enemy/sensorBladeTrap.c @@ -35,7 +35,7 @@ void sub_0802BA18(Entity* this) { return; this->action = 2; - this->nonPlanarMovement = this->field_0x78.HWORD; + this->speed = this->field_0x78.HWORD; this->direction = direction; switch (direction >> 3) { @@ -87,7 +87,7 @@ void sub_0802BAFC(Entity* this) { void sub_0802BB10(Entity* this) { this->action = 3; - this->nonPlanarMovement = 0xc0; + this->speed = 0xc0; this->direction = this->direction ^ 0x10; EnqueueSFX(0x74); } diff --git a/src/enemy/slime.c b/src/enemy/slime.c index 13782f7a..fc7714e3 100644 --- a/src/enemy/slime.c +++ b/src/enemy/slime.c @@ -1,14 +1,10 @@ #include "global.h" #include "entity.h" +#include "enemy.h" #include "room.h" +#include "random.h" #include "functions.h" -typedef struct { - void* field_0x0; - void* entityCount; - u8 freezeTime; -} EntityHandler; - typedef struct { s8 h, v; } PACKED PosOffset; @@ -16,10 +12,6 @@ typedef struct { void sub_08044FF8(Entity*); void sub_08045178(Entity*, Entity*, int, int); -extern void sub_0804A720(Entity*); -extern u32 sub_0806FA04(u32, u32); -extern u32 sub_08049FA0(Entity*); -extern u32 sub_08049EE4(Entity*); extern void sub_0804A4E4(Entity*, Entity*); extern u32 sub_080002CC(Entity*, s32, s32); @@ -29,7 +21,6 @@ extern u8 gUnk_080D16D0[4]; // Entity count per form extern PosOffset gUnk_080D16D4[4]; extern u8 gEntCount; -extern EntityHandler gHitboxCount; void Slime(Entity* this) { EnemyFunctionHandler(this, gUnk_080D16A4); @@ -58,7 +49,7 @@ void nullsub_171() { void sub_08044FC8(Entity* this) { this->action = 1; this->spriteSettings.b.draw = 1; - this->nonPlanarMovement = 128; + this->speed = 128; sub_0804A720(this); InitializeAnimation(this, 0); sub_08044FF8(this); @@ -75,8 +66,8 @@ void sub_08045018(Entity* this) { if (--this->actionDelay == 0) { this->action = 3; this->actionDelay = 1; - if (0 < this->nonPlanarMovement) { - this->actionDelay = sub_0806FA04(4096, this->nonPlanarMovement) >> 8; + if (0 < this->speed) { + this->actionDelay = FixedDiv(4096, this->speed) >> 8; } if (sub_08049FA0(this) == 0 && (Random() & 3)) { this->direction = (sub_08049EE4(this) + 0xfc + (Random() & 8)) & 24; @@ -117,7 +108,7 @@ void sub_080450A8(Entity* this) { ent->parent = entities[(i + count - 1) % count]; ent->type2 = 1; ent->height.HALF.HI = 0; - ent->hurtBlinkTime = -0x10; + ent->iframes = -0x10; /* Set MiniSlime offset relative to killed slime. */ sub_08045178(this, ent, off->h, off->v); diff --git a/src/enemy/sluggula.c b/src/enemy/sluggula.c index 86b90864..436baf3c 100644 --- a/src/enemy/sluggula.c +++ b/src/enemy/sluggula.c @@ -1,5 +1,6 @@ #include "enemy.h" #include "entity.h" +#include "random.h" #include "functions.h" extern s32 sub_080012DC(Entity*); diff --git a/src/enemy/smallPesto.c b/src/enemy/smallPesto.c index f1b039f4..a7d68131 100644 --- a/src/enemy/smallPesto.c +++ b/src/enemy/smallPesto.c @@ -1,17 +1,11 @@ #include "global.h" #include "entity.h" +#include "coord.h" +#include "random.h" +#include "functions.h" extern u32 GetNextFunction(Entity*); -extern u32 sub_0806F520(Entity*); -extern void sub_0806F4E8(Entity*); -extern u32 sub_0806F3E4(); -extern void sub_0804A7D4(Entity*); -extern void sub_0804A720(Entity*); extern void sub_080317F8(Entity*); -extern u32 sub_08049FA0(Entity*); -extern u32 Random(); -extern u32 sub_08049EE4(Entity*); -extern void sub_0806F69C(Entity*); extern void (*gUnk_080CE530[])(Entity*); extern void (*gUnk_080CE548[])(Entity*); @@ -19,7 +13,6 @@ extern void (*gUnk_080CE554[])(Entity*); void sub_080317B4(Entity*); void sub_080317E0(Entity*); -void sub_080317F8(Entity*); void sub_08031840(Entity*); extern Hitbox gUnk_080CE560; @@ -42,17 +35,17 @@ void sub_0803169C(Entity* this) { iVar1 = sub_0806F520(this); if (iVar1 == 0) { this->action = 1; - this->previousActionFlag = 0; + this->subAction = 0; this->flags = this->flags | 0x80; - this->nonPlanarMovement = 0x40; + this->speed = 0x40; this->field_0xf = 1; } else { - gUnk_080CE554[this->previousActionFlag](this); + gUnk_080CE554[this->subAction](this); } } void sub_080316DC(Entity* this) { - this->previousActionFlag = 1; + this->subAction = 1; this->field_0x1d = 0x3c; } @@ -61,7 +54,7 @@ void sub_080316E8(Entity* this) { } void sub_080316F0(Entity* this) { - if (sub_0806F3E4()) { + if (sub_0806F3E4(this)) { sub_0804A7D4(this); } } @@ -101,7 +94,6 @@ void sub_08031770(Entity* this) { this->attachedEntity = NULL; } } - return; } void sub_080317B4(Entity* this) { diff --git a/src/enemy/spark.c b/src/enemy/spark.c index 210b8431..4a6541fa 100644 --- a/src/enemy/spark.c +++ b/src/enemy/spark.c @@ -19,7 +19,7 @@ void sub_0802B2E0(Entity* this) { if (this->bitfield & 0x80) { if ((this->bitfield & 0x7f) == 0x14) { this->flags &= ~0x80; - this->hurtBlinkTime = 0; + this->iframes = 0; this->spriteSettings.b.draw = 0; this->action = 2; ent = CreateFx(this, 2, 0); diff --git a/src/enemy/spearMoblin.c b/src/enemy/spearMoblin.c index 24009c34..033c1ea7 100644 --- a/src/enemy/spearMoblin.c +++ b/src/enemy/spearMoblin.c @@ -1,9 +1,9 @@ #include "enemy.h" #include "entity.h" +#include "random.h" #include "functions.h" extern bool32 sub_0806FC80(Entity*, Entity*, u32); -extern Entity* sub_080A7EE0(u32); extern Entity* sub_08049DF4(u32); void sub_08028604(Entity*); @@ -56,9 +56,9 @@ void sub_08028284(Entity* this) { } } - this->attachedEntity->hurtBlinkTime = this->hurtBlinkTime; + this->attachedEntity->iframes = this->iframes; if (this->currentHealth == 0) { - this->nonPlanarMovement = 0; + this->speed = 0; this->field_0x82.HALF.LO = 0; sub_080287E0(this); DeleteEntity(this->attachedEntity); @@ -86,7 +86,7 @@ void sub_08028314(Entity* this) { if (this->actionDelay) { this->animationState = this->type2 << 1; this->actionDelay = 0x1e; - this->nonPlanarMovement = 0x80; + this->speed = 0x80; this->direction = this->animationState << 2; sub_080287E0(this); } else { @@ -164,13 +164,13 @@ void sub_08028488(Entity* this) { switch (this->field_0x82.HALF.LO) { case 3: this->action = 4; - this->nonPlanarMovement = 0x180; + this->speed = 0x180; this->direction = sub_08049F84(this, 1); EnqueueSFX(0x11e); break; case 2: this->action = 2; - this->nonPlanarMovement = 0; + this->speed = 0; this->actionDelay = (Random() & 7) * 3 + 0x40; break; case 4: @@ -180,7 +180,7 @@ void sub_08028488(Entity* this) { default: this->action = 1; this->field_0x82.HALF.LO = 1; - this->nonPlanarMovement = 0x80; + this->speed = 0x80; this->actionDelay = (Random() & 7) * 3 + 0x22; break; } @@ -245,7 +245,7 @@ void sub_08028604(Entity* this) { this->field_0xf = 0; if (this->field_0x82.HALF.LO == 1) { this->actionDelay = gUnk_080CC7BC[Random() & 3]; - this->nonPlanarMovement = 0x80; + this->speed = 0x80; if (sub_08049FA0(this) != 0) { this->direction = gUnk_080CC7D0[Random() & 7] + 0x18 + this->direction & 0x18; } else { @@ -262,7 +262,7 @@ void sub_08028604(Entity* this) { } } else { this->actionDelay = 0xc; - this->nonPlanarMovement = 0; + this->speed = 0; } if (this->direction >> 2 != this->animationState) { @@ -324,7 +324,7 @@ void sub_080287B4(Entity* this) { this->field_0xf = 0; this->field_0x80.HALF.LO = 0; this->field_0x7a.HALF.HI = 0; - this->nonPlanarMovement = 0; + this->speed = 0; this->field_0x82.HALF.LO = 0; sub_080287E0(this); } @@ -371,7 +371,7 @@ void sub_08028858(Entity* this) { this->hitbox->height = box->height; if (this->field_0x82.HALF.LO == 0) { - this->nonPlanarMovement = 0; + this->speed = 0; } ProcessMovement(this); @@ -386,7 +386,7 @@ void sub_080288C0(Entity* this) { Entity* ent = this->attachedEntity; if (ent && (ent->bitfield & 0x80)) { this->field_0x3e = ent->field_0x3e; - this->hurtBlinkTime = -ent->hurtBlinkTime; + this->iframes = -ent->iframes; this->field_0x46 = ent->field_0x46; this->field_0x42 = ent->field_0x42; ent->field_0x42 = 0; diff --git a/src/enemy/spikedBeetle.c b/src/enemy/spikedBeetle.c index e1c32ce0..46c87653 100644 --- a/src/enemy/spikedBeetle.c +++ b/src/enemy/spikedBeetle.c @@ -1,5 +1,6 @@ #include "enemy.h" #include "entity.h" +#include "random.h" #include "functions.h" extern u32 sub_0804A024(Entity*, u32, u32); @@ -49,10 +50,10 @@ void sub_0802B628(Entity* this) { if (this->action < 6) { this->action = 6; this->field_0x20 = 0x18000; - this->nonPlanarMovement = 0xc0; + this->speed = 0xc0; this->direction = this->field_0x3e; this->field_0x42 = 0; - this->hurtBlinkTime = -8; + this->iframes = -8; this->damageType = 100; InitializeAnimation(this, 9); } @@ -99,7 +100,7 @@ void sub_0802B7A4(Entity* this) { if (--this->actionDelay == 0) { this->action = 1; this->actionDelay = gUnk_080CD314[Random() & 3]; - this->nonPlanarMovement = 0x60; + this->speed = 0x60; sub_0802B960(this); if (this->direction != 0xff) { u32 animation = this->direction >> 3; @@ -116,7 +117,7 @@ void sub_0802B7FC(Entity* this) { if (--this->actionDelay == 0) { this->action = 4; this->actionDelay = 0x78; - this->nonPlanarMovement = 0x1c0; + this->speed = 0x1c0; } } @@ -166,7 +167,7 @@ void sub_0802B8E0(Entity* this) { } else { this->action = 8; this->field_0x20 = 0x10000; - this->nonPlanarMovement = 0x60; + this->speed = 0x60; this->damageType = 99; InitializeAnimation(this, this->animationState); EnqueueSFX(299); diff --git a/src/enemy/spinyChuchu.c b/src/enemy/spinyChuchu.c index 873962c9..21396115 100644 --- a/src/enemy/spinyChuchu.c +++ b/src/enemy/spinyChuchu.c @@ -1,5 +1,6 @@ #include "enemy.h" #include "entity.h" +#include "random.h" #include "functions.h" extern void sub_08001318(Entity*); @@ -117,11 +118,11 @@ void sub_080225EC(Entity* this) { } void sub_08022654(Entity* this) { - switch (this->previousActionFlag) { + switch (this->subAction) { case 0: if (--this->field_0xf) return; - this->previousActionFlag = 1; + this->subAction = 1; SoundReq(0x12d); InitializeAnimation(this, 0); /* fallthrough */ @@ -129,7 +130,7 @@ void sub_08022654(Entity* this) { if (sub_08003FC4(this, 0x1800)) return; - this->previousActionFlag = 2; + this->subAction = 2; this->spriteSettings.b.draw = 1; InitializeAnimation(this, 5); EnqueueSFX(0x7d); @@ -158,7 +159,7 @@ void sub_080226EC(Entity* this) { if (sub_080228F0(this)) { this->action = 6; this->field_0x20 = 0x12000; - this->nonPlanarMovement = 0x140; + this->speed = 0x140; this->direction = GetFacingDirection(this, gUnk_020000B0); this->damageType = 0x5a; InitializeAnimation(this, 4); @@ -209,7 +210,7 @@ void sub_0802281C(Entity* this) { GetNextFrame(this); if (this->frames.all & 0x80) { this->action = 2; - this->nonPlanarMovement = 0x20; + this->speed = 0x20; InitializeAnimation(this, 0); sub_0804AA1C(this); } @@ -232,7 +233,7 @@ void sub_0802289C(Entity* this) { GetNextFrame(this); if (this->frames.all & 0x80) { this->action = 2; - this->nonPlanarMovement = 0x20; + this->speed = 0x20; this->field_0x80.HALF.HI = 0x78; InitializeAnimation(this, 0); } diff --git a/src/enemy/tektite.c b/src/enemy/tektite.c index 66d2ca82..ab5da752 100644 --- a/src/enemy/tektite.c +++ b/src/enemy/tektite.c @@ -1,6 +1,7 @@ #include "global.h" #include "entity.h" #include "enemy.h" +#include "random.h" #include "functions.h" extern void (*const gUnk_080CDED0[])(Entity*); @@ -29,7 +30,7 @@ void sub_0802F150(Entity* this) { switch (this->bitfield & 0x3f) { case 0x14: this->action = 1; - this->previousActionFlag = 0; + this->subAction = 0; if (this->type != 0) { this->actionDelay = 0xc0; } else { @@ -62,15 +63,13 @@ void sub_0802F1F0(Entity* this) { } } -extern u8 gUnk_080CDEF8[]; - void sub_0802F210(Entity* this) { u32 temp; u32 temp2; sub_0804A720(this); this->action = 1; - this->previousActionFlag = 0; + this->subAction = 0; this->actionDelay = gUnk_080CDEF8[Random() & 3]; this->actionDelay = (Random() & 0x1f) + this->actionDelay; this->field_0xf = 0; @@ -106,8 +105,6 @@ void sub_0802F284(Entity* this) { } } -extern u8 gUnk_080CDEF8[]; - void sub_0802F300(Entity* this) { s32 temp; u32 rand; @@ -119,7 +116,7 @@ void sub_0802F300(Entity* this) { if (sub_080044EC(this, this->field_0x80.HWORD) == 1) { this->action = 3; - this->previousActionFlag = 0; + this->subAction = 0; if (this->type != 0) { rand = 0; } @@ -146,9 +143,9 @@ void sub_0802F300(Entity* this) { } } - if ((this->previousActionFlag == 0) && (temp < this->height.HALF.HI)) { + if ((this->subAction == 0) && (temp < this->height.HALF.HI)) { InitializeAnimation(this, 4); - this->previousActionFlag = 1; + this->subAction = 1; } if (temp < -0xc) { diff --git a/src/enemy/tektiteGolden.c b/src/enemy/tektiteGolden.c index 3bf14e34..2567c463 100644 --- a/src/enemy/tektiteGolden.c +++ b/src/enemy/tektiteGolden.c @@ -1,8 +1,9 @@ #include "global.h" #include "entity.h" #include "enemy.h" -#include "functions.h" #include "flags.h" +#include "random.h" +#include "functions.h" extern void sub_08038168(Entity*); @@ -27,7 +28,7 @@ void sub_08037F00(Entity* this) { sub_0804AA30(this, &gUnk_080CF4A0); if (this->bitfield == 0x94) { this->action = 1; - this->previousActionFlag = 0; + this->subAction = 0; this->actionDelay = 0x14; this->field_0xf = 0; this->field_0x80.HALF.LO = 0; @@ -69,7 +70,7 @@ void sub_08037FA0(Entity* this) { } sub_0804A720(this); this->action = 1; - this->previousActionFlag = 0; + this->subAction = 0; this->actionDelay = (Random() & 0x1f) + 0x20; this->field_0xf = 0; this->field_0x80.HALF.LO = 0; @@ -106,7 +107,7 @@ void sub_08038048(Entity* this) { if (sub_080044EC(this, 0x3000) == 1) { this->action = 3; - this->previousActionFlag = 0; + this->subAction = 0; this->actionDelay = 0x14; InitializeAnimation(this, 3); return; @@ -121,9 +122,9 @@ void sub_08038048(Entity* this) { sub_08038168(this); } - if ((this->previousActionFlag == 0) && (temp < this->height.HALF.HI)) { + if ((this->subAction == 0) && (temp < this->height.HALF.HI)) { InitializeAnimation(this, 4); - this->previousActionFlag = 1; + this->subAction = 1; } if (temp < -0xc) { diff --git a/src/enemy/vaatiBall.c b/src/enemy/vaatiBall.c index 02bf4e39..3907e270 100644 --- a/src/enemy/vaatiBall.c +++ b/src/enemy/vaatiBall.c @@ -1,7 +1,8 @@ #include "entity.h" #include "player.h" -#include "functions.h" #include "screen.h" +#include "createObject.h" +#include "functions.h" typedef struct { s8 h, v; @@ -136,8 +137,6 @@ void sub_080447E0(Entity* this) { } } -extern u32 sub_080045B4(); -extern u32 sub_0806FCB8(Entity*, u32, u32, u32); extern void sub_08044DEC(); void sub_08044868(Entity* this) { @@ -155,7 +154,7 @@ void sub_08044868(Entity* this) { if (this->frames.all & 0x80) { this->field_0x74.HALF.LO = 1; this->direction = sub_080045B4(this, vaati->x.HALF.HI, vaati->y.HALF.HI - 0x10); - this->nonPlanarMovement = 0x180; + this->speed = 0x180; } break; case 1: @@ -230,7 +229,7 @@ void sub_080449F8(Entity* this) { if (this->field_0x78.HALF.LO == 0) { this->field_0x78.HALF.LO++; - this->nonPlanarMovement = 640; + this->speed = 640; } this->actionDelay = 4; @@ -321,7 +320,7 @@ void sub_08044B04(Entity* this) { this->field_0xf = 32; } - this->nonPlanarMovement = this->field_0x78.HALF.LO ? 640 : 1280; + this->speed = this->field_0x78.HALF.LO ? 640 : 1280; } } break; @@ -331,7 +330,7 @@ void sub_08044B04(Entity* this) { this->direction = (this->direction + 1) & 0x1f; if (++this->field_0xf == 0x30) { u32 direction = sub_080045B4(this, vaati->x.HALF.HI, vaati->y.HALF.HI - 0x10); - this->nonPlanarMovement = 0; + this->speed = 0; this->direction = (direction + 16) & 0x1f; this->actionDelay = 16; this->field_0xf = 16; @@ -343,32 +342,32 @@ void sub_08044B04(Entity* this) { if (this->field_0xf == 0) { switch (--this->actionDelay) { case 12: - this->nonPlanarMovement = 1280; + this->speed = 1280; break; case 0: this->field_0x74.HALF.LO++; this->direction = sub_080045B4(this, vaati->x.HALF.HI, vaati->y.HALF.HI - 0x10); - this->nonPlanarMovement = 0; + this->speed = 0; this->actionDelay = 4; this->field_0xf = 16; break; case 4: - this->nonPlanarMovement = 640; + this->speed = 640; break; } } else { if (--this->field_0xf == 0) - this->nonPlanarMovement = 640; + this->speed = 640; } break; case 3: if (this->field_0xf) { if (--this->field_0xf == 0) - this->nonPlanarMovement = 640; + this->speed = 640; } else { if (this->actionDelay) { if (--this->actionDelay == 0) { - this->nonPlanarMovement = 1280; + this->speed = 1280; SoundReq(0x14f); } } @@ -450,7 +449,7 @@ void sub_08044DEC(Entity* this) { } this->flags &= 0x7f; this->field_0x78.HALF.LO = 0; - this->nonPlanarMovement = 0x300; + this->speed = 0x300; off = this->parent->field_0x80.HALF.LO - 1; this->direction = gUnk_080D1628[off][this->field_0x78.HALF.HI]; PositionRelative(this->parent, this, 0, -0x100000); @@ -466,11 +465,11 @@ void sub_08044E74(Entity* this, u32 state) { this->direction += 0x18; this->direction &= 0x1f; PositionRelative(this->parent, this, 0, -0x100000); - this->nonPlanarMovement = 12288; + this->speed = 12288; sub_0806F69C(this); this->direction += 0x8; this->direction &= 0x1f; - this->nonPlanarMovement = 1280; + this->speed = 1280; sub_0806F69C(this); break; case 1: @@ -499,5 +498,5 @@ void sub_08044E74(Entity* this, u32 state) { } this->actionDelay = 1; this->field_0x78.HALF.LO = 0; - this->nonPlanarMovement = 1280; + this->speed = 1280; } diff --git a/src/enemy/wallMaster.c b/src/enemy/wallMaster.c index 1ba24a96..394e8620 100644 --- a/src/enemy/wallMaster.c +++ b/src/enemy/wallMaster.c @@ -1,7 +1,8 @@ #include "enemy.h" #include "entity.h" -#include "functions.h" #include "area.h" +#include "random.h" +#include "functions.h" extern void sub_08001328(Entity*); extern Entity* sub_08049DF4(u32); diff --git a/src/enemy/wallMaster2.c b/src/enemy/wallMaster2.c index a788ad58..f6d32479 100644 --- a/src/enemy/wallMaster2.c +++ b/src/enemy/wallMaster2.c @@ -1,9 +1,9 @@ #include "enemy.h" -#include "functions.h" #include "area.h" +#include "random.h" +#include "functions.h" extern void sub_08001328(Entity*); -extern u32 sub_0806FCB8(Entity*, u32, u32, u32); extern void DoExitTransition(u32*); extern Entity* gUnk_020000B0; @@ -83,7 +83,7 @@ void sub_0802CD54(Entity* this) { this->action = 2; tmp = Random() >> 0x10; this->actionDelay = tmp; - this->nonPlanarMovement = 0xc0; + this->speed = 0xc0; this->field_0x78.HWORD = gUnk_080CD728[Random() & 3]; this->field_0x7a.HALF.HI = (tmp >> 8) & 0x60; return; @@ -107,7 +107,7 @@ void sub_0802CDE8(Entity* this) { } else { this->action = 1; this->actionDelay = 60; - this->nonPlanarMovement = 0x60; + this->speed = 0x60; this->field_0x7c.HALF.LO = (Random() & 0x38) + 0x96; } GetNextFrame(this); diff --git a/src/enemy/waterDrop.c b/src/enemy/waterDrop.c index 87b80940..f994b564 100644 --- a/src/enemy/waterDrop.c +++ b/src/enemy/waterDrop.c @@ -1,7 +1,8 @@ #include "enemy.h" #include "entity.h" -#include "functions.h" #include "screen.h" +#include "random.h" +#include "functions.h" void sub_0802A39C(Entity*); void sub_0802A334(Entity*); @@ -22,7 +23,7 @@ void sub_0802A250(Entity* this) { this->action = 1; this->actionDelay = 0; this->field_0x20 = -0x30000; - this->nonPlanarMovement = gUnk_080CD03C[Random() & 3]; + this->speed = gUnk_080CD03C[Random() & 3]; this->direction = gUnk_080CD040[Random() & 3] + 0x18; this->collisionLayer = 2; InitializeAnimation(this, 0); diff --git a/src/enemy/wisp.c b/src/enemy/wisp.c index 10463258..247cf0a0 100644 --- a/src/enemy/wisp.c +++ b/src/enemy/wisp.c @@ -1,10 +1,11 @@ #include "global.h" #include "entity.h" #include "enemy.h" -#include "structures.h" #include "player.h" -#include "functions.h" #include "save.h" +#include "random.h" +#include "createObject.h" +#include "functions.h" extern void (*const gUnk_080CEB74[])(Entity*); extern void (*const gUnk_080CEB8C[])(Entity*); @@ -49,7 +50,7 @@ void sub_08033564(Entity* this) { break; case 0x14: this->flags &= 0x7f; - this->hurtBlinkTime = 0; + this->iframes = 0; this->spriteSettings.b.draw = FALSE; ent = CreateFx(this, 2, 0); if (ent != NULL) { @@ -64,12 +65,12 @@ void sub_08033564(Entity* this) { void sub_0803362C(Entity* this) { if (sub_0806F520() != 0) { - gUnk_080CEB98[this->previousActionFlag](this); + gUnk_080CEB98[this->subAction](this); } } void sub_08033650(Entity* this) { - this->previousActionFlag = 2; + this->subAction = 2; } void sub_08033658(Entity* this) { diff --git a/src/entity.c b/src/entity.c index cb81ae21..acc2795c 100644 --- a/src/entity.c +++ b/src/entity.c @@ -1,5 +1,8 @@ #include "global.h" +#include "area.h" #include "entity.h" +#include "utils.h" +#include "script.h" typedef struct OtherEntity { struct OtherEntity* prev; @@ -22,14 +25,13 @@ Entity* sub_0805E744(void) { return NULL; } -extern Entity* GetEmptyEntity(); -OtherEntity* GetEmptyManager(); +OtherEntity* GetEmptyManager(void); typedef void* (*Getter)(void); -void* GetEmptyEntityByType(int type) { +void* GetEmptyEntityByKind(u32 kind) { Getter getter = NULL; - if (type == 9) { + if (kind == MANAGER) { getter = (Getter)GetEmptyManager; } else { getter = (Getter)GetEmptyEntity; @@ -47,21 +49,20 @@ typedef struct { extern struct_03003DD0 gUnk_03003DD0; extern u32 _call_via_r0(u32*); extern u32 _EntUpdate; -extern void DeleteEntityAny(Entity*); +void DeleteEntityAny(Entity*); void DeleteThisEntity(void) { DeleteEntityAny(gUnk_03003DD0.field_0x8); _call_via_r0((u32*)&_EntUpdate); } -void DeleteEntity(Entity*); void DeleteManager(OtherEntity*); typedef void (*Deleter)(void*); void DeleteEntityAny(Entity* ent) { Deleter deleter = NULL; - if (ent->kind == 9) { + if (ent->kind == MANAGER) { deleter = (Deleter)DeleteManager; } else { deleter = (Deleter)DeleteEntity; @@ -77,11 +78,9 @@ extern void sub_08078954(); extern void sub_0805EC60(); extern void sub_08017744(); extern void sub_0805E92C(); -extern void UnloadCutsceneData(); extern void UnloadHitbox(); -extern void sub_0801DA0C(); extern void sub_0804AA1C(); -extern void UnlinkEntity(); // Unlink +void UnlinkEntity(); void DeleteEntity(Entity* ent) { if (ent->next) { @@ -95,9 +94,9 @@ void DeleteEntity(Entity* ent) { sub_0805E92C(ent); UnloadCutsceneData(ent); UnloadHitbox(ent); - sub_0801DA0C(ent->myHeap); + zFree(ent->myHeap); ent->myHeap = NULL; - if (ent->kind == 3) { + if (ent->kind == ENEMY) { sub_0804AA1C(ent); } ent->flags = ent->flags & 0x7f; @@ -122,7 +121,6 @@ void ClearAllDeletedEntities(void) { ClearDeletedEntity(ent); } } while (ent++, ent < (&gPlayerEntity + 80)); - return; } extern u8 gEntCount; @@ -161,7 +159,6 @@ OtherEntity* GetEmptyManager(void) { return NULL; } -extern void MemClear32(void*, u32); extern u8 gManagerCount; void DeleteManager(OtherEntity* ent) { @@ -170,12 +167,10 @@ void DeleteManager(OtherEntity* ent) { sub_0805E92C(ent); UnlinkEntity(ent); - MemClear32(ent, sizeof(OtherEntity)); + MemClear(ent, sizeof(OtherEntity)); gManagerCount--; } -#include "area.h" - void sub_0805E92C(u32 param_1) { if (param_1 == gArea.unk2) { gArea.unk2 = 0; @@ -185,8 +180,7 @@ void sub_0805E92C(u32 param_1) { } extern Entity gUnk_020369F0; -extern void MemCopy(const void* src, void* dest, size_t size); // dma copy -extern void sub_0805E98C(void); +void sub_0805E98C(void); void sub_0805E958(void) { MemCopy(&gEntityLists, &gUnk_020369F0, 0x48); @@ -213,7 +207,7 @@ void sub_0805E9A8(void) { list = &gEntityLists[0]; do { for (i = list->first; (u32)i != (u32)list; i = i->next) { - i->flags &= 0xfd; + i->flags &= ~2; if ((i->flags & 0x20) == 0) { i->flags |= 0x10; } @@ -238,32 +232,32 @@ void sub_0805E9F4(void) { extern void sub_0805E374(Entity*); -void AppendEntityToList(Entity* ent, int listIndex) { +void AppendEntityToList(Entity* entity, u32 listIndex) { LinkedList* list; list = &gEntityLists[listIndex]; - ent->next = (Entity*)list; - ent->prev = list->last; - list->last->next = ent; - list->last = ent; - if (ent->kind != 9) { - ent->spritePriority.b0 = 4; + entity->next = (Entity*)list; + entity->prev = list->last; + list->last->next = entity; + list->last = entity; + if (entity->kind != MANAGER) { + entity->spritePriority.b0 = 4; gEntCount++; } else { gManagerCount++; } - sub_0805E374(ent); + sub_0805E374(entity); } -void PrependEntityToList(Entity* ent, int listIndex) { +void PrependEntityToList(Entity* entity, u32 listIndex) { LinkedList* list; - UnlinkEntity(ent); + UnlinkEntity(entity); list = &gEntityLists[listIndex]; - ent->prev = (Entity*)list; - ent->next = list->first; - list->first->prev = ent; - list->first = ent; + entity->prev = (Entity*)list; + entity->next = list->first; + list->first->prev = entity; + list->first = entity; } void UnlinkEntity(Entity* ent) { @@ -274,7 +268,7 @@ void UnlinkEntity(Entity* ent) { ent->next->prev = ent->prev; } -bool32 DoesSimilarEntityExist(Entity* ent) { +bool32 EntityHasDuplicateID(Entity* ent) { Entity* i; LinkedList* list; @@ -290,31 +284,31 @@ bool32 DoesSimilarEntityExist(Entity* ent) { return FALSE; } -Entity* FindEntityInListBySubtype(int type, int subtype, int listIndex) { +Entity* FindEntityByID(u32 kind, u32 id, u32 listIndex) { Entity* it; LinkedList* list; list = &gEntityLists[listIndex]; for (it = list->first; (u32)it != (u32)list; it = it->next) { - if (type == it->kind && subtype == it->id) + if (kind == it->kind && id == it->id) return it; } return NULL; } -Entity* FindEntityInListByForm(int type, int subtype, int listIndex, int form, int parameter) { +Entity* FindEntity(u32 kind, u32 id, u32 listIndex, u32 type, u32 type2) { Entity* i; LinkedList* list; list = &gEntityLists[listIndex]; for (i = list->first; (u32)i != (u32)list; i = i->next) { - if (type == i->kind && subtype == i->id && form == i->type && parameter == i->type2) + if (kind == i->kind && id == i->id && type == i->type && type2 == i->type2) return i; } return NULL; } -Entity* FindNextEntityOfSameSubtype(Entity* ent, int listIndex) { +Entity* FindNextDuplicateID(Entity* ent, int listIndex) { Entity* i; LinkedList* list; @@ -326,14 +320,14 @@ Entity* FindNextEntityOfSameSubtype(Entity* ent, int listIndex) { return NULL; } -Entity* FindEntityBySubtype(int type, int subtype) { +Entity* DeepFindEntityByID(u32 kind, u32 id) { Entity* i; LinkedList* list; list = &gEntityLists[0]; do { for (i = (Entity*)list->first; (u32)i != (u32)list; i = i->next) { - if (type == i->kind && (subtype == i->id)) + if (kind == i->kind && (id == i->id)) return i; } } while (++list < &gEntityLists[9]); @@ -350,7 +344,7 @@ void DeleteAllEnemies(void) { do { for (ent = list->first; (u32)ent != (u32)list; ent = next) { next = ent->next; - if (ent->kind == 3) + if (ent->kind == ENEMY) DeleteEntity(ent); } } while (++list < &gEntityLists[9]); diff --git a/src/ezloCap.c b/src/ezloCap.c deleted file mode 100644 index 4272564f..00000000 --- a/src/ezloCap.c +++ /dev/null @@ -1,278 +0,0 @@ -#include "audio.h" -#include "global.h" -#include "entity.h" -#include "functions.h" -#include "flags.h" -#include "save.h" -#include "script.h" - -extern Hitbox gUnk_080FD170; - -extern u16* gUnk_08114144; - -extern u32 gUnk_081141A4[]; -extern u8 gUnk_081141E4[]; - -extern Hitbox gUnk_08114154; -extern void gUnk_08016030; // Cutscene data type? -extern void gUnk_0801606C; // Cutscene data type? - -extern void gUnk_081141F4; // tiles that are changed? - -extern void sub_0809623C(Entity*); -extern void sub_08096260(Entity*); - -void EzloCap(Entity* this) { - if (this->action == 0) { - this->action += 1; - sub_0805E3A0(this, 2); - sub_0807DD50(this); - } - sub_0807DDAC(this, 0); - sub_0807DDE4(this); - UpdateAnimationSingleFrame(this); -} - -NONMATCH("asm/non_matching/ezloCap/sub_0806D8A0.inc", void sub_0806D8A0(Entity* this, u32 param_2)) { -} -END_NONMATCH - -NONMATCH("asm/non_matching/ezloCap/sub_0806D908.inc", void sub_0806D908(Entity* this)) { -} -END_NONMATCH - -void sub_0806D944(Entity* this) { - this->spriteSettings.b.flipX = 0; - if (this->x.WORD <= gPlayerEntity.x.WORD) { - this->spriteSettings.b.flipX = 1; - } -} - -void sub_0806D96C(Entity* this) { - Entity* fx = CreateFx(this, 0x42, 0); - if (fx != NULL) { - fx->spritePriority.b0 = 1; - PositionRelative(this, fx, 0, 0xFFE80000); - } -} - -void sub_0806D9A4(Entity* this) { - if (this->x.WORD <= gPlayerEntity.x.WORD) { - gPlayerEntity.spriteSettings.b.flipX = 0; - } else { - gPlayerEntity.spriteSettings.b.flipX = 1; - } - gPlayerEntity.animationState = 4; -} - -void NPC4E(Entity* this) { - if (this->action == 0) { - this->action = 1; - this->spriteSettings.b.draw = 4; - this->hitbox = &gUnk_080FD170; - sub_0807DD50(this); - } else { - sub_0807DD94(this, 0); - } -} - -NONMATCH("asm/non_matching/ezloCap/sub_0806DA04.inc", void sub_0806DA04(Entity* this, u32 param_2)) { - u8 direction = - sub_080045D4(this->x.HALF.HI, this->y.HALF.HI, (int)gPlayerEntity.x.HALF.HI, (int)gPlayerEntity.y.HALF.HI); - this->direction = direction; - - this->animationState = - (this->animationState & 0x80) | - gUnk_08114144[(((direction) << 0x18) >> 0x19)]; // somehow the cast from u8 to u32 of direction is an issue here -} -END_NONMATCH - -void sub_0806DA1C(Entity* this, u32* param_2) { - sub_0808091C((ScreenTransitionData*)(gUnk_081141A4)[param_2[1]], (u32)(gUnk_081141E4[param_2[1]])); -} - -// Returns the kingstone id? -u8 sub_0806DA3C(Entity* this) { - u32 result; - - switch (this->type) { - default: - result = 0; - break; - case 1: - result = 1; - break; - case 2: - result = 2; - break; - case 3: - result = 3; - break; - case 4: - result = 4; - break; - case 5: - result = 5; - break; - case 11: - result = 9; - break; - case 6: - case 7: - case 8: - case 9: - case 10: - result = sub_0801E99C(this); - break; - } - return result; -} - -// Check whether a kingstone fusion is possible and store the result somewhere in param_2? -void sub_0806DAAC(Entity* this, u32 param_2) { - u32 uVar1; - uVar1 = CheckKinstoneFused(sub_0806DA3C(this)); - *(u32*)(param_2 + 0x14) = uVar1; - gUnk_02033280.unk_07 |= 1; -} - -// maybe actually execute the keystone fusion? -void sub_0806DAD0(Entity* this) { - sub_08078790(this, sub_0806DA3C(this)); -} - -void sub_0806DAE8(Entity* this) { - switch (this->type - 1) { - case 0: - SetLocalFlag(0xee); - break; - case 1: - SetLocalFlag(0xef); - break; - case 2: - SetLocalFlag(0xf0); - break; - case 3: - SetLocalFlag(0xf1); - break; - case 4: - SetLocalFlag(0xf2); - break; - } - - SoundReq(SFX_TASK_COMPLETE); -} - -// Unknown param_2 struct -void sub_0806DB44(Entity* this, u32* param_2) { - param_2[5] = 0; - - if (CheckLocalFlag(0xee) != 0 && CheckLocalFlag(0xef) != 0 && CheckLocalFlag(0xf0) != 0 && - CheckLocalFlag(0xf1) != 0 && CheckLocalFlag(0xf2) != 0) { - param_2[5] = 1; - } -} - -void sub_0806DB84( - Entity* this, - u8 unused) { // The unused param just had to be added, so that a mov r1, #0 in NPC4E_Fusion is matching correctly - Entity* ent; - this->hitbox = &gUnk_08114154; - ent = CreateObject(0x3e, 4, 0); - if (ent != NULL) { - PositionRelative(this, ent, -0x80000, 0); - *(ScriptExecutionContext**)&ent->cutsceneBeh = StartCutscene(ent, &gUnk_08016030); - } - ent = CreateObject(0x3e, 5, 0); - if (ent != NULL) { - PositionRelative(this, ent, 0x80000, 0); - *(ScriptExecutionContext**)&ent->cutsceneBeh = StartCutscene(ent, &gUnk_0801606C); - } -} - -u32 sub_0806DBF4(u32 param_1) { - switch (param_1) { - case 1: - case 2: - case 3: - case 4: - case 6: - param_1 = 1; - if (GetInventoryValue(2) != 0) { - param_1 = 2; - } - if (GetInventoryValue(3) != 0) { - param_1 = 3; - } - if (GetInventoryValue(4) != 0) { - param_1 = 4; - } - if (GetInventoryValue(6) != 0) { - param_1 = 6; - } - break; - } - return param_1; -} - -void sub_0806DC3C(Entity* this) { - this->field_0x68.HALF.LO = gSave.stats.itemOnA; - this->field_0x68.HALF.HI = gSave.stats.itemOnB; -} - -void sub_0806DC58(Entity* this) { - ForceEquipItem(sub_0806DBF4(this->field_0x68.HALF.LO), 0); - ForceEquipItem(sub_0806DBF4(this->field_0x68.HALF.HI), 1); -} - -void sub_0806DC7C() { - u16* tiles = &gUnk_081141F4; - while (*tiles != 0) { - u32 tile = (u32)*tiles; - tiles = tiles + 1; - SetTileType(0x4072, tile, 1); - } -} - -void sub_0806DCA0() { - u16 uVar1; - u16* tiles; - - tiles = &gUnk_081141F4; - while (*tiles != 0) { - u16 tile = *tiles; - tiles = tiles + 1; - sub_0807BA8C((u32)tile, 1); - } -} - -void sub_0806DCC0() { - gScreenTransition.field_0x20 = 0x7c8; - gScreenTransition.field_0x22 = 0xf8; -} - -void NPC4E_Fusion(Entity* this) { - if (this->action == 0) { - this->action += 1; - switch (this->type) { - case 1: - case 2: - case 3: - case 4: - case 5: - sub_0809623C(this); - break; - case 6: - case 7: - case 8: - case 9: - case 10: - sub_08096260(this); - break; - case 11: - sub_0806DB84(this, 0); - this->hitbox = NULL; - break; - } - } -} diff --git a/src/ezloNag.c b/src/ezloNag.c index 51628171..0ad98db7 100644 --- a/src/ezloNag.c +++ b/src/ezloNag.c @@ -1,6 +1,5 @@ #include "audio.h" #include "global.h" -#include "entity.h" #include "functions.h" #include "textbox.h" #include "structures.h" diff --git a/src/sub_08050024.c b/src/fade.c similarity index 96% rename from src/sub_08050024.c rename to src/fade.c index b6915ab9..fe77e3d0 100644 --- a/src/sub_08050024.c +++ b/src/fade.c @@ -12,13 +12,9 @@ extern struct_03000000 gUnk_03000000; extern u32 gUsedPalettes; -extern void sub_0801E104(); -extern void DoFade(u32, u32); - void sub_08050024() { sub_0801E104(); DoFade(5, 0x80 << 1); - return; } void sub_08050038(u32 arg0) { diff --git a/src/fileScreen.c b/src/fileScreen.c index 85fe12ba..b55977ca 100644 --- a/src/fileScreen.c +++ b/src/fileScreen.c @@ -1,4 +1,11 @@ #include "fileScreen.h" +#include "main.h" +#include "player.h" +#include "utils.h" +#include "screen.h" +#include "menu.h" +#include "random.h" +#include "textbox.h" // copy, erase, start #define NUM_FILE_OPERATIONS 3 @@ -105,7 +112,7 @@ void CreateDialogBox(u32 arg0, u32 arg1) { void sub_08050384(void) { sub_0801C4A0(0, 0); - MemClear32(&gBG0Buffer, sizeof(gBG0Buffer)); + MemClear(&gBG0Buffer, sizeof(gBG0Buffer)); gScreen.bg.bg0Updated = 1; } @@ -117,8 +124,8 @@ void sub_080503A8(u32 gfxGroup) { void SetFileSelectState(FileSelectState mode) { gUnk_02032EC0.state = mode; - MemClear32(&gBG0Buffer, sizeof(gBG0Buffer)); - MemClear32(&gBG1Buffer, sizeof(gBG1Buffer)); + MemClear(&gBG0Buffer, sizeof(gBG0Buffer)); + MemClear(&gBG1Buffer, sizeof(gBG1Buffer)); } void LoadOptionsFromSave(u32 idx) { @@ -159,7 +166,7 @@ void HandleChooseFileScreen(void) { gScreen.bg.bg1yOffset = 0; gScreen.affine.bg2xOffset = 0; gScreen.affine.bg2yOffset = 0; - MemClear32(&gChooseFileState, sizeof(gChooseFileState)); + MemClear(&gChooseFileState, sizeof(gChooseFileState)); } HideButtonR(); @@ -182,19 +189,19 @@ void HandleChooseFileScreen(void) { static void HandleFileScreenEnter(void) { u32 i; - sub_0801DA90(1); + DispReset(1); sub_080A3210(); - MemClear32((void*)VRAM, 0x80); // clear palettes + MemClear((void*)VRAM, 0x80); // clear palettes MessageInitialize(); EraseAllEntities(); sub_08080668(); sub_080ADD30(); sub_0801CFA8(0); - MemClear32(&gUnk_0200AF00, sizeof(gUnk_0200AF00)); - MemClear32(&gUnk_02019EE0, sizeof(gUnk_02019EE0)); + MemClear(&gUnk_0200AF00, sizeof(gUnk_0200AF00)); + MemClear(&gUnk_02019EE0, sizeof(gUnk_02019EE0)); gUnk_02019EE0.unk3 = 7; gUnk_02019EE0.unk6 = gUnk_02000000->gameLanguage > LANGUAGE_EN ? 3 : 0; - MemClear32(&gUnk_02032EC0, sizeof(gUnk_02032EC0)); + MemClear(&gUnk_02032EC0, sizeof(gUnk_02032EC0)); gUnk_02032EC0.lastState = 8; SetFileSelectState(STATE_NONE); InitDMA(); @@ -231,10 +238,10 @@ static void HandleFileScreenExit(void) { static void sub_08050624(u32 idx) { SaveFile* saveFile = &gUnk_02019EE0.saves[idx]; - int status = sub_0807CF28(idx, saveFile); + int status = ReadSaveFile(idx, saveFile); switch (status) { case SAVE_DELETED: - sub_0807CF48(idx); + SetFileStatusDeleted(idx); // fallthrough case SAVE_EMPTY: sub_0805194C(idx); @@ -284,7 +291,7 @@ void sub_0805070C(void) { var0->unk8 = gUnk_02000D00; for (i = 0; i < NUM_SAVE_SLOTS; i++) { var0->unk6 = 0; - MemClear32(var0->unk8, 0x200); + MemClear(var0->unk8, 0x200); playerName = &gUnk_02019EE0.saves[i].playerName[0]; for (j = 0; j < FILENAME_LENGTH; j++) { sub_0805F7DC(playerName[j], var0); @@ -489,7 +496,7 @@ void sub_08050B3C(u16*); void sub_08050AFC(u32 idx) { SetActiveSave(idx); - MemClear32(&gBG1Buffer, sizeof(gBG1Buffer)); + MemClear(&gBG1Buffer, sizeof(gBG1Buffer)); if (gUnk_02019EE0.saveStatus[idx] == SAVE_VALID) { sub_08050B3C(&gBG1Buffer.unk29C); } @@ -645,7 +652,7 @@ void HandleFileLanguageSelect(void) { } void sub_08050DB8(void) { - MemClear32(&gBG2Buffer, sizeof(gBG2Buffer)); + MemClear(&gBG2Buffer, sizeof(gBG2Buffer)); sub_080503A8(0xc); gMenu.field_0x4 = gUnk_02000000->gameLanguage; sub_080A7114(1); @@ -697,7 +704,7 @@ void sub_08050DE4(void) { } void sub_08050E88(void) { - if (sub_0807CDA4(2)) + if (HandleSave(2)) SetFileSelectState(0); } @@ -792,7 +799,7 @@ NONMATCH("asm/non_matching/fileScreen/sub_08050EF4.inc", void sub_08050EF4(void) END_NONMATCH void sub_08050FFC(void) { - switch (sub_0807CDA4(0)) { + switch (HandleSave(0)) { case SAVE_ERROR: gMenu.transitionTimer = 0x1e; sub_0805194C(gUnk_02019EE0.unk6); @@ -856,7 +863,7 @@ void sub_080513A8(void) { } void sub_080513C0(void) { - switch (sub_0807CDA4(0)) { + switch (HandleSave(0)) { case 1: gUnk_02019EE0.saveStatus[gUnk_02019EE0.unk6] = 1; sub_080A7114(3); @@ -978,7 +985,6 @@ u32 sub_080514BC(u32 a1) { switch (a1) { default: case 0x0: - return c - 0x33; case 0xe: return c - 0x33; case 0xf: @@ -1043,7 +1049,7 @@ void sub_080515D4(void) { } void sub_080516E0(void) { - if (sub_0807CDA4(1)) { + if (HandleSave(1)) { sub_0805194C(gUnk_02019EE0.unk6); sub_08050AFC(gUnk_02019EE0.unk6); gMenu.transitionTimer = 2; @@ -1139,7 +1145,7 @@ void sub_080517EC(void) { void sub_08051874(void) { s32 temp; gUnk_02000000->saveFileId = gUnk_02019EE0.unk7; - temp = sub_0807CDA4(0); + temp = HandleSave(0); gUnk_02019EE0.saveStatus[gUnk_02019EE0.unk7] = temp; switch (temp) { case 1: @@ -1183,7 +1189,7 @@ void sub_0805194C(u32 save_idx) { gUnk_02019EE0.saveStatus[save_idx] = 0; save = &gUnk_02019EE0.saves[save_idx]; - MemClear32(save, sizeof(*save)); + MemClear(save, sizeof(*save)); save->messageSpeed = 1; save->brightnessPref = 1; save->stats.health = 24; diff --git a/src/flags.c b/src/flags.c index 6f1d5d56..2129ae01 100644 --- a/src/flags.c +++ b/src/flags.c @@ -2,7 +2,6 @@ #include "room.h" #include "flags.h" #include "area.h" -#include "room.h" extern u32 ReadBit(u32*, u32); extern u32 CheckBits(u32*, u32, u32); diff --git a/src/game.c b/src/game.c index b7a1f757..91940328 100644 --- a/src/game.c +++ b/src/game.c @@ -1,7 +1,6 @@ #include "global.h" #include "screen.h" #include "structures.h" -#include "functions.h" #include "screen.h" #include "entity.h" #include "player.h" @@ -9,11 +8,12 @@ #include "main.h" #include "flags.h" #include "save.h" +#include "utils.h" #include "fileScreen.h" +#include "functions.h" extern u8 gArea; extern Entity gPlayerEntity; -extern u32 gUnk_03000B80; extern u32 gUnk_03003FC0; extern u16 gWalletSizes[4]; @@ -118,7 +118,7 @@ void sub_080521A0(void) { gMenu.transitionTimer--; break; case 2: - temp3 = sub_0807CDA4(0); + temp3 = HandleSave(0); gMenu.field_0x0 = temp3; switch (temp3) { case 1: @@ -219,7 +219,7 @@ NONMATCH("asm/non_matching/game/sub_08052418.inc", void sub_08052418(int param_1 int i; struct_080FCA8C temp; - MemClear32(&gBG1Buffer, 0x800); + MemClear(&gBG1Buffer, 0x800); gUnk_020227E8._0[0].WORD = 0xf; gUnk_020227E8._0[2].WORD = 0xf; gUnk_020227E8._0[4].WORD = 0xf; @@ -238,12 +238,12 @@ void InitializePlayer(void) { Entity* pl; sub_080784C8(); - MemClear32((void*)&gUnk_03000B80, 0x70); - MemClear32((void*)&gPlayerState, 0xb0); + MemClear((void*)&gUnk_03000B80, sizeof(gUnk_03000B80)); + MemClear((void*)&gPlayerState, 0xb0); MemFill32(0xffffffff, &gPlayerState.field_0x40, 0x40); pl = &gPlayerEntity; - MemClear32((void*)pl, 0x88); + MemClear((void*)pl, 0x88); gRoomControls.cameraTarget = pl; gPlayerState.playerAction = gUnk_080FCAC8[gScreenTransition.field_0xf]; if (!CheckGlobalFlag(0x14)) { @@ -258,7 +258,7 @@ void InitializePlayer(void) { gPlayerState.field_0x34[4] = 0x10; pl->direction = gScreenTransition.playerState << 2; case 0x3: - pl->nonPlanarMovement = 0xe0; + pl->speed = 0xe0; break; case 0x7: case 0x8: @@ -299,7 +299,7 @@ u32 sub_08052654() { return (gArea >> 7) & 1; } -u32 CheckIsDungeon() { +u32 CheckIsDungeon(void) { return (gArea >> 2) & 1; } diff --git a/src/input.c b/src/input.c deleted file mode 100644 index c187d598..00000000 --- a/src/input.c +++ /dev/null @@ -1,28 +0,0 @@ -#include "global.h" -#include "entity.h" -#include "readKeyInput.h" - -static void StoreKeyInput(Input*, u32); - -void ReadKeyInput(void) { - u32 keyInput = ~REG_KEYINPUT & KEYS_MASK; - StoreKeyInput(&gInput, keyInput); -} - -static void StoreKeyInput(Input* input, u32 keyInput) { - u32 heldKeys = input->heldKeys; - u32 difference = keyInput & ~heldKeys; - input->newKeys = difference; - if (keyInput == heldKeys) { - if (--input->unk7 == 0) { - input->unk7 = 4; - input->unk4 = keyInput; - } else { - input->unk4 = 0; - } - } else { - input->unk7 = 0x14; - input->unk4 = difference; - } - input->heldKeys = keyInput; -} diff --git a/src/intro.c b/src/intro.c index 4480e983..e3ee0f9d 100644 --- a/src/intro.c +++ b/src/intro.c @@ -1,12 +1,12 @@ #include "audio.h" #include "global.h" -#include "menu.h" #include "main.h" #include "entity.h" #include "functions.h" -#include "readKeyInput.h" +#include "utils.h" #include "screen.h" #include "structures.h" +#include "textbox.h" typedef struct { u8 filler0[0x4]; @@ -56,7 +56,7 @@ static const u16 sLightRaysAlphaBlends[] = { static u32 AdvanceIntroSequence(u32 transition) { gUnk_02032EC0.lastState = transition; gMain.funcIndex = 2; - MemClear32(&gIntroState, sizeof(gIntroState)); + MemClear(&gIntroState, sizeof(gIntroState)); DoFade(7, 8); } @@ -65,7 +65,7 @@ void HandleIntroScreen(void) { switch (gMain.funcIndex) { case 0: MessageInitialize(); - MemClear32(&gUnk_02032EC0, sizeof(gUnk_02032EC0)); + MemClear(&gUnk_02032EC0, sizeof(gUnk_02032EC0)); AdvanceIntroSequence(0); break; case 1: @@ -75,7 +75,7 @@ void HandleIntroScreen(void) { if (gFadeControl.active) { return; } - sub_0801DA90(1); + DispReset(1); gMain.funcIndex = 1; break; } @@ -88,7 +88,7 @@ static void HandleNintendoCapcomLogos(void) { advance = GetAdvanceState(); if (gIntroState.state == 0) { - sub_0801DA90(1); + DispReset(1); gIntroState.state = 1; gIntroState.timer = 120; LoadGfxGroup(16); @@ -213,7 +213,6 @@ static void UpdatePressStartIcon(void) { gOamCmd.x = 120; gOamCmd.y = 152; sub_080ADA14(511, 1); - return; } static void UpdateSwordBgAffineData(void) { diff --git a/src/item.c b/src/item.c index ad7a419b..fa23bd31 100644 --- a/src/item.c +++ b/src/item.c @@ -1,6 +1,7 @@ #include "global.h" #include "entity.h" #include "item.h" +#include "functions.h" // TODO - How does this relate to PlayerItemFunctions? Is this just a lookup table? void (*const gItemFunctions[])(ItemBehavior*, u32) = { @@ -11,7 +12,6 @@ void (*const gItemFunctions[])(ItemBehavior*, u32) = { }; extern void sub_08077E78(ItemBehavior*, u32); -extern void SoundReq(u32); extern void sub_08078F60(void); extern void sub_08077D38(ItemBehavior*, u32); extern void sub_0805E544(void); @@ -28,7 +28,6 @@ extern void (*const gUnk_0811BDE0[])(ItemBehavior* beh, u32); extern void (*const gUnk_0811BDE8[])(ItemBehavior* beh, u32); extern void (*const gUnk_0811BDF4[])(ItemBehavior* beh, u32); -extern u8 gUnk_02034490; #if 0 void Ocarina(ItemBehavior* beh, u32 inputFlags) { gOcarinaStates[beh->stateID](beh, inputFlags); @@ -50,7 +49,7 @@ void OcarinaUse(ItemBehavior *beh, u32 arg1) gPlayerEntity.field_0x7a = 2; gPlayerState.flags.all |= 0x10000000; gPlayerState.field_0x27[0] = 0xff; - gUnk_02034490 = 1; + gUnk_02034490[0] = 1; bVar1 = (8 >> arg1); gPlayerState.field_0xa |= bVar1; gPlayerState.keepFacing |= bVar1; diff --git a/src/item11.c b/src/item11.c index 5821d0b5..f2ad2f16 100644 --- a/src/item11.c +++ b/src/item11.c @@ -1,11 +1,10 @@ #include "global.h" #include "entity.h" #include "player.h" +#include "functions.h" -extern void DeleteThisEntity(); extern void sub_08078CD0(Entity*); extern void sub_08018FA0(Entity*); -extern u32 sub_0801766C(Entity*); extern void sub_08018F6C(Entity*); extern void (*const gUnk_080B3DD0[])(Entity*); @@ -16,7 +15,7 @@ extern Hitbox* gUnk_080B3DE8[]; void Item11(Entity* this) { if (this->currentHealth) { - this->hurtBlinkTime = 0; + this->iframes = 0; gUnk_080B3DD0[this->action](this); } else { DeleteThisEntity(); @@ -32,7 +31,7 @@ void sub_08018CBC(Entity* this) { *(u32*)&this->field_0x80 = this->y.WORD = gPlayerEntity.y.WORD; uVar2 = this->animationState = gPlayerEntity.animationState & 0xe; this->direction = (u8)(uVar2 << 2); - this->nonPlanarMovement = 0x400; + this->speed = 0x400; this->damageType = 0x96; this->field_0x3c = (gPlayerEntity.field_0x3c + 1) | 0x80; this->flags2 = gPlayerEntity.flags2; @@ -82,7 +81,7 @@ void sub_08018DE8(Entity* this) { sub_08018F6C(this); break; case 5: - this->attachedEntity->previousActionFlag = 4; + this->attachedEntity->subAction = 4; this->flags = this->flags | 0x80; this->action = 2; this->spritePriority.b0 = 2; diff --git a/src/item14.c b/src/item14.c index acf87a63..5055a986 100644 --- a/src/item14.c +++ b/src/item14.c @@ -20,7 +20,7 @@ void sub_0805FBE8(Entity* this) { this->spriteSettings.b.draw = TRUE; this->field_0x3c = gPlayerEntity.field_0x3c + 1; this->hitbox = &gUnk_08109AD0; - this->nonPlanarMovement = 0x380; + this->speed = 0x380; this->animationState = this->animationState & 0x7f; if (this->collisionLayer == 2) { this->type2 = 1; diff --git a/src/loadRoom.c b/src/loadRoom.c index 459b3ad5..0bd68f75 100644 --- a/src/loadRoom.c +++ b/src/loadRoom.c @@ -1,10 +1,9 @@ #include "global.h" #include "room.h" #include "flags.h" +#include "functions.h" -void LoadRoomEntityList(EntityData* dat); extern void sub_0804B058(EntityData* dat); -extern void LoadRoomTileEntities(EntityData* dat); extern void sub_0801AC98(); extern u32 sub_08049D1C(u32); extern Entity* LoadRoomEntity(EntityData*); @@ -13,6 +12,24 @@ extern void* GetRoomProperty(u32, u32, u32); extern u32 gUnk_02017654; extern u32* gAreaEntities; +extern void sub_080186EC(); +extern void sub_0804B16C(); + +void sub_0804AFF4(void) { + void (*func)(); + + sub_080186EC(); + func = (void (*)())GetCurrentRoomProperty(5); + if (func) { + func(); + } + func = (void (*)())GetCurrentRoomProperty(7); + if (func) { + func(); + } + sub_0804B16C(); +} + void LoadRoom(void) { s32 iVar1; s32* dat; diff --git a/src/main.c b/src/main.c index ba938c55..c17ba447 100644 --- a/src/main.c +++ b/src/main.c @@ -5,8 +5,10 @@ #include "main.h" #include "screen.h" #include "random.h" -#include "readKeyInput.h" +#include "utils.h" #include "save.h" +#include "textbox.h" +#include "arm_proxy.h" extern void HandleIntroScreen(void); extern void HandleChooseFileScreen(void); @@ -21,13 +23,15 @@ static void (*const sScreenHandlers[])(void) = { [SCREEN_CREDITS] = HandleCreditsScreen, [SCREEN_DEBUG_TEXT] = HandleDebugTextScreen, }; -void MainLoop(void) { +static void sub_080560B8(void); + +void AgbMain(void) { int var0; sub_08055F70(); InitSound(); InitDMA(); - sub_0807CE90(); + InitSaveData(); sub_080560B8(); sub_08056208(); gUnk_02000010.field_0x4 = 193; @@ -37,7 +41,7 @@ void MainLoop(void) { MessageInitialize(); sub_080ADD30(); gRand = 0x1234567; - MemClear32(&gMain, sizeof(gMain)); + MemClear(&gMain, sizeof(gMain)); InitScreen(SCREEN_INTRO); while (1) { ReadKeyInput(); @@ -93,7 +97,7 @@ static void sub_08055F70(void) { *(vu16*)BG_PLTT = 0x7FFF; REG_WAITCNT = WAITCNT_PREFETCH_ENABLE | WAITCNT_WS0_S_1 | WAITCNT_WS0_N_3; size = 0x3FFD0; - MemClear32(gUnk_02000030, size); + MemClear(gUnk_02000030, size); size = (u32)gUnk_080B2CD8 - (u32)sub_080B197C; if (size != 0) { MemCopy(sub_080B197C, gUnk_030056F0, size); @@ -104,7 +108,7 @@ static void sub_08055F70(void) { MemCopy(gUnk_080B2CD8_3, gUnk_02038560, size); } - sub_0801DA90(0); + DispReset(0); sub_08016B34(); } @@ -147,26 +151,26 @@ typedef struct { u8 name[6]; u8 _e; u8 _f; -} test; +} Defaults; -const test sDefaultSettings = { +const Defaults sDefaultSettings = { .signature = SIGNATURE, .saveFileId = 0, .messageSpeed = 1, .brightnessPref = 1, - .gameLanguage = LANGUAGE_EN, + .gameLanguage = GAME_LANGUAGE, .name = "LINK", ._e = 0, ._f = 0, }; // single misplaced ldr -NONMATCH("asm/non_matching/sub_080560B8.inc", void sub_080560B8(void)) { +NONMATCH("asm/non_matching/sub_080560B8.inc", static void sub_080560B8(void)) { u32 temp; u32 b; if (!sub_08056134()) { - switch ((s32)sub_0807CF30((void*)0x2000000)) { + switch ((s32)Read_02000000((void*)0x2000000)) { case 1: if (sub_08056134()) break; @@ -174,7 +178,7 @@ NONMATCH("asm/non_matching/sub_080560B8.inc", void sub_080560B8(void)) { case -1: default: MemCopy(&sDefaultSettings, (void*)0x2000000, 16); - sub_0807CF10((u8*)0x2000000); + Write_02000000(gUnk_02000000); break; } } @@ -183,10 +187,10 @@ NONMATCH("asm/non_matching/sub_080560B8.inc", void sub_080560B8(void)) { b = BOOLCAST(temp); if ((gUnk_02000010.field_0x4 != 0) && (gUnk_02000010.field_0x4 != 0xc1)) { - b = 1; + b = TRUE; } - if (b != 0) { - MemClear32((u8*)&gUnk_02000010.signature, 0x20); + if (b) { + MemClear((u8*)&gUnk_02000010.signature, 0x20); gUnk_02000010.signature = SIGNATURE; } } @@ -251,7 +255,7 @@ void sub_08056260(void) { temp2->field_0x1 = 0; } -// Convert in-game AABB to screen coordinates and check if it's within the viewport +// Convert AABB to screen coordinates and check if it's within the viewport u32 sub_080562CC(u32 x0, u32 y0, u32 x1, u32 y1) { u32 result; u32 x = ((gRoomControls.roomScrollX - gRoomControls.roomOriginX) - x0 + DISPLAY_WIDTH); diff --git a/src/manager/manager1.c b/src/manager/manager1.c index 2b06a48f..45e1b000 100644 --- a/src/manager/manager1.c +++ b/src/manager/manager1.c @@ -1,12 +1,11 @@ #include "global.h" #include "entity.h" #include "screen.h" +#include "functions.h" -extern void LoadGfxGroup(u32); extern void sub_08056250(void); extern void sub_080570B8(Entity*); void sub_080570F8(void); -extern void sub_08052D74(void*, void*, void*); extern void (*const gUnk_08107C5C[])(Entity*); extern void (*const gUnk_08107C48[])(Entity*); diff --git a/src/manager/manager15.c b/src/manager/manager15.c index 5e628829..295f14c7 100644 --- a/src/manager/manager15.c +++ b/src/manager/manager15.c @@ -79,7 +79,7 @@ extern Entity gUnk_080E4C08; void sub_0805A370(Manager15* this) { if (this->manager.unk_0d) { - LoadRoomEntityList(&gUnk_080E4C08); + LoadRoomEntityList((EntityData*)&gUnk_080E4C08); this->manager.action = 3; SoundReq(SONG_RESET_UNK); } @@ -87,7 +87,7 @@ void sub_0805A370(Manager15* this) { void sub_0805A394(Manager15* this) { Entity* ent; - if ((ent = FindEntityInListBySubtype(0x3, 0x13, 0x4))) { + if ((ent = FindEntityByID(0x3, 0x13, 0x4))) { if (ent->type != 4) { return; } @@ -252,10 +252,10 @@ void sub_0805A664(Manager15* this) { sub_0805A68C(this); } -extern u32 sub_0806FBFC(u32, u32, u32, u32); +extern u32 CheckPlayerProximity(u32, u32, u32, u32); void sub_0805A68C(Manager15* this) { - if (sub_0806FBFC(this->unk_38 - 0x18, this->unk_3a - 0x18, 0x30, 0x30)) { + if (CheckPlayerProximity(this->unk_38 - 0x18, this->unk_3a - 0x18, 0x30, 0x30)) { if (this->unk_2c <= 0x1007) { gScreen.controls.alphaBlend = ++this->unk_2c; this->unk_22 = 0; @@ -286,7 +286,7 @@ void sub_0805A6E8(Manager15* this) { } u32 sub_0805A73C(Manager15* this) { - return sub_0806FBFC(this->unk_38 - 0x6, this->unk_3a - 0x6, 0xC, 0xC); + return CheckPlayerProximity(this->unk_38 - 0x6, this->unk_3a - 0x6, 0xC, 0xC); } void sub_0805A758(Manager15* this) { @@ -296,7 +296,6 @@ void sub_0805A758(Manager15* this) { } extern void sub_0805E4E0(Manager*, u32); -extern void sub_08077B20(void); void sub_0805A76C(Manager15* this) { if ((gPlayerEntity.currentHealth != 0) && (gPlayerEntity.height.HALF.HI == 0) && (!gPlayerState.field_0x2c)) { @@ -365,7 +364,6 @@ void sub_0805A804(Manager15* this) { } void sub_0805AAC8(Manager15*); -extern void sub_08052D74(void*, void*, void*); void sub_0805A89C(Manager15* this) { sub_0805E3A0(this, 6); diff --git a/src/manager/manager1A.c b/src/manager/manager1A.c index 19a1dbca..379ac5b9 100644 --- a/src/manager/manager1A.c +++ b/src/manager/manager1A.c @@ -4,6 +4,7 @@ #include "entity.h" #include "room.h" #include "screen.h" +#include "utils.h" #include "functions.h" typedef struct { @@ -30,7 +31,7 @@ void sub_0805B030(Manager1A* this) { } extern void sub_08052D74(void*, void*, void*); -extern u32 sub_0806FBFC(u32, u32, u32, u32); +extern u32 CheckPlayerProximity(u32, u32, u32, u32); typedef struct struct_08108764 { u8 unk_00; @@ -65,13 +66,12 @@ u32 sub_0805B1CC(Manager1A*); void sub_0805B210(Manager1A*); void sub_0805B2B0(Manager1A*); void sub_0805B328(Manager1A*); -void sub_0805BC4C(void); void sub_0805B048(Manager1A* this) { struct_08108764* tmp; Entity* obj; sub_0805E3A0(&this->manager, 6); - MemClear32(&this->unk_20, 0x20); + MemClear(&this->unk_20, 0x20); this->manager.action = 1; this->unk_3f = gRoomControls.roomID; tmp = &gUnk_08108764[this->manager.unk_0a]; @@ -138,7 +138,7 @@ void sub_0805B168(Manager1A* this) { u32 sub_0805B1CC(Manager1A* this) { u32 re = 0; - if (sub_0806FBFC(this->unk_20, this->unk_22, this->unk_24, this->unk_26)) { + if (CheckPlayerProximity(this->unk_20, this->unk_22, this->unk_24, this->unk_26)) { if ((gPlayerState.flags.all & 0x4) && (gPlayerState.flags.all & 0x1)) { gPlayerState.flags.all |= 0x8000; } else if (gPlayerState.flags.all & 0x8000) { @@ -224,5 +224,5 @@ void sub_0805B390(u32 unk1) { tmp->type = 0x9; tmp->subtype = 0x1A; tmp->unk_0a = unk1; - AppendEntityToList(tmp, 6); + AppendEntityToList((Entity*)tmp, 6); } diff --git a/src/manager/manager1E.c b/src/manager/manager1E.c index 363c3113..fad34ef4 100644 --- a/src/manager/manager1E.c +++ b/src/manager/manager1E.c @@ -1,7 +1,6 @@ #include "global.h" #include "manager.h" #include "flags.h" -#include "player.h" #include "functions.h" typedef struct { @@ -17,7 +16,6 @@ typedef struct { enum Manager1E_State { Init, ObserveRegion }; -void Manager1E_Handler(Manager1E*); void Manager1E_Init(Manager1E*); void Manager1E_ObserveRegion(Manager1E*); diff --git a/src/manager/manager2.c b/src/manager/manager2.c index 56c81310..b6e0eef7 100644 --- a/src/manager/manager2.c +++ b/src/manager/manager2.c @@ -1,9 +1,9 @@ #include "global.h" #include "entity.h" #include "screen.h" +#include "functions.h" extern void sub_080576A0(); -extern void sub_08052D74(); extern void sub_0805754C(Entity*); void Manager2(Entity* this) { diff --git a/src/manager/manager20.c b/src/manager/manager20.c index b8a20f5f..f7ca8a0b 100644 --- a/src/manager/manager20.c +++ b/src/manager/manager20.c @@ -3,6 +3,7 @@ #include "flags.h" #include "entity.h" #include "room.h" +#include "functions.h" typedef struct { Manager manager; @@ -17,8 +18,6 @@ typedef struct { u16 unk_3e; } Manager20; -extern void DeleteManager(Manager20*); - void sub_0805B7A0(Manager20* this) { Entity* tmp = CreateObject(this->manager.unk_0e, this->manager.unk_0a, this->manager.unk_0b); if (!tmp) @@ -35,5 +34,5 @@ void sub_0805B7A0(Manager20* this) { } tmp->x.HALF.HI += gRoomControls.roomOriginX; tmp->y.HALF.HI += gRoomControls.roomOriginY; - DeleteManager(this); + DeleteManager((Manager*)this); } diff --git a/src/manager/manager27.c b/src/manager/manager27.c index feaee671..6540c1ad 100644 --- a/src/manager/manager27.c +++ b/src/manager/manager27.c @@ -5,7 +5,6 @@ #include "functions.h" extern u32 sub_0805C920(Entity*); -extern void LoadPaletteGroup(u32); void sub_0805C874(Entity*); void sub_0805C894(Entity*); diff --git a/src/manager/manager28.c b/src/manager/manager28.c index 07cac266..1e2eb829 100644 --- a/src/manager/manager28.c +++ b/src/manager/manager28.c @@ -11,7 +11,6 @@ typedef struct { } d; } Manager28; -void Manager28_Entry(Manager28*); void Manager28_Init(Manager28*); void Manager28_Main(Manager28*); u32 Manager28_FindMatchingEntities(Manager28*); @@ -47,7 +46,7 @@ void Manager28_Init(Manager28* this) { /* tmp3->enemies[tmp4] = this->enemies[tmp4]; */ /* } */ tmp3->d = this->d; - AppendEntityToList(tmp3, 6); + AppendEntityToList((Entity*)tmp3, 6); } } DeleteManager(&this->manager); diff --git a/src/manager/manager3.c b/src/manager/manager3.c index 5234f149..acd83825 100644 --- a/src/manager/manager3.c +++ b/src/manager/manager3.c @@ -4,8 +4,11 @@ #include "area.h" #include "room.h" #include "player.h" +#include "random.h" #include "functions.h" +// Facilitates the usage of minish portals. + typedef struct { Manager manager; u32 unk_20; @@ -21,7 +24,7 @@ typedef struct { } Manager3; extern s8 gUnk_08107C6C[]; -extern u32 sub_0806FBFC(u32, u32, u32, u32); +extern u32 CheckPlayerProximity(u32, u32, u32, u32); extern u32 sub_08057810(void); extern u32 sub_080002C0(u16, u16, u8); extern void sub_080577AC(u32, u32, u32); @@ -34,14 +37,14 @@ void sub_080576C0(Manager3* this) { this->unk_24 = this->unk_3a + gRoomControls.roomOriginY - 0x20; return; } - if (sub_0806FBFC(this->unk_20, this->unk_24, 0x40, 0x40)) { - gArea.field_0x12 = this->unk_20 + 0x20; - gArea.field_0x14 = this->unk_24 + 0x20 + gUnk_08107C6C[this->manager.unk_0a]; - gArea.field_0x16 = this->unk_34; - gArea.field_0x17 = this->manager.unk_0a; + if (CheckPlayerProximity(this->unk_20, this->unk_24, 0x40, 0x40)) { + gArea.curPortalX = this->unk_20 + 0x20; + gArea.curPortalY = this->unk_24 + 0x20 + gUnk_08107C6C[this->manager.unk_0a]; + gArea.curPortalExitDirection = this->unk_34; + gArea.curPortalType = this->manager.unk_0a; if (!CheckGlobalFlag(EZERO_1ST)) { gArea.field_0x18 = 1; - gArea.field_0x17 = 5; + gArea.curPortalType = 5; } else { if ((gPlayerState.flags.all & 0x20) && gPlayerState.jumpStatus == 0) { gArea.field_0x18 = 2; @@ -90,7 +93,7 @@ void sub_080577AC(u32 baseX, u32 baseY, u32 layer) { } u32 sub_08057810(void) { - if ((gPlayerState.flags.all & 0x80) && !gPlayerState.field_0xaa && (gArea.field_0x17 != 0x6) && + if ((gPlayerState.flags.all & 0x80) && !gPlayerState.field_0xaa && (gArea.curPortalType != 0x6) && (gPlayerState.heldObject == 0)) { switch (gPlayerState.field_0xa8) { case 0: diff --git a/src/manager/manager30.c b/src/manager/manager30.c index ece1698f..94f3be33 100644 --- a/src/manager/manager30.c +++ b/src/manager/manager30.c @@ -20,8 +20,6 @@ typedef struct Manager30 { u16 flag_reset; } Manager30; -extern void sub_0807B7D8(u32, u32, u32); - enum { INIT, IN_PROGRESS, FAILED, SUCCEEDED }; /* diff --git a/src/manager/manager39.c b/src/manager/manager39.c index 31cbda7e..cdac7c61 100644 --- a/src/manager/manager39.c +++ b/src/manager/manager39.c @@ -3,6 +3,8 @@ #include "screen.h" #include "area.h" #include "textbox.h" +#include "utils.h" +#include "game.h" #include "functions.h" typedef struct { @@ -25,9 +27,7 @@ extern const u8 gUnk_08108E30[0x18]; extern const u8 gUnk_08108E48[0x18]; extern const u8 gUnk_08108E60[]; -extern void MemCopy(const void* src, void* dest, u32 size); extern void sub_0805F46C(void*, const void*); -extern u32 CheckIsDungeon(void); extern void sub_0805E5B4(void); void sub_0805E140(Manager39*); @@ -68,7 +68,7 @@ void sub_0805E18C(Manager39* this) { } void sub_0805E1D8(Manager39* this) { - MemClear32(&gUnk_02034DF0, 0x80); + MemClear(&gUnk_02034DF0, 0x80); gScreen.bg.bg0Updated = 1; DeleteThisEntity(); } @@ -81,7 +81,7 @@ void sub_0805E1F8(u32 unk0, u32 unk1) { u8 unk_06[3]; } PACKED tmp; const u8* tmp2; - MemClear32(&gUnk_02034DF0, 0x80); + MemClear(&gUnk_02034DF0, 0x80); MemCopy(gUnk_08108E60, &tmp, sizeof(tmp)); tmp.unk_04 = unk0 >> 8; tmp.unk_05 = unk0; diff --git a/src/manager/manager4.c b/src/manager/manager4.c index da43751f..3d396682 100644 --- a/src/manager/manager4.c +++ b/src/manager/manager4.c @@ -3,6 +3,7 @@ #include "room.h" #include "manager.h" #include "structures.h" +#include "functions.h" extern void (*gUnk_08107C70[])(Manager*); @@ -12,8 +13,6 @@ void sub_08057854(Manager* this) { extern void sub_080805F8(void); -extern void SetTile(u32, u32, u32); - extern DiggingCaveEntrance* sub_08057AA8(DiggingCaveEntrance*, int); void sub_0805786C(Manager* this) { @@ -67,7 +66,7 @@ void sub_08057A18(Manager*, DiggingCaveEntrance*); u32 sub_0805795C(Manager* this, DiggingCaveEntrance* entr) { u16 offsetX, offsetY, offsetX2, offsetY2; u32 tmp; - if (gUnk_03004030.unk_08) { + if (gUnk_03004030.address_width) { offsetX = gPlayerEntity.x.HALF.HI - gRoomControls.roomOriginX; offsetY = gPlayerEntity.y.HALF.HI - gRoomControls.roomOriginY; offsetX2 = (entr->unk_00 & 0x3F) * 16 + 8; @@ -101,8 +100,6 @@ u32 sub_0805795C(Manager* this, DiggingCaveEntrance* entr) { } #endif -extern void sub_0805E5A8(void); -extern void DeleteManager(Manager*); extern void sub_08080930(); void sub_08057A18(Manager* this, DiggingCaveEntrance* entr) { diff --git a/src/manager/manager5.c b/src/manager/manager5.c index 4cb39ca8..fbb4da2e 100644 --- a/src/manager/manager5.c +++ b/src/manager/manager5.c @@ -35,8 +35,6 @@ void sub_08057AD0(Manager5* this) { void sub_08057CA4(Manager5*, u32, u32); -extern void DeleteManager(Manager*); - void sub_08057AE8(Manager5* this) { u32 tmp; tmp = (this->manager.unk_0b & 0x3) << 1; diff --git a/src/manager/manager6.c b/src/manager/manager6.c index aa5cb48a..ff32b405 100644 --- a/src/manager/manager6.c +++ b/src/manager/manager6.c @@ -1,12 +1,9 @@ #include "global.h" -#include "entity.h" #include "player.h" #include "manager.h" +#include "functions.h" -extern void* GetCurrentRoomProperty(u8); -extern u32 CheckPlayerInRegion(u16, u16, u8, u8); extern void DoExitTransition(void*); -extern void DeleteManager(Entity*); void sub_08057CB4(Manager6* this) { u32 tmp; @@ -15,7 +12,7 @@ void sub_08057CB4(Manager6* this) { this->manager.action = 1; this->warpList = GetCurrentRoomProperty(this->manager.unk_0a); if (!this->warpList) { - DeleteManager((Entity*)this); + DeleteManager(&this->manager); return; } } diff --git a/src/manager/manager7.c b/src/manager/manager7.c index 3a2cbb1a..089dab1b 100644 --- a/src/manager/manager7.c +++ b/src/manager/manager7.c @@ -12,12 +12,9 @@ typedef struct { void sub_08057E30(); u32 sub_08057E40(); -void sub_08057E64(); void sub_08057E7C(u32); -extern void sub_08052D74(); extern u32 sub_08056300(const u16*); -extern void sub_0805E3A0(); extern const u8 gGlobalGfxAndPalettes[]; diff --git a/src/manager/manager8.c b/src/manager/manager8.c index c6cd5075..aa80b627 100644 --- a/src/manager/manager8.c +++ b/src/manager/manager8.c @@ -17,8 +17,6 @@ void sub_08057EFC(); void sub_08058034(void); void sub_08058084(u16*, u16*); -extern void sub_08052D74(void*, void*, void*); - extern u16 gMapDataTopSpecial[]; void sub_08057ED0(Manager8* this) { diff --git a/src/manager/manager9.c b/src/manager/manager9.c index 70d117fb..aebc9a96 100644 --- a/src/manager/manager9.c +++ b/src/manager/manager9.c @@ -15,7 +15,6 @@ void sub_08058210(Manager9*); u32 sub_08058244(int); void sub_080582A0(u32, u32*, u8*); void sub_080582F8(u8*, u8*); -void sub_08058324(); extern u32 gUnk_02006F00[]; extern u8 gBG3Buffer[]; diff --git a/src/manager/managerA.c b/src/manager/managerA.c index 3033dd21..4b4a2ce4 100644 --- a/src/manager/managerA.c +++ b/src/manager/managerA.c @@ -4,6 +4,7 @@ #include "manager.h" #include "flags.h" #include "area.h" +#include "functions.h" void sub_08058398(ManagerA*); void sub_080583EC(ManagerA*); @@ -17,8 +18,6 @@ void sub_08058380(ManagerA* this) { gUnk_081081F4[this->manager.action](this); } -extern void sub_0805E3A0(Manager*, u32); - void sub_08058398(ManagerA* this) { if (CheckFlags(this->unk_3c) != 0) { @@ -36,8 +35,6 @@ void sub_08058398(ManagerA* this) { } } -void sub_08058408(ManagerA*); - void sub_080583EC(ManagerA* this) { if (CheckFlags(this->unk_3e) != 0) { this->manager.action = 2; @@ -45,12 +42,8 @@ void sub_080583EC(ManagerA* this) { } } -extern u32 CheckPlayerInRegion(u32, u32, u32, u32); extern void sub_0805E544(void); -extern void sub_08078A90(u32); -extern void sub_08078AA8(u32, u32); extern void sub_080186C0(u16); -extern void sub_08078B48(void); u32 sub_0805848C(ManagerA*); void sub_080585DC(ManagerA*); diff --git a/src/manager/managerB.c b/src/manager/managerB.c index e6e43a12..ca298178 100644 --- a/src/manager/managerB.c +++ b/src/manager/managerB.c @@ -4,6 +4,7 @@ #include "entity.h" #include "room.h" #include "area.h" +#include "utils.h" #include "functions.h" /* @@ -128,8 +129,8 @@ ManagerBHelper* CreateHelper(Manager* this) { extra->manager.unk_0a = 1; extra->manager.parent = this; this->unk_0e++; - MemClear32(&extra->enemies, 0x20); - AppendEntityToList(extra, 8); + MemClear(&extra->enemies, 0x20); + AppendEntityToList((Entity*)extra, 8); } return extra; } diff --git a/src/manager/managerC.c b/src/manager/managerC.c index f7092e7b..83b35412 100644 --- a/src/manager/managerC.c +++ b/src/manager/managerC.c @@ -4,9 +4,8 @@ #include "flags.h" #include "structures.h" #include "room.h" -#include "area.h" #include "screen.h" -#include "trig.h" +#include "coord.h" #include "functions.h" #include "save.h" @@ -41,12 +40,9 @@ void sub_08058A04(ManagerC*); void sub_080588F8(ManagerC*); u32 sub_08058B08(ManagerC*, u32, u32, const struct_08108228*); void sub_08058B5C(ManagerC*, u32); -void sub_08058D34(void); extern void sub_0805622C(struct BgAffineDstData*, u32, u32); -extern void sub_08052D74(void*, void*, void*); extern void sub_080044AE(Entity*, u32, u32); -extern void MemCopy(const void* src, void* dest, u32 size); extern u8 gUnk_03003DE4[0xC]; @@ -89,7 +85,7 @@ void sub_080588CC(ManagerC* this) { void nullsub_108(ManagerC* this) { } -#define ABS_DIFF_GT(a, b, c) (signed)a - b >= 0 ? a - b > c : b - a > c +#define ABS_DIFF_GT(a, b, c) ((signed)(a) - (b) >= 0 ? (a) - (b) > (c) : (b) - (a) > (c)) void sub_080588F8(ManagerC* this) { if (this->manager.unk_0f == 0) { diff --git a/src/manager/managerE.c b/src/manager/managerE.c index 0f5e9328..44bfb5a7 100644 --- a/src/manager/managerE.c +++ b/src/manager/managerE.c @@ -3,13 +3,7 @@ #include "manager.h" #include "flags.h" #include "room.h" - -extern void LoadRoomEntityList(Entity*); -extern void DeleteThisEntity(void); -extern void DeleteManager(Manager*); -extern void sub_08078A90(u32); -extern void sub_08078B48(void); -extern void SoundReq(u32); +#include "functions.h" void sub_08058E60(ManagerE* this) { if (!this->manager.action) { diff --git a/src/npc.c b/src/npc.c index d7f38b6a..4a94399b 100644 --- a/src/npc.c +++ b/src/npc.c @@ -1,5 +1,4 @@ #include "global.h" -#include "functions.h" #include "entity.h" #include "npc.h" diff --git a/src/npc/anju.c b/src/npc/anju.c index b0b0ee91..e0fb08c8 100644 --- a/src/npc/anju.c +++ b/src/npc/anju.c @@ -1,19 +1,9 @@ #include "global.h" #include "entity.h" #include "player.h" -#include "room.h" -#include "flags.h" -#include "sprite.h" -#include "textbox.h" #include "npc.h" - -extern void sub_0805E3A0(Entity*, u32); -extern void sub_0807DD50(Entity*); -extern u32 sub_0806F5A4(u32); -extern void sub_0806F118(Entity*); -extern void sub_0807DD94(Entity*, u32); -extern u32 sub_0801E99C(void); -extern void sub_08078784(Entity*, u32); +#include "script.h" +#include "functions.h" void Anju(Entity* this) { switch (this->action) { @@ -38,12 +28,11 @@ void Anju(Entity* this) { if (UpdateFuseInteraction(this)) { this->action = 1; } - default: } } void sub_0806C354(Entity* this) { - this->field_0x68.HALF.LO = sub_0801E99C(); + this->field_0x68.HALF.LO = sub_0801E99C(this); sub_08078784(this, this->field_0x68.HALF.LO); } diff --git a/src/npc/beedle.c b/src/npc/beedle.c index 9e7a5755..b4d25858 100644 --- a/src/npc/beedle.c +++ b/src/npc/beedle.c @@ -109,8 +109,8 @@ void sub_08063410(Entity* this) { if (this->type != 0) { sub_0806346C(this); } - sub_0807DDAC(this, NULL); - sub_0807DDE4(this); + ExecuteScriptForEntity(this, NULL); + HandleEntity0x82Actions(this); GetNextFrame(this); } @@ -148,17 +148,17 @@ void sub_0806346C(Entity* this) { } } -void sub_080634E4(Entity* this, u32* param_1) { - param_1[1] = this->type2; +void sub_080634E4(Entity* this, ScriptExecutionContext* context) { + context->intVariable = this->type2; } void sub_080634EC(Entity* this) { gRoomVars.itemForSaleIndex = gUnk_0810C88C[this->type2]; } -void sub_08063504(Entity* this, u32* param_2) { +void sub_08063504(Entity* this, ScriptExecutionContext* context) { u32 uVar1; - uVar1 = sub_080544DC(gUnk_0810C88C[this->type2]); - param_2[5] = BOOLCAST(uVar1); + uVar1 = GetBottleContaining(gUnk_0810C88C[this->type2]); + context->condition = BOOLCAST(uVar1); } diff --git a/src/npc/bigGoron.c b/src/npc/bigGoron.c index 2874115f..3123b036 100644 --- a/src/npc/bigGoron.c +++ b/src/npc/bigGoron.c @@ -2,18 +2,13 @@ #include "entity.h" #include "player.h" #include "structures.h" -#include "functions.h" #include "script.h" +#include "random.h" +#include "functions.h" extern void (*gUnk_081140D4[])(Entity*); extern u16 gUnk_081140CC[]; -extern void sub_0806D0B0(Entity*); -extern void sub_0807DD64(Entity*); -extern void sub_0807DDE4(Entity*); -extern void SoundReq(u32); -extern void sub_0806D02C(Entity*); -extern Entity* FindEntityInListByForm(u32, u32, u32, u32, u32); void BigGoron(Entity* this) { gUnk_081140D4[this->type](this); @@ -22,17 +17,17 @@ void BigGoron(Entity* this) { void sub_0806CF30(Entity* this) { if (this->action == 0) { this->action = 1; - this->previousActionFlag = 1; + this->subAction = 1; this->field_0x68.HWORD = this->x.HALF.HI; sub_0805E3A0(this, 2); sub_0806D0B0(this); sub_0807DD64(this); } else { - sub_0807DDAC(this, NULL); - sub_0807DDE4(this); + ExecuteScriptForEntity(this, NULL); + HandleEntity0x82Actions(this); } - switch (this->previousActionFlag) { + switch (this->subAction) { case 0: case 1: if (gScreenTransition.frameCount % 4 == 0) { @@ -61,7 +56,7 @@ void sub_0806CF30(Entity* this) { void sub_0806D00C(Entity* this) { Entity* pEVar1; - pEVar1 = FindEntityInListByForm(7, 76, 7, 0, 0); + pEVar1 = FindEntity(7, 76, 7, 0, 0); if (pEVar1 != NULL) { this->parent = pEVar1; } diff --git a/src/npc/bladeBrothers.c b/src/npc/bladeBrothers.c index 913f30cc..49a86dfc 100644 --- a/src/npc/bladeBrothers.c +++ b/src/npc/bladeBrothers.c @@ -1,12 +1,13 @@ #include "global.h" #include "entity.h" -#include "functions.h" #include "flags.h" #include "player.h" #include "room.h" #include "textbox.h" #include "save.h" #include "script.h" +#include "npc.h" +#include "functions.h" extern void (*gUnk_081115C0[])(Entity*); extern void (*gUnk_081115D0[])(Entity*); @@ -132,7 +133,7 @@ void FUN_08068b2c(Entity* this) { } void sub_08068B70(Entity* this) { - if (UpdateFuseInteraction()) { + if (UpdateFuseInteraction(this)) { this->action = 1; } } @@ -195,53 +196,50 @@ void sub_08068C6C(Entity* this) { sub_080A7C18(gUnk_0811162B[this->actionDelay] & 0xffffff7f, 0, 0); } -void sub_08068C8C(Entity* param_1, Entity* param_2) { +void sub_08068C8C(Entity* this, ScriptExecutionContext* context) { u8* arr = gUnk_0811162B + 0xd; - - *(u32*)¶m_2->animationState = *(u32*)(arr + param_1->actionDelay * 4); + context->condition = *(u32*)(arr + this->actionDelay * 4); } -void sub_08068CA0(Entity* param_1, Entity* param_2) { +void sub_08068CA0(Entity* this, ScriptExecutionContext* context) { u8 bVar1; u32 uVar2; - bVar1 = param_1->type; + bVar1 = this->type; if (bVar1 == 1) { - *(u32*)¶m_2->animationState = bVar1; + context->condition = bVar1; uVar2 = GetInventoryValue(0x48); // spin attack if (uVar2 == 0) { - *(u32*)¶m_2->animationState = 0; + context->condition = 0; } uVar2 = GetInventoryValue(0x4b); // rock breaker if (uVar2 == 0) { - *(u32*)¶m_2->animationState = 0; + context->condition = 0; } uVar2 = GetInventoryValue(0x4a); // dash attack if (uVar2 == 0) { - *(u32*)¶m_2->animationState = 0; + context->condition = 0; } uVar2 = GetInventoryValue(0x4e); // down thrust if (uVar2 != 0) { return; } } else { - uVar2 = GetInventoryValue(gUnk_0811162B[param_1->actionDelay] & -0x81); + uVar2 = GetInventoryValue(gUnk_0811162B[this->actionDelay] & -0x81); if (uVar2 != 0) { uVar2 = 1; } } - *(u32*)¶m_2->animationState = uVar2; + context->condition = uVar2; } -void sub_08068CFC(Entity* param_1, Entity* param_2, u32 param_3, u32 param_4) - -{ +void sub_08068CFC(Entity* this, ScriptExecutionContext* context) { u8 bVar1; u8 itemID; u32 uVar2; - *(u32*)¶m_2->animationState = 0; - bVar1 = param_1->actionDelay; + context->condition = 0; + bVar1 = this->actionDelay; if (bVar1 > 10) return; @@ -302,7 +300,7 @@ LABEL1: return; } switchD_08068d12_caseD_0: - *(u32*)¶m_2->animationState = 1; + context->condition = 1; } // Introduction dialoague @@ -354,12 +352,12 @@ void sub_08068EB4(void) { gPlayerState.field_0xab = 0; } -void sub_08068EC4(Entity* param_1, Entity* param_2) { - if (gUnk_08111740[param_1->actionDelay] == gPlayerState.field_0xab) { - *(u16*)¶m_2->flags = gUnk_0811172A[param_1->actionDelay]; - *(u32*)¶m_2->animationState = 1; +void sub_08068EC4(Entity* this, ScriptExecutionContext* context) { + if (gUnk_08111740[this->actionDelay] == gPlayerState.field_0xab) { + context->wait = gUnk_0811172A[this->actionDelay]; + context->condition = 1; } else { - *(u32*)¶m_2->animationState = 0; + context->condition = 0; } } @@ -386,7 +384,6 @@ void sub_08068F3C(Entity* this) { } void BladeBrothers_Fusion(Entity* this) { - if (this->action == 0) { this->action += 1; this->spriteSettings.b.draw = 0; diff --git a/src/npc/carlov.c b/src/npc/carlov.c index d3824e78..92d632ed 100644 --- a/src/npc/carlov.c +++ b/src/npc/carlov.c @@ -1,16 +1,9 @@ #include "global.h" #include "entity.h" -#include "player.h" #include "room.h" -#include "flags.h" -#include "sprite.h" -#include "textbox.h" #include "npc.h" -#include "structures.h" - -extern void sub_0807DD50(Entity*); -extern void sub_0807DD94(Entity*, u32); -extern void EnqueueSFX(u32); +#include "script.h" +#include "functions.h" void Carlov(Entity* this) { if (this->action == 0) { diff --git a/src/npc/carpenter.c b/src/npc/carpenter.c index f4bdb04a..21f8db14 100644 --- a/src/npc/carpenter.c +++ b/src/npc/carpenter.c @@ -2,20 +2,11 @@ #include "entity.h" #include "sprite.h" #include "player.h" +#include "npc.h" +#include "functions.h" +#include "script.h" -extern void DeleteThisEntity(); -extern u32 LoadExtraSpriteData(Entity*, SpriteLoadData*); extern SpriteLoadData gUnk_08110CA8[]; -extern void sub_0805E3A0(Entity*, u32); -extern void sub_0807DD64(Entity*); -extern u32 GetFacingDirection(Entity*, Entity*); -extern void sub_0806F118(Entity*); -extern void sub_0807DDAC(Entity*, u32); -extern void sub_0807DDE4(Entity*); -extern u32 UpdateFuseInteraction(Entity*); -extern void SetSpriteSubEntryOffsetData2(Entity*, u32, u32); -extern void sub_0807000C(Entity*); -extern u32 sub_0806F5A4(); void Carpenter(Entity* this) { if (*(u32*)&this->cutsceneBeh == 0) { @@ -39,8 +30,8 @@ void Carpenter(Entity* this) { sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)) + 4 + (this->type * 8)); sub_0806F118(this); } else { - sub_0807DDAC(this, 0); - sub_0807DDE4(this); + ExecuteScriptForEntity(this, 0); + HandleEntity0x82Actions(this); GetNextFrame(this); } break; @@ -69,6 +60,6 @@ void Carpenter_Head(Entity* this) { } } -void sub_080672b0(Entity* this, u32 param_2) { - InitializeAnimation(this, *(u32*)(param_2 + 4) + (this->animationState >> 1) + this->type * 8); +void sub_080672B0(Entity* this, ScriptExecutionContext* context) { + InitializeAnimation(this, context->intVariable + (this->animationState >> 1) + this->type * 8); } diff --git a/src/npc/cow.c b/src/npc/cow.c index 70674a1f..411b139f 100644 --- a/src/npc/cow.c +++ b/src/npc/cow.c @@ -2,22 +2,16 @@ #include "audio.h" #include "entity.h" #include "player.h" +#include "random.h" +#include "npc.h" #include "functions.h" -extern void sub_0806920C(Entity*); -extern u32 sub_0805ACC0(Entity*); -extern u32 sub_0801E99C(Entity*); -extern void sub_0806924C(Entity*); -extern void sub_08078778(Entity*); -extern void sub_080787A8(Entity*, u32); -extern void sub_0806F118(Entity*); -extern void sub_080791D0(); +void sub_0806920C(Entity* ent); +void sub_0806924C(Entity* ent); + extern void (*gUnk_08111914[])(Entity*); extern void (*gUnk_08111928[])(Entity*); extern Dialog gUnk_08111938[]; -extern void SoundReq(u32); -extern u32 UpdateFuseInteraction(Entity*); -extern PlayerState gPlayerState; void Cow(Entity* ent) { gUnk_08111914[ent->action](ent); @@ -30,7 +24,7 @@ void sub_08068FC0(Entity* ent) { ent->action = 1; ent->animationState = ent->type2; - ent->nonPlanarMovement = 0x40; + ent->speed = 0x40; ent->field_0x6c.HALF.HI = 0xFF; @@ -57,8 +51,8 @@ void sub_08068FC0(Entity* ent) { void sub_08069018(Entity* ent) { s32 var0; - if (ent->previousActionFlag == 0) { - ent->previousActionFlag++; + if (ent->subAction == 0) { + ent->subAction++; ent->field_0xf = (Random() & 0x3F) + 0x3C; InitAnimationForceUpdate(ent, ent->animationState); } @@ -71,7 +65,7 @@ void sub_08069018(Entity* ent) { } else { ent->action = 3; } - ent->previousActionFlag = var0; + ent->subAction = var0; } sub_0806924C(ent); @@ -80,10 +74,10 @@ void sub_08069018(Entity* ent) { void sub_08069068(Entity* ent) { s32 var0; - if (ent->previousActionFlag == 0) { + if (ent->subAction == 0) { u32 anim; - ent->previousActionFlag++; + ent->subAction++; anim = (Random() & 2) - 1; anim = (anim + ent->animationState) & 3; @@ -127,7 +121,7 @@ void sub_08069068(Entity* ent) { var0 = --ent->field_0xf; if (var0 == 0) { ent->action = 3; - ent->previousActionFlag = var0; + ent->subAction = var0; } sub_0806924C(ent); @@ -135,7 +129,7 @@ void sub_08069068(Entity* ent) { void sub_08069124(Entity* ent) { UpdateAnimationSingleFrame(ent); - gUnk_08111928[ent->previousActionFlag](ent); + gUnk_08111928[ent->subAction](ent); sub_0806924C(ent); } @@ -143,13 +137,13 @@ void sub_08069148(Entity* ent) { u32 var0 = Random() & 3; var0 += 3; ent->field_0xf = var0; - ent->previousActionFlag = 1; + ent->subAction = 1; InitAnimationForceUpdate(ent, ent->animationState + 8); } void sub_08069168(Entity* ent) { if ((s8)ent->frames.all < 0) { - ent->previousActionFlag = 2; + ent->subAction = 2; InitAnimationForceUpdate(ent, ent->animationState + 12); } } @@ -161,14 +155,14 @@ void sub_08069188(Entity* ent) { if (((s8)--ent->field_0xf) != 0) return; - ent->previousActionFlag = 3; + ent->subAction = 3; InitAnimationForceUpdate(ent, ent->animationState + 16); } void sub_080691BC(Entity* ent) { if ((s8)ent->frames.all < 0) { ent->action = 1; - ent->previousActionFlag = 0; + ent->subAction = 0; InitAnimationForceUpdate(ent, ent->animationState + 4); } } @@ -176,7 +170,7 @@ void sub_080691BC(Entity* ent) { void sub_080691E0(Entity* ent) { if (UpdateFuseInteraction(ent) != 0) { ent->action = 1; - ent->previousActionFlag = 0; + ent->subAction = 0; } } diff --git a/src/npc/dampe.c b/src/npc/dampe.c index f424c1d8..6293bcd7 100644 --- a/src/npc/dampe.c +++ b/src/npc/dampe.c @@ -3,28 +3,15 @@ #include "player.h" #include "room.h" #include "flags.h" -#include "sprite.h" #include "textbox.h" #include "npc.h" - -extern void sub_0805E3A0(Entity*, u32); -extern void sub_0807DD50(Entity*); -extern u32 sub_0806F5A4(u32); -extern void sub_0806F118(Entity*); -extern void sub_0807DD94(Entity*, u32); -extern u32 sub_0801E99C(void); -extern void sub_08078784(Entity*, u32); +#include "functions.h" +#include "script.h" extern u16 gUnk_08113344[]; extern u16 gUnk_0811334A[]; -typedef struct { - u8 filler[18]; - u32 unk; -} struct_0806BE84; - void Dampe(Entity* this) { - switch (this->action) { case 0: this->action = 1; @@ -47,12 +34,11 @@ void Dampe(Entity* this) { if (UpdateFuseInteraction(this)) { this->action = 1; } - default: } } void sub_0806BE3C(Entity* this) { - this->field_0x68.HALF.LO = sub_0801E99C(); + this->field_0x68.HALF.LO = sub_0801E99C(this); sub_08078784(this, this->field_0x68.HALF.LO); } @@ -66,15 +52,15 @@ void Dampe_Fusion(Entity* this) { } } -void sub_0806BE84(Entity* this, struct_0806BE84* r1) { +void sub_0806BE84(Entity* this, ScriptExecutionContext* context) { u32 msgIndex; - r1->unk = 0; + context->condition = 0; msgIndex = 1; if (!CheckLocalFlag(0x69)) { msgIndex = 0; SetLocalFlag(0x69); - r1->unk = 1; + context->condition = 1; } // Graveyard key if (GetInventoryValue(0x3C) >= 2) { @@ -83,16 +69,16 @@ void sub_0806BE84(Entity* this, struct_0806BE84* r1) { TextboxNoOverlap(gUnk_08113344[msgIndex], this); } -void sub_0806BEC8(Entity* this, struct_0806BE84* r1) { +void sub_0806BEC8(Entity* this, ScriptExecutionContext* context) { u32 hasGraveyardKey; u32 msgIndex; msgIndex = 0; - r1->unk = 0; + context->condition = 0; hasGraveyardKey = GetInventoryValue(0x3C); if (hasGraveyardKey == 1) { msgIndex = 1; - r1->unk = 1; + context->condition = 1; } else if (hasGraveyardKey >= 2) { msgIndex = 2; } @@ -107,10 +93,10 @@ void sub_0806BEFC() { SetTileType(0x181, 0x5CF, 1); } -void sub_0806BF44(Entity* this, struct_0806BE84* r1) { - r1->unk = 0; +void sub_0806BF44(Entity* this, ScriptExecutionContext* context) { + context->condition = 0; if (((this->x.HALF.HI - gRoomControls.roomScrollX) + 0x10U < 0x110) && ((this->y.HALF.HI - gRoomControls.roomScrollY) + 0x18U < 0xD0)) { - r1->unk = 1; + context->condition = 1; } } diff --git a/src/npc/emma.c b/src/npc/emma.c index c43b961c..f7a8577a 100644 --- a/src/npc/emma.c +++ b/src/npc/emma.c @@ -1,45 +1,32 @@ #include "global.h" #include "entity.h" +#include "script.h" +#include "functions.h" extern u32 gUnk_0813AD10; extern u32 gUnk_0813AD24; extern u32 gUnk_0813AD38; -extern void sub_0805E3A0(Entity*, u32); -extern void sub_0807DD50(Entity*); -extern void sub_0807DD94(Entity*, u32); extern void DoExitTransition(u32*); -void Emma(Entity* param_1) - -{ - if (param_1->action == 0) { - param_1->action += 1; - sub_0805E3A0(param_1, 2); - sub_0807DD50(param_1); +void Emma(Entity* this) { + if (this->action == 0) { + this->action += 1; + sub_0805E3A0(this, 2); + sub_0807DD50(this); } else { - sub_0807DD94(param_1, 0); + sub_0807DD94(this, 0); } - return; } -void sub_0806C578(void) - -{ +void sub_0806C578(void) { DoExitTransition(&gUnk_0813AD10); - return; } -void sub_0806C588(void) - -{ +void sub_0806C588(void) { DoExitTransition(&gUnk_0813AD24); - return; } -void FUN_0806c598(void) - -{ +void sub_0806C598(void) { DoExitTransition(&gUnk_0813AD38); - return; } diff --git a/src/npc/epona.c b/src/npc/epona.c index 8127eb92..1846d4f9 100644 --- a/src/npc/epona.c +++ b/src/npc/epona.c @@ -3,6 +3,7 @@ #include "entity.h" #include "textbox.h" #include "player.h" +#include "npc.h" #include "functions.h" void sub_08065A64(Entity* this); @@ -44,7 +45,7 @@ void sub_08065A10(Entity* this) { } void sub_08065A34(Entity* this) { - if (UpdateFuseInteraction() != 0) { + if (UpdateFuseInteraction(this) != 0) { this->action = 1; InitAnimationForceUpdate(this, this->animationState / 2); } diff --git a/src/npc/ezloCap.c b/src/npc/ezloCap.c new file mode 100644 index 00000000..a7b5593e --- /dev/null +++ b/src/npc/ezloCap.c @@ -0,0 +1,340 @@ +#include "global.h" +#include "entity.h" +#include "functions.h" +#include "flags.h" +#include "save.h" +#include "script.h" + +extern Hitbox gUnk_080FD170; +extern void script_08016030; // Cutscene data type? +extern void script_0801606C; // Cutscene data type? + +extern void sub_0809623C(Entity*); +extern void sub_08096260(Entity*); + +const u8 gUnk_08114134[]; +const u8 gUnk_08114144[]; +const Hitbox gUnk_08114154; +const u8 gUnk_0811415C[]; +const ScreenTransitionData* const gUnk_081141A4[]; +const u8 gUnk_081141E4[]; +const u16 gUnk_081141F4[]; + +typedef struct { + u32 unk_00; + s8 unk_04; +} gUnk_0810C89C_struct; + +extern void sub_08078850(Entity*, u32, u8 /* TODO this is a s8 in beedle.c*/, gUnk_0810C89C_struct*); + +// Ezlo as a cap in the Minish Woods, is destroyed as soon as link wears ezlo +void EzloCap(Entity* this) { + if (this->action == 0) { + this->action += 1; + sub_0805E3A0(this, 2); + sub_0807DD50(this); + } + ExecuteScriptForEntity(this, NULL); + HandleEntity0x82Actions(this); + UpdateAnimationSingleFrame(this); +} + +void sub_0806D8A0(Entity* this, ScriptExecutionContext* context) { + s32 xOffset; + s32 yOffset; + + context->unk_19 = 8; + context->postScriptActions |= 2; + context->condition = 0; + xOffset = 16; + if (this->spriteSettings.b.flipX) { + xOffset = -xOffset; + } + xOffset += gPlayerEntity.x.HALF.HI; + yOffset = gPlayerEntity.y.HALF.HI + 2; + context->x.HALF.HI = xOffset; + context->y.HALF.HI = yOffset; + + xOffset -= this->x.HALF.HI; + this->direction = sub_080045DA(xOffset, yOffset - this->y.HALF.HI); + this->animationState = (this->animationState & 0x80) | gUnk_08114134[this->direction >> 4]; +} + +void sub_0806D908(Entity* this) { + this->direction = sub_080045D4(this->x.HALF.HI, this->y.HALF.HI, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI); + this->animationState = (this->animationState & 0x80) | gUnk_08114144[this->direction >> 0x1]; +} + +// called when talk to ezlo, also when ezlo moves after you +void sub_0806D944(Entity* this) { + this->spriteSettings.b.flipX = 0; + if (this->x.WORD <= gPlayerEntity.x.WORD) { + this->spriteSettings.b.flipX = 1; + } +} + +// Ezlo Angry FX +void sub_0806D96C(Entity* this) { + Entity* fx = CreateFx(this, 0x42, 0); + if (fx != NULL) { + fx->spritePriority.b0 = 1; + PositionRelative(this, fx, 0, 0xFFE80000); + } +} + +void sub_0806D9A4(Entity* this) { + if (this->x.WORD <= gPlayerEntity.x.WORD) { + gPlayerEntity.spriteSettings.b.flipX = 0; + } else { + gPlayerEntity.spriteSettings.b.flipX = 1; + } + gPlayerEntity.animationState = 4; +} + +// NPC4E is created when link enters minish woods for the first time and +// destroyed once he wears ezlo. Also exists when entering hyrule for the second time +// and fusing kinstones. Is destroyed as soon as the kinstone is fused. +void NPC4E(Entity* this) { + if (this->action == 0) { + this->action = 1; + this->spriteSettings.b.draw = 4; + this->hitbox = &gUnk_080FD170; + sub_0807DD50(this); + } else { + sub_0807DD94(this, 0); + } +} + +void sub_0806DA04(Entity* this, ScriptExecutionContext* context) { + // TODO gUnk_0811415C should be a gUnk_0810C89C_struct[], but then a lot of bytes everywhere are wrong? + gUnk_0810C89C_struct* a = (gUnk_0810C89C_struct*)&( + (gUnk_0810C89C_struct*)gUnk_0811415C)[context->intVariable]; // cast necessary to no longer make it a const* ? + sub_08078850(this, 1, a->unk_04, a); +} + +void sub_0806DA1C(Entity* this, ScriptExecutionContext* context) { + sub_0808091C((ScreenTransitionData*)(gUnk_081141A4)[context->intVariable], + (u32)(gUnk_081141E4[context->intVariable])); +} + +// Returns the kinstone id? +u8 sub_0806DA3C(Entity* this) { + u32 result; + + switch (this->type) { + default: + result = 0; + break; + case 1: + result = 1; + break; + case 2: + result = 2; + break; + case 3: + result = 3; + break; + case 4: + result = 4; + break; + case 5: + result = 5; + break; + case 11: + result = 9; + break; + case 6: + case 7: + case 8: + case 9: + case 10: + result = sub_0801E99C(this); + break; + } + return result; +} + +// Check whether a kinstone fusion is possible and store the result somewhere in param_2? +void sub_0806DAAC(Entity* this, ScriptExecutionContext* context) { + context->condition = CheckKinstoneFused(sub_0806DA3C(this)); + gActiveScriptInfo.flags |= 1; +} + +// maybe actually execute the kinstone fusion? +void sub_0806DAD0(Entity* this) { + sub_08078790(this, sub_0806DA3C(this)); +} + +void sub_0806DAE8(Entity* this) { + switch (this->type - 1) { + case 0: + SetLocalFlag(0xee); + break; + case 1: + SetLocalFlag(0xef); + break; + case 2: + SetLocalFlag(0xf0); + break; + case 3: + SetLocalFlag(0xf1); + break; + case 4: + SetLocalFlag(0xf2); + break; + } + + SoundReq(0xcd); +} + +void sub_0806DB44(Entity* this, ScriptExecutionContext* context) { + context->condition = 0; + + if (CheckLocalFlag(0xee) != 0 && CheckLocalFlag(0xef) != 0 && CheckLocalFlag(0xf0) != 0 && + CheckLocalFlag(0xf1) != 0 && CheckLocalFlag(0xf2) != 0) { + context->condition = 1; + } +} + +void sub_0806DB84(Entity* this, ScriptExecutionContext* context) { + Entity* ent; + this->hitbox = (Hitbox*)&gUnk_08114154; + ent = CreateObject(0x3e, 4, 0); + if (ent != NULL) { + PositionRelative(this, ent, -0x80000, 0); + *(ScriptExecutionContext**)&ent->cutsceneBeh = StartCutscene(ent, &script_08016030); + } + ent = CreateObject(0x3e, 5, 0); + if (ent != NULL) { + PositionRelative(this, ent, 0x80000, 0); + *(ScriptExecutionContext**)&ent->cutsceneBeh = StartCutscene(ent, &script_0801606C); + } +} + +u32 sub_0806DBF4(u32 param_1) { + switch (param_1) { + case 1: + case 2: + case 3: + case 4: + case 6: + param_1 = 1; + if (GetInventoryValue(2) != 0) { + param_1 = 2; + } + if (GetInventoryValue(3) != 0) { + param_1 = 3; + } + if (GetInventoryValue(4) != 0) { + param_1 = 4; + } + if (GetInventoryValue(6) != 0) { + param_1 = 6; + } + break; + } + return param_1; +} + +void sub_0806DC3C(Entity* this) { + this->field_0x68.HALF.LO = gSave.stats.itemOnA; + this->field_0x68.HALF.HI = gSave.stats.itemOnB; +} + +void sub_0806DC58(Entity* this) { + ForceEquipItem(sub_0806DBF4(this->field_0x68.HALF.LO), 0); + ForceEquipItem(sub_0806DBF4(this->field_0x68.HALF.HI), 1); +} + +void sub_0806DC7C() { + const u16* tiles = gUnk_081141F4; + while (*tiles != 0) { + u32 tile = *tiles; + tiles = tiles + 1; + SetTileType(0x4072, tile, 1); + } +} + +void sub_0806DCA0() { + u16 uVar1; + const u16* tiles = gUnk_081141F4; + while (*tiles != 0) { + u32 tile = *tiles; + tiles = tiles + 1; + sub_0807BA8C(tile, 1); + } +} + +void sub_0806DCC0() { + gScreenTransition.field_0x20 = 0x7c8; + gScreenTransition.field_0x22 = 0xf8; +} + +void NPC4E_Fusion(Entity* this) { + if (this->action == 0) { + this->action += 1; + switch (this->type) { + case 1: + case 2: + case 3: + case 4: + case 5: + sub_0809623C(this); + break; + case 6: + case 7: + case 8: + case 9: + case 10: + sub_08096260(this); + break; + case 11: + sub_0806DB84(this, 0); + this->hitbox = NULL; + break; + } + } +} + +// animation states +const u8 gUnk_08114134[] = { 0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x03, 0x04, + 0x04, 0x05, 0x05, 0x06, 0x06, 0x07, 0x07, 0x00 }; + +// animation states +const u8 gUnk_08114144[] = { 0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x03, 0x04, + 0x04, 0x05, 0x05, 0x06, 0x06, 0x07, 0x07, 0x00 }; + +const Hitbox gUnk_08114154 = { 0, -8, 0, 0, 0, 0, 24, 8 }; + +const u8 gUnk_0811415C[] = { 0x00, 0x00, 0x08, 0x08, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x0e, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x10, 0x04, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x0a, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0a, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x04, 0x0e, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x04, 0x0e, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x18, 0x08, + 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x08, 0x0e, 0x00, 0x00, 0x00 }; +extern ScreenTransitionData gUnk_0813AB6C; +extern ScreenTransitionData gUnk_0813ABBC; +extern ScreenTransitionData gUnk_0813ABE4; +extern ScreenTransitionData gUnk_0813ABF8; +extern ScreenTransitionData gUnk_0813AC0C; +extern ScreenTransitionData gUnk_0813AC20; +extern ScreenTransitionData gUnk_0813AC5C; +extern ScreenTransitionData gUnk_0813AC70; +extern ScreenTransitionData gUnk_0813AC84; +extern ScreenTransitionData gUnk_0813AC98; +extern ScreenTransitionData gUnk_0813ACAC; +extern ScreenTransitionData gUnk_0813ACC0; +extern ScreenTransitionData gUnk_0813ACD4; +extern ScreenTransitionData gUnk_0813ACE8; +extern ScreenTransitionData gUnk_0813ACFC; +// Array of pointers to ScreenTransitionData +const ScreenTransitionData* const gUnk_081141A4[] = { &gUnk_0813AB6C, &gUnk_0813ABBC, &gUnk_0813ABE4, &gUnk_0813ABF8, + &gUnk_0813AC0C, &gUnk_0813AC20, &gUnk_0813AC5C, &gUnk_0813AC70, + &gUnk_0813AC84, &gUnk_0813AC98, &gUnk_0813ACAC, &gUnk_0813ACC0, + &gUnk_0813ACD4, &gUnk_0813ACE8, &gUnk_0813AC5C, &gUnk_0813ACFC }; + +// param_2 for the call to sub_0808091C, same indices as gUnk_081141A4 +const u8 gUnk_081141E4[] = { 0x02, 0x02, 0x04, 0x04, 0x02, 0x02, 0x09, 0x02, + 0x02, 0x04, 0x02, 0x04, 0x04, 0x04, 0x04, 0x02 }; + +// tiles that are changed? +const u16 gUnk_081141F4[] = { 0x047a, 0x047b, 0x05af, 0x05ef, 0x0738, 0x0739, 0x073a, 0x073b, 0x0000, 0x0000 }; diff --git a/src/npc/festari.c b/src/npc/festari.c index ad1635bd..e7bb336d 100644 --- a/src/npc/festari.c +++ b/src/npc/festari.c @@ -5,10 +5,6 @@ #include "player.h" #include "script.h" -extern u32 sub_0801E99C(Entity*); -extern void sub_08078784(Entity*, u32); -extern void sub_0807DD50(Entity*); -extern void sub_0806F118(Entity*); extern void sub_0805FF2C(Entity*, void*); extern void (*const gUnk_08109BBC[])(Entity*); @@ -38,7 +34,7 @@ void sub_0805FE48(Entity* this) { InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity))); sub_0806F118(this); } else { - ExecuteScriptCommandSet(this, *(ScriptExecutionContext**)&this->cutsceneBeh); + ExecuteScript(this, *(ScriptExecutionContext**)&this->cutsceneBeh); sub_0805FF2C(this, *(void**)&this->cutsceneBeh); uVar4 = this->field_0x80.HWORD; if (uVar4 < 8) { diff --git a/src/npc/forestMinish.c b/src/npc/forestMinish.c index ce829a81..e42500e8 100644 --- a/src/npc/forestMinish.c +++ b/src/npc/forestMinish.c @@ -4,24 +4,16 @@ #include "flags.h" #include "textbox.h" #include "player.h" -#include "structures.h" -#include "functions.h" #include "save.h" #include "script.h" +#include "random.h" +#include "createObject.h" +#include "structures.h" +#include "functions.h" -extern void sub_0807DD50(Entity*); -extern void sub_0806F118(Entity*); -extern void sub_0807DDE4(Entity*); extern void sub_080600F0(Entity*); extern s32 sub_0806EDD8(Entity*, u32, u32); -extern u32 sub_0806F5B0(u32); -extern u32 sub_0801E99C(Entity*); -extern void sub_08078784(Entity*, u32); -extern void sub_0807000C(Entity*); extern void sub_08060158(Entity*); -extern u32 CheckKinstoneFused(u32); -extern Entity* FindEntityInListBySubtype(u32, u32, u32); -extern void DeleteEntity(Entity*); extern void ModBombs(s32); extern SpriteLoadData gUnk_0810A348; @@ -51,8 +43,8 @@ void ForestMinish(Entity* this) { this->interactType = 0; sub_0806F118(this); } else { - sub_0807DDAC(this, NULL); - sub_0807DDE4(this); + ExecuteScriptForEntity(this, NULL); + HandleEntity0x82Actions(this); if (this->frameDuration != 0xf0) { sub_080600F0(this); } @@ -224,8 +216,8 @@ void sub_080602BC(Entity* this) { TextboxNoOverlap(gUnk_0810A362[index], this); } -void sub_0806030C(Entity* this, u32* arg1) { - ModBombs(*(arg1 + 1)); +void sub_0806030C(Entity* this, ScriptExecutionContext* context) { + ModBombs(context->intVariable); } void sub_08060318(void) { @@ -233,7 +225,7 @@ void sub_08060318(void) { int i; for (i = 2; i >= 0; i--) { - ent = FindEntityInListBySubtype(8, 2, 2); + ent = FindEntityByID(8, 2, 2); if (ent != NULL) { CreateDust(ent); DeleteEntity(ent); diff --git a/src/npc/gentari.c b/src/npc/gentari.c index b7387777..cc086d8a 100644 --- a/src/npc/gentari.c +++ b/src/npc/gentari.c @@ -2,14 +2,8 @@ #include "entity.h" #include "npc.h" #include "player.h" - -extern void sub_0805E3A0(Entity*, u32); -extern u32 sub_0801E99C(Entity*); -extern void sub_08078784(Entity*, u32); -extern void sub_0807DD50(Entity*); -extern u32 sub_0806F5A4(u32); -extern void sub_0806F118(Entity*); -extern void sub_0807DD94(Entity*, u32); +#include "script.h" +#include "functions.h" void Gentari(Entity* this) { switch (this->action) { diff --git a/src/npc/goron.c b/src/npc/goron.c index 0203969c..46a6e940 100644 --- a/src/npc/goron.c +++ b/src/npc/goron.c @@ -97,9 +97,9 @@ u32 sub_08069480(Entity* this) { return (sub_0801E99C(this) << 24) >> 24; } -void sub_0806948C(Entity* this, u32* param_1) { - param_1[5] = CheckKinstoneFused((sub_08069480(this) << 24) >> 24); - gUnk_02033280.unk_07 |= 1; +void sub_0806948C(Entity* this, ScriptExecutionContext* context) { + context->condition = CheckKinstoneFused((sub_08069480(this) << 24) >> 24); + gActiveScriptInfo.flags |= 1; } void sub_080694B0(Entity* this) { diff --git a/src/npc/goronMerchant.c b/src/npc/goronMerchant.c index 9fd402c5..5329bd15 100644 --- a/src/npc/goronMerchant.c +++ b/src/npc/goronMerchant.c @@ -84,12 +84,12 @@ void sub_08069660(Entity* this) { void sub_08069684(void) { Manager* mgr; - if (FindEntityInListBySubtype(9, 0x31, 8) == NULL) { + if (FindEntityByID(9, 0x31, 8) == NULL) { mgr = GetEmptyManager(); if (mgr != NULL) { mgr->type = 9; mgr->subtype = 0x31; - AppendEntityToList(mgr, 8); + AppendEntityToList((Entity*)mgr, 8); } } } diff --git a/src/npc/guard.c b/src/npc/guard.c index 782253ee..d94827c4 100644 --- a/src/npc/guard.c +++ b/src/npc/guard.c @@ -4,36 +4,24 @@ #include "flags.h" #include "textbox.h" #include "room.h" +#include "script.h" +#include "structures.h" +#include "functions.h" typedef struct { u32 unk; u32 entityCount; } struct_03003DB8; -typedef struct { - u8 filler[8]; - u8 unk; -} ScreenTransition; - typedef struct { u32 unk; u32 unk2; } struct_08064050; extern void sub_08063D24(Entity*); -extern void sub_0806ED78(Entity*); -extern u32 GetFacingDirection(Entity*, Entity*); -extern u32 sub_0806F5A4(u32); extern void sub_0806EE20(Entity*); extern void sub_08064428(Entity*); -extern u32 sub_0805ACC0(Entity*); -extern void sub_0807DDAC(Entity*, u32); -extern void sub_0807DDE4(Entity*); -extern void sub_0807000C(Entity*); extern void sub_0806EE04(Entity*, void*, u32); -extern Entity* sub_080A7EE0(int); -extern void sub_08078778(Entity*); -extern void sub_0807DD64(Entity*); void sub_08063DC8(Entity*); void sub_08063F20(Entity*); @@ -160,8 +148,8 @@ void sub_08063E90(Entity* this) { } void sub_08063F20(Entity* this) { - sub_0807DDAC(this, 0); - sub_0807DDE4(this); + ExecuteScriptForEntity(this, 0); + HandleEntity0x82Actions(this); GetNextFrame(this); if (this->interactType != 0) { this->action++; @@ -220,21 +208,19 @@ void sub_08064030(Entity* arg0, Entity* arg1) { } void sub_08064044(void) { - gScreenTransition.unk = 1; + gScreenTransition.transitioningOut = 1; } -void sub_08064050(Entity* arg0, struct_08064050* arg1) { - u32 unk; - - arg1->unk2 = 0; - switch (arg0->type2) { +void sub_08064050(Entity* this, ScriptExecutionContext* context) { + context->intVariable = 0; + switch (this->type2) { case 0x11: - arg1->unk2 = 1; + context->intVariable = 1; break; case 0x12: - arg1->unk2 = 2; + context->intVariable = 2; break; case 0x13: - arg1->unk2 = 3; + context->intVariable = 3; } } diff --git a/src/npc/librari.c b/src/npc/librari.c index 9db202b7..ce6fbefc 100644 --- a/src/npc/librari.c +++ b/src/npc/librari.c @@ -25,8 +25,8 @@ void Librari(Entity* this) { this->interactType = 0; sub_0806F118(this); } else { - sub_0807DDAC(this, NULL); - sub_0807DDE4(this); + ExecuteScriptForEntity(this, NULL); + HandleEntity0x82Actions(this); UpdateAnimationSingleFrame(this); } break; @@ -37,15 +37,15 @@ void Librari(Entity* this) { } } -void sub_0806B260(Entity* this, u32 arg1) { +void sub_0806B260(Entity* this, ScriptExecutionContext* context) { u32 index; - *(u32*)(arg1 + 0x14) = 0; + context->condition = 0; // flippers if (!GetInventoryValue(0x46)) { if (CheckGlobalFlag(0x29)) { index = 2; - *(u32*)(arg1 + 0x14) = 1; + context->condition = 1; } else if (!CheckLocalFlag(0x7a)) { index = 0; SetLocalFlag(0x7a); @@ -60,7 +60,7 @@ void sub_0806B260(Entity* this, u32 arg1) { extern u16 gUnk_08112D50[]; -void sub_0806b2b4(Entity* this) { +void sub_0806B2B4(Entity* this) { u32 index; if (CheckLocalFlag(0xb3)) { diff --git a/src/npc/mailbox.c b/src/npc/mailbox.c index 6ccdd0a8..bab9a8ba 100644 --- a/src/npc/mailbox.c +++ b/src/npc/mailbox.c @@ -1,8 +1,8 @@ #include "global.h" #include "entity.h" #include "textbox.h" +#include "functions.h" -extern void sub_0806ED78(Entity*); extern void sub_08063280(); extern void (*gMailboxBehaviors[4])(Entity*); diff --git a/src/npc/malon.c b/src/npc/malon.c index ca6d6eab..64febefe 100644 --- a/src/npc/malon.c +++ b/src/npc/malon.c @@ -1,9 +1,8 @@ #include "global.h" -#include "functions.h" #include "entity.h" #include "script.h" - -extern Entity gPlayerEntity; +#include "npc.h" +#include "functions.h" extern void (*gUnk_0810FF5C[])(Entity* this); extern void (*gUnk_0810FF64[])(Entity* this); @@ -58,12 +57,12 @@ void sub_08065900(Entity* this) { void sub_08065914(Entity* this) { Entity* target; - target = FindEntityInListBySubtype(7, 0x1F, 7); + target = FindEntityByID(7, 0x1F, 7); if (target != NULL) { PositionRelative(this, target, 0x180000, -0x10000); target->parent = this; } - target = FindEntityInListBySubtype(7, 0x20, 7); + target = FindEntityByID(7, 0x20, 7); if (target != NULL) { PositionRelative(this, target, 0x280000, 0); target->parent = this; diff --git a/src/npc/mayorHagen.c b/src/npc/mayorHagen.c index df7366dd..ae5f1e0e 100644 --- a/src/npc/mayorHagen.c +++ b/src/npc/mayorHagen.c @@ -1,27 +1,16 @@ #include "global.h" #include "entity.h" #include "player.h" -#include "room.h" #include "flags.h" -#include "sprite.h" -#include "textbox.h" #include "npc.h" #include "structures.h" #include "functions.h" #include "save.h" #include "script.h" -extern void sub_0807DD50(Entity*); -extern u32 sub_0806F5A4(u32); -extern void sub_0806F118(Entity*); -extern void sub_08078784(Entity*, u32); -extern void sub_0807DDE4(Entity*); extern void sub_08078850(); extern u32 gUnk_08113F44; extern Dialog gUnk_08113F48[]; -extern u32 GetInventoryValue(u32); -extern u32 CheckLocalFlag(u32); -extern void SetLocalFlag(); void MayorHagen(Entity* this) { u32 v; @@ -43,8 +32,8 @@ void MayorHagen(Entity* this) { sub_0806F118(this); break; } - sub_0807DDAC(this, NULL); - sub_0807DDE4(this); + ExecuteScriptForEntity(this, NULL); + HandleEntity0x82Actions(this); UpdateAnimationSingleFrame(this); break; case 2: diff --git a/src/npc/melari.c b/src/npc/melari.c index 38bc4e54..a62b837b 100644 --- a/src/npc/melari.c +++ b/src/npc/melari.c @@ -2,22 +2,12 @@ #include "entity.h" #include "npc.h" #include "textbox.h" -#include "functions.h" #include "script.h" +#include "random.h" +#include "functions.h" extern void sub_08068780(Entity*); -extern void sub_08078778(Entity*); -extern void sub_0807DD50(Entity*); -extern void sub_0806F118(Entity*); -extern void sub_0807DDE4(Entity*); -extern u32 sub_080040A8(Entity*); -extern void EnqueueSFX(u32); -extern u32 sub_0801E99C(Entity*); -extern void sub_08078784(Entity*, u32); -extern void sub_0807000C(Entity*); extern s32 sub_0806EDD8(Entity*, u32, u32); -extern void sub_080A7C18(u32, u32, u32); -extern void sub_0807CAA0(u32, u32); extern void (*const gUnk_08111530[])(Entity*); @@ -82,8 +72,8 @@ void sub_08068780(Entity* this) { this->interactType = 0; sub_0806F118(this); } else { - sub_0807DDAC(this, NULL); - sub_0807DDE4(this); + ExecuteScriptForEntity(this, NULL); + HandleEntity0x82Actions(this); GetNextFrame(this); } break; diff --git a/src/npc/milkCart.c b/src/npc/milkCart.c index b423dca7..29481848 100644 --- a/src/npc/milkCart.c +++ b/src/npc/milkCart.c @@ -1,7 +1,6 @@ #include "global.h" #include "entity.h" - -extern void sub_0806ED78(); +#include "functions.h" extern void (*gMilkCartBehaviors[2])(Entity*); diff --git a/src/npc/moblinLady.c b/src/npc/moblinLady.c index 640c09d9..d63d4d87 100644 --- a/src/npc/moblinLady.c +++ b/src/npc/moblinLady.c @@ -1,13 +1,7 @@ #include "global.h" #include "entity.h" -#include "player.h" -#include "room.h" -#include "flags.h" -#include "sprite.h" -#include "textbox.h" #include "npc.h" -extern void sub_0807DD50(); -extern void sub_0807DD94(); +#include "script.h" void MoblinLady(Entity* this) { if (this->action == 0) { diff --git a/src/npc/mutoh.c b/src/npc/mutoh.c index 998a54a6..5391ac8d 100644 --- a/src/npc/mutoh.c +++ b/src/npc/mutoh.c @@ -9,15 +9,6 @@ #include "save.h" #include "script.h" -extern void sub_0807DD50(Entity*); -extern u32 GetFacingDirection(Entity*, Entity*); -extern u32 sub_0806F5A4(u32); -extern void sub_0806F118(Entity*); -extern u32 UpdateFuseInteraction(Entity*); -extern void sub_0807000C(Entity*); -extern u32 sub_0801E99C(Entity*); -extern void sub_08078784(Entity*, u32); - extern SpriteLoadData gUnk_08110C00; extern u16 gUnk_08110C0C[]; extern Dialog gUnk_08110C10[]; diff --git a/src/npc/npc9.c b/src/npc/npc9.c index 47cc501b..23a0bd3e 100644 --- a/src/npc/npc9.c +++ b/src/npc/npc9.c @@ -1,11 +1,7 @@ #include "global.h" #include "entity.h" #include "textbox.h" - -extern void sub_08078778(Entity*); -extern void sub_0805E47C(Entity*); -extern void sub_0806ED78(Entity*); -extern void sub_0805E584(Entity*); +#include "functions.h" extern void (*const gUnk_0810C290[])(Entity*); diff --git a/src/npc/percy.c b/src/npc/percy.c index a2a8fcd8..3c5c8a01 100644 --- a/src/npc/percy.c +++ b/src/npc/percy.c @@ -10,7 +10,6 @@ extern void sub_0806B41C(Entity*); extern void sub_0806B3CC(Entity*); extern u32 sub_08002632(Entity*); -extern void sub_0801DFB4(Entity*, u32, u32, u32); extern u16* gUnk_08001A7C[40]; extern u16 gUnk_08112E54[4]; diff --git a/src/npc/postman.c b/src/npc/postman.c index 532f129f..34694306 100644 --- a/src/npc/postman.c +++ b/src/npc/postman.c @@ -10,23 +10,11 @@ #include "script.h" extern void sub_08060528(Entity*); -extern void* GetCurrentRoomProperty(u32); extern void sub_0806EE04(Entity*, void*, u32); extern void sub_080604DC(Entity*); -extern s32 sub_0806ED9C(Entity*, u32, u32); extern void sub_0806EE20(Entity*); -extern u32 sub_080040A8(Entity*); -extern u32 sub_0801E99C(Entity*); -extern void sub_0807DD50(Entity*); -extern void sub_0806F118(Entity*); -extern u32 sub_0806F5A4(u32); -extern u32 GetFacingDirection(Entity*, Entity*); extern void sub_080606D8(Entity*); -extern void sub_080788E0(Entity*); -extern void EnqueueSFX(u32); extern void sub_080606C0(Entity*); -extern void sub_0800451C(Entity*); -extern void sub_08078784(Entity*, u32); typedef struct { s16 x; @@ -52,7 +40,7 @@ void sub_08060428(Entity* this) { void* data; this->actionDelay = 0x5a; - this->nonPlanarMovement = 0x180; + this->speed = 0x180; if (this->type2 != 0) { data = GetCurrentRoomProperty(this->type2); } else { @@ -207,7 +195,7 @@ void sub_08060700(Entity* entity, ScriptExecutionContext* context) { u32 x = coords->x + gRoomControls.roomOriginX; u32 y = coords->y + gRoomControls.roomOriginY; sub_0807DEDC(entity, context, x, y); - gUnk_02033280.unk_07 |= 1; + gActiveScriptInfo.flags |= 1; } void sub_0806075C(Entity* this) { diff --git a/src/npc/rem.c b/src/npc/rem.c index a0b87267..a6059865 100644 --- a/src/npc/rem.c +++ b/src/npc/rem.c @@ -3,14 +3,12 @@ #include "entity.h" #include "script.h" -extern void sub_0807DDE4(Entity*); -extern void SoundReq(u32); extern void sub_0806A8C8(Entity*); extern void (*gUnk_08112260[])(Entity*); extern void (*gUnk_08112278[])(Entity*); -extern void gUnk_08012F0C; +extern void script_08012F0C; void Rem(Entity* this) { gUnk_08112260[this->type](this); @@ -20,8 +18,8 @@ void sub_0806a370(Entity* this) { u8* pbVar1; gUnk_08112278[this->action](this); - sub_0807DDAC(this, NULL); - sub_0807DDE4(this); + ExecuteScriptForEntity(this, NULL); + HandleEntity0x82Actions(this); UpdateAnimationSingleFrame(this); sub_0806ED78(this); if (this->animIndex == 0xf) { @@ -44,7 +42,7 @@ void sub_0806A3D8(Entity* this) { this->actionDelay = 0xb4; sub_0805E3A0(this, 2); sub_0806A8C8(this); - uVar1 = StartCutscene(this, &gUnk_08012F0C); + uVar1 = StartCutscene(this, &script_08012F0C); *(ScriptExecutionContext**)&this->cutsceneBeh = uVar1; sub_0807DD94(this, NULL); } diff --git a/src/npc/simon.c b/src/npc/simon.c index 65270b80..20cb40e5 100644 --- a/src/npc/simon.c +++ b/src/npc/simon.c @@ -12,9 +12,6 @@ typedef struct { } struct_0806C2A0; extern void DoExitTransition(void*); -extern void SetTileType(u32, u32, u32); -extern void DoExitTransition(void*); -extern void DoFade(u32, u32); extern void gUnk_0813AD60; extern void gUnk_0813AD74; @@ -45,8 +42,8 @@ void sub_0806C280(void) { gScreenTransition.transitionType = 6; } -void sub_0806C2A0(u32* param_1, struct_0806C2A0* param_2) { - switch (param_2->unk) { +void sub_0806C2A0(Entity* this, ScriptExecutionContext* context) { + switch (context->intVariable) { case 0: DoFade(0xd, 4); break; diff --git a/src/npc/smith.c b/src/npc/smith.c index 3502d8bf..6b55c1f7 100644 --- a/src/npc/smith.c +++ b/src/npc/smith.c @@ -1,23 +1,13 @@ #include "global.h" #include "entity.h" #include "textbox.h" -#include "functions.h" #include "save.h" #include "script.h" +#include "random.h" +#include "npc.h" +#include "functions.h" -extern u32 GetFacingDirection(Entity*, Entity*); -extern u32 sub_0806F5A4(u32); -extern void sub_0806F118(Entity*); -extern Entity* CreateFx(Entity*, u32, u32); -extern void SoundReq(u32); -extern void sub_0807000C(Entity*); -extern u32 sub_0801E99C(Entity*); -extern void sub_0807DD50(Entity*); -extern void sub_0807DDE4(Entity*); -extern u32 UpdateFuseInteraction(Entity*); -extern u32 GetAnimationState(Entity*); -extern void sub_08078850(u32, u32, u32, u32*); -extern void sub_08078784(Entity*, u32); +extern void sub_08078850(Entity*, u32, u32, u32*); extern void (*const gUnk_08110360[])(Entity*); extern void (*const gUnk_0811036C[])(Entity*); @@ -135,8 +125,8 @@ void sub_080661BC(Entity* this) { } void sub_08066200(Entity* this) { - sub_0807DDAC(this, NULL); - sub_0807DDE4(this); + ExecuteScriptForEntity(this, NULL); + HandleEntity0x82Actions(this); UpdateAnimationSingleFrame(this); } @@ -164,12 +154,12 @@ void sub_08066258(void) { SoundReq(gUnk_081103D0[Random() & 7]); } -void sub_08066274(u32 arg0) { - sub_08078850(arg0, 1, 0, &gUnk_081103E0); +void sub_08066274(Entity* this) { + sub_08078850(this, 1, 0, &gUnk_081103E0); } -void sub_08066288(Entity* arg0) { - sub_08078784(arg0, arg0->field_0x68.HALF.LO); +void sub_08066288(Entity* this) { + sub_08078784(this, this->field_0x68.HALF.LO); } void Smith_Fusion(Entity* this) { diff --git a/src/npc/stamp.c b/src/npc/stamp.c index a30d31ad..51b209b3 100644 --- a/src/npc/stamp.c +++ b/src/npc/stamp.c @@ -4,13 +4,7 @@ #include "functions.h" #include "script.h" -extern void sub_08078778(Entity*); -extern void sub_0805E47C(Entity*); -extern void sub_0805E584(); -extern void sub_0807DD64(); extern void sub_08062CA4(); -extern void sub_0807DDE4(); -extern u32 CheckKinstoneFused(); extern void (*gStampBehaviors1[4])(Entity*); extern void (*gStampBehaviors2[2])(Entity*); @@ -68,15 +62,13 @@ void sub_08062C7C(Entity* ent) { } void sub_08062CA4(Entity* ent) { - sub_0807DDAC(ent, NULL); - sub_0807DDE4(ent); + ExecuteScriptForEntity(ent, NULL); + HandleEntity0x82Actions(ent); GetNextFrame(ent); } void sub_08062CBC(Entity* ent) { - u32 uVar1; - - uVar1 = CheckKinstoneFused(44); + u32 uVar1 = CheckKinstoneFused(44); ShowNPCDialogue(ent, &gUnk_0810C2E4[(-uVar1 | uVar1) >> 31]); } diff --git a/src/npc/syrup.c b/src/npc/syrup.c index 307c75bd..f3a1b5dc 100644 --- a/src/npc/syrup.c +++ b/src/npc/syrup.c @@ -1,19 +1,15 @@ #include "global.h" #include "entity.h" #include "npc.h" - -extern void sub_0807DD50(Entity*); -extern void sub_0806ED78(Entity*); -extern void sub_0805E3A0(Entity*, u32); +#include "script.h" +#include "functions.h" extern void (*gUnk_081121D4[])(Entity*); extern SpriteLoadData gUnk_081121C4; extern SpriteLoadData gUnk_081121B4; -extern u32 gScreenTransition; -extern void sub_0807DD94(Entity*, u32); + extern void sub_0806A26C(Entity*); -extern void sub_080042BA(Entity*, u32); void Syrup(Entity* this) { gUnk_081121D4[this->action](this); @@ -38,7 +34,7 @@ void sub_0806A1F8(Entity* this) { void sub_0806A234(Entity* this) { sub_0807DD94(this, 0); if ((this->field_0x82.HWORD & 4) != 0) { - if ((gScreenTransition & 7) == 0) { + if ((gScreenTransition.frameCount & 7) == 0) { sub_0806A26C(this); } sub_080042BA(this, 2); @@ -56,8 +52,8 @@ void sub_0806A26C(Entity* this) { if (uVar2 = Random(), uVar2) { unk = -unk; // wtf?! } - pEVar1->spriteOffsetX = gUnk_081121DC[uVar2 & 7]; - pEVar1->spriteOffsetY = gUnk_081121DC[(uVar2 / 256) & 7] - 8; + pEVar1->spriteOffsetX = gUnk_081121D4[uVar2 & 7]; + pEVar1->spriteOffsetY = gUnk_081121D4[(uVar2 / 256) & 7] - 8; } } #else diff --git a/src/npc/talon.c b/src/npc/talon.c index 24380fc9..f9c7d66f 100644 --- a/src/npc/talon.c +++ b/src/npc/talon.c @@ -1,14 +1,16 @@ #include "global.h" #include "entity.h" #include "textbox.h" -#include "functions.h" #include "player.h" #include "script.h" +#include "npc.h" +#include "random.h" +#include "functions.h" extern void (*gUnk_0810FEC4[])(Entity* this); extern void (*gUnk_0810FEBC[])(Entity* this); extern SpriteLoadData gUnk_0810FEB0; -extern u8 gUnk_0800B41C; +extern u8 script_0800B41C; extern u8 gUnk_0810FED8[]; void sub_0806574C(Entity* this); @@ -83,7 +85,7 @@ void sub_08065648(Entity* this) { } void sub_08065680(Entity* this) { - if (UpdateFuseInteraction() != 0) { + if (UpdateFuseInteraction(this) != 0) { this->action = this->field_0x68.HALF.HI; InitAnimationForceUpdate(this, this->field_0x6a.HALF.LO); } @@ -107,7 +109,7 @@ void sub_080656D4(Entity* this) { } else { if (this->interactType != 0) { if (GetInventoryValue(0x37) != 0) { // keyLonLon - StartCutscene(this, (u16*)&gUnk_0800B41C); + StartCutscene(this, (u16*)&script_0800B41C); goto label2; } else { this->field_0x68.HALF.HI = this->action; @@ -134,12 +136,12 @@ void sub_0806574C(Entity* this) { this->field_0x6a.HALF.LO = this->animIndex; } -void sub_08065780(Entity* this, u16* param_2) { +void sub_08065780(Entity* this, ScriptExecutionContext* context) { u32 rand; rand = Random(); this->animationState = rand & 6; - param_2[8] = gUnk_0810FED8[rand >> 8 & 7]; + context->wait = gUnk_0810FED8[rand >> 8 & 7]; } void Talon_Head(Entity* this) { diff --git a/src/npc/teachers.c b/src/npc/teachers.c index eaae979d..bf7e6983 100644 --- a/src/npc/teachers.c +++ b/src/npc/teachers.c @@ -1,18 +1,12 @@ #include "global.h" #include "entity.h" #include "player.h" -#include "functions.h" #include "save.h" #include "script.h" +#include "npc.h" +#include "functions.h" extern SpriteLoadData gUnk_08113910[]; -extern void sub_0807DD50(Entity*); -extern u32 GetFacingDirection(Entity*, Entity*); -extern u32 sub_0806F5A4(u32); -extern void sub_0806F118(Entity*); -extern void sub_08078784(Entity*, u32); -extern u32 UpdateFuseInteraction(Entity*); -extern void sub_0807000C(Entity*); extern Dialog gUnk_08113930[]; diff --git a/src/npc/townMinish.c b/src/npc/townMinish.c index 3f97b540..df2d8fe3 100644 --- a/src/npc/townMinish.c +++ b/src/npc/townMinish.c @@ -7,17 +7,12 @@ #include "save.h" #include "script.h" -extern void InitializeAnimation(Entity*, u32); -extern u32 LoadExtraSpriteData(Entity*, SpriteLoadData*); - extern u32 sub_080002C0(); extern void sub_0806ACC4(Entity*); extern void sub_0806AEA8(); extern void sub_0806AEE4(Entity*); -extern void sub_0806AFE8(Entity*, s32*); +extern void sub_0806AFE8(Entity*, ScriptExecutionContext*); extern s32 sub_0806EDD8(Entity*, u32, u32); -extern u32 sub_0806F5B0(u32); -extern void sub_08078784(Entity*, u32); extern void sub_08078850(Entity*, u32, u32, u32*); extern u8 gUnk_081125F4[12]; @@ -26,7 +21,7 @@ extern u32 gUnk_081126D4[4]; extern u8 gUnk_081126E4[4]; extern void (*gUnk_081126E8[])(); extern Dialog gUnk_081126F0[0x10]; -extern void (*gUnk_08112BF0[])(Entity*, s32*); +extern void (*gUnk_08112BF0[])(Entity*, ScriptExecutionContext*); extern u16 gUnk_08112C40[5]; extern u16 gUnk_08112C4A[3]; extern u16 gUnk_08112C50[6]; @@ -112,13 +107,13 @@ void sub_0806ACC4(Entity* this) { this->interactType = 0; sub_0806F118(this); } else { - sub_0807DDAC(this, NULL); + ExecuteScriptForEntity(this, NULL); sub_0806AEA8(this); if (this->type2 == 10 && this->interactType) { this->action = 2; this->interactType = 0; InitializeAnimation(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)) + 8); - sub_0806AFE8(this, *(s32**)&this->cutsceneBeh); + sub_0806AFE8(this, *(ScriptExecutionContext**)&this->cutsceneBeh); } if (this->type == 1) { u8 idx = gPlayerEntity.animationState >> 1; @@ -182,7 +177,7 @@ void sub_0806AEA8(Entity* this) { if (old & 0x20) { sub_08003FC4(this, 0x4000); } - sub_0807DDE4(this); + HandleEntity0x82Actions(this); this->field_0x82.HWORD = old; } @@ -223,25 +218,25 @@ void sub_0806AEE4(Entity* this) { } } -void sub_0806AF60(Entity* this, int* idx) { - InitializeAnimation(this, idx[1] + (this->animationState / 2)); +void sub_0806AF60(Entity* this, ScriptExecutionContext* context) { + InitializeAnimation(this, context->intVariable + (this->animationState / 2)); } -void sub_0806AF70(Entity* this, u32 arg1) { +void sub_0806AF70(Entity* this, ScriptExecutionContext* context) { this->field_0x20 = 0x24000; } -void sub_0806AF78(Entity* this, u32 arg1) { +void sub_0806AF78(Entity* this, ScriptExecutionContext* context) { sub_08003FC4(this, 0x1800); if (0 <= this->height.WORD && this->field_0x20 < 1) { this->height.WORD = 0; - sub_0806AF70(this, arg1); + sub_0806AF70(this, context); } } void sub_0806AFA0(Entity* this) { if (sub_0806ED78(this)) { - sub_0806F62C(this, -this->nonPlanarMovement, this->direction); + sub_0806F62C(this, -this->speed, this->direction); } } @@ -253,12 +248,12 @@ void sub_0806AFBC(Entity* this) { ShowNPCDialogue(this, gUnk_081126F0 + this->type2 * 8 + idx); } -void sub_0806AFE8(Entity* this, s32* unk) { - unk[5] = 0; - gUnk_08112BF0[this->type2](this, unk); +void sub_0806AFE8(Entity* this, ScriptExecutionContext* context) { + context->condition = 0; + gUnk_08112BF0[this->type2](this, context); } -void sub_0806B004(Entity* this, int* unk) { +void sub_0806B004(Entity* this, ScriptExecutionContext* context) { int idx = 0; if (CheckGlobalFlag(0x29)) { @@ -267,7 +262,7 @@ void sub_0806B004(Entity* this, int* unk) { idx = 3; if (CheckLocalFlag(0x78) == 0) { idx = 2; - unk[5] = 1; + context->condition = 1; SetLocalFlag(0x78); } } else { diff --git a/src/npc/townsperson.c b/src/npc/townsperson.c index dbc50909..fc99bac6 100644 --- a/src/npc/townsperson.c +++ b/src/npc/townsperson.c @@ -4,10 +4,11 @@ #include "player.h" #include "textbox.h" #include "flags.h" -#include "structures.h" -#include "functions.h" #include "save.h" #include "script.h" +#include "random.h" +#include "structures.h" +#include "functions.h" typedef struct { u8 frame1; @@ -16,27 +17,11 @@ typedef struct { u8 unk3; } struct_0810B680; -typedef struct { - u32 unk; - u32 unk2; -} struct_08061FB8; - extern void (*const gUnk_0810B774[])(Entity*); extern void (*const gUnk_0810B77C[])(Entity*); extern void sub_08061CB4(Entity*, u32); -extern u32 sub_0805ACC0(Entity*); -extern u32 sub_0801E99C(Entity*); -extern void sub_0807DD64(Entity*); extern void sub_08061D64(Entity*); -extern void sub_0806F118(Entity*); -extern u32 sub_0806F5A4(u32); -extern u32 GetFacingDirection(Entity*, Entity*); -extern void sub_0807DDE4(Entity*); extern void sub_08062048(Entity*); -extern void sub_08078784(Entity*, u32); -extern void sub_08078778(Entity*); -extern u32 sub_0806F5B0(u32); -extern void ResolveEntityOnTop(Entity*, Entity*); extern void sub_08078850(Entity*, u32, u8, u32*); extern SpriteLoadData* gUnk_0810B6EC[]; @@ -143,8 +128,8 @@ void sub_08061D64(Entity* this) { this->field_0x68.HALF.HI = this->animIndex; InitializeAnimation(this, (this->animIndex & -4) + sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity))); } else { - sub_0807DDAC(this, NULL); - sub_0807DDE4(this); + ExecuteScriptForEntity(this, NULL); + HandleEntity0x82Actions(this); if (this->frameDuration == 0xff) { this->frameDuration = gUnk_0810B680[this->type].unk2; } @@ -183,6 +168,7 @@ void sub_08061E70(Entity* this) { } } +// FIXME this is actually (Entity* this, ScriptExecutionContext* context) void sub_08061E90(Entity* this, Entity* arg1) { u32 animIndex; s32 iVar4; @@ -214,7 +200,7 @@ void sub_08061E90(Entity* this, Entity* arg1) { } this->direction = (u8)animIndex; this->animationState = sub_0806F5B0(animIndex); - this->nonPlanarMovement = gUnk_0810B74A[this->type]; + this->speed = gUnk_0810B74A[this->type]; } animIndex = (this->animationState >> 1) + 4; if (animIndex != this->animIndex) { @@ -241,7 +227,7 @@ void sub_08061E90(Entity* this, Entity* arg1) { arg1->spriteIndex = 1; } if (--arg1->spriteIndex != 0) { - gUnk_02033280.unk_06 = 0; + gActiveScriptInfo.commandSize = 0; } } @@ -258,10 +244,10 @@ void sub_08061FB0(Entity* this) { this->hitbox = NULL; } -void sub_08061FB8(Entity* this, struct_08061FB8* arg1) { +void sub_08061FB8(Entity* this, ScriptExecutionContext* context) { u8* temp = gUnk_0810B748; - sub_08078850(this, 1, temp[arg1->unk2], &gUnk_0810B740[arg1->unk2]); + sub_08078850(this, 1, temp[context->intVariable], &gUnk_0810B740[context->intVariable]); } void sub_08061FD8(Entity* this) { diff --git a/src/npc/wheaton.c b/src/npc/wheaton.c index 2edbc69c..1d2170a8 100644 --- a/src/npc/wheaton.c +++ b/src/npc/wheaton.c @@ -1,11 +1,9 @@ #include "global.h" #include "entity.h" +#include "script.h" +#include "functions.h" -extern void sub_0805E3A0(Entity*, u32); -extern void ResolveEntityOnTop(Entity*, Entity*); extern Hitbox gUnk_0810C3C0; -extern void sub_0807DD64(Entity*); -extern void sub_0807DD94(Entity*, u32); void Wheaton(Entity* this) { if (this->action == 0) { diff --git a/src/npc/windTribespeople.c b/src/npc/windTribespeople.c index 9429ccd6..65968f30 100644 --- a/src/npc/windTribespeople.c +++ b/src/npc/windTribespeople.c @@ -8,23 +8,13 @@ #include "save.h" #include "script.h" -extern u32 LoadExtraSpriteData(Entity*, SpriteLoadData*); -extern void sub_0807DD50(Entity*); extern void sub_0806C7D4(Entity*); -extern void sub_0806F118(Entity*); -extern void sub_0807DD80(Entity*, u32*); -extern u32 sub_0801E99C(); -extern void sub_08078784(Entity*, u32); -extern void SetExtraSpriteFrame(Entity*, u32, u32); -extern void SetSpriteSubEntryOffsetData2(Entity*, u32, u32); -extern void SetSpriteSubEntryOffsetData1(Entity*, u32, u32); -extern void sub_0807000C(Entity*); extern void (*const gUnk_08113A7C[])(Entity*); -extern void (*const gUnk_08113A8C[])(Entity*, Entity*); +extern void (*const gUnk_08113A8C[])(Entity*, ScriptExecutionContext*); extern SpriteLoadData gUnk_08113A1C[]; -extern u32 gUnk_08014A80; +extern u16 script_08014A80; extern Dialog gUnk_08113ABC[]; extern u16 gUnk_08113B0C[]; @@ -57,7 +47,7 @@ void sub_0806C7D4(Entity* this) { sub_0807DD94(this, NULL); if ((this->type2 == 3) && (!CheckGlobalFlag(WARP_EVENT_END)) && (CheckLocalFlag(0x63)) && (CheckRoomFlag(0))) { this->type2 = 7; - sub_0807DD80(this, &gUnk_08014A80); + sub_0807DD80(this, &script_08014A80); } } } @@ -111,10 +101,9 @@ void WindTribespeople_Head(Entity* this) { } } -// body and head entities? -void sub_0806C90C(Entity* param_1, Entity* param_2) { - *(u32*)¶m_2->animationState = 0; - gUnk_08113A8C[param_1->type2](param_1, param_2); +void sub_0806C90C(Entity* this, ScriptExecutionContext* context) { + context->condition = 0; + gUnk_08113A8C[this->type2](this, context); } void sub_0806C928(Entity* this) { diff --git a/src/npc/zelda.c b/src/npc/zelda.c index b284b6cf..c9a50cfb 100644 --- a/src/npc/zelda.c +++ b/src/npc/zelda.c @@ -6,78 +6,68 @@ #include "flags.h" #include "script.h" -extern void PrependEntityToList(Entity*, u32); -extern void sub_0807DD50(Entity*); -extern Entity* FindEntityBySubtype(u32, u32); -void CopyPosition(Entity*, Entity*); +extern Entity* DeepFindEntityByID(u32, u32); void sub_08068680(Entity*, Entity*); void sub_08068694(Entity*, Entity*); -u32 GetAnimationState(Entity* ent); -void DeleteThisEntity(void); extern Entity* GetEntityByType(u32, u32); extern void sub_080686C4(Entity*, Entity*); -extern void SoundReq(u32); -extern void SetTileType(u32, u32, u32); - -extern Entity gPlayerEntity; -extern RoomControls gRoomControls; extern void (*gUnk_08110BD8[])(Entity* ent); extern u16 gUnk_08110BE0[]; -void Zelda(Entity* ent) { - gUnk_08110BD8[ent->action](ent); +void Zelda(Entity* this) { + gUnk_08110BD8[this->action](this); } -void sub_08066CCC(Entity* ent) { - ent->action = 1; - ent->spriteSettings.b.draw = 1; - PrependEntityToList(ent, 7); - sub_0805E3A0(ent, 2); - sub_0807DD50(ent); +void sub_08066CCC(Entity* this) { + this->action = 1; + this->spriteSettings.b.draw = 1; + PrependEntityToList(this, 7); + sub_0805E3A0(this, 2); + sub_0807DD50(this); } -void sub_08066CF8(Entity* ent) { - sub_0807DD94(ent, NULL); +void sub_08066CF8(Entity* this) { + sub_0807DD94(this, NULL); } -void sub_08066D04(Entity* ent) { - ent->parent = FindEntityBySubtype(7, 0x2E); +void sub_08066D04(Entity* this) { + this->parent = DeepFindEntityByID(7, 0x2E); } -void sub_08066D14(Entity* ent, u32* param_2) { +void sub_08066D14(Entity* this, ScriptExecutionContext* context) { Entity* parent; - parent = ent->parent; + parent = this->parent; if (parent != NULL) { - ent->animationState = parent->animationState; - ent->spriteSettings.b.draw = 1; - CopyPosition(parent, ent); - sub_08068680(ent, ent->parent); - param_2[5] = 1; + this->animationState = parent->animationState; + this->spriteSettings.b.draw = 1; + CopyPosition(parent, this); + sub_08068680(this, this->parent); + context->condition = 1; } else { - param_2[5] = 0; + context->condition = 0; } } -void sub_08066D4C(Entity* ent, u32* param_2) { +void sub_08066D4C(Entity* this, ScriptExecutionContext* context) { Entity* parent; - parent = ent->parent; - if (ent->parent != NULL) { - CopyPosition(ent, parent); - ent->parent->spriteSettings.b.draw = 1; - ent->parent->animationState = ent->animationState; - ent->spriteSettings.b.draw = 0; - ent->field_0x17 &= 0xFE; - sub_08068694(ent, ent->parent); - param_2[5] = 1; + parent = this->parent; + if (this->parent != NULL) { + CopyPosition(this, parent); + this->parent->spriteSettings.b.draw = 1; + this->parent->animationState = this->animationState; + this->spriteSettings.b.draw = 0; + this->field_0x17 &= 0xFE; + sub_08068694(this, this->parent); + context->condition = 1; } else { - param_2[5] = 0; + context->condition = 0; } } -void sub_08066D94(Entity* ent) { +void sub_08066D94(Entity* this) { u32 roomID; Entity* npc; @@ -86,91 +76,91 @@ void sub_08066D94(Entity* ent) { if (npc != NULL) { npc->animationState = gPlayerEntity.animationState; npc->flags |= 0x20; - npc->animationState = GetAnimationState(ent); + npc->animationState = GetAnimationState(this); roomID = gRoomControls.roomID; npc->field_0x74.HWORD = roomID; - CopyPosition(ent, npc); + CopyPosition(this, npc); } DeleteThisEntity(); } -void sub_08066DE4(Entity* ent) { +void sub_08066DE4(Entity* this) { Entity* pEVar1; - pEVar1 = FindEntityBySubtype(7, 0x2E); + pEVar1 = DeepFindEntityByID(7, 0x2E); if (pEVar1 != NULL) { - CopyPosition(ent, pEVar1); - sub_080686C4(ent, pEVar1); + CopyPosition(this, pEVar1); + sub_080686C4(this, pEVar1); } } -void sub_08066E08(Entity* ent) { - InitAnimationForceUpdate(ent, 0x50); - ent->field_0x80.HWORD = ent->animIndex; +void sub_08066E08(Entity* this) { + InitAnimationForceUpdate(this, 0x50); + this->field_0x80.HWORD = this->animIndex; } -void sub_08066E20(Entity* ent) { - InitAnimationForceUpdate(ent, 0x44); - ent->field_0x80.HWORD = ent->animIndex; +void sub_08066E20(Entity* this) { + InitAnimationForceUpdate(this, 0x44); + this->field_0x80.HWORD = this->animIndex; } -void sub_08066E38(Entity* ent) { - InitAnimationForceUpdate(ent, 0x48); - ent->field_0x80.HWORD = ent->animIndex; +void sub_08066E38(Entity* this) { + InitAnimationForceUpdate(this, 0x48); + this->field_0x80.HWORD = this->animIndex; } -void sub_08066E50(Entity* ent) { - InitAnimationForceUpdate(ent, 0x4C); - ent->field_0x80.HWORD = ent->animIndex; +void sub_08066E50(Entity* this) { + InitAnimationForceUpdate(this, 0x4C); + this->field_0x80.HWORD = this->animIndex; } -void sub_08066E68(Entity* ent) { - InitAnimationForceUpdate(ent, 0x54); - ent->field_0x80.HWORD = ent->animIndex; +void sub_08066E68(Entity* this) { + InitAnimationForceUpdate(this, 0x54); + this->field_0x80.HWORD = this->animIndex; } -void sub_08066E80(Entity* ent, u8* param_2) { - switch (param_2[0x18]) { +void sub_08066E80(Entity* this, ScriptExecutionContext* context) { + switch (context->unk_18) { case 0: - param_2[0x18]++; - InitAnimationForceUpdate(ent, 0x16); + context->unk_18++; + InitAnimationForceUpdate(this, 0x16); break; case 1: - UpdateAnimationSingleFrame(ent); - if (ent->frames.all & 1) { - param_2[0x18]++; - ent->field_0x20 = 0x20000; - ent->frames.all &= 0xFE; + UpdateAnimationSingleFrame(this); + if (this->frames.all & 1) { + context->unk_18++; + this->field_0x20 = 0x20000; + this->frames.all &= 0xFE; SoundReq(SFX_PLY_JUMP); } break; case 2: - sub_0806F62C(ent, 0x100, 0x80); - sub_08003FC4(ent, 0x2000); - if (!(ent->frames.all & 1)) { - UpdateAnimationSingleFrame(ent); + sub_0806F62C(this, 0x100, 0x80); + sub_08003FC4(this, 0x2000); + if (!(this->frames.all & 1)) { + UpdateAnimationSingleFrame(this); } - if (ent->field_0x20 < 0) { - param_2[0x18]++; + if (this->field_0x20 < 0) { + context->unk_18++; } break; case 3: - sub_0806F62C(ent, 0x100, 0x80); - UpdateAnimationSingleFrame(ent); - if (sub_08003FC4(ent, 0x2000) == 0) { - param_2[0x18]++; - InitAnimationForceUpdate(ent, 0x1E); + sub_0806F62C(this, 0x100, 0x80); + UpdateAnimationSingleFrame(this); + if (sub_08003FC4(this, 0x2000) == 0) { + context->unk_18++; + InitAnimationForceUpdate(this, 0x1E); } break; case 4: - UpdateAnimationSingleFrame(ent); - if (ent->frames.b.f3) { - gUnk_02033280.unk_07 |= 1; + UpdateAnimationSingleFrame(this); + if (this->frames.b.f3) { + gActiveScriptInfo.flags |= 1; return; } } - ent->field_0x80.HWORD = ent->animIndex; - gUnk_02033280.unk_06 = 0; + this->field_0x80.HWORD = this->animIndex; + gActiveScriptInfo.commandSize = 0; } void sub_08066F94(void) { diff --git a/src/object/archway.c b/src/object/archway.c index 39975ee7..49f3f497 100644 --- a/src/object/archway.c +++ b/src/object/archway.c @@ -1,26 +1,16 @@ #include "global.h" #include "entity.h" -#include "sprite.h" - -extern u32 CheckIsDungeon(); +#include "game.h" void Archway(Entity* this) { - u32 v1; - u32 v2; - u32 v3; - if (this->action == 0) { - v1 = this->action = 1; - v2 = this->spriteSettings.raw; - v1 = v1 - 0x5; - v1 = v1 & v2; - this->spriteSettings.raw = v1 | 1; + this->action = 1; + this->spriteSettings.b.draw = 1; this->frameIndex = this->type2; this->collisionLayer = 2; UpdateSpriteForCollisionLayer(this); - v3 = CheckIsDungeon(); - if (v3 != 0) { - this->spritePriority.b0 = (this->spritePriority.b0 & 0xf8) | 1; + if (CheckIsDungeon()) { + this->spritePriority.b0 = 1; } } } diff --git a/src/object/backgroundCloud.c b/src/object/backgroundCloud.c index ceebf3d7..aaee8cf2 100644 --- a/src/object/backgroundCloud.c +++ b/src/object/backgroundCloud.c @@ -1,5 +1,6 @@ #include "global.h" #include "entity.h" +#include "random.h" #include "functions.h" extern void (*const gUnk_08121EA4[])(Entity*); @@ -18,13 +19,13 @@ void sub_0808F658(Entity* this) { this->spritePriority.b0 = this->type; this->frameIndex = this->type; this->direction = 8; - this->nonPlanarMovement = gUnk_08121EB0[this->type]; + this->speed = gUnk_08121EB0[this->type]; this->field_0x78.HWORD = gRoomControls.roomOriginX - 0x60; this->field_0x7a.HWORD = gRoomControls.roomOriginX + gRoomControls.width + 0x60; this->animationState = 0; this->x.HALF.HI += (Random() & 0xf) << 4; this->actionDelay = 0; - this->previousActionFlag = 0; + this->subAction = 0; } void sub_0808F6E0(Entity* this) { @@ -35,8 +36,8 @@ void sub_0808F6E0(Entity* this) { } void sub_0808F70C(Entity* this) { - if (this->previousActionFlag == 0) { - this->previousActionFlag = 1; + if (this->subAction == 0) { + this->subAction = 1; this->actionDelay = ((Random() & 7) << 3) + 31; if ((this->direction & 0x10)) { @@ -49,10 +50,10 @@ void sub_0808F70C(Entity* this) { this->y.HALF.HI = gUnk_08121EB3[this->type2 * 2 + (Random() & 1)]; } - if (this->previousActionFlag == 1) { + if (this->subAction == 1) { if (--this->actionDelay == 0) { this->action = 1; - this->previousActionFlag = 0; + this->subAction = 0; } } } diff --git a/src/object/bakerOven.c b/src/object/bakerOven.c index a64217f1..12cbf897 100644 --- a/src/object/bakerOven.c +++ b/src/object/bakerOven.c @@ -59,12 +59,12 @@ void sub_0809CD0C(Entity* this) { } /* Damage minish link if he touches a steam cloud */ - if (this->field_0xf == 0 && gPlayerEntity.hurtBlinkTime == 0 && this->frameIndex && + if (this->field_0xf == 0 && gPlayerEntity.iframes == 0 && this->frameIndex && sub_0806FC80(this, &gPlayerEntity, 4)) { this->field_0xf++; ModHealth(-2); sub_0800449C(&gPlayerEntity, 0x7a); - gPlayerEntity.hurtBlinkTime = 16; + gPlayerEntity.iframes = 16; gPlayerEntity.field_0x3e = 16; gPlayerEntity.field_0x42 = 12; gPlayerEntity.field_0x46 = 16; diff --git a/src/object/bell.c b/src/object/bell.c index 072b0798..3a1e7d41 100644 --- a/src/object/bell.c +++ b/src/object/bell.c @@ -1,5 +1,5 @@ -#include "entity.h" #include "global.h" +#include "entity.h" extern void (*gUnk_08123384[])(Entity*); diff --git a/src/object/bird.c b/src/object/bird.c index acda3985..fcf03eab 100644 --- a/src/object/bird.c +++ b/src/object/bird.c @@ -2,8 +2,9 @@ #include "audio.h" #include "entity.h" #include "flags.h" -#include "functions.h" #include "save.h" +#include "random.h" +#include "functions.h" extern void (*const gUnk_08123EC0[])(Entity*); extern void (*const gUnk_08123EEC[])(Entity*); @@ -29,7 +30,7 @@ void sub_0809CF54(Entity* this) { this->field_0x20 = -0x18000; this->height.WORD = -0x38C000; this->field_0x68.HWORD = -0x800; - this->nonPlanarMovement = 0x280; + this->speed = 0x280; this->direction = 8; this->collisionLayer = 2; this->x.HALF.HI = gRoomControls.roomScrollX; @@ -70,7 +71,7 @@ void sub_0809D048(Entity* this) { } void sub_0809D06C(Entity* this) { - gUnk_08123EFC[this->previousActionFlag](this); + gUnk_08123EFC[this->subAction](this); } void sub_0809D084(Entity* this) { @@ -81,7 +82,7 @@ void sub_0809D084(Entity* this) { if (temp != 0) { PositionRelative(this->parent, this, 0, 0x80000); } else { - this->previousActionFlag++; + this->subAction++; this->field_0x20 = temp; } } diff --git a/src/object/button.c b/src/object/button.c index 23a2ee8d..e545953c 100644 --- a/src/object/button.c +++ b/src/object/button.c @@ -47,7 +47,7 @@ void sub_08081FF8(Entity*); void sub_08081BAC(Entity* this) { if (sub_08081CB0(this)) { - this->previousActionFlag = 0; + this->subAction = 0; this->actionDelay = 0xA; sub_0805E4E0(this, 0xA); sub_08081FF8(this); @@ -105,7 +105,6 @@ void sub_08081C98(Entity* this) { } Entity* sub_08081D74(Entity*); -void sub_0807B7D8(u32, u32, u32); u32 sub_080001DA(u32, u32); u32 sub_08081CB0(Entity* this) { @@ -142,8 +141,7 @@ u32 sub_08081D28(Entity* this) { } extern u32 sub_080002E0(u32, u32); -extern Entity* gUnk_03004040[]; -extern u32 sub_080041A0(Entity*, Entity*, u32, u32); +extern Entity* gUnk_03004040[3]; u32 sub_08081E0C(Entity*); Entity* sub_08081D74(Entity* this) { @@ -171,8 +169,6 @@ Entity* sub_08081D74(Entity* this) { return ent; } -extern u32 sub_08079F8C(); - u32 sub_08081E0C(Entity* this) { Entity* tmp = &gPlayerEntity; if (tmp->height.HALF.HI != 0 || !sub_08079F8C()) { @@ -273,7 +269,6 @@ u32 sub_08081F7C(Entity* this, u32 r7) { return 1; } -extern Entity* gUnk_03004040[3]; extern void sub_080044AE(Entity*, u32, u32); void sub_08081FF8(Entity* this) { diff --git a/src/object/chestSpawner.c b/src/object/chestSpawner.c index 790d1251..3f7e6006 100644 --- a/src/object/chestSpawner.c +++ b/src/object/chestSpawner.c @@ -1,6 +1,5 @@ #include "global.h" #include "entity.h" -#include "flags.h" extern void sub_080842D8(Entity*); extern void sub_08078828(Entity*); diff --git a/src/object/cloud.c b/src/object/cloud.c index e7851f07..56b55984 100644 --- a/src/object/cloud.c +++ b/src/object/cloud.c @@ -4,29 +4,17 @@ #include "room.h" #include "player.h" #include "flags.h" +#include "random.h" #include "functions.h" #include "structures.h" extern void sub_0809F7BC(Entity*); -extern void SoundReq(u32); -extern void sub_0809F814(u32); extern void sub_0809F7F4(Entity*); -extern void LoadRoomEntityList(); -extern void DeleteThisEntity(); -extern u32 CheckRoomFlag(u32); -extern void sub_08078A90(u32); -extern void sub_08078B48(void); -extern void sub_0806F69C(Entity*); extern void (*gUnk_08124798[])(Entity*); extern void (*gUnk_081247A0[])(Entity*); extern void (*gUnk_081247AC[])(Entity*); -extern Entity* CreateObject(u32, u32, u32); -extern void PositionEntityOnTop(Entity*, Entity*); -extern void sub_0807BB68(u32*, u32, u32); extern void* gUnk_080DD750; -extern Entity gPlayerEntity; -extern PlayerState gPlayerState; extern u8 gUnk_081247C0[]; extern u16 gUnk_081247C8[]; extern u32 gUnk_081247D0; @@ -73,7 +61,7 @@ void sub_0809F5B0(Entity* this) { if (--this->actionDelay == 0) { SoundReq(SFX_SECRET_BIG); SetGlobalFlag(KUMOTATSUMAKI); - LoadRoomEntityList(&gUnk_080DD750); + LoadRoomEntityList((EntityData*)&gUnk_080DD750); DeleteThisEntity(); } } @@ -181,7 +169,7 @@ void sub_0809F7BC(Entity* this) { cloud = sub_0809F770(this); if (cloud != NULL) { uVar1 = Random(); - cloud->nonPlanarMovement = gUnk_081247C8[uVar1 & 3]; + cloud->speed = gUnk_081247C8[uVar1 & 3]; cloud->direction = (u8)(uVar1 >> 8) & 31; } } diff --git a/src/object/fileScreenObjects.c b/src/object/fileScreenObjects.c index 51403761..de79631a 100644 --- a/src/object/fileScreenObjects.c +++ b/src/object/fileScreenObjects.c @@ -1,18 +1,17 @@ #include "global.h" #include "entity.h" #include "flags.h" -#include "functions.h" #include "main.h" #include "menu.h" #include "npc.h" -#include "position.h" -#include "structures.h" +#include "coord.h" #include "fileScreen.h" +#include "utils.h" +#include "structures.h" +#include "functions.h" extern int sub_0807A094(int); -extern void LoadPalettes(const u8*, int, int); extern u32 sub_080041EC(int, int); -extern u32 sub_080045DA(int, int); static bool32 sub_0808E950(void); static void sub_0808EABC(Entity*); @@ -39,7 +38,6 @@ typedef struct { extern void (*const gUnk_08121C64[])(Entity*); extern void (*const gUnk_08121CCC[])(Entity*); extern const int gUnk_08133368[]; -extern const u8 gGlobalGfxAndPalettes[]; extern const struct_08121CD4 gUnk_08121CD4[][4]; extern const u8 gUnk_08121D10[]; extern const u8 gUnk_08121D38[][8]; @@ -506,7 +504,7 @@ static u32 sub_0808EF6C(Entity* this) { if (this->field_0x6c.HWORD < var7) { var7 = this->field_0x6c.HWORD; } - this->nonPlanarMovement = var7; + this->speed = var7; this->direction = sub_080045DA(var0, var2) >> 3; sub_0806F69C(this); return 1; @@ -517,7 +515,7 @@ static void sub_0808EFF0(Entity* this) { u8 var1; this->spriteSettings.b.draw = 2; - this->nonPlanarMovement = 0x400; + this->speed = 0x400; this->currentHealth = 1; this->frameIndex = 0xFF; this->animIndex = 0xFF; diff --git a/src/object/floatingBlock.c b/src/object/floatingBlock.c index 661cec72..7e1ad599 100644 --- a/src/object/floatingBlock.c +++ b/src/object/floatingBlock.c @@ -1,6 +1,5 @@ #include "global.h" #include "entity.h" -#include "functions.h" void FloatingBlock(Entity* this) { if (this->action == 0) { diff --git a/src/object/giantLeaf.c b/src/object/giantLeaf.c index cf2fb1df..9badc65b 100644 --- a/src/object/giantLeaf.c +++ b/src/object/giantLeaf.c @@ -1,11 +1,10 @@ #include "global.h" #include "entity.h" #include "room.h" +#include "functions.h" -void SetTile(u32 tileIndex, s32 tilePosition, s32 layerIndex); void sub_0808D618(Entity* ent); -extern RoomControls gRoomControls; extern s16 gUnk_08121750[]; extern s16 gUnk_0812176A[]; diff --git a/src/object/greatFairy.c b/src/object/greatFairy.c index 2140f167..87afa483 100644 --- a/src/object/greatFairy.c +++ b/src/object/greatFairy.c @@ -3,10 +3,13 @@ #include "entity.h" #include "room.h" #include "screen.h" -#include "structures.h" #include "greatFairy.h" -#include "functions.h" +#include "flags.h" #include "save.h" +#include "random.h" +#include "script.h" +#include "structures.h" +#include "functions.h" enum { BEHAVIORS, @@ -23,11 +26,9 @@ enum { // Main void GreatFairy(Entity* this) { - u8 bVar1; - if (this->action == 0) { - bVar1 = __modsi3(this->type, 11); - this->type2 = bVar1; + s32 temp = 11; + this->type2 = this->type % temp; } GreatFairy_Main[this->type2](this); } @@ -66,20 +67,18 @@ void GreatFairy_DormantUpdate(Entity* this) { --*pFrame; } switch (*pFrame) { - case 0x96: - case 0x82: - goto e; - case 0x0: + case 0: this->action = 2; break; - e: - case 0xd2: - case 0xaa: - case 0x121: + case 130: + case 150: + case 170: + case 210: + case 289: ripple = GreatFairy_CreateForm(this, RIPPLE, 0); if (ripple) { - PositionRelative(this, ripple, (s32)GreatFairy_RippleOffsets[this->actionDelay] << 16, - (s32)GreatFairy_RippleOffsets[this->actionDelay + 1] << 16); + PositionRelative(this, ripple, (s32)GreatFairy_RippleOffsets[this->actionDelay] * 65536, + (s32)GreatFairy_RippleOffsets[this->actionDelay + 1] * 65536); this->actionDelay += 2; break; } @@ -108,9 +107,8 @@ void GreatFairy_SpawningUpdate(Entity* this) { DoFade(6, 4); SoundReq(325); this->action = 4; - this->actionDelay = 0x3c; - var = this->spriteSettings.raw & ~0x3; - this->spriteSettings.raw = (this->spriteSettings.raw & var) | 1; + this->actionDelay = 60; + this->spriteSettings.b.draw = 1; } } } @@ -159,21 +157,19 @@ void GreatFairy_WingsInit(Entity* this) { this->spriteRendering.alphaBlend = 1; gScreen.controls.layerFXControl = 0xF40; gScreen.controls.alphaBlend = BLDALPHA_BLEND(9, 8); - this->nonPlanarMovement = 1024; + this->speed = 1024; sub_0805EC9C(this, 1024, 256, 0); } void GreatFairy_WingsUpdate(Entity* this) { - s32 iVar1; - - iVar1 = this->nonPlanarMovement -= 32; - if (iVar1 * 65536 >> 16 == 256) { + this->speed -= 32; + if (this->speed == 256) { this->action = 2; sub_0805EC60(this); gRoomVars.greatFairyState |= 32; - gUnk_02033280.unk_00 |= 4; + gActiveScriptInfo.unk_00 |= 4; } else { - sub_0805EC9C(this, this->nonPlanarMovement, 256, 0); + sub_0805EC9C(this, this->speed, 256, 0); } } @@ -235,7 +231,7 @@ void GreatFairy_MiniRisingUpdate(Entity* this) { void GreatFairy_MiniRemoveMe(Entity* this) { GetNextFrame(this); sub_080873D0(this); - if ((gRoomVars.greatFairyState & 1) != 0) { + if (gRoomVars.greatFairyState & 1) { DeleteEntity(this); } } @@ -260,7 +256,7 @@ void GreatFairy_MiniAffineInit2(Entity* this) { if (this->height.HALF.HI == -20) { this->action = 2; this->actionDelay = 90; - this->nonPlanarMovement = 4096; + this->speed = 4096; this->spriteRendering.b0 = 3; sub_0805EC9C(this, 256, 256, 0); } @@ -268,15 +264,13 @@ void GreatFairy_MiniAffineInit2(Entity* this) { // Mini great fairy stretch void GreatFairy_MiniAffineUpdate(Entity* this) { - s32 iVar2; - if (--this->actionDelay == 0) { gRoomVars.greatFairyState |= 1; this->action = 3; sub_0805EC60(this); } else { - iVar2 = this->nonPlanarMovement -= 24; - sub_0805EC9C(this, 256, iVar2 * 0x10000 >> 20, 0); + this->speed -= 24; + sub_0805EC9C(this, 256, this->speed >> 4, 0); } } @@ -295,7 +289,7 @@ void GreatFairy_DropletInit(Entity* this) { void GreatFairy_DropletUpdate(Entity* this) { GetNextFrame(this); - if (this->frames.b.f3) { + if (this->frames.all & 0x80) { DeleteEntity(this); } } @@ -312,7 +306,7 @@ void GreatFairy_RippleInit(Entity* this) { } void GreatFairy_RippleUpdate(Entity* this) { - if ((gRoomVars.greatFairyState & 2) != 0) { + if (gRoomVars.greatFairyState & 2) { DeleteEntity(this); } else { GetNextFrame(this); @@ -361,7 +355,7 @@ void GreatFairy_EnergyInit(Entity* this) { void GreatFairy_EnergyUpdate(Entity* this) { GetNextFrame(this); - if (this->frames.b.f3) { + if (this->frames.all & 0x80) { DeleteEntity(this); } } @@ -375,35 +369,25 @@ void sub_08087114(Entity* this) { } } -#ifdef NON_MATCHING -extern u8 gUnk_0812079C; - -void sub_08087150(Entity* this) { +NONMATCH("asm/greatFairy/sub_08087150.inc", void sub_08087150(Entity* this)) { u32 temp; - GreatFairy_InitializeAnimation(); + GreatFairy_InitializeAnimation(this); this->spriteSettings.b.draw = TRUE; this->spriteOrientation.flipY = 0; this->spriteRendering.b0 = 0; this->spritePriority.b0 = 3; - this->nonPlanarMovement = 0x80; + this->speed = 128; this->direction = 0x10; - temp = gUnk_0812079C; + temp = gUnk_0812079C[0]; this->palette.raw = ((temp & 0xf) << 4) | 0xf; } -#else -NAKED -void sub_08087150(Entity* this) { - asm(".include \"asm/greatFairy/sub_08087150.inc\""); -} -#endif +END_NONMATCH void nullsub_516(Entity* this) { } void sub_080871A8(Entity* this) { - u32 bVar1; - if (--this->actionDelay == 0) { this->action = 3; this->actionDelay = 60; @@ -412,7 +396,6 @@ void sub_080871A8(Entity* this) { } void sub_080871D0(Entity* this) { - if (--this->actionDelay == 0) { gRoomVars.greatFairyState |= 8; DeleteEntity(this); @@ -422,16 +405,16 @@ void sub_080871D0(Entity* this) { void sub_080871F8(Entity* this) { Entity* temp = this->attachedEntity; - if ((temp->x.HALF.HI == this->x.HALF.HI) && (temp->y.HALF.HI - 0x20 == this->y.HALF.HI)) { + if ((temp->x.HALF.HI == this->x.HALF.HI) && (temp->y.HALF.HI - 32 == this->y.HALF.HI)) { this->action = 2; } else { - this->direction = sub_080045D4(this->x.HALF.HI, this->y.HALF.HI, temp->x.HALF.HI, temp->y.HALF.HI - 0x20); + this->direction = sub_080045D4(this->x.HALF.HI, this->y.HALF.HI, temp->x.HALF.HI, temp->y.HALF.HI - 32); sub_0806F69C(this); } } void sub_08087240(Entity* this) { - if ((gRoomVars.greatFairyState & 4) != 0) { + if (gRoomVars.greatFairyState & 4) { this->action = 3; this->actionDelay = 20; this->direction = 16; @@ -446,7 +429,6 @@ void sub_08087264(Entity* this) { } void sub_0808727C(Entity* this) { - if (--this->actionDelay == 0) { DeleteEntity(this); } @@ -463,7 +445,7 @@ void sub_080872AC(Entity* this) { this->field_0x68.HWORD = this->x.HALF.HI; this->field_0x6a.HWORD = this->y.HALF.HI; this->direction = (u8)Random() & 0x1F; - this->nonPlanarMovement = 32; + this->speed = 32; GreatFairy_InitializeAnimation(this); } @@ -477,17 +459,16 @@ void sub_080872F8(Entity* this) { sub_080045D4(this->x.HALF.HI, this->y.HALF.HI, (s16)this->field_0x68.HWORD, (s16)this->field_0x6a.HWORD); this->direction = (this->direction + gUnk_081207AC[Random() & 3]) & 0x1f; } - temp = gSineTable[this->actionDelay + 0x40]; + temp = gSineTable[this->actionDelay + 64]; this->height.HALF.HI = (temp >> 6) - 8; this->actionDelay++; } void GreatFairy_InitializeAnimation(Entity* this) { - s32 temp; + s32 temp = 11; this->action = 1; - temp = this->type; - this->type2 = temp % 11; + this->type2 = this->type % temp; this->collisionLayer = 2; InitializeAnimation(this, this->type2); sub_0805E3A0(this, 2); @@ -513,7 +494,7 @@ void sub_080873D0(Entity* this) { ent = GreatFairy_CreateForm(this, 8, 0); if (ent != NULL) { CopyPosition(this, ent); - this->actionDelay = 0x30; + this->actionDelay = 48; } } } @@ -524,12 +505,12 @@ void sub_080873FC(void) { SoundReq(SFX_APPARATE); gRoomControls.cameraTarget = NULL; - while (ent = FindEntityInListBySubtype(0x6, 0x1b, 0x6), ent != NULL) { + while (ent = FindEntityByID(0x6, 0x1b, 0x6), ent != NULL) { DeleteEntity(ent); } } -void sub_08087424(Entity* arg0, struct_08087424* arg1) { +void sub_08087424(Entity* this, ScriptExecutionContext* context) { Entity* ent; sub_080791D0(); @@ -540,9 +521,9 @@ void sub_08087424(Entity* arg0, struct_08087424* arg1) { sub_0805E3A0(ent, 2); } - switch (arg1->unk4) { + switch (context->intVariable) { case 0: - gSave.stats.arrowCount = arg1->unk4; + gSave.stats.arrowCount = 0; break; case 1: gSave.stats.bombCount = 0; @@ -550,104 +531,90 @@ void sub_08087424(Entity* arg0, struct_08087424* arg1) { } } -void sub_0808747C(u32 arg0, u32 arg1) { - u32 iVar1; +void sub_0808747C(Entity* this, ScriptExecutionContext* context) { + u32 iVar1 = 0; - iVar1 = (u32)FindEntityInListByForm(0x6, 0xf, 0x6, 0xb, 0x0); + iVar1 = (u32)FindEntity(0x6, 0xf, 0x6, 0xb, 0x0); if (iVar1 != 0) { iVar1 = 1; } - *(u32*)(arg1 + 0x14) = iVar1; + context->condition = iVar1; } -// clang-format off void (*const GreatFairy_Main[])(Entity*) = { - GreatFairy_CallBehavior, + GreatFairy_CallBehavior, GreatFairy_WingsCallBehavior, GreatFairy_WakeCallBehavior, GreatFairy_MiniCallBehavior, - GreatFairy_MiniAffineCallBehavior, - GreatFairy_DropletCallBehavior, - GreatFairy_RippleCallBehavior, + GreatFairy_MiniAffineCallBehavior, + GreatFairy_DropletCallBehavior, + GreatFairy_RippleCallBehavior, GreatFairy_BigRippleCallBehavior, - GreatFairy_EnergyCallBehavior, - sub_08087114, - sub_08087294 + GreatFairy_EnergyCallBehavior, + sub_08087114, + sub_08087294, }; void (*const GreatFairy_Behaviors[])(Entity*) = { - GreatFairy_Init, - GreatFairy_DormantUpdate, - GreatFairy_CreateBigRipple, - GreatFairy_SpawningUpdate, - GreatFairy_MiniUpdate, - GreatFairy_FinalUpdate + GreatFairy_Init, GreatFairy_DormantUpdate, GreatFairy_CreateBigRipple, + GreatFairy_SpawningUpdate, GreatFairy_MiniUpdate, GreatFairy_FinalUpdate, }; const s16 GreatFairy_RippleOffsets[10] = { - 0, 0, - -32, -8, - 16, 20, - 24, -12, - -16, 24 + 0, 0, -32, -8, 16, 20, 24, -12, -16, 24, }; - -void (*const GreatFairy_WingsBehaviors[])(Entity*) = { +void (*const GreatFairy_WingsBehaviors[])(Entity*) = { GreatFairy_WingsInit, GreatFairy_WingsUpdate, - nullsub_116 + nullsub_116, }; void (*const GreatFairy_WakeBehaviors[])(Entity*) = { GreatFairy_WakeInit, - GreatFairy_WakeUpdate + GreatFairy_WakeUpdate, }; void (*const GreatFairy_MiniBehaviors[])(Entity*) = { GreatFairy_MiniInit, GreatFairy_MiniRisingUpdate, - GreatFairy_MiniRemoveMe + GreatFairy_MiniRemoveMe, }; void (*const GreatFairy_MiniAffineBehaviors[])(Entity*) = { GreatFairy_MiniAffineInit, GreatFairy_MiniAffineInit2, GreatFairy_MiniAffineUpdate, - DeleteEntity + DeleteEntity, }; void (*const GreatFairy_DropletBehaviors[])(Entity*) = { GreatFairy_DropletInit, - GreatFairy_DropletUpdate + GreatFairy_DropletUpdate, }; void (*const GreatFairy_RippleBehaviors[])(Entity*) = { GreatFairy_RippleInit, - GreatFairy_RippleUpdate + GreatFairy_RippleUpdate, }; void (*const GreatFairy_BigRippleBehaviors[])(Entity*) = { GreatFairy_BigRippleInit, - GreatFairy_BigRippleUpdate + GreatFairy_BigRippleUpdate, }; void (*const GreatFairy_EnergyBehaviors[])(Entity*) = { GreatFairy_EnergyInit, - GreatFairy_EnergyUpdate + GreatFairy_EnergyUpdate, }; + void (*const GreatFairy_Form1Behaviors[])(Entity*) = { sub_08087150, nullsub_516, sub_080871A8, - sub_080871D0 + sub_080871D0, }; void (*const GreatFairy_Form2Behaviors[])(Entity*) = { - sub_08087150, - sub_080871F8, - sub_08087240, - sub_08087264, - sub_0808727C + sub_08087150, sub_080871F8, sub_08087240, sub_08087264, sub_0808727C, }; -// clang-format on diff --git a/src/object/heartContainer.c b/src/object/heartContainer.c index 6fad6461..046eb0aa 100644 --- a/src/object/heartContainer.c +++ b/src/object/heartContainer.c @@ -4,9 +4,6 @@ #include "flags.h" #include "functions.h" -extern void DeleteThisEntity(); -extern void sub_08080CB4(Entity*); -extern u32 sub_08017850(Entity*); static void sub_0808E6A0(Entity*); static void sub_0808E6E4(Entity*); static void sub_0808E714(Entity*); diff --git a/src/object/houseDoorExterior.c b/src/object/houseDoorExterior.c index d500686c..2b6edaae 100644 --- a/src/object/houseDoorExterior.c +++ b/src/object/houseDoorExterior.c @@ -61,7 +61,7 @@ void sub_080866D8(Entity* this) { entity->field_0x68.HWORD = prop->unk0; entity->field_0x6a.HWORD = prop->unk2; entity->collisionLayer = prop->unk4; - entity->previousActionFlag = prop->unk5; + entity->subAction = prop->unk5; UpdateSpriteForCollisionLayer(entity); *((u32*)(&this->field_0x68)) |= mask; if (prop->unk8) { @@ -98,7 +98,7 @@ static void sub_0808681C(Entity* this) { this->spriteSettings.b.draw = 1; this->frameIndex = 0; this->hitbox = &gUnk_081206AC; - if (this->previousActionFlag == 1) { + if (this->subAction == 1) { this->action = 2; this->frameIndex = 1; } @@ -117,7 +117,7 @@ static void sub_0808681C(Entity* this) { } if (this->flags & 0x2) { - ExecuteScriptCommandSet(this, *(ScriptExecutionContext**)&this->cutsceneBeh); + ExecuteScript(this, *(ScriptExecutionContext**)&this->cutsceneBeh); sub_080868EC(this, *(void**)&this->cutsceneBeh); } } @@ -129,7 +129,7 @@ void sub_080868B0(Entity* this) { this->hitbox = &gUnk_081206AC; this->actionDelay = 8; } - ExecuteScriptCommandSet(this, *(ScriptExecutionContext**)&this->cutsceneBeh); + ExecuteScript(this, *(ScriptExecutionContext**)&this->cutsceneBeh); sub_080868EC(this, *(void**)&this->cutsceneBeh); } @@ -158,7 +158,7 @@ void sub_0808692C(Entity* this) { this->flags &= 0xFD; this->type2 = 2; this->action = this->frameIndex == 0 ? 1 : 2; - this->previousActionFlag = 0; + this->subAction = 0; this->actionDelay = 8; } @@ -174,11 +174,10 @@ static u8 sub_08086954(Entity* this) { return this->actionDelay; } -// TODO: Second arg is some unknown struct. -void sub_080869A4(Entity* entityA, u32* entityB) { - entityB[5] = 0; - if (!sub_08086954(entityA)) { - entityA->actionDelay = 8; - entityB[5] = 1; +void sub_080869A4(Entity* this, ScriptExecutionContext* context) { + context->condition = 0; + if (!sub_08086954(this)) { + this->actionDelay = 8; + context->condition = 1; } } diff --git a/src/object/itemOnGround.c b/src/object/itemOnGround.c index 94a0881c..351b21bd 100644 --- a/src/object/itemOnGround.c +++ b/src/object/itemOnGround.c @@ -142,8 +142,8 @@ static void sub_080810A8(Entity* this) { sub_080814A4(this); if (this->direction & 0x80) { this->direction &= 0x1F; - if (this->nonPlanarMovement == 0) { - this->nonPlanarMovement = 0x100; + if (this->speed == 0) { + this->speed = 0x100; } } else { this->direction |= 0xFF; @@ -163,7 +163,7 @@ static void sub_080810FC(Entity* this) { sub_08081598(this); } else { this->action = 2; - this->previousActionFlag = 0; + this->subAction = 0; this->flags |= 0x80; this->flags2 = 0x11; CopyPosition(&gPlayerEntity, this); @@ -260,7 +260,7 @@ void sub_080812A0(Entity* this) { void sub_080812A8(Entity* this) { if (sub_080002D0(this) != 0xF && this->field_0x6e.HWORD != GetTileTypeByEntity(this)) { this->direction = 0; - this->nonPlanarMovement = 0; + this->speed = 0; this->spriteSettings.b.draw = 1; this->field_0x68.HALF.HI = 0; sub_080810A8(this); @@ -305,11 +305,11 @@ void sub_0808136C(Entity* this) { } static void sub_080813BC(Entity* this) { - gUnk_0811E840[this->previousActionFlag](this); + gUnk_0811E840[this->subAction](this); } void sub_080813D4(Entity* this) { - this->previousActionFlag = 1; + this->subAction = 1; this->field_0x1d = 1; this->spriteSettings.b.draw = 1; } diff --git a/src/object/jailBars.c b/src/object/jailBars.c index d046c822..505ca8e2 100644 --- a/src/object/jailBars.c +++ b/src/object/jailBars.c @@ -2,9 +2,9 @@ #include "entity.h" #include "flags.h" #include "room.h" +#include "functions.h" extern void sub_080A0960(Entity*, u32); -extern void SoundReq(u32); extern void sub_0801AF18(u8*, u32, u32); extern void (*const gUnk_08124950[])(Entity*); diff --git a/src/object/lightableSwitch.c b/src/object/lightableSwitch.c index cfbf0ba5..cbeafdd7 100644 --- a/src/object/lightableSwitch.c +++ b/src/object/lightableSwitch.c @@ -7,10 +7,7 @@ extern void sub_0809EB30(Entity*); extern void sub_0809EAD8(Entity*); extern void sub_0809EABC(Entity*); -extern void EnqueueSFX(u32); extern void sub_080A2CC0(Entity*, Entity**, u16*); -extern void SetTile(u32, u32, u32); -extern void sub_0806F69C(Entity*); extern void (*const gUnk_081243B4[])(Entity*); extern void (*const gUnk_081243BC[])(Entity*); diff --git a/src/object/lilypadSmall.c b/src/object/lilypadSmall.c index a96c49ad..ce0d8c08 100644 --- a/src/object/lilypadSmall.c +++ b/src/object/lilypadSmall.c @@ -1,7 +1,8 @@ #include "global.h" #include "entity.h" -#include "functions.h" #include "player.h" +#include "random.h" +#include "functions.h" extern void sub_080A2CC0(Entity*, Entity**, u16*); diff --git a/src/object/mask.c b/src/object/mask.c index e405df5f..b6d06206 100644 --- a/src/object/mask.c +++ b/src/object/mask.c @@ -2,26 +2,17 @@ #include "entity.h" #include "room.h" #include "random.h" - -extern Entity gPlayerEntity; -extern u16 gScreenTransition[]; +#include "structures.h" +#include "player.h" +#include "flags.h" +#include "functions.h" extern void (*MaskActionFuncs[])(Entity*); -extern void DeleteThisEntity(); - -extern bool32 CheckFlags(u16); -extern void SetFlag(u16); -extern void ClearFlag(u16); - -extern void SetTile(u32, u16, u32); - extern void sub_08000148(u16, u16, u32); extern s16 sub_080001DA(u16, u32); extern u16 sub_080002E0(u16, u32); -extern void EnqueueSFX(u32); -extern void sub_080044EC(Entity*, u16); extern void sub_0805457C(Entity*, s32); void Mask(Entity* this) { @@ -35,7 +26,7 @@ void sub_080929A4(Entity* this) { switch (this->type2 & 0xC0) { case 0x40: - field_0x0a = gScreenTransition[0x5]; + field_0x0a = gScreenTransition.field_0xa; switch (field_0x0a) { case 0x44D ... 0x44F: @@ -69,7 +60,7 @@ void sub_080929A4(Entity* this) { this->field_0x7a.HWORD = sub_080002E0(this->field_0x7c.HALF.HI, 1); - SetTile(0x4022, this->field_0x7c.HALF.HI, 1); + SetTile(0x4022, this->field_0x7c.HALF_U.HI, 1); } // Probably related to knocking it down @@ -94,7 +85,7 @@ void sub_08092A94(Entity* this) { } // Presumably, make the mask fall - SetTile((u16)this->field_0x7c.HALF.LO, this->field_0x7c.HALF.HI, 1); + SetTile(this->field_0x7c.HALF_U.LO, this->field_0x7c.HALF_U.HI, 1); sub_08000148(this->field_0x7a.HWORD, this->field_0x7c.HALF.HI, 1); diff --git a/src/object/metalDoor.c b/src/object/metalDoor.c index 55c8b261..a2a18bff 100644 --- a/src/object/metalDoor.c +++ b/src/object/metalDoor.c @@ -2,15 +2,12 @@ #include "entity.h" #include "room.h" #include "flags.h" +#include "functions.h" extern u32 sub_08083734(Entity*, u32); extern void sub_080A080C(Entity*); -extern void sub_0806F69C(Entity*); -extern void EnqueueSFX(u32); extern void sub_080A0870(Entity*); -extern void SoundReq(u32); extern u32 sub_080001DA(u32, u32); -extern void SetTile(u32, u32, u32); extern void (*const gUnk_0812493C[])(Entity*); @@ -25,7 +22,7 @@ void sub_080A0684(Entity* this) { DeleteThisEntity(); } this->action = 1; - this->nonPlanarMovement = 0x300; + this->speed = 0x300; this->spriteSettings.b.draw = 0; this->frameIndex = 0; this->spriteSettings.b.flipY = 1; diff --git a/src/object/minecart.c b/src/object/minecart.c index e86c814e..af74c357 100644 --- a/src/object/minecart.c +++ b/src/object/minecart.c @@ -8,7 +8,6 @@ extern u32 sub_08091DDC(Entity*); extern u32 sub_080002B4(Entity*, u32, u32); extern u32 sub_08007DD6(u32, u32); extern void sub_08017744(Entity*); -extern u32 sub_080002B8(Entity*); extern void sub_08091C0C(Entity*); typedef struct { @@ -52,7 +51,7 @@ void sub_080916EC(Entity* this) { this->field_0x40 = 0x44; this->flags2 = 0x80; this->direction = DirectionFromAnimationState(this->animationState); - this->nonPlanarMovement = 0x700; + this->speed = 0x700; this->spritePriority.b1 = 3; InitAnimationForceUpdate(this, this->type2 + 4 + this->animationState); SetTile(0x4022, COORD_TO_TILE(this), this->collisionLayer); @@ -82,7 +81,7 @@ void sub_080917DC(Entity* this) { gPlayerState.jumpStatus = 0x81; gPlayerState.flags.all |= 0x4000000; gPlayerEntity.field_0x20 = 0x20000; - gPlayerEntity.nonPlanarMovement = 0x100; + gPlayerEntity.speed = 0x100; gPlayerEntity.flags &= 0x7f; ResetPlayer(); sub_0807A108(); @@ -144,7 +143,7 @@ void sub_080919AC(Entity* this) { } } else { this->flags = this->flags | 0x80; - gPlayerEntity.nonPlanarMovement = 0; + gPlayerEntity.speed = 0; sub_0806F69C(this); CopyPosition(this, &gPlayerEntity); gPlayerEntity.spritePriority.b0 = this->spritePriority.b0 - 1; @@ -177,7 +176,7 @@ void sub_080919AC(Entity* this) { gPlayerState.jumpStatus = 0x41; gPlayerState.flags.all = (gPlayerState.flags.all ^ 0x1000) | 0x4000000; gPlayerEntity.field_0x20 = 0x20000; - gPlayerEntity.nonPlanarMovement = 0x200; + gPlayerEntity.speed = 0x200; gPlayerEntity.animationState = this->animationState << 1; gPlayerEntity.direction = this->direction; gPlayerEntity.flags |= 0x80; diff --git a/src/object/minishSizedArchway.c b/src/object/minishSizedArchway.c new file mode 100644 index 00000000..240fdf95 --- /dev/null +++ b/src/object/minishSizedArchway.c @@ -0,0 +1,15 @@ +#include "global.h" +#include "entity.h" +#include "game.h" + +void MinishSizedArchway(Entity* this) { + if (this->action == 0) { + this->action = 1; + this->frameIndex = this->type; + this->collisionLayer = 2; + UpdateSpriteForCollisionLayer(this); + if (CheckIsDungeon()) { + this->spritePriority.b0 = 1; + } + } +} diff --git a/src/object/minishSizedEntrance.c b/src/object/minishSizedEntrance.c index 78410c6c..03467f41 100644 --- a/src/object/minishSizedEntrance.c +++ b/src/object/minishSizedEntrance.c @@ -1,11 +1,13 @@ #include "global.h" #include "entity.h" +#include "game.h" +#include "player.h" +#include "functions.h" -extern bool32 CheckIsDungeon(); -extern void sub_080AE068(Entity*); -extern void LoadFixedGFX(Entity*, u32); +extern void DoExitTransition(void*); extern void (*const gUnk_08122254[])(Entity*); +extern u16 gUnk_0812225C[]; void MinishSizedEntrance(Entity* this) { gUnk_08122254[this->action](this); @@ -22,3 +24,17 @@ void sub_08090EC0(Entity* this) { LoadFixedGFX(this, 0x184); } } + +void sub_08090F00(Entity* this) { + if (this->type == 1) { + Entity* parent = this->parent; + u32 mask = 1 << this->field_0xf; + if (!(parent->field_0x20 & mask)) { + DeleteThisEntity(); + } + } + if ((gPlayerState.flags.all & 0x80) && sub_080041A0(this, &gPlayerEntity, 4, 4) && + (gPlayerEntity.height.HALF.HI == 0) && (((u16)gPlayerState.field_0x90.HALF.LO) & gUnk_0812225C[this->type2])) { + DoExitTransition((Entity*)GetCurrentRoomProperty(this->actionDelay)); + } +} diff --git a/src/object/object1A.c b/src/object/object1A.c index 26ece918..f028481d 100644 --- a/src/object/object1A.c +++ b/src/object/object1A.c @@ -1,5 +1,6 @@ #include "global.h" #include "entity.h" +#include "random.h" #include "functions.h" extern void sub_08086A6C(); @@ -54,5 +55,5 @@ void sub_08086A6C(Entity* ent) { uVar1 = Random(); ent->field_0x20 = 163840; ent->direction = (uVar1 >> 16) & 31; - ent->nonPlanarMovement = uVar1 & 480; + ent->speed = uVar1 & 480; } diff --git a/src/object/object1C.c b/src/object/object1C.c index c12a6c1d..0c80735a 100644 --- a/src/object/object1C.c +++ b/src/object/object1C.c @@ -2,7 +2,6 @@ #include "entity.h" extern u32 CheckRectOnScreen(s16, s16, u32, u32); -extern void DeleteThisEntity(); void Object1C(Entity* this) { s32 iVar1; diff --git a/src/object/object1D.c b/src/object/object1D.c index 8442b227..f7343fbe 100644 --- a/src/object/object1D.c +++ b/src/object/object1D.c @@ -1,8 +1,6 @@ #include "global.h" #include "entity.h" -void DeleteThisEntity(); - extern void (*gUnk_081208A0[])(Entity*); void Object1D(Entity* this) { diff --git a/src/object/object2A.c b/src/object/object2A.c index ffd00460..dca66978 100644 --- a/src/object/object2A.c +++ b/src/object/object2A.c @@ -31,7 +31,7 @@ void sub_08089B18(Entity* this) { case 4: if (!CheckFlags(this->field_0x86.HWORD)) { this->spriteSettings.b.draw = FALSE; - this->previousActionFlag = 1; + this->subAction = 1; return; } } diff --git a/src/object/object49.c b/src/object/object49.c index 0479ce1f..82d39bd6 100644 --- a/src/object/object49.c +++ b/src/object/object49.c @@ -2,7 +2,7 @@ #include "audio.h" #include "entity.h" #include "functions.h" -#include "position.h" +#include "coord.h" #include "random.h" #include "structures.h" @@ -12,7 +12,6 @@ static void sub_0808F244(Entity*); extern void sub_0806FCF4(Entity*, u32, u32, u32); extern void sub_0808F5EC(Entity*); -extern bool32 sub_0806F3E4(Entity*); extern void (*const gUnk_08121E5C[])(Entity*); extern void (*const gUnk_08121E88[])(Entity*); @@ -151,13 +150,13 @@ void sub_0808F2C0(Entity* this) { void sub_0808F370(Entity* this) { if (this->action == 0) { - if (this->parent->previousActionFlag == 1) { + if (this->parent->subAction == 1) { this->action = 1; this->field_0x70.WORD = 0; sub_0808F5EC(this); } } else { - u8 flag = this->parent->previousActionFlag - 1; + u8 flag = this->parent->subAction - 1; if (flag < 5) { if (this->field_0x70.WORD == 0) { if (--(*(u32*)&this->field_0x74) == -1) { diff --git a/src/object/object7E.c b/src/object/object7E.c index 6c89947e..c456a841 100644 --- a/src/object/object7E.c +++ b/src/object/object7E.c @@ -1,6 +1,6 @@ #include "global.h" #include "entity.h" -#include "functions.h" +#include "coord.h" void Object7E(Entity* this) { diff --git a/src/object/object86.c b/src/object/object86.c index 9706e040..02e0b480 100644 --- a/src/object/object86.c +++ b/src/object/object86.c @@ -1,9 +1,10 @@ #include "global.h" #include "entity.h" +#include "coord.h" #include "player.h" #include "flags.h" +#include "functions.h" -extern u32 sub_080041A0(Entity*, Entity*, u32, u32); void sub_08099ECC(Entity*); extern void sub_0805E4E0(Entity*, u32); extern void sub_0805B390(u32); @@ -18,7 +19,7 @@ void sub_08099DD0(Entity* this) { this->collisionLayer = 1; this->spriteRendering.b3 = 3; this->spritePriority.b0 = 7; - this->previousActionFlag = 0; + this->subAction = 0; if (GetInventoryValue(0x46)) { this->action = 4; this->frameIndex = 0; @@ -31,7 +32,7 @@ void sub_08099DD0(Entity* this) { void sub_08099E10(Entity* this) { if (CheckLocalFlag(0x74)) { GetNextFrame(this); - if ((this->frames.all == 1) && (this->previousActionFlag == 0)) { + if ((this->frames.all == 1) && (this->subAction == 0)) { this->frames.all = 0; sub_08099ECC(this); } @@ -56,7 +57,7 @@ void sub_08099E58(Entity* this) { void sub_08099E8C(Entity* this) { if (sub_080041A0(this, &gPlayerEntity, 0xc, 0xc)) { - if (this->previousActionFlag == 0) { + if (this->subAction == 0) { sub_08099ECC(this); sub_0805E4E0(this, 0x1e); } @@ -70,7 +71,7 @@ void nullsub_534(Entity* this) { } void sub_08099ECC(Entity* this) { - this->previousActionFlag = 1; + this->subAction = 1; CopyPosition(this, &gPlayerEntity); gPlayerState.playerAction = 3; gPlayerState.field_0x34[4] = 0; diff --git a/src/object/object9E.c b/src/object/object9E.c index 858ee01b..f8e89b4e 100644 --- a/src/object/object9E.c +++ b/src/object/object9E.c @@ -1,11 +1,11 @@ #include "global.h" #include "entity.h" +#include "coord.h" #include "room.h" +#include "functions.h" extern Hitbox gUnk_080FD168; -extern void SetTile(u32, u32, u32); - void Object9E(Entity* this) { Entity* ent; u32 tilePos; diff --git a/src/object/objectA.c b/src/object/objectA.c index 3679e4bb..0e63b26f 100644 --- a/src/object/objectA.c +++ b/src/object/objectA.c @@ -2,6 +2,7 @@ #include "entity.h" #include "room.h" #include "flags.h" +#include "createObject.h" #include "functions.h" extern Hitbox gUnk_080FD170; diff --git a/src/object/objectA2.c b/src/object/objectA2.c index 01fd9fa6..0c3307d3 100644 --- a/src/object/objectA2.c +++ b/src/object/objectA2.c @@ -1,6 +1,7 @@ #include "global.h" #include "object.h" #include "menu.h" +#include "random.h" #include "structures.h" #include "functions.h" @@ -105,6 +106,6 @@ void sub_0809F448(Entity* this) { tmp += -0x80000 + (rand & 0xFFFFF); break; } - this->nonPlanarMovement = (tmp > 0 ? tmp : -tmp) / (tmp2->unk_1 << 8); + this->speed = (tmp > 0 ? tmp : -tmp) / (tmp2->unk_1 << 8); this->direction = sub_080045DA(tmp, 0) >> 3; } diff --git a/src/object/objectA8.c b/src/object/objectA8.c index 4cca37f2..c1a5193a 100644 --- a/src/object/objectA8.c +++ b/src/object/objectA8.c @@ -1,14 +1,10 @@ #include "global.h" #include "entity.h" - -extern Entity* CreateItemEntity(u32, u32, u32); -extern void DeleteThisEntity(); -extern void sub_08080CB4(Entity*); +#include "player.h" +#include "functions.h" extern void (*gUnk_08124824[])(Entity*); -extern Entity gPlayerEntity; - void ObjectA8(Entity* this) { if ((this->bitfield & 0x80) != 0) { switch (this->bitfield & 0x7f) { diff --git a/src/object/objectAF.c b/src/object/objectAF.c index c1d32b60..b678d81b 100644 --- a/src/object/objectAF.c +++ b/src/object/objectAF.c @@ -1,5 +1,6 @@ #include "global.h" #include "entity.h" +#include "coord.h" extern void sub_080A0640(Entity*); diff --git a/src/object/objectB2.c b/src/object/objectB2.c index 4722d2e9..0888ed38 100644 --- a/src/object/objectB2.c +++ b/src/object/objectB2.c @@ -1,7 +1,7 @@ #include "global.h" #include "entity.h" +#include "functions.h" -extern void sub_0806F69C(Entity*); extern u32 sub_080AE4CC(Entity*, u32, u32, u32); extern void* gUnk_02027EB4; @@ -22,12 +22,12 @@ void ObjectB2(Entity* this) { this->attachedEntity = pEVar3; InitializeAnimation(this, this->type); } - this->nonPlanarMovement = this->parent->nonPlanarMovement; + this->speed = this->parent->speed; sub_0806F69C(this); if (sub_080AE4CC(this->attachedEntity, this->x.HALF.HI, this->y.HALF.HI, 9) != 0) { DeleteThisEntity(); } - if (this->nonPlanarMovement < 0x41) { + if (this->speed < 0x41) { this->spriteSettings.b.draw ^= 1; if (--this->actionDelay == 0) { diff --git a/src/object/pinwheel.c b/src/object/pinwheel.c index d6a24471..7de61338 100644 --- a/src/object/pinwheel.c +++ b/src/object/pinwheel.c @@ -1,10 +1,9 @@ #include "global.h" #include "entity.h" -#include "functions.h" +#include "flags.h" +#include "createObject.h" extern u32 ReadBit(u32*, u32); -extern void DeleteThisEntity(); -extern u32 CheckLocalFlag(u32); extern u32 gUnk_020342F8; extern u16 gUnk_08125050[]; diff --git a/src/object/pot.c b/src/object/pot.c index cd73f9a8..d589662d 100644 --- a/src/object/pot.c +++ b/src/object/pot.c @@ -16,10 +16,8 @@ extern void (*const gUnk_0811F0C4[])(Entity*); extern Hitbox gUnk_080FD338; // TODO: should be const extern Hitbox gUnk_080FD340; // TODO: should be const -extern u32 sub_08016A30(Entity*); extern u32 sub_080001DA(u32, u32); extern void sub_08078930(Entity*); -extern u32 sub_080002B8(Entity*); extern void sub_08016A6C(Entity*); void Pot(Entity* this) { @@ -34,7 +32,7 @@ void sub_0808222C(Entity* this) { this->action = 1; this->hitbox = &gUnk_080FD338; - this->nonPlanarMovement = 0x80; + this->speed = 0x80; this->y.HALF.HI += 3; this->field_0x16 = 0; this->flags |= 0x80; @@ -62,7 +60,7 @@ void sub_08082310(Entity* this) { switch (var0) { case 0x13: this->action = 3; - this->previousActionFlag = 0; + this->subAction = 0; break; case 0x1D: SetTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer); @@ -86,7 +84,7 @@ void sub_08082310(Entity* this) { this->actionDelay = 32; this->action = 4; if (gPlayerState.flags.all & 0x80) { - this->nonPlanarMovement >>= 1; + this->speed >>= 1; this->actionDelay = 64; } SetTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer); @@ -114,7 +112,7 @@ void sub_08082310(Entity* this) { } void sub_080824F8(Entity* this) { - gUnk_0811F0A8[this->previousActionFlag](this); + gUnk_0811F0A8[this->subAction](this); } void sub_08082510(Entity* this) { @@ -125,7 +123,7 @@ void sub_08082510(Entity* this) { this->flags2 = gPlayerEntity.flags2; this->spriteOffsetY = 0; SetTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer); - this->previousActionFlag++; + this->subAction++; } void nullsub_511(Entity* this) { @@ -166,7 +164,7 @@ void sub_080825F0(Entity* this) { static void sub_08082608(Entity* this) { this->action = 1; - this->previousActionFlag = 0; + this->subAction = 0; } void sub_08082614(Entity* this) { @@ -185,7 +183,7 @@ void sub_08082614(Entity* this) { this->action = 1; if (gPlayerState.flags.all & 0x80) { - this->nonPlanarMovement <<= 1; + this->speed <<= 1; } this->field_0x70.HALF.LO = sub_080001DA(COORD_TO_TILE(this), this->collisionLayer); @@ -203,11 +201,11 @@ void sub_08082614(Entity* this) { } void sub_080826E4(Entity* this) { - gUnk_0811F0C4[this->previousActionFlag](this); + gUnk_0811F0C4[this->subAction](this); } void sub_080826FC(Entity* this) { - this->previousActionFlag = 1; + this->subAction = 1; this->field_0x1d = 48; this->actionDelay = 0; } diff --git a/src/object/railtrack.c b/src/object/railtrack.c index 2e3a3d66..52a74bc3 100644 --- a/src/object/railtrack.c +++ b/src/object/railtrack.c @@ -2,13 +2,12 @@ #include "entity.h" #include "room.h" #include "flags.h" +#include "functions.h" extern u32* GetLayerByIndex(u32); extern void sub_08085394(Entity*); extern void sub_0808543C(Entity*); -extern void EnqueueSFX(u32); extern u32 sub_080854A8(Entity*); -extern void SetTile(u32, u32, u32); extern void (*const gUnk_081205D0[])(Entity*); diff --git a/src/object/smoke.c b/src/object/smoke.c index 5ec708b9..86c75efc 100644 --- a/src/object/smoke.c +++ b/src/object/smoke.c @@ -1,9 +1,8 @@ #include "global.h" #include "entity.h" +#include "random.h" #include "functions.h" -extern void sub_0806F69C(Entity*); - extern void (*const gUnk_08121060[])(Entity*); extern void (*const gUnk_08121070[])(Entity*); @@ -37,7 +36,7 @@ void sub_0808A46C(Entity* this) { void sub_0808A484(Entity* this) { this->action = 1; this->spriteSettings.b.draw = TRUE; - this->nonPlanarMovement = 0x40; + this->speed = 0x40; this->direction = 6; this->spriteRendering.b3 = 1; this->spritePriority.b0 = 0; diff --git a/src/object/thoughtBubble.c b/src/object/thoughtBubble.c index 596cb382..5e77d9e1 100644 --- a/src/object/thoughtBubble.c +++ b/src/object/thoughtBubble.c @@ -1,10 +1,6 @@ #include "global.h" #include "entity.h" - -extern void InitializeAnimation(Entity*, u32); -extern void SoundReq(u32); -extern void DeleteThisEntity(); -extern void GetNextFrame(Entity*); +#include "functions.h" extern void (*const ThoughtBubble_Behaviors[])(Entity*); diff --git a/src/object/treeHidingPortal.c b/src/object/treeHidingPortal.c index 9236ce5c..53f593bb 100644 --- a/src/object/treeHidingPortal.c +++ b/src/object/treeHidingPortal.c @@ -4,19 +4,17 @@ #include "flags.h" #include "player.h" #include "room.h" +#include "structures.h" +#include "functions.h" extern void sub_0809E96C(Entity*); -extern u32 sub_0800419C(Entity*, Entity*, u32, u32); extern void CreateSparkle(Entity*); extern u32 sub_0809E9A0(void); -extern void sub_08078A90(u32); extern void sub_0809E918(Entity*); -extern void SoundReq(u32); extern void CreateMinishEntrance(u32 tile); extern void (*const gUnk_08124354[])(Entity*); -extern u32 gScreenTransition; extern s16 gUnk_08124364[]; void TreeHidingPortal(Entity* this) { @@ -37,7 +35,7 @@ void sub_0809E86C(Entity* this) { if (sub_0800419C(this, &gPlayerEntity, 0x30, 0x30)) { if (CheckGlobalFlag(EZERO_1ST)) { - if (((gScreenTransition & 3) == 0)) { + if (((gScreenTransition.frameCount & 3) == 0)) { CreateSparkle(this); } } diff --git a/src/object/well.c b/src/object/well.c index fda35fed..86710ac6 100644 --- a/src/object/well.c +++ b/src/object/well.c @@ -2,11 +2,7 @@ #include "entity.h" #include "room.h" #include "player.h" - -void SetTile(u32 tileIndex, s32 tilePosition, s32 layerIndex); -s32 GetTileType(s32 tilePosition, s32 layerIndex); -void sub_08078B48(); -void DeleteThisEntity(); +#include "functions.h" extern void (*gUnk_08124C08[])(Entity*); diff --git a/src/object/windTribeFlag.c b/src/object/windTribeFlag.c index 9c769808..bc9d0fa3 100644 --- a/src/object/windTribeFlag.c +++ b/src/object/windTribeFlag.c @@ -1,6 +1,6 @@ #include "global.h" #include "entity.h" -#include "functions.h" +#include "random.h" void WindTribeFlag(Entity* this) { if (this->action == 0) { diff --git a/src/object/windcrest.c b/src/object/windcrest.c index ffd01ce6..b21c5ee0 100644 --- a/src/object/windcrest.c +++ b/src/object/windcrest.c @@ -1,15 +1,10 @@ #include "global.h" #include "audio.h" #include "entity.h" -#include "functions.h" #include "save.h" #include "script.h" -extern void sub_0807DD64(Entity*); -extern void sub_0807DDE4(Entity*); extern void sub_08078850(Entity*, u32, u32, u8*); -extern void SoundReq(u32); -extern Entity* CreateFx(Entity*, u32, u32); extern u8 gUnk_08125010; @@ -19,8 +14,8 @@ void Windcrest(Entity* this) { this->frameIndex = 0; sub_0807DD64(this); } - sub_0807DDAC(this, NULL); - sub_0807DDE4(this); + ExecuteScriptForEntity(this, NULL); + HandleEntity0x82Actions(this); } void sub_080A2124(Entity* this) { diff --git a/src/player.c b/src/player.c index 5c1e2b66..c542c062 100644 --- a/src/player.c +++ b/src/player.c @@ -3,39 +3,66 @@ #include "entity.h" #include "player.h" #include "textbox.h" -#include "functions.h" -#include "readKeyInput.h" +#include "utils.h" #include "area.h" #include "save.h" +#include "game.h" +#include "functions.h" -extern const void (*const gUnk_0811B9E0[])(Entity*); -extern const void (*const gUnk_0811BA60[])(Entity*); -extern const void (*const gUnk_0811BA68[])(Entity*); -extern const void (*const gUnk_0811BA74[])(Entity*); -extern const void (*const gUnk_0811BA7C[])(Entity*); -extern const void (*const gUnk_0811BA88[])(Entity*); -extern const void (*const gUnk_0811BA94[])(Entity*); -extern const void (*const gUnk_0811BA9C[])(Entity*); +static void (*const sPlayerActions[])(Entity*); +extern void (*const gUnk_0811BA60[])(Entity*); +extern void (*const gUnk_0811BA68[])(Entity*); +extern void (*const gUnk_0811BA74[])(Entity*); +extern void (*const gUnk_0811BA7C[])(Entity*); +extern void (*const gUnk_0811BA88[])(Entity*); +extern void (*const gUnk_0811BA94[])(Entity*); +extern void (*const gUnk_0811BA9C[])(Entity*); +extern void (*const gUnk_0811BAD4[])(Entity*); +extern void (*const gUnk_0811BAE4[])(Entity*); +extern void (*const gUnk_0811BB3C[])(Entity*); -extern void sub_08079458(); +extern void RespawnPlayer(); extern void sub_080797EC(); extern void sub_08079E08(); extern void sub_08078F60(); +extern void sub_0806F948(); +extern void sub_08077698(); +extern void sub_0805E544(); +extern void sub_080717F8(); +extern void DoExitTransition(); +extern void UnfreezeTime(); +extern void sub_08071A6C(); +extern void sub_08052BB8(); +extern void sub_08079258(); +extern void sub_08071AF0(); +extern void sub_080728AC(); +extern void sub_0807A298(); +extern u32 sub_08079B24(); +extern void sub_08079708(); +extern void sub_080792D8(); + +typedef struct { + u8 frame; + u8 dummy; + u16 speed; +} PushFrames; + +extern PushFrames gUnk_0811BAF0[]; extern Hitbox gUnk_08114F88; +extern ScreenTransitionData gUnk_0813AB58; -// inject -void sub_08070680(Entity* this) { - gUnk_0811B9E0[this->action](this); +void DoPlayerAction(Entity* this) { + sPlayerActions[this->action](this); } -void sub_08070698(Entity* this) { +void PlayerInit(Entity* this) { Entity* ent; gPlayerState.field_0x0[0] = 0xff; - gPlayerState.field_0x16[0] = gPlayerEntity.x.HALF.HI; - gPlayerState.field_0x16[1] = gPlayerEntity.y.HALF.HI; - this->flags = this->flags | 0x80; + gPlayerState.startPosX = gPlayerEntity.x.HALF.HI; + gPlayerState.startPosY = gPlayerEntity.y.HALF.HI; + this->flags |= 0x80; this->spritePriority.b0 = 0xc; this->spritePriority.b1 = 1; this->spriteSettings.b.shadow = 1; @@ -66,7 +93,7 @@ void sub_08070698(Entity* this) { sub_08079938(); gPlayerState.field_0xa8 = 7; sub_0807ACCC(this); - ent = FindEntityInListByForm(0x6, 0xf, 0x6, 0xb, 0x0); + ent = FindEntity(0x6, 0xf, 0x6, 0xb, 0x0); if (ent != NULL) { DeleteEntity(ent); } @@ -75,9 +102,7 @@ void sub_08070698(Entity* this) { } // PlayerState.flags need to be 100% before this one can reasonably be done -NONMATCH("asm/non_matching/player/sub_08070794.s", void sub_08070794(Entity* this)) { -} -END_NONMATCH +ASM_FUNC("asm/non_matching/player/sub_08070794.s", void PlayerNormal(Entity* this)) void sub_08070BEC(Entity* this, u32 r0) { if (r0 & 1) @@ -89,12 +114,12 @@ void sub_08070BEC(Entity* this, u32 r0) { sub_08079E08(); } -void sub_08070C10(Entity* this) { - gPlayerState.field_0xd[0] = 0xFF; +void PlayerFall(Entity* this) { + gPlayerState.field_0xd = 0xFF; gPlayerState.pushedObject = 0x80; gPlayerState.field_0xa8 = 10; - gUnk_0811BA60[this->previousActionFlag](this); + gUnk_0811BA60[this->subAction](this); } void sub_08070C3C(Entity* this) { @@ -112,7 +137,7 @@ void sub_08070C3C(Entity* this) { else gPlayerState.field_0x8 = 0x1b8; - this->previousActionFlag++; + this->subAction++; this->flags &= ~0x80; this->spritePriority.b1 = 0; ResetPlayer(); @@ -129,24 +154,24 @@ void sub_08070CB4(Entity* this) { this->spriteSettings.b.draw = 0; } else { gPlayerState.flags.all &= ~(0x4 | 0x8000); - sub_08079458(); + RespawnPlayer(); gPlayerState.field_0xa = 0; - this->hurtBlinkTime = 0x20; + this->iframes = 32; ModHealth(-2); } } } -void sub_08070D20(Entity* this) { - gUnk_0811BA68[this->previousActionFlag](this); +void PlayerBounce(Entity* this) { + gUnk_0811BA68[this->subAction](this); } void sub_08070D38(Entity* this) { this->flags &= ~0x80; this->direction = ((this->animationState & 0xe) << 2) ^ 0x10; - this->nonPlanarMovement = 0x100; + this->speed = 0x100; this->field_0x42 = 0; - this->previousActionFlag++; + this->subAction++; this->actionDelay = gPlayerState.field_0x38; this->spriteIndex = 1; @@ -202,7 +227,7 @@ NONMATCH("asm/non_matching/player/sub_08070DC4.s", void sub_08070DC4(Entity* thi this->spriteIndex = 1; this->actionDelay = 8; - this->previousActionFlag++; + this->subAction++; if ((gPlayerState.flags.all & 0x80) == 0) gPlayerState.field_0x8 = 0x100; @@ -225,7 +250,7 @@ void sub_08070E9C(Entity* this) { gPlayerState.field_0x27[0] = 4; gPlayerState.field_0xa8 = 0x13; sub_0807A1B8(); - gUnk_0811BA74[this->previousActionFlag](this); + gUnk_0811BA74[this->subAction](this); } } @@ -233,7 +258,7 @@ void sub_08070EDC(Entity* this) { this->scriptedScene = 2; if ((gTextBox.doTextBox & 0x7f) != 0) - this->previousActionFlag = 1; + this->subAction = 1; if ((gPlayerState.flags.all & 0x80) == 0) sub_08079938(); @@ -249,13 +274,13 @@ void sub_08070f24(Entity* this) { } } -void sub_08070F50(Entity* this) { +void PlayerItemGet(Entity* this) { Entity* child; u8* temp; // todo: retype gPlayerState.field_0xa8 = 0x15; this->flags &= ~(0x80); - gUnk_0811BA7C[this->previousActionFlag](this); + gUnk_0811BA7C[this->subAction](this); child = this->attachedEntity; if (child != NULL) { @@ -276,7 +301,7 @@ void sub_08070FA4(Entity* this) { gPlayerState.jumpStatus = 0; if ((gPlayerState.flags.all & 0x80) == 0) { - if ((gPlayerState.flags.all & 0x8) != 0) { + if (gPlayerState.flags.all & 0x8) { if (sub_080542AC(gPlayerState.field_0x38)) { temp = 0x45e; } else { @@ -292,16 +317,15 @@ void sub_08070FA4(Entity* this) { gPlayerState.field_0x8 = temp; } - this->previousActionFlag = 1; + this->subAction = 1; ResetPlayer(); sub_08078F60(); } void sub_08071020(Entity* this) { UpdateAnimationSingleFrame(this); - if (this->frames.all != 0) { - this->previousActionFlag = 2; - } + if (this->frames.all != 0) + this->subAction = 2; } void sub_08071038(Entity* this) { @@ -311,24 +335,24 @@ void sub_08071038(Entity* this) { if (sub_08078EFC() || (gTextBox.doTextBox & 0x7f)) return; - if ((this->frames.all & 0x80) != 0) { + if (this->frames.all & 0x80) { this->attachedEntity = 0; this->field_0x42 = 0; - this->hurtBlinkTime = 0xf8; + this->iframes = 248; gPlayerState.jumpStatus = 0; sub_080791D0(); } } -void sub_08071084(Entity* this) { +void PlayerJump(Entity* this) { gPlayerState.field_0xa8 = 0xb; - gUnk_0811BA88[this->previousActionFlag](this); + gUnk_0811BA88[this->subAction](this); } void sub_080710A8(Entity* this) { u32 temp; - this->previousActionFlag++; + this->subAction++; gPlayerState.flags.all |= 1; gPlayerState.flags.all &= ~(0x400 | 0x800); @@ -354,7 +378,7 @@ void sub_080710A8(Entity* this) { asm("lsl r0, r0, #0x4"); this->field_0x20 = (temp - 4) * 64 * 64; - this->nonPlanarMovement = 0x100; + this->speed = 256; sub_0807A108(); SoundReq(SFX_PLY_JUMP); SoundReq(SFX_PLY_VO4); @@ -368,7 +392,7 @@ void sub_08071130(Entity* this) { if (gPlayerState.field_0x1a[1] == 0) { UpdateAnimationSingleFrame(this); - if ((this->frames.all & 1)) + if (this->frames.all & 1) return; } @@ -402,7 +426,7 @@ void sub_08071130(Entity* this) { this->actionDelay = 6; if (((gPlayerState.heldObject | gPlayerState.keepFacing) == 0) && ((gPlayerState.flags.all & 0x80) == 0)) { - if ((gPlayerState.flags.all & 0x8) != 0) { + if (gPlayerState.flags.all & 0x8) { gPlayerState.field_0x8 = 0x424; } else { gPlayerState.field_0x8 = 0x820; @@ -410,7 +434,7 @@ void sub_08071130(Entity* this) { this->animIndex = 0xff; } - this->previousActionFlag++; + this->subAction++; sub_08078F60(); this->field_0x42 = 0; SoundReq(SFX_PLY_LAND); @@ -429,33 +453,31 @@ void sub_08071208(Entity* this) { } } -void sub_08071248(Entity* this) { +void PlayerDrown(Entity* this) { gPlayerState.field_0xa8 = 0x16; gPlayerState.flags.all |= 4; this->flags &= ~0x80; - gUnk_0811BA94[this->previousActionFlag](this); + gUnk_0811BA94[this->subAction](this); } void sub_0807127C(Entity* this) { - this->previousActionFlag = 1; + this->subAction = 1; this->spritePriority.b1 = 0; - if ((gPlayerState.flags.all & 0x80) != 0) { + if (gPlayerState.flags.all & 0x80) { this->actionDelay = 0x3c; gPlayerState.field_0x8 = 0xc19; SoundReq(0x84); } else { - if ((gPlayerState.flags.all & 0x10000) == 0) { + if ((gPlayerState.flags.all & 0x10000) == 0) sub_08004168(this); - } CreateFx(this, 11, 0); - if ((gPlayerState.flags.all & 8) == 0) { + if ((gPlayerState.flags.all & 8) == 0) gPlayerState.field_0x8 = 0x72c; - } else { + else gPlayerState.field_0x8 = 0x44c; - } } ResetPlayer(); } @@ -481,28 +503,29 @@ void sub_080712F0(Entity* this) { return; this->field_0x42 = 0; - this->hurtBlinkTime = 0x20; + this->iframes = 32; this->spritePriority.b1 = 1; this->spriteSettings.b.draw = FALSE; - gPlayerState.flags.all &= ~(0x4); - sub_08079458(); + gPlayerState.flags.all &= ~0x4; + RespawnPlayer(); } -void sub_08071380(Entity* this) { +static void PlayerUsePortal(Entity* this) { gPlayerState.field_0xa8 = 0xe; - gUnk_0811BA9C[this->previousActionFlag](this); + gUnk_0811BA9C[this->subAction](this); - if ((this->previousActionFlag == 7) || (this->previousActionFlag < 3)) + // probably a switch + if ((this->subAction == 7) || (this->subAction < 3)) return; if ((gPlayerState.flags.all & 0x20) == 0) return; - if ((gInput.newKeys & 0x102) == 0) + if ((gInput.newKeys & (0x100 | 0x2)) == 0) return; - if (CheckIsDungeon() || gArea.field_0x17 == 3) { - this->previousActionFlag = 7; + if (CheckIsDungeon() || gArea.curPortalType == 3) { + this->subAction = 7; this->actionDelay = 30; DoFade(7, 16); SoundReq(0xf8); @@ -511,19 +534,19 @@ void sub_08071380(Entity* this) { } } -void sub_08071400(Entity* this) { +static void PortalJumpOnUpdate(Entity* this) { u16 x; u16 y; - this->flags &= ~(0x80); + this->flags &= ~0x80; this->field_0x42 = 0; - x = gArea.field_0x12; - y = gArea.field_0x14; + x = gArea.curPortalX; + y = gArea.curPortalY; if ((this->x.HALF.HI != x) || (this->y.HALF.HI != y)) { - this->direction = sub_080045D4(this->x.HALF.HI, this->y.HALF.HI, gArea.field_0x12, gArea.field_0x14); - this->nonPlanarMovement = 0x100; + this->direction = sub_080045D4(this->x.HALF.HI, this->y.HALF.HI, gArea.curPortalX, gArea.curPortalY); + this->speed = 256; sub_08079E08(); } @@ -532,17 +555,542 @@ void sub_08071400(Entity* this) { if (gPlayerState.jumpStatus == 0) { gPlayerState.flags.all |= 0x20; - this->previousActionFlag = 1; + this->subAction = 1; this->animationState = 4; this->spriteSettings.b.flipX = FALSE; - if (gArea.field_0x17 == 4) { + if (gArea.curPortalType == 4) { gPlayerState.field_0x8 = 0x52c; } } this->actionDelay = 8; - if (gArea.field_0x17 != 3) { + if (gArea.curPortalType != 3) { this->spritePriority.b0 = 3; } } + +static void PortalStandUpdate(Entity* this) { + switch (gArea.curPortalType) { + case 4: + case 5: + sub_0806F948(&gPlayerEntity); + break; + } + + if ((gPlayerState.field_0xd & 0x84) == 0) { + if (this->direction != gPlayerState.field_0xd) { + this->actionDelay = 8; + } + if (--this->actionDelay == 0xff) { + this->direction = gPlayerState.field_0xd; + this->animationState = this->direction >> 2; + this->field_0x20 = 0x20000; + this->speed = 256; + this->action = 9; + this->subAction = 7; + this->field_0xf = 0; + gPlayerState.field_0x8 = (gPlayerState.flags.all & 8) ? 0x41C : 0x80C; + gPlayerState.flags.all &= ~0x20; + return; + } + this->direction = gPlayerState.field_0xd; + } else { + this->actionDelay = 8; + } + + if (gArea.curPortalType == 4) { + if (this->frames.all == 0) { + UpdateAnimationSingleFrame(this); + return; + } + } else { + sub_08077698(this); + } + sub_08079938(); +} + +static void PortalActivateInit(Entity* this) { + gRoomControls.cameraTarget = NULL; + gUnk_02034490[0] = 1; + this->subAction = 3; + this->field_0xf = 0x1e; + gPlayerState.field_0x8 = 0x738; + CreateObjectWithParent(this, 6, 1, 0); + sub_08077B20(); + sub_0805E544(); +} + +static void PortalActivateUpdate(Entity* this) { + if (this->field_0xf) + return; + + UpdateAnimationSingleFrame(this); + + if (gPlayerState.flags.all & 0x80) + this->subAction = 4; +} + +static void PortalShrinkInit(Entity* this) { + this->subAction = 5; + this->spritePriority.b1 = 0; + this->field_0xf = 0; + this->spriteRendering.b0 = 3; + *(u32*)&this->field_0x80.HWORD = 0x100; + *(u32*)&this->cutsceneBeh = 0x100; + sub_0805EC9C(this, 0x100, 0x100, 0); + gPlayerState.field_0x8 = 0x2c3; + gPlayerState.flags.all |= 0x80; + SoundReq(0x16f); +} + +// horrible +ASM_FUNC("asm/non_matching/player/sub_08071634.s", static void PortalShrinkUpdate(Entity* this)) + +static void PortalEnterUpdate(Entity* this) { + if (this->actionDelay == 0) { + if (sub_08003FC4(this, 0x2000)) + return; + + this->spriteSettings.b.draw = FALSE; + + if (gArea.curPortalType == 3) { + if (--this->field_0xf == 0) + sub_080717F8(this); + return; + } + if (gArea.curPortalType == 6) + DoExitTransition(&gUnk_0813AB58); + else + gArea.playShrinkSeq = 1; + + return; + } + this->actionDelay--; +} + +static void PortalUnknownUpdate(Entity* this) { + if (gFadeControl.active) + return; + + if (this->actionDelay != 0) { + this->actionDelay--; + return; + } + + sub_080717F8(this); + sub_080500F4(0x10); +} + +extern s16 gUnk_0811BAC4[]; + +void sub_080717F8(Entity* this) { + u32 x; + u32 y; + this->animationState = gArea.curPortalExitDirection << 1; + this->x.HALF.HI = gArea.curPortalX + gUnk_0811BAC4[gArea.curPortalExitDirection * 2]; + this->y.HALF.HI = gArea.curPortalY + gUnk_0811BAC4[gArea.curPortalExitDirection * 2 + 1]; + gArea.unk1A = 0xb4; + gUnk_02034490[0] = 0; + this->action = 9; + this->subAction = 0; + gPlayerState.flags.all = (gPlayerState.flags.all & ~0x20) | 0x80; + sub_0805EC60(this); + UnfreezeTime(); +} + +void PlayerTalkEzlo(Entity* this) { + if (sub_08078EFC()) { + sub_08056360(); + sub_08071A6C(); + } else { + gPlayerState.field_0xa8 = 0x13; + this->flags &= ~0x80; + gUnk_0811BAD4[this->subAction](this); + } +} + +void sub_080718A0(Entity* this) { + ResetPlayer(); + gUnk_03000B80.filler[0x63] = 0; + this->iframes = 0; + gUnk_03003DC0.unk0 = 6; + this->scriptedScene = 6; + + if (gPlayerState.flags.all & 0x80) { + this->subAction = 2; + this->spritePriority.b1 = 0; + sub_08052BB8(); + return; + } + + if (gPlayerState.jumpStatus == 0) { + this->subAction++; + + if (this->animationState == 2) + gPlayerState.field_0x8 = 0x3ca; + else + gPlayerState.field_0x8 = 0x3c6; + + this->spriteSettings.b.flipX = 0; + return; + } + + if (!sub_08003FC4(this, 0x2000)) + gPlayerState.jumpStatus = 0; +} + +void sub_0807193C(Entity* this) { + Entity* child; + + UpdateAnimationSingleFrame(this); + if (this->frames.all & 0x80) { + this->subAction++; + child = CreateObjectWithParent(this, 6, 0, 0); + this->attachedEntity = child; + if (child != NULL) { + if (this->animationState == 2) + gPlayerState.field_0x8 = 0x3cc; + else + gPlayerState.field_0x8 = 0x3c7; + sub_08052BB8(); + } + } +} + +void sub_08071990(Entity* this) { + u32 temp; + + if ((gTextBox.doTextBox & 0x7f) == 0) { + this->subAction++; + + if ((gPlayerState.flags.all & 0x80) == 0) { + if (this->animationState == 2) + gPlayerState.field_0x8 = 0x3cd; + else + gPlayerState.field_0x8 = 0x3c9; + } else { + sub_08071A6C(); + sub_08079258(); + } + return; + } + + if (gPlayerState.flags.all & 0x80) + return; + + if (this->animationState == 2) + temp = 4; + else + temp = 0; + + if (this->attachedEntity->actionDelay != 0) { + if ((u8)(temp + 200) != this->animIndex) { + gPlayerState.field_0x8 = temp + 0x3c8; + return; + } + } else { + if ((u8)(temp + 199) != this->animIndex) { + gPlayerState.field_0x8 = temp + 0x3c7; + return; + } + } + UpdateAnimationSingleFrame(this); +} + +void sub_08071A4C(Entity* this) { + UpdateAnimationSingleFrame(this); + if (this->frames.all & 0x80) { + sub_08071A6C(); + sub_0807921C(); + } +} + +void sub_08071A6C(void) { + gUnk_03003DC0.unk0 = 0; + gPlayerEntity.scriptedScene = gPlayerEntity.scriptedScene2; +} + +void PlayerPush(Entity* this) { + gPlayerState.field_0xa8 = 0x19; + gUnk_0811BAE4[this->subAction](this); +} + +void sub_08071AB0(Entity* this) { + u32 speed; + + this->subAction++; + gPlayerState.flags.all |= 1; + if (this->type == 1) { + this->speed = 0; + this->actionDelay = 0; + this->field_0xf = 1; + } else { + this->speed = (gPlayerState.flags.all & 0x80) ? 64 : 128; + } + sub_08071AF0(this); +} + +void sub_08071AF0(Entity* this) { + gPlayerState.field_0x80 = 0; + UpdateAnimationSingleFrame(this); + if (this->type == 1) { + if (--this->field_0xf == 0) { + if (gUnk_0811BAF0[this->actionDelay].frame != 0xff) { + this->field_0xf = gUnk_0811BAF0[this->actionDelay].frame; + this->speed = gUnk_0811BAF0[this->actionDelay].speed; + this->actionDelay++; + } else { + this->subAction++; + return; + } + } + } else { + gPlayerState.pushedObject--; + if ((gPlayerState.pushedObject & 0x7f) == 0) { + this->subAction++; + } + } + sub_08079E08(); +} + +void sub_08071B60(Entity* this) { + gPlayerState.pushedObject = 2; + gPlayerState.flags.all &= ~0x1; + this->type = 0; + this->field_0x42 = 0; + sub_080728AC(this); + this->field_0xf = 6; + if ((gPlayerState.flags.all & 0x80) == 0) { + gPlayerState.field_0x8 = 0x104; + this->spriteIndex = 3; + InitAnimationForceUpdate(this, (this->animationState >> 1) + 0x3c); + } +} + +extern void (*const gUnk_0811BB2C[])(Entity*); + +void PlayerMinishDie(Entity* this) { + this->flags &= ~0x80; + gUnk_0811BB2C[this->subAction](this); + gPlayerState.field_0xa8 = 0x12; +} + +void sub_08071BDC(Entity* this) { + u32 temp; + + if (gPlayerState.flags.all & (0x10 | 0x100)) + return; + + if (sub_08003FC4(this, 0x2000)) { + if ((gPlayerState.flags.all & 8) != 0) + gPlayerState.field_0x8 = 0x420; + else + gPlayerState.field_0x8 = 0x810; + return; + } + + gPlayerState.playerAction = 0; + if (gPlayerState.flags.all & 0x80) { + if ((u8)(gPlayerState.field_0x10[2] - 8) < 3) { + sub_0807A298(this); + RespawnPlayer(); + this->action = 10; + } + temp = 0xc1a; + } else { + temp = (gPlayerState.flags.all & 8) ? 0x459 : 0x1bc; + } + gPlayerState.field_0x8 = temp; + + gPlayerState.flags.all &= ~(0x1000000 | 0x200000 | 0x40000 | 0x800 | 0x400 | 0x100 | 0x1); + this->subAction = 1; + this->animationState = 4; + this->spritePriority.b1 = 1; + this->spriteSettings.b.draw = 3; + gPlayerState.jumpStatus = 0; + gPlayerState.pushedObject = 0; + sub_0800451C(this); + ResetPlayer(); + SoundReq(0x87); +} + +void sub_08071CAC(Entity* this) { + UpdateAnimationSingleFrame(this); + if (this->frames.all & 0x80) { + u32 temp; + if ((gPlayerState.flags.all & 0x80) == 0) + temp = (gPlayerState.flags.all & 8) ? 0x45a : 0x2bd; + else + temp = 0xc1b; + gPlayerState.field_0x8 = temp; + + this->subAction = 2; + this->actionDelay = 0xf0; + SoundReq(0x7b); + } +} + +void sub_08071D04(Entity* this) { + int idx; + int deltaHealth; + + UpdateAnimationSingleFrame(this); + if (this->frames.all == 0) + return; + + deltaHealth = 0; + idx = GetBottleContaining(0x28); + if (idx != 0) { + gSave.stats.bottles[idx - 1] = 0x20; + CreateObject(0x40, 0x60, 2); + deltaHealth = 32; + } + + if (deltaHealth != 0) { + ModHealth(deltaHealth); + this->subAction = 3; + gPlayerState.field_0x3c[0] = 0; + this->direction = 0xff; + this->speed = 0; + this->field_0x20 = 0x18000; + gPlayerState.jumpStatus = 1; + gPlayerState.swimState = 0; + return; + } + + gScreenTransition.field_0x4[1] = 1; +} + +void sub_08071D80(Entity* this) { + UpdateAnimationSingleFrame(this); + gPlayerState.field_0x14 = 1; + sub_08073904(this); + if ((gPlayerState.jumpStatus & 7) == 3) { + gPlayerState.jumpStatus = 0; + this->iframes = 226; + UnfreezeTime(); + sub_080791D0(); + } +} + +void sub_08071DB8(Entity* this) { + gUnk_0811BB3C[this->subAction](this); +} + +void sub_08071DD0(Entity* this) { + this->actionDelay = gPlayerState.field_0x38; + if (gPlayerState.field_0x39 != 0) { + gPlayerState.field_0x39 = 0; + this->subAction = 2; + gPlayerState.field_0x8 = 0x100; + } else { + this->subAction = 1; + gPlayerState.field_0x8 = 0x114; + } +} + +void sub_08071E04(Entity* this) { + if ((this->height.WORD != 0) && (gPlayerState.field_0x14 == '\0')) { + sub_0807A1B8(); + if (gPlayerState.field_0x10[2] == 1) { + gPlayerState.field_0x10[1] = 7; + gPlayerState.flags.all |= 0x200; + sub_080791BC(); + return; + } + } + + UpdateAnimationSingleFrame(this); + if (sub_08079B24() == 0) { + sub_08079708(this); + return; + } + + sub_080792D8(); + if (sub_0807953C()) + this->actionDelay -= 2; + else + this->actionDelay -= 1; + + if ((s8)this->actionDelay < 1) + sub_080791BC(); +} + +void sub_08071E74(Entity* this) { + u32 temp; + + sub_08003FC4(this, 0x2000); + sub_08079E08(); + temp = this->actionDelay--; + if (temp == 0) + sub_080791BC(); +} + +void PlayerInit(Entity*); +void PlayerNormal(Entity*); +void PlayerInit(Entity*); +void PlayerFall(Entity*); +void PlayerJump(Entity*); +void PlayerPush(Entity*); +void PlayerBounce(Entity*); +void sub_08070E9C(Entity*); +void PlayerItemGet(Entity*); +void PlayerMinish(Entity*); +void PlayerMinishDie(Entity*); +void sub_08071DB8(Entity*); +void PlayerEmptyBottle(Entity*); +void PlayerFrozen(Entity*); +void sub_0807204C(Entity*); +void sub_080720DC(Entity*); +void PlayerPull(Entity*); +void PlayerLava(Entity*); +void PlayerWarp(Entity*); +void sub_08072454(Entity*); +void PlayerDrown(Entity*); +void PlayerUsePortal(Entity*); +void PlayerTalkEzlo(Entity*); +void PlayerRoomTransition(Entity*); +void PlayerRoll(Entity*); +void sub_080728AC(Entity*); +void PlayerInHole(Entity*); +void sub_08072C9C(Entity*); +void sub_08074C44(Entity*); +void sub_08072F34(Entity*); +void PlayerUseEntrance(Entity*); +void PlayerParachute(Entity*); + +static void (*const sPlayerActions[])(Entity*) = { + [PLAYER_INIT] = PlayerInit, + [PLAYER_NORMAL] = PlayerNormal, + [PLAYER_DUMMY] = PlayerInit, + [PLAYER_FALL] = PlayerFall, + [PLAYER_JUMP] = PlayerJump, + [PLAYER_PUSH] = PlayerPush, + [PLAYER_BOUNCE] = PlayerBounce, + [PLAYER_08070E9C] = sub_08070E9C, + [PLAYER_ITEMGET] = PlayerItemGet, + [PLAYER_MINISH] = PlayerMinish, + [PLAYER_MINISHDIE] = PlayerMinishDie, + [PLAYER_08071DB8] = sub_08071DB8, + [PLAYER_EMPTYBOTTLE] = PlayerEmptyBottle, + [PLAYER_FROZEN] = PlayerFrozen, + [PLAYER_0807204C] = sub_0807204C, + [PLAYER_080720DC] = sub_080720DC, + [PLAYER_PULL] = PlayerPull, + [PLAYER_LAVA] = PlayerLava, + [PLAYER_WARP] = PlayerWarp, + [PLAYER_08072454] = sub_08072454, + [PLAYER_DROWN] = PlayerDrown, + [PLAYER_USEPORTAL] = PlayerUsePortal, + [PLAYER_TALKEZLO] = PlayerTalkEzlo, + [PLAYER_ROOMTRANSITION] = PlayerRoomTransition, + [PLAYER_ROLL] = PlayerRoll, + [PLAYER_080728AC] = sub_080728AC, + [PLAYER_INHOLE] = PlayerInHole, + [PLAYER_08072C9C] = sub_08072C9C, + [PLAYER_08074C44] = sub_08074C44, + [PLAYER_08072F34] = sub_08072F34, + [PLAYER_USEENTRANCE] = PlayerUseEntrance, + [PLAYER_PARACHUTE] = PlayerParachute, +}; diff --git a/src/playerItem.c b/src/playerItem.c index 364502d0..7eca5211 100644 --- a/src/playerItem.c +++ b/src/playerItem.c @@ -1,4 +1,6 @@ -extern void DeleteEntity(); +#include "global.h" +#include "functions.h" + extern void sub_080A7544(); extern void sub_0801B188(); extern void sub_0801B45C(); diff --git a/src/position.c b/src/position.c deleted file mode 100644 index 628042c3..00000000 --- a/src/position.c +++ /dev/null @@ -1,51 +0,0 @@ -#include "global.h" -#include "entity.h" -#include "position.h" -#include "functions.h" - -extern u8 gUnk_08114F78[]; -extern u8 gUnk_08114F80[]; - -void CopyPosition(Entity* param_1, Entity* param_2) { - PositionRelative(param_1, param_2, 0, 0); -} - -void PositionEntityOnTop(Entity* ent, Entity* ent2) { - PositionRelative(ent, ent2, 0, 0); - ResolveEntityOnTop(ent, ent2); -} - -void PositionRelative(Entity* source, Entity* target, s32 offsetX, s32 offsetY) { // r0, r1, r2, r3 - s32 x; - s32 y; - - x = source->x.WORD; - target->x.WORD = x + offsetX; - - y = source->y.WORD; - target->y.WORD = y + offsetY; - - target->height = source->height; // ldr - target->collisionLayer = source->collisionLayer; - UpdateSpriteForCollisionLayer(target); -} - -void CopyPositionAndSpriteOffset(Entity* param_1, Entity* param_2) { - param_2->spriteOffsetX = param_1->spriteOffsetX; - param_2->spriteOffsetY = param_1->spriteOffsetY; - PositionRelative(param_1, param_2, 0, 0); -} - -void sub_0806FA90(Entity* param_1, Entity* param_2, s32 offsetX, s32 offsetY) { - param_2->spriteOffsetX = param_1->spriteOffsetX; - param_2->spriteOffsetY = param_1->spriteOffsetY; - PositionRelative(param_1, param_2, offsetX * 64 * 32 * 32, offsetY * 64 * 32 * 32); -} - -void ResolveEntityOnTop(Entity* param_1, Entity* param_2) { - param_2->spritePriority.b0 = gUnk_08114F78[param_1->spritePriority.b0]; -} - -void sub_0806FAD8(Entity* param_1, Entity* param_2) { - param_2->spritePriority.b0 = gUnk_08114F80[param_1->spritePriority.b0]; -} diff --git a/src/room.c b/src/room.c index b940d37f..0797da1d 100644 --- a/src/room.c +++ b/src/room.c @@ -3,7 +3,6 @@ #include "entity.h" #include "area.h" #include "room.h" -#include "functions.h" #include "flags.h" #include "npc.h" #include "player.h" @@ -11,6 +10,9 @@ #include "main.h" #include "structures.h" #include "save.h" +#include "script.h" +#include "random.h" +#include "functions.h" void sub_0804B3C4(void* arg0) { sub_0804B29C(arg0); @@ -387,7 +389,7 @@ u32 sub_0804B7A8(void) { return 1; } -extern void* gUnk_08010A5C[]; +extern void* script_08010A5C[]; void sub_0804B7E8(void) { if (CheckLocalFlag(0x91)) { @@ -395,7 +397,7 @@ void sub_0804B7E8(void) { DoFade(5, 0x100); gPlayerEntity.x.HALF.HI = gRoomControls.roomOriginX + 0x50; gPlayerEntity.y.HALF.HI = gRoomControls.roomOriginY + 0x38; - sub_080751E8(1, 2, &gUnk_08010A5C); + sub_080751E8(1, 2, &script_08010A5C); } } @@ -421,7 +423,7 @@ void sub_0804B86C(void) { DoFade(5, 0x100); gPlayerEntity.x.HALF.HI = gRoomControls.roomOriginX + 0x50; gPlayerEntity.y.HALF.HI = gRoomControls.roomOriginY + 0x38; - sub_080751E8(1, 2, &gUnk_08010A5C); + sub_080751E8(1, 2, &script_08010A5C); } } @@ -441,15 +443,13 @@ u32 sub_0804B8B0(void) { return 1; } -extern void* gUnk_08010A5C[]; - void sub_0804B8F0(void) { if (CheckLocalFlag(0x91)) { ClearLocalFlag(0x91); DoFade(5, 0x100); gPlayerEntity.x.HALF.HI = gRoomControls.roomOriginX + 0x60; gPlayerEntity.y.HALF.HI = gRoomControls.roomOriginY + 0x38; - sub_080751E8(1, 2, &gUnk_08010A5C); + sub_080751E8(1, 2, &script_08010A5C); } } @@ -649,14 +649,14 @@ u32 sub_0804BC50(void) { return 1; } -extern u32 gUnk_08009E88; +extern u32 script_08009E88; void sub_0804BC70(void) { if (!CheckLocalFlag(0x9f)) { DoFade(5, 0x100); gPlayerEntity.x.HALF.HI = gRoomControls.roomOriginX + 0xb0; gPlayerEntity.y.HALF.HI = gRoomControls.roomOriginY + 0x40; - sub_080751E8(0, 6, &gUnk_08009E88); + sub_080751E8(0, 6, &script_08009E88); } if (!CheckGlobalFlag(TABIDACHI)) { sub_08052878(); @@ -972,7 +972,7 @@ void sub_0804BF38(u32 arg0, struct_0804BF38* arg1) fx->x.HALF.HI = gUnk_080D8E50[iVar3].x + gRoomControls.roomOriginX + xOff; fx->y.HALF.HI = gUnk_080D8E50[iVar3].y + gRoomControls.roomOriginY + -0xc + (entCnt & 1) * 8; fx->direction = 0; - fx->nonPlanarMovement = 0x100; + fx->speed = 0x100; } } } @@ -982,7 +982,7 @@ void sub_0804BF38(u32 arg0, struct_0804BF38* arg1) } #else NAKED -void sub_0804BF38(u32 arg0, void* arg1) { +void sub_0804BF38(Entity* this, ScriptExecutionContext* context) { asm(".include \"asm/non_matching/sub_0804BF38.inc\""); } #endif @@ -2236,7 +2236,7 @@ void sub_0804CD48(void) { gFadeControl.active = 0; gUsedPalettes = 0; *(u16*)0x5000000 = 0x7fff; - sub_0801DA90(1); + DispReset(1); } if (CheckGlobalFlag(LV1_CLEAR)) { LoadRoomEntityList(&gUnk_080DF94C); @@ -4307,8 +4307,6 @@ void LoadHyruleTown(void) { } } -extern EntityData gUnk_080EEBAC; - void sub_0804E130(void) { if ((gSave.windcrests & 0x8000000) == 0) { LoadRoomEntityList(&gUnk_080EEBAC); @@ -4499,7 +4497,7 @@ void sub_0804E3C4() { } r = Random(); index = gUnk_080F0D58[index][r & 0x1f]; - LoadRoomEntityList(gUnk_080F0CB8[index & 0xF]); + LoadRoomEntityList((EntityData*)gUnk_080F0CB8[index & 0xF]); index >>= 4; r >>= 8; index = gUnk_080F0E08[index][r & 0x1F]; @@ -4773,8 +4771,7 @@ u32 sub_0804E7D8() { } extern EntityData gUnk_080F31D8; -extern u8 gUnk_02000070; -extern u32 gUnk_08009B30; +extern u32 script_08009B30; void sub_0804E7DC(void) { @@ -4782,7 +4779,7 @@ void sub_0804E7DC(void) { sub_080A71C4(5, 1, 4, 4); gUnk_02000070 = 0; DoFade(5, 0x100); - sub_080751E8(0, 6, &gUnk_08009B30); + sub_080751E8(0, 6, &script_08009B30); } if (!CheckGlobalFlag(OUTDOOR)) { gArea.musicIndex = gArea.pMusicIndex; @@ -4793,12 +4790,12 @@ void sub_0804E7DC(void) { } } -extern u32 gUnk_08009E58; +extern u32 script_08009E58; void sub_0804E864(void) { gPlayerEntity.x.HALF.HI = gRoomControls.roomOriginX + 0x90; gPlayerEntity.y.HALF.HI = gRoomControls.roomOriginY + 0x38; - sub_080751E8(1, 6, &gUnk_08009E58); + sub_080751E8(1, 6, &script_08009E58); ModHealth(0xa0); } @@ -5072,8 +5069,6 @@ void sub_0804EC00(void) { } } -extern EntityData gUnk_080F4E10; - void sub_0804EC98(void) { if ((s32)gSave.windcrests > -1) { LoadRoomEntityList(&gUnk_080F4E10); @@ -5207,8 +5202,6 @@ extern EntityData gUnk_080F5828; extern EntityData gUnk_080F5848; extern EntityData gUnk_080F5788; -extern u8 gBombBagSizes[]; - void sub_0804EEBC(void) { LoadRoomEntityList(&gUnk_080F5758); if (!GetInventoryValue(0x36) && CheckLocalFlagByOffset(0x200, 0x8f)) { @@ -5274,14 +5267,14 @@ u32 sub_0804EFDC(void) { } extern EntityData gUnk_080F5DD0; -extern u32 gUnk_08011C50; +extern u32 script_08011C50; void sub_0804EFF8(void) { if (gSave.unk8 > 7) { LoadRoomEntityList(&gUnk_080F5DD0); } if (CheckGlobalFlag(MAROYA_WAKEUP)) { - sub_080751E8(1, 2, &gUnk_08011C50); + sub_080751E8(1, 2, &script_08011C50); } } @@ -5516,8 +5509,6 @@ void sub_0804F25C(void) { } } -extern EntityData gUnk_080F70D8; - void sub_0804F2C8(void) { if ((gSave.windcrests & 0x40000000) == 0) { LoadRoomEntityList(&gUnk_080F70D8); @@ -5680,35 +5671,35 @@ void sub_0804F680(Entity* parent, s32 x, s32 y) { } } -void sub_0804F6A8(Entity* arg0) { - sub_0804F680(arg0, 0x1d8, 0x108); - sub_0804F680(arg0, 0x218, 0x188); +void sub_0804F6A8(Entity* this) { + sub_0804F680(this, 0x1d8, 0x108); + sub_0804F680(this, 0x218, 0x188); } -void sub_0804F6C8(Entity* arg0) { - sub_0804F680(arg0, 0x1e8, 0x108); - sub_0804F680(arg0, 0x208, 0x188); +void sub_0804F6C8(Entity* this) { + sub_0804F680(this, 0x1e8, 0x108); + sub_0804F680(this, 0x208, 0x188); } -void sub_0804F6E8(Entity* arg0) { - sub_0804F680(arg0, 0x1f8, 0x108); - sub_0804F680(arg0, 0x258, 0x138); - sub_0804F680(arg0, 0x1f8, 0x188); - sub_0804F680(arg0, 0x198, 0x158); +void sub_0804F6E8(Entity* this) { + sub_0804F680(this, 0x1f8, 0x108); + sub_0804F680(this, 0x258, 0x138); + sub_0804F680(this, 0x1f8, 0x188); + sub_0804F680(this, 0x198, 0x158); } -void sub_0804F724(Entity* arg0) { - sub_0804F680(arg0, 0x208, 0x108); - sub_0804F680(arg0, 0x258, 0x148); - sub_0804F680(arg0, 0x1e8, 0x188); - sub_0804F680(arg0, 0x198, 0x148); +void sub_0804F724(Entity* this) { + sub_0804F680(this, 0x208, 0x108); + sub_0804F680(this, 0x258, 0x148); + sub_0804F680(this, 0x1e8, 0x188); + sub_0804F680(this, 0x198, 0x148); } -void sub_0804F760(Entity* arg0) { - sub_0804F680(arg0, 0x218, 0x108); - sub_0804F680(arg0, 0x258, 0x158); - sub_0804F680(arg0, 0x1d8, 0x188); - sub_0804F680(arg0, 0x198, 0x138); +void sub_0804F760(Entity* this) { + sub_0804F680(this, 0x218, 0x108); + sub_0804F680(this, 0x258, 0x158); + sub_0804F680(this, 0x1d8, 0x188); + sub_0804F680(this, 0x198, 0x138); } void sub_0804F79C(Entity* parent) { @@ -6031,8 +6022,6 @@ void sub_0804FBBC(void) { } } -extern EntityData gUnk_080F9304; - void sub_0804FBDC(void) { if ((gSave.windcrests & 0x2000000) == 0) { LoadRoomEntityList(&gUnk_080F9304); @@ -6449,8 +6438,6 @@ void sub_0804FE58(void) { } } -extern EntityData gUnk_080FB004; - void sub_0804FEAC(void) { if ((gSave.windcrests & 0x1000000) == 0) { LoadRoomEntityList(&gUnk_080FB004); diff --git a/src/save.c b/src/save.c index c6d0bfcd..7cbf89aa 100644 --- a/src/save.c +++ b/src/save.c @@ -1,42 +1,62 @@ #include "save.h" +#include "gba/eeprom.h" -typedef struct Thing { - u16 unk_1; - u16 unk_2; - u32 unk_3; -} Thing; +typedef struct SaveFileStatus { + u16 checksum1; + u16 checksum2; + u32 status; +} SaveFileStatus; -extern u32 sub_080B180C(u32, const char*); -extern u16 sub_080B18DC(u16, const char*); +typedef struct { + u16 size; + u16 checksum1; + u16 checksum2; + u16 address1; + u16 address2; +} SaveFileEEPROMAddresses; + +static SaveResult HandleSaveInit(u32); +static SaveResult HandleSaveInProgress(u32); +static SaveResult HandleSaveDone(u32); + +const SaveFileEEPROMAddresses* GetSaveFileEEPROMAddresses(u32); +u32 DataDoubleReadWithStatus(u32, void* data); +u32 DataDoubleWriteWithStatus(u32, const void* data); +u32 VerifyChecksum(SaveFileStatus* fileStatus, u16* data, u32 size); +u16 CalculateChecksum(u16* data, u32); +u32 WriteSaveFile(u32 index, SaveFile* saveFile); +void SetFileStatusInit(u32 index); + +u32 ReadSaveFileStatus(u32 address, SaveFileStatus* fileStatus); +u32 ParseSaveFileStatus(const SaveFileStatus* fileStatus); +u32 WriteSaveFileStatus(u32 address, const SaveFileStatus* fileStatus); + +u32 DataRead(u32 address, void* data, u32 size); +u32 DataWrite(u32 address, const void* data, u32 size); +u32 DataCompare(u32 address, const void* data, u32 size); const u16 gUnk_0811E454[] = { 0x0, 0x0, 0x100, 0x200, 0x300, 0x400, 0x500, 0x5C0, 0x680, 0x740, 0x800, 0x8C0, 0x9C0, 0xA80 }; const char gUnk_0811E470[6] = "LINK"; -static SaveResult HandleSaveInit(u32); -static SaveResult HandleSaveInProgress(u32); -static SaveResult HandleSaveDone(u32); static SaveResult (*const sSaveHandlers[])(u32) = { HandleSaveInit, HandleSaveInProgress, HandleSaveDone }; -u32 sub_0807D008(u32, SaveFile*); -u32 sub_0807D0A0(u16*, u16*, u32); -u32 sub_0807D0EC(u32, const char*); -u32 sub_0807D128(const Thing*); -u16 sub_0807D1A4(u16*, u32); -u32 sub_0807D1D8(u32, const char*, u32); - static const char sSignatureLong[32] = "AGBZELDA:THE MINISH CAP:ZELDA 5"; // Save file is untouched -static const char sSaveDescInit[8] = "\xFF\xFF\xFF\xFF" - "INIT"; +static const SaveFileStatus sSaveDescInit = { 0xffff, 0xffff, 'TINI' }; // Save file is deleted -static const char sSaveDescDeleted[8] = "\xFF\xFF\xFF\xFF" - "DelF"; +static const SaveFileStatus sSaveDescDeleted = { 0xffff, 0xffff, 'FleD' }; const char gUnk_0811E4B4[8] = "DAMEDAME"; -extern struct_0807D1C4 gUnk_0811E4BC[]; +const SaveFileEEPROMAddresses gSaveFileEEPROMAddresses[] = { { 0x500, 0x30, 0x1030, 0x80, 0x1080 }, + { 0x500, 0x40, 0x1040, 0x580, 0x1580 }, + { 0x500, 0x50, 0x1050, 0xa80, 0x1a80 }, + { 0x10, 0x20, 0x1020, 0x70, 0x1070 }, + { 0x20, 0, 0, 0, 0x1000 }, + { 0x20, 0x60, 0x1060, 0xf80, 0x1f80 }, + { 0x8, 0xfa0, 0x1fa0, 0xfa0, 0x1fa0 } }; extern s16 gUnk_02021EE0[6]; @@ -44,7 +64,7 @@ void sub_0807CD9C() { sub_080530C8(); } -SaveResult sub_0807CDA4(u32 arg0) { +SaveResult HandleSave(u32 arg0) { return sSaveHandlers[gMenu.storyPanelIndex](arg0); } @@ -52,7 +72,7 @@ SaveResult HandleSaveInit(u32 arg0) { gUnk_02021EE0[5] -= 8; if (gUnk_02021EE0[4] <= 0) { gMenu.field_0xa = 8; - gMenu.storyPanelIndex = 1; + gMenu.storyPanelIndex = SAVE_IN_PROGRESS; } return SAVE_BUSY; } @@ -64,18 +84,18 @@ SaveResult HandleSaveInProgress(u32 arg0) { InitDMA(); switch (arg0) { case 0: - temp = sub_0807CF08(gUnk_02000000->saveFileId, gSave.filler0); + temp = WriteSaveFile(gUnk_02000000->saveFileId, &gSave); break; case 1: - sub_0807CF48(gUnk_02000000->saveFileId); + SetFileStatusDeleted(gUnk_02000000->saveFileId); temp = 1; break; case 2: - temp = sub_0807CF10((u8*)&gUnk_02000000->signature); + temp = Write_02000000(gUnk_02000000); break; } gMenu.field_0xa = temp; - gMenu.storyPanelIndex = 2; + gMenu.storyPanelIndex = SAVE_DONE; sub_08056208(); } else { gMenu.field_0xa--; @@ -91,7 +111,7 @@ SaveResult HandleSaveDone(u32 arg0) { if (gUnk_02021EE0[3] <= gUnk_02021EE0[5]) { gUnk_02021EE0[5] = gUnk_02021EE0[3]; sub_08050384(); - gMenu.storyPanelIndex = 0; + gMenu.storyPanelIndex = SAVE_INIT; if (gMenu.field_0xa == 1) { result = SAVE_OK; } else { @@ -101,194 +121,187 @@ SaveResult HandleSaveDone(u32 arg0) { return result; } -u32 sub_0807CE90(void) { - struct_0807D1C4* puVar1; - int iVar2; - int iVar3; +u32 InitSaveData(void) { + const SaveFileEEPROMAddresses* eepromAddresses; + u32 error; - sub_080B1520(0x40); - puVar1 = sub_0807D1C4(4); - iVar3 = 0; - if (sub_0807D24C(puVar1->field_0x6, sSignatureLong, puVar1->field_0x0) == 0) { - iVar3 += 1; + EEPROMConfigure(0x40); + eepromAddresses = GetSaveFileEEPROMAddresses(4); + error = 0; + if (DataCompare(eepromAddresses->address1, sSignatureLong, eepromAddresses->size) == 0) { + error += 1; } - if (sub_0807D24C(puVar1->field_0x8, sSignatureLong, puVar1->field_0x0) == 0) { - iVar3 += 2; + if (DataCompare(eepromAddresses->address2, sSignatureLong, eepromAddresses->size) == 0) { + error += 2; } - if (iVar3 != 0) { - if (iVar3 == 3) { - sub_0807CF68(5); - sub_0807CF68(3); - sub_0807CF68(2); - sub_0807CF68(1); - sub_0807CF68(0); + if (error != 0) { + if (error == 3) { + SetFileStatusInit(5); + SetFileStatusInit(3); + SetFileStatusInit(2); + SetFileStatusInit(1); + SetFileStatusInit(0); } - sub_0807D20C(puVar1->field_0x8, sSignatureLong, puVar1->field_0x0); - sub_0807D20C(puVar1->field_0x6, sSignatureLong, puVar1->field_0x0); + DataWrite(eepromAddresses->address2, sSignatureLong, eepromAddresses->size); + DataWrite(eepromAddresses->address1, sSignatureLong, eepromAddresses->size); } return 1; } -u32 sub_0807CF08(u32 arg0, u8* arg1) { - return sub_0807CF88(arg0, arg1); +u32 WriteSaveFile(u32 index, SaveFile* saveFile) { + return DataDoubleWriteWithStatus(index, saveFile); } -u32 sub_0807CF10(u8* arg0) { - return sub_0807CF88(3, arg0); +u32 Write_02000000(struct_02000000* arg0) { + return DataDoubleWriteWithStatus(3, arg0); } u32 sub_0807CF1C(u8* arg0) { - return sub_0807CF88(5, arg0); + return DataDoubleWriteWithStatus(5, arg0); } -s32 sub_0807CF28(u32 arg0, SaveFile* arg1) { - return sub_0807D008(arg0, arg1); +s32 ReadSaveFile(u32 index, SaveFile* saveFile) { + return DataDoubleReadWithStatus(index, saveFile); } -u32 sub_0807CF30(SaveFile* arg0) { - return sub_0807D008(3, arg0); +u32 Read_02000000(struct_02000000* arg0) { + return DataDoubleReadWithStatus(3, arg0); } -u32 sub_0807CF3C(SaveFile* arg0) { - return sub_0807D008(5, arg0); +u32 sub_0807CF3C(u8* arg0) { + return DataDoubleReadWithStatus(5, arg0); } -void sub_0807CF48(u32 arg0) { - struct_0807D1C4* temp; +void SetFileStatusDeleted(u32 index) { + const SaveFileEEPROMAddresses* eepromAddresses; - temp = sub_0807D1C4(arg0); - sub_0807D184(temp->field_0x4, sSaveDescDeleted); - sub_0807D184(temp->field_0x2, sSaveDescDeleted); + eepromAddresses = GetSaveFileEEPROMAddresses(index); + WriteSaveFileStatus(eepromAddresses->checksum2, &sSaveDescDeleted); + WriteSaveFileStatus(eepromAddresses->checksum1, &sSaveDescDeleted); } -void sub_0807CF68(u32 arg0) { - struct_0807D1C4* temp; - const char* str; +void SetFileStatusInit(u32 index) { + const SaveFileEEPROMAddresses* eepromAddresses; + const SaveFileStatus* fileStatus; - temp = sub_0807D1C4(arg0); - str = sSaveDescInit; - sub_0807D184(temp->field_0x4, str); - sub_0807D184(temp->field_0x2, str); + eepromAddresses = GetSaveFileEEPROMAddresses(index); + fileStatus = &sSaveDescInit; + WriteSaveFileStatus(eepromAddresses->checksum2, fileStatus); + WriteSaveFileStatus(eepromAddresses->checksum1, fileStatus); } -u32 sub_0807CF88(u32 arg0, u8* arg1) { - Thing thing; +u32 DataDoubleWriteWithStatus(u32 arg0, const void* data) { + SaveFileStatus fileStatus; - u32 retval; - struct_0807D1C4* ptr; - u32 e0, e1; - u16 l1prep; + u32 ret; + const SaveFileEEPROMAddresses* eepromAddresses; + bool32 write1success, write2success; + u16 checksum; - ptr = sub_0807D1C4(arg0); + eepromAddresses = GetSaveFileEEPROMAddresses(arg0); - thing.unk_3 = 'MCZ3'; - l1prep = sub_0807D1A4((u16*)&thing.unk_3, 4); - l1prep += sub_0807D1A4((u16*)arg1, ptr->field_0x0); - thing.unk_1 = l1prep; - thing.unk_2 = -(u32)l1prep; - e0 = sub_0807D20C(ptr->field_0x6, (const char*)arg1, ptr->field_0x0); - if (e0) { - e0 = sub_0807D184(ptr->field_0x2, (const char*)&thing.unk_1); + fileStatus.status = 'MCZ3'; + checksum = CalculateChecksum((u16*)&fileStatus.status, 4); + checksum += CalculateChecksum((u16*)data, eepromAddresses->size); + fileStatus.checksum1 = checksum; + fileStatus.checksum2 = -(u32)checksum; + write1success = DataWrite(eepromAddresses->address1, data, eepromAddresses->size); + if (write1success) { + write1success = WriteSaveFileStatus(eepromAddresses->checksum1, &fileStatus); } - e1 = sub_0807D20C(ptr->field_0x8, (const char*)arg1, ptr->field_0x0); - if (e1) { - e1 = sub_0807D184(ptr->field_0x4, (const char*)&thing.unk_1); + write2success = DataWrite(eepromAddresses->address2, data, eepromAddresses->size); + if (write2success) { + write2success = WriteSaveFileStatus(eepromAddresses->checksum2, &fileStatus); } - retval = 0; - if (e0 || e1) { - retval = 1; + ret = 0; + if (write1success || write2success) { + ret = 1; } - return retval; + return ret; } -NONMATCH("asm/non_matching/save/sub_0807D008.inc", u32 sub_0807D008(u32 param_1, SaveFile* saveFile)) { - u32 set_0; - char auStack32[8]; +u32 DataDoubleReadWithStatus(u32 param_1, void* data) { + vu32 set_0; + SaveFileStatus fileStatus; - struct_0807D1C4* unk_s; - u32 t1; - u32 t2; + const SaveFileEEPROMAddresses* eepromAddresses; + u32 read1status; + u32 read2status; u32 ret; u32 temp; - unk_s = sub_0807D1C4(param_1); - t1 = sub_0807D0EC(unk_s->field_0x2, auStack32); - if (t1 == 2) { - if ((sub_0807D1D8(unk_s->field_0x6, (char*)saveFile, unk_s->field_0x0) == 0) || - (sub_0807D0A0((u16*)auStack32, (u16*)saveFile, (u32)unk_s->field_0x0) == 0)) { - t1 = 0; + eepromAddresses = GetSaveFileEEPROMAddresses(param_1); + read1status = ReadSaveFileStatus(eepromAddresses->checksum1, &fileStatus); + if (read1status == 2) { + if ((DataRead(eepromAddresses->address1, data, eepromAddresses->size) == 0) || + (VerifyChecksum(&fileStatus, (u16*)data, eepromAddresses->size) == 0)) { + // read 1 failed + read1status = 0; } else { return 1; } } - t2 = sub_0807D0EC(unk_s->field_0x4, auStack32); - if (t2 == 2) { - if ((sub_0807D1D8(unk_s->field_0x8, (char*)saveFile, unk_s->field_0x0) != 0) && - (sub_0807D0A0((u16*)auStack32, (u16*)saveFile, (u32)unk_s->field_0x0) != 0)) { + read2status = ReadSaveFileStatus(eepromAddresses->checksum2, &fileStatus); + if (read2status == 2) { + if ((DataRead(eepromAddresses->address2, data, eepromAddresses->size) != 0) && + (VerifyChecksum(&fileStatus, (u16*)data, (u32)eepromAddresses->size) != 0)) { return 1; } - t2 = 0; + // read 2 failed + read2status = 0; } set_0 = 0; - CpuSet(&set_0, saveFile, unk_s->field_0x0 >> 2 | CPU_SET_SRC_FIXED | CPU_SET_32BIT); - temp = t1 | t2; + CpuSet((u16*)&set_0, data, eepromAddresses->size >> 2 | CPU_SET_SRC_FIXED | CPU_SET_32BIT); + temp = read1status | read2status; ret = 0; if (temp == 0) { - ret = -1; + ret = -1; // both reads failed } return ret; } -END_NONMATCH -NONMATCH("asm/non_matching/save/sub_0807D0A0.inc", u32 sub_0807D0A0(u16* unk_1, u16* unk_2, u32 unk_3)) { - u32 r0; +u32 VerifyChecksum(SaveFileStatus* fileStatus, u16* data, u32 size) { + u32 temp; + u16 checksum; - u32* u32_1 = (u32*)unk_1; + checksum = CalculateChecksum((u16*)&fileStatus->status, 4); + checksum += CalculateChecksum(data, size); - u16 u0; - u32 u1; - - u0 = sub_0807D1A4(unk_1 + 2, 4); - u0 = u0 + sub_0807D1A4(unk_2, unk_3); - - u1 = unk_1[0]; - if (u1 != u0) { - r0 = 0; - } else { - if (unk_1[1] == (-(u1 << 0x10) >> 0x10)) { - if (*(u32_1 + 1) != 'MCZ3') { - r0 = 0; - } else { - r0 = 1; - } - } else { - r0 = 0; - } - } - return r0; + if ((fileStatus->checksum1 != checksum) || + (temp = fileStatus->checksum1 << 0x10, fileStatus->checksum2 != (-temp >> 0x10)) || + (fileStatus->status != 'MCZ3')) { + return 0; + } else + return 1; } -END_NONMATCH -u32 sub_0807D0EC(u32 unk_1, const char* unk_2) { +u32 ReadSaveFileStatus(u32 address, SaveFileStatus* fileStatus) { u32 ret; - if (!sub_0807D1D8(unk_1, unk_2, 8)) { + if (!DataRead(address, fileStatus, 8)) { ret = 0; } else { - ret = sub_0807D128((Thing*)unk_2); + ret = ParseSaveFileStatus(fileStatus); } - if (!ret && sub_0807D1D8(unk_1 + 8, unk_2, 8)) { - ret = sub_0807D128((Thing*)unk_2); + if (!ret && DataRead(address + 8, fileStatus, 8)) { + ret = ParseSaveFileStatus(fileStatus); } return ret; } -u32 sub_0807D128(const Thing* thing) { +/** + * 2 for valid existing file + * 1 for valid empty file + * 0 for bad file + * @param fileStatus + * @return + */ +u32 ParseSaveFileStatus(const SaveFileStatus* fileStatus) { u32 ret; - switch (thing->unk_3) { + switch (fileStatus->status) { case 'MCZ3': - if (thing->unk_1 + thing->unk_2 == 0x10000) { + if (fileStatus->checksum1 + fileStatus->checksum2 == 0x10000) { ret = 2; } else { ret = 0; @@ -297,7 +310,7 @@ u32 sub_0807D128(const Thing* thing) { case 'FleD': case 'TINI': ret = 0; - if ((thing->unk_1 & thing->unk_2) == 0xffff) { + if ((fileStatus->checksum1 & fileStatus->checksum2) == 0xffff) { ret = 1; } break; @@ -308,61 +321,87 @@ u32 sub_0807D128(const Thing* thing) { return ret; } -u32 sub_0807D184(u32 param_1, const char* param_2) { - u32 uVar1; +bool32 WriteSaveFileStatus(u32 address, const struct SaveFileStatus* fileStatus) { + bool32 success; - uVar1 = sub_0807D20C(param_1, param_2, 8); - if (uVar1 == 0) { - uVar1 = sub_0807D20C(param_1 + 8, param_2, 8); + success = DataWrite(address, fileStatus, 8); + if (!success) { + success = DataWrite(address + 8, fileStatus, 8); } - return uVar1; + return success; } -u16 sub_0807D1A4(u16* unk_1, u32 unk_2) { - u32 uVar1; +u16 CalculateChecksum(u16* data, u32 size) { + u32 checksum; - uVar1 = 0; - while (unk_2 != 0) { - uVar1 = uVar1 + (*unk_1 ^ unk_2); - unk_1 = unk_1 + 1; - unk_2 = unk_2 - 2; + checksum = 0; + while (size != 0) { + checksum += (*data ^ size); + data++; + size = size - 2; } - return uVar1; + return checksum; } -struct_0807D1C4* sub_0807D1C4(u32 unk_1) { - return &gUnk_0811E4BC[unk_1]; +const SaveFileEEPROMAddresses* GetSaveFileEEPROMAddresses(u32 unk_1) { + return &gSaveFileEEPROMAddresses[unk_1]; } -// these three are basically the same and wrong by basically one instruction in the wrong place -NONMATCH("asm/non_matching/save/sub_0807D1D8.inc", u32 sub_0807D1D8(u32 unk_1, const char* unk_2, u32 unk_3)) { +/** + * read arbitrary data from EEPROM + * @param address EEPROM address + * @param data buffer to read into + * @param size size in bytes to read + * @return TRUE on success + */ +bool32 DataRead(u32 address, void* data, u32 size) { + size /= 8; + address /= 8; + while (size-- > 0) { + if (EEPROMRead(address, data)) + return FALSE; + address++; + data += 8; + } + return TRUE; } -END_NONMATCH -NONMATCH("asm/non_matching/save/sub_0807D20C.inc", u32 sub_0807D20C(u32 unk_1, const char* unk_2, u32 unk_3)) { - unk_3 >>= 3; - unk_1 >>= 3; - while (unk_3-- > 0) { - if (sub_080B18DC(unk_1, unk_2)) { - sub_080B18DC(unk_1, gUnk_0811E4B4); - return 0; +/** + * write arbitrary data to EEPROM + * @param address EEPROM address + * @param data buffer to write from + * @param size size in bytes to write + * @return TRUE on success + */ +bool32 DataWrite(u32 address, const void* data, u32 size) { + size /= 8; + address /= 8; + while (size-- > 0) { + if (EEPROMWrite0_8k_Check(address, data)) { + EEPROMWrite0_8k_Check(address, (const u16*)gUnk_0811E4B4); + return FALSE; } - unk_1++; - unk_2 += 8; + address++; + data += 8; } - return 1; + return TRUE; } -END_NONMATCH -NONMATCH("asm/non_matching/save/sub_0807D24C.inc", u32 sub_0807D24C(u32 unk_1, const char* unk_2, u32 unk_3)) { - unk_3 >>= 3; - unk_1 >>= 3; - while (unk_3-- > 0) { - if (sub_080B180C(unk_1, unk_2)) - return 0; - unk_1++; - unk_2 += 8; +/** + * compare arbitrary data with EEPROM + * @param address EEPROM address + * @param data buffer to compare to + * @param size size in bytes to compare + * @return TRUE on success + */ +bool32 DataCompare(u32 address, const void* data, u32 size) { + size /= 8; + address /= 8; + while (size-- > 0) { + if (EEPROMCompare(address, data)) + return FALSE; + address++; + data += 8; } - return 1; + return TRUE; } -END_NONMATCH diff --git a/src/script.c b/src/script.c index 621b1c61..0710080c 100644 --- a/src/script.c +++ b/src/script.c @@ -6,180 +6,299 @@ #include "script.h" #include "structures.h" #include "textbox.h" -#include "functions.h" +#include "utils.h" #include "save.h" +#include "random.h" +#include "functions.h" -void sub_0807DAF0(Entity*, ScriptExecutionContext*, u16*); -void sub_0807DB88(ScriptExecutionContext*, u16*); +void InitScriptForEntity(Entity*, ScriptExecutionContext*, u16*); +void InitScriptExecutionContext(ScriptExecutionContext* context, u16* script); void sub_0807DE80(Entity*); void sub_0807DF38(void); -void nullsub_507(Entity*, ScriptExecutionContext*); -void sub_0807E004(Entity*, ScriptExecutionContext*); -void sub_0807E014(Entity*, ScriptExecutionContext*); -void sub_0807E024(Entity*, ScriptExecutionContext*); -void sub_0807E050(Entity*, ScriptExecutionContext*); -void sub_0807E064(Entity*, ScriptExecutionContext*); -void sub_0807E078(Entity*, ScriptExecutionContext*); -void sub_0807E0A0(Entity*, ScriptExecutionContext*); -void sub_0807E0B8(Entity*, ScriptExecutionContext*); -void sub_0807E0CC(Entity*, ScriptExecutionContext*); -void sub_0807E0E0(Entity*, ScriptExecutionContext*); -void sub_0807E10C(Entity*, ScriptExecutionContext*); -void sub_0807E124(Entity*, ScriptExecutionContext*); -void sub_0807E148(Entity*, ScriptExecutionContext*); -void sub_0807E158(Entity*, ScriptExecutionContext*); -void sub_0807E188(Entity*, ScriptExecutionContext*); -void sub_0807E1D8(Entity*, ScriptExecutionContext*); -void sub_0807E200(Entity*, ScriptExecutionContext*); -void sub_0807E220(Entity*, ScriptExecutionContext*); -void sub_0807E240(Entity*, ScriptExecutionContext*); -void sub_0807E260(Entity*, ScriptExecutionContext*); -void sub_0807E280(Entity*, ScriptExecutionContext*); -void sub_0807E2A8(Entity*, ScriptExecutionContext*); -void sub_0807E2E4(Entity*, ScriptExecutionContext*); -void sub_0807E30C(Entity*, ScriptExecutionContext*); -void sub_0807E390(Entity*, ScriptExecutionContext*); -void sub_0807E3BC(Entity*, ScriptExecutionContext*); -void sub_0807E3E8(Entity*, ScriptExecutionContext*); -void sub_0807E40C(Entity*, ScriptExecutionContext*); -void sub_0807E42C(Entity*, ScriptExecutionContext*); -void sub_0807E48C(Entity*, ScriptExecutionContext*); -void sub_0807E4AC(Entity*, ScriptExecutionContext*); -void sub_0807E4CC(Entity*, ScriptExecutionContext*); -void sub_0807E4EC(Entity*, ScriptExecutionContext*); -void sub_0807E514(Entity*, ScriptExecutionContext*); -void sub_0807E538(Entity*, ScriptExecutionContext*); -void sub_0807E564(Entity*, ScriptExecutionContext*); -void sub_0807E584(Entity*, ScriptExecutionContext*); -void sub_0807E5A0(Entity*, ScriptExecutionContext*); -void sub_0807E5CC(Entity*, ScriptExecutionContext*); -void sub_0807E5F8(Entity*, ScriptExecutionContext*); -void sub_0807E610(Entity*, ScriptExecutionContext*); -void sub_0807E628(Entity*, ScriptExecutionContext*); -void sub_0807E634(Entity*, ScriptExecutionContext*); -void sub_0807E644(Entity*, ScriptExecutionContext*); -void sub_0807E650(Entity*, ScriptExecutionContext*); -void sub_0807E65C(Entity*, ScriptExecutionContext*); -void sub_0807E668(Entity*, ScriptExecutionContext*); -void sub_0807E674(Entity*, ScriptExecutionContext*); -void sub_0807E680(Entity*, ScriptExecutionContext*); -void sub_0807E690(Entity*, ScriptExecutionContext*); -void sub_0807E6AC(Entity*, ScriptExecutionContext*); -void sub_0807E6DC(Entity*, ScriptExecutionContext*); -void sub_0807E700(Entity*, ScriptExecutionContext*); -void sub_0807E72C(Entity*, ScriptExecutionContext*); -void sub_0807E75C(Entity*, ScriptExecutionContext*); -void sub_0807E778(Entity*, ScriptExecutionContext*); -void sub_0807E788(Entity*, ScriptExecutionContext*); -void sub_0807E79C(Entity*, ScriptExecutionContext*); -void nullsub_508(Entity*, ScriptExecutionContext*); -void sub_0807E7B0(Entity*, ScriptExecutionContext*); -void sub_0807E7C4(Entity*, ScriptExecutionContext*); -void sub_0807E7D8(Entity*, ScriptExecutionContext*); -void sub_0807E7EC(Entity*, ScriptExecutionContext*); -void sub_0807E800(Entity*, ScriptExecutionContext*); -void sub_0807E80C(Entity*, ScriptExecutionContext*); +void ScriptCommandNop(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_BeginBlock(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_EndBlock(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_Jump(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_JumpIf(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_JumpIfNot(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_JumpTable(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_JumpAbsolute(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_JumpAbsoluteIf(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_JumpAbsoluteIfNot(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_JumpAbsoluteTable(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_Call(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_CallWithArg(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_LoadRoomEntityList(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_TestBit(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_CheckInventory1(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_CheckInventory2(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_CheckLocalFlag(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_CheckLocalFlagByOffset(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_CheckGlobalFlag(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_CheckRoomFlag(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_CheckPlayerInRegion(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_CheckPlayerInRegion2(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_CheckEntityInteractType(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807E30C(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_HasRupees(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807E3BC(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807E3E8(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_CheckKinstoneFused(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_BuyItem(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807E48C(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_HasRoomItemForSale(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807E4CC(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807E4EC(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807E514(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_CheckPlayerFlags(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807E564(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_EntityHasHeight(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_ComparePlayerAction(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_ComparePlayerAnimationState(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807E5F8(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807E610(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_SetLocalFlag(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_SetLocalFlagByOffset(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_ClearLocalFlag(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_SetGlobalFlag(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_ClearGlobalFlag(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_SetRoomFlag(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_ClearRoomFlag(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_Wait(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_WaitForSomething(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_WaitForSomething2(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_WaitPlayerAction8(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_WaitForPlayerAction0x17(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_WaitFor_1(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_WaitFor_2(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807E778(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807E788(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807E79C(Entity* entity, ScriptExecutionContext* context); +void ScriptCommandNop2(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_DoFade4(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_DoFade5(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_DoFade6(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_DoFade7(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807E800(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807E80C(Entity* entity, ScriptExecutionContext* context); void sub_0807E818(u32); -void sub_0807E858(Entity*, ScriptExecutionContext*); -void sub_0807E864(Entity*, ScriptExecutionContext*); -void sub_0807E878(Entity*, ScriptExecutionContext*); -void sub_0807E888(Entity*, ScriptExecutionContext*); -void sub_0807E898(Entity*, ScriptExecutionContext*); -void sub_0807E8C4(Entity*, ScriptExecutionContext*); -void sub_0807E8D4(Entity*, ScriptExecutionContext*); -void sub_0807E8E4(Entity*, ScriptExecutionContext*); -void sub_0807E908(Entity*, ScriptExecutionContext*); -void sub_0807E914(Entity*, ScriptExecutionContext*); -void sub_0807E924(Entity*, ScriptExecutionContext*); -void sub_0807E930(Entity*, ScriptExecutionContext*); -void sub_0807E944(Entity*, ScriptExecutionContext*); -void sub_0807E974(Entity*, ScriptExecutionContext*); -void sub_0807E9D4(Entity*, ScriptExecutionContext*); -void sub_0807E9DC(Entity*, ScriptExecutionContext*); -void sub_0807E9E4(Entity*, ScriptExecutionContext*); -void sub_0807E9F0(Entity*, ScriptExecutionContext*); -void sub_0807EA4C(Entity*, ScriptExecutionContext*); -void sub_0807EA88(Entity*, ScriptExecutionContext*); -void sub_0807EA94(Entity*, ScriptExecutionContext*); -void sub_0807EAB4(Entity*, ScriptExecutionContext*); -void sub_0807EAC0(Entity*, ScriptExecutionContext*); -void sub_0807EAD0(Entity*, ScriptExecutionContext*); -void sub_0807EAF0(Entity*, ScriptExecutionContext*); -void sub_0807EB18(Entity*, ScriptExecutionContext*); -void sub_0807EB28(Entity*, ScriptExecutionContext*); -void sub_0807EB38(Entity*, ScriptExecutionContext*); -void sub_0807EB44(Entity*, ScriptExecutionContext*); -void sub_0807EB4C(Entity*, ScriptExecutionContext*); -void sub_0807EB74(Entity*, ScriptExecutionContext*); -void sub_0807EB8C(Entity*, ScriptExecutionContext*); -void sub_0807EBA8(Entity*, ScriptExecutionContext*); -void sub_0807EBB0(Entity*, ScriptExecutionContext*); -void sub_0807EBC0(Entity*, ScriptExecutionContext*); -void sub_0807EBC8(Entity*, ScriptExecutionContext*); -void sub_0807EBD8(Entity*, ScriptExecutionContext*); -void sub_0807EBF4(Entity*, ScriptExecutionContext*); -void sub_0807EC08(Entity*, ScriptExecutionContext*); -void nullsub_509(Entity*, ScriptExecutionContext*); -void sub_0807EC1C(Entity*, ScriptExecutionContext*); +void ScriptCommand_0807E858(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807E864(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807E878(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807E888(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_SetPlayerAction(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_StartPlayerScript(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807E8D4(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807E8E4(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807E908(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_SetIntVariable(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807E924(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807E930(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807E944(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807E974(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807E9D4(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807E9DC(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807E9E4(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807E9F0(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807EA4C(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807EA88(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807EA94(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_TextboxNoOverlapFollow(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_TextboxNoOverlap(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_TextboxNoOverlapFollowPos(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_TextboxNoOverlapFollowTable(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_TextboxNoOverlapVar(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807EB28(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807EB38(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807EB44(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807EB4C(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807EB74(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807EB8C(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_SetEntityDirection(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_SetEntityDirectionWithAnimationState(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_SetEntitySpeed(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_SetEntity0x20(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_SetEntityPositionRelative(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_SetEntityPosition(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_MoveEntityToPlayer(Entity* entity, ScriptExecutionContext* context); +void ScriptCommandNop3(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807EC1C(Entity* entity, ScriptExecutionContext* context); void sub_0807EC44(Entity*, ScriptExecutionContext*); -void sub_0807EC64(Entity*, ScriptExecutionContext*); -void sub_0807EC94(Entity*, ScriptExecutionContext*); -void sub_0807ECC4(Entity*, ScriptExecutionContext*); -void sub_0807ECF4(Entity*, ScriptExecutionContext*); -void sub_0807ED24(Entity*, ScriptExecutionContext*); -void sub_0807EDD4(Entity*, ScriptExecutionContext*); -void sub_0807EE04(Entity*, ScriptExecutionContext*); -void sub_0807EE30(Entity*, ScriptExecutionContext*); -void sub_0807EEB4(Entity*, ScriptExecutionContext*); -void sub_0807EEF4(Entity*, ScriptExecutionContext*); -void sub_0807EF3C(Entity*, ScriptExecutionContext*); -void sub_0807EF80(Entity*, ScriptExecutionContext*); -void sub_0807EF90(Entity*, ScriptExecutionContext*); -void sub_0807EFA0(Entity*, ScriptExecutionContext*); -void sub_0807EFAC(Entity*, ScriptExecutionContext*); -void sub_0807EFD4(Entity*, ScriptExecutionContext*); -void sub_0807EFE4(Entity*, ScriptExecutionContext*); -void sub_0807EFF4(Entity*, ScriptExecutionContext*); -void sub_0807F004(Entity*, ScriptExecutionContext*); -void sub_0807F010(Entity*, ScriptExecutionContext*); -void sub_0807F034(Entity*, ScriptExecutionContext*); -void sub_0807F050(Entity*, ScriptExecutionContext*); -void sub_0807F060(Entity*, ScriptExecutionContext*); -void sub_0807F078(Entity*, ScriptExecutionContext*); -void sub_0807F088(Entity*, ScriptExecutionContext*); -void sub_0807F098(Entity*, ScriptExecutionContext*); -void sub_0807F0A4(Entity*, ScriptExecutionContext*); -void sub_0807F0B4(Entity*, ScriptExecutionContext*); -void sub_0807F0C8(Entity*, ScriptExecutionContext*); +void ScriptCommand_0807EC64(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807EC94(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807ECC4(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807ECF4(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807ED24(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807EDD4(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807EE04(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807EE30(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807EEB4(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807EEF4(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807EF3C(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_DoPostScriptAction(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_DoPostScriptAction2(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_SoundReq(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_SoundReq2(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_SoundReq3(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_SoundReq0x80100000(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_ModRupees(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_ModHealth(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_IncreaseMaxHealth(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807F034(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807F050(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_GetInventoryValue(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807F078(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807F088(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_CameraTargetEntity(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_CameraTargetPlayer(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807F0B4(Entity* entity, ScriptExecutionContext* context); +void ScriptCommand_0807F0C8(Entity* entity, ScriptExecutionContext* context); extern void CreateSpeechBubbleExclamationMark(Entity*, u32, u32); extern void CreateSpeechBubbleQuestionMark(Entity*, u32, u32); extern void sub_0801C4A0(u32); -void (*const gUnk_0811E524[])() = { - nullsub_507, sub_0807E004, sub_0807E014, sub_0807E024, sub_0807E050, sub_0807E064, sub_0807E078, sub_0807E0A0, - sub_0807E0B8, sub_0807E0CC, sub_0807E0E0, sub_0807E10C, sub_0807E124, sub_0807E148, sub_0807E158, sub_0807E188, - sub_0807E1D8, - sub_0807E4AC, // defined out of order - sub_0807E200, sub_0807E220, sub_0807E240, sub_0807E260, sub_0807E280, sub_0807E2A8, sub_0807E2E4, sub_0807E30C, - sub_0807E390, sub_0807E3BC, sub_0807E3E8, sub_0807E40C, sub_0807E42C, sub_0807E48C, sub_0807E4CC, sub_0807E4EC, - sub_0807E514, sub_0807E538, sub_0807E564, sub_0807E584, sub_0807E5A0, sub_0807E5CC, sub_0807E5F8, sub_0807E610, - sub_0807E628, sub_0807E634, sub_0807E644, sub_0807E650, sub_0807E65C, sub_0807E668, sub_0807E674, sub_0807E680, - sub_0807E690, sub_0807E6AC, sub_0807E6DC, sub_0807E700, sub_0807E72C, sub_0807E75C, sub_0807E778, sub_0807E788, - sub_0807E79C, nullsub_508, sub_0807E7B0, sub_0807E7C4, sub_0807E7D8, sub_0807E7EC, sub_0807E800, sub_0807E80C, - sub_0807E858, sub_0807E864, sub_0807E878, sub_0807E888, sub_0807E898, sub_0807E8C4, sub_0807E8D4, sub_0807E8E4, - sub_0807E8E4, // duplicate - sub_0807E8E4, // duplicate - sub_0807E8E4, // duplicate - sub_0807E908, sub_0807E914, sub_0807E924, sub_0807E930, sub_0807E944, sub_0807E974, sub_0807E9D4, sub_0807E9DC, - sub_0807E9E4, sub_0807E9F0, sub_0807EA4C, sub_0807EA88, sub_0807EA94, sub_0807EAB4, sub_0807EAC0, sub_0807EAD0, - sub_0807EAF0, sub_0807EB18, sub_0807EB28, sub_0807EB38, sub_0807EB44, sub_0807EB4C, sub_0807EB74, sub_0807EB8C, - sub_0807EBA8, sub_0807EBB0, sub_0807EBC0, sub_0807EBC8, sub_0807EBD8, sub_0807EBF4, sub_0807EC08, nullsub_509, - sub_0807EC1C, sub_0807EC64, sub_0807EC94, sub_0807ECC4, sub_0807ECF4, sub_0807ED24, sub_0807EDD4, sub_0807EE04, - sub_0807EE30, sub_0807EEB4, sub_0807EEF4, sub_0807EF3C, sub_0807EF80, sub_0807EF90, sub_0807EFA0, sub_0807EFAC, - sub_0807EFD4, sub_0807EFE4, sub_0807EFF4, sub_0807F004, sub_0807F010, sub_0807F034, sub_0807F050, sub_0807F060, - sub_0807F078, sub_0807F088, sub_0807F098, sub_0807F0A4, sub_0807F0B4, sub_0807F0C8 -}; +typedef void (*ScriptCommand)(Entity*, ScriptExecutionContext*); + +const ScriptCommand gScriptCommands[] = { ScriptCommandNop, + ScriptCommand_BeginBlock, + ScriptCommand_EndBlock, + ScriptCommand_Jump, + ScriptCommand_JumpIf, + ScriptCommand_JumpIfNot, + ScriptCommand_JumpTable, + ScriptCommand_JumpAbsolute, + ScriptCommand_JumpAbsoluteIf, + ScriptCommand_JumpAbsoluteIfNot, + ScriptCommand_JumpAbsoluteTable, + ScriptCommand_Call, + ScriptCommand_CallWithArg, + ScriptCommand_LoadRoomEntityList, + ScriptCommand_TestBit, + ScriptCommand_CheckInventory1, + ScriptCommand_CheckInventory2, + ScriptCommand_HasRoomItemForSale, + ScriptCommand_CheckLocalFlag, + ScriptCommand_CheckLocalFlagByOffset, + ScriptCommand_CheckGlobalFlag, + ScriptCommand_CheckRoomFlag, + ScriptCommand_CheckPlayerInRegion, + ScriptCommand_CheckPlayerInRegion2, + ScriptCommand_CheckEntityInteractType, + ScriptCommand_0807E30C, + ScriptCommand_HasRupees, + ScriptCommand_0807E3BC, + ScriptCommand_0807E3E8, + ScriptCommand_CheckKinstoneFused, + ScriptCommand_BuyItem, + ScriptCommand_0807E48C, + ScriptCommand_0807E4CC, + ScriptCommand_0807E4EC, + ScriptCommand_0807E514, + ScriptCommand_CheckPlayerFlags, + ScriptCommand_0807E564, + ScriptCommand_EntityHasHeight, + ScriptCommand_ComparePlayerAction, + ScriptCommand_ComparePlayerAnimationState, + ScriptCommand_0807E5F8, + ScriptCommand_0807E610, + ScriptCommand_SetLocalFlag, + ScriptCommand_SetLocalFlagByOffset, + ScriptCommand_ClearLocalFlag, + ScriptCommand_SetGlobalFlag, + ScriptCommand_ClearGlobalFlag, + ScriptCommand_SetRoomFlag, + ScriptCommand_ClearRoomFlag, + ScriptCommand_Wait, + ScriptCommand_WaitForSomething, + ScriptCommand_WaitForSomething2, + ScriptCommand_WaitPlayerAction8, + ScriptCommand_WaitForPlayerAction0x17, + ScriptCommand_WaitFor_1, + ScriptCommand_WaitFor_2, + ScriptCommand_0807E778, + ScriptCommand_0807E788, + ScriptCommand_0807E79C, + ScriptCommandNop2, + ScriptCommand_DoFade4, + ScriptCommand_DoFade5, + ScriptCommand_DoFade6, + ScriptCommand_DoFade7, + ScriptCommand_0807E800, + ScriptCommand_0807E80C, + ScriptCommand_0807E858, + ScriptCommand_0807E864, + ScriptCommand_0807E878, + ScriptCommand_0807E888, + ScriptCommand_SetPlayerAction, + ScriptCommand_StartPlayerScript, + ScriptCommand_0807E8D4, + ScriptCommand_0807E8E4, + ScriptCommand_0807E8E4, + ScriptCommand_0807E8E4, + ScriptCommand_0807E8E4, + ScriptCommand_0807E908, + ScriptCommand_SetIntVariable, + ScriptCommand_0807E924, + ScriptCommand_0807E930, + ScriptCommand_0807E944, + ScriptCommand_0807E974, + ScriptCommand_0807E9D4, + ScriptCommand_0807E9DC, + ScriptCommand_0807E9E4, + ScriptCommand_0807E9F0, + ScriptCommand_0807EA4C, + ScriptCommand_0807EA88, + ScriptCommand_0807EA94, + ScriptCommand_TextboxNoOverlapFollow, + ScriptCommand_TextboxNoOverlap, + ScriptCommand_TextboxNoOverlapFollowPos, + ScriptCommand_TextboxNoOverlapFollowTable, + ScriptCommand_TextboxNoOverlapVar, + ScriptCommand_0807EB28, + ScriptCommand_0807EB38, + ScriptCommand_0807EB44, + ScriptCommand_0807EB4C, + ScriptCommand_0807EB74, + ScriptCommand_0807EB8C, + ScriptCommand_SetEntityDirection, + ScriptCommand_SetEntityDirectionWithAnimationState, + ScriptCommand_SetEntitySpeed, + ScriptCommand_SetEntity0x20, + ScriptCommand_SetEntityPositionRelative, + ScriptCommand_SetEntityPosition, + ScriptCommand_MoveEntityToPlayer, + ScriptCommandNop3, + ScriptCommand_0807EC1C, + ScriptCommand_0807EC64, + ScriptCommand_0807EC94, + ScriptCommand_0807ECC4, + ScriptCommand_0807ECF4, + ScriptCommand_0807ED24, + ScriptCommand_0807EDD4, + ScriptCommand_0807EE04, + ScriptCommand_0807EE30, + ScriptCommand_0807EEB4, + ScriptCommand_0807EEF4, + ScriptCommand_0807EF3C, + ScriptCommand_DoPostScriptAction, + ScriptCommand_DoPostScriptAction2, + ScriptCommand_SoundReq, + ScriptCommand_SoundReq2, + ScriptCommand_SoundReq3, + ScriptCommand_SoundReq0x80100000, + ScriptCommand_ModRupees, + ScriptCommand_ModHealth, + ScriptCommand_IncreaseMaxHealth, + ScriptCommand_0807F034, + ScriptCommand_0807F050, + ScriptCommand_GetInventoryValue, + ScriptCommand_0807F078, + ScriptCommand_0807F088, + ScriptCommand_CameraTargetEntity, + ScriptCommand_CameraTargetPlayer, + ScriptCommand_0807F0B4, + ScriptCommand_0807F0C8 }; extern const u16 gUnk_08016984; extern u8 gUnk_0811E514[]; @@ -187,11 +306,11 @@ extern u8 gUnk_0811E510[]; extern ScriptExecutionContext gPlayerScriptExecutionContext; extern ScriptExecutionContext gScriptExecutionContextArray[0x20]; -void sub_0807DA70(void) { - MemClear32(&gUnk_02033280, sizeof(gUnk_02033280)); - MemClear32(&gScriptExecutionContextArray, sizeof(gScriptExecutionContextArray)); - MemClear32(&gPlayerScriptExecutionContext, sizeof(gPlayerScriptExecutionContext)); - gUnk_02033280.unk_08 = 8; +void InitScriptData(void) { + MemClear(&gActiveScriptInfo, sizeof(gActiveScriptInfo)); + MemClear(&gScriptExecutionContextArray, sizeof(gScriptExecutionContextArray)); + MemClear(&gPlayerScriptExecutionContext, sizeof(gPlayerScriptExecutionContext)); + gActiveScriptInfo.unk_08 = 8; } ScriptExecutionContext* CreateScriptExecutionContext(void) { @@ -199,7 +318,7 @@ ScriptExecutionContext* CreateScriptExecutionContext(void) { context = gScriptExecutionContextArray; do { - if (context->unk_00 == 0) { + if (context->scriptInstructionPointer == 0) { return context; } context++; @@ -208,23 +327,23 @@ ScriptExecutionContext* CreateScriptExecutionContext(void) { } void DestroyScriptExecutionContext(ScriptExecutionContext* context) { - MemClear32(context, sizeof(ScriptExecutionContext)); + MemClear(context, sizeof(ScriptExecutionContext)); } -ScriptExecutionContext* StartCutscene(Entity* entity, u16* unk_2) { +ScriptExecutionContext* StartCutscene(Entity* entity, u16* script) { ScriptExecutionContext* context; context = CreateScriptExecutionContext(); if (context) { - sub_0807DAF0(entity, context, unk_2); + InitScriptForEntity(entity, context, script); } return context; } -void sub_0807DAF0(Entity* entity, ScriptExecutionContext* context, u16* unk1) { +void InitScriptForEntity(Entity* entity, ScriptExecutionContext* context, u16* script) { entity->flags = entity->flags | 2; *(ScriptExecutionContext**)&entity->cutsceneBeh = context; - sub_0807DB88(context, unk1); + InitScriptExecutionContext(context, script); } void UnloadCutsceneData(Entity* entity) { @@ -235,11 +354,11 @@ void UnloadCutsceneData(Entity* entity) { } } -void StartPlayerScript(u16* unk1) { +void StartPlayerScript(u16* script) { Entity* player; - MemClear32(&gPlayerScriptExecutionContext, sizeof(gPlayerScriptExecutionContext)); - gPlayerScriptExecutionContext.unk_00 = unk1; + MemClear(&gPlayerScriptExecutionContext, sizeof(gPlayerScriptExecutionContext)); + gPlayerScriptExecutionContext.scriptInstructionPointer = script; player = &gPlayerEntity; *(ScriptExecutionContext**)&player->cutsceneBeh = &gPlayerScriptExecutionContext; gPlayerState.playerAction = 0x1c; @@ -248,89 +367,89 @@ void StartPlayerScript(u16* unk1) { gPlayerState.field_0x38 = 0; } -ScriptExecutionContext* sub_0807DB68(Entity* entity, u16* unk1) { +ScriptExecutionContext* StartCutscene2(Entity* entity, u16* script) { ScriptExecutionContext* context; context = CreateScriptExecutionContext(); if (context) { entity->flags |= 2; *(ScriptExecutionContext**)&entity->field_0x3c = context; - context->unk_00 = unk1; + context->scriptInstructionPointer = script; } return context; } -void sub_0807DB88(ScriptExecutionContext* context, u16* unk1) { - MemClear32(context, sizeof(ScriptExecutionContext)); - context->unk_00 = unk1; +void InitScriptExecutionContext(ScriptExecutionContext* context, u16* script) { + MemClear(context, sizeof(ScriptExecutionContext)); + context->scriptInstructionPointer = script; } -void sub_0807DB98(Entity* entity, ScriptExecutionContext* context) { - u32 switchVar; - - while (context->unk_08) { - switchVar = (~context->unk_08 + 1) & context->unk_08; - context->unk_08 ^= switchVar; - switch (switchVar) { - case 1: +void HandlePostScriptActions(Entity* entity, ScriptExecutionContext* context) { + u32 bit; + // iterate over bits of context->postScriptActions, LSB first + while (context->postScriptActions) { + bit = (~context->postScriptActions + 1) & context->postScriptActions; + context->postScriptActions ^= bit; + switch (bit) { + case 1 << 0x00: entity->field_0x80.HWORD = 0; break; - case 2: + case 1 << 0x01: entity->field_0x80.HWORD = 4; break; - case 4: + case 1 << 0x02: break; - case 8: + case 1 << 0x03: entity->field_0x20 = 0x18000; break; - case 0x10: + case 1 << 0x04: CreateSpeechBubbleExclamationMark(entity, 8, -0x18); break; - case 0x20: + case 1 << 0x05: CreateSpeechBubbleQuestionMark(entity, 8, -0x18); break; - case 0x40: + case 1 << 0x06: DestroyScriptExecutionContext(context); DeleteThisEntity(); - case 0x80: + case 1 << 0x07: entity->spriteSettings.b.draw = 1; break; - case 0x100: + case 1 << 0x08: entity->spriteSettings.b.draw = 0; break; - case 0x200: + case 1 << 0x09: entity->spriteOffsetY = 0; entity->spriteOffsetX = 0; entity->field_0x82.HWORD = 0; break; - case 0x400: + case 1 << 0x0a: entity->field_0x82.HWORD |= 2; break; - case 0x800: + case 1 << 0x0b: entity->field_0x82.HWORD &= 0xfffd; break; - case 0x1000: + case 1 << 0x0c: entity->field_0x82.HWORD &= 0xfffe; break; - case 0x2000: + case 1 << 0x0d: entity->field_0x82.HWORD |= 1; break; - case 0x4000: + case 1 << 0x0e: entity->field_0x82.HWORD |= 8; break; - case 0x8000: + case 1 << 0x0f: entity->field_0x82.HWORD ^= 4; break; - case 0x10000: + case 1 << 0x10: entity->field_0x82.HWORD ^= 0x10; break; - case 0x20000: + case 1 << 0x11: entity->spriteSettings.b.flipX ^= 1; break; - case 0x40000: + case 1 << 0x12: entity->field_0x82.HWORD |= 0x20; break; - case 0x80000: + case 1 << 0x13: entity->field_0x82.HWORD &= 0xffdf; break; default: @@ -351,27 +470,27 @@ void sub_0807DD64(Entity* entity) { entity->field_0x82.HWORD = 0; } -void sub_0807DD80(Entity* entity, u16* unk1) { - sub_0807DB88(*(ScriptExecutionContext**)&entity->cutsceneBeh, unk1); +void sub_0807DD80(Entity* entity, u16* script) { + InitScriptExecutionContext(*(ScriptExecutionContext**)&entity->cutsceneBeh, script); sub_0807DD64(entity); } void sub_0807DD94(Entity* entity, void (*function)(Entity*, ScriptExecutionContext*)) { - sub_0807DDAC(entity, function); - sub_0807DDE4(entity); + ExecuteScriptForEntity(entity, function); + HandleEntity0x82Actions(entity); sub_0807DE80(entity); } -void sub_0807DDAC(Entity* entity, void (*function)(Entity*, ScriptExecutionContext*)) { +void ExecuteScriptForEntity(Entity* entity, void (*postScriptCallback)(Entity*, ScriptExecutionContext*)) { ScriptExecutionContext** piVar1; piVar1 = (ScriptExecutionContext**)&entity->cutsceneBeh; if (*piVar1) { - ExecuteScriptCommandSet(entity, *piVar1); - if (function) { - function(entity, *piVar1); + ExecuteScript(entity, *piVar1); + if (postScriptCallback) { + postScriptCallback(entity, *piVar1); } else { - sub_0807DB98(entity, *piVar1); + HandlePostScriptActions(entity, *piVar1); } if (!entity->next) { DeleteThisEntity(); @@ -379,36 +498,36 @@ void sub_0807DDAC(Entity* entity, void (*function)(Entity*, ScriptExecutionConte } } -void sub_0807DDE4(Entity* entity) { +void HandleEntity0x82Actions(Entity* entity) { u32 temp; - u32 switchVar; + u32 bit; u32 loopVar; loopVar = entity->field_0x82.HWORD; while (loopVar) { - switchVar = (~loopVar + 1) & loopVar; - loopVar = loopVar ^ switchVar; - switch (switchVar) { - case 2: + bit = (~loopVar + 1) & loopVar; + loopVar = loopVar ^ bit; + switch (bit) { + case 1 << 1: if (entity->kind == 7) { sub_0806ED78(entity); } else { sub_0800445C(entity); } break; - case 8: + case 1 << 3: if ((gScreenTransition.frameCount & 3) == 0) { temp = (entity->field_0xf + 2U) & 7; entity->animationState = temp; entity->field_0xf = temp; } break; - case 0x10: + case 1 << 4: if ((gScreenTransition.frameCount & 1) == 0) { entity->spriteOffsetX = gUnk_0811E510[Random() & 3]; } break; - case 0x20: + case 1 << 5: sub_08003FC4(entity, 0x2000); break; } @@ -447,20 +566,20 @@ void sub_0807DE80(Entity* entity) { sub_080042BA(entity, local1); } -void sub_0807DEDC(Entity* entity, ScriptExecutionContext* context, u32 arg2, u32 arg3) { - int temp; - s32 t0, t1; +void sub_0807DEDC(Entity* entity, ScriptExecutionContext* context, u32 x, u32 y) { + int direction; + s32 xOffset, yOffset; context->unk_19 = 8; - context->unk_08 |= 2; - context->unk_14 = 0; - context->unk_1C.HALF.HI = arg2; - context->unk_20.HALF.HI = arg3; - t0 = context->unk_1C.HALF.HI - entity->x.HALF.HI; - t1 = context->unk_20.HALF.HI - entity->y.HALF.HI; - temp = sub_080045DA(t0, t1); - entity->direction = temp; - entity->animationState = (entity->animationState & 0x80) | gUnk_0811E514[(u32)(temp << 0x18) >> 0x1c]; + context->postScriptActions |= 2; + context->condition = 0; + context->x.HALF.HI = x; + context->y.HALF.HI = y; + xOffset = context->x.HALF.HI - entity->x.HALF.HI; + yOffset = context->y.HALF.HI - entity->y.HALF.HI; + direction = sub_080045DA(xOffset, yOffset); + entity->direction = direction; + entity->animationState = (entity->animationState & 0x80) | gUnk_0811E514[(u32)(direction << 0x18) >> 0x1c]; } void sub_0807DF28(void) { @@ -482,124 +601,126 @@ void sub_0807DF50(void) { sub_08079184(); } -void ExecuteScriptCommandSet(Entity* unk1, ScriptExecutionContext* unk2) { - if (!unk2->unk_00) +void ExecuteScript(Entity* entity, ScriptExecutionContext* context) { + if (!context->scriptInstructionPointer) return; - if (unk2->unk_10) { - unk2->unk_10--; + if (context->wait) { + context->wait--; } else { - struct_02033280* tmp2 = &gUnk_02033280; - tmp2->unk_07 = 0; + struct_02033280* activeScriptInfo = &gActiveScriptInfo; + activeScriptInfo->flags = 0; do { - u32 cmd = GetNextScriptCommandHalfword(unk2->unk_00); - u16* tmp; + u32 cmd = GetNextScriptCommandHalfword(context->scriptInstructionPointer); + u16* lastInstruction; if (cmd == 0xFFFF) return; - tmp2->unk_06 = cmd >> 0xA; - tmp2->unk_04 = cmd & 0x3FF; - tmp = unk2->unk_00; - tmp2->unk_07 &= ~1; - gUnk_0811E524[tmp2->unk_04](unk1, unk2); - unk2->unk_00 += tmp2->unk_06; - if (tmp != unk2->unk_00) { - unk2->unk_18 = 0; + activeScriptInfo->commandSize = cmd >> 0xA; + activeScriptInfo->commandIndex = cmd & 0x3FF; + lastInstruction = context->scriptInstructionPointer; + activeScriptInfo->flags &= ~1; + gScriptCommands[activeScriptInfo->commandIndex](entity, context); + context->scriptInstructionPointer += activeScriptInfo->commandSize; + if (lastInstruction != context->scriptInstructionPointer) { + context->unk_18 = 0; } - } while (tmp2->unk_07 & 3); + } while (activeScriptInfo->flags & 3); } } -void nullsub_507(Entity* unk1, ScriptExecutionContext* unk2) { +void ScriptCommandNop(Entity* entity, ScriptExecutionContext* context) { } -void sub_0807E004(Entity* unk1, ScriptExecutionContext* unk2) { - gUnk_02033280.unk_07 |= 2; +// not entirely sure this name is acurate +void ScriptCommand_BeginBlock(Entity* entity, ScriptExecutionContext* context) { + gActiveScriptInfo.flags |= 2; } -void sub_0807E014(Entity* unk1, ScriptExecutionContext* unk2) { - gUnk_02033280.unk_07 &= ~2; +// not entirely sure this name is acurate +void ScriptCommand_EndBlock(Entity* entity, ScriptExecutionContext* context) { + gActiveScriptInfo.flags &= ~2; } -void sub_0807E024(Entity* unk1, ScriptExecutionContext* unk2) { +void ScriptCommand_Jump(Entity* entity, ScriptExecutionContext* context) { s16 tmp; - unk2->unk_00++; - tmp = GetNextScriptCommandHalfword(unk2->unk_00); - unk2->unk_00 += (tmp / 2); - gUnk_02033280.unk_06 = 0; + context->scriptInstructionPointer++; + tmp = GetNextScriptCommandHalfword(context->scriptInstructionPointer); + context->scriptInstructionPointer += (tmp / 2); + gActiveScriptInfo.commandSize = 0; } -void sub_0807E050(Entity* unk1, ScriptExecutionContext* unk2) { - if (unk2->unk_14) { - sub_0807E024(unk1, unk2); +void ScriptCommand_JumpIf(Entity* entity, ScriptExecutionContext* context) { + if (context->condition) { + ScriptCommand_Jump(entity, context); } } -void sub_0807E064(Entity* unk1, ScriptExecutionContext* unk2) { - if (!unk2->unk_14) { - sub_0807E024(unk1, unk2); +void ScriptCommand_JumpIfNot(Entity* entity, ScriptExecutionContext* context) { + if (!context->condition) { + ScriptCommand_Jump(entity, context); } } -void sub_0807E078(Entity* unk1, ScriptExecutionContext* unk2) { - if (gUnk_02033280.unk_06 > unk2->unk_04) { - unk2->unk_00 += unk2->unk_04; - sub_0807E024(unk1, unk2); +void ScriptCommand_JumpTable(Entity* entity, ScriptExecutionContext* context) { + if (gActiveScriptInfo.commandSize > context->intVariable) { + context->scriptInstructionPointer += context->intVariable; + ScriptCommand_Jump(entity, context); } } -void sub_0807E0A0(Entity* unk1, ScriptExecutionContext* unk2) { - unk2->unk_00 = (u16*)GetNextScriptCommandWordAfterCommandMetadata(unk2->unk_00); - gUnk_02033280.unk_06 = 0; +void ScriptCommand_JumpAbsolute(Entity* entity, ScriptExecutionContext* context) { + context->scriptInstructionPointer = + (u16*)GetNextScriptCommandWordAfterCommandMetadata(context->scriptInstructionPointer); + gActiveScriptInfo.commandSize = 0; } -void sub_0807E0B8(Entity* unk1, ScriptExecutionContext* unk2) { - if (unk2->unk_14) { - sub_0807E0A0(unk1, unk2); +void ScriptCommand_JumpAbsoluteIf(Entity* entity, ScriptExecutionContext* context) { + if (context->condition) { + ScriptCommand_JumpAbsolute(entity, context); } } -void sub_0807E0CC(Entity* unk1, ScriptExecutionContext* unk2) { - if (!unk2->unk_14) { - sub_0807E0A0(unk1, unk2); +void ScriptCommand_JumpAbsoluteIfNot(Entity* entity, ScriptExecutionContext* context) { + if (!context->condition) { + ScriptCommand_JumpAbsolute(entity, context); } } -void sub_0807E0E0(Entity* unk1, ScriptExecutionContext* unk2) { - if (gUnk_02033280.unk_06 > (unk2->unk_04 << 1) + 1) { - unk2->unk_00 += unk2->unk_04 << 1; - sub_0807E0A0(unk1, unk2); +void ScriptCommand_JumpAbsoluteTable(Entity* entity, ScriptExecutionContext* context) { + if (gActiveScriptInfo.commandSize > (context->intVariable << 1) + 1) { + context->scriptInstructionPointer += context->intVariable << 1; + ScriptCommand_JumpAbsolute(entity, context); } } -void sub_0807E10C(Entity* unk1, ScriptExecutionContext* unk2) { - ((void (*)(Entity*, ScriptExecutionContext*))GetNextScriptCommandWordAfterCommandMetadata(unk2->unk_00))(unk1, - unk2); +void ScriptCommand_Call(Entity* entity, ScriptExecutionContext* context) { + ((ScriptCommand)GetNextScriptCommandWordAfterCommandMetadata(context->scriptInstructionPointer))(entity, context); } -void sub_0807E124(Entity* unk1, ScriptExecutionContext* unk2) { - void (*tmp)(Entity*, ScriptExecutionContext*) = - (void (*)(Entity*, ScriptExecutionContext*))GetNextScriptCommandWordAfterCommandMetadata(unk2->unk_00); - unk2->unk_04 = GetNextScriptCommandWord(unk2->unk_00 + 3); - tmp(unk1, unk2); +// the called function can read an argument from context->intVariable +void ScriptCommand_CallWithArg(Entity* entity, ScriptExecutionContext* context) { + ScriptCommand tmp = (ScriptCommand)GetNextScriptCommandWordAfterCommandMetadata(context->scriptInstructionPointer); + context->intVariable = GetNextScriptCommandWord(context->scriptInstructionPointer + 3); + tmp(entity, context); } -void sub_0807E148(Entity* unk1, ScriptExecutionContext* unk2) { - LoadRoomEntityList(GetNextScriptCommandWordAfterCommandMetadata(unk2->unk_00)); +void ScriptCommand_LoadRoomEntityList(Entity* entity, ScriptExecutionContext* context) { + LoadRoomEntityList((EntityData*)GetNextScriptCommandWordAfterCommandMetadata(context->scriptInstructionPointer)); } -void sub_0807E158(Entity* unk1, ScriptExecutionContext* unk2) { - u32 tmp = GetNextScriptCommandWordAfterCommandMetadata(unk2->unk_00); +void ScriptCommand_TestBit(Entity* entity, ScriptExecutionContext* context) { + u32 tmp = GetNextScriptCommandWordAfterCommandMetadata(context->scriptInstructionPointer); u32 tmp2 = 0; - u32 tmp3 = gUnk_02033280.unk_00; + u32 tmp3 = gActiveScriptInfo.unk_00; if ((tmp3 & tmp) == tmp) tmp2 = 1; - unk2->unk_14 = tmp2; - gUnk_02033280.unk_00 = tmp3 & ~tmp; - gUnk_02033280.unk_07 |= 1; + context->condition = tmp2; + gActiveScriptInfo.unk_00 = tmp3 & ~tmp; + gActiveScriptInfo.flags |= 1; } -void sub_0807E188(Entity* unk1, ScriptExecutionContext* unk2) { +void ScriptCommand_CheckInventory1(Entity* entity, ScriptExecutionContext* context) { u32 tmp; - u32 tmp2 = GetNextScriptCommandHalfwordAfterCommandMetadata(unk2->unk_00); + u32 tmp2 = GetNextScriptCommandHalfwordAfterCommandMetadata(context->scriptInstructionPointer); switch (tmp2) { case 0x53: tmp = sub_08052734(); @@ -616,416 +737,419 @@ void sub_0807E188(Entity* unk1, ScriptExecutionContext* unk2) { default: tmp = GetInventoryValue(tmp2); } - unk2->unk_14 = tmp; - gUnk_02033280.unk_07 |= 1; + context->condition = tmp; + gActiveScriptInfo.flags |= 1; } -void sub_0807E1D8(Entity* unk1, ScriptExecutionContext* unk2) { - unk2->unk_14 = GetInventoryValue(unk2->unk_00[1]) == 2; - gUnk_02033280.unk_07 |= 1; +void ScriptCommand_CheckInventory2(Entity* entity, ScriptExecutionContext* context) { + context->condition = GetInventoryValue(context->scriptInstructionPointer[1]) == 2; + gActiveScriptInfo.flags |= 1; } -void sub_0807E200(Entity* unk1, ScriptExecutionContext* unk2) { - unk2->unk_14 = CheckLocalFlag(unk2->unk_00[1]); - gUnk_02033280.unk_07 |= 1; +void ScriptCommand_CheckLocalFlag(Entity* entity, ScriptExecutionContext* context) { + context->condition = CheckLocalFlag(context->scriptInstructionPointer[1]); + gActiveScriptInfo.flags |= 1; } -void sub_0807E220(Entity* unk1, ScriptExecutionContext* unk2) { - unk2->unk_14 = CheckLocalFlagByOffset(unk2->unk_00[1], unk2->unk_00[2]); - gUnk_02033280.unk_07 |= 1; +void ScriptCommand_CheckLocalFlagByOffset(Entity* entity, ScriptExecutionContext* context) { + context->condition = + CheckLocalFlagByOffset(context->scriptInstructionPointer[1], context->scriptInstructionPointer[2]); + gActiveScriptInfo.flags |= 1; } -void sub_0807E240(Entity* unk1, ScriptExecutionContext* unk2) { - unk2->unk_14 = CheckGlobalFlag(GetNextScriptCommandHalfwordAfterCommandMetadata(unk2->unk_00)); - gUnk_02033280.unk_07 |= 1; +void ScriptCommand_CheckGlobalFlag(Entity* entity, ScriptExecutionContext* context) { + context->condition = + CheckGlobalFlag(GetNextScriptCommandHalfwordAfterCommandMetadata(context->scriptInstructionPointer)); + gActiveScriptInfo.flags |= 1; } -void sub_0807E260(Entity* unk1, ScriptExecutionContext* unk2) { - unk2->unk_14 = CheckRoomFlag(unk2->unk_00[1]); - gUnk_02033280.unk_07 |= 1; +void ScriptCommand_CheckRoomFlag(Entity* entity, ScriptExecutionContext* context) { + context->condition = CheckRoomFlag(context->scriptInstructionPointer[1]); + gActiveScriptInfo.flags |= 1; } -void sub_0807E280(Entity* unk1, ScriptExecutionContext* unk2) { +void ScriptCommand_CheckPlayerInRegion(Entity* entity, ScriptExecutionContext* context) { u32 x, y, width, height; - width = unk2->unk_00[3]; + width = context->scriptInstructionPointer[3]; height = width >> 8; width &= 0xFF; - x = unk2->unk_00[1]; - y = unk2->unk_00[2]; - unk2->unk_14 = CheckPlayerInRegion(x, y, width, height); - gUnk_02033280.unk_07 |= 1; + x = context->scriptInstructionPointer[1]; + y = context->scriptInstructionPointer[2]; + context->condition = CheckPlayerInRegion(x, y, width, height); + gActiveScriptInfo.flags |= 1; } -void sub_0807E2A8(Entity* unk1, ScriptExecutionContext* unk2) { +void ScriptCommand_CheckPlayerInRegion2(Entity* entity, ScriptExecutionContext* context) { u32 x, y, width, height; - width = unk2->unk_00[1] & 0xFF; - height = unk2->unk_00[1] >> 8; - x = unk1->x.HALF.HI - gRoomControls.roomOriginX; - y = unk1->y.HALF.HI - gRoomControls.roomOriginY; - unk2->unk_14 = CheckPlayerInRegion(x, y, width, height); - gUnk_02033280.unk_07 |= 1; + width = context->scriptInstructionPointer[1] & 0xFF; + height = context->scriptInstructionPointer[1] >> 8; + x = entity->x.HALF.HI - gRoomControls.roomOriginX; + y = entity->y.HALF.HI - gRoomControls.roomOriginY; + context->condition = CheckPlayerInRegion(x, y, width, height); + gActiveScriptInfo.flags |= 1; } -void sub_0807E2E4(Entity* unk1, ScriptExecutionContext* unk2) { - if (unk1->interactType) { - unk1->interactType = 0; - unk2->unk_14 = 1; +void ScriptCommand_CheckEntityInteractType(Entity* entity, ScriptExecutionContext* context) { + if (entity->interactType) { + entity->interactType = 0; + context->condition = 1; } else { - unk2->unk_14 = 0; + context->condition = 0; } - gUnk_02033280.unk_07 |= 1; + gActiveScriptInfo.flags |= 1; } -void sub_0807E30C(Entity* unk1, ScriptExecutionContext* unk2) { - if ((unk2->unk_1A & 0xF) == 0 && (gPlayerState.flags.all & 0x80) == 0 && - sub_080041A0(unk1, &gPlayerEntity, 0x28, 0x28)) { - unk1->animationState = sub_0806F5B0(GetFacingDirection(unk1, &gPlayerEntity)); +void ScriptCommand_0807E30C(Entity* entity, ScriptExecutionContext* context) { + if ((context->unk_1A & 0xF) == 0 && (gPlayerState.flags.all & 0x80) == 0 && + sub_080041A0(entity, &gPlayerEntity, 0x28, 0x28)) { + entity->animationState = sub_0806F5B0(GetFacingDirection(entity, &gPlayerEntity)); } - unk2->unk_1A++; - if (unk1->interactType) { - unk1->interactType = 0; - unk2->unk_14 = 1; - unk1->animationState = sub_0806F5B0(GetFacingDirection(unk1, &gPlayerEntity)); + context->unk_1A++; + if (entity->interactType) { + entity->interactType = 0; + context->condition = 1; + entity->animationState = sub_0806F5B0(GetFacingDirection(entity, &gPlayerEntity)); } else { - unk2->unk_14 = 0; + context->condition = 0; } - gUnk_02033280.unk_07 |= 1; + gActiveScriptInfo.flags |= 1; } -void sub_0807E390(Entity* unk1, ScriptExecutionContext* unk2) { - unk2->unk_14 = (unk2->unk_00[1] <= gSave.stats.rupees); - gUnk_02033280.unk_07 |= 1; +void ScriptCommand_HasRupees(Entity* entity, ScriptExecutionContext* context) { + context->condition = (context->scriptInstructionPointer[1] <= gSave.stats.rupees); + gActiveScriptInfo.flags |= 1; } -void sub_0807E3BC(Entity* unk1, ScriptExecutionContext* unk2) { - unk2->unk_14 = (unk2->unk_00[1] <= gSave.stats.field_0x1a); - gUnk_02033280.unk_07 |= 1; +void ScriptCommand_0807E3BC(Entity* entity, ScriptExecutionContext* context) { + context->condition = (context->scriptInstructionPointer[1] <= gSave.stats.field_0x1a); + gActiveScriptInfo.flags |= 1; } -void sub_0807E3E8(Entity* unk1, ScriptExecutionContext* unk2) { - unk2->unk_14 = !gUnk_02000040.unk_01; - gUnk_02033280.unk_07 |= 1; +void ScriptCommand_0807E3E8(Entity* entity, ScriptExecutionContext* context) { + context->condition = !gUnk_02000040.unk_01; + gActiveScriptInfo.flags |= 1; } -void sub_0807E40C(Entity* unk1, ScriptExecutionContext* unk2) { - unk2->unk_14 = CheckKinstoneFused(unk2->unk_00[1]); - gUnk_02033280.unk_07 |= 1; +void ScriptCommand_CheckKinstoneFused(Entity* entity, ScriptExecutionContext* context) { + context->condition = CheckKinstoneFused(context->scriptInstructionPointer[1]); + gActiveScriptInfo.flags |= 1; } -void sub_0807E42C(Entity* unk1, ScriptExecutionContext* unk2) { - u32 tmp, tmp2; - s32 tmp3; - tmp = unk2->unk_00[1]; - tmp2 = unk2->unk_00[2]; - if (!tmp) { - tmp = gRoomVars.itemForSaleIndex; +void ScriptCommand_BuyItem(Entity* entity, ScriptExecutionContext* context) { + u32 item, tmp2; + s32 price; + item = context->scriptInstructionPointer[1]; + tmp2 = context->scriptInstructionPointer[2]; + if (!item) { + item = gRoomVars.itemForSaleIndex; tmp2 = gRoomVars.field_0x7; } - tmp3 = sub_08053FE0(tmp); - unk2->unk_14 = (tmp3 <= gSave.stats.rupees); - if (unk2->unk_14) { - ModRupees(-tmp3); - sub_080A7C18(tmp, tmp2, 0); + price = GetItemPrice(item); + context->condition = (price <= gSave.stats.rupees); + if (context->condition) { + ModRupees(-price); + sub_080A7C18(item, tmp2, 0); gRoomVars.itemForSaleIndex = 0; gRoomVars.field_0x7 = 0; } - gUnk_02033280.unk_07 |= 1; + gActiveScriptInfo.flags |= 1; } -void sub_0807E48C(Entity* unk1, ScriptExecutionContext* unk2) { - unk2->unk_14 = sub_080544DC(unk2->unk_00[1]); - gUnk_02033280.unk_07 |= 1; +void ScriptCommand_0807E48C(Entity* entity, ScriptExecutionContext* context) { + context->condition = GetBottleContaining(context->scriptInstructionPointer[1]); + gActiveScriptInfo.flags |= 1; } -void sub_0807E4AC(Entity* unk1, ScriptExecutionContext* unk2) { - unk2->unk_14 = !!gRoomVars.itemForSaleIndex; - gUnk_02033280.unk_07 |= 1; +void ScriptCommand_HasRoomItemForSale(Entity* entity, ScriptExecutionContext* context) { + context->condition = !!gRoomVars.itemForSaleIndex; + gActiveScriptInfo.flags |= 1; } -void sub_0807E4CC(Entity* unk1, ScriptExecutionContext* unk2) { - unk2->unk_14 = !!(unk2->unk_04 & unk2->unk_00[1]); - gUnk_02033280.unk_07 |= 1; +void ScriptCommand_0807E4CC(Entity* entity, ScriptExecutionContext* context) { + context->condition = !!(context->intVariable & context->scriptInstructionPointer[1]); + gActiveScriptInfo.flags |= 1; } -void sub_0807E4EC(Entity* unk1, ScriptExecutionContext* unk2) { - u32 tmp = unk2->unk_00[1]; - unk2->unk_14 = tmp == (tmp & unk2->unk_04); - gUnk_02033280.unk_07 |= 1; +void ScriptCommand_0807E4EC(Entity* entity, ScriptExecutionContext* context) { + u32 tmp = context->scriptInstructionPointer[1]; + context->condition = tmp == (tmp & context->intVariable); + gActiveScriptInfo.flags |= 1; } -void sub_0807E514(Entity* unk1, ScriptExecutionContext* unk2) { - u32 tmp = unk2->unk_00[1]; - unk2->unk_14 = tmp == unk2->unk_04; - gUnk_02033280.unk_07 |= 1; +void ScriptCommand_0807E514(Entity* entity, ScriptExecutionContext* context) { + u32 tmp = context->scriptInstructionPointer[1]; + context->condition = tmp == context->intVariable; + gActiveScriptInfo.flags |= 1; } -void sub_0807E538(Entity* unk1, ScriptExecutionContext* unk2) { - unk2->unk_14 = !!(GetNextScriptCommandWordAfterCommandMetadata(unk2->unk_00) & gPlayerState.flags.all); - gUnk_02033280.unk_07 |= 1; +void ScriptCommand_CheckPlayerFlags(Entity* entity, ScriptExecutionContext* context) { + context->condition = + !!(GetNextScriptCommandWordAfterCommandMetadata(context->scriptInstructionPointer) & gPlayerState.flags.all); + gActiveScriptInfo.flags |= 1; } -void sub_0807E564(Entity* unk1, ScriptExecutionContext* unk2) { - unk2->unk_14 = (gPlayerState.flags.all >> 7) & 1; - gUnk_02033280.unk_07 |= 1; +void ScriptCommand_0807E564(Entity* entity, ScriptExecutionContext* context) { + context->condition = (gPlayerState.flags.all >> 7) & 1; + gActiveScriptInfo.flags |= 1; } -void sub_0807E584(Entity* unk1, ScriptExecutionContext* unk2) { - unk2->unk_14 = unk1->height.WORD != 0; - gUnk_02033280.unk_07 |= 1; +void ScriptCommand_EntityHasHeight(Entity* entity, ScriptExecutionContext* context) { + context->condition = entity->height.WORD != 0; + gActiveScriptInfo.flags |= 1; } -void sub_0807E5A0(Entity* unk1, ScriptExecutionContext* unk2) { - unk2->unk_14 = unk2->unk_00[1] == gPlayerEntity.action; - gUnk_02033280.unk_07 |= 1; +void ScriptCommand_ComparePlayerAction(Entity* entity, ScriptExecutionContext* context) { + context->condition = context->scriptInstructionPointer[1] == gPlayerEntity.action; + gActiveScriptInfo.flags |= 1; } -void sub_0807E5CC(Entity* unk1, ScriptExecutionContext* unk2) { - unk2->unk_14 = unk2->unk_00[1] == gPlayerEntity.animationState; - gUnk_02033280.unk_07 |= 1; +void ScriptCommand_ComparePlayerAnimationState(Entity* entity, ScriptExecutionContext* context) { + context->condition = context->scriptInstructionPointer[1] == gPlayerEntity.animationState; + gActiveScriptInfo.flags |= 1; } -void sub_0807E5F8(Entity* unk1, ScriptExecutionContext* unk2) { - gUnk_02033280.unk_00 |= GetNextScriptCommandWordAfterCommandMetadata(unk2->unk_00); +void ScriptCommand_0807E5F8(Entity* entity, ScriptExecutionContext* context) { + gActiveScriptInfo.unk_00 |= GetNextScriptCommandWordAfterCommandMetadata(context->scriptInstructionPointer); } -void sub_0807E610(Entity* unk1, ScriptExecutionContext* unk2) { - gUnk_02033280.unk_00 &= ~GetNextScriptCommandWordAfterCommandMetadata(unk2->unk_00); +void ScriptCommand_0807E610(Entity* entity, ScriptExecutionContext* context) { + gActiveScriptInfo.unk_00 &= ~GetNextScriptCommandWordAfterCommandMetadata(context->scriptInstructionPointer); } -void sub_0807E628(Entity* unk1, ScriptExecutionContext* unk2) { - SetLocalFlag(unk2->unk_00[1]); +void ScriptCommand_SetLocalFlag(Entity* entity, ScriptExecutionContext* context) { + SetLocalFlag(context->scriptInstructionPointer[1]); } -void sub_0807E634(Entity* unk1, ScriptExecutionContext* unk2) { - SetLocalFlagByOffset(unk2->unk_00[1], unk2->unk_00[2]); +void ScriptCommand_SetLocalFlagByOffset(Entity* entity, ScriptExecutionContext* context) { + SetLocalFlagByOffset(context->scriptInstructionPointer[1], context->scriptInstructionPointer[2]); } -void sub_0807E644(Entity* unk1, ScriptExecutionContext* unk2) { - ClearLocalFlag(unk2->unk_00[1]); +void ScriptCommand_ClearLocalFlag(Entity* entity, ScriptExecutionContext* context) { + ClearLocalFlag(context->scriptInstructionPointer[1]); } -void sub_0807E650(Entity* unk1, ScriptExecutionContext* unk2) { - SetGlobalFlag(unk2->unk_00[1]); +void ScriptCommand_SetGlobalFlag(Entity* entity, ScriptExecutionContext* context) { + SetGlobalFlag(context->scriptInstructionPointer[1]); } -void sub_0807E65C(Entity* unk1, ScriptExecutionContext* unk2) { - ClearGlobalFlag(unk2->unk_00[1]); +void ScriptCommand_ClearGlobalFlag(Entity* entity, ScriptExecutionContext* context) { + ClearGlobalFlag(context->scriptInstructionPointer[1]); } -void sub_0807E668(Entity* unk1, ScriptExecutionContext* unk2) { - SetRoomFlag(unk2->unk_00[1]); +void ScriptCommand_SetRoomFlag(Entity* entity, ScriptExecutionContext* context) { + SetRoomFlag(context->scriptInstructionPointer[1]); } -void sub_0807E674(Entity* unk1, ScriptExecutionContext* unk2) { - ClearRoomFlag(unk2->unk_00[1]); +void ScriptCommand_ClearRoomFlag(Entity* entity, ScriptExecutionContext* context) { + ClearRoomFlag(context->scriptInstructionPointer[1]); } -void sub_0807E680(Entity* unk1, ScriptExecutionContext* unk2) { - unk2->unk_10 = GetNextScriptCommandHalfwordAfterCommandMetadata(unk2->unk_00); +void ScriptCommand_Wait(Entity* entity, ScriptExecutionContext* context) { + context->wait = GetNextScriptCommandHalfwordAfterCommandMetadata(context->scriptInstructionPointer); } -void sub_0807E690(Entity* unk1, ScriptExecutionContext* unk2) { - u32 tmp = GetNextScriptCommandWordAfterCommandMetadata(unk2->unk_00); - if ((gUnk_02033280.unk_00 & tmp) != tmp) { - gUnk_02033280.unk_06 = 0; +void ScriptCommand_WaitForSomething(Entity* entity, ScriptExecutionContext* context) { + u32 tmp = GetNextScriptCommandWordAfterCommandMetadata(context->scriptInstructionPointer); + if ((gActiveScriptInfo.unk_00 & tmp) != tmp) { + gActiveScriptInfo.commandSize = 0; } } -void sub_0807E6AC(Entity* unk1, ScriptExecutionContext* unk2) { - u32 tmp = GetNextScriptCommandWordAfterCommandMetadata(unk2->unk_00); - if ((gUnk_02033280.unk_00 & tmp) != tmp) { - gUnk_02033280.unk_06 = 0; +void ScriptCommand_WaitForSomething2(Entity* entity, ScriptExecutionContext* context) { + u32 tmp = GetNextScriptCommandWordAfterCommandMetadata(context->scriptInstructionPointer); + if ((gActiveScriptInfo.unk_00 & tmp) != tmp) { + gActiveScriptInfo.commandSize = 0; } else { - gUnk_02033280.unk_00 &= ~tmp; - gUnk_02033280.unk_07 |= 1; + gActiveScriptInfo.unk_00 &= ~tmp; + gActiveScriptInfo.flags |= 1; } } -void sub_0807E6DC(Entity* unk1, ScriptExecutionContext* unk2) { +void ScriptCommand_WaitPlayerAction8(Entity* entity, ScriptExecutionContext* context) { if (gPlayerEntity.action == 8) { - gUnk_02033280.unk_06 = 0; + gActiveScriptInfo.commandSize = 0; } else { - unk2->unk_10 = 0x2D; + context->wait = 0x2D; } } -void sub_0807E700(Entity* unk1, ScriptExecutionContext* unk2) { +void ScriptCommand_WaitForPlayerAction0x17(Entity* entity, ScriptExecutionContext* context) { if (gPlayerEntity.action != 0x17) { - gUnk_02033280.unk_07 |= 1; + gActiveScriptInfo.flags |= 1; } else { - gUnk_02033280.unk_06 = 0; + gActiveScriptInfo.commandSize = 0; } } -void sub_0807E72C(Entity* unk1, ScriptExecutionContext* unk2) { +void ScriptCommand_WaitFor_1(Entity* entity, ScriptExecutionContext* context) { if (gRoomControls.unk6 & 4) { - gUnk_02033280.unk_06 = 0; + gActiveScriptInfo.commandSize = 0; } else { - gUnk_02033280.unk_07 |= 1; + gActiveScriptInfo.flags |= 1; } } -void sub_0807E75C(Entity* unk1, ScriptExecutionContext* unk2) { +void ScriptCommand_WaitFor_2(Entity* entity, ScriptExecutionContext* context) { if (gFadeControl.active) { - gUnk_02033280.unk_06 = 0; + gActiveScriptInfo.commandSize = 0; } } -void sub_0807E778(Entity* unk1, ScriptExecutionContext* unk2) { - gUnk_02033280.unk_08 = unk2->unk_00[1]; +void ScriptCommand_0807E778(Entity* entity, ScriptExecutionContext* context) { + gActiveScriptInfo.unk_08 = context->scriptInstructionPointer[1]; } -void sub_0807E788(Entity* unk1, ScriptExecutionContext* unk2) { - gFadeControl.field_0x4 = GetNextScriptCommandWordAfterCommandMetadata(unk2->unk_00); +void ScriptCommand_0807E788(Entity* entity, ScriptExecutionContext* context) { + gFadeControl.field_0x4 = GetNextScriptCommandWordAfterCommandMetadata(context->scriptInstructionPointer); } -void sub_0807E79C(Entity* unk1, ScriptExecutionContext* unk2) { - sub_080500F4(gUnk_02033280.unk_08); +void ScriptCommand_0807E79C(Entity* entity, ScriptExecutionContext* context) { + sub_080500F4(gActiveScriptInfo.unk_08); } -void nullsub_508(Entity* unk1, ScriptExecutionContext* unk2) { +void ScriptCommandNop2(Entity* entity, ScriptExecutionContext* context) { } -void sub_0807E7B0(Entity* unk1, ScriptExecutionContext* unk2) { - DoFade(4, gUnk_02033280.unk_08); +void ScriptCommand_DoFade4(Entity* entity, ScriptExecutionContext* context) { + DoFade(4, gActiveScriptInfo.unk_08); } -void sub_0807E7C4(Entity* unk1, ScriptExecutionContext* unk2) { - DoFade(5, gUnk_02033280.unk_08); +void ScriptCommand_DoFade5(Entity* entity, ScriptExecutionContext* context) { + DoFade(5, gActiveScriptInfo.unk_08); } -void sub_0807E7D8(Entity* unk1, ScriptExecutionContext* unk2) { - DoFade(6, gUnk_02033280.unk_08); +void ScriptCommand_DoFade6(Entity* entity, ScriptExecutionContext* context) { + DoFade(6, gActiveScriptInfo.unk_08); } -void sub_0807E7EC(Entity* unk1, ScriptExecutionContext* unk2) { - DoFade(7, gUnk_02033280.unk_08); +void ScriptCommand_DoFade7(Entity* entity, ScriptExecutionContext* context) { + DoFade(7, gActiveScriptInfo.unk_08); } -void sub_0807E800(Entity* unk1, ScriptExecutionContext* unk2) { +void ScriptCommand_0807E800(Entity* entity, ScriptExecutionContext* context) { sub_0807E818(0x10); } -void sub_0807E80C(Entity* unk1, ScriptExecutionContext* unk2) { +void ScriptCommand_0807E80C(Entity* entity, ScriptExecutionContext* context) { sub_0807E818(0x11); } void sub_0807E818(u32 unk1) { - Entity* tmp = gRoomControls.cameraTarget; - u32 tmp2, tmp3; - if (tmp) { - tmp2 = tmp->x.HALF.HI - gRoomControls.roomScrollX; - tmp3 = tmp->y.HALF.HI - gRoomControls.roomScrollY; + Entity* cameraTarget = gRoomControls.cameraTarget; + u32 x, y; + if (cameraTarget) { + x = cameraTarget->x.HALF.HI - gRoomControls.roomScrollX; + y = cameraTarget->y.HALF.HI - gRoomControls.roomScrollY; } else { - tmp2 = 0x78; - tmp3 = 0x50; + x = 0x78; + y = 0x50; } - sub_08050110(tmp2, tmp3, unk1, gUnk_02033280.unk_08); + sub_08050110(x, y, unk1, gActiveScriptInfo.unk_08); } -void sub_0807E858(Entity* unk1, ScriptExecutionContext* unk2) { - sub_08050038(unk2->unk_00[1]); +void ScriptCommand_0807E858(Entity* entity, ScriptExecutionContext* context) { + sub_08050038(context->scriptInstructionPointer[1]); } -void sub_0807E864(Entity* unk1, ScriptExecutionContext* unk2) { +void ScriptCommand_0807E864(Entity* entity, ScriptExecutionContext* context) { gPlayerState.field_0x8b = 3; sub_08078B48(); } -void sub_0807E878(Entity* unk1, ScriptExecutionContext* unk2) { +void ScriptCommand_0807E878(Entity* entity, ScriptExecutionContext* context) { gPlayerState.field_0x8b = 1; } -void sub_0807E888(Entity* unk1, ScriptExecutionContext* unk2) { +void ScriptCommand_0807E888(Entity* entity, ScriptExecutionContext* context) { gPlayerState.field_0x8b = 3; } -void sub_0807E898(Entity* unk1, ScriptExecutionContext* unk2) { - u32 tmp = GetNextScriptCommandWordAfterCommandMetadata(unk2->unk_00); +void ScriptCommand_SetPlayerAction(Entity* entity, ScriptExecutionContext* context) { + u32 tmp = GetNextScriptCommandWordAfterCommandMetadata(context->scriptInstructionPointer); gPlayerState.playerAction = tmp; gPlayerState.field_0x38 = tmp >> 8; gPlayerState.field_0x39 = tmp >> 0x10; gPlayerState.field_0x3a = tmp >> 0x18; } -void sub_0807E8C4(Entity* unk1, ScriptExecutionContext* unk2) { - StartPlayerScript((u16*)GetNextScriptCommandWordAfterCommandMetadata(unk2->unk_00)); +void ScriptCommand_StartPlayerScript(Entity* entity, ScriptExecutionContext* context) { + StartPlayerScript((u16*)GetNextScriptCommandWordAfterCommandMetadata(context->scriptInstructionPointer)); } -void sub_0807E8D4(Entity* unk1, ScriptExecutionContext* unk2) { - gPlayerState.field_0x8 = unk2->unk_00[1]; +void ScriptCommand_0807E8D4(Entity* entity, ScriptExecutionContext* context) { + gPlayerState.field_0x8 = context->scriptInstructionPointer[1]; } -void sub_0807E8E4(Entity* unk1, ScriptExecutionContext* unk2) { +void ScriptCommand_0807E8E4(Entity* entity, ScriptExecutionContext* context) { u32 tmp = (gUnk_08016984 & 0x3FF); u32 tmp2; - gPlayerEntity.animationState = tmp2 = (unk2->unk_00[0] - tmp) << 1; + gPlayerEntity.animationState = tmp2 = (context->scriptInstructionPointer[0] - tmp) << 1; } -void sub_0807E908(Entity* unk1, ScriptExecutionContext* unk2) { - unk1->action = unk2->unk_00[1]; - unk1->previousActionFlag = 0; +void ScriptCommand_0807E908(Entity* entity, ScriptExecutionContext* context) { + entity->action = context->scriptInstructionPointer[1]; + entity->subAction = 0; } -void sub_0807E914(Entity* unk1, ScriptExecutionContext* unk2) { - unk2->unk_04 = GetNextScriptCommandWordAfterCommandMetadata(unk2->unk_00); +void ScriptCommand_SetIntVariable(Entity* entity, ScriptExecutionContext* context) { + context->intVariable = GetNextScriptCommandWordAfterCommandMetadata(context->scriptInstructionPointer); } -void sub_0807E924(Entity* unk1, ScriptExecutionContext* unk2) { - unk2->unk_04 = unk1->frames.all; - unk1->frames.all = 0; +void ScriptCommand_0807E924(Entity* entity, ScriptExecutionContext* context) { + context->intVariable = entity->frames.all; + entity->frames.all = 0; } -void sub_0807E930(Entity* unk1, ScriptExecutionContext* unk2) { - unk1->field_0x80.HWORD = unk2->unk_00[1]; - InitAnimationForceUpdate(unk1, unk2->unk_00[1]); +void ScriptCommand_0807E930(Entity* entity, ScriptExecutionContext* context) { + entity->field_0x80.HWORD = context->scriptInstructionPointer[1]; + InitAnimationForceUpdate(entity, context->scriptInstructionPointer[1]); } -void sub_0807E944(Entity* unk1, ScriptExecutionContext* unk2) { - if (unk1->interactType) { - unk1->interactType = 0; - gUnk_02033280.unk_07 |= 1; +void ScriptCommand_0807E944(Entity* entity, ScriptExecutionContext* context) { + if (entity->interactType) { + entity->interactType = 0; + gActiveScriptInfo.flags |= 1; } else { - gUnk_02033280.unk_06 = 0; + gActiveScriptInfo.commandSize = 0; } } -void sub_0807E974(Entity* unk1, ScriptExecutionContext* unk2) { - switch (unk2->unk_18) { +void ScriptCommand_0807E974(Entity* entity, ScriptExecutionContext* context) { + switch (context->unk_18) { default: - if (!--unk2->unk_19) + if (!--context->unk_19) return; break; case 0: - if (!unk1->interactType) + if (!entity->interactType) break; - unk1->interactType = 0; - unk2->unk_18++; - TextboxNoOverlapFollow(unk2->unk_00[1]); + entity->interactType = 0; + context->unk_18++; + TextboxNoOverlapFollow(context->scriptInstructionPointer[1]); break; case 1: if (gTextBox.doTextBox & 0x7F) break; - unk2->unk_18 = 2; - unk2->unk_19 = 0xF; + context->unk_18 = 2; + context->unk_19 = 0xF; break; } - gUnk_02033280.unk_06 = 0; + gActiveScriptInfo.commandSize = 0; } -void sub_0807E9D4(Entity* unk1, ScriptExecutionContext* unk2) { - sub_08078778(unk1); +void ScriptCommand_0807E9D4(Entity* entity, ScriptExecutionContext* context) { + sub_08078778(entity); } -void sub_0807E9DC(Entity* unk1, ScriptExecutionContext* unk2) { - sub_080788E0(unk1); +void ScriptCommand_0807E9DC(Entity* entity, ScriptExecutionContext* context) { + sub_080788E0(entity); } -void sub_0807E9E4(Entity* unk1, ScriptExecutionContext* unk2) { - sub_08078784(unk1, unk2->unk_00[1]); +void ScriptCommand_0807E9E4(Entity* entity, ScriptExecutionContext* context) { + sub_08078784(entity, context->scriptInstructionPointer[1]); } -void sub_0807E9F0(Entity* unk1, ScriptExecutionContext* unk2) { +void ScriptCommand_0807E9F0(Entity* entity, ScriptExecutionContext* context) { u32 tmp; sub_0801E00C(); tmp = 1; @@ -1033,10 +1157,10 @@ void sub_0807E9F0(Entity* unk1, ScriptExecutionContext* unk2) { case 2: gPlayerState.field_0x8b = 3; gUnk_02034490[0] = tmp; - unk2->unk_14 = tmp; + context->condition = tmp; break; case 1: - unk2->unk_14 = 0; + context->condition = 0; break; default: goto lbl; @@ -1046,351 +1170,356 @@ void sub_0807E9F0(Entity* unk1, ScriptExecutionContext* unk2) { gPlayerState.field_0x8b = 1; } else { lbl: - gUnk_02033280.unk_06 = 0; + gActiveScriptInfo.commandSize = 0; } } -void sub_0807EA4C(Entity* unk1, ScriptExecutionContext* unk2) { - if (unk1->interactType == 2) { - sub_0801DFB4(unk1, 0, 0, 0); - unk1->interactType = 0; - gUnk_02033280.unk_07 |= 1; +void ScriptCommand_0807EA4C(Entity* entity, ScriptExecutionContext* context) { + if (entity->interactType == 2) { + sub_0801DFB4(entity, 0, 0, 0); + entity->interactType = 0; + gActiveScriptInfo.flags |= 1; } else { - gUnk_02033280.unk_06 = 0; + gActiveScriptInfo.commandSize = 0; } } -void sub_0807EA88(Entity* unk1, ScriptExecutionContext* unk2) { - sub_08078790(unk1, unk2->unk_00[1]); +void ScriptCommand_0807EA88(Entity* entity, ScriptExecutionContext* context) { + sub_08078790(entity, context->scriptInstructionPointer[1]); } -void sub_0807EA94(Entity* unk1, ScriptExecutionContext* unk2) { +void ScriptCommand_0807EA94(Entity* entity, ScriptExecutionContext* context) { if (gTextBox.doTextBox & 0x7F) { - gUnk_02033280.unk_06 = 0; + gActiveScriptInfo.commandSize = 0; } } -void sub_0807EAB4(Entity* unk1, ScriptExecutionContext* unk2) { - TextboxNoOverlapFollow(unk2->unk_00[1]); +void ScriptCommand_TextboxNoOverlapFollow(Entity* entity, ScriptExecutionContext* context) { + TextboxNoOverlapFollow(context->scriptInstructionPointer[1]); } -void sub_0807EAC0(Entity* unk1, ScriptExecutionContext* unk2) { - TextboxNoOverlap(unk2->unk_00[1], unk1); +void ScriptCommand_TextboxNoOverlap(Entity* entity, ScriptExecutionContext* context) { + TextboxNoOverlap(context->scriptInstructionPointer[1], entity); } -void sub_0807EAD0(Entity* unk1, ScriptExecutionContext* unk2) { - TextboxNoOverlapFollow(unk2->unk_00[1]); +void ScriptCommand_TextboxNoOverlapFollowPos(Entity* entity, ScriptExecutionContext* context) { + TextboxNoOverlapFollow(context->scriptInstructionPointer[1]); gTextBox.textWindowPosX = 1; - gTextBox.textWindowPosY = unk2->unk_00[2]; + gTextBox.textWindowPosY = context->scriptInstructionPointer[2]; } -void sub_0807EAF0(Entity* unk1, ScriptExecutionContext* unk2) { - if (gUnk_02033280.unk_06 > unk2->unk_04) { - u16* tmp = unk2->unk_00 + unk2->unk_04; +void ScriptCommand_TextboxNoOverlapFollowTable(Entity* entity, ScriptExecutionContext* context) { + if (gActiveScriptInfo.commandSize > context->intVariable) { + u16* tmp = context->scriptInstructionPointer + context->intVariable; TextboxNoOverlapFollow(tmp[1]); } else { TextboxNoOverlapFollow(0); } } -void sub_0807EB18(Entity* unk1, ScriptExecutionContext* unk2) { - TextboxNoOverlap(unk2->unk_04, unk1); +void ScriptCommand_TextboxNoOverlapVar(Entity* entity, ScriptExecutionContext* context) { + TextboxNoOverlap(context->intVariable, entity); } -void sub_0807EB28(Entity* unk1, ScriptExecutionContext* unk2) { - sub_08078AA8(unk2->unk_00[1], 0); +void ScriptCommand_0807EB28(Entity* entity, ScriptExecutionContext* context) { + sub_08078AA8(context->scriptInstructionPointer[1], 0); } -void sub_0807EB38(Entity* unk1, ScriptExecutionContext* unk2) { - unk2->unk_04 = gUnk_02000040.unk_01; +void ScriptCommand_0807EB38(Entity* entity, ScriptExecutionContext* context) { + context->intVariable = gUnk_02000040.unk_01; } -void sub_0807EB44(Entity* unk1, ScriptExecutionContext* unk2) { - unk1->animationState = unk2->unk_00[1]; +void ScriptCommand_0807EB44(Entity* entity, ScriptExecutionContext* context) { + entity->animationState = context->scriptInstructionPointer[1]; } -void sub_0807EB4C(Entity* unk1, ScriptExecutionContext* unk2) { - unk1->animationState = sub_0806F5B0( - sub_080045B4(unk1, unk2->unk_00[1] + gRoomControls.roomOriginX, unk2->unk_00[2] + gRoomControls.roomOriginY)); +void ScriptCommand_0807EB4C(Entity* entity, ScriptExecutionContext* context) { + entity->animationState = + sub_0806F5B0(sub_080045B4(entity, context->scriptInstructionPointer[1] + gRoomControls.roomOriginX, + context->scriptInstructionPointer[2] + gRoomControls.roomOriginY)); } -void sub_0807EB74(Entity* unk1, ScriptExecutionContext* unk2) { - unk1->animationState = sub_0806F5B0(GetFacingDirection(unk1, &gPlayerEntity)); +void ScriptCommand_0807EB74(Entity* entity, ScriptExecutionContext* context) { + entity->animationState = sub_0806F5B0(GetFacingDirection(entity, &gPlayerEntity)); } -void sub_0807EB8C(Entity* unk1, ScriptExecutionContext* unk2) { - gPlayerEntity.animationState = sub_0806F5B0(GetFacingDirection(&gPlayerEntity, unk1)) & ~1; +void ScriptCommand_0807EB8C(Entity* entity, ScriptExecutionContext* context) { + gPlayerEntity.animationState = sub_0806F5B0(GetFacingDirection(&gPlayerEntity, entity)) & ~1; } -void sub_0807EBA8(Entity* unk1, ScriptExecutionContext* unk2) { - unk1->direction = unk2->unk_00[1]; +void ScriptCommand_SetEntityDirection(Entity* entity, ScriptExecutionContext* context) { + entity->direction = context->scriptInstructionPointer[1]; } -void sub_0807EBB0(Entity* unk1, ScriptExecutionContext* unk2) { - unk1->direction = unk2->unk_00[1]; - unk1->animationState = unk1->direction / 4; +void ScriptCommand_SetEntityDirectionWithAnimationState(Entity* entity, ScriptExecutionContext* context) { + entity->direction = context->scriptInstructionPointer[1]; + entity->animationState = entity->direction / 4; } -void sub_0807EBC0(Entity* unk1, ScriptExecutionContext* unk2) { - unk1->nonPlanarMovement = unk2->unk_00[1]; +void ScriptCommand_SetEntitySpeed(Entity* entity, ScriptExecutionContext* context) { + entity->speed = context->scriptInstructionPointer[1]; } -void sub_0807EBC8(Entity* unk1, ScriptExecutionContext* unk2) { - unk1->field_0x20 = GetNextScriptCommandWordAfterCommandMetadata(unk2->unk_00); +void ScriptCommand_SetEntity0x20(Entity* entity, ScriptExecutionContext* context) { + entity->field_0x20 = GetNextScriptCommandWordAfterCommandMetadata(context->scriptInstructionPointer); } -void sub_0807EBD8(Entity* unk1, ScriptExecutionContext* unk2) { - unk1->x.HALF.HI = gRoomControls.roomOriginX + unk2->unk_00[1]; - unk1->y.HALF.HI = gRoomControls.roomOriginY + unk2->unk_00[2]; +void ScriptCommand_SetEntityPositionRelative(Entity* entity, ScriptExecutionContext* context) { + entity->x.HALF.HI = gRoomControls.roomOriginX + context->scriptInstructionPointer[1]; + entity->y.HALF.HI = gRoomControls.roomOriginY + context->scriptInstructionPointer[2]; } -void sub_0807EBF4(Entity* unk1, ScriptExecutionContext* unk2) { - unk1->x.HALF.HI += unk2->unk_00[1]; - unk1->y.HALF.HI += unk2->unk_00[2]; +void ScriptCommand_SetEntityPosition(Entity* entity, ScriptExecutionContext* context) { + entity->x.HALF.HI += context->scriptInstructionPointer[1]; + entity->y.HALF.HI += context->scriptInstructionPointer[2]; } -void sub_0807EC08(Entity* unk1, ScriptExecutionContext* unk2) { - CopyPosition(&gPlayerEntity, unk1); +void ScriptCommand_MoveEntityToPlayer(Entity* entity, ScriptExecutionContext* context) { + CopyPosition(&gPlayerEntity, entity); } -void nullsub_509(Entity* unk1, ScriptExecutionContext* unk2) { +void ScriptCommandNop3(Entity* entity, ScriptExecutionContext* context) { } -void sub_0807EC1C(Entity* unk1, ScriptExecutionContext* unk2) { - if (!unk2->unk_18) { - unk2->unk_18 = 1; - unk2->unk_12 = unk2->unk_00[1]; - unk2->unk_08 |= 2; +void ScriptCommand_0807EC1C(Entity* entity, ScriptExecutionContext* context) { + if (!context->unk_18) { + context->unk_18 = 1; + context->unk_12 = context->scriptInstructionPointer[1]; + context->postScriptActions |= 2; } - sub_0807EC44(unk1, unk2); + sub_0807EC44(entity, context); } -void sub_0807EC44(Entity* unk1, ScriptExecutionContext* unk2) { - sub_0806F69C(unk1); - if (--unk2->unk_12) { - gUnk_02033280.unk_06 = 0; +void sub_0807EC44(Entity* entity, ScriptExecutionContext* context) { + sub_0806F69C(entity); + if (--context->unk_12) { + gActiveScriptInfo.commandSize = 0; } } -void sub_0807EC64(Entity* unk1, ScriptExecutionContext* unk2) { - if (!unk2->unk_18) { - unk2->unk_18 = 1; - unk2->unk_12 = unk2->unk_00[1]; - unk1->animationState = 0; - unk1->direction = 0; - unk2->unk_08 |= 2; +void ScriptCommand_0807EC64(Entity* entity, ScriptExecutionContext* context) { + if (!context->unk_18) { + context->unk_18 = 1; + context->unk_12 = context->scriptInstructionPointer[1]; + entity->animationState = 0; + entity->direction = 0; + context->postScriptActions |= 2; } - sub_0807EC44(unk1, unk2); + sub_0807EC44(entity, context); } -void sub_0807EC94(Entity* unk1, ScriptExecutionContext* unk2) { - if (!unk2->unk_18) { - unk2->unk_18 = 1; - unk2->unk_12 = unk2->unk_00[1]; - unk1->animationState = 2; - unk1->direction = 8; - unk2->unk_08 |= 2; +void ScriptCommand_0807EC94(Entity* entity, ScriptExecutionContext* context) { + if (!context->unk_18) { + context->unk_18 = 1; + context->unk_12 = context->scriptInstructionPointer[1]; + entity->animationState = 2; + entity->direction = 8; + context->postScriptActions |= 2; } - sub_0807EC44(unk1, unk2); + sub_0807EC44(entity, context); } -void sub_0807ECC4(Entity* unk1, ScriptExecutionContext* unk2) { - if (!unk2->unk_18) { - unk2->unk_18 = 1; - unk2->unk_12 = unk2->unk_00[1]; - unk1->animationState = 4; - unk1->direction = 0x10; - unk2->unk_08 |= 2; +void ScriptCommand_0807ECC4(Entity* entity, ScriptExecutionContext* context) { + if (!context->unk_18) { + context->unk_18 = 1; + context->unk_12 = context->scriptInstructionPointer[1]; + entity->animationState = 4; + entity->direction = 0x10; + context->postScriptActions |= 2; } - sub_0807EC44(unk1, unk2); + sub_0807EC44(entity, context); } -void sub_0807ECF4(Entity* unk1, ScriptExecutionContext* unk2) { - if (!unk2->unk_18) { - unk2->unk_18 = 1; - unk2->unk_12 = unk2->unk_00[1]; - unk1->animationState = 6; - unk1->direction = 0x18; - unk2->unk_08 |= 2; +void ScriptCommand_0807ECF4(Entity* entity, ScriptExecutionContext* context) { + if (!context->unk_18) { + context->unk_18 = 1; + context->unk_12 = context->scriptInstructionPointer[1]; + entity->animationState = 6; + entity->direction = 0x18; + context->postScriptActions |= 2; } - sub_0807EC44(unk1, unk2); + sub_0807EC44(entity, context); } -void sub_0807ED24(Entity* unk1, ScriptExecutionContext* unk2) { - if (!unk2->unk_18) { +void ScriptCommand_0807ED24(Entity* entity, ScriptExecutionContext* context) { + if (!context->unk_18) { s32 tmp, tmp2, tmp3; - unk2->unk_18 = 1; - unk2->unk_12 = unk2->unk_00[3]; - tmp = unk2->unk_00[1]; - tmp2 = unk1->x.HALF.HI - gRoomControls.roomOriginX; - unk2->unk_1C.WORD = ((tmp - tmp2) << 0x10) / unk2->unk_12; - tmp = unk2->unk_00[2]; - tmp3 = unk1->y.HALF.HI - gRoomControls.roomOriginY; - unk2->unk_20.WORD = ((tmp - tmp3) << 0x10) / unk2->unk_12; - unk1->animationState = sub_0806F5B0(sub_080045B4(unk1, unk2->unk_00[1] + gRoomControls.roomOriginX, - unk2->unk_00[2] + gRoomControls.roomOriginY)); - unk2->unk_08 |= 2; + context->unk_18 = 1; + context->unk_12 = context->scriptInstructionPointer[3]; + tmp = context->scriptInstructionPointer[1]; + tmp2 = entity->x.HALF.HI - gRoomControls.roomOriginX; + context->x.WORD = ((tmp - tmp2) << 0x10) / context->unk_12; + tmp = context->scriptInstructionPointer[2]; + tmp3 = entity->y.HALF.HI - gRoomControls.roomOriginY; + context->y.WORD = ((tmp - tmp3) << 0x10) / context->unk_12; + entity->animationState = + sub_0806F5B0(sub_080045B4(entity, context->scriptInstructionPointer[1] + gRoomControls.roomOriginX, + context->scriptInstructionPointer[2] + gRoomControls.roomOriginY)); + context->postScriptActions |= 2; } else { - if (!--unk2->unk_12) { - unk1->x.HALF.HI = unk2->unk_00[1] + gRoomControls.roomOriginX; - unk1->y.HALF.HI = unk2->unk_00[2] + gRoomControls.roomOriginY; + if (!--context->unk_12) { + entity->x.HALF.HI = context->scriptInstructionPointer[1] + gRoomControls.roomOriginX; + entity->y.HALF.HI = context->scriptInstructionPointer[2] + gRoomControls.roomOriginY; return; } - unk1->x.WORD += unk2->unk_1C.WORD; - unk1->y.WORD += unk2->unk_20.WORD; + entity->x.WORD += context->x.WORD; + entity->y.WORD += context->y.WORD; } - gUnk_02033280.unk_06 = 0; + gActiveScriptInfo.commandSize = 0; } -void sub_0807EDD4(Entity* unk1, ScriptExecutionContext* unk2) { - if (!unk2->unk_18) { - unk2->unk_18 = 1; - sub_0807EE04(unk1, unk2); +void ScriptCommand_0807EDD4(Entity* entity, ScriptExecutionContext* context) { + if (!context->unk_18) { + context->unk_18 = 1; + ScriptCommand_0807EE04(entity, context); } - sub_0807EE30(unk1, unk2); - if (!unk2->unk_14) { - gUnk_02033280.unk_06 = 0; + ScriptCommand_0807EE30(entity, context); + if (!context->condition) { + gActiveScriptInfo.commandSize = 0; } } -void sub_0807EE04(Entity* unk1, ScriptExecutionContext* unk2) { - sub_0807DEDC(unk1, unk2, unk2->unk_00[1] + gRoomControls.roomOriginX, unk2->unk_00[2] + gRoomControls.roomOriginY); - gUnk_02033280.unk_07 |= 1; +void ScriptCommand_0807EE04(Entity* entity, ScriptExecutionContext* context) { + sub_0807DEDC(entity, context, context->scriptInstructionPointer[1] + gRoomControls.roomOriginX, + context->scriptInstructionPointer[2] + gRoomControls.roomOriginY); + gActiveScriptInfo.flags |= 1; } -void sub_0807EE30(Entity* unk1, ScriptExecutionContext* unk2) { +void ScriptCommand_0807EE30(Entity* entity, ScriptExecutionContext* context) { s32 tmp, tmp2; - if (!--unk2->unk_19) { - unk2->unk_19 = 8; - unk1->direction = sub_080045DA(unk2->unk_1C.HALF.HI - unk1->x.HALF.HI, unk2->unk_20.HALF.HI - unk1->y.HALF.HI); + if (!--context->unk_19) { + context->unk_19 = 8; + entity->direction = + sub_080045DA(context->x.HALF.HI - entity->x.HALF.HI, context->y.HALF.HI - entity->y.HALF.HI); } - tmp = unk1->x.HALF.HI - unk2->unk_1C.HALF.HI; - tmp2 = unk1->y.HALF.HI - unk2->unk_20.HALF.HI; - sub_0806F62C(unk1, unk1->nonPlanarMovement, unk1->direction); - tmp *= unk1->x.HALF.HI - unk2->unk_1C.HALF.HI; - tmp2 *= unk1->y.HALF.HI - unk2->unk_20.HALF.HI; + tmp = entity->x.HALF.HI - context->x.HALF.HI; + tmp2 = entity->y.HALF.HI - context->y.HALF.HI; + sub_0806F62C(entity, entity->speed, entity->direction); + tmp *= entity->x.HALF.HI - context->x.HALF.HI; + tmp2 *= entity->y.HALF.HI - context->y.HALF.HI; if (tmp <= 0 && tmp2 <= 0) { - unk1->x.HALF.HI = unk2->unk_1C.HALF.HI; - unk1->y.HALF.HI = unk2->unk_20.HALF.HI; - unk2->unk_14 = 1; + entity->x.HALF.HI = context->x.HALF.HI; + entity->y.HALF.HI = context->y.HALF.HI; + context->condition = 1; } else { - unk2->unk_14 = 0; + context->condition = 0; } } -void sub_0807EEB4(Entity* unk1, ScriptExecutionContext* unk2) { - if (!unk2->unk_18) { - unk2->unk_18 = 1; - sub_0807DEDC(unk1, unk2, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI); +void ScriptCommand_0807EEB4(Entity* entity, ScriptExecutionContext* context) { + if (!context->unk_18) { + context->unk_18 = 1; + sub_0807DEDC(entity, context, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI); } - sub_0807EE30(unk1, unk2); - if (!unk2->unk_14) { - gUnk_02033280.unk_06 = 0; + ScriptCommand_0807EE30(entity, context); + if (!context->condition) { + gActiveScriptInfo.commandSize = 0; } } -void sub_0807EEF4(Entity* unk1, ScriptExecutionContext* unk2) { - if (!unk2->unk_18) { - unk2->unk_18 = 1; - sub_0807DEDC(unk1, unk2, unk1->x.HALF.HI + ((s16)unk2->unk_00[1]), unk1->y.HALF.HI + ((s16)unk2->unk_00[2])); +void ScriptCommand_0807EEF4(Entity* entity, ScriptExecutionContext* context) { + if (!context->unk_18) { + context->unk_18 = 1; + sub_0807DEDC(entity, context, entity->x.HALF.HI + ((s16)context->scriptInstructionPointer[1]), + entity->y.HALF.HI + ((s16)context->scriptInstructionPointer[2])); } - sub_0807EE30(unk1, unk2); - if (!unk2->unk_14) { - gUnk_02033280.unk_06 = 0; + ScriptCommand_0807EE30(entity, context); + if (!context->condition) { + gActiveScriptInfo.commandSize = 0; } } -void sub_0807EF3C(Entity* unk1, ScriptExecutionContext* unk2) { - if (!unk2->unk_18) { - unk2->unk_18 = 1; - unk1->field_0x20 = ((s16)unk2->unk_00[1]) << 8; - unk2->unk_1C.HALF.LO = unk2->unk_00[2] << 8; - sub_08003FC4(unk1, (u16)unk2->unk_1C.HALF.LO); +void ScriptCommand_0807EF3C(Entity* entity, ScriptExecutionContext* context) { + if (!context->unk_18) { + context->unk_18 = 1; + entity->field_0x20 = ((s16)context->scriptInstructionPointer[1]) << 8; + context->x.HALF.LO = context->scriptInstructionPointer[2] << 8; + sub_08003FC4(entity, (u16)context->x.HALF.LO); } else { - if (!sub_08003FC4(unk1, (u16)unk2->unk_1C.HALF.LO)) + if (!sub_08003FC4(entity, (u16)context->x.HALF.LO)) return; } - gUnk_02033280.unk_06 = 0; + gActiveScriptInfo.commandSize = 0; } -void sub_0807EF80(Entity* unk1, ScriptExecutionContext* unk2) { - unk2->unk_08 |= 1 << unk2->unk_00[1]; +void ScriptCommand_DoPostScriptAction(Entity* entity, ScriptExecutionContext* context) { + context->postScriptActions |= 1 << context->scriptInstructionPointer[1]; } -void sub_0807EF90(Entity* unk1, ScriptExecutionContext* unk2) { - unk2->unk_08 |= 1 << unk2->unk_00[1]; +void ScriptCommand_DoPostScriptAction2(Entity* entity, ScriptExecutionContext* context) { + context->postScriptActions |= 1 << context->scriptInstructionPointer[1]; } -void sub_0807EFA0(Entity* unk1, ScriptExecutionContext* unk2) { - SoundReq(unk2->unk_00[1]); +void ScriptCommand_SoundReq(Entity* entity, ScriptExecutionContext* context) { + SoundReq(context->scriptInstructionPointer[1]); } -void sub_0807EFAC(Entity* unk1, ScriptExecutionContext* unk2) { - if (unk2->unk_00[1] >= 100) { +void ScriptCommand_SoundReq2(Entity* entity, ScriptExecutionContext* context) { + if (context->scriptInstructionPointer[1] >= 100) { SoundReq(gArea.musicIndex); } else { - SoundReq(unk2->unk_00[1]); + SoundReq(context->scriptInstructionPointer[1]); } } -void sub_0807EFD4(Entity* unk1, ScriptExecutionContext* unk2) { - SoundReq(GetNextScriptCommandWordAfterCommandMetadata(unk2->unk_00)); +void ScriptCommand_SoundReq3(Entity* entity, ScriptExecutionContext* context) { + SoundReq(GetNextScriptCommandWordAfterCommandMetadata(context->scriptInstructionPointer)); } -void sub_0807EFE4(Entity* unk1, ScriptExecutionContext* unk2) { +void ScriptCommand_SoundReq0x80100000(Entity* entity, ScriptExecutionContext* context) { SoundReq(SONG_RESET_UNK); } -void sub_0807EFF4(Entity* unk1, ScriptExecutionContext* unk2) { - ModRupees((s16)unk2->unk_00[1]); +void ScriptCommand_ModRupees(Entity* entity, ScriptExecutionContext* context) { + ModRupees((s16)context->scriptInstructionPointer[1]); } -void sub_0807F004(Entity* unk1, ScriptExecutionContext* unk2) { - ModHealth(unk2->unk_00[1]); +void ScriptCommand_ModHealth(Entity* entity, ScriptExecutionContext* context) { + ModHealth(context->scriptInstructionPointer[1]); } -void sub_0807F010(Entity* unk1, ScriptExecutionContext* unk2) { +void ScriptCommand_IncreaseMaxHealth(Entity* entity, ScriptExecutionContext* context) { gSave.stats.maxHealth = min(gSave.stats.maxHealth + 8, 0xA0); gSave.stats.health = gSave.stats.maxHealth; } -void sub_0807F034(Entity* unk1, ScriptExecutionContext* unk2) { +void ScriptCommand_0807F034(Entity* entity, ScriptExecutionContext* context) { u32 tmp = 0; - if (unk2->unk_00[1] == 0x3F) { - tmp = unk2->unk_04; + if (context->scriptInstructionPointer[1] == 0x3F) { + tmp = context->intVariable; } - sub_080A7C18(unk2->unk_00[1], tmp, 0); + sub_080A7C18(context->scriptInstructionPointer[1], tmp, 0); } -void sub_0807F050(Entity* unk1, ScriptExecutionContext* unk2) { - sub_080A7C18(0x5C, unk2->unk_00[1], 0); +void ScriptCommand_0807F050(Entity* entity, ScriptExecutionContext* context) { + sub_080A7C18(0x5C, context->scriptInstructionPointer[1], 0); } -void sub_0807F060(Entity* unk1, ScriptExecutionContext* unk2) { - unk2->unk_04 = GetInventoryValue(unk2->unk_00[1]); - unk2->unk_14 = unk2->unk_04 != 0; +void ScriptCommand_GetInventoryValue(Entity* entity, ScriptExecutionContext* context) { + context->intVariable = GetInventoryValue(context->scriptInstructionPointer[1]); + context->condition = context->intVariable != 0; } -void sub_0807F078(Entity* unk1, ScriptExecutionContext* unk2) { - sub_0807CAA0(unk2->unk_00[1], unk2->unk_00[2]); +void ScriptCommand_0807F078(Entity* entity, ScriptExecutionContext* context) { + sub_0807CAA0(context->scriptInstructionPointer[1], context->scriptInstructionPointer[2]); } -void sub_0807F088(Entity* unk1, ScriptExecutionContext* unk2) { - sub_080A7C18(unk2->unk_00[1], 0, 3); +void ScriptCommand_0807F088(Entity* entity, ScriptExecutionContext* context) { + sub_080A7C18(context->scriptInstructionPointer[1], 0, 3); } -void sub_0807F098(Entity* unk1, ScriptExecutionContext* unk2) { - gRoomControls.cameraTarget = unk1; +void ScriptCommand_CameraTargetEntity(Entity* entity, ScriptExecutionContext* context) { + gRoomControls.cameraTarget = entity; } -void sub_0807F0A4(Entity* unk1, ScriptExecutionContext* unk2) { +void ScriptCommand_CameraTargetPlayer(Entity* entity, ScriptExecutionContext* context) { gRoomControls.cameraTarget = &gPlayerEntity; } -void sub_0807F0B4(Entity* unk1, ScriptExecutionContext* unk2) { - gRoomControls.unk5 = unk2->unk_00[1] & 7; +void ScriptCommand_0807F0B4(Entity* entity, ScriptExecutionContext* context) { + gRoomControls.unk5 = context->scriptInstructionPointer[1] & 7; } -void sub_0807F0C8(Entity* unk1, ScriptExecutionContext* unk2) { - sub_08080964(unk2->unk_00[1], unk2->unk_00[2]); +void ScriptCommand_0807F0C8(Entity* entity, ScriptExecutionContext* context) { + sub_08080964(context->scriptInstructionPointer[1], context->scriptInstructionPointer[2]); } diff --git a/src/sub_0801D754.c b/src/sub_0801D754.c deleted file mode 100644 index 8b1b2b20..00000000 --- a/src/sub_0801D754.c +++ /dev/null @@ -1,17 +0,0 @@ -#include "global.h" - -extern const u8 gUnk_020176E0[]; - -extern void sub_0807C960(); -extern void LoadPalettes(const u8*, int, int); - -void sub_0807C9D8(u32* a1) { - u32* v1; // r5@1 - - v1 = a1; - sub_0807C960(0x6004000, *a1); - sub_0807C960(0x6000000, v1[1]); - sub_0807C960(0x6008000, v1[2]); - sub_0807C960(gUnk_020176E0, v1[3]); - LoadPalettes(gUnk_020176E0, 2, 13); -} diff --git a/src/sub_0804AFF4.c b/src/sub_0804AFF4.c deleted file mode 100644 index a7108fd6..00000000 --- a/src/sub_0804AFF4.c +++ /dev/null @@ -1,43 +0,0 @@ -#include "global.h" - -extern void sub_080186EC(); -extern u32* GetCurrentRoomProperty(u8); -extern u32 _call_via_r0(u32*); -extern void sub_0804B16C(); - -void sub_0804AFF4(void) { - u32* func; - - sub_080186EC(); - func = GetCurrentRoomProperty(5); - if (func != NULL) { - _call_via_r0(func); - } - func = GetCurrentRoomProperty(7); - if (func != NULL) { - _call_via_r0(func); - } - sub_0804B16C(); - return; -} - -/* - thumb_func_start sub_0804AFF4 -sub_0804AFF4: @ 0x0804AFF4 - push {lr} - bl sub_080186EC - movs r0, #5 - bl GetCurrentRoomProperty - cmp r0, #0 - beq _0804B008 - bl _call_via_r0 -_0804B008: - movs r0, #7 - bl GetCurrentRoomProperty - cmp r0, #0 - beq _0804B016 - bl _call_via_r0 -_0804B016: - bl sub_0804B16C - pop {pc} - */ diff --git a/src/sub_08050008.c b/src/sub_08050008.c index 4fe0e197..df79883a 100644 --- a/src/sub_08050008.c +++ b/src/sub_08050008.c @@ -1,16 +1,10 @@ #include "global.h" +#include "utils.h" +#include "structures.h" extern u32 gUnk_020354C0; -extern s32 gFadeControl; -extern void MemClear32(u32, u32, u32); -void sub_08050008(u32 param_1, u32 param_2, u32 param_3) { - s32* unk; - - MemClear32((u32)&gUnk_020354C0, 128, param_3); - - unk = &gFadeControl; - *(unk + 1) = -1; - - return; +void sub_08050008() { + MemClear(&gUnk_020354C0, 128); + gFadeControl.field_0x4 = -1; } diff --git a/src/sub_08055E08.c b/src/sub_08055E08.c index 40c1f812..1b97f26f 100644 --- a/src/sub_08055E08.c +++ b/src/sub_08055E08.c @@ -3,7 +3,6 @@ #include "room.h" #include "functions.h" -extern u32* _call_via_r0(u32* func); extern void (*const gUnk_080FF420[])(); extern void sub_0804B0B0(u32, u32); extern void sub_08055B70(u32, u32, u32, u32); diff --git a/src/sub_0805E374.c b/src/sub_0805E374.c index 5767e6da..e035ce07 100644 --- a/src/sub_0805E374.c +++ b/src/sub_0805E374.c @@ -1,10 +1,12 @@ #include "entity.h" +#include "structures.h" + extern Entity* sub_0805E3A0(Entity*, u32); -extern u8 gScreenTransition[]; extern u8 gUnk_081091F8[]; extern u8 gUnk_081091EE[]; + Entity* sub_0805E374(Entity* param_1) { - u8 r3 = gScreenTransition[0x2C]; + u8 r3 = gScreenTransition.field_0x24[8]; u8* array = gUnk_081091F8; if (r3 != '\x02') { diff --git a/src/sub_0806F9EC.c b/src/sub_0806F9EC.c deleted file mode 100644 index 9f029530..00000000 --- a/src/sub_0806F9EC.c +++ /dev/null @@ -1,13 +0,0 @@ -#include "global.h" - -s32 sub_0806F9EC(s16 param_1, s16 param_2) - -{ - int iVar1; - - iVar1 = (s32)param_1 * (s32)param_2; - if (iVar1 < 0) { - iVar1 = iVar1 + 255; - } - return (iVar1 << 8) >> 16; -} diff --git a/src/sub_0806FA04.c b/src/sub_0806FA04.c deleted file mode 100644 index a7eb191a..00000000 --- a/src/sub_0806FA04.c +++ /dev/null @@ -1,18 +0,0 @@ -#include "global.h" - -extern s32 __divsi3(s32, s32); - -s16 sub_0806FA04(s16 param_1, s16 param_2) - -{ - s16 sVar1; - s32 iVar2; - - if (param_2 != 0) { - sVar1 = __divsi3((param_1 << 16) >> 8, param_2); - iVar2 = sVar1; - } else { - iVar2 = 0; - } - return iVar2; -} diff --git a/src/sub_0806FA24.c b/src/sub_0806FA24.c deleted file mode 100644 index de614717..00000000 --- a/src/sub_0806FA24.c +++ /dev/null @@ -1,10 +0,0 @@ - -#include "global.h" -#include "entity.h" -void PositionRelative(Entity*, Entity*, s32, s32); - -void CopyPosition(Entity* param_1, Entity* param_2) - -{ - PositionRelative(param_1, param_2, 0, 0); -} diff --git a/src/sub_0807B7D8.c b/src/sub_0807B7D8.c deleted file mode 100644 index 7ef8b080..00000000 --- a/src/sub_0807B7D8.c +++ /dev/null @@ -1,21 +0,0 @@ -#include "global.h" - -extern void sub_08000152(u32); -extern void sub_0807B778(u32, u32); -extern void SetTileType(u32, u32, u32); - -void sub_0807B7D8(u32 param_1, u32 param_2, u32 param_3) - -{ - if (param_1 == 53) { - sub_08000152(53); - sub_0807B778(param_2, param_3); - sub_0807B778(param_2 + 1, param_3); - sub_0807B778(param_2 + -1, param_3); - sub_0807B778(param_2 + 64, param_3); - sub_0807B778(param_2 + -64, param_3); - } else { - SetTileType(param_1, param_2, param_3); - } - return; -} diff --git a/src/sub_0807B820.c b/src/sub_0807B820.c index b8ae309d..fabdc8d9 100644 --- a/src/sub_0807B820.c +++ b/src/sub_0807B820.c @@ -1,10 +1,23 @@ #include "global.h" +#include "functions.h" -extern void SetTileType(u32, u32, u32); +extern void sub_08000152(u32); +extern void sub_0807B778(u32, u32); -void sub_0807B820(u32 param_1) +void sub_0807B7D8(u32 param_1, u32 param_2, u32 param_3) { + if (param_1 == 53) { + sub_08000152(53); + sub_0807B778(param_2, param_3); + sub_0807B778(param_2 + 1, param_3); + sub_0807B778(param_2 + -1, param_3); + sub_0807B778(param_2 + 64, param_3); + sub_0807B778(param_2 + -64, param_3); + } else { + SetTileType(param_1, param_2, param_3); + } +} -{ +void sub_0807B820(u32 param_1) { SetTileType(620, param_1 + -65, 1); SetTileType(627, param_1 + -65, 2); SetTileType(621, param_1 + -64, 1); @@ -14,5 +27,28 @@ void sub_0807B820(u32 param_1) SetTileType(623, param_1 + -1, 1); SetTileType(624, param_1, 1); SetTileType(626, param_1 + 1, 1); - return; +} + +void sub_0807B8A8(u32 param_1) { + SetTileType(636, param_1 + -65, 1); + SetTileType(643, param_1 + -65, 2); + SetTileType(637, param_1 + -64, 1); + SetTileType(644, param_1 + -64, 2); + SetTileType(638, param_1 + -63, 1); + SetTileType(645, param_1 + -63, 2); + SetTileType(639, param_1 + -1, 1); + SetTileType(640, param_1, 1); + SetTileType(642, param_1 + 1, 1); +} + +void sub_0807B930(int param_1) { + SetTileType(652, param_1 + -65, 1); + SetTileType(659, param_1 + -65, 2); + SetTileType(653, param_1 + -64, 1); + SetTileType(660, param_1 + -64, 2); + SetTileType(654, param_1 + -63, 1); + SetTileType(661, param_1 + -63, 2); + SetTileType(655, param_1 + -1, 1); + SetTileType(656, param_1, 1); + SetTileType(658, param_1 + 1, 1); } diff --git a/src/sub_0807B8A8.c b/src/sub_0807B8A8.c deleted file mode 100644 index 5c008ad2..00000000 --- a/src/sub_0807B8A8.c +++ /dev/null @@ -1,18 +0,0 @@ -#include "global.h" - -extern void SetTileType(u32, u32, u32); - -void sub_0807B8A8(u32 param_1) - -{ - SetTileType(636, param_1 + -65, 1); - SetTileType(643, param_1 + -65, 2); - SetTileType(637, param_1 + -64, 1); - SetTileType(644, param_1 + -64, 2); - SetTileType(638, param_1 + -63, 1); - SetTileType(645, param_1 + -63, 2); - SetTileType(639, param_1 + -1, 1); - SetTileType(640, param_1, 1); - SetTileType(642, param_1 + 1, 1); - return; -} diff --git a/src/sub_0807B930.c b/src/sub_0807B930.c deleted file mode 100644 index aae0472c..00000000 --- a/src/sub_0807B930.c +++ /dev/null @@ -1,18 +0,0 @@ -#include "global.h" - -extern void SetTileType(u32, u32, u32); - -void sub_0807B930(int param_1) - -{ - SetTileType(652, param_1 + -65, 1); - SetTileType(659, param_1 + -65, 2); - SetTileType(653, param_1 + -64, 1); - SetTileType(660, param_1 + -64, 2); - SetTileType(654, param_1 + -63, 1); - SetTileType(661, param_1 + -63, 2); - SetTileType(655, param_1 + -1, 1); - SetTileType(656, param_1, 1); - SetTileType(658, param_1 + 1, 1); - return; -} diff --git a/src/sub_0807C998.c b/src/sub_0807C998.c index 7c2afd37..7f3a05c9 100644 --- a/src/sub_0807C998.c +++ b/src/sub_0807C998.c @@ -1,11 +1,14 @@ #include "global.h" -#include "entity.h" extern void sub_0807C960(); +extern void LoadPalettes(const u8*, s32, s32); + extern u16 gMetatilesBottom[]; extern u16 gMetatilesTop[]; extern u8 gUnk_08324AE4; +extern const u8 gUnk_020176E0[]; + void sub_0807C960(void* dest, u32 offset) { void* src; @@ -25,3 +28,14 @@ void sub_0807C998(u32* a1) { sub_0807C960(gMetatilesTop, a1[2]); sub_0807C960(gMetatilesTop - 0x1000, a1[3]); } + +void sub_0807C9D8(u32* a1) { + u32* v1; // r5@1 + + v1 = a1; + sub_0807C960((u8*)0x6004000, *a1); + sub_0807C960((u8*)0x6000000, v1[1]); + sub_0807C960((u8*)0x6008000, v1[2]); + sub_0807C960((u8*)gUnk_020176E0, v1[3]); + LoadPalettes(gUnk_020176E0, 2, 13); +} diff --git a/src/textbox.c b/src/textbox.c index ee31f8fc..6a9cf031 100644 --- a/src/textbox.c +++ b/src/textbox.c @@ -2,6 +2,7 @@ #include "audio.h" #include "room.h" #include "entity.h" +#include "utils.h" #include "functions.h" #include "textbox.h" #include "structures.h" @@ -14,11 +15,14 @@ u32 sub_080565B4(void); u32 sub_080565F8(void); u32 sub_08056640(void); -u32 (*const gUnk_08107BC8[])(void) = { sub_080564DC, sub_080564EC, sub_08056654, - sub_080565B4, sub_080565F8, sub_08056640 }; +u32 (*const gUnk_08107BC8[])(void) = { + sub_080564DC, sub_080564EC, sub_08056654, sub_080565B4, sub_080565F8, sub_08056640, +}; extern u8 gUnk_020227DC, gUnk_020227E8, gUnk_020227F0, gUnk_020227F8, gUnk_02022800; -u8* const gUnk_08107BE0[] = { &gUnk_020227DC, &gUnk_020227E8, &gUnk_020227F0, &gUnk_020227F8, &gUnk_02022800 }; +u8* const gUnk_08107BE0[] = { + &gUnk_020227DC, &gUnk_020227E8, &gUnk_020227F0, &gUnk_020227F8, &gUnk_02022800, +}; void sub_08056684(struct_02022780*); void sub_080566B8(struct_02022780*); @@ -27,8 +31,9 @@ void sub_08056B1C(struct_02022780*); void sub_08056B7C(struct_02022780*); void sub_080569D4(struct_02022780*); -void (*const gUnk_08107BF4[])(struct_02022780*) = { sub_08056684, sub_080566B8, sub_08056BA0, - sub_08056B1C, sub_08056B7C, sub_080569D4 }; +void (*const gUnk_08107BF4[])(struct_02022780*) = { + sub_08056684, sub_080566B8, sub_08056BA0, sub_08056B1C, sub_08056B7C, sub_080569D4, +}; extern u32 gUnk_02036A40; extern u32 gUnk_02036A38; @@ -84,7 +89,7 @@ void TextboxAtPosition(u32 index, u32 x, u32 y) { } void ShowTextbox(u32 index) { - MemClear32(&gTextBox, 32); + MemClear(&gTextBox, 32); gTextBox.textIndex = index; gTextBox.textSpeed = 99; gTextBox.textWindowWidth = 26; @@ -95,18 +100,18 @@ void ShowTextbox(u32 index) { } void MessageInitialize(void) { - MemClear32(&gTextBox, 32); - MemClear32(&gUnk_02022780, 168); - MemClear32(&gUnk_02036A40, 8); - MemClear32(&gUnk_02036A38, 8); - MemClear32(&gUnk_02000040, 4); + MemClear(&gTextBox, 32); + MemClear(&gUnk_02022780, 168); + MemClear(&gUnk_02036A40, 8); + MemClear(&gUnk_02036A38, 8); + MemClear(&gUnk_02000040, 4); } void MessageUpdate(void) { int iVar1; if (gTextBox.doTextBox == 1) { - MemClear32((u32*)&gUnk_02022780, sizeof(gUnk_02022780)); + MemClear((u32*)&gUnk_02022780, sizeof(gUnk_02022780)); sub_080564C8(1); } @@ -142,9 +147,9 @@ NONMATCH("asm/non_matching/textbox/sub_080564EC.inc", u32 sub_080564EC(void)) { u32 i; char c; - MemClear32((void*)&gUnk_02036A40, 8); - MemClear32((void*)&gUnk_02024030, 0x18); - MemClear32((void*)&gUnk_02022780, 0xa8); + MemClear((void*)&gUnk_02036A40, 8); + MemClear((void*)&gUnk_02024030, 0x18); + MemClear((void*)&gUnk_02022780, 0xa8); MemCopy(&gTextBox, &gUnk_02022780, 32); if (gUnk_02022780._2 == 0x63) { gUnk_02022780._2 = gUnk_02000000->messageSpeed; diff --git a/src/utils.c b/src/utils.c new file mode 100644 index 00000000..b88fb9cd --- /dev/null +++ b/src/utils.c @@ -0,0 +1,204 @@ +#include "global.h" +#include "utils.h" +#include "structures.h" +#include "screen.h" + +static void StoreKeyInput(Input* input, u32 keyInput); + +typedef struct { + u16 paletteId; + u8 destPaletteNum; + u8 numPalettes; +} PaletteGroup; + +typedef struct { + union { + int raw; + struct { + u8 filler0[0x3]; + u8 unk3; + } bytes; + } unk0; + u32 dest; + u32 unk8; +} GfxItem; + +extern const PaletteGroup* gPaletteGroups[]; +extern const u8 gGlobalGfxAndPalettes[]; +extern u32 gUsedPalettes; +extern u16 gPaletteBuffer[]; +extern const GfxItem* gUnk_08100AA8[]; + +void MemFill16(u32 value, void* dest, u32 size) { + DmaFill16(3, value, dest, size); +} + +void MemFill32(u32 value, void* dest, u32 size) { + DmaFill32(3, value, dest, size); +} + +void MemClear(void* dest, u32 size) { + u32 zero = 0; + + switch (((u32)dest | size) & 3) { + case 0: + MemFill32(0, dest, size); + break; + case 2: + MemFill16(0, dest, size); + break; + default: + do { + *(u8*)dest = zero; + dest++; + size--; + } while (size != 0); + } +} + +void MemCopy(const void* src, void* dest, u32 size) { + switch (((u32)src | (u32)dest | size) & 3) { + case 0: + DmaCopy32(3, src, dest, size); + break; + case 2: + DmaCopy16(3, src, dest, size); + break; + default: + do { + *(u8*)dest = *(u8*)src; + src++; + dest++; + } while (--size); + } +} + +void ReadKeyInput(void) { + u32 keyInput = ~REG_KEYINPUT & KEYS_MASK; + StoreKeyInput(&gInput, keyInput); +} + +static void StoreKeyInput(Input* input, u32 keyInput) { + u32 heldKeys = input->heldKeys; + u32 difference = keyInput & ~heldKeys; + input->newKeys = difference; + if (keyInput == heldKeys) { + if (--input->unk7 == 0) { + input->unk7 = 4; + input->unk4 = keyInput; + } else { + input->unk4 = 0; + } + } else { + input->unk7 = 0x14; + input->unk4 = difference; + } + input->heldKeys = keyInput; +} + +void LoadPaletteGroup(u32 group) { + const PaletteGroup* paletteGroup = gPaletteGroups[group]; + while (1) { + u32 destPaletteNum = paletteGroup->destPaletteNum; + u32 numPalettes = paletteGroup->numPalettes & 0xF; + if (numPalettes == 0) { + numPalettes = 16; + } + LoadPalettes(&gGlobalGfxAndPalettes[paletteGroup->paletteId * 32], destPaletteNum, numPalettes); + if ((paletteGroup->numPalettes & 0x80) == 0) { + break; + } + paletteGroup++; + } +} + +void LoadPalettes(const u8* src, int destPaletteNum, int numPalettes) { + u16* dest; + u32 size = numPalettes * 32; + u32 usedPalettesMask = 1 << destPaletteNum; + while (--numPalettes > 0) { + usedPalettesMask |= (usedPalettesMask << 1); + } + gUsedPalettes |= usedPalettesMask; + dest = &gPaletteBuffer[destPaletteNum * 16]; + DmaCopy32(3, src, dest, size); +} + +void sub_0801D79C(u32 colorIndex, u32 color) { + gPaletteBuffer[colorIndex] = color; + gUsedPalettes |= 1 << (colorIndex / 16); +} + +void sub_0801D7BC(u32 color, u32 arg1) { + if (arg1) { + gScreen.lcd.unk6 = 0xE0FF; + } else { + gScreen.lcd.unk6 = 0xFFFF; + } + sub_0801D79C(0, color); +} + +void LoadGfxGroup(u32 group) { + u32 terminator; + u32 dmaCtrl; + int gfxOffset; + const u8* src; + u32 dest; + int size; + const GfxItem* gfxItem = gUnk_08100AA8[group]; + while (1) { + u32 loadGfx = FALSE; + u32 ctrl = gfxItem->unk0.bytes.unk3; + ctrl &= 0xF; + switch (ctrl) { + case 0x7: + loadGfx = TRUE; + break; + case 0xD: + return; + case 0xE: + if (gUnk_02000000->gameLanguage != 0 && gUnk_02000000->gameLanguage != 1) { + loadGfx = TRUE; + } + break; + case 0xF: + if (gUnk_02000000->gameLanguage != 0) { + loadGfx = TRUE; + } + break; + default: + if (ctrl == gUnk_02000000->gameLanguage) { + loadGfx = TRUE; + } + break; + } + + if (loadGfx) { + gfxOffset = gfxItem->unk0.raw & 0xFFFFFF; + src = &gGlobalGfxAndPalettes[gfxOffset]; + dest = gfxItem->dest; + size = gfxItem->unk8; + dmaCtrl = 0x80000000; + if (size < 0) { + if (dest >= VRAM) { + LZ77UnCompVram(src, (void*)dest); + } else { + LZ77UnCompWram(src, (void*)dest); + } + } else { + DmaSet(3, src, dest, dmaCtrl | ((u32)size >> 1)); + } + } + + terminator = gfxItem->unk0.bytes.unk3; + terminator &= 0x80; + gfxItem++; + if (!terminator) { + break; + } + } +} + +/* TODO: + clear OAM, zMalloc, etc. +*/