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

The display, DMA and decompression state of the system file of the N64 releases. More...

#include <PR/gbi.h>
#include <PR/os.h>
#include <PR/os_cont.h>
#include <PR/sptask.h>
#include <PR/ultratypes.h>
#include "common/assetdma.h"
#include "common/cameraprojection.h"
#include "common/debugmessage.h"
#include "common/displaylistops.h"
#include "common/frametime.h"
#include "common/render.h"
#include "common/screen.h"
#include "common/screendraw.h"
Include dependency graph for system.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  InflateAllocator
 The bump allocator zcalloc() draws from. More...

Macros

#define N64_ACTIVE_DEPTH_BUFFER   g_aDepthBuffer
 Use the regular depth buffer when Expansion Pak rendering is unavailable.
#define DISPLAY_LIST_COMMANDS   6000
 The commands of the display list of each frame.
#define DISPLAY_LIST_RESERVED   64
 The commands at the start of the display list of each frame that the frame does not use.

Functions

void InitRenderingSubsystem (void)
 Set up the display, the RSP and RDP state, and the system threads.
void StartLowResFrame (void)
 Start the display list of a frame in the low-resolution mode.
void StartHighResFrame (void)
 Start the display list of a frame in the high-resolution mode.
void FlushDisplayList (void)
 End the display list of the frame and run it.
void ClearDepthBuffer (void)
 Fill the whole depth buffer with the farthest depth, then draw to the frame buffer again.
void UpdateFrameTiming (void)
 Update the timing of the frames from the CPU timer.
void ClearZBufferRect (s32 x, s32 y, s32 width, s32 height)
 Fill a rectangle of the depth buffer with the farthest depth.
void ResetFrameClock (void)
 Restart the clock of the frames from zero.
OSIoMesg * AllocIoMessage (void)
 Take a message of the DMA, waiting for a DMA to finish when every one is in flight.
void WaitForDmaMessages (void)
 Wait for every DMA started to finish.
s32 UnusedVblankQueryStub (s32 unused0, s32 unused1)
 Return 0.
void RspDoneThread (void *arg)
 Forward each finished task of the RSP to g_RspDoneMsgQueue, marking the timing bars.
void RdpDoneThread (void *arg)
 Forward each finished frame of the RDP to g_RdpDoneMsgQueue, marking the timing bars.
void PreNmiResetHandlerThread (void *arg)
 Wait for the reset button, then silence the sound, record the reset, and blank the screen, for each press.
void ViRetraceThread (void *arg)
 Forward each retrace to g_ViRetraceMesgQueue and count it.
void UnusedFrameTimingStub (void)
 Do nothing.
void WaitForVblankMessage (void)
 Wait for the next retrace.
void StubFunction (s32 unused)
 Do nothing; where a debugger would stop.
void FaultThread (void *arg)
 Wait for faults and keep the thread that faulted.
void BootIdleThread (void *arg)
 Read the arguments of a development kit, start the managers, the fault thread and the main thread, and become the idle thread.
void BeginDisplayList (s32 highRes)
 Start the display list of a frame in a resolution, with the render modes every frame starts with.
void StubEmptyVoid (s32 unused0,...)
 Do nothing.

Variables

u16 g_aFramebuffer0 []
 The first of the two frame buffers, of 320 by 240 16-bit pixels.
u16 g_aFramebuffer1 []
 The second 320-by-240 frame buffer of 16-bit pixels.
u16 g_aDepthBuffer []
 The depth buffer, of 16-bit depths, near the start of the memory.
u8 g_aInflateHeapBuffer []
 The room the heap of zlib takes while the game loads, and that the sound effects of a race are loaded into.
u8 * g_pInflateHeapBase
 The heap DecompressFromRom() lends to zlib, or NULL to let inflateInit2_() borrow the frame buffers.
InflateAllocator g_inflateAllocator
 The state of the allocator inflateInit2_() gives zlib.
u32 g_dwScreenUnblankDelay
 The frames to wait before the display returns after inflateInit2_() blanks it to use the frame buffers as a heap.
u32 g_dwKeepScreenBlanked
 Whether the display stays black whatever a frame would show.
u16 g_wScreenFrameCount
 The frames a screen has shown, for screens that count them.
u32 g_dwColorDitherMode
 The color dither the screens draw with, as the other-mode bits gDPSetColorDither() takes.
u32 g_dwAlphaDitherMode
 The alpha dither the screens draw with, as the other-mode bits gDPSetAlphaDither() takes.
u16 * g_apFramebuffers [2]
 The two frame buffers.
s32 g_dwFrameDeltaMs
 The time the last frame took.
s32 g_dwElapsedTimeMs
 The time UpdateFrameTiming() counts, in milliseconds.
s32 g_bRaceScreenActive
 Whether the screen of a race runs, which makes UpdateFrameTiming() step a fixed 1/30 of a second a frame rather than count the timer of the CPU.
OSIoMesg g_aIoMessagePool [32]
 The messages of the DMA, which AllocIoMessage() hands out in turn.
s32 g_dwIoMessagePendingCount
 The DMA started and not yet waited for.
s32 g_dwIoMessagePoolIndex
 The message of g_aIoMessagePool last handed out.
OSMesgQueue g_DmaMessageQueue
 The queue a finished DMA sends to.
OSMesgQueue g_RspDoneMsgQueue
 The queue the RSP event reaches, and the queue the thread forwards it to.
OSMesgQueue g_RdpDoneMsgQueue
 The queue the RDP event reaches, and the queue the thread forwards it to.
