From df01a57c03253c37143adaaf81d66e2b44cd7af8 Mon Sep 17 00:00:00 2001 From: Luxferre Date: Tue, 16 Aug 2022 16:49:50 +0300 Subject: [PATCH] Some backspace support for a2e --- Makefile | 2 +- equi.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index f0f5409..c43bb0c 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ CFILES=equi.c PBTDIR=platform-build-tools PERSFILE=PERS.DAT # Apple IIe target configuration -A2FLAGS=-DSTACK_SIZE=256 -DLIT_STACK_SIZE=32 -DGPD_AREA_SIZE=1024 -DCMD_BUF_SIZE=13500 -DCLT_ENTRIES_MAX=256 -DEQUI_TASKS_MAX=4 +A2FLAGS=-DSTACK_SIZE=256 -DLIT_STACK_SIZE=32 -DGPD_AREA_SIZE=1024 -DCMD_BUF_SIZE=13400 -DCLT_ENTRIES_MAX=256 -DEQUI_TASKS_MAX=4 # POSIX desktop target configuration PDFLAGS=-DSTACK_SIZE=256 -DLIT_STACK_SIZE=32 -DGPD_AREA_SIZE=3072 -DCMD_BUF_SIZE=20000 -DCLT_ENTRIES_MAX=512 -DEQUI_TASKS_MAX=8 # Common flags diff --git a/equi.c b/equi.c index e5d108e..cbfe0e9 100644 --- a/equi.c +++ b/equi.c @@ -753,14 +753,19 @@ int main(int argc, char* argv[]) { if(instr == 0xFFU || instr == 0U || instr == 3U || instr == 4U) /* exit on zero byte or ctrl+C or ctrl+D */ break; else if(instr == BS || instr == DEL || instr == CR || instr == LF || instr == ' ' || instr == '\t') { /* ignore the backspace or whitespaces */ - if(!smode) + if(!smode && instr != BS && instr != DEL) cputc(instr); /* echo it if not in silent mode */ if(instr == CR) cputc(LF); if(instr == DEL || instr == BS) { /* simulate backspace */ +#ifdef __CC65__ + if(wherex()>0) + gotox(wherex()-1); +#else cputc(BS); cputc(0x20); cputc(BS); +#endif if(ram.ibp > 0) --ram.ibp; }