cc65 config files for mid-range setups?

You need an actual VIC.

Moderator: Moderators

Post Reply
The Geek on Skates
Vic 20 Drifter
Posts: 33
Joined: Fri Jul 12, 2019 6:11 am
Website: http://www.geekonskates.com
Occupation: Code Monkey

cc65 config files for mid-range setups?

Post by The Geek on Skates »

Hey, hope you guys are having a great weekend so far! :)

So I'm building a game, and originally I was thinking target the full 40K (cuz why not?). I'm building it in C using cc65 (and the 35K .cfg file), but it turns out I might be able to get it working less RAM than that (making it available to more players). But cc65 only comes with two config files for the VIC: unexpanded or the whole enchilada. There isn't one for +3K, +8K, +16K, +24K or +32K. At least, none that come with cc65 "out of the box".

And as hard as I've tried to crack their config file language, make sense of it to where I could actually write my own, the truth is there are so many variables I have no idea what I'm doing. That super-advanced configurability is great for those who understand it, cuz it makes it possible to target tons of different 8-bit systems that way, but for us mere mortals it's clear as mud. The cc65 docs are very thorough, but they're more like encyclopedia-style reference than beginner-friendly tutorials (or even examples - there are like none!). Now please don't get me wrong - I love cc65! cc65 is awesome! And I love that I don't have to DIY every little detail in Assembly (math stuff, string stuff, etc.) to build a decent game. I'm not knocking their hard work by any means. But sadly, having a day job means I can't spend all my time pouring over reference material and/or their source code in hopes of eventually arriving at some kind of understanding. Their docs just seem to assume you already know what you're doing, and their config system is the ultimate example.. I know C well but had to learn cc65 through trial and error and countless hours of tinkering. Little things like how in the early days of the language, variables had to be declared before anything else in functions (and in all fairness, Borland Turbo C in DOS had that rule as well - apparently it was the ISO '89 standard or something). And eventually I stumbled across their "coding best practices" page, which helped a lot, but because it's structured reference-style I just happened to find it by accident one day. I've often thought of contributing some tutorials/examples, to help other newcomers start their own retro journey. :)

Okay, sorry, I got way off on a tangent there. My question is, does anyone here know how to target something other than the unexpanded or fully-expanded VIC? Like is there a resource somewhere with config files for each setup somewhere? Or is it just common knowledge that you can use the first config file up to so much, and the other one for everything else? I'm guessing someone on their dev team comes here often (cuz let's face it, this is hand-down the best place to go for all things Vic-20 :) ) and has answer questions like this a bazillion times. But if not, thanks just the same! :)
User avatar
beamrider
Vic 20 Scientist
Posts: 1452
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: cc65 config files for mid-range setups?

Post by beamrider »

8/16/24 configs are all the same, just set the size of the block appropriately

Code: Select all

    # Main program area (8K expansion) BLOCK RAM1/RAM2/RAM3
    RAM1: start = $2000, size = $2000, type = rw, file = %O;
or
    # Main program area (16K expansion) BLOCK RAM1/RAM2/RAM3
    RAM1: start = $2000, size = $4000, type = rw, file = %O;
or
    # Main program area (24K expansion) BLOCK RAM1/RAM2/RAM3
    RAM1: start = $2000, size = $6000, type = rw, file = %O;
The Geek on Skates
Vic 20 Drifter
Posts: 33
Joined: Fri Jul 12, 2019 6:11 am
Website: http://www.geekonskates.com
Occupation: Code Monkey

Re: cc65 config files for mid-range setups?

Post by The Geek on Skates »

Wow, that's all there is to it? That's awesome! :)

I once decided to build my own 8-bit-OS-in-a-browser (kind of like the Commander X16 project, except idk what I'm doing w/hardware so it's just an "emulator"). I spent waaaaay too much time trying to understand cc65's config language so I'd be able to compile C code for that system. My "plan B" ended up being to use -t none and only peekpoke.h and others that don't require a memory map (which worked). But for a system that actually exists - and one as amazing and beloved as the Vic - I was sure someone had already cracked it. I just had no idea it would be so easy! Thank you. :)
Post Reply