mirror of
https://github.com/zeldaret/oot
synced 2026-06-15 14:31:39 -04:00
Fix most compiler warnings in the boot and code segments (#674)
* Less warnings in boot & code segments * few more warnings gone * Ran formatter * z_view warning gone * -> 1 * f31 -> 31 * Remove function casts * Few more small improvements * Separate declaration and assignment in func_80091738 and Item_Give Co-authored-by: Thar0 <maximilianc64@gmail.com>
This commit is contained in:
@@ -11,8 +11,10 @@ s32 __osContRamRead(OSMesgQueue* ctrlrqueue, s32 channel, u16 addr, u8* data) {
|
||||
s32 retryCount = 2;
|
||||
|
||||
__osSiGetAccess();
|
||||
|
||||
do {
|
||||
bufptr = &pifMempakBuf;
|
||||
bufptr = (u8*)&gPifMempakBuf;
|
||||
|
||||
if ((__osContLastPoll != 2) || (__osPfsLastChannel != channel)) {
|
||||
|
||||
__osContLastPoll = 2;
|
||||
@@ -20,7 +22,7 @@ s32 __osContRamRead(OSMesgQueue* ctrlrqueue, s32 channel, u16 addr, u8* data) {
|
||||
// clang-format off
|
||||
for (i = 0; i < channel; i++) { *bufptr++ = 0; }
|
||||
// clang-format on
|
||||
pifMempakBuf.status = 1;
|
||||
gPifMempakBuf.status = 1;
|
||||
((__OSContRamHeader*)bufptr)->unk_00 = 0xFF;
|
||||
((__OSContRamHeader*)bufptr)->txsize = 3;
|
||||
((__OSContRamHeader*)bufptr)->rxsize = 0x21;
|
||||
@@ -31,12 +33,14 @@ s32 __osContRamRead(OSMesgQueue* ctrlrqueue, s32 channel, u16 addr, u8* data) {
|
||||
} else {
|
||||
bufptr += channel;
|
||||
}
|
||||
|
||||
((__OSContRamHeader*)bufptr)->hi = addr >> 3; // send byte 1
|
||||
((__OSContRamHeader*)bufptr)->lo = (s8)(__osContAddressCrc(addr) | (addr << 5)); // send byte 2
|
||||
__osSiRawStartDma(OS_WRITE, &pifMempakBuf);
|
||||
__osSiRawStartDma(OS_WRITE, &gPifMempakBuf);
|
||||
osRecvMesg(ctrlrqueue, NULL, OS_MESG_BLOCK);
|
||||
__osSiRawStartDma(OS_READ, &pifMempakBuf);
|
||||
__osSiRawStartDma(OS_READ, &gPifMempakBuf);
|
||||
osRecvMesg(ctrlrqueue, NULL, OS_MESG_BLOCK);
|
||||
|
||||
ret = (((__OSContRamHeader*)bufptr)->rxsize & 0xC0) >> 4;
|
||||
if (!ret) {
|
||||
if (((__OSContRamHeader*)bufptr)->datacrc != __osContDataCrc(bufptr + 6)) {
|
||||
@@ -55,6 +59,8 @@ s32 __osContRamRead(OSMesgQueue* ctrlrqueue, s32 channel, u16 addr, u8* data) {
|
||||
break;
|
||||
}
|
||||
} while (0 <= retryCount--);
|
||||
|
||||
__osSiRelAccess();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user