Taken from the Export SMS BIOS v1.3 (at address $0461).

;==============================================================
; 1 Bit per Pixel Tile Loader
; HL = Tile data start
; BC = Tiles to load * 8
; A = Color (0~F)
; Uses location (temp) in RAM
;==============================================================
LoadOneBPP:
    ld      (temp),a
loop:
    ld      a,(hl)
    exx    
    ld      bc,$04be    ; 4 bitplanes to do, port $BE
    ld      h,a
    ld      a,(temp)
bitplane:
    rra
    ld      d,h
    jr      c,notnull
    ld      d,$00
notnull:
    out     (c),d
    djnz    bitplane
    exx    
    inc     hl
    dec     bc
    ld      a,b
    or      c
    jr      nz,loop
    ret



Return to top
0.116s