more compatible SETTIM and RDTIM routines
This commit is contained in:
1 parent
1c2b498e15
commit
33393ea824
2 files changed
+8
-6
No files matched your search
+4
-3
@@ -12,7 +12,6 @@ rdtim:
|
|||||||
|
|
||||||
;; Disable interrupts for the duration of the routine, to prevent
|
;; Disable interrupts for the duration of the routine, to prevent
|
||||||
;; jiffy clock update while reeading it's values
|
;; jiffy clock update while reeading it's values
|
||||||
php
|
|
||||||
sei
|
sei
|
||||||
|
|
||||||
;; Store the jiffy clock state
|
;; Store the jiffy clock state
|
||||||
@@ -20,7 +19,9 @@ rdtim:
|
|||||||
ldx TIME + 1
|
ldx TIME + 1
|
||||||
lda TIME + 2
|
lda TIME + 2
|
||||||
|
|
||||||
;; Restore processor state and return
|
;; Enable interrupts. More elegant solution would be pha + sei + ... + pla,
|
||||||
plp
|
;; but (checked by running a test program) original ROM routine always
|
||||||
|
;; leaves IRQs enabled.
|
||||||
|
cli
|
||||||
rts
|
rts
|
||||||
|
|
||||||
+4
-3
@@ -12,7 +12,6 @@ settim:
|
|||||||
|
|
||||||
;; Disable interrupts for the duration of the routine, to prevent
|
;; Disable interrupts for the duration of the routine, to prevent
|
||||||
;; jiffy clock update while changing it's values
|
;; jiffy clock update while changing it's values
|
||||||
php
|
|
||||||
sei
|
sei
|
||||||
|
|
||||||
;; Store the jiffy clock state
|
;; Store the jiffy clock state
|
||||||
@@ -20,7 +19,9 @@ settim:
|
|||||||
stx TIME + 1
|
stx TIME + 1
|
||||||
sta TIME + 2
|
sta TIME + 2
|
||||||
|
|
||||||
;; Restore processor state and return
|
;; Enable interrupts. More elegant solution would be pha + sei + ... + pla,
|
||||||
plp
|
;; but (checked by running a test program) original ROM routine always
|
||||||
|
;; leaves IRQs enabled.
|
||||||
|
cli
|
||||||
rts
|
rts
|
||||||
|
|
||||||
Reference in new issue
Block a user