flag adjustments (trunk only)

Move all system or port specific flags to sysflags which is used only if
SYSFLAGS is defined, and leave everything else in flags unconditional.
This commit is contained in:
nethack.allison
2003-11-09 11:48:38 +00:00
parent da80c0572e
commit 7bab241f17
17 changed files with 107 additions and 73 deletions

View File

@@ -137,6 +137,9 @@ struct trap *ftrap = (struct trap *)0;
NEARDATA struct monst youmonst = DUMMY;
NEARDATA struct context_info context = DUMMY;
NEARDATA struct flag flags = DUMMY;
#ifdef SYSFLAGS
NEARDATA struct sysflag sysflags = DUMMY;
#endif
NEARDATA struct instance_flags iflags = DUMMY;
NEARDATA struct you u = DUMMY;

View File

@@ -1792,9 +1792,9 @@ char *tmp_levels;
}
# endif
}
# ifdef MFLOPPY
# if defined(SYSFLAGS) && defined(MFLOPPY)
else
saveprompt = flags.asksavedisk;
saveprompt = sysflags.asksavedisk;
# endif
(void) strncpy(SAVEP, bufp, SAVESIZE-1);
@@ -1866,14 +1866,16 @@ char *tmp_levels;
extern int amii_numcolors;
int val = atoi( bufp );
amii_numcolors = 1L << min( DEPTH, val );
#if defined(SYSFLAGS)
} else if (match_varname(buf, "DRIPENS", 7)) {
int i, val;
char *t;
for (i = 0, t = strtok(bufp, ",/"); t != (char *)0;
i < 20 && (t = strtok((char*)0, ",/")), ++i) {
sscanf(t, "%d", &val );
flags.amii_dripens[i] = val;
sysflags.amii_dripens[i] = val;
}
#endif
} else if (match_varname(buf, "SCREENMODE", 10 )) {
extern long amii_scrnmode;
if (!stricmp(bufp,"req"))

View File

@@ -7,6 +7,9 @@
#include "objclass.h"
#include "flag.h"
NEARDATA struct flag flags; /* provide linkage */
#ifdef SYSFLAGS
NEARDATA struct sysflag sysflags; /* provide linkage */
#endif
NEARDATA struct instance_flags iflags; /* provide linkage */
#define static
#else
@@ -40,14 +43,14 @@ static struct Bool_Opt
int optflags;
} boolopt[] = {
{"acoustics", &flags.acoustics, TRUE, SET_IN_GAME},
#ifdef AMIGA
{"altmeta", &flags.altmeta, TRUE, DISP_IN_GAME},
#if defined(SYSFLAGS) && defined(AMIGA)
{"altmeta", &sysflags.altmeta, TRUE, DISP_IN_GAME},
#else
{"altmeta", (boolean *)0, TRUE, DISP_IN_GAME},
#endif
{"ascii_map", &iflags.wc_ascii_map, !PREFER_TILED, SET_IN_GAME}, /*WC*/
#ifdef MFLOPPY
{"asksavedisk", &flags.asksavedisk, FALSE, SET_IN_GAME},
#if defined(SYSFLAGS) && defined(MFLOPPY)
{"asksavedisk", &sysflags.asksavedisk, FALSE, SET_IN_GAME},
#else
{"asksavedisk", (boolean *)0, FALSE, SET_IN_FILE},
#endif
@@ -95,8 +98,8 @@ static struct Bool_Opt
#endif
{"female", &flags.female, FALSE, DISP_IN_GAME},
{"fixinv", &flags.invlet_constant, TRUE, SET_IN_GAME},
#ifdef AMIFLUSH
{"flush", &flags.amiflush, FALSE, SET_IN_GAME},
#if defined(SYSFLAGS) && defined(AMIFLUSH)
{"flush", &sysflags.amiflush, FALSE, SET_IN_GAME},
#else
{"flush", (boolean *)0, FALSE, SET_IN_FILE},
#endif
@@ -140,8 +143,8 @@ static struct Bool_Opt
{"news", (boolean *)0, FALSE, SET_IN_FILE},
#endif
{"null", &flags.null, TRUE, SET_IN_GAME},
#ifdef MAC
{"page_wait", &flags.page_wait, TRUE, SET_IN_GAME},
#if defined(SYSFLAGS) && defined(MAC)
{"page_wait", &sysflags.page_wait, TRUE, SET_IN_GAME},
#else
{"page_wait", (boolean *)0, FALSE, SET_IN_FILE},
#endif
@@ -500,6 +503,10 @@ initoptions()
if (boolopt[i].addr)
*(boolopt[i].addr) = boolopt[i].initvalue;
}
#ifdef SYSFLAGS
Strcpy(sysflags.sysflagsid, "sysflags");
sysflags.sysflagsid[9] = (char)sizeof(struct sysflag);
#endif
flags.end_own = FALSE;
flags.end_top = 3;
flags.end_around = 2;

View File

@@ -383,6 +383,9 @@ unsigned int *stuckid, *steedid; /* STEED */
mread(fd, (genericptr_t) &context, sizeof(struct context_info));
mread(fd, (genericptr_t) &flags, sizeof(struct flag));
if (remember_discover) discover = remember_discover;
#ifdef SYSFLAGS
mread(fd, (genericptr_t) &sysflags, sizeof(struct sysflag));
#endif
role_init(); /* Reset the initial role, race, gender, and alignment */
#ifdef AMII_GRAPHICS

View File

@@ -287,6 +287,9 @@ register int fd, mode;
bwrite(fd, (genericptr_t) &uid, sizeof uid);
bwrite(fd, (genericptr_t) &context, sizeof(struct context_info));
bwrite(fd, (genericptr_t) &flags, sizeof(struct flag));
#ifdef SYSFLAGS
bwrite(fd, (genericptr_t) &sysflags, sizeof(struct sysflag));
#endif
#ifndef GOLDOBJ
if (u.ugold) {
struct obj *goldobj = mksobj(GOLD_PIECE, FALSE, FALSE);