cscg22-gearboy

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

msx_set_native_data.s (1215B)


      1        .include        "global.s"
      2
      3        .title  "VRAM utilities"
      4        .module VRAMUtils
      5        .ez80
      6        
      7        .area   _HOME
      8
      9; void set_native_tile_data(uint16_t start, uint16_t ntiles, const void *src) __z88dk_callee
     10_set_native_tile_data::
     11        pop bc
     12        pop hl
     13        pop iy
     14        pop de
     15        push bc
     16
     17        add hl, hl
     18        add hl, hl
     19        add hl, hl
     20
     21        push hl
     22
     23        ld bc, #.VDP_COLORDATA0
     24        add hl, bc
     25        ex (sp), hl
     26
     27        ld bc, #.VDP_TILEDATA0
     28        add hl, bc
     29
     30        DISABLE_VBLANK_COPY        ; switch OFF copy shadow SAT
     31
     32        ld c, #.VDP_DATA
     33        inc iyh
     34        inc iyl
     35        jr 2$
     36
     371$:
     38        VDP_WRITE_CMD h, l
     39        ex de, hl
     40        ld b, #8
     413$:        
     42        outi
     43        jr nz, 3$
     44        ex de, hl
     45
     46        ld a, #8
     47        ADD_A_REG16 h, l
     48        ex (sp), hl
     49
     50        VDP_WRITE_CMD h, l
     51        ex de, hl
     52        ld b, #8
     534$:        
     54        outi
     55        jr nz, 4$
     56        ex de, hl
     57
     58        ld a, #8
     59        ADD_A_REG16 h, l
     60        ex (sp), hl
     61
     622$:
     63        dec iyl
     64        jr  nz, 1$
     65
     66        dec iyh
     67        jr nz, 1$
     68
     69        pop hl
     70
     71        ENABLE_VBLANK_COPY         ; switch ON copy shadow SAT
     72
     73        ret