Misc missing constant use

This commit is contained in:
GriffinR
2023-08-10 01:21:38 -04:00
parent da238562f0
commit 18319e8da3
22 changed files with 254 additions and 218 deletions

View File

@@ -139,7 +139,7 @@ u16 rfu_initializeAPI(u32 *APIBuffer, u16 buffByteSize, IntrFunc *sioIntrTable_p
u16 buffByteSizeMax;
// is in EWRAM?
if (((uintptr_t)APIBuffer & 0xF000000) == 0x2000000 && copyInterruptToRam)
if (((uintptr_t)APIBuffer & 0xF000000) == EWRAM_START && copyInterruptToRam)
return ERR_RFU_API_BUFF_ADR;
// is not 4-byte aligned?
if ((u32)APIBuffer & 3)
@@ -338,7 +338,7 @@ u16 rfu_getRFUStatus(u8 *rfuState)
u16 rfu_MBOOT_CHILD_inheritanceLinkStatus(void)
{
const char *s1 = str_checkMbootLL;
char *s2 = (char *)0x30000F0;
char *s2 = (char *)(IWRAM_START + 0xF0);
u16 checksum;
u16 *mb_buff_iwram_p;
u8 i;
@@ -347,15 +347,15 @@ u16 rfu_MBOOT_CHILD_inheritanceLinkStatus(void)
while (*s1 != '\0')
if (*s1++ != *s2++)
return 1;
mb_buff_iwram_p = (u16 *)0x3000000;
mb_buff_iwram_p = (u16 *)IWRAM_START;
// The size of struct RfuLinkStatus is 180
checksum = 0;
for (i = 0; i < 180/2; ++i)
checksum += *mb_buff_iwram_p++;
if (checksum != *(u16 *)0x30000FA)
if (checksum != *(u16 *)(IWRAM_START + 0xFA))
return 1;
CpuCopy16((u16 *)0x3000000, gRfuLinkStatus, sizeof(struct RfuLinkStatus));
CpuCopy16((u16 *)IWRAM_START, gRfuLinkStatus, sizeof(struct RfuLinkStatus));
gRfuStatic->flags |= 0x80; // mboot
return 0;
}