diff options
Diffstat (limited to 'src/code')
| -rw-r--r-- | src/code/audio_heap.c | 4 | ||||
| -rw-r--r-- | src/code/audio_load.c | 10 | ||||
| -rw-r--r-- | src/code/audio_synthesis.c | 2 | ||||
| -rw-r--r-- | src/code/code_800E6840.c | 15 | ||||
| -rw-r--r-- | src/code/code_801068B0.c | 2 | ||||
| -rw-r--r-- | src/code/irqmgr.c | 4 | ||||
| -rw-r--r-- | src/code/padmgr.c | 14 | ||||
| -rw-r--r-- | src/code/z_message_PAL.c | 3 | ||||
| -rw-r--r-- | src/code/z_ss_sram.c | 7 |
9 files changed, 40 insertions, 21 deletions
diff --git a/src/code/audio_heap.c b/src/code/audio_heap.c index d5f3fc167..ba398c5c4 100644 --- a/src/code/audio_heap.c +++ b/src/code/audio_heap.c @@ -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; diff --git a/src/code/audio_load.c b/src/code/audio_load.c index a29b883a9..e4b1299db 100644 --- a/src/code/audio_load.c +++ b/src/code/audio_load.c @@ -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"); diff --git a/src/code/audio_synthesis.c b/src/code/audio_synthesis.c index 7d1db0730..472a7d1f9 100644 --- a/src/code/audio_synthesis.c +++ b/src/code/audio_synthesis.c @@ -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]; diff --git a/src/code/code_800E6840.c b/src/code/code_800E6840.c new file mode 100644 index 000000000..129502b52 --- /dev/null +++ b/src/code/code_800E6840.c @@ -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); +} diff --git a/src/code/code_801068B0.c b/src/code/code_801068B0.c index 113a472d8..d673cc5e0 100644 --- a/src/code/code_801068B0.c +++ b/src/code/code_801068B0.c @@ -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; diff --git a/src/code/irqmgr.c b/src/code/irqmgr.c index 6f5fe105b..6e7118bff 100644 --- a/src/code/irqmgr.c +++ b/src/code/irqmgr.c @@ -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); diff --git a/src/code/padmgr.c b/src/code/padmgr.c index 02477e205..9de0882cc 100644 --- a/src/code/padmgr.c +++ b/src/code/padmgr.c @@ -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]); } } diff --git a/src/code/z_message_PAL.c b/src/code/z_message_PAL.c index 58c87347b..d8a9cb717 100644 --- a/src/code/z_message_PAL.c +++ b/src/code/z_message_PAL.c @@ -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; diff --git a/src/code/z_ss_sram.c b/src/code/z_ss_sram.c index 307f56441..847482d19 100644 --- a/src/code/z_ss_sram.c +++ b/src/code/z_ss_sram.c @@ -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); } |
