sinit fix for debug

This commit is contained in:
SwareJonge 2023-08-25 00:44:26 +02:00
parent aae7a5f030
commit e0277b29bd
21 changed files with 281 additions and 33 deletions

View File

@ -566,9 +566,9 @@ src/Bando/EngineSound.cpp:
.data: [0x80393760, 0x803937b8]
src/Inagaki/GameAudioHostIO.cpp:
.text: [0x8011b264, 0x8011b2c4] # 0x8011b478
#.ctors: [0x80316194, 0x80316198]
#.bss: [0x803c93a8, 0x803c9400]
.text: [0x8011b264, 0x8011b478]
.ctors: [0x80316194, 0x80316198]
.bss: [0x803c93a8, 0x803c9400]
.sdata2: [0x80418960, 0x80418968]
src/Kameda/Scene.cpp:
@ -583,18 +583,18 @@ src/Kaneshige/HioMgr.cpp:
src/Kaneshige/KartInfo.cpp:
.text: [0x801a8844, 0x801a8f54]
#.ctors: [0x80316274, 0x80316278]
.ctors: [0x80316274, 0x80316278]
.rodata: [0x803770f8, 0x80377378]
.data: [0x80395bf0, 0x80395c98]
#.bss: [0x803ca7c8, 0x803ca7f8]
.bss: [0x803ca7c8, 0x803ca7f8]
.sdata2: [0x80419dc8, 0x80419dd0]
src/Kaneshige/KartChecker.cpp:
.text: [0x801a9040, 0x801ac4b4]
#.ctors: [0x80316278, 0x0x8031627c]
.text: [0x801a9040, 0x801ac5a0]
.ctors: [0x80316278, 0x8031627c]
.rodata: [0x80377378, 0x80377640]
.data: [0x80395c98, 0x80395cd8]
#.bss: [0x803ca7f8, 0x803ca828]
.bss: [0x803ca7f8, 0x803ca828]
.sdata: [0x80414618, 0x80414628]
.sbss: [0x804163a0, 0x804163a8]
.sdata2: [0x80419dd0, 0x80419e18]
@ -617,7 +617,7 @@ src/Kaneshige/CenterLine.cpp:
.text: [0x801b4e4c, 0x801b5098]
src/Kaneshige/RaceInfo.cpp:
.text: [0x801b5098, 0x801b5e14] # excludes __sinit_RaceInfo_cpp and __dt__8RaceInfoFv
.text: [0x801b5098, 0x801b5e14] # excludes __sinit_RaceInfo_cpp and __dt__8RaceInfoFv (0x801b5f78)
#.ctors: [0x8031628c, 0x80316290]
.rodata: [0x80378500, 0x80378698]
.data: [0x80395e08, 0x80395e30]
@ -661,11 +661,11 @@ src/Osako/main.cpp:
.text: [0x801f75f4, 0x801f7618]
src/Osako/system.cpp:
.text: [0x801feb10, 0x801ffe80] # exclude __sinit_system_cpp (801fff8c)
#.ctors: [0x8031637c, 0x80316380]
.text: [0x801feb10, 0x801fff8c]
.ctors: [0x8031637c, 0x80316380]
.rodata: [0x8037d5e8, 0x8037d658]
.data: [0x8039cac0, 0x8039caf8]
#.bss: [0x803d08f0, 0x803d0920]
.bss: [0x803d08f0, 0x803d0920]
.sbss: [0x80416968, 0x80416998]
.sdata2: [0x8041b688, 0x8041b6e8]
@ -713,19 +713,22 @@ src/Sato/stMath.cpp:
.sdata2: [0x8041bb60, 0x8041bbb8]
src/Yamamoto/kartvec.cpp:
.text: [0x802e5210, 0x802e63fc] # 0x802e64e8
#.ctors: [0x803165e4, 0x803165e8]
#.bss: [0x803ef020, 0x803ef050]
.text: [0x802e5210, 0x802e64e8]
.ctors: [0x803165e4, 0x803165e8]
.bss: [0x803ef020, 0x803ef050]
.sdata2: [0x8041d7f8, 0x8041d830]
src/Yamamoto/KartStar.cpp:
.text: [0x80307c44, 0x80307dcc] # 0x80307eb8
#.ctors: [0x80316628, 0x8031662c]
.text: [0x80307c44, 0x80307eb8]
.ctors: [0x80316628, 0x8031662c]
.bss: [0x803ef350, 0x803ef380]
src/Yamamoto/KartTire.cpp:
.text: [0x80307eb8, 0x80307f08] # 0x80307ff4
#.ctors: [0x8031662c, 0x80316630]
.text: [0x80307eb8, 0x80307ff4]
.ctors: [0x8031662c, 0x80316630]
.bss: [0x803ef380, 0x803ef3b0]
src/Yamamoto/KartApeendix.cpp:
.text: [0x80312154, 0x803121a0] # 0x8031228c
#.ctors: [0x80316648, 0x8031664c]
src/Yamamoto/KartApeendix.cpp: # 0x8031228c
.text: [0x80312154, 0x803121a0] #
#.ctors: [0x80316648, 0x8031664c]
#.bss: [0x803ef4d0, 0x803ef500]