OSMesgQueue g_ViRetraceMesgQueue
 The queue of the retrace of ViRetraceThread(), which nothing starts, and the queue each retrace reaches.
Gfx g_aGfxDisplayListPool []
 The value the events send.
DisplayListCommand * g_pDisplayListBase
 The start of the display lists.
f32 g_fCountsPerMillisecond
 The counts of the CPU counter a millisecond.
OSContStatus g_aContStatus [MAXCONTROLLERS]
 What the controllers reported at the start.
u64 g_qwTimestampBase
 The clock of the frames, in counts of the CPU counter.
u32 g_dwFrameTimestamp
 The CPU counter at the last frame.
s32 g_dwPrevElapsedTimeMs
 The time of the frame before, in milliseconds.
OSMesgQueue g_FaultMsgQueue
 The queue of the fault event and the thread that faulted.
s32 g_dwFaultState
 Cleared once by the fault thread.
char * g_apszBootArgv []
 The arguments of a development kit and their count, which starts at 1, and the copies of the argument vector and of the address of the count given to the threads.
char ** g_ppszMainArgv
 The boot argument vector shared with the rendering initialiser.
OSMesgQueue g_PiMgrCmdQueue
 The queue of the commands of the PI manager.
OSViMode g_ViModeNtscLan1
 The video modes of the NTSC and the MPAL consoles.
OSViMode g_ViModeMpalLan1
 The MPAL low-resolution video mode.
OSMesgQueue g_PreNmiMesgQueue
 The queue of the reset button, and its buffer.
s32 g_dwPreNmiResetPending
 Set once the reset button has been pressed.
OSTask g_aGfxTask [2]
 The tasks of the RSP, one for each frame buffer.
u64 g_aRspBootUcode []
 The boot microcode of the RSP.
u64 g_aRspBootUcodeEnd []
 The end of the RSP boot microcode, at the start of the graphics microcode.
u64 g_abRspUcodeData []
 The data of the graphics microcode.
u8 g_abRspDramStackBuffer []
 The memory of the matrix stack of the RSP, 16 bytes more than the stack to align it.
u64 * g_pRdpOutputBuffer [2]
 The start and end of the buffer the RDP commands go to.
s32 g_dwOutputBuffReserve
 The doublewords at the end of the output buffer the tasks do not use.
s32 g_dwDisplayListCommandCount
 The commands of the display list of the last frame.
s32 g_dwPeakShadowCommandCount
 The most commands of a shadow, vertices of a shadow, and commands of a frame seen.
s32 g_dwFirstFlushDone
 Whether a frame has been sent to the RSP.
u32 g_dwFlushDuration
 The counts of the CPU counter the end of a frame took, between the ends of two frames, and at the end of the last frame.
u32 g_dwFlushValueSource
 A word FlushDisplayList() copies each frame, and the copy.
s32 g_dwDisplayModeChangeCountdown
 The frames until the video mode changes to the resolution BeginDisplayList() was given, or 0.
s32 g_dwAppliedScreenScaleShift
 The resolution the video mode was last set to.
OSViMode g_ViModeNtscHaf1
 The video modes of the high resolution.
OSViMode g_ViModeMpalHaf1
 The MPAL high-resolution video mode.
OSViMode g_ViModePalHaf1
 The copies of the PAL video modes the game sets.
OSViMode g_ViModePalLan1
 The PAL low-resolution video mode.
s32 g_dwViGammaEnabled
 Whether the video interface corrects the gamma.

Detailed Description

The display, DMA and decompression state of the system file of the N64 releases.

Macro Definition Documentation

◆ N64_ACTIVE_DEPTH_BUFFER

#define N64_ACTIVE_DEPTH_BUFFER   g_aDepthBuffer

Use the regular depth buffer when Expansion Pak rendering is unavailable.

◆ DISPLAY_LIST_COMMANDS

#define DISPLAY_LIST_COMMANDS   6000

The commands of the display list of each frame.

◆ DISPLAY_LIST_RESERVED

#define DISPLAY_LIST_RESERVED   64

The commands at the start of the display list of each frame that the frame does not use.

Function Documentation

◆ InitRenderingSubsystem()

void InitRenderingSubsystem ( void )

Set up the display, the RSP and RDP state, and the system threads.

Ghidra address:
USA: 0x8021be88
Ghidra address:
Asia: 0x8021B9D8
Ghidra address:
EUR: 0x8021d068
Ghidra address:
JPN: 0x8021c938
Ghidra address:
BRD3D: 0x10034812
Ghidra address:
BRGlide: 0x1002dec3

◆ StartLowResFrame()

void StartLowResFrame ( void )

Start the display list of a frame in the low-resolution mode.

Ghidra address:
USA: 0x80219a1c
Ghidra address:
Asia: 0x8021956C
Ghidra address:
EUR: 0x8021aa3c
Ghidra address:
JPN: 0x8021a394
Ghidra address:
BRD3D: 0x10032873
Ghidra address:
BRGlide: 0x1002bf24

◆ StartHighResFrame()

void StartHighResFrame ( void )

Start the display list of a frame in the high-resolution mode.

Ghidra address:
USA: 0x80219a3c
Ghidra address:
Asia: 0x8021958C
Ghidra address:
EUR: 0x8021aa5c
Ghidra address:
JPN: 0x8021a3b4
Ghidra address:
BRD3D: 0x10032886
Ghidra address:
BRGlide: 0x1002bf37

◆ FlushDisplayList()

void FlushDisplayList ( void )

End the display list of the frame and run it.

