mirror of
https://github.com/irmen/prog8.git
synced 2024-12-25 23:29:55 +00:00
sys.wait() no longer resets the jiffyclock to zero
This commit is contained in:
parent
cb65480c6c
commit
e6a1442296
@ -485,11 +485,15 @@ sys {
|
||||
}
|
||||
|
||||
sub wait(uword jiffies) {
|
||||
c64.SETTIM(0,0,0) ; TODO do the wait without resetting the jiffy clock
|
||||
while c64.RDTIM16() < jiffies {
|
||||
; wait till the time catches up
|
||||
; --- wait approximately the given number of jiffies (1/60th seconds)
|
||||
repeat jiffies {
|
||||
ubyte jiff = lsb(c64.RDTIM16())
|
||||
while jiff==lsb(c64.RDTIM16()) {
|
||||
; wait until 1 jiffy has passed
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
cx16 {
|
||||
|
@ -474,9 +474,12 @@ sys {
|
||||
}
|
||||
|
||||
sub wait(uword jiffies) {
|
||||
c64.SETTIM(0,0,0) ; TODO do the wait without resetting the jiffy clock
|
||||
while c64.RDTIM16() < jiffies {
|
||||
; wait till the time catches up
|
||||
; --- wait approximately the given number of jiffies (1/60th seconds)
|
||||
repeat jiffies {
|
||||
ubyte jiff = lsb(c64.RDTIM16())
|
||||
while jiff==lsb(c64.RDTIM16()) {
|
||||
; wait until 1 jiffy has passed
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,6 @@ TODO
|
||||
====
|
||||
|
||||
- move all str* builtin functions to a str library module
|
||||
- make the syslib.wait() functions not reset the jiffy clock to 0
|
||||
- detect variables that are written but never read - mark those as unused too and remove them, such as uword unused = memory("unused222", 20) - also remove the memory slab allocation
|
||||
- hoist all variable declarations up to the subroutine scope *before* even the constant folding takes place (to avoid undefined symbol errors when referring to a variable from another nested scope in the subroutine)
|
||||
- make it possible to use cpu opcodes such as 'nop' as variable names by prefixing all asm vars with something such as '_'
|
||||
|
@ -1,6 +1,6 @@
|
||||
%import test_stack
|
||||
%import textio
|
||||
%zeropage full
|
||||
%zeropage basicsafe
|
||||
%option no_sysinit
|
||||
|
||||
main {
|
||||
@ -8,13 +8,11 @@ main {
|
||||
sub start () {
|
||||
uword current_time
|
||||
|
||||
repeat 5 {
|
||||
repeat 6 {
|
||||
current_time = c64.RDTIM16()
|
||||
txt.print_uw(current_time)
|
||||
txt.chrout('\n')
|
||||
repeat 60000 {
|
||||
current_time++
|
||||
}
|
||||
sys.wait(30)
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user