Commit Graph

1426 Commits

Author SHA1 Message Date
joevt
5a049642ea atirage: Add VBL callback. 2024-03-06 07:50:03 -07:00
joevt
b168459007 atirage: Calculate vert_blank. 2024-03-06 07:42:51 -07:00
joevt
d5c7b5f537 atirage: Add write CRTC_INT_CNTL. 2024-03-06 07:41:12 -07:00
joevt
506ed000a0 atirage: Add write CONFIG_STAT0. 2024-03-06 07:04:59 -07:00
joevt
b92e9216f4 atirage: Add write CRTC_VLINE_CRNT_VLINE.
For VLINE interrupt (but Mac OS X doesn't use enable VLINE interrupt).
2024-03-06 07:04:40 -07:00
joevt
6ff5079df8 atirage: Init CRTC_DISPLAY_DIS. 2024-03-06 07:04:25 -07:00
joevt
d686fc04f4 atirage: Fix crtc_update.
Add pixel format and pixel clock to the list of fields that will initiate a recalculation.
If frame rate is less than 24 or greater than 120 then assume 60Hz.
2024-03-05 08:02:50 -07:00
joevt
9aef78be4f atirage: Modify write CLOCK_CNTL.
Consider write-only bits: ATI_CLOCK_STROBE can't be read so clear it.
8 bits at Offset 2 is PLL_DATA. If we don't modify PLL_DATA, then insert the current value of PLL_DATA into the value that will be read from ATI_CLOCK_CNTL.
2024-03-05 08:02:20 -07:00
joevt
f6b1c080ad atirage: Init FIFO_CNT of GUI_STAT. 2024-03-05 07:54:19 -07:00
joevt
d4fa85688d atirage: Check both offset and size.
When checking if a particular byte of a register is accessed, check both the starting position (offset) and ending position (offset + size) of the bytes being access.
2024-03-05 07:52:12 -07:00
joevt
20b4a33c00 ppcexec: Remove EXHAUSTIVE_DEBUG. 2024-03-05 07:05:03 -07:00
joevt
f61055ebc0 ppcexec: Convert if to switch for ppc_opcode19. 2024-03-05 07:03:16 -07:00
joevt
777a02cbe9 pci: Use SIZE_ARG for logging arg size.
The SIZE_ARG macro defined in pcibase can be used outside pcibase with a small modification.
2024-03-04 21:16:46 -07:00
joevt
61b1940397 pci: Add command register mask.
The mask represents the list of bits that are allowed to change in the command register of PCI config space.
2024-03-04 21:16:38 -07:00
joevt
eef6d267c3 atirage: PCI BAR changes.
- Add BAR 2 decode. This BAR isn't actually used by Mac OS X, but decode it anyway just in case.
- Support updating of BARs (using change_one_bar method).
2024-03-04 21:13:07 -07:00
joevt
9c48c296c8 atirage: Register cleanup.
- Use register number instead of offset.
- Have one exit path from the read_reg and write_reg methods.
2024-03-04 21:11:56 -07:00
joevt
214c61669a videoctrl: Add pixel_format.
pixel_format is different than pixel_depth.
pixel_format depends on the GPU. A GPU might have multiple formats for the same depth.
We store this in videoctrl so that we can detect changes in pixel_format like we do for pixel_depth and active_width and active_height.
2024-03-04 21:11:42 -07:00
joevt
fb0396923f Fix dma STORE_QUAD and LOAD_QUAD.
When fetching DMA command, make sure to convert little endian fields to host endianness (i.e. don't use memcpy).
When fetching DMA command, return the host address of the DMA command for LOAD_QUAD. Maybe this address should be cached whenever this->cmdptr changes?
When fetching DMA command, return whether the DMA command is writable.
For LOAD_QUAD, pass the address of the DMA command to xfer_quad.
Always log unexpected DMA command values.
Write full 32-bit value for LOAD_QUAD.
Write reqCount to resCount.
2024-03-04 20:38:07 -07:00
joevt
6503a300cc Add PCI interrupt method.
A PCI device passes an interrupt to its host. The host will determine from the PCI device which interrupt to trigger.
2024-03-04 07:47:20 -07:00
joevt
be80595834 Remove obsolete pci config type 1 methods.
pci_find_device is the method used to pass pci config type 1 methods to child PCI devices.
2024-03-04 07:47:08 -07:00
joevt
54bda0ea95 pci: Change pci_conv_rd_data unaligned.
pci_conv_rd_data can be used to handle unaligned or 64-bit accesses in mmio regions if it's modified to include the next 32-bit value.
For pci config accesses, grackle repeats the 32-bit value. bandit uses a seemingly random number for the next 32-bit value, but we'll make it work like grackle.
2024-03-03 20:06:13 -07:00
joevt
6d23e18c11 pci: Add PCI CardBus bridge.
PCCard is used by PowerBook G3 Wallstreet in Open Firmware 2.0.1.
CardBus is probed in New World Macs starting from at least Open Firmware 4.1.9f1 sometime after Open Firmware 3.1.1.

- Create PCIBase from common stuff in PCIDevice.
- Add PCIBridgeBase. These have a primary bus number, secondary bus number, and subordinate bus number which are used to determine if PCI type 1 config cycle should be passed.
- Change PCIBridge to use PCIBridgeBase instead of PCIDevice.
- Add PCICardBusBridge which uses PCIBridgeBase.
2024-03-03 16:00:55 -07:00
joevt
5f8e7fcb73 pci: Log invalid BAR values.
For example, Old World Macs have versions of Open Firmware that don't support 512 MB BARs correctly. They may attempt to set such a BAR to 0x90000000 (a 256 MB boundary) instead of 0xA0000000 (the next available 512 MB boundary).
2024-03-03 15:49:59 -07:00
joevt
214b52a96a machinefactory: Fix spelling. 2024-03-03 15:13:29 -07:00
joevt
d426d0faeb Add settings when adding pci device. 2024-03-03 15:01:39 -07:00
joevt
ebb51addd7 debugger: Allow interrupt of disassembly.
Part of the "debugger: Fix interrupt signal." commit.
2024-03-03 14:36:24 -07:00
joevt
c64fab6ecb heathrow: Align read/write messages. 2024-03-03 12:03:06 -07:00
joevt
696bd6f316 mpc106: Remove pci_read and pci_write.
Because they are only called once and are small enough to include in read and write methods like they are in BanditHost.
2024-03-03 11:56:37 -07:00
joevt
7a3a661e2a platinum: Allow reading swatch registers. 2024-03-03 11:47:03 -07:00
joevt
f0949d296d platinum: Don't abort. 2024-03-03 11:46:40 -07:00
joevt
d2ebcb24b9 platinum: Use calculated fb_ptr for HW cursor. 2024-03-03 10:43:57 -07:00
joevt
644087b592 platinum: Fix fb_ptr calculation. 2024-03-03 10:43:40 -07:00
joevt
be2f5273d1 platinum: Init bank_base.
Because the constructor doesn't do it.
2024-03-03 10:43:25 -07:00
joevt
10053a8a1b atirage: Rename variable.
To match other occurrences in the same file.
2024-03-02 20:49:25 -07:00
joevt
9cefaec49c atirage: Spelling. 2024-03-02 20:44:39 -07:00
joevt
55b79c1518 atirage: Use register bit field names. 2024-03-02 20:44:08 -07:00
joevt
c2ab86d4ba atirage: Do something for hw cursor invert pixels.
Try a 50% alpha blend with black.
2024-03-02 20:43:54 -07:00
joevt
0e5fcde1e9 atirage: Add CUR_HORZ_VERT_OFF name. 2024-03-02 17:27:45 -07:00
joevt
002cce886c atirage: Indent. 2024-03-02 17:15:39 -07:00
joevt
151ea2ece4 atimach64defs: Add register bit fields. 2024-03-02 17:15:25 -07:00
joevt
568882a2ea atimach64defs: Sort addresses in descending order. 2024-03-02 17:14:59 -07:00
joevt
f38d6d73f4 atimach64defs: Add more device IDs. 2024-03-02 17:08:31 -07:00
joevt
569893861d heathrow: Don't set lat_timer.
It will be set by firmware.
2024-03-02 16:42:49 -07:00
joevt
e81ac6f61e Add PERCH slot.
So you can connect a USB controller or whatever to it.
2024-03-02 16:02:19 -07:00
joevt
177098c957 debugger: Fix interrupt signal.
Typing Control-C in Terminal app causes an interrupt signal that should enter the DPPC debugger but this only worked once since the signal handler never returned. Even if the signal handler reenabled the signal somehow, it calls enter_debugger recursively which is strange since the earlier calls to enter_debugger would never return.

Now the signal handler just sets a flag (power_on) which can be used to exit any loop (emulator loops, stepping loops, disassembly loops, dumping loops).

Main always calls enter_debugger now which calls the ppc_exec loop. The power_on flag will exit the ppc_exec loop to return to the debugger. Recursion of enter_debugger is eliminated except for calls to loguru's ABORT_F.

An enum power_off_reason is used to indicate why the power_on flag is set to false and to determine what happens next.
2024-03-02 12:57:02 -07:00
joevt
1e78512c95 Rename Curio and Mesh. 2024-03-02 11:12:45 -07:00
joevt
1b147151f0 videoctrl: Rename get_palette_color.
So it matches set_palette_color.
2024-03-02 08:59:02 -07:00
joevt
ad8a26616f scsidevice: Add LUN field.
This may make it possible for multiple LUNs to be added to the same target ID.
For now just use LUN #0.
2024-03-02 08:52:09 -07:00
joevt
8f28823217 scsi: Initialize cur_phase. 2024-03-02 08:51:45 -07:00
joevt
b509df78df Don't allow vert_blank to be 0. 2024-03-02 08:37:44 -07:00