Mario Kart 64
controller.h File Reference
#include "PR/os_internal.h"
#include "PR/os.h"
#include "PR/rcp.h"
Include dependency graph for controller.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  OSPifRam
 
struct  __OSContReadFormat
 
struct  __OSContRequesFormat
 
struct  __OSContRequesFormatShort
 
struct  __OSContRamReadFormat
 
union  __OSInodeUnit
 
struct  __OSDir
 
struct  __OSInode
 
struct  __OSPackId
 
struct  __OSContEepromFormat
 
struct  __OSInodeCache
 

Macros

#define ARRLEN(x)   ((s32)(sizeof(x) / sizeof(x[0])))
 
#define CHNL_ERR(format)   ((format.rxsize & CHNL_ERR_MASK) >> 4)
 
#define CONT_CMD_REQUEST_STATUS   0
 
#define CONT_CMD_READ_BUTTON   1
 
#define CONT_CMD_READ_MEMPACK   2
 
#define CONT_CMD_WRITE_MEMPACK   3
 
#define CONT_CMD_READ_EEPROM   4
 
#define CONT_CMD_WRITE_EEPROM   5
 
#define CONT_CMD_RESET   0xff
 
#define CONT_CMD_REQUEST_STATUS_TX   1
 
#define CONT_CMD_READ_BUTTON_TX   1
 
#define CONT_CMD_READ_MEMPACK_TX   3
 
#define CONT_CMD_WRITE_MEMPACK_TX   35
 
#define CONT_CMD_READ_EEPROM_TX   2
 
#define CONT_CMD_WRITE_EEPROM_TX   10
 
#define CONT_CMD_RESET_TX   1
 
#define CONT_CMD_REQUEST_STATUS_RX   3
 
#define CONT_CMD_READ_BUTTON_RX   4
 
#define CONT_CMD_READ_MEMPACK_RX   33
 
#define CONT_CMD_WRITE_MEMPACK_RX   1
 
#define CONT_CMD_READ_EEPROM_RX   8
 
#define CONT_CMD_WRITE_EEPROM_RX   1
 
#define CONT_CMD_RESET_RX   3
 
#define CONT_CMD_NOP   0xff
 
#define CONT_CMD_END   0xfe
 
#define CONT_CMD_EXE   1
 
#define DIR_STATUS_EMPTY   0
 
#define DIR_STATUS_UNKNOWN   1
 
#define DIR_STATUS_OCCUPIED   2
 
#define ERRCK(fn)
 
#define SET_ACTIVEBANK_TO_ZERO
 
#define PFS_CHECK_ID
 
#define PFS_CHECK_STATUS
 
#define PFS_GET_STATUS
 

Functions

s32 __osEepStatus (OSMesgQueue *, OSContStatus *)
 
u16 __osSumcalc (u8 *ptr, int length)
 
s32 __osIdCheckSum (u16 *ptr, u16 *csum, u16 *icsum)
 
s32 __osRepairPackId (OSPfs *pfs, __OSPackId *badid, __OSPackId *newid)
 
s32 __osCheckPackId (OSPfs *pfs, __OSPackId *temp)
 
s32 __osGetId (OSPfs *pfs)
 
s32 __osCheckId (OSPfs *pfs)
 
s32 __osPfsRWInode (OSPfs *pfs, __OSInode *inode, u8 flag, u8 bank)
 
s32 __osPfsSelectBank (OSPfs *pfs)
 
s32 __osPfsDeclearPage (OSPfs *pfs, __OSInode *inode, int file_size_in_pages, int *first_page, u8 bank, int *decleared, int *last_page)
 
s32 __osPfsReleasePages (OSPfs *pfs, __OSInode *inode, u8 start_page, u16 *sum, u8 bank, __OSInodeUnit *last_page, int flag)
 
s32 __osBlockSum (OSPfs *pfs, u8 page_no, u16 *sum, u8 bank)
 
s32 __osContRamRead (OSMesgQueue *mq, int channel, u16 address, u8 *buffer)
 
s32 __osContRamWrite (OSMesgQueue *mq, int channel, u16 address, u8 *buffer, int force)
 
void __osContGetInitData (u8 *pattern, OSContStatus *data)
 
void __osPackRequestData (u8 cmd)
 
void __osPfsRequestData (u8 cmd)
 
void __osPfsGetInitData (u8 *pattern, OSContStatus *data)
 
u8 __osContAddressCrc (u16 addr)
 
u8 __osContDataCrc (u8 *data)
 
