Autor
| DI EI
|
norakomi msx professional Mensajes: 861 | Publicado: Septiembre 22 2005, 11:42   |
intterupts !!! bah !!
Ok. at VBLANK int. I allways DI and EI when writing to VRAMregisters.
Now at VBLANK I make all my copies (for the background scroll)
I set the Videoprocessor to work, and the game moves on.
When y=24 is reached there is a pagesplit.
Is it necessary to use DI and EI here as well????
|
|
ARTRAG msx master Mensajes: 1686 | Publicado: Septiembre 22 2005, 12:20   |
DI means that the z80 will ignore any interrupt from VDP
EI means that the z80 will jump to 38h when the VDP signals the interrupt
If you are in a interrupt routine at VBLANK and you are sure that your task
will finish before the next VBLANK interrupt, (that is normal otherwise your
system crashes as you get stack overflow), you DO NOT NEED any DI-EI becouse
you are sure that none is going to interrupt your I/O towards the VDP.
|
|
BiFi msx guru Mensajes: 3142 | Publicado: Septiembre 22 2005, 12:50   |
This is a memorable post... it's my 2525th
Quote:
| DI means that the z80 will ignore any interrupt from VDP
EI means that the z80 will jump to 38h when the VDP signals the interrupt
|
correction: DI means the Z80 will ignore any interrupt requests, period. Not just the VDP one(s)... EI means interrupt requests are accepted again. It depends on the Interrupt Mode which address is used to jump to:
IM 0 (not used on MSX): $38
IM 1 (generally on MSX): $38
IM 2 (device dependent): interrupt vector is derived from the I register and some device data
Even though the MSX only uses IM 1, it is of course possible to set IM 0 or IM 2. |
|
NYYRIKKI msx master Mensajes: 1510 | Publicado: Septiembre 22 2005, 13:22   |
As there can be MIDI interrupts etc. I suggest you to execute DI in start of interrupt handler and EI in the end. This is anyway just to be safe, normally this has no effect.
If you are interested about other interrupt modes, here is pretty weird program, that "records" value from Z80 databus:
http://www.msx.org/forumtopic3816.html
|
|
ro msx guru Mensajes: 2329 | Publicado: Septiembre 22 2005, 18:04   |
It don't even matter if your routine will exceed the time that's between 2 interrupts. As long as those interrupts are withing 1 screen refresh.
I use that all the time. For example
LNI on 100, do a big VDP copy (will take about 100 lines in screen length)
EI after the copy instruction and do some more stuff I don't care about.
LNIon 140, do more stuff BUT VDP action. (the copy from LNI100 will still be active)
You see, overlapping INTs is no prob. (not really the INTs r overlapping, it's just the huge copy instruction)
just calculate and check. No need to DI and EI. Btw. DI is already done while on BIOS interrupt, so no need to use that one.
EI and DI are only necessary in NON interrupt routines (where ya don't know when another int will come while doing some bizar VDP zapping). Again, check and calculate. I always keep my INTs on as much as possible. But then again, I'm an idiot.
Interrupts.... aaah the sweet topic returns
|
|
ro msx guru Mensajes: 2329 | Publicado: Septiembre 22 2005, 18:07   |
sometimes I even DO use *real* int overlapping
for example: having some piece of WOLF music (you know those BIG anthems with lotsa channels and stuff) playing on your VBL will suck up some major CPU. Why not EI before starting that replayer? Hell, it's just data.. no VDP shizl. If another INT is present (LNI for example) it just interrupts the previous interrupt (the music replayer) and when it ends, it returns to playing them pieces of muzak. get it? again, check whaz really happening, what is that INT doing and calculate it's length. just fiddle with it dude!
cheerio. |
|
|
|
|