decompile more of pokeblock.s

This commit is contained in:
DizzyEggg 2017-12-16 00:08:23 +01:00
parent 8ac17e0948
commit 4351676749
56 changed files with 1061 additions and 2184 deletions

View File

@ -463,7 +463,7 @@ _081AAF54:
adds r5, r0, 0
lsls r5, 24
lsrs r5, 24
ldr r0, =gUnknown_03006310
ldr r0, =gMultiuseListMenuTemplate
ldrb r2, [r4, 0x5]
lsls r2, 1
adds r1, r4, 0
@ -719,7 +719,7 @@ _081AB1B2:
b _081AB1E4
.pool
_081AB1CC:
bl sub_8122328
bl LoadListMenuArrowsGfx
ldr r0, [r4]
ldr r1, =0x00000834
adds r0, r1
@ -902,7 +902,7 @@ _081AB30C:
cmp r6, r0
bcc _081AB30C
_081AB34A:
ldr r2, =gUnknown_03006310
ldr r2, =gMultiuseListMenuTemplate
adds r1, r2, 0
ldr r0, =gUnknown_08613F9C
ldm r0!, {r3-r5}
@ -1924,7 +1924,7 @@ bag_menu_inits_lists_menu: @ 81ABBBC
bl sub_81ABA88
ldrb r0, [r7, 0x5]
bl load_bag_item_list_buffers
ldr r0, =gUnknown_03006310
ldr r0, =gMultiuseListMenuTemplate
mov r2, r8
ldrh r1, [r2]
ldrh r2, [r4]
@ -2133,7 +2133,7 @@ _081ABDCC:
ldrb r0, [r6]
adds r1, r7, 0
mov r2, r8
bl get_coro_args_x18_x1A
bl sub_81AE860
ldrh r2, [r7]
mov r3, r8
ldrh r0, [r3]
@ -2157,12 +2157,12 @@ _081ABDCC:
.pool
_081ABE10:
ldrb r0, [r6]
bl ListMenuHandleInput
bl ListMenuHandleInputGetItemId
adds r4, r0, 0
ldrb r0, [r6]
adds r1, r7, 0
mov r2, r8
bl get_coro_args_x18_x1A
bl sub_81AE860
movs r0, 0x2
negs r0, r0
cmp r4, r0
@ -2603,7 +2603,7 @@ _081AC1DC:
subs r5, r4, 0x5
ldrb r0, [r5, 0x5]
bl load_bag_item_list_buffers
ldr r0, =gUnknown_03006310
ldr r0, =gMultiuseListMenuTemplate
ldrb r2, [r5, 0x5]
lsls r2, 1
adds r1, r4, 0
@ -2847,12 +2847,12 @@ sub_81AC3C0: @ 81AC3C0
adds r1, r2, r1
adds r3, 0x8
adds r2, r3
bl get_coro_args_x18_x1A
bl sub_81AE860
b _081AC472
.pool
_081AC418:
ldrb r0, [r4]
bl ListMenuHandleInput
bl ListMenuHandleInputGetItemId
adds r7, r0, 0
ldrb r0, [r4]
ldr r5, =gUnknown_0203CE58
@ -2864,7 +2864,7 @@ _081AC418:
adds r4, r5, 0
adds r4, 0x8
adds r2, r4
bl get_coro_args_x18_x1A
bl sub_81AE860
movs r0, 0
bl sub_80D4FC8
ldrb r0, [r5, 0x5]
@ -2989,7 +2989,7 @@ _081AC4F8:
_081AC538:
ldrb r0, [r5, 0x5]
bl load_bag_item_list_buffers
ldr r0, =gUnknown_03006310
ldr r0, =gMultiuseListMenuTemplate
mov r2, r8
ldrh r1, [r2]
ldrh r2, [r7]
@ -3070,7 +3070,7 @@ sub_81AC590: @ 81AC590
_081AC5F2:
ldrb r0, [r4, 0x5]
bl load_bag_item_list_buffers
ldr r0, =gUnknown_03006310
ldr r0, =gMultiuseListMenuTemplate
ldrh r1, [r6]
ldrh r2, [r5]
bl ListMenuInit
@ -4326,7 +4326,7 @@ Task_ActuallyToss: @ 81AD150
bl sub_81ABA88
ldrb r0, [r4, 0x5]
bl load_bag_item_list_buffers
ldr r0, =gUnknown_03006310
ldr r0, =gMultiuseListMenuTemplate
mov r2, r8
ldrh r1, [r2]
ldrh r2, [r7]
@ -4388,7 +4388,7 @@ _081AD23A:
ldr r0, =gUnknown_0203CE58
ldrb r0, [r0, 0x5]
bl load_bag_item_list_buffers
ldr r0, =gUnknown_03006310
ldr r0, =gMultiuseListMenuTemplate
ldrh r1, [r6]
ldrh r2, [r5]
bl ListMenuInit
@ -5155,7 +5155,7 @@ sub_81AD8C8: @ 81AD8C8
bl sub_81ABA88
ldrb r0, [r7, 0x5]
bl load_bag_item_list_buffers
ldr r0, =gUnknown_03006310
ldr r0, =gMultiuseListMenuTemplate
mov r2, r9
ldrh r1, [r2]
ldrh r2, [r5]

View File

@ -94,7 +94,7 @@ sub_81606A0: @ 81606A0
ldr r0, =gUnknown_085CEBB8
bl LoadSpritePalette
bl sub_81610B8
ldr r0, =gUnknown_03006310
ldr r0, =gMultiuseListMenuTemplate
ldrh r1, [r4]
ldrh r2, [r4, 0x2]
bl ListMenuInit
@ -151,7 +151,7 @@ sub_8160740: @ 8160740
ldr r0, =gUnknown_085CEBB8
bl LoadSpritePalette
bl sub_81610B8
ldr r0, =gUnknown_03006310
ldr r0, =gMultiuseListMenuTemplate
ldrh r1, [r4]
ldrh r2, [r4, 0x2]
bl ListMenuInit
@ -980,7 +980,7 @@ sub_8160F50: @ 8160F50
lsls r4, 1
adds r0, r4
ldrb r0, [r0]
bl ListMenuHandleInput
bl ListMenuHandleInputGetItemId
adds r5, r0, 0
ldr r0, [r6]
adds r0, r4
@ -988,7 +988,7 @@ sub_8160F50: @ 8160F50
ldr r4, =gUnknown_0203BC38
adds r2, r4, 0x2
adds r1, r4, 0
bl get_coro_args_x18_x1A
bl sub_81AE860
movs r0, 0x2
negs r0, r0
cmp r5, r0

View File

@ -18243,7 +18243,7 @@ _08012938:
ldrb r0, [r6, 0xF]
movs r1, 0
bl sub_81973FC
ldr r0, =gUnknown_03006310
ldr r0, =gMultiuseListMenuTemplate
adds r2, r0, 0
ldr r1, =gUnknown_082F015C
ldm r1!, {r3,r5,r7}
@ -19724,7 +19724,7 @@ _0801360C:
ldrb r0, [r6, 0xB]
movs r1, 0
bl sub_81973FC
ldr r0, =gUnknown_03006310
ldr r0, =gMultiuseListMenuTemplate
adds r2, r0, 0
ldr r1, =gUnknown_082F0204
ldm r1!, {r3,r5,r7}
@ -19769,7 +19769,7 @@ _080136EA:
b _08013A72
_080136F2:
ldrb r0, [r6, 0xE]
bl ListMenuHandleInput
bl ListMenuHandleInputGetItemId
adds r4, r0, 0
ldr r0, =gMain
ldrh r1, [r0, 0x2E]
@ -21038,7 +21038,7 @@ sub_8014210: @ 8014210
adds r6, r0, 0
lsls r6, 16
lsrs r6, 16
bl sp000_heal_pokemon
bl HealPlayerParty
bl copy_player_party_to_sav1
bl copy_bags_and_unk_data_from_save_blocks
ldr r5, =gLinkPlayers
@ -21406,7 +21406,7 @@ _080145F4:
ldr r0, =gBlockSendBuffer
movs r1, 0x1
bl sub_80143E4
bl sp000_heal_pokemon
bl HealPlayerParty
bl copy_player_party_to_sav1
bl copy_bags_and_unk_data_from_save_blocks
movs r0, 0x1
@ -21419,7 +21419,7 @@ _080145F4:
.pool
_08014620:
bl overworld_free_bg_tilemaps
bl sp000_heal_pokemon
bl HealPlayerParty
bl copy_player_party_to_sav1
bl copy_bags_and_unk_data_from_save_blocks
ldr r0, =gBlockSendBuffer
@ -21435,7 +21435,7 @@ _08014620:
.pool
_0801464C:
bl overworld_free_bg_tilemaps
bl sp000_heal_pokemon
bl HealPlayerParty
bl copy_player_party_to_sav1
bl copy_bags_and_unk_data_from_save_blocks
ldr r0, =gBlockSendBuffer
@ -21969,7 +21969,7 @@ _08014AEC:
strb r0, [r5, 0xF]
ldrb r0, [r5, 0xF]
bl sub_8018784
ldr r0, =gUnknown_03006310
ldr r0, =gMultiuseListMenuTemplate
adds r2, r0, 0
ldr r1, =gUnknown_082F015C
ldm r1!, {r3,r4,r6}
@ -22501,7 +22501,7 @@ _08014FE8:
strb r0, [r7, 0xD]
ldrb r0, [r7, 0xB]
bl sub_8018784
ldr r0, =gUnknown_03006310
ldr r0, =gMultiuseListMenuTemplate
adds r2, r0, 0
ldr r1, =gUnknown_082F0204
ldm r1!, {r3-r5}
@ -22549,7 +22549,7 @@ _080150CE:
b _080152A0
_080150D6:
ldrb r0, [r7, 0xE]
bl ListMenuHandleInput
bl ListMenuHandleInputGetItemId
adds r2, r0, 0
ldr r0, =gMain
ldrh r1, [r0, 0x2E]
@ -22874,7 +22874,7 @@ _08015398:
strb r0, [r5, 0xB]
ldrb r0, [r5, 0xB]
bl sub_8018784
ldr r0, =gUnknown_03006310
ldr r0, =gMultiuseListMenuTemplate
adds r2, r0, 0
ldr r1, =gUnknown_082F0204
ldm r1!, {r3,r4,r6}
@ -22920,7 +22920,7 @@ _08015446:
cmp r0, 0
beq _08015452
ldrb r0, [r5, 0xE]
bl ListMenuHandleInput
bl ListMenuHandleInputGetItemId
_08015452:
ldrb r0, [r5, 0x14]
cmp r0, 0x78
@ -26270,7 +26270,7 @@ _080171DC:
ldrb r0, [r5]
movs r1, 0
bl sub_81973FC
ldr r0, =gUnknown_03006310
ldr r0, =gMultiuseListMenuTemplate
adds r2, r0, 0
ldr r1, [sp, 0x24]
ldm r1!, {r3,r4,r6}
@ -26295,7 +26295,7 @@ _080171DC:
_08017228:
mov r3, r9
ldrb r0, [r3]
bl ListMenuHandleInput
bl ListMenuHandleInputGetItemId
mov r8, r0
ldr r0, =gMain
ldrh r1, [r0, 0x2E]
@ -26383,7 +26383,7 @@ _080172C8:
ldrb r0, [r6]
movs r1, 0
bl sub_81973FC
ldr r0, =gUnknown_03006310
ldr r0, =gMultiuseListMenuTemplate
adds r2, r0, 0
ldr r1, [sp, 0x24]
ldm r1!, {r3,r4,r7}
@ -26411,7 +26411,7 @@ _08017314:
_0801731C:
mov r3, r10
ldrb r0, [r3]
bl ListMenuHandleInput
bl ListMenuHandleInputGetItemId
adds r1, r0, 0
ldr r0, =gMain
ldrh r2, [r0, 0x2E]

