summaryrefslogtreecommitdiff
path: root/src/kart_dma.c
diff options
context:
space:
mode:
authorMegaMech <MegaMech@users.noreply.github.com>2023-10-06 00:19:09 -0600
committerGitHub <noreply@github.com>2023-10-06 00:19:09 -0600
commit2b74bbbcefe396564a55357eda094fc8c8baf36a (patch)
tree02ff798bcacc50d767e033cb2d13cab819e72eee /src/kart_dma.c
parent274fc21ffa271492d1fa231c99fc48a11e3bbed1 (diff)
Doc setup_game_memory, label syms, add osSyncPrintf support, match funcs (#444)
* Doc setup_game_memory and label syms * match func_800132F4 * match func label defines * fix some fake ptrs * match more code * Matches * Add osSyncPrintf support and matches * Add func equiv to draw_square and add comment to is_debug
Diffstat (limited to 'src/kart_dma.c')
-rw-r--r--src/kart_dma.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/kart_dma.c b/src/kart_dma.c
index f8cc54993..1015be175 100644
--- a/src/kart_dma.c
+++ b/src/kart_dma.c
@@ -1707,8 +1707,7 @@ void func_80027040(Player *player, s8 arg1, s8 arg2, s8 arg3, s8 arg4) {
}
} else if (((temp & 0x400) == 0x400) || ((temp & 0x01000000) == 0x01000000) || ((temp & 0x02000000) == 0x02000000) || ((temp & 0x10000) == 0x10000)) {
osInvalDCache(&D_802DFB80[arg4][arg3][arg1], 0x780U);
- // I think there's something off with the "player->unk_0A8 >> 8"
- // I don't like that right-shift
+ // player->unk_0A8 >> 8 converts an 8.8 fixed-point animation frame to a whole number.
osPiStartDma(&gDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ, (uintptr_t) &_kart_texturesSegmentRomStart[SEGMENT_OFFSET(gKartTextureTumbles[player->characterId][player->unk_0A8 >> 8])], &D_802DFB80[arg4][arg3][arg1], 0x900, &gDmaMesgQueue);
osRecvMesg(&gDmaMesgQueue, &gMainReceivedMesg, OS_MESG_BLOCK);
} else {
@@ -1734,8 +1733,7 @@ void func_80027560(Player *player, s8 arg1, s8 arg2, s8 arg3, s8 arg4) {
((temp & 0x02000000) == 0x02000000) || ((temp & 0x10000) == 0x10000))
{
osInvalDCache(&D_802DFB80[arg4][arg3][arg1], 0x780);
- // I think there's something off with the "player->unk_0A8 >> 8"
- // I don't like that right-shift
+ // player->unk_0A8 >> 8 converts an 8.8 fixed-point animation frame to a whole number.
osPiStartDma(&gDmaIoMesg, OS_MESG_PRI_NORMAL, OS_READ, (uintptr_t) &_kart_texturesSegmentRomStart[SEGMENT_OFFSET(gKartTextureTumbles[player->characterId][player->unk_0A8 >> 8])], &D_802DFB80[arg4][arg3][arg1], 0x900, &gDmaMesgQueue);
} else {
osInvalDCache(&D_802DFB80[arg4][arg3][arg1], D_800DDEB0[player->characterId]);
@@ -1746,7 +1744,7 @@ void func_80027560(Player *player, s8 arg1, s8 arg2, s8 arg3, s8 arg4) {
void func_80027A20(Player *player, s8 arg1, s8 arg2, s8 arg3) {
// Weird typecasting is being done here. We define D_802F1F80 as a 3-dimensional u32 array,
// but its better to understand it as a 3-dimensional struct_D_802F1F80 array.
- struct_D_802F1F80 *temp_s0 = (struct_D_802F1F80 *) &D_802F1F80[arg3][arg2][arg1 << 7];
+ struct_D_802F1F80 *temp_s0 = (struct_D_802F1F80 *) &D_802F1F80[arg3][arg2][arg1 * 0x80];
switch(gActiveScreenMode) {
case SCREEN_MODE_1P:
case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL: