1 |
#include <stdio.h> |
2 |
#include <string.h> |
3 |
#include <stdlib.h> |
4 |
#include <ctype.h> |
5 |
#include <sys/types.h> |
6 |
#include <sys/stat.h> |
7 |
#include <time.h> |
8 |
|
9 |
int main(int argc, char *argv[]) { |
10 |
char str[256]; |
11 |
FILE *f; |
12 |
time_t t; |
13 |
int version; |
14 |
int build; |
15 |
|
16 |
printf("fps2bios romver generator\n"); |
17 |
if (argc < 3){ |
18 |
printf("usage: %s version build\n", argv[0]); |
19 |
return 1; |
20 |
} |
21 |
f = fopen("ROMVER", "wb"); |
22 |
if (f == NULL) { |
23 |
printf("failed to create ROMVER\n"); |
24 |
return 1; |
25 |
} |
26 |
|
27 |
t = time(NULL); |
28 |
strftime(str, 256, "%Y%m%d", localtime(&t)); |
29 |
version = strtol(argv[1], (char**)NULL, 0); |
30 |
build = strtol(argv[2], (char**)NULL, 0); |
31 |
fprintf(f, "%2.2d%2.2dPD%s\n", version, build, str); |
32 |
fputc(0, f); |
33 |
|
34 |
fclose(f); |
35 |
|
36 |
return 0; |
37 |
} |