mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 11:37:40 +01:00
pokemon2 get mon data troubles
This commit is contained in:
parent
5394435520
commit
8e88f2790a
@ -5708,7 +5708,7 @@ _08039A7C:
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
bl GetBankIdentity
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r1, [r1]
|
||||
lsls r0, 24
|
||||
lsrs r0, 22
|
||||
|
@ -1371,7 +1371,7 @@ _0805DC58:
|
||||
lsls r2, r5, 3
|
||||
ldr r1, =gMonFrontPicTable
|
||||
adds r2, r1
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r1, [r1]
|
||||
lsrs r0, 22
|
||||
adds r1, 0x4
|
||||
@ -1543,7 +1543,7 @@ _0805DE00:
|
||||
lsls r0, r5, 3
|
||||
ldr r1, =gMonBackPicTable
|
||||
adds r0, r1
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r1, [r1]
|
||||
lsls r2, r7, 2
|
||||
adds r1, 0x4
|
||||
@ -1558,7 +1558,7 @@ _0805DE2C:
|
||||
lsls r0, r5, 3
|
||||
ldr r1, =gMonBackPicTable
|
||||
adds r0, r1
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r1, [r1]
|
||||
lsls r2, r7, 2
|
||||
adds r1, 0x4
|
||||
@ -1684,7 +1684,7 @@ sub_805DF38: @ 805DF38
|
||||
lsls r4, 3
|
||||
ldr r2, =gTrainerFrontPicTable
|
||||
adds r2, r4, r2
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r1, [r1]
|
||||
lsrs r0, 22
|
||||
adds r1, 0x4
|
||||
@ -1718,7 +1718,7 @@ sub_805DF84: @ 805DF84
|
||||
lsls r5, 3
|
||||
ldr r2, =gTrainerBackPicTable
|
||||
adds r2, r5, r2
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r1, [r1]
|
||||
lsrs r0, 22
|
||||
adds r1, 0x4
|
||||
@ -1959,7 +1959,7 @@ _0805E1AE:
|
||||
load_gfxc_health_bar: @ 805E1B8
|
||||
push {lr}
|
||||
ldr r0, =gUnknown_08C093F0
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r1, [r1]
|
||||
movs r2, 0xBA
|
||||
lsls r2, 1
|
||||
@ -2364,7 +2364,7 @@ _0805E51C:
|
||||
lsls r0, r1, 3
|
||||
ldr r1, =gMonBackPicTable
|
||||
adds r0, r1
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r1, [r1]
|
||||
ldr r1, [r1, 0x4]
|
||||
ldr r3, [r2, 0x10]
|
||||
@ -2434,7 +2434,7 @@ _0805E59C:
|
||||
lsls r0, r1, 3
|
||||
ldr r1, =gMonBackPicTable
|
||||
adds r0, r1
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r1, [r1]
|
||||
mov r3, r10
|
||||
lsls r2, r3, 2
|
||||
@ -2472,7 +2472,7 @@ _0805E618:
|
||||
lsls r0, r1, 3
|
||||
ldr r1, =gMonFrontPicTable
|
||||
adds r0, r1
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r1, [r1]
|
||||
mov r3, r10
|
||||
lsls r2, r3, 2
|
||||
@ -2486,7 +2486,7 @@ _0805E618:
|
||||
mov r2, r8
|
||||
bl HandleLoadSpecialPokePic_DontHandleDeoxys
|
||||
_0805E662:
|
||||
ldr r0, =gBattleDecompressedSprites
|
||||
ldr r0, =gBattleSpritesGfx
|
||||
ldr r0, [r0]
|
||||
mov r2, r10
|
||||
lsls r1, r2, 2
|
||||
@ -2666,7 +2666,7 @@ _0805E814:
|
||||
beq _0805E83C
|
||||
ldr r0, =gUnknown_08C2CEE0
|
||||
_0805E822:
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r1, [r1]
|
||||
lsls r4, 2
|
||||
adds r1, 0x4
|
||||
@ -2677,7 +2677,7 @@ _0805E822:
|
||||
.pool
|
||||
_0805E83C:
|
||||
ldr r0, =gUnknown_08C2D120
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r1, [r1]
|
||||
lsls r4, 2
|
||||
adds r1, 0x4
|
||||
@ -2688,7 +2688,7 @@ _0805E84E:
|
||||
movs r3, 0x1
|
||||
lsls r6, r5, 4
|
||||
ldr r7, =gUnknown_08C2CEBC
|
||||
ldr r0, =gBattleDecompressedSprites
|
||||
ldr r0, =gBattleSpritesGfx
|
||||
ldr r0, [r0]
|
||||
adds r0, 0x4
|
||||
adds r4, r0, r4
|
||||
@ -3608,7 +3608,7 @@ init_uns_table_pokemon_copy: @ 805EFBC
|
||||
mov r5, r8
|
||||
push {r5-r7}
|
||||
movs r6, 0
|
||||
ldr r4, =gBattleDecompressedSprites
|
||||
ldr r4, =gBattleSpritesGfx
|
||||
str r6, [r4]
|
||||
movs r0, 0xC0
|
||||
lsls r0, 1
|
||||
@ -3620,7 +3620,7 @@ init_uns_table_pokemon_copy: @ 805EFBC
|
||||
ldr r1, [r4]
|
||||
str r0, [r1]
|
||||
_0805EFE2:
|
||||
ldr r0, =gBattleDecompressedSprites
|
||||
ldr r0, =gBattleSpritesGfx
|
||||
ldr r1, [r0]
|
||||
lsls r4, r6, 2
|
||||
adds r2, r1, 0x4
|
||||
@ -3649,7 +3649,7 @@ _0805EFE2:
|
||||
mov r12, r8
|
||||
adds r7, r4, 0
|
||||
_0805F01A:
|
||||
ldr r2, =gBattleDecompressedSprites
|
||||
ldr r2, =gBattleSpritesGfx
|
||||
ldr r1, [r2]
|
||||
lsls r4, r5, 3
|
||||
add r4, r12
|
||||
@ -3672,7 +3672,7 @@ _0805F01A:
|
||||
lsrs r5, r0, 24
|
||||
cmp r5, 0x3
|
||||
bls _0805F01A
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r2, [r1]
|
||||
mov r5, r9
|
||||
adds r0, r5, r6
|
||||
@ -3692,7 +3692,7 @@ _0805F01A:
|
||||
movs r0, 0x80
|
||||
lsls r0, 5
|
||||
bl AllocZeroed
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r1, [r1]
|
||||
movs r2, 0xBA
|
||||
lsls r2, 1
|
||||
@ -3711,7 +3711,7 @@ _0805F01A:
|
||||
thumb_func_start sub_805F094
|
||||
sub_805F094: @ 805F094
|
||||
push {r4-r6,lr}
|
||||
ldr r6, =gBattleDecompressedSprites
|
||||
ldr r6, =gBattleSpritesGfx
|
||||
ldr r0, [r6]
|
||||
cmp r0, 0
|
||||
beq _0805F106
|
||||
|
@ -14561,7 +14561,7 @@ _08105CCC:
|
||||
lsls r0, 6
|
||||
bl AllocZeroed
|
||||
adds r1, r0, 0
|
||||
ldr r0, =gBattleDecompressedSprites
|
||||
ldr r0, =gBattleSpritesGfx
|
||||
ldr r0, [r0]
|
||||
movs r2, 0xBE
|
||||
lsls r2, 1
|
||||
@ -14571,7 +14571,7 @@ _08105CCC:
|
||||
bl LZDecompressWram
|
||||
movs r4, 0
|
||||
_08105D00:
|
||||
ldr r5, =gBattleDecompressedSprites
|
||||
ldr r5, =gBattleSpritesGfx
|
||||
ldr r0, [r5]
|
||||
movs r1, 0xBE
|
||||
lsls r1, 1
|
||||
@ -49777,7 +49777,7 @@ sub_8117C44: @ 8117C44
|
||||
movs r0, 0x80
|
||||
lsls r0, 6
|
||||
bl AllocZeroed
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r1, [r1]
|
||||
movs r2, 0xBE
|
||||
lsls r2, 1
|
||||
@ -49797,7 +49797,7 @@ sub_8117C70: @ 8117C70
|
||||
adds r4, r0, 0
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
ldr r6, =gBattleDecompressedSprites
|
||||
ldr r6, =gBattleSpritesGfx
|
||||
ldr r0, [r6]
|
||||
movs r5, 0xBE
|
||||
lsls r5, 1
|
||||
@ -49866,7 +49866,7 @@ _08117CF6:
|
||||
adds r4, r0, 0
|
||||
adds r4, 0x10
|
||||
_08117CFC:
|
||||
ldr r0, =gBattleDecompressedSprites
|
||||
ldr r0, =gBattleSpritesGfx
|
||||
ldr r1, [r0]
|
||||
ldr r0, =gBattleAnimArgs
|
||||
movs r2, 0x2
|
||||
@ -49944,7 +49944,7 @@ _08117D98:
|
||||
lsls r0, r4, 5
|
||||
ldr r1, =gPlttBufferUnfaded
|
||||
adds r0, r1
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r2, [r1]
|
||||
ldr r1, =gBattleAnimArgs
|
||||
movs r3, 0x2
|
||||
@ -52081,7 +52081,7 @@ sub_8118FBC: @ 8118FBC
|
||||
bl GetBankByPlayerAI
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r2, [r1]
|
||||
lsls r4, 2
|
||||
adds r2, 0x4
|
||||
@ -52189,7 +52189,7 @@ sub_8119094: @ 8119094
|
||||
lsls r0, 24
|
||||
mov r9, r0
|
||||
ldr r4, =0x040000d4
|
||||
ldr r0, =gBattleDecompressedSprites
|
||||
ldr r0, =gBattleSpritesGfx
|
||||
ldr r0, [r0]
|
||||
lsrs r2, 22
|
||||
adds r0, 0x4
|
||||
|
@ -4280,7 +4280,7 @@ _0806694C:
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
mov r0, r8
|
||||
bl template_build_for_pokemon_or_trainer
|
||||
bl sub_806A12C
|
||||
ldr r6, =gUnknown_0202499C
|
||||
mov r9, r7
|
||||
ldr r1, =gUnknown_083054E0
|
||||
@ -4409,7 +4409,7 @@ _08066A76:
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
mov r0, r8
|
||||
bl template_build_for_pokemon_or_trainer
|
||||
bl sub_806A12C
|
||||
ldr r0, =gUnknown_0202499C
|
||||
ldr r2, =gUnknown_083054E0
|
||||
mov r3, r8
|
||||
|
@ -3703,7 +3703,7 @@ _0814D002:
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
adds r0, r4, 0
|
||||
bl template_build_for_pokemon_or_trainer
|
||||
bl sub_806A12C
|
||||
ldr r6, =gUnknown_0202499C
|
||||
mov r8, r7
|
||||
ldr r0, =gUnknown_08305D2C
|
||||
|
@ -4336,7 +4336,7 @@ _080617CA:
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
mov r0, r8
|
||||
bl template_build_for_pokemon_or_trainer
|
||||
bl sub_806A12C
|
||||
ldr r6, =gUnknown_0202499C
|
||||
mov r9, r7
|
||||
ldr r1, =gUnknown_083054E0
|
||||
@ -4562,7 +4562,7 @@ _080619DE:
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
mov r0, r8
|
||||
bl template_build_for_pokemon_or_trainer
|
||||
bl sub_806A12C
|
||||
ldr r0, =gUnknown_0202499C
|
||||
ldr r2, =gUnknown_083054E0
|
||||
mov r3, r8
|
||||
|
@ -7549,7 +7549,7 @@ _0805B794:
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
adds r0, r4, 0
|
||||
bl template_build_for_pokemon_or_trainer
|
||||
bl sub_806A12C
|
||||
ldr r6, =gUnknown_0202499C
|
||||
mov r8, r9
|
||||
lsls r4, r7, 16
|
||||
@ -7731,7 +7731,7 @@ _0805B926:
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
adds r0, r4, 0
|
||||
bl template_build_for_pokemon_or_trainer
|
||||
bl sub_806A12C
|
||||
ldr r0, =gUnknown_0202499C
|
||||
ldr r1, =gUnknown_08305D2C
|
||||
lsls r4, 2
|
||||
|
@ -4220,7 +4220,7 @@ _081BD3BE:
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
adds r0, r4, 0
|
||||
bl template_build_for_pokemon_or_trainer
|
||||
bl sub_806A12C
|
||||
ldr r6, =gUnknown_0202499C
|
||||
mov r8, r9
|
||||
lsls r4, r7, 16
|
||||
|
@ -4093,7 +4093,7 @@ _0818892C:
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
mov r0, r8
|
||||
bl template_build_for_pokemon_or_trainer
|
||||
bl sub_806A12C
|
||||
ldr r6, =gUnknown_0202499C
|
||||
mov r9, r7
|
||||
ldr r1, =gUnknown_083054E0
|
||||
|
@ -4189,7 +4189,7 @@ _0818BEDC:
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
adds r0, r4, 0
|
||||
bl template_build_for_pokemon_or_trainer
|
||||
bl sub_806A12C
|
||||
ldr r6, =gUnknown_0202499C
|
||||
mov r8, r9
|
||||
lsls r4, r7, 16
|
||||
|
@ -578,7 +578,7 @@ sub_8159800: @ 8159800
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
adds r0, r6, 0
|
||||
bl template_build_for_pokemon_or_trainer
|
||||
bl sub_806A12C
|
||||
ldr r0, =gUnknown_0202499C
|
||||
ldr r2, =gUnknown_08305D2C
|
||||
ldr r1, [r4]
|
||||
|
@ -3037,7 +3037,7 @@ sub_8169EC8: @ 8169EC8
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
movs r0, 0x6
|
||||
bl template_build_for_pokemon_or_trainer
|
||||
bl sub_806A12C
|
||||
ldr r0, =gUnknown_0202499C
|
||||
ldr r1, =gUnknown_08305D2C
|
||||
ldrb r1, [r1, 0x18]
|
||||
@ -3122,7 +3122,7 @@ dp01t_07_6_: @ 8169F94
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
movs r0, 0x6
|
||||
bl template_build_for_pokemon_or_trainer
|
||||
bl sub_806A12C
|
||||
ldr r0, =gUnknown_0202499C
|
||||
ldr r1, =gUnknown_08305D2C
|
||||
ldrb r1, [r1, 0x18]
|
||||
|
@ -547,7 +547,7 @@ _080D7B4E:
|
||||
strb r5, [r0]
|
||||
bl sub_80D7988
|
||||
bl init_uns_table_pokemon_copy
|
||||
ldr r4, =gBattleDecompressedSprites
|
||||
ldr r4, =gBattleSpritesGfx
|
||||
ldr r0, [r4]
|
||||
ldr r0, [r0]
|
||||
bl Free
|
||||
@ -6741,7 +6741,7 @@ sub_80DB174: @ 80DB174
|
||||
lsls r0, r5, 3
|
||||
ldr r1, =gMonBackPicTable
|
||||
adds r0, r1
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r1, [r1]
|
||||
ldr r1, [r1, 0x4]
|
||||
adds r2, r5, 0
|
||||
@ -6753,7 +6753,7 @@ _080DB1B8:
|
||||
lsls r0, r5, 3
|
||||
ldr r1, =gMonBackPicTable
|
||||
adds r0, r1
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r1, [r1]
|
||||
ldr r1, [r1, 0x4]
|
||||
adds r2, r5, 0
|
||||
|
@ -1364,7 +1364,7 @@ _080F6454:
|
||||
mov r9, r4
|
||||
ldr r4, =gMonFrontPicTable
|
||||
mov r12, r4
|
||||
ldr r4, =gBattleDecompressedSprites
|
||||
ldr r4, =gBattleSpritesGfx
|
||||
mov r8, r4
|
||||
cmp r0, 0
|
||||
beq _080F648C
|
||||
|
@ -581,7 +581,7 @@ sub_81302E8: @ 81302E8
|
||||
lsls r0, r5, 3
|
||||
ldr r1, =gMonFrontPicTable
|
||||
adds r0, r1
|
||||
ldr r4, =gBattleDecompressedSprites
|
||||
ldr r4, =gBattleSpritesGfx
|
||||
ldr r1, [r4]
|
||||
ldr r1, [r1, 0x8]
|
||||
ldr r2, [r6]
|
||||
@ -600,7 +600,7 @@ _08130348:
|
||||
lsls r0, r5, 3
|
||||
ldr r1, =gMonBackPicTable
|
||||
adds r0, r1
|
||||
ldr r4, =gBattleDecompressedSprites
|
||||
ldr r4, =gBattleSpritesGfx
|
||||
ldr r1, [r4]
|
||||
ldr r1, [r1, 0x4]
|
||||
ldr r2, [r6]
|
||||
|
@ -399,7 +399,7 @@ _08071688:
|
||||
lsls r0, r4, 3
|
||||
ldr r1, =gMonFrontPicTable
|
||||
adds r0, r1
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r2, [r1]
|
||||
mov r6, r8
|
||||
lsls r1, r6, 1
|
||||
|
@ -235,7 +235,7 @@ evolution_cutscene: @ 813DA8C
|
||||
lsls r0, r5, 3
|
||||
ldr r1, =gMonFrontPicTable
|
||||
adds r0, r1
|
||||
ldr r2, =gBattleDecompressedSprites
|
||||
ldr r2, =gBattleSpritesGfx
|
||||
ldr r1, [r2]
|
||||
ldr r1, [r1, 0x8]
|
||||
adds r2, r5, 0
|
||||
@ -291,7 +291,7 @@ evolution_cutscene: @ 813DA8C
|
||||
lsls r0, r1, 3
|
||||
ldr r2, =gMonFrontPicTable
|
||||
adds r0, r2
|
||||
ldr r2, =gBattleDecompressedSprites
|
||||
ldr r2, =gBattleSpritesGfx
|
||||
ldr r1, [r2]
|
||||
ldr r1, [r1, 0x10]
|
||||
mov r2, r10
|
||||
@ -492,7 +492,7 @@ sub_813DD7C: @ 813DD7C
|
||||
lsls r0, r5, 3
|
||||
ldr r1, =gMonFrontPicTable
|
||||
adds r0, r1
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r1, [r1]
|
||||
ldr r1, [r1, 0x10]
|
||||
adds r2, r5, 0
|
||||
@ -697,7 +697,7 @@ _0813E0A8:
|
||||
lsls r0, r6, 3
|
||||
ldr r1, =gMonFrontPicTable
|
||||
adds r0, r1
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r1, [r1]
|
||||
ldr r1, [r1, 0x10]
|
||||
adds r2, r6, 0
|
||||
@ -867,7 +867,7 @@ sub_813E1D4: @ 813E1D4
|
||||
lsls r0, r5, 3
|
||||
ldr r1, =gMonFrontPicTable
|
||||
adds r0, r1
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r1, [r1]
|
||||
ldr r1, [r1, 0x8]
|
||||
adds r2, r5, 0
|
||||
|
@ -669,7 +669,7 @@ sub_8153CC8: @ 8153CC8
|
||||
cmp r4, r0
|
||||
bne _08153D18
|
||||
ldr r0, =gStringVar1
|
||||
ldr r1, =gUnknown_085E8264
|
||||
ldr r1, =gEggNickname
|
||||
movs r2, 0xB
|
||||
bl StringCopyN
|
||||
b _08153D22
|
||||
|
@ -322,7 +322,7 @@ _08179E48:
|
||||
lsls r0, r5, 3
|
||||
ldr r1, =gMonFrontPicTable
|
||||
adds r0, r1
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r1, [r1]
|
||||
ldr r1, [r1, 0x8]
|
||||
adds r2, r5, 0
|
||||
|
@ -823,8 +823,8 @@ _08068A02:
|
||||
.pool
|
||||
thumb_func_end sub_80688F8
|
||||
|
||||
thumb_func_start get_pokemon_data_3
|
||||
get_pokemon_data_3: @ 8068A10
|
||||
thumb_func_start GetDeoxysStat
|
||||
GetDeoxysStat: @ 8068A10
|
||||
push {r4-r6,lr}
|
||||
adds r5, r0, 0
|
||||
adds r6, r1, 0
|
||||
@ -895,7 +895,7 @@ _08068A9A:
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end get_pokemon_data_3
|
||||
thumb_func_end GetDeoxysStat
|
||||
|
||||
thumb_func_start sub_8068AA4
|
||||
sub_8068AA4: @ 8068AA4
|
||||
|
1138
asm/pokemon_2.s
1138
asm/pokemon_2.s
File diff suppressed because it is too large
Load Diff
@ -616,7 +616,7 @@ _080A986C:
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
adds r0, r4, 0
|
||||
bl template_build_for_pokemon_or_trainer
|
||||
bl sub_806A12C
|
||||
ldr r6, =gUnknown_0202499C
|
||||
ldr r1, =gUnknown_08305D2C
|
||||
ldr r0, [r5]
|
||||
@ -654,7 +654,7 @@ _080A98D0:
|
||||
lsls r1, 24
|
||||
lsrs r1, 24
|
||||
movs r0, 0x6
|
||||
bl template_build_for_pokemon_or_trainer
|
||||
bl sub_806A12C
|
||||
ldr r5, =gUnknown_0202499C
|
||||
ldr r0, =gUnknown_08305D2C
|
||||
ldrb r0, [r0, 0x18]
|
||||
|
@ -1317,7 +1317,7 @@ _08072D86:
|
||||
movs r2, 0x1
|
||||
movs r3, 0x3
|
||||
bl ConvertIntToDecimalStringN
|
||||
ldr r0, =gBattleDecompressedSprites
|
||||
ldr r0, =gBattleSpritesGfx
|
||||
ldr r0, [r0]
|
||||
movs r1, 0xBA
|
||||
lsls r1, 1
|
||||
@ -1333,7 +1333,7 @@ _08072D86:
|
||||
lsls r0, 2
|
||||
adds r5, r0, r1
|
||||
_08072DB8:
|
||||
ldr r0, =gBattleDecompressedSprites
|
||||
ldr r0, =gBattleSpritesGfx
|
||||
ldr r0, [r0]
|
||||
movs r1, 0xBA
|
||||
lsls r1, 1
|
||||
@ -1536,7 +1536,7 @@ _08072F52:
|
||||
ldr r1, =gUnknown_085E8D3E
|
||||
bl StringCopy
|
||||
_08072F82:
|
||||
ldr r0, =gBattleDecompressedSprites
|
||||
ldr r0, =gBattleSpritesGfx
|
||||
ldr r0, [r0]
|
||||
movs r1, 0xBA
|
||||
lsls r1, 1
|
||||
@ -1556,7 +1556,7 @@ _08072F82:
|
||||
_08072FA6:
|
||||
cmp r4, 0x2
|
||||
bhi _08072FF0
|
||||
ldr r0, =gBattleDecompressedSprites
|
||||
ldr r0, =gBattleSpritesGfx
|
||||
ldr r0, [r0]
|
||||
movs r2, 0xBA
|
||||
lsls r2, 1
|
||||
@ -1579,7 +1579,7 @@ _08072FA6:
|
||||
b _0807301A
|
||||
.pool
|
||||
_08072FF0:
|
||||
ldr r0, =gBattleDecompressedSprites
|
||||
ldr r0, =gBattleSpritesGfx
|
||||
ldr r0, [r0]
|
||||
movs r1, 0xBA
|
||||
lsls r1, 1
|
||||
@ -1609,7 +1609,7 @@ _08073024:
|
||||
mov r3, r8
|
||||
cmp r3, 0
|
||||
bne _08073084
|
||||
ldr r0, =gBattleDecompressedSprites
|
||||
ldr r0, =gBattleSpritesGfx
|
||||
ldr r0, [r0]
|
||||
movs r1, 0xBA
|
||||
lsls r1, 1
|
||||
@ -1702,7 +1702,7 @@ sub_80730D4: @ 80730D4
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
bl GetBankIdentity
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r2, [r1]
|
||||
movs r3, 0xBA
|
||||
lsls r3, 1
|
||||
@ -1877,7 +1877,7 @@ _08073236:
|
||||
strb r0, [r1, 0x5]
|
||||
movs r0, 0xBA
|
||||
strb r0, [r1, 0x8]
|
||||
ldr r5, =gBattleDecompressedSprites
|
||||
ldr r5, =gBattleSpritesGfx
|
||||
ldr r0, [r5]
|
||||
movs r2, 0xBA
|
||||
lsls r2, 1
|
||||
|
@ -5155,7 +5155,7 @@ sub_80A8394: @ 80A8394
|
||||
bl AllocSpritePalette
|
||||
lsls r0, 24
|
||||
lsrs r5, r0, 24
|
||||
ldr r4, =gBattleDecompressedSprites
|
||||
ldr r4, =gBattleSpritesGfx
|
||||
ldr r0, [r4]
|
||||
cmp r0, 0
|
||||
beq _080A8412
|
||||
@ -5213,7 +5213,7 @@ _080A845E:
|
||||
lsls r0, r6, 3
|
||||
ldr r1, =gMonFrontPicTable
|
||||
adds r0, r1
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r1, [r1]
|
||||
movs r3, 0xBE
|
||||
lsls r3, 1
|
||||
@ -5226,7 +5226,7 @@ _080A8488:
|
||||
lsls r0, r6, 3
|
||||
ldr r1, =gMonFrontPicTable
|
||||
adds r0, r1
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r1, [r1]
|
||||
movs r2, 0xBE
|
||||
lsls r2, 1
|
||||
@ -5276,7 +5276,7 @@ _080A84F6:
|
||||
lsls r0, r6, 3
|
||||
ldr r1, =gMonBackPicTable
|
||||
adds r0, r1
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r1, [r1]
|
||||
movs r2, 0xBE
|
||||
lsls r2, 1
|
||||
@ -5294,7 +5294,7 @@ _080A8524:
|
||||
lsls r0, r6, 3
|
||||
ldr r1, =gMonBackPicTable
|
||||
adds r0, r1
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r1, [r1]
|
||||
movs r3, 0xBE
|
||||
lsls r3, 1
|
||||
@ -5305,7 +5305,7 @@ _080A8524:
|
||||
mov r3, r8
|
||||
bl LoadSpecialPokePic_2
|
||||
_080A8540:
|
||||
ldr r5, =gBattleDecompressedSprites
|
||||
ldr r5, =gBattleSpritesGfx
|
||||
ldr r0, [r5]
|
||||
movs r4, 0xBE
|
||||
lsls r4, 1
|
||||
|
@ -14847,7 +14847,7 @@ _080CEE94:
|
||||
_080CEEC0:
|
||||
ldr r2, =0x00000cf9
|
||||
adds r0, r1, r2
|
||||
ldr r1, =gUnknown_085E8264
|
||||
ldr r1, =gEggNickname
|
||||
movs r2, 0
|
||||
movs r3, 0x8
|
||||
bl StringCopyPadded
|
||||
|
@ -3024,7 +3024,7 @@ _0815B8E0:
|
||||
lsls r0, 24
|
||||
lsrs r1, r0, 24
|
||||
_0815B8EA:
|
||||
ldr r0, =gBattleDecompressedSprites
|
||||
ldr r0, =gBattleSpritesGfx
|
||||
ldr r2, [r0]
|
||||
lsls r0, r1, 2
|
||||
adds r2, 0x4
|
||||
|
@ -2290,7 +2290,7 @@ _081BF9EE:
|
||||
strb r1, [r0]
|
||||
movs r0, 0xFF
|
||||
bl sub_81C488C
|
||||
ldr r0, =gBattleDecompressedSprites
|
||||
ldr r0, =gBattleSpritesGfx
|
||||
ldr r0, [r0]
|
||||
cmp r0, 0
|
||||
bne _081BFA12
|
||||
@ -3447,7 +3447,7 @@ sub_81C0484: @ 81C0484
|
||||
movs r2, 0x80
|
||||
lsls r2, 1
|
||||
bl m4aMPlayVolumeControl
|
||||
ldr r0, =gBattleDecompressedSprites
|
||||
ldr r0, =gBattleSpritesGfx
|
||||
ldr r0, [r0]
|
||||
cmp r0, 0
|
||||
bne _081C04E2
|
||||
@ -10970,7 +10970,7 @@ _081C4620:
|
||||
lsls r0, r2, 3
|
||||
ldr r1, =gMonFrontPicTable
|
||||
adds r0, r1
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r1, [r1]
|
||||
ldr r1, [r1, 0x8]
|
||||
b _081C46D6
|
||||
@ -10980,12 +10980,12 @@ _081C4668:
|
||||
lsls r0, r2, 3
|
||||
ldr r1, =gMonFrontPicTable
|
||||
adds r0, r1
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r1, [r1]
|
||||
b _081C46B0
|
||||
.pool
|
||||
_081C4680:
|
||||
ldr r0, =gBattleDecompressedSprites
|
||||
ldr r0, =gBattleSpritesGfx
|
||||
ldr r3, [r0]
|
||||
adds r4, r0, 0
|
||||
cmp r3, 0
|
||||
@ -28902,7 +28902,7 @@ sub_81CD624: @ 81CD624
|
||||
bl sub_81D2C68
|
||||
cmp r0, 0
|
||||
beq _081CD690
|
||||
ldr r1, =gUnknown_085E8264
|
||||
ldr r1, =gEggNickname
|
||||
adds r0, r5, 0
|
||||
movs r2, 0
|
||||
movs r3, 0xC
|
||||
@ -39944,7 +39944,7 @@ sub_81D2CD0: @ 81D2CD0
|
||||
bl sub_81D2C68
|
||||
cmp r0, 0
|
||||
beq _081D2D20
|
||||
ldr r1, =gUnknown_085E8264
|
||||
ldr r1, =gEggNickname
|
||||
adds r0, r5, 0
|
||||
movs r2, 0
|
||||
movs r3, 0xC
|
||||
|
@ -710,7 +710,7 @@ _080F8D44:
|
||||
lsls r0, r6, 3
|
||||
ldr r1, =gMonFrontPicTable
|
||||
adds r0, r1
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r1, [r1]
|
||||
ldr r1, [r1, 0x8]
|
||||
adds r2, r6, 0
|
||||
@ -722,7 +722,7 @@ _080F8DC4:
|
||||
lsls r0, r6, 3
|
||||
ldr r1, =gMonFrontPicTable
|
||||
adds r0, r1
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r1, [r1]
|
||||
ldr r1, [r1, 0x8]
|
||||
adds r2, r6, 0
|
||||
|
@ -7128,7 +7128,7 @@ _0807AD58:
|
||||
lsls r0, r5, 3
|
||||
ldr r1, =gMonFrontPicTable
|
||||
adds r0, r1
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r1, [r1]
|
||||
ldr r1, [r1, 0x8]
|
||||
adds r2, r5, 0
|
||||
@ -7141,7 +7141,7 @@ _0807AD94:
|
||||
lsls r0, r5, 3
|
||||
ldr r1, =gMonFrontPicTable
|
||||
adds r0, r1
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r2, [r1]
|
||||
lsls r4, r6, 1
|
||||
adds r1, r4, 0x1
|
||||
@ -10369,7 +10369,7 @@ _0807CCEE:
|
||||
lsls r0, r2, 3
|
||||
ldr r1, =gMonFrontPicTable
|
||||
adds r0, r1
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r1, [r1]
|
||||
ldr r1, [r1, 0x10]
|
||||
ldr r3, [r3, 0x6C]
|
||||
@ -12474,7 +12474,7 @@ _0807E13A:
|
||||
lsls r0, r2, 3
|
||||
ldr r1, =gMonFrontPicTable
|
||||
adds r0, r1
|
||||
ldr r1, =gBattleDecompressedSprites
|
||||
ldr r1, =gBattleSpritesGfx
|
||||
ldr r1, [r1]
|
||||
ldr r1, [r1, 0x10]
|
||||
ldr r3, [r3, 0x6C]
|
||||
|
@ -679,7 +679,7 @@ gUnknown_085CCB88:: @ 85CCB88
|
||||
gUnknown_085CCB8C:: @ 85CCB8C
|
||||
.incbin "baserom.gba", 0x5ccb8c, 0x4
|
||||
|
||||
gUnknown_085CCB90:: @ 85CCB90
|
||||
gBadEggNickname:: @ 85CCB90
|
||||
.incbin "baserom.gba", 0x5ccb90, 0x8
|
||||
|
||||
BattleText_Wally:: @ 85CCB98
|
||||
|
@ -45,7 +45,7 @@ gExpandedPlaceholder_Brendan:: @ 85E8258
|
||||
gExpandedPlaceholder_May:: @ 85E8260
|
||||
.string "MAY$"
|
||||
|
||||
gUnknown_085E8264:: @ 85E8264
|
||||
gEggNickname:: @ 85E8264
|
||||
|
||||
.string "EGG$"
|
||||
|
||||
|
@ -33,9 +33,13 @@
|
||||
#define BATTLE_TYPE_RAYQUAZA 0x40000000
|
||||
|
||||
#define STEVEN_PARTNER_ID 0xC03
|
||||
#define SECRET_BASE_OPPONENT 0x400
|
||||
|
||||
#define BATTLE_TYPE_FRONTIER (BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_DOME | BATTLE_TYPE_PALACE | BATTLE_TYPE_ARENA | BATTLE_TYPE_FACTORY | BATTLE_TYPE_x100000 | BATTLE_TYPE_PYRAMID)
|
||||
|
||||
#define SIDE_PLAYER 0x0
|
||||
#define SIDE_OPPONENT 0x1
|
||||
|
||||
#define BATTLE_WON 0x1
|
||||
#define BATTLE_LOST 0x2
|
||||
#define BATTLE_DREW 0x3
|
||||
@ -513,12 +517,15 @@ struct BattleScripting
|
||||
|
||||
extern struct BattleScripting gBattleScripting;
|
||||
|
||||
struct BattleDecompressedSprites
|
||||
#include "sprite.h"
|
||||
|
||||
struct BattleSpritesGfx
|
||||
{
|
||||
void* firstDecompressed; // ptr to the decompressed sprite of the first pokemon
|
||||
void* sprites[4];
|
||||
struct SpriteTemplate templates[4];
|
||||
};
|
||||
|
||||
extern struct BattleDecompressedSprites* gBattleDecompressedSprites;
|
||||
extern struct BattleSpritesGfx* gBattleSpritesGfx;
|
||||
|
||||
#endif // GUARD_BATTLE_H
|
||||
|
@ -89,7 +89,7 @@
|
||||
#define MON_DATA_DEF2 85
|
||||
#define MON_DATA_SPD2 86
|
||||
#define MON_DATA_SPATK2 87
|
||||
#define MON_DATA_SPDEF2 88
|
||||
#define MON_DATA_SPDEF2 88
|
||||
|
||||
#define OT_ID_RANDOM_NO_SHINY 2
|
||||
#define OT_ID_PRESET 1
|
||||
@ -279,7 +279,7 @@ struct Pokemon
|
||||
struct BoxPokemon box;
|
||||
u32 status;
|
||||
u8 level;
|
||||
u8 pokerus;
|
||||
u8 mail;
|
||||
u16 hp;
|
||||
u16 maxHP;
|
||||
u16 attack;
|
||||
@ -495,6 +495,10 @@ extern struct PokemonStorage* gPokemonStoragePtr;
|
||||
extern const u32 gExperienceTables[][MAX_MON_LEVEL + 1];
|
||||
extern const u16 *const gLevelUpLearnsets[];
|
||||
|
||||
#define BATTLE_ALIVE_EXCEPT_ACTIVE 0
|
||||
#define BATTLE_ALIVE_ATK_SIDE 1
|
||||
#define BATTLE_ALIVE_DEF_SIDE 2
|
||||
|
||||
void ZeroBoxMonData(struct BoxPokemon *boxMon);
|
||||
void ZeroMonData(struct Pokemon *mon);
|
||||
void ZeroPlayerPartyMons(void);
|
||||
|
352
src/pokemon_2.c
352
src/pokemon_2.c
@ -1,4 +1,356 @@
|
||||
#include "global.h"
|
||||
#include "pokemon.h"
|
||||
#include "battle.h"
|
||||
#include "event_data.h"
|
||||
#include "rng.h"
|
||||
#include "sprite.h"
|
||||
#include "species.h"
|
||||
#include "text.h"
|
||||
#include "string_util.h"
|
||||
|
||||
struct Unknown_020249B4
|
||||
{
|
||||
u8 unk0[0xC];
|
||||
struct SpriteTemplate* templates;
|
||||
};
|
||||
|
||||
extern u8 gAbsentBankFlags;
|
||||
extern u8 gActiveBank;
|
||||
extern u8 gBankAttacker;
|
||||
extern u8 gBankTarget;
|
||||
extern u16 gTrainerBattleOpponent_A;
|
||||
extern u32 gBattleTypeFlags;
|
||||
extern struct SpriteTemplate gUnknown_0202499C;
|
||||
extern struct Unknown_020249B4* gUnknown_020249B4[2];
|
||||
|
||||
extern const u32 gBitTable[];
|
||||
extern const struct SpriteTemplate gUnknown_08329D98[];
|
||||
extern const struct SpriteTemplate gUnknown_08329DF8[];
|
||||
extern const struct SpriteTemplate gUnknown_08329D98[];
|
||||
extern const union AnimCmd* gUnknown_082FF70C[];
|
||||
extern const union AnimCmd* const * const gUnknown_08309AAC[];
|
||||
extern const union AnimCmd* const * const gUnknown_08305D0C[];
|
||||
extern const union AnimCmd* const * const gUnknown_0830536C[];
|
||||
extern const u8 gBadEggNickname[];
|
||||
extern const u8 gEggNickname[];
|
||||
|
||||
extern u8 GetBankSide(u8 bank);
|
||||
extern u8 GetBankByPlayerAI(u8 bank);
|
||||
extern u8 GetBankIdentity(u8 bank);
|
||||
|
||||
u8 CountAliveMonsInBattle(u8 caseId)
|
||||
{
|
||||
s32 i;
|
||||
u8 retVal = 0;
|
||||
|
||||
switch (caseId)
|
||||
{
|
||||
case BATTLE_ALIVE_EXCEPT_ACTIVE:
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (i != gActiveBank && !(gAbsentBankFlags & gBitTable[i]))
|
||||
retVal++;
|
||||
}
|
||||
break;
|
||||
case BATTLE_ALIVE_ATK_SIDE:
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (GetBankSide(i) == GetBankSide(gBankAttacker) && !(gAbsentBankFlags & gBitTable[i]))
|
||||
retVal++;
|
||||
}
|
||||
break;
|
||||
case BATTLE_ALIVE_DEF_SIDE:
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (GetBankSide(i) == GetBankSide(gBankTarget) && !(gAbsentBankFlags & gBitTable[i]))
|
||||
retVal++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
bool8 ShouldGetStatBadgeBoost(u16 badgeFlag, u8 bank)
|
||||
{
|
||||
if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_x2000000 | BATTLE_TYPE_FRONTIER))
|
||||
return FALSE;
|
||||
if (GetBankSide(bank) != SIDE_PLAYER)
|
||||
return FALSE;
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER && gTrainerBattleOpponent_A == SECRET_BASE_OPPONENT)
|
||||
return FALSE;
|
||||
if (FlagGet(badgeFlag))
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
u8 sub_8069F34(u8 bank)
|
||||
{
|
||||
u8 status = GetBankIdentity(bank) & 1;
|
||||
|
||||
status ^= 1;
|
||||
if (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE))
|
||||
return GetBankByPlayerAI(status);
|
||||
if (CountAliveMonsInBattle(BATTLE_ALIVE_EXCEPT_ACTIVE) > 1)
|
||||
{
|
||||
u8 val;
|
||||
|
||||
if ((Random() & 1) == 0)
|
||||
val = status ^ 2;
|
||||
else
|
||||
val = status;
|
||||
return GetBankByPlayerAI(val);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((gAbsentBankFlags & gBitTable[status]))
|
||||
return GetBankByPlayerAI(status ^ 2);
|
||||
else
|
||||
return GetBankByPlayerAI(status);
|
||||
}
|
||||
}
|
||||
|
||||
u8 GetMonGender(struct Pokemon *mon)
|
||||
{
|
||||
return GetBoxMonGender(&mon->box);
|
||||
}
|
||||
|
||||
u8 GetBoxMonGender(struct BoxPokemon *boxMon)
|
||||
{
|
||||
u16 species = GetBoxMonData(boxMon, MON_DATA_SPECIES, NULL);
|
||||
u32 personality = GetBoxMonData(boxMon, MON_DATA_PERSONALITY, NULL);
|
||||
|
||||
switch (gBaseStats[species].genderRatio)
|
||||
{
|
||||
case MON_MALE:
|
||||
case MON_FEMALE:
|
||||
case MON_GENDERLESS:
|
||||
return gBaseStats[species].genderRatio;
|
||||
}
|
||||
|
||||
if (gBaseStats[species].genderRatio > (personality & 0xFF))
|
||||
return MON_FEMALE;
|
||||
else
|
||||
return MON_MALE;
|
||||
}
|
||||
|
||||
u8 GetGenderFromSpeciesAndPersonality(u16 species, u32 personality)
|
||||
{
|
||||
switch (gBaseStats[species].genderRatio)
|
||||
{
|
||||
case MON_MALE:
|
||||
case MON_FEMALE:
|
||||
case MON_GENDERLESS:
|
||||
return gBaseStats[species].genderRatio;
|
||||
}
|
||||
|
||||
if (gBaseStats[species].genderRatio > (personality & 0xFF))
|
||||
return MON_FEMALE;
|
||||
else
|
||||
return MON_MALE;
|
||||
}
|
||||
|
||||
void sub_806A068(u16 species, u8 bankIdentity)
|
||||
{
|
||||
if (gBattleSpritesGfx != NULL)
|
||||
gUnknown_0202499C = gBattleSpritesGfx->templates[bankIdentity];
|
||||
else if (gUnknown_020249B4[0])
|
||||
gUnknown_0202499C = gUnknown_020249B4[0]->templates[bankIdentity];
|
||||
else if (gUnknown_020249B4[1])
|
||||
gUnknown_0202499C = gUnknown_020249B4[1]->templates[bankIdentity];
|
||||
else
|
||||
gUnknown_0202499C = gUnknown_08329D98[bankIdentity];
|
||||
|
||||
gUnknown_0202499C.paletteTag = species;
|
||||
if (bankIdentity == 0 || bankIdentity == 2)
|
||||
gUnknown_0202499C.anims = gUnknown_082FF70C;
|
||||
else if (species > 500)
|
||||
gUnknown_0202499C.anims = gUnknown_08309AAC[species - 500];
|
||||
else
|
||||
gUnknown_0202499C.anims = gUnknown_08309AAC[species];
|
||||
}
|
||||
|
||||
void sub_806A12C(u16 trainerSpriteId, u8 bankIdentity)
|
||||
{
|
||||
gUnknown_0202499C.paletteTag = trainerSpriteId;
|
||||
if (bankIdentity == 0 || bankIdentity == 2)
|
||||
{
|
||||
gUnknown_0202499C = gUnknown_08329DF8[trainerSpriteId];
|
||||
gUnknown_0202499C.anims = gUnknown_08305D0C[trainerSpriteId];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gBattleSpritesGfx != NULL)
|
||||
gUnknown_0202499C = gBattleSpritesGfx->templates[bankIdentity];
|
||||
else
|
||||
gUnknown_0202499C = gUnknown_08329D98[bankIdentity];
|
||||
gUnknown_0202499C.anims = gUnknown_0830536C[trainerSpriteId];
|
||||
}
|
||||
}
|
||||
|
||||
void sub_806A1C0(u16 arg0, u8 bankIdentity)
|
||||
{
|
||||
if (gBattleSpritesGfx != NULL)
|
||||
gUnknown_0202499C = gBattleSpritesGfx->templates[bankIdentity];
|
||||
else
|
||||
gUnknown_0202499C = gUnknown_08329D98[bankIdentity];
|
||||
gUnknown_0202499C.paletteTag = arg0;
|
||||
gUnknown_0202499C.anims = gUnknown_0830536C[arg0];
|
||||
}
|
||||
|
||||
void EncryptBoxMon(struct BoxPokemon *boxMon)
|
||||
{
|
||||
u32 i;
|
||||
for (i = 0; i < 12; i++)
|
||||
{
|
||||
boxMon->secure.raw[i] ^= boxMon->personality;
|
||||
boxMon->secure.raw[i] ^= boxMon->otId;
|
||||
}
|
||||
}
|
||||
|
||||
void DecryptBoxMon(struct BoxPokemon *boxMon)
|
||||
{
|
||||
u32 i;
|
||||
for (i = 0; i < 12; i++)
|
||||
{
|
||||
boxMon->secure.raw[i] ^= boxMon->otId;
|
||||
boxMon->secure.raw[i] ^= boxMon->personality;
|
||||
}
|
||||
}
|
||||
|
||||
#define SUBSTRUCT_CASE(n, v1, v2, v3, v4) \
|
||||
case n: \
|
||||
{ \
|
||||
union PokemonSubstruct *substructs0 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs1 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs2 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs3 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs4 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs5 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs6 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs7 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs8 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs9 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs10 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs11 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs12 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs13 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs14 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs15 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs16 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs17 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs18 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs19 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs20 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs21 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs22 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs23 = boxMon->secure.substructs; \
|
||||
\
|
||||
switch (substructType) \
|
||||
{ \
|
||||
case 0: \
|
||||
substruct = &substructs ## n [v1]; \
|
||||
break; \
|
||||
case 1: \
|
||||
substruct = &substructs ## n [v2]; \
|
||||
break; \
|
||||
case 2: \
|
||||
substruct = &substructs ## n [v3]; \
|
||||
break; \
|
||||
case 3: \
|
||||
substruct = &substructs ## n [v4]; \
|
||||
break; \
|
||||
} \
|
||||
break; \
|
||||
} \
|
||||
|
||||
|
||||
union PokemonSubstruct *GetSubstruct(struct BoxPokemon *boxMon, u32 personality, u8 substructType)
|
||||
{
|
||||
union PokemonSubstruct *substruct = NULL;
|
||||
|
||||
switch (personality % 24)
|
||||
{
|
||||
SUBSTRUCT_CASE( 0,0,1,2,3)
|
||||
SUBSTRUCT_CASE( 1,0,1,3,2)
|
||||
SUBSTRUCT_CASE( 2,0,2,1,3)
|
||||
SUBSTRUCT_CASE( 3,0,3,1,2)
|
||||
SUBSTRUCT_CASE( 4,0,2,3,1)
|
||||
SUBSTRUCT_CASE( 5,0,3,2,1)
|
||||
SUBSTRUCT_CASE( 6,1,0,2,3)
|
||||
SUBSTRUCT_CASE( 7,1,0,3,2)
|
||||
SUBSTRUCT_CASE( 8,2,0,1,3)
|
||||
SUBSTRUCT_CASE( 9,3,0,1,2)
|
||||
SUBSTRUCT_CASE(10,2,0,3,1)
|
||||
SUBSTRUCT_CASE(11,3,0,2,1)
|
||||
SUBSTRUCT_CASE(12,1,2,0,3)
|
||||
SUBSTRUCT_CASE(13,1,3,0,2)
|
||||
SUBSTRUCT_CASE(14,2,1,0,3)
|
||||
SUBSTRUCT_CASE(15,3,1,0,2)
|
||||
SUBSTRUCT_CASE(16,2,3,0,1)
|
||||
SUBSTRUCT_CASE(17,3,2,0,1)
|
||||
SUBSTRUCT_CASE(18,1,2,3,0)
|
||||
SUBSTRUCT_CASE(19,1,3,2,0)
|
||||
SUBSTRUCT_CASE(20,2,1,3,0)
|
||||
SUBSTRUCT_CASE(21,3,1,2,0)
|
||||
SUBSTRUCT_CASE(22,2,3,1,0)
|
||||
SUBSTRUCT_CASE(23,3,2,1,0)
|
||||
}
|
||||
|
||||
return substruct;
|
||||
}
|
||||
|
||||
extern u16 GetDeoxysStat(struct Pokemon *mon, s32 statId);
|
||||
|
||||
#define TRY_GET_DEOXYS_STAT(mon, stat, LABEL) \
|
||||
{ \
|
||||
u32 ret = GetDeoxysStat(mon, stat); \
|
||||
if (ret) \
|
||||
return ret; \
|
||||
else \
|
||||
goto LABEL; \
|
||||
}
|
||||
|
||||
u32 GetMonData(struct Pokemon *mon, s32 field, u8 *data)
|
||||
{
|
||||
switch (field)
|
||||
{
|
||||
case MON_DATA_STATUS:
|
||||
return mon->status;
|
||||
case MON_DATA_LEVEL:
|
||||
return mon->level;
|
||||
case MON_DATA_HP:
|
||||
return mon->hp;
|
||||
case MON_DATA_MAX_HP:
|
||||
return mon->maxHP;
|
||||
case MON_DATA_ATK:
|
||||
TRY_GET_DEOXYS_STAT(mon, 1, GET_ATK)
|
||||
case MON_DATA_DEF:
|
||||
TRY_GET_DEOXYS_STAT(mon, 2, GET_DEF)
|
||||
case MON_DATA_SPD:
|
||||
TRY_GET_DEOXYS_STAT(mon, 3, GET_SPD)
|
||||
case MON_DATA_SPATK:
|
||||
TRY_GET_DEOXYS_STAT(mon, 4, GET_SPATK)
|
||||
case MON_DATA_SPDEF:
|
||||
TRY_GET_DEOXYS_STAT(mon, 5, GET_SPDEF)
|
||||
GET_ATK:
|
||||
case MON_DATA_ATK2:
|
||||
return mon->attack;
|
||||
GET_DEF:
|
||||
case MON_DATA_DEF2:
|
||||
return mon->defense;
|
||||
GET_SPD:
|
||||
case MON_DATA_SPD2:
|
||||
return mon->speed;
|
||||
GET_SPATK:
|
||||
case MON_DATA_SPATK2:
|
||||
return mon->spAttack;
|
||||
GET_SPDEF:
|
||||
case MON_DATA_SPDEF2:
|
||||
return mon->spDefense;
|
||||
case MON_DATA_MAIL:
|
||||
return mon->mail;
|
||||
default:
|
||||
return GetBoxMonData(&mon->box, field, data);
|
||||
}
|
||||
}
|
||||
|
@ -475,8 +475,8 @@ u16 SpeciesToCryId(u16 species)
|
||||
void sub_806D544(u16 species, u32 personality, u8 *dest)
|
||||
{
|
||||
if (species == SPECIES_SPINDA
|
||||
&& dest != gBattleDecompressedSprites->sprites[0]
|
||||
&& dest != gBattleDecompressedSprites->sprites[2])
|
||||
&& dest != gBattleSpritesGfx->sprites[0]
|
||||
&& dest != gBattleSpritesGfx->sprites[2])
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < 4; i++)
|
||||
|
@ -526,7 +526,7 @@ gUnknown_020244CC: @ 20244CC
|
||||
gUnknown_020244D0: @ 20244D0
|
||||
.space 0x4
|
||||
|
||||
gBattleDecompressedSprites: @ 20244D4
|
||||
gBattleSpritesGfx: @ 20244D4
|
||||
.space 0x4
|
||||
|
||||
gUnknown_020244D8: @ 20244D8
|
||||
|
Loading…
Reference in New Issue
Block a user