Q68 Emulate original QL Keyboard

Anything QL Software or Programming Related.
User avatar
Chr$
QL Wafer Drive
Posts: 1315
Joined: Mon May 27, 2019 10:03 am
Location: Sachsen, Germany
Contact:

Q68 Emulate original QL Keyboard

Post by Chr$ »

Merry Christmas everyone.

I've recently been playing around with pre-historic QL games etc but using my Q68. I've been booting it with Jan's Minerva mod for the Q68 (here: https://github.com/janbredenbeek/Minerva4Q68) and in conjunction with Martin's MDI microdrive device driver I can get an original cart assigned as mdv1_ and things look promising for certain ancient follies, despite them obviously being way too fast (something I'll try to cure later). The main issue I have at the moment is that once an old game (e.g. Pudge) is loaded, it fails to respond to the keyboard, so never starts.

Is this because the Q68 with Jan's version of Minerva (and the Q68 in general) is setup to use the PS/2 keyboard and that old software expects something else from the original QL keyboard?

Is there a way to make a Q68 think it's a QL in terms of keyboard input?

Is there a version of JS ROM that can be used on a Q68 (with SD card for win1_, directory and keyboard support) for better compatibility with very old stuff than Minerva? I note that QDOS Classic is mentioned in the Q68 manual, does that exist in a Q68 specific form?

Am I barking up the wrong tree and is it easier to get old stuff working with the Q68 running normal SMSQ/E and then SLUG to slow things down?

I'd be interested to hear how others have got really old stuff working and usable on the wonderful Q68. e.g. for the game Pudge.


https://QXL.WIN
Collector of QL related computers, accessories and QL games/software.
Ask me about felt pads - I can cut them to size and they have proved excellent for mdv data recovery.
User avatar
Peter
Font of All Knowledge
Posts: 2009
Joined: Sat Jan 22, 2011 8:47 am

Re: Q68 Emulate original QL Keyboard

Post by Peter »

Chr$ wrote: Tue Dec 26, 2023 8:26 pm Is this because the Q68 with Jan's version of Minerva (and the Q68 in general) is setup to use the PS/2 keyboard and that old software expects something else from the original QL keyboard?
A few old programs don't get the keyboard input from the OS but access the QL's IPC directly. And the IPC is not implemented in the Q68.
But that is quite rare. More often, there are other issues like copy protection or memory size, which are not Q68 specific.
As a rule of thumb: Almost everything that runs from floppy or Qubide on a QL, also runs on the Q68.
Chr$ wrote: Tue Dec 26, 2023 8:26 pm Is there a way to make a Q68 think it's a QL in terms of keyboard input?
In theory yes. I'd have to implement the IPC and the corresponding parts of the ULA in the FPGA.
Chr$ wrote: Tue Dec 26, 2023 8:26 pm Is there a version of JS ROM that can be used on a Q68 (with SD card for win1_, directory and keyboard support) for better compatibility with very old stuff than Minerva? I note that QDOS Classic is mentioned in the Q68 manual, does that exist in a Q68 specific form?
It does exist, Mark Swift is currently working on adding it to his source tree.
Chr$ wrote: Tue Dec 26, 2023 8:26 pm Am I barking up the wrong tree and is it easier to get old stuff working with the Q68 running normal SMSQ/E and then SLUG to slow things down?
I'd always start with SMSQ/E. QDOS and Minerva rarely bring an advantage for old stuff on the Q68. And you need SLUG anyway for old games.
Chr$ wrote: Tue Dec 26, 2023 8:26 pm I'd be interested to hear how others have got really old stuff working and usable on the wonderful Q68. e.g. for the game Pudge.
Detlef got tons of old stuff running on the Q68. The specific status of Pudge is not known to me.


Derek_Stewart
Font of All Knowledge
Posts: 3975
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: Q68 Emulate original QL Keyboard

Post by Derek_Stewart »

Hi,

The status of Punge is Public Domain, as stated on Rwap web site:
https://www.rwapsoftware.co.uk/pdsoftware.html

Since the game is written in 68000 assembley code, the keyboard is probably accessed directly to the QL IPC. Which Peter says, the Q68 does support.

I will see if the game can be disassembled and see if this problem can be fixed.

Alternatively, Wolgang Lenerz wrote a Boulderdash type game, called BouQLder QLash, which runs on the Q68 under SMSQ/E. Written assembler with source code.
https://www.wlenerz.com/qlstuff/


Regards,

Derek
User avatar
janbredenbeek
Super Gold Card
Posts: 633
Joined: Wed Jan 21, 2015 4:54 pm
Location: Hilversum, The Netherlands

Re: Q68 Emulate original QL Keyboard

Post by janbredenbeek »

Chr$ wrote: Tue Dec 26, 2023 8:26 pm I've recently been playing around with pre-historic QL games etc but using my Q68. I've been booting it with Jan's Minerva mod for the Q68 (here: https://github.com/janbredenbeek/Minerva4Q68) and in conjunction with Martin's MDI microdrive device driver I can get an original cart assigned as mdv1_ and things look promising for certain ancient follies, despite them obviously being way too fast (something I'll try to cure later). The main issue I have at the moment is that once an old game (e.g. Pudge) is loaded, it fails to respond to the keyboard, so never starts.

Is this because the Q68 with Jan's version of Minerva (and the Q68 in general) is setup to use the PS/2 keyboard and that old software expects something else from the original QL keyboard?
It probably reads the keyboard using the KEYROW function. This is emulated through Minerva's IPCOM front-end linked list, but this depends on interrupts being enabled since the keyboard driver reads the keyboard using interrupts and records which keys are held down. If you disable interrupts, this routine doesn't get called so the KEYROW emulation will not work.
Is there a way to make a Q68 think it's a QL in terms of keyboard input?
There is no IPC in the Q68, so trying to read the keyboard by accessing the hardware directly will fail. Minerva has a way to emulate the KEYROW function, but as I mentioned it depends on interrupts being enabled.
I could perhaps change the KEYROW emulator to call the keyboard read routine like it's done under interrupts, but I'm not sure if this would affect normal operation (e.g. key repeat). I have to test this first.
Is there a version of JS ROM that can be used on a Q68 (with SD card for win1_, directory and keyboard support) for better compatibility with very old stuff than Minerva? I note that QDOS Classic is mentioned in the Q68 manual, does that exist in a Q68 specific form?
Like I stated above, the Q68 currently does not emulate the IPC so you need extra code for the keyboard to work. Trouble with JS is that the keyboard handling code has no hooks for this extra code, so you will need either to duplicate this or patch the ROM code itself (the latter will be required anyway for KEYROW).
Am I barking up the wrong tree and is it easier to get old stuff working with the Q68 running normal SMSQ/E and then SLUG to slow things down?
If a program doesn't work under Minerva, it will probably not work under SMSQ/E. But you might give it a try...


User avatar
Chr$
QL Wafer Drive
Posts: 1315
Joined: Mon May 27, 2019 10:03 am
Location: Sachsen, Germany
Contact:

Re: Q68 Emulate original QL Keyboard

Post by Chr$ »

Thanks Peter, Derek, Jan, that's food for thought. I'll keep trying various combinations of things and perhaps make a log of software/games and why they fail to work so that I'll know to try in the future if there are changes made.


https://QXL.WIN
Collector of QL related computers, accessories and QL games/software.
Ask me about felt pads - I can cut them to size and they have proved excellent for mdv data recovery.
User avatar
M68008
Trump Card
Posts: 224
Joined: Sat Jan 29, 2011 1:55 am
Contact:

Re: Q68 Emulate original QL Keyboard

Post by M68008 »

I would try it in Q-emuLator with both Sinclair and Minerva, to see if is a Minerva issue in general, or specific to Q68.

Most games use the keyrow IPC QDOS trap. On Sinclair ROMs, the trap works fine when the rest of the OS is halted or disabled.


User avatar
janbredenbeek
Super Gold Card
Posts: 633
Joined: Wed Jan 21, 2015 4:54 pm
Location: Hilversum, The Netherlands

Re: Q68 Emulate original QL Keyboard

Post by janbredenbeek »

M68008 wrote: Wed Dec 27, 2023 4:28 am I would try it in Q-emuLator with both Sinclair and Minerva, to see if is a Minerva issue in general, or specific to Q68.
Most games use the keyrow IPC QDOS trap. On Sinclair ROMs, the trap works fine when the rest of the OS is halted or disabled.
Yes, but this depends on the IPC hardware being emulated. As Peter wrote, the Q68 currently doesn't emulate the IPC hardware.
Under Minerva there is a possibility to front-end your own routine to the IPC trap, so you can emulate the KEYROW function in software (which Minerva4Q68 does).
I'll see if I can remove the dependency on interrupts, it's probably not a very big change and it's time for a new release anyway as I have the new serial driver ready now.


User avatar
Chr$
QL Wafer Drive
Posts: 1315
Joined: Mon May 27, 2019 10:03 am
Location: Sachsen, Germany
Contact:

Re: Q68 Emulate original QL Keyboard

Post by Chr$ »

M68008 wrote: Wed Dec 27, 2023 4:28 am I would try it in Q-emuLator with both Sinclair and Minerva, to see if is a Minerva issue in general, or specific to Q68.

Most games use the keyrow IPC QDOS trap. On Sinclair ROMs, the trap works fine when the rest of the OS is halted or disabled.
I did that already as a sanity check and Pudge (plus a couple of other things) do work in Q-emuLator under Minerva.
janbredenbeek wrote: Wed Dec 27, 2023 11:01 am Yes, but this depends on the IPC hardware being emulated. As Peter wrote, the Q68 currently doesn't emulate the IPC hardware.
Under Minerva there is a possibility to front-end your own routine to the IPC trap, so you can emulate the KEYROW function in software (which Minerva4Q68 does).
I'll see if I can remove the dependency on interrupts, it's probably not a very big change and it's time for a new release anyway as I have the new serial driver ready now.
Ok, that sounds great. I'll keep an eye out.


https://QXL.WIN
Collector of QL related computers, accessories and QL games/software.
Ask me about felt pads - I can cut them to size and they have proved excellent for mdv data recovery.
Derek_Stewart
Font of All Knowledge
Posts: 3975
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: Q68 Emulate original QL Keyboard

Post by Derek_Stewart »

Hi,

On starting the Pudge game in Qemulator, with Minerva, the game requires F4 to pressed, which is TV Mode (Mode 8) with Second Screen enabled.

I had a quick look at the Pudge game, the game is using the Second Screen area probably to speed up the graphics by temporarily writing the second screen area and flipping the code to QL Screen.

In QPC2, the command QPC_QLSCREMU 8 is entered QPC2 will run the game, if you map DEV1 to the directory and make DEV use flp, like:

The boot files should have this it:

QPC_QLSCREMU 8 : REMark QPC2
DEV_USE 1,"win1_pudge" : REMark location of game files
DEV_USE FLP
LRUN flp1_boot

If SMSqmulator is required to run the game: chnage the QPC_QLSCREMU 8 to JVA_QLSCREMU 8 and the game will run, but too fast.

sQLux runs the game without using Minerva, as the Second Screen is disabled, use JS, JM

But I suppose the games could be disassembled and alter the coding so that it will not use the Second Screen or access the IPC directly.


Regards,

Derek
User avatar
XorA
Site Admin
Posts: 1368
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: Q68 Emulate original QL Keyboard

Post by XorA »

sQLux runs the game without using Minerva, as the Second Screen is disabled, use JS, JM
I guess I should enable that for QL native screen modes :-D


Post Reply