Atari joystick without ZXpand+
Re: Atari joystick without ZXpand+
Ah. That makes sense. So the ZXpand+ is its own API and isn't using INKEY$.
All that I've learned - https://msknight.com/bbc/index.html#zx81
Re: Atari joystick without ZXpand+
The manual stated something which made me assume that it was... so I obviously misunderstood it.
INKEY$ can be used to detect the 4 ordinal directions of an attached joystick. No diagonals are usable at this time. The default joystick codes are 6, 7, 5, 8 and 0 which map to the cursor directions.
All that I've learned - https://msknight.com/bbc/index.html#zx81
Re: Atari joystick without ZXpand+
Inkey can only use single keys.
But the ROM reads the keyboard by eight IN commands. Each can have five keys detected which makes the 40 keys.
Games can do the same.
But even with inkey you can use more directions.
If the game takes T for up and V for down, F for left and G for right then R might be up&left, C down&left, B down&right and Y up&right.
Joy81 supports this
But the ROM reads the keyboard by eight IN commands. Each can have five keys detected which makes the 40 keys.
Games can do the same.
But even with inkey you can use more directions.
If the game takes T for up and V for down, F for left and G for right then R might be up&left, C down&left, B down&right and Y up&right.
Joy81 supports this
In theory, there is no difference between theory and practice. But, in practice, there is.
Re: Atari joystick without ZXpand+
That's all good information. Many thanks.
I'm still left with the question of why I told the ZXPand+ to use the keys for Mazogs, but yet still had to download a version altered for joystick so it would work with the spand... if the spand is using inkey.
...or was Mazogs not using inkey and calling the ROM instead?
I'm still left with the question of why I told the ZXPand+ to use the keys for Mazogs, but yet still had to download a version altered for joystick so it would work with the spand... if the spand is using inkey.
...or was Mazogs not using inkey and calling the ROM instead?
All that I've learned - https://msknight.com/bbc/index.html#zx81
Re: Atari joystick without ZXpand+
Of that I'm not Shure.
But if mazogs didn't work without altering then it doesn't look into the systemvariable LASTK (which inkey does) but either uses the ROM call or own routines.
But if mazogs didn't work without altering then it doesn't look into the systemvariable LASTK (which inkey does) but either uses the ROM call or own routines.
In theory, there is no difference between theory and practice. But, in practice, there is.
Re: Atari joystick without ZXpand+
Just to let you know... Kelly has responded to me, so things will move forward
All that I've learned - https://msknight.com/bbc/index.html#zx81
- 1024MAK
- Posts: 5302
- Joined: Mon Sep 26, 2011 10:56 am
- Location: Looking forward to summer in Somerset, UK...
Re: Atari joystick without ZXpand+
BASIC always uses its own ROM routines to read the keyboard.
At the lowest level, this is the Z80 processor using the Z80 machine code IN instruction. Each keyboard half row has its own I/O address. The data returned is one byte, but only five bits are keyboard data. Hence it takes eight IN instructions to read the whole 40 key keyboard. This is what is meant as a keyboard scan.
The ROM decodes the "raw" data to work out which key(s) has been pressed, taking into amount if the SHIFT key was pressed. This data is then put in the system variable (buffer).
Then another part of BASIC reads this value. This is what INKEY$ reads. This is effectively a higher layer.
Because ZXspand uses its own ROM, it can intervene to add joystick support.
Machine code games can either use BASIC to scan the keyboard, taking the result and using it. Or the software author may choose to use their own low level keyboard scan code. If the latter, the ZXpand+ can't intervene, at it does not have the hardware to do this.
Further, because machine code games may only need to detect a limited number of keys, for speed reasons, they will not scan all of the keyboard. This also makes the code short and simple.
Mark
At the lowest level, this is the Z80 processor using the Z80 machine code IN instruction. Each keyboard half row has its own I/O address. The data returned is one byte, but only five bits are keyboard data. Hence it takes eight IN instructions to read the whole 40 key keyboard. This is what is meant as a keyboard scan.
The ROM decodes the "raw" data to work out which key(s) has been pressed, taking into amount if the SHIFT key was pressed. This data is then put in the system variable (buffer).
Then another part of BASIC reads this value. This is what INKEY$ reads. This is effectively a higher layer.
Because ZXspand uses its own ROM, it can intervene to add joystick support.
Machine code games can either use BASIC to scan the keyboard, taking the result and using it. Or the software author may choose to use their own low level keyboard scan code. If the latter, the ZXpand+ can't intervene, at it does not have the hardware to do this.
Further, because machine code games may only need to detect a limited number of keys, for speed reasons, they will not scan all of the keyboard. This also makes the code short and simple.
Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Amp
Standby alert
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Looking forward to summer being good this year.
ZX81 Chip Pin-outs
ZX81 Video Transistor Amp
Standby alert
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Looking forward to summer being good this year.
Re: Atari joystick without ZXpand+
Makes sense... so they can either read inkey$ or go direct to the keyboard themselves... in the latter case, that'll mean code will have to be changed to work.
Thanks for all the detail. I think I've got it straight in my head now.
Thanks for all the detail. I think I've got it straight in my head now.
All that I've learned - https://msknight.com/bbc/index.html#zx81
Re: Atari joystick without ZXpand+
back in 82, I simply cut a hole in the case, put in a joystick port, and hardwired it to the arrow keys... pretty simple....
Zeddy: ZX80, ZX81/ZXpand, TS1000/ZXpand, TS1500/Zxpand+,Printer
Speccy: 48k, +, +2, +3, TS2068, "Bare Metal" Pi, Next KS2, IF1/Microdrives/Vdrive/Light Gun/VGA-Joy
QL: Minerva/QL-VGA/Custom PSU
C5: 24v, LiFE battery, Disc brakes
Speccy: 48k, +, +2, +3, TS2068, "Bare Metal" Pi, Next KS2, IF1/Microdrives/Vdrive/Light Gun/VGA-Joy
QL: Minerva/QL-VGA/Custom PSU
C5: 24v, LiFE battery, Disc brakes
Re: Atari joystick without ZXpand+
You know some people in here are currently chewing on their knuckles and screaming at that revelation... right?
All that I've learned - https://msknight.com/bbc/index.html#zx81