Commit Graph

1059 Commits

Author SHA1 Message Date
Maxim Poliakovski
85d5b10f61 sc53c94: switch to the new DMA API. 2024-12-03 11:37:18 +01:00
Maxim Poliakovski
5057792d4d dbdma: implement xfer_to_device method. 2024-12-03 11:37:18 +01:00
Mihai Parparita
4479387580 Remove using namespace std from remaining header files
It's somewhat of an anti-pattern, and can lead to conflicts with
other symbols (e.g. the Windows build failure in https://github.com/dingusdev/dingusppc/actions/runs/11762906342/job/32766290288,
I removed `using namespace std` from timermanager.h to fix that one).
2024-11-30 20:01:09 -08:00
Maxim Poliakovski
04899d6528 dbdma: prevent STOP from updating xferStatus. 2024-11-30 12:12:32 +01:00
Maxim Poliakovski
bd7c424989 dmacore: add xfer_to method. 2024-11-30 11:55:16 +01:00
Maxim Poliakovski
6d2872a07f superdrive: add missing break. 2024-11-30 11:55:16 +01:00
Maxim Poliakovski
7e93d2d169 scsihd: add missing phase switch to write(). 2024-11-29 17:47:29 +01:00
Rairii
2bb35dc613 pcihost: Add machine check exception.
A machine check exception happens when attempting to read from an unmapped I/O address.
2024-11-29 07:41:57 -07:00
dingusdev
26aa452c57 Fix benchmark compiling, again 2024-11-29 07:41:45 -07:00
joevt
7a55a81186 pcihost: Fix pci_unregister_device.
Remove the device from the hosts dev_map.
Remove the device from the Machine object.
2024-11-29 07:31:23 -07:00
joevt
c9359592d7 pcihost: Modify name of attached PCI devices.
In case multiple PCI devices of the same type are added, make sure each has a different name for logging.
2024-11-29 07:31:16 -07:00
dingusdev
f4b5ac2d16 Minor fix to page 0x31 2024-11-25 08:11:11 -07:00
dingusdev
f6dc704aff Add MODE_SENSE_6 to ATAPI CD-ROM emulation 2024-11-24 15:23:38 -07:00
dingusdev
ad44ce8ce4
Merge pull request #121 from mihaip/upstream-settings
Add support for specifying properties of dynamically-registered devices via the command line
2024-11-22 07:59:37 -07:00
joevt
4b13af6691 atirage: Change BAR 0 size calculation.
We only need up to BE_FB_OFFSET + this->vram_size.
If vram_size is 8MB, then make sure the last 4K is not mapped to BAR 0 because the macOS driver likes to map BAR 2 at that location.
2024-11-22 07:58:21 -07:00
Mihai Parparita
a941836a4d Add support for specifying properties of dynamically-registered devices via the command line
The previous approach of traversing the machine and its device tree
at startup to register CLI11 options was not working for dynamically
registered devices like PCI cards. This meant that options like
gfxmem_size or mon_id from the video cards could not be set.

