mirror of
https://github.com/pret/pokeruby.git
synced 2026-09-14 05:56:52 -05:00
decompile hof_pc.s
This commit is contained in:
82
asm/hof_pc.s
82
asm/hof_pc.s
@@ -1,82 +0,0 @@
|
||||
.include "constants/gba_constants.inc"
|
||||
.include "constants/species_constants.inc"
|
||||
.include "asm/macros.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
thumb_func_start AccessHallOfFamePC
|
||||
AccessHallOfFamePC: @ 810D618
|
||||
push {lr}
|
||||
ldr r0, _0810D628 @ =sub_81428CC
|
||||
bl SetMainCallback2
|
||||
bl ScriptContext2_Enable
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_0810D628: .4byte sub_81428CC
|
||||
thumb_func_end AccessHallOfFamePC
|
||||
|
||||
thumb_func_start ReturnFromHallOfFamePC
|
||||
ReturnFromHallOfFamePC: @ 810D62C
|
||||
push {lr}
|
||||
ldr r0, _0810D640 @ =c2_exit_to_overworld_2_switch
|
||||
bl SetMainCallback2
|
||||
ldr r1, _0810D644 @ =gUnknown_0300485C
|
||||
ldr r0, _0810D648 @ =ReshowPCMenuAfterHallOfFamePC
|
||||
str r0, [r1]
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_0810D640: .4byte c2_exit_to_overworld_2_switch
|
||||
_0810D644: .4byte gUnknown_0300485C
|
||||
_0810D648: .4byte ReshowPCMenuAfterHallOfFamePC
|
||||
thumb_func_end ReturnFromHallOfFamePC
|
||||
|
||||
thumb_func_start ReshowPCMenuAfterHallOfFamePC
|
||||
ReshowPCMenuAfterHallOfFamePC: @ 810D64C
|
||||
push {lr}
|
||||
sub sp, 0x4
|
||||
bl ScriptContext2_Enable
|
||||
bl sub_8053E90
|
||||
movs r0, 0x1
|
||||
negs r0, r0
|
||||
movs r1, 0
|
||||
str r1, [sp]
|
||||
movs r2, 0x10
|
||||
movs r3, 0
|
||||
bl BeginNormalPaletteFade
|
||||
bl TryCreatePCMenu
|
||||
bl sub_80B5838
|
||||
ldr r0, _0810D680 @ =sub_810D684
|
||||
movs r1, 0xA
|
||||
bl CreateTask
|
||||
add sp, 0x4
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_0810D680: .4byte sub_810D684
|
||||
thumb_func_end ReshowPCMenuAfterHallOfFamePC
|
||||
|
||||
thumb_func_start sub_810D684
|
||||
sub_810D684: @ 810D684
|
||||
push {lr}
|
||||
lsls r0, 24
|
||||
lsrs r2, r0, 24
|
||||
ldr r0, _0810D6A0 @ =gPaletteFade
|
||||
ldrb r1, [r0, 0x7]
|
||||
movs r0, 0x80
|
||||
ands r0, r1
|
||||
cmp r0, 0
|
||||
bne _0810D69C
|
||||
adds r0, r2, 0
|
||||
bl DestroyTask
|
||||
_0810D69C:
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_0810D6A0: .4byte gPaletteFade
|
||||
thumb_func_end sub_810D684
|
||||
|
||||
.align 2, 0 @ Don't pad with nop.
|
||||
@@ -215,7 +215,7 @@ SECTIONS {
|
||||
src/post_battle_event_funcs.o(.text);
|
||||
asm/time_events.o(.text);
|
||||
asm/birch_pc.o(.text);
|
||||
asm/hof_pc.o(.text);
|
||||
src/hof_pc.o(.text);
|
||||
asm/field_specials.o(.text);
|
||||
asm/battle_records.o(.text);
|
||||
asm/pokedex_area_screen.o(.text);
|
||||
|
||||
41
src/hof_pc.c
Normal file
41
src/hof_pc.c
Normal file
@@ -0,0 +1,41 @@
|
||||
#include "global.h"
|
||||
#include "script.h"
|
||||
#include "main.h"
|
||||
#include "script_menu.h"
|
||||
#include "palette.h"
|
||||
#include "rom4.h"
|
||||
#include "task.h"
|
||||
|
||||
extern void sub_81428CC(void);
|
||||
extern void (*gUnknown_0300485C)(void);
|
||||
|
||||
static void ReshowPCMenuAfterHallOfFamePC(void);
|
||||
static void Task_WaitForPaletteFade(u8);
|
||||
|
||||
void AccessHallOfFamePC(void)
|
||||
{
|
||||
SetMainCallback2(sub_81428CC);
|
||||
ScriptContext2_Enable();
|
||||
}
|
||||
|
||||
void ReturnFromHallOfFamePC(void)
|
||||
{
|
||||
SetMainCallback2(c2_exit_to_overworld_2_switch);
|
||||
gUnknown_0300485C = ReshowPCMenuAfterHallOfFamePC;
|
||||
}
|
||||
|
||||
static void ReshowPCMenuAfterHallOfFamePC(void)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
sub_8053E90();
|
||||
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, 0);
|
||||
TryCreatePCMenu();
|
||||
sub_80B5838();
|
||||
CreateTask(Task_WaitForPaletteFade, 10);
|
||||
}
|
||||
|
||||
static void Task_WaitForPaletteFade(u8 taskId)
|
||||
{
|
||||
if (!gPaletteFade.active)
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
Reference in New Issue
Block a user