pfsselectbank.c
907 Bytes
/*---------------------------------------------------------------------
Copyright (C) 1997, Nintendo.
File pfsselectbank.c
Coded by
Modified by Koji Mitsunari. Feb 13, 1998.
Comments Change bank of Controller PAK
$Id: pfsselectbank.c,v 1.1.1.1 2002/05/02 03:28:44 blythe Exp $
---------------------------------------------------------------------*/
#include "osint.h"
#include "controller.h"
s32
__osPfsSelectBank(OSPfs *pfs, u8 bank) /* by YASU */
{
u8 temp[BLOCKSIZE];
int i;
s32 ret = 0;
#ifdef TEST
pfs->channel = pfs->activebank;
return(ret);
#else
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);
#endif /* TEST */
}