gbdk-2020 | GameBoy Development Kit |
| download: https://git.y1.nz/archives/gbdk.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit 8e5ffc95bd802ea04cd88ea0d5881d1284938745 parent c8baae41be1a8f639649e587732509be7dcd564d Author: Toxa <untoxa@mail.ru> Date: Fri, 3 Sep 2021 18:59:14 +0300 cls() resets current x and y position now Diffstat:
| M | gbdk-lib/libc/targets/gbz80/font.s | 21 | +++++++++++---------- |
| M | gbdk-lib/libc/targets/z80/cls.s | 6 | ++++++ |
2 files changed, 17 insertions(+), 10 deletions(-)
diff --git a/gbdk-lib/libc/targets/gbz80/font.s b/gbdk-lib/libc/targets/gbz80/font.s @@ -58,9 +58,6 @@ font_table:: .area _GSINIT - xor a - ld (#.curx),a - ld (#.cury),a ld hl,#.start_font_vars ld c,#(.end_font_vars - .start_font_vars) rst 0x28 @@ -481,12 +478,16 @@ _font_init:: xor a ld (.bg_colour),a - call .cls + call .cls_no_reset_pos pop bc ret _cls:: .cls:: + XOR A + LD (.curx), A + LD (.cury), A +.cls_no_reset_pos: PUSH DE PUSH HL LD HL,#0x9800 @@ -643,12 +644,16 @@ _posy:: POP BC RET - .area _BSS + .area _INITIALIZED .curx:: ; Cursor position .ds 0x01 .cury:: .ds 0x01 + .area _INITIALIZER + .db 0x00 ; .curx + .db 0x00 ; .cury + .area _BASE .globl .drawing_vbl @@ -692,12 +697,8 @@ _posy:: ;; Text mode (out only) .tmode_out:: - XOR A - LD (.curx),A - LD (.cury),A - ;; Clear screen - CALL .cls + CALL .cls_no_reset_pos LD A,#.T_MODE LD (.mode),A diff --git a/gbdk-lib/libc/targets/z80/cls.s b/gbdk-lib/libc/targets/z80/cls.s @@ -3,9 +3,15 @@ .title "console utilities" .module ConsoleUtils + .globl .curx, .cury + .area _HOME _cls:: + ld a, #.SCREEN_X_OFS + ld (.curx), a + ld a, #.SCREEN_Y_OFS + ld (.cury), a DISABLE_VBLANK_COPY ; switch OFF copy shadow SAT ld hl, #(.VDP_TILEMAP + ((.SCREEN_Y_OFS * .VDP_MAP_WIDTH) * 2)) WRITE_VDP_CMD_HL
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.