swt0,VI_V_INTR(a0)// Store Vertical Interrupt To VI Interrupt Register ($A440000C)
llit0,0// T0 = Current Vertical Line (Current Half-Line, Sampled Once Per Line = 0)
swt0,VI_V_CURRENT_LINE(a0)// Store Current Vertical Line To VI Current Register ($A4400010)
lit0,$3E52239// T0 = Video Timing (Start Of Color Burst In Pixels from H-Sync = 3, Vertical Sync Width In Half Lines = 229, Color Burst Width In Pixels = 34, Horizontal Sync Width In Pixels = 57)
swt0,VI_TIMING(a0)// Store Video Timing To VI Burst Register ($A4400014)
llit0,$20D// T0 = Vertical Sync (Number Of Half-Lines Per Field = 525)
swt0,VI_V_SYNC(a0)// Store Vertical Sync To VI V Sync Register ($A4400018)
llit0,$C15// T0 = Horizontal Sync (5-bit Leap Pattern Used For PAL only = 0, Total Duration Of A Line In 1/4 Pixel = 3093)
swt0,VI_H_SYNC(a0)// Store Horizontal Sync To VI H Sync Register ($A440001C)
lit0,$C150C15// T0 = Horizontal Sync Leap (Identical To H Sync = 3093, Identical To H Sync = 3093)
swt0,VI_H_SYNC_LEAP(a0)// Store Horizontal Sync Leap To VI Leap Register ($A4400020)
lit0,$6C02EC// T0 = Horizontal Video (Start Of Active Video In Screen Pixels = 108, End Of Active Video In Screen Pixels = 748)
swt0,VI_H_VIDEO(a0)// Store Horizontal Video To VI H Start Register ($A4400024)
lit0,$2501FF// T0 = Vertical Video (Start Of Active Video In Screen Half-Lines = 37, End Of Active Video In Screen Half-Lines = 511)
swt0,VI_V_VIDEO(a0)// Store Vertical Video To VI V Start Register ($A4400028)
lit0,$E0204// T0 = Vertical Burst (Start Of Color Burst Enable In Half-Lines = 14, End Of Color Burst Enable In Half-Lines = 516)
swt0,VI_V_BURST(a0)// Store Vertical Burst To VI V Burst Register ($A440002C)
llit0,($100*({width}/160))// T0 = X-Scale (Horizontal Subpixel Offset In 2.10 Format = 0, 1/Horizontal Scale Up Factor In 2.10 Format)
swt0,VI_X_SCALE(a0)// Store X-Scale To VI X Scale Register ($A4400030)
llit0,($100*({height}/60))// T0 = Y-Scale (Vertical Subpixel Offset In 2.10 Format = 0, 1/Vertical Scale Up Factor In 2.10 Format)
swt0,VI_Y_SCALE(a0)// Store Y-Scale To VI Y Scale Register ($A4400034)
swt0,VI_V_INTR(a0)// Store Vertical Interrupt To VI Interrupt Register ($A440000C)
llit0,0// T0 = Current Vertical Line (Current Half-Line, Sampled Once Per Line = 0)
swt0,VI_V_CURRENT_LINE(a0)// Store Current Vertical Line To VI Current Register ($A4400010)
lit0,$404233A// T0 = Video Timing (Start Of Color Burst In Pixels from H-Sync = 4, Vertical Sync Width In Half Lines = 04, Color Burst Width In Pixels = 35, Horizontal Sync Width In Pixels = 58)
swt0,VI_TIMING(a0)// Store Video Timing To VI Burst Register ($A4400014)
llit0,$271// T0 = Vertical Sync (Number Of Half-Lines Per Field = 625)
swt0,VI_V_SYNC(a0)// Store Vertical Sync To VI V Sync Register ($A4400018)
lit0,$150C69// T0 = Horizontal Sync (5-bit Leap Pattern Used For PAL only = 21: %10101, Total Duration Of A Line In 1/4 Pixel = 3177)
swt0,VI_H_SYNC(a0)// Store Horizontal Sync To VI H Sync Register ($A440001C)
lit0,$C6F0C6E// T0 = Horizontal Sync Leap (Identical To H Sync = 3183, Identical To H Sync = 3182)
swt0,VI_H_SYNC_LEAP(a0)// Store Horizontal Sync Leap To VI Leap Register ($A4400020)
lit0,$800300// T0 = Horizontal Video (Start Of Active Video In Screen Pixels = 128, End Of Active Video In Screen Pixels = 768)
swt0,VI_H_VIDEO(a0)// Store Horizontal Video To VI H Start Register ($A4400024)
lit0,$5F0239// T0 = Vertical Video (Start Of Active Video In Screen Half-Lines = 95, End Of Active Video In Screen Half-Lines = 569)
swt0,VI_V_VIDEO(a0)// Store Vertical Video To VI V Start Register ($A4400028)
lit0,$9026B// T0 = Vertical Burst (Start Of Color Burst Enable In Half-Lines = 9, End Of Color Burst Enable In Half-Lines = 619)
swt0,VI_V_BURST(a0)// Store Vertical Burst To VI V Burst Register ($A440002C)
llit0,($100*({width}/160))// T0 = X-Scale (Horizontal Subpixel Offset In 2.10 Format = 0, 1/Horizontal Scale Up Factor In 2.10 Format)
swt0,VI_X_SCALE(a0)// Store X-Scale To VI X Scale Register ($A4400030)
llit0,($100*({height}/60))// T0 = Y-Scale (Vertical Subpixel Offset In 2.10 Format = 0, 1/Vertical Scale Up Factor In 2.10 Format)
swt0,VI_Y_SCALE(a0)// Store Y-Scale To VI Y Scale Register ($A4400034)
lit0,{status}// T0 = Status/Control
swt0,VI_STATUS(a0)// Store Status/Control To VI Status Register ($A4400000)
}
macroWaitScanline(scanline){// Wait For RDP To Reach Scanline
luia0,VI_BASE// A0 = VI Base Register ($A4400000)
llit0,{scanline}// T0 = Scan Line
-
lwt1,VI_V_CURRENT_LINE(a0)// T1 = Current Scan Line
bnet1,t0,-// IF (Current Scan Line != Scan Line) Wait