Page 1 of 1

NABU CP/M kbhit,etc not using bdos

Posted: Tue Jan 24, 2023 10:14 pm
by DJ Sures
Hey everyone (not singling out DOM, but he's probably the guy to fix it, haha),

I implemented a virtual 80 column on the NABU Cloud CP/M today. There's a viewport in the double buffer that can be moved around using the page up/down keys. It's fantastic and works great at the command prompt and in programs that require 80 columns.

Except, when building an app with z88dk and using conio.h for kbhit(), the bios CONSTAT is not being used. Is z88dk for CPM assigning its own interrupts to the keyboard? Is that standard practice or z88dk, or can it use the bios conin and constat for kbhit and getchar, respectively? That would also allow my conin cursor to work in z88dk apps that use getchar and getstring and stuff...

Re: NABU CP/M kbhit,etc not using bdos

Posted: Tue Jan 24, 2023 10:50 pm
by dom
Normally we just use the bdos on CP/M, but the Nabu bdos is fairly unfriendly to programs that want to do something different.

See here: https://z88dk.org/forum/viewtopic.php?p=21128#p21128

We normally support direct hardware access as an opt-in and use ROM/bdos routines as a default, but in this case given the problems the default switched to hardware access.

Re: NABU CP/M kbhit,etc not using bdos

Posted: Wed Jan 25, 2023 1:31 am
by DJ Sures
oh i see. I'm using my own bios in cpm, so i have control of bdos - so it functions as it should. So am i stuck with z88 using its own interrupts for stdin?

Let me show you what i created and maybe you have a workaround with a pragma to use bdos with stdin: https://youtu.be/ww3cfBMTU3A

With my latest cloud cpm bios, users can scroll the viewport of a virtual 80 column display

Re: NABU CP/M kbhit,etc not using bdos

Posted: Wed Jan 25, 2023 4:37 am
by DJ Sures
Okay, reading your other post, you don't want interrupts. Can you z88dk +cpm Nabu targets use BDOS for STDIN STDOUT if I change the cloud cp/m not to use interrupts? Currently, all CPM programs work with cloud cp/m virtual 80-column mode except anything made with z88dk.

I'm okay to remove keyboard interrupts from cloud cp/m bios. But without BDOS for stdio, the screen scroll keys don't work. And I suspect you will still have this issue with NABU CPM because it also has virtual 80-column scrolling.

Re: NABU CP/M kbhit,etc not using bdos

Posted: Wed Jan 25, 2023 7:25 am
by DJ Sures
As always - apologies in advance for the multiple posts :) Updating you as I come across tests.

I confirmed that the virtual 80-column scrolling with NABU CPM also does not work with z88dk apps. You can test this with PAGE UP and PAGE DOWN in NABU CPM. Once BDOS is used with z88dk +cpm nabu targets, i'm certain both NABU CPM and Cloud CPM virtual 80 column scrolling will work

Re: NABU CP/M kbhit,etc not using bdos

Posted: Wed Jan 25, 2023 9:01 pm
by DJ Sures
I just realized that if I dropped the subtype=nabu from compiling, I can use nabulib directly, and the +cpm target will use bdos

Re: NABU CP/M kbhit,etc not using bdos

Posted: Wed Jan 25, 2023 10:02 pm
by dom
Indeed - I've added a -subtype=nabubdos to allow creation of discs using libraries that just use BDOS calls.

When the bdos is changed and those issues I mentioned are fixed I'll make sure --hardware-keyboard works as it should and make reading the keyboard without the BDOS opt in.

Re: NABU CP/M kbhit,etc not using bdos

Posted: Wed Jan 25, 2023 11:38 pm
by DJ Sures
Roger! That’s perfect.

Also, do you know the nabu disk cpm diskinfo by chance? To make testing z88dk programs, I’ll make cloud cpm bios use the D: for z88dk disk images

Re: NABU CP/M kbhit,etc not using bdos

Posted: Wed Jan 25, 2023 11:49 pm
by dom
The spec we’re using is here: https://github.com/z88dk/z88dk/blob/mas ... pm2.c#L611

It’s in our spec format but should be convertible to cpmtool.

Re: NABU CP/M kbhit,etc not using bdos

Posted: Thu Jan 26, 2023 2:39 am
by DJ Sures
super thumbs up, dom. i'll add a dpb for it in cloud cpm bios to be d:

Re: NABU CP/M kbhit,etc not using bdos

Posted: Mon Feb 13, 2023 9:08 pm
by dom
It's all gone a bit quiet with the Nabu from my perspective. What's the latest?