diff --git a/src/debugger/gui/CartBUSInfoWidget.cxx b/src/debugger/gui/CartBUSInfoWidget.cxx index 18958c3ef..ce7730057 100644 --- a/src/debugger/gui/CartBUSInfoWidget.cxx +++ b/src/debugger/gui/CartBUSInfoWidget.cxx @@ -25,7 +25,7 @@ CartridgeBUSInfoWidget::CartridgeBUSInfoWidget( { constexpr uInt16 size = 8 * 4096; ostringstream info; - + if (cart.myBUSSubtype == CartridgeBUS::BUSSubtype::BUS0) { info << "BUS Stuffing cartridge (EXPERIMENTAL)\n" @@ -67,7 +67,7 @@ string CartridgeBUSInfoWidget::describeBUSVersion(CartridgeBUS::BUSSubtype subty { case CartridgeBUS::BUSSubtype::BUS0: return "BUS (v0)"; - + case CartridgeBUS::BUSSubtype::BUS1: return "BUS (v1)"; diff --git a/src/debugger/gui/CartBUSWidget.cxx b/src/debugger/gui/CartBUSWidget.cxx index 456b78899..45ed3062a 100644 --- a/src/debugger/gui/CartBUSWidget.cxx +++ b/src/debugger/gui/CartBUSWidget.cxx @@ -34,8 +34,8 @@ CartridgeBUSWidget::CartridgeBUSWidget( VGAP = 4; int xpos = HBORDER, ypos = VBORDER; - int ds2_rows; - + int ds2_rows = 0; + // if (cart.myBUSSubtype == CartridgeBUS::BUSSubtype::BUS0) // { // int lwidth = _font.getStringWidth("Unsupported version of BUS"); // get width of the widest label @@ -43,7 +43,7 @@ CartridgeBUSWidget::CartridgeBUSWidget( // myFontHeight, "Unsupported version of BUS", TextAlign::Left); // return; // } - + if (cart.myBUSSubtype == CartridgeBUS::BUSSubtype::BUS3) { ds2_rows = 2; @@ -54,7 +54,7 @@ CartridgeBUSWidget::CartridgeBUSWidget( ds2_rows = 4; myDatastreamCount = 20; } - + VariantList items; if (cart.myBUSSubtype == CartridgeBUS::BUSSubtype::BUS0) { @@ -108,7 +108,7 @@ CartridgeBUSWidget::CartridgeBUSWidget( myFontWidth*2, myFontHeight, "", TextAlign::Left); myDatastreamLabels[row]->setLabel(Common::Base::toString(row * 4, Common::Base::Fmt::_16_2)); } - + if (cart.myBUSSubtype == CartridgeBUS::BUSSubtype::BUS3) { lwidth = _font.getStringWidth("Write Data (stream 16)"); @@ -141,7 +141,7 @@ CartridgeBUSWidget::CartridgeBUSWidget( ypos+myLineHeight-2 + 7*myLineHeight + 2, lwidth, myFontHeight, "Write Data 3(stream 19)", TextAlign::Left); } - + // Datastream Increments xpos = DS_X + myDatastreamPointers->getWidth() + INDENT; new StaticTextWidget(boss, _font, xpos, ypos, lwidth, @@ -296,7 +296,7 @@ void CartridgeBUSWidget::loadConfig() { // if (myCart.myBUSSubtype == CartridgeBUS::BUSSubtype::BUS0) // return; - + myBank->setSelectedIndex(myCart.getBank()); // Get registers, using change tracking @@ -397,7 +397,6 @@ void CartridgeBUSWidget::loadConfig() } myMusicWaveformSizes->setList(alist, vlist, changed); - if (myCart.myBUSSubtype == CartridgeBUS::BUSSubtype::BUS3) { alist.clear(); vlist.clear(); changed.clear(); diff --git a/src/emucore/CartBUS.cxx b/src/emucore/CartBUS.cxx index fd1a8fc74..57fee6dbc 100644 --- a/src/emucore/CartBUS.cxx +++ b/src/emucore/CartBUS.cxx @@ -307,8 +307,8 @@ uInt8 CartridgeBUS::peek(uInt16 address) uInt8 result = 0; // Get the index of the data fetcher that's being accessed - uInt32 index = address & 0x0f; - uInt32 function = (address >> 4) & 0x01; + const uInt32 index = address & 0x0f; + const uInt32 function = (address >> 4) & 0x01; switch(function) { @@ -335,20 +335,28 @@ uInt8 CartridgeBUS::peek(uInt16 address) break; case 0x08: // 0x18 = AMPLITUDE + { // Update the music data fetchers (counter & flag) updateMusicModeDataFetchers(); // using myDisplayImage[] instead of myProgramImage[] because waveforms // can be modified during runtime. - uInt32 i = myDisplayImage[(getWaveform(0) ) + (myMusicCounters[0] >> myMusicWaveformSize[0])] + - myDisplayImage[(getWaveform(1) ) + (myMusicCounters[1] >> myMusicWaveformSize[1])] + - myDisplayImage[(getWaveform(2) ) + (myMusicCounters[2] >> myMusicWaveformSize[2])]; + const uInt32 i = myDisplayImage[(getWaveform(0)) + (myMusicCounters[0] >> myMusicWaveformSize[0])] + + myDisplayImage[(getWaveform(1)) + (myMusicCounters[1] >> myMusicWaveformSize[1])] + + myDisplayImage[(getWaveform(2)) + (myMusicCounters[2] >> myMusicWaveformSize[2])]; - result = uInt8(i); + result = static_cast(i); + break; + } + + default: break; } break; } + + default: + break; } return result; @@ -402,6 +410,9 @@ uInt8 CartridgeBUS::peek(uInt16 address) case 0xFF3: // CALLFN // these are write-only break; + + default: + break; } } else if (myBUSSubtype == BUSSubtype::BUS0) @@ -762,6 +773,9 @@ bool CartridgeBUS::poke(uInt16 address, uInt8 value) case 0x0A: // 0x1A CALLFUNCTION callFunction(value); break; + + default: + break; } } } @@ -1142,9 +1156,8 @@ void CartridgeBUS::setupVersion() // 3 versions of the BUS driver have been found. Location of the BUS // strings are in a different location for each. - // get offset of BUS ID - uInt32 busOffset = scanBUSDriver(0x00535542); + const uInt32 busOffset = scanBUSDriver(0x00535542); switch(busOffset) { diff --git a/src/windows/FSNodeWINDOWS.cxx b/src/windows/FSNodeWINDOWS.cxx index 1bbfb1fd1..762e30a03 100644 --- a/src/windows/FSNodeWINDOWS.cxx +++ b/src/windows/FSNodeWINDOWS.cxx @@ -191,7 +191,7 @@ bool FilesystemNodeWINDOWS:: current_drive += _tcslen(current_drive) + 1) { FilesystemNodeWINDOWS entry; - char drive_name[2]; + char drive_name[2] = { 0, 0 }; drive_name[0] = toAscii(current_drive)[0]; drive_name[1] = '\0'; diff --git a/src/windows/Stella.vcxproj b/src/windows/Stella.vcxproj index a2155a635..a25f501d4 100755 --- a/src/windows/Stella.vcxproj +++ b/src/windows/Stella.vcxproj @@ -711,6 +711,7 @@ true + true @@ -1893,6 +1894,7 @@ true + true diff --git a/src/windows/Stella.vcxproj.filters b/src/windows/Stella.vcxproj.filters index 1dc18aee7..27088d7c7 100644 --- a/src/windows/Stella.vcxproj.filters +++ b/src/windows/Stella.vcxproj.filters @@ -1137,6 +1137,9 @@ Source Files\debugger + + Source Files\debugger + @@ -2354,6 +2357,9 @@ Header Files\debugger + + Header Files\debugger +