NABU CP/M kbhit,etc not using bdos

Discussion about other targets
Post Reply
DJ Sures
Member
Posts: 67
Joined: Sun Dec 11, 2022 12:41 pm

NABU CP/M kbhit,etc not using bdos

Post 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...
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

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

Post 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.
DJ Sures
Member
Posts: 67
Joined: Sun Dec 11, 2022 12:41 pm

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

Post 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
DJ Sures
Member
Posts: 67
Joined: Sun Dec 11, 2022 12:41 pm

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

Post 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.
DJ Sures
Member
Posts: 67
Joined: Sun Dec 11, 2022 12:41 pm

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

Post 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
DJ Sures
Member
Posts: 67
Joined: Sun Dec 11, 2022 12:41 pm

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

Post 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
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

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

Post 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.
DJ Sures
Member
Posts: 67
Joined: Sun Dec 11, 2022 12:41 pm

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

Post 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
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

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

Post 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.
DJ Sures
Member
Posts: 67
Joined: Sun Dec 11, 2022 12:41 pm

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

Post by DJ Sures »

super thumbs up, dom. i'll add a dpb for it in cloud cpm bios to be d:
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

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

Post by dom »

It's all gone a bit quiet with the Nabu from my perspective. What's the latest?
Post Reply