Source Code

The software and source code provided on this page is without warranty and provided "as is" for personal use. The user should use caution and run this software at their own risk. Resale or commerical use of these products is not permitted. The software and source code on this page were written as practice and is provided here only as sample programs for those who may find them useful. While I will accept comments, bug reports and suggestions but the software and source code is considered legacy and is not under any on going development or support. I would rather not hear any complaints about the software or source code as well being that first they are free and second they were never commerical products.

The quality of the source code will also vary from having good comments to having none and from being written OK to being written very poor. The majority of the source code is old and is only being released for educational purposes.

Random Number Generator
Year: 1996
Size: 1k
Language: Assembly
Operating System: DOS

A puesdo random number generator I wrote. I have commented the code extensively so it should be self explanatory!

WIN32 Assembly Plasma
Year: 2003
Size: 4k
Language: Assembly
Operating System: Windows

Messing around with Direct Draw, slow plasma.

Space Invaders
Year: 1997
Size: 15k
Language: C/Assembly
Operating System: DOS

Code to the DOS Space Invaders game under demos link. Compile and use the .PIC & .DAT files from that ZIP to run.

Weird
Year: 1995
Size: 18k/5k
Language: C++
Operating System: DOS/Linux

Code to the DOS Space Invaders game under demos link. Compile and use the .PIC & .DAT files from that ZIP to run.

A C++ Program that demonstrates how to violate classes. Just a joke program, not reccommended for real programming. It can be ported to other compilers, you just have to figure out if they have backdoors. Mainly, how do they set up their memory when the program is compiled.

Turbo C++ 3.0 DOS Version

g++ RedHat Linux Version

3D Wireframe Cube
Year: 1998
Size: 3k
Language: Assembly
Operating System: DOS

A 3D Rotating Cube on X, Y and Z axis. No Bounds checking so don't make it blow up off the screen. Scale it with +/-. Escape quits. Same program as under DEMOS, CUBE.COM, excpt this is the Unoptimzed version and is 1,173 bytes and not 899 bytes. This is a bit slower but they both rotate at a degree of 1. Requires 387 FPU.

Simple 3D Wire Frame Library
Year: 1998
Size: 14k
Language: Assembly
Operating System: DOS

Includes 3D.INC in which you can inlcude in your assembly programs to create & use Wire Frame 3D objects. Includes TEST3D.ASM sample on how to use 3D.INC. It supports World Coordinates, but not Camera Coordinates. No Bounds checking function, but you could easily add one to clip 2D Lines. Includes Rotation Functions, Line Drawing Function, 3D to 2D Projection Function, Scale Up/Down Functions and Draw Object Function.

Simple Compiler
Year: 2000
Size: 220k
Language: C
Operating System: DOS

Simple Computer Language Compiler. I wrote this for a class. It's a simple langauge compiler. Recursive descent compiler. TEST.IN is a demo of what code for this language looks like. There is 1 thing missing, it's there is no way to assign a character litteral, everything is string litterals so if you make a character you won't be able to assign. This is just something I forgot and I don't feel like fixing it, this source is considered obselete by me supporting anything in it. Also, there is a problem if you don't enter an input file and it prompts for one, the prompt is messed up that if you go to the end of the line and past, you can't backspace anymore. There's also some dead keyboard code that is not used. The download is big because it requires DOS4GW.EXE and the SCL exe included.

Chat Program
Year: 1998
Size: 4k
Language: C
Operating System: Windows

My first sockets program. This is a win32 console app. There are two files. One is the client and one is the server. This is basically a chat program. One person sets up the server and other people connect to it and they can chat. It's pretty crude, but it's my first sockets program.

Winpong
Year: 1998
Size: 7k
Language: Assembly
Operating System: Windows

This is source to my 4th Windows program, you can download the executable from the software page. This is just windows pong.

Multidesk
Year: 1999, 2000, 2001
Size: 7k
Language: Assembly, C
Operating System: Windows

This is all the source code available for MultiDesk, MultiDesk2k and Multidesk 2001. The original multidesk source code are in assembly. The first version was for TASM and then later ported to MASM. The final versions of multidesk are all in C.

API Replace
Year: 2001
Size: 2k
Language: C
Operating System: Windows

Simple demonstration library of replacing a function. This is a simple method, and assumes that the API is at least 6 bytes (For the Jump). This implementation does not support calling back into the original API, this is a complete replace, not exactly a hook. Any function can be replaced, Windows APIs or functions in your own program. For true hooking, you would need to have a dissassembler so you never cut an instruction boundry. This way you could call the original function using a jump after you execute the instructions you replaced.

VMWare Multiple Monitor Support (4.0)
Year: 2005
Size: N/A
Language: C
Operating System: Windows

