tp/libs/dolphin/gx/GXInit.c

280 lines
9.9 KiB
C

//
// Generated By: dol2asm
// Translation Unit: GXInit
//
#include "dolphin/gx/GXInit.h"
#include "dolphin/gx/GX.h"
#include "dol2asm.h"
#include "dolphin/types.h"
//
// Forward References:
//
void __GXShutdown();
void __GXInitRevisionBits();
void __GXInitGX();
//
// External References:
//
void PPCSync();
void PPCMfhid2();
void PPCMthid2();
void PPCMtwpar();
void OSRegisterVersion();
void OSRegisterResetFunction();
void VIGetTvFormat();
void GXSetCPUFifo();
void GXSetGPFifo();
void GXSetBreakPtCallback();
void __GXFifoInit();
void GXClearVtxDesc();
void GXSetVtxAttrFmtv();
void GXInvalidateVtxCache();
void __GXAbort();
void GXPokeAlphaRead();
void GXPokeBlendMode();
void GXSetDrawSyncCallback();
void __GXPEInit();
void GXSetDispCopyFrame2Field();
void GXClearBoundingBox();
void GXInitTlutRegion();
void GXInvalidateTexAll();
void __GXSetTmemConfig();
void __GXSetIndirectMask();
void __GXFlushTextureState();
void GXSetProjectionv();
void GXSetScissorBoxOffset();
void GXSetGPMetric();
void GXClearGPMetric();
extern u8 GXNtsc480IntDf[60];
extern u8 GXMpal480IntDf[60];
extern u8 GXPal528IntDf[60];
extern u8 GXEurgb60Hz480IntDf[60 + 4 /* padding */];
//
// Declarations:
//
/* ############################################################################################## */
/* 8044CE00-8044CE80 079B20 0080+00 1/1 0/0 0/0 .bss FifoObj */
static GXFifoObj FifoObj;
/* 8044CE80-8044D430 079BA0 05B0+00 1/0 0/0 0/0 .bss gxData */
static GXData gxData;
/* 80456580-80456584 -00001 0004+00 6/6 108/108 0/0 .sdata2 __GXData */
SECTION_SDATA2 extern GXData* __GXData = &gxData;
/* 8035921C-80359318 353B5C 00FC+00 1/1 0/0 0/0 .text __GXDefaultTexRegionCallback */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm GXTexRegion* __GXDefaultTexRegionCallback(GXTexObj* obj, GXTexMapID mapID) {
nofralloc
#include "asm/dolphin/gx/GXInit/__GXDefaultTexRegionCallback.s"
}
#pragma pop
/* 80359318-8035933C 353C58 0024+00 1/1 0/0 0/0 .text __GXDefaultTlutRegionCallback */
// blr instead of b
#ifdef NONMATCHING
GXTlutRegion* __GXDefaultTlutRegionCallback(u32 tlut) {
GXTlutRegion* region;
if (tlut >= 20) {
region = NULL;
} else {
region = &__GXData->field_0x388[tlut];
}
return region;
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm GXTlutRegion* __GXDefaultTlutRegionCallback(u32 tlut) {
nofralloc
#include "asm/dolphin/gx/GXInit/__GXDefaultTlutRegionCallback.s"
}
#pragma pop
#endif
/* 80451944-80451948 000E44 0004+00 1/1 0/0 0/0 .sbss resetFuncRegistered$145 */
/* static */ u8 resetFuncRegistered[4];
/* 80451940-80451944 000E40 0004+00 1/1 0/0 0/0 .sbss calledOnce$37 */
/* static */ u8 calledOnce[4];
/* 8045193C-80451940 000E3C 0004+00 1/1 0/0 0/0 .sbss None */
/* static */ u8 data_8045193C[4];
/* 80451938-8045193C 000E38 0004+00 1/1 0/0 0/0 .sbss time$36 */
/* static */ u8 time[4];
/* 80451930-80451938 000E30 0004+04 1/1 0/0 0/0 .sbss peCount$35 */
/* static */ u8 peCount[4 + 4 /* padding */];
/* 8045192C-80451930 000E2C 0004+00 2/2 2/2 0/0 .sbss __memReg */
u8 __memReg[4];
/* 80451928-8045192C 000E28 0004+00 1/1 11/11 0/0 .sbss __peReg */
u8 __peReg[4];
/* 80451924-80451928 000E24 0004+00 2/2 12/12 0/0 .sbss __cpReg */
u16* __cpReg;
/* ############################################################################################## */
/* 80451920-80451924 000E20 0004+00 1/1 2/2 0/0 .sbss __piReg */
u32* __piReg;
/* 8035933C-803594CC 353C7C 0190+00 1/0 0/0 0/0 .text __GXShutdown */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void __GXShutdown(s32) {
nofralloc
#include "asm/dolphin/gx/GXInit/__GXShutdown.s"
}
#pragma pop
/* 803594CC-80359670 353E0C 01A4+00 1/1 1/1 0/0 .text __GXInitRevisionBits */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void __GXInitRevisionBits(void) {
nofralloc
#include "asm/dolphin/gx/GXInit/__GXInitRevisionBits.s"
}
#pragma pop
/* ############################################################################################## */
/* 803D2040-803D20A0 02F160 0044+1C 2/1 0/0 0/0 .data @1 */
SECTION_DATA static char lit_1[] = "<< Dolphin SDK - GX release build: Nov 10 2004 06:27:12 (0x2301) >>";
/* 803D20A0-803D20C0 02F1C0 0020+00 0/1 0/0 0/0 .data DefaultTexData */
#pragma push
#pragma force_active on
SECTION_DATA static u8 DefaultTexData[32] ALIGN_DECL(32) = {
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
};
#pragma pop
/* 803D20C0-803D2190 02F1E0 00D0+00 0/1 0/0 0/0 .data GXDefaultVATList */
#pragma push
#pragma force_active on
SECTION_DATA static u8 GXDefaultVATList[208] = {
0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
#pragma pop
/* 803D2190-803D21AC 02F2B0 001C+00 0/1 0/0 0/0 .data GXDefaultProjData */
#pragma push
#pragma force_active on
SECTION_DATA static u8 GXDefaultProjData[28] = {
0x3F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xBF, 0x80, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
#pragma pop
/* 803D21AC-803D226C 02F2CC 00C0+00 1/1 0/0 0/0 .data GXTexRegionAddrTable */
SECTION_DATA static u8 GXTexRegionAddrTable[192] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00,
0x00, 0x00, 0x80, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x02, 0x80, 0x00, 0x00, 0x03, 0x80, 0x00,
0x00, 0x04, 0x80, 0x00, 0x00, 0x05, 0x80, 0x00, 0x00, 0x06, 0x80, 0x00, 0x00, 0x07, 0x80, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x09, 0x80, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0B, 0x80, 0x00,
0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x08, 0x80, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0A, 0x80, 0x00, 0x00, 0x07, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00,
0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x00, 0x08, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00,
};
/* 803D226C-803D2280 -00001 0010+04 1/1 0/0 0/0 .data GXResetFuncInfo */
SECTION_DATA static void* GXResetFuncInfo[4 + 1 /* padding */] = {
(void*)__GXShutdown,
(void*)0x0000007F,
(void*)NULL,
(void*)NULL,
/* padding */
NULL,
};
/* 80450A78-80450A80 -00001 0004+04 1/1 0/0 0/0 .sdata __GXVersion */
SECTION_SDATA static const char* __GXVersion = lit_1;
/* 80456584-80456588 004B84 0004+00 1/1 0/0 0/0 .sdata2 @267 */
SECTION_SDATA2 static f32 lit_267 = 16777216.0f;
/* 80456588-8045658C 004B88 0004+00 2/2 0/0 0/0 .sdata2 @268 */
SECTION_SDATA2 static u8 lit_268[4] = {
0x00,
0x00,
0x00,
0x00,
};
/* 80359670-80359C70 353FB0 0600+00 0/0 2/2 0/0 .text GXInit */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm GXFifoObj* GXInit(void* base, u32 size) {
nofralloc
#include "asm/dolphin/gx/GXInit/GXInit.s"
}
#pragma pop
/* ############################################################################################## */
/* 8045658C-80456590 004B8C 0004+00 1/1 0/0 0/0 .sdata2 @269 */
SECTION_SDATA2 static u32 lit_269 = 0x404040FF;
/* 80456590-80456594 004B90 0004+00 1/1 0/0 0/0 .sdata2 @270 */
SECTION_SDATA2 static u8 lit_270[4] = {
0x00,
0x00,
0x00,
0x00,
};
/* 80456594-80456598 004B94 0004+00 1/1 0/0 0/0 .sdata2 @271 */
SECTION_SDATA2 static u32 lit_271 = 0xFFFFFFFF;
/* 80456598-8045659C 004B98 0004+00 1/1 0/0 0/0 .sdata2 @331 */
SECTION_SDATA2 static f32 lit_331 = 1.0f;
/* 8045659C-804565A0 004B9C 0004+00 1/1 0/0 0/0 .sdata2 @332 */
SECTION_SDATA2 static f32 lit_332 = 1.0f / 10.0f;
/* 804565A0-804565A8 004BA0 0008+00 1/1 0/0 0/0 .sdata2 @334 */
SECTION_SDATA2 static f64 lit_334 = 4503599627370496.0 /* cast u32 to float */;
/* 80359C70-8035A5A8 3545B0 0938+00 1/1 0/0 0/0 .text __GXInitGX */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void __GXInitGX(void) {
nofralloc
#include "asm/dolphin/gx/GXInit/__GXInitGX.s"
}
#pragma pop