Login
Back to forumSee the full topicGo to last reply

Posted By

Gaia
on 2009-10-25
09:14:53
 Re: IRQ and FF06

Kichy, in case you do it with the FF1D trick you have the benefit that you get the extra "border" cycles, too, which speeds things up quite a bit. Here is a quick and dirty routine I have put together in TEDMON:

D2000 2023
. 2000 78 SEI
. 2001 A9 FE LDA #$FE
. 2003 CD 1C FF CMP $FF1C
. 2006 D0 FB BNE $2003
. 2008 A9 13 LDA #$14
. 200A CD 1D FF CMP $FF1D
. 200D D0 FB BNE $200A
. 200F A9 CA LDA #$CA
. 2011 8D 1D FF STA $FF1D
. 2014 A9 DB LDA #$DB
. 2016 A2 24 LDX #$24
. 2018 CD 1D FF CMP $FF1D
. 201B D0 FB BNE $2018
. 201D 8E 1D FF STX $FF1D
. 2020 EE 19 FF INC $FF19
. 2023 4C 01 20 JMP $2001

The idea here is that we wait until we reach rasterline $014 and then make the TED think he is already at the end of the visible window by writing $CA into the horizontal raster. This will let the TED turn off the DMA (colour and char fetch) and "close the border". But for the rest of the screen and video timing not to screw up, we must set things back a few lines later to the values it would be if there were no raster register writes at all. This is basically how all extended border effects work (well, most of them anyway).

There are a couple of caveats though, one namely that make sure you do not write an odd number into FF1D while it is in an even line and vice versa because that will screw up the PAL line phase and you get artifacts ("alternative" as well alternating colours per frame :-) ). So stay with either all odd or even numbers in case you're not sure.

Of course this routine is quite suboptimal because I am doing all this in a busy loop but it is easy to set things up in a raster IRQ (actually two raster IRQs per frame, or one raster and one timer, as you like it).

PS: it could also be that I accidentally changed the frame rate, too, by not counting the actual video lines generated (which should be 312) properly, but I was lazy.



Back to top


Copyright © Plus/4 World Team, 2001-2024