Skip to content

Commit 166b353

Browse files
committed
Updated PR 1123 for style changes.
1 parent 98a0971 commit 166b353

File tree

10 files changed

+562
-530
lines changed

10 files changed

+562
-530
lines changed

docs/index.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5106,8 +5106,9 @@ <h3><a name="EmulationProps"><b>Emulation Properties</b></a></h3>
51065106
<tr><td>E0 </td><td>8K Parker Bros </td><td>.E0 </td></tr>
51075107
<tr><td>E7 </td><td>8-16K M Network </td><td>.E7 .E78, .E78K</td></tr>
51085108
<tr><td>EF </td><td>64K Homestar Runner </td><td>.EF </td></tr>
5109+
<tr><td>EFF </td><td>64K+2Kee/Grizzards</td><td>.EFF </td></tr>
51095110
<tr><td>EFSC </td><td>64K Homestar Runner + RAM</td><td>.EFS, .EFSC </td></tr>
5110-
<tr><td>ELF </td><td>Mattress Monkeys, ARM based</td><td>.ELF </td></tr>
5111+
<tr><td>ELF </td><td>Mattress Monkeys, ARM based</td><td>.ELF </td></tr>
51115112
<tr><td>F0 </td><td>Dynacom Megaboy </td><td>.F0 </td></tr>
51125113
<tr><td>F4 </td><td>32K Atari </td><td>.F4 </td></tr>
51135114
<tr><td>F4SC </td><td>32K Atari + RAM </td><td>.F4S, .F4SC </td></tr>
@@ -5119,8 +5120,8 @@ <h3><a name="EmulationProps"><b>Emulation Properties</b></a></h3>
51195120
<tr><td>FA2 </td><td>CBS RAM Plus 24/28K </td><td>.FA2 </td></tr>
51205121
<tr><td>FC </td><td>Amiga Power Play Aracde 16/32K </td><td>.FC </td></tr>
51215122
<tr><td>FE </td><td>8K Activision (aka SCABS)</td><td>.FE </td></tr>
5122-
<tr><td>GL &#178;</td><td>4 or 6K GameLine Master Module</td><td>.GL </td></tr>
5123-
<tr><td>JANE </td><td>16K Coleco (Tarzan) </td><td>.JAN, .JANE </td></tr>
5123+
<tr><td>GL &#178;</td><td>4 or 6K GameLine Master Module</td><td>.GL </td></tr>
5124+
<tr><td>JANE </td><td>16K Coleco (Tarzan) </td><td>.JAN, .JANE </td></tr>
51245125
<tr><td>MDM </td><td>Menu Driven Megacart </td><td>.MDM </td></tr>
51255126
<tr><td>MVC </td><td>Movie Cart</td><td>.MVC </td></tr>
51265127
<tr><td>SB </td><td>128-256K SUPERbanking </td><td>.SB </td></tr>

src/emucore/CartDetector.hxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,12 @@ class CartDetector
177177
static bool isProbablyE7(const ByteBuffer& image, size_t size);
178178

179179
/**
180-
Returns true if the image is probably a E78K bankswitching cartridge
180+
Returns true if the image is probably a E78K bankswitching cartridge
181181
*/
182182
static bool isProbablyE78K(const ByteBuffer& image, size_t size);
183183

184184
/**
185-
Returns true (and sets “type”) if the image is probably an EF/EFSC bankswitching cartridge
185+
Returns true (and sets “type”) if the image is probably an EF/EFSC bankswitching cartridge
186186
*/
187187
static bool isProbablyEF(const ByteBuffer& image, size_t size, Bankswitch::Type& type);
188188

@@ -191,7 +191,7 @@ class CartDetector
191191
bankswitching+eeprom cartridge
192192
*/
193193
static bool isProbablyEFF(const ByteBuffer& image, size_t size, Bankswitch::Type& type);
194-
194+
195195
/**
196196
Returns true if the image is probably an F6 bankswitching cartridge
197197
*/

src/emucore/CartEFF.cxx

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -61,86 +61,97 @@ string CartridgeEFF::ramDescription()
6161
return info.str();
6262
}
6363

64+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
6465
uInt8 CartridgeEFF::peek(uInt16 address)
6566
{
6667
const uInt16 romAddress = address & ROM_MASK;
67-
if ((address & 0x1000) && (romAddress >= 0x0FF0) && (romAddress <= 0x0FF4))
68+
if((address & 0x1000) && (romAddress >= 0x0FF0) && (romAddress <= 0x0FF4))
69+
{
70+
switch(romAddress)
6871
{
69-
switch (romAddress) {
70-
case 0x0ff0:
72+
case 0x0FF0:
7173
setI2CClock(false);
7274
break;
73-
case 0x0ff1:
75+
case 0x0FF1:
7476
setI2CClock(true);
7577
break;
76-
case 0x0ff2:
78+
case 0x0FF2:
7779
setI2CData(false);
7880
break;
79-
case 0x0ff3:
81+
case 0x0FF3:
8082
setI2CData(true);
8183
break;
82-
case 0x0ff4:
84+
case 0x0FF4:
8385
return readI2C();
84-
};
85-
}
86+
};
87+
}
8688
return CartridgeEF::peek(address);
8789
}
8890

91+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
8992
bool CartridgeEFF::poke(uInt16 address, uInt8 value)
9093
{
9194
const uInt16 romAddress = address & ROM_MASK;
92-
if ((address & 0x1000) && (romAddress >= 0x0FF0) && (romAddress <= 0x0FF3))
95+
if((address & 0x1000) && (romAddress >= 0x0FF0) && (romAddress <= 0x0FF3))
96+
{
97+
switch(romAddress)
9398
{
94-
switch (romAddress) {
95-
case 0x0ff0:
99+
case 0x0FF0:
96100
setI2CClock(false);
97101
setI2CClock(false);
98102
return false;
99103

100-
case 0x0ff1:
104+
case 0x0FF1:
101105
setI2CClock(true);
102106
setI2CClock(true);
103107
return false;
104108

105-
case 0x0ff2:
109+
case 0x0FF2:
106110
setI2CData(false);
107111
setI2CData(false);
108112
return false;
109113

110-
case 0x0ff3:
114+
case 0x0FF3:
111115
setI2CData(true);
112116
setI2CData(true);
113117
return false;
114-
};
115-
}
118+
};
119+
}
116120
return CartridgeEF::poke(address, value);
117121
}
118122

119-
void CartridgeEFF::setI2CClock(bool value) {
123+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
124+
void CartridgeEFF::setI2CClock(bool value)
125+
{
120126
myI2CClock = value;
121-
if (myEEPROM)
127+
if(myEEPROM)
122128
myEEPROM->writeSCL(myI2CClock);
123129
else
124130
cerr << " (No EEPROM)\n";
125131
}
126132

127-
void CartridgeEFF::setI2CData(bool value) {
133+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
134+
void CartridgeEFF::setI2CData(bool value)
135+
{
128136
myI2CData = value;
129-
if (myEEPROM)
137+
if(myEEPROM)
130138
myEEPROM->writeSDA(myI2CData);
131139
else
132140
cerr << " (No EEPROM)\n";
133141
}
134142

135-
uInt8 CartridgeEFF::readI2C() {
143+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
144+
uInt8 CartridgeEFF::readI2C()
145+
{
136146
const bool sda = myEEPROM->readSDA();
137147
return myImage[0x0ff4 + (sda ? 1 : 0)];
138148
}
139149

150+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
140151
void CartridgeEFF::setNVRamFile(string_view pathname)
141152
{
142153
myEEPROMFile = std::string(pathname) + std::string("_eeprom.dat");
143-
if (mySystem)
154+
if(mySystem)
144155
myEEPROM = make_unique<MT24LC16B>(FSNode(myEEPROMFile), (const System&)mySystem, nullptr);
145156
else
146157
cerr << "ERROR asked to set up eeprom before cartridge installed in system\n";

src/emucore/CartEFF.hxx

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -36,77 +36,77 @@ class System;
3636
class CartridgeEFF : public CartridgeEF
3737
{
3838
friend class CartridgeEFFWidget;
39-
40-
public:
41-
/**
42-
Create a new cartridge using the specified image
43-
44-
@param image Pointer to the ROM image
45-
@param size The size of the ROM image
46-
@param md5 The md5sum of the ROM image
47-
@param settings A reference to the various settings (read-only)
48-
@param bsSize The size specified by the bankswitching scheme
49-
*/
50-
CartridgeEFF(const ByteBuffer& image, size_t size, string_view md5,
51-
const Settings& settings, size_t bsSize = 64_KB);
52-
~CartridgeEFF() override = default;
53-
54-
public:
55-
/**
56-
Get a descriptor for the device name (used in error checking).
57-
58-
@return The name of the object
59-
*/
60-
string name() const override { return "CartridgeEFF"; }
6139

62-
#ifdef DEBUGGER_SUPPORT
63-
/**
64-
Get debugger widget responsible for accessing the inner workings
65-
of the cart.
66-
*/
67-
CartDebugWidget* debugWidget(GuiObject* boss, const GUI::Font& lfont,
68-
const GUI::Font& nfont, int x, int y, int w, int h) override
69-
{
70-
return new CartridgeEFFWidget(boss, lfont, nfont, x, y, w, h, *this);
71-
}
72-
#endif
40+
public:
41+
/**
42+
Create a new cartridge using the specified image
43+
44+
@param image Pointer to the ROM image
45+
@param size The size of the ROM image
46+
@param md5 The md5sum of the ROM image
47+
@param settings A reference to the various settings (read-only)
48+
@param bsSize The size specified by the bankswitching scheme
49+
*/
50+
CartridgeEFF(const ByteBuffer& image, size_t size, string_view md5,
51+
const Settings& settings, size_t bsSize = 64_KB);
52+
~CartridgeEFF() override = default;
53+
54+
public:
55+
/**
56+
Get a descriptor for the device name (used in error checking).
57+
58+
@return The name of the object
59+
*/
60+
string name() const override { return "CartridgeEFF"; }
61+
62+
#ifdef DEBUGGER_SUPPORT
63+
/**
64+
Get debugger widget responsible for accessing the inner workings
65+
of the cart.
66+
*/
67+
CartDebugWidget* debugWidget(GuiObject* boss, const GUI::Font& lfont,
68+
const GUI::Font& nfont, int x, int y, int w, int h) override
69+
{
70+
return new CartridgeEFFWidget(boss, lfont, nfont, x, y, w, h, *this);
71+
}
72+
#endif
7373

74-
int descriptionLines();
74+
int descriptionLines();
7575

76-
string ramDescription();
76+
string ramDescription();
7777

78-
uInt8 peek(uInt16 address) override;
79-
bool poke(uInt16 address, uInt8 value) override;
78+
uInt8 peek(uInt16 address) override;
79+
bool poke(uInt16 address, uInt8 value) override;
80+
void setNVRamFile(string_view path) override;
8081

81-
void setNVRamFile(string_view path);
82+
protected:
83+
bool checkSwitchBank (uInt16 address, uInt8) override;
8284

83-
protected:
84-
bool checkSwitchBank (uInt16 address, uInt8) override;
85+
uInt16 hotspot() const override { return 0x1FE0; }
8586

86-
uInt16 hotspot() const override { return 0x1FE0; }
87+
uInt16 getStartBank() const override { return 1; }
8788

88-
uInt16 getStartBank() const override { return 1; }
89+
// RAM size
90+
static constexpr size_t RAM_SIZE = 0;
8991

90-
// RAM size
91-
static constexpr size_t RAM_SIZE = 0;
92+
void setI2CClock(bool value);
93+
void setI2CData(bool value);
9294

93-
void setI2CClock(bool value);
94-
void setI2CData(bool value);
95-
96-
bool myI2CData = false;
97-
bool myI2CClock = false;
95+
bool myI2CData{false};
96+
bool myI2CClock{false};
9897

99-
string myEEPROMFile;
100-
unique_ptr<MT24LC16B> myEEPROM;
98+
string myEEPROMFile;
99+
unique_ptr<MT24LC16B> myEEPROM;
101100

102-
uInt8 readI2C();
101+
uInt8 readI2C();
103102

104-
// Following constructors and assignment operators not supported
105-
CartridgeEFF() = delete;
106-
CartridgeEFF(const CartridgeEFF&) = delete;
107-
CartridgeEFF(CartridgeEFF&&) = delete;
108-
CartridgeEFF& operator=(const CartridgeEFF&) = delete;
109-
CartridgeEFF& operator=(CartridgeEFF&&) = delete;
103+
private:
104+
// Following constructors and assignment operators not supported
105+
CartridgeEFF() = delete;
106+
CartridgeEFF(const CartridgeEFF&) = delete;
107+
CartridgeEFF(CartridgeEFF&&) = delete;
108+
CartridgeEFF& operator=(const CartridgeEFF&) = delete;
109+
CartridgeEFF& operator=(CartridgeEFF&&) = delete;
110110
};
111111

112112
#endif

src/emucore/MT24LC16B.cxx

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/emucore/MT24LC16B.hxx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@
2121
#include "MicroChip24LC.hxx"
2222

2323
/**
24-
Emulates a Microchip Technology Inc. 24LC16B, a 2kiB Serial
25-
Electrically Erasable PROM accessed using the I2C protocol. Thanks to
26-
J. Payson (aka Supercat) for the bulk of the 24LC256 code; altered for
24+
Emulates a Microchip Technology Inc. 24LC16B, a 2KiB Serial Electrically
25+
Erasable PROM accessed using the I2C protocol. Thanks to J. Payson
26+
(aka Supercat) for the bulk of the 24LC256 code; altered for
2727
24LC16B / EFF (Grizzards) cart type by Bruce-Robert Pocock.
2828
2929
@author Stephen Anthon, J. Payson, and Bruce-Robert Pocock
3030
*/
31-
class MT24LC16B : public MicroChip24LC<2_KB, 16> {
31+
class MT24LC16B : public MicroChip24LC<2_KB, 16>
32+
{
3233
using MicroChip24LC::MicroChip24LC;
3334
};
3435

src/emucore/MT24LC256.cxx

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/emucore/MT24LC256.hxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
2828
@author Stephen Anthony & J. Payson
2929
*/
30-
class MT24LC256 : public MicroChip24LC<32_KB, 64> {
30+
class MT24LC256 : public MicroChip24LC<32_KB, 64>
31+
{
3132
using MicroChip24LC::MicroChip24LC;
3233
};
3334

0 commit comments

Comments
 (0)