Label game/main.c

This commit is contained in:
gamemasterplc 2024-01-27 14:43:35 -06:00
parent 0f4d8e6374
commit 3a50498a3f
2 changed files with 63 additions and 61 deletions

View file

@ -6027,25 +6027,25 @@ dspSlaveLength = .sdata:0x801D39F0; // type:object size:0x2 data:2byte
SendCount = .sdata:0x801D39F8; // type:object size:0x1 scope:local data:byte SendCount = .sdata:0x801D39F8; // type:object size:0x1 scope:local data:byte
SystemInitF = .sbss:0x801D3A00; // type:object size:0x4 data:4byte SystemInitF = .sbss:0x801D3A00; // type:object size:0x4 data:4byte
HuDvdErrWait = .sbss:0x801D3A04; // type:object size:0x4 data:4byte HuDvdErrWait = .sbss:0x801D3A04; // type:object size:0x4 data:4byte
lbl_801D3A08 = .sbss:0x801D3A08; // type:object size:0x4 fi_req = .sbss:0x801D3A08; // type:object size:0x4 scope:local
lbl_801D3A0C = .sbss:0x801D3A0C; // type:object size:0x4 rf_req = .sbss:0x801D3A0C; // type:object size:0x4 scope:local
lbl_801D3A10 = .sbss:0x801D3A10; // type:object size:0x4 pe_req = .sbss:0x801D3A10; // type:object size:0x4 scope:local
lbl_801D3A14 = .sbss:0x801D3A14; // type:object size:0x4 vi_req = .sbss:0x801D3A14; // type:object size:0x4 scope:local
lbl_801D3A18 = .sbss:0x801D3A18; // type:object size:0x4 io_req = .sbss:0x801D3A18; // type:object size:0x4 scope:local
lbl_801D3A1C = .sbss:0x801D3A1C; // type:object size:0x4 dsp_req = .sbss:0x801D3A1C; // type:object size:0x4 scope:local
lbl_801D3A20 = .sbss:0x801D3A20; // type:object size:0x4 cpu_wr_req = .sbss:0x801D3A20; // type:object size:0x4 scope:local
lbl_801D3A24 = .sbss:0x801D3A24; // type:object size:0x4 cpu_rd_req = .sbss:0x801D3A24; // type:object size:0x4 scope:local
lbl_801D3A28 = .sbss:0x801D3A28; // type:object size:0x4 tc_req = .sbss:0x801D3A28; // type:object size:0x4 scope:local
lbl_801D3A2C = .sbss:0x801D3A2C; // type:object size:0x4 cp_req = .sbss:0x801D3A2C; // type:object size:0x4 scope:local
lbl_801D3A30 = .sbss:0x801D3A30; // type:object size:0x4 total_copy_clks = .sbss:0x801D3A30; // type:object size:0x4 scope:local
lbl_801D3A34 = .sbss:0x801D3A34; // type:object size:0x4 clr_pixels_in = .sbss:0x801D3A34; // type:object size:0x4 scope:local
lbl_801D3A38 = .sbss:0x801D3A38; // type:object size:0x4 bot_pixels_out = .sbss:0x801D3A38; // type:object size:0x4 scope:local
lbl_801D3A3C = .sbss:0x801D3A3C; // type:object size:0x4 bot_pixels_in = .sbss:0x801D3A3C; // type:object size:0x4 scope:local
lbl_801D3A40 = .sbss:0x801D3A40; // type:object size:0x4 top_pixels_out = .sbss:0x801D3A40; // type:object size:0x4 scope:local
lbl_801D3A44 = .sbss:0x801D3A44; // type:object size:0x4 top_pixels_in = .sbss:0x801D3A44; // type:object size:0x4 scope:local
lbl_801D3A48 = .sbss:0x801D3A48; // type:object size:0x4 vstall = .sbss:0x801D3A48; // type:object size:0x4 scope:local
lbl_801D3A4C = .sbss:0x801D3A4C; // type:object size:0x4 vmiss = .sbss:0x801D3A4C; // type:object size:0x4 scope:local
lbl_801D3A50 = .sbss:0x801D3A50; // type:object size:0x4 vcheck = .sbss:0x801D3A50; // type:object size:0x4 scope:local
GlobalCounter = .sbss:0x801D3A54; // type:object size:0x4 data:4byte GlobalCounter = .sbss:0x801D3A54; // type:object size:0x4 data:4byte
VCounter = .sbss:0x801D3A58; // type:object size:0x4 data:4byte VCounter = .sbss:0x801D3A58; // type:object size:0x4 data:4byte
RumbleBit = .sbss:0x801D3A5C; // type:object size:0x4 scope:local data:4byte RumbleBit = .sbss:0x801D3A5C; // type:object size:0x4 scope:local data:4byte

View file

