merge with master

This commit is contained in:
DizzyEggg 2018-03-01 10:12:35 +01:00
commit edf2ea45b1
38 changed files with 3839 additions and 8153 deletions

View File

@ -13,7 +13,7 @@ cache:
apt: true
install:
- pushd $HOME
- travis_retry wget http://download.sourceforge.net/devkitpro/devkitARM_r47-x86_64-linux.tar.bz2
- travis_retry wget https://downloads.sourceforge.net/project/devkitpro/devkitARM/devkitARM_r47/devkitARM_r47-x86_64-linux.tar.bz2
- tar xf devkitARM*.tar.bz2
- travis_retry git clone https://github.com/pret/agbcc.git
- cd agbcc && ./build.sh && ./install.sh $TRAVIS_BUILD_DIR

File diff suppressed because it is too large Load Diff

View File

@ -3388,7 +3388,7 @@ _0813980C:
_0813981C:
ldrh r5, [r2]
adds r0, r5, 0
bl sub_80EF370
bl CountDigits
adds r3, r0, 0
lsls r3, 24
lsrs r3, 24
@ -3408,7 +3408,7 @@ _0813983C:
adds r4, 0x4
ldrh r5, [r2]
adds r0, r5, 0
bl sub_80EF370
bl CountDigits
adds r3, r0, 0
lsls r3, 24
lsrs r3, 24

View File

@ -1,709 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start SetUpFieldMove_Flash
SetUpFieldMove_Flash: @ 81370FC
push {r4,lr}
bl ShouldDoBrailleFlyEffect
lsls r0, 24
cmp r0, 0
beq _08137134
ldr r4, =gSpecialVar_Result
bl GetCursorSelectionMonId
lsls r0, 24
lsrs r0, 24
strh r0, [r4]
ldr r1, =gUnknown_03005DB0
ldr r0, =FieldCallback_Teleport
str r0, [r1]
ldr r1, =gUnknown_0203CEEC
ldr r0, =sub_8179918
b _08137152
.pool
_08137134:
ldr r0, =gMapHeader
ldrb r0, [r0, 0x15]
cmp r0, 0x1
bne _08137170
ldr r0, =0x00000888
bl FlagGet
lsls r0, 24
cmp r0, 0
bne _08137170
ldr r1, =gUnknown_03005DB0
ldr r0, =FieldCallback_Teleport
str r0, [r1]
ldr r1, =gUnknown_0203CEEC
ldr r0, =hm2_flash
_08137152:
str r0, [r1]
movs r0, 0x1
b _08137172
.pool
_08137170:
movs r0, 0
_08137172:
pop {r4}
pop {r1}
bx r1
thumb_func_end SetUpFieldMove_Flash
thumb_func_start hm2_flash
hm2_flash: @ 8137178
push {r4,lr}
bl oei_task_add
adds r4, r0, 0
lsls r4, 24
lsrs r4, 24
bl GetCursorSelectionMonId
ldr r1, =gFieldEffectArguments
lsls r0, 24
lsrs r0, 24
str r0, [r1]
ldr r1, =gTasks
lsls r0, r4, 2
adds r0, r4
lsls r0, 3
adds r0, r1
ldr r2, =sub_81371B4
lsrs r1, r2, 16
strh r1, [r0, 0x18]
strh r2, [r0, 0x1A]
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end hm2_flash
thumb_func_start sub_81371B4
sub_81371B4: @ 81371B4
push {lr}
movs r0, 0xCF
bl PlaySE
ldr r0, =0x00000888
bl FlagSet
ldr r0, =EventScript_2926F8
bl ScriptContext1_SetupScript
pop {r0}
bx r0
.pool
thumb_func_end sub_81371B4
thumb_func_start sub_81371D4
sub_81371D4: @ 81371D4
push {lr}
bl RunTasks
bl AnimateSprites
bl BuildOamBuffer
bl UpdatePaletteFade
pop {r0}
bx r0
thumb_func_end sub_81371D4
thumb_func_start sub_81371EC
sub_81371EC: @ 81371EC
push {lr}
bl LoadOam
bl ProcessSpriteCopyRequests
bl TransferPlttBuffer
pop {r0}
bx r0
thumb_func_end sub_81371EC
thumb_func_start c2_change_map
c2_change_map: @ 8137200
push {r4,lr}
sub sp, 0x8
movs r0, 0
bl SetVBlankCallback
movs r0, 0
movs r1, 0
bl SetGpuReg
movs r0, 0xC
movs r1, 0
bl SetGpuReg
movs r0, 0xA
movs r1, 0
bl SetGpuReg
movs r0, 0x8
movs r1, 0
bl SetGpuReg
movs r0, 0x18
movs r1, 0
bl SetGpuReg
movs r0, 0x1A
movs r1, 0
bl SetGpuReg
movs r0, 0x14
movs r1, 0
bl SetGpuReg
movs r0, 0x16
movs r1, 0
bl SetGpuReg
movs r0, 0x10
movs r1, 0
bl SetGpuReg
movs r0, 0x12
movs r1, 0
bl SetGpuReg
mov r1, sp
movs r0, 0
strh r0, [r1]
ldr r1, =0x040000d4
mov r0, sp
str r0, [r1]
movs r0, 0xC0
lsls r0, 19
str r0, [r1, 0x4]
ldr r0, =0x8100c000
str r0, [r1, 0x8]
ldr r0, [r1, 0x8]
movs r4, 0
str r4, [sp, 0x4]
add r0, sp, 0x4
str r0, [r1]
movs r0, 0xE0
lsls r0, 19
str r0, [r1, 0x4]
ldr r0, =0x85000100
str r0, [r1, 0x8]
ldr r0, [r1, 0x8]
mov r0, sp
strh r4, [r0]
str r0, [r1]
ldr r0, =0x05000002
str r0, [r1, 0x4]
ldr r0, =0x810001ff
str r0, [r1, 0x8]
ldr r0, [r1, 0x8]
bl ResetPaletteFade
bl ResetTasks
bl ResetSpriteData
ldr r3, =0x04000208
ldrh r2, [r3]
strh r4, [r3]
ldr r4, =0x04000200
ldrh r0, [r4]
movs r1, 0x1
orrs r0, r1
strh r0, [r4]
strh r2, [r3]
ldr r0, =sub_81371EC
bl SetVBlankCallback
ldr r0, =sub_81371D4
bl SetMainCallback2
bl sub_8137304
lsls r0, 24
cmp r0, 0
bne _081372D2
ldr r0, =gMain
ldr r0, [r0, 0x8]
bl SetMainCallback2
_081372D2:
add sp, 0x8
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end c2_change_map
thumb_func_start sub_8137304
sub_8137304: @ 8137304
push {r4-r7,lr}
bl get_map_light_from_warp0
lsls r0, 24
lsrs r6, r0, 24
bl Overworld_GetMapTypeOfSaveblockLocation
lsls r0, 24
lsrs r5, r0, 24
movs r3, 0
ldr r4, =gUnknown_085B27C8
ldrb r0, [r4]
cmp r0, 0
beq _08137358
adds r7, r4, 0
adds r0, r4, 0x4
mov r12, r0
_08137326:
lsls r2, r3, 3
adds r1, r2, r7
ldrb r0, [r1]
cmp r0, r6
bne _08137348
ldrb r0, [r1, 0x1]
cmp r0, r5
bne _08137348
mov r1, r12
adds r0, r2, r1
ldr r0, [r0]
bl _call_via_r0
movs r0, 0x1
b _0813735A
.pool
_08137348:
adds r0, r3, 0x1
lsls r0, 24
lsrs r3, r0, 24
lsls r0, r3, 3
adds r0, r4
ldrb r0, [r0]
cmp r0, 0
bne _08137326
_08137358:
movs r0, 0
_0813735A:
pop {r4-r7}
pop {r1}
bx r1
thumb_func_end sub_8137304
thumb_func_start sub_8137360
sub_8137360: @ 8137360
push {r4-r6,lr}
lsls r0, 24
lsls r1, 24
lsrs r5, r0, 24
lsrs r4, r1, 24
movs r3, 0
ldr r1, =gUnknown_085B27C8
ldrb r0, [r1]
cmp r0, 0
beq _081373A0
adds r6, r1, 0
_08137376:
lsls r0, r3, 3
adds r2, r0, r6
ldrb r0, [r2]
cmp r0, r5
bne _08137390
ldrb r0, [r2, 0x1]
cmp r0, r4
bne _08137390
ldrb r0, [r2, 0x2]
b _081373A2
.pool
_08137390:
adds r0, r3, 0x1
lsls r0, 24
lsrs r3, r0, 24
lsls r0, r3, 3
adds r0, r1
ldrb r0, [r0]
cmp r0, 0
bne _08137376
_081373A0:
movs r0, 0
_081373A2:
pop {r4-r6}
pop {r1}
bx r1
thumb_func_end sub_8137360
thumb_func_start fade_type_for_given_maplight_pair
fade_type_for_given_maplight_pair: @ 81373A8
push {r4-r6,lr}
lsls r0, 24
lsls r1, 24
lsrs r5, r0, 24
lsrs r4, r1, 24
movs r3, 0
ldr r1, =gUnknown_085B27C8
ldrb r0, [r1]
cmp r0, 0
beq _081373E8
adds r6, r1, 0
_081373BE:
lsls r0, r3, 3
adds r2, r0, r6
ldrb r0, [r2]
cmp r0, r5
bne _081373D8
ldrb r0, [r2, 0x1]
cmp r0, r4
bne _081373D8
ldrb r0, [r2, 0x3]
b _081373EA
.pool
_081373D8:
adds r0, r3, 0x1
lsls r0, 24
lsrs r3, r0, 24
lsls r0, r3, 3
adds r0, r1
ldrb r0, [r0]
cmp r0, 0
bne _081373BE
_081373E8:
movs r0, 0
_081373EA:
pop {r4-r6}
pop {r1}
bx r1
thumb_func_end fade_type_for_given_maplight_pair
thumb_func_start sub_81373F0
sub_81373F0: @ 81373F0
push {lr}
ldr r0, =sub_8137404
movs r1, 0
bl CreateTask
pop {r0}
bx r0
.pool
thumb_func_end sub_81373F0
thumb_func_start sub_8137404
sub_8137404: @ 8137404
lsls r0, 24
lsrs r0, 24
ldr r2, =gTasks
lsls r1, r0, 2
adds r1, r0
lsls r1, 3
adds r1, r2
ldr r0, =sub_8137420
str r0, [r1]
bx lr
.pool
thumb_func_end sub_8137404
thumb_func_start sub_8137420
sub_8137420: @ 8137420
push {r4,lr}
adds r4, r0, 0
lsls r4, 24
lsrs r4, 24
movs r0, 0
movs r1, 0
bl SetGpuReg
ldr r0, =gCaveTransitionTiles
ldr r1, =0x0600c000
bl LZ77UnCompVram
ldr r0, =gCaveTransitionTilemap
ldr r1, =0x0600f800
bl LZ77UnCompVram
ldr r0, =gCaveTransitionPalette_White
movs r1, 0xE0
movs r2, 0x20
bl LoadPalette
ldr r0, =gUnknown_085B28A0
movs r1, 0xE0
movs r2, 0x10
bl LoadPalette
ldr r1, =0x00003e41
movs r0, 0x50
bl SetGpuReg
movs r0, 0x52
movs r1, 0
bl SetGpuReg
movs r0, 0x54
movs r1, 0
bl SetGpuReg
ldr r1, =0x00001f0c
movs r0, 0x8
bl SetGpuReg
movs r1, 0x8A
lsls r1, 5
movs r0, 0
bl SetGpuReg
ldr r1, =gTasks
lsls r0, r4, 2
adds r0, r4
lsls r0, 3
adds r0, r1
ldr r1, =sub_81374C4
str r1, [r0]
movs r2, 0
movs r1, 0x10
strh r1, [r0, 0x8]
strh r2, [r0, 0xA]
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end sub_8137420
thumb_func_start sub_81374C4
sub_81374C4: @ 81374C4
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
ldr r2, =gTasks
lsls r1, r0, 2
adds r1, r0
lsls r1, 3
adds r5, r1, r2
ldrh r4, [r5, 0xA]
movs r0, 0x80
lsls r0, 5
adds r1, r4, r0
lsls r1, 16
lsrs r1, 16
movs r0, 0x52
bl SetGpuReg
cmp r4, 0x10
bhi _081374F8
ldrh r0, [r5, 0xA]
adds r0, 0x1
strh r0, [r5, 0xA]
b _08137500
.pool
_081374F8:
movs r0, 0
strh r0, [r5, 0xC]
ldr r0, =sub_813750C
str r0, [r5]
_08137500:
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end sub_81374C4
thumb_func_start sub_813750C
sub_813750C: @ 813750C
push {r4,lr}
adds r4, r0, 0
lsls r4, 24
lsrs r4, 24
ldr r1, =0x00001010
movs r0, 0x52
bl SetGpuReg
ldr r1, =gTasks
lsls r0, r4, 2
adds r0, r4
lsls r0, 3
adds r4, r0, r1
ldrh r1, [r4, 0xC]
cmp r1, 0x7
bhi _08137554
adds r0, r1, 0x1
strh r0, [r4, 0xC]
lsls r1, 1
ldr r0, =gUnknown_085B28A0
adds r0, r1, r0
movs r2, 0x10
subs r2, r1
lsls r2, 16
lsrs r2, 16
movs r1, 0xE0
bl LoadPalette
b _08137566
.pool
_08137554:
ldr r0, =gCaveTransitionPalette_White
movs r1, 0
movs r2, 0x20
bl LoadPalette
ldr r0, =sub_8137574
str r0, [r4]
movs r0, 0x8
strh r0, [r4, 0xC]
_08137566:
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end sub_813750C
thumb_func_start sub_8137574
sub_8137574: @ 8137574
push {lr}
lsls r0, 24
lsrs r0, 24
ldr r2, =gTasks
lsls r1, r0, 2
adds r1, r0
lsls r1, 3
adds r1, r2
ldrh r2, [r1, 0xC]
movs r3, 0xC
ldrsh r0, [r1, r3]
cmp r0, 0
beq _08137598
subs r0, r2, 0x1
strh r0, [r1, 0xC]
b _081375A0
.pool
_08137598:
ldr r0, =gMain
ldr r0, [r0, 0x8]
bl SetMainCallback2
_081375A0:
pop {r0}
bx r0
.pool
thumb_func_end sub_8137574
thumb_func_start sub_81375A8
sub_81375A8: @ 81375A8
push {lr}
ldr r0, =sub_81375BC
movs r1, 0
bl CreateTask
pop {r0}
bx r0
.pool
thumb_func_end sub_81375A8
thumb_func_start sub_81375BC
sub_81375BC: @ 81375BC
lsls r0, 24
lsrs r0, 24
ldr r2, =gTasks
lsls r1, r0, 2
adds r1, r0
lsls r1, 3
adds r1, r2
ldr r0, =sub_81375D8
str r0, [r1]
bx lr
.pool
thumb_func_end sub_81375BC
thumb_func_start sub_81375D8
sub_81375D8: @ 81375D8
push {r4,lr}
adds r4, r0, 0
lsls r4, 24
lsrs r4, 24
movs r0, 0
movs r1, 0
bl SetGpuReg
ldr r0, =gCaveTransitionTiles
ldr r1, =0x0600c000
bl LZ77UnCompVram
ldr r0, =gCaveTransitionTilemap
ldr r1, =0x0600f800
bl LZ77UnCompVram
movs r0, 0x50
movs r1, 0
bl SetGpuReg
movs r0, 0x52
movs r1, 0
bl SetGpuReg
movs r0, 0x54
movs r1, 0
bl SetGpuReg
ldr r1, =0x00001f0c
movs r0, 0x8
bl SetGpuReg
movs r1, 0x8A
lsls r1, 5
movs r0, 0
bl SetGpuReg
ldr r0, =gCaveTransitionPalette_White
movs r1, 0xE0
movs r2, 0x20
bl LoadPalette
ldr r0, =gCaveTransitionPalette_Black
movs r1, 0
movs r2, 0x20
bl LoadPalette
ldr r1, =gTasks
lsls r0, r4, 2
adds r0, r4
lsls r0, 3
adds r0, r1
ldr r1, =sub_8137678
str r1, [r0]
movs r2, 0
movs r1, 0x10
strh r1, [r0, 0x8]
strh r2, [r0, 0xA]
strh r2, [r0, 0xC]
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end sub_81375D8
thumb_func_start sub_8137678
sub_8137678: @ 8137678
push {r4,lr}
lsls r0, 24
lsrs r0, 24
ldr r2, =gTasks
lsls r1, r0, 2
adds r1, r0
lsls r1, 3
adds r4, r1, r2
ldrh r1, [r4, 0xC]
cmp r1, 0xF
bhi _081376B4
adds r2, r1, 0x1
adds r0, r2, 0x1
strh r0, [r4, 0xC]
movs r0, 0xF
subs r0, r1
lsls r0, 1
ldr r1, =gUnknown_085B2890
adds r0, r1
lsls r2, 17
lsrs r2, 16
movs r1, 0xE0
bl LoadPalette
b _081376C8
.pool
_081376B4:
ldr r1, =0x00001010
movs r0, 0x52
bl SetGpuReg
ldr r1, =0x00003e41
movs r0, 0x50
bl SetGpuReg
ldr r0, =sub_81376DC
str r0, [r4]
_081376C8:
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end sub_8137678
thumb_func_start sub_81376DC
sub_81376DC: @ 81376DC
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
ldr r2, =gTasks
lsls r1, r0, 2
adds r1, r0
lsls r1, 3
adds r5, r1, r2
ldrh r0, [r5, 0xA]
movs r1, 0x10
subs r1, r0
lsls r1, 16
lsrs r4, r1, 16
movs r0, 0x80
lsls r0, 21
adds r1, r0
lsrs r1, 16
movs r0, 0x52
bl SetGpuReg
cmp r4, 0
beq _08137714
ldrh r0, [r5, 0xA]
adds r0, 0x1
strh r0, [r5, 0xA]
b _08137726
.pool
_08137714:
ldr r0, =gCaveTransitionPalette_Black
movs r1, 0
movs r2, 0x20
bl LoadPalette
ldr r0, =gMain
ldr r0, [r0, 0x8]
bl SetMainCallback2
_08137726:
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end sub_81376DC

View File

