Page 1 of 1

Enter key not registering in Cloud CP/M 7.7b? (Fixed)

Posted: Sat Apr 01, 2023 9:07 pm
by tastypies
I have stumbled across an issue in v7.7b of Cloud CP/M, where it appears that the C_RAWIO BDOS function no longer registers a carriage return. The function returns all other keyboard characters, but seems not to recognise the enter key - at least not in MAME. This function worked fine in the previous version(s) of Cloud CP/M.

The problem can be reproduced with the code below, or alternatively in ZORK2, which appears to show the same (or similar) issue.

I may well have missed something, so I'd be grateful for any pointers!

Thanks,
D.

Code: Select all


BDOS		equ 05h		; standard cp/m entry
DCONIO		equ 06h		; direct console I/O
INPREQ		equ 0ffh	; console input request

		org 0100h

		ld de,msg			; print 'welcome' msg
		call pstr
loop:
		call getchar		; get a character
		or a			
		jr z,loop		; nothing, so loop
		
		call putchar		; print the character
		jr loop

getchar:	
		push	bc
		push	de
		ld	c,DCONIO	; direct console i/o
		ld	e,INPREQ	; input request
		call	BDOS		; any chr typed?
		pop	de		; if yes, (a)<--char
		pop	bc		; else    (a)<--00h (ignore chr)
		or	a				
		ret
;
putchar:					
		push	bc
		push	de
		push	af
		push	hl
		ld	c,DCONIO	; direct console i/o
		ld	e,a		; output char (a)
		call	BDOS
		pop	hl
		pop	af
		pop	de
		pop	bc
		ret

pstr:
		ld a,(de)		; get a character
		inc de			; bump pointer
		call putchar		; show character
		cp 0dh			; was it a cr?
		jr nz,pstr		; no, next character
		ret			; yes, returns

msg:		db	"Type something:",0ah, 0dh


Re: Enter key not registering in Cloud CP/M 7.7b?

Posted: Sun Apr 02, 2023 3:05 am
by DJ Sures
I'll take a look at it tomorrow and fix it :D I just got home from traveling so won't have time tonight

Re: Enter key not registering in Cloud CP/M 7.7b?

Posted: Sun Apr 02, 2023 3:13 am
by DJ Sures
scratch that - my brain didn't want me to walk away from it haha so I did it. thankfully a quick fix :) v7.8 fixed. Zork away my good man!

Re: Enter key not registering in Cloud CP/M 7.7b?

Posted: Sun Apr 02, 2023 7:40 am
by tastypies
I'm not so bothered about Zork (undoubtedly a fine game), as my own code! :D

Anyway, all working again - thank you for the quick fix!

D.

Re: Enter key not registering in Cloud CP/M 7.7b?

Posted: Sun Apr 02, 2023 8:47 am
by DJ Sures
It was a strange fix too. When I added the telnet console option, I was testing with Microsoft telnet, which sends cr & lf. So I was filtering ascii 13 because the nabu keyboard only uses ascii 10. But for some reason, Zork needed ascii 13, which is strange because the nabu keyboard doesn’t generate ascii 13.

Because we were able to type enter on command line and mbasic and turbo pascal, etc.

But for zork it as a no no. So strange

Re: Enter key not registering in Cloud CP/M 7.7b?

Posted: Sun Apr 02, 2023 12:40 pm
by tastypies
I came across this issue as I was playing with TastyBasic (https://github.com/dimitrit/tastybasic/tree/nabu/src) in Cloud CP/M.

It hadn't occurred to me that the NABU keyboard might not generate ascii 13 -- as mentioned, I've only tried TastyBasic in Mame so far -- so I wonder how this ever worked at all?

Anyway, I'm currently trying to get my head around the TMS9918 VDP, so that I can make TastyBasic a 'proper' NABU application.

Thanks again!

D. :)

Re: Enter key not registering in Cloud CP/M 7.7b?

Posted: Sun Apr 02, 2023 3:48 pm
by DJ Sures
Yeah I’m curious how it worked too. It must be generating 10 & 13. I’ll have to look into it again today and document it correctly in nabulib. Because I might have gotten something wrong.

Let me know if you have any tms99 questions. Also give the nabulib rep a browse on GitHub to see memory address configurations. Specifically how to split the screen into thirds with tiles/color generators or not.

An example of a split screen app is my TurtleBot in GitHub. And examples of non split screen is game5 or brikbattle

Re: Enter key not registering in Cloud CP/M 7.7b? (Fixed)

Posted: Mon Apr 03, 2023 5:19 pm
by DJ Sures
I was backward :D The nabu keyboard sends ascii 13, not 10.
Capture.JPG

Re: Enter key not registering in Cloud CP/M 7.7b? (Fixed)

Posted: Mon Apr 03, 2023 8:28 pm
by tastypies
Ha...that makes a *lot* more sense! Glad the mystery is solved.

D. :D