From 7c24e9a9b02b04dcaf9507acb94091ea70a2c02d Mon Sep 17 00:00:00 2001 From: Xavi Del Campo Date: Fri, 31 Jan 2020 10:32:23 +0100 Subject: Imported pristine psxsdk-20190410 from official repo --- tools/systemcnf.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 tools/systemcnf.c (limited to 'tools/systemcnf.c') 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 +#include +#include +#include + +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