mirror of
https://github.com/irmen/prog8.git
synced 2025-01-10 20:30:23 +00:00
added emudbg.cpu_cycles() and emudbg.reset_cpu_cycles()
This commit is contained in:
parent
cf551d2cc7
commit
0cb378ca31
@ -62,4 +62,25 @@ emudbg {
|
||||
if is_emulator()
|
||||
EMU_DBGOUT2 = value
|
||||
}
|
||||
|
||||
sub reset_cpu_cycles() {
|
||||
if is_emulator()
|
||||
EMU_CPUCLK_L = 0
|
||||
}
|
||||
|
||||
asmsub cpu_cycles() -> uword @R0, uword @R1 {
|
||||
; -- returns the 32 bits cpu clock counter in R1:R0,
|
||||
; returns lower 16 bits in R0, upper 16 bits in R1.
|
||||
%asm {{
|
||||
lda p8v_EMU_CPUCLK_L
|
||||
sta cx16.r0L
|
||||
lda p8v_EMU_CPUCLK_M
|
||||
sta cx16.r0H
|
||||
lda p8v_EMU_CPUCLK_H
|
||||
sta cx16.r1L
|
||||
lda p8v_EMU_CPUCLK_U
|
||||
sta cx16.r1H
|
||||
rts
|
||||
}}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user