coastline 0.0.4
Loading...
Searching...
No Matches
os_cont.h File Reference

The controllers and the Controller Pak file system. More...

#include <PR/os.h>
#include <PR/ultratypes.h>
Include dependency graph for os_cont.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  OSContStatus
 What osContInit() learns of a controller. More...
struct  OSContPad
 The buttons and stick of a controller. More...
struct  OSPfs
 An open Controller Pak. More...
struct  OSPfsState
 What osPfsFileState() reports of a file. More...

Macros

#define MAXCONTROLLERS   4
 The ports of the console.
#define CONT_ABSOLUTE   0x0001
#define CONT_RELATIVE   0x0002
#define CONT_JOYPORT   0x0004
#define CONT_CARD_ON   0x01
#define CONT_CARD_PULL   0x02
#define CONT_ADDR_CRC_ER   0x04
#define PFS_ERR_NOPACK   1
#define PFS_ERR_NEW_PACK   2
#define PFS_ERR_INCONSISTENT   3
#define PFS_ERR_CONTRFAIL   4
#define PFS_ERR_INVALID   5
#define PFS_ERR_BAD_DATA   6
#define PFS_DATA_FULL   7
#define PFS_DIR_FULL   8
#define PFS_ERR_EXIST   9
#define PFS_ERR_ID_FATAL   10
#define PFS_ERR_DEVICE   11
#define PFS_READ   0
#define PFS_WRITE   1
#define CONT_A   0x8000
#define CONT_B   0x4000
#define CONT_G   0x2000
#define CONT_START   0x1000
#define CONT_UP   0x0800
#define CONT_DOWN   0x0400
#define CONT_LEFT   0x0200
#define CONT_RIGHT   0x0100
#define CONT_L   0x0020
#define CONT_R   0x0010
#define CONT_E   0x0008
#define CONT_D   0x0004
#define CONT_C   0x0002
#define CONT_F   0x0001
#define A_BUTTON   CONT_A
#define B_BUTTON   CONT_B
#define L_TRIG   CONT_L
#define R_TRIG   CONT_R
#define Z_TRIG   CONT_G
#define START_BUTTON   CONT_START
#define U_JPAD   CONT_UP
#define L_JPAD   CONT_LEFT
#define R_JPAD   CONT_RIGHT
#define D_JPAD   CONT_DOWN
#define U_CBUTTONS   CONT_E
#define L_CBUTTONS   CONT_C
#define R_CBUTTONS   CONT_F
#define D_CBUTTONS   CONT_D
#define CONT_NO_RESPONSE_ERROR   8
 OSContPad.errno of a controller that does not respond.
#define CONT_ERRNO   errno
 Select the Nintendo 64 controller channel-error member.
#define PFS_INITIALIZED   0x01
#define PFS_CORRUPTED   0x02
#define CONT_EEPROM   0x8000
 The device type a 4 Kbit EEPROM reports.
#define CONT_EEPROM_BUSY   0x80
 The status bit of an EEPROM that is still writing.
#define EEPROM_MAXBLOCKS   64
 The highest block address of the EEPROM routines accept.
#define EEPROM_BLOCK_SIZE   8
 The bytes of a block of the EEPROM.

Functions

s32 osContInit (OSMesgQueue *mq, u8 *bitpattern, OSContStatus *data)
 Wait until the controllers have powered up, then find which are present.
s32 osContStartReadData (OSMesgQueue *mq)
 Start reading the buttons and sticks of every controller.
void osContGetReadData (OSContPad *data)
 Copy the buttons and sticks of the read osContStartReadData() started.
s32 osPfsIsPlug (OSMesgQueue *queue, u8 *pattern)
 Find which controllers have a Controller Pak inserted.
s32 osPfsInit (OSMesgQueue *queue, OSPfs *pfs, int channel)
 Open the Controller Pak of a channel, repairing its ID if needed, and check its file system.
s32 osPfsInitPak (OSMesgQueue *queue, OSPfs *pfs, int channel)
 Open the Controller Pak of a channel like osPfsInit(), starting from the ID checksum of the caller's stack.
