Kernal size optimizations

This commit is contained in:
FeralChild64 committed 2020-01-28 19:45:02 +01:00
1 parent 1b49724c50
commit dff590c979
7 files changed
+161 -72

No files matched your search

@@ -11,16 +11,20 @@
// Label definitions
.label VK1__RAMTAS = $4000 + 2 * 0
.label VK1__load_tape_normal = $4000 + 2 * 1
.label VK1__load_tape_turbo = $4000 + 2 * 2
.label VK1__load_tape_auto = $4000 + 2 * 3
.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
+9
View File
@@ -9,11 +9,20 @@
.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
+42 -54
View File
@@ -6,90 +6,78 @@
// Kernal error codes are described in 'Commodore 64 Programmers Reference Guide', page 306
kernalerror_ROUTINE_TERMINATED: // by a STOP key
lda #K_ERR_ROUTINE_TERMINATED
sec
rts
skip_2_bytes_trash_nvz
// FALLTROUGH
kernalerror_TOO_MANY_OPEN_FILES:
lda #K_ERR_TOO_MANY_OPEN_FILES
sec
rts
skip_2_bytes_trash_nvz
// FALLTROUGH
kernalerror_FILE_ALREADY_OPEN:
lda #K_ERR_FILE_ALREADY_OPEN
sec
rts
skip_2_bytes_trash_nvz
// FALLTROUGH
kernalerror_FILE_NOT_OPEN:
lda #K_ERR_FILE_NOT_OPEN
sec
rts
skip_2_bytes_trash_nvz
// FALLTROUGH
kernalerror_FILE_NOT_FOUND:
lda #K_ERR_FILE_NOT_FOUND
sec
rts
skip_2_bytes_trash_nvz
// FALLTROUGH
kernalerror_DEVICE_NOT_FOUND:
lda #K_ERR_DEVICE_NOT_FOUND
sec
rts
skip_2_bytes_trash_nvz
// FALLTROUGH
kernalerror_FILE_NOT_INPUT:
lda #K_ERR_FILE_NOT_INPUT
sec
rts
skip_2_bytes_trash_nvz
// FALLTROUGH
kernalerror_FILE_NOT_OUTPUT:
lda #K_ERR_FILE_NOT_OUTPUT
sec
rts
skip_2_bytes_trash_nvz
// FALLTROUGH
kernalerror_FILE_NAME_MISSING:
lda #K_ERR_FILE_NAME_MISSING
sec
rts
skip_2_bytes_trash_nvz
// FALLTROUGH
kernalerror_ILLEGAL_DEVICE_NUMBER:
lda #K_ERR_ILLEGAL_DEVICE_NUMBER
sec
rts
skip_2_bytes_trash_nvz
// FALLTROUGH
kernalerror_TOP_MEM_RS232:
lda #K_ERR_TOP_MEM_RS232
sec
rts
// Kernal status codes are described in 'Commodore 64 Programmers Reference Guide', page 292
kernalstatus_reset:
lda #$00
sta IOSTATUS
rts
// The following two statuses are currently not implemented - and most likely not really needed
// kernalstatus_TIMEOUT_WRITE:
// lda IOSTATUS
// ora #K_STS_TIMEOUT_WRITE
// sta IOSTATUS
// rts
// kernalstatus_TIMEOUT_READ:
// lda IOSTATUS
// ora #K_STS_TIMEOUT_READ
// sta IOSTATUS
// rts
kernalstatus_EOI:
lda IOSTATUS
ora #K_STS_EOI
sta IOSTATUS
rts
kernalstatus_DEVICE_NOT_FOUND:
lda IOSTATUS
ora #K_STS_DEVICE_NOT_FOUND
sta IOSTATUS
rts
+12 -1
View File
@@ -1,5 +1,6 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * KERNAL_0 #TAKE
// #LAYOUT# M65 KERNAL_0 #TAKE
// #LAYOUT# M65 KERNAL_1 #TAKE-FLOAT
// #LAYOUT# * * #IGNORE
//
@@ -11,6 +12,14 @@
setup_vicii:
#if (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
jsr map_KERNAL_1
jsr_ind VK1__setup_vicii
jmp map_NORMAL
#else
// Clear everything - turn off sprites (observed hanging around after
// running programs and resetting), etc.
@@ -67,3 +76,5 @@ setup_vicii:
// Setup default I/O devices
jmp clrchn_reset
#endif // ROM layout
+13 -1
View File
@@ -1,5 +1,6 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * KERNAL_0 #TAKE
// #LAYOUT# M65 KERNAL_0 #TAKE
// #LAYOUT# M65 KERNAL_1 #TAKE-FLOAT
// #LAYOUT# * * #IGNORE
//
@@ -14,6 +15,14 @@
IOINIT:
#if (ROM_LAYOUT_M65 && SEGMENT_KERNAL_0)
jsr map_KERNAL_1
jsr_ind VK1__IOINIT
jmp map_NORMAL
#else
//
// First initialize the CPU port, to make sure we have correct memory map
//
@@ -146,3 +155,6 @@ IOINIT:
rts
#endif
#endif // ROM layout
+42
View File
@@ -0,0 +1,42 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * KERNAL_0 #TAKE
// #LAYOUT# * * #IGNORE
// Kernal status codes are described in 'Commodore 64 Programmers Reference Guide', page 292
kernalstatus_reset:
lda #$00
beq kernalstatus_end // branch always
// The following two statuses are currently not implemented - and most likely not really needed
// kernalstatus_TIMEOUT_WRITE:
//
// lda IOSTATUS
// ora #K_STS_TIMEOUT_WRITE
// bne kernalstatus_end // branch always
// kernalstatus_TIMEOUT_READ:
//
// lda IOSTATUS
// ora #K_STS_TIMEOUT_READ
// bne kernalstatus_end // branch always
kernalstatus_EOI:
lda IOSTATUS
ora #K_STS_EOI
bne kernalstatus_end // branch always
kernalstatus_DEVICE_NOT_FOUND:
lda IOSTATUS
ora #K_STS_DEVICE_NOT_FOUND
// FALLTROUGH
kernalstatus_end:
sta IOSTATUS
rts