decompile overworld

This commit is contained in:
DizzyEggg 2018-02-14 00:58:22 +01:00
parent f22be4d010
commit 94b47c0686
71 changed files with 2501 additions and 4689 deletions

View File

@ -6481,7 +6481,7 @@ _0819218E:
mov r0, r9
cmp r0, 0
bne _081921C4
ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music
ldr r0, =CB2_ReturnToFieldContinueScript
bl SetMainCallback2
b _081921FC
.pool
@ -9539,7 +9539,7 @@ _08193B84:
ldr r0, [r4]
bl Free
str r6, [r4]
ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music
ldr r0, =CB2_ReturnToFieldContinueScript
bl SetMainCallback2
ldr r1, =gTasks
lsls r0, r5, 2
@ -11320,7 +11320,7 @@ _08194B24:
ands r0, r1
cmp r0, 0
bne _08194B3C
ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music
ldr r0, =CB2_ReturnToFieldContinueScript
bl SetMainCallback2
adds r0, r4, 0
bl DestroyTask

View File

@ -855,7 +855,7 @@ sub_813C664: @ 813C664
ands r0, r1
cmp r0, 0
bne _0813C694
ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music
ldr r0, =CB2_ReturnToFieldContinueScript
bl SetMainCallback2
ldr r0, =gUnknown_0203AB78
ldr r0, [r0]

View File

@ -3172,7 +3172,7 @@ _08163A3C:
_08163A74:
bl sub_816537C
_08163A78:
ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music
ldr r0, =CB2_ReturnToFieldContinueScript
bl SetMainCallback2
add sp, 0x4
pop {r4-r6}

View File

@ -777,7 +777,7 @@ _08150340:
bl warp_in
ldr r0, =gFieldCallback
str r4, [r0]
ldr r0, =c2_load_new_map
ldr r0, =CB2_LoadMap
bl SetMainCallback2
add sp, 0x8
pop {r3}

View File

@ -736,7 +736,7 @@ _080B2984:
.pool
_080B2994:
bl GetLinkPlayerCount_2
ldr r4, =gUnknown_03005DB8
ldr r4, =gFieldLinkPlayerCount
strb r0, [r4]
bl GetMultiplayerId
ldr r1, =gUnknown_03005DB4
@ -826,7 +826,7 @@ _080B2A4E:
.pool
_080B2A6C:
bl GetLinkPlayerCount_2
ldr r4, =gUnknown_03005DB8
ldr r4, =gFieldLinkPlayerCount
strb r0, [r4]
bl GetMultiplayerId
ldr r1, =gUnknown_03005DB4
@ -2132,12 +2132,12 @@ _080B35E0:
ldrb r0, [r0]
cmp r0, 0
bne _080B35FE
ldr r0, =c2_exit_to_overworld_2_switch
ldr r0, =CB2_ReturnToField
bl SetMainCallback2
b _080B35FE
.pool
_080B35F8:
ldr r0, =c2_exit_to_overworld_2_switch
ldr r0, =CB2_ReturnToField
bl SetMainCallback2
_080B35FE:
bl RunTasks
@ -2586,7 +2586,7 @@ sp02A_crash_sound: @ 80B39BC
push {lr}
ldr r0, =gSpecialVar_0x8006
ldrb r0, [r0]
ldr r1, =c2_exit_to_overworld_1_continue_scripts_restart_music
ldr r1, =CB2_ReturnToFieldContinueScript
bl sub_80C4E74
pop {r0}
bx r0

View File

@ -5588,7 +5588,7 @@ sub_80DA830: @ 80DA830
bl FreeAllWindowBuffers
bl sub_80D7A5C
bl FreeMonSpritesGfx
ldr r0, =c2_exit_to_overworld_2_switch
ldr r0, =CB2_ReturnToField
bl SetMainCallback2
_080DA860:
pop {r0}

View File

@ -1825,7 +1825,7 @@ _080F6884:
adds r0, r5, 0
bl DestroyTask
bl FreeAllWindowBuffers
ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music
ldr r0, =CB2_ReturnToFieldContinueScript
bl SetMainCallback2
bl sub_80F7E64
_080F68A8:

View File

@ -5,8 +5,8 @@
.text
thumb_func_start sub_809BEDC
sub_809BEDC: @ 809BEDC
thumb_func_start FieldClearPlayerInput
FieldClearPlayerInput: @ 809BEDC
push {r4,r5,lr}
movs r1, 0x2
negs r1, r1
@ -29,11 +29,11 @@ sub_809BEDC: @ 809BEDC
pop {r4,r5}
pop {r0}
bx r0
thumb_func_end sub_809BEDC
thumb_func_end FieldClearPlayerInput
thumb_func_start process_overworld_input
@ void process_overworld_input(overworld_input_data *input_data, char buttons_new, char buttons_held)
process_overworld_input: @ 809BF08
thumb_func_start FieldGetPlayerInput
@ void FieldGetPlayerInput(overworld_input_data *input_data, char buttons_new, char buttons_held)
FieldGetPlayerInput: @ 809BF08
push {r4-r7,lr}
mov r7, r9
mov r6, r8
@ -176,7 +176,7 @@ _0809C006:
pop {r4-r7}
pop {r0}
bx r0
thumb_func_end process_overworld_input
thumb_func_end FieldGetPlayerInput
thumb_func_start sub_809C014
@ int sub_809C014(overworld_input_data *input_data)

View File

@ -1943,7 +1943,7 @@ _080B69D4:
thumb_func_start sub_80B69DC
sub_80B69DC: @ 80B69DC
push {lr}
ldr r0, =c2_exit_to_overworld_2_switch
ldr r0, =CB2_ReturnToField
bl SetMainCallback2
ldr r1, =gFieldCallback
ldr r0, =mapldr_080842E8
@ -2010,7 +2010,7 @@ _080B6A64:
bne _080B6A8A
bl Overworld_ResetStateAfterFly
bl warp_in
ldr r0, =c2_load_new_map
ldr r0, =CB2_LoadMap
bl SetMainCallback2
ldr r1, =gFieldCallback
ldr r0, =mapldr_08084390
@ -2764,7 +2764,7 @@ sub_80B7060: @ 80B7060
ldr r1, =gFieldCallback
ldr r0, =sub_80B70B4
str r0, [r1]
ldr r0, =c2_load_new_map
ldr r0, =CB2_LoadMap
bl SetMainCallback2
ldr r0, =sub_80B6E88
bl FindTaskIdByFunc
@ -3730,7 +3730,7 @@ sub_80B7814: @ 80B7814
ldr r1, =gFieldCallback
ldr r0, =mapldr_080851BC
str r0, [r1]
ldr r0, =c2_load_new_map
ldr r0, =CB2_LoadMap
bl SetMainCallback2
ldr r0, =sub_80B75F0
bl FindTaskIdByFunc
@ -4205,7 +4205,7 @@ sub_80B7BF4: @ 80B7BF4
ldr r1, =gFieldCallback
ldr r0, =sub_80B6B68
str r0, [r1]
ldr r0, =c2_load_new_map
ldr r0, =CB2_LoadMap
bl SetMainCallback2
ldr r0, =sub_80B7A8C
bl FindTaskIdByFunc
@ -4402,7 +4402,7 @@ _080B7D86:
ldr r1, =gFieldCallback
ldr r0, =mapldr_080859D4
str r0, [r1]
ldr r0, =c2_load_new_map
ldr r0, =CB2_LoadMap
bl SetMainCallback2
ldr r0, =sub_80B7CE4
bl FindTaskIdByFunc
@ -4883,7 +4883,7 @@ _080B81B8:
bne _080B81E6
bl Overworld_SetWarpDestToLastHealLoc
bl warp_in
ldr r0, =c2_load_new_map
ldr r0, =CB2_LoadMap
bl SetMainCallback2
ldr r1, =gFieldCallback
ldr r0, =mapldr_08085D88

View File

@ -9015,7 +9015,7 @@ _080AF9D0:
cmp r0, 0
bne _080AF9E8
bl warp_in
ldr r0, =c2_load_new_map
ldr r0, =CB2_LoadMap
bl SetMainCallback2
adds r0, r5, 0
bl DestroyTask
@ -9087,7 +9087,7 @@ _080AFA64:
b _080AFA7C
_080AFA6C:
bl warp_in
ldr r0, =c2_load_new_map
ldr r0, =CB2_LoadMap
bl SetMainCallback2
adds r0, r6, 0
bl DestroyTask
@ -10060,7 +10060,7 @@ _080B0222:
b _080B023A
_080B022A:
bl warp_in
ldr r0, =c2_load_new_map
ldr r0, =CB2_LoadMap
bl SetMainCallback2
adds r0, r5, 0
bl DestroyTask

View File

