summaryrefslogtreecommitdiff
path: root/src/libultra_code_O2/__osPfsSelectBank.c
blob: d257e049113fbeb06981fb166baec6e4a1044b2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#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;
}