s32 osPfsRepairId (OSPfs *pfs)
 Read the ID block again, repairing it if needed.
s32 osPfsChecker (OSPfs *pfs)
 Remove directory entries whose page chains are broken, and rebuild the page tables from the chains that remain.
s32 osPfsFindFile (OSPfs *pfs, u16 company_code, u32 game_code, u8 *game_name, u8 *ext_name, s32 *file_no)
 Find a file by its codes, and by its names unless they are NULL.
s32 osPfsReadWriteFile (OSPfs *pfs, s32 file_no, u8 flag, int offset, int size_in_bytes, u8 *data_buffer)
 Read or write whole blocks of a file.
s32 osPfsFreeBlocks (OSPfs *pfs, s32 *bytes_not_used)
 Return the bytes of the pages no file uses.
s32 osPfsAllocateFile (OSPfs *pfs, u16 company_code, u32 game_code, u8 *game_name, u8 *ext_name, int file_size_in_bytes, s32 *file_no)
 Create a file of at least the given size.
s32 osPfsNumFiles (OSPfs *pfs, s32 *max_files, s32 *files_used)
 Count the directory entries and the files that use them.
s32 osPfsFileState (OSPfs *pfs, s32 file_no, OSPfsState *state)
 Report the size, codes and names of a file.
s32 osPfsDeleteFile (OSPfs *pfs, u16 company_code, u32 game_code, u8 *game_name, u8 *ext_name)
 Delete a file and free its pages.
s32 osMotorInit (OSMesgQueue *mq, OSPfs *pfs, int channel)
 Open the Rumble Pak of a channel and build the commands that start and stop its motor.
s32 osMotorStart (OSPfs *pfs)
 Start the motor of a Rumble Pak.
s32 osMotorStop (OSPfs *pfs)
 Stop the motor of a Rumble Pak.
s32 osEepromProbe (OSMesgQueue *mq)
 Find whether the cartridge has an EEPROM.
s32 osEepromLongRead (OSMesgQueue *mq, u8 address, u8 *buffer, int length)
 Read consecutive blocks of the EEPROM, waiting 12 ms after each block.
s32 osEepromLongWrite (OSMesgQueue *mq, u8 address, u8 *buffer, int length)
 Write consecutive blocks of the EEPROM, waiting 12 ms after each block.
s32 osEepromWrite (OSMesgQueue *mq, u8 address, u8 *buffer)
 Write a block of the EEPROM once it is no longer busy.
s32 osEepromRead (OSMesgQueue *mq, u8 address, u8 *buffer)
 Read a block of the EEPROM once it is no longer busy.

Detailed Description

The controllers and the Controller Pak file system.

Macro Definition Documentation

◆ MAXCONTROLLERS

#define MAXCONTROLLERS   4

The ports of the console.

◆ CONT_ABSOLUTE

#define CONT_ABSOLUTE   0x0001

The device reports absolute positions, as a controller does.

◆ CONT_RELATIVE

#define CONT_RELATIVE   0x0002

The device reports relative movement, as a mouse does.

◆ CONT_JOYPORT

#define CONT_JOYPORT   0x0004

The device has a port for a Pak.

◆ CONT_CARD_ON

#define CONT_CARD_ON   0x01

A Pak is plugged in.

◆ CONT_CARD_PULL

#define CONT_CARD_PULL   0x02

A Pak was pulled out since the last check.

◆ CONT_ADDR_CRC_ER

#define CONT_ADDR_CRC_ER   0x04

The CRC of the last address was wrong.

◆ PFS_ERR_NOPACK

#define PFS_ERR_NOPACK   1

No Pak is plugged in.

◆ PFS_ERR_NEW_PACK

#define PFS_ERR_NEW_PACK   2

The Pak was changed.

◆ PFS_ERR_INCONSISTENT

#define PFS_ERR_INCONSISTENT   3

The file system needs repair.

◆ PFS_ERR_CONTRFAIL

#define PFS_ERR_CONTRFAIL   4

The transfer with the controller failed.

◆ PFS_ERR_INVALID

