From 9166736d826e7b1167f9a69a37badb943acf0090 Mon Sep 17 00:00:00 2001 From: Lol Bozo Date: Tue, 23 Jul 2024 16:24:56 -0400 Subject: [PATCH 1/4] smaller CProg matches Matched CProg: Begin, SetRemain and End --- config/symbol_addrs.txt | 3 +++ include/gs.h | 5 +++++ include/prog.h | 18 ++++++++++++++++- src/P2/prog.c | 43 ++++++++++++++++++++++++++++++++++++++--- 4 files changed, 65 insertions(+), 4 deletions(-) diff --git a/config/symbol_addrs.txt b/config/symbol_addrs.txt index 8d9026d3..731a20ba 100644 --- a/config/symbol_addrs.txt +++ b/config/symbol_addrs.txt @@ -398,6 +398,9 @@ CcharmMost__Fv = 0x160D98; // type:func reload_post_death = 0x160DA0; // type:func +// P2/gs.c +ClearFrameBuffers__Fv = 0x168AF8; // type:func + g_pgsCur = 0x2623c0; // size:0x4 g_pwsCur = 0x2623c4; // size:0x4 diff --git a/include/gs.h b/include/gs.h index f1887650..d3de546a 100644 --- a/include/gs.h +++ b/include/gs.h @@ -10,4 +10,9 @@ // ... +/** + * +*/ +void ClearFrameBuffers(); + #endif // GS_H diff --git a/include/prog.h b/include/prog.h index 2f7d3db7..0376d5aa 100644 --- a/include/prog.h +++ b/include/prog.h @@ -5,10 +5,26 @@ #define PROG_H #include "common.h" +#include "binoc.h" class CProg { - // todo Implement class. + int m_fActive; + int m_nMax; + int m_nTarget; + int m_nRemain; + int m_cRetry; + + RGBA m_rgbaComplete; + RGBA m_rgbaRemain; + RGBA m_rgbaWarning; + RGBA m_rgbaTrouble; + +public: + void Begin(); + void SetRemain(int nRemain); + void End(); + void Draw(); }; #endif // PROG_H diff --git a/src/P2/prog.c b/src/P2/prog.c index 4f3fa1c0..5c76f55b 100644 --- a/src/P2/prog.c +++ b/src/P2/prog.c @@ -1,11 +1,48 @@ #include "common.h" +#include "prog.h" +#include "gs.h" INCLUDE_ASM(const s32, "P2/prog", __5CProgG4RGBAN31); -INCLUDE_ASM(const s32, "P2/prog", Begin__5CProg); +void CProg::Begin() +{ + this->m_fActive = 0; + this->m_cRetry = 0; + this->m_nRemain = 0; + this->m_nTarget = 0; + this->m_nMax = 0; +} -INCLUDE_ASM(const s32, "P2/prog", SetRemain__5CProgi); +void CProg::SetRemain(int nRemain) +{ + if (m_fActive != 0) + { + if (m_nTarget == 0) + { + m_nTarget = nRemain; + m_nMax = nRemain << 1; + ClearFrameBuffers(); + } + else if (this->m_nRemain == nRemain) + { + m_cRetry = m_cRetry + 1; + } + else + { + m_cRetry = 0; + } + this->m_nRemain = nRemain; + Draw(); + } +} -INCLUDE_ASM(const s32, "P2/prog", End__5CProg); +void CProg::End() +{ + this->m_fActive = 0; + this->m_cRetry = 0; + this->m_nRemain = 0; + this->m_nTarget = 0; + this->m_nMax = 0; +} INCLUDE_ASM(const s32, "P2/prog", Draw__5CProg); From 709c826e399888d01a21db3625364907c064ef2b Mon Sep 17 00:00:00 2001 From: Lol Bozo Date: Wed, 24 Jul 2024 02:15:40 -0400 Subject: [PATCH 2/4] CProg Constructor Match --- config/symbol_addrs.txt | 2 +- include/prog.h | 1 + src/P2/main.c | 1 + src/P2/prog.c | 16 ++++++++++++++-- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/config/symbol_addrs.txt b/config/symbol_addrs.txt index 731a20ba..1598bf93 100644 --- a/config/symbol_addrs.txt +++ b/config/symbol_addrs.txt @@ -518,7 +518,7 @@ g_phase = 0x269ba4; // size:0x4 // P2/prog.c -__5CProgG4RGBAN31 = 0x193210; // type:func +__5CProgP4RGBAN31 = 0x193210; // type:func Begin__5CProg = 0x193270; // type:func SetRemain__5CProgi = 0x193288; // type:func End__5CProg = 0x193300; // type:func diff --git a/include/prog.h b/include/prog.h index 0376d5aa..840c6b27 100644 --- a/include/prog.h +++ b/include/prog.h @@ -21,6 +21,7 @@ class CProg RGBA m_rgbaTrouble; public: + CProg(RGBA *rgbaComplete, RGBA *rgbaRemain, RGBA *rgbaWarning, RGBA *rgbaTrouble); void Begin(); void SetRemain(int nRemain); void End(); diff --git a/src/P2/main.c b/src/P2/main.c index ab087716..3ad1f5f2 100644 --- a/src/P2/main.c +++ b/src/P2/main.c @@ -1,5 +1,6 @@ #include "common.h" #include +#include "prog.h" // extern g_chpzArgs; // extern g_aphzArgs; diff --git a/src/P2/prog.c b/src/P2/prog.c index 5c76f55b..06516480 100644 --- a/src/P2/prog.c +++ b/src/P2/prog.c @@ -2,7 +2,19 @@ #include "prog.h" #include "gs.h" -INCLUDE_ASM(const s32, "P2/prog", __5CProgG4RGBAN31); +//INCLUDE_ASM(const s32, "P2/prog", __5CProgG4RGBAN31); +CProg::CProg(RGBA *rgbaComplete, RGBA *rgbaRemain, RGBA *rgbaWarning, RGBA *rgbaTrouble) +{ + m_rgbaComplete = *rgbaComplete; + m_rgbaRemain = *rgbaRemain; + m_rgbaWarning = *rgbaWarning; + m_rgbaTrouble = *rgbaTrouble; + m_fActive = 0; + m_cRetry = 0; + m_nRemain = 0; + m_nTarget = 0; + m_nMax = 0; +} void CProg::Begin() { @@ -13,7 +25,7 @@ void CProg::Begin() this->m_nMax = 0; } -void CProg::SetRemain(int nRemain) +void CProg::SetRemain(int nRemain) { if (m_fActive != 0) { From 5d92cebb0e923c02ba192ab64864aa453697c764 Mon Sep 17 00:00:00 2001 From: Lol Bozo Date: Sun, 28 Jul 2024 19:59:10 -0400 Subject: [PATCH 3/4] Style fixes Added comments to prog.h, other style fixes in prog.c and util.c --- config/symbol_addrs.txt | 2 ++ include/common.h | 2 ++ include/prog.h | 29 +++++++++++++++++++++++++++++ src/P2/prog.c | 21 ++++++++++----------- src/P2/util.c | 14 ++++++++------ 5 files changed, 51 insertions(+), 17 deletions(-) diff --git a/config/symbol_addrs.txt b/config/symbol_addrs.txt index 1598bf93..2ff418d9 100644 --- a/config/symbol_addrs.txt +++ b/config/symbol_addrs.txt @@ -5,6 +5,8 @@ _exit = 0x1000B8; // type:func // UKNOWN FILE UpdateSave__FP4SAVE = 0x18bdc8; // type:func +atan2f__Fff = 0x205778; // type:func + g_save = 0x264A40; diff --git a/include/common.h b/include/common.h index 74a70d2d..8c7c6982 100644 --- a/include/common.h +++ b/include/common.h @@ -10,4 +10,6 @@ #include "include_rodata.h" #include +float atan2f(float x, float y); + #endif /* COMMON_H */ diff --git a/include/prog.h b/include/prog.h index 840c6b27..ff9ebddb 100644 --- a/include/prog.h +++ b/include/prog.h @@ -21,10 +21,39 @@ class CProg RGBA m_rgbaTrouble; public: + +/** + * @brief Initializes CProg with RGBA values + * + * @param rgbaComplete Unknown + * @param rgbaRemain Unknown + * @param rgbaWarning Unknown + * @param rgbaTrouble Unknown + */ CProg(RGBA *rgbaComplete, RGBA *rgbaRemain, RGBA *rgbaWarning, RGBA *rgbaTrouble); + +/** + * @brief Zeroes out the variables + * + */ void Begin(); + +/** + * @brief Clear's Frame Buffers, Updates Remain and calls Draw + * + * @param nRemain new Remain value + */ void SetRemain(int nRemain); + +/** + * @brief Zeroes out the variables + * + */ void End(); + +/** + * @brief Unknown + */ void Draw(); }; diff --git a/src/P2/prog.c b/src/P2/prog.c index 06516480..6e5c2941 100644 --- a/src/P2/prog.c +++ b/src/P2/prog.c @@ -2,7 +2,6 @@ #include "prog.h" #include "gs.h" -//INCLUDE_ASM(const s32, "P2/prog", __5CProgG4RGBAN31); CProg::CProg(RGBA *rgbaComplete, RGBA *rgbaRemain, RGBA *rgbaWarning, RGBA *rgbaTrouble) { m_rgbaComplete = *rgbaComplete; @@ -18,11 +17,11 @@ CProg::CProg(RGBA *rgbaComplete, RGBA *rgbaRemain, RGBA *rgbaWarning, RGBA *rgba void CProg::Begin() { - this->m_fActive = 0; - this->m_cRetry = 0; - this->m_nRemain = 0; - this->m_nTarget = 0; - this->m_nMax = 0; + m_fActive = 0; + m_cRetry = 0; + m_nRemain = 0; + m_nTarget = 0; + m_nMax = 0; } void CProg::SetRemain(int nRemain) @@ -50,11 +49,11 @@ void CProg::SetRemain(int nRemain) void CProg::End() { - this->m_fActive = 0; - this->m_cRetry = 0; - this->m_nRemain = 0; - this->m_nTarget = 0; - this->m_nMax = 0; + m_fActive = 0; + m_cRetry = 0; + m_nRemain = 0; + m_nTarget = 0; + m_nMax = 0; } INCLUDE_ASM(const s32, "P2/prog", Draw__5CProg); diff --git a/src/P2/util.c b/src/P2/util.c index e13719d1..8db3c324 100644 --- a/src/P2/util.c +++ b/src/P2/util.c @@ -5,11 +5,12 @@ static const float PI = 3.14159265359f; float RadNormalize(float rad) { - if ((rad < -PI) || (PI < rad)) { - float modpos = GModPositive(rad + PI, 2 * PI); - rad = modpos - PI; - } - return rad; + if ((rad < -PI) || (PI < rad)) + { + float modpos = GModPositive(rad + PI, 2 * PI); + rad = modpos - PI; + } + return rad; } INCLUDE_ASM(const s32, "P2/util", GLimitAbs); @@ -30,7 +31,8 @@ INCLUDE_ASM(const s32, "P2/util", SmoothMatrix); const int PRIME_MOD = 0x95675; // Generates a random integer in the range [nLow, nHi] -int NRandInRange(int nLow, int nHi) { +int NRandInRange(int nLow, int nHi) +{ if (nLow == nHi) { return nLow; From a80c7e5e8961a5aabd1a04aae1ba478d6857b99b Mon Sep 17 00:00:00 2001 From: Zac Date: Mon, 29 Jul 2024 00:38:37 +0000 Subject: [PATCH 4/4] Minor tweaks and style changes --- config/symbol_addrs.txt | 115 +++++++++++++++++++++++++++++++--------- include/common.h | 4 +- include/prog.h | 59 ++++++++++----------- include/sce/math.h | 10 ++++ src/P2/main.c | 2 +- src/P2/prog.c | 4 +- 6 files changed, 133 insertions(+), 61 deletions(-) create mode 100644 include/sce/math.h diff --git a/config/symbol_addrs.txt b/config/symbol_addrs.txt index 2ff418d9..6b09c3d4 100644 --- a/config/symbol_addrs.txt +++ b/config/symbol_addrs.txt @@ -2,29 +2,34 @@ _start = 0x100008; // type:func _exit = 0x1000B8; // type:func -// UKNOWN FILE +//////////////////////////////////////////////////////////////// +// Unknown file +// Related to save files +//////////////////////////////////////////////////////////////// UpdateSave__FP4SAVE = 0x18bdc8; // type:func -atan2f__Fff = 0x205778; // type:func - g_save = 0x264A40; +//////////////////////////////////////////////////////////////// // P2/splice/spliceutils.cpp +//////////////////////////////////////////////////////////////// StartupSplice__Fv = 0x11BF70; // type:func ShutdownSplice__Fv = 0x11C040; // type:func spliceutils__static_initialization_and_destruction_0 = 0x11C0A8; // type:func _GLOBAL_$I$g_splotheapPair = 0x11C0E8; // type:func _GLOBAL_$D$g_splotheapPair = 0x11C108; // type:func - +//////////////////////////////////////////////////////////////// // P2/989snd.c +//////////////////////////////////////////////////////////////// snd_StreamSafeCdBreak = 0x11e2a0; // type:func snd_SendIOPCommandAndWait = 0x11e6b8; // type:func snd_SendIOPCommandNoWait = 0x11e8c8; // type:func - +//////////////////////////////////////////////////////////////// // P2/binoc.c +//////////////////////////////////////////////////////////////// InitBei = 0x130F48; // type:func GEvaluateBei = 0x131000; // type:func FUN_001310f0 = 0x1310F0; // type:func @@ -65,8 +70,9 @@ SetHorizontalJust__8CTextBox2JH = 0x137260; // type:func SetVerticalJust__8CTextBox2JV = 0x137268; // type:func _GLOBAL_$I$InitBei__FP3BEIP3CLQffi = 0x137270; // type:func - +//////////////////////////////////////////////////////////////// // P2/bis.c +//////////////////////////////////////////////////////////////// __18CBinaryInputStreamiPvi = 0x137290; // type:func DESTRUCTOR__CBinaryInputStream = 0x1372E0; // type:func FOpenSector__18CBinaryInputStreamUiUi = 0x137328; // type:func @@ -96,12 +102,14 @@ ReadBspc__18CBinaryInputStreamP4GEOMP4BSPC = 0x138278; // type:func ReadVbsp__18CBinaryInputStreamPiPP4VBSP = 0x138398; // type:func ReadStringSw__18CBinaryInputStreamPPc = 0x1384A0; // type:func - +//////////////////////////////////////////////////////////////// // P2/cd.c +//////////////////////////////////////////////////////////////// CdPath__FPcT0i = 0x140b60; // type:func - +//////////////////////////////////////////////////////////////// // P2/chkpnt.c +//////////////////////////////////////////////////////////////// ResetChkmgrCheckpoints__FP6CHKMGR = 0x140D90; // type:func SaveChkmgrCheckpoint__FP6CHKMGR3OIDT1 = 0x140E10; // type:func ReturnChkmgrToCheckpoint__FP6CHKMGR = 0x140ED0; // type:func @@ -121,8 +129,9 @@ UpdateChkpnt__FP6CHKPNTf = 0x141690; // type:func FUN_001417f0 = 0x1417F0; // type:func TriggerChkpnt__FP6CHKPNT = 0x141870; // type:func - +//////////////////////////////////////////////////////////////// // P2/clock.c +//////////////////////////////////////////////////////////////// SetClockRate__Ff = 0x142ED0; // type:func MarkClockTick__FP5CLOCK = 0x142F10; // type:func MarkClockTickRealOnly__FP5CLOCK = 0x143030; // type:func @@ -136,8 +145,9 @@ g_rtClockPowerUp = 0x261854; // size:0x4 g_clock = 0x261858; // size:0x20 s_tickLastRaw = 0x261878; // size:0x4 - +//////////////////////////////////////////////////////////////// // P2/cm.c +//////////////////////////////////////////////////////////////// CalcCmAdjust__FP2CMP2SOP6CPDEFIP6VECTOR = 0x143148; // type:func SpringCm__FfffP2CMP6VECTORP6VECTORP6VECTOR = 0x143180; // type:func AdjustCmCpdefi__FP2CMP2SOfP6CPDEFI = 0x143208; // type:func @@ -243,9 +253,9 @@ D_0026198C = 0x26198c; // size:0x4 g_pcm = 0x261990; // size:0x4 - +//////////////////////////////////////////////////////////////// // P2/coin.c - +//////////////////////////////////////////////////////////////// InitDprize__FP6DPRIZE = 0x146340; // type:func LoadDprizeFromBrx__FP6DPRIZEP18CBinaryInputStream = 0x1463C0; // type:func CloneDprize__FP6DPRIZET0 = 0x146418; // type:func @@ -288,8 +298,9 @@ CollectLifetkn__FP7LIFETKN = 0x148FF0; // type:func FUN_00149168 = 0x149168; // type:func break_bottle = 0x149190; // type:func - +//////////////////////////////////////////////////////////////// // P2/difficulty.c +//////////////////////////////////////////////////////////////// PdifficultyEnsureSw = 0x1519E0; // type:func OnDifficultyGameLoad__FP10DIFFICULTY = 0x151A68; // type:func OnDifficultyWorldPreLoad = 0x151A88; // type:func @@ -306,8 +317,9 @@ g_difficultyHard = 0x261e30; // size:0x5c g_difficultyEasy = 0x261e90; // size:0x5c g_difficulty = 0x261ef0; // size:0x20 - +//////////////////////////////////////////////////////////////// // P2/find.c +//////////////////////////////////////////////////////////////// PdlFromSwOid__FP2SW3OID = 0x159F20; // type:func MatchSwObject__FP2LOiiiT0iPiPP2LOT6 = 0x159F48; // type:func CploFindSwObjects__FP2SWi3OIDP2LOiPP2LO = 0x15A198; // type:func @@ -319,8 +331,9 @@ CploFindSwObjectsByClass__FP2SWi3CIDP2LOiPP2LO = 0x15A4F0; // type:func PloFindSwObjectByClass__FP2SWi3CIDP2LO = 0x15A838; // type:func PaloFindLoCommonParent__FP2LOT0 = 0x15A868; // type:func - +//////////////////////////////////////////////////////////////// // P2/flash.c +//////////////////////////////////////////////////////////////// InitFlash__FP5FLASH = 0x15A8B0; // type:func LoadFlashFromBrx__FP5FLASHP18CBinaryInputStream = 0x15A918; // type:func UpdateFlash__FP5FLASHf = 0x15A960; // type:func @@ -328,13 +341,14 @@ RenderFlashSelf__FP5FLASHP2CMP2RO = 0x15A9A8; // type:func FPosFlashWithin__FP5FLASHP6VECTOR = 0x15AA50; // type:func - +//////////////////////////////////////////////////////////////// // P2/font.c - +//////////////////////////////////////////////////////////////// g_pfont = 0x26227C; // size:0x4 - +//////////////////////////////////////////////////////////////// // P2/frm.c +//////////////////////////////////////////////////////////////// StartupFrame__Fv = 0x15E810; // type:func OpenFrame__Fv = 0x15E9F0; // type:func EnsureVu1Code__FP4VIFSPvT1 = 0x15EAE0; // type:func @@ -351,8 +365,9 @@ BlendPrevFrame__Fv = 0x15F320; // type:func g_cframe = 0x2622cc; // size:0x4 - +//////////////////////////////////////////////////////////////// // P2/game.c +//////////////////////////////////////////////////////////////// StartupGame__Fv = 0x160070; // type:func search_level_by_load_data = 0x1600A0; // type:func @@ -400,23 +415,25 @@ CcharmMost__Fv = 0x160D98; // type:func reload_post_death = 0x160DA0; // type:func -// P2/gs.c -ClearFrameBuffers__Fv = 0x168AF8; // type:func - - +// data g_pgsCur = 0x2623c0; // size:0x4 g_pwsCur = 0x2623c4; // size:0x4 g_plsCur = 0x2623c8; // size:0x4 g_worldlevelPrev = 0x2623cc; // size:0x4 chz_none = 0x2623d0; // size:0x7 - // static g_gsCur = 0xea0; // size:0x1a00 +//////////////////////////////////////////////////////////////// +// P2/gs.c +// Graphics synthesizer +//////////////////////////////////////////////////////////////// +ClearFrameBuffers__Fv = 0x168AF8; // type:func - +//////////////////////////////////////////////////////////////// // P2/joy.c +//////////////////////////////////////////////////////////////// StartupJoy__Fv = 0x16E0B8; // type:func AddGrfusr__Fi = 0x16E0F0; // type:func RemoveGrfusr__Fi = 0x16E118; // type:func @@ -445,7 +462,9 @@ StartupCodes__Fv = 0x16F588; // type:func g_joy = 0x262C70; // size:0xc4 +//////////////////////////////////////////////////////////////// // P2/jt.c +//////////////////////////////////////////////////////////////// InitJt__FP2JT = 0x16F608; // type:func LoadJtFromBrx__FP2JTP18CBinaryInputStream = 0x16F7B0; // type:func PostJtLoad__FP2JT = 0x16F810; // type:func @@ -495,7 +514,9 @@ CollectJtPrize__FP2JT3PCKP3ALO = 0x177E70; // type:func PlayJtDialog__FP2JTP6DIALOG = 0x177F98; // type:func +//////////////////////////////////////////////////////////////// // P2/main.c +//////////////////////////////////////////////////////////////// main = 0x185758; // type:func main_epilogue = 0x1858f8; // type:func StartupVU0__Fv = 0x185A58; // type:func @@ -506,20 +527,26 @@ g_chpzArgs = 0x264834; // size:0x4 g_aphzArgs = 0x264838; // size:0x4 +//////////////////////////////////////////////////////////////// // P2/mpeg.c +//////////////////////////////////////////////////////////////// ExecuteOids__5CMpeg = 0x18f148; // type:func g_mpeg = 0x269A00; +//////////////////////////////////////////////////////////////// // P2/phasemem.c +//////////////////////////////////////////////////////////////// SetPhase__F5PHASE = 0x191E70; // type:func ClearPhase__Fv = 0x191EB0; // type:func g_phase = 0x269ba4; // size:0x4 +//////////////////////////////////////////////////////////////// // P2/prog.c +//////////////////////////////////////////////////////////////// __5CProgP4RGBAN31 = 0x193210; // type:func Begin__5CProg = 0x193270; // type:func SetRemain__5CProgi = 0x193288; // type:func @@ -527,12 +554,16 @@ End__5CProg = 0x193300; // type:func Draw__5CProg = 0x193318; // type:func +//////////////////////////////////////////////////////////////// // P2/render.c +//////////////////////////////////////////////////////////////// RenderSw__FP2SWP2CM = 0x19d6c0; // type:func DrawSw__FP2SWP2CM = 0x19DC98; // type:func +//////////////////////////////////////////////////////////////// // P2/screen.c +//////////////////////////////////////////////////////////////// StartupScreen__Fv = 0x1A9C68; // type:func PostBlotsLoad__Fv = 0x1A9F78; // type:func UpdateBlots__Fv = 0x1A9FD0; // type:func @@ -631,23 +662,31 @@ g_unkblot6 = 0x26dfc8; // size:0x280 g_unkblot7 = 0x26e248; // size:0x280 +//////////////////////////////////////////////////////////////// // P2/steppower.c +//////////////////////////////////////////////////////////////// SetFsp__F3FSP = 0x1D29C8; // type:func UpdateJtActivePowerUp__FP2JTP3JOY = 0x1d2bb8; // type:func IRotatePowerUp__FP3JOYiiPi = 0x1d3100; // type:func +//////////////////////////////////////////////////////////////// // P2/sw.c +//////////////////////////////////////////////////////////////// g_psw = 0x275710; // size:0x4 +//////////////////////////////////////////////////////////////// // P2/transition.c +//////////////////////////////////////////////////////////////// Execute__11CTransition = 0x1e4ea8; // type:func g_transition = 0x275af0; +//////////////////////////////////////////////////////////////// // P2/ui.c +//////////////////////////////////////////////////////////////// StartupUi__Fv = 0x1E9088; // type:func InitUi__FP2UI = 0x1E90A8; // type:func PostUiLoad__FP2UI = 0x1E90E8; // type:func @@ -668,7 +707,9 @@ check_anticrack_collectibles_Fv = 0x1E9B30; // type:func g_ui = 0x275BC0; +//////////////////////////////////////////////////////////////// // P2/util.c +//////////////////////////////////////////////////////////////// RadNormalize__Ff = 0x1EA408; // type:func GLimitAbs = 0x1EA480; // type:func GSmooth = 0x1EA4B8; // type:func @@ -696,7 +737,9 @@ Force__FPv = 0x1EB160; // type:func MinimizeRange = 0x1EB168; // type:func +//////////////////////////////////////////////////////////////// // P2/vec.c +//////////////////////////////////////////////////////////////// SetVectorCylind__FP6VECTORfff = 0x1ED650; // type:func SetVectorSphere__FP6VECTORfff = 0x1ED6B0; // type:func SProjectVector = 0x1ED738; // type:func @@ -713,12 +756,16 @@ FCalculateMuzzleVelocityAngle__FP6VECTORT0fT0P2SO = 0x1EE290; // type:func LimitVectorLength = 0x1EE2B0; // type:func +//////////////////////////////////////////////////////////////// // P2/wipe.c +//////////////////////////////////////////////////////////////// g_pwipe = 0x275f80; g_wipe = 0x275f84; +//////////////////////////////////////////////////////////////// // P2/xform.c +//////////////////////////////////////////////////////////////// InitXfm__FP3XFM = 0x1F39F8; // type:func LoadXfmFromBrx__FP3XFMP18CBinaryInputStream = 0x1F3A40; // type:func SetXfmParent__FP3XFMP3ALO = 0x1F3A90; // type:func @@ -746,19 +793,33 @@ PostCameraLoad__FP6CAMERA = 0x1F4E48; // type:func EnableCamera__FP6CAMERA = 0x1F4ED0; // type:func +//////////////////////////////////////////////////////////////// // sce/ee/gcc/src/gcc/libgcc2.c +//////////////////////////////////////////////////////////////// __main__Fv = 0x1fae18; // type:func +//////////////////////////////////////////////////////////////// +// sce/ee/gcc/src/newlib/libm/math/wf_atan2.c +//////////////////////////////////////////////////////////////// +atan2f = 0x205778; // type:func + + +//////////////////////////////////////////////////////////////// // sce/eecdvd.c +//////////////////////////////////////////////////////////////// sceCdBreak = 0x203e28; // type:func +//////////////////////////////////////////////////////////////// // sce/filestub.c +//////////////////////////////////////////////////////////////// sceClose = 0x1f8c38; // type:func +//////////////////////////////////////////////////////////////// // sce/rand.c +//////////////////////////////////////////////////////////////// srand = 0x1F66F8; // type:func rand = 0x1F6708; // type:func @@ -766,11 +827,15 @@ g_rng = 0x276680; // size:0x5c g_prng = 0x27696c; // size:0x4 +//////////////////////////////////////////////////////////////// // gcc/dp-bit.c +//////////////////////////////////////////////////////////////// dpcmp = 0x1FD308; // type:func fptodp = 0x1FD868; // type:func +//////////////////////////////////////////////////////////////// // misc +//////////////////////////////////////////////////////////////// memset = 0x1F5C0C; // type:func __floatdisf = 0x1fb6b0; // type:func diff --git a/include/common.h b/include/common.h index 8c7c6982..d96359a0 100644 --- a/include/common.h +++ b/include/common.h @@ -8,8 +8,6 @@ #include "include_asm.h" #include "include_rodata.h" -#include - -float atan2f(float x, float y); +#include "types.h" #endif /* COMMON_H */ diff --git a/include/prog.h b/include/prog.h index ff9ebddb..3ff09723 100644 --- a/include/prog.h +++ b/include/prog.h @@ -5,7 +5,7 @@ #define PROG_H #include "common.h" -#include "binoc.h" +#include class CProg { @@ -14,46 +14,45 @@ class CProg int m_nTarget; int m_nRemain; int m_cRetry; - + RGBA m_rgbaComplete; RGBA m_rgbaRemain; RGBA m_rgbaWarning; RGBA m_rgbaTrouble; public: - -/** - * @brief Initializes CProg with RGBA values - * - * @param rgbaComplete Unknown - * @param rgbaRemain Unknown - * @param rgbaWarning Unknown - * @param rgbaTrouble Unknown - */ + /** + * @brief Initializes CProg with RGBA values + * + * @param rgbaComplete Unknown + * @param rgbaRemain Unknown + * @param rgbaWarning Unknown + * @param rgbaTrouble Unknown + */ CProg(RGBA *rgbaComplete, RGBA *rgbaRemain, RGBA *rgbaWarning, RGBA *rgbaTrouble); - -/** - * @brief Zeroes out the variables - * - */ + + /** + * @brief Zeroes out the variables + * + */ void Begin(); - -/** - * @brief Clear's Frame Buffers, Updates Remain and calls Draw - * - * @param nRemain new Remain value - */ + + /** + * @brief Clear's Frame Buffers, Updates Remain and calls Draw + * + * @param nRemain new Remain value + */ void SetRemain(int nRemain); - -/** - * @brief Zeroes out the variables - * - */ + + /** + * @brief Zeroes out the variables + * + */ void End(); -/** - * @brief Unknown - */ + /** + * @brief Unknown + */ void Draw(); }; diff --git a/include/sce/math.h b/include/sce/math.h new file mode 100644 index 00000000..c1d32cf5 --- /dev/null +++ b/include/sce/math.h @@ -0,0 +1,10 @@ +""" +@file math.h + +@brief Library math functions. +""" + +extern "C" +{ + float atan2f(float x, float y); +} diff --git a/src/P2/main.c b/src/P2/main.c index 3ad1f5f2..9511d9f5 100644 --- a/src/P2/main.c +++ b/src/P2/main.c @@ -1,6 +1,6 @@ #include "common.h" #include -#include "prog.h" +#include // extern g_chpzArgs; // extern g_aphzArgs; diff --git a/src/P2/prog.c b/src/P2/prog.c index 6e5c2941..ae1d957c 100644 --- a/src/P2/prog.c +++ b/src/P2/prog.c @@ -1,6 +1,6 @@ #include "common.h" -#include "prog.h" -#include "gs.h" +#include +#include CProg::CProg(RGBA *rgbaComplete, RGBA *rgbaRemain, RGBA *rgbaWarning, RGBA *rgbaTrouble) {