Commit 8cb83d7e authored by Steven Fuller's avatar Steven Fuller

Doc updates and more reformatting

parent a6d848b2
...@@ -2,8 +2,7 @@ ...@@ -2,8 +2,7 @@
------------- Please Disregard the Following Outdated Text: ---------------- ------------- Please Disregard the Following Outdated Text: ----------------
* One binary, any game type. Store certain things in a new file for each * One binary, any game type.
dataset?
* A key to change viewsize while playing (note: max == 20, min == 5 or so...) * A key to change viewsize while playing (note: max == 20, min == 5 or so...)
* Game able to cope at any virtual resolution in software mode. OpenGL * Game able to cope at any virtual resolution in software mode. OpenGL
handles this transparently (after setting correct glViewport) handles this transparently (after setting correct glViewport)
...@@ -13,16 +12,14 @@ ...@@ -13,16 +12,14 @@
* Fully compile with no warnings/errors using -Wall -ansi -pedantic and with * Fully compile with no warnings/errors using -Wall -ansi -pedantic and with
other compilers (would need to turn off warnings about unused parameters) other compilers (would need to turn off warnings about unused parameters)
* Port to: Linux/SVGAlib, Linux/X (Windowed and DGA), Linux/OpenGL, * Port to: Linux/SVGAlib, Linux/X (Windowed and DGA), Linux/OpenGL,
DOS/Allegro, Win32/GDI?, Win32/DX, Win32/D3D, Win32/OpenGL, BeOS?, MacOS?, DOS/Allegro?, Win32/GDI?, Win32/DX, Win32/D3D?, Win32/OpenGL, BeOS?, MacOS?,
QNX? QNX?
* Ease in using demos. Playing demos from files, recording to files, batch * Ease in using demos. Playing demos from files, recording to files, batch
playing, and so on. playing, and so on.
* Make Wolf3D the game it was originally planned to be... More strategy... * Make Wolf3D the game it was originally planned to be... More strategy...
* Empty TODO File (TODO states a list of things which need to/should be done * Empty TODO File (TODO states a list of things which need to/should be done
regardless of future plans [IDEAS]) and no TODO/FIXME/XXXs in the source regardless of future plans [IDEAS]) and no TODO/FIXMEs in the source
code code
* Have some sort of way of playing both digital and adlib sounds on all
platforms [fmopl.c] (if possible)
* Test with other available mods (that were compatible with the original * Test with other available mods (that were compatible with the original
game) game)
* Unified input handling * Unified input handling
......
Control Menu:
* TODO
Sound Menu:
* Sound Effects:
- PCM
- OPL2
- PC Speaker?
- None
* Music:
- OPL2
- None
* Sampling Rate:
- 44100
- 22050
...@@ -8,22 +22,26 @@ SD_StartMusic((MusicGroup *)audiosegs[STARTMUSIC + chunk]); ...@@ -8,22 +22,26 @@ SD_StartMusic((MusicGroup *)audiosegs[STARTMUSIC + chunk]);
=> =>
SD_StartMusic(chunk); SD_StartMusic(chunk);
General: * rewrite hw (sound, input) code, remove stuff like SD_SetSoundMode
* convert uses of open() to fopen() * proper left/right sound
* half of these things belong in IDEAS; they are not bugs, just random * adlib sounds seem like they play at twice the freq
musings * set up a "build number" system where every time a file is recompiled via
* inconsistancy: make (ver.c depends on the source code) the number is incremented and so on
id_ca.c has code for setting the data filenames' extension note: this debug system would have to be disabled for all public releases to
so does wl_menu.c prevent confusion. OR ver.c would depend on the source, but it does not have
a version number, just __TIME__. this version id would be used for
savegames until they are fixed to not use pointers
* use static and const where appropriate
* convert uses of open() to fopen(), etc
* menu code is a mess, always does things differently than the rest of the * menu code is a mess, always does things differently than the rest of the
code, it really needs to be cleaned up code, it really needs to be cleaned up
* id_ca.c cache code: fix/readd/rewrite the "garbage collection" system? * id_ca.c cache code: fix/readd/rewrite the "garbage collection" system?
* clean up header files, especially wl_def.h, where some declarations aren't * clean up header files, especially wl_def.h, where some declarations aren't
in the right place in the right place
* every structure that is read/written must be PACKED, with datatypes * every structure that is read/written must be PACKED, with datatypes
specifially set to correct size! specifially set to correct size
* or at least have PACKED versions of read/write structures, and transfer * or have PACKED versions of read/write structures, and transfer
to/from just for reading, so only not-packed structures are used during to/from just for reading, so only non-packed structures are used during
actual gameplay/etc. actual gameplay/etc.
* is that memory intro screen needed anymore? probably not, although it * is that memory intro screen needed anymore? probably not, although it
would be nice to show what version is loaded, but doom just printed text would be nice to show what version is loaded, but doom just printed text
...@@ -39,7 +57,6 @@ metaname like sc_Left etc or something ...@@ -39,7 +57,6 @@ metaname like sc_Left etc or something
* remove GOODTIMES? * remove GOODTIMES?
* Remove the SOD manual check? * Remove the SOD manual check?
* perhaps rename UPLOAD * perhaps rename UPLOAD
* verify if the sounds and graphics are correctly numbered, once again...
* add a ViewMap? (could be done similar to mac version) * add a ViewMap? (could be done similar to mac version)
* find and remove any function stubs (functions which just call another * find and remove any function stubs (functions which just call another
function with same parameters, only difference is the name) function with same parameters, only difference is the name)
...@@ -60,7 +77,7 @@ PlayDemoFromFile specifically ...@@ -60,7 +77,7 @@ PlayDemoFromFile specifically
on the border on the border
same with the spear of destiny animation part of ending same with the spear of destiny animation part of ending
* move all references to gfxbuf to vi_* only (gl will need this anyway, * move all references to gfxbuf to vi_* only (gl will need this anyway,
since it deprecates: id_vh, (parts of) wl_draw, wl_scale) since it would replace id_vh, (parts of) wl_draw, wl_scale)
by putting in code from id_vh (either by using Plot or just copying it in) by putting in code from id_vh (either by using Plot or just copying it in)
we can stop the large conversion before each UpdateScreen we can stop the large conversion before each UpdateScreen
but palette fades will still need it! but palette fades will still need it!
...@@ -68,12 +85,11 @@ but palette fades will still need it! ...@@ -68,12 +85,11 @@ but palette fades will still need it!
for every byte when transferring to the pixmap, palette fades require a for every byte when transferring to the pixmap, palette fades require a
screen update screen update
* make sure none of the code tries to handle gfx/sound data directly * make sure none of the code tries to handle gfx/sound data directly
* if window loses focus, should it clear the keys? most likely * when window loses focus, it should clear the keys
* clean up vi_xlib.c: fix vid mode changing, fix dga for non8bit modes and * clean up vi_xlib.c: fix vid mode changing, fix dga for non8bit modes and
the nonpalette setting stuff... lots of if statements the nonpalette setting stuff... lots of if statements
also, it should be able to compile without extensions also, it should be able to compile without extensions
* rename visable to visible * rename visable to visible
* fix up windows port
* create 'sound channels' with priority.. ie a door can only make one sound * create 'sound channels' with priority.. ie a door can only make one sound
at a time at a time
* change wl_scale to use mac wolf3d's version of scaling * change wl_scale to use mac wolf3d's version of scaling
......
...@@ -2,14 +2,6 @@ ...@@ -2,14 +2,6 @@
#include "id_heads.h" #include "id_heads.h"
/*
=============================================================================
LOCAL CONSTANTS
=============================================================================
*/
typedef struct typedef struct
{ {
/* 0-255 is a character, > is a pointer to a node */ /* 0-255 is a character, > is a pointer to a node */
...@@ -41,14 +33,6 @@ byte *grsegs[NUMCHUNKS]; ...@@ -41,14 +33,6 @@ byte *grsegs[NUMCHUNKS];
static byte grneeded[NUMCHUNKS]; static byte grneeded[NUMCHUNKS];
static byte ca_levelbit, ca_levelnum; static byte ca_levelbit, ca_levelnum;
/*
=============================================================================
LOCAL VARIABLES
=============================================================================
*/
char extension[5], char extension[5],
gheadname[10] = "vgahead.", gheadname[10] = "vgahead.",
gfilename[10] = "vgagraph.", gfilename[10] = "vgagraph.",
......
unsigned char gamepal[] = const unsigned char gamepal[] =
{ '\0', '\0', '\0', '\0', '\0', 0x2a, '\0', 0x2a, '\0', '\0', 0x2a, { '\0', '\0', '\0', '\0', '\0', 0x2a, '\0', 0x2a, '\0', '\0', 0x2a,
0x2a, 0x2a, '\0', '\0', 0x2a, '\0', 0x2a, 0x2a, 0x15, '\0', 0x2a, 0x2a, 0x2a, '\0', '\0', 0x2a, '\0', 0x2a, 0x2a, 0x15, '\0', 0x2a,
0x2a, 0x2a, 0x15, 0x15, 0x15, 0x15, 0x15, '?', 0x15, '?', 0x15, 0x2a, 0x2a, 0x15, 0x15, 0x15, 0x15, 0x15, '?', 0x15, '?', 0x15,
...@@ -69,9 +69,8 @@ unsigned char gamepal[] = ...@@ -69,9 +69,8 @@ unsigned char gamepal[] =
0x1f, 0x1f, '\0', 0x1e, 0x1e, '\0', 0x1d, 0x1d, '\0', 0x1c, 0x1c, 0x1f, 0x1f, '\0', 0x1e, 0x1e, '\0', 0x1d, 0x1d, '\0', 0x1c, 0x1c,
'\0', 0x1b, 0x1b, 0x26, '\0', 0x22,'\0' '\0', 0x1b, 0x1b, 0x26, '\0', 0x22,'\0'
}; };
unsigned long int gamepal_size = 768;
unsigned char introscn[] = const unsigned char introscn[] =
{ 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, { 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29,
0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29,
0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29,
...@@ -5882,4 +5881,3 @@ unsigned char introscn[] = ...@@ -5882,4 +5881,3 @@ unsigned char introscn[] =
0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29,
0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29,'\0' 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29,'\0'
}; };
unsigned long int introscn_size = 64000;
...@@ -32,7 +32,7 @@ typedef struct { ...@@ -32,7 +32,7 @@ typedef struct {
SoundCommon common; SoundCommon common;
Instrument inst; Instrument inst;
byte block, data[1]; byte block, data[1];
} AdLibSound; } PACKED AdLibSound;
typedef struct { typedef struct {
word length, values[1]; word length, values[1];
......
...@@ -11,8 +11,6 @@ boolean SoundSourcePresent, AdLibPresent, SoundBlasterPresent; ...@@ -11,8 +11,6 @@ boolean SoundSourcePresent, AdLibPresent, SoundBlasterPresent;
SDMode SoundMode, MusicMode; SDMode SoundMode, MusicMode;
SDSMode DigiMode; SDSMode DigiMode;
/* ** */
static volatile boolean sqActive; static volatile boolean sqActive;
static fixed globalsoundx, globalsoundy; static fixed globalsoundx, globalsoundy;
...@@ -119,6 +117,7 @@ void *SoundThread(void *data) ...@@ -119,6 +117,7 @@ void *SoundThread(void *data)
AdlibBlock = ((AdlibSnd->block & 7) << 2) | 0x20; AdlibBlock = ((AdlibSnd->block & 7) << 2) | 0x20;
AdlibData = (byte *)&AdlibSnd->data; AdlibData = (byte *)&AdlibSnd->data;
AdlibLength = AdlibSnd->common.length*5; AdlibLength = AdlibSnd->common.length*5;
//OPLWrite(OPL, 0xB0, AdlibBlock);
NewAdlib = -1; NewAdlib = -1;
} }
...@@ -144,14 +143,14 @@ void *SoundThread(void *data) ...@@ -144,14 +143,14 @@ void *SoundThread(void *data)
if (AdlibPlaying != -1) { if (AdlibPlaying != -1) {
if (AdlibLength == 0) { if (AdlibLength == 0) {
OPLWrite(OPL, 0xB0, AdlibBlock); //OPLWrite(OPL, 0xB0, AdlibBlock);
} else if (AdlibLength == -1) { } else if (AdlibLength == -1) {
OPLWrite(OPL, 0xA0, 00); OPLWrite(OPL, 0xA0, 00);
OPLWrite(OPL, 0xB0, AdlibBlock); OPLWrite(OPL, 0xB0, AdlibBlock);
AdlibPlaying = -1; AdlibPlaying = -1;
} else if ((AdlibLength % 5) == 0) { } else if ((AdlibLength % 5) == 0) {
OPLWrite(OPL, 0xA0, *AdlibData); OPLWrite(OPL, 0xA0, *AdlibData);
OPLWrite(OPL, 0xB0, AdlibBlock); OPLWrite(OPL, 0xB0, AdlibBlock & ~2);
AdlibData++; AdlibData++;
} }
AdlibLength--; AdlibLength--;
...@@ -169,7 +168,6 @@ void *SoundThread(void *data) ...@@ -169,7 +168,6 @@ void *SoundThread(void *data)
NextSound = -1; NextSound = -1;
} }
for (i = 0; i < (sizeof(sndbuf)/sizeof(sndbuf[0])); i += 2) { for (i = 0; i < (sizeof(sndbuf)/sizeof(sndbuf[0])); i += 2) {
if (SoundPlaying != -1) { if (SoundPlaying != -1) {
if (SoundPositioned) { if (SoundPositioned) {
snd = ((((signed short)((SoundData[(SoundPlayPos >> 16)] << 8)^0x8000))>>1)/(L+1))+musbuf[i/2]; snd = ((((signed short)((SoundData[(SoundPlayPos >> 16)] << 8)^0x8000))>>1)/(L+1))+musbuf[i/2];
...@@ -200,7 +198,8 @@ void *SoundThread(void *data) ...@@ -200,7 +198,8 @@ void *SoundThread(void *data)
} }
SoundPlayPos += 10402; /* 7000 / 44100 * 65536 */ SoundPlayPos += 10402; /* 7000 / 44100 * 65536 */
if ((SoundPlayPos >> 16) >= SoundPlayLen) { if ((SoundPlayPos >> 16) >= SoundPlayLen) {
SoundPlayPos = 0; //SoundPlayPos = 0;
SoundPlayPos -= (SoundPlayLen << 16);
SoundLen -= 4096; SoundLen -= 4096;
SoundPlayLen = (SoundLen < 4096) ? SoundLen : 4096; SoundPlayLen = (SoundLen < 4096) ? SoundLen : 4096;
if (SoundLen <= 0) { if (SoundLen <= 0) {
...@@ -533,8 +532,6 @@ void UpdateSoundLoc(fixed x, fixed y, int angle) ...@@ -533,8 +532,6 @@ void UpdateSoundLoc(fixed x, fixed y, int angle)
} }
} }
/* ** */
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// //
// SD_MusicOn() - turns on the sequencer // SD_MusicOn() - turns on the sequencer
......
...@@ -450,7 +450,7 @@ void VL_Shutdown() ...@@ -450,7 +450,7 @@ void VL_Shutdown()
void VL_WaitVBL(int vbls) void VL_WaitVBL(int vbls)
{ {
/* hack - but it works for me */ /* hack - but it works for me */
long last = get_TimeCount() + 1; long last = get_TimeCount() + vbls;
while (last > get_TimeCount()) ; while (last > get_TimeCount()) ;
} }
......
...@@ -52,7 +52,7 @@ statetype s_attack = {false,0,0,T_Attack,NULL,NULL}; ...@@ -52,7 +52,7 @@ statetype s_attack = {false,0,0,T_Attack,NULL,NULL};
struct atkinf struct atkinf
{ {
char tics,attack,frame; // attack is 1 for gun, 2 for knife char tics,attack,frame; // attack is 1 for gun, 2 for knife
} attackinfo[4][14] = } static attackinfo[4][14] =
{ {
{ {6,0,1},{6,2,2},{6,0,3},{6,-1,4} }, { {6,0,1},{6,2,2},{6,0,3},{6,-1,4} },
...@@ -1240,7 +1240,7 @@ void VictorySpin (void) ...@@ -1240,7 +1240,7 @@ void VictorySpin (void)
=============== ===============
*/ */
void T_Attack (objtype *ob) void T_Attack(objtype *ob)
{ {
struct atkinf *cur; struct atkinf *cur;
......
...@@ -59,10 +59,10 @@ void CountObjects() ...@@ -59,10 +59,10 @@ void CountObjects()
================ ================
*/ */
void PicturePause (void) void PicturePause()
{ {
FinishPaletteShifts (); FinishPaletteShifts();
IN_Ack(); IN_Ack();
......
...@@ -71,7 +71,6 @@ ...@@ -71,7 +71,6 @@
#define MINDIST (0x5800l) #define MINDIST (0x5800l)
/* xwolf code needs max height to double */
#define MAXSCALEHEIGHT 512 /* largest scale on largest view */ #define MAXSCALEHEIGHT 512 /* largest scale on largest view */
#define MAXVIEWWIDTH 320 #define MAXVIEWWIDTH 320
......
...@@ -102,7 +102,7 @@ void EndSpear(void) ...@@ -102,7 +102,7 @@ void EndSpear(void)
================== ==================
*/ */
void Victory (void) void Victory()
{ {
#ifndef SPEARDEMO #ifndef SPEARDEMO
long sec; long sec;
......
...@@ -1295,6 +1295,8 @@ int WolfMain(int argc, char *argv[]) ...@@ -1295,6 +1295,8 @@ int WolfMain(int argc, char *argv[])
_argc = argc; _argc = argc;
_argv = argv; _argv = argv;
printf("Now Loading %s\n", GAMENAME);
srand(time(NULL)); srand(time(NULL));
CheckForEpisodes(); CheckForEpisodes();
......
...@@ -745,46 +745,6 @@ moveok: ...@@ -745,46 +745,6 @@ moveok:
============================================================================= =============================================================================
*/ */
/*
===============
=
= DropItem
=
= Tries to drop a bonus item somewhere in the tiles surrounding the
= given tilex/tiley
=
===============
*/
void DropItem (stat_t itemtype, int tilex, int tiley)
{
int x,y,xl,xh,yl,yh;
//
// find a free spot to put it in
//
if (!actorat[tilex][tiley])
{
PlaceItemType (itemtype, tilex,tiley);
return;
}
xl = tilex-1;
xh = tilex+1;
yl = tiley-1;
yh = tiley+1;
for (x=xl ; x<= xh ; x++)
for (y=yl ; y<= yh ; y++)
if (!actorat[x][y])
{
PlaceItemType (itemtype, x,y);
return;
}
}
/* /*
=============== ===============
= =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment