From d90c75703d7a9ca53fded2a40fa35344279ed843 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Wed, 6 Jan 2016 04:04:57 -0500 Subject: document the compression before I forget --- comptitle.s.in | 43 ++++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 17 deletions(-) (limited to 'comptitle.s.in') 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 -- cgit v1.2.3