ca65 problems

You need an actual VIC.

Moderator: Moderators

Post Reply
Malcohol
Vic 20 Drifter
Posts: 30
Joined: Mon Apr 04, 2011 4:04 pm
Location: Ireland

ca65 problems

Post by Malcohol »

Hi there.

It's my intention to start work on a homebrew game for the unexpanded Vic 20. I'm new to the machine and unfortunately I'm having difficulty getting started.

I thought a good place to get get up and running would be the unexpanded version of quikman, ie quikman2k8.

Unfortunately, I can't get it built with the cc65 tools. I suspect that the version of cc65 I've installed is newer than the one used by Robert Hurst when he was working on quikman. (I have V2.13.9).

Here's what RIchard proposes:
; to assemble this source using cc65.org project:
; ca65.exe --cpu 6502 --listing quikman2k8.s
; ld65.exe -C doc/vic20.cfg -o quikman2k8.prg quikman2k8.o

Here's what I get:
$ ca65 --cpu 6502 --listing quikman2k8.s
ca65: No input files

The problem here is that the --listing now consumes an argument. Leaving out --listing generates me a .o file as expected.

The version of ld65 I have seems to have built in vic20 cfg file. Here's what happens if I try to link:

$ ld65 -t vic20 -o quikman2k8.o ld65:
Warning: Option `-o' should precede options `-t' or `-C'
ld65: Warning: [builtin config](39): Segment `EXEHDR' does not exist
ld65: Warning: [builtin config](39): Segment `ZPSAVE' does not exist
ld65: Warning: [builtin config](10): Memory area overflow in `RAM', segment `STARTUP' (1038 bytes)
ld65: Error: Cannot generate output due to memory area overflow

Understanding this seems to require a combination of knowledge about both the Vic and CC65 which I don't have yet.

Can anyone suggest how to proceed?

Malcolm
User avatar
Wilson
Vic 20 Enthusiast
Posts: 190
Joined: Mon Sep 28, 2009 7:19 am
Location: Brooklyn, NY

Post by Wilson »

This should be moved to Emulation/Cross development.

I'll do my best to help.
$ ld65 -t vic20 -o quikman2k8.o ld65:
There are a couple problems with this line. First of all, I assume the second "ld65" at the end is output from ld65? Second, you need to specify the output file for the .prg (binary output file). In quikman's case that's the "quikman2k8.prg"

Code: Select all

-o quikman2k8.prg quikman2k8.o 
And finally, the thing causing this error:
ld65: Warning: [builtin config](39): Segment `EXEHDR' does not exist
ld65: Warning: [builtin config](39): Segment `ZPSAVE' does not exist
ld65: Warning: [builtin config](10): Memory area overflow in `RAM', segment `STARTUP' (1038 bytes)
ld65: Error: Cannot generate output due to memory area overflow
Robert, as you generally do when using ca65, uses a configuration file different than the standard one provided for cc65. To compile quikman, you must use the one that Robert provided (apparently doc/vic20.cfg). There's a lot of good information about config files here that I'd recommend reading. Looking at Robert's config file should help a lot too.
Understanding this seems to require a combination of knowledge about both the Vic and CC65 which I don't have yet.
I had some difficulty getting up and running with ca65 at first too. It's a very powerful assembler, and it's a good choice for big projects, but if you're just testing the waters of Vic-20 programming you might consider using a simpler assembler like acme. It can be a bit of a pain setting up a config file, compiling, and linking just to test little programs. I'd hate for you to give up because the tools are too much work! :)
Malcohol
Vic 20 Drifter
Posts: 30
Joined: Mon Apr 04, 2011 4:04 pm
Location: Ireland

Post by Malcohol »

First of all, I assume the second "ld65" at the end is output from ld65?
Yep. Sorry about that!
To compile quikman, you must use the one that Robert provided (apparently doc/vic20.cfg)
Aha! So those values can be set on a per-project basis. Useful to know and tells me why the default cfg didn't work.

Unfortunately, I got the source for the unexpanded one from here:
http://robert.hurst-ri.us/2008/11/01/pr ... s-delight/
and I don't think he has provided the additional cfg file.

I'll try mailing him directly. Thanks,

Malcolm
rhurst
Omega Star Commander
Posts: 1371
Joined: Thu Jan 31, 2008 2:12 pm
Website: https://robert.hurst-ri.us
Location: Providence, RI
Occupation: Tech & Innovation

Post by rhurst »

PM sent.

Starting with unexpanded is a good theory, but in practice, may I suggest going to a more practical place with +8k (or more) memory expansion? Honestly, VIC's internal stock RAM is useful for bootup code and for the VIC chip's graphic data in video games -- and those mainly run from ROM cartridge or expansion RAM. Other than that, it is great for BASIC programming.

The VIC-SSS-MMX archive provides a lot more useful documentation to read, a practical video game example in Sprite Invaders, and some small demos (like this one) to learn from -- complete with sources, batch / shell scripts to compile using ca65, and a whole lot more.
Any technology distinguishable from magic is insufficiently advanced.
https://robert.hurst-ri.us/rob/retrocomputing
Malcohol
Vic 20 Drifter
Posts: 30
Joined: Mon Apr 04, 2011 4:04 pm
Location: Ireland

Post by Malcohol »

Thanks for your message, Robert. Very helpful.
Starting with unexpanded is a good theory, but in practice, may I suggest going to a more practical place with +8k (or more) memory expansion?
I should be honest and say that my interest in the Vic 20 is precisely due to the limitations of the unexpanded machine. I wrote a game for the unexpanded ZX81 last year (1k MazezaM) and got quite a kick out of it.

Given that my last project was in Z80, it seems only fair to do some 6502 coding next :-)
The VIC-SSS-MMX archive provides a lot more useful documentation to read, a practical video game example in Sprite Invaders, and some small demos (like this one) to learn from -- complete with sources, batch / shell scripts to compile using ca65, and a whole lot more.
I saw that. It looks great!

Malcolm
User avatar
Kweepa
Vic 20 Scientist
Posts: 1314
Joined: Fri Jan 04, 2008 5:11 pm
Location: Austin, Texas
Occupation: Game maker

Post by Kweepa »

Your ZX81 game got my vote!
Welcome to the forums.
rhurst
Omega Star Commander
Posts: 1371
Joined: Thu Jan 31, 2008 2:12 pm
Website: https://robert.hurst-ri.us
Location: Providence, RI
Occupation: Tech & Innovation

Post by rhurst »

... precisely due to the limitations of the unexpanded machine.
Ah, good for you then, sounds like a man with a plan.

Whenever my colleagues see me tinkering with old 8-bit stuff, they try to pawn their old Macintoshes or Amigas on me, and I never 'nybble' -- I just say those machines are just too powerful for my retro needs. :P

So I hear you on that, enjoy!
Any technology distinguishable from magic is insufficiently advanced.
https://robert.hurst-ri.us/rob/retrocomputing
Malcohol
Vic 20 Drifter
Posts: 30
Joined: Mon Apr 04, 2011 4:04 pm
Location: Ireland

Post by Malcohol »

Your ZX81 game got my vote! Welcome to the forums.
Thanks, Kweepa. Seems like a fun place.
Ah, good for you then, sounds like a man with a plan.
Well I do have a plan. Whether the game design in my head fits into 4K is another matter... but I'm hopeful!

Malcolm
Post Reply