From 987566eebe346f9dea1a2ca9db4cf5bc0c97a797 Mon Sep 17 00:00:00 2001 From: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com> Date: Thu, 11 Nov 2021 20:45:53 +0000 Subject: [PATCH] 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> --- src/libultra/io/pfsselectbank.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/libultra/io/pfsselectbank.c b/src/libultra/io/pfsselectbank.c index 8353dc43c2..6cc43a4701 100644 --- a/src/libultra/io/pfsselectbank.c +++ b/src/libultra/io/pfsselectbank.c @@ -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; +}