From ef183a6cb1bb29d6ff2b4504f4885dd94b6d33bf Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Wed, 28 Aug 2019 17:45:40 +0200 Subject: [PATCH] implemented SETTIM and RDTIM routines --- STATUS.md | 4 ++-- c64/kernal/rdtim.s | 14 ++++++++++++++ c64/kernal/settim.s | 14 ++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/STATUS.md b/STATUS.md index 8bcd4a96..fc091654 100644 --- a/STATUS.md +++ b/STATUS.md @@ -101,8 +101,8 @@ NOTE: Even the 'DONE' routines won't support features described as missing in on | `$FFD2` | `CHROUT` | PARTIAL | | | `$FFD5` | `LOAD` | PARTIAL | no VERIFY support yet, no STOP key support | | `$FFD8` | `SAVE` | NOT DONE | | -| `$FFDB` | `SETTIM` | NOT DONE | | -| `$FFDE` | `RDTIM` | NOT DONE | | +| `$FFDB` | `SETTIM` | DONE | | +| `$FFDE` | `RDTIM` | DONE | | | `$FFE1` | `STOP` | DONE | | | `$FFE4` | `GETIN` | PARTIAL | only some devices supported | | `$FFE7` | `CLALL` | DONE | | diff --git a/c64/kernal/rdtim.s b/c64/kernal/rdtim.s index a9e40a16..41a32290 100644 --- a/c64/kernal/rdtim.s +++ b/c64/kernal/rdtim.s @@ -9,4 +9,18 @@ ;; rdtim: + + ;; Disable interrupts for the duration of the routine, to prevent + ;; jiffy clock update while reeading it's values + php + sei + + ;; Store the jiffy clock state + ldy TIME + 0 + ldx TIME + 1 + lda TIME + 2 + + ;; Restore processor state and return + plp rts + diff --git a/c64/kernal/settim.s b/c64/kernal/settim.s index 804538c1..2a995427 100644 --- a/c64/kernal/settim.s +++ b/c64/kernal/settim.s @@ -9,4 +9,18 @@ ;; settim: + + ;; Disable interrupts for the duration of the routine, to prevent + ;; jiffy clock update while changing it's values + php + sei + + ;; Store the jiffy clock state + sty TIME + 0 + stx TIME + 1 + sta TIME + 2 + + ;; Restore processor state and return + plp rts +