Any good tutorials on "advanced cc65"?

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

Any good tutorials on "advanced cc65"?

Post by The Geek on Skates »

Hey guys,

I've been trying to figure out some of the more advanced features of cc65. I know c well, but my Assembly skills are... well, let's just say "intermediate at best". I've been all over the documentation, and while I understand most of it, I have tons of questions. API docs are critical, and cc65's are amazing, but they're more like encyclopedia-style reference material than a step-by-step walkthrough of how stuff works. I've been using cc65 for about 2 years now, and I've barely scratched the surface of what it can do. Most of the YouTube videos I've seen are either Hello World stuff or demos for other platforms (mostly the NES and C64 lol).

Like okay, they allocate 1k for a C stack; this made sense at first, because every time you do

Code: Select all

int x;
or

Code: Select all

const char data[] = {255, 128, 42...};
that memory would be allocated on the stack (as opposed to the heap where you're doing your own memory management). But at one point I hit a RAM limit on the game I'm building, and in my custom config file, I kept making the stack smaller and smaller, and currently it's at 0. I have plenty of RAM to finish my game, and that's great, but how? Why? It doesn't make sense, because logically, all my variables are on the stack (or would be on a modern system); I didn't #include <stdlib.h> and do a bunch of malloc/realloc/free calls. Am I confusing heap and stack here, or what?

And unfortunately that's just the tip of the iceberg. I could go on and on and on. Like reading joysticks - what's this about "drivers"? The library I'm writing, "Awesome20", does it with PEEK and POKE calls, but there are no drivers on a VIC-20 afaik. Oh and here's a good one: If I take that program (or any program I write with redefined characters) and compile it with the 32k config file, the code compiles but there are bizarre bugs at runtime (data for graphics and sound routines, that I marked "const", gets overwritten). Then there are subjects like file I/O, handling interrupts, and a bazillion other things that I would love to learn but don't know where to start. All that to say, anyone know a good place where I can learn about stuff like this? :)
Post Reply