Merge branch 'master' into secret_base

This commit is contained in:
PikalaxALT 2017-11-01 23:37:57 -04:00
commit 17fd3bccf7
95 changed files with 20014 additions and 61090 deletions

View File

@ -1888,7 +1888,7 @@ sub_8035C4C: @ 8035C4C
bne _08035C68
ldr r0, =gText_Draw
movs r1, 0x15
bl sub_814F9EC
bl BattleHandleAddTextPrinter
b _08035D68
.pool
_08035C68:
@ -1964,10 +1964,10 @@ _08035CE2:
_08035CFC:
ldr r0, =gText_Win
movs r1, 0x17
bl sub_814F9EC
bl BattleHandleAddTextPrinter
ldr r0, =gText_Loss
movs r1, 0x16
bl sub_814F9EC
bl BattleHandleAddTextPrinter
b _08035D68
.pool
_08035D20:
@ -1985,19 +1985,19 @@ _08035D20:
_08035D36:
ldr r0, =gText_Win
movs r1, 0x16
bl sub_814F9EC
bl BattleHandleAddTextPrinter
ldr r0, =gText_Loss
movs r1, 0x17
bl sub_814F9EC
bl BattleHandleAddTextPrinter
b _08035D68
.pool
_08035D58:
ldr r0, =gText_Win
movs r1, 0x17
bl sub_814F9EC
bl BattleHandleAddTextPrinter
ldr r0, =gText_Loss
movs r1, 0x16
bl sub_814F9EC
bl BattleHandleAddTextPrinter
_08035D68:
pop {r0}
bx r0
@ -2068,14 +2068,14 @@ _08035DDC:
_08035DE6:
adds r0, r1, 0
movs r1, 0x11
bl sub_814F9EC
bl BattleHandleAddTextPrinter
ldrb r1, [r4, 0x18]
movs r0, 0x4
b _08035E14
_08035DF4:
adds r0, r1, 0
movs r1, 0x12
bl sub_814F9EC
bl BattleHandleAddTextPrinter
ldrb r1, [r4, 0x18]
movs r0, 0x4
str r0, [sp]
@ -2085,7 +2085,7 @@ _08035DF4:
_08035E08:
adds r0, r1, 0
movs r1, 0x13
bl sub_814F9EC
bl BattleHandleAddTextPrinter
ldrb r1, [r4, 0x18]
movs r0, 0x8
_08035E14:
@ -2099,7 +2099,7 @@ _08035E1A:
_08035E22:
adds r0, r1, 0
movs r1, 0x14
bl sub_814F9EC
bl BattleHandleAddTextPrinter
ldrb r1, [r4, 0x18]
movs r0, 0x8
str r0, [sp]
@ -2139,14 +2139,14 @@ _08035E66:
adds r1, r0, r4
adds r0, r1, 0
movs r1, 0xF
bl sub_814F9EC
bl BattleHandleAddTextPrinter
lsls r0, r6, 3
subs r0, r6
lsls r0, 2
adds r1, r0, r4
adds r0, r1, 0
movs r1, 0x10
bl sub_814F9EC
bl BattleHandleAddTextPrinter
movs r4, 0x7
str r4, [sp]
adds r0, r7, 0

View File

@ -67,8 +67,8 @@ _0805D192:
.pool
thumb_func_end FreeBattleSpritesData
thumb_func_start sub_805D19C
sub_805D19C: @ 805D19C
thumb_func_start ChooseMoveAndTargetInBattlePalace
ChooseMoveAndTargetInBattlePalace: @ 805D19C
push {r4-r7,lr}
mov r7, r10
mov r6, r9
@ -448,7 +448,7 @@ _0805D496:
pop {r1}
bx r1
.pool
thumb_func_end sub_805D19C
thumb_func_end ChooseMoveAndTargetInBattlePalace
thumb_func_start sub_805D4A8
sub_805D4A8: @ 805D4A8
@ -834,8 +834,8 @@ _0805D800:
.pool
thumb_func_end sub_805D7EC
thumb_func_start move_anim_start_t2_for_situation
move_anim_start_t2_for_situation: @ 805D808
thumb_func_start DoStatusAnimation
DoStatusAnimation: @ 805D808
push {r4-r6,lr}
adds r4, r1, 0
lsls r0, 24
@ -962,10 +962,10 @@ _0805D902:
pop {r4-r6}
pop {r0}
bx r0
thumb_func_end move_anim_start_t2_for_situation
thumb_func_end DoStatusAnimation
thumb_func_start move_anim_start_t3
move_anim_start_t3: @ 805D908
thumb_func_start DoBattleAnimationFromTable
DoBattleAnimationFromTable: @ 805D908
push {r4-r7,lr}
mov r7, r10
mov r6, r9
@ -1070,7 +1070,7 @@ _0805D9CC:
ldr r0, =gUnknown_082C9320
adds r1, r5, 0
movs r2, 0
bl DoBattleAnim
bl LaunchBattleAnimation
ldr r0, =task0A_0803415C
movs r1, 0xA
bl CreateTask
@ -1105,7 +1105,7 @@ _0805DA1E:
pop {r1}
bx r1
.pool
thumb_func_end move_anim_start_t3
thumb_func_end DoBattleAnimationFromTable
thumb_func_start task0A_0803415C
task0A_0803415C: @ 805DA48
@ -1172,8 +1172,8 @@ _0805DABE:
bx r1
thumb_func_end sub_805DAA0
thumb_func_start move_anim_start_t4
move_anim_start_t4: @ 805DAC4
thumb_func_start DoSpecialBattleAnimation
DoSpecialBattleAnimation: @ 805DAC4
push {r4,lr}
adds r4, r0, 0
lsls r4, 24
@ -1187,7 +1187,7 @@ move_anim_start_t4: @ 805DAC4
ldr r0, =gUnknown_082C937C
adds r1, r3, 0
movs r2, 0
bl DoBattleAnim
bl LaunchBattleAnimation
ldr r0, =task0A_08034248
movs r1, 0xA
bl CreateTask
@ -1216,7 +1216,7 @@ move_anim_start_t4: @ 805DAC4
pop {r0}
bx r0
.pool
thumb_func_end move_anim_start_t4
thumb_func_end DoSpecialBattleAnimation
thumb_func_start task0A_08034248
task0A_08034248: @ 805DB34
@ -1258,11 +1258,11 @@ _0805DB76:
.pool
thumb_func_end task0A_08034248
thumb_func_start sub_805DB8C
sub_805DB8C: @ 805DB8C
thumb_func_start IsMoveWithoutAnimation
IsMoveWithoutAnimation: @ 805DB8C
movs r0, 0
bx lr
thumb_func_end sub_805DB8C
thumb_func_end IsMoveWithoutAnimation
thumb_func_start mplay_80342A4
mplay_80342A4: @ 805DB90
@ -1357,7 +1357,7 @@ BattleLoadOpponentMonSpriteGfx: @ 805DC0C
.pool
_0805DC50:
ldrh r5, [r2, 0x2]
ldr r0, =gUnknown_020244BC
ldr r0, =gTransformedPersonalities
adds r0, r1, r0
ldr r6, [r0]
_0805DC58:
@ -1510,7 +1510,7 @@ BattleLoadPlayerMonSpriteGfx: @ 805DD7C
.pool
_0805DDC0:
ldrh r5, [r2, 0x2]
ldr r0, =gUnknown_020244BC
ldr r0, =gTransformedPersonalities
adds r0, r1, r0
ldr r4, [r0]
_0805DDC8:
@ -1670,8 +1670,8 @@ nullsub_24: @ 805DF34
bx lr
thumb_func_end nullsub_24
thumb_func_start sub_805DF38
sub_805DF38: @ 805DF38
thumb_func_start DecompressTrainerFrontPic
DecompressTrainerFrontPic: @ 805DF38
push {r4,lr}
adds r4, r0, 0
adds r0, r1, 0
@ -1701,10 +1701,10 @@ sub_805DF38: @ 805DF38
pop {r0}
bx r0
.pool
thumb_func_end sub_805DF38
thumb_func_end DecompressTrainerFrontPic
thumb_func_start LoadBackTrainerBankSpriteGfx
LoadBackTrainerBankSpriteGfx: @ 805DF84
thumb_func_start DecompressTrainerBackPic
DecompressTrainerBackPic: @ 805DF84
push {r4,r5,lr}
adds r5, r0, 0
adds r4, r1, 0
@ -1742,15 +1742,15 @@ LoadBackTrainerBankSpriteGfx: @ 805DF84
pop {r0}
bx r0
.pool
thumb_func_end LoadBackTrainerBankSpriteGfx
thumb_func_end DecompressTrainerBackPic
thumb_func_start nullsub_25
nullsub_25: @ 805DFE0
bx lr
thumb_func_end nullsub_25
thumb_func_start sub_805DFE4
sub_805DFE4: @ 805DFE4
thumb_func_start FreeTrainerFrontPicPalette
FreeTrainerFrontPicPalette: @ 805DFE4
push {lr}
lsls r0, 16
ldr r1, =gTrainerFrontPicPaletteTable
@ -1761,7 +1761,7 @@ sub_805DFE4: @ 805DFE4
pop {r0}
bx r0
.pool
thumb_func_end sub_805DFE4
thumb_func_end FreeTrainerFrontPicPalette
thumb_func_start sub_805DFFC
sub_805DFFC: @ 805DFFC
@ -2229,8 +2229,8 @@ _0805E3EA:
.pool
thumb_func_end sub_805E394
thumb_func_start sub_805E408
sub_805E408: @ 805E408
thumb_func_start CopyBattleSpriteInvisibility
CopyBattleSpriteInvisibility: @ 805E408
lsls r0, 24
lsrs r0, 24
ldr r1, =gBattleSpritesDataPtr
@ -2258,7 +2258,7 @@ sub_805E408: @ 805E408
strb r0, [r3]
bx lr
.pool
thumb_func_end sub_805E408
thumb_func_end CopyBattleSpriteInvisibility
thumb_func_start sub_805E448
sub_805E448: @ 805E448
@ -2441,7 +2441,7 @@ _0805E59C:
adds r1, 0x4
adds r1, r2
ldr r1, [r1]
ldr r3, =gUnknown_020244BC
ldr r3, =gTransformedPersonalities
lsls r2, r7, 2
adds r2, r3
ldr r3, [r2]
@ -2479,7 +2479,7 @@ _0805E618:
adds r1, 0x4
adds r1, r2
ldr r1, [r1]
ldr r3, =gUnknown_020244BC
ldr r3, =gTransformedPersonalities
lsls r2, r7, 2
adds r2, r3
ldr r3, [r2]
@ -2795,8 +2795,8 @@ _0805E93E:
bx r0
thumb_func_end refresh_graphics_maybe
thumb_func_start sub_805E94C
sub_805E94C: @ 805E94C
thumb_func_start TrySetBehindSubstituteSpriteBit
TrySetBehindSubstituteSpriteBit: @ 805E94C
push {lr}
lsls r0, 24
lsrs r2, r0, 24
@ -2817,7 +2817,7 @@ _0805E96C:
pop {r0}
bx r0
.pool
thumb_func_end sub_805E94C
thumb_func_end TrySetBehindSubstituteSpriteBit
thumb_func_start sub_805E974
sub_805E974: @ 805E974
@ -3111,7 +3111,7 @@ sub_805EB9C: @ 805EB9C
_0805EBC8:
lsls r0, r5, 24
lsrs r0, 24
bl AnimBankSpriteExists
bl IsBankSpritePresent
lsls r0, 24
cmp r0, 0
beq _0805EC60
@ -3329,7 +3329,7 @@ sub_805ED70: @ 805ED70
cmp r0, 0
beq _0805EDAC
adds r0, r4, 0
bl AnimBankSpriteExists
bl IsBankSpritePresent
lsls r0, 24
cmp r0, 0
bne _0805EDC0
@ -3572,8 +3572,8 @@ _0805EF6A:
.pool
thumb_func_end sub_805EF14
thumb_func_start sub_805EF84
sub_805EF84: @ 805EF84
thumb_func_start ClearTemporarySpeciesSpriteData
ClearTemporarySpeciesSpriteData: @ 805EF84
push {r4,lr}
lsls r0, 24
lsrs r4, r0, 24
@ -3598,7 +3598,7 @@ _0805EFAC:
pop {r0}
bx r0
.pool
thumb_func_end sub_805EF84
thumb_func_end ClearTemporarySpeciesSpriteData
thumb_func_start AllocateMonSpritesGfx
AllocateMonSpritesGfx: @ 805EFBC

View File

@ -217,7 +217,7 @@ _080A5E04:
b _080A5E42
.pool
_080A5E3C:
ldr r0, =gUnknown_020244BC
ldr r0, =gTransformedPersonalities
adds r0, r1, r0
ldr r2, [r0]
_080A5E42:
@ -307,7 +307,7 @@ _080A5EC8:
b _080A5F0A
.pool
_080A5F04:
ldr r0, =gUnknown_020244BC
ldr r0, =gTransformedPersonalities
adds r0, r1, r0
ldr r2, [r0]
_080A5F0A:
@ -726,7 +726,7 @@ GetAnimBankSpriteId: @ 80A6240
bne _080A6268
ldr r4, =gAnimBankAttacker
ldrb r0, [r4]
bl AnimBankSpriteExists
bl IsBankSpritePresent
lsls r0, 24
cmp r0, 0
beq _080A62B6
@ -739,7 +739,7 @@ _080A6268:
bne _080A6288
ldr r4, =gAnimBankTarget
ldrb r0, [r4]
bl AnimBankSpriteExists
bl IsBankSpritePresent
lsls r0, 24
cmp r0, 0
beq _080A62B6
@ -1862,8 +1862,8 @@ _080A6A7E:
.pool
thumb_func_end GetBankByIdentity
thumb_func_start AnimBankSpriteExists
AnimBankSpriteExists: @ 80A6A90
thumb_func_start IsBankSpritePresent
IsBankSpritePresent: @ 80A6A90
push {r4,r5,lr}
lsls r0, 24
lsrs r4, r0, 24
@ -1926,7 +1926,7 @@ _080A6B1A:
pop {r4,r5}
pop {r1}
bx r1
thumb_func_end AnimBankSpriteExists
thumb_func_end IsBankSpritePresent
thumb_func_start IsDoubleBattle
IsDoubleBattle: @ 80A6B20
@ -5522,7 +5522,7 @@ _080A86C4:
.pool
_080A871C:
ldrh r7, [r1, 0x2]
ldr r0, =gUnknown_020244BC
ldr r0, =gTransformedPersonalities
adds r0, r2, r0
ldr r2, [r0]
_080A8724:
@ -5612,7 +5612,7 @@ _080A8790:
.pool
_080A87DC:
ldrh r7, [r1, 0x2]
ldr r0, =gUnknown_020244BC
ldr r0, =gTransformedPersonalities
adds r0, r2, r0
ldr r2, [r0]
_080A87E4:

View File

@ -869,7 +869,7 @@ move_anim_start_t2: @ 80AA364
strb r4, [r0]
ldr r0, =gUnknown_082C92FC
movs r2, 0
bl DoBattleAnim
bl LaunchBattleAnimation
ldr r0, =task0A_80788BC
movs r1, 0xA
bl CreateTask

View File

@ -50443,8 +50443,8 @@ _081181CA:
bx r1
thumb_func_end sub_8118140
thumb_func_start battle_intro_launch
battle_intro_launch: @ 81181D4
thumb_func_start HandleIntroSlide
HandleIntroSlide: @ 81181D4
push {r4,lr}
lsls r0, 24
lsrs r4, r0, 24
@ -50521,7 +50521,7 @@ _08118258:
pop {r0}
bx r0
.pool
thumb_func_end battle_intro_launch
thumb_func_end HandleIntroSlide
thumb_func_start sub_811828C
sub_811828C: @ 811828C

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -6956,7 +6956,7 @@ _08192574:
cmp r2, r0
bne _08192598
ldrb r0, [r1, 0x8]
bl sub_806F000
bl PlayerGenderToFrontTrainerPicId
lsls r0, 16
lsrs r0, 16
b _081925B6
@ -6971,7 +6971,7 @@ _08192598:
.pool
_081925AC:
ldr r0, [sp, 0x24]
bl sub_8162AA0
bl GetFrontierTrainerFrontSpriteId
_081925B2:
lsls r0, 24
lsrs r0, 24
@ -8535,7 +8535,7 @@ _081932A2:
ldr r0, =gSaveBlock2Ptr
ldr r0, [r0]
ldrb r0, [r0, 0x8]
bl sub_806F000
bl PlayerGenderToFrontTrainerPicId
lsls r0, 16
lsrs r0, 16
mov r2, r8
@ -8554,7 +8554,7 @@ _081932D4:
_081932E4:
lsls r0, r1, 16
lsrs r0, 16
bl sub_8162AA0
bl GetFrontierTrainerFrontSpriteId
_081932EC:
lsls r0, 24
lsrs r0, 24
@ -8621,7 +8621,7 @@ _0819335A:
ldr r0, =gSaveBlock2Ptr
ldr r0, [r0]
ldrb r0, [r0, 0x8]
bl sub_806F000
bl PlayerGenderToFrontTrainerPicId
lsls r0, 16
lsrs r0, 16
b _081933B0
@ -8642,7 +8642,7 @@ _08193388:
_081933A4:
lsls r0, r1, 16
lsrs r0, 16
bl sub_8162AA0
bl GetFrontierTrainerFrontSpriteId
lsls r0, 24
lsrs r0, 24
_081933B0:

View File

@ -20557,7 +20557,7 @@ _081A5306:
movs r1, 0
movs r2, 0x18
movs r3, 0xD
bl sub_8056A3C
bl HandleBattleWindow
b _081A553E
.pool
_081A531C:
@ -20582,29 +20582,29 @@ _081A5328:
ldr r4, =gDisplayedStringBattle
adds r0, r4, 0
movs r1, 0xF
bl sub_814F9EC
bl BattleHandleAddTextPrinter
ldr r0, =gText_Vs
movs r1, 0x10
bl sub_814F9EC
bl BattleHandleAddTextPrinter
ldr r0, =gText_OpponentMon1Name
bl BattleStringExpandPlaceholdersToDisplayedString
adds r0, r4, 0
movs r1, 0x11
bl sub_814F9EC
bl BattleHandleAddTextPrinter
ldr r0, =gText_Mind
movs r1, 0x12
bl sub_814F9EC
bl BattleHandleAddTextPrinter
ldr r0, =gText_Skill
movs r1, 0x13
bl sub_814F9EC
bl BattleHandleAddTextPrinter
ldr r0, =gText_Body
movs r1, 0x14
bl sub_814F9EC
bl BattleHandleAddTextPrinter
ldr r0, =gText_Judgement
bl BattleStringExpandPlaceholdersToDisplayedString
adds r0, r4, 0
movs r1, 0x15
bl sub_814F9EC
bl BattleHandleAddTextPrinter
b _081A553E
.pool
_081A53B4:
@ -20688,7 +20688,7 @@ _081A5464:
bl BattleStringExpandPlaceholdersToDisplayedString
ldr r0, =gDisplayedStringBattle
movs r1, 0x15
bl sub_814F9EC
bl BattleHandleAddTextPrinter
ldrb r0, [r5]
adds r0, 0x1
strb r0, [r5]
@ -20733,7 +20733,7 @@ _081A54D4:
movs r1, 0
movs r2, 0x18
movs r3, 0xD
bl sub_8056A3C
bl HandleBattleWindow
movs r0, 0
bl CopyBgTilemapBufferToVram
ldr r0, =gMPlay_BGM

View File

@ -110,7 +110,7 @@ _0817CA4C:
ldr r1, =gStringInfo
ldr r1, [r1]
ldrh r1, [r1]
bl sub_817F33C
bl GetBankMoveSlotId
lsls r0, 24
lsrs r0, 24
mov r10, r0
@ -2572,7 +2572,7 @@ _0817E122:
mov r1, r10
ldrb r0, [r1]
adds r1, r7, 0
bl sub_817F33C
bl GetBankMoveSlotId
lsls r0, 24
lsrs r6, r0, 24
cmp r6, 0x3
@ -4793,8 +4793,8 @@ _0817F324:
.pool
thumb_func_end sub_817F2A8
thumb_func_start sub_817F33C
sub_817F33C: @ 817F33C
thumb_func_start GetBankMoveSlotId
GetBankMoveSlotId: @ 817F33C
push {r4-r7,lr}
lsls r0, 24
lsrs r5, r0, 24
@ -4835,7 +4835,7 @@ _0817F388:
pop {r4-r7}
pop {r1}
bx r1
thumb_func_end sub_817F33C
thumb_func_end GetBankMoveSlotId
thumb_func_start sub_817F394
sub_817F394: @ 817F394
@ -4888,97 +4888,4 @@ _0817F3E6:
bx r0
thumb_func_end sub_817F394
thumb_func_start nullsub_69
nullsub_69: @ 817F3EC
bx lr
thumb_func_end nullsub_69
thumb_func_start sub_817F3F0
sub_817F3F0: @ 817F3F0
push {r4-r6,lr}
mov r6, r9
mov r5, r8
push {r5,r6}
sub sp, 0x4
mov r9, r0
mov r8, r1
adds r5, r2, 0
adds r4, r3, 0
lsls r5, 16
negs r5, r5
lsls r4, 16
negs r4, r4
lsrs r4, 16
mov r0, r8
lsls r0, 16
asrs r0, 16
mov r8, r0
asrs r5, 16
adds r1, r5, 0
bl Cos
adds r6, r0, 0
lsls r4, 16
asrs r4, 16
mov r0, r8
adds r1, r4, 0
bl Sin
subs r6, r0
lsls r6, 16
lsrs r6, 16
mov r0, r8
adds r1, r4, 0
bl Cos
adds r2, r0, 0
mov r0, r8
adds r1, r5, 0
str r2, [sp]
bl Sin
ldr r2, [sp]
adds r2, r0
negs r5, r5
negs r4, r4
lsls r6, 16
asrs r6, 16
lsls r5, 16
asrs r5, 16
adds r6, r5
mov r0, r9
strh r6, [r0, 0x24]
lsls r2, 16
asrs r2, 16
lsls r4, 16
asrs r4, 16
adds r2, r4
strh r2, [r0, 0x26]
add sp, 0x4
pop {r3,r4}
mov r8, r3
mov r9, r4
pop {r4-r6}
pop {r0}
bx r0
thumb_func_end sub_817F3F0
thumb_func_start GetSpeciesBackAnimId
GetSpeciesBackAnimId: @ 817F474
push {lr}
lsls r0, 16
lsrs r0, 16
ldr r1, =gUnknown_0860A8C8
adds r0, r1
ldrb r0, [r0]
cmp r0, 0
bne _0817F48C
movs r0, 0
b _0817F492
.pool
_0817F48C:
subs r0, 0x1
lsls r0, 24
lsrs r0, 24
_0817F492:
pop {r1}
bx r1
thumb_func_end GetSpeciesBackAnimId
.align 2, 0 @ Don't pad with nop.

View File

@ -1329,8 +1329,8 @@ _08162A8A:
.pool
thumb_func_end sub_81628A0
thumb_func_start sub_8162AA0
sub_8162AA0: @ 8162AA0
thumb_func_start GetFrontierTrainerFrontSpriteId
GetFrontierTrainerFrontSpriteId: @ 8162AA0
push {r4,r5,lr}
lsls r0, 16
lsrs r4, r0, 16
@ -1454,7 +1454,7 @@ _08162BCA:
pop {r1}
bx r1
.pool
thumb_func_end sub_8162AA0
thumb_func_end GetFrontierTrainerFrontSpriteId
thumb_func_start GetFrontierOpponentClass
GetFrontierOpponentClass: @ 8162BD8
@ -5843,8 +5843,8 @@ _08165206:
.pool
thumb_func_end sub_816515C
thumb_func_start sub_8165244
sub_8165244: @ 8165244
thumb_func_start GetEreaderTrainerFrontSpriteId
GetEreaderTrainerFrontSpriteId: @ 8165244
ldr r1, =gUnknown_0831F578
ldr r0, =gSaveBlock2Ptr
ldr r0, [r0]
@ -5855,7 +5855,7 @@ sub_8165244: @ 8165244
ldrb r0, [r0]
bx lr
.pool
thumb_func_end sub_8165244
thumb_func_end GetEreaderTrainerFrontSpriteId
thumb_func_start GetEreaderTrainerClassId
GetEreaderTrainerClassId: @ 8165264

View File

@ -4348,7 +4348,7 @@ sub_8148218: @ 8148218
ldr r0, =gSaveBlock2Ptr
ldr r0, [r0]
ldrb r0, [r0, 0x8]
bl sub_806F000
bl PlayerGenderToFrontTrainerPicId
lsls r0, 24
lsrs r0, 24
movs r1, 0x88

View File

@ -1415,7 +1415,7 @@ _080F64F2:
adds r0, r6, 0
adds r1, r5, 0
adds r2, r4, 0
bl sub_806E7CC
bl GetMonSpritePalStructFromOtIdPersonality
adds r4, r0, 0
bl LoadCompressedObjectPalette
adds r0, r6, 0

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -694,7 +694,7 @@ sub_80B5FE8: @ 80B5FE8
lsls r5, 16
lsrs r5, 16
adds r0, r6, 0
bl sub_806E7CC
bl GetMonSpritePalStructFromOtIdPersonality
mov r8, r0
lsls r4, 16
asrs r4, 16

View File

@ -47,14 +47,14 @@ sub_81AABB0: @ 81AABB0
lsls r0, 24
cmp r0, 0
bne _081AABCC
ldr r2, =sub_8059D50
ldr r2, =SetCB2ToReshowScreenAfterMenu2
movs r0, 0x1
movs r1, 0x5
bl GoToBagMenu
b _081AABD4
.pool
_081AABCC:
ldr r1, =sub_8059D50
ldr r1, =SetCB2ToReshowScreenAfterMenu2
movs r0, 0x1
bl sub_81C4F98
_081AABD4:
@ -5634,7 +5634,7 @@ DoWallyTutorialBagMenu: @ 81ADD70
movs r0, 0x4
movs r1, 0x1
bl AddBagItem
ldr r2, =sub_8059D50
ldr r2, =SetCB2ToReshowScreenAfterMenu2
movs r0, 0xA
movs r1, 0
bl GoToBagMenu

View File

@ -13861,7 +13861,7 @@ sub_81B7810: @ 81B7810
cmp r4, 0
beq _081B7860
bl sub_81B06F4
ldr r0, =gUnknown_030061E8
ldr r0, =gCB2_AfterEvolution
ldr r1, [r6]
str r1, [r0]
ldrb r3, [r6, 0x9]
@ -14307,7 +14307,7 @@ sub_81B7C74: @ 81B7C74
lsrs r5, r0, 24
movs r0, 0x5
bl PlaySE
ldr r2, =gUnknown_030061E8
ldr r2, =gCB2_AfterEvolution
ldr r1, =gUnknown_0203CEC8
ldr r0, [r1]
str r0, [r2]
@ -15908,7 +15908,7 @@ sub_81B89AC: @ 81B89AC
str r0, [sp]
ldr r0, =sub_81B1370
str r0, [sp, 0x4]
ldr r0, =sub_8059D40
ldr r0, =SetCB2ToReshowScreenAfterMenu
str r0, [sp, 0x8]
movs r0, 0x1
adds r2, r4, 0
@ -16828,7 +16828,7 @@ _081B9136:
thumb_func_start sub_81B9140
sub_81B9140: @ 81B9140
push {lr}
ldr r0, =sub_8059D40
ldr r0, =SetCB2ToReshowScreenAfterMenu
bl SetMainCallback2
pop {r0}
bx r0

View File

@ -2685,8 +2685,8 @@ _080769EA:
.pool
thumb_func_end sub_80769CC
thumb_func_start sub_80769F4
sub_80769F4: @ 80769F4
thumb_func_start DoHitAnimHealthboxEffect
DoHitAnimHealthboxEffect: @ 80769F4
push {r4,r5,lr}
adds r4, r0, 0
lsls r4, 24
@ -2714,7 +2714,7 @@ sub_80769F4: @ 80769F4
pop {r0}
bx r0
.pool
thumb_func_end sub_80769F4
thumb_func_end DoHitAnimHealthboxEffect
thumb_func_start oamc_804BEB4
oamc_804BEB4: @ 8076A38

View File

@ -348,7 +348,7 @@ _08179E84:
adds r1, r0, 0
adds r0, r5, 0
adds r2, r4, 0
bl sub_806E7CC
bl GetMonSpritePalStructFromOtIdPersonality
adds r4, r0, 0
bl LoadCompressedObjectPalette
ldrh r0, [r4, 0x4]

View File

@ -7923,7 +7923,7 @@ _080BF982:
ldr r0, =gSaveBlock2Ptr
ldr r0, [r0]
ldrb r0, [r0, 0x8]
bl sub_806F000
bl PlayerGenderToFrontTrainerPicId
lsls r0, 16
lsrs r0, 16
movs r1, 0x98

View File

@ -4,6 +4,100 @@
.syntax unified
.text
thumb_func_start nullsub_69
nullsub_69: @ 817F3EC
bx lr
thumb_func_end nullsub_69
thumb_func_start sub_817F3F0
sub_817F3F0: @ 817F3F0
push {r4-r6,lr}
mov r6, r9
mov r5, r8
push {r5,r6}
sub sp, 0x4
mov r9, r0
mov r8, r1
adds r5, r2, 0
adds r4, r3, 0
lsls r5, 16
negs r5, r5
lsls r4, 16
negs r4, r4
lsrs r4, 16
mov r0, r8
lsls r0, 16
asrs r0, 16
mov r8, r0
asrs r5, 16
adds r1, r5, 0
bl Cos
adds r6, r0, 0
lsls r4, 16
asrs r4, 16
mov r0, r8
adds r1, r4, 0
bl Sin
subs r6, r0
lsls r6, 16
lsrs r6, 16
mov r0, r8
adds r1, r4, 0
bl Cos
adds r2, r0, 0
mov r0, r8
adds r1, r5, 0
str r2, [sp]
bl Sin
ldr r2, [sp]
adds r2, r0
negs r5, r5
negs r4, r4
lsls r6, 16
asrs r6, 16
lsls r5, 16
asrs r5, 16
adds r6, r5
mov r0, r9
strh r6, [r0, 0x24]
lsls r2, 16
asrs r2, 16
lsls r4, 16
asrs r4, 16
adds r2, r4
strh r2, [r0, 0x26]
add sp, 0x4
pop {r3,r4}
mov r8, r3
mov r9, r4
pop {r4-r6}
pop {r0}
bx r0
thumb_func_end sub_817F3F0
thumb_func_start GetSpeciesBackAnimId
GetSpeciesBackAnimId: @ 817F474
push {lr}
lsls r0, 16
lsrs r0, 16
ldr r1, =gUnknown_0860A8C8
adds r0, r1
ldrb r0, [r0]
cmp r0, 0
bne _0817F48C
movs r0, 0
b _0817F492
.pool
_0817F48C:
subs r0, 0x1
lsls r0, 24
lsrs r0, 24
_0817F492:
pop {r1}
bx r1
thumb_func_end GetSpeciesBackAnimId
thumb_func_start sub_817F498
sub_817F498: @ 817F498

