Update Visual Studio for new BUS class, and fix some minor warnings.

This commit is contained in:
Stephen Anthony 2022-06-11 21:27:36 -02:30
parent 0445a20e13
commit 397dc102ac
6 changed files with 39 additions and 19 deletions

View File

@ -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)";

View File

@ -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();

View File

@ -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<uInt8>(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)
{

View File

@ -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';

View File

@ -711,6 +711,7 @@
<ClCompile Include="..\debugger\gui\CartBFWidget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\debugger\gui\CartBUSInfoWidget.cxx" />
<ClCompile Include="..\debugger\gui\CartBUSWidget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
@ -1893,6 +1894,7 @@
<ClInclude Include="..\debugger\gui\CartBFWidget.hxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="..\debugger\gui\CartBUSInfoWidget.hxx" />
<ClInclude Include="..\debugger\gui\CartBUSWidget.hxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClInclude>

View File

@ -1137,6 +1137,9 @@
<ClCompile Include="..\debugger\gui\Cart0FA0Widget.cxx">
<Filter>Source Files\debugger</Filter>
</ClCompile>
<ClCompile Include="..\debugger\gui\CartBUSInfoWidget.cxx">
<Filter>Source Files\debugger</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\common\bspf.hxx">
@ -2354,6 +2357,9 @@
<ClInclude Include="..\debugger\gui\Cart0FA0Widget.hxx">
<Filter>Header Files\debugger</Filter>
</ClInclude>
<ClInclude Include="..\debugger\gui\CartBUSInfoWidget.hxx">
<Filter>Header Files\debugger</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="stella.ico">