We would reschedule timers based on their interval and the current time, which
would cause timers with the same interval to get aligned. This may be not be
desired (if a subsystem has two intentionally out-of-phase timers), so we
instead advance the timer based on its previously scheduled time and multiples
of the interval.
Not strictly necessary for the codebase as it stands today (we no longer use
two cyclic intervals for the VBL interval) but it still seems like a worthwhile
correctness improvement, if we decide to reintroduce that approach.
With the shared `TimerInfo` structs refactor from 529fff7d, it's easier
to accidentally enqueue the same timer multiple twice. Help the the
programmer out by logging an error if the timer is already `active` when
adding it. To also reduce the boilerplate, one-shot timers and and
cancellation automatically clear the flag.
The error could be upgraded to a CHECK_F once we're more confident that
we've fixed all of the callsites.
The point of this change is that g_icycles might not always be the
current time. For example, when g_realtime is true.
process_timers now returns the next time a timer needs to be processed.
Don't subtract time_now, because for realtime mode, the time has changed
since time_now was captured, especially for timers that take a long time
to process.
When there's no timer pending, process_events will return a time of now
+ 0.5 ms for when process_timers should be called again.
Let empty CD-ROM drives accept image insertion events and report the
change to the guest. Guest eject requests now detach the backing image,
and insertion is rejected while media is still present.
SDL handles dropped files through the shared event path. The macOS
bundle also registers ISO and Toast images for app-icon drops.
Added controls to increment/decrement icnt_factor and toggle g_realtime
for testing and debugging purposes.
Control Alt Shift = -> increment_icnt_factor();
Control Alt Shift - -> decrement_icnt_factor();
Control Alt r -> toggle_g_realtime();
Co-Authored-By: joevt <[email protected]>
Fix virtual display resolution change while in full screen mode.
Switching resolutions should keep the same full screen mode (integer,
full, no bars) unless a custom scale (using the zoom keys Control-- or
Control-+) has been selected.
Control-F is for switching forward through the full screen modes. Add
Control-Shift-F for switching backward through the full screen modes.
This allows reducing full screen mode without going through not full
screen mode.
Keys that are held down too early are ignored which makes it difficult
perform some tasks at startup:
- Shift key to disable extensions.
- Command-Option-O-F to enter Open Firmware.
- Command-Option-P-R to reset nvram.
- Capslock to boot MkLinux or Copland.
This change hopes to grab all the keys being pressed and post events for
all of them when the ADB bus is ready.
Create a mouse grab toggle event to toggle the mouse grab using the current window. After the toggle event is transmitted, transmit a mouse grab changed event so that all windows can update their title.
If the window's size is reduced such that the grabbed mouse is no longer inside the window, then a mouse click will go to another app. Therefore, check the mouse position and update if necessary every time the window changes size.
Added a third full screen mode which removes letterbox or pillarbox black bars.
Added Control-- and control-+ to decrease or increase the scale by a factor of 2^(1/8). This means the scale doubles or halves after pressing the same key 8 times.
drawable_w and drawable_h are floating point so that scaling is reversible (i.e. scaling from 100% to 800% and back to 100% gives 100% instead of 99 or 101%).
default_scale_x
Handle switching host resolution between Retina (HiDPI) and Low resolution modes. This involves updating the window scale factor.
Add window scale factor to window title.
A display begins in Windowed mode.
1) Press Control-F once to use full screen mode with integer scaling. If this mode is the same size as full screen mode then it is skipped.
2) Press Control-F again to use full screen mode. Smooth Scaling should be used for this mode if the scaling is not integer. Look at the Mac OS 7/8/9 window stripes to see the problem.
3) Press Control-F a third time to get back to windowed mode.
Fixed a bug where Control-S (Toggle Smooth Scaling mode) did not immediately update the display.
These keys only affect the current display.
update_window_title can be used to update statistics about the display (such as display resolution) or about DingusPPC in general (such as "mouse grabbed" status).
A DPPC_WINDOWEVENT_MOUSE_GRAB_CHANGED window event is added so that Display::handle_events can update the "mouse grabbed" indicator in each display window. The event handler doesn't check the window ID because the status should be reflected in all windows.
The SDL_WINDOWEVENT_SIZE_CHANGED event causes the window to update the display resolution indicator.
In the future, we might add indicators for HD and CD and floppy disk activity, etc. They will be handled by a window event handler or a general DPPC event handler.