View File

@ -18420,6 +18420,20 @@ global:
0x8041d288: sAnmTable__15TMapObjMareBase
0x8041d2a8: sAnmTable__16TMapObjMonteBase
0x8041d3b0: sAnmTable__13TMapObjPakkun
# mempool leak
0x804159ec: __init__memPool___58JASPoolAllocObject_MultiThreaded<Q28JASTrack11TChannelMgr>
0x804159ed: __init__memPool___43JASPoolAllocObject_MultiThreaded<8JASTrack>
0x804159ee: __init__memPool___46JASPoolAllocObject_MultiThreaded<10JASChannel>
0x804159ef: __init__memPool___30JASPoolAllocObject<9JAIStream>
0x804159f0: __init__memPool___27JASPoolAllocObject<6JAISeq>
0x804159f1: __init__memPool___26JASPoolAllocObject<5JAISe>
0x80415a00: __init__memPool___35JASPoolAllocObject<13JAISoundChild>
0x80415b24: __init__memPool___35JASPoolAllocObject<13JAUAudible<4>>
0x80415b28: __init__memPool___42JASPoolAllocObject<20JAUDopplerAudible<4>>
0x80415b29: __init__memPool___42JASPoolAllocObject<20JAUDopplerAudible<2>>
0x80415b2a: __init__memPool___42JASPoolAllocObject<20JAUDopplerAudible<1>>
0x80415b2b: __init__memPool___35JASPoolAllocObject<13JAUAudible<2>>
0x80415b2c: __init__memPool___35JASPoolAllocObject<13JAUAudible<1>>
src/JKRAram.cpp:
0x80079ee4: decompSZS_subroutine__FPUcPUc
0x8007a17c: firstSrcData__Fv

View File

@ -0,0 +1,16 @@
#ifndef JAUDIO_JASFAKEMATCH_H
#define JAUDIO_JASFAKEMATCH_H
#if defined(MATCHING) && defined(DEBUG) // TODO: fix release
#include "JSystem/JAudio/System/JASMemPool.h"
#include "JSystem/JAudio/System/JASTrack.h"
JASMemPool_MultiThreaded<JASTrack::TChannelMgr> JASPoolAllocObject_MultiThreaded<JASTrack::TChannelMgr>::memPool_;
JASMemPool_MultiThreaded<JASTrack> JASPoolAllocObject_MultiThreaded<JASTrack>::memPool_;
JASMemPool_MultiThreaded<JASChannel> JASPoolAllocObject_MultiThreaded<JASChannel>::memPool_;
#endif
#endif

View File

@ -0,0 +1,14 @@
#ifndef JAUDIO_JASFAKEMATCH2_H
#define JAUDIO_JASFAKEMATCH2_H
#if defined(MATCHING) && defined(DEBUG)
#include "JSystem/JAudio/System/JASMemPool.h"
#include "JSystem/JAudio/System/JASTrack.h"
class JAISe;
#include "JSystem/JAudio/JASFakeMatch.h"
JASMemPool<JAISe> JASPoolAllocObject<JAISe>::memPool_;
#endif
#endif

View File

@ -0,0 +1,20 @@
#ifndef JAUDIO_JASFAKEMATCH3_H
#define JAUDIO_JASFAKEMATCH3_H
#if defined(MATCHING) && defined(DEBUG) // TODO: fix release
#include "JSystem/JAudio/System/JASMemPool.h"
#include "JSystem/JAudio/System/JASTrack.h"
class JAIStream;
class JAISoundChild;
class JAISeq;
class JAISe;
#include "JSystem/JAudio/JASFakeMatch.h"
JASMemPool<JAIStream> JASPoolAllocObject<JAIStream>::memPool_;
JASMemPool<JAISoundChild> JASPoolAllocObject<JAISoundChild>::memPool_;
JASMemPool<JAISeq> JASPoolAllocObject<JAISeq>::memPool_;
JASMemPool<JAISe> JASPoolAllocObject<JAISe>::memPool_;
#endif
#endif

View File

@ -0,0 +1,58 @@
#ifndef JAUDIO_JASMEMPOOL_H
#define JAUDIO_JASMEMPOOL_H
#include "types.h"
#include <dolphin/os.h>
struct JASGenericMemPool
{
JASGenericMemPool();
void free(void *, u32);
u32 _0[4];
};
template <typename T>
struct JASMemPool : public JASGenericMemPool
{
JASMemPool<T>() : JASGenericMemPool() {}
~JASMemPool<T>();
};
template <typename T>
struct JASPoolAllocObject
{
static void operator delete(void *mem, u32 n)
{
BOOL inter = OSDisableInterrupts();
memPool_.free(mem, n);
OSRestoreInterrupts(inter);
}
static JASMemPool<T> memPool_;
static bool __init__memPool_;
};
template <typename T>
struct JASMemPool_MultiThreaded : public JASGenericMemPool
{
JASMemPool_MultiThreaded<T>() : JASGenericMemPool() { }
~JASMemPool_MultiThreaded<T>();
};
template <typename T>
struct JASPoolAllocObject_MultiThreaded
{
static void operator delete(void *mem, u32 n)
{
BOOL inter = OSDisableInterrupts();
memPool_.free(mem, n);
OSRestoreInterrupts(inter);
}
static JASMemPool_MultiThreaded<T> memPool_;
static bool __init__memPool_;
};
#endif

View File

