2018-05-20 04:53:34 +00:00
|
|
|
// Pi1541 - A Commodore 1541 disk drive emulator
|
|
|
|
// Copyright(C) 2018 Stephen White
|
|
|
|
//
|
|
|
|
// This file is part of Pi1541.
|
|
|
|
//
|
|
|
|
// Pi1541 is free software : you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// Pi1541 is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with Pi1541. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
#ifndef OPTIONS_H
|
|
|
|
#define OPTIONS_H
|
|
|
|
|
|
|
|
class TextParser
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TextParser(void)
|
|
|
|
: data(0)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetData(char* buffer) { data = buffer; }
|
|
|
|
|
|
|
|
char* GetToken(bool includeSpace = false);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
char* data;
|
|
|
|
bool ParseComment();
|
|
|
|
void SkipWhiteSpace();
|
|
|
|
};
|
|
|
|
|
|
|
|
class Options : public TextParser
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Options(void);
|
|
|
|
|
|
|
|
void Process(char* buffer);
|
|
|
|
|
2018-06-03 07:54:36 +00:00
|
|
|
inline unsigned int GetDeviceID() const { return deviceID; }
|
|
|
|
inline unsigned int GetOnResetChangeToStartingFolder() const { return onResetChangeToStartingFolder; }
|
|
|
|
inline const char* GetRomFontName() const { return ROMFontName; }
|
2018-05-20 04:53:34 +00:00
|
|
|
const char* GetRomName(int index) const;
|
2018-06-03 07:54:36 +00:00
|
|
|
inline const char* GetStarFileName() const { return starFileName; }
|
|
|
|
inline unsigned int GetExtraRAM() const { return extraRAM; }
|
|
|
|
inline unsigned int GetRAMBOard() const { return RAMBOard; }
|
|
|
|
inline unsigned int GetDisableSD2IECCommands() const { return disableSD2IECCommands; }
|
|
|
|
inline unsigned int GetSupportUARTInput() const { return supportUARTInput; }
|
2018-05-20 04:53:34 +00:00
|
|
|
|
2018-06-03 07:54:36 +00:00
|
|
|
inline unsigned int GraphIEC() const { return graphIEC; }
|
|
|
|
inline unsigned int QuickBoot() const { return quickBoot; }
|
|
|
|
inline unsigned int DisplayPNGIcons() const { return displayPNGIcons; }
|
|
|
|
inline unsigned int SoundOnGPIO() const { return soundOnGPIO; }
|
2018-06-12 11:39:08 +00:00
|
|
|
inline unsigned int SoundOnGPIODuration() const { return soundOnGPIODuration; }
|
2018-06-12 01:17:52 +00:00
|
|
|
inline unsigned int SoundOnGPIOFreq() const { return soundOnGPIOFreq; }
|
2018-06-03 07:54:36 +00:00
|
|
|
inline unsigned int SplitIECLines() const { return splitIECLines; }
|
|
|
|
inline unsigned int InvertIECInputs() const { return invertIECInputs; }
|
|
|
|
inline unsigned int InvertIECOutputs() const { return invertIECOutputs; }
|
|
|
|
inline unsigned int IgnoreReset() const { return ignoreReset; }
|
2018-05-20 04:53:34 +00:00
|
|
|
|
2018-06-03 07:54:36 +00:00
|
|
|
inline unsigned int ScreenWidth() const { return screenWidth; }
|
|
|
|
inline unsigned int ScreenHeight() const { return screenHeight; }
|
2018-06-07 09:00:39 +00:00
|
|
|
|
2018-06-04 09:11:15 +00:00
|
|
|
inline unsigned int I2CBusMaster() const { return i2cBusMaster; }
|
2018-06-07 09:00:39 +00:00
|
|
|
inline unsigned int I2CLcdAddress() const { return i2cLcdAddress; }
|
2018-06-15 14:01:02 +00:00
|
|
|
inline unsigned int I2CLcdFlip() const { return i2cLcdFlip; }
|
2018-06-21 23:31:13 +00:00
|
|
|
inline unsigned int I2CLcdOnBright() const { return i2cLcdOnBright; }
|
|
|
|
inline unsigned int I2CLcdDimBright() const { return i2cLcdDimBright; }
|
|
|
|
inline unsigned int I2CLcdDimTime() const { return i2cLcdDimTime; }
|
2018-05-27 09:56:53 +00:00
|
|
|
|
2018-06-03 08:11:58 +00:00
|
|
|
// Page up and down will jump a different amount based on the maximum number rows displayed.
|
|
|
|
// Perhaps we should use some keyboard modifier to the the other screen?
|
|
|
|
inline unsigned int KeyboardBrowseLCDScreen() const { return keyboardBrowseLCDScreen; }
|
|
|
|
|
|
|
|
const char* GetLCDName() const { return LCDName; }
|
|
|
|
|
2018-05-20 04:53:34 +00:00
|
|
|
static unsigned GetDecimal(char* pString);
|
2018-06-12 09:03:29 +00:00
|
|
|
static float GetFloat(char* pString);
|
2018-05-20 04:53:34 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
unsigned int deviceID;
|
|
|
|
unsigned int onResetChangeToStartingFolder;
|
|
|
|
unsigned int extraRAM;
|
2018-06-03 07:54:36 +00:00
|
|
|
unsigned int RAMBOard;
|
2018-05-20 04:53:34 +00:00
|
|
|
unsigned int disableSD2IECCommands;
|
|
|
|
unsigned int supportUARTInput;
|
|
|
|
unsigned int graphIEC;
|
|
|
|
unsigned int quickBoot;
|
|
|
|
unsigned int displayPNGIcons;
|
|
|
|
unsigned int soundOnGPIO;
|
2018-06-12 11:39:08 +00:00
|
|
|
unsigned int soundOnGPIODuration;
|
2018-06-12 01:17:52 +00:00
|
|
|
unsigned int soundOnGPIOFreq;
|
2018-05-20 04:53:34 +00:00
|
|
|
unsigned int invertIECInputs;
|
2018-05-26 22:55:17 +00:00
|
|
|
unsigned int invertIECOutputs;
|
2018-05-20 04:53:34 +00:00
|
|
|
unsigned int splitIECLines;
|
2018-05-26 22:55:17 +00:00
|
|
|
unsigned int ignoreReset;
|
2018-05-20 04:53:34 +00:00
|
|
|
|
2018-05-27 09:56:53 +00:00
|
|
|
unsigned int screenWidth;
|
|
|
|
unsigned int screenHeight;
|
|
|
|
|
2018-06-04 09:11:15 +00:00
|
|
|
unsigned int i2cBusMaster;
|
2018-06-07 09:00:39 +00:00
|
|
|
unsigned int i2cLcdAddress;
|
2018-06-15 14:01:02 +00:00
|
|
|
unsigned int i2cLcdFlip;
|
2018-06-21 23:31:13 +00:00
|
|
|
unsigned int i2cLcdOnBright;
|
|
|
|
unsigned int i2cLcdDimBright;
|
|
|
|
unsigned int i2cLcdDimTime;
|
2018-06-04 09:11:15 +00:00
|
|
|
|
2018-06-03 08:11:58 +00:00
|
|
|
unsigned int keyboardBrowseLCDScreen;
|
|
|
|
|
2018-05-30 10:38:14 +00:00
|
|
|
char starFileName[256];
|
2018-06-03 08:11:58 +00:00
|
|
|
char LCDName[256];
|
2018-05-30 10:38:14 +00:00
|
|
|
|
2018-05-21 09:12:59 +00:00
|
|
|
char ROMFontName[256];
|
2018-05-20 04:53:34 +00:00
|
|
|
char ROMName[256];
|
|
|
|
char ROMNameSlot2[256];
|
|
|
|
char ROMNameSlot3[256];
|
|
|
|
char ROMNameSlot4[256];
|
|
|
|
char ROMNameSlot5[256];
|
|
|
|
char ROMNameSlot6[256];
|
|
|
|
char ROMNameSlot7[256];
|
|
|
|
char ROMNameSlot8[256];
|
|
|
|
};
|
|
|
|
#endif
|