Each system call is performed via an indirect vector. This means that rather than calling a fixed address, a function pointer is fetched from the fixed address and the call goes through this pointer. For each vector there is a number of different functions available, selected by register r7. Sometimes there is also a superfunction to be selected by register r6. Any arguments to the syscall is passed in registers r4 and r5 (and r6, if it is not used to select superfunction) as in a normal function call. The ROMFONT syscalls are a bit peculiar by using r1 instead of r7 to select function.
This is a list of all known system calls. They are sorted first by vector, and then by (superfunction and) function code. Detailed descriptions follow below. (The names selected for the syscalls below are totally arbitrary, and is only intended as a mnemonic for the function of the call.)
Prepares the other two SYSINFO calls for use by copying the relevant data from the system flashrom into 8C000068-8C00007F. Always call this function before using the other two calls.
Args: none
Returns: zero
Read an icon from the flashrom. The format those icons are in is not known. SYSINFO_INIT must have been called first.
Args:
Returns: number of read bytes if successful, negative if read failed
Query the unique 64 bit ID number of this Dreamcast. SYSINFO_INIT must have been called first.
Args: none
Returns: A pointer to where the ID is stored as 8 contiguous bytes
Returns the address of the ROM font. The font is organized as 288 narrow characters (12 × 24 pixels), followed by 7078 wide characters (24 × 24 pixels), finally followed by 129 VMS icons (32 × 32 pixels). The total size of the font is thus (288 * 12 * 24 / 8) + (7078 * 24 * 24 / 8) + (129 * 32 *32 / 8) = (288 * 36) + (7078 * 72) + (129 * 128) = 10368 + 509616 + 16512 = 536496 bytes. Note that the narrow characters are stored as three nybbles per line, so each pair of two lines occupy three bytes together.
The organization of the narrow characters are as follows:
|
The organization of the wide characters are as follows (a row is 94 characters):
|
The organization of the VMS icons are as follows:
|
Args: none
Returns: A pointer to the first narrow character
Tries to lock a mutex for exclusive access to the ROM font. Quite why anyone would want to arbitrate for access to a resource that resides in ROM is beyond me, but there you have it... The mutex is not checked by ROMFONT_ADDRESS, only by this function.
Args: none
Returns: 0 if you got the mutex (unlock it with ROMFONT_UNLOCK when you're done), -1 if it was already taken by someone else
Releases the mutex locked with ROMFONT_LOCK. Only call this function if you actually got the mutex.
Args: none
Returns: no return value
Queries the extent of a single partition in the system flashrom.
Args:
Returns: zero if successful, -1 if no such partition exists
Read data from the system flashrom.
Args:
Returns: number of read bytes if successful, -1 if read failed
Write data to the system flashrom. Important: It is only possible to overwrite 1:s with 0:s, 0:s can not be written back to 1:s. General overwriting is therefore not possible. Only bytes containing all ones ($FF) can be written with arbitrary values.
Args:
Returns: number of written bytes if successful, -1 if write failed
Return a flashrom partition to all ones, so that it may be rewritten. Danger Will Robinson: ALL data in the entire partition will be lost.
Args:
Returns: zero if successful, -1 if delete failed
Initializes all the syscall vectors to their default values.
Args: none
Returns: zero
Sets/clears the handler for one of the eight superfunctions for this vector. Setting a handler is only allowed if it not currently set.
Args:
Returns: zero if successful, -1 if setting/clearing the handler fails
Enqueue a command for the GDROM subsystem to execute.
Args:
Returns: a request id (>=0) if successful, negative error code if failed
Check if an enqueued command has completed.
Args:
Returns:
In order for enqueued commands to get processed, this function must be called a few times. It can be called from a periodic interrupt, or just keep calling it manually until GDROM_CHECK_COMMAND says that your command has stopped processing.
Args: none
Returns: no return value
Initialize the GDROM subsystem. Should be called before any requests are enqueued.
Args: none
Returns: no return value
Checks the general condition of the drive.
Args:
|
|
Returns: zero if successful, nonzero if failure
Tries to abort a previously enqueued command.
Args:
Returns: zero if successful, nonzero if failure
Resets the drive.
Args: none
Returns: no return value
Sets/gets the sector format for read commands.
Args:
|
Returns: zero if successful, -1 if failure