start working on battle transition

This commit is contained in:
DizzyEggg 2018-01-01 17:41:34 +01:00
parent ad277a69dd
commit ba176dfe07
12 changed files with 730 additions and 899 deletions

View File

@ -5,209 +5,8 @@
.text
thumb_func_start CB2_TestBattleTransition
CB2_TestBattleTransition: @ 8145E84
push {r4,lr}
ldr r4, =sTestingTransitionState
ldrb r0, [r4]
cmp r0, 0
beq _08145E98
cmp r0, 0x1
beq _08145EAC
b _08145EC0
.pool
_08145E98:
ldr r0, =sTestingTransitionId
ldrb r0, [r0]
bl LaunchBattleTransitionTask
ldrb r0, [r4]
adds r0, 0x1
strb r0, [r4]
b _08145EC0
.pool
_08145EAC:
bl IsBattleTransitionDone
lsls r0, 24
cmp r0, 0
beq _08145EC0
movs r0, 0
strb r0, [r4]
ldr r0, =c2_exit_to_overworld_2_switch
bl SetMainCallback2
_08145EC0:
bl RunTasks
bl AnimateSprites
bl BuildOamBuffer
bl UpdatePaletteFade
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end CB2_TestBattleTransition
thumb_func_start TestBattleTransition
TestBattleTransition: @ 8145EDC
push {lr}
ldr r1, =sTestingTransitionId
strb r0, [r1]
ldr r0, =CB2_TestBattleTransition
bl SetMainCallback2
pop {r0}
bx r0
.pool
thumb_func_end TestBattleTransition
thumb_func_start BattleTransition_StartOnField
BattleTransition_StartOnField: @ 8145EF4
push {lr}
lsls r0, 24
lsrs r0, 24
ldr r2, =gMain
ldr r1, =sub_8085E50
str r1, [r2, 0x4]
bl LaunchBattleTransitionTask
pop {r0}
bx r0
.pool
thumb_func_end BattleTransition_StartOnField
thumb_func_start BattleTransition_Start
BattleTransition_Start: @ 8145F10
push {lr}
lsls r0, 24
lsrs r0, 24
bl LaunchBattleTransitionTask
pop {r0}
bx r0
thumb_func_end BattleTransition_Start
thumb_func_start IsBattleTransitionDone
IsBattleTransitionDone: @ 8145F20
push {r4,lr}
ldr r0, =Task_BattleTransitionMain
bl FindTaskIdByFunc
lsls r0, 24
lsrs r2, r0, 24
ldr r1, =gTasks
lsls r0, r2, 2
adds r0, r2
lsls r0, 3
adds r0, r1
movs r1, 0x26
ldrsh r0, [r0, r1]
cmp r0, 0
bne _08145F4C
movs r0, 0
b _08145F60
.pool
_08145F4C:
adds r0, r2, 0
bl DestroyTask
ldr r4, =sTransitionStructPtr
ldr r0, [r4]
bl Free
movs r0, 0
str r0, [r4]
movs r0, 0x1
_08145F60:
pop {r4}
pop {r1}
bx r1
.pool
thumb_func_end IsBattleTransitionDone
thumb_func_start LaunchBattleTransitionTask
LaunchBattleTransitionTask: @ 8145F6C
push {r4,lr}
adds r4, r0, 0
lsls r4, 24
lsrs r4, 24
ldr r0, =Task_BattleTransitionMain
movs r1, 0x2
bl CreateTask
lsls r0, 24
lsrs r0, 24
ldr r2, =gTasks
lsls r1, r0, 2
adds r1, r0
lsls r1, 3
adds r1, r2
strh r4, [r1, 0xA]
ldr r4, =sTransitionStructPtr
movs r0, 0x3C
bl AllocZeroed
str r0, [r4]
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end LaunchBattleTransitionTask
thumb_func_start Task_BattleTransitionMain
Task_BattleTransitionMain: @ 8145FA8
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
ldr r5, =sMainTransitionPhases
ldr r2, =gTasks
lsls r1, r0, 2
adds r1, r0
lsls r1, 3
adds r4, r1, r2
_08145FBA:
movs r1, 0x8
ldrsh r0, [r4, r1]
lsls r0, 2
adds r0, r5
ldr r1, [r0]
adds r0, r4, 0
bl _call_via_r1
lsls r0, 24
cmp r0, 0
bne _08145FBA
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end Task_BattleTransitionMain
thumb_func_start sub_8145FE0
sub_8145FE0: @ 8145FE0
push {r4,lr}
adds r4, r0, 0
bl sub_80AC3D0
ldr r0, =gPlttBufferFaded
ldr r1, =gPlttBufferUnfaded
ldr r2, =0x04000100
bl CpuSet
ldr r1, =sPhase1_Tasks
movs r2, 0xA
ldrsh r0, [r4, r2]
lsls r0, 2
adds r0, r1
ldr r0, [r0]
cmp r0, 0
bne _0814601C
movs r0, 0x2
strh r0, [r4, 0x8]
movs r0, 0x1
b _0814602A
.pool
_0814601C:
movs r1, 0x4
bl CreateTask
ldrh r0, [r4, 0x8]
adds r0, 0x1
strh r0, [r4, 0x8]
movs r0, 0
_0814602A:
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_8145FE0
thumb_func_start sub_8146030
sub_8146030: @ 8146030
thumb_func_start Transition_WaitForPhase1
Transition_WaitForPhase1: @ 8146030
push {r4,lr}
adds r4, r0, 0
ldr r1, =sPhase1_Tasks
@ -233,10 +32,10 @@ _0814605C:
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_8146030
thumb_func_end Transition_WaitForPhase1
thumb_func_start sub_8146064
sub_8146064: @ 8146064
thumb_func_start Transition_Phase2
Transition_Phase2: @ 8146064
push {r4,lr}
adds r4, r0, 0
ldr r1, =sPhase2_Tasks
@ -255,10 +54,10 @@ sub_8146064: @ 8146064
pop {r1}
bx r1
.pool
thumb_func_end sub_8146064
thumb_func_end Transition_Phase2
thumb_func_start sub_814608C
sub_814608C: @ 814608C
thumb_func_start Transition_WaitForPhase2
Transition_WaitForPhase2: @ 814608C
push {r4,lr}
adds r4, r0, 0
movs r0, 0
@ -282,10 +81,10 @@ _081460B0:
pop {r1}
bx r1
.pool
thumb_func_end sub_814608C
thumb_func_end Transition_WaitForPhase2
thumb_func_start sub_81460BC
sub_81460BC: @ 81460BC
thumb_func_start Phase1Task_TransitionAll
Phase1Task_TransitionAll: @ 81460BC
push {r4,lr}
sub sp, 0x4
lsls r0, 24
@ -324,10 +123,10 @@ _08146104:
pop {r4}
pop {r0}
bx r0
thumb_func_end sub_81460BC
thumb_func_end Phase1Task_TransitionAll
thumb_func_start sub_814610C
sub_814610C: @ 814610C
thumb_func_start Phase2Task_Transition_Blur
Phase2Task_Transition_Blur: @ 814610C
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -352,7 +151,7 @@ _0814611E:
pop {r0}
bx r0
.pool
thumb_func_end sub_814610C
thumb_func_end Phase2Task_Transition_Blur
thumb_func_start sub_8146144
sub_8146144: @ 8146144
@ -441,7 +240,7 @@ sub_81461D8: @ 81461D8
ands r0, r1
cmp r0, 0
bne _081461F4
ldr r0, =sub_814610C
ldr r0, =Phase2Task_Transition_Blur
bl FindTaskIdByFunc
lsls r0, 24
lsrs r0, 24
@ -453,8 +252,8 @@ _081461F4:
.pool
thumb_func_end sub_81461D8
thumb_func_start sub_8146204
sub_8146204: @ 8146204
thumb_func_start Phase2Task_Transition_Swirl
Phase2Task_Transition_Swirl: @ 8146204
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -479,7 +278,7 @@ _08146216:
pop {r0}
bx r0
.pool
thumb_func_end sub_8146204
thumb_func_end Phase2Task_Transition_Swirl
thumb_func_start sub_814623C
sub_814623C: @ 814623C
@ -559,7 +358,7 @@ sub_81462A8: @ 81462A8
ands r0, r1
cmp r0, 0
bne _081462FA
ldr r0, =sub_8146204
ldr r0, =Phase2Task_Transition_Swirl
bl FindTaskIdByFunc
lsls r0, 24
lsrs r0, 24
@ -624,8 +423,8 @@ sub_8146358: @ 8146358
.pool
thumb_func_end sub_8146358
thumb_func_start sub_8146384
sub_8146384: @ 8146384
thumb_func_start Phase2Task_Transition_Shuffle
Phase2Task_Transition_Shuffle: @ 8146384
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -650,7 +449,7 @@ _08146396:
pop {r0}
bx r0
.pool
thumb_func_end sub_8146384
thumb_func_end Phase2Task_Transition_Shuffle
thumb_func_start sub_81463BC
sub_81463BC: @ 81463BC
@ -742,7 +541,7 @@ _08146448:
ands r0, r1
cmp r0, 0
bne _0814648E
ldr r0, =sub_8146384
ldr r0, =Phase2Task_Transition_Shuffle
bl FindTaskIdByFunc
lsls r0, 24
lsrs r0, 24
@ -806,8 +605,8 @@ sub_81464E8: @ 81464E8
.pool
thumb_func_end sub_81464E8
thumb_func_start sub_8146514
sub_8146514: @ 8146514
thumb_func_start Phase2Task_Transition_BigPokeball
Phase2Task_Transition_BigPokeball: @ 8146514
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -832,10 +631,10 @@ _08146526:
pop {r0}
bx r0
.pool
thumb_func_end sub_8146514
thumb_func_end Phase2Task_Transition_BigPokeball
thumb_func_start sub_814654C
sub_814654C: @ 814654C
thumb_func_start Phase2Task_Transition_Aqua
Phase2Task_Transition_Aqua: @ 814654C
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -860,10 +659,10 @@ _0814655E:
pop {r0}
bx r0
.pool
thumb_func_end sub_814654C
thumb_func_end Phase2Task_Transition_Aqua
thumb_func_start sub_8146584
sub_8146584: @ 8146584
thumb_func_start Phase2Task_Transition_Magma
Phase2Task_Transition_Magma: @ 8146584
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -888,10 +687,10 @@ _08146596:
pop {r0}
bx r0
.pool
thumb_func_end sub_8146584
thumb_func_end Phase2Task_Transition_Magma
thumb_func_start sub_81465BC
sub_81465BC: @ 81465BC
thumb_func_start Phase2Task_Transition_Regice
Phase2Task_Transition_Regice: @ 81465BC
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -916,10 +715,10 @@ _081465CE:
pop {r0}
bx r0
.pool
thumb_func_end sub_81465BC
thumb_func_end Phase2Task_Transition_Regice
thumb_func_start sub_81465F4
sub_81465F4: @ 81465F4
thumb_func_start Phase2Task_Transition_Registeel
Phase2Task_Transition_Registeel: @ 81465F4
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -944,10 +743,10 @@ _08146606:
pop {r0}
bx r0
.pool
thumb_func_end sub_81465F4
thumb_func_end Phase2Task_Transition_Registeel
thumb_func_start sub_814662C
sub_814662C: @ 814662C
thumb_func_start Phase2Task_Transition_Regirock
Phase2Task_Transition_Regirock: @ 814662C
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -972,10 +771,10 @@ _0814663E:
pop {r0}
bx r0
.pool
thumb_func_end sub_814662C
thumb_func_end Phase2Task_Transition_Regirock
thumb_func_start sub_8146664
sub_8146664: @ 8146664
thumb_func_start Phase2Task_Transition_Kyogre
Phase2Task_Transition_Kyogre: @ 8146664
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -1000,7 +799,7 @@ _08146676:
pop {r0}
bx r0
.pool
thumb_func_end sub_8146664
thumb_func_end Phase2Task_Transition_Kyogre
thumb_func_start sub_814669C
sub_814669C: @ 814669C
@ -2069,8 +1868,8 @@ sub_8146F68: @ 8146F68
.pool
thumb_func_end sub_8146F68
thumb_func_start sub_8146F94
sub_8146F94: @ 8146F94
thumb_func_start Phase2Task_Transition_PokeballsTrail
Phase2Task_Transition_PokeballsTrail: @ 8146F94
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -2095,7 +1894,7 @@ _08146FA6:
pop {r0}
bx r0
.pool
thumb_func_end sub_8146F94
thumb_func_end Phase2Task_Transition_PokeballsTrail
thumb_func_start sub_8146FCC
sub_8146FCC: @ 8146FCC
@ -2205,7 +2004,7 @@ sub_81470A4: @ 81470A4
cmp r0, 0
bne _081470C4
bl sub_8149F84
ldr r0, =sub_8146F94
ldr r0, =Phase2Task_Transition_PokeballsTrail
bl FindTaskIdByFunc
lsls r0, 24
lsrs r0, 24
@ -2365,8 +2164,8 @@ _081471F2:
.pool
thumb_func_end sub_814713C
thumb_func_start sub_8147204
sub_8147204: @ 8147204
thumb_func_start Phase2Task_Transition_Clockwise_BlackFade
Phase2Task_Transition_Clockwise_BlackFade: @ 8147204
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -2391,7 +2190,7 @@ _08147216:
pop {r0}
bx r0
.pool
thumb_func_end sub_8147204
thumb_func_end Phase2Task_Transition_Clockwise_BlackFade
thumb_func_start sub_814723C
sub_814723C: @ 814723C
@ -2923,7 +2722,7 @@ sub_8147648: @ 8147648
strh r0, [r1, 0xA]
ldrh r0, [r1, 0xA]
bl sub_8149F84
ldr r0, =sub_8147204
ldr r0, =Phase2Task_Transition_Clockwise_BlackFade
bl FindTaskIdByFunc
lsls r0, 24
lsrs r0, 24
@ -2992,8 +2791,8 @@ _081476C0:
.pool
thumb_func_end sub_8147688
thumb_func_start sub_8147718
sub_8147718: @ 8147718
thumb_func_start Phase2Task_Transition_Ripple
Phase2Task_Transition_Ripple: @ 8147718
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -3018,7 +2817,7 @@ _0814772A:
pop {r0}
bx r0
.pool
thumb_func_end sub_8147718
thumb_func_end Phase2Task_Transition_Ripple
thumb_func_start sub_8147750
sub_8147750: @ 8147750
@ -3141,7 +2940,7 @@ _08147838:
ands r0, r1
cmp r0, 0
bne _0814785A
ldr r0, =sub_8147718
ldr r0, =Phase2Task_Transition_Ripple
bl FindTaskIdByFunc
lsls r0, 24
lsrs r0, 24
@ -3209,8 +3008,8 @@ sub_81478C0: @ 81478C0
.pool
thumb_func_end sub_81478C0
thumb_func_start sub_81478EC
sub_81478EC: @ 81478EC
thumb_func_start Phase2Task_Transition_Wave
Phase2Task_Transition_Wave: @ 81478EC
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -3235,7 +3034,7 @@ _081478FE:
pop {r0}
bx r0
.pool
thumb_func_end sub_81478EC
thumb_func_end Phase2Task_Transition_Wave
thumb_func_start sub_8147924
sub_8147924: @ 8147924
@ -3373,7 +3172,7 @@ sub_8147A18: @ 8147A18
strh r0, [r1, 0xA]
ldrh r0, [r1, 0xA]
bl sub_8149F84
ldr r0, =sub_81478EC
ldr r0, =Phase2Task_Transition_Wave
bl FindTaskIdByFunc
lsls r0, 24
lsrs r0, 24
@ -3437,8 +3236,8 @@ _08147A90:
.pool
thumb_func_end sub_8147A58
thumb_func_start sub_8147AE4
sub_8147AE4: @ 8147AE4
thumb_func_start Phase2Task_Transition_Sydney
Phase2Task_Transition_Sydney: @ 8147AE4
push {lr}
lsls r0, 24
lsrs r0, 24
@ -3453,10 +3252,10 @@ sub_8147AE4: @ 8147AE4
pop {r0}
bx r0
.pool
thumb_func_end sub_8147AE4
thumb_func_end Phase2Task_Transition_Sydney
thumb_func_start sub_8147B04
sub_8147B04: @ 8147B04
thumb_func_start Phase2Task_Transition_Phoebe
Phase2Task_Transition_Phoebe: @ 8147B04
push {lr}
lsls r0, 24
lsrs r0, 24
@ -3471,10 +3270,10 @@ sub_8147B04: @ 8147B04
pop {r0}
bx r0
.pool
thumb_func_end sub_8147B04
thumb_func_end Phase2Task_Transition_Phoebe
thumb_func_start sub_8147B24
sub_8147B24: @ 8147B24
thumb_func_start Phase2Task_Transition_Glacia
Phase2Task_Transition_Glacia: @ 8147B24
push {lr}
lsls r0, 24
lsrs r0, 24
@ -3489,10 +3288,10 @@ sub_8147B24: @ 8147B24
pop {r0}
bx r0
.pool
thumb_func_end sub_8147B24
thumb_func_end Phase2Task_Transition_Glacia
thumb_func_start sub_8147B44
sub_8147B44: @ 8147B44
thumb_func_start Phase2Task_Transition_Drake
Phase2Task_Transition_Drake: @ 8147B44
push {lr}
lsls r0, 24
lsrs r0, 24
@ -3507,10 +3306,10 @@ sub_8147B44: @ 8147B44
pop {r0}
bx r0
.pool
thumb_func_end sub_8147B44
thumb_func_end Phase2Task_Transition_Drake
thumb_func_start sub_8147B64
sub_8147B64: @ 8147B64
thumb_func_start Phase2Task_Transition_Wallace
Phase2Task_Transition_Wallace: @ 8147B64
push {lr}
lsls r0, 24
lsrs r0, 24
@ -3525,7 +3324,7 @@ sub_8147B64: @ 8147B64
pop {r0}
bx r0
.pool
thumb_func_end sub_8147B64
thumb_func_end Phase2Task_Transition_Wallace
thumb_func_start sub_8147B84
sub_8147B84: @ 8147B84
@ -4664,8 +4463,8 @@ sub_81484B8: @ 81484B8
.pool
thumb_func_end sub_81484B8
thumb_func_start sub_81484D0
sub_81484D0: @ 81484D0
thumb_func_start Phase2Task_Transition_Slice
Phase2Task_Transition_Slice: @ 81484D0
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -4690,7 +4489,7 @@ _081484E2:
pop {r0}
bx r0
.pool
thumb_func_end sub_81484D0
thumb_func_end Phase2Task_Transition_Slice
thumb_func_start sub_8148508
sub_8148508: @ 8148508
@ -4873,7 +4672,7 @@ sub_814865C: @ 814865C
strh r0, [r1, 0xA]
ldrh r0, [r1, 0xA]
bl sub_8149F84
ldr r0, =sub_81484D0
ldr r0, =Phase2Task_Transition_Slice
bl FindTaskIdByFunc
lsls r0, 24
lsrs r0, 24
@ -4963,8 +4762,8 @@ _0814874E:
.pool
thumb_func_end sub_8148728
thumb_func_start sub_8148760
sub_8148760: @ 8148760
thumb_func_start Phase2Task_Transition_25
Phase2Task_Transition_25: @ 8148760
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -4989,7 +4788,7 @@ _08148772:
pop {r0}
bx r0
.pool
thumb_func_end sub_8148760
thumb_func_end Phase2Task_Transition_25
thumb_func_start sub_8148798
sub_8148798: @ 8148798
@ -5442,7 +5241,7 @@ sub_8148B14: @ 8148B14
strh r0, [r1, 0xA]
ldrh r0, [r1, 0xA]
bl sub_8149F84
ldr r0, =sub_8148760
ldr r0, =Phase2Task_Transition_25
bl FindTaskIdByFunc
lsls r0, 24
lsrs r0, 24
@ -5453,8 +5252,8 @@ sub_8148B14: @ 8148B14
.pool
thumb_func_end sub_8148B14
thumb_func_start sub_8148B54
sub_8148B54: @ 8148B54
thumb_func_start Phase2Task_Transition_26
Phase2Task_Transition_26: @ 8148B54
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -5479,10 +5278,10 @@ _08148B66:
pop {r0}
bx r0
.pool
thumb_func_end sub_8148B54
thumb_func_end Phase2Task_Transition_26
thumb_func_start sub_8148B8C
sub_8148B8C: @ 8148B8C
thumb_func_start Phase2Task_Transition_27
Phase2Task_Transition_27: @ 8148B8C
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -5507,7 +5306,7 @@ _08148B9E:
pop {r0}
bx r0
.pool
thumb_func_end sub_8148B8C
thumb_func_end Phase2Task_Transition_27
thumb_func_start sub_8148BC4
sub_8148BC4: @ 8148BC4
@ -5819,8 +5618,8 @@ _08148E3C:
.pool
thumb_func_end sub_8148D6C
thumb_func_start sub_8148E54
sub_8148E54: @ 8148E54
thumb_func_start Phase2Task_Transition_28
Phase2Task_Transition_28: @ 8148E54
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -5845,7 +5644,7 @@ _08148E66:
pop {r0}
bx r0
.pool
thumb_func_end sub_8148E54
thumb_func_end Phase2Task_Transition_28
thumb_func_start sub_8148E8C
sub_8148E8C: @ 8148E8C
@ -6187,8 +5986,8 @@ _08149138:
bx r1
thumb_func_end sub_8149048
thumb_func_start sub_8149140
sub_8149140: @ 8149140
thumb_func_start Phase2Task_Transition_Groudon
Phase2Task_Transition_Groudon: @ 8149140
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -6213,7 +6012,7 @@ _08149152:
pop {r0}
bx r0
.pool
thumb_func_end sub_8149140
thumb_func_end Phase2Task_Transition_Groudon
thumb_func_start sub_8149178
sub_8149178: @ 8149178
@ -6341,8 +6140,8 @@ _0814926E:
.pool
thumb_func_end sub_8149224
thumb_func_start sub_814927C
sub_814927C: @ 814927C
thumb_func_start Phase2Task_Transition_Rayquaza
Phase2Task_Transition_Rayquaza: @ 814927C
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -6367,7 +6166,7 @@ _0814928E:
pop {r0}
bx r0
.pool
thumb_func_end sub_814927C
thumb_func_end Phase2Task_Transition_Rayquaza
thumb_func_start sub_81492B4
sub_81492B4: @ 81492B4
@ -6695,8 +6494,8 @@ _08149554:
.pool
thumb_func_end sub_8149508
thumb_func_start sub_8149578
sub_8149578: @ 8149578
thumb_func_start Phase2Task_Transition_WhiteFade
Phase2Task_Transition_WhiteFade: @ 8149578
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -6721,7 +6520,7 @@ _0814958A:
pop {r0}
bx r0
.pool
thumb_func_end sub_8149578
thumb_func_end Phase2Task_Transition_WhiteFade
thumb_func_start sub_81495B0
sub_81495B0: @ 81495B0
@ -6916,7 +6715,7 @@ sub_8149740: @ 8149740
cmp r0, 0x10
bls _08149766
bl sub_8149F84
ldr r0, =sub_8149578
ldr r0, =Phase2Task_Transition_WhiteFade
bl FindTaskIdByFunc
lsls r0, 24
lsrs r0, 24
@ -7158,8 +6957,8 @@ _0814994C:
.pool
thumb_func_end sub_8149864
thumb_func_start sub_814995C
sub_814995C: @ 814995C
thumb_func_start Phase2Task_Transition_GridSquares
Phase2Task_Transition_GridSquares: @ 814995C
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -7184,7 +6983,7 @@ _0814996E:
pop {r0}
bx r0
.pool
thumb_func_end sub_814995C
thumb_func_end Phase2Task_Transition_GridSquares
thumb_func_start sub_8149994
sub_8149994: @ 8149994
@ -7277,7 +7076,7 @@ sub_8149A40: @ 8149A40
cmp r1, 0
bne _08149A60
bl sub_8149F84
ldr r0, =sub_814995C
ldr r0, =Phase2Task_Transition_GridSquares
bl FindTaskIdByFunc
lsls r0, 24
lsrs r0, 24
@ -7289,8 +7088,8 @@ _08149A60:
.pool
thumb_func_end sub_8149A40
thumb_func_start sub_8149A6C
sub_8149A6C: @ 8149A6C
thumb_func_start Phase2Task_Transition_Shards
Phase2Task_Transition_Shards: @ 8149A6C
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -7315,7 +7114,7 @@ _08149A7E:
pop {r0}
bx r0
.pool
thumb_func_end sub_8149A6C
thumb_func_end Phase2Task_Transition_Shards
thumb_func_start sub_8149AA4
sub_8149AA4: @ 8149AA4
@ -7559,7 +7358,7 @@ sub_8149C60: @ 8149C60
strh r0, [r1, 0xA]
ldrh r0, [r1, 0xA]
bl sub_8149F84
ldr r0, =sub_8149A6C
ldr r0, =Phase2Task_Transition_Shards
bl FindTaskIdByFunc
lsls r0, 24
lsrs r0, 24
@ -8511,8 +8310,8 @@ sub_814A374: @ 814A374
.pool
thumb_func_end sub_814A374
thumb_func_start sub_814A3BC
sub_814A3BC: @ 814A3BC
thumb_func_start Phase2Task_Transition_29
Phase2Task_Transition_29: @ 814A3BC
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -8537,10 +8336,10 @@ _0814A3CE:
pop {r0}
bx r0
.pool
thumb_func_end sub_814A3BC
thumb_func_end Phase2Task_Transition_29
thumb_func_start sub_814A3F4
sub_814A3F4: @ 814A3F4
thumb_func_start Phase2Task_Transition_30
Phase2Task_Transition_30: @ 814A3F4
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -8565,7 +8364,7 @@ _0814A406:
pop {r0}
bx r0
.pool
thumb_func_end sub_814A3F4
thumb_func_end Phase2Task_Transition_30
thumb_func_start sub_814A42C
sub_814A42C: @ 814A42C
@ -8815,7 +8614,7 @@ _0814A632:
ands r0, r1
cmp r0, 0
bne _0814A654
ldr r0, =sub_814A3F4
ldr r0, =Phase2Task_Transition_30
bl FindTaskIdByFunc
lsls r0, 24
lsrs r0, 24
@ -8888,8 +8687,8 @@ sub_814A6CC: @ 814A6CC
.pool
thumb_func_end sub_814A6CC
thumb_func_start sub_814A6F0
sub_814A6F0: @ 814A6F0
thumb_func_start Phase2Task_Transition_31
Phase2Task_Transition_31: @ 814A6F0
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -8914,10 +8713,10 @@ _0814A702:
pop {r0}
bx r0
.pool
thumb_func_end sub_814A6F0
thumb_func_end Phase2Task_Transition_31
thumb_func_start sub_814A728
sub_814A728: @ 814A728
thumb_func_start Phase2Task_Transition_33
Phase2Task_Transition_33: @ 814A728
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -8942,10 +8741,10 @@ _0814A73A:
pop {r0}
bx r0
.pool
thumb_func_end sub_814A728
thumb_func_end Phase2Task_Transition_33
thumb_func_start sub_814A760
sub_814A760: @ 814A760
thumb_func_start Phase2Task_Transition_32
Phase2Task_Transition_32: @ 814A760
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -8970,7 +8769,7 @@ _0814A772:
pop {r0}
bx r0
.pool
thumb_func_end sub_814A760
thumb_func_end Phase2Task_Transition_32
thumb_func_start sub_814A798
sub_814A798: @ 814A798