View File

@ -1087,7 +1087,7 @@ _081C4750:
ldrh r0, [r5, 0x2]
ldr r1, [r5, 0x48]
ldr r2, [r5, 0xC]
bl sub_806E7CC
bl GetMonSpritePalStructFromOtIdPersonality
adds r4, r0, 0
bl LoadCompressedObjectPalette
ldrh r0, [r4, 0x4]
@ -2035,7 +2035,7 @@ sub_81C4EFC: @ 81C4EFC
thumb_func_start sub_81C4F10
sub_81C4F10: @ 81C4F10
push {lr}
ldr r1, =sub_8059D50
ldr r1, =SetCB2ToReshowScreenAfterMenu2
movs r0, 0x1
bl sub_81C4F98
pop {r0}

View File

@ -312,8 +312,8 @@ _08185046:
.pool
thumb_func_end RecordedBattle_ClearBankAction
thumb_func_start sub_8185054
sub_8185054: @ 8185054
thumb_func_start RecordedBattle_ReadBankAction
RecordedBattle_ReadBankAction: @ 8185054
push {r4,lr}
sub sp, 0x4
lsls r0, 24
@ -364,7 +364,7 @@ _081850C6:
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_8185054
thumb_func_end RecordedBattle_ReadBankAction
thumb_func_start sub_81850D0
sub_81850D0: @ 81850D0
@ -2274,7 +2274,7 @@ _0818611E:
b _081863EE
_08186142:
adds r0, r5, 0
bl sub_8185054
bl RecordedBattle_ReadBankAction
movs r5, 0
mov r0, sp
adds r0, 0x4
@ -2326,7 +2326,7 @@ _0818617E:
_081861A6:
ldr r3, [sp, 0x4C]
lsrs r0, r3, 24
bl sub_8185054
bl RecordedBattle_ReadBankAction
strb r0, [r4]
ldrb r0, [r4]
lsls r0, 1

View File

@ -547,7 +547,7 @@ _081358D4:
thumb_func_start sub_81358F4
sub_81358F4: @ 81358F4
push {lr}
ldr r1, =sub_8059D50
ldr r1, =SetCB2ToReshowScreenAfterMenu2
movs r0, 0x1
bl sub_81357FC
pop {r0}

View File

@ -732,7 +732,7 @@ _080F8DD8:
adds r0, r6, 0
mov r1, r8
adds r2, r5, 0
bl sub_806E7CC
bl GetMonSpritePalStructFromOtIdPersonality
adds r4, r0, 0
bl LoadCompressedObjectPalette
adds r0, r6, 0

View File

@ -10590,7 +10590,7 @@ _0807CEDC:
ldrb r0, [r0]
movs r1, 0
bl sub_807B4D0
ldr r1, =gUnknown_030061E8
ldr r1, =gCB2_AfterEvolution
ldr r0, =sub_807B60C
str r0, [r1]
ldr r7, =gUnknown_02032298
@ -10615,7 +10615,7 @@ _0807CEDC:
adds r1, 0x8F
ldrb r2, [r1]
adds r1, r4, 0
bl sub_813E1D4
bl TradeEvolutionScene
b _0807CF48
.pool
_0807CF38:
@ -12695,7 +12695,7 @@ _0807E328:
ldrb r0, [r0]
movs r1, 0
bl sub_807B4D0
ldr r1, =gUnknown_030061E8
ldr r1, =gCB2_AfterEvolution
ldr r0, =sub_807B60C
str r0, [r1]
ldr r7, =gUnknown_02032298
@ -12720,7 +12720,7 @@ _0807E328:
adds r1, 0x8F
ldrb r2, [r1]
adds r1, r4, 0
bl sub_813E1D4
bl TradeEvolutionScene
b _0807E394
.pool
_0807E384:
@ -12810,7 +12810,7 @@ _0807E434:
b _0807E4B2
.pool
_0807E444:
ldr r0, =gUnknown_030061E8
ldr r0, =gCB2_AfterEvolution
ldr r1, =sub_807EB50
mov r8, r1
str r1, [r0]
@ -12836,7 +12836,7 @@ _0807E444:
adds r1, 0x8F
ldrb r2, [r1]
adds r1, r4, 0
bl sub_813E1D4
bl TradeEvolutionScene
b _0807E4AE
.pool
_0807E494:

View File

@ -3,7 +3,168 @@
.section .rodata
.align 2
gUnknown_085CE004:: @ 85CE004
.2byte 0x0000, 0x0004, 0x0010, 0x0004
.2byte 0x0020, 0x0004, 0x0030, 0x0004
.2byte 0x0040, 0x0004, 0xffff, 0x0000
.align 2
gUnknown_085CE01C:: @ 85CE01C
.4byte gUnknown_085CE004
.align 2
gUnknown_085CE020:: @ 85CE020
spr_template 0x2799, 0x2799, gUnknown_08524A34, gUnknown_085CE01C, NULL, gDummySpriteAffineAnimTable, sub_80A77C8
.align 2
spr_template 0x2720, 0x2720, gUnknown_08524934, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_815A0D4
.align 2
spr_template 0x2721, 0x2721, gUnknown_08524904, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_80A78AC
.align 2
gUnknown_085CE068:: @ 85CE068
.2byte 0x0000, 0x0028, 0x0010, 0x0008
.2byte 0x0020, 0x0028, 0xffff, 0x0000
.align 2
gUnknown_085CE078:: @ 85CE078
.4byte gUnknown_085CE068
.align 2
gUnknown_085CE07C:: @ 85CE07C
spr_template 0x27ce, 0x27ce, gUnknown_08524914, gUnknown_085CE078, NULL, gDummySpriteAffineAnimTable, sub_80A77C8
.align 2
spr_template 0x27cf, 0x27cf, gUnknown_08524A3C, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_815A1B0
.align 2
spr_template 0x27cd, 0x27cd, gUnknown_08524974, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_815A254
.align 2
gUnknown_085CE0C4:: @ 85CE0C4
.2byte 0x0180, 0x0180, 0x0000, 0x0000
.2byte 0xffe0, 0x0018, 0x0500, 0x0000
.2byte 0x0018, 0xffe0, 0x0500, 0x0000
.2byte 0x7ffe, 0x0001, 0x0000, 0x0000
.align 2
gUnknown_085CE0E4:: @ 85CE0E4
.2byte 0x0030, 0x0030, 0x0000, 0x0000
.2byte 0x0020, 0x0020, 0x0600, 0x0000
.2byte 0x7fff, 0x0000, 0x0000, 0x0000
.align 2
gUnknown_085CE0FC:: @ 85CE0FC
.4byte gUnknown_085CE0C4
.4byte gUnknown_085CE0E4
.align 2
gUnknown_085CE104:: @ 85CE104
spr_template 0x27cb, 0x27cb, gUnknown_08524AFC, gDummySpriteAnimTable, NULL, gUnknown_085CE0FC, sub_815A2F0
.align 2
spr_template 0x27a8, 0x27a8, gUnknown_0852490C, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_815A6C4
.align 2
gUnknown_085CE134:: @ 85CE134
.2byte 0x0000, 0x0003, 0x0010, 0x0003
.2byte 0x0020, 0x0003, 0x0030, 0x0003
.2byte 0x0040, 0x0003, 0xffff, 0x0000
.align 2
gUnknown_085CE14C:: @ 85CE14C
.4byte gUnknown_085CE134
.align 2
gUnknown_085CE150:: @ 85CE150
spr_template 0x272b, 0x272b, gUnknown_08524914, gUnknown_085CE14C, NULL, gDummySpriteAffineAnimTable, sub_815A7B0
.align 2
gUnknown_085CE168:: @ 85CE168
.2byte 0x0000, 0x0003, 0xffff, 0x0000
.align 2
gUnknown_085CE170:: @ 85CE170
.4byte gUnknown_085CE168
.align 2
gUnknown_085CE174:: @ 85CE174
.2byte 0xfff9, 0xfff9, 0x10fd, 0x0000
.2byte 0x0007, 0x0007, 0x1003, 0x0000
.2byte 0x7ffe, 0x0000, 0x0000, 0x0000
.align 2
gUnknown_085CE18C:: @ 85CE18C
.4byte gUnknown_085CE174
.align 2
gUnknown_085CE190:: @ 85CE190
spr_template 0x27f4, 0x27f4, gUnknown_08524974, gUnknown_085CE170, NULL, gUnknown_085CE18C, sub_815A7EC
.align 2
gUnknown_085CE1A8:: @ 85CE1A8
.2byte 0x0000, 0x0008, 0x0010, 0x0010, 0x0020, 0x0004, 0x0030, 0x0004, 0xffff, 0x0000
.align 2
gUnknown_085CE1BC:: @ 85CE1BC
.4byte gUnknown_085CE1A8
.align 2
gUnknown_085CE1C0:: @ 85CE1C0
.2byte 0x0200, 0x0200, 0x0000, 0x0000
.2byte 0xffe0, 0xffe0, 0x0800, 0x0000
.2byte 0x7fff, 0x0000, 0x0000, 0x0000
.align 2
gUnknown_085CE1D8:: @ 85CE1D8
.4byte gUnknown_085CE1C0
.align 2
gUnknown_085CE1DC:: @ 85CE1DC
spr_template 0x27d0, 0x27d0, gUnknown_085249D4, gUnknown_085CE1BC, NULL, gUnknown_085CE1D8, sub_815A8AC
.align 2
gUnknown_085CE1F4:: @ 85CE1F4
.2byte 0x0000, 0x0180, 0x0000, 0x0000
.2byte 0x0010, 0x0000, 0x1400, 0x0000
.2byte 0x7fff, 0x0000, 0x0000, 0x0000
.align 2
gUnknown_085CE20C:: @ 85CE20C
.2byte 0x0140, 0x0180, 0x0000, 0x0000
.2byte 0xfff0, 0x0000, 0x1300, 0x0000
.2byte 0x7fff, 0x0000, 0x0000, 0x0000
.align 2
gUnknown_085CE224:: @ 85CE224
.4byte gUnknown_085CE1F4
.4byte gUnknown_085CE20C
.align 2
gUnknown_085CE22C:: @ 85CE22C
spr_template 0x27f3, 0x27f3, gUnknown_085249DC, gDummySpriteAnimTable, NULL, gUnknown_085CE224, sub_815A934
.align 2
spr_template 0x2807, 0x2807, gUnknown_08524914, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_815AAA4
.align 2
spr_template 0x2807, 0x2807, gUnknown_08524914, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_815ABD0
.align 2
gUnknown_085CE274:: @ 85CE274
.2byte 0x0000, 0x0002, 0x0008, 0x0002
.2byte 0x0010, 0x0002, 0xfffe, 0x0000
.align 2
gUnknown_085CE284:: @ 85CE284
.4byte gUnknown_085CE274
.align 2
gUnknown_085CE288:: @ 85CE288
spr_template 0x27f5, 0x27f5, gUnknown_08524934, gUnknown_085CE284, NULL, gDummySpriteAffineAnimTable, sub_815ACD0
gUnknown_085CE2A0:: @ 85CE2A0
.incbin "baserom.gba", 0x5ce2a0, 0xb0

View File

@ -1,64 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.align 2
gLinkOpponentBufferCommands:: @ 831C7B4
.4byte dp01t_00_2_getattr
.4byte sub_8065900
.4byte sub_806590C
.4byte sub_8066284
.4byte sub_80662F8
.4byte sub_8066448
.4byte sub_8066624
.4byte sub_8066748
.4byte sub_8066A58
.4byte sub_8066B94
.4byte sub_8066C40
.4byte sub_8066CEC
.4byte sub_8066CF8
.4byte sub_8066D04
.4byte sub_8066D10
.4byte sub_8066D1C
.4byte sub_8066FF4
.4byte sub_806704C
.4byte sub_8067058
.4byte sub_8067064
.4byte sub_8067070
.4byte sub_806707C
.4byte sub_8067088
.4byte sub_8067094
.4byte sub_80670A0
.4byte sub_8067190
.4byte sub_806719C
.4byte sub_8067214
.4byte sub_806727C
.4byte sub_8067288
.4byte sub_8067294
.4byte sub_80672A0
.4byte sub_80672AC
.4byte sub_80672B8
.4byte sub_80672C4
.4byte sub_80672D0
.4byte sub_80672DC
.4byte sub_80672E8
.4byte sub_8067304
.4byte sub_806733C
.4byte sub_8067354
.4byte sub_806737C
.4byte sub_80673EC
.4byte sub_80673F8
.4byte sub_806743C
.4byte sub_8067498
.4byte sub_80674D4
.4byte sub_8067508
.4byte sub_8067718
.4byte sub_8067874
.4byte sub_80678C4
.4byte sub_80678D0
.4byte sub_8067930
.4byte sub_80679A4
.4byte sub_80679C4
.4byte sub_80679D0
.4byte nullsub_92

View File

@ -1,65 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.align 2
gLinkPartnerBufferCommands:: @ 85C9A94
.4byte dp01t_00_4_getattr
.4byte sub_814C038
.4byte sub_814C044
.4byte sub_814CA98
.4byte sub_814CB0C
.4byte sub_814CC28
.4byte sub_814CE14
.4byte sub_814CF30
.4byte sub_814D0E4
.4byte sub_814D0F0
.4byte sub_814D19C
.4byte sub_814D288
.4byte sub_814D294
.4byte sub_814D2A0
.4byte sub_814D2AC
.4byte sub_814D2B8
.4byte sub_814D590
.4byte sub_814D5E8
.4byte sub_814D5F4
.4byte sub_814D600
.4byte sub_814D60C
.4byte sub_814D618
.4byte sub_814D624
.4byte sub_814D630
.4byte sub_814D63C
.4byte sub_814D72C
.4byte sub_814D738
.4byte sub_814D7B0
.4byte sub_814D818
.4byte sub_814D824
.4byte sub_814D830
.4byte sub_814D83C
.4byte sub_814D848
.4byte sub_814D854
.4byte sub_814D860
.4byte sub_814D86C
.4byte sub_814D878
.4byte sub_814D884
.4byte sub_814D8A0
.4byte sub_814D8D8
.4byte sub_814D8F0
.4byte dp01t_29_4_blink
.4byte sub_814D988
.4byte sub_814D994
.4byte sub_814D9D8
.4byte sub_814DA34
.4byte dp01t_2E_4_battle_intro
.4byte sub_814DAA8
.4byte sub_814DDD8
.4byte sub_814DEE4
.4byte sub_814DF34
.4byte sub_814DF40
.4byte sub_814DFA0
.4byte sub_814E014
.4byte sub_814E034
.4byte sub_814E040
.4byte nullsub_113

View File

@ -1,67 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.align 2
gOpponentBufferCommands:: @ 831C6C8
.4byte dp01t_00_7_getattr
.4byte dp01t_01_2_read_pokmon_data_slice
.4byte dp01t_02_7_setattr
.4byte sub_80611B0
.4byte sub_8061224
.4byte sub_806137C
.4byte sub_806156C
.4byte sub_8061690
.4byte sub_80618D8
.4byte sub_8061AF0
.4byte sub_8061B9C
.4byte sub_8061C48
.4byte sub_8061C54
.4byte sub_8061C60
.4byte sub_8061C6C
.4byte sub_8061C78
.4byte sub_8061F34
.4byte sub_8061F90
.4byte sub_8061F9C
.4byte sub_8061FAC
.4byte sub_8061FB8
.4byte sub_806215C
.4byte sub_8062188
.4byte sub_8062288
.4byte sub_8062294
.4byte sub_8062384
.4byte sub_8062390
.4byte sub_8062408
.4byte sub_8062470
.4byte sub_806247C
.4byte sub_8062488
.4byte sub_8062494
.4byte sub_80624A0
.4byte sub_80624AC
.4byte sub_80624B8
.4byte sub_80624C4
.4byte sub_80624D0
.4byte sub_80624DC
.4byte sub_80624F8
.4byte sub_8062530
.4byte sub_8062548
.4byte dp01t_29_7_blink
.4byte sub_80625E0
.4byte sub_80625EC
.4byte sub_8062630
.4byte sub_806268C
.4byte dp01t_2E_7_battle_intro
.4byte sub_80626FC
.4byte dp01t_30_7_0803D67C
.4byte sub_8062A74
.4byte sub_8062AC4
.4byte sub_8062AD0
.4byte dp01t_34_7_move_anim_start_t3
.4byte sub_8062B98
.4byte sub_8062BA4
.4byte sub_8062BB0
.4byte nullsub_91
.align 2
.byte 0xB0, 0xB0, 0xC8, 0x98, 0x28, 0x28, 0x28, 0x20

View File

@ -1,69 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.align 2
gPlayerBufferCommands:: @ 831C514
.4byte dp01t_00_1_getattr
.4byte sub_805A614
.4byte dp01t_02_1_setattr
.4byte sub_805B0F0
.4byte sub_805B164
.4byte sub_805B1CC
.4byte sub_805B3D4
.4byte sub_805B4F0
.4byte dp01t_08_1_8032428
.4byte sub_805B9F8
.4byte sub_805BAB8
.4byte sub_805BBA4
.4byte sub_805BBC4
.4byte sub_805BC18
.4byte sub_805BC78
.4byte dp01t_0F_1_move_anim
.4byte sub_805BF80
.4byte dp01t_11_1_message_for_player_only
.4byte dp01t_12_6_battle_menu
.4byte sub_805C0B0
.4byte dp01t_14_5_move_menu_pokedude
.4byte sub_805C248
.4byte sub_805C2AC
.4byte sub_805C3EC
.4byte sub_805C410
.4byte sub_805C528
.4byte sub_805C5C4
.4byte sub_805C63C
.4byte sub_805C6A4
.4byte sub_805C710
.4byte sub_805C71C
.4byte sub_805C7D0
.4byte sub_805C800
.4byte sub_805C80C
.4byte sub_805C820
.4byte sub_805C834
.4byte sub_805C848
.4byte sub_805C85C
.4byte sub_805C878
.4byte sub_805C8B0
.4byte sub_805C8C8
.4byte dp01t_29_1_blink
.4byte sub_805C960
.4byte sub_805C96C
.4byte sub_805C9B0
.4byte sub_805CA0C
.4byte dp01t_2E_1_battle_intro
.4byte dp01t_2F_1_pokemon_enter
.4byte sub_805CD74
.4byte sub_805CE80
.4byte sub_805CED0
.4byte dp01t_33_1_enemy_move
.4byte sub_805CF54
.4byte dp01t_35_1_link_standby_message_and_free_vram
.4byte sub_805D02C
.4byte sub_805D094
.4byte nullsub_22
.align 2
gUnknown_0831C5F8:: @ 831C5F8
.byte 0x00, 0x02, 0x03, 0x01, 0x48, 0x48, 0x20, 0x5a
.byte 0x50, 0x50, 0x50, 0x58

View File

@ -1,71 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.align 2
gPlayerPartnerBufferCommands:: @ 8617170
.4byte dp01t_00_3_getattr
.4byte sub_81BC484
.4byte sub_81BC490
.4byte sub_81BCEE4
.4byte sub_81BCF58
.4byte sub_81BD074
.4byte sub_81BD260
.4byte sub_81BD37C
.4byte sub_81BD5BC
.4byte sub_81BD5C8
.4byte sub_81BD674
.4byte sub_81BD760
.4byte sub_81BD76C
.4byte sub_81BD778
.4byte sub_81BD784
.4byte sub_81BD790
.4byte sub_81BDA4C
.4byte sub_81BDAA0
.4byte sub_81BDAAC
.4byte sub_81BDABC
.4byte sub_81BDAC8
.4byte sub_81BDB70
.4byte sub_81BDB7C
.4byte sub_81BDC04
.4byte sub_81BDC10
.4byte sub_81BDD00
.4byte sub_81BDD9C
.4byte sub_81BDE14
.4byte sub_81BDE7C
.4byte sub_81BDE88
.4byte sub_81BDE94
.4byte sub_81BDEA0
.4byte sub_81BDEAC
.4byte sub_81BDEB8
.4byte sub_81BDEC4
.4byte sub_81BDED0
.4byte sub_81BDEDC
.4byte sub_81BDEE8
.4byte sub_81BDF04
.4byte sub_81BDF3C
.4byte sub_81BDF54
.4byte dp01t_29_3_blink
.4byte sub_81BDFEC
.4byte sub_81BDFF8
.4byte sub_81BE03C
.4byte sub_81BE098
.4byte dp01t_2E_3_battle_intro
.4byte sub_81BE10C
.4byte dp01t_30_3_80EB11C
.4byte sub_81BE4E0
.4byte sub_81BE530
.4byte sub_81BE53C
.4byte sub_81BE59C
.4byte sub_81BE604
.4byte sub_81BE610
.4byte sub_81BE61C
.4byte nullsub_128
.align 2
@ apparently unused data
.byte 0x83, 0x4d, 0xf3, 0x5f, 0x6f, 0x4f, 0xeb, 0x3e
.byte 0x67, 0x2e, 0x10, 0x46, 0x8c, 0x3d, 0x28, 0x35
.byte 0xc5, 0x2c, 0x15, 0x7f, 0xb5, 0x56, 0x9d, 0x53
.byte 0x3b, 0x43, 0xda, 0x36, 0x79, 0x2a, 0x0e, 0x53

View File

@ -1,65 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.align 2
gRecordedOpponentBufferCommands:: @ 860AE90
.4byte sub_8187224
.4byte sub_8187A44
.4byte sub_8187A50
.4byte sub_81883C8
.4byte sub_818843C
.4byte sub_818858C
.4byte sub_8188768
.4byte sub_818888C
.4byte sub_8188A40
.4byte sub_8188A4C
.4byte sub_8188AF8
.4byte sub_8188BA4
.4byte sub_8188BB0
.4byte sub_8188BBC
.4byte sub_8188BC8
.4byte sub_8188BD4
.4byte sub_8188E90
.4byte sub_8188EE4
.4byte sub_8188EF0
.4byte sub_8188F14
.4byte sub_8188F20
.4byte sub_8188F7C
.4byte sub_8188F88
.4byte sub_8188FC4
.4byte sub_8188FD0
.4byte sub_81890C0
.4byte sub_81890CC
.4byte sub_8189144
.4byte sub_81891AC
.4byte sub_81891B8
.4byte sub_81891C4
.4byte sub_81891D0
.4byte sub_81891DC
.4byte sub_81891E8
.4byte sub_81891F4
.4byte sub_8189200
.4byte sub_818920C
.4byte sub_8189218
.4byte sub_8189234
.4byte sub_818926C
.4byte sub_8189284
.4byte sub_81892AC
.4byte sub_818931C
.4byte sub_8189328
.4byte sub_818936C
.4byte sub_81893C8
.4byte sub_8189404
.4byte sub_8189438
.4byte sub_8189648
.4byte sub_81897A4
.4byte sub_81897F4
.4byte sub_8189800
.4byte sub_8189860
.4byte sub_81898C8
.4byte sub_81898D4
.4byte sub_81898E0
.4byte nullsub_119

View File

@ -1,64 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.align 2
gRecordedPlayerBufferCommands:: @ 860AF74
.4byte sub_818A5EC
.4byte sub_818AE0C
.4byte sub_818AE18
.4byte sub_818B86C
.4byte sub_818B8E0
.4byte sub_818B9FC
.4byte sub_818BBE8
.4byte sub_818BD04
.4byte sub_818BFAC
.4byte sub_818BFB8
.4byte sub_818C064
.4byte sub_818C150
.4byte sub_818C15C
.4byte sub_818C168
.4byte sub_818C174
.4byte sub_818C180
.4byte sub_818C43C
.4byte sub_818C490
.4byte sub_818C4D8
.4byte sub_818C52C
.4byte sub_818C538
.4byte sub_818C594
.4byte sub_818C5A0
.4byte sub_818C5DC
.4byte sub_818C5E8
.4byte sub_818C6E8
.4byte sub_818C6F4
.4byte sub_818C76C
.4byte sub_818C7D4
.4byte sub_818C7E0
.4byte sub_818C7EC
.4byte sub_818C7F8
.4byte sub_818C804
.4byte sub_818C810
.4byte sub_818C81C
.4byte sub_818C828
.4byte sub_818C834
.4byte sub_818C840
.4byte sub_818C85C
.4byte sub_818C894
.4byte sub_818C8AC
.4byte sub_818C8D4
.4byte sub_818C944
.4byte sub_818C950
.4byte sub_818C994
.4byte sub_818C9F0
.4byte dp01t_2E_2_battle_intro
.4byte sub_818CA64
.4byte sub_818CD30
.4byte sub_818CE3C
.4byte sub_818CE8C
.4byte sub_818CE98
.4byte sub_818CEF8
.4byte sub_818CF60
.4byte sub_818CF6C
.4byte sub_818CF78
.4byte nullsub_121

View File

@ -1,228 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.align 2
gSafariBufferCommands:: @ 85CDF20
.4byte sub_81597AC
.4byte sub_81597B8
.4byte sub_81597C4
.4byte sub_81597D0
.4byte sub_81597DC
.4byte sub_81597E8
.4byte sub_81597F4
.4byte sub_8159800
.4byte sub_81598E0
.4byte sub_81598EC
.4byte sub_81598F8
.4byte sub_8159904
.4byte sub_8159910
.4byte sub_8159964
.4byte sub_81599C4
.4byte sub_81599D0
.4byte dp01t_10_6_message
.4byte dp01t_11_6_message_for_player_only
.4byte sub_8159A94
.4byte sub_8159AFC
.4byte sub_8159B08
.4byte sub_8159B14
.4byte sub_8159B54
.4byte sub_8159B60
.4byte sub_8159B6C
.4byte sub_8159B78
.4byte sub_8159B84
.4byte sub_8159BC0
.4byte sub_8159BCC
.4byte sub_8159BD8
.4byte sub_8159BE4
.4byte sub_8159BF0
.4byte sub_8159BFC
.4byte sub_8159C08
.4byte sub_8159C14
.4byte sub_8159C20
.4byte sub_8159C2C
.4byte sub_8159C38
.4byte sub_8159C44
.4byte sub_8159C50
.4byte sub_8159C5C
.4byte sub_8159C68
.4byte sub_8159C74
.4byte sub_8159C80
.4byte dp01t_34_6_move_anim_start_t3
.4byte sub_8159D20
.4byte dp01t_2E_6_battle_intro
.4byte sub_8159D90
.4byte sub_8159DEC
.4byte sub_8159DF8
.4byte sub_8159E04
.4byte sub_8159E10
.4byte sub_8159E1C
.4byte sub_8159E78
.4byte sub_8159E84
.4byte sub_8159E90
.4byte nullsub_115
.align 2
gUnknown_085CE004:: @ 85CE004
.2byte 0x0000, 0x0004, 0x0010, 0x0004
.2byte 0x0020, 0x0004, 0x0030, 0x0004
.2byte 0x0040, 0x0004, 0xffff, 0x0000
.align 2
gUnknown_085CE01C:: @ 85CE01C
.4byte gUnknown_085CE004
.align 2
gUnknown_085CE020:: @ 85CE020
spr_template 0x2799, 0x2799, gUnknown_08524A34, gUnknown_085CE01C, NULL, gDummySpriteAffineAnimTable, sub_80A77C8
.align 2
spr_template 0x2720, 0x2720, gUnknown_08524934, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_815A0D4
.align 2
spr_template 0x2721, 0x2721, gUnknown_08524904, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_80A78AC
.align 2
gUnknown_085CE068:: @ 85CE068
.2byte 0x0000, 0x0028, 0x0010, 0x0008
.2byte 0x0020, 0x0028, 0xffff, 0x0000
.align 2
gUnknown_085CE078:: @ 85CE078
.4byte gUnknown_085CE068
.align 2
gUnknown_085CE07C:: @ 85CE07C
spr_template 0x27ce, 0x27ce, gUnknown_08524914, gUnknown_085CE078, NULL, gDummySpriteAffineAnimTable, sub_80A77C8
.align 2
spr_template 0x27cf, 0x27cf, gUnknown_08524A3C, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_815A1B0
.align 2
spr_template 0x27cd, 0x27cd, gUnknown_08524974, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_815A254
.align 2
gUnknown_085CE0C4:: @ 85CE0C4
.2byte 0x0180, 0x0180, 0x0000, 0x0000
.2byte 0xffe0, 0x0018, 0x0500, 0x0000
.2byte 0x0018, 0xffe0, 0x0500, 0x0000
.2byte 0x7ffe, 0x0001, 0x0000, 0x0000
.align 2
gUnknown_085CE0E4:: @ 85CE0E4
.2byte 0x0030, 0x0030, 0x0000, 0x0000
.2byte 0x0020, 0x0020, 0x0600, 0x0000
.2byte 0x7fff, 0x0000, 0x0000, 0x0000
.align 2
gUnknown_085CE0FC:: @ 85CE0FC
.4byte gUnknown_085CE0C4
.4byte gUnknown_085CE0E4
.align 2
gUnknown_085CE104:: @ 85CE104
spr_template 0x27cb, 0x27cb, gUnknown_08524AFC, gDummySpriteAnimTable, NULL, gUnknown_085CE0FC, sub_815A2F0
.align 2
spr_template 0x27a8, 0x27a8, gUnknown_0852490C, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_815A6C4
.align 2
gUnknown_085CE134:: @ 85CE134
.2byte 0x0000, 0x0003, 0x0010, 0x0003
.2byte 0x0020, 0x0003, 0x0030, 0x0003
.2byte 0x0040, 0x0003, 0xffff, 0x0000
.align 2
gUnknown_085CE14C:: @ 85CE14C
.4byte gUnknown_085CE134
.align 2
gUnknown_085CE150:: @ 85CE150
spr_template 0x272b, 0x272b, gUnknown_08524914, gUnknown_085CE14C, NULL, gDummySpriteAffineAnimTable, sub_815A7B0
.align 2
gUnknown_085CE168:: @ 85CE168
.2byte 0x0000, 0x0003, 0xffff, 0x0000
.align 2
gUnknown_085CE170:: @ 85CE170
.4byte gUnknown_085CE168
.align 2
gUnknown_085CE174:: @ 85CE174
.2byte 0xfff9, 0xfff9, 0x10fd, 0x0000
.2byte 0x0007, 0x0007, 0x1003, 0x0000
.2byte 0x7ffe, 0x0000, 0x0000, 0x0000
.align 2
gUnknown_085CE18C:: @ 85CE18C
.4byte gUnknown_085CE174
.align 2
gUnknown_085CE190:: @ 85CE190
spr_template 0x27f4, 0x27f4, gUnknown_08524974, gUnknown_085CE170, NULL, gUnknown_085CE18C, sub_815A7EC
.align 2
gUnknown_085CE1A8:: @ 85CE1A8
.2byte 0x0000, 0x0008, 0x0010, 0x0010, 0x0020, 0x0004, 0x0030, 0x0004, 0xffff, 0x0000
.align 2
gUnknown_085CE1BC:: @ 85CE1BC
.4byte gUnknown_085CE1A8
.align 2
gUnknown_085CE1C0:: @ 85CE1C0
.2byte 0x0200, 0x0200, 0x0000, 0x0000
.2byte 0xffe0, 0xffe0, 0x0800, 0x0000
.2byte 0x7fff, 0x0000, 0x0000, 0x0000
.align 2
gUnknown_085CE1D8:: @ 85CE1D8
.4byte gUnknown_085CE1C0
.align 2
gUnknown_085CE1DC:: @ 85CE1DC
spr_template 0x27d0, 0x27d0, gUnknown_085249D4, gUnknown_085CE1BC, NULL, gUnknown_085CE1D8, sub_815A8AC
.align 2
gUnknown_085CE1F4:: @ 85CE1F4
.2byte 0x0000, 0x0180, 0x0000, 0x0000
.2byte 0x0010, 0x0000, 0x1400, 0x0000
.2byte 0x7fff, 0x0000, 0x0000, 0x0000
.align 2
gUnknown_085CE20C:: @ 85CE20C
.2byte 0x0140, 0x0180, 0x0000, 0x0000
.2byte 0xfff0, 0x0000, 0x1300, 0x0000
.2byte 0x7fff, 0x0000, 0x0000, 0x0000
.align 2
gUnknown_085CE224:: @ 85CE224
.4byte gUnknown_085CE1F4
.4byte gUnknown_085CE20C
.align 2
gUnknown_085CE22C:: @ 85CE22C
spr_template 0x27f3, 0x27f3, gUnknown_085249DC, gDummySpriteAnimTable, NULL, gUnknown_085CE224, sub_815A934
.align 2
spr_template 0x2807, 0x2807, gUnknown_08524914, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_815AAA4
.align 2
spr_template 0x2807, 0x2807, gUnknown_08524914, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_815ABD0
.align 2
gUnknown_085CE274:: @ 85CE274
.2byte 0x0000, 0x0002, 0x0008, 0x0002
.2byte 0x0010, 0x0002, 0xfffe, 0x0000
.align 2
gUnknown_085CE284:: @ 85CE284
.4byte gUnknown_085CE274
.align 2
gUnknown_085CE288:: @ 85CE288
spr_template 0x27f5, 0x27f5, gUnknown_08524934, gUnknown_085CE284, NULL, gDummySpriteAffineAnimTable, sub_815ACD0

View File

@ -1,64 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.align 2
gWallyBufferCommands:: @ 85DFDC0
.4byte dp01t_00_5_getattr
.4byte sub_81693C0
.4byte sub_81693CC
.4byte sub_8169E20
.4byte sub_8169E2C
.4byte sub_8169E38
.4byte sub_8169E44
.4byte sub_8169EC8
.4byte dp01t_07_6_
.4byte sub_816A060
.4byte sub_816A06C
.4byte sub_816A078
.4byte sub_816A084
.4byte sub_816A0D8
.4byte sub_816A138
.4byte sub_816A144
.4byte sub_816A3B8
.4byte dp01t_11_5_message_for_player_only
.4byte dp01t_12_1_battle_menu
.4byte sub_816A4D8
.4byte sub_816A4E4
.4byte sub_816A57C
.4byte sub_816A5BC
.4byte sub_816A5C8
.4byte sub_816A5D4
.4byte sub_816A6D4
.4byte sub_816A6E0
.4byte sub_816A6EC
.4byte sub_816A6F8
.4byte sub_816A704
.4byte sub_816A710
.4byte sub_816A71C
.4byte sub_816A728
.4byte sub_816A734
.4byte sub_816A740
.4byte sub_816A74C
.4byte sub_816A758
.4byte sub_816A764
.4byte sub_816A770
.4byte sub_816A77C
.4byte sub_816A788
.4byte sub_816A794
.4byte sub_816A804
.4byte sub_816A810
.4byte sub_816A840
.4byte sub_816A89C
.4byte dp01t_2E_5_battle_intro
.4byte sub_816A90C
.4byte sub_816AC78
.4byte sub_816ACFC
.4byte sub_816AD08
.4byte sub_816AD14
.4byte sub_816AD20
.4byte sub_816AD7C
.4byte sub_816AD88
.4byte sub_816AD94
.4byte nullsub_118

View File

@ -410,7 +410,7 @@ gUnknown_085B51E4:: @ 85B51E4
gUnknown_085B5884:: @ 85B5884
.incbin "baserom.gba", 0x5b5884, 0x40
gUnknown_085B58C4:: @ 85B58C4
gText_ShedinjaJapaneseName2:: @ 85B58C4
.incbin "baserom.gba", 0x5b58c4, 0x5
gUnknown_085B58C9:: @ 85B58C9

View File

@ -1,18 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.incbin "baserom.gba", 0x5f53cc, 0x40
gUnknown_085F540C:: @ 85F540C
.incbin "baserom.gba", 0x5f540c, 0x10
gUnknown_085F541C:: @ 85F541C
.incbin "baserom.gba", 0x5f541c, 0x24
gUnknown_085F5440:: @ 85F5440
.incbin "baserom.gba", 0x5f5440, 0x18
gUnknown_085F5458:: @ 85F5458
.incbin "baserom.gba", 0x5f5458, 0x38

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
49 82 82
82 106 106
106 131 131
139 156 156
164 180 180
197 205 205
222 230 230
255 255 255

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 B

View File

@ -229,6 +229,7 @@
#define BATTLE_TERRAIN_ROCK 6
#define BATTLE_TERRAIN_CAVE 7
#define BATTLE_TERRAIN_INSIDE 8
#define BATTLE_TERRAIN_PLAIN 9
// array entries for battle communication
#define MULTIUSE_STATE 0x0
@ -348,7 +349,7 @@ struct UnknownFlags
struct DisableStruct
{
/*0x00*/ u32 unk0;
/*0x00*/ u32 transformedMonPersonality;
/*0x04*/ u16 disabledMove;
/*0x06*/ u16 encoredMove;
/*0x08*/ u8 protectUses;
@ -636,10 +637,10 @@ struct BattleStruct
u8 field_91;
u8 field_92;
u8 field_93;
u8 field_94;
u8 field_95;
u8 field_96;
u8 field_97;
u8 wallyBattleState;
u8 wallyMovesState;
u8 wallyWaitFrames;
u8 wallyMoveFrames;
u8 mirrorMoves[8]; // ask gamefreak why they declared it that way
u8 field_A0;
u8 field_A1;
@ -657,7 +658,7 @@ struct BattleStruct
u8 field_B3;
void (*savedCallback)(void);
u16 usedHeldItems[BATTLE_BANKS_COUNT];
u8 field_C0[4];
u8 chosenItem[4]; // why is this an u8?
u8 AI_itemType[2];
u8 AI_itemFlags[2];
u16 choicedMove[BATTLE_BANKS_COUNT];
@ -772,38 +773,39 @@ extern struct BattleStruct* gBattleStruct;
#define MOVE_EFFECT_AFFECTS_USER 0x40
#define MOVE_EFFECT_CERTAIN 0x80
// battle animations ids
// table ids for general animations
#define B_ANIM_CASTFORM_CHANGE 0x0
#define B_ANIM_STATS_CHANGE 0x1
#define B_ANIM_SUBSTITUTE_FADE 0x2
#define B_ANIM_SUBSTITUTE_APPEAR 0x3
#define B_ANIM_x4 0x4
#define B_ANIM_ITEM_KNOCKOFF 0x5
#define B_ANIM_TURN_TRAP 0x6
#define B_ANIM_ITEM_EFFECT 0x7
#define B_ANIM_SMOKEBALL_ESCAPE 0x8
#define B_ANIM_HANGED_ON 0x9
#define B_ANIM_RAIN_CONTINUES 0xA
#define B_ANIM_SUN_CONTINUES 0xB
#define B_ANIM_SANDSTORM_CONTINUES 0xC
#define B_ANIM_HAIL_CONTINUES 0xD
#define B_ANIM_LEECH_SEED_DRAIN 0xE
#define B_ANIM_MON_HIT 0xF
#define B_ANIM_ITEM_STEAL 0x10
#define B_ANIM_SNATCH_MOVE 0x11
#define B_ANIM_FUTURE_SIGHT_HIT 0x12
#define B_ANIM_x13 0x13
#define B_ANIM_x14 0x14
#define B_ANIM_INGRAIN_HEAL 0x15
#define B_ANIM_WISH_HEAL 0x16
#define B_ANIM_CASTFORM_CHANGE 0x0
#define B_ANIM_STATS_CHANGE 0x1
#define B_ANIM_SUBSTITUTE_FADE 0x2
#define B_ANIM_SUBSTITUTE_APPEAR 0x3
#define B_ANIM_x4 0x4
#define B_ANIM_ITEM_KNOCKOFF 0x5
#define B_ANIM_TURN_TRAP 0x6
#define B_ANIM_ITEM_EFFECT 0x7
#define B_ANIM_SMOKEBALL_ESCAPE 0x8
#define B_ANIM_HANGED_ON 0x9
#define B_ANIM_RAIN_CONTINUES 0xA
#define B_ANIM_SUN_CONTINUES 0xB
#define B_ANIM_SANDSTORM_CONTINUES 0xC
#define B_ANIM_HAIL_CONTINUES 0xD
#define B_ANIM_LEECH_SEED_DRAIN 0xE
#define B_ANIM_MON_HIT 0xF
#define B_ANIM_ITEM_STEAL 0x10
#define B_ANIM_SNATCH_MOVE 0x11
#define B_ANIM_FUTURE_SIGHT_HIT 0x12
#define B_ANIM_x13 0x13
#define B_ANIM_x14 0x14
#define B_ANIM_INGRAIN_HEAL 0x15
#define B_ANIM_WISH_HEAL 0x16
#define B_ANIM_x17 0x17
#define B_ANIM_x18 0x18
#define B_ANIM_x19 0x19
#define B_ANIM_x1A 0x1A
#define B_ANIM_x1B 0x1B
#define B_ANIM_x1C 0x1C
#define B_ANIM_x1D 0x1D
// special animations table
#define B_ANIM_LVL_UP 0x0
#define B_ANIM_SWITCH_OUT_PLAYER_MON 0x1
#define B_ANIM_SWITCH_OUT_OPPONENT_MON 0x2
#define B_ANIM_BALL_THROW 0x3
#define B_ANIM_SAFARI_BALL_THROW 0x4
#define B_ANIM_SUBSTITUTE_TO_MON 0x5
#define B_ANIM_MON_TO_SUBSTITUTE 0x6
#define GET_STAT_BUFF_ID(n)((n & 0xF)) // first four bits 0x1, 0x2, 0x4, 0x8
#define GET_STAT_BUFF_VALUE(n)(((n >> 4) & 7)) // 0x10, 0x20, 0x40
@ -878,6 +880,26 @@ void SetBankEnemyShadowSpriteCallback(u8 bank, u16 species);
void BattleLoadPlayerMonSpriteGfx(struct Pokemon *mon, u8 bank);
void BattleLoadOpponentMonSpriteGfx(struct Pokemon *mon, u8 bank);
void BattleLoadSubstituteSpriteGfx(u8 bank, bool8 arg1);
void nullsub_24(u16 arg0);
void nullsub_25(u8 arg0);
void ClearTemporarySpeciesSpriteData(u8 bank, bool8 dontClearSubstitute);
void sub_805D714(struct Sprite *sprite);
void DecompressTrainerBackPic(u16 backPicId, u8 bank);
void DecompressTrainerFrontPic(u16 frontPicId, u8 bank);
void FreeTrainerFrontPicPalette(u16 frontPicId);
void sub_805D7AC(struct Sprite *sprite);
bool8 IsMoveWithoutAnimation(u16 moveId, u8 animationTurn);
void sub_805EB9C(u8 arg0);
void sub_805E394(void);
void TrySetBehindSubstituteSpriteBit(u8 bank, u16 move);
void DoStatusAnimation(bool8 isStatus2, u32 status);
void DoSpecialBattleAnimation(u8 activeBank, u8 atkBank, u8 defBank, u8 tableId);
bool8 DoBattleAnimationFromTable(u8 active, u8 atkBank, u8 defBank, u8 tableId, u16 argument);
void CopyBattleSpriteInvisibility(u8 bank);
u16 ChooseMoveAndTargetInBattlePalace(void);
void LoadBattleBarGfx(u8 arg0);
bool8 mplay_80342A4(u8 bank);
void sub_805EEE0(u8 bank);
enum
{
@ -890,7 +912,6 @@ enum
BACK_PIC_WALLY,
BACK_PIC_STEVEN
};
void LoadBackTrainerBankSpriteGfx(u8 backPicId, u8 bank);
// rom_80A5C6C
u8 GetBankSide(u8 bank);
@ -916,7 +937,7 @@ struct BattleAnimationInfo
u8 field_5;
u8 field_6;
u8 field_7;
u8 field_8;
u8 ballThrowCaseId;
u8 field_9_x1 : 1;
u8 field_9_x2 : 1;
u8 field_9_x1C : 3;
@ -931,11 +952,18 @@ struct BattleHealthboxInfo
u8 flag_x2 : 1;
u8 flag_x4 : 1;
u8 flag_x8 : 1;
u8 flag_x10 : 1;
u8 field_1;
u8 statusAnimActive : 1; // x10
u8 animFromTableActive : 1; // x20
u8 specialAnimActive : 1; //x40
u8 flag_x80 : 1;
u8 field_1_x1 : 1;
u8 field_1_x1E : 4;
u8 field_1_x20 : 1;
u8 field_1_x40 : 1;
u8 field_1_x80 : 1;
u8 field_2;
u8 field_3;
u8 field_4;
u8 animationState;
u8 field_5;
u8 field_6;
u8 field_7;
@ -950,7 +978,7 @@ struct BattleBarInfo
u8 healthboxSpriteId;
s32 maxValue;
s32 currentValue;
s32 field_C;
s32 receivedValue;
s32 field_10;
};

View File

@ -2,23 +2,45 @@
#define GUARD_BATTLE_2_H
void CB2_InitBattle(void);
void CB2_QuitRecordedBattle(void);
void FaintClearSetData(void);
void SwitchInClearSetData(void);
void sub_803BDA0(u8 bank);
void BattleMainCB2(void);
void CB2_QuitRecordedBattle(void);
void sub_8038528(struct Sprite* sprite);
void sub_8038A04(void); // unused
void VBlankCB_Battle(void);
bool8 TryRunFromBattle(u8 bank);
u8 IsRunningFromBattleImpossible(void);
u8 GetWhoStrikesFirst(u8 bank1, u8 bank2, bool8 ignoreChosenMoves);
void SwapTurnOrder(u8 id1, u8 id2);
void BattleTurnPassed(void);
void RunBattleScriptCommands_PopCallbacksStack(void);
void RunBattleScriptCommands(void);
void nullsub_17(void);
void sub_8038B74(struct Sprite *sprite);
void sub_8038D64(void);
u32 sub_80391E0(u8 arrayId, u8 caseId);
u32 sub_80397C4(u32 setId, u32 tableId);
void oac_poke_opponent(struct Sprite *sprite);
void SpriteCallbackDummy_2(struct Sprite *sprite);
void sub_8039934(struct Sprite *sprite);
void sub_8039AD8(struct Sprite *sprite);
void sub_8039B2C(struct Sprite *sprite);
void sub_8039B58(struct Sprite *sprite);
void sub_8039BB4(struct Sprite *sprite);
void sub_80105DC(struct Sprite *sprite);
void sub_8039C00(struct Sprite *sprite);
void dp11b_obj_instanciate(u8 bank, u8 b, s8 c, s8 d);
void dp11b_obj_free(u8 bank, bool8 b);
void sub_8039E44(struct Sprite *sprite);
void sub_8039E60(struct Sprite *sprite);
void sub_8039E84(struct Sprite *sprite);
void sub_8039E9C(struct Sprite *sprite);
void nullsub_20(void);
void BeginBattleIntro(void);
void SwitchInClearSetData(void);
void FaintClearSetData(void);
void sub_803B3AC(void); // unused
void sub_803B598(void); // unused
void BattleTurnPassed(void);
u8 IsRunningFromBattleImpossible(void);
void sub_803BDA0(u8 bank);
void SwapTurnOrder(u8 id1, u8 id2);
u8 GetWhoStrikesFirst(u8 bank1, u8 bank2, bool8 ignoreChosenMoves);
void RunBattleScriptCommands_PopCallbacksStack(void);
void RunBattleScriptCommands(void);
bool8 TryRunFromBattle(u8 bank);
extern const u8 gStatusConditionString_PoisonJpn[8];
extern const u8 gStatusConditionString_SleepJpn[8];

View File

@ -60,7 +60,7 @@ extern u8 gUnknown_02038440;
void ClearBattleAnimationVars(void);
void DoMoveAnim(u16 move);
void DoBattleAnim(const u8 *const animsTable[], u16 tableId, bool8 isMoveAnim);
void LaunchBattleAnimation(const u8 *const animsTable[], u16 tableId, bool8 isMoveAnim);
void DestroyAnimSprite(struct Sprite *sprite);
void DestroyAnimVisualTask(u8 taskId);
void DestroyAnimSoundTask(u8 taskId);
@ -75,5 +75,24 @@ s16 CalculatePanIncrement(s16 sourcePan, s16 targetPan, s16 incrementPan);
// battle_anim_80FE840.s
void SetAnimBgAttribute(u8 bgId, u8 attributeId, u8 value);
void sub_8118FBC(u8 arg0, u8 arg1, u8 arg2, u8 bankIdentity, u8 arg4, void *arg5, u16 *arg6, u16 arg7);
void HandleIntroSlide(u8 terrainId);
// battle_anim_80A5C6C.s
void sub_80A6EEC(struct Sprite *sprite);
void sub_80A8278(void);
void sub_80A6B30(struct UnknownAnimStruct2*);
void sub_80A6B90(struct UnknownAnimStruct2*, u32 arg1);
u8 sub_80A82E4(u8 bank);
u8 sub_80A5C6C(u8 bank, u8 attributeId);
bool8 IsBankSpritePresent(u8 bank);
void sub_80A6C68(u8 arg0);
u8 GetAnimBankSpriteId(u8 wantedBank);
bool8 IsDoubleBattle(void);
u8 sub_80A6D94(void);
u8 sub_80A8364(u8);
void StoreSpriteCallbackInData6(struct Sprite *sprite, void (*spriteCallback)(struct Sprite*));
void oamt_add_pos2_onto_pos1(struct Sprite *sprite);
u8 sub_80A6138(u8 bank);
u8 sub_80A82E4(u8 bank);
#endif // GUARD_BATTLE_ANIM_H

View File

@ -1,16 +1,69 @@
#ifndef GUARD_BATTLE_CONTROLLERS_H
#define GUARD_BATTLE_CONTROLLERS_H
#define REQUEST_ALL_BATTLE 0x0
#define REQUEST_SPECIES_BATTLE 0x1
#define REQUEST_HELDITEM_BATTLE 0x2
#define REQUEST_MOVES_PP_BATTLE 0x3
#define REQUEST_PPMOVE1_BATTLE 0x9
#define REQUEST_PPMOVE2_BATTLE 0xA
#define REQUEST_PPMOVE3_BATTLE 0xB
#define REQUEST_PPMOVE4_BATTLE 0xC
#define REQUEST_STATUS_BATTLE 0x28
#define REQUEST_HP_BATTLE 0x2A
enum
{
REQUEST_ALL_BATTLE,
REQUEST_SPECIES_BATTLE,
REQUEST_HELDITEM_BATTLE,
REQUEST_MOVES_PP_BATTLE,
REQUEST_MOVE1_BATTLE,
REQUEST_MOVE2_BATTLE,
REQUEST_MOVE3_BATTLE,
REQUEST_MOVE4_BATTLE,
REQUEST_PP_DATA_BATTLE,
REQUEST_PPMOVE1_BATTLE,
REQUEST_PPMOVE2_BATTLE,
REQUEST_PPMOVE3_BATTLE,
REQUEST_PPMOVE4_BATTLE,
REQUEST_UNUSED_13_BATTLE,
REQUEST_UNUSED_14_BATTLE,
REQUEST_UNUSED_15_BATTLE,
REQUEST_UNUSED_16_BATTLE,
REQUEST_OTID_BATTLE,
REQUEST_EXP_BATTLE,
REQUEST_HP_EV_BATTLE,
REQUEST_ATK_EV_BATTLE,
REQUEST_DEF_EV_BATTLE,
REQUEST_SPEED_EV_BATTLE,
REQUEST_SPATK_EV_BATTLE,
REQUEST_SPDEF_EV_BATTLE,
REQUEST_FRIENDSHIP_BATTLE,
REQUEST_POKERUS_BATTLE,
REQUEST_MET_LOCATION_BATTLE,
REQUEST_MET_LEVEL_BATTLE,
REQUEST_MET_GAME_BATTLE,
REQUEST_POKEBALL_BATTLE,
REQUEST_ALL_IVS_BATTLE,
REQUEST_HP_IV_BATTLE,
REQUEST_ATK_IV_BATTLE,
REQUEST_DEF_IV_BATTLE,
REQUEST_SPEED_IV_BATTLE,
REQUEST_SPATK_IV_BATTLE,
REQUEST_SPDEF_IV_BATTLE,
REQUEST_PERSONALITY_BATTLE,
REQUEST_CHECKSUM_BATTLE,
REQUEST_STATUS_BATTLE,
REQUEST_LEVEL_BATTLE,
REQUEST_HP_BATTLE,
REQUEST_MAX_HP_BATTLE,
REQUEST_ATK_BATTLE,
REQUEST_DEF_BATTLE,
REQUEST_SPEED_BATTLE,
REQUEST_SPATK_BATTLE,
REQUEST_SPDEF_BATTLE,
REQUEST_COOL_BATTLE,
REQUEST_BEAUTY_BATTLE,
REQUEST_CUTE_BATTLE,
REQUEST_SMART_BATTLE,
REQUEST_TOUGH_BATTLE,
REQUEST_SHEEN_BATTLE,
REQUEST_COOL_RIBBON_BATTLE,
REQUEST_BEAUTY_RIBBON_BATTLE,
REQUEST_CUTE_RIBBON_BATTLE,
REQUEST_SMART_RIBBON_BATTLE,
REQUEST_TOUGH_RIBBON_BATTLE,
};
#define RESET_ACTION_MOVE_SELECTION 0
#define RESET_ACTION_SELECTION 1
@ -23,6 +76,16 @@
#define BALL_3_SHAKES_SUCCESS 4
#define BALL_TRAINER_BLOCK 5
#define RET_VALUE_LEVELLED_UP 11
#define INSTANT_HP_BAR_DROP 32767
struct UnusedControllerStruct
{
u8 field_0 : 7;
u8 flag_x80 : 1;
};
struct HpAndStatus
{
u16 hp;
@ -31,7 +94,7 @@ struct HpAndStatus
struct MovePpInfo
{
u16 move[4];
u16 moves[4];
u8 pp[4];
u8 ppBonuses;
};
@ -59,15 +122,15 @@ enum
CONTROLLER_TRAINERSLIDE,
CONTROLLER_TRAINERSLIDEBACK,
CONTROLLER_FAINTANIMATION,
CONTROLLER_11,
CONTROLLER_12,
CONTROLLER_BALLTHROW,
CONTROLLER_PALETTEFADE,
CONTROLLER_SUCCESSBALLTHROWANIM,
CONTROLLER_BALLTHROWANIM,
CONTROLLER_PAUSE,
CONTROLLER_MOVEANIMATION,
CONTROLLER_PRINTSTRING,
CONTROLLER_PRINTSTRINGPLAYERONLY,
CONTROLLER_CHOOSEACTION,
CONTROLLER_19,
CONTROLLER_UNKNOWNYESNOBOX,
CONTROLLER_CHOOSEMOVE,
CONTROLLER_OPENBAG,
CONTROLLER_CHOOSEPOKEMON,
@ -81,10 +144,10 @@ enum
CONTROLLER_DMA3TRANSFER,
CONTROLLER_31,
CONTROLLER_32,
CONTROLLER_33,
CONTROLLER_34,
CONTROLLER_35,
CONTROLLER_36,
CONTROLLER_TWORETURNVALUES,
CONTROLLER_CHOSENMONRETURNVALUE,
CONTROLLER_ONERETURNVALUE,
CONTROLLER_ONERETURNVALUE_DUPLICATE,
CONTROLLER_37,
CONTROLLER_38,
CONTROLLER_39,
@ -104,10 +167,11 @@ enum
CONTROLLER_LINKSTANDBYMSG,
CONTROLLER_RESETACTIONMOVESELECTION,
CONTROLLER_55,
CONTROLLER_56
/*new controllers should go here*/
CONTROLLER_TERMINATOR_NOP,
CONTROLLER_CMDS_COUNT
};
#define LAST_CONTROLLER_CMD_ID CONTROLLER_56 + 1
// general functions
void HandleLinkBattleSetup(void);
@ -117,9 +181,9 @@ void sub_8033648(void);
void PrepareBufferDataTransferLink(u8 bufferId, u16 size, u8 *data);
// emitters
void EmitGetMonData(u8 bufferId, u8 arg1, u8 arg2);
void EmitGetMonData(u8 bufferId, u8 requestId, u8 monToCheck);
void EmitGetRawMonData(u8 bufferId, u8 monId, u8 bytes); // unused
void EmitSetMonData(u8 bufferId, u8 request, u8 c, u8 bytes, void *data);
void EmitSetMonData(u8 bufferId, u8 requestId, u8 monToCheck, u8 bytes, void *data);
void EmitSetRawMonData(u8 bufferId, u8 monId, u8 bytes, void *data); // unused
void EmitLoadMonSprite(u8 bufferId);
void EmitSwitchInAnim(u8 bufferId, u8 partyId, bool8 dontClearSubstituteBit);
@ -128,17 +192,17 @@ void EmitDrawTrainerPic(u8 bufferId);
void EmitTrainerSlide(u8 bufferId);
void EmitTrainerSlideBack(u8 bufferId);
void EmitFaintAnimation(u8 bufferId);
void EmitCmd11(u8 bufferId); // unused
void EmitCmd12(u8 bufferId); // unused
void EmitBallThrow(u8 bufferId, u8 caseId);
void EmitPaletteFade(u8 bufferId); // unused
void EmitSuccessBallThrowAnim(u8 bufferId); // unused
void EmitBallThrowAnim(u8 bufferId, u8 caseId);
void EmitPause(u8 bufferId, u8 toWait, void *data); // unused
void EmitMoveAnimation(u8 bufferId, u16 move, u8 turnOfMove, u16 movePower, s32 dmg, u8 friendship, struct DisableStruct *disableStructPtr, u8 multihit);
void EmitPrintString(u8 bufferId, u16 stringId);
void EmitPrintStringPlayerOnly(u8 bufferId, u16 stringId);
void EmitChooseAction(u8 bufferId, u8 arg1, u16 arg2);
void EmitCmd19(u8 bufferId);
void EmitUnknownYesNoBox(u8 bufferId);
void EmitChooseMove(u8 bufferId, bool8 isDoubleBattle, bool8 NoPpNumber, struct ChooseMoveStruct *movePpData);
void EmitOpenBag(u8 bufferId, u8* arg1);
void EmitChooseItem(u8 bufferId, u8* arg1);
void EmitChoosePokemon(u8 bufferId, u8 caseId, u8 arg2, u8 abilityId, u8* arg4);
void EmitCmd23(u8 bufferId); // unused
void EmitHealthBarUpdate(u8 bufferId, u16 hpValue);
@ -150,14 +214,14 @@ void EmitDataTransfer(u8 bufferId, u16 size, void *data);
void EmitDMA3Transfer(u8 bufferId, void *dst, u16 size, void *data); // unused
void EmitPlayBGM(u8 bufferId, u16 songId, void *unusedDumbDataParameter); // unused
void EmitCmd32(u8 bufferId, u16 size, void *c); // unused
void EmitCmd33(u8 bufferId, u8 arg1, u16 arg2);
void EmitCmd34(u8 bufferId, u8 b, u8 *c);
void EmitCmd35(u8 bufferId, u16 b);
void EmitCmd36(u8 bufferId, u16 b);
void EmitCmd37(u8 bufferId);
void EmitCmd38(u8 bufferId, u8 b);
void EmitCmd39(u8 bufferId);
void EmitCmd40(u8 bufferId);
void EmitTwoReturnValues(u8 bufferId, u8 arg1, u16 arg2);
void EmitChosenMonReturnValue(u8 bufferId, u8 b, u8 *c);
void EmitOneReturnValue(u8 bufferId, u16 arg1);
void EmitOneReturnValue_Duplicate(u8 bufferId, u16 b);
void EmitCmd37(u8 bufferId); // unused
void EmitCmd38(u8 bufferId, u8 b); // unused
void EmitCmd39(u8 bufferId); // unused
void EmitCmd40(u8 bufferId); // unused
void EmitHitAnimation(u8 bufferId);
void EmitCmd42(u8 bufferId);
void EmitEffectivenessSound(u8 bufferId, u16 songId);
@ -175,33 +239,40 @@ void EmitResetActionMoveSelection(u8 bufferId, u8 caseId);
void EmitCmd55(u8 bufferId, u8 arg1);
// player controller
void SetBankFuncToPlayerBufferRunCommand(void);
void SetControllerToPlayer(void);
void nullsub_21(void);
void PlayerHandleGetRawMonData(void);
void sub_80587B0(void);
void sub_805CC00(struct Sprite *sprite);
void SetCB2ToReshowScreenAfterMenu(void);
void SetCB2ToReshowScreenAfterMenu2(void);
void c3_0802FDF4(u8 taskId);
void ActionSelectionCreateCursorAt(u8 cursorPos, u8 unused);
void ActionSelectionDestroyCursorAt(u8 cursorPos);
void InitMoveSelectionsVarsAndStrings(void);
// recorded player controller
void SetBankFuncToRecordedPlayerBufferRunCommand(void);
void SetControllerToRecordedPlayer(void);
// opponent controller
void SetBankFuncToOpponentBufferRunCommand(void);
void SetControllerToOpponent(void);
// player partner controller
void SetBankFuncToPlayerPartnerBufferRunCommand(void);
void SetControllerToPlayerPartner(void);
// safari controller
void SetBankFuncToSafariBufferRunCommand(void);
void SetControllerToSafari(void);
// wally controller
void SetBankFuncToWallyBufferRunCommand(void);
void SetControllerToWally(void);
// recorded opponent controller
void SetBankFuncToRecordedOpponentBufferRunCommand(void);
void SetControllerToRecordedOpponent(void);
// link opponent
void SetBankFuncToLinkOpponentBufferRunCommand(void);
void SetControllerToLinkOpponent(void);
// link partner
void SetBankFuncToLinkPartnerBufferRunCommand(void);
void SetControllerToLinkPartner(void);
#endif // GUARD_BATTLE_CONTROLLERS_H

