Jump to content
IGNORED

Lynx programming on Linux?


Jim Leek

Recommended Posts

The newcc65 compiler (it is an old one despite the name) works like a dream on Linux.

 

Just unpack the newcc65 sources to your home directory.

 

export CC65INCLUDE=/home/lynx/newcc65/include

export CC65LIB=/home/lynx/newcc65/lib

export PATH=$PATH:/home/lynx/newcc65/bin

 

Then you need to compile the sources:

cd /home/lynx/newcc65/ra65

make

make install

cd ../cc65

make

make install

cd ../runtime

make

make install

cd ../libsrc

make

make install

cd ../libsrc/lynx

make

make install

 

You should also get sprpck for compressing the graphics from the BLL archive

cd ../../sprpck

make

make install

 

And sometimes it is convenient to use lyxass, the BLL toolkit, lynxer, Handy

- but that is another story...

 

I can email you the source packet with the latest versions of all the tools if

you have problems locating them.

 

Actually I am just now compiling the new cc65 compiler on a Debian laptop.

Shawn Jefferson did a wonderful work on porting 42Bastians modules to

the new mainstream cc65 compiler.

 

I hope to get the new cc65 working as it gives more precise control of where to

place the code in the Lynx memory space. And it should produce more compact

code.

 

--

Cheers,

 

Karri

Link to comment
Share on other sites

Dang, it was easy for you huh? I've been downloading it off of Basitian42's old page. Maybe the secret is in compiling ra65 first and seperately doing make; make install in each directory? In just running make install I've just been getting piles of "warning: function strlen implicitly defined in xxx.c", and then the linker dies on an undefined reference. I've tried a few things, but I'll try your advice out when I get home from work today. Thanks a lot.

 

If I have any trouble I'll ask for your sources, just incase I'm getting something wrong. :P

 

Just out of curiousity, I'm rather new around here, are you working some Lynx development?

Link to comment
Share on other sites

Hey, what version of gcc are you using? I'm using gcc 3.3.3-7. I've got a sneaky suspicion that maybe the library changes recently may have messed this stuff up. I can get a few things to compile by adding in "#include " but I haven't figured out what's up with this problem:

 

gcc -s -O3 -Wall -ffast-math -fomit-frame-pointer -o xopt xopt.cc

/tmp/ccSvVfEY.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'

collect2: ld returned 1 exit status

Link to comment
Share on other sites

Man, I feel like I'm talking to myself. :P Anyway, I've gotten a little farther. I found out:

 

Yes, newcc65 does NOT compile under gcc 3.3.3, you need gcc 2.95. After that, you may need to:

 

add #include to ra65/parse.h

int the cc65/makefile change ~/bin -> ../bin

 

I still haven't gotten it to compile the libraries, but I did get cc65 and ra65 to compile, which is progress! But now I have to go back to work

Link to comment
Share on other sites

Has anyone tried programming for the Lynx on Linux?  I've been thinking about starting to do some Lynx programming, but I don't run windows anymore, just Linux.  So far, I haven't had much luck getting the cc65 compiler to build under Linux.  Any ideas?

 

Fast solution (which I used for some time):

Use the win binaries under wine.

Link to comment
Share on other sites

Hey guys!

 

I was away for a few days with my Debian laptop playing around with

the new compiler from www.cc65.org. I LOVE IT!!! It is the best invention

since sliced bread!

 

Shawn had made a very good porting work for the lynx libraries and I

was able to compile my old stuff with just some minor modifications.

 

The BIG thing is the produced code. It is just incredibly small. The old

C-compiler had 1500 bytes of dead weight hanging around all the time.

 

This new one only takes along what is absolutely necessary.

It is a joy to read the assembler listing as you understand exactly why

every instruction is there. The output of the compiler is actually

readable.

 

I ported my abcmusic to it yesterday and a small struct like

 

struct {

unsigned char a,b,c;

void *next, *bitmap;

int posx,posy,sizex,sizey;

unsigned char palette[8];

} sprite_t;

 

spite_t Sbackground = {

0xc0,0x10,0x20,

&Somesprite,&Somebitmap,

0,0,0x100,0x100,

{0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef}

};

 

produced

 

_Sbackground:

.byte $c0, $10, $20

.addr _Somesprite

.addr _Somebitmap

...

 

Besides it allows prototypes in definitions. It also has a macro assembler

that can be used as standalone. With some work it might actually be

able to handle even BLL-sources.

 

I know that Shawn has not released the lynx stuff yet as this is work in

progress. But I am sure he won't mind if people start using them as

they work quite well already.

 

Compiling this requires something like:

 

tar xjf cc65-sources-2.10.1.tar.bz2

cd cc65-2.10.1

sudo make -f make/gcc.make install

 

Of course you can just do a

make -f make/gcc.make

first to see that everything works.

 

Then you need to get the Lynx-dependent part.

Goes into libsrc/lynx.

 