View File

@ -3055,9 +3055,9 @@ _08085E18:
.pool
thumb_func_end c1_overworld
thumb_func_start c2_overworld_basic
@ void c2_overworld_basic()
c2_overworld_basic: @ 8085E24
thumb_func_start OverworldBasic
@ void OverworldBasic()
OverworldBasic: @ 8085E24
push {lr}
bl ScriptContext2_RunScript
bl RunTasks
@ -3070,15 +3070,15 @@ c2_overworld_basic: @ 8085E24
bl do_scheduled_bg_tilemap_copies_to_vram
pop {r0}
bx r0
thumb_func_end c2_overworld_basic
thumb_func_end OverworldBasic
thumb_func_start sub_8085E50
sub_8085E50: @ 8085E50
thumb_func_start CB2_OverworldBasic
CB2_OverworldBasic: @ 8085E50
push {lr}
bl c2_overworld_basic
bl OverworldBasic
pop {r0}
bx r0
thumb_func_end sub_8085E50
thumb_func_end CB2_OverworldBasic
thumb_func_start c2_overworld
c2_overworld: @ 8085E5C
@ -3092,7 +3092,7 @@ c2_overworld: @ 8085E5C
movs r0, 0
bl SetVBlankCallback
_08085E70:
bl c2_overworld_basic
bl OverworldBasic
cmp r4, 0
beq _08085E7C
bl SetFieldVBlankCallback

