Skip to contents

Extract an unassigned controller-poll stream

Usage

polls(x)

Arguments

x

A replayr_poll_stream.

Value

Data frame in source order. poll is the position of the poll in the file. Digital and numeric columns are named by the keys of button_layout() and channel_layout(). For M64, commands uses bit 0 for reset. For DTM, bit 0 is disc change and bit 1 is reset. Standard DTM exposes is_connected and get_origin; Zelda Edition exposes loading, tuner_event, link_x, and link_z (see read_dtm()). The object's poll_bytes component contains four original bytes per M64 poll, eight per standard DTM poll, or seventeen per Zelda Edition poll, in source order. CTM stores seven bytes per device event. Wii stores padded report bytes with poll_lengths; mixed HID records include the length byte. source_tail retains incomplete final Wii records. Use observation flags before analysing device-specific fields.

Examples

stream <- read_movie(system.file("extdata", "paper", "unassigned.dtm", package = "replayr"))
stream
#> <replayr_poll_stream [dtm] polls=3 buttons=12 enabled_ports=1,2 assignment=unassigned>
polls(stream)[, c("poll", "port", "a", "left_x", "left_y", "is_connected")]
#>   poll port     a left_x left_y is_connected
#> 1    1   NA  TRUE    128    128         TRUE
#> 2    2   NA FALSE    200    160         TRUE
#> 3    3   NA FALSE    128    128         TRUE
# A selection keeps the positions of the polls in the file.
polls(stream[2:3])$poll
#> [1] 2 3