Amiga: auto-assign NetHack: to the program directory

This commit is contained in:
Ingo Paschke
2026-05-04 15:33:14 +02:00
parent 82efba55f2
commit 9a909be7c5
4 changed files with 21 additions and 0 deletions
+17
View File
@@ -30,6 +30,23 @@
int getpid(void) { return (int)FindTask(NULL); }
#endif
/* Point NetHack: at the directory we were launched from. Works for both
CLI ("nethack") and Workbench (icon double-click) launches, since
GetProgramDir() (V37+) resolves both. Any existing assign is replaced;
it would just be stale state from a previous install or session. */
void
amiga_self_assign(void)
{
BPTR dup;
if (GetProgramDir() == 0)
return;
if ((dup = DupLock(GetProgramDir())) == 0)
return;
if (!AssignLock("NetHack", dup))
UnLock(dup);
}
#ifdef AZTEC_50
#include <functions.h>
#undef strcmpi
+1
View File
@@ -18,6 +18,7 @@ int abs(int );
#endif
int tgetch (void);
int dosh (void);
void amiga_self_assign (void);
long freediskspace(char *);
long filesize(char *);
void eraseall(const char * , const char *);