From 6e37b33f44057ab61b2338befa92b4589ec5c21f Mon Sep 17 00:00:00 2001 From: Joseph Carter Date: Sun, 14 May 2000 16:56:28 +0000 Subject: [PATCH] sys.h is no longer part of quakedef.h sys_wina.S is now sys_x86.S (same as now gone sys_dosa.S, used on Linux too) Updated Linux Makefile to reflect above Linux translation table thingy now compiles properly --- include/quakedef.h | 2 +- include/sys.h | 45 ++++-------------------------- source/Makefile | 2 +- source/cl_demo.c | 1 + source/cl_ents.c | 1 + source/cl_main.c | 6 ++-- source/cl_parse.c | 1 + source/cl_tent.c | 1 + source/cmd.c | 1 + source/common.c | 1 + source/console.c | 1 + source/d_modech.c | 1 + source/d_surf.c | 1 + source/draw.c | 1 + source/gl_parse.c | 1 + source/gl_refrag.c | 1 + source/keys.c | 5 +++- source/menu.c | 3 ++ source/net_udp.c | 1 + source/pmovetst.c | 1 + source/r_alias.c | 1 + source/r_bsp.c | 1 + source/r_efrag.c | 1 + source/r_main.c | 1 + source/r_misc.c | 1 + source/r_sprite.c | 1 + source/r_surf.c | 1 + source/screen.c | 1 + source/skin.c | 1 + source/snd_dma.c | 1 + source/snd_mem.c | 1 + source/sys_linux.c | 47 +++++++++++++++++++++++++++++--- source/{sys_wina.S => sys_x86.S} | 0 source/vid_svgalib.c | 1 + source/vid_x11.c | 1 + source/wad.c | 1 + source/zone.c | 1 + 37 files changed, 90 insertions(+), 49 deletions(-) rename source/{sys_wina.S => sys_x86.S} (100%) diff --git a/include/quakedef.h b/include/quakedef.h index e4e2064..fbc1871 100644 --- a/include/quakedef.h +++ b/include/quakedef.h @@ -42,7 +42,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "common.h" #include "bspfile.h" #include "vid.h" -#include "sys.h" +//#include "sys.h" #include "zone.h" #include "mathlib.h" #include "wad.h" diff --git a/include/sys.h b/include/sys.h index bc75930..3eba678 100644 --- a/include/sys.h +++ b/include/sys.h @@ -19,46 +19,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // sys.h -- non-portable functions -// -// Translation table for text consoles -// -char trans_table[256] = -{ - '\0', '#', '#', '#', '#', '.', '#', '#', - '#', 9, 10, '#', ' ', 13, '.', '.', - '[', ']', '0', '1', '2', '3', '4', '5', - '6', '7', '8', '9', '.', '<', '=', '>', - ' ', '!', '"', '#', '$', '%', '&', '\'', - '(', ')', '*', '+', ',', '-', '.', '/', - '0', '1', '2', '3', '4', '5', '6', '7', - '8', '9', ':', ';', '<', '=', '>', '?', - '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', - 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', - 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', - 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', - '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', - 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', - 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', - 'x', 'y', 'z', '{', '|', '}', '~', '<', - - '<', '=', '>', '#', '#', '.', '#', '#', - '#', '#', ' ', '#', ' ', '>', '.', '.', - '[', ']', '0', '1', '2', '3', '4', '5', - '6', '7', '8', '9', '.', '<', '=', '>', - ' ', '!', '"', '#', '$', '%', '&', '\'', - '(', ')', '*', '+', ',', '-', '.', '/', - '0', '1', '2', '3', '4', '5', '6', '7', - '8', '9', ':', ';', '<', '=', '>', '?', - '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', - 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', - 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', - 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', - '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', - 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', - 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', - 'x', 'y', 'z', '{', '|', '}', '~', '<' -}; - +#ifndef __SYS_H +#define __SYS_H // // file IO @@ -114,3 +76,6 @@ void Sys_Printf (char *fmt, ...); // send text to the console void Sys_Init (void); + +#endif // __SYS_H + diff --git a/source/Makefile b/source/Makefile index 5cade2d..ed2c382 100644 --- a/source/Makefile +++ b/source/Makefile @@ -152,7 +152,7 @@ CL_sources=\ menu.c \ keys.c \ console.c \ - sys_dosa.S + sys_x86.S CL_dependencies = $(patsubst %,%.d,$(basename $(CL_sources))) CL_objects = $(patsubst %.d,%.o,$(CL_dependencies)) diff --git a/source/cl_demo.c b/source/cl_demo.c index 7794132..1c66977 100644 --- a/source/cl_demo.c +++ b/source/cl_demo.c @@ -26,6 +26,7 @@ $Id$ */ +#include "sys.h" #include "quakedef.h" void CL_FinishTimeDemo (void); diff --git a/source/cl_ents.c b/source/cl_ents.c index 6e418f8..528bb08 100644 --- a/source/cl_ents.c +++ b/source/cl_ents.c @@ -27,6 +27,7 @@ */ // cl_ents.c -- entity parsing and management +#include "sys.h" #include "quakedef.h" extern cvar_t cl_predict_players; diff --git a/source/cl_main.c b/source/cl_main.c index 587dba5..92b9dbd 100644 --- a/source/cl_main.c +++ b/source/cl_main.c @@ -27,15 +27,17 @@ */ // cl_main.c -- client main loop +#include + +#include "sys.h" #include "quakedef.h" -#include "winquake.h" #ifdef _WIN32 +#include "winquake.h" #include "winsock.h" #include "in_win.h" #else #include #endif -#include // we need to declare some mouse variables here, because the menu system diff --git a/source/cl_parse.c b/source/cl_parse.c index 21bf2d4..a880724 100644 --- a/source/cl_parse.c +++ b/source/cl_parse.c @@ -27,6 +27,7 @@ */ // cl_parse.c -- parse a message received from the server +#include "sys.h" #include "quakedef.h" extern cvar_t gl_flashblend; diff --git a/source/cl_tent.c b/source/cl_tent.c index d1bf365..0ba9673 100644 --- a/source/cl_tent.c +++ b/source/cl_tent.c @@ -27,6 +27,7 @@ */ // cl_tent.c -- client side temporary entities +#include "sys.h" #include "quakedef.h" diff --git a/source/cmd.c b/source/cmd.c index 14c0315..1634b7a 100644 --- a/source/cmd.c +++ b/source/cmd.c @@ -27,6 +27,7 @@ */ // cmd.c -- Quake script command processing module +#include "sys.h" #include "quakedef.h" void Cmd_ForwardToServer (void); diff --git a/source/common.c b/source/common.c index 97a582c..099675e 100644 --- a/source/common.c +++ b/source/common.c @@ -29,6 +29,7 @@ #include +#include "sys.h" #include "quakedef.h" #define MAX_NUM_ARGVS 50 diff --git a/source/console.c b/source/console.c index d7d7a7a..d21ad81 100644 --- a/source/console.c +++ b/source/console.c @@ -26,6 +26,7 @@ $Id$ */ +#include "sys.h" #include "quakedef.h" int con_ormask; diff --git a/source/d_modech.c b/source/d_modech.c index 32934e1..26259da 100644 --- a/source/d_modech.c +++ b/source/d_modech.c @@ -27,6 +27,7 @@ */ // d_modech.c: called when mode has just changed +#include "sys.h" #include "quakedef.h" #include "d_local.h" diff --git a/source/d_surf.c b/source/d_surf.c index 2a21075..833443a 100644 --- a/source/d_surf.c +++ b/source/d_surf.c @@ -27,6 +27,7 @@ */ // d_surf.c: rasterization driver surface heap manager +#include "sys.h" #include "quakedef.h" #include "d_local.h" #include "r_local.h" diff --git a/source/draw.c b/source/draw.c index 24ef85a..0b07726 100644 --- a/source/draw.c +++ b/source/draw.c @@ -28,6 +28,7 @@ // draw.c -- this is the only file outside the refresh that touches the // vid buffer +#include "sys.h" #include "quakedef.h" typedef struct { diff --git a/source/gl_parse.c b/source/gl_parse.c index cae4c10..69a92aa 100644 --- a/source/gl_parse.c +++ b/source/gl_parse.c @@ -27,6 +27,7 @@ */ // cl_parse.c -- parse a message received from the server +#include "sys.h" #include "quakedef.h" #include "glquake.h" diff --git a/source/gl_refrag.c b/source/gl_refrag.c index 0572bec..79b4b01 100644 --- a/source/gl_refrag.c +++ b/source/gl_refrag.c @@ -26,6 +26,7 @@ $Id$ */ +#include "sys.h" #include "quakedef.h" mnode_t *r_pefragtopnode; diff --git a/source/keys.c b/source/keys.c index 8657146..7226182 100644 --- a/source/keys.c +++ b/source/keys.c @@ -26,10 +26,13 @@ $Id$ */ -#include "quakedef.h" #ifdef _WIN32 #include #endif + +#include "sys.h" +#include "quakedef.h" + /* key up events are sent even if in console mode diff --git a/source/menu.c b/source/menu.c index 6783449..1bf8557 100644 --- a/source/menu.c +++ b/source/menu.c @@ -26,8 +26,11 @@ $Id$ */ +#include "sys.h" #include "quakedef.h" +#ifdef _WIN32 #include "winquake.h" +#endif void (*vid_menudrawfn)(void); void (*vid_menukeyfn)(int key); diff --git a/source/net_udp.c b/source/net_udp.c index 506a437..1b17079 100644 --- a/source/net_udp.c +++ b/source/net_udp.c @@ -26,6 +26,7 @@ $Id$ */ +#include "sys.h" #include "quakedef.h" #include diff --git a/source/pmovetst.c b/source/pmovetst.c index 23afd44..2f45384 100644 --- a/source/pmovetst.c +++ b/source/pmovetst.c @@ -26,6 +26,7 @@ $Id$ */ +#include "sys.h" #include "quakedef.h" static hull_t box_hull; diff --git a/source/r_alias.c b/source/r_alias.c index 261f66f..5cc5c60 100644 --- a/source/r_alias.c +++ b/source/r_alias.c @@ -27,6 +27,7 @@ */ // r_alias.c: routines for setting up to draw alias models +#include "sys.h" #include "quakedef.h" #include "r_local.h" #include "d_local.h" // FIXME: shouldn't be needed (is needed for patch diff --git a/source/r_bsp.c b/source/r_bsp.c index a9e4588..eecdc2a 100644 --- a/source/r_bsp.c +++ b/source/r_bsp.c @@ -26,6 +26,7 @@ $Id$ */ +#include "sys.h" #include "quakedef.h" #include "r_local.h" diff --git a/source/r_efrag.c b/source/r_efrag.c index 506242e..0e845ea 100644 --- a/source/r_efrag.c +++ b/source/r_efrag.c @@ -26,6 +26,7 @@ $Id$ */ +#include "sys.h" #include "quakedef.h" #include "r_local.h" diff --git a/source/r_main.c b/source/r_main.c index a2575f8..cf3681c 100644 --- a/source/r_main.c +++ b/source/r_main.c @@ -26,6 +26,7 @@ $Id$ */ +#include "sys.h" #include "quakedef.h" #include "r_local.h" diff --git a/source/r_misc.c b/source/r_misc.c index 48530c0..df0a0c0 100644 --- a/source/r_misc.c +++ b/source/r_misc.c @@ -26,6 +26,7 @@ $Id$ */ +#include "sys.h" #include "quakedef.h" #include "r_local.h" diff --git a/source/r_sprite.c b/source/r_sprite.c index d905243..89a427e 100644 --- a/source/r_sprite.c +++ b/source/r_sprite.c @@ -26,6 +26,7 @@ $Id$ */ +#include "sys.h" #include "quakedef.h" #include "r_local.h" diff --git a/source/r_surf.c b/source/r_surf.c index e92fb49..2411bfb 100644 --- a/source/r_surf.c +++ b/source/r_surf.c @@ -27,6 +27,7 @@ */ // r_surf.c: surface-related refresh code +#include "sys.h" #include "quakedef.h" #include "r_local.h" diff --git a/source/screen.c b/source/screen.c index 51e3d68..4adcb79 100644 --- a/source/screen.c +++ b/source/screen.c @@ -27,6 +27,7 @@ */ // screen.c -- master for refresh, status bar, console, chat, notify, etc +#include "sys.h" #include "quakedef.h" #include "r_local.h" diff --git a/source/skin.c b/source/skin.c index faf5473..fe47d72 100644 --- a/source/skin.c +++ b/source/skin.c @@ -26,6 +26,7 @@ $Id$ */ +#include "sys.h" #include "quakedef.h" cvar_t baseskin = {"baseskin", "base"}; diff --git a/source/snd_dma.c b/source/snd_dma.c index 3c0629d..d9039d0 100644 --- a/source/snd_dma.c +++ b/source/snd_dma.c @@ -27,6 +27,7 @@ */ // snd_dma.c -- main control for any streaming sound output device +#include "sys.h" #include "quakedef.h" #ifdef _WIN32 diff --git a/source/snd_mem.c b/source/snd_mem.c index 89d50a8..653532f 100644 --- a/source/snd_mem.c +++ b/source/snd_mem.c @@ -27,6 +27,7 @@ */ // snd_mem.c: sound caching +#include "sys.h" #include "quakedef.h" int cache_full_cycle; diff --git a/source/sys_linux.c b/source/sys_linux.c index 37e82d3..78f6e53 100644 --- a/source/sys_linux.c +++ b/source/sys_linux.c @@ -45,6 +45,7 @@ #include #include +#include "sys.h" #include "quakedef.h" int noconinput = 0; @@ -56,6 +57,47 @@ qboolean is_server = false; cvar_t sys_linerefresh = {"sys_linerefresh","0"};// set for entity display +// +// Translation table for text consoles +// +char qfont_table[256] = +{ + '\0', '#', '#', '#', '#', '.', '#', '#', + '#', 9, 10, '#', ' ', 13, '.', '.', + '[', ']', '0', '1', '2', '3', '4', '5', + '6', '7', '8', '9', '.', '<', '=', '>', + ' ', '!', '"', '#', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', ':', ';', '<', '=', '>', '?', + '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', + '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', + 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', '{', '|', '}', '~', '<', + + '<', '=', '>', '#', '#', '.', '#', '#', + '#', '#', ' ', '#', ' ', '>', '.', '.', + '[', ']', '0', '1', '2', '3', '4', '5', + '6', '7', '8', '9', '.', '<', '=', '>', + ' ', '!', '"', '#', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', ':', ';', '<', '=', '>', '?', + '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', + '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', + 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', '{', '|', '}', '~', '<' +}; + + // ======================================================================= // General routines // ======================================================================= @@ -128,10 +170,7 @@ void Sys_Printf (char *fmt, ...) return; for (p = (unsigned char *)text; *p; p++) - if ((*p > 128 || *p < 32) && *p != 10 && *p != 13 && *p != 9) - printf("[%02x]", *p); - else - putc(*p, stdout); + putc(qfont_table[*p], stdout); } void Sys_Quit (void) diff --git a/source/sys_wina.S b/source/sys_x86.S similarity index 100% rename from source/sys_wina.S rename to source/sys_x86.S diff --git a/source/vid_svgalib.c b/source/vid_svgalib.c index 2f50391..77fc820 100644 --- a/source/vid_svgalib.c +++ b/source/vid_svgalib.c @@ -36,6 +36,7 @@ #include +#include "sys.h" #include "vga.h" #include "vgakeyboard.h" #include "vgamouse.h" diff --git a/source/vid_x11.c b/source/vid_x11.c index e7c353b..7ec4b82 100644 --- a/source/vid_x11.c +++ b/source/vid_x11.c @@ -47,6 +47,7 @@ typedef unsigned short PIXEL; #include #include +#include "sys.h" #include "quakedef.h" #include "d_local.h" diff --git a/source/wad.c b/source/wad.c index 96d4707..24dc2a8 100644 --- a/source/wad.c +++ b/source/wad.c @@ -26,6 +26,7 @@ $Id$ */ +#include "sys.h" #include "quakedef.h" int wad_numlumps; diff --git a/source/zone.c b/source/zone.c index 16542ed..6d547a4 100644 --- a/source/zone.c +++ b/source/zone.c @@ -26,6 +26,7 @@ $Id$ */ +#include "sys.h" #include "quakedef.h" #define DYNAMIC_SIZE 0x20000