View File

@ -24,8 +24,8 @@ _081DABD2:
bx r1
thumb_func_end sub_81DABBC
thumb_func_start sub_81DABDC
sub_81DABDC: @ 81DABDC
thumb_func_start Phase2Task_Transition_34
Phase2Task_Transition_34: @ 81DABDC
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -50,7 +50,7 @@ _081DABEE:
pop {r0}
bx r0
.pool
thumb_func_end sub_81DABDC
thumb_func_end Phase2Task_Transition_34
thumb_func_start sub_81DAC14
sub_81DAC14: @ 81DAC14
@ -119,7 +119,7 @@ sub_81DAC80: @ 81DAC80
bne _081DACA4
adds r0, r2, 0
bl sub_81DAA20
ldr r0, =sub_81DABDC
ldr r0, =Phase2Task_Transition_34
bl FindTaskIdByFunc
lsls r0, 24
lsrs r0, 24
@ -131,8 +131,8 @@ _081DACA4:
.pool
thumb_func_end sub_81DAC80
thumb_func_start sub_81DACB4
sub_81DACB4: @ 81DACB4
thumb_func_start Phase2Task_Transition_35
Phase2Task_Transition_35: @ 81DACB4
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -157,7 +157,7 @@ _081DACC6:
pop {r0}
bx r0
.pool
thumb_func_end sub_81DACB4
thumb_func_end Phase2Task_Transition_35
thumb_func_start sub_81DACEC
sub_81DACEC: @ 81DACEC
@ -226,7 +226,7 @@ sub_81DAD58: @ 81DAD58
bne _081DAD7C
adds r0, r2, 0
bl sub_81DAA20
ldr r0, =sub_81DACB4
ldr r0, =Phase2Task_Transition_35
bl FindTaskIdByFunc
lsls r0, 24
lsrs r0, 24
@ -238,8 +238,8 @@ _081DAD7C:
.pool
thumb_func_end sub_81DAD58
thumb_func_start sub_81DAD8C
sub_81DAD8C: @ 81DAD8C
thumb_func_start Phase2Task_Transition_36
Phase2Task_Transition_36: @ 81DAD8C
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -264,7 +264,7 @@ _081DAD9E:
pop {r0}
bx r0
.pool
thumb_func_end sub_81DAD8C
thumb_func_end Phase2Task_Transition_36
thumb_func_start sub_81DADC4
sub_81DADC4: @ 81DADC4
@ -342,7 +342,7 @@ sub_81DAE44: @ 81DAE44
bne _081DAE68
adds r0, r2, 0
bl sub_81DAA20
ldr r0, =sub_81DAD8C
ldr r0, =Phase2Task_Transition_36
bl FindTaskIdByFunc
lsls r0, 24
lsrs r0, 24
@ -354,8 +354,8 @@ _081DAE68:
.pool
thumb_func_end sub_81DAE44
thumb_func_start sub_81DAE78
sub_81DAE78: @ 81DAE78
thumb_func_start Phase2Task_Transition_37
Phase2Task_Transition_37: @ 81DAE78
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -380,7 +380,7 @@ _081DAE8A:
pop {r0}
bx r0
.pool
thumb_func_end sub_81DAE78
thumb_func_end Phase2Task_Transition_37
thumb_func_start sub_81DAEB0
sub_81DAEB0: @ 81DAEB0
@ -460,7 +460,7 @@ sub_81DAF34: @ 81DAF34
bne _081DAF58
adds r0, r2, 0
bl sub_81DAA20
ldr r0, =sub_81DAE78
ldr r0, =Phase2Task_Transition_37
bl FindTaskIdByFunc
lsls r0, 24
lsrs r0, 24
@ -472,8 +472,8 @@ _081DAF58:
.pool
thumb_func_end sub_81DAF34
thumb_func_start sub_81DAF68
sub_81DAF68: @ 81DAF68
thumb_func_start Phase2Task_Transition_38
Phase2Task_Transition_38: @ 81DAF68
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -498,7 +498,7 @@ _081DAF7A:
pop {r0}
bx r0
.pool
thumb_func_end sub_81DAF68
thumb_func_end Phase2Task_Transition_38
thumb_func_start sub_81DAFA0
sub_81DAFA0: @ 81DAFA0
@ -585,7 +585,7 @@ sub_81DB02C: @ 81DB02C
bne _081DB050
adds r0, r2, 0
bl sub_81DAA20
ldr r0, =sub_81DAF68
ldr r0, =Phase2Task_Transition_38
bl FindTaskIdByFunc
lsls r0, 24
lsrs r0, 24
@ -597,8 +597,8 @@ _081DB050:
.pool
thumb_func_end sub_81DB02C
thumb_func_start sub_81DB060
sub_81DB060: @ 81DB060
thumb_func_start Phase2Task_Transition_39
Phase2Task_Transition_39: @ 81DB060
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -623,7 +623,7 @@ _081DB072:
pop {r0}
bx r0
.pool
thumb_func_end sub_81DB060
thumb_func_end Phase2Task_Transition_39
thumb_func_start sub_81DB098
sub_81DB098: @ 81DB098
@ -710,7 +710,7 @@ sub_81DB124: @ 81DB124
bne _081DB148
adds r0, r2, 0
bl sub_81DAA20
ldr r0, =sub_81DB060
ldr r0, =Phase2Task_Transition_39
bl FindTaskIdByFunc
lsls r0, 24
lsrs r0, 24
@ -722,4 +722,264 @@ _081DB148:
.pool
thumb_func_end sub_81DB124
thumb_func_start Phase2Task_Transition_40
Phase2Task_Transition_40: @ 81DB158
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
ldr r5, =gUnknown_0862B7E8
ldr r2, =gTasks
lsls r1, r0, 2
adds r1, r0
lsls r1, 3
adds r4, r1, r2
_081DB16A:
movs r1, 0x8
ldrsh r0, [r4, r1]
lsls r0, 2
adds r0, r5
ldr r1, [r0]
adds r0, r4, 0
bl _call_via_r1
lsls r0, 24
cmp r0, 0
bne _081DB16A
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end Phase2Task_Transition_40
thumb_func_start sub_81DB190
sub_81DB190: @ 81DB190
push {r4,lr}
sub sp, 0x10
adds r4, r0, 0
movs r0, 0xA
ldrsh r1, [r4, r0]
cmp r1, 0
bne _081DB1BE
movs r0, 0x80
str r0, [sp]
str r1, [sp, 0x4]
subs r0, 0x84
str r0, [sp, 0x8]
str r1, [sp, 0xC]
movs r0, 0x78
movs r1, 0x2D
movs r2, 0xC
movs r3, 0x4
bl sub_81DA8BC
lsls r0, 24
lsrs r0, 24
strh r0, [r4, 0x10]
b _081DB212
_081DB1BE:
cmp r1, 0x10
bne _081DB1E6
movs r0, 0x80
str r0, [sp]
movs r0, 0
str r0, [sp, 0x4]
subs r0, 0x4
str r0, [sp, 0x8]
movs r0, 0x1
str r0, [sp, 0xC]
movs r0, 0x59
movs r1, 0x61
movs r2, 0xFC
movs r3, 0x4
bl sub_81DA8BC
lsls r0, 24
lsrs r0, 24
strh r0, [r4, 0x12]
b _081DB212
_081DB1E6:
cmp r1, 0x20
bne _081DB212
movs r0, 0x80
str r0, [sp]
movs r0, 0
str r0, [sp, 0x4]
subs r0, 0x4
str r0, [sp, 0x8]
movs r0, 0x2
str r0, [sp, 0xC]
movs r0, 0x97
movs r1, 0x61
movs r2, 0x84
movs r3, 0x4
bl sub_81DA8BC
lsls r0, 24
lsrs r0, 24
strh r0, [r4, 0x14]
ldrh r0, [r4, 0x8]
adds r0, 0x1
strh r0, [r4, 0x8]
_081DB212:
ldrh r0, [r4, 0xA]
adds r0, 0x1
strh r0, [r4, 0xA]
movs r0, 0
add sp, 0x10
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_81DB190
thumb_func_start sub_81DB224
sub_81DB224: @ 81DB224
push {lr}
adds r2, r0, 0
ldr r0, =gPaletteFade
ldrb r1, [r0, 0x7]
movs r0, 0x80
ands r0, r1
cmp r0, 0
bne _081DB248
adds r0, r2, 0
bl sub_81DAA20
ldr r0, =Phase2Task_Transition_40
bl FindTaskIdByFunc
lsls r0, 24
lsrs r0, 24
bl DestroyTask
_081DB248:
movs r0, 0
pop {r1}
bx r1
.pool
thumb_func_end sub_81DB224
thumb_func_start Phase2Task_Transition_41
Phase2Task_Transition_41: @ 81DB258
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
ldr r5, =gUnknown_0862B7FC
ldr r2, =gTasks
lsls r1, r0, 2
adds r1, r0
lsls r1, 3
adds r4, r1, r2
_081DB26A:
movs r1, 0x8
ldrsh r0, [r4, r1]
lsls r0, 2
adds r0, r5
ldr r1, [r0]
adds r0, r4, 0
bl _call_via_r1
lsls r0, 24
cmp r0, 0
bne _081DB26A
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end Phase2Task_Transition_41
thumb_func_start sub_81DB290
sub_81DB290: @ 81DB290
push {r4,lr}
sub sp, 0x10
adds r4, r0, 0
movs r0, 0xA
ldrsh r1, [r4, r0]
cmp r1, 0
bne _081DB2C2
movs r2, 0x8E
lsls r2, 1
movs r0, 0x83
str r0, [sp]
movs r0, 0x23
str r0, [sp, 0x4]
subs r0, 0x26
str r0, [sp, 0x8]
str r1, [sp, 0xC]
movs r0, 0x78
movs r1, 0x50
movs r3, 0x8
bl sub_81DA8BC
lsls r0, 24
lsrs r0, 24
strh r0, [r4, 0x10]
b _081DB316
_081DB2C2:
cmp r1, 0x10
bne _081DB2EA
movs r0, 0x83
str r0, [sp]
movs r0, 0x23
str r0, [sp, 0x4]
subs r0, 0x26
str r0, [sp, 0x8]
movs r0, 0x1
str r0, [sp, 0xC]
movs r0, 0x78
movs r1, 0x50
movs r2, 0x2C
movs r3, 0x8
bl sub_81DA8BC
lsls r0, 24
lsrs r0, 24
strh r0, [r4, 0x12]
b _081DB316
_081DB2EA:
cmp r1, 0x20
bne _081DB316
movs r0, 0x83
str r0, [sp]
movs r0, 0x23
str r0, [sp, 0x4]
subs r0, 0x26
str r0, [sp, 0x8]
movs r0, 0x2
str r0, [sp, 0xC]
movs r0, 0x79
movs r1, 0x50
movs r2, 0xA4
movs r3, 0x8
bl sub_81DA8BC
lsls r0, 24
lsrs r0, 24
strh r0, [r4, 0x14]
ldrh r0, [r4, 0x8]
adds r0, 0x1
strh r0, [r4, 0x8]
_081DB316:
ldrh r0, [r4, 0xA]
adds r0, 0x1
strh r0, [r4, 0xA]
movs r0, 0
add sp, 0x10
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_81DB290
thumb_func_start sub_81DB328
sub_81DB328: @ 81DB328
push {lr}
adds r2, r0, 0
ldr r0, =gPaletteFade
ldrb r1, [r0, 0x7]
movs r0, 0x80
ands r0, r1
cmp r0, 0
bne _081DB34C
adds r0, r2, 0
bl sub_81DAA20
ldr r0, =Phase2Task_Transition_41
bl FindTaskIdByFunc
lsls r0, 24
lsrs r0, 24
bl DestroyTask
_081DB34C:
movs r0, 0
pop {r1}
bx r1
.pool
thumb_func_end sub_81DB328
.align 2, 0 @ Don't pad with nop.

