start pokemon3 decomp

This commit is contained in:
DizzyEggg 2017-09-11 11:35:41 +02:00
parent 6292b82503
commit 154a70e228
44 changed files with 1571 additions and 3153 deletions

View File

@ -5635,7 +5635,7 @@ _080399E4:
cmp r4, r0
bne _08039A08
ldr r0, =gUnknown_08525F78
ldr r1, =gUnknown_020244E4
ldr r1, =gBattleMonForms
adds r1, r6, r1
ldrb r1, [r1]
lsls r1, 2
@ -5708,13 +5708,13 @@ _08039A7C:
lsls r0, 24
lsrs r0, 24
bl GetBankIdentity
ldr r1, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
ldr r1, [r1]
lsls r0, 24
lsrs r0, 22
adds r1, 0x4
adds r1, r0
ldr r2, =gUnknown_020244E4
ldr r2, =gBattleMonForms
movs r3, 0x2E
ldrsh r0, [r4, r3]
adds r0, r2
@ -5734,7 +5734,7 @@ _08039AAE:
subs r0, 0x1
cmp r0, 0
bge _08039AAE
ldr r0, =gUnknown_020244E4
ldr r0, =gBattleMonForms
movs r3, 0x2E
ldrsh r1, [r4, r3]
adds r1, r0
@ -9615,7 +9615,7 @@ _0803BBB8:
lsls r0, 24
lsrs r2, r0, 24
_0803BBC2:
ldr r1, =gUnknown_0202420F
ldr r1, =gStringBank
ldr r3, =gActiveBank
ldrb r0, [r3]
strb r0, [r1]
@ -14854,7 +14854,7 @@ _0803EC54:
lsls r0, 24
lsrs r1, r0, 24
_0803EC5E:
ldr r0, =gUnknown_0202420F
ldr r0, =gStringBank
strb r5, [r0]
cmp r1, 0x25
bne _0803EC9C

View File

@ -315,7 +315,7 @@ _0803FDC4:
lsls r0, 24
lsrs r4, r0, 24
_0803FDCE:
ldr r2, =gUnknown_0202420F
ldr r2, =gStringBank
ldr r1, =gActiveBank
ldrb r0, [r1]
strb r0, [r2]
@ -466,7 +466,7 @@ _0803FF1C:
lsls r1, r7, 3
ldr r3, [sp, 0x14]
_0803FF2E:
ldr r0, =gUnknown_0202420F
ldr r0, =gStringBank
strb r7, [r0]
movs r0, 0
mov r9, r0
@ -8351,7 +8351,7 @@ _0804463C:
_08044654:
ldr r0, =gBattleScripting
strb r7, [r0, 0x17]
ldr r0, =gUnknown_0202420F
ldr r0, =gStringBank
strb r7, [r0]
ldr r1, =gActiveBank
ldr r0, =gBankAttacker
@ -8612,7 +8612,7 @@ _080448CE:
_080448EA:
ldr r0, =gBattleScripting
strb r7, [r0, 0x17]
ldr r0, =gUnknown_0202420F
ldr r0, =gStringBank
strb r7, [r0]
ldr r1, =gActiveBank
ldr r0, =gBankAttacker
@ -9682,7 +9682,7 @@ _080451D6:
_080451DE:
ldr r0, =gBattleScripting
strb r7, [r0, 0x17]
ldr r0, =gUnknown_0202420F
ldr r0, =gStringBank
strb r7, [r0]
ldr r4, =gActiveBank
ldr r0, =gBankAttacker
@ -10135,7 +10135,7 @@ _08045638:
beq _080456B8
ldr r0, =gBattleScripting
strb r7, [r0, 0x17]
ldr r0, =gUnknown_0202420F
ldr r0, =gStringBank
strb r7, [r0]
bl b_movescr_stack_push_cursor
ldr r1, =gBattlescriptCurrInstr
@ -10150,7 +10150,7 @@ _08045674:
_0804567A:
ldr r0, =gBattleScripting
strb r7, [r0, 0x17]
ldr r0, =gUnknown_0202420F
ldr r0, =gStringBank
strb r7, [r0]
ldr r4, =gActiveBank
strb r7, [r4]
@ -10305,7 +10305,7 @@ _08045794:
mov r1, sp
ldrh r1, [r1, 0x14]
strh r1, [r0]
ldr r0, =gUnknown_0202420F
ldr r0, =gStringBank
strb r3, [r0]
ldr r0, =gBattleScripting
strb r3, [r0, 0x17]

View File

@ -1040,7 +1040,7 @@ _08046928:
lsls r0, 24
lsrs r2, r0, 24
_08046944:
ldr r0, =gUnknown_0202420F
ldr r0, =gStringBank
ldr r1, =gBankTarget
ldrb r1, [r1]
strb r1, [r0]
@ -1390,7 +1390,7 @@ _08046C48:
lsls r0, 24
lsrs r6, r0, 24
_08046C50:
ldr r1, =gUnknown_0202420F
ldr r1, =gStringBank
ldr r3, =gBankAttacker
ldrb r0, [r3]
strb r0, [r1]
@ -2982,7 +2982,7 @@ _0804795C:
lsls r0, 24
lsrs r6, r0, 24
_08047976:
ldr r1, =gUnknown_0202420F
ldr r1, =gStringBank
ldr r5, =gBankTarget
ldrb r0, [r5]
strb r0, [r1]
@ -3169,7 +3169,7 @@ _08047B0C:
lsls r0, 24
lsrs r6, r0, 24
_08047B26:
ldr r1, =gUnknown_0202420F
ldr r1, =gStringBank
ldr r5, =gBankTarget
ldrb r0, [r5]
strb r0, [r1]
@ -4230,7 +4230,7 @@ _08048478:
adds r0, r2
ldrh r0, [r0, 0x2E]
strh r0, [r4]
ldr r1, =gUnknown_0202420F
ldr r1, =gStringBank
ldrb r0, [r3]
strb r0, [r1]
movs r0, 0x3F
@ -4295,7 +4295,7 @@ _08048510:
adds r0, r2
ldrh r0, [r0, 0x2E]
strh r0, [r4]
ldr r1, =gUnknown_0202420F
ldr r1, =gStringBank
ldrb r0, [r3]
strb r0, [r1]
movs r0, 0x3F
@ -16226,7 +16226,7 @@ _0804ED10:
lsls r0, 24
lsrs r6, r0, 24
_0804ED2A:
ldr r1, =gUnknown_0202420F
ldr r1, =gStringBank
ldr r5, =gBankTarget
ldrb r0, [r5]
strb r0, [r1]
@ -17407,7 +17407,7 @@ _0804F73E:
atk75_8026A58: @ 804F754
push {lr}
sub sp, 0x4
ldr r2, =gUnknown_020244B8
ldr r2, =gBankInMenu
ldr r1, =gBankAttacker
ldrb r0, [r1]
strb r0, [r2]
@ -21095,7 +21095,7 @@ _08051768:
lsls r0, 24
lsrs r6, r0, 24
_08051782:
ldr r1, =gUnknown_0202420F
ldr r1, =gStringBank
ldr r5, =gBankTarget
ldrb r0, [r5]
strb r0, [r1]

