mirror of
https://github.com/pret/pokepinballrs.git
synced 2026-03-21 17:24:13 -05:00
sub_47100, sub_47110, sub_47160
This commit is contained in:
parent
e357bc98d3
commit
c7007c27f5
243
asm/rom_3219C.s
243
asm/rom_3219C.s
|
|
@ -31641,246 +31641,3 @@ _080470F0: .4byte 0x040000D4
|
|||
_080470F4: .4byte gUnknown_0200FBB0
|
||||
_080470F8: .4byte 0x06008000
|
||||
_080470FC: .4byte 0x80000200
|
||||
|
||||
thumb_func_start sub_47100
|
||||
sub_47100: @ 0x08047100
|
||||
ldr r0, _0804710C @ =gCurrentPinballGame
|
||||
ldr r0, [r0]
|
||||
adds r0, #0xfc
|
||||
movs r1, #0x80
|
||||
strh r1, [r0]
|
||||
bx lr
|
||||
.align 2, 0
|
||||
_0804710C: .4byte gCurrentPinballGame
|
||||
|
||||
thumb_func_start sub_47110
|
||||
sub_47110: @ 0x08047110
|
||||
push {r4, r5, lr}
|
||||
movs r0, #0
|
||||
ldr r5, _08047148 @ =gUnknown_03005C00
|
||||
adds r4, r5, #0
|
||||
ldr r3, _0804714C @ =0x000001FF
|
||||
ldr r2, _08047150 @ =0x000007FF
|
||||
_0804711C:
|
||||
lsls r1, r0, #0x10
|
||||
asrs r1, r1, #0x10
|
||||
lsls r0, r1, #1
|
||||
adds r0, r0, r4
|
||||
strh r3, [r0]
|
||||
adds r1, #1
|
||||
lsls r1, r1, #0x10
|
||||
lsrs r0, r1, #0x10
|
||||
asrs r1, r1, #0x10
|
||||
cmp r1, r2
|
||||
ble _0804711C
|
||||
ldr r1, _08047154 @ =0x040000D4
|
||||
str r5, [r1]
|
||||
ldr r0, _08047158 @ =0x06002000
|
||||
str r0, [r1, #4]
|
||||
ldr r0, _0804715C @ =0x80000800
|
||||
str r0, [r1, #8]
|
||||
ldr r0, [r1, #8]
|
||||
pop {r4, r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_08047148: .4byte gUnknown_03005C00
|
||||
_0804714C: .4byte 0x000001FF
|
||||
_08047150: .4byte 0x000007FF
|
||||
_08047154: .4byte 0x040000D4
|
||||
_08047158: .4byte 0x06002000
|
||||
_0804715C: .4byte 0x80000800
|
||||
|
||||
thumb_func_start sub_47160
|
||||
sub_47160: @ 0x08047160
|
||||
push {r4, r5, lr}
|
||||
ldr r2, _0804719C @ =gMain
|
||||
ldrh r1, [r2, #0x18]
|
||||
movs r0, #8
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
beq _080471B6
|
||||
ldrb r0, [r2, #2]
|
||||
cmp r0, #3
|
||||
beq _080471B6
|
||||
ldr r0, _080471A0 @ =gCurrentPinballGame
|
||||
ldr r0, [r0]
|
||||
movs r1, #0x88
|
||||
lsls r1, r1, #5
|
||||
adds r0, r0, r1
|
||||
ldrb r0, [r0]
|
||||
cmp r0, #0
|
||||
bne _080471B6
|
||||
ldrb r1, [r2, #0xf]
|
||||
movs r0, #2
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
beq _080471A4
|
||||
movs r0, #0xfd
|
||||
ands r0, r1
|
||||
strb r0, [r2, #0xf]
|
||||
bl sub_497BC
|
||||
b _080471B6
|
||||
.align 2, 0
|
||||
_0804719C: .4byte gMain
|
||||
_080471A0: .4byte gCurrentPinballGame
|
||||
_080471A4:
|
||||
movs r0, #0x20
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
bne _080471B6
|
||||
movs r0, #2
|
||||
orrs r0, r1
|
||||
strb r0, [r2, #0xf]
|
||||
bl sub_495A0
|
||||
_080471B6:
|
||||
ldr r4, _080472B0 @ =gMain
|
||||
ldrb r1, [r4, #0xf]
|
||||
movs r5, #2
|
||||
adds r0, r5, #0
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
beq _08047274
|
||||
ldrh r1, [r4, #0x18]
|
||||
movs r0, #0x40
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
beq _080471E4
|
||||
ldr r0, _080472B4 @ =gCurrentPinballGame
|
||||
ldr r1, [r0]
|
||||
ldr r0, _080472B8 @ =0x00001104
|
||||
adds r1, r1, r0
|
||||
ldrb r0, [r1]
|
||||
movs r2, #1
|
||||
eors r0, r2
|
||||
strb r0, [r1]
|
||||
movs r0, SE_UNKNOWN_0xA3
|
||||
bl m4aSongNumStart
|
||||
_080471E4:
|
||||
ldrh r1, [r4, #0x18]
|
||||
movs r0, #0x80
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
beq _08047204
|
||||
ldr r0, _080472B4 @ =gCurrentPinballGame
|
||||
ldr r1, [r0]
|
||||
ldr r0, _080472B8 @ =0x00001104
|
||||
adds r1, r1, r0
|
||||
ldrb r0, [r1]
|
||||
movs r2, #1
|
||||
eors r0, r2
|
||||
strb r0, [r1]
|
||||
movs r0, SE_UNKNOWN_0xA3
|
||||
bl m4aSongNumStart
|
||||
_08047204:
|
||||
ldrh r1, [r4, #0x18]
|
||||
movs r0, #1
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
beq _08047244
|
||||
ldrh r1, [r4, #0x1c]
|
||||
movs r0, #0xe
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
bne _08047244
|
||||
ldr r0, _080472B4 @ =gCurrentPinballGame
|
||||
ldr r0, [r0]
|
||||
ldr r1, _080472B8 @ =0x00001104
|
||||
adds r0, r0, r1
|
||||
ldrb r0, [r0]
|
||||
lsls r0, r0, #0x18
|
||||
asrs r0, r0, #0x18
|
||||
cmp r0, #0
|
||||
bne _08047230
|
||||
strb r5, [r4, #0xe]
|
||||
bl sub_49850
|
||||
_08047230:
|
||||
ldrb r1, [r4, #0xf]
|
||||
movs r0, #0xfd
|
||||
ands r0, r1
|
||||
strb r0, [r4, #0xf]
|
||||
bl sub_497BC
|
||||
ldrh r1, [r4, #0x18]
|
||||
ldr r0, _080472BC @ =0x0000FFFE
|
||||
ands r0, r1
|
||||
strh r0, [r4, #0x18]
|
||||
_08047244:
|
||||
ldr r4, _080472B0 @ =gMain
|
||||
ldrh r1, [r4, #0x18]
|
||||
movs r5, #2
|
||||
adds r0, r5, #0
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
beq _08047266
|
||||
ldrb r1, [r4, #0xf]
|
||||
movs r0, #0xfd
|
||||
ands r0, r1
|
||||
strb r0, [r4, #0xf]
|
||||
bl sub_497BC
|
||||
ldrh r1, [r4, #0x18]
|
||||
ldr r0, _080472C0 @ =0x0000FFFD
|
||||
ands r0, r1
|
||||
strh r0, [r4, #0x18]
|
||||
_08047266:
|
||||
ldrb r1, [r4, #0xf]
|
||||
adds r0, r5, #0
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
beq _08047274
|
||||
bl sub_49A34
|
||||
_08047274:
|
||||
ldr r0, _080472B0 @ =gMain
|
||||
ldrb r1, [r0, #0xf]
|
||||
adds r2, r0, #0
|
||||
cmp r1, #0
|
||||
bne _080472DC
|
||||
ldr r3, _080472B4 @ =gCurrentPinballGame
|
||||
ldr r0, [r3]
|
||||
movs r4, #0xe8
|
||||
lsls r4, r4, #3
|
||||
adds r0, r0, r4
|
||||
strb r1, [r0]
|
||||
ldrh r0, [r2, #0x14]
|
||||
cmp r0, #0
|
||||
beq _080472DC
|
||||
subs r0, #1
|
||||
strh r0, [r2, #0x14]
|
||||
lsls r0, r0, #0x10
|
||||
lsrs r0, r0, #0x10
|
||||
cmp r0, #1
|
||||
bne _080472D2
|
||||
ldr r0, [r3]
|
||||
adds r1, r0, #0
|
||||
adds r1, #0xe4
|
||||
ldrb r0, [r1]
|
||||
cmp r0, #0
|
||||
beq _080472C4
|
||||
movs r0, #0xa
|
||||
strh r0, [r2, #0x14]
|
||||
b _080472D2
|
||||
.align 2, 0
|
||||
_080472B0: .4byte gMain
|
||||
_080472B4: .4byte gCurrentPinballGame
|
||||
_080472B8: .4byte 0x00001104
|
||||
_080472BC: .4byte 0x0000FFFE
|
||||
_080472C0: .4byte 0x0000FFFD
|
||||
_080472C4:
|
||||
ldrb r0, [r2, #0x11]
|
||||
cmp r0, #8
|
||||
bne _080472CE
|
||||
movs r0, #0x13
|
||||
b _080472D0
|
||||
_080472CE:
|
||||
movs r0, #0x14
|
||||
_080472D0:
|
||||
strb r0, [r1]
|
||||
_080472D2:
|
||||
ldrh r0, [r2, #0x14]
|
||||
cmp r0, #0
|
||||
bne _080472DC
|
||||
ldrb r0, [r2, #0x11]
|
||||
strb r0, [r2, #0xf]
|
||||
_080472DC:
|
||||
pop {r4, r5}
|
||||
pop {r0}
|
||||
bx r0
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -637,10 +637,10 @@ extern void sub_47FBC(void);
|
|||
extern void sub_47FF8(void);
|
||||
extern void sub_48124(void);
|
||||
extern void sub_48190(void);
|
||||
//extern ? sub_495A0();
|
||||
//extern ? sub_497BC();
|
||||
//extern ? sub_49850();
|
||||
//extern ? sub_49A34();
|
||||
extern void sub_495A0(void);
|
||||
extern void sub_497BC(void);
|
||||
extern void sub_49850(void);
|
||||
extern void sub_49A34(void);
|
||||
extern void sub_4ACF0();
|
||||
extern void sub_4B000();
|
||||
extern void sub_4B408(s16);
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ struct Main
|
|||
/*0x10*/ u8 unk10;
|
||||
/*0x11*/ u8 unk11;
|
||||
/*0x12*/ u16 unk12;
|
||||
/*0x14*/ s16 unk14;
|
||||
/*0x14*/ u16 unk14;
|
||||
/*0x16*/ u16 unk16;
|
||||
/*0x18*/ u16 newKeys;
|
||||
/*0x1A*/ u16 releasedKeys;
|
||||
|
|
|
|||
|
|
@ -26,6 +26,98 @@ extern s16 gUnknown_02030750[];
|
|||
extern s16 gUnknown_02031500[];
|
||||
extern s16 gUnknown_020306C0[];
|
||||
|
||||
|
||||
void sub_47100(void)
|
||||
{
|
||||
gCurrentPinballGame->unkFC = 128;
|
||||
}
|
||||
|
||||
void sub_47110(void)
|
||||
{
|
||||
s16 i;
|
||||
|
||||
for (i = 0; i < 0x800; i++)
|
||||
gUnknown_03005C00[i] = 0x1FF;
|
||||
|
||||
DmaCopy16(3, gUnknown_03005C00, (void *)0x06002000, 0x1000);
|
||||
}
|
||||
|
||||
void sub_47160(void)
|
||||
{
|
||||
if (JOY_NEW(START_BUTTON) && gMain.mainState != STATE_GAME_IDLE && gCurrentPinballGame->unk1100 == 0)
|
||||
{
|
||||
if (gMain.unkF & 0x2)
|
||||
{
|
||||
gMain.unkF &= ~0x2;
|
||||
sub_497BC();
|
||||
}
|
||||
else if ((gMain.unkF & 0x20) == 0)
|
||||
{
|
||||
gMain.unkF |= 0x2;
|
||||
sub_495A0();
|
||||
}
|
||||
}
|
||||
|
||||
if (gMain.unkF & 0x2)
|
||||
{
|
||||
if (JOY_NEW(DPAD_UP))
|
||||
{
|
||||
gCurrentPinballGame->unk1104 ^= 1;
|
||||
m4aSongNumStart(SE_UNKNOWN_0xA3);
|
||||
}
|
||||
|
||||
if (JOY_NEW(DPAD_DOWN))
|
||||
{
|
||||
gCurrentPinballGame->unk1104 ^= 1;
|
||||
m4aSongNumStart(SE_UNKNOWN_0xA3);
|
||||
}
|
||||
|
||||
if (JOY_NEW(A_BUTTON) && !JOY_HELD(B_BUTTON | SELECT_BUTTON | START_BUTTON))
|
||||
{
|
||||
if (gCurrentPinballGame->unk1104 == 0)
|
||||
{
|
||||
gMain.unkE = 2;
|
||||
sub_49850();
|
||||
}
|
||||
|
||||
gMain.unkF &= ~0x2;
|
||||
sub_497BC();
|
||||
gMain.newKeys &= ~A_BUTTON;
|
||||
}
|
||||
|
||||
if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
gMain.unkF &= ~0x2;
|
||||
sub_497BC();
|
||||
gMain.newKeys &= ~B_BUTTON;
|
||||
}
|
||||
|
||||
if (gMain.unkF & 0x2)
|
||||
sub_49A34();
|
||||
}
|
||||
|
||||
if (gMain.unkF == 0x0)
|
||||
{
|
||||
gCurrentPinballGame->unk740 = 0;
|
||||
if (gMain.unk14 != 0)
|
||||
{
|
||||
gMain.unk14--;
|
||||
if (gMain.unk14 == 1)
|
||||
{
|
||||
if (gCurrentPinballGame->unkE4)
|
||||
gMain.unk14 = 10;
|
||||
else if (gMain.unk11 == 0x8)
|
||||
gCurrentPinballGame->unkE4 = 19;
|
||||
else
|
||||
gCurrentPinballGame->unkE4 = 20;
|
||||
}
|
||||
|
||||
if (gMain.unk14 == 0)
|
||||
gMain.unkF = gMain.unk11;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Handle debug system flags
|
||||
void sub_472E4(void)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user