terminal and readme improvements

This commit is contained in:
Luxferre
2022-08-11 23:23:02 +03:00
parent d457e9c56e
commit d48e6df014
2 changed files with 51 additions and 18 deletions
+10 -7
View File
@@ -556,11 +556,6 @@ int main(int argc, char* argv[]) {
uchar instr, bc, mmode = 0;
if(argc > 1 && argv[1][0] == 'm') /* enter minification mode, don't run the programs */
mmode = 1;
/* CC65-specific terminal init */
#ifdef __CC65__
clrscr();
bc = cursor(1);
#endif
/* _attempt_ to disable buffering for char input/output */
#if !defined __CC65__ && !defined __TINYC__
setvbuf(stdin, NULL, _IONBF, 0);
@@ -576,13 +571,21 @@ int main(int argc, char* argv[]) {
/* Start both execution and input buffering from the start of command buffer (-1 because we use prefix increment) */
ram.pc = ram.ibp = 65535U;
if(!mmode) /* skip the greeting if in minification mode */
printf("\nWelcome to Equi v" EQUI_VER " by Luxferre, 2022\nCLT: 0x%04X (%d bytes)\nGPD: 0x%04X (%d bytes)\nCommand buffer: 0x%04X (%d bytes)\nEqui ready\n\n> ",
if(!mmode) { /* skip the terminal init and the greeting if in minification mode */
/* CC65-specific terminal init */
#ifdef __CC65__
clrscr();
bc = cursor(1);
#else /* VT100-compatible terminal init */
puts("\033c");
#endif
printf("Welcome to Equi v" EQUI_VER " by Luxferre, 2022\nCLT: 0x%04X (%d bytes)\nGPD: 0x%04X (%d bytes)\nCommand buffer: 0x%04X (%d bytes)\nEqui ready\n\n> ",
(unsigned int) ((uchar *)&ram.clt - (uchar *)&ram.main_stack),
(unsigned int) ((uchar *)&ram.gpd - (uchar *)&ram.clt),
ram.gpd_start,
ram.cmd_start - ram.gpd_start,
ram.cmd_start, ram.cmd_size);
}
while(1) { /* Now, we're in the command mode loop */
instr = cgetc(); /* Fetch the next instruction from the keyboard/stdin */