View File

@ -991,7 +991,7 @@ move_anim_start_t3: @ 805D908
ands r0, r7
cmp r0, 0
beq _0805D950
ldr r0, =gUnknown_020244E4
ldr r0, =gBattleMonForms
adds r0, r6, r0
movs r2, 0x7F
adds r1, r7, 0
@ -1371,7 +1371,7 @@ _0805DC58:
lsls r2, r5, 3
ldr r1, =gMonFrontPicTable
adds r2, r1
ldr r1, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
ldr r1, [r1]
lsrs r0, 22
adds r1, 0x4
@ -1433,7 +1433,7 @@ _0805DCC6:
adds r1, r4
adds r0, r6, 0
bl LZDecompressWram
ldr r0, =gUnknown_020244E4
ldr r0, =gBattleMonForms
add r0, r8
ldrb r1, [r0]
lsls r1, 5
@ -1543,7 +1543,7 @@ _0805DE00:
lsls r0, r5, 3
ldr r1, =gMonBackPicTable
adds r0, r1
ldr r1, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
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, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
ldr r1, [r1]
lsls r2, r7, 2
adds r1, 0x4
@ -1618,7 +1618,7 @@ _0805DE7E:
adds r1, r4
adds r0, r6, 0
bl LZDecompressWram
ldr r0, =gUnknown_020244E4
ldr r0, =gBattleMonForms
add r0, r8
ldrb r1, [r0]
lsls r1, 5
@ -1684,7 +1684,7 @@ sub_805DF38: @ 805DF38
lsls r4, 3
ldr r2, =gTrainerFrontPicTable
adds r2, r4, r2
ldr r1, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
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, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
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, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
ldr r1, [r1]
movs r2, 0xBA
lsls r2, 1
@ -2308,7 +2308,7 @@ sub_805E448: @ 805E448
adds r1, r6, 0
movs r2, 0x20
bl LoadPalette
ldr r1, =gUnknown_020244E4
ldr r1, =gBattleMonForms
adds r1, r7, r1
ldr r0, [r4]
ldr r0, [r0, 0x8]
@ -2364,7 +2364,7 @@ _0805E51C:
lsls r0, r1, 3
ldr r1, =gMonBackPicTable
adds r0, r1
ldr r1, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
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, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
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, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
ldr r1, [r1]
mov r3, r10
lsls r2, r3, 2
@ -2486,7 +2486,7 @@ _0805E618:
mov r2, r8
bl HandleLoadSpecialPokePic_DontHandleDeoxys
_0805E662:
ldr r0, =gUnknown_020244D4
ldr r0, =gBattleDecompressedSprites
ldr r0, [r0]
mov r2, r10
lsls r1, r2, 2
@ -2554,7 +2554,7 @@ _0805E662:
adds r1, r4
mov r0, r9
bl LZDecompressWram
ldr r0, =gUnknown_020244E4
ldr r0, =gBattleMonForms
ldr r1, [sp]
adds r0, r1, r0
ldrb r1, [r0]
@ -2589,7 +2589,7 @@ _0805E70A:
adds r0, r1
mov r2, r8
strh r2, [r0, 0x2]
ldr r0, =gUnknown_020244E4
ldr r0, =gBattleMonForms
adds r1, r7, r0
ldr r3, [sp]
adds r0, r3, r0
@ -2614,7 +2614,7 @@ _0805E74A:
adds r0, r1
lsls r0, 2
adds r0, r2
ldr r1, =gUnknown_020244E4
ldr r1, =gBattleMonForms
adds r1, r7, r1
ldrb r1, [r1]
bl StartSpriteAnim
@ -2666,7 +2666,7 @@ _0805E814:
beq _0805E83C
ldr r0, =gUnknown_08C2CEE0
_0805E822:
ldr r1, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
ldr r1, [r1]
lsls r4, 2
adds r1, 0x4
@ -2677,7 +2677,7 @@ _0805E822:
.pool
_0805E83C:
ldr r0, =gUnknown_08C2D120
ldr r1, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
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, =gUnknown_020244D4
ldr r0, =gBattleDecompressedSprites
ldr r0, [r0]
adds r0, 0x4
adds r4, r0, r4
@ -2772,7 +2772,7 @@ refresh_graphics_maybe: @ 805E8F4
lsls r0, 2
ldr r1, =gSprites
adds r4, r0, r1
ldr r0, =gUnknown_020244E4
ldr r0, =gBattleMonForms
adds r0, r6, r0
ldrb r1, [r0]
adds r0, r4, 0
@ -3586,7 +3586,7 @@ sub_805EF84: @ 805EF84
movs r3, 0
movs r2, 0
strh r2, [r0, 0x2]
ldr r0, =gUnknown_020244E4
ldr r0, =gBattleMonForms
adds r0, r4, r0
strb r3, [r0]
cmp r1, 0
@ -3608,7 +3608,7 @@ init_uns_table_pokemon_copy: @ 805EFBC
mov r5, r8
push {r5-r7}
movs r6, 0
ldr r4, =gUnknown_020244D4
ldr r4, =gBattleDecompressedSprites
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, =gUnknown_020244D4
ldr r0, =gBattleDecompressedSprites
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, =gUnknown_020244D4
ldr r2, =gBattleDecompressedSprites
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, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
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, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
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, =gUnknown_020244D4
ldr r6, =gBattleDecompressedSprites
ldr r0, [r6]
cmp r0, 0
beq _0805F106

View File

@ -14561,7 +14561,7 @@ _08105CCC:
lsls r0, 6
bl AllocZeroed
adds r1, r0, 0
ldr r0, =gUnknown_020244D4
ldr r0, =gBattleDecompressedSprites
ldr r0, [r0]
movs r2, 0xBE
lsls r2, 1
@ -14571,7 +14571,7 @@ _08105CCC:
bl LZDecompressWram
movs r4, 0
_08105D00:
ldr r5, =gUnknown_020244D4
ldr r5, =gBattleDecompressedSprites
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, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
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, =gUnknown_020244D4
ldr r6, =gBattleDecompressedSprites
ldr r0, [r6]
movs r5, 0xBE
lsls r5, 1
@ -49866,7 +49866,7 @@ _08117CF6:
adds r4, r0, 0
adds r4, 0x10
_08117CFC:
ldr r0, =gUnknown_020244D4
ldr r0, =gBattleDecompressedSprites
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, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
ldr r2, [r1]
ldr r1, =gBattleAnimArgs
movs r3, 0x2
@ -52081,12 +52081,12 @@ sub_8118FBC: @ 8118FBC
bl GetBankByPlayerAI
lsls r0, 24
lsrs r0, 24
ldr r1, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
ldr r2, [r1]
lsls r4, 2
adds r2, 0x4
adds r2, r4
ldr r1, =gUnknown_020244E4
ldr r1, =gBattleMonForms
adds r0, r1
ldrb r1, [r0]
lsls r1, 11
@ -52189,7 +52189,7 @@ sub_8119094: @ 8119094
lsls r0, 24
mov r9, r0
ldr r4, =0x040000d4
ldr r0, =gUnknown_020244D4
ldr r0, =gBattleDecompressedSprites
ldr r0, [r0]
lsrs r2, 22
adds r0, 0x4

View File

@ -3655,7 +3655,7 @@ sub_80662F8: @ 80662F8
adds r0, r1
lsls r0, 2
adds r0, r5
ldr r1, =gUnknown_020244E4
ldr r1, =gBattleMonForms
adds r2, r1
ldrb r1, [r2]
bl StartSpriteAnim
@ -3850,7 +3850,7 @@ sub_8066494: @ 8066494
adds r0, r1
lsls r0, 2
adds r0, r5
ldr r1, =gUnknown_020244E4
ldr r1, =gBattleMonForms
adds r6, r1
ldrb r1, [r6]
bl StartSpriteAnim

View File

@ -3237,7 +3237,7 @@ sub_814CB0C: @ 814CB0C
adds r0, r1
lsls r0, 2
adds r0, r5
ldr r1, =gUnknown_020244E4
ldr r1, =gBattleMonForms
adds r2, r1
ldrb r1, [r2]
bl StartSpriteAnim
@ -3419,7 +3419,7 @@ sub_814CC98: @ 814CC98
adds r0, r1
lsls r0, 2
adds r0, r5
ldr r1, =gUnknown_020244E4
ldr r1, =gBattleMonForms
adds r6, r1
ldrb r1, [r6]
bl StartSpriteAnim

View File

@ -3811,7 +3811,7 @@ sub_8061224: @ 8061224
adds r0, r1
lsls r0, 2
adds r0, r5
ldr r1, =gUnknown_020244E4
ldr r1, =gBattleMonForms
adds r2, r1
ldrb r1, [r2]
bl StartSpriteAnim
@ -4012,7 +4012,7 @@ sub_80613DC: @ 80613DC
adds r0, r1
lsls r0, 2
adds r0, r5
ldr r1, =gUnknown_020244E4
ldr r1, =gBattleMonForms
adds r6, r1
ldrb r1, [r6]
bl StartSpriteAnim

View File

@ -7067,7 +7067,7 @@ sub_805B258: @ 805B258
adds r0, r1
lsls r0, 2
adds r0, r5
ldr r1, =gUnknown_020244E4
ldr r1, =gBattleMonForms
adds r6, r1
ldrb r1, [r6]
bl StartSpriteAnim
@ -8748,7 +8748,7 @@ sub_805C248: @ 805C248
adds r0, r1
ldr r1, =sub_80598A4
str r1, [r0]
ldr r1, =gUnknown_020244B8
ldr r1, =gBankInMenu
ldrb r0, [r2]
strb r0, [r1]
movs r3, 0
@ -8896,7 +8896,7 @@ _0805C330:
adds r0, r1
ldr r1, =sub_80597CC
str r1, [r0]
ldr r1, =gUnknown_020244B8
ldr r1, =gBankInMenu
ldrb r0, [r4]
strb r0, [r1]
_0805C3BC:

View File

@ -3812,7 +3812,7 @@ sub_81BCF58: @ 81BCF58
adds r0, r1
lsls r0, 2
adds r0, r5
ldr r1, =gUnknown_020244E4
ldr r1, =gBattleMonForms
adds r2, r1
ldrb r1, [r2]
bl StartSpriteAnim
@ -3994,7 +3994,7 @@ sub_81BD0E4: @ 81BD0E4
adds r0, r1
lsls r0, 2
adds r0, r5
ldr r1, =gUnknown_020244E4
ldr r1, =gBattleMonForms
adds r6, r1
ldrb r1, [r6]
bl StartSpriteAnim

View File

@ -3636,7 +3636,7 @@ sub_818843C: @ 818843C
adds r0, r1
lsls r0, 2
adds r0, r5
ldr r1, =gUnknown_020244E4
ldr r1, =gBattleMonForms
adds r2, r1
ldrb r1, [r2]
bl StartSpriteAnim
@ -3831,7 +3831,7 @@ sub_81885D8: @ 81885D8
adds r0, r1
lsls r0, 2
adds r0, r5
ldr r1, =gUnknown_020244E4
ldr r1, =gBattleMonForms
adds r6, r1
ldrb r1, [r6]
bl StartSpriteAnim

View File

@ -3613,7 +3613,7 @@ sub_818B8E0: @ 818B8E0
adds r0, r1
lsls r0, 2
adds r0, r5
ldr r1, =gUnknown_020244E4
ldr r1, =gBattleMonForms
adds r2, r1
ldrb r1, [r2]
bl StartSpriteAnim
@ -3795,7 +3795,7 @@ sub_818BA6C: @ 818BA6C
adds r0, r1
lsls r0, 2
adds r0, r5
ldr r1, =gUnknown_020244E4
ldr r1, =gBattleMonForms
adds r6, r1
ldrb r1, [r6]
bl StartSpriteAnim

View File

@ -923,7 +923,7 @@ sub_8159B14: @ 8159B14
adds r0, r1
ldr r1, =sub_8159660
str r1, [r0]
ldr r1, =gUnknown_020244B8
ldr r1, =gBankInMenu
ldrb r0, [r2]
strb r0, [r1]
add sp, 0x4

