The MTXplus has some very fancy clock controls designed by Tony Brewer. The CPU is booting at 4mhz, but can be switched up to 16mhz in 16 steps.
The same system keeps track of VDP writes and automatically inserts Z80 wait states when the CPU is running faster than 4mhz. /wait from the VDP is wired through that system so will be active if the CPU is switched up, it's enabled by the MTXplus rom early in the boot sequence.
The Fuzix system will be running at 4mhz since it won't know how to program the variable clock, which means the wait system is inactive.
The clock control utility from MTX basic and the one for CPM both re-program the CTC to keep the interrupts at 125hz. The CTC uses 2 daisy chained counters instead of the usual one in order to keep the system tick at 125hz.
so that could be the issue with scrolling, since the wait state system won't be active.
To set an 8mhz clock, sent &70 to port &FF, and program the CTC with time constants 100 and 40 and everything would be fine.
The full source for the SDX command USER SPEED is bellow. The data table sits at 3F00 in the SDX rom simply because it made the pointer maths easier. USER SPEED with no value prints the current clock speed. If there is a value or variable after the command the CPU and CTC will be set up with that speed rating (value mod 16 really,it doesn't range check. USER SPEED 1 is the same as USER SPEED 17)
Code: Select all
;report back the current CPU settings
inc DE ;step past the last character of the command
;;check to see if there is a number following the command
JR z report_CPU_speed ;check the end of line marker
call getnxt ;hopefully this will read the value/variable
ld a,c ;get the low byte
add a,a ;shift to the top 4 bits
out (&FF),A ;and set the clock
add a,5 ;offset into the table of the CPU frequency data
LD L,A ;HL now holds pointer to CPU clock data.
;now need to set up the CTC counters
Call IJinit ;turn off interrupts and reset the CTC just in case
LD A,&05 ;disable interrupt, prescale 16
ld a,(hl) ;get time constant 1
LD A,&D5 ;Enable interrupt, counter mode, 0, rising edge,
;0, time constant follows, no reset, control word
;fall through to report the speed
DS "Master clock:"
ld l,a ;HL now points to the 5 byte string for the current speed description
; call newline
RST &10 ;print a "newline" a different way
;extended CPU speed table
;revised clock system has 16 available frequencies driven from a 32mhz master clock
;table format 5 byte string, 2 bytes major/minor speed, CTC clock settings, 7 bytes padding to make
;entries 16 bytes for quick access
; stored at the end of the rom to make setting up the ponter easy
DS " 4.00"
DS " 4.57"
DS " 4.92"
DS " 5.33"
DS " 5.82"
DS " 6.40"
DS " 7.11"
DS " 8.00"
DS " 8.53"
DS " 9.14"
DS " 9.85"