Some backspace support for a2e

This commit is contained in:
Luxferre
2022-08-16 16:49:50 +03:00
parent 1f05ca0e90
commit df01a57c03
2 changed files with 7 additions and 2 deletions
+6 -1
View File
@@ -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;
}