flat assembler
Message board for the users of flat assembler.

Index > DOS > how to change svga refresh rate at a vesa 3.0 video card

Author
Thread Post new topic Reply to topic
cylo



Joined: 06 Nov 2004
Posts: 20
cylo 09 Feb 2005, 11:17
Hello!

I am not so into assambler. I realy need to change refresh rate at svga modes (initialized with bgi (turbo c++ 4.5)). I am using a PC/104 standard computer with a via eden cpu and a s3 twister chipset (s3 savage4 engine). It is Vesa 3.0 compatible.

Maybe somebody has a little code or hint for me?

thx cylo
Post 09 Feb 2005, 11:17
View user's profile Send private message Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
Matrix 09 Feb 2005, 20:53
hello
sorry i have not implemented these yet, i was writing a modeinfo prog for a week, but i have attached the vesa part from ralph brown interrupt list
you have to set the pixel clock, horizontal, vertical synch start end, and the refresh rate in VBE CRTC Information Block


Description: Interrupt list snipplet (VESA PART)
Download
Filename: graph.rar
Filesize: 10.41 KB
Downloaded: 761 Time(s)



Last edited by Matrix on 11 Feb 2005, 21:51; edited 1 time in total
Post 09 Feb 2005, 20:53
View user's profile Send private message Visit poster's website Reply with quote
cylo



Joined: 06 Nov 2004
Posts: 20
cylo 10 Feb 2005, 09:07
download didnt work. Crying or Very sad
Post 10 Feb 2005, 09:07
View user's profile Send private message Reply with quote
cylo



Joined: 06 Nov 2004
Posts: 20
cylo 11 Feb 2005, 15:46
Crying or Very sad
Post 11 Feb 2005, 15:46
View user's profile Send private message Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
Matrix 11 Feb 2005, 21:53
there was an interesting error in my posting :/
but its fixed, i have uploaded it again
Post 11 Feb 2005, 21:53
View user's profile Send private message Visit poster's website Reply with quote
cylo



Joined: 06 Nov 2004
Posts: 20
cylo 21 Feb 2005, 07:14
hello again!

i have got some code but its writtn for masm. therefore i got some compiling errors out of fasm. most i solved by myselfe but with one i need your help. Smile

Code:
CRTC    DW 1088                        ; horizontal Total       in Pixel
HORIANF DW 860                         ; horizontal  Sync-Start in Pixel
HORIEND DW 18                          ; horizontal  Sync-End   in Pixel
VERTOTA DW 653                         ; vertical   Total       in Lines
VERTANF DW 600                         ; vertical    Sync-Start in Lines
VERTEND DW 47                          ; vertical    Sync-End   in Lines
DOIFLAG DB 04h                         ; Flag (interlaced,doubleScan,polarity)
PIXCLOC DD 55549000                    ; Pixel clock in hz
REFRATE DW 8500                       ; Refresh-Rate in 0.01 hz

Video_Mode = 115h+4000h+800h

mov      ax, 4F0Bh           ; get/set Pixel-Clock
xor      bl, bl              ; get
mov      ecx,  PIXCLOC
mov      dx, Video_Mode
int    10h
cmp      ax, 4Fh
jnz ERROR
mov      [PIXCLOC], ecx

xor      eax, eax
mov      ax, CRTC            ; horizontal total
xor      ebx, ebx
mov      bx, VERTOTA         ; vertikal total
mul      ebx
mov      ebx, eax
mov      eax, ecx            ; pixelclock
mov      esi, 10
xor      edx, edx
div      esi
xor      edx, edx
div      ebx
mov      [REFRATE], ax         ; RefreshRate=Pixelclock/(HTotal*Vtotal)

mov      ax, 4F02h           ; set vesa-video-mode
mov      bx, Video_Mode
mov      di, OFFSET CRTC     ; own timing
int    10h
cmp      ax, 4Fh
jnz ERROR    


error is line
Code:
 mov      di, OFFSET CRTC     ; own timing     


i realy have no idea to make this work.

thx so far cylo
Post 21 Feb 2005, 07:14
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 21 Feb 2005, 09:01
just rewrite it to
Code:
mov bx,[Videomode]
mov cx,CRTC    

but there may be more such problems in code, because this is not FASM code
Post 21 Feb 2005, 09:01
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
cylo



Joined: 06 Nov 2004
Posts: 20
cylo 23 Feb 2005, 16:05
damn i am to busy to get this thing work! i will pay for a working fasm code which i can include in borland c++ 3.1 dos!!! ... or any other solution ^^

i still need to change crtc refresh rate (to >60Hz) in svga mode (640x480,...) which is initialized with svga256.bgi. (borland c++ 3.1 dos compiler) on a Vesa 3.0 compatible gpu.

please contact me at lars [at(@)] mentze [dot(.)] de !
Post 23 Feb 2005, 16:05
View user's profile Send private message Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
Matrix 25 Feb 2005, 05:06
hello cylo
sorry for just helping in indirect way, but i have some to do ...

i did this search on google
and found VESA BIOS EXTENSION (VBE) Core Functions Standard(pdf)

btw .:
pixel clock has to be set correctly, = horizontal pixels * vertical pixels * refresh frequency, in some cases the refresh rate you set is ignored (not sure in these parts)

i have not read this doc yet, but you should
Post 25 Feb 2005, 05:06
View user's profile Send private message Visit poster's website Reply with quote
cylo



Joined: 06 Nov 2004
Posts: 20
cylo 25 Feb 2005, 08:45
i have allready read the doc. Smile

but i am not so into assambler so it takes a lot of time for me to get this all work.

and i have to do a lot of things too... Laughing

btw the code above descibes how to set pixel clock correctly.

1. calc the pixelclock with gtf formula
2. send requested pixelclock and vidmode to gpu
3. get normalized pixelclock
4. calc refresh rates with normalized pixelclock again

i think my main problem is how to get a fasm code into borland c++ 3.1.

i realy have no idea about the syntax how to transmit variables and so on....
Post 25 Feb 2005, 08:45
View user's profile Send private message Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
Matrix 25 Feb 2005, 15:16
your c++ documentation should describe how are variables pssed to a procedure, it should be something like EBP+4 EBP+8 EBP+12 EBP+16
DWORD PARAMERERS which you can access like mov eax,[EBP+4]
Post 25 Feb 2005, 15:16
View user's profile Send private message Visit poster's website Reply with quote
cylo



Joined: 06 Nov 2004
Posts: 20
cylo 04 Mar 2005, 11:11
i somehow figuered it out but now:

LINKING Refresh.exe
Linker Error: 32-Bit record encoutered in module getn.asm Sad

... is it difficult to code a trs which is checking vese mode change?
Post 04 Mar 2005, 11:11
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.