EDIT: Changed OA-L to OA-O 'Open'. More 128KB fixes.

This commit is contained in:
Bobbi Webber-Manners
2020-08-14 01:03:45 -04:00
parent ecd3093515
commit d9fd0c3f40
2 changed files with 14 additions and 8 deletions

View File

@@ -743,8 +743,11 @@ void change_aux_bank(uint8_t logbank) {
uint8_t open_new_aux_bank(uint8_t partnum) { uint8_t open_new_aux_bank(uint8_t partnum) {
strcpy(userentry, filename); strcpy(userentry, filename);
status[2] = partnum; status[2] = partnum;
if (l_auxbank >= banktbl[0])
return 1;
change_aux_bank(++l_auxbank); change_aux_bank(++l_auxbank);
if (DATASIZE() > 0) { if (DATASIZE() > 0) {
change_aux_bank(--l_auxbank);
return 1; return 1;
} }
strcpy(filename, userentry); strcpy(filename, userentry);
@@ -819,12 +822,15 @@ uint8_t load_file(char *fname, uint8_t replace) {
set_gapbuf(gapbegin++, '\r'); set_gapbuf(gapbegin++, '\r');
col = 0; col = 0;
#ifdef AUXMEM #ifdef AUXMEM
if (replace && (FREESPACE() < 15000)) { if (replace && (FREESPACE() < 15000) && (banktbl[0] > 1)) {
draw_screen(); draw_screen();
if (open_new_aux_bank(++partctr) == 1) { if (open_new_aux_bank(++partctr) == 1) {
sprintf(userentry, sprintf(userentry,
"Buffer [%03u] is used. Truncating file.", l_auxbank); "Buffer [%03u] not avail. Truncating file.", l_auxbank + 1);
show_error(userentry); show_error(userentry);
if (partctr == 1) // If truncated to one part ...
status[2] = 0; // Make it a singleton
partctr = 0; // Prevent status[2] increment below
goto done; goto done;
} }
} }
@@ -2095,11 +2101,11 @@ int edit(char *fname) {
show_error("Can't open"); show_error("Can't open");
draw_screen(); draw_screen();
break; break;
case 0x80 + 'L': // OA-L "Load" case 0x80 + 'O': // OA-O "Open"
case 0x80 + 'l': case 0x80 + 'o':
if (status[0]) if (status[0])
save(); save();
if (prompt_for_name("File to load", 1) == 255) if (prompt_for_name("File to open", 1) == 255)
break; // ESC pressed break; // ESC pressed
if (strlen(userentry) == 0) if (strlen(userentry) == 0)
break; break;
@@ -2111,7 +2117,7 @@ int edit(char *fname) {
gapend = BUFSZ - 1; gapend = BUFSZ - 1;
strcpy(filename, userentry); strcpy(filename, userentry);
if (load_file(filename, 1)) { if (load_file(filename, 1)) {
sprintf(userentry, "Can't load '%s'", filename); sprintf(userentry, "Can't open '%s'", filename);
show_error(userentry); show_error(userentry);
strcpy(filename, ""); strcpy(filename, "");
} }
@@ -2275,7 +2281,7 @@ donehelp:
i = 1; i = 1;
if (open_new_aux_bank(i) == 1) { if (open_new_aux_bank(i) == 1) {
sprintf(userentry, sprintf(userentry,
"Buffer [%03u] is used. Can't extend.", l_auxbank); "Buffer [%03u] not avail. Can't extend.", l_auxbank + 1);
show_error(userentry); show_error(userentry);
break; break;
} }

View File

@@ -14,7 +14,7 @@
--------------------------------------+ Block Commands: --------------------------------------+ Block Commands:
File Management Commands: | {-[Space] Mark start/end of selection File Management Commands: | {-[Space] Mark start/end of selection
{-I Insert file at cursor | {-X Cut selected text {-I Insert file at cursor | {-X Cut selected text
{-L Load file | {-C Copy selected text {-O Open file | {-C Copy selected text
{-N Set file name to save | {-P Paste previous cut or copy {-N Set file name to save | {-P Paste previous cut or copy
{-S Save file | [Delete] Delete selected text {-S Save file | [Delete] Delete selected text
{-A Save all unsaved files | ESC Clear selection {-A Save all unsaved files | ESC Clear selection