mirror of
https://github.com/holub/mame
synced 2025-04-25 09:50:04 +03:00
z80ctc: Fixed Z80CTC read handler [Tim Schuerewegen]
side note: given that at write (lines 339-342) the timer is adjusted with (tconst * period) it seems reasonable that at read we divide by period rather than multiplying.
This commit is contained in:
parent
0771a0123a
commit
3a53e7d5dd
@ -302,7 +302,7 @@ READ8_DEVICE_HANDLER( z80ctc_r )
|
||||
VPRINTF(("CTC clock %f\n",ATTOSECONDS_TO_HZ(period.attoseconds)));
|
||||
|
||||
if (channel->timer != NULL)
|
||||
return ((int)(attotime_to_double(timer_timeleft(channel->timer)) * attotime_to_double(period)) + 1) & 0xff;
|
||||
return ((int)(attotime_to_double(timer_timeleft(channel->timer)) / attotime_to_double(period)) + 1) & 0xff;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user