C-Interrupt routine for ZX81

Requests for features
Post Reply
siggi
Well known member
Posts: 344
Joined: Thu Jul 26, 2007 9:06 am

C-Interrupt routine for ZX81

Post by siggi »

Unfortunately the IM2 features of Z88DK cannot be used with a ZX81. But it would be nice, if it were possible to hook a C function into the display routine, so that is called 25 or 50 times/sec during SLOW mode (of course outside the time critical section of the display routine).

I ported a IRC chat program from Spectranet zo ZeddyNet. The Speccy version uses IM2 to read and buffer keyboard entries. My workaround on the Zeddy works, but using INTs would be much better :)

BTW: Could you perhaps add information into WIKI, which libraries are (not) reentrant and (not) romable?

Siggi

EDI: Upps, I mixed NMI with IM2 ...
Last edited by siggi on Tue Feb 21, 2012 10:03 am, edited 1 time in total.
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

i have a large rewrite coming that will include an opportunity to reorganize the startup code for all targets, which would include addressing these sorts of problems.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

Ok then, I will stop any adaption of the CRT0s and of the main libs Makefile. ;)
Something could still happen in the 'math' folder, if all goes as expected..
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

There is no need to stop stef :)

The test target(s) will exist in parallel for a while yet. The main thing will be a rewrite of stdio and an update to more conformance with c99. The immediate goal is to get networking integrated and to have a model that supports many attached devices through a device driver abstraction attached to the end of a file stream.

Existing library code will only be added incrementally as things are checked for romability, opportunities for improvement, etc, so the test targets will be missing things initially. z88dk has grown a lot over the years through add-ons, so I think this is the right time to take a fresh look at how the whole should fit together.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

Agreed, hope I'll have the energy to help :D
siggi
Well known member
Posts: 344
Joined: Thu Jul 26, 2007 9:06 am

Post by siggi »

Any new about that topic?

Siggi
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

The new clib is the rewrite.

It uses a sectioned memory model so ROMable code can always be generated automatically. For the zx81 specifically, there should be separate sections for "executable ram" and "data ram" which is easy to set up; the new stdio code uses FILE structures that contain executable code (a jump) so this must be in "executable ram". If you have gaps in your memory map that is easy to accommodate too.

The new clib needs someone to create a zx81 target with lightweight display drivers and provide alternate implementations of functions that use af'. The current zx81 target using the classic library has many different variations so creating a zx81 target should be done by someone with some zx81 knowledge like maybe stef or yourself.

Adding an isr call to the end of the video interrupt shouldn't be that difficult and should be easy to add to the classic library?
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

I wasn't thinking at the zx81 as the next one to move :S
Let me take it easy and begin inspecting the current drivers to find a suitable place to fit this extra trap.
siggi
Well known member
Posts: 344
Joined: Thu Jul 26, 2007 9:06 am

Post by siggi »

Hi
any news about hooking a C function into the video interrupt routine?

I would like to use this to get a constant keyboard repeat timing on ZX81 clones running at higher speed (ZX81 using Andy's ULA2, ZxMore or ZX81NU)

Siggi
Post Reply