Minor cleanup

This commit is contained in:
Phillip Stephens 2022-09-10 14:32:57 -07:00
parent b0405b7673
commit 172d5efc91
2 changed files with 8 additions and 7 deletions

View File

@ -11,6 +11,7 @@ extern "C" {
#define CARD_FAT_FREEBLOCKS 0x0003u #define CARD_FAT_FREEBLOCKS 0x0003u
#define CARD_FAT_LASTSLOT 0x0004u #define CARD_FAT_LASTSLOT 0x0004u
#define CARD_PAGE_SIZE 128u
#define CARD_SEG_SIZE 512u #define CARD_SEG_SIZE 512u
#define CARD_NUM_SYSTEM_BLOCK 5 #define CARD_NUM_SYSTEM_BLOCK 5

View File

@ -14,10 +14,10 @@ static void BlockReadCallback(s32 chan, s32 result) {
goto error; goto error;
} }
card->xferred += 0x200; card->xferred += CARD_SEG_SIZE;
card->addr += 0x200; card->addr += CARD_SEG_SIZE;
(u8*)card->buffer += 0x200; (u8*)card->buffer += CARD_SEG_SIZE;
if (--card->repeat <= 0) { if (--card->repeat <= 0) {
goto error; goto error;
} }
@ -63,10 +63,10 @@ static void BlockWriteCallback(s32 chan, s32 result) {
goto error; goto error;
} }
card->xferred += 128; card->xferred += CARD_PAGE_SIZE;
card->addr += 128; card->addr += CARD_PAGE_SIZE;
(u8*)card->buffer += 128; (u8*)card->buffer += CARD_PAGE_SIZE;
if (--card->repeat <= 0) { if (--card->repeat <= 0) {
goto error; goto error;
} }
@ -96,7 +96,7 @@ s32 __CARDWrite(s32 chan, u32 addr, s32 length, void* dst, CARDCallback callback
} }
card->xferCallback = callback; card->xferCallback = callback;
card->repeat = (int)(length / 128u); card->repeat = (int)(length / CARD_PAGE_SIZE);
card->addr = addr; card->addr = addr;
card->buffer = dst; card->buffer = dst;