cscg22-gearboy

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

cpy_data.s (745B)


      1        .include	"global.s"
      2
      3        .area	_HOME
      4
      5        ;; Copy part (size = DE) of the VRAM from (BC) to (HL)
      6.copy_vram::
      7        INC     D
      8        INC     E
      9        JR      2$
     101$:
     11        WAIT_STAT
     12
     13        LD	A,(BC)
     14        LD	(HL+),A
     15        INC	BC
     162$:
     17        DEC     E
     18        JR      NZ, 1$
     19        DEC     D
     20        JR      NZ, 1$
     21        RET
     22
     23_vmemcpy::
     24_set_data::
     25_get_data::
     26        PUSH	BC
     27
     28        LDA	HL,9(SP)	; Skip return address and registers
     29        LD	A,(HL-)		; DE = len
     30        LD	D, A
     31        LD	A,(HL-)
     32        LD	E, A
     33        LD	A,(HL-)		; BC = src
     34        LD	B, A
     35        LD	A,(HL-)
     36        LD	C, A
     37        LD	A,(HL-)		; HL = dst
     38        LD	L,(HL)
     39        LD	H,A
     40
     41        CALL	.copy_vram
     42
     43        POP	BC
     44        RET