diff --git a/src/devices/floppy/fdd.c b/src/devices/floppy/fdd.c index 7dc1dd6..a38c111 100644 --- a/src/devices/floppy/fdd.c +++ b/src/devices/floppy/fdd.c @@ -8,7 +8,7 @@ * * Implementation of the floppy drive emulation. * - * Version: @(#)fdd.c 1.0.18 2019/02/10 + * Version: @(#)fdd.c 1.0.19 2019/04/25 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -738,10 +738,10 @@ fdd_reset(void) curdrive = 0; fdd_period = 32; - timer_add(fdd_poll_0, &(fdd_poll_time[0]), &(motoron[0]), NULL); - timer_add(fdd_poll_1, &(fdd_poll_time[1]), &(motoron[1]), NULL); - timer_add(fdd_poll_2, &(fdd_poll_time[2]), &(motoron[2]), NULL); - timer_add(fdd_poll_3, &(fdd_poll_time[3]), &(motoron[3]), NULL); + timer_add(fdd_poll_0, NULL, &fdd_poll_time[0], &motoron[0]); + timer_add(fdd_poll_1, NULL, &fdd_poll_time[1], &motoron[1]); + timer_add(fdd_poll_2, NULL, &fdd_poll_time[2], &motoron[2]); + timer_add(fdd_poll_3, NULL, &fdd_poll_time[3], &motoron[3]); } diff --git a/src/devices/ports/serial.c b/src/devices/ports/serial.c index ef5d072..07b2821 100644 --- a/src/devices/ports/serial.c +++ b/src/devices/ports/serial.c @@ -399,7 +399,7 @@ read_done(void *arg, int num) } /* We have data waiting for us.. delay a little, and then read it. */ -// timer_add(ser_timer, &dev->delay, &dev->delay, dev); +// timer_add(ser_timer, dev, &dev->delay, &dev->delay); } #endif diff --git a/src/devices/sound/sound.c b/src/devices/sound/sound.c index 20058e4..9b3c44b 100644 --- a/src/devices/sound/sound.c +++ b/src/devices/sound/sound.c @@ -8,13 +8,13 @@ * * Sound emulation core. * - * Version: @(#)sound.c 1.0.17 2018/11/11 + * Version: @(#)sound.c 1.0.18 2019/04/25 * * Authors: Fred N. van Kempen, * Miran Grca, * Sarah Walker, * - * Copyright 2017,2018 Fred N. van Kempen. + * Copyright 2017-2019 Fred N. van Kempen. * Copyright 2016-2018 Miran Grca. * Copyright 2008-2018 Sarah Walker. * @@ -345,7 +345,7 @@ sound_reset(void) /* Reset OpenAL. */ openal_reset(); - timer_add(sound_poll, &poll_time, TIMER_ALWAYS_ENABLED, NULL); + timer_add(sound_poll, NULL, &poll_time, TIMER_ALWAYS_ENABLED); sound_cd_set_volume(65535, 65535); diff --git a/src/devices/system/pit.c b/src/devices/system/pit.c index 9bff6dc..1fcde8d 100644 --- a/src/devices/system/pit.c +++ b/src/devices/system/pit.c @@ -13,7 +13,7 @@ * B4 to 40, two writes to 43, then two reads * - value _does_ change! * - * Version: @(#)pit.c 1.0.13 2019/04/11 + * Version: @(#)pit.c 1.0.14 2019/04/25 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -555,8 +555,7 @@ pit_init(void) pit.gate[i] = 1; pit.using_timer[i] = 1; - timer_add(timer_over, - &pit.c[i], &pit.running[i], (void *)&pit.pit_nr[i]); + timer_add(timer_over, &pit.pit_nr[i], &pit.c[i], &pit.running[i]); } io_sethandler(0x0040, 4, @@ -612,8 +611,7 @@ pit_ps2_init(void) pit2.pit_nr[0].nr = 0; pit2.pit_nr[0].pit = &pit2; - timer_add(timer_over, - &pit2.c[0], &pit2.running[0], (void *)&pit2.pit_nr[0]); + timer_add(timer_over, &pit2.pit_nr[0], &pit2.c[0], &pit2.running[0]); io_sethandler(0x0044, 1, pit_read,NULL,NULL, pit_write,NULL,NULL, &pit2); diff --git a/src/timer.c b/src/timer.c index 44e0041..5ac9f01 100644 --- a/src/timer.c +++ b/src/timer.c @@ -83,7 +83,7 @@ timer_process(void) enable[c] = *timers[c].enable; if (enable[c]) { *timers[c].count = *timers[c].count - diff; - if (*timers[c].count <= 0) + if (*timers[c].count <= 0LL) process = 1; } } @@ -91,8 +91,8 @@ timer_process(void) if (! process) return; - while (1) { - int64_t lowest = 1; + for (;;) { + int64_t lowest = 1LL; int lowest_c; for (c = 0; c < present; c++) {