do not output unneeded spaces in BASIC messages
This commit is contained in:
1 parent
25feff3fe2
commit
870de4e432
1 file changed
+22
-14
@@ -30,22 +30,34 @@ packed_message_search:
|
|||||||
sec
|
sec
|
||||||
rts
|
rts
|
||||||
|
|
||||||
found_message_in_token_stream:
|
found_message_in_token_stream: // XXX size-optimize this
|
||||||
// Now print each word in the message
|
// Now print each word in the message
|
||||||
phy_trash_a
|
phy_trash_a
|
||||||
lda packed_message_tokens,y
|
lda packed_message_tokens,y
|
||||||
cmp #$ff
|
cmp #$FF
|
||||||
beq !+
|
beq found_message_in_token_stream_done
|
||||||
|
|
||||||
jsr print_packed_word
|
jsr print_packed_word
|
||||||
jsr print_space
|
|
||||||
ply_trash_a
|
ply_trash_a
|
||||||
iny
|
iny
|
||||||
bne found_message_in_token_stream
|
beq found_message_in_token_stream_done
|
||||||
!:
|
!:
|
||||||
|
phy_trash_a
|
||||||
|
lda packed_message_tokens,y
|
||||||
|
cmp #$FF
|
||||||
|
beq found_message_in_token_stream_done
|
||||||
|
|
||||||
|
pha
|
||||||
|
jsr print_space
|
||||||
|
pla
|
||||||
|
|
||||||
|
jsr print_packed_word
|
||||||
|
ply_trash_a
|
||||||
|
iny
|
||||||
|
bne !-
|
||||||
|
|
||||||
|
found_message_in_token_stream_done:
|
||||||
pla
|
pla
|
||||||
// Rub out space at the end
|
|
||||||
lda #$14
|
|
||||||
jsr JCHROUT
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
print_packed_word:
|
print_packed_word:
|
||||||
@@ -93,7 +105,7 @@ packed_word_search:
|
|||||||
found_packed_word:
|
found_packed_word:
|
||||||
|
|
||||||
// Get pointer to start of packed word
|
// Get pointer to start of packed word
|
||||||
// Make sure we don't wrap on a page boundary
|
// Make sure we do not wrap on a page boundary
|
||||||
tya
|
tya
|
||||||
clc
|
clc
|
||||||
adc FRESPC+0
|
adc FRESPC+0
|
||||||
@@ -136,15 +148,11 @@ next_packed_word_char:
|
|||||||
lsr
|
lsr
|
||||||
tax
|
tax
|
||||||
|
|
||||||
// Save Y so it doesn't get clobbered by CHROUT
|
|
||||||
phy_trash_a
|
|
||||||
|
|
||||||
// X=1-14 = first 14 chars, so subtract one
|
// X=1-14 = first 14 chars, so subtract one
|
||||||
lda packed_message_chars-1,x
|
lda packed_message_chars-1,x
|
||||||
jsr JCHROUT
|
jsr JCHROUT // preserves .Y
|
||||||
|
|
||||||
// See if there is a char in the low nybl to print
|
// See if there is a char in the low nybl to print
|
||||||
ply_trash_a
|
|
||||||
lda (FRESPC),y
|
lda (FRESPC),y
|
||||||
and #$0f
|
and #$0f
|
||||||
beq end_of_packed_word
|
beq end_of_packed_word
|
||||||
|
|||||||
Reference in new issue
Block a user