Skip to content

Commit 675461c

Browse files
authored
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.
1 parent 45c4385 commit 675461c

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

mos-platform/cpm65/cpm.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
.ifb \exiter
2727
jmp BIOS
2828
.else
29-
jsr BDOS
29+
jsr BIOS
3030
jmp \exiter
3131
.endif
3232
.endm

mos-platform/cpm65/cpm.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ typedef struct __attribute__((packed)) {
6060
uint16_t drm; /* maximum directory entry number */
6161
uint8_t al[2]; /* directory allocation bitmap */
6262
uint16_t cks; /* checksum vector size */
63-
uint16_t off; /* number of reserved tracks */
63+
uint16_t off; /* number of reserved sectors */
6464
} DPB;
6565

6666
typedef struct __attribute__((packed)) {
@@ -98,13 +98,18 @@ extern uint8_t cpm_cmdlinelen;
9898
extern char cpm_cmdline[0x7f];
9999
extern uint8_t cpm_errno;
100100

101+
enum {
102+
CONIO_READ_POLLING = 0xff00,
103+
CONIO_READ_BLOCKING = 0xfd00
104+
};
105+
101106
/* 0 */ extern __attribute__((leaf)) void _Noreturn cpm_warmboot(void);
102107
/* 1 */ extern __attribute__((leaf)) uint8_t cpm_conin(void);
103108
/* 2 */ extern __attribute__((leaf)) void cpm_conout(uint8_t b);
104109
/* 3 */ extern __attribute__((leaf)) uint8_t cpm_auxin(void);
105110
/* 4 */ extern __attribute__((leaf)) void cpm_auxout(uint8_t b);
106111
/* 5 */ extern __attribute__((leaf)) void cpm_lstout(uint8_t b);
107-
/* 6 */ extern __attribute__((leaf)) uint8_t cpm_conio(uint8_t b);
112+
/* 6 */ extern __attribute__((leaf)) uint8_t cpm_conio(uint16_t b);
108113
/* 7 */ extern __attribute__((leaf)) uint8_t cpm_get_iobyte(void);
109114
/* 8 */ extern __attribute__((leaf)) void cpm_set_iobyte(uint8_t iob);
110115
/* 9 */ extern __attribute__((leaf)) void cpm_printstring_i(uint16_t s);

0 commit comments

Comments
 (0)