Skip to main content

ExpansionDevice

Enum ExpansionDevice 

Source
#[non_exhaustive]
pub enum ExpansionDevice {
Show 80 variants Unspecified, StandardControllers, FourScore, FamicomFourPlayersAdapter, VsSystem4016, VsSystem4017, VsZapper, Zapper4017, TwoZappers, BandaiHyperShot, PowerPadSideA, PowerPadSideB, FamilyTrainerSideA, FamilyTrainerSideB, VausNes, VausFamicom, TwoVausPlusDataRecorder, KonamiHyperShot, CoconutsPachinko, ExcitingBoxingPunchingBag, JissenMahjong, PartyTap, OekaKidsTablet, BarcodeBattler, MiraclePiano, PokkunMoguraa, TopRider, DoubleFisted, Famicom3dSystem, DoremikkoKeyboard, RobGyromite, FamicomDataRecorder, AsciiTurboFile, IgsBattleBox, FamilyBasicKeyboard, DongdaPecKeyboard, Bit79Keyboard, SuborKeyboard, SuborKeyboardMacroWinnersMouse, SuborKeyboardSuborMouse4016, SnesMouse4016, Multicart, TwoSnesControllers, RacerMateBicycle, UForce, RobStackUp, CityPatrolmanLightgun, SharpC1CassetteInterface, SwappedStandardController, ExcaliburSudokuPad, AblPinball, GoldenNuggetCasino, KedaKeyboard, SuborKeyboardSuborMouse4017, PortTestController, BandaiMultiGamePlayer, VenomTvDanceMat, LgTvRemote, FamicomNetworkController, KingFishing, CroakyKaraoke, KingwonKeyboard, ZechengKeyboard, SuborKeyboardL90Ps2Mouse, Um6578Ps2KeyboardAndMouse, Um6578Ps2Mouse, YuxingMouse, SuborKeyboardYuxingMouse, GiggleTvPump, BbkKeyboardR90Ps2Mouse, MagicalCooking, SnesMouse4017, Zapper4016, VausPrototype, TvMahjongGame, MahjongGekitouDensetsu, SuborKeyboardXInvertedPs2Mouse, IbmPcXtKeyboard, SuborKeyboardMegaBookMouse, Unassigned(u8),
}
Expand description

Default expansion device: NES 2.0 header byte 15, bits 0-6.

The device the game expects at CPU $4016/$4017, per the Nesdev wiki’s “NES 2.0” page, §“Default Expansion Device” (codes $00-$4F). An unassigned code – $06 (withdrawn) or $50-$7F – is kept, unaltered, in ExpansionDevice::Unassigned. The header only describes the device: nothing in the core selects an input device from it.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Unspecified

$00: unspecified (no information).

§

StandardControllers

$01: standard NES / Famicom controllers.

§

FourScore

$02: NES Four Score / Satellite with two more standard controllers.

§

FamicomFourPlayersAdapter

$03: Famicom Four Players Adapter, “simple” protocol.

§

VsSystem4016

$04: Vs. System, 1P via $4016.

§

VsSystem4017

$05: Vs. System, 1P via $4017.

§

VsZapper

$07: Vs. Zapper.

§

Zapper4017

$08: Zapper ($4017).

§

TwoZappers

$09: two Zappers.

§

BandaiHyperShot

$0A: Bandai Hyper Shot light gun.

§

PowerPadSideA

$0B: Power Pad side A.

§

PowerPadSideB

$0C: Power Pad side B.

§

FamilyTrainerSideA

$0D: Family Trainer side A.

§

FamilyTrainerSideB

$0E: Family Trainer side B.

§

VausNes

$0F: Arkanoid Vaus controller (NES).

§

VausFamicom

$10: Arkanoid Vaus controller (Famicom).

§

TwoVausPlusDataRecorder

$11: two Vaus controllers plus Famicom Data Recorder.

§

KonamiHyperShot

$12: Konami Hyper Shot controller.

§

CoconutsPachinko

$13: Coconuts Pachinko controller.

§

ExcitingBoxingPunchingBag

$14: Exciting Boxing punching bag.

§

JissenMahjong

$15: Jissen Mahjong controller.

§

PartyTap

$16: Yonezawa Party Tap.

§

OekaKidsTablet

$17: Oeka Kids tablet.

§

BarcodeBattler

$18: Sunsoft Barcode Battler.

§

MiraclePiano

$19: Miracle Piano keyboard.

§

PokkunMoguraa

$1A: Pokkun Moguraa tap-tap mat.

§

TopRider

$1B: Top Rider handlebars.

§

DoubleFisted

$1C: double-fisted (two controllers per player).

§

Famicom3dSystem

$1D: Famicom 3D System.

§

DoremikkoKeyboard