@ -20,7 +20,7 @@ Special_ShowDiploma: @ 8137CB4
Special_ViewWallClock: @ 8137CC8
push {lr}
ldr r0, =gMain
ldr r1, =c2_exit_to_overworld_2_switch
ldr r1, =CB2_ReturnToField
str r1, [r0, 0x8]
ldr r0, =Cb2_ViewWallClock
bl SetMainCallback2
@ -1906,7 +1906,7 @@ _08138C7E:
thumb_func_start CB2_FieldShowRegionMap
CB2_FieldShowRegionMap: @ 8138C84
push {lr}
ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music
ldr r0, =CB2_ReturnToFieldContinueScript
bl sub_817018C
pop {r0}
bx r0
@ -7153,14 +7153,14 @@ sub_813B7D8: @ 813B7D8
ldrh r0, [r0]
cmp r0, 0
bne _0813B7F8
ldr r2, =c2_exit_to_overworld_1_continue_scripts_restart_music
ldr r2, =CB2_ReturnToFieldContinueScript
movs r0, 0
movs r1, 0x1
bl DoRayquazaScene
b _0813B802
.pool
_0813B7F8:
ldr r2, =c2_exit_to_overworld_1_continue_scripts_restart_music
ldr r2, =CB2_ReturnToFieldContinueScript
movs r0, 0x1
movs r1, 0
bl DoRayquazaScene

View File

@ -88,7 +88,7 @@ sub_809D908: @ 809D908
bl sub_809D8B8
adds r0, r4, 0x2
adds r1, r4, 0x4
bl wild_encounter_related
bl UpdateAmbientCry
_0809D930:
pop {r4}
pop {r0}
@ -96,8 +96,8 @@ _0809D930:
.pool
thumb_func_end sub_809D908
thumb_func_start overworld_ensure_per_step_coros_running
overworld_ensure_per_step_coros_running: @ 809D93C
thumb_func_start SetUpFieldTasks
SetUpFieldTasks: @ 809D93C
push {r4,r5,lr}
ldr r5, =task_per_step_callback_manager
adds r0, r5, 0
@ -142,7 +142,7 @@ _0809D992:
pop {r0}
bx r0
.pool
thumb_func_end overworld_ensure_per_step_coros_running
thumb_func_end SetUpFieldTasks
thumb_func_start ActivatePerStepCallback
ActivatePerStepCallback: @ 809D9A8

View File

@ -31,7 +31,7 @@ ResetBagScrollPositions: @ 81AAB70
@ void CB2_BagMenuFromStartMenu()
CB2_BagMenuFromStartMenu: @ 81AAB9C
push {lr}
ldr r2, =sub_8086194
ldr r2, =CB2_ReturnToFieldWithOpenMenu
movs r0, 0
movs r1, 0x5
bl GoToBagMenu
@ -5747,7 +5747,7 @@ bag_menu_leave_maybe_3: @ 81ADE6C
ldr r0, =gFieldCallback
ldr r1, =sub_819FA50
str r1, [r0]
ldr r0, =c2_exit_to_overworld_2_switch
ldr r0, =CB2_ReturnToField
bl SetMainCallback2
pop {r0}
bx r0
@ -5782,7 +5782,7 @@ bag_menu_leave_maybe_2: @ 81ADEBC
ldr r0, =gFieldCallback
ldr r1, =sub_818DEF4
str r1, [r0]
ldr r0, =c2_exit_to_overworld_2_switch
ldr r0, =CB2_ReturnToField
bl SetMainCallback2
pop {r0}
bx r0
@ -5813,7 +5813,7 @@ bag_menu_leave_maybe: @ 81ADF00
ldr r0, =gFieldCallback
ldr r1, =sub_818E564
str r1, [r0]
ldr r0, =c2_exit_to_overworld_2_switch
ldr r0, =CB2_ReturnToField
bl SetMainCallback2
pop {r0}
bx r0

View File

@ -713,7 +713,7 @@ _08160CD8:
b _08160E8A
_08160CE6:
bl sub_8160EA0
ldr r0, =c2_exit_to_overworld_2_switch
ldr r0, =CB2_ReturnToField
bl SetMainCallback2
b _08160E8A
.pool

View File

@ -1480,7 +1480,7 @@ _08030444:
strh r1, [r0]
ldr r0, =gPlttBufferFaded
strh r1, [r0]
ldr r0, =sub_8086230
ldr r0, =CB2_ContinueSavedGame
b _0803048A
.pool
_08030460:

File diff suppressed because it is too large Load Diff

View File

@ -10083,7 +10083,7 @@ _081B5614:
.pool
_081B5624:
ldr r1, =gUnknown_0203CEC8
ldr r0, =c2_exit_to_overworld_2_switch
ldr r0, =CB2_ReturnToField
_081B5628:
str r0, [r1]
adds r0, r6, 0
@ -10189,7 +10189,7 @@ _081B56F8:
b _081B572A
_081B56FE:
ldr r1, =gUnknown_0203CEC8
ldr r0, =c2_exit_to_overworld_2_switch
ldr r0, =CB2_ReturnToField
str r0, [r1]
adds r0, r4, 0
bl sub_81B12C0
@ -10408,7 +10408,7 @@ sub_81B58A8: @ 81B58A8
str r0, [sp]
ldr r0, =sub_81B1370
str r0, [sp, 0x4]
ldr r0, =sub_8086194
ldr r0, =CB2_ReturnToFieldWithOpenMenu
str r0, [sp, 0x8]
movs r0, 0
movs r1, 0
@ -14836,7 +14836,7 @@ CB2_PartyMenuFromStartMenu: @ 81B7F34
str r0, [sp]
ldr r0, =sub_81B1370
str r0, [sp, 0x4]
ldr r0, =sub_8086194
ldr r0, =CB2_ReturnToFieldWithOpenMenu
str r0, [sp, 0x8]
movs r0, 0
movs r1, 0
@ -16021,7 +16021,7 @@ sub_81B892C: @ 81B892C
str r0, [sp]
ldr r0, =sub_81B1370
str r0, [sp, 0x4]
ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music
ldr r0, =CB2_ReturnToFieldContinueScript
str r0, [sp, 0x8]
movs r0, 0
movs r1, 0
@ -16042,7 +16042,7 @@ sub_81B8958: @ 81B8958
str r0, [sp]
ldr r0, =sub_81B1370
str r0, [sp, 0x4]
ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music
ldr r0, =CB2_ReturnToFieldContinueScript
str r0, [sp, 0x8]
movs r0, 0xB
movs r1, 0
@ -17283,7 +17283,7 @@ sub_81B9354: @ 81B9354
str r1, [sp]
ldr r1, =sub_81B1370
str r1, [sp, 0x4]
ldr r1, =c2_exit_to_overworld_2_switch
ldr r1, =CB2_ReturnToField
str r1, [sp, 0x8]
movs r1, 0
movs r2, 0xB
@ -17311,7 +17311,7 @@ _081B93A6:
ldr r0, =gUnknown_03005DB0
ldr r1, =hm_add_c3_without_phase_2
str r1, [r0]
ldr r0, =c2_exit_to_overworld_2_switch
ldr r0, =CB2_ReturnToField
bl SetMainCallback2
pop {r4}
pop {r0}
@ -17420,7 +17420,7 @@ _081B9486:
ldr r1, =gUnknown_03005DB0
ldr r0, =hm_add_c3_without_phase_2
str r0, [r1]
ldr r0, =c2_exit_to_overworld_2_switch
ldr r0, =CB2_ReturnToField
bl SetMainCallback2
pop {r0}
bx r0
@ -17556,7 +17556,7 @@ _081B95BA:
ldr r0, =gUnknown_03005DB0
ldr r1, =hm_add_c3_without_phase_2
str r1, [r0]
ldr r0, =c2_exit_to_overworld_2_switch
ldr r0, =CB2_ReturnToField
bl SetMainCallback2
pop {r4,r5}
pop {r0}
@ -17660,7 +17660,7 @@ sub_81B968C: @ 81B968C
subs r3, 0x1
lsls r3, 24
lsrs r3, 24
ldr r0, =c2_exit_to_overworld_2_switch
ldr r0, =CB2_ReturnToField
str r0, [sp]
movs r0, 0x3
bl sub_81BF8EC

View File

