Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
315 commits
Select commit Hold shift + click to select a range
652aa74
Accounted to Ordon Shield when buying Ordon Shield check
lunarsoap5 Jun 11, 2024
c9135c1
Add rel patch to fix MA/ZA MS check crash
lunarsoap5 Jun 12, 2024
b352ee9
Update shop models for City
lunarsoap5 Jun 12, 2024
ebd2342
Adjust killing poes to skip the backflip and trigger the item get imm…
Zephiles Jun 14, 2024
bcff158
Merge pull request #30 from lunarsoap5/PoeDelaySkip
lunarsoap5 Jun 14, 2024
f18dc57
Clear reserved bytes upon reaching title screen
Zephiles Jul 4, 2024
952c602
Merge pull request #31 from lunarsoap5/NewFileQueueFix
lunarsoap5 Jul 14, 2024
6513bca
Fix issue with shield house/existing conversations messing with goats
lunarsoap5 Jul 14, 2024
fe35934
Fix flag check for putting midna on back if Eldin twilight is last tw…
lunarsoap5 Jul 19, 2024
b2c1949
Current work for 1.3
Zephiles Aug 18, 2024
47502cf
More work for 1.3
Zephiles Aug 18, 2024
33ef3f0
Fix several crashes
Zephiles Aug 18, 2024
180f8d7
Better crash fix + Add back code for setting the game state to GAME_T…
Zephiles Aug 18, 2024
af45c02
Fix CustomMessageData::getMsgID return type
Zephiles Aug 18, 2024
1370d81
Fix crashing on title screen after returning from file
Zephiles Aug 18, 2024
7bc4858
Remove Randomizer pointer from Seed constructor params
Zephiles Aug 20, 2024
56a7a6a
Add comments for instances of where some code should not run when the…
Zephiles Aug 20, 2024
ffb5f12
boot/randomizer.cpp - Only include d_s_logo.h if building for the PAL…
Zephiles Aug 20, 2024
bac9f75
Fix JP build errors
Zephiles Aug 20, 2024
0d6fe5a
Update DVD code to work correctly for 1.3
Zephiles Aug 21, 2024
bdd2621
boot/main.cpp - Small optimizations + Only hook dComIfGp_setNextStage…
Zephiles Aug 21, 2024
c266cc2
Remove checkTreasureRupeeReturn hook and manually overwrite its instr…
Zephiles Aug 21, 2024
cf82a98
seed.h - Adjust capitalization of m_num variables to m_Num
Zephiles Aug 21, 2024
c3c52a8
Merge branch 'development' of https://github.com/lunarsoap5/Randomize…
lunarsoap5 Aug 21, 2024
39f99e4
Remove duplicates from conflict resolution
lunarsoap5 Aug 21, 2024
be4e2b1
Merge pull request #32 from lunarsoap5/LoadSeedAtBoot
lunarsoap5 Aug 21, 2024
c7606da
Add seed name to save file screen
lunarsoap5 Aug 21, 2024
0ac2d2d
Small optimizations
Zephiles Aug 21, 2024
9010b41
Fix memory leaks due to incorrect delete usages
Zephiles Aug 22, 2024
d2ced82
Fix Kak red potion model and modify bgm data to be an EntryInfo
lunarsoap5 Aug 23, 2024
ea1f9c0
Various adjustments/optimizations
Zephiles Aug 24, 2024
b3a6312
Removed instances of void being placed in functions with no params
Zephiles Aug 24, 2024
15ba5f3
Manually initialize non-zero Seed class variables in constructor
Zephiles Aug 24, 2024
f38c2de
Adjust ShopCheck variable types
Zephiles Aug 24, 2024
92226d8
Fix return types for inlined getItem functions
Zephiles Aug 24, 2024
d9e4593
Fix arc replacement indexing issue
lunarsoap5 Aug 24, 2024
54f74c1
adding injection of seed in the final gci (#33)
kipcode66 Aug 28, 2024
29a83f7
Rework button combo checking functions, and fix fast spinner not working
Zephiles Aug 28, 2024
51f928f
Small optimization in Randomizer::overrideARC
Zephiles Aug 28, 2024
f987583
add devcontainer configs
kipcode66 Aug 28, 2024
56e375a
updated pyelf2rel
kipcode66 Aug 30, 2024
3c620a0
export elf2rel var
kipcode66 Aug 30, 2024
f15aa0e
bump pyelf2rel to 1.0.4
kipcode66 Aug 31, 2024
9186dfa
Merge pull request #34 from kipcode66/devcontainer
lunarsoap5 Sep 1, 2024
cd61e89
Add support for invert x axis on camera, and bmdr alink types
lunarsoap5 Sep 8, 2024
153580b
Cleaned up texture directory parsing.
lunarsoap5 Sep 8, 2024
7d86288
Add CiTS->LH SCOB and code to manage equipped items as wolf
lunarsoap5 Sep 11, 2024
37f1b8e
Optimize asm function and rando ptrs for menu ring functions.
lunarsoap5 Sep 11, 2024
517804e
Move m_MenuRingOpen to ItemWheelMenu class
Zephiles Sep 12, 2024
e2cced5
Adjust variable name in 06_asmOverrides.cpp
Zephiles Sep 12, 2024
a18fc00
Reorder function calls in handle_dMenuRing__create
Zephiles Sep 12, 2024
c94650a
Add support for ToT Sword level requirement
lunarsoap5 Sep 18, 2024
36c54c2
Various optimizations
Zephiles Sep 22, 2024
db6473f
update DVD processing in makefile & add missing lst entries
kipcode66 Sep 23, 2024
8b88b77
Merge pull request #36 from kipcode66/dvd
lunarsoap5 Oct 2, 2024
d6fc11e
add wii compilation pipeline
kipcode66 Oct 4, 2024
d6024ed
Merge pull request #37 from kipcode66/wii
lunarsoap5 Oct 4, 2024
ff25901
Remove sewers states and add transform flag during Faron Twilight int…
lunarsoap5 Oct 4, 2024
71de26c
Fix some problems for compiling Wii US 1.2
Zephiles Oct 23, 2024
5954139
Remove dupe foolish items, add portal items, and removed certain sav…
lunarsoap5 Dec 19, 2024
0fbfa25
Create framework for freestanding rupees as checks
lunarsoap5 Dec 20, 2024
0fb9177
clear lastMode to prevent spawn softlock shenanigans
lunarsoap5 Jan 4, 2025
6ede54f
add support for more arcs and directories
lunarsoap5 Jan 6, 2025
9e32248
Add patch for twilight mist and fix ranch states
lunarsoap5 Jan 11, 2025
37c2c38
optimize skybooks and removed unused custom ids
lunarsoap5 Jan 14, 2025
8b12d92
Fix layer bug where saving talo before doing tutorial causes state sh…
lunarsoap5 Jan 18, 2025
d8c6ec7
fix fado layers and ice trap crash
lunarsoap5 Jan 23, 2025
398bf55
Update build instructions to not pull newest libtp_rel version
Zephiles Jan 29, 2025
6bbeacc
Small changes/optimizations
Zephiles Feb 1, 2025
06bc45c
Fix coro and north faron keys to set flags now. save PoC
lunarsoap5 Feb 3, 2025
dce24d3
add boss rooms to save warp patch exclusion
lunarsoap5 Feb 5, 2025
6a15a10
fix spawn to account for death and portals
lunarsoap5 Feb 7, 2025
587d7a4
Add custom coro actor for twilights
lunarsoap5 Feb 22, 2025
e919df5
Fix stage spawn
lunarsoap5 Mar 12, 2025
f9d53bf
Save progress
icogn Mar 14, 2025
1a4b8fd
Various optimizations
Zephiles Mar 16, 2025
23ceca0
Update HV state to change when Impaz gives item
lunarsoap5 Mar 17, 2025
66075e1
Update hidden village state and fix return to spawn bug
lunarsoap5 Mar 26, 2025
4f0e4d3
Update coro twilight params and re-add sewers
lunarsoap5 Mar 27, 2025
5c4517f
fix mdh flags
lunarsoap5 Mar 27, 2025
19fb6b0
Save before more changes
icogn Mar 28, 2025
c8f95a6
Save progress
icogn Mar 30, 2025
a8fe383
Get adjust select option text working
icogn Mar 30, 2025
aeddce1
Branch result remap working
icogn Mar 31, 2025
57e95f1
Fix allow branch result remap to 0xFFFF
icogn Mar 31, 2025
e3d5262
Event node replacement working
icogn Apr 1, 2025
9c13556
remove magic byte as it is unused
lunarsoap5 Apr 1, 2025
4100066
Fix portal spawn check
lunarsoap5 Apr 5, 2025
4bd9d75
Add support for horse call check and moved Bo door patches to generat…
lunarsoap5 Apr 12, 2025
9dc3299
Add ability to change quest slot item
lunarsoap5 Apr 13, 2025
84c4dde
modify IB functionality to not use a seed flag
lunarsoap5 Apr 15, 2025
14d227c
Revert "modify IB functionality to not use a seed flag"
lunarsoap5 Apr 15, 2025
138fcb3
Save new strRemap structure partial
icogn Apr 18, 2025
a4cf8ac
Add new node remapping
icogn Apr 20, 2025
914e7ec
hook stage loader for stage ARCs to prevent race condition with certa…
lunarsoap5 Apr 20, 2025
da7af39
Save work on bmg
icogn Apr 22, 2025
b7dd519
Work on new version of bmg code
icogn Apr 26, 2025
8bc4802
Update implementation
icogn Apr 26, 2025
d615519
Refactor strRepl lookup
icogn Apr 26, 2025
bbba113
Save work on branch patching
icogn Apr 29, 2025
c5778a9
Node remapping; fix asm bug branchPatch not maintaining r6
icogn Apr 29, 2025
644cf8f
Event patch working
icogn Apr 29, 2025
32f5034
Clean
icogn Apr 29, 2025
5f88091
Branch patch working
icogn Apr 29, 2025
2b3c41d
Add eventNextNode code; fix wrong tableInfosIndex on basic bug
icogn Apr 30, 2025
6ea23b3
Fix binary search edge case
icogn Apr 30, 2025
e91e0cb
Add custom query function
icogn May 2, 2025
0d2c304
Refactor
icogn May 2, 2025
feaf485
Add branch query function for canChangeToD
icogn May 5, 2025
9d6c61b
Add custom nop event
icogn May 5, 2025
dbbbe96
Midna change ToD text box shows again fix
icogn May 5, 2025
dcf4d77
Fix boss music to not rely on story flag
lunarsoap5 May 7, 2025
a3e51c0
Add shadow beast, ganon barrier, and dungeon ER flags
lunarsoap5 May 20, 2025
3f555b0
Fix snowpeak and ER save warp spawns
lunarsoap5 May 22, 2025
3aeb08b
Save recent changes
icogn May 30, 2025
ea659ad
Improve bmgNumber calc
icogn Jun 1, 2025
d5fb107
Refactor to shrink entityInfo size
icogn Jun 3, 2025
a09c543
Clean
icogn Jun 3, 2025
0be4d28
Handle decrypting string table
icogn Jun 12, 2025
92b0e51
Use fallback str
icogn Jun 13, 2025
47d3899
Fix text decryption and TalkToMidna override
icogn Jun 23, 2025
876a783
Clean up ToD change triggering
icogn Jun 29, 2025
ce8347e
Add support for Epona Colors and fix B&C check
lunarsoap5 Jul 7, 2025
33f6f6a
Add support for wolf color and adjust rupee scale
lunarsoap5 Jul 8, 2025
6d68fb6
Pushing current barrier/bk code
lunarsoap5 Jul 8, 2025
aceef55
Fix minor issues to get everything working
lunarsoap5 Jul 9, 2025
2644f0c
Create framework for sfx shuffle
lunarsoap5 Jul 14, 2025
d0c45d2
add functionality for autofill wallets and wallet sizes
lunarsoap5 Jul 20, 2025
ed7372e
Add support for goron donation settings
lunarsoap5 Jul 20, 2025
55208f8
Update event fn params
icogn Jul 22, 2025
107608b
Update libtp dependency
lunarsoap5 Jul 23, 2025
bbc1a2b
Set lastMode to 0 when going to randomized entrance so Ooccoo works
icogn Aug 3, 2025
4615cdd
Check that lastMode is 0xC
icogn Aug 4, 2025
a0e53e2
Merge pull request #38 from icogn/isaac/ooccooInEntranceRando
lunarsoap5 Aug 4, 2025
a737d17
Comment out query023 changes
icogn Aug 14, 2025
26b9b2e
Merge branch 'lunarDevelopment' into isaac/hintSpotImprovements
icogn Aug 20, 2025
64121c9
Update bmg0Offset so compiles; update libtp_rel to point to commit wi…
icogn Aug 20, 2025
e0db234
Add support for rainbow lantern
lunarsoap5 Aug 20, 2025
30d1bff
Fix based on updated endFlowGroup definition
icogn Aug 21, 2025
511e345
Various trade item updates
icogn Aug 21, 2025
ed539a2
Merge pull request #39 from icogn/isaac/tradeItemUpdates
lunarsoap5 Aug 21, 2025
b997d1e
Adjust CitS exit SCOB so it activates after jumping and you do not mi…
icogn Aug 30, 2025
3f0f6e3
Merge pull request #40 from icogn/isaac/adjustCitsExitScob
lunarsoap5 Aug 30, 2025
0f0b7b4
Eldin/Lanayru barrier changes working for US
icogn Sep 4, 2025
3997bb4
Add to eu and jp lst files
icogn Sep 4, 2025
f88a67f
Fix spot_map_proc workaround; clean assembly code
icogn Sep 4, 2025
b521fd4
Fix for Lanayru to Faron, which skipped gate keys
icogn Sep 4, 2025
c99dbbb
Update comment
icogn Sep 4, 2025
30699a3
Update libtp_rel to point to latest zsrtp/master commit
icogn Sep 4, 2025
825d03a
Merge pull request #41 from icogn/isaac/eldinProvinceUnlock
lunarsoap5 Sep 5, 2025
6b416c9
Add support for rainbow Midna hair
lunarsoap5 Sep 5, 2025
6b116fd
Fix shop foolish items not using proper texture ID
lunarsoap5 Sep 8, 2025
51d26ce
Merge remote-tracking branch 'lunar/development' into isaac/hintSpotI…
icogn Sep 18, 2025
d7997db
Update libtp_rel to correct latest zsrtp/master commit
icogn Sep 18, 2025
90dece6
Merge fix: fix seed header bmg0 offset to match output from Generator…
icogn Sep 18, 2025
8dc67b9
Save Iza work
icogn Sep 22, 2025
8f84304
Adjust Epona pos when loading next stage after opening cutscene
icogn Sep 22, 2025
f1cd45d
Simplify
icogn Sep 23, 2025
08d9da1
Merge pull request #42 from icogn/isaac/eponaStartingPos
lunarsoap5 Sep 23, 2025
1b9f557
Merge remote-tracking branch 'lunar/development' into isaac/hintSpotI…
icogn Sep 27, 2025
3ca4e87
Update libtp_rel to latest master commit
icogn Sep 27, 2025
65025a1
Clean
icogn Sep 27, 2025
cdbb8af
Clean and refactor
icogn Sep 27, 2025
38b1bda
Refactor/clean getFlowBranchNode
icogn Sep 27, 2025
00c718b
Clean adjustFlowBranchNextNode
icogn Sep 29, 2025
5cffbf4
Fix transformAnywhere and quick transform issues
icogn Sep 29, 2025
782d82c
Merge pull request #43 from icogn/isaac/transformFixes
lunarsoap5 Sep 30, 2025
d5ca4c6
Pull libtp dependency and update wallet sizes
lunarsoap5 Sep 30, 2025
ac6b07b
Adjust vanilla wallet size. oops
lunarsoap5 Oct 13, 2025
16c5dbb
Add exceptions for rupees so they aren't giant.
lunarsoap5 Oct 13, 2025
ed55391
Update libtp_rel to latest master commit
icogn Oct 18, 2025
b0231c3
Adjust comments
icogn Oct 19, 2025
21aa34c
Clean adjustFlowEventNextNode
icogn Oct 19, 2025
1eff585
Clean getFlowQueryFnPtr
icogn Oct 19, 2025
4e77f85
Clean getFlowEventFnPtr
icogn Oct 19, 2025
b43a133
Clean adjustSelectMsg
icogn Oct 19, 2025
aabe5b7
Clean and refactor
icogn Oct 19, 2025
33957d9
Add eu.lst entries
icogn Oct 20, 2025
8d6332a
Fix eu setSelectMsg address
icogn Oct 20, 2025
6c15f1a
Add jp.lst entries
icogn Oct 20, 2025
d8eb622
Refactor
icogn Oct 20, 2025
0b6215a
Refactor custom query and event code
icogn Oct 20, 2025
b74ae7b
Move asm code to correct file
icogn Oct 20, 2025
bb8f23f
Refactor
icogn Oct 20, 2025
5d0a8a7
Refactor
icogn Oct 20, 2025
2e0f6f4
Remove query023 bombBagComp changes which are no longer needed
icogn Oct 20, 2025
6e69459
Refactor; remove old 0xFE overrideArc patching since not needed for f…
icogn Oct 21, 2025
699bc00
Clean; move EntityInfIdx enum to private
icogn Oct 21, 2025
dbbc5d0
Move impl details from header to cpp
icogn Oct 21, 2025
b330091
Clean
icogn Oct 21, 2025
dc35bdb
Remove talkToMidna strings which come from the Generator now
icogn Oct 23, 2025
2304962
Merge remote-tracking branch 'lunar/development' into isaac/hintSpotI…
icogn Oct 29, 2025
39ccc52
Only allow FLI remap on 0 context
icogn Oct 29, 2025
db8e070
Convert game_patch.h to LF endings
icogn Oct 30, 2025
7d7798c
Convert main.cpp to LF endings
icogn Oct 30, 2025
c320929
Fix flowId on PoT and HC signs
icogn Oct 30, 2025
701bf6d
Merge pull request #44 from icogn/isaac/hintSpotImprovements
lunarsoap5 Oct 31, 2025
0160e59
Migrate static ASM patches to generator to reduce memory.
lunarsoap5 Nov 4, 2025
08481bf
Move BCT, LF, NE, KG, KV, and PoT signs
icogn Nov 5, 2025
df76862
Merge pull request #45 from icogn/isaac/moveHintSigns
lunarsoap5 Nov 5, 2025
1e70392
Add CitS and Shad Owl statue FAQ signs
icogn Nov 6, 2025
30374eb
Merge pull request #46 from icogn/isaac/faqSigns
lunarsoap5 Nov 6, 2025
a7d8446
Adjust HF layer calculation
icogn Nov 13, 2025
d3f1f2f
Merge pull request #47 from icogn/isaac/hfLayerCalc
lunarsoap5 Nov 13, 2025
55cfee9
Fix bug where returning to spawn improperly unsets MDH flags
lunarsoap5 Nov 13, 2025
b5c2236
Fix msgFlow issues
icogn Nov 14, 2025
0e1a7dd
Merge pull request #48 from icogn/isaac/msgFlowFixes
lunarsoap5 Nov 14, 2025
3ffd805
Force player to be link when returning to spawn
lunarsoap5 Nov 14, 2025
a37ab7d
Remove un-needed =
lunarsoap5 Nov 14, 2025
93a2dfc
Add optimizations for Ilia stuff
lunarsoap5 Nov 19, 2025
3923430
Update kak graveyard states and add support for wallet values
lunarsoap5 Nov 24, 2025
676a7b4
Added functionality for warashibe item wheel stuff and add skybook co…
lunarsoap5 Dec 8, 2025
75085b8
Adjust dpad icon position to look cleaner
lunarsoap5 Dec 8, 2025
584dd52
Fix item count function misuse
lunarsoap5 Dec 9, 2025
3b843ba
Clean up code and add framework for handling of special spawns
lunarsoap5 Dec 9, 2025
e700b3e
Add current spawn to save warp vars
lunarsoap5 Dec 18, 2025
6c13b61
Add check to fix quick transform magnetized softlock
lunarsoap5 Dec 19, 2025
3e3dbc7
Update item wheel menu to use flags instead of key byte
lunarsoap5 Jan 21, 2026
1bddb25
Add support for light sword color
lunarsoap5 Jan 23, 2026
e74f072
Update Lake Hylia spawn when save+quitting after warping there
icogn Jan 24, 2026
827fa6c
Merge pull request #49 from icogn/isaac/lhPortalSaveQuitSpawn
lunarsoap5 Jan 24, 2026
b38c6ad
Update libtp dependency
lunarsoap5 Jan 24, 2026
7d5dfe2
Update S+Q after portal points to vanilla values
icogn Jan 24, 2026
87313e7
Merge pull request #50 from icogn/isaac/portalSqFixes
lunarsoap5 Jan 25, 2026
e72e281
use single var instead of ptr references on spawn point.
lunarsoap5 Jan 25, 2026
e451224
Handle various spawn issues after S+Q in different circumstances
icogn Jan 27, 2026
aad302a
Merge pull request #51 from icogn/isaac/spawnSaveFixes
lunarsoap5 Jan 27, 2026
a18212e
Update libtp dependency
lunarsoap5 Jan 27, 2026
bcb2703
Fix patches for items to include bomb refills as well
lunarsoap5 Jan 29, 2026
3010356
Save current changes
icogn Feb 7, 2026
d02d172
Update structure for returnPlace handling
icogn Feb 8, 2026
66e6f46
Update heart scale and adjust custom rando items
lunarsoap5 Feb 9, 2026
7c40ff1
fix broken msg ids
lunarsoap5 Feb 9, 2026
1a4c2d5
Working except canReturnToDungeonEntrance
icogn Feb 13, 2026
eaccb96
Handle canReturnToDungeonEntrance and edge case
icogn Feb 13, 2026
697193f
Merge remote-tracking branch 'lunar/development' into isaac/midnaRetu…
icogn Feb 13, 2026
806bcae
Refactor and clean
icogn Feb 13, 2026
44d6fe1
Disable overrides when talking to Midna
icogn Feb 13, 2026
4c1870c
Update do_end to use lst address
icogn Feb 13, 2026
319d627
Remove old returnToSpawn and copy over other twilight/form reset code
icogn Feb 13, 2026
d9d9dec
clean up rando code and add case for purple rupee item create.
lunarsoap5 Feb 16, 2026
2dc148f
Adjustments
icogn Feb 16, 2026
d8552bc
Fix wrong param
icogn Feb 17, 2026
6a676cc
Update libtp_rel to point to latest zsrtp/master commit
icogn Feb 17, 2026
e99688e
Merge remote-tracking branch 'lunar/development' into isaac/midnaRetu…
icogn Feb 17, 2026
da4a74f
Clean
icogn Feb 17, 2026
e9467c9
Merge pull request #52 from icogn/isaac/midnaReturnToSpawn
lunarsoap5 Feb 17, 2026
61f05c9
Fix crash on S+Q after void when snowboarding with no Yeto/Yeta present
icogn Mar 1, 2026
f50ab88
Merge pull request #53 from icogn/isaac/fixSnowboardingSqCrash
lunarsoap5 Mar 1, 2026
2ff0ed8
Fix bug with auto filled wallets and the possibility of starting with…
lunarsoap5 Mar 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// For format details, see https://aka.ms/devcontainer.json.
{
"name": "devkitppc",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "devkitpro/devkitppc",

// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers/features/python:1": {
"version": "3.12.5"
}
},