Ghidra address:
USA: 0x8021aa08
Ghidra address:
Asia: 0x8021A558
Ghidra address:
EUR: 0x8021bb20
Ghidra address:
JPN: 0x8021b3fc
Ghidra address:
BRD3D: 0x10033838
Ghidra address:
BRGlide: 0x1002cee9

◆ ClearDepthBuffer()

void ClearDepthBuffer ( void )

Fill the whole depth buffer with the farthest depth, then draw to the frame buffer again.

Ghidra address:
USA: 0x80217c94
Ghidra address:
Asia: 0x802177E4
Ghidra address:
EUR: 0x80218cb4
Ghidra address:
JPN: 0x80218604
Ghidra address:
BRD3D: 0x100314de
Ghidra address:
BRGlide: 0x1002ab8f

◆ UpdateFrameTiming()

void UpdateFrameTiming ( void )

Update the timing of the frames from the CPU timer.

Ghidra address:
USA: 0x8021c4b4
Ghidra address:
Asia: 0x8021C004
Ghidra address:
EUR: 0x8021d6a8
Ghidra address:
JPN: 0x8021cf78
Ghidra address:
BRD3D: 0x10034ad5
Ghidra address:
BRGlide: 0x1002e186

◆ ClearZBufferRect()

void ClearZBufferRect ( s32 x,
s32 y,
s32 width,
s32 height )

Fill a rectangle of the depth buffer with the farthest depth.

Parameters
xThe left edge.
yThe upper edge.
widthThe width.
heightThe height, which the bottom edge adds to x rather than y.
Ghidra address:
USA: 0x80217e20
Ghidra address:
Asia: 0x80217970
Ghidra address:
EUR: 0x80218e40
Ghidra address:
JPN: 0x80218790
Ghidra address:
BRD3D: 0x100314e3
Ghidra address:
BRGlide: 0x1002ab94

◆ ResetFrameClock()

void ResetFrameClock ( void )

Restart the clock of the frames from zero.

Ghidra address:
USA: 0x8021c46c
Ghidra address:
Asia: 0x8021BFBC
Ghidra address:
EUR: 0x8021d660
Ghidra address:
JPN: 0x8021cf30
Ghidra address:
BRD3D: 0x10034a8a
Ghidra address:
BRGlide: 0x1002e13b

◆ AllocIoMessage()

OSIoMesg * AllocIoMessage ( void )

Take a message of the DMA, waiting for a DMA to finish when every one is in flight.

Returns
The message.
Ghidra address:
USA: 0x802172d0
Ghidra address:
Asia: 0x80216E20
Ghidra address:
EUR: 0x802182f0
Ghidra address:
JPN: 0x80217c40
Ghidra address:
BRD3D: 0x10031190
Ghidra address:
BRGlide: 0x1002a840

◆ WaitForDmaMessages()

void WaitForDmaMessages ( void )

Wait for every DMA started to finish.

Ghidra address:
USA: 0x8021735c
Ghidra address:
Asia: 0x80216EAC
Ghidra address:
EUR: 0x8021837c
Ghidra address:
JPN: 0x80217ccc
Ghidra address:
BRD3D: 0x100311e4
Ghidra address:
BRGlide: 0x1002a894

◆ UnusedVblankQueryStub()

s32 UnusedVblankQueryStub ( s32 unused0,
s32 unused1 )

Return 0.

The routine has no callers.

Parameters
unused0Not read.
unused1Not read.
Returns
0.
Ghidra address:
USA: 0x802173b8
Ghidra address:
Asia: 0x80216F08
Ghidra address:
EUR: 0x802183d8
Ghidra address:
JPN: 0x80217d28
Ghidra address:
BRD3D: 0x10031212
Ghidra address:
BRGlide: 0x1002a8c2

◆ RspDoneThread()

void RspDoneThread ( void * arg)

Forward each finished task of the RSP to g_RspDoneMsgQueue, marking the timing bars.

Parameters
argNot read.
Ghidra address:
USA: 0x8021bbdc
Ghidra address:
Asia: 0x8021B72C
Ghidra address:
BRD3D: 0x1003467f
Ghidra address:
BRGlide: 0x1002dd30
Ghidra address:
EUR: 0x8021cd18
Ghidra address:
JPN: 0x8021c5e8

◆ RdpDoneThread()

void RdpDoneThread ( void * arg)

Forward each finished frame of the RDP to g_RdpDoneMsgQueue, marking the timing bars.

Parameters
argNot read.
Ghidra address:
USA: 0x8021bca8
Ghidra address:
Asia: 0x8021B7F8
Ghidra address:
BRD3D: 0x100346e9
Ghidra address:
BRGlide: 0x1002dd9a
Ghidra address:
EUR: 0x8021cdc8
Ghidra address:
JPN: 0x8021c698

◆ PreNmiResetHandlerThread()

void PreNmiResetHandlerThread ( void * arg)

Wait for the reset button, then silence the sound, record the reset, and blank the screen, for each press.

Parameters
argNot read.
Ghidra address:
EUR: 0x8021ce88
Ghidra address:
JPN: 0x8021c758

◆ ViRetraceThread()

void ViRetraceThread ( void * arg)

Forward each retrace to g_ViRetraceMesgQueue and count it.

Nothing starts it.

Parameters
argNot read.
Ghidra address:
USA: 0x8021bd68
Ghidra address:
Asia: 0x8021B8B8
Ghidra address:
BRD3D: 0x10034753
Ghidra address:
BRGlide: 0x1002de04
Ghidra address:
EUR: 0x8021cf50
Ghidra address:
JPN: 0x8021c820