@ -586,7 +586,7 @@ sub_816B31C: @ 816B31C
ldr r0, =gFieldCallback
ldr r1, =mapldr_080EBC0C
str r1, [r0]
ldr r0, =c2_exit_to_overworld_2_switch
ldr r0, =CB2_ReturnToField
bl SetMainCallback2
pop {r0}
bx r0
@ -1279,7 +1279,7 @@ sub_816B900: @ 816B900
ldr r0, =gFieldCallback
ldr r1, =pal_fill_for_maplights_or_black
str r1, [r0]
ldr r0, =c2_exit_to_overworld_2_switch
ldr r0, =CB2_ReturnToField
bl SetMainCallback2
pop {r0}
bx r0
@ -1538,7 +1538,7 @@ sub_816BB28: @ 816BB28
ldr r0, =gFieldCallback
ldr r1, =sub_816BB48
str r1, [r0]
ldr r0, =c2_exit_to_overworld_2_switch
ldr r0, =CB2_ReturnToField
bl SetMainCallback2
pop {r0}
bx r0

View File

@ -1244,7 +1244,7 @@ _080BBE18:
bl sub_80BC890
adds r0, r6, 0
bl DestroyTask
ldr r0, =sub_8086194
ldr r0, =CB2_ReturnToFieldWithOpenMenu
bl SetMainCallback2
ldr r0, =gMPlayInfo_BGM
ldr r1, =0x0000ffff

View File

@ -657,7 +657,7 @@ sub_80C7678: @ 80C7678
ldr r1, =gFieldCallback
ldr r0, =mapldr_0808C6D8
str r0, [r1]
ldr r0, =c2_exit_to_overworld_2_switch
ldr r0, =CB2_ReturnToField
bl SetMainCallback2
pop {r0}
bx r0

View File

@ -2024,7 +2024,7 @@ sub_81C4EEC: @ 81C4EEC
thumb_func_start sub_81C4EFC
sub_81C4EFC: @ 81C4EFC
push {lr}
ldr r1, =sub_8086194
ldr r1, =CB2_ReturnToFieldWithOpenMenu
movs r0, 0
bl sub_81C4F98
pop {r0}
@ -2073,7 +2073,7 @@ sub_81C4F44: @ 81C4F44
ldr r0, =gUnknown_03005DB0
ldr r1, =hm_add_c3_without_phase_2
str r1, [r0]
ldr r1, =c2_exit_to_overworld_2_switch
ldr r1, =CB2_ReturnToField
movs r0, 0x3
bl sub_81C4F98
adds r0, r4, 0

View File

