Possible fix for #170 (although I can't reproduce it)
This commit is contained in:
parent
40b5feb576
commit
126400806b
1 changed files with 35 additions and 22 deletions
|
@ -327,14 +327,17 @@ void DiskCaddy::Display()
|
||||||
for (caddyIndex = 0; caddyIndex < numberOfImages; ++caddyIndex)
|
for (caddyIndex = 0; caddyIndex < numberOfImages; ++caddyIndex)
|
||||||
{
|
{
|
||||||
DiskImage* image = GetImage(caddyIndex);
|
DiskImage* image = GetImage(caddyIndex);
|
||||||
const char* name = image->GetName();
|
if (image)
|
||||||
if (name)
|
|
||||||
{
|
{
|
||||||
snprintf(buffer, 256, " ");
|
const char* name = image->GetName();
|
||||||
screen->PrintText(false, x, y, buffer, grey, greyDark);
|
if (name)
|
||||||
snprintf(buffer, 256, " %d %s", caddyIndex + 1, name);
|
{
|
||||||
screen->PrintText(false, x, y, buffer, grey, greyDark);
|
snprintf(buffer, 256, " ");
|
||||||
y += 16;
|
screen->PrintText(false, x, y, buffer, grey, greyDark);
|
||||||
|
snprintf(buffer, 256, " %d %s", caddyIndex + 1, name);
|
||||||
|
screen->PrintText(false, x, y, buffer, grey, greyDark);
|
||||||
|
y += 16;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -346,6 +349,10 @@ void DiskCaddy::ShowSelectedImage(u32 index)
|
||||||
{
|
{
|
||||||
DiskImage* image = GetImage(index);
|
DiskImage* image = GetImage(index);
|
||||||
|
|
||||||
|
if (image == 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
u32 x;
|
u32 x;
|
||||||
u32 y;
|
u32 y;
|
||||||
#if not defined(EXPERIMENTALZERO)
|
#if not defined(EXPERIMENTALZERO)
|
||||||
|
@ -398,17 +405,20 @@ void DiskCaddy::ShowSelectedImage(u32 index)
|
||||||
for (; caddyIndex < numberOfImages; ++caddyIndex)
|
for (; caddyIndex < numberOfImages; ++caddyIndex)
|
||||||
{
|
{
|
||||||
DiskImage* image = GetImage(caddyIndex);
|
DiskImage* image = GetImage(caddyIndex);
|
||||||
const char* name = image->GetName();
|
if (image)
|
||||||
if (name)
|
|
||||||
{
|
{
|
||||||
memset(buffer, ' ', screenLCD->Width()/screenLCD->GetFontWidth());
|
const char* name = image->GetName();
|
||||||
screenLCD->PrintText(false, x, y, buffer, BkColour, BkColour);
|
if (name)
|
||||||
snprintf(buffer, 256, "%d %s", caddyIndex + 1, name);
|
{
|
||||||
screenLCD->PrintText(false, x, y, buffer, 0, caddyIndex == index ? RGBA(0xff, 0xff, 0xff, 0xff) : BkColour);
|
memset(buffer, ' ', screenLCD->Width() / screenLCD->GetFontWidth());
|
||||||
y += screenLCD->GetFontHeight();
|
screenLCD->PrintText(false, x, y, buffer, BkColour, BkColour);
|
||||||
|
snprintf(buffer, 256, "%d %s", caddyIndex + 1, name);
|
||||||
|
screenLCD->PrintText(false, x, y, buffer, 0, caddyIndex == index ? RGBA(0xff, 0xff, 0xff, 0xff) : BkColour);
|
||||||
|
y += screenLCD->GetFontHeight();
|
||||||
|
}
|
||||||
|
if (y >= screenLCD->Height())
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (y >= screenLCD->Height())
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
while (y < screenLCD->Height()) {
|
while (y < screenLCD->Height()) {
|
||||||
memset(buffer, ' ', screenLCD->Width()/screenLCD->GetFontWidth());
|
memset(buffer, ' ', screenLCD->Width()/screenLCD->GetFontWidth());
|
||||||
|
@ -432,13 +442,16 @@ bool DiskCaddy::Update()
|
||||||
x = screen->ScaleX(screenPosXCaddySelections);
|
x = screen->ScaleX(screenPosXCaddySelections);
|
||||||
y = screen->ScaleY(screenPosYCaddySelections) + 16 + 16 * oldCaddyIndex;
|
y = screen->ScaleY(screenPosYCaddySelections) + 16 + 16 * oldCaddyIndex;
|
||||||
DiskImage* image = GetImage(oldCaddyIndex);
|
DiskImage* image = GetImage(oldCaddyIndex);
|
||||||
const char* name = image->GetName();
|
if (image)
|
||||||
if (name)
|
|
||||||
{
|
{
|
||||||
snprintf(buffer, 256, " ");
|
const char* name = image->GetName();
|
||||||
screen->PrintText(false, x, y, buffer, grey, greyDark);
|
if (name)
|
||||||
snprintf(buffer, 256, " %d %s", oldCaddyIndex + 1, name);
|
{
|
||||||
screen->PrintText(false, x, y, buffer, grey, greyDark);
|
snprintf(buffer, 256, " ");
|
||||||
|
screen->PrintText(false, x, y, buffer, grey, greyDark);
|
||||||
|
snprintf(buffer, 256, " %d %s", oldCaddyIndex + 1, name);
|
||||||
|
screen->PrintText(false, x, y, buffer, grey, greyDark);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue