Commit Graph
2809 Commits
Author SHA1 Message Date
joevt a3b248ea3d ppcemu: Use ppc_off_reason setter.
Makes things slightly cleaner and helps debugging. Changes to
ppc_off_reason can be logged.
2026-08-09 21:04:04 -07:00
joevt db5ab5f63c display_sdl: Make auto grab mouse optional.
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).
2026-08-09 21:01:00 -07:00
Maxim Poliakovski d542d9ef96 scsicdromcmds: move page handler 0x31 to the end of the source. 2026-08-09 20:17:15 +02:00
dingusdev 472f130e44 Tweak the manual
Suits current changes
2026-08-09 08:08:44 -07:00
joevt aa2f8c2664 main: Move setenv option to emulation commands. 2026-08-09 08:07:00 -07:00
joevt fdef70cddd main: Rename --realtime to --run.
Because it has nothing to do with timing.
2026-08-09 08:06:51 -07:00
joevt 1082a0c029 main: CLI11 changes.
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.
2026-08-08 17:05:23 -07:00
probonopd 0f4957cbf4 display: show mouse grab state and shortcut in the window title
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.
2026-08-08 15:29:05 -07:00
probonopd f78f05f53b display: auto-grab the mouse when the guest draws its own cursor
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.
2026-08-08 15:29:05 -07:00
probonopd 6dd8b31b51 display: hide the SDL host pointer when the guest draws its own cursor
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.
2026-08-08 15:29:05 -07:00
probonopd ed94cd2459 scsicdrom: Register Apple features mode page (0x31) for ATAPI CD-ROM
Move the Page 0x31 getter from ScsiCdrom into ScsiCdromCmds so it is also
registered for the ATAPI CD-ROM, which Mac OS queries via MODE_SENSE.
2026-08-08 14:33:39 -07:00
probonopd 0f168677b2 atapibasedevice: Clear BSY and signal interrupt on unsupported ATA command
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).
2026-08-08 14:33:39 -07:00
Mihai Parparita d5f607e50f core: mark non-mutating methods as const 2026-08-08 12:49:12 -07:00
joevt 834006d311 dbdma: Fix STORE_QUAD and LOAD_QUAD. 2026-08-08 06:51:03 -07:00
Mihai Parparita 8f6274ed8a ppcmmu: Ignore dcbz for MMIO regions
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.
2026-08-08 06:46:01 -07:00
Mihai Parparita e2a28ec287 atirage: Handle SGRAM color register blits
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.
2026-08-07 08:05:42 -07:00
Mihai Parparita 5c5faa626e atirage: Support general-pattern source blits
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.
2026-08-07 08:05:42 -07:00
Mihai Parparita 1e4014739c atirage: Support solid and color host rectangle fills
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.
2026-08-07 08:05:42 -07:00
joevt eade7a0a30 ppcmmu: Fix indenting. 2026-08-07 06:47:41 -07:00
joevt 9fb34efcf3 soundserver_cubeb: Don't use get_pull_data_remaining.
Just pull data until the DMA buffer is empty.
2026-08-06 20:38:40 -07:00
joevt d3dfbc05ca soundserver_cubeb: Use enum name for pull_data. 2026-08-06 20:38:32 -07:00
Mihai Parparita abf20ce712 Allow different levels of determinism (#201)
Add an "interactive" mode that allows user input, but still disables
hard drive and PRAM persistence.
2026-08-06 19:03:48 -07:00
joevt 90b3119b8f dbdma: Use update_cmd for flush also. 2026-08-06 07:47:26 -07:00
Mihai Parparita 2c7a7c5c36 ppcmmu: Use generational flush for PAT entries
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.
2026-08-06 07:33:54 -07:00
Mihai Parparita 1b0ac89674 ppcmmu: Move TLB internals into implementation
`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.
2026-08-06 07:33:54 -07:00
joevt 577ddb28a9 dbdma: Add update_cmd. 2026-08-05 19:39:27 -07:00
joevt 49cc164a11 dbdma: Add comment. 2026-08-05 19:38:34 -07:00
dingusdev 0df52ad451 Workflows - Use MSVC instead of MSYS2 for Windows 2026-08-05 19:28:45 -07:00
Mihai Parparita 45ea0103ed dbdma: update xferStatus and resCount when handling FLUSH command (#198)
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).
2026-08-05 18:43:52 -07:00
Mihai Parparita 172efccd1b cpu: remove unused global variables (#197)
Last glob_bb_start_la use was removed in d83fdd8866.

Last last_read_area, last_write_area, and last_exec_area uses were removed
in c9d4cc3321.
2026-08-05 18:43:25 -07:00
joevt 21324e200f burgundy: Implement AWAC_FRAME_COUNT.
Just count frame times using virtual time.
Should probably use real time since audio doesn't use virtual time.
2026-08-04 19:11:54 -07:00
joevt 51e5c95a1b burgundy: Implement AWAC_SOUND_CTRL_REG.
Placeholder for now.
2026-08-04 19:02:09 -07:00
joevt 24fad9fec7 burgundy: Rename value variable.
Read and Write should use the same variable name for the value.
2026-08-04 19:01:48 -07:00
dingusdev 10015af36d Merge pull request #195 from mihaip/upstream-fix-boot
atapicdrom: fix spurious reads during Mac OS boot
2026-08-03 22:23:39 -07:00
Mihai Parparita 4055dd07c4 atapicdrom: fix spurious reads during Mac OS boot
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.
2026-08-03 22:18:42 -07:00
Maxim Poliakovski 6f86021ae6 atapicdrom: add missing check for being ready. 2026-08-04 03:33:04 +02:00
dingusdev c916954187 Add missing VX and FEX updates 2026-08-01 11:32:07 -07:00
Maxim Poliakovski 23de8c1c08 scsicdromcmds: reimplement SET_CD_SPEED.
Also remove the corresponding stub from atapicdrom.cpp
2026-07-31 02:40:05 +02:00
Maxim Poliakovski 94e0691caa scsi*cmds: undo temporary renames. 2026-07-31 01:21:20 +02:00
Maxim Poliakovski 958bd0f8e6 cdromdrive: remove implementations of SCSI commands.
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.
2026-07-31 01:08:03 +02:00
Maxim Poliakovski b2bd9efbaa atapicdrom: use generic MODE_SENSE_x implementation. 2026-07-31 00:54:23 +02:00
Maxim Poliakovski 99ce46d510 scsicdromcmds: implement CD-ROM audio control page. 2026-07-31 00:38:39 +02:00
Maxim Poliakovski 78c438884c scsiphysinterface: rename set_eject_state to set_lock_state. 2026-07-30 23:56:16 +02:00
Maxim Poliakovski 87633e7fdf scsicdromcmds: add CD capabilities and mechanical status page. 2026-07-30 23:00:44 +02:00
Maxim Poliakovski 57d97370f1 cdromdrive: add mechanical properties and capabilities. 2026-07-30 23:00:25 +02:00
Maxim Poliakovski 045e6d9d7f atapicdrom: use generic SCSI commands, part 1. 2026-07-30 18:47:32 +02:00
Maxim Poliakovski 90b53a61ad atapibasedevice: implement ATAPI PHY for ScsiPhysInterface.
This permits reusing of generic SCSI commands that
don't contain anything related to the particular
physical layer.
2026-07-30 13:55:12 +02:00
dingusdev 7658707bd3 Add missing return statements 2026-07-29 18:49:54 -07:00
Maxim Poliakovski aad05628ea scsiphysinterface: add sense_key to set_status().
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.
2026-07-30 01:27:45 +02:00
Maxim Poliakovski 520518f2ac scsiblockcmds: improve a couple of logging messages. 2026-07-30 01:27:26 +02:00