I've been toying with CC65 this week in my spare time. I started just playing and re-familiarizing myself with C. Doing this with pointers, etc. The development process is pretty quick. I can edit with MS Visual Code, compile at the command line, and execute the XEX file. I think the latter can be automated within VC, but I haven't checked. Compilation is lightning fast.
For an M1 Mac, getting CC65 is easiest to get going by using Homebrew: "brew install cc65".
Here are some screen shots of the tests I've been working on:
First I started with pointers, and passing them to functions, manipulating the string from the function, and validating how the address is found:
Next I wrote some routines to convert ATASCII to Internal and back:
Then I played with the peek/poke, mostly peek and peekw. Peekw allows you get the High and Low byte, and compute the vector address just by peeking the first number (ie: screen memory at 88/89 by using just 88). I compared it to a manually computed address for validation:
Then I thought I would try converting my Action! WaitYN and WaitKCX functions. They WaitKCX function checks for F1 to F4 and Help, but I can't test F1-F4 since I don't have a 1200. Anyone have a 1400 or 1450 they want to give me? :D
Then I got excited and started converting my Action! window library. I got all the base window functions converted and here is a test showing them all in use.
Now I am working on converting the Action! gadget library, and menu library. I'm going to do some blog posts about CC65 on Unfinished Fitness.
A couple of points.
1) The documentation is incomplete in general and large portions of the Atari specific documentation is missing, but you can look at the source. The source library pretty much equates to assembly, but the source is reasonable to read.
2) The library includes conio, which is a translation from Borland C. It claims to use direct screen I/O, however it doesn't appear to completely. If it did they would be super fast, but they are not as fast as Action!'s. The routines I converted from Action! which DO write directly to screen memory appear to be faster than the conio library functions. In the screen shot above, using cprintf to print "Window x = blah" is noticeably slower than my routines the do a ata->internal conversion and subsequent memcpy to get the string displayed directly. Its small difference, but noticeable. If you don't need the speed, the conio functions will suffice.
I'll release the source for the library once I complete the conversion. Pretty much out of time this weekend. Have a lot to do tomorrow.
I've made more progress. I just have the GInput() gadget to convert then the library is essentially ready to publish. There are a few other routines I had written but not published for the Action! library which revolved around FujiNet, and SQL DB access (via the DB proxy I wrote). It appears more progress has been made on the FujiNet JSON, so maybe the proxy isn't needed anymore, which would make a much cleaner implementation. Hopefully I will be done in the next 2 weeks and can get it published with an API document.
Another Action! gadget converted to C. The GCheck() checkbox routine. I also improved how the keystrokes work so its more efficient to toggle and set.
Another gadget converted tonight. CC65 string and array handling makes some of the code much smaller. Here I have the GButton() gadget converted and tested:
More progress made tonight. I converted the first two gadgets., GAlert() and GProg().
Progress made tonight. First I played with arrays of strings, and passing the pointer through a function. Then I converted my Action! library MenuV function and tested it.