◆ UnusedFrameTimingStub()

void UnusedFrameTimingStub ( void )

Do nothing.

Ghidra address:
USA: 0x8021c6a8
Ghidra address:
Asia: 0x8021C1F8
Ghidra address:
EUR: 0x8021d89c
Ghidra address:
JPN: 0x8021d16c

◆ WaitForVblankMessage()

void WaitForVblankMessage ( void )

Wait for the next retrace.

Ghidra address:
USA: 0x8021e1c0
Ghidra address:
Asia: 0x8021DD10
Ghidra address:
EUR: 0x8021f3c0
Ghidra address:
JPN: 0x8021ec90
Ghidra address:
BRD3D: 0x10035b91
Ghidra address:
BRGlide: 0x1002f242

◆ StubFunction()

void StubFunction ( s32 unused)

Do nothing; where a debugger would stop.

Parameters
unusedNot read.
Ghidra address:
USA: 0x8021e1ec
Ghidra address:
Asia: 0x8021DD3C
Ghidra address:
EUR: 0x8021f3ec
Ghidra address:
JPN: 0x8021ecbc

◆ FaultThread()

void FaultThread ( void * arg)

Wait for faults and keep the thread that faulted.

Parameters
argNot read.
Ghidra address:
USA: 0x8021e21c
Ghidra address:
Asia: 0x8021DD6C
Ghidra address:
EUR: 0x8021f41c
Ghidra address:
JPN: 0x8021ecec

◆ BootIdleThread()

void BootIdleThread ( void * arg)

Read the arguments of a development kit, start the managers, the fault thread and the main thread, and become the idle thread.

Parameters
argThe argument of the main thread.
Ghidra address:
USA: 0x8021e2c8
Ghidra address:
Asia: 0x8021DE18
Ghidra address:
EUR: 0x8021f4c8
Ghidra address:
JPN: 0x8021ed98

◆ BeginDisplayList()

void BeginDisplayList ( s32 highRes)

Start the display list of a frame in a resolution, with the render modes every frame starts with.

A change of resolution takes effect at the next FlushDisplayList().

Parameters
highRes1 for the high resolution, 0 for the low.
Ghidra address:
USA: 0x80219470
Ghidra address:
Asia: 0x80218FC0
Ghidra address:
EUR: 0x8021a490
Ghidra address:
JPN: 0x80219de0
Ghidra address:
BRD3D: 0x100322e6
Ghidra address:
BRGlide: 0x1002b997

◆ StubEmptyVoid()

void StubEmptyVoid ( s32 unused0,
... )

Do nothing.

The arguments are variable, as of a print compiled out.

Parameters
unused0Not read.
Ghidra address:
USA: 0x80219a5c
Ghidra address:
Asia: 0x802195AC
Ghidra address:
EUR: 0x8021aa7c
Ghidra address:
JPN: 0x8021a3d4
Ghidra address:
BRD3D: 0x1003289a
Ghidra address:
BRGlide: 0x1002bf4b

Variable Documentation

◆ g_aFramebuffer0

u16 g_aFramebuffer0[]
extern

The first of the two frame buffers, of 320 by 240 16-bit pixels.

The link script places it.

Ghidra address:
USA: 0x801b5000
Ghidra address:
Asia: 0x801B5000
Ghidra address:
EUR: 0x801b5000
Ghidra address:
JPN: 0x801b5000

◆ g_aFramebuffer1

u16 g_aFramebuffer1[]
extern

The second 320-by-240 frame buffer of 16-bit pixels.

The link script places it.

Ghidra address:
USA: 0x801da800
Ghidra address:
Asia: 0x801DA800
Ghidra address:
EUR: 0x801da800
Ghidra address:
JPN: 0x801da800

◆ g_aDepthBuffer

u16 g_aDepthBuffer[]
extern

The depth buffer, of 16-bit depths, near the start of the memory.

The link script places it.

Ghidra address:
USA: 0x80000400
Ghidra address:
Asia: 0x80000400

◆ g_aInflateHeapBuffer

u8 g_aInflateHeapBuffer[]
extern

The room the heap of zlib takes while the game loads, and that the sound effects of a race are loaded into.

Ghidra address:
USA: 0x80324550
Ghidra address:
Asia: 0x80324000
Ghidra address:
EUR: 0x80326a90
Ghidra address:
JPN: 0x803256c0

◆ g_pInflateHeapBase

u8* g_pInflateHeapBase
extern

The heap DecompressFromRom() lends to zlib, or NULL to let inflateInit2_() borrow the frame buffers.

Ghidra address:
USA: 0x80368ac0
Ghidra address:
Asia: 0x80368570
Ghidra address:
EUR: 0x8036afc0
Ghidra address:
JPN: 0x80369c30

◆ g_inflateAllocator

InflateAllocator g_inflateAllocator
extern

The state of the allocator inflateInit2_() gives zlib.

Ghidra address:
USA: 0x80368ac8
Ghidra address:
Asia: 0x80368578
Ghidra address:
EUR: 0x8036afc8
Ghidra address:
JPN: 0x80369c38

◆ g_dwScreenUnblankDelay

u32 g_dwScreenUnblankDelay
extern

The frames to wait before the display returns after inflateInit2_() blanks it to use the frame buffers as a heap.

Ghidra address:
USA: 0x8028a888
Ghidra address:
Asia: 0x8028A3D8
Ghidra address:
EUR: 0x8028ca88
Ghidra address:
JPN: 0x8028c558
Ghidra address:
BRD3D: 0x106c65f8
Ghidra address:
BRGlide: 0x106ed688

