Page 1 of 6

Beginners cc65

Posted: Mon Jun 04, 2012 11:25 pm
by Dajgoro
I am trying to figure out how the cc65 works. I use Windows and I am kinda lost with the cc65, i tried to compile a simple C code, but i get some error about network path not found. After reading the cc65 manual I am even more confused...

Re: Beginners cc65

Posted: Tue Jun 05, 2012 6:14 am
by BigEd
Are you running in a windows command shell or a Cygwin shell?
Sounds like a confusion between forward and backward slashes in file paths.
I recommend running in Cygwin.
Cheers
Ed

Re: Beginners cc65

Posted: Tue Jun 05, 2012 2:02 pm
by Dajgoro
I have Cygwin, i had to use it once for some labs that i had to do...

But if i use Cygwin, then what are toes exe files?

Re: Beginners cc65

Posted: Tue Jun 05, 2012 2:57 pm
by BigEd
Cygwin will run a win32 exe no problem. And Cygwin programs are also .exe files. But it does look like the cc65 binaries are for native windows. Perhaps you could paste your command line and the result?

Re: Beginners cc65

Posted: Tue Jun 05, 2012 3:05 pm
by 8BIT
I run CC65 from Windows XP and I don't use cygwin (although I'm sure its possible).

CC65 is not an easy "beast" to understand. First thing you need to decide is which platform you plan to target. Without that, it won't work. It is best to use a DOS batch file to handle the compiling process.

If you want an example, you can download my SBC-3 support package. It contains the source code to create an SBC-3 platform that you can target along with two sample programs. There is a batch file in each of the two demo programs that takes care of the compiling. Remember though, that this can only be executed from my SBC-3 (properly outfitted). There are many other targets included in the CC65 package so you will have to choose an appropriate one for your use.

It took me several months to build the target source files and to get programs to compile correctly. I started out by downloading Chris Ward's source files for retargeting CC65 to his SBC. From there, I just modifying those files to fit the SBC-3. I then went into the source files for other targeted platforms and started bringing in more routines that the SBC-3 would support, including serial, graphics, disk strorage, and ethernet.

It was a long road with many bumps, but it can be done.

Daryl

http://sbc.rictor.org/download/cc65lib.zip

Re: Beginners cc65

Posted: Tue Jun 05, 2012 8:50 pm
by Dajgoro
First thing i need to figure out how to compile for any platform at all, is there a good free emulator for any of the cc65 platforms, so i can test the compiled program there, before i go and modify it to fit my sbc?

Re: Beginners cc65

Posted: Tue Jun 05, 2012 8:57 pm
by BigEd
VICE emulates the C64 and is well thought of.

Re: Beginners cc65

Posted: Tue Jun 05, 2012 8:58 pm
by Dajgoro
Yes but C64 emulators tend not to be free, and they are usually closed, so i don't know how i could manipulate the rom...

Re: Beginners cc65

Posted: Tue Jun 05, 2012 9:11 pm
by BigEd
VICE is GPL. You're unlikely to find an historical system with open-sourced ROMs. You will find sources from reverse-engineering efforts for most of them.

(Normally you'd be compiling an application - whether the OS is open or closed isn't an issue.)

Re: Beginners cc65

Posted: Tue Jun 05, 2012 9:43 pm
by 8BIT
It would not be too hard to target the Kawalski Simulator, since all it has is simple input and output. That would at least give you something to start with. Purhaps I'll work on that. It may take a little time, as my spare time has been pretty sparse.

Daryl

Re: Beginners cc65

Posted: Fri Jun 08, 2012 7:22 pm
by 8BIT
I have completed the port to the Kawalski Simulator.

There are not too many features to port as the simulator only has a simple console window and no other IO.

I have also modified 4 of the sample programs to work with the limited conio.h routines. This should give a decent starting point for others to probe the workings of a generic cc65 target.

I just need to write up an brief instruction on installing cc65 with this target, along with generating and loading the samples.

Daryl

Re: Beginners cc65

Posted: Fri Jun 08, 2012 8:55 pm
by fachat
Have you submitted the port back to the cc65 community? They might be interested.

Re: Beginners cc65

Posted: Fri Jun 08, 2012 9:04 pm
by 8BIT
Not yet. I think I would have to spend a lot more time testing more of the cc65 environment before doing that. The 4 demo programs run fine, but that is not to say that any generic C program will. I am not an expert in C. I was just driven enough get cc65 to work for my uIP ethernet project.

In other words, it's enough to help others get started but not a complete solution.

Daryl

Re: Beginners cc65

Posted: Fri Jun 08, 2012 9:29 pm
by GARTHWILSON
Quote:
I was just driven enough get cc65 to work for my uIP ehternet project.
Daryl, on the "Homebuilt Projects" page, Adam's uIP link (near the bottom) no longer really has anything to do with uIP. I was trying to find the correct link to give to Mike, and the closest I came was that it might be part of a 1.4GB (not MB!) download that I wasn't about to do. Do you have a link to the uIP material?

Re: Beginners cc65

Posted: Fri Jun 08, 2012 10:19 pm
by 8BIT
There used to be a link to the "old uIP" pages but they have removed that I see. Try a google search for uIP 1.0 or better yet, uIP 0.9. If that doesn't yield anything, I have the source files backed up at home and can email them to anyone who wants them.

Daryl