From 10eb159ef889691a082a661e38b1d56a0939b25a Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Sun, 12 May 2024 21:33:55 -0400 Subject: [PATCH] WIP Removed some debug stuff --- src/basic.c | 47 ++++------------------------------------------- src/conio.c | 16 ---------------- 2 files changed, 4 insertions(+), 59 deletions(-) diff --git a/src/basic.c b/src/basic.c index 8c5bb3d..9e194a5 100644 --- a/src/basic.c +++ b/src/basic.c @@ -54,17 +54,7 @@ void basic_cmd_list(void *data) for ( i = 0; i <= limit ; i++ ) { if ( basic_memory_lines[i][0] != 0 ) { _cputsf("%d ", (char *)(i+1)); - /*itoa(i+1, decimal); - _cputs(decimal); - _putch(' '); - advanceCursor();*/ _cputsf("%s\n", basic_memory_lines[i]); - /*_cputs(" "); - _cputs(basic_memory_lines[i]); - _putch('\n'); - _cursor_x = 80; - advanceCursor(); - _cputs("\n");*/ } } } @@ -88,7 +78,6 @@ void basic_cmd_run(void *data) char *lineptr; for ( i = 0; i <= basic_last_stored_lineno ; i++ ) { basic_errno = 0; - /*lineptr = basic_memory_line_address(i);*/ if ( basic_memory_lines[i][0] != 0x00 ) { rc = basic_run_line_v2((char *)basic_memory_lines[i], 1); if ( rc != 0 || basic_errno != 0 ) { @@ -136,13 +125,11 @@ char *_tokenize(char *ptr, char *token) memset(_tokenizer_value, 0x00, BASIC_TOKENIZER_MAX_LENGTH); while ( *ptr != 0x0 ) { - /*for ( tokenptr = token ; *tokenptr != 0x00; tokenptr += 1) { + for ( tokenptr = token ; *tokenptr != 0x00; tokenptr += 1) { if ( *ptr == *tokenptr) { - goto _tokenize_copy;*/ - if ( *ptr == ' ' ) { - break; - } - /*}*/ + goto _tokenize_copy; + } + } ptr += 1; len += 1; } @@ -182,7 +169,6 @@ int basic_memory_line_store(char *content, int lineno) return 1; } - /*dest = basic_memory_line_address(lineno);*/ if ( lineno > basic_last_stored_lineno ) { /* * basic_last_stored_lineno only every grows upward (even if you go back and edit a line or insert one). @@ -192,8 +178,6 @@ int basic_memory_line_store(char *content, int lineno) for ( i = basic_last_stored_lineno+1; i <= lineno ; i++ ) { /* We don't need to zero the entire string, just the first character, don't waste time */ basic_memory_lines[i][0] = 0x00; - /*ptr = basic_memory_line_address(i);*/ - /*memset(ptr, 0x00, BASIC_MAX_LINE_LENGTH);*/ } basic_last_stored_lineno = lineno; } @@ -245,9 +229,6 @@ int basic_run_line_v2(char *codeline, int repl_mode) /* Report errors */ if ( basic_errno != 0 ) { - /*_cputs("Last parsed token: "); - _cputs(token); - _cputs("\n");*/ _cputsf("Parsing error: %d", basic_errno); return 1; } @@ -297,13 +278,6 @@ void basic_repl(void) blankScreen(); setCursorPosition(0, 0); - /* - * basic_repl_mode = 1; - * basic_memory_line_store("LIST", 10); - * basic_memory_line_store("PRINT HELLO\\n", 20); - * basic_memory_line_store("PRINT WORLD\\n", 30); - * basic_memory_line_store("PRINT GOODBYE\\n", 40); - */ _cputs("Piquant Basic v0.1\n"); _cputs("READY\n"); @@ -311,19 +285,6 @@ void basic_repl(void) basic_errno = 0; if ( basic_repl_mode == 1 ) { basic_cmd_run(NULL); - /*basic_cmd_list(NULL); - ptr = _tokenize((char *)&basic_memory_lines[19], " "); - token = tokenizer_token(); - basic_cmd_print(ptr); - ptr = _tokenize((char *)&basic_memory_lines[29], " "); - token = tokenizer_token(); - basic_cmd_print(ptr); - ptr = _tokenize((char *)&basic_memory_lines[39], " "); - token = tokenizer_token(); - basic_cmd_print(ptr); - basic_run_line_v2(basic_memory_lines[19], 1); - basic_run_line_v2(basic_memory_lines[29], 1); - basic_run_line_v2(basic_memory_lines[39], 1);*/ basic_repl_mode = 0; } _cputs("\n> "); diff --git a/src/conio.c b/src/conio.c index 52a84b3..a265c0f 100644 --- a/src/conio.c +++ b/src/conio.c @@ -62,22 +62,6 @@ void _cputsf(char *ptr, char *data) return; } - /*_cputs("_cputsf called with ptr : "); - memset(decimal, 0x00, 32); - itoa((int)ptr, decimal); - _cputs(decimal); - _cputs(" ("); - _cputs(ptr); - _cputs(") length "); - memset(decimal, 0x00, 32); - itoa(strlen(ptr), decimal); - _cputs(decimal); - _cputs(" data "); - memset(decimal, 0x00, 32); - itoa((int)data, decimal); - _cputs(decimal); - _cputs("\n");*/ - while (*ptr != 0) { if ( *ptr == '%' ) { ptr += 1;