inkey$ command and player choice
inkey$ command and player choice
would it be better for me to program a inkey$ loop instruction instead of Get a$? the zx81 doesn't really have a provision for scanning the keyboard to find a certain key. Still working on treasure hunt, but this aspect of programming is still hard to pull off. I can get away with an input command here or there, but I miss out on declaring other variables. Will this help or not? For those interested, the story is done. It's nothing major, but my goal is to get the game to be just under 4k. thanks in advance.
In Heck, there are two options for perpetual torment:
Eat the Puckerberry and suffer for eternity:
drink nothing but a cocktail of The Last Dab and Mexican Cake blended and served with
habanero slices
Eat the Puckerberry and suffer for eternity:
drink nothing but a cocktail of The Last Dab and Mexican Cake blended and served with
habanero slices
Re: inkey$ command and player choice
A simple wait for a key if you are in SLOW mode:
- loop:
- CALL SCAN
- If key is $FFFF JR Z loop
- CALL DECODE
- RET
Re: inkey$ command and player choice
What it is Martin ?
10 REM loop:
20 REM SCAN
30 If key is $FFFF JR Z loop
40 CALL DECODE
50 RET
Code: Select all
1 FOR A=0 TO 4E4
2 IF INKEY$="" THEN NEXT A
3 PRINT INKEY$
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Re: inkey$ command and player choice
I’m on vacation and don’t have all my ZX81 books and manuals with me.
I’ve looked most of it up, on the Internet.
It’s machine language.
Loop:
LD HL,$FFFF
LD BC, LAST_K
AND A
SBC HL,BC
JR Z Loop
CALL DECODE ($07BD)
PUSH HL
POP BC
RET
100 REM GET KEY
10 LET KEY=USR xxxxx
I’ve looked most of it up, on the Internet.
It’s machine language.
Loop:
LD HL,$FFFF
LD BC, LAST_K
AND A
SBC HL,BC
JR Z Loop
CALL DECODE ($07BD)
PUSH HL
POP BC
RET
100 REM GET KEY
10 LET KEY=USR xxxxx
Re: inkey$ command and player choice
I'm working on a parser for the zx81
my goal is to make a 4k version of the hobbit but with a better parser
Here is what i have so far
my goal is to make a 4k version of the hobbit but with a better parser
Here is what i have so far
- Attachments
-
- parser.z81
- nothing fancy, though the "ok" is missing, seems to work otherwise
- (2.62 KiB) Downloaded 223 times
In Heck, there are two options for perpetual torment:
Eat the Puckerberry and suffer for eternity:
drink nothing but a cocktail of The Last Dab and Mexican Cake blended and served with
habanero slices
Eat the Puckerberry and suffer for eternity:
drink nothing but a cocktail of The Last Dab and Mexican Cake blended and served with
habanero slices
Re: inkey$ command and player choice
here is the second parser (feel free to use it as you see fit)
- Attachments
-
- parset.tzx
- should work...hopefully. crammed as much as i could into 4k
- (2.63 KiB) Downloaded 224 times
In Heck, there are two options for perpetual torment:
Eat the Puckerberry and suffer for eternity:
drink nothing but a cocktail of The Last Dab and Mexican Cake blended and served with
habanero slices
Eat the Puckerberry and suffer for eternity:
drink nothing but a cocktail of The Last Dab and Mexican Cake blended and served with
habanero slices
Re: inkey$ command and player choice
I mostly codemrtinb wrote: ↑Thu Jul 04, 2019 3:37 pm I’m on vacation and don’t have all my ZX81 books and manuals with me.
I’ve looked most of it up, on the Internet.
It’s machine language.
Loop:
LD HL,$FFFF
LD BC, LAST_K
AND A
SBC HL,BC
JR Z Loop
CALL DECODE ($07BD)
PUSH HL
POP BC
RET
100 REM GET KEY
10 LET KEY=USR xxxxx
Loop:
LD BC,( LAST_K)
LD A,C
INC A
JR Z Loop
In BASIC you can also PEEK LAST_K and use the IN ports for input.
- 1024MAK
- Posts: 5118
- Joined: Mon Sep 26, 2011 10:56 am
- Location: Looking forward to summer in Somerset, UK...
Re: inkey$ command and player choice
There is no IN function in ZX81 BASIC, but it is possible to have a short machine code routine in a REM line to perform the Z80 IN.
Mark
Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer 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 later in the year.
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer 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 later in the year.
Re: inkey$ command and player choice
True, we had to buy a fuc*** Spectrum to get 'IN' and the famous 'OUT'!
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
- 1024MAK
- Posts: 5118
- Joined: Mon Sep 26, 2011 10:56 am
- Location: Looking forward to summer in Somerset, UK...
Re: inkey$ command and player choice
The code in this post demonstrates using a small bit of machine code to perform a read from a hardware port using one of the Z80s IN opcodes.
Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer 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 later in the year.
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer 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 later in the year.