@ -1,596 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start sub_81BE66C
sub_81BE66C: @ 81BE66C
push {lr}
ldr r0, =gSaveBlock1Ptr
ldr r0, [r0]
ldrh r1, [r0, 0x4]
movs r0, 0xD0
lsls r0, 5
cmp r1, r0
bne _081BE690
movs r0, 0xA7
lsls r0, 1
bl FlagGet
lsls r0, 24
lsrs r0, 24
b _081BE692
.pool
_081BE690:
movs r0, 0
_081BE692:
pop {r1}
bx r1
thumb_func_end sub_81BE66C
thumb_func_start sub_81BE698
sub_81BE698: @ 81BE698
push {lr}
ldr r0, =gUnknown_0203CF18
ldr r0, [r0]
adds r0, 0x4
bl sub_8151E50
pop {r0}
bx r0
.pool
thumb_func_end sub_81BE698
thumb_func_start sub_81BE6AC
sub_81BE6AC: @ 81BE6AC
ldr r1, =gUnknown_0203CF18
movs r0, 0
str r0, [r1]
bx lr
.pool
thumb_func_end sub_81BE6AC
thumb_func_start sub_81BE6B8
sub_81BE6B8: @ 81BE6B8
push {r4,lr}
ldr r4, =gUnknown_0203CF18
ldr r0, [r4]
cmp r0, 0
beq _081BE6CC
movs r0, 0
str r0, [r4]
b _081BE718
.pool
_081BE6CC:
ldr r0, =gSaveBlock1Ptr
ldr r0, [r0]
ldrh r1, [r0, 0x4]
movs r0, 0xD0
lsls r0, 5
cmp r1, r0
bne _081BE718
movs r0, 0xA7
lsls r0, 1
bl FlagGet
lsls r0, 24
cmp r0, 0
beq _081BE718
movs r0, 0xC8
bl AllocZeroed
str r0, [r4]
adds r0, 0x4
bl sub_8151B3C
ldr r0, [r4]
adds r0, 0x4
ldr r1, =gUnknown_08617E18
bl sub_8151B68
ldr r0, [r4]
adds r0, 0x4
movs r1, 0x1
movs r2, 0x1
bl sub_8151CA8
ldr r0, =sub_81BE698
movs r1, 0xFF
bl CreateTask
ldr r1, [r4]
strb r0, [r1]
_081BE718:
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end sub_81BE6B8
thumb_func_start sub_81BE72C
sub_81BE72C: @ 81BE72C
push {r4,lr}
ldr r0, =gSaveBlock1Ptr
ldr r0, [r0]
ldrh r1, [r0, 0x4]
movs r0, 0xD0
lsls r0, 5
cmp r1, r0
bne _081BE788
movs r0, 0xA7
lsls r0, 1
bl FlagGet
lsls r0, 24
cmp r0, 0
beq _081BE788
ldr r4, =gUnknown_0203CF18
ldr r0, [r4]
cmp r0, 0
beq _081BE788
ldr r0, =sub_81BE698
bl FuncIsActiveTask
lsls r0, 24
cmp r0, 0
beq _081BE766
ldr r0, [r4]
ldrb r0, [r0]
bl DestroyTask
_081BE766:
ldr r0, [r4]
adds r0, 0x4
movs r1, 0x1
movs r2, 0x1
bl sub_8151D28
ldr r0, [r4]
adds r0, 0x4
movs r1, 0x1
movs r2, 0x1
bl sub_8151C50
ldr r0, [r4]
bl Free
movs r0, 0
str r0, [r4]
_081BE788:
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end sub_81BE72C
thumb_func_start sub_81BE79C
sub_81BE79C: @ 81BE79C
push {r4,lr}
ldr r0, =0x000040cb
bl VarGet
lsls r0, 16
cmp r0, 0
beq _081BE7B8
movs r0, 0xA7
lsls r0, 1
bl FlagClear
b _081BE7EE
.pool
_081BE7B8:
bl Random
lsls r0, 16
lsrs r4, r0, 16
movs r0, 0x1
ands r4, r0
movs r0, 0x9D
bl FlagGet
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
bne _081BE7D4
movs r4, 0x1
_081BE7D4:
cmp r4, 0
beq _081BE7E6
movs r0, 0xA7
lsls r0, 1
bl FlagSet
bl sub_81BE6B8
b _081BE7EE
_081BE7E6:
movs r0, 0xA7
lsls r0, 1
bl FlagClear
_081BE7EE:
pop {r4}
pop {r0}
bx r0
thumb_func_end sub_81BE79C
thumb_func_start sub_81BE7F4
sub_81BE7F4: @ 81BE7F4
push {lr}
ldr r0, =sub_81BE808
movs r1, 0x8
bl CreateTask
pop {r0}
bx r0
.pool
thumb_func_end sub_81BE7F4
thumb_func_start sub_81BE808
sub_81BE808: @ 81BE808
push {r4,r5,lr}
sub sp, 0x4
lsls r0, 24
lsrs r5, r0, 24
ldr r0, =gSaveBlock1Ptr
ldr r0, [r0]
ldrb r1, [r0, 0x5]
ldrb r2, [r0, 0x4]
movs r0, 0x2D
mov r3, sp
bl TryGetFieldObjectIdByLocalIdAndMap
mov r0, sp
ldrb r0, [r0]
lsls r2, r0, 3
adds r2, r0
lsls r2, 2
ldr r4, =gMapObjects
adds r2, r4
ldr r3, =gSprites
ldrb r1, [r2, 0x4]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
adds r0, r3
ldrh r1, [r0, 0x26]
adds r1, 0x4
strh r1, [r0, 0x26]
ldr r0, =gPlayerAvatar
ldrb r0, [r0, 0x5]
lsls r1, r0, 3
adds r1, r0
lsls r1, 2
adds r1, r4
ldrb r2, [r2, 0x4]
lsls r0, r2, 4
adds r0, r2
lsls r0, 2
adds r0, r3
movs r4, 0x22
ldrsh r2, [r0, r4]
movs r4, 0x26
ldrsh r0, [r0, r4]
adds r2, r0
ldrb r1, [r1, 0x4]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
adds r0, r3
movs r3, 0x22
ldrsh r1, [r0, r3]
movs r4, 0x26
ldrsh r0, [r0, r4]
adds r1, r0
cmp r2, r1
blt _081BE882
adds r0, r5, 0
bl DestroyTask
bl EnableBothScriptContexts
_081BE882:
add sp, 0x4
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end sub_81BE808
thumb_func_start sp136_strengh_sound
sp136_strengh_sound: @ 81BE89C
push {r4-r6,lr}
mov r6, r8
push {r6}
mov r8, r0
adds r4, r1, 0
adds r5, r2, 0
adds r6, r3, 0
lsls r0, 24
lsrs r0, 24
mov r8, r0
lsls r4, 24
lsrs r4, 24
lsls r5, 24
lsrs r5, 24
lsls r6, 24
lsrs r6, 24
ldr r0, =sub_81BE900
movs r1, 0x9
bl CreateTask
lsls r0, 24
lsrs r0, 24
ldr r2, =gTasks
lsls r1, r0, 2
adds r1, r0
lsls r1, 3
adds r1, r2
movs r0, 0
strh r4, [r1, 0x8]
strh r0, [r1, 0xA]
strh r5, [r1, 0xC]
strh r6, [r1, 0xE]
mov r0, r8
strh r0, [r1, 0x10]
movs r0, 0
bl SetCameraPanningCallback
movs r0, 0xD6
bl PlaySE
pop {r3}
mov r8, r3
pop {r4-r6}
pop {r0}
bx r0
.pool
thumb_func_end sp136_strengh_sound
thumb_func_start sub_81BE900
sub_81BE900: @ 81BE900
push {r4,r5,lr}
lsls r0, 24
lsrs r5, r0, 24
lsls r0, r5, 2
adds r0, r5
lsls r0, 3
ldr r1, =gTasks + 0x8
adds r4, r0, r1
ldrh r0, [r4, 0x2]
adds r0, 0x1
strh r0, [r4, 0x2]
movs r1, 0x2
ldrsh r0, [r4, r1]
movs r2, 0x6
ldrsh r1, [r4, r2]
bl __modsi3
cmp r0, 0
bne _081BE95C
strh r0, [r4, 0x2]
ldrh r0, [r4, 0x4]
subs r0, 0x1
strh r0, [r4, 0x4]
ldrh r0, [r4]
negs r0, r0
strh r0, [r4]
ldrh r0, [r4, 0x8]
negs r0, r0
strh r0, [r4, 0x8]
movs r1, 0
ldrsh r0, [r4, r1]
movs r2, 0x8
ldrsh r1, [r4, r2]
bl SetCameraPanning
movs r1, 0x4
ldrsh r0, [r4, r1]
cmp r0, 0
bne _081BE95C
bl sub_81BE968
adds r0, r5, 0
bl DestroyTask
bl InstallCameraPanAheadCallback
_081BE95C:
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end sub_81BE900
thumb_func_start sub_81BE968
sub_81BE968: @ 81BE968
push {lr}
ldr r0, =sub_81BE9C0
bl FindTaskIdByFunc
lsls r0, 24
lsrs r2, r0, 24
cmp r2, 0xFF
beq _081BE988
ldr r0, =gTasks
lsls r1, r2, 2
adds r1, r2
lsls r1, 3
adds r1, r0
ldrh r0, [r1, 0x8]
adds r0, 0x1
strh r0, [r1, 0x8]
_081BE988:
pop {r0}
bx r0
.pool
thumb_func_end sub_81BE968
thumb_func_start sub_81BE994
sub_81BE994: @ 81BE994
push {lr}
ldr r0, =gUnknown_08617D94
bl LoadSpriteSheets
bl sub_81BEA20
ldr r0, =sub_81BE9C0
movs r1, 0x8
bl CreateTask
movs r0, 0x2
movs r1, 0x1
movs r2, 0x10
movs r3, 0x3
bl sp136_strengh_sound
pop {r0}
bx r0
.pool
thumb_func_end sub_81BE994
thumb_func_start sub_81BE9C0
sub_81BE9C0: @ 81BE9C0
push {r4,lr}
lsls r0, 24
lsrs r0, 24
lsls r1, r0, 2
adds r1, r0
lsls r3, r1, 3
ldr r4, =gTasks + 0x8
adds r2, r3, r4
ldrh r0, [r2, 0x2]
adds r0, 0x1
strh r0, [r2, 0x2]
lsls r0, 16
movs r1, 0xFA
lsls r1, 18
cmp r0, r1
beq _081BE9E6
ldrh r0, [r2]
cmp r0, 0x11
bne _081BE9F0
_081BE9E6:
adds r0, r4, 0
subs r0, 0x8
adds r0, r3, r0
ldr r1, =sub_81BEA00
str r1, [r0]
_081BE9F0:
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end sub_81BE9C0
thumb_func_start sub_81BEA00
sub_81BEA00: @ 81BEA00
push {r4,lr}
adds r4, r0, 0
lsls r4, 24
lsrs r4, 24
movs r0, 0xFA
lsls r0, 4
bl FreeSpriteTilesByTag
adds r0, r4, 0
bl DestroyTask
bl EnableBothScriptContexts
pop {r4}
pop {r0}
bx r0
thumb_func_end sub_81BEA00
thumb_func_start sub_81BEA20
sub_81BEA20: @ 81BEA20
push {r4-r7,lr}
movs r4, 0
ldr r5, =gUnknown_08617D64
adds r7, r5, 0x2
ldr r6, =gSprites
_081BEA2A:
lsls r0, r4, 1
adds r0, r4
lsls r0, 1
adds r1, r0, r5
ldrh r1, [r1]
adds r1, 0x78
lsls r1, 16
asrs r1, 16
adds r0, r7
movs r3, 0
ldrsh r2, [r0, r3]
ldr r0, =gUnknown_08617E60
movs r3, 0x8
bl CreateSprite
lsls r0, 24
lsrs r1, r0, 24
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
adds r0, r6
ldrb r2, [r0, 0x5]
movs r3, 0xD
negs r3, r3
adds r1, r3, 0
ands r2, r1
movs r1, 0xF
ands r2, r1
strb r2, [r0, 0x5]
strh r4, [r0, 0x2E]
adds r0, r4, 0x1
lsls r0, 24
lsrs r4, r0, 24
cmp r4, 0x7
bls _081BEA2A
movs r4, 0
ldr r5, =gUnknown_08617D64
adds r7, r5, 0x2
ldr r6, =gSprites
_081BEA78:
lsls r0, r4, 1
adds r0, r4
lsls r0, 1
adds r1, r0, r5
ldrh r1, [r1]
adds r1, 0x73
lsls r1, 16
asrs r1, 16
adds r0, r7
ldrh r2, [r0]
subs r2, 0x3
lsls r2, 16
asrs r2, 16
ldr r0, =gUnknown_08617E34
movs r3, 0x8
bl CreateSprite
lsls r0, 24
lsrs r1, r0, 24
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
adds r0, r6
ldrb r2, [r0, 0x5]
movs r3, 0xD
negs r3, r3
adds r1, r3, 0
ands r2, r1
movs r1, 0xF
ands r2, r1
strb r2, [r0, 0x5]
strh r4, [r0, 0x2E]
adds r0, r4, 0x1
lsls r0, 24
lsrs r4, r0, 24
cmp r4, 0x7
bls _081BEA78
pop {r4-r7}
pop {r0}
bx r0
.pool
thumb_func_end sub_81BEA20
thumb_func_start sub_81BEAD8
sub_81BEAD8: @ 81BEAD8
push {r4,lr}
adds r4, r0, 0
ldrh r0, [r4, 0x30]
adds r0, 0x2
strh r0, [r4, 0x30]
movs r1, 0x30
ldrsh r0, [r4, r1]
lsrs r1, r0, 31
adds r0, r1
asrs r0, 1
strh r0, [r4, 0x26]
movs r0, 0x22
ldrsh r3, [r4, r0]
movs r1, 0x26
ldrsh r0, [r4, r1]
adds r3, r0
ldr r2, =gUnknown_08617D64
movs r0, 0x2E
ldrsh r1, [r4, r0]
lsls r0, r1, 1
adds r0, r1
lsls r0, 1
adds r2, 0x4
adds r0, r2
movs r1, 0
ldrsh r0, [r0, r1]
cmp r3, r0
ble _081BEB1A
adds r0, r4, 0
bl DestroySprite
bl sub_81BE968
_081BEB1A:
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end sub_81BEAD8
.align 2, 0 @ Don't pad with nop.

View File

@ -5,893 +5,6 @@
.text
thumb_func_start sub_81BEB24
sub_81BEB24: @ 81BEB24
push {r4,r5,lr}
movs r4, 0
ldr r5, =gUnknown_08617DA4
_081BEB2A:
lsls r2, r4, 2
adds r2, r5
ldrb r0, [r2]
adds r0, 0x7
ldrb r1, [r2, 0x1]
adds r1, 0x7
ldrh r2, [r2, 0x2]
bl MapGridSetMetatileIdAt
adds r0, r4, 0x1
lsls r0, 24
lsrs r4, r0, 24
cmp r4, 0x11
bls _081BEB2A
bl DrawWholeMapView
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end sub_81BEB24
thumb_func_start sub_81BEB54
sub_81BEB54: @ 81BEB54
push {lr}
ldr r0, =sub_81BED50
movs r1, 0x9
bl CreateTask
pop {r0}
bx r0
.pool
thumb_func_end sub_81BEB54
thumb_func_start sub_81BEB68
sub_81BEB68: @ 81BEB68
push {lr}
ldr r0, =sub_81BEBF4
movs r1, 0x9
bl CreateTask
pop {r0}
bx r0
.pool
thumb_func_end sub_81BEB68
thumb_func_start sub_81BEB7C
sub_81BEB7C: @ 81BEB7C
push {lr}
ldr r0, =sub_81BF028
movs r1, 0x9
bl CreateTask
pop {r0}
bx r0
.pool
thumb_func_end sub_81BEB7C
thumb_func_start sub_81BEB90
sub_81BEB90: @ 81BEB90
push {r4,lr}
ldr r4, =gUnknown_0203CF14
ldr r0, [r4]
ldrh r1, [r0]
movs r0, 0x10
bl SetGpuReg
ldr r0, [r4]
ldrh r1, [r0, 0x2]
movs r0, 0x12
bl SetGpuReg
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end sub_81BEB90
thumb_func_start sub_81BEBB4
sub_81BEBB4: @ 81BEBB4
push {lr}
lsls r0, 24
lsrs r0, 24
ldr r2, =gTasks
lsls r1, r0, 2
adds r1, r0
lsls r1, 3
adds r2, r1, r2
ldrh r1, [r2, 0x8]
movs r3, 0x8
ldrsh r0, [r2, r3]
cmp r0, 0
bne _081BEBEC
ldr r0, =gUnknown_0203CF14
ldr r1, [r0]
ldrh r0, [r1]
negs r0, r0
strh r0, [r1]
movs r0, 0x2
strh r0, [r2, 0x8]
bl sub_81BEB90
b _081BEBF0
.pool
_081BEBEC:
subs r0, r1, 0x1
strh r0, [r2, 0x8]
_081BEBF0:
pop {r0}
bx r0
thumb_func_end sub_81BEBB4
thumb_func_start sub_81BEBF4
sub_81BEBF4: @ 81BEBF4
push {r4,r5,lr}
sub sp, 0xC
lsls r0, 24
lsrs r5, r0, 24
ldr r1, =gTasks
lsls r0, r5, 2
adds r0, r5
lsls r0, 3
adds r0, r1
movs r1, 0x8
ldrsh r0, [r0, r1]
cmp r0, 0x6
bls _081BEC10
b _081BED40
_081BEC10:
lsls r0, 2
ldr r1, =_081BEC24
adds r0, r1
ldr r0, [r0]
mov pc, r0
.pool
.align 2, 0
_081BEC24:
.4byte _081BEC40
.4byte _081BEC50
.4byte _081BEC88
.4byte _081BECB0
.4byte _081BECF8
.4byte _081BED00
.4byte _081BED1C
_081BEC40:
bl FreeAllWindowBuffers
movs r0, 0
movs r1, 0x7
movs r2, 0x2
bl SetBgAttribute
b _081BED04
_081BEC50:
ldr r4, =gUnknown_0203CF04
movs r0, 0x92
lsls r0, 4
bl AllocZeroed
str r0, [r4]
ldr r4, =gUnknown_0203CF08
movs r0, 0x80
lsls r0, 4
bl AllocZeroed
str r0, [r4]
movs r0, 0
movs r1, 0
movs r2, 0
bl ChangeBgX
movs r0, 0
movs r1, 0
movs r2, 0
bl ChangeBgY
b _081BECD8
.pool
_081BEC88:
ldr r0, =gUnknown_08617274
ldr r4, =gUnknown_0203CF04
ldr r1, [r4]
movs r2, 0x92
lsls r2, 3
bl CpuSet
ldr r1, [r4]
movs r2, 0x92
lsls r2, 4
movs r0, 0
movs r3, 0
bl LoadBgTiles
b _081BECD8
.pool
_081BECB0:
ldr r0, =gUnknown_0203CF08
ldr r1, [r0]
movs r0, 0
bl SetBgTilemapBuffer
ldr r1, =gUnknown_08617B94
movs r0, 0x6
str r0, [sp]
movs r0, 0xC
str r0, [sp, 0x4]
movs r0, 0x11
str r0, [sp, 0x8]
movs r0, 0
movs r2, 0xC
movs r3, 0x1D
bl CopyToBgTilemapBufferRect_ChangePalette
movs r0, 0
bl CopyBgTilemapBufferToVram
_081BECD8:
ldr r1, =gTasks
lsls r0, r5, 2
adds r0, r5
lsls r0, 3
adds r0, r1
ldrh r1, [r0, 0x8]
adds r1, 0x1
strh r1, [r0, 0x8]
b _081BED40
.pool
_081BECF8:
movs r0, 0
bl ShowBg
b _081BED04
_081BED00:
bl sub_81BEB24
_081BED04:
ldr r0, =gTasks
lsls r1, r5, 2
adds r1, r5
lsls r1, 3
adds r1, r0
ldrh r0, [r1, 0x8]
adds r0, 0x1
strh r0, [r1, 0x8]
b _081BED40
.pool
_081BED1C:
ldr r4, =gUnknown_0203CF14
movs r0, 0x4
bl Alloc
str r0, [r4]
movs r2, 0
movs r1, 0x2
strh r1, [r0]
strh r2, [r0, 0x2]
ldr r0, =sub_81BEBB4
movs r1, 0xA
bl CreateTask
adds r0, r5, 0
bl DestroyTask
bl EnableBothScriptContexts
_081BED40:
add sp, 0xC
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end sub_81BEBF4
thumb_func_start sub_81BED50
sub_81BED50: @ 81BED50
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
sub sp, 0x10
lsls r0, 24
lsrs r0, 24
mov r10, r0
ldr r1, =gTasks
lsls r0, 2
add r0, r10
lsls r0, 3
adds r0, r1
ldrh r0, [r0, 0x8]
subs r0, 0x1
lsls r0, 16
asrs r0, 16
adds r6, r1, 0
cmp r0, 0x7
bls _081BED7C
b _081BF002
_081BED7C:
lsls r0, 2
ldr r1, =_081BED90
adds r0, r1
ldr r0, [r0]
mov pc, r0
.pool
.align 2, 0
_081BED90:
.4byte _081BEDB0
.4byte _081BF002
.4byte _081BEDC4
.4byte _081BEF64
.4byte _081BEF94
.4byte _081BEFD0
.4byte _081BEFF0
.4byte _081BEFF8
_081BEDB0:
ldr r4, =gUnknown_0203CF10
movs r0, 0xC0
lsls r0, 2
bl AllocZeroed
str r0, [r4]
b _081BF002
.pool
_081BEDC4:
mov r1, r10
lsls r0, r1, 2
adds r1, r0, r1
lsls r1, 3
adds r2, r1, r6
ldrh r3, [r2, 0xE]
movs r4, 0xE
ldrsh r1, [r2, r4]
str r0, [sp, 0x8]
cmp r1, 0x5F
bgt _081BEE8A
movs r1, 0xA
ldrsh r0, [r2, r1]
cmp r0, 0x1
ble _081BEE7C
lsls r0, r3, 24
lsrs r4, r0, 24
movs r0, 0x30
bl Alloc
ldr r3, =gUnknown_0203CF10
ldr r1, [r3]
lsls r2, r4, 3
adds r1, r2, r1
str r0, [r1]
movs r5, 0
adds r4, r2, 0
_081BEDFA:
ldr r0, [r3]
adds r0, r4, r0
ldr r0, [r0]
adds r0, r5
strb r5, [r0]
adds r0, r5, 0x1
lsls r0, 16
lsrs r5, r0, 16
cmp r5, 0x2F
bls _081BEDFA
movs r5, 0
ldr r7, =gUnknown_0203CF10
adds r6, r2, 0
_081BEE14:
bl Random
lsls r0, 16
lsrs r0, 16
movs r1, 0x30
bl __umodsi3
adds r4, r0, 0
lsls r4, 16
lsrs r4, 16
bl Random
lsls r0, 16
lsrs r0, 16
movs r1, 0x30
bl __umodsi3
lsls r0, 16
lsrs r0, 16
ldr r1, [r7]
adds r1, r6, r1
ldr r1, [r1]
adds r0, r1, r0
ldrb r2, [r0]
adds r1, r4
ldrb r1, [r1]
strb r1, [r0]
ldr r0, [r7]
adds r0, r6, r0
ldr r0, [r0]
adds r0, r4
strb r2, [r0]
adds r0, r5, 0x1
lsls r0, 16
lsrs r5, r0, 16
cmp r5, 0x2F
bls _081BEE14
ldr r0, =gTasks
ldr r1, [sp, 0x8]
add r1, r10
lsls r1, 3
adds r2, r1, r0
ldrh r3, [r2, 0xE]
movs r4, 0xE
ldrsh r1, [r2, r4]
adds r6, r0, 0
cmp r1, 0x5F
bgt _081BEE78
adds r0, r3, 0x1
strh r0, [r2, 0xE]
_081BEE78:
movs r0, 0
strh r0, [r2, 0xA]
_081BEE7C:
ldr r1, [sp, 0x8]
add r1, r10
lsls r1, 3
adds r1, r6
ldrh r0, [r1, 0xA]
adds r0, 0x1
strh r0, [r1, 0xA]
_081BEE8A:
ldr r0, [sp, 0x8]
add r0, r10
lsls r0, 3
adds r0, r6
ldrb r4, [r0, 0xE]
ldrb r5, [r0, 0xC]
lsls r0, r4, 16
cmp r5, r4
bcs _081BEF32
str r0, [sp, 0xC]
_081BEE9E:
movs r6, 0
adds r0, r5, 0x1
str r0, [sp, 0x4]
lsls r4, r5, 3
movs r2, 0x5F
subs r1, r2, r5
lsls r0, r1, 1
adds r0, r1
lsls r0, 4
mov r9, r0
_081BEEB2:
ldr r0, =gUnknown_0203CF04
ldr r0, [r0]
ldr r7, =gUnknown_0203CF10
ldr r3, [r7]
adds r3, r4, r3
ldrb r2, [r3, 0x4]
adds r1, r2, 0x1
strb r1, [r3, 0x4]
lsls r2, 24
lsrs r2, 24
ldr r1, [r3]
adds r1, r2
ldrb r1, [r1]
add r1, r9
lsls r1, 16
lsrs r1, 16
movs r2, 0x1
mov r8, r2
str r2, [sp]
movs r2, 0
movs r3, 0x30
bl sub_81BF2B8
adds r0, r6, 0x1
lsls r0, 24
lsrs r6, r0, 24
cmp r6, 0
beq _081BEEB2
ldr r0, [r7]
adds r1, r4, r0
ldrb r0, [r1, 0x4]
cmp r0, 0x2F
bls _081BEF24
ldr r0, [r1]
bl Free
ldr r0, [r7]
adds r0, r4, r0
movs r1, 0
str r1, [r0]
ldr r1, [sp, 0x8]
add r1, r10
lsls r1, 3
ldr r4, =gTasks
adds r1, r4
ldrh r0, [r1, 0xC]
adds r0, 0x1
strh r0, [r1, 0xC]
mov r0, r8
ands r5, r0
cmp r5, 0x1
bne _081BEF24
ldr r0, =gUnknown_0203CF14
ldr r1, [r0]
ldrh r0, [r1, 0x2]
subs r0, 0x1
strh r0, [r1, 0x2]
_081BEF24:
ldr r1, [sp, 0x4]
lsls r0, r1, 16
lsrs r5, r0, 16
ldr r2, [sp, 0xC]
lsrs r0, r2, 16
cmp r5, r0
bcc _081BEE9E
_081BEF32:
ldr r0, =gUnknown_0203CF04
ldr r1, [r0]
movs r2, 0x92
lsls r2, 4
movs r0, 0
movs r3, 0
bl LoadBgTiles
ldr r0, =gUnknown_0203CF10
ldr r0, [r0]
movs r4, 0xBE
lsls r4, 2
adds r0, r4
ldrb r0, [r0, 0x4]
cmp r0, 0x2F
bhi _081BF002
b _081BF014
.pool
_081BEF64:
movs r0, 0
bl UnsetBgTilemapBuffer
ldr r0, =sub_81BEBB4
bl FindTaskIdByFunc
lsls r0, 24
lsrs r0, 24
cmp r0, 0xFF
beq _081BEF7C
bl DestroyTask
_081BEF7C:
ldr r0, =gUnknown_0203CF14
ldr r1, [r0]
movs r0, 0
strh r0, [r1]
strh r0, [r1, 0x2]
bl sub_81BEB90
b _081BF002
.pool
_081BEF94:
ldr r4, =gUnknown_0203CF14
ldr r0, [r4]
bl Free
movs r5, 0
str r5, [r4]
ldr r4, =gUnknown_0203CF10
ldr r0, [r4]
bl Free
str r5, [r4]
ldr r4, =gUnknown_0203CF04
ldr r0, [r4]
bl Free
str r5, [r4]
ldr r4, =gUnknown_0203CF08
ldr r0, [r4]
bl Free
str r5, [r4]
b _081BF002
.pool
_081BEFD0:
movs r0, 0xC
movs r1, 0x2
bl SetGpuRegBits
movs r0, 0x8
movs r1, 0
bl SetGpuRegBits
movs r0, 0
movs r1, 0x7
movs r2, 0
bl SetBgAttribute
bl sub_81971D0
b _081BF002
_081BEFF0:
movs r0, 0
bl ShowBg
b _081BF002
_081BEFF8:
mov r0, r10
bl DestroyTask
bl EnableBothScriptContexts
_081BF002:
ldr r0, =gTasks
mov r2, r10
lsls r1, r2, 2
add r1, r10
lsls r1, 3
adds r1, r0
ldrh r0, [r1, 0x8]
adds r0, 0x1
strh r0, [r1, 0x8]
_081BF014:
add sp, 0x10
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r0}
bx r0
.pool
thumb_func_end sub_81BED50
thumb_func_start sub_81BF028
sub_81BF028: @ 81BF028
push {r4-r7,lr}
mov r7, r8
push {r7}
sub sp, 0x18
lsls r0, 24
lsrs r7, r0, 24
ldr r1, =gTasks
lsls r0, r7, 2
adds r0, r7
lsls r0, 3
adds r0, r1
ldrh r0, [r0, 0x8]
subs r0, 0x1
lsls r0, 16
asrs r0, 16
cmp r0, 0x7
bls _081BF04C
b _081BF228
_081BF04C:
lsls r0, 2
ldr r1, =_081BF060
adds r0, r1
ldr r0, [r0]
mov pc, r0
.pool
.align 2, 0
_081BF060:
.4byte _081BF080
.4byte _081BF0B4
.4byte _081BF0DC
.4byte _081BF0F0
.4byte _081BF148
.4byte _081BF170
.4byte _081BF1CC
.4byte _081BF224
_081BF080:
ldr r4, =gUnknown_0203CF0C
movs r0, 0x14
bl AllocZeroed
str r0, [r4]
movs r0, 0x80
bl AllocZeroed
ldr r1, [r4]
str r0, [r1]
movs r0, 0x8
bl AllocZeroed
ldr r1, [r4]
str r0, [r1, 0x4]
movs r0, 0x80
lsls r0, 2
bl AllocZeroed
ldr r1, [r4]
str r0, [r1, 0xC]
movs r0, 0
strh r0, [r1, 0x10]
b _081BF228
.pool
_081BF0B4:
ldr r0, =gUnknown_0203CF0C
ldr r0, [r0]
ldr r1, [r0]
movs r5, 0
ldr r2, =gRootFossil_Gfx
_081BF0BE:
adds r0, r5, r2
ldrb r0, [r0]
strb r0, [r1]
adds r0, r5, 0x1
lsls r0, 16
lsrs r5, r0, 16
adds r1, 0x1
cmp r5, 0x7F
bls _081BF0BE
b _081BF228
.pool
_081BF0DC:
ldr r0, =gUnknown_0203CF0C
ldr r0, [r0]
ldr r1, [r0, 0x4]
ldr r0, [r0]
str r0, [r1]
movs r0, 0x80
strh r0, [r1, 0x4]
b _081BF228
.pool
_081BF0F0:
mov r1, sp
ldr r0, =gUnknown_08617E00
ldm r0!, {r2-r4}
stm r1!, {r2-r4}
ldm r0!, {r2-r4}
stm r1!, {r2-r4}
ldr r4, =gUnknown_0203CF0C
ldr r0, [r4]
ldr r0, [r0, 0x4]
str r0, [sp, 0xC]
movs r2, 0x10
negs r2, r2
mov r0, sp
movs r1, 0x80
movs r3, 0x1
bl CreateSprite
ldr r1, [r4]
movs r3, 0
strb r0, [r1, 0x8]
ldr r2, =gSprites
ldr r0, [r4]
ldrb r1, [r0, 0x8]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
adds r0, r2
adds r0, 0x28
strb r3, [r0]
ldr r3, [r4]
ldrb r1, [r3, 0x8]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
adds r0, r2
ldrh r1, [r0, 0x20]
strh r1, [r0, 0x2E]
ldrb r1, [r3, 0x8]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
adds r0, r2
movs r1, 0x1
strh r1, [r0, 0x30]
_081BF148:
movs r5, 0
ldr r2, =gUnknown_0203CF0C
_081BF14C:
ldr r0, [r2]
ldr r1, [r0, 0xC]
lsls r0, r5, 1
adds r0, r1
strh r5, [r0]
adds r0, r5, 0x1
lsls r0, 16
lsrs r5, r0, 16
cmp r5, 0xFF
bls _081BF14C
b _081BF228
.pool
_081BF170:
movs r5, 0
movs r6, 0xFF
ldr r0, =0x000001ff
mov r8, r0
_081BF178:
bl Random
adds r4, r6, 0
ands r4, r0
bl Random
adds r1, r6, 0
ands r1, r0
ldr r0, =gUnknown_0203CF0C
ldr r3, [r0]
ldr r0, [r3, 0xC]
lsls r1, 1
adds r1, r0
ldrh r2, [r1]
lsls r4, 1
adds r4, r0
ldrh r0, [r4]
strh r0, [r1]
strh r2, [r4]
adds r0, r5, 0x1
lsls r0, 16
lsrs r5, r0, 16
cmp r5, r8
bls _081BF178
ldr r2, =gSprites
ldrb r1, [r3, 0x8]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
adds r2, 0x1C
adds r0, r2
ldr r1, =sub_81BF248
str r1, [r0]
b _081BF228
.pool
_081BF1CC:
ldr r3, =gSprites
ldr r5, =gUnknown_0203CF0C
ldr r0, [r5]
ldrb r1, [r0, 0x8]
lsls r0, r1, 4
adds r0, r1
lsls r2, r0, 2
adds r0, r3, 0
adds r0, 0x1C
adds r0, r2, r0
ldr r1, [r0]
ldr r0, =SpriteCallbackDummy
cmp r1, r0
bne _081BF238
adds r0, r2, r3
bl DestroySprite
ldr r0, [r5]
ldr r0, [r0, 0xC]
bl Free
ldr r0, [r5]
movs r4, 0
str r4, [r0, 0xC]
ldr r0, [r0, 0x4]
bl Free
ldr r0, [r5]
str r4, [r0, 0x4]
ldr r0, [r0]
bl Free
ldr r0, [r5]
str r4, [r0]
bl Free
str r4, [r5]
b _081BF228
.pool
_081BF224:
bl EnableBothScriptContexts
_081BF228:
ldr r0, =gTasks
lsls r1, r7, 2
adds r1, r7
lsls r1, 3
adds r1, r0
ldrh r0, [r1, 0x8]
adds r0, 0x1
strh r0, [r1, 0x8]
_081BF238:
add sp, 0x18
pop {r3}
mov r8, r3
pop {r4-r7}
pop {r0}
bx r0
.pool
thumb_func_end sub_81BF028
thumb_func_start sub_81BF248
sub_81BF248: @ 81BF248
push {r4,r5,lr}
sub sp, 0x4
adds r5, r0, 0
ldr r0, =gUnknown_0203CF0C
ldr r0, [r0]
ldrh r0, [r0, 0x10]
cmp r0, 0xFF
bls _081BF268
ldr r0, =SpriteCallbackDummy
str r0, [r5, 0x1C]
b _081BF2B0
.pool
_081BF268:
ldrh r1, [r5, 0x22]
movs r2, 0x22
ldrsh r0, [r5, r2]
cmp r0, 0x5F
ble _081BF2AC
movs r4, 0
_081BF274:
ldr r0, =gUnknown_0203CF0C
ldr r3, [r0]
ldr r0, [r3]
ldrh r1, [r3, 0x10]
adds r2, r1, 0x1
strh r2, [r3, 0x10]
lsls r1, 16
ldr r2, [r3, 0xC]
lsrs r1, 15
adds r1, r2
ldrh r1, [r1]
movs r2, 0
str r2, [sp]
movs r3, 0x10
bl sub_81BF2B8
adds r0, r4, 0x1
lsls r0, 24
lsrs r4, r0, 24
cmp r4, 0x1
bls _081BF274
adds r0, r5, 0
movs r1, 0
bl StartSpriteAnim
b _081BF2B0
.pool
_081BF2AC:
adds r0, r1, 0x1
strh r0, [r5, 0x22]
_081BF2B0:
add sp, 0x4
pop {r4,r5}
pop {r0}
bx r0
thumb_func_end sub_81BF248
thumb_func_start sub_81BF2B8
sub_81BF2B8: @ 81BF2B8
push {r4-r7,lr}

