X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=host%2Fmain.c;h=c3a850bbeb7d433d03d1105300499152fa0bd6e3;hb=6d4349fc1c542c6a70712f508b4fdaa9eb5f14ee;hp=8f768449f0abc124ecdf80573d03b2d698fdd7ec;hpb=32f257c58ec30db4e2d56cfdbd4d8bd2da6dff3e;p=teensytas.git diff --git a/host/main.c b/host/main.c index 8f76844..c3a850b 100644 --- a/host/main.c +++ b/host/main.c @@ -1,3 +1,28 @@ +/* + * TeensyTAS, TAS input player for MegaDrive + * Copyright (c) 2014 notaz + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + #include #include #include @@ -648,6 +673,7 @@ int main(int argc, char *argv[]) const char *logfn = NULL; uint8_t *tas_data = NULL; int use_vsync = 0; // frame increment on vsync + int no_start_seq = 0; int tas_skip = 0; int enable_sent = 0; int abort_sent = 0; @@ -693,6 +719,9 @@ int main(int argc, char *argv[]) case 'v': use_vsync = 1; continue; + case 'n': + no_start_seq = 1; + continue; default: fprintf(stderr, "bad arg: %s\n", argv[i]); return 1; @@ -994,6 +1023,12 @@ int main(int argc, char *argv[]) /* debug text */ buf_dbg[reaped_urb->actual_length] = 0; printf("%s", buf_dbg); + + // continue receiving debug before sending out stuff + tout.tv_sec = 0; + tout.tv_usec = 1000; + timeout = &tout; + continue; } else { fprintf(stderr, "reaped unknown urb? %p #%zu\n", @@ -1012,6 +1047,7 @@ int main(int argc, char *argv[]) pkt_out.enable.stream_to = (tas_data != NULL); pkt_out.enable.stream_from = (outf != NULL); pkt_out.enable.use_readinc = !use_vsync; + pkt_out.enable.no_start_seq = no_start_seq; ret = submit_urb(dev.fd, &urb[URB_DATA_OUT], dev.ifaces[0].ep_out, &pkt_out, sizeof(pkt_out));