added games
updated code
This commit is contained in:
@@ -9,6 +9,8 @@ My modifications are trivial:
|
||||
* Change default to stretched scaling
|
||||
* Set the grayscale color palette
|
||||
|
||||
https://vimm.net/vault/GB
|
||||
|
||||
Below is the original readme.
|
||||
|
||||
---
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
+30
-3
@@ -8,7 +8,7 @@ framework = arduino
|
||||
board_build.core = earlephilhower
|
||||
#board_build.filesystem_size = 512k
|
||||
|
||||
upload_protocol = uf2
|
||||
upload_protocol = picotool
|
||||
#upload_protocol = cmsis-dap
|
||||
debug_tool = cmsis-dap
|
||||
|
||||
@@ -36,6 +36,7 @@ build_flags =
|
||||
-DENABLE_USB_STORAGE_DEVICE=0
|
||||
-DPEANUT_FULL_GBC_SUPPORT=1
|
||||
-DUSE_TINYUSB
|
||||
-DUSE_EMBED_ROM=1
|
||||
|
||||
[env:pico]
|
||||
extends = pico-base
|
||||
@@ -47,5 +48,31 @@ board_build.filesystem_size = 1280k
|
||||
extends = pico-base
|
||||
board = rpipico2
|
||||
upload_port = /Volumes/RP2350
|
||||
# Reserve 3MB for ROMs, i.e. 1MB for code
|
||||
board_build.filesystem_size = 3072k
|
||||
# Reserve 0MB for filesystem, all 4MB available for code + ROM
|
||||
board_build.filesystem_size = 0k
|
||||
|
||||
[env:pico2_custom_rom]
|
||||
extends = pico-base
|
||||
board = rpipico2
|
||||
upload_port = /Volumes/RP2350
|
||||
# Reserve 0MB for ROMs, i.e. 4MB for code
|
||||
board_build.filesystem_size = 0k
|
||||
build_flags =
|
||||
-I.
|
||||
-Isrc/tft-espi-config
|
||||
-Ilib
|
||||
-DENABLE_SOUND=0
|
||||
-DENABLE_LCD=1
|
||||
-DENABLE_SDCARD=0
|
||||
-DENABLE_INPUT=1
|
||||
-DENABLE_LCD_DMA=1
|
||||
-DENABLE_LCD_FRAMEBUFFER=1
|
||||
-DENABLE_FRAMEBUFFER_FLIP_X_Y=1
|
||||
-DENABLE_DOUBLE_BUFFERING=1
|
||||
-DENABLE_USB_STORAGE_DEVICE=0
|
||||
-DPEANUT_FULL_GBC_SUPPORT=1
|
||||
-DUSE_TINYUSB
|
||||
-DUSE_EMBED_ROM=1
|
||||
-DROM_FILENAME="zelda.gb"
|
||||
extra_scripts =
|
||||
pre:scripts/embed_rom.py
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
# sadly heavily based on code by chat-gpt
|
||||
# loads the original binaries into flash and allows bigger roms to load like the pokemon games
|
||||
|
||||
import os
|
||||
|
||||
Import("env")
|
||||
from SCons.Script import Builder
|
||||
|
||||
# read build flags (CPP defines)
|
||||
flags = env.ParseFlags(env['BUILD_FLAGS'])
|
||||
defs = {items[0]: items[1] for items in flags.get("CPPDEFINES", {}) if isinstance(items, list) and len(items) == 2}
|
||||
|
||||
# passed via -DROM_FILENAME=...
|
||||
rom_filename = defs.get("ROM_FILENAME", "custom_rom.gb")
|
||||
|
||||
# Get the project root directory
|
||||
project_root = env.Dir('#').abspath
|
||||
|
||||
# autogenerate original symbol names used by objcopy
|
||||
auto_sym_base = rom_filename.replace(".", "_").replace(" ", "_")
|
||||
|
||||
# used to replace the symbol names
|
||||
orig_start = f"_binary_{auto_sym_base}_start"
|
||||
orig_end = f"_binary_{auto_sym_base}_end"
|
||||
|
||||
# your preferred symbol names
|
||||
new_start = f"_binary_custom_rom_start"
|
||||
new_end = f"_binary_custom_rom_end"
|
||||
|
||||
# Create a binary-to-object builder
|
||||
bin2obj = Builder(
|
||||
action = (
|
||||
"arm-none-eabi-objcopy -I binary -O elf32-littlearm -B arm "
|
||||
"--rename-section .data=.rodata,alloc,load,readonly,data,contents "
|
||||
"--set-section-alignment .rodata=4 "
|
||||
f"--redefine-sym {orig_start}={new_start} "
|
||||
f"--redefine-sym {orig_end}={new_end} "
|
||||
"$SOURCE $TARGET"
|
||||
),
|
||||
suffix = ".o",
|
||||
src_suffix = ".gb"
|
||||
)
|
||||
|
||||
env.Append(BUILDERS = {"BinToObj": bin2obj})
|
||||
|
||||
# Convert ROM into an object file and link it in
|
||||
rom_path = os.path.join(project_root, rom_filename)
|
||||
rom_obj = env.BinToObj(rom_path) # produces custom_rom.gb.o
|
||||
env.Append(LIBS=[rom_obj])
|
||||
+43694
-6474
File diff suppressed because it is too large
Load Diff
@@ -14,8 +14,13 @@ uint8_t ram[RAM_SIZE];
|
||||
|
||||
// Definition of ROM data
|
||||
#if !ENABLE_SDCARD
|
||||
#if !USE_EMBED_ROM
|
||||
extern const uint8_t _binary_custom_rom_start[];
|
||||
const uint8_t* rom = _binary_custom_rom_start;
|
||||
#else
|
||||
#include "game_bin.h"
|
||||
const uint8_t *rom = GAME_DATA;
|
||||
#endif
|
||||
#else
|
||||
/** Definition of ROM data
|
||||
* We're going to erase and reprogram the region defines as "Filesystem" in platformio.ini (see board_build.filesystem_size).
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
// For ST7735, ST7789 and ILI9341 ONLY, define the colour order IF the blue and red are swapped on your display
|
||||
// Try ONE option at a time to find the correct colour order for your display
|
||||
// #define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue
|
||||
// #define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red
|
||||
#define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red
|
||||
|
||||
// For ST7789, ST7735, ILI9163 and GC9A01 ONLY, define the pixel width and height in portrait orientation
|
||||
// #define TFT_WIDTH 80
|
||||
|
||||
Reference in New Issue
Block a user