View File

@ -1,174 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.align 1
gUnknown_0860A4AC:: @ 860A4AC
.2byte 0x0044, 0x005a, 0x0075, 0x00f3, 0x0020, 0x00af, 0x00b3, 0x00ed, 0x0149, 0x0108, 0x011c, 0x0143, 0x008a, 0x0137, 0x00ad, 0x00dc
.2byte 0x000c, 0x00da, 0x00d8, 0x011b, 0x00d9, 0x0117, 0xffff, 0x00de, 0x0095, 0xffff
.align 1
gUnknown_0860A4E0:: @ 860A4E0
.2byte 0x0001, 0x0001, 0x0001, 0x0004, 0x0001, 0x0001, 0x0001, 0x0000, 0x0005, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001
.2byte 0x0001, 0x0002, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0005, 0x0005, 0x0004, 0x0005, 0x0001, 0x0003, 0x0001
.2byte 0x0003, 0x0005, 0x0001, 0x0007, 0x0001, 0x0007, 0x0007, 0x0001, 0x0005, 0x0002, 0x0004, 0x0001, 0x0001, 0x0001, 0x0005, 0x0001
.2byte 0x0002, 0x0004, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001
.2byte 0x0001, 0x0007, 0x0004, 0x0004, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0004, 0x0001, 0x0001, 0x0001, 0x0004
.2byte 0x0005, 0x0002, 0x0004, 0x0001, 0x0004, 0x0001, 0x0007, 0x0002, 0x0001, 0x0005, 0x0007, 0x0003, 0x0003, 0x0004, 0x0003, 0x0003
.2byte 0x0003, 0x0003, 0x0003, 0x0002, 0x0004, 0x0001, 0x0005, 0x0001, 0x0001, 0x0004, 0x0005, 0x0003, 0x0001, 0x0002, 0x0001, 0x0005
.2byte 0x0004, 0x0003, 0x0006, 0x0004, 0x0003, 0x0003, 0x0003, 0x0002, 0x0004, 0x0001, 0x0001, 0x0001, 0x0005, 0x0001, 0x0001, 0x0007
.2byte 0x0002, 0x0002, 0x0001, 0x0001, 0x0004, 0x0004, 0x0004, 0x0001, 0x0004, 0x0004, 0x0001, 0x0001, 0x0001, 0x0001, 0x0007, 0x0007
.2byte 0x0006, 0x0003, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0002, 0x0003, 0x0001, 0x0001, 0x0004, 0x0004
.2byte 0x0003, 0x0003, 0x0003, 0x0001, 0x0004, 0x0007, 0x0007, 0x0005, 0x0007, 0x0001, 0x0007, 0x0001, 0x0005, 0x0000, 0x0004, 0x0004
.2byte 0x0004, 0x0004, 0x0004, 0x0002, 0x0002, 0x0006, 0x0003, 0x0006, 0x0004, 0x0004, 0x0002, 0x0005, 0x0002, 0x0001, 0x0001, 0x0006
.2byte 0x0006, 0x0006, 0x0001, 0x0001, 0x0001, 0x0001, 0x0002, 0x0006, 0x0001, 0x0004, 0x0001, 0x0001, 0x0003, 0x0001, 0x0001, 0x0001
.2byte 0x0001, 0x0001, 0x0004, 0x0001, 0x0001, 0x0003
.align 1
gUnknown_0860A68C:: @ 860A68C
.2byte 0x0004, 0xfffd, 0xfffa
.align 1
gUnknown_0860A692:: @ 860A692
.2byte 0x0004, 0x0004, 0x0006, 0x0006, 0x0007, 0x0006, 0x0002
.align 1
gUnknown_0860A6A0:: @ 860A6A0
.2byte 0x0091, 0x0003, 0x00fa, 0x0003, 0x00be, 0x0003, 0x0080, 0x0003, 0x006e, 0x0003, 0x0098, 0x0003, 0x0143, 0x0003, 0x0123, 0x0003
.2byte 0x007f, 0x0003, 0x014a, 0x0003, 0x0039, 0x0003, 0x0134, 0x0003, 0x0038, 0x0003, 0x003d, 0x0003, 0x015a, 0x0000, 0x0037, 0x0003
.2byte 0x0160, 0x0003, 0x0137, 0x0003, 0x0057, 0x0003, 0x004c, 0xfffc, 0x013b, 0xfffc, 0x00ac, 0xfffc, 0x0035, 0xfffc, 0x00dd, 0xfffc
.2byte 0x007e, 0xfffc, 0x0101, 0xfffc, 0x0034, 0xfffc, 0x0133, 0xfffc, 0x012b, 0xfffc, 0x011c, 0xfffc, 0x0053, 0xfffc, 0x0007, 0xfffc
.2byte 0x004c, 0xfffc, 0xffff, 0x0000
.align 1
gUnknown_0860A728:: @ 860A728
.2byte 0x013b, 0x0003, 0x00ac, 0x0003, 0x0035, 0x0003, 0x00dd, 0x0003, 0x007e, 0x0003, 0x0101, 0x0003, 0x0034, 0x0003, 0x0133, 0x0003
.2byte 0x012b, 0x0003, 0x011c, 0x0003, 0x0053, 0x0003, 0x0007, 0x0003, 0x004c, 0x0005, 0x00eb, 0x0003, 0x00ea, 0x0003, 0x00ec, 0x0003
.2byte 0x0137, 0x0003, 0xffff, 0x0000
.align 1
gUnknown_0860A770:: @ 860A770
.2byte 0x0137, 0x0003, 0x004c, 0xfffd, 0xffff, 0x0000
.align 1
gUnknown_0860A77C:: @ 860A77C
.2byte 0x0137, 0x0003, 0x004c, 0xfffd, 0xffff, 0x0000
.align 1
gUnknown_0860A788:: @ 860A788
.2byte 0x0055, 0x0003, 0x0009, 0x0003, 0x00d1, 0x0003, 0x0054, 0x0003, 0x00c0, 0x0003, 0x015f, 0x0003, 0x0056, 0x0000, 0x0057, 0x0003
.2byte 0x0158, 0x0003, 0xffff, 0x0000
.align 1
gUnknown_0860A7B0:: @ 860A7B0
.2byte 0x0005, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003
.align 1
gUnknown_0860A7BE:: @ 860A7BE
.2byte 0x0005, 0x0005, 0x0005, 0x0005, 0x0005
.align 1
gUnknown_0860A7C8:: @ 860A7C8
.2byte 0x0004
.align 1
gUnknown_0860A7CA:: @ 860A7CA
.2byte 0x0005
.align 1
gUnknown_0860A7CC:: @ 860A7CC
.2byte 0x0005
.align 1
gUnknown_0860A7CE:: @ 860A7CE
.2byte 0x0003
.align 1
gUnknown_0860A7D0:: @ 860A7D0
.2byte 0x0003
.align 1
gUnknown_0860A7D2:: @ 860A7D2
.2byte 0x0004
.align 1
gUnknown_0860A7D4:: @ 860A7D4
.2byte 0x0003
.align 1
gUnknown_0860A7D6:: @ 860A7D6
.2byte 0x0006
.align 1
gUnknown_0860A7D8:: @ 860A7D8
.2byte 0x0006
.align 1
gUnknown_0860A7DA:: @ 860A7DA
.2byte 0x0006
.align 1
gUnknown_0860A7DC:: @ 860A7DC
.2byte 0x0004
.align 1
gUnknown_0860A7DE:: @ 860A7DE
.2byte 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002
.align 1
gUnknown_0860A7EC:: @ 860A7EC
.2byte 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004
.align 1
gUnknown_0860A7FA:: @ 860A7FA
.2byte 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff
.align 1
gUnknown_0860A808:: @ 860A808
.2byte 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002
.align 1
gUnknown_0860A816:: @ 860A816
.2byte 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004
.align 1
gUnknown_0860A824:: @ 860A824
.2byte 0xfffe, 0xfffe, 0xfffe, 0xfffe, 0xfffe, 0xfffe, 0xfffe
.align 2
gUnknown_0860A834:: @ 860A834
.4byte gUnknown_0860A4E0
.4byte gUnknown_0860A68C
.4byte gUnknown_0860A692
.4byte gUnknown_0860A6A0
.4byte gUnknown_0860A728
.4byte gUnknown_0860A770
.4byte gUnknown_0860A77C
.4byte gUnknown_0860A788
.4byte gUnknown_0860A7B0
.4byte gUnknown_0860A7BE
.4byte gUnknown_0860A7C8
.4byte gUnknown_0860A7CA
.4byte gUnknown_0860A7CC
.4byte gUnknown_0860A7CE
.4byte gUnknown_0860A7D0
.4byte gUnknown_0860A7D2
.4byte gUnknown_0860A7D4
.4byte gUnknown_0860A7D6
.4byte gUnknown_0860A7D8
.4byte gUnknown_0860A7DA
.4byte gUnknown_0860A7DA
.4byte gUnknown_0860A7DC
.4byte gUnknown_0860A7DE
.4byte gUnknown_0860A7EC
.4byte gUnknown_0860A7FA
.4byte gUnknown_0860A808
.4byte gUnknown_0860A816
.4byte gUnknown_0860A824
.align 1
gUnknown_0860A8A4:: @ 860A8A4
.2byte 0x0097, 0x00b2, 0x00bc, 0x008c, 0x00b4, 0x00b5, 0x0093, 0x006a, 0x0091, 0x005e, 0x0030, 0x002a, 0x0095, 0x001c, 0x001d, 0x0064
.2byte 0x0060, 0xffff

View File

@ -1,81 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.align 2
gUnknown_085B27C8:: @ 85B27C8
.byte 0x01, 0x04, 0x01, 0x00
.4byte sub_81375A8
.byte 0x02, 0x04, 0x01, 0x00
.4byte sub_81375A8
.byte 0x03, 0x04, 0x01, 0x00
.4byte sub_81375A8
.byte 0x05, 0x04, 0x01, 0x00
.4byte sub_81375A8
.byte 0x06, 0x04, 0x01, 0x00
.4byte sub_81375A8
.byte 0x07, 0x04, 0x01, 0x00
.4byte sub_81375A8
.byte 0x08, 0x04, 0x01, 0x00
.4byte sub_81375A8
.byte 0x09, 0x04, 0x01, 0x00
.4byte sub_81375A8
.byte 0x04, 0x01, 0x00, 0x01
.4byte sub_81373F0
.byte 0x04, 0x02, 0x00, 0x01
.4byte sub_81373F0
.byte 0x04, 0x03, 0x00, 0x01
.4byte sub_81373F0
.byte 0x04, 0x05, 0x00, 0x01
.4byte sub_81373F0
.byte 0x04, 0x06, 0x00, 0x01
.4byte sub_81373F0
.byte 0x04, 0x07, 0x00, 0x01
.4byte sub_81373F0
.byte 0x04, 0x08, 0x00, 0x01
.4byte sub_81373F0
.byte 0x04, 0x09, 0x00, 0x01
.4byte sub_81373F0
.byte 0x00, 0x00, 0x00, 0x00
.4byte NULL
.align 2
gCaveTransitionPalette_White:: @ 85B2850
.incbin "graphics/misc/cave_transition_white.gbapal"
.align 2
gCaveTransitionPalette_Black:: @ 85B2870
.incbin "graphics/misc/cave_transition_black.gbapal"
.align 2
gUnknown_085B2890:: @ 85B2890
.incbin "graphics/misc/85B2890.gbapal"
.align 2
gUnknown_085B28A0:: @ 85B28A0
.incbin "graphics/misc/85B28A0.gbapal"
.align 2
gCaveTransitionTilemap:: @ 85B28B0
.incbin "graphics/misc/cave_transition_map.bin.lz"
.align 2
gCaveTransitionTiles:: @ 85B2A90
.incbin "graphics/misc/cave_transition.4bpp.lz"

View File