View File

@ -3,6 +3,18 @@
#include "battle_controllers.h"
enum
{
HP_CURRENT,
HP_MAX
};
enum
{
HEALTH_BAR,
EXP_BAR
};
#define TAG_HEALTHBOX_PLAYER1_TILE 0xD6FF
#define TAG_HEALTHBOX_PLAYER2_TILE 0xD700
#define TAG_HEALTHBOX_OPPONENT1_TILE 0xD701
@ -35,7 +47,7 @@ enum
u8 CreateBankHealthboxSprites(u8 bank);
u8 CreateSafariPlayerHealthboxSprites(void);
void SetBattleBarStruct(u8 bank, u8 healthboxSpriteId, s32 maxVal, s32 currVal, s32 field_C);
void SetBattleBarStruct(u8 bank, u8 healthboxSpriteId, s32 maxVal, s32 currVal, s32 receivedValue);
void SetHealthboxSpriteInvisible(u8 healthboxSpriteId);
void SetHealthboxSpriteVisible(u8 healthboxSpriteId);
void DestoryHealthboxSprite(u8 healthboxSpriteId);

View File

@ -0,0 +1,11 @@
#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 GetBankMoveSlotId(u8 bank, u16 move);
#endif // GUARD_BATTLE_LINK_817C95C_H

View File

@ -204,7 +204,7 @@ struct StringInfoBattle
void BufferStringBattle(u16 stringID);
u32 BattleStringExpandPlaceholdersToDisplayedString(const u8* src);
u32 BattleStringExpandPlaceholders(const u8* src, u8* dst);
void sub_814F9EC(const u8* text, u8 arg1);
void BattleHandleAddTextPrinter(const u8* text, u8 arg1);
void SetPpNumbersPaletteInMoveSelection(void);
u8 GetCurrentPpToMaxPpState(u8 currentPp, u8 maxPp);
@ -215,6 +215,7 @@ extern u8 gBattleTextBuff1[TEXT_BUFF_ARRAY_COUNT];
extern u8 gBattleTextBuff2[TEXT_BUFF_ARRAY_COUNT];
extern u8 gBattleTextBuff3[TEXT_BUFF_ARRAY_COUNT];
extern const u8* const gBattleStringsTable[];
extern const u8* const gStatNamesTable[];
extern const u8* const gPokeblockWasTooXStringTable[];
extern const u8* const gRefereeStringsTable[];

View File

@ -25,6 +25,7 @@
#define VARIOUS_GET_MOVE_TARGET 3
#define VARIOUS_RESET_INTIMIDATE_TRACE_BITS 5
#define VARIOUS_UPDATE_CHOICE_MOVE_ON_LVL_UP 6
#define VARIOUS_EMIT_YESNOBOX 13
#define VARIOUS_WAIT_CRY 18
#define VARIOUS_RETURN_OPPONENT_MON1 19
#define VARIOUS_RETURN_OPPONENT_MON2 20
@ -41,15 +42,18 @@
#define STAT_CHANGE_WORKED 0
#define STAT_CHANGE_DIDNT_WORK 1
#define WINDOW_CLEAR 0x1
#define WINDOW_x80 0x80
void AI_CalcDmg(u8 bankAtk, u8 bankDef);
u8 TypeCalc(u16 move, u8 bankAtk, u8 bankDef);
u8 AI_TypeCalc(u16 move, u16 targetSpecies, u8 targetAbility);
u8 BankGetTurnOrder(u8 bank);
void SetMoveEffect(bool8 primary, u8 certain);
void BattleDestroyCursorAt(u8 cursorPosition);
void BattleCreateCursorAt(u8 cursorPosition);
void BattleDestroyYesNoCursorAt(u8 cursorPosition);
void BattleCreateYesNoCursorAt(u8 cursorPosition);
void BufferMoveToLearnIntoBattleTextBuff2(void);
void sub_8056A3C(u8 xStart, u8 yStart, u8 xEnd, u8 yEnd, u8 flags);
void HandleBattleWindow(u8 xStart, u8 yStart, u8 xEnd, u8 yEnd, u8 flags);
bool8 UproarWakeUpCheck(u8 bank);
extern void (* const gBattleScriptingCommandsTable[])(void);

View File

@ -10,6 +10,7 @@ struct MonCoords
};
extern struct MonCoords gTrainerBackPicCoords[];
extern struct MonCoords gTrainerFrontPicCoords[];
extern const u8 gSpeciesNames[][POKEMON_NAME_LENGTH + 1];
extern const u8 gMoveNames[][13];

View File

@ -0,0 +1,15 @@
#ifndef GUARD_EVOLUTION_GRAPHICS_H
#define GUARD_EVOLUTION_GRAPHICS_H
void LoadEvoSparkleSpriteAndPal(void);
u8 LaunchTask_PreEvoSparklesSet1(u16 arg0);
u8 LaunchTask_PreEvoSparklesSet2(void);
u8 LaunchTask_PostEvoSparklesSet1(void);
u8 LaunchTask_PostEvoSparklesSet2AndFlash(u16 species);
u8 LaunchTask_PostEvoSparklesSet2AndFlash_Trade(u16 species);
u8 sub_817C3A0(u8 preEvoSpriteID, u8 postEvoSpriteID);
#define EvoGraphicsTaskEvoStop data[8]
#endif // GUARD_EVOLUTION_GRAPHICS_H

View File

@ -1,8 +1,8 @@
#ifndef GUARD_EVOLUTION_SCENE_H
#define GUARD_EVOLUTION_SCENE_H
void EvolutionScene(struct Pokemon* mon, u16 speciesToEvolve, bool8 canStopEvo, u8 partyID);
void BeginEvolutionScene(struct Pokemon* mon, u16 speciesToEvolve, bool8 canStopEvo, u8 partyID);
void EvolutionScene(struct Pokemon* mon, u16 speciesToEvolve, bool8 canStopEvo, u8 partyID);
void TradeEvolutionScene(struct Pokemon* mon, u16 speciesToEvolve, u8 preEvoSpriteID, u8 partyID);
extern void (*gCB2_AfterEvolution)(void);

View File

@ -628,6 +628,8 @@
#define KEY_OR_INTR 0x0000
#define KEY_AND_INTR 0x8000
#define DPAD_ANY ((DPAD_RIGHT | DPAD_LEFT | DPAD_UP | DPAD_DOWN))
// interrupt flags
#define INTR_FLAG_VBLANK (1 << 0)
#define INTR_FLAG_HBLANK (1 << 1)

View File

