] This is true on a standard MSX with correct devices connected to it. If on
] the other hand a device only checks IORQ and not M1, it might put data on
] the bus when it is read at interrupt-time (In this mode IORQ and M1 are
] both active).
A device which ignores M1 does not respect the Z80 nor the MSX bus protocol,
hence is not MSX compatible! Such a device will not only cause problems in
IM2 but also in IM0 (the Z80 expects to get an instruction, in the MSX it
will always be 0xFF which is RST 38h) and even in IM1 such a device may cause
problems. In the last case because a device may generate wait-states.
Especially when it is slow. This might impact the timing of games,
copyprotections and other softwares that rely on accurate timing. And
ofcourse it might also impact the functionality of the device itself. Some
devices reset/set some internal bits after they have been read or think that
they have been read. For example, the VDP resets the interrupt request bit
after its status port has been read and it increases the address counter
after its dataport has been read. Ofcoure, the I/O decoding for the VDP does
respect the MSX bus protocol so we have never had any problems with that.
Anyway, as far as I'm concerned you should ban devices from your MSX that are
not MSX compatible.
]
] Conclusion: Putting the interrupt vector on [I]fe (I believe the
] last bit is set to 0, since a 2-byte address is fetched) should be enough
The last bit is not set to 0 but read from the databus. Just like the other 7
bits. If you store the interrupt vector at the even address, your program
will NOT work. Just try it.
In a system that really supports IM2, you can have a convention that the
device will only set the highest 7 bits and that the lowest bit musts always
be set to 0. You can even enforce this with a specially designed circuit. But
as far as the Z80 is concerned: it really reads all bits that are placed on
the databus.
In the case that an incompatible device would place an arbitrary number on
the bus -which can be both an odd and an even number- there is only one real
good solution: make sure that the high byte and the low byte of the
interruptroutine are the same. For example:
jumptable: equ &hc000
interrupt_routine: equ &h8080
ld a,.high. jumptable
ld i,a
;initialize table
ld hl,jumptable
ld (hl),.low. interrupt_routine
;fill table up (from c000 upto and including c100)
ld de,jumptable+1
ld bc,&H100
ldir
org interrupt_routine
; the real interruptroutine
But as I already mentioned, you should ban such a device from your MSX
anyway. And when using only compatible devices, my original routine is
sufficient (store the pointer only at ofset 0xff in the table).
Kind regards,
Alex Wulms
--
Alex Wulms/XelaSoft - MSX of anders NIX - Linux 4 ever
See my homepage for info on the *** XSA *** format
http://www.inter.nl.net/users/A.P.Wulms
****
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/)
****