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

Public interface of the libultra operating system, as the game links it. More...

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

Go to the source code of this file.

Classes

struct  OSThread_s
 A thread: its place in the queues, its state, and the registers saved when it last stopped. More...
struct  OSMesgQueue_s
 A message queue: a ring of messages and the threads blocked sending or receiving. More...
struct  OSTimer_s
 A timer that sends a message when it expires, once or periodically. More...
struct  OSPiHandle_s
 A device on the peripheral interface, with the timing of its PI domain. More...
struct  OSPiInfo
 The type and base address of a device on the peripheral interface. More...
struct  OSIoMesgHdr
 The header of an I/O request to a device manager. More...
struct  OSIoMesg
 An I/O request to a device manager: a DMA between RDRAM and a device. More...
struct  OSDevMgr
 A device manager: the thread and queues that serve the I/O requests of one interface. More...
struct  OSViCommonRegs
 The video interface registers a video mode sets for both fields. More...
struct  OSViFieldRegs
 The video interface registers a video mode sets for one field. More...
struct  OSViMode
 A video mode: the registers of the video interface for a resolution and television standard. More...

Macros

#define OS_STATE_STOPPED   1
#define OS_STATE_RUNNABLE   2
#define OS_STATE_RUNNING   4
#define OS_STATE_WAITING   8
#define OS_PRIORITY_MAX   255
#define OS_PRIORITY_VIMGR   254
#define OS_PRIORITY_RMON   250
#define OS_PRIORITY_RMONSPIN   200
#define OS_PRIORITY_PIMGR   150
#define OS_PRIORITY_SIMGR   140
#define OS_PRIORITY_APPMAX   127
#define OS_PRIORITY_IDLE   0
#define OS_MESG_NOBLOCK   0
#define OS_MESG_BLOCK   1
#define OS_EVENT_SW1   0
#define OS_EVENT_SW2   1
#define OS_EVENT_CART   2
#define OS_EVENT_COUNTER   3
#define OS_EVENT_SP   4
#define OS_EVENT_SI   5
#define OS_EVENT_AI   6
#define OS_EVENT_VI   7
#define OS_EVENT_PI   8
#define OS_EVENT_DP   9
#define OS_EVENT_CPU_BREAK   10
#define OS_EVENT_SP_BREAK   11
#define OS_EVENT_FAULT   12
#define OS_EVENT_THREADSTATUS   13
#define OS_EVENT_PRENMI   14
#define MQ_GET_COUNT(mq)
 The number of messages in a queue.
#define MQ_IS_EMPTY(mq)
 Whether a queue has no messages.
#define MQ_IS_FULL(mq)
 Whether a queue has no room for another message.
#define OS_IM_NONE   0x00000001
#define OS_IM_SW1   0x00000501
#define OS_IM_SW2   0x00000601
#define OS_IM_RCP   0x00000401
#define OS_IM_CART   0x00000C01
#define OS_IM_PRENMI   0x00001401
#define OS_IM_RDBWRITE   0x00002401
#define OS_IM_RDBREAD   0x00004401
#define OS_IM_COUNTER   0x00008401
#define OS_IM_CPU   0x0000FF01
#define OS_IM_SP   0x00010401
#define OS_IM_SI   0x00020401
#define OS_IM_AI   0x00040401
#define OS_IM_VI   0x00080401
#define OS_IM_PI   0x00100401
#define OS_IM_DP   0x00200401
#define OS_IM_ALL   0x003FFF01
#define OS_CLOCK_RATE   62500000LL
 The clock rate of the RCP, in hertz.
#define OS_CPU_COUNTER   (OS_CLOCK_RATE * 3 / 4)
 The rate of the CPU counter, in cycles a second.
#define OS_NSEC_TO_CYCLES(n)
 Convert nanoseconds to cycles of the CPU counter.
#define OS_USEC_TO_CYCLES(n)
 Convert microseconds to cycles of the CPU counter.
#define OS_CYCLES_TO_NSEC(c)
 Convert cycles of the CPU counter to nanoseconds.
#define OS_CYCLES_TO_USEC(c)
 Convert cycles of the CPU counter to microseconds.
#define OS_READ   0
#define OS_WRITE   1
#define OS_OTHERS   2
#define OS_MESG_PRI_NORMAL   0
#define OS_MESG_PRI_HIGH   1
#define OS_MESG_TYPE_BASE   10
#define OS_MESG_TYPE_LOOPBACK   (OS_MESG_TYPE_BASE + 0)
#define OS_MESG_TYPE_DMAREAD   (OS_MESG_TYPE_BASE + 1)
#define OS_MESG_TYPE_DMAWRITE   (OS_MESG_TYPE_BASE + 2)
#define OS_MESG_TYPE_VRETRACE   (OS_MESG_TYPE_BASE + 3)
#define OS_MESG_TYPE_COUNTER   (OS_MESG_TYPE_BASE + 4)
#define OS_MESG_TYPE_EDMAREAD   (OS_MESG_TYPE_BASE + 5)
#define OS_MESG_TYPE_EDMAWRITE   (OS_MESG_TYPE_BASE + 6)
#define DEVICE_TYPE_CART   0
#define DEVICE_TYPE_BULK   1
#define DEVICE_TYPE_64DD   2
#define DEVICE_TYPE_SRAM   3
#define DEVICE_TYPE_INIT   7
#define PI_DOMAIN1   0
#define PI_DOMAIN2   1
#define OS_TV_PAL   0
#define OS_TV_NTSC   1
#define OS_TV_MPAL   2
#define VI_NTSC_CLOCK   48681812
#define VI_PAL_CLOCK   49656530
#define VI_MPAL_CLOCK   48628316
#define OS_VI_GAMMA_ON   0x0001
#define OS_VI_GAMMA_OFF   0x0002
#define OS_VI_GAMMA_DITHER_ON   0x0004
#define OS_VI_GAMMA_DITHER_OFF   0x0008
#define OS_VI_DIVOT_ON   0x0010
#define OS_VI_DIVOT_OFF   0x0020
#define OS_VI_DITHER_FILTER_ON   0x0040
#define OS_VI_DITHER_FILTER_OFF   0x0080

Typedefs

typedef s32 OSPri
typedef s32 OSId
typedef struct OSThread_s OSThread
 A thread: its place in the queues, its state, and the registers saved when it last stopped.
typedef u32 OSEvent
typedef u32 OSIntMask
typedef u32 OSPageMask
typedef void * OSMesg
typedef struct OSMesgQueue_s OSMesgQueue
 A message queue: a ring of messages and the threads blocked sending or receiving.
typedef u64 OSTime
typedef struct OSTimer_s OSTimer
 A timer that sends a message when it expires, once or periodically.
