summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2020-04-02 19:04:12 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2020-04-02 19:04:12 -0400
commit59dc46ca8fe1eb6f98abb98fe8579aeaedd2ff15 (patch)
tree4a762bad3013693c8640a36fa626042cfaa13d83 /test
parent6bad8fa605f5011cadab428156c18b4067922185 (diff)
Made the emulator less bloated, and faster.
Diffstat (limited to 'test')
-rw-r--r--test/asr.s8
-rw-r--r--test/subroutine.s48
2 files changed, 30 insertions, 26 deletions
diff --git a/test/asr.s b/test/asr.s
index 4bc388f..c01269e 100644
--- a/test/asr.s
+++ b/test/asr.s
@@ -6,9 +6,10 @@ reset:
cps
start:
- lda.q #$-FFFF
- ldb.q #-1
-
+ lda #0
+ sbc #$FFFF
+ ldb #0
+ deb
signshft:
asr #1
cab
@@ -18,6 +19,5 @@ signshft:
.org $FFC0
.qword reset
.org $0
-v
done
diff --git a/test/subroutine.s b/test/subroutine.s
index 03447fd..65e46ca 100644
--- a/test/subroutine.s
+++ b/test/subroutine.s
@@ -3,7 +3,9 @@ buf:
.org $0
ptr:
-.qword buf
+.qword $0
+ptr2:
+.qword $0
.org $8000
reset:
@@ -13,32 +15,34 @@ reset:
start:
ldy #0
ldb #0
- inb
- stb $C010
- deb
+ tyx
+ lda.w #buf
+ sta.q ptr
+ adc #8
+ sta.q ptr2
+ ;inb
+ ;stb $C010
+ ;deb
+bench:
jsl clr_buf
- jmp start
+ jmp bench
clr_buf:
- lda #0
- cpy.w #$1FFF
- bcs clr_buf_end
- sta.q (ptr), y
- tya
- adc #8
- tay
- tba
- sta.q (ptr), y
- tya
- adc #8
- tay
- tba
- jmp clr_buf
+ tba ; Reset the Accumulator.
+ cpy.w #$1FFF ; Did we clear all of the screen buffer?
+ bcs clr_buf_end ; Yes, so we're done.
+ sta.q (ptr), y ; No, so clear eight bytes.
+ sta.q (ptr2), y ; Clear eight more bytes.
+ tya ; Copy the buffer index.
+ adc #$10 ; Increment the index by 16.
+ tay ; Update the index.
+ jmp clr_buf ; Keep looping.
clr_buf_end:
- ldy.w #0
- rtl
-
+ tay ; Set the index back to zero.
+ rtl ; End of clr_buf.
+;.org $C010
+;.byte $1
.org $FFC0
.qword reset
done