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_native_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_native_tile_data(uint16_t start, uint16_t ntiles, const void *src) __z88dk_callee
     11 _set_native_tile_data::
     12         DISABLE_VBLANK_COPY        ; switch OFF copy shadow SAT
     13 
     14         pop bc
     15         pop hl
     16         pop iy
     17         pop de
     18         push bc
     19 
     20         add hl, hl
     21         add hl, hl
     22         add hl, hl
     23 
     24         push hl
     25 
     26         ld bc, #.VDP_COLORDATA0
     27         add hl, bc
     28         ex (sp), hl
     29 
     30         ld bc, #.VDP_TILEDATA0
     31         add hl, bc
     32 
     33         ld c, #.VDP_DATA
     34         inc iyh
     35         inc iyl
     36         jr 2$
     37 
     38 1$:
     39         VDP_WRITE_CMD h, l
     40         ex de, hl
     41         ld b, #8
     42 3$:        
     43         outi
     44         jr nz, 3$
     45         ex de, hl
     46 
     47         ld a, #8
     48         ADD_A_REG16 h, l
     49         ex (sp), hl
     50 
     51         VDP_WRITE_CMD h, l
     52         ex de, hl
     53         ld b, #8
     54 4$:        
     55         outi
     56         jr nz, 4$
     57         ex de, hl
     58 
     59         ld a, #8
     60         ADD_A_REG16 h, l
     61         ex (sp), hl
     62 
     63 2$:
     64         dec iyl
     65         jr  nz, 1$
     66 
     67         dec iyh
     68         jr nz, 1$
     69 
     70         pop hl
     71 
     72         ENABLE_VBLANK_COPY         ; switch ON copy shadow SAT
     73 
     74         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.