typedef struct OSPiHandle_s OSPiHandle
 A device on the peripheral interface, with the timing of its PI domain.

Functions

void osCreateThread (OSThread *t, OSId id, void(*entry)(void *), void *arg, void *sp, OSPri pri)
 Create a stopped thread on the active queue.
void osDestroyThread (OSThread *t)
 Remove a thread from its queue and from the active queue.
void osYieldThread (void)
 Put the running thread at the end of the threads of its priority and dispatch.
void osStartThread (OSThread *t)
 Make a stopped or waiting thread runnable, and yield to it when its priority is higher.
void osSetThreadPri (OSThread *t, OSPri pri)
 Change the priority of a thread, a NULL thread being the running one, and yield when a runnable thread now has a higher priority than the running one.
OSPri osGetThreadPri (OSThread *t)
 Return the priority of a thread, a NULL thread being the running one.
void osCreateMesgQueue (OSMesgQueue *mq, OSMesg *msg, s32 count)
 Initialise an empty message queue over a buffer of count messages.
s32 osSendMesg (OSMesgQueue *mq, OSMesg msg, s32 flag)
 Append a message to a queue and make its first receiver runnable.
s32 osJamMesg (OSMesgQueue *mq, OSMesg msg, s32 flag)
 Insert a message at the front of a queue and make its first receiver runnable.
s32 osRecvMesg (OSMesgQueue *mq, OSMesg *msg, s32 flag)
 Take the first message of a queue, store it unless msg is NULL, and make its first sender runnable.
void osSetEventMesg (OSEvent e, OSMesgQueue *mq, OSMesg m)
 Register the queue and message that event e sends.
OSIntMask osGetIntMask (void)
 Return the CPU and RCP interrupts that may occur.
OSIntMask osSetIntMask (OSIntMask im)
 Set the CPU and RCP interrupts that may occur, within the global mask.
u32 osGetCount (void)
 Read the CPU counter, or advance the emulated counter on Windows.
void osInvalDCache (void *vaddr, s32 nbytes)
 Invalidate the data cache over a range.
void osInvalICache (void *vaddr, s32 nbytes)
 Invalidate the instruction cache over a range.
void osWritebackDCache (void *vaddr, s32 nbytes)
 Write back the data cache over a range.
void osWritebackDCacheAll (void)
 Write back the whole data cache.
u32 osVirtualToPhysical (void *vaddr)
 Translate a virtual address to a physical one.
void osMapTLBRdb (void)
 Map the RDB port of the development hardware.
OSTime osGetTime (void)
 Return the time since the VI manager started, in CPU counter cycles.
int osSetTimer (OSTimer *t, OSTime countdown, OSTime interval, OSMesgQueue *mq, OSMesg msg)
 Start a timer that sends msg to mq after countdown cycles, or after interval cycles when countdown is 0, and again every interval cycles unless interval is 0.
void osCreateViManager (OSPri pri)
 Start the VI manager thread at priority pri.
void osViBlack (u8 active)
 Blank the screen from the next field on, or show it again.
void osViSetMode (OSViMode *modep)
 Select the video mode from the next field on.
void osViSwapBuffer (void *frameBufPtr)
 Show a frame buffer from the next field on.
void * osViGetCurrentFramebuffer (void)
 Return the frame buffer the screen shows.
void osViSetEvent (OSMesgQueue *mq, OSMesg m, u32 retraceCount)
 Send m to mq every retraceCount vertical retraces.
void osViSetSpecialFeatures (u32 func)
 Turn the gamma, gamma dither, divot, and dither filter features on and off, from the OS_VI_* flags.
OSPiHandle * osCartRomInit (void)
 Return the handle of the cartridge ROM, creating it from the timing its first word records.
OSPiHandle * osLeoDiskInit (void)
 Create the handle of the 64DD and select its domain 2 timing.
void osCreatePiManager (OSPri pri, OSMesgQueue *cmdQ, OSMesg *cmdBuf, s32 cmdMsgCnt)
 Start the PI manager thread at priority pri, serving the requests of cmdQ.
OSMesgQueue * osPiGetCmdQueue (void)
 Return the command queue of the PI manager, or NULL when it does not run.
s32 osPiRawReadIo (u32 devAddr, u32 *data)
 Read a word of the cartridge domain at an offset from the ROM base.
s32 osPiRawStartDma (s32 direction, u32 devAddr, void *dramAddr, u32 size)
 Start a DMA between RDRAM and the cartridge domain at an offset from the ROM base.
s32 osPiStartDma (OSIoMesg *mb, s32 priority, s32 direction, u32 devAddr, void *vAddr, u32 nbytes, OSMesgQueue *mq)
 Queue a DMA request with the PI manager.
s32 osEPiRawReadIo (OSPiHandle *pihandle, u32 devAddr, u32 *data)
 Read a word of the device a handle describes.
s32 osEPiRawWriteIo (OSPiHandle *pihandle, u32 devAddr, u32 data)
 Write a word of the device a handle describes.
s32 osEPiRawStartDma (OSPiHandle *pihandle, s32 direction, u32 devAddr, void *dramAddr, u32 size)
 Start a DMA with the device a handle describes, selecting its domain timing when another handle selected different timing.
s32 osAiSetFrequency (u32 frequency)
 Set the sample rate of the audio DAC to the nearest the video clock allows.
s32 osAiSetNextBuffer (void *bufPtr, u32 size)
 Queue a buffer of samples for the audio DMA.
u32 osAiGetStatus (void)
 Return the audio status register.
u32 osAiGetLength (void)
 Return the remaining length of the buffer the audio DMA plays.
void osInitialize (void)
 Initialise the system: the FPU, the PIF, the exception vectors and the clock rates.
void osSyncPrintf (const char *fmt,...)
 Print to the debugger.
void rmonPrintf (const char *fmt,...)
 Print to the remote monitor.

Variables

u32 osTvType
 The television standard reported by IPL3.
u32 osRomType
 The cartridge ROM type reported by IPL3.
u32 osRomBase
 The cartridge ROM base address reported by IPL3.
u32 osResetType
 The reset type reported by IPL3.
u32 osCicId
 The cartridge CIC identifier reported by IPL3.
u32 osVersion
 The operating-system version reported by IPL3.
u32 osMemSize
 The installed memory size reported by IPL3.
u8 osAppNMIBuffer [64]
 The application buffer retained across an NMI reset.
OSViMode osViModePalLan1
 The low-resolution PAL video mode with anti-aliasing.
OSViMode osViModePalHaf1
 The high-resolution PAL video mode with anti-aliasing.
