Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CP/M & Interrupts (was: C128 Z80 - Interrupts)

24 views
Skip to first unread message

Sven Paepke

unread,
Jun 26, 2004, 10:12:26 AM6/26/04
to
Here is a quick update on the progress of my project to make use of VIC and
CIA interrupts under Z80:

In general, interrupt handling appears to be under control and quite
straight forward. Once I was pointed into the right direction (thanks to
everyone for the help!), I got the initial routine to work. This routine did
nothing special, just cycled the VIC border colour once for each interrupt
(does not care what caused the interrupt). The routine works stable, even
through floppy access. That was the proof of concept. Tick in the box. :)

At the moment, I am struggling with parsing the command line in Assembler.
Found syslib.lbr and may be using some of the routines from it. Great
library, well documented. If anyone wants to understand Z80 CP/M coding in
assembler - read the documentation for syslib.lbr!

Current project: I am trying to re-code a 6502 example for running 5 copies
of the VIC (using raster IRQs), but using the Z80. You can define up to 5
raster lines which trigger interrupts, and completely re-program the VIC
with every interrupt. There are some challenges (like the location of the
HIRES screen and sprites etc). At the moment, I try to do this under CP/M.
Later, I may want to eliminate the OS and run it as a demo straight from
disk without having to boot an operating system. Only condition is that I
have it run Z80. Don't ask WHY? The simple answer is BECAUSE I THINK IT CAN
BE DONE. No real
purpose to be honest.

Another challenge is to move the interrupt code into Bank 0 (this is where
interrupts normally execute as far as I know). The code is getting too big
for the unused areas in the common area from $E000 to $FFFF. I can't afford
bank switches during an interrupt - not enough time to waste - so I need to
move the code into free space in bank 0. The information from Herne
(www.herne.com/cpm.htm) regarding the C128 memory map under CP/M is
outstanding! Also some of their tools (e.g. the C128 CP/M Hacker's Toolkit).
They put most of their internal documents regarding CP/M programming on the
C128 into the public domain. Thanks Herne! Also, the Z80 manual from the
ZILOG website is very helpful, as it contains information on the timing of
Z80 commands. Very useful: http://www.zilog.com/docs/z80/um0080.pdf

Besides these challenges, my brain activity was severely impeded by a cold
and a flu in the past 2 weeks, so progress was s .. l .. o .. w .. I hope to
have a working example for 5 VICs (allows additional sets of sprites or
split screens with HIRES, Multicolour, Text) soon. Besides that, I got hold
of a commented listing of an early version of Rob Hubbard's music routine.
Wouldn't it be nice to do this on the Z80????

I guess I have to start counting available cycles during an interrupt as
well. At the moment I have no idea how many cycles (Z80) we have available
per rasterline for instance. Any suggestions on techniques for finding out
would be appreciated! And how many of these cycles are actually "stolen" by
CP/M??? Questions ... Ultimately, I would love to have Rob Hubbard's music
routine + a couple of sprites (>8, where is the limit???) running on the
C128 under Z80 in form of a demo. But that will probably take a lot more
time to achieve! Any volunteers who want to work on it with me?


Regards,
Sven from Oz


0 new messages