Various tweaks to get valid decomp context

This commit is contained in:
Hexalotl
2024-02-26 10:05:01 -08:00
parent 2d0d9a6bd4
commit 651c6e1598
61 changed files with 135 additions and 57 deletions
+2
View File
@@ -5,6 +5,7 @@
#include "dolphin/gx.h"
#include "JSystem/JUtility/TColor.h"
#ifdef __cplusplus
/**
* Everything is fabricated here except for the default ctor.
* Copied from J3DGXColorS10.
@@ -44,5 +45,6 @@ struct J2DGXColorS10 : public GXColorS10
inline operator JUtility::TColor() const { return toTColor(); }
inline JUtility::TColor toTColor() const { return JUtility::TColor(r, g, b, a); }
};
#endif
#endif
+3 -1
View File
@@ -22,6 +22,7 @@ struct J2DGrafBlend {
u8 mDestFactor; // _02
};
#ifdef __cplusplus
struct J2DGrafContext {
J2DGrafContext(f32, f32, f32, f32);
@@ -130,5 +131,6 @@ void J2DDrawFrame(f32 param_0, f32 param_1, f32 param_2, f32 param_3, JUtility::
void J2DDrawFrame(JGeometry::TBox2f const& param_0, JUtility::TColor param_1, u8 param_2);
void J2DDrawLine(f32, f32, f32, f32, JUtility::TColor, int);
#endif
#endif
#endif
+2
View File
@@ -5,6 +5,7 @@
#include "JSystem/J3D/J3DTypes.h"
#include "dolphin/gx.h"
#ifdef __cplusplus
typedef float Mtx23[2][3];
struct J2DIndTexCoordScaleInfo
@@ -122,5 +123,6 @@ struct J2DIndBlockFull : public J2DIndBlock
J2DIndTexMtx mTexMtxes[3]; // _10
J2DIndTexCoordScale mTexCoordScales[4]; // _64
};
#endif
#endif
+2 -1
View File
@@ -10,6 +10,7 @@
#include "JSystem/JUtility/TColor.h"
#include "types.h"
#ifdef __cplusplus
struct JUTTexture;
enum J2DBinding
@@ -385,5 +386,5 @@ enum J2DTextBoxVBinding
};
// extern const J2DTexCoordInfo j2dDefaultTexCoordInfo[8];
#endif
#endif
+2
View File
@@ -3,6 +3,7 @@
#include "types.h"
#ifdef __cplusplus
enum JBlockType {
JBT_ColorAmbientOn = 'CLAB',
JBT_ColorNull = 'CLNL',
@@ -28,5 +29,6 @@ enum JBlockType {
JBT_TevNull = 'TVNL',
JBT_TevPatched = 'TVPT'
};
#endif
#endif
-2
View File
@@ -5,7 +5,6 @@
#ifdef __cplusplus
extern "C" {
#endif
class JGadget_outMessage {
public:
@@ -44,7 +43,6 @@ private:
#endif
#ifdef __cplusplus
}
#endif
+2
View File
@@ -6,6 +6,7 @@
#include "JSystem/JUtility/JUTAssertion.h"
#include "JSystem/JGadget/define.h"
#ifdef __cplusplus
namespace JGadget {
#define NEGATIVE_OFFSETOF(TYPE, MEMBER) (-static_cast<s32>(offsetof(TYPE, MEMBER)))
@@ -301,5 +302,6 @@ public:
#pragma pop
}
#endif
#endif
+2
View File
@@ -3,6 +3,7 @@
#include "types.h"
#ifdef __cplusplus
inline f32 fsqrt_step(f32 mag)
{
f32 root = __frsqrte(mag);
@@ -359,5 +360,6 @@ typedef TBox2<f32> TBox2f;
typedef TBox3<f32> TBox3f;
} // namespace JGeometry
#endif
#endif
+2
View File
@@ -11,6 +11,7 @@
#include "JSystem/JSupport/JSUList.h"
#include "JSystem/JSupport/JSUStream.h"
#ifdef __cplusplus
#define ARAM_GROUP_ID_ALL 0
#define ARAM_GROUP_ID_DEFAULT 0xFF
@@ -312,3 +313,4 @@ inline void JKRAramPcs_SendCommand(JKRAMCommand* cmd)
}
#endif
#endif
+2
View File
@@ -6,6 +6,7 @@
#include "JSystem/JKernel/JKRHeap.h"
#include "types.h"
#ifdef __cplusplus
// NOTE: Vtable offsets are off
#define JKRARCHIVE_ATTR_COMPRESSION 0x04
@@ -340,3 +341,4 @@ inline JKRArchive* JKRMountArchive(void* inBuf, JKRHeap* heap, JKRArchive::EMoun
}
#endif
#endif
+2
View File
@@ -8,6 +8,7 @@
#include "JSystem/JKernel/JKRAram.h"
#include "JSystem/JKernel/JKREnum.h"
#ifdef __cplusplus
#define JKRDECOMP_MSG_BUF_COUNT 4
#define JKRDECOMP_STACK_SIZE 0x4000
#define JKRDECOMP_THREAD_MSG_BUF_COUNT 16
@@ -105,3 +106,4 @@ int JKRDecompressFromDVDToAram(JKRDvdFile* srcFile, u32 address, u32 fileSize, u
int JKRDecompressFromAramToMainRam(u32 srcAddress, void* dst, u32 fileSize, u32 maxDest, u32 fileOffset);
#endif
#endif
-2
View File
@@ -6,7 +6,6 @@
#ifdef __cplusplus
extern "C" {
#endif
class JKRHeap;
@@ -21,7 +20,6 @@ public:
JSULink<JKRDisposer> mPointerLinks; // _8
};
#ifdef __cplusplus
}
#endif
@@ -6,6 +6,7 @@
#include "JSystem/JSupport/JSUList.h"
#include "types.h"
#ifdef __cplusplus
class JKRADCommand
{
public:
@@ -60,3 +61,4 @@ inline JKRAramBlock* JKRDvdToAram(s32 entrynum, u32 p2, JKRExpandSwitch expSwitc
}
#endif
#endif
+2
View File
@@ -5,6 +5,7 @@
#include "JSystem/JKernel/JKRFile.h"
#include "JSystem/JSupport/JSUStream.h"
#ifdef __cplusplus
class JKRDvdFile;
struct JKRDvdFileInfo : public DVDFileInfo {
@@ -76,5 +77,6 @@ public:
JSULink<JKRDvdFile> mLink;
OSThread* mDvdThread;
};
#endif
#endif
+3
View File
@@ -5,6 +5,8 @@
#include "JSystem/JKernel/JKREnum.h"
#include "JSystem/JKernel/JKRDvdFile.h"
#ifdef __cplusplus
#define SZP_BUFFERSIZE 1024
#define REF_BUFFERSIZE 0x1120
#define DMA_BUFFERSIZE 0x100
@@ -54,3 +56,4 @@ inline void* JKRDvdToMainRam(const char* path, u8* dst, JKRExpandSwitch expandSw
}
#endif
#endif
+2
View File
@@ -4,6 +4,7 @@
#include "JSystem/JKernel/JKRHeap.h"
#include "types.h"
#ifdef __cplusplus
class JKRExpHeap : public JKRHeap
{
public:
@@ -103,5 +104,6 @@ inline JKRExpHeap* JKRCreateExpHeap(u32 size, JKRHeap* parent, bool errorFlag)
{
return JKRExpHeap::create(size, parent, errorFlag);
}
#endif
#endif /* JKREXPHEAP_H */
+2
View File
@@ -8,6 +8,7 @@
#include "JSystem/JKernel/JKRDisposer.h"
#include "JSystem/JKernel/JKRMacro.h"
#ifdef __cplusplus
class JKRFile : public JKRDisposer {
public:
inline JKRFile()
@@ -29,5 +30,6 @@ public:
protected:
bool mFileOpen;
};
#endif
#endif
+2
View File
@@ -5,6 +5,7 @@
#include <dolphin/os.h>
#include "types.h"
#ifdef __cplusplus
class JKRArchive;
struct JKRFileFinderBase
@@ -76,3 +77,4 @@ public:
};
#endif
#endif
+2
View File
@@ -5,6 +5,7 @@
#include "JSystem/JKernel/JKRDisposer.h"
#include "JSystem/JSupport/JSUList.h"
#ifdef __cplusplus
class JKRFileFinder;
class JKRFileLoader : public JKRDisposer
{
@@ -60,3 +61,4 @@ protected:
};
#endif
#endif
+2
View File
@@ -6,6 +6,7 @@
#include "types.h"
#ifdef __cplusplus
typedef void JKRHeapErrorHandler(void*, u32, int);
class JKRHeap : public JKRDisposer
@@ -316,4 +317,5 @@ void* operator new[](size_t, JKRHeap*, int);
void operator delete(void*);
void operator delete[](void*);
#endif
#endif // !JKRHEAP_H
+2
View File
@@ -1,6 +1,7 @@
#ifndef JKRMARCO_H
#define JKRMACRO_H
#ifdef __cplusplus
#define JKR_ISALIGNED(addr, alignment) ((((u32)addr) & (((u32)alignment)-1)) == 0)
#define JKR_ISALIGNED32(addr) (JKR_ISALIGNED(addr, 32))
@@ -9,5 +10,6 @@
#define JKR_ALIGN(addr, alignment) (((u32)addr) & (~(((u32)alignment)-1)))
#define JKR_ALIGN32(addr) (JKR_ALIGN(addr, 32))
#endif
#endif
+2
View File
@@ -10,6 +10,7 @@
#include "JSystem/JKernel/JKRDisposer.h"
#include "JSystem/JUtility/JUTConsole.h"
#ifdef __cplusplus
struct JKRThread;
//class JUTConsole;
@@ -177,3 +178,4 @@ struct JKRIdleThread : public JKRThread
};
#endif
#endif
@@ -5,6 +5,7 @@
#include "JSystem/JKernel/JKRFile.h"
#include "JSystem/JSupport/JSURandomInputStream.h"
#ifdef __cplusplus
class JSUFileInputStream : public JSURandomInputStream {
public:
JSUFileInputStream(JKRFile* file);
@@ -22,5 +23,6 @@ protected:
const void* mObject;
s32 mPosition;
};
#endif
#endif
@@ -4,6 +4,7 @@
#include "types.h"
#include "JSystem/JSupport/JSUIosBase.h"
#ifdef __cplusplus
class JSUInputStream : public JSUIosBase {
public:
virtual ~JSUInputStream();
@@ -106,5 +107,6 @@ public:
return *this;
}
};
#endif
#endif
+2 -1
View File
@@ -4,6 +4,7 @@
#include "types.h"
#include "JSystem/JSupport/JSUStreamEnum.h"
#ifdef __cplusplus
class JSUIosBase {
public:
inline JSUIosBase() : mState(GOOD) { }
@@ -16,6 +17,6 @@ public:
u8 mState;
};
#endif
#endif
-2
View File
@@ -5,7 +5,6 @@
#ifdef __cplusplus
extern "C" {
#endif
class JSUPtrLink;
@@ -224,7 +223,6 @@ private:
JSUTree<T> *mTree;
};
#ifdef __cplusplus
}
#endif
@@ -5,6 +5,7 @@
#include "JSystem/JKernel/JKRFile.h"
#include "JSystem/JSupport/JSUInputStream.h"
#ifdef __cplusplus
class JSURandomInputStream : public JSUInputStream {
public:
virtual ~JSURandomInputStream() { }
@@ -20,5 +21,6 @@ public:
int peek(void* buf, s32 len);
int seek(s32 offset, JSUStreamSeekFrom from);
};
#endif
#endif
-2
View File
@@ -7,7 +7,6 @@
#ifdef __cplusplus
extern "C"
{
#endif
namespace JUTAssertion
{
@@ -62,7 +61,6 @@ namespace JUTAssertion
}
#endif
#ifdef __cplusplus
}
#endif
+3
View File
@@ -6,6 +6,7 @@
#include "JSystem/JKernel/JKRHeap.h"
#include "JSystem/JUtility/JUTFont.h"
#ifdef __cplusplus
inline s32 colorCheck(s32 diff, s32 t)
{
s32 ret = diff - t;
@@ -166,3 +167,5 @@ void JUTWarningConsole_f_va(const char*, va_list);
};
#endif
#endif
@@ -5,6 +5,7 @@
#include "va_args.h"
#include "JSystem/JUtility/TColor.h"
#ifdef __cplusplus
class JUTDirectPrint
{
private:
@@ -58,5 +59,6 @@ inline void JUTChangeFrameBuffer(void *buffer, u16 height, u16 width)
{
JUTDirectPrint::getManager()->changeFrameBuffer(buffer, width, height);
}
#endif
#endif
+2
View File
@@ -7,6 +7,7 @@
#include "dolphin/os.h"
#include "JSystem/JUtility/TColor.h"
#ifdef __cplusplus
struct JKRAramBlock;
struct JKRHeap;
@@ -365,5 +366,6 @@ struct JUTCacheFont : public JUTResFont
};
extern const ResFONT JUTResFONT_Ascfont_fix12;
#endif
#endif
-2
View File
@@ -10,7 +10,6 @@
#ifdef __cplusplus
extern "C" {
#endif
class JUTGamePadRecordBase
{
@@ -357,7 +356,6 @@ public:
OSTime mResetTime; // _A0
};
#ifdef __cplusplus
}
#endif
+2
View File
@@ -8,6 +8,7 @@
#include "types.h"
#ifdef __cplusplus
class JUTProcBar
{
public:
@@ -152,5 +153,6 @@ private:
JKRHeap* mWatchHeap; // _12C
bool mHeapBarVisible; // _130
}; // 0x134 size
#endif
#endif
+2
View File
@@ -7,6 +7,7 @@
#include "dolphin/gx.h"
#include "dolphin/vi.h"
#ifdef __cplusplus
/**
* @size{0x58}
*/
@@ -80,5 +81,6 @@ inline JUTVideo *JUTGetVideoManager() {
}
extern bool sDrawWaiting;
#endif
#endif
-2
View File
@@ -3,7 +3,6 @@
#ifdef __cplusplus
extern "C" {
#endif
#include "types.h"
#include <dolphin/gx.h>
@@ -69,7 +68,6 @@ namespace JUtility {
};
} // namespace JUtility
#ifdef __cplusplus
}
#endif
+3 -1
View File
@@ -4,6 +4,8 @@
#include "dolphin/gx.h"
#include "types.h"
#ifdef __cplusplus
#ifndef _JUTTransparency
typedef u8 _JUTTransparency;
#endif
@@ -52,5 +54,5 @@ struct ResTIMGPair {
ResTIMG _00;
ResTIMG _20;
};
#endif
#endif
+2 -1
View File
@@ -3,6 +3,7 @@
#include "types.h"
#ifdef __cplusplus
namespace std {
template <class InputIterator, class Predicate>
@@ -15,5 +16,5 @@ find_if(InputIterator first, InputIterator last, Predicate pred) {
}
} // namespace std
#endif
#endif
+2
View File
@@ -3,6 +3,7 @@
#include "types.h"
#ifdef __cplusplus
namespace std {
/* TODO: these should be properly implemented */
@@ -28,5 +29,6 @@ distance(InputIterator first, InputIterator last) {
}
} // namespace std
#endif
#endif
+1
View File
@@ -1,6 +1,7 @@
#ifndef TRK_SERPOLL
#define TRK_SERPOLL
#include "types.h"
#include "TRK/trk.h"
#ifdef __cplusplus
extern "C" {
#endif
+3 -3
View File
@@ -1,5 +1,5 @@
#ifndef DSP_H
#define DSP_H
#ifndef DSP_DSP_H
#define DSP_DSP_H
#include "types.h"
@@ -7,7 +7,7 @@
extern "C"{
#endif
extern volatile u16 __DSPRegs[] : 0XCC005000;
extern volatile u16 __DSPRegs[] AT_ADDRESS(0xCC005000);
#ifdef __cplusplus
}
+2 -2
View File
@@ -25,8 +25,8 @@ typedef enum {
OS_ERR_PROTECTION,
OS_ERR_FP_EXCEPTION,
OS_ERR_MAX,
}
#ifdef __cplusplus
};
#ifdef __cplusplus
}
#endif
#endif
+2 -2
View File
@@ -7,8 +7,8 @@ extern "C" {
#endif
#define SIM_MEM *(u32 *)0x800000f0
static asm void Config24MB();
static asm void Config48MB();
static void Config24MB();
static void Config48MB();
u32 OSGetConsoleSimulatedMemSize(void);
#ifdef __cplusplus
+9 -3
View File
@@ -3,8 +3,14 @@
#include "types.h"
extern "C"{
void StartAudioThread(void*, u32, u32, u32);
}
#ifdef __cplusplus
extern "C" {
#endif
void StartAudioThread(void*, u32, u32, u32);
#ifdef __cplusplus
}
#endif
#endif
+9 -2
View File
@@ -1,8 +1,15 @@
#ifndef CMDSTACK_H
#define CMDSTACK_H
#include "types.h"
extern "C"{
void Jac_Portcmd_Init(void);
#ifdef __cplusplus
extern "C" {
#endif
void Jac_Portcmd_Init(void);
#ifdef __cplusplus
}
#endif
#endif
+7 -1
View File
@@ -3,9 +3,15 @@
#include "types.h"
extern "C"{
#ifdef __cplusplus
extern "C" {
#endif
void Probe_Start(void);
void Probe_Finish(void);
#ifdef __cplusplus
}
#endif
#endif
+7 -1
View File
@@ -3,8 +3,14 @@
#include "types.h"
extern "C"{
#ifdef __cplusplus
extern "C" {
#endif
void Jam_InitRegistTrack(void);
#ifdef __cplusplus
}
#endif
#endif
+2 -2
View File
@@ -4,13 +4,13 @@
#include "types.h"
#ifdef __cplusplus
extern "C" {
extern "C" {
#endif
extern void Na_GetRadioCounter(void*);
#ifdef __cplusplus
}
}
#endif
+2 -2
View File
@@ -4,7 +4,7 @@
#include "types.h"
#ifdef __cplusplus
extern "C"{
extern "C" {
#endif
extern void Na_Inst(u16, u8*);
@@ -14,7 +14,7 @@ extern int Na_InstCountGet();
#ifdef __cplusplus
}
}
#endif
#endif
+2 -2
View File
@@ -4,13 +4,13 @@
#include "types.h"
#ifdef __cplusplus
extern "C" {
extern "C" {
#endif
extern void Na_GetKappaCounter(void*);
#ifdef __cplusplus
}
}
#endif
+5 -1
View File
@@ -4,7 +4,7 @@
#include "types.h"
#ifdef __cplusplus
extern "C"
extern "C" {
#endif
extern void Na_RhythmStart(void*, u8,u8);
@@ -15,4 +15,8 @@ extern f32 Na_GetRhythmDelay(void*);
extern f32 Na_GetRhythmInfo(void*);
extern void Na_SetRhythmInfo(f32);
#ifdef __cplusplus
}
#endif
#endif
+1 -1
View File
@@ -12,7 +12,7 @@ void Jaq_Reset(void);
void Jaq_SetSeqData(seqp* seqp, u8* param_2, u32 param_3, int param_4);
#ifdef __cplusplus
};
}
#endif
#endif
+2 -2
View File
@@ -4,7 +4,7 @@
#include "types.h"
#ifdef __cplusplus
extern "C" {
extern "C" {
#endif
typedef struct staff_roll_info_s{
@@ -16,7 +16,7 @@ typedef struct staff_roll_info_s{
extern void Na_GetStaffRollInfo(void*);
#ifdef __cplusplus
}
}
#endif
+1 -5
View File
@@ -7,11 +7,7 @@
#ifdef __cplusplus
extern "C" {
#endif
extern JUTGamePad gamePad[];
#ifdef __cplusplus
extern JUTGamePad gamePad[];
}
#endif
+2 -2
View File
@@ -10,8 +10,8 @@
extern "C" {
#endif
asm void Config24MB();
asm void Config48MB();
void Config24MB();
void Config48MB();
void ReconfigBATs();
-3
View File
@@ -6,7 +6,6 @@
#ifdef __cplusplus
extern "C" {
#endif
#define TEX_CACHE_ALIGNMENT (32-1) /* 32 byte alignment */
#define NUM_TEXTURE_CACHE_DATA 10
@@ -74,10 +73,8 @@ int texture_cache_data_entry(void* original, void* converted);
#define TEX_BUFFER_DATA_SIZE 0xC000
#define TEX_BUFFER_BSS_SIZE 0x1000
extern "C" void emu64_texture_cache_data_entry_set(void* begin, void* end);
extern texture_cache_t* texture_cache_select(void* address);
#ifdef __cplusplus
}
#endif
+2 -2
View File
@@ -24,8 +24,8 @@ enum weight{
MASS_NORMAL
};
#define MASSTYPE_IMMOVABLE 0XFF
#define MASSTYPE_HEAVY 0XFE
#define MASSTYPE_IMMOVABLE 0xFF
#define MASSTYPE_HEAVY 0xFE
typedef struct collision_obj_s {
ACTOR* owner_actor; // actor which owns this collision object
+1 -3
View File
@@ -9,9 +9,7 @@
extern "C" {
#endif
struct music_ovl_s {
};
struct music_ovl_s;
extern void mMU_music_ovl_set_proc(Submenu* submenu);
extern void mMU_music_ovl_construct(Submenu* submenu);
+1
View File
@@ -2,6 +2,7 @@
#define M_TITLEDEMO_H
#include "types.h"
#include "m_play_h.h"
#ifdef __cplusplus
extern "C" {
+5
View File
@@ -121,4 +121,9 @@ typedef u32 unknown;
#define BSS_ORDER_ITEM(v)
#endif
#ifndef __cplusplus
// Some definitions rely on wchar_t being defined
typedef short wchar_t;
#endif
#endif
+1 -1
View File
@@ -1,5 +1,5 @@
#include "Famicom/famicom.h"
#include "Famicom/famicomInternal.h"
#include "Famicom/famicomInternal.hpp"
#include "dolphin/string.h"
#include "dolphin/gx.h"