View File

@ -3803,7 +3803,7 @@ sub_816A57C: @ 816A57C
adds r0, r1
ldr r1, =sub_81685D4
str r1, [r0]
ldr r1, =gUnknown_020244B8
ldr r1, =gBankInMenu
ldrb r0, [r2]
strb r0, [r1]
add sp, 0x4
@ -4504,7 +4504,7 @@ sub_816AA80: @ 816AA80
adds r0, r1
lsls r0, 2
adds r0, r5
ldr r1, =gUnknown_020244E4
ldr r1, =gBattleMonForms
adds r6, r1
ldrb r1, [r6]
bl StartSpriteAnim

View File

@ -42,7 +42,7 @@ BufferStringBattle: @ 814E0C4
ldr r1, [r4]
ldrb r1, [r1, 0x9]
strb r1, [r0]
ldr r1, =gUnknown_0202420F
ldr r1, =gStringBank
ldr r2, [r4]
ldrb r0, [r2, 0xA]
strb r0, [r1]
@ -1602,7 +1602,7 @@ _0814EF98:
ldrb r0, [r0]
cmp r0, 0
beq _0814EFE0
ldr r2, =gUnknown_0202420F
ldr r2, =gStringBank
ldrb r1, [r2]
movs r0, 0x1
ands r0, r1
@ -1611,7 +1611,7 @@ _0814EF98:
b _0814F05C
.pool
_0814EFE0:
ldr r2, =gUnknown_0202420F
ldr r2, =gStringBank
ldrb r1, [r2]
movs r0, 0x1
ands r0, r1
@ -1640,7 +1640,7 @@ _0814F014:
subs r0, r1
lsls r0, 2
adds r0, r2
ldr r1, =gUnknown_0202420F
ldr r1, =gStringBank
ldrb r2, [r1]
ldrh r0, [r0, 0x18]
cmp r0, r2
@ -2513,7 +2513,7 @@ _0814F7A4:
b _0814F8DE
.pool
_0814F7BC:
ldr r1, =gUnknown_085CBE00
ldr r1, =gStatNamesTable
adds r0, r5, r7
ldrb r0, [r0, 0x1]
lsls r0, 2
@ -2606,7 +2606,7 @@ _0814F858:
subs r0, r1
lsls r0, 2
adds r0, r2
ldr r1, =gUnknown_0202420F
ldr r1, =gStringBank
ldrb r2, [r1]
ldrh r0, [r0, 0x18]
cmp r0, r2

View File

@ -547,7 +547,7 @@ _080D7B4E:
strb r5, [r0]
bl sub_80D7988
bl init_uns_table_pokemon_copy
ldr r4, =gUnknown_020244D4
ldr r4, =gBattleDecompressedSprites
ldr r0, [r4]
ldr r0, [r0]
bl Free
@ -581,7 +581,7 @@ _080D7B4E:
lsls r1, 9
adds r0, r1
strb r5, [r0]
bl sub_806E414
bl ClearBattleMonForms
bl sub_80D787C
b _080D7BF6
.pool
@ -2494,7 +2494,7 @@ _080D8DC4:
mov r4, r8
lsls r4, 2
mov r10, r4
ldr r1, =gUnknown_020244E4
ldr r1, =gBattleMonForms
movs r2, 0
adds r0, r1, 0x3
_080D8DD0:
@ -6741,7 +6741,7 @@ sub_80DB174: @ 80DB174
lsls r0, r5, 3
ldr r1, =gMonBackPicTable
adds r0, r1
ldr r1, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
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, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
ldr r1, [r1]
ldr r1, [r1, 0x4]
adds r2, r5, 0
@ -13607,7 +13607,7 @@ sub_80DE864: @ 80DE864
movs r2, 0x14
bl memset
bl sub_80A3934
ldr r1, =gUnknown_020244E4
ldr r1, =gBattleMonForms
movs r2, 0
adds r0, r1, 0x3
_080DE8A8:

View File

@ -1364,7 +1364,7 @@ _080F6454:
mov r9, r4
ldr r4, =gMonFrontPicTable
mov r12, r4
ldr r4, =gUnknown_020244D4
ldr r4, =gBattleDecompressedSprites
mov r8, r4
cmp r0, 0
beq _080F648C

View File

@ -581,7 +581,7 @@ sub_81302E8: @ 81302E8
lsls r0, r5, 3
ldr r1, =gMonFrontPicTable
adds r0, r1
ldr r4, =gUnknown_020244D4
ldr r4, =gBattleDecompressedSprites
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, =gUnknown_020244D4
ldr r4, =gBattleDecompressedSprites
ldr r1, [r4]
ldr r1, [r1, 0x4]
ldr r2, [r6]

View File

@ -399,7 +399,7 @@ _08071688:
lsls r0, r4, 3
ldr r1, =gMonFrontPicTable
adds r0, r1
ldr r1, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
ldr r2, [r1]
mov r6, r8
lsls r1, r6, 1

View File

@ -235,7 +235,7 @@ evolution_cutscene: @ 813DA8C
lsls r0, r5, 3
ldr r1, =gMonFrontPicTable
adds r0, r1
ldr r2, =gUnknown_020244D4
ldr r2, =gBattleDecompressedSprites
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, =gUnknown_020244D4
ldr r2, =gBattleDecompressedSprites
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, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
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, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
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, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
ldr r1, [r1]
ldr r1, [r1, 0x8]
adds r2, r5, 0
@ -1647,7 +1647,7 @@ _0813E99E:
ldrh r1, [r4, 0xA]
ldrh r2, [r4, 0xC]
mov r0, r9
bl sub_806D778
bl EvolutionRenameMon
ldrh r0, [r4, 0xC]
bl SpeciesToNationalPokedexNum
lsls r0, 16
@ -2831,7 +2831,7 @@ _0813F4F2:
ldrh r1, [r4, 0xA]
ldrh r2, [r4, 0xC]
mov r0, r9
bl sub_806D778
bl EvolutionRenameMon
ldrh r0, [r4, 0xC]
bl SpeciesToNationalPokedexNum
lsls r0, 16

View File

@ -2487,7 +2487,7 @@ ItemUseInBattle_StatIncrease: @ 80FE4B8
lsls r0, 24
lsrs r4, r0, 24
ldr r1, =gBattlePartyID
ldr r0, =gUnknown_020244B8
ldr r0, =gBankInMenu
ldrb r0, [r0]
lsls r0, 1
adds r0, r1