@ -1,98 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.align 2
gUnknown_08617274:: @ 8617274
.space 0x20
.incbin "graphics/misc/mirage_tower.4bpp"
.align 2
gUnknown_08617B94:: @ 8617B94
.incbin "graphics/misc/mirage_tower.bin"
.align 2
gRootFossil_Pal:: @ 8617C24
.incbin "graphics/misc/fossil.gbapal"
.align 2
gRootFossil_Gfx:: @ 8617C44
.incbin "graphics/misc/fossil.4bpp"
.align 2
gMirageTowerCrumbles_Gfx:: @ 8617CC4
.incbin "graphics/misc/mirage_tower_crumbles.4bpp"
.align 2
gMirageTowerCrumbles_Palette:: @ 8617D44
.incbin "graphics/misc/mirage_tower_crumbles.gbapal"
.align 1
gUnknown_08617D64:: @ 8617D64
.2byte 0x0000, 0x000a, 0x0041, 0x0011, 0x0003, 0x0032, 0xfff4, 0x0000, 0x004b, 0x000a, 0x000f, 0x005a, 0x0007, 0x0008, 0x0041, 0xffee
.2byte 0x0005, 0x004b, 0x0016, 0xfff6, 0x0037, 0xffe8, 0xfffc, 0x0041
.align 2
gUnknown_08617D94:: @ 8617D94
obj_tiles gMirageTowerCrumbles_Gfx, 0x0080, 0x0fa0
null_obj_tiles
.align 2
gUnknown_08617DA4:: @ 8617DA4
.byte 0x12, 0x35, 0x51, 0x02, 0x13, 0x35, 0x51, 0x02, 0x14, 0x35, 0x51, 0x02, 0x12, 0x36, 0x51, 0x02, 0x13, 0x36, 0x51, 0x02, 0x14, 0x36, 0x51, 0x02, 0x12, 0x37, 0x51, 0x02, 0x13, 0x37, 0x51, 0x02
.byte 0x14, 0x37, 0x51, 0x02, 0x12, 0x38, 0x51, 0x02, 0x13, 0x38, 0x51, 0x02, 0x14, 0x38, 0x51, 0x02, 0x12, 0x39, 0x59, 0x02, 0x13, 0x39, 0x59, 0x02, 0x14, 0x39, 0x59, 0x02, 0x12, 0x3a, 0x21, 0x01
.byte 0x13, 0x3a, 0x21, 0x01, 0x14, 0x3a, 0x21, 0x01
.align 2
gSpriteAnim_8617DEC:: @ 8617DEC
.2byte 0x0000, 0x0001, 0xffff, 0x0000
.align 2
gOamData_8617DF4:: @ 8617DF4
.2byte 0x0000, 0x4000, 0x3000, 0x0000
.align 2
gSpriteAnimTable_8617DFC:: @ 8617DFC
.4byte gSpriteAnim_8617DEC
.align 2
gUnknown_08617E00:: @ 8617E00
spr_template 0xffff, 0xffff, gOamData_8617DF4, gSpriteAnimTable_8617DFC, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
.align 2
gUnknown_08617E18:: @ 8617E18
.byte 0x3b, 0x43, 0x61, 0x00, 0x0f, 0x05, 0xff, 0x9b
.align 2
gSpriteAnim_8617E20:: @ 8617E20
.2byte 0x0000, 0x000c, 0xfffe, 0x0000
.align 2
gSpriteAnimTable_8617E28:: @ 8617E28
.4byte gSpriteAnim_8617E20
.align 2
gUnknown_08617E2C:: @ 8617E2C
.2byte 0x0000, 0x0000, 0x0000, 0x0000
.align 2
gUnknown_08617E34:: @ 8617E34
spr_template 0x0fa0, 0xffff, gUnknown_08617E2C, gSpriteAnimTable_8617E28, NULL, gDummySpriteAffineAnimTable, sub_81BEAD8
.align 2
gSpriteAnim_8617E4C:: @ 8617E4C
.2byte 0x0000, 0x000c, 0xfffe, 0x0000
.align 2
gSpriteAnim_8617E54:: @ 8617E54
.4byte gSpriteAnim_8617E4C
.align 2
gOamData_8617E58:: @ 8617E58
.2byte 0x0000, 0x4000, 0x0000, 0x0000
.align 2
gUnknown_08617E60:: @ 8617E60
spr_template 0x0fa0, 0xffff, gOamData_8617E58, gSpriteAnim_8617E54, NULL, gDummySpriteAffineAnimTable, sub_81BEAD8

View File

@ -353,6 +353,91 @@ struct BattleResults
u8 catchAttempts[11]; // 0x36
};
struct BattleTv_Side
{
u32 spikesMonId:3;
u32 reflectMonId:3;
u32 lightScreenMonId:3;
u32 safeguardMonId:3;
u32 mistMonId:3;
u32 futureSightMonId:3;
u32 doomDesireMonId:3;
u32 perishSongMonId:3;
u32 wishMonId:3;
u32 grudgeMonId:3;
u32 usedMoveSlot:2;
u32 spikesMoveSlot:2;
u32 reflectMoveSlot:2;
u32 lightScreenMoveSlot:2;
u32 safeguardMoveSlot:2;
u32 mistMoveSlot:2;
u32 futureSightMoveSlot:2;
u32 doomDesireMoveSlot:2;
u32 perishSongMoveSlot:2;
u32 wishMoveSlot:2;
u32 grudgeMoveSlot:2;
u32 destinyBondMonId:3;
u32 destinyBondMoveSlot:2;
u32 faintCause:4;
u32 faintCauseMonId:3;
u32 explosion:1;
u32 explosionMoveSlot:2;
u32 explosionMonId:3;
u32 perishSong:1;
};
struct BattleTv_Position
{
u32 curseMonId:3;
u32 leechSeedMonId:3;
u32 nightmareMonId:3;
u32 wrapMonId:3;
u32 attractMonId:3;
u32 confusionMonId:3;
u32 curseMoveSlot:2;
u32 leechSeedMoveSlot:2;
u32 nightmareMoveSlot:2;
u32 wrapMoveSlot:2;
u32 attractMoveSlot:2;
u32 confusionMoveSlot:2;
u32 waterSportMoveSlot:2;
u32 waterSportMonId:3;
u32 mudSportMonId:3;
u32 mudSportMoveSlot:2;
u32 ingrainMonId:3;
u32 ingrainMoveSlot:2;
u32 attackedByMonId:3;
u32 attackedByMoveSlot:2;
};
struct BattleTv_Mon
{
u32 psnMonId:3;
u32 badPsnMonId:3;
u32 brnMonId:3;
u32 prlzMonId:3;
u32 slpMonId:3;
u32 frzMonId:3;
u32 psnMoveSlot:2;
u32 badPsnMoveSlot:2;
u32 brnMoveSlot:2;
u32 prlzMoveSlot:2;
u32 slpMoveSlot:2;
u32 frzMoveSlot:2;
};
struct BattleTv
{
struct BattleTv_Mon mon[2][6]; // [side][partyId]
struct BattleTv_Position pos[2][2]; // [side][flank]
struct BattleTv_Side side[2]; // [side]
};
struct BattleTvMovePoints
{
s16 points[2][PARTY_SIZE * 4];
};
struct BattleStruct
{
u8 turnEffectsTracker;
@ -432,7 +517,7 @@ struct BattleStruct
u8 field_B0;
u8 hpScale;
u8 synchronizeMoveEffect;
u8 field_B3;
bool8 anyMonHasTransformed;
void (*savedCallback)(void);
u16 usedHeldItems[MAX_BATTLERS_COUNT];
u8 chosenItem[4]; // why is this an u8?
@ -457,9 +542,9 @@ struct BattleStruct
u8 wishPerishSongBattlerId;
bool8 overworldWeatherDone;
u8 atkCancellerTracker;
u8 field_1A4[96];
u8 field_204[104];
u8 field_26C[40];
struct BattleTvMovePoints tvMovePoints;
struct BattleTv tv;
u8 notSureWhatFieldLol[0x28];
u8 AI_monToSwitchIntoId[MAX_BATTLERS_COUNT];
u8 field_298[8];
u8 field_2A0;

View File

@ -1,11 +0,0 @@
#ifndef GUARD_BATTLE_LINK_817C95C_H
#define GUARD_BATTLE_LINK_817C95C_H
void sub_817C95C(u16 stringId);
void sub_817E0FC(u16 move, u16 weatherFlags, struct DisableStruct *disableStructPtr);
void sub_817E32C(u8 animationId);
void sub_817E3F4(void);
void sub_817F2A8(void);
u8 GetBattlerMoveSlotId(u8 bank, u16 move);
#endif // GUARD_BATTLE_LINK_817C95C_H

View File

@ -4,16 +4,16 @@
#define WINDOW_CLEAR 0x1
#define WINDOW_x80 0x80
void AI_CalcDmg(u8 bankAtk, u8 bankDef);
u8 TypeCalc(u16 move, u8 bankAtk, u8 bankDef);
void AI_CalcDmg(u8 battlerIdAtk, u8 battlerIdDef);
u8 TypeCalc(u16 move, u8 battlerIdAtk, u8 battlerIdDef);
u8 AI_TypeCalc(u16 move, u16 targetSpecies, u8 targetAbility);
u8 GetBattlerTurnOrderNum(u8 bank);
u8 GetBattlerTurnOrderNum(u8 battlerId);
void SetMoveEffect(bool8 primary, u8 certain);
void BattleDestroyYesNoCursorAt(u8 cursorPosition);
void BattleCreateYesNoCursorAt(u8 cursorPosition);
void BufferMoveToLearnIntoBattleTextBuff2(void);
void HandleBattleWindow(u8 xStart, u8 yStart, u8 xEnd, u8 yEnd, u8 flags);
bool8 UproarWakeUpCheck(u8 bank);
bool8 UproarWakeUpCheck(u8 battlerId);
extern void (* const gBattleScriptingCommandsTable[])(void);
extern const u8 gUnknown_0831C494[][4];

11
include/battle_tv.h Normal file
View File

@ -0,0 +1,11 @@
#ifndef GUARD_BATTLE_TV_H
#define GUARD_BATTLE_TV_H
void BattleTv_SetDataBasedOnString(u16 stringId);
void BattleTv_SetDataBasedOnMove(u16 move, u16 weatherFlags, struct DisableStruct *disableStructPtr);
void BattleTv_SetDataBasedOnAnimation(u8 animationId);
void TryPutLinkBattleTvShowOnAir(void);
void BattleTv_ClearExplosionFaintCause(void);
u8 GetBattlerMoveSlotId(u8 battlerId, u16 moveId);
#endif // GUARD_BATTLE_TV_H

View File

@ -0,0 +1,7 @@
#ifndef GUARD_BRAILLE_PUZZLES_H
#define GUARD_BRAILLE_PUZZLES_H
bool8 ShouldDoBrailleFlyEffect(void);
void sub_8179918(void);
#endif // GUARD_BRAILLE_PUZZLES_H

View File

@ -22,6 +22,7 @@ extern const u8 EventScript_2713D1[];
extern const u8 EventScript_2766A2[];
extern const u8 EventScript_2766A6[];
extern const u8 gTVBravoTrainerText00[];
extern const u8 gTVBravoTrainerText01[];
extern const u8 gTVBravoTrainerText02[];
@ -381,6 +382,9 @@ extern const u8 SecretBase_RedCave1_Text_2751E1[];
extern const u8 SecretBase_RedCave1_Text_2754F6[];
extern const u8 SecretBase_RedCave1_Text_2758CC[];
//field effects
extern const u8 FieryPath_EventScript_2908FD[];
extern const u8 EventScript_290CAE[];
extern const u8 EventScript_2926F8[];
#endif //GUARD_EVENT_SCRIPTS_H

View File

@ -1,7 +0,0 @@
#ifndef GUARD_FLDEFF_GROUNDSHAKE_H
#define GUARD_FLDEFF_GROUNDSHAKE_H
void sub_81BE6B8(void);
void sub_81BE72C(void);
#endif // GUARD_FLDEFF_GROUNDSHAKE_H

View File

@ -188,11 +188,11 @@ typedef union // size = 0x24
struct {
/*0x00*/ u8 kind;
/*0x01*/ bool8 active;
/*0x02*/ u16 species;
/*0x02*/ u16 speciesOpponent;
/*0x04*/ u8 playerName[8];
/*0x0C*/ u8 linkOpponentName[8];
/*0x14*/ u16 move;
/*0x16*/ u16 species2;
/*0x16*/ u16 speciesPlayer;
/*0x18*/ u8 battleType;
/*0x19*/ u8 language;
/*0x1A*/ u8 linkOpponentLanguage;

17
include/roulette_util.h Normal file
View File

@ -0,0 +1,17 @@
#ifndef GUARD_ROULETTE_UTIL_H
#define GUARD_ROULETTE_UTIL_H
// structures
struct InnerStruct203CF18
{
u8 filler[0xC4];
};
void sub_8151B68(struct InnerStruct203CF18 *, const u8*);
void sub_8151B3C(struct InnerStruct203CF18 *);
void sub_8151CA8(struct InnerStruct203CF18 *, u8, u8);
void sub_8151C50(struct InnerStruct203CF18 *, u8, u8);
void sub_8151D28(struct InnerStruct203CF18 *, u8, u8);
void sub_8151E50(struct InnerStruct203CF18 *);
#endif // GUARD_ROULETTE_UTIL_H

View File

@ -4,17 +4,46 @@
extern u8 *const gTVStringVarPtrs[3];
void ClearTVShowData(void);
void PutPokemonTodayCaughtOnAir(void);
void sub_80EE184(void);
void sub_80EE35C(u16 foeSpecies, u16 species, u8 moveIdx, const u16 *movePtr, u16 betterMove);
void sub_80EE8C8(u16 winStreak, u8 facility);
void DoTVShow(void);
void DoTVShowInSearchOfTrainers(void);
void sub_80EDCE8(void);
void sub_80EE2CC(void);
void sub_80EE72C(void);
void sub_80EED10(void);
void sub_80EED34(void);
void sub_80EED60(u16 delta);
void sub_80F01B8(void);
void sub_80F01E8(void *src, u32 size, u8 masterIdx);
void sub_80EE4DC(struct Pokemon *pokemon, u8 ribbonMonDataIdx);
u32 GetPlayerIDAsU32(void);
bool8 GetPriceReduction(u8 newsKind);
u8 GetRibbonCount(struct Pokemon *pokemon);
void TV_PutSecretBaseVisitOnTheAir(void);
void sub_80EE184(void);
void sub_80EEA70(void);
void sub_80F14F8(TVShow *shows);
size_t sub_80EF370(int value);
bool8 Put3CheersForPokeblocksOnTheAir(const u8 *partnersName, u8 flavor, u8 unused, u8 sheen, u8 language);
size_t CountDigits(int value);
u8 GetRibbonCount(struct Pokemon *pokemon);
void sub_80EDE70(u16 nCoinsSpent);
void sub_80EDE84(u16 nCoinsSpent);
void sub_80EDD78(u16 nCoinsPaidOut);
void sub_80EEA70(void);
void sub_80EDB44(void);
void sub_80EDC60(const u16 *words);
void sub_80EDA80(void);
void sub_80F0C7C(void *src, u32 size, u8 masterIdx);
void sub_80F0BB8(void);
void sub_80ED950(bool8 flag);
void sub_80EEC80(void);
void sub_80EECA4(void);
void sub_80EECC8(void);
void sub_80EECEC(void);
void sub_80F1208(TVShow *shows);
void sub_80EE44C(u8 nMonsCaught, u8 nPkblkUsed);
void SetPokemonAnglerSpecies(u16 species);
void UpdateTVShowsPerDay(u16 days);
void PutPokemonTodayCaughtOnAir(void);
void TV_PutSecretBaseVisitOnTheAir(void);
bool8 Put3CheersForPokeblocksOnTheAir(const u8 *partnersName, u8 flavor, u8 unused, u8 sheen, u8 language);
void PutBattleUpdateOnTheAir(u8 opponentLinkPlayerId, u16 move, u16 speciesPlayer, u16 speciesOpponent);
#endif //GUARD_TV_H

View File

@ -180,7 +180,7 @@ SECTIONS {
src/wallclock.o(.text);
asm/rom6.o(.text);
src/pokeblock.o(.text);
asm/fldeff_flash.o(.text);
src/fldeff_flash.o(.text);
asm/post_battle_event_funcs.o(.text);
src/time_events.o(.text);
src/birch_pc.o(.text);
@ -236,7 +236,7 @@ SECTIONS {
src/evolution_graphics.o(.text);
src/bard_music.o(.text);
src/fldeff_teleport.o(.text);
asm/battle_link_817C95C.o(.text);
src/battle_tv.o(.text);
src/pokemon_animation.o(.text);
src/recorded_battle.o(.text);
src/battle_controller_recorded_opponent.o(.text);
@ -258,7 +258,8 @@ SECTIONS {
src/multiboot.o(.text);
src/unk_81BAD84.o(.text);
src/battle_controller_player_partner.o(.text);
asm/fldeff_groundshake.o(.text);
src/fldeff_groundshake.o(.text);
src/fossil_specials.o(.text);
asm/fossil_specials.o(.text);
src/berry_fix_program.o(.text);
src/pokemon_summary_screen.o(.text);
@ -468,7 +469,7 @@ SECTIONS {
data/starter_choose.o(.rodata);
src/wallclock.o(.rodata);
src/pokeblock.o(.rodata);
data/fldeff_flash.o(.rodata);
src/fldeff_flash.o(.rodata);
src/time_events.o(.rodata);
data/field_specials.o(.rodata);
data/battle_records.o(.rodata);
@ -510,7 +511,7 @@ SECTIONS {
src/intro_credits_graphics.o(.rodata);
src/evolution_graphics.o(.rodata);
src/bard_music.o(.rodata);
data/battle_link_817C95C.o(.rodata);
src/battle_tv.o(.rodata);
src/pokemon_animation.o(.rodata);
src/battle_controller_recorded_opponent.o(.rodata);
src/battle_controller_recorded_player.o(.rodata);
@ -529,7 +530,8 @@ SECTIONS {
src/unk_text_util_2.o(.rodata);
src/unk_81BAD84.o(.rodata);
src/battle_controller_player_partner.o(.rodata);
data/fossil_special_fldeff_groundshake.o(.rodata);
src/fossil_specials.o(.rodata);
src/fldeff_groundshake.o(.rodata);
src/berry_fix_program.o(.rodata);
data/pokemon_summary_screen.o(.rodata);
data/pokenav.o(.rodata);

View File

@ -6,7 +6,7 @@
#include "battle_anim.h"
#include "constants/battle_anim.h"
#include "battle_ai_script_commands.h"
#include "battle_link_817C95C.h"
#include "battle_tv.h"
#include "pokemon.h"
#include "link.h"
#include "util.h"
@ -1413,7 +1413,7 @@ static void LinkOpponentHandleMoveAnimation(void)
{
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0;
gBattlerControllerFuncs[gActiveBattler] = LinkOpponentDoMoveAnimation;
sub_817E0FC(move, gWeatherMoveAnim, gAnimDisableStructPtr);
BattleTv_SetDataBasedOnMove(move, gWeatherMoveAnim, gAnimDisableStructPtr);
}
}
}
@ -1477,7 +1477,7 @@ static void LinkOpponentHandlePrintString(void)
BufferStringBattle(*stringId);
BattleHandleAddTextPrinter(gDisplayedStringBattle, 0);
gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter;
sub_817C95C(*stringId);
BattleTv_SetDataBasedOnString(*stringId);
}
static void LinkOpponentHandlePrintSelectionString(void)
@ -1830,7 +1830,7 @@ static void LinkOpponentHandleBattleAnimation(void)
else
gBattlerControllerFuncs[gActiveBattler] = CompleteOnFinishedBattleAnimation;
sub_817E32C(animationId);
BattleTv_SetDataBasedOnAnimation(animationId);
}
}

View File

@ -6,7 +6,7 @@
#include "battle_anim.h"
#include "constants/battle_anim.h"
#include "battle_ai_script_commands.h"
#include "battle_link_817C95C.h"
#include "battle_tv.h"
#include "pokemon.h"
#include "link.h"
#include "util.h"
@ -1237,7 +1237,7 @@ static void LinkPartnerHandleMoveAnimation(void)
{
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0;
gBattlerControllerFuncs[gActiveBattler] = LinkPartnerDoMoveAnimation;
sub_817E0FC(move, gWeatherMoveAnim, gAnimDisableStructPtr);
BattleTv_SetDataBasedOnMove(move, gWeatherMoveAnim, gAnimDisableStructPtr);
}
}
}
@ -1301,7 +1301,7 @@ static void LinkPartnerHandlePrintString(void)
BufferStringBattle(*stringId);
BattleHandleAddTextPrinter(gDisplayedStringBattle, 0);
gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter;
sub_817C95C(*stringId);
BattleTv_SetDataBasedOnString(*stringId);
}
static void LinkPartnerHandlePrintSelectionString(void)
@ -1665,7 +1665,7 @@ static void LinkPartnerHandleBattleAnimation(void)
else
gBattlerControllerFuncs[gActiveBattler] = CompleteOnFinishedBattleAnimation;
sub_817E32C(animationId);
BattleTv_SetDataBasedOnAnimation(animationId);
}
}

View File

@ -5,7 +5,7 @@
#include "battle_interface.h"
#include "battle_anim.h"
#include "constants/battle_anim.h"
#include "battle_link_817C95C.h"
#include "battle_tv.h"
#include "battle_ai_script_commands.h"
#include "pokemon.h"
#include "link.h"

View File

