aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2021-05-20 22:32:04 +0200
committerBad Diode <bd@badd10de.dev>2021-05-20 22:53:09 +0200
commitd81fe3c22410be6beba3577c6985a07483da4694 (patch)
tree232bd4b2867263899b651b342eb38bcbdd50a96c /src/main.c
parentab6fdd0347920cdcda9c4c3c9c3f01996adc48db (diff)
downloaduxngba-d81fe3c22410be6beba3577c6985a07483da4694.tar.gz
uxngba-d81fe3c22410be6beba3577c6985a07483da4694.zip
Apply asie's patch 2 for performance optimizations
This patch replaces the txt_printf with the public domain posprintf library.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index bdff100..6df282d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -39,11 +39,12 @@ nil_talk(Device *d, Uint8 b0, Uint8 w) {
39 39
40void 40void
41console_talk(Device *d, u8 b0, u8 w) { 41console_talk(Device *d, u8 b0, u8 w) {
42 char stmp[2];
42 if(!w) { 43 if(!w) {
43 return; 44 return;
44 } 45 }
45 switch(b0) { 46 switch(b0) {
46 case 0x8: txt_printf("%c", d->dat[0x8]); break; 47 case 0x8: stmp[0] = d->dat[0x8]; stmp[1] = 0; txt_printf(stmp); break;
47 case 0x9: txt_printf("0x%02x", d->dat[0x9]); break; 48 case 0x9: txt_printf("0x%02x", d->dat[0x9]); break;
48 case 0xb: txt_printf("0x%04x", mempeek16(d->dat, 0xa)); break; 49 case 0xb: txt_printf("0x%04x", mempeek16(d->dat, 0xa)); break;
49 case 0xd: txt_printf("%s", &d->mem[mempeek16(d->dat, 0xc)]); break; 50 case 0xd: txt_printf("%s", &d->mem[mempeek16(d->dat, 0xc)]); break;