add clock for Telestrat target and add some Telemon primitives

This commit is contained in:
jede
2021-03-11 22:48:05 +01:00
committed by Oliver Schmidt
parent 4f26650228
commit c0d638a26d
2 changed files with 67 additions and 4 deletions

30
libsrc/telestrat/clock.s Normal file
View File

@@ -0,0 +1,30 @@
;
; Jede, 2021-03-10
;
; clock_t clock (void);
;
.export _clock
.importzp sreg
.include "telestrat.inc"
.proc _clock
; Clear the timer high 16 bits
ldy #$00
sty sreg
sty sreg+1
; Read the timer
sei ; Disable interrupts
lda TIMEUD ; TIMED contains 1/10 of a second from clock. Telestrat main cardridge simulate a clock from VIA6522 timer
ldx TIMEUD+1
cli ; Reenable interrupts
rts
.endproc