From 903d979c0566c4fba04eca964f2605c9581a9852 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Sat, 15 Oct 2022 23:26:42 -0700 Subject: [PATCH] More minor cleanup, use macros from gba.h --- src/Dolphin/GBA/GBA.c | 8 ++++---- src/Dolphin/GBA/GBARead.c | 2 +- src/Dolphin/GBA/GBAWrite.c | 4 ++-- src/Dolphin/GBA/GBAXfer.c | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Dolphin/GBA/GBA.c b/src/Dolphin/GBA/GBA.c index 781596aa..bb89f2e0 100644 --- a/src/Dolphin/GBA/GBA.c +++ b/src/Dolphin/GBA/GBA.c @@ -51,7 +51,7 @@ s32 GBAGetStatusAsync(s32 chan, u8* status, GBACallback callback) { s32 ret; gba = &__GBA[chan]; if (gba->callback != NULL) { - ret = 2; + ret = GBA_BUSY; } else { gba->command = 0; gba->status = status; @@ -67,7 +67,7 @@ s32 GBAGetStatus(s32 chan, u8* status) { s32 ret; ret = GBAGetStatusAsync(chan, status, __GBASyncCallback); - if (ret != 0) { + if (ret != GBA_READY) { return ret; } @@ -80,7 +80,7 @@ s32 GBAResetAsync(s32 chan, u8* status, GBACallback callback) { s32 ret; gba = &__GBA[chan]; if (gba->callback != NULL) { - ret = 2; + ret = GBA_BUSY; } else { gba->command = 0xFF; gba->status = status; @@ -96,7 +96,7 @@ s32 GBAReset(s32 chan, u8* status) { s32 ret; ret = GBAResetAsync(chan, status, __GBASyncCallback); - if (ret != 0) { + if (ret != GBA_READY) { return ret; } diff --git a/src/Dolphin/GBA/GBARead.c b/src/Dolphin/GBA/GBARead.c index 2f5a0b83..ab19bbb3 100644 --- a/src/Dolphin/GBA/GBARead.c +++ b/src/Dolphin/GBA/GBARead.c @@ -34,7 +34,7 @@ s32 GBARead(s32 chan, u8* dst, u8* status) { s32 tmp; s32 ret; ret = GBAReadAsync(chan, dst, status, __GBASyncCallback); - if (ret != 0) { + if (ret != GBA_READY) { return ret; } diff --git a/src/Dolphin/GBA/GBAWrite.c b/src/Dolphin/GBA/GBAWrite.c index c4b34d0d..ae8ecebe 100644 --- a/src/Dolphin/GBA/GBAWrite.c +++ b/src/Dolphin/GBA/GBAWrite.c @@ -17,7 +17,7 @@ s32 GBAWriteAsync(s32 chan, u8* src, u8* status, GBACallback callback) { gba = &__GBA[chan]; if (gba->callback != NULL) { - ret = 2; + ret = GBA_BUSY; } else { gba->command = 0x15; memcpy(gba->src, src, 4); @@ -35,7 +35,7 @@ s32 GBAWrite(s32 chan, u8* src, u8* status) { s32 ret; s32 tmp; ret = GBAWriteAsync(chan, src, status, __GBASyncCallback); - if (ret != 0) { + if (ret != GBA_READY) { return ret; } return __GBASync(chan); diff --git a/src/Dolphin/GBA/GBAXfer.c b/src/Dolphin/GBA/GBAXfer.c index 59a25c12..ec62432e 100644 --- a/src/Dolphin/GBA/GBAXfer.c +++ b/src/Dolphin/GBA/GBAXfer.c @@ -69,12 +69,12 @@ void TypeAndStatusCallback(s32 chan, u32 type) { } if ((type & 0xFF) != 0 || (type & 0xffff0000) != 0x40000) { - gba->result = 1; + gba->result = GBA_NOT_READY; } else { if (SITransfer(chan, &gba->command, gba->_0c, gba->dst, gba->_10, __GBAHandler, gba->delay)) { return; } - gba->result = 2; + gba->result = GBA_BUSY; } if (gba->_38 != NULL) { @@ -107,7 +107,7 @@ s32 __GBATransfer(s32 chan, s32 w1, s32 w2, GBATransferCallback callback) { SIGetTypeAsync(chan, TypeAndStatusCallback); OSRestoreInterrupts(enabled); - return 0; + return GBA_READY; } OSTime __GBASetDelay(s32 chan, OSTime delay) {