From 675461c3c095488b87c42d9a55df76210ed43e10 Mon Sep 17 00:00:00 2001 From: David Given Date: Sat, 16 Nov 2024 00:08:32 +0100 Subject: [PATCH] Fix some minor CP/M-65 issues. (#384) * Fix a typo where sometimes BIOS functions where being invoked through the BDOS entrypoint (with hilarious consequences). * Fix some a few minor incorrect prototypes. --- mos-platform/cpm65/cpm.S | 2 +- mos-platform/cpm65/cpm.h | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/mos-platform/cpm65/cpm.S b/mos-platform/cpm65/cpm.S index 9524cd4d4..d22de6d55 100644 --- a/mos-platform/cpm65/cpm.S +++ b/mos-platform/cpm65/cpm.S @@ -26,7 +26,7 @@ .ifb \exiter jmp BIOS .else - jsr BDOS + jsr BIOS jmp \exiter .endif .endm diff --git a/mos-platform/cpm65/cpm.h b/mos-platform/cpm65/cpm.h index 2778a6861..5516e978e 100644 --- a/mos-platform/cpm65/cpm.h +++ b/mos-platform/cpm65/cpm.h @@ -60,7 +60,7 @@ typedef struct __attribute__((packed)) { uint16_t drm; /* maximum directory entry number */ uint8_t al[2]; /* directory allocation bitmap */ uint16_t cks; /* checksum vector size */ - uint16_t off; /* number of reserved tracks */ + uint16_t off; /* number of reserved sectors */ } DPB; typedef struct __attribute__((packed)) { @@ -98,13 +98,18 @@ extern uint8_t cpm_cmdlinelen; extern char cpm_cmdline[0x7f]; extern uint8_t cpm_errno; +enum { + CONIO_READ_POLLING = 0xff00, + CONIO_READ_BLOCKING = 0xfd00 +}; + /* 0 */ extern __attribute__((leaf)) void _Noreturn cpm_warmboot(void); /* 1 */ extern __attribute__((leaf)) uint8_t cpm_conin(void); /* 2 */ extern __attribute__((leaf)) void cpm_conout(uint8_t b); /* 3 */ extern __attribute__((leaf)) uint8_t cpm_auxin(void); /* 4 */ extern __attribute__((leaf)) void cpm_auxout(uint8_t b); /* 5 */ extern __attribute__((leaf)) void cpm_lstout(uint8_t b); -/* 6 */ extern __attribute__((leaf)) uint8_t cpm_conio(uint8_t b); +/* 6 */ extern __attribute__((leaf)) uint8_t cpm_conio(uint16_t b); /* 7 */ extern __attribute__((leaf)) uint8_t cpm_get_iobyte(void); /* 8 */ extern __attribute__((leaf)) void cpm_set_iobyte(uint8_t iob); /* 9 */ extern __attribute__((leaf)) void cpm_printstring_i(uint16_t s);