Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[WANTED] Caverns of Larn - Old game like moria or nethack
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Gamers & Players
View previous topic :: View next topic  
Author Message
Jalmar
n00b
n00b


Joined: 05 Nov 2005
Posts: 24

PostPosted: Fri Jan 06, 2006 3:14 pm    Post subject: [WANTED] Caverns of Larn - Old game like moria or nethack Reply with quote

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 :P )

Infos are really much appreciated!
Back to top
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Fri Jan 06, 2006 6:51 pm    Post subject: Reply with quote

Have a look at: http://roguelikes.sauceforge.net/pub/larn/.
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20090

PostPosted: Fri Jan 06, 2006 7:03 pm    Post subject: Reply with quote

Moved from Other Things Gentoo
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
Jalmar
n00b
n00b


Joined: 05 Nov 2005
Posts: 24

PostPosted: Fri Jan 06, 2006 7:42 pm    Post subject: Reply with quote

Thanks desultory for your link :D

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 :D
Back to top
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Fri Jan 06, 2006 10:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
hensan
l33t
l33t


Joined: 26 Jun 2003
Posts: 868
Location: Sweden

PostPosted: Fri Jan 06, 2006 11:47 pm    Post subject: Reply with quote

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
View user's profile Send private message
Jalmar
n00b
n00b


Joined: 05 Nov 2005
Posts: 24

PostPosted: Sat Jan 07, 2006 12:29 am    Post subject: Reply with quote

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 :P
Back to top
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Sat Jan 07, 2006 8:32 pm    Post subject: Reply with quote

To get the sources extracted and patched:

  1. Place all of the part*.Z and patch*.Z into an otherwise empty directory.
  2. Change to that directory in a terminal.
  3. 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.
  4. 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
View user's profile Send private message
Jalmar
n00b
n00b


Joined: 05 Nov 2005
Posts: 24

PostPosted: Sun Jan 08, 2006 12:01 am    Post subject: Reply with quote

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 :D
Back to top
View user's profile Send private message
hermanng
Apprentice
Apprentice


Joined: 28 Jan 2004
Posts: 175
Location: Nussberg,Germany,Earth

PostPosted: Sun Jan 08, 2006 9:07 pm    Post subject: Reply with quote

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
View user's profile Send private message
hensan
l33t
l33t


Joined: 26 Jun 2003
Posts: 868
Location: Sweden

PostPosted: Mon Jan 09, 2006 9:15 am    Post subject: Reply with quote

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 :wink:)
- 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
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Wed Jan 11, 2006 7:48 pm    Post subject: Reply with quote

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
View user's profile Send private message
Jalmar
n00b
n00b


Joined: 05 Nov 2005
Posts: 24

PostPosted: Sat Mar 18, 2006 10:32 pm    Post subject: Reply with quote

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 :!: :D
Back to top
View user's profile Send private message
Jalmar
n00b
n00b


Joined: 05 Nov 2005
Posts: 24

PostPosted: Sun Mar 19, 2006 12:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Tue Mar 21, 2006 1:06 am    Post subject: Reply with quote

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
View user's profile Send private message
Jalmar
n00b
n00b


Joined: 05 Nov 2005
Posts: 24

PostPosted: Tue Mar 21, 2006 10:36 pm    Post subject: Reply with quote

Hey desultory :D

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
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Wed Mar 22, 2006 5:25 am    Post subject: Reply with quote

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
View user's profile Send private message
Jalmar
n00b
n00b


Joined: 05 Nov 2005
Posts: 24

PostPosted: Wed Mar 22, 2006 5:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
hermanng
Apprentice
Apprentice


Joined: 28 Jan 2004
Posts: 175
Location: Nussberg,Germany,Earth

PostPosted: Wed Mar 22, 2006 11:05 pm    Post subject: Reply with quote

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
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Thu Mar 23, 2006 1:36 am    Post subject: Reply with quote

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
View user's profile Send private message
Darkael
Veteran
Veteran


Joined: 10 Aug 2004
Posts: 1321
Location: France

PostPosted: Thu Mar 23, 2006 2:26 am    Post subject: Reply with quote

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
View user's profile Send private message
Jalmar
n00b
n00b


Joined: 05 Nov 2005
Posts: 24

PostPosted: Thu Mar 23, 2006 7:19 am    Post subject: Reply with quote

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
View user's profile Send private message
hermanng
Apprentice
Apprentice


Joined: 28 Jan 2004
Posts: 175
Location: Nussberg,Germany,Earth

PostPosted: Thu Mar 23, 2006 10:23 am    Post subject: Reply with quote

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
View user's profile Send private message
Darkael
Veteran
Veteran


Joined: 10 Aug 2004
Posts: 1321
Location: France

PostPosted: Thu Mar 23, 2006 10:30 am    Post subject: Reply with quote

Yes, that's the one-line change I was talking about. The game should compile flawlessly now.
Back to top
View user's profile Send private message
Jalmar
n00b
n00b


Joined: 05 Nov 2005
Posts: 24

PostPosted: Thu Mar 23, 2006 4:38 pm    Post subject: Reply with quote

Well, the Ularn-Sources provided by hermanng finally WORKED :P

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 :D
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gamers & Players All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum