510 Commits

Author SHA1 Message Date
e5523473d6 Item category tweaks, fix two phantom chests 2026-01-06 22:40:00 -06:00
56dd5fbc01 In doors mode, ignore current floor when loading maps 2026-01-06 12:06:04 -06:00
d918e571ab Rearrange some tiles 2026-01-05 06:06:02 -06:00
23edb9a3e6 Supertile shapes, small fixes 2026-01-04 23:02:21 -06:00
21c6d0acfd Many more supertile tweaks 2026-01-04 12:23:56 -06:00
f75db2cac8 AlwaysShowCompass setting 2026-01-04 09:15:10 -06:00
fd8852d866 Lots of bugs fixes and supertile updates 2026-01-04 09:03:23 -06:00
7fc7c8fe0b Full words in supertile shapes file 2026-01-03 17:12:39 -06:00
7a12032067 More supertile shape updates 2026-01-03 13:19:29 -06:00
3489af82fa Add dungeon indicator lettering to maps 2026-01-03 09:58:23 -06:00
fecf9547a5 Sprites for entrances and update supertile shapes 2026-01-03 09:20:51 -06:00
688300d21a Tile warps on map 2026-01-02 17:29:57 -06:00
9b4d79247f Update supertile shapes 2026-01-02 15:01:12 -06:00
1b43799e6e Fix pot shuffle, implement map settings 2026-01-02 03:37:02 -06:00
58db28f8bf Check dungeon prizes, tweak gfx 2025-12-31 12:17:43 -06:00
443080c482 ShowItems settings 2025-12-31 00:21:40 -06:00
10ced3c9c6 Big pass at dungeon item indicators 2025-12-30 21:56:48 -06:00
9a40f28a86 Rename dungeonmap.asm -> bossicons.asm 2025-12-30 16:36:55 -06:00
8de358d99f (de)compression src fixes and windows binaries 2025-12-30 16:35:43 -06:00
1ba813f068 Add src and linux binaries for (de)compression code 2025-12-28 14:30:49 -06:00
13372307c2 Include bosses in option to make baserom playable 2025-12-28 14:29:18 -06:00
63e8d5687b Fix timer and add drop-to-ganon mode 2025-12-14 11:10:23 -06:00
a6ad4c082b Finish pseudoflute 2025-12-13 22:48:03 -06:00
74d9c72cc8 Pseudoflute 2025-12-13 19:06:11 -06:00
18a73e3b88 Add flag to make the baserom work 2025-12-12 21:33:08 -06:00
4f0703ea62 Merge remote-tracking branch 'codemann/OWMain' into GKNew 2025-12-12 18:16:07 -06:00
codemann8
a97f8fbb48 Merged in DR v1.5.2 2025-12-09 16:44:50 -06:00
aerinon
ac7f50fc62 fix: revert to old way 2025-12-09 14:43:47 -07:00
codemann8
dd9ea4d38e Merge branch 'DRUnstable' into OWMain 2025-12-09 09:23:48 -06:00
codemann8
5b7a4c11ed Fixed issue with bonk drops not showing sparkles in DW 2025-12-08 20:40:39 -06:00
aerinon
4437194cfe fix: key counts again 2025-12-08 16:37:51 -07:00
codemann8
0d827eadd2 Merge branch 'DRUnstable' into OWMain 2025-12-04 19:12:35 -06:00
aerinon
fca7f214bc fix: key counts for pot keys and normal absorbed keys 2025-12-04 15:37:02 -07:00
codemann8
a277fb12ac Completed Rain State fixes for Bonk Drops 2025-12-04 12:39:19 -06:00
codemann8
1242198bea Merged in DR v1.5.0 2025-12-03 10:53:43 -06:00
codemann8
96333b22a2 Fixed cucco storm to actually work on first trigger 2025-12-03 10:11:47 -06:00
codemann8
4f4f483647 Completed Rain State fixes for Bonk Drops 2025-12-03 10:10:14 -06:00
codemann8
dfe49a11c4 Merged in DR v1.5.0 2025-12-03 10:09:50 -06:00
codemann8
581e45a63c Merge branch 'DRUnstable' into OWMain 2025-12-03 09:37:31 -06:00
aerinon
b583cc58ff fix: not sure what I was thinking - fix branches and width 2025-12-02 11:09:37 -07:00
KrisDavie
761365927f Prevent prizes dropping in dungeons where they shouldn't (including cave state) and fix rain state items/tablets. 2025-12-02 08:28:08 -07:00
aerinon
68c511d6be fix: skip map check based on "compass" mode 2025-12-02 08:26:33 -07:00
codemann8
94efc26bf3 Merge branch 'limited' into OWMain 2025-12-02 08:57:32 -06:00
codemann8
029f687470 Merge branch 'limited' of https://github.com/codemann8/z3randomizer into limited 2025-12-02 08:57:16 -06:00
codemann8
4dd7bac4d6 Fixed cucco storm to actually work on first trigger 2025-12-02 08:56:53 -06:00
codemann8
1368e15872 Merge branch 'limited' into OWMain 2025-12-01 23:45:56 -06:00
codemann8
2fa0bfc4ef Fixed cucco storm to actually work on first trigger 2025-12-01 23:45:31 -06:00
codemann8
2418c1b322 Fix for post-mirror follower sprite gfx 2025-11-22 06:52:45 -06:00
codemann8
00fb9e6c5d Adding compress/decompress script for use with gfx 2025-11-21 09:20:59 -06:00
aerinon
5936b08497 fix: skip map check only when maps aren't shuffled 2025-11-20 10:04:53 -07:00
aerinon
70a23191ba fix: bunch of fixes for key counting system 2025-11-19 16:29:40 -07:00
codemann8
d21daccf4c changed TF item to use its own gfx id 2025-11-19 08:56:12 -06:00
codemann8
7b93b4b4eb Added new gfx for 10/11 keys rather than A/B keys 2025-11-18 23:54:10 -06:00
aerinon
fee689e583 feat: hud shows all keys, instead of chest keys. Dropped Map requirement for key info. 2025-11-18 15:19:28 -07:00
aerinon
08ecc9b673 feat: pot lose coloring upon collection
fix: normal lamp cone
2025-11-18 10:43:16 -07:00
codemann8
d451b531e7 Added default VRAM values for OWR edge data 2025-11-18 06:09:33 -06:00
aerinon
7f7ffeb5fb feat: lamp cone bitmask settings 2025-11-14 14:37:15 -07:00
aerinon
b27d7c996b feat: enemy "spies" during enemy drop 2025-11-14 09:06:07 -07:00
codemann8
57b8b04f0b Merged in DR v1.4.11 2025-11-13 19:21:33 -06:00
codemann8
7334dd02db Fix to allow VRAM corruption in Blind fight 2025-11-12 10:04:21 +01:00
codemann8
0fdec905d6 Fix to allow VRAM corruption in Blind fight 2025-11-12 02:29:01 -06:00
codemann8
f91e2eb1a2 Re-fixed purple chest follower dupe 2025-11-08 11:12:09 -06:00
codemann8
5a802eda70 Fixed issue with GT Cutscene freezing 2025-11-08 10:29:41 -06:00
codemann8
4d3c2bd7dc Added custom gfx for Ped and Murahdahla 2025-11-03 10:59:08 -06:00
codemann8
fa72adb53d Restore Kodongo AI when in vanilla rooms 2025-10-31 10:37:09 -06:00
codemann8
b24e440597 Fix issue with music silence in DR when straight stairs lead to pre-Aga room 2025-10-31 10:36:23 -06:00
aerinon
44b014fc65 fix: fix for pot drops at sprite limit 2025-10-31 10:29:29 -06:00
codemann8
78fa8b7dd9 Fixed Bosses goal condition check 2025-10-31 01:00:56 -05:00
codemann8
db62d4c660 Fixed issue with Locksmith despawning after purple chest turn-in when a follower is stored 2025-10-29 15:01:47 -05:00
codemann8
2ffcb1c3bd Implemented Custom Goal Framework 2025-10-29 00:08:16 -05:00
codemann8
a9ef09e2d0 Fixed Ganon silvers hint for free-standing items 2025-10-18 02:26:42 -05:00
codemann8
dfc182a2d5 New fix for pot drops when at sprite limit 2025-10-14 11:35:07 -05:00
codemann8
a8b1fc989e Fixed pogdor (frogdor at PoD entrance) with Kiki following while exiting at PoD 2025-09-21 13:40:51 -05:00
codemann8
c3616f2d65 Fixed issue with Duck overwriting GT cutscene gfx 2025-09-21 13:38:02 -05:00
codemann8
912df0be14 Re-fixed old man spawn on pyramid issue 2025-09-07 10:47:23 -05:00
codemann8
2ed9de827b Some follower fixes to support Zelda in TT Prison 2025-09-07 10:47:23 -05:00
9b7e5646b3 Improve junk item configuration 2025-09-05 20:47:36 -05:00
e4f9c4cffc Add variable ganon vulnerability mode 2025-09-03 19:53:10 -05:00
cef41b1674 Merge branch 'OWMain' into GKNew 2025-09-01 10:56:43 -05:00
codemann8
060554a5fb Implemented ability to change GT cutscene gfx 2025-08-25 15:20:36 -05:00
codemann8
e236543180 New gfx for chicken item 2025-08-19 10:17:04 -05:00
codemann8
ea4f39e116 Corrected some music fade-outs during mosaic transitions 2025-08-19 10:16:16 -05:00
codemann8
8ac480947d Fix for music so it doesn't change when going into special OW screens 2025-08-19 10:12:05 -05:00
codemann8
11ff5825ae Fix music change after dig game ends 2025-08-19 10:10:51 -05:00
codemann8
34fa1cd98e Fix issue with music silence in DR when straight stairs lead to pre-Aga room 2025-08-19 10:10:08 -05:00
codemann8
4c5adfbee2 Fix issue with LH/BS half volume issue when exiting to Kakariko 2025-08-19 10:08:36 -05:00
02b07528bb Merge branch 'OWmain' into GKNew 2025-07-22 11:33:34 -05:00
codemann8
6566aa6d48 Restore Kodongo AI when in vanilla rooms 2025-07-13 00:27:22 -05:00
codemann8
7164c3159d Fix crash when Old Man exits out of his House entrance 2025-07-11 04:54:28 -05:00
codemann8
d75d912c7d Added some compass icons to DR pause menu 2025-07-10 22:59:51 -05:00
codemann8
953c115719 Fix HUD to show prize, key count, and compass count if seen by player 2025-07-07 15:03:14 -05:00
9256f48f5e Merge branch 'OWMain' into GKNew 2025-07-01 14:08:48 -05:00
codemann8
1995d8747c Fixed issue with Quake scaring Kiki 2025-06-13 23:39:32 -05:00
codemann8
d8341c650d Fixed issue with Kiki running away at maze if Link spawns from Sanc 2025-06-12 10:28:38 -05:00
codemann8
021ba9d8a6 Actual fix for issue with no music in LH after S+Q from Kakariko 2025-06-12 01:50:21 -05:00
codemann8
4088698af9 Undo MSU Kak Music Fix 2025-06-12 00:54:23 -05:00
codemann8
d19e22cc7d Fix issue with Boots not showing in menu until S+Q 2025-06-10 02:47:08 -05:00
codemann8
e266d351cd Fix issue with despawning follower sprite after purple chest item get 2025-06-08 14:34:16 -05:00
codemann8
baec6954a3 Reset MSU Resume on S+Q 2025-06-05 20:52:13 -05:00
codemann8
faadd1d7f1 Fixing boss behavior in Swamp Palace Arrghus' room 2025-06-05 19:50:49 -05:00
2344f9490e copy skulls manually instead of DMA 2025-05-18 02:56:13 -05:00
642aec9112 Fix gloom heart icons to be loaded via DMA 2025-05-18 02:32:39 -05:00
bc0f396275 Challenge modes: OHKO and Gloom 2025-05-18 00:59:34 -05:00
codemann8
936ff5a882 Locksmith follower now behaves closer to vanilla 2025-05-16 22:20:48 -05:00
a3f892975f Merge branch 'OWMain' into GKNew 2025-05-04 15:18:54 -05:00
codemann8
86efa74185 Various bug fixes for Follower Shuffle post-launch
- Fix issue with infinite purple chest item get
- Fix issue with Kiki running away on iframe ledge hops
- Fix issue with bad follower gfx on screens with followers
- Fix issue with Zelda appearing in conditional follower locations
2025-05-04 09:24:33 -05:00
codemann8
7b4470ddae Merge branch 'DRUnstable' into OWMain 2025-04-30 06:58:20 -05:00
codemann8
2d84f7431e Minor consistency 2025-04-30 06:48:54 -05:00
codemann8
ed7fb312d5 Fixed some incorrect bunny music behavior 2025-04-30 06:26:33 -05:00
codemann8
aabb649578 Initial Follower Shuffle Implementation 2025-04-30 06:18:08 -05:00
aerinon
e86cccad52 fix: fix conveyor bug, unless Helmasaur is present 2025-04-28 14:15:31 -06:00
e92aa018e3 Multiworld junk item shortening 2025-03-17 19:02:02 -05:00
66e4e91beb Dashing mimics and crystal books 2025-03-09 16:42:54 -05:00
bc966c0f99 Dark room modes 2025-03-09 13:25:22 -05:00
codemann8
0bb4d6579e Fix issue with cavestate not showing collected items in dark rooms 2025-02-18 21:49:01 -06:00
codemann8
f50b347aed Fixed VRAM crash on map check 2025-02-16 12:11:07 -06:00
codemann8
160a6c3550 Fixed incorrect ganon silvers hint 2025-01-19 01:29:26 -06:00
codemann8
b06ae7e054 Merge branch 'DRUnstable' into OWMain 2025-01-15 21:41:34 -06:00
codemann8
d42417657b Allow flute use in rain state if weathervane is activated 2025-01-08 08:37:22 -07:00
codemann8
9cbcd33d70 Fixed issue with MapCountDisplay flags not getting set when entering a dungeon and maps aren't wild 2025-01-05 05:33:39 -06:00
codemann8
72b7dea6fd Allow flute use in rain state if weathervane is activated 2025-01-02 04:52:03 -06:00
codemann8
94f8bec8ae Revert "Fixed issue with vanilla HCBK acting like a small key"
This reverts commit d3eb4c229f.
2025-01-02 03:28:31 -06:00
codemann8
51ee4f94c2 Added ability to suppress dungeon item textboxes when items appear in their respective dungeons 2024-12-25 22:56:05 -06:00
codemann8
2e0eb97a4b Fixed rare crash during music transition 2024-12-14 14:11:11 -06:00
codemann8
274ef3f39d Improved Psuedoboots 2024-12-13 16:52:20 -06:00
codemann8
3b41876887 Yet another fix for Hera boss music 2024-11-10 11:24:31 -06:00
codemann8
d3eb4c229f Fixed issue with vanilla HCBK acting like a small key 2024-10-30 10:20:51 -05:00
codemann8
4b98d44820 Merge branch 'DRUnstable' into OWMain 2024-10-15 18:45:40 -05:00
codemann8
c0ba9ee79f Fixed issue with items not showing in dark rooms 2024-09-18 11:36:18 -05:00
codemann8
9e84707f13 Fixed crash on pedestal pull 2024-09-03 10:02:10 -05:00
codemann8
a7af829159 Fix issue with Potion Shop prices drawing on top of Link 2024-08-29 01:06:36 -05:00
codemann8
bee67e66fb Fix weird palette issue during item collection inside Potion Shop 2024-08-29 01:06:09 -05:00
codemann8
d3c2a27ca5 Fix bad screen scroll issue when failing water entry in Zora's Domain 2024-08-28 22:12:25 -05:00
codemann8
cf6268fd1e Fix GFX for small magic drop 2024-08-28 22:11:50 -05:00
codemann8
5a78fa8420 Fix red crystal gfx in dark rooms 2024-08-27 10:05:48 -05:00
codemann8
d664587220 Fix Hera Cage enemy drops being off center 2024-08-27 09:02:20 -05:00
codemann8
46bf02f7ca Fix for post-Aga GFX, bandaid fix for decompression on boot 2024-08-27 07:19:33 -05:00
codemann8
8630b36ef1 Fix black custom palette GFX on item collection 2024-08-27 07:18:18 -05:00
codemann8
a686a718c7 Show shadow on hidden enemies if enemy drops enabled 2024-08-27 07:16:11 -05:00
codemann8
b3979affc9 Don't delete follower on crystal cutscene if prize shuffle 2024-08-27 07:15:18 -05:00
codemann8
8b827c3745 Attempt to fix issue with no music in LH after S+Q from Kakariko 2024-08-27 07:14:19 -05:00
codemann8
23943f2234 Fix some music issues 2024-08-27 07:12:57 -05:00
codemann8
a5dfd97687 Merged in DR v1.4.5 2024-08-16 23:00:45 -05:00
codemann8
f750b7cb06 Hera basement key double counting fix 2024-08-16 21:46:18 -05:00
codemann8
c7c97196fb Fixed issue with drawing A items on HUD with DR menu 2024-08-16 21:41:43 -05:00
codemann8
016ccfd687 Adding collected prizes to map check in prize shuffle 2024-05-30 22:52:19 -05:00
codemann8
d87a88fefd Fixed incorrect red crystal gfx from item receipt 2024-05-30 16:42:02 -05:00
codemann8
9de69d0313 Added flute cancel X gfx to flute map 2024-05-30 16:41:13 -05:00
codemann8
2b38f847bb Changing LW dungeon icons to letters 2024-05-29 19:22:00 -05:00
codemann8
6be3f57977 Adding crystal numbers to prizes in map check 2024-05-29 19:21:24 -05:00
codemann8
879b02387e Fixed issue with HP refill canceling out of post-boss cutscene 2024-05-29 16:16:05 -05:00
codemann8
07b0333d51 Hiding dungeon icons on OW map check if Prizes are wild 2024-05-29 03:38:23 -05:00
codemann8
3deca59f2e Adding colorblind friendly red crystal gfx 2024-05-29 03:36:56 -05:00
codemann8
f933849fbf Last Prize Shuffle changes 2024-05-25 03:13:26 -05:00
codemann8
c9f6971cee Merge branch 'DRUnstable' into OWMain 2024-05-23 20:30:24 -05:00
codemann8
f9da730caf Initial Prize Shuffle Implementation 2024-05-23 18:23:26 -05:00
codemann8
b76d440958 Reimplemented part of the TF Cutscene for new item code 2024-04-30 07:50:38 -05:00
codemann8
ad5eafec61 Fix issue with GT Inverted Map not correctly opening GT 2024-04-21 09:30:47 -05:00
codemann8
50895c1ac2 Potential fix for weird bonk item dupe onto other standing items 2024-04-21 00:50:38 -05:00
codemann8
0d84af814a Merged in DR v1.4.1.10 2024-04-18 09:47:17 -05:00
codemann8
c465ff61dc Fixed issue with Aga transition not restoring vanilla gfx 2024-04-18 09:13:27 -05:00
codemann8
a45f92123a Changed bee refill gfx to be non-animating 2024-04-13 10:16:29 -05:00
codemann8
e71c7641b5 Swap some table variables to match upstream 2024-04-13 10:15:49 -05:00
codemann8
b22d618323 Fixed issue with Flute Cancel in OW Layout Shuffle 2024-04-13 03:18:26 -05:00
codemann8
2367f16179 Formatting and notation 2024-04-10 04:26:17 -05:00
codemann8
279a0ad030 Various GFX fixes 2024-04-10 03:17:03 -05:00
codemann8
d34cb70444 Bee traps for other MW players in shops will not disguise 2024-04-10 03:16:38 -05:00
codemann8
f58277eb55 Fixed issue with MW items awarding player with item 2024-04-10 03:13:23 -05:00
codemann8
bbbc3b1420 Fixed fake world handling for glitched modes 2024-04-10 03:12:49 -05:00
codemann8
27685ac77d More merge labeling 2024-04-09 13:24:54 -05:00
codemann8
9cfeb18fef Merged in DR v1.4.1.9 2024-03-30 04:30:56 -05:00
codemann8
9178309286 Minor consistency 2024-03-30 04:20:31 -05:00
codemann8
e15585c184 Slight correction for old OWR initial implementation 2024-03-25 21:46:52 -05:00
codemann8
8cfa94b49e Changed bee refill gfx to be just a bee 2024-03-25 21:45:44 -05:00
codemann8
b71b48b4b1 Restructured GFX drawing routine to a more generic approach 2024-03-25 14:29:00 -05:00
codemann8
6e4b109058 Bee Trap to not be disguised if for another player 2024-03-24 17:49:37 -05:00
codemann8
c9144cd707 Bonk sparkles to not accumulate during medallion animation 2024-03-24 17:48:27 -05:00
codemann8
4b332c35a4 Removed unneeded MiniGameTimer setting 2024-03-24 17:47:39 -05:00
codemann8
495a8c93f7 Removed unused superbunny mirror bonk freeze code 2024-03-24 17:42:34 -05:00
codemann8
e82006e030 Fix gfx issue with Catfish item spawning off screen 2024-03-21 07:11:46 -05:00
codemann8
a97705ccd9 Added better item animation structure 2024-03-21 05:38:24 -05:00
codemann8
26d9ea5522 Fixed issue with item gfx not transferring to VRAM 2024-03-21 05:32:40 -05:00
codemann8
36f930d42c Various cleanup 2024-03-20 17:47:16 -05:00
codemann8
c0e7343e9b Fix issue with bonk items not updating HUD on location clear 2024-03-20 17:46:59 -05:00
codemann8
6606835eb9 Fix issue with animated items not animating 2024-03-20 17:46:30 -05:00
codemann8
56e6319c45 Various GFX fixes 2024-03-20 17:45:48 -05:00
codemann8
859cfcc275 Fix for Hera Basement key for this dungeon not displaying correctly 2024-03-20 17:44:29 -05:00
codemann8
e34466e214 Fix issue with GFX not clearing out of dynamic drop gfx slots 2024-03-20 17:44:01 -05:00
codemann8
460cccbddd Fix issues with item shadows 2024-03-20 17:43:20 -05:00
codemann8
0392503049 Fix issue with palette not loading in GT Torch/Hera Basement 2024-03-20 17:41:58 -05:00
codemann8
12a825a0fe New GFX for bee traps and others 2024-03-20 17:41:11 -05:00
codemann8
b9da56c8ad Added flag to skip bee trap disguises in various scenarios 2024-03-20 17:38:57 -05:00
codemann8
56def59f58 Fix invisible powder item 2024-03-20 17:34:12 -05:00
codemann8
7f223a872c Fix incorrect GitHub merge 2024-03-16 00:30:08 -05:00
codemann8
ba44924d11 Merged in DR v1.4.1.8 2024-03-16 00:18:53 -05:00
codemann8
068d97f99b Fixed issue with Flute Cancel code using RAM claimed from upstream 2024-03-15 21:09:10 -05:00
codemann8
2e541a8778 GitHub sucks, so heres a merge commit 2024-03-01 14:03:23 -06:00
codemann8
a008406fde Implmented New Item GFX System 2024-03-01 14:00:10 -06:00
codemann8
59eb254116 Merged in DR v1.4.1.6 2024-03-01 13:55:23 -06:00
codemann8
8135e9085f Merged in DR v1.4.1.6 2024-02-23 11:42:02 -06:00
codemann8
75fd81ab57 Merged in DR v1.4.1.6 2024-02-23 11:11:59 -06:00
codemann8
de5e83c172 Moving credits files to new location 2024-01-28 04:57:42 -06:00
codemann8
3b3a153ebe Adding sparkles to Bonk Drop locations 2023-12-31 03:11:25 -06:00
codemann8
81f0270ca4 Consolidated Bonk Drop to use shared codebase 2023-12-31 03:07:33 -06:00
codemann8
00352cc52a Merge branch 'DRUnstable' into OWMain 2023-11-18 14:44:10 -06:00
codemann8
3cbc1ab42e Marking OW screens as visited 2023-11-08 13:50:03 -06:00
codemann8
3dfae76275 Play GT2 track in DR if GTBK is collected 2023-11-05 08:44:19 -06:00
codemann8
6de8dc606c Fix issue with incorrect track playing on DDM 2023-11-05 08:39:54 -06:00
codemann8
84992d010f Fix for playing correct track after Agas and GT cutscene 2023-11-05 08:39:13 -06:00
codemann8
43552d1a64 Fix Hera music to play correct dungeon track following a floor change 2023-10-24 07:38:06 -05:00
codemann8
a6507eea6d Fix for Hera boss music fadeout when falling 2023-10-22 16:23:43 -05:00
codemann8
68af5f735e Minor formatting and bug prevention 2023-10-10 01:29:50 -05:00
codemann8
766cc67dcd Fix heart piece dupe respawn issue 2023-10-10 01:28:20 -05:00
codemann8
70badade72 Fix for Hera boss music fadeout when falling 2023-10-10 01:26:30 -05:00
codemann8
edad66a5a8 New solution for mirror portal disabling in Crossed OWR 2023-10-01 06:12:18 -05:00
codemann8
47ce48a31a Fixed mirror sprite shown on map check in Crossed OWR 2023-10-01 06:11:27 -05:00
codemann8
f3b2719a5b Merge branch 'DRUnstable' into OWMain 2023-09-29 15:00:36 -05:00
codemann8
fdd8fedaef New solution for mirror portal disabling in Crossed OWR 2023-09-28 22:01:18 -05:00
Catobat
4c1433464e Fix issue with rooms $0124-$0127 at Tavern Back 2023-09-27 16:15:20 -05:00
codemann8
8e9b4c234b Fix Old Man death putting you on Pyramid 2023-09-27 16:09:45 -05:00
codemann8
173b474b9d Merge branch 'DRUnstable' into OWMain 2023-08-07 15:10:13 -05:00
codemann8
2f8daa3903 Merge branch 'DRUnstable' into OWMain 2023-07-19 14:28:55 -05:00
codemann8
ffe7985139 Adjusting bottle vendor fish prizes to be centered and display key GFX correctly 2023-07-11 12:44:50 -05:00
codemann8
f51df3e6eb Fixed issue with Kakariko music playing when killing Aggro Guards in enemizer 2023-07-03 15:54:59 -05:00
codemann8
144817fe90 Fixed issue where Aga Door flag prevented TF Cutscene 2023-06-29 19:28:49 -05:00
codemann8
cac3ecf4ef Using new overflow GFX slot and redraw after item get 2023-06-29 19:26:36 -05:00
codemann8
e8a0697829 Fixed issue where items spawning off screen might not redraw 2023-06-16 20:40:01 -05:00
codemann8
1235357531 Using new overflow GFX slot and redraw after item get 2023-06-15 11:12:40 -05:00
codemann8
6dab19d38f Reversed earlier change and targeting Good Bee bonk item instead
Change reversed: Fixed issue where bonk drops were drawing narrow sprites 4 pixels to the
2023-06-14 00:28:25 -05:00
codemann8
c5d7f3291a Minor change to Inverted map terrain of Mimic Cave Ledge 2023-05-16 04:31:44 -05:00
codemann8
b170620285 Fixed issue where bonk drops were drawing narrow sprites 4 pixels to the right 2023-05-14 17:55:14 -05:00
codemann8
9c08588d92 Added a TF Cutscene when getting the TF item 2023-05-13 02:07:40 -05:00
codemann8
3497bd6514 Fixed issue with enemy key drops using wrong palette/GFX sheet 2023-05-12 23:57:13 -05:00
codemann8
71916fb320 Fixed Hera boss music playing after boss defeated 2023-05-12 20:37:33 -05:00
codemann8
81a3fcf773 Fixed 99 bonk limit in stats counters 2023-05-12 20:14:36 -05:00
codemann8
0933392e6d Rearranged new rotating slotted GFX code to allow drawing to specific slots 2023-05-12 20:14:02 -05:00
codemann8
0803e6e290 Allow Murahdahla to act like Murah at Pyramid in rainstate 2023-05-12 20:08:15 -05:00
codemann8
38fa9c3902 Fix for avoiding Arrghus/Zora splash GFX issues 2023-05-10 23:12:42 -05:00
codemann8
1b564d99fc Fixed Apple GFX by using other VRAM slots in the rotation 2023-05-09 21:27:00 -05:00
codemann8
06d22255ef Added Chicken GFX to GFX tables 2023-05-09 16:41:17 -05:00
codemann8
8e48df8c12 Good Bees now spawn automatically under pots 2023-05-09 02:53:08 -05:00
codemann8
5c640a05f1 Fixed issue with menu not allowing DPad input during menus if standing item is visible 2023-05-09 00:10:07 -05:00
codemann8
c002b974f9 Fixed issue with key gfx not drawing correctly during tablet animation 2023-05-09 00:09:16 -05:00
codemann8
9651f9fb1d Added better GFX for fairy and good bee 2023-05-08 07:48:48 -05:00
codemann8
09d93ae5f2 Apples and Bee Traps now spawn automatically under pots 2023-05-08 05:01:44 -05:00
codemann8
bae7457961 Fix bonk dupe and bonk despawn issues 2023-05-05 22:13:38 -05:00
codemann8
9500800c3c Minor formatting and small optimization 2023-05-05 22:11:19 -05:00
codemann8
48b2238109 Animate rupee items in shops 2023-05-05 22:09:37 -05:00
codemann8
20f8ef457e Converting item GFX drawing to use pottery draw method 2023-05-05 20:54:36 -05:00
codemann8
90396136d3 Fixed issue with Bonk Drops not spawning due to OW flags 2023-04-24 00:08:54 -05:00
codemann8
40d301b3e0 Animate standing rupees instead of drawing new OAM slot 2023-04-20 20:32:18 -05:00
codemann8
3d9b76eda0 Fix pottery to retain gfx during map check 2023-04-16 04:34:55 -05:00
codemann8
bd2ebd7827 Animate standing rupees for enemy drops 2023-04-15 05:17:22 -05:00
codemann8
8a9b138d55 Animate standing rupees instead of drawing new OAM slot 2023-04-15 01:09:38 -05:00
codemann8
480372f7a5 Merged in DR v1.2.0.16 2023-04-14 15:30:35 -05:00
codemann8
7da838d1fc Changed bonk drops to not set flag if sprite is off screen 2023-04-13 15:00:57 -05:00
codemann8
12691a0c4a Fixed issue with bonk drops causing other duplicate spawns 2023-04-09 11:07:39 -05:00
codemann8
511cc1af51 Fix for Hera music silence 2023-04-07 15:42:34 -05:00
codemann8
f89802a74e Symmetrical GTCutscene Crystals 2023-04-05 08:31:30 -05:00
codemann8
dd29578c0a Temporary fix for avoiding VRAM issues in non-layout OWR modes 2023-04-03 08:21:16 -05:00
codemann8
25dc4217c6 Fixed Old Man Death causing fake world in glitched 2023-04-02 07:39:02 -05:00
codemann8
d97f5fd23e Set up code structure for future OW palette changes and return to safer changes 2023-03-22 16:06:47 -05:00
codemann8
1bdcbf5b62 Fixed issue with no Woods mosiac on exit in vanilla OW 2023-03-19 12:21:22 -05:00
codemann8
d4e792a71f Fixed issue with MW Player ID on Bonk Locations 2023-03-19 11:00:22 -05:00
codemann8
cb1a4cbb69 Update owrando.asm 2023-03-18 19:14:10 -05:00
codemann8
84b3c1ad50 Correcting OW screen palette on transition 2023-03-18 19:13:04 -05:00
codemann8
8522968c1b Correcting OW screen palette on transition 2023-03-18 05:46:34 -05:00
codemann8
ee4fce4010 Moving some hijacked DR code to new location 2023-03-17 20:06:56 -05:00
codemann8
8d3e084c1d Load correct Link/Bunny palette on transition 2023-03-16 22:21:39 -05:00
codemann8
92e04bde55 Adjusting Bonk Sprite landing position and water ripple 2023-03-15 05:43:39 -05:00
codemann8
1316477771 Reserving space for OWR Version 2023-03-14 17:34:42 -05:00
codemann8
49c486a2cc Merged in DR v.1.2.0.13 2023-03-14 17:25:37 -05:00
codemann8
726b9441b7 Merge branch 'DRUnstable' into OWMain 2023-03-14 17:18:06 -05:00
codemann8
11e815bd96 Fixed item duping issue on OW 2023-03-14 06:20:04 -05:00
codemann8
fb1f7ad907 Fixed Desert Pass WS edge coordinates 2023-03-13 21:53:36 -05:00
codemann8
eeebe58819 Fixing issue with forced HP on Good Bee Bonk Location 2023-03-12 21:45:16 -05:00
codemann8
8e8c195fa9 Minor label reference change for Good Bee Bonk Location 2023-03-12 20:21:16 -05:00
codemann8
8102b75b0c Added Cold Fairy Statue to bonkable locations 2023-03-09 20:28:18 -06:00
codemann8
a1fb6ea1af Add new Good Bee item 2023-03-08 21:26:25 -06:00
codemann8
f8602a74cb Remove 5 Arrow Item 2023-03-08 20:38:34 -06:00
codemann8
f703dcaba7 Merged in DR v1.2.0.12 2023-03-08 16:12:42 -06:00
codemann8
67f2164caf Merge branch 'DRUnstable' into OWMain 2023-03-07 18:46:25 -06:00
codemann8
1453dd12a7 Merged in DR v1.2.0.10 2023-03-02 18:57:26 -06:00
codemann8
750c412f59 Minor comment change 2023-02-25 21:37:44 -06:00
codemann8
b1f23151a2 Disable flute in rain state 2023-02-25 21:37:25 -06:00
codemann8
09b75c3bf6 Merged in DR v1.2.0.9 2023-02-24 16:00:54 -06:00
codemann8
2136de4928 Merge pull request #9 from Catobat/HoboFix 2023-02-24 10:46:32 -06:00
Catobat
aa5c3b63a2 Fix swim state when leaving Hobo area 2023-02-24 13:14:19 +01:00
codemann8
3f13cee945 Improved door landing 2023-02-18 10:36:40 -06:00
codemann8
bfb131be81 Merged in DR v1.2.0.8 2023-02-17 18:47:36 -06:00
codemann8
7fdc59bb08 Improved door landing 2023-02-01 22:14:38 -06:00
codemann8
fd53cea697 Merge branch 'DRUnstable' into OWMain 2023-01-30 11:59:05 -06:00
codemann8
468fe5f2af Improved door landing 2023-01-30 10:34:48 -06:00
codemann8
bae7c6175c Merge branch 'DRUnstable' into OWMain 2023-01-06 21:20:56 -06:00
codemann8
782f18d9d9 Merge branch 'DRUnstable' into OWMain 2022-12-16 17:16:08 -06:00
codemann8
4af93256a5 Merged DR v1.2.0.0 2022-12-01 14:10:35 -06:00
codemann8
1e2a0c7774 Remove the sprite spawn delay when bonking prizes 2022-11-08 18:52:11 -06:00
codemann8
0174e5dbf5 Fixed fake world handling for IB transitions 2022-10-26 13:45:19 -05:00
codemann8
01475f313a Fixed fake world handling for IB transitions 2022-10-26 07:54:05 -05:00
codemann8
74b01030e0 Fixed Murahduhla freeze issue 2022-10-24 17:56:32 -05:00
codemann8
bf034c0f7c Setting World flag on initial spawn 2022-10-22 09:12:20 -05:00
codemann8
43448cc5b6 Fixed OOB transition behavior in Mixed OWR 2022-10-21 00:11:45 -05:00
codemann8
33cfd010a0 Renamed/used some labels 2022-10-20 10:25:08 -05:00
codemann8
3ed0ec0835 Merge pull request #8 from Catobat/Terrain 2022-10-12 21:18:18 -05:00
Catobat
d8e11838c1 Fix direction Link is facing 2022-10-13 00:55:20 +02:00
Catobat
304cb34478 Consistent handling of glitched states 2022-10-13 00:46:24 +02:00
codemann8
36feaff153 Merge pull request #7 from Catobat/Terrain 2022-10-08 18:56:47 -05:00
Catobat
10567536a1 Add free RAM notes 2022-10-08 18:18:50 +02:00
Catobat
4ccca38888 Implement forced transitions 2022-10-08 18:09:44 +02:00
codemann8
f0a15dce36 Fixed incorrect comment 2022-09-07 19:41:39 -05:00
codemann8
3c6c089323 Added warning if overworld map code exceeds original bounds 2022-09-07 19:41:01 -05:00
codemann8
223c086c82 Merge branch 'DRUnstable' into OWMain 2022-09-07 19:38:34 -05:00
codemann8
ee7e08f46c Merge branch 'DRUnstable' into OWMain 2022-08-25 16:14:08 -05:00
codemann8
348da3ac99 Chickens now spawn on same layer as Link 2022-08-25 00:27:25 -05:00
codemann8
93b1949c71 Merged DR v1.0.1.1 2022-08-18 20:51:22 -05:00
codemann8
bfa105fd62 Minor MSU change for bunny music 2022-08-18 20:48:51 -05:00
codemann8
f60b03ba42 Fixed TR Peg Puzzle Not Spawning Portal Overlay 2022-07-31 21:46:54 -05:00
codemann8
c029de9cdc Fixed disappearing mirror portal in Inverted 2022-07-31 21:12:54 -05:00
codemann8
25761a1aa6 Changed MSU-1 in Inverted to flip the triggers for the secondary OW tracks 2022-07-31 21:11:40 -05:00
codemann8
c209abd2a5 Fixed Sprite Author in credits to have same gap as other groups 2022-07-31 09:06:35 -05:00
codemann8
bbc7197933 Adding print statements to help with Credits Debugging 2022-07-29 16:10:36 -05:00
codemann8
8aeeb5efa3 Changed to spawn sprites in chests to nearest 8 pixel boundary 2022-07-29 13:13:03 -05:00
codemann8
9cca3adb8e Reserving space for the excluded Murahduhla tree sprite in Bonk Drop shuffle 2022-07-28 19:23:43 -05:00
codemann8
324014bb54 Added struct for OW Bonk Prize data table 2022-07-28 18:53:01 -05:00
codemann8
6f58eb7c2c Update OW Event Data documentation for newly occupied Bonk Drop Shuffle bitflag slots 2022-07-28 16:54:02 -05:00
codemann8
5d65ae09da Fixed SP floodgate issue 2022-07-28 16:53:17 -05:00
codemann8
da85032de2 Fixed disappearing mirror portal in Inverted+CrossedOWR 2022-07-28 16:03:53 -05:00
codemann8
959f5ce5ab Fixed all goals requiring Aga2 to look at the Aga2 boss flag instead of pyramid hole 2022-07-27 17:53:15 -05:00
codemann8
b107297705 Moving some of the bonk sprite offsets up so the item is collectable without boots 2022-07-26 18:43:06 -05:00
codemann8
cce3594532 Fixed issue with Inverted Aga portal not displaying tile correctly pre-Aga 2022-07-26 18:30:04 -05:00
codemann8
b25c477958 Bonk Trees will revert color after collection 2022-07-26 18:13:20 -05:00
codemann8
1be10e5e12 Fixed issue with Inverted Aga portal not displaying tile correctly pre-Aga 2022-07-26 17:51:15 -05:00
codemann8
2cee6ea4ee Fixed issue with Inverted Aga portal not displaying tile correctly pre-Aga 2022-07-26 17:34:59 -05:00
codemann8
fff99a2f6b Fixed issue with bonk prize on screen 2B 2022-07-24 14:56:03 -05:00
codemann8
1716b4583c Fixed wrong loot ID reference 2022-07-24 13:55:39 -05:00
codemann8
5e6038b464 Shift AddReceivedItemExpanded data section down, sorry Fish 2022-07-24 13:44:11 -05:00
codemann8
8ccf8ecd66 Adding alternate tree colors for Bonk Drops 2022-07-24 11:30:46 -05:00
codemann8
ed72830397 Implemented Bonk Drop Shuffle 2022-07-24 11:29:28 -05:00
codemann8
6696f4bc24 Add new items from Bonk/Pot pool 2022-07-24 11:23:48 -05:00
codemann8
ac934dde3b Formatting improvements 2022-07-19 14:08:22 -05:00
codemann8
c64d0266d5 Move owrando hook out of DR and into main rando 2022-07-18 07:10:49 -05:00
codemann8
7ae2102a16 Revert "Merged DR v1.0.1.0"
This reverts commit 7ddca582e5.
2022-07-08 10:25:00 -05:00
codemann8
7ddca582e5 Merged DR v1.0.1.0 2022-07-08 10:15:00 -05:00
codemann8
7c7664224e Merged DR v1.0.1.0 2022-07-08 05:32:08 -05:00
codemann8
2298148206 Added new DPad invert options for just L/R and just U/D 2022-05-25 14:52:50 -05:00
codemann8
f86780913f Fixed issue with mirror portals showing up in DW in Crossed OW 2022-05-21 20:53:00 -05:00
codemann8
9b846498a2 Moved some mirror code out to new function 2022-05-21 20:51:54 -05:00
codemann8
9b48477418 Adding explicit notation to ASM commands for asar 2022-05-21 20:48:44 -05:00
codemann8
5842cecf0d Replacing hardcoded jumps and references to labels 2022-05-21 20:47:01 -05:00
codemann8
74f66abf51 Replacing hardcoded jumps and references to labels 2022-05-21 20:44:38 -05:00
codemann8
c157708769 For moving mirror portals in Crossed OW, changing EOR to ORA 2022-05-21 17:46:29 -05:00
codemann8
478d4fc7f3 Fix issue with mirror portals showing up on map checks when they shouldn't 2022-05-21 14:55:42 -05:00
codemann8
57bc6a1f59 Fixed crash in Crossed OW when performing mirror superbunny 2022-05-21 11:04:15 -05:00
codemann8
04948c72f6 Adding Catobat to OWR credits 2022-05-17 08:04:37 -05:00
codemann8
a62fcff30a Add lowercase letters to credits end screen 2022-05-05 23:24:32 -05:00
codemann8
31e98903bc Unscramble lowercase letters for new font 2022-05-05 18:26:11 -05:00
codemann8
34f4b72524 Adding labels and rearrange some of the Special Transition code 2022-05-04 16:31:32 -05:00
codemann8
e1a17fa945 Merge pull request #6 from Catobat/Special
Randomize Special Transitions
2022-05-04 15:58:45 -05:00
Catobat
c62b69d1a8 Randomize Special Transitions 2022-05-01 01:25:21 +02:00
codemann8
a26b128b52 Merge remote-tracking branch 'upstream/DRUnstable' into OWMain 2022-04-21 13:11:31 -05:00
codemann8
405edc51b5 Merge pull request #5 from Catobat/MixedMap
Implement new overworld map draw routine for Mixed
2022-04-20 16:51:23 -05:00
Catobat
d1a874cd7f Implement new overworld map draw routine for Mixed 2022-04-20 23:38:20 +02:00
codemann8
0a7b886978 Merge remote-tracking branch 'upstream/DRUnstable' into OWMain 2022-04-19 21:32:47 -05:00
codemann8
0a57153762 Changed OW map in attract mode to show LW map always 2022-04-15 10:48:33 -05:00
codemann8
436ecbb17d Merged DR v1.0.0.3 2022-04-15 10:34:10 -05:00
codemann8
ed03692bef Fix from Aerinon for map/compass dungeon locations on map check 2022-04-10 19:16:24 -05:00
codemann8
c7f9b5c3a0 Fixed map check for GT skull icon to check if Aga2 defeated rather than pyramid hole opened 2022-04-05 11:29:46 -05:00
codemann8
7dabea9f8b Update events.asm 2022-03-26 07:03:54 -05:00
codemann8
da788dadcd Merge remote-tracking branch 'upstream/DRUnstable' into OWMain 2022-03-26 07:00:13 -05:00
codemann8
697a742e09 Minor fix to flute SFX for pre-activated flute 2022-03-18 23:21:45 -05:00
codemann8
eb30242920 Fixed mirror bonk issue incorrectly leaving a mirror portal behind 2022-03-07 20:12:32 -06:00
codemann8
bd8b79ae5c Fixed issue with mirror portal not spawning when entering OW from the DW in Crossed OWR 2022-03-07 19:03:52 -06:00
codemann8
4958d43d71 Some additional changes to lowercase dungeon text 2022-02-24 06:05:23 -06:00
codemann8
cb48137fa7 Fixed issue with mirror portal deleting after mirror bonk in Crossed OW 2022-02-22 19:55:02 -06:00
codemann8
e01e8569d7 Fixed issue with TR Peg Puzzle Portal not working 2022-02-07 19:20:32 -06:00
codemann8
ea8f4dbc57 Fixed issue with TR Peg Puzzle Portal not working 2022-02-07 18:00:10 -06:00
codemann8
ece66e38df Added lowercase version of dungeon item text 2022-02-06 01:00:16 -06:00
codemann8
ba8a9aeb90 Merged in Upstream ER changes 2022-02-04 06:04:26 -06:00
codemann8
98949be9bc Changed GT/AT swap in Mixed OW to prioritize leaving AT vanilla unless GT is the only one in the starting world 2022-02-03 06:13:13 -06:00
codemann8
ddd86a96cf Minor code improvement 2022-02-02 20:00:49 -06:00
codemann8
c7718e7a47 Fixed Hera boss music to correctly read boss defeated flag 2022-01-19 14:39:19 -06:00
codemann8
335744f7b6 Restored vanilla Ice Palace terrain for Inverted 2022-01-19 03:18:31 -06:00
codemann8
7633c8b586 Fixed Hera boss music to correctly read boss defeated flag 2022-01-19 02:31:38 -06:00
codemann8
1677b95744 Restoring vanilla terrain for glitched Inverted modes 2022-01-19 01:42:16 -06:00
codemann8
14748b7788 Fixed world flag on Mountain Cave start 2022-01-19 01:39:24 -06:00
codemann8
bfbc7f16b1 Fixed issue with spawning on Pyramid/HC Ledge with old man 2022-01-19 00:23:24 -06:00
codemann8
c79863aad2 Fixed issue with Inverted Mirror Bonks not getting applied appropriately 2022-01-18 03:14:09 -06:00
codemann8
b72f89ff87 Made flute SFX louder for preactivated flute item get 2022-01-15 20:56:16 -06:00
codemann8
51d7f663c3 Restored vanilla ladder to Dark Graveyard in Inverted 2022-01-15 13:28:45 -06:00
codemann8
49b0cf0669 Inverted TR Peg screen terrain changes 2022-01-15 12:40:51 -06:00
codemann8
cbc4bbd6f3 Removed ladder from DDM 2022-01-15 12:22:01 -06:00
codemann8
3e9f598fe1 Added flute SFX to itemget if collecting a pre-activated flute 2022-01-15 04:07:27 -06:00
codemann8
f2a03f0bda Reorganized and reserved new starting data section 2022-01-14 12:59:14 -06:00
codemann8
fdea61fbf3 Added Starting OW Flag Table 2022-01-13 22:09:01 -06:00
codemann8
b5e313d709 Added Starting OW Flag Table 2022-01-13 21:56:03 -06:00
codemann8
5589127f81 ER Fix by cassidy 2022-01-13 21:54:56 -06:00
codemann8
d71e873d72 Extended Spiral/Mimic Ledge in Inverted 2022-01-06 12:45:27 -06:00
codemann8
c5ff897be6 Inverted TR Peg screen terrain changes 2022-01-06 11:39:21 -06:00
codemann8
b20f9ddd67 Merged DR v0.5.1.7 2022-01-06 02:13:05 -06:00
codemann8
67b96b3051 Extended Spiral/Mimic Ledge in Inverted 2022-01-06 01:52:58 -06:00
codemann8
d75325e1c5 Move mirror portal off screen during mirror bonk in Crossed OW 2021-12-22 10:51:26 -06:00
codemann8
0a4c624f2f Move mirror portal off screen during mirror bonk in Crossed OW 2021-12-22 10:49:12 -06:00
codemann8
9c3d85e360 Improvement to FF damage fix to insta-warp Link to destination once Link has exceeded the bounds of the current screen 2021-12-13 23:16:29 -06:00
codemann8
c3df5f6cb1 Fixed mirror portals showing in DW 2021-12-06 07:43:04 -06:00
codemann8
a1fff4ff76 Fix mirror portals getting erased when changing worlds 2021-11-24 15:58:39 -06:00
codemann8
10ad8ab834 Fix mirror portals getting erased when changing worlds 2021-11-22 09:07:38 -06:00
codemann8
3262c6ff1a Fix mirror portals getting erased when changing worlds 2021-11-20 00:34:57 -06:00
codemann8
9094d118df Fixed Inverted Double-Swap issue 2021-11-14 17:08:06 -06:00
codemann8
7d80b8087a Allow normal Link speed with Old Man if not in his cave or on WDM 2021-11-07 16:24:45 -06:00
codemann8
15a381769c Merge branch 'DRMain' into OWMain 2021-11-02 17:20:03 -05:00
codemann8
582abf3d32 Fixed boss music 2021-11-02 17:17:37 -05:00
codemann8
ff6a553a0d Fake flipper autokill reversal 2021-11-01 10:59:37 -05:00
codemann8
dd57b4be79 Preserve Sanc music change in Standard 2021-11-01 02:09:05 -05:00
codemann8
4bcc76e83b Play Sanc music on arrival in Sanc in Standard 2021-10-31 20:56:27 -05:00
codemann8
2e9f4c5abb Fixed issue with whirlpools not changing world in Crossed OW 2021-10-28 21:40:51 -05:00
codemann8
86212c8d25 Adding cross-world behavior for Whirlpool Shuffle 2021-10-27 01:09:53 -05:00
codemann8
4e67ebd959 Make Smith deletion on S+Q dependent of a new flag 2021-10-22 00:21:22 -05:00
codemann8
7819e80051 Fixed portal to match grass in Inverted 2021-10-21 22:18:23 -05:00
codemann8
2215b16240 Merge branch 'DRMain' into OWMain 2021-10-21 21:26:38 -05:00
codemann8
a30e459dbb Merge branch 'DRMain' into OWMain 2021-09-17 10:54:00 -05:00
codemann8
200c1ff334 Merge branch 'DRMain' into OWMain 2021-08-31 19:21:19 -05:00
codemann8
53dd7ba820 Fix for TR Pegs issue when fluting direct to TR from a screen with hammerpegs 2021-08-26 00:53:02 -05:00
codemann8
5d6d509bd9 Update Crossed OW to only perform Link/Bunny state changes when world changes 2021-08-26 00:51:41 -05:00
codemann8
fe24f6f865 Play SFX on crossworld transition in Crossed OW 2021-08-25 02:21:56 -05:00
codemann8
9b48a88df6 Retain Link state on transition unless bunny in Crossed OW 2021-08-21 18:02:59 -05:00
codemann8
aed1506114 Fixed issue with waterwalking in Crossed 2021-08-21 15:16:21 -05:00
codemann8
11be05c65a Fix Bunny/Lonk issues in Crossed OW 2021-08-20 22:47:17 -05:00
codemann8
f7525866c7 Fixed Flute crash 2021-08-20 20:43:48 -05:00
codemann8
a8e119285e Actually fixed Mixed flag problems 2021-08-19 21:53:26 -05:00
codemann8
58bf92ba04 Moved OW flag checks to global variable 2021-08-19 20:01:48 -05:00
codemann8
94a987f23f Fixed missing OW flag check changes 2021-08-19 18:47:29 -05:00
codemann8
ad8c4e8e70 ROM changes to support Crossed OW changes 2021-08-16 22:52:04 -05:00
codemann8
1210264294 Changed LW2 track in MSU-1 to play after Aga1 kill instead of ped pull 2021-08-11 06:04:09 -05:00
codemann8
c399f8c77b Separated ambient SFX from music track selection
Fixes issue with ambient SFX stopping and starting
2021-08-11 05:53:27 -05:00
codemann8
06a7b7bead Fixed SW MSU track to play regardless of world 2021-08-02 04:20:02 -05:00
codemann8
677ad64419 Rewrote music calculation 2021-08-01 23:41:24 -05:00
codemann8
634764d4fc Merge branch 'DRMain' into OWMain 2021-07-28 16:24:02 -05:00
codemann8
6e721fb069 Fix for boss music not playing in non-DR modes 2021-07-27 02:40:12 -05:00
codemann8
11099f53b0 Merging DRMain 2021-07-23 15:49:10 -05:00
codemann8
b06492d419 Merge branch 'DRMain' into OWMain 2021-07-16 01:15:39 -05:00
codemann8
0cd7986318 Merge branch 'DRMain' into OWMain 2021-07-14 00:06:51 -05:00
codemann8
a05b148261 Fixed boss music when boss room entered thru Straight Stairs in DR 2021-07-12 20:59:47 -05:00
codemann8
dc2a468acb Suppressed awkward/abrupt music changes in dungeons when DR is enabled 2021-07-12 19:22:57 -05:00
codemann8
9209153643 Supressed awkward/abrupt music changes in dungeons when DR is enabled 2021-07-12 16:44:03 -05:00
codemann8
ec04d05c37 Merge branch 'DRMain' into OWMain 2021-07-10 13:46:57 -05:00
codemann8
195fd74e0b Reverting Dark Bonk Rocks rain state sprite fix 2021-07-08 20:26:18 -05:00
codemann8
a474212475 Added Rain state guards for Dark Bonk Rocks 2021-07-08 14:08:34 -05:00
codemann8
6cd0d15abf Merge branch 'DRMain' into OWMain 2021-07-07 19:11:36 -05:00
codemann8
e5ec4f8393 Fixed Stumpy 2021-07-06 14:44:55 -05:00
codemann8
a87ae37eab Minor reformatting comments 2021-07-06 14:29:48 -05:00
codemann8
7f4d783870 Fixed Stumpy sprite loading 2021-07-06 14:29:10 -05:00
codemann8
17b7a23550 Fixed Frogsmith spawning as a bad sprite 2021-07-06 11:57:34 -05:00
codemann8
6f7f9d2a39 Adding OW Rando credits 2021-07-04 11:38:24 -05:00
codemann8
f2f53e8999 Adding OW Rando credits 2021-07-04 11:29:21 -05:00
codemann8
b9193d2fbf Added ability to cancel out of flute menu by pressing X 2021-06-27 19:02:19 -05:00
codemann8
8df468840f Added ability to cancel out of flute menu by pressing X 2021-06-27 14:49:28 -05:00
codemann8
7e615bc033 Fixed Aga portal mirror bonk issue 2021-06-25 13:02:40 -05:00
codemann8
3bb6f78491 Fixed VRAM issue 2021-06-24 14:47:40 -05:00
codemann8
7ba76d4a5c Partial revert of VRAM adjustment 2021-06-24 14:35:31 -05:00
codemann8
92c3448ac2 Merge branch 'DRMain' into OWMain 2021-06-23 10:58:18 -05:00
codemann8
04ffd3a00d Fixed horizontal VRAM loading glitch on megatiles 2021-06-23 08:41:43 -05:00
codemann8
5d06322bd3 Whoops 2021-06-23 05:33:43 -05:00
codemann8
17eb8073ab Initial Mixed/Crossed OW shuffle implementation 2021-06-23 03:05:13 -05:00
codemann8
b03283efd2 Various inverted map changes, including adding correct tiles to GT entrance 2021-06-22 23:09:22 -05:00
codemann8
da0b2c62e2 Added default music track to avoid game crash 2021-06-22 22:52:14 -05:00
codemann8
6f0d52f70e Merge pull request #4 from m0zes/OWMain
Cherry Picked Bank fixes
2021-06-21 20:29:10 -05:00
qwertymodo
b0b65f2131 More robust bank fix
Shouldn't crash on crystal/pendant anymore
2021-06-21 20:25:05 -05:00
qwertymodo
18422922e2 Set DB/DP to 0 in frame hook
Possible fix for hole transition crashes
2021-06-21 20:24:53 -05:00
codemann8
5a7bcfe9f5 Renamed inverted map subroutines to be consistent with OWID 2021-06-19 04:06:34 -05:00
codemann8
a6dafc5fa6 Add HUD indicator if LW/DW in Mixed OW mode 2021-06-13 12:17:51 -05:00
codemann8
c1ecc4c891 Merge branch 'DRMain' into OWMain 2021-06-04 21:49:55 -05:00
codemann8
4846bcbb58 Merge branch 'DRMain' into OWMain 2021-06-03 10:56:15 -05:00
codemann8
22f761a6c5 Added map terrain changes specific to OW Shuffle 2021-06-03 10:54:30 -05:00
codemann8
5cb8b68e8a Added convenient portals on WDM for OW Shuffle 2021-06-03 08:05:41 -05:00
codemann8
53d3fc3737 Added convenient portals on WDM for OW Shuffle 2021-06-03 07:36:59 -05:00
codemann8
6c616a20b2 Made world checks table-based rather than based on OW ID 2021-06-03 00:50:25 -05:00
codemann8
ff87b09d4b Minor reorganization of code/data placement 2021-05-30 06:44:34 -05:00
codemann8
dd2110f91d Moved Inverted Pyramid Entrance to HC Ledge 2021-05-26 21:07:16 -05:00
codemann8
1f37695fe0 Merge branch 'DRMain' into OWMain 2021-05-24 17:52:01 -05:00
codemann8
60ab0fcae2 Merge branch 'MSUMuteFix' into OWMain 2021-05-19 04:32:10 -05:00
codemann8
2e91981a1e Merge branch 'MSUMuteFix' into OWMain 2021-05-19 04:30:05 -05:00
codemann8
89881f3bee Merge remote-tracking branch 'upstream/DRMain' into OWMain 2021-05-16 04:51:57 -05:00
codemann8
99a695c1a2 Removed unnecessary data 2021-05-02 20:28:55 -05:00
codemann8
fd3f27adb1 Minor formatting changes 2021-05-02 19:16:02 -05:00
codemann8
a0b731ffbd Moved VRAM adjustment back to original spot 2021-05-02 19:15:42 -05:00
codemann8
fd3aed6d60 Preserve Link's position if within incoming gap 2021-05-02 18:30:49 -05:00
codemann8
ff08965ce5 Minor efficiency improvements 2021-05-01 19:50:46 -05:00
codemann8
e1a763c29f Minor formatting/labeling 2021-04-29 01:18:10 -05:00
codemann8
42f77472c5 Merge pull request #3 from Catobat/OWFix3
Fix camera unlocking
2021-04-28 18:39:32 -05:00
codemann8
8be83d6f94 Merge pull request #2 from Catobat/OWFix2
Fix transitions for real
2021-04-28 18:37:44 -05:00
Catobat
0abda3e210 Fix camera unlocking 2021-04-27 22:41:32 +02:00
codemann8
e8cba03156 Updated gitignore 2021-04-26 23:15:59 -05:00
codemann8
340a3c1c9d Catobat fix for transition bugs 2021-04-26 18:06:01 -05:00
Catobat
2b65123802 Fix transitions for real 2021-04-26 21:52:06 +02:00
codemann8
7333bf7f92 Minor efficiency 2021-04-24 15:25:17 -05:00
codemann8
619185e1e0 Fixed vanilla/ID-0 transition bug 2021-04-24 15:09:13 -05:00
codemann8
cd4949ce65 Disabled setting LW/DW flag on trans 2021-04-24 15:08:39 -05:00
codemann8
e72193a6be Fixed incorrect data for special areas 2021-04-21 00:11:20 -05:00
codemann8
de637242fc Fixed bad transition data 2021-04-21 00:11:00 -05:00
codemann8
f294773832 Fixed issue with DW transitions causing hardlocking mapwrap crashes 2021-04-21 00:10:45 -05:00
codemann8
5062da19d4 Fixed visual issue with megatiles with VRAM 2021-04-21 00:09:43 -05:00
codemann8
b242f6ae9d Fixed DW hardlocks 2021-04-20 02:14:46 -05:00
codemann8
c43fb64878 Fixed incorrect transition data 2021-04-20 02:14:28 -05:00
codemann8
eb11bb455d Milestone update, all transitions work, megatiles have a visual issue 2021-04-18 13:57:57 -05:00
codemann8
9089a9eb40 Merge remote-tracking branch 'upstream/DRMain' into OWMain 2021-04-12 13:33:04 -05:00
codemann8
9a5448e1bb Fixed bad data 2021-04-12 12:13:27 -05:00
codemann8
174b17d9a2 Not quite accurate transitions, opposite coordinate incorrect still 2021-04-11 21:10:30 -05:00
codemann8
deccdfb630 Milestone successful transition to midpoint 2021-04-07 12:17:03 -05:00
codemann8
fd13889f68 Merge remote-tracking branch 'upstream/DRMain' into DRMain 2021-02-18 22:45:56 -06:00
codemann8
3dd2e7892d Initial OW Shuffle Hook 2021-02-18 09:57:54 -06:00
120 changed files with 12667 additions and 1823 deletions

3
.gitignore vendored
View File

@@ -2,4 +2,5 @@ tournament.asm
/build /build
/.idea /.idea
/__pycache__ /__pycache__
build.sh /.vscode
build.sh

View File

@@ -50,6 +50,7 @@ dw !ROM_VERSION_HIGH
function hexto555(h) = ((((h&$FF)/8)<<10)|(((h>>8&$FF)/8)<<5)|(((h>>16&$FF)/8)<<0)) function hexto555(h) = ((((h&$FF)/8)<<10)|(((h>>8&$FF)/8)<<5)|(((h>>16&$FF)/8)<<0))
; Feature flags, run asar with -DFEATURE_X=1 to enable ; Feature flags, run asar with -DFEATURE_X=1 to enable
!FEATURE_FIX_BASEROM ?= 0
;================================================================================ ;================================================================================
@@ -70,6 +71,10 @@ function hexto555(h) = ((((h&$FF)/8)<<10)|(((h>>8&$FF)/8)<<5)|(((h>>16&$FF)/8)<<
!MULTIWORLD_ITEM_ID = "$7EC09B" ; for lua scripts? !MULTIWORLD_ITEM_ID = "$7EC09B" ; for lua scripts?
!Dungeon_ChestData = "$01E96C" !Dungeon_ChestData = "$01E96C"
!FLAG_OW_MIXED = $04
!FLAG_OW_CROSSED = $02
!FLAG_OW_BONKDROP = $02
incsrc hooks.asm incsrc hooks.asm
incsrc spriteswap.asm incsrc spriteswap.asm
incsrc hashalphabethooks.asm incsrc hashalphabethooks.asm
@@ -78,7 +83,6 @@ incsrc ram.asm
incsrc sram.asm incsrc sram.asm
incsrc registers.asm incsrc registers.asm
incsrc vanillalabels.asm incsrc vanillalabels.asm
incsrc menu/overworldmap.asm ; Overwrites some code in bank $8A
org $A08000 ; bank $20 org $A08000 ; bank $20
incsrc itemdowngrade.asm incsrc itemdowngrade.asm
@@ -115,6 +119,7 @@ incsrc doorframefixes.asm
incsrc music.asm incsrc music.asm
incsrc roomloading.asm incsrc roomloading.asm
incsrc icepalacegraphics.asm incsrc icepalacegraphics.asm
incsrc follower.asm
warnpc $A18000 warnpc $A18000
org $9C8000 ; text tables for translation org $9C8000 ; text tables for translation
@@ -161,6 +166,8 @@ incsrc decryption.asm
incsrc hashalphabet.asm incsrc hashalphabet.asm
incsrc inverted.asm incsrc inverted.asm
incsrc invertedmaps.asm incsrc invertedmaps.asm
incsrc invertedmaps2.asm
incsrc bonktreemaps.asm
incsrc newhud.asm incsrc newhud.asm
incsrc save.asm incsrc save.asm
incsrc password.asm incsrc password.asm
@@ -171,7 +178,8 @@ incsrc elder.asm
incsrc toast.asm incsrc toast.asm
incsrc fastcredits.asm incsrc fastcredits.asm
incsrc msu.asm incsrc msu.asm
incsrc dungeonmap.asm incsrc menu/overworldmap.asm ; Overwrites some code in bank $8A
incsrc bossicons.asm
incsrc hextodec.asm incsrc hextodec.asm
incsrc multiworld.asm incsrc multiworld.asm
incsrc textrenderer.asm incsrc textrenderer.asm
@@ -182,6 +190,8 @@ ItemReceiptGraphicsROM:
; we need some empty space here so that 0000 can mean nothing ; we need some empty space here so that 0000 can mean nothing
fillbyte $00 : fill 32 fillbyte $00 : fill 32
incbin "data/customitems.4bpp" incbin "data/customitems.4bpp"
PreloadedGraphicsROM:
incbin "data/preloadedgfx.4bpp"
warnpc $A2B000 warnpc $A2B000
org $A2B000 org $A2B000
incsrc itemdatatables.asm ; Statically mapped incsrc itemdatatables.asm ; Statically mapped
@@ -192,6 +202,19 @@ incsrc inventory.asm
incsrc menu/hudalpha.asm incsrc menu/hudalpha.asm
warnpc $A38000 warnpc $A38000
org $B98000
incsrc crystalswitchbook.asm
incsrc mimicdash.asm
incsrc gloom.asm
incsrc special_weapons.asm
incsrc variable_ganon_vulnerability.asm
incsrc pseudoflute.asm
incsrc dungeon_map/main.asm
warnpc $B9F000
org $B9F000
incsrc dungeon_map/settings.asm
org $A38000 org $A38000
incsrc stats/credits.asm ; Statically mapped incsrc stats/credits.asm ; Statically mapped
incsrc stats/main.asm incsrc stats/main.asm
@@ -202,6 +225,7 @@ incsrc stats/fonttable.asm
incsrc doorrando/doorrando.asm ; bank 27/A7 incsrc doorrando/doorrando.asm ; bank 27/A7
;bank 28/A8 for keydropshuffle / standing items ;bank 28/A8 for keydropshuffle / standing items
incsrc keydrop/standing_items.asm ; bank 28/A8 incsrc keydrop/standing_items.asm ; bank 28/A8
incsrc owrando.asm ; bank 2A/AA
incsrc enemizer/main.asm ; bank 36/B6 incsrc enemizer/main.asm ; bank 36/B6
org $B08000 ; bank #$30 org $B08000 ; bank #$30
@@ -233,7 +257,7 @@ warnpc $B1A000
org $B1A000 org $B1A000
GFX_HUD_Items: GFX_HUD_Items:
incbin "menu/drsheetdc.2bppc" incbin "menu/dr_sheet_dc.2bppc"
warnpc $B1A800 warnpc $B1A800
org $B1A800 org $B1A800
@@ -286,6 +310,16 @@ NewFontInverted:
incbin "data/newfont_inverted.bin" incbin "data/newfont_inverted.bin"
SmallCharacters: SmallCharacters:
incbin "data/smallchars.2bpp" incbin "data/smallchars.2bpp"
DungeonMapIcons1:
incbin "menu/map_icons_1.3bppc"
DungeonMapIcons2:
incbin "menu/map_icons_2.3bppc"
DungeonMapIcons3:
incbin "menu/map_icons_3.3bppc"
MapSheetD4:
incbin "menu/map_sheet_d4.3bppc"
org $8CD7DF org $8CD7DF
incsrc data/playernamecharmap.asm incsrc data/playernamecharmap.asm
org $8CE73D org $8CE73D
@@ -343,6 +377,7 @@ warnpc $B08000
;$33 Graphics Bank ;$33 Graphics Bank
;$36 reserved for Enemizer ;$36 reserved for Enemizer
;$37 Room data if needed for DR/Pottery/Enemizer ;$37 Room data if needed for DR/Pottery/Enemizer
;$39 GwaaKiwi Code Bank
;$3A reserved for downstream use ;$3A reserved for downstream use
;$3B reserved for downstream use ;$3B reserved for downstream use
;$3F reserved for internal debugging ;$3F reserved for internal debugging

0
bin/linux/asar Executable file → Normal file
View File

BIN
bin/linux/compress Normal file

Binary file not shown.

BIN
bin/linux/decompress Normal file

Binary file not shown.

0
bin/macos/asar Executable file → Normal file
View File

239
bin/src/compress.c Normal file
View File

@@ -0,0 +1,239 @@
#include <stdio.h>
#include <stddef.h>
#include <sys/stat.h>
const int MAXLENGTH = 0x300;
struct section {
int mode;
int length;
char data[2];
int datalength;
};
int find_duplicate(off_t loc, off_t size, char buf[], struct section *out) {
int i, j;
struct section result;
result.mode = 4;
result.length = 0;
for (i = 0; i < loc && i < 0x10000; i++) {
if (buf[i] != buf[loc]) {
continue;
}
for (j = 0; j < MAXLENGTH; j++) {
if (buf[i + j] != buf[loc + j]) {
break;
}
}
if (j > result.length) {
result.length = j;
result.data[0] = i & 0xFF;
result.data[1] = (i >> 8) & 0xFF;
result.datalength = 2;
}
}
if (result.length < 4) {
return -1;
}
*out = result;
return 0;
}
int find_repeat_byte(off_t loc, off_t size, char buf[], struct section *out) {
int i;
for (i = 0; i < MAXLENGTH && loc + i < size; i++) {
if (buf[loc + i] != buf[loc]) {
break;
}
}
if (i > 2) {
struct section result;
result.mode = 1;
result.length = i;
result.data[0] = buf[loc];
result.datalength = 1;
*out = result;
return 0;
}
return -1;
}
int find_repeat_word(off_t loc, off_t size, char buf[], struct section *out) {
int i;
for (i = 0; i < MAXLENGTH && loc + i + 1 < size; i += 1) {
if (buf[loc + i] != buf[loc + (i & 1)]) {
break;
}
}
if (i > 3) {
struct section result;
result.mode = 2;
result.length = i;
result.data[0] = buf[loc];
result.data[1] = buf[loc + 1];
result.datalength = 2;
*out = result;
return 0;
}
return -1;
}
int find_incrementing_byte(off_t loc, off_t size, char buf[], struct section *out) {
int i;
for (i = 0; i < MAXLENGTH && loc + i < size; i++) {
if (buf[loc] + i < i) {
break;
}
if (buf[loc + i] != buf[loc] + i) {
break;
}
}
if (i > 2) {
struct section result;
result.mode = 3;
result.length = i;
result.data[0] = buf[loc];
result.datalength = 1;
*out = result;
return 0;
}
return -1;
}
int get_section(off_t loc, off_t size, char buf[], struct section *out) {
struct section best, current;
best.length = 0;
if (!find_repeat_byte(loc, size, buf, &current)) {
if (current.length > best.length) {
best = current;
}
}
if (!find_repeat_word(loc, size, buf, &current)) {
if (current.length > best.length) {
best = current;
}
}
if (!find_incrementing_byte(loc, size, buf, &current)) {
if (current.length > best.length) {
best = current;
}
}
if (!find_duplicate(loc, size, buf, &current)) {
if (current.length > best.length) {
best = current;
}
}
if (best.length > 0) {
// printf("byte %06X: mode %d length %02X\n", loc, best.mode, best.length);
*out = best;
return 0;
} else {
return -1;
}
}
int write_section(struct section section, char data[], char buf[], int loc) {
int nloc = loc;
int len = section.length - 1;
if (len > 0x1F) {
buf[nloc++] = 0xE0 | (section.mode << 2) | (len >> 8);
buf[nloc++] = len & 0xFF;
} else {
buf[nloc++] = (section.mode << 5) | len;
}
for (int i = 0; i < section.datalength; i++) {
buf[nloc++] = data[i];
}
return nloc;
}
int main(int argc, char *argv[]) {
if (argc < 3) {
printf("Usage: %s infile outfile\n", argv[0]);
return 1;
}
FILE *inptr;
if ((inptr = fopen(argv[1], "rb")) == NULL) {
printf("%s does not exist.\n", argv[1]);
return 1;
}
int fd = fileno(inptr);
if (fd < 0) {
printf("Error stating file: %s\n", argv[1]);
return 1;
}
struct stat buf;
if (fstat(fd, &buf) != 0) {
printf("Error stating file: %s\n", argv[1]);
return 1;
}
off_t size = buf.st_size;
char inbuf[size];
if (fread(inbuf, 1, size, inptr) < size) {
printf("Error reading file: %s\n", argv[1]);
return 1;
}
fclose(inptr);
char outbuf[size * 2];
char m0data[MAXLENGTH];
int oloc = 0;
struct section m0;
m0.mode = 0;
m0.length = 0;
int i;
off_t loc = 0;
while (loc < size) {
struct section section;
if (!get_section(loc, size, inbuf, &section)) {
if (m0.length > 0) {
m0.datalength = m0.length;
oloc = write_section(m0, m0data, outbuf, oloc);
m0.length = 0;
}
oloc = write_section(section, section.data, outbuf, oloc);
loc += section.length;
} else {
if (m0.length == MAXLENGTH) {
m0.datalength = m0.length;
oloc = write_section(m0, m0data, outbuf, oloc);
m0.length = 0;
}
m0data[m0.length++] = inbuf[loc];
loc += 1;
}
}
if (m0.length > 0) {
m0.datalength = m0.length;
oloc = write_section(m0, m0data, outbuf, oloc);
m0.length = 0;
}
outbuf[oloc++] = 0xFF;
FILE *outptr;
if ((outptr = fopen(argv[2], "wb")) == NULL) {
printf("Error opening file: %s\n", argv[2]);
return 1;
}
if (fwrite(outbuf, 1, oloc, outptr) < oloc) {
printf("Error writing to file: %s\n", argv[2]);
return 1;
}
fclose(outptr);
printf("Input file: %X bytes. Compressed: %X bytes.\n", size, oloc);
return 0;
}

147
bin/src/decompress.c Normal file
View File

@@ -0,0 +1,147 @@
#include <stdio.h>
#include <stddef.h>
#include <sys/stat.h>
struct section {
int mode;
int length;
char data[2];
int datalength;
};
int read_section(char buf[], int loc, struct section *out) {
int nloc = loc;
char header = buf[nloc++];
printf("%x: ", header & 0xff);
if (header == -1) {
return -1;
}
struct section result;
result.data[0] = buf[loc];
result.datalength = 1;
if ((header & 0xE0) == 0xE0) {
result.mode = (header & 0x1C) >> 2;
result.length = (((header & 0x03) << 8) | buf[nloc++]) + 1;
} else {
result.mode = (header & 0xE0) >> 5;
result.length = (header & 0x1F) + 1;
}
printf("%d: %x\n", result.mode, result.length);
switch (result.mode) {
case 0:
result.datalength = 0;
break;
case 1:
result.datalength = 1;
break;
case 2:
result.datalength = 2;
break;
case 3:
result.datalength = 1;
break;
case 4:
result.datalength = 2;
break;
}
for (int i = 0; i < result.datalength; i++) {
result.data[i] = buf[nloc++];
}
*out = result;
return nloc;
}
int main(int argc, char *argv[]) {
if (argc < 3) {
printf("Usage: %s infile outfile\n", argv[0]);
return 1;
}
FILE *inptr;
if ((inptr = fopen(argv[1], "rb")) == NULL) {
printf("%s does not exist.\n", argv[1]);
return 1;
}
int fd = fileno(inptr);
if (fd < 0) {
printf("Error stating file: %s\n", argv[1]);
return 1;
}
struct stat buf;
if (fstat(fd, &buf) != 0) {
printf("Error stating file: %s\n", argv[1]);
return 1;
}
off_t size = buf.st_size;
char inbuf[size];
if (fread(inbuf, 1, size, inptr) < size) {
printf("Error reading file: %s\n", argv[1]);
return 1;
}
fclose(inptr);
char outbuf[size * 256];
int oloc = 0;
struct section section;
int i;
off_t loc = 0;
while ((loc = read_section(inbuf, loc, &section)) >= 0) {
if (section.mode == 0) {
for (i = 0; i < section.length; i++) {
outbuf[oloc++] = inbuf[loc++];
}
} else if (section.mode == 1) {
for (i = 0; i < section.length; i++) {
outbuf[oloc++] = section.data[0];
}
} else if (section.mode == 2) {
for (i = 0; i < section.length; i++) {
outbuf[oloc++] = section.data[0];
if (++i < section.length) {
outbuf[oloc++] = section.data[1];
}
}
} else if (section.mode == 3) {
for (i = 0; i < section.length; i++) {
outbuf[oloc++] = (section.data[0] + i) & 0xff;
}
} else if (section.mode == 4) {
int offset = section.data[0] | (section.data[1] << 8);
for (i = 0; i < section.length; i++) {
outbuf[oloc++] = outbuf[offset + i];
}
}
}
FILE *outptr;
if ((outptr = fopen(argv[2], "wb")) == NULL) {
printf("Error opening file: %s\n", argv[2]);
return 1;
}
if (fwrite(outbuf, 1, oloc, outptr) < oloc) {
printf("Error writing to file: %s\n", argv[2]);
return 1;
}
fclose(outptr);
printf("Input file: %X bytes. Decompressed: %X bytes.\n", size, oloc);
return 0;
}

BIN
bin/windows/compress.exe Normal file

Binary file not shown.

BIN
bin/windows/decompress.exe Normal file

Binary file not shown.

1024
bonktreemaps.asm Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -2,23 +2,21 @@
; Randomize Book of Mudora ; Randomize Book of Mudora
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
LoadLibraryItemGFX: LoadLibraryItemGFX:
LDA.l LibraryItem_Player : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID INC.w SkipBeeTrapDisguise
LDA.l LibraryItem_Player : STA.w SprItemMWPlayer, X : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID
%GetPossiblyEncryptedItem(LibraryItem, SpriteItemValues) %GetPossiblyEncryptedItem(LibraryItem, SpriteItemValues)
JSL AttemptItemSubstitution STA.w SprSourceItemId, X
JSL ResolveLootIDLong JML RequestStandingItemVRAMSlot
STA.w SpriteID, X
JSL PrepDynamicTile_loot_resolved
RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
DrawLibraryItemGFX: DrawLibraryItemGFX:
PHA PHA
LDA.w SpriteID, X LDA.w SprItemReceipt, X
JSL DrawDynamicTile JSL DrawPotItem
PLA PLA
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
SetLibraryItem: SetLibraryItem:
LDY.w SpriteID, X LDY.w SprSourceItemId, X
JSL ItemSet_Library ; contains thing we wrote over JSL ItemSet_Library ; contains thing we wrote over
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -30,39 +28,31 @@ RTL
LoadBonkItemGFX: LoadBonkItemGFX:
LDA.b #$08 : STA.w SpriteOAMProp, X ; thing we wrote over LDA.b #$08 : STA.w SpriteOAMProp, X ; thing we wrote over
LoadBonkItemGFX_inner: LoadBonkItemGFX_inner:
LDA.b #$00 : STA.l RedrawFlag INC.w SkipBeeTrapDisguise
JSR LoadBonkItem_Player : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID JSR LoadBonkItem_Player : STA.w SprItemMWPlayer, X : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID
JSR LoadBonkItem JSR LoadBonkItem
JSL AttemptItemSubstitution STA.w SprSourceItemId, X
JSL ResolveLootIDLong JSL RequestStandingItemVRAMSlot
STA.w $0E80, X
STA.w SpriteID, X
JSL PrepDynamicTile
PHA : PHX
LDA.w SpriteID,X : TAX
LDA.l SpriteProperties_standing_width,X : BNE +
LDA.b #$00 : STA.l SpriteOAM : STA.l SpriteOAM+8
+
PLX : PLA
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
DrawBonkItemGFX: DrawBonkItemGFX:
PHA PHA
LDA.l RedrawFlag : BEQ .skipInit LDA.w SprRedrawFlag, X : BEQ .skipInit
JSL LoadBonkItemGFX_inner JSL LoadBonkItemGFX_inner
BRA .done ; don't draw on the init frame LDA.w SprRedrawFlag, X : CMP.b #$02 : BEQ .skipInit
BRA .done ; don't draw on the init frame
.skipInit .skipInit
LDA.w SpriteID,X LDA.w SprItemReceipt,X
JSL DrawDynamicTileNoShadow JSL DrawPotItem
.done .done
PLA PLA
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
GiveBonkItem: GiveBonkItem:
JSR LoadBonkItem_Player : STA.l !MULTIWORLD_ITEM_PLAYER_ID LDA.w SprItemMWPlayer, X : STA.l !MULTIWORLD_ITEM_PLAYER_ID
JSR LoadBonkItem LDA.w SprSourceItemId, X
JSR AbsorbKeyCheck : BCC .notKey JSR AbsorbKeyCheck : BCC .notKey
PHY : LDY.b #$24 : JSL AddInventory : PLY ; do inventory processing for a small key PHY : LDY.b #$24 : JSL AddInventory : PLY ; do inventory processing for a small key
LDA.l CurrentSmallKeys : INC A : STA.l CurrentSmallKeys LDA.l CurrentSmallKeys : INC A : STA.l CurrentSmallKeys

View File

@@ -74,3 +74,22 @@ BonkRecoil:
+ +
LDA.b #$24 : STA.b LinkRecoilZ ; things we wrote over LDA.b #$24 : STA.b LinkRecoilZ ; things we wrote over
RTL RTL
;--------------------------------------------------------------------------------
BonkRecoilStop:
LDA.l BootsModifier : CMP.b #$01 : BEQ .return
LDA.l BootsEquipment : BNE .return
LDA.b LinkState : CMP.b #$02 : BNE .return
LDA.b LinkPosZ : BMI .return : CMP.b #$09 : BCC .return
LDA.b FrameCounter : AND.b #$01 : BNE .return
REP #$20
LDA.w $0114 : CMP.w #$0020 : SEP #$20 : BNE .return
LDA.b LinkRecoilY : BEQ ++ : BMI +
DEC : BRA ++
+ INC
++ STA.b LinkRecoilY
LDA.b LinkRecoilX : BEQ ++ : BMI +
DEC : BRA ++
+ INC
++ STA.b LinkRecoilX
.return
JML LinkHop_FindArbitraryLandingSpot

View File

@@ -20,7 +20,12 @@ DoDungeonMapBossIcon:
; get sprite pointer for room ; get sprite pointer for room
LDA.l UWSpritesPointers,X LDA.l UWSpritesPointers,X
STA.b Scrap00 ; pointer in $00 STA.b Scrap00 ; pointer in $00
LDA.w #$0028 : STA.b Scrap02 ; set the bank to 28 for now if !FEATURE_FIX_BASEROM
LDA.w #$0089
else
LDA.w #$0028 ; set the bank to 28 for now
endif
STA.b Scrap02
LDY.w #$0001 ; to skip the "sort" LDY.w #$0001 ; to skip the "sort"
; get first byte to make sure it isn't an empty room ; get first byte to make sure it isn't an empty room

View File

@@ -1,12 +1,5 @@
;================================================================================ ;================================================================================
;--------------------------------------------------------------------------------
AssignKiki:
LDA.b #$00 : STA.l FollowerDropped ; defuse bomb
LDA.b #$0A : STA.l FollowerIndicator ; assign kiki as follower
RTL
;--------------------------------------------------------------------------------
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; Name: AllowSQ ; Name: AllowSQ
; Returns: Accumulator = 0 if S&Q is disallowed, 1 if allowed ; Returns: Accumulator = 0 if S&Q is disallowed, 1 if allowed
@@ -48,7 +41,7 @@ DecideIfBunnyByScreenIndex:
; superbunny work ; superbunny work
LDA.b IndoorsFlag : BNE .done LDA.b IndoorsFlag : BNE .done
LDA.l MoonPearlEquipment : BNE .done LDA.l MoonPearlEquipment : BNE .done
LDA.b OverworldIndex : AND.b #$40 : PHA PHX : LDX.b OverworldIndex : LDA.l OWTileWorldAssoc, X : PLX : PHA
LDA.l InvertedMode : BNE .inverted LDA.l InvertedMode : BNE .inverted
.normal .normal
PLA : EOR.b #$40 PLA : EOR.b #$40
@@ -80,12 +73,9 @@ FixAga2Bunny:
++ ++
JSL DecideIfBunny : BNE + JSL DecideIfBunny : BNE +
JSR MakeBunny JSR MakeBunny
LDA.b #$04 : STA.w MusicControlRequest ; play bunny music
BRA .done
+ +
LDA.b #$09 : STA.w MusicControlRequest ; what we wrote over .done
.done JML Overworld_DetermineAndSetMusic
RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -190,6 +180,49 @@ LDA.b IndoorsFlag : BNE +
+ +
RTL RTL
PostFixMirrorGfxPrep:
LDA.b #$01 : STA.w OWTransitionFlag
JML HandleFollowersAfterMirroring ; what we wrote over
; warning, this is called on frames after PostFixMirrorGfxPrep but for
; several frames after, so we use OWTransitionFlag to run something once
PostFixMirrorGfx:
STA.w SubModuleInterface ; what we wrote over
LDA.w OWTransitionFlag : CMP.b #$01 : BNE .done
LDA.b #$08 : STA.w OWTransitionFlag
JML FollowerGfxRedraw
.done
RTL
PostFixOAMGfx:
JSL FollowerGfxRedraw
REP #$30 : LDA.w #$2000 ; what we wrote over
RTL
;--------------------------------------------------------------------------------
; Fix losing VRAM gfx when using quake
PostNMIUpdateBGCharHalf:
STA.w DMAENABLE : SEP #$10 ; what we wrote over
LDA.w VRAMTileMapIndex : CMP.b #$46 : BNE .return ; checks to see if this is the last VRAM write
LDA.b LinkState : CMP.b #$08 : BCC + : CMP.b #$0A+1 : BCS + ; skip if we're mid-medallion
RTL
+ JSL DynamicDropGFXClear
JSL HeartPieceSetRedraw ; set redraw flag for items
.return
RTL
; Force redraws of items following map checks
PostOverworldGfxLoad:
INC.b GameSubMode : STZ.b INIDISPQ ; what we wrote over
JSL DynamicDropGFXClear
JSL HeartPieceSetRedraw
RTL
PostUnderworldMap:
JSL DynamicDropGFXClear
JSL HeartPieceSetRedraw
LDA.l $7EC229 ; what we wrote over
RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
FixJingleGlitch: FixJingleGlitch:
LDA.b GameSubMode LDA.b GameSubMode
@@ -238,7 +271,7 @@ ParadoxCaveGfxFix:
LDA.b #$01 : STA.w DMAENABLE LDA.b #$01 : STA.w DMAENABLE
.skipLine .skipLine
RTL JML FollowerGfxRedraw
.skipMostOfLine .skipMostOfLine
; Set line length to 192 bytes (the first 6 8x8 tiles in the line) ; Set line length to 192 bytes (the first 6 8x8 tiles in the line)
@@ -246,9 +279,75 @@ ParadoxCaveGfxFix:
BRA .uploadLine BRA .uploadLine
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
SetItemRiseTimer: SetItemRiseTimer:
LDA.w ItemReceiptMethod : CMP.b #$01 : BNE .not_from_chest LDA.w ItemReceiptMethod : CMP.b #$01 : BNE .not_from_chest
LDA.b #$38 : STA.w AncillaTimer, X LDA.b #$38 : STA.w AncillaTimer, X
RTL RTL
.not_from_chest
TYA : STA.w AncillaTimer, X ; What we wrote over .not_from_chest
JSL.l ItemIsJunk
BEQ .default
.junk
LDA.l JunkItemTimer : AND.b #$3F : STA.w AncillaTimer, X
RTL
.default
TYA : STA.w AncillaTimer, X ; What we wrote over
RTL
;--------------------------------------------------------------------------------
ItemIsJunk:
PHX
LDA.l JunkItemTimer : BIT.b #$3F : BEQ .not_junk
BIT.b #$80 : BNE .check
LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE .check
LDA.l !MULTIWORLD_RECEIVING_ITEM : BNE .check
BRA .not_junk
.check
LDA.l JunkItemTimer : AND.b #$40
BEQ +
LDA.b #JunkItems_triforce_end-JunkItems_end
+
CLC : ADC.b #JunkItems_end-JunkItems-1
LDA.w AncillaGet, X
TAX
-
CMP.l JunkItems, X : BEQ .junk
DEX : BPL -
.not_junk
PLX
LDA.b #$00
RTL
.junk
PLX
LDA.b #$01
RTL
RTL RTL
JunkItems:
db $27 ; Bomb
db $28 ; 3 bombs
db $31 ; 10 bombs
db $34 ; 1 rupee
db $35 ; 5 rupees
db $36 ; 20 rupees
db $40 ; 100 rupees
db $41 ; 50 rupees
db $42 ; Heart
db $43 ; Arrow
db $44 ; 10 arrows
db $45 ; Small magic
db $46 ; 300 rupees
db $47 ; 20 rupees green
db $59 ; Rupoor
db $D1 ; Apples
db $D2 ; Fairy
db $D3 ; Chicken
db $D4 ; Big Magic
db $D5 ; 5 Arrows
db $D6 ; Good Bee
.end
db $6B ; Power Star
db $6C ; Triforce Piece
.triforce_end
;--------------------------------------------------------------------------------

View File

@@ -5,6 +5,60 @@
; Filtered Joypad 1 Register: [AXLR | ????] ; Filtered Joypad 1 Register: [AXLR | ????]
; Filtered Joypad 1 Register: [BYST | udlr] [AXLR | ????] ; Filtered Joypad 1 Register: [BYST | udlr] [AXLR | ????]
InvertDPad_DPadOnly:
LDA.w JOY1L : STA.b Scrap00
LDA.w JOY1H
BIT.b #$0C : BEQ + : EOR.b #$0C : + ; swap up/down
BIT.b #$03 : BEQ + : EOR.b #$03 : + ; swap left/right
STA.b Scrap01
JML InvertDPadReturn
InvertDPad_ButtonsOnly:
REP #$20 ; set 16-bit accumulator
LDA.w JOY1L
BIT.w #$8040 : BEQ + : EOR.w #$8040 : + ; swap X/B
BIT.w #$4080 : BEQ + : EOR.w #$4080 : + ; swap Y/A
STA.b Scrap00
SEP #$20 ; set 8-bit accumulator
JML InvertDPadReturn
InvertDPad_Both:
REP #$20 ; set 16-bit accumulator
LDA.w JOY1L
BIT.w #$8040 : BEQ + : EOR.w #$8040 : + ; swap X/B
BIT.w #$4080 : BEQ + : EOR.w #$4080 : + ; swap Y/A
BIT.w #$0C00 : BEQ + : EOR.w #$0C00 : + ; swap up/down
BIT.w #$0300 : BEQ + : EOR.w #$0300 : + ; swap left/right
STA.b Scrap00
SEP #$20 ; set 8-bit accumulator
JML InvertDPadReturn
InvertDPad_SwapSides:
REP #$20 ; set 16-bit accumulator
LDA.w JOY1L
BIT.w #$0840 : BEQ + : EOR.w #$0840 : + ; swap X/up
BIT.w #$0180 : BEQ + : EOR.w #$0180 : + ; swap A/right
BIT.w #$4200 : BEQ + : EOR.w #$4200 : + ; swap Y/left
BIT.w #$8400 : BEQ + : EOR.w #$8400 : + ; swap B/down
STA.b Scrap00
SEP #$20 ; set 8-bit accumulator
JML InvertDPadReturn
InvertDPad_DPadLROnly:
LDA.w JOY1L : STA.b Scrap00
LDA.w JOY1H
BIT.b #$03 : BEQ + : EOR.b #$03 : + ; swap left/right
STA.b Scrap00
JML InvertDPadReturn
InvertDPad_DPadUDOnly:
LDA.w JOY1L : STA.b Scrap00
LDA.w JOY1H
BIT.b #$0C : BEQ + : EOR.b #$0C : + ; swap up/down
STA.b Scrap00
JML InvertDPadReturn
InvertDPad: InvertDPad:
LDA.l OneMindPlayerCount : BEQ .crowd_control LDA.l OneMindPlayerCount : BEQ .crowd_control
@@ -28,44 +82,18 @@ InvertDPad:
LDA.w JOY1H : STA.b Scrap01 LDA.w JOY1H : STA.b Scrap01
JML InvertDPadReturn JML InvertDPadReturn
+ DEC : BEQ .dpadOnly + DEC : BNE +
DEC : BEQ .buttonsOnly JMP InvertDPad_DPadOnly
DEC : BEQ .invertBoth + DEC : BNE +
.swapSides JMP InvertDPad_ButtonsOnly
REP #$20 ; set 16-bit accumulator + DEC : BNE +
LDA.w JOY1L JMP InvertDPad_Both
BIT.w #$0840 : BEQ + : EOR.w #$0840 : + ; swap X/up + DEC : BNE +
BIT.w #$0180 : BEQ + : EOR.w #$0180 : + ; swap A/right JMP InvertDPad_SwapSides
BIT.w #$4200 : BEQ + : EOR.w #$4200 : + ; swap Y/left + DEC : BNE +
BIT.w #$8400 : BEQ + : EOR.w #$8400 : + ; swap B/down JMP InvertDPad_DPadLROnly
STA.b Scrap00 + JMP InvertDPad_DPadUDOnly
SEP #$20 ; set 8-bit accumulator
JML InvertDPadReturn
.invertBoth
REP #$20 ; set 16-bit accumulator
LDA.w JOY1L
BIT.w #$8040 : BEQ + : EOR.w #$8040 : + ; swap X/B
BIT.w #$4080 : BEQ + : EOR.w #$4080 : + ; swap Y/A
BIT.w #$0C00 : BEQ + : EOR.w #$0C00 : + ; swap up/down
BIT.w #$0300 : BEQ + : EOR.w #$0300 : + ; swap left/right
STA.b Scrap00
SEP #$20 ; set 8-bit accumulator
JML InvertDPadReturn
.buttonsOnly
REP #$20 ; set 16-bit accumulator
LDA.w JOY1L
BIT.w #$8040 : BEQ + : EOR.w #$8040 : + ; swap X/B
BIT.w #$4080 : BEQ + : EOR.w #$4080 : + ; swap Y/A
STA.b Scrap00
SEP #$20 ; set 8-bit accumulator
JML InvertDPadReturn
.dpadOnly
LDA.w JOY1L : STA.b Scrap00
LDA.w JOY1H
BIT.b #$0C : BEQ + : EOR.b #$0C : + ; swap up/down
BIT.b #$03 : BEQ + : EOR.b #$03 : + ; swap left/right
STA.b Scrap01
JML InvertDPadReturn
.onemind_controller_offset .onemind_controller_offset
db 0 ; player 0 - JOY1L - joy1d1 db 0 ; player 0 - JOY1L - joy1d1

52
crystalswitchbook.asm Normal file
View File

@@ -0,0 +1,52 @@
pushpc
org $87A46E
JSL CheckBookTriggerSwitch
BCS +
skip 15
+
org $8296A8
JSL FinishPegChange
pullpc
FinishPegChange:
LDA.b #$20
TRB.w $037A
STZ.b $B0
STZ.b $11
RTL
CheckBookTriggerSwitch:
LDA.l CrystalSwitchBook
BEQ +
LDA.b $10
CMP.b #$07
BNE +
LDA.l $7EC172
EOR.b #$01
STA.l $7EC172
LDA.b #$16
STA.b $11
LDA.b #$20
TSB.w $037A
LDA.b #$25
JSL $8DBB8A
SEC
BRA .done
+ CLC
.done
; what we wrote over
LDA.b $3A
AND.b #$BF
STA.b $3A
RTL

View File

@@ -3,6 +3,7 @@
!INERT = $00 !INERT = $00
!INIT = $08 !INIT = $08
!ALIVE = $09 !ALIVE = $09
!OAMPROPS = $09
!CUCCO_ENRAGED = $23 !CUCCO_ENRAGED = $23
CuccoStorm: CuccoStorm:
@@ -12,6 +13,7 @@ CuccoStorm:
LDA.b GameMode : CMP.b #$09 : BNE + ; only if outdoors LDA.b GameMode : CMP.b #$09 : BNE + ; only if outdoors
LDA.l LoopFrames : AND.b #$7F : BNE + ; check every 128 frames LDA.l LoopFrames : AND.b #$7F : BNE + ; check every 128 frames
.activate
- -
;==== Find a Cucco ;==== Find a Cucco
@@ -40,7 +42,11 @@ CuccoStorm:
PLY PLY
CPY.b #$FF : BEQ + ; fail if no slots found CPY.b #$FF : BEQ + ; fail if no slots found
LDA.b #!CUCCO : STA.w SpriteTypeTable, Y LDA.b #!CUCCO : STA.w SpriteTypeTable, Y
LDA.b #!INIT : STA.w SpriteAITable, Y LDA.b #!ALIVE : STA.w SpriteAITable, Y
PHX
TYX : JSL ResetSpriteProperties
PLX
LDA.b #!OAMPROPS : STA.w SpriteOAMProp, Y
LDA.b LinkPosY : STA.w SpritePosYLow, Y LDA.b LinkPosY : STA.w SpritePosYLow, Y
LDA.b LinkPosY+1 : STA.w SpritePosYHigh, Y LDA.b LinkPosY+1 : STA.w SpritePosYHigh, Y
LDA.b LinkPosX : STA.w SpritePosXLow, Y LDA.b LinkPosX : STA.w SpritePosXLow, Y

View File

@@ -2,7 +2,6 @@
; Dark World Spawn Location Fix & Master Sword Grove Fix ; Dark World Spawn Location Fix & Master Sword Grove Fix
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
DarkWorldSaveFix: DarkWorldSaveFix:
LDA.b #$70 : PHA : PLB ; thing we wrote over - data bank change
JSL MasterSwordFollowerClear JSL MasterSwordFollowerClear
JML StatSaveCounter JML StatSaveCounter
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -11,14 +10,25 @@ DoWorldFix:
JMP DoWorldFix_Inverted JMP DoWorldFix_Inverted
+ +
LDA.l Bugfix_MirrorlessSQToLW : BEQ .skip_mirror_check LDA.l Bugfix_MirrorlessSQToLW : BEQ .skip_mirror_check
LDA.l FollowerIndicator : CMP.b #$04 : BEQ .setLightWorld ; check if old man is following LDA.l FollowerIndicator : CMP.b #$04 : BNE + ; if old man following, skip mirror/aga check
LDA.l MirrorEquipment : AND.b #$02 : BEQ .noMirror ; check if we have the mirror LDA.l FollowerTravelAllowed : CMP.b #$02 : BEQ +
LDA.l OldManRetrievalWorld
BRA .noMirror
+ LDA.l MirrorEquipment : AND.b #$02 : BEQ .noMirror ; check if we have the mirror
.skip_mirror_check ; alt entrance point .skip_mirror_check ; alt entrance point
LDA.l ProgressIndicator : CMP.b #$03 : BCS .done ; check if agahnim 1 is alive LDA.l ProgressIndicator : CMP.b #$03 : BCS .done ; check if agahnim 1 is alive
.setLightWorld .setLightWorld
LDA.b #$00 LDA.b #$00
.noMirror .noMirror
STA.l CurrentWorld ; set flag to light world STA.l CurrentWorld ; set flag to light world
LDA.l SmithDeleteOnSave : BEQ .transform
LDA.l FollowerIndicator
CMP.b #$07 : BEQ .clear ; clear frog
CMP.b #$08 : BEQ .clear ; clear dwarf - consider flute implications
BRA .done
.clear
LDA.b #$00 : STA.l FollowerIndicator : BRA .done ; clear follower
.transform
LDA.l FollowerIndicator : CMP.b #$07 : BNE .done : INC : STA.l FollowerIndicator ; convert frog to dwarf LDA.l FollowerIndicator : CMP.b #$07 : BNE .done : INC : STA.l FollowerIndicator ; convert frog to dwarf
.done .done
RTL RTL
@@ -49,18 +59,27 @@ RTL
;================================================================================ ;================================================================================
DoWorldFix_Inverted: DoWorldFix_Inverted:
LDA.l Bugfix_MirrorlessSQToLW : BEQ .skip_mirror_check LDA.l Bugfix_MirrorlessSQToLW : BEQ .skip_mirror_check
LDA.l FollowerIndicator : CMP.b #$04 : BEQ .setDarkWorld ; check if old man is following LDA.l FollowerIndicator : CMP.b #$04 : BNE + ; if old man following, skip mirror/aga check
LDA.l MirrorEquipment : AND.b #$02 : BEQ .setDarkWorld ; check if we have the mirror LDA.l FollowerTravelAllowed : CMP.b #$02 : BEQ +
LDA.l OldManRetrievalWorld
BRA .setWorld
+ LDA.l MirrorEquipment : AND.b #$02 : BEQ .noMirror ; check if we have the mirror
.skip_mirror_check ; alt entrance point .skip_mirror_check ; alt entrance point
LDA.l ProgressIndicator : CMP.b #$03 : BCS .done ; check if agahnim 1 is alive LDA.l ProgressIndicator : CMP.b #$03 : BCS .done ; check if agahnim 1 is alive
.noMirror
.setDarkWorld .setDarkWorld
LDA.b #$40 : STA.l CurrentWorld ; set flag to dark world LDA.b #$40
LDA.l FollowerIndicator .setWorld
CMP.b #$07 : BEQ .clear ; clear frog STA.l CurrentWorld ; set flag to dark world
CMP.b #$08 : BEQ .clear ; clear dwarf - consider flute implications LDA.l SmithDeleteOnSave : BEQ .transform
BRA .done LDA.l FollowerIndicator
.clear CMP.b #$07 : BEQ .clear ; clear frog
LDA.b #$00 : STA.l FollowerIndicator ; clear follower CMP.b #$08 : BEQ .clear ; clear dwarf - consider flute implications
BRA .done
.clear
LDA.b #$00 : STA.l FollowerIndicator : BRA .done ; clear follower
.transform
LDA.l FollowerIndicator : CMP.b #$07 : BNE .done : INC : STA.l FollowerIndicator ; convert frog to dwarf
.done .done
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -71,7 +90,7 @@ SetDeathWorldChecked_Inverted:
LDA.l GanonPyramidRespawn : BNE .castle ; if flag is set, force respawn at pyramid on death to ganon LDA.l GanonPyramidRespawn : BNE .castle ; if flag is set, force respawn at pyramid on death to ganon
++ ++
.outdoors .outdoors
JMP DoWorldFix JMP DoWorldFix_Inverted
.dungeon .dungeon
LDA.l MosaicLevel : BNE .dontfix ; this is a sanc & quit LDA.l MosaicLevel : BNE .dontfix ; this is a sanc & quit
@@ -90,10 +109,22 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
FakeWorldFix: FakeWorldFix:
LDA.l FixFakeWorld : BEQ + LDA.l FixFakeWorld : BEQ +
LDA.b OverworldIndex : AND.b #$40 : STA.l CurrentWorld PHX
LDX.b OverworldIndex : LDA.l OWTileWorldAssoc, X : STA.l CurrentWorld
PLX
+ +
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
GetCurrentWorldForLoad:
LDA.l FollowerTravelAllowed : CMP.b #$02 : BEQ .default
LDA.l FollowerIndicator : CMP.b #$04 : BNE .default
LDA.l InvertedMode : BEQ +
LDA.b #$40
+ RTL
.default
LDA.l CurrentWorld
RTL
;--------------------------------------------------------------------------------
MasterSwordFollowerClear: MasterSwordFollowerClear:
LDA.l FollowerIndicator LDA.l FollowerIndicator
CMP.b #$0E : BNE .exit ; clear master sword follower CMP.b #$0E : BNE .exit ; clear master sword follower
@@ -102,7 +133,9 @@ MasterSwordFollowerClear:
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
FixAgahnimFollowers: FixAgahnimFollowers:
LDA.b #$00 : STA.l FollowerIndicator ; clear follower LDA.l FollowerTravelAllowed : CMP.b #$02 : BEQ +
LDA.b #$00 : STA.l FollowerIndicator ; clear follower
+
JML PrepDungeonExit ; thing we wrote over JML PrepDungeonExit ; thing we wrote over
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 18 KiB

BIN
data/preloadedgfx.4bpp Normal file

Binary file not shown.

BIN
data/preloadedgfx.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
data/skull.bin Normal file

Binary file not shown.

View File

@@ -198,10 +198,14 @@ DecompressAllItemGraphics:
STA.l $4200 ; already 0 from the LDA above STA.l $4200 ; already 0 from the LDA above
LDX.b #$5D+$73 : JSR FastSpriteDecomp LDX.b #$5D+$73 : JSR AddGfxSheetToBigBuffer
LDX.b #$5C+$73 : JSR FastSpriteDecomp LDX.b #$5C+$73 : JSR AddGfxSheetToBigBuffer
LDX.b #$5B+$73 : JSR FastSpriteDecomp LDX.b #$5B+$73 : JSR AddGfxSheetToBigBuffer
LDX.b #$5A+$73 : JSR FastSpriteDecomp LDX.b #$5A+$73 : JSR AddGfxSheetToBigBuffer
JSR AddCherryPickGfxToBigBuffer
LDX.b #$01 : STX.w $06FA
LDX.b #$06+$73 : JSR AddGfxSheetToBigBuffer
LDX.b #$07+$73 : JSR AddGfxSheetToBigBuffer
REP #$30 REP #$30
PLX PLX
@@ -219,6 +223,21 @@ DecompressAllItemGraphics:
RTL RTL
;===================================================================================================
AddGfxSheetToBigBuffer:
SEP #$30
LDA.l GFXSheetPointers_background_bank,X : PHA : PLB
LDA.l GFXSheetPointers_background_high,X : XBA
LDA.l GFXSheetPointers_background_low,X
CPX.b #$73 : !BLT FastSpriteDecomp
CPX.b #$73+$0C : !BGE FastSpriteDecomp
.uncompressed
JMP Direct3BPPConvert
;=================================================================================================== ;===================================================================================================
; I normally hate macros like this... but I don't feel like constantly rewriting this ; I normally hate macros like this... but I don't feel like constantly rewriting this
;=================================================================================================== ;===================================================================================================
@@ -246,12 +265,6 @@ endmacro
; so might as well rewrite it to be fast ; so might as well rewrite it to be fast
;=================================================================================================== ;===================================================================================================
FastSpriteDecomp: FastSpriteDecomp:
SEP #$30
LDA.l GFXSheetPointers_background_bank,X : PHA : PLB
LDA.l GFXSheetPointers_background_high,X : XBA
LDA.l GFXSheetPointers_background_low,X
REP #$10 REP #$10
TAY TAY
@@ -486,12 +499,86 @@ macro DoPlanesA(offset)
XBA XBA
ORA.b Decomp3BPPScratch ORA.b Decomp3BPPScratch
PHY
LDY.w $06FA : BEQ +
AND.w #$00FF ; idk why this line works but some sheets we pull in aren't correct without it
+
PLY
STA.w BigDecompressionBuffer+$10+<offset>+<offset>,X STA.w BigDecompressionBuffer+$10+<offset>+<offset>,X
endmacro endmacro
;=================================================================================================== ;===================================================================================================
macro DoIndirectPlanesA(offset)
LDA.b Scrap00 : ADC.w #<offset>+<offset> : STA.b Scrap02
LDA.b (Scrap02),Y
STA.l BigDecompressionBuffer+<offset>+<offset>,X
DEC.b Scrap02
ORA.b (Scrap02),Y
AND.w #$FF00
STA.b Decomp3BPPScratch
LDA.b Scrap00 : ADC.w #$10+<offset> : STA.b Scrap02
LDA.b (Scrap02),Y
AND.w #$00FF
TSB.b Decomp3BPPScratch
XBA
ORA.b Decomp3BPPScratch
PHY
LDY.w $06FA : BEQ +
AND.w #$00FF ; idk why this line works but some sheets we pull in aren't correct without it
+
PLY
STA.l BigDecompressionBuffer+$10+<offset>+<offset>,X
endmacro
;===================================================================================================
Direct3BPPConvert:
REP #$31
STA.b Scrap00
LDY.w #$0000
LDX.b DecompBufferOffset
.next_3bpp_tile
%DoIndirectPlanesA(0) ; 8 times
%DoIndirectPlanesA(1)
%DoIndirectPlanesA(2)
%DoIndirectPlanesA(3)
%DoIndirectPlanesA(4)
%DoIndirectPlanesA(5)
%DoIndirectPlanesA(6)
%DoIndirectPlanesA(7)
; carry will always be clear
; don't worry
TXA
ADC.w #32
TAX
; just trust me
TYA
ADC.w #24
TAY
CMP.w #24*64
BCS .done
JMP .next_3bpp_tile
.done
STX.b DecompBufferOffset
SEP #$30
RTS
;===================================================================================================
Unrolled3BPPConvert: Unrolled3BPPConvert:
LDA.b #$7F LDA.b #$7F
PHA PHA
@@ -536,4 +623,57 @@ Unrolled3BPPConvert:
;=================================================================================================== ;===================================================================================================
macro CherryPickGfx(source,dest,length)
LDX.w #BigDecompressionBuffer+<source>
LDY.w #BigDecompressionBuffer+<dest>
LDA.w #<length>-1
MVN BigDecompressionBuffer>>16,BigDecompressionBuffer>>16
LDX.w #BigDecompressionBuffer+<source>+$200
LDY.w #BigDecompressionBuffer+<dest>+$200
LDA.w #<length>-1
MVN BigDecompressionBuffer>>16,BigDecompressionBuffer>>16
endmacro
;===================================================================================================
AddCherryPickGfxToBigBuffer:
; this is mostly to load and rearrange follower gfx to save on space
; assumes DecompBufferOffset left off at $A000 (#BigDecompressionBuffer+$2000)
; adjustments will be needed if anything prior to this changes
LDX.b #$01 : STX.w $06FA
LDX.b #$35+$73 : JSR AddGfxSheetToBigBuffer
LDX.b #$55+$73 : JSR AddGfxSheetToBigBuffer
REP #$30
%CherryPickGfx($2400,$2140,$40) ; move old man head
%CherryPickGfx($2D40,$20C0,$40) ; move zelda body
LDA.b DecompBufferOffset : SEC : SBC.w #$0C00 : STA.b DecompBufferOffset
SEP #$30
LDX.b #$11+$73 : JSR AddGfxSheetToBigBuffer
LDX.b #$15+$73 : JSR AddGfxSheetToBigBuffer
REP #$30
%CherryPickGfx($2940,$2180,$80) ; move locksmith head/body
%CherryPickGfx($2D00,$0440,$40) ; move frog
%CherryPickGfx($31C0,$0500,$40) ; move purple chest
LDA.b DecompBufferOffset : SEC : SBC.w #$1000 : STA.b DecompBufferOffset
SEP #$30
LDX.b #$59+$73 : JSR AddGfxSheetToBigBuffer
LDX.b #$58+$73 : JSR AddGfxSheetToBigBuffer
REP #$30
%CherryPickGfx($2880,$0480,$40) ; move kiki head
%CherryPickGfx($2900,$04C0,$40) ; move kiki body
%CherryPickGfx($30C0,$0540,$40) ; move big bomb
%CherryPickGfx($2C40,$0180,$40) ; move duck
LDA.b DecompBufferOffset : SEC : SBC.w #$1000 : STA.b DecompBufferOffset
SEP #$30
LDX.b #$4D+$73 : JSR AddGfxSheetToBigBuffer
LDX.b #$50+$73 : JSR AddGfxSheetToBigBuffer
REP #$30
%CherryPickGfx($2880,$0580,$40) ; move smith
%CherryPickGfx($3140,$0140,$40) ; move chicken
LDA.b DecompBufferOffset : SEC : SBC.w #$1000 : STA.b DecompBufferOffset
SEP #$30
STZ.w $06FA
RTS

View File

@@ -148,7 +148,11 @@ FreeDungeonItemNotice:
LDA.w DungeonID : CMP.w #$0003 : BCS + LDA.w DungeonID : CMP.w #$0003 : BCS +
.self_notice .self_notice
SEP #$20 SEP #$20
%CopyDialog(Notice_Self) LDA.l FreeItemText : AND.b #$40 : BEQ ++
LDA.b #$00 : STA.l DialogOffsetPointer : STA.l DialogOffsetPointer+1
JMP .skip
++
%CopyDialog(Notice_Self)
JMP .done JMP .done
+ +
SEP #$20 SEP #$20
@@ -261,7 +265,7 @@ RTL
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
DialogGanon1: DialogGanon1:
JSL CheckGanonVulnerability LDA.b #$01 : JSL CheckConditionPass
REP #$20 REP #$20
LDA.w #$018C LDA.w #$018C
BCC + BCC +
@@ -280,31 +284,68 @@ RTL
; s = silver arrow bow ; s = silver arrow bow
; p = 2nd progressive bow ; p = 2nd progressive bow
DialogGanon2: DialogGanon2:
JSL CheckGanonVulnerability LDA.b #$01 : JSL CheckConditionPass
REP #$20 REP #$20
BCS + BCS +
LDA.w #$018D : BRA ++ LDA.w #$018D : JMP .done
+ +
LDA.l BowTracking LDA.l GanonVulnerabilityItem : AND.w #$00FF
BEQ .silver_arrows
CMP.w #$0001 : BEQ .silver_arrows
CMP.w #$0004 : BEQ .bombs
CMP.w #$0005 : BEQ .powder
CMP.w #$0010 : BEQ .bee
BIT.w #$0080 : BNE + ; branch if bow PHX : TAX
LDA.w #$0192 : BRA ++ LDA.l EquipmentWRAM-1, X
+ PLX
BIT.w #$0040 : BEQ + ; branch if no silvers AND.w #$00FF : BNE .have
LDA.w #$0195 : BRA ++ BRA .dont_have
+
BIT.w #$0020 : BNE + ; branch if p bow .silver_arrows
LDA.w #$0194 : BRA ++ LDA.l BowTracking
+
BIT.w #$0080 : BEQ + ; branch if no bow BIT.w #$0080 : BEQ .dont_have ; no bow
LDA.w #$0193 : BRA ++ BIT.w #$0040 : BNE .have ; have silvers
+
LDA.w #$016E BIT.w #$0020 : BNE +
++ LDA.w #$0194 : BRA .done ; have p bow
STA.w TextID + LDA.w #$0193 : BRA .done ; don't have p bow
SEP #$20
JSL Sprite_ShowMessageMinimal_Alt .dont_have
LDA.w #$0192 : BRA .done
.have
LDA.w #$0195 : BRA .done
.bombs
LDA.l BombsEquipment : AND.w #$00FF : BNE .have
LDA.l InfiniteBombs : AND.w #$00FF : BNE .have
BRA .dont_have
.powder
LDA.l InventoryTracking : BIT.w #$0010 : BNE .have
BRA .dont_have
.bee
LDA.l BottleContentsOne : AND.w #$00FF
CMP.w #$0007 : BEQ .have
CMP.w #$0008 : BEQ .have
LDA.l BottleContentsTwo : AND.w #$00FF
CMP.w #$0007 : BEQ .have
CMP.w #$0008 : BEQ .have
LDA.l BottleContentsThree : AND.w #$00FF
CMP.w #$0007 : BEQ .have
CMP.w #$0008 : BEQ .have
LDA.l BottleContentsFour : AND.w #$00FF
CMP.w #$0007 : BEQ .have
CMP.w #$0008 : BEQ .have
BRA .dont_have
.done
STA.w TextID
SEP #$20
JSL Sprite_ShowMessageMinimal_Alt
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
DialogEtherTablet: DialogEtherTablet:
@@ -371,8 +412,8 @@ RTL
;--------------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------------
AgahnimAsksAboutPed: AgahnimAsksAboutPed:
LDA.l GanonVulnerableMode ; seems light_speed option to change some aga text is unused for now
CMP.b #$06 : BNE .vanilla BRA .vanilla
LDA.l OverworldEventDataWRAM+$80 ; check ped flag LDA.l OverworldEventDataWRAM+$80 ; check ped flag
AND.b #$40 AND.b #$40

View File

@@ -694,4 +694,6 @@ dw $ffff
SanctuaryDarkWorld: SanctuaryDarkWorld:
dw $ffff dw $ffff
OldManDarkWorld: OldManDarkWorld:
dw $ffff dw $ffff
OldManRetrievalWorld:
dw $0000

View File

@@ -1,10 +1,23 @@
CheckDarkWorldSpawn: CheckDarkWorldSpawn:
PHP
STA.b RoomIndex : STA.w RoomIndexMirror ; what we wrote over STA.b RoomIndex : STA.w RoomIndexMirror ; what we wrote over
LDA.l DRFlags : AND.w #$0200 : BEQ + ; skip if the flag isn't set JSL SetDefaultWorld
LDA.l MoonPearlEquipment : AND.w #$00FF : BNE + ; moon pearl?
LDA.l LinksHouseDarkWorld : CMP.b RoomIndex : BEQ ++ LDA.l LinksHouseDarkWorld : CMP.b RoomIndex : BEQ ++
LDA.l SanctuaryDarkWorld : CMP.b RoomIndex : BEQ ++ LDA.l SanctuaryDarkWorld : CMP.b RoomIndex : BEQ ++
LDA.l OldManDarkWorld : CMP.b RoomIndex : BNE + LDA.l OldManDarkWorld : CMP.b RoomIndex : BNE +
++ SEP #$30 : LDA.b #$17 : STA.b LinkState ++ SEP #$20 : LDA.l CurrentWorld : EOR.b #$40 : STA.l CurrentWorld
INC.w BunnyFlag : LDA.b #$40 : STA.l CurrentWorld : REP #$30 LDA.l DRFlags+1 : AND.b #$02 : BEQ + ; skip if the flag isn't set
+ RTL LDA.l MoonPearlEquipment : BNE + ; moon pearl?
LDA.b #$17 : STA.b LinkState : INC.w BunnyFlag
+ PLP : RTL
SetDefaultWorld:
PHP : SEP #$20
LDA.l FollowerTravelAllowed : CMP.b #$02 : BEQ .default
LDA.l FollowerIndicator : CMP.b #$04 : BNE .default
LDA.l OldManRetrievalWorld : BRA +
.default
LDA.l InvertedMode : BEQ +
LDA.b #$40
+ STA.l CurrentWorld
PLP : RTL

View File

@@ -216,9 +216,6 @@ rts
org $82C157 org $82C157
JSL AlwaysPushThroughFDoors JSL AlwaysPushThroughFDoors
; Modified from OWR - will need to remove once merged org $80E766
org $85AF75 JML ConditionalLoadCommonSprites_Do3To4Low : NOP #2
Sprite_6C_MirrorPortal: LoadCommonSprites_Prep3To4Low:
JSL FixOvalFadeOutMirror : NOP #2 ; LDA $7EF3CA : BNE $05AFDF
org $85AFDF
Sprite_6C_MirrorPortal_missing_mirror:

View File

@@ -92,4 +92,13 @@ OverridePaletteHeader:
lda.l PaletteTable, x lda.l PaletteTable, x
iny : rtl iny : rtl
+ rep #$20 : iny : lda.b [Scrap0D], Y ; what we wrote over + rep #$20 : iny : lda.b [Scrap0D], Y ; what we wrote over
rtl rtl
Sprite_ConditionalPrepOAMCoord:
LDA.w SpriteTypeTable,X : CMP.b #$62 : BNE .notMasterSword
LDA.w $0D90,X : BNE .specialCutscene
.notMasterSword
JML Sprite_PrepOAMCoordLong ; what we wrote over
.specialCutscene
SEC ; this prevents MasterSword sprite from drawing if it is a special cutscene
RTL

View File

@@ -1,8 +1,8 @@
!BlankTile = $207F !BlankTile = $207F
!SlashTile = $2830 !SlashTile = $2830
!HyphenTile = $2405 !HyphenTile = $2405
!PTile = $296C !LTile = $2D68
!CTile = $295F !DTile = $2D60
!RedSquare = $345E !RedSquare = $345E
!BlueSquare = $2C5E !BlueSquare = $2C5E
@@ -24,7 +24,7 @@ DRHUD_DrawItemCounter:
DRHUD_DrawIndicators: DRHUD_DrawIndicators:
LDA.b IndoorsFlag : BNE .continue LDA.b IndoorsFlag : BNE .continue
JMP DRHUD_Finished JMP OWRHUD_DrawWorldIndicator
.continue .continue
LDA.b FrameCounter : AND.b #$10 : BEQ DRHUD_EnemyDropIndicator LDA.b FrameCounter : AND.b #$10 : BEQ DRHUD_EnemyDropIndicator
@@ -55,7 +55,7 @@ DRHUD_EnemyDropIndicator:
REP #$30 REP #$30
LDA.w EnemyDropIndicator : STA.w HUDMultiIndicator LDA.w EnemyDropIndicator : STA.w HUDMultiIndicator
SEP #$20 SEP #$20
LDA.w DungeonID : CMP.b #$1B : BCS DRHUD_Finished LDA.w DungeonID : CMP.b #$1B : BCC + : JMP DRHUD_Finished : +
SEP #$10 : TAX : REP #$10 SEP #$10 : TAX : REP #$10
DRHUD_DrawCurrentDungeonIndicator: ; mX DRHUD_DrawCurrentDungeonIndicator: ; mX
@@ -69,15 +69,33 @@ DRHUD_DrawCurrentDungeonIndicator: ; mX
STY.w HUDCurrentDungeonWorld STY.w HUDCurrentDungeonWorld
DRHUD_DrawKeyCounter: DRHUD_DrawKeyCounter:
LDA.l DRFlags : AND.b #$04 : BEQ DRHUD_Finished LDA.l DRFlags : AND.b #$04 : BEQ DRHUD_Finished
REP #$20 LDA.l CompassMode : BIT.b #$03 : BEQ DRHUD_Finished
LDA.w MapField : AND.l DungeonMask, X : BEQ DRHUD_Finished REP #$20
TXA : LSR : TAX BIT.w #$0002 : BNE .skip_map_check
LDA.l GenericKeys : AND.w #$00FF : BNE .total_only LDA.w MapField : AND.l DungeonMask, X : BEQ DRHUD_Finished
.skip_map_check
TXA : LSR : BNE .dungeon_id
INC
.dungeon_id
TAX
LDA.l GenericKeys : LSR : BCS .total_only
LDA.w DungeonCollectedKeys, X : JSR ConvertToDisplay : STA.w HUDKeysObtained LDA.w DungeonCollectedKeys, X : JSR ConvertToDisplay : STA.w HUDKeysObtained
LDA.w #!SlashTile : STA.w HUDKeysSlash LDA.w #!SlashTile : STA.w HUDKeysSlash
.total_only .total_only
LDA.l ChestKeys, x : JSR ConvertToDisplay : STA.w HUDKeysTotal LDA.l ChestKeys, x : JSR ConvertToDisplay : STA.w HUDKeysTotal
JMP DRHUD_Finished
OWRHUD_DrawWorldIndicator:
LDA.l OWMode+1 : AND.b #(!FLAG_OW_CROSSED+!FLAG_OW_MIXED) : BEQ DRHUD_Finished
REP #$10
LDY.w #!BlankTile
LDA.w CurrentHealth : BEQ .draw_indicator
LDA.w CurrentWorld : BEQ +
LDY.w #!DTile : BRA .draw_indicator
+ LDY.w #!LTile
.draw_indicator
STY.w HUDCurrentDungeonWorld ; uses same slot as DR Dungeon Indicator
DRHUD_Finished: DRHUD_Finished:
PLB : RTL PLB : RTL
@@ -100,7 +118,6 @@ dw $0000, $0000, $0000, $0000, $000a, $000a, $000a, $0014, $000a, $0014, $0000,
DrHudDungeonItemsAdditions: DrHudDungeonItemsAdditions:
{ {
jsl DrawHUDDungeonItems jsl DrawHUDDungeonItems
lda.l HUDDungeonItems : and.b #$ff : bne + : rtl : +
lda.l DRMode : cmp.b #$02 : beq + : rtl : + lda.l DRMode : cmp.b #$02 : beq + : rtl : +
phx : phy : php phx : phy : php
@@ -141,16 +158,19 @@ DrHudDungeonItemsAdditions:
jsr ConvertToDisplay2 : sta.w $1644, y jsr ConvertToDisplay2 : sta.w $1644, y
+ iny #2 : lda.w #$24f5 : sta.w $1644, y + iny #2 : lda.w #$24f5 : sta.w $1644, y
phx : ldx.b Scrap00 phx : ldx.b Scrap00
lda.l MapField : and.l DungeonMask, x : beq + ; must have map LDA.l CompassMode : BIT.w #$0002 : BNE .skip_map_check
plx : sep #$30 : lda.l ChestKeys, x : sta.b Scrap02 LDA.l MapField : AND.l DungeonMask, x : BEQ .key_info_done ; must have map
lda.l GenericKeys : bne +++ .skip_map_check
lda.b Scrap02 : !SUB.l DungeonCollectedKeys, x : sta.b Scrap02 plx : sep #$30 : lda.l ChestKeys, x : sta.b Scrap02
+++ lda.b Scrap02 lda.l GenericKeys : bne +++
rep #$30 lda.b Scrap02 : !SUB.l DungeonCollectedKeys, x : sta.b Scrap02
jsr ConvertToDisplay2 : sta.w $1644, y ; small key totals +++ lda.b Scrap02
bra .skipStack rep #$30
+ plx jsr ConvertToDisplay2 : sta.w $1644, y ; small key totals
.skipStack iny #2 bra .skipStack
.key_info_done
plx
.skipStack iny #2
cpx.w #$000d : beq + cpx.w #$000d : beq +
lda.w #$24f5 : sta.w $1644, y lda.w #$24f5 : sta.w $1644, y
+ +
@@ -158,24 +178,26 @@ DrHudDungeonItemsAdditions:
+ inx #2 : cpx.w #$001b : bcs ++ : JMP - + inx #2 : cpx.w #$001b : bcs ++ : JMP -
++ ++
lda.l HudFlag : and.w #$0020 : bne + : JMP ++ : + lda.l HudFlag : and.w #$0020 : bne + : JMP ++ : +
lda.l HUDDungeonItems : and.w #$000c : bne + : JMP ++ : + ; map symbols
; map symbols (do I want these) ; note compass symbol is 2c20 lda.w #$2821 : sta.w $1606 : sta.w $1610 : sta.w $161a
lda.w #$2821 : sta.w $1606 : sta.w $1610 : sta.w $161a : sta.w $1624 ; compass symbols
lda.w #$2c20 : sta.w $160a : sta.w $1614 : sta.w $161e : sta.w $16e4
; blank out a couple thing from old hud ; blank out a couple thing from old hud
lda.w #$24f5 : sta.w $16e4 : sta.w $1724 lda.w #$24f5 : sta.w $1624 : sta.w $1724
sta.w $160a : sta.w $1614 : sta.w $161e ; blank out sm key indicators
ldx.w #$0002 ldx.w #$0002
- lda.w #$0000 ; start of hud area - lda.w #$0000 ; start of hud area
!ADD.l RowOffsets, x : !ADD.l ColumnOffsets, x : tay !ADD.l RowOffsets, x : !ADD.l ColumnOffsets, x : tay
lda.l DungeonReminderTable, x : sta.w $1644, y lda.l DungeonReminderTable, x : sta.w $1644, y
iny #2 iny #2
lda.w #$24f5 : sta.w $1644, y ; blank out map spot lda.w #$24f5 : sta.w $1644, y ; blank out map spot
lda.l MapField : and.l DungeonMask, x : beq + ; must have map lda.l MapField : ora.l MapCountDisplay : ora.l MapOverlay
and.l DungeonMask, x : beq + ; must have map
JSR MapIndicatorShort : STA.w $1644, Y JSR MapIndicatorShort : STA.w $1644, Y
+ iny #2 + iny #2
cpx.w #$001a : bne + cpx.w #$001a : bne +
tya : !ADD.w #$003c : tay tya : !ADD.w #$003c : tay
+ lda.l CompassField : and.l DungeonMask, x : beq + ; must have compass + lda.l CompassField : ora.l CompassCountDisplay
and.l DungeonMask, x : beq + ; must have compass
phx ; total chest counts phx ; total chest counts
LDA.l CompassTotalsWRAM, x : !SUB.l DungeonLocationsChecked, x LDA.l CompassTotalsWRAM, x : !SUB.l DungeonLocationsChecked, x
SEP #$30 : JSR HudHexToDec2DigitCopy : REP #$30 SEP #$30 : JSR HudHexToDec2DigitCopy : REP #$30
@@ -231,18 +253,36 @@ BkStatus:
ConvertToDisplay: ConvertToDisplay:
and.w #$00ff : cmp.w #$000a : !BLT + and.w #$00ff : cmp.w #$000a : !BLT +
!ADD.w #$2553 : rts !ADD.w #$2519 : rts
+ !ADD.w #$2490 : rts + !ADD.w #$2490 : rts
ConvertToDisplay2: ConvertToDisplay2:
and.w #$00ff : beq ++ and.w #$00ff : beq ++
cmp.w #$000a : !BLT + cmp.w #$000a : !BLT +
!ADD.w #$2553 : rts ; 2580 with 258A as "A" for non transparent digits !ADD.w #$2517 : rts ; 2580 with 258A as "A" for non transparent digits
+ !ADD.w #$2816 : rts + !ADD.w #$2816 : rts
++ lda.w #$2827 : rts ; 0/O for 0 or placeholder digit ;2483 ++ lda.w #$2827 : rts ; 0/O for 0 or placeholder digit ;2483
CountAbsorbedKeys: CountAbsorbedKeys:
JML IncrementSmallKeysNoPrimary JML IncrementSmallKeysNoPrimary
; This function apporach doesn't currently work
CountAbsorbedKeysViaCountAllKey:
PHA : PHX
LDA.l StandingItemsOn : BEQ .count_it
; LDA.w SpawnedItemKeyCounted : BNE .done ; this was added because pot keys were being double counted when they weren't shuffled
CPY.b #$24 : BEQ .count_it ; small key for this dungeon
LDA.w DungeonID : LSR : TAX
TYA : CMP.l KeyTable, X : BNE .done
.count_it
STY.b Scrap02 : LDY.b #$24 ; for non-24 items (w/o standing_items a small key is just $C), fake it
LDX.b #$84 ; pretend this isn't a smallkey, but an absorbed object (small heart)
REP #$10 : JSL CountAllKey : SEP #$10
LDY.b Scrap02
.done
; STZ.w SpawnedItemKeyCounted ; reset to zero for next time
PLX : PLA
JML IncrementSmallKeysNoPrimary
;================================================================================ ;================================================================================
; 8-bit registers ; 8-bit registers

View File

@@ -11,6 +11,7 @@ rtl
OnFileLoadOverride: OnFileLoadOverride:
jsl OnFileLoad ; what I wrote over jsl OnFileLoad ; what I wrote over
jsl StartingFollower
+ lda.l DRFlags : and.b #$02 : beq + ; Mirror Scroll + lda.l DRFlags : and.b #$02 : beq + ; Mirror Scroll
lda.l MirrorEquipment : bne + lda.l MirrorEquipment : bne +
lda.b #$01 : sta.l MirrorEquipment lda.b #$01 : sta.l MirrorEquipment
@@ -19,7 +20,7 @@ OnFileLoadOverride:
MirrorCheckOverride: MirrorCheckOverride:
lda.l DRFlags : and.b #$02 : beq ++ lda.l DRFlags : and.b #$02 : beq ++
lda.l MirrorEquipment : cmp.b #$01 : beq + lda.l MirrorEquipment : cmp.b #$01 : beq +
++ lda.b OverworldIndex : and.b #$40 ; what I wrote over ++ phx : ldx.b OverworldIndex : lda.l OWTileWorldAssoc,x : plx : and.b #$ff
rtl rtl
+ lda.l DRScroll : rtl + lda.l DRScroll : rtl
@@ -52,8 +53,9 @@ GuruguruFix:
BlindAtticFix: BlindAtticFix:
lda.l DRMode : beq + lda.l DRMode : beq +
lda.b #$01 : rtl - lda.b #$01 : rtl
+ lda.l FollowerIndicator : cmp.b #$06 + lda.l FollowerTravelAllowed : cmp.b #$02 : beq -
lda.l FollowerIndicator : cmp.b #$06
rtl rtl
SuctionOverworldFix: SuctionOverworldFix:
@@ -119,24 +121,8 @@ BlindsAtticHint:
SEP #$20 : RTL ; skip the dialog box if the hole is already open SEP #$20 : RTL ; skip the dialog box if the hole is already open
+ SEP #$20 : JML Main_ShowTextMessage + SEP #$20 : JML Main_ShowTextMessage
BlindZeldaDespawnFix:
CMP.b #06 : BEQ +
LDA.w SpritePosYLow,X : BEQ + ; don't despawn follower if maiden isn't "present"
PLA : PLA : PEA.w SpritePrep_BlindMaiden_despawn_follower-1 : RTL
+ PLA : PLA : PEA.w SpritePrep_BlindMaiden_kill_the_girl-1 : RTL
BigKeyDoorCheck: BigKeyDoorCheck:
CPY.w #$001E : BNE + ; skip if it isn't a BK door CPY.w #$001E : BNE + ; skip if it isn't a BK door
LDA.l DRFlags : AND.w #$0400 : BNE + ; skip if the flag is set - bk doors can be double-sided LDA.l DRFlags : AND.w #$0400 : BNE + ; skip if the flag is set - bk doors can be double-sided
PLA : PEA.w RoomDraw_OneSidedShutters_South_onesided_shutter_or_big_key_door-1 PLA : PEA.w RoomDraw_OneSidedShutters_South_onesided_shutter_or_big_key_door-1
+ LDA.w #$0000 : RTL + LDA.w #$0000 : RTL
FixOvalFadeOutMirror:
LDA.b $10 : CMP.b #$0F : BEQ .skip_activation
LDA.l InvertedMode : BNE +
LDA.l CurrentWorld : BNE .skip_activation
RTL
+ LDA.l CurrentWorld : BEQ .skip_activation
RTL
.skip_activation
PLA : PLA : PLA : JML Sprite_6C_MirrorPortal_missing_mirror

View File

@@ -0,0 +1,99 @@
; we want the icons indicating what is left in a room to blink
; but we don't want to redraw to BG1 every few frames
; so we duplicate the left side of BG1 to a lower portion and just toggle vertical scroll
BlinkLoot:
; do not show icons if we're scrolling
LDA.w $0210
BNE .hide
LDA.b FrameCounter
AND.b #$10
BEQ .show
.hide
LDA.b #$01
.show
STZ.b $E6
STA.w $E7
JSL $8AE96B
RTL
StartDoubleWrite:
; what we wrote over
REP #$30
STZ.w GFXStripes
STZ.w $021B
RTL
CheckDoubleWrite:
LDA.w $021C
BNE .done
LDA.b #$08
STA.w $021C
REP #$30
JML $8AE20B
.done
; what we wrote over
REP #$10
LDY.w GFXStripes
LDA.b #$FF
JML $8AE2E7
DrawMountain:
LDX.w GFXStripes
PHX
LDY.w #$0000
.next_word
LDA.w $8AEFEF, Y
STA.w GFXStripes+2, X
INX : INX
INY : INY
CPY.w #$002A
BCC .next_word
PLY
LDA.w $021B
BEQ .done
; if second copy of mountain, adjust VRAM addresses
SEP #$20
LDA.w GFXStripes+$02, Y
ORA.w $021C
STA.w GFXStripes+$02, Y
LDA.w GFXStripes+$08, Y
ORA.w $021C
STA.w GFXStripes+$08, Y
LDA.w GFXStripes+$10, Y
ORA.w $021C
STA.w GFXStripes+$10, Y
LDA.w GFXStripes+$20, Y
ORA.w $021C
STA.w GFXStripes+$20, Y
LDA.w GFXStripes+$26, Y
ORA.w $021C
STA.w GFXStripes+$26, Y
REP #$20
.done
RTL
WriteBigEndianAddressX:
ORA.w $021B
XBA
STA.w GFXStripes+2, X
AND.w #$FFF7
RTL
WriteBigEndianAddressY:
ORA.w $021B
XBA
STA.w GFXStripes+2, Y
AND.w #$FFF7
RTL

382
dungeon_map/check_loot.asm Normal file
View File

@@ -0,0 +1,382 @@
; A = room_id
; out A = level of loot
CheckLoot:
PHP
REP #$30
PHB : PHX : PHY
STA.b $00
LDA.b $06 : PHA
LDA.b $0E : PHA
STZ.b $02 ; best item class found
LDA.l ShowItems_default
AND.w #$00FF
STA.b $0E
LDA.b $00
ASL A
TAX
LDA.l SaveDataWRAM, X
AND.w #$000F
BEQ +
LDA.l ShowItems_visited_tile
AND.w #$00FF
CMP.b $0E
BCC +
STA.b $0E
+ LDA.w DungeonID
TAX
LDA.l MapField
AND.l DungeonMask, X
BEQ +
LDA.l ShowItems_have_map
AND.w #$00FF
CMP.b $0E
BCC +
STA.b $0E
+ LDA.l CompassField
AND.l DungeonMask, X
BEQ +
LDA.l ShowItems_have_compass
AND.w #$00FF
CMP.b $0E
BCC +
STA.b $0E
+
LDA.l ItemSources : BIT.w #$0001 : BEQ +
JSR CheckChests
+
LDA.l ItemSources : BIT.w #$0002 : BEQ +
JSR CheckPots
+
LDA.l ItemSources : BIT.w #$0004 : BEQ +
JSR CheckEnemies
+
LDA.l ItemSources : BIT.w #$0008 : BEQ +
JSR CheckBoss
+
LDA.l ItemSources : BIT.w #$0010 : BEQ +
JSR CheckPrize
+
.done
PLA : STA.b $0E
PLA : STA.b $06
PLY : PLX : PLB
PLP
LDA.b $02
RTL
CheckChests:
LDA.b $00
ASL A
TAX
LDA.w #($81<<8)
PHA
PLB : PLB
LDA.w #$0008
STA.b $04
LDY.w #$FFFD
.increment_mask
LDA.b $04
ASL A
STA.b $04
.next_chest
INY #3
CPY.w #$01F8
BCS .done
LDA.w RoomData_ChestItems, Y
AND.w #$7FFF
CMP.b $00
BNE .next_chest
LDA.l SaveDataWRAM, X
AND.b $04
BNE .increment_mask ; already got item
LDA.w RoomData_ChestItems+2, Y
AND.w #$00FF
JSR GetLootClass
BRA .increment_mask
.done
RTS
CheckBoss:
LDX.w #$FFFA
.next_boss
INX #6
LDA.l MiscLocations, X
BPL .check
RTS
.check
CMP.b $00
BNE .next_boss
TXY
CMP.b RoomIndex
BEQ .current_room
ASL A
TAX
LDA.l SaveDataWRAM, X
BRA .continue
.current_room
LDA.w RoomItemsTaken ; if checking our current room, $0403 has fresher flags
ASL #4
.continue
STA.b $04
TYX
LDA.l MiscLocations+2, X ; get bit of room data to check
AND.w #$00FF
ASL A
TAX
LDA.l DungeonMask, X
TYX
BIT.b $04
BNE .next_boss ; continue checking if we already got the item
LDA.l MiscLocations+4, X
STA.b $05
LDA.l MiscLocations+3, X
STA.b $04
LDA.b [$04]
AND.w #$00FF
JSR GetLootClass
BRA .next_boss
CheckPrize:
LDX.w #$FFFD
.next_prize
INX #3
LDA.l PrizeLocations, X
BPL .check
RTS
.check
CMP.b $00
BNE .next_prize
TXY
ASL A
TAX
LDA.l SaveDataWRAM, X
TYX
BIT.w #$0800
BNE .next_prize
LDA.l PrizeLocations+2, X ; get which prize to look at
AND.w #$00FF
TAX
LDA.l DungeonPrizeReceiptID, X
TYX
AND.w #$00FF
JSR GetLootClass
BRA .next_prize
CheckPots:
LDA.b $00
ASL A
TAX
LDA.l UWPotsPointers, X
STA.b $04
LDA.w #bank(UWPotsData)
STA.b $06
LDY.w #$0000
LDX.w #$FFFF
.next_pot
LDA.b [$04], Y
CMP.w #$FFFF : BEQ .done
INX : INY : INY
BIT.w #$8000 : BNE .major_item ; marked as major item
LDA.b [$04], Y
AND.w #$00FF
CMP.w #$0008 : BEQ .small_key
INY
BRA .next_pot
.small_key
LDA.w #$8000 : STA.b $08
LDA.w #$0024
PHA
PHX
INY
BRA .mask_set
.major_item
LDA.b [$04], Y
.continue
PHA
PHX
INY
TXA : ASL A
TAX
LDA.l DungeonMask, X : STA.b $08
.mask_set
LDA.b $00 : ASL A : TAX
if !FEATURE_FIX_BASEROM
LDA.l SpriteDropData, X
else
LDA.l RoomPotData, X
endif
PLX
AND.b $08
BEQ .not_obtained
PLA
BRA .next_pot
.not_obtained
PLA
AND.w #$00FF
JSR GetLootClass
BRA .next_pot
.done
RTS
CheckEnemies:
LDA.b $00
ASL A
TAX
LDA.l UWSpritesPointers, X
INC A ; skip the layered/unlayered indicator
STA.b $04
LDA.w #bank(UWSpritesData)
STA.b $06
LDY.w #$0000
LDX.w #$FFFF
.next_enemy
LDA.b [$04], Y
AND.w #$00FF
CMP.w #$00FF : BEQ .done
LDA.b [$04], Y
BIT.w #$8000 : BNE .overlord
INY : INY
LDA.b [$04], Y
AND.w #$00FF
CMP.w #$00F8 : BEQ .major ; major item
CMP.w #$00F9 : BEQ .major ; major item in other world
CMP.w #$00E4 : BEQ .vanilla_key
INY
INX
BRA .next_enemy
.overlord
INY : INY : INY
BRA .next_enemy
.vanilla_key
DEY : DEY
LDA.w #$8000 : STA.b $08
LDA.b [$04], Y
INY #3
AND.w #$00FF
CMP.w #$00FD ; big key
BEQ .big_key
CMP.w #$00FE ; small key
BEQ .small_key
; false alarm -- probably hera basement key
INX ; since it's an actual sprite it advances the counter
BRA .next_enemy
.small_key
LDA.w #$0024
PHA : PHX
BRA .mask_set
.big_key
LDA.w #$0032
PHA : PHX
BRA .mask_set
.major
DEY : DEY
LDA.b [$04], Y
AND.w #$00FF
.proceed
INY : INY : INY
PHA
PHX
TXA : ASL A
TAX
LDA.l DungeonMask, X : STA.b $08
.mask_set
LDA.b $00 : ASL A : TAX
LDA.l SpriteDropData, X
PLX
AND.b $08
BEQ .not_obtained
PLA
BRA .next_enemy
.not_obtained
PLA
AND.w #$00FF
JSR GetLootClass
JMP .next_enemy
.done
RTS
; A = item id
; updates "best loot" value if better
GetLootClass:
PHX
TAX
CMP.w #$0025 : BEQ .compass
AND.w #$00F0
CMP.w #$0080 : BNE .not_compass
.compass
LDA.l AlwaysShowCompass : BNE .check_value
.not_compass
LDA.b $0E
BEQ .done
CMP.w #$0001
BEQ .value_set
.check_value
LDA.l LootTypeMapping, X
AND.w #$00FF
.value_set
CMP.b $02
BCC .done
STA.b $02
.done
PLX
RTS

View File

@@ -0,0 +1,39 @@
File.open("supertile_shapes.asm", "r") do |file|
bytes = []
while line = file.gets
m = line.match(/dw \$(\h+), \$(\h+), \$(\h+), \$(\h+)/)
bytes += m.captures if m
break if bytes.length >= 4 * 0xE0
end
counts = []
for byte in bytes do
value = byte.to_i(16)
next if value == 0xFFFF
value = (value & 0x03FF) - 0x340
if not counts[value]
counts[value] = 0
end
counts[value] += 1
end
print(" ")
for col in 0...16
printf(" x%X", col)
end
puts
for row in 0...0xC
printf("%Xx", row + 4)
for col in 0...16
printf("%4d", counts[row * 16 + col] || 0)
end
puts
end
printf("Unused:")
for i in 0...0x80
printf(" %2X", i) unless counts[i]
end
puts
end

View File

@@ -0,0 +1,26 @@
dw $200C
dw $100E
dw $2012
dw $1023
dw $1024
dw $2028
dw $204A
dw $4056
dw $4057
dw $4058
dw $4059
dw $1060
dw $2061
dw $4062
dw $4063
dw $2077
dw $4083
dw $2084
dw $1085
dw $4098
dw $20C9
dw $40D5
dw $10D6
dw $20DB
dw $40E0
dw $FFFF

View File

@@ -0,0 +1,261 @@
db $0B ; 00 - Fighter Sword and Shield
db $0B ; 01 - Master Sword
db $0B ; 02 - Tempered Sword
db $0B ; 03 - Butter Sword
db $06 ; 04 - Fighter Shield
db $06 ; 05 - Fire Shield
db $06 ; 06 - Mirror Shield
db $0B ; 07 - Fire Rod
db $0B ; 08 - Ice Rod
db $0B ; 09 - Hammer
db $0B ; 0A - Hookshot
db $0B ; 0B - Bow
db $06 ; 0C - Boomerang
db $0B ; 0D - Powder
db $02 ; 0E - Bottle Refill (bee)
db $0B ; 0F - Bombos
db $0B ; 10 - Ether
db $0B ; 11 - Quake
db $0B ; 12 - Lamp
db $06 ; 13 - Shovel
db $0B ; 14 - Flute
db $0B ; 15 - Somaria
db $0B ; 16 - Bottle
db $05 ; 17 - Heartpiece
db $06 ; 18 - Byrna
db $0B ; 19 - Cape
db $0B ; 1A - Mirror
db $0B ; 1B - Glove
db $0B ; 1C - Mitts
db $0B ; 1D - Book
db $0B ; 1E - Flippers
db $0B ; 1F - Pearl
db $0D ; 20 - Crystal
db $06 ; 21 - Net
db $06 ; 22 - Blue Mail
db $06 ; 23 - Red Mail
db $03 ; 24 - Small Key
db $07 ; 25 - Compass
db $05 ; 26 - Heart Container from 4/4
db $02 ; 27 - Bomb
db $02 ; 28 - 3 bombs
db $06 ; 29 - Mushroom
db $06 ; 2A - Red boomerang
db $0B ; 2B - Full bottle (red)
db $0B ; 2C - Full bottle (green)
db $0B ; 2D - Full bottle (blue)
db $05 ; 2E - Potion refill (red)
db $05 ; 2F - Potion refill (green)
db $05 ; 30 - Potion refill (blue)
db $02 ; 31 - 10 bombs
db $09 ; 32 - Big key
db $02 ; 33 - Map
db $02 ; 34 - 1 rupee
db $02 ; 35 - 5 rupees
db $02 ; 36 - 20 rupees
db $0A ; 37 - Green pendant
db $0A ; 38 - Blue pendant
db $0A ; 39 - Red pendant
db $0B ; 3A - Tossed bow
db $0B ; 3B - Silvers
db $0B ; 3C - Full bottle (bee)
db $0B ; 3D - Full bottle (fairy)
db $05 ; 3E - Boss heart
db $05 ; 3F - Sanc heart
db $02 ; 40 - 100 rupees
db $02 ; 41 - 50 rupees
db $02 ; 42 - Heart
db $02 ; 43 - Arrow
db $02 ; 44 - 10 arrows
db $02 ; 45 - Small magic
db $02 ; 46 - 300 rupees
db $02 ; 47 - 20 rupees green
db $0B ; 48 - Full bottle (good bee)
db $0B ; 49 - Tossed fighter sword
db $0B ; 4A - Active Flute
db $0B ; 4B - Boots
db $06 ; 4C - Bomb capacity (50)
db $06 ; 4D - Arrow capacity (70)
db $06 ; 4E - 1/2 magic
db $06 ; 4F - 1/4 magic
db $0B ; 50 - Safe master sword
db $06 ; 51 - Bomb capacity (+5)
db $06 ; 52 - Bomb capacity (+10)
db $06 ; 53 - Arrow capacity (+5)
db $06 ; 54 - Arrow capacity (+10)
db $02 ; 55 - Programmable item 1
db $02 ; 56 - Programmable item 2
db $02 ; 57 - Programmable item 3
db $0B ; 58 - Upgrade-only silver arrows
db $02 ; 59 - Rupoor
db $02 ; 5A - Nothing
db $02 ; 5B - Red clock
db $02 ; 5C - Blue clock
db $02 ; 5D - Green clock
db $0B ; 5E - Progressive sword
db $06 ; 5F - Progressive shield
db $06 ; 60 - Progressive armor
db $0B ; 61 - Progressive glove
db $02 ; 62 - RNG pool item (single)
db $02 ; 63 - RNG pool item (multi)
db $0B ; 64 - Progressive bow
db $0B ; 65 - Progressive bow
db $02 ; 66 -
db $02 ; 67 -
db $02 ; 68 -
db $02 ; 69 -
db $0F ; 6A - Triforce
db $0E ; 6B - Power star
db $0E ; 6C - Triforce Piece
db $02 ; 6D - Server request item
db $02 ; 6E - Server request item (dungeon drop)
db $02 ; 6F -
db $02 ; 70 - Map of Light World
db $02 ; 71 - Map of Dark World
db $02 ; 72 - Map of Ganon's Tower
db $02 ; 73 - Map of Turtle Rock
db $02 ; 74 - Map of Thieves' Town
db $02 ; 75 - Map of Tower of Hera
db $02 ; 76 - Map of Ice Palace
db $02 ; 77 - Map of Skull Woods
db $02 ; 78 - Map of Misery Mire
db $02 ; 79 - Map of Dark Palace
db $02 ; 7A - Map of Swamp Palace
db $02 ; 7B - Map of Agahnim's Tower
db $02 ; 7C - Map of Desert Palace
db $02 ; 7D - Map of Eastern Palace
db $02 ; 7E - Map of Hyrule Castle
db $02 ; 7F - Map of Sewers
db $07 ; 80 - Compass of Light World
db $07 ; 81 - Compass of Dark World
db $07 ; 82 - Compass of Ganon's Tower
db $07 ; 83 - Compass of Turtle Rock
db $07 ; 84 - Compass of Thieves' Town
db $07 ; 85 - Compass of Tower of Hera
db $07 ; 86 - Compass of Ice Palace
db $07 ; 87 - Compass of Skull Woods
db $07 ; 88 - Compass of Misery Mire
db $07 ; 89 - Compass of Dark Palace
db $07 ; 8A - Compass of Swamp Palace
db $07 ; 8B - Compass of Agahnim's Tower
db $07 ; 8C - Compass of Desert Palace
db $07 ; 8D - Compass of Eastern Palace
db $07 ; 8E - Compass of Hyrule Castle
db $07 ; 8F - Compass of Sewers
db $09 ; 90 - Skull key
db $09 ; 91 - Reserved
db $09 ; 92 - Big key of Ganon's Tower
db $09 ; 93 - Big key of Turtle Rock
db $09 ; 94 - Big key of Thieves' Town
db $09 ; 95 - Big key of Tower of Hera
db $09 ; 96 - Big key of Ice Palace
db $09 ; 97 - Big key of Skull Woods
db $09 ; 98 - Big key of Misery Mire
db $09 ; 99 - Big key of Dark Palace
db $09 ; 9A - Big key of Swamp Palace
db $09 ; 9B - Big key of Agahnim's Tower
db $09 ; 9C - Big key of Desert Palace
db $09 ; 9D - Big key of Eastern Palace
db $09 ; 9E - Big key of Hyrule Castle
db $09 ; 9F - Big key of Sewers
db $08 ; A0 - Small key of Sewers
db $08 ; A1 - Small key of Hyrule Castle
db $08 ; A2 - Small key of Eastern Palace
db $08 ; A3 - Small key of Desert Palace
db $08 ; A4 - Small key of Agahnim's Tower
db $08 ; A5 - Small key of Swamp Palace
db $08 ; A6 - Small key of Dark Palace
db $08 ; A7 - Small key of Misery Mire
db $08 ; A8 - Small key of Skull Woods
db $08 ; A9 - Small key of Ice Palace
db $08 ; AA - Small key of Tower of Hera
db $08 ; AB - Small key of Thieves' Town
db $08 ; AC - Small key of Turtle Rock
db $08 ; AD - Small key of Ganon's Tower
db $02 ; AE - Reserved
db $03 ; AF - Generic small key
db $0D ; B0 - Crystal 6
db $0D ; B1 - Crystal 1
db $0D ; B2 - Crystal 5
db $0D ; B3 - Crystal 7
db $0D ; B4 - Crystal 2
db $0D ; B5 - Crystal 4
db $0D ; B6 - Crystal 3
db $02 ; B7 - Reserved
db $02 ; B8 -
db $02 ; B9 -
db $02 ; BA -
db $02 ; BB -
db $02 ; BC -
db $02 ; BD -
db $02 ; BE -
db $02 ; BF -
db $02 ; C0 -
db $02 ; C1 -
db $02 ; C2 -
db $02 ; C3 -
db $02 ; C4 -
db $02 ; C5 -
db $02 ; C6 -
db $02 ; C7 -
db $02 ; C8 -
db $02 ; C9 -
db $02 ; CA -
db $02 ; CB -
db $02 ; CC -
db $02 ; CD -
db $02 ; CE -
db $02 ; CF -
db $02 ; D0 - Bee trap
db $02 ; D1 - Apples
db $02 ; D2 - Fairy
db $02 ; D3 - Chicken
db $02 ; D4 - Big Magic
db $02 ; D5 - 5 Arrows
db $02 ; D6 - Good Bee
db $02 ; D7 -
db $02 ; D8 -
db $02 ; D9 -
db $02 ; DA -
db $02 ; DB -
db $02 ; DC -
db $02 ; DD -
db $02 ; DE -
db $02 ; DF -
db $02 ; E0 -
db $02 ; E1 -
db $02 ; E2 -
db $02 ; E3 -
db $02 ; E4 -
db $02 ; E5 -
db $02 ; E6 -
db $02 ; E7 -
db $02 ; E8 -
db $02 ; E9 -
db $02 ; EA -
db $02 ; EB -
db $02 ; EC -
db $02 ; ED -
db $02 ; EE -
db $02 ; EF -
db $02 ; F0 -
db $02 ; F1 -
db $02 ; F2 -
db $02 ; F3 -
db $02 ; F4 -
db $02 ; F5 -
db $02 ; F6 -
db $02 ; F7 -
db $02 ; F8 -
db $02 ; F9 -
db $02 ; FA -
db $02 ; FB -
db $02 ; FC -
db $02 ; FD -
db $02 ; FE - Server request (async)
db $02 ; FF -

View File

@@ -0,0 +1,258 @@
dw $FFFF, $83A5, $FFFF, $FFFF ; 00
dw $C388, $8388, $FFFF, $FFFF ; 01
dw $4348, $034A, $4342, $0342 ; 02
dw $FFFF, $FFFF, $438F, $FFFF ; 03 - Houlihan
dw $039A, $038F, $4365, $C39B ; 04
dw $FFFF, $FFFF, $FFFF, $FFFF ; 05 - unused
dw $FFFF, $FFFF, $438F, $FFFF ; 06 - Arrghus
dw $C340, $8370, $4340, $0340 ; 07 - Moldorm
dw $FFFF, $FFFF, $43B2, $03B2 ; 08 - useless fairy entrance
dw $C3A6, $837B, $FFFF, $FFFF ; 09
dw $C398, $835F, $FFFF, $FFFF ; 0A
dw $039B, $439C, $839B, $0381 ; 0B
dw $C371, $8371, $4354, $0354 ; 0C
dw $FFFF, $FFFF, $438F, $FFFF ; 0D - Aga 2
dw $FFFF, $FFFF, $8399, $439B ; 0E
dw $FFFF, $FFFF, $FFFF, $FFFF ; 0F - unused and should never be used, treated as non-id
dw $C340, $8340, $4350, $0340 ; 10
dw $83B7, $C3AC, $03B7, $438A ; 11
dw $C354, $8354, $4354, $0354 ; 12
dw $FFFF, $83B7, $FFFF, $03B7 ; 13
dw $C351, $8341, $4351, $0351 ; 14
dw $C374, $8340, $4341, $0340 ; 15
dw $0361, $039A, $C3B2, $83B2 ; 16 - gross (add middle section if feasible)
dw $C370, $8370, $4340, $0340 ; 17
dw $C3B5, $FFFF, $43B4, $FFFF ; 18 - useless fairy drop
dw $FFFF, $8369, $FFFF, $035A ; 19
dw $03E7, $03E8, $03F7, $0361 ; 1A
dw $039B, $439C, $4361, $FFFF ; 1B
dw $038F, $038F, $037E, $C39B ; 1C
dw $C3B2, $83A7, $FFFF, $FFFF ; 1D
dw $FFFF, $4391, $8399, $0366 ; 1E
dw $FFFF, $FFFF, $4360, $C399 ; 1F
dw $FFFF, $FFFF, $438F, $FFFF ; 20
dw $4348, $0363, $C348, $8368 ; 21
dw $FFFF, $FFFF, $4368, $0348 ; 22
dw $FFFF, $FFFF, $FFFF, $039B ; 23
dw $4365, $0365, $0364, $0365 ; 24
dw $FFFF, $FFFF, $FFFF, $FFFF ; 25 - unused
dw $039B, $03E4, $4363, $0382 ; 26
dw $C370, $8370, $4340, $0340 ; 27
dw $C3A5, $FFFF, $4358, $0348 ; 28
dw $FFFF, $FFFF, $FFFF, $0396 ; 29 - Mothula
dw $C350, $8352, $4350, $03F8 ; 2A
dw $C36A, $FFFF, $03F9, $C38D ; 2B
dw $C340, $8340, $4350, $0350 ; 2C - hookshot cave back
dw $FFFF, $FFFF, $FFFF, $FFFF ; 2D - unused
dw $FFFF, $838F, $FFFF, $FFFF ; 2E
dw $C3B4, $FFFF, $436E, $03B2 ; 2F - Kakariko well
dw $C361, $FFFF, $839A, $FFFF ; 30 - inset stairs if possible
dw $43B2, $0397, $839B, $C399 ; 31
dw $43C5, $03C5, $43D5, $03D5 ; 32
dw $FFFF, $FFFF, $438F, $FFFF ; 33
dw $4348, $0368, $4349, $8368 ; 34
dw $C38D, $039B, $43B1, $037D ; 35
dw $C355, $8355, $4355, $0355 ; 36
dw $439B, $838D, $437D, $03B1 ; 37
dw $C3AC, $FFFF, $43B7, $FFFF ; 38
dw $FFFF, $FFFF, $039B, $0381 ; 39
dw $03C2, $03C3, $43D3, $03D3 ; 3A - make bespoke if feasible
dw $C3A5, $FFFF, $43B5, $FFFF ; 3B - inset stairs if feasible
dw $C340, $8350, $4340, $0350 ; 3C - hookshot cave front
dw $039B, $439B, $0361, $838E ; 3D
dw $FFFF, $438F, $43B2, $0373 ; 3E
dw $FFFF, $FFFF, $8399, $C399 ; 3F
dw $C3A5, $FFFF, $4372, $C399 ; 40 - inset stairs if feasible
dw $03C6, $03C7, $03D6, $03D7 ; 41
dw $03E9, $03EA, $FFFF, $FFFF ; 42
dw $C3B2, $03B2, $FFFF, $0361 ; 43
dw $038D, $839F, $838D, $039F ; 44
dw $C3AB, $83B4, $4364, $43B7 ; 45
dw $C375, $8375, $4373, $0373 ; 46
dw $FFFF, $FFFF, $FFFF, $FFFF ; 47 - unused
dw $FFFF, $FFFF, $FFFF, $FFFF ; 48 - unused
dw $839B, $8372, $039B, $0372 ; 49
dw $03E2, $03E3, $0386, $4386 ; 4A
dw $C361, $4391, $4373, $0373 ; 4B
dw $FFFF, $83A5, $FFFF, $03B7 ; 4C
dw $C350, $8370, $4341, $0340 ; 4D
dw $839B, $439C, $FFFF, $FFFF ; 4E
dw $FFFF, $8396, $838D, $FFFF ; 4F
dw $FFFF, $83B7, $FFFF, $03B5 ; 50
dw $C354, $8354, $4384, $0384 ; 51
dw $C3B7, $FFFF, $4359, $0348 ; 52
dw $039A, $83B5, $839B, $43B7 ; 53
dw $C390, $8390, $4380, $0340 ; 54
dw $C340, $8340, $4350, $0340 ; 55 - secret passage
dw $038F, $83B4, $4365, $039F ; 56
dw $039B, $438D, $0365, $039B ; 57
dw $C372, $439B, $0383, $0365 ; 58 - split
dw $838A, $8372, $03D1, $0372 ; 59
dw $FFFF, $FFFF, $FFFF, $038F ; 5A - Helmasaur King
dw $FFFF, $83B7, $FFFF, $03B5 ; 5B
dw $C3B1, $83AA, $FFFF, $838F ; 5C
dw $039B, $C399, $0361, $FFFF ; 5D
dw $FFFF, $4391, $839C, $0366 ; 5E
dw $FFFF, $FFFF, $43BB, $FFFF ; 5F
dw $FFFF, $8379, $FFFF, $036A ; 60
dw $C387, $8385, $4356, $0356 ; 61
dw $C346, $8354, $4352, $0340 ; 62
dw $039A, $FFFF, $0361, $FFFF ; 63
dw $FFFF, $FFFF, $8399, $C3B1 ; 64
dw $FFFF, $FFFF, $83B1, $0381 ; 65
dw $038F, $039A, $0362, $83B2 ; 66
dw $83B4, $83B5, $03B7, $039F ; 67
dw $C340, $8350, $4341, $0340 ; 68
dw $FFFF, $FFFF, $FFFF, $FFFF ; 69 - unused
dw $FFFF, $03E1, $FFFF, $03F1 ; 6A
dw $039A, $0361, $839B, $C39B ; 6B
dw $039A, $FFFF, $839B, $0360 ; 6C - Lanmolas 2
dw $0361, $FFFF, $C39B, $FFFF ; 6D
dw $FFFF, $838E, $FFFF, $FFFF ; 6E
dw $FFFF, $FFFF, $FFFF, $FFFF ; 6F - unused
dw $43BA, $FFFF, $FFFF, $FFFF ; 70
dw $039A, $FFFF, $4365, $438D ; 71
dw $437A, $037A, $8386, $0342 ; 72 - slight cheating I guess...
dw $038F, $038F, $839B, $0366 ; 73
dw $43B2, $03B2, $43A8, $03A8 ; 74
dw $038F, $83B4, $0365, $03B5 ; 75
dw $838A, $03F4, $03B7, $C399 ; 76
dw $C370, $8340, $43A0, $03A0 ; 77
dw $FFFF, $FFFF, $FFFF, $FFFF ; 78 - unused
dw $FFFF, $FFFF, $FFFF, $FFFF ; 79 - unused
dw $FFFF, $FFFF, $FFFF, $FFFF ; 7A - unused
dw $C35E, $83B1, $438F, $4381 ; 7B
dw $C3B7, $83B4, $43B7, $03B7 ; 7C
dw $43B2, $835E, $034C, $0391 ; 7D
dw $FFFF, $83B7, $4393, $438A ; 7E
dw $439B, $FFFF, $838E, $FFFF ; 7F
dw $C3A7, $83B0, $FFFF, $FFFF ; 80
dw $C350, $8341, $4340, $0341 ; 81
dw $C39D, $8354, $4341, $0340 ; 82
dw $038F, $83B5, $4365, $43B7 ; 83
dw $C344, $8345, $4354, $0354 ; 84
dw $C38B, $C39B, $03B7, $439B ; 85
dw $FFFF, $FFFF, $FFFF, $FFFF ; 86 - unused
dw $8399, $439B, $4394, $838F ; 87
dw $FFFF, $FFFF, $FFFF, $FFFF ; 88 - unused
dw $C3B0, $83B0, $FFFF, $FFFF ; 89
dw $FFFF, $FFFF, $FFFF, $FFFF ; 8A - unused
dw $838A, $0360, $038A, $438D ; 8B
dw $83BE, $83BF, $03BD, $0391 ; 8C
dw $0360, $C38A, $038D, $438A ; 8D
dw $FFFF, $838E, $FFFF, $FFFF ; 8E
dw $FFFF, $FFFF, $FFFF, $FFFF ; 8F - unused
dw $FFFF, $FFFF, $438F, $FFFF ; 90
dw $FFFF, $83A5, $FFFF, $03B7 ; 91
dw $03D2, $C3B7, $0364, $039F ; 92
dw $C36C, $836C, $C39B, $838F ; 93
dw $FFFF, $FFFF, $FFFF, $FFFF ; 94 - unused
dw $FFFF, $83B7, $FFFF, $03B5 ; 95
dw $C3B7, $FFFF, $03B7, $C39C ; 96
dw $039A, $83B4, $839B, $036F ; 97
dw $FFFF, $FFFF, $43B2, $0397 ; 98
dw $FFFF, $038F, $434A, $0363 ; 99
dw $FFFF, $FFFF, $FFFF, $FFFF ; 9A - unused
dw $839B, $0381, $435E, $0378 ; 9B
dw $C350, $8350, $4341, $0341 ; 9C
dw $C35E, $83B2, $43B1, $035E ; 9D
dw $FFFF, $439A, $838D, $03B9 ; 9E
dw $FFFF, $FFFF, $439B, $FFFF ; 9F
dw $839B, $C39C, $FFFF, $FFFF ; A0
dw $C3B0, $835D, $FFFF, $036A ; A1
dw $03EE, $03EF, $03FE, $03FF ; A2
dw $C35A, $FFFF, $436A, $FFFF ; A3
dw $FFFF, $FFFF, $438E, $FFFF ; A4
dw $039A, $0361, $C3B2, $83B2 ; A5
dw $C340, $8370, $4340, $0340 ; A6
dw $C396, $FFFF, $FFFF, $FFFF ; A7 - ToH fairy basement room
dw $039B, $03E5, $839B, $03F5 ; A8
dw $C357, $8357, $4356, $0356 ; A9
dw $03E6, $439B, $03F6, $C39B ; AA
dw $FFFF, $FFFF, $439A, $FFFF ; AB
dw $FFFF, $FFFF, $FFFF, $038F ; AC - Blind
dw $FFFF, $FFFF, $FFFF, $FFFF ; AD - unused
dw $FFFF, $8399, $FFFF, $FFFF ; AE
dw $C39B, $FFFF, $FFFF, $FFFF ; AF
dw $039B, $C399, $839B, $C399 ; B0
dw $0391, $83B5, $434C, $438A ; B1
dw $C35C, $83A2, $039B, $0366 ; B2
dw $0365, $FFFF, $0365, $FFFF ; B3
dw $03FA, $83FD, $03EC, $03ED ; B4
dw $03EB, $83FD, $83FA, $03FD ; B5
dw $C3A5, $83B4, $43B5, $03B5 ; B6
dw $C3B4, $FFFF, $43B5, $FFFF ; B7
dw $FFFF, $838A, $FFFF, $03B4 ; B8
dw $43F3, $03F3, $4354, $0354 ; B9
dw $0364, $438D, $FFFF, $FFFF ; BA
dw $838A, $8364, $4372, $0364 ; BB
dw $83BE, $C38A, $03D0, $438A ; BC
dw $FFFF, $FFFF, $FFFF, $FFFF ; BD - unused
dw $FFFF, $439A, $FFFF, $C365 ; BE
dw $FFFF, $8396, $438D, $FFFF ; BF
dw $C372, $C399, $4372, $C399 ; C0
dw $039B, $0364, $4365, $8364 ; C1
dw $C351, $8353, $4341, $0353 ; C2
dw $03E0, $C369, $03F0, $4369 ; C3 - show layers
dw $43C0, $03C0, $4340, $0341 ; C4
dw $C3B5, $FFFF, $438A, $FFFF ; C5
dw $03FA, $03FB, $83FA, $83FB ; C6
dw $43FB, $83FD, $03FC, $03FD ; C7
dw $FFFF, $FFFF, $FFFF, $038F ; C8 - Armos Knights
dw $03F2, $43F2, $0386, $4386 ; C9
dw $FFFF, $FFFF, $FFFF, $FFFF ; CA - unused
dw $C340, $8343, $4354, $0347 ; CB
dw $C353, $8350, $4347, $0354 ; CC
dw $FFFF, $FFFF, $FFFF, $FFFF ; CD - unused
dw $FFFF, $8391, $FFFF, $FFFF ; CE - Kholdstare drop
dw $FFFF, $FFFF, $FFFF, $FFFF ; CF - unused
dw $C372, $C399, $4372, $C399 ; D0
dw $C38E, $838F, $4381, $C38D ; D1
dw $FFFF, $83B5, $FFFF, $0395 ; D2
dw $FFFF, $FFFF, $FFFF, $FFFF ; D3 - unused
dw $FFFF, $FFFF, $FFFF, $FFFF ; D4 - unused
dw $C3B5, $FFFF, $43B5, $FFFF ; D5
dw $C3B5, $83B5, $43B4, $03B5 ; D6
dw $FFFF, $FFFF, $FFFF, $FFFF ; D7 - unused
dw $FFFF, $8361, $FFFF, $839B ; D8
dw $FFFF, $FFFF, $4360, $0360 ; D9
dw $FFFF, $FFFF, $439C, $FFFF ; DA
dw $C354, $8346, $4354, $037F ; DB
dw $C346, $8354, $4343, $0340 ; DC
dw $FFFF, $FFFF, $FFFF, $FFFF ; DD - unused
dw $FFFF, $8396, $FFFF, $FFFF ; DE - Kholdstare
dw $FFFF, $FFFF, $43A0, $0354 ; DF - paradox top
dw $039B, $C399, $0361, $FFFF ; E0
; no more dungeon
dw $C340, $8340, $4350, $0340 ; E1 - lost woods thieves hideout
dw $C340, $8340, $4340, $0350 ; E2 - lumberjack cave
dw $FFFF, $83B4, $43B2, $036E ; E3 - magic bat
dw $C340, $8342, $4350, $0342 ; E4 - old man's house front
dw $C342, $8340, $4356, $0354 ; E5 - old man's house back
dw $C340, $8341, $4350, $0340 ; E6 - death mountain descent left
dw $C341, $8340, $4340, $0350 ; E7 - death mountain descent right
dw $C370, $8370, $4380, $0350 ; E8 - superbunny top
dw $FFFF, $FFFF, $FFFF, $FFFF ; E9 - unused
dw $C3A5, $FFFF, $43B5, $FFFF ; EA - spectacle top
dw $FFFF, $83A6, $FFFF, $03B5 ; EB - bumper top
dw $FFFF, $FFFF, $FFFF, $FFFF ; EC - unused
dw $C370, $8370, $4340, $0350 ; ED - fairy ascension top
dw $C340, $8390, $4340, $0350 ; EE - spiral top
dw $FFFF, $8340, $43A0, $0354 ; EF - paradox top
dw $C340, $8342, $4350, $0342 ; F0 - old man rescue left
dw $C342, $8342, $4340, $0350 ; F1 - old man rescue right
dw $FFFF, $FFFF, $FFFF, $03B2 ; F2 - Sahasrahla's Kakariko house left
dw $FFFF, $FFFF, $43B2, $FFFF ; F3 - Sahasrahla's Kakariko house right
dw $FFFF, $FFFF, $FFFF, $03B2 ; F4 - quarreling brothers left
dw $FFFF, $FFFF, $43B2, $FFFF ; F5 - quarreling brothers right
dw $FFFF, $FFFF, $FFFF, $FFFF ; F6 - unused
dw $FFFF, $FFFF, $FFFF, $FFFF ; F7 - unused
dw $C370, $8370, $43A0, $0354 ; F8 - superbunny bottom
dw $C340, $8341, $4350, $0340 ; F9 - spectacle left
dw $C374, $8340, $4350, $0340 ; FA - spectacle bottom
dw $FFFF, $83A5, $4348, $0358 ; FB - bumper bottom
dw $FFFF, $FFFF, $FFFF, $FFFF ; FC - unused
dw $C370, $8370, $4354, $0354 ; FD - fairy ascension bottom
dw $FFFF, $FFFF, $43B4, $03B5 ; FE - spiral bottom
dw $C3B4, $83B4, $436E, $036D ; FF - paradox bottom

144
dungeon_map/draw_loot.asm Normal file
View File

@@ -0,0 +1,144 @@
RedrawLoot:
JSL DrawLoot
; what we wrote over
SEP #$20
STZ.w $0210
RTL
FirstDrawLoot:
LDA.b #$FF
STA.w $0215
LDA.b #$80
STA.w $0216
STA.w $0218
LDA.l DRMode
BEQ +
LDA.w DungeonID
ASL A
TAX
LDA.l DungeonMapData.floor, X
STA.b $A4
+
; what we wrote over
LDA.b #$08
STA.b $17
DrawLoot:
LDA.b $07
STA.w $021B
REP #$30
PHX : PHY
STZ.b $0E
LDX.w DungeonID
LDA.l DungeonMapRoomPointers, X
STA.b $0C
SEP #$20
LDA.l DungeonMapFloorCountData, X
AND.b #$0F
CLC : ADC.w $020E
PHA
JSR DrawSingleFloorLoot
INC.b $0F
LDA.b #$80
STA.b $0E
PLA : DEC A
JSR DrawSingleFloorLoot
LDX.w GFXStripes
LDA.b #$FF
STA.w GFXStripes+2, X
LDA.b #$01
STA.b NMISTRIPES
PLY : PLX
LDA.b #$00
RTL
DrawSingleFloorLoot:
REP #$20
AND.w #$00FF
ASL A
TAX
LDA.l DungeonMapFloorToDataOffset, X
TAY
STZ.b $06
.next_row
REP #$20
LDA.w GFXStripes
TAX
CLC : ADC.w #$0030
STA.w GFXStripes
LDA.b $07
AND.w #$00FF
XBA
LSR A : LSR A
CLC : ADC.w #$1092
ADC.b $0E
XBA
STA.w GFXStripes+2, X
CLC : ADC.w #$2000
STA.w GFXStripes+$1A, X
LDA.w #$1300
STA.w GFXStripes+$04, X
STA.w GFXStripes+$1C, X
.next_room
REP #$20
LDA.b ($0C), Y ; get room id
PHY
AND.w #$00FF
CMP.w #$000F ; $0F = empty room
BNE .valid_room
LDA.w #$0000
BRA +
.valid_room
JSL CheckLoot
+
ASL A : ASL A : ASL A
TXY
TAX
LDA.l LootTypeIcons+0, X
STA.w GFXStripes+$06, Y
LDA.l LootTypeIcons+2, X
STA.w GFXStripes+$08, Y
LDA.l LootTypeIcons+4, X
STA.w GFXStripes+$1E, Y
LDA.l LootTypeIcons+6, X
STA.w GFXStripes+$20, Y
TYX
PLY
INY : INX #4
SEP #$20
INC.b $06
LDA.b $06
CMP.b #$05
BCC .next_room
STZ.b $06
INC.b $07
LDA.b $07
CMP.b #$05
BCS .done
JMP .next_row
.done
RTS

247
dungeon_map/draw_rooms.asm Normal file
View File

@@ -0,0 +1,247 @@
; $CA has room_id
DrawDungeonMapRoom:
PHB : PHK : PLB ; need to keep this in same bank as data, or else specify bank
LDA.b $0A : PHA
LDA.l ShowRooms_default
AND.w #$00FF
STA.b $0A
PHX
LDX.w DungeonID
LDA.l MapField
AND.l DungeonMask, X
BEQ +
LDA.l ShowRooms_have_map
AND.w #$00FF
CMP.b $0A
BCC +
STA.b $0A
+
LDX.w DungeonID
LDA.l CompassField
AND.l DungeonMask, X
BEQ +
LDA.l ShowRooms_have_compass
AND.w #$00FF
CMP.b $0A
BCC +
STA.b $0A
+
LDA.b $0E
AND.w #$000F
BEQ +
LDA.l ShowRooms_visited_tile
AND.w #$00FF
CMP.b $0A
BCC +
STA.b $0A
+
LDA.b $0A : BNE + : LDA.w #$0F00 : BRA ++
+ DEC A : BNE + : LDA.w #$174F : BRA ++
+ DEC A : BNE + : LDA.w #$174F : BRA ++
+ DEC A : BNE + : LDA.w #$1400 : BRA ++
+ DEC A : BNE + : LDA.w #$1000 : BRA ++
+ DEC A : BNE + : LDA.w #$0C00 : BRA ++
+ LDA.w #$0800
++ STA.b $0C
PLX
LDA.b $CA
AND.w #$00FF
ASL A : ASL A : ASL A
TAY
macro DrawQuadrant(quadrant, writeOffset)
?DrawQuadrant:
LDA.w SupertileRoomShapes+(2*<quadrant>), Y
CMP.w #$FFFF : BEQ ?.empty
PHA
LDA.b $0E
AND.w #1<<(3-<quadrant>)
BNE ?.visited
?.unvisited
LDA.b $0A
CMP.w #$0003
BCS ?.shape
?.square
PLA
LDA.b $0C
EOR.w #(3-<quadrant>)<<14
BRA ?.write
?.shape
PLA
ORA.b $0C
BRA ?.write
?.visited
PLA
ORA.w #$0800
BRA ?.write
?.empty
LDA.b $0A
CMP.w #$0001
BEQ ?.full_square
LDA.w #$0F00
BRA ?.write
?.full_square
LDA.w #$174F
EOR.w #(3-<quadrant>)<<14
?.write
STA.l $7F0000+<writeOffset>, X
?.done
endmacro
%DrawQuadrant(0, $00)
%DrawQuadrant(1, $02)
%DrawQuadrant(2, $40)
%DrawQuadrant(3, $42)
.done
PLA : STA.b $0A
PLB
RTL
DrawEntrances:
REP #$30
PHX : PHY
LDA.b $06 : PHA
LDX.w DungeonID
LDA.l DungeonMapRoomPointers, X
STA.b $0C
SEP #$20
LDA.l DungeonMapFloorCountData, X
AND.b #$0F
CLC : ADC.w $020E
DEC A
REP #$20
AND.w #$00FF
JSR DrawBothFloorsEntrances
.done
REP #$20
PLA : STA.b $06
PLY : PLX
SEP #$30
RTL
DrawBothFloorsEntrances:
ASL A
TAX
LDA.l DungeonMapFloorToDataOffset, X
TAY
STZ.b $06
.next_room
REP #$20
LDA.b ($0C), Y ; get room id
AND.w #$00FF
CMP.w #$000F ; $0F = empty room
BEQ +
JSR DrawSingleRoomEntrances
+
INY
SEP #$20
INC.b $06
LDA.b $06
CMP.b #$05
BCC .next_room
STZ.b $06
- INC.b $07
LDA.b $07
CMP.b #$0A
BCC .next_room
.done
RTS
macro DrawSingleEntrance(offset)
LDX.b $00
STZ.w OAMBufferAux, X ; high x-bit and size bit
TXA
ASL #2
TAX
LDA.b $06
ASL #4
CLC : ADC.b #$90+<offset>
STA.w OAMBuffer+0, X
LDA.b $07
ASL #4
CMP.b #$50
BCC ?+
CLC : ADC.b #$50
?+ CLC : ADC.b #$87
CLC : ADC.w $0213
SEC : SBC.b $E8
STA.w OAMBuffer+1, X
LDA.b #$33
STA.w OAMBuffer+2, X
LDA.b #$23
STA.w OAMBuffer+3, X
INC.b $00
endmacro
DrawSingleRoomEntrances:
STA.b $0E
SEP #$10
LDX.b #$FE
.next_entry
INX : INX
LDA.l SupertileEntrances, X
BPL +
JMP .done
+
AND.w #$0FFF
CMP.b $0E
BNE .next_entry
SEP #$20
LDA.l SupertileEntrances+1, X
PHA : PHA
BIT.b #$40
BEQ +
%DrawSingleEntrance(0)
+
PLA
BIT.b #$20
BEQ +
%DrawSingleEntrance(4)
+
PLA
BIT.b #$10
BEQ +
%DrawSingleEntrance(8)
+
.done
REP #$30
RTS

View File

@@ -0,0 +1,187 @@
CheckSwitchMap:
SEP #$20
LDA.b $F6
AND.b #$30
BNE +
; what we wrote over
REP #$20
LDA.w $8AF5E9, X
AND.w #$000F
CLC : ADC.b $00
RTL
+ PHA
TXA
ASL A
TAX
PLA
BIT.b #$20
BNE +
INX
+ LDA.l DungeonMapData.prev, X
STA.w DungeonID
LDA.b #$04
STA.w $0200
REP #$20
LDA.w #$0000
RTL
DungeonMapSwitch_Submodule:
; LDA.b $9B
; STA.l $7EC229
JSL $80893D
JSL $80833F
; LDA.l $7EC229
; STA.b $9B
LDA.b #$09
STA.b $14
STA.w $0710
LDA.b #$01
STA.w $0200
STA.w $020D
STZ.w $0213
STZ.w $021B
STZ.w $021C
STZ.b $06
STZ.b $07
LDA.w DungeonID
ASL A
TAX
LDA.l DungeonMapData.floor, X
STA.b $A4
REP #$20
STZ.b $E0
STZ.b $E2
STZ.b $E4
STZ.b $E6
STZ.b $E8
STZ.b $EA
JML $98BCA1
SkipMapSprites:
STZ.b $00
LDA.l DRMode
BNE +
LDA.w $0200
CMP.b #$04
BEQ +
JSL DrawEntrances
+
STZ.b $0E
STZ.b $0F
LDA.w $0200
CMP.b #$04
BNE +
JML $8AEAFC
+
LDA.l DRMode
BEQ +
JML $8AEAEE
+
LDA.l $7EC22A
CMP.w DungeonID
BEQ +
JML $8AEAF3
+ JML $8AEADE
CacheCurrentDungeon:
STA.l $7EC206
SEP #$20
LDA.b $A4
STA.l $7EC22B
LDA.w DungeonID
STA.l $7EC22A
LDA.l DRMode
BEQ +
LDA.w DungeonID
PHX
ASL A
TAX
LDA.l DungeonMapData.floor, X
STA.b $A4
PLX
+
REP #$20
RTL
RestoreCurrentDungeon:
LDA.b #$F3
STA.w $012C ; what we wrote over
LDA.l $7EC22A
STA.w DungeonID
LDA.l $7EC22B
STA.b $A4
RTL
RestoreDungeonMapFloorIndex:
STZ.w $020F ; first part we wrote over
LDA.w $021B
STA.b $07
STZ.b $06
LDA.b $0A ; the rest of what we wrote over
AND.b #$08
RTL
DrawDungeonLabel:
LDY.b #$00
LDA.w DungeonID
ASL A
TAX
LDA.b NMISTRIPES
BEQ +
LDY.b #$20
+
REP #$20
LDA.w #$E660
STA.w GFXStripes+$02, Y
LDA.w #$0300
STA.w GFXStripes+$04, Y
LDA.l DungeonLabels+0, X
STA.w GFXStripes+$06, Y
LDA.l DungeonLabels+2, X
STA.w GFXStripes+$08, Y
SEP #$20
LDA.b #$FF
STA.w GFXStripes+$0A, Y
LDA.b #$01
STA.b NMISTRIPES
INC.w $020D ; what we wrote over
RTL
CountFloors:
ADC.w $8AF605, Y
STA.b $04
LDY.w #$0000
RTL
CheckIfRoomFound:
CPY.w #$0032
BCS .not_found
LDA.b ($04), Y
INY
CMP.b $0E
JML $8AE877
.not_found
JML $8AE8CD

150
dungeon_map/hooks.asm Normal file
View File

@@ -0,0 +1,150 @@
; move aga boss icon to correct room
org $8AEE75
db $08
; change dungeon map subsheet gfx in TR
; org $80DDC9
; db $57
; dungeon map sheets
org $80DD97
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
; unused chest data
org $81E9A5
dw $00F0 ; freezor room, second chest (only one chest in supertile)
org $81EA6E
dw $00F0 ; mire spike room, second chest (only one chest in supertile)
org $81EAF8
dw $00F0 ; GT button/switch/bladetrap room (no chest in supertile)
; Dungeon Map Palettes 2-5 left half
org $9BE544
dw $0000, $71E7, $7FFF, $3B5F, $0000, $0000, $7EB5, $1CE7
org $9BE564
dw $0000, $5565, $7FFF, $331C, $0000, $0000, $7E27, $0C63
org $9BE584
dw $0000, $4100, $7FFF, $2656, $4100, $0000, $4100, $4100
org $9BE5A4
dw $0000, $34E0, $7FFF, $34E0, $34E0, $0000, $34E0, $34E0
; move BG1 to main screen in dungeon map screen
org $8AE130
LDA.b #$17 : STA.b $1C
LDA.b #$00 : STA.b $1D
; make skull icon blink opposite our loot icons
org $8AEE2B
AND.b #$10
NOP #2
db $F0 ; BEQ to replace BCS
;================================================================================
; Overhaul of Dungeon Map Screen
;--------------------------------------------------------------------------------
org $8AE64F
PLX
JSL DrawDungeonMapRoom
JMP.w $8AE7F2
org $8AE152
JSL LoadLastHUDPalette
org $8AEAE8 ; vanilla checks number of sprites drawn instead of... counting...
LDA.b $0E
CMP.b #$02
;================================================================================
; Swapping Dungeon in Dungeon Map Screen (L/R)
;--------------------------------------------------------------------------------
org $8AE9A7
JSL CheckSwitchMap
BRA + : NOP #3 : +
org $8AEF06
DEC.b $13
BNE +
JML DungeonMapSwitch_Submodule
+ RTL
warnpc $8AEF29
org $8AEADA
JML SkipMapSprites
org $8AE9C7
JSL RestoreDungeonMapFloorIndex
NOP
org $98BC86
JSL CacheCurrentDungeon
org $8AEFC5
JSL RestoreCurrentDungeon
NOP
org $8AE1EC
PLB
JML DrawDungeonLabel
org $8AE86A
JSL CountFloors
NOP #2
org $8AE872
JML CheckIfRoomFound
NOP
;================================================================================
; Show indicators of what is left in each room
;--------------------------------------------------------------------------------
org $8AEABA
JSL RedrawLoot
NOP
org $8AE42B
JSL FirstDrawLoot
;================================================================================
; Blink indicators of what is left in each room
;--------------------------------------------------------------------------------
org $8AE964
JSL BlinkLoot
org $8AE235
JSL WriteBigEndianAddressX
org $8AE290
JSL WriteBigEndianAddressY
org $8AE350
JSL WriteBigEndianAddressY
org $8AE206
JSL StartDoubleWrite
NOP
org $8AE2E0
JML CheckDoubleWrite
NOP
org $8AE21C
JSL DrawMountain
BRA + : NOP #9 : +

36
dungeon_map/main.asm Normal file
View File

@@ -0,0 +1,36 @@
pushpc
incsrc hooks.asm
macro WriteGFXSheetPointer(sheet, location)
pushpc
org $80CFC0+<sheet>
db <location>>>16
org $80D09F+<sheet>
db <location>>>8
org $80D17E+<sheet>
db <location>>>0
pullpc
endmacro
%WriteGFXSheetPointer($C9, DungeonMapIcons1)
%WriteGFXSheetPointer($CA, DungeonMapIcons2)
%WriteGFXSheetPointer($D5, DungeonMapIcons3)
; %WriteGFXSheetPointer($D6, DungeonMapIcons2)
; TR is such a problem child
; %WriteGFXSheetPointer($A6, DungeonMapIcons2)
%WriteGFXSheetPointer($D4, MapSheetD4)
pullpc
incsrc draw_rooms.asm
incsrc map_bg3.asm
incsrc dungeon_switch.asm
incsrc draw_loot.asm
incsrc check_loot.asm
incsrc blink_loot.asm

96
dungeon_map/map_bg3.asm Normal file
View File

@@ -0,0 +1,96 @@
pushpc
org $809383
db BG3DungeonMapStripes>>0
org $80938C
db BG3DungeonMapStripes>>8
org $809395
db BG3DungeonMapStripes>>16
pullpc
LoadLastHUDPalette:
; what we wrote over
JSL $9BEE52
REP #$20
LDA.l MapHUDPalette
STA.l PaletteBuffer+$3A
LDA.l MapHUDPalette+2
STA.l PaletteBuffer+$3C
LDA.l MapHUDPalette+4
STA.l PaletteBuffer+$3E
SEP #$20
RTL
BG3DungeonMapStripes:
; boring stuff from vanilla
dw $4260, $0100, $2100
dw $4360, $0E40, $2101
dw $4B60, $0100, $6100
dw $6260, $2EC0, $2110
dw $6B60, $2EC0, $6110
dw $6263, $0100, $A100
dw $6363, $0E40, $A101
dw $6B63, $0100, $E100
dw $8460, $0B00, $2102, $2103, $2104, $2105, $2106, $2107
dw $A460, $0B00, $2112, $2113, $2114, $2115, $2116, $2117
dw $4E60, $0100, $2100
dw $4F60, $1A40, $2101
dw $5D60, $0100, $6100
dw $6E60, $2EC0, $2110
dw $7D60, $2EC0, $6110
dw $6E63, $0100, $A100
dw $6F63, $1A40, $A101
dw $7D63, $0100, $E100
dw $0060, $7E40, $2111
dw $8063, $3E41, $2111
dw $0060, $3EC0, $2111
dw $0160, $3EC0, $2111
dw $0C60, $3EC0, $2111
dw $0D60, $3EC0, $2111
dw $1E60, $3EC0, $2111
dw $1F60, $3EC0, $2111
; new stuff here:
; horizontal borders
dw $7260, $1340, $1D11
dw $D261, $1340, $1D11
dw $F261, $1340, $1D11
dw $5263, $1340, $1D11
; vertical borders
dw $7160, $2FC0, $1D11
dw $7C60, $2FC0, $1D11
macro TopOfSquares(start)
; silly Big Endian
db <start>>>8, <start>, $00, $13
dw $5D4C, $1D4C, $5D4C, $1D4C, $5D4C, $1D4C, $5D4C, $1D4C, $5D4C, $1D4C
endmacro
macro BottomOfSquares(start)
; silly Big Endian
db <start>>>8, <start>, $00, $13
dw $DD4C, $9D4C, $DD4C, $9D4C, $DD4C, $9D4C, $DD4C, $9D4C, $DD4C, $9D4C
endmacro
macro FullRow(start)
%TopOfSquares(<start>)
%BottomOfSquares(<start>+$20)
endmacro
; top grid
%FullRow($6092)
%FullRow($60D2)
%FullRow($6112)
%FullRow($6152)
%FullRow($6192)
%FullRow($6212)
%FullRow($6252)
%FullRow($6292)
%FullRow($62D2)
%FullRow($6312)
db $FF

189
dungeon_map/settings.asm Normal file
View File

@@ -0,0 +1,189 @@
; $B9F000
SupertileRoomShapes:
incsrc data/supertile_shapes.asm
warnpc $B9F800
padbyte $FF
pad $B9F800
org $B9F800
DungeonMapData:
db $02, $04, $00, $00 ; Sewers
db $1A, $00, $00, $00 ; Hyrule Castle
db $00, $06, $00, $00 ; Eastern Palace
db $04, $14, $00, $00 ; Desert Palace
db $14, $0C, $01, $00 ; Castle Tower
db $0C, $10, $00, $00 ; Swamp Palace
db $08, $0A, $00, $00 ; Palace of Darkness
db $12, $18, $00, $00 ; Misery Mire
db $0A, $16, $FF, $00 ; Skull Woods
db $16, $0E, $00, $00 ; Ice Palace
db $06, $08, $01, $00 ; Tower of Hera
db $10, $12, $00, $00 ; Thieves Town
db $0E, $1A, $00, $00 ; Turtle Rock
db $18, $02, $01, $00 ; Ganon's Tower
db $1A, $02, $00, $00 ; Extra
db $1A, $02, $00, $00 ; Extra
struct DungeonMapData DungeonMapData
.prev: skip 1
.next: skip 1
.floor: skip 1
.unused: skip 1
endstruct
warnpc $B9F880
org $B9F880
LootTypeIcons:
dw $0B00, $0B00, $0B00, $0B00 ; 00 - nothing
dw $2F32, $6F32, $AF32, $EF32 ; 01 - unknown - dot
dw $2B0D, $6B0D, $2B3D, $6B3D ; 02 - junk - pot
dw $2B07, $6B07, $2B17, $2B18 ; 03 - small key
dw $2B0B, $6B0B, $2B3B, $6B3B ; 04 - triforce piece
dw $6B08, $2B08, $EB08, $AB08 ; 05 - safety - plus
dw $2B0E, $6B0E, $2B3E, $6B3E ; 06 - less important item - small chest
dw $AB3A, $EB3A, $2B3A, $6B3A ; 07 - compass
dw $2B07, $6B07, $2B17, $2B18 ; 08 - small key
dw $2B05, $6B05, $2B15, $2B16 ; 09 - big key
dw $2B09, $2B0A, $2B39, $6B39 ; 0A - pendant
dw $2B0F, $6B0F, $2B3F, $6B3F ; 0B - important inventory item - big chest
dw $2B09, $2B0A, $2B39, $6B39 ; 0C - also pendant
dw $6F02, $2B02, $EB02, $AF02 ; 0D - crystal
dw $2B0B, $6B0B, $2B3B, $6B3B ; 0E - triforce piece
dw $2B0C, $6B0C, $2B3C, $6B3C ; 0F - triforce
warnpc $B9F900
org $B9F900
LootTypeMapping:
incsrc data/item_mapping.asm
warnpc $B9FA00
org $B9FA00
; Room ID mappings to bit to check for presence and address of item drop
MiscLocations:
dw $00C8 : db $04 : dl HeartContainer_ArmosKnights
dw $0033 : db $04 : dl HeartContainer_Lanmolas
dw $0007 : db $04 : dl HeartContainer_Moldorm
dw $005A : db $04 : dl HeartContainer_HelmasaurKing
dw $0006 : db $04 : dl HeartContainer_Arrghus
dw $0029 : db $04 : dl HeartContainer_Mothula
dw $00AC : db $04 : dl HeartContainer_Blind
dw $00DE : db $04 : dl HeartContainer_Kholdstare
dw $0090 : db $04 : dl HeartContainer_Vitreous
dw $00A4 : db $04 : dl HeartContainer_Trinexx
dw $0073 : db $05 : dl BonkKey_Desert ; torch
dw $008C : db $05 : dl BonkKey_GTower ; torch
dw $0087 : db $05 : dl StandingKey_Hera
dw $FFFF : db $FF : dl $FFFFFF ; Placeholders
dw $FFFF : db $FF : dl $FFFFFF
dw $FFFF : db $FF : dl $FFFFFF ; Aga 1? ($0020)
dw $FFFF : db $FF : dl $FFFFFF ; Ice Armos? ($001C)
dw $FFFF : db $FF : dl $FFFFFF ; Lanmolas 2? ($0033)
dw $FFFF : db $FF : dl $FFFFFF ; Moldorm 2? ($004D)
dw $FFFF : db $FF : dl $FFFFFF ; Aga 2? ($000D)
dw $FFFF
warnpc $B9FA9A
org $B9FA9A
MapHUDPalette:
dw $0000, $3ED8, $2E54
warnpc $B9FAA0
org $B9FAA0
PrizeLocations:
dw $00C8 : db $02 ; Armos Knights
dw $0033 : db $03 ; Lanmolas
dw $0006 : db $05 ; Arrghus
dw $005A : db $06 ; Helmasaur King
dw $0090 : db $07 ; Vitreous
dw $0029 : db $08 ; Mothula
dw $00DE : db $09 ; Kholdstare
dw $0007 : db $0A ; Moldorm
dw $00AC : db $0B ; Blind
dw $00A4 : db $0C ; Trinexx
dw $FFFF
warnpc $B9FAC0
org $B9FAC0
SupertileEntrances:
incsrc data/entrance_tiles.asm
warnpc $B9FB00
padbyte $FF
pad $B9FB00
; $B9FB00
DungeonLabels:
dw $2550, $2579 ; Sewers
dw $2550, $2578 ; Hyrule Castle
dw $2561, $256C ; Eastern Palace
dw $2560, $256C ; Desert Palace
dw $255D, $2570 ; Agahnim's Tower
dw $256F, $256C ; Swamp Palace
dw $256C, $2560 ; Palace of Darkness
dw $2569, $2569 ; Misery Mire
dw $256F, $2573 ; Skull Woods
dw $2565, $256C ; Ice Palace
dw $2570, $2564 ; Tower of Hera
dw $2570, $2570 ; Thieves' Town
dw $2570, $256E ; Turtle Rock
dw $2563, $2570 ; Ganon's Tower
dw $25A4, $25A4 ; Reserved
dw $25A4, $25A4 ; Reserved
; $B9FB40
warnpc $B9FF00
org $B9FF00
; $00 - do not show anything
; $01 - show presence of supertile as dark square
; $02 - show presence of quadrants as dark squares
; $03 - show outline of shape with walls but no interior details (palette 5)
; $04 - show dark with stairs but no hole/internal walls (palette 4)
; $05 - show mostly lit with stairs and holes/internal walls (palette 3)
; $06 - show fully lit with stairs and holes/internal walls (palette 2)
ShowRooms:
.default
db $02
.have_map
db $05
.have_compass
db $03
.visited_tile
db $04
.reserved
skip 4
warnpc $B9FF08
org $B9FF08
; $00 - do not show anything
; $01 - show presence of unobtained items
; $02 - show category of item
ShowItems:
.default
db $00
.have_map
db $00
.have_compass
db $02
.visited_tile
db $01
.reserved
skip 4
warnpc $B9FF10
org $B9FF10
; ---P bepc
; P - dungeon prizes
; b - bosses (and torches in GT, plus hera basement standing item)
; e - enemy drops
; p - pots
; c - chests
ItemSources:
db $09
AlwaysShowCompass:
db $01

View File

@@ -3,27 +3,35 @@
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
SpawnDungeonPrize: SpawnDungeonPrize:
PHX : PHB PHX : PHB
TAX
LDA.b $06,S : STA.b ScrapBuffer72 ; Store current RoomTag index PHA
TXA ; Don't spawn prize in Cave state, Hyrule Castle, Escape, Castle Tower, or Ganon's Tower
JSL.l AttemptItemSubstitution LDA.w DungeonID : BMI .skip_prize_drop ; Cave state
JSL.l ResolveLootIDLong CMP.b #$00 : BEQ .skip_prize_drop ; Escape
JSL AttemptItemSubstitution CMP.b #$02 : BEQ .skip_prize_drop ; Hyrule Castle
JSL ResolveLootIDLong CMP.b #$1A : BEQ .skip_prize_drop ; Ganon's Tower
CMP.b #$08 : BEQ .skip_prize_drop ; Agahnim's Tower (Castle Tower)
PLA
STA.w ItemReceiptID STA.w ItemReceiptID
TAX TAX
LDA.b $06,S : STA.b ScrapBuffer72 ; Store current RoomTag index
LDA.b #$29 : LDY.b #$06 LDA.b #$29 : LDY.b #$06
JSL AddAncillaLong JSL AddAncillaLong
BCS .failed_spawn BCS .failed_spawn
LDA.w ItemReceiptID LDA.w ItemReceiptID
STA.w AncillaGet,X : STA.w SpriteID,X STA.w AncillaGet,X
JSR AddDungeonPrizeAncilla JSR AddDungeonPrizeAncilla
LDX.b ScrapBuffer72 : STZ.b RoomTag,X LDX.b ScrapBuffer72 : STZ.b RoomTag,X
.failed_spawn .failed_spawn
PLB : PLX PLB : PLX
RTL RTL
.skip_prize_drop:
PLA : PLB : PLX
RTL
AddDungeonPrizeAncilla: AddDungeonPrizeAncilla:
LDY.w ItemReceiptID LDY.w ItemReceiptID
STZ.w AncillaVelocityY,X STZ.w AncillaVelocityY,X
@@ -67,14 +75,33 @@ RTS
PrepPrizeTile: PrepPrizeTile:
PHA : PHX : PHY PHA : PHX : PHY
LDA.w AncillaGet, X JSL BossPrizeGetPlayer : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID
JSL AttemptItemSubstitution LDA.b #$01 : STA.l SpriteSkipEOR
JSL ResolveLootIDLong LDA.w AncillaGet, X
STA.w SpriteID,X JSL AttemptItemSubstitution
JSL TransferItemReceiptToBuffer_using_ReceiptID JSL ResolveLootIDLong
STA.w AncillaGet, X
JSL RequestStandingItemVRAMSlot
LDA.b #$00 : STA.l SpriteSkipEOR
PLY : PLX : PLA PLY : PLX : PLA
RTL RTL
PrizeReceiveItem:
PHA
JSL BossPrizeGetPlayer : STA.l !MULTIWORLD_ITEM_PLAYER_ID
PLA
CMP.b #$6A : BNE +
; TODO : This doesn't increment any item counts/stats
JML ActivateTriforceCutscene
+
JSL Link_ReceiveItem
LDA.l TextBoxDefer : BEQ +
STZ.w TextID : STZ.w TextID+1 ; reset decompression buffer
JSL Main_ShowTextMessage_Alt
LDA.b #$00 : STA.l TextBoxDefer
+
RTL
SetItemPose: SetItemPose:
PHA PHA
LDA.w DungeonID : BMI .one_handed LDA.w DungeonID : BMI .one_handed
@@ -236,7 +263,6 @@ PrepPrizeOAMCoordinates:
STA.b Scrap02 STA.b Scrap02
STA.b Scrap04 STA.b Scrap04
REP #$20
LDA.w AncillaZCoord,X LDA.w AncillaZCoord,X
AND.w #$00FF AND.w #$00FF
STA.b ScrapBuffer72 STA.b ScrapBuffer72
@@ -247,9 +273,35 @@ PrepPrizeOAMCoordinates:
SBC.b ScrapBuffer72 SBC.b ScrapBuffer72
STA.b Scrap00 STA.b Scrap00
SEP #$20 JSL PrepAncillaAnimation
TXY TXY
LDA.w AncillaGet,X : TAX LDA.w AncillaGet,Y : AND.w #$00FF : PHA
REP #$10
ASL : TAX
LDA.l VRAMAddressOffset,X : STA.b Scrap0C
CLC : ADC.w #$0010 : STA.b Scrap0D
PLX
SEP #$10
PHX
; special animation handling
CPX.b #$D2 : BNE + ; fairy
LDX.w AncillaDirection,Y : BEQ ++ : CPX.b #$03 : BEQ ++ ; use other fairy GFX
LDA.b Scrap0C : CLC : ADC.w #$0002 : STA.b Scrap0C
CLC : ADC.w #$0010 : STA.b Scrap0D
++ CPX.b #$02 : BCC .check_width ; move fairy up 2 pixels
LDA.b Scrap00 : SEC : SBC.w #$0002 : STA.b Scrap00
BRA .check_width
+ CPX.b #$D6 : BNE + ; good bee
LDA.b Scrap0C : AND.w #$FF00 : ORA.w #$007C : STA.b Scrap0C ; use blank GFX for high VRAM
LDX.w AncillaDirection,Y : BEQ ++ : CPX.b #$03 : BEQ ++ ; use other bee GFX
LDA.b Scrap0D : SEC : SBC.w #$0010 : STA.b Scrap0D
++ CPX.b #$02 : BCC + ; move bee up 2 pixels
LDA.b Scrap00 : SEC : SBC.w #$0002 : STA.b Scrap00
+
.check_width
PLX
SEP #$20
LDA.l SpriteProperties_chest_width,X : BNE .wide LDA.l SpriteProperties_chest_width,X : BNE .wide
TYX TYX
LDA.w AncillaID,X : CMP.b #$3E : BEQ .rising_crystal LDA.w AncillaID,X : CMP.b #$3E : BEQ .rising_crystal
@@ -271,20 +323,70 @@ PrepPrizeOAMCoordinates:
PLY : PLX PLY : PLX
RTL RTL
PrepPrizeVRAMHigh:
PHX
LDX.b #$00
JSL PrepPrizeVRAM : BCS .store
LDA.b #$24
.store
STA.b ($90),Y
PLX
RTL
PrepPrizeVRAMLow:
PHX
LDX.b #$01
JSL PrepPrizeVRAM : BCS .store
LDA.b #$34
.store
STA.b ($90),Y
PLX
RTL
PrepPrizeVRAM:
PHY
LDA.b 9,S : TAY
LDA.w AncillaID,Y : CMP.b #$29 : BEQ +
PLY : CLC : RTL ; not a prize drop ancilla
+ LDA.b Scrap0C,X : CMP.b #$24 : BEQ + : CMP.b #$34 : BEQ +
PLY : SEC : RTL ; in vanilla VRAM
+
; use dynamic VRAM slot
PHX
LDA.w SprItemGFXSlot,Y : ASL : TAX
REP #$20
LDA.l FreeUWGraphics,X : LSR #4
PLX
CPX.b #$01 : BNE +
CLC : ADC.w #$0010
+
SEP #$20
PLY : SEC
RTL
PrepPrizeShadow: PrepPrizeShadow:
PHX PHX
LDA.w ItemReceiptID : TAX LDA.b 5,S : TAX : LDA.w AncillaGet,X : TAX
LDA.l SpriteProperties_standing_width,X : BNE .wide LDA.l SpriteProperties_standing_width,X : BNE .wide
LDA.b Scrap02 LDA.b Scrap02
SEC : SBC.b #$04 SEC : SBC.b #$04
STA.b Scrap02 STA.b Scrap02
PLX : LDX.b #$02
BRA .wide+1
.wide .wide
LDA.b #$20 : STA.b Scrap04 ; What we wrote over
PLX PLX
LDA.b #$20 : STA.b Scrap04 ; What we wrote over
RTL RTL
CheckPoseItemCoordinates: CheckPoseItemCoordinates:
PHX PHX
LDA.w SprRedrawFlag,X : BEQ +
JSL BossPrizeGetPlayer : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA.b #$01 : STA.l SpriteSkipEOR
LDA.w AncillaGet,X
JSL RequestStandingItemVRAMSlot
LDA.b #$00 : STA.l SpriteSkipEOR
+
LDA.w ItemReceiptPose : BEQ .done LDA.w ItemReceiptPose : BEQ .done
BIT.b #$02 : BEQ .done BIT.b #$02 : BEQ .done
LDA.w AncillaGet,X : TAX LDA.w AncillaGet,X : TAX
@@ -306,6 +408,9 @@ CrystalOrPendantBehavior:
AND.w #$00FF : ASL : TAX AND.w #$00FF : ASL : TAX
LDA.l InventoryTable_properties,X : BIT.w #$0080 : BNE .crystal_behavior LDA.l InventoryTable_properties,X : BIT.w #$0080 : BNE .crystal_behavior
SEP #$30 SEP #$30
LDA.w ItemReceiptPose : BEQ +
LDA.b #$02 : STA.b LinkDirection
+
PLX : PLA PLX : PLA
RTS RTS
.crystal_behavior .crystal_behavior
@@ -329,3 +434,46 @@ SetDungeonCompleted:
SEP #$20 SEP #$20
+ +
RTS RTS
MaybeSkipHeartRefill:
LDA.w CurrentControlRequest : CMP.b #$13 : BNE .vanilla
LDA.l HeartPieceQuarter : BNE +
; increase health
LDA.l MaximumHealth : CMP.b #$A0 : BEQ .reset_skip
CLC : ADC.b #$08 : STA.l MaximumHealth
+
.reset_skip
LDA.b #$00 ; just to ensure the MaximumHealth doesn't flow outside
BRA .skip
.vanilla
LDA.l HeartPieceQuarter : BEQ .do ; what we wrote over
.skip
CLC
RTL
.do
SEC
RTL
ClearMultiworldText:
PHP : PHX
SEP #$30
LDA.l !MULTIWORLD_HUD_TIMER : BEQ +
LDA.b #$01 : STA.l !MULTIWORLD_HUD_TIMER
JSL GetMultiworldItem
+
PLX : PLP
RTL
MaybeSkipCrystalCutsceneFollowerReset:
PHA
LDA.l FollowerTravelAllowed : CMP.b #$02 : BEQ .skip
; skip if prizes are shuffled outside of normal boss drops
LDA.l InventoryTable_properties+($37*2) : AND.b #$01 : BEQ .continue
.skip
PLA : PLA : PLA : PLA
JML CrystalCutscene_SpawnMaiden_PostFollowerGfx
.continue
PLA
STA.l FollowerIndicator ; what we wrote over
RTL

213
elder.asm
View File

@@ -1,6 +1,6 @@
NewElderCode: NewElderCode:
{ {
LDA.b OverworldIndex : CMP.b #$1B : BEQ .newCodeContinue LDA.b OverworldIndex : AND.b #$3F : CMP.b #$1B : BEQ .newCodeContinue
;Restore Jump we can keep the RTL so JML ;Restore Jump we can keep the RTL so JML
JML Sprite_16_Elder JML Sprite_16_Elder
.newCodeContinue .newCodeContinue
@@ -39,32 +39,219 @@ RTL
Elder_Code: Elder_Code:
{ {
REP #$20 TXY : LDX.b #$06
LDA.l GoalItemRequirement : BEQ .despawn REP #$30
LDA.l GanonVulnerableMode : AND.w #$00FF : CMP.w #$0005 : BEQ .despawn LDA.l GoalConditionTable, X
LDA.l TurnInGoalItems : AND.w #$00FF : BNE + TAX : LDA.l $B00000, X
SEP #$30
TYX
CMP.b #$00 : BEQ .despawn ; no goal, despawn
LDA.l TurnInGoalItems : BNE +
.despawn .despawn
SEP #$20
STZ.w SpriteAITable, X ; despawn self STZ.w SpriteAITable, X ; despawn self
RTS RTS
+ +
SEP #$20
LDA.b GameSubMode LDA.b GameSubMode
BNE .done BNE .done
LDA.b #$96 LDA.b #$96
LDY.b #$01 LDY.b #$01
JSL Sprite_ShowSolicitedMessageIfPlayerFacing_PreserveMessage : BCC .dont_show JSL Sprite_ShowSolicitedMessageIfPlayerFacing_PreserveMessage : BCC .dont_show
REP #$20 LDA.b #$03 : JSL CheckConditionPass : BCC +
LDA.l GoalCounter JSL ActivateTriforceCutscene
CMP.l GoalItemRequirement : !BLT +
SEP #$20
JSL ActivateGoal
+ +
.dont_show .dont_show
.done .done
SEP #$20
LDA.b FrameCounter : LSR #5 : AND.b #$01 : STA.w SpriteGFXControl, X LDA.b FrameCounter : LSR #5 : AND.b #$01 : STA.w SpriteGFXControl, X
RTS RTS
} }
;--------------------------------------------------------------------------------
; Triforce (Pedestal) Cutscene
;--------------------------------------------------------------------------------
ActivateTriforceCutscene:
; despawn other sprites
LDY.b #$0F
- LDA.w SpriteTypeTable,Y : CMP.b #$16 : BNE +
CPY.b #$00 : BEQ .next
; move Murahdahla to slot 0 for draw priority reasons
LDA.w SpriteTypeTable,Y : STA.w SpriteTypeTable
LDA.w SpritePosYLow,Y : STA.w SpritePosYLow
LDA.w SpritePosXLow,Y : STA.w SpritePosXLow
LDA.w SpritePosYHigh,Y : STA.w SpritePosYHigh
LDA.w SpritePosXHigh,Y : STA.w SpritePosXHigh
LDA.w SpriteVelocityY,Y : STA.w SpriteVelocityY
LDA.w SpriteOAMProp,Y : STA.w SpriteOAMProp
LDA.w SpriteOAMProperties,Y : STA.w SpriteOAMProperties
LDA.w SpriteControl,Y : STA.w SpriteControl
LDA.w SpriteAITable,Y : STA.w SpriteAITable
LDA.b #$02 : STA.w SpriteLayer
+ LDA.b #$00 : STA.w SpriteAITable,Y
.next
DEY : BPL -
LDA.b #$62 ; MasterSword Sprite
JSL Sprite_SpawnDynamically
; set up coords
LDA.b LinkPosX : STA.w SpritePosXLow,Y
LDA.b LinkPosX+1 : STA.w SpritePosXHigh,Y
LDA.b LinkPosY : CLC : ADC.b #$08 : STA.w SpritePosYLow,Y
LDA.b LinkPosY+1 : ADC.b #$00 : STA.w SpritePosYHigh,Y
LDA.b #$01 : STA.w SpriteMovement,Y ; our indicator this is a special cutscene sprite
INC : STA.b LinkDirection ; makes Link face downward
; reset modules
LDA.b IndoorsFlag : BEQ +
LDA.b #$07
BRA ++
+ LDA.b #$09
++ STA.b GameMode
STZ.b GameSubMode : STZ.b SubSubModule
RTL
pushpc
org $858928
MasterSword_InPedestal_DoCutscene:
org $8589B1
MasterSword_ConditionalHandleReceipt_DoReceipt:
org $8588DF
JSL MasterSword_CheckIfPulled : PLX : NOP #2
db $90 ; BCC instead of BEQ
org $85890E
JSL MasterSword_ConditionalActivateCutscene
org $85895F
JSL MasterSword_ConditionalGrabPose : NOP
org $858994
JSL MasterSword_ConditionalGrabPose : NOP
org $858D1C
JML MasterSword_SpawnPendantProp_ChangePalette
MasterSword_SpawnPendantProp_ChangePalette_return:
org $8589A3
JSL MasterSword_ConditionalHandleReceipt : NOP #2
pullpc
MasterSword_CheckIfPulled:
CPX.b #$80 : BEQ +
- CLC : RTL ; not on pedestal screen, continue with cutscene
+ LDA.l OverworldEventDataWRAM,X : AND.b #$40 ; what we wrote over
BEQ - : SEC : RTL
MasterSword_ConditionalActivateCutscene:
LDA.w SpriteMovement,X : BNE .specialCutscene
PHX
REP #$30
LDA.w SprRedrawFlag, X : BNE .doNormalPed
INC.w SprRedrawFlag, X
LDA.l PedPullGfx : BEQ .doNormalPed
LDX.w ItemStackPtr : STA.l ItemGFXStack,X
LDA.w #$BCE0>>1 : STA.l ItemTargetStack,X
TXA : INC #2 : STA.w ItemStackPtr
.doNormalPed
SEP #$30
PLX
JML Sprite_CheckDamageToPlayerSameLayerLong ; what we wrote over
.specialCutscene
LDA.b #$02 : STA.w ItemReceiptPose ; Link's 2-hands-up pose
STA.b LinkLayer ; draw Link on top
; draw Triforce piece in VRAM
LDA.w SprRedrawFlag, X : BNE .skipTransfer
INC.w SprRedrawFlag, X
PHX
REP #$30
LDA.l MurahdahlaGfx : BNE .submitRequest
LDX.w #$006A<<1 : LDA.l StandingItemGraphicsOffsets,X
.submitRequest
LDX.w ItemStackPtr : STA.l ItemGFXStack,X
LDA.w #$9CE0>>1 : STA.l ItemTargetStack,X
TXA : INC #2 : STA.w ItemStackPtr
SEP #$30
PLX
.skipTransfer
PLA : PLA : PLA : JML MasterSword_InPedestal_DoCutscene ; do cutscene
MasterSword_ConditionalGrabPose:
PHA
LDA.w SpriteMovement,X : BNE .specialCutscene
PLA
STA.w $0377 : LDA.b #$01 ; what we wrote over
RTL
.specialCutscene
PLA
LDA.b #$01
RTL
MasterSword_SpawnPendantProp_ChangePalette:
STA.w SpriteVelocityY,Y : PLX ; what we wrote over
LDA.w SpriteMovement,X : BNE .specialCutscene
LDA.l PedPullGfx : BNE .customPedGfx
LDA.l PedPullGfx+1 : BNE .customPedGfx
BRA .done
.customPedGfx
LDA.l PedPullPalette : ASL : INC : BRA .setPalette
.specialCutscene
LDA.b #$02 : STA.w SpriteLayer,Y ; change layer
LDA.l MurahdahlaGfx : BNE .customGfx
LDA.l MurahdahlaGfx+1 : BNE .customGfx
LDA.b #$08 : BRA .setPalette
.customGfx
LDA.l MurahdahlaPalette : ASL
.setPalette
STA.w SpriteOAMProp,Y ; change palette
.done
JML MasterSword_SpawnPendantProp_ChangePalette_return
MasterSword_ConditionalHandleReceipt:
LDA.w SpriteMovement,X : BNE .specialCutscene
LDX.b OverworldIndex : LDA.l OverworldEventDataWRAM,X ; what we wrote over
RTL
.specialCutscene
PLA : PLA : PEA.w MasterSword_ConditionalHandleReceipt_DoReceipt-1
LDA.b 4,S : TAX
LDY.b #$6A
RTL
pushpc
org $858AB6
MasterSword_SpawnLightWell:
org $858AD0
MasterSword_SpawnLightFountain:
org $858B62
MasterSword_SpawnLightBeam:
org $858941
JSL MasterSword_ConditionalSpawnLightWell : NOP #2
MasterSword_SpawnLightWell_return:
org $858952
JSL MasterSword_ConditionalSpawnLightFountain : NOP #2
MasterSword_SpawnLightFountain_return:
org $858B64
JSL MasterSword_ConditionalSpawnLightBeam : NOP #2
pullpc
MasterSword_ConditionalSpawnLightWell:
INC.w SpriteActivity,X ; part of what we wrote over
LDA.w SpriteMovement,X : BNE .specialCutscene
PLA : PLA : PLA : PEA.w MasterSword_SpawnLightWell_return-1
JML MasterSword_SpawnLightWell ; part of what we wrote over
.specialCutscene
RTL
MasterSword_ConditionalSpawnLightFountain:
INC.w SpriteActivity,X ; part of what we wrote over
LDA.w SpriteMovement,X : BNE .specialCutscene
PLA : PLA : PLA : PEA.w MasterSword_SpawnLightFountain_return-1
JML MasterSword_SpawnLightFountain ; part of what we wrote over
.specialCutscene
RTL
MasterSword_ConditionalSpawnLightBeam:
LDA.w SpriteMovement,X : BNE .specialCutscene
LDA.b #$62 : JSL Sprite_SpawnDynamically ; what we wrote over
RTL
.specialCutscene
LDY.b #$FF
RTL

View File

@@ -12,8 +12,6 @@
!DMA0_SIZE_LOW_REG = $4305 ; DMA Size Registers (Low) !DMA0_SIZE_LOW_REG = $4305 ; DMA Size Registers (Low)
!DMA0_SIZE_HIGH_REG = $4306 ; DMA Size Registers (Low) !DMA0_SIZE_HIGH_REG = $4306 ; DMA Size Registers (Low)
!DMA_ENABLE_REG = $420B ; DMA Enable Register
macro DMA_VRAM(VRAM_HIGH,VRAM_LOW,SRC_BANK,SRC_HIGH,SRC_LOW,LENGTH_HIGH,LENGTH_LOW) macro DMA_VRAM(VRAM_HIGH,VRAM_LOW,SRC_BANK,SRC_HIGH,SRC_LOW,LENGTH_HIGH,LENGTH_LOW)
PHA PHA
; --- preserve DMA registers ---------------------------------------------------- ; --- preserve DMA registers ----------------------------------------------------
@@ -57,7 +55,7 @@ macro DMA_VRAM(VRAM_HIGH,VRAM_LOW,SRC_BANK,SRC_HIGH,SRC_LOW,LENGTH_HIGH,LENGTH_L
; start DMA on channel 0 ; start DMA on channel 0
LDA.b #$01 ; channel select bitmask LDA.b #$01 ; channel select bitmask
STA.w !DMA_ENABLE_REG STA.w DMAENABLE
; --- restore DMA registers ----------------------------------------------------- ; --- restore DMA registers -----------------------------------------------------
PLA : STA.w !DMA0_SIZE_HIGH_REG PLA : STA.w !DMA0_SIZE_HIGH_REG

View File

@@ -23,12 +23,13 @@ boss_move:
+ +
CMP.b #41 : BNE + ; Is it Skull Woods Boss Room CMP.b #41 : BNE + ; Is it Skull Woods Boss Room
; TODO: Add moving floor sprite
JSL Sprite_ResetAll ; reset sprites twice in that room for some reasons (fix bug with kholdstare) JSL Sprite_ResetAll ; reset sprites twice in that room for some reasons (fix bug with kholdstare)
JSL Dungeon_ResetSprites ; Restore the dungeon_resetsprites JSL Dungeon_ResetSprites ; Restore the dungeon_resetsprites
LDA.b #$07 : STA.w $0B00 ;Spawn the moving floor sprite LDA.w $0E20 : CMP.b #$92 : BNE ++ ; Is it Helmasuar King?
STZ.w $0B28 LDA.b #$07 : STA.w $0B00 ;Spawn the bugged moving floor sprite
INC.w OverlordXLow STZ.w $0B28
INC.w OverlordXLow
++
BRL .move_to_bottom_right BRL .move_to_bottom_right
+ +
@@ -287,3 +288,16 @@ new_trinexx_code:
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
;================================================================================
; Check if water tile in Swamp boss room, skip interaction
;--------------------------------------------------------------------------------
swamp_boss_tile_interaction:
LDA.l Sprite_ReducedTileInteractionTable, X : BEQ .return
CPX.b #$09 : BNE .return ; return if non-water tile
LDX.b IndoorsFlag : BEQ .return ; return if overworld
LDX.b RoomIndex : CPX.b #$06 : BNE .return ; return if not swamp boss room
LDA.b #$00
.return
RTL
;--------------------------------------------------------------------------------

View File

@@ -14,4 +14,13 @@ incsrc hooks/damage_hooks.asm
incsrc hooks/overworld_sprite_hooks.asm incsrc hooks/overworld_sprite_hooks.asm
incsrc hooks/underworld_sprite_hooks.asm incsrc hooks/underworld_sprite_hooks.asm
org $85B8BA
JSL GeldmanDrawOverride
org $9EAAAC
JSL StalfosKnightDrawOverride
org $9EB209
JSL BlobDrawOverride

View File

@@ -11,14 +11,16 @@ Sprite_ResetAll: ; Bank09.asm(1344)
;================================================================================ ;================================================================================
; On Room Transition -> Move Sprite depending on the room loaded ; On Room Transition -> Move Sprite depending on the room loaded
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $828979 ; JSL Dungeon_ResetSprites ; REPLACE THAT (Sprite initialization) original jsl : $09C114 if not(!FEATURE_FIX_BASEROM)
JSL boss_move org $828979 ; JSL Dungeon_ResetSprites ; REPLACE THAT (Sprite initialization) original jsl : $09C114
org $828C16 ; JSL Dungeon_ResetSprites ; REPLACE THAT (Sprite initialization) original jsl : $09C114 JSL boss_move
JSL boss_move org $828C16 ; JSL Dungeon_ResetSprites ; REPLACE THAT (Sprite initialization) original jsl : $09C114
org $829338 ; JSL Dungeon_ResetSprites ; REPLACE THAT (Sprite initialization) original jsl : $09C114 JSL boss_move
JSL boss_move org $829338 ; JSL Dungeon_ResetSprites ; REPLACE THAT (Sprite initialization) original jsl : $09C114
org $828256 ; JSL Dungeon_ResetSprites ; REPLACE THAT (Sprite initialization) original jsl : $09C114 JSL boss_move
JSL boss_move org $828256 ; JSL Dungeon_ResetSprites ; REPLACE THAT (Sprite initialization) original jsl : $09C114
JSL boss_move
endif
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -39,3 +41,10 @@ JSL new_kholdstare_code ; Write new gfx in the vram
org $1DAD67 ; sprite_trinexx.asm (62) : LDA.b #$03 : STA $0DC0, X org $1DAD67 ; sprite_trinexx.asm (62) : LDA.b #$03 : STA $0DC0, X
JSL new_trinexx_code : NOP JSL new_trinexx_code : NOP
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
;================================================================================
; Swamp Boss Room Water Fix
;--------------------------------------------------------------------------------
org $06E81A
JSL swamp_boss_tile_interaction
;--------------------------------------------------------------------------------

View File

@@ -2,7 +2,11 @@
; New bush mob randomization ; New bush mob randomization
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $868279 org $868279
NOP #$0A BRA +
MaybeSkipTerrainDebris:
JSL MaybeSkipTerrainDebris_long : RTS ; sticking this here, no other free space in bank 06
NOP #3
+
JSL sprite_bush_spawn JSL sprite_bush_spawn
NOP ; we keep the branch NOP ; we keep the branch
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------

View File

@@ -1,3 +1,6 @@
org $89C4E3
JSL Overworld_LoadSprites_Decision
org $89C50B ; 0x4C50B org $89C50B ; 0x4C50B
{ {
; .loadData ; .loadData

View File

@@ -61,7 +61,3 @@ LDA.b [Scrap00],Y
org $89C416 org $89C416
LDA.b [Scrap00],Y LDA.b [Scrap00],Y

View File

@@ -2,8 +2,7 @@ pushpc
org $9EC147 org $9EC147
JSL NewKodongoCollision JSL NewKodongoCollision
JMP .continue : NOP #2 BRA + : NOP #3 : +
.continue
org $9EC152 org $9EC152
Kodongo_SetDirection: Kodongo_SetDirection:
@@ -12,8 +11,18 @@ pullpc
NewKodongoCollision: NewKodongoCollision:
LDA.w SpriteMoveDirection, X : INC A : AND.b #$03 : STA.w SpriteMoveDirection, X LDA.w SpriteMoveDirection, X : INC A : AND.b #$03 : STA.w SpriteMoveDirection, X
JSL Kodongo_InVanillaRoom : BEQ .continue
;If they collide more than 4 times just set direction ;If they collide more than 4 times just set direction
LDA.w SpriteAuxTable, X : INC A : STA.w SpriteAuxTable, X : CMP.b #$04 : BCC .continue LDA.w SpriteAuxTable, X : INC A : STA.w SpriteAuxTable, X : CMP.b #$04 : BCC .continue
PLA : PLA : PEA.w Kodongo_SetDirection-1 PLA : PLA : PEA.w Kodongo_SetDirection-1
.continue .continue
RTL RTL
Kodongo_InVanillaRoom:
LDA.b RoomIndex+1 : BNE .return
LDA.b RoomIndex : CMP.b #$19 : BEQ .return
CMP.b #$27 : BEQ .return
CMP.b #$77 : BEQ .return
.return
RTL
nop #10

View File

@@ -52,8 +52,5 @@ incsrc falling_death.asm
incsrc shell_gfx.asm incsrc shell_gfx.asm
warnpc $B6FFFF ;if we hit this we need to split stuff by bank warnpc $B6FFFF ;if we hit this we need to split stuff by bank
org $8684BD
Sprite_Get16BitCoords_long:
org $9EC6FA ;F46FA org $9EC6FA ;F46FA
SpritePrep_Eyegore: SpritePrep_Eyegore:

View File

@@ -5,4 +5,12 @@ LoadOverworldSprites:
; set bank ; set bank
LDA.b #$09 : STA.b Scrap02 ; default is bank 9 LDA.b #$09 : STA.b Scrap02 ; default is bank 9
RTL
; return A = $03 for post-aga enemies, $02 for pre-aga enemies, else rain state enemies
Overworld_LoadSprites_Decision:
PHY : SEP #$10
JSL ClearSpriteData_shared
REP #$10 : PLY
LDA.l ProgressIndicator ; what we wrote over
RTL RTL

View File

@@ -1,11 +1,48 @@
LoadUnderworldSprites: LoadUnderworldSprites:
STA.b Scrap00 ; part one of what we replaced STA.b Scrap00 ; part one of what we replaced
LDA.w #UWSpritesData>>16 : STA.b Scrap02 ; set the bank to 28 for now LDA.w #UWSpritesData>>16 ; set the bank to 28 for now
LDA.w $048E STA.b Scrap02
LDA.w $048E
RTL RTL
GetSpriteSlot16Bit: GetSpriteSlot16Bit:
LDA.b Scrap03 : AND.w #$00FF LDA.b Scrap03 : AND.w #$00FF
ASL A ASL A
TAY TAY
RTL RTL
GeldmanDrawOverride:
PLA : PLA : PLA ; fix the call stack
LDA.l DRFlags+1 : AND.b #$08 : BEQ .vanilla
LDA.b #$01
STA.w $0DC0,X
JML Sprite_4C_Geldman_do_indeed_draw
.vanilla
JSL Sprite_PrepOAMCoordLong
JML Sprite_4C_Geldman_continue
StalfosKnightDrawOverride:
LDA.l DRFlags+1 : AND.b #$08 : BEQ .vanilla
JSL Sprite_PrepOAMCoordLong
LDA.b #$12
JML Sprite_DrawShadowLong
.vanilla
JSL Sprite_PrepOAMCoordLong
RTL
BlobDrawOverride:
PLA : PLA : PLA ; fix the call stack
LDA.l DRFlags+1 : AND.b #$08 : BEQ .vanilla
LDA.b #$05
STA.w $0DC0,X
JML SpriteDraw_Blob_head_popping_out
.vanilla
JSL Sprite_PrepOAMCoordLong
JML SpriteDraw_Blob_bad_gfx

View File

@@ -20,7 +20,7 @@ LockAgahnimDoors:
!BGE .crystalOrUnlock !BGE .crystalOrUnlock
LDA.w #$0001 : RTL LDA.w #$0001 : RTL
.crystalOrUnlock .crystalOrUnlock
LDA.l InvertedMode : AND.w #$00FF : BEQ .unlock LDA.l SwapAgaGanonsTower : AND.w #$00FF : BEQ .unlock
LDA.l OverworldEventDataWRAM+$43 : AND.w #$0020 : BNE .unlock ; Check if GT overlay is already on or not LDA.l OverworldEventDataWRAM+$43 : AND.w #$0020 : BNE .unlock ; Check if GT overlay is already on or not
LDA.w AButtonAct : AND.w #$0080 : BEQ ++ ;If we are holding an item LDA.w AButtonAct : AND.w #$0080 : BEQ ++ ;If we are holding an item
@@ -42,7 +42,7 @@ LockAgahnimDoors:
RTL RTL
;--------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------
FlagAgahnimDoor: FlagAgahnimDoor:
LDA.l InvertedMode : BEQ .vanilla LDA.l SwapAgaGanonsTower : BEQ .vanilla
LDA.l OverworldEventDataWRAM+$43 : ORA.b #$20 : STA.l OverworldEventDataWRAM+$43 ; activate GT overlay LDA.l OverworldEventDataWRAM+$43 : ORA.b #$20 : STA.l OverworldEventDataWRAM+$43 ; activate GT overlay
@@ -63,8 +63,8 @@ RTS
RTS RTS
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
SmithDoorCheck: SmithDoorCheck:
LDA.l SmithTravelsFreely : AND.w #$00FF : BEQ .orig LDA.l FollowerTravelAllowed : AND.w #$00FF : BEQ .orig
;If SmithTravelsFreely is set Frog/Smith can enter multi-entrance overworld doors ;If FollowerTravelAllowed is set Frog/Smith can enter multi-entrance overworld doors
JML Overworld_Entrance_BRANCH_RHO JML Overworld_Entrance_BRANCH_RHO
.orig ; The rest is equivlent to what we overwrote .orig ; The rest is equivlent to what we overwrote
@@ -192,9 +192,9 @@ JML Overworld_Hole_End
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
PreventEnterOnBonk: PreventEnterOnBonk:
STA.b Scrap00 ; part of what we wrote over STA.b Scrap00 ; part of what we wrote over
LDA.l InvertedMode : AND.w #$00FF : BEQ .done LDX.b OverworldIndex : LDA.l OWTileMapAlt, X : AND.w #$0001 : BEQ .done
LDA.b LinkState : AND.w #$00FF : CMP.w #$0014 : BNE .done ;in mirror mode? LDA.b LinkState : AND.w #$00FF : CMP.w #$0014 : BNE .done ;in mirror mode?
LDA.b OverworldIndex : AND.w #$0040 : CMP.b WorldCache : BEQ .done ; Are we bonking, or doing the superbunny glitch? LDA.l OWTileWorldAssoc, X : AND.w #$00FF : CMP.b WorldCache : BEQ .done ; Are we bonking, or doing the superbunny glitch?
; If in inverted, are in mirror mode, and are bonking then do not enter ; If in inverted, are in mirror mode, and are bonking then do not enter
JML PreventEnterOnBonk_BRANCH_IX JML PreventEnterOnBonk_BRANCH_IX
@@ -212,15 +212,15 @@ TurtleRockEntranceFix:
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
AnimatedEntranceFix: ;when an entrance animation tries to start AnimatedEntranceFix: ;when an entrance animation tries to start
PHA PHA : PHX
LDA.l InvertedMode : BEQ + ;If we are in inverted mode LDA.b OverworldIndex : TAX : AND.b #$40 : BNE + ; on a light world screen
LDA.b OverworldIndex : AND.b #$40 : BNE + ;and in the light world LDA.l OWTileMapAlt, X : BNE + ; tile is flipped
PLA PLX : PLA
STZ.w OWEntranceCutscene ; skip it. STZ.w OWEntranceCutscene ; skip it.
LDA.b #$00 LDA.b #$00
RTL RTL
+ +
PLA PLX : PLA
STA.w CutsceneFlag ;what we wrote over STA.w CutsceneFlag ;what we wrote over
STA.w FreezeSprites ;what we wrote over STA.w FreezeSprites ;what we wrote over
STA.w SkipOAM ;what we wrote over STA.w SkipOAM ;what we wrote over

View File

@@ -24,15 +24,21 @@ OnDungeonEntrance:
STA.l PegColor ; thing we wrote over STA.l PegColor ; thing we wrote over
JSL MaybeFlagDungeonTotalsEntrance JSL MaybeFlagDungeonTotalsEntrance
LDA.w #$0001 : STA.l UpdateHUDFlag LDA.w #$0001 : STA.l UpdateHUDFlag
SEP #$30
JSL DynamicDropGFXClear
REP #$30
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
OnDungeonBossExit: OnDungeonBossExit:
JSL StatTransitionCounter JSL StatTransitionCounter
JSL ClearMultiworldText
JSL DynamicDropGFXClear
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
OnPlayerDead: OnPlayerDead:
PHA PHA
JSL SetDeathWorldChecked JSL SetDeathWorldChecked
JSL DynamicDropGFXClear
JSL SetSilverBowMode JSL SetSilverBowMode
JSL RefreshRainAmmo JSL RefreshRainAmmo
PLA PLA
@@ -42,6 +48,7 @@ OnDungeonExit:
PHA : PHP PHA : PHP
SEP #$20 ; set 8-bit accumulator SEP #$20 ; set 8-bit accumulator
JSL SQEGFix JSL SQEGFix
JSL DynamicDropGFXClear
PLP : PLA PLP : PLA
STA.w DungeonID : STZ.w Map16ChangeIndex ; thing we wrote over STA.w DungeonID : STZ.w Map16ChangeIndex ; thing we wrote over
@@ -54,12 +61,22 @@ OnDungeonExit:
PLP : PLA PLP : PLA
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
OnSave:
LDA.b #$70 : PHA : PLB ; thing we wrote over - data bank change
JSL DarkWorldSaveFix
JML MSUResumeReset
;--------------------------------------------------------------------------------
OnQuit: OnQuit:
JSL SQEGFix JSL SQEGFix
LDA.b #$00 : STA.l AltTextFlag ; bandaid patch bug with mirroring away from text LDA.b #$00 : STA.l AltTextFlag ; bandaid patch bug with mirroring away from text
LDA.b #$10 : STA.b MAINDESQ ; thing we wrote over LDA.b #$10 : STA.b MAINDESQ ; thing we wrote over
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
OnDeathNoSave:
JSL MSUResumeReset
LDA.b #$05 : STA.b $10 ; what we wrote over
RTL
;--------------------------------------------------------------------------------
OnUncleItemGet: OnUncleItemGet:
PHA PHA
@@ -90,8 +107,8 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
OnAga1Defeated: OnAga1Defeated:
STA.l ProgressIndicator ; vanilla game state stuff we overwrote STA.l ProgressIndicator ; vanilla game state stuff we overwrote
LDA.l GanonVulnerableMode ; seems light_speed option to auto triforce room is unused for now
CMP.b #$06 : BNE + BRA +
.light_speed .light_speed
REP #$20 REP #$20
LDA.w #$0019 : STA.b GameMode LDA.w #$0019 : STA.b GameMode
@@ -127,7 +144,7 @@ OnFileCreation:
; Resolve instant post-aga if standard ; Resolve instant post-aga if standard
SEP #$20 SEP #$20
LDA.l InitProgressIndicator : BIT #$80 : BEQ + LDA.l InitProgressIndicator : BIT.b #$80 : BEQ +
LDA.b #$00 : STA.l ProgressIndicatorSRAM ; set post-aga after zelda rescue LDA.b #$00 : STA.l ProgressIndicatorSRAM ; set post-aga after zelda rescue
LDA.b #$00 : STA.l OverworldEventDataSRAM+$02 ; keep rain state vanilla LDA.b #$00 : STA.l OverworldEventDataSRAM+$02 ; keep rain state vanilla
+ +
@@ -171,6 +188,7 @@ OnFileLoad:
JSL LoadStaticDecryptionKey JSL LoadStaticDecryptionKey
+ +
SEP #$10 ; restore 8 bit index registers SEP #$10 ; restore 8 bit index registers
JSL DynamicDropGFXClear
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
OnNewFile: OnNewFile:
@@ -199,18 +217,37 @@ OnInitFileSelect:
JSL EnableForceBlank JSL EnableForceBlank
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
OnGloomDamage:
LDA.b #$01
STA.l UpdateHUDFlag
LDA.l MaximumHealth
SEC : SBC.b #$08
STA.l CurrentHealth
BEQ +
STA.l MaximumHealth
+ RTL
;--------------------------------------------------------------------------------
OnLinkDamaged: OnLinkDamaged:
JSL IncrementDamageTakenCounter_Arb JSL IncrementDamageTakenCounter_Arb
LDA.l ChallengeModes : AND.b #$03 : CMP.b #$02 : BEQ .gloom
JML OHKOTimer JML OHKOTimer
.gloom
STZ.b $00
JML OnGloomDamage
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
;OnEnterWater: ;OnEnterWater:
; JSL UnequipCapeQuiet ; what we wrote over ; JSL UnequipCapeQuiet ; what we wrote over
;RTL ;RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
OnLinkDamagedFromPit: OnLinkDamagedFromPit:
LDA.l ChallengeModes : AND.b #$03 : CMP.b #$02 : BEQ .gloom
JSL OHKOTimer JSL OHKOTimer
BRA +
.gloom
JSL OnGloomDamage
CLC : ADC.b #$08 : STA.l CurrentHealth
LDA.l AllowAccidentalMajorGlitch + LDA.l AllowAccidentalMajorGlitch
BEQ ++ BEQ ++
-- LDA.b #$14 : STA.b GameSubMode ; thing we wrote over -- LDA.b #$14 : STA.b GameSubMode ; thing we wrote over
@@ -222,7 +259,12 @@ OnLinkDamagedFromPit:
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
OnLinkDamagedFromPitOutdoors: OnLinkDamagedFromPitOutdoors:
LDA.l ChallengeModes : AND.b #$03 : CMP.b #$02 : BEQ .gloom
JML OHKOTimer ; make sure this is last JML OHKOTimer ; make sure this is last
.gloom
JSL OnGloomDamage
CLC : ADC.b #$08
RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
OnOWTransition: OnOWTransition:
JSL FloodGateReset JSL FloodGateReset
@@ -235,6 +277,7 @@ OnOWTransition:
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
OnLoadDuckMap: OnLoadDuckMap:
JSL SelectFirstFluteSpot
LDA.l DuckMapFlag LDA.l DuckMapFlag
BNE + BNE +
INC : STA.l DuckMapFlag INC : STA.l DuckMapFlag
@@ -273,11 +316,6 @@ PostItemAnimation:
LDA.b IndoorsFlag : BEQ + LDA.b IndoorsFlag : BEQ +
REP #$20 : LDA.b RoomIndex : STA.l !MULTIWORLD_ROOMID : SEP #$20 REP #$20 : LDA.b RoomIndex : STA.l !MULTIWORLD_ROOMID : SEP #$20
LDA.w RoomItemsTaken : STA.l !MULTIWORLD_ROOMDATA LDA.w RoomItemsTaken : STA.l !MULTIWORLD_ROOMDATA
LDA $1B : BEQ +
REP #$20 : LDA $A0 : STA !MULTIWORLD_ROOMID : SEP #$20
LDA $0403 : STA !MULTIWORLD_ROOMDATA
+ +
LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BEQ + LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BEQ +
@@ -285,32 +323,7 @@ PostItemAnimation:
LDA.b #$00 : STA.l !MULTIWORLD_ITEM_PLAYER_ID LDA.b #$00 : STA.l !MULTIWORLD_ITEM_PLAYER_ID
PLB PLB
JML Ancilla_ReceiveItem_objectFinished JML Ancilla_ReceiveItem_objectFinished
+ +
REP #$20
PEA.w $7E00
PLB : PLB
LDA.w TransparencyFlag : BNE .SP05
LDA.l PalettesCustom_off_black+$00 : STA.w PaletteBuffer+$0170 : STA.w PaletteBufferAux+$0170
LDA.l PalettesCustom_off_black+$02 : STA.w PaletteBuffer+$0172 : STA.w PaletteBufferAux+$0172
STA.w PaletteBuffer+$0174 : STA.w PaletteBufferAux+$0174
STA.w PaletteBuffer+$0176 : STA.w PaletteBufferAux+$0176
STA.w PaletteBuffer+$0178 : STA.w PaletteBufferAux+$0178
STA.w PaletteBuffer+$017A : STA.w PaletteBufferAux+$017A
STA.w PaletteBuffer+$017C : STA.w PaletteBufferAux+$017C
STA.w PaletteBuffer+$017E : STA.w PaletteBufferAux+$017E
BRA .done
.SP05
LDA.l PalettesCustom_off_black+$00 : STA.w PaletteBuffer+$01B0 : STA.w PaletteBufferAux+$01B0
LDA.l PalettesCustom_off_black+$02 : STA.w PaletteBuffer+$01B2 : STA.w PaletteBufferAux+$01B2
STA.w PaletteBuffer+$01B4 : STA.w PaletteBufferAux+$01B4
STA.w PaletteBuffer+$01B6 : STA.w PaletteBufferAux+$01B6
STA.w PaletteBuffer+$01B8 : STA.w PaletteBufferAux+$01B8
STA.w PaletteBuffer+$01BA : STA.w PaletteBufferAux+$01BA
STA.w PaletteBuffer+$01BC : STA.w PaletteBufferAux+$01BC
STA.w PaletteBuffer+$01BE : STA.w PaletteBufferAux+$01BE
.done
INC.b NMICGRAM
SEP #$20
STZ.w ItemReceiptMethod : LDA.w AncillaGet, X ; thing we wrote over to get here STZ.w ItemReceiptMethod : LDA.w AncillaGet, X ; thing we wrote over to get here
PLB PLB

View File

@@ -248,8 +248,12 @@ DrawPlayerFileShared:
; Flute ; Flute
LDA.l InventoryTrackingSRAM : AND.w #$0003 : BEQ + LDA.l InventoryTrackingSRAM : AND.w #$0003 : BEQ +
LDA.l $7003C2 : AND.w #$00FF : CMP.w #$00FF : BNE .pseudo
%fs_drawItem(7,16,FileSelectItems_flute) %fs_drawItem(7,16,FileSelectItems_flute)
BRA ++ BRA ++
.pseudo
%fs_drawItem(7,16,FileSelectItems_flute_green)
BRA ++
+ +
%fs_drawItemGray(7,16,FileSelectItems_flute) %fs_drawItemGray(7,16,FileSelectItems_flute)
++ ++
@@ -539,6 +543,8 @@ FileSelectItems:
dw #$0264|!FS_COLOR_BROWN, #$0265|!FS_COLOR_BROWN, #$0274|!FS_COLOR_BROWN, #$0275|!FS_COLOR_BROWN dw #$0264|!FS_COLOR_BROWN, #$0265|!FS_COLOR_BROWN, #$0274|!FS_COLOR_BROWN, #$0275|!FS_COLOR_BROWN
.flute .flute
dw #$0266|!FS_COLOR_BLUE, #$0267|!FS_COLOR_BLUE, #$0276|!FS_COLOR_BLUE, #$0277|!FS_COLOR_BLUE dw #$0266|!FS_COLOR_BLUE, #$0267|!FS_COLOR_BLUE, #$0276|!FS_COLOR_BLUE, #$0277|!FS_COLOR_BLUE
.flute_green
dw #$0266|!FS_COLOR_GREEN, #$0267|!FS_COLOR_GREEN, #$0276|!FS_COLOR_GREEN, #$0277|!FS_COLOR_GREEN
.book .book
dw #$026A|!FS_COLOR_GREEN, #$026B|!FS_COLOR_GREEN, #$027A|!FS_COLOR_GREEN, #$027B|!FS_COLOR_GREEN dw #$026A|!FS_COLOR_GREEN, #$026B|!FS_COLOR_GREEN, #$027A|!FS_COLOR_GREEN, #$027B|!FS_COLOR_GREEN
.redcane .redcane

View File

@@ -3,12 +3,12 @@
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; Written over and used by OnEnterWater hook. ; Written over and used by OnEnterWater hook.
UnequipCapeQuiet: ; UnequipCapeQuiet:
LDA.b #$20 : STA.w PoofTimer ; LDA.b #$20 : STA.w PoofTimer
STZ.w NoDamage ; STZ.w NoDamage
STZ.b CapeOn ; STZ.b CapeOn
STZ.w LinkZap ; STZ.w LinkZap
RTL ; RTL
protectff: protectff:
LDA.l AllowAccidentalMajorGlitch LDA.l AllowAccidentalMajorGlitch
@@ -71,3 +71,26 @@ protectff:
.spow .spow
db $80, $81, $81, $FF, $FF, $FF, $FF, $FF db $80, $81, $81, $FF, $FF, $FF, $FF, $FF
db $FF, $81, $81, $FF, $FF, $FF, $FF, $FF db $FF, $81, $81, $FF, $FF, $FF, $FF, $FF
FlipperScrollWarp:
STZ.b Scrap00 : STZ.b Scrap02 ; what we wrote over
LDA.l AllowAccidentalMajorGlitch : BEQ .checkX : RTL
.checkX
LDA.b LinkPosX : CMP.w $0604 : BCC +
CMP.w CameraTargetE : BCS +
BRA .checkY
+ LDA.l $7EC186
STA.b LinkPosX
.checkY
LDA.b LinkPosY : CMP.w $0600 : BCC +
CMP.w CameraTargetS : BCS +
RTL
+ LDA.l $7EC184
STA.b LinkPosY
RTL
pushpc
; fixes incorrect vanilla camera scroll boundary values for Zora's Domain
org $82E4E9 : dw $0600
org $82E529 : dw $0600
pullpc

View File

@@ -9,9 +9,10 @@ SpawnHauntedGroveItem:
LDA.l HauntedGroveItem_Player : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID LDA.l HauntedGroveItem_Player : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA.b #$EB LDA.b #$EB
STA.l MiniGameTime
JSL Sprite_SpawnDynamically JSL Sprite_SpawnDynamically
LDA.b #$01 : STA.w SprRedrawFlag, Y
LDX.b #$00 LDX.b #$00
LDA.b LinkDirection : CMP.b #$04 : BEQ + : INX : + LDA.b LinkDirection : CMP.b #$04 : BEQ + : INX : +
@@ -60,7 +61,9 @@ FluteBoy:
JML FluteBoy_Continue JML FluteBoy_Continue
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
FreeDuckCheck: FreeDuckCheck:
LDA.l InvertedMode : BEQ .done LDA.l OWMode+1 : AND.b #!FLAG_OW_MIXED : BNE .skipInvertedCheck
LDA.l InvertedMode : BEQ .done
.skipInvertedCheck
LDA.l FluteEquipment : CMP.b #$03 : BEQ .done ; flute is already active LDA.l FluteEquipment : CMP.b #$03 : BEQ .done ; flute is already active
; check the area, is it #$18 = 30? ; check the area, is it #$18 = 30?

942
follower.asm Normal file
View File

@@ -0,0 +1,942 @@
pushpc
; follower hooks
org $81EBB6
JSL MaybeSetZeldaCheckpoint
org $899FA1
db $FF, $FF, $FF ; disable timed follower messages
org $89A647
JSL MaybeSkipFollowerTrigger : NOP
org $89F544
JSL MaybeDeleteFollowersOnDeath
org $85EBCF
JSL SpritePrep_ZeldaFollower : NOP #2
org $85EC9E
JSL SpriteDraw_ZeldaMaiden
org $85ECD9
JSL Zelda_WaitingInCell
org $85ED46
JSL Zelda_BecomeFollower : NOP #2
org $9EE902
JSL SpritePrep_OldManFollower : NOP #2 : db $F0 ; BEQ
org $9DFF18
JSL SpriteDraw_OldManFollower
org $9EE9BC
JSL Follower_CheckMessageCollision
org $9EE9CC
JSL OldMan_BecomeFollower : NOP #2
org $86899C
JSL SpritePrep_BlindMaiden : NOP #2
org $8689A7
JSL BlindZeldaDespawnFix : NOP #2
org $9EE8B0
JSL SpriteDraw_ZeldaMaiden
org $9EE8CD
JSL Follower_CheckCollision
org $9EE8D7
JSL BlindMaiden_BecomeFollower : NOP
org $868A7E
JSL SpritePrep_SmithyFrog : BRA + : NOP #8 : +
org $86B2AA
JSL Follower_CheckMessageCollision
org $86B2B4
JSL Frog_BecomeFollower : NOP #2
org $86B341
JSL SpriteDraw_FrogFollower
org $868A53
JSL SpritePrep_PurpleChest : NOP #2
org $9EE0D7
JSL SpriteDraw_PurpleChest
org $9EE0E7
JSL Follower_CheckMessageCollision
org $9EE0ED
JSL PurpleChest_FollowCheck
org $9EE0F7
JSL PurpleChest_BecomeFollower : NOP
org $868A0A
JSL SpritePrep_SuperBomb
org $868A4A
SuperBomb_BecomeFollower_exit:
org $9EE16E
BRA + : NOP #6 : + ; fix bomb shop dialog for dwarfless big bomb
org $9EE1E8
JSL SuperBomb_FollowCheck
org $9EE1F1
JSL SuperBomb_BecomeFollower : NOP #2
org $9EE2C0
JSL SpriteDraw_SuperBomb
org $868D51
JSL SpritePrep_Kiki : NOP #2
org $9EE3E6
JSL Kiki_OfferToFollow
org $9EE495
JSL Kiki_FollowCheck : BRA + : NOP #12 : +
org $9EE4AF
JSL Kiki_BecomeFollower : NOP #2
org $9EE4F7
JSL Kiki_FixTeleportOnExit
org $89A1B2
JSL Kiki_DontScareTheMonke : NOP #3
org $868D63
JSL SpritePrep_Locksmith : NOP #2 : db $90 ; BCC
org $868D7E
db $80 ; BRA
org $86BCD9
JML Locksmith_Chillin_PostMessage
org $86BD09
JSL Locksmith_BecomeFollower : NOP #2
org $86BD7A ; allow follower pickup after purple chest item
LDA.b #$00 : STA.w SpriteActivity, X
JSL Locksmith_RespondToAnswer_PostItem
org $86BDB4
JSL SpriteDraw_LocksmithFollower
pullpc
MaybeSkipFollowerTrigger:
LDA.b GameMode : AND.w #$00FF : CMP.w #$0010 : BNE .normal
.no_trigger
INC : RTL
.normal
LDA.w $02F2 : AND.b Scrap06 ; what we wrote over
RTL
MaybeDeleteFollowersOnDeath:
LDA.l FollowerTravelAllowed : CMP.b #$02 : BNE .vanilla
; s+q = favor keeping current follower
; death = favor replacing with unfulfilled starting followers
; during escape = always favor keeping zelda
LDA.b GameMode : CMP.b #$17 : BEQ .keep
LDA.w DungeonID : NOP #2 : BPL .keep
LDA.l InitFollowerIndicator : BEQ .keep
JSL DetermineFollowerSpawn_check_resolved : BCS .keep
LDA.l ProgressIndicator : CMP.b #$02 : BCS .delete
LDA.l FollowerIndicator : CMP.b #$01 : BEQ .keep
.delete
PLA : PLA : PEA.w $89F558-1
RTL
.keep
PLA : PLA : PEA.w $89F55E-1
RTL
.vanilla
LDA.l FollowerIndicator ; what we wrote over
RTL
StartingFollower:
LDA.l InitFollowerIndicator : BEQ .return
PHA
REP #$20
; possible spawn points
LDA.b RoomIndex : CMP.w #$0104 : BEQ + ; links house
CMP.w #$0012 : BEQ + ; sanc
CMP.w #$00E4 : BEQ + ; old man
CMP.w #$0112 : BEQ + ; dark sanc
CMP.w #$011C : BEQ + ; bomb shop
SEP #$20 : PLA : RTL
+
SEP #$20
LDA.l FollowerIndicator : BEQ +
LDA.l FollowerDropped : CMP.b #$80 : PLA : BCC .return : PHA
+ LDA.l ProgressIndicator : CMP.b #$02 : PLA : BCC .escape_check
PHA
JSL DetermineFollowerSpawn_check_resolved
PLA
BCC .issue_follower
BRA .return
.escape_check
CMP.b #$01 : BNE .return
PHA : LDA.l ProgressFlags : AND.b #$04 : CMP.b #$04 : PLA : BCS .return
.issue_follower
STA.l FollowerIndicator
LDA.b #$00 : STA.l FollowerDropped
.return
RTL
MaybeSetZeldaCheckpoint:
AND.w #$7FFF : TAX ; what we wrote over
SEP #$20
LDA.l ProgressFlags : AND.b #$04 : BNE .return ; zelda rescued
LDA.l StartingEntrance : CMP.b #$02 : BEQ .return ; cell checkpoint set
CMP.b #$04 : BEQ .return ; throne room checkpoint set
LDA.l FollowerIndicator : CMP.b #$01 : BNE .return ; zelda following
LDA.b RoomIndex : CMP.b #$80 : BNE + ;zelda cell
LDA.l Follower_Zelda : CMP.b #$01 : BNE .return
BRA .set_checkpoint
+ CMP.b #$45 : BNE .return ; maiden cell
CPX.w #$0964 : BNE .return ; top big lock
LDA.l Follower_Maiden : CMP.b #$01 : BNE .return
.set_checkpoint
LDA.b #$02 : STA.l StartingEntrance
PHX
SEP #$10
JSL SaveDeathCount
JSL Dungeon_SaveRoomQuadrantData
REP #$10
PLX
.return
REP #$30
RTL
FollowerGfxRedraw:
PHP : SEP #$30
LDA.l FollowerTravelAllowed : CMP.b #$02 : BNE .return
PHY
LDY.b #$0F
.next
LDA.w SpriteAITable,Y : BEQ ++
LDA.w SpriteTypeTable,Y : CMP.b #$76 : BEQ + ; zelda
CMP.b #$AD : BEQ + ; old man
CMP.b #$B7 : BEQ + ; maiden
CMP.b #$1A : BEQ + ; frog
CMP.b #$39 : BEQ + ; locksmith
CMP.b #$B6 : BEQ + ; kiki
CMP.b #$B4 : BEQ + ; purple chest
CMP.b #$B5 : BNE ++ ; big bomb
LDA.w SpriteJumpIndex,Y : CMP.b #$02 : BEQ +
BRA ++
+ LDA.b #$01 : STA.w SprRedrawFlag,Y
++ DEY : BPL .next
PLY
.return
PLP
RTL
; A = 2 byte VRAM position in OAM2 for head/body
; Scrap06/07/08 = address to OAM group
; Returns with carry flag set if draw occurred
TransferAndDrawFollowerGfx:
PHA
LDA.w SpriteTimerE, X : AND.w #$0008 : BNE .skip_draw ; skip drawing every other frame
LDA.b 1,S
JSR TransferFollowerSpriteGfx ; returns with SEP #$20
LDA.w SpriteTypeTable, X : CMP.b #$39 : BNE +
; locksmith location flicker if quest completed but purple chest remains
LDA.w SpriteAux, X : BNE .continue
JSL DetermineFollowerSpawn : BCS .flicker
+ BRA .continue
.flicker
LDA.w SpriteTimerE, X : NOP #2 : BNE .continue
LDA.b #$0C : STA.w SpriteTimerE, X
.continue
PLA : XBA : PLA : XBA
JSL SpriteDraw_Follower
SEC
RTL
.skip_draw
PLA
SEP #$20
CLC
RTL
; A = 2 byte VRAM position in OAM2 for head/body
TransferFollowerSpriteGfx_skip_transfer:
PLA : PLA
RTS
TransferFollowerSpriteGfx:
PHA : SEP #$20
LDA.w SprRedrawFlag, X : BEQ .skip_transfer
.redraw
STZ.w SprRedrawFlag, X
JSL DetermineFollower
CMP.b #$01 : BNE +
PLA : XBA : LDA.b #$83 ; zelda body
JSR QueueFollowerSpriteGfx
PLA : XBA : LDA.b #$82 ; zelda head
JMP QueueFollowerSpriteGfx
+ CMP.b #$04 : BNE +
PLA : XBA : LDA.b #$84 ; old man body
JSR QueueFollowerSpriteGfx
PLA : XBA : LDA.b #$85 ; old man head
JMP QueueFollowerSpriteGfx
+ CMP.b #$06 : BNE +
PLA : XBA : LDA.b #$81 ; maiden body
JSR QueueFollowerSpriteGfx
PLA : XBA : LDA.b #$80 ; maiden head
JMP QueueFollowerSpriteGfx
+ CMP.b #$07 : BNE +
PLA : XBA : PLA : LDA.b #$11 ; frog
JMP QueueFollowerSpriteGfx
+ CMP.b #$08 : BNE +
PLA : XBA : PLA : LDA.b #$16 ; smith
JMP QueueFollowerSpriteGfx
+ CMP.b #$09 : BNE +
PLA : XBA : LDA.b #$87 ; locksmith body
JSR QueueFollowerSpriteGfx
PLA : XBA : LDA.b #$86 ; locksmith head
JMP QueueFollowerSpriteGfx
+ CMP.b #$0A : BNE +
PLA : XBA : LDA.b #$13 ; kiki body
JSR QueueFollowerSpriteGfx
PLA : XBA : LDA.b #$12 ; kiki head
JMP QueueFollowerSpriteGfx
+ CMP.b #$0C : BNE +
PLA : XBA : PLA : LDA.b #$14 ; purple chest
JMP QueueFollowerSpriteGfx
+ PLA : XBA : PLA : LDA.b #$15 ; super bomb
JMP QueueFollowerSpriteGfx
; A = 2 bytes, dest/src
QueueFollowerSpriteGfx:
PHX : REP #$20
PHA
AND.w #$00FF : CMP.w #$00FF : BEQ +
ASL #6 : EOR.w #$8000 : BRA .write_src
+ LDA.w #$0020 ; blank tile
.write_src
LDX.w ItemStackPtr : STA.l ItemGFXStack,X
PLA : XBA
AND.w #$00FF : ASL #4 : EOR.w #$5000
STA.l ItemTargetStack,X
TXA : INC #2 : STA.w ItemStackPtr
SEP #$20 : PLX
RTS
; A = 2 byte VRAM position in OAM2 for head/body
; Scrap06/07/08 = address to OAM group
; Scrap09/0A = address to palette data
SpriteDraw_Follower:
PHB : LDY.b #$7E : PHY : PLB
REP #$20
PHA
LDY.b #$0E
- LDA.b [Scrap06], Y : STA.w SpriteDynamicOAM, Y
DEY #2 : BPL -
LDA.b Scrap09 : STA.b Scrap06
PLA
SEP #$20
STA.w SpriteDynamicOAM+$0C : XBA : STA.w SpriteDynamicOAM+$04
JSL DetermineFollower : PHA
PHX
TAX : DEX
LDA.b Scrap06 : ORA.b Scrap07 : BEQ +
TXY
LDA.b [Scrap06], Y
BRA .set_palette
+
LDA.l .palette_data, X
.set_palette
STA.w SpriteDynamicOAM+$05 : STA.w SpriteDynamicOAM+$0D
PLX
REP #$20
LDA.w #$0002 : STA.b Scrap06
LDA.w #SpriteDynamicOAM : STA.b Scrap08
SEP #$20
PLA : CMP.b #$07 : BCC + : CMP.b #$09 : BEQ + : CMP.b #$0A : BEQ +
; only draw body
PHA
LDA.b #$01 : STA.b Scrap06
LDA.b #SpriteDynamicOAM+8 : STA.b Scrap08
PLA
+
; follower specific adjustments
CMP.b #$04 : BNE +
LDA.w SpriteDynamicOAM+$0A : SEC : SBC.b #8 : STA.w SpriteDynamicOAM+$02 ; old man coords
+
CMP.b #$0A : BNE +
LDA.w SpriteDynamicOAM+$0A : SEC : SBC.b #6 : STA.w SpriteDynamicOAM+$02 ; kiki coords
LDA.w SpriteTypeTable, X : CMP.b #$1A : BEQ ++ : CMP.b #$B4 : BCS ++ : BRA .draw
++ LDA.w SpriteDynamicOAM+$05 : ORA.b #$40
STA.w SpriteDynamicOAM+$05 : STA.w SpriteDynamicOAM+$0D ; kiki horiz flip
+
.draw
JSL Sprite_DrawMultiple_player_deferred
PLB
RTL
.palette_data
; 01 04 06 07 08 09 0A 0C 0D
db $00, $00, $00, $00, $00, $06, $00, $00, $06, $00, $00, $00, $00
DetermineFollower:
LDA.w SpriteAux, X : BEQ .skip_stored : RTL ; stored follower
.skip_stored
+ LDA.w $0E20,X : CMP.b #$1A : BNE +
LDA.l Follower_Frog : BRA .finalize
+ CMP.b #$39 : BNE +
LDA.l Follower_Locksmith : BRA .finalize
+ CMP.b #$AD : BNE +
LDA.l Follower_OldMan : BRA .finalize
+ CMP.b #$B6 : BNE +
LDA.l Follower_Kiki : BRA .finalize
+ CMP.b #$B7 : BNE +
LDA.l Follower_Maiden : BRA .finalize
+ CMP.b #$76 : BNE +
LDA.l Follower_Zelda : BRA .finalize
+ CMP.b #$B4 : BNE +
LDA.l Follower_PurpleChest : BRA .finalize
+ LDA.l Follower_SuperBomb
.finalize
PHA
CMP.b #$07 : BNE +
LDA.l CurrentWorld : BNE +
PLA : LDA.b #$08 : RTL
+
PLA
RTL
SetAndLoadFollower:
LDA.l FollowerIndicator
.skip_current
PHA
LDA.b #$00 : STA.l FollowerDropped
JSL DetermineFollower : STA.l FollowerIndicator
CMP.b #$01 : BNE +
JSL DetermineFollower_skip_stored : CMP.b #$01 : BNE +
LDA.b #$02 : STA.l StartingEntrance
JSL SaveDeathCount
PHX
JSL Dungeon_SaveRoomQuadrantData
PLX
+ CMP.b #$09 : BNE +
LDA.b #$40 : STA.w $02CD : STZ.w $02CE ; locksmith timed message
+
PHX
JSL Tagalong_LoadGfx
PLX
PLA : BNE +
JSL Follower_Initialize
JML Sprite_BecomeFollower
+
RTL
StoreAndLoadFollower:
LDA.l FollowerDropped : BNE .no_storage
LDA.l FollowerIndicator : BEQ .no_storage
PHA
JSL SetAndLoadFollower_skip_current
PLA : STA.w SpriteAux, X
LDA.b #$13 : JSL Sound_SetSfx3PanLong
LDA.b #$01 : STA.w SprRedrawFlag, X
STZ.w SpriteActivity, X
LDA.b #$90 : STA.w SpriteTimerE, X
SEC : RTL
.no_storage
JSL SetAndLoadFollower_skip_current
CLC : RTL
; return SEC if destination resolved
DetermineFollowerSpawn_locksmith_check:
; locksmith location needs to spawn if purple chest reward not acquired
LDA.l FollowerIndicator : CMP.b #$0C : BEQ .always_spawn
JSL DetermineFollower_skip_stored : CMP.l FollowerIndicator : BEQ .matched_following
LDA.l NpcFlagsVanilla : AND.b #$10 : BEQ .always_spawn
BRA DetermineFollowerSpawn
.always_spawn
CLC : RTL
.matched_following
SEC : RTL
DetermineFollowerSpawn_include_stored:
JSL DetermineFollower
BRA DetermineFollowerSpawn_byof
DetermineFollowerSpawn:
JSL DetermineFollower_skip_stored
.byof
CMP.l FollowerIndicator : BEQ .matched_following
.skip_match_check
PHA
; despawn if pre-requisite not met
LDA.w SpriteTypeTable, X : CMP.b #$B4 : BNE +
LDA.l NpcFlagsVanilla : AND.b #$20 : EOR.b #$20 : CMP.b #$20
BRA .prereq_check
+ CMP.b #$B5 : BNE +
LDA.l CrystalsField : AND.b #$05 : CMP.b #$05
LDA.b #$FF : ADC.b #$00 : ROR ; flip carry flag
.prereq_check
PLA : BCC .check_resolved
RTL
+
PLA
.check_resolved
CMP.b #$01 : BNE +
LDA.l ProgressFlags : AND.b #$04 : CMP.b #$04 : RTL
+ CMP.b #$04 : BNE +
JML ItemCheck_OldMan
+ CMP.b #$06 : BNE +
LDA.l RoomDataWRAM[$AC].high : AND.b #$08 : CMP.b #$08 : BCS ++
LDA.l EnemizerFlags_close_blind_door : CMP.b #$01
++
RTL
+ CMP.b #$09 : BCS + ; if frog or smith
LDA.l NpcFlagsVanilla : AND.b #$20 : CMP.b #$20 : RTL
+ CMP.b #$0A : BNE +
LDA.l OverworldEventDataWRAM+$5E : AND.b #$20 : CMP.b #$20 : RTL
+ CMP.b #$0C : BNE +
LDA.l NpcFlagsVanilla : AND.b #$10 : CMP.b #$10 : RTL
+
.always_spawn
CLC : RTL ; big bomb and locksmith have no completion condition in code
.matched_following
SEC : RTL
Follower_CheckMessageCollision:
PHA
LDA.w SpriteTimerE, X : BNE .skip_collision_check
PLA
JML Sprite_ShowMessageFromPlayerContact ; what we wrote over
.skip_collision_check
PLA
CLC : RTL
Follower_CheckTileCollision:
LDA.w SpriteTimerE, X : BNE .skip_collision_check
JML Sprite_CheckTileCollisionLong ; what we wrote over
.skip_collision_check
RTL
Follower_CheckCollision:
LDA.w SpriteTimerE, X : BNE .skip_collision_check
JML Sprite_CheckDamageToPlayerSameLayerLong ; what we wrote over
.skip_collision_check
CLC : RTL
SpritePrep_ZeldaFollower:
LDA.b RoomIndex : CMP.b #$12 : BEQ .no_follower_shuffle_sanc
LDA.l FollowerTravelAllowed : CMP.b #$02 : BNE .no_follower_shuffle
JSL DetermineFollowerSpawn : BCC + : RTL : +
LDA.b #$01 : STA.w SprRedrawFlag, X
PLA : PLA : PEA.w $EC4B-1 ; return to spawn
RTL
.no_follower_shuffle
LDA.l FollowerIndicator : CMP.b #$01
RTL
.no_follower_shuffle_sanc
LDA.l FollowerIndicator : CMP.b #$02
RTL
Zelda_WaitingInCell:
JSL Follower_CheckCollision ; what we wrote over, kinda
BCC .return
PHP
LDA.l FollowerTravelAllowed : CMP.b #$02 : BNE +
INC.w SpriteActivity, X
PLP
PLA : PLA : PEA.w $ECF9-1 : RTL ; skip sprite movement
+
PLP
.return
RTL
Zelda_BecomeFollower:
LDA.l FollowerTravelAllowed : CMP.b #$02 : BNE .vanilla
PLA : PLA
JSL StoreAndLoadFollower : BCC +
PEA.w $ED68-1 : RTL ; jump to avoid sprite despawn
+
PEA.w $ED60-1 ; jump to despawn
RTL
.vanilla
LDA.b #$02 : STA.l StartingEntrance ; what we wrote over
RTL
SpritePrep_BlindMaiden:
LDA.l FollowerTravelAllowed : CMP.b #$02 : BNE .vanilla
JSL DetermineFollowerSpawn : BCC +
LDA.b #$01 : RTL
+
LDA.b #$01 : STA.w SprRedrawFlag, X
INC.w SpriteAncillaInteract, X
STZ.w FollowerNoDraw
PLA : PLA : PEA.w $89C8-1 ; return to spawn
RTL
.vanilla
LDA.l RoomDataWRAM[$AC].high : AND.b #$08 ; what we wrote over
RTL
; Prevent followers from causing blind/maiden to despawn:
; Door rando: let zelda despawn the maiden.
BlindZeldaDespawnFix:
LDA.l FollowerIndicator ; what we wrote over
CMP.b #06 : BEQ +
LDA.w SpritePosYLow,X : BEQ +
LDA.b #$00 : RTL ; don't despawn follower if maiden isn't "present"
+
LDA.b #$01 : RTL
SpriteDraw_ZeldaMaiden:
LDA.b RoomIndex : CMP.b #$12 : BEQ .vanilla
LDA.l FollowerTravelAllowed : CMP.b #$02 : BNE .vanilla
LDA.b #.oam_group>>16 : STA.b Scrap08
LDA.w SpriteTypeTable, X : CMP.b #$76 : BNE +
REP #$20
LDA.w #.oam_group : STA.b Scrap06
LDA.w #0000 : STA.b Scrap09
LDA.l Follower_Zelda_vram
BRA .transfer
+
REP #$20
LDA.w #.oam_group : STA.b Scrap06
LDA.w #.palette_data_maiden : STA.b Scrap09
LDA.l Follower_Maiden_vram
.transfer
JML TransferAndDrawFollowerGfx
.skip_draw
RTL
.vanilla:
JML SpriteDraw_Maiden
.oam_group:
dw 1, -7 : db $20, $00, $00, $02
dw 1, 3 : db $22, $00, $00, $02
.palette_data_maiden
; 01 04 06 07 08 09 0A 0C 0D
db $02, $00, $00, $02, $00, $04, $02, $02, $04, $02, $00, $02, $02
BlindMaiden_BecomeFollower:
LDA.l FollowerTravelAllowed : CMP.b #$02 : BNE .vanilla
PLA : PLA
JSL StoreAndLoadFollower : BCS .return
STZ.w SpriteAITable, X
.return
PEA.w $E8EA-1 ; jump ahead on return
RTL
.vanilla
STZ.w SpriteAITable, X : LDA.b #$06 ; what we wrote over
RTL
SpritePrep_OldManFollower:
LDA.l FollowerTravelAllowed : CMP.b #$02 : BNE .no_follower_shuffle
PLA : PLA
JSL DetermineFollowerSpawn : BCC +
PEA.w $E928-1 ; return to despawn
RTL
+
LDA.b #$01 : STA.w SprRedrawFlag, X
PEA.w $E927-1 ; return to spawn
RTL
.no_follower_shuffle
LDA.l FollowerIndicator : CMP.b #$04
RTL
SpriteDraw_OldManFollower:
LDA.l FollowerTravelAllowed : CMP.b #$02 : BNE .vanilla
LDA.w SpriteJumpIndex, X : CMP.b #$01 : BEQ .vanilla
LDA.b #.oam_group>>16 : STA.b Scrap08
REP #$20
LDA.w #.oam_group : STA.b Scrap06
LDA.w #0000 : STA.b Scrap09
PLA : PEA.w $FF45-1 ; skip vanilla draw
LDA.l Follower_OldMan_vram
JML TransferAndDrawFollowerGfx
.vanilla
LDA.b #$02 : STA.b Scrap06 ; what we wrote over
RTL
.oam_group
dw 0, 0 : db $AC, $00, $00, $02
dw 0, 8 : db $AE, $00, $00, $02
OldMan_BecomeFollower:
LDA.l FollowerTravelAllowed : CMP.b #$02 : BCC .set_follower_and_despawn
PLA : PLA
JSL StoreAndLoadFollower : BCC +
PEA.w $E9DF-1 : RTL ; jump to avoid sprite despawn
+
PEA.w $E9DC-1 ; jump to despawn
RTL
.set_follower_and_despawn
JSL SetAndLoadFollower
PLA : PLA : PEA.w $E9D6-1
SpritePrep_SmithyFrog:
LDA.l FollowerTravelAllowed : CMP.b #$02 : BNE .no_follower_shuffle
JSL DetermineFollowerSpawn : BCC +
LDA.b #$01 ; return to despawn
RTL
+
LDA.b #$01 : STA.w SprRedrawFlag, X
DEC ; return to spawn
RTL
.no_follower_shuffle
LDA.l FollowerIndicator : BNE + ; what we wrote over
LDA.l NpcFlagsVanilla : AND.b #$20 ; what we wrote over
+ RTL
SpriteDraw_FrogFollower:
LDA.l FollowerTravelAllowed : CMP.b #$02 : BNE .vanilla
LDA.b #.oam_group>>16 : STA.b Scrap08
REP #$20
LDA.w #.oam_group : STA.b Scrap06
LDA.w #0000 : STA.b Scrap09
PLA : PEA.w $DCD6-1
LDA.l Follower_Frog_vram
JML TransferAndDrawFollowerGfx
.vanilla
LDA.b #$01 : STA.b Scrap06 ; what we wrote over
RTL
.oam_group:
dw 1, -8 : db $FF, $00, $00, $02
dw 1, 0 : db $C8, $00, $00, $02
Frog_BecomeFollower:
LDA.l FollowerTravelAllowed : CMP.b #$02 : BCC .set_follower_and_despawn
PLA : PLA
JSL StoreAndLoadFollower : BCC +
PEA.w $B2C7-1 : RTL ; jump to avoid sprite despawn
+
PEA.w $B2C4-1 ; jump to despawn
RTL
.set_follower_and_despawn
JSL SetAndLoadFollower
PLA : PLA : PEA.w $B2C4-1 ; jump to despawn
RTL
SpritePrep_PurpleChest:
LDA.l FollowerTravelAllowed : CMP.b #$02 : BNE .vanilla
JSL DetermineFollowerSpawn : BCC +
LDA.b #$00 ; return to despawn
RTL
+
PLA : PLA : PEA.w $8A69-1 ; return to spawn
LDA.b #$01 : STA.w SprRedrawFlag, X
RTL
.vanilla
LDA.l FollowerIndicator : CMP.b #$0C
RTL
SpriteDraw_PurpleChest:
LDA.l FollowerTravelAllowed : CMP.b #$02 : BNE .vanilla
LDA.b #.oam_group>>16 : STA.b Scrap08
REP #$20
LDA.w #.oam_group : STA.b Scrap06
LDA.w #0000 : STA.b Scrap09
LDA.l Follower_PurpleChest_vram
JML TransferAndDrawFollowerGfx
.vanilla
JML Sprite_PrepAndDrawSingleLargeLong ; what we wrote over
.oam_group:
dw 0, -8 : db $C8, $00, $00, $02
dw 0, 0 : db $EE, $00, $00, $02
PurpleChest_FollowCheck:
LDA.l FollowerTravelAllowed : CMP.b #$02 : BNE .vanilla
LDA.b #$00
RTL
.vanilla
LDA.l FollowerIndicator ; what we wrote over
RTL
PurpleChest_BecomeFollower:
LDA.l FollowerTravelAllowed : CMP.b #$02 : BNE .vanilla
PLA : PLA
JSL StoreAndLoadFollower : BCS .return
STZ.w SpriteAITable, X
.return
PEA.w $E10A-1 ; jump ahead on return
RTL
.vanilla
STZ.w SpriteAITable, X : LDA.b #$0C ; what we wrote over
RTL
SpritePrep_SuperBomb:
LDA.l FollowerTravelAllowed : CMP.b #$02 : BNE .vanilla
JSL DetermineFollowerSpawn : BCC +
LDA.b #$00 ; despawn on exit
RTL
+
LDA.b #$05
RTL
.vanilla
LDA.l CrystalsField ; what we wrote over
RTL
SpriteDraw_SuperBomb:
LDA.w SpriteJumpIndex, X : CMP.b #$02 : BNE .vanilla
LDA.l FollowerTravelAllowed : CMP.b #$02 : BNE .vanilla
LDA.b #.oam_group>>16 : STA.b Scrap08
REP #$20
LDA.w #.oam_group : STA.b Scrap06
LDA.w #.palette_data : STA.b Scrap09
PLA : PEA.w $E2E2-1 ; skip vanilla draw
LDA.l Follower_SuperBomb_vram
JML TransferAndDrawFollowerGfx
.vanilla
LDA.b #$01 : STA.b Scrap06 ; what we wrote over
RTL
.oam_group:
dw 0, -8 : db $AE, $08, $00, $02
dw 0, 0 : db $4E, $08, $00, $02
.palette_data
; 01 04 06 07 08 09 0A 0C 0D
db $08, $00, $00, $08, $00, $06, $08, $08, $06, $08, $00, $08, $08
SuperBomb_FollowCheck:
LDA.l FollowerTravelAllowed : CMP.b #$02 : BNE .vanilla
LDA.w SpriteTimerE, X : BNE .skip_follow
LDA.w SpriteAux, X : BEQ .vanilla
PLA : PLA : PEA.w $E1F1-1 ; jump to skip cost, no double charge
RTL
.skip_follow
PLA : PLA : PEA.w $E20C-1 ; jump to exit
RTL
.vanilla
LDA.b #$64 : LDY.b #$00 ; what we wrote over
RTL
SuperBomb_BecomeFollower:
LDA.l FollowerTravelAllowed : CMP.b #$02 : BNE .vanilla
PLA : PLA
JSL StoreAndLoadFollower : BCC +
PEA.w $E20C-1 : RTL ; jump to exit
+
PEA.w $E201-1 ; jump to despawn
RTL
.vanilla
LDA.b #$0D : STA.l FollowerIndicator ; what we wrote over
RTL
pushpc
org $868A14
NOP #3 ; fix bomb shop spawn for dwarfless big bomb
LDA.b #$B5 : JSL Sprite_SpawnDynamically
BMI SuperBomb_BecomeFollower_exit
LDA.b #$01 : STA.w SprRedrawFlag, Y ; force redraw for super bomb gfx
pullpc
SpritePrep_Kiki:
LDA.l FollowerTravelAllowed : CMP.b #$02 : BNE .vanilla
JSL DetermineFollowerSpawn : BCC +
LDA.b #$20 : RTL ; despawn on exit
+
LDA.b #$00
RTL
.vanilla
LDX.b OverworldIndex : LDA.l OverworldEventDataWRAM,X ; what we wrote over
RTL
Kiki_OfferToFollow:
PHA
LDA.w SpriteTimerE, X : BNE .skip_collision_check
PLA
JML Sprite_ShowMessageUnconditional ; what we wrote over
.skip_collision_check
PLA
CLC : RTL
Kiki_FollowCheck:
JSL DetermineFollowerSpawn_include_stored : BCS .skip_follow
LDA.w SpriteTimerE, X
RTL
.skip_follow
LDA.b #$20
RTL
Kiki_BecomeFollower:
LDA.l FollowerTravelAllowed : CMP.b #$02 : BNE .no_follower_shuffle
PLA : PLA : PEA.w $E4C2-1 ; jump to exit
STZ.w FollowerNoDraw
JML StoreAndLoadFollower
.no_follower_shuffle
LDA.b #$00 : STA.l FollowerDropped ; defuse bomb
LDA.b #$0A : STA.l FollowerIndicator
RTL
Kiki_FixTeleportOnExit:
REP #$30
LDA.b LinkPosX : STA.w LinkPosXCache
LDA.b LinkPosY : STA.w LinkPosYCache
SEP #$30
LDA.b #$19 : LDY.b #$01 ; what we wrote over
RTL
; on return it checks BEQ and if non-zero, kiki get spook
Kiki_DontScareTheMonke:
LDA.b LinkJumping : BEQ .return
CMP.b #$02 : BEQ .no_spook ; needed for quake usage
LDA.w NoDamage : BNE .no_spook
LDA.w LinkThud : BNE .no_spook
.spook
LDA.b #$01 : RTL
.no_spook
LDA.b #$00
.return
RTL
SpritePrep_Locksmith:
LDA.l FollowerTravelAllowed : CMP.b #$02 : BNE .vanilla
JSL DetermineFollowerSpawn_locksmith_check : BCS +
LDA.b #$01 : STA.w SprRedrawFlag, X
+
LDA.l FollowerIndicator
RTL
.vanilla
LDA.l FollowerIndicator : CMP.b #$09 ; what we wrote over
BEQ +
CLC : RTL
+
SEC : RTL
SpriteDraw_LocksmithFollower:
LDA.l FollowerTravelAllowed : CMP.b #$02 : BNE .vanilla
LDA.b #.oam_group>>16 : STA.b Scrap08
REP #$20
LDA.w #.oam_group : STA.b Scrap06
LDA.w #.palette_data : STA.b Scrap09
PLA : PEA.w $DCD6-1 ; skip draw on exit
LDA.l Follower_Locksmith_vram
JML TransferAndDrawFollowerGfx
.vanilla
LDA.b #$02 : STA.b Scrap06 ; what we wrote over
RTL
.oam_group:
dw 0, -8 : db $EA, $00, $00, $02
dw 0, 0 : db $EC, $00, $00, $02
.palette_data
; 01 04 06 07 08 09 0A 0C 0D
db $00, $00, $00, $0E, $00, $00, $0E, $0E, $00, $0E, $00, $0E, $0E
Locksmith_Chillin_PostMessage:
LDA.w SpriteAux, X : BEQ +
; when a follower is stored, merely walk near them
LDA.w SpritePosXLow, X : PHA
JSL Follower_CheckCollision : BCC .return
BRA .continue
+
LDA.w SpritePosXLow, X : PHA
SEC : SBC.b #$10 : STA.w SpritePosXLow, X
LDA.b #$01 : STA.w SpriteVelocityX, X
JSL Sprite_Get16BitCoords_long
JSL Follower_CheckTileCollision : BNE .return
.continue
INC.w SpriteActivity, X ; award follower
LDA.l FollowerIndicator : CMP.b #$0C : BEQ .purple_chest_prize
LDA.l FollowerTravelAllowed : CMP.b #$02 : BEQ .return
LDA.l FollowerIndicator : CMP.b #$00 : BEQ .return
LDA.b #$05 : STA.w SpriteActivity, X ; forever do nothing
BRA .return
.purple_chest_prize
INC.w SpriteActivity, X ; prep for purple chest prize
.return
PLA : STA.w SpritePosXLow, X
JML $86BD08 ; jump back to immediately RTS
Locksmith_BecomeFollower:
LDA.l FollowerTravelAllowed : CMP.b #$02 : BNE .vanilla
STZ.w FollowerNoDraw
PLA : PLA
JSL StoreAndLoadFollower : BCS +
LDA.l FollowerIndicator : CMP.b #$0C : BEQ +
PEA.w $BD24-1 : RTL ; jump to despawn
+
PEA.w $BD27-1 ; jump to exit
RTL
.vanilla
LDA.b #$09 : STA.l FollowerIndicator
RTL
Locksmith_RespondToAnswer_PostItem:
STA.l FollowerIndicator ; what we wrote over
LDA.l FollowerTravelAllowed : CMP.b #$02 : BNE .no_despawn
LDA.w SpriteAux, X : CMP.b #$0C : BEQ .despawn
CMP.b #$00 : BNE .no_despawn
LDA.l Follower_Locksmith : CMP.b #$0C : BEQ .despawn
JSL DetermineFollowerSpawn_include_stored : BCC .no_despawn
.despawn
STZ.w SpriteAITable, X
.no_despawn
RTL

View File

@@ -48,7 +48,7 @@ JML NMIHookReturn
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
PostNMIHookAction: PostNMIHookAction:
LDA.w NMIAux : BEQ + LDA.w NMIAux : BEQ +
PHK : PEA .return-1 ; push stack for RTL return PHK : PEA.w .return-1 ; push stack for RTL return
JMP.w [NMIAux] JMP.w [NMIAux]
.return .return
STZ.w NMIAux ; zero bank byte of NMI hook pointer STZ.w NMIAux ; zero bank byte of NMI hook pointer

29
gloom.asm Normal file
View File

@@ -0,0 +1,29 @@
AdjustDefaultGraphics:
JSL $80E310
LDA.l ChallengeModes : AND.b #$03 : CMP.b #$02 : BEQ .gloom
RTL
.gloom
LDA.b #$80
STA.w $2115
REP #$20
LDA.w #$7500
STA.w $2116
LDY.b #SkullGfx_end-SkullGfx
LDX.b #$00
- LDA.l SkullGfx, X
STA.w $2118
INX #2
DEY #2
BNE -
SEP #$20
RTL
SkullGfx:
incbin "data/skull.bin"
.end

View File

@@ -1,6 +1,6 @@
GoalItemGanonCheck: GoalItemGanonCheck:
LDA.w SpriteTypeTable, X : CMP.b #$D6 : BNE .success ; skip if not ganon LDA.w SpriteTypeTable, X : CMP.b #$D6 : BNE .success ; skip if not ganon
JSL CheckGanonVulnerability LDA.b #$01 : JSL CheckConditionPass
BCS .success BCS .success
.fail .fail
@@ -11,104 +11,193 @@ RTL
LDA.b OAMOffsetY : CMP.b #$80 ; thing we wrote over LDA.b OAMOffsetY : CMP.b #$80 ; thing we wrote over
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
;Carry clear = ganon invincible ; Input A = Type of condition check
;Carry set = ganon vulnerable ; Carry clear = failed check
CheckGanonVulnerability: ; Carry set = successful check
PHX CheckConditionPass:
LDA.l GanonVulnerableMode PHX : PHY
ASL PHB
TAX LDY.b #GoalConditionTable>>16 : PHY : PLB : STY.b Scrap02
REP #$20
ASL : TAY
LDA.w GoalConditionTable, Y : STA.b Scrap00
PHK : PLB
SEP #$20
LDY.b #$00
- LDA.b [Scrap00], Y : CMP.b #$FF : BEQ .exit
INY : ROL : TAX
JSR (.conditions, X) : BCC .exit : BRA -
; Carry .exit
; 0 - invulnerable PLB : PLY : PLX
; 1 - vulnerable RTL
JSR (.goals, X)
PLX ; Y = index after condition code
RTL ; Carry = Set if using default target value
.conditions
dw .always_fail
.goals dw .pendants
dw .vulnerable
dw .invulnerable
dw .all_dungeons
dw .crystals_and_aga
dw .crystals dw .crystals
dw .pendant_bosses
dw .crystal_bosses
dw .bosses
dw .agahnim_defeated
dw .agahnim2_defeated
dw .goal_item dw .goal_item
dw .light_speed dw .collection_rate
dw .crystals_and_bosses dw .custom_goal
dw .bosses_only dw .bingo
dw .all_dungeons_no_agahnim dw .success
dw .all_items dw .success
dw .completionist dw .success
dw .success
; 00 = always vulnerable .agahnim2_defeated
.vulnerable LDA.l RoomDataWRAM[$0D].high : AND.b #$08 : BEQ .fail
.bingo ; not implemented yet
.success .success
SEC SEC : RTS
RTS .always_fail
; 01 = always invulnerable
.invulnerable
.fail .fail
CLC CLC : RTS
RTS .pendants
PHP
; 02 = All dungeons LDA.l PendantCounter : PLP : BCC +
.all_dungeons CMP.b #$03 : RTS
LDA.l ProgressIndicator : CMP.b #$03 : BCC .fail ; require post-aga world state
; 09 = All dungeons except agahnim
.all_dungeons_no_agahnim
LDA.l PendantsField : AND.b #$07 : CMP.b #$07 : BNE .fail ; require all pendants
LDA.l CrystalsField : AND.b #$7F : CMP.b #$7F : BNE .fail ; require all crystals
LDA.l OverworldEventDataWRAM+$5B : AND.b #$20 : BEQ .fail ; require aga2 defeated (pyramid hole open)
BRA .success
; 03 = crystals and aga 2
.crystals_and_aga
LDA.l OverworldEventDataWRAM+$5B : AND.b #$20 : BEQ .fail ; check aga2 first then bleed in
; 04 = crystals only
.crystals .crystals
JSL CheckEnoughCrystalsForGanon PHP
RTS LDA.l CrystalCounter : PLP : BCC +
CMP.b #$07 : RTS
; 05 = require goal item .pendant_bosses
PHP
LDA.b #$02
JSR CheckForBossesDefeated : PLP : BCC +
CMP.b #$03 : RTS
.crystal_bosses
PHP
LDA.b #$01
JSR CheckForBossesDefeated : PLP : BCC +
CMP.b #$07 : RTS
.bosses
PHP
LDA.b #$00
JSR CheckForBossesDefeated : PLP : BCC +
CMP.b #$10 : RTS
+ CMP.b [Scrap00], Y : INY : RTS
.agahnim_defeated
LDA.l ProgressIndicator : CMP.b #$03 : RTS
.goal_item .goal_item
REP #$20 REP #$20
LDA.l GoalCounter : CMP.l GoalItemRequirement LDA.l GoalCounter : BCC +
SEP #$20 CMP.l GoalItemRequirement : BRA ++
.collection_rate
REP #$20
LDA.l TotalItemCounter : BCC +
CMP.l TotalItemCount : BRA ++
+ CMP.b [Scrap00], Y : INY : INY : ++
SEP #$20
RTS RTS
.custom_goal
LDA.b [Scrap00], Y : INY ; options
PHA : AND.b #$07 : ASL : TAX : PLA
;JMP CheckConditionPassCustom
; flows into next function, do not insert code after without uncommenting above
; 06 = light speed ; --------------------------------------------------------------------------------
.light_speed ; Input A = Options value, see GoalConditionTable for format
BRA .fail ; Input X = Condition check type index
; Input Y = Index after Options byte
CheckConditionPassCustom:
PHX : PHA : BIT.b #$08 : PHP
REP #$30
LDA.b [Scrap00], Y : INY : INY ; address
PLP : REP #$30 : BEQ .byte
.word
TAX
SEP #$20
PLA
AND.b #$10
REP #$20
BNE +
LDA.l $7E0000, X : BRA ++
+
LDA.l $7F0000, X : ++
SEP #$10
PLX
REP #$10
JSR (.comparisons, X)
INY
SEP #$30
RTS
.byte
TAX
SEP #$20
PLA
AND.b #$10 : BNE +
LDA.l $7E0000, X : BRA ++
+
LDA.l $7F0000, X : ++
SEP #$10
PLX
JMP (.comparisons, X)
; 07 = Crystals and bosses .comparisons
.crystals_and_bosses dw .minimum
JSL CheckEnoughCrystalsForGanon ; check crystals first then bleed in to next dw .exact
BCC .fail dw .bitfield_nonzero
dw .bitfield_match
; 08 = Crystal bosses but no crystals dw .count_bits
.bosses_only dw .fail
JMP CheckForCrystalBossesDefeated dw .fail
dw .fail
; 09 = 100% item collection rate
.all_items
REP #$20
LDA.l TotalItemCounter : CMP.l TotalItemCount
SEP #$20
RTS
; 0A = 100% item collection rate and all dungeons
.completionist
REP #$20
LDA.l TotalItemCounter : CMP.l TotalItemCount
SEP #$20
BCC .fail
BRA .all_dungeons
.pass
INY : SEC : RTS
.count_bits
JSL CountBits
.minimum
CMP.b [Scrap00], Y : INY
RTS
.bitfield_match
AND.b [Scrap00], Y
.exact
CMP.b [Scrap00], Y : BEQ .pass
INY : CLC : RTS
.bitfield_nonzero
AND.b [Scrap00], Y : BNE .pass
.fail
INY : CLC : RTS
;--------------------------------------------------------------------------------
GTCutscene_TransferGfx:
PHA
REP #$20
STZ.w DuckPose
LDA.l GanonsTowerOpenGfx : BEQ .original_crystal
PHX
LDX.w ItemStackPtr : STA.l ItemGFXStack,X
LDA.w #$81C0>>1 : STA.l ItemTargetStack,X
INX #2 : STX.w ItemStackPtr
PLX
SEP #$20
PLA
RTL
.original_crystal
SEP #$20
PLA
JML TransferItemReceiptToBuffer_using_GraphicsID
;--------------------------------------------------------------------------------
AncillaDraw_GTCutsceneCrystal_OAMPrep:
LDA.l GanonsTowerOpenGfx : ORA.l GanonsTowerOpenGfx+1 : BEQ .vanilla
LDA.b #$0E : STA.b (OAMPtr),Y
INY
LDA.l GanonsTowerOpenPalette : AND.b #$67 : ASL : ORA.b #$30
STA.b (OAMPtr),Y
RTL
.vanilla
LDA.b #$24 : STA.b (OAMPtr),Y
INY
LDA.b #$3C : STA.b (OAMPtr),Y
RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
GTCutscene_CrystalMasks: GTCutscene_CrystalMasks:
db %00000000 ; 0 crystals db %00000000 ; 0 crystals
@@ -171,48 +260,94 @@ GTCutscene_ActivateSparkle_SelectCrystal:
PLY PLY
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; prioritizes: number of gfx used > sum of targets > number of goals
; Scrap00 stores number of goals
; Y sums all goal target values
GTCutscene_NumberOfCrystals: GTCutscene_NumberOfCrystals:
PHX : PHY : PHP
REP #$20 REP #$20
LDA.l GanonsTowerOpenAddress : CMP.w #CrystalCounter : BEQ + LDA.l GanonsTowerOpenGfx+2 : BEQ .not_multiple_gfx
LDA.w #$0001 : BRA .done LDX.b #$04
+ LDA.l GanonsTowerOpenTarget - LDA.l GanonsTowerOpenGfx, X : BEQ +
.done INX : INX : CPX.b #$0E : BCC -
+
TXA : LSR
JMP .done
.not_multiple_gfx
LDX.b #$00 : LDA.l GoalConditionTable, X
TXY : STY.b Scrap00
REP #$10
SEP #$20 SEP #$20
TAX
.next
LDA.l $B00000, X : CMP.b #$FF : BNE + : JMP .use_y : +
INC.b Scrap00
ROL : PHP : CMP.b #$10 : BCS .not_8bit_compare
CMP.b #$0C : BEQ .agas_goal
CMP.b #$0E : BEQ .agas_goal
; uses 8-bit targets
PLP : BCC .use_8bit_target
CMP.b #$04 : BEQ .crystal_goal ; crystal goal
CMP.b #$08 : BEQ .crystal_goal ; crystal bosses goal
CMP.b #$02 : BEQ .pendant_goal ; pendant goal
CMP.b #$06 : BEQ .pendant_goal ; pendant bosses goal
BRA .bosses_goal
.crystal_goal
LDA.b #$07 : INX : BRA .add_to_y
.pendant_goal
LDA.b #$03 : INX : BRA .add_to_y
.bosses_goal
INY : INX : BRA .next ; just increment Y by 1 since default of 10 is already more than max 7
.agas_goal
PLP : INX : BRA .next
.use_8bit_target
INX : LDA.l $B00000, X : INX
.add_to_y
PHY : CLC : ADC.b 1,S : PLY : TAY : BRA .next
.not_8bit_compare
CMP.b #$14 : BEQ .custom_goal : BCS .unknown
; triforce hunt/collection rate - uses 16-bit targets
PLP : INX : BCC +
LDA.l $B00000, X : INX : INX : BRA .add_to_y
+ INY : BRA .next
.custom_goal
PLP
INX : LDA.l $B00000, X : BIT.b #$08 : PHP
INX : INX : INX : AND.b #$03 : BEQ .use_custom_target
; comparison method doesn't use a quantity, increment Y by 1
INY : INX : PLP : BEQ +
INX
+
BRA .next
.use_custom_target
PLP : BEQ ..8bit
; 16-bit target
REP #$20
LDA.l $B00000, X : CMP.w #$0008 : SEP #$20 : INX : BRA +
..8bit
LDA.l $B00000, X : CMP.b #$08 : + : BCC +
; target exceeds 7, just increment Y by 1
INY : INX : JMP .next
+
INX : BRA .add_to_y
.unknown ; unknown condition, exit with safe value
PLP : INY
.use_y
TYA : BEQ + : CMP.b #$08 : BCC .done
+ LDA.b Scrap00 : BEQ .use_one : CMP.b #$08 : BCC .done
.use_one
LDA.b #$01
.done
PLP : PLY : PLX
RTS RTS
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
CheckEnoughCrystalsForGanon:
REP #$20
LDA.l CrystalCounter
CMP.l GanonVulnerableTarget
SEP #$20
RTL
;--------------------------------------------------------------------------------
CheckTowerOpen: CheckTowerOpen:
LDA.l GanonsTowerOpenMode : ASL : TAX LDA.b #$00 : JML CheckConditionPass
JSR (.tower_open_modes,X)
RTL
.tower_open_modes
dw .vanilla
dw .arbitrary_cmp
.vanilla
LDA.l CrystalsField
AND.b #$7F : CMP.b #$7F
RTS
.arbitrary_cmp
REP #$30
LDA.l GanonsTowerOpenAddress : TAX
LDA.l $7E0000,X
CMP.l GanonsTowerOpenTarget
SEP #$30
RTS
;--------------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------------
CheckAgaForPed: CheckAgaForPed:
REP #$20 REP #$20
LDA.l GanonVulnerableMode ; seems light_speed option to force blue balls is unused for now
CMP.w #$0006 : BNE .vanilla BRA .vanilla
.light_speed .light_speed
SEP #$20 SEP #$20
@@ -233,73 +368,61 @@ CheckAgaForPed:
RTL RTL
;--------------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------------
CheckForCrystalBossesDefeated: CheckForBossesDefeated:
PHB : PHX : PHY PHB : PHX : PHY
LDA.b #CrystalPendantFlags_2>>16 STA.b Scrap04 ; 0 = check all, 1 = check crystals, 2 = check pendants
LDA.b #CrystalPendantFlags_3>>16
PHA : PLB PHA : PLB
REP #$30 STZ.b Scrap03 ; count of number of bosses killed
STZ.b Scrap05
; count of number of bosses killed REP #$30
STZ.b Scrap00
LDY.w #10 LDY.w #10
.next_check .next_check
LDA.w CrystalPendantFlags_2-2,Y LDA.w CrystalPendantFlags_3+2,Y : AND.w #$00FF : BEQ .skip
BIT.w #$0040 CMP.w #$0008 ; C set = pendant, C clear = crystal
BEQ ++ LDA.b Scrap04 : BEQ .proceed
PHP : ROR : BCC +
PLP : BCS .skip : BRA .proceed
+ PLP : BCC .skip
TYA .proceed
ASL TYA : ASL : TAX
TAX
LDA.l DrawHUDDungeonItems_boss_room_ids-4,X LDA.l DungeonMapBossRooms+4,X
TAX ASL : TAX
LDA.l RoomDataWRAM.l,X LDA.l RoomDataWRAM.l,X
AND.w #$0800 AND.w #$0800 : BEQ .skip
BEQ ++ INC.b Scrap03
INC.b Scrap00 .skip
DEY : BPL .next_check
++ DEY
BPL .next_check
SEP #$30 SEP #$30
PLY : PLX : PLB PLY : PLX : PLB
LDA.b Scrap00 : CMP.l GanonVulnerableTarget LDA.b Scrap03
RTS RTS
;--------------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------------
CheckPedestalPull: CheckPedestalPull:
; Out: c - Successful ped pull if set, do nothing if unset. ; Out: c - Successful ped pull if set, do nothing if unset.
PHX LDA.b #$02 : JSL CheckConditionPass : BCS .return
LDA.l PedCheckMode : ASL : TAX PHX : PHP
JSR (.pedestal_modes,X) LDA.b GameMode : CMP.b #$0E : BEQ +
PLX REP #$30
LDX.w #$0004 : LDA.l GoalConditionTable, X : TAX
LDA.l $B00000, X : CMP.w #$FF81 : BEQ +
SEP #$30
LDA.b #$97 : LDY.b #$01
JSL Sprite_ShowMessageUnconditional
+
PLP : PLX
.return
RTL RTL
.pedestal_modes
dw .vanilla
dw .arbitrary_cmp
.vanilla
LDA.l PendantsField
AND.b #$07 : CMP.b #$07 : BNE ..nopull
SEC
RTS
..nopull
CLC
RTS
.arbitrary_cmp
REP #$30
LDA.l PedPullAddress : TAX
LDA.l $7E0000,X
CMP.l PedPullTarget
SEP #$30
RTS

View File

@@ -3,15 +3,13 @@
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
HeartPieceGet: HeartPieceGet:
PHX : PHY PHX : PHY
JSL LoadHeartPieceRoomValue LDA.w SprItemMWPlayer, X : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID
JSL AttemptItemSubstitution LDY.w SprSourceItemId, X
JSL ResolveLootIDLong
TAY
JSL MaybeMarkDigSpotCollected JSL MaybeMarkDigSpotCollected
.skipLoad .skipLoad
JSL HeartPieceGetPlayer : STA.l !MULTIWORLD_ITEM_PLAYER_ID LDA.w SprItemMWPlayer, X : STA.l !MULTIWORLD_ITEM_PLAYER_ID
CPY.b #$26 : BNE .not_heart ; don't add a 1/4 heart if it's not a heart piece CPY.b #$26 : BNE .not_heart ; don't add a 1/4 heart if it's not a heart piece
LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE .not_heart CMP.b #$00 : BNE .not_heart
LDA.l HeartPieceQuarter : INC A : AND.b #$03 : STA.l HeartPieceQuarter LDA.l HeartPieceQuarter : INC A : AND.b #$03 : STA.l HeartPieceQuarter
.not_heart .not_heart
JSL Player_HaltDashAttackLong JSL Player_HaltDashAttackLong
@@ -25,39 +23,41 @@ RTL
HeartContainerGet: HeartContainerGet:
PHX : PHY PHX : PHY
JSL IncrementBossSword JSL IncrementBossSword
LDY.w SpriteID, X : BNE + LDY.w SprSourceItemId, X
JSL LoadHeartContainerRoomValue : TAY
+
BRA HeartPieceGet_skipLoad BRA HeartPieceGet_skipLoad
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
DrawHeartPieceGFX: DrawHeartPieceGFX:
PHP PHP
JSL Sprite_IsOnscreen : BCC .offscreen JSL Sprite_IsOnscreen : BCC .offscreen
PHA : PHY PHA : PHY
LDA.l RedrawFlag : BEQ .skipInit ; skip init if already ready LDA.w SprRedrawFlag, X : BEQ .skipInit ; skip init if already ready
JSL HeartPieceSpritePrep JSL HeartPieceSpritePrep
JMP .done ; don't draw on the init frame LDA.w SprRedrawFlag, X : CMP.b #$02 : BEQ .skipInit
BRA .done ; don't draw on the init frame
.skipInit .skipInit
LDA.w SpriteID, X ; Retrieve stored item type LDA.w SprItemReceipt, X ; Retrieve stored item type
.skipLoad .skipLoad
PHA : PHX PHA : PHX
TAX TAX
LDA.l SpriteProperties_standing_width,X : BNE + LDA.l SpriteProperties_standing_width,X : BNE +
PLX PLX
REP #$20 : LDA.b RoomIndex : CMP.w #$0120 : SEP #$20 : BNE .prepShadow
LDA.b IndoorsFlag : BNE .draw ; skip "shadow" change in good bee room
.prepShadow
LDA.w SpriteControl, X : ORA.b #$20 : STA.w SpriteControl, X LDA.w SpriteControl, X : ORA.b #$20 : STA.w SpriteControl, X
.draw
PLA PLA
JSL DrawDynamicTile JSL DrawPotItem
REP #$21 REP #$21
LDA.b Scrap00 LDA.b Scrap00 : ADC.w #$0004 : STA.b Scrap00
ADC.w #$0004
STA.b Scrap00
SEP #$20 SEP #$20
JSL Sprite_DrawShadowLong JSL Sprite_DrawShadowLong
BRA .done BRA .done
+ +
PLX PLX
PLA PLA
JSL DrawDynamicTile JSL DrawPotItem
JSL Sprite_DrawShadowLong JSL Sprite_DrawShadowLong
.done .done
PLY : PLA PLY : PLA
@@ -70,12 +70,13 @@ DrawHeartContainerGFX:
JSL Sprite_IsOnscreen : BCC DrawHeartPieceGFX_offscreen JSL Sprite_IsOnscreen : BCC DrawHeartPieceGFX_offscreen
PHA : PHY PHA : PHY
LDA.l RedrawFlag : BEQ .skipInit ; skip init if already ready LDA.w SprRedrawFlag, X : BEQ .skipInit ; skip init if already ready
JSL HeartContainerSpritePrep JSL HeartContainerSpritePrep
BRA DrawHeartPieceGFX_done ; don't draw on the init frame LDA.w SprRedrawFlag, X : CMP.b #$02 : BEQ .skipInit
BRA DrawHeartPieceGFX_done ; don't draw on the init frame
.skipInit .skipInit
LDA.w SpriteID, X ; Retrieve stored item type LDA.w SprItemReceipt, X ; Retrieve stored item type
BRA DrawHeartPieceGFX_skipLoad BRA DrawHeartPieceGFX_skipLoad
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -92,8 +93,8 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
NormalItemSkipSound: NormalItemSkipSound:
; Out: c - skip sounds if set ; Out: c - skip sounds if set
LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE .skip
JSL CheckIfBossRoom : BCS .boss_room JSL CheckIfBossRoom : BCS .boss_room
LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE .skip
TDC TDC
CPY.b #$17 : BEQ .skip CPY.b #$17 : BEQ .skip
CLC CLC
@@ -110,38 +111,19 @@ RTL
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
HeartPieceSpritePrep: HeartPieceSpritePrep:
PHA
LDA.l ServerRequestMode : BEQ + : : + LDA.l ServerRequestMode : BEQ + : : +
LDA.b #$01 : STA.l RedrawFlag
LDA.b LinkState : CMP.b #$14 : BEQ .skip ; skip if we're mid-mirror
LDA.b #$00 : STA.l RedrawFlag INC.w SkipBeeTrapDisguise
JSL HeartPieceGetPlayer : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID JSL HeartPieceGetPlayer : STA.w SprItemMWPlayer, X : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID
JSL LoadHeartPieceRoomValue JSL LoadHeartPieceRoomValue
JSL AttemptItemSubstitution STA.w SprSourceItemId, X
JSL ResolveLootIDLong JML RequestStandingItemVRAMSlot
STA.w SpriteID, X
JSL PrepDynamicTile_loot_resolved
.skip
PLA
RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
HeartContainerSpritePrep: HeartContainerSpritePrep:
PHA JSL HeartPieceGetPlayer : STA.w SprItemMWPlayer, X : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA.b #$00 : STA.l RedrawFlag
JSL HeartPieceGetPlayer : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID
JSL LoadHeartContainerRoomValue ; load item type JSL LoadHeartContainerRoomValue ; load item type
JSL AttemptItemSubstitution STA.w SprSourceItemId, X
JSL ResolveLootIDLong JML RequestStandingItemVRAMSlot
STA.w SpriteID, X
JSL PrepDynamicTile_loot_resolved
PLA
RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
LoadHeartPieceRoomValue: LoadHeartPieceRoomValue:
LDA.b IndoorsFlag : BEQ .outdoors ; check if we're indoors or outdoors LDA.b IndoorsFlag : BEQ .outdoors ; check if we're indoors or outdoors
@@ -153,6 +135,8 @@ LoadHeartPieceRoomValue:
.done .done
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
!DynamicDropGFXSlotCount_UW = (FreeUWGraphics_end-FreeUWGraphics)>>1
!DynamicDropGFXSlotCount_OW = (FreeOWGraphics_end-FreeOWGraphics)>>1
HPItemReset: HPItemReset:
PHA PHA
LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE .skip LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE .skip
@@ -162,7 +146,9 @@ HPItemReset:
.skip .skip
PLA PLA
.done .done
PHA : LDA.b #$01 : STA.l RedrawFlag : PLA PHA
JSL HeartPieceSetRedraw
PLA
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
MaybeMarkDigSpotCollected: MaybeMarkDigSpotCollected:
@@ -175,6 +161,13 @@ MaybeMarkDigSpotCollected:
PLP : PLA PLP : PLA
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
HeartPieceSpawnDelayFix:
JSL Sprite_DrawRippleIfInWater
; Fix the delay when spawning a HeartPiece sprite
JSL Sprite_CheckIfPlayerPreoccupied : BCS + ; what we moved from $05F037
JSL Sprite_CheckDamageToPlayerSameLayerLong : RTL ; what we wrote over
+ CLC : RTL
;--------------------------------------------------------------------------------
macro GetPossiblyEncryptedItem(ItemLabel,TableLabel) macro GetPossiblyEncryptedItem(ItemLabel,TableLabel)
LDA.l IsEncrypted : BNE ?encrypted LDA.l IsEncrypted : BNE ?encrypted
LDA.l <ItemLabel> LDA.l <ItemLabel>
@@ -215,6 +208,9 @@ LoadIndoorValue:
++ ++
%GetPossiblyEncryptedItem(HeartPiece_Graveyard_Warp, HeartPieceIndoorValues) %GetPossiblyEncryptedItem(HeartPiece_Graveyard_Warp, HeartPieceIndoorValues)
JMP .done JMP .done
+ CMP.w #288 : BNE +
LDA.l UWBonkPrizeData+3
JMP .done
+ CMP.w #294 : BNE + + CMP.w #294 : BNE +
%GetPossiblyEncryptedItem(HeartPiece_Mire_Warp, HeartPieceIndoorValues) %GetPossiblyEncryptedItem(HeartPiece_Mire_Warp, HeartPieceIndoorValues)
JMP .done JMP .done
@@ -227,7 +223,7 @@ LoadIndoorValue:
+ +
PHX PHX
LDX.w CurrentSpriteSlot ; If we're on a different screen ID via glitches load the sprite LDX.w CurrentSpriteSlot ; If we're on a different screen ID via glitches load the sprite
LDA.w SpriteID,X ; we can see and are interacting with LDA.w SprItemReceipt,X ; we can see and are interacting with
PLX PLX
.done .done
AND.w #$00FF ; the loads are words but the values are 1-byte so we need to clear the top half of the accumulator - no guarantee it was 8-bit before AND.w #$00FF ; the loads are words but the values are 1-byte so we need to clear the top half of the accumulator - no guarantee it was 8-bit before
@@ -246,7 +242,16 @@ LoadOutdoorValue:
PHP PHP
REP #$20 ; set 16-bit accumulator REP #$20 ; set 16-bit accumulator
LDA.b OverworldIndex LDA.b OverworldIndex
CMP.w #$03 : BNE + ; Rain state fix: In rain state DW, use LW screen ID for item lookup
BIT.w #$0040 : BEQ +
LDA.l ProgressIndicator : AND.w #$00FF : CMP.w #$0002
LDA.b OverworldIndex : BCS ++ : AND.w #$00BF
++
+
CMP.w #$00 : BNE +
LDA.l OWBonkPrizeTable[$00].loot
JMP .done
+ CMP.w #$03 : BNE +
LDA.b LinkPosX : CMP.w #1890 : !BLT ++ LDA.b LinkPosX : CMP.w #1890 : !BLT ++
%GetPossiblyEncryptedItem(HeartPiece_Spectacle, HeartPieceOutdoorValues) %GetPossiblyEncryptedItem(HeartPiece_Spectacle, HeartPieceOutdoorValues)
JMP .done JMP .done
@@ -254,14 +259,92 @@ LoadOutdoorValue:
%GetPossiblyEncryptedItem(EtherItem, SpriteItemValues) %GetPossiblyEncryptedItem(EtherItem, SpriteItemValues)
JMP .done JMP .done
+ CMP.w #$05 : BNE + + CMP.w #$05 : BNE +
%GetPossiblyEncryptedItem(HeartPiece_Mountain_Warp, HeartPieceOutdoorValues) LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$01].loot
JMP .done
++
%GetPossiblyEncryptedItem(HeartPiece_Mountain_Warp, HeartPieceOutdoorValues)
JMP .done
+ CMP.w #$0A : BNE +
LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$02].loot
JMP .done
++
LDA.l OWBonkPrizeTable[$03].loot
JMP .done
+ CMP.w #$10 : BNE +
LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$04].loot
JMP .done
++
LDA.l OWBonkPrizeTable[$05].loot
JMP .done
+ CMP.w #$11 : BNE +
LDA.l OWBonkPrizeTable[$06].loot
JMP .done
+ CMP.w #$12 : BNE +
LDA.l OWBonkPrizeTable[$07].loot
JMP .done
+ CMP.w #$13 : BNE +
LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$08].loot
JMP .done
++
LDA.l OWBonkPrizeTable[$09].loot
JMP .done
+ CMP.w #$15 : BNE +
LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$0A].loot
JMP .done
++
LDA.l OWBonkPrizeTable[$0B].loot
JMP .done
+ CMP.w #$18 : BNE +
LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$0C].loot
JMP .done
++
LDA.l OWBonkPrizeTable[$0D].loot
JMP .done
+ CMP.w #$1A : BNE +
LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$0E].loot
JMP .done
++
LDA.l OWBonkPrizeTable[$0F].loot
JMP .done
+ CMP.w #$1B : BNE +
LDA.l OWBonkPrizeTable[$10].loot
JMP .done
+ CMP.w #$1D : BNE +
LDA.l OWBonkPrizeTable[$11].loot
JMP .done
+ CMP.w #$1E : BNE +
LDA.l OWBonkPrizeTable[$12].loot
JMP .done JMP .done
+ CMP.w #$28 : BNE + + CMP.w #$28 : BNE +
%GetPossiblyEncryptedItem(HeartPiece_Maze, HeartPieceOutdoorValues) %GetPossiblyEncryptedItem(HeartPiece_Maze, HeartPieceOutdoorValues)
JMP .done JMP .done
+ CMP.w #$2A : BNE + + CMP.w #$2A : BNE +
%GetPossiblyEncryptedItem(HauntedGroveItem, HeartPieceOutdoorValues) LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$13].loot
JMP .done
++ CMP.w #$0008 : BNE ++
LDA.l OWBonkPrizeTable[$14].loot
JMP .done
++
%GetPossiblyEncryptedItem(HauntedGroveItem, HeartPieceOutdoorValues)
JMP .done
+ CMP.w #$2B : BNE +
LDA.l OWBonkPrizeTable[$15].loot
JMP .done JMP .done
+ CMP.w #$2E : BNE +
LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$16].loot
JMP .done
++
LDA.l OWBonkPrizeTable[$17].loot
JMP .done
+ CMP.w #$30 : BNE + + CMP.w #$30 : BNE +
LDA.b LinkPosX : CMP.w #512 : !BGE ++ LDA.b LinkPosX : CMP.w #512 : !BGE ++
%GetPossiblyEncryptedItem(HeartPiece_Desert, HeartPieceOutdoorValues) %GetPossiblyEncryptedItem(HeartPiece_Desert, HeartPieceOutdoorValues)
@@ -269,6 +352,13 @@ LoadOutdoorValue:
++ ++
%GetPossiblyEncryptedItem(BombosItem, SpriteItemValues) %GetPossiblyEncryptedItem(BombosItem, SpriteItemValues)
JMP .done JMP .done
+ CMP.w #$32 : BNE +
LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$18].loot
JMP .done
++
LDA.l OWBonkPrizeTable[$19].loot
JMP .done
+ CMP.w #$35 : BNE + + CMP.w #$35 : BNE +
%GetPossiblyEncryptedItem(HeartPiece_Lake, HeartPieceOutdoorValues) %GetPossiblyEncryptedItem(HeartPiece_Lake, HeartPieceOutdoorValues)
JMP .done JMP .done
@@ -276,24 +366,75 @@ LoadOutdoorValue:
%GetPossiblyEncryptedItem(HeartPiece_Swamp, HeartPieceOutdoorValues) %GetPossiblyEncryptedItem(HeartPiece_Swamp, HeartPieceOutdoorValues)
JMP .done JMP .done
+ CMP.w #$42 : BNE + + CMP.w #$42 : BNE +
%GetPossiblyEncryptedItem(HeartPiece_Cliffside, HeartPieceOutdoorValues) LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
JMP .done LDA.l OWBonkPrizeTable[$1A].loot
JMP .done
++
%GetPossiblyEncryptedItem(HeartPiece_Cliffside, HeartPieceOutdoorValues)
JMP .done
+ CMP.w #$4A : BNE + + CMP.w #$4A : BNE +
%GetPossiblyEncryptedItem(HeartPiece_Cliffside, HeartPieceOutdoorValues) %GetPossiblyEncryptedItem(HeartPiece_Cliffside, HeartPieceOutdoorValues)
JMP .done JMP .done
+ CMP.w #$51 : BNE +
LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$1B].loot
JMP .done
++
LDA.l OWBonkPrizeTable[$1C].loot
JMP .done
+ CMP.w #$54 : BNE +
LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$1D].loot
JMP .done
++ CMP.w #$0008 : BNE ++
LDA.l OWBonkPrizeTable[$1E].loot
JMP .done
++
LDA.l OWBonkPrizeTable[$1F].loot
JMP .done
+ CMP.w #$55 : BNE +
LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$20].loot
JMP .done
++
LDA.l OWBonkPrizeTable[$21].loot
JMP .done
+ CMP.w #$56 : BNE +
LDA.l OWBonkPrizeTable[$22].loot
JMP .done
+ CMP.w #$5B : BNE + + CMP.w #$5B : BNE +
%GetPossiblyEncryptedItem(HeartPiece_Pyramid, HeartPieceOutdoorValues) LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$23].loot
JMP .done
++
%GetPossiblyEncryptedItem(HeartPiece_Pyramid, HeartPieceOutdoorValues)
JMP .done
+ CMP.w #$5E : BNE +
LDA.l OWBonkPrizeTable[$24].loot
JMP .done JMP .done
+ CMP.w #$68 : BNE + + CMP.w #$68 : BNE +
%GetPossiblyEncryptedItem(HeartPiece_Digging, HeartPieceOutdoorValues) %GetPossiblyEncryptedItem(HeartPiece_Digging, HeartPieceOutdoorValues)
JMP .done JMP .done
+ CMP.w #$6E : BNE +
LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$25].loot
JMP .done
++ CMP.w #$0008 : BNE ++
LDA.l OWBonkPrizeTable[$26].loot
JMP .done
++
LDA.l OWBonkPrizeTable[$27].loot
JMP .done
+ CMP.w #$74 : BNE +
LDA.l OWBonkPrizeTable[$28].loot
JMP .done
+ CMP.w #$81 : BNE + + CMP.w #$81 : BNE +
%GetPossiblyEncryptedItem(HeartPiece_Zora, HeartPieceOutdoorValues) %GetPossiblyEncryptedItem(HeartPiece_Zora, HeartPieceOutdoorValues)
JMP .done JMP .done
+ +
PHX PHX
LDX.w CurrentSpriteSlot ; If we're on a different screen ID via glitches load the sprite LDX.w CurrentSpriteSlot ; If we're on a different screen ID via glitches load the sprite
LDA.w SpriteID,X ; we can see and are interacting with. LDA.w SprItemReceipt,X ; we can see and are interacting with.
PLX PLX
.done .done
AND.w #$00FF ; the loads are words but the values are 1-byte so we need to clear the top half of the accumulator - no guarantee it was 8-bit before AND.w #$00FF ; the loads are words but the values are 1-byte so we need to clear the top half of the accumulator - no guarantee it was 8-bit before
@@ -455,6 +596,9 @@ HeartPieceGetPlayer:
++ ++
LDA.l HeartPiece_Graveyard_Warp_Player LDA.l HeartPiece_Graveyard_Warp_Player
BRL .done BRL .done
+ CMP.w #288 : BNE +
LDA.l OWBonkPrizeTable[$2A].mw_player
BRL .done
+ CMP.w #294 : BNE + + CMP.w #294 : BNE +
LDA.l HeartPiece_Mire_Warp_Player LDA.l HeartPiece_Mire_Warp_Player
BRL .done BRL .done
@@ -468,7 +612,10 @@ HeartPieceGetPlayer:
PHP PHP
REP #$20 ; set 16-bit accumulator REP #$20 ; set 16-bit accumulator
LDA.b OverworldIndex LDA.b OverworldIndex
CMP.w #$03 : BNE + CMP.w #$00 : BNE +
LDA.l OWBonkPrizeTable[$00].mw_player
BRL .done
+ CMP.w #$03 : BNE +
LDA.b LinkPosX : CMP.w #1890 : !BLT ++ LDA.b LinkPosX : CMP.w #1890 : !BLT ++
LDA.l HeartPiece_Spectacle_Player LDA.l HeartPiece_Spectacle_Player
BRL .done BRL .done
@@ -476,14 +623,92 @@ HeartPieceGetPlayer:
LDA.l EtherItem_Player LDA.l EtherItem_Player
BRL .done BRL .done
+ CMP.w #$05 : BNE + + CMP.w #$05 : BNE +
LDA.l HeartPiece_Mountain_Warp_Player LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$01].mw_player
BRL .done
++
LDA.l HeartPiece_Mountain_Warp_Player
BRL .done
+ CMP.w #$0A : BNE +
LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$02].mw_player
BRL .done
++
LDA.l OWBonkPrizeTable[$03].mw_player
BRL .done
+ CMP.w #$10 : BNE +
LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$04].mw_player
BRL .done
++
LDA.l OWBonkPrizeTable[$05].mw_player
BRL .done
+ CMP.w #$11 : BNE +
LDA.l OWBonkPrizeTable[$06].mw_player
BRL .done
+ CMP.w #$12 : BNE +
LDA.l OWBonkPrizeTable[$07].mw_player
BRL .done
+ CMP.w #$13 : BNE +
LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$08].mw_player
BRL .done
++
LDA.l OWBonkPrizeTable[$09].mw_player
BRL .done
+ CMP.w #$15 : BNE +
LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$0A].mw_player
BRL .done
++
LDA.l OWBonkPrizeTable[$0B].mw_player
BRL .done
+ CMP.w #$18 : BNE +
LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$0C].mw_player
BRL .done
++
LDA.l OWBonkPrizeTable[$0D].mw_player
BRL .done
+ CMP.w #$1A : BNE +
LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$0E].mw_player
BRL .done
++
LDA.l OWBonkPrizeTable[$0F].mw_player
BRL .done
+ CMP.w #$1B : BNE +
LDA.l OWBonkPrizeTable[$11].mw_player
BRL .done
+ CMP.w #$1D : BNE +
LDA.l OWBonkPrizeTable[$12].mw_player
BRL .done
+ CMP.w #$1E : BNE +
LDA.l OWBonkPrizeTable[$13].mw_player
BRL .done BRL .done
+ CMP.w #$28 : BNE + + CMP.w #$28 : BNE +
LDA.l HeartPiece_Maze_Player LDA.l HeartPiece_Maze_Player
BRL .done BRL .done
+ CMP.w #$2A : BNE + + CMP.w #$2A : BNE +
LDA.l HauntedGroveItem_Player LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$14].mw_player
BRL .done
++ CMP.w #$0008 : BNE ++
LDA.l OWBonkPrizeTable[$15].mw_player
BRL .done
++
LDA.l HauntedGroveItem_Player
BRL .done
+ CMP.w #$2B : BNE +
LDA.l OWBonkPrizeTable[$16].mw_player
BRL .done BRL .done
+ CMP.w #$2E : BNE +
LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$17].mw_player
BRL .done
++
LDA.l OWBonkPrizeTable[$18].mw_player
BRL .done
+ CMP.w #$30 : BNE + + CMP.w #$30 : BNE +
LDA.b LinkPosX : CMP.w #512 : !BGE ++ LDA.b LinkPosX : CMP.w #512 : !BGE ++
LDA.l HeartPiece_Desert_Player LDA.l HeartPiece_Desert_Player
@@ -491,6 +716,13 @@ HeartPieceGetPlayer:
++ ++
LDA.l BombosItem_Player LDA.l BombosItem_Player
BRL .done BRL .done
+ CMP.w #$32 : BNE +
LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$19].mw_player
BRL .done
++
LDA.l OWBonkPrizeTable[$1A].mw_player
BRL .done
+ CMP.w #$35 : BNE + + CMP.w #$35 : BNE +
LDA.l HeartPiece_Lake_Player LDA.l HeartPiece_Lake_Player
BRL .done BRL .done
@@ -498,17 +730,68 @@ HeartPieceGetPlayer:
LDA.l HeartPiece_Swamp_Player LDA.l HeartPiece_Swamp_Player
BRL .done BRL .done
+ CMP.w #$42 : BNE + + CMP.w #$42 : BNE +
LDA.l HeartPiece_Cliffside_Player LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
BRL .done LDA.l OWBonkPrizeTable[$1B].mw_player
BRL .done
++
LDA.l HeartPiece_Cliffside_Player
BRL .done
+ CMP.w #$4A : BNE + + CMP.w #$4A : BNE +
LDA.l HeartPiece_Cliffside_Player LDA.l HeartPiece_Cliffside_Player
BRL .done BRL .done
+ CMP.w #$51 : BNE +
LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$1C].mw_player
BRL .done
++
LDA.l OWBonkPrizeTable[$1D].mw_player
BRL .done
+ CMP.w #$54 : BNE +
LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$1E].mw_player
BRL .done
++ CMP.w #$0008 : BNE ++
LDA.l OWBonkPrizeTable[$1F].mw_player
BRL .done
++
LDA.l OWBonkPrizeTable[$20].mw_player
BRL .done
+ CMP.w #$55 : BNE +
LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$21].mw_player
BRL .done
++
LDA.l OWBonkPrizeTable[$22].mw_player
BRL .done
+ CMP.w #$56 : BNE +
LDA.l OWBonkPrizeTable[$23].mw_player
BRL .done
+ CMP.w #$5B : BNE + + CMP.w #$5B : BNE +
LDA.l HeartPiece_Pyramid_Player LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$24].mw_player
BRL .done
++
LDA.l HeartPiece_Pyramid_Player
BRL .done
+ CMP.w #$5E : BNE +
LDA.l OWBonkPrizeTable[$25].mw_player
BRL .done BRL .done
+ CMP.w #$68 : BNE + + CMP.w #$68 : BNE +
LDA.l HeartPiece_Digging_Player LDA.l HeartPiece_Digging_Player
BRL .done BRL .done
+ CMP.w #$6E : BNE +
LDA.w SpriteSpawnStep,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$26].mw_player
BRL .done
++ CMP.w #$0008 : BNE ++
LDA.l OWBonkPrizeTable[$27].mw_player
BRL .done
++
LDA.l OWBonkPrizeTable[$28].mw_player
BRL .done
+ CMP.w #$74 : BNE +
LDA.l OWBonkPrizeTable[$29].mw_player
BRL .done
+ CMP.w #$81 : BNE + + CMP.w #$81 : BNE +
LDA.l HeartPiece_Zora_Player LDA.l HeartPiece_Zora_Player
BRL .done BRL .done
@@ -521,3 +804,81 @@ HeartPieceGetPlayer:
PLY PLY
RTL RTL
} }
;--------------------------------------------------------------------------------
BossPrizeGetPlayer:
{
PHP
REP #$20 ; set 16-bit accumulator
LDA.b RoomIndex ; these are all decimal because i got them that way
CMP.w #200 : BNE +
LDA.l Prize_ArmosKnights_Player
BRA .done
+ CMP.w #51 : BNE +
LDA.l Prize_Lanmolas_Player
BRA .done
+ CMP.w #7 : BNE +
LDA.l Prize_Moldorm_Player
BRA .done
+ CMP.w #90 : BNE +
LDA.l Prize_HelmasaurKing_Player
BRA .done
+ CMP.w #6 : BNE +
LDA.l Prize_Arrghus_Player
BRA .done
+ CMP.w #41 : BNE +
LDA.l Prize_Mothula_Player
BRA .done
+ CMP.w #172 : BNE +
LDA.l Prize_Blind_Player
BRA .done
+ CMP.w #222 : BNE +
LDA.l Prize_Kholdstare_Player
BRA .done
+ CMP.w #144 : BNE +
LDA.l Prize_Vitreous_Player
BRA .done
+ CMP.w #164 : BNE +
LDA.l Prize_Trinexx_Player
BRA .done
+
LDA.w #$0000
.done
AND.w #$00FF ; the loads are words but the values are 1-byte so we need to clear the top half of the accumulator - no guarantee it was 8-bit before
PLP
RTL
}
;--------------------------------------------------------------------------------
HeartPieceSetRedraw:
PHY
LDY.b #$0F
.next
LDA.w SpriteAITable,Y : BEQ ++
LDA.w SpriteTypeTable,Y : CMP.b #$EB : BEQ + ; heart piece
CMP.b #$E4 : BEQ + ; enemy key drop
CMP.b #$3B : BEQ + ; bonk item (book/key)
CMP.b #$E5 : BEQ + ; enemy big key drop
CMP.b #$E7 : BEQ + ; mushroom item
CMP.b #$E9 : BEQ + ; powder item
BRA ++
+ LDA.b #$01 : STA.w SprRedrawFlag,Y
++ DEY : BPL .next
PLY
RTL
HeartPieceGetRedraw:
PHY
LDY.b #$0F
.next
LDA.w SpriteAITable,Y : BEQ ++
LDA.w SpriteTypeTable,Y : CMP.b #$EB : BEQ + ; heart piece
CMP.b #$E4 : BEQ + ; enemy key drop
CMP.b #$3B : BEQ + ; bonk item (book/key)
CMP.b #$E5 : BEQ + ; enemy big key drop
CMP.b #$E7 : BEQ + ; mushroom item
CMP.b #$E9 : BEQ + ; powder item
BRA ++
+ LDA.w SprRedrawFlag,Y : BEQ ++
PLY : SEC : RTL
++ DEY : BPL .next
PLY
CLC : RTL

305
hooks.asm Normal file → Executable file
View File

@@ -39,6 +39,9 @@ org $80821B ; <- 21B - Bank00.asm : 329 (LDA $13 : STA $2100)
JML PostNMIHookAction : NOP JML PostNMIHookAction : NOP
PostNMIHookReturn: PostNMIHookReturn:
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $808F6C
JSL PostNMIUpdateBGCharHalf : NOP
;--------------------------------------------------------------------------------
;================================================================================ ;================================================================================
; Anti-ZSNES Hook ; Anti-ZSNES Hook
@@ -147,8 +150,15 @@ JSL JumpDownLedge : NOP #4
;================================================================================ ;================================================================================
; Bonk Recoil ; Bonk Recoil
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $87922C ; 3922C <- Bank07.asm : 2869 (LDA.b #$24 : STA $29) ;org $87922C ; 3922C <- Bank07.asm : 2869 (LDA.b #$24 : STA $29)
JSL BonkRecoil ;JSL BonkRecoil
;--------------------------------------------------------------------------------
;================================================================================
; Bonk Recoil Over Pit
;--------------------------------------------------------------------------------
org $87883B
JSL BonkRecoilStop
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
;================================================================================ ;================================================================================
@@ -397,6 +407,16 @@ STA.l StalfosBombDamage
org $8AB76E ; <- 5376E - Bank0A.asm : 30 (JSL OverworldMap_InitGfx) org $8AB76E ; <- 5376E - Bank0A.asm : 30 (JSL OverworldMap_InitGfx)
JSL OnLoadDuckMap JSL OnLoadDuckMap
;================================================================================
; Fix Clobbered Gfx
;--------------------------------------------------------------------------------
org $80DB92
JSL PostFixMirrorGfxPrep
org $80D911
JML PostFixMirrorGfx
org $80E259
JSL PostFixOAMGfx : NOP
;================================================================================ ;================================================================================
; Infinite Bombs / Arrows / Magic ; Infinite Bombs / Arrows / Magic
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -465,8 +485,12 @@ JSL GanonTowerInvertedCheck
org $82EC8D ; <- bank02.asm : 11981 (LDA.w #$020F : LDX $8A : CPX.w #$0033 : BNE .noRock) org $82EC8D ; <- bank02.asm : 11981 (LDA.w #$020F : LDX $8A : CPX.w #$0033 : BNE .noRock)
JSL HardcodedRocks : NOP #19 ;23 bytes removed with the JSL JSL HardcodedRocks : NOP #19 ;23 bytes removed with the JSL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $84E7AE ; <- bank0E.asm : 4230 (LDA $7EF287 : AND.w #$0020) ;org $84E7AE ; <- bank0E.asm : 4230 (LDA $7EF287 : AND.w #$0020)
JSL TurtleRockPegSolved ;JSL TurtleRockPegSolved
;--------------------------------------------------------------------------------
org $9BCAA1 ; <- bank_1B.asm (LDA.w #$0212 : LDX.w #$0720 : STA.l $7E2000,X : JSL : JSL)
JSL Overworld_InvertedTRPuzzle
BRA + : NOP #12 : +
org $84E7B9 ; <- bank0E.asm : 4237 (LDX $04C8) org $84E7B9 ; <- bank0E.asm : 4237 (LDX $04C8)
JMP TurtleRockTrollPegs JMP TurtleRockTrollPegs
@@ -516,6 +540,8 @@ JML GTCutscene_ConditionalAnimateCrystals
org $88CE93 org $88CE93
GTCutscene_DrawSingleCrystal: GTCutscene_DrawSingleCrystal:
JML GTCutscene_ConditionalDrawSingleCrystal JML GTCutscene_ConditionalDrawSingleCrystal
org $88CED1
JSL AncillaDraw_GTCutsceneCrystal_OAMPrep : BRA + : NOP #3 : +
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $88CF19 ; <- 44F19 - ancilla_break_tower_seal.asm : 336 (TXA : AND.b #$07 : TAX) org $88CF19 ; <- 44F19 - ancilla_break_tower_seal.asm : 336 (TXA : AND.b #$07 : TAX)
JSL GTCutscene_ActivateSparkle_SelectCrystal JSL GTCutscene_ActivateSparkle_SelectCrystal
@@ -541,12 +567,6 @@ JSL AgahnimAsksAboutPed
org $9ED6E8 org $9ED6E8
JSL CheckAgaForPed : NOP JSL CheckAgaForPed : NOP
;================================================================================
; Zelda Sprite Fixes
;--------------------------------------------------------------------------------
org $85EBCF ; <- 2EBCF - sprite_zelda.asm : 23 (LDA $7EF359 : CMP.b #$02 : BCS .hasMasterSword)
JSL SpawnZelda : NOP #2
;================================================================================ ;================================================================================
; Alternate Goal ; Alternate Goal
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -674,12 +694,6 @@ db $06, $1F, $40, $12, $01, $3F, $14, $01, $3F, $13, $1F, $42, $1A, $1F, $4B, $1
org $85DFB1 ; <- 2DFB1 - Bank05.asm : 2499 org $85DFB1 ; <- 2DFB1 - Bank05.asm : 2499
JSL SkipDrawEOR JSL SkipDrawEOR
;================================================================================
; Kiki Big Bomb Fix
;--------------------------------------------------------------------------------
org $9EE4AF ; <- f64af sprite_kiki.asm : 285 (LDA.b #$0A : STA $7EF3CC)
JSL AssignKiki : NOP #2
;================================================================================ ;================================================================================
; Wallmaster camera fix ; Wallmaster camera fix
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -826,15 +840,10 @@ JSL LoadModifiedIceFloorValue_a01 : NOP
org $83FC16 ; <- 1FC16 ($A8, $B8, $3D, $D0, $B8, $3D) org $83FC16 ; <- 1FC16 ($A8, $B8, $3D, $D0, $B8, $3D)
db $B1, $C6, $F9, $C9, $C6, $F9 ; data insert - 2 chests, fat fairy room db $B1, $C6, $F9, $C9, $C6, $F9 ; data insert - 2 chests, fat fairy room
; unused item receipts ; unused item receipts - moved to pyramid fairy
org $81E97E org $81E97E
dw $0116 : db $08 dw $0116 : db $5E
dw $0116 : db $25 dw $0116 : db $64
;--------------------------------------------------------------------------------
org $9EE16E ; <- F616E - sprite_bomb_shop_entity.asm : 73
NOP #8 ; fix bomb shop dialog for dwarfless big bomb
org $868A14 ; <- 30A14 - sprite_prep.asm : 716
NOP #8 ; fix bomb shop spawn for dwarfless big bomb
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $86B489 ; <- 33489 - sprite_smithy_bros.asm : 473 (LDA $7EF359 : CMP.b #$03 : BCS .tempered_sword_or_better) org $86B489 ; <- 33489 - sprite_smithy_bros.asm : 473 (LDA $7EF359 : CMP.b #$03 : BCS .tempered_sword_or_better)
JML GetSmithSword : NOP #4 JML GetSmithSword : NOP #4
@@ -896,6 +905,9 @@ org $87B574 ; <- 3B574 - Bank07.asm : 8519 (LDA.b #$01 : STA $02E9)
JSL ChestPrep : NOP #3 JSL ChestPrep : NOP #3
db $90 ; !BCC .cantOpen db $90 ; !BCC .cantOpen
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $808A9D
JSL ConditionalPushBlockTransfer : NOP
org $80D531 ; 5531 - Bank00.asm:3451 (LDY.b #$5D) org $80D531 ; 5531 - Bank00.asm:3451 (LDY.b #$5D)
JML GetAnimatedSpriteGfxFile JML GetAnimatedSpriteGfxFile
@@ -905,8 +917,15 @@ GetAnimatedSpriteGfxFile_return:
org $80D557 ; 5557 - Bank00.asm:3486 (LDA $00 : ADC $D469, X) org $80D557 ; 5557 - Bank00.asm:3486 (LDA $00 : ADC $D469, X)
JSL GetAnimatedSpriteBufferPointer : NOP JSL GetAnimatedSpriteBufferPointer : NOP
org $85FA50
JSL Sprite_ConditionalPrepOAMCoord
org $8799F7 ; 399F7 - Bank07.asm:4107 (JSL AddReceivedItem) org $8799F7 ; 399F7 - Bank07.asm:4107 (JSL AddReceivedItem)
JSL AddReceivedItemExpanded JSL AddReceivedItemExpanded
BRA Link_ReceiveItem_HUDRefresh
org $88C505
JSL Ancilla22_ItemReceipt_ContinueB : NOP #2
org $898605 ; 48605 - ancilla_init.asm:709 (TYA : STA $02E4 : PHX) org $898605 ; 48605 - ancilla_init.asm:709 (TYA : STA $02E4 : PHX)
JML Multiworld_AddReceivedItem_notCrystal JML Multiworld_AddReceivedItem_notCrystal
@@ -976,6 +995,11 @@ LDA.w PotionListExpanded, X
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $86D1EB ; 351EB - sprite_absorbable.asm:364 (STA $7EF375) ; bugbug commented out until i figure out why it doesn't work org $86D1EB ; 351EB - sprite_absorbable.asm:364 (STA $7EF375) ; bugbug commented out until i figure out why it doesn't work
JSL HandleBombAbsorbtion JSL HandleBombAbsorbtion
;--------------------------------------------------------------------------------
org $82EB18
JSL PostOverworldGfxLoad
org $98BD55
JSL PostUnderworldMap
;================================================================================ ;================================================================================
; Kholdstare Shell Fix ; Kholdstare Shell Fix
@@ -1031,13 +1055,17 @@ org $8799EA : JML SetItemPose
org $88C415 : JSL PendantMusicCheck org $88C415 : JSL PendantMusicCheck
BCS Ancilla22_ItemReceipt_is_pendant : BRA Ancilla22_ItemReceipt_wait_for_music BCS Ancilla22_ItemReceipt_is_pendant : BRA Ancilla22_ItemReceipt_wait_for_music
;org $88C452 : JSL MaybeKeepLootID : NOP #2 DR overwrote hook see RetrieveBunnyState ;org $88C452 : JSL MaybeKeepLootID : NOP #2 DR overwrote hook see RetrieveBunnyState
org $88C469 : JSL MaybeSkipHeartRefill : db $90 ;BCC
org $88C61D : JSL AnimatePrizeCutscene : NOP org $88C61D : JSL AnimatePrizeCutscene : NOP
org $88C622 : BCC ItemReceipt_Animate_continue org $88C622 : BCC ItemReceipt_Animate_continue
org $88C6BA : JSL CheckPoseItemCoordinates org $88C6BA : JSL CheckPoseItemCoordinates
org $88C6C3 : JSL PrepPrizeVRAMHigh
org $88C6F4 : JSL PrepPrizeVRAMLow
org $88CAD6 : JSL HandleDropSFX : NOP #2 org $88CAD6 : JSL HandleDropSFX : NOP #2
org $88CADC : BCC Ancilla29_MilestoneItemReceipt_skip_crystal_sfx org $88CADC : BCC Ancilla29_MilestoneItemReceipt_skip_crystal_sfx
org $88CAE9 : JSL PrepPrizeTile org $88CAE9 : JSL PrepPrizeTile
org $88CB23 : JSL PrizeDropSparkle : BCC Ancilla29_MilestoneItemReceipt_no_sparkle : NOP #2 org $88CB23 : JSL PrizeDropSparkle : BCC Ancilla29_MilestoneItemReceipt_no_sparkle : NOP #2
org $88CB6A : JSL PrizeReceiveItem
org $88CB97 : JSL PrepPrizeOAMCoordinates : BRA + : NOP #$12 : + org $88CB97 : JSL PrepPrizeOAMCoordinates : BRA + : NOP #$12 : +
org $88CBFF : JSL PrepPrizeShadow org $88CBFF : JSL PrepPrizeShadow
org $88CC6C : JSL HandleCrystalsField org $88CC6C : JSL HandleCrystalsField
@@ -1228,11 +1256,14 @@ JSL SpawnHauntedGroveItem
org $87A3A2 ; 3A3A2 - Bank07.asm : 5720 - JSL DiggingGameGuy_AttemptPrizeSpawn org $87A3A2 ; 3A3A2 - Bank07.asm : 5720 - JSL DiggingGameGuy_AttemptPrizeSpawn
JSL SpawnShovelItem JSL SpawnShovelItem
BRA _Bank07_5726 BRA _Bank07_5726
org $9DFDAC
JSL SpawnShovelGamePrize
org $87A3AB ; 3A3AB - Bank07.asm : 5726 - LDA.b #$12 : JSR Player_DoSfx2 org $87A3AB ; 3A3AB - Bank07.asm : 5726 - LDA.b #$12 : JSR Player_DoSfx2
_Bank07_5726: _Bank07_5726:
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $879A0E ; 39A0E - Bank07.asm : 4117 - JSL HUD.RefreshIconLong org $879A0E ; 39A0E - Bank07.asm : 4117 - JSL HUD.RefreshIconLong
JSL Link_ReceiveItem_HUDRefresh Link_ReceiveItem_HUDRefresh:
JSL HUDRefresh
;================================================================================ ;================================================================================
; Swordless Mode ; Swordless Mode
@@ -1272,6 +1303,10 @@ JSL SpawnTabletItem
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $85EF1E ; LDA.l $7EF280,X : AND #$40 org $85EF1E ; LDA.l $7EF280,X : AND #$40
JSL CheckTabletItem : NOP #2 JSL CheckTabletItem : NOP #2
;--------------------------------------------------------------------------------
org $85EFFA ; <- 2EFFA - sprite_heart_upgrades.asm : 216 (LDA $7EF280, X : ORA.b #$40 : STA $7EF280, X)
JSL.l SaveTabletItem
NOP #6
;================================================================================ ;================================================================================
; Medallion Entrances ; Medallion Entrances
@@ -1672,14 +1707,6 @@ org $82B15C ; <- 1315C - Bank02.asm:7672 - (LDA $7EF3CA : EOR.b #$40 : STA $7EF3
JSL IncrementOWMirror JSL IncrementOWMirror
JSL FlipLWDWFlag : NOP #2 JSL FlipLWDWFlag : NOP #2
;================================================================================ ;================================================================================
;org $8AC5BB ; < 545BB - Bank0A.asm:1856 - (LDA $7EF3C7 : CMP.b #$03 : BNE .fail)
;JSL OverworldMap_CheckObject : RTS
;org $8AC5D8 ; < 545D8 - Bank0A.asm:1885 - (LDA $7EF3C7 : CMP.b #$07 : BNE OverworldMap_CheckPendant_fail)
;JSL OverworldMap_CheckObject : RTS
;================================================================================
org $8AC53E ; <- 5453E - Bank0A.asm:1771 - (LDA $0AC50D, X : STA $0D)
LDA.l CrystalNumberTable-1,X
;================================================================================
; EVERY INSTANCE OF STA $7EF3C7 IN THE ENTIRE CODEBASE ; EVERY INSTANCE OF STA $7EF3C7 IN THE ENTIRE CODEBASE
org $829D51 : JSL SetLWDWMap org $829D51 : JSL SetLWDWMap
org $8589BB : JSL SetLWDWMap org $8589BB : JSL SetLWDWMap
@@ -1700,21 +1727,14 @@ org $85FF7D : JSL GetMapMode
org $8AC01A : JSL GetMapMode org $8AC01A : JSL GetMapMode
org $8DC849 : JSL GetMapMode org $8DC849 : JSL GetMapMode
;================================================================================ ;================================================================================
org $8AC012 ; <- 54012 - Bank0A.asm:1039 (LDA $7EF2DB : AND.b #$20 : BNE BRANCH_DELTA) org $828B8F ; <- 10B8F - Bank02.asm:2236 (LDA $7EF374 : LSR A)
NOP #8 JSL CheckHeraBossDefeated : NOP
;================================================================================
org $828B8F ; <- 10B8F - Bank02.asm:2236 (LDA $7EF374 : LSR A : BCS BRANCH_BETA)
JSL CheckHeraBossDefeated : BNE + : NOP
LDX.b #$F1 : STX.w MusicControlRequest
+
;================================================================================ ;================================================================================
org $828D6E org $828D6E
JSL FallingMusicFadeOut : BRA + : NOP #2 : + JSL FallingMusicFadeOut : BRA + : NOP #2 : +
;================================================================================ ;================================================================================
org $829090 ; <- 11090 - Bank02.asm:3099 (LDA $7EF374 : LSR A : BCS BRANCH_GAMMA) org $829090 ; <- 11090 - Bank02.asm:3099 (LDA $7EF374 : LSR A)
JSL CheckHeraBossDefeated : BNE + : NOP JSL CheckHeraBossDefeated_AlsoCheckMusic : NOP
STX.w MusicControlRequest ; DON'T MOVE THIS FORWARD OR MADNESS AWAITS
+
;================================================================================ ;================================================================================
org $829798 ; <- 11798 - Bank02.asm:4287 (CMP $02895C, X : BNE BRANCH_ALPHA) org $829798 ; <- 11798 - Bank02.asm:4287 (CMP $02895C, X : BNE BRANCH_ALPHA)
NOP #6 ; remove crystal room cutscene check that causes softlocks NOP #6 ; remove crystal room cutscene check that causes softlocks
@@ -1794,7 +1814,9 @@ Sprite_ShowMessageUnconditional_Rest:
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
;-- Music restarting at zelda fix ;-- Music restarting at zelda fix
org $85ED10 ; <- 2ED10 - sprite_zelda.asm : 233 - (LDA.b #$19 : STA $012C) org $85ED10 ; <- 2ED10 - sprite_zelda.asm : 233 - (LDA.b #$19 : STA $012C)
NOP #5 BRA + : NOP #3 : +
org $85ED63
BRA + : NOP #3 : +
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $9ECE47 ; <- F4E47 - sprite_crystal_maiden.asm : 220 org $9ECE47 ; <- F4E47 - sprite_crystal_maiden.asm : 220
JML MaidenCrystalScript JML MaidenCrystalScript
@@ -1802,6 +1824,9 @@ JML MaidenCrystalScript
org $9ECCEB ; <- F4CEB - sprite_crystal_maiden.asm : 25 ; skip all palette nonsense org $9ECCEB ; <- F4CEB - sprite_crystal_maiden.asm : 25 ; skip all palette nonsense
BRA CrystalCutscene_Initialize_skip_palette BRA CrystalCutscene_Initialize_skip_palette
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $9ECD97
JSL MaybeSkipCrystalCutsceneFollowerReset
;--------------------------------------------------------------------------------
org $88C3FD ; <- 443FD - ancilla_receive_item.asm : 89 org $88C3FD ; <- 443FD - ancilla_receive_item.asm : 89
BRA + : NOP #4 : + BRA + : NOP #4 : +
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -1853,11 +1878,17 @@ JSL CalculateSignIndex
; Dark World Spawn Location Fix & Follower Fixes ; Dark World Spawn Location Fix & Follower Fixes
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $80894A ; <- 94A org $80894A ; <- 94A
PHB : JSL DarkWorldSaveFix PHB : JSL OnSave
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $828046 ; <- 10046 - Bank02.asm : 217 (JSL EnableForceBlank) (Start of Module_LoadFile) org $828046 ; <- 10046 - Bank02.asm : 217 (JSL EnableForceBlank) (Start of Module_LoadFile)
JSL OnFileLoad JSL OnFileLoad
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $89F5DF
JSL OnDeathNoSave
;--------------------------------------------------------------------------------
org $8280A2
JSL GetCurrentWorldForLoad
;--------------------------------------------------------------------------------
org $89F520 ; <- 4F520 - module_death.asm : 401 (LDA $7EF3C5 : CMP.b #$03 : BCS BRANCH_THETA) org $89F520 ; <- 4F520 - module_death.asm : 401 (LDA $7EF3C5 : CMP.b #$03 : BCS BRANCH_THETA)
JSL OnPlayerDead JSL OnPlayerDead
JSL IncrementDeathCounter : NOP #6 JSL IncrementDeathCounter : NOP #6
@@ -2015,6 +2046,12 @@ AddReceivedItem_doneWithSoundEffects:
org $85F030 ; <- 2F030 - display item org $85F030 ; <- 2F030 - display item
JSL DrawHeartPieceGFX JSL DrawHeartPieceGFX
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; moving LinkBusy check to later time to avoid a delay in HP movement
org $85F037 ; (JSL CheckIfLinkIsBusy : BCS .exit)
BRA + : NOP #4 : +
org $85F083
JSL HeartPieceSpawnDelayFix
;--------------------------------------------------------------------------------
org $85F08A ; <- 2F08A - sprite_heart_upgrades.asm : 324 - (LDA $7EF36B : INC A : AND.b #$03 : STA $7EF36B : BNE .got_4_piecese) item determination org $85F08A ; <- 2F08A - sprite_heart_upgrades.asm : 324 - (LDA $7EF36B : INC A : AND.b #$03 : STA $7EF36B : BNE .got_4_piecese) item determination
JSL HeartPieceGet JSL HeartPieceGet
JSL DynamicDrawCleanup JSL DynamicDrawCleanup
@@ -2048,6 +2085,9 @@ JSL OnLinkDamagedFromPit
org $81FFE7 ; <- FFE7 - Bank01.asm:16375 (LDA $7EF36D) org $81FFE7 ; <- FFE7 - Bank01.asm:16375 (LDA $7EF36D)
JSL OnLinkDamagedFromPitOutdoors JSL OnLinkDamagedFromPitOutdoors
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
;org $878F27 ; <- 38F27
;JSL FlipperReset
;--------------------------------------------------------------------------------
org $82B468 org $82B468
dw FakeFlipperProtection dw FakeFlipperProtection
@@ -2057,6 +2097,9 @@ FakeFlipperProtection:
JSL protectff JSL protectff
RTS RTS
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $82B46C ; <- bank_02.asm:9722 (STZ.b $00 : STZ.b $02)
JSL FlipperScrollWarp
;--------------------------------------------------------------------------------
;org $878F51 ; <- 38F51 - Bank07.asm:2444 (JSR $AE54 ; $3AE54 IN ROM) ;org $878F51 ; <- 38F51 - Bank07.asm:2444 (JSR $AE54 ; $3AE54 IN ROM)
;JSL OnEnterWater : NOP ;JSL OnEnterWater : NOP
;================================================================================ ;================================================================================
@@ -2139,6 +2182,9 @@ JSL LampCheck
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $81F503 ; <- F503 - Bank01.asm:14994 (LDA.b #$01 : STA $1D) org $81F503 ; <- F503 - Bank01.asm:14994 (LDA.b #$01 : STA $1D)
JSL SetOverlayIfLamp JSL SetOverlayIfLamp
;--------------------------------------------------------------------------------
org $81B610 ; <- loading whether room is dark
JSL DarkRoomCheck
;================================================================================ ;================================================================================
;================================================================================ ;================================================================================
@@ -2195,17 +2241,63 @@ org $82A9B0 ; (BCS $A9B7)
NOP #2 NOP #2
org $82C1C8 ; (BCS $C1CC) org $82C1C8 ; (BCS $C1CC)
NOP #2 NOP #2
org $82ADA0 ; (LDA.b #$F1 : STA $012C)
JSL Overworld_MosaicDarkWorldChecks : NOP
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $85CC58 ; <- Bank05.asm:1307 (LDA $040A : CMP.b #$18) org $85CC58 ; <- Bank05.asm:1307 (LDA $040A : CMP.b #$18)
JSL PsychoSolder_MusicCheck : NOP #1 JSL PsychoSolder_MusicCheck : NOP #1
org $86F96A
JSL PsychoSolder_MusicCheck : NOP #1
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $82B13A ; <- Bank02.asm:7647 org $82B13A ; <- Bank02.asm:7647
dl Overworld_FinishMirrorWarp dl Overworld_FinishMirrorWarp
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $8AB949 ; <- Bank0A.asm:270 (Different from US ROM) org $8AB949 ; <- Bank0A.asm:270 (Different from US ROM)
JSL BirdTravel_LoadTargetAreaMusic : NOP #16 JSL BirdTravel_LoadTargetAreaMusic
BRA + : NOP #14 : +
;--------------------------------------------------------------------------------
org $829D42
JSL Overworld_DetermineMusic
BRA + : NOP #4 : +
;--------------------------------------------------------------------------------
org $82A981
JSL Overworld_DetermineAndSetMusic : NOP
;--------------------------------------------------------------------------------
org $82B027 ; <- Bank02.asm:7535-7541
JSL Overworld_DetermineMusic
BRA + : NOP #42 : +
;--------------------------------------------------------------------------------
org $82B0C4
LDA.b OverworldIndex : CMP.b #$80 : BCS +
JSL Overworld_DetermineAndSetMusic
BRA + : NOP #10 : +
;--------------------------------------------------------------------------------
org $82B1C1
JSL Overworld_DetermineAmbientSFX
JSL Overworld_DetermineMusic
BRA + : NOP #64 : +
;--------------------------------------------------------------------------------
org $82B441
JSL Overworld_DetermineMusic
BRA + : NOP #4 : +
;--------------------------------------------------------------------------------
org $82C1BA
JSL Overworld_DetermineMusic
BRA + : NOP #12 : +
;--------------------------------------------------------------------------------
org $88C442
JSL Overworld_DetermineAndSetMusic : NOP
;--------------------------------------------------------------------------------
org $9BD1CD
JSL Overworld_DetermineAndSetMusic : NOP
;--------------------------------------------------------------------------------
org $9DFD27
JSL Overworld_DetermineAndSetMusic : NOP
;--------------------------------------------------------------------------------
org $829253
JSL FixHalfVolumeOnSpawnExitToOverworld : NOP
;--------------------------------------------------------------------------------
org $8292D9
BRA + : NOP #4 : +
JSL FixPreAgaMusicFadeOut : db $B0 ; BCS
;================================================================================ ;================================================================================
;================================================================================ ;================================================================================
@@ -2264,24 +2356,6 @@ org $82A451 ; <- 12451 - Bank02.asm:6283 (LDA $F6 : AND.b #$40 : BEQ .xButtonNot
JSL QuickSwap JSL QuickSwap
;================================================================================ ;================================================================================
;================================================================================
; Tagalong Fixes
;--------------------------------------------------------------------------------
org $8689AB ; <- 309AB - sprite_prep.asm: 647 (LDA $7EF3CC : CMP.b #$06 : BEQ .killSprite)
; Note: In JP 1.0 we have: (CMP.b #$00 : BNE .killSprite) appling US bugfix
; Prevent followers from causing blind/maiden to despawn:
; Door rando: let zelda despawn the maiden.
JSL BlindZeldaDespawnFix
org $8689AF
SpritePrep_BlindMaiden_despawn_follower: ; this is the normal execution path
org $8689C9
SpritePrep_BlindMaiden_kill_the_girl: ; not the follower
;--------------------------------------------------------------------------------
; Fix old man purple chest issues using the same method as above
org $9EE906 ; <- F6906 - sprite_old_mountain_man.asm : 31 (LDA $7EF3CC : CMP.b #$00 : BNE .already_have_tagalong)
CMP.b #$04 : db $F0 ; BEQ
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
;Control which doors frog/smith can enter ;Control which doors frog/smith can enter
org $9BBCF0 ; <- DBCF0 - Bank1B.asm: 248 (LDA $04B8 : BNE BRANCH_MU) org $9BBCF0 ; <- DBCF0 - Bank1B.asm: 248 (LDA $04B8 : BNE BRANCH_MU)
@@ -2357,8 +2431,8 @@ JSL NewElderCode
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; Add him to Castle Map post-rain, and post aga1 ; Add him to Castle Map post-rain, and post aga1
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $89D0AC org $89D0A9
db $18, $0F, $43, $FF ; remove heart from tree adjancent map [LW1] db $18, $0A, $D8, $18, $0F, $43, $FF ; remove heart from tree adjancent map [LW1]
db $12, $19, $16 ; add sahasrala in castle Y, X, Sprite ID db $12, $19, $16 ; add sahasrala in castle Y, X, Sprite ID
org $89C937 org $89C937
db $B0, $D0 ; change [LW1] map 01C pointers db $B0, $D0 ; change [LW1] map 01C pointers
@@ -2593,7 +2667,7 @@ org $898AEE : JSL TransferItemReceiptToBuffer_using_GraphicsID
org $898C85 : JSL TransferItemReceiptToBuffer_using_GraphicsID org $898C85 : JSL TransferItemReceiptToBuffer_using_GraphicsID
; gt cutscene ; gt cutscene
org $899BBE : JSL TransferItemReceiptToBuffer_using_GraphicsID org $899BBE : JSL GTCutscene_TransferGfx
;=================================================================================================== ;===================================================================================================
; gratuitous NOPs removed for speed ; gratuitous NOPs removed for speed
@@ -2655,5 +2729,92 @@ NOP #2 ; this fixes Link's direction after mirroring and falling after entering
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; Enable new room header table ; Enable new room header table
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $81B5E6 if not(!FEATURE_FIX_BASEROM)
LDA.b #$30 org $81B5E6
LDA.b #$30
endif
;================================================================================
;--------------------------------------------------------------------------------
; Mimic dash changes
;--------------------------------------------------------------------------------
org $9EC7BE
JSL MimicDirection
;================================================================================
;--------------------------------------------------------------------------------
; Gloom VRAM overwrite
;--------------------------------------------------------------------------------
org $828068
JSL AdjustDefaultGraphics
;================================================================================
; Special Weapons Modes
;--------------------------------------------------------------------------------
org $86ECC3 ; Bank06.asm@4704 (PHX : TAX : LDA.l .damage_classes, X : PLX)
JSL DamageClassCalc
BRA + : NOP #29 : +
;--------------------------------------------------------------------------------
org $86ED94 ; Bank06.asm@4866 (LDA $0E60, X : AND.b #$40)
JSL Utility_CheckImpervious
NOP
;--------------------------------------------------------------------------------
;================================================================================
;--------------------------------------------------------------------------------
; Variable Ganon Vulnerability
;--------------------------------------------------------------------------------
org $88BBD4 ; ancilla_magic_powder.asm@253 (LDA #$0A : JSL Ancilla_CheckSpriteDamage.preset_class)
JSL Ganon_CheckPowderVulnerability
NOP #2
org $1D8F4E ; sprite_ganon.asm@325 (LDA $04C5 : CMP #$02)
JSL Ganon_CheckInvincible
NOP
org $0DD628 ; Bank0D.asm@1266 (LDA $0B6B, Y : AND #$02)
JSL CheckBeeBoss
NOP
org $0DD677 ; Bank0D.asm@1303 (JSL Ancilla_CheckSpriteDamage.preset_class)
JSL Ganon_CheckBeeVulnerability
;--------------------------------------------------------------------------------
;================================================================================
; PseudoFlute
;--------------------------------------------------------------------------------
org $8AB7D5 ; bank_0A.asm@5655 (DEC.w $1AF0 : LDA.b #$20 : STA.w $012F)
JSL SelectFlutePrev
BRA + : NOP #2 : +
;--------------------------------------------------------------------------------
org $8AB7E3 ; bank_0A.asm@5665 (INC.w $1AF0 : LDA.b #$20 : STA.w $012F)
JSL SelectFluteNext
BRA + : NOP #2 : +
;--------------------------------------------------------------------------------
org $8AB877 ; bank_0A.asm@5758 (STA.b $0C : LDA.b #$00 : STA.b $0B)
JSL SetFluteSpotPalette
NOP #2
;--------------------------------------------------------------------------------
org $8AB8BF ; bank_0A.asm@5800 (STA.b $0C : LDA.b #$00 : STA.b $0B)
JSL SetFluteSpotPalette
NOP #2
;--------------------------------------------------------------------------------
org $82AFBE ; bank_02.asm@8776 (LDA.l $7EC213 : STA.b $8A)
JSL CheckEnterOverworld
NOP #2
;--------------------------------------------------------------------------------
org $82A9A1 ; bank_02.asm@7655 (STA.b $8A : STA.w $040A)
JSL CheckTransitionOverworld
NOP
;--------------------------------------------------------------------------------
org $8DF741
dw $3CD4, $3CD5, $3CE4, $3CE5
;--------------------------------------------------------------------------------
org $8DE58E ; bank_0D.asm@15401 (AND.w #$00FF : STA.b $02)
JSL DrawFluteIcon
NOP
;--------------------------------------------------------------------------------
org $8DFB63 ; bank_0D.asm@18092 (LDA.l $7EF33F, X : AND.w #$00FF)
JSL CheckFluteInHUD
NOP #3
;--------------------------------------------------------------------------------

View File

@@ -114,7 +114,10 @@ StartingGenericKeys: skip 1 ; PC 0x18338B
InitInventoryTracking: skip 2 ; PC 0x18338C \ Need to set bits here for silver arrows, InitInventoryTracking: skip 2 ; PC 0x18338C \ Need to set bits here for silver arrows,
InitBowTracking: skip 2 ; PC 0x18338E / boomerangs, powder/mushroom, etc InitBowTracking: skip 2 ; PC 0x18338E / boomerangs, powder/mushroom, etc
InitItemLimitCounts: skip 16 ; PC 0x183390 InitItemLimitCounts: skip 16 ; PC 0x183390
skip 37 ; skip 34 ;
InitFluteBitfield: db $FF ;
InitSpecialWeaponLevel: db $00 ;
InitItemOnB: db $00 ;
InitProgressIndicator: db $02 ; PC 0x1833C5 - Set to $80 for instant post-aga with standard InitProgressIndicator: db $02 ; PC 0x1833C5 - Set to $80 for instant post-aga with standard
InitProgressFlags: db $14 ; PC 0x1833C6 - Set to $00 for standard InitProgressFlags: db $14 ; PC 0x1833C6 - Set to $00 for standard
InitMapIcons: skip 1 ; PC 0x1833C7 InitMapIcons: skip 1 ; PC 0x1833C7
@@ -123,8 +126,8 @@ InitNpcFlagsVanilla: skip 1 ; PC 0x1833C9
InitCurrentWorld: skip 1 ; PC 0x1833CA InitCurrentWorld: skip 1 ; PC 0x1833CA
skip 1 ; PC 0x1833CB skip 1 ; PC 0x1833CB
InitFollowerIndicator: skip 1 ; PC 0x1833CC InitFollowerIndicator: skip 1 ; PC 0x1833CC
InitFollowerXCoord: skip 2 ; PC 0x1833CD InitFollowerYCoord: skip 2 ; PC 0x1833CD
InitFollowerYCoord: skip 2 ; PC 0x1833CF InitFollowerXCoord: skip 2 ; PC 0x1833CF
InitDroppedFollowerIndoors: skip 1 ; PC 0x1833D1 InitDroppedFollowerIndoors: skip 1 ; PC 0x1833D1
InitDroppedFollowerLayer: skip 1 ; PC 0x1833D2 InitDroppedFollowerLayer: skip 1 ; PC 0x1833D2
InitFollowerDropped: skip 1 ; PC 0x1833D3 InitFollowerDropped: skip 1 ; PC 0x1833D3

View File

@@ -364,7 +364,7 @@ IncrementFinalSword:
PLX PLX
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
Link_ReceiveItem_HUDRefresh: HUDRefresh:
LDA.l BombsEquipment : BNE + ; skip if we have bombs LDA.l BombsEquipment : BNE + ; skip if we have bombs
LDA.l BombCapacity : BEQ + ; skip if we can't have bombs LDA.l BombCapacity : BEQ + ; skip if we can't have bombs
LDA.l BombsFiller : BEQ + ; skip if we are filling no bombs LDA.l BombsFiller : BEQ + ; skip if we are filling no bombs
@@ -373,7 +373,7 @@ Link_ReceiveItem_HUDRefresh:
+ +
JSL HUD_RefreshIconLong ; thing we wrote over JSL HUD_RefreshIconLong ; thing we wrote over
LDA.b #$01 : STA.l UpdateHUDFlag LDA.b #$01 : STA.l UpdateHUDFlag
JSL PostItemGet JSL PostItemGet
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -468,7 +468,7 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; sets A to #$02 to ignore summoning the duck ; sets A to #$02 to ignore summoning the duck
FluteCallForDuck: FluteCallForDuck:
LDA.l WarningFlags : AND.b #$20 : BNE .vanilla ; glitched modes allowed flute in rain state LDA.l OverworldEventDataWRAM+$18 : AND.b #$20 : BNE .vanilla ; allow flute in rain state if weathervane activated
LDA.l ProgressIndicator : CMP.b #$02 : BCS .vanilla ; must rescue Zelda first LDA.l ProgressIndicator : CMP.b #$02 : BCS .vanilla ; must rescue Zelda first
.noDuck .noDuck
@@ -559,17 +559,17 @@ RTL
; LoadPowder: ; LoadPowder:
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
LoadPowder: LoadPowder:
PHX JSL Sprite_SpawnDynamically ; thing we wrote over
JSL Sprite_SpawnDynamically ; thing we wrote over .justGFX
LDA.l WitchItem_Player : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID LDA.l WitchItem_Player : STA.w SprItemMWPlayer, Y : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID
%GetPossiblyEncryptedItem(WitchItem, SpriteItemValues) %GetPossiblyEncryptedItem(WitchItem, SpriteItemValues)
JSL AttemptItemSubstitution STA.w SprSourceItemId, Y
JSL ResolveLootIDLong JSL AttemptItemSubstitution
STA.w SpriteID, Y JSL ResolveLootIDLong
STA.l PowderFlag STA.l PowderFlag
TYX PHX : TYX : PLY
JSL PrepDynamicTile_loot_resolved JSL RequestStandingItemVRAMSlot_resolved
PLX PHY : TXY : PLX
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -590,18 +590,19 @@ RTL
; DrawPowder: ; DrawPowder:
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
DrawPowder: DrawPowder:
LDA.w ItemReceiptPose : BNE .defer ; defer if link is buying a potion ;LDA.w ItemReceiptPose : BNE .defer ; defer if link is buying a potion
LDA.l RedrawFlag : BEQ + LDA.w SprRedrawFlag, X : BEQ +
LDA.l WitchItem_Player : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID LDA.w SprItemMWPlayer, X : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA.w $0DA0, X ; Retrieve stored item type LDA.w SprSourceItemId, X
JSL PrepDynamicTile_loot_resolved JSL AttemptItemSubstitution
LDA.b #$00 : STA.l RedrawFlag ; reset redraw flag JSL ResolveLootIDLong
BRA .defer STA.l PowderFlag
JML RequestStandingItemVRAMSlot_resolved
+ +
; this fights with the shopkeep code, so had to move the powder draw there when potion shop is custom ; this fights with the shopkeep code, so had to move the powder draw there when potion shop is custom
LDA.l ShopType : CMP.b #$FF : BNE .defer ; LDA.l ShopType : CMP.b #$FF : BNE .defer
LDA.w SpriteID, X ; Retrieve stored item type LDA.w SprItemReceipt, X ; Retrieve stored item type
JSL DrawDynamicTile JML DrawPotItem
.defer .defer
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -612,21 +613,12 @@ RTL
LoadMushroom: LoadMushroom:
LDA.b #$00 : STA.w SpriteGFXControl, X ; thing we wrote over LDA.b #$00 : STA.w SpriteGFXControl, X ; thing we wrote over
.justGFX .justGFX
PHA PHA
INC.w SkipBeeTrapDisguise
LDA.b #$01 : STA.l RedrawFlag LDA.l MushroomItem_Player : STA.w SprItemMWPlayer : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA.b LinkState : CMP.b #$14 : BEQ .skip ; skip if we're mid-mirror %GetPossiblyEncryptedItem(MushroomItem, SpriteItemValues)
STA.w SprSourceItemId, X
LDA.b #$00 : STA.l RedrawFlag JSL RequestStandingItemVRAMSlot
LDA.l MushroomItem_Player : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID
%GetPossiblyEncryptedItem(MushroomItem, SpriteItemValues)
JSL AttemptItemSubstitution
JSR ResolveLootID
STA.w SpriteID,X
JSL PrepDynamicTile
.skip
PLA PLA
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -636,15 +628,16 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
DrawMushroom: DrawMushroom:
PHA : PHY PHA : PHY
LDA.l RedrawFlag : BEQ .skipInit ; skip init if already ready LDA.w SprRedrawFlag, X : BEQ .draw ; skip init if already ready
JSL LoadMushroom_justGFX JSL LoadMushroom_justGFX
BRA .done ; don't draw on the init frame LDA.w SprRedrawFlag, X : CMP.b #$02 : BEQ .draw
BRA .done ; don't draw on the init frame
.skipInit .draw
LDA.w SpriteID, X ; Retrieve stored item type LDA.w SprItemReceipt, X ; Retrieve stored item type
JSL DrawDynamicTile JSL DrawPotItem
.done .done
PLY : PLA PLY : PLA
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -653,7 +646,7 @@ RTL
; CollectPowder: ; CollectPowder:
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
CollectPowder: CollectPowder:
LDY.w SpriteID, X ; Retrieve stored item type LDY.w SprSourceItemId, X ; Retrieve stored item type
BNE + BNE +
; if for any reason the item value is 0 reload it, just in case ; if for any reason the item value is 0 reload it, just in case
%GetPossiblyEncryptedItem(WitchItem, SpriteItemValues) : TAY %GetPossiblyEncryptedItem(WitchItem, SpriteItemValues) : TAY
@@ -725,10 +718,13 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; SpawnShovelItem: ; SpawnShovelItem:
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
SpawnShovelGamePrize:
JSL Sprite_SpawnDynamically ; thing we wrote over
LDA.b #$01 : STA.w SprRedrawFlag, Y
RTL
;--------------------------------------------------------------------------------
SpawnShovelItem: SpawnShovelItem:
LDA.b #$01 : STA.l RedrawFlag LDA.w YButtonOverride : BEQ +
LDA.w YButtonOverride : BEQ +
JSL DiggingGameGuy_AttemptPrizeSpawn JSL DiggingGameGuy_AttemptPrizeSpawn
JMP .skip JMP .skip
+ +
@@ -752,7 +748,6 @@ SpawnShovelItem:
;most of this part below is copied from the digging game ;most of this part below is copied from the digging game
STA.l MiniGameTime
JSL Sprite_SpawnDynamically JSL Sprite_SpawnDynamically
LDX.b #$00 LDX.b #$00
@@ -811,10 +806,16 @@ RTL
; A = item id being collected ; A = item id being collected
ItemGetAlternateSFX: ItemGetAlternateSFX:
PEA.w $C567 ; SNES to RTS to in bank 08 PEA.w $C567 ; SNES to RTS to in bank 08
LDA.w AncillaGet,X : CMP.b #$4A : BNE + LDA.w AncillaGet, X : CMP.b #$4A : BNE +
; collecting pre-activated flute ; collecting pre-activated flute
LDA.b #$13 : JML Ancilla_SFX2_Near LDA.b #$13 : JML Ancilla_SFX2_Near
+ ; normal itemget sfx + ; not pre-activated flute
JSL.l ItemIsJunk : BEQ .normal
.junk
LDA.b #$3B : JML Ancilla_SFX3_Near ; what we wrote over
.normal
LDA.b #$0F : JML Ancilla_SFX3_Near ; what we wrote over LDA.b #$0F : JML Ancilla_SFX3_Near ; what we wrote over
; A = item id being collected ; A = item id being collected
@@ -823,6 +824,13 @@ CPY.b #$4A : BNE +
JSL Sound_SetSfxPanWithPlayerCoords : ORA.b #$13 : STA.w SFX2 JSL Sound_SetSfxPanWithPlayerCoords : ORA.b #$13 : STA.w SFX2
RTL RTL
+ ; normal itemget sfx + ; normal itemget sfx
JSL.l ItemIsJunk : BEQ .normal
.junk
JSL Sound_SetSfxPanWithPlayerCoords : ORA.b #$3B : STA.w SFX3
RTL
.normal
JSL Sound_SetSfxPanWithPlayerCoords : ORA.b #$0F : STA.w SFX3 ; what we wrote over JSL Sound_SetSfxPanWithPlayerCoords : ORA.b #$0F : STA.w SFX3 ; what we wrote over
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------

View File

@@ -3,7 +3,7 @@
; Does tile modification for... the pyramid of power hole ; Does tile modification for... the pyramid of power hole
; after Ganon slams into it in bat form? ; after Ganon slams into it in bat form?
Overworld_CreatePyramidHoleModified: Overworld_CreatePyramidHoleModified:
LDA.l InvertedMode : BNE + PHX : LDX.b OverworldIndex : LDA.l OWTileMapAlt, X : PLX : AND.b #$01 : BNE +
JMP .originalBehaviour JMP .originalBehaviour
+ +
.invertedBehavior .invertedBehavior
@@ -80,7 +80,7 @@ Overworld_CreatePyramidHoleModified:
RTL RTL
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
Draw_PyramidOverlay: Draw_PyramidOverlay:
LDA.l InvertedMode : AND.w #$00FF : BNE .done PHX : LDA.b OverworldIndex : AND.w #$00FF : TAX : LDA.l OWTileMapAlt, X : PLX : AND.w #$0001 : BNE .done
.normal .normal
LDA.w #$0E39 : STA.w $23BC LDA.w #$0E39 : STA.w $23BC
INC A : STA.w $23BE INC A : STA.w $23BE
@@ -130,7 +130,7 @@ db $02, $02, $02, $00, $08, $02, $02, $00, $00, $00, $00, $01, $00, $00, $20, $0
db $02, $02, $02, $02, $02, $02, $02, $00, $00, $01, $01, $01, $02, $00, $08, $00 db $02, $02, $02, $02, $02, $02, $02, $00, $00, $01, $01, $01, $02, $00, $08, $00
Electric_Barrier: Electric_Barrier:
LDA.l InvertedMode : BEQ .done LDA.l SwapAgaGanonsTower : BEQ .done
LDA.l OverworldEventDataWRAM, X : ORA.b #$40 : STA.l OverworldEventDataWRAM, X ;set barrier dead LDA.l OverworldEventDataWRAM, X : ORA.b #$40 : STA.l OverworldEventDataWRAM, X ;set barrier dead
.done .done
LDA.l OverworldEventDataWRAM, X ; what we wrote over LDA.l OverworldEventDataWRAM, X ; what we wrote over
@@ -138,7 +138,7 @@ RTL
GanonTowerAnimation: GanonTowerAnimation:
LDA.l InvertedMode : BEQ .done LDA.l SwapAgaGanonsTower : BEQ .done
LDA.b #$1B : STA.w SFX3 LDA.b #$1B : STA.w SFX3
STZ.w OWEntranceCutscene STZ.w OWEntranceCutscene
STZ.b SubSubModule STZ.b SubSubModule
@@ -151,7 +151,9 @@ GanonTowerAnimation:
STZ.w BG1ShakeV+1 STZ.w BG1ShakeV+1
STZ.w BG1ShakeH STZ.w BG1ShakeH
STZ.w BG1ShakeH+1 STZ.w BG1ShakeH+1
LDA.b #$02 : STA.w MusicControlRequest PHX
JSL Overworld_DetermineMusic : STX.w MusicControlRequest
PLX
LDA.b #$09 : STA.w SFX1 LDA.b #$09 : STA.w SFX1
RTL RTL
@@ -163,7 +165,7 @@ RTL
GanonTowerInvertedCheck: GanonTowerInvertedCheck:
{ {
LDA.l InvertedMode : BEQ .done LDA.l SwapAgaGanonsTower : BEQ .done
LDA.b #$01 ; Load a random value so it doesn't BEQ LDA.b #$01 ; Load a random value so it doesn't BEQ
RTL RTL
.done .done
@@ -174,11 +176,10 @@ GanonTowerInvertedCheck:
;Hard coded rock removed in LW for Inverted mode ;Hard coded rock removed in LW for Inverted mode
HardcodedRocks: HardcodedRocks:
LDA.b OverworldIndex : AND.w #$00FF : TAX : LDA.l OWTileMapAlt, X : AND.w #$0001 : BEQ .normalrocks
LDA.l InvertedMode : AND.w #$00FF : BEQ .normalrocks
BRA .noRock2 BRA .noRock2
.normalrocks .normalrocks
LDA.w #$020F : LDX.b OverworldIndex : CPX.w #$0033 : BNE .noRock LDA.w #$020F : CPX.w #$0033 : BNE .noRock
STA.l $7E22A8 STA.l $7E22A8
.noRock .noRock
CPX.w #$002F : BNE .noRock2 CPX.w #$002F : BNE .noRock2
@@ -187,7 +188,7 @@ HardcodedRocks:
RTL RTL
TurtleRockPegSolved: TurtleRockPegSolved:
LDA.l InvertedMode : AND.w #$00FF : BNE + PHX : LDA.b OverworldIndex : AND.w #$00FF : TAX : LDA.l OWTileMapAlt, X : PLX : AND.w #$0001 : BNE +
LDA.l OverworldEventDataWRAM+07 ; What we wrote over (reading flags for this screen) LDA.l OverworldEventDataWRAM+07 ; What we wrote over (reading flags for this screen)
RTL RTL
+ +
@@ -196,14 +197,17 @@ RTL
MirrorBonk: MirrorBonk:
; must preserve X/Y, and must preserve $00-$0F ; must preserve X/Y, and must preserve $00-$0F
LDA.l InvertedMode : BEQ .normal PHX : LDX.b OverworldIndex : LDA.l OWTileMapAlt, X : PLX : AND.b #$01 : BEQ .normal
; Goal: use $20 and $22 to decide to force a bonk ; Goal: use $20 and $22 to decide to force a bonk
; if we want to bonk branch to .forceBonk ; if we want to bonk branch to .forceBonk
; otherwise fall through to .normal ; otherwise fall through to .normal
PHX : PHP PHX : PHP
PHB : PHK : PLB PHB : PHK : PLB
LDA.b OverworldIndex : AND.b #$40 : BEQ .endLoop ;World we're in? branch if we are in LW we don't want bonks LDX.b OverworldIndex : LDA.l OWTileWorldAssoc, X
TAX : LDA.l InvertedMode : BEQ +
TXA : EOR.b #$40 : TAX
+ TXA : BNE .endLoop ;World we're in? branch if we are in LW we don't want bonks
REP #$30 REP #$30
LDX.w #$0000 LDX.w #$0000

View File

@@ -5,6 +5,9 @@ OWWriteIncrement = $02
OWWriteTile = $06 OWWriteTile = $06
OWWriteCommand = $08 OWWriteCommand = $08
OWSkipLookup = $00
OWSkipFlags = $03
;--------------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------------
function OWW_RLESize(s) = s<<8 function OWW_RLESize(s) = s<<8
@@ -20,6 +23,8 @@ function OWW_RLESize(s) = s<<8
;=================================================================================================== ;===================================================================================================
Overworld_LoadNewTiles: Overworld_LoadNewTiles:
JSL Overworld_LoadBonkTiles
LDA.b OverworldIndex LDA.b OverworldIndex
CMP.w #$0080 CMP.w #$0080
BCS .exit BCS .exit
@@ -27,7 +32,7 @@ Overworld_LoadNewTiles:
ASL ASL
TAX TAX
LDA.l OverworldMapChangePointers,X LDA.l OverworldMapChangePointers2,X
BNE .do_overlay BNE .do_overlay
.exit .exit
@@ -121,9 +126,21 @@ Overworld_LoadNewTiles:
dw .nothing ; 07 dw .nothing ; 07
dw .nothing ; 08 dw .nothing ; 08
dw .nothing ; 09 dw .nothing ; 09
dw .nothing ; 0A
dw .nothing ; 0B ; dw !OWW_SkipAhead, <address>
dw .nothing ; 0C ; skips to <address> unconditionally
!OWW_SkipAhead = $800A
dw .skip_ahead ; 0A
; dw !OWW_SkipIfFlagSet, <lookup>, <bitflags>, <address>
; skips to <address> when value at <lookup> has bits matching <bitflags>
!OWW_SkipIfFlagSet = $800B
dw .flag_skip ; 0B
; dw !OWW_SkipIfNotFlagSet, <lookup>, <bitflags>, <address>
; skips to <address> when value at <lookup> has bits not matching <bitflags>
!OWW_SkipIfNotFlagSet = $800C
dw .flag_block ; 0C
; dw !OWW_SkipIfInverted, <address> ; dw !OWW_SkipIfInverted, <address>
; skips to <address> when inverted mode ; skips to <address> when inverted mode
@@ -162,7 +179,59 @@ Overworld_LoadNewTiles:
INY INY
INY INY
JMP ($0000,X) JMP.w ($0000,X)
;---------------------------------------------------------------------------------------------------
.skip_ahead
LDX.w $0000,Y
INY : INY
TXY
RTS
;---------------------------------------------------------------------------------------------------
.flag_skip
LDX.w $0000,Y : STX.b OWSkipLookup
INY : INY
LDX.w $0000,Y : STX.b OWSkipFlags-1
INY : INY
LDX.w $0000,Y
INY : INY
SEP #$20
LDA.b [OWSkipLookup]
AND.b OWSkipFlags
CMP.b OWSkipFlags
REP #$20
BNE .nothing
TXY
RTS
;---------------------------------------------------------------------------------------------------
.flag_block
LDX.w $0000,Y : STX.b OWSkipLookup
INY : INY
LDX.w $0000,Y : STX.b OWSkipFlags-1
INY : INY
LDX.w $0000,Y
INY : INY
SEP #$20
LDA.b [OWSkipLookup]
AND.b OWSkipFlags
CMP.b OWSkipFlags
REP #$20
BEQ .nothing
TXY
RTS
;--------------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------------
@@ -172,9 +241,13 @@ Overworld_LoadNewTiles:
INY INY
INY INY
LDA.l InvertedMode PHX
AND.w #$00FF SEP #$20
BEQ .dont_change_inverted LDX.b OverworldIndex : LDA.l OWTileMapAlt, X
REP #$20
PLX
AND.w #$0001
BEQ .nothing
TXY TXY
@@ -196,13 +269,16 @@ Overworld_LoadNewTiles:
LDX.w #ReliableOWWSentinel LDX.w #ReliableOWWSentinel
.check_inverted .check_inverted
LDA.l InvertedMode PHX
AND.w #$00FF SEP #$20
BNE .dont_change_inverted LDX.b OverworldIndex : LDA.l OWTileMapAlt, X
REP #$20
PLX
AND.w #$0001
BNE .nothing
TXY TXY
.dont_change_inverted
RTS RTS
;--------------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------------
@@ -374,7 +450,7 @@ OverworldMapChangePointers:
dw $0000 ; 0B dw $0000 ; 0B
dw $0000 ; 0C dw $0000 ; 0C
dw $0000 ; 0D dw $0000 ; 0D
dw .map0E ; 0E dw $0000 ; 0E
dw $0000 ; 0F dw $0000 ; 0F
dw .map10 ; 10 dw .map10 ; 10
dw $0000 ; 11 dw $0000 ; 11
@@ -409,18 +485,18 @@ OverworldMapChangePointers:
dw $0000 ; 2E dw $0000 ; 2E
dw $0000 ; 2F dw $0000 ; 2F
dw .map30 ; 30 dw .map30 ; 30
dw .map31 ; 31 dw $0000 ; 31
dw .map32 ; 32 dw .map32 ; 32
dw .map33 ; 33 dw .map33 ; 33
dw $0000 ; 34 dw $0000 ; 34
dw .map35 ; 35 dw .map35 ; 35
dw $0000 ; 36 dw $0000 ; 36
dw $0000 ; 37 dw $0000 ; 37
dw .map38 ; 38 dw $0000 ; 38
dw $0000 ; 39 dw $0000 ; 39
dw .map3A ; 3A dw .map3A ; 3A
dw $0000 ; 3B dw $0000 ; 3B
dw .map3C ; 3C dw $0000 ; 3C
dw $0000 ; 3D dw $0000 ; 3D
dw $0000 ; 3E dw $0000 ; 3E
dw $0000 ; 3F dw $0000 ; 3F
@@ -430,7 +506,7 @@ OverworldMapChangePointers:
dw $0000 ; 41 dw $0000 ; 41
dw $0000 ; 42 dw $0000 ; 42
dw .map43 ; 43 dw .map43 ; 43
dw .map44 ; 44 dw $0000 ; 44
dw .map45 ; 45 dw .map45 ; 45
dw $0000 ; 46 dw $0000 ; 46
dw .map47 ; 47 dw .map47 ; 47
@@ -440,7 +516,7 @@ OverworldMapChangePointers:
dw $0000 ; 4B dw $0000 ; 4B
dw $0000 ; 4C dw $0000 ; 4C
dw $0000 ; 4D dw $0000 ; 4D
dw .map4E ; 4E dw $0000 ; 4E
dw $0000 ; 4F dw $0000 ; 4F
dw .map50 ; 50 dw .map50 ; 50
dw $0000 ; 51 dw $0000 ; 51
@@ -482,7 +558,7 @@ OverworldMapChangePointers:
dw .map75 ; 75 dw .map75 ; 75
dw $0000 ; 76 dw $0000 ; 76
dw $0000 ; 77 dw $0000 ; 77
dw .map78 ; 78 dw $0000 ; 78
dw $0000 ; 79 dw $0000 ; 79
dw $0000 ; 7A dw $0000 ; 7A
dw $0000 ; 7B dw $0000 ; 7B
@@ -603,15 +679,6 @@ OverworldMapChangePointers:
;--------------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------------
.map0E
dw !OWW_InvertedOnly
dw $0034, $3D4A
dw !OWW_END
;---------------------------------------------------------------------------------------------------
.map10 .map10
dw !OWW_InvertedOnly dw !OWW_InvertedOnly
@@ -970,99 +1037,6 @@ OverworldMapChangePointers:
dw $06E7 dw $06E7
dw $28D8, $295A, $29DC|!OWW_STOP dw $28D8, $295A, $29DC|!OWW_STOP
dw !OWW_END
;---------------------------------------------------------------------------------------------------
.map31
dw !OWW_InvertedOnly
; singles
dw $017E, $20CE
dw $017E, $2050
dw $0183, $20D0
dw $0183, $214E
dw !OWW_StripeRLE|!OWW_Horizontal|OWW_RLESize(4)
dw $0034, $2050
dw !OWW_StripeRLE|!OWW_Horizontal|OWW_RLESize(7)
dw $00D1, $2052
dw !OWW_StripeRLE|!OWW_Horizontal|OWW_RLESize(7)
dw $00D1, $21E6
dw !OWW_StripeRLE|!OWW_Horizontal|OWW_RLESize(7)
dw $00C9, $20D2
dw !OWW_StripeRLE|!OWW_Horizontal|OWW_RLESize(7)
dw $00C9, $2152
dw !OWW_StripeRLE|!OWW_Horizontal|OWW_RLESize(6)
dw $00C9, $2266
dw !OWW_StripeRLE|!OWW_Horizontal|OWW_RLESize(7)
dw $00DC, $21D2
dw !OWW_StripeRLE|!OWW_Horizontal|OWW_RLESize(6)
dw $00CC, $22E6
dw !OWW_StripeRLE|!OWW_Horizontal|OWW_RLESize(4)
dw $0034, $2452
dw !OWW_StripeRLE|!OWW_Horizontal|OWW_RLESize(8)
dw $06B4, $2562
dw !OWW_StripeRLE|!OWW_Horizontal|OWW_RLESize(7)
dw $0165, $25E4
dw !OWW_StripeRLE|!OWW_Horizontal|OWW_RLESize(4)
dw $0384, $24E8
dw !OWW_StripeRLE|!OWW_Horizontal|OWW_RLESize(4)
dw $0034, $23D0
dw !OWW_StripeRLE|!OWW_Horizontal|OWW_RLESize(4)
dw $0034, $22D2
dw !OWW_END
;---------------------------------------------------------------------------------------------------
.map38
dw !OWW_InvertedOnly
dw $0034, $3D94
dw !OWW_END
;---------------------------------------------------------------------------------------------------
.map3C
dw !OWW_InvertedOnly
dw !OWW_ArbTileCopy
dw $02E5
dw $27AE, $282C, $282E, $2832
dw $28AC, $28AE, $2928, $292C
dw $29A8, $29B0, $2A28, $2A30
dw $2AAC, $2AB2|!OWW_STOP
dw !OWW_ArbTileCopy
dw $078A
dw $28AA, $28B0, $2AAA, $2B2A
dw $2B30, $2BAE|!OWW_STOP
dw !OWW_ArbTileCopy
dw $02EB
dw $28B4, $2930, $29AE, $2A2C
dw $2A32, $2AAE|!OWW_STOP
dw !OWW_ArbTileCopy
dw $02EC
dw $2934, $2B28, $2B2C, $2B2E
dw $2B32|!OWW_STOP
dw !OWW_END dw !OWW_END
;--------------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------------
@@ -1291,31 +1265,6 @@ OverworldMapChangePointers:
dw !OWW_END dw !OWW_END
;---------------------------------------------------------------------------------------------------
.map44
dw !OWW_InvertedOnly
dw !OWW_StripeRLE|!OWW_Vertical|OWW_RLESize(5)
dw $0E96, $235E
dw !OWW_StripeRLE|!OWW_Vertical|OWW_RLESize(5)
dw $0E97, $2360
dw $0E94, $25DE
dw $0E95, $25E0
dw $0212, $2BE0
dw !OWW_Stripe|!OWW_Vertical
dw $275E
dw $0180, $0184, $0184|!OWW_STOP
dw !OWW_Stripe|!OWW_Vertical
dw $276E
dw $0181, $0185, $0185|!OWW_STOP
dw !OWW_END
;--------------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------------
.map45 .map45
dw !OWW_InvertedOnly dw !OWW_InvertedOnly
@@ -1340,15 +1289,6 @@ OverworldMapChangePointers:
;--------------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------------
.map4E
dw !OWW_InvertedOnly
dw $0239, $3D4A
dw !OWW_END
;---------------------------------------------------------------------------------------------------
.map50 .map50
dw !OWW_InvertedOnly dw !OWW_InvertedOnly
@@ -1551,13 +1491,4 @@ OverworldMapChangePointers:
;--------------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------------
.map78
dw !OWW_InvertedOnly
dw $0239, $3D94
dw !OWW_END
;---------------------------------------------------------------------------------------------------
;=================================================================================================== ;===================================================================================================

1147
invertedmaps2.asm Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -243,7 +243,7 @@ endmacro
%ReceiptProps($67, -4, 0, $FF, $F36A, $FF, skip, skip) ; 67 - %ReceiptProps($67, -4, 0, $FF, $F36A, $FF, skip, skip) ; 67 -
%ReceiptProps($68, -4, 0, $FF, $F36A, $FF, skip, skip) ; 68 - %ReceiptProps($68, -4, 0, $FF, $F36A, $FF, skip, skip) ; 68 -
%ReceiptProps($69, -4, 0, $FF, $F36A, $FF, skip, skip) ; 69 - %ReceiptProps($69, -4, 0, $FF, $F36A, $FF, skip, skip) ; 69 -
%ReceiptProps($6A, -4, 0, $49, $F36A, $FF, triforce, skip) ; 6A - Triforce %ReceiptProps($6A, -4, 0, $4A, $F36A, $FF, triforce, skip) ; 6A - Triforce
%ReceiptProps($6B, -4, 0, $50, $F36A, $FF, goal_item, skip) ; 6B - Power star %ReceiptProps($6B, -4, 0, $50, $F36A, $FF, goal_item, skip) ; 6B - Power star
%ReceiptProps($6C, -4, 0, $49, $F36A, $FF, goal_item, skip) ; 6C - Triforce Piece %ReceiptProps($6C, -4, 0, $49, $F36A, $FF, goal_item, skip) ; 6C - Triforce Piece
%ReceiptProps($6D, -4, 0, $FF, $F36A, $FF, request_F0, skip) ; 6D - Server request item %ReceiptProps($6D, -4, 0, $FF, $F36A, $FF, request_F0, skip) ; 6D - Server request item
@@ -313,9 +313,9 @@ endmacro
%ReceiptProps($AD, -4, 4, $0F, $F36A, $FF, free_smallkey, skip) ; AD - Small key of Ganon's Tower %ReceiptProps($AD, -4, 4, $0F, $F36A, $FF, free_smallkey, skip) ; AD - Small key of Ganon's Tower
%ReceiptProps($AE, -4, 4, $0F, $F36A, $FF, skip, skip) ; AE - Reserved %ReceiptProps($AE, -4, 4, $0F, $F36A, $FF, skip, skip) ; AE - Reserved
%ReceiptProps($AF, -4, 4, $0F, $F36A, $FF, generic_smallkey, skip) ; AF - Generic small key %ReceiptProps($AF, -4, 4, $0F, $F36A, $FF, generic_smallkey, skip) ; AF - Generic small key
%ReceiptProps($B0, -4, 0, $28, $F36A, $FF, free_crystal, skip) ; B0 - Crystal 6 %ReceiptProps($B0, -4, 0, $4C, $F36A, $FF, free_crystal, skip) ; B0 - Crystal 6
%ReceiptProps($B1, -4, 0, $28, $F36A, $FF, free_crystal, skip) ; B1 - Crystal 1 %ReceiptProps($B1, -4, 0, $28, $F36A, $FF, free_crystal, skip) ; B1 - Crystal 1
%ReceiptProps($B2, -4, 0, $28, $F36A, $FF, free_crystal, skip) ; B2 - Crystal 5 %ReceiptProps($B2, -4, 0, $4C, $F36A, $FF, free_crystal, skip) ; B2 - Crystal 5
%ReceiptProps($B3, -4, 0, $28, $F36A, $FF, free_crystal, skip) ; B3 - Crystal 7 %ReceiptProps($B3, -4, 0, $28, $F36A, $FF, free_crystal, skip) ; B3 - Crystal 7
%ReceiptProps($B4, -4, 0, $28, $F36A, $FF, free_crystal, skip) ; B4 - Crystal 2 %ReceiptProps($B4, -4, 0, $28, $F36A, $FF, free_crystal, skip) ; B4 - Crystal 2
%ReceiptProps($B5, -4, 0, $28, $F36A, $FF, free_crystal, skip) ; B5 - Crystal 4 %ReceiptProps($B5, -4, 0, $28, $F36A, $FF, free_crystal, skip) ; B5 - Crystal 4
@@ -346,12 +346,12 @@ endmacro
%ReceiptProps($CE, -4, 0, $49, $F36A, $FF, skip, skip) ; CE - %ReceiptProps($CE, -4, 0, $49, $F36A, $FF, skip, skip) ; CE -
%ReceiptProps($CF, -4, 0, $49, $F36A, $FF, skip, skip) ; CF - %ReceiptProps($CF, -4, 0, $49, $F36A, $FF, skip, skip) ; CF -
%ReceiptProps($D0, -4, 0, $47, $F36A, $FF, bee_trap, skip) ; D0 - Bee trap %ReceiptProps($D0, -4, 0, $47, $F36A, $FF, bee_trap, skip) ; D0 - Bee trap
%ReceiptProps($D1, -4, 0, $47, $F36A, $FF, skip, skip) ; D1 - Apples %ReceiptProps($D1, -4, 0, $47, $F36A, $FF, apples, skip) ; D1 - Apples
%ReceiptProps($D2, -4, 0, $47, $F36A, $FF, fairy, skip) ; D2 - Fairy %ReceiptProps($D2, -4, 0, $47, $F36A, $FF, fairy, skip) ; D2 - Fairy
%ReceiptProps($D3, -4, 0, $47, $F36A, $FF, chicken, skip) ; D3 - Chicken %ReceiptProps($D3, -4, 0, $47, $F36A, $FF, chicken, skip) ; D3 - Chicken
%ReceiptProps($D4, -4, 4, $3B, $F373, $80, refill_magic, skip) ; D4 - Big Magic %ReceiptProps($D4, -4, 4, $3B, $F373, $80, refill_magic, skip) ; D4 - Big Magic
%ReceiptProps($D5, -4, 0, $02, $F376, $05, skip, skip) ; D5 - 5 Arrows %ReceiptProps($D5, -4, 0, $02, $F376, $05, skip, skip) ; D5 - 5 Arrows
%ReceiptProps($D6, -4, 0, $49, $F36A, $FF, skip, skip) ; D6 - %ReceiptProps($D6, -4, 4, $47, $F36A, $FF, good_bee, skip) ; D6 - Good Bee
%ReceiptProps($D7, -4, 0, $49, $F36A, $FF, skip, skip) ; D7 - %ReceiptProps($D7, -4, 0, $49, $F36A, $FF, skip, skip) ; D7 -
%ReceiptProps($D8, -4, 0, $49, $F36A, $FF, skip, skip) ; D8 - %ReceiptProps($D8, -4, 0, $49, $F36A, $FF, skip, skip) ; D8 -
%ReceiptProps($D9, -4, 0, $49, $F36A, $FF, skip, skip) ; D9 - %ReceiptProps($D9, -4, 0, $49, $F36A, $FF, skip, skip) ; D9 -
@@ -430,7 +430,7 @@ endmacro
%SpriteProps($0B, 0, 0, $01, $01, PalettesVanilla_red_melon+$0E) ; 0B - Bow %SpriteProps($0B, 0, 0, $01, $01, PalettesVanilla_red_melon+$0E) ; 0B - Bow
%SpriteProps($0C, 0, 0, $02, $02, PalettesVanilla_blue_ice+$0E) ; 0C - Blue Boomerang %SpriteProps($0C, 0, 0, $02, $02, PalettesVanilla_blue_ice+$0E) ; 0C - Blue Boomerang
%SpriteProps($0D, 2, 2, $02, $02, PalettesVanilla_blue_ice+$0E) ; 0D - Powder %SpriteProps($0D, 2, 2, $02, $02, PalettesVanilla_blue_ice+$0E) ; 0D - Powder
%SpriteProps($0E, 2, 2, $02, $02, PalettesVanilla_blue_ice+$0E) ; 0E - Bottle refill (bee) %SpriteProps($0E, 2, 0, $02, $03, PalettesVanilla_blue_ice+$0E) ; 0E - Bottle refill (bee)
%SpriteProps($0F, 2, 2, $04, $04, PalettesVanilla_green_blue_guard+$0E) ; 0F - Bombos %SpriteProps($0F, 2, 2, $04, $04, PalettesVanilla_green_blue_guard+$0E) ; 0F - Bombos
%SpriteProps($10, 2, 2, $04, $04, PalettesVanilla_green_blue_guard+$0E) ; 10 - Ether %SpriteProps($10, 2, 2, $04, $04, PalettesVanilla_green_blue_guard+$0E) ; 10 - Ether
%SpriteProps($11, 2, 2, $04, $04, PalettesVanilla_green_blue_guard+$0E) ; 11 - Quake %SpriteProps($11, 2, 2, $04, $04, PalettesVanilla_green_blue_guard+$0E) ; 11 - Quake
@@ -592,9 +592,9 @@ endmacro
%SpriteProps($AD, 0, 0, $02, $04, PalettesVanilla_blue_ice+$0E) ; AD - Small key of Ganon's Tower %SpriteProps($AD, 0, 0, $02, $04, PalettesVanilla_blue_ice+$0E) ; AD - Small key of Ganon's Tower
%SpriteProps($AE, 2, 2, $02, $02, $0000) ; AE - Reserved %SpriteProps($AE, 2, 2, $02, $02, $0000) ; AE - Reserved
%SpriteProps($AF, 0, 0, $02, $04, PalettesVanilla_blue_ice+$0E) ; AF - Generic small key %SpriteProps($AF, 0, 0, $02, $04, PalettesVanilla_blue_ice+$0E) ; AF - Generic small key
%SpriteProps($B0, 2, 2, $80, $80, PalettesCustom_crystal) ; B0 - Crystal 6 %SpriteProps($B0, 2, 2, $01, $01, PalettesVanilla_red_melon+$0E) ; B0 - Crystal 6
%SpriteProps($B1, 2, 2, $80, $80, PalettesCustom_crystal) ; B1 - Crystal 1 %SpriteProps($B1, 2, 2, $80, $80, PalettesCustom_crystal) ; B1 - Crystal 1
%SpriteProps($B2, 2, 2, $80, $80, PalettesCustom_crystal) ; B2 - Crystal 5 %SpriteProps($B2, 2, 2, $01, $01, PalettesVanilla_red_melon+$0E) ; B2 - Crystal 5
%SpriteProps($B3, 2, 2, $80, $80, PalettesCustom_crystal) ; B3 - Crystal 7 %SpriteProps($B3, 2, 2, $80, $80, PalettesCustom_crystal) ; B3 - Crystal 7
%SpriteProps($B4, 2, 2, $80, $80, PalettesCustom_crystal) ; B4 - Crystal 2 %SpriteProps($B4, 2, 2, $80, $80, PalettesCustom_crystal) ; B4 - Crystal 2
%SpriteProps($B5, 2, 2, $80, $80, PalettesCustom_crystal) ; B5 - Crystal 4 %SpriteProps($B5, 2, 2, $80, $80, PalettesCustom_crystal) ; B5 - Crystal 4
@@ -624,13 +624,13 @@ endmacro
%SpriteProps($CD, 2, 2, $04, $04, $0000) ; CD - %SpriteProps($CD, 2, 2, $04, $04, $0000) ; CD -
%SpriteProps($CE, 2, 2, $04, $04, $0000) ; CE - %SpriteProps($CE, 2, 2, $04, $04, $0000) ; CE -
%SpriteProps($CF, 2, 2, $04, $04, $0000) ; CF - %SpriteProps($CF, 2, 2, $04, $04, $0000) ; CF -
%SpriteProps($D0, 2, 2, $01, $01, PalettesVanilla_green_blue_guard+$0E) ; D0 - Bee Trap todo: sprite props %SpriteProps($D0, 2, 2, $01, $02, PalettesVanilla_green_blue_guard+$0E) ; D0 - Bee Trap
%SpriteProps($D1, 2, 2, $01, $01, PalettesVanilla_green_blue_guard+$0E) ; D1 - Apples %SpriteProps($D1, 2, 2, $01, $01, PalettesVanilla_green_blue_guard+$0E) ; D1 - Apples
%SpriteProps($D2, 2, 2, $01, $01, PalettesVanilla_green_blue_guard+$0E) ; D2 - Fairy %SpriteProps($D2, 2, 2, $04, $04, PalettesVanilla_green_blue_guard+$0E) ; D2 - Fairy
%SpriteProps($D3, 2, 2, $01, $01, PalettesVanilla_green_blue_guard+$0E) ; D3 - Chicken %SpriteProps($D3, 2, 2, $04, $04, PalettesVanilla_green_blue_guard+$0E) ; D3 - Chicken
%SpriteProps($D4, 0, 0, $04, $04, PalettesVanilla_green_blue_guard+$0E) ; D4 - Big Magic %SpriteProps($D4, 0, 0, $04, $04, PalettesVanilla_green_blue_guard+$0E) ; D4 - Big Magic
%SpriteProps($D5, 2, 2, $02, $02, PalettesVanilla_blue_ice+$0E) ; D5 - 5 Arrows %SpriteProps($D5, 2, 2, $02, $02, PalettesVanilla_blue_ice+$0E) ; D5 - 5 Arrows
%SpriteProps($D6, 2, 2, $04, $04, $0000) ; D6 - %SpriteProps($D6, 0, 0, $02, $02, PalettesVanilla_green_blue_guard+$0E) ; D6 - Good Bee
%SpriteProps($D7, 2, 2, $04, $04, $0000) ; D7 - %SpriteProps($D7, 2, 2, $04, $04, $0000) ; D7 -
%SpriteProps($D8, 2, 2, $04, $04, $0000) ; D8 - %SpriteProps($D8, 2, 2, $04, $04, $0000) ; D8 -
%SpriteProps($D9, 2, 2, $04, $04, $0000) ; D9 - %SpriteProps($D9, 2, 2, $04, $04, $0000) ; D9 -
@@ -906,7 +906,7 @@ endmacro
%InventoryItem($D3, $0001, $0000, $0000) ; D3 - Chicken %InventoryItem($D3, $0001, $0000, $0000) ; D3 - Chicken
%InventoryItem($D4, $8001, $0000, $0000) ; D4 - Big Magic %InventoryItem($D4, $8001, $0000, $0000) ; D4 - Big Magic
%InventoryItem($D5, $0001, $0000, $0000) ; D5 - 5 Arrows %InventoryItem($D5, $0001, $0000, $0000) ; D5 - 5 Arrows
%InventoryItem($D6, $0001, $0000, $0000) ; D6 - %InventoryItem($D6, $0001, $0000, $0000) ; D6 - Good Bee
%InventoryItem($D7, $0001, $0000, $0000) ; D7 - %InventoryItem($D7, $0001, $0000, $0000) ; D7 -
%InventoryItem($D8, $0001, $0000, $0000) ; D8 - %InventoryItem($D8, $0001, $0000, $0000) ; D8 -
%InventoryItem($D9, $0001, $0000, $0000) ; D9 - %InventoryItem($D9, $0001, $0000, $0000) ; D9 -
@@ -1132,9 +1132,9 @@ ItemReceiptGraphicsOffsets:
dw BigDecompressionBuffer+$1DC0 ; AD - Small key of Ganon's Tower dw BigDecompressionBuffer+$1DC0 ; AD - Small key of Ganon's Tower
dw $0 ; AE - Reserved dw $0 ; AE - Reserved
dw BigDecompressionBuffer+$1DC0 ; AF - Generic small key dw BigDecompressionBuffer+$1DC0 ; AF - Generic small key
dw BigDecompressionBuffer+$08A0 ; B0 - Crystal 6 dw $0C60 ; B0 - Crystal 6
dw BigDecompressionBuffer+$08A0 ; B1 - Crystal 1 dw BigDecompressionBuffer+$08A0 ; B1 - Crystal 1
dw BigDecompressionBuffer+$08A0 ; B2 - Crystal 5 dw $0C60 ; B2 - Crystal 5
dw BigDecompressionBuffer+$08A0 ; B3 - Crystal 7 dw BigDecompressionBuffer+$08A0 ; B3 - Crystal 7
dw BigDecompressionBuffer+$08A0 ; B4 - Crystal 2 dw BigDecompressionBuffer+$08A0 ; B4 - Crystal 2
dw BigDecompressionBuffer+$08A0 ; B5 - Crystal 4 dw BigDecompressionBuffer+$08A0 ; B5 - Crystal 4
@@ -1170,7 +1170,7 @@ ItemReceiptGraphicsOffsets:
dw $11E0 ; D3 - Chicken dw $11E0 ; D3 - Chicken
dw $11E0 ; D4 - Big Magic dw $11E0 ; D4 - Big Magic
dw $11E0 ; D5 - 5 Arrows dw $11E0 ; D5 - 5 Arrows
dw $0 ; D6 - dw $11E0 ; D6 - Good Bee
dw $0 ; D7 - dw $0 ; D7 -
dw $0 ; D8 - dw $0 ; D8 -
dw $0 ; D9 - dw $0 ; D9 -
@@ -1234,7 +1234,7 @@ StandingItemGraphicsOffsets:
dw BigDecompressionBuffer+$1C00 ; 0B - Bow dw BigDecompressionBuffer+$1C00 ; 0B - Bow
dw BigDecompressionBuffer+$1DE0 ; 0C - Boomerang dw BigDecompressionBuffer+$1DE0 ; 0C - Boomerang
dw BigDecompressionBuffer+$1CC0 ; 0D - Powder dw BigDecompressionBuffer+$1CC0 ; 0D - Powder
dw BigDecompressionBuffer+$09A0 ; 0E - Bottle Refill (bee) dw 0 ; 0E - Bottle Refill (bee)
dw BigDecompressionBuffer+$1440 ; 0F - Bombos dw BigDecompressionBuffer+$1440 ; 0F - Bombos
dw BigDecompressionBuffer+$1400 ; 10 - Ether dw BigDecompressionBuffer+$1400 ; 10 - Ether
dw BigDecompressionBuffer+$1480 ; 11 - Quake dw BigDecompressionBuffer+$1480 ; 11 - Quake
@@ -1266,9 +1266,9 @@ StandingItemGraphicsOffsets:
dw BigDecompressionBuffer+$1500 ; 2B - Full bottle (red) dw BigDecompressionBuffer+$1500 ; 2B - Full bottle (red)
dw BigDecompressionBuffer+$1500 ; 2C - Full bottle (green) dw BigDecompressionBuffer+$1500 ; 2C - Full bottle (green)
dw BigDecompressionBuffer+$1500 ; 2D - Full bottle (blue) dw BigDecompressionBuffer+$1500 ; 2D - Full bottle (blue)
dw BigDecompressionBuffer+$1500 ; 2E - Potion refill (red) dw $0920 ; 2E - Potion refill (red)
dw BigDecompressionBuffer+$1500 ; 2F - Potion refill (green) dw $08A0 ; 2F - Potion refill (green)
dw BigDecompressionBuffer+$1500 ; 30 - Potion refill (blue) dw $08E0 ; 30 - Potion refill (blue)
dw BigDecompressionBuffer+$1D00 ; 31 - 10 bombs dw BigDecompressionBuffer+$1D00 ; 31 - 10 bombs
dw BigDecompressionBuffer+$15C0 ; 32 - Big key dw BigDecompressionBuffer+$15C0 ; 32 - Big key
dw BigDecompressionBuffer+$1580 ; 33 - Map dw BigDecompressionBuffer+$1580 ; 33 - Map
@@ -1402,9 +1402,9 @@ StandingItemGraphicsOffsets:
dw BigDecompressionBuffer+$1DC0 ; AD - Small key of Ganon's Tower dw BigDecompressionBuffer+$1DC0 ; AD - Small key of Ganon's Tower
dw $0 ; AE - Reserved dw $0 ; AE - Reserved
dw BigDecompressionBuffer+$1DC0 ; AF - Generic small key dw BigDecompressionBuffer+$1DC0 ; AF - Generic small key
dw BigDecompressionBuffer+$08A0 ; B0 - Crystal 6 dw $0C60 ; B0 - Crystal 6
dw BigDecompressionBuffer+$08A0 ; B1 - Crystal 1 dw BigDecompressionBuffer+$08A0 ; B1 - Crystal 1
dw BigDecompressionBuffer+$08A0 ; B2 - Crystal 5 dw $0C60 ; B2 - Crystal 5
dw BigDecompressionBuffer+$08A0 ; B3 - Crystal 7 dw BigDecompressionBuffer+$08A0 ; B3 - Crystal 7
dw BigDecompressionBuffer+$08A0 ; B4 - Crystal 2 dw BigDecompressionBuffer+$08A0 ; B4 - Crystal 2
dw BigDecompressionBuffer+$08A0 ; B5 - Crystal 4 dw BigDecompressionBuffer+$08A0 ; B5 - Crystal 4
@@ -1434,13 +1434,13 @@ StandingItemGraphicsOffsets:
dw $0 ; CD - dw $0 ; CD -
dw $0 ; CE - dw $0 ; CE -
dw $0 ; CF - dw $0 ; CF -
dw BigDecompressionBuffer+$09A0 ; D0 - Bee trap dw $0960 ; D0 - Bee trap
dw $11E0 ; D1 - Apples dw $0 ; D1 - Apples
dw $11E0 ; D2 - Fairy dw $0 ; D2 - Fairy
dw $11E0 ; D3 - Chicken dw BigDecompressionBuffer+$0140 ; D3 - Chicken
dw $11E0 ; D4 - Big Magic dw $01E0 ; D4 - Big Magic
dw $11E0 ; D5 - 5 Arrows dw $11E0 ; D5 - 5 Arrows
dw $0 ; D6 - dw $0 ; D6 - Good Bee
dw $0 ; D7 - dw $0 ; D7 -
dw $0 ; D8 - dw $0 ; D8 -
dw $0 ; D9 - dw $0 ; D9 -
@@ -1500,7 +1500,7 @@ VRAMAddressOffset:
dw $0024 ; 0B - Bow dw $0024 ; 0B - Bow
dw $0024 ; 0C - Boomerang dw $0024 ; 0C - Boomerang
dw $0024 ; 0D - Powder dw $0024 ; 0D - Powder
dw $0024 ; 0E - Bottle Refill (bee) dw $00E4 ; 0E - Bottle Refill (bee)
dw $0024 ; 0F - Bombos dw $0024 ; 0F - Bombos
dw $0024 ; 10 - Ether dw $0024 ; 10 - Ether
dw $0024 ; 11 - Quake dw $0024 ; 11 - Quake
@@ -1522,8 +1522,8 @@ VRAMAddressOffset:
dw $0024 ; 21 - Net dw $0024 ; 21 - Net
dw $0024 ; 22 - Blue Mail dw $0024 ; 22 - Blue Mail
dw $0024 ; 23 - Red Mail dw $0024 ; 23 - Red Mail
dw $0024 ; 24 - Small Key dw $006B ; 24 - Small Key
dw $0024 ; 25 - Compbutt dw $0024 ; 25 - Compass
dw $0024 ; 26 - Heart Container from 4/4 dw $0024 ; 26 - Heart Container from 4/4
dw $0024 ; 27 - Bomb dw $0024 ; 27 - Bomb
dw $0024 ; 28 - 3 bombs dw $0024 ; 28 - 3 bombs
@@ -1538,9 +1538,9 @@ VRAMAddressOffset:
dw $0024 ; 31 - 10 bombs dw $0024 ; 31 - 10 bombs
dw $0024 ; 32 - Big key dw $0024 ; 32 - Big key
dw $0024 ; 33 - Map dw $0024 ; 33 - Map
dw $0024 ; 34 - 1 rupee dw $000B ; 34 - 1 rupee
dw $0024 ; 35 - 5 rupees dw $000B ; 35 - 5 rupees
dw $0024 ; 36 - 20 rupees dw $000B ; 36 - 20 rupees
dw $0024 ; 37 - Green pendant dw $0024 ; 37 - Green pendant
dw $0024 ; 38 - Blue pendant dw $0024 ; 38 - Blue pendant
dw $0024 ; 39 - Red pendant dw $0024 ; 39 - Red pendant
@@ -1652,22 +1652,22 @@ VRAMAddressOffset:
dw $0024 ; 9E - Big key of Hyrule Castle dw $0024 ; 9E - Big key of Hyrule Castle
dw $0024 ; 9F - Big key of Sewers dw $0024 ; 9F - Big key of Sewers
dw $0024 ; A0 - Small key of Sewers dw $006B ; A0 - Small key of Sewers
dw $0024 ; A1 - Small key of Hyrule Castle dw $006B ; A1 - Small key of Hyrule Castle
dw $0024 ; A2 - Small key of Eastern Palace dw $006B ; A2 - Small key of Eastern Palace
dw $0024 ; A3 - Small key of Desert Palace dw $006B ; A3 - Small key of Desert Palace
dw $0024 ; A4 - Small key of Agahnim's Tower dw $006B ; A4 - Small key of Agahnim's Tower
dw $0024 ; A5 - Small key of Swamp Palace dw $006B ; A5 - Small key of Swamp Palace
dw $0024 ; A6 - Small key of Dark Palace dw $006B ; A6 - Small key of Dark Palace
dw $0024 ; A7 - Small key of Misery Mire dw $006B ; A7 - Small key of Misery Mire
dw $0024 ; A8 - Small key of Skull Woods dw $006B ; A8 - Small key of Skull Woods
dw $0024 ; A9 - Small key of Ice Palace dw $006B ; A9 - Small key of Ice Palace
dw $0024 ; AA - Small key of Tower of Hera dw $006B ; AA - Small key of Tower of Hera
dw $0024 ; AB - Small key of Thieves' Town dw $006B ; AB - Small key of Thieves' Town
dw $0024 ; AC - Small key of Turtle Rock dw $006B ; AC - Small key of Turtle Rock
dw $0024 ; AD - Small key of Ganon's Tower dw $006B ; AD - Small key of Ganon's Tower
dw $0024 ; AE - Reserved dw $0024 ; AE - Reserved
dw $0024 ; AF - Generic small key dw $006B ; AF - Generic small key
dw $0024 ; B0 - Crystal 6 dw $0024 ; B0 - Crystal 6
dw $0024 ; B1 - Crystal 1 dw $0024 ; B1 - Crystal 1
dw $0024 ; B2 - Crystal 5 dw $0024 ; B2 - Crystal 5
@@ -1706,7 +1706,7 @@ VRAMAddressOffset:
dw $0024 ; D3 - Chicken dw $0024 ; D3 - Chicken
dw $0062 ; D4 - Big Magic dw $0062 ; D4 - Big Magic
dw $0024 ; D5 - 5 Arrows dw $0024 ; D5 - 5 Arrows
dw $0024 ; D6 - dw $00E4 ; D6 - Good Bee
dw $0024 ; D7 - dw $0024 ; D7 -
dw $0024 ; D8 - dw $0024 ; D8 -
dw $0024 ; D9 - dw $0024 ; D9 -

View File

@@ -1,136 +1,398 @@
!DynamicDropGFXSlotCount_UW = (FreeUWGraphics_end-FreeUWGraphics)>>1
!DynamicDropGFXSlotCount_OW = (FreeOWGraphics_end-FreeOWGraphics)>>1
; Come in with ; Come in with
; A = item receipt ID ; A = item receipt ID
; X = sprite slot ; X = sprite slot
RequestStandingItemVRAMSlot: RequestStandingItemVRAMSlot:
PHA
LDA.w DynamicDropGFXIndex
INC
CMP.b #$05 : BCC .fine
LDA.b #$00
.fine
STA.w DynamicDropGFXIndex
STA.w SprItemGFX,X
PLA : PHX
; unsure about substitution rules here, because they aren't skipped properly for MW yet
JSL AttemptItemSubstitution JSL AttemptItemSubstitution
JSL ResolveLootIDLong JSL ResolveLootIDLong
.resolved
STA.w SprItemReceipt, X
JSL ResolveBeeTrapLong JSL ResolveBeeTrapLong
PHX : PHY
PHA
LDA.b #$01 : STA.w SprRedrawFlag, X
LDA.l SpriteSkipEOR : BNE + ; skips on-screen check for special cases, like for prize ancilla
JSL Sprite_IsOnscreen : BCC ++ : +
; skip sending the request if busy with other things
LDA.b GameSubMode : CMP.b #$21 : BCS ++ ; skip if OW is loading Map16 GFX ; TODO: Figure out how to allow submodule 22, check DMA status instead
LDA.b LinkState : CMP.b #$14 : BEQ ++ ; skip if we're mid-mirror
LDA.b IndoorsFlag : BEQ + ; OW current doesn't occupy any slots that medallion gfx do
LDA.w GfxChrHalfSlotVerify : CMP.b #$03 : BCC +
++ PLA : JMP .return
+
; setup the palette
LDA.b 1,S : PHX : JSL GetSpritePalette_resolved : PLX : STA.w SpriteOAMProp, X
PLA
; gfx that are already present in vanilla, use that instead of a new slot
CMP.b #$34 : BCC + : CMP.b #$36+1 : BCS + ; if rupees, use animated rupee OAM slot
LDA.b IndoorsFlag : BEQ ++
LDA.b #!DynamicDropGFXSlotCount_UW
BRA +++
++ LDA.b #!DynamicDropGFXSlotCount_OW
+++ INC : STA.w SprItemGFXSlot,X
JMP .success
+ CMP.b #$24 : BEQ .key : CMP.b #$A0 : BCC + : CMP.b #$AF+1 : BCS + ; if key, use key OAM slot
.key
LDY.b LinkState : CPY.b #$19 : BCC ++ : CPY.b #$1A+1 : BCS ++ ; if getting tablet item, don't use key slot
BRA +
++
LDA.b IndoorsFlag : BEQ ++
LDA.b #!DynamicDropGFXSlotCount_UW
BRA +++
++ LDA.b #!DynamicDropGFXSlotCount_OW
+++ INC #2 : STA.w SprItemGFXSlot,X
JMP .success
+ CMP.b #$D6 : BNE + ; if good bee, use bee OAM slot
LDA.b IndoorsFlag : BEQ ++
LDA.b #!DynamicDropGFXSlotCount_UW
BRA +++
++ LDA.b #!DynamicDropGFXSlotCount_OW
+++ INC #3 : STA.w SprItemGFXSlot,X
JMP .success
+ CMP.b #$D2 : BNE + ; if fairy, use fairy OAM slot
LDA.b IndoorsFlag : BEQ ++
LDA.b #!DynamicDropGFXSlotCount_UW
BRA +++
++ LDA.b #!DynamicDropGFXSlotCount_OW
+++ INC : STA.w SprItemGFXSlot,X
JMP .success
+ CMP.b #$D1 : BNE + ; if apple, use apple OAM slot
LDA.b IndoorsFlag : BEQ ++
LDA.b #!DynamicDropGFXSlotCount_UW
BRA +++
++ LDA.b #!DynamicDropGFXSlotCount_OW
+++ INC #2 : STA.w SprItemGFXSlot,X
JMP .success
+
PHA
; check if gfx that are already present from previous requests
LDY.b #$00
- LDA.w DynamicDropGFXSlots, Y : CMP.b 1,S : BEQ +
INY : CPY.b #$0F : !BLT -
STZ.w RandoOverworldTargetEdge ; some free ram OWR also uses
BRA .newSlot
+ TYA : STA.w SprItemGFXSlot,X
PLA : JMP .success
.newSlot
PHX
LDY.b IndoorsFlag : BEQ +
LDA.b #!DynamicDropGFXSlotCount_UW-1
BRA ++
+ LDA.b #!DynamicDropGFXSlotCount_OW-1
++ STA.w DynamicDropGFXIndex
.next
LDA.w RandoOverworldTargetEdge : BNE +
; on first loop, skip over gfx slots that have some item gfx loaded
LDY.w DynamicDropGFXIndex : LDA.w DynamicDropGFXSlots, Y : BNE .slotUsed
; loop thru other sprites, check if any use the same gfx slot
+ LDY.b #$0F
- TYA : CMP.b 1,S : BEQ + ; don't check self
LDA.w SpriteAITable,Y : BEQ +
LDA.w SprRedrawFlag, Y : BNE +
LDA.w SpriteTypeTable,Y ; don't need E5 enemy big key drop and E9 powder item
CMP.b #$EB : BEQ ++ ; heart piece
CMP.b #$E4 : BEQ ++ ; enemy drop
CMP.b #$3B : BEQ ++ ; bonk item
CMP.b #$E7 : BEQ ++ ; mushroom
BRA +
++ LDA.w SprItemGFXSlot,Y : CMP.w DynamicDropGFXIndex : BNE +
; gfx slot already in use
.slotUsed
DEC.w DynamicDropGFXIndex : BMI .loopAgain : BRA .next
+ DEY : BPL -
PLX
BRA .initRequest
.loopAgain
LDA.w RandoOverworldTargetEdge : BNE .overflow
INC : STA.w RandoOverworldTargetEdge
BRA .newSlot+1
.overflow ; slot already in use, use overflow slot
STZ.w RandoOverworldTargetEdge
LDA.b #$02 : STA.w SprRedrawFlag, X
LDA.b IndoorsFlag : BEQ ++
LDA.b #!DynamicDropGFXSlotCount_UW
BRA +++
++ LDA.b #!DynamicDropGFXSlotCount_OW
+++ STA.w SprItemGFXSlot,X
PLX : PLA : BRA .return
.initRequest
LDA.b 1,S
LDY.w DynamicDropGFXIndex : STA.w DynamicDropGFXSlots, Y
TYA : STA.w SprItemGFXSlot, X
PLA
PHX
REP #$30 REP #$30
ASL : TAX AND.w #$00FF
LDA.l StandingItemGraphicsOffsets,X ASL : TAX
LDX.w ItemStackPtr LDA.l StandingItemGraphicsOffsets,X : LDX.w ItemStackPtr : STA.l ItemGFXStack,X
STA.l ItemGFXStack,X LDA.w DynamicDropGFXIndex : AND.w #$000F : ASL : TAX
LDA.w DynamicDropGFXIndex : AND.w #$000F : ASL : TAX LDA.b IndoorsFlag : AND.w #$00FF : BEQ +
LDA.l FreeUWGraphics,X LDA.l FreeUWGraphics,X : BRA ++
LDX.w ItemStackPtr + LDA.l FreeOWGraphics,X
STA.l ItemTargetStack,X ++ LDX.w ItemStackPtr : STA.l ItemTargetStack,X
TXA : INC #2 : STA.w ItemStackPtr TXA : INC #2 : STA.w ItemStackPtr
SEP #$30 SEP #$30
PLX PLX
.success
STZ.w SprRedrawFlag, X
.return
PLY : PLX
RTL RTL
;=================================================================================================== ;===================================================================================================
FreeUWGraphics: FreeUWGraphics:
dw $8800>>1 dw $8800>>1 ; Shovel Dirt
dw $8840>>1 dw $8840>>1 ; (Unused)
dw $8980>>1 dw $8980>>1 ; (Unused)
dw $9CA0>>1 dw $9960>>1 ; Arghuss/Zora Splash
dw $9DC0>>1 dw $9C00>>1 ; Heart Piece
; dw $9CA0>>1 ; Apple
dw $9DC0>>1 ; Whirlpool
; add new slots above this line
.end
; dw $8800>>1 FreeOWGraphics:
; dw $8840>>1 dw $8180>>1 ; Push Block
; dw $8980>>1 ;dw $8800>>1 ; Shovel Dirt
; dw $9960>>1 # Arghuss Splash apparently dw $9960>>1 ; Arghuss/Zora Splash
; dw $9C00>>1 dw $9C00>>1 ; Heart Piece
; dw $9CA0>>1 ;dw $9CA0>>1 ; Apple
; dw $9DC0>>1 ;dw $9DC0>>1 ; Whirlpool
; add new slots above this line
.end
FixedItemGraphics:
dw $9400>>1 ; (overflow full slot)
dw $9D40>>1 ; Fairy
dw $9CA0>>1 ; Apple
.thin
dw $9C60>>1 ; (overflow thin slot)
dw $8160>>1 ; Rupee
dw $8D60>>1 ; Key
dw $9C80>>1 ; Bee
; Below are the two default 16-byte tables that are loaded
; into SpriteDynamicOAM, and adjustments are applied afterwards
; Format of SpriteDynamicOAM:
; First 8 bytes are the top half, last 8 bytes are bottom half (unused by 16x16 gfx)
; X Offset (2 bytes)
; Y Offset (2 bytes)
; - these offsets are relative to its normal draw position
; VRAM Location (1 byte) - relative to $8000, every 8x8 tile
; increments by 1 (ie. small key is $6B)
; Palette Data (1 byte)
; TBD (2 bytes)
DynamicOAMTile_thin:
dw 4, 0 : db $00, $00, $20, $00
dw 4, 8 : db $00, $00, $20, $00
DynamicOAMTile_full:
dw 0, -1 : db $00, $00, $20, $02
dd 0, 0
;=================================================================================================== ;===================================================================================================
; Come in with
; A = item receipt ID
; X = sprite slot
; Returns with Carry flag set if gfx drawing was skipped
DrawPotItem: DrawPotItem:
PHA
; TODO: Figure out a better way to stop items during transitions, or figure
; out how to get narrow items to continue drawing narrow during transitions
; This has a side effect of ItemID $00 (unused in rando currently)
; disappearing during various submodule uses, like dialogue/trap door actions
CMP.b #$00 : BNE +
LDA.b GameSubMode : BEQ +
PLA : SEC : RTL
; TODO: allow drawing if gfx are not using a VRAM slot that changes during medallion
+ LDA.b IndoorsFlag : BEQ + ; OW current doesn't occupy any slots that medallion gfx do
LDA.w GfxChrHalfSlotVerify : CMP.b #$03 : BCC +
PLA : SEC : RTL
+
JSR PrepItemAnimation
PLA
PHX PHX
JSL AttemptItemSubstitution
JSL ResolveLootIDLong
TAX TAX
STA.b Scrap07 ; store loot ID temporarily, will get overwritten in Sprite_DrawMultiple_quantity_preset call
LDA.l BeeTrapDisguise : BEQ + LDA.l BeeTrapDisguise : BEQ +
TAX TAX : STA.b Scrap07
+ LDA.l SpriteProperties_standing_width,X : BEQ .narrow +
LDA.l SpriteProperties_standing_width,X : BEQ .narrow
.full .full
PLX PLX
LDA.b #$01 : STA.b Scrap06 LDA.b #$01 : STA.b Scrap06
LDA.b #$0C : JSL OAM_AllocateFromRegionC LDA.b #$0C : JSL OAM_AllocateFromRegionC
LDA.b #$02 : PHA LDA.b #$02 : PHA
REP #$20 REP #$20 : LDA.w #DynamicOAMTile_full
LDA.w #DynamicOAMTile_full BRA .transfer
BRA .draw
.narrow .narrow
PLX PLX
LDA.b #$02 : STA.b Scrap06 LDA.b #$02 : STA.b Scrap06
LDA.b #$10 : JSL OAM_AllocateFromRegionC LDA.b #$10 : JSL OAM_AllocateFromRegionC
LDA.b #$03 : PHA LDA.b #$03 : PHA
REP #$20 REP #$20 : LDA.w #DynamicOAMTile_thin
LDA.w #DynamicOAMTile_thin
.draw
PHB : PHK : PLB
.transfer
STA.b Scrap08 STA.b Scrap08
LDA.w SprItemGFX,X PHK : PLY : STY.b Scrap0A
AND.w #$00FF LDY.b #$7E : PHB : PHY : PLB
ASL : ASL : ASL : ASL ; transfer fixed table data into WRAM
ADC.b Scrap08 LDY.b #$0E
STA.b Scrap08 - LDA.b [$08],Y : STA.w SpriteDynamicOAM,Y
SEP #$20 DEY : DEY : BPL -
STZ.b Scrap07
LDA.b #$00 : STA.l SpriteSkipEOR LDY.b #FreeUWGraphics>>16 : PHB : PHY : PLB
JSL Sprite_DrawMultiple_quantity_preset LDA.w SprItemGFXSlot,X : AND.w #$00FF : ASL : TAY
LDA.b IndoorsFlag : AND.w #$00FF : BEQ +
CPY.b #(FreeUWGraphics_end-FreeUWGraphics) : BCC ++
TYA : SEC : SBC.w #(FreeUWGraphics_end-FreeUWGraphics) : TAY : BRA .fixed
++ LDA.w FreeUWGraphics, Y : BRA .setVRAM
+ CPY.b #(FreeOWGraphics_end-FreeOWGraphics) : BCC ++
TYA : SEC : SBC.w #(FreeOWGraphics_end-FreeOWGraphics) : TAY : BRA .fixed
++ LDA.w FreeOWGraphics, Y : BRA .setVRAM
LDA.b OAMPtr : CLC : ADC.b #$08 : STA.b OAMPtr .fixed
INC.b OAMPtr+2 LDA.b Scrap06 : LSR : BCC +
INC.b OAMPtr+2 LDA.w FixedItemGraphics, Y : BRA .setVRAM
+ LDA.w FixedItemGraphics_thin, Y
.setVRAM
LSR #4 : AND.w #$FBFF : PLB : PHA
STA.w SpriteDynamicOAM+4
LDA.b Scrap06 : LSR : PLA : BCS .adjustFull
; narrow
CLC : ADC.w #$0010 : STA.w SpriteDynamicOAM+12
CMP.w #$00F4 : BNE +
; exception for good bee, needs blank tile on top
LDA.w #$007C : STA.w SpriteDynamicOAM+4
+
.adjust
LDA.w SpriteTypeTable, X : AND.w #$00FF : CMP.w #$003B : BNE +
LDA.b RoomIndex : CMP.w #$0107 : BNE .shiftLeft ; bonk item
LDA.w SpriteTypeTable, X : AND.w #$00FF
+ CMP.w #$00E4 : BNE +
LDA.b OverworldIndex : AND.w #$00FF : CMP.w #$0018 : BEQ .shiftLeft ; bottle vendor key
+
.adjustFull
LDA.b RoomIndex : CMP.w #$0087 : BNE +
LDA.b IndoorsFlag : AND.w #$00FF : BEQ +
LDA.w SpriteTypeTable, X : AND.w #$00FF : CMP.w #$00EB : BEQ .drawSpecial
LDA.w SprItemFlags, X : AND.w #$00FF : BEQ .shiftUpLeft ; hera cage item
BRA .shiftLeft
+
LDA.w SprItemFlags, X : AND.w #$00FF : BEQ .drawSpecial
.shiftUpLeft
DEC.w SpriteDynamicOAM+2 : DEC.w SpriteDynamicOAM+10
.shiftLeft
LDA.w SpriteDynamicOAM : SEC : SBC.w #$0004
STA.w SpriteDynamicOAM : STA.w SpriteDynamicOAM+8
.drawSpecial
; special animation handling
LDY.b Scrap07 : CPY.b #$D2 : BNE + ; fairy
LDY.w SpriteDirectionTable, X : BEQ ++ : CPY.b #$03 : BEQ ++ ; use other fairy GFX
LDA.w SpriteDynamicOAM+4 : CLC : ADC.w #$0002 : STA.w SpriteDynamicOAM+4
++ CPY.b #$02 : BCC .draw ; move fairy up 2 pixels
LDA.w SpriteDynamicOAM+2 : SEC : SBC.w #$0002 : STA.w SpriteDynamicOAM+2
BRA .draw
+ CPY.b #$D6 : BNE + ; good bee
LDY.w SpriteDirectionTable, X : BEQ ++ : CPY.b #$03 : BEQ ++ ; use other bee GFX
LDA.w SpriteDynamicOAM+12 : SEC : SBC.w #$0010 : STA.w SpriteDynamicOAM+12
++ CPY.b #$02 : BCC + ; move bee up 2 pixels
LDA.w SpriteDynamicOAM+10 : SEC : SBC.w #$0002 : STA.w SpriteDynamicOAM+10
+
.draw
LDA.w #SpriteDynamicOAM : STA.b Scrap08
SEP #$20
STZ.b Scrap07
LDA.b #$00 : STA.l SpriteSkipEOR
JSL Sprite_DrawMultiple_quantity_preset
PLB PLB
LDA.b OAMPtr : CLC : ADC.b #$08 : STA.b OAMPtr
INC.b OAMPtr+2 : INC.b OAMPtr+2
PLA PLA
CLC
RTL RTL
DynamicOAMTile_thin: DynamicDropGFXClear:
dw 0, 0 : db $40, $00, $20, $00 PHA : PHX
dw 0, 8 : db $50, $00, $20, $00 LDX.b #$0E
- STZ.w DynamicDropGFXSlots, X : DEX : BPL -
PLX : PLA
RTL
dw 0, 0 : db $42, $00, $20, $00 ConditionalPushBlockTransfer:
dw 0, 8 : db $52, $00, $20, $00 LDA.b IndoorsFlag : BNE +
LDA.b #$0F ; don't transfer push block when on the OW
BRA .return-3
+
LDA.b #$1F : STA.w DMAENABLE ; what we wrote over
.return
RTL
dw 0, 0 : db $4C, $00, $20, $00 PrepItemAnimation:
dw 0, 8 : db $5C, $00, $20, $00 LDA.b FrameCounter : AND.b #$30 : LSR #4 : STA.w SpriteDirectionTable, X
RTS
dw 0, 0 : db $E5, $00, $20, $00 PrepAncillaAnimation:
dw 0, 8 : db $F5, $00, $20, $00 PHP : SEP #$20
LDA.b FrameCounter : AND.b #$30 : LSR #4 : STA.w AncillaDirection, X
PLP
RTL
dw 0, 0 : db $EE, $00, $20, $00 WaitForNewVBlank:
dw 0, 8 : db $FE, $00, $20, $00 LDA.b #$00 : STA.w NMITIMEN ; Disable interrupts
- LDA.w RDNMI : BMI - ; Wait until v-blank is over
- LDA.w RDNMI : BPL - ; Wait until v-blank starts
LDA.b #$80 : STA.w NMITIMEN
RTL
DynamicOAMTile_full: TransferCommonToVRAM:
dw -4, -1 : db $40, $00, $20, $02 PHP
dd 0, 0 REP #$21
SEP #$10
dw -4, -1 : db $42, $00, $20, $02 LDA.w #BigDecompressionBuffer+$2400
dd 0, 0 LDX.b #BigDecompressionBuffer>>16
STA.w $4302
STX.w $4304
dw -4, -1 : db $4C, $00, $20, $02 LDX.b #$80 : STX.w $2115
dd 0, 0 LDA.w #$1801 : STA.w $4300
LDA.w #$1000 : STA.w $4305
LDA.w #$4800 : STA.w $2116
LDX.b #$01 : STX.w DMAENABLE
dw -4, -1 : db $E5, $00, $20, $02 PLP
dd 0, 0 RTL
pushpc
; fix Arghuss/Zora splash graphics
org $868595
db $E7, $E7, $E7, $E7, $E7, $C0, $C0
pullpc
dw -4, -1 : db $EE, $00, $20, $02
dd 0, 0

View File

@@ -1,4 +1,7 @@
; hooks ; hooks
org $81DB19
JSL MaybeSkipSmashTerrain : BCS $81DB11
org $81E6B0 org $81E6B0
JSL RevealPotItem JSL RevealPotItem
RTS RTS
@@ -9,10 +12,6 @@ org $829C25
org $89C2BB org $89C2BB
JSL ClearSpriteData JSL ClearSpriteData
; underworld -> overworld transition
org $8282D1
JSL ClearSpriteData2
org $89C327 org $89C327
JSL LoadSpriteData JSL LoadSpriteData
@@ -43,6 +42,9 @@ org $86d180
org $86d18d ; <- 3518D - sprite_absorbable.asm : 274 (LDA $7EF36F : INC A : STA $7EF36F) org $86d18d ; <- 3518D - sprite_absorbable.asm : 274 (LDA $7EF36F : INC A : STA $7EF36F)
JSL KeyGet JSL KeyGet
org $86E24A
JSR MaybeSkipTerrainDebris
org $86f9f3 ; bank06.asm : 6732 (JSL SpritePrep_LoadProperties) org $86f9f3 ; bank06.asm : 6732 (JSL SpritePrep_LoadProperties)
JSL LoadProperties_PreserveCertainProps JSL LoadProperties_PreserveCertainProps
@@ -50,6 +52,11 @@ org $86828A
Sprite_SpawnSecret_SpriteSpawnDynamically: Sprite_SpawnSecret_SpriteSpawnDynamically:
JSL CheckSprite_Spawn JSL CheckSprite_Spawn
org $87B114
JSL MaybeUnableToLiftPotSfx
NOP #4
db $30 ; BMI
org $87B169 org $87B169
JSL PreventPotSpawn : NOP JSL PreventPotSpawn : NOP
@@ -84,13 +91,25 @@ InitializeMirrorHDMA:
org $89D62E org $89D62E
UWSpritesPointers: ; 0x250 bytes for 0x128 rooms' 16-bit pointers UWSpritesPointers: ; 0x250 bytes for 0x128 rooms' 16-bit pointers
org $89D87E if !FEATURE_FIX_BASEROM
org $81DB67
else
org $89D87E
endif
UWPotsPointers: ; 0x250 bytes for 0x128 rooms' 16-bit pointers UWPotsPointers: ; 0x250 bytes for 0x128 rooms' 16-bit pointers
org $89DACE if !FEATURE_FIX_BASEROM
org $01DDE7
else
org $89DACE
endif
UWPotsData: ; variable number of bytes (max 0x11D1) for all pots data UWPotsData: ; variable number of bytes (max 0x11D1) for all pots data
org $A88000 if !FEATURE_FIX_BASEROM
org $89D92E
else
org $A88000
endif
UWSpritesData: ; variable number of bytes (max 0x2800) for all sprites and sprite drop data UWSpritesData: ; variable number of bytes (max 0x2800) for all sprites and sprite drop data
; First $2800 bytes of this bank (28) is reserved for the sprite tables ; First $2800 bytes of this bank (28) is reserved for the sprite tables
@@ -181,7 +200,7 @@ RevealPotItem:
LDA.b RoomIndex : ASL : TAX LDA.b RoomIndex : ASL : TAX
LDA.l UWPotsPointers,X : STA.b Scrap00 ; we may move this LDA.l UWPotsPointers, X : STA.b Scrap00 ; we may move this
LDA.w #UWPotsPointers>>16 : STA.b Scrap02 LDA.w #UWPotsPointers>>16 : STA.b Scrap02
LDY.w #$FFFD : LDX.w #$FFFF LDY.w #$FFFD : LDX.w #$FFFF
@@ -272,6 +291,12 @@ SaveMajorItemDrop:
LDA.w #$0018 : BRA .substitute LDA.w #$0018 : BRA .substitute
+ CPY.w #$0031 : BNE + ; 10 pack bombs + CPY.w #$0031 : BNE + ; 10 pack bombs
LDA.w #$0019 : BRA .substitute LDA.w #$0019 : BRA .substitute
+ CPY.w #$00D1 : BNE + ; Apples
LDA.w #$001A : BRA .substitute
+ CPY.w #$00D0 : BNE + ; Bee Trap
LDA.w #$001B : BRA .substitute
+ CPY.w #$00D6 : BNE + ; Good Bee
LDA.w #$001C : BRA .substitute
+ STA.w $0B9C ; indicates we should use the key routines or a substitute + STA.w $0B9C ; indicates we should use the key routines or a substitute
RTL RTL
.substitute .substitute
@@ -325,19 +350,16 @@ ClearSpriteData:
.shared: .shared:
PHX PHX
LDA.b #$00 : LDX.b #$00 LDX.b #$0F
.loop .loop
STA.w SprDropsItem, X : STA.w SprItemReceipt, X : STA.w SprItemIndex, X STZ.w SprDropsItem, X : STZ.w SprItemIndex, X : STZ.w SprItemFlags, X
STA.w SprItemMWPlayer, X : STA.w SprItemFlags, X STZ.w SprSourceItemId, X : STZ.w SprItemReceipt, X : STZ.w SprItemMWPlayer, X
INX : CPX.b #$10 : BCC .loop STZ.w SprRedrawFlag, X
DEX : BPL .loop
JSR SetupEnemyDropIndicator JSR SetupEnemyDropIndicator
PLX PLX
RTL RTL
ClearSpriteData2:
LDA.b #$82 : STA.b $99
JMP ClearSpriteData_shared
; this routine determines whether enemies still have drops or not ; this routine determines whether enemies still have drops or not
; and sets EnemyDropIndicator appropriately ; and sets EnemyDropIndicator appropriately
@@ -353,7 +375,7 @@ SetupEnemyDropIndicator:
; LDA.w DungeonID : AND.w #$00FF : CMP.w #$00FF : BEQ .skipCompassChecks ; LDA.w DungeonID : AND.w #$00FF : CMP.w #$00FF : BEQ .skipCompassChecks
; compass checks ; compass checks
; does compass for dungeon exist? ; does compass for dungeon exist?
; LSR : TAX : LDA.l ExistsTransfer, X : TAX : LDA.l CompassExists, X : BEQ .skipCompassChecks ; LSR : TAX : LDA.l CompassExists : AND.l DungeonItemMasks,X : BEQ .skipCompassChecks
; do we have the compass ; do we have the compass
; sewers? outstanding? ; sewers? outstanding?
; LDA.l CompassField : LDX.w DungeonID : AND.l DungeonMask, X : BEQ .done ; LDA.l CompassField : LDX.w DungeonID : AND.l DungeonMask, X : BEQ .done
@@ -400,7 +422,7 @@ LoadSpriteData:
LDA.b #$01 : STA.w SprDropsItem, X LDA.b #$01 : STA.w SprDropsItem, X
DEY DEY
.common .common
DEY : LDA.b [Scrap00], Y : STA.w SprItemReceipt, X DEY : LDA.b [Scrap00], Y : STA.w SprSourceItemId, X
STA.b Scrap0E STA.b Scrap0E
LDA.w SprItemMWPlayer, X : BNE + ; skip if multiworld LDA.w SprItemMWPlayer, X : BNE + ; skip if multiworld
PHX PHX
@@ -430,7 +452,7 @@ CheckIfDropValid:
;This section sets up the drop ;This section sets up the drop
LDA.b #$02 : STA.w SpawnedItemFlag LDA.b #$02 : STA.w SpawnedItemFlag
STX.w SpawnedItemIndex STX.w SpawnedItemIndex
LDA.w SprItemReceipt, X : STA.w SpawnedItemID LDA.w SprSourceItemId, X : STA.w SpawnedItemID
LDA.w SprItemMWPlayer, X : STA.w SpawnedItemMWPlayer LDA.w SprItemMWPlayer, X : STA.w SpawnedItemMWPlayer
LDY.b #$01 ; trigger the small key routines LDY.b #$01 ; trigger the small key routines
LDA.w SpawnedItemID : STA.b Scrap00 : CMP.b #$32 : BNE + LDA.w SpawnedItemID : STA.b Scrap00 : CMP.b #$32 : BNE +
@@ -533,10 +555,12 @@ db $36, $DB ; RED RUPEE ($36)
db $42, $D8 ; HEART ($42) db $42, $D8 ; HEART ($42)
db $44, $E2 ; ARROW REFILL 10 ($44) db $44, $E2 ; ARROW REFILL 10 ($44)
db $45, $DF ; SMALL MAGIC DECANTER ($45) db $45, $DF ; SMALL MAGIC DECANTER ($45)
db $D1, $AC ; APPLES ($D1)
db $D2, $E3 ; FAERIE ($D2) db $D2, $E3 ; FAERIE ($D2)
db $D3, $0B ; CUCCO ($D3) db $D3, $0B ; CUCCO ($D3)
db $D4, $E0 ; LARGE MAGIC DECANTER ($D4) db $D4, $E0 ; LARGE MAGIC DECANTER ($D4)
db $D5, $E1 ; ARROW REFILL 5 (x$D5) db $D5, $E1 ; ARROW REFILL 5 ($D5)
db $D6, $79 ; GOOD BEE ($D6)
IncrementCountForMinor: IncrementCountForMinor:
@@ -617,21 +641,16 @@ SpriteKeyPrep:
CPX.b #$0A : BNE .continue ; the hera basement key is always sprite 0x0A CPX.b #$0A : BNE .continue ; the hera basement key is always sprite 0x0A
LDA.b LinkQuadrantH : ORA.b LinkQuadrantV : AND.b #$03 : CMP.b #$02 : BNE .continue LDA.b LinkQuadrantH : ORA.b LinkQuadrantV : AND.b #$03 : CMP.b #$02 : BNE .continue
LDA.b #$00 : STA.w SpawnedItemFlag : STA.w SprItemFlags, X LDA.b #$00 : STA.w SpawnedItemFlag : STA.w SprItemFlags, X
LDA.b #$24 : STA.w $0E80, X LDA.b #$24 : STA.w SprSourceItemId, X : STA.w SprItemReceipt, X
BRA + BRA +
.continue .continue
LDA.w SpawnedItemIndex : STA.w SprItemIndex, X LDA.w SpawnedItemIndex : STA.w SprItemIndex, X
LDA.w SpawnedItemMWPlayer : STA.w SprItemMWPlayer, X : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID LDA.w SpawnedItemMWPlayer : STA.w SprItemMWPlayer, X : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA.w SpawnedItemFlag : STA.w SprItemFlags, X : BEQ + LDA.w SpawnedItemFlag : STA.w SprItemFlags, X : BEQ +
LDA.w SpawnedItemID : STA.w $0E80, X LDA.w SpawnedItemID : STA.w SprSourceItemId, X
PHA : PHY : PHX INC.w ItemReceiptMethod
JSL GetSpritePalette : PLX : STA.w SpriteOAMProp, X ; setup the palette JSL RequestStandingItemVRAMSlot
PLY : PLA STZ.w ItemReceiptMethod
CMP.b #$24 : BNE ++ ;
LDA.b RoomIndex : CMP.b #$80 : BNE +
LDA.w SpawnedItemFlag : BNE +
LDA.b #$24 ; it's the big key drop?
++ JSL RequestStandingItemVRAMSlot
+ PLA + PLA
RTL RTL
@@ -639,21 +658,35 @@ SpriteKeyDrawGFX:
JSL Sprite_DrawRippleIfInWater JSL Sprite_DrawRippleIfInWater
PHA PHA
LDA.w SprItemMWPlayer, X : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID LDA.w SprItemMWPlayer, X : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA.w $0E80, X LDA.w SprRedrawFlag, X : BEQ +
CMP.b #$24 : BNE + LDA.w SprSourceItemId, X
LDA.b RoomIndex : CMP.b #$80 : BNE ++ JSL RequestStandingItemVRAMSlot
LDA.w SpawnedItemFlag : BNE ++ LDA.w SprRedrawFlag, X : CMP.b #$02 : BEQ +
LDA.b #$24 : BRA + BRA .skipDraw
++ PLA + LDA.w SprItemReceipt, X
PHK : PEA.w .jslrtsreturn-1 CMP.b #$24 : BNE +
PEA.w $868014 ; an rtl address - 1 in Bank06 LDA.b RoomIndex : CMP.b #$80 : BNE ++
JML Sprite_DrawAbsorbable LDA.w SpawnedItemFlag : BNE ++
.jslrtsreturn LDA.b #$24 : BRA +
RTL ++ PLA
+ JSL DrawPotItem PHK : PEA.w .jslrtsreturn-1
CMP.b #$03 : BNE + PEA.w $868014 ; an rtl address - 1 in Bank06
PHA : LDA.w SpriteControl, X : ORA.b #$20 : STA.w SpriteControl, X : PLA JML Sprite_DrawAbsorbable
+ JSL Sprite_DrawShadowLong .jslrtsreturn
RTL
+ JSL DrawPotItem : BCS .skipDraw
; draw shadow
CMP.b #$02 : BNE +
PHA
LDA.w SpriteControl, X : AND.b #$DF : STA.w SpriteControl, X
REP #$20
LDA.b Scrap00 : SEC : SBC.w #$0004 : STA.b Scrap00
SEP #$20
PLA
+ CMP.b #$03 : BNE +
PHA : LDA.w SpriteControl, X : ORA.b #$20 : STA.w SpriteControl, X : PLA
+ JSL Sprite_DrawShadowLong
.skipDraw
PLA : RTL PLA : RTL
KeyGet: KeyGet:
@@ -661,7 +694,7 @@ KeyGet:
PHA PHA
LDA.l StandingItemsOn : BNE + LDA.l StandingItemsOn : BNE +
PLA : RTL PLA : RTL
+ LDY.w $0E80, X + LDY.w SprSourceItemId, X
LDA.w SprItemIndex, X : STA.w SpawnedItemIndex LDA.w SprItemIndex, X : STA.w SpawnedItemIndex
LDA.w SprItemFlags, X : STA.w SpawnedItemFlag LDA.w SprItemFlags, X : STA.w SpawnedItemFlag
STY.b Scrap00 STY.b Scrap00
@@ -683,7 +716,7 @@ KeyGet:
.skip PLX .skip PLX
.receive .receive
JSL Player_HaltDashAttackLong JSL Player_HaltDashAttackLong
TYA : JSL AttemptItemSubstitution : JSL ResolveLootIDLong : TAY TYA : JSL AttemptItemSubstitution : TAY
JSL Link_ReceiveItem JSL Link_ReceiveItem
PLA : DEC : RTL PLA : DEC : RTL
@@ -691,7 +724,7 @@ KeyTable:
db $A0, $A0, $A2, $A3, $A4, $A5, $A6, $A7, $A8, $A9, $AA, $AB, $AC, $AD db $A0, $A0, $A2, $A3, $A4, $A5, $A6, $A7, $A8, $A9, $AA, $AB, $AC, $AD
BigKeyGet: BigKeyGet:
LDY.w $0E80, X LDY.w SprSourceItemId, X
CPY.b #$32 : BNE + CPY.b #$32 : BNE +
STZ.w ItemReceiptMethod : LDY.b #$32 ; what we wrote over STZ.w ItemReceiptMethod : LDY.b #$32 ; what we wrote over
PHX : JSL Link_ReceiveItem : PLX ; what we wrote over PHX : JSL Link_ReceiveItem : PLX ; what we wrote over
@@ -703,9 +736,7 @@ LoadProperties_PreserveCertainProps:
CMP.b #$E5 : BEQ + CMP.b #$E5 : BEQ +
JML SpritePrep_LoadProperties JML SpritePrep_LoadProperties
+ LDA.w SpriteOAMProp, X : PHA + LDA.w SpriteOAMProp, X : PHA
LDA.w $0E80, X : PHA
JSL SpritePrep_LoadProperties JSL SpritePrep_LoadProperties
PLA : STA.w $0E80, X
PLA : STA.w SpriteOAMProp, X PLA : STA.w SpriteOAMProp, X
RTL RTL
@@ -724,6 +755,9 @@ SubstitionTable:
db $E2 ; ARROW REFILL 10 - 0x17 db $E2 ; ARROW REFILL 10 - 0x17
db $DD ; BOMB REFILL 4 - 0x18 db $DD ; BOMB REFILL 4 - 0x18
db $DE ; BOMB REFILL 8 - 0x19 db $DE ; BOMB REFILL 8 - 0x19
db $AC ; APPLES - 0x1A
db $79 ; BEE TRAP - 0x1B
db $79 ; GOOD BEE - 0x1C
SubstituteSpriteId: SubstituteSpriteId:
@@ -741,12 +775,27 @@ RTS
CheckSprite_Spawn: CheckSprite_Spawn:
JSR SubstituteSpriteId JSR SubstituteSpriteId
CPY.b #$1C : BNE + ; good bee handling
JSL Sprite_SpawnDynamically
BMI .check
PHX
TYX : JSL SpritePrep_LoadProperties
PLX
JSL GoldBee_SpawnSelf_SetProperties
PLA : PLA : PLA ; pop the return address
PHX : LDX.b #$03
JML Sprite_SpawnSecret_SetCoords
+ CPY.b #$1A : BCC + ; all other non-normal pot sprite spawns
JSL Sprite_SpawnDynamically
BMI .check
LDA.b #$10 : STA.b Scrap0D ; lets the outside code treat this sprite like a Stal (most normal table values)
RTL
+
JSL Sprite_SpawnDynamically JSL Sprite_SpawnDynamically
BMI .check BMI .check
RTL RTL
.check .check
LDA.b Scrap0D : CMP.b #$08 : BNE + LDA.b Scrap0D : CMP.b #$08 : BNE +
LDA.w LinkDashing : BNE .error
LDX.b #$0F LDX.b #$0F
; loop looking for a Sprite with state 0A (carried by the player) ; loop looking for a Sprite with state 0A (carried by the player)
@@ -757,7 +806,9 @@ RTL
LDA.b #$00 : STZ.w SpriteAITable, X LDA.b #$00 : STZ.w SpriteAITable, X
LDA.b #$E4 : JSL Sprite_SpawnDynamically LDA.b #$E4 : JSL Sprite_SpawnDynamically
BMI .error BMI .error
LDA.b #$40 : TSB.w AButtonAct : RTL LDA.w UseY1 : AND.b #$02 : BNE ++
LDA.b #$40 : TSB.w AButtonAct
++ RTL
.error .error
LDA.b #$3C ; SFX2_3C - error beep LDA.b #$3C ; SFX2_3C - error beep
@@ -776,22 +827,136 @@ PreventPotSpawn2:
LDA.b #$01 : TSB.b LinkStrafe ; what we wrote over LDA.b #$01 : TSB.b LinkStrafe ; what we wrote over
+ RTL + RTL
MaybeSkipTerrainDebris_long:
STZ.w SecretId ; what we wrote over
LDA.w SpriteTypeTable, X : CMP.b #$EC
BEQ .return
PLA : PLA : PLA : PLA : PLA
LDA.b #Sprite_ScheduleForBreakage_exit>>16 : PHA
PEA.w Sprite_ScheduleForBreakage_exit-1
.return
RTL
MaybeSkipSmashTerrain:
STY.w ManipIndex : LDA.w ManipTileMapX, Y ; what we wrote over
PHA
SEP #$30
LDX.b #$0F
- LDA.w SpriteAITable, X : BEQ .continue
DEX
BPL -
.skip
PLA : PLA
LDA.b #$3C : STA.w SFX2 ; error beep
SEC
RTL
.continue
REP #$30
PLA
CLC
RTL
MaybeUnableToLiftPotSfx:
- LDA.w SpriteAITable,X : BEQ .return
DEX
BPL -
LDA.b #$3C : STA.w SFX2 ; error beep
LDA.b #$FF
.return
RTL
CheckIfPotIsSpecial: CheckIfPotIsSpecial:
TXA ; give index to A so we can do a CMP.l TXA ; give index to A so we can do a CMP.l
CMP.l $018550 ; see if our current index is that of object 230 CMP.l $018550 ; see if our current index is that of object 230
BEQ .specialpot BNE .normal_pot
; Normal pot, so run the vanilla code .special_pot
PHX
; get pot index and cache room ID offset
LDA.b RoomIndex : ASL : STA.b Scrap0E
TAX
LDA.b $08
BIT.b $BF : BVC .upper ; if $BF has bit 14 set, it's upper layer
ORA.w #$2000 ; set the lower layer bit ($2000)
.upper
STA.b $90 ; cache tilemap offset
LDA.l UWPotsPointers,X : TAX
LDY.w #$0000
.next_pot
LDA.l UWPotsPointers&$FF0000, X ; read only the bank
CMP.w #$FFFF
BEQ .nothing
AND.w #$3FFF ; mask out the first three bits (used for item indicators and layer)
CMP.b $90 ; check against the tilemap offset
BEQ .get_flag
INX #3
INY #2
BRA .next_pot
.get_flag
TYX
LDA.l BitFieldMasks,X
LDX.b Scrap0E ; get room ID
STA.b Scrap0E
LDA.l RoomPotData,X
BRA .check_pot
.nothing
INC ; from FFFF, A is now 0000 so the AND always fails
.check_pot
LDY.b $08 : PLX
AND.b Scrap0E
BEQ .exit ; zero flag will be set, which is what we want
LDX.w #$0E82 ; the normal pot obj. See RoomDrawObjectData_#obj0E82
.normal_pot
; Normal pot, so run the vanilla code
LDA.l CurrentWorld ; check for dark world LDA.l CurrentWorld ; check for dark world
.specialpot ; zero flag already set, so gtg .exit
RTL RTL
SetTheSceneFix: SetTheSceneFix:
STZ.b $6C STZ.b $6C
JSL InitializeMirrorHDMA JSL InitializeMirrorHDMA
JSL LoadCommonSprites_long JSL WaitForNewVBlank
JSL TransferCommonToVRAM
RTL RTL
pushpc
org $868072
JSL SetBottleVendorKey : NOP #4
pullpc
SetBottleVendorKey:
LDA.w SpriteTypeTable,Y : CMP.b #$E4 : BNE +
; small key from bottle vendor
LDA.b #$AF : STA.w SprSourceItemId,Y
LDA.b #$01 : STA.w SprRedrawFlag, Y
BRA .shift
+ CMP.b #$DE : BEQ .return
CMP.b #$E2 : BEQ .return
; shift narrow sprite to left by 4
.shift
LDA.b Scrap00 : CLC : ADC.b #$04 : STA.w SpritePosXLow,Y ; what we wrote over
.return
RTL
ConditionalLoadCommonSprites_Do3To4Low:
LDA.b GameMode : CMP.b #$01 : BEQ + ; what we wrote over
CMP.b #$0E : BEQ ++
JML LoadCommonSprites_Prep3To4Low
+ JML LoadCommonSprites_in_file_select
++ LDA.b #$50 : STA.w $2117 ; skip over some DMA bytes
JML Sound_LoadLightWorldSongBank-1 ; just some RTS in Bank 00
incsrc dynamic_si_vram.asm incsrc dynamic_si_vram.asm
;=================================================================================================== ;===================================================================================================

View File

@@ -6,12 +6,30 @@
LampCheck: LampCheck:
LDA.l LightConeModifier : BNE .lamp LDA.l LightConeModifier : BNE .lamp
LDA.l LampEquipment : BNE .lamp ; skip if we already have lantern LDA.l LampEquipment : BNE .lamp ; skip if we already have lantern
LDA.l LampCone : AND.b #$10 : BNE .lamp
LDA.w DungeonID : CMP.b #$04 : BCS + ; are we en HC? LDA.w DungeonID : CMP.b #$04 : BCS + ; are we en HC?
LDA.l LampConeSewers : RTL LDA.l LampCone : AND.b #$01 : RTL
+ : TDC + : TDC
.lamp .lamp
RTL RTL
;================================================================================ ;================================================================================
; Dark Room checks
;--------------------------------------------------------------------------------
; Output: 0 for normal room, 1 for darkness
;--------------------------------------------------------------------------------
DarkRoomCheck:
LDA.l LampCone : AND.b #$20 : BNE .no_dark
LDA.b [$0D], Y
AND.b #$01
RTL
.no_dark
LDA.b $A0 : ORA.b $A1 : BNE .not_dark
LDA.b #$01 ; ganon's room
RTL
.not_dark
LDA.b #$00 ; not ganon's room, so no darkness
RTL
;================================================================================
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; Output: 0 locked, 1 open ; Output: 0 locked, 1 open
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------

View File

@@ -2,6 +2,13 @@
; Maiden Crystal Fixes ; Maiden Crystal Fixes
;================================================================================ ;================================================================================
pushpc
org $9ECE25
STZ.w $1F00 : NOP : NOP ; fix to allow VRAM corruption during Blind fight
pullpc
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; MaidenCrystalScript ; MaidenCrystalScript
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------

135
menu/compress.py Normal file
View File

@@ -0,0 +1,135 @@
import sys
import os
# Compression function reverse-engineered from ALTTP's decompression routine at $00E7DE
def compress(data):
out = bytearray()
i = 0
while i < len(data):
# Check for repeating byte pattern
if i + 1 < len(data) and data[i] == data[i + 1]:
length = 2
while i + length < len(data) and data[i] == data[i + length] and length < 32:
length += 1
# Repeating byte: 0x20-0x3F
out.append(0x20 | (length - 1))
out.append(data[i])
i += length
continue
# Check for incremental byte pattern
if i + 2 < len(data) and data[i + 1] == data[i] + 1 and data[i + 2] == data[i] + 2:
length = 3
while i + length < len(data) and data[i + length] == data[i] + length and length < 32:
length += 1
# Incremental: 0x60-0x7F
out.append(0x60 | (length - 1))
out.append(data[i])
i += length
continue
# Check for repeating word pattern (alternating two bytes)
if i + 3 < len(data):
# Check if we have an alternating pattern: A B A B...
byte_a = data[i]
byte_b = data[i + 1]
length = 2
while i + length < len(data) and length < 32:
if length % 2 == 0:
if data[i + length] != byte_a:
break
else:
if data[i + length] != byte_b:
break
length += 1
if length >= 4: # Need at least 4 bytes (2 alternations) to make it worthwhile
# Repeating word: 0x40-0x5F
out.append(0x40 | (length - 1))
out.append(byte_a)
out.append(byte_b)
i += length
continue
# Check for copy from past (LZ with absolute offset)
best_len = 0
best_off = 0
search_start = max(0, i - 65536) # Can reference anywhere in output
for j in range(search_start, i):
length = 0
while i + length < len(data) and data[j + length] == data[i + length] and length < 1024:
length += 1
if length >= 2 and length > best_len:
best_len = length
best_off = j # Absolute offset, not relative!
if best_len >= 2:
# Copy from past: 0x80-0xDF or 0xE0-0xFE (extended)
# Offset is ABSOLUTE position in the output buffer
if best_len <= 32:
# Standard copy: 0x80-0xDF (5 bits for length-1, 16 bits for absolute offset)
out.append(0x80 | ((best_len - 1) & 0x1F))
out.append(best_off & 0xFF)
out.append((best_off >> 8) & 0xFF)
else:
# Extended copy: 0xE0-0xFE
if best_len > 1024:
best_len = 1024
# Command byte: 111LLLLL where L is length bits
cmd = 0xE0 | (((best_len - 1) >> 8) & 0x1F)
out.append(cmd)
out.append((best_len - 1) & 0xFF)
out.append(best_off & 0xFF)
out.append((best_off >> 8) & 0xFF)
i += best_len
continue
# Raw copy (no pattern found)
size = 1
while size < 32 and i + size < len(data):
# Don't extend raw copy if we find a better pattern ahead
if i + size + 1 < len(data) and data[i + size] == data[i + size + 1]:
break
if i + size + 2 < len(data) and data[i + size + 1] == data[i + size] + 1:
break
# Check LZ
found_lz = False
for j in range(max(0, i + size - 2048), i + size):
if i + size + 1 < len(data) and data[j] == data[i + size] and data[j + 1] == data[i + size + 1]:
found_lz = True
break
if found_lz:
break
size += 1
# Raw copy: 0x00-0x1F
out.append(size - 1)
out.extend(data[i:i + size])
i += size
# End marker
out.append(0xFF)
return out
if __name__ == '__main__':
if len(sys.argv) != 3:
print("Usage: python compress.py <input_file> <output_file>")
sys.exit(1)
input_file_path = sys.argv[1]
output_file_path = sys.argv[2]
if not os.path.exists(input_file_path):
print(f"Error: Input file not found at {input_file_path}")
sys.exit(1)
with open(input_file_path, 'rb') as f:
input_data = f.read()
compressed_data = compress(input_data)
with open(output_file_path, 'wb') as f:
f.write(compressed_data)
print(f"Successfully compressed '{input_file_path}' to '{output_file_path}'")

112
menu/decompress.py Normal file
View File

@@ -0,0 +1,112 @@
import sys
def decompress(compressed_data):
out = bytearray()
i = 0
while i < len(compressed_data):
cmd = compressed_data[i]
if cmd == 0xFF:
# End marker
break
i += 1
# Decode based on top 3 bits
top_bits = cmd & 0xE0
if cmd < 0xE0:
# Standard commands
length = (cmd & 0x1F) + 1
if top_bits == 0x00:
# Raw copy
out.extend(compressed_data[i:i+length])
i += length
elif top_bits == 0x20:
# Repeating byte
byte_val = compressed_data[i]
out.extend([byte_val] * length)
i += 1
elif top_bits == 0x40:
# Repeating word - alternates between two bytes
byte_a = compressed_data[i]
byte_b = compressed_data[i+1]
for j in range(length):
if j % 2 == 0:
out.append(byte_a)
else:
out.append(byte_b)
i += 2
elif top_bits == 0x60:
# Incremental
start_val = compressed_data[i]
for j in range(length):
out.append((start_val + j) & 0xFF)
i += 1
elif top_bits >= 0x80:
# Copy from past (absolute offset)
offset = compressed_data[i] | (compressed_data[i+1] << 8)
for j in range(length):
out.append(out[offset + j])
i += 2
else:
# Extended command (0xE0-0xFE)
# Command type from bits 5-7 (after shifting)
cmd_type = ((cmd << 3) & 0xE0)
# Length from bits 0-1 of command (high) + next byte (low)
length_high = cmd & 0x03
length_low = compressed_data[i]
length = (length_high << 8) | length_low
length += 1
i += 1
if cmd_type == 0x00:
# Extended raw copy
out.extend(compressed_data[i:i+length])
i += length
elif cmd_type == 0x20:
# Extended repeating byte
byte_val = compressed_data[i]
out.extend([byte_val] * length)
i += 1
elif cmd_type == 0x40:
# Extended repeating word - alternates between two bytes
byte_a = compressed_data[i]
byte_b = compressed_data[i+1]
for j in range(length):
if j % 2 == 0:
out.append(byte_a)
else:
out.append(byte_b)
i += 2
elif cmd_type == 0x60:
# Extended incremental
start_val = compressed_data[i]
for j in range(length):
out.append((start_val + j) & 0xFF)
i += 1
elif cmd_type >= 0x80:
# Extended copy from past
offset = compressed_data[i] | (compressed_data[i+1] << 8)
for j in range(length):
out.append(out[offset + j])
i += 2
return out
if __name__ == '__main__':
if len(sys.argv) != 3:
print("Usage: python decompress.py <input_file> <output_file>")
sys.exit(1)
with open(sys.argv[1], 'rb') as f:
compressed = f.read()
decompressed = decompress(compressed)
with open(sys.argv[2], 'wb') as f:
f.write(decompressed)
print(f"Decompressed {len(compressed)} bytes to {len(decompressed)} bytes")

BIN
menu/dr_sheet_dc.2bpp Normal file

Binary file not shown.

BIN
menu/dr_sheet_dc.2bppc Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
menu/map_icons.3bpp Normal file

Binary file not shown.

BIN
menu/map_icons.dat Normal file

Binary file not shown.

BIN
menu/map_icons.pal Normal file

Binary file not shown.

BIN
menu/map_icons_1.3bppc Normal file

Binary file not shown.

BIN
menu/map_icons_2.3bppc Normal file

Binary file not shown.

BIN
menu/map_icons_3.3bppc Normal file

Binary file not shown.

BIN
menu/map_sheet_d4.3bpp Normal file

Binary file not shown.

BIN
menu/map_sheet_d4.3bppc Normal file

Binary file not shown.

View File

@@ -1,146 +1,468 @@
pushpc pushpc
org $8ABABE : JSL WorldMap_LoadChrHalfSlot
org $8ABDF6
WorldMapIcon_DungeonPointers: ; dungeon idx order
dw WorldMapIcon_pos_hc
dw $0000
dw WorldMapIcon_pos_ep
dw WorldMapIcon_pos_dp
dw WorldMapIcon_pos_at
dw WorldMapIcon_pos_sp
dw WorldMapIcon_pos_pod
dw WorldMapIcon_pos_mm
dw WorldMapIcon_pos_sw
dw WorldMapIcon_pos_ip
dw WorldMapIcon_pos_toh
dw WorldMapIcon_pos_tt
dw WorldMapIcon_pos_tr
dw WorldMapIcon_pos_gt
WorldMapIcon_ExtraPointers: ; dungeon idx order
dw WorldMapIcon_extrapos_hc
dw $0000
dw $0000
dw WorldMapIcon_extrapos_dp
dw $0000
dw $0000
dw $0000
dw $0000
dw WorldMapIcon_extrapos_sw
dw $0000
dw $0000
dw $0000
dw WorldMapIcon_extrapos_tr
dw $0000
warnpc $8ABE2E
org $8ABE2E
; located posx/posy, dislocated posx/posy, prize pox/posy
; located = proper location of icon (default: if you have map)
; dislocated = location of icon if proper location is hidden from player
; highest bit on first posx indicates which world it should show in
; $FFxx on X coord means skip drawing
WorldMapIcon_pos:
.hc
dw $FF00, $FF00, $FF00, $FF00, $FF00, $FF00
.ep
dw $0F31, $0620, $FF00, $FF00, $0F31, $0620
.dp
dw $0108, $0D70, $FF00, $FF00, $0108, $0D70
.at
dw $FF00, $FF00, $FF00, $FF00, $FF00, $FF00
.sp
dw $8759, $0ED0, $FF00, $FF00, $8759, $0ED0
.pod
dw $8F40, $0620, $FF00, $FF00, $8F40, $0620
.mm
dw $8100, $0CA0, $FF00, $FF00, $8100, $0CA0
.sw
dw $8082, $00B0, $FF00, $FF00, $8082, $00B0
.ip
dw $8CA0, $0DA0, $FF00, $FF00, $8CA0, $0DA0
.toh
dw $08D0, $0080, $FF00, $FF00, $08D0, $0080
.tt
dw $81D0, $0780, $FF00, $FF00, $81D0, $0780
.tr
dw $8F11, $0103, $FF00, $FF00, $8F11, $0103
.gt
dw $FF00, $FF00, $FF00, $FF00, $FF00, $FF00
warnpc $8ABECA
org $8ABECA
; additional icons posx/posy (terminator = $FFxx)
; additional icons only show if located
; highest bit on posx indicates which world it should show in
WorldMapIcon_extrapos:
.hc
dw $FF00, $FF00, $FF00, $FF00, $FF00, $FF00, $FF00, $FF00, $FFFF
.dp
dw $FF00, $FF00, $FF00, $FF00, $FF00, $FF00, $FFFF
.sw
dw $FF00, $FF00, $FF00, $FF00, $FF00, $FF00, $FF00, $FF00, $FF00, $FF00, $FF00, $FF00, $FF00, $FF00, $FFFF
.tr
dw $FF00, $FF00, $FF00, $FF00, $FF00, $FF00, $FFFF
; FREE: 0x15 bytes, for any future usage of extra icons ^^^
warnpc $8ABF2B
org $8ABF2B
WorldMapIcon_Numbers:
db $7F, $79, $6C, $6D, $6E, $6F, $7C, $7D, $7E
org $8ABF34
PrizeExists:
dw $37F8
org $8ABF36
; vhpp ccco tttttttt
; v/h - vert/horiz flip
; p - draw priority
; c - color palette idx
; o - OAM page change
; t - VRAM tile idx
WorldMapIcon_prize_tile:
db $00, $00 ; ; Hyrule Castle
db $00, $00 ; ; Sewers
db $38, $60 ; green pendant ; Eastern Palace
db $34, $60 ; blue pendant ; Desert Palace
db $00, $00 ; ; Agahnim's Tower
db $34, $64 ; crystal ; Swamp Palace
db $34, $64 ; crystal ; Dark Palace
db $32, $64 ; red crystal ; Misery Mire
db $34, $64 ; crystal ; Skull Woods
db $32, $64 ; red crystal ; Ice Palace
db $32, $60 ; red pendant ; Tower of Hera
db $34, $64 ; crystal ; Thieves' Town
db $34, $64 ; crystal ; Turtle Rock
db $00, $00 ; ; Ganon's Tower
warnpc $8ABF52
org $8ABF52
WorldMapIcon_dungeon_tile:
db $1A, $7E ; white H ; Hyrule Castle
db $00, $00 ; ; Sewers
db $14, $7B ; blue 1 ; Eastern Palace
db $14, $6B ; blue 2 ; Desert Palace
db $1A, $7D ; white A ; Agahnim's Tower
db $12, $79 ; red 2 ; Swamp Palace
db $12, $7F ; red 1 ; Dark Palace
db $12, $6F ; red 6 ; Misery Mire
db $12, $6C ; red 3 ; Skull Woods
db $12, $6E ; red 5 ; Ice Palace
db $14, $7A ; blue 3 ; Tower of Hera
db $12, $6D ; red 4 ; Thieves' Town
db $12, $7C ; red 7 ; Turtle Rock
db $12, $66 ; skull ; Ganon's Tower
; db $22, $68 ; red X
warnpc $8ABF6E
org $8ABF6E
CompassExists:
dw $37FC
; mirror portal fixes
org $8ABF74
db $24, $64, $E4, $A4 ; lowering mirror portal draw priority
org $8ABFFA
db $4C ; use other mirror portal gfx
org $8AC00E
db $01 ; draw in 2nd OAM slot
org $8AC012 ; <- 54012 - Bank0A.asm:1039 (LDA $7EF2DB : AND.b #$20 : BNE BRANCH_DELTA)
BRA + : NOP #6 : + ; skip pyramid open check
; Scrap
; $00/$01 = Dungeon Pointer
; $02/$03 = Extra Pointer
; $04 = Current World
; $05 = Current Dungeon
; $06 = Helper Bitfield
; $0A = Used as flag to draw icon overlay
; $0B-$0F = OAM GFX Data
org $8AC02B org $8AC02B
DrawPrizesOverride: DrawPrizesOverride:
LDX.b #$FF PHB : LDA.b #WorldMapIcon_DungeonPointers>>16 : PHA : PLB
LDA.l CurrentWorld : STA.b Scrap04
LDY.b #$00 : STY.b Scrap0A
REP #$20
LDA.w #$0800+8 : STA.b OAMPtr
LDA.w #$0A20+2 : STA.b OAMPtr+2
LDY.b #$1A
.next_dungeon
STY.b Scrap05
REP #$20
LDA.w WorldMapIcon_DungeonPointers,Y : BNE + : JMP .advance : +
STA.b Scrap00
LDA.w WorldMapIcon_ExtraPointers,Y : STA.b Scrap02
JSR WorldMap_CheckForDungeonState
LDA.w WorldMapIcon_dungeon_tile,Y : BNE + : JMP .advance : +
XBA : STA.b Scrap0C
TAX : CPX.b #$68 : BNE +
; handle red X animation
PHX
LDA.b FrameCounter : LSR #3 : AND.w #$0003 : TAX
LDA.l WorldMap_RedXChars,X : TAX : STX.b Scrap0D
PLX : CPX.b #$68
BRA .do_dungeon
+
LDA.b FrameCounter : AND.w #$0010 : BEQ + : JMP .show_prizes : +
.do_dungeon
; determine tile size
LDX.b #$00 : BCS +
LDX.b #$02
+ STX.b Scrap0B
.loopStart LDA.l CompassMode : AND.w #$00F0 : ORA.b Scrap06
INX : PHX BIT.w #$0040 : BEQ .main_dungeon_icon
JSR OverworldMap_CheckForPrize BIT.w #$0003 : BEQ .main_dungeon_icon
BCC + : JMP .skip_draw : + ; draw additional dungeon icon under prize
LDY.b #$08 ; 8 is located
BIT.w #$0002 : BNE +
LDY.b #$04 ; 4 is dislocated
+
JSR WorldMap_ValidateCoords : BCS .main_dungeon_icon
JSR WorldMap_DrawTile
TXA : ASL A : TAX ; determine located/dislocated/hidden
LDA.l MapCompassFlag .main_dungeon_icon
AND.b #$01 : BNE + LDA.l CompassMode : AND.w #$00F0 : ORA.b Scrap06
LDA.l WorldMapIcon_posx_vanilla+1, X : STA.l $7EC10B BIT.w #$0020 : BEQ + : BIT.w #$0004 : BNE .show_dungeon ; compass mode, show dungeon icon if its allowed to
LDA.l WorldMapIcon_posx_vanilla, X : STA.l $7EC10A + BIT.w #$0040 : BEQ + : BIT.w #$0008 : BNE .show_dislocated_dungeon : JMP .advance : + ; hidden
LDA.l WorldMapIcon_posy_vanilla+1, X : STA.l $7EC109 .show_dungeon
LDA.l WorldMapIcon_posy_vanilla, X : STA.l $7EC108 LDY.b #$00 ; 0 is located
BRA .adjustment BIT.w #$0004 : BNE + : BIT.w #$0030 : BEQ +
+ LDA.l WorldMapIcon_posx_located+1, X : STA.l $7EC10B .show_dislocated_dungeon
LDA.l WorldMapIcon_posx_located, X : STA.l $7EC10A LDY.b #$04 ; 4 is dislocated
LDA.l WorldMapIcon_posy_located+1, X : STA.l $7EC109 +
LDA.l WorldMapIcon_posy_located, X : STA.l $7EC108
.adjustment
LDA.l WorldMapIcon_tile, X : CMP.b #$FF : BEQ .skip_draw
LDA.l WorldMapIcon_tile+1, X : BEQ .dont_adjust
CMP.b #$64 : BEQ .is_crystal
LDA.b FrameCounter : AND.b #$10 : BNE .skip_draw
.is_crystal
JSR WorldMapIcon_AdjustCoordinate
.dont_adjust
JSR WorldMap_CalculateOAMCoordinates
BCC .skip_draw
PLX : PHX : TXA : ASL A : TAX
LDA.l WorldMapIcon_tile+1, X : BEQ .is_red_x
LDA.l MapCompassFlag : CMP.b #$01 : BEQ .is_red_x
LDA.l WorldMapIcon_tile+1, X : STA.b Scrap0D
LDA.l WorldMapIcon_tile, X : STA.b Scrap0C
LDA.b #$02 : BRA .continue
.is_red_x
LDA.b FrameCounter : LSR #3 : AND.b #$03 : TAX
LDA.l WorldMap_RedXChars,X : STA.b Scrap0D
LDA.b #$32 : STA.b Scrap0C : LDA.b #$00
.continue
STA.b Scrap0B
PLX : PHX
INX : JSR WorldMap_HandleSpriteBlink
.skip_draw
; end of loop
PLX : CPX.b #12 : BCS + : JMP .loopStart : +
PLA : STA.l $7EC10B ; determine if draw and/or continue
PLA : STA.l $7EC10A JSR WorldMap_ValidateCoords : BCC +
PLA : STA.l $7EC109 BNE .extras : BRA .advance
PLA : STA.l $7EC108 +
RTS JSR WorldMap_DrawTile
; TODO: draw X if prize icon is X?... here?
.extras
CPY.b #$04 : BCS .advance ; dislocated dungeon skips extras
LDA.b Scrap02 : BEQ .advance : STA.b Scrap00
LDY.b #$00
.next_icon
JSR WorldMap_ValidateCoords : BCC +
BEQ .advance : INY #4 : BRA .next_icon
+
JSR WorldMap_DrawTile
BRA .next_icon
.show_prizes
LDA.w WorldMapIcon_prize_tile,Y : BEQ .advance
XBA : STA.b Scrap0C
LDX.b #$02 : STX.b Scrap0B ; all prize icons are wide
; X - the index of the prize marker ; determine located/dislocated/unknown
OverworldMap_CheckForPrize: LDA.l CompassMode : AND.w #$00F0 : ORA.b Scrap06
PHX LDY.b #$04 ; 4 is dislocated
LDA.b #$00 : STA.l MapCompassFlag BIT.w #$000B : BEQ .advance
JSR OverworldMap_CheckForCompass BIT.w #$0008 : BNE .prize_known_check
BCC + BIT.w #$0002 : BEQ +
LDA.l MapCompassFlag : ORA.b #$01 : STA.l MapCompassFlag LDY.b #$08 ; 8 is located
LDA.l CurrentWorld : AND.b #$40 : BNE ++ ; is the compass position on LW or DW? .prize_known_check
LDA.l WorldCompassMask, X : BEQ + : JMP .fail BIT.w #$0001 : BNE +
++ LDA.l WorldCompassMask, X : BNE + : JMP .fail ; don't know what prize
+ JSR OverworldMap_CheckForMap BIT.w #$0040 : BEQ .advance
BCC + ; red X
LDA.l MapCompassFlag : ORA.b #$02 : STA.l MapCompassFlag STZ.b Scrap0B
+ LDA.b FrameCounter : LSR #3 : AND.w #$0003 : TAX
LDA.l MapCompassFlag : BEQ .fail LDA.l WorldMap_RedXChars,X : AND.w #$00FF : ORA.w #$2200 : STA.b Scrap0C
CMP.b #$02 : BNE .checkIfObtained +
LDA.l CurrentWorld : AND.b #$40 : BNE +
CPX.b #3 : BCS .fail : BRA .checkIfObtained
+ CPX.b #10 : BCS .fail
CPX.b #3 : BCC .fail
.checkIfObtained ; determine if draw and/or continue
LDA.l MC_DungeonIdsForPrize, X JSR WorldMap_ValidateCoords : BCS .advance
BPL +++ : CLC : BRA .done : +++ ; non-prize flags JSR WorldMap_DrawTileOverlay
CMP.b #$02 : BCC .hyrule_castle JSR WorldMap_DrawTile
ASL : TAX .advance
REP #$20 LDY.b Scrap05 : DEY #2 : BMI + : JMP .next_dungeon : +
LDA.l DungeonsCompleted : AND.l DungeonItemMasks,X : BNE .fail PLB
CLC : BRA .done PLA : XBA : STA.l $7EC10A
PLA : XBA : STA.l $7EC108
; see if hyrule castle has been completely cleared
.hyrule_castle
REP #$20
LDA.l CompassTotalsWRAM, X : SEC : SBC.l DungeonLocationsChecked, X
SEP #$20 SEP #$20
BEQ .fail
CLC : BRA .done
.fail
SEC
.done
SEP #$20
PLX
RTS RTS
; X - which compass in question ; returns with C set if we skip drawing
; CLC - should not move indicator ; returns with Z unset if we want to continue loop for this dungeon
; SEC - yep indicator can move WorldMap_ValidateCoords:
OverworldMap_CheckForCompass: ; checks if icon is valid
LDA.l CompassMode : AND.b #$80 : BEQ .unset ; should I check for compass logic LDA.b (Scrap00),Y : CMP.w #$FF00 : LDX.b #$00 : BCS .fail ; exits with C and Z set
LDA.l CompassMode : AND.b #$40 : BEQ .set ; compasses/maps aren't shuffled BIT.w #$8000 : BEQ +
LDA.l CompassMode : AND.b #$20 : BNE + LDX.b #$40
JSR OverworldMap_CheckForMap : BCC .unset : BRA .set +
+ LDA.l CompassExists, X : BEQ .set ; compass doesn't exist ; checks if icon is for this world
CPX.b Scrap04 : BNE .fail ; exits with C set and Z unset
AND.w #$7FFF : STA.l $7EC10A
INY #2 : LDA.b (Scrap00),Y : STA.l $7EC108
INY #2
CLC : RTS
.fail
SEC : RTS
WorldMap_DrawTileOverlay:
LDA.l CompassMode : AND.w #$0040 : BEQ +
LDA.b Scrap05 : BIT.w #$0100 : BEQ .skip+1
LSR : AND.w #$000F : TAX
LDA.l CrystalPendantFlags_3,X : TAX : BEQ .skip+1
CPX.b #$08 : !BGE +
LDA.b Scrap0C : PHA
LDA.l WorldMapIcon_Numbers-1,X
AND.w #$00FF : ORA.w #$3A00 : STA.b Scrap08
BRA .do_overlay
+
LDA.b Scrap0C : PHA
AND.w #$FF00 : ORA.w #$006A : STA.b Scrap08 ; temp store overlay tile info
LDA.b 1,S : AND.w #$0EFF
CMP.w #$0264 : BEQ .do_overlay ; red crystal
CMP.w #$0860 : BEQ .do_overlay ; green pendant
.skip
PLA
RTS
.do_overlay
LDX.b Scrap0B : PHX
LDX.b #$01 : STX.b Scrap0A
DEX : STX.b Scrap0B
LDA.b Scrap08 : STA.w Scrap0C
JSR WorldMap_DrawTile
LDX.b #$00 : STX.b Scrap0A
PLX : PLA : STX.b Scrap0B : STA.b Scrap0C
RTS
WorldMap_DrawTile:
LDA.b Scrap00 : PHA
SEP #$20
LDX.b Scrap0B : TXA : STA.b (OAMPtr+2)
INC.b OAMPtr+2
JSR WorldMap_CalculateOAMCoordinates
LDX.b Scrap0A : BEQ +
LDA.b Scrap0E : CLC : ADC.b #$04 : STA.b Scrap0E
LDA.b Scrap0F : CLC : ADC.b #$04 : STA.b Scrap0F
+
LDX.b Scrap0B : BEQ +
LDA.b Scrap0E : SEC : SBC.b #$04 : STA.b Scrap0E
LDA.b Scrap0F : SEC : SBC.b #$04 : STA.b Scrap0F
+
REP #$20
PLA : STA.b Scrap00
LDA.b Scrap0E : STA.b (OAMPtr)
INC.b OAMPtr : INC.b OAMPtr
LDA.b Scrap0C : STA.b (OAMPtr)
INC.b OAMPtr : INC.b OAMPtr
RTS
; Y - dungeon index
; TODO: This is terribly inefficient and needs to be rewritten someday
; DungeonItemMasks = 16-bit mask for bitfields
; DungeonsCompleted = 16-bit bitfield for beaten bosses
; MapMode = flag is maps are not wild
; MapField = 16-bit bitfield for collected maps
; MapOverlay = 16-bit bitfield for revealed prizes via Saha/Bomb Shop
; CompassMode = (repurposed version of MapMode above)
; 0x80 = flag is compasses are not wild (similar to MapMode)
; 0x10 = Maps reveals location of dungeons
; 0x20 = Compass reveals location of dungeons
; 0x40 = Boss kill reveals location of prize
; CompassField = 16-bit bitfield for collected compasses
WorldMap_CheckForDungeonState:
PHY : TYX
LDY.b #$00 ; used as bitfield
; determine if prize is revealed
LDA.l MapMode : AND.w #$0001 : BEQ .setRevealPrize ; 0 = always show, 1 = requires map
LDA.l MapField : ORA.l MapOverlay : AND.l DungeonItemMasks,X : BEQ +
.setRevealPrize
TYA : ORA.w #$0001 : TAY
+
; determine if prize is located
LDA.l CompassMode : BIT.w #$0040 : BEQ + ; boss defeated
JSR WorldMap_CheckPrizeCollected : BCC ++
TYA : AND.w #$00FD : ORA.w #$0008 : TAY ; prize collected, hide prize icons
BRA .dungeon_icon
++ LDA.l DungeonsCompleted : AND.l DungeonItemMasks,X : BEQ ++
.setLocatePrize
TYA : ORA.w #$0002 : TAY
BRA .dungeon_icon
++ LDA.l MapOverlay : AND.l DungeonItemMasks,X : BNE .setLocatePrize
BRA .dungeon_icon
+ BIT.w #$0030 : BNE + ; Default ow map
.defaultPrizeCheck
LDA.l MapMode : AND.w #$00FF : BEQ .setLocatePrize ; 0 = always show, 1 = requires map
LDA.l MapField : ORA.l MapOverlay : AND.l DungeonItemMasks,X : BNE .setLocatePrize
BRA .dungeon_icon
+ BIT.w #$0020 : BEQ + ; compass collected
BIT.w #$0080 : BEQ .setLocatePrize ; 0 = always show, 1 = require compass
LDA.l CompassExists : AND.l DungeonItemMasks,X : BEQ .setLocatePrize
LDA.l CompassField : ORA.l MapOverlay : AND.l DungeonItemMasks,X : BNE .setLocatePrize
+ LDA.l CompassMode : BIT.w #$0010 : BNE .defaultPrizeCheck ; map collected
; determine if dungeon is located
.dungeon_icon
LDA.l CompassMode : BIT.w #$0020 : BEQ + ; compass collected
BIT.w #$0080 : BEQ .setLocateDungeon ; 0 = always show, 1 = require compass
LDA.l CompassExists : AND.l DungeonItemMasks,X : BEQ .setLocateDungeon
LDA.l CompassField : AND.l DungeonItemMasks,X : BNE .setLocateDungeon
+ ; Overworld Map: Default or Map option
LDA.l CompassMode : BIT.w #$0010 : BNE ++
BIT.w #$0040 : BEQ ++ ; skip if wild prizes
LDA.l PrizeExists : AND.l DungeonItemMasks,X : BNE +
++
LDA.l MapMode : AND.w #$00FF : BNE + ; 0 = always show, 1 = requires map
LDA.l MapField : AND.l DungeonItemMasks,X : BEQ +
.setLocateDungeon
TYA : ORA.w #$0004 : TAY
+
.continue
STY.b Scrap06
PLY
RTS
WorldMap_CheckPrizeCollected:
PHX PHX
LDA.l MC_SRAM_Offsets, X : TAX ; put compass offset into X TXA : LSR : TAX
LDA.l CompassField, X : ORA.l MapOverlay, X LDA.l CrystalPendantFlags_3,X : AND.w #$00FF : BEQ .prize_not_collected
PLX CMP.w #$0008 : LDA.l CrystalPendantFlags,X : BCS .pendant
AND.l MC_Masks, X : BNE .set ; is the compass obtained AND.l CrystalsField : BRA .check
.unset .pendant
CLC AND.l PendantsField
RTS .check
.set AND.w #$00FF : BEQ .prize_not_collected
SEC PLX : SEC : RTS
RTS .prize_not_collected
PLX : CLC
; map - which map in question
; CLC - should not show exact prize
; SEC - yep should show exact prize
OverworldMap_CheckForMap:
LDA.l MapMode : BEQ .set ; obtaining map doesn't change anything
LDA.l CurrentWorld : AND.b #$40 : BNE + ; not really sure on this check
LDA.l MapField : ORA.l MapOverlay : AND.b #$01 : BNE .set : BRA .continue
+ LDA.l MapField : ORA.l MapOverlay : AND.b #$02 : BNE .set
.continue
PHX
LDA.l MC_SRAM_Offsets, X : TAX ; put map offset into X
LDA.l MapField, X : ORA.l MapOverlay, X
PLX
AND.l MC_Masks, X : BNE .set ; is the map obtained?
.unset
CLC
RTS
.set
SEC
RTS RTS
warnpc $8AC3B1
pullpc pullpc
WorldMap_LoadChrHalfSlot:
JSL Graphics_LoadChrHalfSlot ; what we wrote over
PHB : LDA.b #$7F : PHA : PLB
LDA.b #PreloadedGraphicsROM>>16 : STA.b Scrap02
REP #$20
LDX.b GameSubMode : CPX.b #$07 : BEQ .not_flute_menu
REP #$10
LDX.w #(.list_end-.list_flute)-6
.next_flute_group
LDA.l .list_flute+4,X : TAY
LDA.l .list_flute+2,X : STA.b Scrap03
LDA.l .list_flute,X : STA.b Scrap00
- LDA.b [$00],Y : STA.b ($03),Y : DEY #2 : BPL -
TXA : SBC.w #6 : TAX : BPL .next_flute_group ; SEC is always set
BRA .return
.not_flute_menu
REP #$10
LDX.w #(.list_flute-.list)-6
.next_group
LDA.l .list+4,X : TAY
LDA.l .list+2,X : STA.b Scrap03
LDA.l .list,X : STA.b Scrap00
- LDA.b [$00],Y : STA.b ($03),Y : DEY #2 : BPL -
TXA : SBC.w #6 : TAX : BPL .next_group ; SEC is always set
.return
SEP #$30
PLB
RTL
; from (bank $A2 only), to (bank $7F only), length
.list
dw #PreloadedGraphicsROM+$140, $7F1140, $C0-2
dw #PreloadedGraphicsROM+$320, $7F1320, $E0-2
.list_flute
dw #PreloadedGraphicsROM+$120, $7F13C0, $20-2
.list_end

22
mimicdash.asm Normal file
View File

@@ -0,0 +1,22 @@
;================================================================================
; Mimic Direction Check
;--------------------------------------------------------------------------------
; Output: 0 for darkness, 1 for lamp cone
;--------------------------------------------------------------------------------
MimicDirection:
LDA.b $F0
AND.b #$0F
BNE .done
LDA.l MimicDash
BEQ .done
LDA.w $0372
BEQ .done
LDA.w $0374
BNE .make_zero
LDA.b $67
.done
RTL
.make_zero
LDA.b #$00
RTL

59
msu.asm
View File

@@ -76,7 +76,7 @@
; ;
; Additional tracks ; Additional tracks
; ;
; 60 - Light World OW (after ped pull) ; 60 - Light World OW (after aga kill)
; 61 - Dark World OW (with all crystals) ; 61 - Dark World OW (with all crystals)
; ;
;======================================= ;=======================================
@@ -120,6 +120,7 @@ IsOverworldTrack:
CMP.b #05 : BEQ .yes ; 5 - Forest of Mystery CMP.b #05 : BEQ .yes ; 5 - Forest of Mystery
CMP.b #07 : BEQ .yes ; 7 - Kakariko Village CMP.b #07 : BEQ .yes ; 7 - Kakariko Village
CMP.b #09 : BEQ .yes ; 9 - Dark Golden Land CMP.b #09 : BEQ .yes ; 9 - Dark Golden Land
CMP.b #13 : BEQ .yes ; 13 - Dark Death Mountain
CMP.b #15 : BEQ .yes ; 15 - Dark Woods CMP.b #15 : BEQ .yes ; 15 - Dark Woods
CMP.b #60 : BEQ .yes ; 60 - Light World OW (after ped pull) CMP.b #60 : BEQ .yes ; 60 - Light World OW (after ped pull)
CMP.b #61 : BEQ .yes ; 61 - Dark World OW (with all crystals) CMP.b #61 : BEQ .yes ; 61 - Dark World OW (with all crystals)
@@ -199,36 +200,43 @@ CheckMusicLoadRequest:
LDA.w MusicControlRequest LDA.w MusicControlRequest
CMP.b #02 : BEQ .lightworld CMP.b #02 : BEQ .lightworld
CMP.b #04 : BEQ .no_change+1 ; bunny
CMP.b #09 : BEQ .darkworld CMP.b #09 : BEQ .darkworld
CMP.b #13 : BEQ .darkwoods CMP.b #13 : BEQ .darkwoods
CMP.b #15 : BEQ .darkwoods CMP.b #15 : BEQ .darkwoods
CMP.b #16 : BEQ .castle CMP.b #16 : BEQ .castle
CMP.b #17 : BEQ .dungeon CMP.b #17 : BEQ .dungeon
CMP.b #22 : BEQ .dungeon CMP.b #22 : BEQ .dungeon
CMP.b #21 : BNE .check_fallback CMP.b #21 : BEQ .boss
JMP .check_fallback
;.boss .boss
LDA.w DungeonID : LSR : !ADD.b #45 LDA.w DungeonID : LSR : !ADD.b #45
BRA .check_fallback-3 BRA .check_fallback-3
.no_change
PLA : BRA .check_fallback-3
.lightworld .lightworld
PHA PHA
LDA.l OverworldEventDataWRAM+$80 : AND.b #$40 : BEQ + LDA.l InvertedMode : BNE +
PLA ;LDA OverworldEventDataWRAM+$80 : AND.b #$40 : BEQ + ; ped pull
LDA.b #60 : BRA .check_fallback-3 LDA.l ProgressIndicator : CMP.b #03 : BNE .no_change ; aga1 killed
- PLA : LDA.b #60 : BRA .check_fallback-3
+ +
-- : PLA : BRA .check_fallback-3 LDA.l CrystalsField : CMP.b #$7F : BNE .no_change
BRA -
.darkworld .darkworld
PHA PHA
LDA.l CrystalsField : CMP.b #$7F : BNE -- LDA.l InvertedMode : BNE +
- : PLA LDA.l CrystalsField : CMP.b #$7F : BNE .no_change
LDA.b #61 : BRA .check_fallback-3 - PLA : LDA.b #61 : BRA .check_fallback-3
+
LDA.l ProgressIndicator : CMP.b #03 : BNE .no_change ; aga1 killed
BRA -
.darkwoods .darkwoods
PHA PHA
LDA.l CrystalsField : CMP.b #$7F : BEQ - LDX.b OverworldIndex : LDA.l OWTileWorldAssoc,X : BEQ +
LDA.l CurrentWorld : BEQ -- PLA : BRA .darkworld
LDA.b OverworldIndex : CMP.b #$40 : BNE -- + PLA : BRA .lightworld
PLA
LDA.b #15 : BRA .check_fallback-3
.castle .castle
LDA.w DungeonID LDA.w DungeonID
CMP.b #$08 : BNE .check_fallback ; Hyrule Castle 2 CMP.b #$08 : BNE .check_fallback ; Hyrule Castle 2
@@ -342,7 +350,8 @@ SpiralStairsPreCheck:
JSL LookupSpiralOffset_long JSL LookupSpiralOffset_long
REP #$30 : AND.w #$00FF : ASL #2 : TAX REP #$30 : AND.w #$00FF : ASL #2 : TAX
LDA.l SpiralTable,X LDA.l SpiralTable,X
SEP #$10 : TAX : CPX.b #$07 : BNE .done ; check if hera boss SEP #$10 : LDX.w DungeonID : CPX.b #$FF : BEQ .done
TAX : CPX.b #$07 : BNE .done ; check if hera boss
JSL CheckHeraBossDefeated : BCS .done JSL CheckHeraBossDefeated : BCS .done
LDX.b #$F1 : STX.w MusicControlRequest LDX.b #$F1 : STX.w MusicControlRequest
BRA .done BRA .done
@@ -418,11 +427,7 @@ StoreMusicOnDeath:
MSUInit: MSUInit:
PHP PHP
LDA.b #$00 JSL MSUResumeReset
STA.l MSULoadedTrack
STA.l MSUResumeTrack
STA.l MSUResumeTime : STA.l MSUResumeTime+1 : STA.l MSUResumeTime+2 : STA.l MSUResumeTime+3
STA.l MSUResumeControl
LDA.l NoBGM : BNE .done LDA.l NoBGM : BNE .done
@@ -487,6 +492,18 @@ MSUInit:
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
;================================================================================
; Purge MSU Resume values
;--------------------------------------------------------------------------------
MSUResumeReset:
LDA.b #$00
STA.l MSULoadedTrack
STA.l MSUResumeTrack
STA.l MSUResumeTime : STA.l MSUResumeTime+1 : STA.l MSUResumeTime+2 : STA.l MSUResumeTime+3
STA.l MSUResumeControl
RTL
;--------------------------------------------------------------------------------
;================================================================================ ;================================================================================
; Stop MSU-1 audio track and save the current position when approriate ; Stop MSU-1 audio track and save the current position when approriate
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------

View File

@@ -240,7 +240,10 @@ Multiworld_MasterSword_GrantToPlayer:
LDA.l PedestalSword_Player : STA.l !MULTIWORLD_ITEM_PLAYER_ID LDA.l PedestalSword_Player : STA.l !MULTIWORLD_ITEM_PLAYER_ID
PLP : PLA PLP : PLA
JSL Link_ReceiveItem ; thing we wrote over CPY.b #$6A : BEQ +
JSL Link_ReceiveItem ; thing we wrote over
RTL
+ JSL ActivateGoal
RTL RTL
} }

298
music.asm
View File

@@ -7,68 +7,13 @@ PreOverworld_LoadProperties_ChooseMusic:
LDY.b #$58 ; death mountain animated tileset. LDY.b #$58 ; death mountain animated tileset.
LDX.b #$02 ; Default light world theme
LDA.b OverworldIndex : ORA.b #$40 ; check both light and dark world DM at the same time LDA.b OverworldIndex : ORA.b #$40 ; check both light and dark world DM at the same time
CMP.b #$43 : BEQ .endOfLightWorldChecks CMP.b #$43 : BEQ +
CMP.b #$45 : BEQ .endOfLightWorldChecks CMP.b #$45 : BEQ +
CMP.b #$47 : BEQ .endOfLightWorldChecks CMP.b #$47 : BEQ +
LDY.b #$5A ; Main overworld animated tileset
LDY.b #$5A ; Main overworld animated tileset + JSL Overworld_DetermineMusic
; Skip village and lost woods checks if entering dark world or a special area
LDA.b OverworldIndex : CMP.b #$40 : !BGE .notVillageOrWoods
LDX.b #$07 ; Default village theme
; Check if we're entering the village
LDA.b OverworldIndex : CMP.b #$18 : BEQ .endOfLightWorldChecks
; For NA release would we also branch on indexes #$22 #$28 #$29
LDX.b #$05 ; Lost woods theme
; check if we've pulled from the master sword pedestal
LDA.b OverworldEventDataWRAM+$80 : AND.b #$40 : BEQ +
LDX.b #$02 ; Default light world theme
+
; check if we are entering lost woods
LDA.b OverworldIndex : BEQ .endOfLightWorldChecks
.notVillageOrWoods
; Use the normal overworld (light world) music
LDX.b #$02
; Check phase ; In phase >= 2
LDA.l ProgressIndicator : CMP.b #$02 : !BGE +
; If phase < 2, play the legend music
LDX.b #$03
+
.endOfLightWorldChecks
; if we are in the light world go ahead and set chosen selection
LDA.l CurrentWorld : BEQ .checkInverted+4
LDX.b #$0F ; dark woods theme
; This music is used in dark woods
LDA.b OverworldIndex
CMP.b #$40 : BEQ +
LDX.b #$0D ; dark death mountain theme
; This music is used in dark death mountain
CMP.b #$43 : BEQ + : CMP.b #$45 : BEQ + : CMP.b #$47 : BEQ +
LDX.b #$09 ; dark overworld theme
+
; if not inverted and light world, or inverted and dark world, skip moon pearl check
.checkInverted
LDA.l CurrentWorld : CLC : ROL #$03 : CMP.l InvertedMode : BEQ .lastCheck
; Does Link have a moon pearl?
LDA.l MoonPearlEquipment : BNE +
LDX.b #$04 ; bunny theme
+
.lastCheck .lastCheck
LDA.w MusicControlQueue : CMP.b #$F2 : BNE + LDA.w MusicControlQueue : CMP.b #$F2 : BNE +
@@ -105,58 +50,14 @@ Overworld_FinishMirrorWarp:
SEP #$20 SEP #$20
JSL ReloadPreviouslyLoadedSheets JSL ReloadPreviouslyLoadedSheets
LDA.b #$80 : STA.b HDMAENABLEQ LDA.b #$80 : STA.b HDMAENABLEQ
LDX.b #$04 ; bunny theme
; if not inverted and light world, or inverted and dark world, skip moon pearl check JSL Overworld_DetermineAmbientSFX
LDA.l CurrentWorld : CLC : ROL #$03 : CMP.l InvertedMode : BEQ + JSL Overworld_DetermineMusic
LDA.l MoonPearlEquipment : BEQ .endOfLightWorldChecks
+
LDX.b #$09 ; default dark world theme .done
LDA.b OverworldIndex : CMP.b #$40 : !BGE .endOfLightWorldChecks
LDX.b #$02 ; hyrule field theme
; Check if we're entering the lost woods
CMP.b #$00 : BNE +
LDA.l OverworldEventDataWRAM+$80 : AND.b #$40 : BNE .endOfLightWorldChecks
LDX.b #$05 ; lost woods theme
BRA .endOfLightWorldChecks
+
; Check if we're entering the village
CMP.b #$18 : BNE .endOfLightWorldChecks
; Check what phase we're in
LDX.b #$07 ; Default village theme (phase <3)
.endOfLightWorldChecks
STX.w MusicControlRequest STX.w MusicControlRequest
LDA.b OverworldIndex : CMP.b #$40 : BNE + LDA.b GameSubMode : STA.w GameSubModeCache
LDX.b #$0F ; dark woods theme
BRA .bunny
+
CMP.b #$43 : BEQ .darkMountain
CMP.b #$45 : BEQ .darkMountain
CMP.b #$47 : BNE .notDarkMountain
.darkMountain
LDA.b #$09 : STA.w SFX1 ; set storm ambient SFX
LDX.b #$0D ; dark mountain theme
.bunny
LDA.l MoonPearlEquipment : ORA.l InvertedMode : BNE +
LDX.b #$04 ; bunny theme
+
STX.w MusicControlRequest
.notDarkMountain
LDA.b GameSubMode : STA.w GameSubModeCache ; GameModeCache
STZ.b GameSubMode STZ.b GameSubMode
STZ.b SubSubModule STZ.b SubSubModule
@@ -168,64 +69,96 @@ Overworld_FinishMirrorWarp:
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
BirdTravel_LoadTargetAreaMusic: BirdTravel_LoadTargetAreaMusic:
; Skip village and lost woods checks if entering dark world or a special area JSL Overworld_DetermineAmbientSFX
LDA.b OverworldIndex : CMP.b #$43 : BEQ .endOfLightWorldChecks JSL Overworld_DetermineMusic
CMP.b #$40 : !BGE .notVillageOrWoods STZ.w $04C8 ; Clear peg puzzle count
RTL
;--------------------------------------------------------------------------------
LDX.b #$07 ; Default village theme ;--------------------------------------------------------------------------------
Overworld_DetermineAndSetMusic:
PHX
JSL Overworld_DetermineMusic : STX.w MusicControlRequest
PLX
RTL
;--------------------------------------------------------------------------------
; Check if we're entering the village ;--------------------------------------------------------------------------------
LDA.b OverworldIndex : CMP.b #$18 : BEQ .endOfLightWorldChecks ;X to be set to music track to load
; For NA release would we also branch on indexes #$22 #$28 #$29 Overworld_DetermineMusic:
; check if we are entering lost woods
LDA.b OverworldIndex : BEQ .endOfLightWorldChecks
.notVillageOrWoods
; Use the normal overworld (light world) music
LDX.b #$02
; Check phase ; In phase >= 2
LDA.l ProgressIndicator : CMP.b #$02 : !BGE + LDA.l ProgressIndicator : CMP.b #$02 : !BGE +
; If phase < 2, play the legend music LDX.b #$03 ; If phase < 2, play the rain music
LDX.b #$03 BRA .done
+ +
.endOfLightWorldChecks LDA.l CurrentWorld : BEQ +
; if we are in the light world go ahead and set chosen selection LDA.b OverworldIndex : ORA.b #$40
LDA.l CurrentWorld : BEQ .checkInverted+4 CMP.b #$43 : BEQ .darkMountain
CMP.b #$45 : BEQ .darkMountain
CMP.b #$47 : BEQ .darkMountain
LDX.b #$09 ; default dark world theme
BRA .default_set
+
LDX.b #$02 ; hyrule field theme
LDX.b #$09 ; dark overworld theme .default_set
; Check if we're entering the village
LDA.b OverworldIndex LDA.b OverworldIndex : CMP.b #$18 : BNE +
; Misery Mire rain SFX ; Check what phase we're in
CMP.b #$70 : BNE ++ ; LDA ProgressIndicator : CMP.b #$03 : !BGE .bunny
LDA.l OverworldEventDataWRAM+$70 : AND.b #$20 : BNE ++ LDX.b #$07 ; Default village theme (phase <3)
LDA.b #$01 : CMP.w LastSFX1 : BEQ + BRA .bunny
STA.w SFX1
+ : BRA .checkInverted ; Check if we're entering the lost woods
++ + CMP.b #$00 : BNE +
LDA.l OverworldEventDataWRAM+$80 : AND.b #$40 : BNE .bunny
; This music is used in dark death mountain LDX.b #$05 ; lost woods theme
CMP.b #$43 : BEQ .darkMountain BRA .bunny
LDA.b #$05 : STA.w SFX1
BRA .checkInverted + CMP.b #$40 : BNE .bunny
LDX.b #$0F ; dark woods theme
BRA .bunny
.darkMountain .darkMountain
LDA.l CrystalsField : CMP.b #$7F : BEQ + LDX.b #$0D ; dark mountain theme
LDX.b #$0D ; dark death mountain theme
+ : LDA.b #$09 : STA.w SFX1
.bunny
; if not inverted and light world, or inverted and dark world, skip moon pearl check ; if not inverted and light world, or inverted and dark world, skip moon pearl check
.checkInverted LDA.l CurrentWorld : CLC : ROL #$03 : CMP.l InvertedMode : BEQ .done
LDA.l CurrentWorld : CLC : ROL #$03 : CMP.l InvertedMode : BEQ .lastCheck LDA.l MoonPearlEquipment : BNE .done
LDX.b #$04 ; bunny theme
; Does Link have a moon pearl? .done
LDA.l MoonPearlEquipment : BNE + RTL
LDX.b #$04 ; bunny theme ;--------------------------------------------------------------------------------
+
.lastCheck ;--------------------------------------------------------------------------------
;$012D to be set to any ambient SFX for the area
Overworld_DetermineAmbientSFX:
LDA.l ProgressIndicator : CMP.b #$02 : !BGE +
BRA .done ; rain state sfx handled elsewhere
+ LDA.b OverworldIndex : CMP.b #$43 : BEQ .darkMountain
CMP.b #$45 : BEQ .darkMountain
CMP.b #$47 : BEQ .darkMountain
CMP.b #$70 : BEQ .mire
LDA.b #$05 : BRA .setSfx ; silence
.mire
LDA OverworldEventDataWRAM+$70 : AND.b #$20 : BNE .done
LDA.b #$01 : BRA .setSfx ; Misery Mire rain SFX
.darkMountain
LDA.b #$09 : BRA .setSfx ; set storm ambient SFX
.setSfx
CMP.w LastSFX1 : BEQ +
STA.w SFX1
+ STZ.w SFX1
.done
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -240,24 +173,21 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; Additional dark world checks to determine whether or not to fade out music pushpc
; on mosaic transitions org $82AD6C
; ; Determine whether or not to fade out music on mosaic transitions
; On entry, A = $8A (overworld area being loaded) OverworldMosaicTransition_HandleSong:
Overworld_MosaicDarkWorldChecks: LDA.b GameSubMode : CMP.b #$0D : BNE .dont_fade
CMP.b #$40 : BEQ .checkCrystals LDA.w CurrentControlRequest : CMP.b #$04 : BEQ .dont_fade
CMP.b #$42 : BEQ .checkCrystals BRA .fade_song
CMP.b #$50 : BEQ .checkCrystals
CMP.b #$51 : BNE .doFade
.checkCrystals warnpc $82ADA0
LDA.l CrystalsField : CMP.b #$7F : BEQ .done org $82ADA0
.fade_song
org $82ADA5
.dont_fade
.doFade pullpc
LDA.b #$F1 : STA.w MusicControlRequest ; thing we wrote over, fade out music
.done
RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -280,11 +210,14 @@ Underworld_DoorDown_Entry:
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
CheckHeraBossDefeated_AlsoCheckMusic:
LDA.w LastAPUCommand : AND.w #$00FF : CMP.w #$0015 : BNE + ; if boss music is playing
; Check if the boss in ToH has been defeated (16-bit accumulator) ; Check if the boss in ToH has been defeated (16-bit accumulator)
CheckHeraBossDefeated: CheckHeraBossDefeated:
LDA.l RoomDataWRAM[$07].high : AND.w #$00FF : BEQ + LDA.l RoomDataWRAM[$07].high : AND.w #$00FF : BNE +
SEC : RTL CLC : RTL
+ CLC : RTL + SEC : RTL
FallingMusicFadeOut: FallingMusicFadeOut:
CMP.w #$0017 ; what we wrote over CMP.w #$0017 ; what we wrote over
@@ -293,3 +226,22 @@ FallingMusicFadeOut:
.return .return
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
FixHalfVolumeOnSpawnExitToOverworld:
BEQ .exit : STA.w MusicControlRequest ; what we wrote over
LDA.w DungeonID : BNE .exit
LDA.b LinkPosY+1 : ROR : LDA.b LinkPosY : ROR
CMP.b #$DC : BCS .exit ; check if link loading in room from a spawn
; set queue to half volume to trigger full volume on exit
LDA.b #$F2 : STA.w MusicControlQueue
.exit
RTL
;--------------------------------------------------------------------------------
FixPreAgaMusicFadeOut:
LDA.l DRMode : TAX : CPX.b #$01 : BCS .exit_no_fade+1
LDA.b RoomIndex : CMP.w #$0030 : BEQ .exit_and_fade ; what we
CMP.w #$0040 : BEQ .exit_and_fade ; wrote over
.exit_no_fade
SEC : RTL
.exit_and_fade
CLC : RTL
;--------------------------------------------------------------------------------

Some files were not shown because too many files have changed in this diff Show More