@ -5,7 +5,7 @@
#include "battle_interface.h"
#include "battle_anim.h"
#include "constants/battle_anim.h"
#include "battle_link_817C95C.h"
#include "battle_tv.h"
#include "pokemon.h"
#include "link.h"
#include "util.h"
@ -871,7 +871,7 @@ static void sub_80586F8(void)
gMain.callback1 = gPreBattleCallback1;
SetMainCallback2(sub_8038D64);
if (gBattleOutcome == B_OUTCOME_WON)
sub_817E3F4();
TryPutLinkBattleTvShowOnAir();
FreeAllWindowBuffers();
}
}
@ -884,7 +884,7 @@ static void sub_80586F8(void)
gMain.callback1 = gPreBattleCallback1;
SetMainCallback2(sub_8038D64);
if (gBattleOutcome == B_OUTCOME_WON)
sub_817E3F4();
TryPutLinkBattleTvShowOnAir();
FreeAllWindowBuffers();
}
}
@ -2474,7 +2474,7 @@ static void PlayerHandleMoveAnimation(void)
{
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].animationState = 0;
gBattlerControllerFuncs[gActiveBattler] = PlayerDoMoveAnimation;
sub_817E0FC(move, gWeatherMoveAnim, gAnimDisableStructPtr);
BattleTv_SetDataBasedOnMove(move, gWeatherMoveAnim, gAnimDisableStructPtr);
}
}
}
@ -2538,7 +2538,7 @@ static void PlayerHandlePrintString(void)
BufferStringBattle(*stringId);
BattleHandleAddTextPrinter(gDisplayedStringBattle, 0);
gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter2;
sub_817C95C(*stringId);
BattleTv_SetDataBasedOnString(*stringId);
sub_81A57E4(gActiveBattler, *stringId);
}
@ -2565,7 +2565,7 @@ static void PlayerHandleChooseAction(void)
s32 i;
gBattlerControllerFuncs[gActiveBattler] = HandleChooseActionAfterDma3;
sub_817F2A8();
BattleTv_ClearExplosionFaintCause();
BattleHandleAddTextPrinter(gText_BattleMenu, 2);
for (i = 0; i < 4; i++)
@ -3059,7 +3059,7 @@ static void PlayerHandleBattleAnimation(void)
else
gBattlerControllerFuncs[gActiveBattler] = CompleteOnFinishedBattleAnimation;
sub_817E32C(animationId);
BattleTv_SetDataBasedOnAnimation(animationId);
}
}

View File

@ -6,7 +6,7 @@
#include "battle_anim.h"
#include "constants/battle_anim.h"
#include "battle_ai_script_commands.h"
#include "battle_link_817C95C.h"
#include "battle_tv.h"
#include "recorded_battle.h"
#include "pokemon.h"
#include "link.h"

View File

@ -5,7 +5,7 @@
#include "battle_interface.h"
#include "battle_anim.h"
#include "constants/battle_anim.h"
#include "battle_link_817C95C.h"
#include "battle_tv.h"
#include "pokemon.h"
#include "link.h"
#include "util.h"

View File

@ -77,7 +77,6 @@ void SetUpBattleVarsAndBirchZigzagoon(void)
void sub_8032768(void)
{
s32 i;
u8 *data;
if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED))
sub_8184DA4(1);
@ -100,11 +99,11 @@ void sub_8032768(void)
sub_81B8D64(i, 0);
}
for (i = 0; i < sizeof(gBattleStruct->field_1A4); i++)
*(gBattleStruct->field_1A4 + i) = 0;
for (i = 0; i < sizeof(gBattleStruct->tvMovePoints); i++)
*((u8*)(&gBattleStruct->tvMovePoints) + i) = 0;
for (i = 0; i < sizeof(gBattleStruct->field_204); i++)
*(gBattleStruct->field_204 + i) = 0;
for (i = 0; i < sizeof(gBattleStruct->tv); i++)
*((u8*)(&gBattleStruct->tv) + i) = 0;
}
static void InitSinglePlayerBtlControllers(void)

View File

@ -514,375 +514,375 @@ static const u8 sText_Trainer2LoseText[];
const u8 * const gBattleStringsTable[BATTLESTRINGS_COUNT] =
{
sText_Trainer1LoseText,
sText_PkmnGainedEXP,
sText_PkmnGrewToLv,
sText_PkmnLearnedMove,
sText_TryToLearnMove1,
sText_TryToLearnMove2,
sText_TryToLearnMove3,
sText_PkmnForgotMove,
sText_StopLearningMove,
sText_DidNotLearnMove,
sText_PkmnLearnedMove2,
sText_AttackMissed,
sText_PkmnProtectedItself,
sText_StatsWontIncrease2,
sText_AvoidedDamage,
sText_ItDoesntAffect,
sText_AttackerFainted,
sText_TargetFainted,
sText_PlayerGotMoney,
sText_PlayerWhiteout,
sText_PlayerWhiteout2,
sText_PreventsEscape,
sText_HitXTimes,
sText_PkmnFellAsleep,
sText_PkmnMadeSleep,
sText_PkmnAlreadyAsleep,
sText_PkmnAlreadyAsleep2,
sText_PkmnWasntAffected,
sText_PkmnWasPoisoned,
sText_PkmnPoisonedBy,
sText_PkmnHurtByPoison,
sText_PkmnAlreadyPoisoned,
sText_PkmnBadlyPoisoned,
sText_PkmnEnergyDrained,
sText_PkmnWasBurned,
sText_PkmnBurnedBy,
sText_PkmnHurtByBurn,
sText_PkmnWasFrozen,
sText_PkmnFrozenBy,
sText_PkmnIsFrozen,
sText_PkmnWasDefrosted,
sText_PkmnWasDefrosted2,
sText_PkmnWasDefrostedBy,
sText_PkmnWasParalyzed,
sText_PkmnWasParalyzedBy,
sText_PkmnIsParalyzed,
sText_PkmnIsAlreadyParalyzed,
sText_PkmnHealedParalysis,
sText_PkmnDreamEaten,
sText_StatsWontIncrease,
sText_StatsWontDecrease,
sText_TeamStoppedWorking,
sText_FoeStoppedWorking,
sText_PkmnIsConfused,
sText_PkmnHealedConfusion,
sText_PkmnWasConfused,
sText_PkmnAlreadyConfused,
sText_PkmnFellInLove,
sText_PkmnInLove,
sText_PkmnImmobilizedByLove,
sText_PkmnBlownAway,
sText_PkmnChangedType,
sText_PkmnFlinched,
sText_PkmnRegainedHealth,
sText_PkmnHPFull,
sText_PkmnRaisedSpDef,
sText_PkmnRaisedDef,
sText_PkmnCoveredByVeil,
sText_PkmnUsedSafeguard,
sText_PkmnSafeguardExpired,
sText_PkmnWentToSleep,
sText_PkmnSleptHealthy,
sText_PkmnWhippedWhirlwind,
sText_PkmnTookSunlight,
sText_PkmnLoweredHead,
sText_PkmnIsGlowing,
sText_PkmnFlewHigh,
sText_PkmnDugHole,
sText_PkmnSqueezedByBind,
sText_PkmnTrappedInVortex,
sText_PkmnWrappedBy,
sText_PkmnClamped,
sText_PkmnHurtBy,
sText_PkmnFreedFrom,
sText_PkmnCrashed,
gText_PkmnShroudedInMist,
sText_PkmnProtectedByMist,
gText_PkmnGettingPumped,
sText_PkmnHitWithRecoil,
sText_PkmnProtectedItself2,
sText_PkmnBuffetedBySandstorm,
sText_PkmnPeltedByHail,
sText_PkmnSeeded,
sText_PkmnEvadedAttack,
sText_PkmnSappedByLeechSeed,
sText_PkmnFastAsleep,
sText_PkmnWokeUp,
sText_PkmnUproarKeptAwake,
sText_PkmnWokeUpInUproar,
sText_PkmnCausedUproar,
sText_PkmnMakingUproar,
sText_PkmnCalmedDown,
sText_PkmnCantSleepInUproar,
sText_PkmnStockpiled,
sText_PkmnCantStockpile,
sText_PkmnCantSleepInUproar2,
sText_UproarKeptPkmnAwake,
sText_PkmnStayedAwakeUsing,
sText_PkmnStoringEnergy,
sText_PkmnUnleashedEnergy,
sText_PkmnFatigueConfusion,
sText_PkmnPickedUpItem,
sText_PkmnUnaffected,
sText_PkmnTransformedInto,
sText_PkmnMadeSubstitute,
sText_PkmnHasSubstitute,
sText_SubstituteDamaged,
sText_PkmnSubstituteFaded,
sText_PkmnMustRecharge,
sText_PkmnRageBuilding,
sText_PkmnMoveWasDisabled,
sText_PkmnMoveIsDisabled,
sText_PkmnMoveDisabledNoMore,
sText_PkmnGotEncore,
sText_PkmnEncoreEnded,
sText_PkmnTookAim,
sText_PkmnSketchedMove,
sText_PkmnTryingToTakeFoe,
sText_PkmnTookFoe,
sText_PkmnReducedPP,
sText_PkmnStoleItem,
sText_TargetCantEscapeNow,
sText_PkmnFellIntoNightmare,
sText_PkmnLockedInNightmare,
sText_PkmnLaidCurse,
sText_PkmnAfflictedByCurse,
sText_SpikesScattered,
sText_PkmnHurtBySpikes,
sText_PkmnIdentified,
sText_PkmnPerishCountFell,
sText_PkmnBracedItself,
sText_PkmnEnduredHit,
sText_MagnitudeStrength,
sText_PkmnCutHPMaxedAttack,
sText_PkmnCopiedStatChanges,
sText_PkmnGotFree,
sText_PkmnShedLeechSeed,
sText_PkmnBlewAwaySpikes,
sText_PkmnFledFromBattle,
sText_PkmnForesawAttack,
sText_PkmnTookAttack,
sText_PkmnAttack,
sText_PkmnCenterAttention,
sText_PkmnChargingPower,
sText_NaturePowerTurnedInto,
sText_PkmnStatusNormal,
sText_PkmnHasNoMovesLeft,
sText_PkmnSubjectedToTorment,
sText_PkmnCantUseMoveTorment,
sText_PkmnTighteningFocus,
sText_PkmnFellForTaunt,
sText_PkmnCantUseMoveTaunt,
sText_PkmnReadyToHelp,
sText_PkmnSwitchedItems,
sText_PkmnCopiedFoe,
sText_PkmnMadeWish,
sText_PkmnWishCameTrue,
sText_PkmnPlantedRoots,
sText_PkmnAbsorbedNutrients,
sText_PkmnAnchoredItself,
sText_PkmnWasMadeDrowsy,
sText_PkmnKnockedOff,
sText_PkmnSwappedAbilities,
sText_PkmnSealedOpponentMove,
sText_PkmnCantUseMoveSealed,
sText_PkmnWantsGrudge,
sText_PkmnLostPPGrudge,
sText_PkmnShroudedItself,
sText_PkmnMoveBounced,
sText_PkmnWaitsForTarget,
sText_PkmnSnatchedMove,
sText_PkmnMadeItRain,
sText_PkmnRaisedSpeed,
sText_PkmnProtectedBy,
sText_PkmnPreventsUsage,
sText_PkmnRestoredHPUsing,
sText_PkmnChangedTypeWith,
sText_PkmnPreventsParalysisWith,
sText_PkmnPreventsRomanceWith,
sText_PkmnPreventsPoisoningWith,
sText_PkmnPreventsConfusionWith,
sText_PkmnRaisedFirePowerWith,
sText_PkmnAnchorsItselfWith,
sText_PkmnCutsAttackWith,
sText_PkmnPreventsStatLossWith,
sText_PkmnHurtsWith,
sText_PkmnTraced,
sText_StatSharply,
gText_StatRose,
sText_StatHarshly,
sText_StatFell,
sText_PkmnsStatChanged,
gText_PkmnsStatChanged2,
sText_PkmnsStatChanged3,
sText_PkmnsStatChanged4,
sText_CriticalHit,
sText_OneHitKO,
sText_123Poof,
sText_AndEllipsis,
sText_NotVeryEffective,
sText_SuperEffective,
sText_GotAwaySafely,
sText_WildPkmnFled,
sText_NoRunningFromTrainers,
sText_CantEscape,
sText_DontLeaveBirch,
sText_ButNothingHappened,
sText_ButItFailed,
sText_ItHurtConfusion,
sText_MirrorMoveFailed,
sText_StartedToRain,
sText_DownpourStarted,
sText_RainContinues,
sText_DownpourContinues,
sText_RainStopped,
sText_SandstormBrewed,
sText_SandstormRages,
sText_SandstormSubsided,
sText_SunlightGotBright,
sText_SunlightStrong,
sText_SunlightFaded,
sText_StartedHail,
sText_HailContinues,
sText_HailStopped,
sText_FailedToSpitUp,
sText_FailedToSwallow,
sText_WindBecameHeatWave,
sText_StatChangesGone,
sText_CoinsScattered,
sText_TooWeakForSubstitute,
sText_SharedPain,
sText_BellChimed,
sText_FaintInThree,
sText_NoPPLeft,
sText_ButNoPPLeft,
sText_PlayerUsedItem,
sText_WallyUsedItem,
sText_TrainerBlockedBall,
sText_DontBeAThief,
sText_ItDodgedBall,
sText_YouMissedPkmn,
sText_PkmnBrokeFree,
sText_ItAppearedCaught,
sText_AarghAlmostHadIt,
sText_ShootSoClose,
sText_GotchaPkmnCaught,
sText_GotchaPkmnCaught2,
sText_GiveNicknameCaptured,
sText_PkmnSentToPC,
sText_PkmnDataAddedToDex,
sText_ItIsRaining,
sText_SandstormIsRaging,
sText_CantEscape2,
sText_PkmnIgnoresAsleep,
sText_PkmnIgnoredOrders,
sText_PkmnBeganToNap,
sText_PkmnLoafing,
sText_PkmnWontObey,
sText_PkmnTurnedAway,
sText_PkmnPretendNotNotice,
sText_EnemyAboutToSwitchPkmn,
sText_CreptCloser,
sText_CantGetCloser,
sText_PkmnWatchingCarefully,
sText_PkmnCuriousAboutX,
sText_PkmnEnthralledByX,
sText_PkmnIgnoredX,
sText_ThrewPokeblockAtPkmn,
sText_OutOfSafariBalls,
sText_PkmnsItemCuredParalysis,
sText_PkmnsItemCuredPoison,
sText_PkmnsItemHealedBurn,
sText_PkmnsItemDefrostedIt,
sText_PkmnsItemWokeIt,
sText_PkmnsItemSnappedOut,
sText_PkmnsItemCuredProblem,
sText_PkmnsItemRestoredHealth,
sText_PkmnsItemRestoredPP,
sText_PkmnsItemRestoredStatus,
sText_PkmnsItemRestoredHPALittle,
sText_ItemAllowsOnlyYMove,
sText_PkmnHungOnWithX,
gText_EmptyString3,
sText_PkmnsXPreventsBurns,
sText_PkmnsXBlocksY,
sText_PkmnsXRestoredHPALittle2,
sText_PkmnsXWhippedUpSandstorm,
sText_PkmnsXPreventsYLoss,
sText_PkmnsXInfatuatedY,
sText_PkmnsXMadeYIneffective,
sText_PkmnsXCuredYProblem,
sText_ItSuckedLiquidOoze,
sText_PkmnTransformed,
sText_ElectricityWeakened,
sText_FireWeakened,
sText_PkmnHidUnderwater,
sText_PkmnSprangUp,
sText_HMMovesCantBeForgotten,
sText_XFoundOneY,
sText_PlayerDefeatedLinkTrainerTrainer1,
sText_SoothingAroma,
sText_ItemsCantBeUsedNow,
sText_ForXCommaYZ,
sText_UsingXTheYOfZN,
sText_PkmnUsedXToGetPumped,
sText_PkmnsXMadeYUseless,
sText_PkmnTrappedBySandTomb,
sText_EmptyString4,
sText_ABoosted,
sText_PkmnsXIntensifiedSun,
sText_PkmnMakesGroundMiss,
sText_YouThrowABallNowRight,
sText_PkmnsXTookAttack,
sText_PkmnChoseXAsDestiny,
sText_PkmnLostFocus,
sText_UseNextPkmn,
sText_PkmnFledUsingIts,
sText_PkmnFledUsing,
sText_PkmnWasDraggedOut,
sText_PreventedFromWorking,
sText_PkmnsItemNormalizedStatus,
sText_Trainer1UsedItem,
sText_BoxIsFull,
sText_PkmnAvoidedAttack,
sText_PkmnsXMadeItIneffective,
sText_PkmnsXPreventsFlinching,
sText_PkmnAlreadyHasBurn,
sText_StatsWontDecrease2,
sText_PkmnsXBlocksY2,
sText_PkmnsXWoreOff,
sText_PkmnRaisedDefALittle,
sText_PkmnRaisedSpDefALittle,
sText_TheWallShattered,
sText_PkmnsXPreventsYsZ,
sText_PkmnsXCuredItsYProblem,
sText_AttackerCantEscape,
sText_PkmnObtainedX,
sText_PkmnObtainedX2,
sText_PkmnObtainedXYObtainedZ,
sText_ButNoEffect,
sText_PkmnsXHadNoEffectOnY,
sText_TwoInGameTrainersDefeated,
sText_Trainer2LoseText,
sText_PkmnIncapableOfPower,
sText_GlintAppearsInEye,
sText_PkmnGettingIntoPosition,
sText_PkmnBeganGrowlingDeeply,
sText_PkmnEagerForMore,
sText_DefeatedOpponentByReferee,
sText_LostToOpponentByReferee,
sText_TiedOpponentByReferee,
sText_QuestionForfeitMatch,
sText_ForfeitedMatch,
gText_PkmnTransferredSomeonesPC,
gText_PkmnTransferredLanettesPC,
gText_PkmnBoxSomeonesPCFull,
gText_PkmnBoxLanettesPCFull,
sText_Trainer1WinText,
sText_Trainer2WinText,
sText_Trainer1LoseText, // 12
sText_PkmnGainedEXP, // 13
sText_PkmnGrewToLv, // 14
sText_PkmnLearnedMove, // 15
sText_TryToLearnMove1, // 16
sText_TryToLearnMove2, // 17
sText_TryToLearnMove3, // 18
sText_PkmnForgotMove, // 19
sText_StopLearningMove, // 20
sText_DidNotLearnMove, // 21
sText_PkmnLearnedMove2, // 22
sText_AttackMissed, // 23
sText_PkmnProtectedItself, // 24
sText_StatsWontIncrease2, // 25
sText_AvoidedDamage, // 26
sText_ItDoesntAffect, // 27
sText_AttackerFainted, // 28
sText_TargetFainted, // 29
sText_PlayerGotMoney, // 30
sText_PlayerWhiteout, // 31
sText_PlayerWhiteout2, // 32
sText_PreventsEscape, // 33
sText_HitXTimes, // 34
sText_PkmnFellAsleep, // 35
sText_PkmnMadeSleep, // 36
sText_PkmnAlreadyAsleep, // 37
sText_PkmnAlreadyAsleep2, // 38
sText_PkmnWasntAffected, // 39
sText_PkmnWasPoisoned, // 40
sText_PkmnPoisonedBy, // 41
sText_PkmnHurtByPoison, // 42
sText_PkmnAlreadyPoisoned, // 43
sText_PkmnBadlyPoisoned, // 44
sText_PkmnEnergyDrained, // 45
sText_PkmnWasBurned, // 46
sText_PkmnBurnedBy, // 47
sText_PkmnHurtByBurn, // 48
sText_PkmnWasFrozen, // 49
sText_PkmnFrozenBy, // 50
sText_PkmnIsFrozen, // 51
sText_PkmnWasDefrosted, // 52
sText_PkmnWasDefrosted2, // 53
sText_PkmnWasDefrostedBy, // 54
sText_PkmnWasParalyzed, // 55
sText_PkmnWasParalyzedBy, // 56
sText_PkmnIsParalyzed, // 57
sText_PkmnIsAlreadyParalyzed, // 58
sText_PkmnHealedParalysis, // 59
sText_PkmnDreamEaten, // 60
sText_StatsWontIncrease, // 61
sText_StatsWontDecrease, // 62
sText_TeamStoppedWorking, // 63
sText_FoeStoppedWorking, // 64
sText_PkmnIsConfused, // 65
sText_PkmnHealedConfusion, // 66
sText_PkmnWasConfused, // 67
sText_PkmnAlreadyConfused, // 68
sText_PkmnFellInLove, // 69
sText_PkmnInLove, // 70
sText_PkmnImmobilizedByLove, // 71
sText_PkmnBlownAway, // 72
sText_PkmnChangedType, // 73
sText_PkmnFlinched, // 74
sText_PkmnRegainedHealth, // 75
sText_PkmnHPFull, // 76
sText_PkmnRaisedSpDef, // 77
sText_PkmnRaisedDef, // 78
sText_PkmnCoveredByVeil, // 79
sText_PkmnUsedSafeguard, // 80
sText_PkmnSafeguardExpired, // 81
sText_PkmnWentToSleep, // 82
sText_PkmnSleptHealthy, // 83
sText_PkmnWhippedWhirlwind, // 84
sText_PkmnTookSunlight, // 85
sText_PkmnLoweredHead, // 86
sText_PkmnIsGlowing, // 87
sText_PkmnFlewHigh, // 88
sText_PkmnDugHole, // 89
sText_PkmnSqueezedByBind, // 90
sText_PkmnTrappedInVortex, // 91
sText_PkmnWrappedBy, // 92
sText_PkmnClamped, // 93
sText_PkmnHurtBy, // 94
sText_PkmnFreedFrom, // 95
sText_PkmnCrashed, // 96
gText_PkmnShroudedInMist, // 97
sText_PkmnProtectedByMist, // 98
gText_PkmnGettingPumped, // 99
sText_PkmnHitWithRecoil, // 100
sText_PkmnProtectedItself2, // 101
sText_PkmnBuffetedBySandstorm, // 102
sText_PkmnPeltedByHail, // 103
sText_PkmnSeeded, // 104
sText_PkmnEvadedAttack, // 105
sText_PkmnSappedByLeechSeed, // 106
sText_PkmnFastAsleep, // 107
sText_PkmnWokeUp, // 108
sText_PkmnUproarKeptAwake, // 109
sText_PkmnWokeUpInUproar, // 110
sText_PkmnCausedUproar, // 111
sText_PkmnMakingUproar, // 112
sText_PkmnCalmedDown, // 113
sText_PkmnCantSleepInUproar, // 114
sText_PkmnStockpiled, // 115
sText_PkmnCantStockpile, // 116
sText_PkmnCantSleepInUproar2, // 117
sText_UproarKeptPkmnAwake, // 118
sText_PkmnStayedAwakeUsing, // 119
sText_PkmnStoringEnergy, // 120
sText_PkmnUnleashedEnergy, // 121
sText_PkmnFatigueConfusion, // 122
sText_PkmnPickedUpItem, // 123
sText_PkmnUnaffected, // 124
sText_PkmnTransformedInto, // 125
sText_PkmnMadeSubstitute, // 126
sText_PkmnHasSubstitute, // 127
sText_SubstituteDamaged, // 128
sText_PkmnSubstituteFaded, // 129
sText_PkmnMustRecharge, // 130
sText_PkmnRageBuilding, // 131
sText_PkmnMoveWasDisabled, // 132
sText_PkmnMoveIsDisabled, // 133
sText_PkmnMoveDisabledNoMore, // 134
sText_PkmnGotEncore, // 135
sText_PkmnEncoreEnded, // 136
sText_PkmnTookAim, // 137
sText_PkmnSketchedMove, // 138
sText_PkmnTryingToTakeFoe, // 139
sText_PkmnTookFoe, // 140
sText_PkmnReducedPP, // 141
sText_PkmnStoleItem, // 142
sText_TargetCantEscapeNow, // 143
sText_PkmnFellIntoNightmare, // 144
sText_PkmnLockedInNightmare, // 145
sText_PkmnLaidCurse, // 146
sText_PkmnAfflictedByCurse, // 147
sText_SpikesScattered, // 148
sText_PkmnHurtBySpikes, // 149
sText_PkmnIdentified, // 150
sText_PkmnPerishCountFell, // 151
sText_PkmnBracedItself, // 152
sText_PkmnEnduredHit, // 153
sText_MagnitudeStrength, // 154
sText_PkmnCutHPMaxedAttack, // 155
sText_PkmnCopiedStatChanges, // 156
sText_PkmnGotFree, // 157
sText_PkmnShedLeechSeed, // 158
sText_PkmnBlewAwaySpikes, // 159
sText_PkmnFledFromBattle, // 160
sText_PkmnForesawAttack, // 161
sText_PkmnTookAttack, // 162
sText_PkmnAttack, // 163
sText_PkmnCenterAttention, // 164
sText_PkmnChargingPower, // 165
sText_NaturePowerTurnedInto, // 166
sText_PkmnStatusNormal, // 167
sText_PkmnHasNoMovesLeft, // 168
sText_PkmnSubjectedToTorment, // 169
sText_PkmnCantUseMoveTorment, // 170
sText_PkmnTighteningFocus, // 171
sText_PkmnFellForTaunt, // 172
sText_PkmnCantUseMoveTaunt, // 173
sText_PkmnReadyToHelp, // 174
sText_PkmnSwitchedItems, // 175
sText_PkmnCopiedFoe, // 176
sText_PkmnMadeWish, // 177
sText_PkmnWishCameTrue, // 178
sText_PkmnPlantedRoots, // 179
sText_PkmnAbsorbedNutrients, // 180
sText_PkmnAnchoredItself, // 181
sText_PkmnWasMadeDrowsy, // 182
sText_PkmnKnockedOff, // 183
sText_PkmnSwappedAbilities, // 184
sText_PkmnSealedOpponentMove, // 185
sText_PkmnCantUseMoveSealed, // 186
sText_PkmnWantsGrudge, // 187
sText_PkmnLostPPGrudge, // 188
sText_PkmnShroudedItself, // 189
sText_PkmnMoveBounced, // 190
sText_PkmnWaitsForTarget, // 191
sText_PkmnSnatchedMove, // 192
sText_PkmnMadeItRain, // 193
sText_PkmnRaisedSpeed, // 194
sText_PkmnProtectedBy, // 195
sText_PkmnPreventsUsage, // 196
sText_PkmnRestoredHPUsing, // 197
sText_PkmnChangedTypeWith, // 198
sText_PkmnPreventsParalysisWith, // 199
sText_PkmnPreventsRomanceWith, // 200
sText_PkmnPreventsPoisoningWith, // 201
sText_PkmnPreventsConfusionWith, // 202
sText_PkmnRaisedFirePowerWith, // 203
sText_PkmnAnchorsItselfWith, // 204
sText_PkmnCutsAttackWith, // 205
sText_PkmnPreventsStatLossWith, // 206
sText_PkmnHurtsWith, // 207
sText_PkmnTraced, // 208
sText_StatSharply, // 209
gText_StatRose, // 210
sText_StatHarshly, // 211
sText_StatFell, // 212
sText_PkmnsStatChanged, // 213
gText_PkmnsStatChanged2, // 214
sText_PkmnsStatChanged3, // 215
sText_PkmnsStatChanged4, // 216
sText_CriticalHit, // 217
sText_OneHitKO, // 218
sText_123Poof, // 219
sText_AndEllipsis, // 220
sText_NotVeryEffective, // 221
sText_SuperEffective, // 222
sText_GotAwaySafely, // 223
sText_WildPkmnFled, // 224
sText_NoRunningFromTrainers, // 225
sText_CantEscape, // 226
sText_DontLeaveBirch, // 227
sText_ButNothingHappened, // 228
sText_ButItFailed, // 229
sText_ItHurtConfusion, // 230
sText_MirrorMoveFailed, // 231
sText_StartedToRain, // 232
sText_DownpourStarted, // 233
sText_RainContinues, // 234
sText_DownpourContinues, // 235
sText_RainStopped, // 236
sText_SandstormBrewed, // 237
sText_SandstormRages, // 238
sText_SandstormSubsided, // 239
sText_SunlightGotBright, // 240
sText_SunlightStrong, // 241
sText_SunlightFaded, // 242
sText_StartedHail, // 243
sText_HailContinues, // 244
sText_HailStopped, // 245
sText_FailedToSpitUp, // 246
sText_FailedToSwallow, // 247
sText_WindBecameHeatWave, // 248
sText_StatChangesGone, // 249
sText_CoinsScattered, // 250
sText_TooWeakForSubstitute, // 251
sText_SharedPain, // 252
sText_BellChimed, // 253
sText_FaintInThree, // 254
sText_NoPPLeft, // 255
sText_ButNoPPLeft, // 256
sText_PlayerUsedItem, // 257
sText_WallyUsedItem, // 258
sText_TrainerBlockedBall, // 259
sText_DontBeAThief, // 260
sText_ItDodgedBall, // 261
sText_YouMissedPkmn, // 262
sText_PkmnBrokeFree, // 263
sText_ItAppearedCaught, // 264
sText_AarghAlmostHadIt, // 265
sText_ShootSoClose, // 266
sText_GotchaPkmnCaught, // 267
sText_GotchaPkmnCaught2, // 268
sText_GiveNicknameCaptured, // 269
sText_PkmnSentToPC, // 270
sText_PkmnDataAddedToDex, // 271
sText_ItIsRaining, // 272
sText_SandstormIsRaging, // 273
sText_CantEscape2, // 274
sText_PkmnIgnoresAsleep, // 275
sText_PkmnIgnoredOrders, // 276
sText_PkmnBeganToNap, // 277
sText_PkmnLoafing, // 278
sText_PkmnWontObey, // 279
sText_PkmnTurnedAway, // 280
sText_PkmnPretendNotNotice, // 281
sText_EnemyAboutToSwitchPkmn, // 282
sText_CreptCloser, // 283
sText_CantGetCloser, // 284
sText_PkmnWatchingCarefully, // 285
sText_PkmnCuriousAboutX, // 286
sText_PkmnEnthralledByX, // 287
sText_PkmnIgnoredX, // 288
sText_ThrewPokeblockAtPkmn, // 289
sText_OutOfSafariBalls, // 290
sText_PkmnsItemCuredParalysis, // 291
sText_PkmnsItemCuredPoison, // 292
sText_PkmnsItemHealedBurn, // 293
sText_PkmnsItemDefrostedIt, // 294
sText_PkmnsItemWokeIt, // 295
sText_PkmnsItemSnappedOut, // 296
sText_PkmnsItemCuredProblem, // 297
sText_PkmnsItemRestoredHealth, // 298
sText_PkmnsItemRestoredPP, // 299
sText_PkmnsItemRestoredStatus, // 300
sText_PkmnsItemRestoredHPALittle, // 301
sText_ItemAllowsOnlyYMove, // 302
sText_PkmnHungOnWithX, // 303
gText_EmptyString3, // 304
sText_PkmnsXPreventsBurns, // 305
sText_PkmnsXBlocksY, // 306
sText_PkmnsXRestoredHPALittle2, // 307
sText_PkmnsXWhippedUpSandstorm, // 308
sText_PkmnsXPreventsYLoss, // 309
sText_PkmnsXInfatuatedY, // 310
sText_PkmnsXMadeYIneffective, // 311
sText_PkmnsXCuredYProblem, // 312
sText_ItSuckedLiquidOoze, // 313
sText_PkmnTransformed, // 314
sText_ElectricityWeakened, // 315
sText_FireWeakened, // 316
sText_PkmnHidUnderwater, // 317
sText_PkmnSprangUp, // 318
sText_HMMovesCantBeForgotten, // 319
sText_XFoundOneY, // 320
sText_PlayerDefeatedLinkTrainerTrainer1, // 321
sText_SoothingAroma, // 322
sText_ItemsCantBeUsedNow, // 323
sText_ForXCommaYZ, // 324
sText_UsingXTheYOfZN, // 325
sText_PkmnUsedXToGetPumped, // 326
sText_PkmnsXMadeYUseless, // 327
sText_PkmnTrappedBySandTomb, // 328
sText_EmptyString4, // 329
sText_ABoosted, // 330
sText_PkmnsXIntensifiedSun, // 331
sText_PkmnMakesGroundMiss, // 332
sText_YouThrowABallNowRight, // 333
sText_PkmnsXTookAttack, // 334
sText_PkmnChoseXAsDestiny, // 335
sText_PkmnLostFocus, // 336
sText_UseNextPkmn, // 337
sText_PkmnFledUsingIts, // 338
sText_PkmnFledUsing, // 339
sText_PkmnWasDraggedOut, // 340
sText_PreventedFromWorking, // 341
sText_PkmnsItemNormalizedStatus, // 342
sText_Trainer1UsedItem, // 343
sText_BoxIsFull, // 344
sText_PkmnAvoidedAttack, // 345
sText_PkmnsXMadeItIneffective, // 346
sText_PkmnsXPreventsFlinching, // 347
sText_PkmnAlreadyHasBurn, // 348
sText_StatsWontDecrease2, // 349
sText_PkmnsXBlocksY2, // 350
sText_PkmnsXWoreOff, // 351
sText_PkmnRaisedDefALittle, // 352
sText_PkmnRaisedSpDefALittle, // 353
sText_TheWallShattered, // 354
sText_PkmnsXPreventsYsZ, // 355
sText_PkmnsXCuredItsYProblem, // 356
sText_AttackerCantEscape, // 357
sText_PkmnObtainedX, // 358
sText_PkmnObtainedX2, // 359
sText_PkmnObtainedXYObtainedZ, // 360
sText_ButNoEffect, // 361
sText_PkmnsXHadNoEffectOnY, // 362
sText_TwoInGameTrainersDefeated, // 363
sText_Trainer2LoseText, // 364
sText_PkmnIncapableOfPower, // 365
sText_GlintAppearsInEye, // 366
sText_PkmnGettingIntoPosition, // 367
sText_PkmnBeganGrowlingDeeply, // 368
sText_PkmnEagerForMore, // 369
sText_DefeatedOpponentByReferee, // 370
sText_LostToOpponentByReferee, // 371
sText_TiedOpponentByReferee, // 372
sText_QuestionForfeitMatch, // 373
sText_ForfeitedMatch, // 374
gText_PkmnTransferredSomeonesPC, // 375
gText_PkmnTransferredLanettesPC, // 376
gText_PkmnBoxSomeonesPCFull, // 377
gText_PkmnBoxLanettesPCFull, // 378
sText_Trainer1WinText, // 379
sText_Trainer2WinText, // 380
};
const u16 gMissStringIds[] =

