Skip to content

Commit

Permalink
Merge pull request #52 from BrianPugh/disable-triple-boot
Browse files Browse the repository at this point in the history
Hide RIGHT+GAME triple boot behind option --triple-boot
  • Loading branch information
BrianPugh authored May 10, 2023
2 parents a18b29b + 57a635d commit eda4219
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
2 changes: 2 additions & 0 deletions Core/Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,12 @@ gamepad_t read_buttons() {
gamepad = stock_read_buttons();


#if TRIPLE_BOOT
if((gamepad & GAMEPAD_RIGHT) && (gamepad & GAMEPAD_GAME)){
set_bootloader(BANK_1_STACK_2_ADDRESS);
NVIC_SystemReset();
}
#endif
#if CLOCK_ONLY
if(gamepad & GAMEPAD_GAME){
#else
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ ifneq (,$(findstring --debug, $(PATCH_PARAMS)))
C_DEFS += -DDEBUG
endif

ifneq (,$(findstring --triple-boot, $(PATCH_PARAMS)))
C_DEFS += -DTRIPLE_BOOT
endif

ADAPTER ?= stlink

LARGE_FLASH ?= 0
Expand Down
7 changes: 1 addition & 6 deletions docs/zelda.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Run the following in this repo:

```bash
make clean
make PATCH_PARAMS="--device=zelda --no-la --no-sleep-images" flash
make PATCH_PARAMS="--device=zelda --no-la --no-sleep-images --triple-boot" flash
```

This will setup storage in the following way:
Expand All @@ -62,10 +62,5 @@ make -j8 INTFLASH_ADDRESS=0x08020000 EXTFLASH_SIZE=794624 EXTFLASH_OFFSET=330137
In the Zelda3 repo, after copying `zelda3.sfc` to `zelda3/tables/zelda3.sfc`, run the following commands:

```bash
cd zelda3
make tables/zelda3_assets.dat
cd ..
python3 ./scripts/bundle_all_assets.py
python3 ./scripts/update_all_assets.py
make -j8 INTFLASH_BANK=2 EXTFLASH_SIZE=1703936 EXTFLASH_OFFSET=868352 ADAPTER=stlink GNW_TARGET=zelda flash
```
5 changes: 5 additions & 0 deletions patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ def main():
action="store_true",
help="Enable OTFDEC for the main extflash binary.",
)
parser.add_argument(
"--triple-boot",
action="store_true",
help="Enable RIGHT+GAME to launch 0x08020000.",
)
parser.add_argument(
"--compression-ratio",
type=float,
Expand Down

0 comments on commit eda4219

Please sign in to comment.