Page 1 of 1
Setting Slow And Fast Mode From Machine Code
Posted: Sun Aug 30, 2015 1:35 pm
by IanB
I'm probably being a bit dimwitted (not unusual for me) but I can't seem to work out the right way to call the ROM to set Fast or Slow (er, "Compute And Display"

) mode from a machine code routine.
There is 0207h which the Disassembly calls "Slow/Fast" and 02E7h which it calls "Set Fast Mode", but I can't seem to get them working. Can anyone tell me how to do this in a "For Dummies" kind of way? I've tried every combination of bits 6 and 7 in CDFlags before calling the routines, but none of them seem to be the right way to do it.
Re: Setting Slow And Fast Mode From Machine Code
Posted: Sun Aug 30, 2015 2:23 pm
by Andy Rea
Follow these two snipets from the rom dissasdembly
Code: Select all
;; FAST
L0F23: CALL L02E7 ; routine SET-FAST
RES 6,(IY+$3B) ; sv CDFLAG
RET ; return.
; --------------------------
; THE 'SLOW' COMMAND ROUTINE
; --------------------------
;
;
;; SLOW
L0F2B: SET 6,(IY+$3B) ; sv CDFLAG
JP L0207 ; to SLOW/FAST
or maybe you could just do it the Blunt way and turn off NMI's with an OUT ($FD),A ( set fast mode )
and turn NMI's on with OUT ($FE),A (set slow mode)
Re: Setting Slow And Fast Mode From Machine Code
Posted: Sun Aug 30, 2015 7:52 pm
by IanB
Thanks Andy

Re: Setting Slow And Fast Mode From Machine Code
Posted: Sun Aug 30, 2015 8:17 pm
by PokeMon
There is another method I use for this when I don't want my program to be interupted, just switch off NMI and when you want display back, just switch it on.
Code: Select all
OUT ($FD),A ; switch NMI off
...
OUT ($FE),A ; switch NMI on
You need less code than make a call and it is faster.
I think you are still working on 1k routines ...
So this makes a very long phase of running time for your program - as long as you want or need.
There is another aspect - when you use another video driver than the system driver (HRG driver for example) you driver will be kicked off when calling $0207 which simply or hardly sets and initializes the system video driver be resetting IX register to it's default value.
Re: Setting Slow And Fast Mode From Machine Code
Posted: Sun Aug 30, 2015 8:20 pm
by IanB
Yes I'm still working on 1k routines.
I just want this while I am testing my forthcoming routines to expand and contract the display file, and until they are optimised I don't want the ZX81 trying to display the screen before it is completed, and crashing
