mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-04 15:04:31 +00:00
libultra files and directories restructure (#1038)
* Restructure files, begin header restructure * Format * us2dex * Fix parallel spelling Co-authored-by: JoshDuMan <40190173+JoshDuMan@users.noreply.github.com> * Use OS_K0_TO_PHYSICAL in place of VIRTUAL_TO_PHYSICAL in osAiSetNextBuffer * Uppercase hex, exception vector address defines * Interrupt flags 1 Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com> * Interrupt flags 2 Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com> Co-authored-by: JoshDuMan <40190173+JoshDuMan@users.noreply.github.com> Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
This commit is contained in:
parent
eabc918817
commit
f1d183d6fe
164 changed files with 1171 additions and 738 deletions
|
@ -106,7 +106,7 @@ void AudioHeap_DiscardSequence(s32 seqId) {
|
|||
}
|
||||
|
||||
void AudioHeap_WritebackDCache(void* mem, u32 size) {
|
||||
Audio_osWritebackDCache(mem, size);
|
||||
Audio_WritebackDCache(mem, size);
|
||||
}
|
||||
|
||||
void* AudioHeap_AllocZeroedAttemptExternal(AudioAllocPool* pool, u32 size) {
|
||||
|
@ -802,7 +802,7 @@ void AudioHeap_Init(void) {
|
|||
s32 temporaryMem;
|
||||
s32 totalMem;
|
||||
s32 wantMisc;
|
||||
u32 intMask;
|
||||
OSIntMask intMask;
|
||||
s32 i;
|
||||
s32 j;
|
||||
s32 pad2;
|
||||
|
|
|
@ -868,7 +868,7 @@ void AudioLoad_SyncDma(u32 devAddr, u8* addr, u32 size, s32 medium) {
|
|||
OSIoMesg* ioMesg = &gAudioContext.syncDmaIoMesg;
|
||||
size = ALIGN16(size);
|
||||
|
||||
Audio_osInvalDCache(addr, size);
|
||||
Audio_InvalDCache(addr, size);
|
||||
|
||||
while (true) {
|
||||
if (size < 0x400) {
|
||||
|
@ -1312,10 +1312,10 @@ void AudioLoad_ProcessSlowLoads(s32 resetStatus) {
|
|||
}
|
||||
|
||||
void AudioLoad_DmaSlowCopy(AudioSlowLoad* slowLoad, s32 size) {
|
||||
Audio_osInvalDCache(slowLoad->curRamAddr, size);
|
||||
Audio_InvalDCache(slowLoad->curRamAddr, size);
|
||||
osCreateMesgQueue(&slowLoad->msgqueue, &slowLoad->msg, 1);
|
||||
AudioLoad_Dma(&slowLoad->ioMesg, 0U, 0, slowLoad->curDevAddr, slowLoad->curRamAddr, size, &slowLoad->msgqueue,
|
||||
slowLoad->medium, "SLOWCOPY");
|
||||
AudioLoad_Dma(&slowLoad->ioMesg, OS_MESG_PRI_NORMAL, 0, slowLoad->curDevAddr, slowLoad->curRamAddr, size,
|
||||
&slowLoad->msgqueue, slowLoad->medium, "SLOWCOPY");
|
||||
}
|
||||
|
||||
void AudioLoad_DmaSlowCopyUnkMedium(s32 devAddr, u8* ramAddr, s32 size, s32 arg3) {
|
||||
|
@ -1548,7 +1548,7 @@ void AudioLoad_ProcessAsyncLoad(AudioAsyncLoad* asyncLoad, s32 resetStatus) {
|
|||
|
||||
void AudioLoad_AsyncDma(AudioAsyncLoad* asyncLoad, u32 size) {
|
||||
size = ALIGN16(size);
|
||||
Audio_osInvalDCache(asyncLoad->curRamAddr, size);
|
||||
Audio_InvalDCache(asyncLoad->curRamAddr, size);
|
||||
osCreateMesgQueue(&asyncLoad->msgQueue, &asyncLoad->msg, 1);
|
||||
AudioLoad_Dma(&asyncLoad->ioMesg, 0, 0, asyncLoad->curDevAddr, asyncLoad->curRamAddr, size, &asyncLoad->msgQueue,
|
||||
asyncLoad->medium, "BGCOPY");
|
||||
|
|
|
@ -55,7 +55,7 @@ void AudioSynth_InitNextRingBuf(s32 chunkLen, s32 bufIndex, s32 reverbIndex) {
|
|||
if (reverb->downsampleRate >= 2) {
|
||||
if (reverb->framesToIgnore == 0) {
|
||||
bufItem = &reverb->items[reverb->curFrame][bufIndex];
|
||||
Audio_osInvalDCache(bufItem->toDownsampleLeft, DEFAULT_LEN_2CH);
|
||||
Audio_InvalDCache(bufItem->toDownsampleLeft, DEFAULT_LEN_2CH);
|
||||
|
||||
for (j = 0, i = 0; i < bufItem->lengthA / 2; j += reverb->downsampleRate, i++) {
|
||||
reverb->leftRingBuf[bufItem->startPos + i] = bufItem->toDownsampleLeft[j];
|
||||
|
|
15
src/code/code_800E6840.c
Normal file
15
src/code/code_800E6840.c
Normal file
|
@ -0,0 +1,15 @@
|
|||
#include "global.h"
|
||||
|
||||
void Audio_InvalDCache(void* buf, s32 size) {
|
||||
OSIntMask prevMask = osSetIntMask(1);
|
||||
|
||||
osInvalDCache(buf, size);
|
||||
osSetIntMask(prevMask);
|
||||
}
|
||||
|
||||
void Audio_WritebackDCache(void* buf, s32 size) {
|
||||
OSIntMask prevMask = osSetIntMask(1);
|
||||
|
||||
osWritebackDCache(buf, size);
|
||||
osSetIntMask(prevMask);
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
#include "global.h"
|
||||
|
||||
// memcpy used in __osMalloc.c
|
||||
// memmove used in __osMalloc.c
|
||||
void* func_801068B0(void* dst, void* src, size_t size) {
|
||||
u8* spC = dst;
|
||||
u8* sp8 = src;
|
||||
|
|
|
@ -17,7 +17,7 @@ u32 sIrqMgrRetraceCount = 0;
|
|||
#define STATUS_NMI 2
|
||||
|
||||
void IrqMgr_AddClient(IrqMgr* this, IrqMgrClient* c, OSMesgQueue* msgQ) {
|
||||
u32 prevInt;
|
||||
OSIntMask prevInt;
|
||||
|
||||
LogUtils_CheckNullPointer("this", this, "../irqmgr.c", 96);
|
||||
LogUtils_CheckNullPointer("c", c, "../irqmgr.c", 97);
|
||||
|
@ -43,7 +43,7 @@ void IrqMgr_AddClient(IrqMgr* this, IrqMgrClient* c, OSMesgQueue* msgQ) {
|
|||
void IrqMgr_RemoveClient(IrqMgr* this, IrqMgrClient* c) {
|
||||
IrqMgrClient* iter = this->clients;
|
||||
IrqMgrClient* lastIter = NULL;
|
||||
u32 prevInt;
|
||||
OSIntMask prevInt;
|
||||
|
||||
LogUtils_CheckNullPointer("this", this, "../irqmgr.c", 129);
|
||||
LogUtils_CheckNullPointer("c", c, "../irqmgr.c", 130);
|
||||
|
|
|
@ -72,7 +72,7 @@ void PadMgr_RumbleControl(PadMgr* padMgr) {
|
|||
osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パック ぶるぶるぶるぶる");
|
||||
osSyncPrintf(VT_RST);
|
||||
|
||||
if (osSetRumble(&padMgr->pfs[i], temp) != 0) {
|
||||
if (__osMotorAccess(&padMgr->pfs[i], temp) != 0) {
|
||||
padMgr->pakType[i] = 0;
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
// "A communication error has occurred with the vibration pack"
|
||||
|
@ -94,7 +94,7 @@ void PadMgr_RumbleControl(PadMgr* padMgr) {
|
|||
osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パック 停止");
|
||||
osSyncPrintf(VT_RST);
|
||||
|
||||
if (osSetRumble(&padMgr->pfs[i], 0) != 0) {
|
||||
if (osMotorStop(&padMgr->pfs[i]) != 0) {
|
||||
padMgr->pakType[i] = 0;
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
// "A communication error has occurred with the vibration pack"
|
||||
|
@ -133,12 +133,12 @@ void PadMgr_RumbleControl(PadMgr* padMgr) {
|
|||
i = frame % 4;
|
||||
|
||||
if (padMgr->ctrlrIsConnected[i] && (padMgr->padStatus[i].status & 1) && (padMgr->pakType[i] != 1)) {
|
||||
var4 = osProbeRumblePak(ctrlrQ, &padMgr->pfs[i], i);
|
||||
var4 = osMotorInit(ctrlrQ, &padMgr->pfs[i], i);
|
||||
|
||||
if (var4 == 0) {
|
||||
padMgr->pakType[i] = 1;
|
||||
osSetRumble(&padMgr->pfs[i], 1);
|
||||
osSetRumble(&padMgr->pfs[i], 0);
|
||||
osMotorStart(&padMgr->pfs[i]);
|
||||
osMotorStop(&padMgr->pfs[i]);
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
// "Recognized vibration pack"
|
||||
osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パックを認識しました");
|
||||
|
@ -164,7 +164,7 @@ void PadMgr_RumbleStop(PadMgr* padMgr) {
|
|||
OSMesgQueue* ctrlrQ = PadMgr_LockSerialMesgQueue(padMgr);
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
if (osProbeRumblePak(ctrlrQ, &padMgr->pfs[i], i) == 0) {
|
||||
if (osMotorInit(ctrlrQ, &padMgr->pfs[i], i) == 0) {
|
||||
if ((gFaultStruct.msgId == 0) && (padMgr->rumbleOnFrames != 0)) {
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
// "Stop vibration pack"
|
||||
|
@ -172,7 +172,7 @@ void PadMgr_RumbleStop(PadMgr* padMgr) {
|
|||
osSyncPrintf(VT_RST);
|
||||
}
|
||||
|
||||
osSetRumble(&padMgr->pfs[i], 0);
|
||||
osMotorStop(&padMgr->pfs[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3117,7 +3117,8 @@ void Message_Update(GlobalContext* globalCtx) {
|
|||
R_TEXT_CHOICE_YPOS(1) = R_TEXTBOX_Y_TARGET + 32;
|
||||
R_TEXT_CHOICE_YPOS(2) = R_TEXTBOX_Y_TARGET + 44;
|
||||
osSyncPrintf("message->msg_disp_type=%x\n", msgCtx->textBoxProperties & 0xF0);
|
||||
if (msgCtx->textBoxType == TEXTBOX_TYPE_NONE_BOTTOM || msgCtx->textBoxType == TEXTBOX_TYPE_NONE_NO_SHADOW) {
|
||||
if (msgCtx->textBoxType == TEXTBOX_TYPE_NONE_BOTTOM ||
|
||||
msgCtx->textBoxType == TEXTBOX_TYPE_NONE_NO_SHADOW) {
|
||||
msgCtx->msgMode = MSGMODE_TEXT_STARTING;
|
||||
R_TEXTBOX_X = R_TEXTBOX_X_TARGET;
|
||||
R_TEXTBOX_Y = R_TEXTBOX_Y_TARGET;
|
||||
|
|
|
@ -23,12 +23,15 @@ void SsSram_Init(u32 addr, u8 handleType, u8 handleDomain, u8 handleLatency, u8
|
|||
sSsSramContext.piHandle.relDuration = handleRelDuration;
|
||||
sSsSramContext.piHandle.domain = handleDomain;
|
||||
sSsSramContext.piHandle.speed = handleSpeed;
|
||||
|
||||
bzero(&sSsSramContext.piHandle.transferInfo, sizeof(__OSTranxInfo));
|
||||
|
||||
prevInt = __osDisableInt();
|
||||
sSsSramContext.piHandle.next = __osPiTable;
|
||||
__osPiTable = &sSsSramContext.piHandle;
|
||||
__osRestoreInt(prevInt);
|
||||
sSsSramContext.ioMesg.hdr.pri = 0;
|
||||
|
||||
sSsSramContext.ioMesg.hdr.pri = OS_MESG_PRI_NORMAL;
|
||||
sSsSramContext.ioMesg.hdr.retQueue = &sSsSramContext.mesgQ;
|
||||
sSsSramContext.ioMesg.devAddr = addr;
|
||||
}
|
||||
|
@ -48,6 +51,6 @@ void SsSram_Dma(void* dramAddr, size_t size, s32 direction) {
|
|||
|
||||
void SsSram_ReadWrite(u32 addr, void* dramAddr, size_t size, s32 direction) {
|
||||
osSyncPrintf("ssSRAMReadWrite:%08x %08x %08x %d\n", addr, dramAddr, size, direction);
|
||||
SsSram_Init(addr, DEVICE_TYPE_SRAM, 1, 5, 0xD, 2, 0xC, 0);
|
||||
SsSram_Init(addr, DEVICE_TYPE_SRAM, PI_DOMAIN2, 5, 0xD, 2, 0xC, 0);
|
||||
SsSram_Dma(dramAddr, size, direction);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue