| 31 | } |
| 32 | |
| 33 | void execute(vuart_av_thread &vuart, const void *pkt_buf) override { |
| 34 | const auto pkt = static_cast<const ps3av_pkt_av_init *>(pkt_buf); |
| 35 | |
| 36 | if (vuart.get_reply_buf_free_size() < sizeof(ps3av_pkt_reply_hdr)) { |
| 37 | vuart.write_resp(pkt->hdr.cid, PS3AV_STATUS_BUFFER_OVERFLOW); |
| 38 | return; |
| 39 | } |
| 40 | |
| 41 | vuart.av_cmd_ver = pkt->hdr.version; |
| 42 | vuart.hdmi_events_bitmask |= pkt->event_bit; |
| 43 | |
| 44 | if (pkt->event_bit & PS3AV_EVENT_BIT_UNK) { |
| 45 | // 0 or 255, probably ps2 backwards compatibility (inverted) |
| 46 | const ps3av_pkt_av_init_reply reply = {0}; |
| 47 | |
| 48 | vuart.write_resp(pkt->hdr.cid, PS3AV_STATUS_SUCCESS, &reply, |
| 49 | sizeof(ps3av_pkt_av_init_reply)); |
| 50 | return; |
| 51 | } |
| 52 | |
| 53 | vuart.write_resp(pkt->hdr.cid, PS3AV_STATUS_SUCCESS); |
| 54 | } |
| 55 | }; |
| 56 | |
| 57 | struct av_fini_cmd : public ps3av_cmd { |
no test coverage detected