move unmaintained files into outdated folder

If an old port is resurrected to work with current version code, its files
can be relocated to the appropriate sys or win folder as required.

In the meantime, the burden of upkeep can be avoided for the stuff in the
outdated folder for now.
This commit is contained in:
nhmall
2020-05-10 11:24:51 -04:00
parent 6fcb3fc0c7
commit c6d09a58d6
193 changed files with 0 additions and 0 deletions

2
outdated/sys/amiga/.gitattributes vendored Normal file
View File

@@ -0,0 +1,2 @@
*.p NHSUBST
* NH_filestag=(file%s_for_Amiga_versions_-_untested_for_3.7)

View File

@@ -0,0 +1,140 @@
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.

View File

@@ -0,0 +1,200 @@
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

View File

@@ -0,0 +1,213 @@
# 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

506
outdated/sys/amiga/amidos.c Normal file
View File

@@ -0,0 +1,506 @@
/* NetHack 3.6 amidos.c $NHDT-Date: 1432512796 2015/05/25 00:13:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.10 $ */
/* Copyright (c) Olaf Seibert, Nijmegen, The Netherlands, 1988,1990. */
/* Copyright (c) Kenneth Lorber, Bethesda, Maryland, 1991,1992,1993,1996. */
/* NetHack may be freely redistributed. See license for details. */
/*
* An assortment of imitations of cheap plastic MSDOS and Unix functions.
*/
#include "hack.h"
#include "winami.h"
/* Defined in config.h, let's undefine it here (static function below) */
#undef strcmpi
#include <libraries/dos.h>
#include <exec/execbase.h>
#include <intuition/intuition.h>
#undef COUNT
#if defined(__SASC_60) || defined(__GNUC__)
#include <proto/exec.h>
#include <proto/dos.h>
#endif
#ifdef AZTEC_50
#include <functions.h>
#undef strcmpi
#endif
/* Prototypes */
#include "NH:sys/amiga/winami.p"
#include "NH:sys/amiga/amiwind.p"
#include "NH:sys/amiga/amidos.p"
extern char Initialized;
extern struct window_procs amii_procs;
#ifndef __SASC_60
int Enable_Abort = 0; /* for stdio package */
#endif
/* Initial path, so we can find NetHack.cnf */
char PATH[PATHLEN] = "NetHack:";
static boolean record_exists(void);
void
flushout()
{
(void) fflush(stdout);
}
#ifndef getuid
getuid()
{
return 1;
}
#endif
#ifndef getlogin
char *
getlogin()
{
return ((char *) NULL);
}
#endif
#ifndef AZTEC_50
int
abs(x)
int x;
{
return x < 0 ? -x : x;
}
#endif
#ifdef SHELL
int
dosh()
{
int i;
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>
#define Sprintf (void) sprintf
#define EXTENSION 72
/*
* This routine uses an approximation of the free bytes on a disk.
* How large a file you can actually write depends on the number of
* extension blocks you need for it.
* In each extenstion block there are maximum 72 pointers to blocks,
* so every 73 disk blocks have only 72 available for data.
* The (necessary) file header is also good for 72 data block pointers.
*/
/* TODO: update this for FFS */
long
freediskspace(path)
char *path;
{
#ifdef UNTESTED
/* these changes from Patric Mueller <bhaak@gmx.net> for AROS to
* handle larger disks. Also needs limits.h and aros/oldprograms.h
* for AROS. (keni)
*/
unsigned long long freeBytes = 0;
#else
register long freeBytes = 0;
#endif
register struct InfoData *infoData; /* Remember... longword aligned */
char fileName[32];
/*
* Find a valid path on the device of which we want the free space.
* If there is a colon in the name, it is an absolute path
* and all up to the colon is everything we need.
* Remember slashes in a volume name are allowed!
* If there is no colon, it is relative to the current directory,
* so must be on the current device, so "" is enough...
*/
{
register char *colon;
strncpy(fileName, path, sizeof(fileName) - 1);
fileName[31] = 0;
if (colon = index(fileName, ':'))
colon[1] = '\0';
else
fileName[0] = '\0';
}
{
BPTR fileLock;
infoData = (struct InfoData *) alloc(sizeof(struct InfoData));
if (fileLock = Lock(fileName, SHARED_LOCK)) {
if (Info(fileLock, infoData)) {
/* We got a kind of DOS volume, since we can Lock it. */
/* Calculate number of blocks available for new file */
/* Kludge for the ever-full VOID: (oops RAM:) device */
if (infoData->id_UnitNumber == -1
&& infoData->id_NumBlocks == infoData->id_NumBlocksUsed) {
freeBytes = AvailMem(0L) - 64 * 1024L;
/* Just a stupid guess at the */
/* Ram-Handler overhead per block: */
freeBytes -= freeBytes / 16;
} else {
/* Normal kind of DOS file system device/volume */
freeBytes =
infoData->id_NumBlocks - infoData->id_NumBlocksUsed;
freeBytes -= (freeBytes + EXTENSION) / (EXTENSION + 1);
freeBytes *= infoData->id_BytesPerBlock;
#ifdef UNTESTED
if (freeBytes > LONG_MAX) {
freeBytes = LONG_MAX;
}
#endif
}
if (freeBytes < 0)
freeBytes = 0;
}
UnLock(fileLock);
}
free(infoData);
return freeBytes;
}
}
long
filesize(file)
char *file;
{
register BPTR fileLock;
register struct FileInfoBlock *fileInfoBlock;
register long size = 0;
fileInfoBlock =
(struct FileInfoBlock *) alloc(sizeof(struct FileInfoBlock));
if (fileLock = Lock(file, SHARED_LOCK)) {
if (Examine(fileLock, fileInfoBlock)) {
size = fileInfoBlock->fib_Size;
}
UnLock(fileLock);
}
free(fileInfoBlock);
return size;
}
#if 0
void
eraseall(path, files)
const char *path, *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(from, to)
const char *from, *to;
{
register BPTR fromFile, toFile;
register char *buffer;
register 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
/* this should be replaced */
saveDiskPrompt(start)
{
char buf[BUFSIZ], *bp;
BPTR fileLock;
if (sysflags.asksavedisk) {
/* Don't prompt if you can find the save file */
if (fileLock = Lock(g.SAVEF, SHARED_LOCK)) {
UnLock(fileLock);
#if defined(TTY_GRAPHICS)
if (windowprocs.win_init_nhwindows
!= amii_procs.win_init_nhwindows)
clear_nhwindow(WIN_MAP);
#endif
#if defined(AMII_GRAPHICS)
if (windowprocs.win_init_nhwindows
== amii_procs.win_init_nhwindows)
clear_nhwindow(WIN_BASE);
#endif
return 1;
}
pline("If save file is on a SAVE disk, put that disk in now.");
if (strlen(g.SAVEF) > QBUFSZ - 25 - 22)
panic("not enough buffer space for prompt");
/* THIS IS A HACK */
#if defined(TTY_GRAPHICS)
if (windowprocs.win_init_nhwindows != amii_procs.win_init_nhwindows) {
getlin("File name ?", buf);
clear_nhwindow(WIN_MAP);
}
#endif
#if defined(AMII_GRAPHICS)
if (windowprocs.win_init_nhwindows == amii_procs.win_init_nhwindows) {
getlind("File name ?", buf, g.SAVEF);
clear_nhwindow(WIN_BASE);
}
#endif
clear_nhwindow(WIN_MESSAGE);
if (!start && *buf == '\033')
return 0;
/* Strip any whitespace. Also, if nothing was entered except
* whitespace, do not change the value of g.SAVEF.
*/
for (bp = buf; *bp; bp++) {
if (!isspace(*bp)) {
strncpy(g.SAVEF, bp, PATHLEN);
break;
}
}
}
return 1;
}
/* Return 1 if the record file was found */
static boolean
record_exists()
{
FILE *file;
if (file = fopenp(RECORD, "r")) {
fclose(file);
return TRUE;
}
return FALSE;
}
#ifdef MFLOPPY
/*
* Under MSDOS: Prompt for game disk, then check for record file.
* For Amiga: do nothing, but called from restore.c
*/
void
gameDiskPrompt()
{
}
#endif
/*
* Add a slash to any name not ending in / or :. There must
* be room for the /.
*/
void
append_slash(name)
char *name;
{
char *ptr;
if (!*name)
return;
ptr = eos(name) - 1;
if (*ptr != '/' && *ptr != ':') {
*++ptr = '/';
*++ptr = '\0';
}
}
void
getreturn(str)
const char *str;
{
int ch;
raw_printf("Hit <RETURN> %s.", str);
while ((ch = nhgetch()) != '\n' && ch != '\r')
continue;
}
/* Follow the PATH, trying to fopen the file.
*/
#define PATHSEP ';'
FILE *
fopenp(name, mode)
register const char *name, *mode;
{
register char *bp, *pp, lastch;
register FILE *fp;
register BPTR theLock;
char buf[BUFSIZ];
/* Try the default directory first. Then look along PATH.
*/
if (strlen(name) >= BUFSIZ)
return (NULL);
strcpy(buf, name);
if (theLock = Lock(buf, SHARED_LOCK)) {
UnLock(theLock);
if (fp = fopen(buf, mode))
return fp;
}
pp = PATH;
while (pp && *pp) {
bp = buf;
while (*pp && *pp != PATHSEP) {
if (bp > buf + BUFSIZ - 1)
return (NULL);
lastch = *bp++ = *pp++;
}
if (lastch != ':' && lastch != '/' && bp != buf)
*bp++ = '/';
if (bp + strlen(name) > buf + BUFSIZ - 1)
return (NULL);
strcpy(bp, name);
if (theLock = Lock(buf, SHARED_LOCK)) {
UnLock(theLock);
if (fp = fopen(buf, mode))
return fp;
}
if (*pp)
pp++;
}
return NULL;
}
#endif /* MFLOPPY */
#ifdef CHDIR
/*
* A not general-purpose directory changing routine.
* Assumes you want to return to the original directory eventually,
* by chdir()ing to orgdir (which is defined in pcmain.c).
* Assumes -1 is not a valid lock, since 0 is valid.
*/
#define NO_LOCK ((BPTR) -1)
static BPTR OrgDirLock = NO_LOCK;
chdir(dir) char *dir;
{
extern char orgdir[];
if (dir == orgdir) {
/* We want to go back to where we came from. */
if (OrgDirLock != NO_LOCK) {
UnLock(CurrentDir(OrgDirLock));
OrgDirLock = NO_LOCK;
}
} else {
/*
* Go to some new place. If still at the original
* directory, save the FileLock.
*/
BPTR newDir;
if (newDir = Lock((char *) dir, SHARED_LOCK)) {
if (OrgDirLock == NO_LOCK) {
OrgDirLock = CurrentDir(newDir);
} else {
UnLock(CurrentDir(newDir));
}
} else {
return -1; /* Failed */
}
}
/* CurrentDir always succeeds if you have a lock */
return 0;
}
#endif /* CHDIR */
/* Chdir back to original directory
*/
#undef exit
void
nethack_exit(code)
{
#ifdef CHDIR
extern char orgdir[];
#endif
#ifdef CHDIR
chdir(orgdir); /* chdir, not chdirx */
#endif
#ifdef AMII_GRAPHICS
if (windowprocs.win_init_nhwindows == amii_procs.win_init_nhwindows)
CleanUp();
#endif
exit(code);
}
void regularize(s) /* normalize file name - we don't like :'s or /'s */
register char *s;
{
register char *lp;
while ((lp = index(s, ':')) || (lp = index(s, '/')))
*lp = '_';
}

View File

@@ -0,0 +1,42 @@
/* 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 NDECL(flushout );
#ifndef getuid
int NDECL(getuid );
#endif
#ifndef getpid
int NDECL(getpid );
#endif
#ifndef getlogin
char *NDECL(getlogin );
#endif
#ifndef abs
int FDECL(abs, (int ));
#endif
int NDECL(tgetch );
int NDECL(dosh );
long FDECL(freediskspace, (char *));
long FDECL(filesize, (char *));
void FDECL(eraseall, (const char * , const char *));
char *FDECL(CopyFile, (const char * , const char *));
void FDECL(copybones, (int ));
void NDECL(playwoRAMdisk );
int FDECL(saveDiskPrompt, (int ));
void NDECL(gameDiskPrompt );
void FDECL(append_slash, (char *));
void FDECL(getreturn, (const char *));
#ifndef msmsg
void FDECL(msmsg, ( const char *, ... ));
#endif
#if !defined(__SASC_60) && !defined(_DCC)
int FDECL(chdir, (char *));
#endif
#ifndef strcmpi
int FDECL(strcmpi, (char * , char *));
#endif
#if !defined(memcmp) && !defined(AZTEC_C) && !defined(_DCC) && !defined(__GNUC__)
int FDECL(memcmp, (unsigned char * , unsigned char * , int ));
#endif

View File

@@ -0,0 +1,9 @@
begin 777 hack.font
M#P```6AA8VLO.```````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
G````````````````````````````````````````````````"`!`
`
end

View File

@@ -0,0 +1,59 @@
begin 644 8
M```#\P`````````!``````````````)E```#Z0```F5P_TYU```````````,
M`````!H/@``!``````````````````````````````````````````!&140`
M```````````,`````!H`````"20`"`!```@`!@`!```@_P```&X`M```!@X`
M```````````8;&P8`#@8##````````,\&#P\''X<?CP\```,`#`\?!C\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:JHZK&8`&!@``!@``,/;9NQ5JE95&``</#@`;&O6G#DK^#?LYP/Q[_//
M8``&P#@`'````&Q\9LP`&!AF&!@`&&!F&&9F#&9F&&8,&!@8?A@`P,-F9FQF
M8&9F&&9F9L;&;&!L9F889CSN9AAF,`8,````9F9F9F`P/&88!FP88V9F?#Y@
M!AIF/#8V/#(8&!@`,P````````````````````#_`.<8`,,`````````````
M`%;_5=8/\,,`&!@``!AS`&889C9KU^K_```8&!@`UB9D:E8\:;0M``/_W_O?
MP``#P`__\``8`&P8QG8`##```!@`&,`\?GX\'CP\&#PX&!@,`#`8>,/\//C^
M\#YF?CSF_L;&./`\XSP\/AC&PSS^/`,\````.SP\.SQXQN8\9N8\8V8\8`;P
M?`P[&#9C&'X.&'``S`````````````````````#__\,8`&8`````````````
M`&H`:VH``,,`&!@``!B<&#P89F-6:E8``&88&!@`K`/`(\0L(T&"``/_W_F?
MP``#P````````````````````#```````````````````#``````````````
M```````````````&`````````````````/X`````````?```/```````\`<`
M````````<```````,P````````````````````#__\,8`&8`````````````
M`%8`5E8`````&!@``!@``!@8`,!J5FH````8&!@``,&#J!7!HL&#``/_[_Y_
MP``#P`````````@`"``(`!``"``8``@`(``(`"@`"``P``@`.``(`$``"`!(
M``@`4``(`%@`"`!@``@`:``(`'``"`!X``@`@``(`(@`"`"0``@`F``(`*``
M"`"H``@`L``(`+@`"`#```@`R``(`-``"`#8``@`X``(`.@`"`#P``@`^``(
M`0``"`$(``@!$``(`1@`"`$@``@!*``(`3``"`$X``@!0``(`4@`"`%0``@!
M6``(`6``"`%H``@!<``(`7@`"`&```@!B``(`9``"`&8``@!H``(`:@`"`&P
M``@!N``(`<``"`'(``@!T``(`=@`"`'@``@!Z``(`?``"`'X``@"```(`@@`
M"`(0``@"&``(`B``"`(H``@",``(`C@`"`)```@"2``(`E``"`)8``@"8``(
M`F@`"`)P``@">``(`H``"`*(``@"D``(`I@`"`*@``@"J``(`K``"`*X``@"
MP``(`L@`"`+0``@"V``(`N``"`+H``@"\``(`O@`"`,```@#"``(`Q``"`,8
M``@#(``(`R@`"`,P``@#.``(`T``"`-(``@#4``(`U@`"`-@``@#:``(`W``
M"`-X``@#@``(`X@`"`.0``@#F``(`Z``"`.H``@#L``(`[@`"`/```@#R``(
M`]``"`/8``@#X``(`^@`"`/P``@#^``(!```"``(``@`$``(`!@`"``@``@`
M*``(`#``"``X``@`0``(`$@`"`!0``@`6``(`&``"`!H``@`<``(`'@`"`"`
M``@`B``(`)``"`"8``@`H``(`*@`"`"P``@`N``(`,``"`#(``@`T``(`-@`
M"`#@``@`Z``(`/``"`#X``@$"``(!!``"`08``@$(``(!"@`"`0P``@#J``(
M!#@`"`.8``@$0``(!$@`"`10``@$6``(!&``"`1H``@$<``(!'@`"`2```@$
MB``(!)``"`28``@$H``(!*@`"`2P``@$N``(!,``"`3(``@!V``(`>``"`'H
M``@!\``(`?@`"`(```@$T``(!-@`"`3@``@$Z``(!/``"`3X``@%```(!0@`
M"`40``@%&``(!2``"`4H``@%,``(!3@`"`5```@%2``(!5``"`58``@%8``(
M!6@`"`5P``@%>``(!8``"`6(``@%D``(!9@`"`+8``@"X``(`N@`"`+P``@"
M^``(````"``````#[`````0`````````#@```$0```!<````8@````````/R
`
end

View File

@@ -0,0 +1,43 @@
/* 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
#include "NH:sys/amiga/winami.p"
#include "NH:sys/amiga/amiwind.p"
#include "NH:sys/amiga/amidos.p"
/* end amigst.c */

View File

@@ -0,0 +1,31 @@
Amiga-specific help file for NetHack 3.6
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:
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 options recognized are
-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.

View File

@@ -0,0 +1,107 @@
/* NetHack 3.6 amimenu.c $NHDT-Date: 1432512796 2015/05/25 00:13:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.7 $ */
/* Copyright (c) Olaf 'Rhialto' Seibert, 1989 */
/* Copyright (c) Kenneth Lorber, Bethesda, Maryland, 1992, 1993, 1996 */
/* Copyright (c) Janne Salmijärvi, 2000 */
/* NetHack may be freely redistributed. See license for details. */
/* Originally by John Toebes. */
/* GadTools menus by jhsa */
struct NewMenu GTHackMenu[] = {
{ NM_TITLE, "Commands", 0, 0, 0, 0 },
{ NM_ITEM, "? Display help menu", 0, 0, 0, (void *) '?' },
{ NM_ITEM, "& Explain a command", 0, 0, 0, (void *) '&' },
{ NM_ITEM, "O Set options", 0, 0, 0, (void *) 'O' },
{ NM_ITEM, "! AmigaDos command", 0, 0, 0, (void *) '!' },
{ NM_ITEM, "v Version number", 0, 0, 0, (void *) 'v' },
{ NM_ITEM, "V Long version and game history", 0, 0, 0, (void *) 'V' },
{ NM_ITEM, "^R Redraw screen", 0, 0, 0, (void *) 022 },
{ NM_ITEM, "^P Repeat previous messages", 0, 0, 0, (void *) 020 },
{ NM_ITEM, "M-q #quit the game", 0, 0, 0, (void *)(128 + 'q') },
{ NM_ITEM, "S Save the game", 0, 0, 0, (void *) 'S' },
{ NM_TITLE, "Inventory", 0, 0, 0, 0 },
{ NM_ITEM, "i Inventory", 0, 0, 0, (void *) 'i' },
{ NM_ITEM, "p Pay your bill", 0, 0, 0, (void *) 'p' },
{ NM_ITEM, "d Drop an object", 0, 0, 0, (void *) 'd' },
{ NM_ITEM, "D Drop several things", 0, 0, 0, (void *) 'D' },
{ NM_ITEM, ", Pickup an object", 0, 0, 0, (void *) ',' },
{ NM_ITEM, "@ Toggle pickup", 0, 0, 0, (void *) '@' },
{ NM_ITEM, "/ Identify something", 0, 0, 0, (void *) '/' },
{ NM_ITEM, "C Christen a monster", 0, 0, 0, (void *) 'C' },
{ NM_ITEM, "+ List known spells", 0, 0, 0, (void *) '+' },
{ NM_ITEM, "$ Your gold", 0, 0, 0, (void *) '$' },
{ NM_TITLE, "Actions", 0, 0, 0, 0 },
{ NM_ITEM, "a Apply/use something", 0, 0, 0, (void *) 'a' },
{ NM_ITEM, "e Eat something", 0, 0, 0, (void *) 'e' },
{ NM_ITEM, "f Fire ammunition", 0, 0, 0, (void *) 'f' },
{ NM_ITEM, "F Fight a monster", 0, 0, 0, (void *) 'F' },
{ NM_ITEM, "q Quaff a monster", 0, 0, 0, (void *) 'q' },
{ NM_ITEM, "r Read scroll/book", 0, 0, 0, (void *) 'r' },
{ NM_ITEM, "t Throw something", 0, 0, 0, (void *) 't' },
{ NM_ITEM, "z Zap a wand", 0, 0, 0, (void *) 'z' },
{ NM_ITEM, "Z Cast a spell", 0, 0, 0, (void *) 'Z' },
{ NM_TITLE, "Preparations", 0, 0, 0, 0 },
{ NM_ITEM, "A Remove all armor", 0, 0, 0, (void *) 'A' },
{ NM_ITEM, "P Put on a ring", 0, 0, 0, (void *) 'P' },
{ NM_ITEM, "R Remove ring", 0, 0, 0, (void *) 'R' },
{ NM_ITEM, "Q Select ammunition for quiver", 0, 0, 0, (void *) 'Q' },
{ NM_ITEM, "T Take off armor", 0, 0, 0, (void *) 'T' },
{ NM_ITEM, "w Wield a weapon", 0, 0, 0, (void *) 'w' },
{ NM_ITEM, "W Wear armor", 0, 0, 0, (void *) 'W' },
{ NM_ITEM, "x Swap wielded and secondary weapons", 0, 0, 0,
(void *) 'x' },
{ NM_ITEM, ") Current weapon", 0, 0, 0, (void *) ')' },
{ NM_ITEM, "[ Current armor", 0, 0, 0, (void *) '[' },
{ NM_ITEM, "= Current rings", 0, 0, 0, (void *) '=' },
{ NM_ITEM, "\" Current amulet", 0, 0, 0, (void *) '"' },
{ NM_ITEM, "( Current tools", 0, 0, 0, (void *) '(' },
{ NM_ITEM, "* Current equipment", 0, 0, 0, (void *) '*' },
{ NM_TITLE, "Movement", 0, 0, 0, 0 },
{ NM_ITEM, "o Open door", 0, 0, 0, (void *) 'o' },
{ NM_ITEM, "c Close door", 0, 0, 0, (void *) 'c' },
{ NM_ITEM, "^D Kick door", 0, 0, 0, (void *) 004 },
{ NM_ITEM, "s Search", 0, 0, 0, (void *) 's' },
{ NM_ITEM, "< Go up stairs", 0, 0, 0, (void *) '<' },
{ NM_ITEM, "> Go down stairs", 0, 0, 0, (void *) '>' },
{ NM_ITEM, "^T Teleport", 0, 0, 0, (void *) 024 },
{ NM_ITEM, ". Wait a moment", 0, 0, 0, (void *) '.' },
{ NM_ITEM, "E Engrave message on floor", 0, 0, 0, (void *) 'E' },
{ NM_TITLE, "Extended", 0, 0, 0, 0 },
{ NM_ITEM, "M-a #adjust inventory letters", 0, 0, 0,
(void *)(128 + 'a') },
{ NM_ITEM, "M-c #chat with someone", 0, 0, 0, (void *)(128 + 'c') },
{ NM_ITEM, "M-d #dip an object into something", 0, 0, 0,
(void *)(128 + 'd') },
#ifdef WEAPON_SKILLS
{ NM_ITEM, "M-e #enhance weapon skills", 0, 0, 0, (void *)(128 + 'e') },
#endif
{ NM_ITEM, "M-f #force a lock", 0, 0, 0, (void *)(128 + 'f') },
{ NM_ITEM, "M-i #invoke an object's special powers", 0, 0, 0,
(void *)(128 + 'i') },
{ NM_ITEM, "M-j #jump to another location", 0, 0, 0,
(void *)(128 + 'j') },
{ NM_ITEM, "M-l #loot a box on the floor", 0, 0, 0,
(void *)(128 + 'l') },
{ NM_ITEM, "M-m Use a #monster's special ability", 0, 0, 0,
(void *)(128 + 'm') },
{ NM_ITEM, "M-n #name an item or type of object", 0, 0, 0,
(void *)(128 + 'n') },
{ NM_ITEM, "M-o #offer a sacrifice to the gods", 0, 0, 0,
(void *)(128 + 'o') },
{ NM_ITEM, "M-p #pray to the gods for help", 0, 0, 0,
(void *)(128 + 'p') },
{ NM_ITEM, "M-q #quit the game", 0, 0, 0, (void *)(128 + 'q') },
{ NM_ITEM, "M-r #rub a lamp", 0, 0, 0, (void *)(128 + 'r') },
{ NM_ITEM, "M-s #sit down", 0, 0, 0, (void *)(128 + 's') },
{ NM_ITEM, "M-t #turn undead", 0, 0, 0, (void *)(128 + 't') },
{ NM_ITEM, "M-u #untrap something", 0, 0, 0, (void *)(128 + 'u') },
{ NM_ITEM, "M-v Long #version information", 0, 0, 0,
(void *)(128 + 'v') },
{ NM_ITEM, "M-w #wipe off your face", 0, 0, 0, (void *)(128 + 'w') },
{ NM_ITEM, " Your #conduct", 0, 0, 0, (void *) '#' }, /* "#co\n" */
{ NM_ITEM, " #ride your steed", 0, 0, 0, (void *) '#' }, /* "#ri\n" */
{ NM_ITEM, "M-2 Switch #twoweapon mode on/off", 0, 0, 0,
(void *)(128 + '2') },
{ NM_END, NULL, 0, 0, 0, 0 }
};

375
outdated/sys/amiga/amirip.c Normal file
View File

@@ -0,0 +1,375 @@
/* NetHack 3.6 amirip.c $NHDT-Date: 1450453302 2015/12/18 15:41:42 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.16 $ */
/* Copyright (c) Kenneth Lorber, Bethesda, Maryland 1991,1992,1993,1995,1996.
*/
/* NetHack may be freely redistributed. See license for details. */
#include "hack.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 <graphics/gfxmacros.h>
#include <intuition/intuition.h>
#include <libraries/dosextens.h>
#include <ctype.h>
#include <string.h>
#include "winami.h"
#include "windefs.h"
#include "winext.h"
#include "winproto.h"
static struct RastPort *rp;
#ifdef AMII_GRAPHICS
#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 char *load_list[] = { "tomb.iff", 0 };
static BitMapHeader tomb_bmhd;
static struct BitMap *tbmp[1] = { 0 };
static int cols[2] = { 154, 319 }; /* X location of center of columns */
static int cno = 0; /* current column */
#define TEXT_TOP (65 + yoff)
static xoff, yoff; /* image centering */
/* terrible kludge */
/* this is why prototypes should have ONLY types in them! */
#undef red
#undef green
#undef blue
#undef index
#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 *);
static void dofade(int, int, int);
static int search_cmap(int, int, int);
#define STONE_LINE_LEN \
13 /* # chars that fit on one line \
* (note 1 ' ' border) */
#define DEATH_LINE 10
#define YEAR_LINE 15
static unsigned short tomb_line;
extern struct amii_DisplayDesc *amiIDisplay;
extern struct Screen *HackScreen;
extern int havelace;
static unsigned short transpalette[AMII_MAXCOLORS] = {
0x0000,
};
static struct NewWindow newwin = { 0, 0, 640, 200, 1, 0,
MOUSEBUTTONS | VANILLAKEY | NOCAREREFRESH,
BORDERLESS | ACTIVATE | SMART_REFRESH,
NULL, NULL, (UBYTE *) NULL, NULL, NULL, -1,
-1, 0xffff, 0xffff, CUSTOMSCREEN };
int wh; /* was local in outrip, but needed for SCALE macro */
int cmap_white, cmap_black;
void
amii_outrip(tmpwin, how, when)
winid tmpwin;
int how;
time_t when;
{
int just_return = 0;
int done, rtxth;
struct IntuiMessage *imsg;
int i;
register char *dpx;
char buf[200];
int line, tw, ww;
char *errstr = NULL;
long year;
if (!WINVERS_AMIV || HackScreen->RastPort.BitMap->Depth < 4)
goto cleanup;
/* Use the users display size */
newwin.Height = amiIDisplay->ypix - newwin.TopEdge;
newwin.Width = amiIDisplay->xpix;
newwin.Screen = HackScreen;
for (i = 0; i < amii_numcolors; ++i)
sysflags.amii_curmap[i] = GetRGB4(HackScreen->ViewPort.ColorMap, i);
ripwin = OpenWindow((void *) &newwin);
if (!ripwin)
goto cleanup;
LoadRGB4(&HackScreen->ViewPort, transpalette, amii_numcolors);
rp = ripwin->RPort;
wh = ripwin->Height;
ww = ripwin->Width;
#ifdef HACKFONT
if (HackFont)
SetFont(rp, HackFont);
#endif
tomb_bmhd = ReadImageFiles(load_list, tbmp, &errstr);
if (errstr)
goto cleanup;
if (tomb_bmhd.w > ww || tomb_bmhd.h > wh)
goto cleanup;
#define GENOFF(full, used) ((((full) - (used)) / 2) & ~7)
xoff = GENOFF(ww, tomb_bmhd.w);
yoff = GENOFF(wh, tomb_bmhd.h);
for (i = 0; i < SIZE(cols); i++)
cols[i] += xoff;
cmap_white = search_cmap(0, 0, 0);
cmap_black = search_cmap(15, 15, 15);
BltBitMap(*tbmp, 0, 0, rp->BitMap, xoff, yoff, tomb_bmhd.w, tomb_bmhd.h,
0xc0, 0xff, NULL);
/* Put together death description */
formatkiller(buf, sizeof buf, how, FALSE);
tw = TextLength(rp, buf, STONE_LINE_LEN) + 40;
{
char *p = buf;
int x, tmp;
for (x = STONE_LINE_LEN; x; x--)
*p++ = 'W';
*p = '\0';
tmp = TextLength(rp, buf, STONE_LINE_LEN) + 40;
tw = max(tw, tmp);
}
/* There are 5 lines of text on the stone. */
rtxth = ripwin->RPort->TxHeight * 5;
SetAfPt(rp, (UWORD *) NULL, 0);
SetDrPt(rp, 0xFFFF);
tomb_line = TEXT_TOP;
SetDrMd(rp, JAM1);
/* Put name on stone */
Sprintf(buf, "%s", g.plname);
buf[STONE_LINE_LEN] = 0;
tomb_text(buf);
/* Put $ on stone */
Sprintf(buf, "%ld Au", done_money);
buf[STONE_LINE_LEN] = 0; /* It could be a *lot* of gold :-) */
tomb_text(buf);
/* Put together death description */
formatkiller(buf, sizeof buf, how, FALSE);
/* Put death type on stone */
for (line = DEATH_LINE, dpx = buf; line < YEAR_LINE; line++) {
register int i, i0;
char tmpchar;
if ((i0 = strlen(dpx)) > STONE_LINE_LEN) {
for (i = STONE_LINE_LEN; ((i0 > STONE_LINE_LEN) && i); i--) {
if (dpx[i] == ' ')
i0 = i;
}
if (!i)
i0 = STONE_LINE_LEN;
}
tmpchar = dpx[i0];
dpx[i0] = 0;
tomb_text(dpx);
if (tmpchar != ' ') {
dpx[i0] = tmpchar;
dpx = &dpx[i0];
} else {
dpx = &dpx[i0 + 1];
}
}
/* Put year on stone */
year = yyyymmdd(when) / 10000L;
Sprintf(buf, "%4ld", year);
tomb_text(buf);
#ifdef NH320_DEDICATION
/* dedication */
cno = 1;
tomb_line = TEXT_TOP;
tomb_text("This release");
tomb_text("of NetHack");
tomb_text("is dedicated");
tomb_text("to the");
tomb_text("memory of");
tomb_text("");
tomb_text("Izchak");
tomb_text(" Miller");
tomb_text("");
tomb_text("1935-1994");
tomb_text("");
tomb_text("Ascended");
#endif
/* Fade from black to full color */
dofade(0, 16, 1);
/* Flush all messages to avoid typeahead */
while (imsg = (struct IntuiMessage *) GetMsg(ripwin->UserPort))
ReplyMsg((struct Message *) imsg);
done = 0;
while (!done) {
WaitPort(ripwin->UserPort);
while (imsg = (struct IntuiMessage *) GetMsg(ripwin->UserPort)) {
switch (imsg->Class) {
case MOUSEBUTTONS:
case VANILLAKEY:
done = 1;
break;
}
ReplyMsg((struct Message *) imsg);
}
}
/* Fade out */
dofade(16, 0, -1);
just_return = 1;
cleanup:
/* free everything */
if (ripwin) {
Forbid();
while (imsg = (struct IntuiMessage *) GetMsg(ripwin->UserPort))
ReplyMsg((struct Message *) imsg);
CloseWindow(ripwin);
Permit();
}
LoadRGB4(&HackScreen->ViewPort, sysflags.amii_curmap, amii_numcolors);
if (tbmp[0])
FreeImageFiles(load_list, tbmp);
if (just_return)
return;
/* fall back to the straight-ASCII version */
genl_outrip(tmpwin, how, when);
}
static void
tomb_text(p)
char *p;
{
char buf[STONE_LINE_LEN * 2];
int l;
tomb_line += rp->TxHeight;
if (!*p)
return;
sprintf(buf, " %s ", p);
l = TextLength(rp, buf, strlen(buf));
SetAPen(rp, cmap_white);
Move(rp, cols[cno] - (l / 2) - 1, tomb_line);
Text(rp, buf, strlen(buf));
SetAPen(rp, cmap_white);
Move(rp, cols[cno] - (l / 2) + 1, tomb_line);
Text(rp, buf, strlen(buf));
SetAPen(rp, cmap_white);
Move(rp, cols[cno] - (l / 2), tomb_line - 1);
Text(rp, buf, strlen(buf));
SetAPen(rp, cmap_white);
Move(rp, cols[cno] - (l / 2), tomb_line + 1);
Text(rp, buf, strlen(buf));
SetAPen(rp, cmap_black);
Move(rp, cols[cno] - (l / 2), tomb_line);
Text(rp, buf, strlen(buf));
}
/* search colormap for best match to given color */
static int
search_cmap(int r0, int g0, int b0)
{
int best = 0;
int bdiff = 0x0fffffff;
int x;
for (x = 0; x < amii_numcolors; x++) {
int r = r0 - ((amiv_init_map[x] >> 8) & 15);
int g = g0 - ((amiv_init_map[x] >> 4) & 15);
int b = b0 - ((amiv_init_map[x]) & 15);
int diff = (r * r) + (g * g) + (b * b);
if (diff < bdiff) {
bdiff = diff;
best = x;
}
}
return best;
}
/* caution: this is NOT general! */
static void
dofade(int start, int stop, int inc)
{
int i, j;
for (i = start; (i * inc) <= stop; i += inc) {
for (j = 0; j < amii_numcolors; ++j) {
int r, g, b;
r = (amiv_init_map[j] & 0xf00) >> 8;
g = (amiv_init_map[j] & 0xf0) >> 4;
b = (amiv_init_map[j] & 0xf);
r = (r * i) / 16;
g = (g * i) / 16;
b = (b * i) / 16;
transpalette[j] = ((r << 8) | (g << 4) | b);
}
LoadRGB4(&HackScreen->ViewPort, transpalette, amii_numcolors);
Delay(1);
}
}
#endif /* AMII_GRAPHICS */
/*
TODO:
memory leaks
fix ReadImageFiles to return error instead of panic on error
*/

View File

@@ -0,0 +1,21 @@
/* NetHack 3.6 amistack.c $NHDT-Date: 1432512795 2015/05/25 00:13:15 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ */
/* 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>
/*
* At the moment 90*1024 would suffice, but just to be on the safe side ...
*/
long __stack = 128 * 1024;
#endif

View File

@@ -0,0 +1,84 @@
/* 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 NDECL(tty_change_color);
char *NDECL(tty_get_color_string);
#ifdef TTY_GRAPHICS
int amibbs = 0; /* BBS mode */
char bbs_id[80] = ""; /* BBS uid equivalent */
long afh_in, afh_out; /* BBS mode Amiga filehandles */
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';
tgetch()
{
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 ("");
}

View File

@@ -0,0 +1,901 @@
/* NetHack 3.6 amiwind.c $NHDT-Date: 1432512794 2015/05/25 00:13:14 $ $NHDT-Branch: master $:$NHDT-Revision: 1.10 $ */
/* Copyright (c) Olaf Seibert (KosmoSoft), 1989, 1992 */
/* Copyright (c) Kenneth Lorber, Bethesda, Maryland 1993,1996 */
/* NetHack may be freely redistributed. See license for details. */
#include "NH:sys/amiga/windefs.h"
#include "NH:sys/amiga/winext.h"
#include "NH:sys/amiga/winproto.h"
/* Have to undef CLOSE as display.h and intuition.h both use it */
#undef CLOSE
#ifdef AMII_GRAPHICS /* too early in the file? too late? */
#ifdef AMIFLUSH
static struct Message *FDECL(GetFMsg, (struct MsgPort *));
#endif
static int BufferGetchar(void);
static void ProcessMessage(register struct IntuiMessage *message);
#define BufferQueueChar(ch) (KbdBuffer[KbdBuffered++] = (ch))
struct Library *ConsoleDevice;
#include "NH:sys/amiga/amimenu.c"
/* Now our own variables */
struct IntuitionBase *IntuitionBase;
struct Screen *HackScreen;
struct Window *pr_WindowPtr;
struct MsgPort *HackPort;
struct IOStdReq ConsoleIO;
struct Menu *MenuStrip;
APTR *VisualInfo;
char Initialized = 0;
WEVENT lastevent;
#ifdef HACKFONT
struct GfxBase *GfxBase;
struct Library *DiskfontBase;
#endif
#define KBDBUFFER 10
static unsigned char KbdBuffer[KBDBUFFER];
unsigned char KbdBuffered;
#ifdef HACKFONT
struct TextFont *TextsFont = NULL;
struct TextFont *HackFont = NULL;
struct TextFont *RogueFont = NULL;
UBYTE FontName[] = "NetHack:hack.font";
/* # chars in "NetHack:": */
#define SIZEOF_DISKNAME 8
#endif
struct TextAttr Hack80 = {
#ifdef HACKFONT
&FontName[SIZEOF_DISKNAME],
#else
(UBYTE *) "topaz.font",
#endif
8, FS_NORMAL, FPF_DISKFONT | FPF_DESIGNED | FPF_ROMFONT
};
struct TextAttr TextsFont13 = { (UBYTE *) "courier.font", 13, FS_NORMAL,
FPF_DISKFONT | FPF_DESIGNED
#ifndef HACKFONT
| FPF_ROMFONT
#endif
};
/* Avoid doing a ReplyMsg through a window that no longer exists. */
static enum { NoAction, CloseOver } delayed_key_action = NoAction;
/*
* Open a window that shares the HackPort IDCMP. Use CloseShWindow()
* to close.
*/
struct Window *
OpenShWindow(nw)
struct NewWindow *nw;
{
register struct Window *win;
register ULONG idcmpflags;
if (!HackPort) /* Sanity check */
return (struct Window *) 0;
idcmpflags = nw->IDCMPFlags;
nw->IDCMPFlags = 0;
if (!(win = OpenWindow((void *) nw))) {
nw->IDCMPFlags = idcmpflags;
return (struct Window *) 0;
}
nw->IDCMPFlags = idcmpflags;
win->UserPort = HackPort;
ModifyIDCMP(win, idcmpflags);
return win;
}
/*
* Close a window that shared the HackPort IDCMP port.
*/
void FDECL(CloseShWindow, (struct Window *));
void
CloseShWindow(win)
struct Window *win;
{
register struct IntuiMessage *msg;
if (!HackPort)
panic("HackPort NULL in CloseShWindow");
if (!win)
return;
Forbid();
/* Flush all messages for all windows to avoid typeahead and other
* similar problems...
*/
while (msg = (struct IntuiMessage *) GetMsg(win->UserPort))
ReplyMsg((struct Message *) msg);
KbdBuffered = 0;
win->UserPort = (struct MsgPort *) 0;
ModifyIDCMP(win, 0L);
Permit();
CloseWindow(win);
}
static int
BufferGetchar()
{
register int c;
if (KbdBuffered > 0) {
c = KbdBuffer[0];
KbdBuffered--;
/* Move the remaining characters */
if (KbdBuffered < sizeof(KbdBuffer))
memcpy(KbdBuffer, KbdBuffer + 1, KbdBuffered);
return c;
}
return NO_CHAR;
}
/*
* This should remind you remotely of DeadKeyConvert, but we are cheating
* a bit. We want complete control over the numeric keypad, and no dead
* keys... (they are assumed to be on Alted keys).
*
* Also assumed is that the IntuiMessage is of type RAWKEY. For some
* reason, IECODE_UP_PREFIX events seem to be lost when they occur while
* our console window is inactive. This is particulary troublesome with
* qualifier keys... Is this because I never RawKeyConvert those events???
*/
int
ConvertKey(message)
register struct IntuiMessage *message;
{
static struct InputEvent theEvent;
static char numpad[] = "bjnh.lyku";
static char ctrl_numpad[] = "\x02\x0A\x0E\x08.\x0C\x19\x0B\x15";
static char shift_numpad[] = "BJNH.LYKU";
unsigned char buffer[10];
struct Window *w = message->IDCMPWindow;
register int length;
register ULONG qualifier;
char numeric_pad, shift, control, alt;
if (amii_wins[WIN_MAP])
w = amii_wins[WIN_MAP]->win;
qualifier = message->Qualifier;
control = (qualifier & IEQUALIFIER_CONTROL) != 0;
shift = (qualifier & (IEQUALIFIER_LSHIFT | IEQUALIFIER_RSHIFT)) != 0;
alt = (qualifier & (IEQUALIFIER_LALT | IEQUALIFIER_RALT)) != 0;
/* Allow ALT to function as a META key ... */
/* But make it switchable - alt is needed for some non-US keymaps */
if (sysflags.altmeta)
qualifier &= ~(IEQUALIFIER_LALT | IEQUALIFIER_RALT);
numeric_pad = (qualifier & IEQUALIFIER_NUMERICPAD) != 0;
/*
* Shortcut for HELP and arrow keys. I suppose this is allowed.
* The defines are in intuition/intuition.h, and the keys don't
* serve 'text' input, normally. Also, parsing their escape
* sequences is such a mess...
*/
switch (message->Code) {
case RAWHELP:
if (alt) {
EditColor();
return (-1);
}
#ifdef CLIPPING
else if (WINVERS_AMIV && control) {
EditClipping();
CO = (w->Width - w->BorderLeft - w->BorderRight) / mxsize;
LI = (w->Height - w->BorderTop - w->BorderBottom) / mysize;
clipxmax = CO + clipx;
clipymax = LI + clipy;
if (CO < COLNO || LI < ROWNO) {
clipping = TRUE;
amii_cliparound(u.ux, u.uy);
} else {
clipping = FALSE;
clipx = clipy = 0;
}
BufferQueueChar('R' - 64);
return (-1);
}
#endif
else if (WINVERS_AMIV && shift) {
if (WIN_OVER == WIN_ERR) {
WIN_OVER = amii_create_nhwindow(NHW_OVER);
BufferQueueChar('R' - 64);
} else {
delayed_key_action = CloseOver;
}
return (-1);
}
return ('?');
break;
case CURSORLEFT:
length = '4';
numeric_pad = 1;
goto arrow;
case CURSORDOWN:
length = '2';
numeric_pad = 1;
goto arrow;
case CURSORUP:
length = '8';
numeric_pad = 1;
goto arrow;
case CURSORRIGHT:
length = '6';
numeric_pad = 1;
goto arrow;
}
theEvent.ie_Class = IECLASS_RAWKEY;
theEvent.ie_Code = message->Code;
theEvent.ie_Qualifier = numeric_pad ? IEQUALIFIER_NUMERICPAD : qualifier;
theEvent.ie_EventAddress = (APTR)(message->IAddress);
length = RawKeyConvert(&theEvent, (char *) buffer, (long) sizeof(buffer),
NULL);
if (length == 1) { /* Plain ASCII character */
length = buffer[0];
/*
* If iflags.num_pad is set, movement is by 4286.
* If not set, translate 4286 into hjkl.
* This way, the numeric pad can /always/ be used
* for moving, though best results are when it is off.
*/
arrow:
if (!iflags.num_pad && numeric_pad && length >= '1'
&& length <= '9') {
length -= '1';
if (control) {
length = ctrl_numpad[length];
} else if (shift) {
length = shift_numpad[length];
} else {
length = numpad[length];
}
}
/* Kludge to allow altmeta on eg. scandinavian keymap (# ==
shift+alt+3)
and prevent it from interfering with # command (M-#) */
if (length == ('#' | 0x80))
return '#';
if (alt && sysflags.altmeta)
length |= 0x80;
return (length);
} /* else shift, ctrl, alt, amiga, F-key, shift-tab, etc */
else if (length > 1) {
int i;
if (length == 3 && buffer[0] == 155 && buffer[2] == 126) {
int got = 1;
switch (buffer[1]) {
case 53:
mxsize = mysize = 8;
break;
case 54:
mxsize = mysize = 16;
break;
case 55:
mxsize = mysize = 24;
break;
case 56:
mxsize = mysize = 32;
break;
case 57:
mxsize = mysize = 48;
break;
default:
got = 0;
break;
}
#ifdef OPT_DISPMAP
dispmap_sanity();
#endif
if (got) {
CO = (w->Width - w->BorderLeft - w->BorderRight) / mxsize;
LI = (w->Height - w->BorderTop - w->BorderBottom) / mysize;
clipxmax = CO + clipx;
clipymax = LI + clipy;
if (CO < COLNO || LI < ROWNO) {
amii_cliparound(u.ux, u.uy);
} else {
CO = COLNO;
LI = ROWNO;
}
reclip = 1;
doredraw();
flush_screen(1);
reclip = 0;
/*BufferQueueChar( 'R'-64 );*/
return (-1);
}
}
printf("Unrecognized key: %d ", (int) buffer[0]);
for (i = 1; i < length; ++i)
printf("%d ", (int) buffer[i]);
printf("\n");
}
return (-1);
}
/*
* Process an incoming IntuiMessage.
* It would certainly look nicer if this could be done using a
* PA_SOFTINT message port, but we cannot call RawKeyConvert()
* during a software interrupt.
* Anyway, amikbhit()/kbhit() is called often enough, and usually gets
* ahead of input demands, when the user types ahead.
*/
static void
ProcessMessage(message)
register struct IntuiMessage *message;
{
int c;
int cnt;
menu_item *mip;
static int skip_mouse = 0; /* need to ignore next mouse event on
* a window activation */
struct Window *w = message->IDCMPWindow;
switch (message->Class) {
case ACTIVEWINDOW:
if (alwaysinvent && WIN_INVEN != WIN_ERR
&& w == amii_wins[WIN_INVEN]->win) {
cnt = DoMenuScroll(WIN_INVEN, 0, PICK_NONE, &mip);
} else if (scrollmsg && WIN_MESSAGE != WIN_ERR
&& w == amii_wins[WIN_MESSAGE]->win) {
cnt = DoMenuScroll(WIN_MESSAGE, 0, PICK_NONE, &mip);
} else {
skip_mouse = 1;
}
break;
case MOUSEBUTTONS: {
if (skip_mouse) {
skip_mouse = 0;
break;
}
if (!amii_wins[WIN_MAP] || w != amii_wins[WIN_MAP]->win)
break;
if (message->Code == SELECTDOWN) {
lastevent.type = WEMOUSE;
lastevent.un.mouse.x = message->MouseX;
lastevent.un.mouse.y = message->MouseY;
/* With shift equals RUN */
lastevent.un.mouse.qual =
(message->Qualifier
& (IEQUALIFIER_LSHIFT | IEQUALIFIER_RSHIFT)) != 0;
}
} break;
case MENUPICK: {
USHORT thismenu;
struct MenuItem *item;
thismenu = message->Code;
while (thismenu != MENUNULL) {
item = ItemAddress(MenuStrip, (ULONG) thismenu);
if (KbdBuffered < KBDBUFFER)
BufferQueueChar((char) (GTMENUITEM_USERDATA(item)));
thismenu = item->NextSelect;
}
} break;
case REFRESHWINDOW: {
if (scrollmsg && amii_wins[WIN_MESSAGE]
&& w == amii_wins[WIN_MESSAGE]->win) {
cnt = DoMenuScroll(WIN_MESSAGE, 0, PICK_NONE, &mip);
}
} break;
case CLOSEWINDOW:
if (WIN_INVEN != WIN_ERR && w == amii_wins[WIN_INVEN]->win) {
dismiss_nhwindow(WIN_INVEN);
}
if (WINVERS_AMIV
&& (WIN_OVER != WIN_ERR && w == amii_wins[WIN_OVER]->win)) {
destroy_nhwindow(WIN_OVER);
WIN_OVER = WIN_ERR;
}
break;
case RAWKEY:
if (!(message->Code & IECODE_UP_PREFIX)) {
/* May queue multiple characters
* but doesn't do that yet...
*/
if ((c = ConvertKey(message)) > 0)
BufferQueueChar(c);
}
break;
case GADGETDOWN:
if (WIN_MESSAGE != WIN_ERR && w == amii_wins[WIN_MESSAGE]->win) {
cnt = DoMenuScroll(WIN_MESSAGE, 0, PICK_NONE, &mip);
} else if (WIN_INVEN != WIN_ERR && w == amii_wins[WIN_INVEN]->win) {
cnt = DoMenuScroll(WIN_INVEN, 0, PICK_NONE, &mip);
}
break;
case NEWSIZE:
if (WIN_MESSAGE != WIN_ERR && w == amii_wins[WIN_MESSAGE]->win) {
if (WINVERS_AMIV) {
/* Make sure that new size is honored for good. */
SetAPen(w->RPort, amii_msgBPen);
SetBPen(w->RPort, amii_msgBPen);
SetDrMd(w->RPort, JAM2);
RectFill(w->RPort, w->BorderLeft, w->BorderTop,
w->Width - w->BorderRight - 1,
w->Height - w->BorderBottom - 1);
}
ReDisplayData(WIN_MESSAGE);
} else if (WIN_INVEN != WIN_ERR && w == amii_wins[WIN_INVEN]->win) {
ReDisplayData(WIN_INVEN);
} else if (WINVERS_AMIV && (WIN_OVER != WIN_ERR
&& w == amii_wins[WIN_OVER]->win)) {
BufferQueueChar('R' - 64);
} else if (WIN_MAP != WIN_ERR && w == amii_wins[WIN_MAP]->win) {
#ifdef CLIPPING
CO = (w->Width - w->BorderLeft - w->BorderRight) / mxsize;
LI = (w->Height - w->BorderTop - w->BorderBottom) / mysize;
clipxmax = CO + clipx;
clipymax = LI + clipy;
if (CO < COLNO || LI < ROWNO) {
amii_cliparound(u.ux, u.uy);
} else {
clipping = FALSE;
clipx = clipy = 0;
}
BufferQueueChar('R' - 64);
#endif
}
break;
}
ReplyMsg((struct Message *) message);
switch (delayed_key_action) {
case CloseOver:
amii_destroy_nhwindow(WIN_OVER);
WIN_OVER = WIN_ERR;
delayed_key_action = NoAction;
case NoAction:
; /* null */
}
}
#endif /* AMII_GRAPHICS */
/*
* Get all incoming messages and fill up the keyboard buffer,
* thus allowing Intuition to (maybe) free up the IntuiMessages.
* Return when no more messages left, or keyboard buffer half full.
* We need to do this since there is no one-to-one correspondence
* between characters and incoming messages.
*/
#if defined(TTY_GRAPHICS) && !defined(AMII_GRAPHICS)
int
kbhit()
{
return 0;
}
#else
int
kbhit()
{
int c;
#ifdef TTY_GRAPHICS
/* a kludge to defuse the mess in allmain.c */
/* I hope this is the right approach */
if (windowprocs.win_init_nhwindows == amii_procs.win_init_nhwindows)
return 0;
#endif
c = amikbhit();
if (c <= 0)
return (0);
return (c);
}
#endif
#ifdef AMII_GRAPHICS
int
amikbhit()
{
register struct IntuiMessage *message;
while (KbdBuffered < KBDBUFFER / 2) {
#ifdef AMIFLUSH
message = (struct IntuiMessage *) GetFMsg(HackPort);
#else
message = (struct IntuiMessage *) GetMsg(HackPort);
#endif
if (message) {
ProcessMessage(message);
if (lastevent.type != WEUNK && lastevent.type != WEKEY)
break;
} else
break;
}
return (lastevent.type == WEUNK) ? KbdBuffered : -1;
}
/*
* Get a character from the keyboard buffer, waiting if not available.
* Ignore other kinds of events that happen in the mean time.
*/
int
WindowGetchar()
{
while ((lastevent.type = WEUNK), amikbhit() <= 0) {
WaitPort(HackPort);
}
return BufferGetchar();
}
WETYPE
WindowGetevent()
{
lastevent.type = WEUNK;
while (amikbhit() == 0) {
WaitPort(HackPort);
}
if (KbdBuffered) {
lastevent.type = WEKEY;
lastevent.un.key = BufferGetchar();
}
return (lastevent.type);
}
/*
* Clean up everything. But before we do, ask the user to hit return
* when there is something that s/he should read.
*/
void
amii_cleanup()
{
register struct IntuiMessage *msg;
/* Close things up */
if (HackPort) {
amii_raw_print("");
amii_getret();
}
if (ConsoleIO.io_Device)
CloseDevice((struct IORequest *) &ConsoleIO);
ConsoleIO.io_Device = 0;
if (ConsoleIO.io_Message.mn_ReplyPort)
DeleteMsgPort(ConsoleIO.io_Message.mn_ReplyPort);
ConsoleIO.io_Message.mn_ReplyPort = 0;
/* Strip messages before deleting the port */
if (HackPort) {
Forbid();
while (msg = (struct IntuiMessage *) GetMsg(HackPort))
ReplyMsg((struct Message *) msg);
kill_nhwindows(1);
DeleteMsgPort(HackPort);
HackPort = NULL;
Permit();
}
/* Close the screen, under v37 or greater it is a pub screen and there may
* 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);
if (VisualInfo)
FreeVisualInfo(VisualInfo);
while (CloseScreen(HackScreen) == FALSE) {
struct EasyStruct easy = {
sizeof(struct EasyStruct), 0, "Nethack Problem",
"Can't Close Screen, Close Visiting Windows", "Okay"
};
EasyRequest(NULL, &easy, NULL, NULL);
}
} else
#endif
{
CloseScreen(HackScreen);
}
HackScreen = NULL;
}
#ifdef HACKFONT
if (HackFont) {
CloseFont(HackFont);
HackFont = NULL;
}
if (TextsFont) {
CloseFont(TextsFont);
TextsFont = NULL;
}
if (RogueFont) {
CloseFont(RogueFont);
RogueFont = NULL;
}
if (DiskfontBase) {
CloseLibrary(DiskfontBase);
DiskfontBase = NULL;
}
#endif
if (GadToolsBase) {
CloseLibrary((struct Library *) GadToolsBase);
GadToolsBase = NULL;
}
if (LayersBase) {
CloseLibrary((struct Library *) LayersBase);
LayersBase = NULL;
}
if (GfxBase) {
CloseLibrary((struct Library *) GfxBase);
GfxBase = NULL;
}
if (IntuitionBase) {
CloseLibrary((struct Library *) IntuitionBase);
IntuitionBase = NULL;
}
#ifdef SHAREDLIB
if (DOSBase) {
CloseLibrary((struct Library *) DOSBase);
DOSBase = NULL;
}
#endif
((struct Process *) FindTask(NULL))->pr_WindowPtr = (APTR) pr_WindowPtr;
Initialized = 0;
}
#endif /* AMII_GRAPHICS */
#ifndef SHAREDLIB
void
Abort(rc)
long rc;
{
int fault = 1;
#ifdef CHDIR
extern char orgdir[];
chdir(orgdir);
#endif
#ifdef AMII_GRAPHICS
if (Initialized && ConsoleDevice
&& windowprocs.win_init_nhwindows == amii_procs.win_init_nhwindows) {
printf("\n\nAbort with alert code %08lx...\n", rc);
amii_getret();
} 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);
}
void
CleanUp()
{
amii_cleanup();
}
#endif
#ifdef AMII_GRAPHICS
#ifdef AMIFLUSH
/* This routine adapted from AmigaMail IV-37 by Michael Sinz */
static struct Message *
GetFMsg(port)
struct MsgPort *port;
{
struct IntuiMessage *msg, *succ, *succ1;
if (msg = (struct IntuiMessage *) GetMsg(port)) {
if (!sysflags.amiflush)
return ((struct Message *) msg);
if (msg->Class == RAWKEY) {
Forbid();
succ = (struct IntuiMessage *) (port->mp_MsgList.lh_Head);
while (succ1 = (struct IntuiMessage *) (succ->ExecMessage.mn_Node
.ln_Succ)) {
if (succ->Class == RAWKEY) {
Remove((struct Node *) succ);
ReplyMsg((struct Message *) succ);
}
succ = succ1;
}
Permit();
}
}
return ((struct Message *) msg);
}
#endif
struct NewWindow *
DupNewWindow(win)
struct NewWindow *win;
{
struct NewWindow *nwin;
struct Gadget *ngd, *gd, *pgd = NULL;
struct PropInfo *pip;
struct StringInfo *sip;
/* Copy the (Ext)NewWindow structure */
nwin = (struct NewWindow *) alloc(sizeof(struct NewWindow));
*nwin = *win;
/* Now do the gadget list */
nwin->FirstGadget = NULL;
for (gd = win->FirstGadget; gd; gd = gd->NextGadget) {
ngd = (struct Gadget *) alloc(sizeof(struct Gadget));
*ngd = *gd;
if (gd->GadgetType == STRGADGET) {
sip = (struct StringInfo *) alloc(sizeof(struct StringInfo));
*sip = *((struct StringInfo *) gd->SpecialInfo);
sip->Buffer = (UBYTE *) alloc(sip->MaxChars);
*sip->Buffer = 0;
ngd->SpecialInfo = (APTR) sip;
} else if (gd->GadgetType == PROPGADGET) {
pip = (struct PropInfo *) alloc(sizeof(struct PropInfo));
*pip = *((struct PropInfo *) gd->SpecialInfo);
ngd->SpecialInfo = (APTR) pip;
}
if (pgd)
pgd->NextGadget = ngd;
else
nwin->FirstGadget = ngd;
pgd = ngd;
ngd->NextGadget = NULL;
ngd->UserData = (APTR) 0x45f35c3d; // magic cookie for FreeNewWindow()
}
return (nwin);
}
void
FreeNewWindow(win)
struct NewWindow *win;
{
register struct Gadget *gd, *pgd;
register struct StringInfo *sip;
for (gd = win->FirstGadget; gd; gd = pgd) {
pgd = gd->NextGadget;
if ((ULONG) gd->UserData == 0x45f35c3d) {
if (gd->GadgetType == STRGADGET) {
sip = (struct StringInfo *) gd->SpecialInfo;
free(sip->Buffer);
free(sip);
} else if (gd->GadgetType == PROPGADGET) {
free((struct PropInfo *) gd->SpecialInfo);
}
free(gd);
}
}
free(win);
}
void
bell()
{
if (flags.silent)
return;
DisplayBeep(NULL);
}
void
amii_delay_output()
{
/* delay 50 ms */
Delay(2L);
}
void
amii_number_pad(state)
int state;
{
}
#endif /* AMII_GRAPHICS */
#ifndef SHAREDLIB
void
amiv_loadlib(void)
{
}
void
amii_loadlib(void)
{
}
/* fatal error */
/*VARARGS1*/
void error
VA_DECL(const char *, s)
{
VA_START(s);
VA_INIT(s, char *);
putchar('\n');
vprintf(s, VA_ARGS);
putchar('\n');
VA_END();
Abort(0L);
}
#endif

View File

@@ -0,0 +1,40 @@
/* 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 *FDECL( OpenShWindow, (struct ExtNewWindow *) );
#else
struct Window *FDECL( OpenShWindow, (struct NewWindow *) );
#endif
void FDECL( CloseShWindow, (struct Window *));
int NDECL( kbhit );
int NDECL( amikbhit );
int NDECL( WindowGetchar );
WETYPE NDECL( WindowGetevent );
void NDECL( WindowFlush );
void FDECL( WindowPutchar, (char ));
void FDECL( WindowFPuts, (const char *));
void FDECL( WindowPuts, (const char *));
void FDECL( WindowPrintf, ( char *,... ));
void NDECL( CleanUp );
int FDECL( ConvertKey, ( struct IntuiMessage * ));
#ifndef SHAREDLIB
void FDECL( Abort, (long ));
#endif
void FDECL( flush_glyph_buffer, (struct Window *));
void FDECL( amiga_print_glyph, (winid , int , int ));
void FDECL( start_glyphout, (winid ));
void FDECL( amii_end_glyphout, (winid ));
#ifdef INTUI_NEW_LOOK
struct ExtNewWindow *FDECL( DupNewWindow, (struct ExtNewWindow *));
void FDECL( FreeNewWindow, (struct ExtNewWindow *));
#else
struct NewWindow *FDECL( DupNewWindow, (struct NewWindow *));
void FDECL( FreeNewWindow, (struct NewWindow *));
#endif
void NDECL( bell );
void NDECL( amii_delay_output );
void FDECL( amii_number_pad, (int ));
void amii_cleanup( void );

View File

@@ -0,0 +1,258 @@
static USHORT Palette[] = {
0x0AAA, /* color #0 */
0x0000, /* color #1 */
0x0FFF, /* color #2 */
0x058B, /* color #3 */
0x000F, /* color #4 */
0x0F0F, /* color #5 */
0x00FF, /* color #6 */
0x0FFF /* color #7 */
#define PaletteColorCount 8
};
#define PALETTE Palette
static SHORT ClipBorderVectors1[] = { 0, 0, 76, 0, 76, 11, 0, 11, 0, 0 };
static struct Border ClipBorder1 = {
-1, -1, /* XY origin relative to container TopLeft */
3, 0, JAM1, /* front pen, back pen and drawmode */
5, /* number of XY vectors */
ClipBorderVectors1, /* pointer to XY vectors */
NULL /* next border in list */
};
static struct IntuiText ClipIText1 = {
4, 0, JAM1, /* front and back text pens, drawmode and fill byte */
15, 1, /* XY origin relative to container TopLeft */
NULL, /* font pointer or NULL for default */
"Cancel", /* pointer to text */
NULL /* next IntuiText structure */
};
static struct Gadget ClipCancel = {
NULL, /* next gadget */
240, 59, /* origin XY of hit box relative to window TopLeft */
75, 10, /* hit box width and height */
NULL, /* gadget flags */
RELVERIFY, /* activation flags */
BOOLGADGET, /* gadget type flags */
(APTR) &ClipBorder1, /* gadget border or image to be rendered */
NULL, /* alternate imagery for selection */
&ClipIText1, /* first IntuiText structure */
NULL, /* gadget mutual-exclude long word */
NULL, /* SpecialInfo structure */
GADCANCEL, /* user-definable data */
NULL /* pointer to user-definable data */
};
static SHORT ClipBorderVectors2[] = { 0, 0, 78, 0, 78, 11, 0, 11, 0, 0 };
static struct Border ClipBorder2 = {
-1, -1, /* XY origin relative to container TopLeft */
3, 0, JAM1, /* front pen, back pen and drawmode */
5, /* number of XY vectors */
ClipBorderVectors2, /* pointer to XY vectors */
NULL /* next border in list */
};
static struct IntuiText ClipIText2 = {
4, 0, JAM1, /* front and back text pens, drawmode and fill byte */
24, 1, /* XY origin relative to container TopLeft */
NULL, /* font pointer or NULL for default */
"Okay", /* pointer to text */
NULL /* next IntuiText structure */
};
static struct Gadget ClipOkay = {
&ClipCancel, /* next gadget */
17, 60, /* origin XY of hit box relative to window TopLeft */
77, 10, /* hit box width and height */
NULL, /* gadget flags */
RELVERIFY, /* activation flags */
BOOLGADGET, /* gadget type flags */
(APTR) &ClipBorder2, /* gadget border or image to be rendered */
NULL, /* alternate imagery for selection */
&ClipIText2, /* first IntuiText structure */
NULL, /* gadget mutual-exclude long word */
NULL, /* SpecialInfo structure */
GADOKAY, /* user-definable data */
NULL /* pointer to user-definable data */
};
static struct PropInfo ClipClipXCLIPSInfo = {
AUTOKNOB + FREEHORIZ, /* PropInfo flags */
24504, -1, /* horizontal and vertical pot values */
10922, -1, /* horizontal and vertical body values */
};
static struct Image ClipImage1 = {
43, 0, /* XY origin relative to container TopLeft */
24, 3, /* Image width and height in pixels */
0, /* number of bitplanes in Image */
NULL, /* pointer to ImageData */
0x0000, 0x0000, /* PlanePick and PlaneOnOff */
NULL /* next Image structure */
};
static struct IntuiText ClipIText3 = {
3, 0, JAM1, /* front and back text pens, drawmode and fill byte */
-116, -1, /* XY origin relative to container TopLeft */
NULL, /* font pointer or NULL for default */
"X Clip Border:", /* pointer to text */
NULL /* next IntuiText structure */
};
static struct Gadget ClipXCLIP = {
&ClipOkay, /* next gadget */
134, 37, /* origin XY of hit box relative to window TopLeft */
-199, 7, /* hit box width and height */
GRELWIDTH, /* gadget flags */
RELVERIFY + GADGIMMEDIATE, /* activation flags */
PROPGADGET, /* gadget type flags */
(APTR) &ClipImage1, /* gadget border or image to be rendered */
NULL, /* alternate imagery for selection */
&ClipIText3, /* first IntuiText structure */
NULL, /* gadget mutual-exclude long word */
(APTR) &ClipClipXCLIPSInfo, /* SpecialInfo structure */
XCLIP, /* user-definable data */
NULL /* pointer to user-definable data */
};
static struct PropInfo ClipClipYCLIPSInfo = {
AUTOKNOB + FREEHORIZ, /* PropInfo flags */
13106, -1, /* horizontal and vertical pot values */
10922, -1, /* horizontal and vertical body values */
};
static struct Image ClipImage2 = {
22, 0, /* XY origin relative to container TopLeft */
24, 3, /* Image width and height in pixels */
0, /* number of bitplanes in Image */
NULL, /* pointer to ImageData */
0x0000, 0x0000, /* PlanePick and PlaneOnOff */
NULL /* next Image structure */
};
static struct IntuiText ClipIText4 = {
3, 0, JAM1, /* front and back text pens, drawmode and fill byte */
-116, -1, /* XY origin relative to container TopLeft */
NULL, /* font pointer or NULL for default */
"Y Clip Border:", /* pointer to text */
NULL /* next IntuiText structure */
};
static struct Gadget ClipYCLIP = {
&ClipXCLIP, /* next gadget */
134, 46, /* origin XY of hit box relative to window TopLeft */
-199, 7, /* hit box width and height */
GRELWIDTH, /* gadget flags */
RELVERIFY + GADGIMMEDIATE, /* activation flags */
PROPGADGET, /* gadget type flags */
(APTR) &ClipImage2, /* gadget border or image to be rendered */
NULL, /* alternate imagery for selection */
&ClipIText4, /* first IntuiText structure */
NULL, /* gadget mutual-exclude long word */
(APTR) &ClipClipYCLIPSInfo, /* SpecialInfo structure */
YCLIP, /* user-definable data */
NULL /* pointer to user-definable data */
};
static struct PropInfo ClipClipXSIZESInfo = {
AUTOKNOB + FREEHORIZ, /* PropInfo flags */
26212, -1, /* horizontal and vertical pot values */
10922, -1, /* horizontal and vertical body values */
};
static struct Image ClipImage3 = {
45, 0, /* XY origin relative to container TopLeft */
24, 3, /* Image width and height in pixels */
0, /* number of bitplanes in Image */
NULL, /* pointer to ImageData */
0x0000, 0x0000, /* PlanePick and PlaneOnOff */
NULL /* next Image structure */
};
static struct IntuiText ClipIText5 = {
3, 0, JAM1, /* front and back text pens, drawmode and fill byte */
-124, -1, /* XY origin relative to container TopLeft */
NULL, /* font pointer or NULL for default */
"X Scale Factor:", /* pointer to text */
NULL /* next IntuiText structure */
};
static struct Gadget ClipXSIZE = {
&ClipYCLIP, /* next gadget */
134, 15, /* origin XY of hit box relative to window TopLeft */
-199, 7, /* hit box width and height */
GRELWIDTH, /* gadget flags */
RELVERIFY + GADGIMMEDIATE, /* activation flags */
PROPGADGET, /* gadget type flags */
(APTR) &ClipImage3, /* gadget border or image to be rendered */
NULL, /* alternate imagery for selection */
&ClipIText5, /* first IntuiText structure */
NULL, /* gadget mutual-exclude long word */
(APTR) &ClipClipXSIZESInfo, /* SpecialInfo structure */
XSIZE, /* user-definable data */
NULL /* pointer to user-definable data */
};
static struct PropInfo ClipClipYSIZESInfo = {
AUTOKNOB + FREEHORIZ, /* PropInfo flags */
-25937, -1, /* horizontal and vertical pot values */
10922, -1, /* horizontal and vertical body values */
};
static struct Image ClipImage4 = {
69, 0, /* XY origin relative to container TopLeft */
24, 3, /* Image width and height in pixels */
0, /* number of bitplanes in Image */
NULL, /* pointer to ImageData */
0x0000, 0x0000, /* PlanePick and PlaneOnOff */
NULL /* next Image structure */
};
static struct IntuiText ClipIText6 = {
3, 0, JAM1, /* front and back text pens, drawmode and fill byte */
-124, -1, /* XY origin relative to container TopLeft */
NULL, /* font pointer or NULL for default */
"Y Scale Factor:", /* pointer to text */
NULL /* next IntuiText structure */
};
static struct Gadget ClipYSIZE = {
&ClipXSIZE, /* next gadget */
134, 24, /* origin XY of hit box relative to window TopLeft */
-199, 7, /* hit box width and height */
GRELWIDTH, /* gadget flags */
RELVERIFY + GADGIMMEDIATE, /* activation flags */
PROPGADGET, /* gadget type flags */
(APTR) &ClipImage4, /* gadget border or image to be rendered */
NULL, /* alternate imagery for selection */
&ClipIText6, /* first IntuiText structure */
NULL, /* gadget mutual-exclude long word */
(APTR) &ClipClipYSIZESInfo, /* SpecialInfo structure */
YSIZE, /* user-definable data */
NULL /* pointer to user-definable data */
};
#define ClipGadgetList1 ClipYSIZE
static struct NewWindow ClipNewWindowStructure1 = {
114, 16, /* window XY origin relative to TopLeft of screen */
346, 76, /* window width and height */
0, 1, /* detail and block pens */
NEWSIZE + MOUSEMOVE + GADGETDOWN + GADGETUP + CLOSEWINDOW + ACTIVEWINDOW
+ VANILLAKEY + INTUITICKS, /* IDCMP flags */
WINDOWSIZING + WINDOWDRAG + WINDOWDEPTH + WINDOWCLOSE + ACTIVATE
+ NOCAREREFRESH, /* other window flags */
&ClipYSIZE, /* first gadget in gadget list */
NULL, /* custom CHECKMARK imagery */
"Edit Clipping Parameters", /* window title */
NULL, /* custom screen pointer */
NULL, /* custom bitmap */
350,
76, /* minimum width and height */
-1, -1, /* maximum width and height */
CUSTOMSCREEN /* destination screen type */
};
/* end of PowerWindows source generation */

View File

@@ -0,0 +1,242 @@
SHORT Col_BorderVectors1[] = { 0, 0, 59, 0, 59, 12, 0, 12, 0, 0 };
struct Border Col_Border1 = {
-1, -1, /* XY origin relative to container TopLeft */
3, 0, JAM1, /* front pen, back pen and drawmode */
5, /* number of XY vectors */
Col_BorderVectors1, /* pointer to XY vectors */
NULL /* next border in list */
};
struct IntuiText Col_IText1 = {
7, 0, JAM1, /* front and back text pens, drawmode and fill byte */
13, 1, /* XY origin relative to container TopLeft */
NULL, /* font pointer or NULL for default */
"Save", /* pointer to text */
NULL /* next IntuiText structure */
};
struct Gadget Col_Save = {
NULL, /* next gadget */
9, 77, /* origin XY of hit box relative to window TopLeft */
58, 11, /* hit box width and height */
NULL, /* gadget flags */
RELVERIFY, /* activation flags */
BOOLGADGET, /* gadget type flags */
(APTR) &Col_Border1, /* gadget border or image to be rendered */
NULL, /* alternate imagery for selection */
&Col_IText1, /* first IntuiText structure */
NULL, /* gadget mutual-exclude long word */
NULL, /* SpecialInfo structure */
GADCOLSAVE, /* user-definable data */
NULL /* pointer to user-definable data */
};
SHORT Col_BorderVectors2[] = { 0, 0, 59, 0, 59, 12, 0, 12, 0, 0 };
struct Border Col_Border2 = {
-1, -1, /* XY origin relative to container TopLeft */
3, 0, JAM1, /* front pen, back pen and drawmode */
5, /* number of XY vectors */
Col_BorderVectors2, /* pointer to XY vectors */
NULL /* next border in list */
};
struct IntuiText Col_IText2 = {
7, 0, JAM1, /* front and back text pens, drawmode and fill byte */
17, 1, /* XY origin relative to container TopLeft */
NULL, /* font pointer or NULL for default */
"Use", /* pointer to text */
NULL /* next IntuiText structure */
};
struct Gadget Col_Okay = {
&Col_Save, /* next gadget */
128, 77, /* origin XY of hit box relative to window TopLeft */
58, 11, /* hit box width and height */
NULL, /* gadget flags */
RELVERIFY, /* activation flags */
BOOLGADGET, /* gadget type flags */
(APTR) &Col_Border2, /* gadget border or image to be rendered */
NULL, /* alternate imagery for selection */
&Col_IText2, /* first IntuiText structure */
NULL, /* gadget mutual-exclude long word */
NULL, /* SpecialInfo structure */
GADCOLOKAY, /* user-definable data */
NULL /* pointer to user-definable data */
};
SHORT Col_BorderVectors3[] = { 0, 0, 59, 0, 59, 12, 0, 12, 0, 0 };
struct Border Col_Border3 = {
-1, -1, /* XY origin relative to container TopLeft */
3, 0, JAM1, /* front pen, back pen and drawmode */
5, /* number of XY vectors */
Col_BorderVectors3, /* pointer to XY vectors */
NULL /* next border in list */
};
struct IntuiText Col_IText3 = {
7, 0, JAM1, /* front and back text pens, drawmode and fill byte */
6, 1, /* XY origin relative to container TopLeft */
NULL, /* font pointer or NULL for default */
"Cancel", /* pointer to text */
NULL /* next IntuiText structure */
};
struct Gadget Col_Cancel = {
&Col_Okay, /* next gadget */
244, 77, /* origin XY of hit box relative to window TopLeft */
58, 11, /* hit box width and height */
NULL, /* gadget flags */
RELVERIFY, /* activation flags */
BOOLGADGET, /* gadget type flags */
(APTR) &Col_Border3, /* gadget border or image to be rendered */
NULL, /* alternate imagery for selection */
&Col_IText3, /* first IntuiText structure */
NULL, /* gadget mutual-exclude long word */
NULL, /* SpecialInfo structure */
GADCOLCANCEL, /* user-definable data */
NULL /* pointer to user-definable data */
};
struct PropInfo Col_Col_RedPenSInfo = {
AUTOKNOB + FREEHORIZ, /* PropInfo flags */
0, 0, /* horizontal and vertical pot values */
-1, -1, /* horizontal and vertical body values */
};
struct Image Col_Image1 = {
0, 0, /* XY origin relative to container TopLeft */
263, 7, /* Image width and height in pixels */
0, /* number of bitplanes in Image */
NULL, /* pointer to ImageData */
0x0000, 0x0000, /* PlanePick and PlaneOnOff */
NULL /* next Image structure */
};
struct Gadget Col_RedPen = {
&Col_Cancel, /* next gadget */
32, 12, /* origin XY of hit box relative to window TopLeft */
271, 11, /* hit box width and height */
NULL, /* gadget flags */
RELVERIFY + GADGIMMEDIATE + FOLLOWMOUSE, /* activation flags */
PROPGADGET, /* gadget type flags */
(APTR) &Col_Image1, /* gadget border or image to be rendered */
NULL, /* alternate imagery for selection */
NULL, /* first IntuiText structure */
NULL, /* gadget mutual-exclude long word */
(APTR) &Col_Col_RedPenSInfo, /* SpecialInfo structure */
GADREDPEN, /* user-definable data */
NULL /* pointer to user-definable data */
};
struct PropInfo Col_Col_GreenPenSInfo = {
AUTOKNOB + FREEHORIZ, /* PropInfo flags */
0, 0, /* horizontal and vertical pot values */
-1, -1, /* horizontal and vertical body values */
};
struct Image Col_Image2 = {
0, 0, /* XY origin relative to container TopLeft */
263, 7, /* Image width and height in pixels */
0, /* number of bitplanes in Image */
NULL, /* pointer to ImageData */
0x0000, 0x0000, /* PlanePick and PlaneOnOff */
NULL /* next Image structure */
};
struct Gadget Col_GreenPen = {
&Col_RedPen, /* next gadget */
32, 24, /* origin XY of hit box relative to window TopLeft */
271, 11, /* hit box width and height */
NULL, /* gadget flags */
RELVERIFY + GADGIMMEDIATE + FOLLOWMOUSE, /* activation flags */
PROPGADGET, /* gadget type flags */
(APTR) &Col_Image2, /* gadget border or image to be rendered */
NULL, /* alternate imagery for selection */
NULL, /* first IntuiText structure */
NULL, /* gadget mutual-exclude long word */
(APTR) &Col_Col_GreenPenSInfo, /* SpecialInfo structure */
GADGREENPEN, /* user-definable data */
NULL /* pointer to user-definable data */
};
struct PropInfo Col_Col_BluePenSInfo = {
AUTOKNOB + FREEHORIZ, /* PropInfo flags */
0, 0, /* horizontal and vertical pot values */
-1, -1, /* horizontal and vertical body values */
};
struct Image Col_Image3 = {
0, 0, /* XY origin relative to container TopLeft */
263, 7, /* Image width and height in pixels */
0, /* number of bitplanes in Image */
NULL, /* pointer to ImageData */
0x0000, 0x0000, /* PlanePick and PlaneOnOff */
NULL /* next Image structure */
};
struct Gadget Col_BluePen = {
&Col_GreenPen, /* next gadget */
32, 36, /* origin XY of hit box relative to window TopLeft */
271, 11, /* hit box width and height */
NULL, /* gadget flags */
RELVERIFY + GADGIMMEDIATE + FOLLOWMOUSE, /* activation flags */
PROPGADGET, /* gadget type flags */
(APTR) &Col_Image3, /* gadget border or image to be rendered */
NULL, /* alternate imagery for selection */
NULL, /* first IntuiText structure */
NULL, /* gadget mutual-exclude long word */
(APTR) &Col_Col_BluePenSInfo, /* SpecialInfo structure */
GADBLUEPEN, /* user-definable data */
NULL /* pointer to user-definable data */
};
#define Col_GadgetList1 Col_BluePen
struct IntuiText Col_IText6 = {
3, 0, JAM1, /* front and back text pens, drawmode and fill byte */
17, 38, /* XY origin relative to container TopLeft */
NULL, /* font pointer or NULL for default */
"B", /* pointer to text */
NULL /* next IntuiText structure */
};
struct IntuiText Col_IText5 = {
4, 0,
JAM1, /* front and back text pens, drawmode and fill byte */
16, 26, /* XY origin relative to container TopLeft */
NULL, /* font pointer or NULL for default */
"G", /* pointer to text */
&Col_IText6 /* next IntuiText structure */
};
struct IntuiText Col_IText4 = {
7, 0,
JAM1, /* front and back text pens, drawmode and fill byte */
16, 14, /* XY origin relative to container TopLeft */
NULL, /* font pointer or NULL for default */
"R", /* pointer to text */
&Col_IText5 /* next IntuiText structure */
};
#define Col_IntuiTextList1 Col_IText4
struct NewWindow Col_NewWindowStructure1 = {
175, 45, /* window XY origin relative to TopLeft of screen */
312, 93, /* window width and height */
0, 1, /* detail and block pens */
MOUSEBUTTONS + MOUSEMOVE + GADGETDOWN + GADGETUP + CLOSEWINDOW
+ VANILLAKEY + INTUITICKS, /* IDCMP flags */
WINDOWDRAG + WINDOWDEPTH + WINDOWCLOSE + ACTIVATE
+ NOCAREREFRESH, /* other window flags */
&Col_BluePen, /* first gadget in gadget list */
NULL, /* custom CHECKMARK imagery */
"Edit Screen Colors", /* window title */
NULL, /* custom screen pointer */
NULL, /* custom bitmap */
5,
5, /* minimum width and height */
-1, -1, /* maximum width and height */
CUSTOMSCREEN /* destination screen type */
};
/* end of PowerWindows source generation */

View File

@@ -0,0 +1,223 @@
/* XPM */
static char *noname[] = {
/* width height ncolors chars_per_pixel */
"400 200 16 1",
/* colors */
"` c #66686A",
"a c #797979",
"b c #929291",
"c c #43444A",
"d c #758A74",
"e c #F2F2F2",
"f c #D1D0CE",
"g c #066906",
"h c #065506",
"i c #53535C",
"j c #0C0D0F",
"k c #A3A5A2",
"l c #2D332E",
"m c #C3C4C1",
"n c #B4B4B2",
"o c #07840A",
/* pixels */
"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjljjjjjjjjjjjjjjjljjjjjjjjjjjljljjljljjljjllljljclljlllljlllljlllllllllllllllcicl``clcllclclllclclclcclclclcccccccccccccccccccii`iiccicicicciiciiiiiibiic`iii`a`iiii`icaii`iiii`iiii`ii`ii`iii```iii`i`ii`ii`ii`iiii`iii`ii`iifi`ii`ii`iiiiiiiiiiiiiiiiiiiiii`iciibicicicicciiccciiibiicciiiiccccbicicccccccciccclcccccclc`aiciiiciccclilccccccccccclcccacccccccclccclcclccc",
"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjljjjjjjjljjjjjjljjjjjjajljjljljljljjjjljjljc`baljjllcljjcjlljllllllllllllllllllllllcclllllllclllcclcllclclccccccccclccccccccccccicciicciicicicic`cciiciciciciacicii`iiiiii``iiakii`iiii`ii`ii`iiii`bkb`i`ci``iiiiii`iii`ii``i`iiiiiaiiiiiiiiii`iiiiiiiiiiiiiiiiiiiiiciiciciicicciciiiicllic`iciiiicicciliccccccccccccc`ccccliccccccccciciccclccccclclclclcclccclclclllccclcllccll",
"ijjjjjjjjjjjjjjjjjjljjjjjjjjljjjjjjjjjjjljjjljjjjjjljljjjjjjjljjjljljljljjjjlljljljljcclljllllljlllljllllllllllllllllcclccclcjcllclclclclllcclclcccccccccccciccccciiic`a`icciiccciciiiiiiiiibi`iiiiii`ii`ci`iii`ii`i`iiiiiiiii`iii``ici`i`i`i``ii`ii`iiiiiiic``iiiiiiiiiiiiiiaiiiiiiiiiiciicicii`iiiiiliiccicicccicccci`ccicccicccclccinccccccccclcccaccccccclccccccccccilcl`lllccclcclcclcllcllclcccclllilcllci",
"jjjjjjjjjjjjj`cjjjjljjjjjjjjcljljjjjjjjljjljijjljjjjjjjljljljjljljljlljljllljjljllflcjljllljljlljllllcllllllllllllcllllccllcc`clclllcllcclclcccclccccccccciccciciccccccic`iciic`iiiiciiiiiiiaiii`iii`i`icak`c``i`iiiiii`ii`i`iii`i`ii`iiiiiiici`iii`ii`i`ii``iiii`c`iiiiiiiii`iiiiiiiiciiiiiiiiiiiccccciccicicciiccccciaillcccciiciccclcccccccccccccc`cclclccillccllcliibilikaicllcclccccclcccclcccccllccllcclcl",
"jjcjjjjjjjjljjjjjjjjjjjjjjjjljjjljjjjjjjjjjjljjjjjljjcjjjljjljjljjjljjljljjjlljllljlllcljllllllllllllcclllllllllclllcclccibccclclcclcclcllicicccccccclcccccccciciicciccciaaiciccciiiiiiii`ciiiiii`iiiii`ic`iiiiiiii`ii`iiiiiiiiii`iiiiiciiiii`i`iiiii`ii`iiiciiiiiiiiiiiiiiciiiciiciciiccicciiiiiicicc`cccccccicccccicciiccicccicclilccccccclccccclccllcccilcccclcciclccciclcclccclccclclllcllcllccllcccclaacccl",
"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjljljjjjjjjlljjjjljljjjjjljjljjljljlljljlljlllllljajljljlllllllllllllllcllllllllclccilcicclc`clalcclclclcclcccicclclccccciiccicciccciciiiiiiciib`iiiiiiiiiii`iiii``i`i`iiiiiiii`iiiiiiiiiiiiiiiiiibaiiici`iiiiibiiiii`iiiic`kaiiiiiiiiiiiiiciiiciiiciiciciccicciiiiciiiciccicicccccccciclcccccciiccccaciclclcccciilcccclcclcclcllclilacclcccclccclclcccccclccclclccllcclllllkblllc",
"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjljjljjjljjjjjljljjjjjjjljljjljjljljlllljljljljjjjjljllljcjllllllllllllllllllllccclclabclccccciccccllclclcclcclclccccccccciiaiiicciciiicccccciiiiiiiiiciiiiiicii`i`i``i`iiiii`iiiiiiiiiiiiiiiiiiiiiibiciiiicciiii`iiiiiiiiiie`i``ic`iiiiiiiiiciiciciiciciciciciiiciic`cccclcccccccccciccccccciccciicilcillcccccclciccccclclccclibaili`lillccccciicliccccccclcccllallclliiiclcliilcll",
"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjljjljjjjjjjjljjljjjljjjjjljjljljlllllljllljlclllllljlllllllllllllllllllllllllcccclccliiccccciccccclclcclccccccclcciccccciacciciiiccci`iiiiciiiiiiiiiiiiiii`i`c``````i``iiiiciiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii`kciiiiiiiiii`c`iciciiiiiiciiiiiiciccicicicciciiiiii`ifcccciccicccccccccccccccclccccccclcclccclccclclclcllilclcclcllclcliilclclclccicccccccccllllcecclclliaacllcllclc",
"jjjjjjjjjjljjjjjjjjjjjjjjjjjjjjjjljljjjljjjjlljjljjjljljjlijjllllllllllllljljajlljlalllllllllllllllllllllccccclllccclclccccccccccclcccccc`clcccccccccccicacicciciciciiiiiiib`iiciiiii`c`iiii``iii``ii``ciiiiiiciiiiciiiii`biii`iiiiciiiiciiicib`iiiiiiiiiiiiiiiiicii```cccciciciciiiiiiiciiiciiccccccccccciicciccccccccccccciccccclccclcccllccclclc`ccclcclcccccclcccllclccclclllcllcliccllclmccclcccl`lclclclll",
"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjljjjljjjlljjjllljlljjjljljjjljljlcllllljcljjcljlllijllllllllllllllilcllcccccllicllllclcllcclliccccclccclcccccccccccccccc`iciicicciiiaiciciicl`ici`iiiiiiii`ii`i`ii``iiiiiiiiiiiiiii`iiiiiaciiciiiiiiiciiiciiiiiiicici`ciiciiiiciicciiiciiciciiiciiiiiii`cbi`liicicccccccccclccccccccclclccccccclcilccllccccllcclcccclcclclclllllcllllcllllllclcllccccclllcllilllclllclilillccll",
"jjjjjjjljljjjjjjjjjjjjjjjjjjljjjjljljjjjjjjjlljjljlllljllljllljlcljjljljcjlllljcljllllcllllllllllim`lljccllcclcbacllcllclccliclcccclccccccccccccccicciciciiciiciiiiiibiiiib``iiii`i`iiaii`ii`iiiiiciiiiiiiiiiicciiiiiii`iiiiiciiiiciciici`cciiciciiiiib`c`aaicciicicciccccciiiiiiiicciiicciilccccclcccccccccccclccccccclccliccccclclclcillccccllcclclccilcccclclcclcccclclclclllcllllcclllllllclllcllcllclcll`cc",
"jjjjjjjjjjjjjjjjjjjjijljjjjjjjljjljjljjjljjjjjjcjljljlcjjlcljlljkclllllllcllllljllllllljllllllllllliiccccclllllcccllcclcclclclcicccccclcclcccccccicccciicciciiciiiicc`ciii`ciiiiiiiiii``ii`iiiiiiiicii`i`i`iii`iicic`ii``iiiiiiiiiiciciciiiicc`ciicici`cc`iiiciciicicciicicci`iiiiiciciicicccibiccccccclcccccclclcclclcclccicclclcicclikclcllclllcllcllclccccllclclcliclci`cllclllillliccclcllclclbilllclllclcal",
"jjjjjjcbljjcajjjjjjjljjjljljjjjjljjjjjjljljjljjjlljcjllljlilllllaljlljjl`mllljcillllclllllllllllcllclllciiilccclllclclclcclckaclccccccccclccccccccciiciciiciiciiciiiiii`ic`ii`ii`ii`````i`iiiiiiiiciiciiiiiiiiiiic`ibiiciiiiiiiiicicicicccicicicciciccccicccciiicccciccciccciiiiiiiiciccii`cicbicciccciiciclcccccccclcclcccccllcclllliclclcccccclcclcllclcccclcllclclccllc`lllcllcll`llllllcllllllilllllllclcclc",
"jjjjjjjljjjlijjjjjjjjljjjjjjjjljjjjjlljjjjljjljljljajljljlljlljcljjlllllljlljijjlllllllllllllllcjcllllaclclllllcccclccclllccclcccccccccccccccccii``a`cccciciciiiiic`i`baba`iiii`ii```ii`ii`iiiiiiiiicciiccciciiiic`ia`iccii`c`iiciciccccccccbcccccic`iciciiiiccciccicicccccccccciiiiciccccccciccccccccccciicii`a``icccccccilclclciaa`iiccciclllcllclcllcllcccllllclllcllllclclcllllamiccaclllllccllllccllclcllcl",
"ljjjjjjjjljjjjjjjjljljnjjljljljjljllcjljjjljjjlbjllblljljjjljlcljclljlljlljclikllljlllllllllllllcljclccccccccllclllllcccccclcclcccciccciccciabbkakbnaccici`iciiiiiiic`bbnnnnkbaa``iiii`ciiiiicici``ic``ciiiaiiiiiiiciiciciiiiiiicccciciciiccbcciiccccccciccciicicicicccccccccicccicccccccliccicliiccccici```iabkbaccccccccclccclciammnbbbaaicclcclclclclllllllllllclllllclllllllllccijlakillcllllllclllllllcjcll",
"jjljjjjjjljjjjjljjjjjjjljjjjjjljjjjjljjjljjljljjljjijjljljl`liklljljllllllillljlllllllllllllllllllclllccccllccclcccccllcclcclccccccccciii`abnnbknmnmblciiibiiciicik`i`nbkmnmmnmnnk``i`niiiiciiiiciicccicccibciciiiciciccciciiciccicicccccccciccccccicc`ccccicibfcccccccicccccccccccccccclc`cclcclcci`abbbbaii`nnk`ccccccclllc`cciiknnnnbbakbkkicllclllclclllllclclllcllllclllllllllllclccllcllllllllkalllcljclll",
"jljjljjjjjljjjliljjljjjjjcljjjjjjljljljljlljjjljljljlljlljlijblljljlljljllcjllllllliklllllllllcllllclccccccclclcccclccclccclcccclccciiaa`babnmnnmnnmkjiiccacciiiiiiiiakkknmmmmmnmnkkbbaiibciiccciciiccccccccccciciicicciccccccciicccccccccccciiiilicicccccccciiiilcccccci`ailciclcccclcccckbcllclciabbkkb`icianmnkcccclllclccccii`ammmnbabknkkaa`iillclllcjcclllllcllli`lllllllllclclllclllllllllllllljcllclllll",
"jjjljjljlljljjjljjjjjjljcejjlljlljjjjjjjjjjjjlljjljljljljljllkijlllllllcjkllllcllllcallllllllllllclcclilcclclclcllcccllccccccccccc`bk```baabnmnmmmfmklciiciiiiiciiciiakbbknnmnmnnnkbbbbaknicciiiicccciiiccicciccccciicciiccicccccccccccccccccccccicililccccccciiccicccccciiclcclcccclilclliclccli`abbbnkkacciaknmkllllllclllcccii`amnnnnbbakbk`i`aaa`ccicclllcclcljclllclllllllllllllclllccllcllcjcj`alllllllcll",
"jjjjljljljjjjjjjjljljjjjljjjjljjjjlllljlljjlljjlljljljlllllljilljllljlciacjlljb`llllclllcllllcclclllccciccclclcccclcccccclccllc`aabnkii`bbabbnnnnnmnbljiiiciiiiii`i`i`kkkbknmmmnmnnbbknkak`iccccicicccccccccccccicccccibccccccclcciccccccccccccciciicni`ccccccccccccccclcclccclcclacclcclclliiciabbbbbbnb`cc`bkknnlllllclcllccc`iiamnknnnkaaknaiiabbabbkkcccclccjcclllllllllllllllillllllcllcccllllccelllccclicl",
"jljjjjjljjjljljljjjjjjljjjjjljbjljjjjjjljjljjlljjljljlljljjljljlllllljlllclllcjllllllllllllcllllll`ccilicccclclc`illcccccccci`bnbaakk``abbb``knbnmmkbllciii`i`i`i`i``akbbbbkmmnnnnbbkkkabnmnb`icccccccciccccccccccccccc`ccccccccciicccccccccccciccccciilcccccccclcclclclcclcclccclicllcllcc`aiiabbbkkbakacl`bnnknklccllllcclciiii`bmnknmmbaabka``akaaaakkicllclccibclllllllllllllc`lllllllcllcllllllcjlccclcc`ll",
"jjjjljljjjjjjjjjljjljjjljlljjjljljljljljljlljljlljllljlljlcjllllllllllllljcjllmclllljcllllccllllcclcccccclcccccccccclccccciibnmmaaabbbbbbbb``bmbbnmnbljc`ii`ib`iikb``bnkbabbknmmmkbnnkbbbkmmkkaccccccccccccccccccccccclccccclccclcicccclclccclciic`lccciccccccccclclilccclcclcllcllllc`cc`abaliabkkkkkabiciabnmnfnlllllcllllii`i`i`nkbbmmnbbabaakbbba`iknbbbciclcl`llljcllllllllllllllllllllcllllclljclcclllclll",
"jljjjjjjljjljljjjjjjlljjljjljjjljjjljljliljljljljlljlljllllllljljljllllllllcllallllclllllcbkbaclcciillclcccccccclcccccccciaaaknknbai`bbbbbbb`bmnkmnnalliii`i`aiii`ii``bbbbbbnmmnmmbkkkbbbbnmnnnbaiccccccccccccccccclcccillcccclclccllcclcclclccccclciliccclclclcclclcllclcclclcllcilclbaabb`icaakbbknkbaii`abknmnbclllccllllii`iiiibabbbkkkaa`abbbbkbaaknnkmnalclllclclllllllllllljllllllllccllclljlclclllclclll",
"jjjljjjjjjljjljljlljjjljlicjljlllljljli`cccjl`cjljlljlllljllllllllllllllljcjlllllllllllllliclclclcmbclicccccccclccccccci`bkbbbbbbaaaabbkbbbbabnmfnbacljici`iiii`ici`iiiaabbbkmmnmnbbbababbnnmknnkbiclc`acccccccclccccclccclccclcllclccccccclccccccicllciccccccccllcclilccllclclclcjccababbicc`bbbbbkknbac`ababbaicllllllllllcii`i`iiiababbbaaaabbbkabbabnnnmmfna`acclclllllllllllllllllllllllllclcalllllclclllll",
"jjjjjjljjljjjjjl`ailjljjjljjljjljlc`aabkbaba`aiclljllljljcb`ljlllllllllllclllclillllclllllcllclcililclkclcccccccccccccannbabbbbaaaabbbbkkkkbbkmnbiljlllciiiiic`i`i`iiillcakbbknfnkbbnbkbabbkmnnnknnbilccccclccccccccclcaacllcllccclclllcllclccccclclccccccccclllcclclbclclllcllllccl`aaabaicabkkbbkkknka``bkbbilljlllllllllcciiaaijlljcabaaaaaabbbkkkbbknmnnmnnmbillccjlllllllllljlllcllllllllllllllllclllccllll",
"jljljljjljjlljljcjljjljljjlljljc`bbknnkkkkkkkbbbbbcjllljllllllllllllljlllllllllcclllclllllclllcacclcccclcliliclcclcc`mfnnmkbkkbaai`a`aakmkkbikmmlllljllciiii`iiii`iin`iljcbbdbnmnbbbmknnkaaakmkmmnbbbilclclclclcclclk`abilcaclclcllclcclicccccclillcccclilccclclllclllclllcclllcllibbbaaailiakkkkbbnkkk`bbbaballllcllllllcllci`a`lljlllcba`c`a`aakmbkbabmmnnmnnmbacllccllllljllllllllbjlljljllllllclllllllclllll",
"jljjjljljjljjljjljljljjjjljjlc`akkkkbkmmnnmnkbkkbkb`cjjllllllllllllllcllllllclacjcllllflclllclc`cclliiicclccclciaciabkkmnmmkkka`cc`a`akbnkkb`knkjllljlll``iiii`aiiiiicccllakkkkkkbbbnnmnmkaabnmnkbbkkbiccccliacllillilccccllli`llllcllllcccclllcailllllcllclcclcclccllllclllllllliabka`i`clibbkknbbkknkbkkbbbillllllllllllllc```llllljjlb`cci``abbknkbianmnnmmnnnallilllljllllcjllljllllllcllllllllllcllllllijjl",
"ljljjjjjljjljjljljjjjjlljljjibbkmnnkknnfffmnnknnnkbaa`clllllllllllllllllclilllllcccllclclcllccccccclcccccccclcic`cannbbmnnmnbaiiii``akkdknkaabmblljllllciiiabknmniiiiiijljannkkkbbbkkmmnmk``bbkkbbkkkkkaclcclclclclcllclbilcclllillllccllccclclcclcliccll`llilcclllllllclllllllliabba````ccabbbkknbbkkbknkbbbiljcljcljcbnkbabballlljlllc`iii`a`bkbbknbabnnnnmnnnnalcicilllllljllllllljclljljllljljjclllllllla`ll",
"llljljljjljjljljjlj`ljljljlikbbmnfnnmmnfffmnmnmmmkkbkbiiljlllllllllllllciaiclcllllllclcllclccccclcccclcclaclcilc``bknnbkmnnnka`bba`adbkbbkbaabmkcljllllciicbnmnnkiiiiicljcanmnmnkkbbkmnnn`ibbabbbknkabknbclclllclllcllclcllllllcllcclllllilllilllllliclllllcjliccllclllclclllccci`aa`i`aii`bnkbkkkbabaakbnnkkacllllllc`knmkbbbbljjjjjlj``abba``bkkabkaaaknmnmnnnbacli`acllljllllljlllllllllljlbblljllljcllclabll",
"jljljljljjljljjljjl`jjljjcabkkbefmmfnfefefffmffmfmfnkkbaillllljlllllcllll`llllllajiclllclcccccclcclcccccc`lciccakbbbknkbnnnmnnnnbaabbbbkbb`iadmmaclllllcclcaknkmmkiiiiicc`knkmmmbkbnnnnnbi`bkbbkbkbbbaakkaiclcclclllcclllcclllllllllllcll`ill`cllcllcllcikllillc`cccclclllllcciii`aa``iii`akkkkbaaaaiakkbknknkaallllcabkknnkabkallllllibkmka`aaabkbbai`akmmnmnnmballcibbillcljllllljlljljlllljcjlllljlllcjlllljl",
"jlljljjjjljljjljlljljlajl`bkkkkmffffffeffefffmmfffmmnmkbbillllllllllllllcjcllclllilllilclcccccccllclcccccccclcakmnbbbbbkbkmnnmmbabnkbbbkk`cc`bmmmb`ciia`iii`aabnnmaa`c`abkknmnmmbbknmmnkbiababbbaba`ba`aakk`clclllllciccllllcllclllllllllclllllllllclllclllllllliclclcclcclli`aaaaaa`iclc`bbnnkbaiiiibnbnbbknkbb`ccci`knnknnkbbbb`cjjikfmnbabnnbakkk`li`knmnmnnnb`icccaabclilljll`llllllllljllcljlljlljlllllljal",
"ljljjllljljjljljjjljlabliakknmknmfffefmffefefffffffffnmkkailllllllllllialclcllilcllc`jicccccicccccccclcccciccbnnknnkbbkbbknnnmnbbkmmnkbbbiccabnnmmnknkb`ccii`abmnbbbmknnmmnmmmnmkbkkfmnkaa`aabaaa``ia`akbbkkacllccllliillllllllljiaaillclllclllcclllllllllllllclclllllcllcciaaabkbb`iicciabbkkba`iiiaknbmkbbkkbabknbabnknkknmkkbkabbkmnknnabnmmkbbbbiliabnmmnnnnbbaicii`akallllljilljjllllicljjlljljcljljllllcbl",
"jljllllcjjljljljlljlljllbbnnmmffffeffeefeefefeeffmmefmmknkbclllllllclllclllclclccccccicccicccclcccccccccclccbnmnnnnmmnbbbbbmnnkknmnnfnbb`i`aabnmmmmnnnbaiii`abbkkbkkknkmmfkmnmmmnkkknnmnaaabkkbaaiii`bknbkbkbcllclclclblllclllllllllllllclllllllcjllclcllllllllllllllllllliabbaaaaa````a`abbkba`a```abbknnkbbbkknkkk`bnmnmnnknnmkbkbabnmnnbnmknfnka`iiaabnmmmnnnnbaci``aabkaljllljlljcljllljllllljlliljlljlljjll",
"llljljjjljljjljljljjljc`bkbmnfffefeeeefeefeefffeefffmmnnmnkaclllclllclllllclccccccclccccccciccccccliccclbccanmnmmmnknmnbkbbkmnnnnfmmnmnbi`abbaknmnmnnkb``iai`aa`aabknmmnmnnnmnmmmbkbkfnnkbakmnabaabaabnakbbkbbilllllllllllllllllllllllllllllllllllcjallllllllllllllllllllinkbabbba`iaaaa`akbb``````abbbbkfmbabnmmnbakknmmnmnmnnnmkbbbbknnnnnnnmnnmbiiabbakknmmnnkb`````iaa`ailjlljljlljlljlljljlllljljljiclllljl",
"jljljljljljljljljjllljlbknkfnffffefeeeeefeeeeefeeeefffmmnkkbillllllllllclijcclclclccclclccccccccicinacciiibnmmnnnmnnnmnkbkbamnkmnmmnmmnabdaabbbbmmnnnba``iaii``ii`bnknmnnmnmmmmnnkkbbknmmkbknnbkkbbbabnbbkkbbnaclllllllllllllllllllllllclllllllllllcllllccclllllliclllllikfkbaaaaa``aba```baa`a`aaaabbbbkmnnknmnnkbbknnnnmmmnnnnnnnkbbbknnnnmmmnnnabaaakabbnnmnnba`````c``i`iicjlllljllllljllllijjcjlllllcjjjllj",
"lljljjljljljljljlcjjllkbknmfnffffeeefeeeeeeeeeefeeefffffmnkkbclllllcl`llllccccklllclclcclcccclcccccilccccbmmnmmnmnmnnnmmkkbbnnnbknmmnmkkmkaabbbaknnkkbaa```c``iiiabkbmmmmnmnnnnmmmkkkkknmnbnmkbkkkaa`bbbbbkkbnkacllljcllllllllllllllllllllllllllllllallllllllllll`cjlljlabkbab`aaa`iaba``abaaaa`aabkkkkkknnnmmnkbabnnnnnnmnnnmnknmnmkbbbnkkbnnnnnkbnnabbbbbbnnnkkaaiii`iaiciaailjjlll`bialjlljjclljljajjljjlljll",
"jlljjljljjljlljlcjllljanbmmfnffefeefefeeeeeeeeeeeeeeeeffmfnnk`clcllllaclllcclllclcllccciclcccccccccclicc`mmnnnmmnmnnnknmfbbbbdba`abbdbabkaaaabkbbnnnkbaa``ic`iiiaaabbmnbkkbbdbbkbbabkknmnmkmnnabkkbabbkbkbnkkkbb`llcjllllllllllljllllllllllllllllljlllclllljlllljlllcjl`kbbbbbaaaa```a```abaab`ii``aabbabbbbbkkai`bmnnmmmbbkbkmnnnnmka`aaa``aabbbbaknbabbkbbknmkb``a`ii``iiiaaacllijlcklllbljlljljlljijlljla`ljj",
"ljjllljljljljlljljjljibbknffmfeffeeeeeeeeeeeeeeeeeefeffemfmnkbclllcllclcicbcclillccccclcccccccccclcciclinmnnmnmnnnmmnnnnnnkaai``lllllcllllcllc`abknmnac`i`clclliaaaabnalllclclcclcllcc`kmmnnnkbbbkbkknkknkkkbbaa`iccclljlllljllllljllllljllllllllacljljlllllllllljllcliabnnbaaabbaa``````aababllllllcllllcllcciii`bnnnnnncllllnnnnnnnilcllllllcllllciadkbkkbbnnnb`i``iciilc`aaaaclealljllcecllljjjljljjljljjjjll",
"jjljljjjlljljljlljllclbbmnmffeefeeeeeeeeeeeeeeeeeeeeefefffmkkb`lclcllllclicciclccclccllccccccccccicccciknmnnmnnmmnnnmnnnkmnbiia`lllllllllllllllliaknnb`i`aclllli``i`abilllllllljllllllliknnnnkbbbbbbknnnkknkbkaiiaillljlllllllljlljlllllllljllllcjjlllcllllllljlllljlcabbbba`babbba```iaaaakkbllllllllllllllclicadkmnmnknlllllmmmnnnmijlllllllllllllccibbkkkkbknna`i```icli``i`aaclljjljljlljjlllljljlljjllllllj",
"ljljljllljljljlljifccibbmmfffeffeefeeeeeeeeeeeeeeeefefeffffnknaccclccclcccicclcllllclcccccccccccccccccanmnnnknnmnnmnmmmnnnnbi`nilllcllllllllllllliabbkb`aacllll```iiabillllllcllllllllllibnmnnbabbbknnnnnnknbkaiib`ijljcljlljljllllcljcljlllljll`cjlcjjlljllljlllllllibbka``bbbkbba`i``abbbknbcclclllllllclllllladnnnmnnncllllnnnnnnnallllllllllllllllc`bkknbbakbbaaaaaiiii```ciaalllllljljljljjjl`jljllljjjjjjl",
"ljljljl`llljlljljlcclaakmnfffffeeeeeeeeeeeeeeeeeeeeefefefffmnnacccccllccilcclclccci`cclccccccccccccccinknnmkkmmknnnnnmmmmnbaaakicclc``ai````illlllibbaabaalcllc`aai`abilllciada```aicllllannnmkbbbknnkkkkkbnbk````aklllllljlllllljlillijllljlllljlllllcjlljllllljljllbknbaa`kkbbkbai``abbbbbnbilclcccici`icccccllaknnnkkn`lclcknnfnmndlllc`````aaaaccclldbnnbbbabbaaaa`a`ai`aaiibb`jlljljllljljlll`ljljjjjjlljlj",
"jjljjljcjljlljlllllllcbnnmneemefeeeeeeeeeeeeeeeeeeeeefeeffmmnbbiccciccccccclcclcccccccccliclicccccicibknnnnnnnnnmnnnnnnmmkabbbbiliclnmmkkkbbkalcclcbbbbaaallllc`ab``abcllllaknffnnnkalllllnkmnbkbbkkknnkkkkkbb```i`alljllllljlljlllilljlljllljlljlllljllljlljljlllljakbkkkaabnmbababbbbkbbbbkacllccciiii``aablllccnkknnnkillcldnnnmnmblllc`kkkknmmnblcillbnnkbbbbabba```aaaaaaa`aabcjlljljljlljljjljjjljlljjjljj",
"lljlljljlljljlljlllllibnkmnmffefefeeeeeeeeeeeeeeeeeeefffeffmmkkaccccclcillcllclclccccccci`icicccciciakkbknkknnnnnknnnnmnnbadbkkilclcnnmkkbbkkbllllcabbkabblcllcaabaabkilcclakknnnkbkbcilllkbbbbbbbbkbkkbkkbbbaa`iaaaallljjllljljljlclljlllljlllllljljljlbcjllljljjj`nnkbknbbabkbaabkbkkbbbbbbalcllcciabb``bnnilclckkknkkniccccannnnnnalllc`bbbbnnmmnillcldbdnkdabbbbaaaabaabab`aabb`ljlljljljljljljljljjljjljljl",
"jjljllljljllllccjcljlcbmknnnfefeefeeeeeeeeeeeeeeeeeeeefffemmnkk`cclccli`clbcblilccccccccciccccciial`kkkkknkknnnnnkknnmnnbdaabbkclllcknmnkbkmn`cclliaabbbbbcllclabkdaabilllcbkkkmnkakaliilibbbakbbkbkkbbkkbkkba``ibbaailllljlllllllllljlljljlljljlllillllljlljlljllcaknnbbkkbaaa``abkkkkbbabaa`cllcci`abkkabkkclllcbkknkknilllcannnnnk`clcc`bkbabmnnkllccldkkbkb`abbbbbkbbbbbbbbaabknajljlljljljljljljjljljllljll",
"ljlljjjljljljlccjlllccamnnnnfemeefeeeeeeeeeeeeeeeeeeeeffmffmfnbacclclllillil`cclcclccccclccccciia`canbkknnnnmnnnmnnknnmkkiidnbbclccl`aa``i``illclc`abbbkkbcllllbbkb``b`llcl````a`a`illicl`bbbbkkabbbbbabbbbkb``i``aaaalljlljjljjljljllljljlljllljlcalljlljllljlibjcbkmkmkbab``iiabbbkbbkbabbaailllcci``iii`icllcl`kkknnnm`cllcannnnnb`lllli```i`ab`ccllccnfnnkdbabbbbkkbakbabkbaiabnkijjljljljljljljjljljlllljlj",
"lljlljcjlljlljclclljclamnnknnenefeeeeeeeeeeeeeeeeeeeeefemffmmnb`clcllcllcclccclicccccccccccccciiicinnkknknmnnnnnmnmnnnnkbcc`mnklccllllcllllclccll`kkkkbbkkclclcbbkbaabillclcclllclllllllidbbkbnkbkbbkkbkbbkbaii`aiabbklljlllljlljlllljljlljljljlljlcjljllljjjljljlbbannnmba`ii`akbbbbbbbbbkaad`lllclllllllcljlllidmkbnnmn`cllcannnnnb`llccclllllllccllcldkmmnnmkkbbbbkbbbbbbbbbb`babkaljljljljjljljjljllljljljjl",
"jjljlljljllljllljjcc`l`bnmnnkeffefeeeeeeeeeeeeeeeefeeeeemffnnnb`llclccccclccclciclccccccccicccciccknknkkknnkkkbknnnmnmnka``dnkkllclccllllllcllll`kmnkkbkkkclcllbkabbabclllllllllljlllllibkkabbnkknkbbbbabbkbai`aa`abkkbjljljljljljljljljljljljljljjlljljjlljlicjliakkkmnnkkacc`kkkkbbaababnkabalccclllllcllllllcdnnkkmnkkallll`nnnnnballiclllllllllllll`akkkmmnnkkbkkbbbabbabbbabbbbmnclljljljljljjljljljljljjjj",
"alljaklllljlllllllllllibknmnneefefeeeeeeeeeeeeeeeeefeeeffmfnmkbicccllclllclcliibcccccccciciiiiiic`nmnnnknnnbbbbkkknknmnkbbkkkbdccclcccllcijcjlcbnmnmnbbkbklllllbkbabbbilcclclllllcllc``kknnbbbkknmnbkkbabbbaa`aaabbabkncljlljjljllljljljljljlljljljljlllljljljjllkbbaannkknac`bkkkkkbbbbbknkbb`lclllllllllcllcibnmnkkmkkb`ccccannnmkbkllllclllllcllllidkbbknnnnnnkkbkkkbbbbbbbbaabbkmmaljjljjljjljljljljjjjjljjl",
"ljjl`ajljlllljlljllllliinbmnmmefefeeeeeeeeeeeeeeeeeeeeffmnmnnkblclccclccclilillccccccciciciiiicccamnmnknmnkbknnnkbbkkmmknmnmkballclc`aacl`ccibknnmnnmnkbbkclcclkbbbbab`lllc```aaab`iakkkbnmnkbbkkknbbkkbkbaii`babbbbakb`jlaaljllljljljjljljljljljljljljjjlljjljj`nkbbabkknk`cbkkbbkkbbabnkbbbb`lcllcaailllll`bbmmmknnnkkballlcibkkmnnmllclci`iiaaabbkknkbkbnnnnnnnnbbbbbbbbbkabbabkmnmmcljljljjljjljlljljljljjjj",
"lllljljlllbllljllllllllcaknknmffeffeeeeeeeeeeeefeefeefemmfnnnkacclccclclcccccccccccccccccciii`ciabnmmmnnnnbknnmnmmnkkkknnnmkdballcclbmn`llcll`nknmnknkmnbdlcllcbkbbbbk`lcllkkkknnmnkbbknbnknkbkbnkbbbkbakkaiabaabbbbbbabjljcljljlljjljljljljjlljljljljljljjljjclannbbaanbkacikmnkkbbkkbbnnnkbaacclcibbbilcclcaknmnmknmkbbklllccmkkbnkmclclcai``abbnnknnnkbkkknnnnnknkkbbbbbabkbbkbknmmkaljjlljjjlllljjjjjljjajlj",
"jljljccjllljllllljllilll`bbnmmfffefefeeeeeeeeeeeefffefenmfmnkbiclccclcccccccccccccccccccciiiiiii`bbknnnnknbbmnmnnnnnnkkkmnkaad`lcllcbkmk`cllll`knmnmnknnnkllllinbbkmnn`clllbnkknknnnkkkkbknnnkbbkkkbkb`iaba`abbbbbknnbbbllilljllljljljljjljjljljljljljjljjlljia`bnkbb`akab`aaknnnnbkbbaabnnbbbdllliibbbailllclabnnnmkbkkbkclcccmnnkkkniclcl`i`akbbknknknnbbkknnmnkknnkbbbabbkbbnknnnnmnnljljjjljljljljljjjjljjlj",
"klljljjclljlljllllll`cllcakbmmmfefmffeeeeeeeeeeeeefeeffmmfnnbailclccccclccccccccccccccccciiici`iabbbbkkbkkbnmnnknmnnnnnkkkbdab`lcccibknkn`clillakmnnmnkkmkllccinmnknmncjcccknnkkknmmnnbbkbnknnbbbkbabaciaaaabaabaknmnnbbilijljljlljjljjljljjljljjljjljljljjjljjaknkbbaaba``bknnnmnkkbbabbknkbbblllccbbbbailllcc`bkbkkbkbkklclccnnmnnknillcc`c`abbbknnnnnmkbkkknnnnnnnnnkmkbkmnknnmnknnmm`lljjjljjljljjjjljjcjljj",
"ljlllllljlcljcllllllillll`bbkkmmfffffefffeeeeefeeefefffmmmnkb`ccacclcliccclccccccccicciciiciciaibbbkbkbbakbmmbnnnknnnnnnkkkbbaiclllcbnmknncllllldmfknmnknkllllikbknnnniilllknnkkknnnmmnbkbnknnkkabbbaccaaaaabbabknnnnnnkallljjljjljljjljjljjlljljjjjljjljjjljlcbknkkkbbda`aknnnnnmnkbbbbbbbkbbalcclcknkkbaicllil`bkbbbkdmnlllclnknnnnk`llclii`bbabknkkknnbbbkknnnmnnknnnnnnkbkkknnknnmkkbjjjljjjljljljljjjanjjjj",
"llmjjljllllllilljlllllllllikbbnmmmfffffefeeeeffeefffmffmmnkbaicclcccccclccccccccccccccciiiiicc``bbkkknkbakbnnknknnkkknnnmnbbbaclcccibnmnmnncllclldmnnmnnnnllclckkkbkmmilllcknnnnbkknmfnnbkknkknnkabaic`bbbabbbbknmnknnnnkljjljljljjjljjljjljjijljljljljjjlljjj`ikkkbnkbaaadnnnkknmmkbbbbbbbkbballlclbbbbbabclllcidnkbbbbnmlccilnkkkknn`llccciabaabnmnnkmnnbbbbnknmmnkkkknmnkbbkbbnnnmnnnflljjljajljljjjjjljjjjjj",
"illllllllljllclllllllclllll`bbkmnmmfefeffeffefefmeffmffmknkaiclcclclcccccccccccccccicciciicici`aabbbkknkbabknnnkkkknkkkkkknkb`clcllibknnnmkkcllllcdkmfmnnkllllcbbbbabbclcllknnnnkkknnmnbbkkmnknnnkb`c`bbkbbbbbbbknnnnmnknlljljjljjljjljjljjljcjjjjjjjjljljjjllibkkkknnbaabknmnkkkkknkbkkkbbkknklcclcbkbbakdbilllliakkbabkncllllnnnkknkalllliiaaabbbnnnknmnkbbbkbknmmnkkknkbbkbbaabbknnkkniljjjjljjjljljjjjjljjlj",
"lcljlljlllllljlllllllclllillabbnknmmfmfffffffffffmefmnnnkkaicclcilccbcccccccccicciccciciiciiii`babbbbbbkkakkkmnnknkkkkkkknmnda`clllibbbbbakbacllcl`knmnnnklllc`nmb``bbcllclknnnnnnkknnkbbbknnkknnmna`bbbkbbbbbabkknnnnnnncjjjjjjjljjjjjljjljjjljjljljljljjljjj`anknnmnbbabknmmnnkabnnknmkkbaknkcllllbbkbbakaaillclibkbbbbkiclcckkkknkkaclll`bbkkbaabbkabkbbbabbkkbnmmnnkknmmkkkb`abbkkkbkbjjlljjjljljjjjjjjjjljj",
"cbjcjllljlllllllllllcllllllclcbbkkmnmnffffffemmmfnmnmknkkbiccccclccliclcccccccciccciccciiiiciciabaabaaabkbnkknnnkkkkknnnknkdakndbkbabbbbbnbkbbaaa`bkbkmfnmbkkbbnna`ammakaaamnnnkkkkkknnkkakknkkkkmnaabakkbbabbbkknnnnnnmkajjljljjjjljljjjjjjljiljjjjjjjjjljjcccknknknnbbdknnnmmnbbbknmmnnnkkbbbabababbbbbkkkbaaa`aiabakdnkdbdbbkbkkkkkkab``bnnnnbkbbbbbbkbkkbbabbbbnnmknnmknmmm``bnmkbkbknjjjjljjjljljljjljjj`jj",
"lljljlllllllllllllcllllllllllc`abbkknkmfmmfmfknfmmnnnkkba`cclliliccccncccccciicciccciciciiiiii`bbkbaaabbkbnnbkmkkkkkkbkbkkd`bknknnmnkabbnbkkbknbbbbbbbknmnnnnmnbkiannmnnnknnmnnkkkkkkkknnkkknnkknnnbbabbbkbbbbnkbknnmmmmnbcjjjjjjjljjjjlj`jjjlljjjjllljljljlliiknnnnnnkkbkknknfnkknknnnmmnmnmkkbbknkbaabbnknkbbbbaa`bbkbnkbkmnkkkkbbkbkkaabmkknnnnbbakkbkkkkkbakbbbdbmmnmkmnkbbcdnnmnknbkma`ijjjjjjljjjjljjjjljj",
"ljcbaljllllllllllclllllllclcllcci`bbnbkbnknnmkknkkmkkba`ilccilcclcicl`cccciclcliccicicic`icici`nkkkbaabbkbknkbkfnnkkbbkkbbaannknnnnnnbkbkmkknnkkabaaabbbknnnnmfnk`annnmmnnnnnmnnknnknkknnkkknnnkkkkkkbabkkbbbbbkkknmmnmmfkjjljjlljjjlcljjljjjljjljljjjljjlljii`nknnnmmkbbbbnnnmnknknknnnnnmnmnnnkkkkkbaabkmmnbbnbbaabbkbkkkkknkkkkbkkkkdabknknnnnnnbbbkkkbkkkkbaadbbbkknkkmmfkkibnknnnnknmajjjljjljljljjjjjjjjjj",
"lljci`cjlllllllllclllllllllccllllc``bbkkkkknknnkbnkba`icccccc`ccccccclcccccccaciciciciciiiiiiiankkmkbbbbbkbbkbbknnnnnkkkbaaknkknnnmmmkbbbnkbknkkbbabbbbbbkmmnmmmb`kmknnnmnknknnnkknnnnknknnkkknnnnkkmnkbbbbbkbbnnkkmmnnnnmjc`ljjjjjjjljjjjlj`jljjjljljjlljlj`c`nnknnnmkbbaabkbbknmnnknknnnnnmnmmnkbnkbbbkbnmnnknnkbbbbbbbkkbknnnnknkbkk`akkkknknnmnnbbknkbkkkkbaaabbabbknmnnmnk`kkknnnnnnbillljjljjjljjjjjjjjljj",
"jlljcillllllllllclclllllcllllcccclcliiaabbbbbkbabaaiiiiccccccacccclciciccccciaiccicicicici`iiibnnkfnknbbbkaaknkbnnnmnnnkkbknnnkknnnnmkbbbbkbbkkbaaabbbbbbknmnknkbbknnnnnmnnnnnmmnnknknkkkmnnbkknkkkknnkbbbbkknbkkkknnnkknfjjjjjljjlljjjjljjj`jjljljjlljijjjjccaknnkkknnkb`iaabknnmnnnnknnnnnnnnnmnbkkkabkbknmnkkfnkkkbbbabbbbbknnmnnknkaknknnkknnmnnbbbbkabkbbbadaabbaabnmnknkkaknnnnnnnnfkljcjljljljjjjjjjjjjjj",
"llllcjllllllcllllclllclclclclclcccclclcliiiai``icccccccccccibcccccccccccciciiiiciciciciciiiciinmnkmmnmkkbbbbbabbnnnmknnnkkknknnnnnnnnkkbabbbbkka`aabbbbbabnnnnkknnkmnnmmnmnnmmmnmmnnkkkknnnmkbkknnknnnnnkkkkbmmkkkkkkkkkbnjjjljjjljjjljljlljajljjjjljljjjljjjc`kmnnkknnnba```akmnnnnmnnnnknnnnnnmnkkkkbbkkknnnmknmmmnbbbkbbbbbknnmkknnkknknnknnnnnkkkbabbbbkkbiabbbbbbbdnnkkmbknnknnmnnmkmbjinijljljjjjjjjjjjjjj",
"llljllllllllllllccclllcllclclllcllcccccccccclcccccccclcccccc`lccccicciccciccicciciciciiiiii`ickmmnmnmnbbbbbclciicccilcciliiilciccicccccclcclicllllcclcccllciiciciiciiiiicciiiicci`iiclliiiciiccciiiicciiiccccamknkkbkbkkkblljljjljjjjjjjjjjljljjlljjljjjjjjlllinmmnnnknmkaacccciiiciiiiiiiciiiciiiicccclciiicc`cciccillccclclciiciclicliicccliiciccccccclccccllllciccccliiciiiakkknnmmnmnnkciijljjjjjjjjjjjjjjjj",
"ljlcljlllllllllllclllcllllccccccccclccllcccccccccccccccccccclccccccccicccicci`iiciiiicicii`a`ikmnmmmnkbabbijjjjjjjjljljjjjjljjjjjljjjjjjjjljljjjjjjjjjljjjljjjjjjljjljjjjjjjjljjjjljjjjjljjjljjjljjjjjjjjjjjjinnnkkbbbbbkbjjjjjjlljjjjjjjjljjljljjljajjjjjjljccknnnnknnmkbacjjjjjljjjjjljjljjljjjjljjjjjjjjljjljjljjjljjjjjjjjjjjljjljjjljjjjjljjjjjjjjjjjjjjjjjjjjjjjjjjjjjjlikkbknnmnnmkncjljjjljjjjjjjjjjjjjj",
"llllllcllllllllcclclclclccllclclclcclcccccclilccccccccccilicciccicccccciciciibiciciciiciiia``immmmnnmknnkkillljcccjljclljlllccjijljcllljljlljjljljjljlcjlllllllllcllljlcjljjljllljjlclljllilljllclljlcicjclclcknkkkkkabbbkljjjjljjjjjjjjjjjljjljjjjjjjjjjjjjjcianmnnnknmnbacjllclcjcjcjcjllllllllljllllccjlllllljljllcjjllllljlljljjljljjjjlljjjllllllllcjllljllclljjllljljjllabbbbbknknmkn`jjljjjjjjjjjjjjjjjjj",
"lllllljcllcllllccclllclcclclclclcccccccccmkcccilccccccccccccccicccciccccciciiaiiciiiiiiiciii`immmnmnnmmnnkclnmfffffffeeffmmffmmffmfffffmmffffeffemfffffmmmffffffffffffffffmmmffffffmffmmfffffmffffmffmmmmffmmkkmnnkbbnkabkjailjjjjjjjjjjjjjjjjjjjjjjjljjjjjjlcibknmknnnnmkdidkkkmnnnnmmmnkknkkkkkkkknkkkkkknknknnkkkkkkbkbknknnkkknnkkkbkkbbbbbkkbbbbbbbbnkkbbkbkbbkkkabbkbkda`dbbbbbbkbnmnljljljjjj`jljjjjjjjjj",
"jlllllcbccnnclclllklclllllcclcclcllccclcciclclciccccccicccccicaiccccciciicciciciiicicicii`ii`innmmnnnmfnmnilmffffeffffffffffffmffmmffffmmfffffffffffmfmmmmffffefffeffeffmffmmmfffmmmffffffffffffffffffmmfffffnbnnkkbbkkkbaljjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjlcibbmmnknnmkka`bnknmmnnnnnnknnnkkkkkbkknnkbkkknknknnkkkkkkbbbkkkkkkkkkkknnkkkkbbbbkbbbbbkbbbkkkbbbkkkkkkbbbbkkbba`bbabbbabaknniljjjjljjjjjjjjjjjjj`",
"c`iljllllliclclclkicllicllccccccccccccccaaiciclcccciclilcicccc`cciciccciciiaiiciiiciciiiii`i``nmmnkknmmmmmilmmmfffffmmffffffmmffmfmmfffmfmmfffffemmffffmmfffffffffffffffmffmmnmffmnmmfmmfeffffffffefffmmfffffkbknnmkbbknkbljjjjjjjjjjllcjjjjjjjjjjjjjjiljjjjliibknmkknnnmnnabkkkmnmnkkknknnkkkkknkkkkknkkkbkknknnkkkkkkbbkkbkkkbkbkkkkkkbkkbbbbkbbbbbkbkkkkkkbkbkbkbkkbbbkbkba`bbbbbbaabkknbjljjjjj`jjjjjjjjijjj",
"lljlcclllllllcccclcllcllccclclcccccclccccccclciccccccciccciccaccccccicicciibiiiciiiiiii`i``i``nmnnnkknmmmnicffffffffmmmmfffmmffmffmmfffffmmmffffffmefefmfffffffnfmmmmmmmmffffffffmmmfffffffffffmefffmmffffffmnbbnnmmkbbbknjjjjjjjjjjjjjjjjjjijjjjjjjjjljjjjjliidbnmnnnknmnnaaknmnnnkkkknknnkkknkkkkbknnknkkbbkknnkkkkkkbbnkknnbbbbkbkkbbbkkkkbkkkbbbbkkkkkbkkbkbkkkbbkbkbkbkkaiabbabkkkbbbbajjjjjjjbljjjjjjjljjj",
"llllllllcjccjlcllcclalccclclaccccccccccccccccccccciccicicccicbcicicicicicic`iciiiiiiii`iii`ii`nnnnnnknmmnmccmffffffmfmfmffffmffmfffmfeffmfmmffffffmfffmmmmfffffmmmmmmmmmmffffefffffmmffffmfffffffffmmfffefffmnkbkkmmnkbbbkjjjjjjjjjjjjjjljjjjjjjjjjjjjjjjjjjci`bbkmmnkknnnn`annnnnnnnkkknkkkknkkkkkkknnknbkbkkkkkkkkkkkkbnkkkkkbkbbbbbbbbkbknnkkbkbkbkbkbbbkbbbkkkbbbkkkkkkkbbibababbkkkkba`ljjjjjjjjjjjjjjjljjj",
"llllllcllclliccclllclccllccik`lc`ccicccccclccccccccciclccicccciciciciciciiccciiiciiiiiiiii`ii`nmnkkkknnmnnlcmmmmffmfmffffffmmffmmfffefffmffmfffmmmnmmmmfmfffffmmmfmmmfmmmfffffmmffffmmfffmmfffffffmmmfffmefmnnkkbbknnnkbabjjjjjjjjjjjjjjijjjjjjjjjjjjjjjjjjjlc`kkkbknnnkmnnaakkknknknnkknnkkknkkkkknmnnkkkkkkkkkbbkbbkkkbkkkkkbkbkbbbbkbbbkbkkkbkbkbkbbbkkbkbbkkkbbbbkbbkkbbba`abbbaabknkkb`ljjjjjjjjjjjjjjjcjjj",
"cllcclllllccccclclclccllcclliccciclcccccciccciccicccicaccciciciiciciciciiciiiiiiiii`i`iiiiiiibnmkkkkkknnnmcifmfmmmmmfmmffffmfffffffeffffmffffefmmfmmffmfmfefmmmmmmfmfmmmnfmmmmnmmffffffefmfffmfffmmmmmmnmfmnmnbkbbbkknnnkbljjcjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjli`bmbbbknmkkkkbannnknkkkkkknnnknnnkkknnnnkkkknknkkkkbkbkkkbkbkkkbbbbkkbkkbbbbbbbbbbbkbkbkkkkbbkkbkbkbbbbbabbkbabb`abbbbaaabkkkbljjjjjjjjjdcjjjjjjjj",
"lccllcilclllccclllclcccccccclcclccccc`biccccccc`ccicicfiiccciiliiciciciiciiciiciiii``iii`iiiibnmmnkkknnnkklcmmmmmmmmmmmmefffffefffffmmffffmfffffnfmfffnfmfffmmmmfffmfmmmffmnmmmmmnmmfffffmfffnmfnmnmnnmmmfnmfnbkkkkkkknnnmljjljjjjjjjjjjjjjjjjjjjjjjjjljjjjjlciamkba`knnnnbb`nknkkkkkkkkknmkknmnnnkkkkkknknknknnkkkkkknkkbknbbbkkbkbbbbbbkkbbbbbbbbbbbkkkbakkbbbbbbabbababbbbb`aba`aaaabbbbbjjjjljjjjjjjjjjjjjjj",
"lclccc``cllccclclccclccclcccccccccccccccbaiccci`cicicciicciciciciciciciiiiaiiii````ii`iiii`i``nmmnnkknnmnklammffmfmmmmmmmmffffmffffffffeffffemmmmffffffmmffmmmmffmffmmmmfffmmnmmnfmmmffffffffffmmmmnmnmmmfffmmnkkkknkbkmnnjjjjjjjjljjjjjjjjjjjjjjjjjjjjjjjjjcccbnbbabbbnnknn`nnknnkkkkkkkkknnnkknnnnknkkknnkkbkbbkkkkkkkkkkbbbbkkbkbkbbbkkkbbbbbbbbbbbkkkkbkkkbbbbabbabbbkbbkbbbnbi`ii`abkbbjjjjeajjjjjjjjjjjjjj",
"ccllllcclclcclcclcllcclccccclcccccccccciciicicccilckciciiciciciciiciiicicii`i`iiii`iiiiii`ii``nnmnnnnnmnnklammfffmfmmmmmmmffmmmmffmfffmfffmffnmmmfmfmfmmnmmmmmmmmmmfmmnmmmmnmmmmmmmnnmmmefffmnmfnnnnmnnmnnffmmkbbkkkbabmnkljljjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjl``abkbkbbbknnmm`knknnknkkkkkkknkkkkkkbkkkkknnnknbkbbkkkbbbbbbbkbbbbkkbkkkbbbbbbbbbbbbbbbbbbbkkkbbbkbbbbabbaabbbkbaakbiiii`aabbkcljjjjjjjjjjljjjjdkj",
"clllclclimalccllcclclcccclcccccccccccccccicccciiiciiccicciciciciiciiiiic`iakciiiiiiiiii`ii`iiakmmnnnnnnmnkjanmmfffmfmmmnmmmmmnmmmmmmmmmmfeffmmfmmffmmffmmmmmmmmmmmffmmmmmmmmmmmmmnmmmnnmmfffffmnmnmmmnmnnmffmnnbbbbbbabnmmcjjjj`jjjjjjjjjjjjjjjjjjjjjjjjjcljlii`knkbbbkkbnnn`kknnnnkkkkkbkknkbbkkkkbbkkbknnknkkbkkkkbkkkbbbbkbbbbbbkbkbbbbbbbbbbbbbbbababbkbkbbbbabbbbababbbbb``ka`icc``aabkljjjjjjjjjjjjjjjjjjj",
"lclcllcccclcllcclc`kcclcclccclcacicciliccccccccccicciciciciciciciiiciciiii`i`iiiiiii`iiaiii`iakmnmnmnnnnnblbmmfmfffmmmmmmfmmmmmffmmnmnmfmffmmmmmmfmmmffnfmmmmnmnmmmmmmmmmmmmmmnmmmmmmmnmmmmffmmmmmmmmmnnffmfmnnnbbbkkbbbbbcjjjjiljjjljjjjjjjjjjjjjjjjjjjjljjlc`aknnkkbbkbbbk`knnnnnnnkkkkkkkkkkkkkkkkkbbkbnkkkkkbkkkbkkkkbbkbbbbbbbbbbkbbkbkbbbbbbbbbbbbbkbbbkbbababbbbbbbbbkba`bb``lciaabkncjjjjjjjjjjjjjjjjjjj",
"llllllccccllcclccccciclccclc`iliccclccicicciiicccicciiciciiciiiiciiiiiii`iicii`c`iiiiii`iii``annmmnnnmnnnbjbmffffmfmmmnnmmmmmmmfmmffmmmnmmfmmfmmmmfnmfmmnmnmmmmffmnmnmmmnmmmmmmmmnnmmnmmfmknffmknnmmmnmmffffnmnnnkbbkbbba`ljjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjli`annnnnkbbbb`aiknnknknkkkkkkkkkbkknkkbkbkkbkkkkbkkbkkbbbbkbbbbbbbkkkkbbbbbbbbbbbbbbbbbbbbabkbbbkbbbbbabbbakbkbbbb`kbailciankkn`jjjjjjjjjjjljjjjjjj",
"clllccllllccjcilccllnacllicanaclccn`ccikaicccciicci`cciciciciciiii`iiii`ib`iiiciiiii`iiiii`i`knmmmnmnnmmmblkffffmfmmmmmmmnmmmmmmmmmmmmmnfmfnmffmmmmfmmfmmmfnmmffffmnmmmmmnmnmmnmmmnmmmmfnffffmffmmnmnmmfffffmnnnnnkbbakn``jjjjajji`jjjjjjjjjjjjjljjjjjjjjjjjl`i`nnnnnnbka`ciinnnnnknkkkbkbbkkkkkkkbkkbkbkkkbkbbkkbbkkkkbkkkkbbbnknkbbbbbbbbbbbbbbbbbbbbbkbbbbkbbbbbbbabbbkkkkka`kb`clciannkk`jjjjjjjjjjjjjjjjjjj",
"clclcclccclicllclcccacciccciicciicacccli`cccccccicimiiciiiciiiiii`i`i`i`iicii`iii`iiii`ii`ii`knnmnnnmmnmmblkmffmfmmmmnmmnmmmmmmfmnmmnmfffmfmmfmmmmmfmffffffmmffmffmnmmmmmmmmmmmmmmmnmmfmfmmmmmffffmmmnmffmffmmnnmnnkbbknblijjljjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjiiannnknkbbi`ciinnnnnkkkkkkkkkkkkkkkkkkkkbkkkkkkkkkbbkkkkkknkkkbkkkkkkbbbkbbbbbbbbbbbbbbbbbbbkkbbbkbkbbbbbbbbkbbbbibbicci`kknnnajjjjjjjjjjjjjjjjjjj",
"llcllclclcjcccclclcclcccbcccccccccicicicccciciiccccicciiciicicii`iii``iiiiiiicii`a`iii`iiiiiinnnnnmnnmnmnbjkmffmmmmmmmmmmmmmmmmmmmffffeffnmmffmmmmmmmnffmffnmffmmmmnnmmmmmmmmmmmmmmnnmmnnmmfmmmmmnmnnmmmmmmmmnmnnmnnkbbba`jijjjjjjjjjjjjjjjjjjjjjjjjjjjjljjjl`iaknmkkb`iiii``nnnkkkkkkkkkkkkkbbkkbbkknnmnkkkkkkkbkbkkbbbkkkkkkknkkkbbbbbkbbbbkbbbbbbbabbbbabkkbabbbbbabakbbbbbb`ab`````nnnkk`jjjjjjjjjjjjjjjjjjj",
"lcllccccccclclcccccccccciccccccccccccicciciccciciiciciciiciciiiiaiia`iiiiiiiiiii```i`iii`iiiikkkbmmmnmmnnalnfmmmnmmnmmmmmmmmnmmnmffmffmffffmmfmnmmmmmnmffmfmffffffmmmnnmnnmmmmmmmmmmnnnmmmmmmmnmmmmmmmnnmnnmmmnnmkmnnkabi`jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjii`nnnka`ic`a``innknkkkkkkbkkkkkkkkbkkkknkkkknkkkkbbkkbkbbbkkkkkbknbkkbbbbbbbbbbbbbbbbbbbababbkbbbbbbabbbbbabbabbbcibbai`akkmkkbjjjjjjjjjjjjjjjjjjj",
"lccllccclclccclccccccccccccicccc`ciliciccccciccccciciciciciiiii`faiii`iiiiii`ii`ii`ii`iiiiiiikmnkbmmnmmnfalkmmfmmffnmnmmmmmmmmfmffffffnmfmfmffmmmmmmmmmfmfffffffmffmmmmmmmmmmnnmnnnnmmmmnmmmmmmmmmmmmnnmnnnmmmmnnmnnnkba`ajjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj`i`nnbbaa`iaaa`inkkkkknkkkkkkkkkbkkkkkknknnbkkkkknkkkbkbbkbkkbbkkkkbkkknbbbbbbbbkbbbbbbabbbbbbbbbbbbbbbbbbabbababa``bba`aabbbnfkjjjjjjjjjjjjjjjjjjj",
"clcllclllclccclcclcccccccccclciccicccccciciiiciiciciciiciiiiii`iicciiiiiiiiiiiiiiiiiii`iiiii`nnmbbkmnmmnk`jnnmmmffmmnmnmmnmmnmfmmmfffffmfmfmffnmmmnmmmmfnfmfmfffffffmnnmmmmnmmnmmmnmnmmmmmmmmmmnmmmmmmmfnnnnnnknnfkkknn``aljjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjji``nnnbbbaaabaaikknkknnkbkbkkkkkkbkknkkknnnkkkkkkkbbbbbbbkkbkkkknkknkkkkbbbbbkbbbbbbbbabbbbbbbbbbbbbbbbbbbbbbbabba`aba`abbbkbakkjjjjjjjjjjjjjjjjjjj",
"lclclccccccllccccccccccccciciccclic`cciiiciiiiciiiicicciiiiiiiciii`iiiiiiii`iii`ii`i`iii`ii`akbmnabnnnmnb`jffffmfffmmmnmmnmmmmfmfmmmffffffffffmfnmmnmmmfmffmmfffmmfmmmmmmnnmmmmmmmmnmnmnmmmmmmmnmnnnmfmmfmmmmnknnmnkknkaabjlljjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjlic`bkmkbbbabbaainnnknnnkkkkbkkkkkkknkkkkkkknkknkkkkkkkbbbbbbnnkkkbnnkbbbkbbbbbbbbbbkbbbbbbbbbbbbbbbabbbabbbkbbbbbba`baaabkbnbbkbccjjjjjjjjjjjjjjjjj",
"clcccclcall`lcclccccccccccccbiciicicccicccciicciciciciiii`iiiiiiiiccii`iiiiii`ii`iiiiiiiiiciabbkbbbbmmnnn`jffmmfmfmmmmnfmmmfffffffmmmfffmfffffffffmnmnnmfffmmmffffmmmmnnmnmmfmfmnmmmmmmmmnmnnnnnmnnmmmmmmfmmmnnknknkknbbbkljjjjjjjljjjjjjjjjjjjjjjjjjjjjjjjjj`iabknnnkknnkbbinnnnnnnkkkkkkkkknnknnkkkkkkkkkkknnknnkkbkbbbnkkkbbkkkkkkbbbbbbbbkkkbkbbbbbbbbbbbbbabbabbbbbbbbbbbbaabababbbbmnkbljjjjjjjjjjjjjjjjjj",
"clclclcl`lcmcccccccccccccciikiiiii``iiicicciiccicicicii`iiiiiiiii```iiiiii`iiiiii`ii`iiiiiii`bbbbkbbmmnmmilmfnmmmmmmmmmmmmffffffffmmffmmffmmfmffmmmmmmmffmfnmmffffmmmmnnmmmffmmmmnmmmmmmmnmnmnmmmfffnnnnmnnmmnnkkknnkkbkbkljjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjji``mnkkknnmmkbbiknnnkkkknnkkkknknnnnnnnkkkkkkknkkkkkkkkbkbkbkbkkbbbkkbkbkbbbbbbkbkkbbbbbbbbbbbbbabbbbbbbbbbbabbabba`b`bkkkkabmmbljjjjjjjjjjjjjjjjjj",
"clcccllclcikcc`cccccccciiciib`iiiiabibiiiiiiciiiiiiiiiiiiiiiiiiiiiiciiiiiiii`i`iiiiiiiiiiiic`kbkbbbbnmnnmicmfffmmmfmfmnmfmmfffffmmmmffmffffmmnmmmmmmffmmmmmnmfffnmmmmfffmffffmnmmmmmmmnnmmnmmmmmmffmmnmmnmmnmnnnkkknkkdbbkljjjjjjjjjjljjjjjjjjjjjjjjjjjjjjjjji``mnkbbkknkkbaiknnnkbkknkkkknkknnknkkkkknnnknkkbkbbbkbkkkkkkkkkbbkkkbbbbkkbkbkkkbbbbbbbbbbbbbbabbkbbbkbbbbabababaaiiibknnkkknnnijjjjjjjjjjjjjjjjjj",
"cclcclcclccclcnicccccciiiiiiciii`ca`iaiciiiciiiiiiiii`iiiiiiiiiiiiii`ic`i`iiiii`iii`iiiiiiii`bknbkkbbnmnnilnfffnmmmmmmmffmfffffmmfnmffffffnmfnmfmfffffmnffmmnfmmmfmmfmmmmffffmmmmmmnmnmmnmmmmmmfmnnnmmnnmnmnnkknkkbnnkbbnbljjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjii`kmnkbbkkbbbbiknnnkknkkkkkknkknnnknkbkkkkkkknbkkkkkkkkknnkbkkbbbkbbbkkkbkbbbkknkbbbkbbbbbbbbbbbbkbbbbbbabbbbbabbalilbkkkknnnnmijjjjjjjjjjjjjjjjjj",
"lccclccclcccccccccccciiiiiiiiciiiiii`i`iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii`ii`iiiiiiiiiiciankbbkbbbkkmmccnfffffffmffffmmnmmmmfmmmfffffmmfffmfffmmfffmmffffffnmmfffmmmfmfffmmmnfmnmmmnmnnmffmnnnnnnnnmmnmmnnnkknnkkbkkkknljjjjajjjjjjjjjjjjjjjjjjjjjjjjjjjjjc`iknmnbbbkbbba`bnmnnnnnnnnnnnkkkkbnkbkkknkkkkknnkbkknkkkkkbkknnkkbkbkkkbkbkkbbkkbkbbkbbbbbbababkbbabbaabbbaabbbaaalccankknkbnbkajjjjjjjjjjjjjjjjjj",
"lclliclcccccccccccccciiia`ccciiicickkiiiiiiii`ii`iiiiiiiiiiiiiiiiiiiii`ii`iiii`ai`iiiiii`ii``mnkkbbbabkkklcnnffffffffefffmmnfffmffffmmmmfmfmmnmmffmnmmmffffffmmmmmmmmmffmfffffmmmmnmnnmnmmmmnnnnnnmmmnnkmmmnmnbbknnkbbknnnljjjjjjjjjjjjjjljjjjjjjjjjjjjjjjjjjia`kbnmnbbbbbkaabknnnnmnnnnnnnkkkknkkknkkknkkbkbkkkkknkkkkknnkkkknkkbbkbkbbkkkkkkkkkbbbbbbbbbbbbbbbababbbabbbbbbkbalciakkknnknkkdjjjjjjjjjjjjjjjjjj",
"cclibccaccclcccccccciiicaccciiicic`aai`iiiiiiiiiiiiiiciii`iiiiiii`i`iii`iii`ii`iiiiiiiiciccc`knknkkkbaaa`lifmfmmmfffffffmmnmmffmmfmmmmmmffmfmfffffmfmmmfmfmmnnfnfmmmmnfffffffmmmnmnmmnmmmfmnnmfmfmmfffmmmnmnmnkkbkkkabkknncjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjc``kbknmnbbknnkabnkkbnnnnmnnnnnkkknknnnnkknbknkkkbkkkkkkkkkkbkkkbbbkbkbbbkbbkkkkkbbbbbbbbbabbbbbbbakbkbkkkbabbabbbkci`akknkknkkkajjjjjjjjjjjjjjjjjj",
"cclc`lcccccccccccccciiiccciiicciicac`ii`ii`i`iiiiiiiiiiiiiiiiiii`iiii`ii`iiiiiiiiiiiiiiciiiiakkknnmnba``ij`mmmmmffffmmnmnmfmmffmfffffmmmffmmmmnmnffffmmmmfnmmmfffnmfnnffmmmmmmmmmnmnnmmfmmnnnffffmmmmmmnmnnnmnknkbabkkkbbkljjjjjjjjjjjjjjjjjjljjjjjjjjjjjjjjji`ikkkkkmmnnnfnbbnknknnnnkknkkkkkkknkkkknnnbknnkkkkbkkknknkbkkkkbbbbkkkbkbbkkkkbbbbbbbbbabbbbkkababkbkbbbbbbbbbbabki`abkkkkkknnkbjjjjjjjjjjjjjjjjjj",
"lcllccclcccccccccciiiiiccciicciiciciiiiiiii`iiiiiciiiiiiiiiiiiiiii`iiiiii`bb`iiii`iiiciiiccibnkkbknbba`cijafmmfmfffmmmnmnnmffmffffffffffffmmmmffmffffmmnmfnnmnfmfmmfnnmnmmnnnnmmmnnnmmmmmnnnfmmmnmmfffnnnmmffmknkbabbbkkkkljjjjjjjjjjjjjjjjjjjjjjjjjjjjj`ljjjca`bknkknmnmnnmbannnknkkkkknkbkkkkknnknnnknknkkkbkknkkkkkkkkbbkbbbbbkbbkkbbbbbbbbabbbbbbbbbbkbbabbbbbbbbbkbkbaabkkbaakkkkbbbkknnnjjjjjjjjjjkjjjjjlj",
"cccclcccccccccccccccciiiiciicciccici`ii`i`i`iiiiiiiiiiiiiiiiiii`iiiii`iiiiiicci`iiiiciiiiiciakkkknkaaa`i`jamfmmmmmmfmmnnfnnmffmfmfmfmmffffffffffffmmmfmmmmnmmnfmmmmfmnmnnmmmmmnnmnnmmmmnnnnmfmmnffmmfmmmnnmmmnnnmkbkbbknnbljjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjji`ikkknkbkmnnkkbannkkknknnkkbkbkbkknnnnnkkknknnknknkkkkkkkkkbbbkkbbbkkbbkbbabbbbbbbbbbbabbbbbbaabkkbbkkkbkbbbbbbkbbaakkkkkkkbbbknjjjjjjjjjjjjjjjjjj",
"clcccilcccccccciiciciiicccciciicic`iii``ii`iiiiiciiiiiiiii`iii`ii`iiiiiiiiii`iiiiiiiiiiiiiiibkknnkaaaa`abjanmnnfmmmfmmnnmmnmmmmmffmmnnmmffffmmnnfmfmfffmffmffmmmmfmmnmmnmmmmmnmnnmmmfmnnnnmmmmmfmmnnnnmmnmmnmmnmmnkkkkkkkkljjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjc``kbkkkbknmnkkbannkknkkkkkbkkkbkkknkkkkkbbkkknnkkkkbkknkkkkknnkkkkbbbkkbbbbbbbbbbbbbbbbbbbbbabbbbkbbbbbbabbbbbbabbaaknknkknkkbkkljjjjjjjjjjjjjjjjk",
"lcccbf`cccccciiaccccciiiiciccciiiiim`iaii`iiiciiiiiiiiiiiii`iiiiiii`i`iii`iciiiiiiii```iiiicabbbkb`iba`abjamfnnmfmmmmmmfnffmmmmnnmmmmnmfmmmmmnnnnfffmmfffnmmmfnmmmmnnnmmmmmmnmnmnnnmmnnnnmfmnmmmnnnnnnnnmmfmffmnnmmnkknbbbljjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjl`ibabbkkkbnnkbkakkbkkkkknkkknkkknknkbbkkkbbkkbkkbkbbbknnkkkkkkbkkkbkbbkbbbbkbbkkbbbabbbbbbbbabbkbbakbabbabbbabbkkka`knknnmnnnbnkljjljjjjjjjjjjjjjj",
"k`ii`icclccccciccciicc`ccicicciiciicibniiiiiiiiiiiiiiii`caci`ii`i`iiiiiiiiiiiiciiciiiniiiiic`b`abaiiaaabbjbmmmmmnnnmmmfffffmfmnnmnffmnnnmmmnnnmnnmffmmmffmmffmmmnmfmmmnmmmmnnnmnfffmnnmmffmmmnmnnnnmmnmfnmmfmnnmnmmnnkkknbcjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjci`akkbkkkbbbmkkanknnkkbkkknnkknnknbbbbnknkbkbkkkbbkbbbkkknbkkbbkkkbbbkknkbbbbkbbbbbbbbkkbbabkbbbbbkbbaaabbabbbbbbbaakknnnkbknnkbijjjjjjjjjjjjjjjjj",
"ilcciccciccccccciccccii`iiiiciiciiiiiiai`iiiiiiiiiiii`ic`ii`iiaciiiiiiiiiiiciiiiii`iiaiiiccaabaab`iiaabbblkfmmfmmnmmmfmmfffmmnnmnnmmffmmffffmmmmmmmmmmmnmnmmmnnmmmnmmnnmnnnnmmnmmmnmnnmfnmmfmnnnnnnmmmmmmmmmmnnnmmnmnnnkbk`jjjjjjjjjjajjjjjjjjjjjjjjjjjjjjjjjc`iabnkkkbbbbkkk`knnnnbbkknnnnnmnbkbkkkbkknkkkknkkkbbbbkkkkbbkbkbbkbbbbbbbbbbbbbbbbbbbbbbbabbkkbkbkababbbbbkkbbbbbbb`knnnnkbbkkkkijjjjjjjjjjjjjjjjj",
"cccciciclccicliaccccciliiicciiiiiii`iiiiiiiiiiiiifkiikaiiiiii`c`iiiii`aai`c`iiiiiiiiiciiiac`bb`aacc`bbkkalkmnmfmnnnnmmmnfffnnnnmnmmmmmmmmmnmmmnmmffffmmffmmmmmmmnnnffmnmnnmmfmmmnnmmmnmmnnmnnnnnnnmnffmmnmnnmmnfmnmmnmnnkbljjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjli`bbbbkkkkkbkkk`knkkkkkbbkbkbknnkbbkbbbkkkbkkkkkbkkkkkkkkkkkkkkbbkbkkbbbknbbbbbbbbkbbbbkkbbbbbbbbabbbbbbbbbkbbbbabaannnknnbbknkk`jjjjjjjjjjjjjjjjj",
"cciccicccccccciicciciiiiiciiiiiiiiiii`iiiiiiiiiiiic`iicii``ii`iiiiiiiii`iaikiiiiiiiciciiikilab`a`ciakkbk`jnmnmmmmmnmmffmmfmnnmmnnmfmnmmfmmmnmmffmmmfmfmmfmmmmmmfnnmffmnmnnknnnknmmfffmnnnnnnnmmmnmfmnmnmnnnnnnmmnmmnnnnnmkljjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjic`bkbbbbkkbbnkk`kkknnnnkbnnnknnkbkbbbkknkbkknkkbkbkkkkkkkkkkkkkbkkbkbbbbkkbbbbabbbbbbbbkkkkbbbaabbbbbbbbbbbbbabbaba`knnnnmkbmmnndjjjjjjjjjjjjjjjjj",
"ccccccciccccciclcicicia`aiiiicciii`iiai`iiiiiiiic`iikb```ii`eic`iiiiiciccnicbiciiccciciciiickai``c`bnkkkajnmmmmmmnmmmfmmmmmnmmmnnmfmmmffmmnnmmfmnmmfmfmfmnmmnmmnnmfmmmfffnnmnnnmmmfffnnnnnnfffmmmmfmnnmnmfmnnnnmmnkknnnnnn`jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjlicibnnnkbbkkbnkk`nknnkkkkknnnkkkkbkbbkbnnkkbkkkkkbkkkkbbbkkkkkbbkkbbbbbbkkbkkkbbbabbabkkkkkbbbbbkkkkkbbbkbbbabbbbbbb`aaknnknkmmnnbjjjjjjjjjjjjjjjjj",
"cclicciiccccccciccciccbib`ciiiiiiiiii`iiiiiiiiii`iiia`ica`iciin`iiii`iii``cinciccicccccciccinic``aaknnkkajnmfmmnnnnnnnnnnmnnmfmmffmfmmmmnmfmmmmnmmmffffmmmmfmnmnnmffmmmnmnnnnnnmmmmmnmnnmffffmmmmfmmmmmmnmmmnmnnmnnkknnnkn`jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjiciibkmnkkkkkkkkk`nmkkbbkbbkbbbbkbbkkkkkkkknkkkkbbkbkkbbbkkkknkbkkkbkkbbbkkkkbkbbbbbbbbkbbkbababkbkbkbbbkkbbbbbbbbbbb`baabnnnkmnnkkjjjjjjjjjjjjjjjjj",
"cclcccciaicccccciic`icacaiciiii`ii`iiiiiiiiiiiiiiiii`ii`i`i`ciaiiiiiiiiciliaf`ilcciccccccicckic`abkknnnnajmmmnnmmmmnmnmnnnnnmfmmnnnmffffmffffmmnnnmmmmmmmnffmmfmnmfffmmnmmfmmmffmmnmnmmffmmmnnmnfmmmfmmmnmmnmnnnnnmkbbknmkijjjjjjjbjjjjjjjjjjjjjjjjjjjjjjjjjlciibbkknnkknbkkbikkkknknkkkkkkkkbbkkknkbkkknnnnkknkkkbbbkkkbkkkkkkbbbkbbbkkbbbbkbbbkbkkbbbbbbkkkbbbbbbbbkbbbkbbbbbbbakkbbknmnmnnnkjjjjjjjjjjjjjjjjj",
"ccccciciiiicciccccciiciiii`iiiiiiiiiii`iiiiiiiiiiii```ii`iiiiiiiiiiiiii`cicia`aiicicccccciciaca`aknkknnn`jfmmnnmmnmmmnmmnnnnmnnmmmnnmnmffffffnnnnmmmfmfmnmmfmmmmfmmmmmnmnmffmmmnnnmmmmmfnnnnmfmnmmmfmmnmmnnnnnkknmnkabkknnijjjijjjjjjjjjjjjjjjjjjjjjjjjjjjjjjci`akkkkknnbknkkannbnkkkkkkkkkbkbknbkbkbkbbkbkkkknkbbbbbbbbkkkkbbbnkkbkknkkkbkbkkkkbbbbbbbkkbbbabbbbbbbbkkkbbbbbabbb`bnnbbknmmnnkbjjjjjjjjjjjjjjjjj",
"cccccciiicccccicicicciiiii``biiii`ii`a`iiiiiiiiiiii`iiiia`ii``iciccici`ciicci`icbicccccccici`i`aknknnnnn`jffnnfmmnmnmmmnnnmmmmmnfmmmnmmmnmmffnmnnnmnnnnfnmmfmmmfmnmmmnnnmnnnmmmmmnmmfmmfnnnnmfmmmmmnnmmfnmnnmnmkknnkbbbbkkcjjjjjjjjjjjjjjjjjjjjjjjljcljjjjjjjci`abkkkknkmbnkn`nkkkkkkkkkkknkbkkkbkkknkkbkkkkbbkmkkbbbbbbbbkbbbknkbkkbbbkbkbbbbbbkkkbakkbkkkbbaabbkbkbabbbbkbbbbbbaannnkbbnnmnnnjjjjjjjjjjjjjjjjj",
"ccccccciicicicciciaaiccc`iii`iiiiiiiii`iiiiiiiii``iiiii`aiiiaa``ciiiiiiccciciiicilcclcccccciaabkkknnnnnn`jfmnnmnmmnnmmnnnnmmmmfmnnmmfnmfnmmffmmmmnmnnnmmnnnmmnnmmmmmmfffmnmmmmmmmnmmfmmmmnnnnmmnmnnnnmnnnnnmnmmnbnnbbkkbakijjjjcljjjjjjjjjjjjjjbljcjjljjjjjjcjiaakbkkbnknnnmm`nkkkkkkkkkkkbbbkkkkkkkkbknbkkkkbbkkkkkbkbbbbbkbbbkbbbbkbkkbkbkbbbbbbbkbbbkbbkkbkabkbkbbbbabbbbabbbaabnnnnbbbknmnnljjjjjjjjjjjjjjjj",
"lciccciiciciccicciiiiiciii```i``i`iiiiiiiiiiii`iii`ii``b`iiiiiicicicciiiciccccccccicccccccciabkkknnnnnnnilnnnmnmnnnnnnnmnffmmmmmnmmfmnmffmmmfmfmnmmmnnnmmmmmnmmnnnnmnmmmnnmmmnmmmmmmmmnnmmmmfffmmmmnnmmnmmnnnnnnbkbbbkbbabcjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj``iabkbkbkkknknn`kkkkkkkkbkbkbkkknkknkkbkknbkknkkknkknbbkkbbbbbkbbbbbbbbbbkbbkkbbbkbkkbkkkbkbbabkbkbbbbbbaabkbbbbbbaaannnmnbbbkknmcjjjjjjjjjjjjjjjj",
"iiiccciiiiciciccicicccci``iiii`ii`iiiiiiiiii`iii`i`iiii`iiiiiciiiciciiiiciicccccci`ilccccccaabkknnnnnnnnclmnnmnnnnnnnnmnmfmmmnnmmmmmmnmmmmmmfmmmnnmnmnnnmmmnnmmmnnnnnnnnmnnnffmnmnmmmnnnfmmnmmmmmmmnmmffmmnmnkkknkbkkbabbbcjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjli`abkbkbkkknkkkckkbkkbkbkbkbkkknkkkkbbknkkkbkkkkknkkkbbbkbbbbbkbkkbkkbbbbbbbbbbbbbbkkbbbkbkabbkkbbbknkbkkkbbkkbbbabaamnnnnkbbabbncjjjjj`ljjjjjjjjj",
"ciicciiiiiiiciicccciiiamb`i`i````iiiiiiiii`iii`iiii`iiciiiiiiiiiiciiiiiciiiccccccciccclccli`kkmmknknknnnccmnnfnnnnnnnnmfnmfnmnnnmmmmmmnnmnmmmmmmnnnmnnnnnnnnmmmmfmnnnnnmnnnmffmmmmmmnnnnnnnnnnmmnfmmnmmfmnnnnnkkkbbkkbabbbcjjjjjbjjjjjjjjjjjjjjjjjcjjjjjjjjjjcci`bbkbbkbkkkbkckkkkkkbbbbbkkkknkkbbbbnnkkkkbkkbbkkkkkbbbbbbbbbbbbbbkkbbbbbbbbbabkkbbbbbbkbabbbbababbbbbbbabkkbbaababnnmnmnbbbbab`jjjjjijjjjjjjjjj",
"ccccciiciiiiiiiiiiciiccaiii`iiii`iiiiiiiiiii`i`i`iii`i`iiiiiiicciiciii`iiiiiciccclcclccccccaknmmmmnnnkknlcmnnmnnnnnnnnmfmfmmmnnnfmmmffmmmmnnnmnfnmnnmnmnnnnnnmmfnnnmmmnnnmmmnmmmmfmmnknnnnnnmmmfmmmnnmmmmknnnnkbabbbabaakaljjjjjjjjjjjjjjjjjjcjjjjjjjjjjjj`jjli``bkbbbkbkknkkckkkkkbkbkbbkknnknnkbbkkkkknkkkkkbbbbbkkbbbkbbbbabbbkbkbbbbbbbbbbbbkkkkkkkkbdbaabbbkbbbkkbbbbbbbabbabakmnnnkkbkkbbijjjjjjjljjjjjjjj",
"cccciciiiiiiiiiiciiab`icci`a`ic`i`iii`ii`iiiii`i`iiiicciciiicciiiccicibiiiccccccicccccclcccanmnmmmmnkkkklimnnmnnnnnnnmfffffmnnnnfnnnmffffnmnnmnmmmnmnnnmnnnmmnmmnnmffmmnmmmnnnmmfmnmmnmmmmmnnnnnmmnmmmnmnnnnknkbabkbbbabbaljjjjjjjjjjjbjjjjjjjjjjjjjjjjjjjjijliiabbkbbkkbkkkb`kkkkkkbbkbbknnnnkkkbkbkbbkknkkkkkbbbbkkbkbbbbbbbbbbbbkbbbbkbbbbbbbbbbkbkbbbbbkkbbbbbbbbbbbbbbbbabbba`bnnnnknnbkbb`jjjjjjjjjjjjjjjj",
"ccccccciiiiiiiiii`iiiiii``iiiiciiiiiii`iiiiii`i`iiiiiiiiiiiciiicciiaicaicciiccccclcclcclllcafmnfnmnnnnnnlcmfnmnmnnnnnmmfmmnnnnnnnnnnmmmmmnmnmfnnfmnnnnnnnnnmnknnnnnnnnnmmnnnnmfmmnnnnmmmmnmnnnmfnnmmmnnmnknkknbbbbbkbaaaaaljjjjjjjjjjjljjji`jjjjjjjjjjjcljjjjj`iabkkkbkkkkkmaaknkkkkbkbbkknnkkkkbbbbnbbbkkkkkbkbnkkbkkkbbbbbbbbkbbbbbabbbbbbbbbbbbbkkbbbbbkbbbbbabbkbabkbbbbbbaaaa`aknnnmnkknbbajjjjjjjjjjjjjjjj",
"icccci`cciciiiiiii`iiiiiii``iiiiii`iiiii`i```iii``ci`ciiiiiccicicccciciiicicccccccclccccclikmmnmnmnnnnnklammnnknnnnnnnnnmmmnnknmnnnnnnmmmmmmfnnmnmmmmnmnmnnnmmnnnnnnnnnnnnmmmmmfnnnnnfnmmnnnnnkmmnnnmmnnmnmnnkbbabbba`aaailjjcjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjliiakbknkkkbknnk`nkkbbkkbkbbbkknkkbbkbkbkbbbkkkkbknbnbbbkbnkbbbkbkbbbbbbbbbabbbbbbbkbbbbbbbabkkkbbbbbbbbbabbbabbbbbaaibbbbknmmknkabjjjjjjjjjjjjjjjj",
"icciccccciicci`bi``i`iii`i``ciiiciiiiiiiiiiiii`aci`iiiciiiiiiiccciicccccccciciccccccccclclcbnnmmnnnnnnnklaffmnnmnnnnnnmmmmmnnnmmnnknmmmmnnmmfnnnnnmmnmnnnmnnmnmnknmnnmmnmmfmmnnnnnnmmfmmnnnnnnnmmmmmnnnkmnnnnkbababaa`aaicjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjliiakkabkkkkknnnannkkbbkbbkbkkkknkkkbbnbbbbbbkkkkkkbkkbbbkkkkbbbbbbbbbbbabbbbbbbkkkbbbbbabbbkbbbbabbbabkkbbabbabbbabb`abbbkknmmmkbb`ljjjjjjjjjjjjjj",
"macciiiicicciii`iii`i`i`i`knai`c`iii`iii`ii`ii`aaciiafiiiciiiciacciccccciciiccclccclccllclcaknnmmnnmnnnnjbmffmnnmnnnnnmmmfnmnnmfmnknmmmnmnmnnnmnmmnmmmnnnnnnnnnnnmmmnmmnnmmnnnnnnnnnnnnnnnmnnnmnnnmnnnknnnnnnkabaaaai```iiljjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjiiakbaakkknnnmnankmnkkkkkkbbkkkkkkkbbnkkbbnkkkkbbbbbkbkbnkkkbbbbabbbbbbbkkkkbbbbbbbbbbbbbbabbbbabbabbbbabkabababbbbb`abbbbbknmmnbbljjjjjjjjjjjjjjj",
"biccclcciicciccii`iiii`iii``ci`ia`iiiii`iii`iii`c`iiii`ciiicccibccciciciiiiiiicccccclccclclabkkkmnnmmnmklanmmnnnmnnnnnnmmfmnnnnmmnknmmnnmnmnnmfmmnmmmmmnnknknnnnmmmmmmnnmnnmmmmmmnmknmmmnmmmmmnnnnnmnnnnknnnmkabbaa```a`iiljjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjlii`kkbabkbkknmnakknkkbkkkkbbkknkkkkbbnkkbbkkbbbkkkbbknkbkbbkkbabbbbbbbbbkkbbbbbkbbbbbbbbbbbbbbkbbbbkbbbabbabbababbbb`abbbbbabknkkajjjjjjjjjjjjjjjj",
"cciiiiiicciiccib`iii`ii`i`````ic`ii`iii`i`i`iiiiiiiciiciicciiciiiccciiiciiciccilcclclcllcll``aaknmmnmnmblbnnmnnmmnmnnnnmmmmmnknnmnnnnnnnnnmnmnfnknnnnknnnnnnnnnnnnmmnmnmnmnnmmmmmnfnfmmnnnnmmmmnnnnknnnknnkknkabbaaaabba``cjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjii`baaaabakkbknakkkkbkkkkkkbbkknkkkbbbkkkbbbbbbbkkbbkkbbbbbbbbbbbbbbbkbkbbbkbkbbbkbbkkbbbbbkbbbbbbkkbbabaabaaaabaaaa`i```aabaknnbacjjjjjjjjjjjjjjl",
"icccciccicciic`b```iiiiii``iiiiiiiii`iii`iiii`iiicii`cicciiciicccccccicciicicciclcclclcllcli``akkmmmnmnbjbnmmnmnmmmmnnnnmmmmnnnkmnnnnnnnkknnnnnnnnnnnknnmnnnnmmmnmmnnnnnnknknnnmmnmnnnnnnnknmmnnkkkknnkknnnknkabbaaabbkabaijjjjjjjjjjjjjjjjjjjjjjjjjjjljjjjjjjcci`ii`abbkkbkkabnkknknknknkbbkknnkkbbbkkbbkkbbbbbkkbkbbbbbbbabbbbbbkbkkkkbbkbbababbbbkbbbbbbabbabbkbabaababbbbbbabaiciii`aabbnnkacjjjjjjjjjjjjjjj",
"liiicciiiicciiii`i`iiiii``ii``iii`iiii`i`iiiiiiiki`cciciciiccccicccccccccicciiaicccllcllclcaaabknmmnmnnbjkmmfnnnmmfmmnnknmmfmnmnnnnnnnnnnnnnnnnmnnnnnnnnnnnnnnnmmmmnnmmknnnknnmmnnknnmmfmnnmmmnmnnnnnmmnnnnkkbabaaaabkkbnaijjjjjjjjljjjjjjjjjjjjjjjjjjjjjjjjjjilcic``bkbkkkkbaankkkbkkkkkkkbbkknnkkbkbkbbbkkbbbkkbbbbkbbbbabbbbbabbbbbkbbbbbbbbababbkbbabbkkkbbbbkkkbbbbbabbbbabaaalccciabbbkkkbijjjjjjjjjjjjjjj",
"icciciccciiciiiiii`iiiiiii`iii`iiiii`i`iii`iiiiiiic`ciiiiicciicccciccccccilcclilclclclccllcbbbbmmmmmmnnbjkmmmnknnmmnmmmnmfmfmmmfnnmmmmnnknmnmnnmnnnnnnnnnnnnnnnnmmmmmmmmnnnnnnnmnnnmnmnnnnknnmmnmnnnnnnnnnnnnkbb`i`aabnnkaijjjjjjjjljjjjjjjjjjjjjjjjjjjjjjjjjjcllcc`abbbabbkbaannkbbbkkkkkkkkkkknknnkbkbkkkbbbbkbbkbnbbbbbbbbbbbbbbbbkkkkkkkbbbbbabbbababbbabbabbbbbbbbabbbbabbbab`lllciibbabbbbijjjjjjjjjjjjjjj",
"ccciciicciiciii``c`i`cii``iiiii`ikbn`iiii`iiiiiiiciiiiiccakaiccccccccccciccccclccllcllclllcbbbnmmmmmmnnajmmmnnnnnnmmnnnmnmmmmmmmmnnnnmmnnnmnmmmknmmnknmnnknknnmnmnmmmnnnmnknnnnnnkkmmmnnmnmnnnnknkknmmmnmnmkkkaaii``bkkkbaijjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjicllccaakbbbann`bnnkbbkkknkkkkbkknnkknkkbbbbkkbbbbbkkbbbkbbbbbbbbabbbbkkbbbkbbbbbabbabbbabbkkbbbbbbabbbaaabbbbbbbbaaalccc`abkbbbabajjjjjjjjjjjjjjj",
"ciiil`ciciciciiii`iiiii`ii```iiii`ia`i`iic`ci`iiiiiicciiiciccccciccccccccccllcclcccllclclccbbbnnnnnmmnn`lnmnknnnnnnmmnmnnmfmmmmmmknkknnknnmnmmmnmnnmmnnnnnnnmnnnnknnnnmmnnknnnnnnnnmmnnnmnnnnnnknnnknmnnknnnmka`i``abbknaaijjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjicjcii`bkbkkknmaankbkbkbbknkkkkbknnnknkbbbbbbbbbkkbkkkbbbkkbbbbbbbbbkkbabbbbbbkbbabbbbbbbbbbbbbbbbabbbabbaabbbbaabbbblli``bkbbbbaaajjjjjjjjjjjjjjj",
"ccciina`iicicii`iaiiiiiii``i`iiii`i``ii`i`a`iic`iciciiccciicciccccccclcccccccclclclccllclciabkmnnnnmmnm`jnnnnknnkknmmmmknmfmmnmfmnnnnnmnnmmnnmmmmmmmmnknnnnnmmmnnnnnmmmfkknnkknnmmmmnnnnmnmnnnnknkkknnnmnnnnmna````bbknbaaijjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjljjcila`i`bkbknnnnaabbkkkbbbbnkkkbbkkkkkkknkbbbkkbbbkbkbnkkkkbbbbbbbbbbkkbbabbkbkkbaabababbbbbbbabbkbbbaaabababbbbbbabbbllababkbbbbbbbjjjjjjjjjjjjjjj",
"iiccik`iiciacii`ibiiii`iii```i`ii`i`iciiiiiiiciciiiiiiiiiccciccccccccccccclccllcieillclllciabknnnnnnnnnilknnnnnnnnmmnmmnnmmmmmmmnnkknmmmmnnnnnmmnfmmnmmknnnnnmmnnnmmmmmmnnknnknnmnnmnnnnnmmnnknnknknkmmmmnkknkaaa`abakkaab`jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjicca`iibbbknnnnb`bkbkbbkkkkkknkkknknnkkkbbbbbkkkbbbbbbkkkkbkkkbbbbbkbbbbkbkkkbkbabbbabbbbkbbbabbbbbbabbaabbabbbbbbaablcabbbkkbbbbbbjjjjjjjjjjjjjjj",
"ciccccicciibiiiiiaiiiiiiiii`i`i``iii```iiiiiiiiiciiiccciciccccicilclcicccilclclclccclclcll`kknnnnmnnnnn`jnknnnnkmmmmnmmmnmmmmmmmmnnnknnnnnknnnnmnnmnnfmmmmnnmnnnmmnnnmmnnnnnknknnmnmmnnknmnnknknnnmnnmmnnnnkkkabaaabbaaibk`jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjliccb`iibbbbknknk`kkkkbknknkbnnkbkkknkkkkkbbbkkkkbkbakkkbbkbbkkkbbbkbbbbbkbbbbbkbbbababbbbbbbkbabbbbaabbabbbbbbbbaaabbcibbabbkbbaabbljjjjjjjjjjjjjj",
"ciciiciicii`iii`i`ii`iiiii`iii``i``iaaai`iici`ciiicc`iccciiiccclccicccciiaillcclcjlallllll`knnnmnmmnnnn`lnnnnnnnmnnnnmmnnnnnnmnnmfmnmmnnnnknnmmmnnmmmmnmmmnmknkkmmnnnmmmnnkknnnnmmmnmmnknnnknnknnnmmnmmnnnmnnkbbb`abba`abkijjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjiicnk`cakbbknknkabkbkbkkkbkbkkkbbbbkbkkkkkkkbkkbbbbkbkkkbbkkkkkkkkbbbabbkkdkkbkkbabbbbbbbbbkbbabbbabbabbbbbbbbbbabbbaiiabbabkbabbbbjjjjjjjjjjjjjjj",
"icciiciciicccii`iiiiiiiiiii`i````iiii`iikiiiabiiiiccaa`ibicbbicicc`iccc`ibcclclllacjclllll`bkknmmmnnnnnilnnnnknnnnnnnmmknnknnnnnnmnmmmnnnnnmnmnnmmmmnknnnnknnkknmmmmmmmmknknnmmmmnmnmnnnnnnknnknnnnnnmnnnnmnknkaiiiab`abbk`jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjji`cnnic`bbkbknkk`bkkbbkkbkkkknkkbkkkkbkbkkkkkkkbbbkbbnbnbbkbbbbbbbbbbbabkkkkkkkbbababbbkbkbbbbbabbabbbabbbbabbbbabbab`ibbabbbbbbbkbljjjjjjjjjjjjjj",
"cciiciciciiii`iiii`iii`i`i`iiii`````iiiiiiciiiicciii`iccciccccicccilccccc`lclllcclcllcllll`bbkbknmnnnnnicnnnnknmnnnnnnnnnnnnnnnnkmmmmmnnknnmnmnnnmmnknnnnnnmnnknknmmmnmnnnknnnmnnnmnnnnnnmnknmnnnnnknnnkkbnmnmbilcci``abkkijjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjic`kb``akmbakkknakkbbbbkbknbbkbbbbbbbkbbbkkkkbbbbkkkkbbbkkbbbabbbbkbbbbbbbkkbkkbabbbbkkbkbkbbbbbbkbabbbaababbbaaabbbb`ibkabbbbkbbabljjjjjjjjjjjjjj",
"iciciiiiiccci`i`iiiiiiiiii``i``i``iiiiiiiiiiciciiacciilccccciicciccccccclclclcllllllllllcl`abbbknmmnmnnlcnnkknnnnmnknnnnknnnnnnmmmnmmknnnffmmmnnnmnkknnnknnknnnnnkknnnnnkknnnmmnnmmnnnmnnnnmmmnknknnmnnnnkmnnnii`ciccikkbbijjjjjjjljjjjjjjjjjjjjjjjjjjjjjjjjjjic`bb``bkknbbbnnakkbbkkkkkbbbkkbbkbkbbbknkbkkbbbbnkkkbbbkkbabbbbbbbbbbbbababbbbababbbbbbbbbbbkbbakbbbbbbbabkbbbaabbbb``bbkaknbbkkakijjjajjjjjjjjjj",
"cicciccia``ii``i`i`iiiii`i```i```i`iiiiiciiiiiiic`ciccaiciicciicicccccccclclcllclllllllcjcabbbknnmnmnnnlinnnnknmnnnknnnnnmnmmnmnmmnmnkknknmnmnnmknnnknnnknnnkknknnnknnknnnnmmmmmnmnnnnnmnnmnmnnnnnnmmmnnnnnknk`c`iiciiabbbijjjjjjjjjjjjjjjjcjjjjjjjjjjjjjjjjjjci`bb``bkkkkbbkkakbkbbkkkkbbbkkkbkkkkkkkkkkkkbbbbkkkkkkbbbbbbbabbbbababbbbabbbabbbbkbkkbkbbbabbbbbbbbbbbabbbbbbbabbab``babbbkkbbkkbijjjljjjjjjjjjj",
"cciciiiciiciii``i`i`i`i`ii`````i`iiiiiii`iicicccciciicb`ciiicicicicccccclcllclllllllllllclakknmnmnnmnmmlinknkknmmnnmnkkmnnnmnmnnmnkmmnnmnmmnmmnmmnnmmkknnnnkknknnnnnnnnknnknnnnnnnnnnknmnmmmnnknknmmnnnnkknkkkiciiclcc`ank`jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjic`kb`bbbkkkkbbk`bkbbkkknkkkkkbknbbknkkbkkkkbbbbbkbkkkkkbkbbbbbbbbbbbabbbbbkabbbbbbbbbbkbbbbaabbbkkbbbababbbbbbabaaabaibabbbbkkbbnkajjjjjjjjjjjjjj",
"ciciciciiciiiiiiii`i`i``a`i```i`iiiiiiiiicic`iiiiccccci`iicccciccicciclccllclllcllcllcll`c`bbbmfmnnmmmnl`nknnkkmnnnmmnnmmnknnnnknnnkkkkknmmmnmnnmmnmnnkknnnnkknknnnnnmnnnmnnnmnnnnnnnknnnnmmnnknknnnnnnkkknknk`iicclcciakkajjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjlli`bbbknkkkkkkbbibbkbbbkkkbnkkkkkbbbbbbbkbbbbbbbbkkkkbbbbkbkbbbabkkbbbbbbbbbbbbbbbbbbbbbabbbbbabbkbkbbbabbbbbbabaabakaikaabkbkkbbkkajjjjjjjjjjjjjj",
"cciciciciiiiiiiiiii````ibaiiiii`iiiiiiiiiciabiiliccciiiiccccccccccciclcllclllcllllllllllcjbnkbbknkmmmnmj`nnnnnknnnnnmmnmnnkknnnnknnkknnnnmmnnnkknnnnnnnnnnnnnknkknnkknnnnmmnmmnmknmnknnnmmnnnnknnnnknnkkknnnmkaiiccici`abbbjjjjjjjjjljjjcajjjjjjjjjjjjjjjjjjjjcciabbknkkkkkkkb`kkkkbbkkbkkkkkkkbbbbbbbbbbbbbbbkkkbbbbbbbkbbbbbbkbbababbbbbabbbkkbbbbbbbbbbbabbbbbbbbaabbbbabaaabbaba`nbabbkkkkbbkkjjjjjnljjjjjjj",
"iiciciciiciiiii`iiiiiii`a`iiiiiiiiiiiiiib`iciciiiciiiibiccccccccccccclcllllclllllccllllllcbbbkkbkkkmnmnlannmnknnknknnmmnmnkknnnmnknnmmnfmnnnknnnknknnmmnknnnnnknknkkknnnmmmnnnnknnmkknnnmnnnnnnknnkkknkkknknnb`icc`ai`a`aa`jjjjjjjjjljjjjjjjjjjjjjjjjjjjjjjjjjlci`abbknkkkknnk`kkkkkbkbbbbkkkkkkbbbbkkkbbbbkbkkkbbbbbbbbabkkkbbaabbbbabaababbbbkbbkbbabbbbabbbbbbbbbabbbaaaabaabaabbikkbakkbbnkbbbljjjjajjjjjjjj",
"iiciciiiiiiiiiiiiiiii`iiiii`i`iiiiiiiiii`ccciiciiiiiccalcccccccccclclc`lcllllllllcclllllllbbbnbabbbknmkjannmnnnknnknnmmmmnnnnknmfnmnnnkkmnnnnnnnkkkkknnkknknnnnkknknknknnnmnnnnknnnnknmmmnnnknnnnkkkkkkknnnnnk`cc`ab`a`cii`jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjlciaabbkknkkknnkakkkkkkbbkbbkkkkkkbbbbkkkkkkkkbbkbbkbbbbbabbbbbbbbbbbbbbababbabbbbbbbbbbbbbabakbkbbbabbbabaaabaabbabbaiakbabbbbbkankijjjjjjjjjjjjj",
"iiicciciciiiiiiiiii`iii`ii`iii`iiiiiiiiciiiiciiiicciccliccciicclcllclcaclcllclllllclllllllbabbdkdddbnnklannnknnkknknnnnmmnnnkknmmmmnnfnnnknnnnnknnknnnnnkknnnnnkkkknkknnnnnnnnmknnnnmnnnmnnkkknnkkkkkkkknnnknb`c`bkbba`i``ijjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjcibbbkkbknknkkn`kkbkkbbbbbkkbkkkbkkbbbknkkbkkbbbbbbbbbbbbbbbbbbbbbkbbbbbbabababbakbbbkabbbbkbbbkkbababbbaabaaaabbkaaa`bnabbkkbabbbkcjjjjjjjjjjjjj",
"ciiiiciiiiciiiiiiiiii``i`iiiiiii`iiiiiiiciiciiicicccicccililccccclccllllllclllllllllbllllikkabbbbbkbkmblanmnknnknnnkknnnnnnnmmnmmnnnnnnnnnnnknnnnknnnnnnnnnknnnknnnkknnnkkkknnknknmnkknnnnknknnbkkkkkkkknmkkkb`ibknnkbaa``cjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjli`akkbbkbknnnnnibkbbbbkbkbbbkkbkkkkkkknkkbkbbbbbbbbbbbbbbbbbbbbbabbbbbabbbbbbbbbababbbabbbkabbbbababbbaaabbaaaakbbaaa`bnbbbbnkkbbbbljjjjjjjjjjjjj",
"icciccicicii`c`ii`i``cc`ii`iii`ai`iic`iiciiciiiiccccccccclcccclcllciilclllllllllllllcjcllannkbbbkkbaknajknnkkkkkknnknmnnnnnnknnmnnnnnnnknnkkkkkkkknkknkkkknnnnkkmnnkkkkknkkknnnnnknnnknknkknknnnkkkkkkkknnmnnk`aknknknkb`d`jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjl``aknkbbkknnnkkikkbbbbbbbbkbbbkbbbbbbbkkkbbbbkbbbbbbbbbbbbbabbabbbbbbbabkbbaaaabaaababbbabbaabababbaabbbaaaaababbkbbb`ankabbknkbbkbijjjljjjjjjjjj",
"iccici`c`ciii`kiiiiiiiai`iiiiii`ii`iiiccicciiicccciccccc`mlclclclccccllcllllclllllllllail`bkkbaknkbabkijnnkknknnkkkkknnmnnkkknnmkkkknnnnnknknnkknnnnnkknknnnknkkmmmnnnnkkkknnnnnkkknknkknkkkknnkknnnnnnnnmmnkbaknnnknfnbbnbjjjjjljjjjlcjjjjjjjjjjjjjjjjjjjjjjjl``bnnknkkbkknkk`kbkbkbbbkbkbbkkkbbbbbbkbbbbbbbbbbbbbabbbbbbbbbbbbbbbbbbbkkbbbbbbbbbbbkbbbbabbaabbbabbbaaabbdbbbbbbbaa`amkbbbknknkbbijjjjjjjjjjjjj",
"ciiiiia`ci`bna`iii`iibfiii``i`iiii`iiiiiiiciiicccccicccclccl`cilcllllllcclllccllllllll``liabbabkkkkbbbilknkknnknnnkkknnnknnnkknnkkknknknknknknknnnnnnknknnnkknnmmnnkkkkknknknnnmknmnkknnnnnmmmnkkknknkknknnkkbbnnnknmmkdakbjjjjjjjjjjjljjjjjjjjjjjjjjjjjjjjjjjli`bnknnnkkbbkkmabbbkbkbbkbbbbbkkbkbbbbbbbbbbkbbbbbbbbbbbbbbbbbbbbbababbbkbbbabaabababbbbabbabbbbabbbbabbababbbaabaabaaamnabbkkkkkkkijjjjjjjjjjjjj",
"c`icciiciiciiiii`ii`ian`i```iiiaiciiciibiciiiicccccccccccccinlclclcccccllllclclllljcljlilibbbbbbaabkkb`jbkkknkknknkkknnnkknkkkkknkknnkkkkkknknnknnnnkkknknnkknnmmmnnkkknnnnnnnkknnnmnknnkkknnnkbkknnkkkkkkknnkbkkknmnkbbknkjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjl`i`bknknmkkbbbk`bbbbbbkbbkbbbkbbbbbbbbbbbbbbbbbbbbbabbbbbbbbbababbbabbbkkknbababkkbkbbbbkabbabbbabbbbbbaaabbaaabaababa`nkbabbkkkknbaljjjjjjjjjjjj",
"ibaiiiiiik`ciai`iiiiii`iii`iiii`iciiiciaiiciiccicccccccccllililcclllcclllllllllllclllllllibkbkndaabnkb`jknnkkkknkknnnnkkknknkkkknnnnnknkknkknnnnkkknknknknnnnnnnknnnnkkknmnnnnnnnnkkknnnnnnknmnmknnnkkkkkkkknnbnnknmnbbnnnncjjjjjjjjjjjjjjjjjjl`jjjjjjjjjjjjjjl``abkkkknmkbbbbibbbbbkbbbkbbkbbbkbbbbbbbbbbbbbbbabbbbbbbbbbbabbbabbbbbbbbbkbbbabbbbbbbabbbabbabbabbabbbbabbbaabbaaabaaikbbbabbkkbbbbjjjjjjjjjjjjj",
"c`iciiiii`i`iiii`a`ii`iiii`iiiiciiiiicciiiiicccccccccccclicjillccllcllcllllllllljlljllljlanmnnnbabnnnbclknnnnnnnkkknnkkkknknknnnnkknkkknnknnknnnknknnnnnknnnnnnnnnnnnnmmnnmnnnnnnkbkknnknnkkknnnnnnnkkkkkkbkkkbnknnkbbkmmnkjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjl`iakkkmnkknkkbbibkkkkkkbbbbbbbbbbbbkbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbkbbbbbkbbbbbkbkbbbbbaababbbbbaabbbbbbabaaaababaaaikbababbbkkkkbjjjjjjjjji`lj",
"iiiiiciii`iiiiiiiii`iii``i`ii`i`iiicciiciiicicccccccccicc`ciiilallccllcllllllllllllllllllannmnkbbmkkfkljknnmfnnknkkkkkknkkknnnnnknkkkkkknnkknkknkkkknnnnkknnnmmmnnknkknmmmmmmnnnbknnkkmnnnkknnnnnnkkkkkkkknnkkbnknnbbakmnmbjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjl`iiaknnnnknnmnkcakknkbkbkbbbbbbbbbbbbkbbbbbbbabbbbbbbbbbababbbkbabbbbkkkbbbbbabkkbkbkbbaabaaabbbbbbaabbbbbbbaabaaabbabikbbbbaabbknbkjjjjjjjjjjjjj",
"iiiiiiiiiiiiiiiii`i````ii```ii`iiicicici`iicccccccccccclcclclcclclclllllcllllbllljcbcljllannnnbaknnmnncjnmnnnkkkkkknnkkknnnnnkkkkkkkknnnnknnknkknknnnkkkknmnnnnnmmnnnnnnnnnkkkkkkkkkkkkknnnkknnnnknnnkkknkknnb`knkkbdbnmnmbjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjlii`abbkkknnkkmk`kknkkbbbbbbkbbbbbbbkkbbbbbabbbbbbbbbabbbbbbbbbbbbakkbbbbkkbbbkbkbkbbabaababbaaababbabakbbabbbaabbbababcanbaabbabkknkjjjjjjjjjjjjj",
"ciciiiiiiiiiii`i`i```i`i`icc``i`iiiiiiiiicciciccccclccccccclcccllllllclllllllijllllijllllaknkkabkkknmnclmnknknkbnknnnnkkkkkknnknkkkknknknnkknkkkkknnkkkkkknnkknfnmnnknnnnnkkkkknkkkkkkkbkknmnnnkkkknkkkkknkkkbabnkkkbknnfnmjijjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjlii`akdbbbbkmmk`cabbbbbbbbbkkkbbbbbbbbbbbabbbbbbbbbbbbbabbbbbbbaabbbbabbbkbbbbbbbbbbaaabbbaaaabaaabbbkbbaaaaabbbaadababiabbbabaaabbkbljjjjjjjjjjjj",
"iiiiiiiiiiiii`i````iiiiiiii`baiiiiiiiicccccccccccccccccclclclcclclllcccllllllllllllljlljlbknkbankabknncckknknnnmnnnnmnkkknknkkkkkkknnnkknkknkkknknnnnnnnkkkkkknmknnnkkknknnnnnnknkkkkkkknkknnnnnnnnnnnknkkkkkkbknkkkknnnmnajjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjiciakbkbkkkbbbaiakbkkkkbkkbkkkbbbbbbbbbbbbbbbbbbbbbbbbbababkbbbbbabbaabkbbbbaaabababbbbababbbabababbbkbbbbbbbbabbabaabc`aaaaaaaabkknijjjjjjjjjjjj",
"iiiiiiii``i`ii`i``i`i`iii`cciiia`i`i`iiiiiccccccccclccccccclccccclcllilllllllllllllllllllkmkkkknbdabkklcknmmnnnnnkknnnkkkkkknknkkkknknnkkkkkkkkkkknnkknknkkkkkkmkkkkkkknnnnnnkkkknnkknnnnkkkknmnnnkkkbkkknkkbkbnmnnnkknmnnajjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjliiibbbbbbkka`caabkkbkkkkbkbbbkbbbbbbbbbbbbbbbbbbbabababbabbbbbbbbbababbbbaabbabbbbbbkbbaabbabbbbbbbbaabbbbaaaabaababaacc`iaaaa`aabkkijjjjjjjjjjjj",
"lllllllllllllllllllljlllllllllllllllllljlljlljljlljljljljjljjljljjljjljjljjjljjjljjjljjjjknknmnnbbbbkklcnnnnnnkknkknnnkbkkknkkkknknknkknkkkkkkknnnmnnnmnnnnnknnnkkkkkknnmnnkkkkkkknknkmmnknkknnkkbkkkkkkkkbkkbbnnmmkkkkmmnkjljjjjjjljljjjjjjljljjjjjjjjjjjjjjjli``bbbbbbbaiiiaaakbkbbkbkbbbkbbabbbbbbbbbbbbkbbbbbbbbbbbbbbbbbbkbkbbbbbkbbababbbkbbbaaabbbbabbbbbbbabbbbaaaaaaababaaaaiccii`ii``aaab`jjjjjjjjjjjj",
"ljljljljljljjljlljljlljljjljjjljjjjjjjljljlljljljjjjljljlljljljjljlllllljllljllljlljljjljbbknmmnkbbbbblinnnnnnnnknkknnnnkkkkknknknkkknkkkkkkknkknknnkknknnmnnnmnkkkkkknnnnkkkkknkkkknnnnknnknnnkkkknnnkkkbkkbbakmmkbbbbknnkjjjlljlljljllljljjljlllllllljlljljll`cibabaaa`cliaba`kkkkkbbkbbbbbkbbbbbbbbbbbbbbbbbbbababbbbbkkbbbbbkkbbbkbbbaababbbkbaabaabaabbbbbbababbkababbbbbbaaaaaaiciiicci```aad`ljllllllljlj",
"ljlljlljljljljljlllljljljljllljllllhllllljljljjjlllljllllllljljljjljjljljlljjjljllllllljlddknmmnkbkbbbj`mmmnkknnnknkknnnkkkkkkkknkkkkkkkkkknkknknknnnnnnnnnnnnnnknkkbkknnkkknkkkkkbkknnknnkkkknkkknnkkbkkkbkkkaknnbbbbbbknnjljljljllllljllllljlljljljljlllllljl```bbaa`cjlcabbakknkkbkkkbbkbbkkbbbbbbbbbbbbbbbababbbbbbbbbbbbbbbbbkbkbbbbbaaabbabbbbbbaaaaabbbbbbbbaabaababbaaaaaaaab`c``icci`aaaa`iljjjljjljljl",
"jlljlljlllhllhlhlljhlllljlljlljllhjljhjllhlllllhljljllhjllllhllhlhllhjllljhjlhjlhjjljlljlbkmmmmnmbkbkbj`knknnnnnnnknkknnkkkkkknkkkkkkkkkkkkknnknkkbnnnmnnnknkkkkknnnkknmmkkbkkkbkkkbknnnkkknkbkkkkkkkbkkknkknnbkmnkbbbabbadllllllhlllljhjhjljlljlllllllhjlllllc```bba`clliakkbabbbkbbbkkbkkbbbkbbbbbbbbbbbbbbbbbbbbbbbbbbabbbkkbbbbbbbabbbbbabbbbaaaabababaaabbababaaabaaaaaaaaababbaaiaa``i`a`add`cljhljlljljll",
"lljhjhlhjllllllllhlljlljhjlljllllllhlllhjllhllljlllljljlljljlllllllllhlllhllljljlllllljljnknmnmmmnkkbal`kkknnnkkkkknkknmkkkkkkkkmnkkkkkkkknmnkknnkkbkkkkkkknknknknnnknnnnkkkkbkkkkkkkbkkkkkkknkbkkkkkknnnmnkknnknmnbbbkbbbbljljljjljljhjljlhlhllhjhlllllljljllli``kkaiclc`bbkkkbbbbkkkkbbbbkbbkkbbbbabbbkbbababbabbkkbabbbaabbabbabbbbbbbbkbabbbbbbaaabaabaaabbbaababaaababaabbbbbbabacbbaaa`i`abb`iljlllljhjljj",
"llllljljlhllhlllhjllhjhllhlllllljhjljhjlllhjllhlhjhlhlhlhlhlhjhjlljhjljlljlllhlhllhllhllhkknmknmmnkkbbj`nnnnnnnnkkkknnkmnnmnkkkkkkkkkkkkkknnkkkkkkkkkkknkkkkkkkkknmnnnnnkkkkkkkkkkkkbkknkknnnkkknknknnnnknkknmnnnnnbbbbbdbdjlljhlhlhlhlllhlllllljljjhjllllllljhiiiba``ic`bnkbbkbbbkbkkbkbbbkbbbkkkkbbbbbababbbbabbbbbabbbbabbbbbbbbabaabbbkbbbkbbbaabaabaaabaaababbbbbbbabbbbbbbbbababiababba``add`iljhjllljhjhl",
"llhllhjhjllljhjhjlhjllllllllhjhlhllhlllhjljhljljllljlljljljhlllhlhllhlhlhlhlljllljljlllllkbnmkknmmnkkalakknnkkkknknnkkkkmnnnnnnkkkbkkkknkknnkkkkkkkkkknkkkkkkkkknnmnnnnnkkbkbkbkbkbkkbkkkknnkkkkbkknnkkkknknknbkbkbbbabbbkbhllhllljljljhjjljlljhllhlllhlllhjhlli`i````a`abnnkbb`bkkkbbbbbkbbbbbbkkbbkbbbbabababbbbbkbbbaaabaaaabbaababbbbbkbbkbbaaaaaabaabaaabababbabaaaaabbbbaabaabbbibabnnk`iaaa``llljhjhllllj",
"lllllhlllhllhlllhlllhlhlhjhjlllljlljlhjlllllllhlhlhlhlhlhlhlllllljlljljljlljlhjhjhjhllllckbbkkbknfmkbalannnnkkbknkkknkkknkbknnnkkkkkkknnnnnnnnkkkknnkkkkkkkkkkkkkknnnnnkbkkkkkkkkkkkkkknkkkkkbbkkkkkbkkbkkknnnbbbbbbabbbbbbllllllhlhlhljhlllllhjljljhjljhlllllhiiciiiaaabbnnmnk`kkkkbbbakbbbkbbbbbbbbkbbbbababbkbbkbbbbbbbbbbbabababbabaabbbbbbbaababaaaaabbababbabaaaaaaaaaaaaaabbbbbiabannnb``addahlllllljljll",
"jhjhjllhlllhllhlllhllllllllhjhjlllllljhjhjhjhljlllllllhlllllhlhllhlhlhlhlllhljhlllllllllhbbbbbkbknkkb`jamnnnnkkkkkkknnnnnkkkkknkkkkkkkknnnnnnkkkknnnnkkkkkkkkkkkkkkkkkkkkkkkkkkkbkkkknnknnkbkkkkkbkbkkbkbkbnnnkkkkkbbbbkbbdljhjhjljljlllllhlllllhlhllhlhljhlllli`lli`aabbkmmnnmakkkkbbbbbbbbkkkkbbbbbkbbbbbbbbbbbbkbbbkabbkbbbbbababbbaabababaaaababaabaabaabbbbbbaabababaaaababaaabbaibbaknmka`abbbillllllllllj",
"llljhjhjlllllllllhlllhlhlhllllhlhlhlhllhjllljlllljhjhljljllllllhllllhllllhlllhljlhllllllibdbbbbknkabkajbnnnnnnnkkbkknnnmkkkkkkknkkbkbkknnknmnnnnknnnnkkkkkkkkkkkkkkkkkkbkbkkbkbkbbkkkkknnkbkkkkbkkkkkkkkkkknnkbknkkkkbbbbkdlllllllhlhlhlhlljllllllllljljllllllliilc`abaabbknnnn`kkkkkkkkbabbbkkkbbbbbbbbbbababbbkbbkbkkbbbbbbbabababaabbabaaababaababaaaaaabababbbaaababaabbabaaaaaabb`abknkkka`abbbcljlljljllll",
"lllhjllllljhjhllljhllllllllhllllllllllllhlhlhlhlhlllljhlhllllljllllljlhjhjllllhlhllhllllibdkbabknnbbkalknnnnmmnnnkkkkknnkbbkknnknkkkkkkkkknnnnnnknnnkkkkkkkkkkkkkkbkkkkkkkkkkkkkbkkbknnknkkkkkkbkkkkkkkbbkbbkkbkkkkkbkbbkkkllhjhllljljljlllhlllhllhlhlhlhlllllhiic`aabbbbbbnmmn`kkbkkkkbbbbbbbbbbbbbbbbbkbbabbbbbbkbbkbbbbkbkbbbbbbaabbabababababaaabababaaabbbbbabaaaaaaaaabaaabaaaab`annnkbka`abbdilllllhllllh",
"lhlllhlhlhllllhjhlljljllllllllllhjhjhjhllllllllllllhlhllllhllhlhlhlhlhjllhjhlhllllllllll`ddbddaknmkkb`jnmnnknnkkkkkbkknnkknnkknnnkkkkkkknkknkbkknnnnnnnknnnkbkkkkkkkkkkkkkbkbkbkkkkknnnnnnkkbbbkkkkkkkkkkkbkbkbbkkbbbkkbkkbhllllhlllhlhlhllllllljljljlllljhjlll`ciakakbbkbbbknnakkkbkkkbbbkabbbkaabbbbkkbbbbbbbbbbbbbabbbkbbbkbabbbbababbabababbbbababaababbbbbbbbbbaaaababaaaabaaab`aibnmnkbnb`abbb`ljhlllllhll",
"lllhllllhllhlhlllllhlhlhlhllllllllllllllllhlhllhjlljllllllllhllhlhlhlhhhlhhlhlhhhhhhhhhlodddddddknmkdglknknnnnkkkkkkkkkkkkkkknnmkkkknkkbnkkknkknmnnnnnnknkkkkknbkkkkkknnknkkkkkkkkbnnknnnknnnnkbkbkbbbkbkkkbbbbbbkkbbkkkbkkljhlljlhlllllljhjhlllhlhlhlhllhllhlh`i`ababkbbkmbknmakkkbbkbbbbbbbbbabbbbabbbkbbbbbbabbbbbbbbbbbkbbbbbbbbbaabbababbbbbbbabaabbaabbbabbbabbbbaaaaaaaaabaaaa``annnnkbb`bbad`llllhlljlll",
"hlhllhlhllhlllhlhllllllllllllllhjhlllhjhlljhjhjhlhlhlhlhlhhhlhhhhhhhhhlhhllhhhhhhhhhhhhhhhhhhhhhghghhhhggghhghhhhhhgg`g`g`o`dddbddbbkkkkkkknnnkmnnmnnnkbnnnkbbbkbkbknkkbnknkkkknnkkkkkknnnnnmnkkkbkbkkkkbkkbkkbbbbkkkknnknklljhjhlljljhjllllljllljlllllhllhllllii`dbbbbbkbnnbkncbbbknkbabbkbbabbbbbbbbbbkbbbbabbbababbbbbbkkbkbbbbbbbabaababbbabababababbababbbbkbbbbbbaaaaaaabaaaabaa``mnmkkbb`bbdddllhllhlhlhl",
"ljllllllhllhlhllhlhhlhhlhhhhhhhlhlhhhlhhlhhlhhhhhhhhhhhhhhhhgghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhghghhghghhhhhhhhhhhhhhhhhhhhhhhchhhco`oddkknnmnnkknnnkknkkbbkkkkkkbkkkkkkkknmnnnnnnnnnkkbkbkbkbbkkbkkkkbbbkknkbknkkhlllhllhlhllhlhlhlhllhlhlllllllljhjlii`abbbbakbmnkkkibbbbkbbbbbkbbbabbbbbbakbkbbbkbabaabbabbkbbkbbkbbbbbbbbbbbaaaaabaaababaabbaabbbbbbbbbbbbabaaadaaaaaaabaa`knnkbdaadd`ddhlhlhlhlllh",
"lhlhlhlhlhllhlhlhhlhhlhhhlhhlhhhhhhhhhhhhhhhhhhhhhhhgghhggggogoogggghhhhhhhhggggggghhhhhhhhhhhhhhhhhhlghhhhhhhhhgghghhhhlhhhhhghghhhhhhhhhhhhhhhhhhgho`oknknmnnmnkkkbkkkkkkkkkkkkknnnkknnnnnnnkbkbbbkbkbkkkbkkbbkkknnkkkkkblllhllllhlllhlllllllhllllhlhlhjhlllh`i`abbabbbknnnkn`bbbabbbbknkkkbkkbbbbbbbkbbbkkbdbbbbbbbbbbbbkbbkbbabbbbbbbbbaabaabbaabababbbbbbdabbbbbbddadddddddddddddd`kmkdd`higio`ghhhhhhhhhhh",
"lhlllhllhlhlhlhhhhhhhhhhhhhhhhhhhghhhhhhhhhhhhhhgggghgggggggggggggghghhhhhhhhhhhhhhhhlljhlhhhhhhhhhhhhhhhhhhgggghhhhghggghghhhhhgghhhhhhhgghhhhghhhlhlhhhhhh`oddnnnnkkkkbkkkkkkkkkbkkknnnnnnnnkbkkkbbkkkbkbkbkbbbbbkkkkbkdblhlllllljhlljhlllllllllllljllllljhlli``aaabbanbnnknncaabbbbbbbbbbabbbbbkkbkbbbbbkkdbbdabbbbabbbbbbbkbabbbbbbbkkbbbbbababbbababaaabdbbkbkkbkdddd`oig`og`ghhhhhhhghhhhghhhhhhhhghhhgghh",
"hhhhhhhhhhhhhhhhghgggggggggggggggggggghghghggggghghghggggogggggogggggghhhhhhggoggggghhghhghggggghhhhhhhhhghghhhhgggggghghhhhgggggggggggghhhhhgghhhhghhhhllhhhhhglhgiodddnknnnnnkkkkkknnnkknnkkbbbbbkkbbkbkkkkkkbbbbbbbbdbbdlljhjhjhlljhllllllllllllllhlhjlllljli`i`baabbbbnnkkblbkkkbbbbkbbbbbbbbbbkbbbbbbbkbdabbdddabbbbbbbabbbbbbbabbabbbkbabbbbabbbbbbbdddddkddd`oihhlhhhhghgggghhhhhhhhhghhhhhhhghghghghgggg",
"hhhhhhhhhhhhhhghggggghghgghghghgggggggghgggggggggghhhhhhggggggggggggggggggggghhhghghhhhhhhhhhhhhgggghhhhghgggghghggggggggggggggggggghhhhhhghghhhhhhhgghhhhhhhhhhhhlhlhhhhhh`ddkkddbbkkkkkknkkkbkkkkbkkkbbbkbbkknnnnnkbbbkkkllhlllhllhlllhlhlhlhllhllhlllhlhlhlhiii`abbbbakkbba`ibbbbkbbkbbbababbkbbabbkkbbkbdbdbbabbbbbkkbkbbbkbbbbbbbbbabbkkbbbkbkbbdbbddd``o`ohhhhhhhhhhhhhhhlhhhhghggghhhhgghhhggggggggghgggg",
"gggggggogggggggggggggggggggggggggggghgggggggggggghghgghhhggggghgggggghhhhhggghhghhhhhhhhhhhhhgggghgggggghhhhhghghhhhghhhghghhhhhhhhhhhhhhhhhhhhghhhhhhhhhhhhhhhlhhghhhhhhhhhhhhhhhcg`bknnnnnnnnnnnknnnbbbbbbabkknnnnbbbkmnklllllllllllhllljllljlllllljhjllljlll`i`abababkaa`ii````aababbkkkkkkknnkbbbbbbbkbbabbnbkmnnmknknkkbkkkbbbbbkkkkbbkkddkkddd`gcglhhhhhhhhhhhhhhhhghghhhghhhgggggghghhhhhghhhgggghhhhhhhh",
"ggoggogogogoggggoggogoggggggghggggggghhgggggggggggggghghgggggggggggghghhhhhhhghhgghghhhhghgggggggggggghghgggghghhhhhhhhhhhhhhhghghhhhhghhhhhhhhlhhhhhhhhhhhhhhhhlhhhhhhlhhhhhhhlhlhhh`ddknnnknnnkknbnnnkabbbbbknnmnnnnnknnnhlllhjhjhjljlllhlllhllllllllllllhljhi`idkkbbabaiciiiccciabbabbknbbkkkkkbabbbbbbbbaabnnkkkmkknnnnkbbknkbdkkkknkkddo`ooggghhhghhhhhggggghghgghhhhhhhgghgggggggggghgggghggogghggghhhhggg",
"ggogoggoggggggoggggggggggggghggghgggggggggggggggghhgghgggggggggghhhhhhhhhhhhhhhhhhhlhhhhhhhhhhhhhhhhhhhhhghhghghhhhhhhhghghhhghgggghhhhhhhhhhhhhhhhhhgghhhhhhhhhhhhhhhhhhhhhhhhhhhhlhhhhhgddknnkkknknnkbbkkbbbkmnnnnnnnnnnncjhjlllllhlhlllljllljhjllllllllljllli`ibkkbbba`i`aaiccc`aka``abbkbkkkknnbkbaaabkbabbnnkbkknnnknnnkdddmkddo`gghhhhhhhchghhghhhghggggghgghhhhggghhhhhhhhhhggggghgggogogggghhhhhhhghgggg",
"hghghghghghhhhhhhghhhggghhghgggggogggggggggogggghghhgghgggggggggggghhhhhhhhhhghhhhhghhhhhhhhhhhhhhhhhhhhhhhhhhhghhhhhghhhhhhhhggghhhhhhhhhhhhhhhhghghhhhhghhhhhhhhhhghghghhhhhhhhhhhhhhlhhhhhgddbkmmmnkakkkbbbkbbbbbbnnmmnnhlllhjhljlljhjhlhlllhllhjhlllllhlhjhi`idbnkkkb```aa`ii``i```i`abbbbknbnkkbaaabbbbbabkmnkbbnnnmnkddo`oghhhhhgghhghhhhgghggghghgggggggggggghghgggghhhhhgogogggggghggggggghgghhghhhhhhhg",
"hhhghhhhhhhhhhhhhhhhghhghgggggggggggoggogoggggggghgghhgghggggggggghhhhhhhhhhghhghhhhhhhhhhhhhhghhhhghggghhhhhhhhhhgggggghhhhhgghghghhghhhhhhhhhhgghhhghhhhhhhhhhggggggggggghhhhhhhhhlhhhhlhhhhhhhhgdddbbbbbabkkkkbbaabkknmnllhllhllhlhllhllllhllllllllhlhllllhli`iabkknkbaaaa`aa```aa`icl`akkkkkkkkka`abaabbbbbbkndddndkd`oghhhhhhhhhhhhhghghhhghggggggghgggggoggggooggghhgogggghghhhgggggggggghhghghgghgghghggh",
"ggghghhhhhhhlhhhhgggggghgggghghghggggggoggggggggggghhghhhgggggghhhhhhhhhhghhhhghghhhhhhlllhhhhhhhhhhhhhhhhhhhhhhgghggggggghgggggggggggggggghgggghhhhggghghghhhhhgghghhhhhgghghhhhlhhhhhlhhhhlhhhlhlhhhhi`dkdddbbknkkkkkknnmlllhlllhlllhllhlhllhlhlhlhllllhlhlll````bbbbbabbaaabka`akkbicliannkkkbkkba`abbbdkkkbdkkdo`ghhhhhhhhhggghghhggggghggggghhgghghhggggoggghhhhghhhhhhhghgghhhhggohghhhhhgggogogggggggghgh",
"hghghghhhhhhhhhhhhgggggggghghghggggghggggggggggggggggggghhhhghghhhhhhhhgghggggggggghhhhhhhhhhhhhhhhhhhhhhhhhhhhhghggggggghghhhghggghghghhhhhhhhhhhhhhhhhhghhhhhhlhhhgggghhhhhhhhhhhhhhhhhhhhhhhlhhlhllhhhhh`dkkdkbbbbbbbkknlhlchlhllhllhlllllhlllllhllhlhlllhlhi`i`bbbbbbbbbabbbbaakkaiiliaknkkbkbbaddbddddddddohhhhhhhhhhhhhhhhggggggggggghhhhhggghghhhhgggoggggggggggghgggggggghghhhhhhhhhghggggggggggggghhhhh",
"gggggghghhhhhhhhggggggghhhghhhghhhgggggggggggggggogggggghgghgggggggggghhhhhhggggggggghhhhhhhhhhhgggghggghhhhhhhghgggggghhhhhhghghhhhhhhhhhhhhhhghhhghhhhhhhhhhhhhhhlhhhhgghgghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhgdnmnnnkbbbkblllllhlchlchlchlhllhlhchlchllchcllcliiiabakbbkbaaaaabaaakaaicciabknbbkbaddbddo`gggghhhhhhhhggggggghhgggggoggggggggogggggghghhhhghgggghhhhghhhhhggggggggggggggggggggggogoogggggggggggg",
"ghhhhhhhhhhhhghggggggghhhhhhhhhhgggggggggggggoggggggggghggggghghhhhhhhhhhhggghggghgghghghhhhhhhhhhhhhhhhhhhhhghggggggggghghghhghggghhhhllllhhhhgghgggghgghghhhhhhlhhhhhhhgghhhhhhhhhhhhhhhhhhhhhhhhhlhhhhlhlhhlhh`dknmkkbbdlllhlchllhllchllchlchllclllchlllhchlgciabbkbbbbabbbabbabbaailcc`abkkbd`iiihhhhhhhhgghghghgggggggggghhghggggoggogggggggghhhhghgggggggggggghggggghhgggggghggggghggggogogogggggggggghhhh",
"hhhhhhggggggghghhhhhhhhhhhhhhhhhhhhhhhhhhggggggohggggggggghhhhhhhhhhhhggggggggghghghghhhhhhhhhhhlhlhlhhhhhhgggggggggghghghhghhhhhhhhhhhlhhhhhhhggghhhhhhhhhhghghhhhhhhgggghhhhhhhhhhhhhhhhhhhhlllhhhhhhhhhhhlhhhllhlgakmkdglhlllllclcclllchllchlchlhchllhcllllccciabbabbbbbbababbaaaiiiiii`ddd`dgghhghhggghhhghhgggggggggggggggggggggogggggghhhhhhgggggggghhhhhhgghgggggggggggoggggghghggggggggggggggggghhghgggg",
"hhgggggggggghhhhhhhhhhlhhhhhhhhhhlhhhhhhgghghhhhhhhhhgggghghhhhhhhhhhhgggggggghgggggggggggggghhhhhhhhhhhhgggggggggggggggghhhhhhhhhghhhhhhlhhhhhhgghhhhjljllhhgggghghhhhghghgghhhhhhlhhhhhhhhhhhhlhlhhhhhhhhhhhhhhhhhhhhg`gchllhlhlljjjjljjljljllllllllllllhllhllhidbbaabaabbkkbbbbaa````igioihhhhghghhhghhgggggggggghhhhgggggggghhhgghgggggghghhgghhhhggggggogggggggggggghggggggoggggggoggghhhhhhhhhhhhhgggggggg",
"ggggggogggghghhhhhhhhhhhhhhhhhhhhhhhhggghghhhghhhhhhghghgghghhhhhhhhhgggggggggghgggggggggggghghhhhhhhhhgggggggggggghgggghhhghhhhhghghhhhhhhhhhhhhgghhlhjhjhhhhgghhhhhhhhhhghghghhhhhhhhhhhhhlllhhhhhhhhhhhhhhhhhhhhhhjhlhlhlhlhjjjjjjjjjjjjjjjjjjjjjjjjjjljllllhiiidbababbabbbknnkkdido`hhhhhhhhhhghgghghggghhgghgggggggggoggggoggggogggggoggggghgggggghggggggghgggggghhghggggogogghhggggggggggghhhggggggghggggg",
"ogogoggggggggggghghggggghhhghggghghghggggghghhhghghghhgggggggggghhhhghgggggggggggggggggggghgggggggghggggggggggggggghghhhhghhhhhhggghhhhhhhhhhhhhhgghhhhhhlhjhhhhhhhhghhhhhhhhghhhhhhhhhhhhhhhhhlhhhhhhhhhhhhlhhhhhhhjhhhlhlhlhllljjjjjjjjjjjjjjjjjjjjjjjjjjjjjjc`iibbbbbaaakbdkkkddighhhhhhhhhghgggggggghgghhhhghgggggggggggggggggogggggoggggggggghggggggggggggggogogghghhgggggggghhhhhhhhgghghhghghghhhgggggogo",
"ggogogogggggghhhhhhhhhhhhhghgghhghhhghhhgggggghhghgggghggggghhhhhhhghhhhgggggggggggggggghhghgggggghghghhghhhhgggggghghhghhhhhhggghghhhhhhhhhhhhhgghghhljhjhhhhhhhhghghgghhhhhhhghhhhhhhhlhhhhhhhhhhhhhghhhhhhhhhhhhhhhllhhhhlhlllljjjjjjjjjjjjjjjjjjjjjjjjjjjjlli``bababbddddddogggghhhhhghghgghgggggggghggghggggggggggoggoggggggggggggggggghgggggggggggggggggogggggghghghgggggogghhhhhhggggggggggggogogggoggogo",
"oogogogogogghgghhhhhhhhhhhhhhhhhhhhhhhgggggggggghghhhghghghhhhhhhhghgghghhhghhhhhhhhhhhhhghggggghgghghgghgghghhhgghghhghghhhhhhghhhhhhhhhhhhhhhhghghhhhhlhhhhhhhghhhhghhhhhhhhhhhhhhhhhhlhhlhhhhhhhhgghhhghhhhhhhhhhhhhhlhhhhhhhhlhlljjjjjjjjjjjjjjjjjjjjjjjjjjjiiibabbdbd`oghhhhghhghhohhhgggggghghgggghgggggggggggggogggggggogoggggggggogghhggggogoogggggogggggogggggggggggggggggghhgggggggggggggggggggogoogoo",
"ggogoggggggggghhhhhhhhhhhhhhhhhhhhgggggghhghhhhhhhhhhhhhhhhhhhhhgghggggggghhghhhhhhghggggggghggghghghghgghhhhhghhhghhghghggggggghhhhhhhhhghgggggghhhhhhhhhhhhhghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhghhhhhghhhlhhhhhlhhhhhlhlhlhhhlhjljjjjjjjjjjjjjjjjjjjjjjjjl```kbbd`ggihhhhgggghhghhghhghhhhggggggghgggggghhghggggggoogggggggggggggggoggggggggghhggogggggoggghhhhhhhgggggghgghghgggggggogogggggggggggggggogg",
"ggggggogggggghhhhhhhhlllhlhhhhhhgghhhhhhghhhhhhhhhhhhhhhhhhhhhhhhghghghghhhhhhhhhhhhhghggghghghghhhhhhghhhhhhhhhhhhhhhhgghhggghhghghhhhgghgggggggghhhhhhhhhhhghghhhhhhhhhhhhhhhhllhhhhhhhhhhhhhhhhhhhhgghhhhhhhhhhhhhhhlhhhhlhhhhhhhlhlhjjjjjjjjjjjjjjjjjjjjjjlhi``ddihhhhhhhghhhghhhghhghhhhhhggggggggggggghhghgghgggggggogghhhghhgooogggogggggggggggggogoggggggogggggoggghghhhghhggogggghhhhghgggggggggggogggg",
"gggggggghhhhhhhhhlhhhhhhhhhhhhghghhghghhhghghhhhhhhhhhhhhhhhhhgghgggghghhghhhhhghgggggggghgggggggggggghhhhhhhhhhhhhhhghhhggggggggggghghghghggggghhhhhhlhhhhhhhghhhhhhhhhhhhghghhhhhhhhhhhhghhhhghhhhhhhhhhhhhhhhllhhhhhhhhhhlhhhhhhhlhlhlhjjjjjjjjjjjjjjjjjjhlhcgggghghhhhhgghghgghgghgggggghhhhgggggghggggghhhgghhgggggogoggggghggghhgoogogoogggooogogogoggogogogogoggghhgggghhhhhghhgoghghhghhhhhhhgggoogggggh",
"ghghhhhhhhhhlhhhhhhhhhhhghhhhghhghghhghghhghggghhhhhhhhhhhhhghhhgghghghggghghghghghhghhghggghghgggggggghhhhhlhlhhhhhhhghhhhghggggggghghghgghgggggghhhhhhhhhghhhhhhhhhghhgghgggghhhhhhhhhghhhhhghhhhhhhhhhhhhhhhhhhllhhhhhhhhhhhhhhhhhhhlhlllljjjjjjjjjjjjljlhllhhghhghghhghgggghgghggggghhhhhhhhhghggggghgggggggghhggggogggogogggggggggggggggoggogggggggggggogoggghggggggghggggogggggggggoggggggoggggggggggggggg",
"hhhhhhhlhhhhhhhhhhhhhhhhhhghghghghghggggggggggggghhhhhhhhghghggggghghhghhhhhhhhghggghgghghhggggggggggggghhhhhhhhhhhhhhhhghgggghghgghghhghghgghggghhhhhhhhgggghghghghgghghghghhhhhhhhhlhhhhhghhghhhhhhhhhhhhhhlhhhhhhhhhhhhhhhhhlhhhhhlhhhlhhhhjljjjjjjllhhhhhhhhhhhggggogghhghhhggggggggggggghhhhhgghggghgggggggghhhhgggggggogoggggggggggggogogoggggggggggggggggggggggogggggggggogggggggoggggggghggghggggggggggg",
"hhhhhhhhhhhhhhhhhhhhhhhhhghhggggggggggggggggoggggggghghhghghghgghgghghhhhhhhhhhhghghgggggghghhhghggggghghhhhhhhhhhhhhhghhghhhghghgggghhghghghhhhhhghhhhghghgggggghggghghhhhhhhhhhhhhhhhhhhgggghhhhhhhhllhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhlhhlhlhhhlljjhjhlhlhhhhhhggggggggggggggggggggooggggggggggggggghghggggoggghgghhggggggggogogggooogggggoggogogogoggghghghhggggggggggooghhhhhgogggooggggogggghhhggggggghghghg",
"hhhhhhhghhhhhhhhhhhhhhhhghggggggggghhhghgggggggggghhghhhgghghghghghghhhhhhhhhgggggggghhghghghgghgggggggggggghhhhhhhhhhhhhhhhhhhggggghhhhhhhhghhhhhhhhhhgghghhhhghgghgghghghghhhhhhlhlhlhhhhhhhghhhhhhhhhhhhhhhhlhhhhhhghghhhhhhhhhhhhhlhhlhlhhlhhlhlhlhhhhhghhggggogggogggggghggggggghhggggggghgggggggggghggogggghghhggogggoggggoogggggggoggggggoggggggggggggggggggggggogggghhhghgggggggogoggggggggggggoggghhhhh",
"hhhhhhhhhhhhhhhhhhhhhhhggggggggggghghhhghhgggggggggghhghhhhghghggghhhhhhhhhhhghgggggggggghghghgggggogggggghhhghggghgghghhhhhhhhghgghghhhhhhhghghhhhhhghggghghhhhhhghghhghhghhhhhhhhlhjhlhhhhhhghhhhhhhhhhhhhhhhhhhhhhghhghghhhhhhhhhhhhlhlhhhhhhhhhlhhhgghggggggggghggghggghghhggoggghhhggggggggggghhgggghggggggghhhhgggogoggogoggggggggggghghgggggoggggogoogggggogggoggggghggggggoogogggggggghghghggogogogoggog",
"hhhhhhhhhhhhhggggggggggggggggghghghhhhhhgggggogggghgghhhhhhggggghghhhhhhhhhhghgggggggggghghhghgggogogggghhhhhggghggghghghhhhgggggghhhhhhhhhghggghhhhhhhghgghhhhhhhhhhhhhhhhhghhhhhhhhhhhhhhhhgghhghhhhhhghhhhhhhhhhhhgghhhhghhhlhhhhhhhhhhhhhhhhllhhlhhhhggggggoghghggoggoggggggggggghhgggggghggghghgggggggggggghhhhhgoogoggoggggooggghggggggggghggogoggggggggggggoggggggghghhhhggggggoggghgggggggggooooogogoggg",
"hghhhhhhhhhhggggggggggghhhhhhhhhhhhhhhhgghgggggggghghhhhhghghghhhhhhhhhhhhhggggggggggghhhhghhggggggggghghghgghhghghgggggghggghghgghhhhhhhhhhgggggghhhhhhhhhhgghghhhhhhhhhhhhhhhhlhhhhhhhhhhhhggghhhhhhhgghghhhhhhghghhhghghhhhhhhhhhhhhhhlhlhlhhhhlhhhhhgggggggggghgggggoggggggggggghhhggghggggggggggggggoogggghhhhgoggggggggggggogghhhggggogghhghggghggghgggggggggogooogghhhghhhhhggggghhgggogogogoogogoogogogg",
"ghghhhhhgggggggghhhhhhhhhhhhhhhhhhhhhhgghgggghghghghghgggggghhhhhhhhhhhhhhggggggggghghghggggghghgghhhhhhhhhhggggggggggggggghgghggghghhhhhhhgghghhhhghhhhhhhhhhhhhhhghhhhhhhhhhllhlhhhhhhhhhhhhghghhgggghhhhhhhhhhhhghghhghhhghhhhhhhhhhlhhhlhlhhlhhhhhhlghhggoggggggogghggogggggggghhghghggghgghggoggogggggggoogggggggggogoggogogggogghhggogghhhhhggggghhggggoooooooogggoggggghhghhhgghggggggogoghgghgggggoggggg",
"ghghggggggggggggghghhhhhhhhhlhhhhhhhhhhhgghggghggggggggghghhghghhhhhhhghhggggggggggggggggggggggghhghghhhhhhghgghghggggogggggggggggghhhhhhggggghghhhhghhhhhhhhhhhggghhhhhlhlhlhhlhhhhhhhhhhhhhghghghhhghhgghhhhlhlhhhghghhhghhhhhhhhhhhhhhhhlhhhhhhhlhhhhhlhhhggoggggggooggggoggggggghhhhggggghgggggggggggggogogghgggggghhggggggghhgggggogoggggggggggggggggggggogogoggooggggggggggggggogoggggoggggggggghggggogggg",
"hgggggghghggghghgghghhhhhhhhhhlhhhhhhhhghghhhghgggggghhhghghghhhhhhghghgghghhgggoogogogggghghhgghgghghghghghgghgggggggggggghggggggggghhggggghghhhhghghggghghhhhhhhghhhhhhlhlhlhhhhhhghhhlhhhhhgghhhhhhgghhhhhhhhhhhhhhhghghhhhhhhhhhhghhhhhhhhhhlhhhhhhhlhhhhhhhgggggghhggooggggggoggggggggghghhgooggggogogggggggggghhhhhhgggoghhhggogooggggggggggggogghhggogogoggoggggogggggggggggogogggooogoggoggggggggoggoggg",
"ghghghhghhhhhghgggggghhhhhhhlhhhlhhhhhghghghhghggggggghhgggghgggggghhhhhhhhggggggggoggggghghhhhghgggggggggggggggggggggoggghghghgggggggghggggggggghhhhghghgghhhhhhhghhlhhlhhlhlhhhhhghhhlhllhhhhhhhhhhhhhhhhhhhhhhhhhhhgggghhhhhhhhlhhhhhhhlhlhhhlhhhhhhhhlhhhhhhhhggggggogoggggggggggggggghggghgggoogogoggoogogggggghhhhhhgggggggggggogggggggooggogoggghgggoogoogoggogogoggghgggggggggggghggggggggggggggoggogogg",
"hhhhhhhhhghghggggggghhhhhhhhhhhhhhhhhhgggggggggggggghgggghgggghghghhhhhhhhgggggggoggggghhhhhhhhhghgghghhggggggggggggggggggggggggggghghghgghghgghhhhghghgghhhhhhhhggghhlhlhlhlhlhhhghhhhhlhlhhhhhhhhhhhhhhhhhhhhhhhhhhgggghhhhhhhlhhlhlhhlhhlhhhhhhhllhhhhlhhhhhhhhggggghggghggghgghhgggghhggggghggggoggggoggggggggogggghhhgghggggghgggggghgggggggggggggggooggogggggogogoggggghggggoooogoggggggggggggggggggoggggg",
"hhhhhhhhghggggggggghghhhhhhhhhhhhhhhhggggggggggggggggggggggghghghhhhhhhggggggggoggggghhhhhhhhhhhhghgghggggggghghggggogggogggggghgghggghghghgggggggghghhhhhhhlllhhhghhhhhlhhlhlhhhhhghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhghhhhhgghhjljhlhhlhlhhlhhhhhhlhhhhlhjhhlhhjhhhhhggghhhoghhgggggghhggggogggghhggggggggoggggggggggggggoggghgggggghhggogggghgggggogggggoggggghghghhhgggggggggggggoggggggggggggogggoggggggogogggg",
"hhhhggggggggggggggghhhhhhhhhhhhhhhhggggggggggggghhhghghghghgghgghhhghgggghgggggggggghhhhhhhhhhhhghghggghgghhhhhghgggggggggggghggghgghgghhhgghgghghhgghghhhlllhlhhhhhhhhhhhhhhhhhhhgghhhhhhhhhhhhlllhlhhhhhhhhhghhhhhhhhhhhhhhhlhjhlhhlhhhhhhhhhlhlhhhhllhhlhjhllhhlhlhggggogooggggggggogggggoggggggooggogggggggggggggggggggghggggggggogoggggggooogogggggggggghghhhhhhhhhhhhggggggggoggghhhhhggggogggghggggoooogg",
"gggggghggggggggggghgghhhhhhhhhhghgghghggggggggghggggghghggghggghghggghghhhghgggghghhghhhhhhhhhhghhhghggggggghhghghgggggogoggggghgghghghhghghgghghhhghghhhhlhhlhlhhhhhhhhhhhhhhhhhhhghhhhhhhgghhhhlhjhlhlhhhhhhhhhhhhhhhhhhhhhhhhlljlhhhlhhhhhhhhhhlhjhhhjhlhhhgjhhhhhhhhoggoogggoogghggghgggggggggoggggogoggoogggggghgghggghggggggogogogoooggghggoggggggggghhhhhhhhhhhhhhhhggghgggogoggghhhhhggogoghhhhhhgggggog"
};

View File

@@ -0,0 +1,55 @@
.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

View File

@@ -0,0 +1,13 @@
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.

View File

@@ -0,0 +1,446 @@
/* NetHack 3.6 txt2iff.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>
#include <clib/dos_protos.h>
#include <clib/iffparse_protos.h>
#ifndef _DCC
#include <proto/exec.h>
#include <proto/iffparse.h>
#include <proto/dos.h>
#endif
void panic(const char *);
void map_colors(void);
int BestMatch(int, int, int);
extern pixval ColorMap[3][MAXCOLORMAPSIZE];
extern int colorsinmap;
/*
* WARNING:
* This program carries forth the assumption that the colormaps in all
* of the .txt files are the same. This is a bug.
*/
struct {
int Height;
int Width;
} IFFScreen;
/*
* 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 */
#ifndef _DCC
extern
#endif
struct Library *IFFParseBase;
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;
int findcolor(register pixel *pix);
void packwritebody(pixel (*tile)[TILE_X], char **planes, int tileno);
void
error(char *str)
{
fprintf(stderr, "ERROR: %s\n", str);
}
/*
* This array maps the image colors to the amiga's first 16 colors. The
* colors
* are reordered to help with maintaining dripen settings.
*/
int colrmap[] = { 0, 6, 9, 15, 4, 10, 2, 3, 5, 11, 7, 13, 8, 1, 14, 12 };
/* How many tiles fit across and down. */
#define COLS 20
#define ROWS ((tiles + COLS - 1) / COLS)
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;
char **planes;
if (argc != 3) {
fprintf(stderr, "Usage: %s source destination\n", argv[0]);
exit(1);
}
#if defined(_DCC) || defined(__GNUC__)
IFFParseBase = OpenLibrary("iffparse.library", 0);
if (!IFFParseBase) {
error("unable to open iffparse.library");
exit(1);
}
#endif
/* First, count the files in the file */
if (fopen_text_file(argv[1], "r") != TRUE) {
perror(argv[1]);
return (1);
}
nplanes = 0;
i = colorsinmap - 1; /*IFFScreen.Colors - 1; */
while (i != 0) {
nplanes++;
i >>= 1;
}
planes = malloc(nplanes * sizeof(char *));
if (planes == 0) {
error("can not allocate planes pointer");
exit(1);
}
while (read_text_tile(pixels) == TRUE)
++tiles;
fclose_text_file();
IFFScreen.Width = COLS * TILE_X;
IFFScreen.Height = ROWS * TILE_Y;
pbytes = (COLS * ROWS * TILE_X + 15) / 16 * 2 * TILE_Y;
for (i = 0; i < nplanes; ++i) {
planes[i] = calloc(1, pbytes);
if (planes[i] == 0) {
error("can not allocate planes pointer");
exit(1);
}
}
/* Now, process it */
if (fopen_text_file(argv[1], "r") != TRUE) {
perror(argv[1]);
return (1);
}
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 = IFFScreen.Width;
bmhd.h = IFFScreen.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 = TILE_X;
bmhd.pageHeight = TILE_Y;
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);
/* We need to reorder the colors to get reasonable default pens but
* we also need to know where some of the colors are - so go find out.
*/
map_colors();
cmap = malloc((colors = (1L << nplanes)) * sizeof(AmiColorMap));
for (i = 0; i < colors; ++i) {
cmap[colrmap[i]].r = ColorMap[CM_RED][i];
cmap[colrmap[i]].g = ColorMap[CM_GREEN][i];
cmap[colrmap[i]].b = ColorMap[CM_BLUE][i];
}
PushChunk(iff, ID_BMAP, ID_CMAP, IFFSIZE_UNKNOWN);
for (i = 0; i < colors; ++i)
WriteChunkBytes(iff, &cmap[i], 3);
PopChunk(iff);
cnt = 0;
while (read_text_tile(pixels) == TRUE) {
packwritebody(pixels, planes, cnt);
if (cnt % 20 == 0)
printf("%d..", cnt);
++cnt;
fflush(stdout);
}
pdat.nplanes = nplanes;
pdat.pbytes = pbytes;
pdat.xsize = TILE_X;
pdat.ysize = TILE_Y;
pdat.across = COLS;
pdat.down = ROWS;
pdat.npics = cnt;
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);
printf("\n%d tiles converted\n", cnt);
#if defined(_DCC) || defined(__GNUC__)
CloseLibrary(IFFParseBase);
#endif
exit(0);
}
findcolor(register pixel *pix)
{
register int i;
for (i = 0; i < MAXCOLORMAPSIZE; ++i) {
if ((pix->r == ColorMap[CM_RED][i])
&& (pix->g == ColorMap[CM_GREEN][i])
&& (pix->b == ColorMap[CM_BLUE][i])) {
return (i);
}
}
return (-1);
}
void
packwritebody(pixel (*tile)[TILE_X], char **planes, int tileno)
{
register int i, j, k, col;
register char *buf;
register int across, rowbytes, xoff, yoff;
/* how many tiles fit across? */
across = COLS;
/* How many bytes per pixel row */
rowbytes = ((IFFScreen.Width + 15) / 16) * 2;
/* How many bytes to account for y distance in planes */
yoff = ((tileno / across) * TILE_Y) * rowbytes;
/* How many bytes to account for x distance in planes */
xoff = (tileno % across) * (TILE_X / 8);
/* For each row... */
for (i = 0; i < TILE_Y; ++i) {
/* For each bitplane... */
for (k = 0; k < nplanes; ++k) {
const int mask = 1l << k;
/* Go across the row */
for (j = 0; j < TILE_X; j++) {
col = findcolor(&tile[i][j]);
if (col == -1) {
error("can not convert pixel color to colormap index");
return;
}
/* Shift the colors around to have good complements and to
* know the dripen values.
*/
col = colrmap[col];
/* To top left corner of tile */
buf = planes[k] + yoff + xoff;
/*To i'th row of tile and the correct byte for the j'th
* pixel*/
buf += (i * rowbytes) + (j / 8);
/* Or in the bit for this color */
*buf |= (((col & mask) != 0) << (7 - (j % 8)));
}
}
}
}
/* #define DBG */
/* map_colors
* The incoming colormap is in arbitrary order and has arbitrary colors in
* it, but we need (some) specific colors in specific places. Find the
* colors we need and fix the mapping table to match.
*/
/* What we are aiming for: */
/* XXX was 0-7 */
#define CX_BLACK 0
#define CX_WHITE 1
#define CX_BROWN 11
#define CX_CYAN 2
#define CX_GREEN 5
#define CX_MAGENTA 10
#define CX_BLUE 4
#define CX_RED 7
/* we don't care about the rest, at least now */
/* should get: black white blue red grey greyblue ltgrey */
void
map_colors()
{
int x;
#if 1
int tmpmap[] = { 0, 2, 3, 7, 4, 5, 8, 9, 10, 11, 13, 15, 12, 1, 14, 6 };
/* still not right: gray green yellow lost somewhere? */
#else
int tmpmap[16];
int x, y;
for (x = 0; x < 16; x++)
tmpmap[x] = -1; /* set not assigned yet */
tmpmap[BestMatch(0, 0, 0)] = CX_BLACK;
tmpmap[BestMatch(255, 255, 255)] = CX_WHITE;
tmpmap[BestMatch(255, 0, 0)] = CX_RED;
tmpmap[BestMatch(0, 255, 0)] = CX_GREEN;
tmpmap[BestMatch(0, 0, 255)] = CX_BLUE;
/* clean up the rest */
for (x = 0; x < 16; x++) {
for (y = 0; y < 16; y++)
if (tmpmap[y] == x)
goto outer_cont;
for (y = 0; y < 16; y++)
if (tmpmap[y] == -1) {
tmpmap[y] = x;
break;
}
if (y == 16)
panic("too many colors?");
outer_cont:
;
}
for (x = 0; x < 16; x++)
if (tmpmap[y] == -1)
panic("lost color?");
#endif
for (x = 0; x < 16; x++) {
#ifdef DBG
printf("final: c[%d]=%d (target: %d)\n", x, tmpmap[x], colrmap[x]);
#endif
colrmap[x] = tmpmap[x];
}
}
BestMatch(r, g, b) int r, g, b;
{
int x;
int bestslot;
int bestrate = 99999999L;
for (x = 0; x < 16; x++) {
int rr = r - ColorMap[CM_RED][x];
int gg = g - ColorMap[CM_GREEN][x];
int bb = b - ColorMap[CM_BLUE][x];
int rate = rr * rr + gg * gg + bb * bb;
if (bestrate > rate) {
bestrate = rate;
bestslot = x;
}
}
#ifdef DBG
printf("map (%d,%d,%d) -> %d (error=%d)\n", r, g, b, bestslot, bestrate);
#endif
return bestslot;
}
long *
alloc(unsigned int n)
{
long *ret = malloc(n);
if (!ret) {
error("Can't allocate memory");
exit(1);
}
return (ret);
}
void
panic(const char *msg)
{
fprintf(stderr, "PANIC: %s\n", msg);
exit(1);
}

1660
outdated/sys/amiga/winami.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,57 @@
/* 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 FDECL(amii_raw_print, (const char *));
void FDECL(amii_raw_print_bold, (const char *));
void FDECL(amii_start_menu, (winid , unsigned long ));
void FDECL(amii_add_menu, (winid , char , int , const char *, unsigned int));
void FDECL(amii_end_menu, (winid , char , const char * , const char *));
char FDECL(amii_select_menu, (winid ));
void NDECL(amii_update_inventory );
void NDECL(amii_mark_synch );
void NDECL(amii_wait_synch );
void NDECL(amii_setclipped );
void FDECL(amii_cliparound, (int , int ));
void NDECL(amii_askname );
void NDECL(amii_player_selection );
void NDECL(flush_output );
void FDECL(amii_destroy_nhwindow, (winid ));
int FDECL(amii_create_nhwindow, (int ));
void NDECL(amii_init_nhwindows );
int NDECL(amii_get_ext_cmd);
char FDECL(amii_yn_function, (const char * , const char * , char ));
void FDECL(amii_addtopl, (const char *));
void FDECL(TextSpaces, (struct RastPort * , int ));
void FDECL(amii_putstr, (winid , int , const char *));
void FDECL(amii_putsym, (winid , int , int , CHAR_P ));
void FDECL(amii_clear_nhwindow, (winid ));
void FDECL(amii_exit_nhwindows, (const char *));
int FDECL(amii_nh_poskey, (int * , int * , int *));
int NDECL(amii_nhgetch );
void NDECL(amii_get_nh_event );
void NDECL(amii_remember_topl );
int NDECL(amii_doprev_message );
void FDECL(amii_display_nhwindow, (winid , boolean ));
void FDECL(amii_display_file, (const char * , boolean ));
void FDECL(amii_curs, (winid , int , int ));
void FDECL(amii_print_glyph, (winid , xchar , xchar , int, int ));
void FDECL(DoMenuScroll, (int , int ));
void FDECL(DisplayData, (int , int , int ));
void FDECL(SetPropInfo, (struct Window * , struct Gadget * , long , long , long ));
void FDECL(kill_nhwindows, (int ));
void FDECL(amii_cl_end, (struct amii_WinDesc * , int ));
void FDECL(cursor_off, (winid ));
void FDECL(cursor_on, (winid ));
void NDECL(amii_getret );
void FDECL(amii_getlin, (const char * , char *));
void FDECL(getlind, (const char * , char * , const char *));
void FDECL(amii_suspend_nhwindows, (char * ));
void NDECL(amii_resume_nhwindows);
void NDECL(amii_bell);
void NDECL(EditColor);
void FDECL(DrawCol, ( struct Window *, int, UWORD * ) );
void FDECL( DispCol, ( struct Window *w, int idx, UWORD * ) );
void FDECL( SetBorder, (struct Gadget *) );
void NDECL( port_help );
void FDECL( dismiss_nhwindow, (winid) );

1200
outdated/sys/amiga/winchar.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,203 @@
/* NetHack 3.6 windefs.h $NHDT-Date: 1432512795 2015/05/25 00:13:15 $ $NHDT-Branch: master $:$NHDT-Revision: 1.7 $ */
/* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1991,1992,1993. */
/* NetHack may be freely redistributed. See license for details. */
#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>
#include <devices/console.h>
#include <devices/conunit.h>
#include <graphics/gfxbase.h>
#include <intuition/intuition.h>
#include <intuition/intuitionbase.h>
#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"
#endif
#include "wintype.h"
#include "winami.h"
#include "func_tab.h"
#ifndef CLIPPING
CLIPPING must be defined for the AMIGA version
#endif
#undef LI
#undef CO
/*#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>
#include <proto/layers.h>
#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
#ifndef __SASC_60
#undef index
#define index strchr
#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("amitile", windowprocs.name) == 0)
#define WINVERS_AMIT (strcmp("amitty", windowprocs.name) == 0)
/* cw->data[x] contains 2 characters worth of special information. These
* characters are stored at the offsets as described here.
*/
#define VATTR 0 /* Video attribute is in this slot */
#define SEL_ITEM 1 /* If this is a select item, slot is 1 else 0 */
#define SOFF 2 /* The string starts here. */
#undef NULL
#define NULL 0L
/*
* Versions we need of various libraries. We can't use LIBRARY_VERSION
* as defined in <exec/types.h> because some of the libraries we need
* don't have that version number in the 1.2 ROM.
*/
#define LIBRARY_FONT_VERSION 34L
#define LIBRARY_TILE_VERSION 37L
/* These values are just sorta suggestions in use, but are minimum
* requirements
* in reality...
*/
#define WINDOWHEIGHT 192
#define SCREENHEIGHT 200
#define WIDTH 640
/* This character is a solid block (cursor) in Hack.font */
#define CURSOR_CHAR 0x90
#define FONTHEIGHT 8
#define FONTWIDTH 8
#define FONTBASELINE 8
#define MAPFTWIDTH 8
#define MAPFTHEIGHT 8
#define MAPFTBASELN 6
/* If Compiling with the "New Look", redefine these now */
#ifdef INTUI_NEW_LOOK
#define NewWindow ExtNewWindow
#define NewScreen ExtNewScreen
#endif
#define SIZEOF_DISKNAME 8
#define CSI '\x9b'
#define NO_CHAR -1
#define RAWHELP 0x5F /* Rawkey code of the HELP key */
#define C_BLACK 0
#define C_WHITE 1
#define C_BROWN (WINVERS_AMIV ? 11 : 2)
#define C_CYAN (WINVERS_AMIV ? 2 : 3)
#define C_GREEN (WINVERS_AMIV ? 5 : 4)
#define C_MAGENTA (WINVERS_AMIV ? 10 : 5)
#define C_BLUE (WINVERS_AMIV ? 4 : 6)
#define C_RED 7
#define C_ORANGE 3
#define C_GREY 6
#define C_LTGREEN 8
#define C_YELLOW 9
#define C_GREYBLUE 12
#define C_LTBROWN 13
#define C_LTGREY 14
#define C_PEACH 15
/* Structure describing tile files */
struct PDAT
{
long nplanes; /* Depth of images */
long pbytes; /* Bytes in a plane of data */
long across; /* Number of tiles across */
long down; /* Number of tiles down */
long npics; /* Number of pictures in this file */
long xsize; /* X-size of a tile */
long ysize; /* Y-size of a-tile */
};
#undef MAXCOLORS
#define MAXCOLORS 256

148
outdated/sys/amiga/winext.h Normal file
View File

@@ -0,0 +1,148 @@
/* NetHack 3.6 winext.h $NHDT-Date: 1432512794 2015/05/25 00:13:14 $ $NHDT-Branch: master $:$NHDT-Revision: 1.7 $ */
/* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1991,1992,1993. */
/* NetHack may be freely redistributed. See license for details. */
extern int reclip;
#ifdef CLIPPING
extern int clipping;
extern int clipx;
extern int clipy;
extern int clipxmax;
extern int clipymax;
extern int xclipbord, yclipbord;
#endif
extern int CO;
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 */
extern struct window_procs amii_procs;
extern struct window_procs amiv_procs;
extern unsigned short amii_initmap[AMII_MAXCOLORS];
extern unsigned short amiv_init_map[AMII_MAXCOLORS];
extern unsigned short amii_init_map[AMII_MAXCOLORS];
extern int bigscreen;
extern int amii_numcolors;
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;
extern int amii_statBPen;
extern int amii_menuAPen;
extern int amii_menuBPen;
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;
extern struct TextAttr Hack80;
extern struct TextAttr TextsFont13;
extern struct Window *pr_WindowPtr;
extern struct Menu HackMenu[];
extern struct Menu *MenuStrip;
extern struct NewMenu GTHackMenu[];
extern APTR *VisualInfo;
extern unsigned char KbdBuffered;
extern struct TextFont *TextsFont;
extern struct TextFont *HackFont;
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;
extern struct Image Image1;
extern struct Gadget MenuScroll;
/* This gadget is for the message window... */
extern struct PropInfo MsgPropScroll;
extern struct Image MsgImage1;
extern struct Gadget MsgScroll;
extern struct TagItem tags[];
extern struct win_setup {
struct NewWindow newwin;
UWORD offx, offy, maxrow, rows, maxcol, cols; /* CHECK TYPES */
} new_wins[];
extern UWORD scrnpens[];
/* The last Window event is stored here for reference. */
extern WEVENT lastevent;
extern const char winpanicstr[];
extern struct TagItem scrntags[];
extern struct NewScreen NewHackScreen;
extern int topl_addspace;
extern char spaces[76];
extern int wincnt; /* # of nh windows opened */
extern struct Rectangle lastinvent, lastmsg;
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 enum {
COL_MAZE_BRICK,
COL_MAZE_STONE,
COL_MAZE_HEAT,
COL_MAZE_WOOD
} MazeType;
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;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,94 @@
/* NetHack 3.6 winkey.c $NHDT-Date: 1432512794 2015/05/25 00:13:14 $ $NHDT-Branch: master $:$NHDT-Revision: 1.7 $ */
/* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1991,1992,1993. */
/* NetHack may be freely redistributed. See license for details. */
#include "NH:sys/amiga/windefs.h"
#include "NH:sys/amiga/winext.h"
#include "NH:sys/amiga/winproto.h"
amii_nh_poskey(x, y, mod) int *x, *y, *mod;
{
struct amii_WinDesc *cw;
WETYPE type;
struct RastPort *rp;
struct Window *w;
if (cw = amii_wins[WIN_MESSAGE]) {
cw->wflags &= ~FLMAP_SKIP;
if (scrollmsg)
cw->wflags |= FLMSG_FIRST;
cw->disprows = 0;
}
if (WIN_MAP != WIN_ERR && (cw = amii_wins[WIN_MAP]) && (w = cw->win)) {
cursor_on(WIN_MAP);
} else
panic("no MAP window opened for nh_poskey\n");
rp = w->RPort;
while (1) {
type = WindowGetevent();
if (type == WEMOUSE) {
*mod = CLICK_1;
if (lastevent.un.mouse.qual)
*mod = 0;
/* X coordinates are 1 based, Y are 1 based. */
*x = ((lastevent.un.mouse.x - w->BorderLeft) / mxsize) + 1;
*y = ((lastevent.un.mouse.y - w->BorderTop - MAPFTBASELN)
/ mysize) + 1;
#ifdef CLIPPING
if (clipping) {
*x += clipx;
*y += clipy;
}
#endif
return (0);
} else if (type == WEKEY) {
lastevent.type = WEUNK;
return (lastevent.un.key);
}
}
}
int
amii_nhgetch()
{
int ch;
struct amii_WinDesc *cw = amii_wins[WIN_MESSAGE];
if (WIN_MAP != WIN_ERR && amii_wins[WIN_MAP]) {
cursor_on(WIN_MAP);
}
if (cw)
cw->wflags &= ~FLMAP_SKIP;
ch = WindowGetchar();
return (ch);
}
void
amii_get_nh_event()
{
/* nothing now - later I have no idea. Is this just a Mac hook? */
}
void
amii_getret()
{
register int c;
raw_print("");
raw_print("Press Return...");
c = 0;
while (c != '\n' && c != '\r') {
if (HackPort)
c = WindowGetchar();
else
c = getchar();
}
return;
}

1461
outdated/sys/amiga/winmenu.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,154 @@
/* NetHack 3.6 winproto.h $NHDT-Date: 1433806597 2015/06/08 23:36:37 $ $NHDT-Branch: master $:$NHDT-Revision: 1.9 $ */
/* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1991,1992,1993. */
/* NetHack may be freely redistributed. See license for details. */
/* winreq.c */
void EditColor(void);
void EditClipping(void);
void DrawCol(struct Window *w, int idx, UWORD *colors);
void DispCol(struct Window *w, int idx, UWORD *colors);
void amii_change_color(int, long, int);
char *amii_get_color_string();
void amii_getlin(const char *prompt, char *bufp);
void getlind(const char *prompt, char *bufp, const char *dflt);
char *amii_get_color_string(void);
int filecopy(char *from, char *to);
char *basename(char *str);
char *dirname(char *str);
/* winstr.c */
void amii_putstr(winid window, int attr, const char *str);
void outmore(struct amii_WinDesc *cw);
void outsubstr(struct amii_WinDesc *cw, char *str, int len, int fudge);
void amii_putsym(winid st, int i, int y, CHAR_P c);
void amii_addtopl(const char *s);
void TextSpaces(struct RastPort *rp, int nr);
void amii_remember_topl(void);
long CountLines(winid);
long FindLine(winid, int);
int amii_doprev_message(void);
void flushIDCMP(struct MsgPort *);
int amii_msgborder(struct Window *);
void amii_scrollmsg(register struct Window *w,
register struct amii_WinDesc *cw);
/* winkey.c */
int amii_nh_poskey(int *x, int *y, int *mod);
int amii_nhgetch(void);
void amii_get_nh_event(void);
void amii_getret(void);
/* winmenu.c */
void amii_start_menu(winid window, unsigned long);
void FDECL(amii_add_menu, (winid, int, const anything *, CHAR_P, CHAR_P, int,
const char *, unsigned int));
void FDECL(amii_end_menu, (winid, const char *));
int FDECL(amii_select_menu, (winid, int, menu_item **));
int DoMenuScroll(int win, int blocking, int how, menu_item **);
void ReDisplayData(winid win);
void DisplayData(winid win, int start);
void SetPropInfo(struct Window *win, struct Gadget *gad, long vis, long total,
long top);
/* amiwind.c */
struct Window *OpenShWindow(struct NewWindow *nw);
void CloseShWindow(struct Window *win);
int ConvertKey(struct IntuiMessage *message);
int kbhit(void);
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, int bkglyph);
void start_glyphout(winid window);
void amii_end_glyphout(winid window);
struct NewWindow *DupNewWindow(struct NewWindow *win);
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);
/* winfuncs.c */
void amii_destroy_nhwindow(winid win);
int amii_create_nhwindow(int type);
void amii_init_nhwindows(int *, char **);
void amii_setdrawpens(struct Window *, int type);
void amii_sethipens(struct Window *, int type, int attr);
void amii_setfillpens(struct Window *, int type);
void amii_clear_nhwindow(winid win);
void dismiss_nhwindow(winid win);
void amii_exit_nhwindows(const char *str);
void amii_display_nhwindow(winid win, boolean blocking);
void amii_curs(winid window, int x, int y);
void kill_nhwindows(int all);
void amii_cl_end(struct amii_WinDesc *cw, int i);
void cursor_off(winid window);
void cursor_on(winid window);
void amii_suspend_nhwindows(const char *str);
void amii_resume_nhwindows(void);
void amii_bell(void);
void removetopl(int cnt);
void port_help(void);
void amii_print_glyph(winid win, xchar x, xchar y, int glyph, int bkglyph);
void amii_raw_print(const char *s);
void amii_raw_print_bold(const char *s);
void amii_update_inventory(void);
void amii_mark_synch(void);
void amii_wait_synch(void);
void amii_setclipped(void);
void amii_cliparound(int x, int y);
void amii_set_text_font(char *font, int size);
BitMapHeader ReadImageFiles(char **, struct BitMap **, char **);
BitMapHeader ReadTileImageFiles(void);
void FreeImageFiles(char **, struct BitMap **);
void FreeTileImageFiles();
/* winami.c */
#ifdef SHAREDLIB
int __UserLibInit(void);
void __UserLibCleanup(void);
#endif
void amii_askname(void);
void amii_player_selection(void);
void RandomWindow(char *name);
int amii_get_ext_cmd(void);
char amii_yn_function(const char *prompt, const char *resp, char def);
char amii_yn_function(const char *query, const char *resp, char def);
void amii_display_file(const char *fn, boolean complain);
void SetBorder(struct Gadget *gd);
void *malloc(register unsigned size);
void free(void *q);
#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
/* amirip.c */
void FDECL(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
void FreeTileImageFiles(void);

1022
outdated/sys/amiga/winreq.c Normal file

File diff suppressed because it is too large Load Diff

492
outdated/sys/amiga/winstr.c Normal file
View File

@@ -0,0 +1,492 @@
/* NetHack 3.6 winstr.c $NHDT-Date: 1432512795 2015/05/25 00:13:15 $ $NHDT-Branch: master $:$NHDT-Revision: 1.7 $ */
/* Copyright (c) Gregg Wonderly, Naperville, Illinois, 1991,1992,1993. */
/* NetHack may be freely redistributed. See license for details. */
#include "NH:sys/amiga/windefs.h"
#include "NH:sys/amiga/winext.h"
#include "NH:sys/amiga/winproto.h"
/* Put a string into the indicated window using the indicated attribute */
void
amii_putstr(window, attr, str)
winid window;
int attr;
const char *str;
{
int fudge;
int len;
struct Window *w;
register struct amii_WinDesc *cw;
char *ob;
int i, j, n0, bottom, totalvis, wheight;
static int wrapping = 0;
/* Always try to avoid a panic when there is no window */
if (window == WIN_ERR) {
window = WIN_BASE;
if (window == WIN_ERR)
window = WIN_BASE = amii_create_nhwindow(NHW_BASE);
}
if (window == WIN_ERR || (cw = amii_wins[window]) == NULL) {
iflags.window_inited = 0;
panic(winpanicstr, window, "putstr");
}
w = cw->win;
if (!str)
return;
amiIDisplay->lastwin = window; /* do we care??? */
/* NHW_MENU windows are not opened immediately, so check if we
* have the window pointer yet
*/
if (w) {
/* Set the drawing mode and pen colors */
SetDrMd(w->RPort, JAM2);
amii_sethipens(w, cw->type, attr);
} else if (cw->type != NHW_MENU && cw->type != NHW_TEXT) {
panic("NULL window pointer in putstr 2: %d", window);
}
/* Okay now do the work for each type */
switch (cw->type) {
case NHW_MESSAGE:
if (WINVERS_AMIV)
fudge = 2;
else {
/* 8 for --more--, 1 for preceeding sp, 1 for putstr pad */
fudge = 10;
}
/* There is a one pixel border at the borders, so subtract two */
bottom = amii_msgborder(w);
wheight = (w->Height - w->BorderTop - w->BorderBottom - 3)
/ w->RPort->TxHeight;
if (scrollmsg || wheight > 1)
fudge = 0;
amii_scrollmsg(w, cw);
while (isspace(*str))
str++;
strncpy(toplines, str, TBUFSZ);
toplines[TBUFSZ - 1] = 0;
/* For initial message to be visible, we need to explicitly position
* the
* cursor. This flag, cw->curx == -1 is set elsewhere to force the
* cursor to be repositioned to the "bottom".
*/
if (cw->curx == -1) {
amii_curs(WIN_MESSAGE, 1, bottom);
cw->curx = 0;
}
/* If used all of history lines, move them down */
if (cw->maxrow >= iflags.msg_history) {
if (cw->data[0])
free(cw->data[0]);
memcpy(cw->data, &cw->data[1],
(iflags.msg_history - 1) * sizeof(char *));
cw->data[iflags.msg_history - 1] =
(char *) alloc(strlen(toplines) + 5);
strcpy(cw->data[i = iflags.msg_history - 1] + SOFF
+ (scrollmsg != 0),
toplines);
} else {
/* Otherwise, allocate a new one and copy the line in */
cw->data[cw->maxrow] = (char *) alloc(strlen(toplines) + 5);
strcpy(cw->data[i = cw->maxrow++] + SOFF + (scrollmsg != 0),
toplines);
}
cw->data[i][SEL_ITEM] = 1;
cw->data[i][VATTR] = attr + 1;
if (scrollmsg) {
cw->curx = 0;
cw->data[i][2] = (cw->wflags & FLMSG_FIRST) ? '>' : ' ';
}
str = cw->data[i] + SOFF;
if (cw->curx + strlen(str) >= (cw->cols - fudge)) {
int i;
char *ostr = (char *) str;
char *p;
while (cw->curx + strlen(str) >= (cw->cols - fudge)) {
for (p = ((char *) &str[cw->cols - 1 - cw->curx]) - fudge;
!isspace(*p) && p > str;)
--p;
if (p < str)
p = (char *) str;
if (p == str) {
/* p = (char *)&str[ cw->cols ]; */
outmore(cw);
continue;
}
i = (long) p - (long) str;
outsubstr(cw, (char *) str, i, fudge);
cw->curx += i;
while (isspace(*p))
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);
}
if (*str) {
if (str != ostr) {
outsubstr(cw, "+", 1, fudge);
cw->curx += 2;
}
while (isspace(*str))
++str;
outsubstr(cw, (char *) str, i = strlen((char *) str), fudge);
cw->curx += i;
amii_cl_end(cw, cw->curx);
}
} else {
outsubstr(cw, (char *) str, i = strlen((char *) str), fudge);
cw->curx += i;
amii_cl_end(cw, cw->curx);
}
cw->wflags &= ~FLMSG_FIRST;
len = 0;
if (scrollmsg) {
totalvis = CountLines(window);
SetPropInfo(w, &MsgScroll,
(w->Height - w->BorderTop - w->BorderBottom)
/ w->RPort->TxHeight,
totalvis, totalvis);
}
i = strlen(toplines + SOFF);
cw->maxcol = max(cw->maxcol, i);
cw->vwy = cw->maxrow;
break;
case NHW_STATUS:
if (cw->data[cw->cury] == NULL)
panic("NULL pointer for status window");
ob = &cw->data[cw->cury][j = cw->curx];
if (g.context.botlx)
*ob = 0;
/* Display when beam at top to avoid flicker... */
WaitTOF();
Text(w->RPort, (char *) str, strlen((char *) str));
if (cw->cols > strlen(str))
TextSpaces(w->RPort, cw->cols - strlen(str));
(void) strncpy(cw->data[cw->cury], str, cw->cols);
cw->data[cw->cury][cw->cols - 1] = '\0'; /* null terminate */
cw->cury = (cw->cury + 1) % 2;
cw->curx = 0;
break;
case NHW_MAP:
case NHW_BASE:
if (cw->type == NHW_BASE && wrapping) {
amii_curs(window, cw->curx + 1, cw->cury);
TextSpaces(w->RPort, cw->cols);
if (cw->cury < cw->rows) {
amii_curs(window, cw->curx + 1, cw->cury + 1);
TextSpaces(w->RPort, cw->cols);
cw->cury--;
}
}
amii_curs(window, cw->curx + 1, cw->cury);
Text(w->RPort, (char *) str, strlen((char *) str));
cw->curx = 0;
/* CR-LF is automatic in these windows */
cw->cury++;
if (cw->type == NHW_BASE && cw->cury >= cw->rows) {
cw->cury = 0;
wrapping = 1;
}
break;
case NHW_MENU:
case NHW_TEXT:
/* always grows one at a time, but alloc 12 at a time */
if (cw->cury >= cw->rows || !cw->data) {
char **tmp;
/* Allocate 12 more rows */
cw->rows += 12;
tmp = (char **) alloc(sizeof(char *) * cw->rows);
/* Copy the old lines */
for (i = 0; i < cw->cury; i++)
tmp[i] = cw->data[i];
if (cw->data) {
free(cw->data);
cw->data = NULL;
}
cw->data = tmp;
/* Null out the unused entries. */
for (i = cw->cury; i < cw->rows; i++)
cw->data[i] = 0;
}
if (!cw->data)
panic("no data storage");
/* Shouldn't need to do this, but... */
if (cw->data && cw->data[cw->cury]) {
free(cw->data[cw->cury]);
cw->data[cw->cury] = NULL;
}
n0 = strlen(str) + 1;
cw->data[cw->cury] = (char *) alloc(n0 + SOFF);
/* avoid nuls, for convenience */
cw->data[cw->cury][VATTR] = attr + 1;
cw->data[cw->cury][SEL_ITEM] = 0;
Strcpy(cw->data[cw->cury] + SOFF, str);
if (n0 > cw->maxcol)
cw->maxcol = n0;
if (++cw->cury > cw->maxrow)
cw->maxrow = cw->cury;
break;
default:
panic("Invalid or unset window type in putstr()");
}
}
void
amii_scrollmsg(w, cw)
register struct Window *w;
register struct amii_WinDesc *cw;
{
int bottom, wheight;
bottom = amii_msgborder(w);
wheight =
(w->Height - w->BorderTop - w->BorderBottom - 3) / w->RPort->TxHeight;
if (scrollmsg) {
if (++cw->disprows > wheight) {
outmore(cw);
cw->disprows = 1; /* count this line... */
} else {
ScrollRaster(w->RPort, 0, w->RPort->TxHeight, w->BorderLeft,
w->BorderTop + 1, w->Width - w->BorderRight - 1,
w->Height - w->BorderBottom - 1);
}
amii_curs(WIN_MESSAGE, 1, bottom);
}
}
int
amii_msgborder(w)
struct Window *w;
{
register int bottom;
/* There is a one pixel border at the borders, so subtract two */
bottom = w->Height - w->BorderTop - w->BorderBottom - 2;
bottom /= w->RPort->TxHeight;
if (bottom > 0)
--bottom;
return (bottom);
}
void
outmore(cw)
register struct amii_WinDesc *cw;
{
struct Window *w = cw->win;
if ((cw->wflags & FLMAP_SKIP) == 0) {
if (scrollmsg) {
int bottom;
bottom = amii_msgborder(w);
ScrollRaster(w->RPort, 0, w->RPort->TxHeight, w->BorderLeft,
w->BorderTop + 1, w->Width - w->BorderRight - 1,
w->Height - w->BorderBottom - 1);
amii_curs(WIN_MESSAGE, 1, bottom); /* -1 for inner border */
Text(w->RPort, "--more--", 8);
} else
Text(w->RPort, " --more--", 9);
/* Make sure there are no events in the queue */
flushIDCMP(HackPort);
/* Allow mouse clicks to clear --more-- */
WindowGetchar();
if (lastevent.type == WEKEY && lastevent.un.key == '\33')
cw->wflags |= FLMAP_SKIP;
}
if (!scrollmsg) {
amii_curs(WIN_MESSAGE, 1, 0);
amii_cl_end(cw, cw->curx);
}
}
void
outsubstr(cw, str, len, fudge)
register struct amii_WinDesc *cw;
char *str;
int len;
int fudge;
{
struct Window *w = cw->win;
if (cw->curx) {
/* Check if this string and --more-- fit, if not,
* then put out --more-- and wait for a key.
*/
if ((len + fudge) + cw->curx >= cw->cols) {
if (!scrollmsg)
outmore(cw);
} else {
/* Otherwise, move and put out a blank separator */
Text(w->RPort, spaces, 1);
cw->curx += 1;
}
}
Text(w->RPort, str, len);
}
/* Put a graphics character onto the screen */
void
amii_putsym(st, i, y, c)
winid st;
int i, y;
CHAR_P c;
{
amii_curs(st, i, y);
Text(amii_wins[st]->win->RPort, &c, 1);
}
/* Add to the last line in the message window */
void
amii_addtopl(s)
const char *s;
{
register struct amii_WinDesc *cw = amii_wins[WIN_MESSAGE];
while (*s) {
if (cw->curx == cw->cols - 1)
amii_putstr(WIN_MESSAGE, 0, "");
amii_putsym(WIN_MESSAGE, cw->curx + 1, amii_msgborder(cw->win), *s++);
cw->curx++;
}
}
void
TextSpaces(rp, nr)
struct RastPort *rp;
int nr;
{
if (nr < 1)
return;
while (nr > sizeof(spaces) - 1) {
Text(rp, spaces, (long) sizeof(spaces) - 1);
nr -= sizeof(spaces) - 1;
}
if (nr > 0)
Text(rp, spaces, (long) nr);
}
void
amii_remember_topl()
{
/* ignore for now. I think this will be done automatically by
* the code writing to the message window, but I could be wrong.
*/
}
int
amii_doprev_message()
{
struct amii_WinDesc *cw;
struct Window *w;
char *str;
if (WIN_MESSAGE == WIN_ERR || (cw = amii_wins[WIN_MESSAGE]) == NULL
|| (w = cw->win) == NULL) {
panic(winpanicstr, WIN_MESSAGE, "doprev_message");
}
/* When an interlaced/tall screen is in use, the scroll bar will be there
*/
/* Or in some other cases as well */
if (scrollmsg) {
struct Gadget *gd;
struct PropInfo *pip;
int hidden, topidx, i, total, wheight;
for (gd = w->FirstGadget; gd && gd->GadgetID != 1;)
gd = gd->NextGadget;
if (gd) {
pip = (struct PropInfo *) gd->SpecialInfo;
wheight = (w->Height - w->BorderTop - w->BorderBottom - 2)
/ w->RPort->TxHeight;
hidden = max(cw->maxrow - wheight, 0);
topidx = (((ULONG) hidden * pip->VertPot) + (MAXPOT / 2)) >> 16;
for (total = i = 0; i < cw->maxrow; ++i) {
if (cw->data[i][1] != 0)
++total;
}
i = 0;
topidx -= wheight / 4 + 1;
if (topidx < 0)
topidx = 0;
SetPropInfo(w, &MsgScroll, wheight, total, topidx);
DisplayData(WIN_MESSAGE, topidx);
}
return (0);
}
if (--cw->vwy < 0) {
cw->maxcol = 0;
DisplayBeep(NULL);
str = "\0\0No more history saved...";
} else
str = cw->data[cw->vwy];
amii_cl_end(cw, 0);
amii_curs(WIN_MESSAGE, 1, 0);
amii_setdrawpens(amii_wins[WIN_MESSAGE]->win, NHW_MESSAGE);
Text(w->RPort, str + SOFF, strlen(str + SOFF));
cw->curx = cw->cols + 1;
return (0);
}

View File

@@ -0,0 +1,363 @@
/* 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];
}

1
outdated/sys/atari/.gitattributes vendored Normal file
View File

@@ -0,0 +1 @@
* NH_filestag=(file%s_for_Atari_version_-_untested_for_3.7)

View File

@@ -0,0 +1,124 @@
Instructions for compiling and installing NetHack 3.6
on a TOS system
=====================================================
(or, How to make ST NetHack 3.6)
Last revision: 2 February 2000
1. Make sure all the NetHack files are in the appropriate directory structure.
You should have a main directory with subdirectories dat, doc, include,
src, util, sys\atari, sys\share, sys\unix, and at least one of win\tty
and win\gem. You may have other subdirectories under sys and win, but
they needn't concern you. If you do not follow this structure, the
Makefiles will not function properly. The .c files for the main program
belong in src, those for utility programs in util, and Atari-specific
ones in sys\atari. All the .h files belong in include, the documentation
in doc, and assorted data files in dat. You may also use random.c from
sys\share. The Makefiles belong in sys\unix. (A more detailed
explanation of the directory structure may be found in Files, which
should be in the top directory.)
2. If you don't already have a good command line interpreter, get one.
Doing all of the following from the desktop or a GEM shell will
probably be a *big* pain. If you can get a Bourne shell compatible
one, and put it in \bin\sh, then you'll save yourself some trouble
with the Makefiles. There are several good shells on various
FTP sites (including atari.archive.umich.edu).
Run the "setup.g" shell script in sys\atari. This will setup all the
makefiles and other files in the appropriate directories. It assumes
that your compiler prefers \ to / as a directory separator. If not,
simply copy the makefiles instead of running sed on them.
3. Now go to the include subdirectory to edit a couple of the header files
there.
First edit config.h according to the comments to match your system and
desired set of features. In particular:
make sure that UNIX is *not* defined, and TOS is (if you're using
the MiNT library, and/or the -mint option to gcc, this will
be done automatically)
make sure that HACKDIR is defined properly (or not at all)
make sure that COMPRESS is not defined
Also edit tosconf.h; this shouldn't need much changing. If you are not
going to include random.c you will need to comment out RANDOM. Gcc users
don't need RANDOM, since the gcc and MiNT libraries have a Berkeley
derived srandom() function already. If you have no termcap support and
don't want to use the supplied termcap.uu, comment out TERMLIB. Gcc has
a termcap library, so TERMLIB should always be "on" with gcc (and you
don't need to worry about termcap.uu at all).
4. If you want to change the high score list behavior, examine the top of
topten.c, in the src directory. You may want to change the definitions of
PERSMAX, POINTSMIN, and ENTRYMAX. I set POINTSMIN to 51 and ENTRYMAX to
50 to keep the size of the score list down.
5. Go to the src directory and edit your Makefile. You'll want the Systos
target configuration; the comments explain most of what needs to be done,
at least for the gcc.
Next, go to the top, util, dat, and doc directories, and edit the Makefiles
there, as necessary. You'll need nroff and/or TeX to do the files in doc;
if you don't have one/both of these, you can skip it (docs?? we don't need
no steenking docs :-)).
If you elected to use Fred Fish's termcap library (bundled in as
termcap.arc), you will have to generate termcap.a from those sources.
If you are recompiling after patching your sources, or if you got your
files from somewhere other than the official distribution, "touch
makedefs.c" to ensure that certain files (onames.h and pm.h) are remade,
lest potentially troublesome timestamps fool "make."
8. Now, enter "make all", and take a long siesta; your computer will be
occupied for a long time. If all goes well, you will get an executable.
If you tried to compile in too many features, you will probably get a
dysfunctional executable, and will have to start over.
Hint 1: If you're short on memory, you might enter "make -n all
>make.bat," and then run script.bat with some sort of batch
program or with the gulam command "script make.bat."
Hint 2: You'll save yourself a lot of grief if you use the GNU
version of the "make" program. Some of the smaller makes aren't
completely compatible. GNU software for the Atari is widely
available; for example, by anonymous FTP from atari.archive.umich.edu.
9. Make sure the support files -- data, rumors, cmdhelp, opthelp, help, hh,
history, license, and oracles, or simply nhdat if DLB was defined --
were copied to the game directory. If not, move them there from the
dat directory yourself. rumors can be created manually by entering
"makedefs -r;" data by entering "makedefs -d."
Also, make sure that the various level files (*.lev, from the dat
subdirectory) were copied over correctly. If you're not sure what files
should have been made, double check with Makefile.dat.
10. Go to the src\atari directory. Copy atari.cnf to your game directory
as NetHack.cnf. Edit it to reflect your particular setup and personal
preferences, following the comments.
If you compiled in the TERMLIB feature, also move the "termcap" file to
your game directory. (Note: gcc's termcap routines have built-in
defaults, so the termcap file is not necessary with that compiler.)
If you're running NetHack from the MultiTOS desktop, and you want a
more useful set of drop down menus than the plain system "File/Edit"
ones, copy nethack.mnu to your games directory. This file contains a
menu definition that puts a lot of the common commands into the menu.
11. Play NetHack. If it works, you're done!
Notes
-----
1) Save files and bones files from previous versions will not work with
NetHack 3.4. Don't bother trying to keep them.
2) To install an update of NetHack after changing something, enter "make"
from the src directory. If you add, delete, or reorder monsters or
objects, or you change the format of saved level files, delete any save
and bones files. (Trying to use such files sometimes produces amusing
confusions on the game's part, but more often produces crashes.)

View File

@@ -0,0 +1,119 @@
table
!"#$%&'()*+,-./0123456789:;<=>?
@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
begin 644 hackfnt.arc
M&@A(04-+1DY4+E!21P E!, #\48JO>BQ\= ,8#0 #" S4 ,! ! &@!Bz
M8 "#D!2 > . !Q_P%!5= 'D!0(GN10.X('EB9,Z1L+0"<,&1!DY<M[(T0$By
MC9LY=<R823,F31DW=$"T*=-&9IX&"@8B.<<#APF*($8L&[@!CY*0 #8 ,J-@x
M!+^!"1=J?;$ I$-.)@" 6 . 0;1U "B\!< A"3P< TPPP,//&"$0*RI" K *w
M (1 PP$&MA0$B B@4HJ"401@#<0.:@BD@((#P%8A,18&0<(QPX$!ISL R( v
M0%(/ %0 H ' !XH!V HC&$%L8,$1P32#,>*5L<@-B,#H(!<(N' 8XIH'SYK<u
M!(@ Y Y=DX=#(:KFME N X-*_(1P#2_ <,WF7E$(!(#<@@@K;7W(!9 &R0Bt
M, '%__P##@"R -*&#2XL\<TP5@E1Q L#D/5# 3\0X$00WGS%0%J=./-"9ED1s
M\B%5<(R8%1UF 2" -!FVA4<"*O @$@8O4&AA$%P\D18>3.CQSX057EA26DQ\r
MPP$/)REU#@XPB$ 1!G0 0$(: &!033IT8:&$"0KPY1<)0XR@#%5_4<F"$A"<q
MX00#$ 0A!D\,( " %( $( 9-,@)P!$JFL&"GE809 8)>O90D1D<"*$)%H((p
M\1T&9O C)HDD(,.H$I#R \9 B%1Z::9HFB&+HHQ*\Q4@$&2 !" R (!$,"!Lo
MB<0;",#!#S"!4 -(-<!H.6E6<)#PE9V:0"$(& 1(D<04@3 0@5IG&. L G@n
M.9D;[(#APK0@G$'!M-5J 8#W$8+KAD(,*OLM>P(L0$8"*1J 3#1,GNM,T),m
M8$< (PQ#%1UHGB%!I5*81\>GD8;JCA"2@" %H 4R0 ')RW% P@\ZO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RFF]ZO4(>@*5DALD88 3SV:LDC % <)OYV45- ;..XQT7e
MM$(M! ::): %"@8V "?)=YD^) .*DD?VD42"I(5Z@,7FJ'8IGG9JD4(T%Z_d
M][:40TU86**__*&^I$*2?3D[/1!2Q "&\ D8\*[MI4XW>GU<B+9.K:?("0##c
M\ ?+^0_."3\3)2W;:P=RQ@;829O^B0>G=4%:)*6#M:5M68T$4(%MU8BJZJC[b
MTP"ZHP-9P]:7"@D'X(<BL3\EW:GXI#L'L*, \ E30"GI-MP$IPN=-P]JKS+a
M-!!3A[!WI*U@@ _IYE:-)!)@X#DEO0!DH -<< 9N4 =<P 9S5P!G, 9C\ 5Cz
M\ 9M <?_@5?, <K(0=T$ -S-S)? =A( =S4 8U/G<#$ "<\ 4U?@;SN1#=y
M(Q9PX.-R$.(B,>0#L %T@ 9A, 9KD%5TX (Z+@"X$.(C7N(G7N6XH.)B$ 8Wx
M3A]B@0<JW@9A8!,#4>72\ 4+P1(V409*O@%\H.)E@ =I$"4J(A)63N)OP 9Rw
M\ 5D$ 9^N35L/@!$4 1&$ 15$.> H.)H@.-P\.5^61 JSN(U'B4I7A1N\ : v
M+N@B,0!%7@9T4.=XKN.4_A-VD 8QX09Q3@B53@=K, =IH =QC@A?\!)RL.EBu
MON2,<.MV'B4+P>5?8.9H'NQZK@]?8!-WKN=Z#@^W'N@K 1;'$>IN0 :O$^>#t
M(1(0$,T,@ Z@ +2H@ *X (H &H 0( .KQ !"8*)6P ZP $0X #C3@$ s
# !H r
q
end

View File

@@ -0,0 +1,53 @@
# Sample .mnu file for NetHack
# This will work only with MINIWIN v1.1
# or TOSWIN v2.0 (or better)
#%title "NetHack"
#%about "About NetHack" "v"
File
"Shell" "!"
"Options" "O"
---
"Save Game" "S"
---
"Quit" ?"[1][Really quit?][ Yes | No ]":%A"#quit y":!
Edit
"Copy" %C
"Paste" %P
"Paste Options..." %O
---
"Set Font..." %F
Inventory
"Show Inventory" "i"
--
"Put on jewelry" "P"
"Remove jewelry" "R"
"Wear armor" "W"
"Take off armor" "T"
"Wield weapon" "w"
"Exchange weapons" "x"
"Ready ammo in quiver" "Q"
---
"Eat" "e"
"Quaff potion" "q"
---
"Drop" "d"
"Throw" "t"
"Fire" "f"
Move
"North" "k" 4800
"South" "j" 5000
"East" "l" 4d00
"West" "h" 4b00
---
"Rest" "."
---
"Open door" "o"
"Close door" "c"
Misc
"Help" "?" 6200
"List known spells" "+"
"Cast spell" "Z"
---
"Abort" 001b 6100

View File

@@ -0,0 +1,17 @@
# gulam shell script -- should work with tcsh and many
# other Atari shells, too
# UNIX shells use '/' in file names, but at least some Atari shells need '\'
# so we process the UNIX makefiles to make that switch
# sed script not included as a here document in this script because at
# least some Atari shells don't do that
sed -f unx2atar.sed < ..\unix\Makefile.top > ..\..\Makefile
sed -f unx2atar.sed < ..\unix\Makefile.dat > ..\..\dat\Makefile
sed -f unx2atar.sed < ..\unix\Makefile.doc > ..\..\doc\Makefile
sed -f unx2atar.sed < ..\unix\Makefile.src > ..\..\src\Makefile
sed -f unx2atar.sed < ..\unix\Makefile.utl > ..\..\util\Makefile
# KLUDGE to fix a Makefile problem
echo > ..\..\include\win32api.h

379
outdated/sys/atari/tos.c Normal file
View File

@@ -0,0 +1,379 @@
/* NetHack 3.6 tos.c $NHDT-Date: 1501979358 2017/08/06 00:29:18 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.8 $ */
/* NetHack may be freely redistributed. See license for details. */
/*
* TOS system functions.
*/
#define NEED_VARARGS
#include "hack.h"
#ifdef TTY_GRAPHICS
#include "tcap.h"
#else
/* To avoid error for tos.c; will be removed later */
static char *nh_HE = "\033q";
#endif
#ifdef TOS
#include <osbind.h>
#ifndef WORD
#define WORD short /* 16 bits -- redefine if necessary */
#endif
#include <ctype.h>
static char NDECL(DOSgetch);
static char NDECL(BIOSgetch);
static void NDECL(init_aline);
char *_a_line; /* for Line A variables */
#ifdef TEXTCOLOR
boolean colors_changed = FALSE;
#endif
int
tgetch()
{
char ch;
/* BIOSgetch can use the numeric key pad on IBM compatibles. */
if (iflags.BIOS)
ch = BIOSgetch();
else
ch = DOSgetch();
return ((ch == '\r') ? '\n' : ch);
}
/*
* Keyboard translation tables.
*/
#define KEYPADLO 0x61
#define KEYPADHI 0x71
#define PADKEYS (KEYPADHI - KEYPADLO + 1)
#define iskeypad(x) (KEYPADLO <= (x) && (x) <= KEYPADHI)
/*
* Keypad keys are translated to the normal values below.
* When iflags.BIOS is active, shifted keypad keys are translated to the
* shift values below.
*/
static const struct pad {
char normal, shift, cntrl;
} keypad[PADKEYS] =
{
{ C('['), 'Q', C('[') }, /* UNDO */
{ '?', '/', '?' }, /* HELP */
{ '(', 'a', '(' }, /* ( */
{ ')', 'w', ')' }, /* ) */
{ '/', '/', '/' }, /* / */
{ C('p'), '$', C('p') }, /* * */
{ 'y', 'Y', C('y') }, /* 7 */
{ 'k', 'K', C('k') }, /* 8 */
{ 'u', 'U', C('u') }, /* 9 */
{ 'h', 'H', C('h') }, /* 4 */
{ '.', '.', '.' },
{ 'l', 'L', C('l') }, /* 6 */
{ 'b', 'B', C('b') }, /* 1 */
{ 'j', 'J', C('j') }, /* 2 */
{ 'n', 'N', C('n') }, /* 3 */
{ 'i', 'I', C('i') }, /* Ins */
{ '.', ':', ':' } /* Del */
},
numpad[PADKEYS] = {
{ C('['), 'Q', C('[') }, /* UNDO */
{ '?', '/', '?' }, /* HELP */
{ '(', 'a', '(' }, /* ( */
{ ')', 'w', ')' }, /* ) */
{ '/', '/', '/' }, /* / */
{ C('p'), '$', C('p') }, /* * */
{ '7', M('7'), '7' }, /* 7 */
{ '8', M('8'), '8' }, /* 8 */
{ '9', M('9'), '9' }, /* 9 */
{ '4', M('4'), '4' }, /* 4 */
{ '.', '.', '.' }, /* 5 */
{ '6', M('6'), '6' }, /* 6 */
{ '1', M('1'), '1' }, /* 1 */
{ '2', M('2'), '2' }, /* 2 */
{ '3', M('3'), '3' }, /* 3 */
{ 'i', 'I', C('i') }, /* Ins */
{ '.', ':', ':' } /* Del */
};
/*
* Unlike Ctrl-letter, the Alt-letter keystrokes have no specific ASCII
* meaning unless assigned one by a keyboard conversion table, so the
* keyboard BIOS normally does not return a character code when Alt-letter
* is pressed. So, to interpret unassigned Alt-letters, we must use a
* scan code table to translate the scan code into a letter, then set the
* "meta" bit for it. -3.
*/
#define SCANLO 0x10
static const char scanmap[] = {
/* ... */
'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', '\n', 0, 'a',
's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '\'', '`', 0, '\\', 'z', 'x',
'c', 'v', 'b', 'N', 'm', ',', '.', '?' /* ... */
};
#define inmap(x) (SCANLO <= (x) && (x) < SCANLO + SIZE(scanmap))
/*
* BIOSgetch gets keys directly with a BIOS call.
*/
#define SHIFT (0x1 | 0x2)
#define CTRL 0x4
#define ALT 0x8
static char
BIOSgetch()
{
unsigned char scan, shift, ch;
const struct pad *kpad;
long x;
/* Get scan code.
*/
x = Crawcin();
ch = x & 0x0ff;
scan = (x & 0x00ff0000L) >> 16;
/* Get shift status.
*/
shift = Kbshift(-1);
/* Translate keypad keys */
if (iskeypad(scan)) {
kpad = iflags.num_pad ? numpad : keypad;
if (shift & SHIFT)
ch = kpad[scan - KEYPADLO].shift;
else if (shift & CTRL)
ch = kpad[scan - KEYPADLO].cntrl;
else
ch = kpad[scan - KEYPADLO].normal;
}
/* Translate unassigned Alt-letters */
if ((shift & ALT) && !ch) {
if (inmap(scan))
ch = scanmap[scan - SCANLO];
return (isprint(ch) ? M(ch) : ch);
}
return ch;
}
static char
DOSgetch()
{
return (Crawcin() & 0x007f);
}
long
freediskspace(path)
char *path;
{
int drive = 0;
struct {
long freal; /*free allocation units*/
long total; /*total number of allocation units*/
long bps; /*bytes per sector*/
long pspal; /*physical sectors per allocation unit*/
} freespace;
if (path[0] && path[1] == ':')
drive = (toupper(path[0]) - 'A') + 1;
if (Dfree(&freespace, drive) < 0)
return -1;
return freespace.freal * freespace.bps * freespace.pspal;
}
/*
* Functions to get filenames using wildcards
*/
int
findfirst(path)
char *path;
{
return (Fsfirst(path, 0) == 0);
}
int
findnext()
{
return (Fsnext() == 0);
}
char *
foundfile_buffer()
{
return (char *) Fgetdta() + 30;
}
long
filesize(file)
char *file;
{
if (findfirst(file))
return (*(long *) ((char *) Fgetdta() + 26));
else
return -1L;
}
/*
* Chdrive() changes the default drive.
*/
void
chdrive(str)
char *str;
{
char *ptr;
char drive;
if ((ptr = index(str, ':')) != (char *) 0) {
drive = toupper(*(ptr - 1));
(void) Dsetdrv(drive - 'A');
}
return;
}
void
get_scr_size()
{
#ifdef MINT
#include <ioctl.h>
struct winsize win;
char *tmp;
if ((tmp = nh_getenv("LINES")))
LI = atoi(tmp);
else if ((tmp = nh_getenv("ROWS")))
LI = atoi(tmp);
if (tmp && (tmp = nh_getenv("COLUMNS")))
CO = atoi(tmp);
else {
ioctl(0, TIOCGWINSZ, &win);
LI = win.ws_row;
CO = win.ws_col;
}
#else
init_aline();
LI = (*((WORD *) (_a_line + -42L))) + 1;
CO = (*((WORD *) (_a_line + -44L))) + 1;
#endif
}
#define BIGBUF 8192
int
_copyfile(from, to)
char *from, *to;
{
int fromfd, tofd, r;
char *buf;
fromfd = open(from, O_RDONLY | O_BINARY, 0);
if (fromfd < 0)
return -1;
tofd = open(to, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, FCMASK);
if (tofd < 0) {
close(fromfd);
return -1;
}
buf = (char *) alloc((unsigned) BIGBUF);
while ((r = read(fromfd, buf, BIGBUF)) > 0)
write(tofd, buf, r);
close(fromfd);
close(tofd);
free((genericptr_t) buf);
return 0; /* successful */
}
int
kbhit()
{
return Cconis();
}
static void
init_aline()
{
#ifdef __GNUC__
/* line A calls nuke registers d0-d2,a0-a2; not all compilers regard these
as scratch registers, though, so we save them
*/
asm(" moveml d0-d2/a0-a2, sp@-");
asm(" .word 0xa000; movel d0, __a_line");
asm(" moveml sp@+, d0-d2/a0-a2");
#else
asm(" movem.l d0-d2/a0-a2, -(sp)");
asm(" .dc.w 0xa000"); /* tweak as necessary for your compiler */
asm(" move.l d0, __a_line");
asm(" movem.l (sp)+, d0-d2/a0-a2");
#endif
}
#ifdef TEXTCOLOR
/* used in termcap.c to decide how to set up the hilites */
unsigned long tos_numcolors = 2;
void
set_colors()
{
static char colorHE[] = "\033q\033b0";
if (!iflags.BIOS)
return;
init_aline();
tos_numcolors = 1 << (((unsigned char *) _a_line)[1]);
if (tos_numcolors <= 2) { /* mono */
iflags.use_color = FALSE;
return;
} else {
colors_changed = TRUE;
nh_HE = colorHE;
}
}
void
restore_colors()
{
static char plainHE[] = "\033q";
if (colors_changed)
nh_HE = plainHE;
colors_changed = FALSE;
}
#endif /* TEXTCOLOR */
#ifdef SUSPEND
#include <signal.h>
#ifdef MINT
extern int __mint;
#endif
int
dosuspend()
{
#ifdef MINT
extern int kill();
if (__mint == 0) {
#endif
pline("Sorry, it seems we have no SIGTSTP here. Try ! or S.");
#ifdef MINT
} else if (signal(SIGTSTP, SIG_IGN) == SIG_DFL) {
suspend_nhwindows((char *) 0);
(void) signal(SIGTSTP, SIG_DFL);
(void) kill(0, SIGTSTP);
get_scr_size();
resume_nhwindows();
} else {
pline("I don't think your shell has job control.");
}
#endif /* MINT */
return (0);
}
#endif /* SUSPEND */
#endif /* TOS */

View File

@@ -0,0 +1,23 @@
: loop
/\\$/N
/\\$/b loop
# for each line, append any continuation lines before trying to classify it
/^ / {
# if it starts with a tab, it's meant for the shell, and we should think
# about reversing the slashes
s;cd ../util;cd ..\\util;
s;cd ../src;cd ..\\src;
/librarian/ s;dat/options;dat\\options;
/$(MAKE)/b
/$(CC)/b
s;/;\\;g
}
# unfortunately, we do not want to reverse *all* the slashes, as even the
# Atari make and gcc like forward ones, and it's messy to avoid the ones in
# sed addresses
# so, flip the first one in e.g.
# @( cd ../util ; $(MAKE) ../include/onames.h )
# flip the librarian-related ones in dat/options
# ignore other lines related to make and gcc
# and flip any slashes left over, which include a number of UNIX-only things
# that we didn't need to do but don't hurt

1
outdated/sys/be/.gitattributes vendored Normal file
View File

@@ -0,0 +1 @@
* NH_filestag=(file%s_for_BeOS_version_-_untested_for_3.7)

63
outdated/sys/be/README Normal file
View File

@@ -0,0 +1,63 @@
This file is sys/be/README. It is for those intending to compile
NetHack 3.6 on a BeOS 4.5 system.
BeOS NetHack currently only supports the TTY windowing system. In
order to compile it, it would benefit you greatly to think of your Be
system as a UNIX variant. It is possible to compile using BeIDE.
However, there are four executables and several steps involved in making
NetHack. Unless you are extremely familiar with the build sequence and
are willing to modify the code somewhat, I suggest you avoid it for now.
Let the UNIX Makefiles take care of all that for you.
Known problems:
+ No special characters for walls. None of the fonts available for use
in a tty window has the graphics characters needed to improve the look.
If such a font existed, then all you need to do is set the dungeon,
object, and/or monter mappings in your defaults file.
+ The arrow keys don't work.
Build instructions. From a freshly unpacked source tree:
1. Copy the Makfiles in sys/unix to their proper spots. You may
use setup.sh or copy them by hand. Using setup.sh to create
links instead of copying the Makefiles will work, but BeOS will
not let you edit a link. It may be helpful to read
sys/unix/Install.unx.
2. Edit src/Makefile:
o Change System to SysBe.
o Comment out the UNIX versions of SYSSRC and SYSOBJ variables.
o Uncomment the BeOS versions of SYSRC and SYSOBJ.
o Uncomment the BeOS versions of CC, CFLAGS, LD, and LFLAGS. The
flags are different for Intel vs BeBox/Mac.
o Uncomment one of the Intel or BeBox/Mac BeOS versions of CC, CFLAGS,
LD, and LFLAGS.
o Comment out the default CFLAGS and LFLAGS.
o Change WINTTYLIB to be -ltermcap.
3. Edit util/Makefile:
o If on a BeBox/Mac:
- Uncomment the BeOS versions of CC and CFLAGS
- Comment out the default CFLAGS and LFLAGS.
o If on Intel:
- the default values of CFLAGS and LFLAGS work fine
o Change YACC and LEX to be bison -y and flex respectively.
4. Edit include/config.h to change HACKDIR to be the location of your
install directory.
5. Edit top level Makefile and change GAMEDIR to match HACKDIR in
include/config.h. Make sure the path to GAMEDIR exists. Change
SHELLDIR to a "throw away" directory, like /tmp. We don't use the
shell. Change CHOWN and CHGRP commands to "true", there really
aren't groups on the BeOS.
6. Type "make install" at the top level.
It is possible that some necessary steps needed to make the game have been
omitted. Feel free to ad-lib as necessary.

278
outdated/sys/be/bemain.c Normal file
View File

@@ -0,0 +1,278 @@
/* NetHack 3.6 bemain.c $NHDT-Date: 1447844549 2015/11/18 11:02:29 $ $NHDT-Branch: master $:$NHDT-Revision: 1.18 $ */
/* Copyright (c) Dean Luick, 1996. */
/* NetHack may be freely redistributed. See license for details. */
#include "hack.h"
#include "dlb.h"
#include <fcntl.h>
static void whoami(void);
static void process_options(int argc, char **argv);
static void chdirx(const char *dir);
static void getlock(void);
#ifdef __begui__
#define MAIN nhmain
int nhmain(int argc, char **argv);
#else
#define MAIN main
#endif
int
MAIN(int argc, char **argv)
{
int fd;
char *dir;
boolean resuming = FALSE; /* assume new game */
early_init();
dir = nh_getenv("NETHACKDIR");
if (!dir)
dir = nh_getenv("HACKDIR");
choose_windows(DEFAULT_WINDOW_SYS);
chdirx(dir);
initoptions();
init_nhwindows(&argc, argv);
whoami();
/*
* It seems you really want to play.
*/
u.uhp = 1; /* prevent RIP on early quits */
process_options(argc, argv); /* command line options */
set_playmode(); /* sets plname to "wizard" for wizard mode */
/* strip role,race,&c suffix; calls askname() if plname[] is empty
or holds a generic user name like "player" or "games" */
plnamesuffix();
/* unlike Unix where the game might be invoked with a script
which forces a particular character name for each player
using a shared account, we always allow player to rename
the character during role/race/&c selection */
iflags.renameallowed = TRUE;
getlock();
dlb_init(); /* must be before newgame() */
/*
* Initialize the vision system. This must be before mklev() on a
* new game or before a level restore on a saved game.
*/
vision_init();
display_gamewindows();
/*
* First, try to find and restore a save file for specified character.
* We'll return here if new game player_selection() renames the hero.
*/
attempt_restore:
if ((fd = restore_saved_game()) >= 0) {
#ifdef NEWS
if (iflags.news) {
display_file(NEWS, FALSE);
iflags.news = FALSE; /* in case dorecover() fails */
}
#endif
pline("Restoring save file...");
mark_synch(); /* flush output */
if (dorecover(fd)) {
resuming = TRUE; /* not starting new game */
if (discover)
You("are in non-scoring discovery mode.");
if (discover || wizard) {
if (yn("Do you want to keep the save file?") == 'n')
(void) delete_savefile();
else {
nh_compress(fqname(g.SAVEF, SAVEPREFIX, 0));
}
}
}
}
if (!resuming) {
/* new game: start by choosing role, race, etc;
player might change the hero's name while doing that,
in which case we try to restore under the new name
and skip selection this time if that didn't succeed */
if (!iflags.renameinprogress) {
player_selection();
if (iflags.renameinprogress) {
/* player has renamed the hero while selecting role;
discard current lock file and create another for
the new character name */
delete_levelfile(0); /* remove empty lock file */
getlock();
goto attempt_restore;
}
}
newgame();
if (discover)
You("are in non-scoring discovery mode.");
}
moveloop(resuming);
return 0;
}
static void
whoami(void)
{
/*
* Who am i? Algorithm: 1. Use name as specified in NETHACKOPTIONS
* 2. Use $USER or $LOGNAME (if 1. fails)
* The resulting name is overridden by command line options.
* If everything fails, or if the resulting name is some generic
* account like "games", "play", "player", "hack" then eventually
* we'll ask him.
*/
char *s;
if (*g.plname)
return;
if (s = nh_getenv("USER")) {
(void) strncpy(g.plname, s, sizeof(g.plname) - 1);
return;
}
if (s = nh_getenv("LOGNAME")) {
(void) strncpy(g.plname, s, sizeof(g.plname) - 1);
return;
}
}
/* normalize file name - we don't like .'s, /'s, spaces */
void
regularize(char *s)
{
register char *lp;
while ((lp = strchr(s, '.')) || (lp = strchr(s, '/'))
|| (lp = strchr(s, ' ')))
*lp = '_';
}
static void
process_options(int argc, char **argv)
{
int i;
while (argc > 1 && argv[1][0] == '-') {
argv++;
argc--;
switch (argv[0][1]) {
case 'D':
wizard = TRUE, discover = FALSE;
break;
case 'X':
discover = TRUE, wizard = FALSE;
break;
#ifdef NEWS
case 'n':
iflags.news = FALSE;
break;
#endif
case 'u':
if (argv[0][2])
(void) strncpy(g.plname, argv[0] + 2, sizeof(g.plname) - 1);
else if (argc > 1) {
argc--;
argv++;
(void) strncpy(g.plname, argv[0], sizeof(g.plname) - 1);
} else
raw_print("Player name expected after -u");
break;
case 'p': /* profession (role) */
if (argv[0][2]) {
if ((i = str2role(&argv[0][2])) >= 0)
flags.initrole = i;
} else if (argc > 1) {
argc--;
argv++;
if ((i = str2role(argv[0])) >= 0)
flags.initrole = i;
}
break;
case 'r': /* race */
if (argv[0][2]) {
if ((i = str2race(&argv[0][2])) >= 0)
flags.initrace = i;
} else if (argc > 1) {
argc--;
argv++;
if ((i = str2race(argv[0])) >= 0)
flags.initrace = i;
}
break;
case '@':
flags.randomall = 1;
break;
default:
raw_printf("Unknown option: %s", *argv);
break;
}
}
}
static void
chdirx(const char *dir)
{
if (!dir)
dir = HACKDIR;
if (chdir(dir) < 0)
error("Cannot chdir to %s.", dir);
/* Warn the player if we can't write the record file */
/* perhaps we should also test whether . is writable */
check_recordfile(dir);
}
void
getlock(void)
{
int fd;
Sprintf(g.lock, "%d%s", getuid(), g.plname);
regularize(g.lock);
set_levelfile_name(g.lock, 0);
fd = creat(g.lock, FCMASK);
if (fd == -1) {
error("cannot creat lock file.");
} else {
if (write(fd, (genericptr_t) &g.hackpid, sizeof(g.hackpid))
!= sizeof(g.hackpid)) {
error("cannot write lock");
}
if (close(fd) == -1) {
error("cannot close lock");
}
}
}
/* validate wizard mode if player has requested access to it */
boolean
authorize_wizard_mode()
{
/* other ports validate user name or character name here */
return TRUE;
}
#ifndef __begui__
/*
* If we are not using the Be GUI, then just exit -- we don't need to
* do anything extra.
*/
void nethack_exit(int status);
void
nethack_exit(int status)
{
exit(status);
}
#endif /* !__begui__ */
/*bemain.c*/

2
outdated/sys/mac/.gitattributes vendored Normal file
View File

@@ -0,0 +1,2 @@
NHDeflts NHSUBST
* NH_filestag=(file%s_for_68K_Macintosh_versions)

301
outdated/sys/mac/Files.r Normal file
View File

@@ -0,0 +1,301 @@
#include <MacTypes.r>
#include "date.h"
#include "patchlevel.h"
/* Carbon 'carb' resource
* has been made obsolete by the 'plst' resource below.
*/
/* Carbon 'plst' resource
* Single-file applications must have this resource for MacOS X to
* count it as a Carbon app rather than a Classic app. It contains
* an embedded Info.plist file, with the same format as would occur
* in an application based on a directory bundle. The attributes
* declared in this resource override the 'BNDL', 'FREF', and 'vers'
* resources in MacOS X.
*
* For further information, see
* http://developer.apple.com/technotes/tn/tn2013.html
*/
read 'plst' (0) "carbon.plist";
/* Classic resources
* These resources are used in MacOS 9.x and earlier.
*/
resource 'vers' (1, purgeable) {
VERSION_MAJOR, (VERSION_MINOR<<4) | PATCHLEVEL, final, EDITLEVEL, verUS,
VERSION_STRING,
VERSION_STRING
};
resource 'vers' (2, purgeable) {
VERSION_MAJOR, (VERSION_MINOR<<4) | PATCHLEVEL, final, EDITLEVEL, verUS,
VERSION_STRING,
"devteam@nethack.org"
};
/* Dungeon librarian files
* File data and quest.dat have gotten too big to be put into resources!
*/
#ifdef TARGET_API_MAC_CARBON
read 'File' (1000,"cmdhelp") "cmdhelp";
read 'File' (1001,"help") "help";
read 'File' (1002,"hh") "hh";
read 'File' (1003,"history") "history";
read 'File' (1004,"license") "license";
read 'File' (1005,"MacHelp") "MacHelp";
read 'File' (1006,"News") "News";
read 'File' (1007,"opthelp") "opthelp";
read 'File' (1008,"wizhelp") "wizhelp";
read 'File' (1009,"air.lev") "air.lev";
read 'File' (1010,"asmodeus.lev") "asmodeus.lev";
read 'File' (1011,"astral.lev") "astral.lev";
read 'File' (1012,"baalz.lev") "baalz.lev";
read 'File' (1013,"bigrm-1.lev") "bigrm-1.lev";
read 'File' (1014,"bigrm-2.lev") "bigrm-2.lev";
read 'File' (1015,"bigrm-3.lev") "bigrm-3.lev";
read 'File' (1016,"bigrm-4.lev") "bigrm-4.lev";
read 'File' (1017,"bigrm-5.lev") "bigrm-5.lev";
read 'File' (1018,"castle.lev") "castle.lev";
//read 'File' (1019,"data") "data";
read 'File' (1020,"dungeon") "dungeon";
read 'File' (1021,"earth.lev") "earth.lev";
read 'File' (1022,"fakewiz1.lev") "fakewiz1.lev";
read 'File' (1023,"fakewiz2.lev") "fakewiz2.lev";
read 'File' (1024,"fire.lev") "fire.lev";
read 'File' (1025,"juiblex.lev") "juiblex.lev";
read 'File' (1026,"knox.lev") "knox.lev";
read 'File' (1027,"medusa-1.lev") "medusa-1.lev";
read 'File' (1028,"medusa-2.lev") "medusa-2.lev";
read 'File' (1029,"minefill.lev") "minefill.lev";
read 'File' (1030,"minend-1.lev") "minend-1.lev";
read 'File' (1031,"minend-2.lev") "minend-2.lev";
read 'File' (1032,"minend-3.lev") "minend-3.lev";
read 'File' (1034,"minetn-1.lev") "minetn-1.lev";
read 'File' (1035,"minetn-2.lev") "minetn-2.lev";
read 'File' (1036,"minetn-3.lev") "minetn-3.lev";
read 'File' (1037,"minetn-4.lev") "minetn-4.lev";
read 'File' (1038,"minetn-5.lev") "minetn-5.lev";
read 'File' (1039,"minetn-6.lev") "minetn-6.lev";
read 'File' (1040,"minetn-7.lev") "minetn-7.lev";
read 'File' (1041,"options") "options";
read 'File' (1042,"oracle.lev") "oracle.lev";
read 'File' (1043,"oracles") "oracles";
read 'File' (1044,"orcus.lev") "orcus.lev";
//read 'File' (1045,"quest.dat") "quest.dat";
read 'File' (1046,"rumors") "rumors";
read 'File' (1047,"sanctum.lev") "sanctum.lev";
read 'File' (1048,"soko1-1.lev") "soko1-1.lev";
read 'File' (1049,"soko1-2.lev") "soko1-2.lev";
read 'File' (1050,"soko2-1.lev") "soko2-1.lev";
read 'File' (1051,"soko2-2.lev") "soko2-2.lev";
read 'File' (1052,"soko3-1.lev") "soko3-1.lev";
read 'File' (1053,"soko3-2.lev") "soko3-2.lev";
read 'File' (1054,"soko4-1.lev") "soko4-1.lev";
read 'File' (1055,"soko4-2.lev") "soko4-2.lev";
read 'File' (1056,"tower1.lev") "tower1.lev";
read 'File' (1057,"tower2.lev") "tower2.lev";
read 'File' (1058,"tower3.lev") "tower3.lev";
read 'File' (1059,"valley.lev") "valley.lev";
read 'File' (1060,"water.lev") "water.lev";
read 'File' (1061,"wizard1.lev") "wizard1.lev";
read 'File' (1062,"wizard2.lev") "wizard2.lev";
read 'File' (1063,"wizard3.lev") "wizard3.lev";
read 'File' (1100,"Arc-fila.lev") "Arc-fila.lev";
read 'File' (1101,"Arc-filb.lev") "Arc-filb.lev";
read 'File' (1102,"Arc-goal.lev") "Arc-goal.lev";
read 'File' (1103,"Arc-loca.lev") "Arc-loca.lev";
read 'File' (1104,"Arc-strt.lev") "Arc-strt.lev";
read 'File' (1105,"Bar-fila.lev") "Bar-fila.lev";
read 'File' (1106,"Bar-filb.lev") "Bar-filb.lev";
read 'File' (1107,"Bar-goal.lev") "Bar-goal.lev";
read 'File' (1108,"Bar-loca.lev") "Bar-loca.lev";
read 'File' (1109,"Bar-strt.lev") "Bar-strt.lev";
read 'File' (1110,"Cav-fila.lev") "Cav-fila.lev";
read 'File' (1111,"Cav-filb.lev") "Cav-filb.lev";
read 'File' (1112,"Cav-goal.lev") "Cav-goal.lev";
read 'File' (1113,"Cav-loca.lev") "Cav-loca.lev";
read 'File' (1114,"Cav-strt.lev") "Cav-strt.lev";
read 'File' (1115,"Hea-fila.lev") "Hea-fila.lev";
read 'File' (1116,"Hea-filb.lev") "Hea-filb.lev";
read 'File' (1117,"Hea-goal.lev") "Hea-goal.lev";
read 'File' (1118,"Hea-loca.lev") "Hea-loca.lev";
read 'File' (1119,"Hea-strt.lev") "Hea-strt.lev";
read 'File' (1120,"Kni-fila.lev") "Kni-fila.lev";
read 'File' (1121,"Kni-filb.lev") "Kni-filb.lev";
read 'File' (1122,"Kni-goal.lev") "Kni-goal.lev";
read 'File' (1123,"Kni-loca.lev") "Kni-loca.lev";
read 'File' (1124,"Kni-strt.lev") "Kni-strt.lev";
read 'File' (1125,"Mon-fila.lev") "Mon-fila.lev";
read 'File' (1126,"Mon-filb.lev") "Mon-filb.lev";
read 'File' (1127,"Mon-goal.lev") "Mon-goal.lev";
read 'File' (1128,"Mon-loca.lev") "Mon-loca.lev";
read 'File' (1129,"Mon-strt.lev") "Mon-strt.lev";
read 'File' (1130,"Pri-fila.lev") "Pri-fila.lev";
read 'File' (1131,"Pri-filb.lev") "Pri-filb.lev";
read 'File' (1132,"Pri-goal.lev") "Pri-goal.lev";
read 'File' (1133,"Pri-loca.lev") "Pri-loca.lev";
read 'File' (1134,"Pri-strt.lev") "Pri-strt.lev";
read 'File' (1135,"Ran-fila.lev") "Ran-fila.lev";
read 'File' (1136,"Ran-filb.lev") "Ran-filb.lev";
read 'File' (1137,"Ran-goal.lev") "Ran-goal.lev";
read 'File' (1138,"Ran-loca.lev") "Ran-loca.lev";
read 'File' (1139,"Ran-strt.lev") "Ran-strt.lev";
read 'File' (1140,"Rog-fila.lev") "Rog-fila.lev";
read 'File' (1141,"Rog-filb.lev") "Rog-filb.lev";
read 'File' (1142,"Rog-goal.lev") "Rog-goal.lev";
read 'File' (1143,"Rog-loca.lev") "Rog-loca.lev";
read 'File' (1144,"Rog-strt.lev") "Rog-strt.lev";
read 'File' (1145,"Sam-fila.lev") "Sam-fila.lev";
read 'File' (1146,"Sam-filb.lev") "Sam-filb.lev";
read 'File' (1147,"Sam-goal.lev") "Sam-goal.lev";
read 'File' (1148,"Sam-loca.lev") "Sam-loca.lev";
read 'File' (1149,"Sam-strt.lev") "Sam-strt.lev";
read 'File' (1150,"Tou-fila.lev") "Tou-fila.lev";
read 'File' (1151,"Tou-filb.lev") "Tou-filb.lev";
read 'File' (1152,"Tou-goal.lev") "Tou-goal.lev";
read 'File' (1153,"Tou-loca.lev") "Tou-loca.lev";
read 'File' (1154,"Tou-strt.lev") "Tou-strt.lev";
read 'File' (1155,"Val-fila.lev") "Val-fila.lev";
read 'File' (1156,"Val-filb.lev") "Val-filb.lev";
read 'File' (1157,"Val-goal.lev") "Val-goal.lev";
read 'File' (1158,"Val-loca.lev") "Val-loca.lev";
read 'File' (1159,"Val-strt.lev") "Val-strt.lev";
read 'File' (1160,"Wiz-fila.lev") "Wiz-fila.lev";
read 'File' (1161,"Wiz-filb.lev") "Wiz-filb.lev";
read 'File' (1162,"Wiz-goal.lev") "Wiz-goal.lev";
read 'File' (1163,"Wiz-loca.lev") "Wiz-loca.lev";
read 'File' (1164,"Wiz-strt.lev") "Wiz-strt.lev";
#else
read 'File' (1000,"cmdhelp") ":dat:cmdhelp";
read 'File' (1001,"help") ":dat:help";
read 'File' (1002,"hh") ":dat:hh";
read 'File' (1003,"history") ":dat:history";
read 'File' (1004,"license") ":dat:license";
read 'File' (1005,"MacHelp") ":sys:mac:MacHelp";
read 'File' (1006,"News") ":sys:mac:News";
read 'File' (1007,"opthelp") ":dat:opthelp";
read 'File' (1008,"wizhelp") ":dat:wizhelp";
read 'File' (1009,"air.lev") ":lib:air.lev";
read 'File' (1010,"asmodeus.lev") ":lib:asmodeus.lev";
read 'File' (1011,"astral.lev") ":lib:astral.lev";
read 'File' (1012,"baalz.lev") ":lib:baalz.lev";
read 'File' (1013,"bigrm-1.lev") ":lib:bigrm-1.lev";
read 'File' (1014,"bigrm-2.lev") ":lib:bigrm-2.lev";
read 'File' (1015,"bigrm-3.lev") ":lib:bigrm-3.lev";
read 'File' (1016,"bigrm-4.lev") ":lib:bigrm-4.lev";
read 'File' (1017,"bigrm-5.lev") ":lib:bigrm-5.lev";
read 'File' (1018,"castle.lev") ":lib:castle.lev";
read 'File' (1019,"data") ":lib:data";
read 'File' (1020,"dungeon") ":lib:dungeon";
read 'File' (1021,"earth.lev") ":lib:earth.lev";
read 'File' (1022,"fakewiz1.lev") ":lib:fakewiz1.lev";
read 'File' (1023,"fakewiz2.lev") ":lib:fakewiz2.lev";
read 'File' (1024,"fire.lev") ":lib:fire.lev";
read 'File' (1025,"juiblex.lev") ":lib:juiblex.lev";
read 'File' (1026,"knox.lev") ":lib:knox.lev";
read 'File' (1027,"medusa-1.lev") ":lib:medusa-1.lev";
read 'File' (1028,"medusa-2.lev") ":lib:medusa-2.lev";
read 'File' (1029,"minefill.lev") ":lib:minefill.lev";
read 'File' (1030,"minend-1.lev") ":lib:minend-1.lev";
read 'File' (1031,"minend-2.lev") ":lib:minend-2.lev";
read 'File' (1032,"minend-3.lev") ":lib:minend-3.lev";
read 'File' (1034,"minetn-1.lev") ":lib:minetn-1.lev";
read 'File' (1035,"minetn-2.lev") ":lib:minetn-2.lev";
read 'File' (1036,"minetn-3.lev") ":lib:minetn-3.lev";
read 'File' (1037,"minetn-4.lev") ":lib:minetn-4.lev";
read 'File' (1038,"minetn-5.lev") ":lib:minetn-5.lev";
read 'File' (1039,"minetn-6.lev") ":lib:minetn-6.lev";
read 'File' (1040,"minetn-7.lev") ":lib:minetn-7.lev";
read 'File' (1041,"options") ":lib:options";
read 'File' (1042,"oracle.lev") ":lib:oracle.lev";
read 'File' (1043,"oracles") ":lib:oracles";
read 'File' (1044,"orcus.lev") ":lib:orcus.lev";
read 'File' (1045,"quest.dat") ":lib:quest.dat";
read 'File' (1046,"rumors") ":lib:rumors";
read 'File' (1047,"sanctum.lev") ":lib:sanctum.lev";
read 'File' (1048,"soko1-1.lev") ":lib:soko1-1.lev";
read 'File' (1049,"soko1-2.lev") ":lib:soko1-2.lev";
read 'File' (1050,"soko2-1.lev") ":lib:soko2-1.lev";
read 'File' (1051,"soko2-2.lev") ":lib:soko2-2.lev";
read 'File' (1052,"soko3-1.lev") ":lib:soko3-1.lev";
read 'File' (1053,"soko3-2.lev") ":lib:soko3-2.lev";
read 'File' (1054,"soko4-1.lev") ":lib:soko4-1.lev";
read 'File' (1055,"soko4-2.lev") ":lib:soko4-2.lev";
read 'File' (1056,"tower1.lev") ":lib:tower1.lev";
read 'File' (1057,"tower2.lev") ":lib:tower2.lev";
read 'File' (1058,"tower3.lev") ":lib:tower3.lev";
read 'File' (1059,"valley.lev") ":lib:valley.lev";
read 'File' (1060,"water.lev") ":lib:water.lev";
read 'File' (1061,"wizard1.lev") ":lib:wizard1.lev";
read 'File' (1062,"wizard2.lev") ":lib:wizard2.lev";
read 'File' (1063,"wizard3.lev") ":lib:wizard3.lev";
read 'File' (1100,"Arc-fila.lev") ":lib:Arc-fila.lev";
read 'File' (1101,"Arc-filb.lev") ":lib:Arc-filb.lev";
read 'File' (1102,"Arc-goal.lev") ":lib:Arc-goal.lev";
read 'File' (1103,"Arc-loca.lev") ":lib:Arc-loca.lev";
read 'File' (1104,"Arc-strt.lev") ":lib:Arc-strt.lev";
read 'File' (1105,"Bar-fila.lev") ":lib:Bar-fila.lev";
read 'File' (1106,"Bar-filb.lev") ":lib:Bar-filb.lev";
read 'File' (1107,"Bar-goal.lev") ":lib:Bar-goal.lev";
read 'File' (1108,"Bar-loca.lev") ":lib:Bar-loca.lev";
read 'File' (1109,"Bar-strt.lev") ":lib:Bar-strt.lev";
read 'File' (1110,"Cav-fila.lev") ":lib:Cav-fila.lev";
read 'File' (1111,"Cav-filb.lev") ":lib:Cav-filb.lev";
read 'File' (1112,"Cav-goal.lev") ":lib:Cav-goal.lev";
read 'File' (1113,"Cav-loca.lev") ":lib:Cav-loca.lev";
read 'File' (1114,"Cav-strt.lev") ":lib:Cav-strt.lev";
read 'File' (1115,"Hea-fila.lev") ":lib:Hea-fila.lev";
read 'File' (1116,"Hea-filb.lev") ":lib:Hea-filb.lev";
read 'File' (1117,"Hea-goal.lev") ":lib:Hea-goal.lev";
read 'File' (1118,"Hea-loca.lev") ":lib:Hea-loca.lev";
read 'File' (1119,"Hea-strt.lev") ":lib:Hea-strt.lev";
read 'File' (1120,"Kni-fila.lev") ":lib:Kni-fila.lev";
read 'File' (1121,"Kni-filb.lev") ":lib:Kni-filb.lev";
read 'File' (1122,"Kni-goal.lev") ":lib:Kni-goal.lev";
read 'File' (1123,"Kni-loca.lev") ":lib:Kni-loca.lev";
read 'File' (1124,"Kni-strt.lev") ":lib:Kni-strt.lev";
read 'File' (1125,"Mon-fila.lev") ":lib:Mon-fila.lev";
read 'File' (1126,"Mon-filb.lev") ":lib:Mon-filb.lev";
read 'File' (1127,"Mon-goal.lev") ":lib:Mon-goal.lev";
read 'File' (1128,"Mon-loca.lev") ":lib:Mon-loca.lev";
read 'File' (1129,"Mon-strt.lev") ":lib:Mon-strt.lev";
read 'File' (1130,"Pri-fila.lev") ":lib:Pri-fila.lev";
read 'File' (1131,"Pri-filb.lev") ":lib:Pri-filb.lev";
read 'File' (1132,"Pri-goal.lev") ":lib:Pri-goal.lev";
read 'File' (1133,"Pri-loca.lev") ":lib:Pri-loca.lev";
read 'File' (1134,"Pri-strt.lev") ":lib:Pri-strt.lev";
read 'File' (1135,"Ran-fila.lev") ":lib:Ran-fila.lev";
read 'File' (1136,"Ran-filb.lev") ":lib:Ran-filb.lev";
read 'File' (1137,"Ran-goal.lev") ":lib:Ran-goal.lev";
read 'File' (1138,"Ran-loca.lev") ":lib:Ran-loca.lev";
read 'File' (1139,"Ran-strt.lev") ":lib:Ran-strt.lev";
read 'File' (1140,"Rog-fila.lev") ":lib:Rog-fila.lev";
read 'File' (1141,"Rog-filb.lev") ":lib:Rog-filb.lev";
read 'File' (1142,"Rog-goal.lev") ":lib:Rog-goal.lev";
read 'File' (1143,"Rog-loca.lev") ":lib:Rog-loca.lev";
read 'File' (1144,"Rog-strt.lev") ":lib:Rog-strt.lev";
read 'File' (1145,"Sam-fila.lev") ":lib:Sam-fila.lev";
read 'File' (1146,"Sam-filb.lev") ":lib:Sam-filb.lev";
read 'File' (1147,"Sam-goal.lev") ":lib:Sam-goal.lev";
read 'File' (1148,"Sam-loca.lev") ":lib:Sam-loca.lev";
read 'File' (1149,"Sam-strt.lev") ":lib:Sam-strt.lev";
read 'File' (1150,"Tou-fila.lev") ":lib:Tou-fila.lev";
read 'File' (1151,"Tou-filb.lev") ":lib:Tou-filb.lev";
read 'File' (1152,"Tou-goal.lev") ":lib:Tou-goal.lev";
read 'File' (1153,"Tou-loca.lev") ":lib:Tou-loca.lev";
read 'File' (1154,"Tou-strt.lev") ":lib:Tou-strt.lev";
read 'File' (1155,"Val-fila.lev") ":lib:Val-fila.lev";
read 'File' (1156,"Val-filb.lev") ":lib:Val-filb.lev";
read 'File' (1157,"Val-goal.lev") ":lib:Val-goal.lev";
read 'File' (1158,"Val-loca.lev") ":lib:Val-loca.lev";
read 'File' (1159,"Val-strt.lev") ":lib:Val-strt.lev";
read 'File' (1160,"Wiz-fila.lev") ":lib:Wiz-fila.lev";
read 'File' (1161,"Wiz-filb.lev") ":lib:Wiz-filb.lev";
read 'File' (1162,"Wiz-goal.lev") ":lib:Wiz-goal.lev";
read 'File' (1163,"Wiz-loca.lev") ":lib:Wiz-loca.lev";
read 'File' (1164,"Wiz-strt.lev") ":lib:Wiz-strt.lev";
#endif

291
outdated/sys/mac/Install.mw Normal file
View File

@@ -0,0 +1,291 @@
Building a PPC NetHack 3.6 with the Metrowerks compilers
Note: If you are building using any compiler for OS X, use the instructions
in sys/unix. This file contains old instructions that predated OS X.
You must be familiar with the Metrowerks compiler and know how to construct
projects. The NetHack source may come with the four pre-made projects that
are needed to build NetHack and the files it needs. These four projects are
in :sys:mac and are MakeDefs.u, DgnComp.u, LevComp.u, and NetHack.u. If you
do not have them, or wish to construct them yourself, see the section "Project
Contents" below.
1. Move the projects MakeDefs.u, DgnComp.u, LevComp.u, and NetHack.u to the
top level of the NetHack tree. If you are building your own, create each
project as needed, in the order given below.
2. Create a folder "lib" in the top level. This is where the files used by
NetHack will be deposited by MakeDefs, DgnComp, and LevComp.
3. Build and run MakeDefs.
You will be presented with a list of options. Initially choose them all (the
default). Later you may wish to only run a few of them. The options are
"odemvpqrhz", each of which makes a file:
-o creates :include:onames.h
-p creates :include:pm.h
-z creates :src:vis_tab.c
-m creates :src:monstr.c
-e creates :dat:dundeon.pdf
-v creates :lib:options
-d creates :lib:data
-r creates :lib:rumors
-h creates :lib:oracles
-q creates :lib:quest.dat
4. If you are _not_ using DLB, follow these directions. As of v3.3, DLB is ON
for the Mac. Copy the following files. You may want to change News or NHDeflts.
a. copy ':sys:mac:MacHelp' to ':lib:MacHelp'
b. copy ':sys:mac:News' to ':lib:News'
c. copy ':sys:mac:NHDeflts' to ':lib:NetHack Defaults'
d. copy ':dat:cmdhelp' to ':lib:cmdhelp'
e. copy ':dat:help' to ':lib:help'
f. copy ':dat:hh' to 'lib:hh'
g. copy ':dat:history' to ':lib:history'
h. copy ':dat:license' to ':lib:license'
i. copy ':dat:opthelp' to ':lib:opthelp'
j. copy ':dat:wizhelp' to ':lib:wizhelp'
5. Create an empty file, ':lib:record'
6. Build and run DgnComp.
This will create a file "dungeon" in the lib directory.
7. Build and run LevComp.
This will build the level files (*.lev) in the lib directory.
8. Build NetHack.
Move NetHack in the lib directory.
------------------------
Building NetHack with MetroWerks IDE 1.x (DR7-DR10, DR11 was never used)
To build NetHack, you will need to create four projects at the top level of
the NetHack directory tree. These four projects are MakeDefs.u, DgnComp.u,
LevComp.u, and NetHack.u. The projects don't have to end in ".u", but you
should append some form of ".XXX" to the end of the project's name to
distinguish the project from the executable that it produces. The files
and libraries to include in these projects are listed in the "Project
Contents" section below. You must create and run Makedefs before creating
NetHack because MakeDefs will create files used by NetHack.
Use the MacOS C/C++ template for each of the projects. The libraries included
will be overkill for all the projects (e.g. the C++ libraries are not needed).
Add the .c and resource files as indicated below. Unless otherwise noted, the
projects can use the default preferences:
Font
The tabbing on all non-mac files is 8. All mac files have a
tab of 4.
PPC Processor
All projects must have the same alignment to build a consistent
NetHack. To share save files with 68K, the alignments
must match for their projects, as well.
Turn on Global Optimization (official version is compiled
with level 1). If you don't turn it on, some files may
not compile because of register overflow. [NetHack
only]
PPC Project
Set name to <MakeDefs, LevComp DgnComp, NetHack>
Other settings [NetHack only]
creator: nh31
preferred heap size:2500
minimum heap size: 2000
stack size: 128 [PPC only]
The SIOUX library may be replaced with console.stubs.c for the NetHack
project.
NOTE: As NetHack 3.3, you must turn on OLDROUTINENAMES -- so you can't use
the default pre-compiled header. You should either remove it from the
preferences or insert another precompiled header that has this define off.
------------------------
Building NetHack with MetroWerks IDE 2.0.
This is for building a PowerPC version only. This doesn't take advantage
of the IDE's subprojects. These will be investigated later.
MakeDefs.u, DgnComp.u, LevComp.u: Select ANSI C Console PPC.
Settings:
PPC Target
+ Change File Name to MakeDefs, DgnComp, or LevComp respectively.
C/C++ Language
+ Turn off ANSI strict, ANSI Keywords Only, Expand Trigraphs
PPC Processor
+ Turn on global optimization (at least to level 1)
NetHack.u: Basic ToolBox PPC
PPC Target
+ Change File Name to NetHack. Other settings
creator: nh31
preferred heap size:2500
minimum heap size: 2000
stack size: 128 [PPC only]
C/C++ Language
+ Options ANSI strict, ANSI Keywords Only, Expand Trigraphs
are already turned off, so you don't have to do anything.
PPC Processor
+ Turn on global optimization (at least to level 1)
------------------------
Creating projects for NetHack with MetroWerks IDE 3.3 (Pro 4)
This is what I changed from the default settings when creating a 68K version. Some of
the settings may not be necessary. For example, NetHack doesn't use floating point,
so I didn't have to check 8 byte doubles. Some are interrelated. For example, the
codegen and the Math and MSL libraries used.
For MakeDefs.u, DgnComp.u, LevComp.u:
1. Select File>>New Project...>>MacOS>>C_C++>>Standard Console>>Std C Console 68K
2. 68K Settings:
Target Settings:
+ Set "Target Name" to {MakeDefs,DgnComp,LevComp}.
68K Target:
+ Set "File Name" to {MakeDefs,DgnComp,LevComp}.
C/C++ Language:
+ Check Require Function Prototypes, uncheck everything else.
+ Clear "Prefix File".
68K Processor:
+ Set "Code Model" to Large.
+ Check 68020 Codegen, 4-Byte Ints, 8-Byte Doubles, Far Data, Far Method Tables,
Far String Constants. Uncheck everything else.
3. Libraries 68K
+ Remove the C++ Library (it is not needed).
+ Change math library to MathLib68K Fa(4i_8d).Lib.
+ Change MSL C library to MSL C.68K Fa(4i_8d).Lib.
Note: The actual libraries used must match the CodeGen options in 68K Processor.
For NetHack.u:
1. Select File>>New Project...>>MacOS>>C_C++>>MacOS ToolBox>>MacOS ToolBox 68K
2. 68K Settings
Target Settings:
+ Set "Target Name" to NetHack Debug and NetHack Final.
68K Target:
+ Set "File Name" to NetHack Debug and NetHack Final.
+ Set "Creator" to 'nh31'.
+ Set "Preferred Heap Size (k)" to 2500.
+ Set "Minimum Heap Size (k)" to 1500.
C/C++ Language:
+ Check Require Function Prototypes, uncheck everything else.
+ Set "Prefix File" to LocalDefines.h. I use this header to define
OLDROUTINENAMES because the pre-compiled header doesn't have it set
any more. One of these days we'll fix up the code...
68K Processor:
+ Set "Code Model" to Large.
+ Check 68020 Codegen, 4-Byte Ints, 8-Byte Doubles, Far Data, Far Method Tables,
Far String Constants. Uncheck everything else.
3. Libraries 68K
+ Remove the C++ Library (it is not needed).
+ Change math library to MathLib68K Fa(4i_8d).Lib.
+ Change MSL C library to MSL C.68K Fa(4i_8d).Lib.
Note: The actual libraries used must match the CodeGen options in 68K Processor.
For Recover.u:
1. Select File>>New Project...>>MacOS>>C_C++>>MacOS ToolBox>>MacOS ToolBox 68K
2. 68K Settings
Target Settings:
+ Set "Target Name" to Recover Debug and Recover Final.
68K Target:
+ Set "File Name" to Recover Debug and Recover Final.
+ Set "Creator" to 'nhRc'.
C/C++ Language:
+ Check Require Function Prototypes, uncheck everything else.
+ Set "Prefix File" to LocalDefines.h. I use this header to define
OLDROUTINENAMES because the pre-compiled header doesn't have it set
any more. One of these days we'll fix up the code...
68K Processor:
+ Set "Code Model" to Large.
+ Check 68020 Codegen, 4-Byte Ints, 8-Byte Doubles, Far Data, Far Method Tables,
Far String Constants. Uncheck everything else.
3. Libraries 68K
+ Remove the C++ Library (it is not needed).
+ Change math library to MathLib68K Fa(4i_8d).Lib.
+ Change MSL C library to MSL C.68K Fa(4i_8d).Lib.
Note: The actual libraries used must match the CodeGen options in 68K Processor.
------------------------
Project Contents:
MakeDefs.u should contain the following source files:
src
objects.c
monst.c
util
makedefs.c
DgnComp.u should contain the following source files:
src
alloc.c
sys:share
dgn_lex.c
dgn_yacc.c
util
dgn_main.c
panic.c
LevComp.u should contain the following source files:
src
alloc.c
decl.c
drawing.c
monst.c
objects.c
sys:mac
macerrs.c
macfile.c
sys:share
lev_lex.c
lev_yacc.c
util
lev_main.c
panic.c
NetHack.u should contain the following source files:
src
*.c [can do an add all]
sys:mac
*.c except mrecover.c
NetHack.rsrc
machelp.bh [for baloon help]
Sound.rsrc [if you wish to have a few, crude sounds]
Files.r [if you use DLB (on by default)]
sys:share
random.c
win:tty
*.c [can do an add all - termcap.c is not needed, but will compile to nothing]
Note: src:monstr.c and src:vis_tab.c are created by MakeDefs -m and -s
respectively.
Recover.u should contain the following source files:
sys:mac
mrecover.c
mrecover.rsrc

158
outdated/sys/mac/MacHelp Normal file
View File

@@ -0,0 +1,158 @@
Macintosh-specific help file for NetHack 3.6
The following are options, features, or concerns specific to the
MacOS Classic port of NetHack. Bug reports, suggestions, comments,
and so on, should be addressed to:
To: nethack-bugs@nethack.org
Subject: Mac NetHack 3.6
or you can use our on-line bug reporting form at
http://www.nethack.org
Please include your machine-type, system software version and other
relevant information (i.e. system extensions, monitor, accelerators
and so on).
=== Configuration of a playground
NetHack is packaged in a Dungeon Folder which includes:
NetHack - the application file itself.
NetHack Defaults - text file for default option settings.
License - licensing terms for nethack.
Guidebook - description of the game in long format.
Recover - the application to restore save files from crashed games.
Previous versions had a large number of data files in the Dungeon
Folder. These are now packaged as resources inside the application
file and will no longer appear in the Dungeon Folder.
During play another file type appears:
Player level files (labelled "iName.n", i is a constant number,
Name is the player name and n is the dungeon level).
Two other types of files will appear in the Dungeon Folder
as a result of playing NetHack:
Bones files (of previously deceased players).
Saved games (labelled "save/iName", i is a number, same as above,
and Name is the player name).
The following files or file types may be thrown away:
logfile - if it becomes too large. A new one will be generated.
Player level files _not_ belonging to a game in progress.
Alternatively, these files may be processed by Recover,
which may be able to restore a save file from the level files.
Old bones files and saved games.
=== Resuming a saved game
Double-click (or open) the desired saved game file or open NetHack
and answer the "Who are you?" dialog with the player name of
the saved game in the Dungeon Folder.
=== Windows
The Dungeon Map and Message windows are the essential windows used
during window-mode play. During tty-mode play there is only one
window which displays the map, messages, lists and other info.
For window-mode play, lists (e.g. the list of objects that may
be wielded) and special info windows appear as needed. Windows
may be closed in the normal ways (i.e. clicking their close box,
choosing 'Close' from the File menu or typing the command
equivalent for 'Close', cmd-W) and the list windows may also be
dismissed by hitting the space bar (or Return or Enter Keys).
Hitting the ESCape key will dismiss special windows without
scrolling to the end.
The command "Reposition" on the File menu may be used to restore the
the startup sizes and locations of the various windows. The
window positions are saved in a file labelled "NetHack Windows"
in the appropriate preferences folder.
=== Default options
The following options are specific to the Macintosh port:
background: - black or white
MACgraphics - use enhanced dungeon map symbols [TRUE]
page_wait - display --MORE-- after messages [TRUE]
Default options may be set by editing the NetHack Defaults text
file (using SimpleText or your favorite editor). The following
notation is used:
OPTIONS=name:Arnold,time,!tombstone
It should also be mentioned here that there are two graphic
interface modes available: 'mac' and 'tty'. Choosing between
these interfaces is accomplished by the option:
window:mac - the default multi-window Macintosh(tm) interface.
window:tty - traditional Unix(tm)-style TTY window interface.
See option help (?f or ?g) for more details.
=== Movement by mouse
The shape (direction) of the cursor over the Dungeon Map window,
typically, indicates the direction that you desire to move in when
the mouse is clicked. Modifier keys affect mouse-movement in the
same way that they affect keyboard movement. Clicking on yourself
means rest one turn and Shift-clicking on yourself means "open door"
in the subsequently indicated direction.
=== Sounds
Real sounds (resources) have been added for various instruments.
The option "silent" [FALSE] controls whether or not a sound will
be heard when an instrument is applied.
=== Explore and Debug Modes
As of version 3.1.2, you can enter Explore (aka Discover) mode or
Debug (aka Wizard) mode by choosing the appropriate entries on the
'Mode' popup-menu section of the "Who are you?" startup dialog.
This same dialog allows you to specify your role, race, gender,
alignment, and name, of course.
Starting in Explore mode is essentially the same as playing in
Regular mode except that if you are killed then you are given an
opportunity to override your death. Because of this advantage,
your Explore mode scores are not entered on the scoreboard record.
You also get a wand of wishing in your starting inventory and can
see your intrinsic abilities using the command ctl-X (also available
on the 'Explore' submenu on the File menu).
Starting in Debug mode is only intended for developers and others
interested in characterizing bugs. Using this mode for other
purposes will have confusing results and eliminate your enjoyment
of the game!
=== Menus
As of version 3.1.2, the menus have been reworked to provide access
to all the NetHack commands and a special 'Kbd' menu was added to
facilitate play using only the mouse. In some cases, a command may
appear on more than one menu. In general, the commands have been
grouped to appear on an appropriate menu:
File - commands related to windows, start mode and play control.
Help - info commands generally not related to a specific game (i.e.
(key descriptions, version info, internal option editor).
Info - commands that are generally game-specific (i.e. inventory
related, describe features seen on the map or name things).
Equip - commands related to things you might wield or wear.
Act - commands for actions that you might do alone (i.e. wait,
jump) or do with another dungeon denizen (i.e. pay, chat).
Magic - commands for things that you might do with items (drop,
eat, read) or spell-related.
Bits - commands for things you might do to dungeon pieces (i.e.
open door, loot chest, engrave on the floor, climb stairs).
The key related to a command generally appears to the left of the
menu entry for that command (i.e. w for wield and W for wear). A
leftmost # denotes an extended command (without a related key) and
a left cloverleaf or command symbol denotes a command that requires
either a control or command key modifier (i.e. holding down the
control or command key while hitting the related key).
===
The members of the Macintosh NetHack port team hope you enjoy this game.

161
outdated/sys/mac/NHDeflts Normal file
View File

@@ -0,0 +1,161 @@
# NetHack 3.6 NHDeflts $NHDT-Date: 1432512798 2015/05/25 00:13:18 $ $NHDT-Branch: master $:$NHDT-Revision: 1.7 $
# Copyright (c) 2002 by Dean Luick, Mark Modrall, and Kevin Hugo
# NetHack may be freely redistributed. See license for details.
#
# Default settings for the Macintosh port of NetHack.
# Lines beginning with a `#' character are "comments" and are
# ignored all the way to the end of the line. Using this
# method, some of the lines below have been disabled so you
# can see an example without having those options actually
# set. Remove the `#' character to "uncomment" the line and
# allow those options to take effect.
### Display ###
# Uncomment for the traditional single-window tty interface
#OPTIONS=win:tty
# Boulder symbol
#OPTIONS=boulder:0
# Color
OPTIONS=color
# Fonts
#OPTIONS=font_map:NewHackFont,font_size_map:9
#OPTIONS=font_menu:geneva,font_size_menu:9
#OPTIONS=font_message:PSHackFont,font_size_message:9
#OPTIONS=font_status:monaco,font_size_status:9
#OPTIONS=font_text:geneva,font_size_text:9
# Don't make dark corridors look like lit corridors
OPTIONS=!lit_corridor
# Enable sound and beeps
OPTIONS=sound,!silent
### Start-up and ending ###
# Don't display the game introduction and new feature list at start
#OPTIONS=!legacy,!news
# Save game state periodically in case of crashes (recommended)
OPTIONS=checkpoint
# How to prompt for things after death
#OPTIONS=disclose:+i na -v yg nc
# Show tombstone and top scores at death
OPTIONS=tombstone,scores:10t/3a/o
# Show top ten list in its own window
#OPTIONS=toptenwin
### User input and feedback ###
# Choose between menus or text prompts
# (traditional, combination, partial, or full)
OPTIONS=menustyle:full
# Extended (`#') commands by menu
#OPTIONS=extmenu
# Increase the number of message lines remembered
#OPTIONS=msghistory:60
# Enable the number pad keys
OPTIONS=number_pad
# Pause for --more-- and make it boldface
OPTIONS=page_wait,standout
# Ask for confirmation with the #pray command
OPTIONS=prayconfirm
# Allow spacebar as rest command
#OPTIONS=rest_on_space
# Display experience, score, and time on status line
OPTIONS=showexp,showscore,time
# Turn off animations
#OPTIONS=!sparkle
# Display a little more information with some commands
#OPTIONS=suppress_alert:3.3.0
OPTIONS=verbose
### Character ###
# A Valkyrie...
#OPTIONS=name:Brunhilda,role:Val
# The old way works, too:
#OPTIONS=name:Brunhilda-V
# How about an Elven Ranger?
#OPTIONS=name:Silwa,role:Ranger,race:Elf,gender:Male
# Always a human female
#OPTIONS=race:human,female
# Or leave them commented out and the game will ask you
### Inventory ###
# Automatically dig if wielding a pick
#OPTIONS=autodig
# Disable autopickup (toggle it with the `@' command)
#OPTIONS=!autopickup,pickup_types:$*
# Automatically fill the quiver
#OPTIONS=autoquiver
# Don't use fixed inventory letters
OPTIONS=!fixinv,perm_invent,sortpack
# What you want to call slime molds
#OPTIONS=fruit:grape
# Desired inventory display order
#OPTIONS=packorder:)[(
# How much you're willing to carry without confirmation
#OPTIONS=pickup_burden:B
# Put weapon in secondary slot when wielding another
#OPTIONS=pushweapon
### Pets ###
# What to call your starting pet, and its type
#OPTIONS=dogname:Quinn,catname:Vladimir,horsename:Silver,pettype:dog
# Don't intentionally attack your pets
OPTIONS=confirm,!hilite_pet,safe_pet
### Unused options ###
# Now obsolete
#
# background, large_font, popup_dialog, use_stone
# Obsolete way to obtain reverse video; use at your own risk
#OPTIONS=palette:000/c22/2c2/ca0/22c/a2a/2aa/ccc/999/f00/0f0/dd0/00f/d0d/0dd/fff/999/444/622/62c/-222
# Options used in tty window mode, but not mac window mode
#
# menu_..., msg_window, timed_delay, use_inverse, vary_msgcount
# Options used by other ports but not Macintosh:
#
# align_message, align_status, ascii_map, BIOS, checkspace,
# decgraphics, eight_bit_tty, ibmgraphics, ignintr, mail,
# map_mode, null, player_selection, preload_tiles, rawio,
# splash_screen, tiled_map, tile_..., videocolors, videoshades,
# windowcolors
# End-of-file

991
outdated/sys/mac/NHrsrc.hqx Normal file
View File

@@ -0,0 +1,991 @@
(This file must be converted with BinHex 4.0)
:$%jPG%KKBfXZFR0bB`"58e*$8P0&4!%!N!I4j"fk!*!%!3#3!mRS!!$)k!!!"r`
!N!30!"!!,3!`S!)!U!#3"4B!1!!R!1')'&0dE`a1CA4)B@0V,R*cFQ0UFfecFQ0
PER4c+f036(0`F'pM!!"58e*$8P0&4!%!!&-"%!#3%V0,SqB!N!CM'`!!b!%`!!%
!N!J,Z3#3""8!N!AQ!9`!!3#3#!Zi!*!%&3"3!'i!qJ'i!!%!N!J(e!#3""8!8!"
Z!2S"Z!!"!*!)"p-!N!39!&!!EJ$k!EJ!!3#3#!I5!*!%&3"3!'i!qJ'i!*!$(!%
)!!J"5J$`!*!+"dePFh0KCf8i#J#3!a`",J!%!9)"bJ#3#JC6G'&dGA0V1!S!N!-
@!(`!fJ$i!BS!N!3"!*!'66J+!*!$'J#q!!B"8!%b!*!%!3#3"34*EQC[)$J+!*!
$)J!S!#J!M!#L!*!%!3#3"3e1G@aX)&GTEQ4[Gb!K1!S!N!-m$NjeE@*PFL"[CL"
VCAPc6d019!8UN!9-8e4$"dYPH@0[C'9)3PP8"%0SBA*$5%&5"5U3"8a69%8!N!-
J!#J!+!&+!Hi!N!S,4(9ZCf9[EL"0BA!i#J#3!b!!+!!S!+`"c!#3"!%!N!8,4'P
KCfj[Fh4TBh-i#J#3!aB!!400B@-J6Q9d5'&MDb")C@a`b5mr!*!$J!#3#`rr!*!
%r`$a!I!!N!2lm!m3(`#3!`qr$`%"m!#3!r[r%"$`!!$`$lrrmI!!$`rr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fYZB@eP"90dBA*d#d&LEh9d,f9bFQpb"d0[EQCTFQd,3@*
[GA3[CA*bEh)(3fpZCQPbE3Y1CAG)B@0V4QpZG!a38dKKBfY'Efjd)$Q6)`:

4197
outdated/sys/mac/NHsound.hqx Normal file

File diff suppressed because it is too large Load Diff

9
outdated/sys/mac/News Normal file
View File

@@ -0,0 +1,9 @@
Welcome to NetHack 3.6 for MacOS 7.0 - 9.x
Unfortunately, the 68k version is no longer supported.
This game is brought to you by Dean Luick, Kevin Hugo, and Mark Modrall.
Bug reports, suggestions, comments, etc., should be e-mailed to the
Internet address nethack-bugs@nethack.org, or fill out our comment
form on the web at http://www.nethack.org.

36
outdated/sys/mac/README Normal file
View File

@@ -0,0 +1,36 @@
Jan 2002
The MPW compilers are now supported again.
Support for 68k has been discontinued due to a lack of a debugging
system for 68k binaries.
Note that the tiled MacOS X port uses the Qt windowport and the UNIX
build system, not this windowport code.
26 Nov, 1999
NetHack 3.3.0 was built with Metrowerk's Pro 4 compiler on a PPC
system. We are still compiling with 68K alignment because we know
it works. No one has checked lately if the PPC alignment bug
still exists.
23 May, 1996
NetHack 3.2.1 was built with Metrowerk's DR8 compiler on a PPC system.
The official 68K and PPC versions were compiled with 68K Alignment
to share files. The 3.2.0 versions were compiled with PPC alignment,
but it was discovered that the Metrowerks 68K compiler has a bug with
PPC alignment and structures that can be aligned to a single byte. This
bug _may_ be fixed in DR10, it is not fixed in DR9. Why bother with PPC
alignment at all? Because the space saving from 68K alignment is small
and the PowerPC version will run better. The 68K version was compiled
with 4 byte ints using the far model.
Only the Metrowerks compiler has been used to compile the code in a
long time. It is _very_ likely that the other compilers, Think C and
MPW C, will no longer be able to compile NetHack out of the box. They
and their files have been moved to the "old" directory until such time
that someone can compile with them.

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIconFile</key>
<string>nethack</string>
<key>CFBundleIdentifier</key>
<string>org.nethack.carbon</string>
<key>CFBundleLongVersionString</key>
<string>3.5.0 © 1985-2005 devteam@nethack.org</string>
<key>CFBundleName</key>
<string>NetHack</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.5.0</string>
<key>CFBundleSignature</key>
<string>NHak</string>
<key>CFBundleVersion</key>
<string>3.5.0</string>
<key>LSPrefersCarbon</key>
<true/>
<key>NSAppleScriptEnabled</key>
<false/>
<key>NSHumanReadableCopyright</key>
<string>© 1985-2005 devteam@nethack.org</string>
</dict>
</plist>

View File

@@ -0,0 +1,48 @@
/* NetHack 3.6 dprintf.c $NHDT-Date: 1432512798 2015/05/25 00:13:18 $ $NHDT-Branch: master $:$NHDT-Revision: 1.7 $ */
/* Copyright (c) Jon W{tte, 1993. */
/* NetHack may be freely redistributed. See license for details. */
#include "hack.h"
#include "macwin.h"
static Boolean
KeyDown(unsigned short code)
{
unsigned char keys[16];
GetKeys((void *) keys);
return ((keys[code >> 3] >> (code & 7)) & 1) != 0;
}
void
dprintf(char *format, ...)
{
char buffer[500];
va_list list;
int doit;
#define DO_DEBUGSTR 1
#define DO_PLINE 2
if (flags.debug) {
doit = 0;
if (macFlags.hasDebugger && KeyDown(0x39)) { /* Caps Lock */
doit = DO_DEBUGSTR;
} else if (KeyDown(0x3B) && iflags.window_inited && /* Control */
(WIN_MESSAGE != -1)
&& theWindows[WIN_MESSAGE].its_window) {
doit = DO_PLINE;
}
if (doit) {
va_start(list, format);
vsprintf(&buffer[1], format, list);
va_end(list);
if (doit == DO_DEBUGSTR) {
buffer[0] = strlen(&buffer[1]);
DebugStr((uchar *) buffer);
} else if (doit == DO_PLINE)
pline("%s", &buffer[1]);
}
}
}

212
outdated/sys/mac/maccurs.c Normal file
View File

@@ -0,0 +1,212 @@
/* NetHack 3.6 maccurs.c $NHDT-Date: 1432512797 2015/05/25 00:13:17 $ $NHDT-Branch: master $:$NHDT-Revision: 1.9 $ */
/* Copyright (c) Jon W{tte, 1992. */
/* NetHack may be freely redistributed. See license for details. */
#include "hack.h"
#include "mactty.h"
#include "macwin.h"
#if 1 /*!TARGET_API_MAC_CARBON*/
#include <Folders.h>
#include <TextUtils.h>
#include <Resources.h>
#endif
static Boolean winFileInit = 0;
static unsigned char winFileName[32] = "\pNetHack Preferences";
static long winFileDir;
static short winFileVol;
typedef struct WinPosSave {
char validPos;
char validSize;
short top;
short left;
short height;
short width;
} WinPosSave;
static WinPosSave savePos[kLastWindowKind + 1];
static void
InitWinFile(void)
{
StringHandle sh;
long len;
short ref = 0;
if (winFileInit) {
return;
}
/* We trust the glue. If there's an error, store in game dir. */
if (FindFolder(kOnSystemDisk, kPreferencesFolderType, kCreateFolder,
&winFileVol, &winFileDir)) {
winFileVol = 0;
winFileDir = 0;
}
sh = GetString(128);
if (sh && *sh) {
BlockMove(*sh, winFileName, **sh + 1);
ReleaseResource((Handle) sh);
}
if (HOpen(winFileVol, winFileDir, winFileName, fsRdPerm, &ref)) {
return;
}
len = sizeof(savePos);
if (!FSRead(ref, &len, savePos)) {
winFileInit = 1;
}
FSClose(ref);
}
static void
FlushWinFile(void)
{
short ref;
long len;
if (!winFileInit) {
if (!winFileName[0]) {
return;
}
HCreate(winFileVol, winFileDir, winFileName, MAC_CREATOR, PREF_TYPE);
HCreateResFile(winFileVol, winFileDir, winFileName);
}
if (HOpen(winFileVol, winFileDir, winFileName, fsWrPerm, &ref)) {
return;
}
winFileInit = 1;
len = sizeof(savePos);
(void) FSWrite(ref, &len, savePos); /* Don't care about error */
FSClose(ref);
}
Boolean
RetrievePosition(short kind, short *top, short *left)
{
Point p;
if (kind < 0 || kind > kLastWindowKind) {
dprintf("Retrieve Bad kind %d", kind);
return 0;
}
InitWinFile();
if (!savePos[kind].validPos) {
dprintf("Retrieve Not stored kind %d", kind);
return 0;
}
p.v = savePos[kind].top;
p.h = savePos[kind].left;
*left = p.h;
*top = p.v;
dprintf("Retrieve Kind %d Pt (%d,%d)", kind, p.h, p.v);
return (PtInRgn(p, GetGrayRgn()));
}
Boolean
RetrieveSize(short kind, short top, short left, short *height, short *width)
{
Point p;
if (kind < 0 || kind > kLastWindowKind) {
return 0;
}
InitWinFile();
if (!savePos[kind].validSize) {
return 0;
}
*width = savePos[kind].width;
*height = savePos[kind].height;
p.h = left + *width;
p.v = top + *height;
return PtInRgn(p, GetGrayRgn());
}
static void
SavePosition(short kind, short top, short left)
{
if (kind < 0 || kind > kLastWindowKind) {
dprintf("Save bad kind %d", kind);
return;
}
InitWinFile();
savePos[kind].validPos = 1;
savePos[kind].top = top;
savePos[kind].left = left;
dprintf("Save kind %d pt (%d,%d)", kind, left, top);
FlushWinFile();
}
static void
SaveSize(short kind, short height, short width)
{
if (kind < 0 || kind > kLastWindowKind) {
dprintf("Save bad kind %d", kind);
return;
}
InitWinFile();
savePos[kind].validSize = 1;
savePos[kind].width = width;
savePos[kind].height = height;
FlushWinFile();
}
static short
GetWinKind(WindowPtr win)
{
short kind;
if (!CheckNhWin(win)) {
return -1;
}
kind = GetWindowKind(win) - WIN_BASE_KIND;
if (kind < 0 || kind > NHW_TEXT) {
return -1;
}
dprintf("In win kind %d (%lx)", kind, win);
switch (kind) {
case NHW_MAP:
case NHW_STATUS:
case NHW_BASE:
kind = kMapWindow;
break;
case NHW_MESSAGE:
kind = kMessageWindow;
break;
case NHW_MENU:
kind = kMenuWindow;
break;
default:
kind = kTextWindow;
break;
}
dprintf("Out kind %d", kind);
return kind;
}
Boolean
RetrieveWinPos(WindowPtr win, short *top, short *left)
{
return RetrievePosition(GetWinKind(win), top, left);
}
void
SaveWindowPos(WindowPtr win)
{
Rect r;
GetWindowBounds(win, kWindowContentRgn, &r);
SavePosition(GetWinKind(win), r.top, r.left);
}
void
SaveWindowSize(WindowPtr win)
{
short width, height;
Rect r;
GetWindowBounds(win, kWindowContentRgn, &r);
width = r.right - r.left;
height = r.bottom - r.top;
SaveSize(GetWinKind(win), height, width);
}

173
outdated/sys/mac/macerrs.c Normal file
View File

@@ -0,0 +1,173 @@
/* NetHack 3.6 macerrs.c $NHDT-Date: 1432512797 2015/05/25 00:13:17 $ $NHDT-Branch: master $:$NHDT-Revision: 1.10 $ */
/* Copyright (c) Michael Hamel, 1991 */
/* NetHack may be freely redistributed. See license for details. */
#if defined(macintosh) && defined(__SC__) && !defined(__FAR_CODE__)
/* this needs to be resident always */
#pragma segment Main
#endif
#include "hack.h"
#include "macwin.h"
#if !TARGET_API_MAC_CARBON
#include <Dialogs.h>
#include <TextUtils.h>
#include <Resources.h>
#endif
void
error(const char *format, ...)
{
Str255 buf;
va_list ap;
va_start(ap, format);
vsprintf((char *) buf, format, ap);
va_end(ap);
C2P((char *) buf, buf);
ParamText(buf, (StringPtr) "", (StringPtr) "", (StringPtr) "");
Alert(128, (ModalFilterUPP) NULL);
ExitToShell();
}
#if 0 /* Remainder of file is obsolete and will be removed */
#define stackDepth 1
#define errAlertID 129
#define stdIOErrID 1999
static Str255 gActivities[stackDepth] = {""};
static short gTopactivity = 0;
void showerror(char * errdesc, const char * errcomment)
{
short itemHit;
Str255 paserr,
pascomment;
SetCursor(&qd.arrow);
if (errcomment == nil) errcomment = "";
C2P (errcomment, pascomment);
C2P (errdesc, paserr);
ParamText(paserr,pascomment,gActivities[gTopactivity],(StringPtr)"");
itemHit = Alert(errAlertID, (ModalFilterUPP)nil);
}
Boolean itworked(short errcode)
/* Return TRUE if it worked, do an error message and return false if it didn't. Error
strings for native C errors are in STR#1999, Mac errs in STR 2000-errcode, e.g
2108 for not enough memory */
{
if (errcode != 0) {
short itemHit;
Str255 errdesc;
StringHandle strh;
errdesc[0] = '\0';
if (errcode > 0) GetIndString(errdesc,stdIOErrID,errcode); /* STDIO file rres, etc */
else {
strh = GetString(2000-errcode);
if (strh != (StringHandle) nil) {
memcpy(errdesc,*strh,256);
ReleaseResource((Handle)strh);
}
}
if (errdesc[0] == '\0') { /* No description found, just give the number */
sprintf((char *)&errdesc[1],"a %d error occurred",errcode);
errdesc[0] = strlen((char*)&errdesc[1]);
}
SetCursor(&qd.arrow);
ParamText(errdesc,(StringPtr)"",gActivities[gTopactivity],(StringPtr)"");
itemHit = Alert(errAlertID, (ModalFilterUPP)nil);
}
return(errcode==0);
}
void mustwork(short errcode)
/* For cases where we can't recover from the error by any means */
{
if (itworked(errcode)) ;
else ExitToShell();
}
#if defined(USE_STDARG) || defined(USE_VARARGS)
#ifdef USE_STDARG
static void vprogerror(const char *line, va_list the_args);
#else
static void vprogerror();
#endif
/* Macro substitute for error() */
void error VA_DECL(const char *, line)
{
VA_START(line);
VA_INIT(line, char *);
vprogerror(line, VA_ARGS);
VA_END();
}
#ifdef USE_STDARG
static void
vprogerror(const char *line, va_list the_args)
#else
static void
vprogerror(line, the_args) const char *line; va_list the_args;
#endif
#else /* USE_STDARG | USE_VARARG */
void
error VA_DECL(const char *, line)
#endif
{ /* opening brace for vprogerror(), nested block for USE_OLDARG error() */
char pbuf[BUFSZ];
if(index(line, '%')) {
Vsprintf(pbuf,line,VA_ARGS);
line = pbuf;
}
showerror("of an internal error",line);
#if !(defined(USE_STDARG) || defined(USE_VARARGS))
VA_END(); /* provides closing brace for USE_OLDARGS's nested block */
#endif
}
void attemptingto(char * activity)
/* Say what we are trying to do for subsequent error-handling: will appear as x in an
alert in the form "Could not x because y" */
{ C2P(activity,gActivities[gTopactivity]);
}
void comment(char *s, long n)
{
Str255 paserr;
short itemHit;
sprintf((char *)&paserr[1], "%s - %d",s,n);
paserr[0] = strlen ((char*)&paserr[1]);
ParamText(paserr,(StringPtr)"",(StringPtr)"",(StringPtr)"");
itemHit = Alert(128, (ModalFilterUPP)nil);
}
void pushattemptingto(char * activity)
/* Push a new description onto stack so we can pop later to previous state */
{
if (gTopactivity < stackDepth) {
gTopactivity++;
attemptingto(activity);
}
else error("activity stack overflow");
}
void popattempt(void)
/* Pop to previous state */
{
if (gTopactivity > 1) --gTopactivity;
else error("activity stack underflow");
}
#endif /* Obsolete */

480
outdated/sys/mac/macfile.c Normal file
View File

@@ -0,0 +1,480 @@
/* NetHack 3.6 macfile.c $NHDT-Date: 1432512798 2015/05/25 00:13:18 $ $NHDT-Branch: master $:$NHDT-Revision: 1.11 $ */
/* Copyright (c) Jon W{tte, Hao-Yang Wang, Jonathan Handler 1992. */
/* NetHack may be freely redistributed. See license for details. */
/*
* macfile.c
* MAC file I/O routines
*/
#include "hack.h"
#include "macwin.h"
#ifndef __MACH__
#include <files.h>
#include <errors.h>
#include <resources.h>
#include <memory.h>
#include <TextUtils.h>
#include <ToolUtils.h>
#endif
#include "dlb.h"
/*
* We should get the default dirID and volRefNum (from name) from prefs and
* the situation at startup... For now, this will have to do.
*/
/* The HandleFiles are resources built into the application which are treated
as read-only files: if we fail to open a file we look for a resource */
#define FIRST_HF 32000 /* file ID of first HandleFile */
#define MAX_HF 6 /* Max # of open HandleFiles */
#define APP_NAME_RES_ID (-16396)
typedef struct handlefile {
long type; /* Resource type */
short id; /* Resource id */
long mark; /* Current position */
long size; /* total size */
Handle data; /* The resource, purgeable */
} HandleFile;
static HandleFile *FDECL(IsHandleFile, (int));
static int FDECL(OpenHandleFile, (const unsigned char *, long));
static int FDECL(CloseHandleFile, (int));
static int FDECL(ReadHandleFile, (int, void *, unsigned));
static long FDECL(SetHandleFilePos, (int, short, long));
HandleFile theHandleFiles[MAX_HF];
MacDirs theDirs; /* also referenced in macwin.c */
static HandleFile *
IsHandleFile(int fd)
{
HandleFile *hfp = NULL;
if (fd >= FIRST_HF && fd < FIRST_HF + MAX_HF) {
/* in valid range, check for data */
hfp = &theHandleFiles[fd - FIRST_HF];
if (!hfp->data)
hfp = NULL;
}
return hfp;
}
static int
OpenHandleFile(const unsigned char *name, long fileType)
{
int i;
Handle h;
Str255 s;
for (i = 0; i < MAX_HF; i++) {
if (theHandleFiles[i].data == 0L)
break;
}
if (i >= MAX_HF)
return -1;
h = GetNamedResource(fileType, name);
if (!h)
return (-1);
theHandleFiles[i].data = h;
theHandleFiles[i].size = GetHandleSize(h);
GetResInfo(h, &theHandleFiles[i].id, (void *) &theHandleFiles[i].type, s);
theHandleFiles[i].mark = 0L;
return (i + FIRST_HF);
}
static int
CloseHandleFile(int fd)
{
if (!IsHandleFile(fd)) {
return -1;
}
fd -= FIRST_HF;
ReleaseResource(theHandleFiles[fd].data);
theHandleFiles[fd].data = 0L;
return (0);
}
static int
ReadHandleFile(int fd, void *ptr, unsigned len)
{
unsigned maxBytes;
Handle h;
if (!IsHandleFile(fd))
return -1;
fd -= FIRST_HF;
maxBytes = theHandleFiles[fd].size - theHandleFiles[fd].mark;
if (len > maxBytes)
len = maxBytes;
h = theHandleFiles[fd].data;
HLock(h);
BlockMove(*h + theHandleFiles[fd].mark, ptr, len);
HUnlock(h);
theHandleFiles[fd].mark += len;
return (len);
}
static long
SetHandleFilePos(int fd, short whence, long pos)
{
long curpos;
if (!IsHandleFile(fd))
return -1;
fd -= FIRST_HF;
curpos = theHandleFiles[fd].mark;
switch (whence) {
case SEEK_CUR:
curpos += pos;
break;
case SEEK_END:
curpos = theHandleFiles[fd].size - pos;
break;
default: /* set */
curpos = pos;
break;
}
if (curpos < 0)
curpos = 0;
else if (curpos > theHandleFiles[fd].size)
curpos = theHandleFiles[fd].size;
theHandleFiles[fd].mark = curpos;
return curpos;
}
void
C2P(const char *c, unsigned char *p)
{
int len = strlen(c), i;
if (len > 255)
len = 255;
for (i = len; i > 0; i--)
p[i] = c[i - 1];
p[0] = len;
}
void
P2C(const unsigned char *p, char *c)
{
int idx = *p++;
for (; idx > 0; idx--)
*c++ = *p++;
*c = '\0';
}
static void
replace_resource(Handle new_res, ResType its_type, short its_id,
Str255 its_name)
{
Handle old_res;
SetResLoad(false);
old_res = Get1Resource(its_type, its_id);
SetResLoad(true);
if (old_res) {
RemoveResource(old_res);
DisposeHandle(old_res);
}
AddResource(new_res, its_type, its_id, its_name);
}
int
maccreat(const char *name, long fileType)
{
return macopen(name, O_RDWR | O_CREAT | O_TRUNC, fileType);
}
int
macopen(const char *name, int flags, long fileType)
{
short refNum;
short perm;
Str255 s;
C2P(name, s);
if (flags & O_CREAT) {
if (HCreate(theDirs.dataRefNum, theDirs.dataDirID, s, TEXT_CREATOR,
fileType) && (flags & O_EXCL)) {
return -1;
}
#if 0 /* Fails during makedefs */
if (fileType == SAVE_TYPE) {
short resRef;
HCreateResFile(theDirs.dataRefNum, theDirs.dataDirID, s);
resRef = HOpenResFile(theDirs.dataRefNum, theDirs.dataDirID, s,
fsRdWrPerm);
if (resRef != -1) {
Handle name;
Str255 plnamep;
C2P(g.plname, plnamep);
name = (Handle)NewString(plnamep);
if (name)
replace_resource(name, 'STR ', PLAYER_NAME_RES_ID,
"\pPlayer Name");
/* The application name resource. See IM VI, page 9-21. */
name = (Handle)GetString(APP_NAME_RES_ID);
if (name) {
DetachResource(name);
replace_resource(name, 'STR ', APP_NAME_RES_ID,
"\pApplication Name");
}
CloseResFile(resRef);
}
}
#endif
}
/*
* Here, we should check for file type, maybe a SFdialog if
* we fail with default, etc. etc. Besides, we should use HOpen
* and permissions.
*/
if ((flags & O_RDONLY) == O_RDONLY) {
perm = fsRdPerm;
}
if ((flags & O_WRONLY) == O_WRONLY) {
perm = fsWrPerm;
}
if ((flags & O_RDWR) == O_RDWR) {
perm = fsRdWrPerm;
}
if (HOpen(theDirs.dataRefNum, theDirs.dataDirID, s, perm, &refNum)) {
return OpenHandleFile(s, fileType);
}
if (flags & O_TRUNC) {
if (SetEOF(refNum, 0L)) {
FSClose(refNum);
return -1;
}
}
return refNum;
}
int
macclose(int fd)
{
if (IsHandleFile(fd)) {
CloseHandleFile(fd);
} else {
if (FSClose(fd)) {
return -1;
}
FlushVol((StringPtr) 0, theDirs.dataRefNum);
}
return 0;
}
int
macread(int fd, void *ptr, unsigned len)
{
long amt = len;
if (IsHandleFile(fd)) {
return ReadHandleFile(fd, ptr, amt);
} else {
short err = FSRead(fd, &amt, ptr);
return ((err == noErr) || (err == eofErr && len)) ? amt : -1;
}
}
#if 0 /* this function isn't used, if you use it, uncomment prototype in \
macwin.h */
char *
macgets (int fd, char *ptr, unsigned len)
{
int idx = 0;
char c;
while (-- len > 0) {
if (macread (fd, ptr + idx, 1) <= 0)
return (char *)0;
c = ptr[idx++];
if (c == '\n' || c == '\r')
break;
}
ptr [idx] = '\0';
return ptr;
}
#endif /* 0 */
int
macwrite(int fd, void *ptr, unsigned len)
{
long amt = len;
if (IsHandleFile(fd))
return -1;
if (FSWrite(fd, &amt, ptr) == noErr)
return (amt);
else
return (-1);
}
long
macseek(int fd, long where, short whence)
{
short posMode;
long curPos;
if (IsHandleFile(fd)) {
return SetHandleFilePos(fd, whence, where);
}
switch (whence) {
default:
posMode = fsFromStart;
break;
case SEEK_CUR:
posMode = fsFromMark;
break;
case SEEK_END:
posMode = fsFromLEOF;
break;
}
if (SetFPos(fd, posMode, where) == noErr && GetFPos(fd, &curPos) == noErr)
return (curPos);
else
return (-1);
}
int
macunlink(const char *name)
{
Str255 pname;
C2P(name, pname);
return (HDelete(theDirs.dataRefNum, theDirs.dataDirID, pname) == noErr
? 0
: -1);
}
/* ---------------------------------------------------------------------- */
boolean
rsrc_dlb_init(void)
{
return TRUE;
}
void
rsrc_dlb_cleanup(void)
{
}
boolean
rsrc_dlb_fopen(dlb *dp, const char *name, const char *mode)
{
#if defined(__SC__) || defined(__MRC__)
#pragma unused(mode)
#endif
Str255 pname;
C2P(name, pname);
dp->fd = OpenHandleFile(pname, 'File'); /* automatically read-only */
return dp->fd >= 0;
}
int
rsrc_dlb_fclose(dlb *dp)
{
return CloseHandleFile(dp->fd);
}
int
rsrc_dlb_fread(char *buf, int size, int quan, dlb *dp)
{
int nread;
if (size < 0 || quan < 0)
return 0;
nread = ReadHandleFile(dp->fd, buf, (unsigned) size * (unsigned) quan);
return nread / size; /* # of whole pieces (== quan in normal case) */
}
int
rsrc_dlb_fseek(dlb *dp, long pos, int whence)
{
return SetHandleFilePos(dp->fd, whence, pos);
}
char *
rsrc_dlb_fgets(char *buf, int len, dlb *dp)
{
HandleFile *hfp = IsHandleFile(dp->fd);
char *p;
int bytesLeft, n = 0;
if (hfp && hfp->mark < hfp->size) {
bytesLeft = hfp->size - hfp->mark;
if (bytesLeft < len)
len = bytesLeft;
HLock(hfp->data);
for (n = 0, p = *hfp->data + hfp->mark; n < len; n++, p++) {
buf[n] = *p;
if (*p == '\r')
buf[n] = '\n';
if (buf[n] == '\n') {
n++; /* we want the return in the buffer */
break;
}
}
HUnlock(hfp->data);
hfp->mark += n;
if (n != 0)
buf[n] = '\0'; /* null terminate result */
}
return n ? buf : NULL;
}
int
rsrc_dlb_fgetc(dlb *dp)
{
HandleFile *hfp = IsHandleFile(dp->fd);
int ret;
if (!hfp || hfp->size <= hfp->mark)
return EOF;
ret = *(unsigned char *) (*hfp->data + hfp->mark);
hfp->mark++;
return ret;
}
long
rsrc_dlb_ftell(dlb *dp)
{
HandleFile *hfp = IsHandleFile(dp->fd);
if (!hfp)
return 0;
return hfp->mark;
}

View File

@@ -0,0 +1,67 @@
(This file must be converted with BinHex 4.0)
:#QeKBfKPE(!ZBQJ!9%9B9%0A588"#!!!#PX!!!'XRNmM#90$3e-J5@3k)%!S)bP
YB@0SC@a`,Q*S#6-Z-`Nj15m`-bma03dM#80[F(PbD@GSG#!SBbNJ-6Nj1#da16N
j)'*j)%YPGQPZ)%KeCfm0)b"1CA4)B@0V)'eKH5"LC5"QFQ9PE(NJFQ9NDA0dFQP
LGA4PC#iJ)&0PC5"XD@0PER0P)'C[FL"NCA4KD@ac,Jd0$5-M)b""FfYZB@eP)'4
TB@a[Cb!M)b-04%P"6%p()$B`-$!JBA0VEQ&YC3d0)b"3E'&j)'*eG(4[EJda,Q9
ZB@*XC@3J3faTBfXJD'9bC5"dEb"`E'&j)(4SDA-JBfKKFQ&MG'9b,Jda,Q4TFf&
LE'9N)%0XD@0V)'KPFQ8JG'mJF'aKH5"dD'Pc)'0SBA*KBh4PFLl#$5!J6Qpd)'&
fB@PXB@*XC5"LC@0KGA0P)(P[G5"S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Ff8JG'KTFb"YC@je)(4[)("PFQC
[FQh#$5"YDA0MC@aXB@jPEh9c)'&MG'P[ER-Z$3e&6N3Y689193d048j%$5dp!!!
"!!!!!9S!!!"D!!!!8KY`!4m!6VVdjL!ZrqU`RfF-2`B["5m-U"YJ!!$+9Bmr#Qe
KBfKPE(!ZBQKbUL"*4%8J8(*PCR0TEfjMCA0PFfi!$&4&@&4$9dP&!3Mrrrrr!!!
!!!!!!!!!!!!!!!!!!!K$XNab!!!!#PX!!!'XmNkkqQSq(fCU9Bmr,[r`5'lrpNK
ZrrK)E[rm6VVpU$iICP"9Mh!!,`!r"Lm&6VVkKMiICJS[$+Qa9BqTVciIF!+`V[r
iCKC9Mh!!,`!r,[r`,blrmNkkqPik(f!39Bp`!#m!2blrm%kkpFJk(dT(CJ)q"6(
(#Q"-lK$JrpT1AL"I6`!!!%J!#8e[EQ&ME`!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!)!"!!V!+F"dJ*H!#X!T`(5!Pkc58b!!!!!!!!!#PX!!!!!!3!!!!!#!!!
!!!!%!!%!!!!!!3!!!!&D!!!!@J!!!&)"ITa%(YS!!!!F!&)!!8e38e)!!3!569G
#3J!!!#S$lIrr!!!!!!!!!!!$lrrr!!!!6!!!!!!$m2rr!!!!8J!!!!#PK!:

292
outdated/sys/mac/macmain.c Normal file
View File

@@ -0,0 +1,292 @@
/* NetHack 3.6 macmain.c $NHDT-Date: 1432512796 2015/05/25 00:13:16 $ $NHDT-Branch: master $:$NHDT-Revision: 1.21 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2009. */
/* NetHack may be freely redistributed. See license for details. */
/* main.c - Mac NetHack */
#include "hack.h"
#include "dlb.h"
#include "macwin.h"
#include "mactty.h"
#if 1 /*!TARGET_API_MAC_CARBON*/
#include <OSUtils.h>
#include <files.h>
#include <Types.h>
#include <Dialogs.h>
#include <Packages.h>
#include <ToolUtils.h>
#include <Resources.h>
#include <Errors.h>
#endif
#ifndef O_RDONLY
#include <fcntl.h>
#endif
static void finder_file_request(void);
int main(void);
#if __SC__ || __MRC__
QDGlobals qd;
#endif
int
main(void)
{
register int fd = -1;
int argc = 1;
boolean resuming = FALSE; /* assume new game */
early_init();
windowprocs = mac_procs;
InitMac();
g.hname = "Mac Hack";
hackpid = getpid();
setrandom();
initoptions();
init_nhwindows(&argc, (char **) &g.hname);
/*
* It seems you really want to play.
*/
u.uhp = 1; /* prevent RIP on early quits */
finder_file_request();
dlb_init(); /* must be before newgame() */
/*
* Initialize the vision system. This must be before mklev() on a
* new game or before a level restore on a saved game.
*/
vision_init();
display_gamewindows();
set_playmode(); /* sets plname to "wizard" for wizard mode */
/* strip role,race,&c suffix; calls askname() if plname[] is empty
or holds a generic user name like "player" or "games" */
plnamesuffix();
/* unlike Unix where the game might be invoked with a script
which forces a particular character name for each player
using a shared account, we always allow player to rename
the character during role/race/&c selection */
iflags.renameallowed = TRUE;
getlock();
/*
* First, try to find and restore a save file for specified character.
* We'll return here if new game player_selection() renames the hero.
*/
attempt_restore:
if ((fd = restore_saved_game()) >= 0) {
#ifdef NEWS
if (iflags.news) {
display_file(NEWS, FALSE);
iflags.news = FALSE; /* in case dorecover() fails */
}
#endif
pline("Restoring save file...");
mark_synch(); /* flush output */
game_active = 1;
if (dorecover(fd)) {
resuming = TRUE; /* not starting new game */
if (discover)
You("are in non-scoring discovery mode.");
if (discover || wizard) {
if (yn("Do you want to keep the save file?") == 'n')
(void) delete_savefile();
else {
nh_compress(fqname(g.SAVEF, SAVEPREFIX, 0));
}
}
}
}
if (!resuming) {
/* new game: start by choosing role, race, etc;
player might change the hero's name while doing that,
in which case we try to restore under the new name
and skip selection this time if that didn't succeed */
if (!iflags.renameinprogress) {
player_selection();
if (iflags.renameinprogress) {
/* player has renamed the hero while selecting role;
discard current lock file and create another for
the new character name */
delete_levelfile(0); /* remove empty lock file */
getlock();
goto attempt_restore;
}
}
game_active = 1; /* done with selection, draw active game window */
newgame();
if (discover)
You("are in non-scoring discovery mode.");
}
UndimMenuBar(); /* Yes, this is the place for it (!) */
moveloop(resuming);
exit(EXIT_SUCCESS);
/*NOTREACHED*/
return 0;
}
static OSErr
copy_file(short src_vol, long src_dir, short dst_vol, long dst_dir,
Str255 fName,
pascal OSErr (*opener)(short vRefNum, long dirID,
ConstStr255Param fileName,
signed char permission, short *refNum))
{
short src_ref, dst_ref;
OSErr err = (*opener)(src_vol, src_dir, fName, fsRdPerm, &src_ref);
if (err == noErr) {
err = (*opener)(dst_vol, dst_dir, fName, fsWrPerm, &dst_ref);
if (err == noErr) {
long file_len;
err = GetEOF(src_ref, &file_len);
if (err == noErr) {
Handle buf;
long count = MaxBlock();
if (count > file_len)
count = file_len;
buf = NewHandle(count);
err = MemError();
if (err == noErr) {
while (count > 0) {
OSErr rd_err = FSRead(src_ref, &count, *buf);
err = FSWrite(dst_ref, &count, *buf);
if (err == noErr)
err = rd_err;
file_len -= count;
}
if (file_len == 0)
err = noErr;
DisposeHandle(buf);
}
}
FSClose(dst_ref);
}
FSClose(src_ref);
}
return err;
}
static void
force_hdelete(short vol, long dir, Str255 fName)
{
HRstFLock(vol, dir, fName);
HDelete(vol, dir, fName);
}
void
process_openfile(short src_vol, long src_dir, Str255 fName, OSType ftype)
{
OSErr err = noErr;
if (ftype != SAVE_TYPE)
return; /* only deal with save files */
if (src_vol != theDirs.dataRefNum
|| src_dir != theDirs.dataDirID
&& CatMove(src_vol, src_dir, fName, theDirs.dataDirID, "\p:")
!= noErr) {
HCreate(theDirs.dataRefNum, theDirs.dataDirID, fName, MAC_CREATOR,
SAVE_TYPE);
err =
copy_file(src_vol, src_dir, theDirs.dataRefNum, theDirs.dataDirID,
fName, &HOpen); /* HOpenDF is only there under 7.0 */
if (err == noErr)
err = copy_file(src_vol, src_dir, theDirs.dataRefNum,
theDirs.dataDirID, fName, &HOpenRF);
if (err == noErr)
force_hdelete(src_vol, src_dir, fName);
else
HDelete(theDirs.dataRefNum, theDirs.dataDirID, fName);
}
if (err == noErr) {
short ref;
ref = HOpenResFile(theDirs.dataRefNum, theDirs.dataDirID, fName,
fsRdPerm);
if (ref != -1) {
Handle name = Get1Resource('STR ', PLAYER_NAME_RES_ID);
if (name) {
Str255 save_f_p;
P2C(*(StringHandle) name, g.plname);
set_savefile_name(TRUE);
C2P(fqname(g.SAVEF, SAVEPREFIX, 0), save_f_p);
force_hdelete(theDirs.dataRefNum, theDirs.dataDirID,
save_f_p);
if (HRename(theDirs.dataRefNum, theDirs.dataDirID, fName,
save_f_p) == noErr)
macFlags.gotOpen = 1;
}
CloseResFile(ref);
}
}
}
static void
finder_file_request(void)
{
if (macFlags.hasAE) {
/* we're capable of handling Apple Events, so let's see if we have any
*/
EventRecord event;
long toWhen = TickCount()
+ 20; /* wait a third of a second for all initial AE */
while (TickCount() < toWhen) {
if (WaitNextEvent(highLevelEventMask, &event, 3L, 0)) {
AEProcessAppleEvent(&event);
if (macFlags.gotOpen)
break;
}
}
}
#if 0
#ifdef MAC68K
else {
short finder_msg, file_count;
CountAppFiles(&finder_msg, &file_count);
if (finder_msg == appOpen && file_count == 1) {
OSErr err;
AppFile src;
FSSpec filespec;
GetAppFiles(1, &src);
err = FSMakeFSSpec(src.vRefNum, 0, src.fName, &filespec);
if (err == noErr && src.fType == SAVE_TYPE) {
process_openfile (filespec.vRefNum, filespec.parID, filespec.name, src.fType);
if (macFlags.gotOpen)
ClrAppFiles(1);
}
}
}
#endif /* MAC68K */
#endif /* 0 */
}
/* validate wizard mode if player has requested access to it */
boolean
authorize_wizard_mode()
{
/* other ports validate user name or character name here */
return TRUE;
}
/*macmain.c*/

1152
outdated/sys/mac/macmenu.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,66 @@
/* NetHack 3.6 mactopl.c $NHDT-Date: 1432512797 2015/05/25 00:13:17 $ $NHDT-Branch: master $:$NHDT-Revision: 1.9 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Kenneth Lorber, Kensington, Maryland, 2015. */
/* NetHack may be freely redistributed. See license for details. */
#include "hack.h"
#include "mactty.h"
#include "macwin.h"
#include "macpopup.h"
char
queued_resp(char *resp)
{
char buf[30];
if (try_key_queue(buf)) {
if (!resp || strchr(resp, buf[0]))
return buf[0];
if (digit(buf[0]) && strchr(resp, '#')) {
yn_number = atoi(buf);
return '#';
}
}
return '\0';
}
char
topl_yn_function(const char *query, const char *resp, char def)
{
char buf[30];
char c = queued_resp((char *) resp);
if (!c) {
enter_topl_mode((char *) query);
topl_set_resp((char *) resp, def);
do {
c = readchar();
if (c && resp && !strchr(resp, c)) {
nhbell();
c = '\0';
}
} while (!c);
topl_set_resp("", '\0');
leave_topl_mode(buf);
if (c == '#')
yn_number = atoi(buf);
}
return c;
}
char
mac_yn_function(query, resp, def)
const char *query, *resp;
char def;
/*
* Generic yes/no function. 'def' is the default (returned by space or
* return; 'esc' returns 'q', or 'n', or the default, depending on
* what's in the string. The 'query' string is printed before the user
* is asked about the string.
* If resp is NULL, any single character is accepted and returned.
*/
{
return topl_yn_function(query, resp, def);
}
/* mactopl.c */

1260
outdated/sys/mac/mactty.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,40 @@
/* NetHack 3.6 macunix.c $NHDT-Date: 1432512797 2015/05/25 00:13:17 $ $NHDT-Branch: master $:$NHDT-Revision: 1.10 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Kenneth Lorber, Kensington, Maryland, 2015. */
/* NetHack may be freely redistributed. See license for details. */
/* This file collects some Unix dependencies */
#include "hack.h"
void
regularize(char *s)
{
register char *lp;
for (lp = s; *lp; lp++) {
if (*lp == '.' || *lp == ':')
*lp = '_';
}
}
void
getlock(void)
{
int fd;
int pid = getpid(); /* Process ID */
Sprintf(g.lock, "%d%s", getuid(), g.plname);
set_levelfile_name(g.lock, 0);
if ((fd = open(g.lock, O_RDWR | O_EXCL | O_CREAT, LEVL_TYPE)) == -1) {
raw_printf("Could not lock the game %s.", g.lock);
panic("Another game in progress?");
}
if (write(fd, (char *) &pid, sizeof(pid)) != sizeof(pid)) {
raw_printf("Could not lock the game %s.", g.lock);
panic("Disk locked?");
}
close(fd);
}

3284
outdated/sys/mac/macwin.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,78 @@
/* NetHack 3.6 mgetline.c $NHDT-Date: 1432512797 2015/05/25 00:13:17 $ $NHDT-Branch: master $:$NHDT-Revision: 1.10 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Kenneth Lorber, Kensington, Maryland, 2015. */
/* NetHack may be freely redistributed. See license for details. */
#include "hack.h"
#include "mactty.h"
#include "macwin.h"
#include "macpopup.h"
#include "func_tab.h"
extern int NDECL(extcmd_via_menu); /* cmd.c */
typedef Boolean FDECL((*key_func), (unsigned char));
int
get_line_from_key_queue(char *bufp)
{
*bufp = 0;
if (try_key_queue(bufp)) {
while (*bufp) {
if (*bufp == 10 || *bufp == 13) {
*bufp = 0;
}
bufp++;
}
return true;
}
return false;
}
static void
topl_getlin(const char *query, char *bufp, Boolean ext)
{
if (get_line_from_key_queue(bufp))
return;
enter_topl_mode((char *) query);
while (topl_key(nhgetch(), ext))
;
leave_topl_mode(bufp);
}
/*
* Read a line closed with '\n' into the array char bufp[BUFSZ].
* (The '\n' is not stored. The string is closed with a '\0'.)
* Reading can be interrupted by an escape ('\033') - now the
* resulting string is "\033".
*/
void
mac_getlin(const char *query, char *bufp)
{
topl_getlin(query, bufp, false);
}
/* Read in an extended command - doing command line completion for
* when enough characters have been entered to make a unique command.
* This is just a modified getlin() followed by a lookup. -jsb
*/
int
mac_get_ext_cmd()
{
char bufp[BUFSZ];
int i;
if (iflags.extmenu)
return extcmd_via_menu();
topl_getlin("# ", bufp, true);
for (i = 0; extcmdlist[i].ef_txt != (char *) 0; i++)
if (!strcmp(bufp, extcmdlist[i].ef_txt))
break;
if (extcmdlist[i].ef_txt == (char *) 0)
i = -1; /* not found */
return i;
}
/* macgetline.c */

29
outdated/sys/mac/mmodal.c Normal file
View File

@@ -0,0 +1,29 @@
/* NetHack 3.6 mmodal.c $NHDT-Date: 1432512797 2015/05/25 00:13:17 $ $NHDT-Branch: master $:$NHDT-Revision: 1.11 $ */
/* Copyright (c) Jon W{tte, Hao-Yang Wang, Jonathan Handler 1992. */
/* NetHack may be freely redistributed. See license for details. */
#if 1 /*!TARGET_API_MAC_CARBON*/
#include <Dialogs.h>
#include <ControlDefinitions.h>
#else
#include <Carbon/Carbon.h>
#endif
#include "macpopup.h"
/* Flash a dialog button when its accelerator key is pressed */
void
FlashButton(DialogRef wind, short item)
{
short type;
Handle handle;
Rect rect;
unsigned long ticks;
/* Apple recommends 8 ticks */
GetDialogItem(wind, item, &type, &handle, &rect);
HiliteControl((ControlHandle) handle, kControlButtonPart);
Delay(8, &ticks);
HiliteControl((ControlHandle) handle, 0);
return;
}

1338
outdated/sys/mac/mrecover.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,69 @@
(This file must be converted with BinHex 4.0)
:$@ebC@0[GQ9b,R*cFQ-!FR0bBe*6483!!!!!!!!!!!aI55J!!!!!!3!!!!TJ!!!
*B!!!!Im!!'1M#Q&$E'YTEQPd,Q1!!J!!!&4&@&4,38K-!3!!-"*YFQ9MEhCPFLj
`FQpU,R*cFQ0b!J!!!(*cFQ058d9%!!"bFh*M8P0&4!%!!0!!J!!!!!!!!!!!!!!
!!!!!!!!!!+lTZ(B!!!!!!!!-F`!!!!!!!!!!%!!!!'1M#Q&$E'YXEfp`,Q1!!J!
!!&4&@&4,38K-!3!!B!"X!!!!!'1V!!!!!&Le!!"F!!!!!!!!!!!!!!#Mk`QeT3H
i4`!!!!"hD3!!!!!!!!!!!!!!!!!!!!!p93!A!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!L!!%!!!!!!$J!EJ"-!1B%!Np,!!!!!!!+!!S!+J&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r`$r!2m!r`$r!2m!IJ!m!"J!!*!!F!!!!U!c#!!!!!!c-Z-ap
5C@0[GQ9b)$-Z-`eNCACdC@&Y3'jPG'KKBfXZEh*R!!!!&J-`J!!!!!-c,M-,8Q9
MEhCPFL!c,M-!!!%!!!!+B!!!#@!!!!(r"-)(q#qq!!!!(!(k!!p"6&*8!!%!JN4
*9%`!!J#D689193!#!,j$99*6!!F!iNP$6L-!!!&#D@0c)`!!!8j#6N4-!!!"@Qj
S8Q-!!!&Q4P*&4J!!!A*fCA*c!!%"IQPME$3!!!'@D@0c0!!!!D*65801!!!"VQe
PE8)!!!'k9%e36!!!!FC%6%p(!!!"dJ#!rrm!!!!Q!!!!!!#"rrm!!!!f!!!!!!#
!rrmJ!!!!!!!!!!#"rrmJ!!90!!!!!!%!rrmJ!!HF!!!!!!##rrm!!!"'!!!!!!#
!rrm!!!#5!!!!!!#"rrm!!!C(!!!!!!#!rrm8!!$1!!!!!!#"rrm8!!EV!!!!!!#
#rrm8!!Fc!!!!!!#(rrm8!!H`!!!!!!#&rrm8!!Ii!!!!!!#'rrm8!!K!!!!!!!#
%rrm8!!L)!!!!!!#$rrm8!!M3!!!!!!#!rrm!!!'G!!!!!!#!rrm!!!%@!!!!!!#
!rrm!!!&D!!!!!!!!rrm!!!'&!!!!!!#!rrm!!!&k!!!!!!!"rrm!!!NB!!!!!!!
#rrm!!!P'!!!!!!#!rrm!!!+K!!!!!!#!rrm!!!5P!!!!!!#!rrm!!!8T!!!!!!#
!rrm8!!D0!!!!!!#!!!!!!!DP!!!!!!%!rrm!!!Gl!!!!!!4YC@e#8i3:

626
outdated/sys/mac/mttymain.c Normal file
View File

@@ -0,0 +1,626 @@
/* NetHack 3.6 mttymain.c $NHDT-Date: 1554215928 2019/04/02 14:38:48 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.13 $ */
/* Copyright (c) Jon W{tte, 1993 */
/* NetHack may be freely redistributed. See license for details. */
#include "hack.h"
#include "macwin.h"
#include "mttypriv.h"
#include "mactty.h"
#include "wintty.h"
#if !TARGET_API_MAC_CARBON
#include <Palettes.h>
#endif
#include <Gestalt.h>
#define MT_WINDOW 135
#define MT_WIDTH 80
#define MT_HEIGHT 24
/*
* Names:
*
* Statics are prefixed _
* Mac-tty becomes mt_
*/
static long _mt_attrs[5][2] = {
{ 0x000000, 0xffffff }, /* Normal */
{ 0xff8080, 0xffffff }, /* Underline */
{ 0x40c020, 0xe0e0e0 }, /* Bold */
{ 0x003030, 0xff0060 }, /* Blink */
{ 0xff8888, 0x000000 }, /* Inverse */
};
static char _attrs_inverse[5] = {
0, 0, 0, 0, 0,
};
/* see color.h */
static long _mt_colors[CLR_MAX][2] = {
{ 0x000000, 0x808080 }, /* Black */
{ 0x880000, 0xffffff }, /* Red */
{ 0x008800, 0xffffff }, /* Green */
{ 0x553300, 0xffffff }, /* Brown */
{ 0x000088, 0xffffff }, /* Blue */
{ 0x880088, 0xffffff }, /* Magenta */
{ 0x008888, 0xffffff }, /* Cyan */
{ 0x888888, 0xffffff }, /* Gray */
{ 0x000000, 0xffffff }, /* No Color */
{ 0xff4400, 0xffffff }, /* Orange */
{ 0x00ff00, 0xffffff }, /* Bright Green */
{ 0xffff00, 0x606060 }, /* Yellow */
{ 0x0033ff, 0xffffff }, /* Bright Blue */
{ 0xff00ff, 0xffffff }, /* Bright Magenta */
{ 0x00ffff, 0xffffff }, /* Bright Cyan */
{ 0xffffff, 0x505050 }, /* White */
};
static char _colors_inverse[CLR_MAX] = {
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
#ifdef CHANGE_COLOR
#define POWER_LIMIT 22
#define SECONDARY_POWER_LIMIT 16
#define CHANNEL_LIMIT 14
#define SECONDARY_CHANNEL_LIMIT 12
void
tty_change_color(int color, long rgb, int reverse)
{
long inverse, working_rgb = rgb;
int total_power = 0, max_channel = 0;
int cnt = 3;
working_rgb >>= 4;
while (cnt-- > 0) {
total_power += working_rgb & 0xf;
max_channel = max(max_channel, working_rgb & 0xf);
working_rgb >>= 8;
}
if (total_power >= POWER_LIMIT
|| (total_power >= SECONDARY_POWER_LIMIT
&& max_channel >= SECONDARY_CHANNEL_LIMIT)
|| max_channel >= CHANNEL_LIMIT)
inverse = 0x000000;
else
inverse = 0xffffff;
if (reverse) {
working_rgb = rgb;
rgb = inverse;
inverse = working_rgb;
}
if (color >= CLR_MAX) {
if (color - CLR_MAX >= 5)
impossible("Changing too many colors");
else {
_mt_attrs[color - CLR_MAX][0] = rgb;
_mt_attrs[color - CLR_MAX][1] = inverse;
_attrs_inverse[color - CLR_MAX] = reverse;
}
} else if (color >= 0) {
_mt_colors[color][0] = rgb;
_mt_colors[color][1] = inverse;
_colors_inverse[color] = reverse;
} else
impossible("Changing negative color");
}
void
tty_change_background(int white_or_black)
{
register int i;
for (i = 0; i < CLR_MAX; i++) {
if (white_or_black)
_mt_colors[i][1] = 0xffffff; /* white */
else
_mt_colors[i][1] = 0x000000; /* black */
}
/* special cases */
if (white_or_black) {
_mt_colors[CLR_BLACK][1] =
0x808080; /* differentiate black from no color */
_mt_colors[CLR_WHITE][1] =
0x505050; /* highlight white with grey background */
_mt_colors[CLR_YELLOW][1] =
0x606060; /* highlight yellow with grey background */
_mt_colors[CLR_BLUE][0] = 0x000088; /* make pure blue */
_mt_colors[NO_COLOR][0] = 0x000000; /* make no_color black on white */
_mt_attrs[0][0] = 0x000000; /* "normal" is black on white */
_mt_attrs[0][1] = 0xffffff;
} else {
_mt_colors[NO_COLOR][0] = 0xffffff; /* make no_color white on black */
_mt_colors[CLR_BLACK][1] =
0x808080; /* differentiate black from no color */
_mt_colors[CLR_BLUE][0] =
0x222288; /* lighten blue - it's too dark on black */
_mt_attrs[0][0] = 0xffffff; /* "normal" is white on black */
_mt_attrs[0][1] = 0x000000;
}
}
char *
tty_get_color_string(void)
{
char *ptr;
int count;
static char color_buf[5 * (CLR_MAX + 5) + 1];
color_buf[0] = 0;
ptr = color_buf;
for (count = 0; count < CLR_MAX; count++) {
int flag = _colors_inverse[count] ? 1 : 0;
sprintf(ptr, "%s%s%x%x%x", count ? "/" : "", flag ? "-" : "",
(int) (_mt_colors[count][flag] >> 20) & 0xf,
(int) (_mt_colors[count][flag] >> 12) & 0xf,
(int) (_mt_colors[count][flag] >> 4) & 0xf);
ptr += strlen(ptr);
}
for (count = 0; count < 5; count++) {
int flag = _attrs_inverse[count] ? 1 : 0;
sprintf(ptr, "/%s%x%x%x", flag ? "-" : "",
(int) (_mt_attrs[count][flag] >> 20) & 0xf,
(int) (_mt_attrs[count][flag] >> 12) & 0xf,
(int) (_mt_attrs[count][flag] >> 4) & 0xf);
ptr += strlen(ptr);
}
return color_buf;
}
#endif
extern struct DisplayDesc *ttyDisplay; /* the tty display descriptor */
char kill_char = CHAR_ESC;
char erase_char = CHAR_BS;
WindowRef _mt_window = (WindowRef) 0;
static Boolean _mt_in_color = 0;
extern short win_fonts[NHW_TEXT + 1];
static void
_mt_init_stuff(void)
{
long resp, flag;
short num_cols, num_rows, win_width, win_height, font_num, font_size;
short char_width, row_height;
short hor, vert;
LI = MT_HEIGHT;
CO = MT_WIDTH;
if (!strcmp(windowprocs.name, "mac")) {
dprintf("Mac Windows");
LI -= 1;
} else {
dprintf("TTY Windows");
}
/*
* If there is at least one screen CAPABLE of color, and if
* 32-bit QD is there, we use color. 32-bit QD is needed for the
* offscreen GWorld
*/
if (!Gestalt(gestaltQuickdrawVersion, &resp) && resp > 0x1ff) {
GDHandle gdh = GetDeviceList();
while (gdh) {
if (TestDeviceAttribute(gdh, screenDevice)) {
if (HasDepth(gdh, 4, 1, 1) || HasDepth(gdh, 8, 1, 1)
|| HasDepth(gdh, 16, 1, 1) || HasDepth(gdh, 32, 1, 1)) {
_mt_in_color = 1;
break;
}
}
gdh = GetNextDevice(gdh);
}
}
if (create_tty(&_mt_window, WIN_BASE_KIND + NHW_MAP, _mt_in_color)
!= noErr)
error("_mt_init_stuff: Couldn't create tty.");
SetWindowKind(_mt_window, WIN_BASE_KIND + NHW_MAP);
SelectWindow(_mt_window);
SetPortWindowPort(_mt_window);
SetOrigin(-1, -1);
font_size = iflags.wc_fontsiz_map
? iflags.wc_fontsiz_map
: (iflags.large_font && !small_screen) ? 12 : 9;
if (init_tty_number(_mt_window, win_fonts[NHW_MAP], font_size, CO, LI)
!= noErr)
error("_mt_init_stuff: Couldn't init tty.");
if (get_tty_metrics(_mt_window, &num_cols, &num_rows, &win_width,
&win_height, &font_num, &font_size, &char_width,
&row_height))
error("_mt_init_stuff: Couldn't get tty metrics.");
SizeWindow(_mt_window, win_width + 2, win_height + 2, 1);
if (RetrievePosition(kMapWindow, &vert, &hor)) {
dprintf("Moving window to (%d,%d)", hor, vert);
MoveWindow(_mt_window, hor, vert, 1);
}
ShowWindow(_mt_window);
/* Start in raw, always flushing mode */
get_tty_attrib(_mt_window, TTY_ATTRIB_FLAGS, &flag);
flag |= TA_ALWAYS_REFRESH | TA_WRAP_AROUND;
set_tty_attrib(_mt_window, TTY_ATTRIB_FLAGS, flag);
get_tty_attrib(_mt_window, TTY_ATTRIB_CURSOR, &flag);
flag |= (TA_BLINKING_CURSOR | TA_NL_ADD_CR);
set_tty_attrib(_mt_window, TTY_ATTRIB_CURSOR, flag);
set_tty_attrib(_mt_window, TTY_ATTRIB_FOREGROUND,
_mt_colors[NO_COLOR][0]);
set_tty_attrib(_mt_window, TTY_ATTRIB_BACKGROUND,
_mt_colors[NO_COLOR][1]);
clear_tty(_mt_window);
InitMenuRes();
{
/* update the window proc has_color table */
int i, setting = 0;
Rect r;
// Point p = {0, 0};
GDHandle gh = (GDHandle) 0;
if (_mt_in_color) {
GetWindowBounds(_mt_window, kWindowContentRgn, &r);
// SetPortWindowPort(_mt_window);
// LocalToGlobal (&p);
// OffsetRect (&r, p.h, p.v);
gh = GetMaxDevice(&r);
/* > 4 bpp */
setting = ((*((*gh)->gdPMap))->pixelSize > 4) ? 1 : 0;
}
for (i = 0; i < CLR_MAX ; ++i) {
tty_procs.has_color[i] =
(i == CLR_BLACK || i == NO_COLOR || i == CLR_WHITE)
? 1
: (_mt_in_color && gh)
? setting
: 0;
}
}
}
int
tgetch(void)
{
EventRecord event;
long sleepTime = 0;
int ret = 0;
for (; !ret;) {
WaitNextEvent(-1, &event, sleepTime, 0);
HandleEvent(&event);
blink_cursor(_mt_window, event.when);
if (event.what == nullEvent) {
sleepTime = GetCaretTime();
} else {
sleepTime = 0;
}
ret = GetFromKeyQueue();
if (ret == CHAR_CR)
ret = CHAR_LF;
}
return ret;
}
void
getreturn(char *str)
{
FlushEvents(-1, 0);
msmsg("Press space %s", str);
(void) tgetch();
}
#if 0 /* this function is commented out */
/* the tty has_color[] table is filled in during init above */
int
has_color(int color)
{
#if defined(__SC__) || defined(__MRC__)
#pragma unused(color)
#endif
Rect r;
// Point p = {0, 0};
GDHandle gh;
if (!_mt_in_color)
return 0;
GetWindowBounds(_mt_window, kWindowContentRgn, &r);
// SetPortWindowPort(_mt_window);
// LocalToGlobal (&p);
// OffsetRect (&r, p.h, p.v);
gh = GetMaxDevice(&r);
if (!gh) {
return 0;
}
return (*((*gh)->gdPMap))->pixelSize > 4; /* > 4 bpp */
}
#endif
void
tty_delay_output(void)
{
EventRecord event;
long toWhen = TickCount() + 3;
while (TickCount() < toWhen) {
WaitNextEvent(updateMask, &event, 3L, 0);
if (event.what == updateEvt) {
HandleEvent(&event);
blink_cursor(_mt_window, event.when);
}
}
}
void
cmov(int x, int y)
{
move_tty_cursor(_mt_window, x, y);
ttyDisplay->cury = y;
ttyDisplay->curx = x;
}
void
nocmov(int x, int y)
{
cmov(x, y);
}
static void
_mt_set_colors(long *colors)
{
short err;
if (!_mt_in_color) {
return;
}
err = set_tty_attrib(_mt_window, TTY_ATTRIB_FOREGROUND, colors[0]);
err = set_tty_attrib(_mt_window, TTY_ATTRIB_BACKGROUND, colors[1]);
}
int
term_attr_fixup(int attrmask)
{
attrmask &= ~ATR_DIM;
return attrmask;
}
void
term_end_attr(int attr)
{
#if defined(__SC__) || defined(__MRC__)
#pragma unused(attr)
#endif
_mt_set_colors(_mt_attrs[0]);
}
void
term_start_attr(int attr)
{
switch (attr) {
case ATR_ULINE:
_mt_set_colors(_mt_attrs[1]);
break;
case ATR_BOLD:
_mt_set_colors(_mt_attrs[2]);
break;
case ATR_BLINK:
_mt_set_colors(_mt_attrs[3]);
break;
case ATR_INVERSE:
_mt_set_colors(_mt_attrs[4]);
break;
default:
_mt_set_colors(_mt_attrs[0]);
break;
}
}
void
standoutend(void)
{
term_end_attr(ATR_INVERSE);
}
void
standoutbeg(void)
{
term_start_attr(ATR_INVERSE);
}
void
term_end_color(void)
{
_mt_set_colors(_mt_colors[NO_COLOR]);
}
void
cl_end(void)
{
_mt_set_colors(_mt_attrs[0]);
clear_tty_window(_mt_window, ttyDisplay->curx, ttyDisplay->cury, CO - 1,
ttyDisplay->cury);
}
void
clear_screen(void)
{
_mt_set_colors(_mt_attrs[0]);
clear_tty(_mt_window);
}
void
cl_eos(void)
{
_mt_set_colors(_mt_attrs[0]);
clear_tty_window(_mt_window, ttyDisplay->curx, ttyDisplay->cury, CO - 1,
LI - 1);
}
void
home(void)
{
cmov(0, 0);
}
void
backsp(void)
{
char eraser[] = { CHAR_BS, CHAR_BLANK, CHAR_BS, 0 };
short err;
err = add_tty_string(_mt_window, eraser);
err = update_tty(_mt_window);
}
void
msmsg(const char *str, ...)
{
va_list args;
char buf[1000];
va_start(args, str);
vsprintf(buf, str, args);
va_end(args);
xputs(buf);
}
void
term_end_raw_bold(void)
{
term_end_attr(ATR_INVERSE);
}
void
term_start_raw_bold(void)
{
term_start_attr(ATR_INVERSE);
}
void
term_start_color(int color)
{
if (color >= 0 && color < CLR_MAX) {
_mt_set_colors(_mt_colors[color]);
}
}
void
setftty(void)
{
long flag;
/* Buffered output for the game */
get_tty_attrib(_mt_window, TTY_ATTRIB_FLAGS, &flag);
flag &= ~TA_ALWAYS_REFRESH;
flag |= TA_INHIBIT_VERT_SCROLL; /* don't scroll */
set_tty_attrib(_mt_window, TTY_ATTRIB_FLAGS, flag);
iflags.cbreak = 1;
}
void
tty_startup(int *width, int *height)
{
_mt_init_stuff();
*width = CO;
*height = LI;
}
void
gettty(void)
{
}
void
settty(const char *str)
{
long flag;
update_tty(_mt_window);
/* Buffered output for the game, raw in "raw" mode */
get_tty_attrib(_mt_window, TTY_ATTRIB_FLAGS, &flag);
flag &= ~TA_INHIBIT_VERT_SCROLL; /* scroll */
flag |= TA_ALWAYS_REFRESH;
set_tty_attrib(_mt_window, TTY_ATTRIB_FLAGS, flag);
tty_raw_print("\n");
if (str) {
tty_raw_print(str);
}
}
void
tty_number_pad(int arg)
{
#if defined(__SC__) || defined(__MRC__)
#pragma unused(arg)
#endif
}
void
tty_start_screen(void)
{
iflags.cbreak = 1;
}
void
tty_end_screen(void)
{
}
void
xputs(const char *str)
{
add_tty_string(_mt_window, str);
}
int
term_puts(const char *str)
{
xputs(str);
return strlen(str);
}
int
term_putc(int c)
{
short err;
err = add_tty_char(_mt_window, c);
return err ? EOF : c;
}
int
term_flush(void *desc)
{
if (desc == stdout || desc == stderr) {
update_tty(_mt_window);
} else {
impossible("Substituted flush for file");
return fflush(desc);
}
return 0;
}

2
outdated/sys/os2/.gitattributes vendored Normal file
View File

@@ -0,0 +1,2 @@
Makefile.* NHSUBST
* NH_filestag=(file%s_for_OS/2_version_-_untested_for_3.7)

View File

@@ -0,0 +1,276 @@
Instructions for compiling and installing NetHack 3.4
on an OS/2 system
=====================================================
Timo Hakulinen
Last revision: 29 October 1996
0. Read this entire file before starting, and come back to the Notes below if
you have any problems.
1. Make sure all the NetHack files are in the appropriate directory
structure. You should have a top directory (e.g. nh33, or whatever you
like) with subdirectories dat, doc, include, src, util, sys\share,
sys\os2, and win\tty. You may have other subdirectories under sys and
win, but they will not affect compilation for an OS/2 system. If you do
not follow this structure, the makefile will not function properly. The
.c files for the main program belong in src, those for utility programs in
util, and OS/2-specific ones in sys\os2. All the .h files belong in
include, the documentation in doc, and assorted data files in dat. There
are also some necessary files in sys\share (pc*.c, random.c, dgn_*.*,
lev_*.*). A more detailed explanation of the directory structure is found
in file Files, which should be in the top directory.
If you downloaded or ftp'd the sources from a UNIX system, the lines may
end in UNIX-style newlines instead of the carriage return and line feed
pairs used by DOS and OS/2. You'll have to convert them (with a utility
like Rahul Dhesi's "flip"). Also, every file should end with a carriage
return / line feed pair, because Microsoft C has had a habit of ignoring
the last line of each file otherwise. Besides, even editing UNIX-style
files with DOS editors is often a royal pain.
2. The makefile for OS/2, Makefile.os2, is found in directory sys\os2. Copy
it to directory src and rename it Makefile. From now on, Makefile.os2
will be referred to as "the makefile" in this document.
The makefile supports the following make utilities:
NDMAKE a public domain make utility for DOS by Don Kneller
NMAKE make shipped with Microsoft languages and IBM C Set/2
DMAKE a public domain make for DOS and OS/2 by Dennis Vadura
Both NDMAKE and DMAKE are available at major archive sites. The
following compilers are supported:
compiler: runs in: compiles for:
Microsoft C 5.1 DOS / OS/2 1.0-Warp OS/2 1.x
Microsoft 6.0A (see note 5) - " - - " -
IBM C Set/2 1.00, Toolkit/2 2.00 OS/2 2.x, Warp OS/2 2.x, Warp
IBM CSet++ 2.00 OS/2 2.x, Warp OS/2 2.x, Warp
GCC emx 0.8f (see note 6) OS/2 2.x, Warp OS/2 2.x, Warp
Note that code compiled for OS/2 versions 1.0-1.3 runs unmodified in OS/2
versions 2.0 and up. In principle it should be possible to cross compile
NetHack 3.6 for OS/2 in DOS using NDMAKE and MSC, but this is not
recommended (see note 3).
If you're using some other compiler than one listed above, you will have
to adapt the makefile to your needs. In particular, change the CC,
CFLAGS, LINK, and LFLAGS macros to your C compiler's and linker's liking.
See the makefile for more information.
If you are going to be constructing Fred Fish's termcap library, you'll
need Makefile.lib in sys\share (see note 4).
3. Go to the include subdirectory. First edit config.h according to the
comments to match your system and desired set of features. In particular,
make sure that OS2 is defined, and that UNIX, HACKDIR, and COMPRESS are
*not* defined. If you want to try out the new DLB data file library
scheme, uncomment DLB. Note that although the makefile contains some
support for this scheme, it's new in NetHack 3.3 and hasn't been tested.
If your compiler is ANSI compliant (like practically all OS/2 compilers
are), it's probable that nothing else needs to be configured in config.h.
Next look at os2conf.h. This file shouldn't need much changing. If you
want to use the hardcoded OS/2 system definitions in def_os2.h instead of
the compiler's standard headers, comment out OS2_USESYSHEADERS. This may
become necessary if you are using a compiler which doesn't come with
proper system headers by default. In this case you may have to edit the
definitions there, because every compiler has its own way of declaring
the necessary system functions and data structures. In general you
should prefer the compiler's offerings, if possible.
If you are going to compile the game on an HPFS drive, uncomment OS2_HPFS,
which enables the use of longer file names during compilation. The
generated executable will only use file names compatible with FAT drives,
however.
If you are using a 32 bit compiler other than GCC emx 0.8f or C Set/2 in
OS/2 2.x, force OS2_32BITAPI to be defined. Otherwise it is defined only
for the above mentioned compilers.
If you are not going to include random.c, because you are using the
random number generator provided by your compiler, you will need to
comment out RANDOM.
If you want to muck with different termcap settings, uncomment TERMLIB to
enable the use of termcap routines (see note 4). This is not necessary to
create a fully functional game, however.
4. If you are using another compiler than MSC, GCC, or IBM C Set/2, you may
want to look through system.h in the include directory. This file matches
the return and parameter types for system calls and library routines with
various flavors of compilers and operating systems. Leaving this file
alone is unlikely to cause problems, but if you get compile errors with
any functions in the standard library, it's worth checking the
declarations there.
5. If you want to change the high score list behavior, examine the top of
topten.c, in the src directory. You may want to change the definitions of
PERSMAX, POINTSMIN, and ENTRYMAX.
6. Go to the src directory and edit the top of the makefile. Be sure that
the directory you want the game installed to actually exists.
You'll need nroff and/or TeX/LaTeX to do the files in doc. If you don't
have either of these, you can skip it.
If you elected not to use the high quality BSD random number routines by
commenting out RANDOM in os2conf.h, comment out (or set equal to nothing)
the RANDOM macro in the makefile.
If you elected to use Fred Fish's termcap library (bundled in as
termcap.uu in directory sys\share), you will have to generate termlib.lib
from those sources by typing "make -f makefile.lib termlib.lib". You must
set the TERMLIB option in the makefile to link the resulting termlib.lib
into the game.
If you are recompiling after patching your sources, or if you got your
files from somewhere other than the official distribution, "touch
makedefs.c" to ensure that certain files (onames.h and pm.h) are remade,
lest potentially troublesome time stamps fool make.
If you have lex and yacc programs, or the equivalent flex and bison
programs, you can set up the makefile to generate the appropriate .h and
.c files from their .l and .y counterparts whenever you recompile. This
is done by changing the do_yacc and do_lex targets in the makefile to
depend on targets yacc_act and lex_act instead of yacc_cpy and lex_cpy.
Otherwise the makefile will copy pre-generated yacc and lex output files
dgn_*.* and lev_*.* from directory sys\share to util and include.
Now, enter "make all", and take a siesta; your computer will be occupied
for a fair amount of time. If all goes well, you will get an executable.
7. All the support data files should have been copied to the game directory
by the make process. Here is the complete list in alphabetical order of
all the files that should have gotten there during a full build:
Arc-fila.lev Arc-filb.lev Arc-goal.lev Arc-loca.lev Arc-strt.lev
Bar-fila.lev Bar-filb.lev Bar-goal.lev Bar-loca.lev Bar-strt.lev
Cav-fila.lev Cav-filb.lev Cav-goal.lev Cav-loca.lev Cav-strt.lev
Hea-fila.lev Hea-filb.lev Hea-goal.lev Hea-loca.lev Hea-strt.lev
Kni-fila.lev Kni-filb.lev Kni-goal.lev Kni-loca.lev Kni-strt.lev
Mon-fila.lev Mon-filb.lev Mon-goal.lev Mon-loca.lev Mon-strt.lev
Pri-fila.lev Pri-filb.lev Pri-goal.lev Pri-loca.lev Pri-strt.lev
Ran-fila.lev Ran-filb.lev Ran-goal.lev Ran-loca.lev Ran-strt.lev
Rog-fila.lev Rog-filb.lev Rog-goal.lev Rog-loca.lev Rog-strt.lev
Sam-fila.lev Sam-filb.lev Sam-goal.lev Sam-loca.lev Sam-strt.lev
Tou-fila.lev Tou-filb.lev Tou-goal.lev Tou-loca.lev Tou-strt.lev
Val-fila.lev Val-filb.lev Val-goal.lev Val-loca.lev Val-strt.lev
Wiz-fila.lev Wiz-filb.lev Wiz-goal.lev Wiz-loca.lev Wiz-strt.lev
air.lev asmodeus.lev astral.lev baalz.lev bigrm-1.lev
bigrm-2.lev bigrm-3.lev bigrm-4.lev bigrm-5.lev castle.lev
cmdhelp data dungeon earth.lev fakewiz1.lev
fakewiz2.lev fire.lev help hh history
juiblex.lev knox.lev license medusa-1.lev medusa-2.lev
minefill.lev minend-1.lev minend-2.lev minetn-1.lev minetn-2.lev
nethack.cmd nethack.cnf nethack.exe nethack.ico opthelp
options oracle.lev oracles orcus.lev quest.dat
recover.exe rumors sanctum.lev soko1-1.lev soko1-2.lev
soko2-1.lev soko2-2.lev soko3-1.lev soko3-2.lev soko4-1.lev
soko4-2.lev tower1.lev tower2.lev tower3.lev valley.lev
water.lev wizard1.lev wizard2.lev wizard3.lev wizhelp
Yes. It's 112 files for a full featured NetHack 3.4. If any of the files
are missing, try to rerun make. If that doesn't help, you'll have to try
to decipher the makefile to find out how to manually create the missing
files. These kinds of troubles shouldn't happen except for two reasons:
You've run out of disk space while compiling or your make utility doesn't
understand the makefile properly for some reason. In either case, you
should get some warnings from the make, though.
If you have old record, logfile, or news files in the game directory, they
are not overwritten. Of course, old records from NetHack 3.1 and 3.2 are
not worth keeping with 3.4, since these games are really quite different.
Edit file nethack.cnf in the game directory to reflect your particular
setup and personal preferences, following the comments there. More info
about settable options can be found in the file opthelp and the guidebook.
If you compiled in the TERMLIB feature, also move the sys\share\termcap
file to your game directory.
8. If you'll be running NetHack from a different subdirectory, you will want
to "set HACKDIR=c:\games\nh33" (or whatever directory you want to use).
Add it to your config.sys, if you'll be playing often.
You can also create a special NetHack entry in your Presentation Manager /
Workplace Shell desktop. This will use the included NetHack icon.
The following is a sample program description for OS/2 1.3 desktop, but
it's similar for OS/2 2.0:
Program title: NetHack 3.4
Path and file name: c:\games\nh33\nethack.cmd
Parameters:
Working directory: c:\games\nh33
Program type: OS/2 Full screen
Naturally you must fill in your own game directory and parameters if you
want to set any. The program type can be either OS/2 Full screen or OS/2
Windowed. Note that you should set the executable path to use the .cmd
file generated by the makefile. This file generates an extra pause after
the program exit, because otherwise you wouldn't get to see the high score
list upon quitting due to PM/WPS automatically closing the program window.
When starting NetHack normally from OS/2 command prompt, the command
processor starts nethack.exe instead, so no extra pause is generated.
9. If you want to clear up the temporary files and objects created by the
compilation process, you may issue "make spotless". This will return your
source tree to near-distribution condition. Naturally, it will not affect
your newly built game files in any way.
10. Play NetHack. If it works, you're done!
Notes
-----
1) Save-files and bones-files from previous versions will not work with
NetHack 3.4. Don't bother trying to keep them.
2) To install an update of NetHack after changing something, enter "make"
from the src directory. If you add, delete, or reorder monsters or
objects, or you change the format of saved level files, delete any save
and bones files. (Trying to use such files sometimes produces amusing
confusions on the game's part, but usually crashes.)
3) When cross-compiling for OS/2 in DOS, NDMAKE is the best choice because it
requires the least RAM for itself. Note however, that cross-compilation
in DOS is discouraged, because it is considered obsolete (OS/2 is really
a much better place to compile). If you still want to try, here are some
suggestions:
During linking, Microsoft linker will need temporary storage space. Make
sure you have about 1 MB of free disk where ever you have defined your
temporary storage. It is also a good idea to compile with as much free
RAM as possible. It may otherwise get crowded with the bigger, more
complex source files (compiler bombs with "out of heap space" or similar).
If this happens, strip your configuration, zap TSR's, get a better memory
manager etc.
4) The file sys\share\termcap.uu is the fixed version of the Fred Fish
termcap library. You will need to run a uudecode utility on it to
generate the file termcap.zip. termcap.zip contains several files of
termcap routines. Using them with NetHack involves very little knowledge
of the UNIX concept of a termcap database; mostly you need to know enough
to set a TERM environment variable. You can unzip termcap.zip in the
sys\share directory, but if you are going to use it, it is probably best
to unzip a copy in the src directory. That way you will not miss copying
any files over. Wherever you unzip it, get rid of the included makefile
since a better version has been provided as Makefile.lib. After creating
the termcap library file termlib.lib, copy it to src before compiling the
game main source.
5) When compiling with MSC 6.0, the maintenance version 6.0A should be used
instead of the original 6.0, which was all too buggy to successfully build
NetHack.
6) Note that emx 0.8f is the first version of GCC for OS/2 that can properly
compile NetHack. Earlier versions do not work, because they don't support
the 16 bit API calls of OS/2.
GCC emx 0.8f does not currently work properly when fseek() function is
used with text files. This is well documented in the compiler's
documentation. Unfortunately NetHack uses fseek() in several places in
connection with text data. This means that some help texts may not come
out right, but no serious problems should emerge.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,23 @@
begin 644 nethack.ico
M0D$H``````````````!#21H`````````>`````P````@`$```0`!`````/___
M_T-)&@````````!X`0``#````"``(``!``0```````"``(```("`@```@`"`L
M@(``@("`P,#```#_`/\``/___P``_P#___\`____````````````````````!
M`````````````````````````````````````````````````````````````
M`````````````````````````````````````````````````````````````
M`````````````````````````````````````````````````````````````
M`````````````````````````````````````````````````````````````
M`````````````````````````````````````````````````````````````
M`````````````````````/9F9F9F9F9F9F9F9F9F9F;_9F9F9F9F9F9F9F9F7
M9F9F_XB(B(B(B(B(B(B(B(AF9O^(B(B(B(B(B(B(B(B(9F;_B(B(B(5558B("
MB(B(B&9F_XB(B(@`506(B(B(B(AF9O^(B(B(```%B(B(B(B(9F;_B(A555``@
M55B(B(B(B&9F_XB+N[NP#N-5B(B(B(AF9O^(N[N[`+[N-5B(B(B(9F;_B[N[E
MN[N[[N-8B(B(B&9F_XN[N[N[N[[N4XB(B(AF9O^+N[N9F9N[[N,XB(B(9F;_)
MB[NYF9F9N[[N,XB(B&9F_XN[F9F9F9N[[N,XB(AF9O^+N9F9F9F9NU[N,XB(<
M9F;_B[F9F9F9F;M8[N,XB&9F_XNYF9F9F9F[6([N,XAF9O^+N9F9F9F9NUB(]
M[N.(9F;_B[F9F9F9F;M8B([NB&9F_XN[F9F9F9N[6(B([HAF9O^+N[F9F9F[#
MNUB(B(B(9F;_B[N[F9F;N[M8B(B(B&9F_XN[N[N[N[N[6(B(B(AF9O^+N[N[)
MN[N[NXB(B(B(9F;_B[N(B(B(B[N(B(B(B&9F_XNXB(B(B(B[B(B(B(AF9O^(/
MB(B(B(B(B(B(B(B(9F;_B(B(B(B(B(B(B(B(B&9F_XB(B(B(B(B(B(B(B(AFN
A9O__________________]F;_____________________?
``
end

376
outdated/sys/os2/os2.c Normal file
View File

@@ -0,0 +1,376 @@
/* NetHack 3.6 os2.c $NHDT-Date: 1432512793 2015/05/25 00:13:13 $ $NHDT-Branch: master $:$NHDT-Revision: 1.9 $ */
/* Copyright (c) Timo Hakulinen, 1990, 1991, 1992, 1993, 1996. */
/* NetHack may be freely redistributed. See license for details. */
/*
* OS/2 system functions.
*/
#define NEED_VARARGS
#include "hack.h"
#ifdef OS2
#include "tcap.h"
/* OS/2 system definitions */
#ifdef __EMX__
#undef CLR_BLACK
#undef CLR_WHITE
#undef CLR_BLUE
#undef CLR_RED
#undef CLR_GREEN
#undef CLR_CYAN
#undef CLR_YELLOW
#undef CLR_BROWN
#endif
#include "def_os2.h"
#include <ctype.h>
static char NDECL(DOSgetch);
static char NDECL(BIOSgetch);
int
tgetch()
{
char ch;
/* BIOSgetch can use the numeric key pad on IBM compatibles. */
if (iflags.BIOS)
ch = BIOSgetch();
else
ch = DOSgetch();
return ((ch == '\r') ? '\n' : ch);
}
/*
* Keyboard translation tables.
*/
#define KEYPADLO 0x47
#define KEYPADHI 0x53
#define PADKEYS (KEYPADHI - KEYPADLO + 1)
#define iskeypad(x) (KEYPADLO <= (x) && (x) <= KEYPADHI)
/*
* Keypad keys are translated to the normal values below.
* When iflags.BIOS is active, shifted keypad keys are translated to the
* shift values below.
*/
static const struct pad {
char normal, shift, cntrl;
} keypad[PADKEYS] =
{
{ 'y', 'Y', C('y') }, /* 7 */
{ 'k', 'K', C('k') }, /* 8 */
{ 'u', 'U', C('u') }, /* 9 */
{ 'm', C('p'), C('p') }, /* - */
{ 'h', 'H', C('h') }, /* 4 */
{ 'g', 'g', 'g' }, /* 5 */
{ 'l', 'L', C('l') }, /* 6 */
{ 'p', 'P', C('p') }, /* + */
{ 'b', 'B', C('b') }, /* 1 */
{ 'j', 'J', C('j') }, /* 2 */
{ 'n', 'N', C('n') }, /* 3 */
{ 'i', 'I', C('i') }, /* Ins */
{ '.', ':', ':' } /* Del */
},
numpad[PADKEYS] = {
{ '7', M('7'), '7' }, /* 7 */
{ '8', M('8'), '8' }, /* 8 */
{ '9', M('9'), '9' }, /* 9 */
{ 'm', C('p'), C('p') }, /* - */
{ '4', M('4'), '4' }, /* 4 */
{ 'g', 'G', 'g' }, /* 5 */
{ '6', M('6'), '6' }, /* 6 */
{ 'p', 'P', C('p') }, /* + */
{ '1', M('1'), '1' }, /* 1 */
{ '2', M('2'), '2' }, /* 2 */
{ '3', M('3'), '3' }, /* 3 */
{ 'i', 'I', C('i') }, /* Ins */
{ '.', ':', ':' } /* Del */
};
/*
* Unlike Ctrl-letter, the Alt-letter keystrokes have no specific ASCII
* meaning unless assigned one by a keyboard conversion table, so the
* keyboard BIOS normally does not return a character code when Alt-letter
* is pressed. So, to interpret unassigned Alt-letters, we must use a
* scan code table to translate the scan code into a letter, then set the
* "meta" bit for it. -3.
*/
#define SCANLO 0x10
#define SCANHI 0x32
#define SCANKEYS (SCANHI - SCANLO + 1)
#define inmap(x) (SCANLO <= (x) && (x) <= SCANHI)
static const char scanmap[SCANKEYS] = {
/* ... */
'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', '\n', 0, 'a',
's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '\'', '`', 0, '\\', 'z', 'x',
'c', 'v', 'b', 'N', 'm' /* ... */
};
/*
* BIOSgetch emulates the MSDOS way of getting keys directly with a BIOS call.
*/
#define SHIFT_KEY (0x1 | 0x2)
#define CTRL_KEY 0x4
#define ALT_KEY 0x8
static char
BIOSgetch()
{
unsigned char scan, shift, ch;
const struct pad *kpad;
KBDKEYINFO CharData;
USHORT IOWait = 0;
HKBD KbdHandle = 0;
KbdCharIn(&CharData, IOWait, KbdHandle);
ch = CharData.chChar;
scan = CharData.chScan;
shift = CharData.fsState;
/* Translate keypad keys */
if (iskeypad(scan)) {
kpad = iflags.num_pad ? numpad : keypad;
if (shift & SHIFT_KEY)
ch = kpad[scan - KEYPADLO].shift;
else if (shift & CTRL_KEY)
ch = kpad[scan - KEYPADLO].cntrl;
else
ch = kpad[scan - KEYPADLO].normal;
}
/* Translate unassigned Alt-letters */
if ((shift & ALT_KEY) && !ch) {
if (inmap(scan))
ch = scanmap[scan - SCANLO];
return (isprint(ch) ? M(ch) : ch);
}
return ch;
}
static char
DOSgetch()
{
KBDKEYINFO CharData;
USHORT IOWait = 0;
HKBD KbdHandle = 0;
KbdCharIn(&CharData, IOWait, KbdHandle);
if (CharData.chChar == 0) { /* an extended code -- not yet supported */
KbdCharIn(&CharData, IOWait, KbdHandle); /* eat the next character */
CharData.chChar = 0; /* and return a 0 */
}
return (CharData.chChar);
}
char
switchar()
{
return '/';
}
int
kbhit()
{
KBDKEYINFO CharData;
HKBD KbdHandle = 0;
KbdPeek(&CharData, KbdHandle);
return (CharData.fbStatus & (1 << 6));
}
long
freediskspace(path)
char *path;
{
FSALLOCATE FSInfoBuf;
#ifdef OS2_32BITAPI
ULONG
#else
USHORT
#endif
DriveNumber, FSInfoLevel = 1, res;
if (path[0] && path[1] == ':')
DriveNumber = (toupper(path[0]) - 'A') + 1;
else
DriveNumber = 0;
res =
#ifdef OS2_32BITAPI
DosQueryFSInfo(DriveNumber, FSInfoLevel, (PVOID) &FSInfoBuf,
(ULONG) sizeof(FSInfoBuf));
#else
DosQFSInfo(DriveNumber, FSInfoLevel, (PBYTE) &FSInfoBuf,
(USHORT) sizeof(FSInfoBuf));
#endif
if (res)
return -1L; /* error */
else
return ((long) FSInfoBuf.cSectorUnit * FSInfoBuf.cUnitAvail
* FSInfoBuf.cbSector);
}
/*
* Functions to get filenames using wildcards
*/
#ifdef OS2_32BITAPI
static FILEFINDBUF3 ResultBuf;
#else
static FILEFINDBUF ResultBuf;
#endif
static HDIR DirHandle;
int
findfirst(path)
char *path;
{
#ifdef OS2_32BITAPI
ULONG
#else
USHORT
#endif
res, SearchCount = 1;
DirHandle = 1;
res =
#ifdef OS2_32BITAPI
DosFindFirst((PSZ) path, &DirHandle, 0L, (PVOID) &ResultBuf,
(ULONG) sizeof(ResultBuf), &SearchCount, 1L);
#else
DosFindFirst((PSZ) path, &DirHandle, 0, &ResultBuf,
(USHORT) sizeof(ResultBuf), &SearchCount, 0L);
#endif
return (!res);
}
int
findnext()
{
#ifdef OS2_32BITAPI
ULONG
#else
USHORT
#endif
res, SearchCount = 1;
res =
#ifdef OS2_32BITAPI
DosFindNext(DirHandle, (PVOID) &ResultBuf, (ULONG) sizeof(ResultBuf),
&SearchCount);
#else
DosFindNext(DirHandle, &ResultBuf, (USHORT) sizeof(ResultBuf),
&SearchCount);
#endif
return (!res);
}
char *
foundfile_buffer()
{
return (ResultBuf.achName);
}
long
filesize(file)
char *file;
{
if (findfirst(file)) {
return (*(long *) (ResultBuf.cbFileAlloc));
} else
return -1L;
}
/*
* Chdrive() changes the default drive.
*/
void
chdrive(str)
char *str;
{
char *ptr;
char drive;
if ((ptr = index(str, ':')) != (char *) 0) {
drive = toupper(*(ptr - 1));
#ifdef OS2_32BITAPI
DosSetDefaultDisk((ULONG)(drive - 'A' + 1));
#else
DosSelectDisk((USHORT)(drive - 'A' + 1));
#endif
}
}
void
disable_ctrlP()
{
KBDINFO KbdInfo;
HKBD KbdHandle = 0;
if (!iflags.rawio)
return;
KbdInfo.cb = sizeof(KbdInfo);
KbdGetStatus(&KbdInfo, KbdHandle);
KbdInfo.fsMask &= 0xFFF7; /* ASCII off */
KbdInfo.fsMask |= 0x0004; /* BINARY on */
KbdSetStatus(&KbdInfo, KbdHandle);
}
void
enable_ctrlP()
{
KBDINFO KbdInfo;
HKBD KbdHandle = 0;
if (!iflags.rawio)
return;
KbdInfo.cb = sizeof(KbdInfo);
KbdGetStatus(&KbdInfo, KbdHandle);
KbdInfo.fsMask &= 0xFFFB; /* BINARY off */
KbdInfo.fsMask |= 0x0008; /* ASCII on */
KbdSetStatus(&KbdInfo, KbdHandle);
}
void
get_scr_size()
{
VIOMODEINFO ModeInfo;
HVIO VideoHandle = 0;
ModeInfo.cb = sizeof(ModeInfo);
(void) VioGetMode(&ModeInfo, VideoHandle);
CO = ModeInfo.col;
LI = ModeInfo.row;
}
void
gotoxy(x, y)
int x, y;
{
HVIO VideoHandle = 0;
x--;
y--; /* (0,0) is upper right corner */
(void) VioSetCurPos(x, y, VideoHandle);
}
char *
get_username(lan_username_size)
int *lan_username_size;
{
return (char *) 0;
}
#ifdef X11_GRAPHICS
int errno;
#endif
#endif /* OS2 */

4
outdated/sys/wince/.gitattributes vendored Normal file
View File

@@ -0,0 +1,4 @@
*.ce NHSUBST
*.mak NHSUBST
*.bat NHSUBST
* NH_filestag=(file%s_for_Windows_CE_and_PocketPC_-_untested_for_3.7)

View File

@@ -0,0 +1,136 @@
Copyright (c) Alex Kompel, 2002
NetHack may be freely redistributed. See license for details.
========================================================================
Instructions for compiling and installing
NetHack 3.6 on a Windows CE or PocketPC system
========================================================================
Last revision: $NHDT-Date: 1432512799 2015/05/25 00:13:19 $
Credit for the porting of NetHack to Windows CE goes to Alex Kompel who
initially developed and contributed the port.
In order to build NetHack for Windows CE, you need *both* of the following:
o A copy of Microsoft Visual C V6.0 SP3 or later. Things may work with
an earlier version of the compiler, but the current code has not been
tested with an earlier version.
o Embedded Visual C++ 3.0 or later
FIRST STEP:
The first step in building NetHack for Windows CE is to execute
sys/wince/cesetup.bat.
From the command prompt:
cd sys\wince
cesetup
From a Windows explorer window:
double-click on cesetup.bat
A "wince" directory will be created off the top of the NetHack source
tree, and a Microsoft embedded C workspace file will be placed in the
top of the NetHack source tree.
------------
| BUILDING |
------------
Boostrapping the build process on Windows NT/2000/XP
1. With the Visual C++ 6.0 tools in your path,
Run "nmake /f bootstrp.mak" from the wince folder.
Compiling
2. Start the Embedded Visual C IDE. In the Embedded Visual C IDE
Menus, choose:
File | Open Workspace
3. Set up for the build.
o In the Visual C "Open Workspace" dialog box, navigate to the top
of your NetHack source directory tree.
In there, highlight "wince.vcw" and click on Open.
Once the workspace has been opened, you should see the following
list in the Visual C selection window:
+ nethack_hpc files
+ nethack_palm_pc files
+ nethack_pocket_pc files
+ nethack_smartphone files
o On the Embedded Visual C menus, choose:
Build | Set Active Platform
Select the platform that corresponds to your device:
Palm-size PC 2.11 - palm size PC running Windows CE version 2.11
Pocket PC - palm-size PC running Windows CE 3.0 and higher (PocketPC)
H/PC Pro 2.11 - handheld computers running Windows CE 2.11 anf higher
Smartphone 2002 - Microsoft SmartPhone device
o On the Visual C menus again, choose either:
Build | Set Active Configuration
where configuration is one of the following (make sure it matches the platform
you have selected):
nethack_hpc - Win32 (WCE MIPS) HPCRelease - H/PC Pro 2.11 MIPS processor release executable
nethack_hpc - Win32 (WCE x86em) HPCDebug - H/PC Pro 2.11 x86 emulation debug executable
nethack_hpc - Win32 (WCE ARM) HPCRelease - H/PC Pro 2.11 ARM processor release executable
nethack_hpc - Win32 (WCE SH3) HPCRelease - H/PC Pro 2.11 SH3 processor release executable
nethack_hpc - Win32 (WCE x86em) HPCRelease - H/PC Pro 2.11 x86 emulation release executable
nethack_hpc - Win32 (WCE SH4) HPCRelease - H/PC Pro 2.11 SH4 processor release executable
nethack_palm_pc - Win32 (WCE MIPS) PalmPCRelease - Palm-size PC 2.11 MIPS processor release executable
nethack_palm_pc - Win32 (WCE x86em) PalmPCDebug - Palm-size PC 2.11 x86 emulation debug executable
nethack_palm_pc - Win32 (WCE SH3) PalmPCRelease - Palm-size PC 2.11 SH3 processor release executable
nethack_palm_pc - Win32 (WCE x86em) PalmPCRelease - Palm-size PC 2.11 x86 emulation release executable
nethack_pocket_pc - Win32 (WCE MIPS) PocketPCRelease - Pocket PC MIPS processor release executable
nethack_pocket_pc - Win32 (WCE ARM) PocketPCRelease - Pocket PC ARM processor release executable
nethack_pocket_pc - Win32 (WCE x86em) PocketPCRelease - Pocket PC x86 emulation release executable
nethack_pocket_pc - Win32 (WCE x86em) PocketPCDebug - Pocket PC x86 emulation debug executable
nethack_pocket_pc - Win32 (WCE SH3) PocketPCRelease - Pocket PC SH3 processor release executable
nethack_smartphone - Win32 (WCE ARM) SPhoneRelease - Smartphone 2002 ARM processor release executable
nethack_smartphone - Win32 (WCE x86em) SPhoneDebug - Smartphone 2002 x86 emulation debug executable
Building
4. Start your build.
o On the Embedded Visual C menus once again, choose:
Build | Build nethackm.exe
This starts the build. It is likely that the IDE message window
where you are doing the compiling will be occupied for a while.
Notes:
o You may get a bunch of warnings regarding missing include files in the
beginning of the build process - ignore them. For some reason the tool
that produces these messages ignores preprocessor directives. The actual
build will go just fine.
o Sometimes the compiler chokes on do_wear.c Ignore that - let the build
finish. Then run it again - it will compile just fine. (Seems to be some
sort of bug in EVC++)
Transfer
5. Transfer the files and executables to your handheld by extracting the
files into some folder on the CE device - that should do it.
Notes
If you want to use IBMGraphics make sure that you have a proper
font installed on the device that supports OEM character set
(for example, Lucida Console)
PROBLEMS
If you discover a bug and wish to report it, or if you have comments
or suggestions we recommend using our "Contact Us" web page at:
http://www.nethack.org/common/contact.html
If you don't have access to the web, or you want to send us a patch
to the NetHack source code feel free to drop us a line c/o:
DevTeam (at) nethack.org
Happy NetHacking!

View File

@@ -0,0 +1,876 @@
# NetHack 3.6 bootstrp.mak $NHDT-Date: 1432512801 2015/05/25 00:13:21 $ $NHDT-Branch: master $:$NHDT-Revision: 1.13 $
# Copyright (c) Michael Allison
#
# NetHack Windows CE bootstrap file for MS Visual C++ V6.x and
# above and MS NMAKE
#
# This will:
# - build makedefs
# -
#==============================================================================
# Do not delete the following 3 lines.
#
TARGETOS=BOTH
APPVER=4.0
!include <win32.mak>
#
# Source directories. Makedefs hardcodes these, don't change them.
#
INCL = ..\include # NetHack include files
DAT = ..\dat # NetHack data files
DOC = ..\doc # NetHack documentation files
UTIL = ..\util # Utility source
SRC = ..\src # Main source
SSYS = ..\sys\share # Shared system files
NTSYS = ..\sys\winnt # NT Win32 specific files
TTY = ..\win\tty # window port files (tty)
WIN32 = ..\win\win32 # window port files (WINCE)
WSHR = ..\win\share # Tile support files
SWINCE= ..\wince # wince files
WINCE = ..\wince # wince build area
OBJ = $(WINCE)\ceobj
DLB = $(DAT)\nhdat
#==========================================
# Setting up the compiler and linker
# macros. All builds include the base ones.
#==========================================
CFLAGSBASE = -c $(cflags) $(cvarsmt) -I$(INCL) -nologo $(cdebug) $(WINPINC) -DDLB
LFLAGSBASEC = $(linkdebug) /NODEFAULTLIB /INCREMENTAL:NO /RELEASE /NOLOGO -subsystem:console,4.0 $(conlibsmt)
LFLAGSBASEG = $(linkdebug) $(guiflags) $(guilibsmt) comctl32.lib
#==========================================
# Util builds
#==========================================
CFLAGSU = $(CFLAGSBASE) $(WINPFLAG)
LFLAGSU = $(LFLAGSBASEC)
LEVCFLAGS= -c -nologo -DWINVER=0x0400 -DWIN32 -D_WIN32 \
-D_MT -MT -I..\include -nologo -Z7 -Od -DDLB
#==========================================
#================ RULES ==================
#==========================================
.SUFFIXES: .exe .o .til .uu .c .y .l
#==========================================
# Rules for files in src
#==========================================
#.c{$(OBJ)}.o:
# $(cc) $(CFLAGSU) -Fo$@ $<
{$(SRC)}.c{$(OBJ)}.o:
$(CC) $(CFLAGSU) -Fo$@ $<
#==========================================
# Rules for files in sys\share
#==========================================
{$(SSYS)}.c{$(OBJ)}.o:
$(CC) $(CFLAGSU) -Fo$@ $<
#==========================================
# Rules for files in sys\winnt
#==========================================
{$(NTSYS)}.c{$(OBJ)}.o:
$(CC) $(CFLAGSU) -Fo$@ $<
{$(NTSYS)}.h{$(INCL)}.h:
copy $< $@
#==========================================
# Rules for files in util
#==========================================
{$(UTIL)}.c{$(OBJ)}.o:
$(CC) $(CFLAGSU) -Fo$@ $<
#==========================================
# Rules for files in win\share
#==========================================
{$(WSHR)}.c{$(OBJ)}.o:
$(CC) $(CFLAGSU) -Fo$@ $<
{$(WSHR)}.h{$(INCL)}.h:
copy $< $@
#{$(WSHR)}.txt{$(DAT)}.txt:
# copy $< $@
#==========================================
# Rules for files in win\tty
#==========================================
{$(TTY)}.c{$(OBJ)}.o:
$(CC) $(CFLAGSU) -Fo$@ $<
#==========================================
# Rules for files in win\win32
#==========================================
{$(WIN32)}.c{$(OBJ)}.o:
$(cc) $(CFLAGSU) -Fo$@ $<
#==========================================
# Rules for files in sys\wince
#==========================================
{$(SWINCE)}.c{$(OBJ)}.o:
$(cc) $(CFLAGSU) -Fo$@ $<
#==========================================
#================ MACROS ==================
#==========================================
#
# Shorten up the location for some files
#
O = $(OBJ)^\
U = $(UTIL)^\
#
# Utility Objects.
#
MAKESRC = $(U)makedefs.c
SPLEVSRC = $(U)lev_yacc.c $(U)lev_$(LEX).c $(U)lev_main.c $(U)panic.c
DGNCOMPSRC = $(U)dgn_yacc.c $(U)dgn_$(LEX).c $(U)dgn_main.c
MAKEOBJS = $(O)makedefs.o $(O)monst.o $(O)objects.o
SPLEVOBJS = $(O)lev_yacc.o $(O)lev_$(LEX).o $(O)lev_main.o \
$(O)alloc.o $(O)decl.o $(O)drawing.o \
$(O)monst.o $(O)objects.o $(O)panic.o
DGNCOMPOBJS = $(O)dgn_yacc.o $(O)dgn_$(LEX).o $(O)dgn_main.o \
$(O)alloc.o $(O)panic.o
TILEFILES = $(WSHR)\monsters.txt $(WSHR)\objects.txt $(WSHR)\other.txt
#
# These are not invoked during a normal game build in 3.5.0
#
TEXT_IO = $(O)tiletext.o $(O)tiletxt.o $(O)drawing.o \
$(O)decl.o $(O)monst.o $(O)objects.o
TEXT_IO32 = $(O)tilete32.o $(O)tiletx32.o $(O)drawing.o \
$(O)decl.o $(O)monst.o $(O)objects.o
GIFREADERS = $(O)gifread.o $(O)alloc.o $(O)panic.o
GIFREADERS32 = $(O)gifrd32.o $(O)alloc.o $(O)panic.o
PPMWRITERS = $(O)ppmwrite.o $(O)alloc.o $(O)panic.o
DLBOBJ = $(O)dlb.o
#==========================================
# Header file macros
#==========================================
CONFIG_H = $(INCL)\config.h $(INCL)\config1.h $(INCL)\tradstdc.h \
$(INCL)\global.h $(INCL)\coord.h $(INCL)\vmsconf.h \
$(INCL)\system.h $(INCL)\unixconf.h $(INCL)\os2conf.h \
$(INCL)\micro.h $(INCL)\pcconf.h $(INCL)\tosconf.h \
$(INCL)\amiconf.h $(INCL)\macconf.h $(INCL)\beconf.h \
$(INCL)\ntconf.h $(INCL)\wceconf.h
HACK_H = $(INCL)\hack.h $(CONFIG_H) $(INCL)\align.h \
$(INCL)\dungeon.h $(INCL)\monsym.h $(INCL)\mkroom.h \
$(INCL)\objclass.h $(INCL)\youprop.h $(INCL)\prop.h \
$(INCL)\permonst.h $(INCL)\mextra.h $(INCL)\monattk.h \
$(INCL)\monflag.h $(INCL)\mondata.h $(INCL)\pm.h \
$(INCL)\wintype.h $(INCL)\decl.h $(INCL)\quest.h \
$(INCL)\spell.h $(INCL)\color.h $(INCL)\obj.h \
$(INCL)\you.h $(INCL)\attrib.h $(INCL)\monst.h \
$(INCL)\skills.h $(INCL)\onames.h $(INCL)\timeout.h \
$(INCL)\trap.h $(INCL)\flag.h $(INCL)\rm.h \
$(INCL)\vision.h $(INCL)\display.h $(INCL)\engrave.h \
$(INCL)\rect.h $(INCL)\region.h $(INCL)\winprocs.h \
$(INCL)\wintty.h $(INCL)\trampoli.h
DGN_FILE_H = $(INCL)\dgn_file.h
LEV_COMP_H = $(INCL)\lev_comp.h
SP_LEV_H = $(INCL)\sp_lev.h
TILE_H = ..\win\share\tile.h
#==========================================
# Miscellaneous
#==========================================
DATABASE = $(DAT)\data.base
#==========================================
#=============== TARGETS ==================
#==========================================
#
# The default make target (so just typing 'nmake' is useful).
#
default : all
#
# Everything
#
all : $(INCL)\date.h $(INCL)\onames.h $(INCL)\pm.h \
$(SRC)\monstr.c $(SRC)\vis_tab.c $(U)lev_comp.exe $(INCL)\vis_tab.h \
$(U)dgn_comp.exe $(U)uudecode.exe \
$(DAT)\data $(DAT)\rumors $(DAT)\dungeon \
$(DAT)\oracles $(DAT)\quest.dat $(O)sp_lev.tag $(DLB) $(SRC)\tile.c \
$(SWINCE)\nethack.ico $(SWINCE)\tiles.bmp $(SWINCE)\mnsel.bmp \
$(SWINCE)\mnunsel.bmp $(SWINCE)\petmark.bmp $(SWINCE)\mnselcnt.bmp \
$(SWINCE)\keypad.bmp $(SWINCE)\menubar.bmp
@echo Done!
$(O)sp_lev.tag: $(DAT)\bigroom.des $(DAT)\castle.des \
$(DAT)\endgame.des $(DAT)\gehennom.des $(DAT)\knox.des \
$(DAT)\medusa.des $(DAT)\oracle.des $(DAT)\tower.des \
$(DAT)\yendor.des $(DAT)\arch.des $(DAT)\barb.des \
$(DAT)\caveman.des $(DAT)\healer.des $(DAT)\knight.des \
$(DAT)\monk.des $(DAT)\priest.des $(DAT)\ranger.des \
$(DAT)\rogue.des $(DAT)\samurai.des $(DAT)\sokoban.des \
$(DAT)\tourist.des $(DAT)\valkyrie.des $(DAT)\wizard.des
cd $(DAT)
$(U)lev_comp bigroom.des
$(U)lev_comp castle.des
$(U)lev_comp endgame.des
$(U)lev_comp gehennom.des
$(U)lev_comp knox.des
$(U)lev_comp mines.des
$(U)lev_comp medusa.des
$(U)lev_comp oracle.des
$(U)lev_comp sokoban.des
$(U)lev_comp tower.des
$(U)lev_comp yendor.des
$(U)lev_comp arch.des
$(U)lev_comp barb.des
$(U)lev_comp caveman.des
$(U)lev_comp healer.des
$(U)lev_comp knight.des
$(U)lev_comp monk.des
$(U)lev_comp priest.des
$(U)lev_comp ranger.des
$(U)lev_comp rogue.des
$(U)lev_comp samurai.des
$(U)lev_comp tourist.des
$(U)lev_comp valkyrie.des
$(U)lev_comp wizard.des
cd $(WINCE)
echo sp_levs done > $(O)sp_lev.tag
#$(NHRES): $(TILEBMP16) $(WINCE)\winhack.rc $(WINCE)\mnsel.bmp \
# $(WINCE)\mnselcnt.bmp $(WINCE)\mnunsel.bmp \
# $(WINCE)\petmark.bmp $(WINCE)\NetHack.ico $(WINCE)\rip.bmp \
# $(WINCE)\splash.bmp
# $(rc) -r -fo$@ -i$(WINCE) -dNDEBUG $(WINCE)\winhack.rc
#
# Utility Targets.
#
#==========================================
# Makedefs Stuff
#==========================================
$(U)makedefs.exe: $(MAKEOBJS)
$(link) $(LFLAGSU) -out:$@ $(MAKEOBJS)
$(O)makedefs.o: $(CONFIG_H) $(INCL)\monattk.h $(INCL)\monflag.h $(INCL)\objclass.h \
$(INCL)\monsym.h $(INCL)\patchlevel.h \
$(U)makedefs.c
if not exist $(OBJ)\*.* echo creating directory $(OBJ)
if not exist $(OBJ)\*.* mkdir $(OBJ)
$(CC) $(CFLAGSU) -Fo$@ $(U)makedefs.c
#
# date.h should be remade every time any of the source or include
# files is modified.
#
$(INCL)\date.h $(OPTIONS_FILE) : $(U)makedefs.exe
$(U)makedefs -v
$(INCL)\onames.h : $(U)makedefs.exe
$(U)makedefs -o
$(INCL)\pm.h : $(U)makedefs.exe
$(U)makedefs -p
#$(INCL)\trap.h : $(U)makedefs.exe
# $(U)makedefs -t
$(SRC)\monstr.c: $(U)makedefs.exe
$(U)makedefs -m
$(INCL)\vis_tab.h: $(U)makedefs.exe
$(U)makedefs -z
$(SRC)\vis_tab.c: $(U)makedefs.exe
$(U)makedefs -z
#==========================================
# uudecode utility and uuencoded targets
#==========================================
$(U)uudecode.exe: $(O)uudecode.o
$(link) $(LFLAGSU) -out:$@ $(O)uudecode.o
$(O)uudecode.o: $(SSYS)\uudecode.c
$(SWINCE)\NetHack.ico : $(U)uudecode.exe $(SWINCE)\nhico.uu
chdir $(SWINCE)
..\util\uudecode.exe nhico.uu
chdir $(WINCE)
$(SWINCE)\mnsel.bmp: $(U)uudecode.exe $(SWINCE)\mnsel.uu
chdir $(SWINCE)
..\util\uudecode.exe mnsel.uu
chdir $(WINCE)
$(SWINCE)\mnselcnt.bmp: $(U)uudecode.exe $(SWINCE)\mnselcnt.uu
chdir $(SWINCE)
..\util\uudecode.exe mnselcnt.uu
chdir $(WINCE)
$(SWINCE)\mnunsel.bmp: $(U)uudecode.exe $(SWINCE)\mnunsel.uu
chdir $(SWINCE)
..\util\uudecode.exe mnunsel.uu
chdir $(WINCE)
$(SWINCE)\petmark.bmp: $(U)uudecode.exe $(SWINCE)\petmark.uu
chdir $(SWINCE)
..\util\uudecode.exe petmark.uu
chdir $(WINCE)
$(SWINCE)\rip.bmp: $(U)uudecode.exe $(SWINCE)\rip.uu
chdir $(SWINCE)
..\util\uudecode.exe rip.uu
chdir $(WINCE)
$(SWINCE)\splash.bmp: $(U)uudecode.exe $(SWINCE)\splash.uu
chdir $(SWINCE)
..\util\uudecode.exe splash.uu
chdir $(WINCE)
$(SWINCE)\keypad.bmp: $(U)uudecode.exe $(SWINCE)\keypad.uu
chdir $(SWINCE)
..\util\uudecode.exe keypad.uu
chdir $(WINCE)
$(SWINCE)\menubar.bmp: $(U)uudecode.exe $(SWINCE)\menubar.uu
chdir $(SWINCE)
..\util\uudecode.exe menubar.uu
chdir $(WINCE)
#==========================================
# Level Compiler Stuff
#==========================================
$(U)lev_comp.exe: $(SPLEVOBJS)
echo Linking $@...
$(link) $(LFLAGSU) -out:$@ @<<$(@B).lnk
$(SPLEVOBJS:^ =^
)
<<
$(O)lev_yacc.o: $(HACK_H) $(SP_LEV_H) $(INCL)\lev_comp.h $(U)lev_yacc.c
$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)lev_yacc.c
$(O)lev_$(LEX).o: $(HACK_H) $(INCL)\lev_comp.h $(SP_LEV_H) \
$(U)lev_$(LEX).c
$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)lev_$(LEX).c
$(O)lev_main.o: $(U)lev_main.c $(HACK_H) $(SP_LEV_H)
$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)lev_main.c
$(U)lev_yacc.c $(INCL)\lev_comp.h : $(U)lev_comp.y
@echo We will copy the prebuilt lev_yacc.c and
@echo lev_comp.h from $(SSYS) into $(UTIL) and use them.
@copy $(SSYS)\lev_yacc.c $(U)lev_yacc.c >nul
@copy $(SSYS)\lev_comp.h $(INCL)\lev_comp.h >nul
@echo /**/ >>$(U)lev_yacc.c
@echo /**/ >>$(INCL)\lev_comp.h
$(U)lev_$(LEX).c: $(U)lev_comp.l
@echo We will copy the prebuilt lev_lex.c
@echo from $(SSYS) into $(UTIL) and use it.
@copy $(SSYS)\lev_lex.c $@ >nul
@echo /**/ >>$@
#==========================================
# Dungeon Compiler Stuff
#==========================================
$(U)dgn_comp.exe: $(DGNCOMPOBJS)
@echo Linking $@...
$(link) $(LFLAGSU) -out:$@ @<<$(@B).lnk
$(DGNCOMPOBJS:^ =^
)
<<
$(O)dgn_yacc.o: $(HACK_H) $(DGN_FILE_H) $(INCL)\dgn_comp.h $(U)dgn_yacc.c
$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)dgn_yacc.c
$(O)dgn_$(LEX).o: $(HACK_H) $(DGN_FILE_H) $(INCL)\dgn_comp.h \
$(U)dgn_$(LEX).c
$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)dgn_$(LEX).c
$(O)dgn_main.o: $(HACK_H) $(U)dgn_main.c
$(CC) $(LEVCFLAGS) -W0 -Fo$@ $(U)dgn_main.c
$(U)dgn_yacc.c $(INCL)\dgn_comp.h : $(U)dgn_comp.y
@echo We will copy the prebuilt $(U)dgn_yacc.c and
@echo dgn_comp.h from $(SSYS) into $(UTIL) and use them.
@copy $(SSYS)\dgn_yacc.c $(U)dgn_yacc.c >nul
@copy $(SSYS)\dgn_comp.h $(INCL)\dgn_comp.h >nul
@echo /**/ >>$(U)dgn_yacc.c
@echo /**/ >>$(INCL)\dgn_comp.h
$(U)dgn_$(LEX).c: $(U)dgn_comp.l
@echo We will copy the prebuilt dgn_lex.c
@echo from $(SSYS) into $(UTIL) and use it.
@copy $(SSYS)\dgn_lex.c $@ >nul
@echo /**/ >>$@
#==========================================
# Create directory for holding object files
#==========================================
$(O)obj.tag:
if not exist $(OBJ)\*.* echo creating directory $(OBJ)
if not exist $(OBJ)\*.* mkdir $(OBJ)
echo directory created >$@
#==========================================
# Notify of any CL environment variables
# in effect since they change the compiler
# options.
#==========================================
envchk:
! IF "$(CL)"!=""
@echo Warning, the CL Environment variable is defined:
@echo CL=$(CL)
! ENDIF
@echo ----
@echo NOTE: This build will include tile support.
@echo ----
#==========================================
#=========== SECONDARY TARGETS ============
#==========================================
#===========================================
# Header files NOT distributed in ..\include
#===========================================
$(INCL)\win32api.h: $(NTSYS)\win32api.h
copy $(NTSYS)\win32api.h $@
#==========================================
# DLB utility and nhdat file creation
#==========================================
$(U)dlb_main.exe: $(DLBOBJ) $(O)dlb.o
$(link) $(LFLAGSU) -out:$@ @<<$(@B).lnk
$(O)dlb_main.o
$(O)dlb.o
$(O)alloc.o
$(O)panic.o
<<
$(O)dlb.o: $(O)dlb_main.o $(O)alloc.o $(O)panic.o $(INCL)\dlb.h
$(CC) $(CFLAGSU) /Fo$@ $(SRC)\dlb.c
$(O)dlb_main.o: $(UTIL)\dlb_main.c $(INCL)\config.h $(INCL)\dlb.h
$(CC) $(CFLAGSU) /Fo$@ $(UTIL)\dlb_main.c
#$(DAT)\porthelp: $(NTSYS)\porthelp
# copy $(NTSYS)\porthelp $@ >nul
$(DAT)\nhdat: $(U)dlb_main.exe $(DAT)\data $(DAT)\oracles $(OPTIONS_FILE) \
$(DAT)\quest.dat $(DAT)\rumors $(DAT)\help $(DAT)\hh $(DAT)\cmdhelp \
$(DAT)\history $(DAT)\opthelp $(DAT)\wizhelp $(DAT)\dungeon \
$(DAT)\license $(O)sp_lev.tag
cd $(DAT)
echo data >dlb.lst
echo oracles >>dlb.lst
if exist options echo options >>dlb.lst
if exist ttyoptions echo ttyoptions >>dlb.lst
if exist guioptions echo guioptions >>dlb.lst
if exist porthelp echo porthelp >>dlb.lst
echo quest.dat >>dlb.lst
echo rumors >>dlb.lst
echo help >>dlb.lst
echo hh >>dlb.lst
echo cmdhelp >>dlb.lst
echo history >>dlb.lst
echo opthelp >>dlb.lst
echo wizhelp >>dlb.lst
echo dungeon >>dlb.lst
echo license >>dlb.lst
for %%N in (*.lev) do echo %%N >>dlb.lst
$(U)dlb_main cIf dlb.lst nhdat
cd $(WINCE)
#==========================================
# Tile Mapping
#==========================================
$(SRC)\tile.c: $(U)tilemap.exe
echo A new $@ has been created
$(U)tilemap
$(U)tilemap.exe: $(O)tilemap.o
$(link) $(LFLAGSU) -out:$@ $(O)tilemap.o
$(O)tilemap.o: $(WSHR)\tilemap.c $(HACK_H)
$(CC) $(CFLAGSU) -Fo$@ $(WSHR)\tilemap.c
$(O)tiletx32.o: $(WSHR)\tilemap.c $(HACK_H)
$(CC) $(CFLAGSU) /DTILETEXT /DTILE_X=32 /DTILE_Y=32 -Fo$@ $(WSHR)\tilemap.c
$(O)tiletxt.o: $(WSHR)\tilemap.c $(HACK_H)
$(CC) $(CFLAGSU) /DTILETEXT -Fo$@ $(WSHR)\tilemap.c
$(O)gifread.o: $(WSHR)\gifread.c $(CONFIG_H) $(TILE_H)
$(CC) $(CFLAGSU) -I$(WSHR) -Fo$@ $(WSHR)\gifread.c
$(O)gifrd32.o: $(WSHR)\gifread.c $(CONFIG_H) $(TILE_H)
$(CC) $(CFLAGSU) -I$(WSHR) /DTILE_X=32 /DTILE_Y=32 -Fo$@ $(WSHR)\gifread.c
$(O)ppmwrite.o: $(WSHR)\ppmwrite.c $(CONFIG_H) $(TILE_H)
$(CC) $(CFLAGSU) -I$(WSHR) -Fo$@ $(WSHR)\ppmwrite.c
$(O)tiletext.o: $(WSHR)\tiletext.c $(CONFIG_H) $(TILE_H)
$(CC) $(CFLAGSU) -I$(WSHR) -Fo$@ $(WSHR)\tiletext.c
$(O)tilete32.o: $(WSHR)\tiletext.c $(CONFIG_H) $(TILE_H)
$(CC) $(CFLAGSU) -I$(WSHR) /DTILE_X=32 /DTILE_Y=32 -Fo$@ $(WSHR)\tiletext.c
$(SWINCE)\tiles.bmp: $(U)tile2bmp.exe $(TILEFILES)
echo Creating 16x16 binary tile files (this may take some time)
$(U)tile2bmp $@
#$(TILEBMP32): $(TILEUTIL32) $(TILEFILES32)
# echo Creating 32x32 binary tile files (this may take some time)
# $(U)til2bm32 $(TILEBMP32)
$(U)tile2bmp.exe: $(O)tile2bmp.o $(TEXT_IO)
@echo Linking $@...
$(link) $(LFLAGSU) -out:$@ @<<$(@B).lnk
$(O)tile2bmp.o
$(TEXT_IO:^ =^
)
<<
$(U)til2bm32.exe: $(O)til2bm32.o $(TEXT_IO32)
@echo Linking $@...
$(link) $(LFLAGSU) -out:$@ @<<$(@B).lnk
$(O)til2bm32.o
$(TEXT_IO32:^ =^
)
<<
$(O)tile2bmp.o: $(WSHR)\tile2bmp.c $(HACK_H) $(TILE_H) $(INCL)\win32api.h
$(CC) $(CFLAGSU) -I$(WSHR) /DPACKED_FILE /Fo$@ $(WSHR)\tile2bmp.c
$(O)til2bm32.o: $(WSHR)\tile2bmp.c $(HACK_H) $(TILE_H) $(INCL)\win32api.h
$(CC) $(CFLAGSU) -I$(WSHR) /DPACKED_FILE /DTILE_X=32 /DTILE_Y=32 /Fo$@ $(WSHR)\tile2bmp.c
#===================================================================
# OTHER DEPENDENCIES
#===================================================================
#
# dat dependencies
#
$(DAT)\data: $(UTIL)\makedefs.exe
$(U)makedefs -d
$(DAT)\rumors: $(UTIL)\makedefs.exe $(DAT)\rumors.tru $(DAT)\rumors.fal
$(U)makedefs -r
$(DAT)\quest.dat: $(UTIL)\makedefs.exe $(DAT)\quest.txt
$(U)makedefs -q
$(DAT)\oracles: $(UTIL)\makedefs.exe $(DAT)\oracles.txt
$(U)makedefs -h
$(DAT)\dungeon: $(UTIL)\makedefs.exe $(DAT)\dungeon.def
$(U)makedefs -e
cd $(DAT)
$(U)dgn_comp dungeon.pdf
cd $(WINCE)
#
# NT dependencies
#
#
#$(O)nttty.o: $(HACK_H) $(TILE_H) $(INCL)\win32api.h $(NTSYS)\nttty.c
# $(CC) $(CFLAGSU) -I$(WSHR) -Fo$@ $(NTSYS)\nttty.c
#$(O)winnt.o: $(HACK_H) $(INCL)\win32api.h $(NTSYS)\winnt.c
# $(CC) $(CFLAGSU) -Fo$@ $(NTSYS)\winnt.c
#$(O)ntsound.o: $(HACK_H) $(NTSYS)\ntsound.c
# $(CC) $(CFLAGSU) -Fo$@ $(NTSYS)\ntsound.c
#
# util dependencies
#
$(O)panic.o: $(U)panic.c $(CONFIG_H)
$(CC) $(CFLAGSU) -Fo$@ $(U)panic.c
#
# The rest are stolen from sys/unix/Makefile.src,
# with slashes changed to back-slashes
# and -c (which is included in CFLAGSU) substituted
# with -Fo$@ , but otherwise untouched. That
# means that there is some irrelevant stuff
# in here, but maintenance should be easier.
#
$(O)tos.o: ..\sys\atari\tos.c $(HACK_H) $(INCL)\tcap.h
$(CC) $(CFLAGSU) -Fo$@ ..\sys\atari\tos.c
$(O)pcmain.o: ..\sys\share\pcmain.c $(HACK_H) $(INCL)\dlb.h \
$(INCL)\win32api.h
$(CC) $(CFLAGSU) -Fo$@ ..\sys\share\pcmain.c
$(O)pcsys.o: ..\sys\share\pcsys.c $(HACK_H)
$(CC) $(CFLAGSU) -Fo$@ ..\sys\share\pcsys.c
$(O)pctty.o: ..\sys\share\pctty.c $(HACK_H)
$(CC) $(CFLAGSU) -Fo$@ ..\sys\share\pctty.c
$(O)pcunix.o: ..\sys\share\pcunix.c $(HACK_H)
$(CC) $(CFLAGSU) -Fo$@ ..\sys\share\pcunix.c
$(O)random.o: ..\sys\share\random.c $(HACK_H)
$(CC) $(CFLAGSU) -Fo$@ ..\sys\share\random.c
$(O)ioctl.o: ..\sys\share\ioctl.c $(HACK_H) $(INCL)\tcap.h
$(CC) $(CFLAGSU) -Fo$@ ..\sys\share\ioctl.c
$(O)unixtty.o: ..\sys\share\unixtty.c $(HACK_H)
$(CC) $(CFLAGSU) -Fo$@ ..\sys\share\unixtty.c
$(O)unixmain.o: ..\sys\unix\unixmain.c $(HACK_H) $(INCL)\dlb.h
$(CC) $(CFLAGSU) -Fo$@ ..\sys\unix\unixmain.c
$(O)unixunix.o: ..\sys\unix\unixunix.c $(HACK_H)
$(CC) $(CFLAGSU) -Fo$@ ..\sys\unix\unixunix.c
$(O)bemain.o: ..\sys\be\bemain.c $(HACK_H) $(INCL)\dlb.h
$(CC) $(CFLAGSU) -Fo$@ ..\sys\be\bemain.c
$(O)getline.o: ..\win\tty\getline.c $(HACK_H) $(INCL)\func_tab.h
$(CC) $(CFLAGSU) -Fo$@ ..\win\tty\getline.c
$(O)termcap.o: ..\win\tty\termcap.c $(HACK_H) $(INCL)\tcap.h
$(CC) $(CFLAGSU) -Fo$@ ..\win\tty\termcap.c
$(O)topl.o: ..\win\tty\topl.c $(HACK_H) $(INCL)\tcap.h
$(CC) $(CFLAGSU) -Fo$@ ..\win\tty\topl.c
$(O)wintty.o: ..\win\tty\wintty.c $(HACK_H) $(INCL)\dlb.h \
$(INCL)\date.h $(INCL)\patchlevel.h $(INCL)\tcap.h
$(CC) $(CFLAGSU) -Fo$@ ..\win\tty\wintty.c
$(O)Window.o: ..\win\X11\Window.c $(INCL)\xwindowp.h $(INCL)\xwindow.h \
$(CONFIG_H)
$(CC) $(CFLAGSU) -Fo$@ ..\win\X11\Window.c
$(O)dialogs.o: ..\win\X11\dialogs.c $(CONFIG_H)
$(CC) $(CFLAGSU) -Fo$@ ..\win\X11\dialogs.c
$(O)winX.o: ..\win\X11\winX.c $(HACK_H) $(INCL)\winX.h $(INCL)\dlb.h \
$(INCL)\patchlevel.h ..\win\X11\nh72icon \
..\win\X11\nh56icon ..\win\X11\nh32icon
$(CC) $(CFLAGSU) -Fo$@ ..\win\X11\winX.c
$(O)winmap.o: ..\win\X11\winmap.c $(INCL)\xwindow.h $(HACK_H) $(INCL)\dlb.h \
$(INCL)\winX.h $(INCL)\tile2x11.h
$(CC) $(CFLAGSU) -Fo$@ ..\win\X11\winmap.c
$(O)winmenu.o: ..\win\X11\winmenu.c $(HACK_H) $(INCL)\winX.h
$(CC) $(CFLAGSU) -Fo$@ ..\win\X11\winmenu.c
$(O)winmesg.o: ..\win\X11\winmesg.c $(INCL)\xwindow.h $(HACK_H) $(INCL)\winX.h
$(CC) $(CFLAGSU) -Fo$@ ..\win\X11\winmesg.c
$(O)winmisc.o: ..\win\X11\winmisc.c $(HACK_H) $(INCL)\func_tab.h \
$(INCL)\winX.h
$(CC) $(CFLAGSU) -Fo$@ ..\win\X11\winmisc.c
$(O)winstat.o: ..\win\X11\winstat.c $(HACK_H) $(INCL)\winX.h
$(CC) $(CFLAGSU) -Fo$@ ..\win\X11\winstat.c
$(O)wintext.o: ..\win\X11\wintext.c $(HACK_H) $(INCL)\winX.h $(INCL)\xwindow.h
$(CC) $(CFLAGSU) -Fo$@ ..\win\X11\wintext.c
$(O)winval.o: ..\win\X11\winval.c $(HACK_H) $(INCL)\winX.h
$(CC) $(CFLAGSU) -Fo$@ ..\win\X11\winval.c
$(O)tile.o: $(SRC)\tile.c $(HACK_H)
$(O)gnaskstr.o: ..\win\gnome\gnaskstr.c ..\win\gnome\gnaskstr.h \
..\win\gnome\gnmain.h
$(CC) $(CFLAGSU) $(GNOMEINC) -c ..\win\gnome\gnaskstr.c
$(O)gnbind.o: ..\win\gnome\gnbind.c ..\win\gnome\gnbind.h ..\win\gnome\gnmain.h \
..\win\gnome\gnaskstr.h ..\win\gnome\gnyesno.h
$(CC) $(CFLAGSU) $(GNOMEINC) -c ..\win\gnome\gnbind.c
$(O)gnglyph.o: ..\win\gnome\gnglyph.c ..\win\gnome\gnglyph.h
$(CC) $(CFLAGSU) $(GNOMEINC) -c ..\win\gnome\gnglyph.c
$(O)gnmain.o: ..\win\gnome\gnmain.c ..\win\gnome\gnmain.h ..\win\gnome\gnsignal.h \
..\win\gnome\gnbind.h ..\win\gnome\gnopts.h $(HACK_H) \
$(INCL)\date.h
$(CC) $(CFLAGSU) $(GNOMEINC) -c ..\win\gnome\gnmain.c
$(O)gnmap.o: ..\win\gnome\gnmap.c ..\win\gnome\gnmap.h ..\win\gnome\gnglyph.h \
..\win\gnome\gnsignal.h $(HACK_H)
$(CC) $(CFLAGSU) $(GNOMEINC) -c ..\win\gnome\gnmap.c
$(O)gnmenu.o: ..\win\gnome\gnmenu.c ..\win\gnome\gnmenu.h ..\win\gnome\gnmain.h \
..\win\gnome\gnbind.h
$(CC) $(CFLAGSU) $(GNOMEINC) -c ..\win\gnome\gnmenu.c
$(O)gnmesg.o: ..\win\gnome\gnmesg.c ..\win\gnome\gnmesg.h ..\win\gnome\gnsignal.h
$(CC) $(CFLAGSU) $(GNOMEINC) -c ..\win\gnome\gnmesg.c
$(O)gnopts.o: ..\win\gnome\gnopts.c ..\win\gnome\gnopts.h ..\win\gnome\gnglyph.h \
..\win\gnome\gnmain.h ..\win\gnome\gnmap.h $(HACK_H)
$(CC) $(CFLAGSU) $(GNOMEINC) -c ..\win\gnome\gnopts.c
$(O)gnplayer.o: ..\win\gnome\gnplayer.c ..\win\gnome\gnplayer.h \
..\win\gnome\gnmain.h $(HACK_H)
$(CC) $(CFLAGSU) $(GNOMEINC) -c ..\win\gnome\gnplayer.c
$(O)gnsignal.o: ..\win\gnome\gnsignal.c ..\win\gnome\gnsignal.h \
..\win\gnome\gnmain.h
$(CC) $(CFLAGSU) $(GNOMEINC) -c ..\win\gnome\gnsignal.c
$(O)gnstatus.o: ..\win\gnome\gnstatus.c ..\win\gnome\gnstatus.h \
..\win\gnome\gnsignal.h ..\win\gnome\gn_xpms.h \
..\win\gnome\gnomeprv.h
$(CC) $(CFLAGSU) $(GNOMEINC) -c ..\win\gnome\gnstatus.c
$(O)gntext.o: ..\win\gnome\gntext.c ..\win\gnome\gntext.h ..\win\gnome\gnmain.h \
..\win\gnome\gn_rip.h
$(CC) $(CFLAGSU) $(GNOMEINC) -c ..\win\gnome\gntext.c
$(O)gnyesno.o: ..\win\gnome\gnyesno.c ..\win\gnome\gnbind.h ..\win\gnome\gnyesno.h
$(CC) $(CFLAGSU) $(GNOMEINC) -c ..\win\gnome\gnyesno.c
$(O)wingem.o: ..\win\gem\wingem.c $(HACK_H) $(INCL)\func_tab.h $(INCL)\dlb.h \
$(INCL)\patchlevel.h $(INCL)\wingem.h
$(CC) $(CFLAGSU) -Fo$@ ..\win\gem\wingem.c
$(O)wingem1.o: ..\win\gem\wingem1.c $(INCL)\gem_rsc.h $(INCL)\load_img.h \
$(INCL)\wintype.h $(INCL)\wingem.h
$(CC) $(CFLAGSU) -Fo$@ ..\win\gem\wingem1.c
$(O)load_img.o: ..\win\gem\load_img.c $(INCL)\load_img.h
$(CC) $(CFLAGSU) -Fo$@ ..\win\gem\load_img.c
$(O)tile.o: $(SRC)\tile.c $(HACK_H)
$(O)qt_win.o: ..\win\Qt\qt_win.cpp $(HACK_H) $(INCL)\func_tab.h \
$(INCL)\dlb.h $(INCL)\patchlevel.h $(INCL)\qt_win.h \
$(INCL)\qt_clust.h $(INCL)\qt_kde0.h \
$(INCL)\qt_xpms.h qt_win.moc qt_kde0.moc
$(CXX) $(CXXFLAGS) -c ..\win\Qt\qt_win.cpp
$(O)qt_clust.o: ..\win\Qt\qt_clust.cpp $(INCL)\qt_clust.h
$(CXX) $(CXXFLAGS) -c ..\win\Qt\qt_clust.cpp
$(O)monstr.o: $(SRC)\monstr.c $(CONFIG_H)
$(O)vis_tab.o: $(SRC)\vis_tab.c $(CONFIG_H) $(INCL)\vis_tab.h
$(O)allmain.o: $(SRC)\allmain.c $(HACK_H)
$(O)alloc.o: $(SRC)\alloc.c $(CONFIG_H)
$(O)apply.o: $(SRC)\apply.c $(HACK_H)
$(O)artifact.o: $(SRC)\artifact.c $(HACK_H) $(INCL)\artifact.h $(INCL)\artilist.h
$(O)attrib.o: $(SRC)\attrib.c $(HACK_H) $(INCL)\artifact.h
$(O)ball.o: $(SRC)\ball.c $(HACK_H)
$(O)bones.o: $(SRC)\bones.c $(HACK_H)
$(O)botl.o: $(SRC)\botl.c $(HACK_H)
$(O)cmd.o: $(SRC)\cmd.c $(HACK_H) $(INCL)\func_tab.h
$(O)dbridge.o: $(SRC)\dbridge.c $(HACK_H)
$(O)decl.o: $(SRC)\decl.c $(HACK_H)
$(O)detect.o: $(SRC)\detect.c $(HACK_H) $(INCL)\artifact.h
$(O)dig.o: $(SRC)\dig.c $(HACK_H)
$(O)display.o: $(SRC)\display.c $(HACK_H)
$(O)dlb.o: $(SRC)\dlb.c $(CONFIG_H) $(INCL)\dlb.h
$(O)do.o: $(SRC)\do.c $(HACK_H)
$(O)do_name.o: $(SRC)\do_name.c $(HACK_H)
$(O)do_wear.o: $(SRC)\do_wear.c $(HACK_H)
$(O)dog.o: $(SRC)\dog.c $(HACK_H)
$(O)dogmove.o: $(SRC)\dogmove.c $(HACK_H) $(INCL)\mfndpos.h
$(O)dokick.o: $(SRC)\dokick.c $(HACK_H)
$(O)dothrow.o: $(SRC)\dothrow.c $(HACK_H)
$(O)drawing.o: $(SRC)\drawing.c $(HACK_H) $(INCL)\tcap.h
$(O)dungeon.o: $(SRC)\dungeon.c $(HACK_H) $(INCL)\dgn_file.h $(INCL)\dlb.h
$(O)eat.o: $(SRC)\eat.c $(HACK_H)
$(O)end.o: $(SRC)\end.c $(HACK_H) $(INCL)\dlb.h
$(O)engrave.o: $(SRC)\engrave.c $(HACK_H)
$(O)exper.o: $(SRC)\exper.c $(HACK_H)
$(O)explode.o: $(SRC)\explode.c $(HACK_H)
$(O)extralev.o: $(SRC)\extralev.c $(HACK_H)
$(O)files.o: $(SRC)\files.c $(HACK_H) $(INCL)\dlb.h
$(O)fountain.o: $(SRC)\fountain.c $(HACK_H)
$(O)hack.o: $(SRC)\hack.c $(HACK_H)
$(O)hacklib.o: $(SRC)\hacklib.c $(HACK_H)
$(O)invent.o: $(SRC)\invent.c $(HACK_H) $(INCL)\artifact.h
$(O)light.o: $(SRC)\light.c $(HACK_H)
$(O)lock.o: $(SRC)\lock.c $(HACK_H)
$(O)mail.o: $(SRC)\mail.c $(HACK_H) $(INCL)\mail.h
$(O)makemon.o: $(SRC)\makemon.c $(HACK_H)
$(O)mapglyph.o: $(SRC)\mapglyph.c $(HACK_H)
$(O)mcastu.o: $(SRC)\mcastu.c $(HACK_H)
$(O)mhitm.o: $(SRC)\mhitm.c $(HACK_H) $(INCL)\artifact.h
$(O)mhitu.o: $(SRC)\mhitu.c $(HACK_H) $(INCL)\artifact.h
$(O)minion.o: $(SRC)\minion.c $(HACK_H)
$(O)mklev.o: $(SRC)\mklev.c $(HACK_H)
$(O)mkmap.o: $(SRC)\mkmap.c $(HACK_H) $(INCL)\sp_lev.h
$(O)mkmaze.o: $(SRC)\mkmaze.c $(HACK_H) $(INCL)\sp_lev.h
$(O)mkobj.o: $(SRC)\mkobj.c $(HACK_H) $(INCL)\artifact.h
$(O)mkroom.o: $(SRC)\mkroom.c $(HACK_H)
$(O)mon.o: $(SRC)\mon.c $(HACK_H) $(INCL)\mfndpos.h
$(O)mondata.o: $(SRC)\mondata.c $(HACK_H)
$(O)monmove.o: $(SRC)\monmove.c $(HACK_H) $(INCL)\mfndpos.h $(INCL)\artifact.h
$(O)monst.o: $(SRC)\monst.c $(CONFIG_H) $(INCL)\permonst.h $(INCL)\align.h \
$(INCL)\monattk.h $(INCL)\monflag.h $(INCL)\monsym.h \
$(INCL)\dungeon.h $(INCL)\color.h
$(O)mplayer.o: $(SRC)\mplayer.c $(HACK_H)
$(O)mthrowu.o: $(SRC)\mthrowu.c $(HACK_H)
$(O)muse.o: $(SRC)\muse.c $(HACK_H)
$(O)music.o: $(SRC)\music.c $(HACK_H) #interp.c
$(O)o_init.o: $(SRC)\o_init.c $(HACK_H)
$(O)objects.o: $(SRC)\objects.c $(CONFIG_H) $(INCL)\obj.h $(INCL)\objclass.h \
$(INCL)\prop.h $(INCL)\skills.h $(INCL)\color.h
$(O)objnam.o: $(SRC)\objnam.c $(HACK_H)
$(O)options.o: $(SRC)\options.c $(CONFIG_H) $(INCL)\objclass.h $(INCL)\flag.h \
$(HACK_H) $(INCL)\tcap.h
$(O)pager.o: $(SRC)\pager.c $(HACK_H) $(INCL)\dlb.h
$(O)pickup.o: $(SRC)\pickup.c $(HACK_H)
$(O)pline.o: $(SRC)\pline.c $(HACK_H)
$(O)polyself.o: $(SRC)\polyself.c $(HACK_H)
$(O)potion.o: $(SRC)\potion.c $(HACK_H)
$(O)pray.o: $(SRC)\pray.c $(HACK_H)
$(O)priest.o: $(SRC)\priest.c $(HACK_H) $(INCL)\mfndpos.h
$(O)quest.o: $(SRC)\quest.c $(HACK_H)
$(O)questpgr.o: $(SRC)\questpgr.c $(HACK_H) $(INCL)\dlb.h
$(O)read.o: $(SRC)\read.c $(HACK_H)
$(O)rect.o: $(SRC)\rect.c $(HACK_H)
$(O)region.o: $(SRC)\region.c $(HACK_H)
$(O)restore.o: $(SRC)\restore.c $(HACK_H) $(INCL)\tcap.h
$(O)rip.o: $(SRC)\rip.c $(HACK_H)
$(O)rnd.o: $(SRC)\rnd.c $(HACK_H)
$(O)role.o: $(SRC)\role.c $(HACK_H)
$(O)rumors.o: $(SRC)\rumors.c $(HACK_H) $(INCL)\dlb.h
$(O)save.o: $(SRC)\save.c $(HACK_H)
$(O)shk.o: $(SRC)\shk.c $(HACK_H)
$(O)shknam.o: $(SRC)\shknam.c $(HACK_H)
$(O)sit.o: $(SRC)\sit.c $(HACK_H) $(INCL)\artifact.h
$(O)sounds.o: $(SRC)\sounds.c $(HACK_H)
$(O)sp_lev.o: $(SRC)\sp_lev.c $(HACK_H) $(INCL)\dlb.h $(INCL)\sp_lev.h
$(O)spell.o: $(SRC)\spell.c $(HACK_H)
$(O)steal.o: $(SRC)\steal.c $(HACK_H)
$(O)steed.o: $(SRC)\steed.c $(HACK_H)
$(O)teleport.o: $(SRC)\teleport.c $(HACK_H)
$(O)timeout.o: $(SRC)\timeout.c $(HACK_H)
$(O)topten.o: $(SRC)\topten.c $(HACK_H) $(INCL)\dlb.h $(INCL)\patchlevel.h
$(O)track.o: $(SRC)\track.c $(HACK_H)
$(O)trap.o: $(SRC)\trap.c $(HACK_H)
$(O)u_init.o: $(SRC)\u_init.c $(HACK_H)
$(O)uhitm.o: $(SRC)\uhitm.c $(HACK_H)
$(O)vault.o: $(SRC)\vault.c $(HACK_H)
$(O)version.o: $(SRC)\version.c $(HACK_H) $(INCL)\date.h $(INCL)\patchlevel.h
$(O)vision.o: $(SRC)\vision.c $(HACK_H) $(INCL)\vis_tab.h
$(O)weapon.o: $(SRC)\weapon.c $(HACK_H)
$(O)were.o: $(SRC)\were.c $(HACK_H)
$(O)wield.o: $(SRC)\wield.c $(HACK_H)
$(O)windows.o: $(SRC)\windows.c $(HACK_H) $(INCL)\wingem.h $(INCL)\winGnome.h
$(O)wizard.o: $(SRC)\wizard.c $(HACK_H)
$(O)worm.o: $(SRC)\worm.c $(HACK_H)
$(O)worn.o: $(SRC)\worn.c $(HACK_H)
$(O)write.o: $(SRC)\write.c $(HACK_H)
$(O)zap.o: $(SRC)\zap.c $(HACK_H)
# end of file

View File

@@ -0,0 +1 @@
* NH_filestag=(header_file%s_for_Windows_CE_and_PocketPC_-_untested_for_3.7)

View File

@@ -0,0 +1,17 @@
/***
*assert.h - define the assert macro
*
****/
#undef assert
#ifdef NDEBUG
#define assert(exp) ((void) 0)
#else
#define assert(exp) \
(void)((exp) || (panic("%s at %s line %ld", #exp, __FILE__, __LINE__), 1))
#endif /* NDEBUG */

View File

@@ -0,0 +1,3 @@
/* empty file */
extern int errno;

View File

@@ -0,0 +1,67 @@
/***
*fcntl.h - file control options used by open()
*
*Purpose:
* This file defines constants for the file control options used
* by the _open() function.
* [System V]
*
* [Public]
*
****/
#ifndef _INC_FCNTL
#define _INC_FCNTL
#define _O_RDONLY 0x0000 /* open for reading only */
#define _O_WRONLY 0x0001 /* open for writing only */
#define _O_RDWR 0x0002 /* open for reading and writing */
#define _O_APPEND 0x0008 /* writes done at eof */
#define _O_CREAT 0x0100 /* create and open file */
#define _O_TRUNC 0x0200 /* open and truncate */
#define _O_EXCL 0x0400 /* open only if file doesn't already exist */
/* O_TEXT files have <cr><lf> sequences translated to <lf> on read()'s,
** and <lf> sequences translated to <cr><lf> on write()'s
*/
#define _O_TEXT 0x4000 /* file mode is text (translated) */
#define _O_BINARY 0x8000 /* file mode is binary (untranslated) */
/* macro to translate the C 2.0 name used to force binary mode for files */
#define _O_RAW _O_BINARY
/* Open handle inherit bit */
#define _O_NOINHERIT 0x0080 /* child process doesn't inherit file */
/* Temporary file bit - file is deleted when last handle is closed */
#define _O_TEMPORARY 0x0040 /* temporary file bit */
/* sequential/random access hints */
#define _O_SEQUENTIAL 0x0020 /* file access is primarily sequential */
#define _O_RANDOM 0x0010 /* file access is primarily random */
#if !__STDC__ || defined(_POSIX_)
/* Non-ANSI names for compatibility */
#define O_RDONLY _O_RDONLY
#define O_WRONLY _O_WRONLY
#define O_RDWR _O_RDWR
#define O_APPEND _O_APPEND
#define O_CREAT _O_CREAT
#define O_TRUNC _O_TRUNC
#define O_EXCL _O_EXCL
#define O_TEXT _O_TEXT
#define O_BINARY _O_BINARY
#define O_RAW _O_BINARY
#define O_TEMPORARY _O_TEMPORARY
#define O_NOINHERIT _O_NOINHERIT
#define O_SEQUENTIAL _O_SEQUENTIAL
#define O_RANDOM _O_RANDOM
#endif /* __STDC__ */
#endif /* _INC_FCNTL */

View File

@@ -0,0 +1 @@
* NH_filestag=(sys/stat.h_for_Windows_CE_and_PocketPC_-_untested_for_3.6.2)

View File

@@ -0,0 +1 @@
/* empty file */

906
outdated/sys/wince/celib.c Normal file
View File

@@ -0,0 +1,906 @@
/* NetHack 3.6 celib.c $NHDT-Date: 1432512803 2015/05/25 00:13:23 $ $NHDT-Branch: master $:$NHDT-Revision: 1.10 $ */
/* Copyright (C) 2001 by Alex Kompel */
/* NetHack may be freely redistributed. See license for details. */
#define NEED_VARARGS
#include "hack.h"
#include <fcntl.h>
// #include "wceconf.h"
static union {
time_t t_val;
struct time_pack {
unsigned int ss : 6;
unsigned int mm : 6;
unsigned int dd : 5;
unsigned int hh : 6;
unsigned int mo : 4;
unsigned int yr : 10;
unsigned int wd : 3;
} tm_val;
} _t_cnv;
#define IS_LEAP(yr) (((yr) % 4 == 0 || (yr) % 100 == 0) && !(yr) % 400 == 0)
static char _day_mo_leap[12] = { 31, 29, 31, 30, 31, 30,
31, 31, 30, 31, 30, 31 };
static char _day_mo[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
struct tm *__cdecl localtime(const time_t *ptime)
{
static struct tm ptm;
int i;
if (!ptime)
return NULL;
_t_cnv.t_val = *ptime;
ptm.tm_sec = _t_cnv.tm_val.ss; /* seconds after the minute - [0,59] */
ptm.tm_min = _t_cnv.tm_val.mm; /* minutes after the hour - [0,59] */
ptm.tm_hour = _t_cnv.tm_val.hh; /* hours since midnight - [0,23] */
ptm.tm_mday = _t_cnv.tm_val.dd; /* day of the month - [1,31] */
ptm.tm_mon = _t_cnv.tm_val.mo - 1; /* months since January - [0,11] */
ptm.tm_year = _t_cnv.tm_val.yr; /* years since 1900 */
ptm.tm_wday = _t_cnv.tm_val.wd; /* days since Sunday - [0,6] */
ptm.tm_yday = _t_cnv.tm_val.dd; /* days since January 1 - [0,365] */
for (i = 0; i < ptm.tm_mon; i++)
ptm.tm_yday +=
IS_LEAP(_t_cnv.tm_val.yr + 1900) ? _day_mo_leap[i] : _day_mo[i];
ptm.tm_isdst = 0; /* daylight savings time flag - NOT IMPLEMENTED */
return &ptm;
}
time_t __cdecl time(time_t *timeptr)
{
SYSTEMTIME stm;
GetLocalTime(&stm);
_t_cnv.tm_val.yr = stm.wYear - 1900;
_t_cnv.tm_val.mo = stm.wMonth;
_t_cnv.tm_val.dd = stm.wDay;
_t_cnv.tm_val.hh = stm.wHour;
_t_cnv.tm_val.mm = stm.wMinute;
_t_cnv.tm_val.ss = stm.wSecond;
_t_cnv.tm_val.wd = stm.wDayOfWeek;
if (timeptr)
*timeptr = _t_cnv.t_val;
return _t_cnv.t_val;
}
time_t __cdecl mktime(struct tm *tb)
{
if (!tb)
return (time_t) -1;
_t_cnv.tm_val.yr = tb->tm_year;
_t_cnv.tm_val.mo = tb->tm_mon;
_t_cnv.tm_val.dd = tb->tm_mday;
_t_cnv.tm_val.hh = tb->tm_hour;
_t_cnv.tm_val.mm = tb->tm_min;
_t_cnv.tm_val.ss = tb->tm_sec;
_t_cnv.tm_val.wd = tb->tm_wday;
return _t_cnv.t_val;
}
/*------------------------------------------------------------------------------*/
/* __io.h__ */
/* Hack io.h function with stdio.h functions */
/* ASSUMPTION : int can hold FILE* */
static TCHAR _nh_cwd[MAX_PATH];
const int MAGIC_OFFSET = 5;
#define FILE_TABLE_SIZE 256
static HANDLE _nh_file_table[FILE_TABLE_SIZE];
static int file_pointer = -1;
static HANDLE
get_file_handle(int i)
{
i -= MAGIC_OFFSET;
if (i >= 0 && i < FILE_TABLE_SIZE)
return _nh_file_table[i];
else
return INVALID_HANDLE_VALUE;
}
static int
alloc_file_handle(HANDLE h)
{
int i;
if (file_pointer == -1) {
file_pointer = 0;
for (i = 0; i < FILE_TABLE_SIZE; i++)
_nh_file_table[i] = INVALID_HANDLE_VALUE;
}
i = (file_pointer + 1) % FILE_TABLE_SIZE;
while (_nh_file_table[i] != INVALID_HANDLE_VALUE) {
if (i == file_pointer) {
MessageBox(NULL, _T("Ran out of file handles."),
_T("Fatal Error"), MB_OK);
abort();
}
i = (i + 1) % FILE_TABLE_SIZE;
}
file_pointer = i;
_nh_file_table[file_pointer] = h;
return file_pointer + MAGIC_OFFSET;
}
int __cdecl close(int f)
{
int retval;
f -= MAGIC_OFFSET;
if (f < 0 || f >= FILE_TABLE_SIZE)
return -1;
retval = (CloseHandle(_nh_file_table[f]) ? 0 : -1);
_nh_file_table[f] = INVALID_HANDLE_VALUE;
return retval;
}
int __cdecl creat(const char *fname, int mode)
{
HANDLE f;
TCHAR wbuf[MAX_PATH + 1];
ZeroMemory(wbuf, sizeof(wbuf));
NH_A2W(fname, wbuf, MAX_PATH);
f = CreateFile(wbuf, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL, NULL);
if (f == INVALID_HANDLE_VALUE)
return -1;
else
return alloc_file_handle(f);
}
int __cdecl eof(int f)
{
DWORD fpos, fsize;
HANDLE p = get_file_handle(f);
if (f == -1)
return -1;
fpos = SetFilePointer(p, 0, NULL, FILE_CURRENT);
fsize = SetFilePointer(p, 0, NULL, FILE_END);
if (fpos == 0xFFFFFFFF || fsize == 0xFFFFFFFF)
return -1;
if (fpos == fsize)
return 1;
else {
SetFilePointer(p, fpos, NULL, FILE_BEGIN);
return 0;
}
}
long __cdecl lseek(int f, long offset, int origin)
{
HANDLE p = get_file_handle(f);
DWORD fpos;
switch (origin) {
case SEEK_SET:
fpos = SetFilePointer(p, offset, NULL, FILE_BEGIN);
break;
case SEEK_CUR:
fpos = SetFilePointer(p, offset, NULL, FILE_CURRENT);
break;
case SEEK_END:
fpos = SetFilePointer(p, offset, NULL, FILE_END);
break;
default:
fpos = 0xFFFFFFFF;
break;
}
if (fpos == 0xFFFFFFFF)
return -1;
else
return (long) fpos;
}
int __cdecl open(const char *filename, int oflag, ...)
{
TCHAR fname[MAX_PATH + 1];
TCHAR path[MAX_PATH + 1];
HANDLE f;
DWORD fileaccess;
DWORD filecreate;
/* O_TEXT is not supported */
/*
* decode the access flags
*/
switch (oflag & (_O_RDONLY | _O_WRONLY | _O_RDWR)) {
case _O_RDONLY: /* read access */
fileaccess = GENERIC_READ;
break;
case _O_WRONLY: /* write access */
fileaccess = GENERIC_READ | GENERIC_WRITE;
break;
case _O_RDWR: /* read and write access */
fileaccess = GENERIC_READ | GENERIC_WRITE;
break;
default: /* error, bad oflag */
return -1;
}
/*
* decode open/create method flags
*/
switch (oflag & (_O_CREAT | _O_EXCL | _O_TRUNC)) {
case 0:
case _O_EXCL: // ignore EXCL w/o CREAT
filecreate = OPEN_EXISTING;
break;
case _O_CREAT:
filecreate = OPEN_ALWAYS;
break;
case _O_CREAT | _O_EXCL:
case _O_CREAT | _O_TRUNC | _O_EXCL:
filecreate = CREATE_NEW;
break;
case _O_TRUNC:
case _O_TRUNC | _O_EXCL: // ignore EXCL w/o CREAT
filecreate = TRUNCATE_EXISTING;
break;
case _O_CREAT | _O_TRUNC:
filecreate = CREATE_ALWAYS;
break;
default:
return -1;
}
/* assemple the file name */
ZeroMemory(fname, sizeof(fname));
ZeroMemory(path, sizeof(path));
NH_A2W(filename, fname, MAX_PATH);
if (*filename != '\\' && *filename != '/') {
_tcscpy(path, _nh_cwd);
_tcsncat(path, _T("\\"), MAX_PATH - _tcslen(path));
}
_tcsncat(path, fname, MAX_PATH - _tcslen(path));
/*
* try to open/create the file
*/
if ((f = CreateFile(path, fileaccess, 0, NULL, filecreate,
FILE_ATTRIBUTE_NORMAL, NULL))
== INVALID_HANDLE_VALUE) {
return -1;
}
if (!(oflag & O_APPEND))
SetFilePointer(f, 0, NULL, FILE_BEGIN);
return alloc_file_handle(f);
}
int __cdecl read(int f, void *buffer, unsigned int count)
{
HANDLE p = get_file_handle(f);
DWORD bytes_read;
if (!ReadFile(p, buffer, count, &bytes_read, NULL))
return -1;
else
return (int) bytes_read;
}
int __cdecl unlink(const char *filename)
{
TCHAR wbuf[MAX_PATH + 1];
TCHAR fname[MAX_PATH + 1];
ZeroMemory(wbuf, sizeof(wbuf));
ZeroMemory(fname, sizeof(fname));
NH_A2W(filename, wbuf, MAX_PATH);
if (*filename != '\\' && *filename != '/') {
_tcscpy(fname, _nh_cwd);
_tcsncat(fname, _T("\\"), MAX_PATH - _tcslen(fname));
}
_tcsncat(fname, wbuf, MAX_PATH - _tcslen(fname));
return !DeleteFileW(fname);
}
int __cdecl write(int f, const void *buffer, unsigned int count)
{
HANDLE p = get_file_handle(f);
DWORD bytes_written;
if (!WriteFile(p, buffer, count, &bytes_written, NULL))
return -1;
else
return (int) bytes_written;
}
int __cdecl rename(const char *oldname, const char *newname)
{
WCHAR f1[MAX_PATH + 1];
WCHAR f2[MAX_PATH + 1];
ZeroMemory(f1, sizeof(f1));
ZeroMemory(f2, sizeof(f2));
MultiByteToWideChar(CP_ACP, 0, oldname, -1, f1, MAX_PATH);
MultiByteToWideChar(CP_ACP, 0, newname, -1, f2, MAX_PATH);
return !MoveFile(f1, f2);
}
int __cdecl access(const char *path, int mode)
{
DWORD attr;
WCHAR f[MAX_PATH + 1];
ZeroMemory(f, sizeof(f));
MultiByteToWideChar(CP_ACP, 0, path, -1, f, MAX_PATH);
attr = GetFileAttributes(f);
if (attr == (DWORD) -1)
return -1;
if ((attr & FILE_ATTRIBUTE_READONLY) && (mode & 2))
return -1;
else
return 0;
}
int
chdir(const char *dirname)
{
ZeroMemory(_nh_cwd, sizeof(_nh_cwd));
NH_A2W(dirname, _nh_cwd, MAX_PATH);
return 0;
}
char *
getcwd(char *buffer, int maxlen)
{
if (maxlen < (int) _tcslen(_nh_cwd))
return NULL;
else
return NH_W2A(_nh_cwd, buffer, maxlen);
}
/*------------------------------------------------------------------------------*/
/* __errno.h__ */
int errno;
/*------------------------------------------------------------------------------*/
/*
* Chdrive() changes the default drive.
*/
void
chdrive(char *str)
{
return;
}
/*
* This is used in nhlan.c to implement some of the LAN_FEATURES.
*/
char *
get_username(lan_username_size)
int *lan_username_size;
{
static char username_buffer[BUFSZ];
strcpy(username_buffer, "nhsave");
return username_buffer;
}
void
Delay(int ms)
{
(void) Sleep(ms);
}
void
more()
{
}
int
isatty(int f)
{
return 0;
}
#if defined(WIN_CE_PS2xx) || defined(WIN32_PLATFORM_HPCPRO)
int __cdecl isupper(int c)
{
char str[2];
WCHAR wstr[2];
str[0] = c;
str[1] = 0;
NH_A2W(str, wstr, 1);
return iswupper(wstr[0]);
}
int __cdecl isdigit(int c)
{
return ('0' <= c && c <= '9');
}
int __cdecl isxdigit(int c)
{
return (('0' <= c && c <= '9') || ('a' <= c && c <= 'f')
|| ('A' <= c && c <= 'F'));
}
int __cdecl isspace(int c)
{
char str[2];
WCHAR wstr[2];
str[0] = c;
str[1] = 0;
NH_A2W(str, wstr, 1);
return iswspace(wstr[0]);
}
int __cdecl isprint(int c)
{
char str[2];
WCHAR wstr[2];
str[0] = c;
str[1] = 0;
NH_A2W(str, wstr, 1);
return iswprint(wstr[0]);
}
char *__cdecl _strdup(const char *s)
{
char *p;
p = malloc(strlen(s) + 1);
return strcpy(p, s);
}
char *__cdecl strrchr(const char *s, int c)
{
WCHAR wstr[1024];
WCHAR *w;
w = wcsrchr(NH_A2W(s, wstr, 1024), c);
if (w)
return (char *) (s + (w - wstr));
else
return NULL;
}
int __cdecl _stricmp(const char *a, const char *b)
{
return strncmpi(a, b, 65535u);
}
#endif
#if defined(WIN_CE_PS2xx)
/* stdio.h functions are missing from PAlm Size PC SDK 1.2 (SH3 and MIPS) */
#pragma warning(disable : 4273)
FILE *__cdecl fopen(const char *filename, const char *mode)
{
int modeflag;
int whileflag;
int filedes;
/* First mode character must be 'r', 'w', or 'a'. */
switch (*mode) {
case 'r':
modeflag = _O_RDONLY;
break;
case 'w':
modeflag = _O_WRONLY | _O_CREAT | _O_TRUNC;
break;
case 'a':
modeflag = _O_WRONLY | _O_CREAT | _O_APPEND;
break;
default:
return NULL;
}
whileflag = 1;
while (*++mode && whileflag)
switch (*mode) {
case '+':
if (modeflag & _O_RDWR)
whileflag = 0;
else {
modeflag |= _O_RDWR;
modeflag &= ~(_O_RDONLY | _O_WRONLY);
}
break;
case 'b':
if (modeflag & (_O_TEXT | _O_BINARY))
whileflag = 0;
else
modeflag |= _O_BINARY;
break;
case 't': /* not supported */
whileflag = 0;
break;
default:
whileflag = 0;
break;
}
if ((filedes = open(filename, modeflag)) == -1)
return NULL;
return (FILE *) filedes;
}
int __cdecl fscanf(FILE *f, const char *format, ...)
{
/* Format spec: %[*] [width] [l] type ] */
int ch;
int sch;
int matched = 0;
int width = 65535;
int modifier = -1;
int skip_flag = 0;
int n_read = 0;
char buf[BUFSZ];
TCHAR wbuf[BUFSZ];
char *p;
va_list args;
#define RETURN_SCANF(i) \
{ \
va_end(args); \
return i; \
}
#define NEXT_CHAR(f) (n_read++, fgetc(f))
va_start(args, format);
ch = *format++;
sch = NEXT_CHAR(f);
while (ch && sch != EOF) {
if (isspace(ch)) {
while (ch && isspace(ch))
ch = *format++;
while (sch != EOF && isspace(sch))
sch = NEXT_CHAR(f);
format--;
goto next_spec;
}
/* read % */
if (ch != '%') {
if (sch != ch)
RETURN_SCANF(matched);
sch = NEXT_CHAR(f);
goto next_spec;
} else {
/* process '%%' */
ch = *format++;
if (ch == '%') {
if (sch != '%')
RETURN_SCANF(matched);
sch = NEXT_CHAR(f);
goto next_spec;
}
if (ch == '*') {
/* read skip flag - '*' */
skip_flag = 1;
ch = *format++;
}
/* get width */
if (isdigit(ch)) {
width = 0;
while (ch && isdigit(ch)) {
width = width * 10 + (ch - '0');
ch = *format++;
}
}
/* get modifier */
if (ch == 'l') {
modifier = 'l';
ch = *format++;
}
/* get type */
switch (ch) {
case 'c':
if (!skip_flag) {
*(va_arg(args, char *) ) = sch;
matched++;
}
sch = NEXT_CHAR(f);
goto next_spec;
case 'd':
p = buf;
/* skip space */
while (sch != EOF && isspace(sch))
sch = NEXT_CHAR(f);
while (sch != EOF && isdigit(sch) && --width >= 0) {
*p++ = sch;
sch = NEXT_CHAR(f);
}
*p = '\x0';
if (!skip_flag) {
matched++;
if (modifier == 'l') {
*(va_arg(args, long *) ) =
wcstol(NH_A2W(buf, wbuf, BUFSZ), NULL, 10);
} else {
*(va_arg(args, int *) ) =
wcstol(NH_A2W(buf, wbuf, BUFSZ), NULL, 10);
}
}
goto next_spec;
case 'x':
p = buf;
while (sch != EOF && isspace(sch))
sch = NEXT_CHAR(f);
while (sch != EOF && isxdigit(sch) && --width >= 0) {
*p++ = sch;
sch = NEXT_CHAR(f);
}
*p = '\x0';
if (!skip_flag) {
matched++;
if (modifier == 'l') {
*(va_arg(args, long *) ) =
wcstol(NH_A2W(buf, wbuf, BUFSZ), NULL, 16);
} else {
*(va_arg(args, int *) ) =
wcstol(NH_A2W(buf, wbuf, BUFSZ), NULL, 16);
}
}
goto next_spec;
case 'n':
*(va_arg(args, int *) ) = n_read;
matched++;
goto next_spec;
case 's':
if (skip_flag) {
while (sch != EOF && !isspace(sch) && --width >= 0) {
sch = NEXT_CHAR(f);
}
} else {
p = va_arg(args, char *);
while (sch != EOF && !isspace(sch) && --width >= 0) {
*p++ = sch;
sch = NEXT_CHAR(f);
}
*p = '\x0';
matched++;
}
goto next_spec;
case '[': {
char pattern[256];
int start, end;
int negate;
ZeroMemory(pattern, sizeof(pattern));
p = pattern;
/* try to parse '^' modifier */
ch = *format++;
if (ch == '^') {
negate = 1;
ch = *format++;
} else {
negate = 0;
}
if (ch == 0)
RETURN_SCANF(EOF);
for (; ch && ch != ']'; ch = *format++) {
/* try to parse range: a-z */
if (format[0] == '-' && format[1] && format[1] != ']') {
start = ch;
format++;
end = *format++;
while (start <= end) {
if (!strchr(pattern, (char) start))
*p++ = (char) start;
start++;
}
} else {
if (!strchr(pattern, (char) ch))
*p++ = (char) ch;
}
}
if (skip_flag) {
while (sch != EOF && strchr(pattern, sch)
&& --width >= 0) {
sch = NEXT_CHAR(f);
}
} else {
p = va_arg(args, char *);
if (negate)
while (sch != EOF && !strchr(pattern, sch)
&& --width >= 0) {
*p++ = sch;
sch = NEXT_CHAR(f);
}
else
while (sch != EOF && strchr(pattern, sch)
&& --width >= 0) {
*p++ = sch;
sch = NEXT_CHAR(f);
}
*p = '\x0';
matched++;
}
}
goto next_spec;
default:
RETURN_SCANF(EOF);
}
}
next_spec:
width = 65535;
modifier = -1;
skip_flag = 0;
ch = *format++;
}
fseek(f, -1, SEEK_CUR);
RETURN_SCANF(matched);
#undef RETURN_SCANF
#undef NEXT_CHAR
}
int __cdecl fprintf(FILE *f, const char *format, ...)
{
int retval;
va_list args;
if (!f || !format)
return 0;
va_start(args, format);
retval = vfprintf(f, format, args);
va_end(args);
return retval;
}
int __cdecl vfprintf(FILE *f, const char *format, va_list args)
{
char buf[4096];
int retval;
if (!f || !format)
return 0;
retval = vsprintf(buf, format, args);
write((int) f, buf, strlen(buf));
return retval;
}
int __cdecl fgetc(FILE *f)
{
char c;
int fh = (int) f;
if (!f)
return EOF;
if (read(fh, &c, 1) == 1)
return c;
else
return EOF;
}
char *__cdecl fgets(char *s, int size, FILE *f)
{
/* not the best performance but it will do for now...*/
char c;
if (!f || !s || size == 0)
return NULL;
while (--size > 0) {
if ((c = fgetc(f)) == EOF)
return NULL;
*s++ = c;
if (c == '\n')
break;
}
*s = '\x0';
return s;
}
int __cdecl printf(const char *format, ...)
{
int retval;
va_list args;
if (!format)
return 0;
va_start(args, format);
retval = vprintf(format, args);
va_end(args);
return retval;
}
int __cdecl vprintf(const char *format, va_list args)
{
char buf[4096];
int retval;
retval = vsprintf(buf, format, args);
puts(buf);
return retval;
}
// int __cdecl putchar(int);
int __cdecl puts(const char *s)
{
TCHAR wbuf[4096];
NH_A2W(s, wbuf, 4096);
MessageBox(NULL, wbuf, _T("stdout"), MB_OK);
return 0;
}
FILE *__cdecl _getstdfilex(int desc)
{
return NULL;
}
int __cdecl fclose(FILE *f)
{
if (!f)
return EOF;
return close((int) f) == -1 ? EOF : 0;
}
size_t __cdecl fread(void *p, size_t size, size_t count, FILE *f)
{
int read_bytes;
if (!f || !p || size == 0 || count == 0)
return 0;
read_bytes = read((int) f, p, size * count);
return read_bytes > 0 ? (read_bytes / size) : 0;
}
size_t __cdecl fwrite(const void *p, size_t size, size_t count, FILE *f)
{
int write_bytes;
if (!f || !p || size == 0 || count == 0)
return 0;
write_bytes = write((int) f, p, size * count);
return write_bytes > 0 ? write_bytes / size : 0;
}
int __cdecl fflush(FILE *f)
{
return 0;
}
int __cdecl feof(FILE *f)
{
return (f && eof((int) f) == 0) ? 0 : 1;
}
int __cdecl fseek(FILE *f, long offset, int from)
{
return (f && lseek((int) f, offset, from) >= 0) ? 0 : 1;
}
long __cdecl ftell(FILE *f)
{
return f ? lseek((int) f, 0, SEEK_CUR) : -1;
}
#endif

View File

@@ -0,0 +1,40 @@
@REM NetHack 3.6 cesetup.bat $NHDT-Date: 1432512801 2015/05/25 00:13:21 $ $NHDT-Branch: master $:$NHDT-Revision: 1.15 $ */
@REM Copyright (c) Alex Kompel, 2002
@REM NetHack may be freely redistributed. See license for details.
@REM Win32 nhsetup batch file, see Install.ce for details
@REM
@echo off
REM
REM Make sure directories necessary for build exist
REM
if NOT exist ..\..\wince\*.* mkdir ..\..\wince
REM
REM Get these files from the win\win32 port
REM
copy ..\..\win\win32\mnsel.uu ..\..\wince\mnsel.uu
copy ..\..\win\win32\mnselcnt.uu ..\..\wince\mnselcnt.uu
copy ..\..\win\win32\mnunsel.uu ..\..\wince\mnunsel.uu
copy ..\..\win\win32\petmark.uu ..\..\wince\petmark.uu
copy ..\..\sys\wince\menubar.uu ..\..\wince\menubar.uu
copy ..\..\sys\wince\keypad.uu ..\..\wince\keypad.uu
copy ..\..\sys\wince\nhico.uu ..\..\wince\nhico.uu
REM
REM Get these files from sys\wince
REM
copy bootstrp.mak ..\..\wince\bootstrp.mak
copy wince.vcw ..\..\wince.vcw
copy hpc.vcp ..\..\wince\wince_hpc.vcp
copy palmpc.vcp ..\..\wince\wince_palm_pc.vcp
copy pocketpc.vcp ..\..\wince\wince_pocket_pc.vcp
copy smartphn.vcp ..\..\wince\wince_smartphone.vcp
echo.
echo Proceed with the following steps:
echo.
echo cd ..\..\wince
echo nmake /f bootstrp.mak
echo.
echo Then start Embedded Visual C and open
echo the workspace wince.vcw (at the top of the NetHack tree)
echo to build. See Install.ce for details.
echo.

View File

@@ -0,0 +1,29 @@
/* NetHack 3.6 cesound.c $NHDT-Date: 1432512799 2015/05/25 00:13:19 $ $NHDT-Branch: master $:$NHDT-Revision: 1.13 $ */
/* Copyright (c) NetHack PC Development Team 1993 */
/* NetHack may be freely redistributed. See license for details. */
/* */
/*
* cesound.c - Windows CE NetHack sound support
*
*
*/
#include "hack.h"
#include <mmsystem.h>
#ifdef USER_SOUNDS
void
play_usersound(filename, volume)
const char *filename;
int volume;
{
TCHAR wbuf[MAX_PATH + 1];
/* pline("play_usersound: %s (%d).", filename, volume); */
ZeroMemory(wbuf, sizeof(wbuf));
(void) sndPlaySound(NH_A2W(filename, wbuf, MAX_PATH),
SND_ASYNC | SND_NODEFAULT);
}
#endif /*USER_SOUNDS*/
/* cesound.c */

View File

@@ -0,0 +1,84 @@
# $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$
# Copyright (c) 2007 by Michael Allison
# NetHack may be freely redistributed. See license for details.
#
# Sample config file for win32 NetHack
# A '#' at the beginning of a line means the rest of the line is a comment.
#
# Some options MUST be set in this file, other options can be toggled while
# playing. For a list of options available see the <opthelp.> file.
#
# To change the configuration, comment out the unwanted lines, and
# uncomment the configuration you want.
# *** OPTIONS ***
#
# Use the IBM character set rather than just plain ascii characters
# for tty window-port.
# OPTIONS=IBMGraphics
# *** Personal Preferences ***
# Some options to set personal preferences. Uncomment and change these to
# suit your personal preference. If several people are to use the same
# configuration, options like these should not be set.
#
#OPTIONS=name:Janet,role:Valkyrie,race:Human,gender:female,align:lawful
#OPTIONS=dogname:Fido,catname:Morris,fruit:guava
#OPTIONS=horsename:Silver
#OPTIONS=autopickup,pickup_types:$"=/!?+
#OPTIONS=packorder:")[%?+/=!(*0_`
#OPTIONS=scores:10 top/2 around/own
#OPTIONS=nolegacy,noverbose
#OPTIONS=menustyle:traditional
#
# General options. You might also set "silent" so as not to attract
# the boss's attention.
#
OPTIONS=time,noshowexp,number_pad,lit_corridor,rest_on_space
#
# If you want to get rid of "use #quit to quit..." use:
#OPTIONS=suppress_alert:3.3.1
#
# Set some options to control graphical window-port (these will
# be safely and silently ignored by the tty port)
#
# Map window settings
# possible map_mode options include: tiles|ascii4x6|ascii6x8|ascii8x8|ascii16x8|
# ascii7x12|ascii8x12|ascii16x12|ascii12x16|
# ascii10x18|fit_to_screen
OPTIONS=map_mode:tiles,scroll_margin:4
# Menu settings
# OPTIONS=font_menu:Arial
# Other
OPTIONS=hilite_pet,!toptenwin
OPTIONS=!splash_screen,player_selection:prompts
OPTIONS=vary_msgcount:3
OPTIONS=fullscreen,wraptext,softkeyboard
# Status/message window colors
# Possible color options include:
# six digit hexadecimal RGB color value ("#8F8F8F"), black, red, green, brown,
# blue, magenta, cyan, gray (or grey), orange, brightgreen, yellow, brightblue,
# brightmagenta, brightcyan, white, trueblack, purple, silver, maroon, fuchsia,
# lime, olive, navy, teal, aqua, activeborder, activecaption, appworkspace,
# background, btnface, btnshadow, btntext, captiontext, graytext, highlight,
# highlighttext, inactiveborder, inactivecaption, menu, menutext, scrollbar,
# window, windowframe, windowtext.
#OPTIONS=windowcolors:status windowtext/window message windowtext/window
OPTIONS=windowcolors:status white/#000000 message white/#000000 menu white/#000000 text white/#000000
#
#HACKDIR=c:\games\nethack
#
# Note: On Windows HACKDIR defaults to the location
# of the NetHack.exe or NetHackw.exe file.
# Setting HACKDIR above will override that.
#
# LEVELS and SAVE default to HACKDIR
#
#LEVELS=c:\games\nethack\bones
#SAVE=c:\games\nethack\bones

View File

@@ -0,0 +1,8 @@
begin 600 keypad.bmp
M0DV^`````````#X````H````<`````@````!``$``````(``````````````
M`````````````````/___P#__________________P``[__[____________
M_R0``.?_\_?C]__W__?_]^MU``#CP>/GU?/AX\/OY_O5=0``X>/#Q\'QX\'C
MS^?YZR4``/_W_^?5\^?_\^__^]5M``#____WX_?O__OW__?_)```________
*__________\``.?5
`
end

View File

@@ -0,0 +1,12 @@
begin 600 menubar.bmp
M0DUV`0```````'8````H````(````!`````!``0````````!````````````
M````````````````````@```@````("``(````"``(``@(```,#`P`"`@(``
M``#_``#_````__\`_P```/\`_P#__P``____`'=W=W=W=W=W=W=W=W=W=W=W
M=W=W=W=W=W=W=W=W=W=W=$1$1$1$1'=W=W=W=W=W=W1$_T1/]$1W=W=W=W=W
M=W=T1/_T__1$=W=W=W=W=W=W=/______]'=W=P<'!P=W=W3_______1W=W#P
M\/#P=W=T3__T__]$=W</#P\/#P=W=$3_1$_T1'=P\/#P\/#P=W1/__3__T1W
M=P\/#P\/!W=T_______T=W#P\/#P\/!W=/______]'=W!P<'!P<'=W1$__3_
M]$1W=W=W=W=W=W=T1/]$3_1$=W=W=W=W=W=W=$1$1$1$1'=W=W=W=W=W=W=W
.=W=W=W=W=W=W=W=W=W=$
`
end

View File

@@ -0,0 +1,13 @@
/* NetHack 3.6 mhaskyn.c $NHDT-Date: 1432512801 2015/05/25 00:13:21 $ $NHDT-Branch: master $:$NHDT-Revision: 1.9 $ */
/* Copyright (C) 2001 by Alex Kompel */
/* NetHack may be freely redistributed. See license for details. */
#include <assert.h>
#include "winMS.h"
#include "mhaskyn.h"
int
mswin_yes_no_dialog(const char *question, const char *choices, int def)
{
return '\032';
}

View File

@@ -0,0 +1,12 @@
/* NetHack 3.6 mhaskyn.h $NHDT-Date: 1432512800 2015/05/25 00:13:20 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ */
/* Copyright (C) 2001 by Alex Kompel */
/* NetHack may be freely redistributed. See license for details. */
#ifndef MSWINAskYesNO_h
#define MSWINAskYesNO_h
#include "winMS.h"
int mswin_yes_no_dialog(const char *question, const char *choices, int def);
#endif /* MSWINAskYesNO_h */

1532
outdated/sys/wince/mhcmd.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,27 @@
/* NetHack 3.6 mhcmd.h $NHDT-Date: 1524689383 2018/04/25 20:49:43 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.2 $ */
/* Copyright (c) 2002 by Michael Allison */
/* NetHack may be freely redistributed. See license for details. */
#ifndef MSWINCMDWindow_h
#define MSWINCMDWindow_h
#include "winMS.h"
#include "config.h"
#include "global.h"
HWND mswin_init_command_window();
/* if either sz->cx or sz->cy are already set this function will
no modify it. It will adjust them to the minimum size
required by the command window */
void mswin_command_window_size(HWND hwnd, LPSIZE sz);
#if defined(WIN_CE_SMARTPHONE)
/* special keypad input handling for SmartPhone */
BOOL NHSPhoneTranslateKbdMessage(WPARAM wParam, LPARAM lParam, BOOL keyDown);
void NHSPhoneSetKeypadFromString(const char *str);
void NHSPhoneSetKeypadDirection();
void NHSPhoneSetKeypadDefault();
#endif
#endif /* MSWINCMDWindow_h */

View File

@@ -0,0 +1,233 @@
/* NetHack 3.6 mhcolor.c $NHDT-Date: 1432512802 2015/05/25 00:13:22 $ $NHDT-Branch: master $:$NHDT-Revision: 1.7 $ */
/* Copyright (C) 2001 by Alex Kompel */
/* NetHack may be freely redistributed. See license for details. */
/* color management and such */
#include "winMS.h"
#include "mhcolor.h"
#define TOTAL_BRUSHES 10
#define NHBRUSH_CODE(win, type) ((((win) &0xFF) << 8) | ((type) &0xFF))
struct t_brush_table {
int code;
HBRUSH brush;
COLORREF color;
};
static struct t_brush_table brush_table[TOTAL_BRUSHES];
static int max_brush = 0;
static struct t_brush_table default_brush_table[] = {
{ NHBRUSH_CODE(NHW_STATUS, MSWIN_COLOR_FG), NULL, RGB(0, 0, 0) },
{ NHBRUSH_CODE(NHW_MESSAGE, MSWIN_COLOR_FG), NULL, RGB(0, 0, 0) },
{ NHBRUSH_CODE(NHW_STATUS, MSWIN_COLOR_FG), NULL, RGB(0, 0, 0) },
{ NHBRUSH_CODE(NHW_TEXT, MSWIN_COLOR_FG), NULL, RGB(0, 0, 0) },
{ NHBRUSH_CODE(NHW_KEYPAD, MSWIN_COLOR_FG), NULL, RGB(0, 0, 0) },
{ NHBRUSH_CODE(NHW_MAP, MSWIN_COLOR_FG), NULL, RGB(96, 96, 96) },
{ NHBRUSH_CODE(NHW_MENU, MSWIN_COLOR_BG), NULL, RGB(255, 255, 255) },
{ NHBRUSH_CODE(NHW_MESSAGE, MSWIN_COLOR_BG), NULL, RGB(192, 192, 192) },
{ NHBRUSH_CODE(NHW_STATUS, MSWIN_COLOR_BG), NULL, RGB(192, 192, 192) },
{ NHBRUSH_CODE(NHW_TEXT, MSWIN_COLOR_BG), NULL, RGB(255, 255, 255) },
{ NHBRUSH_CODE(NHW_KEYPAD, MSWIN_COLOR_BG), NULL, RGB(255, 255, 255) },
{ NHBRUSH_CODE(NHW_MAP, MSWIN_COLOR_BG), NULL, RGB(192, 192, 192) },
{ -1, NULL, RGB(0, 0, 0) }
};
static void mswin_color_from_string(char *colorstring, HBRUSH *brushptr,
COLORREF *colorptr);
typedef struct ctv {
const char *colorstring;
COLORREF colorvalue;
} color_table_value;
/*
* The color list here is a combination of:
* NetHack colors. (See mhmap.c)
* HTML colors. (See http://www.w3.org/TR/REC-html40/types.html#h-6.5 )
*/
static color_table_value color_table[] = {
/* NetHack colors */
{ "black", RGB(0x55, 0x55, 0x55) },
{ "red", RGB(0xFF, 0x00, 0x00) },
{ "green", RGB(0x00, 0x80, 0x00) },
{ "brown", RGB(0xA5, 0x2A, 0x2A) },
{ "blue", RGB(0x00, 0x00, 0xFF) },
{ "magenta", RGB(0xFF, 0x00, 0xFF) },
{ "cyan", RGB(0x00, 0xFF, 0xFF) },
{ "orange", RGB(0xFF, 0xA5, 0x00) },
{ "brightgreen", RGB(0x00, 0xFF, 0x00) },
{ "yellow", RGB(0xFF, 0xFF, 0x00) },
{ "brightblue", RGB(0x00, 0xC0, 0xFF) },
{ "brightmagenta", RGB(0xFF, 0x80, 0xFF) },
{ "brightcyan", RGB(0x80, 0xFF, 0xFF) },
{ "white", RGB(0xFF, 0xFF, 0xFF) },
/* Remaining HTML colors */
{ "trueblack", RGB(0x00, 0x00, 0x00) },
{ "gray", RGB(0x80, 0x80, 0x80) },
{ "grey", RGB(0x80, 0x80, 0x80) },
{ "purple", RGB(0x80, 0x00, 0x80) },
{ "silver", RGB(0xC0, 0xC0, 0xC0) },
{ "maroon", RGB(0x80, 0x00, 0x00) },
{ "fuchsia", RGB(0xFF, 0x00, 0xFF) }, /* = NetHack magenta */
{ "lime", RGB(0x00, 0xFF, 0x00) }, /* = NetHack bright green */
{ "olive", RGB(0x80, 0x80, 0x00) },
{ "navy", RGB(0x00, 0x00, 0x80) },
{ "teal", RGB(0x00, 0x80, 0x80) },
{ "aqua", RGB(0x00, 0xFF, 0xFF) }, /* = NetHack cyan */
{ "", RGB(0x00, 0x00, 0x00) },
};
typedef struct ctbv {
char *colorstring;
int syscolorvalue;
} color_table_brush_value;
static color_table_brush_value color_table_brush[] = {
{ "activeborder", COLOR_ACTIVEBORDER },
{ "activecaption", COLOR_ACTIVECAPTION },
{ "appworkspace", COLOR_APPWORKSPACE },
{ "background", COLOR_BACKGROUND },
{ "btnface", COLOR_BTNFACE },
{ "btnshadow", COLOR_BTNSHADOW },
{ "btntext", COLOR_BTNTEXT },
{ "captiontext", COLOR_CAPTIONTEXT },
{ "graytext", COLOR_GRAYTEXT },
{ "greytext", COLOR_GRAYTEXT },
{ "highlight", COLOR_HIGHLIGHT },
{ "highlighttext", COLOR_HIGHLIGHTTEXT },
{ "inactiveborder", COLOR_INACTIVEBORDER },
{ "inactivecaption", COLOR_INACTIVECAPTION },
{ "menu", COLOR_MENU },
{ "menutext", COLOR_MENUTEXT },
{ "scrollbar", COLOR_SCROLLBAR },
{ "window", COLOR_WINDOW },
{ "windowframe", COLOR_WINDOWFRAME },
{ "windowtext", COLOR_WINDOWTEXT },
{ "", -1 },
};
void
mswin_init_color_table()
{
int i;
struct t_brush_table *p;
/* cleanup */
for (i = 0; i < max_brush; i++)
DeleteObject(brush_table[i].brush);
max_brush = 0;
/* initialize brush table */
#define BRUSHTABLE_ENTRY(opt, win, type) \
brush_table[max_brush].code = NHBRUSH_CODE((win), (type)); \
mswin_color_from_string((opt), &brush_table[max_brush].brush, \
&brush_table[max_brush].color); \
max_brush++;
BRUSHTABLE_ENTRY(iflags.wc_foregrnd_menu, NHW_MENU, MSWIN_COLOR_FG);
BRUSHTABLE_ENTRY(iflags.wc_foregrnd_message, NHW_MESSAGE, MSWIN_COLOR_FG);
BRUSHTABLE_ENTRY(iflags.wc_foregrnd_status, NHW_STATUS, MSWIN_COLOR_FG);
BRUSHTABLE_ENTRY(iflags.wc_foregrnd_text, NHW_TEXT, MSWIN_COLOR_FG);
BRUSHTABLE_ENTRY(iflags.wc_foregrnd_message, NHW_KEYPAD, MSWIN_COLOR_FG);
BRUSHTABLE_ENTRY(iflags.wc_backgrnd_menu, NHW_MENU, MSWIN_COLOR_BG);
BRUSHTABLE_ENTRY(iflags.wc_backgrnd_message, NHW_MESSAGE, MSWIN_COLOR_BG);
BRUSHTABLE_ENTRY(iflags.wc_backgrnd_status, NHW_STATUS, MSWIN_COLOR_BG);
BRUSHTABLE_ENTRY(iflags.wc_backgrnd_text, NHW_TEXT, MSWIN_COLOR_BG);
BRUSHTABLE_ENTRY(iflags.wc_backgrnd_message, NHW_KEYPAD, MSWIN_COLOR_BG);
#undef BRUSHTABLE_ENTRY
/* go through the values and fill in "blanks" (use default values) */
for (i = 0; i < max_brush; i++) {
if (!brush_table[i].brush) {
for (p = default_brush_table; p->code != -1; p++) {
if (p->code == brush_table[i].code) {
brush_table[i].brush = CreateSolidBrush(p->color);
brush_table[i].color = p->color;
}
}
}
}
}
HBRUSH
mswin_get_brush(int win_type, int color_index)
{
int i;
for (i = 0; i < max_brush; i++)
if (brush_table[i].code == NHBRUSH_CODE(win_type, color_index))
return brush_table[i].brush;
return NULL;
}
COLORREF
mswin_get_color(int win_type, int color_index)
{
int i;
for (i = 0; i < max_brush; i++)
if (brush_table[i].code == NHBRUSH_CODE(win_type, color_index))
return brush_table[i].color;
return RGB(0, 0, 0);
}
static void
mswin_color_from_string(char *colorstring, HBRUSH *brushptr,
COLORREF *colorptr)
{
color_table_value *ctv_ptr = color_table;
color_table_brush_value *ctbv_ptr = color_table_brush;
int red_value, blue_value, green_value;
static char *hexadecimals = "0123456789abcdef";
*brushptr = NULL;
*colorptr = RGB(0, 0, 0);
if (colorstring == NULL)
return;
if (*colorstring == '#') {
if (strlen(++colorstring) != 6)
return;
red_value =
index(hexadecimals, tolower(*colorstring++)) - hexadecimals;
red_value *= 16;
red_value +=
index(hexadecimals, tolower(*colorstring++)) - hexadecimals;
green_value =
index(hexadecimals, tolower(*colorstring++)) - hexadecimals;
green_value *= 16;
green_value +=
index(hexadecimals, tolower(*colorstring++)) - hexadecimals;
blue_value =
index(hexadecimals, tolower(*colorstring++)) - hexadecimals;
blue_value *= 16;
blue_value +=
index(hexadecimals, tolower(*colorstring++)) - hexadecimals;
*colorptr = RGB(red_value, blue_value, green_value);
} else {
while (*ctv_ptr->colorstring
&& _stricmp(ctv_ptr->colorstring, colorstring))
++ctv_ptr;
if (*ctv_ptr->colorstring) {
*colorptr = ctv_ptr->colorvalue;
} else {
while (*ctbv_ptr->colorstring
&& _stricmp(ctbv_ptr->colorstring, colorstring))
++ctbv_ptr;
if (*ctbv_ptr->colorstring) {
*brushptr = SYSCLR_TO_BRUSH(ctbv_ptr->syscolorvalue);
*colorptr = GetSysColor(ctbv_ptr->syscolorvalue);
}
}
}
if (max_brush > TOTAL_BRUSHES)
panic("Too many colors!");
*brushptr = CreateSolidBrush(*colorptr);
}

View File

@@ -0,0 +1,18 @@
/* NetHack 3.6 mhcolor.h $NHDT-Date: 1432512799 2015/05/25 00:13:19 $ $NHDT-Branch: master $:$NHDT-Revision: 1.6 $ */
/* Copyright (C) 2001 by Alex Kompel */
/* NetHack may be freely redistributed. See license for details. */
/* color management functions */
#ifndef MSWINColor_h
#define MSWINColor_h
#define MSWIN_COLOR_BG 0
#define MSWIN_COLOR_FG 1
#define SYSCLR_TO_BRUSH(x) ((HBRUSH)((x) + 1))
extern void mswin_init_color_table();
extern HBRUSH mswin_get_brush(int win_type, int color_index);
extern COLORREF mswin_get_color(int win_type, int color_index);
#endif /* MSWINColor_h */

825
outdated/sys/wince/mhdlg.c Normal file
View File

@@ -0,0 +1,825 @@
/* NetHack 3.6 mhdlg.c $NHDT-Date: 1432512802 2015/05/25 00:13:22 $ $NHDT-Branch: master $:$NHDT-Revision: 1.18 $ */
/* Copyright (C) 2001 by Alex Kompel */
/* NetHack may be freely redistributed. See license for details. */
/* various dialog boxes are defined here */
#include "winMS.h"
#include "hack.h"
#include "func_tab.h"
#include "mhdlg.h"
#include "mhmain.h"
#define CheckDlgButton(dlg, btn_id, st) \
SendDlgItemMessage((dlg), (btn_id), BM_SETCHECK, (WPARAM)(st), 0)
/*---------------------------------------------------------------*/
/* data for getlin dialog */
struct getlin_data {
const char *question;
char *result;
size_t result_size;
};
LRESULT CALLBACK GetlinDlgProc(HWND, UINT, WPARAM, LPARAM);
int
mswin_getlin_window(const char *question, char *result, size_t result_size)
{
int ret;
struct getlin_data data;
/* initilize dialog data */
ZeroMemory(&data, sizeof(data));
data.question = question;
data.result = result;
data.result_size = result_size;
/* create modal dialog window */
ret = DialogBoxParam(GetNHApp()->hApp, MAKEINTRESOURCE(IDD_GETLIN),
GetNHApp()->hMainWnd, GetlinDlgProc, (LPARAM) &data);
if (ret == -1)
panic("Cannot create getlin window");
return ret;
}
LRESULT CALLBACK
GetlinDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
struct getlin_data *data;
RECT main_rt, text_rt, dlg_rt, edit_rt;
SIZE dlg_sz;
TCHAR wbuf[BUFSZ];
HDC hdc;
HWND control;
HWND hwndMap;
#if defined(WIN_CE_POCKETPC)
SHInputDialog(hWnd, message, wParam);
#endif
switch (message) {
case WM_INITDIALOG:
data = (struct getlin_data *) lParam;
SetWindowText(hWnd, NH_A2W(data->question, wbuf, sizeof(wbuf)));
SetWindowLong(hWnd, GWL_USERDATA, lParam);
/* get title text width */
SetRect(&text_rt, 0, 0, 100, 50);
hdc = GetWindowDC(hWnd);
DrawText(hdc, wbuf, _tcslen(wbuf), &text_rt,
DT_CALCRECT | DT_SINGLELINE | DT_NOPREFIX | DT_LEFT
| DT_VCENTER);
ReleaseDC(hWnd, hdc);
/* center dialog in the main window */
GetWindowRect(hWnd, &dlg_rt);
hwndMap = mswin_hwnd_from_winid(WIN_MAP);
GetWindowRect(IsWindow(hwndMap) ? hwndMap : GetNHApp()->hMainWnd,
&main_rt);
dlg_sz.cx = max(
dlg_rt.right - dlg_rt.left,
min(text_rt.right - text_rt.left + GetSystemMetrics(SM_CXICON),
main_rt.right - main_rt.left));
dlg_sz.cy =
min(dlg_rt.bottom - dlg_rt.top, main_rt.bottom - main_rt.top);
dlg_rt.left = (main_rt.left + main_rt.right - dlg_sz.cx) / 2;
dlg_rt.right = dlg_rt.left + dlg_sz.cx;
dlg_rt.top = (main_rt.top + main_rt.bottom - dlg_sz.cy) / 2;
dlg_rt.bottom = dlg_rt.top + dlg_sz.cy;
MoveWindow(hWnd, (main_rt.left + main_rt.right - dlg_sz.cx) / 2,
(main_rt.top + main_rt.bottom - dlg_sz.cy) / 2, dlg_sz.cx,
dlg_sz.cy, TRUE);
/* change layout of controls */
GetClientRect(hWnd, &dlg_rt);
control = GetDlgItem(hWnd, IDC_GETLIN_EDIT);
GetWindowRect(control, &edit_rt);
MoveWindow(control, 0, 0, dlg_rt.right - dlg_rt.left,
edit_rt.bottom - edit_rt.top, TRUE);
control = GetDlgItem(hWnd, IDOK);
GetWindowRect(control, &text_rt);
MoveWindow(control, 0, edit_rt.bottom - edit_rt.top,
(dlg_rt.right - dlg_rt.left) / 2,
text_rt.bottom - text_rt.top, TRUE);
control = GetDlgItem(hWnd, IDCANCEL);
GetWindowRect(control, &text_rt);
MoveWindow(control, (dlg_rt.right - dlg_rt.left) / 2,
edit_rt.bottom - edit_rt.top,
(dlg_rt.right - dlg_rt.left) / 2,
text_rt.bottom - text_rt.top, TRUE);
#if defined(WIN_CE_SMARTPHONE)
NHSPhoneDialogSetup(hWnd, IDC_SPHONE_DIALOGBAR, TRUE, FALSE);
#endif
/* set focus to the edit control */
SetFocus(GetDlgItem(hWnd, IDC_GETLIN_EDIT));
/* tell windows that we've set the focus */
return FALSE;
break;
case WM_COMMAND: {
TCHAR wbuf[BUFSZ];
switch (LOWORD(wParam)) {
/* OK button was pressed */
case IDOK:
data = (struct getlin_data *) GetWindowLong(hWnd, GWL_USERDATA);
SendDlgItemMessage(hWnd, IDC_GETLIN_EDIT, WM_GETTEXT,
(WPARAM) sizeof(wbuf), (LPARAM) wbuf);
NH_W2A(wbuf, data->result, data->result_size);
/* Fall through. */
/* cancel button was pressed */
case IDCANCEL:
EndDialog(hWnd, wParam);
return TRUE;
}
} break;
#if defined(WIN_CE_SMARTPHONE)
case WM_HOTKEY:
if (VK_TBACK == HIWORD(lParam)) {
SHSendBackToFocusWindow(message, wParam, lParam);
}
break;
#endif
} /* end switch (message) */
return FALSE;
}
/*---------------------------------------------------------------*/
/* dialog data for the list of extended commands */
struct extcmd_data {
int *selection;
};
LRESULT CALLBACK ExtCmdDlgProc(HWND, UINT, WPARAM, LPARAM);
int
mswin_ext_cmd_window(int *selection)
{
int ret;
struct extcmd_data data;
/* init dialog data */
ZeroMemory(&data, sizeof(data));
*selection = -1;
data.selection = selection;
/* create modal dialog window */
ret = DialogBoxParam(GetNHApp()->hApp, MAKEINTRESOURCE(IDD_EXTCMD),
GetNHApp()->hMainWnd, ExtCmdDlgProc, (LPARAM) &data);
if (ret == -1)
panic("Cannot create extcmd window");
return ret;
}
LRESULT CALLBACK
ExtCmdDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
struct extcmd_data *data;
RECT main_rt, dlg_rt;
SIZE dlg_sz;
int i;
const char *ptr;
TCHAR wbuf[255];
switch (message) {
case WM_INITDIALOG:
data = (struct extcmd_data *) lParam;
SetWindowLong(hWnd, GWL_USERDATA, lParam);
/* center dialog in the main window */
GetWindowRect(GetNHApp()->hMainWnd, &main_rt);
GetWindowRect(hWnd, &dlg_rt);
dlg_sz.cx = dlg_rt.right - dlg_rt.left;
dlg_sz.cy = dlg_rt.bottom - dlg_rt.top;
dlg_rt.left = (main_rt.left + main_rt.right - dlg_sz.cx) / 2;
dlg_rt.right = dlg_rt.left + dlg_sz.cx;
dlg_rt.top = (main_rt.top + main_rt.bottom - dlg_sz.cy) / 2;
dlg_rt.bottom = dlg_rt.top + dlg_sz.cy;
MoveWindow(hWnd, (main_rt.left + main_rt.right - dlg_sz.cx) / 2,
(main_rt.top + main_rt.bottom - dlg_sz.cy) / 2, dlg_sz.cx,
dlg_sz.cy, TRUE);
/* fill combobox with extended commands */
for (i = 0; (ptr = extcmdlist[i].ef_txt); i++) {
SendDlgItemMessage(hWnd, IDC_EXTCMD_LIST, LB_ADDSTRING,
(WPARAM) 0,
(LPARAM) NH_A2W(ptr, wbuf, sizeof(wbuf)));
}
#if defined(WIN_CE_SMARTPHONE)
NHSPhoneDialogSetup(hWnd, IDC_SPHONE_DIALOGBAR, FALSE, FALSE);
GetClientRect(hWnd, &dlg_rt);
MoveWindow(GetDlgItem(hWnd, IDC_EXTCMD_LIST), dlg_rt.left, dlg_rt.top,
dlg_rt.right - dlg_rt.left, dlg_rt.bottom - dlg_rt.top,
TRUE);
#endif
/* set focus to the list control */
SetFocus(GetDlgItem(hWnd, IDC_EXTCMD_LIST));
/* tell windows we set the focus */
return FALSE;
break;
case WM_COMMAND:
data = (struct extcmd_data *) GetWindowLong(hWnd, GWL_USERDATA);
switch (LOWORD(wParam)) {
/* OK button ws clicked */
case IDOK:
*data->selection = SendDlgItemMessage(
hWnd, IDC_EXTCMD_LIST, LB_GETCURSEL, (WPARAM) 0, (LPARAM) 0);
if (*data->selection == LB_ERR)
*data->selection = -1;
/* Fall through. */
/* CANCEL button ws clicked */
case IDCANCEL:
EndDialog(hWnd, wParam);
return TRUE;
/* list control events */
case IDC_EXTCMD_LIST:
switch (HIWORD(wParam)) {
case LBN_DBLCLK:
/* double click within the list
wParam
The low-order word is the list box identifier.
The high-order word is the notification message.
lParam
Handle to the list box
*/
*data->selection = SendMessage((HWND) lParam, LB_GETCURSEL,
(WPARAM) 0, (LPARAM) 0);
if (*data->selection == LB_ERR)
*data->selection = -1;
EndDialog(hWnd, IDOK);
return TRUE;
}
break;
}
}
return FALSE;
}
/*---------------------------------------------------------------*/
/* player selector dialog data */
struct plsel_data {
int *selection;
};
BOOL CALLBACK PlayerSelectorDlgProc(HWND, UINT, WPARAM, LPARAM);
static void plselInitDialog(HWND hWnd);
static void plselAdjustLists(HWND hWnd, int changed_opt);
static int plselFinalSelection(HWND hWnd, int *selection);
int
mswin_player_selection_window(int *selection)
{
int ret;
struct plsel_data data;
/* init dialog data */
ZeroMemory(&data, sizeof(data));
data.selection = selection;
/* create modal dialog */
ret = DialogBoxParam(
GetNHApp()->hApp, MAKEINTRESOURCE(IDD_PLAYER_SELECTOR),
GetNHApp()->hMainWnd, PlayerSelectorDlgProc, (LPARAM) &data);
if (ret == -1)
panic("Cannot create getlin window");
return ret;
}
BOOL CALLBACK
PlayerSelectorDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
struct plsel_data *data;
RECT main_rt, dlg_rt;
SIZE dlg_sz;
switch (message) {
case WM_INITDIALOG:
data = (struct plsel_data *) lParam;
SetWindowLong(hWnd, GWL_USERDATA, lParam);
/* center dialog in the main window */
GetWindowRect(GetNHApp()->hMainWnd, &main_rt);
GetWindowRect(hWnd, &dlg_rt);
dlg_sz.cx = dlg_rt.right - dlg_rt.left;
dlg_sz.cy = dlg_rt.bottom - dlg_rt.top;
dlg_rt.left = (main_rt.left + main_rt.right - dlg_sz.cx) / 2;
dlg_rt.right = dlg_rt.left + dlg_sz.cx;
dlg_rt.top = (main_rt.top + main_rt.bottom - dlg_sz.cy) / 2;
dlg_rt.bottom = dlg_rt.top + dlg_sz.cy;
MoveWindow(hWnd, (main_rt.left + main_rt.right - dlg_sz.cx) / 2,
(main_rt.top + main_rt.bottom - dlg_sz.cy) / 2, dlg_sz.cx,
dlg_sz.cy, TRUE);
/* init dialog */
plselInitDialog(hWnd);
#if defined(WIN_CE_SMARTPHONE)
NHSPhoneDialogSetup(hWnd, IDC_SPHONE_DIALOGBAR, FALSE, FALSE);
#endif
/* set focus on the role checkbox (random) field */
SetFocus(GetDlgItem(hWnd, IDC_PLSEL_ROLE_RANDOM));
/* tell windows we set the focus */
return FALSE;
break;
case WM_COMMAND:
data = (struct plsel_data *) GetWindowLong(hWnd, GWL_USERDATA);
switch (LOWORD(wParam)) {
/* OK button was clicked */
case IDOK:
if (plselFinalSelection(hWnd, data->selection)) {
EndDialog(hWnd, wParam);
} else {
MessageBox(
hWnd, TEXT("Cannot match this role. Try something else."),
TEXT("STOP"), MB_OK);
}
return TRUE;
/* CANCEL button was clicked */
case IDCANCEL:
*data->selection = -1;
EndDialog(hWnd, wParam);
return TRUE;
/* following are events from dialog controls:
"random" checkboxes send BN_CLICKED messages;
role/race/... combo-boxes send CBN_SELENDOK
if something was selected;
*/
case IDC_PLSEL_ROLE_RANDOM:
if (HIWORD(wParam) == BN_CLICKED) {
/* enable corresponding list window if "random"
checkbox was "unchecked" */
EnableWindow(GetDlgItem(hWnd, IDC_PLSEL_ROLE_LIST),
SendMessage((HWND) lParam, BM_GETCHECK, 0, 0)
== BST_UNCHECKED);
}
break;
case IDC_PLSEL_RACE_RANDOM:
if (HIWORD(wParam) == BN_CLICKED) {
EnableWindow(GetDlgItem(hWnd, IDC_PLSEL_RACE_LIST),
SendMessage((HWND) lParam, BM_GETCHECK, 0, 0)
== BST_UNCHECKED);
}
break;
case IDC_PLSEL_GENDER_RANDOM:
if (HIWORD(wParam) == BN_CLICKED) {
EnableWindow(GetDlgItem(hWnd, IDC_PLSEL_GENDER_LIST),
SendMessage((HWND) lParam, BM_GETCHECK, 0, 0)
== BST_UNCHECKED);
}
break;
case IDC_PLSEL_ALIGN_RANDOM:
if (HIWORD(wParam) == BN_CLICKED) {
EnableWindow(GetDlgItem(hWnd, IDC_PLSEL_ALIGN_LIST),
SendMessage((HWND) lParam, BM_GETCHECK, 0, 0)
== BST_UNCHECKED);
}
break;
case IDC_PLSEL_ROLE_LIST:
if (HIWORD(wParam) == CBN_SELENDOK) {
/* filter out invalid options if
the selection was made */
plselAdjustLists(hWnd, LOWORD(wParam));
}
break;
case IDC_PLSEL_RACE_LIST:
if (HIWORD(wParam) == CBN_SELENDOK) {
plselAdjustLists(hWnd, LOWORD(wParam));
}
break;
case IDC_PLSEL_GENDER_LIST:
if (HIWORD(wParam) == CBN_SELENDOK) {
plselAdjustLists(hWnd, LOWORD(wParam));
}
break;
case IDC_PLSEL_ALIGN_LIST:
if (HIWORD(wParam) == CBN_SELENDOK) {
plselAdjustLists(hWnd, LOWORD(wParam));
}
break;
}
break;
}
return FALSE;
}
void
setComboBoxValue(HWND hWnd, int combo_box, int value)
{
int index_max = SendDlgItemMessage(hWnd, combo_box, CB_GETCOUNT, 0, 0);
int index;
int value_to_set = LB_ERR;
for (index = 0; index < index_max; index++) {
if (SendDlgItemMessage(hWnd, combo_box, CB_GETITEMDATA,
(WPARAM) index, 0) == value) {
value_to_set = index;
break;
}
}
SendDlgItemMessage(hWnd, combo_box, CB_SETCURSEL, (WPARAM) value_to_set,
0);
}
/* initialize player selector dialog */
void
plselInitDialog(HWND hWnd)
{
TCHAR wbuf[BUFSZ];
/* set player name */
SetDlgItemText(hWnd, IDC_PLSEL_NAME, NH_A2W(g.plname, wbuf, sizeof(wbuf)));
/* check flags for consistency */
if (flags.initrole >= 0) {
if (flags.initrace >= 0
&& !validrace(flags.initrole, flags.initrace)) {
flags.initrace = ROLE_NONE;
}
if (flags.initgend >= 0
&& !validgend(flags.initrole, flags.initrace, flags.initgend)) {
flags.initgend = ROLE_NONE;
}
if (flags.initalign >= 0
&& !validalign(flags.initrole, flags.initrace, flags.initalign)) {
flags.initalign = ROLE_NONE;
}
}
/* populate select boxes */
plselAdjustLists(hWnd, -1);
/* intialize roles list */
if (flags.initrole < 0
|| !ok_role(flags.initrole, ROLE_NONE, ROLE_NONE, ROLE_NONE)) {
CheckDlgButton(hWnd, IDC_PLSEL_ROLE_RANDOM, BST_CHECKED);
EnableWindow(GetDlgItem(hWnd, IDC_PLSEL_ROLE_LIST), FALSE);
} else {
CheckDlgButton(hWnd, IDC_PLSEL_ROLE_RANDOM, BST_UNCHECKED);
EnableWindow(GetDlgItem(hWnd, IDC_PLSEL_ROLE_LIST), TRUE);
setComboBoxValue(hWnd, IDC_PLSEL_ROLE_LIST, flags.initrole);
}
/* intialize races list */
if (flags.initrace < 0
|| !ok_race(flags.initrole, flags.initrace, ROLE_NONE, ROLE_NONE)) {
CheckDlgButton(hWnd, IDC_PLSEL_RACE_RANDOM, BST_CHECKED);
EnableWindow(GetDlgItem(hWnd, IDC_PLSEL_RACE_LIST), FALSE);
} else {
CheckDlgButton(hWnd, IDC_PLSEL_RACE_RANDOM, BST_UNCHECKED);
EnableWindow(GetDlgItem(hWnd, IDC_PLSEL_RACE_LIST), TRUE);
setComboBoxValue(hWnd, IDC_PLSEL_RACE_LIST, flags.initrace);
}
/* intialize genders list */
if (flags.initgend < 0
|| !ok_gend(flags.initrole, flags.initrace, flags.initgend,
ROLE_NONE)) {
CheckDlgButton(hWnd, IDC_PLSEL_GENDER_RANDOM, BST_CHECKED);
EnableWindow(GetDlgItem(hWnd, IDC_PLSEL_GENDER_LIST), FALSE);
} else {
CheckDlgButton(hWnd, IDC_PLSEL_GENDER_RANDOM, BST_UNCHECKED);
EnableWindow(GetDlgItem(hWnd, IDC_PLSEL_GENDER_LIST), TRUE);
setComboBoxValue(hWnd, IDC_PLSEL_GENDER_LIST, flags.initgend);
}
/* intialize alignments list */
if (flags.initalign < 0
|| !ok_align(flags.initrole, flags.initrace, flags.initgend,
flags.initalign)) {
CheckDlgButton(hWnd, IDC_PLSEL_ALIGN_RANDOM, BST_CHECKED);
EnableWindow(GetDlgItem(hWnd, IDC_PLSEL_ALIGN_LIST), FALSE);
} else {
CheckDlgButton(hWnd, IDC_PLSEL_ALIGN_RANDOM, BST_UNCHECKED);
EnableWindow(GetDlgItem(hWnd, IDC_PLSEL_ALIGN_LIST), TRUE);
setComboBoxValue(hWnd, IDC_PLSEL_ALIGN_LIST, flags.initalign);
}
}
/* adjust role/race/alignment/gender list - filter out
invalid combinations
changed_sel points to the list where selection occurred
(-1 if unknown)
*/
void
plselAdjustLists(HWND hWnd, int changed_sel)
{
HWND control_role, control_race, control_gender, control_align;
int initrole, initrace, initgend, initalign;
int i;
int ind;
int valid_opt;
TCHAR wbuf[255];
/* get control handles */
control_role = GetDlgItem(hWnd, IDC_PLSEL_ROLE_LIST);
control_race = GetDlgItem(hWnd, IDC_PLSEL_RACE_LIST);
control_gender = GetDlgItem(hWnd, IDC_PLSEL_GENDER_LIST);
control_align = GetDlgItem(hWnd, IDC_PLSEL_ALIGN_LIST);
/* get current selections */
ind = SendMessage(control_role, CB_GETCURSEL, 0, 0);
initrole = (ind == LB_ERR)
? flags.initrole
: SendMessage(control_role, CB_GETITEMDATA, ind, 0);
ind = SendMessage(control_race, CB_GETCURSEL, 0, 0);
initrace = (ind == LB_ERR)
? flags.initrace
: SendMessage(control_race, CB_GETITEMDATA, ind, 0);
ind = SendMessage(control_gender, CB_GETCURSEL, 0, 0);
initgend = (ind == LB_ERR)
? flags.initgend
: SendMessage(control_gender, CB_GETITEMDATA, ind, 0);
ind = SendMessage(control_align, CB_GETCURSEL, 0, 0);
initalign = (ind == LB_ERR)
? flags.initalign
: SendMessage(control_align, CB_GETITEMDATA, ind, 0);
/* intialize roles list */
if (changed_sel == -1) {
valid_opt = 0;
/* reset content and populate the list */
SendMessage(control_role, CB_RESETCONTENT, 0, 0);
for (i = 0; roles[i].name.m; i++) {
if (ok_role(i, initrace, initgend, initalign)) {
if (initgend >= 0 && flags.female && roles[i].name.f)
ind = SendMessage(
control_role, CB_ADDSTRING, (WPARAM) 0,
(LPARAM) NH_A2W(roles[i].name.f, wbuf, sizeof(wbuf)));
else
ind = SendMessage(
control_role, CB_ADDSTRING, (WPARAM) 0,
(LPARAM) NH_A2W(roles[i].name.m, wbuf, sizeof(wbuf)));
SendMessage(control_role, CB_SETITEMDATA, (WPARAM) ind,
(LPARAM) i);
if (i == initrole) {
SendMessage(control_role, CB_SETCURSEL, (WPARAM) ind,
(LPARAM) 0);
valid_opt = 1;
}
}
}
/* set selection to the previously selected role
if it is still valid */
if (!valid_opt) {
initrole = ROLE_NONE;
initrace = ROLE_NONE;
initgend = ROLE_NONE;
initalign = ROLE_NONE;
SendMessage(control_role, CB_SETCURSEL, (WPARAM) -1, (LPARAM) 0);
}
/* trigger change of the races list */
changed_sel = IDC_PLSEL_ROLE_LIST;
}
/* intialize races list */
if (changed_sel == IDC_PLSEL_ROLE_LIST) {
valid_opt = 0;
/* reset content and populate the list */
SendMessage(control_race, CB_RESETCONTENT, 0, 0);
for (i = 0; races[i].noun; i++)
if (ok_race(initrole, i, ROLE_NONE, ROLE_NONE)) {
ind = SendMessage(
control_race, CB_ADDSTRING, (WPARAM) 0,
(LPARAM) NH_A2W(races[i].noun, wbuf, sizeof(wbuf)));
SendMessage(control_race, CB_SETITEMDATA, (WPARAM) ind,
(LPARAM) i);
if (i == initrace) {
SendMessage(control_race, CB_SETCURSEL, (WPARAM) ind,
(LPARAM) 0);
valid_opt = 1;
}
}
/* set selection to the previously selected race
if it is still valid */
if (!valid_opt) {
initrace = ROLE_NONE;
initgend = ROLE_NONE;
initalign = ROLE_NONE;
SendMessage(control_race, CB_SETCURSEL, (WPARAM) -1, (LPARAM) 0);
}
/* trigger change of the genders list */
changed_sel = IDC_PLSEL_RACE_LIST;
}
/* intialize genders list */
if (changed_sel == IDC_PLSEL_RACE_LIST) {
valid_opt = 0;
/* reset content and populate the list */
SendMessage(control_gender, CB_RESETCONTENT, 0, 0);
for (i = 0; i < ROLE_GENDERS; i++)
if (ok_gend(initrole, initrace, i, ROLE_NONE)) {
ind = SendMessage(
control_gender, CB_ADDSTRING, (WPARAM) 0,
(LPARAM) NH_A2W(genders[i].adj, wbuf, sizeof(wbuf)));
SendMessage(control_gender, CB_SETITEMDATA, (WPARAM) ind,
(LPARAM) i);
if (i == initgend) {
SendMessage(control_gender, CB_SETCURSEL, (WPARAM) ind,
(LPARAM) 0);
valid_opt = 1;
}
}
/* set selection to the previously selected gender
if it is still valid */
if (!valid_opt) {
initgend = ROLE_NONE;
initalign = ROLE_NONE;
SendMessage(control_gender, CB_SETCURSEL, (WPARAM) -1,
(LPARAM) 0);
}
/* trigger change of the alignments list */
changed_sel = IDC_PLSEL_GENDER_LIST;
}
/* intialize alignments list */
if (changed_sel == IDC_PLSEL_GENDER_LIST) {
valid_opt = 0;
/* reset content and populate the list */
SendMessage(control_align, CB_RESETCONTENT, 0, 0);
for (i = 0; i < ROLE_ALIGNS; i++)
if (ok_align(initrole, initrace, initgend, i)) {
ind = SendMessage(
control_align, CB_ADDSTRING, (WPARAM) 0,
(LPARAM) NH_A2W(aligns[i].adj, wbuf, sizeof(wbuf)));
SendMessage(control_align, CB_SETITEMDATA, (WPARAM) ind,
(LPARAM) i);
if (i == initalign) {
SendMessage(control_align, CB_SETCURSEL, (WPARAM) ind,
(LPARAM) 0);
valid_opt = 1;
}
}
/* set selection to the previously selected alignment
if it is still valid */
if (!valid_opt) {
initalign = ROLE_NONE;
SendMessage(control_align, CB_SETCURSEL, (WPARAM) -1, (LPARAM) 0);
}
}
}
/* player made up his mind - get final selection here */
int
plselFinalSelection(HWND hWnd, int *selection)
{
int ind;
/* get current selections */
if (SendDlgItemMessage(hWnd, IDC_PLSEL_ROLE_RANDOM, BM_GETCHECK, 0, 0)
== BST_CHECKED) {
flags.initrole = ROLE_RANDOM;
} else {
ind =
SendDlgItemMessage(hWnd, IDC_PLSEL_ROLE_LIST, CB_GETCURSEL, 0, 0);
flags.initrole = (ind == LB_ERR)
? ROLE_RANDOM
: SendDlgItemMessage(hWnd, IDC_PLSEL_ROLE_LIST,
CB_GETITEMDATA, ind, 0);
}
if (SendDlgItemMessage(hWnd, IDC_PLSEL_RACE_RANDOM, BM_GETCHECK, 0, 0)
== BST_CHECKED) {
flags.initrace = ROLE_RANDOM;
} else {
ind =
SendDlgItemMessage(hWnd, IDC_PLSEL_RACE_LIST, CB_GETCURSEL, 0, 0);
flags.initrace = (ind == LB_ERR)
? ROLE_RANDOM
: SendDlgItemMessage(hWnd, IDC_PLSEL_RACE_LIST,
CB_GETITEMDATA, ind, 0);
}
if (SendDlgItemMessage(hWnd, IDC_PLSEL_GENDER_RANDOM, BM_GETCHECK, 0, 0)
== BST_CHECKED) {
flags.initgend = ROLE_RANDOM;
} else {
ind = SendDlgItemMessage(hWnd, IDC_PLSEL_GENDER_LIST, CB_GETCURSEL, 0,
0);
flags.initgend = (ind == LB_ERR)
? ROLE_RANDOM
: SendDlgItemMessage(hWnd, IDC_PLSEL_GENDER_LIST,
CB_GETITEMDATA, ind, 0);
}
if (SendDlgItemMessage(hWnd, IDC_PLSEL_ALIGN_RANDOM, BM_GETCHECK, 0, 0)
== BST_CHECKED) {
flags.initalign = ROLE_RANDOM;
} else {
ind = SendDlgItemMessage(hWnd, IDC_PLSEL_ALIGN_LIST, CB_GETCURSEL, 0,
0);
flags.initalign = (ind == LB_ERR)
? ROLE_RANDOM
: SendDlgItemMessage(hWnd, IDC_PLSEL_ALIGN_LIST,
CB_GETITEMDATA, ind, 0);
}
/* check the role */
if (flags.initrole == ROLE_RANDOM) {
flags.initrole = pick_role(flags.initrace, flags.initgend,
flags.initalign, PICK_RANDOM);
if (flags.initrole < 0) {
MessageBox(hWnd, TEXT("Incompatible role!"), TEXT("STOP"), MB_OK);
return FALSE;
}
}
/* Select a race, if necessary */
/* force compatibility with role */
if (flags.initrace == ROLE_RANDOM
|| !validrace(flags.initrole, flags.initrace)) {
/* pre-selected race not valid */
if (flags.initrace == ROLE_RANDOM) {
flags.initrace = pick_race(flags.initrole, flags.initgend,
flags.initalign, PICK_RANDOM);
}
if (flags.initrace < 0) {
MessageBox(hWnd, TEXT("Incompatible race!"), TEXT("STOP"), MB_OK);
return FALSE;
}
}
/* Select a gender, if necessary */
/* force compatibility with role/race, try for compatibility with
* pre-selected alignment */
if (flags.initgend < 0
|| !validgend(flags.initrole, flags.initrace, flags.initgend)) {
/* pre-selected gender not valid */
if (flags.initgend == ROLE_RANDOM) {
flags.initgend = pick_gend(flags.initrole, flags.initrace,
flags.initalign, PICK_RANDOM);
}
if (flags.initgend < 0) {
MessageBox(hWnd, TEXT("Incompatible gender!"), TEXT("STOP"),
MB_OK);
return FALSE;
}
}
/* Select an alignment, if necessary */
/* force compatibility with role/race/gender */
if (flags.initalign < 0
|| !validalign(flags.initrole, flags.initrace, flags.initalign)) {
/* pre-selected alignment not valid */
if (flags.initalign == ROLE_RANDOM) {
flags.initalign = pick_align(flags.initrole, flags.initrace,
flags.initgend, PICK_RANDOM);
} else {
MessageBox(hWnd, TEXT("Incompatible alignment!"), TEXT("STOP"),
MB_OK);
return FALSE;
}
}
return TRUE;
}

View File

@@ -0,0 +1,17 @@
/* NetHack 3.6 mhdlg.h $NHDT-Date: 1432512802 2015/05/25 00:13:22 $ $NHDT-Branch: master $:$NHDT-Revision: 1.8 $ */
/* Copyright (C) 2001 by Alex Kompel */
/* NetHack may be freely redistributed. See license for details. */
#ifndef MSWINDlgWindow_h
#define MSWINDlgWindow_h
#include "winMS.h"
#include "config.h"
#include "global.h"
int mswin_getlin_window(const char *question, char *result,
size_t result_size);
int mswin_ext_cmd_window(int *selection);
int mswin_player_selection_window(int *selection);
#endif /* MSWINDlgWindow_h */

Some files were not shown because too many files have changed in this diff Show More