It is currently Fri Jun 22, 2018 7:47 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: cc65 compiling
PostPosted: Sun Jun 10, 2018 8:47 am 
Online
User avatar

Joined: Tue Jun 24, 2008 8:38 pm
Posts: 1541
Location: Fukuoka, Japan
Included, the basic runtime that I'm using with 2.17. The other file (runtime.lst) list which files are included. I think I'm almost using the same thing as Shiru.

Once my makefile is finished, I will release it and you will be able to build the runtime anytime you want. For now I don't like that it uses a copy in a specific folder so I want to retrieve specifics files from the cc65 folder if the version gets updated some day.

That make file will even compile your project once a few specific files are set in the lib folder (neslib/famitone) and in the src folder (your c/s files and crt files). I want to make it so that even if you use a specific neslib/famitone/crt that it still can compile some generic project. It should help for people that want to start C like project (which I'm in the same situation right now).

Will share it soon, once I find it good enough. For now, I will try to help you figure out your current issues until it is available.


Attachments:
runtime.lst.zip [716 Bytes]
Downloaded 3 times
runtime.lib.zip [45.24 KiB]
Downloaded 3 times
Top
 Profile  
 
 Post subject: Re: cc65 compiling
PostPosted: Sun Jun 10, 2018 8:08 pm 
Offline

Joined: Fri Jun 08, 2018 6:48 pm
Posts: 8
Now that I switched to nes.lib, I'm getting a different error:

ld65 -C nes.cfg -o example1.nes crt0.o example1.o nes.lib
ld65: Error: Missing memory area assignment for segment `ONCE'

The only leads I have to follow are to search all the files for ONCE and try to
figure out what's going on with it.

I welcome any suggestions for finding some complete example code to start
working with and modifying


Top
 Profile  
 
 Post subject: Re: cc65 compiling
PostPosted: Sun Jun 10, 2018 10:57 pm 
Online
User avatar

Joined: Tue Jun 24, 2008 8:38 pm
Posts: 1541
Location: Fukuoka, Japan
Like mentioned before, I’m working on making a sample Makefile that should make it easier to create simple c projects with the latest runtime.

I just finished an example based of Shiru’s example1.c and added some code to test famitone inside it.

It should be usable in it’s current state. Except for example.c and the cfg files, other files were not modified (crt0, neslib, famitone) since it would be a common cause of bugs if some file a refreshed with the current examples.

Librsc folder contains the latest files from cc65 (2.17) so it can be tested right away. You just call make from root folder and everything should be compiled. It is possible to compile/clean the runtime only when required.

The files may be removed at a later stage if there is some issues to include it in a personal project. It is possible to use the currently installed lbsrc on your computer by modifying the Makefile accordingly.

There is not much doc with it for now but I think the Makefile should be quite a time saver. It took me time to make it but I’m more than happy to share it if it can helps people use the latest runtime.

Since I had the same issues to make it work with the latest version, I understand how it feels when nothing compiles with no obvious reason why it failed and you don’t know yet the tool chain.

It’s a work in progress but any comments on possible issues is always appreciated.


Attachments:
example.zip [249.46 KiB]
Downloaded 5 times
Top
 Profile  
 
 Post subject: Re: cc65 compiling
PostPosted: Mon Jun 11, 2018 7:21 am 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 2092
Location: DIGDUG
Copied from a .cfg file that I use...notice the 'ONCE' segment.


SEGMENTS {
HEADER: load = HEADER, type = ro;
STARTUP: load = PRG, type = ro, define = yes;
LOWCODE: load = PRG, type = ro, optional = yes;
INIT: load = PRG, type = ro, define = yes, optional = yes;
CODE: load = PRG, type = ro, define = yes;
RODATA: load = PRG, type = ro, define = yes;
DATA: load = PRG, run = RAM, type = rw, define = yes;
CHARS: load = CHR, type = rw;
BSS: load = RAM, type = bss, define = yes;
HEAP: load = RAM, type = bss, optional = yes;
ZEROPAGE: load = ZP, type = zp;
ONCE: load = PRG, type = ro, define = yes;

VECTORS: load = PRG, start = $fffa, type = ro;
}



you could also write it as...

ONCE: load = PRG, type = ro, define = yes, optional = yes;

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
 Post subject: Re: cc65 compiling
PostPosted: Mon Jun 11, 2018 7:46 am 
Online
User avatar

Joined: Tue Jun 24, 2008 8:38 pm
Posts: 1541
Location: Fukuoka, Japan
The once segment is something they added around 2.14 and is now mandatory if my memory is good. Since Shiru's example where done with 2.11, this segment was not defined in the examples.

edit:

this segment is used for constructors. Since I do not define any, this segment is not in any file and should cause no issue. It just the config file that seems to nags you if you don't define it.

edit2:

@dougeff

Since you did some C tutorials, I would like to know if you think the make file I did is useful for beginners or not. I think it is since you just create you files (.s or .c) in src and it will compile them automatically.


Top
 Profile  
 
 Post subject: Re: cc65 compiling
PostPosted: Mon Jun 11, 2018 7:56 am 
Offline

Joined: Fri Jun 08, 2018 6:48 pm
Posts: 8
It compiled. Thanks everyone. I can start figuring out how to make changes now.


Top
 Profile  
 
 Post subject: Re: cc65 compiling
PostPosted: Mon Jun 11, 2018 10:29 am 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 2092
Location: DIGDUG
Quote:
Since you did some C tutorials, I would like to know if you think the make file I did is useful for beginners or not. I think it is since you just create you files (.s or .c) in src and it will compile them automatically.


I think it will be useful. Yes. I'm always thinking about changing my tutorial, so it is good for me to see other people write source code.

Maybe one day I should collaborate with you or na_th_an or cppchriscpp to write some better example code.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 2 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