#define PFS_ERR_INVALID   5

An argument is invalid or the file does not exist.

◆ PFS_ERR_BAD_DATA

#define PFS_ERR_BAD_DATA   6

The data read is wrong.

◆ PFS_DATA_FULL

#define PFS_DATA_FULL   7

No pages are free.

◆ PFS_DIR_FULL

#define PFS_DIR_FULL   8

No entries of the directory are free.

◆ PFS_ERR_EXIST

#define PFS_ERR_EXIST   9

The file already exists.

◆ PFS_ERR_ID_FATAL

#define PFS_ERR_ID_FATAL   10

The identity area cannot be repaired.

◆ PFS_ERR_DEVICE

#define PFS_ERR_DEVICE   11

The Pak is not a Controller Pak.

◆ PFS_READ

#define PFS_READ   0

Read from the file.

◆ PFS_WRITE

#define PFS_WRITE   1

Write to the file.

◆ CONT_A

#define CONT_A   0x8000

The A button.

◆ CONT_B

#define CONT_B   0x4000

The B button.

◆ CONT_G

#define CONT_G   0x2000

The Z trigger.

◆ CONT_START

#define CONT_START   0x1000

The Start button.

◆ CONT_UP

#define CONT_UP   0x0800

Up on the directional pad.

◆ CONT_DOWN

#define CONT_DOWN   0x0400

Down on the directional pad.

◆ CONT_LEFT

#define CONT_LEFT   0x0200

Left on the directional pad.

◆ CONT_RIGHT

#define CONT_RIGHT   0x0100

Right on the directional pad.

◆ CONT_L

#define CONT_L   0x0020

The L trigger.

◆ CONT_R

#define CONT_R   0x0010

The R trigger.

◆ CONT_E

#define CONT_E   0x0008

The up C button.

◆ CONT_D

#define CONT_D   0x0004

The down C button.

◆ CONT_C

#define CONT_C   0x0002

The left C button.

◆ CONT_F

#define CONT_F   0x0001

The right C button.

◆ A_BUTTON

#define A_BUTTON   CONT_A

The A button.

◆ B_BUTTON

#define B_BUTTON   CONT_B

The B button.

◆ L_TRIG

#define L_TRIG   CONT_L

The L trigger.

◆ R_TRIG

#define R_TRIG   CONT_R

The R trigger.

◆ Z_TRIG

#define Z_TRIG   CONT_G

The Z trigger.

◆ START_BUTTON

#define START_BUTTON   CONT_START

The Start button.

◆ U_JPAD

#define U_JPAD   CONT_UP

Up on the directional pad.

◆ L_JPAD

#define L_JPAD   CONT_LEFT

Left on the directional pad.

◆ R_JPAD

#define R_JPAD   CONT_RIGHT

Right on the directional pad.

◆ D_JPAD

#define D_JPAD   CONT_DOWN

Down on the directional pad.

◆ U_CBUTTONS

#define U_CBUTTONS   CONT_E

The up C button.

◆ L_CBUTTONS

#define L_CBUTTONS   CONT_C

The left C button.

◆ R_CBUTTONS

#define R_CBUTTONS   CONT_F

The right C button.

◆ D_CBUTTONS

#define D_CBUTTONS   CONT_D

The down C button.

◆ CONT_NO_RESPONSE_ERROR

#define CONT_NO_RESPONSE_ERROR   8

OSContPad.errno of a controller that does not respond.

◆ CONT_ERRNO

#define CONT_ERRNO   errno

Select the Nintendo 64 controller channel-error member.

◆ PFS_INITIALIZED

#define PFS_INITIALIZED   0x01

The file system was initialised.

◆ PFS_CORRUPTED

#define PFS_CORRUPTED   0x02

The file system is corrupted.

◆ CONT_EEPROM

#define CONT_EEPROM   0x8000

The device type a 4 Kbit EEPROM reports.

◆ CONT_EEPROM_BUSY

#define CONT_EEPROM_BUSY   0x80

The status bit of an EEPROM that is still writing.

◆ EEPROM_MAXBLOCKS

