fix bug in calculation of shift memory up bounds, and add debugging
This commit is contained in:
1 parent
e04a648044
commit
885fcca833
1 file changed
+27
-3
@@ -24,9 +24,21 @@ basic_shift_mem_up_and_relink:
|
|||||||
sbc basic_current_line_ptr+1
|
sbc basic_current_line_ptr+1
|
||||||
sta memmove_size+1
|
sta memmove_size+1
|
||||||
lda basic_end_of_text_ptr+0
|
lda basic_end_of_text_ptr+0
|
||||||
sbc #0
|
sbc basic_current_line_ptr+1
|
||||||
sta memmove_size+0
|
sta memmove_size+0
|
||||||
|
|
||||||
|
jsr printf
|
||||||
|
.byte "SHIFTING UP $"
|
||||||
|
.byte $f1,<memmove_size,>memmove_size
|
||||||
|
.byte $f0,<memmove_size,>memmove_size
|
||||||
|
.byte " BYTES FROM $"
|
||||||
|
.byte $f1,<memmove_src,>memmove_src
|
||||||
|
.byte $f0,<memmove_src,>memmove_src
|
||||||
|
.byte " TO $"
|
||||||
|
.byte $f1,<memmove_dst,>memmove_dst
|
||||||
|
.byte $f0,<memmove_dst,>memmove_dst
|
||||||
|
.byte $0d,0
|
||||||
|
|
||||||
;; To make life simple for the copy routine that lives in RAM,
|
;; To make life simple for the copy routine that lives in RAM,
|
||||||
;; we have to adjust the end pointers down one page and set Y to the low
|
;; we have to adjust the end pointers down one page and set Y to the low
|
||||||
;; byte of the copy size.
|
;; byte of the copy size.
|
||||||
@@ -54,6 +66,18 @@ basic_shift_mem_up_and_relink:
|
|||||||
|
|
||||||
stx tokenise_work3
|
stx tokenise_work3
|
||||||
|
|
||||||
|
jsr printf
|
||||||
|
.byte "REVISED BOUNDS $"
|
||||||
|
.byte $f1,<memmove_size,>memmove_size
|
||||||
|
.byte $f0,<memmove_size,>memmove_size
|
||||||
|
.byte " BYTES FROM $"
|
||||||
|
.byte $f1,<memmove_src,>memmove_src
|
||||||
|
.byte $f0,<memmove_src,>memmove_src
|
||||||
|
.byte " TO $"
|
||||||
|
.byte $f1,<memmove_dst,>memmove_dst
|
||||||
|
.byte $f0,<memmove_dst,>memmove_dst
|
||||||
|
.byte $0d,0
|
||||||
|
|
||||||
;; Do the copy
|
;; Do the copy
|
||||||
jsr shift_mem_up
|
jsr shift_mem_up
|
||||||
|
|
||||||
@@ -71,8 +95,8 @@ basic_shift_mem_up_and_relink:
|
|||||||
jsr poke_under_roms
|
jsr poke_under_roms
|
||||||
|
|
||||||
relink_up_next_line:
|
relink_up_next_line:
|
||||||
inc $d020
|
;; inc $d020
|
||||||
jmp relink_up_next_line
|
;; jmp relink_up_next_line
|
||||||
|
|
||||||
ldy #0
|
ldy #0
|
||||||
ldx #<basic_current_line_ptr+0
|
ldx #<basic_current_line_ptr+0
|
||||||
|
|||||||
Reference in new issue
Block a user