View File

@ -1,268 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start sub_81DB158
sub_81DB158: @ 81DB158
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
ldr r5, =gUnknown_0862B7E8
ldr r2, =gTasks
lsls r1, r0, 2
adds r1, r0
lsls r1, 3
adds r4, r1, r2
_081DB16A:
movs r1, 0x8
ldrsh r0, [r4, r1]
lsls r0, 2
adds r0, r5
ldr r1, [r0]
adds r0, r4, 0
bl _call_via_r1
lsls r0, 24
cmp r0, 0
bne _081DB16A
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end sub_81DB158
thumb_func_start sub_81DB190
sub_81DB190: @ 81DB190
push {r4,lr}
sub sp, 0x10
adds r4, r0, 0
movs r0, 0xA
ldrsh r1, [r4, r0]
cmp r1, 0
bne _081DB1BE
movs r0, 0x80
str r0, [sp]
str r1, [sp, 0x4]
subs r0, 0x84
str r0, [sp, 0x8]
str r1, [sp, 0xC]
movs r0, 0x78
movs r1, 0x2D
movs r2, 0xC
movs r3, 0x4
bl sub_81DA8BC
lsls r0, 24
lsrs r0, 24
strh r0, [r4, 0x10]
b _081DB212
_081DB1BE:
cmp r1, 0x10
bne _081DB1E6
movs r0, 0x80
str r0, [sp]
movs r0, 0
str r0, [sp, 0x4]
subs r0, 0x4
str r0, [sp, 0x8]
movs r0, 0x1
str r0, [sp, 0xC]
movs r0, 0x59
movs r1, 0x61
movs r2, 0xFC
movs r3, 0x4
bl sub_81DA8BC
lsls r0, 24
lsrs r0, 24
strh r0, [r4, 0x12]
b _081DB212
_081DB1E6:
cmp r1, 0x20
bne _081DB212
movs r0, 0x80
str r0, [sp]
movs r0, 0
str r0, [sp, 0x4]
subs r0, 0x4
str r0, [sp, 0x8]
movs r0, 0x2
str r0, [sp, 0xC]
movs r0, 0x97
movs r1, 0x61
movs r2, 0x84
movs r3, 0x4
bl sub_81DA8BC
lsls r0, 24
lsrs r0, 24
strh r0, [r4, 0x14]
ldrh r0, [r4, 0x8]
adds r0, 0x1
strh r0, [r4, 0x8]
_081DB212:
ldrh r0, [r4, 0xA]
adds r0, 0x1
strh r0, [r4, 0xA]
movs r0, 0
add sp, 0x10
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_81DB190
thumb_func_start sub_81DB224
sub_81DB224: @ 81DB224
push {lr}
adds r2, r0, 0
ldr r0, =gPaletteFade
ldrb r1, [r0, 0x7]
movs r0, 0x80
ands r0, r1
cmp r0, 0
bne _081DB248
adds r0, r2, 0
bl sub_81DAA20
ldr r0, =sub_81DB158
bl FindTaskIdByFunc
lsls r0, 24
lsrs r0, 24
bl DestroyTask
_081DB248:
movs r0, 0
pop {r1}
bx r1
.pool
thumb_func_end sub_81DB224
thumb_func_start sub_81DB258
sub_81DB258: @ 81DB258
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
ldr r5, =gUnknown_0862B7FC
ldr r2, =gTasks
lsls r1, r0, 2
adds r1, r0
lsls r1, 3
adds r4, r1, r2
_081DB26A:
movs r1, 0x8
ldrsh r0, [r4, r1]
lsls r0, 2
adds r0, r5
ldr r1, [r0]
adds r0, r4, 0
bl _call_via_r1
lsls r0, 24
cmp r0, 0
bne _081DB26A
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end sub_81DB258
thumb_func_start sub_81DB290
sub_81DB290: @ 81DB290
push {r4,lr}
sub sp, 0x10
adds r4, r0, 0
movs r0, 0xA
ldrsh r1, [r4, r0]
cmp r1, 0
bne _081DB2C2
movs r2, 0x8E
lsls r2, 1
movs r0, 0x83
str r0, [sp]
movs r0, 0x23
str r0, [sp, 0x4]
subs r0, 0x26
str r0, [sp, 0x8]
str r1, [sp, 0xC]
movs r0, 0x78
movs r1, 0x50
movs r3, 0x8
bl sub_81DA8BC
lsls r0, 24
lsrs r0, 24
strh r0, [r4, 0x10]
b _081DB316
_081DB2C2:
cmp r1, 0x10
bne _081DB2EA
movs r0, 0x83
str r0, [sp]
movs r0, 0x23
str r0, [sp, 0x4]
subs r0, 0x26
str r0, [sp, 0x8]
movs r0, 0x1
str r0, [sp, 0xC]
movs r0, 0x78
movs r1, 0x50
movs r2, 0x2C
movs r3, 0x8
bl sub_81DA8BC
lsls r0, 24
lsrs r0, 24
strh r0, [r4, 0x12]
b _081DB316
_081DB2EA:
cmp r1, 0x20
bne _081DB316
movs r0, 0x83
str r0, [sp]
movs r0, 0x23
str r0, [sp, 0x4]
subs r0, 0x26
str r0, [sp, 0x8]
movs r0, 0x2
str r0, [sp, 0xC]
movs r0, 0x79
movs r1, 0x50
movs r2, 0xA4
movs r3, 0x8
bl sub_81DA8BC
lsls r0, 24
lsrs r0, 24
strh r0, [r4, 0x14]
ldrh r0, [r4, 0x8]
adds r0, 0x1
strh r0, [r4, 0x8]
_081DB316:
ldrh r0, [r4, 0xA]
adds r0, 0x1
strh r0, [r4, 0xA]
movs r0, 0
add sp, 0x10
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_81DB290
thumb_func_start sub_81DB328
sub_81DB328: @ 81DB328
push {lr}
adds r2, r0, 0
ldr r0, =gPaletteFade
ldrb r1, [r0, 0x7]
movs r0, 0x80
ands r0, r1
cmp r0, 0
bne _081DB34C
adds r0, r2, 0
bl sub_81DAA20
ldr r0, =sub_81DB258
bl FindTaskIdByFunc
lsls r0, 24
lsrs r0, 24
bl DestroyTask
_081DB34C:
movs r0, 0
pop {r1}
bx r1
.pool
thumb_func_end sub_81DB328
.align 2, 0 @ Don't pad with nop.

