Subversion Repositories Shiroi

Rev

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

Rev 28 Rev 29
Line 1... Line 1...
1
/* $Id: text.c 28 2024-08-31 12:49:20Z nishi $ */
1
/* $Id: text.c 29 2024-08-31 17:41:43Z nishi $ */
2
 
2
 
3
#include "text.h"
3
#include "text.h"
4
 
4
 
5
#include "video.h"
5
#include "video.h"
6
#include "math.h"
6
#include "math.h"
Line 64... Line 64...
64
void clear(void){
64
void clear(void){
65
	int i;
65
	int i;
66
	int size = muli(scrwidth, scrheight);
66
	int size = muli(scrwidth, scrheight);
67
	setvramaddr(0);
67
	setvramaddr(0);
68
	for(i = 0; i < size; i++) vramchar(' ');
68
	for(i = 0; i < size; i++) vramchar(' ');
-
 
69
	posx = 0;
-
 
70
	posy = 0;
69
}
71
}
70
 
72
 
71
void print_ptr(void* ptr){
73
void print_ptr(void* ptr){
72
	unsigned short p = (unsigned short)ptr;
74
	unsigned short p = (unsigned short)ptr;
73
	int i;
75
	int i;
Line 140... Line 142...
140
void putstr(char* str){
142
void putstr(char* str){
141
	int i;
143
	int i;
142
	for(i = 0; str[i] != 0; i++) putchar(str[i]);
144
	for(i = 0; str[i] != 0; i++) putchar(str[i]);
143
}
145
}
144
 
146
 
-
 
147
void putnum(int num){
-
 
148
	int i;
-
 
149
	char buffer[513];
-
 
150
	buffer[512] = 0;
-
 
151
	int incr = 511;
-
 
152
	while(1){
-
 
153
		buffer[incr--] = '0' + modl(num, 10);
-
 
154
		num = divl(num, 10);
-
 
155
		if(num == 0) break;
-
 
156
	}
-
 
157
	putstr(buffer + incr + 1);
-
 
158
}
-
 
159
 
145
void text_init(void){
160
void text_init(void){
146
	posx = 0;
161
	posx = 0;
147
	posy = 0;
162
	posy = 0;
148
	curx = 0;
163
	curx = 0;
149
	cury = 0;
164
	cury = 0;