Dave2001 said:
Anyway, I have a question to ask...
Can anyone give me a better description of the VI_X_SCALE and VI_Y_SCALE registers? I have one description:
VI x-scale
(RW): [11:0] 1/horizontal scale up factor (2.10 format)
[27:16] horizontal subpixel offset (2.10 format)
VI y-scale
(RW): [11:0] 1/vertical scale up factor (2.10 format)
[27:16] vertical subpixel offset (2.10 format)
However, this is very odd, since I typically get VI_X_SCALE = 0x200 and VI_Y_SCALE = 0x400.
That would make x_scale: 1/.5=2, right?
and y_scale: 1/1=1
is it really trying to scale 2x in the x-axis and 1x in the y-axis?
I had most of the resolution problems fixed when I used 0x200/VI_X_SCALE and 0x400/VI_Y_SCALE but there were still a small number more which it didn't handle.
and how about this one?
y stretched:
ViStatusChanged () - VI_X_SCALE_REG: 00000200,
VI_Y_SCALE_REG: 00000800
1 / 0.5 = 2
1 / 2 = 0.5
2x0.5? it's larger in the y, not the x...
I know you will hate me for doing this.. but how about some algebra?
the first 12 bits are the X/Y scale in both factors 1/X2.X10 1/Y2.Y10
That's what the comment says at least.
so XSF (X scale factor)
0x200 or
0010 0000 0000
or
1/2 (binary fraction remember?)
so YSF (Y Scale factor)
0x400 or
0100 0000 0000
or
1 (binary scale factor)
This tells me that it is using double the resolution but at half the pixel scale horizontally. It's not actually scaling up horizontally at all. Important to note that.
the aspect ratio is still 2/1 though you are right
But what's happening is if your resolution is say
320x240 your image data is 2 times the horizontal resoluation as the vertical resoluation. Why they did this I've no idea. It just means things would look squished outward if you rendered them 1:1
But basically they aren't scaling it up they are halving it

instead. Another game that does this is the tomb raider games though they are rendered at 512x240 I had a heck of a time figuring that out
Cyb