View File

@ -322,7 +322,7 @@ _08179E48:
lsls r0, r5, 3
ldr r1, =gMonFrontPicTable
adds r0, r1
ldr r1, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
ldr r1, [r1]
ldr r1, [r1, 0x8]
adds r2, r5, 0

View File

@ -335,7 +335,7 @@ sub_806A068: @ 806A068
lsrs r5, r0, 16
lsls r1, 24
lsrs r4, r1, 24
ldr r0, =gUnknown_020244D4
ldr r0, =gBattleDecompressedSprites
ldr r2, [r0]
cmp r2, 0
beq _0806A09C
@ -454,7 +454,7 @@ _0806A144:
b _0806A1B0
.pool
_0806A170:
ldr r0, =gUnknown_020244D4
ldr r0, =gBattleDecompressedSprites
ldr r1, [r0]
cmp r1, 0
beq _0806A194
@ -501,7 +501,7 @@ sub_806A1C0: @ 806A1C0
lsrs r5, r0, 16
lsls r1, 24
lsrs r4, r1, 24
ldr r0, =gUnknown_020244D4
ldr r0, =gBattleDecompressedSprites
ldr r2, [r0]
cmp r2, 0
beq _0806A1F4

File diff suppressed because it is too large Load Diff

View File

@ -77,7 +77,7 @@ ExecuteTableBasedItemEffect: @ 806BD28
cmp r0, 0
beq _0806BDA8
ldr r2, =gEnigmaBerries
ldr r0, =gUnknown_020244B8
ldr r0, =gBankInMenu
ldrb r1, [r0]
lsls r0, r1, 3
subs r0, r1
@ -100,8 +100,8 @@ _0806BDBC:
lsrs r0, 24
_0806BDC4:
str r0, [sp, 0x34]
ldr r1, =gUnknown_0202420F
ldr r0, =gUnknown_020244B8
ldr r1, =gStringBank
ldr r0, =gBankInMenu
ldrb r2, [r0]
strb r2, [r1]
ldr r0, =gMain

View File

@ -265,7 +265,7 @@ _080A94F8:
bl sub_805EE54
_080A955C:
ldr r1, =gUnknown_020244AC
ldr r0, =gUnknown_020244B8
ldr r0, =gBankInMenu
ldrb r0, [r0]
adds r0, r1
ldrb r0, [r0]
@ -587,7 +587,7 @@ _080A9786:
adds r0, r1
lsls r0, 2
adds r0, r5
ldr r1, =gUnknown_020244E4
ldr r1, =gBattleMonForms
adds r1, r7, r1
ldrb r1, [r1]
bl StartSpriteAnim
@ -804,7 +804,7 @@ _080A998C:
adds r0, r1
lsls r0, 2
adds r0, r5
ldr r1, =gUnknown_020244E4
ldr r1, =gBattleMonForms
adds r1, r7, r1
ldrb r1, [r1]
bl StartSpriteAnim

View File

@ -76,7 +76,7 @@ _080326B8:
movs r5, 0
str r5, [r0]
bl sub_80A3934
bl sub_806E414
bl ClearBattleMonForms
movs r0, 0xF
bl BattleAI_HandleItemUseBeforeAISetup
ldr r0, =gBattleTypeFlags
@ -2619,7 +2619,7 @@ dp01_build_cmdbuf_x10_TODO: @ 8033BE4
adds r0, 0xB1
ldrb r0, [r0]
strb r0, [r3, 0x9]
ldr r0, =gUnknown_0202420F
ldr r0, =gStringBank
ldrb r0, [r0]
strb r0, [r3, 0xA]
ldr r3, =gBattleMoves

View File

@ -1317,7 +1317,7 @@ _08072D86:
movs r2, 0x1
movs r3, 0x3
bl ConvertIntToDecimalStringN
ldr r0, =gUnknown_020244D4
ldr r0, =gBattleDecompressedSprites
ldr r0, [r0]
movs r1, 0xBA
lsls r1, 1
@ -1333,7 +1333,7 @@ _08072D86:
lsls r0, 2
adds r5, r0, r1
_08072DB8:
ldr r0, =gUnknown_020244D4
ldr r0, =gBattleDecompressedSprites
ldr r0, [r0]
movs r1, 0xBA
lsls r1, 1
@ -1536,7 +1536,7 @@ _08072F52:
ldr r1, =gUnknown_085E8D3E
bl StringCopy
_08072F82:
ldr r0, =gUnknown_020244D4
ldr r0, =gBattleDecompressedSprites
ldr r0, [r0]
movs r1, 0xBA
lsls r1, 1
@ -1556,7 +1556,7 @@ _08072F82:
_08072FA6:
cmp r4, 0x2
bhi _08072FF0
ldr r0, =gUnknown_020244D4
ldr r0, =gBattleDecompressedSprites
ldr r0, [r0]
movs r2, 0xBA
lsls r2, 1
@ -1579,7 +1579,7 @@ _08072FA6:
b _0807301A
.pool
_08072FF0:
ldr r0, =gUnknown_020244D4
ldr r0, =gBattleDecompressedSprites
ldr r0, [r0]
movs r1, 0xBA
lsls r1, 1
@ -1609,7 +1609,7 @@ _08073024:
mov r3, r8
cmp r3, 0
bne _08073084
ldr r0, =gUnknown_020244D4
ldr r0, =gBattleDecompressedSprites
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, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
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, =gUnknown_020244D4
ldr r5, =gBattleDecompressedSprites
ldr r0, [r5]
movs r2, 0xBA
lsls r2, 1

View File

