Problems in CGA (Screen 1 and Screen 2)

DOS specific questions.
andrzejlisek
Posts: 6
Joined: Oct 29, 2010 22:02

Problems in CGA (Screen 1 and Screen 2)

Postby andrzejlisek » Apr 06, 2013 17:22

I have tested FreeBasic 0.24 in DosBox and I wrote following program:

Code: Select all

SCREEN 1
CLS
COLOR 1, 3
PRINT "Hello World!"
DIM I AS INTEGER
FOR I = 0 TO 3
 LINE (I * 80, 20)-(I * 80 + 79, 199), I, BF
NEXT
SLEEP
COLOR 0, 2
PRINT "Palette changed"
SLEEP
SCREEN 2
CLS
LINE (0, 0)-(639, 199)
LINE (0, 199)-(639, 0)
LINE (0, 0)-(639, 199), , B
LOCATE 1, 1
PRINT "AA"
LOCATE 1, 79
PRINT "BB"
SLEEP


This program displays tree pictures, two in Screen 1 mode and one in Screen 2 mode.

I found problems with CGA graphics in current version of FreeBasic.

This program compiled with Microsoft QuickBasic displays following pictures:
Image

The pictures are the same in all machine types in DosBox configuration, only in "hercules" machinetype this program does not work.

But with the same program compiled with FreeBasic (also with "-lang qb") there are some problems with display and mouse.

In machine type "pcjr" this program does not work.

Machine type one of following: cga,tandy,ega,vgaonly,svga_et3000,svga_et4000,svga_paradise
In Screen 1, COLOR statement does not work, and in Screen 2, picture is moved by 8 pixels right.
Image

In machine type "svga_s3" or "vesa_oldvbe" picture in both screen modes is displayed correctly.
Image

In these machine type in Screen 2 mode there is a problem with mouse. The starting point is not screen center, there is at bottom edge. When I move mouse "below" bottom edge, DosBox exits with following error:
Image

In machine type "vesa_nolfb" screen are as following and there is the same problem with mouse.
Image
counting_pine
Site Admin
Posts: 6174
Joined: Jul 05, 2005 17:32
Location: Manchester, Lancs

Re: Problems in CGA (Screen 1 and Screen 2)

Postby counting_pine » Apr 07, 2013 1:50

(Note: I'm not really an expert in DOS and graphics.. You might want to read through /wiki/FaqDOS. If I contradict anything there, trust the wiki page over me.)

I think the Screen 1 palette problems are probably something to do with the fact that all the palette modes are actually 8-bit internally, unlike QB.
The Screen 2 problems are interesting. The mouse problem and squashing will be something to do with the 2× height scaling in that mode, but I can't explain the 8-pixel offset.

I would say the Screen 1 palette problem is probably more of a limitation than a bug in FB, and proper 1-bit screen support would probably fall under the category of feature request. But perhaps there should be minimum system requirements for DOS..
The Screen 2 problems are interesting, and may warrant separate bug reports on the tracker.
MichaelW
Posts: 3500
Joined: May 16, 2006 22:34
Location: USA

Re: Problems in CGA (Screen 1 and Screen 2)

Postby MichaelW » Apr 07, 2013 3:36

Machine type one of following: cga,tandy,ega,vgaonly,svga_et3000,svga_et4000,svga_paradise

Considering how few of these adapters are still in use, where is the incentive to do anything to support them?
andrzejlisek
Posts: 6
Joined: Oct 29, 2010 22:02

Re: Problems in CGA (Screen 1 and Screen 2)

Postby andrzejlisek » Apr 07, 2013 18:00

I suppose that testing in DosBox and Bochs are good way to test software compatibility with DOS.

I have tested this program in Bochs (http://bochs.sourceforge.net/) with MS-DOS 6.22 installed inside. The program behaves the same like in DosBox in machine type cga/tandy/ega/vgaonly/svga_et3000/svga_et4000/svga_paradise, so mouse works correctly, no pallette changes in Screen 1 and there is a picture offset in Screen 2.

All tests in DosBox and Bochs I made using "HX DOS Extender", which is a better replacement for CWSDPMI.

I conclude, that picture offset is the FreeBasic problem, not bugs in emulators, because are the same in both emulators.

Return to “DOS”

Who is online

Users browsing this forum: No registered users and 2 guests