teensytp: initial implementation (derived from teensytas)
[megadrive.git] / teensytp / pkts.h
index 582fa72..52ccfee 100644 (file)
@@ -1,38 +1,24 @@
 
 enum tas_pkt_type {
-       PKT_FIXED_STATE       = 0xef01,
-       PKT_STREAM_ENABLE     = 0xef02,
-       PKT_STREAM_REQ        = 0xef03,
-       PKT_STREAM_DATA_TO_P1 = 0xef04,
-       PKT_STREAM_DATA_TO_P2 = 0xef05,
-       PKT_STREAM_DATA_FROM  = 0xef06,
-       PKT_STREAM_END        = 0xef07,
-       PKT_STREAM_ABORT      = 0xef08,
+       PKT_UPD_MODE = 0xe301, // op_mode
+       PKT_UPD_BTNS = 0xe302,
 };
 
-struct tas_pkt {
+struct tp_pkt {
        uint16_t type;
-       uint16_t size; // for DATA_FROM/TO
+       uint16_t pad;
        union {
                uint8_t data[60];
+               uint32_t mode;
                struct {
-                       uint32_t frame; // just fyi
-                       uint8_t is_p2;
-               } req;
-               struct {
-                       uint8_t stream_to;
-                       uint8_t stream_from;
-                       // frame increment on read
-                       uint8_t inc_mode;
-                       uint8_t no_start_seq;
-               } enable;
+                       uint32_t changed_players;
+                       uint32_t bnts[4]; // MXYZ SACB RLDU
+               };
        };
 } __attribute__((packed));
 
-enum inc_mode {
-       INC_MODE_VSYNC = 0,
-       // shared stream index incremented by pl1 or pl2
-       INC_MODE_SHARED_PL1 = 1,
-       INC_MODE_SHARED_PL2 = 2,
-       INC_MODE_SEPARATE = 3,
+enum op_mode {
+       OP_MODE_3BTN = 0,
+       OP_MODE_6BTN = 1,
+       OP_MODE_TEAMPLAYER = 2,
 };