Merge branch 'cleanup' of https://github.com/ingpaschke/NetHack into NetHack-5.0

This commit is contained in:
nhmall
2026-05-11 15:43:56 -04:00
36 changed files with 226 additions and 5575 deletions
-5
View File
@@ -132,11 +132,6 @@ wceconf.h
mac-carbon.h mac-qt.h mac-term.h macconf.h macpopup.h
mactty.h macwin.h mttypriv.h
outdated/sys/amiga:
(files for Amiga versions - untested for 5.0)
Build.ami Install.ami Makefile.agc Makefile.ami NetHack.cnf
ifchange mkdmake xpm2iff.c
outdated/sys/atari:
(files for Atari version - untested for 5.0)
Install.tos atarifnt.uue nethack.mnu setup.g tos.c
+3 -103
View File
@@ -7,41 +7,17 @@
#define AMICONF_H
#undef abs /* avoid using macro form of abs */
#ifndef __SASC_60
#undef min /* this gets redefined */
#undef max /* this gets redefined */
#endif
#include <time.h> /* get time_t defined before use! */
#ifdef CROSS_TO_AMIGA
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <dos/dos.h>
#include <clib/dos_protos.h>
#include <proto/dos.h>
#endif
#ifdef __SASC_60 /* since SAS can prevent re-inclusion */
#include <stdlib.h> /* general things, including builtins */
#include <string.h>
#endif
#ifdef AZTEC_50
#include <stdlib.h>
#define AZTEC_C_WORKAROUND /* Bug which turns up in sounds.c. Bummer... */
#define NO_SIGNAL /* 5.0 signal handling doesn't like SIGINT... */
#endif
#ifdef _DCC
#include <stdlib.h>
#define _SIZE_T
#endif
#ifndef __GNUC__
typedef long off_t;
#endif
#define MICRO /* must be defined to allow some inclusions */
@@ -56,66 +32,30 @@ typedef long off_t;
/* nhsdat sound library not used in 5.0 */
#undef DLBFILE2
#ifndef CROSS_TO_AMIGA
#define FILENAME_CMP stricmp /* case insensitive */
#else
#define FILENAME_CMP strcmpi /* case insensitive */
#endif
#ifndef __SASC_60
#define O_BINARY 0
#endif
/* Compile in New Intuition look for 2.0 */
#ifdef IDCMP_CLOSEWINDOW
#ifndef INTUI_NEW_LOOK
#define INTUI_NEW_LOOK 1
#endif
#endif
#define MFLOPPY /* You'll probably want this; provides assistance \
* for typical personal computer configurations \
*/
#ifndef CROSS_TO_AMIGA
#define RANDOM
#endif
/* ### amidos.c ### */
extern void nethack_exit(int);
/* ### amiwbench.c ### */
extern void ami_wbench_init(void);
extern void ami_wbench_args(void);
extern int ami_wbench_getsave(int);
extern void ami_wbench_unlink(char *);
extern int ami_wbench_iconsize(char *);
extern void ami_wbench_iconwrite(char *);
extern int ami_wbench_badopt(const char *);
extern void ami_wbench_cleanup(void);
extern void getlind(const char *, char *, const char *);
/* ### winreq.c ### */
extern void amii_setpens(int);
extern void getlind(const char *, char *, const char *);
extern void exit(int);
extern void CleanUp(void);
extern void Abort(long);
extern int getpid(void);
extern char *CopyFile(const char *, const char *);
extern int kbhit(void);
extern int WindowGetchar(void);
extern void ami_argset(int *, char *[]);
extern void ami_mkargline(int *, char **[]);
extern void ami_wininit_data(int);
#define FromWBench 0 /* A hint for compiler ... */
/* extern boolean FromWBench; /* how were we run? */
extern int ami_argc;
extern char **ami_argv;
#ifndef MICRO_H
#include "micro.h"
#endif
@@ -125,36 +65,15 @@ extern char **ami_argv;
#endif
#define remove(x) unlink(x)
/* DICE wants rewind() to return void. We want it to return int. */
#if defined(_DCC) || defined(__GNUC__)
#define rewind(f) fseek(f, 0, 0)
#endif
#ifdef AZTEC_C
extern FILE *freopen(const char *, const char *, FILE *);
extern char *gets(char *);
#endif
/*
* If AZTEC_C we can't use the long cpath in vision.c....
*/
#ifdef AZTEC_C
#undef MACRO_CPATH
#endif
/*
* (Possibly) configurable Amiga options:
*/
#define HACKFONT /* Use special hack.font */
#ifndef CROSS_TO_AMIGA /* issues with prototype and spawnl */
#define SHELL /* Have a shell escape command (!) */
#endif
#define MAIL /* Get mail at unexpected occasions */
#define DEFAULT_ICON "NetHack:default.icon" /* private icon */
#define AMIFLUSH /* toss typeahead (select flush in .cnf) */
/* #define OPT_DISPMAP /* enable fast_map option */
/* new window system options */
/* WRONG - AMIGA_INTUITION should go away */
@@ -167,45 +86,26 @@ extern char *gets(char *);
#define AMII_MAXCOLORS (1L << DEPTH)
typedef unsigned short AMII_COLOR_TYPE;
#define PORT_HELP "nethack:amii.hlp"
#define PORT_HELP "amii.hlp"
#undef TERMLIB
#define AMII_MUFFLED_VOLUME 40
#define AMII_SOFT_VOLUME 50
#define AMII_OKAY_VOLUME 60
#define AMII_LOUDER_VOLUME 80
#ifdef TTY_GRAPHICS
#define ANSI_DEFAULT
#endif
extern int amibbs; /* BBS mode? */
#ifdef AMII_GRAPHICS
extern int amii_numcolors;
void amii_setpens(int);
#endif
/* for cmd.c: override version in micro.h */
#ifdef __SASC_60
#undef M
#define M(c) ((c) -128)
#endif
struct ami_sysflags {
char sysflagsid[10];
#ifdef AMIFLUSH
boolean altmeta; /* use ALT keys as META */
boolean amiflush; /* kill typeahead */
#endif
#ifdef AMII_GRAPHICS
#ifdef AMII_GRAPHICS
int numcols;
unsigned short amii_dripens[20]; /* DrawInfo Pens currently there are 13 in v39 */
AMII_COLOR_TYPE amii_curmap[AMII_MAXCOLORS]; /* colormap */
#endif
#ifdef OPT_DISPMAP
boolean fast_map; /* use optimized, less flexible map display */
#endif
#ifdef MFLOPPY
boolean asksavedisk;
#endif
+3 -11
View File
@@ -59,16 +59,8 @@ struct amii_WinDesc {
char *morestr; /* string to display instead of default */
/* amiga stuff */
struct Window *win; /* Intuition window pointer */
#ifdef INTUI_NEW_LOOK
struct ExtNewWindow *newwin; /* NewWindow alloc'd */
#else
struct NewWindow *newwin; /* ExtNewWindow alloc'd */
#endif
#ifdef INTUI_NEW_LOOK
struct ExtNewWindow *newwin; /* NewWindow alloc'd */
struct TagItem wintags[MAXWINTAGS]; /* Tag items for this window */
#else
long wintags[MAXWINTAGS * 2];
#endif
void *hook; /* Hook structure pointer for tiles version */
#define FLMAP_INGLYPH 1 /* An NHW_MAP window is in glyph mode */
#define FLMAP_CURSUP 2 /* An NHW_MAP window has the cursor displayed */
@@ -117,8 +109,8 @@ typedef struct WEVENT {
/* port specific variable declarations */
extern winid WIN_BASE;
extern winid WIN_OVER;
#define NHW_BASE 6
#define NHW_OVER 7 /* overview window */
#define NHW_BASE (NHW_LAST_TYPE + 1)
#define NHW_OVER (NHW_LAST_TYPE + 2) /* overview window */
extern struct amii_WinDesc *amii_wins[MAXWIN + 1];
-2
View File
@@ -1,2 +0,0 @@
*.p NHSUBST
* NH_filestag=(file%s_for_Amiga_versions_-_untested_for_5.0)
-140
View File
@@ -1,140 +0,0 @@
Compiling Amiga NetHack 3.4
Last Revision: 21 February 2002 for NetHack 3.4.1
We would like to thank each and every one of the people who took
the time and effort to report bugs to us. THANK YOU! (And keep
up the good work!)
I. Introduction
The Amiga-specific documentation has been split since the 3.1.3 release
- please read the file Install.ami for information specific to the
Amiga port before continuing.
If you have problems with compilation, installation, or think you have
found a bug in the game, please report it by electronic mail to the
development group at nethack-bugs@nethack.org, where it will be routed
to the appropriate person. Include your configuration, the version of
NetHack you are playing (use the 'v' command or see
include/patchlevel.h), and as much specific information as possible.
As NetHack runs on many different machines, be sure to mention that you
are playing the Amiga version and also mention if you are using the
version for mc68k or ppc.
If you want to find out about distributing NetHack, read the license
(in NetHack:license or type ?i during the game).
II. Compiling Amiga NetHack 3.4
II.A. Compilation Overview
Compiling NetHack is not very hard - basically you do a little
configuration and start make. It does, however, require a good amount
of disk space and time. It also needs a good bit of memory, especially
for linking.
II.B. Basic Compilation
NetHack can be built with SAS/C version 6.5x. The commercial version
of DICE might work, but NetHack version 3.2.2 or later haven't been
compiled with it. The "official" compiler for NetHack 3.6 is SAS/C 6.58
- we have dropped support for SAS/C 5.x.
The Manx/Aztec port has not been tested recently and is certainly
broken. Anyone managing to compile NetHack with this compiler is
encouraged to submit context diffs of the required changes. When last
tested, NetHack required version 5.0B of that compiler.
Compiling with gcc should also work.
II.B.1. Introduction to Compiling NetHack
Before doing any compilation, read the README files distributed with
the source. These should familiarize you with the source tree layout
and what files are shared with what computers; everything in the
sys/amiga directory is used exclusively by the Amiga.
The makefile (sys/amiga/Makefile.ami) depends on certain assignments,
providing the developer with a fairly flexible environment. See
sys/amiga/Makefile.ami for assignment assumptions. DICE users should
see section II.B.3 for information on creating a DMakefile usable with
DMake.
Edit config.h to your liking and system configuration. The defaults
should be satisfactory for most systems.
Read VERY CAREFULLY through the Makefile to familiarize yourself
with which assignments are assumed. Otherwise, you're going to get
something like "Insert NH: in any drive." You will need uudecode,
and, if you need to modify dgn_comp or lev_comp, flex, and bison.
The first thing Makefile.ami does is build makedefs, which handles
a variety of data file generation, and then lev_comp and dgn_comp
which compile the special levels. Makedefs will then be run to create
a few files, followed by a roughly alphabetically sorted compilation
of the entire source tree. This process will compile selected files
from the sys/amiga, sys/share, win/tty, and src directories, eventually
creating sbin/nethack. After building the main binary, a make install
will build the auxiliary files including help files, special levels,
icons, and the font files and will put these files into their final
positions - most will be in dlb archives (if DLB was defined in config.h).
The first make run should be done in NH:obj and the make install should be
done in NetHack:; for both runs, the makefile is NH:sys/amiga/Makefile.ami
(or NH:sys/amiga/DMakefile for DMake and NH:sys/amiga/Makefile.agc for
gcc).
Note that not all the source is simple C code. If you are modifying
lev_comp or dgn_comp you may need bison and/or flex (depending on what
modifications you are making). You do not need any of these tools to
simply build NetHack - all the C output files are provided in the source
distribution. Also, the ifchange script requires a version of diff that
produces standard Unix format context diffs for proper operation - the
version shipped with SAS/C is not sufficient.
If you do not have bison and flex, copy the files from sys/share. The
include files go in include/ and the C files go in util/. If the compile
fails due to prototype errors for malloc and realloc, try deleting
the first line of lev_comp.c and dgn_comp.c.
II.B.2. Compiling NetHack with SAS/C version 6.58
NOTE WELL - Amiga NetHack has dropped support for SAS/C version 5.
This version of NetHack was developed with SAS/C 6.58. Earlier versions
than version of the compiler are known to cause problems - don't use them.
A couple of notes and warnings from the SAS/C users on the team:
* Included in the SAS/C port is code for generating a SnapShot.tb
file upon catching various internal disasters. That is why the
debug=l flag is in the makefile. This adds about 270K to the disk
image, but it does not increase the run time memory requirements.
* The 5.10b optimizer did not produce correct code for NetHack. The
current optimizer has not been tested.
II.B.3. Compiling NetHack with the commercial version of DICE
IMPORTANT NOTE: If you are using DMake, you need to create DMakefile
from Makefile.ami. Do the following:
cd NH:sys/amiga
edit from Makefile.ami to DMakefile with mkdmake opt w255
Some versions of DMake have been known to crash horribly on the
makefile - if this happens, you'll need to download another make
utility, such as AMake (ftp://ftp.dragonfire.net/amiga/utils/amake),
which will run in DMake-compatibility mode if invoked with the -C switch
(e.g. "amake -C -f NH:sys/amiga/DMakefile", or just
"alias dmake amake -C").
SECOND IMPORTANT NOTE: The score list is currently disabled when
compiling under DICE, due to an as-yet-unknown problem which causes
system crashes when displaying the score list.
NetHack can be compiled using the commercial version of DICE only. The
registered shareware version had a bug in it which resulted in odd-
aligned procedures. (It is possible to patch DC1 to fix this problem;
however, this is not recommended, and you should upgrade to the
commercial version.)
During compilation, DICE will output a lot of warnings; they can be
safely ignored.
-200
View File
@@ -1,200 +0,0 @@
Using and Installing Amiga NetHack 3.4
(or Everything You Never Wanted to Know Before NetHacking)
(or Not Everything That Happens Always Comes Knocking)
Last Revision: 28 March 2000 for NetHack 3.4.1
0. Pre-intro for NetHack 3.4.1:
Amiga-specific changes for 3.4.1:
Most (around 99%) known bugs fixed (volunteers welcome).
HackWB and HackCli are no longer supported. Use the main binary.
We would like to thank each and every one of the people who took
the time and effort to report bugs to us. THANK YOU!
I. Introduction
I.A. Overview
Welcome to Amiga NetHack! If this is your first visit to our fair
city, you are in for an amazing but dangerous journey; if you have
visited us before, beware! the city has changed in many strange and
subtle ways; it has also grown quite a bit. This missive brings to
light those mundane tasks which must be dealt with before beginning
your journey; for those of you who are faced with the task of
installing the pre-fabricated version of our town, section III
(Installing Amiga NetHack 3.6) will guide you through the task at
hand. If you are ready to visit, the local visitors guide is in
section II (Using Amiga NetHack 3.6); please also see the general
guide packaged separately (the file "GuideBook").
To all our visitors, a hearty Welcome! - and please be careful.
[Those responsible for the previous paragraphs have been sacked. The
documentation has been completed at great expense in a more traditional
style. -- The Management]
I.B. Getting Help
If you have questions about strategy, weapons, or monsters, the best
place to go for help is the Usenet newsgroup rec.games.roguelike.nethack.
If you have problems with installation or think you have found a bug
in the game, please report it by electronic mail to the development
team at nethack-bugs@nethack.org, where it will be routed to the
appropriate person. Include your configuration, the version of
NetHack you are playing (use the 'v' command), whether or not you are
using an official binary release (and if so which one) and as much
specific information as possible. As NetHack runs on many different
machines, be sure to mention that you are playing the Amiga version.
I.C. Credits
Olaf Seibert first ported NetHack 2.3 and 3.0 to the Amiga. Richard
Addison, Andrew Church, Jochen Erwied, Mark Gooderum, Ken Lorber,
Greg Olson, Mike Passaretti, and Gregg Wonderly polished and extended
the 3.0 and 3.1 ports. Andrew Church, Ken Lorber, and Gregg Wonderly
are responsible for the 3.2 port. Janne Salmijärvi resurrected the
amigaport for 3.3 and Teemu Suikki joined before 3.4.0.
II. Using Amiga NetHack 3.4
Run NetHack from the shell or from some tool that allows that,
ie. ToolManager. See the NetHack.txt file for command line options
and other usage.
II.A. Sources of Information
Where to go depends on what you want to find out. If you want to find
out about distributing NetHack, read the license (in NetHack:license
or type ?i during the game). For an introduction to NetHack, read
the GuideBook file. To find out what options are compiled into your
copy of NetHack, type #v during the game. Finally, for information
during the game on all kinds of things, type ? and select from the
menu or by pressing Help key.
II.B. The Amiga NetHack WorkBench Front End
Starting from 3.3.0 HackWB is not supported.
II.C. The Amiga NetHack CLI Front End
Starting from 3.3.0 CLI Front end is not supported either.
Instead, use the main binary. See NetHack.txt file for the standard Unix
flags for NetHack. In addition to those flags, Amiga NetHack accepts
the flags -l to force non-interlaced mode and -L to force interlaced mode.
II.D. Amiga-Specific Information for NetHack
There are several options that are unique to the Amiga version of
NetHack that may be specified in the NetHack.cnf file or on an
OPTIONS line:
altmeta allows the ALT keys to function as META keys. The default
is altmeta.
flush flush discards all characters in the queue except the first,
which limits typeahead accidents. The default is !flush.
silent turn off the audio output. The default is silent.
The current version of Amiga NetHack also supports menu accelerators.
See Guidebook.txt for a detailed description. Also supported is
selecting the number of stacked objects to drop, used with the (D)rop
command. Type the number and then select an item (or items with
accelerators). Items with a count associated with them are denoted
with # in place of -. I.e. 'd - 3 blessed daggers' becomes
'd # 3 blessed daggers'. You can clear the count by hitting esc
while counting or deselect and reselect the item. The default
is to drop all selected items (as before).
For other options how to configure the screen setting and colors refer
to Nethack.cnf.
III. Installing Amiga NetHack 3.4
III.A. General Installation
Installation should be easy - basically it consists of putting files
where they belong and adding an assign to your startup. If you are
installing from the official binary distribution, simply unpacking
the archive in the appropriate directory will put the files in the
places they belong.
IF YOU ALREADY HAVE A PREVIOUS VERSION INSTALLED YOU MUST DELETE THE
OLD SAVE AND BONES FILES - THEY WILL NOT WORK! This includes save
and bones files from all previous versions of NetHack (yes, even 3.3.1).
If you have a game in progress and want to finish it, use your
current version and then update.
Will NetHack fit on your machine?
NetHack 3.6 is large. NetHack 3.4 is very large. You will need:
> Any standard series Amiga: 500, 600, 1000, 1200, 2000, 2500, 3000, 4000.
> WorkBench 2.04 or later.
> At least 3 meg of RAM. NetHack will NOT run in 1 meg (probably even 2).
> Mass storage: A hard drive with over 3 meg of free space is highly
recommended.
Hard Disk Installation:
Unpack the archive to your place of choice. Since you are reading this
you've probably done that already. Now just assign NetHack: to
NetHack directory containing the executable and datafiles and other needed
directories.
Use the table in the next section to see where things should end up.
Be sure that the file 8 ends up in NetHack:hack/8.
Configuration
Using your favorite text editor, edit NetHack:NetHack.cnf to match
your system.
Create the save file directory (makedir NetHack:save) and the levels file
directory (makedir NetHack:levels), if they don't already exist.
Create the score file (echo to NetHack:record) and, if desired, the log
file (echo to NetHack:logfile), if they don't already exist. You may
leave out logfile, but record is needed.
III.B. File Location Table
NetHack:
amii.hlp Guidebook.txt hack.font
license NetHack NetHack.cnf
NetHack.txt nhdat nhsdat
record Recover Recover.txt
logfile (optional, but useful)
NetHack:hack
8
NetHack:tiles
monsters.iff objects.iff other.iff
IV. BBS Interface
[Since HackCli and split binary is no longer supported the following
probably doesn't apply anymore. Due to lack of a suitable environment
it is also untested.]
The BBS mode is based on the standard NetHack tty port and is designed
for use in a BBS setting - it is specifically not recommended for use
on the console. The current TTY mode has changed significantly since
the preliminary version released with 3.1.2. In particular, BBS mode
now works with split binaries (only), and now supports multiple games
in progress at the same time for multi-line boards (note however that
any individual user should not be allowed to run two instances of
NetHack at the same time).
To set up NetHack for use with a BBS, set OPTIONS=windowtype:tty
and unset DUNGEONS, TRAPS, and EFFECTS in NetHack.cnf. Configure
the BBS to expect I/O through stdin and stdout, and have NetHack
invoked as:
HackCLI :uid -u uname options...
where uid is any string (without embedded spaces, colons, or slashes)
that is unique for each BBS user and uname is some corresponding human-
readable name for that user. Uid is used in constructing file names
to prevent collisions between simultaneous games and to prevent
people from using other people's save files. Uname is the name the
character will have in the game and the name that will appear in the
record file.
The terminal is assumed to be a 24x80 ANSI-compatible terminal.
The present version does not deal with situations such as low
memory gracefully - as NetHack uses a considerable amount of
memory this is particularly painful with multiple games in
progress. Sysops are reminded to be familiar with the recover
utility, which may be needed from time to time and which should
probably not be available directly to users. Bug reports and
suggestions for improvements are requested from the user community -
this is still considered alpha software.
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-213
View File
@@ -1,213 +0,0 @@
# A '#' at the beginning of a line means the rest of the line is a comment.
# This is an example configuration file.
# If several people are to use it, don't specify "name" or personal
# prefences like "dogname" or "packorder" in OPTIONS.
# To change configuration, comment out the unwanted configurations, and
# remove the comment from the configuration you want.
# Some options to set personal preferences. If several people are to
# use it, options like these should not be set here - use the command line
#OPTIONS=name:Janet-V,female,dogname:Fido,fruit:apricot
#OPTIONS=packorder:")[%?+/=!(*0_`,scores:10t/2a,noverbose
#OPTIONS=gender:male
#OPTIONS=role:random
#OPTIONS=race:random
#OPTIONS=align:chaotic
# Other general options
#OPTIONS=time,rest_on_space,noautopickup
# The search path for files like record, help, opthelp, etc.
PATH=NetHack:
# My own setup
#OPTIONS=nolegacy,fruit:lemon,time,autopickup,checkpoint,showexp,showscore,standout,nonews
#OPTIONS=nomail,flush,eight_bit_tty,scores:10t/2a,pickup_types:$,suppress_alert:3.3.0,autoquiver
# The windowtype option must be set before any options regarding colors and palette
# are set otherwise previously set values will be overridden by the defaults
#
# The font version of the game
OPTIONS=windowtype:amii
#
# New tile version of the game
#OPTIONS=windowtype:amitile
#
# A hard disk configuration.
#
HACKDIR=NetHack:
LEVELS=Nethack:Levels
SAVE=Nethack:Save
BONESDIR=Nethack:Levels
SCOREDIR=Nethack:
LOCKDIR=Nethack:
CONFIGDIR=Nethack:
DATADIR=Nethack:
TROUBLEDIR=Nethack:
# *** CHARACTER GRAPHICS ***
#
# See the on-line help or the Guidebook for which symbols are in which
# positions.
#
# Note that the hack.font has special graphics characters from 192 on.
# An example using the hack.font graphics character set:
DUNGEON = 032 192 193 194 195 196 197 198 216 214 \
215 213 217 145 146 147 148 035 035 217 \
218 229 060 062 060 062 095 124 092 035 \
123 125 042 125 042 042 035 035 046 035 \
125
TRAPS = 094 094 094 094 094 094 094 094 094 094 \
094 094 094 094 094 094 094 034 094 094 \
094 094
EFFECTS = 241 240 242 243 042 033 123 125 \
064 038 042 035 \
244 245 246 247 239 248 249 250 \
230 234 231 236 212 237 232 235 233
WARNINGS = 048 049 050 051 052 053
# Monitors vary greatly in their color response. If the default colors
# are not good on your monitor, here are some other alternatives for the
# font version of the game:
#
# Last color of the palette is always used for the cursor.
#
#CBM 1960, set color/contrast for good pure red, green, and blue. True colors.
#PENS=000,fff,a61,7bb,0f0,e0c,00f,f00
#CBM 1960, set color/contrast as above, better colors for NetHack.
#PENS=667,fff,da1,7bb,2f0,e0d,0af,f42
#and other suggestions:
#PENS=888,ffc,840,0b8,4e4,e8b,7be,a04
#PENS=000,fff,830,7ae,181,c06,23e,c00
#
# For an "interlaced"+ line screen, the default font is courier:13. If you want
# a different font, set it here. The format is "fontname.font:size"; i.e. the
# .font extension is required.
#FONT=courier.font:13
#FONT=topaz.font:8
#
# Proportional fonts such as CGTimes are probably not a good idea because they
# result in many things not being spaced out correctly.
#FONT=CGTimes.font:15
#
# This sized proportional font is readable, but still has spacing problems
#FONT=CGTimes.font:21
#
# FOR AGA OR OTHER DISPLAYS CAPABLE OF 5 OR MORE PLANES...
#
# For a screen of depth 5 the following dripens provide a brown border
# using pens 16-31.
#
# Pens 16-31 can be redefined with PENS= if you want different colors,
# using the PENS= values below for a 4 plane screen as the first 16 colors.
#
#DEPTH=5
#DRIPENS=0,0,0,17,27,23,1,23,15,0,23,27
#
# The APEN and BPEN values in the various types of windows can be set in
# the manner shown below. These values are for the 16 color version of
# the tile game.
#
# These values are specified as APEN,BPEN (foreground,background)
#
#MSGPENS=1,12
#STATUSPENS=1,12
#MENUPENS=1,23
#TEXTPENS=1,23
#OTHERPENS=1,23
#
# FOR ECS OR OTHERS ONLY CAPABLE OF 4 PLANES...
#
# These values work good for the TILE version of the game on ECS machines
# These are the default values for reference purposes.
#
#DEPTH=4
#defaults for tilemode:
#PENS=000,fff,0bf,f60,00f,090,69b,f00,6f0,ff0,f0f,940,466,c40,ddb,fb9
#DRIPENS=0,1,0,2,4,12,14,12,7,1,12,4
#defaults for fontmode:
#PENS=000,fff,830,7ac,181,c06,23e,c00
#DRIPENS=0,6,2,1,6,3,1,3,7,1,3,6
#
# The APEN and BPEN values in the various types of windows can be set in
# the manner shown below. These values are for a 32 color version of
# the tile game.
#
# These values are specified as APEN,BPEN (foreground,background)
#
#MSGPENS=1,12
#STATUSPENS=1,12
#MENUPENS=0,14
#TEXTPENS=0,14
#OTHERPENS=1,12
#
# New alternative color scheme for 16 color font mode.
# This changes the colors of monsters, objects etc.
#
# FGPENS and BGPENS define APEN and BPEN for objects and monsters on the map.
# The colors are in the following order:
# black, red, green, brown, blue, magenta, cyan, gray, no color, orange,
# bright green, yellow, bright blue, bright magenta, bright cyan, white
#
DEPTH=4
PENS=000,fff,830,7ac,181,c06,23e,c00,888,f60,4f4,ff0,4af,f8f,8ff,f00
FGPENS= 0, 7, 4, 2, 6, 5, 3, 8, 1, 9,10,11,12,13,14, 1
BGPENS= 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
#
# Screen mode selections below should all work for either the font or tile
# version of the game. Other modes can be tried and as long as they are at
# least 640x200, the game should adapt to them...
#
# Select screenmode with a requester
#SCREENMODE=Req
# NTSC_MONITOR_ID
#SCREENMODE=0x00019000
# PAL_MONITOR_ID
#SCREENMODE=0x00029000
# NTSC_MONITOR_ID+LACE
#SCREENMODE=0x00019004
# PAL_MONITOR_ID+LACE
#SCREENMODE=0x00029004
# NTSC_MONITOR_ID+HIRES+LACE
#SCREENMODE=0x00019024
# PAL_MONITOR_ID+HIRES+LACE
#SCREENMODE=0x00029024
# VGA_MONITOR_ID
#SCREENMODE=0x00031000
# VGAPRODUCT_KEY
#SCREENMODE=0x00039024
# A2024TENHERTZ_KEY
#SCREENMODE=0x00041000
# A2024FIFTEENHERTZ_KEY
#SCREENMODE=0x00049000
# EURO72_MONITOR_ID
#SCREENMODE=0x00061000
# EURO72PRODUCT_KEY
#SCREENMODE=0x00069024
# EURO72PRODUCTLACE_KEY
#SCREENMODE=0x00069025
# EURO72PRODUCTDBL_KEY
#SCREENMODE=0x00069020
# EURO36_MONITOR_ID
#SCREENMODE=0x00071000
# SUPER72HIRESDBL_KEY
#SCREENMODE=0x00089008
# SUPER72SUPERDBL_KEY
#SCREENMODE=0x00089028
# DBLNTSCHIRES_KEY
#SCREENMODE=0x00099000
# DBLNTSCHIRESFF_KEY
#SCREENMODE=0x00099004
# DBLNTSCHIRESLACE_KEY
#SCREENMODE=0x00099005
# DBLPALHIRES_KEY
#SCREENMODE=0x000a9000
# DBLPALHIRESFF_KEY
#SCREENMODE=0x000a9004
# DBLPALHIRESLACE_KEY
#SCREENMODE=0x000a9005
-55
View File
@@ -1,55 +0,0 @@
.KEY oper/a,tmp/a,real/a,f1,f2,f3,f4,f5
. ; miscellaneous script functions for the Amiga
. ; Copyright (c) Kenneth Lorber, Bethesda, Maryland, 1992, 1993, 1996.
. ; NetHack may be freely redistributed. See license for details.
FAILAT 6
IF <oper> EQ "MOVE"
IF EXISTS <real>
diff >T:mic -c <tmp> <real>
search from T:mic SEARCH "---" QUIET
IF WARN
echo "MOVE: no change"
delete <tmp>
ELSE
echo "MOVE: copy"
copy <tmp> <real> clone
delete <tmp>
ENDIF
ELSE
echo "MOVE: copy2"
copy <tmp> <real> clone
delete <tmp>
ENDIF
QUIT
ENDIF
IF <oper> EQ "TOUCH"
IF EXISTS <real>
diff >T:mic -c <tmp> <real>
search from T:mic SEARCH "---" QUIET
IF NOT WARN
echo "TOUCH: touch"
IF NOT <f1$@> EQ "@"
setdate <f1>
ENDIF
IF NOT <f2$@> EQ "@"
setdate <f2>
ENDIF
IF NOT <f3$@> EQ "@"
setdate <f3>
ENDIF
IF NOT <f4$@> EQ "@"
setdate <f4>
ENDIF
IF NOT <f5$@> EQ "@"
setdate <f5>
ENDIF
ENDIF
ENDIF
QUIT
ENDIF
echo "ifchange: '<oper>' not recognized"
quit 10
-13
View File
@@ -1,13 +0,0 @@
GE/$@/%(left)/
GE/$</%(right)/
GE/\#/#/
39(F B/#SFD_INSTEAD / ; E/#SFD_INSTEAD // ; N ; D )
REWIND
CG
9(F P/#SFD_BEGIN/; D ; GE /##// ; F P/#SFD_ELSE/ ; CG ; DF P/#SFD_END/ ; D )
Q
Copyright (c) Andrew Church, Olney, Maryland, 1994,1996.
NetHack may be freely redistributed. See license for details.
See IV.B.4 of Install.ami for instructions on using this file.
-363
View File
@@ -1,363 +0,0 @@
/* NetHack 3.6 xpm2iff.c $NHDT-Date: 1432512795 2015/05/25 00:13:15 $ $NHDT-Branch: master $:$NHDT-Revision: 1.7 $ */
/* Copyright (c) 1995 by Gregg Wonderly, Naperville, Illinois */
/* NetHack may be freely redistributed. See license for details. */
#include <stdlib.h>
#include "config.h"
#include "tile.h"
#include <dos/dos.h>
#include <dos/dos.h>
#include <dos/dosextens.h>
#include <graphics/gfx.h>
#include <graphics/gfxbase.h>
#include <graphics/view.h>
#include <libraries/iffparse.h>
#include <libraries/dos.h>
#ifndef _DCC
#include <proto/iffparse.h>
#include <proto/dos.h>
#include <proto/exec.h>
#endif
struct xpmscreen {
int Width;
int Height;
int Colors;
int ColorResolution;
int Background;
int AspectRatio;
int Interlace;
int BytesPerRow;
} XpmScreen;
/* translation table from xpm characters to RGB and colormap slots */
struct Ttable {
char flag;
char r, g, b;
int slot; /* output colortable index */
} ttable[256];
pixval ColorMap[3][MAXCOLORMAPSIZE];
int colorsinmap;
/*
* We are using a hybrid form of our own design which we call a BMAP (for
* bitmap) form. It is an ILBM with the bitmaps already deinterleaved,
* completely uncompressed.
* This speeds the loading of the images from the games point of view because
* it
* does not have to deinterleave and uncompress them.
*/
#define ID_BMAP MAKE_ID('B', 'M', 'A', 'P') /* instead of ILBM */
#define ID_BMHD MAKE_ID('B', 'M', 'H', 'D') /* Same as ILBM */
#define ID_CAMG MAKE_ID('C', 'A', 'M', 'G') /* Same as ILBM */
#define ID_CMAP MAKE_ID('C', 'M', 'A', 'P') /* Same as ILBM */
#define ID_PDAT \
MAKE_ID('P', 'D', 'A', 'T') /* Extra data describing plane \
* size due to graphics.library \
* rounding requirements. \
*/
#define ID_PLNE MAKE_ID('P', 'L', 'N', 'E') /* The planes of the image */
int nplanes;
/* BMHD from IFF documentation */
typedef struct {
UWORD w, h;
WORD x, y;
UBYTE nPlanes;
UBYTE masking;
UBYTE compression;
UBYTE reserved1;
UWORD transparentColor;
UBYTE xAspect, yAspect;
WORD pageWidth, pageHeight;
} BitMapHeader;
typedef struct {
UBYTE r, g, b;
} AmiColorMap;
pixel pixels[TILE_Y][TILE_X];
AmiColorMap *cmap;
void
error(char *str)
{
fprintf(stderr, "ERROR: %s\n", str);
}
char **planes;
main(int argc, char **argv)
{
int colors;
struct {
long nplanes;
long pbytes;
long across;
long down;
long npics;
long xsize;
long ysize;
} pdat;
long pbytes; /* Bytes of data in a plane */
int i, cnt;
BitMapHeader bmhd;
struct IFFHandle *iff;
long camg = HIRES | LACE;
int tiles = 0;
int index;
#if defined(_DCC) || defined(__GNUC__)
IFFParseBase = OpenLibrary("iffparse.library", 0);
if (!IFFParseBase) {
error("unable to open iffparse.library");
exit(1);
}
#endif
if (fopen_xpm_file(argv[1], "r") != TRUE) {
perror(argv[1]);
return (1);
}
nplanes = 0;
i = XpmScreen.Colors - 1;
while (i != 0) {
nplanes++;
i >>= 1;
}
planes = malloc(nplanes * sizeof(char *));
if (planes == 0) {
error("can not allocate planes pointer");
exit(1);
}
XpmScreen.BytesPerRow = ((XpmScreen.Width + 15) / 16) * 2;
pbytes = XpmScreen.BytesPerRow * XpmScreen.Height;
for (i = 0; i < nplanes; ++i) {
planes[i] = malloc(pbytes);
if (planes[i] == 0) {
error("can not allocate planes pointer");
exit(1);
}
memset(planes[i], 0, pbytes);
}
iff = AllocIFF();
if (!iff) {
error("Can not allocate IFFHandle");
return (1);
}
iff->iff_Stream = Open(argv[2], MODE_NEWFILE);
if (!iff->iff_Stream) {
error("Can not open output file");
return (1);
}
InitIFFasDOS(iff);
OpenIFF(iff, IFFF_WRITE);
PushChunk(iff, ID_BMAP, ID_FORM, IFFSIZE_UNKNOWN);
bmhd.w = XpmScreen.Width;
bmhd.h = XpmScreen.Height;
bmhd.x = 0;
bmhd.y = 0;
bmhd.nPlanes = nplanes;
bmhd.masking = 0;
bmhd.compression = 0;
bmhd.reserved1 = 0;
bmhd.transparentColor = 0;
bmhd.xAspect = 100;
bmhd.yAspect = 100;
bmhd.pageWidth = 0; /* not needed for this program */
bmhd.pageHeight = 0; /* not needed for this program */
PushChunk(iff, ID_BMAP, ID_BMHD, sizeof(bmhd));
WriteChunkBytes(iff, &bmhd, sizeof(bmhd));
PopChunk(iff);
PushChunk(iff, ID_BMAP, ID_CAMG, sizeof(camg));
WriteChunkBytes(iff, &camg, sizeof(camg));
PopChunk(iff);
#define SCALE(x) (x)
cmap = malloc((colors = (1L << nplanes)) * sizeof(AmiColorMap));
if (cmap == 0) {
error("Can't allocate color map");
exit(1);
}
for (index = 0; index < 256; index++) {
if (ttable[index].flag) {
cmap[ttable[index].slot].r = SCALE(ttable[index].r);
cmap[ttable[index].slot].g = SCALE(ttable[index].g);
cmap[ttable[index].slot].b = SCALE(ttable[index].b);
}
}
#undef SCALE
PushChunk(iff, ID_BMAP, ID_CMAP, IFFSIZE_UNKNOWN);
WriteChunkBytes(iff, cmap, colors * sizeof(*cmap));
PopChunk(iff);
conv_image();
pdat.nplanes = nplanes;
pdat.pbytes = pbytes;
pdat.xsize = XpmScreen.Width;
pdat.ysize = XpmScreen.Height;
pdat.across = 0;
pdat.down = 0;
pdat.npics = 1;
PushChunk(iff, ID_BMAP, ID_PDAT, IFFSIZE_UNKNOWN);
WriteChunkBytes(iff, &pdat, sizeof(pdat));
PopChunk(iff);
PushChunk(iff, ID_BMAP, ID_PLNE, IFFSIZE_UNKNOWN);
for (i = 0; i < nplanes; ++i)
WriteChunkBytes(iff, planes[i], pbytes);
PopChunk(iff);
CloseIFF(iff);
Close(iff->iff_Stream);
FreeIFF(iff);
#if defined(_DCC) || defined(__GNUC__)
CloseLibrary(IFFParseBase);
#endif
exit(0);
}
#define SETBIT(Plane, Plane_offset, Col, Value) \
if (Value) { \
planes[Plane][Plane_offset + (Col / 8)] |= 1 << (7 - (Col & 7)); \
}
conv_image()
{
int row, col, planeno;
for (row = 0; row < XpmScreen.Height; row++) {
char *xb = xpmgetline();
int plane_offset;
if (xb == 0)
return;
plane_offset = row * XpmScreen.BytesPerRow;
for (col = 0; col < XpmScreen.Width; col++) {
int slot;
int color = xb[col];
if (!ttable[color].flag) {
fprintf(stderr, "Bad image data\n");
}
slot = ttable[color].slot;
for (planeno = 0; planeno < nplanes; planeno++) {
SETBIT(planeno, plane_offset, col, slot & (1 << planeno));
}
}
}
}
long *
alloc(unsigned int n)
{
long *ret = malloc(n);
if (!ret) {
error("Can't allocate memory");
exit(1);
}
return (ret);
}
FILE *xpmfh = 0;
char initbuf[200];
char *xpmbuf = initbuf;
/* version 1. Reads the raw xpm file, NOT the compiled version. This is
* not a particularly good idea but I don't have time to do the right thing
* at this point, even if I was absolutely sure what that was. */
fopen_xpm_file(const char *fn, const char *mode)
{
int temp;
char *xb;
if (strcmp(mode, "r"))
return FALSE; /* no choice now */
if (xpmfh)
return FALSE; /* one file at a time */
xpmfh = fopen(fn, mode);
if (!xpmfh)
return FALSE; /* I'm hard to please */
/* read the header */
xb = xpmgetline();
if (xb == 0)
return FALSE;
if (4 != sscanf(xb, "%d %d %d %d", &XpmScreen.Width, &XpmScreen.Height,
&XpmScreen.Colors, &temp))
return FALSE; /* bad header */
/* replace the original buffer with one big enough for
* the real data
*/
/* XXX */
xpmbuf = malloc(XpmScreen.Width * 2);
if (!xpmbuf) {
error("Can't allocate line buffer");
exit(1);
}
if (temp != 1)
return FALSE; /* limitation of this code */
{
/* read the colormap and translation table */
int ccount = -1;
while (ccount++ < (XpmScreen.Colors - 1)) {
char index;
int r, g, b;
xb = xpmgetline();
if (xb == 0)
return FALSE;
if (4 != sscanf(xb, "%c c #%2x%2x%2x", &index, &r, &g, &b)) {
fprintf(stderr, "Bad color entry: %s\n", xb);
return FALSE;
}
ttable[index].flag = 1; /* this color is valid */
ttable[index].r = r;
ttable[index].g = g;
ttable[index].b = b;
ttable[index].slot = ccount;
}
}
return TRUE;
}
/* This deserves better. Don't read it too closely - you'll get ill. */
#define bufsz 2048
char buf[bufsz];
xpmgetline()
{
char *bp;
do {
if (fgets(buf, bufsz, xpmfh) == 0)
return 0;
} while (buf[0] != '"');
/* strip off the trailing <",> if any */
for (bp = buf; *bp; bp++)
;
bp--;
while (isspace(*bp))
bp--;
if (*bp == ',')
bp--;
if (*bp == '"')
bp--;
bp++;
*bp = '\0';
return &buf[1];
}
-9
View File
@@ -110,10 +110,6 @@ static char fqn_filename_buffer[FQN_NUMBUF][FQN_MAX_FILENAME];
#ifdef AMIGA
extern char PATH[]; /* see sys/amiga/amidos.c */
extern char bbs_id[];
#ifdef __SASC_60
#include <proto/dos.h>
#endif
#include <libraries/dos.h>
extern void amii_set_text_font(char *, int);
@@ -1065,11 +1061,6 @@ set_savefile_name(boolean regularize_it)
#if defined(MICRO) && !defined(WIN32) && !defined(MSDOS)
if (strlen(gs.SAVEP) < (SAVESIZE - 1))
Strcpy(gs.SAVEF, gs.SAVEP);
else
#ifdef AMIGA
if (strlen(gs.SAVEP) + strlen(bbs_id) < (SAVESIZE - 1))
strncat(gs.SAVEF, bbs_id, PATHLEN);
#endif
{
int i = strlen(gs.SAVEP);
#ifdef AMIGA
+7 -124
View File
@@ -20,10 +20,8 @@
#undef COUNT
#if defined(__SASC_60) || defined(__GNUC__)
#include <proto/exec.h>
#include <proto/dos.h>
#endif
/* POSIX stubs needed by libnix (-noixemul) */
#ifdef __noixemul__
@@ -47,30 +45,19 @@ amiga_self_assign(void)
UnLock(dup);
}
/* Generate an RFC 4122 v4 UUID for this game. Entropy comes from
DateStamp + the running task's address mixed through a small LCG. */
/* Generate an RFC 4122 v4 UUID for this game. Draw bytes from the
core's ISAAC64 RNG, which init_random() seeded before we get here. */
void
get_nhuuid(void)
{
uchar bytes[16];
struct DateStamp ds;
unsigned long x;
int i;
if (svn.nhuuid[0])
return;
DateStamp(&ds);
x = (unsigned long) ds.ds_Days
^ ((unsigned long) ds.ds_Minute << 16)
^ ((unsigned long) ds.ds_Tick << 8)
^ (unsigned long) FindTask(NULL);
/* Classic glibc/POSIX rand() LCG (Knuth, C99 7.22.2.1). Full period
2^32; we read bits 16-23 to skip the LCG's bad low bits. */
for (i = 0; i < 16; i++) {
x = x * 1103515245u + 12345u;
bytes[i] = (uchar) (x >> 16);
}
for (i = 0; i < 16; i++)
bytes[i] = (uchar) rn2(256);
/* RFC 4122: version=4 (random), variant=10. */
bytes[6] = (bytes[6] & 0x0F) | 0x40;
bytes[8] = (bytes[8] & 0x3F) | 0x80;
@@ -96,21 +83,8 @@ free_nhuuid(void)
}
}
#ifdef AZTEC_50
#include <functions.h>
#undef strcmpi
#endif
/* Prototypes */
#ifndef CROSS_TO_AMIGA
#include "NH:sys/amiga/amiwind.p"
#include "NH:sys/amiga/winami.p"
#include "NH:sys/amiga/amidos.p"
#else
#include "amiwind.p"
#include "winami.p"
#include "amidos.p"
#endif
#include "winext.h"
#include "winproto.h"
extern char Initialized;
@@ -118,9 +92,7 @@ extern struct window_procs amii_procs;
struct ami_sysflags sysflags = {0};
FILE *fopenp(const char *, const char *);
#ifndef __SASC_60
int Enable_Abort = 0; /* for stdio package */
#endif
/* Initial path, so we can find NetHack.cnf */
char PATH[PATHLEN] = "NetHack:";
@@ -151,27 +123,6 @@ getlogin(void)
/* abs() provided by libnix/stdlib */
#ifdef SHELL
int
dosh(void)
{
int i = 0;
char buf[BUFSZ];
extern struct ExecBase *SysBase;
/* Only under 2.0 and later ROMs do we have System() */
if (SysBase->LibNode.lib_Version >= 37 && !amibbs) {
getlin("Enter CLI Command...", buf);
if (buf[0] != '\033')
i = System(buf, NULL);
} else {
i = 0;
pline("No mysterious force prevented you from using multitasking.");
}
return i;
}
#endif /* SHELL */
#ifdef MFLOPPY
#include <ctype.h>
@@ -276,74 +227,6 @@ filesize(char *file)
return size;
}
#if 0
void
void
eraseall(const char *path, const char *files)
{
BPTR dirLock, dirLock2;
struct FileInfoBlock *fibp;
int chklen;
#if (NH_DEVEL_STATUS != NH_STATUS_RELEASED)
if(files != g.alllevels)panic("eraseall");
#endif
chklen=(int)index(files,'*')-(int)files;
if (dirLock = Lock( (char *)path ,SHARED_LOCK)) {
dirLock2=DupLock(dirLock);
dirLock2= CurrentDir(dirLock2);
fibp=AllocMem(sizeof(struct FileInfoBlock),0);
if(fibp){
if(Examine(dirLock,fibp)){
while(ExNext(dirLock,fibp)){
if(!strncmp(fibp->fib_FileName,files,chklen)){
DeleteFile(fibp->fib_FileName);
}
}
}
FreeMem(fibp,sizeof(struct FileInfoBlock));
}
UnLock(dirLock);
UnLock(CurrentDir(dirLock2));
}
}
#endif
/* This size makes that most files can be copied with two Read()/Write()s */
#if 0 /* Unused */
#define COPYSIZE 4096
char *CopyFile(const char *from, const char *to)
{
BPTR fromFile, toFile;
char *buffer;
long size;
char *error = NULL;
buffer = (char *) alloc(COPYSIZE);
if (fromFile = Open( (char *)from, MODE_OLDFILE)) {
if (toFile = Open( (char *)to, MODE_NEWFILE)) {
while (size = Read(fromFile, buffer, (long)COPYSIZE)) {
if (size == -1){
error = "Read error";
break;
}
if (size != Write(toFile, buffer, size)) {
error = "Write error";
break;
}
}
Close(toFile);
} else
error = "Cannot open destination";
Close(fromFile);
} else
error = "Cannot open source (this should not occur)";
free(buffer);
return error;
}
#endif
#ifdef MFLOPPY
/* this should be replaced */
@@ -481,7 +364,7 @@ fopenp(const char *name, const char *mode)
while (pp && *pp) {
bp = buf;
while (*pp && *pp != PATHSEP) {
if (bp > buf + BUFSIZ - 1)
if (bp >= buf + BUFSIZ - 1)
return (NULL);
lastch = *bp++ = *pp++;
}
-43
View File
@@ -1,43 +0,0 @@
/* NetHack 3.6 amidos.p $NHDT-Date: 1432512796 2015/05/25 00:13:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.7 $ */
/* Copyright (c) Kenneth Lorber, Bethesda, Maryland, 1992, 1993. */
/* NetHack may be freely redistributed. See license for details. */
/* amidos.c */
void flushout (void);
#ifndef getuid
int getuid (void);
#endif
#ifndef getpid
int getpid (void);
#endif
#ifndef getlogin
char *getlogin (void);
#endif
#ifndef abs
int abs(int );
#endif
int tgetch (void);
int dosh (void);
void amiga_self_assign (void);
long freediskspace(char *);
long filesize(char *);
void eraseall(const char * , const char *);
char *CopyFile(const char * , const char *);
void copybones(int );
void playwoRAMdisk (void);
int saveDiskPrompt(int );
void gameDiskPrompt (void);
void append_slash(char *);
void getreturn(const char *);
#ifndef msmsg
void msmsg( const char *, ... );
#endif
#if !defined(__SASC_60) && !defined(_DCC) && !defined(CROSS_TO_AMIGA)
int chdir(char *);
#endif
#ifndef strcmpi
int strcmpi(char * , char *);
#endif
#if !defined(memcmp) && !defined(AZTEC_C) && !defined(_DCC) && !defined(__GNUC__)
int memcmp(unsigned char * , unsigned char * , int );
#endif
-49
View File
@@ -1,49 +0,0 @@
/* NetHack 3.6 amigst.c $NHDT-Date: 1432512794 2015/05/25 00:13:14 $ $NHDT-Branch: master $:$NHDT-Revision: 1.7 $ */
/* Copyright (c) Gregg Wonderly, Naperville, IL, 1992, 1993 */
/* NetHack may be freely redistributed. See license for details. */
#include <stdio.h>
#include <exec/types.h>
#include <exec/io.h>
#include <exec/alerts.h>
#include <exec/devices.h>
#include <devices/console.h>
#include <devices/conunit.h>
#include <graphics/gfxbase.h>
#include <intuition/intuition.h>
#include <libraries/dosextens.h>
#include <ctype.h>
#undef strcmpi
#include <string.h>
#include <errno.h>
#ifdef __SASC
#include <dos.h> /* for __emit */
#include <string.h>
#include <proto/dos.h>
#include <proto/exec.h>
#include <proto/graphics.h>
#include <proto/intuition.h>
#include <proto/diskfont.h>
#include <proto/console.h>
#endif
#include "hack.h"
#include "winprocs.h"
#include "winami.h"
#ifdef AZTEC
#include <functions.h>
#endif
#ifndef CROSS_TO_AMIGA
#include "NH:sys/amiga/winami.p"
#include "NH:sys/amiga/amiwind.p"
#include "NH:sys/amiga/amidos.p"
#else
#include "winami.p"
#include "amiwind.p"
#include "amidos.p"
#endif
/* end amigst.c */
+61 -25
View File
@@ -1,31 +1,67 @@
Amiga-specific help file for NetHack 3.6
Amiga-specific help for NetHack 5.0
The Amiga port of NetHack supports a number of additional commands
and facilities specific to the Amiga. Listed below are the things
which are either specific to the Amiga port or might not appear
in other ports.
While playing NetHack you can press:
Special key combinations
------------------------
ALT-HELP Edit the screen colour palette.
CTL-HELP Set tile scaling and clipping (amiv only).
SHIFT-HELP Toggle the dungeon overview window (amiv only).
ALT-HELP Color requestor.
CTL-HELP Scale display (amitile only).
SHIFT-HELP Overview window (amitile only).
Amiga-specific run-time options:
altmeta use the alt keys as meta keys
flush throw away keyboard type-ahead
Command-line flags
------------------
-L Force interlaced (tall) screen.
-l Force non-interlaced screen.
-uNAME Play as NAME (e.g. -uwizard for wizard mode).
-pCLASS Pick a profession (e.g. -pvalkyrie).
-rRACE Pick a race.
Command line options recognized are
Wizard/debug mode is gated on the player name matching WIZARD_NAME
("wizard" by default), so the simplest way in is -uwizard.
-n No News at game startup.
-X Play in discovery mode.
-D Play in debug mode.
-L Interlaced screen.
-l Never Interlaced screen.
-u Play as player given as
an argument.
-r Pick a race given as an
argument.
-p Pick a profession given
as an argument
-? Gives command line usage.
Configuration (nethack.cnf in the NetHack: drawer)
--------------------------------------------------
Window backend selection:
OPTIONS=windowtype:amiv tile graphics (default)
OPTIONS=windowtype:amii text/character mode
Amiga-specific runtime options:
OPTIONS=altmeta ALT+letter sends META+letter (default on).
Disable with !altmeta if your keymap needs
ALT for typing accented characters.
OPTIONS=flush drop any keys queued during long operations
OPTIONS=asksavedisk prompt for a save-disk before saving
(MFLOPPY only)
File-location overrides
-----------------------
NetHack: is automatically assigned to the directory the executable was
launched from. All game files default to that volume. Override any of
these in nethack.cnf to relocate parts of the game state:
HACKDIR=NetHack: program / shared data
LEVELDIR=NetHack: per-level files during play
SAVEDIR=NetHack:save/ save files
BONESDIR=NetHack:bones/ bones files (shared between games)
DATADIR=NetHack: nhdat and other data files
SCOREDIR=NetHack: record / logfile
LOCKDIR=NetHack: lock files
CONFIGDIR=NetHack: per-user config
You can also override the install path entirely without editing the cnf
by setting the NETHACKDIR or HACKDIR shell environment variable before
launching:
setenv NETHACKDIR Work:games/nethack-dev/
Work:games/nethack-dev/nethack
Display fallback
----------------
Tile mode (amiv) requires at least 16 colours and ~384 KB free chip
RAM. If neither is available the game falls back to text mode (amii)
at startup with a one-line note.
-16
View File
@@ -28,20 +28,10 @@ static struct RastPort *rp;
#undef NULL
#define NULL 0
#ifdef AZTEC_C
#include <functions.h>
#else
#ifdef _DCC
#include <clib/dos_protos.h>
#include <clib/exec_protos.h>
#include <clib/console_protos.h>
#include <clib/diskfont_protos.h>
#else
#include <proto/dos.h>
#include <proto/exec.h>
#include <proto/console.h>
#include <proto/diskfont.h>
#endif
static BitMapHeader tomb_bmhd;
static struct BitMap *tombimg = NULL;
@@ -58,14 +48,8 @@ static int xoff, yoff; /* image centering */
#undef red
#undef green
#undef blue
#ifdef _DCC
#include <clib/graphics_protos.h>
#include <clib/intuition_protos.h>
#else
#include <proto/graphics.h>
#include <proto/intuition.h>
#endif
#endif /* AZTEC_C */
static struct Window *ripwin = 0;
static void tomb_text(char *);
+2 -17
View File
@@ -2,30 +2,15 @@
/* Copyright (c) Janne Salmijärvi, Tampere, Finland, 2000 */
/* NetHack may be freely redistributed. See license for details. */
/*
* Increase stack size to allow deep recursions.
*
* Note: This is SAS/C specific, using other compiler probably
* requires another method for increasing stack.
*
*/
#ifdef __SASC_60
#include <dos.h>
#endif
/*
* Increase stack size to allow deep recursions.
* NetHack 5.0 with Lua needs significantly more stack than 3.6.
*
* libnix needs __stkinit referenced to pull swapstack.o from libnix.a.
*/
#ifdef __SASC_60
long __stack = 256 * 1024;
#else
/* libnix needs __stkinit referenced to pull swapstack.o from libnix.a */
unsigned long __stack = 256 * 1024;
#ifdef CROSS_TO_AMIGA
extern void __stkinit(void);
void *__nh_force_stkinit = __stkinit;
#endif
#endif
-85
View File
@@ -1,85 +0,0 @@
/* NetHack 3.6 amitty.c $NHDT-Date: 1432512795 2015/05/25 00:13:15 $ $NHDT-Branch: master $:$NHDT-Revision: 1.7 $ */
/* Copyright (c) Kenneth Lorber, Bethesda, Maryland 1993,1996 */
/* NetHack may be freely redistributed. See license for details. */
/* TTY-specific code for the Amiga
* This is still experimental.
* Still to do:
* add real termcap handling - currently requires ANSI_DEFAULT
*/
#include "hack.h"
#include "tcap.h"
#include <stdio.h>
#include <proto/dos.h>
#ifdef _DCC
#define getch() getchar()
#endif
#ifdef __SASC_60
#include <clib/dos_protos.h>
#endif
void tty_change_color(void);
char *tty_get_color_string(void);
int amibbs = 0; /* BBS mode */
char bbs_id[80] = ""; /* BBS uid equivalent */
long afh_in, afh_out; /* BBS mode Amiga filehandles */
#ifdef TTY_GRAPHICS
void
settty(const char *s)
{
end_screen();
if (s)
raw_print(s);
iflags.cbreak = ON; /* this is too easy: probably wrong */
#if 1 /* should be version>=36 */
/* if(IsInteractive(afh_in)){ */
SetMode(afh_in, 0); /* con mode */
/* } */
#endif
}
void
gettty()
{
#if 1 /* should be VERSION >=36 */
/* if(IsInteractive(afh_in)){ */
SetMode(afh_in, 1); /* raw mode */
/* } */
#endif
}
void
setftty()
{
iflags.cbreak = ON; /* ditto */
}
char kill_char = 'X' - '@';
char erase_char = '\b';
int
tgetch(void)
{
unsigned char x;
Read(afh_in, &x, 1);
return (x == '\r') ? '\n' : x;
}
void
get_scr_size()
{
CO = 80;
LI = 24;
}
#endif
void
tty_change_color()
{
}
char *
tty_get_color_string()
{
return ("");
}
+9 -62
View File
@@ -3,15 +3,9 @@
/* Copyright (c) Kenneth Lorber, Bethesda, Maryland 1993,1996 */
/* NetHack may be freely redistributed. See license for details. */
#ifndef CROSS_TO_AMIGA
#include "NH:sys/amiga/windefs.h"
#include "NH:sys/amiga/winext.h"
#include "NH:sys/amiga/winproto.h"
#else
#include "windefs.h"
#include "winext.h"
#include "winproto.h"
#endif
/* Have to undef CLOSE as display.h and intuition.h both use it */
#undef CLOSE
@@ -23,7 +17,7 @@ static struct Message *GetFMsg(struct MsgPort *);
#endif
static int BufferGetchar(void);
static void ProcessMessage(struct IntuiMessage *message);
void ProcessMessage(struct IntuiMessage *message);
#define BufferQueueChar(ch) (KbdBuffer[KbdBuffered++] = (ch))
@@ -38,11 +32,7 @@ struct Library *GadToolsBase = NULL;
struct Library *LayersBase = NULL;
struct Library *AslBase = NULL;
#ifndef CROSS_TO_AMIGA
#include "NH:sys/amiga/amimenu.c"
#else
#include "amimenu.c"
#endif
/* Now our own variables */
@@ -69,15 +59,17 @@ struct TextFont *TextsFont = NULL;
struct TextFont *HackFont = NULL;
struct TextFont *RogueFont = NULL;
UBYTE FontName[] = "NetHack:hack.font";
/* # chars in "NetHack:": */
#define SIZEOF_DISKNAME 8
/* hack.font is registered via NetHack:hack.font (which references
* NetHack:hack/8). OpenFont()/SetFont() take the bare name; only
* OpenDiskFont() needs the full path. */
UBYTE HackFontName[] = "hack.font";
UBYTE HackFontPath[] = "NetHack:hack.font";
#endif
struct TextAttr Hack80 = {
#ifdef HACKFONT
&FontName[SIZEOF_DISKNAME],
HackFontName,
#else
(UBYTE *) "topaz.font",
#endif
@@ -328,9 +320,6 @@ ConvertKey(struct IntuiMessage *message)
got = 0;
break;
}
#ifdef OPT_DISPMAP
dispmap_sanity();
#endif
if (got) {
CO = (w->Width - w->BorderLeft - w->BorderRight) / mxsize;
@@ -365,7 +354,7 @@ ConvertKey(struct IntuiMessage *message)
* ahead of input demands, when the user types ahead.
*/
static void
void
ProcessMessage(struct IntuiMessage *message)
{
int c;
@@ -630,7 +619,6 @@ amii_cleanup(void)
* be visitors, so check close status and wait till everyone is gone.
*/
if (HackScreen) {
#ifdef INTUI_NEW_LOOK
if (IntuitionBase->LibNode.lib_Version >= 37) {
if (MenuStrip)
FreeMenus(MenuStrip);
@@ -643,9 +631,7 @@ amii_cleanup(void)
};
EasyRequest(NULL, &easy, NULL, NULL);
}
} else
#endif
{
} else {
CloseScreen(HackScreen);
}
HackScreen = NULL;
@@ -693,13 +679,6 @@ amii_cleanup(void)
IntuitionBase = NULL;
}
#ifdef SHAREDLIB
if (DOSBase) {
CloseLibrary((struct Library *) DOSBase);
DOSBase = NULL;
}
#endif
((struct Process *) FindTask(NULL))->pr_WindowPtr = (APTR) pr_WindowPtr;
Initialized = 0;
@@ -707,11 +686,9 @@ amii_cleanup(void)
#endif /* AMII_GRAPHICS */
#ifndef SHAREDLIB
void
Abort(long rc)
{
int fault = 1;
#ifdef CHDIR
extern char orgdir[];
chdir(orgdir);
@@ -724,38 +701,11 @@ Abort(long rc)
} else
#endif
printf("\n\nAbort with alert code %08lx...\n", rc);
/* Alert(rc); this is too severe */
#ifdef __SASC
#ifdef INTUI_NEW_LOOK
if (IntuitionBase->LibNode.lib_Version >= 37) {
struct EasyStruct es = {
sizeof(struct EasyStruct), 0, "NetHack Panic Request",
"NetHack is Aborting with code == 0x%08lx",
"Continue Abort|Return to Program|Clean up and exit",
};
fault = EasyRequest(NULL, &es, NULL, (long) rc);
if (fault == 2)
return;
}
#endif
if (fault == 1) {
/* __emit(0x4afc); */ /* illegal instruction */
__emit(0x40fc); /* divide by */
__emit(0x0000); /* #0 */
/* NOTE: don't move amii_cleanup() above here - */
/* it is too likely to kill the system */
/* before it can get the SnapShot out, if */
/* there is something really wrong. */
}
#endif
#ifdef AMII_GRAPHICS
if (windowprocs.win_init_nhwindows == amii_procs.win_init_nhwindows)
amii_cleanup();
#endif
#undef exit
#ifdef AZTEC_C
_abort();
#endif
exit((int) rc);
}
@@ -764,7 +714,6 @@ CleanUp(void)
{
amii_cleanup();
}
#endif
#ifdef AMII_GRAPHICS
@@ -880,7 +829,6 @@ amii_number_pad(int state)
}
#endif /* AMII_GRAPHICS */
#ifndef SHAREDLIB
void
amiv_loadlib(void)
{
@@ -910,4 +858,3 @@ VA_DECL(const char *, s)
VA_END();
Abort(0L);
}
#endif
-40
View File
@@ -1,40 +0,0 @@
/* NetHack 3.6 amiwind.p $NHDT-Date: 1432512795 2015/05/25 00:13:15 $ $NHDT-Branch: master $:$NHDT-Revision: 1.6 $ */
/* Copyright (c) Gregg Wonderly, Naperville, IL, 1992, 1993 */
/* NetHack may be freely redistributed. See license for details. */
/* amiwind.c */
#ifdef INTUI_NEW_LOOK
struct Window * OpenShWindow(struct ExtNewWindow *) ;
#else
struct Window * OpenShWindow(struct NewWindow *) ;
#endif
void CloseShWindow(struct Window *);
int kbhit (void);
int amikbhit (void);
int WindowGetchar (void);
WETYPE WindowGetevent (void);
void WindowFlush (void);
void WindowPutchar(char );
void WindowFPuts(const char *);
void WindowPuts(const char *);
void WindowPrintf( char *,... );
void CleanUp (void);
int ConvertKey( struct IntuiMessage * );
#ifndef SHAREDLIB
void Abort(long );
#endif
void flush_glyph_buffer(struct Window *);
void amiga_print_glyph(winid , int , int );
void start_glyphout(winid );
void amii_end_glyphout(winid );
#ifdef INTUI_NEW_LOOK
struct ExtNewWindow * DupNewWindow(struct ExtNewWindow *);
void FreeNewWindow(struct ExtNewWindow *);
#else
struct NewWindow * DupNewWindow(struct NewWindow *);
void FreeNewWindow(struct NewWindow *);
#endif
void bell (void);
void amii_delay_output (void);
void amii_number_pad(int );
void amii_cleanup( void );
+14
View File
@@ -47,3 +47,17 @@ MENUCOLOR="gray dragon scale"=cyan
MENUCOLOR="speed boots"=magenta
MENUCOLOR="luckstone"=green
MENUCOLOR="unicorn horn"=green
# *** FILE LOCATIONS ***
# NetHack: is auto-assigned to the directory the binary was launched
# from, so all game files default there. Uncomment any of these to
# relocate part of the game state to a different volume or subdir.
#
#HACKDIR=NetHack:
#LEVELDIR=NetHack:
#SAVEDIR=NetHack:save/
#BONESDIR=NetHack:bones/
#DATADIR=NetHack:
#SCOREDIR=NetHack:
#LOCKDIR=NetHack:
#CONFIGDIR=NetHack:
+22 -41
View File
@@ -3,15 +3,9 @@
*/
/* NetHack may be freely redistributed. See license for details. */
#ifndef CROSS_TO_AMIGA
#include "NH:sys/amiga/windefs.h"
#include "NH:sys/amiga/winext.h"
#include "NH:sys/amiga/winproto.h"
#else
#include "windefs.h"
#include "winext.h"
#include "winproto.h"
#endif
/* Start building the text for a menu */
void
@@ -215,7 +209,7 @@ make_menu_items(struct amii_WinDesc *cw, menu_item **rmip)
}
if (idx) {
mmip = *rmip = (menu_item *) alloc(idx * sizeof(*mip));
mmip = *rmip = (menu_item *) alloc(idx * sizeof(menu_item));
for (mip = cw->menu.items; mip; mip = mip->next) {
if (mip->selected) {
mmip->item = mip->identifier;
@@ -271,11 +265,9 @@ DoMenuScroll(int win, int blocking, int how, menu_item **retmip)
topidx = 0;
if (w == NULL) {
#ifdef INTUI_NEW_LOOK
if (IntuitionBase->LibNode.lib_Version >= 37) {
PropScroll.Flags |= PROPNEWLOOK;
}
#endif
nw = (void *) DupNewWindow((void *) (&new_wins[cw->type].newwin));
if (!alwaysinvent || win != WIN_INVEN) {
xsize = scrn->WBorLeft + scrn->WBorRight + MenuScroll.Width + 1
@@ -368,10 +360,8 @@ DoMenuScroll(int win, int blocking, int how, menu_item **retmip)
}
nw->Height = min(ysize, amiIDisplay->ypix - nw->TopEdge);
if (WINVERS_AMIV || WINVERS_AMII) {
/* Make sure we are using the correct hook structure */
nw->Extension = cw->wintags;
}
/* Make sure we are using the correct hook structure */
nw->Extension = cw->wintags;
/* Now, open the window */
w = cw->win = OpenShWindow((void *) nw);
@@ -447,13 +437,6 @@ DoMenuScroll(int win, int blocking, int how, menu_item **retmip)
morc = 0;
oidx = -1;
#if 0
/* Make sure there are no selections left over from last time. */
/* XXX potential problem for preselection if this is really needed */
for( amip = cw->menu.items; amip; amip = amip->next )
amip->selected = 0;
#endif
DisplayData(win, topidx);
/* Make the prop gadget the right size and place */
@@ -480,11 +463,13 @@ DoMenuScroll(int win, int blocking, int how, menu_item **retmip)
mx = imsg->MouseX;
my = imsg->MouseY;
/* Only do our window or VANILLAKEY from other windows */
/* Only do our window or VANILLAKEY from other windows.
* Background events (NEWSIZE on inventory, CLOSEWINDOW
* on overview, etc.) get routed to the main dispatcher
* so the game stays in sync. ProcessMessage ReplyMsgs. */
if (imsg->IDCMPWindow != w && class != VANILLAKEY
&& class != RAWKEY) {
ReplyMsg((struct Message *) imsg);
ProcessMessage(imsg);
continue;
}
@@ -550,21 +535,19 @@ DoMenuScroll(int win, int blocking, int how, menu_item **retmip)
* amii_cl_end if window shrinks and columns decrease.
*/
if (WINVERS_AMII || WINVERS_AMIV) {
amii_setfillpens(w, cw->type);
SetDrMd(w->RPort, JAM2);
x2 = w->Width - w->BorderRight;
y2 = w->Height - w->BorderBottom;
x1 = x2 - w->IFont->tf_XSize - w->IFont->tf_XSize;
y1 = w->BorderTop;
if (x1 < w->BorderLeft)
x1 = w->BorderLeft;
RectFill(w->RPort, x1, y1, x2, y2);
amii_setfillpens(w, cw->type);
SetDrMd(w->RPort, JAM2);
x2 = w->Width - w->BorderRight;
y2 = w->Height - w->BorderBottom;
x1 = x2 - w->IFont->tf_XSize - w->IFont->tf_XSize;
y1 = w->BorderTop;
if (x1 < w->BorderLeft)
x1 = w->BorderLeft;
y1 = y1 - w->IFont->tf_YSize;
RectFill(w->RPort, x1, y1, x2, y2);
RefreshWindowFrame(w);
}
RectFill(w->RPort, x1, y1, x2, y2);
x1 = w->BorderLeft;
y1 = y1 - w->IFont->tf_YSize;
RectFill(w->RPort, x1, y1, x2, y2);
RefreshWindowFrame(w);
/* Make the prop gadget the right size and place */
@@ -982,8 +965,8 @@ DoMenuScroll(int win, int blocking, int how, menu_item **retmip)
amip->str[SOFF + 2] = '-';
}
}
if (counting && amip->selected && amip->canselect
&& amip->selector) {
if (amip && counting && amip->selected
&& amip->canselect && amip->selector) {
amip->count = count;
reset_counting = TRUE;
amip->str[SOFF + 2] = '#';
@@ -1415,11 +1398,9 @@ SetPropInfo(struct Window *win, struct Gadget *gad, long vis, long total, long t
pot = 0;
mflags = AUTOKNOB | FREEVERT;
#ifdef INTUI_NEW_LOOK
if (IntuitionBase->LibNode.lib_Version >= 37) {
mflags |= PROPNEWLOOK;
}
#endif
NewModifyProp(gad, win, NULL, mflags, 0, pot, MAXBODY, body, 1);
}
+37 -503
View File
@@ -3,15 +3,9 @@
*/
/* NetHack may be freely redistributed. See license for details. */
#ifndef CROSS_TO_AMIGA
#include "NH:sys/amiga/windefs.h"
#include "NH:sys/amiga/winext.h"
#include "NH:sys/amiga/winproto.h"
#else
#include "windefs.h"
#include "winext.h"
#include "winproto.h"
#endif
#include "dlb.h"
@@ -38,76 +32,35 @@ long amii_scrnmode;
/* Interface definition, for use by windows.c and winprocs.h to provide
* the intuition interface for the amiga...
*/
struct window_procs amii_procs = {
WPID(amii),
WC_COLOR | WC_HILITE_PET | WC_INVERSE,
0L,
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, /* color availability */
amii_init_nhwindows,
amii_player_selection, amii_askname, amii_get_nh_event,
amii_exit_nhwindows, amii_suspend_nhwindows, amii_resume_nhwindows,
amii_create_nhwindow, amii_clear_nhwindow, amii_display_nhwindow,
amii_destroy_nhwindow, amii_curs, amii_putstr, genl_putmixed,
amii_display_file, amii_start_menu, amii_add_menu, amii_end_menu,
amii_select_menu, genl_message_menu,
amii_mark_synch, amii_wait_synch,
#ifdef CLIPPING
amii_cliparound,
#endif
#ifdef POSITIONBAR
donull,
#endif
amii_print_glyph, amii_raw_print, amii_raw_print_bold, amii_nhgetch,
amii_nh_poskey, amii_bell, amii_doprev_message, amii_yn_function,
amii_getlin, amii_get_ext_cmd, amii_number_pad, amii_delay_output,
#ifdef CHANGE_COLOR /* only a Mac option currently */
amii_change_color, amii_get_color_string,
#endif
amii_outrip, genl_preference_update,
genl_getmsghistory, genl_putmsghistory,
genl_status_init, genl_status_finish, genl_status_enablefield,
genl_status_update,
genl_can_suspend_yes,
amii_update_inventory,
amii_ctrl_nhwindow,
};
/* Both windowports share the same function table -- the AMII (text) /
* AMIV (tile) split happens at runtime based on WINVERS_AMIV checks. */
#define AMI_WIN_PROCS_BODY \
WC_COLOR | WC_HILITE_PET | WC_INVERSE, \
0L, \
{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, /* has_color */ \
amii_init_nhwindows, \
amii_player_selection, amii_askname, amii_get_nh_event, \
amii_exit_nhwindows, amii_suspend_nhwindows, amii_resume_nhwindows, \
amii_create_nhwindow, amii_clear_nhwindow, amii_display_nhwindow, \
amii_destroy_nhwindow, amii_curs, amii_putstr, genl_putmixed, \
amii_display_file, amii_start_menu, amii_add_menu, amii_end_menu, \
amii_select_menu, genl_message_menu, \
amii_mark_synch, amii_wait_synch, \
amii_cliparound, \
amii_print_glyph, amii_raw_print, amii_raw_print_bold, amii_nhgetch,\
amii_nh_poskey, amii_bell, amii_doprev_message, amii_yn_function, \
amii_getlin, amii_get_ext_cmd, amii_number_pad, amii_delay_output, \
amii_change_color, amii_get_color_string, \
amii_outrip, genl_preference_update, \
genl_getmsghistory, genl_putmsghistory, \
genl_status_init, genl_status_finish, genl_status_enablefield, \
genl_status_update, \
genl_can_suspend_yes, \
amii_update_inventory, \
amii_ctrl_nhwindow
/* The view window layout uses the same function names so we can use
* a shared library to allow the executable to be smaller.
*/
struct window_procs amiv_procs = {
WPID(amiv),
WC_COLOR | WC_HILITE_PET | WC_INVERSE,
0L,
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, /* color availability */
amii_init_nhwindows,
amii_player_selection, amii_askname, amii_get_nh_event,
amii_exit_nhwindows, amii_suspend_nhwindows, amii_resume_nhwindows,
amii_create_nhwindow, amii_clear_nhwindow, amii_display_nhwindow,
amii_destroy_nhwindow, amii_curs, amii_putstr, genl_putmixed,
amii_display_file, amii_start_menu, amii_add_menu, amii_end_menu,
amii_select_menu, genl_message_menu,
amii_mark_synch, amii_wait_synch,
#ifdef CLIPPING
amii_cliparound,
#endif
#ifdef POSITIONBAR
donull,
#endif
amii_print_glyph, amii_raw_print, amii_raw_print_bold, amii_nhgetch,
amii_nh_poskey, amii_bell, amii_doprev_message, amii_yn_function,
amii_getlin, amii_get_ext_cmd, amii_number_pad, amii_delay_output,
#ifdef CHANGE_COLOR /* only a Mac option currently */
amii_change_color, amii_get_color_string,
#endif
amii_outrip, genl_preference_update,
genl_getmsghistory, genl_putmsghistory,
genl_status_init, genl_status_finish, genl_status_enablefield,
genl_status_update,
genl_can_suspend_yes,
amii_update_inventory,
amii_ctrl_nhwindow,
};
struct window_procs amii_procs = { WPID(amii), AMI_WIN_PROCS_BODY };
struct window_procs amiv_procs = { WPID(amiv), AMI_WIN_PROCS_BODY };
unsigned short amii_initmap[AMII_MAXCOLORS];
/* Default pens used unless user overides in nethack.cnf. */
@@ -159,8 +112,7 @@ unsigned short amiv_init_map[AMII_MAXCOLORS] = {
0x0fff, /* color #31 */
};
#if !defined(TTY_GRAPHICS) \
|| defined(SHAREDLIB) /* this should be shared better */
#ifndef TTY_GRAPHICS
char morc; /* the character typed in response to a --more-- prompt */
#endif
char spaces[76] = " "
@@ -207,14 +159,12 @@ int wincnt = 0; /* # of nh windows opened */
* while they are playing... like compiling...
*/
#ifdef INTUI_NEW_LOOK
extern struct Hook fillhook;
struct TagItem tags[] = {
{ WA_BackFill, (ULONG) &fillhook },
{ WA_PubScreenName, (ULONG) "NetHack" },
{ TAG_DONE, 0 },
};
#endif
/*
* The default dimensions and status values for each window type. The
@@ -230,16 +180,10 @@ struct win_setup new_wins[] = {
{ { 0, 1, 640, 11, 0xff, 0xff,
NEWSIZE | GADGETUP | GADGETDOWN | MOUSEMOVE | MOUSEBUTTONS | RAWKEY,
BORDERLESS | ACTIVATE | SMART_REFRESH
#ifdef INTUI_NEW_LOOK
| WFLG_NW_EXTENDED
#endif
,
NULL, NULL, (UBYTE *) "Messages", NULL, NULL, 320, 40, 0xffff, 0xffff,
#ifdef INTUI_NEW_LOOK
PUBLICSCREEN, tags
#else
CUSTOMSCREEN
#endif
},
0,
0,
@@ -251,16 +195,10 @@ struct win_setup new_wins[] = {
/* NHW_STATUS */
{ { 0, 181, 640, 24, 0xff, 0xff, RAWKEY | MENUPICK | DISKINSERTED,
BORDERLESS | ACTIVATE | SMART_REFRESH | BACKDROP
#ifdef INTUI_NEW_LOOK
| WFLG_NW_EXTENDED
#endif
,
NULL, NULL, (UBYTE *) "Game Status", NULL, NULL, 0, 0, 0xffff, 0xffff,
#ifdef INTUI_NEW_LOOK
PUBLICSCREEN, tags
#else
CUSTOMSCREEN
#endif
},
0,
0,
@@ -273,17 +211,11 @@ struct win_setup new_wins[] = {
{ { 0, 0, WIDTH, WINDOWHEIGHT, 0xff, 0xff,
RAWKEY | MENUPICK | MOUSEBUTTONS | ACTIVEWINDOW | MOUSEMOVE,
BORDERLESS | ACTIVATE | SMART_REFRESH | BACKDROP
#ifdef INTUI_NEW_LOOK
| WFLG_NW_EXTENDED
#endif
,
NULL, NULL, (UBYTE *) "Dungeon Map", NULL, NULL, 64, 64, 0xffff,
0xffff,
#ifdef INTUI_NEW_LOOK
PUBLICSCREEN, tags
#else
CUSTOMSCREEN
#endif
},
0,
0,
@@ -298,16 +230,10 @@ struct win_setup new_wins[] = {
| GADGETDOWN | CLOSEWINDOW | VANILLAKEY | NEWSIZE
| INACTIVEWINDOW,
WINDOWSIZING | WINDOWCLOSE | WINDOWDRAG | ACTIVATE | SMART_REFRESH
#ifdef INTUI_NEW_LOOK
| WFLG_NW_EXTENDED
#endif
,
&MenuScroll, NULL, NULL, NULL, NULL, 64, 32, 0xffff, 0xffff,
#ifdef INTUI_NEW_LOOK
PUBLICSCREEN, tags
#else
CUSTOMSCREEN
#endif
},
0,
0,
@@ -321,17 +247,11 @@ struct win_setup new_wins[] = {
RAWKEY | MENUPICK | DISKINSERTED | MOUSEMOVE | GADGETUP | CLOSEWINDOW
| VANILLAKEY | NEWSIZE,
WINDOWSIZING | WINDOWCLOSE | WINDOWDRAG | ACTIVATE | SMART_REFRESH
#ifdef INTUI_NEW_LOOK
| WFLG_NW_EXTENDED
#endif
,
&MenuScroll, NULL, (UBYTE *) NULL, NULL, NULL, 100, 32, 0xffff,
0xffff,
#ifdef INTUI_NEW_LOOK
PUBLICSCREEN, tags
#else
CUSTOMSCREEN
#endif
},
0,
0,
@@ -340,20 +260,19 @@ struct win_setup new_wins[] = {
22,
78 },
/* NHW_PERMINVENT — placeholder; port does not implement persistent
inventory yet, but the slot must exist because new_wins[] is
indexed by NHW_* type. */
{ { 0 } },
/* NHW_BASE */
{ { 0, 0, WIDTH, WINDOWHEIGHT, 0xff, 0xff,
RAWKEY | MENUPICK | MOUSEBUTTONS,
BORDERLESS | ACTIVATE | SMART_REFRESH | BACKDROP
#ifdef INTUI_NEW_LOOK
| WFLG_NW_EXTENDED
#endif
,
NULL, NULL, (UBYTE *) NULL, NULL, NULL, -1, -1, 0xffff, 0xffff,
#ifdef INTUI_NEW_LOOK
PUBLICSCREEN, tags
#else
CUSTOMSCREEN
#endif
},
0,
0,
@@ -365,16 +284,10 @@ struct win_setup new_wins[] = {
/* NHW_OVER */
{ { 320, 20, 319, 179, 0xff, 0xff, RAWKEY | MENUPICK | MOUSEBUTTONS,
BORDERLESS | ACTIVATE | SMART_REFRESH | BACKDROP
#ifdef INTUI_NEW_LOOK
| WFLG_NW_EXTENDED
#endif
,
NULL, NULL, (UBYTE *) NULL, NULL, NULL, 64, 32, 0xffff, 0xffff,
#ifdef INTUI_NEW_LOOK
PUBLICSCREEN, tags
#else
CUSTOMSCREEN
#endif
},
0,
0,
@@ -389,7 +302,6 @@ const char winpanicstr[] = "Bad winid %d in %s()";
/* The opened windows information */
struct amii_WinDesc *amii_wins[MAXWIN + 1];
#ifdef INTUI_NEW_LOOK
/*
* NUMDRIPENS varies based on headers, so don't use it
* here, its value is used elsewhere.
@@ -408,23 +320,14 @@ struct TagItem scrntags[] = {
{ TAG_DONE, 0 },
};
#endif
struct NewScreen NewHackScreen = { 0, 0, WIDTH, SCREENHEIGHT, 3, 0,
1, /* DetailPen, BlockPen */
HIRES, CUSTOMSCREEN
#ifdef INTUI_NEW_LOOK
| NS_EXTENDED
#endif
,
HIRES, CUSTOMSCREEN | NS_EXTENDED,
&Hack80, /* Font */
NULL, /*(UBYTE *)" NetHack X.Y.Z" */
NULL, /* Gadgets */
NULL, /* CustomBitmap */
#ifdef INTUI_NEW_LOOK
scrntags
#endif
};
scrntags };
/*
* plname is filled either by an option (-u Player or -uPlayer) or
@@ -452,300 +355,8 @@ amii_askname(void)
}
}
/* Discarded ... -jhsa
#include "NH:sys/amiga/char.c"
*/
/* Get the player selection character */
#if 0 /* New function at the bottom */
void
amii_player_selection(void)
{
struct Window *cwin;
struct IntuiMessage *imsg;
int aredone = 0;
struct Gadget *gd;
static int once = 0;
long class, code;
amii_clear_nhwindow( WIN_BASE );
if (validrole(flags.initrole))
return;
else {
flags.initrole = randrole(FALSE);
return;
}
#if 0 /* Don't query the user ... instead give random character -jhsa */
#if 0 /* OBSOLETE */
if( *svp.pl_character ){
svp.pl_character[ 0 ] = toupper( svp.pl_character[ 0 ] );
if( strchr( pl_classes, svp.pl_character[ 0 ] ) )
return;
}
#endif
if( !once ){
if( bigscreen ){
Type_NewWindowStructure1.TopEdge =
(HackScreen->Height/2) - (Type_NewWindowStructure1.Height/2);
}
for( gd = Type_NewWindowStructure1.FirstGadget; gd;
gd = gd->NextGadget )
{
if( gd->GadgetID != 0 )
SetBorder( gd );
}
once = 1;
}
if( WINVERS_AMIV )
{
#ifdef INTUI_NEW_LOOK
Type_NewWindowStructure1.Extension = wintags;
Type_NewWindowStructure1.Flags |= WFLG_NW_EXTENDED;
fillhook.h_Entry = (void *) &LayerFillHook;
fillhook.h_Data = (void *)-2;
fillhook.h_SubEntry = 0;
#endif
}
Type_NewWindowStructure1.Screen = HackScreen;
if( ( cwin = OpenShWindow( (void *)&Type_NewWindowStructure1 ) ) == NULL )
{
return;
}
#if 0
WindowToFront( cwin );
#endif
while( !aredone )
{
WaitPort( cwin->UserPort );
while( ( imsg = (void *) GetMsg( cwin->UserPort ) ) != NULL )
{
class = imsg->Class;
code = imsg->Code;
gd = (struct Gadget *)imsg->IAddress;
ReplyMsg( (struct Message *)imsg );
switch( class )
{
case VANILLAKEY:
if( strchr( pl_classes, toupper( code ) ) )
{
svp.pl_character[0] = toupper( code );
aredone = 1;
}
else if( code == ' ' || code == '\n' || code == '\r' )
{
flags.initrole = randrole(FALSE);
#if 0 /* OBSOLETE */
strcpy( svp.pl_character, roles[ rnd( 11 ) ] );
#endif
aredone = 1;
amii_clear_nhwindow( WIN_BASE );
CloseShWindow( cwin );
RandomWindow( svp.pl_character );
return;
}
else if( code == 'q' || code == 'Q' )
{
CloseShWindow( cwin );
clearlocks();
exit_nhwindows(NULL);
nh_terminate(0);
}
else
DisplayBeep( NULL );
break;
case GADGETUP:
switch( gd->GadgetID )
{
case 1: /* Random Character */
flags.initrole = randrole(FALSE);
#if 0 /* OBSOLETE */
strcpy( svp.pl_character, roles[ rnd( 11 ) ] );
#endif
amii_clear_nhwindow( WIN_BASE );
CloseShWindow( cwin );
RandomWindow( svp.pl_character );
return;
default:
svp.pl_character[0] = gd->GadgetID;
break;
}
aredone = 1;
break;
case CLOSEWINDOW:
CloseShWindow( cwin );
clearlocks();
exit_nhwindows(NULL);
nh_terminate(0);
break;
}
}
}
amii_clear_nhwindow( WIN_BASE );
CloseShWindow( cwin );
#endif /* Do not query user ... -jhsa */
}
#endif /* Function elsewhere */
#if 0 /* Unused ... -jhsa */
#include "NH:sys/amiga/randwin.c"
void
RandomWindow(char *name)
{
struct MsgPort *tport;
struct timerequest *trq;
static int once = 0;
struct Gadget *gd;
struct Window *w;
struct IntuiMessage *imsg;
int ticks = 0, aredone = 0, timerdone = 0;
long mask, got;
tport = CreateMsgPort();
trq = (struct timerequest *)CreateIORequest( tport, sizeof( *trq ) );
if( tport == NULL || trq == NULL )
{
allocerr:
if( tport ) DeleteMsgPort( tport );
if( trq ) DeleteIORequest( (struct IORequest *)trq );
Delay( 8 * 50 );
return;
}
if( OpenDevice( TIMERNAME, UNIT_VBLANK, (struct IORequest *)trq, 0L ) != 0 )
goto allocerr;
trq->tr_node.io_Command = TR_ADDREQUEST;
trq->tr_time.tv_secs = 8;
trq->tr_time.tv_micro = 0;
SendIO( (struct IORequest *)trq );
/* Place the name in the center of the screen */
Rnd_IText5.IText = name;
Rnd_IText6.LeftEdge = Rnd_IText4.LeftEdge +
(strlen(Rnd_IText4.IText)+1)*8;
Rnd_NewWindowStructure1.Width = (
(strlen( Rnd_IText2.IText )+1) * 8 ) +
HackScreen->WBorLeft + HackScreen->WBorRight;
Rnd_IText5.LeftEdge = (Rnd_NewWindowStructure1.Width -
(strlen(name)*8))/2;
gd = Rnd_NewWindowStructure1.FirstGadget;
gd->LeftEdge = (Rnd_NewWindowStructure1.Width - gd->Width)/2;
/* Chose correct modifier */
Rnd_IText6.IText = "a";
switch( *name )
{
case 'a': case 'e': case 'i': case 'o':
case 'u': case 'A': case 'E': case 'I':
case 'O': case 'U':
Rnd_IText6.IText = "an";
break;
}
if( !once )
{
if( bigscreen )
{
Rnd_NewWindowStructure1.TopEdge =
(HackScreen->Height/2) - (Rnd_NewWindowStructure1.Height/2);
}
for( gd = Rnd_NewWindowStructure1.FirstGadget; gd; gd = gd->NextGadget )
{
if( gd->GadgetID != 0 )
SetBorder( gd );
}
Rnd_NewWindowStructure1.IDCMPFlags |= VANILLAKEY;
once = 1;
}
if( WINVERS_AMIV )
{
#ifdef INTUI_NEW_LOOK
Rnd_NewWindowStructure1.Extension = wintags;
Rnd_NewWindowStructure1.Flags |= WFLG_NW_EXTENDED;
fillhook.h_Entry = (void *) &LayerFillHook;
fillhook.h_Data = (void *)-2;
fillhook.h_SubEntry = 0;
#endif
}
Rnd_NewWindowStructure1.Screen = HackScreen;
if( ( w = OpenShWindow( (void *)&Rnd_NewWindowStructure1 ) ) == NULL )
{
AbortIO( (struct IORequest *)trq );
WaitIO( (struct IORequest *)trq );
CloseDevice( (struct IORequest *)trq );
DeleteIORequest( (struct IORequest *) trq );
DeleteMsgPort( tport );
Delay( 50 * 8 );
return;
}
PrintIText( w->RPort, &Rnd_IntuiTextList1, 0, 0 );
mask = (1L << tport->mp_SigBit)|(1L << w->UserPort->mp_SigBit);
while( !aredone )
{
got = Wait( mask );
if( got & (1L << tport->mp_SigBit ) )
{
aredone = 1;
timerdone = 1;
GetMsg( tport );
}
while( w && ( imsg = (struct IntuiMessage *) GetMsg( w->UserPort ) ) )
{
switch( (long)imsg->Class )
{
/* Must be up for a little while... */
case INACTIVEWINDOW:
if( ticks >= 40 )
aredone = 1;
break;
case INTUITICKS:
++ticks;
break;
case GADGETUP:
aredone = 1;
break;
case VANILLAKEY:
if(imsg->Code=='\n' || imsg->Code==' ' || imsg->Code=='\r')
aredone = 1;
break;
}
ReplyMsg( (struct Message *)imsg );
}
}
if( !timerdone )
{
AbortIO( (struct IORequest *)trq );
WaitIO( (struct IORequest *)trq );
}
CloseDevice( (struct IORequest *)trq );
DeleteIORequest( (struct IORequest *) trq );
DeleteMsgPort( tport );
if(w) CloseShWindow( w );
}
#endif /* Discarded randwin ... -jhsa */
/* this should probably not be needed (or be renamed)
void
@@ -760,11 +371,6 @@ amii_get_ext_cmd(void)
menu_item *mip;
anything id;
struct amii_WinDesc *cw;
#ifdef EXTMENU
winid win;
int i;
char buf[256];
#endif
int colx;
int bottom = 0;
@@ -782,47 +388,6 @@ amii_get_ext_cmd(void)
bottom = amii_msgborder(w);
colx = 3;
#ifdef EXTMENU
if (iflags.extmenu) {
win = amii_create_nhwindow(NHW_MENU);
amii_start_menu(win, MENU_BEHAVE_STANDARD);
pline("#");
amii_putstr(WIN_MESSAGE, -1, " ");
for (i = 0; extcmdlist[i].ef_txt != NULL; ++i) {
id.a_char = *extcmdlist[i].ef_txt;
sprintf(buf, "%-10s - %s ", extcmdlist[i].ef_txt,
extcmdlist[i].ef_desc);
amii_add_menu(win, (const glyph_info *) 0, &id,
extcmdlist[i].ef_txt[0], 0, 0, NO_COLOR,
buf, MENU_ITEMFLAGS_NONE);
}
amii_end_menu(win, (char *) 0);
sel = amii_select_menu(win, PICK_ONE, &mip);
amii_destroy_nhwindow(win);
if (sel == 1) {
sel = mip->item.a_char;
for (i = 0; extcmdlist[i].ef_txt != NULL; ++i) {
if (sel == extcmdlist[i].ef_txt[0])
break;
}
/* copy in the text */
if (extcmdlist[i].ef_txt != NULL) {
amii_clear_nhwindow(WIN_MESSAGE);
(void) put_ext_cmd((char *) extcmdlist[i].ef_txt, 0, cw,
bottom);
return (i);
} else
DisplayBeep(NULL);
}
return (-1);
}
#endif
amii_clear_nhwindow(WIN_MESSAGE); /* Was NHW_MESSAGE */
if (scrollmsg) {
pline("#");
@@ -1046,23 +611,6 @@ amii_yn_function(const char *query, const char *resp, char def)
cursor_on(WIN_MESSAGE);
q = lowc(WindowGetchar());
cursor_off(WIN_MESSAGE);
#if 0
/* fix for PL2 */
if (q == '\020') { /* ctrl-P */
if(!doprev)
(void) tty_doprev_message(); /* need two initially */
(void) tty_doprev_message();
q = (char)0;
doprev = 1;
continue;
} else if (doprev) {
tty_clear_nhwindow(WIN_MESSAGE);
cw->maxcol = cw->maxrow;
doprev = 0;
amii_addtopl(prompt);
continue;
}
#endif /*0*/
digit_ok = allow_num && isdigit(q);
if (q == '\033') {
if (strchr(resp, 'q'))
@@ -1156,17 +704,7 @@ amii_display_file(const char *fn, boolean complain)
if ((fp = dlb_fopen(fn, RDTMODE)) == (dlb *) NULL) {
if (complain) {
sprintf(buf, "Can't display %s: %s", fn,
#if defined(_DCC) || defined(__GNUC__)
strerror(errno)
#else
#ifdef __SASC_60
__sys_errlist[errno]
#else
sys_errlist[errno]
#endif
#endif
);
sprintf(buf, "Can't display %s: %s", fn, strerror(errno));
amii_addtopl(buf);
}
return;
@@ -1205,11 +743,8 @@ SetBorder(struct Gadget *gd)
int borders = 6;
int hipen = sysflags.amii_dripens[SHINEPEN],
shadowpen = sysflags.amii_dripens[SHADOWPEN];
#ifdef INTUI_NEW_LOOK
struct DrawInfo *dip;
#endif
#ifdef INTUI_NEW_LOOK
if (IntuitionBase->LibNode.lib_Version >= 37) {
if ((dip = GetScreenDrawInfo(HackScreen)) != 0) {
hipen = dip->dri_Pens[SHINEPEN];
@@ -1217,7 +752,6 @@ SetBorder(struct Gadget *gd)
FreeScreenDrawInfo(HackScreen, dip);
}
}
#endif
/* Allocate two border structures one for up image and one for down
* image, plus vector arrays for the border lines.
*/
-57
View File
@@ -1,57 +0,0 @@
/* NetHack 3.6 winami.p $NHDT-Date: 1433806595 2015/06/08 23:36:35 $ $NHDT-Branch: master $:$NHDT-Revision: 1.7 $ */
/* Copyright (c) Gregg Wonderly, Naperville, IL, 1992, 1993 */
/* NetHack may be freely redistributed. See license for details. */
/* winami.c */
void amii_raw_print(const char *);
void amii_raw_print_bold(const char *);
void amii_start_menu(winid , unsigned long );
void amii_add_menu(winid, const glyph_info *, const anything *, char, char, int, int, const char *, unsigned int);
void amii_end_menu(winid , char , const char * , const char *);
char amii_select_menu(winid );
void amii_update_inventory(int);
void amii_mark_synch (void);
void amii_wait_synch (void);
void amii_setclipped (void);
void amii_cliparound(int , int );
void amii_askname (void);
void amii_player_selection (void);
void flush_output (void);
void amii_destroy_nhwindow(winid );
int amii_create_nhwindow(int );
void amii_init_nhwindows (void);
int amii_get_ext_cmd(void);
char amii_yn_function(const char * , const char * , char );
void amii_addtopl(const char *);
void TextSpaces(struct RastPort * , int );
void amii_putstr(winid , int , const char *);
void amii_putsym(winid , int , int , CHAR_P );
void amii_clear_nhwindow(winid );
void amii_exit_nhwindows(const char *);
int amii_nh_poskey(coordxy *, coordxy *, int *);
int amii_nhgetch (void);
void amii_get_nh_event (void);
void amii_remember_topl (void);
int amii_doprev_message (void);
void amii_display_nhwindow(winid , boolean );
void amii_display_file(const char * , boolean );
void amii_curs(winid , int , int );
void amii_print_glyph(winid, coordxy, coordxy, const glyph_info *, const glyph_info *);
void DoMenuScroll(int , int );
void DisplayData(int , int , int );
void SetPropInfo(struct Window * , struct Gadget * , long , long , long );
void kill_nhwindows(int );
void amii_cl_end(struct amii_WinDesc * , int );
void cursor_off(winid );
void cursor_on(winid );
void amii_getret (void);
void amii_getlin(const char * , char *);
void getlind(const char * , char * , const char *);
void amii_suspend_nhwindows(char * );
void amii_resume_nhwindows(void);
void amii_bell(void);
void EditColor(void);
void DrawCol( struct Window *, int, UWORD * ) ;
void DispCol( struct Window *w, int idx, UWORD * ) ;
void SetBorder(struct Gadget *) ;
void port_help (void);
void dismiss_nhwindow(winid) ;
+8 -271
View File
@@ -7,35 +7,14 @@
#include <exec/types.h>
#include <libraries/iffparse.h>
#include <graphics/scale.h>
#ifndef _DCC
#include <proto/iffparse.h>
#endif
#ifdef TESTING
#include "hack.h"
#else
#ifndef CROSS_TO_AMIGA
#include "NH:src/tile.c"
#else
#include "../src/tile.c"
#endif
#endif
#ifndef CROSS_TO_AMIGA
#include "NH:win/share/tile.h"
#include "NH:sys/amiga/windefs.h"
#include "NH:sys/amiga/winext.h"
#include "NH:sys/amiga/winproto.h"
#else
#include "tile.h"
#include "windefs.h"
#include "winext.h"
#include "winproto.h"
#endif
#ifdef OPT_DISPMAP
#define DISPMAP /* use display_map() from dispmap.s */
#endif
/* NH:sys/amiga/winvchar.c */
int main(int, char **);
@@ -60,10 +39,6 @@ extern int reclip;
struct BitMap *MyAllocBitMap(int xsize, int ysize, int depth, long mflags);
void MyFreeBitMap(struct BitMap *bmp);
#ifdef DISPMAP
extern void display_map(struct Window *);
#endif
#ifdef TILES_IN_GLYPHMAP
extern int maxmontile, maxobjtile, maxothtile; /* from tile.c */
#define MAXMONTILE maxmontile
@@ -96,85 +71,6 @@ struct PDAT pictdata;
char *tilefile;
struct BitMap *tileimg, *tile;
#ifdef TESTING
short pens[NUMDRIPENS] = { 8, 3, 15, 0, 15, 7, 7, 8, 0 };
main(int argc, char **argv)
{
BitMapHeader bmhd;
struct IntuiMessage *imsg;
long code, class;
char buf[100];
int i, x, y, tbl, done = 0, num;
struct Window *w;
struct Screen *scr;
bmhd = ReadTileImageFiles();
scr = OpenScreenTags(
NULL, SA_Depth, pictdata.nplanes + amii_extraplanes, SA_DisplayID,
DBLNTSC_MONITOR_ID | HIRESLACE_KEY, SA_Overscan, OSCAN_TEXT, SA_Top,
0, SA_Left, 0, SA_Width, STDSCREENWIDTH, SA_Height, STDSCREENHEIGHT,
SA_Type, CUSTOMSCREEN, SA_DetailPen, 0, SA_BlockPen, 1, SA_Title,
"NetHack Chars", SA_Pens, pens, TAG_DONE);
if (scr == NULL) {
printf("no screen\n");
#undef exit
exit(1);
}
w = OpenWindowTags(
0, WA_CustomScreen, scr, WA_Flags,
WFLG_DRAGBAR | WFLG_SIZEGADGET | WFLG_DEPTHGADGET | WFLG_CLOSEGADGET,
WA_IDCMP, IDCMP_CLOSEWINDOW | IDCMP_NEWSIZE | IDCMP_MOUSEBUTTONS,
WA_Left, 0, WA_Top, scr->WBorTop + 1 + 13, WA_MinWidth, 100,
WA_MinHeight, 100, WA_MaxWidth, 700, WA_MaxHeight, 1000, WA_Width,
640, WA_Height, 340, WA_SmartRefresh, TRUE, TAG_DONE);
if (w) {
while (!done) {
for (i = 0; i < NUMTILEIMAGES * IMGPAGESIZE; ++i) {
int dx, dy;
tbl = i / IMGPAGESIZE;
x = i % IMGPAGESIZE;
y = x / IMGCOLUMNS;
x = x % IMGCOLUMNS;
dx = i % (IMGCOLUMNS * 2);
dy = i / (IMGCOLUMNS * 2);
BltBitMapRastPort(tileimg, x * pictdata.xsize,
y * pictdata.ysize, w->RPort,
w->BorderLeft + 1 + dx * pictdata.xsize,
w->BorderTop + 1 + dy * pictdata.ysize,
pictdata.xsize, pictdata.ysize, 0xc0);
}
WaitPort(w->UserPort);
while (imsg = (struct IntuiMessage *) GetMsg(w->UserPort)) {
class = imsg->Class;
code = imsg->Code;
ReplyMsg((struct Message *) imsg);
switch (class) {
case IDCMP_MOUSEBUTTONS: {
x = imsg->MouseX - w->BorderLeft;
y = imsg->MouseY - w->BorderTop;
num = ((y / pictdata.ysize) * IMGCOLUMNS * 2)
+ (x / pictdata.xsize);
sprintf(buf, "Char #%d", num);
SetWindowTitles(w, buf, buf);
} break;
case IDCMP_CLOSEWINDOW:
done = 1;
break;
}
}
}
CloseWindow(w);
CloseScreen(scr);
}
FreeTileImageFiles();
return (0);
}
#endif
/*
* Read a single BMAP IFF file into a BitMap.
* Returns the BitMapHeader; *bmp receives the bitmap.
@@ -329,25 +225,6 @@ MyFreeBitMap(struct BitMap *bmp)
free(bm);
}
#ifdef TESTING
void
panic(char *s, long a1, long a2, long a3, long a4)
{
printf(s, a1, a2, a3, a4);
putchar('\n');
}
long *
alloc(unsigned int x)
{
long *p = (long *) malloc(x);
if (!p) {
panic("malloc failed");
exit(1);
}
return p;
}
#endif
void
FreeTileImageFiles(void)
{
@@ -355,7 +232,6 @@ FreeTileImageFiles(void)
FreeImageFile(&tile);
}
#ifndef TESTING
/*
* Define some stuff for our special glyph drawing routines
*/
@@ -385,7 +261,6 @@ flush_glyph_buffer(struct Window *vw)
void
amiv_flush_glyph_buffer(struct Window *vw)
{
#if !defined(DISPMAP) || defined(OPT_DISPMAP)
int xsize, ysize, x, y;
struct BitScaleArgs bsa;
struct BitScaleArgs bsm;
@@ -395,7 +270,6 @@ amiv_flush_glyph_buffer(struct Window *vw)
int i, k;
int scaling_needed;
struct RastPort *rp = vw->RPort;
#endif
/* If nothing is buffered, return before we do anything */
if (glyph_node_index == 0)
@@ -404,20 +278,8 @@ amiv_flush_glyph_buffer(struct Window *vw)
cursor_off(WIN_MAP);
amiv_start_glyphout(WIN_MAP);
#ifdef OPT_DISPMAP
if (sysflags.fast_map) {
#endif
#ifdef DISPMAP
display_map(vw);
#endif
#ifdef OPT_DISPMAP
} else {
#endif
#if !defined(DISPMAP) || defined(OPT_DISPMAP)
/* XXX fix indent */
/* This is a dynamic value based on this relationship. */
scaling_needed =
(pictdata.xsize != mxsize || pictdata.ysize != mysize);
/* This is a dynamic value based on this relationship. */
scaling_needed = (pictdata.xsize != mxsize || pictdata.ysize != mysize);
/* If overview window is up, set up to render the correct scale there
*/
@@ -546,10 +408,6 @@ amiv_flush_glyph_buffer(struct Window *vw)
MyFreeBitMap(imgbm);
if (bm)
MyFreeBitMap(bm);
#endif /* DISPMAP */
#ifdef OPT_DISPMAP
}
#endif
amii_end_glyphout(WIN_MAP);
@@ -563,7 +421,7 @@ amiv_flush_glyph_buffer(struct Window *vw)
void
amiv_lprint_glyph(winid window, int color_index, int glyph)
{
int base;
int base = 0;
struct amii_WinDesc *cw;
struct Window *w;
int curx;
@@ -625,27 +483,8 @@ amiv_lprint_glyph(winid window, int color_index, int glyph)
amiv_g_nodes[glyph_node_index].dsty =
min(w->BorderTop + (cury * mysize), w->Height - 1);
#ifdef OPT_DISPMAP
if (sysflags.fast_map) {
#endif /* keni */
#ifdef DISPMAP
/* display_map() needs byte-aligned destinations, and we don't
* want to
* overwrite the window border.
*/
amiv_g_nodes[glyph_node_index].dstx =
(w->BorderLeft + 8 + (curx * mxsize)) & -8;
#endif
#ifdef OPT_DISPMAP
} else {
#endif
#if !defined(DISPMAP) || defined(OPT_DISPMAP)
amiv_g_nodes[glyph_node_index].dstx =
min(w->BorderLeft + (curx * mxsize), w->Width - 1);
#endif
#ifdef OPT_DISPMAP
}
#endif
amiv_g_nodes[glyph_node_index].dstx =
min(w->BorderLeft + (curx * mxsize), w->Width - 1);
amiv_g_nodes[glyph_node_index].odsty = cw->cury;
amiv_g_nodes[glyph_node_index].odstx = cw->curx;
amiv_g_nodes[glyph_node_index].srcx = xoff;
@@ -657,17 +496,6 @@ amiv_lprint_glyph(winid window, int color_index, int glyph)
int j, k, x, y, apen;
struct RastPort *rp = w->RPort;
x = rp->cp_x - pictdata.xsize - 3;
#ifdef OPT_DISPMAP
if (sysflags.fast_map) {
#endif
#ifdef DISPMAP
x &= -8;
if (x == 0)
x = 8;
#endif
#ifdef OPT_DISPMAP
}
#endif
y = rp->cp_y - pictdata.ysize + 1;
@@ -805,21 +633,12 @@ GlyphToIcon(int glyph)
glyph_info gi;
map_glyphinfo(0, 0, glyph, 0, &gi);
if (glyph > 10000)
if (glyph >= 10000)
return glyph;
return (gi.gm.tileidx);
}
#endif
#ifdef AMII_GRAPHICS
#ifdef TESTING
/*
* Define some stuff for our special glyph drawing routines
*/
static unsigned short glyph_node_index, glyph_buffer_index;
#define NUMBER_GLYPH_NODES 80
#define GLYPH_BUFFER_SIZE 512
#endif /* TESTING */
struct amii_glyph_node {
short x;
@@ -846,27 +665,6 @@ int foreg[AMII_MAXCOLORS] = {
int backg[AMII_MAXCOLORS] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 4, 1, 6, 5, 3, 0
};
#if 0
#define CLR_BLACK 0
#define CLR_RED 1
#define CLR_GREEN 2
#define CLR_BROWN 3 /* on IBM, low-intensity yellow is brown */
#define CLR_BLUE 4
#define CLR_MAGENTA 5
#define CLR_CYAN 6
#define CLR_GRAY 7 /* low-intensity white */
#define NO_COLOR 8
#define CLR_ORANGE 9
#define CLR_BRIGHT_GREEN 10
#define CLR_YELLOW 11
#define CLR_BRIGHT_BLUE 12
#define CLR_BRIGHT_MAGENTA 13
#define CLR_BRIGHT_CYAN 14
#define CLR_WHITE 15
#define CLR_MAX 16
#endif
#ifndef TESTING
/*
* Begin Revamped Text display routines
*
@@ -1004,18 +802,14 @@ amii_lprint_glyph(winid window, int color_index, int glyph)
++glyph_node_index;
}
}
#endif /* !TESTING */
#ifdef TESTING
/*
* Define some variables which will be used to save context when toggling
* back and forth between low level text and console I/O.
* Variables used to save context when toggling between low level text
* and console I/O.
*/
static long xsave, ysave, modesave, apensave, bpensave;
static int usecolor;
#endif /* TESTING */
#ifndef TESTING
/*
* The function is called before any glyphs are driven to the screen. It
* removes the cursor, saves internal state of the window, then returns.
@@ -1052,62 +846,5 @@ amii_start_glyphout(winid window)
iflags.use_color = FALSE;
cw->wflags |= FLMAP_INGLYPH;
}
#endif /* !TESTING */
#if 0
/*
* General cleanup routine -- flushes and restores cursor
*/
void
amii_end_glyphout(window)
winid window;
{
struct amii_WinDesc *cw;
struct Window *w;
if( ( cw = amii_wins[ window ] ) == (struct amii_WinDesc *)NULL )
panic("bad window id %d in amii_end_glyphout()", window );
if( ( cw->wflags & FLMAP_INGLYPH ) == 0 )
return;
cw->wflags &= ~(FLMAP_INGLYPH);
if( !(w = cw->win ) )
panic( "bad winid %d, no window ptr set", window );
/*
* Clean up whatever is left in the buffer
*/
iflags.use_color = usecolor;
/*
* Reset internal data structs
*/
SetAPen(w->RPort, apensave);
SetBPen(w->RPort, bpensave);
SetDrMd(w->RPort, modesave);
Move(w->RPort, xsave, ysave);
}
#endif
#endif
#ifndef TESTING
#ifdef OPT_DISPMAP
/* don't use dispmap unless x & y are 8,16,24,32,48 and equal */
void
dispmap_sanity(void)
{
if (mxsize != mysize || dispmap_sanity1(mxsize)
|| dispmap_sanity1(mysize)) {
sysflags.fast_map = 0;
}
}
int
dispmap_sanity1(int x)
{
static unsigned char valid[] = { 8, 16, 24, 32, 48, 0 };
return !strchr((char *)valid, x);
}
#endif /* OPT_DISPMAP */
#endif /* TESTING */
+3 -63
View File
@@ -5,9 +5,6 @@
#include <exec/types.h>
#include <exec/memory.h>
#include <exec/io.h>
#if !defined(_DCC) && !defined(__GNUC__)
#include <dos.h>
#endif
#include <exec/alerts.h>
#include <exec/devices.h>
#include <exec/execbase.h>
@@ -19,31 +16,10 @@
#include <libraries/gadtools.h>
#include <libraries/dosextens.h>
#include <libraries/asl.h>
/* stddef.h is included in the precompiled version of hack.h . If we include
* it here normally (through string.h) we'll get an "illegal typedef" later
* on. This is the easiest way I can think of to fix it without messing
* around with the rest of the #includes. --AMC
*/
#if defined(_DCC) && !defined(HACK_H)
#define ptrdiff_t ptrdiff_t_
#define size_t size_t_
#define wchar_t wchar_t_
#endif
#include <ctype.h>
#undef strcmpi
#include <string.h>
#include <errno.h>
#if defined(_DCC) && !defined(HACK_H)
#undef ptrdiff_t
#undef size_t
#undef wchar_T
#endif
#ifdef IDCMP_CLOSEWINDOW
#ifndef INTUI_NEW_LOOK
#define INTUI_NEW_LOOK
#endif
#endif
#ifndef HACK_H
#include "hack.h"
@@ -62,17 +38,6 @@ CLIPPING must be defined for the AMIGA version
/*#define TOPL_GETLINE /* Don't use a window for getlin() */
/*#define WINDOW_YN /* Use a window for y/n questions */
#ifdef AZTEC_C
#include <functions.h>
#else
#ifdef _DCC
#include <clib/dos_protos.h>
#include <clib/exec_protos.h>
#include <clib/console_protos.h>
#include <clib/layers_protos.h>
#include <clib/diskfont_protos.h>
#include <clib/gadtools_protos.h>
#else
#include <proto/dos.h>
#include <proto/exec.h>
#include <proto/console.h>
@@ -80,40 +45,18 @@ CLIPPING must be defined for the AMIGA version
#include <proto/diskfont.h>
#include <proto/gadtools.h>
#include <proto/asl.h>
#endif
/* kludge - see amirip for why */
#undef red
#undef green
#undef blue
#ifdef _DCC
#include <clib/graphics_protos.h>
#else
#include <proto/graphics.h>
#endif
#ifdef _DCC
#define __asm /* DICE doesn't like __asm */
#endif
#ifdef _DCC
#include <clib/intuition_protos.h>
#else
#include <proto/intuition.h>
#endif
#endif
#ifdef SHAREDLIB
#include "NH:sys/amiga/lib/libmacs.h"
#endif
#ifdef INTUI_NEW_LOOK
#include <utility/tagitem.h>
#endif
#define WINVERS_AMII (strcmp("amii", windowprocs.name) == 0)
#define WINVERS_AMIV (strcmp("amiv", windowprocs.name) == 0)
#define WINVERS_AMIT (strcmp("amitty", windowprocs.name) == 0)
#define WINVERS_AMII WINDOWPORT(amii)
#define WINVERS_AMIV WINDOWPORT(amiv)
/* cw->data[x] contains 2 characters worth of special information. These
* characters are stored at the offsets as described here.
@@ -153,13 +96,10 @@ CLIPPING must be defined for the AMIGA version
#define MAPFTHEIGHT 8
#define MAPFTBASELN 6
/* If Compiling with the "New Look", redefine these now */
#ifdef INTUI_NEW_LOOK
/* Use the OS 2.0+ "new look" Intuition structs unconditionally. */
#define NewWindow ExtNewWindow
#define NewScreen ExtNewScreen
#endif
#define SIZEOF_DISKNAME 8
#define CSI '\x9b'
#define NO_CHAR -1
-30
View File
@@ -18,7 +18,6 @@ extern int LI;
extern int scrollmsg;
extern int alwaysinvent;
#ifndef SHAREDLIB
extern unsigned short amii_defpens[20];
extern struct amii_DisplayDesc
*amiIDisplay; /* the Amiga Intuition descriptor */
@@ -33,21 +32,6 @@ extern long amii_scrnmode;
extern winid amii_rawprwin;
extern struct Screen *HackScreen;
extern char Initialized;
/* These have already been defined elsewhere (and some are conflicting)
* ... going ... going once ... going twice ....
* extern const char *roles[];
* extern struct Library *ConsoleDevice;
* extern char toplines[ TBUFSZ ];
* extern NEARDATA winid WIN_MESSAGE;
* extern NEARDATA winid WIN_MAP;
* extern NEARDATA winid WIN_STATUS;
* extern NEARDATA winid WIN_INVEN;
* extern winid WIN_OVER;
* extern struct GfxBase *GfxBase;
* extern struct Library *DiskfontBase;
* extern struct IntuitionBase *IntuitionBase;
* extern struct Library *LayersBase;
*/
extern int amii_msgAPen;
extern int amii_msgBPen;
extern int amii_statAPen;
@@ -58,9 +42,6 @@ extern int amii_textAPen;
extern int amii_textBPen;
extern int amii_otherAPen;
extern int amii_otherBPen;
#else
extern WinamiBASE *WinamiBase;
#endif
/* All kinds of shared stuff */
extern struct TextAttr Hack160;
extern struct TextAttr Hack40;
@@ -78,9 +59,6 @@ extern struct IOStdReq ConsoleIO;
extern struct MsgPort *HackPort;
extern int txwidth, txheight, txbaseline;
#ifdef SUPERBITMAP_MAP
extern struct BitMap amii_vbm;
#endif
/* This gadget data is replicated for menu/text windows... */
extern struct PropInfo PropScroll;
@@ -132,17 +110,9 @@ typedef enum {
extern struct PDAT pictdata;
extern struct Hook fillhook;
extern struct TagItem wintags[];
#ifndef SHAREDLIB
#ifndef __GNUC__
void __asm LayerFillHook(register __a0 struct Hook *hk,
register __a2 struct RastPort *rp,
register __a1 struct FillParams *fp);
#else
#ifdef __PPC__
struct EmulLibEntry LayerFillHook;
#else
void LayerFillHook(void);
#endif
#endif
#endif
extern int mxsize, mysize;
+32 -104
View File
@@ -3,28 +3,18 @@
*/
/* NetHack may be freely redistributed. See license for details. */
#ifndef CROSS_TO_AMIGA
#include "NH:sys/amiga/windefs.h"
#include "NH:sys/amiga/winext.h"
#include "NH:sys/amiga/winproto.h"
#else
#include "windefs.h"
#include "winext.h"
#include "winproto.h"
#endif
#include "patchlevel.h"
extern struct TagItem scrntags[];
#ifndef CROSS_TO_AMIGA
extern struct Library *ConsoleDevice;
#else
extern struct Device *
# ifdef __CONSTLIBBASEDECL__
__CONSTLIBBASEDECL__
# endif /* __CONSTLIBBASEDECL__ */
ConsoleDevice;
#endif
static BitMapHeader amii_bmhd;
static void cursor_common(struct RastPort *, int, int);
@@ -136,14 +126,10 @@ ami_wininit_data(int dir)
memcpy(amii_initmap, amiv_init_map, sizeof(amii_initmap));
}
#ifdef OPT_DISPMAP
dispmap_sanity();
#endif
memcpy(sysflags.amii_dripens, amii_defpens,
sizeof(sysflags.amii_dripens));
}
#ifdef INTUI_NEW_LOOK
struct Hook SM_FilterHook;
struct Hook fillhook;
struct TagItem wintags[] = {
@@ -151,7 +137,6 @@ struct TagItem wintags[] = {
{ WA_PubScreenName, (ULONG) "NetHack" },
{ TAG_END, 0 },
};
#endif
void
amii_destroy_nhwindow(winid win) /* just hide */
@@ -244,7 +229,6 @@ amii_destroy_nhwindow(winid win) /* just hide */
WIN_INVEN = WIN_ERR;
}
#ifdef INTUI_NEW_LOOK
struct FillParams {
struct Layer *layer;
struct Rectangle bounds;
@@ -252,7 +236,6 @@ struct FillParams {
WORD offsety;
};
#ifdef __GNUC__
#ifdef __PPC__
void PPC_LayerFillHook(void);
struct EmulLibEntry LayerFillHook = { TRAP_LIB, 0,
@@ -281,16 +264,6 @@ void
LayerFillHook_impl(struct Hook *hk, struct RastPort *rp,
struct FillParams *fp)
{
#endif
#else
void
#ifndef _DCC
__interrupt
#endif
__saveds __asm LayerFillHook(__a0 struct Hook *hk,
__a2 struct RastPort *rp,
__a1 struct FillParams *fp)
{
#endif
long x, y, xmax, ymax;
@@ -334,7 +307,6 @@ void
SetDrMd(&rptmp, JAM2);
RectFill(&rptmp, x, y, xmax, ymax);
}
#endif
winid
amii_create_nhwindow(int type)
@@ -519,12 +491,10 @@ amii_create_nhwindow(int type)
if (nw->Height + stath + maph < HackScreen->Height - nw->TopEdge)
nw->Height = HackScreen->Height - nw->TopEdge - 1 - maph - stath;
#ifdef INTUI_NEW_LOOK
if (IntuitionBase->LibNode.lib_Version >= 37) {
MsgPropScroll.Flags |= PROPNEWLOOK;
PropScroll.Flags |= PROPNEWLOOK;
}
#endif
}
nw->IDCMPFlags |= MENUPICK;
@@ -568,29 +538,26 @@ amii_create_nhwindow(int type)
wd = (struct amii_WinDesc *) alloc(sizeof(struct amii_WinDesc));
memset(wd, 0, sizeof(struct amii_WinDesc));
/* Both, since user may have changed the pen settings so respect those */
if (WINVERS_AMII || WINVERS_AMIV) {
/* Special backfill for these types of layers */
switch (type) {
case NHW_MESSAGE:
case NHW_STATUS:
case NHW_TEXT:
case NHW_MENU:
case NHW_BASE:
case NHW_OVER:
case NHW_MAP:
if (wd) {
fillhook.h_Entry = (void *) &LayerFillHook;
fillhook.h_Data = (void *) type;
fillhook.h_SubEntry = 0;
wd->hook = alloc(sizeof(fillhook));
memcpy(wd->hook, &fillhook, sizeof(fillhook));
memcpy(wd->wintags, wintags, sizeof(wd->wintags));
wd->wintags[0].ti_Data = (long) wd->hook;
nw->Extension = (void *) wd->wintags;
}
break;
/* Special backfill for these types of layers */
switch (type) {
case NHW_MESSAGE:
case NHW_STATUS:
case NHW_TEXT:
case NHW_MENU:
case NHW_BASE:
case NHW_OVER:
case NHW_MAP:
if (wd) {
fillhook.h_Entry = (void *) &LayerFillHook;
fillhook.h_Data = (void *) type;
fillhook.h_SubEntry = 0;
wd->hook = alloc(sizeof(fillhook));
memcpy(wd->hook, &fillhook, sizeof(fillhook));
memcpy(wd->wintags, wintags, sizeof(wd->wintags));
wd->wintags[0].ti_Data = (long) wd->hook;
nw->Extension = (void *) wd->wintags;
}
break;
}
/* Don't open MENU or TEXT windows yet */
@@ -828,7 +795,6 @@ amii_create_nhwindow(int type)
return (newid);
}
#ifdef __GNUC__
#ifdef __PPC__
int PPC_SM_Filter(void);
struct EmulLibEntry SM_Filter = { TRAP_LIB, 0,
@@ -857,16 +823,6 @@ int
SM_Filter_impl(struct Hook *hk, ULONG modeID,
struct ScreenModeRequester *smr)
{
#endif
#else
int
#ifndef _DCC
__interrupt
#endif
__saveds __asm SM_Filter(
__a0 struct Hook *hk, __a1 ULONG modeID,
__a2 struct ScreenModeRequester *smr)
{
#endif
struct DimensionInfo dims;
struct DisplayInfo disp;
@@ -1002,7 +958,6 @@ amii_init_nhwindows(int *argcp, char **argv)
/* Use Intuition sizes for overscan screens... */
amiIDisplay->xpix = 0;
#ifdef INTUI_NEW_LOOK
if (IntuitionBase->LibNode.lib_Version >= 37) {
if (wbscr = LockPubScreen("Workbench")) {
amiIDisplay->xpix = wbscr->Width;
@@ -1010,7 +965,6 @@ amii_init_nhwindows(int *argcp, char **argv)
UnlockPubScreen(NULL, wbscr);
}
}
#endif
if (amiIDisplay->xpix == 0) {
amiIDisplay->ypix = GfxBase->NormalDisplayRows;
amiIDisplay->xpix = GfxBase->NormalDisplayColumns;
@@ -1055,9 +1009,11 @@ amii_init_nhwindows(int *argcp, char **argv)
*/
if (DiskfontBase = OpenLibrary("diskfont.library", amii_libvers)) {
Hack80.ta_Name -= SIZEOF_DISKNAME;
extern UBYTE HackFontName[], HackFontPath[];
Hack80.ta_Name = HackFontPath;
HackFont = OpenDiskFont(&Hack80);
Hack80.ta_Name += SIZEOF_DISKNAME;
Hack80.ta_Name = HackFontName;
/* Textsfont13 is filled in with "FONT=" settings. The default is
* courier/13.
@@ -1068,9 +1024,9 @@ amii_init_nhwindows(int *argcp, char **argv)
/* Try hack/8 for texts if no user specified font */
if (TextsFont == NULL) {
Hack80.ta_Name -= SIZEOF_DISKNAME;
Hack80.ta_Name = HackFontPath;
TextsFont = OpenDiskFont(&Hack80);
Hack80.ta_Name += SIZEOF_DISKNAME;
Hack80.ta_Name = HackFontName;
}
/* If no fonts, make everything topaz 8 for non-view windows.
@@ -1136,11 +1092,6 @@ amii_init_nhwindows(int *argcp, char **argv)
PATCHLEVEL);
NewHackScreen.DefaultTitle = fname;
}
#if 0
NewHackScreen.BlockPen = C_BLACK;
NewHackScreen.DetailPen = C_WHITE;
#endif
#ifdef INTUI_NEW_LOOK
if (IntuitionBase->LibNode.lib_Version >= 37) {
int i;
struct DimensionInfo dims;
@@ -1159,11 +1110,7 @@ amii_init_nhwindows(int *argcp, char **argv)
if (amii_scrnmode == 0xffffffff) {
struct ScreenModeRequester *SMR;
#ifdef __GNUC__
SM_FilterHook.h_Entry = (void *) &SM_Filter;
#else
SM_FilterHook.h_Entry = (ULONG (*) ()) SM_Filter;
#endif
SM_FilterHook.h_Data = 0;
SM_FilterHook.h_SubEntry = 0;
SMR = AllocAslRequest(ASL_ScreenModeRequest, NULL);
@@ -1253,15 +1200,14 @@ amii_init_nhwindows(int *argcp, char **argv)
}
}
}
#endif
if (WINVERS_AMIV) {
extern char *tilefile;
if (amii_numcolors >= 32) {
tilefile = "NetHack:tiles/tiles32.iff";
tilefile = (char *) fqname("tiles/tiles32.iff", DATAPREFIX, 0);
amii_numcolors = 32;
} else {
tilefile = "NetHack:tiles/tiles16.iff";
tilefile = (char *) fqname("tiles/tiles16.iff", DATAPREFIX, 0);
}
amii_bmhd = ReadTileImageFiles();
} else
@@ -1300,10 +1246,8 @@ amii_init_nhwindows(int *argcp, char **argv)
else
bigscreen = 0;
#ifdef INTUI_NEW_LOOK
if (IntuitionBase->LibNode.lib_Version >= 37)
PubScreenStatus(HackScreen, 0);
#endif
amiIDisplay->ypix = HackScreen->Height;
amiIDisplay->xpix = HackScreen->Width;
@@ -1354,6 +1298,7 @@ amii_sethipens(struct Window *w, int type, int attr)
case NHW_TEXT:
SetAPen(w->RPort, attr ? C_BLACK : amii_textAPen);
SetBPen(w->RPort, amii_textBPen);
break;
case -2:
SetBPen(w->RPort, amii_otherBPen);
SetAPen(w->RPort, attr ? C_RED : amii_otherAPen);
@@ -1445,7 +1390,7 @@ amii_clear_nhwindow(winid win)
/* Clear the overview window too if it is displayed */
if (WINVERS_AMIV
&& (cw->type == WIN_MAP && WIN_OVER != WIN_ERR && reclip == 0)) {
&& (cw->type == NHW_MAP && WIN_OVER != WIN_ERR && reclip == 0)) {
amii_clear_nhwindow(WIN_OVER);
}
@@ -1724,11 +1669,6 @@ amii_curs(winid window, int x, int y)
if (WINVERS_AMIV) {
if (cw->type == NHW_MAP) {
if (Is_rogue_level(&u.uz)) {
#if 0
int qqx= (x * w->RPort->TxWidth) + w->BorderLeft;
int qqy= w->BorderTop + ( (y+1) * w->RPort->TxHeight ) + 1;
printf("pos: (%d,%d)->(%d,%d)\n",x,y,qqx,qqy);
#endif
SetAPen(w->RPort,
C_WHITE); /* XXX should be elsewhere (was 4)*/
Move(rp, (x * w->RPort->TxWidth) + w->BorderLeft,
@@ -1932,12 +1872,7 @@ cursor_on(winid window)
/* Save the current information */
#ifdef DISPMAP
if (WINVERS_AMIV && cw->type == NHW_MAP && !Is_rogue_level(&u.uz))
x = cw->cursx = (rp->cp_x & -8) + 8;
else
#endif
x = cw->cursx = rp->cp_x;
x = cw->cursx = rp->cp_x;
y = cw->cursy = rp->cp_y;
apen = rp->FgPen;
bpen = rp->BgPen;
@@ -2031,6 +1966,8 @@ removetopl(int cnt)
void
port_help(void)
{
/* display_file -> dlb_fopen -> fopen_datafile already routes through
DATAPREFIX; pass the bare filename. */
display_file(PORT_HELP, 1);
}
#endif
@@ -2075,15 +2012,6 @@ amii_print_glyph(winid win, coordxy x, coordxy y,
panic(winpanicstr, win, "amii_print_glyph");
}
#if 0
{
static int x=-1;
if(u.uz.dlevel != x){
fprintf(stderr,"lvlchg: %d (%d)\n",u.uz.dlevel,Is_rogue_level(&u.uz));
x = u.uz.dlevel;
}
}
#endif
if (WINVERS_AMIV && !Is_rogue_level(&u.uz)) {
amii_curs(win, x, y);
amiga_print_glyph(win, 0, glyph);
-6
View File
@@ -2,15 +2,9 @@
/* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1991,1992,1993. */
/* NetHack may be freely redistributed. See license for details. */
#ifndef CROSS_TO_AMIGA
#include "NH:sys/amiga/windefs.h"
#include "NH:sys/amiga/winext.h"
#include "NH:sys/amiga/winproto.h"
#else
#include "windefs.h"
#include "winext.h"
#include "winproto.h"
#endif
int
amii_nh_poskey(coordxy *x, coordxy *y, int *mod)
+1 -20
View File
@@ -53,14 +53,13 @@ void SetPropInfo(struct Window *win, struct Gadget *gad, long vis, long total,
struct Window *OpenShWindow(struct NewWindow *nw);
void CloseShWindow(struct Window *win);
int ConvertKey(struct IntuiMessage *message);
void ProcessMessage(struct IntuiMessage *message);
int kbhit(void);
int amikbhit(void);
int WindowGetchar(void);
WETYPE WindowGetevent(void);
void amii_cleanup(void);
#ifndef SHAREDLIB
void Abort(long rc);
#endif
void CleanUp(void);
void flush_glyph_buffer(struct Window *w);
void amiga_print_glyph(winid window, int color_index, int glyph);
@@ -71,10 +70,8 @@ void FreeNewWindow(struct NewWindow *win);
void bell(void);
void amii_delay_output(void);
void amii_number_pad(int state);
#ifndef SHAREDLIB
void amiv_loadlib(void);
void amii_loadlib(void);
#endif
void preserve_icon(void);
void clear_icon(void);
@@ -114,10 +111,6 @@ BitMapHeader ReadTileImageFiles(void);
void FreeTileImageFiles(void);
/* winami.c */
#ifdef SHAREDLIB
int __UserLibInit(void);
void __UserLibCleanup(void);
#endif
void amii_askname(void);
void amii_player_selection(void);
void RandomWindow(char *name);
@@ -127,15 +120,7 @@ void amii_display_file(const char *fn, boolean complain);
void SetBorder(struct Gadget *gd);
/* malloc/free provided by stdlib.h */
#ifdef SHAREDLIB
/* amilib.c */
void amii_loadlib(void);
void amiv_loadlib(void);
void CleanUp(void);
void setup_librefs(WinamiBASE *base);
#else
void Abort(long rc);
#endif
win_request_info *amii_ctrl_nhwindow(winid, int, win_request_info *);
@@ -145,7 +130,3 @@ void amii_outrip(winid tmpwin, int how, time_t when);
/* winchar.c */
void SetMazeType(MazeType);
int GlyphToIcon(int glyph);
#ifdef OPT_DISPMAP
void dispmap_sanity(void);
int dispmap_sanity1(int);
#endif
+19 -68
View File
@@ -2,15 +2,9 @@
/* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1991,1992,1993. */
/* NetHack may be freely redistributed. See license for details. */
#ifndef CROSS_TO_AMIGA
#include "NH:sys/amiga/windefs.h"
#include "NH:sys/amiga/winext.h"
#include "NH:sys/amiga/winproto.h"
#else
#include "windefs.h"
#include "winext.h"
#include "winproto.h"
#endif
#define GADBLUEPEN 2
#define GADREDPEN 3
@@ -45,11 +39,7 @@ struct NewWindow StrWindow = {
&String, NULL, NULL, NULL, NULL, 5, 5, 0xffff, 0xffff, CUSTOMSCREEN
};
#ifndef CROSS_TO_AMIGA
#include "NH:sys/amiga/colorwin.c"
#else
#include "colorwin.c"
#endif
#define XSIZE 2
#define YSIZE 3
@@ -58,11 +48,7 @@ struct NewWindow StrWindow = {
#define GADOKAY 6
#define GADCANCEL 7
#ifndef CROSS_TO_AMIGA
#include "NH:sys/amiga/clipwin.c"
#else
#include "clipwin.c"
#endif
void ClearCol(struct Window *w);
@@ -117,22 +103,16 @@ EditColor(void)
svcolors[i] = colors[i] = GetRGB4(scrn->ViewPort.ColorMap, i);
Col_NewWindowStructure1.Screen = scrn;
#ifdef INTUI_NEW_LOOK
if (IntuitionBase->LibNode.lib_Version >= 37) {
((struct PropInfo *) Col_BluePen.SpecialInfo)->Flags |= PROPNEWLOOK;
((struct PropInfo *) Col_RedPen.SpecialInfo)->Flags |= PROPNEWLOOK;
((struct PropInfo *) Col_GreenPen.SpecialInfo)->Flags |= PROPNEWLOOK;
}
#endif
if (WINVERS_AMIV || WINVERS_AMII) {
#ifdef INTUI_NEW_LOOK
Col_NewWindowStructure1.Extension = wintags;
Col_NewWindowStructure1.Flags |= WFLG_NW_EXTENDED;
fillhook.h_Entry = (void *) &LayerFillHook;
fillhook.h_Data = (void *) -2;
fillhook.h_SubEntry = 0;
#endif
}
Col_NewWindowStructure1.Extension = wintags;
Col_NewWindowStructure1.Flags |= WFLG_NW_EXTENDED;
fillhook.h_Entry = (void *) &LayerFillHook;
fillhook.h_Data = (void *) -2;
fillhook.h_SubEntry = 0;
nw = OpenWindow((void *) &Col_NewWindowStructure1);
@@ -372,23 +352,17 @@ EditClipping(void)
once = 1;
}
ClipNewWindowStructure1.Screen = scrn;
#ifdef INTUI_NEW_LOOK
if (IntuitionBase->LibNode.lib_Version >= 37) {
((struct PropInfo *) ClipXSIZE.SpecialInfo)->Flags |= PROPNEWLOOK;
((struct PropInfo *) ClipYSIZE.SpecialInfo)->Flags |= PROPNEWLOOK;
((struct PropInfo *) ClipXCLIP.SpecialInfo)->Flags |= PROPNEWLOOK;
((struct PropInfo *) ClipYCLIP.SpecialInfo)->Flags |= PROPNEWLOOK;
}
#endif
if (WINVERS_AMIV || WINVERS_AMII) {
#ifdef INTUI_NEW_LOOK
ClipNewWindowStructure1.Extension = wintags;
ClipNewWindowStructure1.Flags |= WFLG_NW_EXTENDED;
fillhook.h_Entry = (void *) &LayerFillHook;
fillhook.h_Data = (void *) -2;
fillhook.h_SubEntry = 0;
#endif
}
ClipNewWindowStructure1.Extension = wintags;
ClipNewWindowStructure1.Flags |= WFLG_NW_EXTENDED;
fillhook.h_Entry = (void *) &LayerFillHook;
fillhook.h_Data = (void *) -2;
fillhook.h_SubEntry = 0;
nw = OpenWindow((void *) &ClipNewWindowStructure1);
@@ -399,11 +373,9 @@ EditClipping(void)
ShowClipValues(nw);
mflags = AUTOKNOB | FREEHORIZ;
#ifdef INTUI_NEW_LOOK
if (IntuitionBase->LibNode.lib_Version >= 37) {
mflags |= PROPNEWLOOK;
}
#endif
for (i = 0; i < 7; ++i) {
if (mxsize <= sizes[i])
@@ -470,9 +442,6 @@ EditClipping(void)
yclipbord = aidx + 2;
}
ShowClipValues(nw);
#ifdef OPT_DISPMAP
dispmap_sanity();
#endif
} else if (gd->GadgetID == GADOKAY) {
done = 1;
okay = 1;
@@ -518,9 +487,6 @@ EditClipping(void)
SetBPen(nw->RPort, amii_otherBPen);
SetDrMd(nw->RPort, JAM2);
Text(nw->RPort, buf, strlen(buf));
#ifdef OPT_DISPMAP
dispmap_sanity();
#endif
break;
}
}
@@ -582,12 +548,9 @@ filecopy(char *from, char *to)
if (buf) {
sprintf(buf, "c:copy \"%s\" \"%s\" clone", from, to);
/* Check SysBase instead? Shouldn't matter */
#ifdef INTUI_NEW_LOOK
if (IntuitionBase->LibNode.lib_Version >= 37)
i = System(buf, NULL);
else
#endif
Execute(buf, NULL, NULL);
free(buf);
} else {
@@ -716,11 +679,9 @@ DrawCol(struct Window *w, int idx, UWORD *colors)
b = colors[idx] & 0x00f;
mflags = AUTOKNOB | FREEHORIZ;
#ifdef INTUI_NEW_LOOK
if (IntuitionBase->LibNode.lib_Version >= 37) {
mflags |= PROPNEWLOOK;
}
#endif
NewModifyProp(&Col_RedPen, w, NULL, mflags, (r * MAXPOT) / 15, 0,
MAXPOT / 15, 0, 1);
NewModifyProp(&Col_GreenPen, w, NULL, mflags, (g * MAXPOT) / 15, 0,
@@ -759,7 +720,6 @@ DispCol(struct Window *w, int idx, UWORD *colors)
void
amii_setpens(int count)
{
#ifdef INTUI_NEW_LOOK
struct EasyStruct ea = { sizeof(struct EasyStruct), 0l, "NetHack Request",
"Number of pens requested(%ld) not correct",
"Use default pens|Use requested pens" };
@@ -768,12 +728,9 @@ amii_setpens(int count)
"Number of pens requested(%ld) not\ncompatible "
"with game configuration(%ld)",
"Use default pens|Use requested pens" };
#endif
/* If the pens in amii_curmap are
* more pens than in amii_numcolors, then we choose to ignore
* those pens.
*/
#ifdef INTUI_NEW_LOOK
/* If the pens in amii_curmap are more than in amii_numcolors, ignore
* the extras. */
if (IntuitionBase && IntuitionBase->LibNode.lib_Version >= 39) {
if (count != amii_numcolors) {
long args[2];
@@ -791,9 +748,7 @@ amii_setpens(int count)
amii_numcolors * sizeof(amii_initmap[0]));
}
}
} else
#endif
if (count != amii_numcolors) {
} else if (count != amii_numcolors) {
memcpy(sysflags.amii_curmap, amii_initmap,
amii_numcolors * sizeof(amii_initmap[0]));
}
@@ -848,15 +803,11 @@ getlind(const char *prompt, char *bufp, const char *dflt)
once = 1;
}
if (WINVERS_AMIV || WINVERS_AMII) {
#ifdef INTUI_NEW_LOOK
StrWindow.Extension = wintags;
StrWindow.Flags |= WFLG_NW_EXTENDED;
fillhook.h_Entry = (void *) &LayerFillHook;
fillhook.h_Data = (void *) -2;
fillhook.h_SubEntry = 0;
#endif
}
StrWindow.Extension = wintags;
StrWindow.Flags |= WFLG_NW_EXTENDED;
fillhook.h_Entry = (void *) &LayerFillHook;
fillhook.h_Data = (void *) -2;
fillhook.h_SubEntry = 0;
if ((cwin = OpenWindow((void *) &StrWindow)) == NULL) {
return;
-12
View File
@@ -2,15 +2,9 @@
/* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1991,1992,1993. */
/* NetHack may be freely redistributed. See license for details. */
#ifndef CROSS_TO_AMIGA
#include "NH:sys/amiga/windefs.h"
#include "NH:sys/amiga/winext.h"
#include "NH:sys/amiga/winproto.h"
#else
#include "windefs.h"
#include "winext.h"
#include "winproto.h"
#endif
/* Put a string into the indicated window using the indicated attribute */
void
@@ -144,12 +138,6 @@ amii_putstr(winid window, int attr, const char *str)
p++;
str = p;
#if 0
if( str != ostr ) {
outsubstr( cw, "+", 1, fudge );
cw->curx+=2;
}
#endif
if (*str)
amii_scrollmsg(w, cw);
amii_cl_end(cw, cw->curx);
+1 -2
View File
@@ -232,10 +232,8 @@ endif # CROSS_TO_MIPS
ifdef CROSS_TO_AMIGA
$(TARGETPFX)amidos.o : ../sys/amiga/amidos.c $(HACK_H)
$(TARGETPFX)amigst.o : ../sys/amiga/amigst.c $(HACK_H)
$(TARGETPFX)amirip.o : ../sys/amiga/amirip.c $(HACK_H)
$(TARGETPFX)amistack.o : ../sys/amiga/amistack.c $(HACK_H)
$(TARGETPFX)amitty.o : ../sys/amiga/amitty.c $(HACK_H)
$(TARGETPFX)amiwind.o : ../sys/amiga/amiwind.c \
../sys/amiga/amimenu.c $(HACK_H)
$(TARGETPFX)winami.o : ../sys/amiga/winami.c $(HACK_H)
@@ -323,6 +321,7 @@ amigapkg: $(AMITILES) ../util/uudecode
( cd $(TARGETPFX)pkg/NetHack && ../../../../util/uudecode ../../../../sys/amiga/amifont.uu )
cp $(AMISRC)/nethack.cnf $(TARGETPFX)pkg/NetHack/nethack.cnf
cp $(AMISRC)/README.amiga $(TARGETPFX)pkg/NetHack/README.amiga
cp $(AMISRC)/amii.hlp $(TARGETPFX)pkg/NetHack/amii.hlp
( cd $(TARGETPFX)pkg/NetHack && ../../../../util/uudecode ../../../../sys/amiga/NHinfo.uu )
( cd $(TARGETPFX)pkg/NetHack && ../../../../util/uudecode ../../../../sys/amiga/cnf-info.uu )
( cd $(TARGETPFX)pkg/NetHack && ../../../../util/uudecode ../../../../sys/amiga/license-info.uu )
+4 -4
View File
@@ -511,9 +511,9 @@ endif
override TARGET_LFLAGS= $(TOOLARCH) -noixemul -Wl,--allow-multiple-definition
override TARGET_LIBS += $(LIBLM)
VARDATND += nhtiles.bmp
override SYSSRC = ../sys/amiga/amidos.c ../sys/amiga/amigst.c \
override SYSSRC = ../sys/amiga/amidos.c \
../sys/amiga/amimenu.c ../sys/amiga/amirip.c \
../sys/amiga/amistack.c ../sys/amiga/amitty.c \
../sys/amiga/amistack.c \
../sys/amiga/amiwind.c ../sys/amiga/clipwin.c \
../sys/amiga/colorwin.c \
../sys/amiga/winami.c ../sys/amiga/winchar.c \
@@ -522,9 +522,9 @@ override SYSSRC = ../sys/amiga/amidos.c ../sys/amiga/amigst.c \
../sys/amiga/winstr.c ../sys/share/pcmain.c \
../win/share/bmptiles.c ../win/share/giftiles.c \
../win/share/tileset.c
override SYSOBJ = $(TARGETPFX)amidos.o $(TARGETPFX)amigst.o \
override SYSOBJ = $(TARGETPFX)amidos.o \
$(TARGETPFX)amirip.o $(TARGETPFX)amistack.o \
$(TARGETPFX)amitty.o $(TARGETPFX)amiwind.o \
$(TARGETPFX)amiwind.o \
$(TARGETPFX)winami.o $(TARGETPFX)winchar.o \
$(TARGETPFX)winfuncs.o $(TARGETPFX)winkey.o \
$(TARGETPFX)winamenu.o $(TARGETPFX)winreq.o \