# HG changeset patch # User Laurens Holst # Date 1625406167 -7200 # Sun Jul 04 15:42:47 2021 +0200 # Node ID 9bb8dac98a80f2dded43e36280a1bc439bccd00e # Parent 60cc59f0c84ccf2fb1d4d87b0cc08bed1d4babcb msx_io_ports: Add turbo available bit to Panasonic expanded I/O port. Based on openMSX information and implementation; Sanyo MSX2+ machines provide the Panasonic expanded I/O port but do not support the turbo 5.37 MHz CPU mode. This is indicated by bit 2. diff --git a/resources/msx_io_ports.php b/resources/msx_io_ports.php --- a/resources/msx_io_ports.php +++ b/resources/msx_io_ports.php @@ -511,7 +511,7 @@ 254MPS2 (ASCII) -

Some example code, this enables the 6MHz mode on Panasonic FS-A1WX/WSX/FX +

For example, this enables the turbo CPU mode on Panasonic FS-A1WX/WSX/FX computers:

@@ -522,25 +522,27 @@ - +
#41Available on FS-A1FX/WX/WSX only:
- bit 0: CPU speed mode (0=5.37MHz, 1=3.57MHz)
- bit 7: Firmware switch status (0=on, 1=off) (read-only)
bit 0: CPU speed mode (0 = 5.37 MHz, 1 = 3.58 MHz)
+ bit 2: CPU 5.37 MHz turbo available (0 = available) (read-only)
+ bit 7: Firmware switch status (0 = on, 1 = off) (read-only)
-
    in a,(40H)
     cpl
     push af
     ld a,8
-    out (40H),a  ;out the manufacturer code 8 (Panasonic) to I/O port 40h
-    in a,(40H)   ;read the value you have just written
-    cpl          ;complement all bits of the value
-    cp 8         ;if it does not match the value you originally wrote,
-    jr nz,NotWX  ;it is not a WX/WSX/FX.
-    xor a        ;write 0 to I/O port 41h
-    out (41H),a  ;and the mode changes to high-speed clock
-NotWX:
+    out (40H),a    ; out the manufacturer code 8 (Panasonic) to I/O port 40h
+    in a,(40H)     ; read the value you have just written
+    cpl            ; complement all bits of the value
+    cp 8           ; if it does not match the value you originally wrote,
+    jr nz,NoTurbo  ; it does not have the Panasonic expanded I/O ports
+    in a,(41H)
+    bit 2,a        ; is turbo mode available?
+    jr nz,NoTurbo
+    res 0,a
+    out (41H),a    ; enable turbo
+NoTurbo:
     pop af
     out (40H),a