1576
src/battle_tv.c Normal file

File diff suppressed because it is too large Load Diff

367
src/fldeff_flash.c Normal file
View File

@ -0,0 +1,367 @@
#include "global.h"
#include "constants/songs.h"
#include "braille_puzzles.h"
#include "event_data.h"
#include "event_scripts.h"
#include "field_effect.h"
#include "gpu_regs.h"
#include "gba/io_reg.h"
#include "main.h"
#include "palette.h"
#include "party_menu.h"
#include "overworld.h"
#include "rom6.h"
#include "script.h"
#include "sound.h"
#include "sprite.h"
#include "task.h"
// structures
struct FlashStruct
{
u8 unk0;
u8 unk1;
bool8 unk2;
bool8 unk3;
void (*func)(void);
};
// static functions
static void hm2_flash(void);
static void sub_81371B4(void);
static bool8 sub_8137304(void);
static void sub_81373F0(void);
static void sub_8137404(u8 taskId);
static void sub_8137420(u8 taskId);
static void sub_81374C4(u8 taskId);
static void sub_813750C(u8 taskId);
static void sub_8137574(u8 taskId);
static void sub_81375A8(void);
static void sub_81375BC(u8 taskId);
static void sub_81375D8(u8 taskId);
static void sub_8137678(u8 taskId);
static void sub_81376DC(u8 taskId);
// rodata
static const struct FlashStruct gUnknown_085B27C8[] =
{
{1, 4, 1, 0, sub_81375A8},
{2, 4, 1, 0, sub_81375A8},
{3, 4, 1, 0, sub_81375A8},
{5, 4, 1, 0, sub_81375A8},
{6, 4, 1, 0, sub_81375A8},
{7, 4, 1, 0, sub_81375A8},
{8, 4, 1, 0, sub_81375A8},
{9, 4, 1, 0, sub_81375A8},
{4, 1, 0, 1, sub_81373F0},
{4, 2, 0, 1, sub_81373F0},
{4, 3, 0, 1, sub_81373F0},
{4, 5, 0, 1, sub_81373F0},
{4, 6, 0, 1, sub_81373F0},
{4, 7, 0, 1, sub_81373F0},
{4, 8, 0, 1, sub_81373F0},
{4, 9, 0, 1, sub_81373F0},
{0, 0, 0, 0, NULL},
};
static const u16 gCaveTransitionPalette_White[] = INCBIN_U16("graphics/misc/cave_transition_white.gbapal");
static const u16 gCaveTransitionPalette_Black[] = INCBIN_U16("graphics/misc/cave_transition_black.gbapal");
static const u16 gUnknown_085B2890[] = INCBIN_U16("graphics/misc/85B2890.gbapal");
static const u16 gUnknown_085B28A0[] = INCBIN_U16("graphics/misc/85B28A0.gbapal");
static const u16 gCaveTransitionTilemap[] = INCBIN_U16("graphics/misc/cave_transition_map.bin.lz");
static const u8 gCaveTransitionTiles[] = INCBIN_U8("graphics/misc/cave_transition.4bpp.lz");
// text
bool8 SetUpFieldMove_Flash(void)
{
if (ShouldDoBrailleFlyEffect())
{
gSpecialVar_Result = GetCursorSelectionMonId();
gUnknown_03005DB0 = FieldCallback_Teleport;
gUnknown_0203CEEC = sub_8179918;
return TRUE;
}
else if (gMapHeader.cave == TRUE && !FlagGet(FLAG_SYS_USE_FLASH))
{
gUnknown_03005DB0 = FieldCallback_Teleport;
gUnknown_0203CEEC = hm2_flash;
return TRUE;
}
return FALSE;
}
static void hm2_flash(void)
{
u8 taskId = oei_task_add();
gFieldEffectArguments[0] = GetCursorSelectionMonId();
gTasks[taskId].data[8] = (uintptr_t)sub_81371B4 >> 16;
gTasks[taskId].data[9] = (uintptr_t)sub_81371B4;
}
static void sub_81371B4(void)
{
PlaySE(SE_W115);
FlagSet(FLAG_SYS_USE_FLASH);
ScriptContext1_SetupScript(EventScript_2926F8);
}
static void sub_81371D4(void)
{
RunTasks();
AnimateSprites();
BuildOamBuffer();
UpdatePaletteFade();
}
static void sub_81371EC(void)
{
LoadOam();
ProcessSpriteCopyRequests();
TransferPlttBuffer();
}
void c2_change_map(void)
{
u16 ime;
SetVBlankCallback(NULL);
SetGpuReg(REG_OFFSET_DISPCNT, 0);
SetGpuReg(REG_OFFSET_BG2CNT, 0);
SetGpuReg(REG_OFFSET_BG1CNT, 0);
SetGpuReg(REG_OFFSET_BG0CNT, 0);
SetGpuReg(REG_OFFSET_BG2HOFS, 0);
SetGpuReg(REG_OFFSET_BG2VOFS, 0);
SetGpuReg(REG_OFFSET_BG1HOFS, 0);
SetGpuReg(REG_OFFSET_BG1VOFS, 0);
SetGpuReg(REG_OFFSET_BG0HOFS, 0);
SetGpuReg(REG_OFFSET_BG0VOFS, 0);
DmaFill16(3, 0, (void *)VRAM, VRAM_SIZE);
DmaFill32(3, 0, (void *)OAM, OAM_SIZE);
DmaFill16(3, 0, (void *)(PLTT + 2), PLTT_SIZE - 2);
ResetPaletteFade();
ResetTasks();
ResetSpriteData();
ime = REG_IME;
REG_IME = 0;
REG_IE |= INTR_FLAG_VBLANK;
REG_IME = ime;
SetVBlankCallback(sub_81371EC);
SetMainCallback2(sub_81371D4);
if (!sub_8137304())
SetMainCallback2(gMain.savedCallback);
}
static bool8 sub_8137304(void)
{
u8 i;
u8 v0 = get_map_light_from_warp0();
u8 v1 = Overworld_GetMapTypeOfSaveblockLocation();
for (i = 0; gUnknown_085B27C8[i].unk0; i++)
{
if (gUnknown_085B27C8[i].unk0 == v0 && gUnknown_085B27C8[i].unk1 == v1)
{
gUnknown_085B27C8[i].func();
return TRUE;
}
}
return FALSE;
}
bool8 sub_8137360(u8 a1, u8 a2)
{
u8 i;
u8 v0 = a1;
u8 v1 = a2;
for (i = 0; gUnknown_085B27C8[i].unk0; i++)
{
if (gUnknown_085B27C8[i].unk0 == v0 && gUnknown_085B27C8[i].unk1 == v1)
{
return gUnknown_085B27C8[i].unk2;
}
}
return FALSE;
}
bool8 fade_type_for_given_maplight_pair(u8 a1, u8 a2)
{
u8 i;
u8 v0 = a1;
u8 v1 = a2;
for (i = 0; gUnknown_085B27C8[i].unk0; i++)
{
if (gUnknown_085B27C8[i].unk0 == v0 && gUnknown_085B27C8[i].unk1 == v1)
{
return gUnknown_085B27C8[i].unk3;
}
}
return FALSE;
}
static void sub_81373F0(void)
{
CreateTask(sub_8137404, 0);
}
static void sub_8137404(u8 taskId)
{
gTasks[taskId].func = sub_8137420;
}
static void sub_8137420(u8 taskId)
{
SetGpuReg(REG_OFFSET_DISPCNT, 0);
LZ77UnCompVram(gCaveTransitionTiles, (void *)0x600C000);
LZ77UnCompVram(gCaveTransitionTilemap, (void *)0x600F800);
LoadPalette(gCaveTransitionPalette_White, 0xE0, 0x20);
LoadPalette(gUnknown_085B28A0, 0xE0, 0x10);
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG0
| BLDCNT_EFFECT_BLEND
| BLDCNT_TGT2_BG1
| BLDCNT_TGT2_BG2
| BLDCNT_TGT2_BG3
| BLDCNT_TGT2_OBJ
| BLDCNT_TGT2_BD);
SetGpuReg(REG_OFFSET_BLDALPHA, 0);
SetGpuReg(REG_OFFSET_BLDY, 0);
SetGpuReg(REG_OFFSET_BG0CNT, BGCNT_PRIORITY(0)
| BGCNT_CHARBASE(3)
| BGCNT_SCREENBASE(31)
| BGCNT_16COLOR
| BGCNT_TXT256x256);
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0
| DISPCNT_OBJ_1D_MAP
| DISPCNT_BG0_ON
| DISPCNT_OBJ_ON);
gTasks[taskId].func = sub_81374C4;
gTasks[taskId].data[0] = 16;
gTasks[taskId].data[1] = 0;
}
static void sub_81374C4(u8 taskId)
{
u16 count = gTasks[taskId].data[1];
u16 blend = count + 0x1000;
SetGpuReg(REG_OFFSET_BLDALPHA, blend);
if (count <= 0x10)
{
gTasks[taskId].data[1]++;
}
else
{
gTasks[taskId].data[2] = 0;
gTasks[taskId].func = sub_813750C;
}
}
static void sub_813750C(u8 taskId)
{
u16 count;
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(16, 16));
count = gTasks[taskId].data[2];
if (count < 8)
{
gTasks[taskId].data[2]++;
LoadPalette(&gUnknown_085B28A0[count], 0xE0, 16 - 2 * count);
}
else
{
LoadPalette(gCaveTransitionPalette_White, 0, 0x20);
gTasks[taskId].func = sub_8137574;
gTasks[taskId].data[2] = 8;
}
}
static void sub_8137574(u8 taskId)
{
if (gTasks[taskId].data[2])
gTasks[taskId].data[2]--;
else
SetMainCallback2(gMain.savedCallback);
}
static void sub_81375A8(void)
{
CreateTask(sub_81375BC, 0);
}
static void sub_81375BC(u8 taskId)
{
gTasks[taskId].func = sub_81375D8;
}
static void sub_81375D8(u8 taskId)
{
SetGpuReg(REG_OFFSET_DISPCNT, 0);
LZ77UnCompVram(gCaveTransitionTiles, (void *)0x600C000);
LZ77UnCompVram(gCaveTransitionTilemap, (void *)0x600F800);
SetGpuReg(REG_OFFSET_BLDCNT, 0);
SetGpuReg(REG_OFFSET_BLDALPHA, 0);
SetGpuReg(REG_OFFSET_BLDY, 0);
SetGpuReg(REG_OFFSET_BG0CNT, BGCNT_PRIORITY(0)
| BGCNT_CHARBASE(3)
| BGCNT_SCREENBASE(31)
| BGCNT_16COLOR
| BGCNT_TXT256x256);
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0
| DISPCNT_OBJ_1D_MAP
| DISPCNT_BG0_ON
| DISPCNT_OBJ_ON);
LoadPalette(gCaveTransitionPalette_White, 0xE0, 0x20);
LoadPalette(gCaveTransitionPalette_Black, 0, 0x20);
gTasks[taskId].func = sub_8137678;
gTasks[taskId].data[0] = 16;
gTasks[taskId].data[1] = 0;
gTasks[taskId].data[2] = 0;
}
static void sub_8137678(u8 taskId)
{
u16 count = gTasks[taskId].data[2];
if (count < 16)
{
gTasks[taskId].data[2]++;
gTasks[taskId].data[2]++;
LoadPalette(&gUnknown_085B2890[15 - count], 0xE0, 2 * (count + 1));
}
else
{
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(16, 16));
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG0
| BLDCNT_EFFECT_BLEND
| BLDCNT_TGT2_BG1
| BLDCNT_TGT2_BG2
| BLDCNT_TGT2_BG3
| BLDCNT_TGT2_OBJ
| BLDCNT_TGT2_BD);
gTasks[taskId].func = sub_81376DC;
}
}
static void sub_81376DC(u8 taskId)
{
u16 count = 16 - gTasks[taskId].data[1];
u16 blend = count + 0x1000;
SetGpuReg(REG_OFFSET_BLDALPHA, blend);
if (count)
{
gTasks[taskId].data[1]++;
}
else
{
LoadPalette(gCaveTransitionPalette_Black, 0, 0x20);
SetMainCallback2(gMain.savedCallback);
}
}

