Site hosted by Angelfire.com: Build your free website today!

Mike's Pascal Corner

Email Mike

See Mike's Resume

See My Code

All files are compressed in ZIP format.

If you have any trouble using these programs please check the beginning of the main source code(*.pas) file. There will be instructions describing input. Please email me with a description of any problems not covered by the instructions.

If you have tried programs like "crackout", "breakout", "tetris" & "life". You may have recieved a "Run Time Error 200" when tring to run them. This was due to a problem with the "delay" procedure in the BP 7.0 "CRT" unit. This problem only shows up on systems with a Pentium II(TM) or better processor. I noticed it when I replaced my Socket 7 board and AMD K62(TM) processor with a 400MHZ Pentium II. For some reason the AMD processor did not have this problem. There are a variety of fixes for the crt unit. The fix I chose was T7TplFix.zip. All programs affected by this bug have been recompiled & should work correctly on your system. Please download & try them again.


First I have Crackout. Which is my first and only complete game. It is a simple brick breaking game in text mode. It uses the #pad keys for movement of the paddle. The code is a bit difficult to understand because this is one of my first programs.


Crackout



Breakout is next on my list. Same theme although much more advanced. Brakeout is more modular in its design. It uses functions & procedures from various libraries including mikegraf, mikekey, dstruct & mouse. The real bonus is that it is in graphics mode rather than text

Mikegraf is a simple VGA 320x200x256 graphics unit. It is a combo of pascal & in-line assembler. The assembly code is mostly 16 bit. There are a few 32 bit operations used to gain some extra speed, because of the 32 bit operations the Mikegraf unit will only function properly on 80386 or better processors.

Mikekey is a simple keyboard unit written in in-line assembler & pascal. It uses BIOS INT 16Hex. It does not recognize all keys on the keyboard, but it does allow easy use of more keys than the "crt" unit that comes with BP 7.0.

Dstruct sounds dangerous but is actually just a unit for handling dynamic structures like arrays & lists. Last I checked it does not contain any in-line assembler code so it should be quite portable to other compilers like free pascal. ***Note this unit should be used with caution because very little error checking is done when allocating & freeing memory.

Mouse is a unit I picked up quite a while ago. It was not written by me & unfortunately the documentation mouse.txt does not make any reference to who the author is. As soon as I discover the illusive author of the unit I will credit them appropriately. This version contains a few of my own modifications. I had to fix a problem which prevented the unit from reporting the state of the mouse buttons. I also added a few procedures which one may find useful. It consists of 16 bit in-line assembler using INT 33Hex & pascal routines.


Breakout




Tetris is a classic so I had to try making my own. It's incomplete but playable.


Tetris




We must not forget the game of Life. This is a quite funcitonal version. It contains an editor and the ability to save and load your favorite experiments. This program contains some inline assembler code.


Life




Fractal Trees are fun. This program was originally written using Free Pascal. I have included both a Free Pascal & Borland Pascal compileable versions. It is designed to produce both static & random fractal trees. There is a crude but functional editor which should allow one to create their own trees. Also one can save and load their favorite creations.


This program uses a new unit called gtext which handles simple tty functions for text output & input when using the graph unit.


Trees




Last & definatley not least we have my 3D Editor. It is a simple editor designed to define 3D forms & connect them together into complex poseable objects. I have included quite a few objects for you to play with. All objects can be identified by the ".oid"(short for Noid) extension.

Recently I fixed a huge memory leak in the editor and also added simple flat shading with a single light source(it's not pretty, but it works). At the moment the user cannot change the light source position. One will notice that the light source is coming from the user.

We have a few new units used by this program.


First is basetype which defines basic data structures which quite a few of my units depend uppon.

Next is matrix which contains math functions for both 2D & 3D matricies.

Vector which contains math functions for 2D & 3D vectors.

Mikepal which contains functions for manipulating VGA256 palletes. I use the wait_for_(vertical)retrace function to try and reduce flicker although it does not appear to be helping.

Finally bnchdiag which contains a function to report FPS(frames per second) and two procedures used to verify that there are no memory leaks.


3D Editor

 

I have a new treat for 3D fiends. Hopefully it will satisfy their hunger. It just so happens to be a delicious attempt at 3D Breakout. One will notice many similaritys to my 2D version of breakout, but it will eventually mature into more of an Arknoid style of game. Perhaps multiplayer.

On to the new unit.

Timer is a unit for controlling the PIT. It has a delay procedure as well as the ability to create many individual alarms for accurately timing whatever. I used it to try and keep the game at a max of 30 FPS. Timer works rather well on Pentium class computers although my 486 took a speed hit when I tried to use it. I have almost compleated an ASM version of the timer handler (which should eliminate the problem) all except for a few 32 bit instructions which I have been too lazy to look up.

The code for Timer was initially barrowed from a document titled "Programming the Intel 8253 Programmable Interval Timer" Written for the PC-GPE(PC Game Programmer's Encyclopedia) by Mark Feldman. Very informative. The filename that I found was named "PIT.TXT".

3D Breakout

Last Update: July 22, 2003 17:39