Decompile more of resultdll

This commit is contained in:
gamemasterplc 2024-04-05 14:31:14 -05:00
parent d32bd99e23
commit 3c8d3954b9
6 changed files with 233 additions and 23 deletions

View file

@ -972,14 +972,14 @@ SLSaveDataMake = .text:0x80058860; // type:function size:0x154
SLSaveDataInfoSet = .text:0x800589B4; // type:function size:0x218
SLCommonSet = .text:0x80058BCC; // type:function size:0x254
SLSaveBoard = .text:0x80058E20; // type:function size:0x8C
SLSaveBoardBackup = .text:0x80058EAC; // type:function size:0x8C
SLSaveBoardStory = .text:0x80058EAC; // type:function size:0x8C
SLSave = .text:0x80058F38; // type:function size:0x380
SLCreateSaveWin = .text:0x800592B8; // type:function size:0xDC scope:local
SLKillSaveWin = .text:0x80059394; // type:function size:0x48 scope:local
SLLoad = .text:0x800593DC; // type:function size:0x110
SLLoadGameStat = .text:0x800594EC; // type:function size:0x38
SLLoadBoard = .text:0x80059524; // type:function size:0x1A0
SLLoadBoardBackup = .text:0x800596C4; // type:function size:0x184
SLLoadBoardStory = .text:0x800596C4; // type:function size:0x184
SLSerialNoGet = .text:0x80059848; // type:function size:0x28
SLSerialNoCheck = .text:0x80059870; // type:function size:0xA0
SLCheckSumCheck = .text:0x80059910; // type:function size:0x60

View file

@ -234,6 +234,11 @@ static inline void GWLuckyValueSet(s32 value)
GWSystem.lucky_value = value;
}
static inline s16 GWPlayerCoinBattleGet(s32 player)
{
return GWPlayer[player].coins_battle;
}
static inline s16 GWPlayerCoinCollectGet(s32 player)
{
return GWPlayer[player].coin_collect;

View file

@ -15,8 +15,8 @@ typedef struct save_buf_data {
GameStat stat;
SystemState system;
PlayerState player[4];
SystemState systemBackup;
PlayerState playerBackup[4];
SystemState systemStory;
PlayerState playerStory[4];
} SaveBufData;
typedef union save_buf_all {
@ -24,7 +24,12 @@ typedef union save_buf_all {
u8 ATTRIBUTE_ALIGN(32) buf[SAVE_BUF_SIZE];
} SaveBufAll;
extern CARDFileInfo curFileInfo;
extern SaveBufAll saveBuf;
extern u64 SLSerialNo;
extern s32 saveExecF;
extern u8 curBoxNo;
extern s16 curSlotNo;
s32 SLFileOpen(char *fileName);
s32 SLFileCreate(char *fileName, u32 size, void *addr);
@ -39,12 +44,12 @@ void SLSaveDataMake(s32 erase, OSTime *time);
void SLSaveDataInfoSet(OSTime *time);
void SLCommonSet(void);
void SLSaveBoard(void);
void SLSaveBoardBackup(void);
void SLSaveBoardStory(void);
s32 SLSave(void);
s32 SLLoad(void);
void SLLoadGameStat(void);
void SLLoadBoard(void);
void SLLoadBoardBackup(void);
void SLLoadBoardStory(void);
void SLSerialNoGet(void);
BOOL SLSerialNoCheck(void);
BOOL SLCheckSumCheck(void);

View file

@ -10,6 +10,7 @@
#include "game/audio.h"
#include "game/wipe.h"
#include "game/pad.h"
#include "game/armem.h"
#include "game/saveload.h"
#include "game/gamework.h"
#include "game/board/player.h"
@ -385,7 +386,7 @@ void fn_1_B78(void)
lbl_1_bss_12[i][4] = HuSprCreate(anim2, 0, 0);
HuSprGrpMemberSet(lbl_1_bss_3A[i], 4, lbl_1_bss_12[i][4]);
HuSprPosSet(lbl_1_bss_3A[i], 4, 60.0f, -25.0f);
HuSprGrpPosSet(lbl_1_bss_3A[i], lbl_1_data_3D8[(i*2)], lbl_1_data_3D8[(i*2)+1]);
HuSprGrpPosSet(lbl_1_bss_3A[i], lbl_1_data_438[(i*2)], lbl_1_data_438[(i*2)+1]);
fn_1_3CAC(lbl_1_bss_3A[i], 9);
HuSprGrpScaleSet(lbl_1_bss_3A[i], 0.0f, 0.0f);
}
@ -687,7 +688,7 @@ void fn_1_2ADC(void)
temp_r27 = temp_r28-(i*20);
if(temp_r27 <= 20) {
if(temp_r27 <= 10) {
HuSprScaleSet(lbl_1_bss_52, i, 1.0f, sin(M_PI*(9.0f*temp_r27)/180.0));
HuSprScaleSet(lbl_1_bss_52, i, 1.0f, cos(M_PI*(9.0f*temp_r27)/180.0));
} else {
HuSprAttrSet(lbl_1_bss_52, i, 4);
HuSprAttrReset(lbl_1_data_380, i, 4);
@ -841,4 +842,203 @@ void fn_1_3E08(void)
}
}
}
}
s32 lbl_1_data_450[] = {
DATADIR_W01,
DATADIR_W02,
DATADIR_W03,
DATADIR_W04,
DATADIR_W05,
DATADIR_W06
};
void fn_1_3FD8(void)
{
s32 status;
u32 ardma;
if(!_CheckFlag(0x10000)) {
lbl_1_bss_178 = 1;
HuPrcEnd();
while(1) {
HuPrcVSleep();
}
}
status = HuDataDirReadAsync(DATADIR_BOARD);
if(status != -1) {
while(!HuDataGetAsyncStat(status)) {
HuPrcVSleep();
}
}
ardma = HuAR_MRAMtoARAM(DATADIR_BOARD);
if(ardma) {
while(HuARDMACheck()) {
HuPrcVSleep();
}
}
HuDataDirClose(DATADIR_BOARD);
status = HuDataDirReadAsync(lbl_1_data_450[GWSystem.board]);
if(status != -1) {
while(!HuDataGetAsyncStat(status)) {
HuPrcVSleep();
}
}
lbl_1_bss_178 = 1;
HuPrcEnd();
while(1) {
HuPrcVSleep();
}
}
void fn_1_40DC(void)
{
s16 i;
s16 sp8[5];
fn_1_423C(sp8);
sp8[lbl_1_bss_172] += sp8[4];
for(i=0; i<4; i++) {
GWCoinsAdd(i, sp8[i]);
GWPlayerCoinWinSet(i, 0);
GWPlayerCoinCollectSet(i, 0);
if(mgInfoTbl[GWSystem.mg_next].type != 4) {
GWPlayer[i].coins_mg += sp8[i];
if(GWPlayer[i].coins_mg > 9999) {
GWPlayer[i].coins_mg = 9999;
}
}
}
}
void fn_1_423C(s16 *data)
{
s16 i;
s32 coin;
u32 mul_coin;
u32 coin_battle;
s16 temp_r26;
s16 mgtype;
float sp10[4];
s16 sp8[4];
mgtype = mgInfoTbl[GWSystem.mg_next].type;
switch(mgtype) {
case 4:
temp_r26 = 0;
for(i=coin_battle=0; i<4; i++) {
coin_battle += GWPlayerCoinBattleGet(i);
}
sp8[0] = sp8[1] = sp8[2] = sp8[3] = 0;
for(i=0; i<4; i++) {
sp8[GWPlayerCoinWinGet(i)]++;
}
sp10[0] = sp10[1] = sp10[2] = sp10[3] = 0;
if(sp8[0] == 1 && sp8[1] == 1 && sp8[2] == 1) {
sp10[0] = 0.7f;
sp10[1] = 0.3f;
} else if(sp8[0] ==2) {
sp10[0] = 0.5f;
} else if(sp8[0] == 3) {
sp10[0] = 1.0f/3.0f;
} else if(sp8[0] == 1 && sp8[1] == 2) {
sp10[0] = 0.6f;
sp10[1] = 0.2f;
} else if(sp8[0] == 1 && sp8[1] == 3) {
sp10[0] = 0.7f;
sp10[1] = 0.1f;
} else if(sp8[0] == 1 && sp8[1] == 1 && sp8[2] == 2) {
sp10[0] = 0.7f;
sp10[1] = 0.3f;
} else if(sp8[0] == 4) {
sp10[0] = 0.25f;
} else {
temp_r26 = 1;
}
for(i=coin=0; i<4; i++) {
if(!temp_r26) {
mul_coin = coin_battle*sp10[GWPlayerCoinWinGet(i)];
} else {
mul_coin = GWPlayerCoinBattleGet(i);
}
data[i] = mul_coin;
coin += mul_coin;
}
if(coin < coin_battle) {
data[4] = coin_battle-coin;
} else {
data[4] = 0;
}
break;
default:
for(i=0; i<4; i++) {
coin = GWPlayerCoinWinGet(i)+GWPlayerCoinCollectGet(i);
mul_coin = GWLuckyValueGet();
if(mul_coin == 0) {
mul_coin = 1;
}
coin *= mul_coin;
data[i] = coin;
}
break;
}
}
void fn_1_461C(void)
{
s16 sprite;
Hu3DAllKill();
HuSprClose();
HuSprInit();
espInit();
HuPrcVSleep();
sprite = espEntry(0x860020, 5000, 0);
espPosSet(sprite, 288.0, 240.0);
espAttrReset(sprite, 4);
Hu3DBGColorSet(0, 0, 0);
WipeCreate(WIPE_MODE_IN, WIPE_TYPE_NORMAL, 20);
while(WipeStatGet()) {
HuPrcVSleep();
}
if(GWSaveModeGet() == 2) {
GWSystem.save_mode = 1;
}
if(GWPartyGet() == 1) {
GWGameStat.party_continue = 1;
SLSaveBoard();
} else {
GWGameStat.story_continue = 1;
SLSaveBoardStory();
}
SLCommonSet();
if(SLSave()) {
saveExecF = 1;
} else {
GWSystem.save_mode = 1;
}
WipeCreate(WIPE_MODE_OUT, WIPE_TYPE_NORMAL, 20);
while(WipeStatGet()) {
HuPrcVSleep();
}
}
s32 lbl_1_data_468[] = {
DATADIR_MARIOMDL1,
DATADIR_LUIGIMDL1,
DATADIR_PEACHMDL1,
DATADIR_YOSHIMDL1,
DATADIR_WARIOMDL1,
DATADIR_DONKEYMDL1,
DATADIR_DAISYMDL1,
DATADIR_WALUIGIMDL1
};
Vec lbl_1_data_488[] = {
{ 160, 185, 500 },
{ 240, 185, 500 },
{ 160, 355, 500 },
{ 240, 355, 500 },
};
void fn_1_47FC(void)
{
}

