Although being optional in ATA-3 and absent in >= ATA-4,
RECALIBRATE is issued by Open Firmware 3.1.1 during device
initialization. If it fails, the drive is considered non-bootable.
Now we got two classes: IdeChannel and MacioIdeChannel.
The former models a generic IDE channel so it can be used elsewhere.
The latter implements MacIO specific configuration register(s)
and interrupt signaling.
There's no reason for it to be a global, we always set it and use it
in instruction implementations, and we never read it directly.
Perhaps the compiler could optimize this away, but it's better to be
simpler (and also be easier to read).
Both cmd_pkt and data_buf class members are cast to a uint16_t pointer,
so we need to make sure they are properly aligned, otherwise it is
undefined behavior.
Take the DDRA and DDRB registers into account as well because
there is software that tries to change state of the pins configured
as inputs.
This commit fixes Cuda for Rhapsody.
Mode 1 contains real addressing mode entries, which by definition cannot
be using segment registers. By skipping over them, we can shave off a
couple of seconds from the 10.2 boot time.
They happen surprisingly often, and flushing the TLB is expensive
because we need to walk over all entries.
Takes booting 10.2 on a Beige G3 from binary start to "Welcome to Macintosh"
from 58s to 38s on my machine.
We do a linear scan in find_range (which is called on all TLB misses) to
find the entries. The largest and most frequently hit entry is the
system memory (which starts at 0). By ensuring that it's the first entry
in the list, we end up only doing one iteration through the loop.
The JS implementation does content hashing to not blit unchanged
framebuffer contents (see mihaip/dingusppc@171ff2d407).
However, that is not necessary for the ATI adapters that already track
this and only set draw_fb if the framebuffer has actually changed.
Pass through a fb_known_to_be_changed for these cases, and also add an
optional update_skipped method (since the JS still wants to know when
the last logical screen update was).
size_t and off_t are 32-bit values in Emscripten, which causes issues
with disk images larger than 4GB. Use the explicit type (which is more
consistent with the rest of the codebase anyway).