First post, by Snover
- Rank
- l33t++
If you're trying to play an old game and it was written in Turbo Pascal, chances are, on any machine over 200MHz, you will get an Error 200 (Divide by zero error). This program corrects the problem by patching your executable.
From the readme...
ctbppat v1.2 © Andreas Stiller [April 2000] […]
ctbppat v1.2 © Andreas Stiller [April 2000]
ctbppat fixes programs coded in Borland Pascal that cause runtime error 200 on systems with clock speeds of over 200MHz. This error occurs due to incorrect initialisation of the DELAY counter.
ctbppat is also a universal EXE scanner, monitor, and patcher. It supports the usual EXE formats -- MZ for DOS; NE for OS/2, DPMI, and Windows 3.11; and PE for 32-bit environments -- and can detect the language with which the file was created. Running "bppatch *.* /s [/p]" will list all file formats in the current directory.
If you use the switches /NE, /MZ, or /PE, ctbppat will be restricted to the respective EXE format. This will increase the speed with which it can analyse files. Running in pure DOS mode with SmartDrive (if possible) will also increase analysation speed.
If ctbppat finds an executable made with Borland Pascal 7.0, it will examine the file further to determine if it uses an original or changed CRT unit, whether this unit is already patched, and whether the DELAY function is called at all. (If it is not, patching is unnecessary.)
Depending on the result of this examination, ctbppat may offer to patch the file. If the DELAY function is used, it can be fixed by using a different delay routine that should function properly up to ~4GHz.
To do this, the BREAK routine in the CRT unit is shortened and the delay code patched into the free space.If DELAY is not used, the divisor is simply increased to 65535. This will prevent DELAY from operating; however, this will ensure that the program is able to run (theorhetically) on a 300GHz CPU.
If the CRT unit has been changed, but contains the same incorrect initialisation, ctbppat will modify the faulty divisor (255 => 1).
ctbppat only analyses original CRT units -- routines with similar incorrect code in Tool Boxes remain unchanged. However, by running "ctbppat [filename.ext] /brute", one can force the program to search for the incorrect code but WITHOUT further analysis (which prevents error checking and will then allow the faulty code to be changed). ctbppat will then allow you to patch the code with the new divisor (the default is 255, but by using the "/BRUTE=XXXX" switch, where XXXX is the divisor in HEX, you can enter your own divisor). When a file is patched, a new file (ex$) is created and the original EXE will then be overwritten (if desired).
*** BE SURE TO MAKE BACKUPS OF ALL FILES YOU ARE GOING TO PATCH! ***
Although the patch software proceeds quite carefully, a warranty for perfect functionality cannot be given. Some programs use OVERLAY operations (OVR files), with which patched programs may not work correctly.
All output is in an "international language" in order to make the program somewhat simpler for foreigners.
As a goodie, ctbppat also contains a small file monitor that can dump or disassemble the file content or display the entries and segment lists of the EXE headers (MZ/PE/NE). The disassembler displays file addresses and assigned logical addresses. It supports MMX and 3DNow!.
TO RUN: "ctbppat [filename.ext] /mon"
PROGRAMMERS!
The file ftp://ftp.heise.de/pub/ct/ctsi/bppatch.zip contains a modified version of the CRT unit, which should be good for clock speeds up to 300GHz.Enjoy!
Andreas Stiller
as@ct.heise.de
Englishized by: COLIN SNOVER
For more information on this and other Borland Pascal 7.0 patches, please visit <http://www.merlyn.demon.co.uk/pas-r200.htm>.
Yes, it’s my fault.