Commit Graph

1971 Commits

Author SHA1 Message Date
Maxim Poliakovski
671cd0c5da machineyosemite: set PCI IRQ maps. 2024-08-29 00:16:59 +02:00
Maxim Poliakovski
ef62e8b965 New API for registering PCI interrupts. 2024-08-29 00:16:59 +02:00
dingusdev
8c44da655c Documentation additions 2024-08-26 06:48:55 -07:00
dingusdev
b5850f1cd2 Slight clean-up to ppcexec 2024-08-26 06:48:40 -07:00
dingusdev
0a61970b29
Merge pull request #116 from mihaip/upstream-log
main: add more control over logging
2024-08-25 17:15:39 -07:00
Mihai Parparita
91a8e83f21 main: add more control over logging
Allow the verbosity to be adjusted.

Allow logging to be sent to stderr even when running in interpreter mode.

Allow uptime (time since program start) to be disabled. This makes it
easier to compare logs across successive runs.
2024-08-25 17:05:46 -07:00
Maxim Poliakovski
825314c869 atahd: clean up READ_MULTIPLE/WRITE_MULTIPLE. 2024-08-26 00:20:53 +02:00
dingusdev
8d9bc66a82
Merge pull request #115 from mihaip/upstream-multiple
Fixes for READ_MULTIPLE and WRITE_MULTIPLE commands
2024-08-25 06:38:15 -07:00
Mihai Parparita
52f4d847dd Fixes for READ_MULTIPLE and WRITE_MULTIPLE commands
We may be transferring less data than can fit in a chunk, so we need
to ensure that xfer_cnt is clamped to 0 when transferring the last
chunk (otherwise it remains negative, and has_data() will return true).

It's also possible that the transfer size is bigger than a chunk but not
an even multiple of the chunk size, so we need to ensure that we don't
try to transfer a whole chunk in the last iteration.

More correctly initialize the device identification struct, to report
the maximum (word 47) and current (word 59) number of blocks that can be
transferred with READ_MULTIPLE and WRITE_MULTIPLE commands.

Fix post_xfer_action to write the actual data size that was written,
as opposed to an entire chunk (which may be larger).
2024-08-24 22:51:07 -07:00
dingusdev
ebf4b0e969 minor ATA tweaks
From @Wack0's branch
2024-08-24 12:58:19 -07:00
Maxim Poliakovski
47237ff87b
Merge pull request #114 from mihaip/upstream-atahd-fix
Fix ATA HD initialization on Beige G3 when booting 9.2
2024-08-23 12:59:51 +02:00
Mihai Parparita
8d95aa5ed3 Fix ATA HD initialization on Beige G3 when booting 9.2
1f2256ec81a/7ee8b9b2 were referencing a multiple_sector_count field,
but it was never set. This was resulting in an error being returned
(`READ MULTIPLE with SET MULTIPLE==0`).` We actually should use
`sec_per_block``, which bd16b7c69e introduced.
2024-08-22 22:38:48 -07:00
dingusdev
7ee8b9b2f0 Add missing variable 2024-08-22 20:49:11 -07:00
dingusdev
1f2256ec81 Additional ATA commands
Mostly from Wack0's NT4 fork.

