mirror of
https://github.com/izzy2lost/Diddy-Kong-Racing.git
synced 2026-06-19 01:16:26 -07:00
Fix dmaMesg's being an array of 1
This commit is contained in:
@@ -90,6 +90,7 @@ void osCreatePiManager(OSPri pri, OSMesgQueue *cmdQ, OSMesg *cmdBuf, s32 cmdMsgC
|
||||
OSMesgQueue *osPiGetCmdQueue(void);
|
||||
s32 osPiWriteIo(uintptr_t devAddr, u32 data);
|
||||
s32 osPiReadIo(uintptr_t devAddr, u32 *data);
|
||||
s32 osPiRawReadIo(u32 devAddr, u32 *data);
|
||||
|
||||
s32 osPiRawStartDma(s32 dir, u32 cart_addr, void *dram_addr, size_t size);
|
||||
s32 osEPiRawStartDma(OSPiHandle *piHandle, s32 dir, u32 cart_addr, void *dram_addr, size_t size);
|
||||
|
||||
+4
-4
@@ -11,7 +11,7 @@
|
||||
/************ .bss ************/
|
||||
|
||||
OSIoMesg gAssetsDmaIoMesg;
|
||||
OSMesg gDmaMesgBuf[1]; //Seems to only work as an array of 1 for some reason.
|
||||
OSMesg gDmaMesg;
|
||||
OSMesgQueue gDmaMesgQueue;
|
||||
OSMesg gPIMesgBuf[16];
|
||||
OSMesgQueue gPIMesgQueue;
|
||||
@@ -25,7 +25,7 @@ extern u8 __ASSETS_LUT_START, __ASSETS_LUT_END; // __ASSETS_LUT_START = 0xECB60,
|
||||
void func_80076BA0(void) {
|
||||
u32 assetTableSize;
|
||||
osCreateMesgQueue(&gPIMesgQueue, gPIMesgBuf, ARRAY_COUNT(gPIMesgBuf));
|
||||
osCreateMesgQueue(&gDmaMesgQueue, gDmaMesgBuf, ARRAY_COUNT(gDmaMesgBuf));
|
||||
osCreateMesgQueue(&gDmaMesgQueue, &gDmaMesg, 1);
|
||||
osCreatePiManager((OSPri)150, &gPIMesgQueue, gPIMesgBuf, ARRAY_COUNT(gPIMesgBuf));
|
||||
assetTableSize = &__ASSETS_LUT_END - &__ASSETS_LUT_START;
|
||||
gAssetsLookupTable = (s32 *)allocate_from_main_pool_safe(assetTableSize, COLOR_TAG_GRAY);
|
||||
@@ -175,7 +175,7 @@ s32 get_size_of_asset_section(u32 assetIndex) {
|
||||
* Copies data from the game cartridge to a ram address.
|
||||
*/
|
||||
void dmacopy(u32 romOffset, u32 ramAddress, s32 numBytes) {
|
||||
OSMesg dmaMesgBuf[1]; //Seems to only work as an array of 1 for some reason.
|
||||
OSMesg dmaMesg;
|
||||
s32 numBytesToDMA;
|
||||
|
||||
osInvalDCache(ramAddress, numBytes);
|
||||
@@ -185,7 +185,7 @@ void dmacopy(u32 romOffset, u32 ramAddress, s32 numBytes) {
|
||||
numBytesToDMA = numBytes;
|
||||
}
|
||||
osPiStartDma(&gAssetsDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ, romOffset, ramAddress, numBytesToDMA, &gDmaMesgQueue);
|
||||
osRecvMesg(&gDmaMesgQueue, dmaMesgBuf, ARRAY_COUNT(dmaMesgBuf));
|
||||
osRecvMesg(&gDmaMesgQueue, &dmaMesg, 1);
|
||||
numBytes -= numBytesToDMA;
|
||||
romOffset += numBytesToDMA;
|
||||
ramAddress += numBytesToDMA;
|
||||
|
||||
Reference in New Issue
Block a user