mirror of
https://github.com/zestydevy/marioparty3.git
synced 2024-11-23 05:19:51 +00:00
fix some typing of stuff for to remove warnings
This commit is contained in:
parent
8104e85451
commit
5b18633b97
14
decomp.yaml
Normal file
14
decomp.yaml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
name: Mario Party 3
|
||||||
|
github: https://github.com/zestydevy/marioparty3
|
||||||
|
platform: n64
|
||||||
|
versions:
|
||||||
|
- name: mp3
|
||||||
|
fullname: MP3
|
||||||
|
paths:
|
||||||
|
baserom: "baserom.us.z64"
|
||||||
|
build: "build/marioparty3.z64"
|
||||||
|
asm: "asm"
|
||||||
|
nonmatchings: "asm/nonmatchings"
|
||||||
|
map: "build/marioparty3.map"
|
||||||
|
elf: "build/marioparty3.elf"
|
||||||
|
tools:
|
@ -4,5 +4,5 @@
|
|||||||
#include "libultra.h"
|
#include "libultra.h"
|
||||||
#include "include_asm.h"
|
#include "include_asm.h"
|
||||||
#include "variables.h"
|
#include "variables.h"
|
||||||
|
#include "functions.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -143,6 +143,16 @@ typedef struct {
|
|||||||
s8 unk35;
|
s8 unk35;
|
||||||
|
|
||||||
// s8 pad2[3];
|
// s8 pad2[3];
|
||||||
} Player; // sizeof 0x38 | 56
|
} Player; // sizeof 0x38 | 56
|
||||||
|
|
||||||
|
typedef struct SpaceData {
|
||||||
|
/* 0x00 */ s8 unk_00;
|
||||||
|
/* 0x01 */ u8 space_type; // enum board_space_type
|
||||||
|
/* 0x02 */ s16 unk_02;
|
||||||
|
/* 0x04 */ s32 unk_04;
|
||||||
|
/* 0x08 */ HuVec3F coords;
|
||||||
|
/* 0x14 */ HuVec3F rot;
|
||||||
|
/* 0x20 */ void* event_list;
|
||||||
|
} SpaceData;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -55,19 +55,19 @@ typedef struct
|
|||||||
void * bytesCopy;
|
void * bytesCopy;
|
||||||
} HuFileInfoD;
|
} HuFileInfoD;
|
||||||
|
|
||||||
extern u32 gArchiveRomAddr; // FS ROM location
|
extern u8* gArchiveRomAddr; // FS ROM location
|
||||||
extern u32 gArchiveDirCount; // Directory count
|
extern u32 gArchiveDirCount; // Directory count
|
||||||
extern s32 * gArchiveTblAddr; // Directory offset table pointer.
|
extern s32* gArchiveTblAddr; // Directory offset table pointer.
|
||||||
|
|
||||||
extern u32 gArchiveRomAddrCopy; // FS ROM location (copy)
|
extern u8* gArchiveRomAddrCopy; // FS ROM location (copy)
|
||||||
extern u32 gArchiveDirCountCopy; // Directory count (copy)
|
extern u32 gArchiveDirCountCopy; // Directory count (copy)
|
||||||
extern s32 * gArchiveTblAddrCopy; // Directory offset table pointer (copy)
|
extern s32* gArchiveTblAddrCopy; // Directory offset table pointer (copy)
|
||||||
|
|
||||||
extern HuArchive gArchive;
|
extern HuArchive gArchive;
|
||||||
|
|
||||||
void HuInitArchive(u32 fsRomPtr);
|
void HuInitArchive(u8* fsRomPtr);
|
||||||
void HuInitFileInfo(EArchiveType type, s32 index, HuFileInfo * info);
|
void HuInitFileInfo(EArchiveType type, s32 index, HuFileInfo * info);
|
||||||
void * LoadFormBinary(s32 dirAndFile);
|
void * Hu3DModelCreate(s32 dirAndFile);
|
||||||
void * HuDecodeFilePerm(EArchiveType type, s32 index);
|
void * HuDecodeFilePerm(EArchiveType type, s32 index);
|
||||||
void * HuDecodeFileTemp(EArchiveType type, s32 index);
|
void * HuDecodeFileTemp(EArchiveType type, s32 index);
|
||||||
void * HuDecodeFileTag(EArchiveType type, s32 index, s32 tag);
|
void * HuDecodeFileTag(EArchiveType type, s32 index, s32 tag);
|
||||||
|
9
include/functions.h
Normal file
9
include/functions.h
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#ifndef _FUNCTIONS_H_
|
||||||
|
#define _FUNCTIONS_H_
|
||||||
|
|
||||||
|
#include <PR/ultratypes.h>
|
||||||
|
|
||||||
|
//global function definitions
|
||||||
|
u8 rand8(void);
|
||||||
|
|
||||||
|
#endif
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
|
|
||||||
s32 HuStartDma(OSIoMesg * msg, u8 pri, s32 direction, u32 src, void * dest, u32 size, OSMesgQueue * retQueue);
|
s32 HuStartDma(OSIoMesg * msg, u8 pri, s32 direction, u32 src, void * dest, u32 size, OSMesgQueue * retQueue);
|
||||||
s32 HuRomDmaRead(void * src, void * dest, s32 size);
|
s32 HuRomDmaRead(u8* src, u8* dest, s32 size);
|
||||||
s32 HuRomDmaCodeRead(void * src, void * dest, s32 size);
|
s32 HuRomDmaCodeRead(u8* src, u8* dest, s32 size);
|
||||||
|
|
||||||
#endif
|
#endif
|
32
src/data.c
32
src/data.c
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
// -----------------------------------------------------------------
|
// -----------------------------------------------------------------
|
||||||
|
|
||||||
void HuInitArchive(u32 fsRomPtr)
|
void HuInitArchive(u8* fsRomPtr)
|
||||||
{
|
{
|
||||||
s32 dirTblSize;
|
s32 dirTblSize;
|
||||||
HuArchive * archiveHeader;
|
HuArchive * archiveHeader;
|
||||||
@ -15,13 +15,13 @@ void HuInitArchive(u32 fsRomPtr)
|
|||||||
gArchiveRomAddr = fsRomPtr;
|
gArchiveRomAddr = fsRomPtr;
|
||||||
archiveHeader = &gArchive;
|
archiveHeader = &gArchive;
|
||||||
|
|
||||||
HuRomDmaRead(fsRomPtr, archiveHeader, 16);
|
HuRomDmaRead(fsRomPtr, (u8*)archiveHeader, 16);
|
||||||
|
|
||||||
gArchiveDirCount = archiveHeader->count;
|
gArchiveDirCount = archiveHeader->count;
|
||||||
dirTblSize = archiveHeader->count * 4;
|
dirTblSize = archiveHeader->count * 4;
|
||||||
gArchiveTblAddr = (s32 *)HuMemMemoryAllocPerm(dirTblSize);
|
gArchiveTblAddr = (s32 *)HuMemMemoryAllocPerm(dirTblSize);
|
||||||
|
|
||||||
HuRomDmaRead(fsRomPtr + 4, gArchiveTblAddr, dirTblSize);
|
HuRomDmaRead((u8*)fsRomPtr + 4, (u8*)gArchiveTblAddr, dirTblSize);
|
||||||
|
|
||||||
gArchiveRomAddrCopy = gArchiveRomAddr;
|
gArchiveRomAddrCopy = gArchiveRomAddr;
|
||||||
gArchiveDirCountCopy = gArchiveDirCount;
|
gArchiveDirCountCopy = gArchiveDirCount;
|
||||||
@ -30,9 +30,9 @@ void HuInitArchive(u32 fsRomPtr)
|
|||||||
|
|
||||||
// -----------------------------------------------------------------
|
// -----------------------------------------------------------------
|
||||||
|
|
||||||
void HuInitFileInfo(EArchiveType type, s32 index, HuFileInfo * info)
|
void HuInitFileInfo(EArchiveType type, s32 index, HuFileInfo* info)
|
||||||
{
|
{
|
||||||
HuArchive * archiveHeader;
|
HuArchive* archiveHeader;
|
||||||
archiveHeader = &gArchive;
|
archiveHeader = &gArchive;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
@ -44,7 +44,7 @@ void HuInitFileInfo(EArchiveType type, s32 index, HuFileInfo * info)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
HuRomDmaRead(info->bytes, archiveHeader, 16);
|
HuRomDmaRead(info->bytes, (u8*)archiveHeader, 16);
|
||||||
|
|
||||||
info->bytes += 8;
|
info->bytes += 8;
|
||||||
info->size = archiveHeader->count;
|
info->size = archiveHeader->count;
|
||||||
@ -57,7 +57,7 @@ void HuInitFileInfo(EArchiveType type, s32 index, HuFileInfo * info)
|
|||||||
* Reads a file from the main filesystem and decodes it.
|
* Reads a file from the main filesystem and decodes it.
|
||||||
* File is in the permanent heap.
|
* File is in the permanent heap.
|
||||||
*/
|
*/
|
||||||
void * ReadMainFS(s32 dirAndFile)
|
void* ReadMainFS(s32 dirAndFile)
|
||||||
{
|
{
|
||||||
u32 dir;
|
u32 dir;
|
||||||
u32 file;
|
u32 file;
|
||||||
@ -78,7 +78,7 @@ void * ReadMainFS(s32 dirAndFile)
|
|||||||
|
|
||||||
// -----------------------------------------------------------------
|
// -----------------------------------------------------------------
|
||||||
|
|
||||||
void * HuReadFileTemp(s32 dirAndFile)
|
void* HuReadFileTemp(s32 dirAndFile)
|
||||||
{
|
{
|
||||||
u32 dir;
|
u32 dir;
|
||||||
u32 file;
|
u32 file;
|
||||||
@ -99,9 +99,9 @@ void * HuReadFileTemp(s32 dirAndFile)
|
|||||||
|
|
||||||
// -----------------------------------------------------------------
|
// -----------------------------------------------------------------
|
||||||
|
|
||||||
void * HuReadFileTag(s32 dirAndFile, s32 tag)
|
void* HuReadFileTag(s32 dirAndFile, s32 tag)
|
||||||
{
|
{
|
||||||
s32 dir;
|
u32 dir;
|
||||||
u32 file;
|
u32 file;
|
||||||
|
|
||||||
dir = dirAndFile >> 16;
|
dir = dirAndFile >> 16;
|
||||||
@ -191,7 +191,7 @@ void HuFreeFileTemp(void * data)
|
|||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
s32 tablePtr;
|
u8* tablePtr;
|
||||||
s32 unk0004; // not used
|
s32 unk0004; // not used
|
||||||
s32 unk0008; // not used
|
s32 unk0008; // not used
|
||||||
s32 unk000C; // not used
|
s32 unk000C; // not used
|
||||||
@ -203,7 +203,7 @@ void HuInitDirectory(EArchiveType type, s32 dir)
|
|||||||
HuArchive * fsHeader;
|
HuArchive * fsHeader;
|
||||||
HuDataInfo info;
|
HuDataInfo info;
|
||||||
|
|
||||||
info.tablePtr = gArchiveRomAddr + gArchiveTblAddr[dir];
|
info.tablePtr = &gArchiveRomAddr[gArchiveTblAddr[dir]];
|
||||||
|
|
||||||
if (gArchiveRomAddrCopy != info.tablePtr) {
|
if (gArchiveRomAddrCopy != info.tablePtr) {
|
||||||
if (gArchiveRomAddrCopy != gArchiveRomAddr) {
|
if (gArchiveRomAddrCopy != gArchiveRomAddr) {
|
||||||
@ -213,13 +213,13 @@ void HuInitDirectory(EArchiveType type, s32 dir)
|
|||||||
gArchiveRomAddrCopy = info.tablePtr;
|
gArchiveRomAddrCopy = info.tablePtr;
|
||||||
|
|
||||||
fsHeader = &gArchive;
|
fsHeader = &gArchive;
|
||||||
HuRomDmaRead(gArchiveRomAddrCopy, fsHeader, 16);
|
HuRomDmaRead(gArchiveRomAddrCopy, (u8*)fsHeader, 16);
|
||||||
|
|
||||||
gArchiveDirCountCopy = gArchive.count;
|
gArchiveDirCountCopy = gArchive.count;
|
||||||
dirCount = gArchiveDirCountCopy * 4;
|
dirCount = gArchiveDirCountCopy * 4;
|
||||||
gArchiveTblAddrCopy = HuMemMemoryAllocPerm(dirCount);
|
gArchiveTblAddrCopy = HuMemMemoryAllocPerm(dirCount);
|
||||||
|
|
||||||
HuRomDmaRead((u32)(info.tablePtr + 4), gArchiveTblAddrCopy, dirCount);
|
HuRomDmaRead((info.tablePtr + 4), (u8*)gArchiveTblAddrCopy, dirCount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -285,7 +285,7 @@ s32 func_8000A028_AC28(HuFileInfoD * info)
|
|||||||
s32 func_8000A0D4_ACD4(s8 * arg0, s32 arg1, s32 arg2, HuFileInfoD * arg3)
|
s32 func_8000A0D4_ACD4(s8 * arg0, s32 arg1, s32 arg2, HuFileInfoD * arg3)
|
||||||
{
|
{
|
||||||
s32 temp_v0;
|
s32 temp_v0;
|
||||||
s8 * var_s1;
|
s8* var_s1;
|
||||||
|
|
||||||
s32 i = 0;
|
s32 i = 0;
|
||||||
s32 b = arg1 * arg2;
|
s32 b = arg1 * arg2;
|
||||||
@ -293,7 +293,7 @@ s32 func_8000A0D4_ACD4(s8 * arg0, s32 arg1, s32 arg2, HuFileInfoD * arg3)
|
|||||||
|
|
||||||
while (TRUE)
|
while (TRUE)
|
||||||
{
|
{
|
||||||
s32 temp_v0 = func_8000A028_AC28(arg3);
|
temp_v0 = func_8000A028_AC28(arg3);
|
||||||
|
|
||||||
if (temp_v0 == -1) {
|
if (temp_v0 == -1) {
|
||||||
break;
|
break;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "hmfman", func_8001A070_1AC70);
|
INCLUDE_ASM(s32, "hmfman", func_8001A070_1AC70);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "hmfman", LoadFormBinary);
|
INCLUDE_ASM(s32, "hmfman", Hu3DModelCreate);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "hmfman", func_8001A61C_1B21C);
|
INCLUDE_ASM(s32, "hmfman", func_8001A61C_1B21C);
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
extern s8 TotalTurns;
|
extern s8 gTotalTurns;
|
||||||
extern s8 CurrentTurn;
|
extern s8 gCurrentTurn;
|
||||||
s32 rand8(void);
|
u8 rand8(void);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "overlays/shared_board/1006F0", func_800ECAD0_1006F0);
|
INCLUDE_ASM(s32, "overlays/shared_board/1006F0", func_800ECAD0_1006F0);
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ s16 RNGPercentChance(s8 arg0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
s16 GetTurnsElapsed(void) {
|
s16 GetTurnsElapsed(void) {
|
||||||
return (TotalTurns - CurrentTurn) + 1;
|
return (gTotalTurns - gCurrentTurn) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "overlays/shared_board/1006F0", func_800ECF18_100B38);
|
INCLUDE_ASM(s32, "overlays/shared_board/1006F0", func_800ECF18_100B38);
|
||||||
|
@ -71,7 +71,17 @@ INCLUDE_ASM(s32, "overlays/shared_board/101840", func_800EECF0_102910);
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "overlays/shared_board/101840", func_800EEE84_102AA4);
|
INCLUDE_ASM(s32, "overlays/shared_board/101840", func_800EEE84_102AA4);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "overlays/shared_board/101840", func_800EEF80_102BA0);
|
s32 func_800EEF80_102BA0(f32 arg0) {
|
||||||
|
// rand8 returns an unsigned byte
|
||||||
|
u8 randomByte1 = rand8();
|
||||||
|
u8 randomByte2 = rand8();
|
||||||
|
s32 shiftedByte1 = (randomByte1 << 8);
|
||||||
|
|
||||||
|
// Normalize the 16-bit number to the range [0, 1), then multiply by arg0
|
||||||
|
s32 scaledRandom = ((randomByte2 | shiftedByte1) / 65536.0f) * arg0;
|
||||||
|
|
||||||
|
return scaledRandom;
|
||||||
|
}
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "overlays/shared_board/101840", func_800EEFEC_102C0C);
|
INCLUDE_ASM(s32, "overlays/shared_board/101840", func_800EEFEC_102C0C);
|
||||||
|
|
||||||
|
@ -88,7 +88,63 @@ INCLUDE_ASM(s32, "overlays/shared_board/10C230", func_800FC3D0_10FFF0);
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "overlays/shared_board/10C230", func_800FC4E0_110100);
|
INCLUDE_ASM(s32, "overlays/shared_board/10C230", func_800FC4E0_110100);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "overlays/shared_board/10C230", func_800FC594_1101B4);
|
extern s16 gCoinBlockSpaceIndex;
|
||||||
|
extern s16 gStarBlockSpaceIndex;
|
||||||
|
extern s16 gItemBlockSpaceIndex;
|
||||||
|
extern u16 D_800D03FC;
|
||||||
|
extern u16 D_800CE208;
|
||||||
|
extern u16 D_800CDD68;
|
||||||
|
|
||||||
|
extern s16 gPrevCoinBlockIndexes[];
|
||||||
|
extern s16 gPrevStarBlockIndexes[];
|
||||||
|
extern s16 gPrevItemBlockIndexes[];
|
||||||
|
|
||||||
|
s16 func_800EBCD4_FF8F4(u8);
|
||||||
|
s32 _CheckFlag(s32 input);
|
||||||
|
|
||||||
|
void func_800FC594_1101B4(void) {
|
||||||
|
s32 i;
|
||||||
|
|
||||||
|
if (_CheckFlag(0xF) != 0) {
|
||||||
|
while (gCoinBlockSpaceIndex == -1 || gCoinBlockSpaceIndex == gStarBlockSpaceIndex || gCoinBlockSpaceIndex == gItemBlockSpaceIndex) {
|
||||||
|
gCoinBlockSpaceIndex = func_800EBCD4_FF8F4(D_800D03FC);
|
||||||
|
D_800D03FC += 1;
|
||||||
|
for (i = 0; i < 10; i++) {
|
||||||
|
if (gCoinBlockSpaceIndex == gPrevCoinBlockIndexes[i]) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (i != 0xA) {
|
||||||
|
gCoinBlockSpaceIndex = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (gStarBlockSpaceIndex == -1 || gCoinBlockSpaceIndex == gStarBlockSpaceIndex || gItemBlockSpaceIndex == gStarBlockSpaceIndex) {
|
||||||
|
gStarBlockSpaceIndex = func_800EBCD4_FF8F4(D_800CE208);
|
||||||
|
D_800CE208 += 1;
|
||||||
|
for (i = 0; i < 10; i++) {
|
||||||
|
if (gStarBlockSpaceIndex == gPrevStarBlockIndexes[i]) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (i != 0xA) {
|
||||||
|
gStarBlockSpaceIndex = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
while (gItemBlockSpaceIndex == -1 || gCoinBlockSpaceIndex == gItemBlockSpaceIndex || gStarBlockSpaceIndex == gItemBlockSpaceIndex) {
|
||||||
|
gItemBlockSpaceIndex = func_800EBCD4_FF8F4(D_800CDD68);
|
||||||
|
D_800CDD68 += 1;
|
||||||
|
for (i = 0; i < 10; i++) {
|
||||||
|
if (gItemBlockSpaceIndex == gPrevItemBlockIndexes[i]) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (i != 0xA) {
|
||||||
|
gItemBlockSpaceIndex = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "overlays/shared_board/10C230", func_800FC7C8_1103E8);
|
INCLUDE_ASM(s32, "overlays/shared_board/10C230", func_800FC7C8_1103E8);
|
||||||
|
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
|
extern s16 D_801054B6;
|
||||||
|
extern s16 D_801052B8[];
|
||||||
|
extern u8 D_80101468_115088[];
|
||||||
|
extern u16 D_80105210;
|
||||||
|
extern s16 D_801054B8[];
|
||||||
|
extern s16 D_801054F8; //total blue spaces hidden blocks cannot spawn on (8 unless waluigi's island, then it's 23)
|
||||||
|
SpaceData* GetSpaceData(s16 spaceIndex);
|
||||||
|
s32 func_800EEF80_102BA0(f32 arg0);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "overlays/shared_board/F5B90", func_800E1F70_F5B90);
|
INCLUDE_ASM(s32, "overlays/shared_board/F5B90", func_800E1F70_F5B90);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "overlays/shared_board/F5B90", func_800E2074_F5C94);
|
INCLUDE_ASM(s32, "overlays/shared_board/F5B90", func_800E2074_F5C94);
|
||||||
@ -370,7 +379,7 @@ INCLUDE_ASM(s32, "overlays/shared_board/F5B90", func_800EAE10_FEA30);
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "overlays/shared_board/F5B90", func_800EB09C_FECBC);
|
INCLUDE_ASM(s32, "overlays/shared_board/F5B90", func_800EB09C_FECBC);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "overlays/shared_board/F5B90", func_800EB160_FED80);
|
INCLUDE_ASM(s32, "overlays/shared_board/F5B90", GetSpaceData);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "overlays/shared_board/F5B90", func_800EB184_FEDA4);
|
INCLUDE_ASM(s32, "overlays/shared_board/F5B90", func_800EB184_FEDA4);
|
||||||
|
|
||||||
@ -386,7 +395,62 @@ INCLUDE_ASM(s32, "overlays/shared_board/F5B90", func_800EB3C0_FEFE0);
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "overlays/shared_board/F5B90", func_800EB4F0_FF110);
|
INCLUDE_ASM(s32, "overlays/shared_board/F5B90", func_800EB4F0_FF110);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "overlays/shared_board/F5B90", func_800EB5DC_FF1FC);
|
s16 func_800EB5DC_FF1FC(u16 arg0, u8 arg1) {
|
||||||
|
u8 var_s1;
|
||||||
|
SpaceData* temp_a1;
|
||||||
|
s32 i, j;
|
||||||
|
var_s1 = 0;
|
||||||
|
|
||||||
|
for (i = 0; i < D_80105210; i++) {
|
||||||
|
temp_a1 = GetSpaceData(i);
|
||||||
|
if (D_80101468_115088[temp_a1->space_type & 0xF] & arg0){
|
||||||
|
var_s1++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var_s1 -= D_801054F8;
|
||||||
|
if (arg1 < 5) {
|
||||||
|
var_s1 -= D_801054B6;
|
||||||
|
}
|
||||||
|
|
||||||
|
var_s1 = func_800EEF80_102BA0(var_s1);
|
||||||
|
|
||||||
|
for (i = 0;; i = (++i < D_80105210) ? i : 0) {
|
||||||
|
temp_a1 = GetSpaceData(i);
|
||||||
|
for (j = 0; j < D_801054F8; j++) {
|
||||||
|
if (D_801054B8[j] == i) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (j == D_801054F8) {
|
||||||
|
if (arg1 < 5) {
|
||||||
|
for (j = 0; j < D_801054B6; j++) {
|
||||||
|
if (D_801052B8[j] == i) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (j == D_801054B6) {
|
||||||
|
if (D_80101468_115088[temp_a1->space_type & 0xF] & arg0) {
|
||||||
|
if (var_s1 == 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
var_s1--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (D_80101468_115088[temp_a1->space_type & 0xF] & arg0) {
|
||||||
|
if (var_s1 == 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
var_s1--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "overlays/shared_board/F5B90", func_800EB7F0_FF410);
|
INCLUDE_ASM(s32, "overlays/shared_board/F5B90", func_800EB7F0_FF410);
|
||||||
|
|
||||||
@ -408,7 +472,9 @@ INCLUDE_ASM(s32, "overlays/shared_board/F5B90", func_800EBCBC_FF8DC);
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "overlays/shared_board/F5B90", func_800EBCC8_FF8E8);
|
INCLUDE_ASM(s32, "overlays/shared_board/F5B90", func_800EBCC8_FF8E8);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "overlays/shared_board/F5B90", func_800EBCD4_FF8F4);
|
s16 func_800EBCD4_FF8F4(u8 arg0) {
|
||||||
|
return func_800EB5DC_FF1FC(2, arg0);
|
||||||
|
}
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "overlays/shared_board/F5B90", func_800EBCFC_FF91C);
|
INCLUDE_ASM(s32, "overlays/shared_board/F5B90", func_800EBCFC_FF91C);
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ extern u8 D_800962F0_96EF0;
|
|||||||
extern u32 rnd_seed;
|
extern u32 rnd_seed;
|
||||||
extern OverlayInfo overlay_table[];
|
extern OverlayInfo overlay_table[];
|
||||||
|
|
||||||
s32 LoadFormBinary(u8* arg0, u32 arg1);
|
s32 Hu3DModelCreate(u8* arg0, u32 arg1);
|
||||||
void* ReadMainFS(s32);
|
void* ReadMainFS(s32);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "ovlman", func_8000B0A0_BCA0);
|
INCLUDE_ASM(s32, "ovlman", func_8000B0A0_BCA0);
|
||||||
@ -26,7 +26,7 @@ INCLUDE_ASM(s32, "ovlman", func_8000B0D4_BCD4);
|
|||||||
INCLUDE_ASM(s32, "ovlman", func_8000B108_BD08);
|
INCLUDE_ASM(s32, "ovlman", func_8000B108_BD08);
|
||||||
|
|
||||||
s16 func_8000B13C_BD3C(s32 arg0) {
|
s16 func_8000B13C_BD3C(s32 arg0) {
|
||||||
return LoadFormBinary(ReadMainFS(arg0), 0x1D);
|
return Hu3DModelCreate(ReadMainFS(arg0), 0x1D);
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 rand8(void) {
|
u8 rand8(void) {
|
||||||
|
20
src/rom.c
20
src/rom.c
@ -24,23 +24,23 @@ s32 HuStartDma(OSIoMesg * msg, u8 pri, s32 direction, u32 src, void * dest, u32
|
|||||||
return osEPiStartDma(D_800CDD50, msg, direction);
|
return osEPiStartDma(D_800CDD50, msg, direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 HuRomDmaRead(void * src, void * dest, s32 size)
|
s32 HuRomDmaRead(u8* src, u8* dest, s32 size)
|
||||||
{
|
{
|
||||||
OSIoMesg msg;
|
OSIoMesg msg;
|
||||||
s32 var_s1;
|
s32 curBlockOffset;
|
||||||
u32 var_v1;
|
u32 var_v1;
|
||||||
s32 err;
|
s32 err;
|
||||||
|
|
||||||
osInvalDCache(dest, OS_DCACHE_ROUNDUP_SIZE(size));
|
osInvalDCache(dest, OS_DCACHE_ROUNDUP_SIZE(size));
|
||||||
|
|
||||||
var_s1 = 0;
|
curBlockOffset = 0;
|
||||||
while (size > 0)
|
while (size > 0)
|
||||||
{
|
{
|
||||||
var_v1 = size;
|
var_v1 = size;
|
||||||
if (size >= 0x4001) {
|
if (size >= 0x4001) {
|
||||||
var_v1 = 0x4000;
|
var_v1 = 0x4000;
|
||||||
}
|
}
|
||||||
err = HuStartDma(&msg, 0, 0, src + var_s1, dest + var_s1, var_v1, &D_800B29F0);
|
err = HuStartDma(&msg, 0, 0, &src[curBlockOffset], &dest[curBlockOffset], var_v1, &D_800B29F0);
|
||||||
|
|
||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
return err;
|
return err;
|
||||||
@ -48,30 +48,30 @@ s32 HuRomDmaRead(void * src, void * dest, s32 size)
|
|||||||
|
|
||||||
osRecvMesg(&D_800B29F0, 0, 1);
|
osRecvMesg(&D_800B29F0, 0, 1);
|
||||||
size -= 0x4000;
|
size -= 0x4000;
|
||||||
var_s1 += 0x4000;
|
curBlockOffset += 0x4000;
|
||||||
|
|
||||||
}
|
}
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 HuRomDmaCodeRead(void * src, void * dest, s32 size)
|
s32 HuRomDmaCodeRead(u8* src, u8* dest, s32 size)
|
||||||
{
|
{
|
||||||
OSIoMesg msg;
|
OSIoMesg msg;
|
||||||
s32 var_s1;
|
s32 curBlockOffset;
|
||||||
u32 var_v1;
|
u32 var_v1;
|
||||||
s32 err;
|
s32 err;
|
||||||
|
|
||||||
osInvalICache(dest, OS_DCACHE_ROUNDUP_SIZE(size));
|
osInvalICache(dest, OS_DCACHE_ROUNDUP_SIZE(size));
|
||||||
osInvalDCache(dest, OS_DCACHE_ROUNDUP_SIZE(size));
|
osInvalDCache(dest, OS_DCACHE_ROUNDUP_SIZE(size));
|
||||||
|
|
||||||
var_s1 = 0;
|
curBlockOffset = 0;
|
||||||
while (size > 0)
|
while (size > 0)
|
||||||
{
|
{
|
||||||
var_v1 = size;
|
var_v1 = size;
|
||||||
if (size >= 0x4001) {
|
if (size >= 0x4001) {
|
||||||
var_v1 = 0x4000;
|
var_v1 = 0x4000;
|
||||||
}
|
}
|
||||||
err = HuStartDma(&msg, 0, 0, src + var_s1, dest + var_s1, var_v1, &D_800B29F0);
|
err = HuStartDma(&msg, 0, 0, &src[curBlockOffset], &dest[curBlockOffset], var_v1, &D_800B29F0);
|
||||||
|
|
||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
return err;
|
return err;
|
||||||
@ -79,7 +79,7 @@ s32 HuRomDmaCodeRead(void * src, void * dest, s32 size)
|
|||||||
|
|
||||||
osRecvMesg(&D_800B29F0, 0, 1);
|
osRecvMesg(&D_800B29F0, 0, 1);
|
||||||
size -= 0x4000;
|
size -= 0x4000;
|
||||||
var_s1 += 0x4000;
|
curBlockOffset += 0x4000;
|
||||||
|
|
||||||
}
|
}
|
||||||
return err;
|
return err;
|
||||||
|
@ -26,8 +26,7 @@ extern s32 D_800B1A30;
|
|||||||
|
|
||||||
s32 func_80035EB0_36AB0(s32 arg0);
|
s32 func_80035EB0_36AB0(s32 arg0);
|
||||||
|
|
||||||
void func_80035A50_36650(void)
|
void func_80035A50_36650(void) {
|
||||||
{
|
|
||||||
u8 * ptr = (u8 *)&D_800CC0C8;
|
u8 * ptr = (u8 *)&D_800CC0C8;
|
||||||
|
|
||||||
bzero(&D_800CC0C8, 0xA4);
|
bzero(&D_800CC0C8, 0xA4);
|
||||||
@ -38,8 +37,7 @@ void func_80035A50_36650(void)
|
|||||||
D_800CD059.unkF = 0;
|
D_800CD059.unkF = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_80035AA8_366A8(s8 arg0)
|
void func_80035AA8_366A8(s8 arg0) {
|
||||||
{
|
|
||||||
D_800CD068 = arg0;
|
D_800CD068 = arg0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,8 +96,7 @@ u16 func_80035C6C_3686C(s16 arg0) {
|
|||||||
return D_800CC0CA[arg0];
|
return D_800CC0CA[arg0];
|
||||||
}
|
}
|
||||||
|
|
||||||
void func_80035C84_36884(s8 arg0)
|
void func_80035C84_36884(s8 arg0) {
|
||||||
{
|
|
||||||
D_800CD059.unk0 = arg0;
|
D_800CD059.unk0 = arg0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,20 +1,96 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
|
extern u8 D_800CD0C0[];
|
||||||
|
extern s32 D_800BBAA0;
|
||||||
|
extern s32 D_800BBAA4;
|
||||||
|
extern char D_800A7B40_A8740[];
|
||||||
|
extern s32 D_800BBAA0;
|
||||||
|
extern s32 D_800BBAA4;
|
||||||
|
extern u8 D_800CD0C0[];
|
||||||
|
|
||||||
|
void func_8004F83C_5043C(s32);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "unknown/4FE90", func_8004F290_4FE90);
|
INCLUDE_ASM(s32, "unknown/4FE90", func_8004F290_4FE90);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "unknown/4FE90", func_8004F504_50104);
|
INCLUDE_ASM(s32, "unknown/4FE90", func_8004F504_50104);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "unknown/4FE90", func_8004F524_50124);
|
INCLUDE_ASM(s32, "unknown/4FE90", func_8004F524_50124);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "unknown/4FE90", func_8004F544_50144);
|
INCLUDE_ASM(s32, "unknown/4FE90", SavePlayerStruct);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "unknown/4FE90", func_8004F564_50164);
|
INCLUDE_ASM(s32, "unknown/4FE90", func_8004F564_50164);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "unknown/4FE90", func_8004F584_50184);
|
INCLUDE_ASM(s32, "unknown/4FE90", func_8004F584_50184);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "unknown/4FE90", func_8004F5A4_501A4);
|
s32 SaveFileEncode(s32 arg0, u8* arg1) {
|
||||||
|
s32 phi_s0;
|
||||||
|
s16 phi_v1_2;
|
||||||
|
u8* phi_s2_2;
|
||||||
|
s16 i, j, k, l;
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "unknown/4FE90", func_8004F83C_5043C);
|
for (l = 0; l < 220; l++) {
|
||||||
|
D_800CD0C0[l] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
D_800BBAA4 = 0;
|
||||||
|
D_800BBAA0 = 0;
|
||||||
|
|
||||||
|
while (*arg1 != 0) {
|
||||||
|
for (phi_s2_2 = (u8*)(arg0 + arg1[2]), i = 0; i < arg1[1]; i++) {
|
||||||
|
if (arg1[0] >= 0x11U) {
|
||||||
|
for (j = 0; j < (arg1[0] >> 3); j++, phi_s2_2++) {
|
||||||
|
phi_s0 = *phi_s2_2;
|
||||||
|
for (k = 0; k < 8; k++, phi_s0 *= 2) {
|
||||||
|
func_8004F83C_5043C(phi_s0 & 0x80);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
if (arg1[0] >= 9U) {
|
||||||
|
phi_s0 = *phi_s2_2 << (0x10 - arg1[0]);
|
||||||
|
phi_v1_2 = arg1[0] - 8;
|
||||||
|
for (k = 0; k < phi_v1_2; k++, phi_s0 *=2) {
|
||||||
|
func_8004F83C_5043C(phi_s0 & 0x80);
|
||||||
|
}
|
||||||
|
phi_s2_2++;
|
||||||
|
phi_s0 = *phi_s2_2;
|
||||||
|
phi_v1_2 = 8;
|
||||||
|
} else {
|
||||||
|
phi_s0 = *phi_s2_2 << (8 - arg1[0]);
|
||||||
|
phi_v1_2 = arg1[0];
|
||||||
|
}
|
||||||
|
for (k = 0; k < phi_v1_2; k++, phi_s0 *= 2) {
|
||||||
|
func_8004F83C_5043C(phi_s0 & 0x80);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
phi_s2_2++;
|
||||||
|
}
|
||||||
|
arg1 += 3;
|
||||||
|
if (arg1[0] == 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
D_800CD0C0[D_800BBAA0] <<= 8 - D_800BBAA4;
|
||||||
|
if (D_800BBAA4 == 0) {
|
||||||
|
D_800BBAA0--;
|
||||||
|
}
|
||||||
|
if (D_800BBAA0 >= 0xDD) {
|
||||||
|
osSyncPrintf(D_800A7B40_A8740);
|
||||||
|
}
|
||||||
|
return D_800BBAA0 + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void func_8004F83C_5043C(s32 arg0) {
|
||||||
|
D_800CD0C0[D_800BBAA0] *= 2;
|
||||||
|
D_800CD0C0[D_800BBAA0] |= arg0 ? 1 : 0;
|
||||||
|
|
||||||
|
if (++D_800BBAA4 >= 8) {
|
||||||
|
D_800BBAA0++;
|
||||||
|
D_800BBAA4 = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "unknown/4FE90", func_8004F8BC_504BC);
|
INCLUDE_ASM(s32, "unknown/4FE90", func_8004F8BC_504BC);
|
||||||
|
|
||||||
|
@ -492,9 +492,9 @@ GetTurnsElapsed = 0x800ECEE4; //rom:0x100B04
|
|||||||
PlayerHasItem = 0x800E4978; //rom:0xF8598
|
PlayerHasItem = 0x800E4978; //rom:0xF8598
|
||||||
RNGPercentChance = 0x800ECE9C; //rom:0x100ABC
|
RNGPercentChance = 0x800ECE9C; //rom:0x100ABC
|
||||||
RunDecisionTree = 0x800DA190; //rom:0xEDDB0
|
RunDecisionTree = 0x800DA190; //rom:0xEDDB0
|
||||||
LoadFormBinary = 0x8001A150; //rom:0x1AD50
|
Hu3DModelCreate = 0x8001A150; //rom:0x1AD50
|
||||||
TotalTurns = 0x800CD05A;
|
gTotalTurns = 0x800CD05A;
|
||||||
CurrentTurn = 0x800CD05B;
|
gCurrentTurn = 0x800CD05B;
|
||||||
|
|
||||||
omOvlCallEx = 0x80048128; //rom:0x48D28
|
omOvlCallEx = 0x80048128; //rom:0x48D28
|
||||||
omOvlGotoEx = 0x80048228; //rom:0x48E28
|
omOvlGotoEx = 0x80048228; //rom:0x48E28
|
||||||
@ -507,3 +507,15 @@ omovlhisidx = 0x800A1768; //rom:0xA2368 size:0x02 type:s16
|
|||||||
overlay_table = 0x800962F4; //rom:0x96EF4 size:0x126C
|
overlay_table = 0x800962F4; //rom:0x96EF4 size:0x126C
|
||||||
LoadOverlay = 0x8000B2C4; //rom:0xBEC4
|
LoadOverlay = 0x8000B2C4; //rom:0xBEC4
|
||||||
rnd_seed = 0x80097650; //rom:0x98250 type:u32
|
rnd_seed = 0x80097650; //rom:0x98250 type:u32
|
||||||
|
|
||||||
|
SavePlayerStruct = 0x8004F544; //rom:0x50144
|
||||||
|
GetSpaceData = 0x800EB160; //rom:0xFED80
|
||||||
|
SaveFileEncode = 0x8004F5A4; //rom:0x501A4
|
||||||
|
|
||||||
|
gCoinBlockSpaceIndex = 0x800CE1C4; // type:s16
|
||||||
|
gStarBlockSpaceIndex = 0x800D124E; // type:s16
|
||||||
|
gItemBlockSpaceIndex = 0x800CC4E4; // type:s16
|
||||||
|
|
||||||
|
gPrevCoinBlockIndexes = 0x800CE1E8; //type:s16 size:0x14
|
||||||
|
gPrevStarBlockIndexes = 0x800D59E0; //type:s16 size:0x14
|
||||||
|
gPrevItemBlockIndexes = 0x800CC378; //type:s16 size:0x14
|
Loading…
Reference in New Issue
Block a user