diff --git a/src/DiskCaddy.cpp b/src/DiskCaddy.cpp index 1815e72..906e2ae 100644 --- a/src/DiskCaddy.cpp +++ b/src/DiskCaddy.cpp @@ -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); diff --git a/src/FileBrowser.cpp b/src/FileBrowser.cpp index b74424d..05db08b 100644 --- a/src/FileBrowser.cpp +++ b/src/FileBrowser.cpp @@ -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) diff --git a/src/main.cpp b/src/main.cpp index 719c2a2..7cac8a7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -596,7 +596,13 @@ void UpdateScreen() if (emulating != IEC_COMMANDS) { //refreshUartStatusDisplay = - diskCaddy.Update(); +#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;