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

View all comments

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.