aboutsummaryrefslogtreecommitdiff
path: root/comptitle.s.in
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2016-01-06 04:04:57 -0500
committerB. Watson <yalhcru@gmail.com>2016-01-06 04:04:57 -0500
commitd90c75703d7a9ca53fded2a40fa35344279ed843 (patch)
treedd88251aa2aa4c2f5d67abb40c263d7427915bbf /comptitle.s.in
parentad615f1eb4febb59f5148ba356d9ad91dc72db09 (diff)
downloadtaipan-d90c75703d7a9ca53fded2a40fa35344279ed843.tar.gz
document the compression before I forget
Diffstat (limited to 'comptitle.s.in')
-rw-r--r--comptitle.s.in43
1 files changed, 26 insertions, 17 deletions
diff --git a/comptitle.s.in b/comptitle.s.in
index 7862b3d..b8ed688 100644
--- a/comptitle.s.in
+++ b/comptitle.s.in
@@ -1,3 +1,4 @@
+;;; see titlecompression.txt to understand how this works!
; cl65 -o comptitle.xex -t none comptitle.s
@@ -37,6 +38,13 @@ table:
; decompression code starts here
init:
+ lda #0
+
+ ;;; for benchmarking only, remove!
+ ;sta RTCLOK
+ ;sta RTCLOK+1
+ ;sta RTCLOK+2
+
lda #>imgsize
sta pagecount
lda #>compdata
@@ -62,7 +70,22 @@ copyloop:
beq notcode
; got a zero-run code. A = number of bytes of zeroes to store.
- jmp storezerorun
+storezerorun:
+ sty tmp
+ tay
+ dey
+ lda #0
+szloop:
+ sta (dstptr),y
+ jsr incdest
+ beq done
+nohi2:
+ dey
+ bpl szloop
+
+ ldy tmp
+ clc
+ bcc storedone
notcode:
lda tmp
@@ -83,24 +106,10 @@ storedone:
bne copyloop ; always branch (since srcptr never wraps around to 0)
done:
+ ;;; for benchmarking only, remove!
+ ;.byte $02 ; CIM, drops us to atari800 monitor
rts
-storezerorun:
- sty tmp
- tay
- dey
- lda #0
-szloop:
- sta (dstptr),y
- jsr incdest
- beq done
-nohi2:
- dey
- bpl szloop
-
- ldy tmp
- jmp storedone
-
incdest:
inc dstptr
bne iddone