View file

@ -578,11 +578,11 @@ void SLCurSlotNoSet(void);
void SLSaveDataMake(void);
void SLCommonSet(void);
void SLSaveBoard(void);
void SLSaveBoardBackup(void);
void SLSaveBoardStory(void);
void SLSave(void);
void SLLoadGameStat(void);
void SLLoadBoard(void);
void SLLoadBoardBackup(void);
void SLLoadBoardStory(void);
void SLLoad(void);
void SLCurBoxNoSet(void);
void SLSaveFlagSet(void);
@ -1595,11 +1595,11 @@ extern void _kerjmp_SLCurSlotNoSet(void);
extern void _kerjmp_SLSaveDataMake(void);
extern void _kerjmp_SLCommonSet(void);
extern void _kerjmp_SLSaveBoard(void);
extern void _kerjmp_SLSaveBoardBackup(void);
extern void _kerjmp_SLSaveBoardStory(void);
extern void _kerjmp_SLSave(void);
extern void _kerjmp_SLLoadGameStat(void);
extern void _kerjmp_SLLoadBoard(void);
extern void _kerjmp_SLLoadBoardBackup(void);
extern void _kerjmp_SLLoadBoardStory(void);
extern void _kerjmp_SLLoad(void);
extern void _kerjmp_SLCurBoxNoSet(void);
extern void _kerjmp_SLSaveFlagSet(void);
@ -3195,16 +3195,16 @@ asm void _kerent(void) {
b SLCommonSet
entry _kerjmp_SLSaveBoard
b SLSaveBoard
entry _kerjmp_SLSaveBoardBackup
b SLSaveBoardBackup
entry _kerjmp_SLSaveBoardStory
b SLSaveBoardStory
entry _kerjmp_SLSave
b SLSave
entry _kerjmp_SLLoadGameStat
b SLLoadGameStat
entry _kerjmp_SLLoadBoard
b SLLoadBoard
entry _kerjmp_SLLoadBoardBackup
b SLLoadBoardBackup
entry _kerjmp_SLLoadBoardStory
b SLLoadBoardStory
entry _kerjmp_SLLoad
b SLLoad
entry _kerjmp_SLCurBoxNoSet

View file

@ -12,7 +12,7 @@
#include "stddef.h"
#define SAVE_GET_PLAYER(player_idx) &saveBuf.buf[((player_idx)*sizeof(PlayerState))+offsetof(SaveBufData, player)]
#define SAVE_GET_PLAYER_BACKUP(player_idx) &saveBuf.buf[((player_idx)*sizeof(PlayerState))+offsetof(SaveBufData, playerBackup)]
#define SAVE_GET_PLAYER_STORY(player_idx) &saveBuf.buf[((player_idx)*sizeof(PlayerState))+offsetof(SaveBufData, playerStory)]
static s16 SLCreateSaveWin(void);
static void SLKillSaveWin(void);
@ -319,12 +319,12 @@ void SLSaveBoard(void) {
}
}
void SLSaveBoardBackup(void) {
void SLSaveBoardStory(void) {
s16 i;
memcpy(&saveBuf.data.systemBackup, &GWSystem, sizeof(SystemState));
memcpy(&saveBuf.data.systemStory, &GWSystem, sizeof(SystemState));
for (i = 0; i < 4; i++) {
memcpy(SAVE_GET_PLAYER_BACKUP(i), &GWPlayer[i], sizeof(PlayerState));
memcpy(SAVE_GET_PLAYER_STORY(i), &GWPlayer[i], sizeof(PlayerState));
}
}
@ -470,12 +470,12 @@ void SLLoadBoard(void) {
}
}
void SLLoadBoardBackup(void) {
void SLLoadBoardStory(void) {
s16 i;
memcpy(&GWSystem, &saveBuf.data.systemBackup, 0xDC);
memcpy(&GWSystem, &saveBuf.data.systemStory, 0xDC);
for (i = 0; i < 4; i++) {
memcpy(&GWPlayer[i], SAVE_GET_PLAYER_BACKUP(i), sizeof(PlayerState));
memcpy(&GWPlayer[i], SAVE_GET_PLAYER_STORY(i), sizeof(PlayerState));
GWPlayerCfg[i].character = GWPlayer[i].character;
GWPlayerCfg[i].pad_idx = GWPlayer[i].port;
GWPlayerCfg[i].diff = GWPlayer[i].diff;