diff options
| author | tomas <93524600+TommiRommi@users.noreply.github.com> | 2023-08-04 19:04:49 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-04 13:04:49 -0600 |
| commit | 9d716d921ab6e48e09813636be8acbe77fb26669 (patch) | |
| tree | 5dab79f7a9a92d7962c478504c63cc1189582c9f /src/os | |
| parent | 2e5b2737f3fa8bdde21f493ba3f807b4017b2394 (diff) | |
very cool debug display list (#348)
* added a very cool debug display list ^^ (prints variables to screen)
* Decompiled various functions
Diffstat (limited to 'src/os')
| -rw-r--r-- | src/os/_Printf.c | 10 | ||||
| -rw-r--r-- | src/os/sprintf.c | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/os/_Printf.c b/src/os/_Printf.c index e42bf0428..0442e5fcc 100644 --- a/src/os/_Printf.c +++ b/src/os/_Printf.c @@ -3,6 +3,12 @@ #include <string.h> #include "printf.h" +#if DEBUG +#define STATIC +#else +#define STATIC static +#endif + #define ATOI(i, a) \ for (i = 0; *a >= '0' && *a <= '9'; a++) \ if (i < 999) \ @@ -31,7 +37,7 @@ const u32 flags_arr[] = { FLAGS_SPACE, FLAGS_PLUS, FLAGS_MINUS, FLAGS_HASH, FLAG char _spaces[] = " "; char _zeroes[] = "00000000000000000000000000000000"; -static void _Putfld(printf_struct *, va_list *, u8, u8 *); +STATIC void _Putfld(printf_struct *, va_list *, u8, u8 *); s32 _Printf(char *(*prout)(char *, const char *, size_t), char *dst, const char *fmt, va_list args) { printf_struct sp78; @@ -111,7 +117,7 @@ s32 _Printf(char *(*prout)(char *, const char *, size_t), char *dst, const char } } -static void _Putfld(printf_struct *a0, va_list *args, u8 type, u8 *buff) { +STATIC void _Putfld(printf_struct *a0, va_list *args, u8 type, u8 *buff) { a0->part1_len = a0->num_leading_zeros = a0->part2_len = a0->num_mid_zeros = a0->part3_len = a0->num_trailing_zeros = 0; diff --git a/src/os/sprintf.c b/src/os/sprintf.c index 57a7e99d4..8450fbc53 100644 --- a/src/os/sprintf.c +++ b/src/os/sprintf.c @@ -9,7 +9,7 @@ int sprintf(char *dst, const char *fmt, ...) { s32 written; va_list args; va_start(args, fmt); - written = _Putfld(proutSprintf, dst, fmt, args); + written = _Printf(proutSprintf, dst, fmt, args); if (written >= 0) { dst[written] = 0; } |
