mirror of https://github.com/stella-emu/stella.git
I was a little too eager with the 'constexpr'; it currently doesn't work on
enum types. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@3300 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
dd96a80e7e
commit
abf4a4a44c
|
@ -363,3 +363,8 @@ uInt8 CartridgeDASHWidget::internalRamGetValue(int addr)
|
||||||
{
|
{
|
||||||
return myCart.myRAM[addr];
|
return myCart.myRAM[addr];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
const CartridgeDASHWidget::BankID CartridgeDASHWidget::bankEnum[4] = {
|
||||||
|
kBank0Changed, kBank1Changed, kBank2Changed, kBank3Changed
|
||||||
|
};
|
||||||
|
|
|
@ -57,10 +57,7 @@ class CartridgeDASHWidget : public CartDebugWidget
|
||||||
kBank2Changed = 'b2CH',
|
kBank2Changed = 'b2CH',
|
||||||
kBank3Changed = 'b3CH'
|
kBank3Changed = 'b3CH'
|
||||||
};
|
};
|
||||||
static constexpr BankID bankEnum[4] = {
|
static const BankID bankEnum[4];
|
||||||
kBank0Changed, kBank1Changed, kBank2Changed, kBank3Changed
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void saveOldState() override;
|
void saveOldState() override;
|
||||||
|
|
|
@ -92,7 +92,7 @@ inline void CartridgeDPC::clockRandomNumberGenerator()
|
||||||
{
|
{
|
||||||
// Table for computing the input bit of the random number generator's
|
// Table for computing the input bit of the random number generator's
|
||||||
// shift register (it's the NOT of the EOR of four bits)
|
// shift register (it's the NOT of the EOR of four bits)
|
||||||
static const uInt8 f[16] = {
|
static constexpr uInt8 f[16] = {
|
||||||
1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1
|
1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -204,7 +204,7 @@ uInt8 CartridgeDPC::peek(uInt16 address)
|
||||||
// No, it's a music read
|
// No, it's a music read
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
static const uInt8 musicAmplitudes[8] = {
|
static constexpr uInt8 musicAmplitudes[8] = {
|
||||||
0x00, 0x04, 0x05, 0x09, 0x06, 0x0a, 0x0b, 0x0f
|
0x00, 0x04, 0x05, 0x09, 0x06, 0x0a, 0x0b, 0x0f
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -124,7 +124,7 @@ void Driving::update()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gray codes for rotation
|
// Gray codes for rotation
|
||||||
static const uInt8 graytable[] = { 0x03, 0x01, 0x00, 0x02 };
|
static constexpr uInt8 graytable[] = { 0x03, 0x01, 0x00, 0x02 };
|
||||||
|
|
||||||
// Determine which bits are set
|
// Determine which bits are set
|
||||||
uInt8 gray = graytable[myGrayIndex];
|
uInt8 gray = graytable[myGrayIndex];
|
||||||
|
|
|
@ -284,7 +284,7 @@ bool M6532::poke(uInt16 addr, uInt8 value)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void M6532::setTimerRegister(uInt8 value, uInt8 interval)
|
void M6532::setTimerRegister(uInt8 value, uInt8 interval)
|
||||||
{
|
{
|
||||||
static const uInt8 shift[] = { 0, 3, 6, 10 };
|
static constexpr uInt8 shift[] = { 0, 3, 6, 10 };
|
||||||
|
|
||||||
myIntervalShift = shift[interval];
|
myIntervalShift = shift[interval];
|
||||||
myOutTimer[interval] = value;
|
myOutTimer[interval] = value;
|
||||||
|
|
|
@ -419,3 +419,6 @@ int Paddles::TRIGRANGE = Paddles::TRIGMAX;
|
||||||
int Paddles::DIGITAL_SENSITIVITY = -1;
|
int Paddles::DIGITAL_SENSITIVITY = -1;
|
||||||
int Paddles::DIGITAL_DISTANCE = -1;
|
int Paddles::DIGITAL_DISTANCE = -1;
|
||||||
int Paddles::MOUSE_SENSITIVITY = -1;
|
int Paddles::MOUSE_SENSITIVITY = -1;
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
const Controller::DigitalPin Paddles::ourButtonPin[2] = { Four, Three };
|
||||||
|
|
|
@ -128,17 +128,18 @@ class Paddles : public Controller
|
||||||
|
|
||||||
// Range of values over which digital and mouse movement is scaled
|
// Range of values over which digital and mouse movement is scaled
|
||||||
// to paddle resistance
|
// to paddle resistance
|
||||||
static constexpr int TRIGMIN = 1;
|
static const int TRIGMIN = 1;
|
||||||
static constexpr int TRIGMAX = 4096;
|
static const int TRIGMAX = 4096;
|
||||||
static int TRIGRANGE; // This one is variable for the upper range
|
static int TRIGRANGE; // This one is variable for the upper range
|
||||||
|
|
||||||
static constexpr int MAX_DIGITAL_SENSE = 20;
|
static const int MAX_DIGITAL_SENSE = 20;
|
||||||
static constexpr int MAX_MOUSE_SENSE = 20;
|
static const int MAX_MOUSE_SENSE = 20;
|
||||||
static int DIGITAL_SENSITIVITY, DIGITAL_DISTANCE;
|
static int DIGITAL_SENSITIVITY, DIGITAL_DISTANCE;
|
||||||
static int MOUSE_SENSITIVITY;
|
static int MOUSE_SENSITIVITY;
|
||||||
|
|
||||||
// Lookup table for associating paddle buttons with controller pins
|
// Lookup table for associating paddle buttons with controller pins
|
||||||
static constexpr Controller::DigitalPin ourButtonPin[2] = { Four, Three };
|
// Yes, this is hideously complex
|
||||||
|
static const Controller::DigitalPin ourButtonPin[2];
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -308,3 +308,8 @@ void GlobalPropsDialog::handleCommand(CommandSender* sender, int cmd,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
const char* GlobalPropsDialog::ourJoyState[10] = {
|
||||||
|
"U", "D", "L", "R", "F", "U", "D", "L", "R", "F"
|
||||||
|
};
|
||||||
|
|
|
@ -60,10 +60,7 @@ class GlobalPropsDialog : public Dialog, public CommandSender
|
||||||
CheckboxWidget* myHoldSelect;
|
CheckboxWidget* myHoldSelect;
|
||||||
CheckboxWidget* myHoldReset;
|
CheckboxWidget* myHoldReset;
|
||||||
|
|
||||||
static constexpr char* ourJoyState[10] = {
|
static const char* ourJoyState[10];
|
||||||
"U", "D", "L", "R", "F", "U", "D", "L", "R", "F"
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
|
@ -249,3 +249,9 @@ void LauncherFilterDialog::handleCommand(CommandSender* sender, int cmd,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
const char* LauncherFilterDialog::ourRomTypes[2][5] = {
|
||||||
|
{ ".a26", ".bin", ".rom", ".zip", ".gz" },
|
||||||
|
{ "a26", "bin", "rom", "zip", "gz" }
|
||||||
|
};
|
||||||
|
|
|
@ -74,11 +74,7 @@ class LauncherFilterDialog : public Dialog, public CommandSender
|
||||||
};
|
};
|
||||||
|
|
||||||
// Holds static strings representing ROM types
|
// Holds static strings representing ROM types
|
||||||
static constexpr char* ourRomTypes[2][5] = {
|
static const char* ourRomTypes[2][5];
|
||||||
{ ".a26", ".bin", ".rom", ".zip", ".gz" },
|
|
||||||
{ "a26", "bin", "rom", "zip", "gz" }
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
|
|
Loading…
Reference in New Issue