Each disk write back is now displayed on screen(s) when modified images are unmounted.
This commit is contained in:
parent
a838a57a5f
commit
3e83a57349
4 changed files with 70 additions and 10 deletions
|
@ -32,6 +32,69 @@ static char buffer[256] = { 0 };
|
||||||
static u32 white = RGBA(0xff, 0xff, 0xff, 0xff);
|
static u32 white = RGBA(0xff, 0xff, 0xff, 0xff);
|
||||||
static u32 red = RGBA(0xff, 0, 0, 0xff);
|
static u32 red = RGBA(0xff, 0, 0, 0xff);
|
||||||
|
|
||||||
|
void DiskCaddy::Empty()
|
||||||
|
{
|
||||||
|
int x;
|
||||||
|
int y;
|
||||||
|
int index;
|
||||||
|
for (index = 0; index < (int)disks.size(); ++index)
|
||||||
|
{
|
||||||
|
if (disks[index].IsDirty())
|
||||||
|
{
|
||||||
|
if (screen)
|
||||||
|
{
|
||||||
|
x = screen->ScaleX(screenPosXCaddySelections);
|
||||||
|
y = screen->ScaleY(screenPosYCaddySelections);
|
||||||
|
|
||||||
|
snprintf(buffer, 256, "Saving %s\r\n", disks[index].GetName());
|
||||||
|
screen->PrintText(false, x, y, buffer, RGBA(0xff, 0xff, 0xff, 0xff), red);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (screenLCD)
|
||||||
|
{
|
||||||
|
RGBA BkColour = RGBA(0, 0, 0, 0xFF);
|
||||||
|
screenLCD->Clear(BkColour);
|
||||||
|
x = 0;
|
||||||
|
y = 0;
|
||||||
|
|
||||||
|
snprintf(buffer, 256, "Saving");
|
||||||
|
screenLCD->PrintText(false, x, y, buffer, RGBA(0xff, 0xff, 0xff, 0xff), BkColour);
|
||||||
|
y += 16;
|
||||||
|
snprintf(buffer, 256, "%s ", disks[index].GetName());
|
||||||
|
screenLCD->PrintText(false, x, y, buffer, RGBA(0xff, 0xff, 0xff, 0xff), red);
|
||||||
|
screenLCD->SwapBuffers();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
disks[index].Close();
|
||||||
|
}
|
||||||
|
if (screen)
|
||||||
|
{
|
||||||
|
x = screen->ScaleX(screenPosXCaddySelections);
|
||||||
|
y = screen->ScaleY(screenPosYCaddySelections);
|
||||||
|
|
||||||
|
snprintf(buffer, 256, "Saving Complete \r\n");
|
||||||
|
screen->PrintText(false, x, y, buffer, RGBA(0xff, 0xff, 0xff, 0xff), red);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (screenLCD)
|
||||||
|
{
|
||||||
|
RGBA BkColour = RGBA(0, 0, 0, 0xFF);
|
||||||
|
screenLCD->Clear(BkColour);
|
||||||
|
x = 0;
|
||||||
|
y = 0;
|
||||||
|
|
||||||
|
snprintf(buffer, 256, "Saving");
|
||||||
|
screenLCD->PrintText(false, x, y, buffer, RGBA(0xff, 0xff, 0xff, 0xff), BkColour);
|
||||||
|
y += 16;
|
||||||
|
snprintf(buffer, 256, "Complete ");
|
||||||
|
screenLCD->PrintText(false, x, y, buffer, RGBA(0xff, 0xff, 0xff, 0xff), red);
|
||||||
|
screenLCD->SwapBuffers();
|
||||||
|
}
|
||||||
|
|
||||||
|
disks.clear();
|
||||||
|
selectedIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
bool DiskCaddy::Insert(const FILINFO* fileInfo, bool readOnly)
|
bool DiskCaddy::Insert(const FILINFO* fileInfo, bool readOnly)
|
||||||
{
|
{
|
||||||
int x;
|
int x;
|
||||||
|
|
|
@ -35,16 +35,7 @@ public:
|
||||||
|
|
||||||
void SetScreen(Screen* screen, ScreenBase* screenLCD) { this->screen = screen; this->screenLCD = screenLCD; }
|
void SetScreen(Screen* screen, ScreenBase* screenLCD) { this->screen = screen; this->screenLCD = screenLCD; }
|
||||||
|
|
||||||
void Empty()
|
void Empty();
|
||||||
{
|
|
||||||
int index;
|
|
||||||
for (index = 0; index < (int)disks.size(); ++index)
|
|
||||||
{
|
|
||||||
disks[index].Close();
|
|
||||||
}
|
|
||||||
disks.clear();
|
|
||||||
selectedIndex = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Insert(const FILINFO* fileInfo, bool readOnly);
|
bool Insert(const FILINFO* fileInfo, bool readOnly);
|
||||||
|
|
||||||
|
|
|
@ -113,6 +113,8 @@ public:
|
||||||
|
|
||||||
unsigned LastTrackUsed();
|
unsigned LastTrackUsed();
|
||||||
|
|
||||||
|
bool IsDirty() const { return dirty; }
|
||||||
|
|
||||||
static unsigned char readBuffer[READBUFFER_SIZE];
|
static unsigned char readBuffer[READBUFFER_SIZE];
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -868,6 +868,10 @@ void emulator()
|
||||||
// - TDOO: need to display the image names as they write back
|
// - TDOO: need to display the image names as they write back
|
||||||
// - pass in a call back function?
|
// - pass in a call back function?
|
||||||
diskCaddy.Empty();
|
diskCaddy.Empty();
|
||||||
|
IEC_Bus::WaitMicroSeconds(2 * 1000000);
|
||||||
|
|
||||||
|
fileBrowser->ClearSelections();
|
||||||
|
fileBrowser->RefeshDisplay(); // Just redisplay the current folder.
|
||||||
|
|
||||||
IEC_Bus::WaitUntilReset();
|
IEC_Bus::WaitUntilReset();
|
||||||
//DEBUG_LOG("6502 resetting\r\n");
|
//DEBUG_LOG("6502 resetting\r\n");
|
||||||
|
|
Loading…
Reference in a new issue