diff --git a/bin/kernal b/bin/kernal index b992407f..b169ad25 100644 Binary files a/bin/kernal and b/bin/kernal differ diff --git a/c64/kernal/acptr.s b/c64/kernal/acptr.s index d9ac012f..b6fd88be 100644 --- a/c64/kernal/acptr.s +++ b/c64/kernal/acptr.s @@ -1,3 +1,12 @@ -; Function defined on pp272-273 of C64 Programmers Reference Guide + +;; +;; Official Kernal routine, described in: +;; +;; - [RG64] C64 Programmer's Reference Guide - page 274 +;; - [CM64] Compute's Mapping the Commodore 64 - page 224/225 +;; +;; CPU registers that has to be preserved (see [RG64]): .Y +;; + acptr: rts diff --git a/c64/kernal/chkin.s b/c64/kernal/chkin.s index ffa509d7..f48b8b5e 100644 --- a/c64/kernal/chkin.s +++ b/c64/kernal/chkin.s @@ -1,4 +1,12 @@ -; Function defined on pp272-273 of C64 Programmers Reference Guide + +;; +;; Official Kernal routine, described in: +;; +;; - [RG64] C64 Programmer's Reference Guide - page 275 +;; - [CM64] Compute's Mapping the Commodore 64 - page 229 +;; +;; CPU registers that has to be preserved (see [RG64]): .Y +;; chkin: diff --git a/c64/kernal/chkout.s b/c64/kernal/chkout.s index 36b5a683..0f1f2e58 100644 --- a/c64/kernal/chkout.s +++ b/c64/kernal/chkout.s @@ -1,4 +1,12 @@ -; Function defined on pp272-273 of C64 Programmers Reference Guide + +;; +;; Official Kernal routine, described in: +;; +;; - [RG64] C64 Programmer's Reference Guide - page 276 +;; - [CM64] Compute's Mapping the Commodore 64 - page 229 +;; +;; CPU registers that has to be preserved (see [RG64]): .Y +;; chkout: diff --git a/c64/kernal/chrin.s b/c64/kernal/chrin.s index c60c5040..761c7c79 100644 --- a/c64/kernal/chrin.s +++ b/c64/kernal/chrin.s @@ -1,5 +1,14 @@ - ; Function defined on pp272-273 of C64 Programmers Reference Guide - ;; Compute's Mapping the 64, p228 + +;; +;; Official Kernal routine, described in: +;; +;; - [RG64] C64 Programmer's Reference Guide - page 277/278 +;; - [CM64] Compute's Mapping the Commodore 64 - page 228 +;; +;; CPU registers that has to be preserved (see [RG64]): .Y +;; + + ;; Reads a byte of input, unless from keyboard. ;; If from keyboard, then it gets a whole line of input, and returns the first char. ;; Repeated calls after that read out the successive bytes of the line of input. diff --git a/c64/kernal/chrout.s b/c64/kernal/chrout.s index 02503fa7..926a9391 100644 --- a/c64/kernal/chrout.s +++ b/c64/kernal/chrout.s @@ -1,4 +1,14 @@ -; Function defined on pp272-273 of C64 Programmers Reference Guide + +;; +;; Official Kernal routine, described in: +;; +;; - [RG64] C64 Programmer's Reference Guide - page 278/279 +;; - [CM64] Compute's Mapping the Commodore 64 - page 228 +;; +;; CPU registers that has to be preserved (see [RG64]): .Y +;; + + chrout: ;; Crude implementation of character output diff --git a/c64/kernal/cint.s b/c64/kernal/cint.s index bf760279..7dd92f46 100644 --- a/c64/kernal/cint.s +++ b/c64/kernal/cint.s @@ -1,5 +1,14 @@ - ;; Function defined on pp272-273 of C64 Programmers Reference Guide - ;; Compute's Mapping the 64 p215 + +;; +;; Official Kernal routine, described in: +;; +;; - [RG64] C64 Programmer's Reference Guide - page 280 +;; - [CM64] Compute's Mapping the Commodore 64 - page 242 +;; +;; CPU registers that has to be preserved (see [RG64]): none +;; + + cint: jsr setup_vicii diff --git a/c64/kernal/fda3.ioinit.s b/c64/kernal/fda3.ioinit.s index 2cadb1bc..fd579b03 100644 --- a/c64/kernal/fda3.ioinit.s +++ b/c64/kernal/fda3.ioinit.s @@ -1,4 +1,13 @@ -; Function defined on pp272-273 of C64 Programmers Reference Guide + +;; +;; Official Kernal routine, described in: +;; +;; - [RG64] C64 Programmer's Reference Guide - page 285 +;; - [CM64] Compute's Mapping the Commodore 64 - page 238 +;; +;; CPU registers that has to be preserved (see [RG64]): none +;; + ioinit: ; Set $00/$01 port mode and value diff --git a/c64/kernal/iec_turnaround_to_listen.s b/c64/kernal/iec_turnaround_to_listen.s index 964ef0ed..b1d0f576 100644 --- a/c64/kernal/iec_turnaround_to_listen.s +++ b/c64/kernal/iec_turnaround_to_listen.s @@ -4,6 +4,10 @@ iec_turnaround_to_listen: + ;; Timing is critical here - execute on disabled IRQs + php + sei + ;; Pull DATA, release CLK and ATN (we are not sending commands) jsr iec_pull_data_release_atn_clk @@ -17,11 +21,13 @@ iec_turnaround_to_listen: bne - ;; Timeout + plp sec rts ;; CLK is pulled by the device, OK -* +* + plp clc rts diff --git a/c64/kernal/iec_turnaround_to_talk.s b/c64/kernal/iec_turnaround_to_talk.s index c8cc9b47..c24639d2 100644 --- a/c64/kernal/iec_turnaround_to_talk.s +++ b/c64/kernal/iec_turnaround_to_talk.s @@ -4,6 +4,10 @@ iec_turnaround_to_talk: + ;; Timing is critical here - execute on disabled IRQs + php + sei + ;; First make sure both CLK, DATA and ATN are released at our side jsr iec_release_atn jsr iec_release_clk_data @@ -14,5 +18,6 @@ iec_turnaround_to_talk: ;; Pull CLK line, it should be held by talker jsr iec_pull_clk_release_data + plp clc rts diff --git a/c64/kernal/ramtas.s b/c64/kernal/ramtas.s index 45de1315..e54f7bd2 100644 --- a/c64/kernal/ramtas.s +++ b/c64/kernal/ramtas.s @@ -1,4 +1,13 @@ -; Function defined on pp272-273 of C64 Programmers Reference Guide + +;; +;; Official Kernal routine, described in: +;; +;; - [RG64] C64 Programmer's Reference Guide - page 291 +;; - [CM64] Compute's Mapping the Commodore 64 - page 237 +;; +;; CPU registers that has to be preserved (see [RG64]): none +;; + ramtas: ; C64 Programmer's Reference guide p291: ; Clear $0000-$0101, $0200-$03ff diff --git a/c64/kernal/vector.s b/c64/kernal/vector.s index 027bf14a..4a086198 100644 --- a/c64/kernal/vector.s +++ b/c64/kernal/vector.s @@ -1,4 +1,12 @@ -; Functions defined on pp272-273 of C64 Programmers Reference Guide + +;; +;; Official Kernal routine, described in: +;; +;; - [RG64] C64 Programmer's Reference Guide - page 293 (RESTOR), 304 (VECTOR) +;; - [CM64] Compute's Mapping the Commodore 64 - page 237 +;; +;; CPU registers that has to be preserved (see [RG64]): none +;; restor: