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/sm83/metasprites_hide_spr.s

      1         .include    "global.s"
      2 
      3         .title  "Metasprites"
      4         .module Metasprites
      5 
      6         .globl  ___render_shadow_OAM
      7 
      8         .area   _CODE
      9 
     10 ; void hide_sprites_range(UINT8 from, UINT8 to)
     11 
     12 _hide_sprites_range::
     13         cp      #40
     14         ret     nc
     15 
     16         ld      d, a
     17 
     18         add     a
     19         add     a
     20         ld      c, a
     21 
     22         ld      a, e
     23         sub     d
     24 
     25         ret     c
     26         ret     z
     27 
     28         ld      hl, #___render_shadow_OAM
     29         ld      h, (hl)
     30         ld      l, c
     31 
     32         ld      de, #4
     33 
     34         srl     a
     35         jr      nc, 0$
     36 
     37         ld      (hl), d
     38         add     hl, de
     39 
     40         ret     z               ; z is not affected by 16-bit add
     41 
     42 0$:
     43         srl     a
     44         jr      nc, 1$
     45 
     46         ld      (hl), d
     47         add     hl, de
     48 
     49         ld      (hl), d
     50         add     hl, de
     51 
     52         ret     z               ; z is not affected by 16-bit add
     53 
     54 1$:
     55         ld      (hl), d
     56         add     hl, de
     57 
     58         ld      (hl), d
     59         add     hl, de
     60 
     61         ld      (hl), d
     62         add     hl, de
     63 
     64         ld      (hl), d
     65         add     hl, de
     66 
     67         dec     a
     68         jr      nz, 1$
     69 
     70         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.