git.y1.nz

gbdk-2020

GameBoy Development Kit
download: https://git.y1.nz/archives/gbdk.tar.gz
README | Files | Log | Refs | LICENSE

gbdk-lib/libc/targets/z80/msxdos/msx_set_1bpp_data.s

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

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.