1 ;PT3 Duration Calculator
2 ;Author Sergey Bulba <vorobey@mail.khstu.ru>
3 ;Support page http://bulba.at.kz/
6 ;Based on Ay_Emul's GetTime function and
7 ;on VT II PT3 player for ZX Spectrum
9 ;Calculation delay is about from 0.1 to 0.5 second
10 ;(depending of given PT3 module)
12 ;Precision of calculation is 1 interrupt
16 ;No any checkings of module structure, so, can
17 ;deadlock on damaged modules or on random data.
18 ;If you want, you can add deadlock and crash
19 ;checking from Ay_Emul (will decrease speed).
23 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
25 ;; HL: PT3 MODULE ADDRESS
27 ;; HL: # of interrupts
28 ;; (PT3TIME): # of interrupts
30 DI ;SP is used, any interrupts are not allowed
89 PT3TLP2 LD HL,PT3TSKACNT
105 PT3TCHB LD HL,PT3TSKBCNT
118 PT3TCHC LD HL,PT3TSKCCNT
172 LD HL,0+(PT3TSPCCOMS+#FF20-#1000)&#FFFF
182 PT3TC_DELAY LD A,(BC)
196 ;ALL 16 ADDRESSES TO PROTECT FROM BROKEN PT3 MODULES
197 PT3TSPCCOMS DW PT3TC_NOP
216 EI ;REMOVE TO DISABLE INTERRUPTS