gbdk-2020 | GameBoy Development Kit |
| download: https://git.y1.nz/archives/gbdk.tar.gz | |
| README | Files | Log | Refs | LICENSE |
gbdk-lib/libc/targets/sm83/gprintn.c
1 #include <stdint.h>
2 #include <gb/drawing.h>
3
4 /* Print a number in any radix */
5
6 extern char *digits;
7
8 void gprintn(int8_t number, int8_t radix, int8_t signed_value) NONBANKED
9 {
10 uint8_t i;
11
12 if(number < 0 && signed_value) {
13 wrtchr('-');
14 number = -number;
15 }
16 if((i = (uint8_t)number / (uint8_t)radix) != 0)
17 gprintn(i, radix, UNSIGNED);
18 wrtchr(digits[(uint8_t)number % (uint8_t)radix]);
19 }
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.