Trivial modifications to match my use case in a Lego Game Boy.

This commit is contained in:
Staacks
2025-10-01 15:49:32 +02:00
parent 84d29789d5
commit 78527c8fc9
6 changed files with 45 additions and 36 deletions
+12 -12
View File
@@ -29,14 +29,14 @@
#define PIN_START 7
#elif ENABLE_INPUT == INPUT_GPIO
// Use GPIOs directly on Pico for Joypad
#define PIN_UP 2
#define PIN_DOWN 3
#define PIN_LEFT 4
#define PIN_RIGHT 5
#define PIN_A 6
#define PIN_B 7
#define PIN_SELECT 8
#define PIN_START 9
#define PIN_UP 0
#define PIN_DOWN 0
#define PIN_LEFT 0
#define PIN_RIGHT 0
#define PIN_A 0
#define PIN_B 0
#define PIN_SELECT 0
#define PIN_START 0
#endif
#if ENABLE_SOUND
@@ -46,10 +46,10 @@
#if ENABLE_SDCARD
#define SD_SPI SPI
#define SD_CS_PIN 17
#define SD_SCK_PIN 18
#define SD_MOSI_PIN 19
#define SD_MISO_PIN 16
#define SD_CS_PIN 13
#define SD_SCK_PIN 14
#define SD_MOSI_PIN 15
#define SD_MISO_PIN 12
extern uint8_t _FS_start;
extern uint8_t _FS_end;
+1 -1
View File
@@ -44,7 +44,7 @@ static uint8_t scaledLineOffsetTable[LCD_HEIGHT]; // scaled to 240 lines
/* Pixel data is stored in here. */
static uint8_t pixels_buffer[LCD_WIDTH];
volatile ScalingMode scalingMode = ScalingMode::STRETCH_KEEP_ASPECT;
volatile ScalingMode scalingMode = ScalingMode::STRETCH;
static int lcd_line_busy = 0;
+2 -2
View File
@@ -68,7 +68,8 @@ void startEmulator() {
/* Automatically assign a colour palette to the game */
char rom_title[16];
auto_assign_palette(palette, gb_colour_hash(&gb), gb_get_rom_name(&gb, rom_title));
//auto_assign_palette(palette, gb_colour_hash(&gb), gb_get_rom_name(&gb, rom_title));
get_colour_palette(palette, 0x16, 0x00);
#if ENABLE_LCD
gb_init_lcd(&gb, &lcd_draw_line);
@@ -166,7 +167,6 @@ void setup() {
void loop() {
gb.gb_frame = 0;
do {
__gb_step_cpu(&gb);
tight_loop_contents();
+12 -19
View File
@@ -22,10 +22,10 @@
// Tell the library to use parallel mode (otherwise SPI is assumed)
//#define TFT_PARALLEL_8_BIT
#define TFT_PARALLEL_16_BIT // **** 16-bit parallel ONLY for RP2040 processor ****
//#define TFT_PARALLEL_16_BIT // **** 16-bit parallel ONLY for RP2040 processor ****
// Only define one driver, the other ones must be commented out
#define ILI9341_DRIVER // Generic driver for common displays
//#define ILI9341_DRIVER // Generic driver for common displays
//#define ILI9341_2_DRIVER // Alternative ILI9341 driver, see https://github.com/Bodmer/TFT_eSPI/issues/1172
//#define ST7735_DRIVER // Define additional parameters below for this display
//#define ILI9163_DRIVER // Define additional parameters below for this display
@@ -35,7 +35,7 @@
//#define ILI9481_DRIVER
//#define ILI9486_DRIVER
//#define ILI9488_DRIVER // WARNING: Do not connect ILI9488 display SDO to MISO if other devices share the SPI bus (TFT SDO does NOT tristate when CS is high)
//#define ST7789_DRIVER // Full configuration option, define additional parameters below for this display
#define ST7789_DRIVER // Full configuration option, define additional parameters below for this display
//#define ST7789_2_DRIVER // Minimal configuration option, define additional parameters below for this display
//#define R61581_DRIVER
//#define RM68140_DRIVER
@@ -100,22 +100,15 @@
// driven with a PWM signal or turned OFF/ON then this must be handled by the user
// sketch. e.g. with digitalWrite(TFT_BL, LOW);
// #define TFT_BL 32 // LED back-light control pin
// #define TFT_BACKLIGHT_ON HIGH // Level to turn ON back-light (HIGH or LOW)
#define TFT_BL 14 // LED back-light control pin
#define TFT_BACKLIGHT_ON HIGH // Level to turn ON back-light (HIGH or LOW)
#define TFT_D0 0
#define TFT_D1 1
#define TFT_D2 2
#define TFT_D3 3
#define TFT_D4 4
#define TFT_D5 5
#define TFT_D6 6
#define TFT_D7 7
#define TFT_WR 18 // Write strobe for modified Raspberry Pi TFT only
#define TFT_DC 19 // Data Command control pin
#define TFT_CS 22 // Chip select control pin D8
//#define TFT_RST 22 // Reset pin (could connect to NodeMCU RST, see next line)
#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
#define TFT_MOSI 9
#define TFT_SCLK 10
#define TFT_DC 13 // Data Command control pin
#define TFT_CS 11 // Chip select control pin D8
#define TFT_RST 12 // Reset pin (could connect to NodeMCU RST, see next line)
//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to NodeMCU RST or 3.3V
// ##################################################################################
//
@@ -150,7 +143,7 @@
// ##################################################################################
// For RP2040 processor and SPI displays, uncomment the following line to use the PIO interface.
//#define RP2040_PIO_SPI // Leave commented out to use standard RP2040 SPI port interface
#define RP2040_PIO_SPI // Leave commented out to use standard RP2040 SPI port interface
// For RP2040 processor and 8 or 16-bit parallel displays:
// The parallel interface write cycle period is derived from a division of the CPU clock