OSViMode osViModeMpalLan1
 The low-resolution MPAL video mode with anti-aliasing.
OSViMode osViModeNtscLan1
 The low-resolution NTSC video mode with anti-aliasing.
u64 osClockRate
 The rate of the CPU counter, OS_CPU_COUNTER until osInitialize() sets it.
s32 osViClock
 The frequency of the video clock.
u8 aiHdwrBugFlag
 Whether the last buffer osAiSetNextBuffer() queued ended 0x2000 bytes into a 16 KiB page, a case the audio DMA mishandles.

Detailed Description

Public interface of the libultra operating system, as the game links it.

The layouts are those of libultra 2.0 before 2.0L. A thread has no profiling pointer, and its context begins at 0x20.

Macro Definition Documentation

◆ OS_STATE_STOPPED

#define OS_STATE_STOPPED   1

The thread is stopped.

◆ OS_STATE_RUNNABLE

#define OS_STATE_RUNNABLE   2

The thread waits to run.

◆ OS_STATE_RUNNING

#define OS_STATE_RUNNING   4

The thread runs.

◆ OS_STATE_WAITING

#define OS_STATE_WAITING   8

The thread waits on a message queue.

◆ OS_PRIORITY_MAX

#define OS_PRIORITY_MAX   255

The highest priority.

◆ OS_PRIORITY_VIMGR

#define OS_PRIORITY_VIMGR   254

The priority of the VI manager.

◆ OS_PRIORITY_RMON

#define OS_PRIORITY_RMON   250

The priority of the remote monitor.

◆ OS_PRIORITY_RMONSPIN

#define OS_PRIORITY_RMONSPIN   200

The priority of the remote monitor while it spins.

◆ OS_PRIORITY_PIMGR

#define OS_PRIORITY_PIMGR   150

The priority of the PI manager.

◆ OS_PRIORITY_SIMGR

#define OS_PRIORITY_SIMGR   140

The priority of the SI manager.

◆ OS_PRIORITY_APPMAX

#define OS_PRIORITY_APPMAX   127

The highest priority of a thread of the game.

◆ OS_PRIORITY_IDLE

#define OS_PRIORITY_IDLE   0

The priority of the idle thread.

◆ OS_MESG_NOBLOCK

#define OS_MESG_NOBLOCK   0

Return at once when the queue is full or empty.

◆ OS_MESG_BLOCK

#define OS_MESG_BLOCK   1

Wait until the queue has room or a message.

◆ OS_EVENT_SW1

#define OS_EVENT_SW1   0

Software interrupt 1.

◆ OS_EVENT_SW2

#define OS_EVENT_SW2   1

Software interrupt 2.

◆ OS_EVENT_CART

#define OS_EVENT_CART   2

The cartridge interrupt.

◆ OS_EVENT_COUNTER

#define OS_EVENT_COUNTER   3

The CPU counter reached the compare register.

◆ OS_EVENT_SP

#define OS_EVENT_SP   4

The RSP finished.

◆ OS_EVENT_SI

#define OS_EVENT_SI   5

The serial interface finished.

◆ OS_EVENT_AI

#define OS_EVENT_AI   6

The audio interface needs a buffer.

◆ OS_EVENT_VI

#define OS_EVENT_VI   7

The video interface reached its interrupt line.

◆ OS_EVENT_PI

#define OS_EVENT_PI   8

The peripheral interface finished.

◆ OS_EVENT_DP

#define OS_EVENT_DP   9

The RDP finished.

◆ OS_EVENT_CPU_BREAK

#define OS_EVENT_CPU_BREAK   10

The CPU hit a breakpoint.

◆ OS_EVENT_SP_BREAK

#define OS_EVENT_SP_BREAK   11

The RSP hit a breakpoint.

◆ OS_EVENT_FAULT

#define OS_EVENT_FAULT   12

A thread faulted.

◆ OS_EVENT_THREADSTATUS

#define OS_EVENT_THREADSTATUS   13

The status of a thread changed.

◆ OS_EVENT_PRENMI

#define OS_EVENT_PRENMI   14

The reset button was pressed.

◆ MQ_GET_COUNT

#define MQ_GET_COUNT ( mq)
Value:
((mq)->validCount)

The number of messages in a queue.

◆ MQ_IS_EMPTY

#define MQ_IS_EMPTY ( mq)
Value:
(MQ_GET_COUNT(mq) == 0)
#define MQ_GET_COUNT(mq)
The number of messages in a queue.
Definition os.h:107

Whether a queue has no messages.

◆ MQ_IS_FULL

#define MQ_IS_FULL ( mq)
Value:
(MQ_GET_COUNT(mq) >= (mq)->msgCount)

Whether a queue has no room for another message.

◆ OS_IM_NONE

#define OS_IM_NONE   0x00000001

No interrupts.

◆ OS_IM_SW1

#define OS_IM_SW1   0x00000501

Software interrupt 1.

◆ OS_IM_SW2

#define OS_IM_SW2   0x00000601

Software interrupt 2.

◆ OS_IM_RCP

#define OS_IM_RCP   0x00000401

The interrupts of the RCP.

◆ OS_IM_CART

#define OS_IM_CART   0x00000C01

The cartridge interrupt.

◆ OS_IM_PRENMI

#define OS_IM_PRENMI   0x00001401

The reset button.

◆ OS_IM_RDBWRITE

#define OS_IM_RDBWRITE   0x00002401

A write of the debugger port.

◆ OS_IM_RDBREAD

#define OS_IM_RDBREAD   0x00004401

A read of the debugger port.

◆ OS_IM_COUNTER

#define OS_IM_COUNTER   0x00008401

The CPU counter.

◆ OS_IM_CPU

#define OS_IM_CPU   0x0000FF01

Every interrupt of the CPU.

◆ OS_IM_SP

#define OS_IM_SP   0x00010401

The RSP.

◆ OS_IM_SI

#define OS_IM_SI   0x00020401

The serial interface.

◆ OS_IM_AI

#define OS_IM_AI   0x00040401

The audio interface.

◆ OS_IM_VI

#define OS_IM_VI   0x00080401

The video interface.

◆ OS_IM_PI

#define OS_IM_PI   0x00100401

The peripheral interface.

◆ OS_IM_DP

#define OS_IM_DP   0x00200401

The RDP.

◆ OS_IM_ALL

#define OS_IM_ALL   0x003FFF01

Every interrupt.

◆ OS_CLOCK_RATE

#define OS_CLOCK_RATE   62500000LL

The clock rate of the RCP, in hertz.

◆ OS_CPU_COUNTER

#define OS_CPU_COUNTER   (OS_CLOCK_RATE * 3 / 4)

The rate of the CPU counter, in cycles a second.

◆ OS_NSEC_TO_CYCLES

#define OS_NSEC_TO_CYCLES ( n)
Value:
(((u64)(n) * (OS_CPU_COUNTER / 15625000LL)) / (1000000000LL / 15625000LL))
#define OS_CPU_COUNTER
The rate of the CPU counter, in cycles a second.
Definition os.h:148
unsigned long long u64
Definition ultratypes.h:21

Convert nanoseconds to cycles of the CPU counter.

◆ OS_USEC_TO_CYCLES

#define OS_USEC_TO_CYCLES ( n)
Value:
(((u64)(n) * (OS_CPU_COUNTER / 15625LL)) / (1000000LL / 15625LL))

Convert microseconds to cycles of the CPU counter.

◆ OS_CYCLES_TO_NSEC

#define OS_CYCLES_TO_NSEC ( c)
Value:
(((u64)(c) * (1000000000LL / 15625000LL)) / (OS_CPU_COUNTER / 15625000LL))

Convert cycles of the CPU counter to nanoseconds.

◆ OS_CYCLES_TO_USEC

#define OS_CYCLES_TO_USEC ( c)
Value:
(((u64)(c) * (1000000LL / 15625LL)) / (OS_CPU_COUNTER / 15625LL))

Convert cycles of the CPU counter to microseconds.

◆ OS_READ

#define OS_READ   0

From the device to memory.

◆ OS_WRITE

#define OS_WRITE   1

From memory to the device.

◆ OS_OTHERS

#define OS_OTHERS   2

Neither, for a request that moves no data.

◆ OS_MESG_PRI_NORMAL

#define OS_MESG_PRI_NORMAL   0

The request joins the end of the queue.

◆ OS_MESG_PRI_HIGH

#define OS_MESG_PRI_HIGH   1

The request jumps to the front of the queue.

◆ OS_MESG_TYPE_BASE

#define OS_MESG_TYPE_BASE   10

The first type.

◆ OS_MESG_TYPE_LOOPBACK

#define OS_MESG_TYPE_LOOPBACK   (OS_MESG_TYPE_BASE + 0)

A request sent back unchanged.

◆ OS_MESG_TYPE_DMAREAD

#define OS_MESG_TYPE_DMAREAD   (OS_MESG_TYPE_BASE + 1)

A DMA from the cartridge.

◆ OS_MESG_TYPE_DMAWRITE

#define OS_MESG_TYPE_DMAWRITE   (OS_MESG_TYPE_BASE + 2)

A DMA to the cartridge.

◆ OS_MESG_TYPE_VRETRACE

#define OS_MESG_TYPE_VRETRACE   (OS_MESG_TYPE_BASE + 3)

A vertical retrace.

◆ OS_MESG_TYPE_COUNTER

#define OS_MESG_TYPE_COUNTER   (OS_MESG_TYPE_BASE + 4)

An expiry of the counter.

◆ OS_MESG_TYPE_EDMAREAD

#define OS_MESG_TYPE_EDMAREAD   (OS_MESG_TYPE_BASE + 5)

A DMA from a device handle.

◆ OS_MESG_TYPE_EDMAWRITE

#define OS_MESG_TYPE_EDMAWRITE   (OS_MESG_TYPE_BASE + 6)

A DMA to a device handle.

◆ DEVICE_TYPE_CART

#define DEVICE_TYPE_CART   0

The cartridge ROM.

◆ DEVICE_TYPE_BULK

#define DEVICE_TYPE_BULK   1

Bulk storage.

◆ DEVICE_TYPE_64DD

#define DEVICE_TYPE_64DD   2

The 64DD.

◆ DEVICE_TYPE_SRAM

#define DEVICE_TYPE_SRAM   3

Battery-backed SRAM.

◆ DEVICE_TYPE_INIT

#define DEVICE_TYPE_INIT   7

A device not yet probed.

◆ PI_DOMAIN1

#define PI_DOMAIN1   0

Domain 1, the cartridge ROM.

◆ PI_DOMAIN2

#define PI_DOMAIN2   1

Domain 2, SRAM and the 64DD.

◆ OS_TV_PAL

#define OS_TV_PAL   0

PAL.

◆ OS_TV_NTSC

#define OS_TV_NTSC   1

NTSC.

◆ OS_TV_MPAL

#define OS_TV_MPAL   2

PAL-M.

◆ VI_NTSC_CLOCK

#define VI_NTSC_CLOCK   48681812

The video clock of NTSC, in hertz.

◆ VI_PAL_CLOCK

#define VI_PAL_CLOCK   49656530

The video clock of PAL, in hertz.

◆ VI_MPAL_CLOCK

#define VI_MPAL_CLOCK   48628316

The video clock of PAL-M, in hertz.

◆ OS_VI_GAMMA_ON

#define OS_VI_GAMMA_ON   0x0001

Turn the gamma correction on.

◆ OS_VI_GAMMA_OFF

#define OS_VI_GAMMA_OFF   0x0002

Turn the gamma correction off.

◆ OS_VI_GAMMA_DITHER_ON

#define OS_VI_GAMMA_DITHER_ON   0x0004

Turn the gamma dither on.

◆ OS_VI_GAMMA_DITHER_OFF

#define OS_VI_GAMMA_DITHER_OFF   0x0008

Turn the gamma dither off.

◆ OS_VI_DIVOT_ON

#define OS_VI_DIVOT_ON   0x0010

Turn the divot removal on.

◆ OS_VI_DIVOT_OFF

#define OS_VI_DIVOT_OFF   0x0020

Turn the divot removal off.

◆ OS_VI_DITHER_FILTER_ON

#define OS_VI_DITHER_FILTER_ON   0x0040

Turn the dither filter on.

◆ OS_VI_DITHER_FILTER_OFF

#define OS_VI_DITHER_FILTER_OFF   0x0080

Turn the dither filter off.

Typedef Documentation

◆ OSPri

typedef s32 OSPri

The priority of a thread, from OS_PRIORITY_IDLE to OS_PRIORITY_MAX.

◆ OSId

typedef s32 OSId

The number that identifies a thread.

◆ OSThread

typedef struct OSThread_s OSThread

A thread: its place in the queues, its state, and the registers saved when it last stopped.

◆ OSEvent

typedef u32 OSEvent

A system event, one of the OS_EVENT_* values.

◆ OSIntMask

typedef u32 OSIntMask

A mask of interrupts, a combination of the OS_IM_* values.

◆ OSPageMask

typedef u32 OSPageMask

A mask of the page size of a TLB entry.

◆ OSMesg

typedef void* OSMesg

A message, a word sent through a message queue.

◆ OSMesgQueue

