A Couple of ca65/ld65 Templates

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

Post Reply
User avatar
segaloco
Posts: 293
Joined: Fri Aug 25, 2023 11:56 am
Contact:

A Couple of ca65/ld65 Templates

Post by segaloco »

Been cleaning up my workspace in prep for a potential shift to a RISC-V board I'm tinkering with and decided to upload some boilerplate from my templates folder, just stuff I keep around to keep from starting from an empty folder every time.

Included are a couple Famicom/NES relevant bits: https://gitlab.com/segaloco/templates/- ... type=heads

After the link are NROM and FDS templates for building a skeletal version of each. When I say skeletal I mean the FDS template doesn't even include setting the warm boot flags, these are blank canvases. Despite the README therein saying you're on your own, if someone here happens to get use out of these but has a nit to pick, I'll happily commit improvements or accept pull requests. The FDS stuff does depend on my disk mastering tools, they're linked as a submodule therein so if cloning be sure to recurse submodules.

The parent repo will accrete stuff as time goes on, I've been really bad about starting from a blank document in an empty folder almost every time I spin something up, so trying to get more in the habit of avoiding boilerplate where I've got my settled patterns. Where IDE integrations are present, they are for VSCode, as that is pretty much all I use these days. However, all builds are based on relatively spartan makefiles, so hopefully integration with an editor/environment of choice isn't difficult.

Have fun, make cool things! You obviously don't have to credit me but I'd love stories of anything with this as ground zero.
ninja_kun
Posts: 14
Joined: Fri Jun 17, 2022 5:02 am

Re: A Couple of ca65/ld65 Templates

Post by ninja_kun »

Thanks, this is helpful!

When I try to make the fds template I get an error though:

Code: Select all

~/code/templates/nes/fds$ make
cp data/kyodaku_.bin kyodaku_.bin
cp: cannot stat 'data/kyodaku_.bin': No such file or directory
make: *** [Makefile:53: kyodaku_.bin] Error 1
What is kyodaku_.bin and where can I get it from?
Pokun
Posts: 2772
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: A Couple of ca65/ld65 Templates

Post by Pokun »

It's the KYODAKU-file which must be included on each FDS disk or the BIOS won't boot it. It's 224 byte and contains the text data for the initial splash screen that comes scrolling down when loading an FDS image.

Here is the valid data in asm6 syntax:

Code: Select all

;File 0 "KYODAKU-"

  .hex 24 24 24 24 24 24 24 24 24 24 24 17 12 17 1D 0E
  .hex 17 0D 18 24 28 24 24 24 24 24 24 24 24 24 24 24
  .hex 24 24 24 24 24 24 24 0F 0A 16 12 15 22 24 0C 18
  .hex 16 19 1E 1D 0E 1B 24 1D 16 24 24 24 24 24 24 24
  .hex 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
  .hex 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
  .hex 24 24 1D 11 12 1C 24 19 1B 18 0D 1E 0C 1D 24 12
  .hex 1C 24 16 0A 17 1E 0F 0A 0C 1D 1E 1B 0E 0D 24 24
  .hex 24 24 0A 17 0D 24 1C 18 15 0D 24 0B 22 24 17 12
  .hex 17 1D 0E 17 0D 18 24 0C 18 27 15 1D 0D 26 24 24
  .hex 24 24 18 1B 24 0B 22 24 18 1D 11 0E 1B 24 0C 18
  .hex 16 19 0A 17 22 24 1E 17 0D 0E 1B 24 24 24 24 24
  .hex 24 24 15 12 0C 0E 17 1C 0E 24 18 0F 24 17 12 17
  .hex 1D 0E 17 0D 18 24 0C 18 27 15 1D 0D 26 26 24 24

;Translates to this in SMB/Zelda encoding:
;"           NINTENDO R           "
;"       FAMILY COMPUTER TM       "
;"                                "
;"  THIS PRODUCT IS MANUFACTERED  "
;"  AND SOLD BY NINTENDO CO,LTD.  "
;"  OR BY OTHER COMPANY UNDER     "
;"  LICENSE OF NINTENDO CO,LTD..  "
I guess you have to enter the 224 bytes into a binary file and save it as "kyodaku_.bin".
Post Reply