commanderx16 / x16-rom

Other
153 stars 44 forks source link

[Feature Request] Expose BASIC float functions in Kernal API #46

Closed LRFLEW closed 5 years ago

LRFLEW commented 5 years ago

I was experimenting with porting a slow BASIC demo to C (using cc65 to compile), and realized there is no direct floating point support. The rom already includes a number of floating point processing functions as part of the BASIC interpreter (yes, it's not IEEE floats (at least on the C64), but it's functionally similar) that would be extremely useful to be able to rely upon in ASM and C code. Apparently some Commodore 64 programs did this by referring to the exact offsets of functions in the ROM, but doing this for the X16 would be incredibly unstable as the rom is still being developed. It would be really nice if the existing (and stable) Kernal API could be extended to allow access to the floating point operations found in the BASIC code. It doesn't necessarily have to be individual API addresses for each floating point instruction; it could require some extra indirection to use and still work fine. It would just be extremely convenient to have this already existing code accessible when developing programs.

mist64 commented 5 years ago

Duplicate of https://github.com/commanderx16/x16-rom/issues/16

LRFLEW commented 5 years ago

Sorry. Not sure why I didn't see that before I posted. I shouldn't make feature requests when I'm tired I guess 😛.

mist64 commented 5 years ago

No problem. Good suggestion! ;-)