mirror of
https://github.com/Blzut3/Wolf3D-Mac.git
synced 2024-12-21 15:29:26 +00:00
The Macintosh Wolfenstein 3D as released.
This commit is contained in:
commit
4ff692cf2a
1
Burger.h
Normal file
1
Burger.h
Normal file
@ -0,0 +1 @@
|
||||
typedef unsigned int Word;
typedef unsigned long LongWord;
#ifndef __MACTYPES__
typedef unsigned char Byte;
typedef unsigned char Boolean;
#endif
#define BLACK 255
#define DARKGREY 250
#define BROWN 101
#define PURPLE 133
#define BLUE 210
#define DARKGREEN 229
#define ORANGE 23
#define RED 216
#define BEIGE 14
#define YELLOW 5
#define GREEN 225
#define LIGHTBLUE 150
#define LILAC 48
#define PERIWINKLE 120
#define LIGHTGREY 43
#define WHITE 0
#define __MAC__
#define __BIGENDIAN__
#define SfxActive 1
#define MusicActive 2
#define VideoSize 64000
#define SetAuxType(x,y)
#define SetFileType(x,y)
extern unsigned char *VideoPointer;
extern Word KeyModifiers;
extern Word ScanCode;
extern Word KilledSong;
extern Word SystemState;
extern Word VideoWidth;
extern LongWord LastTick;
extern LongWord YTable[480];
extern Handle RezHandle;
void DLZSS(Byte *Dest, Byte *Src,LongWord Length);
void DLZB(Byte *Dest, Byte *Src,LongWord Length);
LongWord SwapLong(LongWord Val);
unsigned short SwapUShort(unsigned short Val);
short SwapShort(short Val);
void WaitTick(void);
void WaitTicks(Word TickCount);
Word WaitTicksEvent(Word TickCount);
Word WaitEvent(void);
LongWord ReadTick(void);
void *AllocSomeMem(LongWord Size);
void FreeSomeMem(void *MemPtr);
Word GetAKey(void);
Word AllKeysUp(void);
Word WaitKey(void);
void FlushKeys(void);
Word FixMacKey(EventRecord *MyRecord);
void SoundOff(void);
void PlaySound(Word SndNum);
void StopSound(Word SndNum);
void PlaySong(Word SongNum);
void ClearTheScreen(Word Color);
void ShowPic(Word PicNum);
void InitYTable(void);
void InstallAFont(Word FontNum);
void FontUseMask(void);
void FontUseZero(void);
void SetFontXY(Word x,Word y);
void FontSetColor(Word Index,Word Color);
void DrawAString(char *TextPtr);
void DrawAChar(Word Letter);
void ultoa(LongWord Val,char *TextPtr);
Word GetRandom(Word Range);
void Randomize(void);
void DrawShape(Word x,Word y,void *ShapePtr);
void DrawXMShape(Word x,Word y,void *ShapePtr);
void DrawMShape(Word x,Word y,void *ShapePtr);
void EraseMBShape(Word x,Word y, void *ShapePtr,void *BackPtr);
Word TestMShape(Word x,Word y,void *ShapePtr);
Word TestMBShape(Word x,Word y,void *ShapePtr,void *BackPtr);
void SetAPalette(Word PalNum);
void SetAPalettePtr(unsigned char *PalPtr);
void FadeTo(Word PalNum);
void FadeToBlack(void);
void FadeToPtr(unsigned char *PalPtr);
void *LoadAResource(Word RezNum);
void ReleaseAResource(Word RezNum);
void KillAResource(Word RezNum);
void *LoadAResource2(Word RezNum,LongWord Type);
void ReleaseAResource2(Word RezNum,LongWord Type);
void KillAResource2(Word RezNum,LongWord Type);
void SaveJunk(void *AckPtr,Word Length);
|
1
HideMenuBar.c
Normal file
1
HideMenuBar.c
Normal file
@ -0,0 +1 @@
|
||||
#include "hidemenubar.h"
static Boolean MenuBarHidden = FALSE; /* Current state of the menu bar. */
static Rect OldeMBarRect; /* Saves rectangle enclosing real menu bar. */
static RgnHandle OldeGrayRgn; /* Saves the region defining the desktop */
static short OldMBarHeight; /* Previous menu bar height */
extern GDHandle gMainGDH;
/********************************
Hide the menu bar (If visible)
********************************/
void HideMenuBar(void)
{
RgnHandle menuRgn;
WindowPeek theWindow;
GDHandle TempHand;
TempHand = GetMainDevice();
if (TempHand!=gMainGDH) { /* Main graphics handle */
return;
}
if (!MenuBarHidden) { /* Already hidden? */
OldMBarHeight = LMGetMBarHeight(); /* Get the height in pixels */
OldeGrayRgn = NewRgn(); /* Make a new region */
CopyRgn(GetGrayRgn(), OldeGrayRgn); /* Copy the background region */
OldeMBarRect = qd.screenBits.bounds; /* Make a region from the rect or the monitor width */
OldeMBarRect.bottom = OldeMBarRect.top + OldMBarHeight; /* Top to bottom of menu */
menuRgn = NewRgn(); /* Convert to region */
RectRgn(menuRgn, &OldeMBarRect);
UnionRgn(GetGrayRgn(), menuRgn, GetGrayRgn()); /* Add the menu area to background */
theWindow = (WindowPeek)FrontWindow();
PaintOne((WindowPtr)theWindow, menuRgn); /* Redraw the front window */
PaintBehind((WindowPtr)theWindow, menuRgn); /* Redraw all other windows */
CalcVis((WindowPtr)theWindow); /* Resize the visible region */
CalcVisBehind((WindowPtr)theWindow, menuRgn); /* Resize the visible regions for all others */
DisposeRgn(menuRgn); /* Release the menu region */
MenuBarHidden = TRUE; /* It is now hidden */
ZapMHeight(); /* Zap the height */
}
}
/********************************
Show the menu bar (If hidden)
********************************/
void ShowMenuBar(void)
{
WindowPeek theWindow;
if (MenuBarHidden) { /* Hidden? */
FixMHeight();
MenuBarHidden = FALSE; /* The bar is here */
CopyRgn(OldeGrayRgn, GetGrayRgn()); /* Get the region */
RectRgn(OldeGrayRgn, &OldeMBarRect); /* Convert menu rect to region */
theWindow = (WindowPeek)FrontWindow(); /* Get the front window */
CalcVis((WindowPtr)theWindow); /* Reset the visible region */
CalcVisBehind((WindowPtr)theWindow,OldeGrayRgn); /* Remove the menu bar from windows */
DisposeRgn(OldeGrayRgn); /* Bye bye region */
OldeGrayRgn = 0; /* Zap the handle */
HiliteMenu(0); /* Don't hilite any menu options */
DrawMenuBar(); /* Redraw the menu bar */
}
}
/********************************
Restore the menu bar height so that
the OS can handle menu bar events
********************************/
void FixMHeight(void)
{
if (MenuBarHidden) { /* Hidden? */
LMSetMBarHeight(OldMBarHeight); /* Reset the height */
}
}
/********************************
Zap the menu bar height so that things
like MenuClock won't draw
********************************/
void ZapMHeight(void)
{
if (MenuBarHidden) { /* Hidden? */
LMSetMBarHeight(0); /* Zap the height */
}
}
|
1
HideMenuBar.h
Normal file
1
HideMenuBar.h
Normal file
@ -0,0 +1 @@
|
||||
extern void HideMenuBar(void);
extern void ShowMenuBar(void);
extern void FixMHeight(void);
extern void ZapMHeight(void);
|
1
InterMis.c
Normal file
1
InterMis.c
Normal file
File diff suppressed because one or more lines are too long
1
Intro.c
Normal file
1
Intro.c
Normal file
@ -0,0 +1 @@
|
||||
#include "wolfdef.h"
#include <ctype.h>
#include <stdlib.h>
/**********************************
Main game introduction
**********************************/
void Intro(void)
{
LongWord *PackPtr;
LongWord PackLength;
Byte *ShapePtr;
NewGameWindow(1); /* Set to 512 mode */
FadeToBlack(); /* Fade out the video */
PackPtr = LoadAResource(rMacPlayPic);
PackLength = PackPtr[0];
ShapePtr = AllocSomeMem(PackLength);
DLZSS(ShapePtr,(Byte *) &PackPtr[1],PackLength);
DrawShape(0,0,ShapePtr);
FreeSomeMem(ShapePtr);
ReleaseAResource(rMacPlayPic);
BlastScreen();
StartSong(SongListPtr[0]); /* Play the song */
FadeTo(rMacPlayPal); /* Fade in the picture */
WaitTicksEvent(240); /* Wait for event */
FadeTo(rIdLogoPal);
if (toupper(WaitTicksEvent(240))=='B') { /* Wait for event */
FadeToBlack();
ClearTheScreen(BLACK);
BlastScreen();
PackPtr = LoadAResource(rYummyPic);
PackLength = PackPtr[0];
ShapePtr = AllocSomeMem(PackLength);
DLZSS(ShapePtr,(Byte *) &PackPtr[1],PackLength);
DrawShape((SCREENWIDTH-320)/2,(SCREENHEIGHT-200)/2,ShapePtr);
FreeSomeMem(ShapePtr);
ReleaseAResource(rYummyPic);
BlastScreen();
FadeTo(rYummyPal);
WaitTicksEvent(600);
}
}
|
BIN
MWPPCSoundMusicSystem(rev3).lib
Normal file
BIN
MWPPCSoundMusicSystem(rev3).lib
Normal file
Binary file not shown.
0
MWSoundMusicSystem(rev3).lib
Normal file
0
MWSoundMusicSystem(rev3).lib
Normal file
1
Missiles.c
Normal file
1
Missiles.c
Normal file
File diff suppressed because one or more lines are too long
1
Music.c
Normal file
1
Music.c
Normal file
@ -0,0 +1 @@
|
||||
#include "Wolfdef.h"
/**********************************
Stop the current song from playing
**********************************/
void StopSong(void)
{
PlaySong(0);
}
/**********************************
Play a new song
**********************************/
void StartSong(Word songnum)
{
PlaySong(songnum); /* Stop the previous song (If any) */
}
|
1
PickAMonitor.c
Normal file
1
PickAMonitor.c
Normal file
File diff suppressed because one or more lines are too long
1
PickAMonitor.h
Normal file
1
PickAMonitor.h
Normal file
@ -0,0 +1 @@
|
||||
extern void CenterWindowOnMonitor(WindowPtr theWindow, GDHandle theMonitor);
extern Boolean SupportsColor(GDHandle theMonitor);
extern short SupportsDepth(GDHandle theMonitor, int theDepth, Boolean needsColor);
extern Boolean SupportsSize(GDHandle theMonitor, short theWidth, short theHeight);
extern GDHandle MonitorFromPoint(Point *thePoint);
extern GDHandle PickAMonitor(int bitDepth, Boolean colorRequired, short minWidth, short minHeight);
extern Boolean WaitNextEvent2(short EventMask,EventRecord *theEvent,long sleep,RgnHandle mouseRgn);
|
1
Prefs.h
Normal file
1
Prefs.h
Normal file
@ -0,0 +1 @@
|
||||
void InitPrefsFile(OSType creator,Byte *PrefsName);
OSErr LoadPrefsFile(Byte *PrefsPtr,Word PrefsLen);
OSErr SavePrefsFile(Byte *PrefsPtr,Word PrefsLen);
|
1
PrefsFile.c
Normal file
1
PrefsFile.c
Normal file
File diff suppressed because one or more lines are too long
1
PushWall.c
Normal file
1
PushWall.c
Normal file
@ -0,0 +1 @@
|
||||
#include "wolfdef.h"
#define PWALLSPEED 4 /* Micropixels per 60th of a second */
pushwall_t PushWallRec; /* Record for the single pushwall in progress */
/**********************************
Set pwallychange and pwallxchange
Uses pwallpos,pwalldir
**********************************/
void SetPWallChange(void)
{
Word pos;
pos = PushWallRec.pwallpos&(FRACUNIT-1); /* Get the pixel fraction */
PushWallRec.pwallxchange = 0; /* No motion yet */
PushWallRec.pwallychange = 0;
switch (PushWallRec.pwalldir) { /* Which way? */
case CD_NORTH:
PushWallRec.pwallychange = -pos; /* Y motion */
return;
case CD_EAST:
PushWallRec.pwallxchange = pos; /* X motion */
return;
case CD_SOUTH:
PushWallRec.pwallychange = pos; /* Y motion */
return;
case CD_WEST:
PushWallRec.pwallxchange = -pos; /* X motion */
}
}
/**********************************
Marks the dest tile as blocked and begins a push wall sequence
Uses pwallx,pwally,pwalldir
**********************************/
void PushWallOne(void)
{
PushWallRec.pwallcheckx = PushWallRec.pwallx;
PushWallRec.pwallchecky = PushWallRec.pwally;
switch (PushWallRec.pwalldir) {
case CD_NORTH:
PushWallRec.pwallchecky--;
break;
case CD_EAST:
PushWallRec.pwallcheckx++;
break;
case CD_SOUTH:
PushWallRec.pwallchecky++;
break;
case CD_WEST:
PushWallRec.pwallcheckx--;
}
tilemap[PushWallRec.pwallchecky][PushWallRec.pwallcheckx] |= TI_BLOCKMOVE | TI_BLOCKSIGHT;
StartPushWall(); /* let the refresh do some junk*/
}
/**********************************
Initiate a pushwall sequence
Call with x,y,dir of wall to push
**********************************/
void PushWall(Word x,Word y,Word dir)
{
PlaySound(SND_PWALL); /* Play the wall sound */
PushWallRec.pwallx = x; /* Save the x,y in my globals */
PushWallRec.pwally = y;
PushWallRec.pwalldir = dir; /* Save the wall direction */
PushWallOne(); /* Initiate the animation */
PushWallRec.pwallcount = 2; /* Move two cells */
++gamestate.secretcount; /* Secret area found */
PushWallRec.pwallpos = PWALLSPEED/2; /* Begin the move */
/* mark the segs that are being moved */
tilemap[y][x] &= ~TI_PUSHWALL; /* Clear the pushwall bit */
SetPWallChange(); /* Set pwallchange */
}
/**********************************
Continue any pushwall animations, called by the main loop
**********************************/
void MovePWalls (void)
{
if (!PushWallRec.pwallcount) { /* Any walls to push? */
return; /* Nope, get out */
}
PushWallRec.pwallpos += PWALLSPEED*TicCount; /* Move the wall a little */
SetPWallChange(); /* Set the wall for the renderer */
if (PushWallRec.pwallpos<256) { /* Crossed a tile yet? */
return; /* Exit now */
}
PushWallRec.pwallpos -= 256; /* Mark as crossed */
/* the tile can now be walked into */
tilemap[PushWallRec.pwally][PushWallRec.pwallx] &= ~TI_BLOCKMOVE; /* The movable block is gone */
AdvancePushWall(); /* Remove the bsp seg */
if (!--PushWallRec.pwallcount) { /* Been pushed 2 blocks?*/
StopSound(SND_PWALL); /* Play the wall sound */
PlaySound(SND_PWALL2); /* Play the wall stop sound */
return; /* Don't do this anymore! */
}
PushWallRec.pwallx = PushWallRec.pwallcheckx; /* Set the tile to the next cell */
PushWallRec.pwally = PushWallRec.pwallchecky;
PushWallOne(); /* Push one more record */
}
|
1
ReadMe.txt
Normal file
1
ReadMe.txt
Normal file
@ -0,0 +1 @@
|
||||
History of Wolfenstein 3D: First & Second Encounter
Programming and Project Lead: Bill Heineman
Additional programming: Chris DeSalvo
Producer: Bill Dugan
Wolfenstein 3D for MacOS was released on October 1st, 1994 by Interplay Productions under license from id software. The code was based not on the PC version but of a Super NES version that was done at id software. This version of the game differs greatly from the PC version since it used BSP trees to help determine which walls were to be drawn instead of the ray-casting method.
The fixed point number system was 8.8 format so that it could fit in a 65816 register for the SNES and Apple IIgs version of Wolf 3D. (8 bits of integer and 8 bits of fraction)
The mac version also has two modes of drawing. In the 68000 version, 68000 code is generated at runtime to draw the vertical lines very quickly. The source file SetupScalers68k.c creates the 68000 code and then issues calls to it via a little 68000 assembly glue code. This is how the game got its speed. The powerpc version originally had this method as well but the performance sucked. So it was changed to a simple assembly loop and the game ran fine. This is why there is SetupScalersPPC.c and SetupScalers68k.c.
I took the code from Codewarrion DR/4 which was the development system at the time and updated the project to Codewarrior PRO 5 (Which is what I use today). I've compiled, tested and ran the game and the code runs fine. The sound code is copyright Steve Hales and Jim Nitchals. You cannot use the music driver in your own programs unless you get a license from Steve Hales. (Jim Nitchals sadly has passed on, may he rest in peace).
Yes, there is a level editor that I wrote. It sucks. I suggest you get WolfEdit that is available on the web from WolfAddict software instead. It doesn't suck.
Here it is 1/21/2000. Over 5 years since I did the mac version of Wolf 3D. Seems like yesterday. I hope you enjoy looking over this code and making little changes for your own pleasure and learning. If someone makes any improvements to this code like adding Sprocket support or GL support, please send me the new source. I can be found at burger@logicware.com
I want to thank those who helped make this project a reality. John Carmack, Jay Wilbur, John Romero, Brian Luzietti and my wife Lorenza.
Bill Heineman
Logicware Inc.
20628 E. Arrow Hwy. #6
burger@logicware.com
|
1
RefSprite.c
Normal file
1
RefSprite.c
Normal file
File diff suppressed because one or more lines are too long
1
Refresh2.c
Normal file
1
Refresh2.c
Normal file
File diff suppressed because one or more lines are too long
1
SetupScalers68k.c
Normal file
1
SetupScalers68k.c
Normal file
@ -0,0 +1 @@
|
||||
#include "WolfDef.h"
#include <string.h>
#include <stdlib.h>
LongWord ScaleDiv[2048];
/**********************************
Create the compiled scalers
**********************************/
Boolean SetupScalers(void)
{
Word i;
if (!ScaleDiv[1]) { /* Divide table inited already? */
i = 1;
do {
ScaleDiv[i] = 0x400000UL/(LongWord)i; /* Get the recipocal for the scaler */
} while (++i<2048);
}
MaxScaler = 2048;
return TRUE;
}
void ReleaseScalers(void)
{
}
/**********************************
Draw a vertical line with a scaler
(Used for WALL drawing)
**********************************/
void ScaleGlue(void *a,LongWord scale,void *c,LongWord d,LongWord e,LongWord f,LongWord g);
#if 0
void IO_ScaleWallColumn(Word x,Word scale,LongWord column)
{
LongWord TheFrac;
LongWord TheInt;
LongWord y;
Byte *ArtStart;
if (scale) { /* Uhh.. Don't bother */
TheFrac = ScaleDiv[scale];
scale*=2;
ArtStart = &ArtData[(column>>7)&0x3f][(column&127)<<7];
if (scale<VIEWHEIGHT) {
y = (VIEWHEIGHT-scale)/2;
TheInt = TheFrac>>24;
TheFrac <<= 8;
ScaleGlue(ArtStart,scale,
&VideoPointer[(y*VideoWidth)+x],
TheFrac,
TheInt,
VideoWidth,
0
);
return;
}
y = (scale-VIEWHEIGHT)/2; /* How manu lines to remove */
y = y*TheFrac;
TheInt = TheFrac>>24;
TheFrac <<= 8L;
ScaleGlue(&ArtStart[y>>24L],VIEWHEIGHT,
&VideoPointer[x],
TheFrac,
TheInt,
VideoWidth,
y<<8L
);
}
}
#endif
/**********************************
Draw a vertical line with a masked scaler
(Used for SPRITE drawing)
**********************************/
typedef struct {
unsigned short Topy;
unsigned short Boty;
unsigned short Shape;
} SpriteRun;
void SpriteGlue(Byte *a,LongWord b,Byte *c,Word d,Word e);
/*
SGArtStart EQU A0 ;Pointer to the 6 byte run structure
SGFrac EQU D2 ;Pointer to the scaler
SGInteger EQU D3 ;Pointer to the video
SGScreenPtr EQU A1 ;Pointer to the run base address
SGCount EQU D6
SGDelta EQU D4
*/
void IO_ScaleMaskedColumn(Word x,Word scale,unsigned short *CharPtr,Word column)
{
Byte * CharPtr2;
int Y1,Y2;
Byte *Screenad;
SpriteRun *RunPtr;
LongWord TheFrac;
Word RunCount;
Word TopY;
Word Index;
LongWord Delta;
if (!scale) {
return;
}
CharPtr2 = (Byte *) CharPtr;
TheFrac = ScaleDiv[scale]; /* Get the scale fraction */
RunPtr = (SpriteRun *) &CharPtr[CharPtr[column+1]/2]; /* Get the offset to the RunPtr data */
Screenad = &VideoPointer[x]; /* Set the base screen address */;
TopY = (VIEWHEIGHT/2)-scale; /* Number of pixels for 128 pixel shape */
while (RunPtr->Topy != (unsigned short) -1) { /* Not end of record? */
Y1 = (LongWord)scale*RunPtr->Topy/128+TopY;
if (Y1<(int)VIEWHEIGHT) { /* Clip top? */
Y2 = (LongWord)scale*RunPtr->Boty/128+TopY;
if (Y2>0) {
if (Y2>(int)VIEWHEIGHT) {
Y2 = VIEWHEIGHT;
}
Index = RunPtr->Shape+(RunPtr->Topy/2);
Delta = 0;
if (Y1<0) {
Delta = (LongWord)(0-Y1)*TheFrac;
Index += (Delta>>16);
Y1 = 0;
}
RunCount = Y2-Y1; /* How many lines to draw?*/
if (RunCount) {
SpriteGlue(
&CharPtr2[Index], /* Pointer to art data */
TheFrac, /* Fixed point fractional value */
&Screenad[YTable[Y1]], /* Pointer to screen */
RunCount, /* Number of lines to draw */
Delta /* Delta value */
);
}
}
}
RunPtr++; /* Next record */
}
}
/**********************************
Draw an automap tile
**********************************/
Byte *SmallFontPtr;
void DrawSmall(Word x,Word y,Word tile)
{
Byte *Screenad;
Byte *ArtStart;
Word Width,Height;
if (!SmallFontPtr) {
return;
}
x*=16;
y*=16;
Screenad = &VideoPointer[YTable[y]+x];
ArtStart = &SmallFontPtr[tile*(16*16)];
Height = 0;
do {
Width = 16;
do {
Screenad[0] = ArtStart[0];
++Screenad;
++ArtStart;
} while (--Width);
Screenad+=VideoWidth-16;
} while (++Height<16);
}
void MakeSmallFont(void)
{
Word i,j,Width,Height;
Byte *DestPtr,*ArtStart;
Byte *TempPtr;
SmallFontPtr = AllocSomeMem(16*16*65);
if (!SmallFontPtr) {
return;
}
memset(SmallFontPtr,0,16*16*65); /* Erase the font */
i = 0;
DestPtr = SmallFontPtr;
do {
ArtStart = &ArtData[i][0];
if (!ArtStart) {
DestPtr+=(16*16);
} else {
Height = 0;
do {
Width = 16;
j = Height*8;
do {
DestPtr[0] = ArtStart[j];
++DestPtr;
j+=(WALLHEIGHT*8);
} while (--Width);
} while (++Height<16);
}
} while (++i<64);
TempPtr = LoadAResource(MyBJFace);
memcpy(DestPtr,TempPtr,16*16);
ReleaseAResource(MyBJFace);
}
void KillSmallFont(void)
{
if (SmallFontPtr) {
FreeSomeMem(SmallFontPtr);
SmallFontPtr=0;
}
}
|
1
SetupScalersPPC.c
Normal file
1
SetupScalersPPC.c
Normal file
File diff suppressed because one or more lines are too long
1
SnesMain.c
Normal file
1
SnesMain.c
Normal file
@ -0,0 +1 @@
|
||||
#include "WolfDef.h"
#include <string.h>
#include <stdlib.h>
#include <setjmp.h>
#include <ctype.h>
/**********************************
Prepare the screen for game
**********************************/
void SetupPlayScreen (void)
{
SetAPalette(rBlackPal); /* Force black palette */
ClearTheScreen(BLACK); /* Clear the screen to black */
BlastScreen();
firstframe = 1; /* fade in after drawing first frame */
GameViewSize = NewGameWindow(GameViewSize);
}
/**********************************
Display the automap
**********************************/
void RunAutoMap(void)
{
Word vx,vy;
Word Width,Height;
Word CenterX,CenterY;
Word oldjoy,newjoy;
MakeSmallFont(); /* Make the tiny font */
playstate = EX_AUTOMAP;
vx = viewx>>8; /* Get my center x,y */
vy = viewy>>8;
Width = (SCREENWIDTH/16); /* Width of map in tiles */
Height = (VIEWHEIGHT/16); /* Height of map in tiles */
CenterX = Width/2;
CenterY = Height/2;
if (vx>=CenterX) {
vx -= CenterX;
} else {
vx = 0;
}
if (vy>=CenterY) {
vy -= CenterY;
} else {
vy = 0;
}
oldjoy = joystick1;
do {
ClearTheScreen(BLACK);
DrawAutomap(vx,vy);
do {
ReadSystemJoystick();
} while (joystick1==oldjoy);
oldjoy &= joystick1;
newjoy = joystick1 ^ oldjoy;
if (newjoy & (JOYPAD_START|JOYPAD_SELECT|JOYPAD_A|JOYPAD_B|JOYPAD_X|JOYPAD_Y)) {
playstate = EX_STILLPLAYING;
}
if (newjoy & JOYPAD_UP && vy) {
--vy;
}
if (newjoy & JOYPAD_LFT && vx) {
--vx;
}
if (newjoy & JOYPAD_RGT && vx<(MAPSIZE-1)) {
++vx;
}
if (newjoy & JOYPAD_DN && vy <(MAPSIZE-1)) {
++vy;
}
} while (playstate==EX_AUTOMAP);
playstate = EX_STILLPLAYING;
/* let the player scroll around until the start button is pressed again */
KillSmallFont(); /* Release the tiny font */
RedrawStatusBar();
ReadSystemJoystick();
mousex = 0;
mousey = 0;
mouseturn = 0;
}
/**********************************
Begin a new game
**********************************/
void StartGame(void)
{
if (playstate!=EX_LOADGAME) { /* Variables already preset */
NewGame(); /* init basic game stuff */
}
SetupPlayScreen();
GameLoop(); /* Play the game */
StopSong(); /* Make SURE music is off */
}
/**********************************
Show the game logo
**********************************/
Boolean TitleScreen (void)
{
Word RetVal; /* Value to return */
LongWord PackLen;
LongWord *PackPtr;
Byte *ShapePtr;
playstate = EX_LIMBO; /* Game is not in progress */
NewGameWindow(1); /* Set to 512 mode */
FadeToBlack(); /* Fade out the video */
PackPtr = LoadAResource(rTitlePic);
PackLen = PackPtr[0];
ShapePtr = (Byte *)AllocSomeMem(PackLen);
DLZSS(ShapePtr,(Byte *) &PackPtr[1],PackLen);
DrawShape(0,0,ShapePtr);
ReleaseAResource(rTitlePic);
FreeSomeMem(ShapePtr);
BlastScreen();
StartSong(SongListPtr[0]);
FadeTo(rTitlePal); /* Fade in the picture */
BlastScreen();
RetVal = WaitTicksEvent(0); /* Wait for event */
playstate = EX_COMPLETED;
return TRUE; /* Return True if canceled */
}
/**********************************
Main entry point for the game (Called after InitTools)
**********************************/
jmp_buf ResetJmp;
Boolean JumpOK;
extern Word NumberIndex;
void main(void)
{
InitTools(); /* Init the system environment */
WaitTick(); /* Wait for a system tick to go by */
playstate = (exit_t)setjmp(ResetJmp);
NumberIndex = 36; /* Force the score to redraw properly */
IntermissionHack = FALSE;
if (playstate) {
goto DoGame; /* Begin a new game or saved game */
}
JumpOK = TRUE; /* Jump vector is VALID */
FlushKeys(); /* Allow a system event */
Intro(); /* Do the game intro */
for (;;) {
if (TitleScreen()) { /* Show the game logo */
StartSong(SongListPtr[0]);
ClearTheScreen(BLACK); /* Blank out the title page */
BlastScreen();
SetAPalette(rBlackPal);
if (ChooseGameDiff()) { /* Choose your difficulty */
playstate = EX_NEWGAME; /* Start a new game */
DoGame:
FadeToBlack(); /* Fade the screen */
StartGame(); /* Play the game */
}
}
}
}
|
1
SoundMusicSystem.h
Normal file
1
SoundMusicSystem.h
Normal file
File diff suppressed because one or more lines are too long
1
Sounds.h
Normal file
1
Sounds.h
Normal file
@ -0,0 +1 @@
|
||||
/* generated by sndlink.exe */
enum {
SND_NOSOUND,
SND_THROWSWITCH, /* Throw end level switch */
SND_GETKEY, /* Pick up a key */
SND_BONUS, /* Score ding */
SND_OPENDOOR, /* Open a door */
SND_DOGBARK, /* Dog bite */
SND_DOGDIE, /* Dog die */
SND_ESEE, /* Ahtung! */
SND_ESEE2, /* Halt! */
SND_EDIE, /* Nazi died */
SND_EDIE2, /* Nazi died 2 */
SND_BODYFALL, /* Body hit the ground */
SND_PAIN, /* Hit bad guy */
SND_GETAMMO, /* Pick up ammo */
SND_KNIFE, /* Knife attack */
SND_GUNSHT, /* 45 Shoot */
SND_MGUN, /* Sub machine gun */
SND_CHAIN, /* Chain gun */
SND_FTHROW, /* Flame thrower */
SND_ROCKET, /* Rocket launcher */
SND_PWALL, /* Start pushwall */
SND_PWALL2, /* Stop pushwall */
SND_GUTEN, /* Guten tag */
SND_SHIT, /* Shit! */
SND_HEAL, /* Healed a bit */
SND_THUMBSUP, /* You stud you! */
SND_EXTRA, /* Extra guy */
SND_OUCH1, /* BJ has beed injured */
SND_OUCH2, /* Second sound */
SND_PDIE, /* BJ has died */
SND_HITWALL, /* Tried to open a wall */
SND_KNIFEMISS, /* Knife missed */
SND_BIGGUN, /* Boss's gun */
SND_COMEHERE, /* Come here! */
SND_ESEE3, /* Nazi sees you */
SND_ESEE4, /* Nazi sees you */
SND_OK, /* Hit start game */
SND_MENU, /* New game menu */
SND_HITLERSEE, /* Hitler sees you */
SND_SHITHEAD, /* Big boss sees you */
SND_BOOM, /* Explosion */
SND_LOCKEDDOOR, /* Locked door */
SND_MECHSTEP, /* Mech step */
NUMSOUNDS };
|
1
Sprites.h
Normal file
1
Sprites.h
Normal file
@ -0,0 +1 @@
|
||||
/* generated by sprgrab */
enum {
S_NONE,
S_MISSILE,
S_MISSBOOM,
S_GAMEOVER,
S_ENMISSILE,
S_FIREBALL,
S_FIREBOOM,
S_NEEDLE,
S_VICTORY,
S_DKNIGHT_ATK1,
S_DKNIGHT_ATK2,
S_DKNIGHT_ATK3,
S_DKNIGHT_ATK4,
S_DKNIGHT_WLK1,
S_DKNIGHT_WLK2,
S_DKNIGHT_WLK3,
S_DKNIGHT_WLK4,
S_DKNIGHT_DTH1,
S_DKNIGHT_DTH2,
S_DKNIGHT_DTH3,
S_DOG_ATK1,
S_DOG_ATK2,
S_DOG_ATK3,
S_DOG_WLK1,
S_DOG_WLK2,
S_DOG_WLK3,
S_DOG_WLK4,
S_DOG_DTH1,
S_DOG_DTH2,
S_DOG_DTH3,
S_GUARD_ATK1,
S_GUARD_ATK2,
S_GUARD_ATK3,
S_GUARD_WLK1,
S_GUARD_WLK2,
S_GUARD_WLK3,
S_GUARD_WLK4,
S_GUARD_PAIN,
S_GUARD_DTH1,
S_GUARD_DTH2,
S_GUARD_DTH3,
S_HANS_ATK1,
S_HANS_ATK2,
S_HANS_ATK3,
S_HANS_WLK1,
S_HANS_WLK2,
S_HANS_WLK3,
S_HANS_WLK4,
S_HANS_DTH1,
S_HANS_DTH2,
S_HANS_DTH3,
S_HITLER_ATK1,
S_HITLER_ATK2,
S_HITLER_ATK3,
S_HITLER_WLK1,
S_HITLER_WLK2,
S_HITLER_WLK3,
S_HITLER_WLK4,
S_HITLER_DTH1,
S_HITLER_DTH2,
S_HITLER_DTH3,
S_UBER_ATK1,
S_UBER_ATK2,
S_UBER_ATK3,
S_UBER_ATK4,
S_UBER_WLK1,
S_UBER_WLK2,
S_UBER_WLK3,
S_UBER_WLK4,
S_UBER_DTH1,
S_UBER_DTH2,
S_UBER_DTH3,
S_MHITLER_ATK1,
S_MHITLER_ATK2,
S_MHITLER_ATK3,
S_MHITLER_DIE1,
S_MHITLER_DIE2,
S_MHITLER_DIE3,
S_MHITLER_DIE4,
S_MHITLER_WLK1,
S_MHITLER_WLK2,
S_MHITLER_WLK3,
S_MHITLER_WLK4,
S_MUTANT_ATK1,
S_MUTANT_ATK2,
S_MUTANT_ATK3,
S_MUTANT_WLK1,
S_MUTANT_WLK2,
S_MUTANT_WLK3,
S_MUTANT_WLK4,
S_MUTANT_PAIN,
S_MUTANT_DTH1,
S_MUTANT_DTH2,
S_MUTANT_DTH3,
S_OFFICER_ATK1,
S_OFFICER_ATK2,
S_OFFICER_ATK3,
S_OFFICER_WLK1,
S_OFFICER_WLK2,
S_OFFICER_WLK3,
S_OFFICER_WLK4,
S_OFFICER_PAIN,
S_OFFICER_DTH1,
S_OFFICER_DTH2,
S_OFFICER_DTH3,
S_SCHABBS_ATK1,
S_SCHABBS_ATK2,
S_SCHABBS_WLK1,
S_SCHABBS_WLK2,
S_SCHABBS_WLK3,
S_SCHABBS_WLK4,
S_SCHABBS_DTH1,
S_SCHABBS_DTH2,
S_SCHABBS_DTH3,
S_SS_ATK1,
S_SS_ATK2,
S_SS_ATK3,
S_SS_WLK1,
S_SS_WLK2,
S_SS_WLK3,
S_SS_WLK4,
S_SS_PAIN,
S_SS_DTH1,
S_SS_DTH2,
S_SS_DTH3,
S_TRANS_ATK1,
S_TRANS_ATK2,
S_TRANS_ATK3,
S_TRANS_WLK1,
S_TRANS_WLK2,
S_TRANS_WLK3,
S_TRANS_WLK4,
S_TRANS_DTH1,
S_TRANS_DTH2,
S_TRANS_DTH3,
S_WATER_PUDDLE,
S_GREEN_BARREL,
S_CHAIR_TABLE,
S_FLOOR_LAMP,
S_CHANDELIER,
S_DOG_FOOD,
S_COLLUMN,
S_POTTED_TREE,
S_FLAG,
S_POTTED_PLANT,
S_BLUE_POT,
S_DEBRIS1,
S_LIGHT,
S_BUCKET,
S_ARMOUR,
S_CAGE,
S_G_KEY,
S_S_KEY,
S_BANDOLIER,
S_AMMOCASE,
S_FOOD,
S_HEALTH,
S_AMMO,
S_MACHINEGUN,
S_CHAINGUN,
S_CROSS,
S_CHALICE,
S_CHEST,
S_CROWN,
S_ONEUP,
S_WOOD_BARREL,
S_WATER_WELL,
S_FLAMETHROWER,
S_GASCAN,
S_LAUNCHER,
S_MISSILES,
S_LASTONE
};
|
1
StateDef.c
Normal file
1
StateDef.c
Normal file
File diff suppressed because one or more lines are too long
1
States.h
Normal file
1
States.h
Normal file
@ -0,0 +1 @@
|
||||
/* generated by statescr*/
typedef enum {
ST_GRD_STND,
ST_GRD_WLK1,
ST_GRD_WLK2,
ST_GRD_WLK3,
ST_GRD_WLK4,
ST_GRD_ATK1,
ST_GRD_ATK2,
ST_GRD_ATK3,
ST_GRD_PAIN,
ST_GRD_DIE,
ST_GRD_DTH1,
ST_GRD_DTH2,
ST_GRD_DTH3,
ST_DOG_STND,
ST_DOG_WLK1,
ST_DOG_WLK2,
ST_DOG_WLK3,
ST_DOG_WLK4,
ST_DOG_ATK1,
ST_DOG_ATK2,
ST_DOG_ATK3,
ST_DOG_ATK4,
ST_DOG_DIE,
ST_DOG_DTH2,
ST_DOG_DTH3,
ST_DOG_DTH4,
ST_SS_STND,
ST_SS_WLK1,
ST_SS_WLK2,
ST_SS_WLK3,
ST_SS_WLK4,
ST_SS_ATK1,
ST_SS_ATK2,
ST_SS_ATK3,
ST_SS_ATK4,
ST_SS_ATK5,
ST_SS_ATK6,
ST_SS_ATK7,
ST_SS_ATK8,
ST_SS_ATK9,
ST_SS_PAIN,
ST_SS_DIE,
ST_SS_DTH1,
ST_SS_DTH2,
ST_SS_DTH3,
ST_OFC_STND,
ST_OFC_WLK1,
ST_OFC_WLK2,
ST_OFC_WLK3,
ST_OFC_WLK4,
ST_OFC_ATK1,
ST_OFC_ATK2,
ST_OFC_ATK3,
ST_OFC_PAIN,
ST_OFC_DIE,
ST_OFC_DTH1,
ST_OFC_DTH2,
ST_OFC_DTH3,
ST_MUTANT_STND,
ST_MUTANT_WLK1,
ST_MUTANT_WLK2,
ST_MUTANT_WLK3,
ST_MUTANT_WLK4,
ST_MUTANT_ATK1,
ST_MUTANT_ATK2,
ST_MUTANT_ATK3,
ST_MUTANT_ATK4,
ST_MUTANT_PAIN,
ST_MUTANT_DIE,
ST_MUTANT_DTH1,
ST_MUTANT_DTH2,
ST_MUTANT_DTH3,
ST_HANS_STND,
ST_HANS_WLK1,
ST_HANS_WLK2,
ST_HANS_WLK3,
ST_HANS_WLK4,
ST_HANS_ATK1,
ST_HANS_ATK2,
ST_HANS_ATK3,
ST_HANS_ATK4,
ST_HANS_ATK5,
ST_HANS_ATK6,
ST_HANS_ATK7,
ST_HANS_DIE,
ST_HANS_DTH2,
ST_HANS_DTH3,
ST_SCHABBS_STND,
ST_SCHABBS_WLK1,
ST_SCHABBS_WLK2,
ST_SCHABBS_WLK3,
ST_SCHABBS_WLK4,
ST_SCHABBS_ATK1,
ST_SCHABBS_ATK2,
ST_SCHABBS_DIE,
ST_SCHABBS_DTH2,
ST_SCHABBS_DTH3,
ST_TRANS_STND,
ST_TRANS_WLK1,
ST_TRANS_WLK2,
ST_TRANS_WLK3,
ST_TRANS_WLK4,
ST_TRANS_ATK1,
ST_TRANS_ATK2,
ST_TRANS_ATK3,
ST_TRANS_ATK4,
ST_TRANS_ATK5,
ST_TRANS_ATK6,
ST_TRANS_ATK7,
ST_TRANS_DIE,
ST_TRANS_DTH2,
ST_TRANS_DTH3,
ST_UBER_STND,
ST_UBER_WLK1,
ST_UBER_WLK2,
ST_UBER_WLK3,
ST_UBER_WLK4,
ST_UBER_ATK1,
ST_UBER_ATK2,
ST_UBER_ATK3,
ST_UBER_ATK4,
ST_UBER_ATK5,
ST_UBER_ATK6,
ST_UBER_ATK7,
ST_UBER_DIE,
ST_UBER_DTH2,
ST_UBER_DTH3,
ST_DKNIGHT_STND,
ST_DKNIGHT_WLK1,
ST_DKNIGHT_WLK2,
ST_DKNIGHT_WLK3,
ST_DKNIGHT_WLK4,
ST_DKNIGHT_ATK1,
ST_DKNIGHT_ATK2,
ST_DKNIGHT_ATK3,
ST_DKNIGHT_ATK4,
ST_DKNIGHT_ATK5,
ST_DKNIGHT_DIE,
ST_DKNIGHT_DTH2,
ST_DKNIGHT_DTH3,
ST_MHITLER_STND,
ST_MHITLER_WLK1,
ST_MHITLER_WLK2,
ST_MHITLER_WLK3,
ST_MHITLER_WLK4,
ST_MHITLER_ATK1,
ST_MHITLER_ATK2,
ST_MHITLER_ATK3,
ST_MHITLER_ATK4,
ST_MHITLER_ATK5,
ST_MHITLER_ATK6,
ST_MHITLER_ATK7,
ST_MHITLER_DIE1,
ST_MHITLER_DIE2,
ST_MHITLER_DIE3,
ST_MHITLER_DIE4,
ST_HITLER_WLK1,
ST_HITLER_WLK2,
ST_HITLER_WLK3,
ST_HITLER_WLK4,
ST_HITLER_ATK1,
ST_HITLER_ATK2,
ST_HITLER_ATK3,
ST_HITLER_ATK4,
ST_HITLER_ATK5,
ST_HITLER_DIE,
ST_HITLER_DTH2,
ST_HITLER_DTH3,
ST_HITLER_DTH4,
NUMSTATES
} stateindex_t;
|
1
Wolf.68k
Normal file
1
Wolf.68k
Normal file
@ -0,0 +1 @@
|
||||
;
; Assembly language functions for wolf 3-D
; By Bill Heineman
; 9-12-94 (Rev to use tight loop for scale code)
;
; Call the compiled scaler
; void ScaleGlue(void *TextPtr,t_compscale *CodePtr);
;
CASE ON
WALLHEIGHT EQU 128+1
EXPORT IO_ScaleWallColumn
EXPORT SpriteGlue
IMPORT VideoPointer:DATA
IMPORT VideoWidth:DATA
IMPORT ScaleDiv:DATA
IMPORT ArtData:DATA
IMPORT MacViewHeight:DATA
IO_ScaleWallColumn PROC
Adder1 EQU 20
ParmX EQU 4+Adder1
ParmScale EQU 6+Adder1
ParmTile EQU 8+Adder1
ParmColumn EQU 10+Adder1
;
; D0 = Temp, A0 = Temp
;
RegScrn EQU A0 ;Pointer to the screen
RegArt2 EQU A1 ;True pointer to art
RegArt EQU D1 ;Offset into the shape
RegDelta EQU D2 ;Delta counter
RegFrac EQU D3 ;Fixed point fraction
RegInt EQU D4 ;Fixed point integer
RegVidWidth EQU D5 ;Width of the screen in bytes
RegScale EQU D6 ;Scale factor
MOVEM.L D2-D6,-(A7) ;Save my registers
MOVE.L #0,RegScale ;Force scale to a long value
MOVE.W ParmScale(A7),RegScale ;Preload the scale factor
CMP.W #0,RegScale ;Scale of zero?
BEQ.S ByeBye ;Exit now! (Can't draw zero height)
MOVE.W ParmX(A7),D0 ;Get the X coord
MOVE.L VideoPointer,RegScrn ;Init the screen pointer
ADD.W D0,RegScrn ;Add the X coord
MOVE.W VideoWidth,RegVidWidth ;Init the video width
LEA ScaleDiv,RegArt2 ;Get pointer to the scaler recipocal table
MOVE.W RegScale,D0 ;Place scale value in temp
LSL.W #2,D0 ;Mul by 4 for longword index
MOVE.L (RegArt2,D0.W),RegFrac ;Get the precalced fraction
ADD.W RegScale,RegScale ;Convert scale to pixel value
MOVE.W ParmColumn(A7),RegArt ;Get the column index to the art
LSL.W #7,RegArt ;I have the pixel index
MOVE.W ParmTile(A7),D0
LSL.W #2,D0 ;Shift down 7 up 2
LEA ArtData,RegArt2 ;Get pointer to my shape ptr array
MOVE.L (RegArt2,D0.W),RegArt2 ;Get the base pointer to the art in A2
MOVE.W MacViewHeight,D0 ;Get the height
CMP.W D0,RegScale ;Clipping needed?
BCC.S ClipTop ;Do the clipped version
SUB.W RegScale,D0 ;How many line are clear?
LSR.W #1,D0 ;Number of lines to jump DOWN (Center it)
MULU.W RegVidWidth,D0 ;Mul by bytes per line
ADD.L D0,RegScrn ;Add to the screen pointer
MOVE.L RegFrac,RegInt ;Copy the full fixed point number
SWAP RegInt ;Isolate the integer
MOVE.W #0,RegDelta ;Zap the delta
SUB.W #1,RegScale ;-1 from the count for DBF
;
; This is the tight loop that draws the scaled line
; RegArt2/RegArt = Source ptr
; RegScrn = Video pointer
; RegFrac = Scale fraction
; RegInt = Scale integer
; RegDelta = Scale delta
; RegScale = Pixel count (Max MacViewHeight)
;
Loopy
MOVE.B (RegArt2,RegArt.W),D0 ;Move shape byte
MOVE.B D0,(RegScrn)
ADD.W RegFrac,RegDelta ;Adjust the delta
ADDX.W RegInt,RegArt ;Adjust the source byte offset
ADD.W RegVidWidth,RegScrn ;Next dest scan line
DBF RegScale,Loopy ;Still more?
ByeBye ;Exit
MOVEM.L (A7)+,D2-D6
RTS
ClipTop
SUB.W D0,RegScale ;Number of lines clipped
LSR.W #1,RegScale ;True number of lines skipped from top
MOVE.W RegFrac,RegDelta ;Init the delta for the mul
MULU.W RegScale,RegDelta ;Make the new delta for skipped lines
MOVE.L RegDelta,D0 ;Copy the delta
SWAP D0 ;Isolate the integer
ADD.W D0,RegArt ;Skip the hidden lines
MOVE.L RegFrac,D0
SWAP D0
MULU.W RegScale,D0
ADD.W D0,RegArt
MOVE.L RegFrac,RegInt ;Copy the full fixed point number
SWAP RegInt ;Isolate the integer
MOVE.W MacViewHeight,RegScale ;Use maximum height
SUB.W #1,RegScale ;Adjust for DBF
JMP Loopy
;
; Call the compiled scaler to draw a run of the line
;
;void SpriteGlue(Byte *a,LongWord b,Byte *c,Word d,Word e);
SpriteGlue PROC
Off EQU 20
ParmSGArt EQU 4+Off ;Pointer to the 6 byte run structure
ParmTFrac EQU 8+Off ;Pointer to the scaler
ParmScrn EQU 12+Off ;Pointer to the run base address
ParmCnt EQU 16+Off ;Line count
ParmDelta EQU 18+Off ;Initial delta
SGArt2 EQU A0 ;Pointer to the 6 byte run structure
SGScrn EQU A1 ;Pointer to the run base address
SGArt EQU D1
SGFrac EQU D2 ;Pointer to the scaler
SGInt EQU D3 ;Pointer to the video
SGCount EQU D6
SGDelta EQU D4
SGVidWidth EQU D5
MOVEM.L D2-D6,-(A7)
MOVE.L ParmSGArt(A7),SGArt2
MOVE.L ParmScrn(A7),SGScrn
MOVE.L ParmTFrac(A7),SGFrac ;Get pointer to the run structure
MOVE.L SGFrac,SGInt
SWAP SGInt
MOVE.W ParmCnt(A7),SGCount
MOVE.W ParmDelta(A7),SGDelta
MOVE.W VideoWidth,SGVidWidth ;Init the video width
MOVE.L #0,SGArt
SUB.W #1,SGCount ;Adjust for count used in DBF
Loopy2
MOVE.B (SGArt2,SGArt.W),D0 ;Get shape byte
MOVE.B D0,(SGScrn)
ADD.W SGFrac,SGDelta ;Adjust the delta
ADDX.W SGInt,SGArt ;Adjust the source byte offset
ADD.W SGVidWidth,SGScrn ;Next dest scan line
DBF SGCount,Loopy2 ;Still more?
MOVEM.L (A7)+,D2-D6
RTS
END
|
1
Wolf.h
Normal file
1
Wolf.h
Normal file
@ -0,0 +1 @@
|
||||
#define MyMenuBar 128 /* application's menu bar */
#define rAboutAlert 128 /* about alert */
#define rUserAlert 129 /* error user alert */
#define AskSizeWin 130 /* Ask for screen size window */
#define NewGameWin 131 /* Choose difficulty */
#define Not607Win 132 /* Not system 6.0.7 or later */
#define NotColorWin 133 /* No color */
#define Not32QDWin 134 /* Not Quickdraw 32 */
#define SlowWarnWin 135 /* Your machine is slow */
#define SpeedTipsWin 136 /* Hints on speed */
#define ShareWareWin 137 /* Pay us $$$ */
#define GoSlowWin 138 /* You are not in 8 bit color mode */
#define EndGameWin 139 /* You won the shareware version */
#define LowMemWin 140 /* You are dangerously low on memory */
/* kSysEnvironsVersion is passed to SysEnvirons to tell it which version of the
SysEnvRec we understand. */
#define kSysEnvironsVersion 1
/* kOSEvent is the event number of the suspend/resume and mouse-moved events sent
by MultiFinder. Once we determine that an event is an osEvent, we look at the
high byte of the message sent to determine which kind it is. To differentiate
suspend and resume events we check the resumeMask bit. */
#define kOSEvent app4Evt /* event used by MultiFinder */
#define kSuspendResumeMessage 1 /* high byte of suspend/resume event message */
#define kResumeMask 1 /* bit of message field for resume vs. suspend */
#define kMouseMovedMessage 0xFA /* high byte of mouse-moved event message */
#define kNoEvents 0 /* no events mask */
/* The following constants are used to identify menus and their items. The menu IDs
have an "m" prefix and the item numbers within each menu have an "i" prefix. */
#define mApple 128 /* Apple menu */
#define iAbout 1
#define iSpeedHint 2
#define iShareWare 3
#define mFile 129 /* File menu */
#define iNew 1
#define iOpen 2
#define iClose 4
#define iSave 5
#define iSaveAs 6
#define iQuit 8
#define mEdit 130 /* Edit menu */
#define iUndo 1
#define iCut 3
#define iCopy 4
#define iPaste 5
#define iClear 6
#define mOptions 131 /* Game menu */
#define iSound 1
#define iMusic 2
#define iScreenSize 3
#define iGovenor 4
#define iMouseControl 5
#define iUseQuickDraw 6
/* 1.01 - kTopLeft - This is for positioning the Disk Initialization dialogs. */
#define kDITop 0x0050
#define kDILeft 0x0070
/* kExtremeNeg and kExtremePos are used to set up wide open rectangles and regions. */
#define kExtremeNeg -32768
#define kExtremePos 32767 - 1 /* required to address an old region bug */
/* these #defines are used to set enable/disable flags of a menu */
#define AllItems 0b1111111111111111111111111111111 /* 31 flags */
#define NoItems 0b0000000000000000000000000000000
#define MenuItem1 0b0000000000000000000000000000001
#define MenuItem2 0b0000000000000000000000000000010
#define MenuItem3 0b0000000000000000000000000000100
#define MenuItem4 0b0000000000000000000000000001000
#define MenuItem5 0b0000000000000000000000000010000
#define MenuItem6 0b0000000000000000000000000100000
#define MenuItem7 0b0000000000000000000000001000000
#define MenuItem8 0b0000000000000000000000010000000
#define MenuItem9 0b0000000000000000000000100000000
#define MenuItem10 0b0000000000000000000001000000000
#define MenuItem11 0b0000000000000000000010000000000
#define MenuItem12 0b0000000000000000000100000000000
/* Burger resources */
#define rIdLogoPic 128 /* Id Logo for 3do version */
#define rMacPlayPic 129 /* Mac play logo */
#define rMacPlayPal 130
#define rIdLogoPal 131
#define rBlackPal 132
#define rTitlePic 133 /* Title screen picture */
#define rTitlePal 134 /* Title screen palette */
#define MySoundList 135 /* List of sound effects to log */
#define MyDarkData 136 /* 256 byte table to darken walls */
#define MyWallList 137 /* All wall shapes */
#define MyBJFace 138 /* BJ's face for automap */
#define rIntermission 139 /* Intermission background */
#define rInterPal 140
#define rInterPics 141 /* BJ's intermission pictures */
#define rFaceShapes 142 /* All the permanent game shapes */
#define rFace512 143 /* All game sprites */
#define rFace640 144
#define rGamePal 145 /* Game Palette */
#define rMapList 146 /* Map info data */
#define rSongList 147 /* Music list data */
#define rGetPsychPic 148
#define rYummyPic 149
#define rYummyPal 150
#define rFineTangent 151 /* High detail tangent table */
#define rFineSine 152 /* High detail sine table */
#define rScaleAtZ 153 /* High detail scale table */
#define rViewAngleToX 154 /* Angle to X coord */
#define rXToViewAngle 155 /* X to angle */
|
1
Wolf.ppc
Normal file
1
Wolf.ppc
Normal file
@ -0,0 +1 @@
|
||||
;
; Assembly language functions for wolf 3-D PPC version
; Written by Bill Heineman
; 9-12-94 (Rev for removing scalers and using direct code)
;
;
; Bullshit to make the PPC Mac environment know I'm here
;
import VideoWidth ; global variable from C program
import MacViewHeight
import ArtData
import VideoPointer
import ScaleDiv
toc
tc VideoWidth[TC],VideoWidth
tc MacViewHeight[TC],MacViewHeight
tc ArtData[TC],ArtData
tc VideoPointer[TC],VideoPointer
tc ScaleDiv[TC],ScaleDiv
export IO_ScaleWallColumn[DS]
export .IO_ScaleWallColumn[PR]
export SpriteGlue[DS]
export .SpriteGlue[PR]
toc ;Table of contents for the subroutines
tc IO_ScaleWallColumn[TC], IO_ScaleWallColumn[DS]
tc SpriteGlue[TC], SpriteGlue[DS]
csect IO_ScaleWallColumn[DS]
dc.l .IO_ScaleWallColumn[PR]
dc.l TOC[tc0]
csect SpriteGlue[DS]
dc.l .SpriteGlue[PR]
dc.l TOC[tc0]
;
; This routine will draw a scaled wall column.
;
; void IO_ScaleWallColumn(Word x,Word scale,LongWord column)
;
WALLHEIGHT EQU 128+1
; Passed from "C"
X equ R3 ;X coord
Scale equ R4 ;Scale factor
Tile equ R5 ;Tile to draw
Column equ R6 ;Packed wall column #
; Locals
ArtStart EQU R7 ;Pointer to wall art
ScreenPtr EQU R8 ;Pointer to screen memory column
Frac EQU R9 ;Fractional scaler
Integer EQU R10 ;Fractional integer
VWidth EQU R11 ;Video of the video screen in bytes
Delta EQU R6 ;Delta factor and temp
VHeight EQU R12 ;Height of mac screen
Temp EQU R3 ;Temp (Use AFTER X is added)
csect .IO_ScaleWallColumn[PR]
CMPLWI Scale,0 ;Is the scale factor zero?
BEQLR ;Exit NOW!
LWZ ScreenPtr,VideoPointer[TC](RTOC) ;Get handle to video
LWZ ArtStart,ArtData[TC](RTOC) ;Get handle to art data list
LWZ VWidth,VideoWidth[TC](RTOC) ;Get handle to video width
LWZ Frac,ScaleDiv[TC](RTOC)
LWZ VHeight,MacViewHeight[TC](RTOC) ;Get pointer to view height
LWZ ScreenPtr,0(ScreenPtr) ;I have the base pointer
LWZ VWidth,0(VWidth) ;Init video width
LWZ VHeight,0(VHeight) ;Get the number of lines visible
SLWI Scale,Scale,1 ;Mul scale by 2 (Get true pixel value
ADD ScreenPtr,ScreenPtr,X ;Add the X coord (Frees Temp)
SLWI Temp,Scale,1 ;Get low word index
SLWI Tile,Tile,2 ;Get the wall shape pointer
LWZX Frac,Frac,Temp ;Get the scale factor
SLWI Column,Column,7 ;Mul by 128 pixels
LWZX ArtStart,ArtStart,Tile ;Get pointer to the shape
ADD ArtStart,ArtStart,Column ;I have the shape ptr
CMPLW Scale,VHeight ;Too big?
BGE ClipTop ;Clip the top
;
; No clipping needed!
; Adjust the dest screen for the starting Y coord
;
MTCTR Scale ;Init counter
SUB Temp,VHeight,Scale ;How many lines to jump down?
LI Delta,0 ;Init the delta factor
SRWI Temp,Temp,1 ;Divide by to center vertically
SRWI Integer,Frac,24 ;Isolate the integer
MULLW Temp,VWidth,Temp ;Adjust the Y coord
SLWI Frac,Frac,8 ;Isolate the fraction
ADD ScreenPtr,ScreenPtr,Temp ;Create the dest screen pointer
;
; Tight loop
; Grab byte, adjust fractional scaler values and store to screen
;
More:
LBZ R0,0(ArtStart) ;Fetch a shape byte
ADDC. Delta,Delta,Frac ;Add the scaler fractional
STB R0,0(ScreenPtr) ;Store on the screen
ADDE ArtStart,ArtStart,Integer ;Add the constant
ADD ScreenPtr,ScreenPtr,VWidth ;Go down a line
BDNZ More ;All lines done?
BLR ;Exit routine
;
; Clip the top and bottom
; Calc the number of lost lines by clipping and "Fake"
; the numbers as if I processed those missing lines
;
ClipTop:
MTCTR VHeight ;I will draw a screen line full
SUB Temp,Scale,VHeight ;How many lines to jump down?
SRWI Integer,Frac,24 ;Isolate the integer
SRWI Temp,Temp,1 ;Divide by to center vertically
MULLW Temp,Frac,Temp ;Adjust the scaler by lost lines
SRWI Delta,Temp,24 ;How many bytes are lost?
ADD ArtStart,ArtStart,Delta ;Create the SOURCE art pointer
SLWI Frac,Frac,8 ;Isolate the fraction
SLWI Delta,Temp,8 ;Init the adjusted delta
B More ;Jump to the code
;
; Call the compiled scaler to draw a run of the line
;
csect .SpriteGlue[PR]
SGArtStart EQU R3 ;Pointer to the 6 byte run structure
SGFrac EQU R4 ;Pointer to the scaler
SGInteger EQU R5 ;Pointer to the video
SGScreenPtr EQU R6 ;Pointer to the run base address
SGCount EQU R7
SGDelta EQU R8
SGVWidth EQU R9
LWZ SGVWidth,VideoWidth[TC](RTOC)
LWZ SGVWidth,0(SGVWidth)
MTCTR SGCount
SMore:
LBZ R0,0(SGArtStart) ;Fetch a shape byte
ADDC. SGDelta,SGDelta,SGFrac ;Add the scaler fractional
STB R0,0(SGScreenPtr) ;Store on the screen
ADDE SGArtStart,SGArtStart,SGInteger ;Add the constant
ADD SGScreenPtr,SGScreenPtr,SGVWidth ;Go down a line
BDNZ SMore ;All lines done?
BLR ;Exit routine
|
BIN
Wolf3D.mcp
Normal file
BIN
Wolf3D.mcp
Normal file
Binary file not shown.
1
WolfMain.c
Normal file
1
WolfMain.c
Normal file
File diff suppressed because one or more lines are too long
BIN
wolf.68k.o
Normal file
BIN
wolf.68k.o
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user