Fixes for several minor issues in the last few commits:

- move files from src/windows to proper location
- formatting fixes to match style in other files

This fixes all compile issues in Linux; still TODO is fix Windows and OSX.
This commit is contained in:
Stephen Anthony 2017-10-01 16:23:53 -02:30
parent c19dc0dd9f
commit 924e92214f
22 changed files with 161 additions and 154 deletions

View File

@ -31,14 +31,14 @@ AtariVoxWidget::AtariVoxWidget(GuiObject* boss, const GUI::Font& font,
void AtariVoxWidget::eraseCurrent()
{
AtariVox& avox = static_cast<AtariVox&>(myController);
avox.myEEPROM->eraseCurrent();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool AtariVoxWidget::isPageUsed(int page)
bool AtariVoxWidget::isPageUsed(uInt32 page)
{
AtariVox& avox = static_cast<AtariVox&>(myController);
return avox.myEEPROM->isPageUsed(page);
}
}

View File

@ -28,9 +28,9 @@ class AtariVoxWidget : public FlashWidget
Controller& controller);
virtual ~AtariVoxWidget() = default;
private:
void eraseCurrent();
bool isPageUsed(int page);
private:
void eraseCurrent() override;
bool isPageUsed(uInt32 page) override;
// Following constructors and assignment operators not supported
AtariVoxWidget() = delete;

View File

