cscg22-gearboy

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

msx_metasprites_hide.s (675B)


      1        .include    "global.s"
      2
      3        .title  "Metasprites"
      4        .module Metasprites
      5
      6        .globl  ___current_metasprite, ___render_shadow_OAM
      7
      8        .area   _CODE
      9
     10
     11; void __hide_metasprite(uint8_t id) __z88dk_fastcall __preserves_regs(iyh,iyl);
     12
     13___hide_metasprite::
     14        ld      e, l
     15
     16        ld      hl, (___current_metasprite)
     17
     18        ld      bc, #4
     19
     20        ld      a, (___render_shadow_OAM)
     21        ld      d, a
     221$:
     23        ld      a, (hl)
     24        cp      #0x80
     25        ret     z
     26
     27        ld      a, #0x1F
     28        cp      e
     29        ret     c
     30
     31        add     hl, bc
     32
     33        ld      a, #0xC0
     34        ld      (de), a
     35
     36        inc     e
     37        jp      1$