summaryrefslogtreecommitdiff
path: root/lib/ultralib/src/io/pfsselectbank.c
blob: 7e33b2d3e5a0969e4424008bbe56493789ffd5c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "PR/os_internal.h"
#include "controller.h"

#if BUILD_VERSION >= VERSION_J
s32 __osPfsSelectBank(OSPfs* pfs, u8 bank) {
    u8 temp[BLOCKSIZE];
    int i;
    s32 ret = 0;

    for (i = 0; i < BLOCKSIZE; i++) {
        temp[i] = bank;
    }

    ret = __osContRamWrite(pfs->queue, pfs->channel, CONT_BLOCK_DETECT, temp, FALSE);

    if (ret == 0) {
        pfs->activebank = bank;
    }

    return ret;
}
#endif