And you need to modify a bunch of files telling you what a

target -t lynx and a memory configuration -C lynx.cfg looks like.

 

I have done all these and have plans to run

diff -urN cc65-2.10.1.orig cc65-2.10.1.lynx > lynxpatch

 

Then you could patch your compiler by

cd cc65-2.10.1

patch -p0 < lynxpatch

 

So skip the newcc65 and move to latest_and_greatest_cc65

 

--

Karri

Link to comment
Share on other sites

So does someone have a nice copy of the latest compiler with the Lynx ports? Perhaps the CC65.org people will host it or at least link it? The link on Bastian's site does not appear to be updated.

 

Hey, what's the deal with Lynxass.exe? Is that an assembler? Are there any sources or docs for that floating around? One of the things I like about the newcc65 package is the source code -- if I have any questions about how something works I can always go to the source.

 

Eric

 

PS: OK, I got busy with work and my game isn't going to make it for this year's minigame competition. There's always next year. I'd still like to find the time to finish a large version by Philly Classic. Maybe my wife will let me take my laptop on vacation this year.

Link to comment
Share on other sites

Hi Karri,

 

I'm glad that someone is using the www.cc65.org version of the lynx library. Did you create a new header file with all the old library function names?

 

I got to the point where I figured all that needed to be done was to add prototypes for the original function names, write up some documentation and petition Ullrich to add lynx support officially to cc65.

 

Also, the library needs to be packaged up properly with proper makefiles (never did really get a good handle on those... maybe it's about time.)

 

--

Shawn Jefferson

Link to comment
Share on other sites

I just recompiled the newcc65 from the sources with gcc 2.95.4-14.

 

The following order worked fine:

cd newcc65

export CC65INCLUDE=`pwd`/include

export CC65LIB=`pwd`/include

export PATH=$PATH:`pwd`/bin

cd ra65

make

make install

cd ../cc65

make

make install

cd ../runtime

make

make install

cd ../libsrc

make

make install

cd lynx

make

make install

 

Then I also compiler sprpck from the BLL archive. And lyxass. And lynxer.

All these I install into newcc65/bin for convenience.

 

I already emailed the sources to jim.

 

I also compiled the stuff on a Windows machine and put the binaries on

sipo.fi/winlynx.zip

 

Well... Actually the file I emailed to Jim is there also as

sipo.fi/lynxdev.tar.gz

 

--

Karri

 

PS. Hi Shawn!

 

I created all the Makefiles for the new compiler, but I did not create

any new header files. I took the one you made in the test directory.

They worked just fine.

 

Of course we should perhaps create more functions to be compatible

with the other platforms at some time. But now the current Lynx

developement can work using the same subroutines that the old

(newcc65) was having.

 

By the way... Your fade-routines and sample-routines look cool.

I will probably use them.

 

If it is OK with you I could release a pre-made tarball with everything

in place on sipo.fi ?

 

--

Cheers,

 

Karri

Link to comment
Share on other sites

Thanks for the info. I just downloaded a nightly snapshot and compiled. Unfortunatly my wife is eyeing me to goto bed, so no more playing with it tonight.

 

One question though, where can I get all the newest Lynx libraries? Or are Bastian42''s as new as they get?

 

ALso, thanks for sending me the old tools Kerri. If there's a need, I would be willing to set up a website to host them.

Link to comment
Share on other sites

By the way... Your fade-routines and sample-routines look cool. I will probably use them.

 

The fade routines are mine, but the sample routines are (I think) Bastian's. I don't know if they work properly, since there is no documentation on getting samples to work anywhere, and I haven't figured it out yet.

 

If it is OK with you I could release a pre-made tarball with everything in place on sipo.fi ?

 

Sure! I will eventually write up some documentation and put it on a website for people to download though. In the meantime, you can get this version out there.

 

PS. Just to make it clear, this is largely Bastian's and others work, all I did was make some changes to allow it to work with www.cc65.org version of cc65.

Link to comment
Share on other sites

I made a tar-file of my compiled cc65 lynxified compiler to

sipo.fi/cc65-lynx.tar.gz

 

I also put the sources into my local cvs. You can retrieve the latest version from

 

export CVSROOT=:pserver:anonymous@sipo.fi:/home/lynx/cvs

cvs login

(password th6dxx)

cvs co cc65-lynx

 

In this way you can easily get the latest changes later by just

cd cc65-lynx

cvs update

 

--

karrri

Link to comment
Share on other sites

Eric,

 

The lyxass sources are also in my sipo.fi/lynxdev.tar.gz

 

I just don't remember anymore where I got these from...

 

Oh. And the cc65-lynx stuff is the cc65-2.10.1 modified by

Shawn and me. And naturally everything is based on the

nice guys at www.cc65.org and people who have contributed

to newcc65 (Bastian, Harry, Matthias etc...........)

 

--

Cheers,

 

Karri

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...