This system demonstartes how to add multiple monitor support to VMWare. The source code and the article that goes with the source can be found on C/C++ Users Journal website for November 2005.

32 to 64 Bit Driver
Year: 2005
Size: N/A
Language: C/Assembly
Operating System: Windows

This driver demonstrates how to save the state in Windows 32 bit, then switch to 64 bit and run a 64 bit binary code sample. It will then switch back to 32 bit when finished. This is a joke on "Dos Extenders" in which previously 16 bit OSes running on 32 bit hardware had software which would then extend the platform for 32 bit applications. In this day though 32 bit OS running on 64 bit hardware there is no such thing as a 64 bit extender.

IRC v2.0 API
Year: 2001-2005
Size: N/A
Language: C
Operating System: Windows (Generic)

Though this source code has been written for Windows it could easily be ported to other Operating Systems. This is a generic IRC API with the basic set of commands supported. This API could be extended to implement more commands quite easily. The intent of this API was to create a simple abstraction so that a bot or IRC client could easily be written. There is an example shell for a Client or Bot also supplied. The IRC library itself actually uses another abstraction for network called "DTL Sockets". Underneath is uses the very basic sockets implementation however any network interface coudl be implemented including extending DTL to use more efficent APIs than the basic blocking sockets. This driver demonstrates how to save the state in Windows 32 bit, then switch to 64 bit and run a 64 bit binary code sample. It will then switch back to 32 bit when finished. This is a joke on "Dos Extenders" in which previously 16 bit OSes running on 32 bit hardware had software which would then extend the platform for 32 bit applications. In this day though 32 bit OS running on 64 bit hardware there is no such thing as a 64 bit extender.

2D Tile Engine
Year: 2003
Size: N/A
Language: C
Operating System: Windows (Generic)

Though this source code has been written for Windows it could easily be ported to other Operating Systems. This is a generic IRC API that allows you to specify a tile map and it will allow you to move in the specified map. The library is written so that it doesn't do the drawing, instead it will call your supplied callback and it will tell you which tile to draw and where to draw it. It will also calculate if clipping should occur on the tile.

GDI Library
Year: 2003
Size: N/A
Language: C
Operating System: Windows

This is a generic library that allows you to easily use and create double buffers for GDI applications. There are some small weird behaviors such as implementation use of critical sections in the paints that probably aren't nessecary but this is old code.

PCX Library
Year: 2003
Size: N/A
Language: C
Operating System: Windows

This is a generic library that allows you to load PCX files into your application to display. PCX files are simple to parse and were very popular in the 90s for use in home grown games as sprites.

Direct X Wrapper
Year: 2003
Size: N/A
Language: C
Operating System: Windows

This is a simple API wrapper around Direct Draw with essentially the same interface as the GDI Library above. The goal would be to have an application be written to use either or API sets with little or no change.

Simple OpenGL Example
Year: 2004
Size: N/A
Language: C
Operating System: Windows

This is a simple OpenGL graphics example. The code was written just as an experiment to get a little bit familar with OpenGL.

Network API
Year: 2004
Size: N/A
Language: C
Operating System: Windows

This API was implemented to enumerate network connections in relation to processes.

Sockets API
Year: 2004
Size: N/A
Language: C
Operating System: Windows

This is a generic sockets API that I had written for a project that I didn't finish. I do not know if this library actually works because I do not remember if I ever tested it. Here it is anyway for you to play around with.

Cubix
Year: 2002
Size: N/A
Language: C
Operating System: Windows

This is a direct draw demo that draws a cube on the screen. There is nothing special about this demo except it could be used as an example since it's very simple.

Cube
Year: 2004
Size: N/A
Language: Assembly
Operating System: Windows

This is a demo of drawing a cube in assembly in DirectX 8. The idea for this project was to attempt to get it to as small a file size as possible. This demo still does its own line drawing and treates DX8 as Direct Draw.

D3D Cube
Year: 2004
Size: N/A
Language: C
Operating System: Windows

This is a demo that uses Direct3D to draw a cube and will display an image on the side of the cube using D3D's texturemapping APIs. The file just needs to be named image.bmp and be in the same directory as the executable. This demo was written based on another example tutorial that was on the web.

Test Demo
Year: 2003
Size: N/A
Language: C
Operating System: Windows

This is a demo that performs various effects such as plasma, waving an image like a flag, lens effect (my own algorithm and attempt), rotating and cutting the image into pieces and finally flying the image around the screen in 3D space. This is provided here as example source code. There is also a sound library using the standard wave* APIs that can play sound in the background. There are various versions of the sources in there along with commented out code that does different effects. The images and sound can be replaced but they are included in the ZIP. If the demo is slow then there may be some changes that need to revert the speed back to a faster demo.



















Web site contents © Copyright Toby Opferman 1996-2007, All rights reserved.
Website templates