Skip to content

Commit

Permalink
Add version info: v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
amaiorano committed Jan 27, 2015
1 parent 7d85518 commit 1df9269
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/Base.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ static_assert(sizeof(int64)==8, "Invalid type size");
static_assert(sizeof(float32)==4, "Invalid type size");
static_assert(sizeof(float64)==8, "Invalid type size");

// Use to make a macro value into a string
#define STRINGIZE(v) __STRINGIZE(v)
#define __STRINGIZE(v) #v

#define KB(n) (n*1024)
#define MB(n) (n*1024*1024)

Expand Down
4 changes: 3 additions & 1 deletion src/Nes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ void Nes::ExecuteFrame()

// PPU just rendered a screen; FrameTimer will wait until we hit 60 FPS (if machine is too fast)
m_frameTimer.Update(minFrameTime);
Renderer::SetWindowTitle( FormattedString<>("nes-emu [FPS: %2.2f]", m_frameTimer.GetFps()).Value() );

extern const char* kVersionString;
Renderer::SetWindowTitle( FormattedString<>("nes-emu %s [FPS: %2.2f]", kVersionString, m_frameTimer.GetFps()).Value() );

// Auto-save sram at fixed intervals
const float64 saveInterval = 5.0;
Expand Down
13 changes: 11 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,26 @@
#include "System.h"
#include "Input.h"

#define kVersionMajor 1
#define kVersionMinor 0
#if CONFIG_DEBUG
#define kVersionConfig "d"
#else
#define kVersionConfig ""
#endif
const char* kVersionString = "v" STRINGIZE(kVersionMajor) "." STRINGIZE(kVersionMinor) kVersionConfig;

namespace
{
void PrintAppInfo()
{
const char* text =
"### nes-emu - Nintendo Entertainment System Emulator\n"
"### nes-emu %s - Nintendo Entertainment System Emulator\n"
"### Author: Antonio Maiorano (amaiorano at gmail dot com)\n"
"### Source code available at http://github.com/amaiorano/nes-emu/ \n"
"\n";

printf(text);
printf(text, kVersionString);
}

inline size_t BytesToKB(size_t bytes) { return bytes / 1024; }
Expand Down

0 comments on commit 1df9269

Please sign in to comment.