Video Interface: Difference between revisions

Added details on the High Res images on interlacing
m (→‎Video DAC: Spelling update)
(Added details on the High Res images on interlacing)
Line 115:
 
==== 0x0440 0008 - VI_H_WIDTH_REG - R/(W default) ====
This is the width in pixels of the <u>framebuffer</u> if you draw to the framebuffer based on a different width than what is given here the image will drift with each line to the left or right. The common values are 320 and 640, the maximum value is 640. The minimum value depends on the TV set, 160 would probably be a safe minimum but no guarantee. The same value would also be used on drawing commands for clipping or scissors. This can also be used with High Res interlacing modes to change the odd and even lines of the framebuffer to be drawn to screen by doubling the width of this value and changing the VI_DRAM_ADDR_REG to the odd or even field being displayed.
 
==== 0x0440 000C - VI_V_INTR_REG - R/(W default) ====
Line 280:
 
Once this is explained I believe it will be fixed soon, so this is explained as an example of what the difference can be. The libdragon homebrew library doesn't actually support High Resolution Mode, because it doesn't implement this register value change. To be fair this is very easy to overlook, it works fine in every emulator and would at least look OK on a console. The difference is that emulators present the framebuffer memory as a single block of data. While the VI Interface and Video DAC see the 1 framebuffer as even lines top to bottom, then odd lines top to bottom.
 
Learnt from Factor 5 games(Mazamars312):
 
The VI_DRAM_ADDR_REG address is set to the odd or even line of the framebuffer and the VI_H_WIDTH_REG value is doubled to help skip to the next Odd or Even field line for the VI core to process.
 
Once the odd or even field has been displayed the VI_DRAM_ADDR_REG is updated to the other field's address. Also the VI_Y_SCALE_REG.Subpixel is changed between fields with the values 12'h0100 and 12'h0200 to help the scaling and AA calculations (Need to find out which one is Odd and Even based as this could be game based)
 
The real width and height values are calculated by the following calculations
 
'''Width''': C programming(float) ((VI_H_START_REG.END - VI_H_START_REG.START) * (VI_X_SCALE_REG.ScaleUp / 1024))
 
'''Height''': C programming(float) (((VI_H_START_REG.END - VI_H_START_REG.START) >> 1) * (VI_X_SCALE_REG.ScaleUp / 1024))
 
===== Improve visible detail in low resolution =====
Line 302 ⟶ 314:
 
Advanced version of this is to reduce either the height or width and to increase the scaling so it still fits the screen but stretches the image out to fill the screen.
 
[[Category:Motherboard components]]
__FORCETOC__