From b36cab1c120e997c1afb67cc2bf59edc21cf3775 Mon Sep 17 00:00:00 2001 From: dwsJason Date: Fri, 31 Aug 2018 23:24:12 -0400 Subject: [PATCH] blit.s: more routines for full screen image presents, SCBs, and palettes. import a macros file, to try and get ORCA lup to work --- asm/blit.s | 124 ++++++++++++++++++++++++++++++++++++++++++++++ asm/unroll.macros | 1 + 2 files changed, 125 insertions(+) create mode 100644 asm/unroll.macros diff --git a/asm/blit.s b/asm/blit.s index 4135e88..93c0f0f 100644 --- a/asm/blit.s +++ b/asm/blit.s @@ -8,9 +8,133 @@ longa on longi on + mcopy asm:unroll.macros + Dummy5 start BLITCODE end +PresentPalette start BLITCODE + phb + phk + plb + + tsc + sta stack + + tdc + sta dp + +*--------------------- + + clc + lda #$9E00 +peiloop anop + tcd + adc #$00FF + tcs + + _pushpage + + inc a + cmp #$A000 + bcs done + jmp peiloop + +*--------------------- +done anop + lda dp + tcd + + lda stack + tcs + + plb + rtl +stack ds 2 +dp ds 2 + end + +PresentSCB start BLITCODE + phb + phk + plb + + tsc + sta stack + + tdc + sta dp + +*--------------------- + + lda #$9D00 + tcd + lda #$9DFF + tcs + + lcla &ct +&ct seta 128 +.loop +&ct seta &ct-1 + pei &ct*2 + aif &ct,^loop + +*--------------------- + lda dp + tcd + + lda stack + tcs + + plb + rtl +stack ds 2 +dp ds 2 + end + +PresentFrameBuffer start BLITCODE + + phb + phk + plb + + tsc + sta stack + + tdc + sta dp + +*--------------------- + + clc + lda #$2000 +peiloop anop + tcd + adc #$00FF + tcs + + _pushpage + + inc a + cmp #$9d00 + bcs done + jmp peiloop + +*--------------------- +done anop + lda dp + tcd + + lda stack + tcs + + plb + rtl +stack ds 2 +dp ds 2 + end + + * * void DrawRect(short x, short y, short width, short height) * diff --git a/asm/unroll.macros b/asm/unroll.macros new file mode 100644 index 0000000..a8f0700 --- /dev/null +++ b/asm/unroll.macros @@ -0,0 +1 @@ + MACRO &lab _pushpage &lab lcla &addr &addr seta 254 lcla &loop &loop seta 128 .ploop pei &addr &addr seta &addr-2 &loop seta &loop-1 aif &loop,^ploop MEND macro &lab asl4 &lab lcla &ct &ct seta 4 .top asl a &ct seta &ct-1 aif &ct>0,^top mend \ No newline at end of file