typedef struct OSMesgQueue_s OSMesgQueue

A message queue: a ring of messages and the threads blocked sending or receiving.

◆ OSTime

typedef u64 OSTime

A time in cycles of the CPU counter.

◆ OSTimer

typedef struct OSTimer_s OSTimer

A timer that sends a message when it expires, once or periodically.

◆ OSPiHandle

typedef struct OSPiHandle_s OSPiHandle

A device on the peripheral interface, with the timing of its PI domain.

Function Documentation

◆ osCreateThread()

void osCreateThread ( OSThread * t,
OSId id,
void(* entry )(void *),
void * arg,
void * sp,
OSPri pri )

Create a stopped thread on the active queue.

It runs entry(arg) on the stack that ends at sp, and destroys itself when entry returns.

Parameters
tThe thread to create.
idThe identifier of the thread, for the debugger.
entryThe routine the thread runs.
argThe argument passed to entry.
spThe end of the stack of the thread, aligned to 8 bytes.
priThe priority, from OS_PRIORITY_IDLE to OS_PRIORITY_MAX.
Ghidra address:
USA: 0x80265670
Ghidra address:
Asia: 0x802651C0
Ghidra address:
EUR: 0x80266e00
Ghidra address:
JPN: 0x80266900

◆ osDestroyThread()

void osDestroyThread ( OSThread * t)

Remove a thread from its queue and from the active queue.

A NULL thread is the running one, and destroying the running thread dispatches the next.

Parameters
tThe thread to destroy, or NULL for the running thread.
Ghidra address:
USA: 0x8026e500
Ghidra address:
Asia: 0x8026E050
Ghidra address:
EUR: 0x802704d0
Ghidra address:
JPN: 0x8026ff80

◆ osYieldThread()

void osYieldThread ( void )

Put the running thread at the end of the threads of its priority and dispatch.

Ghidra address:
USA: 0x8026e820
Ghidra address:
Asia: 0x8026E370
Ghidra address:
EUR: 0x802707f0
Ghidra address:
JPN: 0x802702a0

◆ osStartThread()

void osStartThread ( OSThread * t)

Make a stopped or waiting thread runnable, and yield to it when its priority is higher.

Parameters
tThe thread to start.
Ghidra address:
USA: 0x802657c0
Ghidra address:
Asia: 0x80265310
Ghidra address:
EUR: 0x80266f50
Ghidra address:
JPN: 0x80266a50

◆ osSetThreadPri()

void osSetThreadPri ( OSThread * t,
OSPri pri )

Change the priority of a thread, a NULL thread being the running one, and yield when a runnable thread now has a higher priority than the running one.

Parameters
tThe thread, or NULL for the running thread.
priThe new priority, from OS_PRIORITY_IDLE to OS_PRIORITY_MAX.
Ghidra address:
USA: 0x802668f0
Ghidra address:
Asia: 0x80266440
Ghidra address:
EUR: 0x802680e0
Ghidra address:
JPN: 0x80267b80

◆ osGetThreadPri()

OSPri osGetThreadPri ( OSThread * t)

Return the priority of a thread, a NULL thread being the running one.

Parameters
tThe thread, or NULL for the running thread.
Returns
The priority of the thread.
Ghidra address:
USA: 0x8026c040
Ghidra address:
Asia: 0x8026BB90
Ghidra address:
EUR: 0x8026e010
Ghidra address:
JPN: 0x8026dac0

◆ osCreateMesgQueue()

void osCreateMesgQueue ( OSMesgQueue * mq,
OSMesg * msg,
s32 count )

Initialise an empty message queue over a buffer of count messages.

Parameters
mqThe queue to initialise.
msgThe buffer of the messages.
countThe number of messages the buffer has room for.
Ghidra address:
USA: 0x80265410
Ghidra address:
Asia: 0x80264F60
Ghidra address:
EUR: 0x80266ba0
Ghidra address:
JPN: 0x802666a0

◆ osSendMesg()

s32 osSendMesg ( OSMesgQueue * mq,
OSMesg msg,
s32 flag )

Append a message to a queue and make its first receiver runnable.

Parameters
mqThe queue.
msgThe message.
flagOS_MESG_BLOCK to wait while the queue is full, or OS_MESG_NOBLOCK to return.
Returns
0, or -1 when the queue is full and flag is OS_MESG_NOBLOCK. Windows returns 1 without accessing the queue or message.
Ghidra address:
BRD3D: 0x10042af0
Ghidra address:
BRGlide: 0x100385e0
Ghidra address:
USA: 0x802654b0
Ghidra address:
Asia: 0x80265000
Ghidra address:
EUR: 0x80266c40
Ghidra address:
JPN: 0x80266740

◆ osJamMesg()

s32 osJamMesg ( OSMesgQueue * mq,
OSMesg msg,
s32 flag )

Insert a message at the front of a queue and make its first receiver runnable.

Parameters
mqThe queue.
msgThe message.
flagOS_MESG_BLOCK to wait while the queue is full, or OS_MESG_NOBLOCK to return.
Returns
0, or -1 when the queue is full and flag is OS_MESG_NOBLOCK.
Ghidra address:
USA: 0x8026b5d0
Ghidra address:
Asia: 0x8026B120
Ghidra address:
EUR: 0x8026d5a0
Ghidra address:
JPN: 0x8026d050

◆ osRecvMesg()

s32 osRecvMesg ( OSMesgQueue * mq,
OSMesg * msg,
s32 flag )

Take the first message of a queue, store it unless msg is NULL, and make its first sender runnable.

Parameters
mqThe queue.
msgReceives the message, unless it is NULL.
flagOS_MESG_BLOCK to wait while the queue is empty, or OS_MESG_NOBLOCK to return.
Returns
0, or -1 when the queue is empty and flag is OS_MESG_NOBLOCK. Windows returns 1 without accessing the queue or message.
Ghidra address:
BRD3D: 0x10042af0
Ghidra address:
BRGlide: 0x100385e0
Ghidra address:
USA: 0x802642e0
Ghidra address:
Asia: 0x80263E30
Ghidra address:
EUR: 0x80265a60
Ghidra address:
JPN: 0x80265500

◆ osSetEventMesg()

void osSetEventMesg ( OSEvent e,
OSMesgQueue * mq,
OSMesg m )

Register the queue and message that event e sends.

Parameters
eThe event, such as OS_EVENT_SI or OS_EVENT_PI.
mqThe queue the event sends to.
mThe message the event sends.
Ghidra address:
USA: 0x80265440
Ghidra address:
Asia: 0x80264F90
Ghidra address:
EUR: 0x80266bd0
Ghidra address:
JPN: 0x802666d0

◆ osGetIntMask()