View File

@ -64,7 +64,7 @@ _081AE4B0:
ldr r1, [sp, 0x4]
bl sub_8098858
_081AE4C0:
ldr r0, =gUnknown_03006310
ldr r0, =gMultiuseListMenuTemplate
adds r2, r0, 0
ldr r1, [sp]
ldm r1!, {r3-r5}
@ -87,7 +87,7 @@ _081AE4C0:
.pool
_081AE4F4:
ldrb r0, [r5, 0x6]
bl ListMenuHandleInput
bl ListMenuHandleInputGetItemId
str r0, [r5]
ldr r1, =gMain
ldrh r0, [r1, 0x2E]
@ -227,9 +227,9 @@ _081AE5F0:
bx r1
thumb_func_end Unused_ListMenuInit2
thumb_func_start ListMenuHandleInput
@ int ListMenuHandleInput(u8 taskId)
ListMenuHandleInput: @ 81AE604
thumb_func_start ListMenuHandleInputGetItemId
@ int ListMenuHandleInputGetItemId(u8 taskId)
ListMenuHandleInputGetItemId: @ 81AE604
push {lr}
lsls r0, 24
lsrs r0, 24
@ -337,7 +337,7 @@ _081AE6BE:
_081AE6C2:
pop {r1}
bx r1
thumb_func_end ListMenuHandleInput
thumb_func_end ListMenuHandleInputGetItemId
thumb_func_start sub_81AE6C8
sub_81AE6C8: @ 81AE6C8
@ -557,8 +557,8 @@ _081AE856:
.pool
thumb_func_end sub_81AE838
thumb_func_start get_coro_args_x18_x1A
get_coro_args_x18_x1A: @ 81AE860
thumb_func_start sub_81AE860
sub_81AE860: @ 81AE860
push {lr}
adds r3, r1, 0
lsls r0, 24
@ -581,7 +581,7 @@ _081AE882:
pop {r0}
bx r0
.pool
thumb_func_end get_coro_args_x18_x1A
thumb_func_end sub_81AE860
thumb_func_start ListMenuGetYCoordForPrintingArrowCursor
@ u8 ListMenuGetYCoordForPrintingArrowCursor(u8 taskId)

View File

@ -752,8 +752,8 @@ _08122322:
bx r0
thumb_func_end sub_8122298
thumb_func_start sub_8122328
sub_8122328: @ 8122328
thumb_func_start LoadListMenuArrowsGfx
LoadListMenuArrowsGfx: @ 8122328
push {lr}
ldr r0, =gUnknown_0859F514
bl LoadCompressedObjectPic
@ -762,7 +762,7 @@ sub_8122328: @ 8122328
pop {r0}
bx r0
.pool
thumb_func_end sub_8122328
thumb_func_end LoadListMenuArrowsGfx
thumb_func_start sub_8122344
sub_8122344: @ 8122344

View File

@ -21,7 +21,7 @@ sub_8084620: @ 8084620
lsrs r1, 1
adds r0, r4, 0
bl SetMoney
bl sp000_heal_pokemon
bl HealPlayerParty
bl sub_8084720
bl copy_saved_warp3_bank_and_enter_x_to_warp1
bl warp_in

View File

@ -733,7 +733,7 @@ sub_816B430: @ 816B430
bl sub_816B4C0
bl sub_816BC14
bl gpu_pal_allocator_reset__manage_upper_four
bl sub_8122328
bl LoadListMenuArrowsGfx
ldr r0, =gUnknown_0203BCC4
ldr r0, [r0]
movs r1, 0xCD
@ -1013,7 +1013,7 @@ sub_816B674: @ 816B674
cmp r0, 0
bne _0816B71E
ldrb r0, [r4, 0xA]
bl ListMenuHandleInput
bl ListMenuHandleInputGetItemId
adds r6, r0, 0
ldrb r0, [r4, 0xA]
ldr r7, =gUnknown_0203BCBA
@ -1021,7 +1021,7 @@ sub_816B674: @ 816B674
mov r8, r1
adds r1, r7, 0
mov r2, r8
bl get_coro_args_x18_x1A
bl sub_81AE860
movs r0, 0x2
negs r0, r0
cmp r6, r0
@ -1820,7 +1820,7 @@ _0816BD58:
movs r1, 0x2
negs r1, r1
str r1, [r0]
ldr r4, =gUnknown_03006310
ldr r4, =gMultiuseListMenuTemplate
adds r1, r4, 0
ldr r0, =gUnknown_085DFF44
ldm r0!, {r2,r3,r6}
@ -2327,7 +2327,7 @@ _0816C186:
bl sub_816C110
bl sub_816C140
bl sub_816BD04
ldr r0, =gUnknown_03006310
ldr r0, =gMultiuseListMenuTemplate
ldr r2, =gUnknown_0203BCB8
ldrh r1, [r2, 0x2]
ldrh r2, [r2]
@ -2476,7 +2476,7 @@ sub_816C30C: @ 816C30C
ldr r1, =gUnknown_0203BCBA
subs r4, r1, 0x2
adds r2, r4, 0
bl get_coro_args_x18_x1A
bl sub_81AE860
ldrh r1, [r4, 0x2]
ldrh r0, [r4]
adds r1, r0
@ -2492,12 +2492,12 @@ sub_816C30C: @ 816C30C
.pool
_0816C35C:
ldrb r0, [r4, 0xA]
bl ListMenuHandleInput
bl ListMenuHandleInputGetItemId
adds r6, r0, 0
ldrb r0, [r4, 0xA]
ldr r1, =gUnknown_0203BCBA
subs r2, r1, 0x2
bl get_coro_args_x18_x1A
bl sub_81AE860
movs r0, 0x2
negs r0, r0
cmp r6, r0
@ -2691,18 +2691,18 @@ sub_816C4FC: @ 816C4FC
ldrb r0, [r4, 0xA]
ldr r1, =gUnknown_0203BCBA
subs r2, r1, 0x2
bl get_coro_args_x18_x1A
bl sub_81AE860
b _0816C57E
.pool
_0816C530:
ldrb r0, [r4, 0xA]
bl ListMenuHandleInput
bl ListMenuHandleInputGetItemId
adds r6, r0, 0
ldrb r0, [r4, 0xA]
ldr r1, =gUnknown_0203BCBA
subs r4, r1, 0x2
adds r2, r4, 0
bl get_coro_args_x18_x1A
bl sub_81AE860
ldr r0, =gUnknown_0203BCC4
ldr r0, [r0]
movs r1, 0xCD
@ -2825,7 +2825,7 @@ _0816C622:
adds r0, r2
movs r1, 0xFF
strb r1, [r0]
ldr r0, =gUnknown_03006310
ldr r0, =gMultiuseListMenuTemplate
ldr r2, =gUnknown_0203BCB8
ldrh r1, [r2, 0x2]
ldrh r2, [r2]
@ -3363,7 +3363,7 @@ sub_816CB04: @ 816CB04
bl sub_816C110
bl sub_816C140
bl sub_816BD04
ldr r0, =gUnknown_03006310
ldr r0, =gMultiuseListMenuTemplate
ldrh r1, [r4, 0x2]
ldrh r2, [r4]
bl ListMenuInit

File diff suppressed because it is too large Load Diff

View File

@ -2460,7 +2460,7 @@ _081C52DC:
b _081C5308
.pool
_081C52F0:
bl sub_8122328
bl LoadListMenuArrowsGfx
ldr r0, [r4]
ldr r1, =0x00000984
adds r0, r1
@ -2559,7 +2559,7 @@ _081C5382:
movs r0, 0x2
negs r0, r0
str r0, [r1]
ldr r2, =gUnknown_03006310
ldr r2, =gMultiuseListMenuTemplate
adds r1, r2, 0
ldr r0, =gUnknown_0861F2C0
ldm r0!, {r4,r6,r7}
@ -2918,7 +2918,7 @@ sub_81C56F8: @ 81C56F8
lsls r4, 3
ldr r0, =gTasks + 0x8
adds r4, r0
ldr r0, =gUnknown_03006310
ldr r0, =gMultiuseListMenuTemplate
ldr r2, =gUnknown_0203CF30
ldrh r1, [r2, 0x8]
ldrh r2, [r2, 0x6]
@ -3545,7 +3545,7 @@ _081C5C12:
adds r1, r4, 0
adds r1, 0x8
adds r2, r4, 0x6
bl get_coro_args_x18_x1A
bl sub_81AE860
ldrh r1, [r4, 0x8]
ldrh r0, [r4, 0x6]
adds r1, r0
@ -3565,14 +3565,14 @@ _081C5C12:
.pool
_081C5C5C:
ldrb r0, [r7]
bl ListMenuHandleInput
bl ListMenuHandleInputGetItemId
adds r6, r0, 0
ldrb r0, [r7]
ldr r1, =gUnknown_0203CF38
mov r8, r1
mov r2, r8
subs r2, 0x2
bl get_coro_args_x18_x1A
bl sub_81AE860
movs r0, 0x2
negs r0, r0
cmp r6, r0
@ -4646,7 +4646,7 @@ sub_81C65CC: @ 81C65CC
bl sub_81C5924
bl sub_81C59BC
bl sub_81C5314
ldr r0, =gUnknown_03006310
ldr r0, =gMultiuseListMenuTemplate
ldrh r1, [r6]
ldrh r2, [r7]
bl ListMenuInit
@ -4953,18 +4953,18 @@ sub_81C68B0: @ 81C68B0
ldrb r0, [r4]
ldr r1, =gUnknown_0203CF38
subs r2, r1, 0x2
bl get_coro_args_x18_x1A
bl sub_81AE860
b _081C6940
.pool
_081C68F8:
ldrb r0, [r4]
bl ListMenuHandleInput
bl ListMenuHandleInputGetItemId
adds r6, r0, 0
ldrb r0, [r4]
ldr r4, =gUnknown_0203CF38
subs r2, r4, 0x2
adds r1, r4, 0
bl get_coro_args_x18_x1A
bl sub_81AE860
movs r0, 0
bl sub_81C7028
subs r4, 0x8
@ -5066,7 +5066,7 @@ _081C69A8:
strh r0, [r1, 0x6]
_081C69E0:
bl sub_81C5314
ldr r0, =gUnknown_03006310
ldr r0, =gMultiuseListMenuTemplate
ldrh r1, [r7]
mov r3, r8
ldrh r2, [r3]
@ -5124,7 +5124,7 @@ sub_81C6A14: @ 81C6A14
strh r0, [r1, 0x6]
_081C6A5E:
bl sub_81C5314
ldr r0, =gUnknown_03006310
ldr r0, =gMultiuseListMenuTemplate
ldrh r1, [r5]
ldrh r2, [r7]
bl ListMenuInit

View File

@ -21921,7 +21921,7 @@ sub_81D1DC0: @ 81D1DC0
ldr r7, =gUnknown_0203CF4C
ldr r0, =gText_Cancel2
mov r12, r0
ldr r4, =gUnknown_03006310
ldr r4, =gMultiuseListMenuTemplate
ldr r1, =gUnknown_0203CF48
mov r8, r1
ldr r2, =sub_81D1E7C
@ -23376,7 +23376,7 @@ sub_81D28C8: @ 81D28C8
push {r4-r7,lr}
lsls r1, 16
lsrs r4, r1, 16
ldr r3, =gUnknown_03006310
ldr r3, =gMultiuseListMenuTemplate
adds r2, r3, 0
ldr r1, =gUnknown_08625548
ldm r1!, {r5-r7}