Switch to instead registering in MachineFactory a hook function that
provides CLI flag values. We can call it when registering any property,
whether at startup or dynamically.
2024-11-21 22:58:36 -08:00
dingusdev
d279ada718 Revert "dbdma: Schedule interpret_cmd."
This reverts commit e1849a2bfd.
2024-11-17 06:49:43 -07:00
joevt
e1849a2bfd dbdma: Schedule interpret_cmd.
Have the entire dbdma program executed by scheduling each iteration in the CPU loop.
This is done only for devices that use the dbdma program to drive data input/output (has_data_callbacks) rather than have the device drive the dbdma program.
2024-11-16 10:30:20 -07:00
joevt
362cfcbc83 atahd: Rename descriptors. 2024-11-15 12:05:50 -07:00
joevt
6c093e141b Add missing override statements. 2024-11-15 10:03:57 -07:00
joevt
ef6f2a40c8 atimach64defs: Add some bits. 2024-11-13 07:52:34 -07:00
joevt
3fbf0ddaa4 atimach64defs: Don't need L for unsigned constants. 2024-11-13 07:52:25 -07:00
joevt
6572bf8ce3 atirage: Fix Apple monitor extended sense codes.
Now multi-sync displays should be usable with Beige G3.
2024-11-13 07:51:49 -07:00
joevt
f27b8ba1be pdmonboard: Fix display resolution change.
You can connect a multisync display which should support 640x480 and 832x624.
2024-11-12 19:04:59 -07:00
joevt
f53a7cce32 appleramdac: Fix clock divisor 1x.
If bits 6 and 7 are 3, then the divisor should be 1 instead of 16.
0 -> 2x
1 -> 4x
2 -> 8x
3 -> 1x (not 16x).
This change affects RGB 12 inch dislay 512 x 384 60Hz mode in Platinum.
2024-11-12 19:04:29 -07:00
joevt
e7eb1c8a66 Fix PCI interrupts and add devices.
- Use interrupt source instead of IRQ ID in the IrqMap.
- Add a get_interrupt_controller method to mirror the set_interrupt_controller method.
- Have PCI hosts use pcihost_device_postinit to add PCI devices. This was moved from bandit's device_postinit and allows for duplicate devices by appending the slot to the registered device name.
- Fix interrupts of Pippin.

Fix interrupts of cmd646
- Make it work like other PCI devices.
- IntDetails is built into the pcibase base class.
- IntDetails is initialized by calling pci_interrupt.
- pci_interrupt checks the "enable interrupts" flag before doing an interrupt.
2024-11-12 07:04:55 -07:00
joevt
e707d1f27a Remove slashes from PCI device names.
So they are not mistaken for path separators.
2024-11-11 21:28:51 -07:00
joevt
9a2303c495 pci: Replace pci_name with get_name.
It's redundant to have two names.
2024-11-11 21:28:23 -07:00
joevt
6154b7cbe2 amic: Add modem port transmit DMA read. 2024-11-11 21:10:17 -07:00
joevt
ffc7de4715 platinum: Handle read 4 bytes with offset. 2024-11-10 21:05:05 -07:00
joevt
97339e4ce4 platinum: Add disable_display.
To mirror enable_display.
2024-11-10 21:03:53 -07:00
joevt
fc89fec3e6 dbdma: Do interrupt after setting resCount and xferStatus. 2024-11-10 06:24:24 -07:00
joevt
15986a4e4f dbdma: Allow clearing only control bits.
Only control bits can be set and cleared by software.
Command bits and status bits cannot be cleared.
2024-11-10 06:23:35 -07:00
joevt
d56520d22a dbdma: Set active only when wake is set. 2024-11-10 06:22:38 -07:00
Mihai Parparita
f65f9b9845 Add a deterministic execution mode
Adds support for a --deterministic command-line option that makes
repeated runs the same:
- Keyboard and mouse input is ignored
- The sound server does a periodic pull from the DMA channel (so that
  it gets drained), but only does so via a periodic timer (instead of
  being driven by a cubeb callback, which could arrive at different
  times)
- Disk image writes are disabled (reads of a modified area still
  work via an in-memory copy)
- NVRAM writes are disabled
- The current time that ViaCuda initializes the guest OS is always the
  same.

This makes execution exactly the same each time, which should
make debugging of more subtle issues easier.

