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

More cleanups

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