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:
60
LibMultiSpacc/neslib/vram_unrle.s
Normal file
60
LibMultiSpacc/neslib/vram_unrle.s
Normal file
@ -0,0 +1,60 @@
|
||||
|
||||
.importzp TEMP
|
||||
.include "nes.inc"
|
||||
.include "zpvars.inc"
|
||||
.export _vram_unrle
|
||||
|
||||
;void __fastcall__ vram_unrle(const unsigned char *data);
|
||||
|
||||
_vram_unrle:
|
||||
|
||||
tay
|
||||
stx <RLE_HIGH
|
||||
lda #0
|
||||
sta <RLE_LOW
|
||||
|
||||
lda (RLE_LOW),y
|
||||
sta <RLE_TAG
|
||||
iny
|
||||
bne @1
|
||||
inc <RLE_HIGH
|
||||
|
||||
@1:
|
||||
|
||||
lda (RLE_LOW),y
|
||||
iny
|
||||
bne @11
|
||||
inc <RLE_HIGH
|
||||
|
||||
@11:
|
||||
|
||||
cmp <RLE_TAG
|
||||
beq @2
|
||||
sta PPU_DATA
|
||||
sta <RLE_BYTE
|
||||
bne @1
|
||||
|
||||
@2:
|
||||
|
||||
lda (RLE_LOW),y
|
||||
beq @4
|
||||
iny
|
||||
bne @21
|
||||
inc <RLE_HIGH
|
||||
|
||||
@21:
|
||||
|
||||
tax
|
||||
lda <RLE_BYTE
|
||||
|
||||
@3:
|
||||
|
||||
sta PPU_DATA
|
||||
dex
|
||||
bne @3
|
||||
beq @1
|
||||
|
||||
@4:
|
||||
|
||||
rts
|
||||
|
Reference in New Issue
Block a user