mirror of
https://github.com/SAT-R/sa2.git
synced 2026-10-28 09:43:38 +00:00
Match SA1's CreateStageUI & CreateSpecialStageUI (#270)
* sa1: match CreateStageUI & CreateSpecialStageUI * oh yeah, there's this * delete the target asm file * little documentation hopefully, we find a way to make proper use of the original code's (possible) debug behavior... or i could be exaggerating over what was originally just the devs playing safe! eh, either theory works, i guess * maybe i went a bit overboard... revert the previous commit, basically (web GitHub also doesn't support commit reverting, what a surprise!)
This commit is contained in:
1 parent
71c5a7195b
commit
978cf77612
2 files changed
+16
-64
No files matched your search
@@ -1,36 +0,0 @@
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
.text
|
||||
push {r4, lr}
|
||||
sub sp, #4
|
||||
movs r1, #0
|
||||
ldr r0, _0805422C @ =Task_SpecialStageUIMain
|
||||
movs r2, #0x8c
|
||||
lsls r2, r2, #5
|
||||
movs r4, #0
|
||||
str r1, [sp]
|
||||
movs r1, #0x50
|
||||
movs r3, #0
|
||||
bl TaskCreate
|
||||
adds r1, r0, #0
|
||||
ldrh r0, [r1, #6]
|
||||
ldr r2, _08054230 @ =0x03000040
|
||||
adds r0, r0, r2
|
||||
strh r4, [r0]
|
||||
ldrh r0, [r1, #6]
|
||||
ldr r1, _08054234 @ =0x0300004C
|
||||
adds r0, r0, r1
|
||||
strh r4, [r0]
|
||||
bl UiGfxStackInit
|
||||
bl sub_8054068
|
||||
add sp, #4
|
||||
pop {r4}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_0805422C: .4byte Task_SpecialStageUIMain
|
||||
_08054230: .4byte 0x03000040
|
||||
_08054234: .4byte 0x0300004C
|
||||
|
||||
.syntax divided
|
||||
@@ -596,51 +596,39 @@ void sub_8054068(void)
|
||||
|
||||
void CreateStageUI(void)
|
||||
{
|
||||
#ifndef NON_MATCHING
|
||||
register void *dtor asm("r1") = 0;
|
||||
StageUI_20 *unk20 = NULL;
|
||||
register Task *t asm("r1") = TaskCreate(Task_StageUIMain, sizeof(StageUI), 0x2180, 0, dtor);
|
||||
#else
|
||||
void *dtor = 0;
|
||||
StageUI_20 *unk20 = NULL;
|
||||
Task *t = TaskCreate(Task_StageUIMain, sizeof(StageUI), 0x2180, 0, dtor);
|
||||
#endif
|
||||
StageUI *ui = TASK_DATA(t);
|
||||
Task *t = NULL;
|
||||
|
||||
StageUI *ui;
|
||||
StageUI_20 *unk20 = NULL;
|
||||
|
||||
t = TaskCreate(Task_StageUIMain, sizeof(StageUI), 0x2180, 0, NULL);
|
||||
|
||||
ui = TASK_DATA(t);
|
||||
ui->unk40 = 0;
|
||||
|
||||
// Colons
|
||||
ui = TASK_DATA(t);
|
||||
ui = TASK_DATA(t); // copy-paste?
|
||||
unk20 = &ui->unk20;
|
||||
unk20->unk1 = 42;
|
||||
unk20->unk4 = 42;
|
||||
unk20->unk1 = UI_DIGIT(10);
|
||||
unk20->unk4 = UI_DIGIT(10);
|
||||
|
||||
UiGfxStackInit();
|
||||
sub_80538BC();
|
||||
}
|
||||
|
||||
// https://decomp.me/scratch/3QSHy
|
||||
void CreateSpecialStageUI(void)
|
||||
{
|
||||
#ifndef NON_MATCHING
|
||||
register void *dtor asm("r1") = 0;
|
||||
register Task *t asm("r1");
|
||||
#else
|
||||
void *dtor = 0;
|
||||
Task *t;
|
||||
#endif
|
||||
s32 zero;
|
||||
StageUI *ui;
|
||||
|
||||
t = TaskCreate(Task_SpecialStageUIMain, sizeof(StageUI), 0x1180, (zero = 0), dtor);
|
||||
Task *t = NULL;
|
||||
t = TaskCreate(Task_SpecialStageUIMain, sizeof(StageUI), 0x1180, 0, NULL);
|
||||
|
||||
ui = TASK_DATA(t);
|
||||
ui->unk40 = zero;
|
||||
ui->unk40 = 0;
|
||||
|
||||
#ifndef NON_MATCHING
|
||||
ui = TASK_DATA(t);
|
||||
#endif
|
||||
ui->unk4C = zero;
|
||||
// Colons
|
||||
ui = TASK_DATA(t); // copy-paste?
|
||||
ui->unk4C = 0;
|
||||
|
||||
UiGfxStackInit();
|
||||
sub_8054068();
|
||||
|
||||
Reference in new issue
Block a user