[makerom/ctrtool] Updated usage text. (now with build datestamp)

This commit is contained in:
jakcron
2015-10-22 01:35:53 +08:00
parent dd9538b096
commit d7d45411ba
3 changed files with 382 additions and 357 deletions
+3 -2
View File
@@ -38,9 +38,10 @@ typedef struct
static void usage(const char *argv0) static void usage(const char *argv0)
{ {
fprintf(stderr, fprintf(stderr,
"Usage: %s [options...] <file>\n"
"CTRTOOL (c) neimod, 3DSGuy.\n" "CTRTOOL (c) neimod, 3DSGuy.\n"
"Built: %s %s\n"
"\n" "\n"
"Usage: %s [options...] <file>\n"
"Options:\n" "Options:\n"
" -i, --info Show file info.\n" " -i, --info Show file info.\n"
" This is the default action.\n" " This is the default action.\n"
@@ -86,7 +87,7 @@ static void usage(const char *argv0)
" --romfsdir=dir Specify RomFS directory path.\n" " --romfsdir=dir Specify RomFS directory path.\n"
" --listromfs List files in RomFS.\n" " --listromfs List files in RomFS.\n"
"\n", "\n",
argv0); __TIME__, __DATE__, argv0);
exit(1); exit(1);
} }
+3 -4
View File
@@ -5,13 +5,12 @@ OBJS = $(foreach dir,$(SRC_DIR),$(subst .c,.o,$(wildcard $(dir)/*.c)))
# Compiler Settings # Compiler Settings
LIBS = -static-libgcc LIBS = -static-libgcc
CXXFLAGS = -I. CXXFLAGS = -I.
CFLAGS = --std=c99 -Wall -O2 -flto -static -Wno-unused-but-set-variable -Wno-unused-value -I. -DMAKEROM_VER_MAJOR=$(VER_MAJOR) -DMAKEROM_VER_MINOR=$(VER_MINOR) $(MAKEROM_BUILD_FLAGS) -m64 CFLAGS = --std=c99 -O2 -flto -Wall -Wno-unused-but-set-variable -Wno-unused-value -I. $(MAKEROM_BUILD_FLAGS)
CC = gcc CC = gcc
CXX = g++
# MAKEROM Build Settings # MAKEROM Build Settings
MAKEROM_BUILD_FLAGS = #-DDEBUG MAKEROM_BUILD_FLAGS = #-DDEBUG
VER_MAJOR = 0
VER_MINOR = 14
OUTPUT = makerom OUTPUT = makerom
main: build main: build
@@ -19,7 +18,7 @@ main: build
rebuild: clean build rebuild: clean build
build: $(OBJS) build: $(OBJS)
g++ -o $(OUTPUT) $(LIBS) $(OBJS) -m64 $(CXX) -o $(OUTPUT) $(LIBS) $(OBJS)
clean: clean:
rm -rf $(OUTPUT) $(OBJS) *.cci *.cia *.cxi *.cfa rm -rf $(OUTPUT) $(OBJS) *.cci *.cia *.cxi *.cfa
+40 -15
View File
@@ -2,6 +2,7 @@
// Private Prototypes // Private Prototypes
void DisplayHelp(char *app_name); void DisplayHelp(char *app_name);
void DisplayExtendedHelp(char *app_name);
void SetDefaults(user_settings *set); void SetDefaults(user_settings *set);
int SetArgument(int argc, int i, char *argv[], user_settings *set); int SetArgument(int argc, int i, char *argv[], user_settings *set);
int CheckArgumentCombination(user_settings *set); int CheckArgumentCombination(user_settings *set);
@@ -26,6 +27,10 @@ int ParseArgs(int argc, char *argv[], user_settings *set)
DisplayHelp(argv[0]); DisplayHelp(argv[0]);
return USR_HELP; return USR_HELP;
} }
else if (strcmp(argv[i], "-exthelp") == 0) {
DisplayExtendedHelp(argv[0]);
return USR_HELP;
}
} }
// Allocating Memory for Content Path Ptrs // Allocating Memory for Content Path Ptrs
@@ -640,17 +645,6 @@ int SetArgument(int argc, int i, char *argv[], user_settings *set)
} }
else if (set->dname.m_items == set->dname.u_items) { else if (set->dname.m_items == set->dname.u_items) {
set->dname.m_items *= 2; set->dname.m_items *= 2;
/*
dname_item *tmp = malloc(sizeof(dname_item)*set->dname.m_items);
if(!tmp){
fprintf(stderr,"[SETTING ERROR] Not enough memory\n");
return MEM_ERROR;
}
memset(tmp,0,sizeof(dname_item)*set->dname.m_items);
memcpy(tmp,set->dname.items,sizeof(dname_item)*set->dname.u_items);
free(set->dname.items);
set->dname.items = tmp;
*/
set->dname.items = realloc(set->dname.items, sizeof(dname_item)*set->dname.m_items); set->dname.items = realloc(set->dname.items, sizeof(dname_item)*set->dname.m_items);
if (!set->dname.items) { if (!set->dname.items) {
fprintf(stderr, "[SETTING ERROR] Not enough memory\n"); fprintf(stderr, "[SETTING ERROR] Not enough memory\n");
@@ -854,14 +848,46 @@ void PrintNoNeedParam(char *arg)
fprintf(stderr, "[SETTING ERROR] \"%s\" does not take a parameter\n", arg); fprintf(stderr, "[SETTING ERROR] \"%s\" does not take a parameter\n", arg);
} }
void DisplayBanner(void)
{
printf("CTR MAKEROM v0.14 (C) 3DSGuy 2014\n");
printf("Built: %s %s\n\n", __TIME__, __DATE__);
}
void DisplayHelp(char *app_name) void DisplayHelp(char *app_name)
{ {
printf("CTR MAKEROM %d.%d\n",MAKEROM_VER_MAJOR,MAKEROM_VER_MINOR); DisplayBanner();
printf("(C) 3DSGuy 2014\n");
printf("Usage: %s [options... ]\n", app_name); printf("Usage: %s [options... ]\n", app_name);
printf("Option Parameter Explanation\n"); printf("Option Parameter Explanation\n");
printf("GLOBAL OPTIONS:\n"); printf("GLOBAL OPTIONS:\n");
printf(" -help Display this text\n"); printf(" -help Display this text\n");
printf(" -exthelp Display extended usage help\n");
printf(" -rsf <file> ROM Spec File (*.rsf)\n");
printf(" -f <ncch|cci|cia> Output format, defaults to 'ncch'\n");
printf(" -o <file> Output file\n");
printf(" -v Verbose output\n");
printf(" -DNAME=VALUE Substitute values in RSF file\n");
printf("NCCH OPTIONS:\n");
printf(" -elf <file> ELF file\n");
printf(" -icon <file> Icon file\n");
printf(" -banner <file> Banner file\n");
printf(" -desc <apptype>:<fw> Specify Access Descriptor template\n");
printf("NCCH REBUILD OPTIONS:\n");
printf(" -code <file> Decompressed ExeFS \".code\"\n");
printf(" -exheader <file> Exheader template\n");
printf(" -romfs <file> RomFS binary\n");
printf("CIA/CCI OPTIONS:\n");
printf(" -content <file>:<index> Specify content files\n");
}
void DisplayExtendedHelp(char *app_name)
{
DisplayBanner();
printf("Usage: %s [options... ]\n", app_name);
printf("Option Parameter Explanation\n");
printf("GLOBAL OPTIONS:\n");
printf(" -help Display simple usage help\n");
printf(" -exthelp Display this text\n");
printf(" -rsf <file> ROM Spec File (*.rsf)\n"); printf(" -rsf <file> ROM Spec File (*.rsf)\n");
printf(" -f <ncch|cci|cia> Output format, defaults to 'ncch'\n"); printf(" -f <ncch|cci|cia> Output format, defaults to 'ncch'\n");
printf(" -o <file> Output file\n"); printf(" -o <file> Output file\n");
@@ -896,7 +922,7 @@ void DisplayHelp(char *app_name)
printf(" -cverinfo <file>:<cia|tmd> Include cver title info\n"); printf(" -cverinfo <file>:<cia|tmd> Include cver title info\n");
printf("CIA OPTIONS:\n"); printf("CIA OPTIONS:\n");
printf(" -content <file>:<index>:<id> Specify content files\n"); printf(" -content <file>:<index>:<id> Specify content files\n");
printf(" -major <version> Major version\n"); printf(" -ver <version> Title Version\n");
printf(" -minor <version> Minor version\n"); printf(" -minor <version> Minor version\n");
printf(" -micro <version> Micro version\n"); printf(" -micro <version> Micro version\n");
printf(" -dver <version> Data-title version\n"); printf(" -dver <version> Data-title version\n");
@@ -909,5 +935,4 @@ void DisplayHelp(char *app_name)
printf(" -ccitocia <cci file> Convert CCI to CIA\n"); printf(" -ccitocia <cci file> Convert CCI to CIA\n");
printf(" -ciatocci <cia file> Convert CIA to CCI\n"); printf(" -ciatocci <cia file> Convert CIA to CCI\n");
printf(" -inclupd Include \"Update NCCH\" in CCI to CIA conversion\n"); printf(" -inclupd Include \"Update NCCH\" in CCI to CIA conversion\n");
} }