To validate that the deterministic mode is working, I've added a
periodic log of the current "time" (measured in cycle count), PC
and opcode. When comparing two runs with --log-no-uptime, the generated
log files are identical.
2024-11-09 22:48:06 -08:00
joevt
f415a63b76 dbdma: Allow Stop command to set xferStatus.
Some software may check the status flags of a Stop DBDMA descriptor.
2024-11-09 21:05:32 -07:00
joevt
50e661f804 dbdma: Resume should continue DBDMA program.
Just like Start does.
2024-11-09 21:05:27 -07:00
joevt
7ffafdc007 dbdma: Implement branch taken flag. 2024-11-09 20:31:54 -07:00
joevt
96875a1278 dbdma: Clear active flag if paused flag is set.
The active flag is cleared when the pause flag is set, so why shouldn't the active flag be cleared when the start flag is set with the pause flag is already set?
2024-11-09 19:59:52 -07:00
dingusdev
6766ca8647
Merge pull request #118 from mihaip/upstream-hidpi
Enable HiDPI mode for SDL and ensure that we use nearest-neighbor scaling
2024-11-09 16:59:15 -07:00
Mihai Parparita
fc13f6870b Enable HiDPI mode for SDL and ensure that we use nearest-neighbor scaling
Avoids blurriness on macOS hosts with Retina displays.

Smooth scaling can be toggled back on via control-S
2024-11-09 15:48:00 -08:00
Rairii
625e474c03 atirage: Force redraw if pixel format changes. 2024-11-08 08:00:43 -07:00
joevt
116a65ce77 ati: Frame refresh if CRTC_ENABLE changes. 2024-11-08 07:38:07 -07:00
Maxim Poliakovski
c6116fcc88 grandcentral: pass Curio DREQ state to its DMA channel.
Bit 5 of the channel status register of the SCSI0 DMA channel
reflects the DREQ signal from Curio.
The old SCSI API still used in some Macintosh applications
- most notably HD SC Setup and Drive Setup - relies on this API
and that signal to be implemented.
2024-11-03 15:10:33 +01:00
Maxim Poliakovski
86ce9b0bb1 dbdma: support for non-DWORD register reads. 2024-11-03 15:10:33 +01:00
Maxim Poliakovski
9915c15086 Initial CMD646U2 Ultra ATA controller emulation. 2024-10-09 14:49:09 +02:00
Keith Kaisershot
34e0ba84f1 Add AppleJack controller support, based on AdbMouse
All AppleJack controllers start in mouse emulation mode, behaving exactly like
ADB mice. Only upon receiving a Listen command on register 3 with handler ID
0x46 does the AppleJack switch protocols, albeit such a change consisting merely
of expanding register 0's buffer size to 4 bytes. In this state, the first 2
bytes remain defined as they are for an ADB mouse; the additional 16 bits carry
the respective states of each of the AppleJack controller's remaining 11 buttons
out of a possible supported 16.

For backward compatibility, honor both mouse clicks and shoulder button presses
on the host when considering the state of the emulated trigger buttons.
2024-10-06 23:43:50 -07:00
Keith Kaisershot
6696248158 adbbus: decouple ADB devices from CUDA
AdbMouse and AdbKeyboard are subdevices of the CUDA device alongside AdbBus.
This doesn't make sense because conceptually, ADB devices hang off of the ADB
bus, not CUDA itself. An ADB bus can exist without a CUDA present, for example
Egret on older 68K Macs and the PMU on newer Power Macs. Therefore, make the ADB
device list a subhierarchy of AdbBus instead. Add a new "adb_devices" property
belonging to AdbBus that can allow users to specify ADB devices on the command
line at machine creation time, independent of the emulated bus's host. Make this
property default to "Mouse,Keyboard" to preserve existing behavior.
2024-10-06 23:20:10 -07:00
Maxim Poliakovski
64a5a17df0 heathrow: fix interrupt masking.
Use int_mask1/int_mask2 directly without changing int_events1/int_events2.
That permits interrupt generation on int_mask1/int_mask2 changes.
2024-09-28 23:17:14 +02:00
Maxim Poliakovski
a649a688e7 grandcentral: fix interrupt masking.
Use int_mask directly without changing int_events.
That permits interrupt generation on int_mask changes.
2024-09-28 23:17:14 +02:00