cscg22-gearboy

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

init_vram.s (624B)


      1	.include	"global.s"
      2
      3	.area	_HOME
      4
      5	.globl	.init_wtt, .init_btt, .init_vram
      6
      7
      8	;; Initialize window tile table
      9	;; void init_win(char c);
     10_init_win::
     11	PUSH	BC
     12	LDA	HL, 4(SP)
     13	LD	B, (HL)
     14	CALL	.init_wtt
     15	POP	BC
     16	RET
     17	
     18	;; Initialize background tile table
     19	;; void init_bkg(char c);
     20_init_bkg::
     21	PUSH	BC
     22	LDA	HL, 4(SP)
     23	LD	B, (HL)
     24	CALL	.init_btt
     25	POP	BC
     26	RET
     27
     28	;; Fills the VRAM memory region s of size n with c 
     29	;; void _vmemset (void *s, char c, size_t n);
     30_vmemset::
     31	PUSH	BC
     32	LDA	HL, 8(SP)
     33	LD	A, (HL-)
     34	LD	D, A
     35	LD	A, (HL-)
     36	LD	E, A
     37	LD	A, (HL-)
     38	LD	B, A
     39	LD	A, (HL-)
     40	LD	L, (HL)
     41	LD	H, A
     42	CALL	.init_vram
     43	POP	BC
     44	RET