Some backspace support for a2e
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user