s32 __osPfsGetStatus (OSMesgQueue *queue, int channel)
 

Variables

u8 _osLastSentSiCmd
 
OSTimer __osEepromTimer
 
OSMesg __osEepromTimerMsg
 
OSMesgQueue __osEepromTimerQ
 
OSPifRam __osEepPifRam
 
OSPifRam __osContPifRam
 
OSPifRam __osPfsPifRam
 
u8 _osContNumControllers
 

Macro Definition Documentation

◆ ARRLEN

#define ARRLEN (   x)    ((s32)(sizeof(x) / sizeof(x[0])))

◆ CHNL_ERR

#define CHNL_ERR (   format)    ((format.rxsize & CHNL_ERR_MASK) >> 4)

◆ CONT_CMD_END

#define CONT_CMD_END   0xfe

◆ CONT_CMD_EXE

#define CONT_CMD_EXE   1

◆ CONT_CMD_NOP

#define CONT_CMD_NOP   0xff

◆ CONT_CMD_READ_BUTTON

#define CONT_CMD_READ_BUTTON   1

◆ CONT_CMD_READ_BUTTON_RX

#define CONT_CMD_READ_BUTTON_RX   4

◆ CONT_CMD_READ_BUTTON_TX

#define CONT_CMD_READ_BUTTON_TX   1

◆ CONT_CMD_READ_EEPROM

#define CONT_CMD_READ_EEPROM   4

◆ CONT_CMD_READ_EEPROM_RX

#define CONT_CMD_READ_EEPROM_RX   8

◆ CONT_CMD_READ_EEPROM_TX

#define CONT_CMD_READ_EEPROM_TX   2

◆ CONT_CMD_READ_MEMPACK

#define CONT_CMD_READ_MEMPACK   2

◆ CONT_CMD_READ_MEMPACK_RX

#define CONT_CMD_READ_MEMPACK_RX   33

◆ CONT_CMD_READ_MEMPACK_TX

#define CONT_CMD_READ_MEMPACK_TX   3

◆ CONT_CMD_REQUEST_STATUS

#define CONT_CMD_REQUEST_STATUS   0

◆ CONT_CMD_REQUEST_STATUS_RX

#define CONT_CMD_REQUEST_STATUS_RX   3

◆ CONT_CMD_REQUEST_STATUS_TX

#define CONT_CMD_REQUEST_STATUS_TX   1

◆ CONT_CMD_RESET

#define CONT_CMD_RESET   0xff

◆ CONT_CMD_RESET_RX

#define CONT_CMD_RESET_RX   3

◆ CONT_CMD_RESET_TX

#define CONT_CMD_RESET_TX   1

◆ CONT_CMD_WRITE_EEPROM

#define CONT_CMD_WRITE_EEPROM   5

◆ CONT_CMD_WRITE_EEPROM_RX

#define CONT_CMD_WRITE_EEPROM_RX   1

◆ CONT_CMD_WRITE_EEPROM_TX

#define CONT_CMD_WRITE_EEPROM_TX   10

◆ CONT_CMD_WRITE_MEMPACK

#define CONT_CMD_WRITE_MEMPACK   3

◆ CONT_CMD_WRITE_MEMPACK_RX

#define CONT_CMD_WRITE_MEMPACK_RX   1

◆ CONT_CMD_WRITE_MEMPACK_TX

#define CONT_CMD_WRITE_MEMPACK_TX   35

◆ DIR_STATUS_EMPTY

#define DIR_STATUS_EMPTY   0

◆ DIR_STATUS_OCCUPIED

#define DIR_STATUS_OCCUPIED   2

◆ DIR_STATUS_UNKNOWN

#define DIR_STATUS_UNKNOWN   1

◆ ERRCK

#define ERRCK (   fn)
Value:
ret = fn; \
if (ret != 0) \
return ret;

◆ PFS_CHECK_ID

#define PFS_CHECK_ID
Value:
s32 __osCheckId(OSPfs *pfs)
Definition: contpfs.c:202
#define PFS_ERR_NEW_PACK
Definition: os.h:433

◆ PFS_CHECK_STATUS

#define PFS_CHECK_STATUS
Value:
if ((pfs->status & PFS_INITIALIZED) == 0) \
#define PFS_INITIALIZED
Definition: os.h:427
#define PFS_ERR_INVALID
Definition: os.h:437

◆ PFS_GET_STATUS

