gbdk-2020 | GameBoy Development Kit |
| download: https://git.y1.nz/archives/gbdk.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit 6ef2329db0130911445527cd50dca1b70cf2288f parent 67335e5e285cccceb590626e10e707c2dc5dec9d Author: Toxa <untoxa@mail.ru> Date: Mon, 21 Dec 2020 17:02:04 +0300 input.s fixed Diffstat:
| M | gbdk-lib/examples/gb/rpn/rpn.c | 4 | ++++ |
| M | gbdk-lib/libc/gb/font.s | 12 | ++++++------ |
| M | gbdk-lib/libc/gb/input.s | 4 | ++-- |
3 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/gbdk-lib/examples/gb/rpn/rpn.c b/gbdk-lib/examples/gb/rpn/rpn.c @@ -1,3 +1,4 @@ +#include <gb/font.h> #include <stdio.h> #include <ctype.h> @@ -67,6 +68,9 @@ void main(void) BYTE type; WORD op2; + font_init(); + font_load(font_ibm_fixed); + puts("RPN Calculator"); sp = 0; pos = 0; diff --git a/gbdk-lib/libc/gb/font.s b/gbdk-lib/libc/gb/font.s @@ -85,10 +85,11 @@ font_copy_uncompressed:: dec d 1$: WAIT_STAT - ld a,(bc) ld (hl+),a inc bc + + WAIT_STAT ld a,(bc) ld (hl),a inc bc @@ -164,7 +165,7 @@ font_copy_compressed_grey2: WAIT_STAT ld (hl),b - inc hl + inc l ; can't overflow here ld (hl),c inc hl @@ -464,11 +465,10 @@ _font_init:: call .tmode - ld a,#1 ; We use the first tile as a space _always_ + xor a ld (font_first_free_tile),a ; Clear the font table - xor a ld hl,#font_table ld b,#sfont_handle_sizeof*.MAX_FONTS 1$: @@ -620,10 +620,10 @@ _posy:: ; Banked LD D,#0x20 ; D = width 2$: WAIT_STAT - LD A,(BC) LD (HL+),A INC BC + DEC D JR NZ,2$ DEC E @@ -632,11 +632,11 @@ _posy:: ; Banked LD D,#0x20 3$: WAIT_STAT - LD A,#.SPACE LD (HL+),A DEC D JR NZ,3$ + POP HL POP DE POP BC diff --git a/gbdk-lib/libc/gb/input.s b/gbdk-lib/libc/gb/input.s @@ -584,6 +584,6 @@ _gets:: ; Banked .db 0x3B .ascii "<=>?" .ascii "@ABCDEFGHIJKLMNO" - .ascii "PQRSTUVWXYZ[\\]^_" + .ascii "PQRSTUVWXYZ[\]^_" .ascii "`abcdefghijklmno" - .ascii "pqrstuvwxyz\{\|\}~ " + .ascii "pqrstuvwxyz{|}~ "
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.