Shutdown will enter the debugger or quit depending on the execution mode.
Quit is different from shutdown since it is triggered outside the guest by using the host Quit menu item.
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).
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.
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.
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.
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.
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.
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.
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).
Raw images contain supplementary information like synchronization fields,
correction codes etc. that needs to be ignored/discarded when
reading/writing user data.
This commit establish a basic architecture for exchanging user data
between a virtual device and a raw image.
The RR0_RX_CHARACTER_AVAILABLE bit is cleared after the character is read in receive_byte, but clear it anyway in read_reg when there's no character available just in case a character that was available somehow becomes unavailable.
Normally, the Port_B_Data or Port_A_Data address is used to directly access RR8 or WR8, but setting the register pointer in Port_B_Cmd or Port_A_Cmd to RR8/WR8 is another option.
Update write_regs[WR8] and read_regs[RR8] for possible debugging purposes.
Update write_regs[WR9] even though most or all of the bits are in master_int_cntrl.
Fix hardware reset for WR9. It's supposed to leave WR9_NO_VECTOR | WR9_VECTOR_INCLUDES_STATUS unchanged.
Fix channel reset for WR9. It's supposed to clear WR9_INTERRUPT_MASKING_WITHOUT_INTACK.
Add absolute coordinates for tablets. Absolute coordinates is relative to window so it can't work for multiple displays? Doesn't work for single display without mouse driver modification.
Add arbitrary number of buttons. Previously, only one mouse button was supported.
Add arbitrary number of bits. Previously, only 7 bits per axis was supported which is good enough for relative movement but not absolute movement.
Allow the dbdma program to initiate reading/writing by adding in and out callbacks.
Support the DBDMA flush command by adding a flush callback. If the transfer completes, then clear the flush flag, otherwise leave it unchanged.
Clear the flush flag after it is copied to the xferStatus of the DBDMA command.
Switching from Watch to Arrow cursor at vertical position zero (top of the screen) would sometimes cut off the top half of the Arrow cursor. The following changes fix this:
Use the new cursor_dirty flag to signal when the cursor should be updated. This reduces the number of cursor updates and doesn't depend on registers being accessed in a specific order.
Set the cursor_dirty flag for any change that should cause the hardware cursor to be updated:
- CUR_CLR0, CUR_CLR1: Cursor color changes. We don't check if the colors actually changed (all cursors are usually black and white). Rather, writes to these registers usually means the cursor bytes have changed or will change.
- CUR_OFFSET: Offset to cursor bytes.
- CUR_VERT_OFF: First vertical line of cursor to draw.
Other changes that don't require the cursor to be updated:
- CUR_HORZ_OFF: Horizontal offset of cursor position. The cursor is unchanged - just need to adjust the drawing position.
- CUR_HORZ_VERT_POSN: The cursor is unchanged - only the drawing position is changed.
The only thing that could change the cursor that we don't check is a change to the cursor bytes.
Sense codes for displays like the 12 inch RGB display (512x384) weren't working since they had the extended part set to 0xff.
Related to issues #25.
Also added some descriptive information and sizes which may be used for UI purposes such as creating a menu of displays to choose from. The sizes may be used to set the default window size for the display.
This commit fixes conflict resolution mistakes in the following commits:
"atimach64gx: Let crtc_update calculate fb_ptr."
"atimach64gx: Redraw only when necessary."
"atimach64gx: Log unhandled overlay registers." was mistakenly included in "atimach64gx: Let crtc_update calculate fb_ptr.". The OVR_ registers were included because they may be needed for 2D acceleration in System 7.5.3 and later.
Init them to defaults.
Make CONFIG_CNTL 8 bytes so unaligned read/write is easier.
Write changes to CONFIG_CNTL even if offset + size is > 4.
Log aperture change only if first byte (LSB) of CONFIG_CNTL is written. The driver might only write to the 2 most significant bytes which won't affect aperture size.
Offset and size are applied to the destination, not to source value, so we shouldn't use extract_bits when logging value.
Use ATI bitfield enums in switch statement.
The first packet the one sec mode should send is a mode 1 real time packet, same as GET_REAL_TIME.
A mode 2 packet is the same but doesn't include the time.
They are incomplete or unused (includes cmd and count but not the data and the count isn't used). Might as well get everything from the class fields in_buf and in_count.