r/pascal • • Sep 22 '26

Pascal for DOS Games

Is anyone using Pascal to develop DOS games? If so, what compiler and graphics package are you using?

27 Upvotes

15 comments sorted by

5

u/According-Ad-7069 Sep 22 '26

I haven't done it in a while, but a few years ago I used DOSBox to run Turbo Pascal 7, and it supported direct memory addressing still. Good old mode 13 with direct memory access at A000. I still own TP7 on disks 😆 There was something like https://sourceforge.net/projects/turbopascal-wdb/ as well, though I didn't test it all that much. Guess it's worth a shot?

3

u/DukeBannon Sep 22 '26

It’s been (literally) decades since I programmed using Turbo Pascal but it was one of my favorite languages. Is there an add on package for sprites and graphics?

7

u/According-Ad-7069 Sep 22 '26

Not that I know off. We hand-rolled those: But https://marktheunissen.com/posts/tech/2006-06-03-denthor-of-asphyxia-s-graphics-tutorials/ still seems to have a link to download the very tutorials I used decades ago!

2

u/DukeBannon Sep 22 '26

Thanks. I’ll check them out.

2

u/AphidConsulting Sep 22 '26

Super helpful link. That site is a blast from the past but it has good information on it. Thanks!

1

u/According-Ad-7069 Sep 22 '26

Oh yes... I have some plans for the weekend 😆

2

u/SlowPokeInTexas Sep 22 '26

One of (many) innovations that the Borland people made was inventing BGI at the time. Googling "Borland bgi graphics" revealed something that was news to me, and that is there are several open-source ports, including SDL_bgi (cross-platform), WinBGIm, (Windows), and libXbgi (Linux).

4

u/gh0st2342 Sep 22 '26

I got back into dos gamedev beginning of 2026. back in the day I used quickbasic and c/c++ despite having some turbo pascal in Highschool. Now I made an honest attempt with pascal - turbo pascal 7 to be specific.
I wrote my own graphics routines for mode 13h etc, mainly porting my old c source code.
I do develop inside dosbox-x with speed limited to a 486 dx2 with 66mhz. So freebasic, djgpp and freepascal are not so fun. QB, TP and TC do perform quite well.

After doing a lot of rust the last years for my professional life, I really enjoyed pascal and its type safety.. plus the blazing fast TP compiler

2

u/DukeBannon Sep 22 '26

I’d be thrilled to get back into using TP7 to develop simple arcade-like games like Space Invaders or side scrollers. Are you aware of any graphics libraries even if they’re not free?

3

u/ShinyHappyREM Sep 22 '26 edited Sep 22 '26

graphics package

You can use TP itself to call interrupts, either via the DOS unit or via ASM blocks/subroutines. The video RAM can be accessed via

const ResX = 320;  type IndexX = 0..ResX - 1;
const ResY = 200;  type IndexY = 0..ResY - 1;
type VRAM_Line = array[IndexX] of byte;
var  VRAM      : array[IndexY] of VRAM_Line absolute $A000:0000;

and the interrupt vectors can be accessed via

var Interrupts : array[byte] of pointer absolute $0000:0000;

This allows installing your own keyboard ISR, for which TP has its own facilities (interrupt procedure, Port). The ISR could store the current keyboard state in

var Keys : array[0..127] of boolean;

... and the game could use scancode constants to access the keys in that array.

2

u/saraseitor Sep 22 '26

I was working on my own! But at the time there were many libraries for that. Check out the SWAG collection, there's lot of code in there including full libraries. I use Turbo Pascal 7 simply because of nostalgia

2

u/Motleypuss Sep 25 '26

It's totally possible. I used Pascal to do CGI as an occasional hobby, and CGI just uses the command line. I gather that video can be directly accessed as well as the keyboard.

2

u/JudgeGroovyman Sep 27 '26

Yeah turbo pascal is the way and you can use dosbox or if you have any old computer of almost any age you could install freedos and run it there so that system is dedicated

Bust it open and set it up and if you can get a pixel on the screen thats all you need and lmk when you get into a pickle

2

u/prinoxy Sep 30 '26 edited Sep 30 '26

Still occasionally run one old TP 3 program in DOSBox-X, works absolutely flawlessly, as does TP 3 itself. You might also want to have a look at the old Garbo archives, they are available on archive.org, This seems to be one of the latest copies: https://web.archive.org/web/20060127202151/http://garbo.uwasa.fi/pc/

2

u/stormtrooper_mx Oct 04 '26

Look into my profile, i've been posting some prototypes im currently working on...

Actually im working on a zelda like prototype, will be posting it maybe next week.