Subversion Repositories Shiroi

Rev

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

Rev 29 Rev 32
Line 1... Line 1...
1
/* $Id: text.c 29 2024-08-31 17:41:43Z nishi $ */
1
/* $Id: text.c 32 2024-09-01 08:51:40Z 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 147... Line 147...
147
void putnum(int num){
147
void putnum(int num){
148
	int i;
148
	int i;
149
	char buffer[513];
149
	char buffer[513];
150
	buffer[512] = 0;
150
	buffer[512] = 0;
151
	int incr = 511;
151
	int incr = 511;
-
 
152
	char m = num < 0 ? 1 : 0;
152
	while(1){
153
	while(1){
-
 
154
		int l = modl(num, 10);
-
 
155
		if(l < 0) l = -l;
153
		buffer[incr--] = '0' + modl(num, 10);
156
		buffer[incr--] = '0' + l;
154
		num = divl(num, 10);
157
		num = divl(num, 10);
155
		if(num == 0) break;
158
		if(num == 0) break;
156
	}
159
	}
-
 
160
	if(m == 1){
-
 
161
		buffer[incr--] = '-';
-
 
162
	}
157
	putstr(buffer + incr + 1);
163
	putstr(buffer + incr + 1);
158
}
164
}
159
 
165
 
160
void text_init(void){
166
void text_init(void){
161
	posx = 0;
167
	posx = 0;