@ -100,7 +100,7 @@ void DrivingWidget::handleCommand(
void DrivingWidget::setValue()
{
int grayCode = ourGrayTable[myGrayIndex];
// * 8 = a nasty hack, because the DataGridWidget does not support 2 digit binary output
// FIXME * 8 = a nasty hack, because the DataGridWidget does not support 2 digit binary output
myGrayValue->setList(0, (grayCode & 0b01) + (grayCode & 0b10) * 8);
}

View File

@ -22,18 +22,20 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FlashWidget::FlashWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, Controller& controller)
: ControllerWidget(boss, font, x, y, controller) {}
: ControllerWidget(boss, font, x, y, controller)
{
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FlashWidget::init(GuiObject* boss, const GUI::Font& font, int x, int y)
{
const GUI::Font& ifont = instance().frameBuffer().infoFont();
const int lineHeight = font.getLineHeight();
const int iLineHeight = ifont.getLineHeight();
int xpos = x, ypos = y;
bool leftport = myController.jack() == Controller::Left;
new StaticTextWidget(boss, font, xpos, ypos + 2, (leftport ? "Left (" : "Right (") + myController.name() + ")");
new StaticTextWidget(boss, font, xpos, ypos + 2,
(leftport ? "Left (" : "Right (") + myController.name() + ")");
ypos += lineHeight + 6;
@ -42,12 +44,12 @@ void FlashWidget::init(GuiObject* boss, const GUI::Font& font, int x, int y)
ypos += lineHeight + 2;
xpos += 8;
for(int page = 0; page < MAX_PAGES; page++)
for(uInt32 page = 0; page < MAX_PAGES; ++page)
{
myPage[page] = new StaticTextWidget(boss, ifont, xpos, ypos,
page ? " " : "none ");
myPage[page] = new StaticTextWidget(boss, ifont, xpos, ypos,
page ? " " : "none ");
ypos += lineHeight;
}
}
xpos -= 8; ypos += 2;
myEEPROMEraseCurrent = new ButtonWidget(boss, font, xpos, ypos,
@ -68,7 +70,7 @@ void FlashWidget::handleCommand(CommandSender*, int cmd, int, int)
void FlashWidget::loadConfig()
{
int useCount = 0, startPage = -1;
for(int page = 0; page < MT24LC256::PAGE_NUM; page++)
for(uInt32 page = 0; page < MT24LC256::PAGE_NUM; ++page)
{
if(isPageUsed(page))
{
@ -85,13 +87,13 @@ void FlashWidget::loadConfig()
label.str("");
label << Common::Base::HEX3 << startPage;
if(page - 1 != startPage)
if(int(page) - 1 != startPage)
label << "-" << Common::Base::HEX3 << page - 1;
else
label << " ";
label << ": " << Common::Base::HEX4 << from << "-" << Common::Base::HEX4 << to;
myPage[useCount]->setLabel(label.str());
startPage = -1;
@ -102,4 +104,4 @@ void FlashWidget::loadConfig()
}
myEEPROMEraseCurrent->setEnabled(useCount != 0);
}
}

View File

@ -0,0 +1,65 @@
//============================================================================
//
// SSSS tt lll lll
// SS SS tt ll ll
// SS tttttt eeee ll ll aaaa
// SSSS tt ee ee ll ll aa
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
// SS SS tt ee ll ll aa aa
// SSSS ttt eeeee llll llll aaaaa
//
// Copyright (c) 1995-2017 by Bradford W. Mott, Stephen Anthony
// and the Stella Team
//
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//============================================================================
#ifndef FLASH_WIDGET_HXX
#define FLASH_WIDGET_HXX
class ButtonWidget;
#include "Control.hxx"
#include "ControllerWidget.hxx"
class FlashWidget : public ControllerWidget
{
public:
FlashWidget(GuiObject* boss, const GUI::Font& font, int x, int y,
Controller& controller);
virtual ~FlashWidget() = default;
protected:
void init(GuiObject* boss, const GUI::Font& font, int x, int y);
private:
ButtonWidget* myEEPROMEraseCurrent;
enum { kEEPROMEraseCurrent = 'eeEC' };
static constexpr uInt32 MAX_PAGES = 5;
StaticTextWidget* myPage[MAX_PAGES];
private:
void loadConfig() override;
void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
/**
Erase the EEPROM pages used by the current ROM
*/
virtual void eraseCurrent() = 0;
/**
Check if a page is used by the current ROM
*/
virtual bool isPageUsed(uInt32 page) = 0;
// Following constructors and assignment operators not supported
FlashWidget() = delete;
FlashWidget(const FlashWidget&) = delete;
FlashWidget(FlashWidget&&) = delete;
FlashWidget& operator=(const FlashWidget&) = delete;
FlashWidget& operator=(FlashWidget&&) = delete;
};
#endif

View File

@ -36,9 +36,9 @@ void SaveKeyWidget::eraseCurrent()
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool SaveKeyWidget::isPageUsed(int page)
bool SaveKeyWidget::isPageUsed(uInt32 page)
{
SaveKey& skey = static_cast<SaveKey&>(myController);
return skey.myEEPROM->isPageUsed(page);
}
}

View File

@ -29,8 +29,8 @@ class SaveKeyWidget : public FlashWidget
virtual ~SaveKeyWidget() = default;
private:
void eraseCurrent();
bool isPageUsed(int page);
void eraseCurrent() override;
bool isPageUsed(uInt32 page) override;
// Following constructors and assignment operators not supported
SaveKeyWidget() = delete;

View File

@ -1,82 +1,82 @@
MODULE := src/debugger/gui
MODULE_OBJS := \
src/debugger/gui/AmigaMouseWidget.o \
src/debugger/gui/AtariMouseWidget.o \
src/debugger/gui/AtariVoxWidget.o \
src/debugger/gui/AudioWidget.o \
src/debugger/gui/CpuWidget.o \
src/debugger/gui/PromptWidget.o \
src/debugger/gui/RamWidget.o \
src/debugger/gui/RiotWidget.o \
src/debugger/gui/RiotRamWidget.o \
src/debugger/gui/RomWidget.o \
src/debugger/gui/RomListWidget.o \
src/debugger/gui/RomListSettings.o \
src/debugger/gui/TiaWidget.o \
src/debugger/gui/TiaInfoWidget.o \
src/debugger/gui/TiaOutputWidget.o \
src/debugger/gui/TiaZoomWidget.o \
src/debugger/gui/DataGridOpsWidget.o \
src/debugger/gui/DataGridWidget.o \
src/debugger/gui/DebuggerDialog.o \
src/debugger/gui/ToggleBitWidget.o \
src/debugger/gui/TogglePixelWidget.o \
src/debugger/gui/ToggleWidget.o \
src/debugger/gui/CartRamWidget.o \
src/debugger/gui/BoosterWidget.o \
src/debugger/gui/Cart0840Widget.o \
src/debugger/gui/Cart2KWidget.o \
src/debugger/gui/Cart3EWidget.o \
src/debugger/gui/Cart3EPlusWidget.o \
src/debugger/gui/Cart3EWidget.o \
src/debugger/gui/Cart3FWidget.o \
src/debugger/gui/Cart4A50Widget.o \
src/debugger/gui/Cart4KWidget.o \
src/debugger/gui/Cart4KSCWidget.o \
src/debugger/gui/Cart4KWidget.o \
src/debugger/gui/CartARWidget.o \
src/debugger/gui/CartBFSCWidget.o \
src/debugger/gui/CartBFWidget.o \
src/debugger/gui/CartBUSWidget.o \
src/debugger/gui/CartCDFWidget.o \
src/debugger/gui/CartCMWidget.o \
src/debugger/gui/CartCTYWidget.o \
src/debugger/gui/CartCVWidget.o \
src/debugger/gui/CartCVPlusWidget.o \
src/debugger/gui/CartCVWidget.o \
src/debugger/gui/CartDASHWidget.o \
src/debugger/gui/CartDPCWidget.o \
src/debugger/gui/CartDFSCWidget.o \
src/debugger/gui/CartDFWidget.o \
src/debugger/gui/CartDPCPlusWidget.o \
src/debugger/gui/CartDPCWidget.o \
src/debugger/gui/CartE0Widget.o \
src/debugger/gui/CartE7Widget.o \
src/debugger/gui/CartEFWidget.o \
src/debugger/gui/CartEFSCWidget.o \
src/debugger/gui/CartBFWidget.o \
src/debugger/gui/CartBFSCWidget.o \
src/debugger/gui/CartDFWidget.o \
src/debugger/gui/CartDFSCWidget.o \
src/debugger/gui/CartEFWidget.o \
src/debugger/gui/CartF0Widget.o \
src/debugger/gui/CartF4Widget.o \
src/debugger/gui/CartF6Widget.o \
src/debugger/gui/CartF8Widget.o \
src/debugger/gui/CartF4SCWidget.o \
src/debugger/gui/CartF4Widget.o \
src/debugger/gui/CartF6SCWidget.o \
src/debugger/gui/CartF6Widget.o \
src/debugger/gui/CartF8SCWidget.o \
src/debugger/gui/CartFAWidget.o \
src/debugger/gui/CartF8Widget.o \
src/debugger/gui/CartFA2Widget.o \
src/debugger/gui/CartFAWidget.o \
src/debugger/gui/CartFEWidget.o \
src/debugger/gui/CartMDMWidget.o \
src/debugger/gui/CartRamWidget.o \
src/debugger/gui/CartSBWidget.o \
src/debugger/gui/CartUAWidget.o \
src/debugger/gui/CartWDWidget.o \
src/debugger/gui/CartX07Widget.o \
src/debugger/gui/JoystickWidget.o \
src/debugger/gui/PaddleWidget.o \
src/debugger/gui/BoosterWidget.o \
src/debugger/gui/CpuWidget.o \
src/debugger/gui/DataGridOpsWidget.o \
src/debugger/gui/DataGridWidget.o \
src/debugger/gui/DebuggerDialog.o \
src/debugger/gui/DelayQueueWidget.o \
src/debugger/gui/DrivingWidget.o \
src/debugger/gui/KeyboardWidget.o \
src/debugger/gui/GenesisWidget.o \
src/debugger/gui/FlashWidget.o \
src/debugger/gui/AtariVoxWidget.o \
src/debugger/gui/SaveKeyWidget.o \
src/debugger/gui/DelayQueueWidget.o
src/debugger/gui/GenesisWidget.o \
src/debugger/gui/JoystickWidget.o \
src/debugger/gui/KeyboardWidget.o \
src/debugger/gui/PaddleWidget.o \
src/debugger/gui/PointingDeviceWidget.o \
src/debugger/gui/AmigaMouseWidget.o \
src/debugger/gui/AtariMouseWidget.o \
src/debugger/gui/TrakBallWidget.o \
src/debugger/gui/PromptWidget.o \
src/debugger/gui/RamWidget.o \
src/debugger/gui/RiotRamWidget.o \
src/debugger/gui/RiotWidget.o \
src/debugger/gui/RomListSettings.o \
src/debugger/gui/RomListWidget.o \
src/debugger/gui/RomWidget.o \
src/debugger/gui/SaveKeyWidget.o \
src/debugger/gui/TiaInfoWidget.o \
src/debugger/gui/TiaOutputWidget.o \
src/debugger/gui/TiaWidget.o \
src/debugger/gui/TiaZoomWidget.o \
src/debugger/gui/ToggleBitWidget.o \
src/debugger/gui/TogglePixelWidget.o \
src/debugger/gui/ToggleWidget.o \
src/debugger/gui/TrakBallWidget.o
MODULE_DIRS += \
src/debugger/gui

View File

@ -683,7 +683,7 @@ void Console::setTIAProperties()
void Console::setControllers(const string& rommd5)
{
// Setup the controllers based on properties
const string& left = myProperties.get(Controller_Left);
const string& left = myProperties.get(Controller_Left);
const string& right = myProperties.get(Controller_Right);
// Check for CompuMate controllers; they are special in that a handler
@ -699,24 +699,24 @@ void Console::setControllers(const string& rommd5)
cartcm->setCompuMate(myCMHandler);
myCart = std::move(cartcm);
myLeftControl = std::move(myCMHandler->leftController());
myLeftControl = std::move(myCMHandler->leftController());
myRightControl = std::move(myCMHandler->rightController());
return;
}
unique_ptr<Controller> leftC = std::move(myLeftControl),
rightC = std::move(myRightControl);
leftC = getControllerPort(rommd5, left, Controller::Left);
rightC = getControllerPort(rommd5, right, Controller::Right);
// Swap the ports if necessary
if(myProperties.get(Console_SwapPorts) == "NO")
if(myProperties.get(Console_SwapPorts) == "NO")
{
myLeftControl = std::move(leftC);
myRightControl = std::move(rightC);
}
else
else
{
myLeftControl = std::move(rightC);
myRightControl = std::move(leftC);
@ -726,7 +726,8 @@ void Console::setControllers(const string& rommd5)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
unique_ptr<Controller> Console::getControllerPort(const string& rommd5, string controllerName, Controller::Jack port)
unique_ptr<Controller> Console::getControllerPort(const string& rommd5,
const string& controllerName, Controller::Jack port)
{
unique_ptr<Controller> controller = std::move(myLeftControl);
@ -779,8 +780,8 @@ unique_ptr<Controller> Console::getControllerPort(const string& rommd5, string c
{
const string& nvramfile = myOSystem.nvramDir() + "atarivox_eeprom.dat";
controller = make_unique<AtariVox>(port, myEvent,
*mySystem, myOSystem.serialPort(),
myOSystem.settings().getString("avoxport"), nvramfile);
*mySystem, myOSystem.serialPort(),
myOSystem.settings().getString("avoxport"), nvramfile);
}
else if(controllerName == "SAVEKEY")
{

View File

@ -318,7 +318,8 @@ class Console : public Serializable
/**
Selects the left or right controller depending on ROM properties
*/
unique_ptr<Controller> getControllerPort(const string& rommd5, string controllerName, Controller::Jack port);
unique_ptr<Controller> getControllerPort(const string& rommd5,
const string& controllerName, Controller::Jack port);
/**
Loads a user-defined palette file (from OSystem::paletteFile), filling the

View File

@ -54,7 +54,7 @@ MT24LC256::MT24LC256(const string& filename, const System& system)
myCyclesWhenSCLSet(0),
myDataFile(filename),
myDataFileExists(false),
myDataChanged(false),
myDataChanged(false),
jpee_mdat(0),
jpee_sdat(0),
jpee_mclk(0),
@ -149,7 +149,7 @@ void MT24LC256::systemReset()
{
myCyclesWhenSDASet = myCyclesWhenSCLSet = myCyclesWhenTimerSet =
mySystem.cycles();
memset(myPageHit, false, sizeof(myPageHit));
}
@ -163,9 +163,9 @@ void MT24LC256::eraseAll()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void MT24LC256::eraseCurrent()
{
for(uInt32 page = 0; page < PAGE_NUM; page++)
for(uInt32 page = 0; page < PAGE_NUM; page++)
{
if(myPageHit[page])
if(myPageHit[page])
{
memset(myData + page * PAGE_SIZE, INIT_VALUE, PAGE_SIZE);
myDataChanged = true;
@ -174,7 +174,7 @@ void MT24LC256::eraseCurrent()
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool MT24LC256::isPageUsed(int page) const
bool MT24LC256::isPageUsed(uInt32 page) const
{
if(page < PAGE_NUM)
return myPageHit[page];
@ -193,7 +193,7 @@ void MT24LC256::jpee_init()
jpee_smallmode = 0;
jpee_logmode = -1;
if(!myDataFileExists)
memset(myData, INIT_VALUE, FLASH_SIZE);
memset(myData, INIT_VALUE, FLASH_SIZE);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -45,7 +45,7 @@ class MT24LC256
private:
// Sizes of the EEPROM
static constexpr uInt32 FLASH_SIZE = 32 * 1024;
public:
static constexpr uInt32 PAGE_SIZE = 64;
static constexpr uInt32 PAGE_NUM = FLASH_SIZE / PAGE_SIZE;
@ -67,7 +67,7 @@ class MT24LC256
void eraseCurrent();
/** Returns true if the page is used by the current ROM */
bool isPageUsed(int page) const;
bool isPageUsed(uInt32 page) const;
private:
// I2C access code provided by Supercat
@ -82,7 +82,7 @@ class MT24LC256
private:
// Inital state value of flash EEPROM
static constexpr uInt8 INIT_VALUE = 0xff;
static constexpr uInt8 INIT_VALUE = 0xff;
// The system of the parent controller
const System& mySystem;

View File

@ -311,7 +311,8 @@ StaticTextWidget::StaticTextWidget(GuiObject* boss, const GUI::Font& font,
int x, int y,
const string& text, TextAlignment align)
: StaticTextWidget(boss, font, x, y, font.getStringWidth(text), font.getLineHeight(), text, align)
{}
{
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void StaticTextWidget::setValue(int value)
@ -358,17 +359,19 @@ ButtonWidget::ButtonWidget(GuiObject* boss, const GUI::Font& font,
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ButtonWidget::ButtonWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int dw,
int x, int y, int dw,
const string& label, int cmd)
: ButtonWidget(boss, font, x, y, font.getStringWidth(label) + dw, font.getLineHeight() + 4, label, cmd)
{}
{
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ButtonWidget::ButtonWidget(GuiObject* boss, const GUI::Font& font,
int x, int y,
const string& label, int cmd)
: ButtonWidget(boss, font, x, y, 20, label, cmd)
{}
{
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void ButtonWidget::handleMouseEntered(int button)

View File

@ -1,65 +0,0 @@
//============================================================================
//
// SSSS tt lll lll
// SS SS tt ll ll
// SS tttttt eeee ll ll aaaa
// SSSS tt ee ee ll ll aa
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
// SS SS tt ee ll ll aa aa
// SSSS ttt eeeee llll llll aaaaa
//
// Copyright (c) 1995-2017 by Bradford W. Mott, Stephen Anthony
// and the Stella Team
//
// See the file "License.txt" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//============================================================================
#ifndef FLASH_WIDGET_HXX
#define FLASH_WIDGET_HXX
class ButtonWidget;
#include "Control.hxx"
#include "ControllerWidget.hxx"
class FlashWidget : public ControllerWidget
{
public:
FlashWidget(GuiObject* boss, const GUI::Font& font, int x, int y,
Controller& controller);
virtual ~FlashWidget() = default;
protected:
void init(GuiObject* boss, const GUI::Font& font, int x, int y);
private:
ButtonWidget* myEEPROMEraseCurrent;
enum { kEEPROMEraseCurrent = 'eeEC' };
static constexpr uInt32 MAX_PAGES = 5;
StaticTextWidget* myPage[MAX_PAGES];
private:
void loadConfig() override;
void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
/**
Erase the EEPROM pages used by the current ROM
*/
virtual void eraseCurrent() = 0;
/**
Check if a page is used by the current ROM
*/
virtual bool isPageUsed(int page) = 0;
// Following constructors and assignment operators not supported
FlashWidget() = delete;
FlashWidget(const FlashWidget&) = delete;
FlashWidget(FlashWidget&&) = delete;
FlashWidget& operator=(const FlashWidget&) = delete;
FlashWidget& operator=(FlashWidget&&) = delete;
};
#endif