@ -41,6 +41,8 @@ enum
VERSION_SAPPHIRE = 1,
VERSION_RUBY = 2,
VERSION_EMERALD = 3,
VERSION_FIRE_RED = 4,
VERSION_LEAF_GREEN = 5,
};
enum LanguageId {

View File

@ -191,5 +191,6 @@ void sub_800A620(void);
void sub_8011BD0(void);
u8 sub_800ABAC(void);
u8 sub_800ABBC(void);
void sub_800AC34(void);
#endif // GUARD_LINK_H

View File

@ -2,5 +2,6 @@
#define GUARD_PARTY_MENU_H
bool8 pokemon_has_move(struct Pokemon *, u16);
void DoWallyTutorialBagMenu(void);
#endif // GUARD_PARTY_MENU_H

8
include/pokeball.h Normal file
View File

@ -0,0 +1,8 @@
#ifndef GUARD_POKEBALL_H
#define GUARD_POKEBALL_H
u8 sub_80753E8(u16, u8);
void sub_8076918(u8 bank);
void DoHitAnimHealthboxEffect(u8 bank);
#endif // GUARD_POKEBALL_H

View File

@ -620,7 +620,7 @@ void SetWildMonHeldItem(void);
u16 GetMonEVCount(struct Pokemon *);
const struct CompressedSpritePalette *sub_806E794(struct Pokemon *mon);
const struct CompressedSpritePalette *sub_806E7CC(u16 species, u32 otId , u32 personality);
const struct CompressedSpritePalette *GetMonSpritePalStructFromOtIdPersonality(u16 species, u32 otId , u32 personality);
bool32 IsHMMove2(u16 move);
bool8 IsPokeSpriteNotFlipped(u16 species);
bool8 IsMonShiny(struct Pokemon *mon);
@ -629,7 +629,7 @@ bool8 IsShinyOtIdPersonality(u32 otId, u32 personality);
void MonGainEVs(struct Pokemon *mon, u16 defeatedSpecies);
bool8 IsTradedMon(struct Pokemon *mon);
void HandleSetPokedexFlag(u16 nationalNum, u8 caseId, u32 personality);
s32 sub_806D864(u16 a1);
s32 GetBankMultiplayerId(u16 a1);
bool16 sub_806D82C(u8 id);
u16 MonTryLearningNewMove(struct Pokemon* mon, bool8);
void sub_8068AA4(void); // sets stats for deoxys
@ -643,6 +643,11 @@ void PartySpreadPokerus(struct Pokemon *party);
s8 GetMonFlavourRelation(struct Pokemon *mon, u8 a2);
s8 GetFlavourRelationByPersonality(u32 personality, u8 a2);
u8 GetItemEffectParamOffset(u16 itemId, u8 effectByte, u8 effectBit);
u8 GetDefaultMoveTarget(u8 atkBank);
u16 PlayerGenderToFrontTrainerPicId(u8 playerGender);
void sub_806A1C0(u16 arg0, u8 bankIdentity);
void sub_806A12C(u16 trainerSpriteId, u8 bankIdentity);
u8 GetSecretBaseTrainerPicIndex(void);
#include "sprite.h"

View File

@ -6,6 +6,7 @@ extern u32 gRecordedBattleRngSeed;
void sub_8184DA4(u8 arg0);
void sub_8185F84(void);
void sub_8184E58(void);
u8 RecordedBattle_ReadBankAction(u8 bank);
void RecordedBattle_SetBankAction(u8 bank, u8 action);
void RecordedBattle_ClearBankAction(u8 bank, u8 bytesToClear);
void sub_8185F90(u16 arg0);
@ -18,5 +19,6 @@ void sub_8185FD0(void);
void sub_8186444(void);
void sub_8185EB8(void);
u8 sub_81850DC(u8 *arg0);
u8 sub_8185F40(void);
#endif // GUARD_RECORDED_BATTLE_H

View File

@ -3,16 +3,16 @@
enum
{
CLASS_PKMN_TRAINER0, //0
CLASS_PKMN_TRAINER1, //1
CLASS_HIKER, //2
CLASS_TEAM_AQUA, //3
CLASS_PKMN_BREEDER, //4
CLASS_COOLTRAINER, //5
CLASS_BIRDKEEPER, //6
CLASS_COLLECTOR, //7
CLASS_SWIMMER_MALE, //8
CLASS_TEAM_MAGMA, //9
CLASS_PKMN_TRAINER0, // 0
CLASS_PKMN_TRAINER1, // 1
CLASS_HIKER, // 2
CLASS_TEAM_AQUA, // 3
CLASS_PKMN_BREEDER, // 4
CLASS_COOLTRAINER, // 5
CLASS_BIRDKEEPER, // 6
CLASS_COLLECTOR, // 7
CLASS_SWIMMER_MALE, // 8
CLASS_TEAM_MAGMA, // 9
CLASS_EXPERT, // 0xA
CLASS_AQUA_ADMIN, // 0xB
CLASS_BLACK_BELT, // 0xC
@ -36,11 +36,32 @@ enum
CLASS_GENTLEMAN, // 0x1E
CLASS_ELITE_FOUR, // 0x1F
CLASS_LEADER, // 0x20
CLASS_CHAMPION = 0x26,
CLASS_MAGMA_ADMIN = 0x31,
CLASS_PKMN_TRAINER_RIVAL = 0x32,
CLASS_MAGMA_LEADER = 0x35,
CLASS_SALON_MAIDEN = 0x3A,
CLASS_SCHOOL_KID, // 0x21
CLASS_SCHOOL_SR_JR, // 0x22
CLASS_WINSTRATE, // 0x23
CLASS_POKE_FAN, // 0x24
CLASS_YOUNGSTER, // 0x25
CLASS_CHAMPION, // 0x26
CLASS_FISHERMAN, // 0x27
CLASS_TRIATHLETE, // 0x28
CLASS_DRAGON_TAMER, // 0x29
CLASS_NINJA_BOY, // 0x2A
CLASS_BATTLE_GIRL, // 0x2B
CLASS_PARASOL_LADY, // 0x2C
CLASS_SWIMMER_FEMALE, // 0x2D
CLASS_TWINS, // 0x2E
CLASS_SAILOR, // 0x2F
CLASS_COOLTRAINER_2, // 0x30
CLASS_MAGMA_ADMIN, // 0x31
CLASS_PKMN_TRAINER_RIVAL, // 0x32
CLASS_BUG_CATCHER, // 0x33
CLASS_PKMN_RANGER, // 0x34
CLASS_MAGMA_LEADER, // 0x35
CLASS_LASS, // 0x36
CLASS_YOUNG_COUPLE, // 0x37
CLASS_OLD_COUPLE, // 0x38
CLASS_SIS_AND_BRO, // 0x39
CLASS_SALON_MAIDEN, // 0x3A
CLASS_DOME_ACE, // 0x3B
CLASS_PALACE_MAVEN, // 0x3C
CLASS_ARENA_TYCOON, // 0x3D

View File

@ -0,0 +1,101 @@
#ifndef GUARD_TRAINER_FRONT_SPRITES_H
#define GUARD_TRAINER_FRONT_SPRITES_H
enum
{
TRAINER_FRONT_PIC_HIKER,
TRAINER_FRONT_PIC_AQUA_GRUNT_M,
TRAINER_FRONT_PIC_PKMN_BREEDER_F,
TRAINER_FRONT_PIC_COOLTRAINER_M,
TRAINER_FRONT_PIC_BIRD_KEEPER,
TRAINER_FRONT_PIC_COLLECTOR,
TRAINER_FRONT_PIC_AQUA_GRUNT_F,
TRAINER_FRONT_PIC_SWIMMER_M,
TRAINER_FRONT_PIC_MAGMA_GRUNT_M,
TRAINER_FRONT_PIC_EXPERT_M,
TRAINER_FRONT_PIC_AQUA_ADMIN_M,
TRAINER_FRONT_PIC_BLACK_BELT,
TRAINER_FRONT_PIC_AQUA_ADMIN_F,
TRAINER_FRONT_PIC_AQUA_LEADER,
TRAINER_FRONT_PIC_HEX_MANIAC,
TRAINER_FRONT_PIC_AROMA_LADY,
TRAINER_FRONT_PIC_RUIN_MANIAC,
TRAINER_FRONT_PIC_INTERVIEWER,
TRAINER_FRONT_PIC_TUBER_F,
TRAINER_FRONT_PIC_TUBER_M,
TRAINER_FRONT_PIC_COOLTRAINER_F,
TRAINER_FRONT_PIC_LADY,
TRAINER_FRONT_PIC_BEAUTY,
TRAINER_FRONT_PIC_RICH_BOY,
TRAINER_FRONT_PIC_EXPERT_F,
TRAINER_FRONT_PIC_POKE_MANIAC,
TRAINER_FRONT_PIC_MAGMA_GRUNT_F,
TRAINER_FRONT_PIC_GUITARIST,
TRAINER_FRONT_PIC_KINDLER,
TRAINER_FRONT_PIC_CAMPER,
TRAINER_FRONT_PIC_PICNICKER,
TRAINER_FRONT_PIC_BUG_MANIAC,
TRAINER_FRONT_PIC_PKMN_BREEDER_M,
TRAINER_FRONT_PIC_PSYCHIC_M,
TRAINER_FRONT_PIC_PSYCHIC_F,
TRAINER_FRONT_PIC_GENTLEMAN,
TRAINER_FRONT_PIC_SIDNEY,
TRAINER_FRONT_PIC_PHOEBE,
TRAINER_FRONT_PIC_GLACIA,
TRAINER_FRONT_PIC_DRAKE,
TRAINER_FRONT_PIC_ROXANNE,
TRAINER_FRONT_PIC_BRAWLY,
TRAINER_FRONT_PIC_WATTSON,
TRAINER_FRONT_PIC_FLANNERY,
TRAINER_FRONT_PIC_NORMAN,
TRAINER_FRONT_PIC_WINONA,
TRAINER_FRONT_PIC_TATE_LIZA,
TRAINER_FRONT_PIC_JUAN,
TRAINER_FRONT_PIC_SCHOOL_KID_M,
TRAINER_FRONT_PIC_SCHOOL_KID_F,
TRAINER_FRONT_PIC_SR_JR,
TRAINER_FRONT_PIC_POKÉFAN_M,
TRAINER_FRONT_PIC_POKÉFAN_F,
TRAINER_FRONT_PIC_YOUNGSTER,
TRAINER_FRONT_PIC_WALLACE,
TRAINER_FRONT_PIC_FISHERMAN,
TRAINER_FRONT_PIC_TRIATHLETE_BIKER_M,
TRAINER_FRONT_PIC_TRIATHLETE_BIKER_F,
TRAINER_FRONT_PIC_TRIATHLETE_JOGGER_M,
TRAINER_FRONT_PIC_TRIATHLETE_JOGGER_F,
TRAINER_FRONT_PIC_TRIATHLETE_SWIMMER_M,
TRAINER_FRONT_PIC_TRIATHLETE_SWIMMER_F,
TRAINER_FRONT_PIC_DRAGON_TAMER,
TRAINER_FRONT_PIC_NINJA_BOY,
TRAINER_FRONT_PIC_BATTLE_GIRL,
TRAINER_FRONT_PIC_PARASOL_LADY,
TRAINER_FRONT_PIC_SWIMMER_F,
TRAINER_FRONT_PIC_TWINS,
TRAINER_FRONT_PIC_SAILOR,
TRAINER_FRONT_PIC_MAGMA_ADMIN_M,
TRAINER_FRONT_PIC_WALLY,
TRAINER_FRONT_PIC_BRENDAN_E,
TRAINER_FRONT_PIC_MAY_E,
TRAINER_FRONT_PIC_BUG_CATCHER,
TRAINER_FRONT_PIC_PKMN_RANGER_M,
TRAINER_FRONT_PIC_PKMN_RANGER_F,
TRAINER_FRONT_PIC_MAGMA_LEADER,
TRAINER_FRONT_PIC_LASS,
TRAINER_FRONT_PIC_YOUNG_COUPLE,
TRAINER_FRONT_PIC_OLD_COUPLE,
TRAINER_FRONT_PIC_SIS_AND_BRO,
TRAINER_FRONT_PIC_STEVEN,
TRAINER_FRONT_PIC_ANABEL,
TRAINER_FRONT_PIC_TUCKER,
TRAINER_FRONT_PIC_SPENSER,
TRAINER_FRONT_PIC_GRETA,
TRAINER_FRONT_PIC_NOLAND,
TRAINER_FRONT_PIC_LUCY,
TRAINER_FRONT_PIC_BRANDON,
TRAINER_FRONT_PIC_RED,
TRAINER_FRONT_PIC_LEAF,
TRAINER_FRONT_PIC_BRENDAN_RS,
TRAINER_FRONT_PIC_MAY_RS
};
#endif // GUARD_TRAINER_FRONT_SPRITES_H

View File

@ -61,11 +61,11 @@ SECTIONS {
src/battle_util.o(.text);
src/battle_script_commands.o(.text);
asm/battle_5.o(.text);
asm/battle_controller_player.o(.text);
src/battle_controller_player.o(.text);
asm/battle_7.o(.text);
asm/battle_controller_opponent.o(.text);
src/battle_controller_opponent.o(.text);
src/battle_ai_switch_items.o(.text);
asm/battle_controller_linkopponent.o(.text);
src/battle_controller_link_opponent.o(.text);
src/pokemon_1.o(.text);
asm/pokemon_1.o(.text);
src/calculate_base_damage.o(.text);
@ -114,7 +114,7 @@ SECTIONS {
src/palette.o(.text);
src/sound.o(.text);
src/battle_anim.o(.text);
asm/rom_80A5C6C.o(.text);
asm/battle_anim_80A5C6C.o(.text);
src/task.o(.text);
src/reshow_battle_screen.o(.text);
asm/battle_anim_80A9C70.o(.text);
@ -180,7 +180,7 @@ SECTIONS {
asm/rom6.o(.text);
asm/battle_records.o(.text);
asm/pokedex_area_screen.o(.text);
asm/evolution_scene.o(.text);
src/evolution_scene.o(.text);
asm/roulette.o(.text);
asm/pokedex_cry_screen.o(.text);
src/coins.o(.text);
@ -188,7 +188,7 @@ SECTIONS {
asm/landmark.o(.text);
asm/fldeff_strength.o(.text);
asm/battle_transition.o(.text);
asm/battle_controller_linkpartner.o(.text);
src/battle_controller_link_partner.o(.text);
src/battle_message.o(.text);
asm/cable_car.o(.text);
asm/math_util.o(.text);
@ -199,7 +199,7 @@ SECTIONS {
asm/field_effect_helpers.o(.text);
asm/contest_ai.o(.text);
asm/battle_anim_sound_tasks.o(.text);
asm/battle_controller_safari.o(.text);
src/battle_controller_safari.o(.text);
asm/fldeff_sweetscent.o(.text);
asm/battle_anim_815A0D4.o(.text);
asm/learn_move.o(.text);
@ -208,7 +208,7 @@ SECTIONS {
src/roamer.o(.text);
asm/battle_tower.o(.text);
asm/use_pokeblock.o(.text);
asm/battle_controller_wally.o(.text);
src/battle_controller_wally.o(.text);
asm/player_pc.o(.text);
asm/intro.o(.text);
src/reset_save_heap.o(.text);
@ -225,14 +225,14 @@ SECTIONS {
asm/pokeblock_feed.o(.text);
src/clear_save_data_screen.o(.text);
asm/intro_credits_graphics.o(.text);
asm/evolution_graphics.o(.text);
src/evolution_graphics.o(.text);
asm/bard_music.o(.text);
asm/fldeff_teleport.o(.text);
asm/battle_link_817C95C.o(.text);
asm/pokemon_animation.o(.text);
asm/recorded_battle.o(.text);
asm/battle_controller_recorded_opponent.o(.text);
asm/battle_controller_recorded_player.o(.text);
src/battle_controller_recorded_opponent.o(.text);
src/battle_controller_recorded_player.o(.text);
src/battle_dome_cards.o(.text);
src/lilycove_lady.o(.text);
asm/battle_frontier_1.o(.text);
@ -250,7 +250,7 @@ SECTIONS {
src/unk_text_util_2.o(.text);
src/multiboot.o(.text);
asm/unk_81BAD84.o(.text);
asm/battle_controller_player_partner.o(.text);
src/battle_controller_player_partner.o(.text);
asm/fldeff_groundshake.o(.text);
asm/fossil_specials.o(.text);
src/berry_fix_program.o(.text);
@ -335,10 +335,10 @@ SECTIONS {
src/battle_2.o(.rodata);
src/battle_util.o(.rodata);
src/battle_script_commands.o(.rodata);
data/battle_controller_player.o(.rodata);
src/battle_controller_player.o(.rodata);
data/smokescreen.o(.rodata);
data/battle_controller_opponent.o(.rodata);
data/battle_controller_link_opponent.o(.rodata);
src/battle_controller_opponent.o(.rodata);
src/battle_controller_link_opponent.o(.rodata);
data/data2c.o(.rodata);
src/trig.o(.rodata);
src/util.o(.rodata);
@ -418,19 +418,19 @@ SECTIONS {
data/contest_painting.o(.rodata);
src/battle_ai_script_commands.o(.rodata);
data/data4.o(.rodata);
data/battle_controller_link_partner.o(.rodata);
src/battle_controller_link_partner.o(.rodata);
src/battle_message.o(.rodata);
data/cable_car.o(.rodata);
data/save.o(.rodata);
data/field_effect_helpers.o(.rodata);
data/contest_ai.o(.rodata);
data/battle_controller_safari.o(.rodata);
src/battle_controller_safari.o(.rodata);
data/battle_anim_815A0D4.o(.rodata);
data/learn_move.o(.rodata);
src/roamer.o(.rodata);
data/battle_tower.o(.rodata);
data/use_pokeblock.o(.rodata);
data/battle_controller_wally.o(.rodata);
src/battle_controller_wally.o(.rodata);
data/player_pc.o(.rodata);
data/intro.o(.rodata);
data/field_region_map.o(.rodata);
@ -447,11 +447,11 @@ SECTIONS {
data/pokeblock_feed.o(.rodata);
src/clear_save_data_screen.o(.rodata);
data/intro_credits_graphics.o(.rodata);
data/evolution_graphics.o(.rodata);
src/evolution_graphics.o(.rodata);
data/bard_music.o(.rodata);
data/data_860A4AC.o(.rodata);
data/battle_controller_recorded_opponent.o(.rodata);
data/battle_controller_recorded_player.o(.rodata);
src/battle_controller_recorded_opponent.o(.rodata);
src/battle_controller_recorded_player.o(.rodata);
src/battle_dome_cards.o(.rodata);
src/lilycove_lady.o(.rodata);
data/battle_frontier_1.o(.rodata);
@ -465,7 +465,7 @@ SECTIONS {
data/battle_tent.o(.rodata);
src/unk_text_util_2.o(.rodata);
data/unk_81BAD84.o(.rodata);
data/battle_controller_player_partner.o(.rodata);
src/battle_controller_player_partner.o(.rodata);
data/fossil_special_fldeff_groundshake.o(.rodata);
src/berry_fix_program.o(.rodata);
data/pokemon_summary_screen.o(.rodata);

View File

@ -85,7 +85,7 @@ extern u16 gTrainerBattleOpponent_B;
extern struct BattleEnigmaBerry gEnigmaBerries[BATTLE_BANKS_COUNT];
extern void (*gPreBattleCallback1)(void);
extern void (*gBattleMainFunc)(void);
extern void (*gUnknown_030061E8)(void);
extern void (*gCB2_AfterEvolution)(void);
extern struct UnknownPokemonStruct2 gUnknown_02022FF8[3]; // what is it used for?
extern struct UnknownPokemonStruct2* gUnknown_02023058; // what is it used for?
extern u8 gUnknown_02039B28[]; // possibly a struct?
@ -238,7 +238,6 @@ static void sub_8038F34(void);
static void sub_80392A8(void);
static void sub_803937C(void);
static void sub_803939C(void);
void oac_poke_opponent(struct Sprite *sprite);
static void sub_803980C(struct Sprite *sprite);
static void sub_8039838(struct Sprite *sprite);
static void sub_8039894(struct Sprite *sprite);
@ -2121,7 +2120,7 @@ static void sub_8038F34(void)
if (sub_800A520() == TRUE)
{
sub_800ADF8();
sub_814F9EC(gText_LinkStandby3, 0);
BattleHandleAddTextPrinter(gText_LinkStandby3, 0);
gBattleCommunication[MULTIUSE_STATE]++;
}
break;
@ -2247,17 +2246,17 @@ static void sub_803939C(void)
case 3:
if (!gPaletteFade.active)
{
sub_814F9EC(gText_RecordBattleToPass, 0);
BattleHandleAddTextPrinter(gText_RecordBattleToPass, 0);
gBattleCommunication[MULTIUSE_STATE]++;
}
break;
case 4:
if (!IsTextPrinterActive(0))
{
sub_8056A3C(0x18, 8, 0x1D, 0xD, 0);
sub_814F9EC(gText_BattleYesNoChoice, 0xC);
HandleBattleWindow(0x18, 8, 0x1D, 0xD, 0);
BattleHandleAddTextPrinter(gText_BattleYesNoChoice, 0xC);
gBattleCommunication[CURSOR_POSITION] = 1;
BattleCreateCursorAt(1);
BattleCreateYesNoCursorAt(1);
gBattleCommunication[MULTIUSE_STATE]++;
}
break;
@ -2267,9 +2266,9 @@ static void sub_803939C(void)
if (gBattleCommunication[CURSOR_POSITION] != 0)
{
PlaySE(SE_SELECT);
BattleDestroyCursorAt(gBattleCommunication[CURSOR_POSITION]);
BattleDestroyYesNoCursorAt(gBattleCommunication[CURSOR_POSITION]);
gBattleCommunication[CURSOR_POSITION] = 0;
BattleCreateCursorAt(0);
BattleCreateYesNoCursorAt(0);
}
}
else if (gMain.newKeys & DPAD_DOWN)
@ -2277,9 +2276,9 @@ static void sub_803939C(void)
if (gBattleCommunication[CURSOR_POSITION] == 0)
{
PlaySE(SE_SELECT);
BattleDestroyCursorAt(gBattleCommunication[CURSOR_POSITION]);
BattleDestroyYesNoCursorAt(gBattleCommunication[CURSOR_POSITION]);
gBattleCommunication[CURSOR_POSITION] = 1;
BattleCreateCursorAt(1);
BattleCreateYesNoCursorAt(1);
}
}
else if (gMain.newKeys & A_BUTTON)
@ -2287,7 +2286,7 @@ static void sub_803939C(void)
PlaySE(SE_SELECT);
if (gBattleCommunication[CURSOR_POSITION] == 0)
{
sub_8056A3C(0x18, 8, 0x1D, 0xD, 1);
HandleBattleWindow(0x18, 8, 0x1D, 0xD, WINDOW_CLEAR);
gBattleCommunication[1] = MoveRecordedBattleToSaveData();
gBattleCommunication[MULTIUSE_STATE] = 10;
}
@ -2305,11 +2304,11 @@ static void sub_803939C(void)
case 6:
if (sub_800A520() == TRUE)
{
sub_8056A3C(0x18, 8, 0x1D, 0xD, 1);
HandleBattleWindow(0x18, 8, 0x1D, 0xD, WINDOW_CLEAR);
if (gMain.field_439_x4)
{
sub_800ADF8();
sub_814F9EC(gText_LinkStandby3, 0);
BattleHandleAddTextPrinter(gText_LinkStandby3, 0);
}
gBattleCommunication[MULTIUSE_STATE]++;
}
@ -2340,14 +2339,14 @@ static void sub_803939C(void)
{
PlaySE(SE_SAVE);
BattleStringExpandPlaceholdersToDisplayedString(gText_BattleRecordedOnPass);
sub_814F9EC(gDisplayedStringBattle, 0);
BattleHandleAddTextPrinter(gDisplayedStringBattle, 0);
gBattleCommunication[1] = 0x80;
gBattleCommunication[MULTIUSE_STATE]++;
}
else
{
BattleStringExpandPlaceholdersToDisplayedString(gText_BattleRecordCouldntBeSaved);
sub_814F9EC(gDisplayedStringBattle, 0);
BattleHandleAddTextPrinter(gDisplayedStringBattle, 0);
gBattleCommunication[1] = 0x80;
gBattleCommunication[MULTIUSE_STATE]++;
}
@ -2358,7 +2357,7 @@ static void sub_803939C(void)
if (gMain.field_439_x4)
{
sub_800ADF8();
sub_814F9EC(gText_LinkStandby3, 0);
BattleHandleAddTextPrinter(gText_LinkStandby3, 0);
}
gBattleCommunication[MULTIUSE_STATE]++;
}
@ -3690,7 +3689,7 @@ static void TryDoEventsBeforeFirstTurn(void)
TurnValuesCleanUp(FALSE);
SpecialStatusesClear();
*(&gBattleStruct->field_91) = gAbsentBankFlags;
sub_814F9EC(gText_EmptyString3, 0);
BattleHandleAddTextPrinter(gText_EmptyString3, 0);
gBattleMainFunc = HandleTurnActionSelectionState;
ResetSentPokesToOpponentValue();
@ -3797,7 +3796,7 @@ void BattleTurnPassed(void)
*(gBattleStruct->field_5C + i) = 6;
*(&gBattleStruct->field_91) = gAbsentBankFlags;
sub_814F9EC(gText_EmptyString3, 0);
BattleHandleAddTextPrinter(gText_EmptyString3, 0);
gBattleMainFunc = HandleTurnActionSelectionState;
gRandomTurnNumber = Random();
@ -4025,7 +4024,7 @@ static void HandleTurnActionSelectionState(void)
}
else
{
EmitOpenBag(0, gBattleStruct->field_60[gActiveBank]);
EmitChooseItem(0, gBattleStruct->field_60[gActiveBank]);
MarkBufferBankForExecution(gActiveBank);
}
break;
@ -4070,7 +4069,7 @@ static void HandleTurnActionSelectionState(void)
}
break;
case ACTION_POKEBLOCK_CASE:
EmitOpenBag(0, gBattleStruct->field_60[gActiveBank]);
EmitChooseItem(0, gBattleStruct->field_60[gActiveBank]);
MarkBufferBankForExecution(gActiveBank);
break;
case ACTION_CANCEL_PARTNER:
@ -4939,7 +4938,7 @@ static void HandleEndTurn_FinishBattle(void)
BeginFastPaletteFade(3);
FadeOutMapMusic(5);
gBattleMainFunc = FreeResetData_ReturnToOvOrDoEvolutions;
gUnknown_030061E8 = BattleMainCB2;
gCB2_AfterEvolution = BattleMainCB2;
}
else
{

View File

@ -39,7 +39,7 @@ static bool8 ShouldSwitchIfPerishSong(void)
&& gDisableStructs[gActiveBank].perishSong1 == 0)
{
*(gBattleStruct->field_294 + gActiveBank) = 6;
EmitCmd33(1, 2, 0);
EmitTwoReturnValues(1, ACTION_SWITCH, 0);
return TRUE;
}
@ -121,7 +121,7 @@ static bool8 ShouldSwitchIfWonderGuard(void)
{
// we found a mon
*(gBattleStruct->field_294 + gActiveBank) = i;
EmitCmd33(1, 2, 0);
EmitTwoReturnValues(1, ACTION_SWITCH, 0);
return TRUE;
}
}
@ -221,7 +221,7 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void)
{
// we found a mon
*(gBattleStruct->field_294 + gActiveBank) = i;
EmitCmd33(1, 2, 0);
EmitTwoReturnValues(1, ACTION_SWITCH, 0);
return TRUE;
}
}
@ -241,13 +241,13 @@ static bool8 ShouldSwitchIfNaturalCure(void)
if ((gUnknown_02024250[gActiveBank] == 0 || gUnknown_02024250[gActiveBank] == 0xFFFF) && Random() & 1)
{
*(gBattleStruct->field_294 + gActiveBank) = 6;
EmitCmd33(1, 2, 0);
EmitTwoReturnValues(1, ACTION_SWITCH, 0);
return TRUE;
}
else if (gBattleMoves[gUnknown_02024250[gActiveBank]].power == 0 && Random() & 1)
{
*(gBattleStruct->field_294 + gActiveBank) = 6;
EmitCmd33(1, 2, 0);
EmitTwoReturnValues(1, ACTION_SWITCH, 0);
return TRUE;
}
@ -258,7 +258,7 @@ static bool8 ShouldSwitchIfNaturalCure(void)
if (Random() & 1)
{
*(gBattleStruct->field_294 + gActiveBank) = 6;
EmitCmd33(1, 2, 0);
EmitTwoReturnValues(1, ACTION_SWITCH, 0);
return TRUE;
}
@ -426,7 +426,7 @@ static bool8 FindMonWithFlagsAndSuperEffective(u8 flags, u8 moduloPercent)
if (moveFlags & MOVESTATUS_SUPEREFFECTIVE && Random() % moduloPercent == 0)
{
*(gBattleStruct->field_294 + gActiveBank) = i;
EmitCmd33(1, 2, 0);
EmitTwoReturnValues(1, ACTION_SWITCH, 0);
return TRUE;
}
}
@ -611,7 +611,7 @@ void AI_TrySwitchOrUseItem(void)
}
}
EmitCmd33(1, 0, (gActiveBank ^ BIT_SIDE) << 8);
EmitTwoReturnValues(1, ACTION_USE_MOVE, (gActiveBank ^ BIT_SIDE) << 8);
}
#define TYPE_FORESIGHT 0xFE
@ -940,8 +940,8 @@ static bool8 ShouldUseItem(void)
if (shouldUse)
{
EmitCmd33(1, 1, 0);
*(gBattleStruct->field_C0 + (gActiveBank / 2) * 2) = item;
EmitTwoReturnValues(1, ACTION_USE_ITEM, 0);
*(gBattleStruct->chosenItem + (gActiveBank / 2) * 2) = item;
gBattleResources->battleHistory->trainerItems[i] = 0;
return shouldUse;
}

View File

@ -47,18 +47,6 @@ extern const struct CompressedSpriteSheet gBattleAnimPicTable[];
extern const struct CompressedSpritePalette gBattleAnimPaletteTable[];
extern const struct BattleAnimBackground gBattleAnimBackgroundTable[];
extern void sub_80A8278(void); // rom_80A5C6C.s
extern void sub_80A6B30(struct UnknownAnimStruct2*); // rom_80A5C6C.s
extern void sub_80A6B90(struct UnknownAnimStruct2*, u32 arg1); // rom_80A5C6C.s
extern u8 sub_80A82E4(u8 bank); // rom_80A5C6C.s
extern u8 sub_80A5C6C(u8 bank, u8 attributeId); // rom_80A5C6C.s
extern bool8 AnimBankSpriteExists(u8 bank); // rom_80A5C6C.s
extern void sub_80A6C68(u8 arg0); // rom_80A5C6C.s
extern u8 GetAnimBankSpriteId(u8 wantedBank); // rom_80A5C6C.s
extern u8 sub_80A6D94(void);
extern u8 sub_80A8364(u8);
extern bool8 IsDoubleBattle(void);
// this file's functions
static void ScriptCmd_loadspritegfx(void);
static void ScriptCmd_unloadspritegfx(void);
@ -234,10 +222,10 @@ void DoMoveAnim(u16 move)
{
gAnimBankAttacker = gBankAttacker;
gAnimBankTarget = gBankTarget;
DoBattleAnim(gBattleAnims_Moves, move, TRUE);
LaunchBattleAnimation(gBattleAnims_Moves, move, TRUE);
}
void DoBattleAnim(const u8 *const animsTable[], u16 tableId, bool8 isMoveAnim)
void LaunchBattleAnimation(const u8 *const animsTable[], u16 tableId, bool8 isMoveAnim)
{
s32 i;
@ -672,7 +660,7 @@ bool8 IsAnimBankSpriteVisible(u8 bank)
else
return FALSE;
}
if (!AnimBankSpriteExists(bank))
if (!IsBankSpritePresent(bank))
return FALSE;
if (IsContest())
return TRUE; // this line wont ever be reached.
@ -1281,7 +1269,7 @@ static void ScriptCmd_changebg(void)
s8 BattleAnimAdjustPanning(s8 pan)
{
if (!IsContest() && gBattleSpritesDataPtr->healthBoxesData[gAnimBankAttacker].flag_x10)
if (!IsContest() && gBattleSpritesDataPtr->healthBoxesData[gAnimBankAttacker].statusAnimActive)
{
if (GetBankSide(gAnimBankAttacker) != SIDE_PLAYER)
pan = PAN_SIDE_OPPONENT;
@ -1323,7 +1311,7 @@ s8 BattleAnimAdjustPanning(s8 pan)
s8 BattleAnimAdjustPanning2(s8 pan)
{
if (!IsContest() && gBattleSpritesDataPtr->healthBoxesData[gAnimBankAttacker].flag_x10)
if (!IsContest() && gBattleSpritesDataPtr->healthBoxesData[gAnimBankAttacker].statusAnimActive)
{
if (GetBankSide(gAnimBankAttacker) != SIDE_PLAYER)
pan = PAN_SIDE_OPPONENT;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,714 @@
#include "global.h"
#include "battle.h"
#include "battle_controllers.h"
#include "battle_message.h"
#include "battle_interface.h"
#include "battle_anim.h"
#include "pokemon.h"
#include "link.h"
#include "util.h"
#include "main.h"
#include "songs.h"
#include "sound.h"
#include "window.h"
#include "m4a.h"
#include "palette.h"
#include "task.h"
#include "text.h"
#include "bg.h"
#include "reshow_battle_screen.h"
#include "pokeball.h"
#include "data2.h"
extern u32 gBattleExecBuffer;
extern u8 gActiveBank;
extern u8 gBankSpriteIds[BATTLE_BANKS_COUNT];
extern u8 gActionSelectionCursor[BATTLE_BANKS_COUNT];
extern u8 gNoOfAllBanks;
extern bool8 gDoingBattleAnim;
extern void (*gBattleBankFunc[BATTLE_BANKS_COUNT])(void);
extern void (*gPreBattleCallback1)(void);
extern u16 gBattlePartyID[BATTLE_BANKS_COUNT];
extern u8 gBattleBufferA[BATTLE_BANKS_COUNT][0x200];
extern u8 gBattleBufferB[BATTLE_BANKS_COUNT][0x200];
extern struct BattlePokemon gBattleMons[BATTLE_BANKS_COUNT];
extern struct SpriteTemplate gUnknown_0202499C;
extern u16 gScriptItemId;
extern u8 gHealthBoxesIds[BATTLE_BANKS_COUNT];
extern u8 gBattleOutcome;
extern u16 gBattle_BG0_X;
extern u16 gBattle_BG0_Y;
extern u8 gBankInMenu;
extern u16 gUnknown_020243FC;
extern const struct CompressedSpritePalette gTrainerBackPicPaletteTable[];
extern const u8 gText_SafariZoneMenu[];
extern const u8 gText_WhatWillPkmnDo2[];
extern void sub_81358F4(void);
// this file's functions
static void SafariHandleGetMonData(void);
static void SafariHandleGetRawMonData(void);
static void SafariHandleSetMonData(void);
static void SafariHandleSetRawMonData(void);
static void SafariHandleLoadMonSprite(void);
static void SafariHandleSwitchInAnim(void);
static void SafariHandleReturnMonToBall(void);
static void SafariHandleDrawTrainerPic(void);
static void SafariHandleTrainerSlide(void);
static void SafariHandleTrainerSlideBack(void);
static void SafariHandleFaintAnimation(void);
static void SafariHandlePaletteFade(void);
static void SafariHandleSuccessBallThrowAnim(void);
static void SafariHandleBallThrowAnim(void);
static void SafariHandlePause(void);
static void SafariHandleMoveAnimation(void);
static void SafariHandlePrintString(void);
static void SafariHandlePrintStringPlayerOnly(void);
static void SafariHandleChooseAction(void);
static void SafariHandleUnknownYesNoBox(void);
static void SafariHandleChooseMove(void);
static void SafariHandleChooseItem(void);
static void SafariHandleChoosePokemon(void);
static void SafariHandleCmd23(void);
static void SafariHandleHealthBarUpdate(void);
static void SafariHandleExpUpdate(void);
static void SafariHandleStatusIconUpdate(void);
static void SafariHandleStatusAnimation(void);
static void SafariHandleStatusXor(void);
static void SafariHandleDataTransfer(void);
static void SafariHandleDMA3Transfer(void);
static void SafariHandlePlayBGM(void);
static void SafariHandleCmd32(void);
static void SafariHandleTwoReturnValues(void);
static void SafariHandleChosenMonReturnValue(void);
static void SafariHandleOneReturnValue(void);
static void SafariHandleOneReturnValue_Duplicate(void);
static void SafariHandleCmd37(void);
static void SafariHandleCmd38(void);
static void SafariHandleCmd39(void);
static void SafariHandleCmd40(void);
static void SafariHandleHitAnimation(void);
static void SafariHandleCmd42(void);
static void SafariHandleEffectivenessSound(void);
static void SafariHandlePlayFanfareOrBGM(void);
static void SafariHandleFaintingCry(void);
static void SafariHandleIntroSlide(void);
static void SafariHandleIntroTrainerBallThrow(void);
static void SafariHandleDrawPartyStatusSummary(void);
static void SafariHandleCmd49(void);
static void SafariHandleCmd50(void);
static void SafariHandleSpriteInvisibility(void);
static void SafariHandleBattleAnimation(void);
static void SafariHandleLinkStandbyMsg(void);
static void SafariHandleResetActionMoveSelection(void);
static void SafariHandleCmd55(void);
static void nullsub_115(void);
static void SafariBufferRunCommand(void);
static void SafariBufferExecCompleted(void);
static void CompleteWhenChosePokeblock(void);
static void (*const sSafariBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
{
SafariHandleGetMonData,
SafariHandleGetRawMonData,
SafariHandleSetMonData,
SafariHandleSetRawMonData,
SafariHandleLoadMonSprite,
SafariHandleSwitchInAnim,
SafariHandleReturnMonToBall,
SafariHandleDrawTrainerPic,
SafariHandleTrainerSlide,
SafariHandleTrainerSlideBack,
SafariHandleFaintAnimation,
SafariHandlePaletteFade,
SafariHandleSuccessBallThrowAnim,
SafariHandleBallThrowAnim,
SafariHandlePause,
SafariHandleMoveAnimation,
SafariHandlePrintString,
SafariHandlePrintStringPlayerOnly,
SafariHandleChooseAction,
SafariHandleUnknownYesNoBox,
SafariHandleChooseMove,
SafariHandleChooseItem,
SafariHandleChoosePokemon,
SafariHandleCmd23,
SafariHandleHealthBarUpdate,
SafariHandleExpUpdate,
SafariHandleStatusIconUpdate,
SafariHandleStatusAnimation,
SafariHandleStatusXor,
SafariHandleDataTransfer,
SafariHandleDMA3Transfer,
SafariHandlePlayBGM,
SafariHandleCmd32,
SafariHandleTwoReturnValues,
SafariHandleChosenMonReturnValue,
SafariHandleOneReturnValue,
SafariHandleOneReturnValue_Duplicate,
SafariHandleCmd37,
SafariHandleCmd38,
SafariHandleCmd39,
SafariHandleCmd40,
SafariHandleHitAnimation,
SafariHandleCmd42,
SafariHandleEffectivenessSound,
SafariHandlePlayFanfareOrBGM,
SafariHandleFaintingCry,
SafariHandleIntroSlide,
SafariHandleIntroTrainerBallThrow,
SafariHandleDrawPartyStatusSummary,
SafariHandleCmd49,
SafariHandleCmd50,
SafariHandleSpriteInvisibility,
SafariHandleBattleAnimation,
SafariHandleLinkStandbyMsg,
SafariHandleResetActionMoveSelection,
SafariHandleCmd55,
nullsub_115
};
static void nullsub_114(void)
{
}
void SetControllerToSafari(void)
{
gBattleBankFunc[gActiveBank] = SafariBufferRunCommand;
}
static void SafariBufferRunCommand(void)
{
if (gBattleExecBuffer & gBitTable[gActiveBank])
{
if (gBattleBufferA[gActiveBank][0] < ARRAY_COUNT(sSafariBufferCommands))
sSafariBufferCommands[gBattleBufferA[gActiveBank][0]]();
else
SafariBufferExecCompleted();
}
}
static void HandleInputChooseAction(void)
{
if (gMain.newKeys & A_BUTTON)
{
PlaySE(SE_SELECT);
switch (gActionSelectionCursor[gActiveBank])
{
case 0:
EmitTwoReturnValues(1, ACTION_SAFARI_ZONE_BALL, 0);
break;
case 1:
EmitTwoReturnValues(1, ACTION_POKEBLOCK_CASE, 0);
break;
case 2:
EmitTwoReturnValues(1, ACTION_GO_NEAR, 0);
break;
case 3:
EmitTwoReturnValues(1, ACTION_SAFARI_ZONE_RUN, 0);
break;
}
SafariBufferExecCompleted();
}
else if (gMain.newKeys & DPAD_LEFT)
{
if (gActionSelectionCursor[gActiveBank] & 1)
{
PlaySE(SE_SELECT);
ActionSelectionDestroyCursorAt(gActionSelectionCursor[gActiveBank]);
gActionSelectionCursor[gActiveBank] ^= 1;
ActionSelectionCreateCursorAt(gActionSelectionCursor[gActiveBank], 0);
}
}
else if (gMain.newKeys & DPAD_RIGHT)
{
if (!(gActionSelectionCursor[gActiveBank] & 1))
{
PlaySE(SE_SELECT);
ActionSelectionDestroyCursorAt(gActionSelectionCursor[gActiveBank]);
gActionSelectionCursor[gActiveBank] ^= 1;
ActionSelectionCreateCursorAt(gActionSelectionCursor[gActiveBank], 0);
}
}
else if (gMain.newKeys & DPAD_UP)
{
if (gActionSelectionCursor[gActiveBank] & 2)
{
PlaySE(SE_SELECT);
ActionSelectionDestroyCursorAt(gActionSelectionCursor[gActiveBank]);
gActionSelectionCursor[gActiveBank] ^= 2;
ActionSelectionCreateCursorAt(gActionSelectionCursor[gActiveBank], 0);
}
}
else if (gMain.newKeys & DPAD_DOWN)
{
if (!(gActionSelectionCursor[gActiveBank] & 2))
{
PlaySE(SE_SELECT);
ActionSelectionDestroyCursorAt(gActionSelectionCursor[gActiveBank]);
gActionSelectionCursor[gActiveBank] ^= 2;
ActionSelectionCreateCursorAt(gActionSelectionCursor[gActiveBank], 0);
}
}
}
static void CompleteOnBankSpriteCallbackDummy(void)
{
if (gSprites[gBankSpriteIds[gActiveBank]].callback == SpriteCallbackDummy)
SafariBufferExecCompleted();
}
static void CompleteOnInactiveTextPrinter(void)
{
if (!IsTextPrinterActive(0))
SafariBufferExecCompleted();
}
static void CompleteOnHealthboxSpriteCallbackDummy(void)
{
if (gSprites[gHealthBoxesIds[gActiveBank]].callback == SpriteCallbackDummy)
SafariBufferExecCompleted();
}
static void sub_81595E4(void)
{
if (!gPaletteFade.active)
{
gMain.inBattle = FALSE;
gMain.callback1 = gPreBattleCallback1;
SetMainCallback2(gMain.savedCallback);
}
}
static void CompleteOnSpecialAnimDone(void)
{
if (!gDoingBattleAnim || !gBattleSpritesDataPtr->healthBoxesData[gActiveBank].specialAnimActive)
SafariBufferExecCompleted();
}
static void OpenPokeblockCase(void)
{
if (!gPaletteFade.active)
{
gBattleBankFunc[gActiveBank] = CompleteWhenChosePokeblock;
FreeAllWindowBuffers();
sub_81358F4();
}
}
static void CompleteWhenChosePokeblock(void)
{
if (gMain.callback2 == BattleMainCB2 && !gPaletteFade.active)
{
EmitOneReturnValue(1, gScriptItemId);
SafariBufferExecCompleted();
}
}
static void CompleteOnFinishedBattleAnimation(void)
{
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animFromTableActive)
SafariBufferExecCompleted();
}
static void SafariBufferExecCompleted(void)
{
gBattleBankFunc[gActiveBank] = SafariBufferRunCommand;
if (gBattleTypeFlags & BATTLE_TYPE_LINK)
{
u8 playerId = GetMultiplayerId();
PrepareBufferDataTransferLink(2, 4, &playerId);
gBattleBufferA[gActiveBank][0] = CONTROLLER_TERMINATOR_NOP;
}
else
{
gBattleExecBuffer &= ~gBitTable[gActiveBank];
}
}
static void CompleteOnFinishedStatusAnimation(void)
{
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].statusAnimActive)
SafariBufferExecCompleted();
}
static void SafariHandleGetMonData(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleGetRawMonData(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleSetMonData(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleSetRawMonData(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleLoadMonSprite(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleSwitchInAnim(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleReturnMonToBall(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleDrawTrainerPic(void)
{
DecompressTrainerBackPic(gSaveBlock2Ptr->playerGender, gActiveBank);
sub_806A12C(gSaveBlock2Ptr->playerGender, GetBankIdentity(gActiveBank));
gBankSpriteIds[gActiveBank] = CreateSprite(
&gUnknown_0202499C,
80,
(8 - gTrainerBackPicCoords[gSaveBlock2Ptr->playerGender].coords) * 4 + 80,
30);
gSprites[gBankSpriteIds[gActiveBank]].oam.paletteNum = gActiveBank;
gSprites[gBankSpriteIds[gActiveBank]].pos2.x = 240;
gSprites[gBankSpriteIds[gActiveBank]].data0 = -2;
gSprites[gBankSpriteIds[gActiveBank]].callback = sub_805D7AC;
gBattleBankFunc[gActiveBank] = CompleteOnBankSpriteCallbackDummy;
}
static void SafariHandleTrainerSlide(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleTrainerSlideBack(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleFaintAnimation(void)
{
SafariBufferExecCompleted();
}
static void SafariHandlePaletteFade(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleSuccessBallThrowAnim(void)
{
gBattleSpritesDataPtr->animationData->ballThrowCaseId = BALL_3_SHAKES_SUCCESS;
gDoingBattleAnim = TRUE;
DoSpecialBattleAnimation(gActiveBank, gActiveBank, GetBankByIdentity(IDENTITY_OPPONENT_MON1), B_ANIM_SAFARI_BALL_THROW);
gBattleBankFunc[gActiveBank] = CompleteOnSpecialAnimDone;
}
static void SafariHandleBallThrowAnim(void)
{
u8 ballThrowCaseId = gBattleBufferA[gActiveBank][1];
gBattleSpritesDataPtr->animationData->ballThrowCaseId = ballThrowCaseId;
gDoingBattleAnim = TRUE;
DoSpecialBattleAnimation(gActiveBank, gActiveBank, GetBankByIdentity(IDENTITY_OPPONENT_MON1), B_ANIM_SAFARI_BALL_THROW);
gBattleBankFunc[gActiveBank] = CompleteOnSpecialAnimDone;
}
static void SafariHandlePause(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleMoveAnimation(void)
{
SafariBufferExecCompleted();
}
static void SafariHandlePrintString(void)
{
u16 *stringId;
gBattle_BG0_X = 0;
gBattle_BG0_Y = 0;
stringId = (u16*)(&gBattleBufferA[gActiveBank][2]);
BufferStringBattle(*stringId);
BattleHandleAddTextPrinter(gDisplayedStringBattle, 0);
gBattleBankFunc[gActiveBank] = CompleteOnInactiveTextPrinter;
}
static void SafariHandlePrintStringPlayerOnly(void)
{
if (GetBankSide(gActiveBank) == SIDE_PLAYER)
SafariHandlePrintString();
else
SafariBufferExecCompleted();
}
static void HandleChooseActionAfterDma3(void)
{
if (!IsDma3ManagerBusyWithBgCopy())
{
gBattle_BG0_X = 0;
gBattle_BG0_Y = 160;
gBattleBankFunc[gActiveBank] = HandleInputChooseAction;
}
}
static void SafariHandleChooseAction(void)
{
s32 i;
gBattleBankFunc[gActiveBank] = HandleChooseActionAfterDma3;
BattleHandleAddTextPrinter(gText_SafariZoneMenu, 2);
for (i = 0; i < 4; i++)
ActionSelectionDestroyCursorAt(i);
ActionSelectionCreateCursorAt(gActionSelectionCursor[gActiveBank], 0);
BattleStringExpandPlaceholdersToDisplayedString(gText_WhatWillPkmnDo2);
BattleHandleAddTextPrinter(gDisplayedStringBattle, 1);
}
static void SafariHandleUnknownYesNoBox(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleChooseMove(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleChooseItem(void)
{
s32 i;
BeginNormalPaletteFade(-1, 0, 0, 0x10, 0);
gBattleBankFunc[gActiveBank] = OpenPokeblockCase;
gBankInMenu = gActiveBank;
}
static void SafariHandleChoosePokemon(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleCmd23(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleHealthBarUpdate(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleExpUpdate(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleStatusIconUpdate(void)
{
UpdateHealthboxAttribute(gHealthBoxesIds[gActiveBank], &gPlayerParty[gBattlePartyID[gActiveBank]], HEALTHBOX_SAFARI_BALLS_TEXT);
SafariBufferExecCompleted();
}
static void SafariHandleStatusAnimation(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleStatusXor(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleDataTransfer(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleDMA3Transfer(void)
{
SafariBufferExecCompleted();
}
static void SafariHandlePlayBGM(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleCmd32(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleTwoReturnValues(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleChosenMonReturnValue(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleOneReturnValue(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleOneReturnValue_Duplicate(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleCmd37(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleCmd38(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleCmd39(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleCmd40(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleHitAnimation(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleCmd42(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleEffectivenessSound(void)
{
s8 pan;
if (GetBankSide(gActiveBank) == SIDE_PLAYER)
pan = PAN_SIDE_PLAYER;
else
pan = PAN_SIDE_OPPONENT;
PlaySE12WithPanning(gBattleBufferA[gActiveBank][1] | (gBattleBufferA[gActiveBank][2] << 8), pan);
SafariBufferExecCompleted();
}
static void SafariHandlePlayFanfareOrBGM(void)
{
if (gBattleBufferA[gActiveBank][3])
{
BattleMusicStop();
PlayBGM(gBattleBufferA[gActiveBank][1] | (gBattleBufferA[gActiveBank][2] << 8));
}
else
{
PlayFanfare(gBattleBufferA[gActiveBank][1] | (gBattleBufferA[gActiveBank][2] << 8));
}
SafariBufferExecCompleted();
}
static void SafariHandleFaintingCry(void)
{
u16 species = GetMonData(&gPlayerParty[gBattlePartyID[gActiveBank]], MON_DATA_SPECIES);
PlayCry1(species, 25);
SafariBufferExecCompleted();
}
static void SafariHandleIntroSlide(void)
{
HandleIntroSlide(gBattleBufferA[gActiveBank][1]);
gUnknown_020243FC |= 1;
SafariBufferExecCompleted();
}
static void SafariHandleIntroTrainerBallThrow(void)
{
UpdateHealthboxAttribute(gHealthBoxesIds[gActiveBank], &gPlayerParty[gBattlePartyID[gActiveBank]], HEALTHBOX_SAFARI_ALL_TEXT);
sub_8076918(gActiveBank);
SetHealthboxSpriteVisible(gHealthBoxesIds[gActiveBank]);
gBattleBankFunc[gActiveBank] = CompleteOnHealthboxSpriteCallbackDummy;
}
static void SafariHandleDrawPartyStatusSummary(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleCmd49(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleCmd50(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleSpriteInvisibility(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleBattleAnimation(void)
{
u8 animationId = gBattleBufferA[gActiveBank][1];
u16 argument = gBattleBufferA[gActiveBank][2] | (gBattleBufferA[gActiveBank][3] << 8);
if (DoBattleAnimationFromTable(gActiveBank, gActiveBank, gActiveBank, animationId, argument))
SafariBufferExecCompleted();
else
gBattleBankFunc[gActiveBank] = CompleteOnFinishedBattleAnimation;
}
static void SafariHandleLinkStandbyMsg(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleResetActionMoveSelection(void)
{
SafariBufferExecCompleted();
}
static void SafariHandleCmd55(void)
{
gBattleOutcome = gBattleBufferA[gActiveBank][1];
FadeOutMapMusic(5);
BeginFastPaletteFade(3);
SafariBufferExecCompleted();
if ((gBattleTypeFlags & BATTLE_TYPE_LINK) && !(gBattleTypeFlags & BATTLE_TYPE_WILD))
gBattleBankFunc[gActiveBank] = sub_81595E4;
}
static void nullsub_115(void)
{
}

File diff suppressed because it is too large Load Diff

View File

@ -145,30 +145,30 @@ static void SetControllersVariables(void)
if (gBattleTypeFlags & BATTLE_TYPE_RECORDED)
{
gBattleBankFunc[0] = SetBankFuncToRecordedPlayerBufferRunCommand;
gBattleBankFunc[0] = SetControllerToRecordedPlayer;
gBanksByIdentity[0] = IDENTITY_PLAYER_MON1;
gBattleBankFunc[1] = SetBankFuncToOpponentBufferRunCommand;
gBattleBankFunc[1] = SetControllerToOpponent;
gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1;
gBattleBankFunc[2] = SetBankFuncToPlayerPartnerBufferRunCommand;
gBattleBankFunc[2] = SetControllerToPlayerPartner;
gBanksByIdentity[2] = IDENTITY_PLAYER_MON2;
gBattleBankFunc[3] = SetBankFuncToOpponentBufferRunCommand;
gBattleBankFunc[3] = SetControllerToOpponent;
gBanksByIdentity[3] = IDENTITY_OPPONENT_MON2;
}
else
{
gBattleBankFunc[0] = SetBankFuncToPlayerBufferRunCommand;
gBattleBankFunc[0] = SetControllerToPlayer;
gBanksByIdentity[0] = IDENTITY_PLAYER_MON1;
gBattleBankFunc[1] = SetBankFuncToOpponentBufferRunCommand;
gBattleBankFunc[1] = SetControllerToOpponent;
gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1;
gBattleBankFunc[2] = SetBankFuncToPlayerPartnerBufferRunCommand;
gBattleBankFunc[2] = SetControllerToPlayerPartner;
gBanksByIdentity[2] = IDENTITY_PLAYER_MON2;
gBattleBankFunc[3] = SetBankFuncToOpponentBufferRunCommand;
gBattleBankFunc[3] = SetControllerToOpponent;
gBanksByIdentity[3] = IDENTITY_OPPONENT_MON2;
}
@ -189,15 +189,15 @@ static void SetControllersVariables(void)
gBattleMainFunc = BeginBattleIntro;
if (gBattleTypeFlags & BATTLE_TYPE_SAFARI)
gBattleBankFunc[0] = SetBankFuncToSafariBufferRunCommand;
gBattleBankFunc[0] = SetControllerToSafari;
else if (gBattleTypeFlags & BATTLE_TYPE_WALLY_TUTORIAL)
gBattleBankFunc[0] = SetBankFuncToWallyBufferRunCommand;
gBattleBankFunc[0] = SetControllerToWally;
else
gBattleBankFunc[0] = SetBankFuncToPlayerBufferRunCommand;
gBattleBankFunc[0] = SetControllerToPlayer;
gBanksByIdentity[0] = IDENTITY_PLAYER_MON1;
gBattleBankFunc[1] = SetBankFuncToOpponentBufferRunCommand;
gBattleBankFunc[1] = SetControllerToOpponent;
gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1;
gNoOfAllBanks = 2;
@ -210,20 +210,20 @@ static void SetControllersVariables(void)
{
gBattleMainFunc = BeginBattleIntro;
gBattleBankFunc[0] = SetBankFuncToRecordedPlayerBufferRunCommand;
gBattleBankFunc[0] = SetControllerToRecordedPlayer;
gBanksByIdentity[0] = IDENTITY_PLAYER_MON1;
gBattleBankFunc[1] = SetBankFuncToRecordedOpponentBufferRunCommand;
gBattleBankFunc[1] = SetControllerToRecordedOpponent;
gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1;
gNoOfAllBanks = 2;
}
else // see how the banks are switched
{
gBattleBankFunc[1] = SetBankFuncToRecordedPlayerBufferRunCommand;
gBattleBankFunc[1] = SetControllerToRecordedPlayer;
gBanksByIdentity[1] = IDENTITY_PLAYER_MON1;
gBattleBankFunc[0] = SetBankFuncToRecordedOpponentBufferRunCommand;
gBattleBankFunc[0] = SetControllerToRecordedOpponent;
gBanksByIdentity[0] = IDENTITY_OPPONENT_MON1;
gNoOfAllBanks = 2;
@ -231,10 +231,10 @@ static void SetControllersVariables(void)
}
else
{
gBattleBankFunc[0] = SetBankFuncToRecordedPlayerBufferRunCommand;
gBattleBankFunc[0] = SetControllerToRecordedPlayer;
gBanksByIdentity[0] = IDENTITY_PLAYER_MON1;
gBattleBankFunc[1] = SetBankFuncToOpponentBufferRunCommand;
gBattleBankFunc[1] = SetControllerToOpponent;
gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1;
}
}
@ -243,16 +243,16 @@ static void SetControllersVariables(void)
{
gBattleMainFunc = BeginBattleIntro;
gBattleBankFunc[0] = SetBankFuncToPlayerBufferRunCommand;
gBattleBankFunc[0] = SetControllerToPlayer;
gBanksByIdentity[0] = IDENTITY_PLAYER_MON1;
gBattleBankFunc[1] = SetBankFuncToOpponentBufferRunCommand;
gBattleBankFunc[1] = SetControllerToOpponent;
gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1;
gBattleBankFunc[2] = SetBankFuncToPlayerBufferRunCommand;
gBattleBankFunc[2] = SetControllerToPlayer;
gBanksByIdentity[2] = IDENTITY_PLAYER_MON2;
gBattleBankFunc[3] = SetBankFuncToOpponentBufferRunCommand;
gBattleBankFunc[3] = SetControllerToOpponent;
gBanksByIdentity[3] = IDENTITY_OPPONENT_MON2;
gNoOfAllBanks = 4;
@ -263,16 +263,16 @@ static void SetControllersVariables(void)
{
gBattleMainFunc = BeginBattleIntro;
gBattleBankFunc[0] = SetBankFuncToRecordedPlayerBufferRunCommand;
gBattleBankFunc[0] = SetControllerToRecordedPlayer;
gBanksByIdentity[0] = 0;
gBattleBankFunc[1] = SetBankFuncToOpponentBufferRunCommand;
gBattleBankFunc[1] = SetControllerToOpponent;
gBanksByIdentity[1] = 1;
gBattleBankFunc[2] = SetBankFuncToRecordedPlayerBufferRunCommand;
gBattleBankFunc[2] = SetControllerToRecordedPlayer;
gBanksByIdentity[2] = 2;
gBattleBankFunc[3] = SetBankFuncToOpponentBufferRunCommand;
gBattleBankFunc[3] = SetControllerToOpponent;
gBanksByIdentity[3] = 3;
gNoOfAllBanks = 4;
@ -307,7 +307,7 @@ static void SetControllersVariables(void)
if (i == var)
{
gBattleBankFunc[gLinkPlayers[i].lp_field_18] = SetBankFuncToRecordedPlayerBufferRunCommand;
gBattleBankFunc[gLinkPlayers[i].lp_field_18] = SetControllerToRecordedPlayer;
switch (gLinkPlayers[i].lp_field_18)
{
case 0:
@ -325,7 +325,7 @@ static void SetControllersVariables(void)
else if ((!(gLinkPlayers[i].lp_field_18 & 1) && !(gLinkPlayers[var].lp_field_18 & 1))
|| ((gLinkPlayers[i].lp_field_18 & 1) && (gLinkPlayers[var].lp_field_18 & 1)))
{
gBattleBankFunc[gLinkPlayers[i].lp_field_18] = SetBankFuncToRecordedPlayerBufferRunCommand;
gBattleBankFunc[gLinkPlayers[i].lp_field_18] = SetControllerToRecordedPlayer;
switch (gLinkPlayers[i].lp_field_18)
{
case 0:
@ -342,7 +342,7 @@ static void SetControllersVariables(void)
}
else
{
gBattleBankFunc[gLinkPlayers[i].lp_field_18] = SetBankFuncToRecordedOpponentBufferRunCommand;
gBattleBankFunc[gLinkPlayers[i].lp_field_18] = SetControllerToRecordedOpponent;
switch (gLinkPlayers[i].lp_field_18)
{
case 0:
@ -361,51 +361,51 @@ static void SetControllersVariables(void)
}
else if (gBattleTypeFlags & BATTLE_TYPE_WILD)
{
gBattleBankFunc[0] = SetBankFuncToRecordedPlayerBufferRunCommand;
gBattleBankFunc[0] = SetControllerToRecordedPlayer;
gBanksByIdentity[0] = IDENTITY_PLAYER_MON1;
gBattleBankFunc[2] = SetBankFuncToRecordedPlayerBufferRunCommand;
gBattleBankFunc[2] = SetControllerToRecordedPlayer;
gBanksByIdentity[2] = IDENTITY_PLAYER_MON2;
if (gBattleTypeFlags & BATTLE_TYPE_x2000000)
{
gBattleBankFunc[1] = SetBankFuncToRecordedOpponentBufferRunCommand;
gBattleBankFunc[1] = SetControllerToRecordedOpponent;
gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1;
gBattleBankFunc[3] = SetBankFuncToRecordedOpponentBufferRunCommand;
gBattleBankFunc[3] = SetControllerToRecordedOpponent;
gBanksByIdentity[3] = IDENTITY_OPPONENT_MON2;
}
else
{
gBattleBankFunc[1] = SetBankFuncToOpponentBufferRunCommand;
gBattleBankFunc[1] = SetControllerToOpponent;
gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1;
gBattleBankFunc[3] = SetBankFuncToOpponentBufferRunCommand;
gBattleBankFunc[3] = SetControllerToOpponent;
gBanksByIdentity[3] = IDENTITY_OPPONENT_MON2;
}
}
else
{
gBattleBankFunc[1] = SetBankFuncToRecordedPlayerBufferRunCommand;
gBattleBankFunc[1] = SetControllerToRecordedPlayer;
gBanksByIdentity[1] = IDENTITY_PLAYER_MON1;
gBattleBankFunc[3] = SetBankFuncToRecordedPlayerBufferRunCommand;
gBattleBankFunc[3] = SetControllerToRecordedPlayer;
gBanksByIdentity[3] = IDENTITY_PLAYER_MON2;
if (gBattleTypeFlags & BATTLE_TYPE_x2000000)
{
gBattleBankFunc[0] = SetBankFuncToRecordedOpponentBufferRunCommand;
gBattleBankFunc[0] = SetControllerToRecordedOpponent;
gBanksByIdentity[0] = IDENTITY_OPPONENT_MON1;
gBattleBankFunc[2] = SetBankFuncToRecordedOpponentBufferRunCommand;
gBattleBankFunc[2] = SetControllerToRecordedOpponent;
gBanksByIdentity[2] = IDENTITY_OPPONENT_MON2;
}
else
{
gBattleBankFunc[0] = SetBankFuncToOpponentBufferRunCommand;
gBattleBankFunc[0] = SetControllerToOpponent;
gBanksByIdentity[0] = IDENTITY_OPPONENT_MON1;
gBattleBankFunc[2] = SetBankFuncToOpponentBufferRunCommand;
gBattleBankFunc[2] = SetControllerToOpponent;
gBanksByIdentity[2] = IDENTITY_OPPONENT_MON2;
}
}
@ -424,20 +424,20 @@ static void SetControllersVariablesInLinkBattle(void)
{
gBattleMainFunc = BeginBattleIntro;
gBattleBankFunc[0] = SetBankFuncToPlayerBufferRunCommand;
gBattleBankFunc[0] = SetControllerToPlayer;
gBanksByIdentity[0] = IDENTITY_PLAYER_MON1;
gBattleBankFunc[1] = SetBankFuncToLinkOpponentBufferRunCommand;
gBattleBankFunc[1] = SetControllerToLinkOpponent;
gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1;
gNoOfAllBanks = 2;
}
else
{
gBattleBankFunc[1] = SetBankFuncToPlayerBufferRunCommand;
gBattleBankFunc[1] = SetControllerToPlayer;
gBanksByIdentity[1] = IDENTITY_PLAYER_MON1;
gBattleBankFunc[0] = SetBankFuncToLinkOpponentBufferRunCommand;
gBattleBankFunc[0] = SetControllerToLinkOpponent;
gBanksByIdentity[0] = IDENTITY_OPPONENT_MON1;
gNoOfAllBanks = 2;
@ -449,32 +449,32 @@ static void SetControllersVariablesInLinkBattle(void)
{
gBattleMainFunc = BeginBattleIntro;
gBattleBankFunc[0] = SetBankFuncToPlayerBufferRunCommand;
gBattleBankFunc[0] = SetControllerToPlayer;
gBanksByIdentity[0] = IDENTITY_PLAYER_MON1;
gBattleBankFunc[1] = SetBankFuncToLinkOpponentBufferRunCommand;
gBattleBankFunc[1] = SetControllerToLinkOpponent;
gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1;
gBattleBankFunc[2] = SetBankFuncToPlayerBufferRunCommand;
gBattleBankFunc[2] = SetControllerToPlayer;
gBanksByIdentity[2] = IDENTITY_PLAYER_MON2;
gBattleBankFunc[3] = SetBankFuncToLinkOpponentBufferRunCommand;
gBattleBankFunc[3] = SetControllerToLinkOpponent;
gBanksByIdentity[3] = IDENTITY_OPPONENT_MON2;
gNoOfAllBanks = 4;
}
else
{
gBattleBankFunc[1] = SetBankFuncToPlayerBufferRunCommand;
gBattleBankFunc[1] = SetControllerToPlayer;
gBanksByIdentity[1] = IDENTITY_PLAYER_MON1;
gBattleBankFunc[0] = SetBankFuncToLinkOpponentBufferRunCommand;
gBattleBankFunc[0] = SetControllerToLinkOpponent;
gBanksByIdentity[0] = IDENTITY_OPPONENT_MON1;
gBattleBankFunc[3] = SetBankFuncToPlayerBufferRunCommand;
gBattleBankFunc[3] = SetControllerToPlayer;
gBanksByIdentity[3] = IDENTITY_PLAYER_MON2;
gBattleBankFunc[2] = SetBankFuncToLinkOpponentBufferRunCommand;
gBattleBankFunc[2] = SetControllerToLinkOpponent;
gBanksByIdentity[2] = IDENTITY_OPPONENT_MON2;
gNoOfAllBanks = 4;
@ -486,32 +486,32 @@ static void SetControllersVariablesInLinkBattle(void)
{
gBattleMainFunc = BeginBattleIntro;
gBattleBankFunc[0] = SetBankFuncToPlayerBufferRunCommand;
gBattleBankFunc[0] = SetControllerToPlayer;
gBanksByIdentity[0] = IDENTITY_PLAYER_MON1;
gBattleBankFunc[1] = SetBankFuncToOpponentBufferRunCommand;
gBattleBankFunc[1] = SetControllerToOpponent;
gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1;
gBattleBankFunc[2] = SetBankFuncToLinkPartnerBufferRunCommand;
gBattleBankFunc[2] = SetControllerToLinkPartner;
gBanksByIdentity[2] = IDENTITY_PLAYER_MON2;
gBattleBankFunc[3] = SetBankFuncToOpponentBufferRunCommand;
gBattleBankFunc[3] = SetControllerToOpponent;
gBanksByIdentity[3] = IDENTITY_OPPONENT_MON2;
gNoOfAllBanks = 4;
}
else
{
gBattleBankFunc[0] = SetBankFuncToLinkPartnerBufferRunCommand;
gBattleBankFunc[0] = SetControllerToLinkPartner;
gBanksByIdentity[0] = IDENTITY_PLAYER_MON1;
gBattleBankFunc[1] = SetBankFuncToLinkOpponentBufferRunCommand;
gBattleBankFunc[1] = SetControllerToLinkOpponent;
gBanksByIdentity[1] = IDENTITY_OPPONENT_MON1;
gBattleBankFunc[2] = SetBankFuncToPlayerBufferRunCommand;
gBattleBankFunc[2] = SetControllerToPlayer;
gBanksByIdentity[2] = IDENTITY_PLAYER_MON2;
gBattleBankFunc[3] = SetBankFuncToLinkOpponentBufferRunCommand;
gBattleBankFunc[3] = SetControllerToLinkOpponent;
gBanksByIdentity[3] = IDENTITY_OPPONENT_MON2;
gNoOfAllBanks = 4;
@ -549,7 +549,7 @@ static void SetControllersVariablesInLinkBattle(void)
if (i == multiplayerId)
{
gBattleBankFunc[gLinkPlayers[i].lp_field_18] = SetBankFuncToPlayerBufferRunCommand;
gBattleBankFunc[gLinkPlayers[i].lp_field_18] = SetControllerToPlayer;
switch (gLinkPlayers[i].lp_field_18)
{
case 0:
@ -569,7 +569,7 @@ static void SetControllersVariablesInLinkBattle(void)
if ((!(gLinkPlayers[i].lp_field_18 & 1) && !(gLinkPlayers[multiplayerId].lp_field_18 & 1))
|| ((gLinkPlayers[i].lp_field_18 & 1) && (gLinkPlayers[multiplayerId].lp_field_18 & 1)))
{
gBattleBankFunc[gLinkPlayers[i].lp_field_18] = SetBankFuncToLinkPartnerBufferRunCommand;
gBattleBankFunc[gLinkPlayers[i].lp_field_18] = SetControllerToLinkPartner;
switch (gLinkPlayers[i].lp_field_18)
{
case 0:
@ -586,7 +586,7 @@ static void SetControllersVariablesInLinkBattle(void)
}
else
{
gBattleBankFunc[gLinkPlayers[i].lp_field_18] = SetBankFuncToLinkOpponentBufferRunCommand;
gBattleBankFunc[gLinkPlayers[i].lp_field_18] = SetControllerToLinkOpponent;
switch (gLinkPlayers[i].lp_field_18)
{
case 0:
@ -939,11 +939,11 @@ static void Task_HandleCopyReceivedLinkBuffersData(u8 taskId)
}
}
void EmitGetMonData(u8 bufferId, u8 arg1, u8 arg2)
void EmitGetMonData(u8 bufferId, u8 requestId, u8 monToCheck)
{
gBattleBuffersTransferData[0] = CONTROLLER_GETMONDATA;
gBattleBuffersTransferData[1] = arg1;
gBattleBuffersTransferData[2] = arg2;
gBattleBuffersTransferData[1] = requestId;
gBattleBuffersTransferData[2] = monToCheck;
gBattleBuffersTransferData[3] = 0;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
@ -957,13 +957,13 @@ void EmitGetRawMonData(u8 bufferId, u8 monId, u8 bytes)
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
void EmitSetMonData(u8 bufferId, u8 request, u8 c, u8 bytes, void *data)
void EmitSetMonData(u8 bufferId, u8 requestId, u8 monToCheck, u8 bytes, void *data)
{
s32 i;
gBattleBuffersTransferData[0] = CONTROLLER_SETMONDATA;
gBattleBuffersTransferData[1] = request;
gBattleBuffersTransferData[2] = c;
gBattleBuffersTransferData[1] = requestId;
gBattleBuffersTransferData[2] = monToCheck;
for (i = 0; i < bytes; i++)
gBattleBuffersTransferData[3 + i] = *(u8*)(data++);
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 3 + bytes);
@ -984,9 +984,9 @@ void EmitSetRawMonData(u8 bufferId, u8 monId, u8 bytes, void *data)
void EmitLoadMonSprite(u8 bufferId)
{
gBattleBuffersTransferData[0] = CONTROLLER_LOADMONSPRITE;
gBattleBuffersTransferData[1] = 4;
gBattleBuffersTransferData[2] = 4;
gBattleBuffersTransferData[3] = 4;
gBattleBuffersTransferData[1] = CONTROLLER_LOADMONSPRITE;
gBattleBuffersTransferData[2] = CONTROLLER_LOADMONSPRITE;
gBattleBuffersTransferData[3] = CONTROLLER_LOADMONSPRITE;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
@ -1009,60 +1009,60 @@ void EmitReturnMonToBall(u8 bufferId, u8 arg1)
void EmitDrawTrainerPic(u8 bufferId)
{
gBattleBuffersTransferData[0] = CONTROLLER_DRAWTRAINERPIC;
gBattleBuffersTransferData[1] = 7;
gBattleBuffersTransferData[2] = 7;
gBattleBuffersTransferData[3] = 7;
gBattleBuffersTransferData[1] = CONTROLLER_DRAWTRAINERPIC;
gBattleBuffersTransferData[2] = CONTROLLER_DRAWTRAINERPIC;
gBattleBuffersTransferData[3] = CONTROLLER_DRAWTRAINERPIC;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
void EmitTrainerSlide(u8 bufferId)
{
gBattleBuffersTransferData[0] = CONTROLLER_TRAINERSLIDE;
gBattleBuffersTransferData[1] = 8;
gBattleBuffersTransferData[2] = 8;
gBattleBuffersTransferData[3] = 8;
gBattleBuffersTransferData[1] = CONTROLLER_TRAINERSLIDE;
gBattleBuffersTransferData[2] = CONTROLLER_TRAINERSLIDE;
gBattleBuffersTransferData[3] = CONTROLLER_TRAINERSLIDE;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
void EmitTrainerSlideBack(u8 bufferId)
{
gBattleBuffersTransferData[0] = CONTROLLER_TRAINERSLIDEBACK;
gBattleBuffersTransferData[1] = 9;
gBattleBuffersTransferData[2] = 9;
gBattleBuffersTransferData[3] = 9;
gBattleBuffersTransferData[1] = CONTROLLER_TRAINERSLIDEBACK;
gBattleBuffersTransferData[2] = CONTROLLER_TRAINERSLIDEBACK;
gBattleBuffersTransferData[3] = CONTROLLER_TRAINERSLIDEBACK;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
void EmitFaintAnimation(u8 bufferId)
{
gBattleBuffersTransferData[0] = CONTROLLER_FAINTANIMATION;
gBattleBuffersTransferData[1] = 10;
gBattleBuffersTransferData[2] = 10;
gBattleBuffersTransferData[3] = 10;
gBattleBuffersTransferData[1] = CONTROLLER_FAINTANIMATION;
gBattleBuffersTransferData[2] = CONTROLLER_FAINTANIMATION;
gBattleBuffersTransferData[3] = CONTROLLER_FAINTANIMATION;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
void EmitCmd11(u8 bufferId)
void EmitPaletteFade(u8 bufferId)
{
gBattleBuffersTransferData[0] = CONTROLLER_11;
gBattleBuffersTransferData[1] = 11;
gBattleBuffersTransferData[2] = 11;
gBattleBuffersTransferData[3] = 11;
gBattleBuffersTransferData[0] = CONTROLLER_PALETTEFADE;
gBattleBuffersTransferData[1] = CONTROLLER_PALETTEFADE;
gBattleBuffersTransferData[2] = CONTROLLER_PALETTEFADE;
gBattleBuffersTransferData[3] = CONTROLLER_PALETTEFADE;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
void EmitCmd12(u8 bufferId)
void EmitSuccessBallThrowAnim(u8 bufferId)
{
gBattleBuffersTransferData[0] = CONTROLLER_12;
gBattleBuffersTransferData[1] = 12;
gBattleBuffersTransferData[2] = 12;
gBattleBuffersTransferData[3] = 12;
gBattleBuffersTransferData[0] = CONTROLLER_SUCCESSBALLTHROWANIM;
gBattleBuffersTransferData[1] = CONTROLLER_SUCCESSBALLTHROWANIM;
gBattleBuffersTransferData[2] = CONTROLLER_SUCCESSBALLTHROWANIM;
gBattleBuffersTransferData[3] = CONTROLLER_SUCCESSBALLTHROWANIM;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
void EmitBallThrow(u8 bufferId, u8 caseId)
void EmitBallThrowAnim(u8 bufferId, u8 caseId)
{
gBattleBuffersTransferData[0] = CONTROLLER_BALLTHROW;
gBattleBuffersTransferData[0] = CONTROLLER_BALLTHROWANIM;
gBattleBuffersTransferData[1] = caseId;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 2);
}
@ -1146,7 +1146,7 @@ void EmitPrintStringPlayerOnly(u8 bufferId, u16 stringID)
struct StringInfoBattle* stringInfo;
gBattleBuffersTransferData[0] = CONTROLLER_PRINTSTRINGPLAYERONLY;
gBattleBuffersTransferData[1] = 17;
gBattleBuffersTransferData[1] = CONTROLLER_PRINTSTRINGPLAYERONLY;
gBattleBuffersTransferData[2] = stringID;
gBattleBuffersTransferData[3] = (stringID & 0xFF00) >> 8;
@ -1178,12 +1178,12 @@ void EmitChooseAction(u8 bufferId, u8 arg1, u16 arg2)
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
void EmitCmd19(u8 bufferId)
void EmitUnknownYesNoBox(u8 bufferId)
{
gBattleBuffersTransferData[0] = CONTROLLER_19;
gBattleBuffersTransferData[1] = 19;
gBattleBuffersTransferData[2] = 19;
gBattleBuffersTransferData[3] = 19;
gBattleBuffersTransferData[0] = CONTROLLER_UNKNOWNYESNOBOX;
gBattleBuffersTransferData[1] = CONTROLLER_UNKNOWNYESNOBOX;
gBattleBuffersTransferData[2] = CONTROLLER_UNKNOWNYESNOBOX;
gBattleBuffersTransferData[3] = CONTROLLER_UNKNOWNYESNOBOX;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
@ -1200,7 +1200,7 @@ void EmitChooseMove(u8 bufferId, bool8 isDoubleBattle, bool8 NoPpNumber, struct
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, sizeof(*movePpData) + 4);
}
void EmitOpenBag(u8 bufferId, u8 *arg1)
void EmitChooseItem(u8 bufferId, u8 *arg1)
{
s32 i;
@ -1226,9 +1226,9 @@ void EmitChoosePokemon(u8 bufferId, u8 caseId, u8 arg2, u8 abilityId, u8* arg4)
void EmitCmd23(u8 bufferId)
{
gBattleBuffersTransferData[0] = CONTROLLER_23;
gBattleBuffersTransferData[1] = 23;
gBattleBuffersTransferData[2] = 23;
gBattleBuffersTransferData[3] = 23;
gBattleBuffersTransferData[1] = CONTROLLER_23;
gBattleBuffersTransferData[2] = CONTROLLER_23;
gBattleBuffersTransferData[3] = CONTROLLER_23;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
@ -1289,7 +1289,7 @@ void EmitDataTransfer(u8 bufferId, u16 size, void *data)
s32 i;
gBattleBuffersTransferData[0] = CONTROLLER_DATATRANSFER;
gBattleBuffersTransferData[1] = 29;
gBattleBuffersTransferData[1] = CONTROLLER_DATATRANSFER;
gBattleBuffersTransferData[2] = size;
gBattleBuffersTransferData[3] = (size & 0xFF00) >> 8;
for (i = 0; i < size; i++)
@ -1337,38 +1337,38 @@ void EmitCmd32(u8 bufferId, u16 size, void *data)
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, size + 3);
}
void EmitCmd33(u8 bufferId, u8 arg1, u16 arg2)
void EmitTwoReturnValues(u8 bufferId, u8 arg1, u16 arg2)
{
gBattleBuffersTransferData[0] = CONTROLLER_33;
gBattleBuffersTransferData[0] = CONTROLLER_TWORETURNVALUES;
gBattleBuffersTransferData[1] = arg1;
gBattleBuffersTransferData[2] = arg2;
gBattleBuffersTransferData[3] = (arg2 & 0xFF00) >> 8;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
void EmitCmd34(u8 bufferId, u8 b, u8 *c)
void EmitChosenMonReturnValue(u8 bufferId, u8 b, u8 *c)
{
s32 i;
gBattleBuffersTransferData[0] = CONTROLLER_34;
gBattleBuffersTransferData[0] = CONTROLLER_CHOSENMONRETURNVALUE;
gBattleBuffersTransferData[1] = b;
for (i = 0; i < 3; i++)
gBattleBuffersTransferData[2 + i] = c[i];
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 5);
}
void EmitCmd35(u8 bufferId, u16 b)
void EmitOneReturnValue(u8 bufferId, u16 arg1)
{
gBattleBuffersTransferData[0] = CONTROLLER_35;
gBattleBuffersTransferData[1] = b;
gBattleBuffersTransferData[2] = (b & 0xFF00) >> 8;
gBattleBuffersTransferData[0] = CONTROLLER_ONERETURNVALUE;
gBattleBuffersTransferData[1] = arg1;
gBattleBuffersTransferData[2] = (arg1 & 0xFF00) >> 8;
gBattleBuffersTransferData[3] = 0;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
void EmitCmd36(u8 bufferId, u16 b)
void EmitOneReturnValue_Duplicate(u8 bufferId, u16 b)
{
gBattleBuffersTransferData[0] = CONTROLLER_36;
gBattleBuffersTransferData[0] = CONTROLLER_ONERETURNVALUE_DUPLICATE;
gBattleBuffersTransferData[1] = b;
gBattleBuffersTransferData[2] = (b & 0xFF00) >> 8;
gBattleBuffersTransferData[3] = 0;
@ -1378,9 +1378,9 @@ void EmitCmd36(u8 bufferId, u16 b)
void EmitCmd37(u8 bufferId)
{
gBattleBuffersTransferData[0] = CONTROLLER_37;
gBattleBuffersTransferData[1] = 37;
gBattleBuffersTransferData[2] = 37;
gBattleBuffersTransferData[3] = 37;
gBattleBuffersTransferData[1] = CONTROLLER_37;
gBattleBuffersTransferData[2] = CONTROLLER_37;
gBattleBuffersTransferData[3] = CONTROLLER_37;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
@ -1394,36 +1394,36 @@ void EmitCmd38(u8 bufferId, u8 b)
void EmitCmd39(u8 bufferId)
{
gBattleBuffersTransferData[0] = CONTROLLER_39;
gBattleBuffersTransferData[1] = 39;
gBattleBuffersTransferData[2] = 39;
gBattleBuffersTransferData[3] = 39;
gBattleBuffersTransferData[1] = CONTROLLER_39;
gBattleBuffersTransferData[2] = CONTROLLER_39;
gBattleBuffersTransferData[3] = CONTROLLER_39;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
void EmitCmd40(u8 bufferId)
{
gBattleBuffersTransferData[0] = CONTROLLER_40;
gBattleBuffersTransferData[1] = 40;
gBattleBuffersTransferData[2] = 40;
gBattleBuffersTransferData[3] = 40;
gBattleBuffersTransferData[1] = CONTROLLER_40;
gBattleBuffersTransferData[2] = CONTROLLER_40;
gBattleBuffersTransferData[3] = CONTROLLER_40;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
void EmitHitAnimation(u8 bufferId)
{
gBattleBuffersTransferData[0] = CONTROLLER_HITANIMATION;
gBattleBuffersTransferData[1] = 41;
gBattleBuffersTransferData[2] = 41;
gBattleBuffersTransferData[3] = 41;
gBattleBuffersTransferData[1] = CONTROLLER_HITANIMATION;
gBattleBuffersTransferData[2] = CONTROLLER_HITANIMATION;
gBattleBuffersTransferData[3] = CONTROLLER_HITANIMATION;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
void EmitCmd42(u8 bufferId)
{
gBattleBuffersTransferData[0] = CONTROLLER_42;
gBattleBuffersTransferData[1] = 42;
gBattleBuffersTransferData[2] = 42;
gBattleBuffersTransferData[3] = 42;
gBattleBuffersTransferData[1] = CONTROLLER_42;
gBattleBuffersTransferData[2] = CONTROLLER_42;
gBattleBuffersTransferData[3] = CONTROLLER_42;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
@ -1448,9 +1448,9 @@ void EmitPlayFanfareOrBGM(u8 bufferId, u16 songId, bool8 playBGM)
void EmitFaintingCry(u8 bufferId)
{
gBattleBuffersTransferData[0] = CONTROLLER_FAINTINGCRY;
gBattleBuffersTransferData[1] = 45;
gBattleBuffersTransferData[2] = 45;
gBattleBuffersTransferData[3] = 45;
gBattleBuffersTransferData[1] = CONTROLLER_FAINTINGCRY;
gBattleBuffersTransferData[2] = CONTROLLER_FAINTINGCRY;
gBattleBuffersTransferData[3] = CONTROLLER_FAINTINGCRY;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
@ -1464,9 +1464,9 @@ void EmitIntroSlide(u8 bufferId, u8 terrainId)
void EmitIntroTrainerBallThrow(u8 bufferId)
{
gBattleBuffersTransferData[0] = CONTROLLER_INTROTRAINERBALLTHROW;
gBattleBuffersTransferData[1] = 47;
gBattleBuffersTransferData[2] = 47;
gBattleBuffersTransferData[3] = 47;
gBattleBuffersTransferData[1] = CONTROLLER_INTROTRAINERBALLTHROW;
gBattleBuffersTransferData[2] = CONTROLLER_INTROTRAINERBALLTHROW;
gBattleBuffersTransferData[3] = CONTROLLER_INTROTRAINERBALLTHROW;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
@ -1477,7 +1477,7 @@ void EmitDrawPartyStatusSummary(u8 bufferId, struct HpAndStatus* hpAndStatus, u8
gBattleBuffersTransferData[0] = CONTROLLER_DRAWPARTYSTATUSSUMMARY;
gBattleBuffersTransferData[1] = arg2 & 0x7F;
gBattleBuffersTransferData[2] = (arg2 & 0x80) >> 7;
gBattleBuffersTransferData[3] = 48;
gBattleBuffersTransferData[3] = CONTROLLER_DRAWPARTYSTATUSSUMMARY;
for (i = 0; i < (s32)(sizeof(struct HpAndStatus) * 6); i++)
gBattleBuffersTransferData[4 + i] = *(i + (u8*)(hpAndStatus));
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, sizeof(struct HpAndStatus) * 6 + 4);
@ -1486,18 +1486,18 @@ void EmitDrawPartyStatusSummary(u8 bufferId, struct HpAndStatus* hpAndStatus, u8
void EmitCmd49(u8 bufferId)
{
gBattleBuffersTransferData[0] = CONTROLLER_49;
gBattleBuffersTransferData[1] = 49;
gBattleBuffersTransferData[2] = 49;
gBattleBuffersTransferData[3] = 49;
gBattleBuffersTransferData[1] = CONTROLLER_49;
gBattleBuffersTransferData[2] = CONTROLLER_49;
gBattleBuffersTransferData[3] = CONTROLLER_49;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
void EmitCmd50(u8 bufferId)
{
gBattleBuffersTransferData[0] = CONTROLLER_50;
gBattleBuffersTransferData[1] = 50;
gBattleBuffersTransferData[2] = 50;
gBattleBuffersTransferData[3] = 50;
gBattleBuffersTransferData[1] = CONTROLLER_50;
gBattleBuffersTransferData[2] = CONTROLLER_50;
gBattleBuffersTransferData[3] = CONTROLLER_50;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
@ -1505,8 +1505,8 @@ void EmitSpriteInvisibility(u8 bufferId, bool8 isInvisible)
{
gBattleBuffersTransferData[0] = CONTROLLER_SPRITEINVISIBILITY;
gBattleBuffersTransferData[1] = isInvisible;
gBattleBuffersTransferData[2] = 51;
gBattleBuffersTransferData[3] = 51;
gBattleBuffersTransferData[2] = CONTROLLER_SPRITEINVISIBILITY;
gBattleBuffersTransferData[3] = CONTROLLER_SPRITEINVISIBILITY;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}

View File

@ -124,7 +124,7 @@ static void sub_818D0C4(u16 species, u32 otId, u32 personality, u8 paletteSlot,
else
{
gUnknown_0203CCEC.paletteTag = paletteTag;
LoadCompressedObjectPalette(sub_806E7CC(species, otId, personality));
LoadCompressedObjectPalette(GetMonSpritePalStructFromOtIdPersonality(species, otId, personality));
}
}
else

View File

@ -21,23 +21,11 @@
#include "safari_zone.h"
#include "battle_anim.h"
enum
{
HEALTH_BAR,
EXP_BAR
};
enum
{
HP_CURRENT,
HP_MAX
};
struct TestingBar
{
s32 maxValue;
s32 currValue;
s32 field_8;
s32 receivedValue;
u32 unkC_0:5;
u32 unk10;
};
@ -189,7 +177,6 @@ extern const u16 gBattleInterface_BallDisplayPal[];
extern const u8 gHealthboxElementsGfxTable[][32];
// functions
extern bool8 IsDoubleBattle(void);
extern void AddTextPrinterParametrized2(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, struct TextColor *color, s8 speed, const u8 *str); // menu.h
extern void LoadBattleBarGfx(u8 arg0);
@ -220,10 +207,10 @@ static void SpriteCB_StatusSummaryBallsOnBattleStart(struct Sprite *sprite);
static void SpriteCB_StatusSummaryBallsOnSwitchout(struct Sprite *sprite);
static u8 GetStatusIconForBankId(u8 statusElementId, u8 bank);
static s32 sub_8074DB8(s32 maxValue, s32 currValue, s32 arg2, s32 *arg3, u8 arg4, u16 arg5);
static u8 GetScaledExpFraction(s32 currValue, s32 arg1, s32 maxValue, u8 scale);
static s32 sub_8074DB8(s32 maxValue, s32 currValue, s32 receivedValue, s32 *arg3, u8 arg4, u16 arg5);
static u8 GetScaledExpFraction(s32 currValue, s32 receivedValue, s32 maxValue, u8 scale);
static void sub_8074B9C(u8 bank, u8 whichBar);
static u8 sub_8074E8C(s32 maxValue, s32 currValue, s32 arg2, s32 *arg3, u8 *arg4, u8 arg5);
static u8 sub_8074E8C(s32 maxValue, s32 currValue, s32 receivedValue, s32 *arg3, u8 *arg4, u8 arg5);
static void sub_8074F88(struct TestingBar *barInfo, s32 *arg1, u16 *arg2);
// const rom data
@ -1055,12 +1042,12 @@ static void sub_8072924(struct Sprite *sprite)
sprite->pos2.y = gSprites[otherSpriteId].pos2.y;
}
void SetBattleBarStruct(u8 bank, u8 healthboxSpriteId, s32 maxVal, s32 currVal, s32 field_C)
void SetBattleBarStruct(u8 bank, u8 healthboxSpriteId, s32 maxVal, s32 currVal, s32 receivedValue)
{
gBattleSpritesDataPtr->battleBars[bank].healthboxSpriteId = healthboxSpriteId;
gBattleSpritesDataPtr->battleBars[bank].maxValue = maxVal;
gBattleSpritesDataPtr->battleBars[bank].currentValue = currVal;
gBattleSpritesDataPtr->battleBars[bank].field_C = field_C;
gBattleSpritesDataPtr->battleBars[bank].receivedValue = receivedValue;
gBattleSpritesDataPtr->battleBars[bank].field_10 = -32768;
}
@ -2268,22 +2255,22 @@ s32 sub_8074AA0(u8 bank, u8 healthboxSpriteId, u8 whichBar, u8 arg3)
{
var = sub_8074DB8(gBattleSpritesDataPtr->battleBars[bank].maxValue,
gBattleSpritesDataPtr->battleBars[bank].currentValue,
gBattleSpritesDataPtr->battleBars[bank].field_C,
gBattleSpritesDataPtr->battleBars[bank].receivedValue,
&gBattleSpritesDataPtr->battleBars[bank].field_10,
6, 1);
}
else // exp bar
{
u16 expFraction = GetScaledExpFraction(gBattleSpritesDataPtr->battleBars[bank].currentValue,
gBattleSpritesDataPtr->battleBars[bank].field_C,
gBattleSpritesDataPtr->battleBars[bank].receivedValue,
gBattleSpritesDataPtr->battleBars[bank].maxValue, 8);
if (expFraction == 0)
expFraction = 1;
expFraction = abs(gBattleSpritesDataPtr->battleBars[bank].field_C / expFraction);
expFraction = abs(gBattleSpritesDataPtr->battleBars[bank].receivedValue / expFraction);
var = sub_8074DB8(gBattleSpritesDataPtr->battleBars[bank].maxValue,
gBattleSpritesDataPtr->battleBars[bank].currentValue,
gBattleSpritesDataPtr->battleBars[bank].field_C,
gBattleSpritesDataPtr->battleBars[bank].receivedValue,
&gBattleSpritesDataPtr->battleBars[bank].field_10,
8, expFraction);
}
@ -2299,7 +2286,7 @@ s32 sub_8074AA0(u8 bank, u8 healthboxSpriteId, u8 whichBar, u8 arg3)
static void sub_8074B9C(u8 bank, u8 whichBar)
{
u8 array[7];
u8 array[8];
u8 subRet, level;
u8 barElementId;
u8 i;
@ -2309,7 +2296,7 @@ static void sub_8074B9C(u8 bank, u8 whichBar)
case HEALTH_BAR:
subRet = sub_8074E8C(gBattleSpritesDataPtr->battleBars[bank].maxValue,
gBattleSpritesDataPtr->battleBars[bank].currentValue,
gBattleSpritesDataPtr->battleBars[bank].field_C,
gBattleSpritesDataPtr->battleBars[bank].receivedValue,
&gBattleSpritesDataPtr->battleBars[bank].field_10,
array, 6);
barElementId = 3;
@ -2333,7 +2320,7 @@ static void sub_8074B9C(u8 bank, u8 whichBar)
case EXP_BAR:
sub_8074E8C(gBattleSpritesDataPtr->battleBars[bank].maxValue,
gBattleSpritesDataPtr->battleBars[bank].currentValue,
gBattleSpritesDataPtr->battleBars[bank].field_C,
gBattleSpritesDataPtr->battleBars[bank].receivedValue,
&gBattleSpritesDataPtr->battleBars[bank].field_10,
array, 8);
level = GetMonData(&gPlayerParty[gBattlePartyID[bank]], MON_DATA_LEVEL);
@ -2355,7 +2342,7 @@ static void sub_8074B9C(u8 bank, u8 whichBar)
}
}
static s32 sub_8074DB8(s32 maxValue, s32 currValue, s32 arg2, s32 *arg3, u8 arg4, u16 arg5)
static s32 sub_8074DB8(s32 maxValue, s32 currValue, s32 receivedValue, s32 *arg3, u8 arg4, u16 arg5)
{
s32 r6;
s32 ret;
@ -2369,7 +2356,7 @@ static s32 sub_8074DB8(s32 maxValue, s32 currValue, s32 arg2, s32 *arg3, u8 arg4
*arg3 = currValue;
}
currValue -= arg2;
currValue -= receivedValue;
if (currValue < 0)
currValue = 0;
else if (currValue > maxValue)
@ -2394,7 +2381,7 @@ static s32 sub_8074DB8(s32 maxValue, s32 currValue, s32 arg2, s32 *arg3, u8 arg4
{
s32 var = (maxValue << 8) / arg4;
if (arg2 < 0)
if (receivedValue < 0)
{
*arg3 = r6 + var;
ret = *arg3 >> 8;
@ -2419,7 +2406,7 @@ static s32 sub_8074DB8(s32 maxValue, s32 currValue, s32 arg2, s32 *arg3, u8 arg4
}
else
{
if (arg2 < 0)
if (receivedValue < 0)
{
*arg3 += arg5;
if (*arg3 > currValue)
@ -2438,9 +2425,9 @@ static s32 sub_8074DB8(s32 maxValue, s32 currValue, s32 arg2, s32 *arg3, u8 arg4
return ret;
}
static u8 sub_8074E8C(s32 maxValue, s32 currValue, s32 arg2, s32 *arg3, u8 *arg4, u8 arg5)
static u8 sub_8074E8C(s32 maxValue, s32 currValue, s32 receivedValue, s32 *arg3, u8 *arg4, u8 arg5)
{
s32 r5 = currValue - arg2;
s32 r5 = currValue - receivedValue;
u8 ret;
u8 i;
u8 r2;
@ -2493,7 +2480,7 @@ static s16 sub_8074F28(struct TestingBar *barInfo, s32 *arg1, u16 *arg2, s32 arg
ret = sub_8074DB8(barInfo->maxValue,
barInfo->currValue,
barInfo->field_8,
barInfo->receivedValue,
arg1, 6, 1);
sub_8074F88(barInfo, arg1, arg2);
@ -2514,7 +2501,7 @@ static void sub_8074F88(struct TestingBar *barInfo, s32 *arg1, u16 *arg2)
u8 i;
sub_8074E8C(barInfo->maxValue, barInfo->currValue,
barInfo->field_8, arg1, sp8, 6);
barInfo->receivedValue, arg1, sp8, 6);
for (i = 0; i < 6; i++)
sp10[i] = (barInfo->unkC_0 << 12) | (barInfo->unk10 + sp8[i]);
@ -2522,13 +2509,13 @@ static void sub_8074F88(struct TestingBar *barInfo, s32 *arg1, u16 *arg2)
CpuCopy16(sp10, arg2, sizeof(sp10));
}
static u8 GetScaledExpFraction(s32 currValue, s32 arg1, s32 maxValue, u8 scale)
static u8 GetScaledExpFraction(s32 currValue, s32 receivedValue, s32 maxValue, u8 scale)
{
s32 r5, result;
s8 r4, r0;
scale *= 8;
r5 = currValue - arg1;
r5 = currValue - receivedValue;
if (r5 < 0)
r5 = 0;

View File

@ -1858,16 +1858,16 @@ u32 BattleStringExpandPlaceholders(const u8* src, u8* dst)
toCpy = gLinkPlayers[multiplayerID].name;
break;
case B_TXT_1F: // link partner name?
toCpy = gLinkPlayers[sub_806D864(2 ^ gLinkPlayers[multiplayerID].lp_field_18)].name;
toCpy = gLinkPlayers[GetBankMultiplayerId(2 ^ gLinkPlayers[multiplayerID].lp_field_18)].name;
break;
case B_TXT_20: // link opponent 1 name?
toCpy = gLinkPlayers[sub_806D864(1 ^ gLinkPlayers[multiplayerID].lp_field_18)].name;
toCpy = gLinkPlayers[GetBankMultiplayerId(1 ^ gLinkPlayers[multiplayerID].lp_field_18)].name;
break;
case B_TXT_21: // link opponent 2 name?
toCpy = gLinkPlayers[sub_806D864(3 ^ gLinkPlayers[multiplayerID].lp_field_18)].name;
toCpy = gLinkPlayers[GetBankMultiplayerId(3 ^ gLinkPlayers[multiplayerID].lp_field_18)].name;
break;
case B_TXT_22: // link scripting active name
toCpy = gLinkPlayers[sub_806D864(gBattleScripting.bank)].name;
toCpy = gLinkPlayers[GetBankMultiplayerId(gBattleScripting.bank)].name;
break;
case B_TXT_PLAYER_NAME: // player name
if (gBattleTypeFlags & BATTLE_TYPE_RECORDED)
@ -2209,7 +2209,7 @@ static void sub_814F950(u8* dst)
}
}
void sub_814F9EC(const u8 *text, u8 arg1)
void BattleHandleAddTextPrinter(const u8 *text, u8 arg1)
{
const u8 *r8 = gUnknown_085CD660[gBattleScripting.field_24];
bool32 r9;

View File

@ -3625,7 +3625,7 @@ static void atk23_getexp(void)
if (gBattleExecBuffer == 0)
{
gActiveBank = gBattleStruct->expGetterBank;
if (gBattleBufferB[gActiveBank][0] == 0x21 && gBattleBufferB[gActiveBank][1] == 0xB)
if (gBattleBufferB[gActiveBank][0] == CONTROLLER_TWORETURNVALUES && gBattleBufferB[gActiveBank][1] == RET_VALUE_LEVELLED_UP)
{
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER && gBattlePartyID[gActiveBank] == gBattleStruct->expGetterId)
sub_805E990(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank);
@ -5463,7 +5463,7 @@ static void atk4F_jump_if_cannot_switch(void)
party = gPlayerParty;
val = 0;
if (sub_806D82C(sub_806D864(gActiveBank)) == TRUE)
if (sub_806D82C(GetBankMultiplayerId(gActiveBank)) == TRUE)
val = 3;
}
else
@ -5485,7 +5485,7 @@ static void atk4F_jump_if_cannot_switch(void)
val = 0;
if (sub_806D82C(sub_806D864(gActiveBank)) == TRUE)
if (sub_806D82C(GetBankMultiplayerId(gActiveBank)) == TRUE)
val = 3;
}
@ -6114,33 +6114,33 @@ static void atk5A_yesnoboxlearnmove(void)
switch (gBattleScripting.learnMoveState)
{
case 0:
sub_8056A3C(0x18, 8, 0x1D, 0xD, 0);
sub_814F9EC(gText_BattleYesNoChoice, 0xC);
HandleBattleWindow(0x18, 8, 0x1D, 0xD, 0);
BattleHandleAddTextPrinter(gText_BattleYesNoChoice, 0xC);
gBattleScripting.learnMoveState++;
gBattleCommunication[CURSOR_POSITION] = 0;
BattleCreateCursorAt(0);
BattleCreateYesNoCursorAt(0);
break;
case 1:
if (gMain.newKeys & DPAD_UP && gBattleCommunication[CURSOR_POSITION] != 0)
{
PlaySE(SE_SELECT);
BattleDestroyCursorAt(gBattleCommunication[CURSOR_POSITION]);
BattleDestroyYesNoCursorAt(gBattleCommunication[CURSOR_POSITION]);
gBattleCommunication[CURSOR_POSITION] = 0;
BattleCreateCursorAt(0);
BattleCreateYesNoCursorAt(0);
}
if (gMain.newKeys & DPAD_DOWN && gBattleCommunication[CURSOR_POSITION] == 0)
{
PlaySE(SE_SELECT);
BattleDestroyCursorAt(gBattleCommunication[CURSOR_POSITION]);
BattleDestroyYesNoCursorAt(gBattleCommunication[CURSOR_POSITION]);
gBattleCommunication[CURSOR_POSITION] = 1;
BattleCreateCursorAt(1);
BattleCreateYesNoCursorAt(1);
}
if (gMain.newKeys & A_BUTTON)
{
PlaySE(SE_SELECT);
if (gBattleCommunication[1] == 0)
{
sub_8056A3C(0x18, 0x8, 0x1D, 0xD, 1);
HandleBattleWindow(0x18, 0x8, 0x1D, 0xD, WINDOW_CLEAR);
BeginNormalPaletteFade(-1, 0, 0, 0x10, 0);
gBattleScripting.learnMoveState++;
}
@ -6214,7 +6214,7 @@ static void atk5A_yesnoboxlearnmove(void)
}
break;
case 5:
sub_8056A3C(0x18, 8, 0x1D, 0xD, 1);
HandleBattleWindow(0x18, 8, 0x1D, 0xD, WINDOW_CLEAR);
gBattlescriptCurrInstr += 5;
break;
case 6:
@ -6231,26 +6231,26 @@ static void atk5B_yesnoboxstoplearningmove(void)
switch (gBattleScripting.learnMoveState)
{
case 0:
sub_8056A3C(0x18, 8, 0x1D, 0xD, 0);
sub_814F9EC(gText_BattleYesNoChoice, 0xC);
HandleBattleWindow(0x18, 8, 0x1D, 0xD, 0);
BattleHandleAddTextPrinter(gText_BattleYesNoChoice, 0xC);
gBattleScripting.learnMoveState++;
gBattleCommunication[CURSOR_POSITION] = 0;
BattleCreateCursorAt(0);
BattleCreateYesNoCursorAt(0);
break;
case 1:
if (gMain.newKeys & DPAD_UP && gBattleCommunication[CURSOR_POSITION] != 0)
{
PlaySE(SE_SELECT);
BattleDestroyCursorAt(gBattleCommunication[CURSOR_POSITION]);
BattleDestroyYesNoCursorAt(gBattleCommunication[CURSOR_POSITION]);
gBattleCommunication[CURSOR_POSITION] = 0;
BattleCreateCursorAt(0);
BattleCreateYesNoCursorAt(0);
}
if (gMain.newKeys & DPAD_DOWN && gBattleCommunication[CURSOR_POSITION] == 0)
{
PlaySE(SE_SELECT);
BattleDestroyCursorAt(gBattleCommunication[CURSOR_POSITION]);
BattleDestroyYesNoCursorAt(gBattleCommunication[CURSOR_POSITION]);
gBattleCommunication[CURSOR_POSITION] = 1;
BattleCreateCursorAt(1);
BattleCreateYesNoCursorAt(1);
}
if (gMain.newKeys & A_BUTTON)
{
@ -6261,13 +6261,13 @@ static void atk5B_yesnoboxstoplearningmove(void)
else
gBattlescriptCurrInstr += 5;
sub_8056A3C(0x18, 0x8, 0x1D, 0xD, 1);
HandleBattleWindow(0x18, 0x8, 0x1D, 0xD, WINDOW_CLEAR);
}
else if (gMain.newKeys & B_BUTTON)
{
PlaySE(SE_SELECT);
gBattlescriptCurrInstr = BSScriptReadPtr(gBattlescriptCurrInstr + 1);
sub_8056A3C(0x18, 0x8, 0x1D, 0xD, 1);
HandleBattleWindow(0x18, 0x8, 0x1D, 0xD, WINDOW_CLEAR);
}
break;
}
@ -6527,38 +6527,38 @@ static void atk67_yesnobox(void)
switch (gBattleCommunication[0])
{
case 0:
sub_8056A3C(0x18, 8, 0x1D, 0xD, 0);
sub_814F9EC(gText_BattleYesNoChoice, 0xC);
HandleBattleWindow(0x18, 8, 0x1D, 0xD, 0);
BattleHandleAddTextPrinter(gText_BattleYesNoChoice, 0xC);
gBattleCommunication[0]++;
gBattleCommunication[CURSOR_POSITION] = 0;
BattleCreateCursorAt(0);
BattleCreateYesNoCursorAt(0);
break;
case 1:
if (gMain.newKeys & DPAD_UP && gBattleCommunication[CURSOR_POSITION] != 0)
{
PlaySE(SE_SELECT);
BattleDestroyCursorAt(gBattleCommunication[CURSOR_POSITION]);
BattleDestroyYesNoCursorAt(gBattleCommunication[CURSOR_POSITION]);
gBattleCommunication[CURSOR_POSITION] = 0;
BattleCreateCursorAt(0);
BattleCreateYesNoCursorAt(0);
}
if (gMain.newKeys & DPAD_DOWN && gBattleCommunication[CURSOR_POSITION] == 0)
{
PlaySE(SE_SELECT);
BattleDestroyCursorAt(gBattleCommunication[CURSOR_POSITION]);
BattleDestroyYesNoCursorAt(gBattleCommunication[CURSOR_POSITION]);
gBattleCommunication[CURSOR_POSITION] = 1;
BattleCreateCursorAt(1);
BattleCreateYesNoCursorAt(1);
}
if (gMain.newKeys & B_BUTTON)
{
gBattleCommunication[CURSOR_POSITION] = 1;
PlaySE(SE_SELECT);
sub_8056A3C(0x18, 8, 0x1D, 0xD, 1);
HandleBattleWindow(0x18, 8, 0x1D, 0xD, WINDOW_CLEAR);
gBattlescriptCurrInstr++;
}
else if (gMain.newKeys & A_BUTTON)
{
PlaySE(SE_SELECT);
sub_8056A3C(0x18, 8, 0x1D, 0xD, 1);
HandleBattleWindow(0x18, 8, 0x1D, 0xD, WINDOW_CLEAR);
gBattlescriptCurrInstr++;
}
break;
@ -6674,7 +6674,7 @@ static void atk6C_draw_lvlupbox(void)
SetBgAttribute(1, BG_CTRL_ATTR_MOSAIC, 0);
ShowBg(0);
ShowBg(1);
sub_8056A3C(0x12, 7, 0x1D, 0x13, 0x80);
HandleBattleWindow(0x12, 7, 0x1D, 0x13, WINDOW_x80);
gBattleScripting.atk6C_state = 4;
break;
case 4:
@ -6704,7 +6704,7 @@ static void atk6C_draw_lvlupbox(void)
if (gMain.newKeys != 0)
{
PlaySE(SE_SELECT);
sub_8056A3C(0x12, 7, 0x1D, 0x13, 0x81);
HandleBattleWindow(0x12, 7, 0x1D, 0x13, WINDOW_x80 | WINDOW_CLEAR);
gBattleScripting.atk6C_state++;
}
break;
@ -7136,8 +7136,8 @@ static void atk76_various(void)
gDisableStructs[0].truantUnknownBit = 1;
gDisableStructs[1].truantUnknownBit = 1;
break;
case 13:
EmitCmd19(0);
case VARIOUS_EMIT_YESNOBOX:
EmitUnknownYesNoBox(0);
MarkBufferBankForExecution(gActiveBank);
break;
case 14:
@ -7148,7 +7148,7 @@ static void atk76_various(void)
break;
case 16:
BattleStringExpandPlaceholdersToDisplayedString(gRefereeStringsTable[gBattlescriptCurrInstr[1]]);
sub_814F9EC(gDisplayedStringBattle, 0x16);
BattleHandleAddTextPrinter(gDisplayedStringBattle, 0x16);
break;
case 17:
if (IsTextPrinterActive(0x16))
@ -7255,7 +7255,7 @@ static void atk78_faintifabilitynotdamp(void)
{
gActiveBank = gBankAttacker;
gBattleMoveDamage = gBattleMons[gActiveBank].hp;
EmitHealthBarUpdate(0, 0x7FFF);
EmitHealthBarUpdate(0, INSTANT_HP_BAR_DROP);
MarkBufferBankForExecution(gActiveBank);
gBattlescriptCurrInstr++;
@ -7933,7 +7933,7 @@ static void atk8F_forcerandomswitch(void)
else if ((gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_LINK)
|| (gBattleTypeFlags & BATTLE_TYPE_MULTI && gBattleTypeFlags & BATTLE_TYPE_x2000000))
{
if (sub_806D82C(sub_806D864(gBankTarget)) == 1)
if (sub_806D82C(GetBankMultiplayerId(gBankTarget)) == 1)
{
firstMonId = 3;
lastMonId = 6;
@ -8443,7 +8443,7 @@ static void atk9B_transformdataexecution(void)
gBattleMons[gBankAttacker].status2 |= STATUS2_TRANSFORMED;
gDisableStructs[gBankAttacker].disabledMove = 0;
gDisableStructs[gBankAttacker].disableTimer1 = 0;
gDisableStructs[gBankAttacker].unk0 = gBattleMons[gBankTarget].personality;
gDisableStructs[gBankAttacker].transformedMonPersonality = gBattleMons[gBankTarget].personality;
gDisableStructs[gBankAttacker].unk18_b = 0;
PREPARE_SPECIES_BUFFER(gBattleTextBuff1, gBattleMons[gBankTarget].species)
@ -9152,7 +9152,7 @@ static void atkA8_copymovepermanently(void) // sketch
for (i = 0; i < 4; i++)
{
movePpData.move[i] = gBattleMons[gBankAttacker].moves[i];
movePpData.moves[i] = gBattleMons[gBankAttacker].moves[i];
movePpData.pp[i] = gBattleMons[gBankAttacker].pp[i];
}
movePpData.ppBonuses = gBattleMons[gBankAttacker].ppBonuses;
@ -10184,7 +10184,7 @@ static void atkC9_jumpifattackandspecialattackcannotfall(void) // memento
{
gActiveBank = gBankAttacker;
gBattleMoveDamage = gBattleMons[gActiveBank].hp;
EmitHealthBarUpdate(0, 0x7FFF);
EmitHealthBarUpdate(0, INSTANT_HP_BAR_DROP);
MarkBufferBankForExecution(gActiveBank);
gBattlescriptCurrInstr += 5;
}
@ -11003,13 +11003,13 @@ static void atkEF_pokeball_catch_calculation(void)
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER)
{
EmitBallThrow(0, BALL_TRAINER_BLOCK);
EmitBallThrowAnim(0, BALL_TRAINER_BLOCK);
MarkBufferBankForExecution(gActiveBank);
gBattlescriptCurrInstr = BattleScript_TrainerBallBlock;
}
else if (gBattleTypeFlags & BATTLE_TYPE_WALLY_TUTORIAL)
{
EmitBallThrow(0, BALL_3_SHAKES_SUCCESS);
EmitBallThrowAnim(0, BALL_3_SHAKES_SUCCESS);
MarkBufferBankForExecution(gActiveBank);
gBattlescriptCurrInstr = BattleScript_WallyBallThrow;
}
@ -11098,7 +11098,7 @@ static void atkEF_pokeball_catch_calculation(void)
if (odds > 254) // mon caught
{
EmitBallThrow(0, BALL_3_SHAKES_SUCCESS);
EmitBallThrowAnim(0, BALL_3_SHAKES_SUCCESS);
MarkBufferBankForExecution(gActiveBank);
gBattlescriptCurrInstr = BattleScript_SuccessBallThrow;
SetMonData(&gEnemyParty[gBattlePartyID[gBankTarget]], MON_DATA_POKEBALL, &gLastUsedItem);
@ -11120,7 +11120,7 @@ static void atkEF_pokeball_catch_calculation(void)
if (gLastUsedItem == ITEM_MASTER_BALL)
shakes = BALL_3_SHAKES_SUCCESS; // why calculate the shakes before that check?
EmitBallThrow(0, shakes);
EmitBallThrowAnim(0, shakes);
MarkBufferBankForExecution(gActiveBank);
if (shakes == BALL_3_SHAKES_SUCCESS) // mon caught, copy of the code above
@ -11238,7 +11238,7 @@ static void atkF2_display_dex_info(void)
}
}
void sub_8056A3C(u8 xStart, u8 yStart, u8 xEnd, u8 yEnd, u8 flags)
void HandleBattleWindow(u8 xStart, u8 yStart, u8 xEnd, u8 yEnd, u8 flags)
{
s32 destY, destX;
u16 var = 0;
@ -11275,10 +11275,10 @@ void sub_8056A3C(u8 xStart, u8 yStart, u8 xEnd, u8 yEnd, u8 flags)
var = 0x1026;
}
if (flags & 1)
if (flags & WINDOW_CLEAR)
var = 0;
if (flags & 0x80)
if (flags & WINDOW_x80)
CopyToBgTilemapBufferRect_ChangePalette(1, &var, destX, destY, 1, 1, 0x11);
else
CopyToBgTilemapBufferRect_ChangePalette(0, &var, destX, destY, 1, 1, 0x11);
@ -11286,7 +11286,7 @@ void sub_8056A3C(u8 xStart, u8 yStart, u8 xEnd, u8 yEnd, u8 flags)
}
}
void BattleCreateCursorAt(u8 cursorPosition)
void BattleCreateYesNoCursorAt(u8 cursorPosition)
{
u16 src[2];
src[0] = 1;
@ -11296,7 +11296,7 @@ void BattleCreateCursorAt(u8 cursorPosition)
CopyBgTilemapBufferToVram(0);
}
void BattleDestroyCursorAt(u8 cursorPosition)
void BattleDestroyYesNoCursorAt(u8 cursorPosition)
{
u16 src[2];
src[0] = 0x1016;
@ -11311,26 +11311,26 @@ static void atkF3_nickname_caught_poke(void)
switch (gBattleCommunication[MULTIUSE_STATE])
{
case 0:
sub_8056A3C(0x18, 8, 0x1D, 0xD, 0);
sub_814F9EC(gText_BattleYesNoChoice, 0xC);
HandleBattleWindow(0x18, 8, 0x1D, 0xD, 0);
BattleHandleAddTextPrinter(gText_BattleYesNoChoice, 0xC);
gBattleCommunication[MULTIUSE_STATE]++;
gBattleCommunication[CURSOR_POSITION] = 0;
BattleCreateCursorAt(0);
BattleCreateYesNoCursorAt(0);
break;
case 1:
if (gMain.newKeys & DPAD_UP && gBattleCommunication[CURSOR_POSITION] != 0)
{
PlaySE(SE_SELECT);
BattleDestroyCursorAt(gBattleCommunication[CURSOR_POSITION]);
BattleDestroyYesNoCursorAt(gBattleCommunication[CURSOR_POSITION]);
gBattleCommunication[CURSOR_POSITION] = 0;
BattleCreateCursorAt(0);
BattleCreateYesNoCursorAt(0);
}
if (gMain.newKeys & DPAD_DOWN && gBattleCommunication[CURSOR_POSITION] == 0)
{
PlaySE(SE_SELECT);
BattleDestroyCursorAt(gBattleCommunication[CURSOR_POSITION]);
BattleDestroyYesNoCursorAt(gBattleCommunication[CURSOR_POSITION]);
gBattleCommunication[CURSOR_POSITION] = 1;
BattleCreateCursorAt(1);
BattleCreateYesNoCursorAt(1);
}
if (gMain.newKeys & A_BUTTON)
{

View File

@ -1729,7 +1729,7 @@ bool8 sub_80423F4(u8 bank, u8 r1, u8 r2)
if (GetBankSide(bank) == SIDE_PLAYER)
{
party = gPlayerParty;
r7 = sub_806D864(bank);
r7 = GetBankMultiplayerId(bank);
r6 = sub_806D82C(r7);
}
else
@ -1748,7 +1748,7 @@ bool8 sub_80423F4(u8 bank, u8 r1, u8 r2)
}
else
{
r7 = sub_806D864(bank);
r7 = GetBankMultiplayerId(bank);
if (GetBankSide(bank) == SIDE_PLAYER)
party = gPlayerParty;
else

611
src/evolution_graphics.c Normal file
View File

@ -0,0 +1,611 @@
#include "global.h"
#include "evolution_graphics.h"
#include "sprite.h"
#include "trig.h"
#include "rng.h"
#include "decompress.h"
#include "task.h"
#include "sound.h"
#include "songs.h"
#include "palette.h"
// this file's functions
static void EvoSparkle_DummySpriteCb(struct Sprite* sprite);
static void EvoTask_BeginPreSet1_FadeAndPlaySE(u8 taskID);
static void EvoTask_CreatePreEvoSparkleSet1(u8 taskID);
static void EvoTask_WaitForPre1SparklesToGoUp(u8 taskID);
static void EvoTask_BeginPreSparklesSet2(u8 taskID);
static void EvoTask_CreatePreEvoSparklesSet2(u8 taskID);
static void EvoTask_DestroyPreSet2Task(u8 taskID);
static void EvoTask_BeginPostSparklesSet1(u8 taskID);
static void EvoTask_CreatePostEvoSparklesSet1(u8 taskID);
static void EvoTask_DestroyPostSet1Task(u8 taskID);
static void EvoTask_BeginPostSparklesSet2_AndFlash(u8 taskID);
static void EvoTask_CreatePostEvoSparklesSet2_AndFlash(u8 taskID);
static void EvoTask_BeginPostSparklesSet2_AndFlash_Trade(u8 taskID);
static void EvoTask_CreatePostEvoSparklesSet2_AndFlash_Trade(u8 taskID);
static void EvoTask_DestroyPostSet2AndFlashTask(u8 taskID);
static void sub_817C4EC(u8 taskID);
static void sub_817C510(u8 taskID);
static void PreEvoVisible_PostEvoInvisible_KillTask(u8 taskID);
static void PreEvoInvisible_PostEvoVisible_KillTask(u8 taskID);
static void sub_817C560(u8 taskID);
static const u16 sEvoSparklePalette[] = INCBIN_U16("graphics/misc/evo_sparkle.gbapal");
static const u8 sEvoSparkleTiles[] = INCBIN_U8("graphics/misc/evo_sparkle.4bpp.lz");
static const struct CompressedSpriteSheet sEvoSparkleSpriteSheets[] =
{
{sEvoSparkleTiles, 0x20, 1001},
{NULL, 0, 0}
};
static const struct SpritePalette sEvoSparkleSpritePals[] =
{
{sEvoSparklePalette, 1001},
{NULL, 0}
};
static const struct OamData sOamData_EvoSparkle =
{
.y = 160,
.affineMode = 0,
.objMode = 0,
.mosaic = 0,
.bpp = 0,
.shape = 0,
.x = 0,
.matrixNum = 0,
.size = 0,
.tileNum = 0,
.priority = 1,
.paletteNum = 0,
.affineParam = 0,
};
static const union AnimCmd sSpriteAnim_EvoSparkle[] =
{
ANIMCMD_FRAME(0, 8),
ANIMCMD_END
};
static const union AnimCmd *const sSpriteAnimTable_EvoSparkle[] =
{
sSpriteAnim_EvoSparkle,
};
static const struct SpriteTemplate sEvoSparkleSpriteTemplate =
{
.tileTag = 1001,
.paletteTag = 1001,
.oam = &sOamData_EvoSparkle,
.anims = sSpriteAnimTable_EvoSparkle,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = EvoSparkle_DummySpriteCb
};
static const s16 sEvoSparkleMatrices[] =
{
0x3C0, 0x380, 0x340, 0x300, 0x2C0, 0x280, 0x240, 0x200, 0x1C0,
0x180, 0x140, 0x100, -4, 0x10, -3, 0x30, -2, 0x50,
-1, 0x70, 0x1, 0x70, 0x2, 0x50, 0x3, 0x30, 0x4, 0x10
};
static void EvoSparkle_DummySpriteCb(struct Sprite *sprite)
{
}
static void SetEvoSparklesMatrices(void)
{
u16 i;
for (i = 0; i < 12; i++)
{
SetOamMatrix(20 + i, sEvoSparkleMatrices[i], 0, 0, sEvoSparkleMatrices[i]);
}
}
static void SpriteCB_PreEvoSparkleSet1(struct Sprite* sprite)
{
if (sprite->pos1.y > 8)
{
u8 matrixNum;
sprite->pos1.y = 88 - (sprite->data7 * sprite->data7) / 80;
sprite->pos2.y = Sin((u8)(sprite->data6), sprite->data5) / 4;
sprite->pos2.x = Cos((u8)(sprite->data6), sprite->data5);
sprite->data6 += 4;
if (sprite->data7 & 1)
sprite->data5--;
sprite->data7++;
if (sprite->pos2.y > 0)
sprite->subpriority = 1;
else
sprite->subpriority = 20;
matrixNum = sprite->data5 / 4 + 20;
if (matrixNum > 31)
matrixNum = 31;
sprite->oam.matrixNum = matrixNum;
}
else
DestroySprite(sprite);
}
static void CreatePreEvoSparkleSet1(u8 arg0)
{
u8 spriteID = CreateSprite(&sEvoSparkleSpriteTemplate, 120, 88, 0);
if (spriteID != MAX_SPRITES)
{
gSprites[spriteID].data5 = 48;
gSprites[spriteID].data6 = arg0;
gSprites[spriteID].data7 = 0;
gSprites[spriteID].oam.affineMode = 1;
gSprites[spriteID].oam.matrixNum = 31;
gSprites[spriteID].callback = SpriteCB_PreEvoSparkleSet1;
}
}
static void SpriteCB_PreEvoSparkleSet2(struct Sprite* sprite)
{
if (sprite->pos1.y < 88)
{
sprite->pos1.y = 8 + (sprite->data7 * sprite->data7) / 5;
sprite->pos2.y = Sin((u8)(sprite->data6), sprite->data5) / 4;
sprite->pos2.x = Cos((u8)(sprite->data6), sprite->data5);
sprite->data5 = 8 + Sin((u8)(sprite->data7 * 4), 40);
sprite->data7++;
}
else
DestroySprite(sprite);
}
static void CreatePreEvoSparkleSet2(u8 arg0)
{
u8 spriteID = CreateSprite(&sEvoSparkleSpriteTemplate, 120, 8, 0);
if (spriteID != MAX_SPRITES)
{
gSprites[spriteID].data5 = 8;
gSprites[spriteID].data6 = arg0;
gSprites[spriteID].data7 = 0;
gSprites[spriteID].oam.affineMode = 1;
gSprites[spriteID].oam.matrixNum = 25;
gSprites[spriteID].subpriority = 1;
gSprites[spriteID].callback = SpriteCB_PreEvoSparkleSet2;
}
}
static void SpriteCB_PostEvoSparkleSet1(struct Sprite* sprite)
{
if (sprite->data5 > 8)
{
sprite->pos2.y = Sin((u8)(sprite->data6), sprite->data5);
sprite->pos2.x = Cos((u8)(sprite->data6), sprite->data5);
sprite->data5 -= sprite->data3;
sprite->data6 += 4;
}
else
DestroySprite(sprite);
}
static void CreatePostEvoSparkleSet1(u8 arg0, u8 arg1)
{
u8 spriteID = CreateSprite(&sEvoSparkleSpriteTemplate, 120, 56, 0);
if (spriteID != MAX_SPRITES)
{
gSprites[spriteID].data3 = arg1;
gSprites[spriteID].data5 = 120;
gSprites[spriteID].data6 = arg0;
gSprites[spriteID].data7 = 0;
gSprites[spriteID].oam.affineMode = 1;
gSprites[spriteID].oam.matrixNum = 31;
gSprites[spriteID].subpriority = 1;
gSprites[spriteID].callback = SpriteCB_PostEvoSparkleSet1;
}
}
static void SpriteCB_PostEvoSparkleSet2(struct Sprite* sprite)
{
if (!(sprite->data7 & 3))
sprite->pos1.y++;
if (sprite->data6 < 128)
{
u8 matrixNum;
sprite->pos2.y = -Sin((u8)(sprite->data6), sprite->data5);
sprite->pos1.x = 120 + (sprite->data3 * sprite->data7) / 3;
sprite->data6++;
matrixNum = 31 - (sprite->data6 * 12 / 128);
if (sprite->data6 > 64)
sprite->subpriority = 1;
else
{
sprite->invisible = 0;
sprite->subpriority = 20;
if (sprite->data6 > 112 && sprite->data6 & 1)
sprite->invisible = 1;
}
if (matrixNum < 20)
matrixNum = 20;
sprite->oam.matrixNum = matrixNum;
sprite->data7++;
}
else
DestroySprite(sprite);
}
static void CreatePostEvoSparkleSet2(u8 arg0)
{
u8 spriteID = CreateSprite(&sEvoSparkleSpriteTemplate, 120, 56, 0);
if (spriteID != MAX_SPRITES)
{
gSprites[spriteID].data3 = 3 - (Random() % 7);
gSprites[spriteID].data5 = 48 + (Random() & 0x3F);
gSprites[spriteID].data7 = 0;
gSprites[spriteID].oam.affineMode = 1;
gSprites[spriteID].oam.matrixNum = 31;
gSprites[spriteID].subpriority = 20;
gSprites[spriteID].callback = SpriteCB_PostEvoSparkleSet2;
}
}
void LoadEvoSparkleSpriteAndPal(void)
{
LoadCompressedObjectPicUsingHeap(&sEvoSparkleSpriteSheets[0]);
LoadSpritePalettes(sEvoSparkleSpritePals);
}
#define tFrameCounter data[15]
u8 LaunchTask_PreEvoSparklesSet1(u16 arg0)
{
u8 taskID = CreateTask(EvoTask_BeginPreSet1_FadeAndPlaySE, 0);
gTasks[taskID].data[1] = arg0;
return taskID;
}
static void EvoTask_BeginPreSet1_FadeAndPlaySE(u8 taskID)
{
SetEvoSparklesMatrices();
gTasks[taskID].tFrameCounter = 0;
BeginNormalPaletteFade(3 << gTasks[taskID].data[1], 0xA, 0, 0x10, 0x7FFF);
gTasks[taskID].func = EvoTask_CreatePreEvoSparkleSet1;
PlaySE(SE_W025);
}
static void EvoTask_CreatePreEvoSparkleSet1(u8 taskID)
{
if (gTasks[taskID].tFrameCounter < 64)
{
if (!(gTasks[taskID].tFrameCounter & 7))
{
u8 i;
for (i = 0; i < 4; i++)
CreatePreEvoSparkleSet1((0x78 & gTasks[taskID].tFrameCounter) * 2 + i * 64);
}
gTasks[taskID].tFrameCounter++;
}
else
{
gTasks[taskID].tFrameCounter = 96;
gTasks[taskID].func = EvoTask_WaitForPre1SparklesToGoUp;
}
}
static void EvoTask_WaitForPre1SparklesToGoUp(u8 taskID)
{
if (gTasks[taskID].tFrameCounter != 0)
gTasks[taskID].tFrameCounter--;
else
DestroyTask(taskID);
}
u8 LaunchTask_PreEvoSparklesSet2(void)
{
return CreateTask(EvoTask_BeginPreSparklesSet2, 0);
}
static void EvoTask_BeginPreSparklesSet2(u8 taskID)
{
SetEvoSparklesMatrices();
gTasks[taskID].tFrameCounter = 0;
gTasks[taskID].func = EvoTask_CreatePreEvoSparklesSet2;
PlaySE(SE_W062B);
}
static void EvoTask_CreatePreEvoSparklesSet2(u8 taskID)
{
if (gTasks[taskID].tFrameCounter < 96)
{
if (gTasks[taskID].tFrameCounter < 6)
{
u8 i;
for (i = 0; i < 9; i++)
CreatePreEvoSparkleSet2(i * 16);
}
gTasks[taskID].tFrameCounter++;
}
else
gTasks[taskID].func = EvoTask_DestroyPreSet2Task;
}
static void EvoTask_DestroyPreSet2Task(u8 taskID)
{
DestroyTask(taskID);
}
u8 LaunchTask_PostEvoSparklesSet1(void)
{
return CreateTask(EvoTask_BeginPostSparklesSet1, 0);
}
static void EvoTask_BeginPostSparklesSet1(u8 taskID)
{
SetEvoSparklesMatrices();
gTasks[taskID].tFrameCounter = 0;
gTasks[taskID].func = EvoTask_CreatePostEvoSparklesSet1;
PlaySE(SE_REAPOKE);
}
static void EvoTask_CreatePostEvoSparklesSet1(u8 taskID)
{
if (gTasks[taskID].tFrameCounter < 48)
{
if (gTasks[taskID].tFrameCounter == 0)
{
u8 i;
for (i = 0; i < 16; i++)
CreatePostEvoSparkleSet1(i * 16, 4);
}
if (gTasks[taskID].tFrameCounter == 32)
{
u8 i;
for (i = 0; i < 16; i++)
CreatePostEvoSparkleSet1(i * 16, 8);
}
gTasks[taskID].tFrameCounter++;
}
else
gTasks[taskID].func = EvoTask_DestroyPostSet1Task;
}
static void EvoTask_DestroyPostSet1Task(u8 taskID)
{
DestroyTask(taskID);
}
u8 LaunchTask_PostEvoSparklesSet2AndFlash(u16 species)
{
u8 taskID = CreateTask(EvoTask_BeginPostSparklesSet2_AndFlash, 0);
gTasks[taskID].data[2] = species;
return taskID;
}
static void EvoTask_BeginPostSparklesSet2_AndFlash(u8 taskID)
{
SetEvoSparklesMatrices();
gTasks[taskID].tFrameCounter = 0;
CpuSet(&gPlttBufferFaded[0x20], &gPlttBufferUnfaded[0x20], 0x30);
BeginNormalPaletteFade(0xFFF9041C, 0, 0, 0x10, 0x7FFF); // was 0xFFF9001C in R/S
gTasks[taskID].func = EvoTask_CreatePostEvoSparklesSet2_AndFlash;
PlaySE(SE_W080);
}
static void EvoTask_CreatePostEvoSparklesSet2_AndFlash(u8 taskID)
{
if (gTasks[taskID].tFrameCounter < 128)
{
u8 i;
switch (gTasks[taskID].tFrameCounter)
{
default:
if (gTasks[taskID].tFrameCounter < 50)
CreatePostEvoSparkleSet2(Random() & 7);
break;
case 0:
for (i = 0; i < 8; i++)
CreatePostEvoSparkleSet2(i);
break;
case 32:
BeginNormalPaletteFade(0xFFFF041C, 0x10, 0x10, 0, 0x7FFF); // was 0xFFF9001C in R/S
break;
}
gTasks[taskID].tFrameCounter++;
}
else
gTasks[taskID].func = EvoTask_DestroyPostSet2AndFlashTask;
}
static void EvoTask_DestroyPostSet2AndFlashTask(u8 taskID)
{
if (!gPaletteFade.active)
DestroyTask(taskID);
}
u8 LaunchTask_PostEvoSparklesSet2AndFlash_Trade(u16 species)
{
u8 taskID = CreateTask(EvoTask_BeginPostSparklesSet2_AndFlash_Trade, 0);
gTasks[taskID].data[2] = species;
return taskID;
}
static void EvoTask_BeginPostSparklesSet2_AndFlash_Trade(u8 taskID)
{
SetEvoSparklesMatrices();
gTasks[taskID].tFrameCounter = 0;
CpuSet(&gPlttBufferFaded[0x20], &gPlttBufferUnfaded[0x20], 0x30);
BeginNormalPaletteFade(0xFFF90400, 0, 0, 0x10, 0x7FFF); // was 0xFFFF0001 in R/S
gTasks[taskID].func = EvoTask_CreatePostEvoSparklesSet2_AndFlash_Trade;
PlaySE(SE_W080);
}
static void EvoTask_CreatePostEvoSparklesSet2_AndFlash_Trade(u8 taskID)
{
if (gTasks[taskID].tFrameCounter < 128)
{
u8 i;
switch (gTasks[taskID].tFrameCounter)
{
default:
if (gTasks[taskID].tFrameCounter < 50)
CreatePostEvoSparkleSet2(Random() & 7);
break;
case 0:
for (i = 0; i < 8; i++)
CreatePostEvoSparkleSet2(i);
break;
case 32:
BeginNormalPaletteFade(0xFFFF0400, 0x10, 0x10, 0, 0x7FFF); // was 0xFFFF0001 in R/S
break;
}
gTasks[taskID].tFrameCounter++;
}
else
gTasks[taskID].func = EvoTask_DestroyPostSet2AndFlashTask;
}
#undef tFrameCounter
static void PokeEvoSprite_DummySpriteCB(struct Sprite* sprite)
{
}
#define tPreEvoSpriteID data[1]
#define tPostEvoSpriteID data[2]
#define tEvoStopped data[8]
u8 sub_817C3A0(u8 preEvoSpriteID, u8 postEvoSpriteID)
{
u16 i;
u16 stack[16];
u8 taskID;
s32 toDiv;
for (i = 0; i < 16; i++)
stack[i] = 0x7FFF;
taskID = CreateTask(sub_817C4EC, 0);
gTasks[taskID].tPreEvoSpriteID = preEvoSpriteID;
gTasks[taskID].tPostEvoSpriteID = postEvoSpriteID;
gTasks[taskID].data[3] = 256;
gTasks[taskID].data[4] = 16;
toDiv = 65536;
SetOamMatrix(30, 256, 0, 0, 256);
SetOamMatrix(31, toDiv / gTasks[taskID].data[4], 0, 0, toDiv / gTasks[taskID].data[4]);
gSprites[preEvoSpriteID].callback = PokeEvoSprite_DummySpriteCB;
gSprites[preEvoSpriteID].oam.affineMode = 1;
gSprites[preEvoSpriteID].oam.matrixNum = 30;
gSprites[preEvoSpriteID].invisible = 0;
CpuSet(stack, &gPlttBufferFaded[0x100 + (gSprites[preEvoSpriteID].oam.paletteNum * 16)], 16);
gSprites[postEvoSpriteID].callback = PokeEvoSprite_DummySpriteCB;
gSprites[postEvoSpriteID].oam.affineMode = 1;
gSprites[postEvoSpriteID].oam.matrixNum = 31;
gSprites[postEvoSpriteID].invisible = 0;
CpuSet(stack, &gPlttBufferFaded[0x100 + (gSprites[postEvoSpriteID].oam.paletteNum * 16)], 16);
gTasks[taskID].tEvoStopped = FALSE;
return taskID;
}
static void sub_817C4EC(u8 taskID)
{
gTasks[taskID].data[5] = 0;
gTasks[taskID].data[6] = 8;
gTasks[taskID].func = sub_817C510;
}
static void sub_817C510(u8 taskID)
{
if (gTasks[taskID].tEvoStopped)
PreEvoVisible_PostEvoInvisible_KillTask(taskID);
else if (gTasks[taskID].data[6] == 128)
PreEvoInvisible_PostEvoVisible_KillTask(taskID);
else
{
gTasks[taskID].data[6] += 2;
gTasks[taskID].data[5] ^= 1;
gTasks[taskID].func = sub_817C560;
}
}
static void sub_817C560(u8 taskID)
{
if (gTasks[taskID].tEvoStopped)
gTasks[taskID].func = PreEvoVisible_PostEvoInvisible_KillTask;
else
{
u16 oamMatrixArg;
u8 r6 = 0;
if (gTasks[taskID].data[5] == 0)
{
if (gTasks[taskID].data[3] < 256 - gTasks[taskID].data[6])
gTasks[taskID].data[3] += gTasks[taskID].data[6];
else
{
gTasks[taskID].data[3] = 256;
r6++;
}
if (gTasks[taskID].data[4] > 16 + gTasks[taskID].data[6])
gTasks[taskID].data[4] -= gTasks[taskID].data[6];
else
{
gTasks[taskID].data[4] = 16;
r6++;
}
}
else
{
if (gTasks[taskID].data[4] < 256 - gTasks[taskID].data[6])
gTasks[taskID].data[4] += gTasks[taskID].data[6];
else
{
gTasks[taskID].data[4] = 256;
r6++;
}
if (gTasks[taskID].data[3] > 16 + gTasks[taskID].data[6])
gTasks[taskID].data[3] -= gTasks[taskID].data[6];
else
{
gTasks[taskID].data[3] = 16;
r6++;
}
}
oamMatrixArg = 65536 / gTasks[taskID].data[3];
SetOamMatrix(30, oamMatrixArg, 0, 0, oamMatrixArg);
oamMatrixArg = 65536 / gTasks[taskID].data[4];
SetOamMatrix(31, oamMatrixArg, 0, 0, oamMatrixArg);
if (r6 == 2)
gTasks[taskID].func = sub_817C510;
}
}
static void PreEvoInvisible_PostEvoVisible_KillTask(u8 taskID)
{
gSprites[gTasks[taskID].tPreEvoSpriteID].oam.affineMode = 0;
gSprites[gTasks[taskID].tPreEvoSpriteID].oam.matrixNum = 0;
gSprites[gTasks[taskID].tPreEvoSpriteID].invisible = 1;
gSprites[gTasks[taskID].tPostEvoSpriteID].oam.affineMode = 0;
gSprites[gTasks[taskID].tPostEvoSpriteID].oam.matrixNum = 0;
gSprites[gTasks[taskID].tPostEvoSpriteID].invisible = 0;
DestroyTask(taskID);
}
static void PreEvoVisible_PostEvoInvisible_KillTask(u8 taskID)
{
gSprites[gTasks[taskID].tPreEvoSpriteID].oam.affineMode = 0;
gSprites[gTasks[taskID].tPreEvoSpriteID].oam.matrixNum = 0;
gSprites[gTasks[taskID].tPreEvoSpriteID].invisible = 0;
gSprites[gTasks[taskID].tPostEvoSpriteID].oam.affineMode = 0;
gSprites[gTasks[taskID].tPostEvoSpriteID].oam.matrixNum = 0;
gSprites[gTasks[taskID].tPostEvoSpriteID].invisible = 1;
DestroyTask(taskID);
}

1506
src/evolution_scene.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -84,7 +84,7 @@ bool8 ShouldGetStatBadgeBoost(u16 badgeFlag, u8 bank)
return FALSE;
}
u8 sub_8069F34(u8 bank)
u8 GetDefaultMoveTarget(u8 bank)
{
u8 status = GetBankIdentity(bank) & 1;
@ -194,6 +194,7 @@ void sub_806A1C0(u16 arg0, u8 bankIdentity)
gUnknown_0202499C = gMonSpritesGfxPtr->templates[bankIdentity];
else
gUnknown_0202499C = gUnknown_08329D98[bankIdentity];
gUnknown_0202499C.paletteTag = arg0;
gUnknown_0202499C.anims = gUnknown_0830536C[arg0];
}
@ -1304,7 +1305,7 @@ void RemoveBattleMonPPBonus(struct BattlePokemon *mon, u8 moveIndex)
}
void sub_803FA70(u8 bank);
void sub_805EF84(u8 bank, bool8);
void ClearTemporarySpeciesSpriteData(u8 bank, bool8);
extern struct BattlePokemon gBattleMons[4];
@ -1360,5 +1361,5 @@ void CopyPlayerPartyMonToBattleData(u8 bank, u8 partyIndex)
gBattleMons[bank].status2 = 0;
sub_803FA70(bank);
sub_805EF84(bank, FALSE);
ClearTemporarySpeciesSpriteData(bank, FALSE);
}

View File

@ -618,7 +618,7 @@ bool16 sub_806D82C(u8 id)
return retVal;
}
s32 sub_806D864(u16 a1)
s32 GetBankMultiplayerId(u16 a1)
{
s32 id;
for (id = 0; id < MAX_LINK_PLAYERS; id++)
@ -1267,10 +1267,10 @@ const struct CompressedSpritePalette *sub_806E794(struct Pokemon *mon)
u16 species = GetMonData(mon, MON_DATA_SPECIES2, 0);
u32 otId = GetMonData(mon, MON_DATA_OT_ID, 0);
u32 personality = GetMonData(mon, MON_DATA_PERSONALITY, 0);
return sub_806E7CC(species, otId, personality);
return GetMonSpritePalStructFromOtIdPersonality(species, otId, personality);
}
const struct CompressedSpritePalette *sub_806E7CC(u16 species, u32 otId , u32 personality)
const struct CompressedSpritePalette *GetMonSpritePalStructFromOtIdPersonality(u16 species, u32 otId , u32 personality)
{
u32 shinyValue;
@ -1477,7 +1477,7 @@ const u8* GetTrainerPartnerName(void)
else
{
u8 id = GetMultiplayerId();
return gLinkPlayers[sub_806D864(gLinkPlayers[id].lp_field_18 ^ 2)].name;
return gLinkPlayers[GetBankMultiplayerId(gLinkPlayers[id].lp_field_18 ^ 2)].name;
}
}
@ -1659,7 +1659,7 @@ u16 sub_806EFF0(u16 arg0)
return gUnknown_0831F578[arg0];
}
u16 sub_806F000(u8 playerGender)
u16 PlayerGenderToFrontTrainerPicId(u8 playerGender)
{
if (playerGender)
return sub_806EFF0(0x3F);

View File

@ -220,9 +220,9 @@ static bool8 LoadBankSpriteGfx(u8 bank)
BattleLoadSubstituteSpriteGfx(bank, FALSE);
}
else if (gBattleTypeFlags & BATTLE_TYPE_SAFARI && bank == 0)
LoadBackTrainerBankSpriteGfx(gSaveBlock2Ptr->playerGender, bank);
DecompressTrainerBackPic(gSaveBlock2Ptr->playerGender, bank);
else if (gBattleTypeFlags & BATTLE_TYPE_WALLY_TUTORIAL && bank == 0)
LoadBackTrainerBankSpriteGfx(BACK_PIC_WALLY, bank);
DecompressTrainerBackPic(BACK_PIC_WALLY, bank);
else if (!gBattleSpritesDataPtr->bankData[bank].behindSubstitute)
BattleLoadPlayerMonSpriteGfx(&gPlayerParty[gBattlePartyID[bank]], bank);
else

View File

@ -704,7 +704,7 @@ u8 sub_80E98AC(struct Pokemon *pokemon)
evTotal = GetMonData(pokemon, MON_DATA_HP_EV);
evTotal += GetMonData(pokemon, MON_DATA_ATK_EV);
evTotal += GetMonData(pokemon, MON_DATA_DEF_EV);
evTotal += GetMonData(pokemon, MON_DATA_SPD_EV);
evTotal += GetMonData(pokemon, MON_DATA_SPEED_EV);
evTotal += GetMonData(pokemon, MON_DATA_SPATK_EV);
evTotal += GetMonData(pokemon, MON_DATA_SPDEF_EV);
return evTotal / 6;

View File

@ -221,10 +221,10 @@ gBattleBankFunc: @ 3005D60
gHealthBoxesIds: @ 3005D70
.space 0x4
gUnknown_03005D74: @ 3005D74
gMultiUsePlayerCursor: @ 3005D74
.space 0x4
gUnknown_03005D78: @ 3005D78
gNumberOfMovesToChoose: @ 3005D78
.space 0x4
gUnknown_03005D7C: @ 3005D7C
@ -370,7 +370,7 @@ gUnknown_030061C4: @ 30061C4
gUnknown_030061D0: @ 30061D0
.space 0x18
gUnknown_030061E8: @ 30061E8
gCB2_AfterEvolution: @ 30061E8
.space 0x4
gUnknown_030061EC: @ 30061EC

View File

@ -495,10 +495,10 @@ gBankInMenu: @ 20244B8
gDoingBattleAnim: @ 20244B9
.space 0x3
gUnknown_020244BC: @ 20244BC
gTransformedPersonalities: @ 20244BC
.space 0x10
gUnknown_020244CC: @ 20244CC
gPlayerDpadHoldFrames: @ 20244CC
.space 0x4
gBattleSpritesDataPtr: @ 20244D0
@ -1272,11 +1272,7 @@ gUnknown_0203AB78: @ 203AB78
gUnknown_0203AB7C: @ 203AB7C
.space 0x4
gUnknown_0203AB80: @ 203AB80
.space 0x4
gUnknown_0203AB84: @ 203AB84
.space 0x4
.include "src/evolution_scene.o"
gUnknown_0203AB88: @ 203AB88
.space 0x4