2020-12-05 12:45:18 +01:00
|
|
|
; Time library
|
|
|
|
; @author Daniele Verducci
|
|
|
|
|
2020-12-06 15:51:26 +01:00
|
|
|
; Duration in cpu cycles / 55 (change these values based on CPU frequency)
|
2020-12-09 20:09:52 +01:00
|
|
|
TIME_DUR_SECOND: EQU 2545
|
2020-12-06 15:51:26 +01:00
|
|
|
TIME_DUR_MILLIS: EQU 3
|
2020-12-05 12:45:18 +01:00
|
|
|
|
|
|
|
; Wait bc * 55 states
|
|
|
|
; Use 1 iteration as delay between I/O bus writes
|
|
|
|
; @param bc The number of iterations. Each iteration is 55 states long.
|
|
|
|
Time_delay55:
|
2021-01-02 16:33:51 +01:00
|
|
|
ret
|
2020-12-05 12:45:18 +01:00
|
|
|
bit 0,a ; 8
|
|
|
|
bit 0,a ; 8
|
|
|
|
bit 0,a ; 8
|
2020-12-29 23:28:30 +01:00
|
|
|
and 255 ; 7
|
2020-12-05 12:45:18 +01:00
|
|
|
dec bc ; 6
|
|
|
|
ld a,c ; 4
|
2020-12-29 23:28:30 +01:00
|
|
|
or b ; 4
|
2020-12-05 12:45:18 +01:00
|
|
|
jp nz,Time_delay55 ; 10, total = 55 states/iteration
|
|
|
|
ret
|