File tree Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,10 @@ static_assert(sizeof(int64)==8, "Invalid type size");
4545static_assert (sizeof (float32)==4 , " Invalid type size" );
4646static_assert (sizeof (float64)==8 , " Invalid type size" );
4747
48+ // Use to make a macro value into a string
49+ #define STRINGIZE (v ) __STRINGIZE(v)
50+ #define __STRINGIZE (v ) #v
51+
4852#define KB (n ) (n*1024 )
4953#define MB (n ) (n*1024 *1024 )
5054
Original file line number Diff line number Diff line change @@ -52,7 +52,9 @@ void Nes::ExecuteFrame()
5252
5353 // PPU just rendered a screen; FrameTimer will wait until we hit 60 FPS (if machine is too fast)
5454 m_frameTimer.Update (minFrameTime);
55- Renderer::SetWindowTitle ( FormattedString<>(" nes-emu [FPS: %2.2f]" , m_frameTimer.GetFps ()).Value () );
55+
56+ extern const char * kVersionString ;
57+ Renderer::SetWindowTitle ( FormattedString<>(" nes-emu %s [FPS: %2.2f]" , kVersionString , m_frameTimer.GetFps ()).Value () );
5658
5759 // Auto-save sram at fixed intervals
5860 const float64 saveInterval = 5.0 ;
Original file line number Diff line number Diff line change 33#include " System.h"
44#include " Input.h"
55
6+ #define kVersionMajor 1
7+ #define kVersionMinor 0
8+ #if CONFIG_DEBUG
9+ #define kVersionConfig " d"
10+ #else
11+ #define kVersionConfig " "
12+ #endif
13+ const char * kVersionString = " v" STRINGIZE(kVersionMajor ) " ." STRINGIZE(kVersionMinor ) kVersionConfig ;
14+
615namespace
716{
817 void PrintAppInfo ()
918 {
1019 const char * text =
11- " ### nes-emu - Nintendo Entertainment System Emulator\n "
20+ " ### nes-emu %s - Nintendo Entertainment System Emulator\n "
1221 " ### Author: Antonio Maiorano (amaiorano at gmail dot com)\n "
1322 " ### Source code available at http://github.com/amaiorano/nes-emu/ \n "
1423 " \n " ;
1524
16- printf (text);
25+ printf (text, kVersionString );
1726 }
1827
1928 inline size_t BytesToKB (size_t bytes) { return bytes / 1024 ; }
You can’t perform that action at this time.
0 commit comments