[AD] MIDI fix and related patches

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


I've attached the 3 patches I'm going to commit soon:

- timer.diff: makes src/timer.c revert to its original revision (1.1.1.1
from WIP 3.9.32) and supplements the docs about the retroactive speed
changing mechanism; it fixes the MIDI bug on all platforms (tested DOS and
Windows with Cherokee.mid: 2'39" for both).

- keyboard4.diff: (as timer.diff breaks the current keyboard autorepeat
handling code) makes src/keyboard.c revert to its original revision (1.1.1.1
from WIP 3.9.32) then applies the rev1.3 to rev1.4 diff that is still valid
(tested the autorepeat support under DOS and Windows).

- wtimer3.diff: (as keyboard4.diff brings back the now famous Win2k keyboard
bug) definitively removes the Windows MT timer driver (R.I.P ...).

The former Windows MT and ST timer drivers were each actually made of two
'sub-drivers': a high performance driver relying on the Windows Performance
Counter (wrapper for RDTSC on 586 and greater I think) and a low performance
driver. Therefore I split the former ST driver into two new drivers
(TIMER_WIN32_HIGH_PERF and TIMER_WIN32_LOW_PERF), both single-threaded of
course.

The high performance driver worked nicely out of the box (Cherokee.mid:
2'39") but the low performance driver was badly broken (Cherokee.mid: 3'05"
!!) because it didn't take into account the _actual_ elapsed time between
two ticks, as the hiperf driver and Peter's pthread driver do. I fixed it
and now Cherokee.mid is played at the right speed.

Btw, it looks like the BeOS timer driver has got the same flaw (see the
thread loop in src/beos/btimeapi.cpp:timer_thread()), has anyone tested
Cherokee.mid under BeOS ?

--
Eric Botcazou
ebotcazou@xxxxxxxxxx

Attachment: midi_fix.zip
Description: Zip compressed data



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/