mirror of
https://github.com/zestydevy/marioparty3.git
synced 2024-11-26 23:00:32 +00:00
decomp a few things, sync a few names with mp1/mp2
This commit is contained in:
parent
55c29fd69f
commit
12f4d67b25
@ -6,6 +6,7 @@
|
||||
#include "math.h"
|
||||
|
||||
#define MAX_PLAYERS 4
|
||||
#define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0]))
|
||||
|
||||
#define OS_K0_TO_PHYSICAL(x) (u32)(((char *)(x)-0x80000000))
|
||||
#define OS_PHYSICAL_TO_K0(x) (void *)(((u32)(x)+0x80000000))
|
||||
@ -126,7 +127,7 @@ typedef struct {
|
||||
|
||||
s8 unks1E1F[2]; // 20 - 31
|
||||
|
||||
/* 32 (0x20) 800D1128 */ struct process *process;
|
||||
/* 32 (0x20) 800D1128 */ Process*process;
|
||||
/* 36 (0x24) 800D112C */ struct objectt *obj;
|
||||
/* 40 (0x28) 800D1130 */ s16 minigameStar;
|
||||
/* 42 (0x2A) 800D1132 */ s16 maxCoins;
|
||||
|
@ -67,7 +67,7 @@ extern HuArchive gArchive;
|
||||
|
||||
void HuInitArchive(u32 fsRomPtr);
|
||||
void HuInitFileInfo(EArchiveType type, s32 index, HuFileInfo * info);
|
||||
void * HuReadFilePerm(s32 dirAndFile);
|
||||
void * LoadFormBinary(s32 dirAndFile);
|
||||
void * HuDecodeFilePerm(EArchiveType type, s32 index);
|
||||
void * HuDecodeFileTemp(EArchiveType type, s32 index);
|
||||
void * HuDecodeFileTag(EArchiveType type, s32 index, s32 tag);
|
||||
|
@ -43,7 +43,7 @@ typedef struct
|
||||
{
|
||||
u16 unk0; // 0000
|
||||
u16 unk2; // 0002
|
||||
struct process * prc; // 0004
|
||||
Process* prc; // 0004
|
||||
process_func unk8; // 0008
|
||||
} HuObjUnk0;
|
||||
|
||||
@ -60,7 +60,7 @@ void HuObjInit(s32 numOfObjs, s32 numOfPrcs);
|
||||
HuObjInfo * HuObjCreate(s16 priority, u16 arg1, u16 arg2, s16 arg3, HuObjFunc func);
|
||||
void HuObjRegister(HuObjInfo * obj);
|
||||
void func_80047CDC_488DC(u16 arg0, HuObjInfo * obj);
|
||||
struct process * HuObjPrcCreate(process_func func, u16 priority, s32 stackSize, s32 extDataSize);
|
||||
Process* HuObjPrcCreate(process_func func, u16 priority, s32 stackSize, s32 extDataSize);
|
||||
void func_80048054_48C54(void);
|
||||
|
||||
#endif
|
@ -20,14 +20,13 @@ extern s32 longjmp(jmp_buf *jump_buf, s32 val);
|
||||
|
||||
typedef void (*process_func)();
|
||||
|
||||
struct process
|
||||
{
|
||||
/*0x00*/ struct process *next;
|
||||
/*0x04*/ struct process *youngest_child;
|
||||
/*0x08*/ struct process *oldest_child;
|
||||
/*0x0C*/ struct process *relative;
|
||||
/*0x10*/ struct process *parent_oldest_child;
|
||||
/*0x14*/ struct process *new_process;
|
||||
typedef struct Process {
|
||||
/*0x00*/ struct Process *next;
|
||||
/*0x04*/ struct Process *youngest_child;
|
||||
/*0x08*/ struct Process *oldest_child;
|
||||
/*0x0C*/ struct Process *relative;
|
||||
/*0x10*/ struct Process *parent_oldest_child;
|
||||
/*0x14*/ struct Process *new_process;
|
||||
/*0x18*/ void *heap;
|
||||
/*0x1C*/ u16 exec_mode;
|
||||
/*0x1E*/ u16 stat;
|
||||
@ -38,27 +37,27 @@ struct process
|
||||
/*0x2C*/ jmp_buf prc_jump;
|
||||
/*0x88*/ process_func destructor;
|
||||
/*0x8C*/ void *user_data;
|
||||
};
|
||||
} Process;
|
||||
|
||||
void HuPrcSysInit();
|
||||
void HuPrcLink(struct process **root, struct process *process);
|
||||
void HuPrcUnlink(struct process **root, struct process *process);
|
||||
struct process * HuPrcCreate(process_func func, u16 priority, s32 stack_size, s32 extra_data_size);
|
||||
void HuPrcChildLink(struct process *process, struct process *child);
|
||||
void HuPrcChildUnlink(struct process *process);
|
||||
struct process * HuPrcCreateChild(process_func func, u16 priority, s32 stack_size, s32 extra_data_size, struct process * parent);
|
||||
void HuPrcLink(Process**root, Process*process);
|
||||
void HuPrcUnlink(Process**root, Process*process);
|
||||
Process* HuPrcCreate(process_func func, u16 priority, s32 stack_size, s32 extra_data_size);
|
||||
void HuPrcChildLink(Process*process, Process*child);
|
||||
void HuPrcChildUnlink(Process*process);
|
||||
Process* HuPrcCreateChild(process_func func, u16 priority, s32 stack_size, s32 extra_data_size, Process* parent);
|
||||
void HuPrcChildWait();
|
||||
struct process * HuPrcGetCurrent();
|
||||
s32 HuPrcChildGet(struct process *process);
|
||||
s32 HuPrcStatKill(struct process *process);
|
||||
void HuPrcKill(struct process *process);
|
||||
void HuPrcChildKill(struct process *process);
|
||||
void HuPrcTerminate(struct process *process);
|
||||
Process* HuPrcCurrentGet();
|
||||
s32 HuPrcChildGet(Process*process);
|
||||
s32 HuPrcStatKill(Process*process);
|
||||
void HuPrcKill(Process*process);
|
||||
void HuPrcChildKill(Process*process);
|
||||
void HuPrcTerminate(Process*process);
|
||||
void HuPrcExit();
|
||||
void HuPrcSleep(s32 time);
|
||||
void HuPrcVSleep();
|
||||
void HuPrcAwake(struct process *process);
|
||||
void HuPrcDtor(struct process *process, process_func destructor);
|
||||
void HuPrcAwake(Process*process);
|
||||
void HuPrcDtor(Process*process, process_func destructor);
|
||||
void HuPrcCurrentDtor(process_func destructor);
|
||||
void * HuPrcAllocMem(s32 size);
|
||||
void HuPrcFreeMem(void *ptr);
|
||||
|
@ -57,7 +57,7 @@ void HuInitFileInfo(EArchiveType type, s32 index, HuFileInfo * info)
|
||||
* Reads a file from the main filesystem and decodes it.
|
||||
* File is in the permanent heap.
|
||||
*/
|
||||
void * HuReadFilePerm(s32 dirAndFile)
|
||||
void * ReadMainFS(s32 dirAndFile)
|
||||
{
|
||||
u32 dir;
|
||||
u32 file;
|
||||
|
@ -42,11 +42,11 @@ extern u16 D_800CD2F4;
|
||||
extern s32 D_800CDD50;
|
||||
extern f32 D_800CE1C8;
|
||||
|
||||
extern struct process *D_800D0448;
|
||||
extern Process* D_800D0448;
|
||||
extern u8 D_800D09A8;
|
||||
extern HuVec3F D_800D138C;
|
||||
|
||||
extern struct process *D_800D170C;
|
||||
extern Process* D_800D170C;
|
||||
extern u8 D_800D1710;
|
||||
extern s16 D_800D1F36;
|
||||
|
||||
@ -64,7 +64,7 @@ extern u16 D_800A190E_A250E;
|
||||
extern void func_800007FC_13FC(struct str800D5298 *arg0);
|
||||
extern void func_80000EA8_1AA8(struct str800D5298 *arg0);
|
||||
extern void func_80000F30_1B30(u32 arg0);
|
||||
extern u8 HuGetRandomByte(); //ovlman.h
|
||||
extern u8 rand8(); //ovlman.h
|
||||
extern void func_8000BA30_C630(); // esprite.h
|
||||
extern void func_800143F0_14FF0();
|
||||
extern void func_80014A3C_1563C(u32 arg0);
|
||||
@ -75,8 +75,8 @@ extern void func_800224BC_230BC();
|
||||
extern void func_80035A50_36650(); // save.h
|
||||
extern void func_80035C20_36820(s16 arg0, s16 arg1); // save.h
|
||||
extern void func_80036380_36F80(void **arg0);
|
||||
extern void func_80048128_48D28(u32 argo0, u32 arg1, u32 arg2);
|
||||
extern void func_80048504_49104();
|
||||
extern s32 omOvlCallEx(s32 arg0, s16 arg1, u16 arg2);
|
||||
extern void omMain();
|
||||
extern void func_8004DC00_4E800();
|
||||
extern void func_8004DC98_4E898();
|
||||
extern void func_8004F290_4FE90();
|
||||
@ -154,10 +154,10 @@ void func_8000E3C0_EFC0() {
|
||||
func_80050E78_51A78(0);
|
||||
func_80050800_51400();
|
||||
if (temp_s0 != 0) {
|
||||
func_80048128_48D28(0x67, 0, 0x82);
|
||||
omOvlCallEx(0x67, 0, 0x82);
|
||||
}
|
||||
else {
|
||||
func_80048128_48D28(0x58, 0, 0x84);
|
||||
omOvlCallEx(0x58, 0, 0x84);
|
||||
}
|
||||
}
|
||||
|
||||
@ -185,7 +185,7 @@ void func_8000E3C0_EFC0() {
|
||||
func_80000F30_1B30(0);
|
||||
}
|
||||
|
||||
HuPrcKill(HuPrcGetCurrent());
|
||||
HuPrcKill(HuPrcCurrentGet());
|
||||
|
||||
while (TRUE) {
|
||||
HuPrcVSleep();
|
||||
@ -205,7 +205,7 @@ void func_8000E740_F340() {
|
||||
void func_8000E78C_F38C() {
|
||||
while (TRUE) {
|
||||
HuPrcVSleep();
|
||||
func_80048504_49104();
|
||||
omMain();
|
||||
}
|
||||
}
|
||||
|
||||
@ -213,7 +213,7 @@ void func_8000E78C_F38C() {
|
||||
void func_8000E7B8_F3B8() {
|
||||
while (TRUE) {
|
||||
HuPrcVSleep();
|
||||
HuGetRandomByte();
|
||||
rand8();
|
||||
func_8000BA30_C630(); // esprite
|
||||
func_80014A3C_1563C(2);
|
||||
func_8001B0B4_1BCB4(&D_800CCF38, 2); // hmfman
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
INCLUDE_ASM(s32, "hmfman", func_8001A070_1AC70);
|
||||
|
||||
INCLUDE_ASM(s32, "hmfman", func_8001A150_1AD50);
|
||||
INCLUDE_ASM(s32, "hmfman", LoadFormBinary);
|
||||
|
||||
INCLUDE_ASM(s32, "hmfman", func_8001A61C_1B21C);
|
||||
|
||||
|
@ -1,5 +1,28 @@
|
||||
#include "common.h"
|
||||
|
||||
typedef struct GameStatus { //from partyplanner
|
||||
/* 0x00 - 800CD058 */ s8 unk0;
|
||||
/* 0x01 - 800CD059 */ s8 current_board_index;
|
||||
/* 0x02 - 800CD05A */ s8 total_turns;
|
||||
/* 0x03 - 800CD05B */ s8 current_turn;
|
||||
/* 0x04 - 800CD05C */ s8 current_game_length; // 00=Lite Play,01=Standard Play,02=Full Play,03=Custom Play
|
||||
/* 0x05 - 800CD05D */ s8 current_star_spawn; // Index of star space (index into star_spawn_indices)
|
||||
/* 0x06 - 800CD05E */ s8 star_spawn_indices[7];
|
||||
/* 0x0D - 800CD065 */ s8 unkD;
|
||||
/* 0x0E - 800CD066 */ s8 unkE;
|
||||
/* 0x0F - 800CD067 */ s8 current_player_index;
|
||||
/* 0x10 - 800CD068 */ s8 unk10;
|
||||
/* 0x11 - 800CD069 */ s8 current_space_index;
|
||||
/* 0x12 - 800CD06A */ s8 unk12;
|
||||
/* 0x13 - 800CD06B */ s8 unk13;
|
||||
/* 0x14 - 800CD06C */ s8 unk14;
|
||||
/* 0x15 - 800CD06D */ s8 unk15;
|
||||
/* 0x16 - 800CD06E */ s8 unk16;
|
||||
// 800cd09c flag for re-roll
|
||||
} GameStatus;
|
||||
|
||||
extern GameStatus D_800CD058;
|
||||
|
||||
INCLUDE_ASM(s32, "overlays/board_chillywaters/chillywaters2", func_80105E80_31B9F0);
|
||||
|
||||
INCLUDE_ASM(s32, "overlays/board_chillywaters/chillywaters2", func_80105EA8_31BA18);
|
||||
|
@ -5,9 +5,9 @@
|
||||
void func_801059D0_3D8AC0(void) {
|
||||
D_800CDD58 = 1;
|
||||
D_800D037C = 0;
|
||||
func_80047B80_48780(HuPrcGetCurrent(), 0x80);
|
||||
func_80047B80_48780(HuPrcCurrentGet(), 0x80);
|
||||
func_80100CEC(gPlayers[gCurrentPlayerIndex].controller);
|
||||
func_80047BAC_487AC(HuPrcGetCurrent(), 0x80);
|
||||
func_80047BAC_487AC(HuPrcCurrentGet(), 0x80);
|
||||
D_800CDD58 = 0;
|
||||
D_800D037C = 1;
|
||||
}
|
||||
@ -38,7 +38,7 @@ void func_80105B10_3D8C00(void) {
|
||||
void func_80105B64_3D8C54(void) {
|
||||
D_800CD059 = 0;
|
||||
HuObjInit(0xA, 0);
|
||||
func_80048228_48E28(0x5A, 0, 0x4190);
|
||||
omOvlGotoEx(0x5A, 0, 0x4190);
|
||||
}
|
||||
|
||||
void func_80105B9C_3D8C8C(void) {
|
||||
@ -61,7 +61,7 @@ void func_80105B9C_3D8C8C(void) {
|
||||
D_800CD0B0.unk_04 = 5;
|
||||
D_800CD0B0.unk_02 = 0;
|
||||
func_800EA760();
|
||||
func_8004819C_48D9C(1);
|
||||
omOvlReturnEx(1);
|
||||
}
|
||||
|
||||
void func_80105C64_3D8D54(s32 arg0, s32 arg1, unkStruct01* arg2) {
|
||||
|
@ -61,8 +61,8 @@ extern s16 D_800A1764_A2364;
|
||||
|
||||
extern s8 gCurrentPlayerIndex;
|
||||
extern Player gPlayers[4];
|
||||
void func_80047B80_48780(struct process*, s32);
|
||||
void func_80047BAC_487AC(struct process*, s32);
|
||||
void func_80047B80_48780(Process**, s32);
|
||||
void func_80047BAC_487AC(Process**, s32);
|
||||
void func_80100CEC(u8);
|
||||
extern s16 D_800CDD58;
|
||||
extern s16 D_800D037C;
|
||||
@ -80,9 +80,9 @@ extern s32 D_80119474;
|
||||
extern s32 D_80119478;
|
||||
extern s32 D_8011947C;
|
||||
void HuObjInit(s32, s32);
|
||||
void func_80048228_48E28(s32, s32, s32);
|
||||
void omOvlGotoEx(s32, s16, u16);
|
||||
extern s8 D_800CD059;
|
||||
void func_8004819C_48D9C(s32);
|
||||
s32 omOvlReturnEx(s16 level);
|
||||
void func_800E94D0(void);
|
||||
void func_800E9564(void);
|
||||
void func_800E9B10(s32, s32);
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
extern s8 TotalTurns;
|
||||
extern s8 CurrentTurn;
|
||||
s32 HuGetRandomByte(void);
|
||||
s32 rand8(void);
|
||||
|
||||
INCLUDE_ASM(s32, "overlays/shared_board/1006F0", func_800ECAD0_1006F0);
|
||||
|
||||
@ -27,7 +27,7 @@ INCLUDE_ASM(s32, "overlays/shared_board/1006F0", func_800ECDD4_1009F4);
|
||||
INCLUDE_ASM(s32, "overlays/shared_board/1006F0", func_800ECE4C_100A6C);
|
||||
|
||||
s16 RNGPercentChance(s8 arg0) {
|
||||
u8 randByte = HuGetRandomByte();
|
||||
u8 randByte = rand8();
|
||||
s32 chance = arg0;
|
||||
|
||||
return (randByte * 99 >> 8) < chance;
|
||||
|
@ -28,7 +28,7 @@ void func_800F3F0C_107B2C(s32); /* extern */
|
||||
void func_800F3FF4_107C14(s32); /* extern */
|
||||
void func_800F4798_1083B8(s32, s32); /* extern */
|
||||
void func_800F4874_108494(s32, s16, s16); /* extern */
|
||||
void func_80047B80_48780(struct process*, s32); /* extern */
|
||||
void func_80047B80_48780(Process**, s32); /* extern */
|
||||
void func_800F4190_107DB0(void); /* extern */
|
||||
void func_800F43FC_10801C(s32); /* extern */
|
||||
void func_800F3400_107020(void);
|
||||
@ -37,7 +37,7 @@ extern s32 D_801055E8[];
|
||||
extern CharPortraitRelated D_801057E0[4];
|
||||
extern s32 D_80101780_1153A0;
|
||||
extern s32 D_80101784_1153A4;
|
||||
extern struct process* D_80105580;
|
||||
extern Process** D_80105580;
|
||||
extern s16 D_801055C2;
|
||||
extern s16 D_801055C4;
|
||||
extern s16 D_801055FC[4];
|
||||
|
52
src/ovlman.c
52
src/ovlman.c
@ -1,4 +1,23 @@
|
||||
#include "common.h"
|
||||
#include "rom.h"
|
||||
typedef struct OverlayInfo {
|
||||
u8 *rom_start;
|
||||
u8 *rom_end;
|
||||
u8 *ram_start;
|
||||
u8 *code_start;
|
||||
u8 *code_end;
|
||||
u8 *data_start;
|
||||
u8 *data_end;
|
||||
u8 *bss_start;
|
||||
u8 *bss_end;
|
||||
} OverlayInfo; // sizeof 0x24
|
||||
|
||||
extern u8 D_800962F0_96EF0;
|
||||
extern u32 rnd_seed;
|
||||
extern OverlayInfo overlay_table[];
|
||||
|
||||
s32 LoadFormBinary(u8* arg0, u32 arg1);
|
||||
void* ReadMainFS(s32);
|
||||
|
||||
INCLUDE_ASM(s32, "ovlman", func_8000B0A0_BCA0);
|
||||
|
||||
@ -6,13 +25,40 @@ INCLUDE_ASM(s32, "ovlman", func_8000B0D4_BCD4);
|
||||
|
||||
INCLUDE_ASM(s32, "ovlman", func_8000B108_BD08);
|
||||
|
||||
INCLUDE_ASM(s32, "ovlman", func_8000B13C_BD3C);
|
||||
s16 func_8000B13C_BD3C(s32 arg0) {
|
||||
return LoadFormBinary(ReadMainFS(arg0), 0x1D);
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "ovlman", HuGetRandomByte);
|
||||
u8 rand8(void) {
|
||||
rnd_seed = rnd_seed * 0x41C64E6D + 0x3039;
|
||||
return (rnd_seed + 1) >> 16;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "ovlman", func_8000B1A0_BDA0);
|
||||
|
||||
INCLUDE_ASM(s32, "ovlman", func_8000B2C4_BEC4);
|
||||
// copies in an overlay and clears bss region.
|
||||
void LoadOverlay(s32 overlayIndex) {
|
||||
u8 *rom_start;
|
||||
u8 *rom_end;
|
||||
u8 *bss_start;
|
||||
u8 *bss_end;
|
||||
u8 *temp;
|
||||
|
||||
rom_start = overlay_table[overlayIndex].rom_start;
|
||||
rom_end = overlay_table[overlayIndex].rom_end;
|
||||
bss_start = overlay_table[overlayIndex].bss_start;
|
||||
bss_end = overlay_table[overlayIndex].bss_end;
|
||||
|
||||
HuRomDmaCodeRead(rom_start, overlay_table[overlayIndex].ram_start, rom_end - rom_start);
|
||||
|
||||
temp = bss_start;
|
||||
while (bss_start < bss_end) {
|
||||
*(temp++) = 0;
|
||||
bss_start++;
|
||||
}
|
||||
|
||||
D_800962F0_96EF0 = 0;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "ovlman", func_8000B364_BF64);
|
||||
|
||||
|
@ -4,8 +4,8 @@
|
||||
#include "malloc.h"
|
||||
|
||||
extern jmp_buf process_jmp_buf;
|
||||
extern struct process *top_process;
|
||||
extern struct process *current_process;
|
||||
extern Process* top_process;
|
||||
extern Process* current_process;
|
||||
extern s16 process_count;
|
||||
|
||||
// pointer to where HuPrcVSleep was called
|
||||
@ -17,9 +17,9 @@ void HuPrcSysInit()
|
||||
top_process = NULL;
|
||||
}
|
||||
|
||||
void HuPrcLink(struct process **root, struct process *process)
|
||||
void HuPrcLink(Process** root, Process* process)
|
||||
{
|
||||
struct process *src_process = *root;
|
||||
Process* src_process = *root;
|
||||
if (src_process != NULL && (src_process->priority >= process->priority))
|
||||
{
|
||||
while (src_process->next != NULL)
|
||||
@ -51,7 +51,7 @@ void HuPrcLink(struct process **root, struct process *process)
|
||||
}
|
||||
}
|
||||
|
||||
void HuPrcUnlink(struct process **root, struct process *process)
|
||||
void HuPrcUnlink(Process** root, Process* process)
|
||||
{
|
||||
if (process->next)
|
||||
{
|
||||
@ -67,17 +67,17 @@ void HuPrcUnlink(struct process **root, struct process *process)
|
||||
}
|
||||
}
|
||||
|
||||
struct process * HuPrcCreate(process_func func, u16 priority, s32 stack_size, s32 extra_data_size)
|
||||
Process* HuPrcCreate(process_func func, u16 priority, s32 stack_size, s32 extra_data_size)
|
||||
{
|
||||
struct heap_node *process_heap;
|
||||
struct process *process;
|
||||
Process* process;
|
||||
s32 alloc_size;
|
||||
|
||||
if (stack_size == 0) {
|
||||
stack_size = 2048;
|
||||
}
|
||||
|
||||
alloc_size = HuMemMemoryAllocSizeGet(sizeof(struct process))
|
||||
alloc_size = HuMemMemoryAllocSizeGet(sizeof(Process))
|
||||
+ HuMemMemoryAllocSizeGet(stack_size)
|
||||
+ HuMemMemoryAllocSizeGet(extra_data_size);
|
||||
|
||||
@ -87,7 +87,7 @@ struct process * HuPrcCreate(process_func func, u16 priority, s32 stack_size, s3
|
||||
}
|
||||
HuMemHeapInit(process_heap, alloc_size);
|
||||
|
||||
process = (struct process *)HuMemMemoryAlloc(process_heap, sizeof(struct process));
|
||||
process = (Process*)HuMemMemoryAlloc(process_heap, sizeof(Process));
|
||||
process->heap = process_heap;
|
||||
process->exec_mode = EXEC_PROCESS_DEFAULT;
|
||||
process->stat = 0;
|
||||
@ -106,7 +106,7 @@ struct process * HuPrcCreate(process_func func, u16 priority, s32 stack_size, s3
|
||||
return process;
|
||||
}
|
||||
|
||||
void HuPrcChildLink(struct process *process, struct process *child)
|
||||
void HuPrcChildLink(Process* process, Process* child)
|
||||
{
|
||||
HuPrcChildUnlink(child);
|
||||
if (process->oldest_child)
|
||||
@ -119,7 +119,7 @@ void HuPrcChildLink(struct process *process, struct process *child)
|
||||
child->relative = process;
|
||||
}
|
||||
|
||||
void HuPrcChildUnlink(struct process *process)
|
||||
void HuPrcChildUnlink(Process* process)
|
||||
{
|
||||
if (process->relative)
|
||||
{
|
||||
@ -139,16 +139,16 @@ void HuPrcChildUnlink(struct process *process)
|
||||
}
|
||||
}
|
||||
|
||||
struct process * HuPrcCreateChild(process_func func, u16 priority, s32 stack_size, s32 extra_data_size, struct process * parent)
|
||||
Process* HuPrcCreateChild(process_func func, u16 priority, s32 stack_size, s32 extra_data_size, Process* parent)
|
||||
{
|
||||
struct process * child = HuPrcCreate(func, priority, stack_size, extra_data_size);
|
||||
Process* child = HuPrcCreate(func, priority, stack_size, extra_data_size);
|
||||
HuPrcChildLink(parent, child);
|
||||
return child;
|
||||
}
|
||||
|
||||
void HuPrcChildWait()
|
||||
{
|
||||
struct process *process = HuPrcGetCurrent();
|
||||
Process* process = HuPrcCurrentGet();
|
||||
if (process->oldest_child)
|
||||
{
|
||||
process->exec_mode = EXEC_PROCESS_WATCH;
|
||||
@ -159,15 +159,15 @@ void HuPrcChildWait()
|
||||
}
|
||||
}
|
||||
|
||||
struct process * HuPrcGetCurrent()
|
||||
Process* HuPrcCurrentGet()
|
||||
{
|
||||
return current_process;
|
||||
}
|
||||
|
||||
s32 HuPrcChildGet(struct process *process)
|
||||
s32 HuPrcChildGet(Process* process)
|
||||
{
|
||||
s32 i;
|
||||
struct process *curr_child = process->oldest_child;
|
||||
Process* curr_child = process->oldest_child;
|
||||
i = 0;
|
||||
while (curr_child)
|
||||
{
|
||||
@ -177,7 +177,7 @@ s32 HuPrcChildGet(struct process *process)
|
||||
return i;
|
||||
}
|
||||
|
||||
s32 HuPrcStatKill(struct process *process)
|
||||
s32 HuPrcStatKill(Process* process)
|
||||
{
|
||||
if (process->exec_mode != EXEC_PROCESS_DEAD)
|
||||
{
|
||||
@ -191,16 +191,16 @@ s32 HuPrcStatKill(struct process *process)
|
||||
}
|
||||
}
|
||||
|
||||
void HuPrcKill(struct process *process)
|
||||
void HuPrcKill(Process* process)
|
||||
{
|
||||
HuPrcChildKill(process);
|
||||
HuPrcChildUnlink(process);
|
||||
HuPrcStatKill(process);
|
||||
}
|
||||
|
||||
void HuPrcChildKill(struct process *process)
|
||||
void HuPrcChildKill(Process* process)
|
||||
{
|
||||
struct process *curr_child = process->oldest_child;
|
||||
Process* curr_child = process->oldest_child;
|
||||
while (curr_child != NULL)
|
||||
{
|
||||
if (curr_child->oldest_child != NULL) {
|
||||
@ -212,7 +212,7 @@ void HuPrcChildKill(struct process *process)
|
||||
process->oldest_child = NULL;
|
||||
}
|
||||
|
||||
void HuPrcTerminate(struct process *process)
|
||||
void HuPrcTerminate(Process* process)
|
||||
{
|
||||
if (process->destructor)
|
||||
{
|
||||
@ -225,7 +225,7 @@ void HuPrcTerminate(struct process *process)
|
||||
|
||||
void HuPrcExit()
|
||||
{
|
||||
struct process *process = HuPrcGetCurrent();
|
||||
Process* process = HuPrcCurrentGet();
|
||||
HuPrcChildKill(process);
|
||||
HuPrcChildUnlink(process);
|
||||
HuPrcTerminate(process);
|
||||
@ -233,7 +233,7 @@ void HuPrcExit()
|
||||
|
||||
void HuPrcSleep(s32 time)
|
||||
{
|
||||
struct process *process = HuPrcGetCurrent();
|
||||
Process* process = HuPrcCurrentGet();
|
||||
if (time != 0 && process->exec_mode != EXEC_PROCESS_DEAD)
|
||||
{
|
||||
process->exec_mode = EXEC_PROCESS_SLEEPING;
|
||||
@ -250,25 +250,25 @@ void HuPrcVSleep()
|
||||
HuPrcSleep(0);
|
||||
}
|
||||
|
||||
void HuPrcAwake(struct process *process)
|
||||
void HuPrcAwake(Process* process)
|
||||
{
|
||||
process->sleep_time = 0;
|
||||
}
|
||||
|
||||
void HuPrcDtor(struct process *process, process_func destructor)
|
||||
void HuPrcDtor(Process* process, process_func destructor)
|
||||
{
|
||||
process->destructor = destructor;
|
||||
}
|
||||
|
||||
void HuPrcCurrentDtor(process_func destructor)
|
||||
{
|
||||
struct process *process = HuPrcGetCurrent();
|
||||
Process* process = HuPrcCurrentGet();
|
||||
HuPrcDtor(process, destructor);
|
||||
}
|
||||
|
||||
void HuPrcCall(s32 time)
|
||||
{
|
||||
struct process *cur_proc_local;
|
||||
Process* cur_proc_local;
|
||||
s32 ret;
|
||||
|
||||
current_process = top_process;
|
||||
@ -338,7 +338,7 @@ void HuPrcCall(s32 time)
|
||||
|
||||
void * HuPrcAllocMem(s32 size)
|
||||
{
|
||||
struct process *process = HuPrcGetCurrent();
|
||||
Process* process = HuPrcCurrentGet();
|
||||
return (void *)HuMemMemoryAlloc((struct heap_node *)process->heap, size);
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,28 @@
|
||||
#include "common.h"
|
||||
|
||||
s32 omOvlGotoEx(s32, s16, u16);
|
||||
extern s16 omovlhisidx;
|
||||
|
||||
typedef struct omOvlHisData { //Object Manager History Data
|
||||
/* 0x00 */ s32 overlayID;
|
||||
/* 0x04 */ s16 event;
|
||||
/* 0x06 */ u16 stat;
|
||||
} omOvlHisData; //sizeof 0x08
|
||||
|
||||
extern omOvlHisData omovlhis[12];
|
||||
|
||||
typedef struct OverlayInfo {
|
||||
u8 *rom_start;
|
||||
u8 *rom_end;
|
||||
u8 *ram_start;
|
||||
u8 *code_start;
|
||||
u8 *code_end;
|
||||
u8 *data_start;
|
||||
u8 *data_end;
|
||||
u8 *bss_start;
|
||||
u8 *bss_end;
|
||||
} OverlayInfo; // sizeof 0x24
|
||||
|
||||
INCLUDE_ASM(s32, "unknown/47D60", HuObjInit);
|
||||
|
||||
INCLUDE_ASM(s32, "unknown/47D60", func_80047420_48020);
|
||||
@ -56,17 +79,52 @@ INCLUDE_ASM(s32, "unknown/47D60", func_80048054_48C54);
|
||||
|
||||
INCLUDE_ASM(s32, "unknown/47D60", func_800480E4_48CE4);
|
||||
|
||||
INCLUDE_ASM(s32, "unknown/47D60", func_80048128_48D28);
|
||||
s32 omOvlCallEx(s32 arg0, s16 arg1, u16 arg2) {
|
||||
omOvlHisData* history;
|
||||
s32 ret;
|
||||
|
||||
INCLUDE_ASM(s32, "unknown/47D60", func_8004819C_48D9C);
|
||||
if (omovlhisidx < ARRAY_COUNT(omovlhis)) {
|
||||
history = &omovlhis[++omovlhisidx];
|
||||
history->overlayID = arg0;
|
||||
history->event = arg1;
|
||||
history->stat = arg2;
|
||||
omOvlGotoEx(arg0, arg1, arg2);
|
||||
ret = 1;
|
||||
} else {
|
||||
ret = 0;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "unknown/47D60", func_80048228_48E28);
|
||||
s32 omOvlReturnEx(s16 level) {
|
||||
omovlhisidx -= level;
|
||||
|
||||
if (omovlhisidx < 0) {
|
||||
omovlhisidx = 0;
|
||||
omOvlGotoEx(omovlhis[0].overlayID, omovlhis[0].event, omovlhis[0].stat);
|
||||
return 0;
|
||||
}
|
||||
omOvlGotoEx(omovlhis[omovlhisidx].overlayID, omovlhis[omovlhisidx].event, omovlhis[omovlhisidx].stat);
|
||||
return 1;
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "unknown/47D60", func_80048460_49060);
|
||||
INCLUDE_ASM(s32, "unknown/47D60", omOvlGotoEx);
|
||||
|
||||
INCLUDE_ASM(s32, "unknown/47D60", func_8004849C_4909C);
|
||||
void omOvlHisChg(s16 arg0, s32 overlay, s16 event, s16 stat) {
|
||||
s32 ovlhisIndex = omovlhisidx - arg0;
|
||||
omOvlHisData* history;
|
||||
|
||||
if (ovlhisIndex >= 0) {
|
||||
history = &omovlhis[ovlhisIndex];
|
||||
history->overlayID = overlay;
|
||||
history->event = event;
|
||||
history->stat = stat;
|
||||
}
|
||||
}
|
||||
|
||||
INCLUDE_ASM(s32, "unknown/47D60", func_80048504_49104);
|
||||
INCLUDE_ASM(s32, "unknown/47D60", omOvlKill);
|
||||
|
||||
INCLUDE_ASM(s32, "unknown/47D60", omMain);
|
||||
|
||||
INCLUDE_ASM(s32, "unknown/47D60", func_80048E88_49A88);
|
||||
|
||||
|
@ -292,10 +292,10 @@ INCLUDE_ASM(s32, "unknown/47d60", func_80047E5C_48A5C);
|
||||
|
||||
INCLUDE_ASM(s32, "unknown/47d60", func_80047E90_48A90);
|
||||
|
||||
struct process * HuObjPrcCreate(process_func func, u16 priority, s32 stackSize, s32 extDataSize)
|
||||
Process* HuObjPrcCreate(process_func func, u16 priority, s32 stackSize, s32 extDataSize)
|
||||
{
|
||||
s16 prevIdx;
|
||||
struct process * newPrc;
|
||||
Process* newPrc;
|
||||
HuObjUnk0 * temp_s0;
|
||||
|
||||
if (D_800A1776_A2376 == D_800A1774_A2374) {
|
||||
@ -326,10 +326,10 @@ INCLUDE_ASM(s32, "unknown/47d60", func_80048008_48C08);
|
||||
void func_80048054_48C54(void)
|
||||
{
|
||||
process_func func;
|
||||
struct process * currPrc;
|
||||
Process* currPrc;
|
||||
HuObjUnk0 * temp_s0;
|
||||
|
||||
currPrc = HuPrcGetCurrent();
|
||||
currPrc = HuPrcCurrentGet();
|
||||
temp_s0 = &D_800A177C_A237C[currPrc->dtor_idx];
|
||||
func = temp_s0->unk8;
|
||||
if (func != NULL) {
|
||||
@ -343,17 +343,17 @@ void func_80048054_48C54(void)
|
||||
|
||||
INCLUDE_ASM(s32, "unknown/47d60", func_800480E4_48CE4);
|
||||
|
||||
INCLUDE_ASM(s32, "unknown/47d60", func_80048128_48D28);
|
||||
INCLUDE_ASM(s32, "unknown/47d60", omOvlCallEx);
|
||||
|
||||
INCLUDE_ASM(s32, "unknown/47d60", func_8004819C_48D9C);
|
||||
INCLUDE_ASM(s32, "unknown/47d60", omOvlReturnEx);
|
||||
|
||||
INCLUDE_ASM(s32, "unknown/47d60", func_80048228_48E28);
|
||||
INCLUDE_ASM(s32, "unknown/47d60", omOvlGotoEx);
|
||||
|
||||
INCLUDE_ASM(s32, "unknown/47d60", func_80048460_49060);
|
||||
INCLUDE_ASM(s32, "unknown/47d60", omOvlHisChg);
|
||||
|
||||
INCLUDE_ASM(s32, "unknown/47d60", func_8004849C_4909C);
|
||||
INCLUDE_ASM(s32, "unknown/47d60", omOvlKill);
|
||||
|
||||
INCLUDE_ASM(s32, "unknown/47d60", func_80048504_49104);
|
||||
INCLUDE_ASM(s32, "unknown/47d60", omMain);
|
||||
|
||||
INCLUDE_ASM(s32, "unknown/47d60", func_80048E88_49A88);
|
||||
|
||||
|
@ -63,7 +63,7 @@ HuRomDmaCodeRead = 0x8004DB14;
|
||||
|
||||
HuInitArchive = 0x80009AC0;
|
||||
HuInitFileInfo = 0x80009B64;
|
||||
HuReadFilePerm = 0x80009C10;
|
||||
ReadMainFS = 0x80009C10;
|
||||
HuReadFileTemp = 0x80009C74;
|
||||
HuReadFileTag = 0x80009CD8;
|
||||
HuDecodeFilePerm = 0x80009D4C;
|
||||
@ -80,7 +80,7 @@ HuDecodeFslide = 0x8000A9E8;
|
||||
HuDecodeRLE = 0x8000AE64;
|
||||
HuDecode = 0x8000B000;
|
||||
|
||||
HuGetRandomByte = 0x8000B16C;
|
||||
rand8 = 0x8000B16C;
|
||||
|
||||
HuPadInit = 0x80008DD0;
|
||||
|
||||
@ -92,7 +92,7 @@ HuPrcChildLink = 0x8004ED30;
|
||||
HuPrcChildUnlink = 0x8004ED84;
|
||||
HuPrcCreateChild = 0x8004EDD4;
|
||||
HuPrcChildWait = 0x8004EE18;
|
||||
HuPrcGetCurrent = 0x8004EE68;
|
||||
HuPrcCurrentGet = 0x8004EE68;
|
||||
HuPrcChildGet = 0x8004EE74;
|
||||
HuPrcStatKill = 0x8004EE94;
|
||||
HuPrcKill = 0x8004EED8;
|
||||
@ -490,6 +490,18 @@ GetTurnsElapsed = 0x800ECEE4; //rom:0x100B04
|
||||
PlayerHasItem = 0x800E4978; //rom:0xF8598
|
||||
RNGPercentChance = 0x800ECE9C; //rom:0x100ABC
|
||||
RunDecisionTree = 0x800DA190; //rom:0xEDDB0
|
||||
|
||||
LoadFormBinary = 0x8001A150; //rom:0x1AD50
|
||||
TotalTurns = 0x800CD05A;
|
||||
CurrentTurn = 0x800CD05B;
|
||||
CurrentTurn = 0x800CD05B;
|
||||
|
||||
omOvlCallEx = 0x80048128; //rom:0x48D28
|
||||
omOvlGotoEx = 0x80048228; //rom:0x48E28
|
||||
omOvlReturnEx = 0x8004819C; //rom:0x48D9C
|
||||
omOvlHisChg = 0x80048460; //rom:0x49060
|
||||
omovlhis = 0x800D2010; //size:0x60
|
||||
omOvlKill = 0x8004849C; //rom:0x4909C
|
||||
omMain = 0x80048504; //rom:0x49104
|
||||
omovlhisidx = 0x800A1768; //rom:0xA2368 size:0x02 type:s16
|
||||
overlay_table = 0x800962F4; //rom:0x96EF4 size:0x126C
|
||||
LoadOverlay = 0x8000B2C4; //rom:0xBEC4
|
||||
rnd_seed = 0x80097650; //rom:0x98250 type:u32
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 5aaad5330b946c53145e8a5a3ba27c1a74dbe7ba
|
||||
Subproject commit f51abc54f7e2fc5c1eb1f4d148cea4f769a95b1d
|
@ -1 +1 @@
|
||||
Subproject commit bece1d6db17040749f77dbbd090363cc6fb926f9
|
||||
Subproject commit af0c9e11e308c5b4930fd8b0dc0120f0864df0fc
|
0
tools/progress.py
Normal file → Executable file
0
tools/progress.py
Normal file → Executable file
@ -1 +1 @@
|
||||
Subproject commit c523ce1a3ae2673a26aa76affe8951e9e0ed7d88
|
||||
Subproject commit 874db6102d7334ac102b3a907fcdbf61d723015a
|
Loading…
Reference in New Issue
Block a user