From: Jean-Paul Mari Date: Wed, 18 Nov 2020 06:01:50 +0000 (-0500) Subject: Work around fix for a compilation error on Linux X-Git-Tag: v2.1.3-R5^2~29 X-Git-Url: http://git.hcoop.net/clinton/Virtual-Jaguar-Rx.git/commitdiff_plain/b45a1df38cc67e98bf41f7dc686c4b0242fa2445 Work around fix for a compilation error on Linux EEPROM directory creation allowed only for Windows at the moment. --- diff --git a/.gitignore b/.gitignore index a3660b8..af3f26c 100644 --- a/.gitignore +++ b/.gitignore @@ -34,4 +34,4 @@ virtualjaguar.WinMerge /Win-VS2017/GeneratedFiles/ /Win-VS2017/GeneratedFiles/qrc_virtualjaguar.cpp /Win-VS2017/My Inspector Results - virtualjaguar -/Win-VS2019/ +/Win-VS2019/ diff --git a/docs/vj_HistoryNotes.txt b/docs/vj_HistoryNotes.txt index 67ce196..cfd07ea 100644 --- a/docs/vj_HistoryNotes.txt +++ b/docs/vj_HistoryNotes.txt @@ -22,6 +22,8 @@ Release 5 (TBA) -- Will avoid source code mismatching with the ELF executable 15) Remove Visual Studio 2015 support 16) Project has switched to libdwarf 20201020 library 64bits for VS 2017 +17) Work around fix for a compilation error on Linux +-- EEPROM directory creation allowed only for Windows at the moment Release 4a (15th August 2019) ----------------------------- diff --git a/src/eeprom.cpp b/src/eeprom.cpp index 9062c2c..7e21166 100644 --- a/src/eeprom.cpp +++ b/src/eeprom.cpp @@ -9,14 +9,19 @@ // JLH = James Hammons // JPM = Jean-Paul Mari // -// Who When What -// --- ---------- ------------------------------------------------------------ -// JLH 01/16/2010 Created this log ;-) -// JPM 10/11/2017 Directory detection and creation if missing +// Who When (MM/DD/YY) What +// --- --------------- ------------------------------------------------------------ +// JLH 01/16/2010 Created this log ;-) +// JPM 10/11/2017 EEPROM directory detection and creation if missing +// JPM 11/18/2020 EEPROM directory creation allowed only for Windows // #include "eeprom.h" +#if _WIN32 || _WIN64 #include +#else +#define _mkdir(dir) 1 +#endif #include #include // For memset #include "jaguar.h" @@ -114,10 +119,14 @@ void EepromInit(void) void EepromReset(void) { if (!haveEEPROM) + { memset(eeprom_ram, 0xFF, 64 * sizeof(uint16_t)); + } if (!haveCDROMEEPROM) + { memset(cdromEEPROM, 0xFF, 64 * sizeof(uint16_t)); + } } @@ -173,8 +182,10 @@ void ReadEEPROMFromFile(FILE * file, uint16_t * ram) uint8_t buffer[128]; size_t ignored = fread(buffer, 1, 128, file); - for(int i=0; i<64; i++) + for (int i = 0; i < 64; i++) + { ram[i] = (buffer[(i * 2) + 0] << 8) | buffer[(i * 2) + 1]; + } }