Imports FinalBurn Alpha FBM input streams using an explicit game input
layout. FBM stores values in driver order, so the recording must be paired
with a verified ROM identifier or an ordered schema. Bundled game layouts
cite their driver sources in extdata/fbm-layouts.json.
Usage
read_fbm(
path,
analog = "raw",
deadzone = NULL,
triggers = "raw",
aliases = TRUE,
game = NULL,
input_schema = NULL,
...
)Arguments
- path
Recording file path.
- analog
Stick representation:
"raw"(default),"cardinal4","cardinal8","angle", or"angle+magnitude". A scalar applies to both sticks;c(left = "cardinal8", right = "angle")selects them independently. Cardinal modes add separate left/right logical direction columns. Continuous modes return numeric fields throughstick_channels(). Original X/Y values remain inanalog_channels()in every mode. Absent sticks add no columns.- deadzone
Radial threshold in centred axis half-range units, from zero to one. One value applies to both sticks; named left/right values are allowed.
NULLuses the default of the controller, whichever emulator recorded it: 0.125 for the sticks of Nintendo's consoles (Nintendo 64, GameCube, Wii extensions, 3DS) and 0.25 for all other sticks. The first is close to the 15 of 128 units that the GameCube's controller library discards on each axis (PAD_Clampin libogc). The second covers the resting position of a released PlayStation stick, up to about 32 of 128 units from the centre (psx-spx), and is close to the 7849 and 8689 of 32767 that Microsoft gives for the thumbsticks of PC gamepads (XInput). A game applies a threshold of its own, which the recording does not store; give that value to study one game. Neutral observations have no direction and anNAangle. Magnitude is kept.- triggers
"raw"(default) or"digital". For DTM, digital additionally projects each analogue trigger at 128/255 into separate L2/R2 columns. Hardware L/R click bits remain distinct from thresholded analogue triggers.- aliases
TRUE(default) places the controls of a recording under the shared IDs thatbutton_layout()describes. WithFALSE, a control that would be placed under another control's ID keeps the key of its source, so every control of the recording has a column of its own and no two are combined.- game
A verified ROM identifier matching a bundled input layout, such as
"ghouls". Supply eithergameorinput_schema.- input_schema
An ordered schema with a
sourcereference and afieldslist. Each field giveskey,player(zero for system inputs),type("button","byte", or"analog"), and an optional displayname. Optionalbutton_encodingis"binary"(default),"bit0", or"nonzero", according to the driver's interpretation of the byte. Field order must match the emulator driver exactly.- ...
Reader-specific arguments, such as
controller_orderfor M64 or DTM, ormemberfor a recording inside a ZIP archive (seemovie_members()).
Value
A replayr_movie with compact controls and the input schema.
Details
player() returns game controls, analog_channels() retains numeric
player inputs, and system_channels() returns cabinet and system inputs.
It also retains every raw field under raw_pN_key or raw_system_key,
including source bytes whose button interpretation uses only bit zero.
Rows follow the stored frame order. The header retains the frame count,
rerecord count, source flags, and input-schema reference, and in
metadata the text that the author of the recording entered when
recording, where the file has one (usually the author's name or a
comment).
Examples
path <- system.file("extdata", "expanded", "synthetic-arcade.fbm",
package = "replayr")
movie <- read_fbm(path, game = "ghouls")
press_counts(movie)
#> dpad_right dpad_left dpad_down dpad_up start b a
#> 120 12 0 0 2 28 12