$1E: Doremikko keyboard.

§

RobGyromite

$1F: R.O.B. Gyromite.

§

FamicomDataRecorder

$20: Famicom Data Recorder (“silent” keyboard).

§

AsciiTurboFile

$21: ASCII Turbo File.

§

IgsBattleBox

$22: IGS Storage Battle Box.

§

FamilyBasicKeyboard

$23: Family BASIC keyboard plus Famicom Data Recorder.

§

DongdaPecKeyboard

$24: Dongda PEC keyboard.

§

Bit79Keyboard

$25: Bit Corp. Bit-79 keyboard.

§

SuborKeyboard

$26: Subor keyboard.

§

SuborKeyboardMacroWinnersMouse

$27: Subor keyboard plus Macro Winners mouse.

§

SuborKeyboardSuborMouse4016

$28: Subor keyboard plus Subor mouse via $4016.

§

SnesMouse4016

$29: SNES mouse ($4016).

§

Multicart

$2A: multicart.

§

TwoSnesControllers

$2B: two SNES controllers replacing the two standard controllers.

§

RacerMateBicycle

$2C: RacerMate bicycle.

§

UForce

$2D: U-Force.

§

RobStackUp

$2E: R.O.B. Stack-Up.

§

CityPatrolmanLightgun

$2F: City Patrolman light gun.

§

SharpC1CassetteInterface

$30: Sharp C1 cassette interface.

§

SwappedStandardController

$31: standard controller with swapped Left-Right / Up-Down / B-A.

§

ExcaliburSudokuPad

$32: Excalibur Sudoku pad.

§

AblPinball

$33: ABL Pinball.

§

GoldenNuggetCasino

$34: Golden Nugget Casino extra buttons.

§

KedaKeyboard

$35: Keda keyboard.

§

SuborKeyboardSuborMouse4017

$36: Subor keyboard plus Subor mouse via $4017.

§

PortTestController

$37: port test controller.

§

BandaiMultiGamePlayer

$38: Bandai Multi Game Player gamepad buttons.

§

VenomTvDanceMat

$39: Venom TV Dance Mat.

§

LgTvRemote

$3A: LG TV remote control.

§

FamicomNetworkController

$3B: Famicom Network Controller.

§

KingFishing

$3C: King Fishing controller.

§

CroakyKaraoke

$3D: Croaky Karaoke controller.

§

KingwonKeyboard

$3E: Kingwon keyboard.

§

ZechengKeyboard

$3F: Zecheng keyboard.

§

SuborKeyboardL90Ps2Mouse

$40: Subor keyboard plus L90-rotated PS/2 mouse in $4017.

§

Um6578Ps2KeyboardAndMouse

$41: PS/2 keyboard in the UM6578 PS/2 port, PS/2 mouse via $4017.

§

Um6578Ps2Mouse

$42: PS/2 mouse in the UM6578 PS/2 port.

§

YuxingMouse

$43: Yuxing mouse via $4016.

§

SuborKeyboardYuxingMouse

$44: Subor keyboard plus Yuxing mouse in $4016.

§

GiggleTvPump

$45: Gigggle TV Pump.

§

BbkKeyboardR90Ps2Mouse

$46: BBK keyboard plus R90-rotated PS/2 mouse in $4017.

§

MagicalCooking

$47: Magical Cooking.

§

SnesMouse4017

$48: SNES mouse ($4017).

§

Zapper4016

$49: Zapper ($4016).

§

VausPrototype

$4A: Arkanoid Vaus controller (prototype).

§

TvMahjongGame

$4B: TV Mahjong Game controller.

§

MahjongGekitouDensetsu

$4C: Mahjong Gekitou Densetsu controller.

§

SuborKeyboardXInvertedPs2Mouse

$4D: Subor keyboard plus X-inverted PS/2 mouse in $4017.

§

IbmPcXtKeyboard

$4E: IBM PC/XT keyboard.

§

SuborKeyboardMegaBookMouse

$4F: Subor keyboard plus Mega Book mouse.

§

Unassigned(u8)

A code the page does not assign ($06, $50-$7F).

Implementations§

Source§

impl ExpansionDevice

Source

pub const fn from_code(code: u8) -> Self

Decode header byte 15 (bit 7 is not part of the field and is ignored).

Source

pub const fn code(self) -> u8

The 7-bit byte-15 code this device encodes to.

Trait Implementations§

Source§

impl Clone for ExpansionDevice

Source§

fn clone(&self) -> ExpansionDevice

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ExpansionDevice

Source§

impl Debug for ExpansionDevice

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for ExpansionDevice

Source§

impl Hash for ExpansionDevice

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ExpansionDevice

Source§

fn eq(&self, other: &ExpansionDevice) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ExpansionDevice

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.