Cleaning up repository.
This commit is contained in:
parent
7d3bd4d066
commit
c91620c2cb
2 changed files with 0 additions and 4140 deletions
|
@ -1,42 +0,0 @@
|
|||
/*
|
||||
* 65b2js.c
|
||||
*
|
||||
* Created on: May 19, 2011
|
||||
* Author: Scott Duensing
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
if (argc != 2) {
|
||||
printf("usage: %s filename\n", argv[0]);
|
||||
return 1;
|
||||
} else {
|
||||
FILE *file = fopen(argv[1], "r");
|
||||
if (file == 0) {
|
||||
printf("Could not open file\n");
|
||||
return 2;
|
||||
} else {
|
||||
int c;
|
||||
int count = 0;
|
||||
int first = 1;
|
||||
printf("var PROGRAM = [\n");
|
||||
while ((c = fgetc(file)) != EOF) {
|
||||
if (first == 1)
|
||||
first = 0;
|
||||
else
|
||||
printf(", ");
|
||||
if (++count > 15) {
|
||||
printf("\n");
|
||||
count = 0;
|
||||
}
|
||||
printf("0x%02x", c);
|
||||
}
|
||||
if (count != 0)
|
||||
printf("\n");
|
||||
printf("];\n");
|
||||
fclose(file);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue