>Hello!
>
>
>I want to speed up the interrupt (original #38).
>So I use the #FD9A for jumping to my own routine (which will
>pop the return-adress from the stack), checking the Vertcal-
>Blank flag and only the absoult necessary things.
>
>Everything is fine, BUT - there are still two things which
>I would like to remove...
>
>the call to the old #FD9A, and the call to #FD9F.
>
>#FD9A: called on every interrupt which occurs,
> normally not used by the system, only some special software.
> - there shouldn't be problems if I won't call this old entry
>
>#FD9F: called 50/60 times per second,
> a restard-command to stop the diskdrive.
> - before disabling this call, I will call it 256 times after
> a diskoperation to stop the drive.
>
>What is your opinion? Will I be in troubles by removing this two calls?
>
>
>thanx in advance for your help
>
>greets
>wolfgang
>
>
You can also create your own ISR, using another Interrupt Mode of the Z80.
The good side of *this* method is that you still can use the BIOS routines.
Let me show you how to do it:
- Create a jumptable, starting at a 256-byte boundary (i.e. #C000, #C100,
etc), containing 128 times the start-address of your ISR-routine. Note that
the high- and low-byte of this address should be the same (for safety).
(i.e. #D0D0, #CFCF, etc.).
- Put the high-byte of the start-address of the jumptable in the
interrupt-vector register (i.e.: LD A,#C0 LD I,A).
- Switch to interrupt-mode 2.
Here's an example:
; --- Switch to own ISR
di
ld HL,#C000 ; start address of jump-table is #C000
ld DE,#C001
ld BC,256-1
ld (HL),#D0 ; start address of ISR is #D0D0
ldir
ld A,#C0 ; let interrupt-vector point to #C0xx
ld I,A ; (xx = variable!!!)
im 2 ; Interrupt Mode 2
ei
equ #D0D0
ISR: ; your ISR
This code is from the top of my head, but I think this'll do.
Note that you took over the complete ISR! So, save the registers onto the
stack yourself, check whether it's a VDP Vertical Retrace interrupt, etc.
Also you have to take care of keyboard-input yourself. No default handler
will do that for you anymore, since these handlers run under interrupt as
well.
Hope this helps!
Greets,
Jan-Lieuwe Koopmans
****
MSX Mailinglist. To unsubscribe, send an email to [EMAIL PROTECTED] and put
in the body (not subject) "unsubscribe msx [EMAIL PROTECTED]" (without the
quotes :-) Problems? contact [EMAIL PROTECTED] (www.stack.nl/~wiebe/mailinglist/)
****