Fixed graphical corruption on the HDMI screen after disk image write back

This commit is contained in:
Stephen White 2019-12-27 15:27:32 +11:00
parent a4379326be
commit 7437e9e16c
3 changed files with 32 additions and 15 deletions

View file

@ -43,6 +43,11 @@ bool DiskCaddy::Empty()
int index;
bool anyDirty = false;
#if not defined(EXPERIMENTALZERO)
if (screen)
screen->Clear(RGBA(0x40, 0x31, 0x8D, 0xFF));
#endif
for (index = 0; index < (int)disks.size(); ++index)
{
if (disks[index]->IsDirty())
@ -54,7 +59,7 @@ bool DiskCaddy::Empty()
x = screen->ScaleX(screenPosXCaddySelections);
y = screen->ScaleY(screenPosYCaddySelections);
snprintf(buffer, 256, "Saving %s\r\n", disks[index]->GetName());
snprintf(buffer, 256, "Saving %s", disks[index]->GetName());
screen->PrintText(false, x, y, buffer, RGBA(0xff, 0xff, 0xff, 0xff), red);
}
#endif
@ -85,7 +90,7 @@ bool DiskCaddy::Empty()
x = screen->ScaleX(screenPosXCaddySelections);
y = screen->ScaleY(screenPosYCaddySelections);
snprintf(buffer, 256, "Saving Complete \r\n");
snprintf(buffer, 256, " Saving Complete ");
screen->PrintText(false, x, y, buffer, RGBA(0xff, 0xff, 0xff, 0xff), red);
}
#endif
@ -107,6 +112,7 @@ bool DiskCaddy::Empty()
disks.clear();
selectedIndex = 0;
oldCaddyIndex = 0;
return anyDirty;
}
@ -125,10 +131,10 @@ bool DiskCaddy::Insert(const FILINFO* fileInfo, bool readOnly)
x = screen->ScaleX(screenPosXCaddySelections);
y = screen->ScaleY(screenPosYCaddySelections);
snprintf(buffer, 256, " \r\n");
snprintf(buffer, 256, " ");
screen->PrintText(false, x, y, buffer, RGBA(0xff, 0xff, 0xff, 0xff), red);
snprintf(buffer, 256, "Loading %s\r\n", fileInfo->fname);
snprintf(buffer, 256, "Loading %s", fileInfo->fname);
screen->PrintText(false, x, y, buffer, RGBA(0xff, 0xff, 0xff, 0xff), red);
}
#endif
@ -293,9 +299,9 @@ void DiskCaddy::Display()
x = screen->ScaleX(screenPosXCaddySelections);
y = screen->ScaleY(screenPosYCaddySelections);
snprintf(buffer, 256, " \r\n");
snprintf(buffer, 256, " ");
screen->PrintText(false, x, y, buffer, RGBA(0xff, 0xff, 0xff, 0xff), redDark);
snprintf(buffer, 256, " Emulating\r\n");
snprintf(buffer, 256, " Emulating");
screen->PrintText(false, x, y, buffer, RGBA(0xff, 0xff, 0xff, 0xff), redDark);
y += 16;
@ -305,7 +311,7 @@ void DiskCaddy::Display()
const char* name = image->GetName();
if (name)
{
snprintf(buffer, 256, " \r\n");
snprintf(buffer, 256, " ");
screen->PrintText(false, x, y, buffer, grey, greyDark);
snprintf(buffer, 256, " %d %s", caddyIndex + 1, name);
screen->PrintText(false, x, y, buffer, grey, greyDark);
@ -407,7 +413,7 @@ bool DiskCaddy::Update()
const char* name = image->GetName();
if (name)
{
snprintf(buffer, 256, " \r\n");
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);

View file

@ -553,6 +553,9 @@ FileBrowser::FileBrowser(InputMappings* inputMappings, DiskCaddy* diskCaddy, ROM
folder.AddView(screenLCD, inputMappings, columns, rows, positionX, positionY, true);
}
f_chdir("/1541");
RefreshFolderEntries();
}
u32 FileBrowser::Colour(int index)

View file

@ -596,7 +596,13 @@ void UpdateScreen()
if (emulating != IEC_COMMANDS)
{
//refreshUartStatusDisplay =
#if not defined(EXPERIMENTALZERO)
core0RefreshingScreen.Acquire();
#endif
diskCaddy.Update();
#if not defined(EXPERIMENTALZERO)
core0RefreshingScreen.Release();
#endif
}
//if (options.GetSupportUARTInput())
@ -1172,7 +1178,6 @@ void emulator()
diskCaddy.SetScreen(&screen, screenLCD);
fileBrowser = new FileBrowser(inputMappings, &diskCaddy, &roms, &deviceID, options.DisplayPNGIcons(), &screen, screenLCD, options.ScrollHighlightRate());
fileBrowser->DisplayRoot();
pi1541.Initialise();
m_IEC_Commands.SetAutoBootFB128(options.AutoBootFB128());
@ -1283,7 +1288,6 @@ void emulator()
break;
case IEC_Commands::POP_DIR:
fileBrowser->PopFolder();
fileBrowser->RefeshDisplay();
break;
case IEC_Commands::POP_TO_ROOT:
fileBrowser->DisplayRoot();
@ -1329,19 +1333,23 @@ void emulator()
// Clearing the caddy now
// - will write back all changed/dirty/written to disk images now
// - TDOO: need to display the image names as they write back
// - pass in a call back function?
#if not defined(EXPERIMENTALZERO)
core0RefreshingScreen.Acquire();
#endif
if (diskCaddy.Empty())
IEC_Bus::WaitMicroSeconds(2 * 1000000);
IEC_Bus::WaitUntilReset();
//DEBUG_LOG("6502 resetting\r\n");
emulating = IEC_COMMANDS;
if ((exitReason == EXIT_RESET) && (options.GetOnResetChangeToStartingFolder() || selectedViaIECCommands))
fileBrowser->DisplayRoot(); // TO CHECK
inputMappings->WaitForClearButtons();
#if not defined(EXPERIMENTALZERO)
core0RefreshingScreen.Release();
#endif
}
}
delete fileBrowser;