@ -14,7 +14,7 @@ CB2_PokeNav: @ 81C7250
str r0, [r4]
cmp r0, 0
bne _081C7270
ldr r0, =sub_8086194
ldr r0, =CB2_ReturnToFieldWithOpenMenu
bl SetMainCallback2
b _081C7292
.pool
@ -66,7 +66,7 @@ sub_81C72BC: @ 81C72BC
str r0, [r4]
cmp r0, 0
bne _081C72F0
ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music
ldr r0, =CB2_ReturnToFieldContinueScript
bl SetMainCallback2
b _081C7320
.pool
@ -351,12 +351,12 @@ _081C752C:
bl sub_81C7334
cmp r4, 0
beq _081C755C
ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music
ldr r0, =CB2_ReturnToFieldContinueScript
bl SetMainCallback2
b _081C7562
.pool
_081C755C:
ldr r0, =sub_8086194
ldr r0, =CB2_ReturnToFieldWithOpenMenu
bl SetMainCallback2
_081C7562:
pop {r4-r7}
@ -3757,7 +3757,7 @@ sub_81C8EF8: @ 81C8EF8
lsls r2, 2
add r2, r8
str r2, [r5, 0x44]
ldrh r3, [r2, 0x4]
ldrh r3, [r2( 0x4]
lsls r1, r3, 22
lsrs r1, 22
adds r1, 0x2

View File

@ -3116,7 +3116,7 @@ _08014070:
movs r0, 0x6
strb r0, [r1, 0x1]
ldr r1, =gMain
ldr r0, =c2_exit_to_overworld_2_switch
ldr r0, =CB2_ReturnToField
str r0, [r1, 0x8]
ldr r0, =sub_807AE50
bl SetMainCallback2
@ -3258,7 +3258,7 @@ _080141D4:
eors r0, r1
lsls r0, 24
lsrs r0, 24
ldr r1, =c2_exit_to_overworld_2_switch
ldr r1, =CB2_ReturnToField
bl sub_80C4E74
_080141F2:
bl RunTasks
@ -3399,7 +3399,7 @@ sub_8014304: @ 8014304
ldr r0, =0x00004087
bl VarSet
bl GetLinkPlayerCount
ldr r1, =gUnknown_03005DB8
ldr r1, =gFieldLinkPlayerCount
strb r0, [r1]
bl GetMultiplayerId
ldr r1, =gUnknown_03005DB4
@ -3757,7 +3757,7 @@ _08014714:
bl GetCursorSelectionMonId
lsls r0, 24
lsrs r0, 24
ldr r1, =c2_load_new_map
ldr r1, =CB2_LoadMap
bl sub_802A9A8
b _08014764
.pool
@ -3766,7 +3766,7 @@ _08014734:
movs r1, 0x9
movs r2, 0x1
bl sub_8014290
ldr r0, =c2_load_new_map
ldr r0, =CB2_LoadMap
bl sub_8020C70
b _08014764
.pool
@ -3778,7 +3778,7 @@ _0801474C:
bl GetCursorSelectionMonId
lsls r0, 24
lsrs r0, 24
ldr r1, =c2_load_new_map
ldr r1, =CB2_LoadMap
bl sub_802493C
_08014764:
adds r0, r4, 0
@ -6931,7 +6931,7 @@ _08016502:
ldr r1, =gFieldCallback
ldr r0, =sub_80AF128
str r0, [r1]
ldr r1, =c2_exit_to_overworld_2_switch
ldr r1, =CB2_ReturnToField
movs r0, 0x8
bl sub_81B8904
b _08016878
@ -7229,7 +7229,7 @@ _0801677E:
ldr r1, =gFieldCallback
ldr r0, =sub_80AF128
str r0, [r1]
ldr r1, =c2_exit_to_overworld_2_switch
ldr r1, =CB2_ReturnToField
movs r0, 0x9
bl sub_81B8904
adds r0, r6, 0
@ -14941,7 +14941,7 @@ _0801A58C:
ldr r0, =gUnknown_03000DAC
ldr r0, [r0]
bl Free
ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music
ldr r0, =CB2_ReturnToFieldContinueScript
bl SetMainCallback2
pop {r4}
pop {r0}
@ -16076,7 +16076,7 @@ _0801AF58:
bl sub_801ABDC
cmp r0, 0
beq _0801AFAE
ldr r0, =c2_exit_to_overworld_2_switch
ldr r0, =CB2_ReturnToField
bl SetMainCallback2
b _0801AFAE
.pool
@ -16102,7 +16102,7 @@ _0801AF98:
bl sub_801ABDC
cmp r0, 0
beq _0801AFAE
ldr r0, =c2_exit_to_overworld_2_switch
ldr r0, =CB2_ReturnToField
bl SetMainCallback2
_0801AFAE:
bl RunTasks
@ -23568,7 +23568,7 @@ _0801EBA8:
bne _0801EBC2
bl sub_801F544
bl sub_801DE30
ldr r0, =c2_exit_to_overworld_2_switch
ldr r0, =CB2_ReturnToField
bl SetMainCallback2
_0801EBC2:
add sp, 0x4
@ -27694,7 +27694,7 @@ _08020C26:
str r0, [r5]
adds r0, r4, 0
bl SetMainCallback2
ldr r0, =c2_exit_to_overworld_2_switch
ldr r0, =CB2_ReturnToField
cmp r4, r0
bne _08020C5A
ldr r2, =gTextFlags
@ -27705,8 +27705,8 @@ _08020C26:
movs r0, 0xC8
lsls r0, 1
bl PlayNewMapMusic
ldr r0, =c1_overworld
bl set_callback1
ldr r0, =CB1_Overworld
bl SetMainCallback1
_08020C5A:
movs r0, 0
_08020C5C:

View File

@ -915,8 +915,8 @@ _080FBECA:
bx r0
thumb_func_end RotatingGatePuzzleCameraUpdate
thumb_func_start sub_80FBED0
sub_80FBED0: @ 80FBED0
thumb_func_start RotatingGate_InitPuzzleAndGraphics
RotatingGate_InitPuzzleAndGraphics: @ 80FBED0
push {lr}
bl GetCurrentMapRotatingGatePuzzleType
cmp r0, 0
@ -929,7 +929,7 @@ sub_80FBED0: @ 80FBED0
_080FBEEA:
pop {r0}
bx r0
thumb_func_end sub_80FBED0
thumb_func_end RotatingGate_InitPuzzleAndGraphics
thumb_func_start CheckForRotatingGatePuzzleCollision
CheckForRotatingGatePuzzleCollision: @ 80FBEF0

View File

@ -3276,7 +3276,7 @@ sub_8141E7C: @ 8141E7C
ldr r1, =gFieldCallback
ldr r0, =sub_80AF168
str r0, [r1]
ldr r0, =c2_exit_to_overworld_2_switch
ldr r0, =CB2_ReturnToField
bl SetMainCallback2
adds r0, r5, 0
bl DestroyTask

View File

@ -390,7 +390,7 @@ _080F8AB6:
thumb_func_start sub_80F8ACC
sub_80F8ACC: @ 80F8ACC
push {lr}
ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music
ldr r0, =CB2_ReturnToFieldContinueScript
bl SetMainCallback2
pop {r0}
bx r0
@ -1559,7 +1559,7 @@ _080F9478:
movs r0, 0x1
strh r0, [r1]
_080F947E:
ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music
ldr r0, =CB2_ReturnToFieldContinueScript
bl SetMainCallback2
pop {r0}
bx r0
@ -1599,7 +1599,7 @@ _080F94D0:
movs r0, 0x1
strh r0, [r1]
_080F94D6:
ldr r0, =c2_exit_to_overworld_1_continue_scripts_restart_music
ldr r0, =CB2_ReturnToFieldContinueScript
bl SetMainCallback2
pop {r0}
bx r0

View File

@ -230,7 +230,7 @@ CB2_ExitSellMenu: @ 80DFC48
ldr r0, =gFieldCallback
ldr r1, =MapPostLoadHook_ExitBuyOrSellMenu
str r1, [r0]
ldr r0, =c2_exit_to_overworld_2_switch
ldr r0, =CB2_ReturnToField
bl SetMainCallback2
pop {r0}
bx r0
@ -2706,7 +2706,7 @@ Task_ExitBuyMenu: @ 80E11B0
bne _080E11D6
bl RemoveMoneyLabelObject
bl BuyMenuFreeMemory
ldr r0, =c2_exit_to_overworld_2_switch
ldr r0, =CB2_ReturnToField
bl SetMainCallback2
adds r0, r4, 0
bl DestroyTask

View File

@ -591,7 +591,7 @@ StartMenu_PlayerName: @ 809FC8C
cmp r0, 0
beq _0809FCC8
_0809FCB6:
ldr r0, =sub_8086194
ldr r0, =CB2_ReturnToFieldWithOpenMenu
bl sub_80C4DDC
b _0809FCEA
.pool
@ -601,12 +601,12 @@ _0809FCC8:
lsls r0, 24
cmp r0, 0
beq _0809FCE4
ldr r0, =sub_8086194
ldr r0, =CB2_ReturnToFieldWithOpenMenu
bl sub_80C51C4
b _0809FCEA
.pool
_0809FCE4:
ldr r0, =sub_8086194
ldr r0, =CB2_ReturnToFieldWithOpenMenu
bl sub_80C4DDC
_0809FCEA:
movs r0, 0x1
@ -656,7 +656,7 @@ _0809FD38:
ldr r0, =CB2_InitOptionMenu
bl SetMainCallback2
ldr r1, =gMain
ldr r0, =sub_8086194
ldr r0, =CB2_ReturnToFieldWithOpenMenu
str r0, [r1, 0x8]
movs r0, 0x1
_0809FD52:
@ -703,7 +703,7 @@ _0809FDA0:
bl overworld_free_bg_tilemaps
ldr r0, =gUnknown_03005DB4
ldrb r0, [r0]
ldr r1, =sub_8086194
ldr r1, =CB2_ReturnToFieldWithOpenMenu
bl sub_80C4E74
movs r0, 0x1
_0809FDB4:

View File

@ -10669,7 +10669,7 @@ _0807CF5C:
bl Free
str r4, [r7]
_0807CFAA:
ldr r0, =c2_exit_to_overworld_2_switch
ldr r0, =CB2_ReturnToField
bl SetMainCallback2
bl sub_807E784
_0807CFB4:
@ -12774,7 +12774,7 @@ _0807E3A8:
bl Free
str r4, [r7]
_0807E3F6:
ldr r0, =c2_exit_to_overworld_2_switch
ldr r0, =CB2_ReturnToField
bl SetMainCallback2
bl sub_807E784
_0807E400:

View File

@ -8,7 +8,6 @@
.include "asm/macros.inc"
.include "asm/macros/event.inc"
.include "constants/constants.inc"
.section script_data, "aw", %progbits

View File

@ -8,7 +8,7 @@
.align 2
gUnknown_085920D8:: @ 85920D8
.4byte sub_81B617C
.4byte c2_exit_to_overworld_2_switch
.4byte CB2_ReturnToField
.4byte NULL
.align 2

View File

@ -916,21 +916,21 @@ RecordCorner_EventScript_277471:: @ 8277471
releaseall
end
gUnknown_0827747E:: @ 827747E
EventScript_TradeRoom_ReadTrainerCard1:: @ 827747E
msgbox Text_278452, 4
fadescreen 1
special sp02A_crash_sound
waitstate
end
gUnknown_0827748D:: @ 827748D
EventScript_TradeRoom_ReadTrainerCard2:: @ 827748D
msgbox Text_27847B, 4
fadescreen 1
special sp02A_crash_sound
waitstate
end
gUnknown_0827749C:: @ 827749C
EventScript_TradeRoom_TooBusyToNotice:: @ 827749C
msgbox Text_27842E, 4
closemessage
end
@ -983,7 +983,7 @@ gUnknown_08277509:: @ 8277509
special sub_80B371C
end
gUnknown_08277513:: @ 8277513
EventScript_277513:: @ 8277513
special sub_80B36EC
special sub_80AF9F8
waitstate

View File

@ -12,7 +12,7 @@ FortreeCity_Gym_MapScript2_2165BA: @ 82165BA
.2byte 0
FortreeCity_Gym_EventScript_2165C4:: @ 82165C4
special sub_80FBED0
special RotatingGate_InitPuzzleAndGraphics
end
FortreeCity_Gym_EventScript_2165C8:: @ 82165C8

View File

@ -12,7 +12,7 @@ Route110_TrickHousePuzzle6_MapScript2_26DDB6: @ 826DDB6
.2byte 0
Route110_TrickHousePuzzle6_EventScript_26DDC0:: @ 826DDC0
special sub_80FBED0
special RotatingGate_InitPuzzleAndGraphics
end
Route110_TrickHousePuzzle6_EventScript_26DDC4:: @ 826DDC4

View File

@ -18,7 +18,7 @@ Route119_EventScript_1F4439:: @ 81F4439
Route119_MapScript1_1F444D: @ 81F444D
call Route119_EventScript_271ED7
call Route119_EventScript_271EFB
compare VAR_0x40B3, 1
compare VAR_WEATHER_INSTITUTE_STATE, 1
call_if 1, Route119_EventScript_1F4466
special SetRoute119Weather
end
@ -26,7 +26,7 @@ Route119_MapScript1_1F444D: @ 81F444D
Route119_EventScript_1F4466:: @ 81F4466
setflag FLAG_0x37D
clearflag FLAG_0x37C
setvar VAR_0x40B3, 2
setvar VAR_WEATHER_INSTITUTE_STATE, 2
return
Route119_EventScript_1F4472:: @ 81F4472

View File

@ -3,7 +3,7 @@ Route119_WeatherInstitute_1F_MapScripts:: @ 826FA86
.byte 0
Route119_WeatherInstitute_1F_MapScript1_26FA8C: @ 826FA8C
compare VAR_0x40B3, 0
compare VAR_WEATHER_INSTITUTE_STATE, 0
call_if 1, Route119_WeatherInstitute_1F_EventScript_26FA98
end
@ -16,7 +16,7 @@ Route119_WeatherInstitute_1F_EventScript_26FAA4:: @ 826FAA4
lock
faceplayer
special GetPlayerBigGuyGirlString
compare VAR_0x40B3, 0
compare VAR_WEATHER_INSTITUTE_STATE, 0
goto_eq Route119_WeatherInstitute_1F_EventScript_26FABE
msgbox Route119_WeatherInstitute_1F_Text_26FCE5, 4
release

View File

@ -3,9 +3,9 @@ Route119_WeatherInstitute_2F_MapScripts:: @ 826FF1E
.byte 0
Route119_WeatherInstitute_2F_MapScript1_26FF24: @ 826FF24
compare VAR_0x40B3, 0
compare VAR_WEATHER_INSTITUTE_STATE, 0
call_if 1, Route119_WeatherInstitute_2F_EventScript_26FF44
compare VAR_0x40B3, 1
compare VAR_WEATHER_INSTITUTE_STATE, 1
call_if 1, Route119_WeatherInstitute_2F_EventScript_26FF50
checkflag FLAG_SYS_GAME_CLEAR
call_if 1, Route119_WeatherInstitute_2F_EventScript_26FF5C
@ -62,7 +62,7 @@ Route119_WeatherInstitute_2F_EventScript_26FFC8:: @ 826FFC8
waitmovement 0
msgbox Route119_WeatherInstitute_2F_Text_2705DD, 4
closemessage
setvar VAR_0x40B3, 1
setvar VAR_WEATHER_INSTITUTE_STATE, 1
clearflag FLAG_0x37D
fadedefaultbgm
fadescreen 1

View File

@ -213,7 +213,7 @@ gSpecials:: @ 81DBA64
def_special sub_80F972C
def_special sp0C8_whiteout_maybe
def_special sub_80FBE90
def_special sub_80FBED0
def_special RotatingGate_InitPuzzleAndGraphics
def_special SetSSTidalFlag
def_special ResetSSTidalFlag
def_special EnterSafariMode

View File

@ -26,5 +26,14 @@ void DrawWholeMapView(void);
void CurrentMapDrawMetatileAt(int x, int y);
void sub_8089C08(s16 *a0, s16 *a1);
void DrawDoorMetatileAt(int x, int y, u16 *arr);
void move_tilemap_camera_to_upper_left_corner(void);
void sub_8057A58(void);
void ResetCameraUpdateInfo(void);
u32 InitCameraUpdateCallback(u8 a);
void CameraUpdate(void);
void SetCameraPanningCallback(void (*a)(void));
void SetCameraPanning(s16 a, s16 b);
void InstallCameraPanAheadCallback(void);
void UpdateCameraPanning(void);
#endif //GUARD_FIELD_CAMERA_H

View File

@ -0,0 +1,41 @@
#ifndef GUARD_FIELDCONTROLAVATAR_H
#define GUARD_FIELDCONTROLAVATAR_H
struct FieldInput
{
u8 pressedAButton:1;
u8 input_field_0_1:1;
u8 pressedStartButton:1;
u8 pressedSelectButton:1;
u8 input_field_0_4:1;
u8 input_field_0_5:1;
u8 input_field_0_6:1;
u8 pressedBButton:1;
u8 input_field_1_0:1;
u8 input_field_1_1:1;
u8 input_field_1_2:1;
u8 input_field_1_3:1;
u8 input_field_1_4:1;
u8 input_field_1_5:1;
u8 input_field_1_6:1;
u8 input_field_1_7:1;
u8 dpadDirection;
u8 input_field_3;
};
void FieldClearPlayerInput(struct FieldInput *pStruct);
void FieldGetPlayerInput(struct FieldInput *pStruct, u16 keys, u16 heldKeys);
int sub_809C014(struct FieldInput *pStruct);
u8 *sub_80682A8(struct MapPosition *, u8, u8);
void overworld_poison_timer_set(void);
void prev_quest_postbuffer_cursor_backup_reset(void);
u8 *sub_8068E24(struct MapPosition *);
u8 *GetFieldObjectScriptPointerPlayerFacing(void);
bool8 mapheader_trigger_activate_at__run_now(struct MapPosition *);
bool8 sub_8068870(u16 a);
bool8 sub_8068894(void);
bool8 sub_8068A64(struct MapPosition *, u16);
u8 sub_8068F18(void);
bool8 dive_warp(struct MapPosition *position, u16 b);
#endif // GUARD_FIELDCONTROLAVATAR_H

View File

@ -10,6 +10,8 @@
// Exported RAM declarations
// Exported ROM declarations
u8 ZCoordToPriority(u8);
void FieldObjectUpdateZCoord(struct MapObject *pObject);
void SetObjectSubpriorityByZCoord(u8, struct Sprite *, u8);
void InitObjectPriorityByZCoord(struct Sprite *, u8);
bool8 IsZCoordMismatchAt(u8, s16, s16);

View File

@ -25,6 +25,7 @@ enum SpinnerRunnerFollowPatterns {
// Exported ROM declarations
void sub_808D438(void);
u8 get_go_image_anim_num(u8);
u8 GetFieldObjectIdByLocalIdAndMap(u8, u8, u8);
bool8 TryGetFieldObjectIdByLocalIdAndMap(u8, u8, u8, u8 *);
u8 GetFieldObjectIdByXY(s16, s16);
@ -88,6 +89,8 @@ bool8 FieldObjectIsSpecialAnimOrDirectionSequenceAnimActive(struct MapObject *ma
u8 FieldObjectCheckIfSpecialAnimFinishedOrInactive(struct MapObject *mapObject);
void sub_808F23C(const struct MapObject *mapObject, u8 movementType);
void sub_808F208(const struct MapObject *mapObject);
void npc_coords_shift_still(struct MapObject *pObject);
void FieldObjectMoveDestCoords(struct MapObject *pObject, u32 unk_19, s16 *pInt, s16 *pInt1);
// Exported data declarations

View File

@ -1,6 +1,7 @@
#ifndef GUARD_FIELD_PLAYER_AVATAR_H
#define GUARD_FIELD_PLAYER_AVATAR_H
void player_step(u8 a, u16 b, u16 c);
void ClearPlayerAvatarInfo(void);
void SetPlayerAvatarExtraStateTransition(u8, u8);
u8 GetPlayerAvatarGenderByGraphicsId(u8);
@ -31,7 +32,7 @@ u8 CheckForFieldObjectCollision(struct MapObject *a, s16 b, s16 c, u8 d, u8 e);
u8 PlayerGetZCoord(void);
void SetPlayerAvatarTransitionFlags(u16 a);
void sub_808BCE8(void);
void InitPlayerAvatar(s16 a, s16 b, u8 c, u8 d);
void sub_808D074(u8);
void GetXYCoordsOneStepInFrontOfPlayer(s16 *xPtr, s16 *yPtr);
u8 GetRivalAvatarGraphicsIdByStateIdAndGender(u8, u8);

View File

@ -15,5 +15,6 @@ bool8 MapGridIsImpassableAt(s16, s16);
s32 GetMapBorderIdAt(s16, s16);
bool32 CanCameraMoveInDirection(u8);
u16 GetBehaviorByMetatileId(u16 metatileId);
void sav1_camera_get_focus_coords(u16 *x, u16 *y);
#endif //GUARD_FIELDMAP_H

View File

@ -162,10 +162,10 @@ struct MapConnections
struct MapHeader
{
/* 0x00 */ struct MapData *mapData;
/* 0x04 */ struct MapEvents *events;
/* 0x00 */ const struct MapData *mapData;
/* 0x04 */ const struct MapEvents *events;
/* 0x08 */ u8 *mapScripts;
/* 0x0C */ struct MapConnections *connections;
/* 0x0C */ const struct MapConnections *connections;
/* 0x10 */ u16 music;
/* 0x12 */ u16 mapDataId;
/* 0x14 */ u8 regionMapSectionId;

View File

@ -144,6 +144,18 @@ struct UCoords16
u16 y;
};
struct Coords32
{
s32 x;
s32 y;
};
struct UCoords32
{
u32 x;
u32 y;
};
struct Time
{
/*0x00*/ s16 days;

View File

@ -1,7 +1,5 @@
#ifndef GUARD_ROM4_H
#define GUARD_ROM4_H
#include "main.h"
#ifndef GUARD_OVERWORLD_H
#define GUARD_OVERWORLD_H
struct UnkPlayerStruct
{
@ -17,19 +15,15 @@ struct LinkPlayerMapObject
u8 mode;
};
struct UCoords32
{
u32 x, y;
};
extern struct WarpData gUnknown_020322DC;
extern struct LinkPlayerMapObject gLinkPlayerMapObjects[4];
extern MainCallback gFieldCallback;
extern const struct UCoords32 gUnknown_08339D64[];
void DoWhiteOut(void);
void Overworld_ResetStateAfterFly(void);
void Overworld_ResetStateAfterTeleport(void);
void Overworld_ResetStateAfterDigEscRope(void);
void sub_8084788(void);
void ResetGameStats(void);
void IncrementGameStat(u8 index);
u32 GetGameStat(u8 index);
@ -39,82 +33,106 @@ void LoadMapObjTemplatesFromHeader(void);
void LoadSaveblockMapObjScripts(void);
void Overworld_SetMapObjTemplateCoords(u8 localId, s16 x, s16 y);
void Overworld_SetMapObjTemplateMovementType(u8 localId, u8 movementType);
void mapdata_load_assets_to_gpu_and_full_redraw(void);
struct MapData *get_mapdata_header(void);
const struct MapData *get_mapdata_header(void);
void ApplyCurrentWarp(void);
void set_warp2_warp3_to_neg_1(void);
void SetWarpData(struct WarpData *warp, s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y);
bool32 warp_data_is_not_neg_1(struct WarpData *warp);
struct MapHeader *const Overworld_GetMapHeaderByGroupAndId(u16 mapGroup, u16 mapNum);
struct MapHeader *const warp1_get_mapheader(void);
const struct MapHeader *Overworld_GetMapHeaderByGroupAndId(u16 mapGroup, u16 mapNum);
const struct MapHeader *warp1_get_mapheader(void);
void set_current_map_header_from_sav1_save_old_name(void);
void LoadSaveblockMapHeader(void);
void update_camera_pos_from_warpid(void);
void warp_in(void);
void Overworld_SetWarpDestination(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y);
void warp1_set_2(s8 mapGroup, s8 mapNum, s8 warpId);
void saved_warp2_set(int unused, s8 mapGroup, s8 mapNum, s8 warpId);
void saved_warp2_set_2(int unused, s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y);
void saved_warp2_set(s32 unused, s8 mapGroup, s8 mapNum, s8 warpId);
void saved_warp2_set_2(s32 unused, s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y);
void copy_saved_warp2_bank_and_enter_x_to_warp1(u8 unused);
void sub_8084CCC(u8 a1);
void Overworld_SetWarpDestToLastHealLoc(void);
void Overworld_SetHealLocationWarp(u8 healLocationId);
void sub_8084D5C(s16 a1, s16 a2);
void sub_8084DD4(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y);
// to erase later
bool32 Overworld_IsBikingAllowed(void);
u8 sub_808532C(struct UnkPlayerStruct *playerStruct, u16 a2, u8 a3);
u8 sub_808538C(struct UnkPlayerStruct *playerStruct, u8 a2, u16 a3, u8 a4);
u16 cur_mapdata_block_role_at_screen_center_acc_to_sav1(void);
bool8 Overworld_MapTypeIsIndoors(u8 mapType);
void SetDefaultFlashLevel(void);
void Overworld_ClearSavedMusic(void);
void sub_8085810(void);
u8 GetMapTypeByGroupAndId(s8 mapGroup, s8 mapNum);
u8 Overworld_GetMapTypeOfSaveblockLocation(void);
void Overworld_SetMapObjTemplateCoords(u8, s16, s16);
void Overworld_SetMapObjTemplateMovementType(u8, u8);
void Overworld_SetWarpDestination(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y);
void saved_warp2_set(int unused, s8 mapGroup, s8 mapNum, s8 warpId);
void saved_warp2_set_2(int unused, s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y);
void Overworld_SetHealLocationWarp(u8);
void sub_8084DD4(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y);
void sub_8084E2C(s8, s8, s8, s8, s8);
void sub_8084E80(s8, s8, s8, s8, s8);
void sub_8084EBC(s16, s16);
void sub_8084E14(void);
void sub_8084E2C(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y);
void warp1_set_to_warp2(void);
void sub_8084E80(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y);
void sub_8084EBC(s16 x, s16 y);
void warp1_set_to_sav1w(void);
void sub_8084F2C(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y);
void sub_8084F6C(u8 a1);
void sub_8084FAC(void);
const struct MapConnection *GetMapConnection(u8 dir);
bool8 sub_8084FF8(u8 dir, u16 x, u16 y);
bool8 sub_8085058(u16 x, u16 y);
bool8 sub_8085078(u16 x, u16 y);
void mliX_load_map(u8 mapGroup, u8 mapNum);
void player_avatar_init_params_reset(void);
bool8 Overworld_MapTypeAllowsTeleportAndFly(u8 mapType);
void Overworld_ResetStateAfterTeleport(void);
void Overworld_SetFlashLevel(s32 a1);
//u8 Overworld_GetFlashLevel(void);
void sub_8085524(u16);
void Overworld_SetSavedMusic(u16);
void walkrun_find_lowest_active_bit_in_bitfield(void);
bool32 Overworld_IsBikingAllowed(void);
void SetDefaultFlashLevel(void);
void Overworld_SetFlashLevel(s32 flashLevel);
u8 Overworld_GetFlashLevel(void);
void sub_8085524(u16 mapDataId);
void sub_8085540(u8 var);
u8 sub_808554C(void);
u16 GetLocationMusic(struct WarpData *warp);
u16 GetCurrLocationDefaultMusic(void);
u16 GetWarpDestinationMusic(void);
void Overworld_ResetMapMusic(void);
void Overworld_PlaySpecialMapMusic(void);
void Overworld_SetSavedMusic(u16 songNum);
void Overworld_ClearSavedMusic(void);
void Overworld_ChangeMusicToDefault(void);
void Overworld_ChangeMusicTo(u16);
bool32 is_c1_link_related_active(void);
extern u16 gUnknown_03005DA8;
void strange_npc_table_clear(void);
void FieldObjectMoveDestCoords(struct MapObject *, u32, s16 *, s16 *);
void sub_8086230(void);
void c2_exit_to_overworld_2_switch(void);
bool32 sub_8087598(void);
void c2_exit_to_overworld_1_continue_scripts_restart_music(void);
void warp_in(void);
u8 get_map_light_level_by_bank_and_number(s8 mapGroup, s8 mapNum);
void sub_8086194(void);
void sub_8084CCC(u8 spawn);
void warp1_set_2(s8 mapGroup, s8 mapNum, s8 warpNum);
void c2_load_new_map(void);
void copy_saved_warp2_bank_and_enter_x_to_warp1(u8 unused);
void mapldr_default(void);
void Overworld_ChangeMusicTo(u16 newMusic);
u8 GetMapMusicFadeoutSpeed(void);
void music_something(void);
bool8 sub_80859A0(void);
void Overworld_FadeOutMapMusic(void);
void UpdateAmbientCry(s16 *state, u16 *delayCounter);
u8 GetMapTypeByGroupAndId(s8 mapGroup, s8 mapNum);
u8 GetMapTypeByWarpData(struct WarpData *warp);
u8 Overworld_GetMapTypeOfSaveblockLocation(void);
u8 get_map_light_from_warp0(void);
bool8 is_light_level_1_2_3_5_or_6(u8 a1);
bool8 is_light_level_1_2_3_5_or_6(u8 mapType);
bool8 Overworld_MapTypeAllowsTeleportAndFly(u8 mapType);
bool8 Overworld_MapTypeIsIndoors(u8 mapType);
u8 sav1_saved_warp2_map_get_name(void);
u8 sav1_map_get_name(void);
u8 GetCurrentMapBattleScene(void);
void overworld_free_bg_tilemaps(void);
bool32 is_c1_link_related_active(void);
void CB1_Overworld(void);
void CB2_OverworldBasic(void);
void CB2_Overworld(void);
void SetMainCallback1(void (*cb)(void));
void sub_8085E94(void *a0);
void CB2_NewGame(void);
void CB2_WhiteOut(void);
void CB2_LoadMap(void);
void sub_8086024(void);
void sub_8086074(void);
void CB2_ReturnToField(void);
void CB2_ReturnToFieldLocal(void);
void CB2_ReturnToFieldLink(void);
void c2_8056854(void);
void CB2_ReturnToFieldWithOpenMenu(void);
void sub_80861B0(void);
void CB2_ReturnToFieldContinueScript(void);
void sub_80861E8(void);
void CB2_ContinueSavedGame(void);
void sub_8086C2C(void);
u32 sub_8087214(void);
bool32 sub_808727C(void);
u16 sub_8087288(void);
u16 sub_808729C(void);
u16 sub_80872B0(void);
u16 sub_80872C4(void);
bool32 sub_8087598(void);
bool32 sub_80875C8(void);
bool32 sub_8087634(void);
bool32 sub_808766C(void);
void IncrementGameStat(u8);
u32 GetGameStat(u8);
void CB2_OverworldBasic(void);
void ZeroAllLinkPlayerMapObjects(void);
#endif //GUARD_ROM4_H
#endif // GUARD_OVERWORLD_H

View File

@ -87,7 +87,6 @@ SECTIONS {
src/play_time.o(.text);
src/new_game.o(.text);
src/overworld.o(.text);
asm/overworld.o(.text);
asm/fieldmap.o(.text);
src/metatile_behavior.o(.text);
asm/field_camera.o(.text);

View File

@ -472,7 +472,7 @@ void StartWallyTutorialBattle(void)
{
CreateMaleMon(&gEnemyParty[0], SPECIES_RALTS, 5);
ScriptContext2_Enable();
gMain.savedCallback = c2_exit_to_overworld_1_continue_scripts_restart_music;
gMain.savedCallback = CB2_ReturnToFieldContinueScript;
gBattleTypeFlags = BATTLE_TYPE_WALLY_TUTORIAL;
CreateBattleStartTask(B_TRANSITION_SLICE, 0);
}
@ -601,7 +601,7 @@ static void CB2_EndWildBattle(void)
}
else
{
SetMainCallback2(c2_exit_to_overworld_2_switch);
SetMainCallback2(CB2_ReturnToField);
gFieldCallback = sub_80AF6F0;
}
}
@ -614,13 +614,13 @@ static void CB2_EndScriptedWildBattle(void)
if (IsPlayerDefeated(gBattleOutcome) == TRUE)
{
if (InBattlePyramid())
SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music);
SetMainCallback2(CB2_ReturnToFieldContinueScript);
else
SetMainCallback2(CB2_WhiteOut);
}
else
{
SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music);
SetMainCallback2(CB2_ReturnToFieldContinueScript);
}
}
@ -937,7 +937,7 @@ static void CB2_StartFirstBattle(void)
static void CB2_EndFirstBattle(void)
{
Overworld_ClearSavedMusic();
SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music);
SetMainCallback2(CB2_ReturnToFieldContinueScript);
}
static void sub_80B1218(void)
@ -1313,18 +1313,18 @@ static void CB2_EndTrainerBattle(void)
{
if (gTrainerBattleOpponent_A == SECRET_BASE_OPPONENT)
{
SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music);
SetMainCallback2(CB2_ReturnToFieldContinueScript);
}
else if (IsPlayerDefeated(gBattleOutcome) == TRUE)
{
if (InBattlePyramid() || sub_81D5C18())
SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music);
SetMainCallback2(CB2_ReturnToFieldContinueScript);
else
SetMainCallback2(CB2_WhiteOut);
}
else
{
SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music);
SetMainCallback2(CB2_ReturnToFieldContinueScript);
if (!InBattlePyramid() && !sub_81D5C18())
{
RegisterTrainerInMatchCall();
@ -1337,7 +1337,7 @@ static void CB2_EndRematchBattle(void)
{
if (gTrainerBattleOpponent_A == SECRET_BASE_OPPONENT)
{
SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music);
SetMainCallback2(CB2_ReturnToFieldContinueScript);
}
else if (IsPlayerDefeated(gBattleOutcome) == TRUE)
{
@ -1345,7 +1345,7 @@ static void CB2_EndRematchBattle(void)
}
else
{
SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music);
SetMainCallback2(CB2_ReturnToFieldContinueScript);
RegisterTrainerInMatchCall();
SetBattledTrainersFlags();
HandleRematchVarsOnBattleEnd();

View File

@ -919,7 +919,7 @@ static void CB2_TestBattleTransition(void)
if (IsBattleTransitionDone())
{
sTestingTransitionState = 0;
SetMainCallback2(c2_exit_to_overworld_2_switch);
SetMainCallback2(CB2_ReturnToField);
}
break;
}