@ -0,0 +1,103 @@
#ifndef JAUDIO_TCHANNELMGR_H
#define JAUDIO_TCHANNELMGR_H
#include "types.h"
#include "JSystem/JAudio/System/JASSoundParams.h"
class JASChannel;
class JASTrack
{
public:
class MoveParam_
{
MoveParam_(); // 0x800a0270
};
class TChannelMgr
{
TChannelMgr(JASTrack *); // 0x800a3e4c
void init(); // 0x800a3ec0
void releaseAll(); // 0x800a3f30
void noteOff(u32, u16); // 0x800a3fac
void setPauseFlag(bool); // 0x800a4088
};
class TList
{
void append(JASTrack *); // 0x800a3c3c
void seqMain(); // 0x800a3cf0
virtual ~TList(); // 0x800a42d8
};
JASTrack(); // 0x800a018c
~JASTrack(); // 0x800a0288
void setChannelMgrCount(u32); // 0x800a0374
void init(); // 0x800a0544
void initTimed(); // 0x800a09e8
void assignExtBuffer(u32, JASSoundParams *); // 0x800a0a5c
void setSeqData(void *, u32); // 0x800a0af4
void startSeq(); // 0x800a0b8c
void stopSeq(); // 0x800a0c64
void start(); // 0x800a0ca8
void close(); // 0x800a0d60
void connectChild(u32, JASTrack *); // 0x800a10e4
void closeChild(u32); // 0x800a1190
void openChild(u32); // 0x800a12ec
void connectBus(int, int); // 0x800a1820
void setLatestKey(u8); // 0x800a18b0
void noteOn(u32, u32, u32); // 0x800a18ec
void gateOn(u32, u32, f32, u32); // 0x800a1ac0
void noteOff(u32, u16); // 0x800a1cf8
void checkNoteStop(u32) const; // 0x800a1db8
void overwriteOsc(JASChannel *); // 0x800a1e74
void updateTimedParam(); // 0x800a1f28
void updateTrack(f32); // 0x800a2014
void updateTempo(); // 0x800a21b4
void updateSeq(bool, f32); // 0x800a2250
void seqTimeToDspTime(f32); // 0x800a2578
void setParam(u32, f32, u32); // 0x800a2614
void noteOffAll(u16); // 0x800a26d0
void mute(bool); // 0x800a29a0
//void setOscTable(u32, const JASOscillator::Point *); // 0x800a29d8
void setOscAdsr(s16, s16, s16, s16, u16); // 0x800a2a74
void setFIR(const s16 *); // 0x800a2acc
void setIIR(const s16 *); // 0x800a2b2c
void readPortSelf(u32); // 0x800a2b80
void writePortSelf(u32, u16); // 0x800a2ba4
void writePort(u32, u16); // 0x800a2bc8
void readPort(u32); // 0x800a2c2c
void pause(bool); // 0x800a2c50
void getTransposeTotal() const; // 0x800a2d38
void isMute() const; // 0x800a2ea8
void setTempo(u16); // 0x800a3028
void setTempoRate(f32); // 0x800a30b8
void setTimebase(u16); // 0x800a3148
//void channelUpdateCallback(u32, JASChannel *, JASDsp::TChannel *, void *); // 0x800a31d8
void getRootTrack(); // 0x800a3350
void tickProc(); // 0x800a3368
void seqMain(); // 0x800a3afc
// Inline/Unused
// void JASThreadingModel::InterruptsDisable<JASMemPool_MultiThreaded<TChannelMgr>>::Lock::~InterruptsDisable();
// void inherit(const JASTrack &);
// void setAutoMixingMode();
// void getVolume() const;
// void getPitch() const;
// void getPan() const;
// void getFxmix() const;
// void getDolby() const;
// void channelStart(TChannelMgr *, unsigned long, unsigned long, unsigned long);
// void setOscParam(unsigned long, const JASOscillator::Data &);
// void setChannelPauseFlag(bool);
// void updateChannel(JASChannel *, JASDsp::TChannel *);
// void getChannelCount() const;
// void JGadget::TLinkList<JASTrack, -584>::~TLinkList();
// void JASGlobalInstance<JASDefaultBankTable>::~JASGlobalInstance();
// Data
static s16 sAdsTable[12]; // 0x80369df0
//static sEnvOsc; // 0x80369e08, combination of u32 and f32
//void sPitchEnvOsc; // 0x80369e20
//void sDefaultBankTable; // 0x803fac24
//void sTrackList; // 0x803fb070
};
#endif

View File

@ -42,8 +42,8 @@ enum ERaceGpCup
class RaceInfo
{
public:
RaceInfo(); // inlined in release version, inline auto?
~RaceInfo();
RaceInfo();
~RaceInfo() { }
static u16 sWaitDemoSelector;
static ERaceGpCup sAwardDebugCup;
@ -148,7 +148,7 @@ public:
u16 mHidingConsoles;
s8 _0x29e[0x2e0 - 0x29e]; // unknown
};
// unfortunately i can't enable this yet
// RaceInfo gRaceInfo;
extern RaceInfo gRaceInfo;
#endif // !RACEINFO_H

View File