@ -263,7 +263,7 @@ _080A5E90:
cmp r5, r0
bne _080A5EB0
ldr r0, =gUnknown_08525F8C
ldr r1, =gUnknown_020244E4
ldr r1, =gBattleMonForms
adds r1, r4, r1
ldrb r1, [r1]
adds r1, r0
@ -353,7 +353,7 @@ _080A5F58:
cmp r5, r0
bne _080A5F7C
ldr r0, =gUnknown_08525F78
ldr r1, =gUnknown_020244E4
ldr r1, =gBattleMonForms
adds r1, r4, r1
ldrb r1, [r1]
lsls r1, 2
@ -407,7 +407,7 @@ sub_80A5FA0: @ 80A5FA0
cmp r4, r0
bne _080A5FE8
ldr r0, =gUnknown_08525F88
ldr r1, =gUnknown_020244E4
ldr r1, =gBattleMonForms
adds r1, r6, r1
ldrb r1, [r1]
adds r1, r0
@ -4541,7 +4541,7 @@ sub_80A7F18: @ 80A7F18
movs r4, 0
ldr r1, =gBankSpriteIds
ldr r7, =0x00000181
ldr r0, =gUnknown_020244E4
ldr r0, =gBattleMonForms
adds r6, r5, r0
_080A7F38:
adds r0, r4, r1
@ -5155,7 +5155,7 @@ sub_80A8394: @ 80A8394
bl AllocSpritePalette
lsls r0, 24
lsrs r5, r0, 24
ldr r4, =gUnknown_020244D4
ldr r4, =gBattleDecompressedSprites
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, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
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, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
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, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
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, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
ldr r1, [r1]
movs r3, 0xBE
lsls r3, 1
@ -5305,7 +5305,7 @@ _080A8524:
mov r3, r8
bl LoadSpecialPokePic_2
_080A8540:
ldr r5, =gUnknown_020244D4
ldr r5, =gBattleDecompressedSprites
ldr r0, [r5]
movs r4, 0xBE
lsls r4, 1
@ -5658,7 +5658,7 @@ _080A882E:
cmp r7, r0
bne _080A8850
_080A8834:
ldr r0, =gUnknown_020244E4
ldr r0, =gBattleMonForms
add r0, r8
ldrb r0, [r0]
lsls r0, 2

View File

@ -3024,12 +3024,12 @@ _0815B8E0:
lsls r0, 24
lsrs r1, r0, 24
_0815B8EA:
ldr r0, =gUnknown_020244D4
ldr r0, =gBattleDecompressedSprites
ldr r2, [r0]
lsls r0, r1, 2
adds r2, 0x4
adds r2, r0
ldr r1, =gUnknown_020244E4
ldr r1, =gBattleMonForms
ldr r0, =gAnimationBankAttacker
ldrb r0, [r0]
adds r0, r1

View File

@ -52450,8 +52450,8 @@ sub_81A9F1C: @ 81A9F1C
.pool
thumb_func_end sub_81A9F1C
thumb_func_start sub_81A9F3C
sub_81A9F3C: @ 81A9F3C
thumb_func_start GetTrainerEncounterMusicIdInBattlePyramind
GetTrainerEncounterMusicIdInBattlePyramind: @ 81A9F3C
push {r4,lr}
lsls r0, 16
lsrs r0, 16
@ -52483,7 +52483,7 @@ _081A9F7A:
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_81A9F3C
thumb_func_end GetTrainerEncounterMusicIdInBattlePyramind
thumb_func_start sub_81A9F80
sub_81A9F80: @ 81A9F80
@ -80378,7 +80378,7 @@ _081B8BA8:
movs r0, 0x1
strb r0, [r1]
ldr r1, =gBattlePartyID
ldr r0, =gUnknown_020244B8
ldr r0, =gBankInMenu
ldrb r0, [r0]
lsls r0, 1
adds r0, r1
@ -80410,7 +80410,7 @@ _081B8BFC:
b _081B8C42
.pool
_081B8C20:
ldr r0, =gUnknown_020244B8
ldr r0, =gBankInMenu
ldrb r0, [r0]
ldr r1, =gBattlePartyID
lsls r0, 1

View File

@ -2290,7 +2290,7 @@ _081BF9EE:
strb r1, [r0]
movs r0, 0xFF
bl sub_81C488C
ldr r0, =gUnknown_020244D4
ldr r0, =gBattleDecompressedSprites
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, =gUnknown_020244D4
ldr r0, =gBattleDecompressedSprites
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, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
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, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
ldr r1, [r1]
b _081C46B0
.pool
_081C4680:
ldr r0, =gUnknown_020244D4
ldr r0, =gBattleDecompressedSprites
ldr r3, [r0]
adds r4, r0, 0
cmp r3, 0

View File

@ -710,7 +710,7 @@ _080F8D44:
lsls r0, r6, 3
ldr r1, =gMonFrontPicTable
adds r0, r1
ldr r1, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
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, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
ldr r1, [r1]
ldr r1, [r1, 0x8]
adds r2, r6, 0

View File

@ -7128,7 +7128,7 @@ _0807AD58:
lsls r0, r5, 3
ldr r1, =gMonFrontPicTable
adds r0, r1
ldr r1, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
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, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
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, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
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, =gUnknown_020244D4
ldr r1, =gBattleDecompressedSprites
ldr r1, [r1]
ldr r1, [r1, 0x10]
ldr r3, [r3, 0x6C]

View File

@ -548,7 +548,7 @@ gUnknown_085CBDBD:: @ 85CBDBD
gUnknown_085CBDBF:: @ 85CBDBF
.incbin "baserom.gba", 0x5cbdbf, 0x41
gUnknown_085CBE00:: @ 85CBE00
gStatNamesTable:: @ 85CBE00
.incbin "baserom.gba", 0x5cbe00, 0x6c
gUnknown_085CBE6C:: @ 85CBE6C

View File