#define EEPROM_MAXBLOCKS   64

The highest block address of the EEPROM routines accept.

◆ EEPROM_BLOCK_SIZE

#define EEPROM_BLOCK_SIZE   8

The bytes of a block of the EEPROM.

Function Documentation

◆ osContInit()

s32 osContInit ( OSMesgQueue * mq,
u8 * bitpattern,
OSContStatus * data )

Wait until the controllers have powered up, then find which are present.

Windows returns 1 without changing the output arguments.

Parameters
mqThe queue of SI events, registered with osSetEventMesg() for OS_EVENT_SI.
bitpatternReceives a bit for each controller that answered.
dataReceives the status of each of the MAXCONTROLLERS controllers.
Returns
0, or -1 when the SI was busy. A second call returns 0 without a query.
Ghidra address:
USA: 0x80265910
Ghidra address:
Asia: 0x80265460
Ghidra address:
EUR: 0x802670a0
Ghidra address:
JPN: 0x80266ba0
Ghidra address:
BRD3D: 0x10042af0
Ghidra address:
BRGlide: 0x100385e0

◆ osContStartReadData()

s32 osContStartReadData ( OSMesgQueue * mq)

Start reading the buttons and sticks of every controller.

Parameters
mqThe queue of SI events. The routine blocks on it only when the read command must be written first, and the caller waits on it for the end of the read.
Returns
0, or -1 when the SI was busy.
Ghidra address:
USA: 0x80264760
Ghidra address:
Asia: 0x802642B0
Ghidra address:
EUR: 0x80265fc0
Ghidra address:
JPN: 0x802659f0

◆ osContGetReadData()

void osContGetReadData ( OSContPad * data)

Copy the buttons and sticks of the read osContStartReadData() started.

On Windows, update only the first pad and preserve its error byte.

Parameters
dataReceives the pad of each of the MAXCONTROLLERS controllers. A pad with a nonzero errno is not otherwise written.
Ghidra address:
USA: 0x80264824
Ghidra address:
Asia: 0x80264374
Ghidra address:
EUR: 0x80266084
Ghidra address:
JPN: 0x80265ab4
Ghidra address:
BRD3D: 0x10060e00
Ghidra address:
BRGlide: 0x10059e70

◆ osPfsIsPlug()

s32 osPfsIsPlug ( OSMesgQueue * queue,
u8 * pattern )

Find which controllers have a Controller Pak inserted.

Parameters
queueThe queue of SI events, blocked on for each transfer.
patternReceives a bit for each controller with a Pak.
Returns
0, or -1 when the SI was busy.
Ghidra address:
USA: 0x80261940
Ghidra address:
Asia: 0x80261490
Ghidra address:
EUR: 0x802630c0
Ghidra address:
JPN: 0x80262b60

◆ osPfsInit()

s32 osPfsInit ( OSMesgQueue * queue,
OSPfs * pfs,
int channel )

Open the Controller Pak of a channel, repairing its ID if needed, and check its file system.

Parameters
queueThe queue of SI events, blocked on for each transfer.
pfsReceives the description of the open Pak.
channelThe controller port, 0 to 3.
Returns
0, or PFS_ERR_NOPACK, PFS_ERR_NEW_PACK, PFS_ERR_CONTRFAIL, PFS_ERR_ID_FATAL, PFS_ERR_DEVICE, or PFS_ERR_INCONSISTENT.
Ghidra address:
USA: 0x80265cd0
Ghidra address:
Asia: 0x80265820
Ghidra address:
EUR: 0x80267460
Ghidra address:
JPN: 0x80266f60

◆ osPfsInitPak()

s32 osPfsInitPak ( OSMesgQueue * queue,
OSPfs * pfs,
int channel )

Open the Controller Pak of a channel like osPfsInit(), starting from the ID checksum of the caller's stack.

