View previous topic :: View next topic |
Author |
Message |
Jalmar n00b
Joined: 05 Nov 2005 Posts: 24
|
Posted: Fri Jan 06, 2006 3:14 pm Post subject: [WANTED] Caverns of Larn - Old game like moria or nethack |
|
|
Hello everyone!
I recently installed Moria and Nethack on my box, and remembered there was another game like those which I used to play ages ago on my Atari 1040 ST.
Well, that game I am looking for was called "The Caverns of Larn", or simply "Larn". I couldn't find it in portage, but I stumbled across some hints in the web that it might exist in FreeBSD. Now my question: Is there any chance of digging this game up somehow? Does a version for Linux exist?
I would be really happy to get this one, as I am a little nostalgic about those ASCII-games (I even completed Moria with a ranger-character )
Infos are really much appreciated! |
|
Back to top |
|
|
desultory Bodhisattva
Joined: 04 Nov 2005 Posts: 9410
|
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20090
|
Posted: Fri Jan 06, 2006 7:03 pm Post subject: |
|
|
Moved from Other Things Gentoo _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
Jalmar n00b
Joined: 05 Nov 2005 Posts: 24
|
Posted: Fri Jan 06, 2006 7:42 pm Post subject: |
|
|
Thanks desultory for your link
However, the ularn-Link doesn't work, and I am having trouble extracting the sources (*.Z)
I emerged zoo for extraction, but it complains about an invalid header.
Do you (or anybody else) know how I can extract those...?
Thanks a lot so far |
|
Back to top |
|
|
desultory Bodhisattva
Joined: 04 Nov 2005 Posts: 9410
|
Posted: Fri Jan 06, 2006 10:28 pm Post subject: |
|
|
I have never used zoo, so I really can provide no help there.
I can however ask: why the msdos binary, dosemu?
Edit: typo
Last edited by desultory on Mon May 01, 2006 10:52 pm; edited 1 time in total |
|
Back to top |
|
|
hensan l33t
Joined: 26 Jun 2003 Posts: 868 Location: Sweden
|
Posted: Fri Jan 06, 2006 11:47 pm Post subject: |
|
|
Jalmar, you can use gunzip to unpack .Z files (gunzip -c part01.Z > part01 etc.)
Then chmod +x the files.
Then edit the files and remove everything before the #!/bin/sh line.
Then run the files to unpack the sources (the files are shell archives).
Then apply the patches, patch -p0 < patches01 etc. (The patches fail to update patchlevel.h properly, so you have to do that yourself).
Now you have the sources ready. Only they won't build.
Seems like this thing is going to need some patching before it will build on linux...
Edit: Found ularn: www.ularn.org ...only it won't build either... |
|
Back to top |
|
|
Jalmar n00b
Joined: 05 Nov 2005 Posts: 24
|
Posted: Sat Jan 07, 2006 12:29 am Post subject: |
|
|
Thanks guys, I came as far as producing the sources!
Edit: Well, I thought so....still fighting with those patches
But I never built anything from sources this way, which command should I use an all those c-files?
The Ularn-Website states that it should build on Linux. Do you have any ideas about how to get it compiled without having to wait for a patch (which might take ages I fear...) ?
This would be really awesome to see it work |
|
Back to top |
|
|
desultory Bodhisattva
Joined: 04 Nov 2005 Posts: 9410
|
Posted: Sat Jan 07, 2006 8:32 pm Post subject: |
|
|
To get the sources extracted and patched:
- Place all of the part*.Z and patch*.Z into an otherwise empty directory.
- Change to that directory in a terminal.
- Run: (This could get bash specific here, so keep that in mind.)
Code: |
gunzip `ls -1`
perl -pe '($f=1)if(/^\#\! *\/bin\/sh\s*$/);($f=0)if(/exit 0/); if($f==1){s/(.*)/$1/}else{s/.*//;chomp;chomp}' `ls -1` | sh
uufilter larn_hlp.uue
< patches01 patch -p0
< patches02 patch -p0
< patches03 patch -p0
< patches04 patch -p0
|
Note: the perl command is broken over 2 lines, paste it together and it should work.
Also, each time patch will complain about rejects in patchlevel.h, ignore them as it does.
Edit patchlevel. h to contain:
Code: | #define PATCHLEVEL 4 |
To, try to, build it once you have the sources readied just run make in the directory where the sourcess are.
To get it to build without patching it further just install BSD 4.3, it should build just fine.
Edit: added the uudecoding step.
Last edited by desultory on Sun Jan 08, 2006 7:01 am; edited 1 time in total |
|
Back to top |
|
|
Jalmar n00b
Joined: 05 Nov 2005 Posts: 24
|
Posted: Sun Jan 08, 2006 12:01 am Post subject: |
|
|
Good evening!
I followed your suggestions desultory, and, es expected, the build didn't work. If you (or anybody else) don't know a way around this, I will see if I can get FreeBSD running (maybe emulate it?).
If I get it to work I will tell you, of course. Thanks a bunch so far, and if you stumble about interesting news don't hesitate to PM me or just answer here |
|
Back to top |
|
|
hermanng Apprentice
Joined: 28 Jan 2004 Posts: 175 Location: Nussberg,Germany,Earth
|
Posted: Sun Jan 08, 2006 9:07 pm Post subject: |
|
|
Jalmar, you might want to try some other link, this one built fine here:
http://www.users.bigpond.com/jolds/ularn_src_1_6_3a.tar.gz
This implementation gives you a choice of several interfaces, I used the traditional tty.
HTH,
Hermann _________________ Hermann |
|
Back to top |
|
|
hensan l33t
Joined: 26 Jun 2003 Posts: 868 Location: Sweden
|
Posted: Mon Jan 09, 2006 9:15 am Post subject: |
|
|
I managed to build the larn sources.
- Add -DNOVARARGS and -DSYSV to the build line in the Makefile, and remove -DBSD
- Edit signal.c and add #define SIGEMT 7 (I don't think Linux has a SIGEMT, so gcc complains it's undefined. A better solution might be to define it as a signal that linux does understand, but hey, at least it builds )
- Emerge libtermcap-compat.
I think that's all you need for it to work. I also fixed all the warnings about crap after #endif and #else statements, and the ones about externs declared as statics, but I think it should build even if you leave those alone. |
|
Back to top |
|
|
desultory Bodhisattva
Joined: 04 Nov 2005 Posts: 9410
|
Posted: Wed Jan 11, 2006 7:48 pm Post subject: |
|
|
As did I.
- It is fairly trivial to change the source to use stdarg.h instead of varargs.h and add a define flag to that effect.
- Commenting out the references to SIGEMT works too, signal.c is the only place SIGEMT is referenced.
- Linking against ncurses seems to work as well.
You might also need to change line 263 of monster.c to indicate that amt is of type int, also defining away register in header.h might be needed. It will build with the 'extra tokens' and "declared implicitly as 'extern' and later 'static'" warnings, gcc is smart enough to handle them properly. |
|
Back to top |
|
|
Jalmar n00b
Joined: 05 Nov 2005 Posts: 24
|
Posted: Sat Mar 18, 2006 10:32 pm Post subject: |
|
|
Hello once again!
Thanks for your last posts, I am a bit late to check up on them. I didn't manage to build ularn up until now, but I will try to do so tomorrow.
I must admit that I am quite a noob concerning editing makefiles and stuff, so please expect me to ask more questions.
Could you three tell me a little more detailed what you did in order to get it to compile? I tried the sources hermanng posted, but didn't succeed yet.
Thanks a lot for your help |
|
Back to top |
|
|
Jalmar n00b
Joined: 05 Nov 2005 Posts: 24
|
Posted: Sun Mar 19, 2006 12:01 pm Post subject: |
|
|
I made a few steps in the right direction!
I edited the makefile as hensan proposed, and the build goes on until it encounters an
exit(); in bill.c which I edited to exit(0);
After that, the compiler finds 3 errors in lines that all state
something=lrint(); (diag.c, Lines 314,345,355)
I found out that lrint() needs to take a double, but how do I know what to put in there |
|
Back to top |
|
|
desultory Bodhisattva
Joined: 04 Nov 2005 Posts: 9410
|
Posted: Tue Mar 21, 2006 1:06 am Post subject: |
|
|
Jalmar wrote: | I edited the makefile as hensan proposed, and the build goes on until it encounters an
exit(); in bill.c which I edited to exit(0); |
Expect more of those.
Jalmar wrote: | After that, the compiler finds 3 errors in lines that all state
something=lrint(); (diag.c, Lines 314,345,355)
I found out that lrint() needs to take a double, but how do I know what to put in there :?: |
What do you mean it takes a double? The function long lrint() takes no arguments and returns a long integer value derived from user input. Neither gcc nor tcc have any problem with that function here. |
|
Back to top |
|
|
Jalmar n00b
Joined: 05 Nov 2005 Posts: 24
|
Posted: Tue Mar 21, 2006 10:36 pm Post subject: |
|
|
Hey desultory
This is what I get after typing "make":
diag.c:315: error: too few arguments to function `lrint'
Code: gtime = lrint();
diag.c:346: error: too few arguments to function `lrint'
Code: initialtime = zzz-lrint();
diag.c:356: error: too few arguments to function `lrint'
Code: i = lrint(); /* inode # */
Do you have any idea what to do with those errors? |
|
Back to top |
|
|
desultory Bodhisattva
Joined: 04 Nov 2005 Posts: 9410
|
Posted: Wed Mar 22, 2006 5:25 am Post subject: |
|
|
Actually, I need to verify that we are looking at the same (or at least similar) code. According to the line numbers given in the error messages you posted you have an extra line in diag.c before 315, from the code quoted in the error messages I think you just split line 314, which had been:
diag.c, line 314: | lrfill((char*)&c[0],100*sizeof(long)); gtime = lrint(); |
If that is the case, so far as diag.c goes, we are looking at effectively the same code, which brings us to the problem. In the code I am looking at the following snippets constitute the declaration and definition of lrint, which as you can see takes no arguments.
header.h: | long paytaxes(),lgetc(),lrint(),time(); |
io.c: | long lrint()
{
register unsigned long i;
i = 255 & lgetc(); i |= (255 & lgetc()) << 8;
i |= (255 & lgetc()) << 16; i |= (255 & lgetc()) << 24;
return(i);
} |
So, at this point, it appears that the most suitable thing would be for you to post the corresponding code from your codebase, that is if they differ, as you logically can not give too few arguments to a function which takes none.
Also, mostly out of curiousity, what compiler are you using? |
|
Back to top |
|
|
Jalmar n00b
Joined: 05 Nov 2005 Posts: 24
|
Posted: Wed Mar 22, 2006 5:54 pm Post subject: |
|
|
Good evening!
desultory, you're right about that line I added to my source. And I just checked my io.c and header.h
We're for sure looking at the same code:
io.c
long lrint()
{
register unsigned long i;
i = 255 & lgetc(); i |= (255 & lgetc()) << 8;
i |= (255 & lgetc()) << 16; i |= (255 & lgetc()) << 24;
return(i);
}
header.h
long paytaxes(),lgetc(),lrint(),time();
I'm using gcc:
* sys-devel/gcc
Latest version available: 3.4.5-r1
Latest version installed: 3.4.5-r1
Well, this puzzles me a little.
I just tried "gcc *.*" in my Larn-directory, and it works without errors, while "make" doesn't. |
|
Back to top |
|
|
hermanng Apprentice
Joined: 28 Jan 2004 Posts: 175 Location: Nussberg,Germany,Earth
|
Posted: Wed Mar 22, 2006 11:05 pm Post subject: |
|
|
Jalmar wrote: | ... I tried the sources hermanng posted, but didn't succeed yet.... |
I did not change anything in the sources, just typed 'make -f makefile.tty' _________________ Hermann |
|
Back to top |
|
|
desultory Bodhisattva
Joined: 04 Nov 2005 Posts: 9410
|
Posted: Thu Mar 23, 2006 1:36 am Post subject: |
|
|
Despite the differences between using gcc under make and just running gcc, I am uncertain as to the reason for the failure to build under make.
If you are interested I could post a minimal effort patch (to clean sources) which seems to work, in part to see if it fails with your compiler. I am however unsure as to how the forum software will treat a patch, mostly so far as whitespace mangling. |
|
Back to top |
|
|
Darkael Veteran
Joined: 10 Aug 2004 Posts: 1321 Location: France
|
Posted: Thu Mar 23, 2006 2:26 am Post subject: |
|
|
Jalmar, what is the error you got when you tried the sources hermanng linked to? On my box, I just had to change one line of code for it to compile. And as hermanng said, you need to use one of the makefile.* files, copy one of them to Makefile and then type make, or alternatively use 'make -f makefile.xxx'. |
|
Back to top |
|
|
Jalmar n00b
Joined: 05 Nov 2005 Posts: 24
|
Posted: Thu Mar 23, 2006 7:19 am Post subject: |
|
|
Good morning!
@desultory:
A patch would be great if chances are it will make the source work Maybe you can put on some webspace, instead of pasting it here?
@KarnEvil, hermanng:
localhost ularn_src_1_6_3a # cp makefile.tty Makefile
localhost ularn_src_1_6_3a # make
gcc -Wall -I/usr/include/X11R6 -c ularn_wintty.c
ularn_wintty.c:1122: error: conflicting types for 'init_app'
ularn_win.h:222: error: previous declaration of 'init_app' was here
ularn_wintty.c:1122: error: conflicting types for 'init_app'
ularn_win.h:222: error: previous declaration of 'init_app' was here
ularn_wintty.c:78: warning: 'PIDName' defined but not used
ularn_wintty.c:1444: warning: 'get_string_input' defined but not used
make: *** [ularn_wintty.o] Error 1
This is what I get |
|
Back to top |
|
|
hermanng Apprentice
Joined: 28 Jan 2004 Posts: 175 Location: Nussberg,Germany,Earth
|
Posted: Thu Mar 23, 2006 10:23 am Post subject: |
|
|
Sorry, forgot this one, you need to make a small change in config.h . From Line 37 etc. it should look like Code: | #define UNIX_TTY
//#define UNIX_X11
//#define WINDOWS
//#define W32_TTY
//#define AMIGA_WIN |
_________________ Hermann |
|
Back to top |
|
|
Darkael Veteran
Joined: 10 Aug 2004 Posts: 1321 Location: France
|
Posted: Thu Mar 23, 2006 10:30 am Post subject: |
|
|
Yes, that's the one-line change I was talking about. The game should compile flawlessly now. |
|
Back to top |
|
|
Jalmar n00b
Joined: 05 Nov 2005 Posts: 24
|
Posted: Thu Mar 23, 2006 4:38 pm Post subject: |
|
|
Well, the Ularn-Sources provided by hermanng finally WORKED
Thanks a lot!
It would still be interesting to get those original *.Z - Sources running and see if there are big differences.
I will try with them a little more, and if you have suggestions about what my gcc might complain about (when there seems nothing to be worth complaining about...), please tell me |
|
Back to top |
|
|
|