doz and dozi were storing the result into the wrong register.
nabs was not taking into account two's complement storage of numbers
and was just setting the signed bit.
These two instructions are used in the implementation of text
measurement in native QuickDraw on 7.1.2/the PDM ROM, and the incorrect
values were resulting in nothing being rendered. With the fix text
appears when booting from the 7.1.2 CD.
AdbKeyboard would copy the event into its own fields and set the
changed field, so that we could return the event when register was 0.
However, if a subsequent event was received before ADB polling, the
previous event would be overwritten and lost.
Fix this by maintaining a queue of events, so that we can return
everything since the last poll.
We were using an empty value on the second byte of the ADB keyboard
register 0, but that maps to the "a" key. This manifested itself
as the Key Caps DA never showing the "a" key as being down.
Switch to a non-existent key for the second byte.
Allows different implementations for different platforms (the JS
build relies on browser APIs to stream disk images over the network).
Setting aside the JS build, this also reduces some code duplication.
postinit_devices() may cause additional devices to be registered
(e.g. PCI hosts will register their cards). We were not calling
device_postinit on those devices, because the iterator over the
device map was set up at the start of the loop.
Keep looping until we've actually initialized all devices in the map.
Otherwise if pull_data is called again, it will think that it still
has data available in the buffer (rem_len will be non-zero) and
random data at the buffer location will be returned.
This manifested itself as noise being played back in the JS
implementation of the SoundServer. The cubeb implementation was not
affected because it stops polling once it's told it has no more
data in the buffer. Both approaches are valid (the JS version pads
data with silence), and the DMA buffer should support both.