From c3362521050ced7450c7c3a1588ce87edfb9eb1f Mon Sep 17 00:00:00 2001 From: Paul Gardner-Stephen Date: Wed, 17 Apr 2019 04:53:50 +0930 Subject: [PATCH] update information and add first few routines. --- c64/kernal/fff3.s | 9 +++++++++ c64/kernal/fffa.s | 4 ++++ c64/kernal/fffc.s | 4 ++++ c64/kernal/fffe.s | 5 +++++ c64/kernal/public_interfaces.md | 31 ++++++++++++++++++++++++++++++- 5 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 c64/kernal/fff3.s create mode 100644 c64/kernal/fffa.s create mode 100644 c64/kernal/fffc.s create mode 100644 c64/kernal/fffe.s diff --git a/c64/kernal/fff3.s b/c64/kernal/fff3.s new file mode 100644 index 00000000..4870c7ba --- /dev/null +++ b/c64/kernal/fff3.s @@ -0,0 +1,9 @@ +; $FFF3 - Get page of IO devices +; Returns Y=$DC, X=$00 +; (http://codebase64.org/doku.php?id=base:kernalreference) +; +; As there is nothing between here and $FFFA, we can just hard code this in place. +LDY #$DC +LDX #$00 +RTS + diff --git a/c64/kernal/fffa.s b/c64/kernal/fffa.s new file mode 100644 index 00000000..7218f8fb --- /dev/null +++ b/c64/kernal/fffa.s @@ -0,0 +1,4 @@ +; $FFFA - CPU NMI Hanlder +; Uncontrovertial as this is also a CPU requirement. + + .word nmi_handler diff --git a/c64/kernal/fffc.s b/c64/kernal/fffc.s new file mode 100644 index 00000000..e494873d --- /dev/null +++ b/c64/kernal/fffc.s @@ -0,0 +1,4 @@ +; $FFFC - CPU Reset Vector +; Uncontrovertial, as it is a CPU requirement, and nothing else. + + .word reset_entry diff --git a/c64/kernal/fffe.s b/c64/kernal/fffe.s new file mode 100644 index 00000000..8cacf712 --- /dev/null +++ b/c64/kernal/fffe.s @@ -0,0 +1,5 @@ +; $FFFE - CPU IRQ Vector. +; 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 diff --git a/c64/kernal/public_interfaces.md b/c64/kernal/public_interfaces.md index 08064963..d72bc826 100644 --- a/c64/kernal/public_interfaces.md +++ b/c64/kernal/public_interfaces.md @@ -1,7 +1,36 @@ -# Public Interfaces of the C64 KERNAL +# Focus must be on interoperability In terms of the goal of ensuring interoperability, it is vital that the public interfaces match. We believe that this activity very closely matches that described in section 12 of http://classic.austlii.edu.au/au/journals/JlLawInfoSci/2003/2.html and thus is allowable. +From an interoperability perspective, we should ideally justify why each function, memory location +etc is required, by providing an example existing C64 program that will fail if it is not correct, +thus establishing that every single thing is required for interoperability. + +Also, where there are similarities to the original in any routine, these should also ideally be +justified by again finding software that does not work if the content is changed. + +# C64 KERNAL Memory Range + +While the KERNAL is often referred to as the ROM from $E000-$FFFF, analysis of publicly +available disassemblies, such as https://github.com/mist64/c64rom/blob/master/c64rom_en.txt, +reveal that the KERNAL actually is only the part $E4D3-$FFFF -- the earlier part actually +being parts of the BASIC ROM that did not fit in the 8KB BASIC ROM. + +Notably, the boot message of a C64 is thus part of the BASIC, and not the KERNAL. +Thus switching the KERNAL part will not change the boot message. That will occur only +when the BASIC ROM is also replaced. + +# Public jump table + +# ZP and other well-known RAM usage + +The KERNAL uses $90-$FF for various things, +$100-$13D as temporary storage of tape data, +$259-$2A6 for various housekeeping things. +$0314-$0333 for vectors +$033C-$03FB for casette data buffer + +Reference: http://sta.c64.org/cbm64mem.html