Fix warnings generated by clang 8.

- Several more still exist, and are mostly related to C-style code
- It has long been my intent to remove as much C-style code as possible
This commit is contained in:
Stephen Anthony 2019-03-02 12:06:08 -03:30
parent d04b5dd64b
commit abc3b3a32b
15 changed files with 244 additions and 227 deletions

View File

@ -39,13 +39,17 @@ PNGLibrary::PNGLibrary(OSystem& osystem)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void PNGLibrary::loadImage(const string& filename, FBSurface& surface)
{
#define loadImageERROR(s) { err_message = s; goto done; }
png_structp png_ptr = nullptr;
png_infop info_ptr = nullptr;
png_uint_32 iwidth, iheight;
int bit_depth, color_type, interlace_type;
const char* err_message = nullptr;
auto loadImageERROR = [&](const char* s) {
if(png_ptr)
png_destroy_read_struct(&png_ptr, info_ptr ? &info_ptr : nullptr, nullptr);
if(s)
throw runtime_error(s);
};
ifstream in(filename, std::ios_base::binary);
if(!in.is_open())
@ -113,12 +117,8 @@ void PNGLibrary::loadImage(const string& filename, FBSurface& surface)
loadImagetoSurface(surface);
// Cleanup
done:
if(png_ptr)
png_destroy_read_struct(&png_ptr, info_ptr ? &info_ptr : nullptr, nullptr);
if(err_message)
throw runtime_error(err_message);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -178,11 +178,15 @@ void PNGLibrary::saveImage(const string& filename, const FBSurface& surface,
void PNGLibrary::saveImageToDisk(ofstream& out, const unique_ptr<png_bytep[]>& rows,
png_uint_32 width, png_uint_32 height, const VariantList& comments)
{
#define saveImageERROR(s) { err_message = s; goto done; }
png_structp png_ptr = nullptr;
png_infop info_ptr = nullptr;
const char* err_message = nullptr;
auto saveImageERROR = [&](const char* s) {
if(png_ptr)
png_destroy_write_struct(&png_ptr, &info_ptr);
if(s)
throw runtime_error(s);
};
// Create the PNG saving context structure
png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, nullptr,
@ -228,11 +232,8 @@ void PNGLibrary::saveImageToDisk(ofstream& out, const unique_ptr<png_bytep[]>& r
png_write_end(png_ptr, info_ptr);
// Cleanup
done:
if(png_ptr)
png_destroy_write_struct(&png_ptr, &info_ptr);
if(err_message)
throw runtime_error(err_message);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -135,47 +135,47 @@ void AtariNTSC::renderThread(const uInt8* atari_in, const uInt32 in_width,
for(uInt32 n = chunk_count; n; --n)
{
// order of input and output pixels must not be altered
ATARI_NTSC_COLOR_IN(0, line_in[0]);
ATARI_NTSC_RGB_OUT_8888(0, line_out[0]);
ATARI_NTSC_RGB_OUT_8888(1, line_out[1]);
ATARI_NTSC_RGB_OUT_8888(2, line_out[2]);
ATARI_NTSC_RGB_OUT_8888(3, line_out[3]);
ATARI_NTSC_COLOR_IN(0, line_in[0])
ATARI_NTSC_RGB_OUT_8888(0, line_out[0])
ATARI_NTSC_RGB_OUT_8888(1, line_out[1])
ATARI_NTSC_RGB_OUT_8888(2, line_out[2])
ATARI_NTSC_RGB_OUT_8888(3, line_out[3])
ATARI_NTSC_COLOR_IN(1, line_in[1]);
ATARI_NTSC_RGB_OUT_8888(4, line_out[4]);
ATARI_NTSC_RGB_OUT_8888(5, line_out[5]);
ATARI_NTSC_RGB_OUT_8888(6, line_out[6]);
ATARI_NTSC_COLOR_IN(1, line_in[1])
ATARI_NTSC_RGB_OUT_8888(4, line_out[4])
ATARI_NTSC_RGB_OUT_8888(5, line_out[5])
ATARI_NTSC_RGB_OUT_8888(6, line_out[6])
line_in += 2;
line_out += 7;
}
// finish final pixels
ATARI_NTSC_COLOR_IN(0, line_in[0]);
ATARI_NTSC_RGB_OUT_8888(0, line_out[0]);
ATARI_NTSC_RGB_OUT_8888(1, line_out[1]);
ATARI_NTSC_RGB_OUT_8888(2, line_out[2]);
ATARI_NTSC_RGB_OUT_8888(3, line_out[3]);
ATARI_NTSC_COLOR_IN(0, line_in[0])
ATARI_NTSC_RGB_OUT_8888(0, line_out[0])
ATARI_NTSC_RGB_OUT_8888(1, line_out[1])
ATARI_NTSC_RGB_OUT_8888(2, line_out[2])
ATARI_NTSC_RGB_OUT_8888(3, line_out[3])
ATARI_NTSC_COLOR_IN(1, NTSC_black);
ATARI_NTSC_RGB_OUT_8888(4, line_out[4]);
ATARI_NTSC_RGB_OUT_8888(5, line_out[5]);
ATARI_NTSC_RGB_OUT_8888(6, line_out[6]);
ATARI_NTSC_COLOR_IN(1, NTSC_black)
ATARI_NTSC_RGB_OUT_8888(4, line_out[4])
ATARI_NTSC_RGB_OUT_8888(5, line_out[5])
ATARI_NTSC_RGB_OUT_8888(6, line_out[6])
line_in += 2;
line_out += 7;
ATARI_NTSC_COLOR_IN(0, NTSC_black);
ATARI_NTSC_RGB_OUT_8888(0, line_out[0]);
ATARI_NTSC_RGB_OUT_8888(1, line_out[1]);
ATARI_NTSC_RGB_OUT_8888(2, line_out[2]);
ATARI_NTSC_RGB_OUT_8888(3, line_out[3]);
ATARI_NTSC_COLOR_IN(0, NTSC_black)
ATARI_NTSC_RGB_OUT_8888(0, line_out[0])
ATARI_NTSC_RGB_OUT_8888(1, line_out[1])
ATARI_NTSC_RGB_OUT_8888(2, line_out[2])
ATARI_NTSC_RGB_OUT_8888(3, line_out[3])
ATARI_NTSC_COLOR_IN(1, NTSC_black);
ATARI_NTSC_RGB_OUT_8888(4, line_out[4]);
ATARI_NTSC_COLOR_IN(1, NTSC_black)
ATARI_NTSC_RGB_OUT_8888(4, line_out[4])
#if 0
ATARI_NTSC_RGB_OUT_8888(5, line_out[5]);
ATARI_NTSC_RGB_OUT_8888(6, line_out[6]);
ATARI_NTSC_RGB_OUT_8888(5, line_out[5])
ATARI_NTSC_RGB_OUT_8888(6, line_out[6])
#endif
atari_in += in_width;
@ -208,47 +208,47 @@ void AtariNTSC::renderWithPhosphorThread(const uInt8* atari_in, const uInt32 in_
for(uInt32 n = chunk_count; n; --n)
{
// order of input and output pixels must not be altered
ATARI_NTSC_COLOR_IN(0, line_in[0]);
ATARI_NTSC_RGB_OUT_8888(0, line_out[0]);
ATARI_NTSC_RGB_OUT_8888(1, line_out[1]);
ATARI_NTSC_RGB_OUT_8888(2, line_out[2]);
ATARI_NTSC_RGB_OUT_8888(3, line_out[3]);
ATARI_NTSC_COLOR_IN(0, line_in[0])
ATARI_NTSC_RGB_OUT_8888(0, line_out[0])
ATARI_NTSC_RGB_OUT_8888(1, line_out[1])
ATARI_NTSC_RGB_OUT_8888(2, line_out[2])
ATARI_NTSC_RGB_OUT_8888(3, line_out[3])
ATARI_NTSC_COLOR_IN(1, line_in[1]);
ATARI_NTSC_RGB_OUT_8888(4, line_out[4]);
ATARI_NTSC_RGB_OUT_8888(5, line_out[5]);
ATARI_NTSC_RGB_OUT_8888(6, line_out[6]);
ATARI_NTSC_COLOR_IN(1, line_in[1])
ATARI_NTSC_RGB_OUT_8888(4, line_out[4])
ATARI_NTSC_RGB_OUT_8888(5, line_out[5])
ATARI_NTSC_RGB_OUT_8888(6, line_out[6])
line_in += 2;
line_out += 7;
}
// finish final pixels
ATARI_NTSC_COLOR_IN(0, line_in[0]);
ATARI_NTSC_RGB_OUT_8888(0, line_out[0]);
ATARI_NTSC_RGB_OUT_8888(1, line_out[1]);
ATARI_NTSC_RGB_OUT_8888(2, line_out[2]);
ATARI_NTSC_RGB_OUT_8888(3, line_out[3]);
ATARI_NTSC_COLOR_IN(0, line_in[0])
ATARI_NTSC_RGB_OUT_8888(0, line_out[0])
ATARI_NTSC_RGB_OUT_8888(1, line_out[1])
ATARI_NTSC_RGB_OUT_8888(2, line_out[2])
ATARI_NTSC_RGB_OUT_8888(3, line_out[3])
ATARI_NTSC_COLOR_IN(1, NTSC_black);
ATARI_NTSC_RGB_OUT_8888(4, line_out[4]);
ATARI_NTSC_RGB_OUT_8888(5, line_out[5]);
ATARI_NTSC_RGB_OUT_8888(6, line_out[6]);
ATARI_NTSC_COLOR_IN(1, NTSC_black)
ATARI_NTSC_RGB_OUT_8888(4, line_out[4])
ATARI_NTSC_RGB_OUT_8888(5, line_out[5])
ATARI_NTSC_RGB_OUT_8888(6, line_out[6])
line_in += 2;
line_out += 7;
ATARI_NTSC_COLOR_IN(0, NTSC_black);
ATARI_NTSC_RGB_OUT_8888(0, line_out[0]);
ATARI_NTSC_RGB_OUT_8888(1, line_out[1]);
ATARI_NTSC_RGB_OUT_8888(2, line_out[2]);
ATARI_NTSC_RGB_OUT_8888(3, line_out[3]);
ATARI_NTSC_COLOR_IN(0, NTSC_black)
ATARI_NTSC_RGB_OUT_8888(0, line_out[0])
ATARI_NTSC_RGB_OUT_8888(1, line_out[1])
ATARI_NTSC_RGB_OUT_8888(2, line_out[2])
ATARI_NTSC_RGB_OUT_8888(3, line_out[3])
ATARI_NTSC_COLOR_IN(1, NTSC_black);
ATARI_NTSC_RGB_OUT_8888(4, line_out[4]);
ATARI_NTSC_COLOR_IN(1, NTSC_black)
ATARI_NTSC_RGB_OUT_8888(4, line_out[4])
#if 0
ATARI_NTSC_RGB_OUT_8888(5, line_out[5]);
ATARI_NTSC_RGB_OUT_8888(6, line_out[6]);
ATARI_NTSC_RGB_OUT_8888(5, line_out[5])
ATARI_NTSC_RGB_OUT_8888(6, line_out[6])
#endif
// Do phosphor mode (blend the resulting frames)
@ -304,8 +304,8 @@ inline uInt32 AtariNTSC::getRGBPhosphor(const uInt32 c, const uInt32 p) const
const uInt8 green = uInt8(color >> 8);\
const uInt8 blue = uInt8(color);
TO_RGB(c, rc, gc, bc);
TO_RGB(p, rp, gp, bp);
TO_RGB(c, rc, gc, bc)
TO_RGB(p, rp, gp, bp)
// Mix current calculated frame with previous displayed frame
const uInt8 rn = myPhosphorPalette[rc][rp];

View File

@ -996,7 +996,7 @@ string CartDebug::saveDisassembly()
settings.fFlag = DiStella::settings.fFlag;
settings.rFlag = DiStella::settings.rFlag;
settings.bytesWidth = 8+1; // same as Stella debugger
settings.bFlag = DiStella::settings.bFlag;; // process break routine (TODO)
settings.bFlag = DiStella::settings.bFlag; // process break routine (TODO)
Disassembly disasm;
disasm.list.reserve(2048);

View File

@ -349,7 +349,7 @@ bool TIADebug::resMP1(int newVal)
if(newVal > -1)
mySystem.poke(RESMP1, bool(newVal) << 1);
return myTIA.registerValue(RESMP1) & 0x02;;
return myTIA.registerValue(RESMP1) & 0x02;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -1085,36 +1085,36 @@ string TIADebug::toString()
<< " BK=$" << Common::Base::HEX2 << state.coluRegs[3] << "/"
<< colorSwatch(state.coluRegs[3])
<< endl
<< "P0: GR=%" << Common::Base::toString(state.gr[P0], Common::Base::F_2_8)
<< " pos=#" << std::dec << state.pos[P0]
<< " HM=$" << Common::Base::HEX2 << state.hm[P0] << " "
<< "P0: GR=%" << Common::Base::toString(state.gr[TiaState::P0], Common::Base::F_2_8)
<< " pos=#" << std::dec << state.pos[TiaState::P0]
<< " HM=$" << Common::Base::HEX2 << state.hm[TiaState::P0] << " "
<< nusizP0String() << " "
<< booleanWithLabel("refl", refP0()) << " "
<< booleanWithLabel("delay", vdelP0())
<< endl
<< "P1: GR=%" << Common::Base::toString(state.gr[P1], Common::Base::F_2_8)
<< " pos=#" << std::dec << state.pos[P1]
<< " HM=$" << Common::Base::HEX2 << state.hm[P1] << " "
<< "P1: GR=%" << Common::Base::toString(state.gr[TiaState::P1], Common::Base::F_2_8)
<< " pos=#" << std::dec << state.pos[TiaState::P1]
<< " HM=$" << Common::Base::HEX2 << state.hm[TiaState::P1] << " "
<< nusizP1String() << " "
<< booleanWithLabel("refl", refP1()) << " "
<< booleanWithLabel("delay", vdelP1())
<< endl
<< "M0: " << (enaM0() ? " ENABLED" : "disabled")
<< " pos=#" << std::dec << state.pos[M0]
<< " HM=$" << Common::Base::HEX2 << state.hm[M0]
<< " size=" << std::dec << state.size[M0] << " "
<< " pos=#" << std::dec << state.pos[TiaState::M0]
<< " HM=$" << Common::Base::HEX2 << state.hm[TiaState::M0]
<< " size=" << std::dec << state.size[TiaState::M0] << " "
<< booleanWithLabel("reset", resMP0())
<< endl
<< "M1: " << (enaM1() ? " ENABLED" : "disabled")
<< " pos=#" << std::dec << state.pos[M1]
<< " HM=$" << Common::Base::HEX2 << state.hm[M1]
<< " size=" << std::dec << state.size[M1] << " "
<< " pos=#" << std::dec << state.pos[TiaState::M1]
<< " HM=$" << Common::Base::HEX2 << state.hm[TiaState::M1]
<< " size=" << std::dec << state.size[TiaState::M1] << " "
<< booleanWithLabel("reset", resMP0())
<< endl
<< "BL: " << (enaBL() ? " ENABLED" : "disabled")
<< " pos=#" << std::dec << state.pos[BL]
<< " HM=$" << Common::Base::HEX2 << state.hm[BL]
<< " size=" << std::dec << state.size[BL] << " "
<< " pos=#" << std::dec << state.pos[TiaState::BL]
<< " HM=$" << Common::Base::HEX2 << state.hm[TiaState::BL]
<< " size=" << std::dec << state.size[TiaState::BL] << " "
<< booleanWithLabel("delay", vdelBL())
<< endl
<< "PF0: %" << Common::Base::toString(state.pf[0], Common::Base::F_2_8) << "/$"

View File

@ -29,11 +29,6 @@ using TiaMethod = int (TIADebug::*)() const;
#include "DebuggerSystem.hxx"
#include "bspf.hxx"
// Indices for various IntArray in TiaState
enum {
P0, P1, M0, M1, BL
};
class TiaState : public DebuggerState
{
public:
@ -50,6 +45,9 @@ class TiaState : public DebuggerState
IntArray size;
IntArray aud;
IntArray info;
// Indices for various IntArray above
enum { P0, P1, M0, M1, BL };
};
class TIADebug : public DebuggerSystem

View File

@ -392,7 +392,7 @@ void DebuggerDialog::createFont()
myLFont = make_unique<GUI::Font>(GUI::consoleMediumDesc);
myNFont = make_unique<GUI::Font>(GUI::consoleMediumDesc);
break;
};
}
}
else
{

View File

@ -52,7 +52,7 @@ void DelayQueueWidget::loadConfig() {
if (!delayQueueIterator->isValid()) {
line = "";
continue;
};
}
stringstream ss;
const auto address = delayQueueIterator->address();

View File

@ -77,28 +77,28 @@ RiotWidget::RiotWidget(GuiObject* boss, const GUI::Font& lfont,
bits->setList(off, on);
// SWCHA bits in 'poke' mode
CREATE_IO_REGS("SWCHA(W)", mySWCHAWriteBits, kSWCHABitsID, true);
CREATE_IO_REGS("SWCHA(W)", mySWCHAWriteBits, kSWCHABitsID, true)
col = xpos + 20; // remember this for adding widgets to the second column
// SWACNT bits
xpos = 10; ypos += lineHeight + 5;
CREATE_IO_REGS("SWACNT", mySWACNTBits, kSWACNTBitsID, true);
CREATE_IO_REGS("SWACNT", mySWACNTBits, kSWACNTBitsID, true)
// SWCHA bits in 'peek' mode
xpos = 10; ypos += lineHeight + 5;
CREATE_IO_REGS("SWCHA(R)", mySWCHAReadBits, kSWCHARBitsID, true);
CREATE_IO_REGS("SWCHA(R)", mySWCHAReadBits, kSWCHARBitsID, true)
// SWCHB bits in 'poke' mode
xpos = 10; ypos += 2 * lineHeight;
CREATE_IO_REGS("SWCHB(W)", mySWCHBWriteBits, kSWCHBBitsID, true);
CREATE_IO_REGS("SWCHB(W)", mySWCHBWriteBits, kSWCHBBitsID, true)
// SWBCNT bits
xpos = 10; ypos += lineHeight + 5;
CREATE_IO_REGS("SWBCNT", mySWBCNTBits, kSWBCNTBitsID, true);
CREATE_IO_REGS("SWBCNT", mySWBCNTBits, kSWBCNTBitsID, true)
// SWCHB bits in 'peek' mode
xpos = 10; ypos += lineHeight + 5;
CREATE_IO_REGS("SWCHB(R)", mySWCHBReadBits, 0, false);
CREATE_IO_REGS("SWCHB(R)", mySWCHBReadBits, 0, false)
// Timer registers (R/W)
const char* const writeNames[] = { "TIM1T", "TIM8T", "TIM64T", "T1024T" };
@ -257,22 +257,22 @@ void RiotWidget::loadConfig()
const RiotState& oldstate = static_cast<const RiotState&>(riot.getOldState());
// Update the SWCHA register booleans (poke mode)
IO_REGS_UPDATE(mySWCHAWriteBits, swchaWriteBits);
IO_REGS_UPDATE(mySWCHAWriteBits, swchaWriteBits)
// Update the SWACNT register booleans
IO_REGS_UPDATE(mySWACNTBits, swacntBits);
IO_REGS_UPDATE(mySWACNTBits, swacntBits)
// Update the SWCHA register booleans (peek mode)
IO_REGS_UPDATE(mySWCHAReadBits, swchaReadBits);
IO_REGS_UPDATE(mySWCHAReadBits, swchaReadBits)
// Update the SWCHB register booleans (poke mode)
IO_REGS_UPDATE(mySWCHBWriteBits, swchbWriteBits);
IO_REGS_UPDATE(mySWCHBWriteBits, swchbWriteBits)
// Update the SWBCNT register booleans
IO_REGS_UPDATE(mySWBCNTBits, swbcntBits);
IO_REGS_UPDATE(mySWBCNTBits, swbcntBits)
// Update the SWCHB register booleans (peek mode)
IO_REGS_UPDATE(mySWCHBReadBits, swchbReadBits);
IO_REGS_UPDATE(mySWCHBReadBits, swchbReadBits)
// Update TIA INPTx registers
alist.clear(); vlist.clear(); changed.clear();

View File

@ -1003,22 +1003,24 @@ void TiaWidget::loadConfig()
myGRP0Old->setColor(kBGColorLo);
myGRP0Old->setCrossed(true);
}
myGRP0->setIntState(state.gr[P0], false);
myGRP0Old->setIntState(state.gr[P0+2], false);
myGRP0->setIntState(state.gr[TiaState::P0], false);
myGRP0Old->setIntState(state.gr[TiaState::P0+2], false);
// posP0
myPosP0->setList(0, state.pos[P0], state.pos[P0] != oldstate.pos[P0]);
myPosP0->setList(0, state.pos[TiaState::P0],
state.pos[TiaState::P0] != oldstate.pos[TiaState::P0]);
// hmP0
myHMP0->setList(0, state.hm[P0], state.hm[P0] != oldstate.hm[P0]);
myHMP0->setList(0, state.hm[TiaState::P0],
state.hm[TiaState::P0] != oldstate.hm[TiaState::P0]);
// refP0 & vdelP0
myRefP0->setState(tia.refP0(), state.ref[P0] != oldstate.ref[P0]);
myDelP0->setState(tia.vdelP0(), state.vdel[P0] != oldstate.vdel[P0]);
myRefP0->setState(tia.refP0(), state.ref[TiaState::P0] != oldstate.ref[TiaState::P0]);
myDelP0->setState(tia.vdelP0(), state.vdel[TiaState::P0] != oldstate.vdel[TiaState::P0]);
// NUSIZ0 (player portion)
bool nusiz0changed = state.size[P0] != oldstate.size[P0];
myNusizP0->setList(0, state.size[P0], nusiz0changed);
bool nusiz0changed = state.size[TiaState::P0] != oldstate.size[TiaState::P0];
myNusizP0->setList(0, state.size[TiaState::P0], nusiz0changed);
myNusizP0Text->setText(tia.nusizP0String(), nusiz0changed);
////////////////////////////
@ -1037,22 +1039,24 @@ void TiaWidget::loadConfig()
myGRP1Old->setColor(kBGColorLo);
myGRP1Old->setCrossed(true);
}
myGRP1->setIntState(state.gr[P1], false);
myGRP1Old->setIntState(state.gr[P1+2], false);
myGRP1->setIntState(state.gr[TiaState::P1], false);
myGRP1Old->setIntState(state.gr[TiaState::P1+2], false);
// posP1
myPosP1->setList(0, state.pos[P1], state.pos[P1] != oldstate.pos[P1]);
myPosP1->setList(0, state.pos[TiaState::P1],
state.pos[TiaState::P1] != oldstate.pos[TiaState::P1]);
// hmP1
myHMP1->setList(0, state.hm[P1], state.hm[P1] != oldstate.hm[P1]);
myHMP1->setList(0, state.hm[TiaState::P1],
state.hm[TiaState::P1] != oldstate.hm[TiaState::P1]);
// refP1 & vdelP1
myRefP1->setState(tia.refP1(), state.ref[P1] != oldstate.ref[P1]);
myDelP1->setState(tia.vdelP1(), state.vdel[P1] != oldstate.vdel[P1]);
myRefP1->setState(tia.refP1(), state.ref[TiaState::P1] != oldstate.ref[TiaState::P1]);
myDelP1->setState(tia.vdelP1(), state.vdel[TiaState::P1] != oldstate.vdel[TiaState::P1]);
// NUSIZ1 (player portion)
bool nusiz1changed = state.size[P1] != oldstate.size[P1];
myNusizP1->setList(0, state.size[P1], nusiz1changed);
bool nusiz1changed = state.size[TiaState::P1] != oldstate.size[TiaState::P1];
myNusizP1->setList(0, state.size[TiaState::P1], nusiz1changed);
myNusizP1Text->setText(tia.nusizP1String(), nusiz1changed);
////////////////////////////
@ -1063,16 +1067,19 @@ void TiaWidget::loadConfig()
myEnaM0->setIntState(tia.enaM0() ? 1 : 0, false);
// posM0
myPosM0->setList(0, state.pos[M0], state.pos[M0] != oldstate.pos[M0]);
myPosM0->setList(0, state.pos[TiaState::M0],
state.pos[TiaState::M0] != oldstate.pos[TiaState::M0]);
// hmM0
myHMM0->setList(0, state.hm[M0], state.hm[M0] != oldstate.hm[M0]);
myHMM0->setList(0, state.hm[TiaState::M0],
state.hm[TiaState::M0] != oldstate.hm[TiaState::M0]);
// NUSIZ0 (missile portion)
myNusizM0->setList(0, state.size[M0], state.size[M0] != oldstate.size[M0]);
myNusizM0->setList(0, state.size[TiaState::M0],
state.size[TiaState::M0] != oldstate.size[TiaState::M0]);
// resMP0
myResMP0->setState(tia.resMP0(), state.res[P0] != oldstate.res[P0]);
myResMP0->setState(tia.resMP0(), state.res[TiaState::P0] != oldstate.res[TiaState::P0]);
////////////////////////////
// M1 register info
@ -1082,16 +1089,19 @@ void TiaWidget::loadConfig()
myEnaM1->setIntState(tia.enaM1() ? 1 : 0, false);
// posM1
myPosM1->setList(0, state.pos[M1], state.pos[M1] != oldstate.pos[M1]);
myPosM1->setList(0, state.pos[TiaState::M1],
state.pos[TiaState::M1] != oldstate.pos[TiaState::M1]);
// hmM1
myHMM1->setList(0, state.hm[M1], state.hm[M1] != oldstate.hm[M1]);
myHMM1->setList(0, state.hm[TiaState::M1],
state.hm[TiaState::M1] != oldstate.hm[TiaState::M1]);
// NUSIZ1 (missile portion)
myNusizM1->setList(0, state.size[M1], state.size[M1] != oldstate.size[M1]);
myNusizM1->setList(0, state.size[TiaState::M1],
state.size[TiaState::M1] != oldstate.size[TiaState::M1]);
// resMP1
myResMP1->setState(tia.resMP1(),state.res[P1] != oldstate.res[P1]);
myResMP1->setState(tia.resMP1(),state.res[TiaState::P1] != oldstate.res[TiaState::P1]);
////////////////////////////
// BL register info
@ -1113,13 +1123,16 @@ void TiaWidget::loadConfig()
myEnaBLOld->setIntState(state.gr[5], false);
// posBL
myPosBL->setList(0, state.pos[BL], state.pos[BL] != oldstate.pos[BL]);
myPosBL->setList(0, state.pos[TiaState::BL],
state.pos[TiaState::BL] != oldstate.pos[TiaState::BL]);
// hmBL
myHMBL->setList(0, state.hm[BL], state.hm[BL] != oldstate.hm[BL]);
myHMBL->setList(0, state.hm[TiaState::BL],
state.hm[TiaState::BL] != oldstate.hm[TiaState::BL]);
// CTRLPF (size portion)
mySizeBL->setList(0, state.size[BL], state.size[BL] != oldstate.size[BL]);
mySizeBL->setList(0, state.size[TiaState::BL],
state.size[TiaState::BL] != oldstate.size[TiaState::BL]);
// vdelBL
myDelBL->setState(tia.vdelBL(), state.vdel[2] != oldstate.vdel[2]);

View File

@ -201,76 +201,76 @@ static void MD5Transform(uInt32 state[4], const uInt8 block[64])
Decode (x, block, 64);
/* Round 1 */
FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */
FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */
FF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */
FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */
FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */
FF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */
FF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */
FF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */
FF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */
FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */
FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */
FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */
FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */
FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */
FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */
FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */
FF (a, b, c, d, x[ 0], S11, 0xd76aa478) /* 1 */
FF (d, a, b, c, x[ 1], S12, 0xe8c7b756) /* 2 */
FF (c, d, a, b, x[ 2], S13, 0x242070db) /* 3 */
FF (b, c, d, a, x[ 3], S14, 0xc1bdceee) /* 4 */
FF (a, b, c, d, x[ 4], S11, 0xf57c0faf) /* 5 */
FF (d, a, b, c, x[ 5], S12, 0x4787c62a) /* 6 */
FF (c, d, a, b, x[ 6], S13, 0xa8304613) /* 7 */
FF (b, c, d, a, x[ 7], S14, 0xfd469501) /* 8 */
FF (a, b, c, d, x[ 8], S11, 0x698098d8) /* 9 */
FF (d, a, b, c, x[ 9], S12, 0x8b44f7af) /* 10 */
FF (c, d, a, b, x[10], S13, 0xffff5bb1) /* 11 */
FF (b, c, d, a, x[11], S14, 0x895cd7be) /* 12 */
FF (a, b, c, d, x[12], S11, 0x6b901122) /* 13 */
FF (d, a, b, c, x[13], S12, 0xfd987193) /* 14 */
FF (c, d, a, b, x[14], S13, 0xa679438e) /* 15 */
FF (b, c, d, a, x[15], S14, 0x49b40821) /* 16 */
/* Round 2 */
GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */
GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */
GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */
GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */
GG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */
GG (d, a, b, c, x[10], S22, 0x2441453); /* 22 */
GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */
GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */
GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */
GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */
GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */
GG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */
GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */
GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */
GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */
GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */
GG (a, b, c, d, x[ 1], S21, 0xf61e2562) /* 17 */
GG (d, a, b, c, x[ 6], S22, 0xc040b340) /* 18 */
GG (c, d, a, b, x[11], S23, 0x265e5a51) /* 19 */
GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa) /* 20 */
GG (a, b, c, d, x[ 5], S21, 0xd62f105d) /* 21 */
GG (d, a, b, c, x[10], S22, 0x2441453) /* 22 */
GG (c, d, a, b, x[15], S23, 0xd8a1e681) /* 23 */
GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8) /* 24 */
GG (a, b, c, d, x[ 9], S21, 0x21e1cde6) /* 25 */
GG (d, a, b, c, x[14], S22, 0xc33707d6) /* 26 */
GG (c, d, a, b, x[ 3], S23, 0xf4d50d87) /* 27 */
GG (b, c, d, a, x[ 8], S24, 0x455a14ed) /* 28 */
GG (a, b, c, d, x[13], S21, 0xa9e3e905) /* 29 */
GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8) /* 30 */
GG (c, d, a, b, x[ 7], S23, 0x676f02d9) /* 31 */
GG (b, c, d, a, x[12], S24, 0x8d2a4c8a) /* 32 */
/* Round 3 */
HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */
HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */
HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */
HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */
HH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */
HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */
HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */
HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */
HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */
HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */
HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */
HH (b, c, d, a, x[ 6], S34, 0x4881d05); /* 44 */
HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */
HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */
HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */
HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */
HH (a, b, c, d, x[ 5], S31, 0xfffa3942) /* 33 */
HH (d, a, b, c, x[ 8], S32, 0x8771f681) /* 34 */
HH (c, d, a, b, x[11], S33, 0x6d9d6122) /* 35 */
HH (b, c, d, a, x[14], S34, 0xfde5380c) /* 36 */
HH (a, b, c, d, x[ 1], S31, 0xa4beea44) /* 37 */
HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9) /* 38 */
HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60) /* 39 */
HH (b, c, d, a, x[10], S34, 0xbebfbc70) /* 40 */
HH (a, b, c, d, x[13], S31, 0x289b7ec6) /* 41 */
HH (d, a, b, c, x[ 0], S32, 0xeaa127fa) /* 42 */
HH (c, d, a, b, x[ 3], S33, 0xd4ef3085) /* 43 */
HH (b, c, d, a, x[ 6], S34, 0x4881d05) /* 44 */
HH (a, b, c, d, x[ 9], S31, 0xd9d4d039) /* 45 */
HH (d, a, b, c, x[12], S32, 0xe6db99e5) /* 46 */
HH (c, d, a, b, x[15], S33, 0x1fa27cf8) /* 47 */
HH (b, c, d, a, x[ 2], S34, 0xc4ac5665) /* 48 */
/* Round 4 */
II (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */
II (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */
II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */
II (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */
II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */
II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */
II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */
II (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */
II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */
II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */
II (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */
II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */
II (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */
II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */
II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */
II (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */
II (a, b, c, d, x[ 0], S41, 0xf4292244) /* 49 */
II (d, a, b, c, x[ 7], S42, 0x432aff97) /* 50 */
II (c, d, a, b, x[14], S43, 0xab9423a7) /* 51 */
II (b, c, d, a, x[ 5], S44, 0xfc93a039) /* 52 */
II (a, b, c, d, x[12], S41, 0x655b59c3) /* 53 */
II (d, a, b, c, x[ 3], S42, 0x8f0ccc92) /* 54 */
II (c, d, a, b, x[10], S43, 0xffeff47d) /* 55 */
II (b, c, d, a, x[ 1], S44, 0x85845dd1) /* 56 */
II (a, b, c, d, x[ 8], S41, 0x6fa87e4f) /* 57 */
II (d, a, b, c, x[15], S42, 0xfe2ce6e0) /* 58 */
II (c, d, a, b, x[ 6], S43, 0xa3014314) /* 59 */
II (b, c, d, a, x[13], S44, 0x4e0811a1) /* 60 */
II (a, b, c, d, x[ 4], S41, 0xf7537e82) /* 61 */
II (d, a, b, c, x[11], S42, 0xbd3af235) /* 62 */
II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb) /* 63 */
II (b, c, d, a, x[ 9], S44, 0xeb86d391) /* 64 */
state[0] += a;
state[1] += b;

View File

@ -27,6 +27,11 @@
#define DEBUG_EEPROM 0
// FIXME - Change to more proper C++ code, to eliminate warnings from clang8
// It seems we only need OSystem here to print a message; I think this
// can be abstracted away from the class; perhaps use a lambda to
// register a callback when a write happens??
#if DEBUG_EEPROM
char jpee_msg[256];
#define JPEE_LOG0(msg) jpee_logproc(msg)

View File

@ -261,8 +261,8 @@ inline uInt32 TIASurface::getRGBPhosphor(const uInt32 c, const uInt32 p) const
#define TO_RGB(color, red, green, blue) \
const uInt8 red = color >> 16; const uInt8 green = color >> 8; const uInt8 blue = color;
TO_RGB(c, rc, gc, bc);
TO_RGB(p, rp, gp, bp);
TO_RGB(c, rc, gc, bc)
TO_RGB(p, rp, gp, bp)
// Mix current calculated frame with previous displayed frame
const uInt8 rn = myPhosphorPalette[rc][rp];
@ -328,8 +328,8 @@ inline uInt32 TIASurface::averageBuffers(uInt32 bufOfs)
uInt32 p = myPrevRGBFramebuffer[bufOfs];
// Split into RGB values
TO_RGB(c, rc, gc, bc);
TO_RGB(p, rp, gp, bp);
TO_RGB(c, rc, gc, bc)
TO_RGB(p, rp, gp, bp)
// Mix current calculated buffer with previous calculated buffer (50:50)
const uInt8 rn = (rc + rp) / 2;

View File

@ -53,10 +53,11 @@ using Common::Base;
#endif
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Thumbulator::Thumbulator(const uInt16* rom_ptr, uInt16* ram_ptr, uInt32 romSize, bool traponfatal,
Thumbulator::ConfigureFor configurefor, Cartridge* cartridge)
Thumbulator::Thumbulator(const uInt16* rom_ptr, uInt16* ram_ptr, uInt32 rom_size,
bool traponfatal, Thumbulator::ConfigureFor configurefor,
Cartridge* cartridge)
: rom(rom_ptr),
romSize(romSize),
romSize(rom_size),
decodedRom(new Op[romSize / 2]),
ram(ram_ptr),
T1TCR(0),
@ -1218,7 +1219,7 @@ int Thumbulator::execute()
{
//branch to thumb
rb = read_register(14);
rb += (inst & ((1 << 11) - 1)) << 1;;
rb += (inst & ((1 << 11) - 1)) << 1;
rb += 2;
DO_DISS(statusMsg << "bl 0x" << Base::HEX8 << (rb-3) << endl);
write_register(14, (pc-2) | 1);
@ -1230,7 +1231,7 @@ int Thumbulator::execute()
//fprintf(stderr,"cannot branch to arm 0x%08X 0x%04X\n",pc,inst);
// fxq: this should exit the code without having to detect it
rb = read_register(14);
rb += (inst & ((1 << 11) - 1)) << 1;;
rb += (inst & ((1 << 11) - 1)) << 1;
rb &= 0xFFFFFFFC;
rb += 2;
DO_DISS(statusMsg << "bl 0x" << Base::HEX8 << (rb-3) << endl);
@ -1487,8 +1488,6 @@ int Thumbulator::execute()
return 1;
}
break;
}
//CMN

View File

@ -59,8 +59,9 @@ class Thumbulator
DPCplus // cartridges of type DPC+
};
Thumbulator(const uInt16* rom, uInt16* ram, uInt32 romSize, bool traponfatal,
Thumbulator::ConfigureFor configurefor, Cartridge* cartridge);
Thumbulator(const uInt16* rom_ptr, uInt16* ram_ptr, uInt32 rom_size,
bool traponfatal, Thumbulator::ConfigureFor configurefor,
Cartridge* cartridge);
/**
Run the ARM code, and return when finished. A runtime_error exception is

View File

@ -255,16 +255,16 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
wid.push_back(myTV ## obj); \
ypos += lineHeight + VGAP;
CREATE_CUSTOM_SLIDERS(Contrast, "Contrast ");
CREATE_CUSTOM_SLIDERS(Bright, "Brightness ");
CREATE_CUSTOM_SLIDERS(Hue, "Hue ");
CREATE_CUSTOM_SLIDERS(Satur, "Saturation ");
CREATE_CUSTOM_SLIDERS(Gamma, "Gamma ");
CREATE_CUSTOM_SLIDERS(Sharp, "Sharpness ");
CREATE_CUSTOM_SLIDERS(Res, "Resolution ");
CREATE_CUSTOM_SLIDERS(Artifacts, "Artifacts ");
CREATE_CUSTOM_SLIDERS(Fringe, "Fringing ");
CREATE_CUSTOM_SLIDERS(Bleed, "Bleeding ");
CREATE_CUSTOM_SLIDERS(Contrast, "Contrast ")
CREATE_CUSTOM_SLIDERS(Bright, "Brightness ")
CREATE_CUSTOM_SLIDERS(Hue, "Hue ")
CREATE_CUSTOM_SLIDERS(Satur, "Saturation ")
CREATE_CUSTOM_SLIDERS(Gamma, "Gamma ")
CREATE_CUSTOM_SLIDERS(Sharp, "Sharpness ")
CREATE_CUSTOM_SLIDERS(Res, "Resolution ")
CREATE_CUSTOM_SLIDERS(Artifacts, "Artifacts ")
CREATE_CUSTOM_SLIDERS(Fringe, "Fringing ")
CREATE_CUSTOM_SLIDERS(Bleed, "Bleeding ")
xpos += myTVContrast->getWidth() + 30;
ypos = VBORDER;
@ -279,7 +279,7 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
// TV Phosphor blend level
xpos += INDENT;
swidth = font.getMaxCharWidth() * 10;
CREATE_CUSTOM_SLIDERS(PhosLevel, "Blend ");
CREATE_CUSTOM_SLIDERS(PhosLevel, "Blend ")
ypos += 6;
// Scanline intensity and interpolation
@ -288,7 +288,7 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
ypos += lineHeight;
xpos += INDENT;
CREATE_CUSTOM_SLIDERS(ScanIntense, "Intensity ");
CREATE_CUSTOM_SLIDERS(ScanIntense, "Intensity ")
myTVScanInterpolate = new CheckboxWidget(myTab, font, xpos, ypos, "Interpolation");
wid.push_back(myTVScanInterpolate);
@ -302,14 +302,14 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
new ButtonWidget(myTab, font, xpos, ypos, cloneWidth, buttonHeight,\
desc, kClone ## obj ##Cmd); \
wid.push_back(myClone ## obj); \
ypos += lineHeight + 4 + VGAP
ypos += lineHeight + 4 + VGAP;
ypos += VGAP;
CREATE_CLONE_BUTTON(Composite, "Clone Composite");
CREATE_CLONE_BUTTON(Svideo, "Clone S-Video");
CREATE_CLONE_BUTTON(RGB, "Clone RGB");
CREATE_CLONE_BUTTON(Bad, "Clone Bad adjust");
CREATE_CLONE_BUTTON(Custom, "Revert");
CREATE_CLONE_BUTTON(Composite, "Clone Composite")
CREATE_CLONE_BUTTON(Svideo, "Clone S-Video")
CREATE_CLONE_BUTTON(RGB, "Clone RGB")
CREATE_CLONE_BUTTON(Bad, "Clone Bad adjust")
CREATE_CLONE_BUTTON(Custom, "Revert")
// Add items for tab 2
addToFocusList(wid, myTab, tabID);