View File

@ -161,7 +161,7 @@ extern void copy_textbox_border_tile_patterns_to_vram(u8, u16, u8);
extern void sub_81AABF0(void (*callback)(void));
extern void sub_800B4C0(void);
extern void ClearLinkCallback(void);
extern void c2_exit_to_overworld_1_continue_scripts_restart_music(void);
extern void CB2_ReturnToFieldContinueScript(void);
extern void sub_8153430(void);
extern bool8 sub_8153474(void);
extern void sub_80EECEC(void);
@ -2692,7 +2692,7 @@ static void CB2_HandlePlayerLinkPlayAgainChoice(void)
if (gReceivedRemoteLinkPlayers == 0)
{
FREE_AND_SET_NULL(sBerryBlenderData);
SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music);
SetMainCallback2(CB2_ReturnToFieldContinueScript);
}
break;
}
@ -2742,7 +2742,7 @@ static void CB2_HandlePlayerPlayAgainChoice(void)
if (sBerryBlenderData->playAgainState == PLAY_AGAIN_OK)
SetMainCallback2(DoBerryBlending);
else
SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music);
SetMainCallback2(CB2_ReturnToFieldContinueScript);
FreeAllWindowBuffers();
UnsetBgTilemapBuffer(2);

View File

@ -83,7 +83,7 @@ static void UpdatePerMinute(struct Time *localTime)
static void ReturnFromStartWallClock(void)
{
InitTimeBasedEvents();
SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music);
SetMainCallback2(CB2_ReturnToFieldContinueScript);
}
void StartWallClock(void)

