Re: Q68 Emulate original QL Keyboard
Posted: Tue Jan 16, 2024 10:50 am
Wonder if all this could be related to the problems I had with Jan's Minerva for Q68, where I never did manage to get it up and running on my 1.05 Q68.
RIP Sir Clive Sinclair 1940 - 2021
https://theqlforum.com/
In v1.6, I've added a 'sf q68_reset' instruction which should reset the Q68 hardware. This seems to cause an immediate lock-up on Mark's Q68 (on my Q68 it seems to do nothing, even when POKEd from BASIC). He could fix it by adding a 2-second delay afterwards, however his Q68 locked up later on (after pressing F1/F2).Peter wrote: Tue Jan 16, 2024 9:50 am They surfaced when Martyn tests his QLNET driver. Unfortunately they are so rare that I can not even reproduce them myself.
I can't say if there is a connection to your problem or not - I simply have no time to dig into https://github.com/janbredenbeek/Minerva4Q68/issues/1 at this time.
Maybe Derek can find out by the delivery date whether your board is affected?
OK, Peter notified me that I got this reset thing wrong... The Q68 can be reset by writing a magic word $BAD0 into hardware register $1C024. POKEing this from BASIC works on SMSQ/E but not from Minerva, because Minerva pokes individual bytes to allow (long) words to be written into odd locations.janbredenbeek wrote: Tue Jan 16, 2024 2:48 pm In v1.6, I've added a 'sf q68_reset' instruction which should reset the Q68 hardware. This seems to cause an immediate lock-up on Mark's Q68 (on my Q68 it seems to do nothing, even when POKEd from BASIC). He could fix it by adding a 2-second delay afterwards, however his Q68 locked up later on (after pressing F1/F2).
The hardware reset by magic word access to $1C024 resets both the CPU and all peripherals except the CP2200.janbredenbeek wrote: Tue Jan 16, 2024 10:26 pm Resetting the Q68 in this way reboots the operating system but leaves the RAM intact, so it should only be used by the Minerva boot loader (LRESPRed from SMSQ/E) or CTRL-ALT-SHIFT-TAB key combination.
No, this reset also disables the ethernet interrupt.janbredenbeek wrote: Tue Jan 16, 2024 10:26 pm It doesn't disable the Ethernet interrupt, but that will be catered for by the hardware initialisation code in Minerva itself.
I am curious whether this does preserve the 68000 registers or not. If not, it won't be possible to do a full hardware reset with CALL 390 because it expects a magic word in register A5 and boot options in D1. At present, it does a RESET instruction (which sends a reset signal to the hardware but doesn't reset the 68000 itself) followed by a jump to the initial PC vector location. Does the CPU in the Q68 do something similar on a RESET instruction?Peter wrote: Wed Jan 17, 2024 9:21 am The hardware reset by magic word access to $1C024 resets both the CPU and all peripherals except the CP2200.
Well, for me the boot loader is just convenient as it eliminates the need for a separate SD card with a FAT32 partition, and running the risk of it getting fragmented with each new build (even Windows command line's COPY is not safe). I use a second FAT16 partition for the builds and just boot it from SMSQ/E.To me, the extra bootloader mainly seems a workaround for not having native access to FAT32 when developing/changing Minerva itself. If there is interest, I can write a little tool that allows to update Q68_ROM.SYS on FAT32 from the QL side instead.
Okay, forget that question... I've tested it by replacing the RESET at $190 with MOVE.W $BAD0,$1C024 and CALL 390 works, so the registers appear to be preserved.janbredenbeek wrote: Wed Jan 17, 2024 1:59 pmI am curious whether this does preserve the 68000 registers or not. If not, it won't be possible to do a full hardware reset with CALL 390 because it expects a magic word in register A5 and boot options in D1. At present, it does a RESET instruction (which sends a reset signal to the hardware but doesn't reset the 68000 itself) followed by a jump to the initial PC vector location. Does the CPU in the Q68 do something similar on a RESET instruction?Peter wrote: Wed Jan 17, 2024 9:21 am The hardware reset by magic word access to $1C024 resets both the CPU and all peripherals except the CP2200.
Random numbers in d1 register?janbredenbeek wrote: Fri Jan 19, 2024 1:56 pmOkay, forget that question... I've tested it by replacing the RESET at $190 with MOVE.W $BAD0,$1C024 and CALL 390 works, so the registers appear to be preserved.janbredenbeek wrote: Wed Jan 17, 2024 1:59 pmI am curious whether this does preserve the 68000 registers or not. If not, it won't be possible to do a full hardware reset with CALL 390 because it expects a magic word in register A5 and boot options in D1. At present, it does a RESET instruction (which sends a reset signal to the hardware but doesn't reset the 68000 itself) followed by a jump to the initial PC vector location. Does the CPU in the Q68 do something similar on a RESET instruction?Peter wrote: Wed Jan 17, 2024 9:21 am The hardware reset by magic word access to $1C024 resets both the CPU and all peripherals except the CP2200.
Now I need to find out why (re)booting Minerva with SHIFT-F1 sometimes gets you 28MB of RAM instead of 128K, which it cannot handle and crashes sooner or later...