Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
vi.c File Reference

Classes

struct  VITiming
 
struct  SomeVIStruct
 

Functions

static u32 getCurrentFieldEvenOdd (void)
 
VITiming__VISetExtraTiming (VITiming *t)
 
void __VIEnableRawPositionInterrupt (s16 x, s16 y, void(*callback)(s16, s16))
 
void __VIDisplayPositionToXY (u32 hct, u32 vct, s16 *x, s16 *y)
 
void __VISetLatchMode (u32 mode)
 
int __VIGetLatch0Position (s16 *px, s16 *py)
 
int __VIGetLatch1Position (s16 *px, s16 *py)
 
int __VIGetLatchPosition (u32 port, s16 *px, s16 *py)
 
static u32 getEncoderType (void)
 
static s32 cntlzd (u64 bit)
 
static int VISetRegs (void)
 
static void __VIRetraceHandler (__OSInterrupt unused, OSContext *context)
 
VIRetraceCallback VISetPreRetraceCallback (VIRetraceCallback cb)
 
VIRetraceCallback VISetPostRetraceCallback (VIRetraceCallback cb)
 
static VITiminggetTiming (VITVMode mode)
 
void __VIInit (VITVMode mode)
 
static void AdjustPosition (u16 acv)
 
static void ImportAdjustingValues (void)
 
void VIInit (void)
 
void VIWaitForRetrace (void)
 
static void setInterruptRegs (VITiming *tm)
 
static void setPicConfig (u16 fbSizeX, VIXFBMode xfbMode, u16 panPosX, u16 panSizeX, u8 *wordPerLine, u8 *std, u8 *wpl, u8 *xof)
 
static void setBBIntervalRegs (VITiming *tm)
 
static void setScalingRegs (u16 panSizeX, u16 dispSizeX, BOOL threeD)
 
static void calcFbbs (u32 bufAddr, u16 panPosX, u16 panPosY, u8 wordPerLine, VIXFBMode xfbMode, u16 dispPosY, u32 *tfbb, u32 *bfbb)
 
static void setFbbRegs (SomeVIStruct *HorVer, u32 *tfbb, u32 *bfbb, u32 *rtfbb, u32 *rbfbb)
 
static void setHorizontalRegs (VITiming *tm, u16 dispPosX, u16 dispSizeX)
 
static void setVerticalRegs (u16 dispPosY, u16 dispSizeY, u8 equ, u16 acv, u16 prbOdd, u16 prbEven, u16 psbOdd, u16 psbEven, BOOL black)
 
static void PrintDebugPalCaution (void)
 
void VIConfigure (const GXRenderModeObj *rm)
 
void VIConfigurePan (u16 xOrg, u16 yOrg, u16 width, u16 height)
 
void VIFlush (void)
 
void VISetNextFrameBuffer (void *fb)
 
void * VIGetNextFrameBuffer (void)
 
void * VIGetCurrentFrameBuffer (void)
 
void VISetNextRightFrameBuffer (void *fb)
 
void VISetBlack (BOOL black)
 
void VISet3D (BOOL threeD)
 
u32 VIGetRetraceCount (void)
 
static void GetCurrentDisplayPosition (u32 *hct, u32 *vct)
 
static u32 getCurrentHalfLine (void)
 
u32 VIGetNextField (void)
 
u32 VIGetCurrentLine (void)
 
u32 VIGetTvFormat (void)
 
u32 VIGetScanMode (void)
 
u32 VIGetDTVStatus (void)
 
void __VISetAdjustingValues (s16 x, s16 y)
 
void __VIGetAdjustingValues (s16 *x, s16 *y)
 
void __VIGetCurrentPosition (s16 *x, s16 *y)
 

Variables

const char * __VIVersion = "<< Dolphin SDK - VI\tdebug build: Apr 7 2004 03:55:59 (0x2301) >>"
 
static BOOL IsInitialized
 
static volatile u32 retraceCount
 
static volatile u32 flushFlag
 
static OSThreadQueue retraceQueue
 
static void(* PreCB )(u32)
 
static void(* PostCB )(u32)
 
static void(* PositionCallback )(s16, s16)
 
static u32 encoderType
 
static s16 displayOffsetH
 
static s16 displayOffsetV
 
static volatile u32 changeMode
 
static volatile u64 changed
 
static volatile u32 shdwChangeMode
 
static volatile u16 regs [59]
 
static volatile u64 shdwChanged
 
static VITimingCurrTiming
 
static u32 CurrTvMode
 
static u32 NextBufAddr
 
static u32 CurrBufAddr
 
static volatile u16 shdwRegs [59]
 
static VITiming timing [10]
 
static u16 taps [25]
 
static SomeVIStruct HorVer
 
static u32 FBSet
 
static VITimingtimingExtra
 
