added missing code for some meory models

This commit is contained in:
FeralChild64 committed 2020-07-18 21:20:55 +02:00
1 parent e99bb9356a
commit 080ea5dab5
4 files changed
+89 -12

No files matched your search

+2 -2
View File
@@ -39,9 +39,9 @@
// Memory model
#define CONFIG_MEMORY_MODEL_38K
// #define CONFIG_MEMORY_MODEL_38K
// #define CONFIG_MEMORY_MODEL_46K
// #define CONFIG_MEMORY_MODEL_50K
#define CONFIG_MEMORY_MODEL_50K
// #define CONFIG_MEMORY_MODEL_60K
@@ -0,0 +1,53 @@
// #LAYOUT# STD * #TAKE-HIGH
// #LAYOUT# * BASIC_0 #TAKE-HIGH
// #LAYOUT# * * #IGNORE
// This has to go $E000 or above - routines below banks out the main BASIC ROM!
//
// Helper routine for string concatenation
//
#if CONFIG_MEMORY_MODEL_46K || CONFIG_MEMORY_MODEL_50K
helper_add_concat:
// Unmap BASIC lower ROM
lda #$26
sta CPU_R6510
// Copy data from the first string
ldy #$00
!:
lda (__FAC2+1),y
sta (INDEX),y
iny
cpy __FAC2+0
bne !-
// Increase INDEX pointer by the size of the 1st string
tya
jsr varstr_INDEX_up_A
// Copy data from the second string
ldy #$00
!:
lda (__FAC1+1),y
sta (INDEX),y
iny
cpy __FAC1+0
bne !-
// Restore default memory mapping
lda #$27
sta CPU_R6510
rts
#endif
+29 -7
View File
@@ -73,16 +73,38 @@ oper_add_strings:
#if CONFIG_MEMORY_MODEL_60K
// XXX
// XXX
// XXX
// Copy data from the first string
ldy #$00
!:
ldx #<(__FAC2+1)
jsr peek_under_roms
ldx #<INDEX
jsr poke_under_roms
iny
cpy __FAC2+0
bne !-
// Increase INDEX pointer by the size of the 1st string
tya
jsr varstr_INDEX_up_A
// Copy data from the second string
ldy #$00
!:
ldx #<(__FAC1+1)
jsr peek_under_roms
ldx #<INDEX
jsr poke_under_roms
iny
cpy __FAC1+0
bne !-
#elif CONFIG_MEMORY_MODEL_46K || CONFIG_MEMORY_MODEL_50K
// XXX consider optimized version without multiple JSRs
// XXX
// XXX
// XXX
jsr helper_add_concat
#else // CONFIG_MEMORY_MODEL_38K
+5 -3
View File
@@ -1,9 +1,11 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# STD * #TAKE-HIGH
// #LAYOUT# * BASIC_0 #TAKE-HIGH
// #LAYOUT# * * #IGNORE
// This has to go $E000 or above - it can be used by routines which bank out the main BASIC ROM!
//
// Helper routine, used by garbage collector
// Helper routine, used by garbage collector and string concatenation
//