299
src/fldeff_groundshake.c Normal file
View File

@ -0,0 +1,299 @@
#include "global.h"
#include "global.fieldmap.h"
#include "constants/flags.h"
#include "constants/songs.h"
#include "event_data.h"
#include "field_camera.h"
#include "field_map_obj.h"
#include "malloc.h"
#include "random.h"
#include "roulette_util.h"
#include "script.h"
#include "sound.h"
#include "sprite.h"
#include "task.h"
// structures
struct Struct203CF18 {
u8 taskId;
struct InnerStruct203CF18 unk4;
}; //size = 0xC8
// extern data
extern const struct SpriteSheet gUnknown_08617D94[];
extern const s16 gUnknown_08617D64[][3];
// static functions
static void sub_81BE808(u8 taskId);
static void sub_81BE900(u8 taskId);
static void sub_81BE968(void);
static void sub_81BE9C0(u8 taskId);
static void sub_81BEA00(u8 taskId);
static void sub_81BEA20(void);
static void sub_81BEAD8(struct Sprite* sprite);
// rodata
static const u8 gUnknown_08617E18[] = {0x3b, 0x43, 0x61, 0x00, 0x0f, 0x05, 0xff, 0x9b};
static const union AnimCmd gSpriteAnim_8617E20[] =
{
ANIMCMD_FRAME(0, 12),
ANIMCMD_JUMP(0),
};
static const union AnimCmd *const gSpriteAnimTable_8617E28[] =
{
gSpriteAnim_8617E20,
};
static const struct OamData gUnknown_08617E2C =
{
.y = 0,
.affineMode = 0,
.objMode = 0,
.mosaic = 0,
.bpp = 0,
.shape = 0,
.x = 0,
.matrixNum = 0,
.size = 0,
.tileNum = 0,
.priority = 0,
.paletteNum = 0,
.affineParam = 0,
};
static const struct SpriteTemplate gUnknown_08617E34 = {
0x0FA0, 0xFFFF, &gUnknown_08617E2C, gSpriteAnimTable_8617E28, NULL, gDummySpriteAffineAnimTable, sub_81BEAD8
};
static const union AnimCmd gSpriteAnim_8617E4C[] =
{
ANIMCMD_FRAME(0, 12),
ANIMCMD_JUMP(0),
};
static const union AnimCmd *const gSpriteAnim_8617E54[] =
{
gSpriteAnim_8617E4C,
};
static const struct OamData gSpriteAnim_8617E58 =
{
.y = 0,
.affineMode = 0,
.objMode = 0,
.mosaic = 0,
.bpp = 0,
.shape = 0,
.x = 0,
.matrixNum = 0,
.size = 1,
.tileNum = 0,
.priority = 0,
.paletteNum = 0,
.affineParam = 0,
};
static const struct SpriteTemplate gUnknown_08617E60 = {
0x0FA0, 0xFFFF, &gSpriteAnim_8617E58, gSpriteAnim_8617E54, NULL, gDummySpriteAffineAnimTable, sub_81BEAD8
};
// ewram
EWRAM_DATA struct Struct203CF18 *gUnknown_0203CF18 = NULL;
// text
bool8 sub_81BE66C(void)
{
if (!(gSaveBlock1Ptr->location.mapGroup == 0x0 && gSaveBlock1Ptr->location.mapNum == 0x1A))
return 0;
return FlagGet(FLAG_0x14E);
}
void sub_81BE698(u8 taskId)
{
sub_8151E50(&(gUnknown_0203CF18->unk4));
}
void sub_81BE6AC(void)
{
gUnknown_0203CF18 = NULL;
}
void sub_81BE6B8(void)
{
if(gUnknown_0203CF18 != NULL)
{
gUnknown_0203CF18 = NULL;
return;
}
if(!(gSaveBlock1Ptr->location.mapGroup == 0x0 && gSaveBlock1Ptr->location.mapNum == 0x1A) || !FlagGet(FLAG_0x14E))
return;
gUnknown_0203CF18 = (struct Struct203CF18 *)AllocZeroed(sizeof(struct Struct203CF18));
sub_8151B3C(&(gUnknown_0203CF18->unk4));
sub_8151B68(&(gUnknown_0203CF18->unk4), gUnknown_08617E18);
sub_8151CA8(&(gUnknown_0203CF18->unk4), 1, 1);
gUnknown_0203CF18->taskId = CreateTask(sub_81BE698, 0xFF);
}
void sub_81BE72C(void)
{
if(!(gSaveBlock1Ptr->location.mapGroup == 0x0 && gSaveBlock1Ptr->location.mapNum == 0x1A) || !FlagGet(FLAG_0x14E) || gUnknown_0203CF18 == NULL)
return;
if(FuncIsActiveTask(sub_81BE698))
DestroyTask(gUnknown_0203CF18->taskId);
sub_8151D28(&(gUnknown_0203CF18->unk4), 1, 1);
sub_8151C50(&(gUnknown_0203CF18->unk4), 1, 1);
Free(gUnknown_0203CF18);
gUnknown_0203CF18 = NULL;
}
void sub_81BE79C(void)
{
u16 rand;
bool8 chance;
if(VarGet(VAR_0x40CB) != 0)
{
FlagClear(FLAG_0x14E);
return;
}
rand = Random();
chance = rand & 1;
if(FlagGet(FLAG_0x09D) == TRUE)
chance = TRUE;
if(chance)
{
FlagSet(FLAG_0x14E);
sub_81BE6B8();
return;
}
FlagClear(FLAG_0x14E);
}
void sub_81BE7F4(void)
{
CreateTask(sub_81BE808, 0x8);
}
static void sub_81BE808(u8 taskId)
{
u8 mapObjectIdBuffer;
struct MapObject *fieldMapObject;
struct MapObject *playerAvatarMapObject;
TryGetFieldObjectIdByLocalIdAndMap(0x2D, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, &mapObjectIdBuffer);
fieldMapObject = &(gMapObjects[mapObjectIdBuffer]);
gSprites[fieldMapObject->spriteId].pos2.y += 4;
playerAvatarMapObject = &(gMapObjects[gPlayerAvatar.mapObjectId]);
if((gSprites[fieldMapObject->spriteId].pos1.y + gSprites[fieldMapObject->spriteId].pos2.y) >=
(gSprites[playerAvatarMapObject->spriteId].pos1.y + gSprites[playerAvatarMapObject->spriteId].pos2.y))
{
DestroyTask(taskId);
EnableBothScriptContexts();
}
}
static void sp136_strengh_sound(u8 a, u8 b, u8 c, u8 d)
{
u8 taskId;
taskId = CreateTask(sub_81BE900, 0x9);
gTasks[taskId].data[0] = b;
gTasks[taskId].data[1] = 0;
gTasks[taskId].data[2] = c;
gTasks[taskId].data[3] = d;
gTasks[taskId].data[4] = a;
SetCameraPanningCallback(NULL);
PlaySE(SE_W070);
}
static void sub_81BE900(u8 taskId)
{
s16 *data;
data = gTasks[taskId].data;
data[1]++;
if((data[1] % data[3]) == 0)
{
data[1] = 0;
data[2]--;
data[0] = -data[0];
data[4] = -data[4];
SetCameraPanning(data[0], data[4]);
if(!data[2])
{
sub_81BE968();
DestroyTask(taskId);
InstallCameraPanAheadCallback();
}
}
}
static void sub_81BE968(void)
{
u8 taskId;
taskId = FindTaskIdByFunc(sub_81BE9C0);
if(taskId != 0xFF)
gTasks[taskId].data[0]++;
}
void sub_81BE994(void)
{
LoadSpriteSheets(gUnknown_08617D94);
sub_81BEA20();
CreateTask(sub_81BE9C0, 0x8);
sp136_strengh_sound(2, 1, 16, 3);
}
static void sub_81BE9C0(u8 taskId)
{
u16 *data;
data = gTasks[taskId].data;
data[1]++;
if(data[1] == 1000 || data[0] == 17)
gTasks[taskId].func = sub_81BEA00;
}
static void sub_81BEA00(u8 taskId)
{
FreeSpriteTilesByTag(4000);
DestroyTask(taskId);
EnableBothScriptContexts();
}
static void sub_81BEA20(void)
{
u8 i;
u8 spriteId;
for(i = 0; i < 8; i++)
{
spriteId = CreateSprite(&gUnknown_08617E60, gUnknown_08617D64[i][0] + 120, gUnknown_08617D64[i][1], 8);
gSprites[spriteId].oam.priority = 0;
gSprites[spriteId].oam.paletteNum = 0;
gSprites[spriteId].data[0] = i;
}
for(i = 0; i < 8; i++)
{
spriteId = CreateSprite(&gUnknown_08617E34, gUnknown_08617D64[i][0] + 115, gUnknown_08617D64[i][1] - 3, 8);
gSprites[spriteId].oam.priority = 0;
gSprites[spriteId].oam.paletteNum = 0;
gSprites[spriteId].data[0] = i;
}
}
static void sub_81BEAD8(struct Sprite* sprite)
{
sprite->data[1] += 2;
sprite->pos2.y = (sprite->data[1] / 2);
if(((sprite->pos1.y) + (sprite->pos2.y)) > gUnknown_08617D64[sprite->data[0]][2])
{
DestroySprite(sprite);
sub_81BE968();
}
}

View File

