diff options
| author | Xavi Del Campo <xavi.dcr@tutanota.com> | 2020-01-31 10:32:23 +0100 |
|---|---|---|
| committer | Xavi Del Campo <xavi.dcr@tutanota.com> | 2020-01-31 10:32:23 +0100 |
| commit | 7c24e9a9b02b04dcaf9507acb94091ea70a2c02d (patch) | |
| tree | c28d0748652ad4b4222309e46e6cfc82c0906220 /tools/systemcnf.c | |
| parent | a2b7b6bb1cc2f4a3258b7b2dbc92399d151f864d (diff) | |
| download | psxsdk-7c24e9a9b02b04dcaf9507acb94091ea70a2c02d.tar.gz | |
Imported pristine psxsdk-20190410 from official repo
Diffstat (limited to 'tools/systemcnf.c')
| -rw-r--r-- | tools/systemcnf.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/tools/systemcnf.c b/tools/systemcnf.c new file mode 100644 index 0000000..301936d --- /dev/null +++ b/tools/systemcnf.c @@ -0,0 +1,50 @@ +/* + * systemcnf + * + * Small program that outputs a system.cnf file to standard output + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <ctype.h> + +int tcb = 4; +int event = 16; +unsigned int stack = 0x801FFFF0; + +int main(int argc, char *argv[]) +{ + int x; + + if(argc < 2) + { + printf("systemcnf\n"); + printf("usage: systemcnf exe_name [tcb] [event] [stack_addr]\n"); + printf("\n"); + printf("This programs outputs a system.cnf file to standard output\n"); + printf("Only the exe_name argument is necessary because if the others\n"); + printf("are missing, the default values are used.\n"); + printf("Specify stack_addr in hexadecimal, without prefixes.\n"); + return 0; + } + + if(argc >= 3) + tcb = atoi(argv[2]); + + if(argc >= 4) + event = atoi(argv[3]); + + if(argc >= 5) + sscanf(argv[4],"%x",&stack); + + for(x=0;x<strlen(argv[1]);x++) + argv[1][x] = toupper((int)argv[1][x]); + + printf("BOOT = cdrom:%s;1\n", argv[1]); + printf("TCB = %d\n", tcb); + printf("EVENT = %d\n", event); + printf("STACK = %X", stack); + + return 0; +} |
