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.
Setting Slow And Fast Mode From Machine Code
Re: Setting Slow And Fast Mode From Machine Code
Follow these two snipets from the rom dissasdembly
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)
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
and turn NMI's on with OUT ($FE),A (set slow mode)
what's that Smell.... smells like fresh flux and solder fumes...
Re: Setting Slow And Fast Mode From Machine Code
Thanks Andy
Re: Setting Slow And Fast Mode From Machine Code
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.
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.
Code: Select all
OUT ($FD),A ; switch NMI off
...
OUT ($FE),A ; switch NMI on
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
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
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