Shipwright/soh/src/libultra/io/pfsselectbank.c
M4xw 39cc86c260 git subrepo clone https://github.com/HarbourMasters/soh.git
subrepo:
  subdir:   "soh"
  merged:   "ba904bbd0"
upstream:
  origin:   "https://github.com/HarbourMasters/soh.git"
  branch:   "master"
  commit:   "ba904bbd0"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2022-03-22 02:51:23 +01:00

19 lines
372 B
C

#include "ultra64/pfs.h"
#include "global.h"
s32 __osPfsSelectBank(OSPfs* pfs, u8 bank) {
u8 temp[BLOCKSIZE];
s32 i;
s32 ret = 0;
for (i = 0; i < BLOCKSIZE; i++) {
temp[i] = bank;
}
ret = __osContRamWrite(pfs->queue, pfs->channel, 0x8000 / BLOCKSIZE, temp, 0);
if (ret == 0) {
pfs->activebank = bank;
}
return ret;
}