Changeset 193 in Main for trunk/Server/main.c
- Timestamp:
- Sep 29, 2024, 2:55:18 PM (7 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Server/main.c
r191 r193 309 309 void tt_putstr(const char* str) { 310 310 int i; 311 for(i = 0; str[i] != 0; i++) {311 for(i = 0; str[i] != 0; i++) { 312 312 tvram[tt_y * tt_width + tt_x] = str[i]; 313 if(str[i] == '\n') {313 if(str[i] == '\n') { 314 314 tt_x = 0; 315 315 tt_y++; 316 } else{316 } else { 317 317 tt_x++; 318 if(tt_x == tt_width) {318 if(tt_x == tt_width) { 319 319 tt_x = 0; 320 320 tt_y++; 321 321 } 322 322 } 323 if(tt_y == tt_height) {323 if(tt_y == tt_height) { 324 324 tt_y--; 325 325 int x, y; 326 for(y = 0; y < tt_height - 1; y++) {327 for(x = 0; x < tt_width; x++) {326 for(y = 0; y < tt_height - 1; y++) { 327 for(x = 0; x < tt_width; x++) { 328 328 tvram[y * tt_width + x] = tvram[(y + 1) * tt_width + x]; 329 329 } 330 330 } 331 for(x = 0; x < tt_width; x++) {331 for(x = 0; x < tt_width; x++) { 332 332 tvram[(tt_height - 1) * tt_width + x] = 0; 333 333 } … … 336 336 } 337 337 338 void tt_putchar(struct rsx_buffer* buffer, int x, int y, uint8_t c) {338 void tt_putchar(struct rsx_buffer* buffer, int x, int y, uint8_t c) { 339 339 int i, j; 340 340 if(c < 0x20) c = 0x20; 341 341 if(c >= 0x7f) c = 0x20; 342 for(i = 0; i < 7; i++) {342 for(i = 0; i < 7; i++) { 343 343 uint8_t l = font[(c - 0x20) * 8 + i]; 344 for(j = 0; j < 5; j++) {344 for(j = 0; j < 5; j++) { 345 345 uint32_t c = 0; 346 if(l & (1 << 7)) {346 if(l & (1 << 7)) { 347 347 c = 0xffffff; 348 348 } … … 388 388 if(tmpl[i] == '%') { 389 389 i++; 390 if(tmpl[i] == 's') {390 if(tmpl[i] == 's') { 391 391 char* tmp = log; 392 392 log = cm_strcat(tmp, va_arg(va, char*)); 393 393 free(tmp); 394 } else if(tmpl[i] == 'd'){394 } else if(tmpl[i] == 'd') { 395 395 char buf[513]; 396 396 sprintf(buf, "%d", va_arg(va, int)); … … 398 398 log = cm_strcat(tmp, buf); 399 399 free(tmp); 400 } else if(tmpl[i] == '%'){400 } else if(tmpl[i] == '%') { 401 401 char* tmp = log; 402 402 log = cm_strcat(tmp, "%");
Note:
See TracChangeset
for help on using the changeset viewer.