Commit 349df00f authored by Steven Fuller's avatar Steven Fuller

More cleanups

parent fc651432
......@@ -4,9 +4,9 @@ CFLAGS = -g -DUSEVGA
#CFLAGS = -g -Wall -DUSEVGA -DDEBUG
#CFLAGS = -g -DUSEVGA -DDEBUG
#CFLAGS = -g -pg -DDEBUG
OBJS = objs.o id_ca.o id_in.o id_sd.o id_vl.o id_vh.o wl_scale.o wl_draw.o \
wl_act1.o wl_act2.o wl_agent.o wl_game.o wl_inter.o wl_menu.o \
wl_play.o wl_state.o wl_main.o wl_debug.o
OBJS = objs.o misc.o id_ca.o id_in.o id_sd.o id_vl.o id_vh.o wl_scale.o \
wl_draw.o wl_act1.o wl_act2.o wl_agent.o wl_game.o wl_inter.o \
wl_menu.o wl_play.o wl_state.o wl_main.o wl_debug.o
#LFLAGS = -lm -lvga -pg
LFLAGS = -lm -lvga
......
This diff is collapsed.
......@@ -167,12 +167,6 @@ void MM_BombOnError (boolean bomb);
void MML_UseSpace (unsigned segstart, unsigned seglength);
//
// ID_PM.H
// Header file for Id Engine's Page Manager
//
// NOTE! PMPageSize must be an even divisor of EMSPageSize, and >= 1024
#define EMSPageSize 16384
#define EMSPageSizeSeg (EMSPageSize >> 4)
#define EMSPageSizeKB (EMSPageSize >> 10)
......@@ -201,19 +195,13 @@ typedef enum
pmba_Allocated = 2
} PMBlockAttr;
typedef struct
{
longword offset; // Offset of chunk into file
word length; // Length of the chunk
int xmsPage; // If in XMS, (xmsPage * PMPageSize) gives offset into XMS handle
PMLockType locked; // If set, this page can't be purged
int emsPage; // If in EMS, logical page/offset into page
int mainPage; // If in Main, index into handle array
longword lastHit; // Last frame number of hit
} PageListStruct;
typedef struct {
longword offset; // Offset of chunk into file
word length; // Length of the chunk
PMLockType locked; // If set, this page can't be purged
memptr addr;
longword lastHit; // Last frame number of hit
} PageListStruct;
typedef struct
{
......@@ -238,7 +226,7 @@ extern PageListStruct *PMPages;
extern char PageFileName[13];
extern void PM_Startup(void),
void PM_Startup(void),
PM_Shutdown(void),
PM_Reset(void),
PM_Preload(boolean (*update)(word current,word total)),
......@@ -246,7 +234,7 @@ extern void PM_Startup(void),
PM_SetPageLock(int pagenum,PMLockType lock),
PM_SetMainPurge(int level),
PM_CheckMainMem(void);
extern memptr PM_GetPageAddress(int pagenum),
memptr PM_GetPageAddress(int pagenum),
PM_GetPage(int pagenum); // Use this one to cache page
void PM_SetMainMemPurge(int level);
#ifndef __ID_HEADS_H__
#define __ID_HEADS_H__
#include <unistd.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
......@@ -9,6 +10,9 @@
#include <string.h>
#include <sys/stat.h>
#include <values.h>
#include <sys/types.h>
#include "misc.h"
#include "version.h"
......
......@@ -14,10 +14,10 @@ void alOut(byte n,byte b);
typedef enum {
sdm_Off,
sdm_PC,sdm_AdLib,
sdm_PC, sdm_AdLib
} SDMode;
typedef enum {
smm_Off,smm_AdLib
smm_Off, smm_AdLib
} SMMode;
typedef enum {
sds_Off,sds_PC,sds_SoundSource,sds_SoundBlaster
......
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include "misc.h"
long filelength(int handle)
{
struct stat buf;
if (fstat(handle, &buf) == -1) {
perror("filelength");
exit(EXIT_FAILURE);
}
return buf.st_size;
}
#ifndef __MISC_H__
#define __MISC_H__
long filelength(int handle);
#elif
#error "fix me TODO"
#endif
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