void(*)(s16, s16__VIDisableRawPositionInterrupt ()
 

Function Documentation

◆ __VIDisplayPositionToXY()

void __VIDisplayPositionToXY ( u32 hct,
u32 vct,
s16 * x,
s16 * y )

◆ __VIEnableRawPositionInterrupt()

void __VIEnableRawPositionInterrupt ( s16 x,
s16 y,
void(* callback )(s16, s16) )

◆ __VIGetAdjustingValues()

void __VIGetAdjustingValues ( s16 * x,
s16 * y )

◆ __VIGetCurrentPosition()

void __VIGetCurrentPosition ( s16 * x,
s16 * y )

◆ __VIGetLatch0Position()

int __VIGetLatch0Position ( s16 * px,
s16 * py )

◆ __VIGetLatch1Position()

int __VIGetLatch1Position ( s16 * px,
s16 * py )

◆ __VIGetLatchPosition()

int __VIGetLatchPosition ( u32 port,
s16 * px,
s16 * py )

◆ __VIInit()

void __VIInit ( VITVMode mode)

◆ __VIRetraceHandler()

static void __VIRetraceHandler ( __OSInterrupt unused,
OSContext * context )
static

◆ __VISetAdjustingValues()

void __VISetAdjustingValues ( s16 x,
s16 y )

◆ __VISetExtraTiming()

VITiming * __VISetExtraTiming ( VITiming * t)

◆ __VISetLatchMode()

void __VISetLatchMode ( u32 mode)

◆ AdjustPosition()

static void AdjustPosition ( u16 acv)
static

◆ calcFbbs()

static void calcFbbs ( u32 bufAddr,
u16 panPosX,
u16 panPosY,
u8 wordPerLine,
VIXFBMode xfbMode,
u16 dispPosY,
u32 * tfbb,
u32 * bfbb )
static

◆ cntlzd()

static s32 cntlzd ( u64 bit)
static

◆ GetCurrentDisplayPosition()

static void GetCurrentDisplayPosition ( u32 * hct,
u32 * vct )
static

◆ getCurrentFieldEvenOdd()

static u32 getCurrentFieldEvenOdd ( void )
static

◆ getCurrentHalfLine()

static u32 getCurrentHalfLine ( void )
static

◆ getEncoderType()

static u32 getEncoderType ( void )
static

◆ getTiming()

static VITiming * getTiming ( VITVMode mode)
static

◆ ImportAdjustingValues()

static void ImportAdjustingValues ( void )
static

◆ PrintDebugPalCaution()

static void PrintDebugPalCaution ( void )
static

◆ setBBIntervalRegs()

static void setBBIntervalRegs ( VITiming * tm)
static

◆ setFbbRegs()

static void setFbbRegs ( SomeVIStruct * HorVer,
u32 * tfbb,
u32 * bfbb,
u32 * rtfbb,
u32 * rbfbb )
static

◆ setHorizontalRegs()

static void setHorizontalRegs ( VITiming * tm,
u16 dispPosX,
u16 dispSizeX )
static

◆ setInterruptRegs()

static void setInterruptRegs ( VITiming * tm)
static

◆ setPicConfig()

static void setPicConfig ( u16 fbSizeX,
VIXFBMode xfbMode,
u16 panPosX,
u16 panSizeX,
u8 * wordPerLine,
u8 * std,
u8 * wpl,
u8 * xof )
static

◆ setScalingRegs()

static void setScalingRegs ( u16 panSizeX,
u16 dispSizeX,
BOOL threeD )
static

◆ setVerticalRegs()

static void setVerticalRegs ( u16 dispPosY,
u16 dispSizeY,
u8 equ,
u16 acv,
u16 prbOdd,
u16 prbEven,
u16 psbOdd,
u16 psbEven,
BOOL black )
static

◆ VIConfigure()

void VIConfigure ( const GXRenderModeObj * rm)

◆ VIConfigurePan()

void VIConfigurePan ( u16 xOrg,
u16 yOrg,
u16 width,
u16 height )

◆ VIFlush()

void VIFlush ( void )

◆ VIGetCurrentFrameBuffer()

void * VIGetCurrentFrameBuffer ( void )

◆ VIGetCurrentLine()

u32 VIGetCurrentLine ( void )

◆ VIGetDTVStatus()

u32 VIGetDTVStatus ( void )

◆ VIGetNextField()

u32 VIGetNextField ( void )

◆ VIGetNextFrameBuffer()

void * VIGetNextFrameBuffer ( void )

◆ VIGetRetraceCount()

u32 VIGetRetraceCount ( void )

◆ VIGetScanMode()

u32 VIGetScanMode ( void )

◆ VIGetTvFormat()

u32 VIGetTvFormat ( void )

◆ VIInit()

void VIInit ( void )

◆ VISet3D()

void VISet3D ( BOOL threeD)

◆ VISetBlack()

void VISetBlack ( BOOL black)

◆ VISetNextFrameBuffer()

void VISetNextFrameBuffer ( void * fb)

◆ VISetNextRightFrameBuffer()

void VISetNextRightFrameBuffer ( void * fb)

◆ VISetPostRetraceCallback()

VIRetraceCallback VISetPostRetraceCallback ( VIRetraceCallback cb)

◆ VISetPreRetraceCallback()

VIRetraceCallback VISetPreRetraceCallback ( VIRetraceCallback cb)

◆ VISetRegs()

static int VISetRegs ( void )
static

◆ VIWaitForRetrace()

void VIWaitForRetrace ( void )

Variable Documentation

◆ __VIDisableRawPositionInterrupt

void(*)(s16, s16) __VIDisableRawPositionInterrupt() ( )

◆ __VIVersion

const char * __VIVersion = "<< Dolphin SDK - VI\tdebug build: Apr 7 2004 03:55:59 (0x2301) >>"

◆ changed

volatile u64 changed
static

◆ changeMode

volatile u32 changeMode
static

◆ CurrBufAddr

u32 CurrBufAddr
static

◆ CurrTiming

VITiming* CurrTiming
static

◆ CurrTvMode

u32 CurrTvMode
static

◆ displayOffsetH

s16 displayOffsetH
static

◆ displayOffsetV

s16 displayOffsetV
static

◆ encoderType

u32 encoderType
static

◆ FBSet

u32 FBSet
static

◆ flushFlag

volatile u32 flushFlag
static

◆ HorVer

SomeVIStruct HorVer
static

◆ IsInitialized

BOOL IsInitialized
static

◆ NextBufAddr

u32 NextBufAddr
static

◆ PositionCallback

void(* PositionCallback) (s16, s16) ( s16 ,
s16  )
static

◆ PostCB

void(* PostCB) (u32) ( u32 )
static

◆ PreCB

void(* PreCB) (u32) ( u32 )
static

◆ regs

volatile u16 regs[59]
static

◆ retraceCount

volatile u32 retraceCount
static

◆ retraceQueue

OSThreadQueue retraceQueue
static

◆ shdwChanged

volatile u64 shdwChanged
static

◆ shdwChangeMode

volatile u32 shdwChangeMode
static

◆ shdwRegs

volatile u16 shdwRegs[59]
static

◆ taps

u16 taps[25]
static
Initial value:
= {
0x01F0, 0x01DC,
0x01AE, 0x0174,
0x0129, 0x00DB,
0x008E, 0x0046,
0x000C, 0x00E2,
0x00CB, 0x00C0,
0x00C4, 0x00CF,
0x00DE, 0x00EC,
0x00FC, 0x0008,
0x000F, 0x0013,
0x0013, 0x000F,
0x000C, 0x0008,
0x0001
}

◆ timing

VITiming timing[10]
static
Initial value:
= {
{ 6, 240, 24, 25, 3, 2, 12, 13, 12, 13, 520, 519, 520, 519, 525, 429, 64, 71, 105, 162, 373, 122, 412 },
{ 6, 240, 24, 24, 4, 4, 12, 12, 12, 12, 520, 520, 520, 520, 526, 429, 64, 71, 105, 162, 373, 122, 412 },
{ 5, 287, 35, 36, 1, 0, 13, 12, 11, 10, 619, 618, 617, 620, 625, 432, 64, 75, 106, 172, 380, 133, 420 },
{ 5, 287, 33, 33, 2, 2, 13, 11, 13, 11, 619, 621, 619, 621, 624, 432, 64, 75, 106, 172, 380, 133, 420 },
{ 6, 240, 24, 25, 3, 2, 16, 15, 14, 13, 518, 517, 516, 519, 525, 429, 64, 78, 112, 162, 373, 122, 412 },
{ 6, 240, 24, 24, 4, 4, 16, 14, 16, 14, 518, 520, 518, 520, 526, 429, 64, 78, 112, 162, 373, 122, 412 },
{ 12, 480, 48, 48, 6, 6, 24, 24, 24, 24, 1038, 1038, 1038, 1038, 1050, 429, 64, 71, 105, 162, 373, 122, 412 },
{ 12, 480, 44, 44, 10, 10, 24, 24, 24, 24, 1038, 1038, 1038, 1038, 1050, 429, 64, 71, 105, 168, 379, 122, 412 },
{ 6, 241, 24, 25, 1, 0, 12, 13, 12, 13, 520, 519, 520, 519, 525, 429, 64, 71, 105, 159, 370, 122, 412 },
{ 12, 480, 48, 48, 6, 6, 24, 24, 24, 24, 1038, 1038, 1038, 1038, 1050, 429, 64, 71, 105, 180, 391, 122, 412 }
}

◆ timingExtra

VITiming* timingExtra
static