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

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<"*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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