Skip to content

Commit af8d101

Browse files
committed
CoCo: Fixed pause to be (properly) ticks instead of seconds
1 parent c534206 commit af8d101

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

src/coco/pause.c

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,28 @@
99

1010
void pause(unsigned char delay)
1111
{
12-
#ifdef DRAGON
13-
asm
14-
{
15-
// We come here from a JMP $C000 in Color Basic (normally at
16-
// $A10A in v1.2). At this point, the 60 Hz interrupt has
17-
// not been enabled yet, so enable it.
18-
lda $FF03 // get control register of PIA0, port B
12+
#ifdef DRAGON
13+
asm
14+
{
15+
// We come here from a JMP $C000 in Color Basic (normally at
16+
// $A10A in v1.2). At this point, the 60 Hz interrupt has
17+
// not been enabled yet, so enable it.
18+
lda $FF03 // get control register of PIA0, port B
1919
ora #1
20-
sta $FF03 // enable 60 Hz interrupt
20+
sta $FF03 // enable 60 Hz interrupt
2121

22-
// Unmask interrupts to allow the timer IRQ to be processed.
22+
// Unmask interrupts to allow the timer IRQ to be processed.
2323
andcc #$AF
24-
}
24+
}
2525
#endif
26-
sleep(delay/20);
26+
27+
if (!delay)
28+
{
29+
return;
30+
}
31+
32+
setTimer(0);
33+
while (getTimer() < delay);
2734
}
2835

2936
#endif /* _CMOC_VERSION */

0 commit comments

Comments
 (0)