From 12f9989a1d5e9353760a1961db47c23bb2969d00 Mon Sep 17 00:00:00 2001 From: steve Date: Sat, 18 Nov 2023 20:08:16 +0000 Subject: [PATCH] small cleanups --- README.md | 3 ++- display.cpp | 8 ++++---- hw/esp8bit.h | 2 ++ hw/node32s-example.h | 4 +++- hw/stellarpad-example.h | 6 +++++- hw/ttgo-t7-v14-mini32.h | 4 +++- sound_dac.cpp | 2 +- 7 files changed, 20 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 787e57f..f88603d 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ Sample Applications - [Pacman](https://github.com/jscrane/pacman) - [Commodore PET](https://github.com/jscrane/PET) - [Compukit UK101](https://github.com/jscrane/UK101) +- [Commodore Chessmate](https://github.com/jscrane/Chessmate) Configuration for Arduino -------------- @@ -51,5 +52,5 @@ ESP8266 board, e.g., [WeMOS](https://www.wemos.cc/en/latest/d1/d1_mini.html), _o ESP32-based board, e.g., [Node32s](https://www.esp32.com/viewtopic.php?t=459), - An SD drive to store programs (for Stellarpad), - A 23k256 SPI RAM chip (for Stellarpad, optional), -- A supported TFT screen, such as [this one](http://forum.stellarisiti.com/topic/626-ssd1289-32-320x240-tft-16bit-parallel-interface-touch-libraries/), +- A supported TFT screen (if not using a board with VGA), - A PS/2 keyboard. diff --git a/display.cpp b/display.cpp index bb25a4f..22bc10d 100644 --- a/display.cpp +++ b/display.cpp @@ -193,7 +193,7 @@ void Display::drawCircle(unsigned x, unsigned y, unsigned r, colour_t col) { #elif defined(USE_ESPI) espi.drawCircle(x, y, r, col); #elif defined(USE_VGA) - canvas.setBrushColor(rgb(col)); + canvas.setPenColor(rgb(col)); canvas.fillEllipse(x, y, r, r); #endif } @@ -207,7 +207,7 @@ void Display::fillCircle(unsigned x, unsigned y, unsigned r, colour_t col) { #elif defined(USE_ESPI) espi.fillCircle(x, y, r, col); #elif defined(USE_VGA) - canvas.setPenColor(rgb(col)); + canvas.setBrushColor(rgb(col)); canvas.drawEllipse(x, y, r, r); #endif } @@ -221,7 +221,7 @@ void Display::drawRectangle(unsigned x, unsigned y, unsigned w, unsigned h, colo #elif defined(USE_ESPI) espi.drawRect(x, y, w, h, col); #elif defined(USE_VGA) - canvas.setBrushColor(rgb(col)); + canvas.setPenColor(rgb(col)); canvas.fillRectangle(x, y, x+w, y+h); #endif } @@ -235,7 +235,7 @@ void Display::fillRectangle(unsigned x, unsigned y, unsigned w, unsigned h, colo #elif defined(USE_ESPI) espi.fillRect(x, y, w, h, col); #elif defined(USE_VGA) - canvas.setPenColor(rgb(col)); + canvas.setBrushColor(rgb(col)); canvas.drawRectangle(x, y, x+w, y+h); #endif } diff --git a/hw/esp8bit.h b/hw/esp8bit.h index ad351f2..4af9385 100644 --- a/hw/esp8bit.h +++ b/hw/esp8bit.h @@ -22,10 +22,12 @@ #define KBD_DATA D4 // SPI-RAM +#if !defined(NO_SPIRAM) #define USE_SPIRAM #define SPIRAM_DEV SPI #define SPIRAM_CS D0 #define SPIRAM_SIZE 0x8000u +#endif // flash storage #if !defined(NO_STORAGE) diff --git a/hw/node32s-example.h b/hw/node32s-example.h index cc6b0ce..c88e5e6 100644 --- a/hw/node32s-example.h +++ b/hw/node32s-example.h @@ -28,10 +28,12 @@ #define KBD_DATA 34 #define KBD_IRQ 35 -// storage +// Storage +#if !defined(NO_STORAGE) #undef USE_SD #undef USE_LITTLEFS #define USE_SPIFFS +#endif // sound: dac and pwm #define DAC_SOUND 25 diff --git a/hw/stellarpad-example.h b/hw/stellarpad-example.h index 57a2c0e..831175f 100644 --- a/hw/stellarpad-example.h +++ b/hw/stellarpad-example.h @@ -7,12 +7,15 @@ #define KBD_DATA PE_4 #define KBD_IRQ PE_5 -// "tape" storage... +// Storage +#if !defined(NO_STORAGE) #define USE_SD #define SD_CS PF_3 #define SD_SPI 1 +#endif // 23k256 SPI-RAM +#if !defined(NO_SPIRAM) #define USE_SPIRAM #define SPI_CS PF_3 #define SPIRAM_CS PE_0 @@ -20,6 +23,7 @@ #define SPIRAM_MODULE 1 #define SPIRAM_CLKDIV 1 #define SPIRAM_SIZE 0x8000u +#endif // TFT display... // NOTE: edit memorysaver.h to select the correct chip for your display! diff --git a/hw/ttgo-t7-v14-mini32.h b/hw/ttgo-t7-v14-mini32.h index 6a6968f..3cfe9bd 100644 --- a/hw/ttgo-t7-v14-mini32.h +++ b/hw/ttgo-t7-v14-mini32.h @@ -20,7 +20,9 @@ #define DAC_SOUND 25 #define PWM_SOUND 25 -// "tape" storage... +// Storage +#if !defined(NO_STORAGE) #undef USE_SD #undef USE_LITTLEFS #define USE_SPIFFS +#endif diff --git a/sound_dac.cpp b/sound_dac.cpp index 06fd796..bf1c192 100644 --- a/sound_dac.cpp +++ b/sound_dac.cpp @@ -3,9 +3,9 @@ #include "timed.h" #include "sound_dac.h" +#if defined(DAC_SOUND) && defined(ESP_PLATFORM) static DAC *s; -#if defined(DAC_SOUND) && defined(ESP_PLATFORM) #include static portMUX_TYPE mux = portMUX_INITIALIZER_UNLOCKED;