Add a build option in the Makefile for a Total Reply build. For a TR build, we have a special quit handler which jumps to a special vector. Also in a TR build, ".tr" is appended to the version number to make it clear it is a TR build. Bump the version number up to 2.1.

This commit is contained in:
Jeremy Rand 2020-01-24 21:46:51 -05:00
parent 34e320a605
commit e8783b019b
4 changed files with 21 additions and 1 deletions

View File

@ -71,6 +71,7 @@ SRCDIRS+=
# If you want to add arguments to the compile commandline, add them
# to this variable:
# CFLAGS += -DTOTAL_REPLAY_BUILD
CFLAGS += -Os
# If you want to add arguments to the assembly commandline, add them

View File

@ -9,14 +9,27 @@
#include <stdbool.h>
#include <stdlib.h>
#include "ui.h"
// Implementation
#ifdef TOTAL_REPLAY_BUILD
void totalReplayQuit(void)
{
__asm__ ("BIT $C082");
__asm__ ("JMP ($FFFC)");
}
#endif
int main(void)
{
#ifdef TOTAL_REPLAY_BUILD
atexit(totalReplayQuit);
#endif
initUI();
printInstructions();

View File

@ -26,7 +26,13 @@
// Defines
#define SAVE_OPTIONS_FILE "a2bejwld.opts"
#define VERSION "v2.1a1"
#define BASE_VERSION "v2.1"
#ifdef TOTAL_REPLAY_BUILD
#define VERSION BASE_VERSION ".tr"
#else
#define VERSION BASE_VERSION
#endif
// Typedefs