@ -9,10 +9,10 @@
#include "strings.h"
#include "task.h"
void sub_816166C(u8 taskId);
void sub_81617B8(u8 taskId);
void sub_81616C0(u8 taskId);
void sub_8161724(u8 taskId);
static void sub_816166C(u8 taskId);
static void sub_81616C0(u8 taskId);
static void sub_8161724(u8 taskId);
static void sub_81617B8(u8 taskId);
bool8 SetUpFieldMove_SoftBoiled(void)
{
@ -63,13 +63,13 @@ void sub_81615A8(u8 taskId)
sub_81B1F18(taskId, unk9, -1, GetMonData(&gPlayerParty[unk9], MON_DATA_MAX_HP)/5, sub_816166C);
}
void sub_816166C(u8 taskId)
static void sub_816166C(u8 taskId)
{
PlaySE(SE_KAIFUKU);
sub_81B1F18(taskId, gUnknown_0203CEC8.unkA, 1, GetMonData(&gPlayerParty[gUnknown_0203CEC8.unk9], MON_DATA_MAX_HP)/5, sub_81616C0);
}
void sub_81616C0(u8 taskId)
static void sub_81616C0(u8 taskId)
{
GetMonNickname(&gPlayerParty[gUnknown_0203CEC8.unkA], gStringVar1);
StringExpandPlaceholders(gStringVar4, gText_PkmnHPRestoredByVar2);
@ -78,7 +78,7 @@ void sub_81616C0(u8 taskId)
gTasks[taskId].func = sub_8161724;
}
void sub_8161724(u8 taskId)
static void sub_8161724(u8 taskId)
{
if(sub_81B1BD4() == 1)
return;
@ -92,7 +92,7 @@ void sub_8161724(u8 taskId)
gTasks[taskId].func = sub_81B1370;
}
void sub_8161784(u8 taskId)
static void sub_8161784(u8 taskId)
{
if(sub_81B1BD4() == 1)
return;
@ -100,7 +100,7 @@ void sub_8161784(u8 taskId)
gTasks[taskId].func = sub_81B1370;
}
void sub_81617B8(u8 taskId)
static void sub_81617B8(u8 taskId)
{
PlaySE(SE_SELECT);
sub_81B1B5C(&gText_CantBeUsedOnPkmn, 0);

View File

@ -7,9 +7,11 @@
#include "script.h"
#include "task.h"
void FldEff_UseStrength(void);
void sub_8145E74(void);
// static functions
static void FldEff_UseStrength(void);
static void sub_8145E74(void);
// text
bool8 SetUpFieldMove_Strength(void)
{
if (npc_before_player_of_type(87) == TRUE)
@ -22,7 +24,7 @@ bool8 SetUpFieldMove_Strength(void)
return FALSE;
}
void FldEff_UseStrength(void)
static void FldEff_UseStrength(void)
{
gFieldEffectArguments[0] = GetCursorSelectionMonId();
ScriptContext1_SetupScript(FieryPath_EventScript_2908FD);
@ -37,7 +39,7 @@ bool8 sub_8145E2C(void)
return FALSE;
}
void sub_8145E74(void)
static void sub_8145E74(void)
{
FieldEffectActiveListRemove(FLDEFF_USE_STRENGTH);
EnableBothScriptContexts();

View File

@ -6,7 +6,6 @@
#include "field_effect.h"
#include "field_player_avatar.h"
#include "field_screen.h"
#include "fldeff_groundshake.h"
#include "palette.h"
#include "party_menu.h"
#include "rom6.h"
@ -20,6 +19,8 @@ void hm2_sweet_scent(void);
void sub_8159F5C(void);
void sub_8159FEC(u8 taskId);
void sub_815A090(u8 taskId);
void sub_81BE6B8(void);
void sub_81BE72C(void);
bool8 SetUpFieldMove_SweetScent(void)
{

770
src/fossil_specials.c Normal file
View File

@ -0,0 +1,770 @@
#include "global.h"
#include "constants/flags.h"
#include "constants/songs.h"
#include "bg.h"
#include "event_data.h"
#include "field_camera.h"
#include "field_map_obj.h"
#include "fieldmap.h"
#include "global.fieldmap.h"
#include "gpu_regs.h"
#include "malloc.h"
#include "menu.h"
#include "random.h"
#include "script.h"
#include "sound.h"
#include "sprite.h"
#include "task.h"
#include "window.h"
#define MIRAGE_TOWER_GFX_LENGTH (sizeof(gUnknown_08617274) + sizeof(gMirageTower_Gfx))
#define MIRAGE_TOWER_PALETTE_LENGTH 0x800
#define ROOT_FOSSIL_GFX_LENGTH sizeof(gRootFossil_Gfx)
#define ROOT_FOSSIL_GFX_RANDOMIZER_LENGTH 0x100
//struct
struct Struct8617DA4 {
u8 x;
u8 y;
u16 tileId;
};
struct Struct203CF10 {
u8 *buffer;
u8 curr_buffer_index;
};
struct DynamicSpriteFrameImage{
u8 *data;
u16 size;
};
struct Struct203CF0C {
u8 *frameImageTiles;
struct DynamicSpriteFrameImage *frameImage;
u8 spriteId;
u16 *unkC;
u16 unk10;
};
// static functions
static void sub_81BED50(u8 taskId);
static void sub_81BEBF4(u8 taskId);
static void sub_81BF028(u8 taskId);
static void sub_81BF248(struct Sprite *);
/*static*/ void sub_81BF2B8(u8* a, u16 b, u8 c, u8 d, u8 e);
// .rodata
static const u8 gUnknown_08617274[] = {00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00};
static const u8 gMirageTower_Gfx[] = INCBIN_U8("graphics/misc/mirage_tower.4bpp");
static const u16 gUnknown_08617B94[] = INCBIN_U16("graphics/misc/mirage_tower.bin");
static const u16 gRootFossil_Pal[] = INCBIN_U16("graphics/misc/fossil.gbapal");
static const u8 gRootFossil_Gfx[] = INCBIN_U8("graphics/misc/fossil.4bpp");
static const u8 gMirageTowerCrumbles_Gfx[] = INCBIN_U8("graphics/misc/mirage_tower_crumbles.4bpp");
static const u16 gMirageTowerCrumbles_Palette[] = INCBIN_U16("graphics/misc/mirage_tower_crumbles.gbapal");
const s16 gUnknown_08617D64[][3] =
{
{ 0, 10, 65},
{ 17, 3, 50},
{-12, 0, 75},
{ 10, 15, 90},
{ 7, 8, 65},
{-18, 5, 75},
{ 22, -10, 55},
{-24, -4, 65},
};
const struct SpriteSheet gUnknown_08617D94[] =
{
{gMirageTowerCrumbles_Gfx, 0x0080, 0x0fa0},
{NULL}
};
static const struct Struct8617DA4 gUnknown_08617DA4[] =
{
{0x12, 0x35, 0x251},
{0x13, 0x35, 0x251},
{0x14, 0x35, 0x251},
{0x12, 0x36, 0x251},
{0x13, 0x36, 0x251},
{0x14, 0x36, 0x251},
{0x12, 0x37, 0x251},
{0x13, 0x37, 0x251},
{0x14, 0x37, 0x251},
{0x12, 0x38, 0x251},
{0x13, 0x38, 0x251},
{0x14, 0x38, 0x251},
{0x12, 0x39, 0x259},
{0x13, 0x39, 0x259},
{0x14, 0x39, 0x259},
{0x12, 0x3A, 0x121},
{0x13, 0x3A, 0x121},
{0x14, 0x3A, 0x121},
};
static const union AnimCmd gSpriteAnim_8617DEC[] =
{
ANIMCMD_FRAME(0, 1),
ANIMCMD_END,
};
static const struct OamData gOamData_8617DF4 =
{
.y = 0,
.affineMode = 0,
.objMode = 0,
.mosaic = 0,
.bpp = 0,
.shape = 0,
.x = 0,
.matrixNum = 0,
.size = 1,
.tileNum = 0,
.priority = 0,
.paletteNum = 3,
.affineParam = 0,
};
static const union AnimCmd *const gSpriteAnimTable_8617DFC[] =
{
gSpriteAnim_8617DEC,
};
static const struct SpriteTemplate gUnknown_08617E00 = {
0xFFFF, 0xFFFF, &gOamData_8617DF4, gSpriteAnimTable_8617DFC, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
};
// ewram
EWRAM_DATA u8* gUnknown_0203CF04 = NULL;
EWRAM_DATA u8* gUnknown_0203CF08 = NULL;
EWRAM_DATA struct Struct203CF0C *gUnknown_0203CF0C = NULL;
EWRAM_DATA struct Struct203CF10 *gUnknown_0203CF10 = NULL;
EWRAM_DATA u16 *gUnknown_0203CF14 = NULL;
// iwram
IWRAM_DATA u16 gUnknown_030012A8[8] = {0, 0, 0, 0, 0, 0, 0, 0};
// text
void sub_81BEB24(void)
{
u8 i;
for(i = 0; i < (sizeof(gUnknown_08617DA4)/sizeof(gUnknown_08617DA4[0])); i++)
MapGridSetMetatileIdAt(gUnknown_08617DA4[i].x + 7, gUnknown_08617DA4[i].y + 7, gUnknown_08617DA4[i].tileId);
DrawWholeMapView();
}
void sub_81BEB54(void)
{
CreateTask(sub_81BED50, 0x9);
}
void sub_81BEB68(void)
{
CreateTask(sub_81BEBF4, 0x9);
}
void sub_81BEB7C(void)
{
CreateTask(sub_81BF028, 0x9);
}
void sub_81BEB90(void)
{
SetGpuReg(REG_OFFSET_BG0HOFS, gUnknown_0203CF14[0]);
SetGpuReg(REG_OFFSET_BG0VOFS, gUnknown_0203CF14[1]);
}
void sub_81BEBB4(u8 taskId)
{
if(!(gTasks[taskId].data[0]))
{
gUnknown_0203CF14[0] = -gUnknown_0203CF14[0];
gTasks[taskId].data[0] = 2;
sub_81BEB90();
}
else
gTasks[taskId].data[0]--;
}
static void sub_81BEBF4(u8 taskId)
{
u8 zero;
switch(gTasks[taskId].data[0])
{
case 0:
FreeAllWindowBuffers();
SetBgAttribute(0, BG_CTRL_ATTR_MOSAIC, 2);
gTasks[taskId].data[0]++;
break;
case 1:
gUnknown_0203CF04 = (u8 *)AllocZeroed(MIRAGE_TOWER_GFX_LENGTH);
gUnknown_0203CF08 = (u8 *)AllocZeroed(MIRAGE_TOWER_PALETTE_LENGTH);
ChangeBgX(0, 0, 0);
ChangeBgY(0, 0, 0);
gTasks[taskId].data[0]++;
break;
case 2:
CpuSet(gUnknown_08617274, gUnknown_0203CF04, MIRAGE_TOWER_GFX_LENGTH / 2);
LoadBgTiles(0, gUnknown_0203CF04, MIRAGE_TOWER_GFX_LENGTH, 0);
gTasks[taskId].data[0]++;
break;
case 3:
SetBgTilemapBuffer(0, gUnknown_0203CF08);
CopyToBgTilemapBufferRect_ChangePalette(0, &gUnknown_08617B94, 12, 29, 6, 12, 17);
CopyBgTilemapBufferToVram(0);
gTasks[taskId].data[0]++;
break;
case 4:
ShowBg(0);
gTasks[taskId].data[0]++;
break;
case 5:
sub_81BEB24();
gTasks[taskId].data[0]++;
break;
case 6:
gUnknown_0203CF14 = (u16 *)Alloc(4);
zero = 0;
gUnknown_0203CF14[0] = 2;
gUnknown_0203CF14[1] = zero;
CreateTask(sub_81BEBB4, 0xA);
DestroyTask(taskId);
EnableBothScriptContexts();
break;
}
}
#ifdef NONMATCHING
#define OUTER_BUFFER_LENGTH 0x60
#define INNER_BUFFER_LENGTH 0x30
static void sub_81BED50(u8 taskId)
{
u8 anotherTaskId, j;
switch(gTasks[taskId].data[0])
{
case 1:
gUnknown_0203CF10 = (struct Struct203CF10 *)AllocZeroed(OUTER_BUFFER_LENGTH * sizeof(struct Struct203CF10));
break;
case 3:
{
u16 i;
u16 left;
u32 index, next;
index = (u16)gTasks[taskId].data[3];
if(gTasks[taskId].data[3] <= (OUTER_BUFFER_LENGTH - 1))
{
if(gTasks[taskId].data[1] > 1)
{
index = (u8)index;
gUnknown_0203CF10[index].buffer = (u8 *)Alloc(INNER_BUFFER_LENGTH);
for(i = 0; i <= (INNER_BUFFER_LENGTH - 1); i++)
gUnknown_0203CF10[index].buffer[i] = i;
for(i = 0; i <= (INNER_BUFFER_LENGTH - 1); i++)
{
u16 rand1, rand2, temp;
rand1 = Random() % 0x30;
rand2 = Random() % 0x30;
temp = gUnknown_0203CF10[index].buffer[rand2];
gUnknown_0203CF10[index].buffer[rand2] = gUnknown_0203CF10[index].buffer[rand1];
gUnknown_0203CF10[index].buffer[rand1] = temp;
}
if(gTasks[taskId].data[3] <= (OUTER_BUFFER_LENGTH - 1))
gTasks[taskId].data[3]++;
gTasks[taskId].data[1] = 0;
}
gTasks[taskId].data[1]++;
}
index = (u8)gTasks[taskId].data[3];
for(left = (u8)gTasks[taskId].data[2]; left < (u16)index; left = next)
{
j = 0;
next = left + 1;
while(!j)
{
sub_81BF2B8(gUnknown_0203CF04, ((((OUTER_BUFFER_LENGTH - 1) - left) * INNER_BUFFER_LENGTH) + gUnknown_0203CF10[left].buffer[(gUnknown_0203CF10[left].curr_buffer_index)++]), 0, INNER_BUFFER_LENGTH, 1);
j++;
}
if(gUnknown_0203CF10[left].curr_buffer_index > (INNER_BUFFER_LENGTH - 1))
{
FREE_AND_SET_NULL(gUnknown_0203CF10[left].buffer);
gTasks[taskId].data[2]++;
if((left % 2) == 1)
gUnknown_0203CF14[1]--;
}
}
LoadBgTiles(0, gUnknown_0203CF04, MIRAGE_TOWER_GFX_LENGTH, 0);
if(gUnknown_0203CF10[OUTER_BUFFER_LENGTH - 1].curr_buffer_index > (INNER_BUFFER_LENGTH - 1))
break;
return;
}
case 4:
UnsetBgTilemapBuffer(0);
anotherTaskId = FindTaskIdByFunc(sub_81BEBB4);
if(anotherTaskId != 0xFF)
DestroyTask(anotherTaskId);
gUnknown_0203CF14[1] = gUnknown_0203CF14[0] = 0;
sub_81BEB90();
break;
case 5:
FREE_AND_SET_NULL(gUnknown_0203CF14);
FREE_AND_SET_NULL(gUnknown_0203CF10);
FREE_AND_SET_NULL(gUnknown_0203CF04);
FREE_AND_SET_NULL(gUnknown_0203CF08);
break;
case 6:
SetGpuRegBits(REG_OFFSET_BG2CNT, 0x2);
SetGpuRegBits(REG_OFFSET_BG0CNT, 0x0);
SetBgAttribute(0, BG_CTRL_ATTR_MOSAIC, 0);
sub_81971D0();
break;
case 7:
ShowBg(0);
break;
case 8:
DestroyTask(taskId);
EnableBothScriptContexts();
break;
}
gTasks[taskId].data[0]++;
}
#else
ASM_DIRECT
static void sub_81BED50(u8 taskId)
{
asm("\n\
.syntax unified\n\
push {r4-r7,lr}\n\
mov r7, r10\n\
mov r6, r9\n\
mov r5, r8\n\
push {r5-r7}\n\
sub sp, 0x10\n\
lsls r0, 24\n\
lsrs r0, 24\n\
mov r10, r0\n\
ldr r1, =gTasks\n\
lsls r0, 2\n\
add r0, r10\n\
lsls r0, 3\n\
adds r0, r1\n\
ldrh r0, [r0, 0x8]\n\
subs r0, 0x1\n\
lsls r0, 16\n\
asrs r0, 16\n\
adds r6, r1, 0\n\
cmp r0, 0x7\n\
bls _081BED7C\n\
b _081BF002\n\
_081BED7C:\n\
lsls r0, 2\n\
ldr r1, =_081BED90\n\
adds r0, r1\n\
ldr r0, [r0]\n\
mov pc, r0\n\
.pool\n\
.align 2, 0\n\
_081BED90:\n\
.4byte _081BEDB0\n\
.4byte _081BF002\n\
.4byte _081BEDC4\n\
.4byte _081BEF64\n\
.4byte _081BEF94\n\
.4byte _081BEFD0\n\
.4byte _081BEFF0\n\
.4byte _081BEFF8\n\
_081BEDB0:\n\
ldr r4, =gUnknown_0203CF10\n\
movs r0, 0xC0\n\
lsls r0, 2\n\
bl AllocZeroed\n\
str r0, [r4]\n\
b _081BF002\n\
.pool\n\
_081BEDC4:\n\
mov r1, r10\n\
lsls r0, r1, 2\n\
adds r1, r0, r1\n\
lsls r1, 3\n\
adds r2, r1, r6\n\
ldrh r3, [r2, 0xE]\n\
movs r4, 0xE\n\
ldrsh r1, [r2, r4]\n\
str r0, [sp, 0x8]\n\
cmp r1, 0x5F\n\
bgt _081BEE8A\n\
movs r1, 0xA\n\
ldrsh r0, [r2, r1]\n\
cmp r0, 0x1\n\
ble _081BEE7C\n\
lsls r0, r3, 24\n\
lsrs r4, r0, 24\n\
movs r0, 0x30\n\
bl Alloc\n\
ldr r3, =gUnknown_0203CF10\n\
ldr r1, [r3]\n\
lsls r2, r4, 3\n\
adds r1, r2, r1\n\
str r0, [r1]\n\
movs r5, 0\n\
adds r4, r2, 0\n\
_081BEDFA:\n\
ldr r0, [r3]\n\
adds r0, r4, r0\n\
ldr r0, [r0]\n\
adds r0, r5\n\
strb r5, [r0]\n\
adds r0, r5, 0x1\n\
lsls r0, 16\n\
lsrs r5, r0, 16\n\
cmp r5, 0x2F\n\
bls _081BEDFA\n\
movs r5, 0\n\
ldr r7, =gUnknown_0203CF10\n\
adds r6, r2, 0\n\
_081BEE14:\n\
bl Random\n\
lsls r0, 16\n\
lsrs r0, 16\n\
movs r1, 0x30\n\
bl __umodsi3\n\
adds r4, r0, 0\n\
lsls r4, 16\n\
lsrs r4, 16\n\
bl Random\n\
lsls r0, 16\n\
lsrs r0, 16\n\
movs r1, 0x30\n\
bl __umodsi3\n\
lsls r0, 16\n\
lsrs r0, 16\n\
ldr r1, [r7]\n\
adds r1, r6, r1\n\
ldr r1, [r1]\n\
adds r0, r1, r0\n\
ldrb r2, [r0]\n\
adds r1, r4 \n\
ldrb r1, [r1]\n\
strb r1, [r0]\n\
ldr r0, [r7]\n\
adds r0, r6, r0\n\
ldr r0, [r0]\n\
adds r0, r4\n\
strb r2, [r0]\n\
adds r0, r5, 0x1\n\
lsls r0, 16\n\
lsrs r5, r0, 16\n\
cmp r5, 0x2F\n\
bls _081BEE14\n\
ldr r0, =gTasks\n\
ldr r1, [sp, 0x8]\n\
add r1, r10\n\
lsls r1, 3\n\
adds r2, r1, r0\n\
ldrh r3, [r2, 0xE]\n\
movs r4, 0xE\n\
ldrsh r1, [r2, r4]\n\
adds r6, r0, 0\n\
cmp r1, 0x5F\n\
bgt _081BEE78\n\
adds r0, r3, 0x1\n\
strh r0, [r2, 0xE]\n\
_081BEE78:\n\
movs r0, 0\n\
strh r0, [r2, 0xA]\n\
_081BEE7C:\n\
ldr r1, [sp, 0x8]\n\
add r1, r10\n\
lsls r1, 3\n\
adds r1, r6\n\
ldrh r0, [r1, 0xA]\n\
adds r0, 0x1\n\
strh r0, [r1, 0xA]\n\
_081BEE8A:\n\
ldr r0, [sp, 0x8]\n\
add r0, r10\n\
lsls r0, 3\n\
adds r0, r6\n\
ldrb r4, [r0, 0xE]\n\
ldrb r5, [r0, 0xC]\n\
lsls r0, r4, 16\n\
cmp r5, r4\n\
bcs _081BEF32\n\
str r0, [sp, 0xC]\n\
_081BEE9E:\n\
movs r6, 0\n\
adds r0, r5, 0x1\n\
str r0, [sp, 0x4]\n\
lsls r4, r5, 3\n\
movs r2, 0x5F\n\
subs r1, r2, r5\n\
lsls r0, r1, 1\n\
adds r0, r1\n\
lsls r0, 4\n\
mov r9, r0\n\
_081BEEB2:\n\
ldr r0, =gUnknown_0203CF04\n\
ldr r0, [r0]\n\
ldr r7, =gUnknown_0203CF10\n\
ldr r3, [r7]\n\
adds r3, r4, r3\n\
ldrb r2, [r3, 0x4]\n\
adds r1, r2, 0x1\n\
strb r1, [r3, 0x4]\n\
lsls r2, 24\n\
lsrs r2, 24\n\
ldr r1, [r3]\n\
adds r1, r2\n\
ldrb r1, [r1]\n\
add r1, r9\n\
lsls r1, 16\n\
lsrs r1, 16\n\
movs r2, 0x1\n\
mov r8, r2\n\
str r2, [sp]\n\
movs r2, 0\n\
movs r3, 0x30\n\
bl sub_81BF2B8\n\
adds r0, r6, 0x1\n\
lsls r0, 24\n\
lsrs r6, r0, 24\n\
cmp r6, 0\n\
beq _081BEEB2\n\
ldr r0, [r7]\n\
adds r1, r4, r0\n\
ldrb r0, [r1, 0x4]\n\
cmp r0, 0x2F\n\
bls _081BEF24\n\
ldr r0, [r1]\n\
bl Free\n\
ldr r0, [r7]\n\
adds r0, r4, r0\n\
movs r1, 0\n\
str r1, [r0]\n\
ldr r1, [sp, 0x8]\n\
add r1, r10\n\
lsls r1, 3\n\
ldr r4, =gTasks\n\
adds r1, r4\n\
ldrh r0, [r1, 0xC]\n\
adds r0, 0x1\n\
strh r0, [r1, 0xC]\n\
mov r0, r8\n\
ands r5, r0\n\
cmp r5, 0x1\n\
bne _081BEF24\n\
ldr r0, =gUnknown_0203CF14\n\
ldr r1, [r0]\n\
ldrh r0, [r1, 0x2]\n\
subs r0, 0x1\n\
strh r0, [r1, 0x2]\n\
_081BEF24:\n\
ldr r1, [sp, 0x4]\n\
lsls r0, r1, 16\n\
lsrs r5, r0, 16\n\
ldr r2, [sp, 0xC]\n\
lsrs r0, r2, 16\n\
cmp r5, r0\n\
bcc _081BEE9E\n\
_081BEF32:\n\
ldr r0, =gUnknown_0203CF04\n\
ldr r1, [r0]\n\
movs r2, 0x92\n\
lsls r2, 4\n\
movs r0, 0\n\
movs r3, 0\n\
bl LoadBgTiles\n\
ldr r0, =gUnknown_0203CF10\n\
ldr r0, [r0]\n\
movs r4, 0xBE\n\
lsls r4, 2\n\
adds r0, r4\n\
ldrb r0, [r0, 0x4]\n\
cmp r0, 0x2F\n\
bhi _081BF002\n\
b _081BF014\n\
.pool\n\
_081BEF64:\n\
movs r0, 0\n\
bl UnsetBgTilemapBuffer\n\
ldr r0, =sub_81BEBB4\n\
bl FindTaskIdByFunc\n\
lsls r0, 24\n\
lsrs r0, 24\n\
cmp r0, 0xFF\n\
beq _081BEF7C\n\
bl DestroyTask\n\
_081BEF7C:\n\
ldr r0, =gUnknown_0203CF14\n\
ldr r1, [r0]\n\
movs r0, 0\n\
strh r0, [r1]\n\
strh r0, [r1, 0x2]\n\
bl sub_81BEB90\n\
b _081BF002\n\
.pool\n\
_081BEF94:\n\
ldr r4, =gUnknown_0203CF14\n\
ldr r0, [r4]\n\
bl Free\n\
movs r5, 0\n\
str r5, [r4]\n\
ldr r4, =gUnknown_0203CF10\n\
ldr r0, [r4]\n\
bl Free\n\
str r5, [r4]\n\
ldr r4, =gUnknown_0203CF04\n\
ldr r0, [r4]\n\
bl Free\n\
str r5, [r4]\n\
ldr r4, =gUnknown_0203CF08\n\
ldr r0, [r4]\n\
bl Free\n\
str r5, [r4]\n\
b _081BF002\n\
.pool\n\
_081BEFD0:\n\
movs r0, 0xC\n\
movs r1, 0x2\n\
bl SetGpuRegBits\n\
movs r0, 0x8\n\
movs r1, 0\n\
bl SetGpuRegBits\n\
movs r0, 0\n\
movs r1, 0x7\n\
movs r2, 0\n\
bl SetBgAttribute\n\
bl sub_81971D0\n\
b _081BF002\n\
_081BEFF0:\n\
movs r0, 0\n\
bl ShowBg\n\
b _081BF002\n\
_081BEFF8:\n\
mov r0, r10\n\
bl DestroyTask\n\
bl EnableBothScriptContexts\n\
_081BF002:\n\
ldr r0, =gTasks\n\
mov r2, r10\n\
lsls r1, r2, 2\n\
add r1, r10\n\
lsls r1, 3\n\
adds r1, r0\n\
ldrh r0, [r1, 0x8]\n\
adds r0, 0x1\n\
strh r0, [r1, 0x8]\n\
_081BF014:\n\
add sp, 0x10\n\
pop {r3-r5}\n\
mov r8, r3\n\
mov r9, r4\n\
mov r10, r5\n\
pop {r4-r7}\n\
pop {r0}\n\
bx r0\n\
.pool\n\
.syntax divided");
}
#endif // NONMATCHING
static void sub_81BF028(u8 taskId)
{
u16 i;
switch(gTasks[taskId].data[0])
{
case 1:
gUnknown_0203CF0C = (struct Struct203CF0C *)AllocZeroed(sizeof(struct Struct203CF0C));
gUnknown_0203CF0C->frameImageTiles = (u8 *)AllocZeroed(ROOT_FOSSIL_GFX_LENGTH);
gUnknown_0203CF0C->frameImage = (struct DynamicSpriteFrameImage *) AllocZeroed(sizeof(struct DynamicSpriteFrameImage));
gUnknown_0203CF0C->unkC = (u16 *)AllocZeroed(ROOT_FOSSIL_GFX_RANDOMIZER_LENGTH * sizeof(u16));
gUnknown_0203CF0C->unk10 = 0;
break;
case 2:
{
u8 *buffer;
buffer = gUnknown_0203CF0C->frameImageTiles;
for(i = 0; i < ROOT_FOSSIL_GFX_LENGTH; i++, buffer++)
*buffer = gRootFossil_Gfx[i];
}
break;
case 3:
gUnknown_0203CF0C->frameImage->data = gUnknown_0203CF0C->frameImageTiles;
gUnknown_0203CF0C->frameImage->size = ROOT_FOSSIL_GFX_LENGTH;
break;
case 4:
{
u8 spriteId, zero;
struct SpriteTemplate fossilTemplate;
fossilTemplate = gUnknown_08617E00;
fossilTemplate.images = (struct SpriteFrameImage *)(gUnknown_0203CF0C->frameImage);
spriteId = CreateSprite(&fossilTemplate, 128, -16, 1);
gUnknown_0203CF0C->spriteId = spriteId;
zero = 0;
gSprites[gUnknown_0203CF0C->spriteId].centerToCornerVecX = zero;
gSprites[gUnknown_0203CF0C->spriteId].data[0] = gSprites[gUnknown_0203CF0C->spriteId].pos1.x;
gSprites[gUnknown_0203CF0C->spriteId].data[1] = 1;
}
case 5:
for(i = 0; i < ROOT_FOSSIL_GFX_RANDOMIZER_LENGTH; i++)
gUnknown_0203CF0C->unkC[i] = i;
break;
case 6:
{
u16 rand1, rand2, temp, j;
j = (ROOT_FOSSIL_GFX_RANDOMIZER_LENGTH * sizeof(u16)) - 1;
for(i = 0; i <= j; i++)
{
rand1 = Random() % 0x100;
rand2 = Random() % 0x100;
j = (ROOT_FOSSIL_GFX_RANDOMIZER_LENGTH * sizeof(u16)) - 1;
temp = gUnknown_0203CF0C->unkC[rand2];
gUnknown_0203CF0C->unkC[rand2] = gUnknown_0203CF0C->unkC[rand1];
gUnknown_0203CF0C->unkC[rand1] = temp;
}
gSprites[gUnknown_0203CF0C->spriteId].callback = sub_81BF248;
break;
}
case 7:
if(gSprites[gUnknown_0203CF0C->spriteId].callback != SpriteCallbackDummy)
return;
DestroySprite(&gSprites[gUnknown_0203CF0C->spriteId]);
FREE_AND_SET_NULL(gUnknown_0203CF0C->unkC);;
FREE_AND_SET_NULL(gUnknown_0203CF0C->frameImage);
FREE_AND_SET_NULL(gUnknown_0203CF0C->frameImageTiles);
FREE_AND_SET_NULL(gUnknown_0203CF0C);
break;
case 8:
EnableBothScriptContexts();
}
++gTasks[taskId].data[0];
}
static void sub_81BF248(struct Sprite *sprite)
{
if (gUnknown_0203CF0C->unk10 >= (ROOT_FOSSIL_GFX_RANDOMIZER_LENGTH))
{
sprite->callback = SpriteCallbackDummy;
}
else if (sprite->pos1.y >= 0x60)
{
u8 i;
for (i = 0; i < 2; i++)
{
sub_81BF2B8(gUnknown_0203CF0C->frameImageTiles, gUnknown_0203CF0C->unkC[gUnknown_0203CF0C->unk10++], 0, 16, 0);
}
StartSpriteAnim(sprite, 0);
}
else
{
sprite->pos1.y++;
}
}

View File

@ -2198,7 +2198,7 @@ void DeleteFirstMoveAndGiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move)
(var) /= (gStatStageRatios)[(mon)->statStages[(statIndex)]][1]; \
}
s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *defender, u32 move, u16 sideStatus, u16 powerOverride, u8 typeOverride, u8 bankAtk, u8 bankDef)
s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *defender, u32 move, u16 sideStatus, u16 powerOverride, u8 typeOverride, u8 battlerIdAtk, u8 battlerIdDef)
{
u32 i;
s32 damage = 0;
@ -2228,8 +2228,8 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de
if (attacker->item == ITEM_ENIGMA_BERRY)
{
attackerHoldEffect = gEnigmaBerries[bankAtk].holdEffect;
attackerHoldEffectParam = gEnigmaBerries[bankAtk].holdEffectParam;
attackerHoldEffect = gEnigmaBerries[battlerIdAtk].holdEffect;
attackerHoldEffectParam = gEnigmaBerries[battlerIdAtk].holdEffectParam;
}
else
{
@ -2239,8 +2239,8 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de
if (defender->item == ITEM_ENIGMA_BERRY)
{
defenderHoldEffect = gEnigmaBerries[bankDef].holdEffect;
defenderHoldEffectParam = gEnigmaBerries[bankDef].holdEffectParam;
defenderHoldEffect = gEnigmaBerries[battlerIdDef].holdEffect;
defenderHoldEffectParam = gEnigmaBerries[battlerIdDef].holdEffectParam;
}
else
{
@ -2251,13 +2251,13 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de
if (attacker->ability == ABILITY_HUGE_POWER || attacker->ability == ABILITY_PURE_POWER)
attack *= 2;
if (ShouldGetStatBadgeBoost(FLAG_BADGE01_GET, bankAtk))
if (ShouldGetStatBadgeBoost(FLAG_BADGE01_GET, battlerIdAtk))
attack = (110 * attack) / 100;
if (ShouldGetStatBadgeBoost(FLAG_BADGE05_GET, bankDef))
if (ShouldGetStatBadgeBoost(FLAG_BADGE05_GET, battlerIdDef))
defense = (110 * defense) / 100;
if (ShouldGetStatBadgeBoost(FLAG_BADGE07_GET, bankAtk))
if (ShouldGetStatBadgeBoost(FLAG_BADGE07_GET, battlerIdAtk))
spAttack = (110 * spAttack) / 100;
if (ShouldGetStatBadgeBoost(FLAG_BADGE07_GET, bankDef))
if (ShouldGetStatBadgeBoost(FLAG_BADGE07_GET, battlerIdDef))
spDefense = (110 * spDefense) / 100;
for (i = 0; i < ARRAY_COUNT(sHoldEffectToType); i++)
@ -2442,7 +2442,7 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de
}
// flash fire triggered
if ((gBattleResources->flags->flags[bankAtk] & UNKNOWN_FLAG_FLASH_FIRE) && type == TYPE_FIRE)
if ((gBattleResources->flags->flags[battlerIdAtk] & UNKNOWN_FLAG_FLASH_FIRE) && type == TYPE_FIRE)
damage = (15 * damage) / 10;
}

View File

@ -1612,7 +1612,7 @@ bool8 ScrCmd_buffernumberstring(struct ScriptContext *ctx)
{
u8 stringVarIndex = ScriptReadByte(ctx);
u16 v1 = VarGet(ScriptReadHalfword(ctx));
u8 v2 = sub_80EF370(v1);
u8 v2 = CountDigits(v1);
ConvertIntToDecimalStringN(sScriptStringVars[stringVarIndex], v1, 0, v2);
return FALSE;

483
src/tv.c

File diff suppressed because it is too large Load Diff