diff --git a/config/GMPE01_00/symbols.txt b/config/GMPE01_00/symbols.txt index 922ccfa3..f5df7bf8 100644 --- a/config/GMPE01_00/symbols.txt +++ b/config/GMPE01_00/symbols.txt @@ -6027,25 +6027,25 @@ dspSlaveLength = .sdata:0x801D39F0; // type:object size:0x2 data:2byte SendCount = .sdata:0x801D39F8; // type:object size:0x1 scope:local data:byte SystemInitF = .sbss:0x801D3A00; // type:object size:0x4 data:4byte HuDvdErrWait = .sbss:0x801D3A04; // type:object size:0x4 data:4byte -lbl_801D3A08 = .sbss:0x801D3A08; // type:object size:0x4 -lbl_801D3A0C = .sbss:0x801D3A0C; // type:object size:0x4 -lbl_801D3A10 = .sbss:0x801D3A10; // type:object size:0x4 -lbl_801D3A14 = .sbss:0x801D3A14; // type:object size:0x4 -lbl_801D3A18 = .sbss:0x801D3A18; // type:object size:0x4 -lbl_801D3A1C = .sbss:0x801D3A1C; // type:object size:0x4 -lbl_801D3A20 = .sbss:0x801D3A20; // type:object size:0x4 -lbl_801D3A24 = .sbss:0x801D3A24; // type:object size:0x4 -lbl_801D3A28 = .sbss:0x801D3A28; // type:object size:0x4 -lbl_801D3A2C = .sbss:0x801D3A2C; // type:object size:0x4 -lbl_801D3A30 = .sbss:0x801D3A30; // type:object size:0x4 -lbl_801D3A34 = .sbss:0x801D3A34; // type:object size:0x4 -lbl_801D3A38 = .sbss:0x801D3A38; // type:object size:0x4 -lbl_801D3A3C = .sbss:0x801D3A3C; // type:object size:0x4 -lbl_801D3A40 = .sbss:0x801D3A40; // type:object size:0x4 -lbl_801D3A44 = .sbss:0x801D3A44; // type:object size:0x4 -lbl_801D3A48 = .sbss:0x801D3A48; // type:object size:0x4 -lbl_801D3A4C = .sbss:0x801D3A4C; // type:object size:0x4 -lbl_801D3A50 = .sbss:0x801D3A50; // type:object size:0x4 +fi_req = .sbss:0x801D3A08; // type:object size:0x4 scope:local +rf_req = .sbss:0x801D3A0C; // type:object size:0x4 scope:local +pe_req = .sbss:0x801D3A10; // type:object size:0x4 scope:local +vi_req = .sbss:0x801D3A14; // type:object size:0x4 scope:local +io_req = .sbss:0x801D3A18; // type:object size:0x4 scope:local +dsp_req = .sbss:0x801D3A1C; // type:object size:0x4 scope:local +cpu_wr_req = .sbss:0x801D3A20; // type:object size:0x4 scope:local +cpu_rd_req = .sbss:0x801D3A24; // type:object size:0x4 scope:local +tc_req = .sbss:0x801D3A28; // type:object size:0x4 scope:local +cp_req = .sbss:0x801D3A2C; // type:object size:0x4 scope:local +total_copy_clks = .sbss:0x801D3A30; // type:object size:0x4 scope:local +clr_pixels_in = .sbss:0x801D3A34; // type:object size:0x4 scope:local +bot_pixels_out = .sbss:0x801D3A38; // type:object size:0x4 scope:local +bot_pixels_in = .sbss:0x801D3A3C; // type:object size:0x4 scope:local +top_pixels_out = .sbss:0x801D3A40; // type:object size:0x4 scope:local +top_pixels_in = .sbss:0x801D3A44; // type:object size:0x4 scope:local +vstall = .sbss:0x801D3A48; // type:object size:0x4 scope:local +vmiss = .sbss:0x801D3A4C; // type:object size:0x4 scope:local +vcheck = .sbss:0x801D3A50; // type:object size:0x4 scope:local GlobalCounter = .sbss:0x801D3A54; // 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 diff --git a/src/game/main.c b/src/game/main.c index 1e0e3415..7fe5b41f 100644 --- a/src/game/main.c +++ b/src/game/main.c @@ -15,35 +15,34 @@ extern FileListEntry _ovltbl[]; u32 GlobalCounter; -u32 lbl_801D3A50; -u32 lbl_801D3A4C; -u32 lbl_801D3A48; -u32 lbl_801D3A44; -u32 lbl_801D3A40; -u32 lbl_801D3A3C; -u32 lbl_801D3A38; -u32 lbl_801D3A34; -u32 lbl_801D3A30; -u32 lbl_801D3A2C; -u32 lbl_801D3A28; -u32 lbl_801D3A24; -u32 lbl_801D3A20; -u32 lbl_801D3A1C; -u32 lbl_801D3A18; -u32 lbl_801D3A14; -u32 lbl_801D3A10; -u32 lbl_801D3A0C; -u32 lbl_801D3A08; +static u32 vcheck; +static u32 vmiss; +static u32 vstall; +static u32 top_pixels_in; +static u32 top_pixels_out; +static u32 bot_pixels_in; +static u32 bot_pixels_out; +static u32 clr_pixels_in; +static u32 total_copy_clks; +static u32 cp_req; +static u32 tc_req; +static u32 cpu_rd_req; +static u32 cpu_wr_req; +static u32 dsp_req; +static u32 io_req; +static u32 vi_req; +static u32 pe_req; +static u32 rf_req; +static u32 fi_req; s32 HuDvdErrWait; s32 SystemInitF; -void main(void) { - u32 sp14; - u32 sp10; - s32 spC; - s32 sp8; - s16 var_r31; - s32 temp_r30; +void main(void) +{ + u32 met0; + u32 met1; + s16 i; + s32 retrace; HuDvdErrWait = 0; SystemInitF = 0; @@ -58,14 +57,14 @@ void main(void) { HuDataInit(); HuPerfInit(); HuPerfCreate("USR0", 0xFF, 0xFF, 0xFF, 0xFF); - HuPerfCreate("USR1", 0, 0xFF, 0xFF, 0xFF); + HuPerfCreate("USR1", 0, 0xFF, 0xFF, 0xFF); WipeInit(RenderMode); - for (var_r31 = 0; var_r31 < 4; var_r31++) { - GWPlayerCfg[var_r31].character = -1; + for (i = 0; i < 4; i++) { + GWPlayerCfg[i].character = -1; } - omMasterInit(0, _ovltbl, 0x63, 1); + omMasterInit(0, _ovltbl, OVL_COUNT, OVL_BOOT); VIWaitForRetrace(); if (VIGetNextField() == 0) { @@ -73,7 +72,7 @@ void main(void) { VIWaitForRetrace(); } while (1) { - temp_r30 = VIGetRetraceCount(); + retrace = VIGetRetraceCount(); if (HuSoftResetButtonCheck() != 0 || HuDvdErrWait != 0) { continue; } @@ -100,28 +99,31 @@ void main(void) { pfDrawFonts(); HuPerfEnd(1); msmMusFdoutEnd(); - HuSysDoneRender(temp_r30); - GXReadGPMetric(&sp14, &sp10); - GXReadVCacheMetric(&lbl_801D3A50, &lbl_801D3A4C, &lbl_801D3A48); - GXReadPixMetric(&lbl_801D3A44, &lbl_801D3A40, &lbl_801D3A3C, &lbl_801D3A38, &lbl_801D3A34, &lbl_801D3A30); - GXReadMemMetric(&lbl_801D3A2C, &lbl_801D3A28, &lbl_801D3A24, &lbl_801D3A20, &lbl_801D3A1C, &lbl_801D3A18, &lbl_801D3A14, &lbl_801D3A10, &lbl_801D3A0C, &lbl_801D3A08); + HuSysDoneRender(retrace); + GXReadGPMetric(&met0, &met1); + GXReadVCacheMetric(&vcheck, &vmiss, &vstall); + GXReadPixMetric(&top_pixels_in, &top_pixels_out, &bot_pixels_in, &bot_pixels_out, &clr_pixels_in, &total_copy_clks); + 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); GlobalCounter++; } } -void HuSysVWaitSet(s16 arg0) { - minimumVcount = arg0; - minimumVcountf = arg0; +void HuSysVWaitSet(s16 vcount) +{ + minimumVcount = vcount; + minimumVcountf = vcount; } -s16 HuSysVWaitGet(void) { +s16 HuSysVWaitGet(void) +{ return (s16) minimumVcount; } s32 rnd_seed = 0x0000D9ED; -s32 rand8(void) { +s32 rand8(void) +{ rnd_seed = (rnd_seed * 0x41C64E6D) + 0x3039; - return (u8)(((rnd_seed + 1) >> 0x10) & 0xFF); + return (u8)(((rnd_seed + 1) >> 16) & 0xFF); }