Reply 180 of 187, by superfury
So then the 3D vectorbobs should have:
(128 rows*2 scanlines/row)+05 scanlines adjustment=261 scanlines. Your code says 262 scanlines? Didn't the docs say this is simply added?
Edit: Just looked at the manual again. It says it's a fraction of the character clock. Also looking at the vertical timings shows the following:
Nvsp = 16 x Tsi
Tadj = Nadj x Tsi
Seeing as reenigne multiplied the character clock by 2 to get 16(8 is used in my emulation, although halved when setting it's position), I assume Nadj is the amount of scanlines after VTotal+1 vertical character clocks before starting a new frame(Going back to Scanline #0)?
I don't see anything in the documentation of the chip about 1 being added to the value of the register, as it's programmed. It's used directly once the final clock has ended according to it's timings graph.
Your code loads the value 05h into the register. The commentary says it's 6 scanlines. But the documentation says 5 lines, as you're programming it. If it's set to 0, nothing is added, thus the vertical total(register 04h) times character height is your vertical timing.
So in fact, the timing used doesn't match the timing as documented, as the vertical total adjust is one scanline too small. Thus you end up with modes with strange framerates, which the camera has trouble with.
Anyone can verify this? I just looked at the chip documentation and timing and saw this strange timing issue. Although it might be something's misread here?
Edit: Double checked to make sure:
http://www.oldskool.org/guides/oldonnew/resou … ces/cgatech.txt
3D4h index 04h (W): Vertical Total Register Bit 0-6 Number of character rows in a frame. This is adjusted by the number […]
3D4h index 04h (W): Vertical Total Register
Bit 0-6 Number of character rows in a frame. This is adjusted by the number
of scanlines in a character (index 9) and the Vertical Adjust (index
5).
Note: this register is Read/Write on the CT82c425/6.3D4h index 05h (W): Vertical Total Adjust Register
Bit 0-3 Number of scanlines added to the Vertical Total time.
This confirms it. The problem you're having is because the vertical total adjust register is programmed incorrectly. It's supposed to be the number of extra scanlines to be added. Nothing is said that 1 scanline is added to it as far as I can see. Thus vertical total has 5 scanlines added instead of 6 because you've programmed it wrong. Change the vertical total adjust to 6 instead of 5 to get the right screen height(262 scanlines at 59.72FPS).
Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io