in_Pause(2000) for ZX81?

ZX80, ZX 81, ZX Spectrum, TS2068 and other clones
Post Reply
siggi
Well known member
Posts: 344
Joined: Thu Jul 26, 2007 9:06 am

in_Pause(2000) for ZX81?

Post by siggi »

Hi
I used "in_Pause(2000);" during SLOW mode to show lyrics within a MIDI song for 2 seconds before returning to FAST mode to continue playing the song. But the player stays in display mode (SLOW) for approx. 9 seconds (and shows the text), while WIKI says.
8. in_Pause()

Pause for a period of time measured in milliseconds. Returns early with time remaining in the pause if a key is pressed. This function is implemented as a busy-wait and is guaranteed to work even with interrupts disabled.
Maybe it works at ZX81 while "interrupts are disabled" (at ZX81: FAST mode) as documented, but not during ZX81 SLOW mode ;-)

If there is no easy solution: the documention should be updated ;-)

Siggi
stefano
Well known member
Posts: 2151
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

could it be just lasting longer than expected? if the zx81 is runs only for a 20% of the total cpu time, then 9/80*20=2.25
stefano
Well known member
Posts: 2151
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

similarly, 2000/80*20=500 .. does this value fix the delay to the expected value?
siggi
Well known member
Posts: 344
Joined: Thu Jul 26, 2007 9:06 am

Post by siggi »

Currently I divide by 5 (=20%), which gives approximatley the expected timing. But my ZX81 has Wilf's WHY WAIT modification, so is approx. 10% faster than "normal" Zeddies.

Siggi

BTW: 20% of 2000ms is 2000ms/100*20 ;-)
stefano
Well known member
Posts: 2151
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

odd how someone can love computing that much and be weak in maths .. :)
Post Reply