Parameters
queueThe queue of SI events, blocked on for each transfer.
pfsReceives the description of the open Pak.
channelThe controller port, 0 to 3.
Returns
0, or PFS_ERR_NOPACK, PFS_ERR_NEW_PACK, PFS_ERR_CONTRFAIL, PFS_ERR_ID_FATAL, PFS_ERR_DEVICE, or PFS_ERR_INCONSISTENT.
Ghidra address:
USA: 0x80261cb0
Ghidra address:
Asia: 0x80261800
Ghidra address:
EUR: 0x80263430
Ghidra address:
JPN: 0x80262ed0

◆ osPfsRepairId()

s32 osPfsRepairId ( OSPfs * pfs)

Read the ID block again, repairing it if needed.

Parameters
pfsThe open Pak, updated with the ID, the geometry, and the label.
Returns
0, or PFS_ERR_NEW_PACK, PFS_ERR_CONTRFAIL, PFS_ERR_ID_FATAL, or PFS_ERR_DEVICE.
Ghidra address:
USA: 0x80262660
Ghidra address:
Asia: 0x802621B0
Ghidra address:
EUR: 0x80263de0
Ghidra address:
JPN: 0x80263880

◆ osPfsChecker()

s32 osPfsChecker ( OSPfs * pfs)

Remove directory entries whose page chains are broken, and rebuild the page tables from the chains that remain.

Parameters
pfsThe open Pak. PFS_CORRUPTED in its status is set when the check finds damage.
Returns
0, or PFS_ERR_NEW_PACK, PFS_ERR_CONTRFAIL, or PFS_ERR_ID_FATAL.
Ghidra address:
USA: 0x80262a80
Ghidra address:
Asia: 0x802625D0
Ghidra address:
EUR: 0x80264200
Ghidra address:
JPN: 0x80263ca0

◆ osPfsFindFile()

s32 osPfsFindFile ( OSPfs * pfs,
u16 company_code,
u32 game_code,
u8 * game_name,
u8 * ext_name,
s32 * file_no )

Find a file by its codes, and by its names unless they are NULL.

Parameters
pfsThe open Pak.
company_codeThe company code of the file.
game_codeThe game code of the file.
game_nameThe 16-byte file name in the Pak character set, or NULL to match every name.
ext_nameThe 4-byte extension in the Pak character set, or NULL to match every one.
file_noReceives the directory index, or -1.
Returns
0, PFS_ERR_INVALID when no file matches, or PFS_ERR_NEW_PACK or PFS_ERR_CONTRFAIL.
Ghidra address:
USA: 0x802628c0
Ghidra address:
Asia: 0x80262410
Ghidra address:
EUR: 0x80264040
Ghidra address:
JPN: 0x80263ae0

◆ osPfsReadWriteFile()

s32 osPfsReadWriteFile ( OSPfs * pfs,
s32 file_no,
u8 flag,
int offset,
int size_in_bytes,
u8 * data_buffer )

Read or write whole blocks of a file.

Parameters
pfsThe open Pak.
file_noThe directory index of the file.
flagPFS_READ or PFS_WRITE.
offsetThe byte offset in the file, a multiple of 32.
size_in_bytesThe count of bytes, a positive multiple of 32.
data_bufferThe buffer read into or written from.
Returns
0, or PFS_ERR_INVALID, PFS_ERR_NEW_PACK, PFS_ERR_INCONSISTENT, PFS_ERR_BAD_DATA, or PFS_ERR_CONTRFAIL.
Ghidra address:
USA: 0x802635dc
Ghidra address:
Asia: 0x8026312C
Ghidra address:
EUR: 0x80264d5c
Ghidra address:
JPN: 0x802647fc

◆ osPfsFreeBlocks()

s32 osPfsFreeBlocks ( OSPfs * pfs,
s32 * bytes_not_used )

Return the bytes of the pages no file uses.

Parameters
pfsThe open Pak.
bytes_not_usedReceives the free space in bytes, a multiple of 256.
Returns
0, or PFS_ERR_INVALID, PFS_ERR_NEW_PACK, PFS_ERR_INCONSISTENT, or PFS_ERR_CONTRFAIL.
Ghidra address:
USA: 0x802639e0
Ghidra address:
Asia: 0x80263530
Ghidra address:
EUR: 0x80265160
Ghidra address:
JPN: 0x80264c00

