Page 1 of 1

[SOLVED] Trio64V+ Hardware Accelerator / LFP

Posted: Wed Jul 08, 2015 10:56 am
by BASICFreak
So; I started my this endeavor about two weeks ago in protected mode, and accelerating standard VGA mode 640x480x8 was not working too well - plus I wanted a higher resolution.

I have been using Grub to boot my OS, but its lack for VBE support frustrated me - either because the real hardware does not support LFP by default VBE spec or because I had no clue what I was doing.

So I decided to tackle my "long dreaded" bootloader, so far I am in (un)real mode in the stage two loader (way incomplete)


I can now use 1024x768x16, unfortunately at this resolution I am double imaging, while at 640x480x16 the image displays perfectly.
The only reference I can find on this card is (Com)Buster's user article "Trio64 Hardware"

Is there a register that controls the height of the resolution that I am unaware of?

and as always code:

Code: Select all

		mov ax, 0x4F02
		mov bx, WORD [VBEMode]
		int 0x10
		cmp al, 0x4F
		jne ERROR_STUB
		test ah, ah
		jz ERROR_STUB

		push dx
		push ax
		mov dx, 0x3C4
		mov al, 0x08
		out dx, al
		inc dx
		mov al, 0x06
		out dx, al
		mov dx, 0x3D4
		mov al, 0x38
		out dx, al
		inc dx
		mov al, 0x48
		out dx, al
		dec dx
		mov al, 0x39
		out dx, al
		inc dx
		mov al, 0xA5
		out dx, al
		dec dx
		mov al, 0x33
		out dx, al
		inc dx
		mov al, 0x48
		out dx, al
		in al, dx
		dec dx
		push ax
		mov al, 0x33
		out dx, al
		pop ax
		inc dx
		and al, 0xAD
		out dx, al
		
		mov dx, 0x4AE8
		mov ax, 1
		out dx, ax

		mov dx, 0x3D4
		mov al, 0x31
		out dx, al
		inc dx
		in al, dx
		push ax
		dec dx
		mov al, 0x31
		out dx, al
		pop ax
		or al, 9
		inc dx
		out dx, al
		dec dx
		mov al, 0x58
		out dx, al
		inc dx
		in al, dx
		push ax
		dec dx
		mov al, 0x58
		out dx, al
		pop ax
		inc dx
		or al, 0x13
		out dx, al
		dec dx
		mov al, 0x13
		out dx, al
		inc dx
		mov ax, WORD [VBEWidth]
		shr ax, 2 ; Multiply by 2 (this takes 2 bytes per pix) Divide by 8 (or just divide by 4)
		out dx, ax

		pop ax
		pop dx
In the above:

640x480x16 VBEMode = 0x0111 & VBEWidth = 640
1024x768x16 VBEMode = 0x0117 & VBEWidth = 1024

Re: Trio64V+ Hardware Accelerator / LFP

Posted: Wed Jul 08, 2015 1:36 pm
by Octocontrabass
Why are you poking the video card's registers instead of using INT 0x10?

Re: Trio64V+ Hardware Accelerator / LFP

Posted: Wed Jul 08, 2015 3:20 pm
by BASICFreak
Let's try this post again... Power went out for an hour when I tried replying last time.
Octocontrabass wrote:Why are you poking the video card's registers instead of using INT 0x10?
The hardware does not support LFB according to the VBE standard

the mode attributes are 0x1B

trying to set 0x4117 or 0xC117 just comes back as mode not supported so I'm stuck with 0x0117 until the LFB is enabled by the Hardware not BIOS Ext

Re: Trio64V+ Hardware Accelerator / LFP

Posted: Thu Jul 09, 2015 10:48 am
by BASICFreak
Well, unfortunately I have found the issue.

1024x768x16 is 1.5MB

The S3 Trio64V+ (at least in my case) has only 1MB of video ram, so 3/4 way down the screen (above 1MB) was looping back to the start of video memory...

This is quite a disappointment, guess one day I will find another video card (or the ram extension modules for this one)

Max resolution at 16bbp is 800x600 ;(
max at 8bbp is 1024x768
max at 24bpp is 640x480