diff --git a/Makefile b/Makefile index 5893269..97f7f12 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,10 @@ TARGET = x49gpng TARGET_ALLCAPS = X49GPNG +VERSION_MAJOR = 1 +VERSION_MINOR = 0 +PATCHLEVEL = 0 + CC = gcc LD = $(CC) AR = ar @@ -98,6 +102,9 @@ X49GP_CFLAGS = -O2 \ $(DEBUG) \ $(INCLUDES) \ $(DEFINES) \ + -DVERSION_MAJOR=$(VERSION_MAJOR) \ + -DVERSION_MINOR=$(VERSION_MINOR) \ + -DPATCHLEVEL=$(PATCHLEVEL) \ -Wno-error=deprecated-declarations X49GP_LDFLAGS += $(DEBUG) $(GDB_LDFLAGS) X49GP_LDLIBS = $(X49GP_LIBS) $(GDB_LIBS) $(COCOA_LIBS) diff --git a/src/main.c b/src/main.c index c13ccdb..7efd045 100644 --- a/src/main.c +++ b/src/main.c @@ -26,6 +26,16 @@ #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; /* 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 ); fprintf( stderr, - "Emulator for HP 49G+ / 50G calculators\n" + "%s %i.%i.%i Emulator for HP 49G+ / 50G calculators\n" "Usage: %s [] []\n" "Valid options:\n" " -D, --enable-debug[=arm)); - printf("D TLB: hit0 %lu, hit1 %lu, search %lu (%lu), walk %lu\n", - x49gp->mmu->dTLB.hit0, x49gp->mmu->dTLB.hit1, - x49gp->mmu->dTLB.search, x49gp->mmu->dTLB.nsearch, - x49gp->mmu->dTLB.walk); - printf("I TLB: hit0 %lu, hit1 %lu, search %lu (%lu), walk %lu\n", - x49gp->mmu->iTLB.hit0, x49gp->mmu->iTLB.hit1, - x49gp->mmu->iTLB.search, x49gp->mmu->iTLB.nsearch, - x49gp->mmu->iTLB.walk); + printf("ClkTicks: %lu\n", ARMul_Time(x49gp->arm)); + printf("D TLB: hit0 %lu, hit1 %lu, search %lu (%lu), walk %lu\n", + x49gp->mmu->dTLB.hit0, x49gp->mmu->dTLB.hit1, + x49gp->mmu->dTLB.search, x49gp->mmu->dTLB.nsearch, + x49gp->mmu->dTLB.walk); + printf("I TLB: hit0 %lu, hit1 %lu, search %lu (%lu), walk %lu\n", + x49gp->mmu->iTLB.hit0, x49gp->mmu->iTLB.hit1, + x49gp->mmu->iTLB.search, x49gp->mmu->iTLB.nsearch, + x49gp->mmu->iTLB.walk); #endif return 0; }