Skip to contents

Multi-controller M64 and DTM files store ordered samples without per-sample port IDs. The S3 class replayr_poll_stream retains the decoded controls and original bytes. polls() returns one row per poll, with port = NA_integer_, digital controls, source numeric channels, selected stick fields, and command bits. DTM and CTM streams also expose format-specific poll flags. button_layout() maps digital keys to stable IDs. analog_channels() and stick_channels() select the single stored stream with idx = 1.

Details

n_observations() counts polls; n_players() returns NA_integer_. player() requires an assigned controller and therefore directs callers to polls(). If emulator evidence establishes a repeating polling order, supply controller_order to read_m64() or read_dtm() to construct a replayr_movie. The format-specific help explains how player indices map to physical controller ports.

CTM stores separate pad, touch, and auxiliary-device events. Its observation flags identify which controls were sampled; observed_inputs provides the per-control mask. Mixed DTM adds device family and physical port when known. Wii reports marked valid_report = FALSE preserve missing source payloads.

See also

read_m64, read_dtm

Examples

# Two GameCube controllers are enabled, and the file does not say which
# poll belongs to which.
stream <- read_movie(system.file("extdata", "paper", "unassigned.dtm", package = "replayr"))
class(stream)
#> [1] "replayr_poll_stream"
stream
#> <replayr_poll_stream [dtm] polls=3 buttons=12 enabled_ports=1,2 assignment=unassigned>
n_players(stream)
#> [1] NA
button_layout(stream)$key
#>  [1] "dpad_right" "dpad_left"  "dpad_down"  "dpad_up"    "start"     
#>  [6] "b"          "a"          "x"          "y"          "l1"        
#> [11] "r1"         "z"         
polls(stream)[, c("poll", "port", "a", "left_x", "left_y")]
#>   poll port     a left_x left_y
#> 1    1   NA  TRUE    128    128
#> 2    2   NA FALSE    200    160
#> 3    3   NA FALSE    128    128