OSIntMask osGetIntMask ( void )

Return the CPU and RCP interrupts that may occur.

The game does not link this routine.

Returns
The interrupt mask.

◆ osSetIntMask()

OSIntMask osSetIntMask ( OSIntMask im)

Set the CPU and RCP interrupts that may occur, within the global mask.

Parameters
imThe new interrupt mask, from the OS_IM_* bits.
Returns
The previous mask.
Ghidra address:
USA: 0x8026e460
Ghidra address:
Asia: 0x8026DFB0
Ghidra address:
EUR: 0x80270430
Ghidra address:
JPN: 0x8026fee0

◆ osGetCount()

u32 osGetCount ( void )

Read the CPU counter, or advance the emulated counter on Windows.

Returns
The counter value.
Ghidra address:
USA: 0x802649f0
Ghidra address:
Asia: 0x80264540
Ghidra address:
EUR: 0x80266250
Ghidra address:
JPN: 0x80265c80
Ghidra address:
BRD3D: 0x10060e90
Ghidra address:
BRGlide: 0x10059f00

◆ osInvalDCache()

void osInvalDCache ( void * vaddr,
s32 nbytes )

Invalidate the data cache over a range.

Parameters
vaddrThe start of the range, a virtual address.
nbytesThe length of the range in bytes. A length of 0 or less does nothing.
Ghidra address:
USA: 0x802662e0
Ghidra address:
Asia: 0x80265E30
Ghidra address:
EUR: 0x80267a70
Ghidra address:
JPN: 0x80267570

◆ osInvalICache()

void osInvalICache ( void * vaddr,
s32 nbytes )

Invalidate the instruction cache over a range.

Parameters
vaddrThe start of the range, a virtual address.
nbytesThe length of the range in bytes. A length of 0 or less does nothing.
Ghidra address:
USA: 0x8026bac0
Ghidra address:
Asia: 0x8026B610
Ghidra address:
EUR: 0x8026da90
Ghidra address:
JPN: 0x8026d540

◆ osWritebackDCache()

void osWritebackDCache ( void * vaddr,
s32 nbytes )

Write back the data cache over a range.

Parameters
vaddrThe start of the range, a virtual address.
nbytesThe length of the range in bytes. A length of 0 or less does nothing.
Ghidra address:
USA: 0x8026b7d0
Ghidra address:
Asia: 0x8026B320
Ghidra address:
EUR: 0x8026d7a0
Ghidra address:
JPN: 0x8026d250

◆ osWritebackDCacheAll()

void osWritebackDCacheAll ( void )

Write back the whole data cache.

Ghidra address:
USA: 0x802649c0
Ghidra address:
Asia: 0x80264510
Ghidra address:
EUR: 0x80266220
Ghidra address:
JPN: 0x80265c50

◆ osVirtualToPhysical()

u32 osVirtualToPhysical ( void * vaddr)

Translate a virtual address to a physical one.

Parameters
vaddrThe virtual address, in KSEG0, KSEG1, or a segment the TLB maps.
Returns
The physical address, or -1 when the TLB does not map the address.
Ghidra address:
USA: 0x8026b750
Ghidra address:
Asia: 0x8026B2A0
Ghidra address:
EUR: 0x8026d720
Ghidra address:
JPN: 0x8026d1d0

◆ osMapTLBRdb()

void osMapTLBRdb ( void )

Map the RDB port of the development hardware.

Ghidra address:
USA: 0x8026bb40
Ghidra address:
Asia: 0x8026B690
Ghidra address:
EUR: 0x8026db10
Ghidra address:
JPN: 0x8026d5c0

◆ osGetTime()

OSTime osGetTime ( void )

Return the time since the VI manager started, in CPU counter cycles.

Returns
The time in CPU counter cycles, OS_CPU_COUNTER of them per second.
Ghidra address:
USA: 0x8026b960
Ghidra address:
Asia: 0x8026B4B0
Ghidra address:
EUR: 0x8026d930
Ghidra address:
JPN: 0x8026d3e0

◆ osSetTimer()

int osSetTimer ( OSTimer * t,
OSTime countdown,
OSTime interval,
OSMesgQueue * mq,
OSMesg msg )

Start a timer that sends msg to mq after countdown cycles, or after interval cycles when countdown is 0, and again every interval cycles unless interval is 0.

Parameters
tThe timer, not reused until it expires for the last time.
countdownThe cycles of the CPU counter until the first message.
intervalThe cycles between later messages, or 0 for a single message.
mqThe queue the timer sends to.
msgThe message the timer sends.
Returns
0.
Ghidra address:
USA: 0x80268390
Ghidra address:
Asia: 0x80267EE0
Ghidra address:
EUR: 0x80269b80
Ghidra address:
JPN: 0x80269630

◆ osCreateViManager()

void osCreateViManager ( OSPri pri)

Start the VI manager thread at priority pri.

The call raises the calling thread to pri while it creates the manager, and does nothing once the manager runs.

Parameters
priThe priority of the manager thread.
Ghidra address:
USA: 0x80266400
Ghidra address:
Asia: 0x80265F50
Ghidra address:
EUR: 0x80267b90
Ghidra address:
JPN: 0x80267690

◆ osViBlack()

void osViBlack ( u8 active)

Blank the screen from the next field on, or show it again.

Parameters
activeTRUE to blank the screen, FALSE to show it.
Ghidra address:
USA: 0x80260ab0
Ghidra address:
Asia: 0x80260600
Ghidra address:
EUR: 0x80265e40
Ghidra address:
JPN: 0x80265870

◆ osViSetMode()

void osViSetMode ( OSViMode * modep)

Select the video mode from the next field on.

Parameters
modepThe mode, such as osViModeNtscLan1.
Ghidra address:
USA: 0x80264a60
Ghidra address:
Asia: 0x802645B0
Ghidra address:
EUR: 0x80265dd0
Ghidra address:
JPN: 0x80265cf0

◆ osViSwapBuffer()

void osViSwapBuffer ( void * frameBufPtr)

Show a frame buffer from the next field on.

Parameters
frameBufPtrThe virtual address of the frame buffer.
Ghidra address:
USA: 0x80264ad0
Ghidra address:
Asia: 0x80264620
Ghidra address:
EUR: 0x80266260
Ghidra address:
JPN: 0x80265d60

◆ osViGetCurrentFramebuffer()

void * osViGetCurrentFramebuffer ( void )

Return the frame buffer the screen shows.

Returns
The frame buffer of the current context.
Ghidra address:
USA: 0x80264b20
Ghidra address:
Asia: 0x80264670
Ghidra address:
EUR: 0x802662b0
Ghidra address:
JPN: 0x80265db0

