From 1e70c8a46b597a99b1063ed6e18b422f98ffa33c Mon Sep 17 00:00:00 2001 From: erysdren Date: Sun, 22 Sep 2024 17:52:09 -0500 Subject: [PATCH] Remove some unused headers and other cleanup (#89) --- rott/_isr.h | 32 ----- rott/isr.c | 1 - rott/modexlib.c | 1 - rott/myprint.h | 33 ----- rott/rt_net.c | 1 - rott/rt_str.c | 1 - rott/rt_str.h | 2 - rott/rt_util.h | 6 + rott/splib.h | 207 --------------------------- rott/{vga_font_cp437.h => vgafont.h} | 0 rott/vgatext.c | 2 +- 11 files changed, 7 insertions(+), 279 deletions(-) delete mode 100644 rott/_isr.h delete mode 100644 rott/myprint.h delete mode 100644 rott/splib.h rename rott/{vga_font_cp437.h => vgafont.h} (100%) diff --git a/rott/_isr.h b/rott/_isr.h deleted file mode 100644 index e53a307..0000000 --- a/rott/_isr.h +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright (C) 1994-1995 Apogee Software, Ltd. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -*/ -//*************************************************************************** -// -// ISR Constants -// -//*************************************************************************** - -#ifndef _isr_private -#define _isr_private - -#define TIMERINT 0x08 -#define KEYBOARDINT 0x09 - -#endif diff --git a/rott/isr.c b/rott/isr.c index c63792b..6d73eb2 100644 --- a/rott/isr.c +++ b/rott/isr.c @@ -32,7 +32,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "rt_def.h" #include "isr.h" -#include "_isr.h" #include "rt_in.h" #include "rt_util.h" #include "profile.h" diff --git a/rott/modexlib.c b/rott/modexlib.c index 15a6bfd..b7b7c19 100644 --- a/rott/modexlib.c +++ b/rott/modexlib.c @@ -30,7 +30,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "modexlib.h" #include "rt_util.h" #include "rt_net.h" // for GamePaused -#include "myprint.h" #include "isr.h" // for VBLCOUNTER diff --git a/rott/myprint.h b/rott/myprint.h deleted file mode 100644 index e830a5f..0000000 --- a/rott/myprint.h +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright (C) 1994-1995 Apogee Software, Ltd. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -*/ -#ifndef __MYPRINT_H -#define __MYPRINT_H - -enum COLORS - { - BLACK, BLUE, GREEN, CYAN, RED, MAGENTA, BROWN, LIGHTGRAY, DARKGRAY, - LIGHTBLUE, LIGHTGREEN, LIGHTCYAN, LIGHTRED, LIGHTMAGENTA, YELLOW, WHITE - }; - -#define NONE -1 -#define SINGLE_FRAME -1 -#define DOUBLE_FRAME -2 - -#endif diff --git a/rott/rt_net.c b/rott/rt_net.c index 79309b5..f032876 100644 --- a/rott/rt_net.c +++ b/rott/rt_net.c @@ -41,7 +41,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "rt_rand.h" #include "rt_game.h" #include "rt_draw.h" -#include "myprint.h" #include "rt_debug.h" #include "rt_view.h" #include "rt_battl.h" diff --git a/rott/rt_str.c b/rott/rt_str.c index fafd002..89e530d 100644 --- a/rott/rt_str.c +++ b/rott/rt_str.c @@ -49,7 +49,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "rt_msg.h" #include "rt_playr.h" #include "rt_sound.h" -#include "myprint.h" //****************************************************************************** diff --git a/rott/rt_str.h b/rott/rt_str.h index 125dbbf..b723459 100644 --- a/rott/rt_str.h +++ b/rott/rt_str.h @@ -120,6 +120,4 @@ void DrawIntensityString (unsigned short x, unsigned short y, const char *string void VW_MeasureIntensityPropString (const char *string, int *width, int *height); byte GetIntensityColor (byte pix); -#include "myprint.h" - #endif diff --git a/rott/rt_util.h b/rott/rt_util.h index b0648fc..924e54b 100644 --- a/rott/rt_util.h +++ b/rott/rt_util.h @@ -33,6 +33,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "m_misc2.h" #include "develop.h" +enum COLORS + { + BLACK, BLUE, GREEN, CYAN, RED, MAGENTA, BROWN, LIGHTGRAY, DARKGRAY, + LIGHTBLUE, LIGHTGREEN, LIGHTCYAN, LIGHTRED, LIGHTMAGENTA, YELLOW, WHITE + }; + extern int egacolor[16]; extern byte * origpal; extern int _argc; diff --git a/rott/splib.h b/rott/splib.h deleted file mode 100644 index 9945eb5..0000000 --- a/rott/splib.h +++ /dev/null @@ -1,207 +0,0 @@ -/* -Copyright (C) 1994-1995 Apogee Software, Ltd. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -*/ -#ifndef SPLIB_H -#define SPLIB_H - -/* ======================================================================= * - * Please Read "SpReadme.doc" for usage * - * ======================================================================= */ - -/* ======================================================================= * - * Compiler & Memory Mode Wrappers. * - * ----------------------------------------------------------------------- */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(REALMODE) -#define FAR __far -#else -#define FAR -#endif - -//--------------------------------------------------------------------------- -// Constants - -#define TSR_SERIAL_LENGTH 14 -#define TSR_MAX_LENGTH 80 - -//--------------------------------------------------------------------------- - -typedef struct { - char copyright[TSR_MAX_LENGTH]; // driver copyright - short major; // driver version number - short minor; - short count; // # of available devices -} SpwDrvOpenPacket; - - - -typedef struct { - char copyright[TSR_MAX_LENGTH]; // device copyright - char serial[TSR_SERIAL_LENGTH]; // device serial number -} SpwDevOpenPacket; - - - -typedef struct { - long timestamp; // time of event - unsigned short period; // period since last MOVEMENT - unsigned short button; // button pressed mask - short tx; // Translation X - short ty; // Y - short tz; // Z - short rx; // Rotation X - short ry; // Y - short rz; // Z -} SpwForcePacket; - - - -typedef struct { - long timestamp; // time of event - unsigned short period; // period since last BUTTON - unsigned short button; // button pressed mask -} SpwButtonPacket; - - - -typedef struct { - unsigned long data; // MUST be TSRCMD_DATA -} SpwCommandPacket; - -#define TSRCMD_DATA 0xFF0000FF - -//--------------------------------------------------------------------------- - -typedef union { - char padding[128]; /* Extra room for future expansion */ - - SpwCommandPacket command; - - SpwDrvOpenPacket drvOpen; - SpwDevOpenPacket devOpen; - - SpwForcePacket force; - SpwButtonPacket button; -} SpwPacket; - - - -// TSR Interrupt Functions -#define TSR_DRIVER_CLOSE 0x0000 -#define TSR_DRIVER_OPEN 0x8001 -#define TSR_DEVICE_CLOSE 0x0002 -#define TSR_DEVICE_OPEN 0x8003 - -#define TSR_DEVICE_DISABLE 0x0010 -#define TSR_DEVICE_ENABLE 0x0011 - -#define TSR_DEVICE_GETFORCE 0x8020 -#define TSR_DEVICE_GETBUTTONS 0x8021 - -/* ======================================================================= * - * Function Prototypes * - * ======================================================================= */ - -short SpwOpenDriver(SpwPacket FAR *packet); -short SpwCloseDriver(void); - -short SpwOpenDevice(short device, SpwPacket FAR *packet); -short SpwCloseDevice(short device); - -short SpwEnableDevice(short device); -short SpwDisableDevice(short device); - -short SpwGetForce(short device, SpwPacket FAR *packet); -short SpwGetButton(short device, SpwPacket FAR *packet); - -/* ======================================================================= * - * Convience functions * - * ======================================================================= */ - -/* ----------------------------------------------------------------------- * - * The SpwSimple... functions are just convienence wrappers for the above * - * functions. * - * ----------------------------------------------------------------------- */ - -#ifndef SPWSTRUCTS -#define SPWSTRUCTS - -enum SpwDeviceType { - SPW_AVENGER=1, -}; - - - -enum SpwEventType { - SPW_NO_EVENT=0, - SPW_BUTTON_HELD=1, - SPW_BUTTON_DOWN=2, - SPW_BUTTON_UP=4, - SPW_MOTION=8 -}; - - - -/* ----------------------------------------------------------------------- * - * Data struct for handling library calls * - * ----------------------------------------------------------------------- */ - -typedef struct { - short new; - short cur; - short old; -} SpwButtonRec; - - - -typedef struct { - short tx; /* Current Translation vector */ - short ty; - short tz; - short rx; /* Current Rotation vector */ - short ry; - short rz; - SpwButtonRec buttons; /* Current Button Record */ - short newData; /* An SpEventType mask of newData, 0 if none */ -} SpwRawData; - -#endif - - - -short SpwSimpleGet(short devNum, SpwRawData FAR *splayer); -short SpwSimpleOpen(short devNum); -short SpwSimpleClose(short devNum); - -/* ======================================================================= * - * Compiler & Memory Mode Wrappers. * - * ======================================================================= * - */ - -#ifdef __cplusplus -}; -#endif - -/* ======================================================================= */ -#endif - diff --git a/rott/vga_font_cp437.h b/rott/vgafont.h similarity index 100% rename from rott/vga_font_cp437.h rename to rott/vgafont.h diff --git a/rott/vgatext.c b/rott/vgatext.c index bd4adaf..3dc9238 100644 --- a/rott/vgatext.c +++ b/rott/vgatext.c @@ -24,7 +24,7 @@ SOFTWARE. #include "SDL.h" -#include "vga_font_cp437.h" +#include "vgafont.h" #define BLINK_HZ ((1000 / 70) * 16)