added support for the Commander X16 memory layout

This commit is contained in:
FeralChild64 committed 2020-02-07 17:57:46 +01:00
1 parent 9b94f30f98
commit 6a1070c8ac
173 files changed
+605 -155

No files matched your search

+1
View File
@@ -0,0 +1 @@
This particular address is not for interoperability - we had to choose some fixed location foor the extended ROM jumptable, beginning of the mapped memory block is just sane.
@@ -0,0 +1,48 @@
// #LAYOUT# M65 KERNAL_0 #TAKE-FLOAT
// #LAYOUT# M65 KERNAL_1 #TAKE
// #LAYOUT# * * #IGNORE
//
// Definitions for communication with Mega65 segment KERNAL_1 from KERNAL_0
//
#if SEGMENT_KERNAL_0
// Label definitions
.label VK1__IOINIT = $4000 + 2 * 0
.label VK1__RAMTAS = $4000 + 2 * 1
.label VK1__setup_vicii = $4000 + 2 * 2
.label VK1__load_tape_normal = $4000 + 2 * 3
.label VK1__load_tape_turbo = $4000 + 2 * 4
.label VK1__load_tape_auto = $4000 + 2 * 5
#else
// Vector table (OpenROMs private!)
.word IOINIT
.word RAMTAS
.word setup_vicii
#if CONFIG_TAPE_NORMAL && !CONFIG_TAPE_AUTODETECT
.word load_tape_normal
#else
.word $0000
#endif
#if CONFIG_TAPE_TURBO && !CONFIG_TAPE_AUTODETECT
.word load_tape_turbo
#else
.word $0000
#endif
#if CONFIG_TAPE_AUTODETECT
.word load_tape_auto
#else
.word $0000
#endif
#endif
+57
View File
@@ -0,0 +1,57 @@
// #LAYOUT# M65 KERNAL_1 #TAKE
// #LAYOUT# * * #IGNORE
//
// Definitions for calling Mega65 segment KERNAL_0 routines from KERNAL_1
//
#import "KERNAL_0_combined.sym"
.label STOP = KERNAL_0.STOP
.label clrchn_reset = KERNAL_0.clrchn_reset
.label udtim_keyboard = KERNAL_0.udtim_keyboard
.label setup_irq_timer = KERNAL_0.setup_irq_timer
.label wait_x_bars = KERNAL_0.wait_x_bars
#if CONFIG_IEC
.label iec_set_idle = KERNAL_0.iec_set_idle
#endif
#if CONFIG_TAPE_NORMAL || CONFIG_TAPE_TURBO
.label screen_on = KERNAL_0.screen_on
.label screen_off = KERNAL_0.screen_off
.label tape_motor_on = KERNAL_0.tape_motor_on
.label tape_motor_off = KERNAL_0.tape_motor_off
.label lvs_display_loading_verifying = KERNAL_0.proxy_K1_lvs_display_loading_verifying
.label lvs_display_done = KERNAL_0.proxy_K1_lvs_display_done
.label lvs_return_last_address = KERNAL_0.proxy_K1_lvs_return_last_address
.label lvs_device_not_found_error = KERNAL_0.proxy_K1_lvs_device_not_found_error
.label lvs_load_verify_error = KERNAL_0.proxy_K1_lvs_load_verify_error
.label lvs_check_EAL = KERNAL_0.lvs_check_EAL
.label lvs_STAL_to_MEMUSS = KERNAL_0.lvs_STAL_to_MEMUSS
.label kernalerror_ROUTINE_TERMINATED = KERNAL_0.proxy_K1_kernalerror_ROUTINE_TERMINATED
.label print_kernal_message = KERNAL_0.proxy_K1_print_kernal_message
.label print_return = KERNAL_0.proxy_K1_print_return
.label __MSG_KERNAL_PRESS_PLAY = KERNAL_0.__MSG_KERNAL_PRESS_PLAY
.label __MSG_KERNAL_FOUND = KERNAL_0.__MSG_KERNAL_FOUND
#endif
#if CONFIG_TAPE_NORMAL
.label tape_normal_byte_store = KERNAL_0.tape_normal_byte_store
#endif
+56
View File
@@ -0,0 +1,56 @@
// #LAYOUT# M65 KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// ROM mapping routines for Mega65
//
// Available memory maps:
// - NORMAL - nothing mapped in
// - KERNAL_1 - for calling KERNAL_1 segment code
map_NORMAL:
php
pha
phx
phy
phz
lda #$00
tax
tay
taz
// FALLTROUGH
map_end:
map
eom
plz
ply
plx
pla
plp
rts
map_KERNAL_1:
php
pha
phx
phy
phz
lda #$00
tay
taz
ldx #$42 // 0x4000 <- map 8KB from 0x20000
bne map_end
+59
View File
@@ -0,0 +1,59 @@
// #LAYOUT# M65 KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Proxies for calling Mega65 segment KERNAL_0 routines from KERNAL_1
//
#if CONFIG_TAPE_NORMAL || CONFIG_TAPE_TURBO
proxy_K1_kernalerror_ROUTINE_TERMINATED:
jsr map_NORMAL
jmp kernalerror_ROUTINE_TERMINATED
proxy_K1_lvs_display_loading_verifying:
jsr map_NORMAL
jsr lvs_display_loading_verifying
jmp map_KERNAL_1
proxy_K1_lvs_display_done:
jsr map_NORMAL
jsr lvs_display_done
jmp map_KERNAL_1
proxy_K1_lvs_return_last_address:
jsr map_NORMAL
jmp lvs_return_last_address
proxy_K1_lvs_device_not_found_error:
jsr map_NORMAL
jmp lvs_device_not_found_error
proxy_K1_lvs_load_verify_error:
jsr map_NORMAL
jmp lvs_load_verify_error
proxy_K1_print_kernal_message:
jsr map_NORMAL
jsr print_kernal_message
jmp map_KERNAL_1
proxy_K1_print_return:
jsr map_NORMAL
jsr print_return
jmp map_KERNAL_1
#endif
@@ -0,0 +1,39 @@
// #LAYOUT# M65 KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// ROM routine call redirect for tape loading
//
#if CONFIG_TAPE_NORMAL && !CONFIG_TAPE_AUTODETECT
load_tape_normal:
jsr map_KERNAL_1
jsr_ind VK1__load_tape_normal
jmp map_NORMAL
#endif
#if CONFIG_TAPE_TURBO && !CONFIG_TAPE_AUTODETECT
load_tape_turbo:
jsr map_KERNAL_1
jsr_ind VK1__load_tape_turbo
jmp map_NORMAL
#endif
#if CONFIG_TAPE_AUTODETECT
load_tape_auto:
jsr map_KERNAL_1
jsr_ind VK1__load_tape_auto
jmp map_NORMAL
#endif
@@ -0,0 +1,19 @@
// #LAYOUT# M65 KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Tape (normal) helper routine - byte storage when ban changing is needed
//
#if CONFIG_TAPE_NORMAL
tape_normal_byte_store:
jsr map_NORMAL
sta (MEMUSS), y
jmp map_KERNAL_1
#endif