home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
D!Zone (Collector's Edition)
/
D_ZONE_CD.ISO
/
programs
/
editors
/
dhtk100
/
dhtk.txt
< prev
next >
Wrap
Text File
|
1994-12-06
|
28KB
|
783 lines
*****************************************************************************
* The DOOM Hacker's Tool Kit v1.00 *
*****************************************************************************
* Author: Joshua Jackson internet: joshjackson@delphi.com *
* Release Date: 5/25/94 *
* Language: Borland Pascal 7.0 (Mostly Object Oriented) *
* Destination Platform: DOS real mode -OR- DPMI DOS protected mode *
* *
* The DOOM Hacker's Tool Kit is a product of Jackson Software *
*****************************************************************************
Welcome fellow DOOM hacker!
I have released this source code in hopes that someone out there with a
bit more brains than I have can put it to good use. I am also making
a request that anyone willing to trade source code and ideas, please
email me at the above address. I am mostly interested in 3D rendering
code, but am looking for anything that is not contained in this tool kit,
or improves upon it.
I am also considering setting up a DOOM Hacker's BBS. If you are
interested in such a BBS, please let me know so. It will be setup on
a File Point system with no ratio required for Long Distance callers.
I would also accept UUENCODED source over the internet, which would
then be placed onto the BBS.
NOTE: This BBS would be for programs that include the SOURCE CODE only!
I will also have a section for technical FAQs and the like...
similiar to DMSPEC13.TXT
All Languages would be accepted.
This is a rather extensive set of utilities that I hacked up to access
just about everything in the WAD file. Resource utilities include:
Sprite Viewer
Map Viewer (With object recognition/sprite viewing)
Floor/Ceiling Texture Viewer
Wall Texture Viewier
Sound Player
Resource Extractor
Object Caching
In addition, I have also included the source code for the DOOM Front End
v1.31. The majority of the code here is written in Borland Pascal 7.0 and
is mostly geared toward OOP (Object Oriented Programming). There is also some
assembly language thrown into it here and there.
Comments, Suggestions, Bashing, and Questions are more than welcome!
(Please, don't write just to tell me that the code is not fully cleaned up!
I do realize that there are declared variables that aren't used and things
of that nature. This is because I wanted to get this program into your
hands as soon as possible, and that this code, even though its version 1.0,
has done some massive evolving since I first began construction of it. It
was originally written in staight pascal, no objects that is, and was VERY
pathetic! This tool kit has probably under gone several dozen revisions
since I begin the project about a month ago.)
Contacting me:
Internet: joshjackson@delphi.com
Snail Mail: Joshua Jackson
10506 Bayard Rd.
Minerva, OH 44657
Phone: (216) 868-1169
!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*
DISCLAIMER:
The author will not accept any resposibility for damage resulting from the
use of these programs, whether it be hardware, software, or mental.
COPYING/USE of this code:
All of the code in the DOOM Hacker's tool kit is placed in the public domain
with the exception of DFE. The DFE source has been released simply for
educational purposes only, I would appriciate if you would not modify and
release and versions of this program.
!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*
NOTE: If you plan to compile this tool kit under DPMI, you should use the
BGI256.BGI or BGI256.OBJ (for linking in the graphics driver). I
obtained these drivers off of the official Borland BBS. Most public
domain BGI drivers will cause a general protection fault under DPMI,
BGI256 is designed to be compatible.
Well, enough of that, lets get onto the part you probably are interested in
reading.
The following are descriptions of all of the Objects/Routines that are
contained in the WAD Hacker's Toolkit.
------------------------------------------------------------------------------
Unit: WADDECL.PAS
Purpose: Declarations Unit
There is not much to this unit, it is simply the type declarations for
many of the different structured variables in the tool kit... If you can't
understand this unit, you may want to stop here! :)
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Unit: WAD.PAS
Purpose: Accessing a WAD file's directory
This unit is the center of the tool kit. It contains an object that
loads a given WAD file's directory into memory. Almost all of the other units
rely on this unit for their access into the WAD files.
The object contained in this unit (TWadDirectory) MUST be initialized before
any other units can be initialized.
The following is a listing of the TWadDirectory object declaration:
type PWadDirectory=^TWadDirectory;
TWadDirectory=object
WadName :array[1..9] of char;
WadFile :file;
WadID :array[1..4] of char;
DirEntries :longint;
DirStart :longint;
DirEntry :PWADDirList;
Constructor Init(WadFileName:String);
Procedure DisplayWadDir;
Function FindObject(ObjName:ObjNameStr):word;
Procedure SetWadPalette(PlayPalNum:integer);
Procedure RestorePalette;
Destructor Done;
end;
When calling the init constructor, the only needed parameter is the path and
name of the WAD file that you wish to load. The following is an example
program that will load a WAD file directory:
uses Wad;
var WDir:PWadDirectory;
begin
{Initialize WAD file directory for DOOM.WAD}
WDir:=New(PWadDirectory, Init('C:\DOOM\DOOM.WAD'));
{Your code goes here}
{Dispose of the WAD file directory}
Dispose(WDir, Done);
end.
You will also notice that I included the call to the object's done destructor
when disposing of the object. This is mandatory unless you want a ton of
garbage left on the heap.
The other methods besides init and done are use mainly by the other units in
the tool kit. However, if you would like you implement them in your own
programs here is the syntax for them:
Function FindObject(ObjName:ObjNameStr):word
Returns the position in the directory array of the given object's name.
NOTE: you may use use the WildCard value of '?' for any or all letters in
the name if you want to do a "find first that matches" type search.
Procedure DisplayWadDir
displays the given WAD file's directory to the screen
Procedure SetWadPalette(PlayPalNum:integer);
Sets the current graphics palette to one of the 17 palettes available in
the WAD file. The main play palette is 0.
Procedure RestorePalette
Restores the current graphics palette to the original palette before the
first call to SetWadPalette
Finally, the variable fields in this object are defined as follows:
WadName :array[1..9] of char;
The ASCIIZ name of the WAD file that this object contains the directory to.
(NOTE: the .WAD extension is not included)
WadFile :file;
This file identifier used when accessing the WAD file. This field should
NEVER be altered.
WadID :array[1..4] of char;
Indicated if the loaded file is a 'PWAD' or an 'IWAD'
DirEntries :longint;
The number of directory entires contained in the WAD file.
DirStart :longint;
The file offset of the begining of the directory structure.
DirEntry :PWADDirList;
The directory entries themselves. The number of entries will vary
depending on the size of the WAD file.
NOTE: The number of entries in this array is always equal to DirEntries.
The structure for PWADDirList is contained in the WADDECL unit an