Add NES building and adapt example functions

This commit is contained in:
2023-11-01 13:58:22 +01:00
parent 5c404b5faf
commit 9be90d7629
33 changed files with 3951 additions and 35 deletions

View File

@ -0,0 +1,49 @@
.importzp TEMP
.import popa, popax
.include "zpvars.inc"
.export _memfill
;void __fastcall__ memfill(void *dst,unsigned char value,unsigned int len);
_memfill:
sta <LEN
stx <LEN+1
jsr popa
sta <TEMP
jsr popax
sta <DST
stx <DST+1
ldx #0
@1:
lda <LEN+1
beq @2
jsr @3
dec <LEN+1
inc <DST+1
jmp @1
@2:
ldx <LEN
beq @5
@3:
ldy #0
lda <TEMP
@4:
sta (DST),y
iny
dex
bne @4
@5:
rts