Co-Authored-By: Rairii <2650838+Wack0@users.noreply.github.com>
2024-08-22 20:42:43 -07:00
Maxim Poliakovski
0518f2ae2f atahd: fix DIAGNOSTICS command. 2024-08-21 23:12:53 +02:00
Maxim Poliakovski
3bf088f2c8 atahd: fix RECALIBRATE command.
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.
2024-08-21 21:21:44 +02:00
Maxim Poliakovski
bd16b7c69e atahd: implement mandatory SET_MULTIPLE_MODE command. 2024-08-21 21:21:44 +02:00
Maxim Poliakovski
f5c91968a2 idechannel: split MacIO specific stuff into a separate class.
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.
2024-08-20 16:55:31 +02:00
Maxim Poliakovski
4e78ac33c5 atabasedevice: disable device interrupts on reset. 2024-08-20 15:36:12 +02:00
Maxim Poliakovski
e1acf5d160 Rename ppc_effective_address to ea. 2024-08-19 21:11:22 +02:00
dingusdev
047515d813
Merge pull request #112 from mihaip/upstream-ppc_effective_address
ppc: make ppc_effective_address into a local
2024-08-19 06:21:31 -07:00
Mihai Parparita
bdbeb742d4 ppc: remove two unused global variables
Last use of grab_return was removed in f204caa907.
grab_breakpoint was added in 2bd717e293 but
never used.
2024-08-18 22:46:52 -07:00
Mihai Parparita
e7d8e71297 ppc: make ppc_effective_address into a local
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).
2024-08-18 22:38:50 -07:00
Maxim Poliakovski
a34e0a4737 PCI-to-PCI bridges now return true in supports_io_space().
Doing so ensures that accesses to the I/O space are broadcasted
to the PCI-to-PCI bridges automatically.
2024-08-17 01:01:53 +02:00
Maxim Poliakovski
2c026259b1 pcibridge: improve formatting. 2024-08-17 01:01:53 +02:00
Maxim Poliakovski
cd36df5500 pcibridge: fix a bug in pci_io_write() caused by copy-and-paste coding. 2024-08-17 01:01:53 +02:00
Maxim Poliakovski
5ea7b8c5f8
Merge pull request #111 from mihaip/upstream-alignment
atapibasedevice: fix unaligned memory access
2024-08-16 12:56:08 +02:00
Mihai Parparita
372b9cae7a atapibasedevice: fix unaligned memory access
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.
2024-08-15 22:32:46 -07:00
Maxim Poliakovski
595478ed6f hwcomponent: add IDE_HOST component type. 2024-08-12 14:03:05 +02:00
dingusdev
a2776ddae1 Documentation update - Aug. 11, 2024 2024-08-11 17:48:55 -07:00
Maxim Poliakovski
f9338b8dd9 pcihost: broadcast I/O requests to PCI-to-PCI bridges. 2024-08-11 15:51:06 +02:00
dingusdev
dee7090071 More documentation work 2024-08-07 22:38:35 -07:00
dingusdev
2a8e5538b2 Partially addressing Issue #109
It'll be better to use a keycode file in the future. This will hopefully do for now.
2024-08-04 15:02:48 -07:00
Maxim Poliakovski
20b2fb1bef viacuda: refactor emulation of the VIA registers.
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.
2024-08-04 21:43:06 +02:00
Maxim Poliakovski
f096eef66d viacuda.h: cosmetic improvements. 2024-08-04 21:43:06 +02:00
Maxim Poliakovski
899000b647
Merge pull request #108 from mihaip/upstream-mmu-skip-mode1
ppcmmu: skip over mode 1 entries when doing PAT flushes
2024-08-01 12:09:35 +02:00
Mihai Parparita
76824fb602 ppcmmu: skip over mode 1 entries when doing PAT flushes
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.
2024-07-31 23:08:36 -07:00
dingusdev
02af6da599
Merge pull request #106 from roytam1/pr-sdl-redraw
sdl: handle SDL_WINDOWEVENT_EXPOSED event to fix redrawing issue
2024-07-29 18:44:25 -07:00
roytam1
83afae5625 sdl: handle SDL_WINDOWEVENT_EXPOSED event to fix redrawing issue 2024-07-29 23:27:05 +08:00
dingusdev
e5510dd9ae
Merge pull request #105 from Wack0/fix-mouse-upstream
adbmouse: only send first two bytes in standard/classic protocol as per spec
2024-07-29 06:25:52 -07:00
Rairii
4d7c520f18 adbmouse: only send first two bytes in standard/classic protocol as per spec
Fixes any mouse driver that only supports the classic protocol and expects register 0 reads to return two bytes.
2024-07-29 11:37:54 +01:00
dingusdev
6f62f9dd98
Merge pull request #104 from mihaip/upstream-mmu-perf
ppcopcodes: avoid TLB flushes for noop SR changes
2024-07-28 14:06:18 -07:00
Mihai Parparita
31d7b056af ppcopcodes: avoid TLB flushes for noop SR changes
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.
2024-07-28 13:28:05 -07:00
Mihai Parparita
9b49603c72 memctrl: keep address_map sorted by address
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.
2024-07-28 13:27:48 -07:00
dingusdev
f192d11758
Merge pull request #102 from mihaip/upstream-dev_id
atabasedevice: Set dev_id.
2024-07-27 14:40:16 -07:00
dingusdev
ae08c083ea
Merge pull request #103 from mihaip/upstream-fb_known_to_be_changed
Pass through draw_fb optimization metadata to Display class
2024-07-27 14:04:41 -07:00
Mihai Parparita
dab9334c3a Pass through draw_fb optimization metadata to Display class
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).
2024-07-27 11:38:59 -07:00
joevt
7fdfd6109f atabasedevice: Set dev_id.
Extracted from @Wack0's Wack0/dingusppc-nt@529991bd78

Co-authored-by: Rairii <2650838+Wack0@users.noreply.github.com>
2024-07-27 09:10:28 -07:00
dingusdev
7d6e87a0d3 Add stub for setting power messages 2024-07-26 07:31:31 -07:00
dingusdev
a20ebade09 Add more things to gitignore 2024-07-26 07:31:06 -07:00