flat assembler
Message board for the users of flat assembler.

Index > DOS > Setting Hercules Graphics Adapter to 720x348 pixels

Author
Thread Post new topic Reply to topic
RicardoFco



Joined: 15 Apr 2009
Posts: 7
RicardoFco 26 Jun 2014, 22:15
Hello everybody:

My problem isn't about DOS. Rather is about old hardware.

I'm trying to set the Hercules Graphics Card to the graphics mode.
Borland's Turbo C can change it thru a driver called HERC.BGI and a propietary binary lib (GRAPHICS.LIB).
Also Microsoft GW-BASIC and Borland's Turbo Basic can change to this mode writing "SCREEN 2". This command/instruction behaves quite diferent with a CGA graphics adapter.

I've tried Int 10h with the AH register set to 40h, but it didn't work.

I also found this on google:

https://groups.google.com/forum/#!topic/comp.lang.pascal/yPM8Y7lx2Bc

(I can't put the link properly so copy and paste in the address bar to see)

that consist in sending some bytes to ports, but doesn't work fine. The image in the screen begins to shake (and I think the problem is a bad frequency in the sweep).

Any idea?

Edit by revolution: Fixed the link
Post 26 Jun 2014, 22:15
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 27 Jun 2014, 06:49
RicardoFco,

"Programmer's Guide to PC and PS/2 Video Systems" by Richard Wilton gives good insight about legacy video programming (2nd ed. is titled without "and PS/2" AFAIK).
Post 27 Jun 2014, 06:49
View user's profile Send private message Reply with quote
ACP



Joined: 23 Sep 2006
Posts: 204
ACP 27 Jun 2014, 10:40
"Undocumented PC" may also provide some info about different video cards including legacy ones it if I remember correctly.
Post 27 Jun 2014, 10:40
View user's profile Send private message Reply with quote
axlucas



Joined: 02 May 2014
Posts: 70
Location: Argentina
axlucas 30 Jun 2014, 03:16
Look! The SIMCGA.COM program (CGA emulator for Hercules) is only 618 bytes long! You may want to see it with DEBUG. Take a look: http://www.filewatcher.com/m/SIMCGA.COM.618-0.html
Or maybe you could just run it and then use CGA mode 640x200x2 instead.

Another possibility is MSHERC.COM. I remember my uncle would load it in his old XT. Here it is, but if you want to analyse it, it's over 6K: http://www.filewatcher.com/m/MSHERC.COM.6749-0.html

Hope it's useful! Good luck!
Post 30 Jun 2014, 03:16
View user's profile Send private message Reply with quote
RicardoFco



Joined: 15 Apr 2009
Posts: 7
RicardoFco 30 Jun 2014, 12:40
Thanks baldr,ACP and axlucas.

I found a listing inside "Programmer's Guide to PC and PS/2 Video Systems" by Richard Wilton very similar to the listing in the link I put and it don't work. Sad

I will try reading "Undocumented PC" and the solution of axlucas.

Programming for the Hercules Graphics Card seems to be a headache.

If any knows some more specific , please post!!
Post 30 Jun 2014, 12:40
View user's profile Send private message Reply with quote
prostyle4444



Joined: 28 Jun 2013
Posts: 25
Location: Bootsector
prostyle4444 30 Jun 2014, 15:56
I have more info on Hercules Graphics Card. Hope it helps. Smile

Code:
INT 10 - AH = 40h VIDEO - SET GRAPHICS MODE (Hercules GRAFIX)
INT 10 - AH = 41h VIDEO - SET TEXT MODE (Hercules GRAFIX)
INT 10 - AH = 42h VIDEO - CLEAR CURRENT PAGE (Hercules GRAFIX)
INT 10 - AH = 43h VIDEO - SELECT DRAWING PAGE (Hercules GRAFIX)
AL = page number (0,1)
INT 10 - AH = 44h VIDEO - SELECT DRAWING FUNCTION (Hercules GRAFIX)
AL = drawing function
 00h clear pixels
 01h set pixels
 02h invert pixels
INT 10 - AH = 45h VIDEO - SELECT PAGE TO DISPLAY (Hercules GRAFIX)
AL = page number (0,1)
INT 10 - AH = 46h VIDEO - DRAW ONE PIXEL (Hercules GRAFIX)
DI = x (0-720)
BP = y (0-347)
Note: function 44h determines operation and function 43h which page to use
INT 10 - AH = 47h VIDEO - FIND PIXEL VALUE (Hercules GRAFIX)
DI = x (0-720)
BP = y (0-347)
Return: AL = 0 pixel clear
AL = 1 pixel set
Note: function 43h specifies which page is used
INT 10 - AH = 48h VIDEO - MOVE TO POINT (Hercules GRAFIX)
DI = x (0-720)
BP = y (0-347)
INT 10 - AH = 49h VIDEO - DRAW TO POINT (Hercules GRAFIX)
DI = x (0-720)
BP = y (0-347)
INT 10 - AH = 4Ah VIDEO - BLOCK FILL (Hercules GRAFIX)
INT 10 - AH = 4Bh VIDEO - DISPLAY CHARACTER (Hercules GRAFIX)
AL = character to display
DI = x (0-720)
BP = y (0-347)
Note: Unlike the other BIOS character functions character position is specified in pixels rather than rows and columns.
INT 10 - AH = 4Ch VIDEO - DRAW ARC (Hercules GRAFIX)
INT 10 - AH = 4Dh VIDEO - DRAW CIRCLE (Hercules GRAFIX)
INT 10 - AH = 4Eh VIDEO - FILL AREA (Hercules GRAFIX)
    
Post 30 Jun 2014, 15:56
View user's profile Send private message Reply with quote
RicardoFco



Joined: 15 Apr 2009
Posts: 7
RicardoFco 30 Jun 2014, 16:38
This is what I meant when I put:

Quote:

I've tried Int 10h with the AH register set to 40h, but it didn't work.


Anyway, thank you!
Post 30 Jun 2014, 16:38
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.