cscg22-gearboy

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

gotoxy.s (541B)


      1        .include        "global.s"
      2
      3        .title  "console utilities"
      4        .module ConsoleUtils
      5
      6        .globl  .curx, .cury
      7
      8        .area   _HOME
      9
     10_gotoxy::
     11        pop hl
     12        pop de
     13        push de
     14        push hl
     15
     16        ld a, #.SCREEN_X_OFS
     17        add e
     18        ld (.curx), a
     19        ld a, #.SCREEN_Y_OFS
     20        add d
     21        ld (.cury), a
     22        ret
     23
     24_posx::
     25        ld a, (.curx)
     26        sub #.SCREEN_X_OFS
     27        ld l, a
     28        ret
     29
     30_posy::
     31        ld a, (.cury)
     32        sub #.SCREEN_Y_OFS
     33        ld l, a
     34        ret