View File

@ -4,263 +4,6 @@
.section .rodata
.align 2
sBigPokeball_Tileset:: @ 85B9330
.incbin "graphics/battle_transitions/big_pokeball.4bpp"
.align 2
sPokeballTrail_Tileset:: @ 85B98B0
.incbin "graphics/battle_transitions/pokeball_trail.4bpp"
.align 2
sSpriteImage_85B98F0:: @ 85B98F0
.incbin "graphics/battle_transitions/pokeball.4bpp"
.align 2
sUnknown_085B9AF0:: @ 85B9AF0
.incbin "graphics/battle_transitions/elite_four_bg.4bpp"
.align 2
sSpriteImage_85B9CD0:: @ 85B9CD0
.incbin "graphics/battle_transitions/unused_brendan.4bpp"
.align 2
sSpriteImage_85BA4D0:: @ 85BA4D0
.incbin "graphics/battle_transitions/unused_lass.4bpp"
.align 2
sShrinkingBoxTileset:: @ 85BACD0
.incbin "graphics/battle_transitions/shrinking_box.4bpp"
.align 2
sEvilTeam_Palette:: @ 85BAEB0
.incbin "graphics/battle_transitions/evil_team.gbapal"
.align 2
sTeamAqua_Tileset:: @ 85BAED0
.incbin "graphics/battle_transitions/team_aqua.4bpp.lz"
.align 2
sTeamAqua_Tilemap:: @ 85BB248
.incbin "graphics/battle_transitions/team_aqua.bin.lz"
.align 2
sTeamMagma_Tileset:: @ 85BB4A4
.incbin "graphics/battle_transitions/team_magma.4bpp.lz"
.align 2
sTeamMagma_Tilemap:: @ 85BB930
.incbin "graphics/battle_transitions/team_magma.bin.lz"
.align 2
gUnknown_085BBC14:: @ 85BBC14
.incbin "graphics/battle_transitions/85BBC14.4bpp"
.align 2
gUnknown_085BC2B4:: @ 85BC2B4
.incbin "graphics/battle_transitions/85BC2B4.gbapal"
.align 2
gUnknown_085BC2D4:: @ 85BC2D4
.incbin "graphics/battle_transitions/85BC2D4.gbapal"
.align 2
gUnknown_085BC2F4:: @ 85BC2F4
.incbin "graphics/battle_transitions/85BC2F4.gbapal"
.align 2
gUnknown_085BC314:: @ 85BC314
.incbin "graphics/battle_transitions/85BC314.bin"
.align 2
gUnknown_085BCB14:: @ 85BCB14
.incbin "graphics/battle_transitions/85BCB14.bin"
.align 2
gUnknown_085BD314:: @ 85BD314
.incbin "graphics/battle_transitions/85BD314.bin"
.align 2
gUnknown_085BDB14:: @ 85BDB14
.incbin "graphics/battle_transitions/85BDB14.gbapal"
.align 2
gUnknown_085BDB34:: @ 85BDB34
.incbin "graphics/battle_transitions/kyogre.4bpp.lz"
.align 2
gUnknown_085BE1E8:: @ 85BE1E8
.incbin "graphics/battle_transitions/kyogre.bin.lz"
.align 2
gUnknown_085BE51C:: @ 85BE51C
.incbin "graphics/battle_transitions/groudon.4bpp.lz"
.align 2
gUnknown_085BEA88:: @ 85BEA88
.incbin "graphics/battle_transitions/groudon.bin.lz"
.align 2
gUnknown_085BEDA0:: @ 85BEDA0
.incbin "graphics/battle_transitions/kyogre_pt1.gbapal"
.align 2
gUnknown_085BEEE0:: @ 85BEEE0
.incbin "graphics/battle_transitions/kyogre_pt2.gbapal"
.align 2
gUnknown_085BF0A0:: @ 85BF0A0
.incbin "graphics/battle_transitions/groudon_pt1.gbapal"
.align 2
gUnknown_085BF2A0:: @ 85BF2A0
.incbin "graphics/battle_transitions/groudon_pt2.gbapal"
.align 2
gUnknown_085BF4A0:: @ 85BF4A0
.incbin "graphics/battle_transitions/rayquaza.gbapal"
.align 2
gUnknown_085BF6A0:: @ 85BF6A0
.incbin "graphics/battle_transitions/rayquaza.4bpp"
.align 2
gUnknown_085C6BE0:: @ 85C6BE0
.incbin "graphics/battle_transitions/rayquaza.bin"
.align 2
gUnknown_085C7BE0:: @ 85C7BE0
.incbin "graphics/battle_transitions/frontier_brain.gbapal"
.align 2
gUnknown_085C7C00:: @ 85C7C00
.incbin "graphics/battle_transitions/frontier_brain.4bpp.lz"
.align 2
gUnknown_085C828C:: @ 85C828C
.incbin "graphics/battle_transitions/frontier_brain.bin.lz"
.align 2
gUnknown_085C8578:: @ 85C8578
.incbin "graphics/battle_transitions/frontier_squares_blanktiles.gbapal"
.align 2
gUnknown_085C8598:: @ 85C8598
.incbin "graphics/battle_transitions/frontier_square_1.4bpp.lz"
.align 2
gUnknown_085C86F4:: @ 85C86F4
.incbin "graphics/battle_transitions/frontier_square_2.4bpp.lz"
.align 2
gUnknown_085C87F4:: @ 85C87F4
.incbin "graphics/battle_transitions/frontier_square_3.4bpp.lz"
.align 2
gUnknown_085C88A4:: @ 85C88A4
.incbin "graphics/battle_transitions/frontier_square_4.4bpp.lz"
.align 2
gUnknown_085C8928:: @ 85C8928
.incbin "graphics/battle_transitions/frontier_squares.bin"
.align 2
sPhase1_Tasks:: @ 85C8948
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.4byte sub_81460BC
.align 2
sPhase2_Tasks:: @ 85C89F0
.4byte sub_814610C
.4byte sub_8146204
.4byte sub_8146384
.4byte sub_8146514
.4byte sub_8146F94
.4byte sub_8147204
.4byte sub_8147718
.4byte sub_81478EC
.4byte sub_81484D0
.4byte sub_8149578
.4byte sub_814995C
.4byte sub_8149A6C
.4byte sub_8147AE4
.4byte sub_8147B04
.4byte sub_8147B24
.4byte sub_8147B44
.4byte sub_8147B64
.4byte sub_814654C
.4byte sub_8146584
.4byte sub_81465BC
.4byte sub_81465F4
.4byte sub_814662C
.4byte sub_8146664
.4byte sub_8149140
.4byte sub_814927C
.4byte sub_8148760
.4byte sub_8148B54
.4byte sub_8148B8C
.4byte sub_8148E54
.4byte sub_814A3BC
.4byte sub_814A3F4
.4byte sub_814A6F0
.4byte sub_814A760
.4byte sub_814A728
.4byte sub_81DABDC
.4byte sub_81DACB4
.4byte sub_81DAD8C
.4byte sub_81DAE78
.4byte sub_81DAF68
.4byte sub_81DB060
.4byte sub_81DB158
.4byte sub_81DB258
.align 2
sMainTransitionPhases:: @ 85C8A98
.4byte sub_8145FE0
.4byte sub_8146030
.4byte sub_8146064
.4byte sub_814608C
.align 2
sPhase2_Transition_Blur_Funcs:: @ 85C8AA8
.4byte sub_8146144