◆ osPfsAllocateFile()

s32 osPfsAllocateFile ( OSPfs * pfs,
u16 company_code,
u32 game_code,
u8 * game_name,
u8 * ext_name,
int file_size_in_bytes,
s32 * file_no )

Create a file of at least the given size.

Parameters
pfsThe open Pak.
company_codeThe company code of the file, not 0.
game_codeThe game code of the file, not 0.
game_nameThe 16-byte file name in the Pak character set.
ext_nameThe 4-byte extension in the Pak character set.
file_size_in_bytesThe size of the file, rounded up to a whole page of 256 bytes.
file_noReceives the directory index of the new file.
Returns
0, or PFS_ERR_INVALID, PFS_ERR_NEW_PACK, PFS_ERR_EXIST, PFS_DATA_FULL, PFS_DIR_FULL, PFS_ERR_INCONSISTENT, or PFS_ERR_CONTRFAIL.
Ghidra address:
USA: 0x80263b30
Ghidra address:
Asia: 0x80263680
Ghidra address:
EUR: 0x802652b0
Ghidra address:
JPN: 0x80264d50

◆ osPfsNumFiles()

s32 osPfsNumFiles ( OSPfs * pfs,
s32 * max_files,
s32 * files_used )

Count the directory entries and the files that use them.

Parameters
pfsThe open Pak.
max_filesReceives the number of directory entries.
files_usedReceives the number of entries with nonzero codes.
Returns
0, or PFS_ERR_INVALID, PFS_ERR_NEW_PACK, or PFS_ERR_CONTRFAIL.
Ghidra address:
USA: 0x802677e0
Ghidra address:
Asia: 0x80267330
Ghidra address:
EUR: 0x80268fd0
Ghidra address:
JPN: 0x80268a80

◆ osPfsFileState()

s32 osPfsFileState ( OSPfs * pfs,
s32 file_no,
OSPfsState * state )

Report the size, codes and names of a file.

Parameters
pfsThe open Pak.
file_noThe directory index of the file.
stateReceives the size, codes, and names of the file.
Returns
0, or PFS_ERR_INVALID, PFS_ERR_NEW_PACK, PFS_ERR_INCONSISTENT, or PFS_ERR_CONTRFAIL.
Ghidra address:
USA: 0x80267930
Ghidra address:
Asia: 0x80267480
Ghidra address:
EUR: 0x80269120
Ghidra address:
JPN: 0x80268bd0

◆ osPfsDeleteFile()

s32 osPfsDeleteFile ( OSPfs * pfs,
u16 company_code,
u32 game_code,
u8 * game_name,
u8 * ext_name )

Delete a file and free its pages.

Parameters
pfsThe open Pak.
company_codeThe company code of the file, not 0.
game_codeThe game code of the file, not 0.
game_nameThe 16-byte file name in the Pak character set.
ext_nameThe 4-byte extension in the Pak character set.
Returns
0, or PFS_ERR_INVALID, PFS_ERR_NEW_PACK, PFS_ERR_INCONSISTENT, or PFS_ERR_CONTRFAIL.
Ghidra address:
USA: 0x80267c20
Ghidra address:
Asia: 0x80267770
Ghidra address:
EUR: 0x80269410
Ghidra address:
JPN: 0x80268ec0

◆ osMotorInit()

s32 osMotorInit ( OSMesgQueue * mq,
OSPfs * pfs,
int channel )

Open the Rumble Pak of a channel and build the commands that start and stop its motor.

Parameters
mqThe queue of SI events, blocked on for each transfer.
pfsReceives the description of the Rumble Pak.
channelThe controller port, 0 to 3.
Returns
0, or PFS_ERR_NOPACK, PFS_ERR_CONTRFAIL, or PFS_ERR_DEVICE when the Pak is not a Rumble Pak.
Ghidra address:
USA: 0x80262370
Ghidra address:
Asia: 0x80261EC0
Ghidra address:
EUR: 0x80263af0
Ghidra address:
JPN: 0x80263590

