cc65 support for R39 and beyond

Chat about anything CX16 related that doesn't fit elsewhere
Post Reply
TomXP411
Posts: 1785
Joined: Tue May 19, 2020 8:49 pm

cc65 support for R39 and beyond

Post by TomXP411 »


@Greg King I was talking with @Michael Steil (aka @mist64) on Discord tonight, and your name came up. There was talk about cc65 support, and I mentioned that the CONIO library may be out of date. 

The big thing that CONIO needs to do is read the screen geometry and frame buffer address from VERA, rather than assume the text lives at a particular location. My thinking was to throw this into screensize() (and maybe an additional conio_init() function) and force a call to screensize() the first time clrscr() is called. This would guarantee the library knows the state of the screen, even if the default frame buffer address changes again in the future.

Also, Michael has asked for a list of "wants" - anything that cc65 needs that is not currently an official KERNAL entry point or variable. Here's his message:

 


Quote




 



Instead of cc65 fixing every breaking change in the x16 ROM, I’d rather have it use APIs that won’t break. Can we get a list of asks from cc65 so I can implement missing APIs to prevent them from using internal state?



 



 

if there's anything any of us can do to to help, please let us know.

 

Michael Steil
Posts: 94
Joined: Mon May 18, 2020 7:25 pm

cc65 support for R39 and beyond

Post by Michael Steil »


What @TomXP411 said. ? The C64 has some well-known and well-documented internal state that has always been used by a lot of software. The C64 also only had 2 KERNAL updates, all of which were minor and allowed them to keep the layout of code and variables. For the X16, there will be more updates, and they will break the layout of the zeropage and the $0200 area again. I've already added lots of API so that direct messing with variables isn't necessary for some cases. For example, an app can query the keyboard buffer or put characters into the keyboard buffer.

I'd like to get cc65 into a state where changes in ROM, zeropage or variable layout don't break cc65-compiled apps. What else do we need?

Some more comments on https://cc65.github.io/doc/cx16.html#ss8.1, while we're talking here: ?


Quote




The Esc key acts as Commodore's STOP key -- or, you can press the Ctrl key and the C key together. Pressing the Shift and the Esc keys together will type Commodore's RUN key.



This is incorrect. The X16 emulator maps the host's Esc to the PS/2 "Break" key, because some laptop keyboards don't have a Break key, or it's not easily accessible. On real hardware, you'd have to press Break. "Esc" will return ASCII code 0x1B.


Quote




Supports up to two NES (and SNES) controllers connected to the joystick ports of the CX16.



This part is outdated now. It supports five: One "keyboard joystick" and four SNES controllers. (No NES.)

ZeroByte
Posts: 714
Joined: Wed Feb 10, 2021 2:40 pm

cc65 support for R39 and beyond

Post by ZeroByte »


I've also noticed that waitvsync() works by peeking at the Kernal's internal jiffies counter in bank0, which of course breaks every time the Kernal builds that into a different spot.

I think the joystick library also does direct peeking - but I never could quite figure out how to properly use that module so I can't say for sure.

 

Post Reply