Compare commits
2
Commits
78527c8fc9
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7bb18ee95a | ||
|
|
98cfc5601b |
@@ -2,7 +2,3 @@ build
|
|||||||
uf2
|
uf2
|
||||||
.pio
|
.pio
|
||||||
.vscode
|
.vscode
|
||||||
*_bin.h
|
|
||||||
*.bin
|
|
||||||
*.gb
|
|
||||||
*.gbc
|
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ My modifications are trivial:
|
|||||||
* Change default to stretched scaling
|
* Change default to stretched scaling
|
||||||
* Set the grayscale color palette
|
* Set the grayscale color palette
|
||||||
|
|
||||||
|
https://vimm.net/vault/GB
|
||||||
|
|
||||||
Below is the original readme.
|
Below is the original readme.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
BIN
Binary file not shown.
BIN
Binary file not shown.
+31
-3
@@ -8,7 +8,7 @@ framework = arduino
|
|||||||
board_build.core = earlephilhower
|
board_build.core = earlephilhower
|
||||||
#board_build.filesystem_size = 512k
|
#board_build.filesystem_size = 512k
|
||||||
|
|
||||||
upload_protocol = mbed
|
upload_protocol = picotool
|
||||||
#upload_protocol = cmsis-dap
|
#upload_protocol = cmsis-dap
|
||||||
debug_tool = cmsis-dap
|
debug_tool = cmsis-dap
|
||||||
|
|
||||||
@@ -36,6 +36,7 @@ build_flags =
|
|||||||
-DENABLE_USB_STORAGE_DEVICE=0
|
-DENABLE_USB_STORAGE_DEVICE=0
|
||||||
-DPEANUT_FULL_GBC_SUPPORT=1
|
-DPEANUT_FULL_GBC_SUPPORT=1
|
||||||
-DUSE_TINYUSB
|
-DUSE_TINYUSB
|
||||||
|
-DUSE_EMBED_ROM=1
|
||||||
|
|
||||||
[env:pico]
|
[env:pico]
|
||||||
extends = pico-base
|
extends = pico-base
|
||||||
@@ -46,5 +47,32 @@ board_build.filesystem_size = 1280k
|
|||||||
[env:pico2]
|
[env:pico2]
|
||||||
extends = pico-base
|
extends = pico-base
|
||||||
board = rpipico2
|
board = rpipico2
|
||||||
# Reserve 3MB for ROMs, i.e. 1MB for code
|
upload_port = /Volumes/RP2350
|
||||||
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
File diff suppressed because it is too large
Load Diff
@@ -14,8 +14,13 @@ uint8_t ram[RAM_SIZE];
|
|||||||
|
|
||||||
// Definition of ROM data
|
// Definition of ROM data
|
||||||
#if !ENABLE_SDCARD
|
#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"
|
#include "game_bin.h"
|
||||||
const uint8_t *rom = GAME_DATA;
|
const uint8_t *rom = GAME_DATA;
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
/** Definition of ROM data
|
/** Definition of ROM data
|
||||||
* We're going to erase and reprogram the region defines as "Filesystem" in platformio.ini (see board_build.filesystem_size).
|
* 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
|
// 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
|
// 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_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
|
// For ST7789, ST7735, ILI9163 and GC9A01 ONLY, define the pixel width and height in portrait orientation
|
||||||
// #define TFT_WIDTH 80
|
// #define TFT_WIDTH 80
|
||||||
|
|||||||
Reference in New Issue
Block a user