Subversion Repositories Krakow BASIC

Rev

Rev 2 | Rev 4 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 3
Line 1... Line 1...
1
/* $Id: basic.c 2 2024-09-03 11:20:04Z nishi $ */
1
/* $Id: basic.c 3 2024-09-03 11:21:02Z nishi $ */
2
 
2
 
3
/* Krakow BASIC - Multi-platform simple BASIC */
3
/* Krakow BASIC - Multi-platform simple BASIC */
4
 
4
 
5
#if defined(PLATFORM_SHIROI)
5
#if defined(PLATFORM_SHIROI)
6
 
6
 
Line 140... Line 140...
140
	int bg = (a & 0xf);
140
	int bg = (a & 0xf);
141
	if(!(0 <= fg && fg <= 15)) return;
141
	if(!(0 <= fg && fg <= 15)) return;
142
	if(!(0 <= bg && bg <= 15)) return;
142
	if(!(0 <= bg && bg <= 15)) return;
143
	char color[2];
143
	char color[2];
144
	color[1] = 0;
144
	color[1] = 0;
145
	if(bg < 8){
145
	if(bg < 8) {
146
		color[0] = bg + '0';
146
		color[0] = bg + '0';
147
		putstr("\x1b[4");
147
		putstr("\x1b[4");
148
	}else{
148
	} else {
149
		color[0] = (bg - 8) + '0';
149
		color[0] = (bg - 8) + '0';
150
		putstr("\x1b[10");
150
		putstr("\x1b[10");
151
	}
151
	}
152
	putstr(color);
152
	putstr(color);
153
	putstr("m");
153
	putstr("m");
154
	if(fg < 8){
154
	if(fg < 8) {
155
		color[0] = fg + '0';
155
		color[0] = fg + '0';
156
		putstr("\x1b[3");
156
		putstr("\x1b[3");
157
	}else{
157
	} else {
158
		color[0] = (fg - 8) + '0';
158
		color[0] = (fg - 8) + '0';
159
		putstr("\x1b[9");
159
		putstr("\x1b[9");
160
	}
160
	}
161
	putstr(color);
161
	putstr(color);
162
	putstr("m");
162
	putstr("m");