added memory models 46K and 50K to KERNAL
This commit is contained in:
1 parent
0df838cfc9
commit
6a4fe4d180
8 files changed
+113
-6
No files matched your search
@@ -40,6 +40,8 @@
|
||||
// Memory model
|
||||
|
||||
#define CONFIG_MEMORY_MODEL_38K
|
||||
// #define CONFIG_MEMORY_MODEL_46K // please keep disabled for now
|
||||
// #define CONFIG_MEMORY_MODEL_50K // please keep disabled for now
|
||||
// #define CONFIG_MEMORY_MODEL_60K
|
||||
|
||||
|
||||
|
||||
@@ -121,6 +121,12 @@
|
||||
#if CONFIG_MEMORY_MODEL_38K
|
||||
.eval selected++
|
||||
#endif
|
||||
#if CONFIG_MEMORY_MODEL_46K
|
||||
.eval selected++
|
||||
#endif
|
||||
#if CONFIG_MEMORY_MODEL_50K
|
||||
.eval selected++
|
||||
#endif
|
||||
#if CONFIG_MEMORY_MODEL_60K
|
||||
.eval selected++
|
||||
#endif
|
||||
|
||||
@@ -20,6 +20,8 @@ iec_send_file_name_loop:
|
||||
#if CONFIG_MEMORY_MODEL_60K
|
||||
ldx #<FNADDR+0
|
||||
jsr peek_under_roms
|
||||
#elif CONFIG_MEMORY_MODEL_46K || CONFIG_MEMORY_MODEL_50K
|
||||
jsr peek_under_roms_FNADDR
|
||||
#else // CONFIG_MEMORY_MODEL_38K
|
||||
lda (FNADDR),y
|
||||
#endif
|
||||
|
||||
@@ -82,6 +82,8 @@ iec_save_loop:
|
||||
#if CONFIG_MEMORY_MODEL_60K
|
||||
ldx #<MEMUSS+0
|
||||
jsr peek_under_roms
|
||||
#elif CONFIG_MEMORY_MODEL_46K || CONFIG_MEMORY_MODEL_50K
|
||||
jsr peek_under_roms_MEMUSS
|
||||
#else // CONFIG_MEMORY_MODEL_38K
|
||||
lda (MEMUSS),y
|
||||
#endif
|
||||
|
||||
@@ -66,7 +66,12 @@ lvs_handle_byte_verify:
|
||||
// Compare with stored byte
|
||||
cmp TBTCNT
|
||||
|
||||
#else
|
||||
#elif CONFIG_MEMORY_MODEL_46K || CONFIG_MEMORY_MODEL_50K
|
||||
|
||||
ldy #0
|
||||
jsr peek_under_roms_EAL
|
||||
|
||||
#else // CONFIG_MEMORY_MODEL_38K
|
||||
|
||||
ldy #0
|
||||
cmp (EAL),y
|
||||
@@ -134,6 +139,8 @@ lvs_display_searching_for:
|
||||
#if CONFIG_MEMORY_MODEL_60K
|
||||
ldx #<FNADDR+0
|
||||
jsr peek_under_roms
|
||||
#elif CONFIG_MEMORY_MODEL_46K || CONFIG_MEMORY_MODEL_50K
|
||||
jsr peek_under_roms_FNADDR
|
||||
#else // CONFIG_MEMORY_MODEL_38K
|
||||
lda (FNADDR),y
|
||||
#endif
|
||||
|
||||
@@ -2,14 +2,94 @@
|
||||
// #LAYOUT# * KERNAL_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
|
||||
#if CONFIG_MEMORY_MODEL_46K ||CONFIG_MEMORY_MODEL_50K
|
||||
|
||||
|
||||
peek_under_roms_MEMUSS:
|
||||
|
||||
// Store current memory mapping, unmap BASIC ROM
|
||||
|
||||
lda CPU_R6510
|
||||
pha
|
||||
and #$FE
|
||||
sta CPU_R6510
|
||||
|
||||
// Retrieve value from under ROMs
|
||||
|
||||
lda (MEMUSS), y
|
||||
|
||||
// FALLTROUGH
|
||||
|
||||
peek_under_roms_finalize:
|
||||
|
||||
// Store value in a safe place
|
||||
|
||||
tax
|
||||
|
||||
// Restore memory mapping
|
||||
|
||||
pla
|
||||
sta CPU_R6510
|
||||
|
||||
// Retrieve value and quit
|
||||
|
||||
txa
|
||||
rts
|
||||
|
||||
|
||||
peek_under_roms_FNADDR:
|
||||
|
||||
// Store current memory mapping, unmap BASIC ROM
|
||||
|
||||
lda CPU_R6510
|
||||
pha
|
||||
and #$FE
|
||||
sta CPU_R6510
|
||||
|
||||
// Retrieve value from under ROMs
|
||||
|
||||
lda (FNADDR), y
|
||||
|
||||
// Continue using common code
|
||||
|
||||
#if HAS_OPCODES_65C02
|
||||
bra peek_under_roms_finalize
|
||||
#else
|
||||
jmp peek_under_roms_finalize
|
||||
#endif
|
||||
|
||||
|
||||
peek_under_roms_EAL:
|
||||
|
||||
// Store current memory mapping, unmap BASIC ROM
|
||||
|
||||
lda CPU_R6510
|
||||
pha
|
||||
and #$FE
|
||||
sta CPU_R6510
|
||||
|
||||
// Retrieve value from under ROMs
|
||||
|
||||
lda (EAL), y
|
||||
|
||||
// Continue using common code
|
||||
|
||||
#if HAS_OPCODES_65C02
|
||||
bra peek_under_roms_finalize
|
||||
#else
|
||||
jmp peek_under_roms_finalize
|
||||
#endif
|
||||
|
||||
|
||||
#elif CONFIG_MEMORY_MODEL_60K
|
||||
|
||||
|
||||
// IMPORTANT:
|
||||
// These routines lengths cannot be changed without changing
|
||||
// the aliases for peek_under_roms, poke_under_roms etc
|
||||
// in ,aliases.s.
|
||||
// the aliases for peek_under_roms, poke_under_roms, etc.
|
||||
// Thus those addresses are expressed using formulae.
|
||||
|
||||
#if CONFIG_MEMORY_MODEL_60K
|
||||
|
||||
install_ram_routines:
|
||||
// Copy routines into place
|
||||
ldx #__ram_routines_end-__ram_routines_start-1
|
||||
@@ -69,4 +149,5 @@ memmap_allram_routine:
|
||||
|
||||
__ram_routines_end:
|
||||
|
||||
#endif // CONFIG_MEMORY_MODEL_60K
|
||||
|
||||
#endif
|
||||
@@ -14,6 +14,10 @@
|
||||
.error "CONFIG_MEMORY_MODEL_60K is not compatible with RS-232 memory allocation code"
|
||||
#endif
|
||||
|
||||
#if CONFIG_MEMORY_MODEL_46K ||CONFIG_MEMORY_MODEL_50K
|
||||
.error "TODO: add compatibility with these memory models"
|
||||
#endif
|
||||
|
||||
|
||||
close_rs232:
|
||||
|
||||
|
||||
@@ -14,6 +14,9 @@
|
||||
.error "CONFIG_MEMORY_MODEL_60K is not compatible with RS-232 memory allocation code"
|
||||
#endif
|
||||
|
||||
#if CONFIG_MEMORY_MODEL_46K ||CONFIG_MEMORY_MODEL_50K
|
||||
.error "TODO: add compatibility with these memory models"
|
||||
#endif
|
||||
|
||||
open_rs232:
|
||||
|
||||
|
||||
Reference in new issue
Block a user