◆ osMotorStart()

s32 osMotorStart ( OSPfs * pfs)

Start the motor of a Rumble Pak.

Parameters
pfsThe Rumble Pak osMotorInit() opened.
Returns
0, or the channel error, or PFS_ERR_CONTRFAIL when the Pak returns a wrong CRC.
Ghidra address:
USA: 0x80262088
Ghidra address:
Asia: 0x80261BD8
Ghidra address:
EUR: 0x80263808
Ghidra address:
JPN: 0x802632a8

◆ osMotorStop()

s32 osMotorStop ( OSPfs * pfs)

Stop the motor of a Rumble Pak.

Parameters
pfsThe Rumble Pak osMotorInit() opened.
Returns
0, or the channel error, or PFS_ERR_CONTRFAIL when the Pak returns a wrong CRC.
Ghidra address:
USA: 0x80261f20
Ghidra address:
Asia: 0x80261A70
Ghidra address:
EUR: 0x802636a0
Ghidra address:
JPN: 0x80263140

◆ osEepromProbe()

s32 osEepromProbe ( OSMesgQueue * mq)

Find whether the cartridge has an EEPROM.

Parameters
mqThe queue of SI events, blocked on for each transfer.
Returns
1 when a 4 Kbit EEPROM responds, otherwise 0.
Ghidra address:
EUR: 0x80262dd0
Ghidra address:
JPN: 0x80262870

◆ osEepromLongRead()

s32 osEepromLongRead ( OSMesgQueue * mq,
u8 address,
u8 * buffer,
int length )

Read consecutive blocks of the EEPROM, waiting 12 ms after each block.

Parameters
mqThe queue of SI events, blocked on for each transfer.
addressThe first block, at most EEPROM_MAXBLOCKS.
bufferReceives the blocks.
lengthThe bytes to read, a multiple of EEPROM_BLOCK_SIZE.
Returns
0, -1 for an address out of range, or the error of osEepromRead().
Ghidra address:
EUR: 0x80262e40
Ghidra address:
JPN: 0x802628e0

◆ osEepromLongWrite()

s32 osEepromLongWrite ( OSMesgQueue * mq,
u8 address,
u8 * buffer,
int length )

Write consecutive blocks of the EEPROM, waiting 12 ms after each block.

Parameters
mqThe queue of SI events, blocked on for each transfer.
addressThe first block, at most EEPROM_MAXBLOCKS.
bufferThe blocks to write.
lengthThe bytes to write, a multiple of EEPROM_BLOCK_SIZE.
Returns
0, -1 for an address out of range, or the error of osEepromWrite().
Ghidra address:
EUR: 0x80262f80
Ghidra address:
JPN: 0x80262a20

◆ osEepromWrite()

s32 osEepromWrite ( OSMesgQueue * mq,
u8 address,
u8 * buffer )

Write a block of the EEPROM once it is no longer busy.

Parameters
mqThe queue of SI events, blocked on for each transfer.
addressThe block, at most EEPROM_MAXBLOCKS.
bufferThe EEPROM_BLOCK_SIZE bytes to write.
Returns
0, -1 for an address out of range, CONT_NO_RESPONSE_ERROR when no EEPROM responds, or the channel error. The SI is not released after CONT_NO_RESPONSE_ERROR.
Ghidra address:
EUR: 0x8026ab40
Ghidra address:
JPN: 0x8026a5f0

◆ osEepromRead()

s32 osEepromRead ( OSMesgQueue * mq,
u8 address,
u8 * buffer )

Read a block of the EEPROM once it is no longer busy.

Parameters
mqThe queue of SI events, blocked on for each transfer.
addressThe block, at most EEPROM_MAXBLOCKS.
bufferReceives the EEPROM_BLOCK_SIZE bytes, written only without an error.
Returns
0, -1 for an address out of range, CONT_NO_RESPONSE_ERROR when no EEPROM responds, or the channel error. The SI is not released after CONT_NO_RESPONSE_ERROR.
Ghidra address:
EUR: 0x8026b020
Ghidra address:
JPN: 0x8026aad0