]> Joshua Wise's Git repositories - fpgaboy.git/blobdiff - binwire.c
Add nintendo logo to diag. Add xmodem loader. Add auxboot and binwire utilities.
[fpgaboy.git] / binwire.c
diff --git a/binwire.c b/binwire.c
new file mode 100644 (file)
index 0000000..9322ef1
--- /dev/null
+++ b/binwire.c
@@ -0,0 +1,28 @@
+#include <stdio.h>
+
+void dowrite(char *s, int len)
+{
+  int i;
+  for (i=0; i<len; i++)
+  {
+    write(1, s+i, 1);
+  }
+}
+
+void main()
+{
+  char buf[259];
+  int sz;
+  dowrite("\x1B" "A\x00\x00\x00...", 8);
+  fprintf(stderr, "Address sent\n");
+  while ((sz = read(0, buf+3, 128)) > 0)
+  {
+    buf[0] = 0x1B;
+    buf[1] = 'D';
+    buf[2] = sz - 1;
+    dowrite(buf, sz + 3);
+    dowrite(".", 1);
+    fprintf(stderr, "Data sent\n");
+    usleep(100000);
+  }
+}
\ No newline at end of file
This page took 0.021971 seconds and 4 git commands to generate.