Port-dreamcast archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

mkbd(4) delay fix



Hi,

attached is a patch that allows my dreamcast keyboard to work
properly. It seems that the intention of the original code was to
introduce some sort of delay by looping but this no longer works (I'm
assuming it did once) because any decent compiler will notice that
there is no useful value computed in the loop and optimise out the
code. Adding the 'volatile' keyword to loop counter variable will fix
this but the correct fix to me seems to be use an actual delay()
function if we want a delay.

The delay time of 30 microseconds was picked arbitrarily as a value
that was relatively small but that worked. If anyone has a decent
heuristic for picking a value, I'm all ears :-)

If no one has any objections I'll commit it in about a week.

Matt

Attachment: dreamcast2.patch
Description: Binary data



Home | Main Index | Thread Index | Old Index