View File

@ -46,7 +46,7 @@ extern void sub_819746C(u8, bool8);
extern void NewMenuHelpers_DrawStdWindowFrame(u8, bool8);
extern void sub_81B9328(void);
extern void sub_81AF078(u32, bool8, struct ListMenu *);
extern void c2_exit_to_overworld_2_switch(void);
extern void CB2_ReturnToField(void);
// this file's functions
static void ClearDaycareMonMisc(struct DaycareMiscMon *misc);
@ -1315,5 +1315,5 @@ void ShowDaycareLevelMenu(void)
void ChooseSendDaycareMon(void)
{
sub_81B9328();
gMain.savedCallback = c2_exit_to_overworld_2_switch;
gMain.savedCallback = CB2_ReturnToField;
}

View File

@ -1682,7 +1682,7 @@ void c1_overworld_prev_quest(u8 taskId)
sub_812A3C8();
FreeSpritePaletteByTag(OVERWORLD_PLACE_DECOR_SELECTOR_PAL_TAG);
gFieldCallback = sub_8128CD4;
SetMainCallback2(c2_exit_to_overworld_2_switch);
SetMainCallback2(CB2_ReturnToField);
DestroyTask(taskId);
break;
}
@ -2673,7 +2673,7 @@ void sub_812A25C(u8 taskId)
case 1:
sub_812A3C8();
gFieldCallback = sub_812A334;
SetMainCallback2(c2_exit_to_overworld_2_switch);
SetMainCallback2(CB2_ReturnToField);
DestroyTask(taskId);
break;
}

