Subversion Repositories Shiroi

Rev

Rev 20 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 20 Rev 28
Line 1... Line 1...
1
/* $Id: basic.c 20 2024-08-31 06:50:57Z nishi $ */
1
/* $Id: basic.c 28 2024-08-31 12:49:20Z nishi $ */
2
 
2
 
3
#include "dri/text.h"
3
#include "dri/text.h"
4
 
4
 
5
unsigned char basicbuffer[1024 * 30];
5
unsigned char basicbuffer[1024 * 30];
6
 
6
 
Line 8... Line 8...
8
	clear();
8
	clear();
9
 
9
 
10
	putstr("Shiroi Microcomputer BASIC\r\n");
10
	putstr("Shiroi Microcomputer BASIC\r\n");
11
	putstr("Copyright 2024 by Nishi\r\n");
11
	putstr("Copyright 2024 by Nishi\r\n");
12
	cursor();
12
	cursor();
-
 
13
	int lineind = 0;
13
	while(1){
14
	while(1){
14
		char c = agetch();
15
		char c = agetch();
15
		if(c != 0) killcursor();
16
		if(c != 0) killcursor();
16
		if(c == 1){
17
		if(c == 1){
17
			putstr("Break\r\n");
18
			putstr("Break\r\n");
-
 
19
			lineind = 0;
18
		}else if(c == '\n'){
20
		}else if(c == '\n'){
19
			putstr("\r\n");
21
			putstr("\r\n");
-
 
22
			lineind = 0;
-
 
23
		}else if(c == 0x8){
-
 
24
			if(lineind > 0){
-
 
25
				putstr("\x08 \x08");
-
 
26
				lineind--;
-
 
27
			}
20
		}else if(c != 0){
28
		}else if(c != 0){
21
			putchar(c);
29
			putchar(c);
-
 
30
			lineind++;
22
		}
31
		}
23
		cursor();
32
		cursor();
24
	}
33
	}
25
}
34
}