extra conf search; default TV display

This commit is contained in:
Christopher A. Mosher 2019-04-13 00:34:25 -04:00
parent b54de32a5e
commit 5ecc59d37e
9 changed files with 349 additions and 331 deletions

2
.gitignore vendored
View File

@ -12,7 +12,7 @@ Makefile.in
/install-sh
/missing
/config.h.in*
/test-driver
# need these for non-VPATH builds

View File

@ -1,6 +1,6 @@
# epple2, The Emulated Apple ][
Copyright © 20082019, Christopher Alan Mosher, Shelton, Connecticut, USA, <cmosher01@gmail.com>. GPLv3.
Copyright © 20082019, Christopher Alan Mosher, Shelton, Connecticut, USA, <cmosher01@gmail.com>. [GPLv3](https://www.gnu.org/licenses/gpl.md).
[![Website](https://img.shields.io/website/https/cmosher01.github.io/Epple-II.svg)](https://cmosher01.github.io/Epple-II)
[![Latest Release](https://img.shields.io/github/release/cmosher01/Epple-II.svg)](https://github.com/cmosher01/Epple-II/releases/latest)

View File

@ -1,6 +1,6 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_INIT(epple2, v1.0.3)
AC_INIT(epple2, v1.0.4)
AC_PREREQ(2.68)
AC_CONFIG_SRCDIR([src/apple2.cpp])

View File

@ -34,9 +34,9 @@ class AnalogTV
public:
enum DisplayType
{
TV_OLD_COLOR,
MONITOR_COLOR,
MONITOR_GREEN,
TV_OLD_COLOR,
NUM_DISPLAY_TYPES
};

View File

@ -143,8 +143,7 @@ void Config::parse(MemoryRandomAccess& ram, Memory& rom, Slots& slts, int& revis
if (path.empty())
{
/*
Last effort to find it (most likely will
only work on Linux).
Try a likely linux location
*/
path = "/etc/epple2/epple2.conf";
pConfig = new std::ifstream(path.c_str());
@ -152,11 +151,33 @@ void Config::parse(MemoryRandomAccess& ram, Memory& rom, Slots& slts, int& revis
path.clear();
}
if (path.empty())
{
/*
Try another likely linux location
*/
path = "/etc/epple2.conf";
pConfig = new std::ifstream(path.c_str());
if (!pConfig->is_open())
path.clear();
}
if (path.empty())
{
/*
Last effort to find it.
*/
path = "epple2.conf";
pConfig = new std::ifstream(path.c_str());
if (!pConfig->is_open())
path.clear();
}
if (path.empty())
{
std::cerr << "Cannot open config file /etc/epple2/epple2.conf" << std::endl;
return;
}
std::cout << "Reading configuration from file: " << path << std::endl;
std::string line;
std::getline(*pConfig,line);
while (!pConfig->eof())

View File

@ -26,15 +26,13 @@ class ScreenImage;
class CassetteIn;
class CassetteOut;
class ConfigException
{
class ConfigException {
public:
const std::string msg;
ConfigException(const std::string& msg) : msg(msg) {}
};
class Config
{
class Config {
private:
const std::string& file_path;
static unsigned char disk_mask;

View File

@ -78,7 +78,6 @@ void Emulator::config(Config& cfg) {
void Emulator::init() {
powerOffComputer();
this->display.setType(AnalogTV::MONITOR_COLOR);
this->display.powerOn(true);
}

View File

@ -58,7 +58,7 @@ fullscreen(false),
hyper(false),
buffer(true),
fillLines(true),
display(AnalogTV::MONITOR_COLOR),
display(AnalogTV::TV_OLD_COLOR),
slotnames(8),
cassInName(32, ' '),
cassOutName(32, ' ') {
@ -155,9 +155,9 @@ void ScreenImage::drawCassette() {
}
static const char* displays[] = {
"TELEVISION ",
"COLOR MONITOR ",
"GREEN MONITOR ",
"TELEVISION ",
};
void ScreenImage::drawFnKeys() {