@ -187,8 +187,7 @@ struct Trainer
{
/*0x00*/ u8 partyFlags;
/*0x01*/ u8 trainerClass;
/*0x02*/ u8 encounterMusic:7;
/*0x02*/ u8 gender:1;
/*0x02*/ u8 encounterMusic_gender; // last bit is gender
/*0x03*/ u8 trainerPic;
/*0x04*/ u8 trainerName[12];
/*0x10*/ u16 items[4];
@ -200,6 +199,8 @@ struct Trainer
extern const struct Trainer gTrainers[];
#define TRAINER_ENCOUNTER_MUSIC(trainer)((gTrainers[trainer].encounterMusic_gender & 0x7F))
struct UnknownFlags
{
u32 flags[4];
@ -412,4 +413,12 @@ struct BattleScripting
extern struct BattleScripting gBattleScripting;
#endif
struct BattleDecompressedSprites
{
void* firstDecompressed; // ptr to the decompressed sprite of the first pokemon
void* sprites[4];
};
extern struct BattleDecompressedSprites* gBattleDecompressedSprites;
#endif // GUARD_BATTLE_H

View File

@ -20,4 +20,9 @@ void BufferStringBattle(u16 stringID);
u32 StrCpyDecodeToDisplayedStringBattle(const u8* src);
u32 StrCpyDecodeBattle(const u8* src, u8* dst);
extern u8 gBattleTextBuff1[];
extern u8 gBattleTextBuff2[];
extern u8 gBattleTextBuff3[];
extern u8 gDisplayedStringBattle[];
#endif // GUARD_BATTLE_MESSAGE_H

View File

@ -42,14 +42,14 @@ struct Berry2
struct EnigmaBerry
{
struct Berry2 berry;
u8 pic[(6 * 6) * TILE_SIZE_4BPP];
u16 palette[16];
u8 description1[45];
u8 description2[45];
u8 itemEffect[18];
u8 holdEffect;
u8 holdEffectParam;
u32 checksum;
u8 pic[(6 * 6) * TILE_SIZE_4BPP];
u16 palette[16];
u8 description1[45];
u8 description2[45];
};
struct BattleEnigmaBerry

194
include/link.h Normal file
View File

@ -0,0 +1,194 @@
#ifndef GUARD_LINK_H
#define GUARD_LINK_H
#define MAX_LINK_PLAYERS 4
#define CMD_LENGTH 8
#define QUEUE_CAPACITY 50
#define BLOCK_BUFFER_SIZE 0x100
#define LINK_STAT_LOCAL_ID 0x00000003
#define LINK_STAT_PLAYER_COUNT 0x0000001C
#define LINK_STAT_PLAYER_COUNT_SHIFT 2
#define LINK_STAT_MASTER 0x00000020
#define LINK_STAT_MASTER_SHIFT 5
#define LINK_STAT_CONN_ESTABLISHED 0x00000040
#define LINK_STAT_CONN_ESTABLISHED_SHIFT 6
#define LINK_STAT_RECEIVED_NOTHING 0x00000100
#define LINK_STAT_RECEIVED_NOTHING_SHIFT 8
#define LINK_STAT_ERRORS 0x0007F000
#define EXTRACT_PLAYER_COUNT(status) \
(((status) & LINK_STAT_PLAYER_COUNT) >> LINK_STAT_PLAYER_COUNT_SHIFT)
#define EXTRACT_MASTER(status) \
(((status) >> LINK_STAT_MASTER_SHIFT) & 1)
#define EXTRACT_CONN_ESTABLISHED(status) \
(((status) >> LINK_STAT_CONN_ESTABLISHED_SHIFT) & 1)
#define EXTRACT_RECEIVED_NOTHING(status) \
(((status) >> LINK_STAT_RECEIVED_NOTHING_SHIFT) & 1)
#define MASTER_HANDSHAKE 0x8FFF
#define SLAVE_HANDSHAKE 0xB9A0
enum
{
LINK_STATE_START0,
LINK_STATE_START1,
LINK_STATE_HANDSHAKE,
LINK_STATE_INIT_TIMER,
LINK_STATE_CONN_ESTABLISHED,
};
enum
{
EXCHANGE_NOT_STARTED,
EXCHANGE_COMPLETE,
EXCHANGE_TIMED_OUT,
EXCHANGE_IN_PROGRESS,
};
enum
{
QUEUE_FULL_NONE,
QUEUE_FULL_SEND,
QUEUE_FULL_RECV,
};
enum
{
LAG_NONE,
LAG_MASTER,
LAG_SLAVE,
};
struct LinkPlayer
{
/* 0x00 */ u16 version;
/* 0x02 */ u16 lp_field_2;
/* 0x04 */ u32 trainerId;
/* 0x08 */ u8 name[11];
/* 0x13 */ u8 gender;
/* 0x14 */ u32 linkType;
/* 0x18 */ u16 lp_field_18;
/* 0x1A */ u16 language;
};
struct LinkPlayerBlock
{
u8 magic1[16];
struct LinkPlayer linkPlayer;
u8 magic2[16];
};
// circular queues
struct SendQueue
{
u16 data[CMD_LENGTH][QUEUE_CAPACITY];
u8 pos;
u8 count;
};
struct RecvQueue
{
u16 data[MAX_LINK_PLAYERS][CMD_LENGTH][QUEUE_CAPACITY];
u8 pos;
u8 count;
};
struct Link
{
u8 isMaster; // 0: slave, 8: master
u8 state;
u8 localId; // local multi-player ID
u8 playerCount;
u16 tempRecvBuffer[4];
bool8 receivedNothing;
s8 serialIntrCounter;
bool8 handshakeAsMaster;
u8 link_field_F;
// error conditions
bool8 hardwareError; // hardware reported an error
bool8 badChecksum; // checksum didn't match between devices
u8 queueFull; // send or recv queue out of space
u8 lag; // connection is lagging
u16 checksum;
u8 sendCmdIndex;
u8 recvCmdIndex;
struct SendQueue sendQueue;
struct RecvQueue recvQueue;
};
struct BlockRequest
{
void * address;
u32 size;
};
extern const struct BlockRequest sBlockRequestLookupTable[5];
extern struct Link gLink;
extern u16 gRecvCmds[CMD_LENGTH][MAX_LINK_PLAYERS];
extern u8 gBlockSendBuffer[BLOCK_BUFFER_SIZE];
extern u16 gLinkType;
extern u32 gLinkStatus;
extern u16 gBlockRecvBuffer[MAX_LINK_PLAYERS][BLOCK_BUFFER_SIZE / 2];
extern u16 gSendCmd[CMD_LENGTH];
extern u8 gShouldAdvanceLinkState;
extern struct LinkPlayer gLinkPlayers[];
extern u16 word_3002910[];
extern bool8 gReceivedRemoteLinkPlayers;
void Task_DestroySelf(u8);
void sub_8007270(u8);
void OpenLink(void);
void CloseLink(void);
u16 LinkMain2(u16 *);
void sub_8007B14(void);
bool32 sub_8007B24(void);
void ClearLinkCallback(void);
void ClearLinkCallback_2(void);
u8 GetLinkPlayerCount(void);
void OpenLinkTimed(void);
u8 GetLinkPlayerDataExchangeStatusTimed(void);
bool8 IsLinkPlayerDataExchangeComplete(void);
u32 GetLinkPlayerTrainerId(u8);
void ResetLinkPlayers(void);
void sub_8007E24(void);
void sub_8007E4C(void);
u8 GetMultiplayerId(void);
u8 bitmask_all_link_players_but_self(void);
bool8 SendBlock(u8, void *, u16);
bool8 sub_8007E9C(u8);
bool8 sub_8007ECC(void);
u8 GetBlockReceivedStatus(void);
void ResetBlockReceivedFlags(void);
void ResetBlockReceivedFlag(u8);
void sub_8007F4C(void);
void SetLinkDebugValues(u32, u32);
u8 sub_8008198(void);
void sub_80081C8(u8);
u8 sub_800820C(void);
u8 sub_8008218(void);
void sub_800826C(void);
void sub_80082EC(void);
u8 GetLinkPlayerCount_2(void);
bool8 IsLinkMaster(void);
void sub_800832C(void);
void sub_8008480(void);
void sub_80084A4(void);
void CB2_LinkError(void);
u8 GetSioMultiSI(void);
bool8 IsLinkConnectionEstablished(void);
void SetSuppressLinkErrorMessage(bool8);
bool8 HasLinkErrorOccurred(void);
void ResetSerial(void);
u32 LinkMain1(u8 *, u16 *, u16[CMD_LENGTH][MAX_LINK_PLAYERS]);
void LinkVSync(void);
void Timer3Intr(void);
void SerialCB(void);
#endif // GUARD_LINK_H

View File

@ -420,6 +420,12 @@ struct BattleMove
u8 flags;
};
struct SpindaSpot
{
u8 x, y;
u16 image[16];
};
struct __attribute__((packed)) LevelUpMove
{
u16 move:9;
@ -483,9 +489,11 @@ extern struct Pokemon gPlayerParty[PARTY_SIZE];
extern u8 gEnemyPartyCount;
extern struct Pokemon gEnemyParty[PARTY_SIZE];
extern const struct BaseStats gBaseStats[];
extern const u8 *const gItemEffectTable[];
extern const struct EvolutionData gEvolutionTable[];
extern struct PokemonStorage* gPokemonStoragePtr;
extern const u32 gExperienceTables[][MAX_MON_LEVEL + 1];
extern const u16 *const gLevelUpLearnsets[];
void ZeroBoxMonData(struct BoxPokemon *boxMon);
void ZeroMonData(struct Pokemon *mon);
@ -551,4 +559,28 @@ void CopyPlayerPartyMonToBattleData(u8 battleIndex, u8 partyIndex);
u8 GetNature(struct Pokemon *mon);
u8 GetNatureFromPersonality(u32 personality);
u16 nature_stat_mod(u8 nature, u16 n, u8 statIndex);
void MonRestorePP(struct Pokemon *);
u16 NationalPokedexNumToSpecies(u16 nationalNum);
u16 NationalToHoennOrder(u16);
u16 SpeciesToNationalPokedexNum(u16);
u16 HoennToNationalOrder(u16);
u16 SpeciesToCryId(u16 species);
void DrawSpindaSpots(u16, u32, u8 *, u8);
void AdjustFriendship(struct Pokemon *, u8);
u8 CheckPartyHasHadPokerus(struct Pokemon *, u8);
void UpdatePartyPokerusTime(u16);
u32 CanMonLearnTMHM(struct Pokemon *, u8);
u32 CanSpeciesLearnTMHM(u16 species, u8 tm);
u8 GetMoveRelearnerMoves(struct Pokemon *mon, u16 *moves);
void ClearBattleMonForms(void);
const u8 *pokemon_get_pal(struct Pokemon *mon);
const u8 *species_and_otid_get_pal(u16, u32, u32);
const struct CompressedSpritePalette *sub_80409C8(u16, u32, u32);
bool8 IsOtherTrainer(u32, u8 *);
void SetWildMonHeldItem(void);
u16 GetMonEVCount(struct Pokemon *);
#endif // GUARD_POKEMON_H

53
include/trainer_class.h Normal file
View File

@ -0,0 +1,53 @@
#ifndef GUARD_TRAINER_CLASS_H
#define GUARD_TRAINER_CLASS_H
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_EXPERT, // 0xA
CLASS_AQUA_ADMIN, // 0xB
CLASS_BLACK_BELT, // 0xC
CLASS_AQUA_LEADER, // 0xD
CLASS_HEX_MANIAC, // 0xE
CLASS_AROMA_LADY, // 0xF
CLASS_RUIN_MANIAC, // 0x10
CLASS_INTERVIEWER, // 0x11
CLASS_TUBER_FEMALE, // 0x12
CLASS_TUBER_MALE, // 0x13
CLASS_LADY, // 0x14
CLASS_BEAUTY, // 0x15
CLASS_RICH_BOY, // 0x16
CLASS_POKEMANIAC, // 0x17
CLASS_GUITARIST, // 0x18
CLASS_KINDLER, // 0x19
CLASS_CAMPER, // 0x1A
CLASS_PICKNICKER, // 0x1B
CLASS_BUG_MANIAC, // 0x1C
CLASS_PSYCHIC, // 0x1D
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_DOME_ACE, // 0x3B
CLASS_PALACE_MAVEN, // 0x3C
CLASS_ARENA_TYCOON, // 0x3D
CLASS_FACTORY_HEAD, // 0x3E
CLASS_PIKE_QUEEN, // 0x3F
CLASS_PYRAMID_KING, // 0x40
CLASS_PKMN_TRAINER2, // 0x41
};
#endif // GUARD_TRAINER_CLASS_H

View File

@ -73,6 +73,7 @@ SECTIONS {
src/pokemon_2.o(.text);
asm/pokemon_2.o(.text);
asm/pokemon_item_effect.o(.text);
src/pokemon_3.o(.text);
asm/pokemon_3.o(.text);
src/trig.o(.text);
src/rng.o(.text);

1113
src/pokemon_3.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -367,7 +367,7 @@ gUnknown_0202420D: @ 202420D
gUnknown_0202420E: @ 202420E
.space 0x1
gUnknown_0202420F: @ 202420F
gStringBank: @ 202420F
.space 0x1
gAbsentBankFlags: @ 2024210
@ -511,7 +511,7 @@ gUnknown_020244B0: @ 20244B0
gUnknown_020244B4: @ 20244B4
.space 0x4
gUnknown_020244B8: @ 20244B8
gBankInMenu: @ 20244B8
.space 0x1
gDoingBattleAnim: @ 20244B9
@ -526,7 +526,7 @@ gUnknown_020244CC: @ 20244CC
gUnknown_020244D0: @ 20244D0
.space 0x4
gUnknown_020244D4: @ 20244D4
gBattleDecompressedSprites: @ 20244D4
.space 0x4
gUnknown_020244D8: @ 20244D8
@ -541,7 +541,7 @@ gBattleMovePower: @ 20244E0
gMoveToLearn: @ 20244E2
.space 0x2
gUnknown_020244E4: @ 20244E4
gBattleMonForms: @ 20244E4
.space 0x4
sLearningMoveTableID: @ 20244E8