#define PFS_GET_STATUS
Value:
ret = __osPfsGetStatus(queue, channel); \
__osSiRelAccess(); \
if (ret != 0) \
return ret;
void __osSiGetAccess(void)
Definition: __osSiCreateAccessQueue.c:15
s32 __osPfsGetStatus(OSMesgQueue *queue, int channel)
Definition: osPfsInit.c:27

◆ SET_ACTIVEBANK_TO_ZERO

#define SET_ACTIVEBANK_TO_ZERO
Value:
if (pfs->activebank != 0) \
{ \
pfs->activebank = 0; \
ERRCK(__osPfsSelectBank(pfs)) \
}
s32 __osPfsSelectBank(OSPfs *pfs)
Definition: contpfs.c:291

Function Documentation

◆ __osBlockSum()

s32 __osBlockSum ( OSPfs *  pfs,
u8  page_no,
u16 sum,
u8  bank 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __osCheckId()

s32 __osCheckId ( OSPfs *  pfs)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __osCheckPackId()

s32 __osCheckPackId ( OSPfs *  pfs,
__OSPackId temp 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __osContAddressCrc()

u8 __osContAddressCrc ( u16  addr)
Here is the caller graph for this function:

◆ __osContDataCrc()

u8 __osContDataCrc ( u8 data)
Here is the caller graph for this function:

◆ __osContGetInitData()

void __osContGetInitData ( u8 pattern,
OSContStatus *  data 
)
Here is the caller graph for this function:

◆ __osContRamRead()

s32 __osContRamRead ( OSMesgQueue *  mq,
int  channel,
u16  address,
u8 buffer 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __osContRamWrite()

s32 __osContRamWrite ( OSMesgQueue *  mq,
int  channel,
u16  address,
u8 buffer,
int  force 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __osEepStatus()

s32 __osEepStatus ( OSMesgQueue *  ,
OSContStatus *   
)

◆ __osGetId()

s32 __osGetId ( OSPfs *  pfs)
Todo:
remove magic constant
Todo:
loads of magic constants..
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __osIdCheckSum()

s32 __osIdCheckSum ( u16 ptr,
u16 csum,
u16 icsum 
)
Here is the caller graph for this function:

◆ __osPackRequestData()

void __osPackRequestData ( u8  cmd)
Here is the caller graph for this function:

◆ __osPfsDeclearPage()

s32 __osPfsDeclearPage ( OSPfs *  pfs,
__OSInode inode,
int  file_size_in_pages,
int *  first_page,
u8  bank,
int *  decleared,
int *  last_page 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __osPfsGetInitData()

void __osPfsGetInitData ( u8 pattern,
OSContStatus *  data 
)
Here is the caller graph for this function:

◆ __osPfsGetStatus()

s32 __osPfsGetStatus ( OSMesgQueue *  queue,
int  channel 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __osPfsReleasePages()

s32 __osPfsReleasePages ( OSPfs *  pfs,
__OSInode inode,
u8  start_page,
u16 sum,
u8  bank,
__OSInodeUnit last_page,
int  flag 
)
Todo:
magic number
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __osPfsRequestData()

void __osPfsRequestData ( u8  cmd)
Here is the caller graph for this function:

◆ __osPfsRWInode()

s32 __osPfsRWInode ( OSPfs *  pfs,
__OSInode inode,
u8  flag,
u8  bank 
)
Todo:
don't like this =/ //maybe &inode->inode_table[j*PFS_ONE_PAGE].ipage or something
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __osPfsSelectBank()

s32 __osPfsSelectBank ( OSPfs *  pfs)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __osRepairPackId()

s32 __osRepairPackId ( OSPfs *  pfs,
__OSPackId badid,
__OSPackId newid 
)
Todo:
fix magic number
Todo:
remove magic constant
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __osSumcalc()

u16 __osSumcalc ( u8 ptr,
int  length 
)
Here is the caller graph for this function:

Variable Documentation

◆ __osContPifRam

OSPifRam __osContPifRam
extern

◆ __osEepPifRam

OSPifRam __osEepPifRam
extern

◆ __osEepromTimer

OSTimer __osEepromTimer
extern

◆ __osEepromTimerMsg

OSMesg __osEepromTimerMsg
extern

◆ __osEepromTimerQ

OSMesgQueue __osEepromTimerQ
extern

◆ __osPfsPifRam

OSPifRam __osPfsPifRam
extern

◆ _osContNumControllers

u8 _osContNumControllers
extern

◆ _osLastSentSiCmd

u8 _osLastSentSiCmd
extern