OLED support added

OLED support added back in with extra update call to refresh the display on single core devices.
New macro added to allow 1581 tests in the Pi Zero experimental build.
This commit is contained in:
Alexander Martinelle 2019-09-21 17:24:09 +02:00
parent 9b38fc6d32
commit 58be6a8079
8 changed files with 58 additions and 81 deletions

View file

@ -53,7 +53,7 @@ bool DiskCaddy::Empty()
snprintf(buffer, 256, "Saving %s\r\n", disks[index].GetName()); snprintf(buffer, 256, "Saving %s\r\n", disks[index].GetName());
screen->PrintText(false, x, y, buffer, RGBA(0xff, 0xff, 0xff, 0xff), red); screen->PrintText(false, x, y, buffer, RGBA(0xff, 0xff, 0xff, 0xff), red);
} }
#endif
if (screenLCD) if (screenLCD)
{ {
RGBA BkColour = RGBA(0, 0, 0, 0xFF); RGBA BkColour = RGBA(0, 0, 0, 0xFF);
@ -68,7 +68,6 @@ bool DiskCaddy::Empty()
screenLCD->PrintText(false, x, y, buffer, RGBA(0xff, 0xff, 0xff, 0xff), red); screenLCD->PrintText(false, x, y, buffer, RGBA(0xff, 0xff, 0xff, 0xff), red);
screenLCD->SwapBuffers(); screenLCD->SwapBuffers();
} }
#endif
} }
disks[index].Close(); disks[index].Close();
} }
@ -84,7 +83,7 @@ bool DiskCaddy::Empty()
snprintf(buffer, 256, "Saving Complete \r\n"); snprintf(buffer, 256, "Saving Complete \r\n");
screen->PrintText(false, x, y, buffer, RGBA(0xff, 0xff, 0xff, 0xff), red); screen->PrintText(false, x, y, buffer, RGBA(0xff, 0xff, 0xff, 0xff), red);
} }
#endif
if (screenLCD) if (screenLCD)
{ {
RGBA BkColour = RGBA(0, 0, 0, 0xFF); RGBA BkColour = RGBA(0, 0, 0, 0xFF);
@ -99,7 +98,6 @@ bool DiskCaddy::Empty()
screenLCD->PrintText(false, x, y, buffer, RGBA(0xff, 0xff, 0xff, 0xff), red); screenLCD->PrintText(false, x, y, buffer, RGBA(0xff, 0xff, 0xff, 0xff), red);
screenLCD->SwapBuffers(); screenLCD->SwapBuffers();
} }
#endif
} }
disks.clear(); disks.clear();
@ -125,6 +123,7 @@ bool DiskCaddy::Insert(const FILINFO* fileInfo, bool readOnly)
snprintf(buffer, 256, "Loading %s\r\n", fileInfo->fname); snprintf(buffer, 256, "Loading %s\r\n", fileInfo->fname);
screen->PrintText(false, x, y, buffer, RGBA(0xff, 0xff, 0xff, 0xff), red); screen->PrintText(false, x, y, buffer, RGBA(0xff, 0xff, 0xff, 0xff), red);
} }
#endif
if (screenLCD) if (screenLCD)
{ {
@ -140,7 +139,6 @@ bool DiskCaddy::Insert(const FILINFO* fileInfo, bool readOnly)
screenLCD->PrintText(false, x, y, buffer, RGBA(0xff, 0xff, 0xff, 0xff), red); screenLCD->PrintText(false, x, y, buffer, RGBA(0xff, 0xff, 0xff, 0xff), red);
screenLCD->SwapBuffers(); screenLCD->SwapBuffers();
} }
#endif
u32 bytesRead; u32 bytesRead;
SetACTLed(true); SetACTLed(true);
f_read(&fp, DiskImage::readBuffer, READBUFFER_SIZE, &bytesRead); f_read(&fp, DiskImage::readBuffer, READBUFFER_SIZE, &bytesRead);
@ -303,6 +301,8 @@ void DiskCaddy::ShowSelectedImage(u32 index)
snprintf(buffer, 256, "*"); snprintf(buffer, 256, "*");
screen->PrintText(false, x, y, buffer, white, red); screen->PrintText(false, x, y, buffer, white, red);
} }
#endif
if (screenLCD) if (screenLCD)
{ {
unsigned numberOfImages = GetNumberOfImages(); unsigned numberOfImages = GetNumberOfImages();
@ -351,7 +351,6 @@ void DiskCaddy::ShowSelectedImage(u32 index)
} }
screenLCD->SwapBuffers(); screenLCD->SwapBuffers();
} }
#endif
} }
bool DiskCaddy::Update() bool DiskCaddy::Update()
@ -368,15 +367,16 @@ bool DiskCaddy::Update()
y = screen->ScaleY(screenPosYCaddySelections) + 16 + 16 * oldCaddyIndex; y = screen->ScaleY(screenPosYCaddySelections) + 16 + 16 * oldCaddyIndex;
snprintf(buffer, 256, " "); snprintf(buffer, 256, " ");
screen->PrintText(false, x, y, buffer, red, red); screen->PrintText(false, x, y, buffer, red, red);
}
#endif
oldCaddyIndex = caddyIndex; oldCaddyIndex = caddyIndex;
ShowSelectedImage(oldCaddyIndex); ShowSelectedImage(oldCaddyIndex);
}
if (screenLCD) if (screenLCD)
{ {
} }
#endif
return true; return true;
} }
return false; return false;

