mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 11:37:40 +01:00
Finish decompiling pyramid bag.
This commit is contained in:
parent
bc9fe72c6e
commit
917b32ffbe
@ -1,576 +0,0 @@
|
||||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
|
||||
|
||||
|
||||
thumb_func_start sub_81C6DAC
|
||||
sub_81C6DAC: @ 81C6DAC
|
||||
push {lr}
|
||||
sub sp, 0x10
|
||||
adds r3, r1, 0
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
ldr r1, =gUnknown_0861F370
|
||||
movs r2, 0x2
|
||||
str r2, [sp]
|
||||
movs r2, 0x1
|
||||
str r2, [sp, 0x4]
|
||||
movs r2, 0xE
|
||||
str r2, [sp, 0x8]
|
||||
str r3, [sp, 0xC]
|
||||
movs r2, 0x1
|
||||
movs r3, 0
|
||||
bl CreateYesNoMenuWithCallbacks
|
||||
add sp, 0x10
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81C6DAC
|
||||
|
||||
thumb_func_start DisplayItemMessageInBattlePyramid
|
||||
@ void DisplayItemMessageInBattlePyramid(u8 taskId, u8 *str, void ( *callback)(u8 taskId))
|
||||
DisplayItemMessageInBattlePyramid: @ 81C6DD8
|
||||
push {r4-r6,lr}
|
||||
sub sp, 0x10
|
||||
adds r4, r0, 0
|
||||
adds r5, r1, 0
|
||||
adds r6, r2, 0
|
||||
lsls r4, 24
|
||||
lsrs r4, 24
|
||||
movs r0, 0x2
|
||||
movs r1, 0x11
|
||||
bl FillWindowPixelBuffer
|
||||
bl GetPlayerTextSpeed
|
||||
lsls r0, 24
|
||||
lsrs r0, 24
|
||||
movs r1, 0x1
|
||||
str r1, [sp]
|
||||
str r0, [sp, 0x4]
|
||||
str r5, [sp, 0x8]
|
||||
str r6, [sp, 0xC]
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x2
|
||||
movs r2, 0xA
|
||||
movs r3, 0xD
|
||||
bl DisplayMessageAndContinueTask
|
||||
movs r0, 0x1
|
||||
bl schedule_bg_copy_tilemap_to_vram
|
||||
add sp, 0x10
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end DisplayItemMessageInBattlePyramid
|
||||
|
||||
thumb_func_start sub_81C6E1C
|
||||
sub_81C6E1C: @ 81C6E1C
|
||||
push {lr}
|
||||
movs r0, 0x2
|
||||
movs r1, 0
|
||||
bl sub_8197DF8
|
||||
movs r0, 0x2
|
||||
bl ClearWindowTilemap
|
||||
movs r0, 0x1
|
||||
bl schedule_bg_copy_tilemap_to_vram
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_81C6E1C
|
||||
|
||||
thumb_func_start sub_81C6E38
|
||||
sub_81C6E38: @ 81C6E38
|
||||
push {r4,r5,lr}
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
ldr r0, =gUnknown_0203CF2C
|
||||
ldr r2, =0x00000804
|
||||
adds r1, r4, r2
|
||||
ldr r0, [r0]
|
||||
adds r5, r0, r1
|
||||
ldrb r0, [r5]
|
||||
cmp r0, 0xFF
|
||||
beq _081C6E80
|
||||
ldr r0, =0x00001024
|
||||
adds r4, r0
|
||||
adds r0, r4, 0
|
||||
bl FreeSpriteTilesByTag
|
||||
adds r0, r4, 0
|
||||
bl FreeSpritePaletteByTag
|
||||
ldrb r1, [r5]
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
ldr r4, =gSprites
|
||||
adds r0, r4
|
||||
bl FreeSpriteOamMatrix
|
||||
ldrb r1, [r5]
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
adds r0, r4
|
||||
bl DestroySprite
|
||||
movs r0, 0xFF
|
||||
strb r0, [r5]
|
||||
_081C6E80:
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81C6E38
|
||||
|
||||
thumb_func_start sub_81C6E98
|
||||
sub_81C6E98: @ 81C6E98
|
||||
push {r4,lr}
|
||||
sub sp, 0x8
|
||||
movs r0, 0x40
|
||||
bl Alloc
|
||||
adds r4, r0, 0
|
||||
ldr r0, =gUnknown_08D9ADD0
|
||||
adds r1, r4, 0
|
||||
bl LZDecompressWram
|
||||
ldr r0, =gSaveBlock2Ptr
|
||||
ldr r0, [r0]
|
||||
ldr r1, =0x00000ca9
|
||||
adds r0, r1
|
||||
ldrb r0, [r0]
|
||||
lsls r0, 30
|
||||
lsrs r0, 25
|
||||
adds r0, r4, r0
|
||||
str r0, [sp]
|
||||
ldr r1, =0xffff0000
|
||||
ldr r0, [sp, 0x4]
|
||||
ands r0, r1
|
||||
ldr r1, =0x00001024
|
||||
orrs r0, r1
|
||||
str r0, [sp, 0x4]
|
||||
mov r0, sp
|
||||
bl LoadSpritePalette
|
||||
adds r0, r4, 0
|
||||
bl Free
|
||||
add sp, 0x8
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81C6E98
|
||||
|
||||
thumb_func_start sub_81C6EF4
|
||||
sub_81C6EF4: @ 81C6EF4
|
||||
push {r4,lr}
|
||||
ldr r0, =gUnknown_0203CF2C
|
||||
ldr r4, [r0]
|
||||
ldr r0, =0x00000804
|
||||
adds r4, r0
|
||||
ldr r0, =gUnknown_0861F3D4
|
||||
movs r1, 0x44
|
||||
movs r2, 0x38
|
||||
movs r3, 0
|
||||
bl CreateSprite
|
||||
strb r0, [r4]
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81C6EF4
|
||||
|
||||
thumb_func_start sub_81C6F20
|
||||
sub_81C6F20: @ 81C6F20
|
||||
push {r4,lr}
|
||||
ldr r0, =gUnknown_0203CF2C
|
||||
ldr r0, [r0]
|
||||
ldr r1, =0x00000804
|
||||
adds r0, r1
|
||||
ldrb r1, [r0]
|
||||
lsls r0, r1, 4
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
ldr r1, =gSprites
|
||||
adds r4, r0, r1
|
||||
adds r0, r4, 0
|
||||
adds r0, 0x3F
|
||||
ldrb r1, [r0]
|
||||
movs r0, 0x20
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _081C6F50
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x1
|
||||
bl StartSpriteAffineAnim
|
||||
ldr r0, =sub_81C6F68
|
||||
str r0, [r4, 0x1C]
|
||||
_081C6F50:
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81C6F20
|
||||
|
||||
thumb_func_start sub_81C6F68
|
||||
sub_81C6F68: @ 81C6F68
|
||||
push {r4,lr}
|
||||
adds r4, r0, 0
|
||||
adds r0, 0x3F
|
||||
ldrb r1, [r0]
|
||||
movs r0, 0x20
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
beq _081C6F84
|
||||
adds r0, r4, 0
|
||||
movs r1, 0
|
||||
bl StartSpriteAffineAnim
|
||||
ldr r0, =SpriteCallbackDummy
|
||||
str r0, [r4, 0x1C]
|
||||
_081C6F84:
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81C6F68
|
||||
|
||||
thumb_func_start ShowItemImage
|
||||
ShowItemImage: @ 81C6F90
|
||||
push {r4-r6,lr}
|
||||
lsls r0, 16
|
||||
lsrs r6, r0, 16
|
||||
lsls r1, 24
|
||||
lsrs r4, r1, 24
|
||||
ldr r0, =gUnknown_0203CF2C
|
||||
ldr r2, =0x00000805
|
||||
adds r1, r4, r2
|
||||
ldr r0, [r0]
|
||||
adds r5, r0, r1
|
||||
ldrb r0, [r5]
|
||||
cmp r0, 0xFF
|
||||
bne _081C6FE0
|
||||
ldr r0, =0x00001025
|
||||
adds r4, r0
|
||||
adds r0, r4, 0
|
||||
bl FreeSpriteTilesByTag
|
||||
adds r0, r4, 0
|
||||
bl FreeSpritePaletteByTag
|
||||
adds r0, r4, 0
|
||||
adds r1, r4, 0
|
||||
adds r2, r6, 0
|
||||
bl AddItemIconSprite
|
||||
lsls r0, 24
|
||||
lsrs r2, r0, 24
|
||||
cmp r2, 0x40
|
||||
beq _081C6FE0
|
||||
strb r2, [r5]
|
||||
ldr r1, =gSprites
|
||||
lsls r0, r2, 4
|
||||
adds r0, r2
|
||||
lsls r0, 2
|
||||
adds r0, r1
|
||||
movs r1, 0x18
|
||||
strh r1, [r0, 0x24]
|
||||
movs r1, 0x58
|
||||
strh r1, [r0, 0x26]
|
||||
_081C6FE0:
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end ShowItemImage
|
||||
|
||||
thumb_func_start sub_81C6FF8
|
||||
sub_81C6FF8: @ 81C6FF8
|
||||
push {lr}
|
||||
lsls r0, 24
|
||||
movs r1, 0x80
|
||||
lsls r1, 17
|
||||
adds r0, r1
|
||||
lsrs r0, 24
|
||||
bl sub_81C6E38
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_81C6FF8
|
||||
|
||||
thumb_func_start sub_81C700C
|
||||
sub_81C700C: @ 81C700C
|
||||
push {lr}
|
||||
ldr r0, =gUnknown_0203CF2C
|
||||
ldr r0, [r0]
|
||||
ldr r1, =0x00000807
|
||||
adds r0, r1
|
||||
movs r1, 0x8
|
||||
bl sub_8122344
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81C700C
|
||||
|
||||
thumb_func_start sub_81C7028
|
||||
sub_81C7028: @ 81C7028
|
||||
push {lr}
|
||||
adds r2, r0, 0
|
||||
lsls r2, 24
|
||||
lsrs r2, 24
|
||||
ldr r0, =gUnknown_0203CF2C
|
||||
ldr r0, [r0]
|
||||
ldr r1, =0x00000807
|
||||
adds r0, r1
|
||||
movs r1, 0x8
|
||||
bl sub_81223FC
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81C7028
|
||||
|
||||
thumb_func_start sub_81C704C
|
||||
sub_81C704C: @ 81C704C
|
||||
push {lr}
|
||||
adds r3, r0, 0
|
||||
lsls r3, 24
|
||||
ldr r0, =gUnknown_0203CF2C
|
||||
ldr r0, [r0]
|
||||
ldr r1, =0x00000807
|
||||
adds r0, r1
|
||||
lsrs r3, 4
|
||||
movs r1, 0x80
|
||||
lsls r1, 13
|
||||
adds r3, r1
|
||||
lsrs r3, 16
|
||||
movs r1, 0x88
|
||||
movs r2, 0x78
|
||||
bl sub_8122448
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end sub_81C704C
|
||||
|
||||
thumb_func_start sub_81C7078
|
||||
sub_81C7078: @ 81C7078
|
||||
push {r4,r5,lr}
|
||||
adds r5, r0, 0
|
||||
adds r4, r1, 0
|
||||
bl is_c1_link_related_active
|
||||
cmp r0, 0
|
||||
bne _081C7090
|
||||
ldr r0, =sub_81C7170
|
||||
b _081C7092
|
||||
.pool
|
||||
_081C7090:
|
||||
ldr r0, =sub_81C71E4
|
||||
_081C7092:
|
||||
lsls r1, r4, 24
|
||||
lsrs r1, 24
|
||||
bl CreateTask
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x1
|
||||
adds r2, r5, 0
|
||||
bl SetWordTaskArg
|
||||
ldr r1, =gTasks
|
||||
lsls r0, r4, 2
|
||||
adds r0, r4
|
||||
lsls r0, 3
|
||||
adds r0, r1
|
||||
ldr r2, =gUnknown_0203CF3C
|
||||
ldrb r1, [r2]
|
||||
strh r1, [r0, 0xE]
|
||||
ldrb r0, [r2]
|
||||
adds r1, r0, 0x1
|
||||
strb r1, [r2]
|
||||
lsls r0, 24
|
||||
lsrs r0, 8
|
||||
orrs r0, r4
|
||||
pop {r4,r5}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_81C7078
|
||||
|
||||
thumb_func_start sub_81C70D8
|
||||
sub_81C70D8: @ 81C70D8
|
||||
push {lr}
|
||||
ldr r1, =0x0000ffff
|
||||
ands r1, r0
|
||||
lsrs r3, r0, 16
|
||||
ldr r2, =gTasks
|
||||
lsls r0, r1, 2
|
||||
adds r0, r1
|
||||
lsls r0, 3
|
||||
adds r1, r0, r2
|
||||
ldrb r0, [r1, 0x4]
|
||||
cmp r0, 0
|
||||
beq _081C711C
|
||||
ldr r2, [r1]
|
||||
ldr r0, =sub_81C7170
|
||||
cmp r2, r0
|
||||
beq _081C70FE
|
||||
ldr r0, =sub_81C71E4
|
||||
cmp r2, r0
|
||||
bne _081C711C
|
||||
_081C70FE:
|
||||
movs r2, 0xE
|
||||
ldrsh r0, [r1, r2]
|
||||
cmp r0, r3
|
||||
bne _081C711C
|
||||
movs r0, 0x1
|
||||
b _081C711E
|
||||
.pool
|
||||
_081C711C:
|
||||
movs r0, 0
|
||||
_081C711E:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81C70D8
|
||||
|
||||
thumb_func_start sub_81C7124
|
||||
sub_81C7124: @ 81C7124
|
||||
push {r4-r6,lr}
|
||||
adds r6, r0, 0
|
||||
movs r5, 0
|
||||
ldr r4, =gTasks
|
||||
_081C712C:
|
||||
ldrb r0, [r4, 0x4]
|
||||
cmp r0, 0
|
||||
beq _081C7160
|
||||
ldr r1, [r4]
|
||||
ldr r0, =sub_81C7170
|
||||
cmp r1, r0
|
||||
beq _081C7140
|
||||
ldr r0, =sub_81C71E4
|
||||
cmp r1, r0
|
||||
bne _081C7160
|
||||
_081C7140:
|
||||
lsls r0, r5, 24
|
||||
lsrs r0, 24
|
||||
movs r1, 0x1
|
||||
bl GetWordTaskArg
|
||||
cmp r0, r6
|
||||
bne _081C7160
|
||||
movs r0, 0x1
|
||||
b _081C716A
|
||||
.pool
|
||||
_081C7160:
|
||||
adds r4, 0x28
|
||||
adds r5, 0x1
|
||||
cmp r5, 0xF
|
||||
ble _081C712C
|
||||
movs r0, 0
|
||||
_081C716A:
|
||||
pop {r4-r6}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81C7124
|
||||
|
||||
thumb_func_start sub_81C7170
|
||||
sub_81C7170: @ 81C7170
|
||||
push {r4-r7,lr}
|
||||
lsls r0, 24
|
||||
lsrs r5, r0, 24
|
||||
adds r0, r5, 0
|
||||
movs r1, 0x1
|
||||
bl GetWordTaskArg
|
||||
adds r6, r0, 0
|
||||
lsls r0, r5, 2
|
||||
adds r0, r5
|
||||
lsls r0, 3
|
||||
ldr r1, =gTasks + 0x8
|
||||
adds r4, r0, r1
|
||||
movs r7, 0
|
||||
_081C718C:
|
||||
movs r1, 0
|
||||
ldrsh r0, [r4, r1]
|
||||
bl _call_via_r6
|
||||
cmp r0, 0x4
|
||||
bhi _081C71D6
|
||||
lsls r0, 2
|
||||
ldr r1, =_081C71AC
|
||||
adds r0, r1
|
||||
ldr r0, [r0]
|
||||
mov pc, r0
|
||||
.pool
|
||||
.align 2, 0
|
||||
_081C71AC:
|
||||
.4byte _081C71C6
|
||||
.4byte _081C71C0
|
||||
.4byte _081C71DE
|
||||
.4byte _081C71DA
|
||||
.4byte _081C71CE
|
||||
_081C71C0:
|
||||
ldrh r0, [r4]
|
||||
adds r0, 0x1
|
||||
b _081C71D8
|
||||
_081C71C6:
|
||||
ldrh r0, [r4]
|
||||
adds r0, 0x1
|
||||
strh r0, [r4]
|
||||
b _081C71DE
|
||||
_081C71CE:
|
||||
adds r0, r5, 0
|
||||
bl DestroyTask
|
||||
b _081C71DE
|
||||
_081C71D6:
|
||||
subs r0, 0x5
|
||||
_081C71D8:
|
||||
strh r0, [r4]
|
||||
_081C71DA:
|
||||
cmp r7, 0
|
||||
beq _081C718C
|
||||
_081C71DE:
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_81C7170
|
||||
|
||||
thumb_func_start sub_81C71E4
|
||||
sub_81C71E4: @ 81C71E4
|
||||
push {r4,r5,lr}
|
||||
lsls r0, 24
|
||||
lsrs r5, r0, 24
|
||||
bl sub_8087598
|
||||
cmp r0, 0
|
||||
bne _081C724A
|
||||
adds r0, r5, 0
|
||||
movs r1, 0x1
|
||||
bl GetWordTaskArg
|
||||
adds r2, r0, 0
|
||||
lsls r0, r5, 2
|
||||
adds r0, r5
|
||||
lsls r0, 3
|
||||
ldr r1, =gTasks + 0x8
|
||||
adds r4, r0, r1
|
||||
movs r1, 0
|
||||
ldrsh r0, [r4, r1]
|
||||
bl _call_via_r2
|
||||
cmp r0, 0x4
|
||||
bhi _081C7246
|
||||
lsls r0, 2
|
||||
ldr r1, =_081C7224
|
||||
adds r0, r1
|
||||
ldr r0, [r0]
|
||||
mov pc, r0
|
||||
.pool
|
||||
.align 2, 0
|
||||
_081C7224:
|
||||
.4byte _081C7238
|
||||
.4byte _081C7238
|
||||
.4byte _081C724A
|
||||
.4byte _081C724A
|
||||
.4byte _081C723E
|
||||
_081C7238:
|
||||
ldrh r0, [r4]
|
||||
adds r0, 0x1
|
||||
b _081C7248
|
||||
_081C723E:
|
||||
adds r0, r5, 0
|
||||
bl DestroyTask
|
||||
b _081C724A
|
||||
_081C7246:
|
||||
subs r0, 0x5
|
||||
_081C7248:
|
||||
strh r0, [r4]
|
||||
_081C724A:
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_81C71E4
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
@ -11626,7 +11626,7 @@ c2_815ABFC: @ 81B6254
|
||||
bl GoToBagMenu
|
||||
b _081B6276
|
||||
_081B626C:
|
||||
ldr r0, =gUnknown_0203CF30
|
||||
ldr r0, =gPyramidBagCursorData
|
||||
ldr r1, [r0]
|
||||
movs r0, 0x4
|
||||
bl sub_81C4F98
|
||||
|
233
asm/pokenav.s
233
asm/pokenav.s
@ -4,6 +4,239 @@
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
|
||||
|
||||
thumb_func_start sub_81C7078
|
||||
sub_81C7078: @ 81C7078
|
||||
push {r4,r5,lr}
|
||||
adds r5, r0, 0
|
||||
adds r4, r1, 0
|
||||
bl is_c1_link_related_active
|
||||
cmp r0, 0
|
||||
bne _081C7090
|
||||
ldr r0, =sub_81C7170
|
||||
b _081C7092
|
||||
.pool
|
||||
_081C7090:
|
||||
ldr r0, =sub_81C71E4
|
||||
_081C7092:
|
||||
lsls r1, r4, 24
|
||||
lsrs r1, 24
|
||||
bl CreateTask
|
||||
lsls r0, 24
|
||||
lsrs r4, r0, 24
|
||||
adds r0, r4, 0
|
||||
movs r1, 0x1
|
||||
adds r2, r5, 0
|
||||
bl SetWordTaskArg
|
||||
ldr r1, =gTasks
|
||||
lsls r0, r4, 2
|
||||
adds r0, r4
|
||||
lsls r0, 3
|
||||
adds r0, r1
|
||||
ldr r2, =gUnknown_0203CF3C
|
||||
ldrb r1, [r2]
|
||||
strh r1, [r0, 0xE]
|
||||
ldrb r0, [r2]
|
||||
adds r1, r0, 0x1
|
||||
strb r1, [r2]
|
||||
lsls r0, 24
|
||||
lsrs r0, 8
|
||||
orrs r0, r4
|
||||
pop {r4,r5}
|
||||
pop {r1}
|
||||
bx r1
|
||||
.pool
|
||||
thumb_func_end sub_81C7078
|
||||
|
||||
thumb_func_start sub_81C70D8
|
||||
sub_81C70D8: @ 81C70D8
|
||||
push {lr}
|
||||
ldr r1, =0x0000ffff
|
||||
ands r1, r0
|
||||
lsrs r3, r0, 16
|
||||
ldr r2, =gTasks
|
||||
lsls r0, r1, 2
|
||||
adds r0, r1
|
||||
lsls r0, 3
|
||||
adds r1, r0, r2
|
||||
ldrb r0, [r1, 0x4]
|
||||
cmp r0, 0
|
||||
beq _081C711C
|
||||
ldr r2, [r1]
|
||||
ldr r0, =sub_81C7170
|
||||
cmp r2, r0
|
||||
beq _081C70FE
|
||||
ldr r0, =sub_81C71E4
|
||||
cmp r2, r0
|
||||
bne _081C711C
|
||||
_081C70FE:
|
||||
movs r2, 0xE
|
||||
ldrsh r0, [r1, r2]
|
||||
cmp r0, r3
|
||||
bne _081C711C
|
||||
movs r0, 0x1
|
||||
b _081C711E
|
||||
.pool
|
||||
_081C711C:
|
||||
movs r0, 0
|
||||
_081C711E:
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81C70D8
|
||||
|
||||
thumb_func_start sub_81C7124
|
||||
sub_81C7124: @ 81C7124
|
||||
push {r4-r6,lr}
|
||||
adds r6, r0, 0
|
||||
movs r5, 0
|
||||
ldr r4, =gTasks
|
||||
_081C712C:
|
||||
ldrb r0, [r4, 0x4]
|
||||
cmp r0, 0
|
||||
beq _081C7160
|
||||
ldr r1, [r4]
|
||||
ldr r0, =sub_81C7170
|
||||
cmp r1, r0
|
||||
beq _081C7140
|
||||
ldr r0, =sub_81C71E4
|
||||
cmp r1, r0
|
||||
bne _081C7160
|
||||
_081C7140:
|
||||
lsls r0, r5, 24
|
||||
lsrs r0, 24
|
||||
movs r1, 0x1
|
||||
bl GetWordTaskArg
|
||||
cmp r0, r6
|
||||
bne _081C7160
|
||||
movs r0, 0x1
|
||||
b _081C716A
|
||||
.pool
|
||||
_081C7160:
|
||||
adds r4, 0x28
|
||||
adds r5, 0x1
|
||||
cmp r5, 0xF
|
||||
ble _081C712C
|
||||
movs r0, 0
|
||||
_081C716A:
|
||||
pop {r4-r6}
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_81C7124
|
||||
|
||||
thumb_func_start sub_81C7170
|
||||
sub_81C7170: @ 81C7170
|
||||
push {r4-r7,lr}
|
||||
lsls r0, 24
|
||||
lsrs r5, r0, 24
|
||||
adds r0, r5, 0
|
||||
movs r1, 0x1
|
||||
bl GetWordTaskArg
|
||||
adds r6, r0, 0
|
||||
lsls r0, r5, 2
|
||||
adds r0, r5
|
||||
lsls r0, 3
|
||||
ldr r1, =gTasks + 0x8
|
||||
adds r4, r0, r1
|
||||
movs r7, 0
|
||||
_081C718C:
|
||||
movs r1, 0
|
||||
ldrsh r0, [r4, r1]
|
||||
bl _call_via_r6
|
||||
cmp r0, 0x4
|
||||
bhi _081C71D6
|
||||
lsls r0, 2
|
||||
ldr r1, =_081C71AC
|
||||
adds r0, r1
|
||||
ldr r0, [r0]
|
||||
mov pc, r0
|
||||
.pool
|
||||
.align 2, 0
|
||||
_081C71AC:
|
||||
.4byte _081C71C6
|
||||
.4byte _081C71C0
|
||||
.4byte _081C71DE
|
||||
.4byte _081C71DA
|
||||
.4byte _081C71CE
|
||||
_081C71C0:
|
||||
ldrh r0, [r4]
|
||||
adds r0, 0x1
|
||||
b _081C71D8
|
||||
_081C71C6:
|
||||
ldrh r0, [r4]
|
||||
adds r0, 0x1
|
||||
strh r0, [r4]
|
||||
b _081C71DE
|
||||
_081C71CE:
|
||||
adds r0, r5, 0
|
||||
bl DestroyTask
|
||||
b _081C71DE
|
||||
_081C71D6:
|
||||
subs r0, 0x5
|
||||
_081C71D8:
|
||||
strh r0, [r4]
|
||||
_081C71DA:
|
||||
cmp r7, 0
|
||||
beq _081C718C
|
||||
_081C71DE:
|
||||
pop {r4-r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_81C7170
|
||||
|
||||
thumb_func_start sub_81C71E4
|
||||
sub_81C71E4: @ 81C71E4
|
||||
push {r4,r5,lr}
|
||||
lsls r0, 24
|
||||
lsrs r5, r0, 24
|
||||
bl sub_8087598
|
||||
cmp r0, 0
|
||||
bne _081C724A
|
||||
adds r0, r5, 0
|
||||
movs r1, 0x1
|
||||
bl GetWordTaskArg
|
||||
adds r2, r0, 0
|
||||
lsls r0, r5, 2
|
||||
adds r0, r5
|
||||
lsls r0, 3
|
||||
ldr r1, =gTasks + 0x8
|
||||
adds r4, r0, r1
|
||||
movs r1, 0
|
||||
ldrsh r0, [r4, r1]
|
||||
bl _call_via_r2
|
||||
cmp r0, 0x4
|
||||
bhi _081C7246
|
||||
lsls r0, 2
|
||||
ldr r1, =_081C7224
|
||||
adds r0, r1
|
||||
ldr r0, [r0]
|
||||
mov pc, r0
|
||||
.pool
|
||||
.align 2, 0
|
||||
_081C7224:
|
||||
.4byte _081C7238
|
||||
.4byte _081C7238
|
||||
.4byte _081C724A
|
||||
.4byte _081C724A
|
||||
.4byte _081C723E
|
||||
_081C7238:
|
||||
ldrh r0, [r4]
|
||||
adds r0, 0x1
|
||||
b _081C7248
|
||||
_081C723E:
|
||||
adds r0, r5, 0
|
||||
bl DestroyTask
|
||||
b _081C724A
|
||||
_081C7246:
|
||||
subs r0, 0x5
|
||||
_081C7248:
|
||||
strh r0, [r4]
|
||||
_081C724A:
|
||||
pop {r4,r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
thumb_func_end sub_81C71E4
|
||||
|
||||
thumb_func_start CB2_PokeNav
|
||||
CB2_PokeNav: @ 81C7250
|
||||
|
@ -3,60 +3,6 @@
|
||||
|
||||
.section .rodata
|
||||
|
||||
.align 2
|
||||
gUnknown_0861F2B4:: @ 861F2B4
|
||||
.4byte 0x000011f0, 0x000001e1, 0x000021de
|
||||
|
||||
.align 2
|
||||
gUnknown_0861F2C0:: @ 861F2C0
|
||||
.4byte 0x00000000, sub_81C5460, sub_81C5518, 0x00000000, 0x00080000, 0x07003021
|
||||
|
||||
.align 2
|
||||
gUnknown_0861F2D8:: @ 861F2D8
|
||||
.4byte gMenuText_Use, sub_81C61E0
|
||||
.4byte gMenuText_Toss, sub_81C62C4
|
||||
.4byte gMenuText_Give, sub_81C6648
|
||||
.4byte gText_Cancel2, sub_81C6258
|
||||
.4byte gMenuText_Use, sub_81C679C
|
||||
.4byte gText_EmptyString2, NULL
|
||||
|
||||
gUnknown_0861F308:: @ 861F308
|
||||
.byte 0x00, 0x02, 0x01, 0x03
|
||||
|
||||
gUnknown_0861F30C:: @ 861F30C
|
||||
.byte 0x01, 0x03
|
||||
|
||||
gUnknown_0861F30E:: @ 861F30E
|
||||
.byte 0x04, 0x03
|
||||
|
||||
gUnknown_0861F310:: @ 861F310
|
||||
.byte 0x03, 0x00, 0x00, 0x00
|
||||
|
||||
gUnknown_0861F314:: @ 861F314
|
||||
.4byte sub_81C654C
|
||||
.4byte sub_81C63D0
|
||||
|
||||
gUnknown_0861F31C:: @ 861F31C
|
||||
.byte 0x00, 0x02, 0x03, 0x00, 0x03, 0x01, 0x01, 0x02, 0x03, 0x00, 0x00, 0x00
|
||||
|
||||
.align 2
|
||||
gUnknown_0861F328:: @ 861F328
|
||||
window_template 0x00, 0x0e, 0x02, 0x0f, 0x10, 0x0f, 0x001e
|
||||
window_template 0x00, 0x00, 0x0d, 0x0e, 0x06, 0x0f, 0x010e
|
||||
window_template 0x01, 0x02, 0x0f, 0x1b, 0x04, 0x0f, 0x0162
|
||||
window_template 0x01, 0x18, 0x11, 0x05, 0x02, 0x0f, 0x01ce
|
||||
null_window_template
|
||||
|
||||
.align 2
|
||||
gUnknown_0861F350:: @ 861F350
|
||||
window_template 0x01, 0x16, 0x11, 0x07, 0x02, 0x0f, 0x01d8
|
||||
window_template 0x01, 0x16, 0x0f, 0x07, 0x04, 0x0f, 0x01d8
|
||||
window_template 0x01, 0x0f, 0x0f, 0x0e, 0x04, 0x0f, 0x01d8
|
||||
window_template 0x01, 0x0f, 0x0d, 0x0e, 0x06, 0x0f, 0x01d8
|
||||
|
||||
.align 2
|
||||
gUnknown_0861F370:: @ 861F370
|
||||
window_template 0x01, 0x18, 0x0f, 0x05, 0x04, 0x0f, 0x01d8
|
||||
|
||||
.align 2
|
||||
gOamData_861F378:: @ 861F378
|
||||
|
49
include/battle_pyramid_bag.h
Normal file
49
include/battle_pyramid_bag.h
Normal file
@ -0,0 +1,49 @@
|
||||
#ifndef GUARD_BATTLE_PYRAMID_BAG_H
|
||||
#define GUARD_BATTLE_PYRAMID_BAG_H
|
||||
|
||||
#include "list_menu.h"
|
||||
|
||||
struct PyramidBagResources
|
||||
{
|
||||
void (*callback2)(void);
|
||||
u8 tilemapBuffer[0x800];
|
||||
u8 itemsSpriteIds[PYRAMID_BAG_ITEMS_COUNT + 1];
|
||||
u8 windowIds[5];
|
||||
u8 unk814;
|
||||
u8 unk815;
|
||||
u8 scrollArrowSpriteId;
|
||||
const u8 *menuActionIds;
|
||||
u8 filler81C[0x820 - 0x81C];
|
||||
u8 menuActionsCount;
|
||||
u8 listMenuCount;
|
||||
u8 listMenuMaxShown;
|
||||
struct ListMenuItem bagListItems[PYRAMID_BAG_ITEMS_COUNT + 1];
|
||||
u8 itemStrings[PYRAMID_BAG_ITEMS_COUNT + 1][ITEM_NAME_LENGTH + 10];
|
||||
s16 state;
|
||||
u8 filler986[0x98C - 0x986];
|
||||
};
|
||||
|
||||
struct PyramidBagCursorData
|
||||
{
|
||||
void (*callback)(void);
|
||||
u8 unk4;
|
||||
u16 cursorPosition;
|
||||
u16 scrollPosition;
|
||||
};
|
||||
|
||||
extern struct PyramidBagResources *gPyramidBagResources;
|
||||
extern struct PyramidBagCursorData gPyramidBagCursorData;
|
||||
|
||||
void CB2_PyramidBagMenuFromStartMenu(void);
|
||||
void sub_81C4F84(void);
|
||||
void sub_81C5924(void);
|
||||
void sub_81C59BC(void);
|
||||
void sub_81C4EFC(void);
|
||||
void sub_81C4F98(u8 a0, void (*callback)(void));
|
||||
void sub_81C6714(u8 taskId);
|
||||
void sub_81C6A94(void);
|
||||
void sub_81C4F24(void);
|
||||
void sub_81C5B14(u8 taskId);
|
||||
void DisplayItemMessageInBattlePyramid(u8 taskId, const u8 *str, void (*callback)(u8 taskId));
|
||||
|
||||
#endif // GUARD_BATTLE_PYRAMID_BAG_H
|
@ -51,6 +51,5 @@ void ItemUseInBattle_EnigmaBerry(u8);
|
||||
void ItemUseOutOfBattle_CannotUse(u8);
|
||||
u8 CheckIfItemIsTMHMOrEvolutionStone(u16 itemId);
|
||||
void sub_80FDD10(u8);
|
||||
void DisplayItemMessageInBattlePyramid(u8 taskId, const u8* str, void(*callback)(u8 taskId));
|
||||
|
||||
#endif // GUARD_ITEM_USE_H
|
||||
|
@ -32,7 +32,7 @@ struct SaveSectionOffsets
|
||||
};
|
||||
|
||||
// Emerald changes this definition to be the sectors per slot.
|
||||
#define NUM_SECTORS_PER_SLOT 16 // move to save.h
|
||||
#define NUM_SECTORS_PER_SLOT 16
|
||||
|
||||
#define UNKNOWN_CHECK_VALUE 0x8012025
|
||||
|
||||
|
@ -267,7 +267,6 @@ SECTIONS {
|
||||
src/pokemon_summary_screen.o(.text);
|
||||
src/unk_pokedex_area_screen_helper.o(.text);
|
||||
src/battle_pyramid_bag.o(.text);
|
||||
asm/battle_pyramid_bag.o(.text);
|
||||
asm/pokenav.o(.text);
|
||||
src/match_call.o(.text);
|
||||
asm/pokenav.o(.text.after.match.call);
|
||||
@ -545,6 +544,7 @@ SECTIONS {
|
||||
src/berry_fix_program.o(.rodata);
|
||||
src/pokemon_summary_screen.o(.rodata);
|
||||
src/unk_pokedex_area_screen_helper.o(.rodata);
|
||||
src/battle_pyramid_bag.o(.rodata);
|
||||
data/battle_pyramid_bag.o(.rodata);
|
||||
data/pokenav.o(.rodata);
|
||||
src/match_call.o(.rodata);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -10,6 +10,7 @@
|
||||
#include "item_menu.h"
|
||||
#include "strings.h"
|
||||
#include "load_save.h"
|
||||
#include "battle_pyramid_bag.h"
|
||||
|
||||
extern bool8 InBattlePyramid(void);
|
||||
extern u16 gUnknown_0203CF30[];
|
||||
@ -965,7 +966,7 @@ bool8 RemovePyramidBagItem(u16 itemId, u16 count)
|
||||
u16 *items = gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode];
|
||||
u8 *quantities = gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.lvlMode];
|
||||
|
||||
i = gUnknown_0203CF30[3] + gUnknown_0203CF30[4];
|
||||
i = gPyramidBagCursorData.cursorPosition + gPyramidBagCursorData.scrollPosition;
|
||||
if (items[i] == itemId && quantities[i] >= count)
|
||||
{
|
||||
quantities[i] -= count;
|
||||
|
@ -33,8 +33,8 @@
|
||||
#include "pokeblock.h"
|
||||
#include "menu.h"
|
||||
#include "item_menu.h"
|
||||
#include "battle_pyramid_bag.h"
|
||||
|
||||
extern void(**gUnknown_0203CF2C)(void);
|
||||
extern void(*gUnknown_0203A0F4)(u8 taskId);
|
||||
extern void(*gUnknown_085920D8[])(void);
|
||||
extern void (*gUnknown_03006328)(u8, u16, TaskFunc);
|
||||
@ -122,7 +122,7 @@ void SetUpItemUseCallback(u8 taskId)
|
||||
}
|
||||
else
|
||||
{
|
||||
*gUnknown_0203CF2C = gUnknown_085920D8[type];
|
||||
gPyramidBagResources->callback2 = gUnknown_085920D8[type];
|
||||
sub_81C5B14(taskId);
|
||||
}
|
||||
}
|
||||
@ -987,7 +987,7 @@ void sub_80FE54C(u8 taskId)
|
||||
}
|
||||
else
|
||||
{
|
||||
*gUnknown_0203CF2C = sub_81B89F0;
|
||||
gPyramidBagResources->callback2 = sub_81B89F0;
|
||||
sub_81C5B14(taskId);
|
||||
}
|
||||
}
|
||||
|
@ -33,6 +33,7 @@
|
||||
#include "international_string_util.h"
|
||||
#include "constants/songs.h"
|
||||
#include "field_player_avatar.h"
|
||||
#include "battle_pyramid_bag.h"
|
||||
|
||||
// Menu actions
|
||||
enum
|
||||
@ -73,12 +74,11 @@ EWRAM_DATA static u8 sSaveDialogTimer = 0;
|
||||
EWRAM_DATA static bool8 sSavingComplete = FALSE;
|
||||
EWRAM_DATA static u8 sSaveInfoWindowId = 0;
|
||||
|
||||
// Extern variables
|
||||
// Extern variables.
|
||||
extern u8 gDifferentSaveFile;
|
||||
extern u16 gSaveFileStatus;
|
||||
extern u8 gUnknown_03005DB4;
|
||||
|
||||
// Extern functions in uncompiled files
|
||||
// Extern functions in not decompiled files.
|
||||
extern void sub_80AF688(void);
|
||||
extern void var_800D_set_xB(void);
|
||||
extern void sub_808B864(void);
|
||||
@ -89,7 +89,6 @@ extern void CB2_PokeNav(void);
|
||||
extern void sub_80C4DDC(void (*)(void));
|
||||
extern void sub_80C51C4(void (*)(void));
|
||||
extern void sub_80C4E74(u8, void (*)(void));
|
||||
extern void sub_81C4EFC(void);
|
||||
extern void ScriptUnfreezeEventObjects(void);
|
||||
extern void sub_81A9EC8(void);
|
||||
extern void save_serialize_map(void);
|
||||
@ -781,7 +780,7 @@ static bool8 StartMenuBattlePyramidBagCallback(void)
|
||||
play_some_sound();
|
||||
RemoveExtraStartMenuWindows();
|
||||
overworld_free_bg_tilemaps();
|
||||
SetMainCallback2(sub_81C4EFC); // Display battle pyramid bag
|
||||
SetMainCallback2(CB2_PyramidBagMenuFromStartMenu);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user