[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: cc65 for Apple 2?
Hi,
>I have cc65 and some Win32-based Apple 2 emulators and am wondering
>how to create Apple 2 programs for the Apple 2. I am more of a
>Commodore person, but I find the graphics modes funny and am
>interested in exploring Apple 2 programming.
As cc65 has great support for both the CBMs and the Apple2s that
approach makes a lot of sense :-)
>What do I need to know?
The general steps are identical for both CBM an Apple2:
1. Compile and link the binary using the cc65 toolchain.
2. Import the binary into a disk image using a target-specific tool.
3. Run the binary from within the disk image using an emulator.
The cc65 docs contains a section explicitly describing the steps above
for several targets. Just check it out:
http://www.cc65.org/snapshot-doc/intro-6.html
>For example, how do I write, transfer to .dsk images and run the
>software; access the disk and hardware; etc?
In contrast to other 6502 C (cross-)compiler packages the cc65 does
its very best to adapt the idea of the C language to 6502 based
targets. That is: Allow efficient programming without the _need_ for
target-specific code on the one hand but without on the other hand
hindering target-specific low level code in any way .
In example Contiki (http://www.sics.se/contiki/) is built using cc65
for the C64, C128, Apple ][+, enhanced Apple //e with ext. 80 col
board with only handful of target-specific code. I've about not clue
at all when it comes to CBM specific stuff. Nevertheless porting
Contiki to the C64 and C128 using cc65 was literally a matter of
hours for me!
So the same should be true the other way round for you coming from the
CBM world to the Apple2 :-)
In your example you could use the standard POSIX functions for disk
i/o both on CBM and Apple2. If you are however interested in learning
graphics hardware details on the Apple2 then you'd _not_ use the cc65
hires graphics library (that allows to create multi-target graphics
programs from a single source code) but go directly for the Apple2
hardware. That could be done with C and if necessary with assembler.
For the latter you can choose between the inline assembler for small
routines or the fullblown macro assembler for more complex stuff.
Have fun, Oliver