View File

@ -1,6 +1,7 @@
#ifndef GUARD_BATTLE_TRANSITION_H
#define GUARD_BATTLE_TRANSITION_H
void TestBattleTransition(u8 transitionId);
void sub_8149DFC(u8 a1);
void BattleTransition_StartOnField(u8 transitionID);
void BattleTransition_Start(u8 transitionID);
@ -52,5 +53,6 @@ bool8 IsBattleTransitionDone(void);
#define B_TRANSITION_39 39
#define B_TRANSITION_40 40
#define B_TRANSITION_41 41
#define B_TRANSITION_COUNT 42
#endif // GUARD_BATTLE_TRANSITION_H

View File

@ -71,4 +71,6 @@ void mapldr_default(void);
void IncrementGameStat(u8);
u32 GetGameStat(u8);
void CB2_OverworldBasic(void);
#endif //GUARD_ROM4_H

13
include/unk_transition.h Normal file
View File

@ -0,0 +1,13 @@
#ifndef GUARD_UNK_TRANSITION_H
#define GUARD_UNK_TRANSITION_H
void Phase2Task_Transition_34(u8 taskId);
void Phase2Task_Transition_35(u8 taskId);
void Phase2Task_Transition_36(u8 taskId);
void Phase2Task_Transition_37(u8 taskId);
void Phase2Task_Transition_38(u8 taskId);
void Phase2Task_Transition_39(u8 taskId);
void Phase2Task_Transition_40(u8 taskId);
void Phase2Task_Transition_41(u8 taskId);
#endif // GUARD_UNK_TRANSITION_H

