fix some bugs with unpacking literal chars

This commit is contained in:
Paul Gardner-Stephen committed 2019-04-25 21:52:09 +09:30
1 parent d8c236009d
commit 54b0cff2fd
2 files changed
+11 -2

No files matched your search

-1
View File
@@ -107,7 +107,6 @@ end_string_if_required:
end_string: end_string:
;; Write end of string sequence if required ;; Write end of string sequence if required
inc $d020
lda #$00 lda #$00
jsr write_unpacked_char jsr write_unpacked_char
rts rts
+11 -1
View File
@@ -115,6 +115,8 @@ next_packed_word_char:
lda (temp_string_ptr),y lda (temp_string_ptr),y
cmp #$00 cmp #$00
beq end_of_packed_word beq end_of_packed_word
cmp #$fe
beq last_literal
and #$f0 and #$f0
beq end_of_packed_word beq end_of_packed_word
@@ -189,7 +191,15 @@ end_of_packed_word:
;; Hit end of packed data ;; Hit end of packed data
rts rts
last_literal:
jsr unpack_literal_char
rts
next_is_literal_char: next_is_literal_char:
jsr unpack_literal_char
jmp ready_for_next_char
unpack_literal_char:
;; Output the literal char, and ready for next char ;; Output the literal char, and ready for next char
iny iny
tya tya
@@ -198,7 +208,7 @@ next_is_literal_char:
jsr $ffd2 jsr $ffd2
pla pla
tay tay
jmp ready_for_next_char rts
is_uncommon_char: is_uncommon_char:
;; Lower nybl has offset into low-frequency part of the table ;; Lower nybl has offset into low-frequency part of the table