◆ osViSetEvent()

void osViSetEvent ( OSMesgQueue * mq,
OSMesg m,
u32 retraceCount )

Send m to mq every retraceCount vertical retraces.

Parameters
mqThe queue the VI manager sends to.
mThe message the VI manager sends.
retraceCountThe number of retraces between messages, 1 for every retrace.
Ghidra address:
USA: 0x80265600
Ghidra address:
Asia: 0x80265150
Ghidra address:
EUR: 0x80266d90
Ghidra address:
JPN: 0x80266890

◆ osViSetSpecialFeatures()

void osViSetSpecialFeatures ( u32 func)

Turn the gamma, gamma dither, divot, and dither filter features on and off, from the OS_VI_* flags.

Parameters
funcThe OS_VI_*_ON and OS_VI_*_OFF flags to apply.
Ghidra address:
USA: 0x80264490
Ghidra address:
Asia: 0x80263FE0
Ghidra address:
EUR: 0x80265c10
Ghidra address:
JPN: 0x802656b0

◆ osCartRomInit()

OSPiHandle * osCartRomInit ( void )

Return the handle of the cartridge ROM, creating it from the timing its first word records.

Returns
The handle of the cartridge ROM.
Ghidra address:
USA: 0x8026c3d0
Ghidra address:
Asia: 0x8026BF20
Ghidra address:
EUR: 0x8026e3a0
Ghidra address:
JPN: 0x8026de50

◆ osLeoDiskInit()

OSPiHandle * osLeoDiskInit ( void )

Create the handle of the 64DD and select its domain 2 timing.

Returns
The handle of the 64DD.
Ghidra address:
USA: 0x8026c4c0
Ghidra address:
Asia: 0x8026C010
Ghidra address:
EUR: 0x8026e490
Ghidra address:
JPN: 0x8026df40

◆ osCreatePiManager()

void osCreatePiManager ( OSPri pri,
OSMesgQueue * cmdQ,
OSMesg * cmdBuf,
s32 cmdMsgCnt )

Start the PI manager thread at priority pri, serving the requests of cmdQ.

The call raises the calling thread to pri while it creates the manager, and does nothing once the manager runs.

Parameters
priThe priority of the manager thread.
cmdQThe queue the manager receives requests on, created by the call.
cmdBufThe buffer of the messages of cmdQ.
cmdMsgCntThe number of messages cmdBuf has room for.
Ghidra address:
USA: 0x80266760
Ghidra address:
Asia: 0x802662B0
Ghidra address:
EUR: 0x80267f50
Ghidra address:
JPN: 0x802679f0

◆ osPiGetCmdQueue()

OSMesgQueue * osPiGetCmdQueue ( void )

Return the command queue of the PI manager, or NULL when it does not run.

Returns
The command queue, or NULL.
Ghidra address:
USA: 0x8026b720
Ghidra address:
Asia: 0x8026B270
Ghidra address:
EUR: 0x8026d6f0
Ghidra address:
JPN: 0x8026d1a0

◆ osPiRawReadIo()

s32 osPiRawReadIo ( u32 devAddr,
u32 * data )

Read a word of the cartridge domain at an offset from the ROM base.

Parameters
devAddrThe offset from the ROM base, a multiple of 4.
dataReceives the word.
Returns
0.
Ghidra address:
USA: 0x802663a0
Ghidra address:
Asia: 0x80265EF0
Ghidra address:
EUR: 0x80267b30
Ghidra address:
JPN: 0x80267630

◆ osPiRawStartDma()

s32 osPiRawStartDma ( s32 direction,
u32 devAddr,
void * dramAddr,
u32 size )

Start a DMA between RDRAM and the cartridge domain at an offset from the ROM base.

Parameters
directionOS_READ to read the cartridge, OS_WRITE to write it.
devAddrThe offset from the ROM base, a multiple of 2.
dramAddrThe virtual address of the buffer in RDRAM, aligned to 8 bytes.
sizeThe count of bytes to move.
Returns
0, or -1 for a direction other than OS_READ and OS_WRITE.
Ghidra address:
USA: 0x8026c680
Ghidra address:
Asia: 0x8026C1D0
Ghidra address:
EUR: 0x8026e650
Ghidra address:
JPN: 0x8026e100

◆ osPiStartDma()

s32 osPiStartDma ( OSIoMesg * mb,
s32 priority,
s32 direction,
u32 devAddr,
void * vAddr,
u32 nbytes,
OSMesgQueue * mq )

Queue a DMA request with the PI manager.

A request of priority OS_MESG_PRI_HIGH goes to the front of the queue.

Parameters
mbThe request, not reused until the manager sends it to mq.
priorityOS_MESG_PRI_NORMAL or OS_MESG_PRI_HIGH.
directionOS_READ to read the cartridge, OS_WRITE to write it.
devAddrThe offset from the ROM base, a multiple of 2.
vAddrThe virtual address of the buffer in RDRAM, aligned to 8 bytes.
nbytesThe count of bytes to move.
mqThe queue the manager sends mb to when the transfer ends.
Returns
The result of the send, or -1 when the PI manager does not run.
Ghidra address:
USA: 0x80264650
Ghidra address:
Asia: 0x802641A0
Ghidra address:
EUR: 0x80265eb0
Ghidra address:
JPN: 0x802658e0

◆ osEPiRawReadIo()

s32 osEPiRawReadIo ( OSPiHandle * pihandle,
u32 devAddr,
u32 * data )

Read a word of the device a handle describes.

Parameters
pihandleThe handle of the device.
devAddrThe offset from the base address of the device, a multiple of 4.
dataReceives the word.
Returns
0.
Ghidra address:
USA: 0x8026e780
Ghidra address:
Asia: 0x8026E2D0
Ghidra address:
EUR: 0x80270750
Ghidra address:
JPN: 0x80270200

◆ osEPiRawWriteIo()

s32 osEPiRawWriteIo ( OSPiHandle * pihandle,
u32 devAddr,
u32 data )

Write a word of the device a handle describes.

Parameters
pihandleThe handle of the device.
devAddrThe offset from the base address of the device, a multiple of 4.
dataThe word to write.
Returns
0.
Ghidra address:
USA: 0x8026e730
Ghidra address:
Asia: 0x8026E280
Ghidra address:
EUR: 0x80270700
Ghidra address:
JPN: 0x802701b0

◆ osEPiRawStartDma()

s32 osEPiRawStartDma ( OSPiHandle * pihandle,
s32 direction,
u32 devAddr,
void * dramAddr,
u32 size )

Start a DMA with the device a handle describes, selecting its domain timing when another handle selected different timing.

