From 6ce74cf9c8335e07ef7991a51036c5d2f21a3927 Mon Sep 17 00:00:00 2001 From: penfold42 Date: Fri, 15 Jun 2018 13:31:01 +1000 Subject: [PATCH 1/3] GCC 7 support and cleanup compiler warnings --- Makefile.rules | 4 ++-- src/armc-cstartup.c | 2 +- src/armc-cstubs.c | 11 +++++++++++ src/iec_bus.h | 10 +++++----- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/Makefile.rules b/Makefile.rules index 0ab879a..d4679f5 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -29,7 +29,7 @@ $(error RASPPI must be one of: 0, 1, 2, 3) endif AFLAGS += $(ARCH) -CFLAGS += $(ARCH) -Wall -Wno-psabi -fsigned-char -fno-builtin -Ofast -DNDEBUG +CFLAGS += $(ARCH) -Wall -Wno-unused-variable -Wno-unused-but-set-variable -Wno-psabi -fsigned-char -fno-builtin -Ofast -DNDEBUG CPPFLAGS := $(CFLAGS) $(CPPFLAGS) -fno-exceptions -fno-rtti -std=c++0x -Wno-write-strings CFLAGS += -fno-delete-null-pointer-checks -fdata-sections -ffunction-sections -u _printf_float -std=gnu99 @@ -45,4 +45,4 @@ CFLAGS += -fno-delete-null-pointer-checks -fdata-sections -ffunction-sections - %.o: %.cpp @echo " CPP $@" - $(Q)$(CPP) $(CPPFLAGS) $(INCLUDE) -c -o $@ $< \ No newline at end of file + $(Q)$(CPP) $(CPPFLAGS) $(INCLUDE) -c -o $@ $< diff --git a/src/armc-cstartup.c b/src/armc-cstartup.c index 742c5c8..5495d2f 100644 --- a/src/armc-cstartup.c +++ b/src/armc-cstartup.c @@ -56,7 +56,7 @@ void _cstartup( unsigned int r0, unsigned int r1, unsigned int r2 ) while( bss < bss_end ) *bss++ = 0; - __libc_init_array(); + __libc_init_array(); /* We should never return from main ... */ kernel_main( r0, r1, r2 ); diff --git a/src/armc-cstubs.c b/src/armc-cstubs.c index 46b6891..8fb4e29 100644 --- a/src/armc-cstubs.c +++ b/src/armc-cstubs.c @@ -87,6 +87,17 @@ void _exit(int status) } } +void _fini(int status) +{ + /* Stop the compiler complaining about unused variables by "using" it */ + (void) status; + + while (1) + { + /* TRAP HERE */ + } +} + /* There's currently no implementation of a file system because there's no file system! */ int _close(int file) diff --git a/src/iec_bus.h b/src/iec_bus.h index 3e6d645..0ca9705 100644 --- a/src/iec_bus.h +++ b/src/iec_bus.h @@ -531,10 +531,10 @@ public: invertIECInputs = value; if (value) { - PI_Atn = ~PI_Atn; - PI_Data = ~PI_Data; - PI_Clock = ~PI_Clock; - PI_Reset = ~PI_Reset; + PI_Atn = !PI_Atn; + PI_Data = !PI_Data; + PI_Clock = !PI_Clock; + PI_Reset = !PI_Reset; } } @@ -626,4 +626,4 @@ private: static u32 inputRepeat[5]; static u32 inputRepeatPrev[5]; }; -#endif \ No newline at end of file +#endif From 777ab80d99c842239bfa60da2f0d4b2c5c348f8b Mon Sep 17 00:00:00 2001 From: penfold42 Date: Fri, 15 Jun 2018 18:33:41 +1000 Subject: [PATCH 2/3] Moved status bar to avoid overlap with 40 track BAM --- src/FileBrowser.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/FileBrowser.cpp b/src/FileBrowser.cpp index 98aedf7..34b5ffc 100644 --- a/src/FileBrowser.cpp +++ b/src/FileBrowser.cpp @@ -892,10 +892,11 @@ void FileBrowser::ShowDeviceAndROM() char buffer[256]; u32 textColour = RGBA(0, 0, 0, 0xff); u32 bgColour = RGBA(0xff, 0xff, 0xff, 0xff); - u32 y = screenMain->ScaleY(STATUS_BAR_POSITION_Y); + u32 x = 0; // 43 * 8 + u32 y = screenMain->ScaleY(STATUS_BAR_POSITION_Y - 20); - snprintf(buffer, 256, "Device %d %s \r\n", deviceID, roms->ROMNames[roms->currentROMIndex]); - screenMain->PrintText(false, 43 * 8, y, buffer, textColour, bgColour); + snprintf(buffer, 256, "Device %d %s\r\n", deviceID, roms->ROMNames[roms->currentROMIndex]); + screenMain->PrintText(false, x, y, buffer, textColour, bgColour); } void FileBrowser::DisplayDiskInfo(DiskImage* diskImage, const char* filenameForIcon) From a5170e350a32ba2b5eb2c457d0c5ae49023a9c28 Mon Sep 17 00:00:00 2001 From: penfold42 Date: Sat, 16 Jun 2018 10:26:08 +1000 Subject: [PATCH 3/3] Updated readme with toolchain info and build platforms tested --- README.md | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3f91f2d..86bb31a 100644 --- a/README.md +++ b/README.md @@ -13,18 +13,25 @@ Commodore Plus4 See www.pi1541.com for SD card and hardware configurations. -Building --------- +Toolchain Installation +---------------------- On Windows use GNU Tools ARM Embedded tool chain 5.4.1 using make. https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads/5-2016-q2-update On dpkg based linux systems install: -binutils-arm-none-eabi -gcc-arm-none-eabi -libnewlib-arm-none-eabi -libstdc++-arm-none-eabi-newlib +(Tested on osmc/rpi3) +``` +apt-get install binutils-arm-none-eabi gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib +``` +On RHEL/Centos/Fedora systems follow the guide at: +https://web1.foxhollow.ca/?menu=centos7arm +(Tested on Centos7/x64 with GCC7) +https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads/7-2017-q4-major + +Building +-------- ``` make ```