@ -15,35 +15,34 @@
extern FileListEntry _ovltbl[]; extern FileListEntry _ovltbl[];
u32 GlobalCounter; u32 GlobalCounter;
u32 lbl_801D3A50; static u32 vcheck;
u32 lbl_801D3A4C; static u32 vmiss;
u32 lbl_801D3A48; static u32 vstall;
u32 lbl_801D3A44; static u32 top_pixels_in;
u32 lbl_801D3A40; static u32 top_pixels_out;
u32 lbl_801D3A3C; static u32 bot_pixels_in;
u32 lbl_801D3A38; static u32 bot_pixels_out;
u32 lbl_801D3A34; static u32 clr_pixels_in;
u32 lbl_801D3A30; static u32 total_copy_clks;
u32 lbl_801D3A2C; static u32 cp_req;
u32 lbl_801D3A28; static u32 tc_req;
u32 lbl_801D3A24; static u32 cpu_rd_req;
u32 lbl_801D3A20; static u32 cpu_wr_req;
u32 lbl_801D3A1C; static u32 dsp_req;
u32 lbl_801D3A18; static u32 io_req;
u32 lbl_801D3A14; static u32 vi_req;
u32 lbl_801D3A10; static u32 pe_req;
u32 lbl_801D3A0C; static u32 rf_req;
u32 lbl_801D3A08; static u32 fi_req;
s32 HuDvdErrWait; s32 HuDvdErrWait;
s32 SystemInitF; s32 SystemInitF;
void main(void) { void main(void)
u32 sp14; {
u32 sp10; u32 met0;
s32 spC; u32 met1;
s32 sp8; s16 i;
s16 var_r31; s32 retrace;
s32 temp_r30;
HuDvdErrWait = 0; HuDvdErrWait = 0;
SystemInitF = 0; SystemInitF = 0;
@ -58,14 +57,14 @@ void main(void) {
HuDataInit(); HuDataInit();
HuPerfInit(); HuPerfInit();
HuPerfCreate("USR0", 0xFF, 0xFF, 0xFF, 0xFF); HuPerfCreate("USR0", 0xFF, 0xFF, 0xFF, 0xFF);
HuPerfCreate("USR1", 0, 0xFF, 0xFF, 0xFF); HuPerfCreate("USR1", 0, 0xFF, 0xFF, 0xFF);
WipeInit(RenderMode); WipeInit(RenderMode);
for (var_r31 = 0; var_r31 < 4; var_r31++) { for (i = 0; i < 4; i++) {
GWPlayerCfg[var_r31].character = -1; GWPlayerCfg[i].character = -1;
} }
omMasterInit(0, _ovltbl, 0x63, 1); omMasterInit(0, _ovltbl, OVL_COUNT, OVL_BOOT);
VIWaitForRetrace(); VIWaitForRetrace();
if (VIGetNextField() == 0) { if (VIGetNextField() == 0) {
@ -73,7 +72,7 @@ void main(void) {
VIWaitForRetrace(); VIWaitForRetrace();
} }
while (1) { while (1) {
temp_r30 = VIGetRetraceCount(); retrace = VIGetRetraceCount();
if (HuSoftResetButtonCheck() != 0 || HuDvdErrWait != 0) { if (HuSoftResetButtonCheck() != 0 || HuDvdErrWait != 0) {
continue; continue;
} }
@ -100,28 +99,31 @@ void main(void) {
pfDrawFonts(); pfDrawFonts();
HuPerfEnd(1); HuPerfEnd(1);
msmMusFdoutEnd(); msmMusFdoutEnd();
HuSysDoneRender(temp_r30); HuSysDoneRender(retrace);
GXReadGPMetric(&sp14, &sp10); GXReadGPMetric(&met0, &met1);
GXReadVCacheMetric(&lbl_801D3A50, &lbl_801D3A4C, &lbl_801D3A48); GXReadVCacheMetric(&vcheck, &vmiss, &vstall);
GXReadPixMetric(&lbl_801D3A44, &lbl_801D3A40, &lbl_801D3A3C, &lbl_801D3A38, &lbl_801D3A34, &lbl_801D3A30); GXReadPixMetric(&top_pixels_in, &top_pixels_out, &bot_pixels_in, &bot_pixels_out, &clr_pixels_in, &total_copy_clks);
GXReadMemMetric(&lbl_801D3A2C, &lbl_801D3A28, &lbl_801D3A24, &lbl_801D3A20, &lbl_801D3A1C, &lbl_801D3A18, &lbl_801D3A14, &lbl_801D3A10, &lbl_801D3A0C, &lbl_801D3A08); GXReadMemMetric(&cp_req, &tc_req, &cpu_rd_req, &cpu_wr_req, &dsp_req, &io_req, &vi_req, &pe_req, &rf_req, &fi_req);
HuPerfEnd(2); HuPerfEnd(2);
GlobalCounter++; GlobalCounter++;
} }
} }
void HuSysVWaitSet(s16 arg0) { void HuSysVWaitSet(s16 vcount)
minimumVcount = arg0; {
minimumVcountf = arg0; minimumVcount = vcount;
minimumVcountf = vcount;
} }
s16 HuSysVWaitGet(void) { s16 HuSysVWaitGet(void)
{
return (s16) minimumVcount; return (s16) minimumVcount;
} }
s32 rnd_seed = 0x0000D9ED; s32 rnd_seed = 0x0000D9ED;
s32 rand8(void) { s32 rand8(void)
{
rnd_seed = (rnd_seed * 0x41C64E6D) + 0x3039; rnd_seed = (rnd_seed * 0x41C64E6D) + 0x3039;
return (u8)(((rnd_seed + 1) >> 0x10) & 0xFF); return (u8)(((rnd_seed + 1) >> 16) & 0xFF);
} }