◆ g_dwKeepScreenBlanked

u32 g_dwKeepScreenBlanked
extern

Whether the display stays black whatever a frame would show.

Ghidra address:
USA: 0x8028a884
Ghidra address:
Asia: 0x8028A3D4
Ghidra address:
EUR: 0x8028ca84
Ghidra address:
JPN: 0x8028c554
Ghidra address:
BRD3D: 0x106c65f4
Ghidra address:
BRGlide: 0x106ed684

◆ g_wScreenFrameCount

u16 g_wScreenFrameCount
extern

The frames a screen has shown, for screens that count them.

Ghidra address:
USA: 0x8028dbb0
Ghidra address:
Asia: 0x8028D700
Ghidra address:
EUR: 0x80290310
Ghidra address:
JPN: 0x8028fd80

◆ g_dwColorDitherMode

u32 g_dwColorDitherMode
extern

The color dither the screens draw with, as the other-mode bits gDPSetColorDither() takes.

Ghidra address:
USA: 0x8028a8a0
Ghidra address:
Asia: 0x8028A3F0
Ghidra address:
EUR: 0x8028caa4
Ghidra address:
JPN: 0x8028c574
Ghidra address:
BRD3D: 0x106c0688
Ghidra address:
BRGlide: 0x106e7718

◆ g_dwAlphaDitherMode

u32 g_dwAlphaDitherMode
extern

The alpha dither the screens draw with, as the other-mode bits gDPSetAlphaDither() takes.

Ghidra address:
USA: 0x8028a89c
Ghidra address:
Asia: 0x8028A3EC
Ghidra address:
EUR: 0x8028caa0
Ghidra address:
JPN: 0x8028c570
Ghidra address:
BRD3D: 0x106c0920
Ghidra address:
BRGlide: 0x106e79b0

◆ g_apFramebuffers

u16* g_apFramebuffers[2]
extern

The two frame buffers.

Ghidra address:
USA: 0x8031aa28
Ghidra address:
Asia: 0x8031A4D8
Ghidra address:
EUR: 0x8031cf28
Ghidra address:
JPN: 0x8031bb58

◆ g_dwFrameDeltaMs

s32 g_dwFrameDeltaMs
extern

The time the last frame took.

Ghidra address:
USA: 0x8028aadc
Ghidra address:
Asia: 0x8028A62C
Ghidra address:
EUR: 0x8028cce4
Ghidra address:
JPN: 0x8028c7b4
Ghidra address:
BRD3D: 0x10690a30
Ghidra address:
BRGlide: 0x106b7ac0

◆ g_dwElapsedTimeMs

s32 g_dwElapsedTimeMs
extern

The time UpdateFrameTiming() counts, in milliseconds.

Ghidra address:
USA: 0x8028aad4
Ghidra address:
Asia: 0x8028A624
Ghidra address:
EUR: 0x8028ccdc
Ghidra address:
JPN: 0x8028c7ac
Ghidra address:
BRD3D: 0x106c56d8
Ghidra address:
BRGlide: 0x106ec768

◆ g_bRaceScreenActive

s32 g_bRaceScreenActive
extern

Whether the screen of a race runs, which makes UpdateFrameTiming() step a fixed 1/30 of a second a frame rather than count the timer of the CPU.

Ghidra address:
USA: 0x8028ab10
Ghidra address:
Asia: 0x8028A660
Ghidra address:
EUR: 0x8028cd18
Ghidra address:
JPN: 0x8028c7e8
Ghidra address:
BRD3D: 0x106c6648
Ghidra address:
BRGlide: 0x106ed6d8

◆ g_aIoMessagePool

OSIoMesg g_aIoMessagePool[32]
extern

The messages of the DMA, which AllocIoMessage() hands out in turn.

Ghidra address:
USA: 0x8031a020
Ghidra address:
Asia: 0x80319AD0
Ghidra address:
EUR: 0x8031c500
Ghidra address:
JPN: 0x8031b130
Ghidra address:
BRD3D: 0x106c29f0
Ghidra address:
BRGlide: 0x106e9a80

◆ g_dwIoMessagePendingCount

s32 g_dwIoMessagePendingCount
extern

The DMA started and not yet waited for.

Ghidra address:
USA: 0x80272d44
Ghidra address:
Asia: 0x80272894
Ghidra address:
EUR: 0x80274f44
Ghidra address:
JPN: 0x80274a14
Ghidra address:
BRD3D: 0x106c65dc
Ghidra address:
BRGlide: 0x106ed66c

◆ g_dwIoMessagePoolIndex

s32 g_dwIoMessagePoolIndex
extern

The message of g_aIoMessagePool last handed out.

Ghidra address:
USA: 0x80272d40
Ghidra address:
Asia: 0x80272890
Ghidra address:
EUR: 0x80274f40
Ghidra address:
JPN: 0x80274a10
Ghidra address:
BRD3D: 0x106c65d8
Ghidra address:
BRGlide: 0x106ed668

◆ g_DmaMessageQueue

OSMesgQueue g_DmaMessageQueue
extern

The queue a finished DMA sends to.

Ghidra address:
USA: 0x80319f88
Ghidra address:
Asia: 0x80319A38
Ghidra address:
EUR: 0x8031c468
Ghidra address:
JPN: 0x8031b098
Ghidra address:
BRD3D: 0x106c64e0
Ghidra address:
BRGlide: 0x106ed570

◆ g_RspDoneMsgQueue

OSMesgQueue g_RspDoneMsgQueue
extern