"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.autopep8",
"ms-vscode.makefile-tools",
"ms-vscode.cpptools-extension-pack"
]
}
},

"onCreateCommand": "pip install -r GameCube/bin/requirements.txt"

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
**/*.rel
**/*.elf
**/*.gci
**/*.bin
**/build.*
**/codehandler/*.bin
**/codehandler/*.h
Expand All @@ -11,4 +12,6 @@
Generator/src/obj
Generator/bin
*.tga
*.DS_Store
*.DS_Store

GameCube/bin/seed.bin
2 changes: 1 addition & 1 deletion BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Run the following two commands to fetch and update the [libtp_rel](https://githu

```
git submodule init
git submodule update --remote
git submodule update
```

### Building the Randomizer
Expand Down
178 changes: 117 additions & 61 deletions GameCube/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,22 @@ ifeq ($(strip $(DEVKITPPC)),)
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>/devkitPPC")
endif

ifeq ($(shell which elf2rel),)
$(error "Please install pyelf2rel. pip install pyelf2rel")
endif

ifeq ($(PLATFORM),wii)
include $(DEVKITPPC)/wii_rules
else ifeq ($(PLATFORM),gcn)
include $(DEVKITPPC)/gamecube_rules
endif

# Format: YYYYMMDDHHmm + 2 char Game Region
export BUILDID:='"$(shell date +'%Y%m%d%H%M')"'

# Version
export _VERSION_MAJOR:=1
export _VERSION_MINOR:=2
export _VERSION_MINOR:=3
export _VERSION_PATCH:=0
export _VERSION:='"$(_VERSION_MAJOR).$(_VERSION_MINOR).$(_VERSION_PATCH)"'
# Variant: i.e. Public, NoLogic, Race, etc.
Expand All @@ -33,66 +41,53 @@ export ROOT_DIR ?= $(CURDIR)

export GCIPACK := python3 $(realpath ../bin/gcipack.py)

UNAME := $(shell uname)
export NANDPACK := python3 $(realpath ../bin/nandpack.py)

ifeq ($(UNAME), Linux)
export ELF2REL := $(realpath ../bin/elf2rel)
else
export ELF2REL := $(realpath ../bin/elf2rel.exe)
endif
export RELSMGR := python3 $(realpath ../bin/rels_mgr.py)

export ELF2REL := elf2rel

JSON_READ := python3 $(realpath ../bin/json_read.py)
MAPPER := python3 $(realpath ../bin/relmapper.py)

SEED_PATH := $(realpath ../bin/seed.bin)

DVD ?= ""
ifneq ($(DVD),"")
export DVD_DEF := "-DDVD"
endif

ifeq ($(VERSION),)
all: us jp eu
all: gcn wii
gcn: us jp eu
wii: wus0 wus2 wjp weu
us:
@$(MAKE) --no-print-directory VERSION=us
@$(MAKE) --no-print-directory VERSION=us PLATFORM=gcn
jp:
@$(MAKE) --no-print-directory VERSION=jp
@$(MAKE) --no-print-directory VERSION=jp PLATFORM=gcn
eu:
@$(MAKE) --no-print-directory VERSION=eu

deploy:
@status=$$(git status --porcelain); \
if test "x$${status}" = x; then \
echo Ready for deployment!; \
echo Twilight Princess :: $(PROJECT_NAME) > build.log; \
echo ------------------------- >> build.log; \
echo Version: $(_VERSION) >> build.log; \
echo Variant: $(_VARIANT) >> build.log; \
echo Build ID: $(BUILDID) >> build.log; \
printf "Build Log:\n\n-----\n" >> build.log; \
make clean; \
make all >> build.log; \
echo ----- >> build.log; \
echo Done. >> build.log; \
echo Working directory is dirty; \ echo Ready for deployment!; \
echo Twilight Princess :: $(PROJECT_NAME) > build.log; \
echo ------------------------- >> build.log; \
echo Version: $(_VERSION) >> build.log; \
echo Variant: $(_VARIANT) >> build.log; \
echo Build ID: $(BUILDID) >> build.log; \
printf "Build Log:\n\n-----\n" >> build.log; \
make clean; \
make all >> build.log; \
echo ----- >> build.log; \
echo Done. >> build.log; \
else \
echo Working directory isn\'t clean, cannot release like this...; \
fi
@$(MAKE) --no-print-directory VERSION=eu PLATFORM=gcn
wus0:
@$(MAKE) --no-print-directory VERSION=wus0 PLATFORM=wii
wus2:
@$(MAKE) --no-print-directory VERSION=wus2 PLATFORM=wii
wjp:
@$(MAKE) --no-print-directory VERSION=wjp PLATFORM=wii
weu:
@$(MAKE) --no-print-directory VERSION=weu PLATFORM=wii

clean:
@$(MAKE) --no-print-directory clean_target VERSION=us
@$(MAKE) --no-print-directory clean_target VERSION=jp
@$(MAKE) --no-print-directory clean_target VERSION=eu
@$(MAKE) --no-print-directory clean_target VERSION=us PLATFORM=gcn
@$(MAKE) --no-print-directory clean_target VERSION=jp PLATFORM=gcn
@$(MAKE) --no-print-directory clean_target VERSION=eu PLATFORM=gcn
@$(MAKE) --no-print-directory clean_target VERSION=wus0 PLATFORM=wii
@$(MAKE) --no-print-directory clean_target VERSION=wus2 PLATFORM=wii
@$(MAKE) --no-print-directory clean_target VERSION=wjp PLATFORM=wii
@$(MAKE) --no-print-directory clean_target VERSION=weu PLATFORM=wii

.PHONY: all clean gcn wii us jp eu wus0 wus2 wjp weu
ifneq ($(DVD),"")
export DVD_DEF := "-DDVD"
$(info Building for DVD injection)
endif

.PHONY: all clean us jp eu
else

#---------------------------------------------------------------------------------
Expand All @@ -111,32 +106,58 @@ INCLUDES := $(CURDIR)/include $(CURDIR)/$(LIBTP_REL)/include
# options for code generation
#---------------------------------------------------------------------------------

MACHDEP = -mno-sdata -mgcn -DGEKKO -mcpu=750 -meabi -mhard-float
ifeq ($(PLATFORM),wii)
MACHDEP_PLATFORM = rvl
else ifeq ($(PLATFORM),gcn)
MACHDEP_PLATFORM = gcn
endif

MACHDEP = -mno-sdata -m$(MACHDEP_PLATFORM) -DGEKKO -mcpu=750 -meabi -mhard-float

CFLAGS = -nostdlib -ffunction-sections -fdata-sections -g -Oz -fvisibility=hidden -Wall -Werror -Wextra -Wshadow -Wno-address-of-packed-member -Wno-stringop-truncation $(MACHDEP) $(INCLUDE) $(DVD_DEF) -D_PROJECT_NAME='"$(PROJECT_NAME)"' -D_VERSION_MAJOR='$(_VERSION_MAJOR)' -D_VERSION_MINOR='$(_VERSION_MINOR)' -D_VERSION_PATCH='$(_VERSION_PATCH)' -D_VERSION='"$(_VERSION)"' -D_VARIANT='"$(_VARIANT)"'
CFLAGS = -nostdlib -ffunction-sections -fdata-sections -g -Oz -fvisibility=hidden -Wall -Werror -Wextra -Wshadow -Wno-address-of-packed-member -Wno-stringop-truncation -Wno-class-memaccess $(MACHDEP) $(INCLUDE) $(DVD_DEF) -D_PROJECT_NAME='"$(PROJECT_NAME)"' -D_VERSION_MAJOR='$(_VERSION_MAJOR)' -D_VERSION_MINOR='$(_VERSION_MINOR)' -D_VERSION_PATCH='$(_VERSION_PATCH)' -D_VERSION='"$(_VERSION)"' -D_VARIANT='"$(_VARIANT)"'
CXXFLAGS = -fno-exceptions -fno-rtti -std=gnu++20 $(CFLAGS)

LDFLAGS = -r -e _prolog -u _prolog -u _epilog -u _unresolved -Wl,--gc-sections,--gc-keep-exported -nostdlib -g $(MACHDEP) -Wl,-Map,$(notdir $@).map

# Platform options
ifeq ($(VERSION),us)
CFLAGS += -DTP_US
CFLAGS += -DTP_US -DTP_GUS
CFLAGS += -D_BUILDID='"$(BUILDID)US"'
ASFLAGS += -DTP_US
ASFLAGS += -DTP_US -DTP_GUS
GAMECODE = "GZ2E"
PRINTVER = "US"
PRINTVER = US
else ifeq ($(VERSION),eu)
CFLAGS += -DTP_EU
CFLAGS += -DTP_EU -DTP_GEU
CFLAGS += -D_BUILDID='"$(BUILDID)EU"'
ASFLAGS += -DTP_EU
ASFLAGS += -DTP_EU -DTP_GEU
GAMECODE = "GZ2P"
PRINTVER = "EU"
PRINTVER = EU
else ifeq ($(VERSION),jp)
CFLAGS += -DTP_JP
CFLAGS += -DTP_JP -DTP_GJP
CFLAGS += -D_BUILDID='"$(BUILDID)JP"'
ASFLAGS += -DTP_JP
ASFLAGS += -DTP_JP -DTP_GJP
GAMECODE = "GZ2J"
PRINTVER = "JP"
PRINTVER = JP
else ifeq ($(VERSION),wus0)
CFLAGS += -DTP_US -DTP_WUS0 -DPLATFORM_WII=1
CFLAGS += -D_BUILDID='"$(BUILDID)WUS0"'
ASFLAGS += -DTP_US -DTP_WUS0 -DPLATFORM_WII=1
PACKVER = "us0"
else ifeq ($(VERSION),wus2)
CFLAGS += -DTP_US -DTP_WUS2 -DPLATFORM_WII=1
CFLAGS += -D_BUILDID='"$(BUILDID)WUS2"'
ASFLAGS += -DTP_US -DTP_WUS2 -DPLATFORM_WII=1
PACKVER = "us2"
else ifeq ($(VERSION),weu)
CFLAGS += -DTP_EU -DTP_WEU -DPLATFORM_WII=1
CFLAGS += -D_BUILDID='"$(BUILDID)WEU"'
ASFLAGS += -DTP_EU -DTP_WEU -DPLATFORM_WII=1
PACKVER = "eu"
else ifeq ($(VERSION),wjp)
CFLAGS += -DTP_JP -DTP_WJP -DPLATFORM_WII=1
CFLAGS += -D_BUILDID='"$(BUILDID)WJP"'
ASFLAGS += -DTP_JP -DTP_WJP -DPLATFORM_WII=1
PACKVER = "jp"
endif


Expand Down Expand Up @@ -189,13 +210,19 @@ export OFILES := $(OFILES_BIN) $(OFILES_SOURCES)

export HFILES := $(addsuffix .h,$(subst .,_,$(BINFILES)))

ifeq ($(PLATFORM),gcn)
BANNER_PREFIX := gc
else ifeq ($(PLATFORM),wii)
BANNER_PREFIX := wii
endif

# For REL linking
export LDFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.ld)))
export MAPFILE := $(ROOT_DIR)/$(BUILD)/temp.$(VERSION).lst
export MODIDS := $(realpath assets/modids.json)
export BASE_MAPFILE := $(realpath assets/$(VERSION).lst)
export BANNERFILE := $(realpath assets/banner.raw)
export ICONFILE := $(realpath assets/icon.raw)
export BANNERFILE := $(realpath assets/$(BANNER_PREFIX)_banner.raw)

export SUBREL := $(notdir $(wildcard subrel/*))
export SUBREL_CLEAN := $(addsuffix /clean,$(SUBREL))
Expand Down Expand Up @@ -224,9 +251,15 @@ $(BUILD):
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile

#---------------------------------------------------------------------------------
ifeq ($(PLATFORM),gcn)
OUTPUT_GCI_BIN := $(OUTPUT).gci $(OUTPUT).seeded.gci
else ifeq ($(PLATFORM),wii)
OUTPUT_GCI_BIN := $(OUTPUT).bin
endif

clean_target: $(SUBREL_CLEAN)
@echo clean ... $(OUTPUT_FILENAME) $(VERSION)
@rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).dol $(OUTPUT).rel $(OUTPUT).gci
@rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).dol $(OUTPUT).rel $(OUTPUT_GCI_BIN)

$(SUBREL_CLEAN):
@$(MAKE) -C $(abspath subrel/$(patsubst %/,%,$(dir $@))) clean_target
Expand All @@ -239,7 +272,11 @@ DEPENDS := $(OFILES:.o=.d)
#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
ifeq ($(PLATFORM),gcn)
$(OUTPUT).gci: $(OUTPUT).rel $(BANNERFILE) $(ICONFILE)
else ifeq ($(PLATFORM),wii)
$(OUTPUT).bin: $(OUTPUT).rel $(BANNERFILE)
endif
$(OUTPUT).rel: $(OUTPUT).elf $(MAPFILE) $(SUBREL)
$(OUTPUT).elf: $(LDFILES) $(OFILES)

Expand All @@ -257,11 +294,30 @@ $(SUBREL): $(MAPFILE)
# REL linking
%.rel: %.elf
@echo output ... $(notdir $@)
@$(ELF2REL) $< -s $(MAPFILE) --rel-id $(shell $(JSON_READ) $(MODIDS) "$(OUTPUT_FILENAME)")
@$(ELF2REL) $< $(abspath $(MAPFILE)) $@ --rel-id $(shell $(JSON_READ) $(MODIDS) "$(OUTPUT_FILENAME)")

ifeq ($(DVD),"")
ifeq ($(PLATFORM),gcn)
%.gci: %.rel
@echo packing ... $(notdir $@)
@$(GCIPACK) $< "Custom REL File" "Twilight Princess" "($(PRINTVER)) $(PROJECT_NAME)" $(BANNERFILE) $(ICONFILE) $(GAMECODE) $(addprefix --rel ,$(SUBRELS))
ifneq ("$(wildcard $(SEED_PATH))","")
@echo injecting seed ...
@$(RELSMGR) add $@ 0x53454544 $(SEED_PATH) -o $(basename $@).seeded.gci
endif
else ifeq ($(PLATFORM),wii)
%.bin: %.rel
@echo packing ... $(notdir $@)
@$(NANDPACK) generate -g $(PACKVER) -l 2 -f "$(PROJECT_NAME)" $< $(BANNERFILE) $@
@$(NANDPACK) files add $@ $(SUBRELS) $(addprefix --map ,$(foreach subrel,$(SUBRELS),$(subrel):rel/$(notdir $(subrel:%.$(VERSION).rel=%.rel))))
ifneq ("$(wildcard $(SEED_PATH))","")
@echo injecting seed ...
@$(NANDPACK) files add $@ $(SEED_PATH) -M "$(SEED_PATH):seed.bin"
endif
endif
else
@echo "Skipping packing (building for DVD)"
endif

#---------------------------------------------------------------------------------
# This rule links in binary data with the .jpg extension
Expand Down
Loading