pfsselectbank OK (#420)

* pfsselectbank OK

* Update src/libultra/io/pfsselectbank.c

Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>

Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>
This commit is contained in:
EllipticEllipsis 2021-11-11 20:45:53 +00:00 committed by GitHub
parent 285381e662
commit 987566eebe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 1 deletions

View File

@ -1,3 +1,18 @@
#include "PR/pfs.h"
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/pfsselectbank/__osPfsSelectBank.s")
s32 __osPfsSelectBank(OSPfs* pfs, u8 bank) {
u8 buf[BLOCKSIZE];
s32 i;
s32 ret = 0;
for (i = 0; i < BLOCKSIZE; i++) {
buf[i] = bank;
}
ret = __osContRamWrite(pfs->queue, pfs->channel, 0x8000 / BLOCKSIZE, buf, 0);
if (ret == 0) {
pfs->activebank = bank;
}
return ret;
}