The queue the RSP event reaches, and the queue the thread forwards it to.

Ghidra address:
USA: 0x8031a338
Ghidra address:
Asia: 0x80319DE8
Ghidra address:
BRD3D: 0x106c65c0
Ghidra address:
BRGlide: 0x106ed650
Ghidra address:
EUR: 0x8031c818
Ghidra address:
JPN: 0x8031b448 The queue of completed RSP tasks consumed by the frame renderer.
Ghidra address:
USA: 0x8031a320
Ghidra address:
Asia: 0x80319DD0
Ghidra address:
EUR: 0x8031c800
Ghidra address:
JPN: 0x8031b430
Ghidra address:
BRD3D: 0x106c33a0
Ghidra address:
BRGlide: 0x106ea430

◆ g_RdpDoneMsgQueue

OSMesgQueue g_RdpDoneMsgQueue
extern

The queue the RDP event reaches, and the queue the thread forwards it to.

Ghidra address:
USA: 0x8031a370
Ghidra address:
Asia: 0x80319E20
Ghidra address:
BRD3D: 0x106c5ab8
Ghidra address:
BRGlide: 0x106ecb48
Ghidra address:
EUR: 0x8031c850
Ghidra address:
JPN: 0x8031b480 The queue of completed RDP tasks consumed by the frame renderer.
Ghidra address:
USA: 0x8031a358
Ghidra address:
Asia: 0x80319E08
Ghidra address:
EUR: 0x8031c838
Ghidra address:
JPN: 0x8031b468
Ghidra address:
BRD3D: 0x106c3380
Ghidra address:
BRGlide: 0x106ea410

◆ g_ViRetraceMesgQueue

OSMesgQueue g_ViRetraceMesgQueue
extern

The queue of the retrace of ViRetraceThread(), which nothing starts, and the queue each retrace reaches.

Ghidra address:
USA: 0x8031a3b0
Ghidra address:
Asia: 0x80319E60
Ghidra address:
BRD3D: 0x106c5618
Ghidra address:
BRGlide: 0x106ec6a8
Ghidra address:
EUR: 0x8031c8b0
Ghidra address:
JPN: 0x8031b4e0 The queue of video retrace events consumed by frame timing and display updates.
Ghidra address:
USA: 0x8031a390
Ghidra address:
Asia: 0x80319E40
Ghidra address:
BRD3D: 0x106c6540
Ghidra address:
BRGlide: 0x106ed5d0
Ghidra address:
EUR: 0x8031c890
Ghidra address:
JPN: 0x8031b4c0

◆ g_aGfxDisplayListPool

Gfx g_aGfxDisplayListPool[]
extern

The value the events send.

Ghidra address:
USA: 0x8031a3cc
Ghidra address:
Asia: 0x80319E7C
Ghidra address:
BRD3D: 0x106c06a8
Ghidra address:
BRGlide: 0x106e7738
Ghidra address:
EUR: 0x8031c8cc
Ghidra address:
JPN: 0x8031b4fc The retraces ViRetraceThread() forwarded, from 0 to 15.
Ghidra address:
USA: 0x8028adec
Ghidra address:
Asia: 0x8028A93C
Ghidra address:
BRD3D: 0x106c6670
Ghidra address:
BRGlide: 0x106ed700
Ghidra address:
EUR: 0x8028d09c
Ghidra address:
JPN: 0x8028cacc The memory the display lists are built in.
Ghidra address:
USA: 0x80272d68
Ghidra address:
Asia: 0x802728B8
Ghidra address:
EUR: 0x80274f68
Ghidra address:
JPN: 0x80274a38

◆ g_pDisplayListBase

DisplayListCommand* g_pDisplayListBase
extern

The start of the display lists.

Ghidra address:
USA: 0x8028a848
Ghidra address:
Asia: 0x8028A398
Ghidra address:
EUR: 0x8028ca48
Ghidra address:
JPN: 0x8028c518
Ghidra address:
BRD3D: 0x106c0944
Ghidra address:
BRGlide: 0x106e79d4

◆ g_fCountsPerMillisecond

f32 g_fCountsPerMillisecond
extern

The counts of the CPU counter a millisecond.

Ghidra address:
USA: 0x8028a8b0
Ghidra address:
Asia: 0x8028A400
Ghidra address:
EUR: 0x8028cab4
Ghidra address:
JPN: 0x8028c584
Ghidra address:
BRD3D: 0x106c56e0
Ghidra address:
BRGlide: 0x106ec770

◆ g_aContStatus

OSContStatus g_aContStatus[MAXCONTROLLERS]
extern

What the controllers reported at the start.

Ghidra address:
USA: 0x8031a3d0
Ghidra address:
Asia: 0x80319E80
Ghidra address:
EUR: 0x8031c8d0
Ghidra address:
JPN: 0x8031b500
Ghidra address:
BRD3D: 0x106c0928
Ghidra address:
BRGlide: 0x106e79b8

◆ g_qwTimestampBase

u64 g_qwTimestampBase
extern

The clock of the frames, in counts of the CPU counter.

Ghidra address:
USA: 0x8028adf8
Ghidra address:
Asia: 0x8028A948
Ghidra address:
EUR: 0x8028d0a8
Ghidra address:
JPN: 0x8028cad8
Ghidra address:
BRD3D: 0x106c56b0
Ghidra address:
BRGlide: 0x106ec740

◆ g_dwFrameTimestamp

u32 g_dwFrameTimestamp
extern

The CPU counter at the last frame.

