cscg22-gearboy

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

sms_fill_rect.s (692B)


      1        .include        "global.s"
      2
      3        .globl  .fill_rect_xy
      4
      5        .area   _HOME
      6
      7; void fill_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint16_t tile) __z88dk_callee __preserves_regs(iyh, iyl);
      8_fill_rect::
      9        pop hl          ; HL = ret
     10        pop bc          ; BC = YX
     11        pop de          ; DE = WH
     12        ex (sp), hl     ; HL = data
     13        ex de, hl       ; HL = WH, DE = data
     14
     15        ld a, b
     16        ld b, d
     17
     18        add #.SCREEN_Y_OFS
     19        ld d, a
     20        xor a
     21        FAST_MOD8 d #28
     22        ld d, a
     23
     24        ld a, c
     25        add #.SCREEN_X_OFS
     26        and #0x1f
     27        ld c, e
     28        ld e, a         ; BC = data, DE = YX
     29
     30        jp .fill_rect_xy