several features are now optional, added legacy BASIC memory model

This commit is contained in:
FeralChild64 committed 2019-09-11 19:21:02 +02:00
1 parent 49e8b75b85
commit ed51a62f32
30 files changed
+555 -72

No files matched your search

+3
View File
@@ -62,6 +62,8 @@
.label enable_case_switch = $0291
.label screen_scroll_disable = $0292
#if CONFIG_MEMORY_MODEL_60K
// Under-ROM routines
// (BASIC also includes them. XXX - We should de-duplicate them in a safe manner)
.label missed_nmi_flag = $2A7
@@ -71,3 +73,4 @@
.label memmap_allram = tiny_nmi_handler+memmap_allram_routine-tiny_nmi_handler_routine
.label memmap_normal = tiny_nmi_handler+memmap_normal_routine-tiny_nmi_handler_routine
#endif // CONFIG_MEMORY_MODEL_60K
+2
View File
@@ -81,8 +81,10 @@ open_iec:
jmp kernalerror_DEVICE_NOT_FOUND
!:
#if CONFIG_MEMORY_MODEL_60K
// We need our helpers to get to filenames under ROMs or IO area
jsr install_ram_routines
#endif
// Send command ('file name')
jsr lvs_send_file_name
+2
View File
@@ -31,8 +31,10 @@ LOAD:
// Reset status
jsr kernalstatus_reset
#if CONFIG_MEMORY_MODEL_60K
// We need our helpers to get to filenames under ROMs or IO area
jsr install_ram_routines
#endif
// Allow platform-specific routine to takeover the flow
TARGET_HOOK_LOAD()
+30 -2
View File
@@ -20,23 +20,51 @@ IOINIT:
sta CPU_R6510
stx CPU_D6510
// Silence the SID chips under common addresses
// Silence the SID chips, depending on the configuration
#if !CONFIG_SID_D4XX
lda SID_SIGVOL
and #$F0
sta SID_SIGVOL
#endif // !CONFIG_SID_D4XX
#if CONFIG_SID_D4XX || CONFIG_SID_D5XX
ldy #$00
!:
// SIDs under $D4xx
#if CONFIG_SID_D4XX
lda SID_SIGVOL, Y
and #$F0
sta SID_SIGVOL, Y
#endif // CONFIG_SID_D4XX
#if CONFIG_SID_D5XX
// SIDs under $D5xx
lda SID_SIGVOL + $100, Y
and #$F0
sta SID_SIGVOL + $100, Y
#endif // CONFIG_SID_D4XX
tya
clc
adc #$20
tay
bne !-
#endif // CONFIG_SID_D4XX || CONFIG_SID_D5XX
#if CONFIG_SID_2ND
lda SID_SIGVOL - SID_BASE + CONFIG_SID_2ND_ADDRESS
and #$F0
sta SID_SIGVOL - SID_BASE + CONFIG_SID_2ND_ADDRESS
#endif // CONFIG_SID_2ND
#if CONFIG_SID_3RD
lda SID_SIGVOL - SID_BASE + CONFIG_SID_3RD_ADDRESS
and #$F0
sta SID_SIGVOL - SID_BASE + CONFIG_SID_3RD_ADDRESS
#endif // CONFIG_SID_3RD
// Initialize CIAs
// XXX: calibrate TOD for both CIA's, see here: https://codebase64.org/doku.php?id=base:efficient_tod_initialisation
+14 -2
View File
@@ -8,8 +8,14 @@ lvs_send_file_name:
lvs_send_file_name_loop:
cpy FNLEN
beq lvs_send_file_name_done
ldx #<current_filename_ptr
#if CONFIG_MEMORY_MODEL_60K
ldx #<current_filename_ptr+0
jsr peek_under_roms
#else // CONFIG_MEMORY_MODEL_38K
lda (current_filename_ptr),y
#endif
iny
// Set Carry flag on the last file name character, to mark EOI
cpy FNLEN
@@ -73,8 +79,14 @@ lvs_display_searching_for:
!:
cpy FNLEN
beq lvs_display_end
ldx #<current_filename_ptr
#if CONFIG_MEMORY_MODEL_60K
ldx #<current_filename_ptr+0
jsr peek_under_roms
#else // CONFIG_MEMORY_MODEL_38K
lda (current_filename_ptr),y
#endif
jsr JCHROUT
iny
jmp !-
+4
View File
@@ -4,6 +4,8 @@
// in ,aliases.s.
// 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
@@ -62,3 +64,5 @@ memmap_allram_routine:
rts
ram_routines_end:
#endif // CONFIG_MEMORY_MODEL_60K