aboutsummaryrefslogtreecommitdiff
path: root/libpsn00b/libc
diff options
context:
space:
mode:
authorJohn Wilbert M. Villamor <lameguy64@gmail.com>2019-10-11 10:04:28 +0800
committerJohn Wilbert M. Villamor <lameguy64@gmail.com>2019-10-11 10:04:28 +0800
commitd80d92e13330d527ddb94420b19f9e21bf0e74eb (patch)
treee65c35da97b547f974020fe3f9e429cd9c26e865 /libpsn00b/libc
parent7d001b2a757383665ef3151ed961d921640e00bf (diff)
downloadpsn00bsdk-d80d92e13330d527ddb94420b19f9e21bf0e74eb.tar.gz
Added FntOpen(), FntPrint() and FntFlush(), fixed termPrim() typo, fixed negative values in vsprintf(), added billboard sprites example
Diffstat (limited to 'libpsn00b/libc')
-rw-r--r--libpsn00b/libc/makefile2
-rw-r--r--libpsn00b/libc/putchar.s10
-rw-r--r--libpsn00b/libc/vsprintf.c12
3 files changed, 17 insertions, 7 deletions
diff --git a/libpsn00b/libc/makefile b/libpsn00b/libc/makefile
index 67f2284..c925b53 100644
--- a/libpsn00b/libc/makefile
+++ b/libpsn00b/libc/makefile
@@ -12,7 +12,7 @@ AFILES = $(notdir $(wildcard ./*.s))
OFILES = $(addprefix build/,$(CFILES:.c=.o) $(CXXFILES:.cxx=.o) $(AFILES:.s=.o))
CFLAGS = -g -O2 -msoft-float -fno-builtin -fdata-sections -ffunction-sections -Wa,--strip-local-absolute
-AFLAGS = -g -msoft-float -Wa,--strip-local-absolute
+AFLAGS = -g -msoft-float -Wa,-strip-local-absolute
CC = $(PREFIX)gcc
CXX = $(PREFIX)g++
diff --git a/libpsn00b/libc/putchar.s b/libpsn00b/libc/putchar.s
new file mode 100644
index 0000000..a3f6c57
--- /dev/null
+++ b/libpsn00b/libc/putchar.s
@@ -0,0 +1,10 @@
+.set noreorder
+.section .text
+
+.global putchar
+.type putchar, @function
+putchar:
+ addiu $t2, $0, 0xa0
+ jr $t2
+ addiu $t1, $0, 0x3c
+ \ No newline at end of file
diff --git a/libpsn00b/libc/vsprintf.c b/libpsn00b/libc/vsprintf.c
index 153ca21..361b24e 100644
--- a/libpsn00b/libc/vsprintf.c
+++ b/libpsn00b/libc/vsprintf.c
@@ -51,7 +51,7 @@
#define calculate_real_padding_hex() \
last = 0; \
- for (x = 0; x < 16; x++) \
+ for (x = 0; x < 8; x++) \
if((arg >> (x * 4)) & 0xf) \
last = x; \
\
@@ -125,15 +125,15 @@ unsigned int get_arg_in_size(int size, unsigned long *arg, unsigned int check_si
case SPRINTF_SIZE_LONG:
*arg &= 0xffffffff;
- /*if(check_sign)
+ if(check_sign)
{
if(*arg & (1<<31))
{
- *arg |= (long long)0xffffffff00000000;
+ //*arg |= (long long)0xffffffff00000000;
*arg = ~(*arg - 1);
s = 1;
}
- }*/
+ }
break;
/*case SPRINTF_SIZE_LONG_LONG:
@@ -440,7 +440,7 @@ int vsnprintf(char *string, unsigned int size, const char *fmt, va_list ap)
//printf("argsize = %d\n", argsize);
//if(argsize < SPRINTF_SIZE_LONG_LONG)
- arg = (unsigned long)va_arg(ap, unsigned int);
+ arg = (unsigned long)va_arg(ap, unsigned long);
//else
// arg = va_arg(ap, unsigned long);
@@ -527,7 +527,7 @@ int vsnprintf(char *string, unsigned int size, const char *fmt, va_list ap)
empty_digit = 1;
//if(argsize < SPRINTF_SIZE_LONG_LONG)
- arg = (unsigned long)va_arg(ap, unsigned int);
+ arg = (unsigned long)va_arg(ap, unsigned int);
//else
//arg = va_arg(ap, unsigned long long);