View File

@ -196,6 +196,7 @@ SECTIONS {
src/coins.o(.text);
src/landmark.o(.text);
asm/fldeff_strength.o(.text);
src/battle_transition.o(.text);
asm/battle_transition.o(.text);
src/battle_controller_link_partner.o(.text);
src/battle_message.o(.text);
@ -274,7 +275,6 @@ SECTIONS {
asm/trainer_rematch.o(.text);
asm/unk_sprite_file.o(.text);
asm/unk_transition.o(.text);
asm/unk_transition_2.o(.text);
src/international_string_util.o(.text);
asm/international_string_util.o(.text);
} =0
@ -447,6 +447,7 @@ SECTIONS {
data/roulette.o(.rodata);
data/pokedex_cry_screen.o(.rodata);
src/landmark.o(.rodata);
src/battle_transition.o(.rodata);
data/battle_transition.o(.rodata);
src/battle_controller_link_partner.o(.rodata);
src/battle_message.o(.rodata);

287
src/battle_transition.c Normal file
View File

@ -0,0 +1,287 @@
#include "global.h"
#include "battle_transition.h"
#include "unk_transition.h"
#include "main.h"
#include "overworld.h"
#include "task.h"
#include "palette.h"
#include "trig.h"
#include "field_effect.h"
#include "random.h"
#include "sprite.h"
#include "sound.h"
#include "constants/songs.h"
#include "constants/trainers.h"
#include "field_camera.h"
#include "unknown_task.h"
#include "malloc.h"
struct TransitionData
{
vs8 VBlank_DMA;
u16 WININ;
u16 WINOUT;
u16 field_6;
u16 WIN0V;
u16 field_A;
u16 field_C;
u16 BLDCNT;
u16 BLDALPHA;
u16 BLDY;
s16 field_14;
s16 field_16;
s16 field_18;
s16 field_1A;
s16 field_1C;
s16 field_1E; // unused
s16 field_20;
s16 field_22; // unused
s16 data[11];
};
typedef bool8 (*TransitionState)(struct Task *task);
typedef bool8 (*TransitionSpriteCallback)(struct Sprite *sprite);
extern void c2_exit_to_overworld_2_switch(void);
extern void sub_80AC3D0(void);
// this file's functions
void LaunchBattleTransitionTask(u8 transitionId);
void Task_BattleTransitionMain(u8 taskId);
void Phase1Task_TransitionAll(u8 taskId);
void Phase2Task_Transition_Blur(u8 taskId);
void Phase2Task_Transition_Swirl(u8 taskId);
void Phase2Task_Transition_Shuffle(u8 taskId);
void Phase2Task_Transition_BigPokeball(u8 taskId);
void Phase2Task_Transition_PokeballsTrail(u8 taskId);
void Phase2Task_Transition_Clockwise_BlackFade(u8 taskId);
void Phase2Task_Transition_Ripple(u8 taskId);
void Phase2Task_Transition_Wave(u8 taskId);
void Phase2Task_Transition_Slice(u8 taskId);
void Phase2Task_Transition_WhiteFade(u8 taskId);
void Phase2Task_Transition_GridSquares(u8 taskId);
void Phase2Task_Transition_Shards(u8 taskId);
void Phase2Task_Transition_Sydney(u8 taskId);
void Phase2Task_Transition_Phoebe(u8 taskId);
void Phase2Task_Transition_Glacia(u8 taskId);
void Phase2Task_Transition_Drake(u8 taskId);
void Phase2Task_Transition_Wallace(u8 taskId);
void Phase2Task_Transition_Aqua(u8 taskId);
void Phase2Task_Transition_Magma(u8 taskId);
void Phase2Task_Transition_Regice(u8 taskId);
void Phase2Task_Transition_Registeel(u8 taskId);
void Phase2Task_Transition_Regirock(u8 taskId);
void Phase2Task_Transition_Kyogre(u8 taskId);
void Phase2Task_Transition_Groudon(u8 taskId);
void Phase2Task_Transition_Rayquaza(u8 taskId);
void Phase2Task_Transition_25(u8 taskId);
void Phase2Task_Transition_26(u8 taskId);
void Phase2Task_Transition_27(u8 taskId);
void Phase2Task_Transition_28(u8 taskId);
void Phase2Task_Transition_29(u8 taskId);
void Phase2Task_Transition_30(u8 taskId);
void Phase2Task_Transition_31(u8 taskId);
void Phase2Task_Transition_32(u8 taskId);
void Phase2Task_Transition_33(u8 taskId);
bool8 Transition_Phase1(struct Task *task);
bool8 Transition_WaitForPhase1(struct Task *task);
bool8 Transition_Phase2(struct Task *task);
bool8 Transition_WaitForPhase2(struct Task *task);
// iwram bss vars
IWRAM_DATA u16 gUnknown_03001208;
IWRAM_DATA static u8 sTestingTransitionId;
IWRAM_DATA static u8 sTestingTransitionState;
// ewram vars
EWRAM_DATA struct TransitionData *sTransitionStructPtr = NULL;
// const rom data
const u32 sBigPokeball_Tileset[] = INCBIN_U32("graphics/battle_transitions/big_pokeball.4bpp");
const u32 sPokeballTrail_Tileset[] = INCBIN_U32("graphics/battle_transitions/pokeball_trail.4bpp");
const u32 sSpriteImage_85B98F0[] = INCBIN_U32("graphics/battle_transitions/pokeball.4bpp");
const u32 sUnknown_085B9AF0[] = INCBIN_U32("graphics/battle_transitions/elite_four_bg.4bpp");
const u32 sSpriteImage_85B9CD0[] = INCBIN_U32("graphics/battle_transitions/unused_brendan.4bpp");
const u32 sSpriteImage_85BA4D0[] = INCBIN_U32("graphics/battle_transitions/unused_lass.4bpp");
const u32 sShrinkingBoxTileset[] = INCBIN_U32("graphics/battle_transitions/shrinking_box.4bpp");
const u32 sEvilTeam_Palette[] = INCBIN_U32("graphics/battle_transitions/evil_team.gbapal");
const u32 sTeamAqua_Tileset[] = INCBIN_U32("graphics/battle_transitions/team_aqua.4bpp.lz");
const u32 sTeamAqua_Tilemap[] = INCBIN_U32("graphics/battle_transitions/team_aqua.bin.lz");
const u32 sTeamMagma_Tileset[] = INCBIN_U32("graphics/battle_transitions/team_magma.4bpp.lz");
const u32 sTeamMagma_Tilemap[] = INCBIN_U32("graphics/battle_transitions/team_magma.bin.lz");
const u32 gUnknown_085BBC14[] = INCBIN_U32("graphics/battle_transitions/85BBC14.4bpp");
const u32 gUnknown_085BC2B4[] = INCBIN_U32("graphics/battle_transitions/85BC2B4.gbapal");
const u32 gUnknown_085BC2D4[] = INCBIN_U32("graphics/battle_transitions/85BC2D4.gbapal");
const u32 gUnknown_085BC2F4[] = INCBIN_U32("graphics/battle_transitions/85BC2F4.gbapal");
const u32 gUnknown_085BC314[] = INCBIN_U32("graphics/battle_transitions/85BC314.bin");
const u32 gUnknown_085BCB14[] = INCBIN_U32("graphics/battle_transitions/85BCB14.bin");
const u32 gUnknown_085BD314[] = INCBIN_U32("graphics/battle_transitions/85BD314.bin");
const u32 gUnknown_085BDB14[] = INCBIN_U32("graphics/battle_transitions/85BDB14.gbapal");
const u32 gUnknown_085BDB34[] = INCBIN_U32("graphics/battle_transitions/kyogre.4bpp.lz");
const u32 gUnknown_085BE1E8[] = INCBIN_U32("graphics/battle_transitions/kyogre.bin.lz");
const u32 gUnknown_085BE51C[] = INCBIN_U32("graphics/battle_transitions/groudon.4bpp.lz");
const u32 gUnknown_085BEA88[] = INCBIN_U32("graphics/battle_transitions/groudon.bin.lz");
const u32 gUnknown_085BEDA0[] = INCBIN_U32("graphics/battle_transitions/kyogre_pt1.gbapal");
const u32 gUnknown_085BEEE0[] = INCBIN_U32("graphics/battle_transitions/kyogre_pt2.gbapal");
const u32 gUnknown_085BF0A0[] = INCBIN_U32("graphics/battle_transitions/groudon_pt1.gbapal");
const u32 gUnknown_085BF2A0[] = INCBIN_U32("graphics/battle_transitions/groudon_pt2.gbapal");
const u32 gUnknown_085BF4A0[] = INCBIN_U32("graphics/battle_transitions/rayquaza.gbapal");
const u32 gUnknown_085BF6A0[] = INCBIN_U32("graphics/battle_transitions/rayquaza.4bpp");
const u32 gUnknown_085C6BE0[] = INCBIN_U32("graphics/battle_transitions/rayquaza.bin");
const u32 gUnknown_085C7BE0[] = INCBIN_U32("graphics/battle_transitions/frontier_brain.gbapal");
const u32 gUnknown_085C7C00[] = INCBIN_U32("graphics/battle_transitions/frontier_brain.4bpp.lz");
const u32 gUnknown_085C828C[] = INCBIN_U32("graphics/battle_transitions/frontier_brain.bin.lz");
const u32 gUnknown_085C8578[] = INCBIN_U32("graphics/battle_transitions/frontier_squares_blanktiles.gbapal");
const u32 gUnknown_085C8598[] = INCBIN_U32("graphics/battle_transitions/frontier_square_1.4bpp.lz");
const u32 gUnknown_085C86F4[] = INCBIN_U32("graphics/battle_transitions/frontier_square_2.4bpp.lz");
const u32 gUnknown_085C87F4[] = INCBIN_U32("graphics/battle_transitions/frontier_square_3.4bpp.lz");
const u32 gUnknown_085C88A4[] = INCBIN_U32("graphics/battle_transitions/frontier_square_4.4bpp.lz");
const u32 gUnknown_085C8928[] = INCBIN_U32("graphics/battle_transitions/frontier_squares.bin");
const TaskFunc sPhase1_Tasks[B_TRANSITION_COUNT] =
{
[0 ... B_TRANSITION_COUNT - 1] = &Phase1Task_TransitionAll
};
const TaskFunc sPhase2_Tasks[B_TRANSITION_COUNT] =
{
Phase2Task_Transition_Blur, // 0
Phase2Task_Transition_Swirl, // 1
Phase2Task_Transition_Shuffle, // 2
Phase2Task_Transition_BigPokeball, // 3
Phase2Task_Transition_PokeballsTrail, // 4
Phase2Task_Transition_Clockwise_BlackFade, // 5
Phase2Task_Transition_Ripple, // 6
Phase2Task_Transition_Wave, // 7
Phase2Task_Transition_Slice, // 8
Phase2Task_Transition_WhiteFade, // 9
Phase2Task_Transition_GridSquares, // 10
Phase2Task_Transition_Shards, // 11
Phase2Task_Transition_Sydney, // 12
Phase2Task_Transition_Phoebe, // 13
Phase2Task_Transition_Glacia, // 14
Phase2Task_Transition_Drake, // 15
Phase2Task_Transition_Wallace, // 16
Phase2Task_Transition_Aqua, // 17
Phase2Task_Transition_Magma, // 18
Phase2Task_Transition_Regice, // 19
Phase2Task_Transition_Registeel, // 20
Phase2Task_Transition_Regirock, // 21
Phase2Task_Transition_Kyogre, // 22
Phase2Task_Transition_Groudon, // 23
Phase2Task_Transition_Rayquaza, // 24
Phase2Task_Transition_25, // 25
Phase2Task_Transition_26, // 26
Phase2Task_Transition_27, // 27
Phase2Task_Transition_28, // 28
Phase2Task_Transition_29, // 29
Phase2Task_Transition_30, // 30
Phase2Task_Transition_31, // 31
Phase2Task_Transition_32, // 32
Phase2Task_Transition_33, // 33
Phase2Task_Transition_34, // 34
Phase2Task_Transition_35, // 35
Phase2Task_Transition_36, // 36
Phase2Task_Transition_37, // 37
Phase2Task_Transition_38, // 38
Phase2Task_Transition_39, // 39
Phase2Task_Transition_40, // 40
Phase2Task_Transition_41, // 41
};
const TransitionState sMainTransitionPhases[] =
{
&Transition_Phase1,
&Transition_WaitForPhase1,
&Transition_Phase2,
&Transition_WaitForPhase2
};
// code
static void CB2_TestBattleTransition(void)
{
switch (sTestingTransitionState)
{
case 0:
LaunchBattleTransitionTask(sTestingTransitionId);
sTestingTransitionState++;
break;
case 1:
if (IsBattleTransitionDone())
{
sTestingTransitionState = 0;
SetMainCallback2(c2_exit_to_overworld_2_switch);
}
break;
}
RunTasks();
AnimateSprites();
BuildOamBuffer();
UpdatePaletteFade();
}
void TestBattleTransition(u8 transitionId)
{
sTestingTransitionId = transitionId;
SetMainCallback2(CB2_TestBattleTransition);
}
void BattleTransition_StartOnField(u8 transitionId)
{
gMain.callback2 = CB2_OverworldBasic;
LaunchBattleTransitionTask(transitionId);
}
void BattleTransition_Start(u8 transitionId)
{
LaunchBattleTransitionTask(transitionId);
}
#define tState data[0]
#define tTransitionID data[1]
#define tTransitionDone data[15]
bool8 IsBattleTransitionDone(void)
{
u8 taskId = FindTaskIdByFunc(Task_BattleTransitionMain);
if (gTasks[taskId].tTransitionDone)
{
DestroyTask(taskId);
FREE_AND_SET_NULL(sTransitionStructPtr);
return TRUE;
}
else
{
return FALSE;
}
}
void LaunchBattleTransitionTask(u8 transitionId)
{
u8 taskId = CreateTask(Task_BattleTransitionMain, 2);
gTasks[taskId].tTransitionID = transitionId;
sTransitionStructPtr = AllocZeroed(sizeof(*sTransitionStructPtr));
}
void Task_BattleTransitionMain(u8 taskId)
{
while (sMainTransitionPhases[gTasks[taskId].tState](&gTasks[taskId]));
}
bool8 Transition_Phase1(struct Task *task)
{
sub_80AC3D0();
CpuCopy32(gPlttBufferFaded, gPlttBufferUnfaded, 0x400);
if (sPhase1_Tasks[task->tTransitionID] != NULL)
{
CreateTask(sPhase1_Tasks[task->tTransitionID], 4);
task->tState++;
return FALSE;
}
else
{
task->tState = 2;
return TRUE;
}
}

View File

@ -73,14 +73,9 @@ gUnknown_03001202: @ 3001202
gUnknown_03001204: @ 3001204
.space 0x4
gUnknown_03001208: @ 3001208
.space 0x2
.include "src/battle_transition.o"
sTestingTransitionId: @ 300120A
.space 0x1
sTestingTransitionState: @ 300120B
.space 0x5
.align 4
gUnknown_03001210: @ 3001210
.space 0x30

View File

@ -1193,10 +1193,7 @@ gUnknown_0203AB98: @ 203AB98
.space 0x4
.include "src/coins.o"
.align 2
sTransitionStructPtr: @ 203ABA0
.space 0x4
.include "src/battle_transition.o"
gAbilitiesPerBank: @ 203ABA4
.space 0x4