Setting Slow And Fast Mode From Machine Code

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
Post Reply
IanB
Posts: 60
Joined: Mon Jul 27, 2015 5:40 am
Location: Northampton UK

Setting Slow And Fast Mode From Machine Code

Post 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.
User avatar
Andy Rea
Posts: 1606
Joined: Fri May 09, 2008 2:48 pm
Location: Planet Earth
Contact:

Re: Setting Slow And Fast Mode From Machine Code

Post 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)
what's that Smell.... smells like fresh flux and solder fumes...
IanB
Posts: 60
Joined: Mon Jul 27, 2015 5:40 am
Location: Northampton UK

Re: Setting Slow And Fast Mode From Machine Code

Post by IanB »

Thanks Andy :)
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: Setting Slow And Fast Mode From Machine Code

Post 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 ... 8-)

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.
IanB
Posts: 60
Joined: Mon Jul 27, 2015 5:40 am
Location: Northampton UK

Re: Setting Slow And Fast Mode From Machine Code

Post 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 :)
Post Reply