#[non_exhaustive]pub struct Options {
pub tickrate: Option<u16>,
pub max_size: Option<u16>,
pub screen_rotation: ScreenRotation,
pub font_style: Font,
pub touch_input_mode: TouchMode,
pub start_address: Option<u16>,
pub colors: Colors,
pub quirks: Quirks,
}
Expand description
Representation of Octo options.
Fields (Non-exhaustive)
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.tickrate: Option<u16>
The number of CHIP-8 instructions executed per 60Hz frame, ie. the “speed” of the virtual CPU. These are all approximations of hardware limitations, because on real hardware different instructions execute in different times, but it’s a conventional middle ground.
Common values:
- 7–15 (approximate speed of the original interpreter for the COSMAC VIP)
- 20–30 (approximate speed of the SUPER-CHIP interpreters for the HP 48 calculators)
- 10000 (Octo’s “Ludicrous speed” setting)
max_size: Option<u16>
The maximum amount of virtual memory, in bytes, that is available to the program. If the CHIP-8 program is larger than this, the interpreter should give an error.
At least 512 bytes are always reserved for the CHIP-8 interpreter and unavailable to the
CHIP-8 game; see the field start_address
.
This is mostly relevant when developing CHIP-8 games for real hardware, as an assertion that the game will fit in the target platform’s memory. Most CHIP-8 interpreters can ignore this value without consequence.
Common values:
- 3216 (original interpreter for the COSMAC VIP with 4K RAM)
- 3583 (SUPER-CHIP interpreter for the HP 48)
- 3584 (Octo)
- 65024 (XO-CHIP interpreters)
Other values might be used for games for more obscure platforms, games that were designed to run on a COSMAC VIP with only 2K RAM, etc.
screen_rotation: ScreenRotation
The orientation of the display.
font_style: Font
The font style expected by the game.
touch_input_mode: TouchMode
The touch controls this game supports.
start_address: Option<u16>
The memory address in the virtual RAM that this game should be loaded from. On legacy
hardware, the interpreter itself was loaded into the lower memory addresses, and then the
game was loaded after it (usually at address 0x200
, ie. 512).
Common values:
- 512 (original interpreter for the COSMAC VIP, DREAM 6800, HP 48, etc)
- 1536 (interpreter for the ETI-660)
colors: Colors
Custom colors this game would like to use, if possible. It’s not important for a CHIP-8 interpreter to support custom colors although not doing so might impact the creator’s artistic vision, especially for XO-CHIP games that use more than two colors.
quirks: Quirks
Specific behaviors this game expects from the interpreter in order to run properly. See
[OctoQuirks
] for specifics.
Implementations
Trait Implementations
sourceimpl Default for Options
impl Default for Options
Returns a default with a pretty fast tickrate, the maximum ROM size possible, and no quirks enabled except that the LoResDxy0Behavior
assumes Octo behavior.
sourceimpl<'de> Deserialize<'de> for Options
impl<'de> Deserialize<'de> for Options
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Display for Options
impl Display for Options
Serializes Options into a JSON string.
This format is used by Octo in Octocarts and HTML exports, as well as the Chip-8 Archive.
sourceimpl FromStr for Options
impl FromStr for Options
Deserializes Options from a JSON string.
This format is used by Octo in Octocarts and HTML exports, as well as the Chip-8 Archive.
impl StructuralPartialEq for Options
Auto Trait Implementations
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnwindSafe for Options
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more