From: Lukas Krickl Date: Tue, 1 Oct 2024 15:09:00 +0000 (+0200) Subject: strings: fixed puts printing the 0 character X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=a45cd5e2c76f2e6fbfa28236d87591ab4635b392;p=gbrg%2F.git strings: fixed puts printing the 0 character --- diff --git a/src/strings.s b/src/strings.s index 5fd229c..e2691bd 100644 --- a/src/strings.s +++ b/src/strings.s @@ -3,8 +3,10 @@ .rep i, 26, 1, .scc i + 'a' = i + 10 .rep i, 26, 1, .scc i + 'A' = i + 10 +#define EMPTY_TILE 0x30 + ; map space to empty tile -.scc 0x20 = 0x30 +.scc 0x20 = EMPTY_TILE STR_TITLE: .str "game" @@ -18,9 +20,10 @@ STR_TITLE: puts: @loop: ld a, [hl+] + cp a, 0 + jr z, @done REL ld [de], a inc de - cp a, 0 - jp nz, @loop - + jr @loop REL +@done: ret diff --git a/src/video.s b/src/video.s index 7b2144c..d7b97dd 100644 --- a/src/video.s +++ b/src/video.s @@ -28,7 +28,6 @@ lcd_off: lcd_on: ld a, LCDCF_ON | LCDCF_BGON | LCDCF_OBJON ld [RLCD], a - call vblank_wait ret @@ -37,7 +36,7 @@ video_init: ld hl, SCRN0 ld bc, 1024 - ld d, 0 + ld d, EMPTY_TILE call memset ; set up bgp