added code to move array area, if needed
This commit is contained in:
1 parent
2f4d50454c
commit
33d49c27d7
2 files changed
+43
-1
No files matched your search
@@ -104,6 +104,7 @@ assign_variable_common_1:
|
||||
bpl assign_variable_not_array_2
|
||||
|
||||
// Yes, this is an array - preserve FAC1 values which might get overwritten
|
||||
// XXX adapt this for floats!
|
||||
|
||||
ldx #$04
|
||||
!:
|
||||
@@ -136,6 +137,7 @@ assign_variable_common_1:
|
||||
assign_variable_arr_ret:
|
||||
|
||||
// Restore FAC1 values
|
||||
// XXX adapt this for floats!
|
||||
|
||||
ldx #$04
|
||||
!:
|
||||
|
||||
@@ -116,7 +116,43 @@ fetch_variable_alocate:
|
||||
|
||||
fetch_variable_alocate_space_OK:
|
||||
|
||||
// If needed, move all the arrays up
|
||||
// If arrays exist, we need to move them upwards
|
||||
|
||||
sec
|
||||
lda STREND+0
|
||||
sta memmove__src+0
|
||||
sbc ARYTAB+0
|
||||
sta memmove__size+0
|
||||
lda STREND+1
|
||||
sta memmove__src+1
|
||||
sbc ARYTAB+1
|
||||
sta memmove__size+1
|
||||
|
||||
ora memmove__size+0
|
||||
beq fetch_variable_alocate_adjust_vars
|
||||
|
||||
// Indeed, there are arrays - adjust size, calculate the destination and perform copytin
|
||||
|
||||
#if !HAS_OPCODES_65CE02
|
||||
inc memmove__size+0
|
||||
bne !+
|
||||
inc memmove__size+1
|
||||
!:
|
||||
#else // HAS_OPCODES_65CE02
|
||||
inw memmove__size
|
||||
#endif
|
||||
|
||||
clc
|
||||
lda memmove__src+0
|
||||
adc #$07
|
||||
sta memmove__dst+0
|
||||
lda memmove__src+1
|
||||
adc #$00
|
||||
sta memmove__dst+1
|
||||
|
||||
jsr shift_mem_up
|
||||
|
||||
// Now, we need to recreate the back-pointers
|
||||
|
||||
#if CONFIG_MEMORY_MODEL_60K
|
||||
|
||||
@@ -139,6 +175,10 @@ fetch_variable_alocate_space_OK:
|
||||
|
||||
#endif
|
||||
|
||||
// FALLTROUGH
|
||||
|
||||
fetch_variable_alocate_adjust_vars:
|
||||
|
||||
// Adjust ARYTAB and STREND
|
||||
|
||||
clc
|
||||
|
||||
Reference in new issue
Block a user