Parameters
pihandleThe handle of the device.
directionOS_READ to read the device, OS_WRITE to write it.
devAddrThe offset from the base address of the device, a multiple of 2.
dramAddrThe virtual address of the buffer in RDRAM, aligned to 8 bytes.
sizeThe count of bytes to move.
Returns
0, or -1 for a direction other than OS_READ and OS_WRITE.
Ghidra address:
USA: 0x8026c760
Ghidra address:
Asia: 0x8026C2B0
Ghidra address:
EUR: 0x8026e730
Ghidra address:
JPN: 0x8026e1e0

◆ osAiSetFrequency()

s32 osAiSetFrequency ( u32 frequency)

Set the sample rate of the audio DAC to the nearest the video clock allows.

Parameters
frequencyThe requested sample rate in hertz.
Returns
The rate set in hertz, or -1 when the frequency is too high.
Ghidra address:
USA: 0x80268230
Ghidra address:
Asia: 0x80267D80
Ghidra address:
EUR: 0x80269a20
Ghidra address:
JPN: 0x802694d0

◆ osAiSetNextBuffer()

s32 osAiSetNextBuffer ( void * bufPtr,
u32 size )

Queue a buffer of samples for the audio DMA.

Parameters
bufPtrThe virtual address of the samples, aligned to 8 bytes.
sizeThe length of the buffer in bytes, a multiple of 8.
Returns
0, or -1 when the queue of the audio interface is full.
Ghidra address:
USA: 0x80268470
Ghidra address:
Asia: 0x80267FC0
Ghidra address:
EUR: 0x80269c60
Ghidra address:
JPN: 0x80269710

◆ osAiGetStatus()

u32 osAiGetStatus ( void )

Return the audio status register.

Returns
The value of the AI status register.
Ghidra address:
USA: 0x80268520
Ghidra address:
Asia: 0x80268070
Ghidra address:
EUR: 0x80269d10
Ghidra address:
JPN: 0x802697c0

◆ osAiGetLength()

u32 osAiGetLength ( void )

Return the remaining length of the buffer the audio DMA plays.

Returns
The bytes the audio DMA has yet to play.
Ghidra address:
USA: 0x80268530
Ghidra address:
Asia: 0x80268080
Ghidra address:
EUR: 0x80269d20
Ghidra address:
JPN: 0x802697d0

◆ osInitialize()

void osInitialize ( void )

Initialise the system: the FPU, the PIF, the exception vectors and the clock rates.

Ghidra address:
USA: 0x80265d90
Ghidra address:
Asia: 0x802658E0
Ghidra address:
EUR: 0x80267520
Ghidra address:
JPN: 0x80267020

◆ osSyncPrintf()

void osSyncPrintf ( const char * fmt,
... )

Print to the debugger.

The retail library discards the output.

Parameters
fmtThe printf format, followed by its arguments.
Ghidra address:
USA: 0x802607dc
Ghidra address:
Asia: 0x8026032C
Ghidra address:
EUR: 0x80261cdc
Ghidra address:
JPN: 0x80261a3c
Ghidra address:
BRD3D: 0x10008b80
Ghidra address:
BRGlide: 0x10008d60

◆ rmonPrintf()

void rmonPrintf ( const char * fmt,
... )

Print to the remote monitor.

The retail library discards the output.

Parameters
fmtThe printf format, followed by its arguments.
Ghidra address:
USA: 0x802607c0
Ghidra address:
Asia: 0x80260310
Ghidra address:
EUR: 0x80261cc0
Ghidra address:
JPN: 0x80261a20

Variable Documentation

◆ osTvType

u32 osTvType
extern

The television standard reported by IPL3.

◆ osRomType

u32 osRomType
extern

The cartridge ROM type reported by IPL3.

◆ osRomBase

u32 osRomBase
extern

The cartridge ROM base address reported by IPL3.

◆ osResetType

u32 osResetType
extern

The reset type reported by IPL3.

◆ osCicId

u32 osCicId
extern

The cartridge CIC identifier reported by IPL3.

◆ osVersion

u32 osVersion
extern

The operating-system version reported by IPL3.

◆ osMemSize

u32 osMemSize
extern

The installed memory size reported by IPL3.

◆ osAppNMIBuffer

u8 osAppNMIBuffer[64]
extern

The application buffer retained across an NMI reset.

◆ osViModePalLan1

OSViMode osViModePalLan1
extern

The low-resolution PAL video mode with anti-aliasing.

Ghidra address:
USA: 0x802a62f0
Ghidra address:
Asia: 0x802A5E40
Ghidra address:
EUR: 0x802a7bf0
Ghidra address:
JPN: 0x802a7970

◆ osViModePalHaf1

OSViMode osViModePalHaf1
extern

The high-resolution PAL video mode with anti-aliasing.

Ghidra address:
EUR: 0x802a7ba0

◆ osViModeMpalLan1

OSViMode osViModeMpalLan1
extern

The low-resolution MPAL video mode with anti-aliasing.

Ghidra address:
USA: 0x802a6340
Ghidra address:
Asia: 0x802A5E90
Ghidra address:
EUR: 0x802a7c90
Ghidra address:
JPN: 0x802a76e0

◆ osViModeNtscLan1

OSViMode osViModeNtscLan1
extern

The low-resolution NTSC video mode with anti-aliasing.

Ghidra address:
USA: 0x802a6390
Ghidra address:
Asia: 0x802A5EE0
Ghidra address:
EUR: 0x802a7e80
Ghidra address:
JPN: 0x802a7730

◆ osClockRate

u64 osClockRate
extern

The rate of the CPU counter, OS_CPU_COUNTER until osInitialize() sets it.

Ghidra address:
USA: 0x802a6140
Ghidra address:
Asia: 0x802A5C90
Ghidra address:
EUR: 0x802a7c50
Ghidra address:
JPN: 0x802a7790
Ghidra address:
BRD3D: 0x100adfb8
Ghidra address:
BRGlide: 0x100ad7c0

◆ osViClock

s32 osViClock
extern

The frequency of the video clock.

osInitialize() selects it by television standard.

Ghidra address:
USA: 0x802a6148
Ghidra address:
Asia: 0x802A5C98
Ghidra address:
EUR: 0x802a7c58
Ghidra address:
JPN: 0x802a7798

◆ aiHdwrBugFlag

u8 aiHdwrBugFlag
extern

Whether the last buffer osAiSetNextBuffer() queued ended 0x2000 bytes into a 16 KiB page, a case the audio DMA mishandles.

Ghidra address:
USA: 0x802a61b0
Ghidra address:
Asia: 0x802A5D00
Ghidra address:
EUR: 0x802a7d10
Ghidra address:
JPN: 0x802a7800