Hi,
Well from the top of my head 1C is I believe the timer interrupt. I just
checked a decennia old assembly program of mine
http://moonlit.xs4all.nl/MUSIC.COM
and it still runs in a dosbox. I.e. apparently you can still set
timerinterrupts. 08 interupt vector was I believe the keyboard interrupt.
Open a dosbox and enter music.com (if you dare :-) ) It is a tsr so to
remove it from memory just run it again.
--
Here is a piece of code (in assembly, the C functions are not compatible
amongst the C compiler (msc or turbo C). This replaces interrupt 1C (the
time interrupt) using msdos function (interrupt 21) 35h and 25h. It saves
the old address because you have to restore it when exiting your program.
Otherwise it will obviously point into nothing (which is pretty bad for the
timer interrupt).
Playtune is the offset of your interrupt routine. In MSVC you can use the
__asm keyword. The interrupt itself is best created with as 'naked' routine
and should end with reti (return from interrupt, instead of the compiler
generated ret)
Install: Mov Ax,351ch ;Get old interuptvector
Int 21h
Mov [Oldintoff],Bx
Mov [Oldintseg],Es
Mov Ax,251ch ;Install new interuptvector.
Mov Dx, Play_tune
Int 21h
Ok, so you really don't want to do this right? Just learn windows
programming and lookup WM_TIMER message, SetTimer, KillTimer and WM_CHAR
messages.
Let msvc generate a basic MFC app and do something with those messages in
the main event loop.
Then on the WM_PAINT event draw in your window using the nice GDI functions.
That should cover all those turbo pascal functions I see in your listing.
Regards, Ron AF Greve
http://moonlit.xs4all.nl
<dh*****************@hotmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
>I am trying to port an old Pascal DOS game to DOS C/C++. I am wondering
if anyone is familar with the dos & crt Pascal units and whether there
are C/C++ equivalent libraries. Maybe dos.c & crt.c?
Below lists names of variables, functions, types & weird interrupt
procedures found in Pascal. Am wondering what can be done to get around
them for use in C/C++.
dos.pas
crt.pas
---undefined identifiers---
'black'
'blue'
'clrscr'
'lightblue'
'lightcyan'
'lightgray'
'lightgreen'
'lightmagenta'
'lightred'
'mem'
'port'
'wherex'
'wherey'
'white'
'yellow'
---undefined functions---
'addr'
'blockread'
'delay'
'fillchar'
'fsearch'
'getintvec'
'gettime'
'gotoxy'
'hi'
'inline_'
'int_'
'intr'
'lo'
'ofs'
'seg'
'setintvec'
'settime'
'swap'
'textbackground'
'textcolor'
'window'
---unknown types---
Single
registers
---misc---
Port[$3C8] := reg;
l := port[$60];
port[$20] := $20;
Port[$43] := $B6;
ch := mem[seg(tex) + (let div 16): ofs(tex) + (let mod 16)];
procedure NewInt1C; Interrupt;
procedure NewInt08; Interrupt;