cscg22-gearboy

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

msx_fill_rect.s (601B)


      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        xor a
     16        FAST_MOD8 b #.VDP_MAP_HEIGHT
     17
     18        ld b, d
     19        ld d, a
     20
     21        ld a, c
     22        ld c, e
     23        ld e, a         ; BC = data, DE = YX
     24
     25        jp .fill_rect_xy