pub struct PresentCap(/* private fields */);Expand description
The fastest a game may change the picture: the fewest VBlanks between two display flips.
Every PSoXide game is capped at PresentCap::HZ30 (a flip at most every
second VBlank, 30 fps NTSC and 25 fps PAL) unless it opts out by name with
PresentCap::UNCAPPED. A frame built inside one VBlank interval then waits
for the next flip slot instead of flipping at 60 for a moment and falling back,
which reads as a stutter. Frames slower than the cap are untouched: the cap
bounds the rate from above and never speeds anything up.
psx-rt enforces it where the flip happens (see
psx_rt::interrupts::set_present_cap); FlipGate is the same rule as pure
logic, so it is host-testable and a tool can check a recorded run against it.
Implementations§
Source§impl PresentCap
impl PresentCap
Sourcepub const HZ30: PresentCap
pub const HZ30: PresentCap
At most one flip every second VBlank (30 fps NTSC, 25 PAL): the default.
Sourcepub const UNCAPPED: PresentCap
pub const UNCAPPED: PresentCap
A flip on every VBlank (60 fps NTSC, 50 PAL). The explicit opt-out, for a game that deliberately targets the full display rate.
Sourcepub const fn every_vblanks(vblanks: u8) -> PresentCap
pub const fn every_vblanks(vblanks: u8) -> PresentCap
At most one flip every vblanks VBlanks (0 is treated as 1).
Sourcepub const fn min_vblanks(self) -> u8
pub const fn min_vblanks(self) -> u8
The fewest VBlanks between two flips.
Trait Implementations§
Source§impl Clone for PresentCap
impl Clone for PresentCap
Source§fn clone(&self) -> PresentCap
fn clone(&self) -> PresentCap
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PresentCap
impl Debug for PresentCap
Source§impl Default for PresentCap
impl Default for PresentCap
Source§fn default() -> PresentCap
fn default() -> PresentCap
Source§impl PartialEq for PresentCap
impl PartialEq for PresentCap
impl Copy for PresentCap
impl Eq for PresentCap
impl StructuralPartialEq for PresentCap
Auto Trait Implementations§
impl Freeze for PresentCap
impl RefUnwindSafe for PresentCap
impl Send for PresentCap
impl Sync for PresentCap
impl Unpin for PresentCap
impl UnsafeUnpin for PresentCap
impl UnwindSafe for PresentCap
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)