It is currently Tue Dec 12, 2017 3:00 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 20 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Fri Apr 14, 2017 12:12 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5891
Location: Canada
Here's a modified version of my simple ca65 example program to run on FDS.

Rather than trying to do everything with CA65/LD65, it uses ca65/ld65 to assemble a binary file and then creates the FDS with a python (3) script.

While you could technically just build the file in ca65/ld65, it feels a lot more sensible just to assemble the FDS with a secondary tool. I might make a third version just to demonstrate how to do it in ca65/ld65 alone though.


edit: eventually reconsidered that maybe an external python script wasn't that great either, and would recommend instead the version below that skips the license (or the ca65 only version just above it if you want to keep the license for some reason). keeping this uploaded here for posterity, though, just in case it's wanted.


Attachments:
example_fds.zip [8.3 KiB]
Downloaded 16 times


Last edited by rainwarrior on Fri Sep 22, 2017 11:02 pm, edited 3 times in total.
Top
 Profile  
 
PostPosted: Fri Apr 14, 2017 12:44 am 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 919
Location: Sweden
Why is this hard to do in ca65? And why does it make more sense to use an additional tool for it?
To me it sounds like it would be better if the assembler could do it without outside help.


Top
 Profile  
 
PostPosted: Fri Apr 14, 2017 12:54 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5891
Location: Canada
Here's the ca65/ld65 only version, demonstrating that you can in fact do it without any additional tools.

Pokun wrote:
Why is this hard to do in ca65? And why does it make more sense to use an additional tool for it?
To me it sounds like it would be better if the assembler could do it without outside help.

I don't think it's "hard", you can look at the example I am posting now to see exactly how it looks.

I just think it's easier to work with an external tool than write all the extra boilerplate in the ca65 stuff. You could make some of it cleaner with macros, but the config files have to be the way they are. Though maybe it's just me, already having python installed and ready to go, and used to just using it to write quick/simple tools whenever I need them. Admittedly it's not really a big difference either way.


Attachments:
example_fds_ca65_only.zip [7.89 KiB]
Downloaded 21 times


Last edited by rainwarrior on Fri Sep 22, 2017 10:56 pm, edited 2 times in total.
Top
 Profile  
 
PostPosted: Fri Apr 14, 2017 1:26 am 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 919
Location: Sweden
I see, thanks for the example!


Top
 Profile  
 
PostPosted: Tue May 02, 2017 1:24 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5891
Location: Canada
Using the technique described here, I've made a third version of the example that skips the license screen.

This is convenient because it makes the startup sequence a few seconds faster, but also prevents your program from lying to the user about a license from Nintendo. ;)

(This is built upon the second "ca65 only" example above.)


edit: examples updated to prevent accidental clearing of BIOS variables at $F9-$FF


Attachments:
example_fds_skip_license.zip [8.39 KiB]
Downloaded 17 times
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ]  Go to page Previous  1, 2

All times are UTC - 7 hours


Who is online

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