mirror of
https://github.com/zeldaret/mm.git
synced 2026-08-04 01:02:54 -04:00
more variables
This commit is contained in:
@@ -199,10 +199,10 @@ s32 __osPfsGetStatus(OSMesgQueue* queue, s32 channel);
|
||||
s32 __osContChannelReset(OSMesgQueue* mq, s32 channel);
|
||||
|
||||
extern OSPifRam __osContPifRam;
|
||||
// extern UNK_TYPE1 D_8009CF0C;
|
||||
extern u8 __osContLastPoll;
|
||||
extern u8 __osMaxControllers;
|
||||
// extern OSMesgQueue D_8009CF38;
|
||||
// extern OSMesg D_8009CF50;
|
||||
extern OSMesgQueue __osEepromTimerQ;
|
||||
extern OSMesg __osEepromTimerMsg;
|
||||
extern OSPifRam __osPfsPifRam;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
#ifndef PR_GUINT_H
|
||||
#define PR_GUINT_H
|
||||
|
||||
#include "ultratypes.h"
|
||||
|
||||
typedef union {
|
||||
f64 d;
|
||||
struct {
|
||||
u32 hi;
|
||||
u32 lo;
|
||||
} word;
|
||||
} du;
|
||||
|
||||
typedef union {
|
||||
u32 i;
|
||||
f32 f;
|
||||
} fu;
|
||||
|
||||
#define ROUND(x) (s32)(((x) >= 0.0) ? ((x) + 0.5) : ((x) - 0.5))
|
||||
|
||||
extern f32 __libm_qnan_f;
|
||||
|
||||
#endif
|
||||
@@ -44,4 +44,10 @@ extern u32 __osShutdown;
|
||||
|
||||
extern OSTimer* __osTimerList;
|
||||
|
||||
extern OSTimer __osBaseTimer;
|
||||
extern OSTime __osCurrentTime;
|
||||
extern u32 __osBaseCounter;
|
||||
extern u32 __osViIntrCount;
|
||||
extern u32 __osTimerCounter;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -87,6 +87,10 @@ extern OSDevMgr __osPiDevMgr;
|
||||
extern OSPiHandle* __osCurrentHandle[];
|
||||
extern u32 __osPiAccessQueueEnabled;
|
||||
|
||||
extern OSPiHandle __Dom1SpeedParam;
|
||||
extern OSPiHandle __Dom2SpeedParam;
|
||||
|
||||
extern OSMesgQueue __osPiAccessQueue;
|
||||
|
||||
void __osDevMgrMain(void* arg);
|
||||
void __osPiCreateAccessQueue(void);
|
||||
|
||||
@@ -22,6 +22,12 @@ typedef volatile s64 vs64;
|
||||
typedef float f32;
|
||||
typedef double f64;
|
||||
|
||||
typedef u32 size_t;
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL (void*)0
|
||||
#endif
|
||||
|
||||
// TODO: move this somewhere else
|
||||
typedef void* TexturePtr;
|
||||
|
||||
|
||||
@@ -10,21 +10,6 @@
|
||||
#define SHT_MAX 32767.0f
|
||||
#define SHT_MINV (1.0f / SHT_MAX)
|
||||
|
||||
typedef union {
|
||||
f64 d;
|
||||
struct {
|
||||
u32 hi;
|
||||
u32 lo;
|
||||
} word;
|
||||
} du;
|
||||
|
||||
typedef union {
|
||||
u32 i;
|
||||
f32 f;
|
||||
} fu;
|
||||
|
||||
extern f32 __libm_qnan_f;
|
||||
|
||||
float fabsf(float f);
|
||||
#pragma intrinsic(fabsf)
|
||||
#ifdef __GNUC__
|
||||
|
||||
@@ -3,14 +3,8 @@
|
||||
|
||||
#include "PR/ultratypes.h"
|
||||
|
||||
typedef u32 size_t;
|
||||
|
||||
typedef s32 ptrdiff_t;
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL (void*)0
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define offsetof(structure, member) __builtin_offsetof (structure, member)
|
||||
#else
|
||||
|
||||
@@ -95,8 +95,6 @@
|
||||
#define CLAMP_MAX(x, max) ((x) > (max) ? (max) : (x))
|
||||
#define CLAMP_MIN(x, min) ((x) < (min) ? (min) : (x))
|
||||
|
||||
#define ROUND(x) (s32)(((x) >= 0.0) ? ((x) + 0.5) : ((x) - 0.5))
|
||||
|
||||
#define SWAP(type, a, b) \
|
||||
{ \
|
||||
type _temp = (a); \
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "PR/gbi.h"
|
||||
|
||||
#include "PR/gu.h"
|
||||
#include "PR/guint.h"
|
||||
#include "PR/controller_voice.h"
|
||||
#include "PR/hardware.h"
|
||||
#include "PR/os.h"
|
||||
|
||||
@@ -55,28 +55,7 @@ extern f32 D_80099100;
|
||||
extern f32 D_80099104;
|
||||
extern f32 D_80099108;
|
||||
extern f32 D_8009910C;
|
||||
extern u16 D_800991A0[64];
|
||||
|
||||
extern f64 D_800992C0;
|
||||
extern f64 D_800992F0;
|
||||
extern f64 D_800992F8;
|
||||
extern char D_80099300[];
|
||||
extern char D_80099304[];
|
||||
extern unsigned int D_8009930C[6];
|
||||
extern f32 D_80099400;
|
||||
extern f64 D_80099428;
|
||||
extern f64 D_80099430;
|
||||
extern f64 D_80099438;
|
||||
// extern UNK_TYPE4 D_80099440;
|
||||
extern f32 __libm_qnan_f;
|
||||
extern f64 D_80099460[9];
|
||||
extern char D_800994A8[];
|
||||
extern char D_800994AC[];
|
||||
extern char D_800994B0[];
|
||||
// extern UNK_TYPE1 D_800994B1;
|
||||
extern f64 D_800994B8;
|
||||
extern f64 D_800994C0;
|
||||
extern f64 D_800994C8;
|
||||
extern char gBuildTeam[];
|
||||
extern char gBuildDate[];
|
||||
extern char gBuildMakeOption[];
|
||||
@@ -94,25 +73,6 @@ extern void* gYaz0DecompressDstEnd;
|
||||
// extern UNK_TYPE4 D_8009CD10;
|
||||
extern u32 sRandFloat;
|
||||
// extern UNK_TYPE4 sArenaLockMsg;
|
||||
extern OSTask tmp_task;
|
||||
|
||||
extern OSMesg siAccessBuf[1];
|
||||
extern OSMesgQueue __osSiAccessQueue;
|
||||
|
||||
extern OSThread __osThreadSave;
|
||||
extern OSPiHandle D_8009D130;
|
||||
extern OSPiHandle D_8009D1A8;
|
||||
|
||||
extern OSMesg D_8009E3F0[1];
|
||||
extern OSMesgQueue __osPiAccessQueue;
|
||||
extern __OSInode __osPfsInodeCache;
|
||||
extern OSTimer D_8009E590;
|
||||
extern OSTime __osCurrentTime;
|
||||
extern u32 __osBaseCounter;
|
||||
extern u32 __osViIntrCount;
|
||||
extern u32 __osTimerCounter;
|
||||
extern OSPifRam __osPfsPifRam;
|
||||
extern OSPiHandle CartRomHandle;
|
||||
|
||||
extern DmaEntry dmadata[1568];
|
||||
// extern UNK_TYPE1 D_80186028;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "global.h"
|
||||
|
||||
OSPiHandle CartRomHandle;
|
||||
OSPiHandle __CartRomHandle;
|
||||
|
||||
OSPiHandle* osCartRomInit(void) {
|
||||
register u32 initialConfig;
|
||||
@@ -17,15 +17,15 @@ OSPiHandle* osCartRomInit(void) {
|
||||
|
||||
if (!sCartRomNeedsInit) {
|
||||
__osPiRelAccess();
|
||||
return &CartRomHandle;
|
||||
return &__CartRomHandle;
|
||||
}
|
||||
|
||||
sCartRomNeedsInit = false;
|
||||
CartRomHandle.type = DEVICE_TYPE_CART;
|
||||
CartRomHandle.baseAddress = 0xB0000000;
|
||||
CartRomHandle.domain = 0;
|
||||
CartRomHandle.speed = 0;
|
||||
bzero(&CartRomHandle.transferInfo, sizeof(__OSTranxInfo));
|
||||
__CartRomHandle.type = DEVICE_TYPE_CART;
|
||||
__CartRomHandle.baseAddress = 0xB0000000;
|
||||
__CartRomHandle.domain = 0;
|
||||
__CartRomHandle.speed = 0;
|
||||
bzero(&__CartRomHandle.transferInfo, sizeof(__OSTranxInfo));
|
||||
|
||||
/* Uses `status & PI_STATUS_ERROR` in OoT */
|
||||
while (status = HW_REG(PI_STATUS_REG, u32), status & (PI_STATUS_BUSY | PI_STATUS_IOBUSY)) {
|
||||
@@ -42,11 +42,11 @@ OSPiHandle* osCartRomInit(void) {
|
||||
HW_REG(PI_BSD_DOM1_RLS_REG, u32) = 3;
|
||||
HW_REG(PI_BSD_DOM1_PWD_REG, u32) = 0xFF;
|
||||
|
||||
initialConfig = HW_REG(CartRomHandle.baseAddress, u32);
|
||||
CartRomHandle.latency = initialConfig & 0xFF;
|
||||
CartRomHandle.pageSize = (initialConfig >> 0x10) & 0xF;
|
||||
CartRomHandle.relDuration = (initialConfig >> 0x14) & 0xF;
|
||||
CartRomHandle.pulse = (initialConfig >> 8) & 0xFF;
|
||||
initialConfig = HW_REG(__CartRomHandle.baseAddress, u32);
|
||||
__CartRomHandle.latency = initialConfig & 0xFF;
|
||||
__CartRomHandle.pageSize = (initialConfig >> 0x10) & 0xF;
|
||||
__CartRomHandle.relDuration = (initialConfig >> 0x14) & 0xF;
|
||||
__CartRomHandle.pulse = (initialConfig >> 8) & 0xFF;
|
||||
|
||||
HW_REG(PI_BSD_DOM1_LAT_REG, u32) = lastLatency;
|
||||
HW_REG(PI_BSD_DOM1_PGS_REG, u32) = lastPageSize;
|
||||
@@ -54,10 +54,10 @@ OSPiHandle* osCartRomInit(void) {
|
||||
HW_REG(PI_BSD_DOM1_PWD_REG, u32) = lastPulse;
|
||||
|
||||
prevInt = __osDisableInt();
|
||||
CartRomHandle.next = __osPiTable;
|
||||
__osPiTable = &CartRomHandle;
|
||||
__CartRomHandle.next = __osPiTable;
|
||||
__osPiTable = &__CartRomHandle;
|
||||
__osRestoreInt(prevInt);
|
||||
__osPiRelAccess();
|
||||
|
||||
return &CartRomHandle;
|
||||
return &__CartRomHandle;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#include "global.h"
|
||||
|
||||
UNK_TYPE4 __osContinitialized = 0;
|
||||
s32 __osContinitialized = 0;
|
||||
|
||||
OSPifRam __osContPifRam;
|
||||
u8 __osContLastPoll;
|
||||
u8 __osMaxControllers;
|
||||
|
||||
OSTimer __osEepromTimer;
|
||||
OSMesgQueue D_8009CF38;
|
||||
OSMesg D_8009CF50[1];
|
||||
OSMesgQueue __osEepromTimerQ;
|
||||
OSMesg __osEepromTimerMsg[1];
|
||||
|
||||
s32 osContInit(OSMesgQueue* mq, u8* bitpattern, OSContStatus* data) {
|
||||
OSMesg dummy;
|
||||
@@ -43,7 +43,7 @@ s32 osContInit(OSMesgQueue* mq, u8* bitpattern, OSContStatus* data) {
|
||||
__osContGetInitData(bitpattern, data);
|
||||
__osContLastPoll = 0;
|
||||
__osSiCreateAccessQueue();
|
||||
osCreateMesgQueue(&D_8009CF38, D_8009CF50, ARRAY_COUNT(D_8009CF50));
|
||||
osCreateMesgQueue(&__osEepromTimerQ, __osEepromTimerMsg, ARRAY_COUNT(__osEepromTimerMsg));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
u32 __osPiAccessQueueEnabled = 0;
|
||||
|
||||
OSMesg D_8009E3F0[1];
|
||||
OSMesg piAccessBuf[1];
|
||||
OSMesgQueue __osPiAccessQueue;
|
||||
|
||||
void __osPiCreateAccessQueue(void) {
|
||||
__osPiAccessQueueEnabled = 1;
|
||||
osCreateMesgQueue(&__osPiAccessQueue, D_8009E3F0, ARRAY_COUNT(D_8009E3F0));
|
||||
osCreateMesgQueue(&__osPiAccessQueue, piAccessBuf, ARRAY_COUNT(piAccessBuf));
|
||||
osSendMesg(&__osPiAccessQueue, NULL, OS_MESG_NOBLOCK);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include "global.h"
|
||||
#include "stack.h"
|
||||
|
||||
OSPiHandle D_8009D130;
|
||||
OSPiHandle D_8009D1A8;
|
||||
OSPiHandle __Dom1SpeedParam;
|
||||
OSPiHandle __Dom2SpeedParam;
|
||||
OSThread sPiMgrThread;
|
||||
STACK(sPiMgrStack, 0x1000);
|
||||
OSMesgQueue D_8009E3D0;
|
||||
|
||||
@@ -19,17 +19,17 @@ u32 __OSGlobalIntMask = OS_IM_ALL;
|
||||
UNK_TYPE4 D_8009CF70;
|
||||
|
||||
void __createSpeedParam(void) {
|
||||
D_8009D130.type = DEVICE_TYPE_INIT;
|
||||
D_8009D130.latency = HW_REG(PI_BSD_DOM1_LAT_REG, u32);
|
||||
D_8009D130.pulse = HW_REG(PI_BSD_DOM1_PWD_REG, u32);
|
||||
D_8009D130.pageSize = HW_REG(PI_BSD_DOM1_PGS_REG, u32);
|
||||
D_8009D130.relDuration = HW_REG(PI_BSD_DOM1_RLS_REG, u32);
|
||||
__Dom1SpeedParam.type = DEVICE_TYPE_INIT;
|
||||
__Dom1SpeedParam.latency = HW_REG(PI_BSD_DOM1_LAT_REG, u32);
|
||||
__Dom1SpeedParam.pulse = HW_REG(PI_BSD_DOM1_PWD_REG, u32);
|
||||
__Dom1SpeedParam.pageSize = HW_REG(PI_BSD_DOM1_PGS_REG, u32);
|
||||
__Dom1SpeedParam.relDuration = HW_REG(PI_BSD_DOM1_RLS_REG, u32);
|
||||
|
||||
D_8009D1A8.type = DEVICE_TYPE_INIT;
|
||||
D_8009D1A8.latency = HW_REG(PI_BSD_DOM2_LAT_REG, u32);
|
||||
D_8009D1A8.pulse = HW_REG(PI_BSD_DOM2_PWD_REG, u32);
|
||||
D_8009D1A8.pageSize = HW_REG(PI_BSD_DOM2_PGS_REG, u32);
|
||||
D_8009D1A8.relDuration = HW_REG(PI_BSD_DOM2_RLS_REG, u32);
|
||||
__Dom2SpeedParam.type = DEVICE_TYPE_INIT;
|
||||
__Dom2SpeedParam.latency = HW_REG(PI_BSD_DOM2_LAT_REG, u32);
|
||||
__Dom2SpeedParam.pulse = HW_REG(PI_BSD_DOM2_PWD_REG, u32);
|
||||
__Dom2SpeedParam.pageSize = HW_REG(PI_BSD_DOM2_PGS_REG, u32);
|
||||
__Dom2SpeedParam.relDuration = HW_REG(PI_BSD_DOM2_RLS_REG, u32);
|
||||
}
|
||||
|
||||
void __osInitialize_common(void) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "global.h"
|
||||
|
||||
OSTimer D_8009E590;
|
||||
OSTimer __osBaseTimer;
|
||||
OSTime __osCurrentTime;
|
||||
u32 __osBaseCounter;
|
||||
u32 __osViIntrCount;
|
||||
@@ -8,7 +8,7 @@ u32 __osTimerCounter;
|
||||
s32 D_8009E5C8[2]; // dummy bss padding required
|
||||
OSPifRam __osPfsPifRam;
|
||||
|
||||
OSTimer* __osTimerList = &D_8009E590;
|
||||
OSTimer* __osTimerList = &__osBaseTimer;
|
||||
|
||||
void __osTimerServicesInit(void) {
|
||||
__osCurrentTime = 0;
|
||||
|
||||
@@ -336,6 +336,7 @@
|
||||
0x8009E410 : "contpfs",
|
||||
0x8009E510 : "seteventmesg",
|
||||
0x8009E590 : "timerintr",
|
||||
0x8009E5D0 : "pfsisplug",
|
||||
0x8009E610 : "cartrominit",
|
||||
0x8009E690 : "vimgr",
|
||||
},
|
||||
|
||||
@@ -251,7 +251,7 @@
|
||||
0x80099128:("D_80099128","char","[]",0x1),
|
||||
0x8009915C:("D_8009915C","char","[]",0x1),
|
||||
0x80099178:("D_80099178","char","[]",0x1),
|
||||
0x800991A0:("D_800991A0","u16","[64]",0x80),
|
||||
0x800991A0:("__osRcpImTable","u16","[64]",0x80),
|
||||
0x80099220:("P","du","[5]",0x28),
|
||||
0x80099248:("rpi","du","",0x8),
|
||||
0x80099250:("pihi","du","",0x8),
|
||||
@@ -330,32 +330,31 @@
|
||||
0x8009CEB0:("siAccessBuf","OSMesg","[1]",0x4),
|
||||
0x8009CEB8:("__osSiAccessQueue","OSMesgQueue","",0x18),
|
||||
0x8009CED0:("__osContPifRam","OSPifRam","",0x40),
|
||||
0x8009CF0C:("D_8009CF0C","UNK_TYPE1","",0x1),
|
||||
0x8009CF10:("__osContLastPoll","u8","",0x1),
|
||||
0x8009CF11:("__osMaxControllers","u8","",0x1),
|
||||
0x8009CF18:("__osEepromTimer","OSTimer","",0x20),
|
||||
0x8009CF38:("D_8009CF38","OSMesgQueue","",0x18),
|
||||
0x8009CF50:("D_8009CF50","OSMesg","",0x4),
|
||||
0x8009CF38:("__osEepromTimerQ","OSMesgQueue","",0x18),
|
||||
0x8009CF50:("__osEepromTimerMsg","OSMesg","",0x4),
|
||||
0x8009CF60:("sHandleStatus","UNK_TYPE1","",0x1),
|
||||
0x8009CF70:("D_8009CF70","UNK_TYPE4","",0x4),
|
||||
0x8009CF80:("__osThreadSave","OSThread","",0x1b0),
|
||||
0x8009D130:("D_8009D130","OSPiHandle","",0x74),
|
||||
0x8009D1A8:("D_8009D1A8","OSPiHandle","",0x74),
|
||||
0x8009D130:("__Dom1SpeedParam","OSPiHandle","",0x74),
|
||||
0x8009D1A8:("__Dom2SpeedParam","OSPiHandle","",0x74),
|
||||
0x8009D220:("sPiMgrThread","OSThread","",0x1b0),
|
||||
0x8009D3D0:("sPiMgrStack","u8","[4096]",0x1000),
|
||||
0x8009E3D0:("D_8009E3D0","OSMesgQueue","",0x18),
|
||||
0x8009E3E8:("D_8009E3E8","OSMesg","[1]",0x4),
|
||||
0x8009E3F0:("D_8009E3F0","OSMesg","[1]",0x4),
|
||||
0x8009E3F0:("piAccessBuf","OSMesg","[1]",0x4),
|
||||
0x8009E3F8:("__osPiAccessQueue","OSMesgQueue","",0x18),
|
||||
0x8009E410:("__osPfsInodeCache","__OSInode","",0x100),
|
||||
0x8009E510:("__osEventStateTab","__OSEventState","[16]",0x80),
|
||||
0x8009E590:("D_8009E590","OSTimer","",0x20),
|
||||
0x8009E590:("__osBaseTimer","OSTimer","",0x20),
|
||||
0x8009E5B0:("__osCurrentTime","OSTime","",0x8),
|
||||
0x8009E5B8:("__osBaseCounter","u32","",0x4),
|
||||
0x8009E5BC:("__osViIntrCount","u32","",0x4),
|
||||
0x8009E5C0:("__osTimerCounter","u32","",0x4),
|
||||
0x8009E5D0:("__osPfsPifRam","OSPifRam","",0x40),
|
||||
0x8009E610:("CartRomHandle","OSPiHandle","",0x74),
|
||||
0x8009E610:("__CartRomHandle","OSPiHandle","",0x74),
|
||||
0x8009E690:("viThread","OSThread","",0x1b0),
|
||||
0x8009E840:("sViStack","u8","[4096]",0x1000),
|
||||
0x8009F840:("viEventQueue","OSMesgQueue","",0x18),
|
||||
|
||||
Reference in New Issue
Block a user