View file

@ -30,15 +30,17 @@ public:
: selectedIndex(0) : selectedIndex(0)
#if not defined(EXPERIMENTALZERO) #if not defined(EXPERIMENTALZERO)
, screen(0) , screen(0)
, screenLCD(0)
#endif #endif
, screenLCD(0)
{ {
} }
#if defined(EXPERIMENTALZERO) void SetScreen(Screen* screen, ScreenBase* screenLCD)
void SetScreen() { } {
#else #if not defined(EXPERIMENTALZERO)
void SetScreen(Screen* screen, ScreenBase* screenLCD) { this->screen = screen; this->screenLCD = screenLCD; } this->screen = screen;
#endif #endif
this->screenLCD = screenLCD;
}
bool Empty(); bool Empty();
@ -46,6 +48,9 @@ public:
DiskImage* GetCurrentDisk() DiskImage* GetCurrentDisk()
{ {
#if defined(EXPERIMENTALZERO)
Update();
#endif
if (selectedIndex < disks.size()) if (selectedIndex < disks.size())
return &disks[selectedIndex]; return &disks[selectedIndex];
@ -55,6 +60,7 @@ public:
DiskImage* NextDisk() DiskImage* NextDisk()
{ {
selectedIndex = (selectedIndex + 1) % (u32)disks.size(); selectedIndex = (selectedIndex + 1) % (u32)disks.size();
auto ret = GetCurrentDisk();
return GetCurrentDisk(); return GetCurrentDisk();
} }
@ -108,8 +114,8 @@ private:
u32 oldCaddyIndex; u32 oldCaddyIndex;
#if not defined(EXPERIMENTALZERO) #if not defined(EXPERIMENTALZERO)
ScreenBase* screen; ScreenBase* screen;
ScreenBase* screenLCD;
#endif #endif
ScreenBase* screenLCD;
}; };
#endif #endif

View file

