8#define ARRLEN(x) ((s32) (sizeof(x) / sizeof(x[0])))
9#define CHNL_ERR(format) ((format.rxsize & CHNL_ERR_MASK) >> 4)
100#define CONT_CMD_REQUEST_STATUS 0
101#define CONT_CMD_READ_BUTTON 1
102#define CONT_CMD_READ_MEMPACK 2
103#define CONT_CMD_WRITE_MEMPACK 3
104#define CONT_CMD_READ_EEPROM 4
105#define CONT_CMD_WRITE_EEPROM 5
106#define CONT_CMD_RESET 0xff
108#define CONT_CMD_REQUEST_STATUS_TX 1
109#define CONT_CMD_READ_BUTTON_TX 1
110#define CONT_CMD_READ_MEMPACK_TX 3
111#define CONT_CMD_WRITE_MEMPACK_TX 35
112#define CONT_CMD_READ_EEPROM_TX 2
113#define CONT_CMD_WRITE_EEPROM_TX 10
114#define CONT_CMD_RESET_TX 1
116#define CONT_CMD_REQUEST_STATUS_RX 3
117#define CONT_CMD_READ_BUTTON_RX 4
118#define CONT_CMD_READ_MEMPACK_RX 33
119#define CONT_CMD_WRITE_MEMPACK_RX 1
120#define CONT_CMD_READ_EEPROM_RX 8
121#define CONT_CMD_WRITE_EEPROM_RX 1
122#define CONT_CMD_RESET_RX 3
124#define CONT_CMD_NOP 0xff
125#define CONT_CMD_END 0xfe
126#define CONT_CMD_EXE 1
128#define DIR_STATUS_EMPTY 0
129#define DIR_STATUS_UNKNOWN 1
130#define DIR_STATUS_OCCUPIED 2
177#define SET_ACTIVEBANK_TO_ZERO \
178 if (pfs->activebank != 0) { \
179 pfs->activebank = 0; \
180 ERRCK(__osPfsSelectBank(pfs)) \
183#define PFS_CHECK_ID \
184 if (__osCheckId(pfs) == PFS_ERR_NEW_PACK) \
185 return PFS_ERR_NEW_PACK;
188#define PFS_CHECK_STATUS \
189 if ((pfs->status & PFS_INITIALIZED) == 0) \
190 return PFS_ERR_INVALID;
192#define PFS_GET_STATUS \
194 ret = __osPfsGetStatus(queue, channel); \
s32 __osIdCheckSum(u16 *ptr, u16 *csum, u16 *icsum)
Definition contpfs.c:17
OSPifRam __osPfsPifRam
Definition osPfsIsPlug.c:6
OSMesgQueue __osEepromTimerQ
s32 __osPfsDeclearPage(OSPfs *pfs, __OSInode *inode, int file_size_in_pages, int *first_page, u8 bank, int *decleared, int *last_page)
Definition osPfsAllocateFile.c:112
u8 __osContDataCrc(u8 *data)
Definition crc.c:23
s32 __osPfsGetStatus(OSMesgQueue *queue, int channel)
Definition osPfsInit.c:27
s32 __osPfsSelectBank(OSPfs *pfs)
Definition contpfs.c:270
s32 __osContRamRead(OSMesgQueue *mq, int channel, u16 address, u8 *buffer)
Definition contramread.c:8
u8 __osContAddressCrc(u16 addr)
Definition crc.c:3
void __osContGetInitData(u8 *bitpattern, OSContStatus *status)
Definition osContInit.c:48
OSPifRam __osContPifRam
Definition osContInit.c:12
u16 __osSumcalc(u8 *ptr, int length)
Definition contpfs.c:4
void __osPackRequestData(u8 command)
Definition osContInit.c:69
s32 __osCheckId(OSPfs *pfs)
Definition contpfs.c:188
s32 __osCheckPackId(OSPfs *pfs, __OSPackId *temp)
Definition contpfs.c:110
s32 __osEepStatus(OSMesgQueue *, OSContStatus *)
Definition osEepromWrite.c:85
s32 __osPfsReleasePages(OSPfs *pfs, __OSInode *inode, u8 start_page, u16 *sum, u8 bank, __OSInodeUnit *last_page, int flag)
Definition osPfsDeleteFile.c:62
OSPifRam __osEepPifRam
Definition osEepromWrite.c:5
void __osPfsRequestData(u8 cmd)
Definition osPfsIsPlug.c:49
s32 __osPfsRWInode(OSPfs *pfs, __OSInode *inode, u8 flag, u8 bank)
Definition contpfs.c:212
s32 __osGetId(OSPfs *pfs)
Definition contpfs.c:143
void __osPfsGetInitData(u8 *pattern, OSContStatus *data)
Definition osPfsIsPlug.c:78
u8 _osContNumControllers
Definition osContInit.c:14
s32 __osContRamWrite(OSMesgQueue *mq, int channel, u16 address, u8 *buffer, int force)
Definition contramwrite.c:8
s32 __osBlockSum(OSPfs *pfs, u8 page_no, u16 *sum, u8 bank)
Definition osPfsDeleteFile.c:112
OSMesg __osEepromTimerMsg
u8 __osContLastCmd
Definition osContInit.c:13
s32 __osRepairPackId(OSPfs *pfs, __OSPackId *badid, __OSPackId *newid)
Definition contpfs.c:33
unsigned long long int u64
Definition llconv.c:2
#define PFS_FILE_EXT_LEN
Definition os.h:410
#define EEPROM_BLOCK_SIZE
Definition os.h:444
#define PFS_FILE_NAME_LEN
Definition os.h:409
#define BLOCKSIZE
Definition os.h:411
Definition controller.h:11
u32 pifstatus
Definition controller.h:13
Definition controller.h:64
u8 status
Definition controller.h:68
__OSInodeUnit start_page
Definition controller.h:67
u16 company_code
Definition controller.h:66
u16 data_sum
Definition controller.h:70
u32 game_code
Definition controller.h:65
s8 reserved
Definition controller.h:69
Definition controller.h:132
u8 bank
Definition controller.h:134
__OSInode inode
Definition controller.h:133
Definition controller.h:75
Definition controller.h:79
u8 banks
Definition controller.h:85
u32 random
Definition controller.h:81
u16 checksum
Definition controller.h:87
u16 deviceid
Definition controller.h:84
u8 version
Definition controller.h:86
u32 repaired
Definition controller.h:80
u16 inverted_checksum
Definition controller.h:88
u64 serial_low
Definition controller.h:83
u64 serial_mid
Definition controller.h:82
signed int s32
Definition ultratypes.h:15
unsigned int u32
Definition ultratypes.h:16
signed char s8
Definition ultratypes.h:11
unsigned short int u16
Definition ultratypes.h:14
unsigned char u8
Definition ultratypes.h:12
Definition controller.h:56
u8 bank
Definition controller.h:58
u8 page
Definition controller.h:59
u16 ipage
Definition controller.h:61