mirror of
https://github.com/pret/pokepinballrs.git
synced 2026-03-21 17:24:13 -05:00
Decompile sub_4F258 and also add a compabitility fix for the tools. (#144)
Some checks failed
CI / build (push) Has been cancelled
Some checks failed
CI / build (push) Has been cancelled
* Decompile sub_4F258 and also add a compabitility fix for the tools. * remove expected object file.
This commit is contained in:
parent
bc25e5d24a
commit
51fbb5c15a
|
|
@ -4130,54 +4130,7 @@ _0804F24C:
|
|||
.align 2, 0
|
||||
_0804F254: .4byte 0x0000071A
|
||||
|
||||
thumb_func_start sub_4F258
|
||||
sub_4F258: @ 0x0804F258
|
||||
push {r4, r5, r6, r7, lr}
|
||||
movs r1, #0
|
||||
ldr r0, _0804F2A8 @ =gCurrentPinballGame
|
||||
ldr r0, [r0]
|
||||
movs r2, #0xe3
|
||||
lsls r2, r2, #3
|
||||
adds r5, r0, r2
|
||||
ldr r4, _0804F2AC @ =gUnknown_086B0B70
|
||||
adds r7, r4, #0
|
||||
adds r7, #8
|
||||
ldr r3, _0804F2B0 @ =0x040000D4
|
||||
ldr r6, _0804F2B4 @ =0x80000020
|
||||
_0804F270:
|
||||
lsls r2, r1, #0x10
|
||||
asrs r2, r2, #0x10
|
||||
lsls r1, r2, #1
|
||||
adds r1, r1, r2
|
||||
lsls r1, r1, #2
|
||||
adds r0, r5, r2
|
||||
ldrb r0, [r0]
|
||||
lsls r0, r0, #0x18
|
||||
asrs r0, r0, #0x18
|
||||
lsls r0, r0, #2
|
||||
adds r0, r0, r4
|
||||
adds r0, r1, r0
|
||||
adds r1, r1, r7
|
||||
ldr r0, [r0]
|
||||
str r0, [r3]
|
||||
ldr r0, [r1]
|
||||
str r0, [r3, #4]
|
||||
str r6, [r3, #8]
|
||||
ldr r0, [r3, #8]
|
||||
adds r2, #1
|
||||
lsls r2, r2, #0x10
|
||||
lsrs r1, r2, #0x10
|
||||
asrs r2, r2, #0x10
|
||||
cmp r2, #2
|
||||
ble _0804F270
|
||||
pop {r4, r5, r6, r7}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.align 2, 0
|
||||
_0804F2A8: .4byte gCurrentPinballGame
|
||||
_0804F2AC: .4byte gUnknown_086B0B70
|
||||
_0804F2B0: .4byte 0x040000D4
|
||||
_0804F2B4: .4byte 0x80000020
|
||||
.section .text4F258
|
||||
|
||||
thumb_func_start sub_4F2B8
|
||||
sub_4F2B8: @ 0x0804F2B8
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -669,7 +669,7 @@ extern void sub_4E9F0(s8);
|
|||
//extern ? sub_4EF38();
|
||||
//extern ? sub_4F028();
|
||||
//extern ? sub_4F0F0();
|
||||
//extern ? sub_4F258();
|
||||
extern void sub_4F258(void);
|
||||
//extern ? sub_4F2B8();
|
||||
//extern ? sub_4F30C();
|
||||
//extern ? sub_4F4B4();
|
||||
|
|
|
|||
|
|
@ -573,9 +573,7 @@ struct PinballGame
|
|||
/*0x715*/ u8 filler715[0x1];
|
||||
/*0x716*/ s8 unk716;
|
||||
/*0x717*/ u8 unk717;
|
||||
/*0x718*/ s8 leftBallPowerUpLight;
|
||||
/*0x719*/ s8 centerBallPowerUpLight;
|
||||
/*0x71A*/ s8 rightBallPowerUpLight;
|
||||
/*0x718*/ s8 ballPowerUpLight[3];
|
||||
/*0x71B*/ u8 unk71B;
|
||||
/*0x71C*/ u8 unk71C;
|
||||
/*0x71D*/ u8 filler71D[0x7];
|
||||
|
|
|
|||
|
|
@ -71,6 +71,8 @@ SECTIONS
|
|||
asm/rom_4CEA8.o(.text);
|
||||
src/rom_4E598.o(.text);
|
||||
asm/rom_4CEA8.o(.text4E598);
|
||||
src/rom_4F258.o(.text);
|
||||
asm/rom_4CEA8.o(.text4F258);
|
||||
src/rom_50AD4.o(.text);
|
||||
src/rom_50FAC.o(.text);
|
||||
src/options.o(.text);
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ extern const struct Unk20028D8 gUnknown_086B077C[];
|
|||
extern const VoidFunc gUnknown_086B085C[];
|
||||
extern struct SpriteGroup *gMainFieldSpriteGroups[][60];
|
||||
extern struct SpriteGroup *gBonusFieldSpriteGroups[][30];
|
||||
|
||||
extern const u8 gUnknown_08158284[];
|
||||
extern const u8 gUnknown_08395A4C[];
|
||||
extern const u8 gUnknown_08397E6C[];
|
||||
|
|
|
|||
|
|
@ -173,10 +173,10 @@ void sub_19FA0(void) {
|
|||
gCurrentPinballGame->lLight = gCurrentPinballGame->eLight;
|
||||
gCurrentPinballGame->eLight = tmp;
|
||||
|
||||
tmp = gCurrentPinballGame->leftBallPowerUpLight;
|
||||
gCurrentPinballGame->leftBallPowerUpLight = gCurrentPinballGame->centerBallPowerUpLight;
|
||||
gCurrentPinballGame->centerBallPowerUpLight = gCurrentPinballGame->rightBallPowerUpLight;
|
||||
gCurrentPinballGame->rightBallPowerUpLight = tmp;
|
||||
tmp = gCurrentPinballGame->ballPowerUpLight[0];
|
||||
gCurrentPinballGame->ballPowerUpLight[0] = gCurrentPinballGame->ballPowerUpLight[1];
|
||||
gCurrentPinballGame->ballPowerUpLight[1] = gCurrentPinballGame->ballPowerUpLight[2];
|
||||
gCurrentPinballGame->ballPowerUpLight[2] = tmp;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->newButtonActions[1])
|
||||
|
|
@ -193,10 +193,10 @@ void sub_19FA0(void) {
|
|||
gCurrentPinballGame->oLight = gCurrentPinballGame->hLight;
|
||||
gCurrentPinballGame->hLight = tmp;
|
||||
|
||||
tmp = gCurrentPinballGame->rightBallPowerUpLight;
|
||||
gCurrentPinballGame->rightBallPowerUpLight = gCurrentPinballGame->centerBallPowerUpLight;
|
||||
gCurrentPinballGame->centerBallPowerUpLight = gCurrentPinballGame->leftBallPowerUpLight;
|
||||
gCurrentPinballGame->leftBallPowerUpLight = tmp;
|
||||
tmp = gCurrentPinballGame->ballPowerUpLight[2];
|
||||
gCurrentPinballGame->ballPowerUpLight[2] = gCurrentPinballGame->ballPowerUpLight[1];
|
||||
gCurrentPinballGame->ballPowerUpLight[1] = gCurrentPinballGame->ballPowerUpLight[0];
|
||||
gCurrentPinballGame->ballPowerUpLight[0] = tmp;
|
||||
|
||||
gCurrentPinballGame->unk301 = 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -702,10 +702,10 @@ void sub_32DF8(void)
|
|||
gCurrentPinballGame->lLight = gCurrentPinballGame->eLight;
|
||||
gCurrentPinballGame->eLight = tmp;
|
||||
|
||||
tmp = gCurrentPinballGame->leftBallPowerUpLight;
|
||||
gCurrentPinballGame->leftBallPowerUpLight = gCurrentPinballGame->centerBallPowerUpLight;
|
||||
gCurrentPinballGame->centerBallPowerUpLight = gCurrentPinballGame->rightBallPowerUpLight;
|
||||
gCurrentPinballGame->rightBallPowerUpLight = tmp;
|
||||
tmp = gCurrentPinballGame->ballPowerUpLight[0];
|
||||
gCurrentPinballGame->ballPowerUpLight[0] = gCurrentPinballGame->ballPowerUpLight[1];
|
||||
gCurrentPinballGame->ballPowerUpLight[1] = gCurrentPinballGame->ballPowerUpLight[2];
|
||||
gCurrentPinballGame->ballPowerUpLight[2] = tmp;
|
||||
}
|
||||
|
||||
if (gCurrentPinballGame->newButtonActions[1])
|
||||
|
|
@ -722,10 +722,10 @@ void sub_32DF8(void)
|
|||
gCurrentPinballGame->oLight = gCurrentPinballGame->hLight;
|
||||
gCurrentPinballGame->hLight = tmp;
|
||||
|
||||
tmp = gCurrentPinballGame->rightBallPowerUpLight;
|
||||
gCurrentPinballGame->rightBallPowerUpLight = gCurrentPinballGame->centerBallPowerUpLight;
|
||||
gCurrentPinballGame->centerBallPowerUpLight = gCurrentPinballGame->leftBallPowerUpLight;
|
||||
gCurrentPinballGame->leftBallPowerUpLight = tmp;
|
||||
tmp = gCurrentPinballGame->ballPowerUpLight[2];
|
||||
gCurrentPinballGame->ballPowerUpLight[2] = gCurrentPinballGame->ballPowerUpLight[1];
|
||||
gCurrentPinballGame->ballPowerUpLight[1] = gCurrentPinballGame->ballPowerUpLight[0];
|
||||
gCurrentPinballGame->ballPowerUpLight[0] = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,9 +38,9 @@ void sub_4E598(void)
|
|||
gCurrentPinballGame->unk1D0 = 0;
|
||||
}
|
||||
|
||||
gCurrentPinballGame->leftBallPowerUpLight = 0;
|
||||
gCurrentPinballGame->centerBallPowerUpLight = gCurrentPinballGame->leftBallPowerUpLight;
|
||||
gCurrentPinballGame->rightBallPowerUpLight = gCurrentPinballGame->leftBallPowerUpLight;
|
||||
gCurrentPinballGame->ballPowerUpLight[0] = 0;
|
||||
gCurrentPinballGame->ballPowerUpLight[1] = gCurrentPinballGame->ballPowerUpLight[0];
|
||||
gCurrentPinballGame->ballPowerUpLight[2] = gCurrentPinballGame->ballPowerUpLight[0];
|
||||
gCurrentPinballGame->unk308 = 0;
|
||||
if (gMain.eReaderBonuses[EREADER_DX_MODE_CARD])
|
||||
{
|
||||
|
|
|
|||
13
src/rom_4F258.c
Normal file
13
src/rom_4F258.c
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#include "global.h"
|
||||
#include "main.h"
|
||||
|
||||
extern u8* gUnknown_086B0B70[][3];
|
||||
|
||||
void sub_4F258(void) {
|
||||
s16 i;
|
||||
for (i = 0; i < 3; i++) {
|
||||
u8 ** src = gUnknown_086B0B70[i] + gCurrentPinballGame->ballPowerUpLight[i];
|
||||
u8 ** dst = gUnknown_086B0B70[i] + 2;
|
||||
DmaCopy16(3, *src, *dst, 0x40);
|
||||
}
|
||||
}
|
||||
|
|
@ -453,7 +453,7 @@ int AsmFile::ReadDexString(unsigned short* s, uint8_t targetLength, bool padLeft
|
|||
if (dexEncoding.count(c) == 0)
|
||||
{
|
||||
if (c.size() == 1 && IsAsciiPrintable(c[0]))
|
||||
RaiseError("character '%c' not valid in dex string", c);
|
||||
RaiseError("character '%c' not valid in dex string", c.c_str());
|
||||
else
|
||||
{
|
||||
std::string hex;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user