mirror of
https://gitlab.com/octospacc/MultiSpaccSDK
synced 2025-06-05 22:09:21 +02:00
Add NES building and adapt example functions
This commit is contained in:
49
LibMultiSpacc/neslib/memfill.s
Normal file
49
LibMultiSpacc/neslib/memfill.s
Normal 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
|
Reference in New Issue
Block a user