Closed neilsf closed 4 years ago
This would make XC=BASIC so much better! Your draft looks good to me. Not sure, if you remember, but we talked about this some weeks ago and there you had similar ideas.
@oliverhermanni the idea comes from an old C64 version of Pascal - can't remember which - although that one supported only one interrupt handler routine at a time.
That Pascal version is probably so old that the developers thought nobody needs more interrupt handlers than one. :D
Implemented in xcb-ext-rasterinterrupts.
This is going to be a mayor improvement and contrarily to my previous beliefs it may be implemented as part of the core language instead of an optional extension.
This is an implementation DRAFT and is posted here so that you can add your own ideas/remarks.
XC=BASIC will handle raster interrupts via interrupt service routines (ISR) that are simple procedures:
ISR Procedures can't have parameters or even if they do define parameters, no parameters will be passed to them - which is legal in XC=BASIC.
The XC=BASIC runtime is able to register at most eight raster interrupts (RI), for example:
... and so on, until RI # 7.
The commands for setting/clearing an entry in the RI table could be similar to:
Other commands that should be implemented:
Enables or disables the KERNAL interrupt handler, i.e keyboard input and flashing cursor.
Updates the RI table based on the RI_SET and RI_CLEAR commands, disables CIA timer interrupts and starts raster interrupt service.
Disables raster interrupt service and re-enables CIA timer interrupts.
These are preliminary ideas yet, anything may change until the actual implementation.