Changeset 128

Show
Ignore:
Timestamp:
05/12/07 08:36:30 (2 years ago)
Author:
takkaria
Message:

Slim down ports further (nuke VCS, DOS, IBM, LFB).
Nuke h-config and incorporate it into h-basic.h, now it's much simpler.
Clear up some dead code.

That's all for #110 for 3.0.8; main-xaw can be sorted out in 3.0.9.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/Makefile.src

    r127 r128  
    66# 
    77 
    8 HDRS = h-basic.h h-config.h 
     8HDRS = h-basic.h 
    99INCS = angband.h config.h defines.h externs.h types.h \ 
    1010       z-term.h z-rand.h z-type.h z-util.h z-virt.h z-form.h 
     
    1414ZFILES = z-file z-form z-rand z-term z-type z-util z-virt 
    1515MAINFILES = main maid-x11 \ 
    16         $(addprefix main-,crb dos gcu gtk ibm ros sdl vcs win x11 xaw) 
     16        $(addprefix main-,crb gcu gtk ros sdl win x11 xaw) 
    1717 
    1818ANGFILES = \ 
  • trunk/src/Makefile.std

    r127 r128  
    44# This makefile probably requires GNU make. 
    55# 
    6 # This makefile is intended for use with Unix machines running X11, gtk, 
    7 # (n)curses, termcap, or VT100, Slang, Linux VCS or SVGA library.  You can 
    8 # choose what systems below. 
     6# This makefile is intended for use with Unix machines running X11, gtk or  
     7# (n)curses.  You can choose which you want to compile for below. 
    98# 
    109# You can also place your alterations to a file in the src/ directory called  
    1110# "config", in which case that file will override what is specified here. 
    12 # 
    13 # If you used to use Makefile.gtk or Makefile.lsl, uncomment the appropriate 
    14 # lines below. 
    1511# 
    1612 
     
    4440SYS_gtk = -DUSE_GTK $(shell pkg-config gtk+-2.0 --libs --cflags) 
    4541 
    46 # Support raw console access (main-lfb.c) -- Linux only 
    47 SYS_lfb = -DUSE_LFB 
    48  
    4942# Support SDL frontend 
    5043#SYS_sdl = -DUSE_SDL $(shell sdl-config --cflags) $(shell sdl-config --libs) -lSDL_ttf 
    5144 
    52  
    53  
    54  
    55 # Old raw tty protocols that may not work 
    56 # With curses support, all are effectively superceded by USE_GCU 
    57  
    58 # Support direct termio on 8bit color-depth screen (main-vcs.c) 
    59 #SYS_vcs = -DUSE_VCS 
    6045 
    6146 
     
    9883# Enable linux-specific modules, if requested. 
    9984ifeq ($(uname),Linux) 
    100   MODULES += $(SYS_lfb) $(SYS_vcs) 
    101   LINUXOBJS = main-vcs.o main-lfb.o 
    10285  CFLAGS += -DHAVE_MKSTEMP 
    10386endif 
     
    10689# Object definitions 
    10790X11OBJS = maid-x11.o main-x11.o main-xaw.o main-gtk.o 
    108 MAINOBJS = main.o main-gcu.o main-sdl.o $(X11OBJS) $(LINUXOBJS) 
     91MAINOBJS = main.o main-gcu.o main-sdl.o $(X11OBJS) 
    10992OBJS = $(BASEOBJS) $(MAINOBJS) 
    11093 
  • trunk/src/config.h

    r103 r128  
    377377#endif 
    378378 
    379 /* 
    380  * Hack -- Special "ancient machine" versions 
    381  */ 
    382 #if defined(USE_286) || defined(ANGBAND_LITE_MAC) 
    383 # ifndef ANGBAND_LITE 
    384 #  define ANGBAND_LITE 
    385 # endif 
    386 #endif 
    387379 
    388380/* 
  • trunk/src/h-basic.h

    r87 r128  
    1313 
    1414 
    15 /* 
    16  * h-config sets various system-specific defines, relied on later in this file 
    17  * and throughout the game. 
    18  */ 
    19 #include "h-config.h" 
     15/*** Autodetect platform ***/ 
     16 
     17/* 
     18 * Extract the "RISCOS" flag from the compiler 
     19 */ 
     20#ifdef __riscos 
     21# ifndef RISCOS 
     22#  define RISCOS 
     23# endif 
     24#endif 
     25 
     26 
     27/* 
     28 * Extract the "WINDOWS" flag from the compiler 
     29 */ 
     30#if defined(_Windows) || defined(__WINDOWS__) || \ 
     31    defined(__WIN32__) || defined(WIN32) || \ 
     32    defined(__WINNT__) || defined(__NT__) 
     33# ifndef WINDOWS 
     34#  define WINDOWS 
     35# endif 
     36#endif 
     37 
     38 
     39/* 
     40 * OPTION: set "SET_UID" if the machine is a "multi-user" machine. 
     41 * 
     42 * This option is used to verify the use of "uids" and "gids" for 
     43 * various "Unix" calls, and of "pids" for getting a random seed, 
     44 * and of the "umask()" call for various reasons, and to guess if 
     45 * the "kill()" function is available, and for permission to use 
     46 * functions to extract user names and expand "tildes" in filenames. 
     47 * It is also used for "locking" and "unlocking" the score file. 
     48 * Basically, SET_UID should *only* be set for "Unix" machines. 
     49 */ 
     50#if !defined(MACH_O_CARBON) && !defined(WINDOWS) && \ 
     51    !defined(RISCOS) && !defined(GAMEBOY) 
     52# define SET_UID 
     53#endif 
     54 
     55 
     56/* 
     57 * Every system seems to use its own symbol as a path separator. 
     58 * 
     59 * Default to the standard Unix slash, but attempt to change this 
     60 * for various other systems.  Note that any system that uses the 
     61 * "period" as a separator (i.e. RISCOS) will have to pretend that 
     62 * it uses the slash, and do its own mapping of period <-> slash. 
     63 * 
     64 * It is most definitely wrong to have such things here.  Platform-specific 
     65 * code should handle shifting Angband filenames to platform ones. XXX 
     66 */ 
     67#undef PATH_SEP 
     68#define PATH_SEP "/" 
     69 
     70#ifdef WINDOWS 
     71# undef PATH_SEP 
     72# define PATH_SEP "\\" 
     73#endif 
     74 
     75 
     76/* 
     77 * Mac support 
     78 */ 
     79#ifdef MACH_O_CARBON 
     80 
     81/* OS X uses filetypes when creating files. */ 
     82# define FILE_TYPE_TEXT 'TEXT' 
     83# define FILE_TYPE_DATA 'DATA' 
     84# define FILE_TYPE_SAVE 'SAVE' 
     85# define FILE_TYPE(X) (_ftype = (X)) 
     86 
     87#else 
     88 
     89# define FILE_TYPE(X) ((void)0) 
     90 
     91#endif 
    2092 
    2193 
  • trunk/src/main-gcu.c

    r87 r128  
    8585#define USE_TPOSIX 
    8686 
    87 /* 
    88  * Hack -- Amiga uses "fake curses" and cannot do any of this stuff 
    89  */ 
    90 #if defined(AMIGA) 
    91 # undef USE_TPOSIX 
    92 #endif 
    9387 
    9488/* 
  • trunk/src/main.c

    r115 r128  
    4646#endif /* USE_X11 */ 
    4747 
    48 #ifdef USE_XPJ 
    49         { "xpj", help_xpj, init_xpj }, 
    50 #endif /* USE_XPJ */ 
    51  
    5248#ifdef USE_GCU 
    5349        { "gcu", help_gcu, init_gcu }, 
    5450#endif /* USE_GCU */ 
    55  
    56 #ifdef USE_CAP 
    57         { "cap", help_cap, init_cap }, 
    58 #endif /* USE_CAP */ 
    59  
    60 #ifdef USE_DOS 
    61         { "dos", help_dos, init_dos }, 
    62 #endif /* USE_DOS */ 
    63  
    64 #ifdef USE_IBM 
    65         { "ibm", help_ibm, init_ibm }, 
    66 #endif /* USE_IBM */ 
    67  
    68 #ifdef USE_EMX 
    69         { "emx", help_emx, init_emx }, 
    70 #endif /* USE_EMX */ 
    71  
    72 #ifdef USE_SLA 
    73         { "sla", help_sla, init_sla }, 
    74 #endif /* USE_SLA */ 
    75  
    76 #ifdef USE_LSL 
    77         { "lsl", help_lsl, init_lsl }, 
    78 #endif /* USE_LSL */ 
    79  
    80 #ifdef USE_AMI 
    81         { "ami", help_ami, init_ami }, 
    82 #endif /* USE_AMI */ 
    83  
    84 #ifdef USE_VCS 
    85         { "vcs", help_vcs, init_vcs }, 
    86 #endif /* USE_VCS */ 
    87  
    88 #ifdef USE_LFB 
    89         { "lfb", help_lfb, init_lfb }, 
    90 #endif /* USE_LFB */ 
    9151}; 
    9252 
     
    11676 
    11777 
    118  
    119 /* 
    120  * Set the stack size (for the Amiga) 
    121  */ 
    122 #ifdef AMIGA 
    123 # include <dos.h> 
    124 __near long __stack = 32768L; 
    125 #endif /* AMIGA */ 
    126  
    127  
    128 /* 
    129  * Set the stack size and overlay buffer (see main-286.c") 
    130  */ 
    131 #ifdef USE_286 
    132 # include <dos.h> 
    133 extern unsigned _stklen = 32768U; 
    134 extern unsigned _ovrbuffer = 0x1500; 
    135 #endif /* USE_286 */ 
    13678 
    13779/* 
     
    158100 * relevant "sub-directory names" to the given path. 
    159101 * 
    160  * Note that the "path" must be "Angband:" for the Amiga, and it 
    161  * is ignored for "VM/ESA", so I just combined the two. 
    162  * 
    163102 * Make sure that the path doesn't overflow the buffer.  We have 
    164103 * to leave enough space for the path separator, directory, and 
     
    169108        char path[1024]; 
    170109 
    171 #if defined(AMIGA) 
    172  
    173         /* Hack -- prepare "path" */ 
    174         strcpy(path, "Angband:"); 
    175  
    176 #else /* AMIGA */ 
    177  
    178110        cptr tail = NULL; 
    179111 
     
    193125        /* Hack -- Add a path separator (only if needed) */ 
    194126        if (!suffix(path, PATH_SEP)) my_strcat(path, PATH_SEP, sizeof(path)); 
    195  
    196 #endif /* AMIGA */ 
    197127 
    198128        /* Initialize */ 
     
    330260 
    331261 
    332 #ifdef USE_286 
    333         /* Attempt to use XMS (or EMS) memory for swap space */ 
    334         if (_OvrInitExt(0L, 0L)) 
    335         { 
    336                 _OvrInitEms(0, 0, 64); 
    337         } 
    338 #endif /* USE_286 */ 
    339  
    340  
    341262#ifdef SET_UID 
    342263 
     
    355276        /* Get the user id (?) */ 
    356277        player_uid = getuid(); 
    357  
    358 #ifdef VMS 
    359         /* Mega-Hack -- Factor group id */ 
    360         player_uid += (getgid() * 1000); 
    361 #endif /* VMS */ 
    362278 
    363279# ifdef SAFE_SETUID 
  • trunk/src/z-file.c

    r127 r128  
    798798 
    799799 
     800/* 
     801 * Assume UNIX-style directory handling. 
     802 */ 
     803#if !defined(HAVE_CONFIG_H) && !defined(WINDOWS) && !defined(RISCOS) 
     804#define HAVE_DIRENT_H 
     805#endif 
     806 
     807 
    800808#ifdef WINDOWS 
    801809