Troubles when planning to make a FDS template with CA65

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

User avatar
rainwarrior
Posts: 7669
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Troubles when planning to make a FDS template with CA65

Post by rainwarrior » Fri Apr 14, 2017 12:12 am

Edit: this example now lives at Github. This post below will be left intact for posterity, but please find the latest version of this example here: GitHub repository


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 343 times
Last edited by rainwarrior on Thu Apr 04, 2019 3:28 pm, edited 4 times in total.

Pokun
Posts: 1269
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Troubles when planning to make a FDS template with CA65

Post by Pokun » Fri Apr 14, 2017 12:44 am

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.

User avatar
rainwarrior
Posts: 7669
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Troubles when planning to make a FDS template with CA65

Post by rainwarrior » Fri Apr 14, 2017 12:54 am

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 350 times
Last edited by rainwarrior on Fri Sep 22, 2017 10:56 pm, edited 2 times in total.

Pokun
Posts: 1269
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Troubles when planning to make a FDS template with CA65

Post by Pokun » Fri Apr 14, 2017 1:26 am

I see, thanks for the example!

User avatar
rainwarrior
Posts: 7669
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Troubles when planning to make a FDS template with CA65

Post by rainwarrior » Tue May 02, 2017 1:24 pm

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.)


This is now maintained at GitHub: https://github.com/bbbradsmith/NES-ca65 ... e/tree/fds


The original version is still attached to this post below.

edit: examples updated to prevent accidental clearing of BIOS variables at $F9-$FF
Attachments
example_fds_skip_license.zip
(8.39 KiB) Downloaded 366 times

Post Reply