View File

@ -1174,8 +1174,8 @@ _080F917A:
bx r1
thumb_func_end sub_80F9160
thumb_func_start sp000_heal_pokemon
sp000_heal_pokemon: @ 80F9180
thumb_func_start HealPlayerParty
HealPlayerParty: @ 80F9180
push {r4-r7,lr}
mov r7, r10
mov r6, r9
@ -1267,7 +1267,7 @@ _080F922C:
pop {r0}
bx r0
.pool
thumb_func_end sp000_heal_pokemon
thumb_func_end HealPlayerParty
thumb_func_start ScriptGiveMon
@ void ScriptGiveMon(s16 species_num, u8 level, int held_item)

View File

@ -409,7 +409,7 @@ _080DFDAC:
adds r4, r0, 0
lsls r4, 24
lsrs r4, 24
ldr r0, =gUnknown_03006310
ldr r0, =gMultiuseListMenuTemplate
movs r1, 0
movs r2, 0
bl ListMenuInit
@ -601,7 +601,7 @@ _080DFF78:
movs r0, 0x2
negs r0, r0
str r0, [r1, 0x4]
ldr r3, =gUnknown_03006310
ldr r3, =gMultiuseListMenuTemplate
adds r1, r3, 0
ldr r0, =gUnknown_08589A48
ldm r0!, {r4-r6}
@ -627,7 +627,7 @@ _080DFFDC:
_080DFFDE:
ldr r0, =gUnknown_02039F70
ldr r0, [r0]
ldr r1, =gUnknown_03006310
ldr r1, =gMultiuseListMenuTemplate
ldrh r1, [r1, 0xE]
ldr r2, =0x00002004
adds r0, r2
@ -1976,7 +1976,7 @@ Task_BuyMenu: @ 80E0AC8
b _080E0C8E
_080E0AEA:
ldrb r0, [r4, 0xE]
bl ListMenuHandleInput
bl ListMenuHandleInputGetItemId
adds r5, r0, 0
ldrb r0, [r4, 0xE]
ldr r7, =gUnknown_02039F70
@ -1985,7 +1985,7 @@ _080E0AEA:
adds r1, r2, r3
subs r3, 0x2
adds r2, r3
bl get_coro_args_x18_x1A
bl sub_81AE860
movs r0, 0x2
negs r0, r0
cmp r5, r0

View File

@ -5,15 +5,6 @@
.section .rodata
gUnknown_085B2748:: @ 85B2748
.incbin "baserom.gba", 0x5b2748, 0x60
gUnknown_085B27A8:: @ 85B27A8
.incbin "baserom.gba", 0x5b27a8, 0x8
gUnknown_085B27B0:: @ 85B27B0
.incbin "baserom.gba", 0x5b27b0, 0x18
gUnknown_085B27C8:: @ 85B27C8
.incbin "baserom.gba", 0x5b27c8, 0x88

View File

@ -1431,7 +1431,7 @@ OldaleTown_PokemonCenter_1F_EventScript_271993:: @ 8271993
waitfieldeffect 25
applymovement VAR_0x800B, OldaleTown_PokemonCenter_1F_Movement_2725AA
waitmovement 0
special sp000_heal_pokemon
special HealPlayerParty
return
OldaleTown_PokemonCenter_1F_EventScript_2719B1:: @ 82719B1
@ -2190,7 +2190,7 @@ SSTidalRooms_EventScript_272083:: @ 8272083
fadescreen 1
playfanfare BGM_ME_ASA
waitfanfare
special sp000_heal_pokemon
special HealPlayerParty
fadescreen 0
return
@ -5129,7 +5129,7 @@ SecretBase_RedCave1_EventScript_276286:: @ 8276286
call_if 1, SecretBase_RedCave1_EventScript_2762C1
compare_var_to_value VAR_RESULT, 2
call_if 1, SecretBase_RedCave1_EventScript_2762C5
special sp000_heal_pokemon
special HealPlayerParty
release
end

View File

@ -449,7 +449,7 @@ OldaleTown_PokemonCenter_2F_EventScript_276F60:: @ 8276F60
end
OldaleTown_PokemonCenter_2F_EventScript_276FBD:: @ 8276FBD
special sp000_heal_pokemon
special HealPlayerParty
special copy_player_party_to_sav1
special copy_bags_and_unk_data_from_save_blocks
copyvar VAR_0x4087, VAR_0x8004
@ -1031,7 +1031,7 @@ OldaleTown_PokemonCenter_2F_EventScript_27759F:: @ 827759F
goto_eq OldaleTown_PokemonCenter_2F_EventScript_2772EC
msgbox OldaleTown_PokemonCenter_2F_Text_27961C, 4
closemessage
special sp000_heal_pokemon
special HealPlayerParty
setvar VAR_0x8004, 6
copyvar VAR_0x4087, VAR_0x8004
call OldaleTown_PokemonCenter_2F_EventScript_277BBE

View File

@ -143,7 +143,7 @@ BattleFrontier_BattleArenaBattleRoom_EventScript_257630:: @ 8257630
special sub_81A1780
playfanfare BGM_ME_ASA
waitfanfare
special sp000_heal_pokemon
special HealPlayerParty
BattleFrontier_BattleArenaBattleRoom_EventScript_2576B0:: @ 82576B0
setvar VAR_0x8004, 9
@ -430,14 +430,14 @@ FallarborTown_BattleTentBattleRoom_EventScript_257B6C:: @ 8257B6C
setvar VAR_0x8005, 6
setvar VAR_0x8006, 0
special sub_81A1780
special sp000_heal_pokemon
special HealPlayerParty
setvar VAR_0x8004, 5
setvar VAR_0x8005, 0
special sub_8163AC4
waitstate
setvar VAR_0x8004, 18
special sub_81A1780
special sp000_heal_pokemon
special HealPlayerParty
setvar VAR_0x8004, 21
special sub_81A1780
return

View File

@ -90,7 +90,7 @@ BattleFrontier_BattleArenaLobby_EventScript_255D59:: @ 8255D59
setvar VAR_0x8004, 8
special sub_81A1780
special copy_player_party_from_sav1
special sp000_heal_pokemon
special HealPlayerParty
setvar VAR_0x8004, 3
setvar VAR_0x8005, 0
special sub_81A5238

View File

@ -528,7 +528,7 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_24C440:: @ 824C440
setvar VAR_0x8005, 6
setvar VAR_0x8006, 0
special sub_81A1780
special sp000_heal_pokemon
special HealPlayerParty
setvar VAR_0x8004, 3
setvar VAR_0x8005, 0
setvar VAR_0x4009, 1
@ -537,7 +537,7 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_24C440:: @ 824C440
setvar VAR_0x4009, 0
setvar VAR_0x8004, 17
special sub_818E9AC
special sp000_heal_pokemon
special HealPlayerParty
setvar VAR_0x8004, 16
special sub_818E9AC
return

View File

@ -95,7 +95,7 @@ BattleFrontier_BattleDomeLobby_EventScript_2498C9:: @ 82498C9
setvar VAR_0x8006, 1
special sub_818E9AC
special copy_player_party_from_sav1
special sp000_heal_pokemon
special HealPlayerParty
goto BattleFrontier_BattleDomeLobby_EventScript_249991
BattleFrontier_BattleDomeLobby_EventScript_249940:: @ 8249940
@ -118,7 +118,7 @@ BattleFrontier_BattleDomeLobby_EventScript_249940:: @ 8249940
setvar VAR_0x8006, 1
special sub_818E9AC
special copy_player_party_from_sav1
special sp000_heal_pokemon
special HealPlayerParty
BattleFrontier_BattleDomeLobby_EventScript_249991:: @ 8249991
setvar VAR_0x8004, 13
@ -265,7 +265,7 @@ BattleFrontier_BattleDomeLobby_EventScript_249BC2:: @ 8249BC2
msgbox BattleFrontier_BattleDomeLobby_Text_24A437, 4
closemessage
call BattleFrontier_BattleDomeLobby_EventScript_249C6E
special sp000_heal_pokemon
special HealPlayerParty
warp BATTLE_FRONTIER_BATTLE_DOME_CORRIDOR, 255, 23, 6
setvar VAR_0x4000, 0
waitstate

View File

@ -249,7 +249,7 @@ BattleFrontier_BattleDomePreBattleRoom_EventScript_24B5C7:: @ 824B5C7
special sub_81A1780
playfanfare BGM_ME_ASA
waitfanfare
special sp000_heal_pokemon
special HealPlayerParty
call BattleFrontier_BattleDomePreBattleRoom_EventScript_24B600
fadescreen 1
setvar VAR_0x8004, 11

View File

@ -89,7 +89,7 @@ BattleFrontier_BattleFactoryBattleRoom_EventScript_25AEA7:: @ 825AEA7
setvar VAR_0x8005, 6
setvar VAR_0x8006, 0
special sub_81A1780
special sp000_heal_pokemon
special HealPlayerParty
setvar VAR_0x8004, 6
setvar VAR_0x8005, 0
special sub_8163AC4
@ -225,7 +225,7 @@ BattleFrontier_BattleFactoryBattleRoom_EventScript_25B0E0:: @ 825B0E0
setvar VAR_0x8005, 6
setvar VAR_0x8006, 0
special sub_81A1780
special sp000_heal_pokemon
special HealPlayerParty
setvar VAR_0x8004, 6
setvar VAR_0x8005, 0
special sub_8163AC4

View File

@ -72,7 +72,7 @@ BattleFrontier_BattleFactoryPreBattleRoom_EventScript_259BA5:: @ 8259BA5
msgbox BattleFrontier_BattleFactoryPreBattleRoom_Text_25A22D, 4
playfanfare BGM_ME_ASA
waitfanfare
special sp000_heal_pokemon
special HealPlayerParty
setvar VAR_0x8004, 9
special sub_81A1780
compare_var_to_value VAR_RESULT, 0

View File

@ -100,7 +100,7 @@ BattleFrontier_BattlePalaceBattleRoom_EventScript_24F911:: @ 824F911
special sub_81A1780
playfanfare BGM_ME_ASA
waitfanfare
special sp000_heal_pokemon
special HealPlayerParty
BattleFrontier_BattlePalaceBattleRoom_EventScript_24F98A:: @ 824F98A
setvar VAR_0x8004, 9
@ -337,14 +337,14 @@ VerdanturfTown_BattleTentBattleRoom_EventScript_24FDF7:: @ 824FDF7
setvar VAR_0x8005, 6
setvar VAR_0x8006, 0
special sub_81A1780
special sp000_heal_pokemon
special HealPlayerParty
setvar VAR_0x8004, 4
setvar VAR_0x8005, 0
special sub_8163AC4
waitstate
setvar VAR_0x8004, 18
special sub_81A1780
special sp000_heal_pokemon
special HealPlayerParty
setvar VAR_0x8004, 21
special sub_81A1780
return

View File

@ -90,7 +90,7 @@ BattleFrontier_BattlePalaceLobby_EventScript_24D8A1:: @ 824D8A1
setvar VAR_0x8004, 8
special sub_81A1780
special copy_player_party_from_sav1
special sp000_heal_pokemon
special HealPlayerParty
setvar VAR_0x8004, 7
setvar VAR_0x8005, 0
special sub_8195960

View File

