From c00d2c136076f967fbb39d1faa2d6d731fd52a0e Mon Sep 17 00:00:00 2001 From: dwsJason Date: Sun, 19 Aug 2018 16:11:13 -0400 Subject: [PATCH] DrawSprite: modify ASM function, to be called from ORCA C --- asm/drawsprite.s | 23 +++++++++++++++++++++-- include/system.h | 1 + 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/asm/drawsprite.s b/asm/drawsprite.s index bd9befc..f0e96a8 100644 --- a/asm/drawsprite.s +++ b/asm/drawsprite.s @@ -9,13 +9,32 @@ Dummy4 start ASMCODE end *------------------------------------------------------------------------------- - +* +*void DrrawSprite(int offset, into SpriteNo); +* DrawSprite start ASMCODE + +iOffset equ 5 +iSpriteNo equ 7 + PHB PHK PLB + + lda iOffset,s ; Screen Address + tay ; Y=Target Screen Address ($2000-$9D00) + + lda iSpriteNo,s ASL A ; A=Sprite Number ($0000-$01C1) - TAX ; Y=Target Screen Address ($2000-$9D00) + tax +* Repair Stack + lda 3,s + sta iSpriteNo,s + lda 1,s + sta iSpriteNo-2,s + pla + pla +* Dispatch bank specific LDA xrickNum,X ; Relative Sprite Number Table JMP (xrickBank,X) ; Bank Number Table diff --git a/include/system.h b/include/system.h index 22ef7f0..64e0e87 100644 --- a/include/system.h +++ b/include/system.h @@ -182,6 +182,7 @@ extern volatile unsigned long* tick; extern void SetTileBank(short bank); extern void DrawTile(int offset, int tileNo); extern void SetSpriteBanks(short b0, short b1, short b2, short b3); +extern void DrawSprite(int offset, into SpriteNo); // ADB Support Code extern char KeyArray[128];