Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2002-01

VESA modes in fpc for win32

26 messages · 13 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Victor V. Shuvalov

[note: I'm not subscribed to this mailing list, so please send me a personal copy of your answer. TIA]

Hello!

How do I initialize VESA graphics modes (like 101h) with fpc for win32? The documentation says

If you need another mode, then set GraphDriver to a value different from zero and graphmode to the mode you wish (VESA modes where 640x480x256 is 101h etc.).

but the program like

 .........
 GraphDriver:=1;
 GraphMode:=$103;
 InitGraph(GraphDriver,GraphMode,'');
 .........

which was working well with old version 0.99.12b (go32v2) is not working with version 1.0.4 (neither win32 nor go32v2). Please help if you can.

TIA,

Victor V. Shuvalov

Shifted Soul
to Victor V. Shuvalov
Show quoted text 7 lines
but the program like ......... GraphDriver:=1; GraphMode:=$103; InitGraph(GraphDriver,GraphMode,''); .........

Hi
Don't ask me why, but I countred the same problem and it was solved by setting the value of GraphDriver to 10 !?
bye

Victor V. Shuvalov
to Victor V. Shuvalov: [note: I'm not subscribed to this mailing list, so please send me a personal copy of your…

[I'm not subscribed to this mailing list, so please send me a copy of your answer. Thanks.]

Show quoted text 12 lines
> but the program like > > ......... > GraphDriver:=1; > GraphMode:=$103; > InitGraph(GraphDriver,GraphMode,''); > ......... Hi Don't ask me why, but I countred the same problem and it was solved by setting the value of GraphDriver to 10 !? bye

Hi!

Thanks, with go32v2 it works fine, but with win32 I get Graph Application Window instead of normal full-screen picture in vesa mode --- why? Maybe win32 version doesn't support vesa at all???

TIA,

Victor V. Shuvalov

Jonas Maebe
to Victor V. Shuvalov: [note: I'm not subscribed to this mailing list, so please send me a personal copy of your…
Victor V. Shuvalov wrote 9 lines
How do I initialize VESA graphics modes (like 101h) with fpc for win32? The documentation says If you need another mode, then set GraphDriver to a value different from zero and graphmode to the mode you wish (VESA modes where 640x480x256 is 101h etc.).

Is this in the current documentation? This information is completely outdated, please check the new documentation.

Show quoted text 10 lines
but the program like ......... GraphDriver:=1; GraphMode:=$103; InitGraph(GraphDriver,GraphMode,''); ......... which was working well with old version 0.99.12b (go32v2) is not working with version 1.0.4 (neither win32 nor go32v2). Please help if you can.

There are several reasons

a) the win32 graph unit only supports 640x480x16 colors. There is no way to directly set video modes from a win32 program based on the VESA specifications, you have to got through the win32 api or direct-x and this is not implemented yet in the graph unit
b) the graph mode setting has been completely reworked in the current versions of FPC. You would now use something like

graphdriver := d8bit;
graphmode := m640x480;
initgraph(graphdriver,graphmode,'');
if graphresult  grOK then
   begin
     error handling here
   end;

See the docs for more info. You can use the go32v2 version of the compiler to create (Dos) programs that switch into VESA modes (using the graph unit and the method described above), but keep in mind that WinNT/2000/XP do *NOT* support VESA modes for Dos programs (well, the OS may support it, but most video card drivers do not). It will work fine under Win9x and WinME though.

Jonas

Ignacio Flores
to Jonas Maebe

Hi everybody

Is there some database for freepascal for monouser programs?

Some like turbo pascal data base toolkit with pascal 5

Thanks everybody

Ignacio

Victor V. Shuvalov
to Jonas Maebe: Is this in the current documentation? This information is completely outdated, please…

[I'm not subscribed to this mailing list, so please send me a copy of your answer.]

Hello!

Thanks for your answer.

Show quoted text 12 lines
> How do I initialize VESA graphics modes (like 101h) with fpc for win32? > The > documentation says > > If you need another mode, then set GraphDriver to a value different > from > zero and graphmode to the mode you wish (VESA modes where 640x480x256 > is > 101h etc.). Is this in the current documentation? This information is completely outdated, please check the new documentation.

Unfortunately it is. I downloaded dosw32104full (containing many things including docs) some 1.5 month ago. Maybe the online documentation is more fresh --- I didn't check yet.

Show quoted text 14 lines
> but the program like > > ......... > GraphDriver:=1; > GraphMode:=$103; > InitGraph(GraphDriver,GraphMode,''); > ......... > > which was working well with old version 0.99.12b (go32v2) is not working > with version 1.0.4 (neither win32 nor go32v2). Please help if you can. There are several reasons a) the win32 graph unit only supports 640x480x16 colors.

OK, how do I use at least this mode?

See the docs for more info. You can use the go32v2 version of the compiler to create (Dos) programs that switch into VESA modes (using the graph unit and the method described above),

Surprisingly the method described above is NOT working, but GraphDriver=10 helps --- which looks like nonsence, isn't it?

The problem with win32 and graph is that I can't use Crt in graphics mode (you have to switch to text window and press keys there :-). FAQ recommends WinCrt instead, but WinCrt is not working in text mode (ch:=keypressed causes the program to hang)! So there's no chance to use Crt procedures and function both in text and graphics mode, which seems to be a big problem. Is there any way to fix this problem?

TIA,

Victor V. Shuvalov

Chuck welch
to Ignacio Flores: Hi everybody Is there some database for freepascal for monouser programs? Some like turbo…
you wrote 10 lines
Hi everybody Is there some database for freepascal for monouser programs? Some like turbo pascal data base toolkit with pascal 5 Thanks everybody Ignacio

Check out Halcyon version 3.0

You can download it from:

http://www.programmersheaven.com/zone24/cat573/index.htm

It's good for single user mode in dos to create and manipulate the old dBase III+ format.

I don't think there is a linux port.

Thanks

Chuck

Georgi Georgiev
to Ignacio Flores: Hi everybody Is there some database for freepascal for monouser programs? Some like turbo…
--- Ignacio Flores wrote 11 lines
Hi everybody Is there some database for freepascal for monouser programs? Some like turbo pascal data base toolkit with pascal 5 Thanks everybody Ignacio

For Linux OS try the package:

http://skelet.hit.bg/srdb/SRDB.htm

=====
Skelet
====== http://skelet.hit.bg

__________________________________________________ Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

Jonas Maebe
to Markus Kaemmerer
Markus Kaemmerer wrote
an FPC program compiled with -gl displays line information if an exception occours. This is realy helpful. It is possible to write this line information in a file (e.g. an debug log) instead of the screen?

No, at this time only the output from the heaptrc unit can be redirected. The normal "crash logs" are always written to stdout.

Jonas

Jonas Maebe
to Ignacio Flores: I'm trying to tanslate an old pas file into fpc pas file but I have this error: Syntax…
Ignacio Flores wrote 10 lines
I'm trying to tanslate an old pas file into fpc pas file but I have this error: Syntax error, : expected but ( Found and the line is: inline ($FF/$1E/Errorproc); {CALL DWORD PTR Errorproc} Somebody knows how can i change this line? or is equivalent?

Just change the declaration of "ErrorProc" from

var
   ErrorProc: pointer; (I suppose it's currently decared like that anyway)

to

var
   ErrorProc: procedure;

Then you can replace the above with simply

ErrorProc;

You may have to change some code which assigns a value to errorproc though.

Jonas

Jonas Maebe
to Victor V. Shuvalov: [I'm not subscribed to this mailing list, so please send me a copy of your answer.] Hello!
Victor V. Shuvalov wrote
Unfortunately it is. I downloaded dosw32104full (containing many things including docs) some 1.5 month ago. Maybe the online documentation is more fresh --- I didn't check yet.

Really strange, the documentation in that package should already contain all the new mode handling stuff.

Show quoted text 5 lines
> There are several reasons > > a) the win32 graph unit only supports 640x480x16 colors. OK, how do I use at least this mode?
graphdriver := d4bit;
graphmode := m640x480;
Show quoted text 8 lines
> See the docs for more info. You can use the go32v2 version of the > compiler to create (Dos) programs that switch into VESA modes (using > the > graph unit and the method described above), Surprisingly the method described above is NOT working, but GraphDriver=10 helps --- which looks like nonsence, isn't it?

Yes, because there is no graphdriver 10 available under windows...

Show quoted text 10 lines
The problem with win32 and graph is that I can't use Crt in graphics mode (you have to switch to text window and press keys there :-). FAQ recommends WinCrt instead, but WinCrt is not working in text mode (ch:=keypressed causes the program to hang)! So there's no chance to use Crt procedures and function both in text and graphics mode, which seems to be a big problem. Is there any way to fix this problem?

I don't know. Maybe you could look at the fpctris sources (it's one of the demo's), I think it also uses both the graph and crt unit.

Jonas

Marco van de Voort
to Jonas Maebe
Show quoted text 16 lines
On maandag, januari 28, 2002, at 07:22 , Victor V. Shuvalov wrote: > The problem with win32 and graph is that I can't use Crt in graphics > mode > (you have to switch to text window and press keys there :-). FAQ > recommends > WinCrt instead, but WinCrt is not working in text mode (ch:=keypressed > causes the program to hang)! So there's no chance to use Crt procedures > and > function both in text and graphics mode, which seems to be a big > problem. > Is there any way to fix this problem? I don't know. Maybe you could look at the fpctris sources (it's one of the demo's), I think it also uses both the graph and crt unit.

Yes, but he wants to sometimes be in graph mode, and sometimes not.

This doesn't work afaik. FPCTris is either pure text, or {$APPMODE GUI} and pure Graph.

That FAQ item is written after I figured it out for fpctris/samegame etc. (with Florians help IIRC)

Original poster: If you look at fpctris, be sure to get them from CVS

Victor V. Shuvalov
to Jonas Maebe: Really strange, the documentation in that package should already contain all the new mode…

[note: I'm not a member of this mailing list, so please send me a copy of your answer!]

Hello!

Thanks a lot for your help.

Show quoted text 8 lines
>> There are several reasons >> >> a) the win32 graph unit only supports 640x480x16 colors. > > OK, how do I use at least this mode? graphdriver := d4bit; graphmode := m640x480;

It seems to be wrong. My program with these lines reports "Invalid graphics mode". Maybe this is the problem of my video card? It is Matrox Millenium G400.

Show quoted text 8 lines
>> See the docs for more info. You can use the go32v2 version of the >> compiler to create (Dos) programs that switch into VESA modes (using >> the graph unit and the method described above), > > Surprisingly the method described above is NOT working, but > GraphDriver=10 helps --- which looks like nonsence, isn't it? Yes, because there is no graphdriver 10 available under windows...

Well, there can be a kind of misunderstanding --- GraphDriver=10 helps ising vesa modes with go32v2 version, not win32. The nonsence is that no other value of GraphDriver helps!!!

Hope I didn't disturb you too much with my (probably stupid) questions,

Victor V. Shuvalov

Jonas Maebe
to Victor V. Shuvalov
Victor V. Shuvalov wrote 10 lines
>> OK, how do I use at least this mode? > > graphdriver := d4bit; > graphmode := m640x480; It seems to be wrong. My program with these lines reports "Invalid graphics mode". Maybe this is the problem of my video card? It is Matrox Millenium G400.

It would surprise me, but it is possible that they removed support for that mode in newer drivers or so...

Show quoted text 7 lines
>> Surprisingly the method described above is NOT working, but >> GraphDriver=10 helps --- which looks like nonsence, isn't it? > > Yes, because there is no graphdriver 10 available under windows... Well, there can be a kind of misunderstanding --- GraphDriver=10 helps ising vesa modes with go32v2 version, not win32.

That's normal. However, even under go32v2 you should use the new way to select modes since as of the VESA 3.0 standard, the vesa modes aren't required to be numbered the same as in previous versions (so in theory, mode $101 could suddenly be 1600x1200x32 bit).

The nonsence is that no other value of GraphDriver helps!!!

Using "detect" would probably help (then you'll get the best available mode), but I'm really curious why it doesn't work otherwise. Since I don't have windows, I can't test unfortunately.

Hope I didn't disturb you too much with my (probably stupid) questions,

No problem.

Jonas

Marco van de Voort
to Fernando Lozano
Show quoted text 5 lines
> I've just dowloaded dev-pascal and am looking for an online source of > reference info. Unfortunately, dev-pascal is unsuported and there will be no noew releases, patches, etc. At least that was said by the authors. :-(

The source is GPL, FPC also.

All it needs is somebody with a Delphi license.

gj bart
to Fernando Lozano: Unfortunately, dev-pascal is unsuported and there will be no noew releases, patches, etc.…
Fernando Lozano wrote 11 lines
Hi there, > I've just dowloaded dev-pascal and am looking for an online source of > reference info. Unfortunately, dev-pascal is unsuported and there will be no noew releases, patches, etc. At least that was said by the authors. :-( []s, Fernando Lozano

Bummer, I was just starting to get used to some things. What is the consensus favorite alternative on this list?

gj

Unknown author
to gj bart
gj bart wrote 17 lines
On Thu, 31 Jan 2002, Fernando Lozano wrote: > Hi there, > > > I've just dowloaded dev-pascal and am looking for an online source of > > reference info. > > Unfortunately, dev-pascal is unsuported and there will be no noew > releases, patches, etc. At least that was said by the authors. :-( Bummer, I was just starting to get used to some things. What is the consensus favorite alternative on this list?

I think that till Lazarus is fully-functional and stable, FPE might be your best choice on Windows. See http://www.freepascal/links.html for a download link.

Michael.

Markus Kaemmerer
to Jonas Maebe: No, at this time only the output from the heaptrc unit can be redirected. The normal…

Jonas Maebe wrote:,

Show quoted text 6 lines
> an FPC program compiled with -gl displays line information if an > exception occours. This is realy helpful. It is possible to write this > line information in a file (e.g. an debug log) instead of the screen? No, at this time only the output from the heaptrc unit can be redirected. The normal "crash logs" are always written to stdout.

do you see a chance to implement this with minimal expense?

Happy Arts Software
Peter Vreman
Show quoted text 10 lines
Jonas Maebe wrote:, >> an FPC program compiled with -gl displays line information if an >> exception occours. This is realy helpful. It is possible to write this >> line information in a file (e.g. an debug log) instead of the screen? > >No, at this time only the output from the heaptrc unit can be >redirected. The normal "crash logs" are always written to stdout. do you see a chance to implement this with minimal expense?

You can override the following procvar:

  TBackTraceStrFunc = Function (Addr: Longint): ShortString;

This is called for every address that is printed in the back trace.

Markus Kaemmerer
to Peter Vreman

Peter Vreman wrote:,

You can override the following procvar: TBackTraceStrFunc = Function (Addr: Longint): ShortString;

thank you, this is working fine.

Happy Arts Software