View File

@ -63,7 +63,7 @@ extern void FadeScreen(u8, u8);
extern void overworld_free_bg_tilemaps(void);
extern void sub_80AF168(void);
extern void ScanlineEffect_Stop(void);
extern void c2_exit_to_overworld_2_switch(void);
extern void CB2_ReturnToField(void);
extern void play_some_sound(void);
extern void DoNamingScreen(u8, const u8*, u16, u8, u32, MainCallback);
extern u16 sub_80D22D0(void);
@ -564,7 +564,7 @@ static void EggHatchSetMonNickname(void)
SetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_NICKNAME, gStringVar3);
FreeMonSpritesGfx();
Free(sEggHatchData);
SetMainCallback2(c2_exit_to_overworld_2_switch);
SetMainCallback2(CB2_ReturnToField);
}
static void Task_EggHatchPlayBGM(u8 taskID)
@ -688,7 +688,7 @@ static void CB2_EggHatch_1(void)
UnsetBgTilemapBuffer(0);
UnsetBgTilemapBuffer(1);
Free(sEggHatchData);
SetMainCallback2(c2_exit_to_overworld_2_switch);
SetMainCallback2(CB2_ReturnToField);
}
break;
}

View File

@ -198,7 +198,7 @@ static void npcs_clear_ids_and_state(void)
void sub_808D438(void)
{
strange_npc_table_clear();
ZeroAllLinkPlayerMapObjects();
npcs_clear_ids_and_state();
ClearPlayerAvatarInfo();
sub_808D450();

View File

@ -25,7 +25,7 @@ void AccessHallOfFamePC(void)
void ReturnFromHallOfFamePC(void)
{
SetMainCallback2(c2_exit_to_overworld_2_switch);
SetMainCallback2(CB2_ReturnToField);
gFieldCallback = ReshowPCMenuAfterHallOfFamePC;
}

View File

@ -637,7 +637,7 @@ void sub_80FDC00(u8 taskId)
if (!gPaletteFade.active)
{
overworld_free_bg_tilemaps();
OpenPokeblockCase(0, c2_exit_to_overworld_2_switch);
OpenPokeblockCase(0, CB2_ReturnToField);
DestroyTask(taskId);
}
}
@ -678,7 +678,7 @@ void sub_80FDD10(u8 taskId)
{
gUnknown_0203A0F4 = sub_80FDD74;
gFieldCallback = MapPostLoadHook_UseItem;
*gUnknown_0203CE54 = c2_exit_to_overworld_2_switch;
*gUnknown_0203CE54 = CB2_ReturnToField;
unknown_ItemMenu_Confirm(taskId);
}
else

View File

@ -1079,7 +1079,7 @@ void sub_818E914(void)
void sub_818E92C(void)
{
OpenPokeblockCase(3, c2_exit_to_overworld_2_switch);
OpenPokeblockCase(3, CB2_ReturnToField);
}
void sub_818E940(void)

View File

