mirror of
https://github.com/pmret/papermario.git
synced 2024-11-08 12:02:30 +01:00
match some cursed funcs + cleanup
This commit is contained in:
parent
7d1dd6058a
commit
c1df09dba8
@ -1,33 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
glabel func_8004DA0C
|
||||
/* 28E0C 8004DA0C 27BDFFE0 */ addiu $sp, $sp, -0x20
|
||||
/* 28E10 8004DA10 AFB10014 */ sw $s1, 0x14($sp)
|
||||
/* 28E14 8004DA14 0080882D */ daddu $s1, $a0, $zero
|
||||
/* 28E18 8004DA18 AFB00010 */ sw $s0, 0x10($sp)
|
||||
/* 28E1C 8004DA1C 0000802D */ daddu $s0, $zero, $zero
|
||||
/* 28E20 8004DA20 1220000D */ beqz $s1, .L8004DA58
|
||||
/* 28E24 8004DA24 AFBF0018 */ sw $ra, 0x18($sp)
|
||||
/* 28E28 8004DA28 0C0135E5 */ jal func_8004D794
|
||||
/* 28E2C 8004DA2C 00000000 */ nop
|
||||
/* 28E30 8004DA30 0040202D */ daddu $a0, $v0, $zero
|
||||
/* 28E34 8004DA34 50800009 */ beql $a0, $zero, .L8004DA5C
|
||||
/* 28E38 8004DA38 24100002 */ addiu $s0, $zero, 2
|
||||
/* 28E3C 8004DA3C 8C82001C */ lw $v0, 0x1c($a0)
|
||||
/* 28E40 8004DA40 16220007 */ bne $s1, $v0, .L8004DA60
|
||||
/* 28E44 8004DA44 0200102D */ daddu $v0, $s0, $zero
|
||||
/* 28E48 8004DA48 0C0136AA */ jal func_8004DAA8
|
||||
/* 28E4C 8004DA4C 00000000 */ nop
|
||||
/* 28E50 8004DA50 08013698 */ j .L8004DA60
|
||||
/* 28E54 8004DA54 0200102D */ daddu $v0, $s0, $zero
|
||||
.L8004DA58:
|
||||
/* 28E58 8004DA58 24100003 */ addiu $s0, $zero, 3
|
||||
.L8004DA5C:
|
||||
/* 28E5C 8004DA5C 0200102D */ daddu $v0, $s0, $zero
|
||||
.L8004DA60:
|
||||
/* 28E60 8004DA60 8FBF0018 */ lw $ra, 0x18($sp)
|
||||
/* 28E64 8004DA64 8FB10014 */ lw $s1, 0x14($sp)
|
||||
/* 28E68 8004DA68 8FB00010 */ lw $s0, 0x10($sp)
|
||||
/* 28E6C 8004DA6C 03E00008 */ jr $ra
|
||||
/* 28E70 8004DA70 27BD0020 */ addiu $sp, $sp, 0x20
|
@ -1,11 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
glabel func_800559C4
|
||||
/* 30DC4 800559C4 27BDFFE8 */ addiu $sp, $sp, -0x18
|
||||
/* 30DC8 800559C8 AFBF0010 */ sw $ra, 0x10($sp)
|
||||
/* 30DCC 800559CC 0C013683 */ jal func_8004DA0C
|
||||
/* 30DD0 800559D0 00000000 */ nop
|
||||
/* 30DD4 800559D4 8FBF0010 */ lw $ra, 0x10($sp)
|
||||
/* 30DD8 800559D8 03E00008 */ jr $ra
|
||||
/* 30DDC 800559DC 27BD0018 */ addiu $sp, $sp, 0x18
|
@ -167,6 +167,6 @@ extern s16 gMusicUnkVolume;
|
||||
extern s16 gMusicUnkVolume2;
|
||||
extern s16 gMusicCurrentVolume;
|
||||
extern s16 gMusicTargetVolume;
|
||||
extern MusicPlayer gMusicPlayers[];
|
||||
extern MusicPlayer gMusicPlayers[]; // TODO: how many?
|
||||
|
||||
#endif
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "common.h"
|
||||
#include "code_28910_len_5090.h"
|
||||
|
||||
INCLUDE_ASM(s32, "code_28910_len_5090", func_8004D510);
|
||||
|
||||
@ -6,11 +6,41 @@ INCLUDE_ASM(s32, "code_28910_len_5090", func_8004D794);
|
||||
|
||||
INCLUDE_ASM(s32, "code_28910_len_5090", func_8004D7E0);
|
||||
|
||||
INCLUDE_ASM(s32, "code_28910_len_5090", func_8004DA0C);
|
||||
s32 func_8004DA0C(UNK_TYPE arg0) {
|
||||
s32 ret = 0;
|
||||
|
||||
if (arg0 != 0) {
|
||||
UnkStructFor8004DAA8* unknown;
|
||||
|
||||
do {
|
||||
unknown = func_8004D794();
|
||||
} while (0);
|
||||
|
||||
do {
|
||||
if (unknown == NULL) {
|
||||
ret = 2;
|
||||
} else if (arg0 == unknown->unk_01C) {
|
||||
func_8004DAA8(unknown);
|
||||
ret = 0;
|
||||
}
|
||||
} while (0);
|
||||
} else {
|
||||
ret = 3;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "code_28910_len_5090", func_8004DA74);
|
||||
|
||||
INCLUDE_ASM(s32, "code_28910_len_5090", func_8004DAA8);
|
||||
void func_8004DAA8(UnkStructFor8004DAA8 *arg0) {
|
||||
if (arg0->unk_221 != 0) {
|
||||
arg0->unk_221 = 4;
|
||||
arg0->unk_010 = 1;
|
||||
arg0->unk_008 = 1;
|
||||
func_80053A18(&arg0->unk_02C);
|
||||
}
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "code_28910_len_5090", func_8004DAE0);
|
||||
|
||||
|
22
src/code_28910_len_5090.h
Normal file
22
src/code_28910_len_5090.h
Normal file
@ -0,0 +1,22 @@
|
||||
#ifndef _CODE_28910_LEN_5090_H_
|
||||
#define _CODE_28910_LEN_5090_H_
|
||||
|
||||
#include "common.h"
|
||||
#include "code_2e230_len_2190.h"
|
||||
|
||||
typedef struct {
|
||||
/* 0x000 */ char unk_000[8];
|
||||
/* 0x008 */ s32 unk_008;
|
||||
/* 0x00C */ char unk_00C[4];
|
||||
/* 0x010 */ s32 unk_010;
|
||||
/* 0x014 */ char unk_014[8];
|
||||
/* 0x01C */ UNK_TYPE unk_01C;
|
||||
/* 0x020 */ char unk_020[0xC];
|
||||
/* 0x02C */ UnkStructFor80053A18 unk_02C;
|
||||
/* 0x03C */ char unk_03C[0x1E5];
|
||||
/* 0x221 */ u8 unk_221;
|
||||
} UnkStructFor8004DAA8; // size unknown
|
||||
|
||||
void func_8004DAA8(UnkStructFor8004DAA8* arg0);
|
||||
|
||||
#endif
|
@ -1,4 +1,4 @@
|
||||
#include "common.h"
|
||||
#include "code_2e230_len_2190.h"
|
||||
|
||||
INCLUDE_ASM(s32, "code_2e230_len_2190", func_80052E30);
|
||||
|
||||
@ -24,7 +24,11 @@ INCLUDE_ASM(s32, "code_2e230_len_2190", func_800538F8);
|
||||
|
||||
INCLUDE_ASM(s32, "code_2e230_len_2190", func_80053974);
|
||||
|
||||
INCLUDE_ASM(s32, "code_2e230_len_2190", func_80053A18);
|
||||
void func_80053A18(UnkStructFor80053A18* arg0) {
|
||||
arg0->unk_0A = 0;
|
||||
arg0->unk_04 = 0;
|
||||
arg0->unk_0C = 0;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "code_2e230_len_2190", func_80053A28);
|
||||
|
||||
|
17
src/code_2e230_len_2190.h
Normal file
17
src/code_2e230_len_2190.h
Normal file
@ -0,0 +1,17 @@
|
||||
#ifndef _CODE_2E230_LEN_2190_H_
|
||||
#define _CODE_2E230_LEN_2190_H_
|
||||
|
||||
#include "common.h"
|
||||
|
||||
// Probably some libultra audio thing
|
||||
typedef struct UnkStructFor80053A18 {
|
||||
/* 0x00 */ UNK_TYPE unk_00;
|
||||
/* 0x04 */ s32 unk_04;
|
||||
/* 0x08 */ char unk_08[2];
|
||||
/* 0x0A */ u16 unk_0A;
|
||||
/* 0x0C */ s32 unk_0C;
|
||||
} UnkStructFor80053A18; // size unknown
|
||||
|
||||
void func_80053A18(UnkStructFor80053A18* arg0);
|
||||
|
||||
#endif
|
@ -70,7 +70,9 @@ INCLUDE_ASM(s32, "code_303c0_len_3e10", func_8005591C);
|
||||
|
||||
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_80055970);
|
||||
|
||||
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_800559C4);
|
||||
s32 func_800559C4(UNK_TYPE arg0) {
|
||||
return func_8004DA0C(arg0);
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "code_303c0_len_3e10", func_800559E0);
|
||||
|
||||
|
@ -19,7 +19,8 @@ s32 _set_music_track(s32 playerIndex, s32 songID, s32 variation, s32 fadeOutTime
|
||||
if (gameStatus->demoState != 0) {
|
||||
return 1;
|
||||
} else {
|
||||
MusicPlayer* musicPlayers = &gMusicPlayers;
|
||||
// TODO: these two lines likely a MUSIC_PLAYER(idx) macro
|
||||
MusicPlayer* musicPlayers = gMusicPlayers;
|
||||
MusicPlayer* musicPlayer = &musicPlayers[playerIndex];
|
||||
|
||||
if (!gameStatus->musicEnabled) {
|
||||
@ -57,7 +58,7 @@ s32 _set_music_track(s32 playerIndex, s32 songID, s32 variation, s32 fadeOutTime
|
||||
}
|
||||
|
||||
s32 set_music_track(s32 playerIndex, s32 songID, s32 variation, s32 fadeOutTime, s16 volume) {
|
||||
MusicPlayer* musicPlayers = &gMusicPlayers;
|
||||
MusicPlayer* musicPlayers = gMusicPlayers;
|
||||
|
||||
musicPlayers[playerIndex].flags &= ~8;
|
||||
|
||||
@ -70,7 +71,7 @@ s32 func_8014A964(s32 playerIndex, s32 songID, s32 variation, s32 fadeInTime, s1
|
||||
if (gameStatus->demoState != 0) {
|
||||
return 1;
|
||||
} else {
|
||||
MusicPlayer* musicPlayers = &gMusicPlayers;
|
||||
MusicPlayer* musicPlayers = gMusicPlayers;
|
||||
MusicPlayer* musicPlayer = &musicPlayers[playerIndex];
|
||||
|
||||
if (!gameStatus->musicEnabled) {
|
||||
@ -99,7 +100,7 @@ s32 func_8014A964(s32 playerIndex, s32 songID, s32 variation, s32 fadeInTime, s1
|
||||
}
|
||||
|
||||
s32 func_8014AA54(s32 playerIndex, s32 arg1, s16 arg2) {
|
||||
MusicPlayer* musicPlayers = &gMusicPlayers;
|
||||
MusicPlayer* musicPlayers = gMusicPlayers;
|
||||
MusicPlayer* musicPlayer = &musicPlayers[playerIndex];
|
||||
|
||||
if (!(musicPlayer->flags & 1)) {
|
||||
@ -126,7 +127,7 @@ s32 func_8014AA54(s32 playerIndex, s32 arg1, s16 arg2) {
|
||||
}
|
||||
|
||||
s32 func_8014AB0C(s32 playerIndex, s16 arg1) {
|
||||
MusicPlayer* musicPlayers = &gMusicPlayers;
|
||||
MusicPlayer* musicPlayers = gMusicPlayers;
|
||||
MusicPlayer* musicPlayer = &musicPlayers[playerIndex];
|
||||
|
||||
if (!(musicPlayer->flags & 1)) {
|
||||
@ -137,7 +138,7 @@ s32 func_8014AB0C(s32 playerIndex, s16 arg1) {
|
||||
}
|
||||
|
||||
s32 func_8014AB60(s32 playerIndex, s16 arg1) {
|
||||
MusicPlayer* musicPlayers = &gMusicPlayers;
|
||||
MusicPlayer* musicPlayers = gMusicPlayers;
|
||||
MusicPlayer* musicPlayer = &musicPlayers[playerIndex];
|
||||
|
||||
if (!(musicPlayer->flags & 1)) {
|
||||
@ -148,7 +149,7 @@ s32 func_8014AB60(s32 playerIndex, s16 arg1) {
|
||||
}
|
||||
|
||||
s32 func_8014ABB4(s32 playerIndex, s16 arg1) {
|
||||
MusicPlayer* musicPlayers = &gMusicPlayers;
|
||||
MusicPlayer* musicPlayers = gMusicPlayers;
|
||||
MusicPlayer* musicPlayer = &musicPlayers[playerIndex];
|
||||
|
||||
if (!(musicPlayer->flags & 1)) {
|
||||
|
Loading…
Reference in New Issue
Block a user