@ -82,7 +82,6 @@ void FileBrowser::BrowsableListView::RefreshLine(u32 entryIndex, u32 x, u32 y, b
if (entryIndex < list->entries.size()) if (entryIndex < list->entries.size())
{ {
FileBrowser::BrowsableList::Entry* entry = &list->entries[entryIndex]; FileBrowser::BrowsableList::Entry* entry = &list->entries[entryIndex];
#if not defined(EXPERIMENTALZERO)
if (screen->IsLCD()) if (screen->IsLCD())
{ {
// pre-clear line on OLED // pre-clear line on OLED
@ -112,10 +111,8 @@ void FileBrowser::BrowsableListView::RefreshLine(u32 entryIndex, u32 x, u32 y, b
{ {
snprintf(buffer2, 256, "%s", entry->filImage.fname); snprintf(buffer2, 256, "%s", entry->filImage.fname);
} }
#endif
int len = strlen(buffer2 + highlightScrollOffset); int len = strlen(buffer2 + highlightScrollOffset);
strncpy(buffer1, buffer2 + highlightScrollOffset, sizeof(buffer1)); strncpy(buffer1, buffer2 + highlightScrollOffset, sizeof(buffer1));
#if not defined(EXPERIMENTALZERO)
if (!screen->IsLCD()) if (!screen->IsLCD())
{ {
// space pad the remainder of the line (but not on OLED) // space pad the remainder of the line (but not on OLED)
@ -123,56 +120,44 @@ void FileBrowser::BrowsableListView::RefreshLine(u32 entryIndex, u32 x, u32 y, b
buffer1[len++] = ' '; buffer1[len++] = ' ';
buffer1[columnsMax] = 0; buffer1[columnsMax] = 0;
} }
#endif
if (selected) if (selected)
{ {
if (entry->filImage.fattrib & AM_DIR) if (entry->filImage.fattrib & AM_DIR)
{ {
#if not defined(EXPERIMENTALZERO)
screen->PrintText(false, x, y, buffer1, palette[VIC2_COLOUR_INDEX_LBLUE], RGBA(0xff, 0xff, 0xff, 0xff)); screen->PrintText(false, x, y, buffer1, palette[VIC2_COLOUR_INDEX_LBLUE], RGBA(0xff, 0xff, 0xff, 0xff));
#endif
} }
else else
{ {
colour = RGBA(0xff, 0, 0, 0xff); colour = RGBA(0xff, 0, 0, 0xff);
if (entry->filImage.fattrib & AM_RDO) if (entry->filImage.fattrib & AM_RDO)
colour = palette[VIC2_COLOUR_INDEX_RED]; colour = palette[VIC2_COLOUR_INDEX_RED];
#if not defined(EXPERIMENTALZERO)
screen->PrintText(false, x, y, buffer1, colour, RGBA(0xff, 0xff, 0xff, 0xff)); screen->PrintText(false, x, y, buffer1, colour, RGBA(0xff, 0xff, 0xff, 0xff));
#endif
} }
} }
else else
{ {
if (entry->filImage.fattrib & AM_DIR) if (entry->filImage.fattrib & AM_DIR)
{ {
#if not defined(EXPERIMENTALZERO)
screen->PrintText(false, x, y, buffer1, palette[VIC2_COLOUR_INDEX_LBLUE], BkColour); screen->PrintText(false, x, y, buffer1, palette[VIC2_COLOUR_INDEX_LBLUE], BkColour);
#endif
} }
else else
{ {
colour = palette[VIC2_COLOUR_INDEX_LGREY]; colour = palette[VIC2_COLOUR_INDEX_LGREY];
if (entry->filImage.fattrib & AM_RDO) if (entry->filImage.fattrib & AM_RDO)
colour = palette[VIC2_COLOUR_INDEX_PINK]; colour = palette[VIC2_COLOUR_INDEX_PINK];
#if not defined(EXPERIMENTALZERO)
screen->PrintText(false, x, y, buffer1, colour, BkColour); screen->PrintText(false, x, y, buffer1, colour, BkColour);
#endif
} }
} }
} }
else // line is blank, write spaces else // line is blank, write spaces
{ {
memset(buffer1, ' ', columnsMax); memset(buffer1, ' ', columnsMax);
#if not defined(EXPERIMENTALZERO)
screen->PrintText(false, x, y, buffer1, BkColour, BkColour); screen->PrintText(false, x, y, buffer1, BkColour, BkColour);
#endif
} }
} }
void FileBrowser::BrowsableListView::Refresh() void FileBrowser::BrowsableListView::Refresh()
{ {
#if not defined(EXPERIMENTALZERO)
u32 index; u32 index;
u32 entryIndex; u32 entryIndex;
u32 x = positionX; u32 x = positionX;
@ -197,7 +182,6 @@ void FileBrowser::BrowsableListView::Refresh()
} }
screen->SwapBuffers(); screen->SwapBuffers();
#endif
} }
void FileBrowser::BrowsableListView::RefreshHighlightScroll() void FileBrowser::BrowsableListView::RefreshHighlightScroll()
@ -205,7 +189,6 @@ void FileBrowser::BrowsableListView::RefreshHighlightScroll()
char buffer2[256] = { 0 }; char buffer2[256] = { 0 };
FileBrowser::BrowsableList::Entry* entry = list->current; FileBrowser::BrowsableList::Entry* entry = list->current;
#if not defined(EXPERIMENTALZERO)
if (screen->IsMonocrome()) if (screen->IsMonocrome())
{ {
if (entry->filImage.fattrib & AM_DIR) if (entry->filImage.fattrib & AM_DIR)
@ -268,7 +251,6 @@ void FileBrowser::BrowsableListView::RefreshHighlightScroll()
screen->RefreshRows(rowIndex, 1); screen->RefreshRows(rowIndex, 1);
} }
#endif
} }
bool FileBrowser::BrowsableListView::CheckBrowseNavigation(bool pageOnly) bool FileBrowser::BrowsableListView::CheckBrowseNavigation(bool pageOnly)
@ -516,11 +498,14 @@ FileBrowser::FileBrowser(InputMappings* inputMappings, DiskCaddy* diskCaddy, ROM
, displayPNGIcons(displayPNGIcons) , displayPNGIcons(displayPNGIcons)
#if not defined(EXPERIMENTALZERO) #if not defined(EXPERIMENTALZERO)
, screenMain(screenMain) , screenMain(screenMain)
, screenLCD(screenLCD)
#endif #endif
, screenLCD(screenLCD)
, scrollHighlightRate(scrollHighlightRate) , scrollHighlightRate(scrollHighlightRate)
, displayingDevices(false) , displayingDevices(false)
{ {
folder.scrollHighlightRate = scrollHighlightRate;
#if not defined(EXPERIMENTALZERO) #if not defined(EXPERIMENTALZERO)
u32 columns = screenMain->ScaleX(80); u32 columns = screenMain->ScaleX(80);
u32 rows = (int)(38.0f * screenMain->GetScaleY()); u32 rows = (int)(38.0f * screenMain->GetScaleY());
@ -530,7 +515,6 @@ FileBrowser::FileBrowser(InputMappings* inputMappings, DiskCaddy* diskCaddy, ROM
if (rows < 1) if (rows < 1)
rows = 1; rows = 1;
folder.scrollHighlightRate = scrollHighlightRate;
folder.AddView(screenMain, inputMappings, columns, rows, positionX, positionY, false); folder.AddView(screenMain, inputMappings, columns, rows, positionX, positionY, false);
positionX = screenMain->ScaleX(1024 - 320); positionX = screenMain->ScaleX(1024 - 320);
@ -538,17 +522,17 @@ FileBrowser::FileBrowser(InputMappings* inputMappings, DiskCaddy* diskCaddy, ROM
caddySelections.AddView(screenMain, inputMappings, columns, rows, positionX, positionY, false); caddySelections.AddView(screenMain, inputMappings, columns, rows, positionX, positionY, false);
#endif
if (screenLCD) if (screenLCD)
{ {
columns = screenLCD->Width() / 8; u32 columns = screenLCD->Width() / 8;
rows = screenLCD->Height() / screenLCD->GetFontHeight(); u32 rows = screenLCD->Height() / screenLCD->GetFontHeight();
positionX = 0; u32 positionX = 0;
positionY = 0; u32 positionY = 0;
folder.AddView(screenLCD, inputMappings, columns, rows, positionX, positionY, true); folder.AddView(screenLCD, inputMappings, columns, rows, positionX, positionY, true);
} }
#endif
} }
u32 FileBrowser::Colour(int index) u32 FileBrowser::Colour(int index)
@ -709,7 +693,6 @@ void FileBrowser::DeviceSwitched()
m_IEC_Commands.SetDisplayingDevices(displayingDevices); m_IEC_Commands.SetDisplayingDevices(displayingDevices);
FolderChanged(); FolderChanged();
} }
#if not defined(EXPERIMENTALZERO)
/* /*
void FileBrowser::RefeshDisplayForBrowsableList(FileBrowser::BrowsableList* browsableList, int xOffset, bool showSelected) void FileBrowser::RefeshDisplayForBrowsableList(FileBrowser::BrowsableList* browsableList, int xOffset, bool showSelected)
{ {
@ -788,7 +771,6 @@ void FileBrowser::RefeshDisplayForBrowsableList(FileBrowser::BrowsableList* brow
} }
} }
*/ */
#endif
void FileBrowser::RefeshDisplay() void FileBrowser::RefeshDisplay()
{ {
#if not defined(EXPERIMENTALZERO) #if not defined(EXPERIMENTALZERO)
@ -800,11 +782,9 @@ void FileBrowser::RefeshDisplay()
screenMain->DrawRectangle(0, 0, (int)screenMain->Width(), 17, bgColour); screenMain->DrawRectangle(0, 0, (int)screenMain->Width(), 17, bgColour);
screenMain->PrintText(false, 0, 0, buffer, textColour, bgColour); screenMain->PrintText(false, 0, 0, buffer, textColour, bgColour);
} }
#if not defined(EXPERIMENTALZERO)
//u32 offsetX = screenMain->ScaleX(1024 - 320); //u32 offsetX = screenMain->ScaleX(1024 - 320);
//RefeshDisplayForBrowsableList(&folder, 0); //RefeshDisplayForBrowsableList(&folder, 0);
//RefeshDisplayForBrowsableList(&caddySelections, offsetX, false); //RefeshDisplayForBrowsableList(&caddySelections, offsetX, false);
#endif
folder.RefreshViews(); folder.RefreshViews();
caddySelections.RefreshViews(); caddySelections.RefreshViews();
@ -816,14 +796,14 @@ void FileBrowser::RefeshDisplay()
u32 y = screenMain->ScaleY(STATUS_BAR_POSITION_Y); u32 y = screenMain->ScaleY(STATUS_BAR_POSITION_Y);
screenMain->PrintText(false, 0, y, folder.searchPrefix, textColour, bgColour); screenMain->PrintText(false, 0, y, folder.searchPrefix, textColour, bgColour);
} }
#else
folder.RefreshViews();
caddySelections.RefreshViews();
#endif #endif
} }
bool FileBrowser::CheckForPNG(const char* filename, FILINFO& filIcon) bool FileBrowser::CheckForPNG(const char* filename, FILINFO& filIcon)
{ {
#if defined(EXPERIMENTALZERO)
return false;
#else
bool foundValid = false; bool foundValid = false;
filIcon.fname[0] = 0; filIcon.fname[0] = 0;
@ -845,7 +825,6 @@ bool FileBrowser::CheckForPNG(const char* filename, FILINFO& filIcon)
} }
} }
return foundValid; return foundValid;
#endif
} }
void FileBrowser::DisplayPNG(FILINFO& filIcon, int x, int y) void FileBrowser::DisplayPNG(FILINFO& filIcon, int x, int y)
@ -1457,11 +1436,7 @@ void FileBrowser::DisplayDiskInfo(DiskImage* diskImage, const char* filenameForI
char name[17] = { 0 }; char name[17] = { 0 };
unsigned char buffer[260] = { 0 }; unsigned char buffer[260] = { 0 };
int charIndex; int charIndex;
#if defined(EXPERIMENTALZERO)
u32 fontHeight = 16;
#else
u32 fontHeight = screenMain->GetFontHeightDirectoryDisplay(); u32 fontHeight = screenMain->GetFontHeightDirectoryDisplay();
#endif
u32 x = 0; u32 x = 0;
u32 y = 0; u32 y = 0;
char bufferOut[128] = { 0 }; char bufferOut[128] = { 0 };

View file

@ -63,9 +63,7 @@ public:
BrowsableListView(BrowsableList* list, InputMappings* inputMappings, ScreenBase* screen, u32 columns, u32 rows, u32 positionX, u32 positionY, bool lcdPgUpDown) BrowsableListView(BrowsableList* list, InputMappings* inputMappings, ScreenBase* screen, u32 columns, u32 rows, u32 positionX, u32 positionY, bool lcdPgUpDown)
: list(list) : list(list)
, inputMappings(inputMappings) , inputMappings(inputMappings)
#if not defined(EXPERIMENTALZERO)
, screen(screen) , screen(screen)
#endif
, columns(columns) , columns(columns)
, rows(rows) , rows(rows)
, positionX(positionX) , positionX(positionX)
@ -86,9 +84,7 @@ public:
BrowsableList* list; BrowsableList* list;
u32 offset; u32 offset;
InputMappings* inputMappings; InputMappings* inputMappings;
#if not defined(EXPERIMENTALZERO)
ScreenBase* screen; ScreenBase* screen;
#endif
u32 columns; u32 columns;
u32 rows; u32 rows;
u32 positionX; u32 positionX;
@ -215,14 +211,10 @@ private:
void RefreshFolderEntries(); void RefreshFolderEntries();
void UpdateInputFolders(); void UpdateInputFolders();
#if not defined(EXPERIMENTALZERO)
//void UpdateInputDiskCaddy(); //void UpdateInputDiskCaddy();
#endif
void UpdateCurrentHighlight(); void UpdateCurrentHighlight();
#if not defined(EXPERIMENTALZERO)
//void RefeshDisplayForBrowsableList(FileBrowser::BrowsableList* browsableList, int xOffset, bool showSelected = true); //void RefeshDisplayForBrowsableList(FileBrowser::BrowsableList* browsableList, int xOffset, bool showSelected = true);
#endif
bool FillCaddyWithSelections(); bool FillCaddyWithSelections();
bool AddToCaddy(FileBrowser::BrowsableList::Entry* current); bool AddToCaddy(FileBrowser::BrowsableList::Entry* current);
@ -256,8 +248,8 @@ private:
BrowsableList caddySelections; BrowsableList caddySelections;
#if not defined(EXPERIMENTALZERO) #if not defined(EXPERIMENTALZERO)
ScreenBase* screenMain; ScreenBase* screenMain;
ScreenBase* screenLCD;
#endif #endif
ScreenBase* screenLCD;
float scrollHighlightRate; float scrollHighlightRate;
bool displayingDevices; bool displayingDevices;

View file

@ -106,17 +106,17 @@ public:
#if defined(EXPERIMENTALZERO) #if defined(EXPERIMENTALZERO)
inline bool Exit() inline bool Exit()
{ {
return /*KeyboardFlag(ESC_FLAG) | UartFlag(ESC_FLAG) |*/ ButtonFlag(ESC_FLAG); return ButtonFlag(ESC_FLAG);
} }
inline bool NextDisk() inline bool NextDisk()
{ {
return /*KeyboardFlag(NEXT_FLAG) | UartFlag(NEXT_FLAG) |*/ ButtonFlag(NEXT_FLAG); return ButtonFlag(NEXT_FLAG);
} }
inline bool PrevDisk() inline bool PrevDisk()
{ {
return /*KeyboardFlag(PREV_FLAG) | UartFlag(PREV_FLAG) |*/ ButtonFlag(PREV_FLAG); return ButtonFlag(PREV_FLAG);
} }
#else #else
inline bool Exit() inline bool Exit()

View file

@ -93,7 +93,7 @@ extern u16 pc;
u8 read6502_1581(u16 address) u8 read6502_1581(u16 address)
{ {
u8 value = 0; u8 value = 0;
#if not defined(EXPERIMENTALZERO) #if defined(PI1581SUPPORT)
if (address & 0x8000) if (address & 0x8000)
{ {
value = roms.Read1581(address); value = roms.Read1581(address);
@ -129,7 +129,7 @@ u8 peek6502_1581(u16 address)
void write6502_1581(u16 address, const u8 value) void write6502_1581(u16 address, const u8 value)
{ {
#if not defined(EXPERIMENTALZERO) #if defined(PI1581SUPPORT)
if (address & 0x8000) if (address & 0x8000)
{ {
return; return;

View file

@ -2,7 +2,9 @@
#define DEFS_H #define DEFS_H
#include "debug.h" #include "debug.h"
#ifndef EXPERIMENTALZERO
#define PI1581SUPPORT 1
#endif
// Indicates a Pi with the 40 pin GPIO connector // Indicates a Pi with the 40 pin GPIO connector
// so that additional functionality (e.g. test pins) can be enabled // so that additional functionality (e.g. test pins) can be enabled
#if defined(RPIZERO) || defined(RPIBPLUS) || defined(RPI2) || defined(RPI3) #if defined(RPIZERO) || defined(RPIBPLUS) || defined(RPI2) || defined(RPI3)

View file

@ -101,7 +101,7 @@ u8 s_u8Memory[0xc000];
int numberOfUSBMassStorageDevices = 0; int numberOfUSBMassStorageDevices = 0;
DiskCaddy diskCaddy; DiskCaddy diskCaddy;
Pi1541 pi1541; Pi1541 pi1541;
#if not defined(EXPERIMENTALZERO) #if defined(PI1581SUPPORT)
Pi1581 pi1581; Pi1581 pi1581;
#endif #endif
CEMMCDevice m_EMMC; CEMMCDevice m_EMMC;
@ -250,7 +250,6 @@ void InitialiseHardware()
void InitialiseLCD() void InitialiseLCD()
{ {
#if not defined(EXPERIMENTALZERO)
FILINFO filLcdIcon; FILINFO filLcdIcon;
int i2cBusMaster = options.I2CBusMaster(); int i2cBusMaster = options.I2CBusMaster();
@ -312,7 +311,6 @@ void InitialiseLCD()
screenLCD->RefreshScreen(); screenLCD->RefreshScreen();
} }
else else
#endif
{ {
screenLCD = 0; screenLCD = 0;
} }
@ -612,7 +610,7 @@ EmulatingMode BeginEmulating(FileBrowser* fileBrowser, const char* filenameForIc
DiskImage* diskImage = diskCaddy.SelectFirstImage(); DiskImage* diskImage = diskCaddy.SelectFirstImage();
if (diskImage) if (diskImage)
{ {
#if not defined(EXPERIMENTALZERO) #if defined(PI1581SUPPORT)
if (diskImage->IsD81()) if (diskImage->IsD81())
{ {
pi1581.Insert(diskImage); pi1581.Insert(diskImage);
@ -673,7 +671,7 @@ void GlobalSetDeviceID(u8 id)
deviceID = id; deviceID = id;
m_IEC_Commands.SetDeviceId(id); m_IEC_Commands.SetDeviceId(id);
pi1541.SetDeviceID(id); pi1541.SetDeviceID(id);
#if not defined(EXPERIMENTALZERO) #if defined(PI1581SUPPORT)
pi1581.SetDeviceID(id); pi1581.SetDeviceID(id);
#endif #endif
} }
@ -719,6 +717,8 @@ EXIT_TYPE Emulate1541(FileBrowser* fileBrowser)
if (numberOfImagesMax > 10) if (numberOfImagesMax > 10)
numberOfImagesMax = 10; numberOfImagesMax = 10;
diskCaddy.Display();
inputMappings->directDiskSwapRequest = 0; inputMappings->directDiskSwapRequest = 0;
// Force an update on all the buttons now before we start emulation mode. // Force an update on all the buttons now before we start emulation mode.
IEC_Bus::ReadBrowseMode(); IEC_Bus::ReadBrowseMode();
@ -1053,8 +1053,9 @@ EXIT_TYPE Emulate1541(FileBrowser* fileBrowser)
} }
return exitReason; return exitReason;
} }
#endif
#if defined(PI1581SUPPORT)
EXIT_TYPE Emulate1581(FileBrowser* fileBrowser) EXIT_TYPE Emulate1581(FileBrowser* fileBrowser)
{ {
EXIT_TYPE exitReason = EXIT_UNKNOWN; EXIT_TYPE exitReason = EXIT_UNKNOWN;
@ -1251,11 +1252,7 @@ void emulator()
roms.lastManualSelectedROMIndex = 0; roms.lastManualSelectedROMIndex = 0;
#if defined(EXPERIMENTALZERO)
diskCaddy.SetScreen();
#else
diskCaddy.SetScreen(&screen, screenLCD); diskCaddy.SetScreen(&screen, screenLCD);
#endif
fileBrowser = new FileBrowser(inputMappings, &diskCaddy, &roms, &deviceID, options.DisplayPNGIcons(), &screen, screenLCD, options.ScrollHighlightRate()); fileBrowser = new FileBrowser(inputMappings, &diskCaddy, &roms, &deviceID, options.DisplayPNGIcons(), &screen, screenLCD, options.ScrollHighlightRate());
fileBrowser->DisplayRoot(); fileBrowser->DisplayRoot();
pi1541.Initialise(); pi1541.Initialise();
@ -1405,7 +1402,7 @@ void emulator()
{ {
if (emulating == EMULATING_1541) if (emulating == EMULATING_1541)
exitReason = Emulate1541(fileBrowser); exitReason = Emulate1541(fileBrowser);
#if not defined(EXPERIMENTALZERO) #if defined(PI1581SUPPORT)
else else
exitReason = Emulate1581(fileBrowser); exitReason = Emulate1581(fileBrowser);
#endif #endif
@ -1865,8 +1862,14 @@ void DisplayMessage(int x, int y, bool LCD, const char* message, u32 textColour,
screenLCD->SwapBuffers(); screenLCD->SwapBuffers();
core0RefreshingScreen.Release(); core0RefreshingScreen.Release();
} }
#else
RGBA BkColour = RGBA(0, 0, 0, 0xFF);
screenLCD->Clear(BkColour);
screenLCD->PrintText(false, x, y, (char*)message, textColour, backgroundColour);
screenLCD->SwapBuffers();
#endif #endif
} }
@ -1984,10 +1987,9 @@ extern "C"
pi1541.drive.SetVIA(&pi1541.VIA[1]); pi1541.drive.SetVIA(&pi1541.VIA[1]);
pi1541.VIA[0].GetPortB()->SetPortOut(0, IEC_Bus::PortB_OnPortOut); pi1541.VIA[0].GetPortB()->SetPortOut(0, IEC_Bus::PortB_OnPortOut);
IEC_Bus::Initialise(); IEC_Bus::Initialise();
#if not defined(EXPERIMENTALZERO)
if (screenLCD) if (screenLCD)
screenLCD->ClearInit(0); screenLCD->ClearInit(0);
#endif
#ifdef HAS_MULTICORE #ifdef HAS_MULTICORE
start_core(3, _spin_core); start_core(3, _spin_core);
start_core(2, _spin_core); start_core(2, _spin_core);