TV tenis - the PONG remake

Datasheet
Written By: Jozsef Laszlo
Status: Done, tested with DOS, WinXP, DosBOX
Purpose: FUN, Education
Legal: Free, Open Source
Target OS: DOS, real mode
Development system: Borland Pascal 7.0, using ASSEMBLY functions/procedures
Runs on Windows XP? YES
Runs in DosBox? YES (just fine)
Video: VGA, standard 640x480x16 planar graphics video mode
Sound: Speaker only
  • Source is commented party in English and party in Hungarian
  • No WARRANTY! Use it as is. I am not responsible for anything.
Controls: Left player: Q - Z
Right player: numpad-9 - numpad-3
Start ball: SPACE
Stick size: F1
Speed: F2
Angle: F3
Sound: F4
GameType: F5
Reset: F6
Auto ball: F7
Handicap: F10

Description

This game is really just a tribute to the first video game, the PONG. Well, I don't know if this was the first in time, at least it was the first I played with. That time the game was black and white. In this program I used the standard VGA mode, the old 640x480 with only 16 colors. The technic is simple. This videomode uses bitplanes to store the pixels. There are four bitplanes (each is 640x480, where a byte contains 8 pixels, so it's a 80x480 bytes memory array), and the 16 possible variation is built by the same bits of the bitplanes.

Because the PONG game only uses 4 colors, I implemented a trick in this game: each different moving object uses a different plane, so they don't bother each other. For example, the sticks for the first player are on the first bitplane, while the sticks for the second player are on the second bitplane. Setting up the palette makes sure, that the colors are good when two moving objects are in the same place. This does not happen though, the only one case when two objects are in the same place is when the ball bounces back from the stick.

The source code contains some comments, both in Hungarian and English. The entire application is really simple though, so if you know the VGA registers, it will not be a problem to read the source. Enjoy!

Joco


Screenshot


Downloads