@ -23,7 +23,7 @@ u32 GXGetTexBufferSize(u16 width, u16 height, u32 format, GXBool mipmap, u8 max_
void GXInvalidateTexAll();
void GXInitTexObjWrapMode(GXTexObj* obj, GXTexWrapMode s, GXTexWrapMode t);
void GXInitTlutObj(GXTlutObj* obj, const void* data, GXTlutFmt format, u16 entries);
void GXLoadTlut(const GXTlutObj* obj, GXTlut idx);
void GXLoadTlut(const GXTlutObj* obj, u32 idx);
void GXSetTexCoordScaleManually(GXTexCoordID coord, GXBool enable, u16 ss, u16 ts);
void GXInitTexCacheRegion(GXTexRegion* region, GXBool is_32b_mipmap, u32 tmem_even,
GXTexCacheSize size_even, u32 tmem_odd, GXTexCacheSize size_odd);

View File

@ -31,7 +31,7 @@ bool JUTPalette::load()
{
bool check = mNumColors != 0;
if (check) {
GXLoadTlut(&mTlutObj, (GXTlut)mTlutName);
GXLoadTlut(&mTlutObj, mTlutName);
}
return check;

View File

@ -1,9 +1,9 @@
#include "Inagaki/GameAudioHostIO.h"
#include "Yamamoto/kartPad.h"
#include "JSystem/JAudio/JASFakeMatch3.h"
namespace GameAudio {
const f32 GA_MULTI_CAMERA_VOL_DOWN_DISTANCE = 10000.0;
const f32 GA_MULTI_CAMERA_VOL_DOWN_RATE = 0.5f;
}
// TODO: JAudio Nonsense for sinit
}

View File

@ -19,6 +19,8 @@
#endif
#include "Kaneshige/KartChecker.h"
#include <JSystem/JAudio/JASFakeMatch2.h>
#if DEBUG // I assume because Kartchecker doesn't put anything in rodata this gets deadstripped?
static const float lbl_80377378[4] = {0.0f, 0.0f, 0.0f, 1.0f};
#pragma push
@ -27,6 +29,8 @@ DUMMY_POINTER(lbl_80377378)
#pragma pop
#endif
int KartChecker::sPlayerKartColorTable[] = {
0, 1, 2, 3, 4, 5, 6, 7};
@ -1090,3 +1094,5 @@ bool LapChecker::isUDValid()
{
return validUD(mLapUnitDist);
}

View File

@ -4,6 +4,8 @@
#include "Osako/kartPad.h"
#include "Kaneshige/KartInfo.h"
#include "JSystem/JAudio/JASFakeMatch2.h"
const KartInfo::SCharDB KartInfo::cBabyMarioCharDB = {
BABY_MARIO,
BABY_LUIGI,

View File

@ -15,6 +15,8 @@ DUMMY_POINTER(lbl_80378500)
#pragma pop
#endif
// RaceInfo gRaceInfo; enable when common bss works
u16 RaceInfo::sWaitDemoSelector;
ERaceGpCup RaceInfo::sAwardDebugCup;

View File

@ -554,4 +554,6 @@ BOOL THPPlayerSetVolume(s32 vol, s32 duration)
}
return FALSE;
}
}
#include <JSystem/JAudio/System/JASFakeMatch.h>

View File

@ -28,6 +28,8 @@
#include "Osako/systemData.h"
#include "Osako/SystemRecord.h"
#include "JSystem/JAudio/JASFakeMatch2.h"
// .rodata
#ifdef DEBUG
static const float lbl_8037d5e8[4] = {0.0f, 0.0f, 0.0f, 1.0f};

View File

@ -1,5 +1,7 @@
#include "Yamamoto/kartCtrl.h"
#include "JSystem/JAudio/JASFakeMatch2.h"
void KartAppendix::Init(int idx) {
if (mKartLoader->getWheelNumber() == 6)
{

View File

@ -2,7 +2,7 @@
#include "Sato/JPEffectPerformer.h"
#include "Yamamoto/kartCtrl.h"
#include <ppcdis.h>
#include "JSystem/JAudio/JASFakeMatch2.h"
void KartStar::Init(int idx)
{

View File

@ -1,5 +1,7 @@
#include "Yamamoto/kartCtrl.h"
#include "JSystem/JAudio/JASFakeMatch2.h"
void KartTire::Init(int idx) {
mBody = GetKartCtrl()->getKartBody(idx);
_4 = 0;

View File

@ -4,6 +4,8 @@
#include "std/math.h"
#include "JSystem/JAudio/JASFakeMatch2.h"
// TODO: hire a mathematician to properly name variables
// Unused