Add a command line option to enable auto grab.
Default to the previous behavior before the auto grab feature was added.
Add a debugger command to enable or disable auto grab.
Notes:
Auto grab mouse currently only works for graphics controllers and guest
OSs that use a hardware cursor and only if the emulation sets
cursor_dirty to true (i.e. not emulation that uses cursor_ovl_cb).
Add --help-all option.
Move emulation options to an empty named subcommand.
Show defaults for --workingdir and --bootrom.
If --bootrom is not specified then validate the default.
The window title now reflects whether the mouse is grabbed and how to toggle
it, so the user knows how to release the automatic grab and move the pointer
to other windows, or how to re-grab it.
While a guest cursor is drawn, the host mouse is now grabbed automatically
so the guest cursor can reach every screen area and the host pointer cannot
wander off the window. The grab is released again when the guest cursor
disappears, and re-established when the window regains focus, because SDL
may drop the grab on focus loss. A manual grab with Ctrl+G is sticky and
overrides the automatic behavior.
When the guest OS draws a hardware cursor into the framebuffer, the SDL
host pointer was still shown on top, so the user saw two cursors that did
not track each other. Hide the host pointer while a guest cursor is drawn
and show it again otherwise, so the user can aim the mouse at the window
when no guest cursor is present.
The default case in perform_command() set the ABRT/ERR flags but left BSY
asserted and never fired the interrupt. Open Firmware therefore hung
waiting on the ATAPI CD-ROM after issuing commands it does not support
(e.g. 0xEC IDENTIFY_DEVICE during the boot device probe).
The ATI drivers uses dcbz to simulate a write-combining buffer when
sending HOST_DATA payloads.
The intent is something like this (on real hardware):
```
dcbz:
cache line = [0, 0, 0, 0, 0, 0, 0, 0]
ATI sees nothing
following stores:
cache line = [A, B, C, D, E, F, G, H]
ATI still sees nothing
dcbf or eviction:
write back [A, B, C, D, E, F, G, H]
ATI receives one completed cache line
```
With our previous cacheless implementation, the behavior was more like this:
```
dcbz:
ATI immediately receives [0, 0, 0, 0, 0, 0, 0, 0]
following stores:
ATI then receives [A, B, C, D, E, F, G, H]
dcbf:
no-op
```
The zero-ed out values have side effects (32 pixels of black being
written), so the intermediate state was visible.
The truly correct fix is to fully model the data cache, and do an
eventual write back of the modified cache lines with their final values,
but that is very invasive (and likely to be slow).
We instead just make `dcbz` a no-op for MMIO regions, which lets us
avoid that intermediate state and unintended side effects.
The Mac OS 8.6 driver enables color-register writes without enabling
block writes to update SGRAM state. Treat that command as a
register-only operation instead of sending it through the VRAM blitter,
while retaining the documented destination tiling side effects.
This prevents the command from producing stray pixels near the menu
bar and Control Strip.
References:
- ATI 3D Rage LT Pro Register Reference Guide, pp. 5-21--5-24.
- ATI Rage Pro and Derivatives Programmer's Guide, pp. 6-11--6-19.
Mac OS 8.6 uses general and rotated source trajectories when drawing
Finder icons and the Control Strip. Preserve both source size/start
composites and repeat their first and second rectangles according to
SRC_CNTL.
Use the documented signed source coordinates and inclusive scissors
while advancing the source for clipped destination pixels. Unbounded
blits continue to use the existing linear trajectory.
References:
- ATI 3D Rage LT Pro Register Reference Guide, pp. 5-21--5-31 and
5-39--5-42.
- ATI Rage Pro and Derivatives Programmer's Guide, pp. 6-11--6-19,
6-31--6-33, and 6-42.
Mac OS 8.6 programs GUI_TRAJ_CNTL to set draw-engine direction and
issues fills through several destination register initiators. Model the
composite register, destination initiators, signed inclusive scissors,
tiling side effects, and Always_1 source selection.
Accept source mix 7 independently of the unused background mix for
solid fills, and consume 8-bit HOST_DATA writes in trajectory order.
This lets the desktop paint and prevents host uploads from being
reversed or clipped.
References:
- ATI 3D Rage LT Pro Register Reference Guide, pp. 5-8--5-12,
5-33, 5-39--5-42, 5-47--5-51, 5-58, and 5-64--5-65.
- ATI Rage Pro and Derivatives Programmer's Guide, pp. 6-5,
6-11--6-19, and 6-27--6-29.
We end up flushing all entries very frequently (hundreds of thousands of times
during Mac OS X boot), and were spending a lot of time in `tlb_flush_entries`
walking through the array. We can instead store a generation counter and
make invalidation be a simple increment. This does make validity checks slightly
more expensive, but it appears to be a net win. On my machine it takes booting
the Mac OS X public meta to the Finder from ~58 seconds to ~35 seconds.
`TLBEntry` and its cache constants and flags are used exclusively by
ppcmmu.cpp. Keep them out of the public MMU header so future TLB changes
do not expand its interface.
This required a small fix in dbdma.cpp since it was implicitly relying on
an include that we removed.
Also declare `gTLBFlush*` variables as static to make it explicit that we
don't expect them to be accessed outside of ppcmmu.cpp.
Per the DBDMA spec (section 15.4.3), this is required. Fixes a hang
when booting 9.0 and 9.0.4 on the Beige G3 (they would get stuck in a
loop polling the `xferStatus.active` field).
Fixes a couple of regressions after the generic SCSI command refactor:
- `not_ready_reason` was missing an override, so we were not actually returning
`MEDIUM_NOT_PRESENT`
- `status_good()` was unconditionally called before every command, including for
`REQ_SENSE`. It cleared `sense_key`, thus we were not returning the correct
state back.
This source should contain anything related to
the physical properties of a CD/DVD drive like
mechanical capabilities, formats supported as well as
handling of the underlying images.
SCSI devices don't need that because it's usually stored
internally and returned during REQUEST SENSE command.
On the contrary, ATAPI devices always report sense key
in the upper bits of the error register.