Ghidra address:
USA: 0x8028ae00
Ghidra address:
Asia: 0x8028A950
Ghidra address:
EUR: 0x8028d0b0
Ghidra address:
JPN: 0x8028cae0
Ghidra address:
BRD3D: 0x106c0204
Ghidra address:
BRGlide: 0x106e7294

◆ g_dwPrevElapsedTimeMs

s32 g_dwPrevElapsedTimeMs
extern

The time of the frame before, in milliseconds.

Ghidra address:
USA: 0x8028aad0
Ghidra address:
Asia: 0x8028A620
Ghidra address:
EUR: 0x8028ccd8
Ghidra address:
JPN: 0x8028c7a8
Ghidra address:
BRD3D: 0x106c64f8
Ghidra address:
BRGlide: 0x106ed588

◆ g_FaultMsgQueue

OSMesgQueue g_FaultMsgQueue
extern

The queue of the fault event and the thread that faulted.

Ghidra address:
USA: 0x8031b1b0
Ghidra address:
Asia: 0x8031AC60
Ghidra address:
EUR: 0x8031d6b0
Ghidra address:
JPN: 0x8031c2e0

◆ g_dwFaultState

s32 g_dwFaultState
extern

Cleared once by the fault thread.

Ghidra address:
USA: 0x8031b1d0
Ghidra address:
Asia: 0x8031AC80
Ghidra address:
EUR: 0x8031d6d0
Ghidra address:
JPN: 0x8031c300

◆ g_apszBootArgv

char* g_apszBootArgv[]
extern

The arguments of a development kit and their count, which starts at 1, and the copies of the argument vector and of the address of the count given to the threads.

Ghidra address:
USA: 0x80316450
Ghidra address:
Asia: 0x80315F00
Ghidra address:
EUR: 0x80318130
Ghidra address:
JPN: 0x80316d60

◆ g_ppszMainArgv

char** g_ppszMainArgv
extern

The boot argument vector shared with the rendering initialiser.

Ghidra address:
USA: 0x8026ff04
Ghidra address:
Asia: 0x8026FA54
Ghidra address:
EUR: 0x80271ed4
Ghidra address:
JPN: 0x80271984

◆ g_PiMgrCmdQueue

OSMesgQueue g_PiMgrCmdQueue
extern

The queue of the commands of the PI manager.

Ghidra address:
USA: 0x80319ed0
Ghidra address:
Asia: 0x80319980
Ghidra address:
EUR: 0x8031c3b0
Ghidra address:
JPN: 0x8031ade0

◆ g_ViModeNtscLan1

OSViMode g_ViModeNtscLan1
extern

The video modes of the NTSC and the MPAL consoles.

Ghidra address:
USA: 0x802a54b0
Ghidra address:
Asia: 0x802A5000

◆ g_ViModeMpalLan1

OSViMode g_ViModeMpalLan1
extern

The MPAL low-resolution video mode.

Ghidra address:
USA: 0x802a5d70
Ghidra address:
Asia: 0x802A58C0

◆ g_PreNmiMesgQueue

OSMesgQueue g_PreNmiMesgQueue
extern

The queue of the reset button, and its buffer.

Ghidra address:
EUR: 0x8031c870
Ghidra address:
JPN: 0x8031b4a0

◆ g_dwPreNmiResetPending

s32 g_dwPreNmiResetPending
extern

Set once the reset button has been pressed.

Ghidra address:
EUR: 0x8028ca8c
Ghidra address:
JPN: 0x8028c55c

◆ g_aGfxTask

OSTask g_aGfxTask[2]
extern

The tasks of the RSP, one for each frame buffer.

Ghidra address:
USA: 0x8031a9a8
Ghidra address:
Asia: 0x8031A458
Ghidra address:
EUR: 0x8031cea8
Ghidra address:
JPN: 0x8031bad8
Ghidra address:
BRD3D: 0x106c1588
Ghidra address:
BRGlide: 0x106e8618

◆ g_aRspBootUcode

u64 g_aRspBootUcode[]
extern

The boot microcode of the RSP.

The text of the graphics microcode follows it.

Ghidra address:
USA: 0x8026ea00
Ghidra address:
Asia: 0x8026E550
Ghidra address:
EUR: 0x802709d0
Ghidra address:
JPN: 0x80270480

◆ g_aRspBootUcodeEnd

u64 g_aRspBootUcodeEnd[]
extern

The end of the RSP boot microcode, at the start of the graphics microcode.

Ghidra address:
USA: 0x8026ead0
Ghidra address:
Asia: 0x8026E620
Ghidra address:
EUR: 0x80270aa0
Ghidra address:
JPN: 0x80270550

◆ g_abRspUcodeData

u64 g_abRspUcodeData[]
extern

The data of the graphics microcode.

Ghidra address:
USA: 0x802abc00
Ghidra address:
Asia: 0x802AB6C0
Ghidra address:
EUR: 0x802ad8f0
Ghidra address:
JPN: 0x802ac330

◆ g_abRspDramStackBuffer

u8 g_abRspDramStackBuffer[]
extern

The memory of the matrix stack of the RSP, 16 bytes more than the stack to align it.

Ghidra address:
USA: 0x8031a598
Ghidra address:
Asia: 0x8031A048
Ghidra address:
EUR: 0x8031ca98
Ghidra address:
JPN: 0x8031b6c8
Ghidra address:
BRD3D: 0x106c2d00
Ghidra address:
BRGlide: 0x106e9d90

◆ g_pRdpOutputBuffer

u64* g_pRdpOutputBuffer[2]
extern

The start and end of the buffer the RDP commands go to.

