Subversion Repositories Shiroi

Rev

Details | Last modification | View Log | RSS feed

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