@ -25,7 +25,7 @@ BattleFrontier_BattlePikeLobby_EventScript_25B707:: @ 825B707
end
BattleFrontier_BattlePikeLobby_EventScript_25B710:: @ 825B710
special sp000_heal_pokemon
special HealPlayerParty
setvar VAR_0x8004, 27
special sub_81A703C
lockall
@ -77,7 +77,7 @@ BattleFrontier_BattlePikeLobby_EventScript_25B78D:: @ 825B78D
copyvar VAR_0x8006, VAR_RESULT
special sub_81A703C
special copy_player_party_from_sav1
special sp000_heal_pokemon
special HealPlayerParty
setvar VAR_0x8004, 27
special sub_81A703C
message BattleFrontier_BattlePikeLobby_Text_25C1DF
@ -108,7 +108,7 @@ BattleFrontier_BattlePikeLobby_EventScript_25B806:: @ 825B806
setvar VAR_0x8006, 0
special sub_81A703C
special copy_player_party_from_sav1
special sp000_heal_pokemon
special HealPlayerParty
setvar VAR_0x8004, 27
special sub_81A703C
setvar VAR_0x8004, 8
@ -210,7 +210,7 @@ BattleFrontier_BattlePikeLobby_EventScript_25B95C:: @ 825B95C
setvar VAR_0x8004, 5
special sub_81A1780
call BattleFrontier_BattlePikeLobby_EventScript_25BA94
special sp000_heal_pokemon
special HealPlayerParty
call BattleFrontier_BattlePikeLobby_EventScript_25BB49
warpsilent BATTLE_FRONTIER_BATTLE_PIKE_CORRIDOR, 255, 6, 7
setvar VAR_0x4000, 0

View File

@ -89,7 +89,7 @@ BattleFrontier_BattlePikeRandomRoom1_EventScript_25D285:: @ 825D285
msgbox BattleFrontier_BattlePikeRandomRoom1_Text_25DE3F, 4
playfanfare BGM_ME_ASA
waitfanfare
special sp000_heal_pokemon
special HealPlayerParty
msgbox BattleFrontier_BattlePikeRandomRoom1_Text_25DE94, 4
closemessage
release
@ -257,7 +257,7 @@ BattleFrontier_BattlePikeRandomRoom1_EventScript_25D50E:: @ 825D50E
waitmessage
playfanfare BGM_ME_ASA
waitfanfare
special sp000_heal_pokemon
special HealPlayerParty
msgbox BattleFrontier_BattlePikeRandomRoom1_Text_25DA13, 4
closemessage
applymovement 1, BattleFrontier_BattlePikeRandomRoom1_Movement_25D798

View File

@ -90,7 +90,7 @@ BattleFrontier_BattlePyramidTop_EventScript_252B66:: @ 8252B66
special sub_81A8E7C
setvar VAR_0x8004, 14
special sub_81A8E7C
special sp000_heal_pokemon
special HealPlayerParty
warpsilent BATTLE_FRONTIER_BATTLE_PYRAMID_LOBBY, 255, 7, 13
waitstate
end

View File

@ -70,7 +70,7 @@ BattleFrontier_BattlePyramidLobby_EventScript_2507DA:: @ 82507DA
special copy_player_party_from_sav1
setvar VAR_0x8004, 14
special sub_81A8E7C
special sp000_heal_pokemon
special HealPlayerParty
message BattleFrontier_BattlePyramidLobby_Text_2519F8
waitmessage
playse SE_EXPMAX
@ -100,7 +100,7 @@ BattleFrontier_BattlePyramidLobby_EventScript_250852:: @ 8250852
special copy_player_party_from_sav1
setvar VAR_0x8004, 14
special sub_81A8E7C
special sp000_heal_pokemon
special HealPlayerParty
lockall
message BattleFrontier_BattlePyramidLobby_Text_251B5A
waitmessage
@ -218,7 +218,7 @@ BattleFrontier_BattlePyramidLobby_EventScript_250A21:: @ 8250A21
setvar VAR_0x8006, 0
special sub_81A1780
setvar VAR_RESULT, 0
special sp000_heal_pokemon
special HealPlayerParty
warp BATTLE_FRONTIER_BATTLE_PYRAMID_EMPTY_SQUARE, 255, 1, 1
setvar VAR_0x4000, 0
waitstate

View File

@ -84,7 +84,7 @@ BattleFrontier_BattleTowerBattleRoom_EventScript_241C2F:: @ 8241C2F
msgbox BattleFrontier_BattleTowerBattleRoom_Text_242217, 4
playfanfare BGM_ME_ASA
waitfanfare
special sp000_heal_pokemon
special HealPlayerParty
BattleFrontier_BattleTowerBattleRoom_EventScript_241C8F:: @ 8241C8F
setvar VAR_0x8004, 9
@ -361,7 +361,7 @@ BattleFrontier_BattleTowerBattleRoom_EventScript_24210E:: @ 824210E
setvar VAR_0x8005, 6
setvar VAR_0x8006, 0
special sub_81A1780
special sp000_heal_pokemon
special HealPlayerParty
setvar VAR_0x8004, 0
setvar VAR_0x8005, 0
special sub_8163AC4
@ -371,7 +371,7 @@ BattleFrontier_BattleTowerBattleRoom_EventScript_24210E:: @ 824210E
goto_eq BattleFrontier_BattleTowerBattleRoom_EventScript_24215A
setvar VAR_0x8004, 18
special sub_81A1780
special sp000_heal_pokemon
special HealPlayerParty
setvar VAR_0x8004, 21
special sub_81A1780

View File

@ -161,7 +161,7 @@ BattleFrontier_BattleTowerBattleRoom2_EventScript_249121:: @ 8249121
call_if 1, BattleFrontier_BattleTowerBattleRoom2_EventScript_249514
playfanfare BGM_ME_ASA
waitfanfare
special sp000_heal_pokemon
special HealPlayerParty
BattleFrontier_BattleTowerBattleRoom2_EventScript_249143:: @ 8249143
setvar VAR_0x8004, 1

View File

@ -153,7 +153,7 @@ BattleFrontier_BattleTowerLobby_EventScript_23E84D:: @ 823E84D
setvar VAR_0x8004, 8
special sub_81A1780
special copy_player_party_from_sav1
special sp000_heal_pokemon
special HealPlayerParty
setvar VAR_0x8004, 6
setvar VAR_0x8005, 0
special sub_8161F74

View File

@ -68,7 +68,7 @@ BattleFrontier_BattleTowerMultiBattleRoom_EventScript_243E41:: @ 8243E41
applymovement 255, BattleFrontier_BattleTowerMultiBattleRoom_Movement_2725A6
waitmovement 0
msgbox BattleFrontier_BattleTowerMultiBattleRoom_Text_244056, 4
special sp000_heal_pokemon
special HealPlayerParty
setvar VAR_0x4001, 1
releaseall
end

View File

@ -110,7 +110,7 @@ FallarborTown_BattleTentBattleRoom_EventScript_2009B3:: @ 82009B3
special sub_81A1780
playfanfare BGM_ME_ASA
waitfanfare
special sp000_heal_pokemon
special HealPlayerParty
FallarborTown_BattleTentBattleRoom_EventScript_200A2A:: @ 8200A2A
setvar VAR_0x8004, 1

View File

@ -230,7 +230,7 @@ Route101_EventScript_1EBE16:: @ 81EBE16
applymovement 2, Route101_Movement_1EBE8D
waitmovement 0
msgbox Route101_Text_1EBF12, 4
special sp000_heal_pokemon
special HealPlayerParty
setflag FLAG_0x2D0
clearflag FLAG_0x2D1
setflag FLAG_0x2BC

View File

@ -54,7 +54,7 @@ SlateportCity_BattleTentBattleRoom_EventScript_2099BE:: @ 82099BE
msgbox 0x2021fc4, 4
waitmessage
closemessage
special sp000_heal_pokemon
special HealPlayerParty
setvar VAR_0x8004, 6
setvar VAR_0x8005, 0
special sub_8163AC4

View File

@ -65,7 +65,7 @@ SlateportCity_BattleTentCorridor_EventScript_208EEE:: @ 8208EEE
msgbox SlateportCity_BattleTentCorridor_Text_25A22D, 4
playfanfare BGM_ME_ASA
waitfanfare
special sp000_heal_pokemon
special HealPlayerParty
SlateportCity_BattleTentCorridor_EventScript_208F0D:: @ 8208F0D
setvar VAR_0x8004, 1

View File

@ -78,7 +78,7 @@ SlateportCity_OceanicMuseum_2F_EventScript_20BB00:: @ 820BB00
fadescreen 1
playfanfare BGM_ME_ASA
waitfanfare
special sp000_heal_pokemon
special HealPlayerParty
removeobject 1
setflag FLAG_0x384
compare_var_to_value VAR_0x40DA, 0

View File

@ -29,7 +29,7 @@ SootopolisCity_MysteryEventsHouse_B1F_EventScript_227E68:: @ 8227E68
compare_var_to_value VAR_RESULT, 2
call_if 1, SootopolisCity_MysteryEventsHouse_B1F_EventScript_227EE8
closemessage
special sp000_heal_pokemon
special HealPlayerParty
applymovement 255, SootopolisCity_MysteryEventsHouse_B1F_Movement_227EF9
waitmovement 0
special copy_player_party_from_sav1

View File

@ -97,7 +97,7 @@ TrainerHill_Entrance_EventScript_2681DA:: @ 82681DA
applymovement 255, TrainerHill_Entrance_Movement_268381
waitmovement 0
setvar VAR_0x40D6, 0
special sp000_heal_pokemon
special HealPlayerParty
releaseall
TrainerHill_Entrance_EventScript_2681EE:: @ 82681EE
@ -174,7 +174,7 @@ TrainerHill_Entrance_EventScript_2682C8:: @ 82682C8
special sp194_trainer_tower
setvar VAR_0x40D6, 1
setvar VAR_0x4005, 0
special sp000_heal_pokemon
special HealPlayerParty
msgbox TrainerHill_Entrance_Text_26862A, 4
setvar VAR_0x8004, 0
special sp194_trainer_tower

View File

@ -88,7 +88,7 @@ VerdanturfTown_BattleTentBattleRoom_EventScript_2023C8:: @ 82023C8
special sub_81A1780
playfanfare BGM_ME_ASA
waitfanfare
special sp000_heal_pokemon
special HealPlayerParty
VerdanturfTown_BattleTentBattleRoom_EventScript_20243C:: @ 820243C
setvar VAR_0x8004, 1

View File

@ -53,7 +53,7 @@ EventScript_2A4BAC:: @ 82A4BAC
EventScript_2A4BD0:: @ 82A4BD0
fadescreen 1
special sub_8135908
special OpenPokeblockCaseOnFeeder
waitstate
compare_var_to_value VAR_RESULT, 65535
goto_if 5, EventScript_2A4BE2

View File

@ -7,7 +7,7 @@
.set __special__, 0
.align 2
gSpecials:: @ 81DBA64
def_special sp000_heal_pokemon
def_special HealPlayerParty
def_special sub_809D2BC
def_special sub_80AF948
def_special sub_80AF9F8
@ -218,7 +218,7 @@ gSpecials:: @ 81DBA64
def_special EnterSafariMode
def_special ExitSafariMode
def_special GetPokeblockFeederInFront
def_special sub_8135908
def_special OpenPokeblockCaseOnFeeder
def_special sub_813793C
def_special sub_8137988
def_special sub_8137A0C

View File

@ -489,11 +489,12 @@ struct RecordMixingDayCareMail
bool16 holdsItem[DAYCARE_MON_COUNT];
};
#define MAP_OBJECTS_COUNT 16
#define BERRY_TREES_COUNT 128
#define FLAGS_COUNT 300
#define VARS_COUNT 256
#define MAIL_COUNT 16
#define POKEBLOCKS_COUNT 40
#define MAP_OBJECTS_COUNT 16
#define BERRY_TREES_COUNT 128
#define FLAGS_COUNT 300
#define VARS_COUNT 256
#define MAIL_COUNT 16
enum
{
@ -586,7 +587,7 @@ struct SaveBlock1
/*0x650*/ struct ItemSlot bagPocket_PokeBalls[16];
/*0x690*/ struct ItemSlot bagPocket_TMHM[64];
/*0x790*/ struct ItemSlot bagPocket_Berries[46];
/*0x848*/ struct Pokeblock pokeblocks[40];
/*0x848*/ struct Pokeblock pokeblocks[POKEBLOCKS_COUNT];
/*0x988*/ u8 seen1[52];
/*0x9BC*/ u16 berryBlenderRecords[3];
/*0x9C2*/ u8 field_9C2[6];

View File

@ -1,14 +1,17 @@
#ifndef GUARD_LIST_MENU_H
#define GUARD_LIST_MENU_H
#define LIST_NOTHING_CHOSEN -1
#define LIST_B_PRESSED -2
// Exported type declarations
// Exported RAM declarations
struct ListMenuItem
{
const u8 *unk_00;
s32 unk_04;
const u8 *name;
s32 id;
};
struct ListMenu;
@ -16,7 +19,7 @@ struct ListMenu;
struct ListMenuTemplate
{
const struct ListMenuItem *items;
void (* unk_04)(u32, bool8, struct ListMenu *);
void (* moveCursorFunc)(u32, bool8, struct ListMenu *);
void (* unk_08)(u8, s32, u8);
u16 totalItems;
u16 maxShowed;
@ -32,9 +35,11 @@ struct ListMenuTemplate
u32 spaceBetweenItems:6; // x20000, x40000, x80000, x100000, x200000, x400000 = x7E0000
u32 unk_16_7:1; // x800000
u32 unk_17_0:6; // x1000000, x2000000, x4000000, x8000000, x10000000, x20000000 = x3F000000
u32 cursorKind:2; // x40000000, x80000000
};
struct ListMenu {
struct ListMenu
{
struct ListMenuTemplate _template;
u16 scrollOffset;
u16 selectedRow;
@ -44,13 +49,13 @@ struct ListMenu {
u8 unk_1F;
};
extern struct ListMenuTemplate gUnknown_03006310;
extern struct ListMenuTemplate gMultiuseListMenuTemplate;
// Exported ROM declarations
u8 ListMenuInit(struct ListMenuTemplate *template, u16 a1, u16 a2);
s32 ListMenuHandleInput(u8 id);
void get_coro_args_x18_x1A(u8 a0, u16 *a1, u16 *a2);
void sub_81AE6C8(u8 a0, u16 *a1, u16 *a2);
u8 ListMenuInit(struct ListMenuTemplate *template, u16 cursorPage, u16 cursorPosition);
s32 ListMenuHandleInputGetItemId(u8 listTaskId);
void sub_81AE860(u8 listTaskId, u16 *a1, u16 *a2);
void sub_81AE6C8(u8 listTaskId, u16 *a1, u16 *a2);
#endif //GUARD_LIST_MENU_H

View File

@ -32,7 +32,7 @@ void CreateYesNoMenu(const struct WindowTemplate *windowTemplate, u16 borderFirs
s8 sub_8198C58(void);
void do_scheduled_bg_tilemap_copies_to_vram(void);
void clear_scheduled_bg_copies_to_vram(void);
void AddTextPrinterParametrized2(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, struct TextColor *color, s8 speed, const u8 *str);
void AddTextPrinterParametrized2(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, const struct TextColor *color, s8 speed, const u8 *str);
void sub_8197B1C(u8 windowId, bool8 copyToVram, u16 a2, u16 a3);
#endif // GUARD_MENU_H

View File

@ -3,7 +3,8 @@
// Exported type declarations
struct YesNoFuncTable {
struct YesNoFuncTable
{
TaskFunc yesFunc;
TaskFunc noFunc;
};
@ -20,5 +21,9 @@ void ResetVramOamAndBgCntRegs(void);
void SetVBlankHBlankCallbacksToNull(void);
void ResetAllBgsCoordinates(void);
bool16 RunTextPrintersRetIsActive(u8 textPrinterId);
void sub_8122344(void *arg0, u8 arg1);
void LoadListMenuArrowsGfx(void);
void sub_81223FC(u8 *a0, u8 count, u8 a2);
void sub_8122448(u8 *a0, u8 count, u16 x, u16 y);
#endif //GUARD_MENU_HELPERS_H

View File

@ -25,6 +25,14 @@ enum
PBLOCK_FEEL,
};
enum
{
PBLOCK_CASE_FIELD,
PBLOCK_CASE_BATTLE,
PBLOCK_CASE_FEEDER,
PBLOCK_CASE_GIVE
};
// use pokeblock
extern u8 gPokeblockMonId;
extern s16 gPokeblockGain;
@ -40,8 +48,13 @@ extern const u8 *const gPokeblockNames[];
extern const struct CompressedSpriteSheet gPokeblockCase_SpriteSheet;
extern const struct CompressedSpritePalette gPokeblockCase_SpritePal;
void OpenPokeblockCase(u8 caseId, void (*callback)(void));
void OpenPokeblockCaseInBattle(void);
void OpenPokeblockCaseOnFeeder(void);
void ResetPokeblockScrollPositions(void);
u8 CreatePokeblockCaseSprite(s16 x, s16 y, u8 subpriority);
u8 GetPokeblockData(const struct Pokeblock *pokeblock, u8 dataId);
s16 GetPokeblockData(const struct Pokeblock *pokeblock, u8 dataId);
void ClearPokeblocks(void);
s8 GetFirstFreePokeblockSlot(void);
bool32 AddPokeblock(struct Pokeblock *pokeblock);

View File

@ -18,6 +18,15 @@ extern const u8 gText_Tough[];
extern const u8 gText_Single[];
extern const u8 gText_Double[];
extern const u8 gText_Spicy[];
extern const u8 gText_Dry[];
extern const u8 gText_Sweet[];
extern const u8 gText_Bitter[];
extern const u8 gText_Sour[];
extern const u8 gText_StowCase[];
extern const u8 gText_LvVar1[];
extern const u8 gText_Spicy2[];
extern const u8 gText_Dry2[];
extern const u8 gText_Sweet2[];

View File

@ -19,6 +19,7 @@
#include "reshow_battle_screen.h"
#include "pokeball.h"
#include "data2.h"
#include "pokeblock.h"
extern u32 gBattleExecBuffer;
extern u8 gActiveBank;
@ -291,13 +292,13 @@ static void CompleteOnSpecialAnimDone(void)
SafariBufferExecCompleted();
}
static void OpenPokeblockCase(void)
static void SafariOpenPokeblockCase(void)
{
if (!gPaletteFade.active)
{
gBattleBankFunc[gActiveBank] = CompleteWhenChosePokeblock;
FreeAllWindowBuffers();
sub_81358F4();
OpenPokeblockCaseInBattle();
}
}
@ -497,7 +498,7 @@ static void SafariHandleChooseItem(void)
s32 i;
BeginNormalPaletteFade(-1, 0, 0, 0x10, 0);
gBattleBankFunc[gActiveBank] = OpenPokeblockCase;
gBattleBankFunc[gActiveBank] = SafariOpenPokeblockCase;
gBankInMenu = gActiveBank;
}

View File

@ -40,7 +40,7 @@ extern const u8 gDaycareText_PlayOther[];
extern u8 GetCursorSelectionMonId(void);
extern u16 ItemIdToBattleMoveId(u16);
extern s32 ListMenuHandleInput(u8);
extern s32 ListMenuHandleInputGetItemId(u8);
extern void sub_81AE6C8(u8, u16*, u16*);
extern void sub_819746C(u8, bool8);
extern void sub_81973FC(u8, bool8);
@ -75,7 +75,7 @@ static const struct ListMenuItem sLevelMenuItems[] =
static const struct ListMenuTemplate sDaycareListMenuLevelTemplate =
{
.items = sLevelMenuItems,
.unk_04 = sub_81AF078,
.moveCursorFunc = sub_81AF078,
.unk_08 = DaycarePrintMonInfo,
.totalItems = 3,
.maxShowed = 3,
@ -90,7 +90,8 @@ static const struct ListMenuTemplate sDaycareListMenuLevelTemplate =
.unk_16_0 = TRUE,
.spaceBetweenItems = 0,
.unk_16_7 = FALSE,
.unk_17_0 = 1
.unk_17_0 = 1,
.cursorKind = 0
};
static const u8 *const sCompatibilityMessages[] =
@ -1256,7 +1257,7 @@ static void DaycarePrintMonInfo(u8 windowId, s32 daycareSlotId, u8 y)
static void Task_HandleDaycareLevelMenuInput(u8 taskId)
{
u32 var = ListMenuHandleInput(gTasks[taskId].tMenuListTaskId);
u32 var = ListMenuHandleInputGetItemId(gTasks[taskId].tMenuListTaskId);
if (gMain.newKeys & A_BUTTON)
{

View File

@ -791,17 +791,17 @@ void sub_8127330(u8 taskId)
for (i = 0; i < sDecorPCBuffer->unk_520 - 1; i ++)
{
sub_8127454(sDecorPCBuffer->names[i], gCurDecorInventoryItems[i]);
sDecorPCBuffer->items[i].unk_00 = sDecorPCBuffer->names[i];
sDecorPCBuffer->items[i].unk_04 = i;
sDecorPCBuffer->items[i].name = sDecorPCBuffer->names[i];
sDecorPCBuffer->items[i].id = i;
}
StringCopy(sDecorPCBuffer->names[i], gText_Cancel);
sDecorPCBuffer->items[i].unk_00 = sDecorPCBuffer->names[i];
sDecorPCBuffer->items[i].unk_04 = -2;
gUnknown_03006310 = gUnknown_085A6BD0;
gUnknown_03006310.unk_10 = sDecorMenuWindowIndices[1];
gUnknown_03006310.totalItems = sDecorPCBuffer->unk_520;
gUnknown_03006310.items = sDecorPCBuffer->items;
gUnknown_03006310.maxShowed = sDecorPCBuffer->unk_521;
sDecorPCBuffer->items[i].name = sDecorPCBuffer->names[i];
sDecorPCBuffer->items[i].id = -2;
gMultiuseListMenuTemplate = gUnknown_085A6BD0;
gMultiuseListMenuTemplate.unk_10 = sDecorMenuWindowIndices[1];
gMultiuseListMenuTemplate.totalItems = sDecorPCBuffer->unk_520;
gMultiuseListMenuTemplate.items = sDecorPCBuffer->items;
gMultiuseListMenuTemplate.maxShowed = sDecorPCBuffer->unk_521;
}
void sub_8127454(u8 *dest, u16 decorId)
@ -870,7 +870,7 @@ void sub_812759C(u8 taskId)
sub_81272C8();
sub_81272F8();
sub_8127330(taskId);
data[13] = ListMenuInit(&gUnknown_03006310, sSecretBasePCSelectDecorPageNo, sSecretBasePCSelectDecorLineNo);
data[13] = ListMenuInit(&gMultiuseListMenuTemplate, sSecretBasePCSelectDecorPageNo, sSecretBasePCSelectDecorLineNo);
sub_8127500();
}
@ -888,8 +888,8 @@ void sub_812764C(u8 taskId)
data = gTasks[taskId].data;
if (!gPaletteFade.active)
{
input = ListMenuHandleInput(data[13]);
get_coro_args_x18_x1A(data[13], &sSecretBasePCSelectDecorPageNo, &sSecretBasePCSelectDecorLineNo);
input = ListMenuHandleInputGetItemId(data[13]);
sub_81AE860(data[13], &sSecretBasePCSelectDecorPageNo, &sSecretBasePCSelectDecorLineNo);
switch (input)
{
case -1:

View File

@ -33,7 +33,6 @@ extern void Overworld_SetWarpDestination(s8 mapBank, s8 mapNo, s8 warpNo, s8 xPo
extern void warp_in(void);
extern void sub_80BB358(void);
extern void ResetBagScrollPositions(void);
extern void sub_813624C(void); // clears something pokeblock related
extern void ResetPokedex(void);
extern void sub_8084400(void);
extern void ClearMailData(void);
@ -148,7 +147,7 @@ void sub_808447C(void)
ZeroPlayerPartyMons();
ZeroEnemyPartyMons();
ResetBagScrollPositions();
sub_813624C();
ResetPokeblockScrollPositions();
}
void NewGameInitData(void)

View File

@ -8,6 +8,59 @@
#include "menu_helpers.h"
#include "pokemon.h"
#include "graphics.h"
#include "malloc.h"
#include "main.h"
#include "battle.h"
#include "battle_controllers.h"
#include "palette.h"
#include "unknown_task.h"
#include "list_menu.h"
#include "gpu_regs.h"
#include "decompress.h"
#include "international_string_util.h"
#include "item.h"
#include "items.h"
#include "string_util.h"
#include "songs.h"
#include "sound.h"
#include "berry.h"
#include "menu_indicators.h"
#include "event_data.h"
#define FIELD_E75_COUNT 7
struct PokeblockMenuStruct
{
u8 tilemap[0x800];
void (*debugCallback)(void);
const u8 *pokeblockOptions;
u8 optionsNo;
u8 caseId;
u8 itemsNo;
u8 maxShowed;
struct ListMenuItem items[POKEBLOCKS_COUNT + 1];
u8 menuItemsStrings[POKEBLOCKS_COUNT + 1][0x20]; // + 1 because of STOW CASE item
u8 pokeblockCaseSpriteId;
u8 field_E75[FIELD_E75_COUNT];
u8 unkTaskId;
bool8 isSwapping;
s16 gfxState;
u8 field_E80;
u8 field_E81;
u8 field_E82;
u8 field_E83;
u8 field_E84;
u8 field_E85;
u8 field_E86;
u8 field_E87;
};
struct PokeblockSavedData
{
void (*callback)(void);
u16 lastItemPos;
u16 lastItemPage;
};
enum
{
@ -19,7 +72,33 @@ enum
PKBL_GIVE_TO_LADY
};
extern u16 gSpecialVar_ItemId;
extern void (*gFieldCallback)(void);
extern const u16 gUnknown_0860F074[];
extern void c2_exit_to_overworld_2_switch(void);
extern bool8 sub_81221EC(void);
extern void sub_809882C(u8, u16, u8);
extern void copy_textbox_border_tile_patterns_to_vram(u8, u16, u8);
extern void sub_80AF168(void);
// this file's functions
void CB2_InitPokeblockMenu(void);
bool8 InitPokeblockMenu(void);
static bool8 LoadPokeblockMenuGfx(void);
static void HandleInitBackgrounds(void);
static void HandleInitWindows(void);
void SetMenuItemsCountAndMaxShowed(void);
void sub_81362E0(void);
void sub_8136344(void);
void HandlePokeblockListMenuItems(void);
void sub_81363BC(void);
static void MovePokeblockMenuCursor(u32 pkblId, bool8 arg1, struct ListMenu *arg2);
static void PutPokeblockInfoText(void);
void HandlePokeblockMenuCursor(u16 cursorPos, u16 arg1);
static void PutPokeblockListMenuString(u8 *dst, u16 pkblId);
void Task_HandlePokeblockMenuInput(u8 taskId);
void PokeblockAction_UseOnField(u8 taskId);
void PokeblockAction_Toss(u8 taskId);
void PokeblockAction_Cancel(u8 taskId);
@ -28,6 +107,16 @@ void PokeblockAction_UseOnPokeblockFeeder(u8 taskId);
void PokeblockAction_GiveToContestLady(u8 taskId);
void TossPokeblockChoice_Yes(u8 taskId);
void TossPokeblockChoice_No(u8 taskId);
void Task_FreeDataAndExitPokeblockCase(u8 taskId);
void PutPokeblockOptionsWindow(u8 taskId);
static void Task_HandlePokeblocksSwapInput(u8 taskId);
static void sub_8136470(struct Sprite *sprite);
static void sub_8135FCC(s32 pkblId);
void HandlePokeblocksSwap(u8 taskId, bool8 noSwap);
// ram variables
EWRAM_DATA struct PokeblockSavedData sSavedPokeblockData = {0};
EWRAM_DATA struct PokeblockMenuStruct *sPokeblockMenu = NULL;
// const rom data
const s8 gPokeblockFlavorCompatibilityTable[] =
@ -60,7 +149,7 @@ const s8 gPokeblockFlavorCompatibilityTable[] =
0, 0, 0, 0, 0 // Quirky
};
const struct BgTemplate gUnknown_085B2620[] =
static const struct BgTemplate sBgTemplatesForPokeblockMenu[] =
{
{
.bg = 0,
@ -181,7 +270,7 @@ const struct CompressedSpritePalette gPokeblockCase_SpritePal =
gMenuPokeblockDevice_Pal, GFX_TAG_POKEBLOCK_CASE
};
const struct SpriteTemplate sSpriteTemplate_PokeblockCase =
static const struct SpriteTemplate sSpriteTemplate_PokeblockCase =
{
GFX_TAG_POKEBLOCK_CASE,
GFX_TAG_POKEBLOCK_CASE,
@ -202,3 +291,727 @@ const struct Pokeblock sFavoritePokeblocksTable[] =
{ PBLOCK_CLR_GREEN, 0, 0, 0, 20, 0, 20},
{ PBLOCK_CLR_YELLOW, 0, 0, 0, 0, 20, 20}
};
static const struct WindowTemplate sWindowTemplatesForPokeblockMenu[] =
{
{0, 2, 1, 9, 2, 0xF, 0x1E},
{0, 0xF, 1, 0xE, 0x12, 0xF, 0x30},
{0, 2, 0xD, 5, 2, 0xF, 0x12C},
{0, 2, 0xF, 5, 2, 0xF, 0x136},
{0, 2, 0x11, 5, 2, 0xF, 0x140},
{0, 8, 0xD, 5, 2, 0xF, 0x14A},
{0, 8, 0xF, 5, 2, 0xF, 0x154},
{0, 0xB, 0x11, 2, 2, 0xF, 0x15E},
{1, 7, 5, 6, 6, 0xF, 0x162},
{1, 7, 7, 6, 4, 0xF, 0x186},
{1, 2, 0xF, 0x1B, 4, 0xF, 0x19E},
DUMMY_WIN_TEMPLATE
};
const struct WindowTemplate gUnknown_085B27A8[] = {1, 0x15, 9, 5, 4, 0xF, 0x20A};
static const struct ListMenuTemplate sPokeblockListMenuTemplate =
{
.items = NULL,
.moveCursorFunc = MovePokeblockMenuCursor,
.unk_08 = NULL,
.totalItems = 0,
.maxShowed = 0,
.unk_10 = 1,
.unk_11 = 0,
.unk_12 = 1,
.cursor_Y = 0,
.upText_Y = 1,
.cursorColor = 2,
.fillColor = 0,
.cursorShadowColor = 3,
.unk_16_0 = FALSE,
.spaceBetweenItems = 32,
.unk_16_7 = FALSE,
.unk_17_0 = 1,
.cursorKind = 1
};
// code
void OpenPokeblockCase(u8 caseId, void (*callback)(void))
{
sPokeblockMenu = Alloc(sizeof(*sPokeblockMenu));
sPokeblockMenu->caseId = caseId;
sPokeblockMenu->debugCallback = NULL;
sPokeblockMenu->unkTaskId = 0xFF;
sPokeblockMenu->isSwapping = FALSE;
sSavedPokeblockData.callback = callback;
switch (sPokeblockMenu->caseId)
{
case PBLOCK_CASE_BATTLE:
sPokeblockMenu->pokeblockOptions = sActionsInBattle;
sPokeblockMenu->optionsNo = ARRAY_COUNT(sActionsInBattle);
break;
case PBLOCK_CASE_FEEDER:
sPokeblockMenu->pokeblockOptions = sActionsOnPokeblockFeeder;
sPokeblockMenu->optionsNo = ARRAY_COUNT(sActionsOnPokeblockFeeder);
break;
case PBLOCK_CASE_GIVE:
sPokeblockMenu->pokeblockOptions = sActionsWhenGivingToLady;
sPokeblockMenu->optionsNo = ARRAY_COUNT(sActionsWhenGivingToLady);
break;
default:
sPokeblockMenu->pokeblockOptions = sActionsOnField;
sPokeblockMenu->optionsNo = ARRAY_COUNT(sActionsOnField);
break;
}
SetMainCallback2(CB2_InitPokeblockMenu);
}
void OpenPokeblockCaseInBattle(void)
{
OpenPokeblockCase(PBLOCK_CASE_BATTLE, SetCB2ToReshowScreenAfterMenu2);
}
void OpenPokeblockCaseOnFeeder(void)
{
OpenPokeblockCase(PBLOCK_CASE_FEEDER, c2_exit_to_overworld_2_switch);
}
static void CB2_PokeblockMenu(void)
{
RunTasks();
AnimateSprites();
BuildOamBuffer();
do_scheduled_bg_tilemap_copies_to_vram();
UpdatePaletteFade();
}
static void VBlankCB_PokeblockMenu(void)
{
LoadOam();
ProcessSpriteCopyRequests();
TransferPlttBuffer();
}
void CB2_InitPokeblockMenu(void)
{
while (1)
{
if (sub_81221EC() == TRUE)
break;
if (InitPokeblockMenu() == TRUE)
break;
if (sub_81221AC() == TRUE)
break;
}
}
bool8 InitPokeblockMenu(void)
{
u8 taskId;
switch (gMain.state)
{
case 0:
SetVBlankHBlankCallbacksToNull();
clear_scheduled_bg_copies_to_vram();
gMain.state++;
break;
case 1:
remove_some_task();
gMain.state++;
break;
case 2:
FreeAllSpritePalettes();
gMain.state++;
break;
case 3:
ResetPaletteFade();
gPaletteFade.bufferTransferDisabled = 1;
gMain.state++;
break;
case 4:
ResetSpriteData();
gMain.state++;
break;
case 5:
if (sPokeblockMenu->caseId != PBLOCK_CASE_BATTLE)
ResetTasks();
gMain.state++;
break;
case 6:
HandleInitBackgrounds();
sPokeblockMenu->gfxState = 0;
gMain.state++;
break;
case 7:
if (!LoadPokeblockMenuGfx())
return FALSE;
gMain.state++;
break;
case 8:
SetMenuItemsCountAndMaxShowed();
sub_81362E0();
sub_8136344();
gMain.state++;
break;
case 9:
sPokeblockMenu->pokeblockCaseSpriteId = CreatePokeblockCaseSprite(56, 64, 0);
gMain.state++;
break;
case 10:
sub_8122344(&sPokeblockMenu->field_E75, FIELD_E75_COUNT);
gMain.state++;
break;
case 11:
HandlePokeblockMenuCursor(sSavedPokeblockData.lastItemPos, 0x1005);
gMain.state++;
break;
case 12:
HandleInitWindows();
gMain.state++;
break;
case 13:
HandlePokeblockListMenuItems();
gMain.state++;
break;
case 14:
sub_81363BC();
gMain.state++;
break;
case 15:
taskId = CreateTask(Task_HandlePokeblockMenuInput, 0);
gTasks[taskId].data[0] = ListMenuInit(&gMultiuseListMenuTemplate, sSavedPokeblockData.lastItemPage, sSavedPokeblockData.lastItemPos);
gMain.state++;
break;
case 16:
PutPokeblockInfoText();
gMain.state++;
break;
case 17:
BlendPalettes(-1, 0x10, 0);
gMain.state++;
break;
case 18:
BeginNormalPaletteFade(-1, 0, 0x10, 0, 0);
gPaletteFade.bufferTransferDisabled = 0;
gMain.state++;
break;
default:
SetVBlankCallback(VBlankCB_PokeblockMenu);
SetMainCallback2(CB2_PokeblockMenu);
return TRUE;
}
return FALSE;
}
static void HandleInitBackgrounds(void)
{
ResetVramOamAndBgCntRegs();
ResetBgsAndClearDma3BusyFlags(0);
InitBgsFromTemplates(0, sBgTemplatesForPokeblockMenu, ARRAY_COUNT(sBgTemplatesForPokeblockMenu));
SetBgTilemapBuffer(2, sPokeblockMenu->tilemap);
ResetAllBgsCoordinates();
schedule_bg_copy_tilemap_to_vram(2);
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP);
ShowBg(0);
ShowBg(1);
ShowBg(2);
SetGpuReg(REG_OFFSET_BLDCNT, 0);
}
static bool8 LoadPokeblockMenuGfx(void)
{
switch (sPokeblockMenu->gfxState)
{
case 0:
reset_temp_tile_data_buffers();
decompress_and_copy_tile_data_to_vram(2, gMenuPokeblock_Gfx, 0, 0, 0);
sPokeblockMenu->gfxState++;
break;
case 1:
if (free_temp_tile_data_buffers_if_possible() != TRUE)
{
LZDecompressWram(gMenuPokeblock_Tilemap, sPokeblockMenu->tilemap);
sPokeblockMenu->gfxState++;
}
break;
case 2:
LoadCompressedPalette(gMenuPokeblock_Pal, 0, 0xC0);
sPokeblockMenu->gfxState++;
break;
case 3:
LoadCompressedObjectPic(&gPokeblockCase_SpriteSheet);
sPokeblockMenu->gfxState++;
break;
case 4:
LoadCompressedObjectPalette(&gPokeblockCase_SpritePal);
sPokeblockMenu->gfxState++;
break;
case 5:
LoadListMenuArrowsGfx();
sPokeblockMenu->gfxState = 0;
return TRUE;
}
return FALSE;
}
static void HandleInitWindows(void)
{
u8 i;
InitWindows(sWindowTemplatesForPokeblockMenu);
DeactivateAllTextPrinters();
sub_809882C(0, 1, 0xE0);
copy_textbox_border_tile_patterns_to_vram(0, 0xA, 0xD0);
LoadPalette(gUnknown_0860F074, 0xF0, 0x20);
for (i = 0; i < ARRAY_COUNT(sWindowTemplatesForPokeblockMenu) - 1; i++)
{
FillWindowPixelBuffer(i, 0);
}
schedule_bg_copy_tilemap_to_vram(0);
schedule_bg_copy_tilemap_to_vram(1);
}
void PrintOnPokeblockWindow(u8 windowId, const u8 *string, s32 x)
{
AddTextPrinterParametrized2(windowId, 1, x, 1, 0, 0, &sTextColorInPokeblockMenu, 0, string);
}
static void PutPokeblockInfoText(void)
{
u8 i;
const u8 *itemName = ItemId_GetItem(ITEM_POKEBLOCK_CASE)->name;
PrintOnPokeblockWindow(0, itemName, GetStringCenterAlignXOffset(1, itemName, 0x48));
PrintOnPokeblockWindow(2, gText_Spicy, 0);
PrintOnPokeblockWindow(3, gText_Dry, 0);
PrintOnPokeblockWindow(4, gText_Sweet, 0);
PrintOnPokeblockWindow(5, gText_Bitter, 0);
PrintOnPokeblockWindow(6, gText_Sour, 0);
for (i = 0; i < 8; i++)
{
PutWindowTilemap(i);
}
}
void HandlePokeblockListMenuItems(void)
{
u16 i;
for (i = 0; i < sPokeblockMenu->itemsNo - 1; i++)
{
PutPokeblockListMenuString(sPokeblockMenu->menuItemsStrings[i], i);
sPokeblockMenu->items[i].name = sPokeblockMenu->menuItemsStrings[i];
sPokeblockMenu->items[i].id = i;
}
StringCopy(sPokeblockMenu->menuItemsStrings[i], gText_StowCase);
sPokeblockMenu->items[i].name = sPokeblockMenu->menuItemsStrings[i];
sPokeblockMenu->items[i].id = LIST_B_PRESSED;
gMultiuseListMenuTemplate = sPokeblockListMenuTemplate;
gMultiuseListMenuTemplate.unk_17_0 = 7;
gMultiuseListMenuTemplate.totalItems = sPokeblockMenu->itemsNo;
gMultiuseListMenuTemplate.items = sPokeblockMenu->items;
gMultiuseListMenuTemplate.maxShowed = sPokeblockMenu->maxShowed;
}
static void PutPokeblockListMenuString(u8 *dst, u16 pkblId)
{
struct Pokeblock *pkblock = &gSaveBlock1Ptr->pokeblocks[pkblId];
u8 *txtPtr = StringCopy(dst, gPokeblockNames[pkblock->color]);
*(txtPtr++) = EXT_CTRL_CODE_BEGIN;
*(txtPtr++) = 0x12;
*(txtPtr++) = 0x57;
ConvertIntToDecimalStringN(gStringVar1, GetHighestPokeblocksFlavorLevel(pkblock), STR_CONV_MODE_LEFT_ALIGN, 3);
StringExpandPlaceholders(txtPtr, gText_LvVar1);
}
static void MovePokeblockMenuCursor(u32 pkblId, bool8 arg1, struct ListMenu *arg2)
{
if (arg1 != TRUE)
{
PlaySE(SE_SELECT);
gSprites[sPokeblockMenu->pokeblockCaseSpriteId].callback = sub_8136470;
}
if (!sPokeblockMenu->isSwapping)
sub_8135FCC(pkblId);
}
static void sub_8135FCC(s32 pkblId)
{
u8 i;
struct Pokeblock *pokeblock;
u16 rectTilemapSrc[2];
FillWindowPixelBuffer(7, 0);
if (pkblId != LIST_B_PRESSED)
{
pokeblock = &gSaveBlock1Ptr->pokeblocks[pkblId];
rectTilemapSrc[0] = 0x17;
rectTilemapSrc[1] = 0x18;
for (i = 0; i < FLAVOR_COUNT; i++)
{
if (GetPokeblockData(pokeblock, PBLOCK_SPICY + i) > 0)
{
rectTilemapSrc[0] = (i << 0xC) + 0x17;
rectTilemapSrc[1] = (i << 0xC) + 0x18;
}
else
{
rectTilemapSrc[0] = 0xF;
rectTilemapSrc[1] = 0xF;
}
CopyToBgTilemapBufferRect(2, rectTilemapSrc, (i / 3 * 6) + 1, (i % 3 * 2) + 13, 1, 2);
}
ConvertIntToDecimalStringN(gStringVar1, GetPokeblocksFeel(pokeblock), STR_CONV_MODE_RIGHT_ALIGN, 2);
PrintOnPokeblockWindow(7, gStringVar1, 4);
}
else
{
rectTilemapSrc[0] = 0xF;
rectTilemapSrc[1] = 0xF;
for (i = 0; i < FLAVOR_COUNT; i++)
{
CopyToBgTilemapBufferRect(2, rectTilemapSrc, (i / 3 * 6) + 1, (i % 3 * 2) + 13, 1, 2);
}
CopyWindowToVram(7, 2);
}
schedule_bg_copy_tilemap_to_vram(0);
schedule_bg_copy_tilemap_to_vram(2);
}
void HandlePokeblockMenuCursor(u16 cursorPos, u16 arg1)
{
FillBgTilemapBufferRect_Palette0(2, arg1, 0xF, (cursorPos * 2) + 1, 0xE, 2);
schedule_bg_copy_tilemap_to_vram(2);
}
void CompactPokeblockSlots(void)
{
u16 i, j;
for (i = 0; i < POKEBLOCKS_COUNT - 1; i++)
{
for (j = i + 1; j < POKEBLOCKS_COUNT; j++)
{
if (gSaveBlock1Ptr->pokeblocks[i].color == 0)
{
struct Pokeblock temp = gSaveBlock1Ptr->pokeblocks[i];
gSaveBlock1Ptr->pokeblocks[i] = gSaveBlock1Ptr->pokeblocks[j];
gSaveBlock1Ptr->pokeblocks[j] = temp;
}
}
}
}
void SwapSortPokeblocksInternalData(u32 id1, u32 id2)
{
s16 i, count;
struct Pokeblock *pokeblocks = gSaveBlock1Ptr->pokeblocks;
struct Pokeblock *copyPokeblock1;
if (id1 == id2)
return;
copyPokeblock1 = Alloc(sizeof(struct Pokeblock));
*copyPokeblock1 = pokeblocks[id1];
if (id2 > id1)
{
id2--;
for (count = id2, i = id1; i < count; i++)
pokeblocks[i] = pokeblocks[i + 1];
}
else
{
for (count = id2, i = id1; i > count; i--)
pokeblocks[i] = pokeblocks[i - 1];
}
pokeblocks[id2] = *copyPokeblock1;
Free(copyPokeblock1);
}
void ResetPokeblockScrollPositions(void)
{
sSavedPokeblockData.lastItemPos = 0;
sSavedPokeblockData.lastItemPage = 0;
}
void SetMenuItemsCountAndMaxShowed(void)
{
u16 i;
CompactPokeblockSlots();
for (sPokeblockMenu->itemsNo = 0, i = 0; i < POKEBLOCKS_COUNT; i++)
{
if (gSaveBlock1Ptr->pokeblocks[i].color != 0)
sPokeblockMenu->itemsNo++;
}
sPokeblockMenu->itemsNo++; // STOW CASE menu item
if (sPokeblockMenu->itemsNo > 9)
sPokeblockMenu->maxShowed = 9;
else
sPokeblockMenu->maxShowed = sPokeblockMenu->itemsNo;
}
void sub_81362E0(void)
{
if (sSavedPokeblockData.lastItemPage != 0)
{
if (sSavedPokeblockData.lastItemPage + sPokeblockMenu->maxShowed > sPokeblockMenu->itemsNo)
sSavedPokeblockData.lastItemPage = sPokeblockMenu->itemsNo - sPokeblockMenu->maxShowed;
}
if (sSavedPokeblockData.lastItemPage + sSavedPokeblockData.lastItemPos >= sPokeblockMenu->itemsNo)
{
if (sPokeblockMenu->itemsNo == 0)
sSavedPokeblockData.lastItemPos = 0;
else
sSavedPokeblockData.lastItemPos = sPokeblockMenu->itemsNo - 1;
}
}
void sub_8136344(void)
{
if (sSavedPokeblockData.lastItemPos > 4)
{
u8 i;
for (i = 0;
i < sSavedPokeblockData.lastItemPos - 4 && sSavedPokeblockData.lastItemPage + sPokeblockMenu->maxShowed != sPokeblockMenu->itemsNo;
sSavedPokeblockData.lastItemPos--, sSavedPokeblockData.lastItemPage++, i++);
}
}
void sub_81363BC(void)
{
if (sPokeblockMenu->unkTaskId == 0xFF)
{
sPokeblockMenu->unkTaskId = AddScrollIndicatorArrowPairParametrized(2, 0xB0, 8, 0x98, sPokeblockMenu->itemsNo - sPokeblockMenu->maxShowed,
0x456, 0x456, &sSavedPokeblockData.lastItemPage);
}
}
void sub_8136418(void)
{
if (sPokeblockMenu->unkTaskId != 0xFF)
{
RemoveScrollIndicatorArrowPair(sPokeblockMenu->unkTaskId);
sPokeblockMenu->unkTaskId = 0xFF;
}
}
u8 CreatePokeblockCaseSprite(s16 x, s16 y, u8 subpriority)
{
return CreateSprite(&sSpriteTemplate_PokeblockCase, x, y, subpriority);
}
static void sub_8136470(struct Sprite *sprite)
{
if (sprite->data[0] > 1)
sprite->data[0] = 0;
switch (sprite->data[0])
{
case 0:
sprite->oam.affineMode = 1;
sprite->affineAnims = sSpriteAffineAnimTable_85B26F0;
InitSpriteAffineAnim(sprite);
sprite->data[0] = 1;
sprite->data[1] = 0;
break;
case 1:
if (++sprite->data[1] > 11)
{
sprite->oam.affineMode = 0;
sprite->data[0] = 0;
sprite->data[1] = 0;
FreeOamMatrix(sprite->oam.matrixNum);
sprite->callback = SpriteCallbackDummy;
}
break;
}
}
void FadePaletteAndSetTaskToClosePokeblockCase(u8 taskId)
{
BeginNormalPaletteFade(-1, 0, 0, 0x10, 0);
gTasks[taskId].func = Task_FreeDataAndExitPokeblockCase;
}
void Task_FreeDataAndExitPokeblockCase(u8 taskId)
{
s16 *data = gTasks[taskId].data;
if (!gPaletteFade.active)
{
if (sPokeblockMenu->caseId == PBLOCK_CASE_FEEDER || sPokeblockMenu->caseId == PBLOCK_CASE_GIVE)
gFieldCallback = sub_80AF168;
sub_81AE6C8(data[0], &sSavedPokeblockData.lastItemPage, &sSavedPokeblockData.lastItemPos);
sub_8136418();
ResetSpriteData();
FreeAllSpritePalettes();
if (sPokeblockMenu->debugCallback != NULL)
SetMainCallback2(sPokeblockMenu->debugCallback);
else
SetMainCallback2(sSavedPokeblockData.callback);
FreeAllWindowBuffers();
Free(sPokeblockMenu);
DestroyTask(taskId);
}
}
void Task_HandlePokeblockMenuInput(u8 taskId)
{
s16 *data = gTasks[taskId].data;
if (!gPaletteFade.active && sub_81221EC() != TRUE)
{
if (gMain.newKeys & SELECT_BUTTON)
{
sub_81AE860(data[0], &sSavedPokeblockData.lastItemPage, &sSavedPokeblockData.lastItemPos);
if (sSavedPokeblockData.lastItemPage + sSavedPokeblockData.lastItemPos != sPokeblockMenu->itemsNo - 1)
{
PlaySE(SE_SELECT);
HandlePokeblockMenuCursor(sSavedPokeblockData.lastItemPos, 0x2005);
data[2] = sSavedPokeblockData.lastItemPage + sSavedPokeblockData.lastItemPos;
sPokeblockMenu->isSwapping = TRUE;
gTasks[taskId].func = Task_HandlePokeblocksSwapInput;
}
}
else
{
u16 oldPosition = sSavedPokeblockData.lastItemPos;
s32 itemId = ListMenuHandleInputGetItemId(data[0]);
sub_81AE860(data[0], &sSavedPokeblockData.lastItemPage, &sSavedPokeblockData.lastItemPos);
if (oldPosition != sSavedPokeblockData.lastItemPos)
{
HandlePokeblockMenuCursor(oldPosition, 5);
HandlePokeblockMenuCursor(sSavedPokeblockData.lastItemPos, 0x1005);
}
switch (itemId)
{
case LIST_NOTHING_CHOSEN:
break;
case LIST_B_PRESSED:
PlaySE(SE_SELECT);
gSpecialVar_Result = 0xFFFF;
gSpecialVar_ItemId = 0;
FadePaletteAndSetTaskToClosePokeblockCase(taskId);
break;
default:
PlaySE(SE_SELECT);
gSpecialVar_ItemId = itemId;
PutPokeblockOptionsWindow(taskId);
break;
}
}
}
}
static void Task_HandlePokeblocksSwapInput(u8 taskId)
{
s16 *data = gTasks[taskId].data;
if (sub_81221EC() == TRUE)
return;
if (gMain.newKeys & SELECT_BUTTON)
{
PlaySE(SE_SELECT);
sub_81AE860(data[0], &sSavedPokeblockData.lastItemPage, &sSavedPokeblockData.lastItemPos);
HandlePokeblocksSwap(taskId, FALSE);
}
else
{
u16 i = sSavedPokeblockData.lastItemPage;
u16 var = sSavedPokeblockData.lastItemPos;
s32 itemId = ListMenuHandleInputGetItemId(data[0]);
sub_81AE860(data[0], &sSavedPokeblockData.lastItemPage, &sSavedPokeblockData.lastItemPos);
if (i != sSavedPokeblockData.lastItemPage || var != sSavedPokeblockData.lastItemPos)
{
for (i = 0; i < 9; i++)
{
var = i + sSavedPokeblockData.lastItemPage;
if (var == data[2])
HandlePokeblockMenuCursor(i, 0x2005);
else
HandlePokeblockMenuCursor(i, 5);
}
}
sub_81223FC(sPokeblockMenu->field_E75, FIELD_E75_COUNT, 0);
sub_8122448(sPokeblockMenu->field_E75, FIELD_E75_COUNT, 0x80, (sSavedPokeblockData.lastItemPos * 16) + 8);
switch (itemId)
{
case LIST_NOTHING_CHOSEN:
break;
case LIST_B_PRESSED: // same id as STOW CASE field
PlaySE(SE_SELECT);
if (gMain.newKeys & A_BUTTON)
HandlePokeblocksSwap(taskId, FALSE);
else
HandlePokeblocksSwap(taskId, TRUE);
break;
default:
PlaySE(SE_SELECT);
HandlePokeblocksSwap(taskId, FALSE);
break;
}
}
}
void HandlePokeblocksSwap(u8 taskId, bool8 noSwap)
{
u8 i;
s16 *data = gTasks[taskId].data;
u16 swappedFromId = sSavedPokeblockData.lastItemPage + sSavedPokeblockData.lastItemPos;
sPokeblockMenu->isSwapping = FALSE;
sub_81AE6C8(data[0], &sSavedPokeblockData.lastItemPage, &sSavedPokeblockData.lastItemPos);
if (!noSwap && data[2] != swappedFromId && data[2] != swappedFromId - 1)
{
SwapSortPokeblocksInternalData(data[2], swappedFromId);
HandlePokeblockListMenuItems();
}
if (data[2] < swappedFromId)
sSavedPokeblockData.lastItemPos--;
data[0] = ListMenuInit(&gMultiuseListMenuTemplate, sSavedPokeblockData.lastItemPage, sSavedPokeblockData.lastItemPos);
schedule_bg_copy_tilemap_to_vram(0);
sub_81223FC(sPokeblockMenu->field_E75, FIELD_E75_COUNT, 1);
for (i = 0; i < 9; i++)
HandlePokeblockMenuCursor(i, 5);
HandlePokeblockMenuCursor(sSavedPokeblockData.lastItemPos, 0x1005);
gTasks[taskId].func = Task_HandlePokeblockMenuInput;
}

View File

@ -1081,13 +1081,13 @@ void game_continue(u8 taskId)
if (sub_80E9878(i))
{
sub_80E9780(gUnknown_0203A020->names[count], i);
gUnknown_0203A020->items[count].unk_00 = gUnknown_0203A020->names[count];
gUnknown_0203A020->items[count].unk_04 = i;
gUnknown_0203A020->items[count].name = gUnknown_0203A020->names[count];
gUnknown_0203A020->items[count].id = i;
count ++;
}
}
gUnknown_0203A020->items[count].unk_00 = gText_Cancel;
gUnknown_0203A020->items[count].unk_04 = -2;
gUnknown_0203A020->items[count].name = gText_Cancel;
gUnknown_0203A020->items[count].id = -2;
data[0] = count + 1;
if (data[0] < 8)
{
@ -1097,11 +1097,11 @@ void game_continue(u8 taskId)
{
data[3] = 8;
}
gUnknown_03006310 = gUnknown_0858D07C;
gUnknown_03006310.unk_10 = data[6];
gUnknown_03006310.totalItems = data[0];
gUnknown_03006310.items = gUnknown_0203A020->items;
gUnknown_03006310.maxShowed = data[3];
gMultiuseListMenuTemplate = gUnknown_0858D07C;
gMultiuseListMenuTemplate.unk_10 = data[6];
gMultiuseListMenuTemplate.totalItems = data[0];
gMultiuseListMenuTemplate.items = gUnknown_0203A020->items;
gMultiuseListMenuTemplate.maxShowed = data[3];
}
void sub_80E9DEC(u32 a0, bool8 flag, struct ListMenu *menu)
@ -1118,7 +1118,7 @@ void sub_80E9E00(u8 taskId)
data = gTasks[taskId].data;
SetStandardWindowBorderStyle(data[6], 0);
data[5] = ListMenuInit(&gUnknown_03006310, data[2], data[1]);
data[5] = ListMenuInit(&gMultiuseListMenuTemplate, data[2], data[1]);
sub_80E9E44(taskId);
schedule_bg_copy_tilemap_to_vram(0);
}
@ -1137,8 +1137,8 @@ void sub_80E9E90(u8 taskId)
s32 input;
data = gTasks[taskId].data;
input = ListMenuHandleInput(data[5]);
get_coro_args_x18_x1A(data[5], &data[2], &data[1]);
input = ListMenuHandleInputGetItemId(data[5]);
sub_81AE860(data[5], &data[2], &data[1]);
switch (input)
{
case -1:

View File

@ -419,7 +419,7 @@ gUnknown_030062F4: @ 30062F4
gUnknown_03006300: @ 3006300
.space 0x10
gUnknown_03006310: @ 3006310
gMultiuseListMenuTemplate: @ 3006310
.space 0x18
gUnknown_03006328: @ 3006328

View File

@ -1165,14 +1165,7 @@ gUnknown_0203AB34: @ 203AB34
gUnknown_0203AB40: @ 203AB40
.space 0x8
gUnknown_0203AB48: @ 203AB48
.space 0x6
gUnknown_0203AB4E: @ 203AB4E
.space 0x2
gUnknown_0203AB50: @ 203AB50
.space 0x4
.include "src/pokeblock.o"
gUnknown_0203AB54: @ 203AB54
.space 0x1