From 51bd39ac8c46c51025bd8a54585c030b02293387 Mon Sep 17 00:00:00 2001 From: nino-porcino Date: Sat, 2 Apr 2022 10:10:13 +0200 Subject: [PATCH] rearrange input buffer and lowram layout to allow longer file names --- demos/sdcard/cmd_help.h | 10 +++++----- demos/sdcard/console.h | 11 ++++++----- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/demos/sdcard/cmd_help.h b/demos/sdcard/cmd_help.h index acca728..d0a65a1 100644 --- a/demos/sdcard/cmd_help.h +++ b/demos/sdcard/cmd_help.h @@ -16,12 +16,12 @@ void comando_help() { } } - // builds the name of the help file - strcpy((char *)KEYBUFSTART, "/HELP/"); - strcat((char *)KEYBUFSTART, filename); - strcat((char *)KEYBUFSTART, ".TXT"); + // builds the name of the help file using the input buffer as buffer + strcpy(KEYBUF, "/HELP/"); + strcat(KEYBUF, filename); + strcat(KEYBUF, ".TXT"); - strcpy(filename, (char *)KEYBUFSTART); + strcpy(filename, KEYBUF); comando_type(); } diff --git a/demos/sdcard/console.h b/demos/sdcard/console.h index 389ab05..a4f7616 100644 --- a/demos/sdcard/console.h +++ b/demos/sdcard/console.h @@ -3,17 +3,18 @@ byte **const BASIC_LOMEM = (byte **) 0x004a; // lomem pointer used by integer BASIC byte **const BASIC_HIMEM = (byte **) 0x004c; // himem pointer used by integer BASIC -byte *const KEYBUF = (byte *) 0x0200; // use the same keyboard buffer as in WOZ monitor + #define KEYBUFSTART (0x200) #define KEYBUFLEN (79) // keyboard buffer 0x200-27F uses only the first 40 bytes, the rest is recycled for free mem -byte *const command = (byte *) (KEYBUFSTART+KEYBUFLEN ); // [6] stores a 5 character command -byte *const filename = (byte *) (KEYBUFSTART+KEYBUFLEN+6 ); // [33] stores a filename or pattern -byte *const hex1 = (byte *) (KEYBUFSTART+KEYBUFLEN+6+33 ); // [5] stores a hex parameter -byte *const hex2 = (byte *) (KEYBUFSTART+KEYBUFLEN+6+33+5); // [5] stores a hex parameter +byte *const filename = (byte *) (KEYBUFSTART ); // $0200-$021F [33] stores a filename or pattern +byte *const KEYBUF = (byte *) 0x0220; // $0220-$026F [80] keyboard input +byte *const hex1 = (byte *) (KEYBUFSTART+33+KEYBUFLEN ); // $0270-$0274 [5] stores a hex parameter +byte *const hex2 = (byte *) (KEYBUFSTART+33+KEYBUFLEN+5 ); // $0275-$0279 [5] stores a hex parameter +byte *const command = (byte *) (KEYBUFSTART+33+KEYBUFLEN+5+5); // $027A-$027F [6] stores a 5 character command const byte OK_RESPONSE = 0x00; const byte WAIT_RESPONSE = 0x01;