SSBM Decomp
Loading...
Searching...
No Matches
vi.c File Reference
#include <macros.h>
#include "__gx.h"
#include "__os.h"
#include "__vi.h"
#include <dolphin/gx.h>
#include <dolphin/hw_regs.h>
#include <dolphin/os.h>
#include <dolphin/pad.h>
#include <dolphin/vi.h>

Data Structures

struct  VITiming
struct  SomeVIStruct

Macros

#define MARK_CHANGED(index)
#define MAX(a, b)
#define MIN(a, b)
#define CLAMP(val, min, max)

Functions

static u32 getCurrentFieldEvenOdd (void)
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, int black)
void VIConfigure (GXRenderModeObj *rm)
void VIConfigurePan (u16 xOrg, u16 yOrg, u16 width, u16 height)
void VIFlush (void)
void VISetNextFrameBuffer (void *fb)
void VISetNextRightFrameBuffer (void *fb)
void VISetBlack (BOOL black)
void VISet3D (BOOL threeD)
u32 VIGetRetraceCount (void)
static u32 getCurrentHalfLine (void)
u32 VIGetNextField (void)
u32 VIGetCurrentLine (void)
u32 VIGetTvFormat (void)
void __VISetAdjustingValues (s16 x, s16 y)
void __VIGetAdjustingValues (s16 *x, s16 *y)
u32 VIGetDTVStatus (void)

Variables

static volatile u32 retraceCount
static volatile u32 flushFlag
static struct OSThreadQueue retraceQueue
static void(* PreCB )(u32)
static void(* PostCB )(u32)
static u32 encoderType
static s16 displayOffsetH
static s16 displayOffsetV
static volatile u32 shdwChangeMode
static volatile u64 changed
static volatile u32 changeMode
static u16 regs [59]
static volatile u64 shdwChanged
static u16 shdwRegs [59]
static VITiming timing [8]
static u16 taps [25]
static SomeVIStruct HorVer
static VITimingCurrTiming
static s32 CurrTvMode
static u32 FBSet

Macro Definition Documentation

◆ MARK_CHANGED

#define MARK_CHANGED ( index)
Value:
(changed |= 1LL << (63 - (index)))
static u8 index[20][3]
Definition GXDraw.c:424
static volatile u64 changed
Definition vi.c:81

◆ MAX

#define MAX ( a,
b )
Value:
((a) > (b) ? (a) : (b))
GXColorS10 a
Definition tev.c:9

◆ MIN

#define MIN ( a,
b )
Value:
((a) < (b) ? (a) : (b))

◆ CLAMP

#define CLAMP ( val,
min,
max )
Value:
((val) > (max) ? (max) : (val) < (min) ? (min) : (val))

Function Documentation

◆ getCurrentFieldEvenOdd()

u32 getCurrentFieldEvenOdd ( void )
static

◆ getEncoderType()

u32 getEncoderType ( void )
static

◆ cntlzd()

s32 cntlzd ( u64 bit)
static

◆ VISetRegs()

int VISetRegs ( void )
static

◆ __VIRetraceHandler()

void __VIRetraceHandler ( __OSInterrupt unused,
OSContext * context )
static

◆ VISetPreRetraceCallback()

VIRetraceCallback VISetPreRetraceCallback ( VIRetraceCallback cb)

◆ VISetPostRetraceCallback()

VIRetraceCallback VISetPostRetraceCallback ( VIRetraceCallback cb)

◆ getTiming()

VITiming * getTiming ( VITVMode mode)
static

◆ __VIInit()

void __VIInit ( VITVMode mode)

◆ AdjustPosition()

void AdjustPosition ( u16 acv)
static

◆ ImportAdjustingValues()

void ImportAdjustingValues ( void )
static

◆ VIInit()

void VIInit ( void )

◆ VIWaitForRetrace()

void VIWaitForRetrace ( void )

◆ setInterruptRegs()

void setInterruptRegs ( VITiming * tm)
static

◆ setPicConfig()

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

◆ setBBIntervalRegs()

void setBBIntervalRegs ( VITiming * tm)
static

◆ setScalingRegs()

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

◆ calcFbbs()

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

◆ setFbbRegs()

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

◆ setHorizontalRegs()

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

◆ setVerticalRegs()

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

◆ VIConfigure()

void VIConfigure ( GXRenderModeObj * rm)

◆ VIConfigurePan()

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

◆ VIFlush()

void VIFlush ( void )

◆ VISetNextFrameBuffer()

void VISetNextFrameBuffer ( void * fb)

◆ VISetNextRightFrameBuffer()

void VISetNextRightFrameBuffer ( void * fb)

◆ VISetBlack()

void VISetBlack ( BOOL black)

◆ VISet3D()

void VISet3D ( BOOL threeD)

◆ VIGetRetraceCount()

u32 VIGetRetraceCount ( void )

◆ getCurrentHalfLine()

u32 getCurrentHalfLine ( void )
static

◆ VIGetNextField()

u32 VIGetNextField ( void )

◆ VIGetCurrentLine()

u32 VIGetCurrentLine ( void )

◆ VIGetTvFormat()

u32 VIGetTvFormat ( void )

◆ __VISetAdjustingValues()

void __VISetAdjustingValues ( s16 x,
s16 y )

◆ __VIGetAdjustingValues()

void __VIGetAdjustingValues ( s16 * x,
s16 * y )

◆ VIGetDTVStatus()

u32 VIGetDTVStatus ( void )

Variable Documentation

◆ retraceCount

volatile u32 retraceCount
static

◆ flushFlag

volatile u32 flushFlag
static

◆ retraceQueue

struct OSThreadQueue retraceQueue
static

◆ PreCB

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

◆ PostCB

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

◆ encoderType

u32 encoderType
static

◆ displayOffsetH

s16 displayOffsetH
static

◆ displayOffsetV

s16 displayOffsetV
static

◆ shdwChangeMode

volatile u32 shdwChangeMode
static

◆ changed

volatile u64 changed
static

◆ changeMode

volatile u32 changeMode
static

◆ regs

u16 regs[59]
static

◆ shdwChanged

volatile u64 shdwChanged
static

◆ shdwRegs

u16 shdwRegs[59]
static

◆ timing

VITiming timing[8]
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, 35, 35, 2, 2, 13, 11, 13, 11, 619, 621,
619, 621, 626, 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 },
}

◆ 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 }

◆ HorVer

SomeVIStruct HorVer
static

◆ CurrTiming

VITiming* CurrTiming
static

◆ CurrTvMode

s32 CurrTvMode
static

◆ FBSet

u32 FBSet
static