From 6949bd3f48e2f822cc38fa605a4d1a0835cbcd09 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Tue, 24 Sep 2019 17:59:46 +0200 Subject: [PATCH] small startup/interrupt cleanup --- CONFIG.md | 2 +- c64/kernal/{fffa.s => fffa.vector_nmi.s} | 2 +- c64/kernal/{fffc.s => fffc.vector_reset.s} | 2 +- c64/kernal/{fffe.s => fffe.vector_irq.s} | 2 +- c64/kernal/interrupts/{irq_handler.s => hw_entry_irq.s} | 4 ++-- c64/kernal/interrupts/{nmi_handler.s => hw_entry_nmi.s} | 4 +--- c64/kernal/{reset_entry.s => interrupts/hw_entry_reset.s} | 2 +- 7 files changed, 8 insertions(+), 10 deletions(-) rename c64/kernal/{fffa.s => fffa.vector_nmi.s} (80%) rename c64/kernal/{fffc.s => fffc.vector_reset.s} (81%) rename c64/kernal/{fffe.s => fffe.vector_irq.s} (88%) rename c64/kernal/interrupts/{irq_handler.s => hw_entry_irq.s} (98%) rename c64/kernal/interrupts/{nmi_handler.s => hw_entry_nmi.s} (96%) rename c64/kernal/{reset_entry.s => interrupts/hw_entry_reset.s} (98%) diff --git a/CONFIG.md b/CONFIG.md index 027794e8..35e6570a 100644 --- a/CONFIG.md +++ b/CONFIG.md @@ -35,7 +35,7 @@ Choose if your CPU supports the Western Design Center 65C02 instruction set, lik It enables some speed/size code optimizations. Warning - this is untested! -### `#define CONFIG_CPU_WDC_65816` +### `CONFIG_CPU_WDC_65816` Choose if your CPU supports the 16-bit Western Design Center 65816 instruction set, like: diff --git a/c64/kernal/fffa.s b/c64/kernal/fffa.vector_nmi.s similarity index 80% rename from c64/kernal/fffa.s rename to c64/kernal/fffa.vector_nmi.s index d39f0f53..19ee0ad8 100644 --- a/c64/kernal/fffa.s +++ b/c64/kernal/fffa.vector_nmi.s @@ -1,4 +1,4 @@ // $FFFA - CPU NMI Hanlder // Uncontrovertial as this is also a CPU requirement. - .word nmi_handler + .word hw_entry_nmi diff --git a/c64/kernal/fffc.s b/c64/kernal/fffc.vector_reset.s similarity index 81% rename from c64/kernal/fffc.s rename to c64/kernal/fffc.vector_reset.s index eb4f1ba8..20545b6c 100644 --- a/c64/kernal/fffc.s +++ b/c64/kernal/fffc.vector_reset.s @@ -1,4 +1,4 @@ // $FFFC - CPU Reset Vector // Uncontrovertial, as it is a CPU requirement, and nothing else. - .word reset_entry + .word hw_entry_reset diff --git a/c64/kernal/fffe.s b/c64/kernal/fffe.vector_irq.s similarity index 88% rename from c64/kernal/fffe.s rename to c64/kernal/fffe.vector_irq.s index 2a892889..fd3e136d 100644 --- a/c64/kernal/fffe.s +++ b/c64/kernal/fffe.vector_irq.s @@ -2,4 +2,4 @@ // This is non-controvertial, as it is a 6502 CPU requirement, and we just have to point // it to whatever IRQ routine we make. - .word irq_handler + .word hw_entry_irq diff --git a/c64/kernal/interrupts/irq_handler.s b/c64/kernal/interrupts/hw_entry_irq.s similarity index 98% rename from c64/kernal/interrupts/irq_handler.s rename to c64/kernal/interrupts/hw_entry_irq.s index aad1fb9d..517100c4 100644 --- a/c64/kernal/interrupts/irq_handler.s +++ b/c64/kernal/interrupts/hw_entry_irq.s @@ -1,5 +1,6 @@ -irq_handler: +hw_entry_irq: + // The IRQ is a commonly messed with thing on the C64, // so we need to handle entry points that are commonly // relied upon, including: @@ -52,4 +53,3 @@ irq_handler_brk: // Interrupt caused by BRK jmp (CBINV) - diff --git a/c64/kernal/interrupts/nmi_handler.s b/c64/kernal/interrupts/hw_entry_nmi.s similarity index 96% rename from c64/kernal/interrupts/nmi_handler.s rename to c64/kernal/interrupts/hw_entry_nmi.s index 9c0b668d..ca41e1d0 100644 --- a/c64/kernal/interrupts/nmi_handler.s +++ b/c64/kernal/interrupts/hw_entry_nmi.s @@ -1,5 +1,5 @@ -nmi_handler: +hw_entry_nmi: sei // don't allow IRQ to interfere, see https://www.c64-wiki.com/wiki/Interrupt @@ -18,5 +18,3 @@ nmi_handler: // Vector not initialized - call default interrupt routine pla jmp default_nmi_handler - - diff --git a/c64/kernal/reset_entry.s b/c64/kernal/interrupts/hw_entry_reset.s similarity index 98% rename from c64/kernal/reset_entry.s rename to c64/kernal/interrupts/hw_entry_reset.s index 89382905..ed498dfc 100644 --- a/c64/kernal/reset_entry.s +++ b/c64/kernal/interrupts/hw_entry_reset.s @@ -2,7 +2,7 @@ // https://www.c64-wiki.com/wiki/Reset_(Process) -reset_entry: +hw_entry_reset: // The GPL program at https://github.com/Klaus2m5/6502_65C02_functional_tests/blob/master/6502_functional_test.a65 // uses the following initial reset sequence, affirmed by c64 PRG p269