comparison rvinterf/lowlevel/rviftmode.c @ 938:74930218c270

rvinterf TM log: decode ETM_AUDIO commands
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 24 May 2023 04:30:39 +0000
parents 06f96627ac9a
children ec5f51d33fdc
comparison
equal deleted inserted replaced
937:06f96627ac9a 938:74930218c270
205 audio_cmd_classify(pkt, pktlen, outbuf) 205 audio_cmd_classify(pkt, pktlen, outbuf)
206 u_char *pkt; 206 u_char *pkt;
207 unsigned pktlen; 207 unsigned pktlen;
208 char *outbuf; 208 char *outbuf;
209 { 209 {
210 /* classification code to be filled */ 210 if (pktlen < 4) {
211 strcpy(outbuf, "ETM_AUDIO"); 211 strcpy(outbuf, "ETM_AUDIO runt");
212 return;
213 }
214 switch (pkt[2]) {
215 case 'L':
216 strcpy(outbuf, "aul");
217 return;
218 case 'S':
219 strcpy(outbuf, "aus");
220 return;
221 case 'R':
222 strcpy(outbuf, "aur");
223 return;
224 case 'W':
225 strcpy(outbuf, "auw");
226 return;
227 default:
228 sprintf(outbuf, "ETM_AUDIO opcode 0x%02X", pkt[2]);
229 }
212 } 230 }
213 231
214 static void 232 static void
215 tm_classify(pkt, pktlen, is_cmd, outbuf) 233 tm_classify(pkt, pktlen, is_cmd, outbuf)
216 u_char *pkt; 234 u_char *pkt;