WIP Removed some debug stuff
This commit is contained in:
47
src/basic.c
47
src/basic.c
@@ -54,17 +54,7 @@ void basic_cmd_list(void *data)
|
|||||||
for ( i = 0; i <= limit ; i++ ) {
|
for ( i = 0; i <= limit ; i++ ) {
|
||||||
if ( basic_memory_lines[i][0] != 0 ) {
|
if ( basic_memory_lines[i][0] != 0 ) {
|
||||||
_cputsf("%d ", (char *)(i+1));
|
_cputsf("%d ", (char *)(i+1));
|
||||||
/*itoa(i+1, decimal);
|
|
||||||
_cputs(decimal);
|
|
||||||
_putch(' ');
|
|
||||||
advanceCursor();*/
|
|
||||||
_cputsf("%s\n", basic_memory_lines[i]);
|
_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;
|
char *lineptr;
|
||||||
for ( i = 0; i <= basic_last_stored_lineno ; i++ ) {
|
for ( i = 0; i <= basic_last_stored_lineno ; i++ ) {
|
||||||
basic_errno = 0;
|
basic_errno = 0;
|
||||||
/*lineptr = basic_memory_line_address(i);*/
|
|
||||||
if ( basic_memory_lines[i][0] != 0x00 ) {
|
if ( basic_memory_lines[i][0] != 0x00 ) {
|
||||||
rc = basic_run_line_v2((char *)basic_memory_lines[i], 1);
|
rc = basic_run_line_v2((char *)basic_memory_lines[i], 1);
|
||||||
if ( rc != 0 || basic_errno != 0 ) {
|
if ( rc != 0 || basic_errno != 0 ) {
|
||||||
@@ -136,13 +125,11 @@ char *_tokenize(char *ptr, char *token)
|
|||||||
|
|
||||||
memset(_tokenizer_value, 0x00, BASIC_TOKENIZER_MAX_LENGTH);
|
memset(_tokenizer_value, 0x00, BASIC_TOKENIZER_MAX_LENGTH);
|
||||||
while ( *ptr != 0x0 ) {
|
while ( *ptr != 0x0 ) {
|
||||||
/*for ( tokenptr = token ; *tokenptr != 0x00; tokenptr += 1) {
|
for ( tokenptr = token ; *tokenptr != 0x00; tokenptr += 1) {
|
||||||
if ( *ptr == *tokenptr) {
|
if ( *ptr == *tokenptr) {
|
||||||
goto _tokenize_copy;*/
|
goto _tokenize_copy;
|
||||||
if ( *ptr == ' ' ) {
|
}
|
||||||
break;
|
}
|
||||||
}
|
|
||||||
/*}*/
|
|
||||||
ptr += 1;
|
ptr += 1;
|
||||||
len += 1;
|
len += 1;
|
||||||
}
|
}
|
||||||
@@ -182,7 +169,6 @@ int basic_memory_line_store(char *content, int lineno)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*dest = basic_memory_line_address(lineno);*/
|
|
||||||
if ( lineno > basic_last_stored_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).
|
* 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++ ) {
|
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 */
|
/* We don't need to zero the entire string, just the first character, don't waste time */
|
||||||
basic_memory_lines[i][0] = 0x00;
|
basic_memory_lines[i][0] = 0x00;
|
||||||
/*ptr = basic_memory_line_address(i);*/
|
|
||||||
/*memset(ptr, 0x00, BASIC_MAX_LINE_LENGTH);*/
|
|
||||||
}
|
}
|
||||||
basic_last_stored_lineno = lineno;
|
basic_last_stored_lineno = lineno;
|
||||||
}
|
}
|
||||||
@@ -245,9 +229,6 @@ int basic_run_line_v2(char *codeline, int repl_mode)
|
|||||||
|
|
||||||
/* Report errors */
|
/* Report errors */
|
||||||
if ( basic_errno != 0 ) {
|
if ( basic_errno != 0 ) {
|
||||||
/*_cputs("Last parsed token: ");
|
|
||||||
_cputs(token);
|
|
||||||
_cputs("\n");*/
|
|
||||||
_cputsf("Parsing error: %d", basic_errno);
|
_cputsf("Parsing error: %d", basic_errno);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -297,13 +278,6 @@ void basic_repl(void)
|
|||||||
blankScreen();
|
blankScreen();
|
||||||
setCursorPosition(0, 0);
|
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("Piquant Basic v0.1\n");
|
||||||
_cputs("READY\n");
|
_cputs("READY\n");
|
||||||
|
|
||||||
@@ -311,19 +285,6 @@ void basic_repl(void)
|
|||||||
basic_errno = 0;
|
basic_errno = 0;
|
||||||
if ( basic_repl_mode == 1 ) {
|
if ( basic_repl_mode == 1 ) {
|
||||||
basic_cmd_run(NULL);
|
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;
|
basic_repl_mode = 0;
|
||||||
}
|
}
|
||||||
_cputs("\n> ");
|
_cputs("\n> ");
|
||||||
|
|||||||
16
src/conio.c
16
src/conio.c
@@ -62,22 +62,6 @@ void _cputsf(char *ptr, char *data)
|
|||||||
return;
|
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) {
|
while (*ptr != 0) {
|
||||||
if ( *ptr == '%' ) {
|
if ( *ptr == '%' ) {
|
||||||
ptr += 1;
|
ptr += 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user