Help with CC65 Development

You need an actual VIC.

Moderator: Moderators

User avatar
hawk
Vic 20 Afficionado
Posts: 328
Joined: Mon Jun 20, 2005 7:32 pm

Help with CC65 Development

Postby hawk » Tue Feb 07, 2017 1:01 am

I'm finally putting out a call for help.

Over the past few years I have been trying, on and off, to get some code that I was working on prior to Uz passing the CC65 maintenance on.

Initially I had issues with actually building the program, as the config file changed, and way custom startup code changed. But after looking at the examples of others, I finally got my program to build again. The problem was that it no longer functioned correctly.

I think I've narrowed the problem down to the cprintf() function. Now I know you're going to say don't use that as it bloats the code, but I've been using it to print out debug information as I'm developing.

Has anyone else encountered a problem with using cprintf() in VIC20 programs?

As far as I can tell, by debugging within VICE, the self-modifying code that formats the different data types is not jumping to the correct location and hanging or exiting the program early.

Any ideas?

Hawk
Attachments
Lesson2.zip
(56.87 KiB) Downloaded 10 times

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

Re: Help with CC65 Development

Postby Kweepa » Tue Feb 07, 2017 10:13 am

I don't remember having a problem with cprintf (although as you say it bloats the code so I stopped using it quickly).
Is it one of the cprintfs at the bottom of lesson2.c that is failing? Which one?

User avatar
hawk
Vic 20 Afficionado
Posts: 328
Joined: Mon Jun 20, 2005 7:32 pm

Re: Help with CC65 Development

Postby hawk » Tue Feb 07, 2017 8:56 pm

Thanks for the reply Kweepa.

If I uncomment them, it's the first one the code comes across in main().

This code is a mishmash of ideas that I've been working on for the past few years. It was me learning how to program for the VIC-20 hardware.

groepaz
Vic 20 Nerd
Posts: 538
Joined: Wed Aug 25, 2010 5:30 pm

Re: Help with CC65 Development

Postby groepaz » Wed Feb 08, 2017 10:16 am

i very much doubt cprintf is the problem - it works fine

however, there is a lot of things in this code that could cause problems.... the custom crt0 is one, and various other direct memory accesses - a lot of things changed in cc65 during the years, so you'll probably have to review all the custom stuff and adjust it accordingly.

i'd get rid of the custom crt0 first, and use the one that comes with cc65, and disable the custom stuff one by one. besides that i dont see anything that shouldnt work fine

User avatar
hawk
Vic 20 Afficionado
Posts: 328
Joined: Mon Jun 20, 2005 7:32 pm

Re: Help with CC65 Development

Postby hawk » Thu Aug 10, 2017 1:09 am

Thanks for the pointers, I think I worked out what the problem was...either way I got it working again.

I think the problem was that I didn't leave a memory block in the CFG file for the relocated screen RAM, so when I wrote to the new screen I trashed the program. I found the problem by looking at Robert Hurst's Quickman CFG file.

My program is now back where it started umpteen years ago. Now I'm back to deciding how to output to the screen...direct memory access, or use cc65 library routines. I've discovered that you can't use both as they give you different results.


Return to “Emulation and Cross Development”

Who is online

Users browsing this forum: No registered users and 1 guest