cscg22-gearboy

CSCG 2022 Challenge 'Gearboy'
git clone https://git.sinitax.com/sinitax/cscg22-gearboy
Log | Files | Refs | sfeed.txt

cls.s (698B)


      1        .include        "global.s"
      2
      3        .title  "console utilities"
      4        .module ConsoleUtils
      5
      6        .globl  .curx, .cury
      7
      8        .area   _HOME
      9
     10_cls::
     11        ld a, #.SCREEN_X_OFS
     12        ld (.curx), a
     13        ld a, #.SCREEN_Y_OFS
     14        ld (.cury), a
     15
     16        DISABLE_VBLANK_COPY     ; switch OFF copy shadow SAT
     17
     18        ld hl, #(.VDP_TILEMAP + ((.SCREEN_Y_OFS * .VDP_MAP_WIDTH) * 2))
     19        WRITE_VDP_CMD_HL
     20
     21        ld hl, #.SPACE
     22        ld bc, #(.SCREEN_HEIGHT * .VDP_MAP_WIDTH)
     23        inc b
     24        inc c
     25        jr 1$
     262$:
     27        WRITE_VDP_DATA_HL
     281$:
     29        dec c
     30        jr nz, 2$
     31        djnz 2$ 
     32
     33        ENABLE_VBLANK_COPY         ; switch ON copy shadow SAT
     34        ret