@ -133,12 +133,12 @@ void MoveSaveBlocks_ResetHeap(void)
}
u8 sav2_x1_query_bit1(void)
u32 GetSecretBase2Field_9(void)
{
return gSaveBlock2Ptr->specialSaveWarp & 1;
}
void sav2_x9_clear_bit1(void)
void ClearSecretBase2Field_9(void)
{
gSaveBlock2Ptr->specialSaveWarp &= ~1;
}

View File

@ -1798,22 +1798,22 @@ static bool8 sub_80E503C(u8 character)
static void sub_80E5074(void)
{
DoNamingScreen(0, gSaveBlock2Ptr->playerName, gSaveBlock2Ptr->playerGender, 0, 0, sub_8086194);
DoNamingScreen(0, gSaveBlock2Ptr->playerName, gSaveBlock2Ptr->playerGender, 0, 0, CB2_ReturnToFieldWithOpenMenu);
}
static void sub_80E509C(void)
{
DoNamingScreen(1, gSaveBlock2Ptr->playerName, gSaveBlock2Ptr->playerGender, 0, 0, sub_8086194);
DoNamingScreen(1, gSaveBlock2Ptr->playerName, gSaveBlock2Ptr->playerGender, 0, 0, CB2_ReturnToFieldWithOpenMenu);
}
static void sub_80E50C4(void)
{
DoNamingScreen(2, gSaveBlock2Ptr->playerName, gSaveBlock2Ptr->playerGender, 0, 0, sub_8086194);
DoNamingScreen(2, gSaveBlock2Ptr->playerName, gSaveBlock2Ptr->playerGender, 0, 0, CB2_ReturnToFieldWithOpenMenu);
}
static void sub_80E50EC(void)
{
DoNamingScreen(3, gSaveBlock2Ptr->playerName, gSaveBlock2Ptr->playerGender, 0, 0, sub_8086194);
DoNamingScreen(3, gSaveBlock2Ptr->playerName, gSaveBlock2Ptr->playerGender, 0, 0, CB2_ReturnToFieldWithOpenMenu);
}
//--------------------------------------------------

File diff suppressed because it is too large Load Diff

View File

@ -74,7 +74,7 @@ extern void (*gFieldCallback)(void);
extern const u16 gUnknown_0860F074[];
extern void c2_exit_to_overworld_2_switch(void);
extern void CB2_ReturnToField(void);
extern bool8 sub_81221EC(void);
extern void sub_809882C(u8, u16, u8);
extern void copy_textbox_border_tile_patterns_to_vram(u8, u16, u8);
@ -374,7 +374,7 @@ void OpenPokeblockCaseInBattle(void)
void OpenPokeblockCaseOnFeeder(void)
{
OpenPokeblockCase(PBLOCK_CASE_FEEDER, c2_exit_to_overworld_2_switch);
OpenPokeblockCase(PBLOCK_CASE_FEEDER, CB2_ReturnToField);
}
static void CB2_PokeblockMenu(void)

View File

@ -1581,7 +1581,7 @@ void MCB2_FlyMap(void)
gUnknown_0203A148 = malloc(sizeof(*gUnknown_0203A148));
if (gUnknown_0203A148 == NULL)
{
SetMainCallback2(sub_8086194);
SetMainCallback2(CB2_ReturnToFieldWithOpenMenu);
}
else
{

View File

@ -26,5 +26,5 @@ void sub_81700F8(void)
Sav2_ClearSetDefault();
SetPokemonCryStereo(gSaveBlock2Ptr->optionsSound);
InitHeap(gHeap, HEAP_SIZE);
SetMainCallback2(sub_8086230);
SetMainCallback2(CB2_ContinueSavedGame);
}

View File

@ -30,9 +30,9 @@ extern void sub_80EE44C(u8, u8);
extern void IncrementGameStat(u8 index);
extern void ScriptContext1_SetupScript(u8*);
extern void ScriptContext2_RunNewScript(u8*);
extern void c2_exit_to_overworld_2_switch(void);
extern void c2_exit_to_overworld_1_continue_scripts_restart_music(void);
extern void c2_load_new_map(void);
extern void CB2_ReturnToField(void);
extern void CB2_ReturnToFieldContinueScript(void);
extern void CB2_LoadMap(void);
extern void sub_80AF6F0(void);
extern void ScriptContext1_Stop(void);
extern void warp_in(void);
@ -112,20 +112,20 @@ void CB2_EndSafariBattle(void)
sSafariZoneCaughtMons++;
if (gNumSafariBalls != 0)
{
SetMainCallback2(c2_exit_to_overworld_2_switch);
SetMainCallback2(CB2_ReturnToField);
}
else if (gBattleOutcome == B_OUTCOME_NO_SAFARI_BALLS)
{
ScriptContext2_RunNewScript(EventScript_2A4B4C);
warp_in();
gFieldCallback = sub_80AF6F0;
SetMainCallback2(c2_load_new_map);
SetMainCallback2(CB2_LoadMap);
}
else if (gBattleOutcome == B_OUTCOME_CAUGHT)
{
ScriptContext1_SetupScript(EventScript_2A4B9B);
ScriptContext1_Stop();
SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music);
SetMainCallback2(CB2_ReturnToFieldContinueScript);
}
}

View File

@ -2054,7 +2054,7 @@ bool8 ScrCmd_playslotmachine(struct ScriptContext *ctx)
{
u8 slotMachineIndex = VarGet(ScriptReadHalfword(ctx));
PlaySlotMachine(slotMachineIndex, c2_exit_to_overworld_1_continue_scripts_restart_music);
PlaySlotMachine(slotMachineIndex, CB2_ReturnToFieldContinueScript);
ScriptContext1_Stop();
return TRUE;
}

View File

@ -386,7 +386,7 @@ void sub_80E8FD0(u8 taskId)
sub_80E8F9C();
warp_in();
gFieldCallback = sub_80AF168;
SetMainCallback2(c2_load_new_map);
SetMainCallback2(CB2_LoadMap);
DestroyTask(taskId);
break;
}
@ -444,7 +444,7 @@ void sub_80E916C(u8 taskId)
Overworld_SetWarpDestination(gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1, gUnknown_0858CFE8[idx + 2], gUnknown_0858CFE8[idx + 3]);
warp_in();
gFieldCallback = sub_80E9108;
SetMainCallback2(c2_load_new_map);
SetMainCallback2(CB2_LoadMap);
DestroyTask(taskId);
}
}
@ -642,7 +642,7 @@ void sub_80E96A4(u8 taskId)
copy_saved_warp2_bank_and_enter_x_to_warp1(0x7e);
warp_in();
gFieldCallback = mapldr_default;
SetMainCallback2(c2_load_new_map);
SetMainCallback2(CB2_LoadMap);
ScriptContext2_Disable();
DestroyTask(taskId);
break;

View File

@ -3633,7 +3633,7 @@ void ChangePokemonNickname(void)
void ChangePokemonNickname_CB(void)
{
SetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_NICKNAME, gStringVar2);
c2_exit_to_overworld_1_continue_scripts_restart_music();
CB2_ReturnToFieldContinueScript();
}
void ChangeBoxPokemonNickname(void)
@ -3649,7 +3649,7 @@ void ChangeBoxPokemonNickname(void)
void ChangeBoxPokemonNickname_CB(void)
{
SetBoxMonNickFromAnyBox(gSpecialVar_MonBoxId, gSpecialVar_MonBoxPos, gStringVar2);
c2_exit_to_overworld_1_continue_scripts_restart_music();
CB2_ReturnToFieldContinueScript();
}
void TV_CopyNicknameToStringVar1AndEnsureTerminated(void)

View File

@ -14,7 +14,7 @@ extern const u8 gText_Peekaboo[];
extern u8 *GetWaldaPhrasePtr(void);
extern bool32 IsWaldaPhraseEmpty(void);
extern void sub_80AF168(void);
extern void c2_exit_to_overworld_2_switch(void);
extern void CB2_ReturnToField(void);
extern void SetWaldaPhrase(const u8 *src);
extern void SetWaldaWallpaperPatternId(u8 patternId);
extern void SetWaldaWallpaperIconId(u8 iconId);
@ -80,7 +80,7 @@ static void CB2_HandleGivenWaldaPhrase(void)
StringCopy(gStringVar1, GetWaldaPhrasePtr());
gFieldCallback = sub_80AF168;
SetMainCallback2(c2_exit_to_overworld_2_switch);
SetMainCallback2(CB2_ReturnToField);
}
static u32 GetWaldaPhraseInputCase(u8 *inputPtr)

View File

@ -51,7 +51,7 @@ gUnknown_03005DB0: @ 3005DB0
gUnknown_03005DB4: @ 3005DB4
.space 0x4
gUnknown_03005DB8: @ 3005DB8
gFieldLinkPlayerCount: @ 3005DB8
.space 0x8
gUnknown_03005DC0: @ 3005DC0