PPP - Pascal Program Patch

About

This is a very old little program I wrote, around year 2002. Its purpose is to fix Turbo Pascal-created binaries, which does cause a Runtime Error 200 at XXXX:XXXX, without recompiling them. This is very useful to make those old games work again, even without having access to source code.

The software is in Portuguese, but it is so damn easy to use. It was created when I was 17 years old.

How to use

First, download the binary ppp20.exe. Then, just run:ppp20 originalfile patchedfile. The file originalfile (should be the EXEcutable of your old game) will be read. PPP will look inside it for the defective code from Turbo Pascal's CRT. If it is found, PPP will write a new file called patchedfile. This will be the patched version of your old EXEcutable. Just run it and enjoy your old game on your fast computer. :)

There is no warranty. I advise you to keep a copy of original EXEcutable. If PPP works for you, enjoy! (you may send me a e-mail, I would like to know that my humble program was useful for you) If PPP does not work for you, don't blame me! :P

PPP messages

As I said before, the program is in Portuguese. So, only to help you to understand what PPP says, I wrote this little glossary of all PPP messages.

O arquivo "SOMEFILE" já existe. Deseja sobrescrevê-lo? [s/n]
The file "SOMEFILE" already exists. Do you want to overwrite it? s=yes; n=no
Utilize "ppp programa.exe destino.exe"
Use "ppp program.exe destination.exe
Para mais informações, digite "ppp ?"
For more information (in Portuguese), type "ppp ?"
O arquivo "SOMEFILE" foi alterado com sucesso e gravado em "ANOTHERFILE".
The file "SOMEFILE" was successfully patched and was wrote in "ANOTHERFILE".
O arquivo "SOMEFILE" não precisa de patch.
The file "SOMEFILE" does not need a patch. (at least PPP thinks this)
Erro ### no arquivo "SOMEFILE".
Error ### in file "SOMEFILE".
13 lines of Portuguese text
This is the help message shown on command line ppp ?

How it was made

In 2002, I was very young (17 years old). I was programming in Pascal and C. I was also learning assembly. So, I asked my teacher Fausto about source code of CRT, and about that patch available. He gave me, and I started to study it. I used some knowledge of assembly to understand the CRT defective code inserted on all Turbo Pascal programs. So, I tried to discover some fix.

The first fix (ppp10) wasn't good. Some time after, I discovered the interruption 15h, wich does the delay action. So, my job was to remove broken code from CRT initialization and also change the delay function. And that is what I've done.

I don't remember exactly what tools I used, but I know I used some disassemblers (perhaps hiew and W32Dasm). I used, of course, Turbo Pascal to create and test some programs. However, I used DJGPP to create PPP.

PPP was wrote in C language, and manipulates assembly code created by Turbo Pascal.

Downloads

ppp20.exe
PPP binary for DOS. Requires DPMI (csdpmi, cswdpmi). This does mean that PPP runs fine under Windows and under DOSEMU, but needs some DPMI manager (like cwsdpmi) to be able to run under DosBox or plain DOS (like ZSNES emulator). DPMI is needed only for PPP binary. Programs patched by PPP don't require it.
ppp20.c
PPP source code (written in plain C, uses only stdio.h). Please forgive me if the code isn't very good. I hadn't to much experience that time. :)
beerw2.zip, pac-man.zip
Little games that works with PPP. Inside zipfile there are some EXE files. One of them is original (unpatched). Other(s) is(are) patched version(s).

There are also old versions (ppp09, ppp10) and a "beta" of a little better PPP 2.1 (ppp21b1). It was abandoned because lack of interest. PPP20 (version 2.0) works fine, so I had no need to make another version.

One famous old game that works after PPP have patched it is Jazz Jackrabbit. It is very good to know it that PPP works very well! :)

Note about DosBox and DOSEMU

I my little tests, I found that even unpatched programs appears to run fine in DosBox. In DOSEMU, however, those old programs showed Runtime Error 200, as if they were run in a real "fast" machine. I really don't know why DosBox does not have this behavior.

Interruption 15h isn't supported byt DosBox version 0.61. CVS version, however, supports it. Versions greater than 0.61 should support that too. See at DosBox SourceForge homepage or at #dosbox at irc.freenode.org to know where to get DosBox CVS.

PPP homepage

PPP does not have a fixed homepage (yet). I need time to create my personal homepage. If you want to link to PPP, link to http://users.vialink.com.br/denilson/files/ppp/ and to http://go.to/denilson and http://pagina.de/denilson". One of these will always work. :)

Feedback

I would like to receive feedback about PPP. Send any feedback to d e n i l s o n (a) v i a l i n k _ com _ br