Add 'teensytp/' from commit 'be48e888050f18a31e788269c8f47358036a8e3b'
[megadrive.git] / teensytp / pkts.h
1
2 enum tas_pkt_type {
3         PKT_FIXED_STATE       = 0xef01,
4         PKT_STREAM_ENABLE     = 0xef02,
5         PKT_STREAM_REQ        = 0xef03,
6         PKT_STREAM_DATA_TO_P1 = 0xef04,
7         PKT_STREAM_DATA_TO_P2 = 0xef05,
8         PKT_STREAM_DATA_FROM  = 0xef06,
9         PKT_STREAM_END        = 0xef07,
10         PKT_STREAM_ABORT      = 0xef08,
11 };
12
13 struct tas_pkt {
14         uint16_t type;
15         uint16_t size; // for DATA_FROM/TO
16         union {
17                 uint8_t data[60];
18                 struct {
19                         uint32_t frame; // just fyi
20                         uint8_t is_p2;
21                 } req;
22                 struct {
23                         uint8_t stream_to;
24                         uint8_t stream_from;
25                         // frame increment on read
26                         uint8_t inc_mode;
27                         uint8_t no_start_seq;
28                 } enable;
29         };
30 } __attribute__((packed));
31
32 enum inc_mode {
33         INC_MODE_VSYNC = 0,
34         // shared stream index incremented by pl1 or pl2
35         INC_MODE_SHARED_PL1 = 1,
36         INC_MODE_SHARED_PL2 = 2,
37         INC_MODE_SEPARATE = 3,
38 };