1
0
Fork 0
forked from Miroirs/x49gp

add versionning, fix config path in --help

This commit is contained in:
Gwenhael Le Moine 2024-10-23 10:12:22 +02:00
parent 75cbab80ed
commit 0089156ad1
No known key found for this signature in database
GPG key ID: FDFE3669426707A7
2 changed files with 29 additions and 12 deletions

View file

@ -4,6 +4,10 @@
TARGET = x49gpng TARGET = x49gpng
TARGET_ALLCAPS = X49GPNG TARGET_ALLCAPS = X49GPNG
VERSION_MAJOR = 1
VERSION_MINOR = 0
PATCHLEVEL = 0
CC = gcc CC = gcc
LD = $(CC) LD = $(CC)
AR = ar AR = ar
@ -98,6 +102,9 @@ X49GP_CFLAGS = -O2 \
$(DEBUG) \ $(DEBUG) \
$(INCLUDES) \ $(INCLUDES) \
$(DEFINES) \ $(DEFINES) \
-DVERSION_MAJOR=$(VERSION_MAJOR) \
-DVERSION_MINOR=$(VERSION_MINOR) \
-DPATCHLEVEL=$(PATCHLEVEL) \
-Wno-error=deprecated-declarations -Wno-error=deprecated-declarations
X49GP_LDFLAGS += $(DEBUG) $(GDB_LDFLAGS) X49GP_LDFLAGS += $(DEBUG) $(GDB_LDFLAGS)
X49GP_LDLIBS = $(X49GP_LIBS) $(GDB_LIBS) $(COCOA_LIBS) X49GP_LDLIBS = $(X49GP_LIBS) $(GDB_LIBS) $(COCOA_LIBS)

View file

@ -26,6 +26,16 @@
#include "gdbstub.h" #include "gdbstub.h"
#ifndef VERSION_MAJOR
# define VERSION_MAJOR 0
#endif
#ifndef VERSION_MINOR
#define VERSION_MINOR 0
#endif
#ifndef PATCHLEVEL
#define PATCHLEVEL 0
#endif
static x49gp_t* x49gp; static x49gp_t* x49gp;
/* LD TEMPO HACK */ /* LD TEMPO HACK */
@ -278,7 +288,7 @@ static int action_help( struct options* opt, struct option_def* match, char* thi
warn_unneeded_param( match, this_opt ); warn_unneeded_param( match, this_opt );
fprintf( stderr, fprintf( stderr,
"Emulator for HP 49G+ / 50G calculators\n" "%s %i.%i.%i Emulator for HP 49G+ / 50G calculators\n"
"Usage: %s [<options>] [<config-file>]\n" "Usage: %s [<options>] [<config-file>]\n"
"Valid options:\n" "Valid options:\n"
" -D, --enable-debug[=<port] enable the debugger interface\n" " -D, --enable-debug[=<port] enable the debugger interface\n"
@ -304,10 +314,10 @@ static int action_help( struct options* opt, struct option_def* match, char* thi
" settings for which\n" " settings for which\n"
"persistence makes sense, like calculator model, CPU" "persistence makes sense, like calculator model, CPU"
" registers, etc.\n" " registers, etc.\n"
"If the config file is omitted, ~/.%s/config is used.\n" "If the config file is omitted, ~/.config/%s/config is used.\n"
"Please consult the manual for more details on config file" "Please consult the manual for more details on config file"
" settings.\n", " settings.\n",
progname, DEFAULT_GDBSTUB_PORT, progname ); progname, VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL, progname, DEFAULT_GDBSTUB_PORT, progname );
exit( 0 ); exit( 0 );
} }
@ -619,15 +629,15 @@ int main( int argc, char** argv )
x49gp_modules_exit( x49gp ); x49gp_modules_exit( x49gp );
#if 0 #if 0
printf("ClkTicks: %lu\n", ARMul_Time(x49gp->arm)); printf("ClkTicks: %lu\n", ARMul_Time(x49gp->arm));
printf("D TLB: hit0 %lu, hit1 %lu, search %lu (%lu), walk %lu\n", printf("D TLB: hit0 %lu, hit1 %lu, search %lu (%lu), walk %lu\n",
x49gp->mmu->dTLB.hit0, x49gp->mmu->dTLB.hit1, x49gp->mmu->dTLB.hit0, x49gp->mmu->dTLB.hit1,
x49gp->mmu->dTLB.search, x49gp->mmu->dTLB.nsearch, x49gp->mmu->dTLB.search, x49gp->mmu->dTLB.nsearch,
x49gp->mmu->dTLB.walk); x49gp->mmu->dTLB.walk);
printf("I TLB: hit0 %lu, hit1 %lu, search %lu (%lu), walk %lu\n", printf("I TLB: hit0 %lu, hit1 %lu, search %lu (%lu), walk %lu\n",
x49gp->mmu->iTLB.hit0, x49gp->mmu->iTLB.hit1, x49gp->mmu->iTLB.hit0, x49gp->mmu->iTLB.hit1,
x49gp->mmu->iTLB.search, x49gp->mmu->iTLB.nsearch, x49gp->mmu->iTLB.search, x49gp->mmu->iTLB.nsearch,
x49gp->mmu->iTLB.walk); x49gp->mmu->iTLB.walk);
#endif #endif
return 0; return 0;
} }