Browse Source

Minor ZX Improvements

- Modified so that CPM3 GENCPM output is displayed properly.
patch
Wayne Warthen 5 years ago
parent
commit
3a8ae3cfae
  1. 13
      Tools/unix/zx/zx.c
  2. 38
      Tools/unix/zx/zxcbdos.c
  3. BIN
      Tools/zx/zx-src.zip
  4. BIN
      Tools/zx/zx.exe
  5. BIN
      Tools/zx/zxdbg.exe

13
Tools/unix/zx/zx.c

@ -39,10 +39,12 @@ char *parse_to_fcb(char *s, int afcb)
RAM[afcb] = 0;
memset(fcb, ' ', 11);
while (*s == ' ') ++s;
while (1)
{
if (s[0] == 0) break;
if (s[0] == ' ') {++s; continue; }
if (s[0] == ' ') break;
if (s[1] == ':')
{
RAM[afcb] = s[0] - '@';
@ -353,10 +355,9 @@ int main(int ac, char **av)
str = parse_to_fcb(pCmd, 0x5C);
parse_to_fcb(str, 0x6C);
/* This statement is very useful when creating a client like zxc or zxas
// This statement is very useful when creating a client like zxc or zxas
Msg("Command tail is \"%s\"\n", pCmd);
printf("Command tail is %s\n", pCmd);
*/
load_bios();
memset(RAM + 0xFE9C, 0, 0x64); /* Zap the SCB */
@ -417,8 +418,8 @@ int zx_term(void)
word n;
n = RAM[0x81]; /* Get the return code. This is Hi-Tech C */
n = (n << 8) | RAM[0x80]; /* specific and fails with other COM files */
//n = RAM[0x81]; /* Get the return code. This is Hi-Tech C */
//n = (n << 8) | RAM[0x80]; /* specific and fails with other COM files */
putchar('\n');

38
Tools/unix/zx/zxcbdos.c

@ -28,13 +28,47 @@ void bdos_rdline(word line, word *PC)
void bdos_rdline(word line, word *PC)
{
unsigned char c;
unsigned char *p;
int n;
int maxlen;
if (!line) line = cpm_dma;
maxlen = RAM[line];
fgets((char *)(RAM + line + 2), maxlen, stdin);
RAM[line + 1] = strlen((char *)(RAM + line + 2)) - 1;
// fgets causes extra linefeeds, so we invent our own
//fgets((char *)(RAM + line + 2), maxlen, stdin);
p = (RAM + line + 2);
n = 0;
while (1) {
c = cin();
if (c == '\r')
break;
if (c == '\b') {
if (n > 0) {
cout('\b');
cout(' ');
cout('\b');
n--;
p--;
}
}
else {
if (n < maxlen) {
cout(c);
*p++ = c;
n++;
}
}
}
cout('\r');
*p = '\0';
//RAM[line + 1] = strlen((char *)(RAM + line + 2)) - 1;
RAM[line + 1] = (unsigned char)n;
Msg("Input: [%d] %-*.*s\n", RAM[line + 1], RAM[line + 1], RAM[line +1], (char *)(RAM+line+2));
}

BIN
Tools/zx/zx-src.zip

Binary file not shown.

BIN
Tools/zx/zx.exe

Binary file not shown.

BIN
Tools/zx/zxdbg.exe

Binary file not shown.
Loading…
Cancel
Save