It is currently Sun Jun 16, 2019 12:07 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Trouble with nes.lib
PostPosted: Mon Mar 25, 2019 6:33 pm 
Offline

Joined: Mon Mar 25, 2019 10:58 am
Posts: 13
I'm in NESICIDE and i'm trying to test-compile Alter Ego but the nes.lib, according to the log, says the add.o is at a different version or something. I tried downloading a new library but now the error comes up as:
Code:
ld65: Error: Wrong data version in 'nes.lib'

If anyone knows how to deal with this, please let me know.


Top
 Profile  
 
 Post subject: Re: Trouble with nes.lib
PostPosted: Mon Mar 25, 2019 6:45 pm 
Offline
User avatar

Joined: Tue Jun 24, 2008 8:38 pm
Posts: 2299
Location: Fukuoka, Japan
My guess would be that alter ago, since it's was released a long time ago, is using a version of neslib compiled with a older version of cc65. Since there is a good chance that NESICIDE is using a more recent version, you will need to compile neslib yourself. I remember having such issues at first when trying to use Shiru's example with the latest version (2.17) of cc65 when the examples were targeted for, hmm, 2.14 I think.


Top
 Profile  
 
 Post subject: Re: Trouble with nes.lib
PostPosted: Mon Mar 25, 2019 7:28 pm 
Offline

Joined: Mon Mar 25, 2019 10:58 am
Posts: 13
Banshaku wrote:
My guess would be that alter ago, since it's was released a long time ago, is using a version of neslib compiled with a older version of cc65. Since there is a good chance that NESICIDE is using a more recent version, you will need to compile neslib yourself. I remember having such issues at first when trying to use Shiru's example with the latest version (2.17) of cc65 when the examples were targeted for, hmm, 2.14 I think.

Question is how do I compile a neslib? Do i just stick it through ca65 or ld65 or do i just put it through a special compiler?


Top
 Profile  
 
 Post subject: Re: Trouble with nes.lib
PostPosted: Mon Mar 25, 2019 8:05 pm 
Offline
User avatar

Joined: Tue Jun 24, 2008 8:38 pm
Posts: 2299
Location: Fukuoka, Japan
It depends what nes.lib represents in that case. The last time I checked those sample it was almost a year ago so my memory is quite fuzzy about it. I think in that case it would be the C runtime, which you need to rebuild with ca65/cc65, which is not obvious is you just started worked on the nes or have never worked with cc65 directly.

I will check what was nes.lib for alter ego and let you know later.

edit:

I confirmed and nes.lib is the C runtime and alter ago provides a version for cc65 he used at the time. You will need to rebuild that file, which I did once and is a barebone set of the C library but I don't have the commands in front of me to do it. There was a sample I shared last year on nesdev that should allow to re-create it and may contain the sample with it. I will see if I can find the link and add it to this post later.

edit2:

This post contain a makefile with example1.c from Shiru's samples:
viewtopic.php?f=2&t=17467

It should work under linux/macos and once compiled, it should create the example and runtime. CC65 needs to be in your path, if not, just update the paths inside the makefile.

Instead of nes.lib, it will create a file called runtime.lib which you should be able to rename to nes.lib and use with alter ego sample.


Top
 Profile  
 
 Post subject: Re: Trouble with nes.lib
PostPosted: Tue Mar 26, 2019 7:15 am 
Offline
NESICIDE developer
User avatar

Joined: Mon Oct 13, 2008 7:55 pm
Posts: 1089
Location: Minneapolis, MN
radishking27 wrote:
Question is how do I compile a neslib? Do i just stick it through ca65 or ld65 or do i just put it through a special compiler?

If I recall, the changes Shiru made to the lib weren't API-breaking thus the original nes.lib that comes with cc65 toolchain "works".
I also found that the libs built with the latest toolchain have a segment called ONCE that looks to have replaced the segment called INIT. Modifying the nes.cfg linker script in this regard, and removing the nes.lib from the project (to force it to use the one that comes with the toolchain) leads to a successful build and run of AlterEgo in nesicide.

I've uploaded the modified AlterEgo project here.
I'll have to dig to find out what Shiru changed in the nes.lib, but the game runs.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 3 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group