more cleanup in BASIC

This commit is contained in:
FeralChild64 committed 2020-06-28 20:52:49 +02:00
1 parent 0a85c12f42
commit 2085e426c8
8 files changed
+149 -157

No files matched your search

+8 -10
View File
@@ -7,22 +7,20 @@
shift_mem_down:
// Move __memmove_size bytes from __memmove_src to __memmove_dst,
// where __memmove_dst > __memmove_src
// Move memmove__size bytes from memmove__src to memmove__dst, where memmove__dst > memmove__src
//
// This means we have to copy from the back end down.
// This routine assumes the pointers are already pointed
// to the end of the areas, and that Y is correctly initialised
// to allow the copy to begin.
// This routine assumes the pointers are already pointed to the end of the areas, and that .Y is correctly initialized
php
!:
lda (__memmove_src),y
sta (__memmove_dst),y
lda (memmove__src),y
sta (memmove__dst),y
iny
bne !-
inc __memmove_src+1
inc __memmove_dst+1
dec __memmove_size+1
inc memmove__src+1
inc memmove__dst+1
dec memmove__size+1
bne !-
plp
rts
+8 -10
View File
@@ -7,22 +7,20 @@
shift_mem_up:
// Move __memmove_size bytes from __memmove_src to __memmove_dst,
// where __memmove_dst > __memmove_src
// Move memmove__size bytes from memmove__src to memmove__dst, where memmove__dst > memmove__src
//
// This means we have to copy from the back end down.
// This routine assumes the pointers are already pointed
// to the end of the areas, and that Y is correctly initialised
// to allow the copy to begin.
// This routine assumes the pointers are already pointed to the end of the areas, and that .Y is correctly initialized
php
!:
lda (__memmove_src),y
sta (__memmove_dst),y
lda (memmove__src),y
sta (memmove__dst),y
dey
bne !-
dec __memmove_src+1
dec __memmove_dst+1
dec __memmove_size+1
dec memmove__src+1
dec memmove__dst+1
dec memmove__size+1
bne !-
plp
rts
+16 -20
View File
@@ -72,12 +72,10 @@ peek_under_roms_via_FAC1_PLUS_1:
shift_mem_up:
// Move __memmove_size bytes from __memmove_src to __memmove_dst,
// where __memmove_dst > __memmove_src
// Move memmove__size bytes from memmove__src to memmove__dst, where memmove__dst > memmove__src
//
// This means we have to copy from the back end down.
// This routine assumes the pointers are already pointed
// to the end of the areas, and that Y is correctly initialised
// to allow the copy to begin.
// This routine assumes the pointers are already pointed to the end of the areas, and that .Y is correctly initialized
// Unmap BASIC lower ROM
@@ -88,13 +86,13 @@ shift_mem_up:
// Perform the copying
!:
lda (__memmove_src),y
sta (__memmove_dst),y
lda (memmove__src),y
sta (memmove__dst),y
dey
bne !-
dec __memmove_src+1
dec __memmove_dst+1
dec __memmove_size+1
dec memmove__src+1
dec memmove__dst+1
dec memmove__size+1
bne !-
#if HAS_OPCODES_65C02
@@ -106,12 +104,10 @@ shift_mem_up:
shift_mem_down:
// Move __memmove_size bytes from __memmove_src to __memmove_dst,
// where __memmove_dst > __memmove_src
// Move memmove__size bytes from memmove__src to memmove__dst, where memmove__dst > memmove__src
//
// This means we have to copy from the back end down.
// This routine assumes the pointers are already pointed
// to the end of the areas, and that Y is correctly initialised
// to allow the copy to begin.
// This routine assumes the pointers are already pointed to the end of the areas, and that .Y is correctly initialized
// Unmap BASIC lower ROM
@@ -122,13 +118,13 @@ shift_mem_down:
// Perform the copying
!:
lda (__memmove_src),y
sta (__memmove_dst),y
lda (memmove__src),y
sta (memmove__dst),y
iny
bne !-
inc __memmove_src+1
inc __memmove_dst+1
dec __memmove_size+1
inc memmove__src+1
inc memmove__dst+1
dec memmove__size+1
bne !-
// FALLTROUGH
+26 -26
View File
@@ -70,44 +70,44 @@ memmap_allram_routine:
rts
shift_mem_up_routine:
// Move __memmove_size bytes from __memmove_src to __memmove_dst,
// where __memmove_dst > __memmove_src
// Move memmove__size bytes from memmove__src to memmove__dst, where memmove__dst > memmove__src
//
// This means we have to copy from the back end down.
// This routine assumes the pointers are already pointed
// to the end of the areas, and that Y is correctly initialised
// to allow the copy to begin.
// This routine assumes the pointers are already pointed to the end of the areas, and that .Y is correctly initialized
php
jsr memmap_allram
smu1:
lda (__memmove_src),y
sta (__memmove_dst),y
!:
lda (memmove__src),y
sta (memmove__dst),y
dey
bne smu1
dec __memmove_src+1
dec __memmove_dst+1
dec __memmove_size+1
bne smu1
bne !-
dec memmove__src+1
dec memmove__dst+1
dec memmove__size+1
bne !-
plp
jmp memmap_normal
shift_mem_down_routine:
// Move __memmove_size bytes from __memmove_src to __memmove_dst,
// where __memmove_dst > __memmove_src
// Move memmove__size bytes from memmove__src to memmove__dst, where memmove__dst > memmove__src
//
// This means we have to copy from the back end down.
// This routine assumes the pointers are already pointed
// to the end of the areas, and that Y is correctly initialised
// to allow the copy to begin.
// This routine assumes the pointers are already pointed to the end of the areas, and that .Y is correctly initialized
php
jsr memmap_allram
smd1:
lda (__memmove_src),y
sta (__memmove_dst),y
!:
lda (memmove__src),y
sta (memmove__dst),y
iny
bne smd1
inc __memmove_src+1
inc __memmove_dst+1
dec __memmove_size+1
bne smd1
bne !-
inc memmove__src+1
inc memmove__dst+1
dec memmove__size+1
bne !-
plp
jmp memmap_normal