Ghidra address:
USA: 0x8028a860
Ghidra address:
Asia: 0x8028A3B0
Ghidra address:
EUR: 0x8028ca60
Ghidra address:
JPN: 0x8028c530
Ghidra address:
BRD3D: 0x100aa728
Ghidra address:
BRGlide: 0x100a9eb8

◆ g_dwOutputBuffReserve

s32 g_dwOutputBuffReserve
extern

The doublewords at the end of the output buffer the tasks do not use.

Ghidra address:
USA: 0x8028ab84
Ghidra address:
Asia: 0x8028A6D4
Ghidra address:
EUR: 0x8028ce30
Ghidra address:
JPN: 0x8028c860
Ghidra address:
BRD3D: 0x106c6668
Ghidra address:
BRGlide: 0x106ed6f8

◆ g_dwDisplayListCommandCount

s32 g_dwDisplayListCommandCount
extern

The commands of the display list of the last frame.

Ghidra address:
USA: 0x8028ab70
Ghidra address:
Asia: 0x8028A6C0
Ghidra address:
EUR: 0x8028ce1c
Ghidra address:
JPN: 0x8028c84c
Ghidra address:
BRD3D: 0x106c1170
Ghidra address:
BRGlide: 0x106e8200

◆ g_dwPeakShadowCommandCount

s32 g_dwPeakShadowCommandCount
extern

The most commands of a shadow, vertices of a shadow, and commands of a frame seen.

Ghidra address:
USA: 0x8028ab74
Ghidra address:
Asia: 0x8028A6C4
Ghidra address:
EUR: 0x8028ce20
Ghidra address:
JPN: 0x8028c850
Ghidra address:
BRD3D: 0x106c6658
Ghidra address:
BRGlide: 0x106ed6e8

◆ g_dwFirstFlushDone

s32 g_dwFirstFlushDone
extern

Whether a frame has been sent to the RSP.

Ghidra address:
USA: 0x8028ab80
Ghidra address:
Asia: 0x8028A6D0
Ghidra address:
EUR: 0x8028ce2c
Ghidra address:
JPN: 0x8028c85c
Ghidra address:
BRD3D: 0x106c6664
Ghidra address:
BRGlide: 0x106ed6f4

◆ g_dwFlushDuration

u32 g_dwFlushDuration
extern

The counts of the CPU counter the end of a frame took, between the ends of two frames, and at the end of the last frame.

Ghidra address:
USA: 0x8028aae8
Ghidra address:
Asia: 0x8028A638
Ghidra address:
EUR: 0x8028ccf0
Ghidra address:
JPN: 0x8028c7c0
Ghidra address:
BRD3D: 0x106c020c
Ghidra address:
BRGlide: 0x106e729c

◆ g_dwFlushValueSource

u32 g_dwFlushValueSource
extern

A word FlushDisplayList() copies each frame, and the copy.

No other routine reads either.

Ghidra address:
USA: 0x8028aa20
Ghidra address:
Asia: 0x8028A570
Ghidra address:
EUR: 0x8028cc28
Ghidra address:
JPN: 0x8028c6f8
Ghidra address:
BRD3D: 0x106c6598
Ghidra address:
BRGlide: 0x106ed628

◆ g_dwDisplayModeChangeCountdown

s32 g_dwDisplayModeChangeCountdown
extern

The frames until the video mode changes to the resolution BeginDisplayList() was given, or 0.

Ghidra address:
USA: 0x8028a84c
Ghidra address:
Asia: 0x8028A39C
Ghidra address:
EUR: 0x8028ca4c
Ghidra address:
JPN: 0x8028c51c
Ghidra address:
BRD3D: 0x106c65e0
Ghidra address:
BRGlide: 0x106ed670

◆ g_dwAppliedScreenScaleShift

s32 g_dwAppliedScreenScaleShift
extern

The resolution the video mode was last set to.

Ghidra address:
USA: 0x8028a854
Ghidra address:
Asia: 0x8028A3A4
Ghidra address:
EUR: 0x8028ca54
Ghidra address:
JPN: 0x8028c524
Ghidra address:
BRD3D: 0x106c65e8
Ghidra address:
BRGlide: 0x106ed678

◆ g_ViModeNtscHaf1

OSViMode g_ViModeNtscHaf1
extern

The video modes of the high resolution.

Ghidra address:
USA: 0x802a5780
Ghidra address:
Asia: 0x802A52D0
Ghidra address:
JPN: 0x802a7690

◆ g_ViModeMpalHaf1

OSViMode g_ViModeMpalHaf1
extern

The MPAL high-resolution video mode.

Ghidra address:
USA: 0x802a6040
Ghidra address:
Asia: 0x802A5B90
Ghidra address:
JPN: 0x802a7640

◆ g_ViModePalHaf1

OSViMode g_ViModePalHaf1
extern

The copies of the PAL video modes the game sets.

Ghidra address:
EUR: 0x8028cd74

◆ g_ViModePalLan1

OSViMode g_ViModePalLan1
extern

The PAL low-resolution video mode.

Ghidra address:
EUR: 0x8028cdc4

◆ g_dwViGammaEnabled

s32 g_dwViGammaEnabled
extern

Whether the video interface corrects the gamma.

Ghidra address:
USA: 0x8028aa4c
Ghidra address:
Asia: 0x8028A59C
Ghidra address:
EUR: 0x8028cc54
Ghidra address:
JPN: 0x8028c724
Ghidra address:
BRD3D: 0x106c6604
Ghidra address:
BRGlide: 0x106ed694