403 Commits

Author SHA1 Message Date
dacae98439 Merge branch 'OWMain' into overworld_kara 2024-02-28 16:29:01 -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
63f0f8002f Fix crash on bugnet upgrade acquisition 2023-09-26 16:53:20 -05:00
4b8de58460 Move SpecialWeaponLevel location to not overlap bow tracking 2023-09-09 11:13:51 -05:00
93e1cfa361 Add missing hook 2023-09-04 20:29:13 -05:00
fa484ec987 Fix picked up items not going in inventory 2023-09-04 17:59:42 -05:00
256f0fa270 Move non-swords not damaging enemies to high bit of special weapons 2023-09-04 17:05:25 -05:00
5ad699f731 Fix bugnet on aga not reflecting balls 2023-09-04 16:57:15 -05:00
0b01f75f80 Show B indicator in menu when can switch item to B button 2023-09-04 16:54:36 -05:00
f076566dca Changes to special weapon modes:
- allow killing red baris with fire rod/bombos
- allow medallions to kill bunny beams
2023-09-04 16:52:31 -05:00
4815c9971a Generalize item-on-B approach 2023-09-04 16:49:28 -05:00
723d359b0a Better icon on bugnet-on-B 2023-09-04 16:37:48 -05:00
ed85faaab5 Allow toggling strafe/bugnet-on-B 2023-09-04 16:36:51 -05:00
13ccba90c3 Add toggle of bugnet-on-B 2023-09-04 16:35:07 -05:00
b52404469b Fix gold bugnet mothula, bugnet on B 2023-09-04 16:32:12 -05:00
cd1a1f4288 First pass at bugnet mode 2023-09-04 16:23:19 -05:00
25c44cd2bb Merge branch 'OWMain' into overworld_kara 2023-09-04 15:03:18 -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
015f769521 Move kara-branch code to bank A2 so there's space 2023-02-26 14:31:51 -06:00
bfbc180ff3 Merge branch 'OWMain' into overworld_kara 2023-02-26 14:30:05 -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
ec6231955d Merge remote-tracking branch 'codemann/OWMain' into overworld_kara 2023-01-30 19:47:34 -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
9699c4d731 Fix swordless boss counter 2022-11-19 21:09:34 -08:00
846ad798cf Fix conflict between hammer-on-B code with bunny-pressing-A code 2022-11-19 10:06:37 -08:00
44e2ccf7f7 Fix bomb on file select screen in swordless 2022-11-16 14:39:47 -08:00
5d4e7fa62d Add Hammer-On-B mode 2022-11-16 14:39:05 -08:00
be81787446 Bee Mode 2022-11-16 14:37:42 -08:00
682583c215 Merge branch 'OWMain' into overworld_kara 2022-11-16 14:24:25 -08: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
3cec56c5d8 Revert "Fix mixing progressive/non-progressive swords and shields"
This reverts commit d05169d5e2.
2022-10-12 15:55:48 -07: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
d05169d5e2 Fix mixing progressive/non-progressive swords and shields 2022-10-08 15:43:28 -07: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
f93a817ed3 Show chest keys count always 2022-09-18 23:21:55 -07:00
d6f3aee02b Remove non-progressive bomb/cane upgrades 2022-09-18 18:18:12 -07:00
4817fa2013 Fix up labels
still WIP

still do not use
2022-09-18 18:11:21 -07:00
6f138825d9 Merge remote-tracking branch 'codemann/OWMain' into overworld_kara
WIP, Broken, Do Not Use
2022-09-18 17:36:49 -07: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
6400a563ea unscramble lowercase letters for new font 2022-04-02 10:07:39 -07:00
9c30e3cdf9 Merge commit '697a742e0937780d3e6d1193876c8096ef1e2200' into HEAD 2022-04-01 18:28:29 -07: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
7da5e6257a Merge branch 'OWMain' of github.com:codemann8/z3randomizer into overworld_kara 2022-02-11 13:36:00 -08: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
8dfdd3ee87 Merge branch 'main' into overworld_kara 2022-01-24 14:07:50 -08:00
ede8760b5c Make non-seeded rng a rom flag instead of compile flag 2022-01-24 13:55:29 -08:00
2a15f39e65 Fix boomerang instakilling Armos Knights 2022-01-24 13:55:19 -08: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
Thomas Prescott
c416bfa917 update credits 2022-01-03 12:29:04 -08:00
b2043ef15e Adjust credits to match layout of base randomizer fork 2022-01-03 12:26:15 -08:00
74c55cf048 Merge remote-tracking branch 'codemann/OWMain' into overworld_kara 2022-01-01 15:30:19 -08:00
spannerisms
e78c41ef38 match expected usage 2021-12-29 18:58:15 -08:00
6db6733d80 Add permanent ice physics bit 2021-12-29 18:51:42 -08:00
8ffef89fb8 Fix bee damage 2021-12-27 14:04:20 -08:00
8c6d2ac26d Fix moldorm/somaria issue and add both-canes mode 2021-12-23 22:13:30 -08:00
0f26e5aaa5 Fix width of special cane freestanding sprites 2021-12-23 22:13:30 -08:00
8a25dc9d52 Prevent hitting stunned ganon in cane-mode with default vulnerability 2021-12-23 22:13:30 -08:00
d2ad452170 Fix mothula/ganon breaking things (hopefully) 2021-12-23 22:13:30 -08:00
b1e3a7999c Remove bomb damage in cane modes 2021-12-23 22:13:30 -08:00
53792aea25 Add cane-only modes 2021-12-23 22:13:26 -08: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
0ab9095222 Merge branch 'OWMain' into overworld_kara 2021-11-29 00:04:13 -08: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
e96d802ed1 Shorten duration of boomerang stun 2021-11-10 00:08:35 -08:00
b515b59a38 Make boomerang in bomb-only mode stun enemies it would normally damage 2021-11-08 16:38:03 -08:00
69a669e16e Merge branch 'OWMain' into overworld_kara 2021-11-08 00:09:02 -08:00
4896985493 Fix bomb icons on file select/endgame screens 2021-11-07 23:58:40 -08:00
2fd459d8ca Show bomb level on file select screen in bomb-only mode 2021-11-07 19:32:27 -08:00
918eefc3bd Minor fixes 2021-11-07 19:31:53 -08: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
2b241b2340 Unify handling of bomb colors in bomb-only mode 2021-11-07 12:47:13 -08: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
0c6ba20470 Merge branch 'main' into overworld_kara 2021-10-30 16:38:09 -07:00
82c5190f63 Merge branch 'OWMain' into overworld_kara 2021-10-30 11:55:08 -07:00
aeec3fe6c6 Allow early detonation of bombs and add build flag to remove static RNG 2021-10-30 09:11:36 -07: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
825d4a1ead Merge branch 'overworld_kara' of github.com:ardnaxelarak/z3randomizer into overworld_kara 2021-10-02 21:19:06 -07:00
6d9cbc85b7 Merge branch 'OWMain' of github.com:codemann8/z3randomizer into overworld_kara 2021-10-02 20:46:14 -07:00
f6f6383913 Merge remote-tracking branch 'codemann/OWMain' into overworld_kara 2021-09-21 14:10:23 -07:00
fb4068a3e1 Merge branch 'main' into overworld_kara 2021-09-21 11:55:33 -07: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
42002ae839 Merge branch 'main' into overworld_kara 2021-08-26 08:44:15 -07: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
0816bb7cab Merge branch 'fix_ohko' into overworld_kara 2021-08-09 15:33:03 -07:00
a12b5a9188 Merge branch 'OWMain' into overworld_kara 2021-08-02 19:00:33 -07:00
f14fea3699 Merge branch 'main' into overworld_kara 2021-08-02 19:00:13 -07: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
07f0ee9962 Merge branch 'OWMain' into overworld_kara 2021-07-28 12:54:14 -07:00
codemann8
6e721fb069 Fix for boss music not playing in non-DR modes 2021-07-27 02:40:12 -05:00
7aac3970d1 Add pseudo-sword mode 2021-07-25 01:42:21 -07:00
b663bb982f Merge branch 'OWMain' into overworld_kara 2021-07-23 15:42:41 -07:00
73ac8d8c25 Merge branch 'main' into overworld_kara 2021-07-23 15:28:30 -07:00
codemann8
11099f53b0 Merging DRMain 2021-07-23 15:49:10 -05:00
6df8dca127 Fix Stalfos Knights in bomb-mode to have bombs instakill while collapsed 2021-07-20 20:34:08 -07:00
faf05fb9a9 Merge branch 'OWMain' into overworld_kara 2021-07-17 12:19:56 -07:00
6da1227578 Color bombs in the HUD according to bomb level in bomb-only mode 2021-07-17 12:11:25 -07:00
59affe8b93 Adjust things for replacing sword stats with bomb stats 2021-07-17 12:11:25 -07: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
bdd665db24 move storage of BOMB_LEVEL to make it play nicely with starting equipment 2021-07-13 11:28:04 -07: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
e81905a517 Fix bomb downgrades and track bomb stats in bomb-mode 2021-07-12 02:35:24 -07:00
da14e440c7 Add L-1 bombs as separate from no bombs in bomb-only mode 2021-07-12 02:34:57 -07:00
8d92e39451 Fix extra space in credits 2021-07-12 02:13:08 -07:00
2c221dfa37 Allow bombing barrier and getting tablet checks with L2+ bombs 2021-07-10 23:47:27 -07:00
codemann8
ec04d05c37 Merge branch 'DRMain' into OWMain 2021-07-10 13:46:57 -05:00
a6a8cda041 Fix junk graphics appearing during GAME OVER screen 2021-07-10 11:32:48 -07:00
2c931527e9 Merge branch 'DRMain' into overworld_kara 2021-07-08 19:39:10 -07: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
8b173ac27b Fix printing damage and magic to stat counters in credits 2021-07-08 01:57:12 -07:00
codemann8
6cd0d15abf Merge branch 'DRMain' into OWMain 2021-07-07 19:11:36 -05:00
d960103e86 Merge branch 'main' into overworld_kara 2021-07-07 09:15:29 -07:00
7022b8768a Merge branch 'OWMain' of github.com:codemann8/z3randomizer into overworld_kara 2021-07-06 19:00:52 -07: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
d4e1337471 Add bombs-placed counter to stat screen 2021-07-05 17:56:56 -07:00
b8545ca055 Fix quake not blobbifying certain enemies 2021-07-05 16:15:26 -07:00
f4e7d412ed Fix hookshot and armos knights:
- hookshot now stuns enemies it would normally damage
- armos knights now take same damage from L-2 bombs as L-1/L-3
2021-07-04 18:34:10 -07:00
28b84484e0 NO BOMBOS DAMAGE 2021-07-04 15:40:57 -07: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
2fec3f7484 Merge commit 'f403ca10da9e009599a531be8cdcd20a61b4801c' of github.com:spannerisms/z3randomizer into overworld_kara 2021-07-01 23:05:48 -07:00
01abf889d7 Merge branch 'main' into overworld_kara 2021-07-01 23:02:23 -07:00
b8dc86d7c5 Allow Ganon to be vulnerable to arbitrary item 2021-06-29 16:43:01 -07:00
8b0f0464f8 Implement always-allowed medallions 2021-06-29 16:43:01 -07:00
b3d649a0fb Add bomb-only mode 2021-06-29 16:43:01 -07: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
69 changed files with 7505 additions and 2181 deletions

3
.gitignore vendored
View File

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

View File

@@ -44,7 +44,10 @@ dw !ROM_VERSION_HIGH
!MS_GOT = "$7F5031"
!REDRAW = "$7F5000"
;!REDRAW = "$7F5000"
!SPRITE_REDRAW = "$7E0790" ; 16 bytes
!SPRITE_OAM = "$7EC025" ; 16 bytes
!SPRITE_DYNAMIC_OAM = "$7EC035" ; 16 bytes
!GANON_WARP_CHAIN = "$7F5032";
!TILE_UPLOAD_BUFFER = "$7EA180";
@@ -74,7 +77,7 @@ dw !ROM_VERSION_HIGH
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_NEW_TEXT ?= 0
!FEATURE_NEW_TEXT ?= 1
;================================================================================
@@ -95,6 +98,10 @@ function hexto555(h) = ((((h&$FF)/8)<<10)|(((h>>8&$FF)/8)<<5)|(((h>>16&$FF)/8)<<
!MULTIWORLD_ITEM_ID = "$7EC09B" ; for lua scripts?
!Dungeon_ChestData = "$01E96C"
!FLAG_OW_MIXED = $04
!FLAG_OW_CROSSED = $02
!FLAG_OW_BONKDROP = $02
incsrc hooks.asm
incsrc treekid.asm
incsrc spriteswap.asm
@@ -197,6 +204,7 @@ incsrc decryption.asm
incsrc hashalphabet.asm
incsrc inverted.asm
incsrc invertedmaps.asm
incsrc bonktreemaps.asm
incsrc newhud.asm
incsrc compasses.asm
incsrc save.asm
@@ -221,6 +229,9 @@ warnpc $A58000
;org $228000 ; contrib area
org $A28000 ; contrib area
incsrc contrib.asm
incsrc special_weapons.asm
incsrc item_on_b.asm
incsrc variable_ganon_vulnerability.asm
warnpc $A38000
org $A38000
@@ -230,6 +241,7 @@ incsrc menu/overworldmap.asm ; overwrites some code in bank 0A
incsrc doorrando/doorrando.asm ; bank 27 likely A7 in the future
;bank 28/A8 for keydropshuffle / standing items
incsrc keydrop/standing_items.asm
incsrc owrando.asm ; bank AA
incsrc enemizer/main.asm ; this is originally in bank 36, but is currently in migratory status in bank 37
org $308000 ; bank #$30
@@ -298,6 +310,16 @@ InvertedCastleHole: ;address used by front end. DO NOT MOVE!
incbin sheet73.gfx
warnpc $31E501
org $31E800
Damage_Table_Bombs:
incbin damage_table_sword_bombs.bin
warnpc $31F000
org $31F000
Damage_Table_Pseudo:
incbin damage_table_pseudo_sword.bin
warnpc $31F800
org $338000
GFX_HUD_Palette:
incbin hudpalette.pal
@@ -312,24 +334,24 @@ BossMapIconGFX:
incbin bossicons.4bpp
if !FEATURE_NEW_TEXT
org $339C00
NewFont:
incbin newfont.bin
NewFontInverted:
incbin newfont_inverted.bin
org $339C00
NewFont:
incbin newfont.bin
NewFontInverted:
incbin newfont_inverted.bin
org $0CD7DF
incbin text_unscramble1.bin
org $0CE4D5
incbin text_unscramble2.bin
org $0CD7DF
incbin text_unscramble1.bin
org $0CE4D5
incbin text_unscramble2.bin
endif
org $328000
Extra_Text_Table:
if !FEATURE_NEW_TEXT
incsrc itemtext_lower.asm
incsrc itemtext_lower.asm
else
incsrc itemtext.asm
incsrc itemtext.asm
endif
warnpc $32E000
@@ -496,6 +518,9 @@ Attract_DecompressStoryGfx:
org $00E529
LoadSelectScreenGfx:
org $00E784
LoadCommonSprites_in_file_select:
org $00F945
PrepDungeonExit:
@@ -519,15 +544,33 @@ Dungeon_SaveRoomData:
org $02A0BE
Dungeon_SaveRoomData_justKeys:
org $02A4E3
Overworld_ActualScreenID:
org $02A9F3
OverworldHandleTransitions_change_palettes:
org $02B861
Dungeon_SaveRoomQuadrantData:
org $02C11D
CalculateTransitionLanding:
org $02C176
Overworld_FinalizeEntryOntoScreen_Data:
org $82C3F2
OverworldLoadScreensPaletteSet_long:
org $02D9B9
Underworld_LoadSpawnEntrance:
org $02E99D
FluteMenu_LoadTransport:
org $02FD6D
LoadGearPalettes_link:
org $02FD8A ; 17D8A - Bank0E.asm: 3732 Note: Different bank
LoadGearPalettes_bunny:
@@ -537,6 +580,15 @@ LoadGearPalettes_variable:
org $02FEAB
Filter_Majorly_Whiten_Color:
org $04E780
Overworld_MemorizeMap16Change:
org $04E879
Overworld_CheckForSpecialOverworldTrigger_Direction:
org $058008
Sprite_SpawnSparkleGarnish:
org $05A51D
Sprite_SpawnFallingItem:
@@ -570,6 +622,9 @@ Utility_CheckIfHitBoxesOverlapLong:
org $06A7DB
Chicken_SpawnAvengerChicken: ; returns short
org $06AD58
Sprite_TransmuteToBomb:
org $06DC5C
Sprite_DrawShadowLong:
@@ -582,6 +637,9 @@ Sprite_PrepAndDrawSingleLargeLong:
org $06DC00
Sprite_PrepAndDrawSingleSmallLong:
org $06E41C
Sprite_PrepOAMCoordLong:
org $06EA18
Sprite_ApplySpeedTowardsPlayerLong:
@@ -600,9 +658,21 @@ Player_HaltDashAttackLong:
org $07999D
Link_ReceiveItem:
org $079F82
Link_UseHammer:
org $07AFEE
Link_UseBugNet:
org $07A985
SetGameModeLikeMirror:
org $07E68F
Unknown_Method_0: ; In US version disassembly simply called "$3E6A6 IN ROM"
org $07F413
Link_CheckForEdgeScreenTransition:
org $07F4AA
Sprite_CheckIfPlayerPreoccupied:
@@ -651,12 +721,18 @@ AddAncillaLong:
org $099D1A
Ancilla_CheckIfAlreadyExistsLong:
org $09AC57
Ancilla_TerminateSelectInteractives:
org $09AE64
Sprite_SetSpawnedCoords:
org $09AD58
GiveRupeeGift:
org $0AB7BD
FluteMenu_HandleSelection_NoSelection:
org $0ABA4F
OverworldMap_InitGfx:
@@ -782,6 +858,12 @@ DiggingGameGuy_AttemptPrizeSpawn:
org $1EDE28
Sprite_GetEmptyBottleIndex: ; this is totally in sprite_bees.asm
org $1EDE89
GoldBee_Dormant_exit:
org $1EDE8A
GoldBee_SpawnSelf:
org $1EF4E7
Sprite_PlayerCantPassThrough:
;================================================================================

1021
bonktreemaps.asm Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -5,13 +5,12 @@ LoadLibraryItemGFX:
LDA.l LibraryItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
%GetPossiblyEncryptedItem(LibraryItem, SpriteItemValues)
STA $0E80, X ; Store item type
JSL.l PrepDynamicTile
RTL
JML RequestSlottedTile
;--------------------------------------------------------------------------------
DrawLibraryItemGFX:
PHA
LDA $0E80, X ; Retrieve stored item type
JSL.l DrawDynamicTile
JSL.l DrawSlottedTile
PLA
RTL
;--------------------------------------------------------------------------------
@@ -25,27 +24,23 @@ RTL
;================================================================================
; Randomize Bonk Keys
;--------------------------------------------------------------------------------
!REDRAW = "$7F5000"
;--------------------------------------------------------------------------------
LoadBonkItemGFX:
LDA.b #$08 : STA $0F50, X ; thing we wrote over
LoadBonkItemGFX_inner:
LDA.b #$00 : STA !REDRAW
JSR LoadBonkItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
JSR LoadBonkItem
JSL.l PrepDynamicTile
RTL
JML RequestSlottedTile
;--------------------------------------------------------------------------------
DrawBonkItemGFX:
PHA
LDA !REDRAW : BEQ .skipInit ; skip init if already ready
JSL.l LoadBonkItemGFX_inner
BRA .done ; don't draw on the init frame
LDA.w !SPRITE_REDRAW, X : BEQ .skipInit ; skip init if already ready
JSL.l LoadBonkItemGFX_inner
LDA.w !SPRITE_REDRAW, X : CMP.b #$02 : BEQ .skipInit
BRA .done ; don't draw on the init frame
.skipInit
JSR LoadBonkItem
JSL.l DrawDynamicTileNoShadow
JSR LoadBonkItem
JSL DrawSlottedTile
.done
PLA
@@ -69,7 +64,7 @@ RTL
LoadBonkItem:
LDA $A0 ; check room ID - only bonk keys in 2 rooms so we're just checking the lower byte
CMP #115 : BNE + ; Desert Bonk Key
LDA.l BonkKey_Desert
LDA.l BonkKey_Desert
BRA ++
+ : CMP #140 : BNE + ; GTower Bonk Key
LDA.l BonkKey_GTower
@@ -85,7 +80,7 @@ LoadBonkItem_Player:
LDA.l BonkKey_Desert_Player
BRA ++
+ : CMP #140 : BNE + ; GTower Bonk Key
LDA.l BonkKey_GTower_Player
LDA.l BonkKey_GTower_Player
BRA ++
+
LDA.b #$00

View File

@@ -49,7 +49,7 @@ DecideIfBunnyByScreenIndex:
; superbunny work
LDA $1B : BNE .done
LDA MoonPearlEquipment : BNE .done
LDA $8A : AND.b #$40 : PHA
PHX : LDX $8A : LDA.l OWTileWorldAssoc, X : PLX : PHA
LDA.l InvertedMode : BNE .inverted
.normal
PLA : EOR #$40
@@ -90,11 +90,11 @@ FixAga2Bunny:
++
JSL DecideIfBunny : BNE +
JSR MakeBunny
LDA.b #$04 : STA.w $012C ; play bunny music
BRA .done
+
LDA.b #$09 : STA.w $012C ; what we wrote over
.done
PHX
JSL Overworld_DetermineMusic : STX !REG_MUSIC_CONTROL_REQUEST
PLX
RTL
;--------------------------------------------------------------------------------
@@ -200,6 +200,27 @@ LDA $1B : BNE +
+
RTL
;--------------------------------------------------------------------------------
; Fix losing VRAM gfx when using quake
PostNMIUpdateBGCharHalf:
STA.w $420B : SEP #$10 ; what we wrote over
LDA.w $0116 : CMP.b #$46 : BNE .return ; checks to see if this is the last VRAM write
LDA.b $5D : CMP.b #$08 : BCC + : CMP.b #$0A+1 : BCS + ; skip if we're mid-medallion
RTL
+ JSL HeartPieceSetRedraw ; set redraw flag for items
.return
RTL
; Force redraws of items following map checks
PostOverworldGfxLoad:
INC.b $11 : STZ.b $13 ; what we wrote over
JSL HeartPieceSetRedraw
RTL
PostUnderworldMap:
JSL HeartPieceSetRedraw
LDA.l $7EC229 ; what we wrote over
RTL
;--------------------------------------------------------------------------------
FixJingleGlitch:
LDA.b $11

Binary file not shown.

Binary file not shown.

View File

@@ -1,25 +1,23 @@
;================================================================================
; Randomize Catfish
;--------------------------------------------------------------------------------
!HEART_REDRAW = "$7F5000"
LoadCatfishItemGFX:
LDA.l CatfishItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA.l $1DE185 ; location randomizer writes catfish item to
JML PrepDynamicTile
LDA.l $1DE185 ; location randomizer writes catfish item to
JML RequestSlottedTile
;--------------------------------------------------------------------------------
DrawThrownItem:
LDA $8A : CMP.b #$81 : BNE .catfish
.zora
LDA.b #$01 : STA !HEART_REDRAW
LDA.l $1DE1C3 ; location randomizer writes zora item to
LDA.l $1DE1C3 ; location randomizer writes zora item to
BRA .draw
.catfish
LDA.l $1DE185 ; location randomizer writes catfish item to
LDA.l $1DE185 ; location randomizer writes catfish item to
.draw
JML DrawDynamicTile
JML DrawSlottedTile
;--------------------------------------------------------------------------------
MarkThrownItem:
PHA
@@ -27,12 +25,12 @@ MarkThrownItem:
LDA $8A : CMP.b #$81 : BNE .catfish
.zora
JSL.l ItemSet_ZoraKing
JSL.l ItemSet_ZoraKing
LDA ZoraItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID
BRA .done
.catfish
JSL.l ItemSet_Catfish
JSL.l ItemSet_Catfish
LDA CatfishItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID
.done

View File

@@ -6,6 +6,61 @@
; Filtered Joypad 1 Register: [BYST | udlr] [AXLR | ????]
!INVERT_DPAD = "$7F50CB"
InvertDPad_DPadOnly:
LDA $4218 : STA $00
LDA $4219
BIT.b #$0C : BEQ + : EOR.b #$0C : + ; swap up/down
BIT.b #$03 : BEQ + : EOR.b #$03 : + ; swap left/right
STA $01
JML.l InvertDPadReturn
InvertDPad_ButtonsOnly:
REP #$20 ; set 16-bit accumulator
LDA $4218
BIT.w #$8040 : BEQ + : EOR.w #$8040 : + ; swap X/B
BIT.w #$4080 : BEQ + : EOR.w #$4080 : + ; swap Y/A
STA $00
SEP #$20 ; set 8-bit accumulator
JML.l InvertDPadReturn
InvertDPad_Both:
REP #$20 ; set 16-bit accumulator
LDA $4218
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 $00
SEP #$20 ; set 8-bit accumulator
JML.l InvertDPadReturn
InvertDPad_SwapSides:
REP #$20 ; set 16-bit accumulator
LDA $4218
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 $00
SEP #$20 ; set 8-bit accumulator
JML.l InvertDPadReturn
InvertDPad_DPadLROnly:
LDA $4218 : STA $00
LDA $4219
BIT.b #$03 : BEQ + : EOR.b #$03 : + ; swap left/right
STA $01
JML.l InvertDPadReturn
InvertDPad_DPadUDOnly:
LDA $4218 : STA $00
LDA $4219
BIT.b #$0C : BEQ + : EOR.b #$0C : + ; swap up/down
STA $01
JML.l InvertDPadReturn
InvertDPad:
LDA.l OneMindPlayerCount : BEQ .crowd_control
@@ -29,44 +84,18 @@ InvertDPad:
LDA $4219 : STA $01
JML.l InvertDPadReturn
+ DEC : BEQ .dpadOnly
DEC : BEQ .buttonsOnly
DEC : BEQ .invertBoth
.swapSides
REP #$20 ; set 16-bit accumulator
LDA $4218
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 $00
SEP #$20 ; set 8-bit accumulator
JML.l InvertDPadReturn
.invertBoth
REP #$20 ; set 16-bit accumulator
LDA $4218
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 $00
SEP #$20 ; set 8-bit accumulator
JML.l InvertDPadReturn
.buttonsOnly
REP #$20 ; set 16-bit accumulator
LDA $4218
BIT.w #$8040 : BEQ + : EOR.w #$8040 : + ; swap X/B
BIT.w #$4080 : BEQ + : EOR.w #$4080 : + ; swap Y/A
STA $00
SEP #$20 ; set 8-bit accumulator
JML.l InvertDPadReturn
.dpadOnly
LDA $4218 : STA $00
LDA $4219
BIT.b #$0C : BEQ + : EOR.b #$0C : + ; swap up/down
BIT.b #$03 : BEQ + : EOR.b #$03 : + ; swap left/right
STA $01
JML.l InvertDPadReturn
+ DEC : BNE +
JMP.w InvertDPad_DPadOnly
+ DEC : BNE +
JMP.w InvertDPad_ButtonsOnly
+ DEC : BNE +
JMP.w InvertDPad_Both
+ DEC : BNE +
JMP.w InvertDPad_SwapSides
+ DEC : BNE +
JMP.w InvertDPad_DPadLROnly
+ JMP.w InvertDPad_DPadUDOnly
.onemind_controller_offset
db 0 ; player 0 - $4218 - joy1d1
@@ -76,8 +105,6 @@ JML.l InvertDPadReturn
db 2 ; player 4 - $421A - joy2d1
db 6 ; player 5 - $421E - joy2d2
;--------------------------------------------------------------------------------
HandleOneMindController:

Binary file not shown.

Binary file not shown.

View File

@@ -1,13 +1,13 @@
CheckReceivedItemPropertiesBeforeLoad:
LDA $A0 : BEQ .normalCode
LDA $7EC005 : BNE .lightOff
.normalCode
LDA.l AddReceivedItemExpanded_properties, X ;Restore Rando Code
.normalCode
JSL LoadReceivedItemExpandedProperties ; get palette
RTL
.lightOff
PHX : PHY : PHB
LDA.l AddReceivedItemExpanded_properties, X ; get palette
JSL LoadReceivedItemExpandedProperties ; get palette
REP #$30
AND #$0007 ; mask out palette

View File

@@ -11,13 +11,24 @@ DoWorldFix:
JMP DoWorldFix_Inverted
+
LDA.l Bugfix_MirrorlessSQToLW : BEQ .skip_mirror_check
LDA MirrorEquipment : AND #$02 : BEQ .noMirror ; check if we have the mirror
LDA FollowerIndicator : CMP #$04 : BNE + ; if old man following, skip mirror/aga check
LDA.l OldManRetrievalWorld
BRA .noMirror
+ LDA MirrorEquipment : AND #$02 : BEQ .noMirror ; check if we have the mirror
.skip_mirror_check ; alt entrance point
LDA ProgressIndicator : CMP.b #$03 : BCS .done ; check if agahnim 1 is alive
.aga1Alive
.setLightWorld
LDA #$00
.noMirror
STA CurrentWorld ; set flag to light world
LDA.l SmithDeleteOnSave : BEQ .transform
LDA FollowerIndicator
CMP #$07 : BEQ .clear ; clear frog
CMP #$08 : BEQ .clear ; clear dwarf - consider flute implications
BRA .done
.clear
LDA.b #$00 : STA FollowerIndicator : BRA .done ; clear follower
.transform
LDA FollowerIndicator : CMP #$07 : BNE .done : INC : STA FollowerIndicator ; convert frog to dwarf
.done
RTL
@@ -46,18 +57,26 @@ RTL
;================================================================================
DoWorldFix_Inverted:
LDA.l Bugfix_MirrorlessSQToLW : BEQ .skip_mirror_check
LDA.l MirrorEquipment : AND #$02 : BEQ .noMirror ; check if we have the mirror
LDA FollowerIndicator : CMP #$04 : BNE + ; if old man following, skip mirror/aga check
LDA.l OldManRetrievalWorld
BRA .setWorld
+ LDA.l MirrorEquipment : AND #$02 : BEQ .noMirror ; check if we have the mirror
.skip_mirror_check ; alt entrance point
LDA ProgressIndicator : CMP.b #$03 : BCS .done ; check if agahnim 1 is alive
.noMirror
.aga1Alive
LDA #$40 : STA CurrentWorld ; set flag to dark world
LDA FollowerIndicator
CMP #$07 : BEQ .clear ; clear frog
CMP #$08 : BEQ .clear ; clear dwarf - consider flute implications
BRA .done
.clear
LDA.b #$00 : STA FollowerIndicator ; clear follower
.setDarkWorld
LDA #$40
.setWorld
STA CurrentWorld ; set flag to dark world
LDA.l SmithDeleteOnSave : BEQ .transform
LDA FollowerIndicator
CMP #$07 : BEQ .clear ; clear frog
CMP #$08 : BEQ .clear ; clear dwarf - consider flute implications
BRA .done
.clear
LDA.b #$00 : STA FollowerIndicator : BRA .done ; clear follower
.transform
LDA FollowerIndicator : CMP #$07 : BNE .done : INC : STA FollowerIndicator ; convert frog to dwarf
.done
RTL
;--------------------------------------------------------------------------------
@@ -68,7 +87,7 @@ SetDeathWorldChecked_Inverted:
LDA GanonPyramidRespawn : BNE .castle ; if flag is set, force respawn at pyramid on death to ganon
++
.outdoors
JMP DoWorldFix
JMP DoWorldFix_Inverted
.dungeon
LDA Bugfix_PreAgaDWDungeonDeathToFakeDW : BNE .done ; if the bugfix is enabled, we do nothing on death in dungeon
@@ -85,10 +104,21 @@ RTL
;--------------------------------------------------------------------------------
FakeWorldFix:
LDA FixFakeWorld : BEQ +
LDA $8A : AND.b #$40 : STA CurrentWorld
PHX
LDX $8A : LDA.l OWTileWorldAssoc, X : STA CurrentWorld
PLX
+
RTL
;--------------------------------------------------------------------------------
GetCurrentWorldForLoad:
LDA FollowerIndicator : CMP #$04 : BNE .default
LDA InvertedMode : BEQ +
LDA #$40
+ RTL
.default
LDA CurrentWorld
RTL
;--------------------------------------------------------------------------------
MasterSwordFollowerClear:
LDA FollowerIndicator
CMP #$0E : BNE .exit ; clear master sword follower
@@ -135,22 +165,25 @@ RefreshRainAmmo:
.done
RTL
;--------------------------------------------------------------------------------
!INFINITE_ARROWS = "$7F50C8"
!INFINITE_BOMBS = "$7F50C9"
!INFINITE_MAGIC = "$7F50CA"
SetEscapeAssist:
LDA ProgressIndicator : CMP.b #$01 : BNE .no_train ; check if we're in rain state
.rain
LDA.l EscapeAssist
BIT.b #$04 : BEQ + : STA !INFINITE_MAGIC : +
BIT.b #$02 : BEQ + : STA !INFINITE_BOMBS : +
BIT.b #$01 : BEQ + : STA !INFINITE_ARROWS : +
BIT.b #$04 : BEQ + : STA InfiniteMagicModifier : +
BIT.b #$02 : BEQ + : STA InfiniteBombsModifier : +
BIT.b #$01 : BEQ + : STA InfiniteArrowsModifier : +
BRA ++
.no_train ; choo choo
LDA.l EscapeAssist : BIT.b #$04 : BEQ + : LDA.b #$00 : STA !INFINITE_MAGIC : +
LDA.l EscapeAssist : BIT.b #$02 : BEQ + : LDA.b #$00 : STA !INFINITE_BOMBS : +
LDA.l EscapeAssist : BIT.b #$01 : BEQ + : LDA.b #$00 : STA !INFINITE_ARROWS : +
LDA.l EscapeAssist
BIT.b #$40 : BEQ + : STA InfiniteMagicModifier : +
BIT.b #$20 : BEQ + : STA InfiniteBombsModifier : +
BIT.b #$10 : BEQ + : STA InfiniteArrowsModifier : +
++
LDA.l SpecialWeapons : AND.b #$7F : CMP #$01 : BNE +
LDA.l SpecialWeaponLevel : BEQ +
LDA #$01 : STA InfiniteBombsModifier
+
RTL
;--------------------------------------------------------------------------------
SetSilverBowMode:

View File

@@ -268,8 +268,7 @@ RTL
DialogFairyThrow:
LDA.l Restrict_Ponds : BEQ .normal
LDA BottleContentsOne
ORA BottleContentsTwo : ORA BottleContentsThree : ORA BottleContentsFour : BNE .normal
ORA BottleContentsTwo : ORA BottleContentsThree : ORA BottleContentsFour : BNE .normal
.noInventory
LDA $0D80, X : !ADD #$08 : STA $0D80, X
LDA.b #$51
@@ -300,31 +299,64 @@ RTL
; s = silver arrow bow
; p = 2nd progressive bow
DialogGanon2:
JSL.l CheckGanonVulnerability
JSL.l CheckGanonVulnerability
REP #$20
BCS +
LDA.w #$018D : BRA ++
+
LDA.w #$018D : JMP .done
+
LDA.l GanonVulnerabilityItem : AND #$00FF : BNE .special_item
LDA.l SpecialWeapons : AND.w #$007F
CMP.w #$0001 : BEQ .bombs ; bombs if special bomb mode
.silver_arrows
LDA.l BowTracking
BIT.w #$0080 : BNE + ; branch if bow
LDA.w #$0192 : BRA ++
+
BIT.w #$0040 : BEQ + ; branch if no silvers
LDA.w #$0195 : BRA ++
+
BIT.w #$0020 : BNE + ; branch if p bow
LDA.w #$0194 : BRA ++
+
BIT.w #$0080 : BEQ + ; branch if no bow
LDA.w #$0193 : BRA ++
+
LDA.w #$016E
++
BIT.w #$0080 : BNE + ; branch if bow
LDA.w #$0192 : JMP .done
+
BIT.w #$0040 : BEQ + ; branch if no silvers
LDA.w #$0195 : JMP .done
+
BIT.w #$0020 : BNE + ; branch if p bow
LDA.w #$0194 : JMP .done
+
BIT.w #$0080 : BEQ + ; branch if no bow
LDA.w #$0193 : JMP .done
+
LDA.w #$016E : JMP .done
.special_item
CMP.w #$0001 : BEQ .silver_arrows
CMP.w #$0004 : BEQ .bombs
CMP.w #$0005 : BEQ .powder
CMP.w #$0010 : BEQ .bee
PHX : TAX
LDA.l EquipmentWRAM-1, X : PLX : AND #$00FF : BNE +
LDA.w #$0192 : JMP .done
+
LDA.w #$0195 : BRA .done
.bombs
LDA.l BombsEquipment : AND #$00FF : BNE +
LDA.l InfiniteBombsModifier : AND #$00FF : BNE + ; check for infinite bombs
LDA.w #$0192 : BRA .done
+
LDA.w #$0195 : BRA .done
.powder
LDA.l InventoryTracking : AND #$0010 : BNE + ; check for powder
LDA.w #$0192 : BRA .done
+
LDA.w #$0195 : BRA .done
.bee
LDA.l BottleContentsOne : AND #$00FF : CMP.w #$0007 : BEQ + : CMP.w #$0008 : BEQ +
LDA.l BottleContentsTwo : AND #$00FF : CMP.w #$0007 : BEQ + : CMP.w #$0008 : BEQ +
LDA.l BottleContentsThree : AND #$00FF : CMP.w #$0007 : BEQ + : CMP.w #$0008 : BEQ +
LDA.l BottleContentsFour : AND #$00FF : CMP.w #$0007 : BEQ + : CMP.w #$0008 : BEQ +
LDA.w #$0192 : BRA .done
+
LDA.w #$0195 : BRA .done
.done
STA $1CF0
SEP #$20
JSL.l Sprite_ShowMessageMinimal_Alt
JSL.l Sprite_ShowMessageMinimal_Alt
RTL
;--------------------------------------------------------------------------------
DialogEtherTablet:
@@ -334,11 +366,8 @@ DialogEtherTablet:
PLA : JML Sprite_ShowMessageUnconditional ; Wacky Hylian Text
+
BIT $F4 : BVC - ; Show normal text if Y is not pressed
LDA.l AllowHammerTablets : BEQ ++
LDA HammerEquipment : BEQ .yesText : BRA .noText
++
LDA SwordEquipment : CMP.b #$FF : BEQ .yesText : CMP.b #$02 : BCS .noText
;++
JSL CheckTabletSword : BMI .yesText
CMP.b #$02 : !BGE .noText
.yesText
PLA
LDA.b #$0C
@@ -356,13 +385,10 @@ DialogBombosTablet:
PLA : JML Sprite_ShowMessageUnconditional ; Wacky Hylian Text
+
BIT $F4 : BVC - ; Show normal text if Y is not pressed
LDA.l AllowHammerTablets : BEQ ++
LDA HammerEquipment : BEQ .yesText : BRA .noText
++
LDA SwordEquipment : CMP.b #$FF : BEQ .yesText : CMP.b #$02 : !BGE .noText
;++
JSL CheckTabletSword : BMI .yesText
CMP.b #$02 : !BGE .noText
.yesText
PLA
PLA
LDA.b #$0D
LDY.b #$01
JML Sprite_ShowMessageUnconditional ; Text From MSPedestalText (tables.asm)
@@ -374,7 +400,7 @@ RTL
DialogSahasrahla:
LDA.l PendantsField : AND #$04 : BEQ + ;Check if player has green pendant
LDA.b #$2F
LDY.b #$00
LDY.b #$00
JML Sprite_ShowMessageUnconditional
+
RTL
@@ -455,7 +481,7 @@ RTL
CalculateSignIndex:
; for the big 1024x1024 screens we are calculating link's effective
; screen area, as though the screen was 4 different 512x512 screens.
; And we do this in a way that will likely give the right value even
; And we do this in a way that will likely give the right value even
; with major glitches.
LDA $8A : ASL A : TAY ;what we wrote over
@@ -464,13 +490,13 @@ CalculateSignIndex:
LDA $21 : AND.w #$0002 : ASL #2 : EOR $8A : AND.w #$0008 : BEQ +
TYA : !ADD.w #$0010 : TAY ;add 16 if we are in lower half of big screen.
+
+
LDA $23 : AND.w #$0002 : LSR : EOR $8A : AND.w #$0001 : BEQ +
TYA : INC #2 : TAY ;add 16 if we are in lower half of big screen.
+
; ensure even if things go horribly wrong, we don't read the sign out of bounds and crash:
TYA : AND.w #$00FF : TAY
TYA : AND.w #$00FF : TAY
.done
RTL

View File

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

View File

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

View File

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

View File

@@ -92,4 +92,13 @@ OverridePaletteHeader:
lda.l PaletteTable, x
iny : rtl
+ rep #$20 : iny : lda [$0D], Y ; what we wrote over
rtl
rtl
Sprite_ConditionalPrepOAMCoord:
LDA.w $0E20,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

@@ -16,7 +16,7 @@ HudAdditions:
+ JSL HexToDec_fast
.skip
LDA #$207F : STA !GOAL_DRAW_ADDRESS+2 : STA !GOAL_DRAW_ADDRESS+4
PLA : PHA : CMP.w #100 : !BLT +
LDA.b 1,S : CMP.w #100 : !BLT +
LDX.b $05 : TXA : ORA.w #$2490 : STA !GOAL_DRAW_ADDRESS+2 ; draw 100's digit
+ PLA : CMP.w #10 : !BLT +
LDX.b $06 : TXA : ORA.w #$2490 : STA !GOAL_DRAW_ADDRESS+4 ; draw 10's digit
@@ -40,8 +40,15 @@ HudAdditions:
STA !GOAL_DRAW_ADDRESS+14 : STA !GOAL_DRAW_ADDRESS+16
.end_item_count
LDX $1B : BNE + : RTS : + ; Skip if outdoors
ldx $040c : cpx #$ff : bne + : rts : + ; Skip if not in dungeon
LDX $1B : BNE + ; if outdoors
lda.l OWMode : and.w #((!FLAG_OW_CROSSED+!FLAG_OW_MIXED)<<8)+$ff : bne ++ : rts ; Skip if vanilla ow rando
++ lda CurrentHealth : and #$00ff : beq ++
lda CurrentWorld : and #$00ff : beq +++
lda #$2d60 : bra .owdisplay
+++ lda #$2d68 : bra .owdisplay
++ lda #$207f
.owdisplay sta $7ec702 : rts
+ ldx $040c : cpx #$ff : bne + : rts : + ; Skip if not in dungeon
lda.l DRMode : bne + : rts : + ; Skip if not door rando
phb : phk : plb
lda CompassField : and.l $0098c0, x : beq +
@@ -55,7 +62,7 @@ HudAdditions:
+ lda #$207f
.reminder sta $7ec702
+ lda.w DRFlags : and #$0004 : beq .restore
lda MapField : and.l $0098c0, x : beq .restore
; lda MapField : and.l $0098c0, x : beq .restore
txa : lsr : tax
lda.l GenericKeys : and #$00ff : bne +
@@ -126,7 +133,7 @@ DrHudDungeonItemsAdditions:
jsr ConvertToDisplay2 : sta $1644, y
+ iny #2 : lda.w #$24f5 : sta $1644, y
phx : ldx $00
lda MapField : and.l $0098c0, x : beq + ; must have map
; lda MapField : and.l $0098c0, x : beq + ; must have map
plx : sep #$30 : lda.l ChestKeys, x : sta $02
lda.l GenericKeys : bne +++
lda $02 : !sub DungeonCollectedKeys, x : sta $02

View File

@@ -433,7 +433,7 @@ HandleSpecialDoorLanding: {
HandleIncomingDoorState:
PHA
LDA.l DRMode : BEQ .noDoor
PLA : PHA : AND.b #$FA : CMP.b #$80 : bne .noDoor
LDA.b 1,S : AND.b #$FA : CMP.b #$80 : bne .noDoor
.setDoorState
LDA.w $0418 : AND.b #$02 : BNE + : INC
@@ -443,6 +443,5 @@ HandleSpecialDoorLanding: {
PLA
CMP.b #$34 : BNE + ; inroom stairs
PHA : LDA.b #$26 : STA.w $045E : PLA
+
RTL
+ RTL
}

View File

@@ -19,7 +19,8 @@ OnFileLoadOverride:
MirrorCheckOverride:
lda.l DRFlags : and #$02 : beq ++
lda MirrorEquipment : cmp #$01 : beq +
++ lda $8A : and #$40 ; what I wrote over
;++ lda $8A : and #$40 ; what I wrote over
++ phx : ldx $8A : lda.l OWTileWorldAssoc,x : plx : and.b #$ff
rtl
+ lda.l DRScroll : rtl
@@ -128,12 +129,12 @@ BigKeyDoorCheck:
PLA : PEA.w RoomDraw_OneSidedShutters_South_onesided_shutter_or_big_key_door-1
+ 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
; 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

163
elder.asm
View File

@@ -1,6 +1,6 @@
NewElderCode:
{
LDA $8A : CMP #$1B : BEQ .newCodeContinue
LDA $8A : AND.b #$3F : CMP #$1B : BEQ .newCodeContinue
;Restore Jump we can keep the RTL so JML
JML $05F0CD
.newCodeContinue
@@ -12,7 +12,7 @@ JSR Elder_Code
PLB
RTL
}
Elder_Draw:
{
@@ -50,6 +50,8 @@ RTL
RTS
+
SEP #$20
LDA.b $11
BNE .done
LDA.b #$96
LDY.b #$01
@@ -58,7 +60,7 @@ RTL
LDA.l GoalCounter
CMP.l GoalItemRequirement : !BLT +
SEP #$20
JSL.l ActivateGoal
JSL ActivateTriforceCutscene
+
.dont_show
@@ -67,3 +69,158 @@ RTL
LDA.b $1A : LSR #5 : AND.b #$01 : STA.w $0DC0, X
RTS
}
;--------------------------------------------------------------------------------
; Triforce (Pedestal) Cutscene
;--------------------------------------------------------------------------------
ActivateTriforceCutscene:
; despawn other sprites
LDY.b #$0F
- LDA.w $0E20,Y : CMP.b #$16 : BNE +
CPY.b #$00 : BEQ .next
; move Murahdahla to slot 0 for draw priority reasons
LDA.w $0E20,Y : STA.w $0E20
LDA.w $0D00,Y : STA.w $0D00
LDA.w $0D10,Y : STA.w $0D10
LDA.w $0D20,Y : STA.w $0D20
LDA.w $0D30,Y : STA.w $0D30
LDA.w $0D40,Y : STA.w $0D40
LDA.w $0F50,Y : STA.w $0F50
LDA.w $0E40,Y : STA.w $0E40
LDA.w $0E60,Y : STA.w $0E60
LDA.w $0DD0,Y : STA.w $0DD0
LDA.b #$02 : STA.w $0F20
+ LDA.b #$00 : STA.w $0DD0,Y
.next
DEY : BPL -
LDA.b #$62 ; MasterSword Sprite
JSL Sprite_SpawnDynamically
; set up coords
LDA.b $22 : STA.w $0D10,Y
LDA.b $23 : STA.w $0D30,Y
LDA.b $20 : CLC : ADC.b #$08 : STA.w $0D00,Y
LDA.b $21 : ADC.b #$00 : STA.w $0D20,Y
LDA.b #$01 : STA.w $0D90,Y ; our indicator this is a special cutscene sprite
INC : STA.b $2F ; makes Link face downward
; reset modules
LDA.b $1B : BEQ +
LDA.b #$07
BRA ++
+ LDA.b #$09
++ STA.b $10
STZ.b $11 : STZ.b $B0
RTL
pushpc
org $058928
MasterSword_InPedestal_DoCutscene:
org $0589B1
MasterSword_ConditionalHandleReceipt_DoReceipt:
org $0588DF
JSL MasterSword_CheckIfPulled : PLX : NOP #2
db $90 ; BCC instead of BEQ
org $05890E
JSL MasterSword_ConditionalActivateCutscene
org $05895F
JSL MasterSword_ConditionalGrabPose : NOP
org $058994
JSL MasterSword_ConditionalGrabPose : NOP
org $058D1C
JML MasterSword_SpawnPendantProp_ChangePalette
MasterSword_SpawnPendantProp_ChangePalette_return:
org $0589A3
JSL MasterSword_ConditionalHandleReceipt : NOP #2
pullpc
MasterSword_CheckIfPulled:
CPX.b #$80 : BEQ +
- CLC : RTL ; not on pedestal screen, continue with cutscene
+ LDA.l $7EF280,X : AND.b #$40 ; what we wrote over
BEQ - : SEC : RTL
MasterSword_ConditionalActivateCutscene:
LDA.w $0D90,X : BNE .specialCutscene
JML Sprite_CheckDamageToPlayerSameLayerLong ; what we wrote over
.specialCutscene
LDA.b #$02 : STA.w $02DA ; Link's 2-hands-up pose
STA.b $EE ; draw Link on top
LDA.b #$6A : JSL RequestSlottedTile ; draw Triforce piece in VRAM
PLA : PLA : PLA : JML MasterSword_InPedestal_DoCutscene ; do cutscene
MasterSword_ConditionalGrabPose:
PHA
LDA.w $0D90,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 $0D40,Y : PLX ; what we wrote over
LDA.w $0D90,X : BNE .specialCutscene
BRA .done
.specialCutscene
LDA.b #$08 : STA.w $0F50,Y ; change palette
LDA.b #$02 : STA.w $0F20,Y ; change layer
.done
JML MasterSword_SpawnPendantProp_ChangePalette_return
MasterSword_ConditionalHandleReceipt:
LDA.w $0D90,X : BNE .specialCutscene
LDX.b $8A : LDA.l $7EF280,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 $058AB6
MasterSword_SpawnLightWell:
org $058AD0
MasterSword_SpawnLightFountain:
org $058B62
MasterSword_SpawnLightBeam:
org $058941
JSL MasterSword_ConditionalSpawnLightWell : NOP #2
MasterSword_SpawnLightWell_return:
org $058952
JSL MasterSword_ConditionalSpawnLightFountain : NOP #2
MasterSword_SpawnLightFountain_return:
org $058B64
JSL MasterSword_ConditionalSpawnLightBeam : NOP #2
pullpc
MasterSword_ConditionalSpawnLightWell:
INC.w $0D80,X ; part of what we wrote over
LDA.w $0D90,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 $0D80,X ; part of what we wrote over
LDA.w $0D90,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 $0D90,X : BNE .specialCutscene
LDA.b #$62 : JSL Sprite_SpawnDynamically ; what we wrote over
RTL
.specialCutscene
LDY.b #$FF
RTL

View File

@@ -20,7 +20,7 @@ LockAgahnimDoors:
!BGE .crystalOrUnlock
LDA #$0001 : RTL
.crystalOrUnlock
LDA InvertedMode : AND.w #$00FF : BEQ .unlock
LDA SwapAgaGanonsTower : AND.w #$00FF : BEQ .unlock
LDA OverworldEventDataWRAM+$43 : AND.w #$0020 : BNE .unlock ; Check if GT overlay is already on or not
LDA $0308 : AND.w #$0080 : BEQ ++ ;If we are holding an item
@@ -42,7 +42,7 @@ LockAgahnimDoors:
RTL
;---------------------------------------------------------------------------------
FlagAgahnimDoor:
LDA.l InvertedMode : BEQ .vanilla
LDA.l SwapAgaGanonsTower : BEQ .vanilla
LDA OverworldEventDataWRAM+$43 : ORA #$20 : STA OverworldEventDataWRAM+$43 ; activate GT overlay
@@ -80,8 +80,7 @@ AllowStartFromSingleEntranceCave:
LDA StartingEntrance : AND.w #$00FF ; What we wrote over
PHA
TAX
LDA.l StartingAreaExitOffset, X
AND.w #$00FF
LDA.l StartingAreaExitOffset, X : AND.w #$00FF
BNE +
JMP .done
@@ -126,8 +125,9 @@ AllowStartFromSingleEntranceCave:
SEP #$20 ; set 8-bit accumulator
LDA StartingEntrance : TAX
LDA.l StartingAreaOverworldDoor, X : STA.l $7F5099 ;Load overworld door
REP #$20 ; reset 16-bit accumulator
JSL.l CacheDoorFrameData
JSL.l CacheDoorFrameData
.done
PLA
@@ -194,9 +194,9 @@ JML Overworld_Hole_End
;--------------------------------------------------------------------------------
PreventEnterOnBonk:
STA $00 ; part of what we wrote over
LDA.l InvertedMode : AND.w #$00FF : BEQ .done
LDA.b $8A : TAX : LDA.l OWTileMapAlt, X : AND.w #$0001 : BEQ .done
LDA.l $5D : AND.w #$00FF : CMP.w #$0014 : BNE .done ;in mirror mode?
LDA.b $8A : AND.w #$0040 : CMP $7B : BEQ .done ; Are we bonking, or doing the superbunny glitch?
LDA.b $8A : TAX : LDA.l OWTileWorldAssoc, X : AND.w #$00FF : CMP $7B : BEQ .done ; Are we bonking, or doing the superbunny glitch?
; If in inverted, are in mirror mode, and are bonking then do not enter
JML.l PreventEnterOnBonk_BRANCH_IX
@@ -214,15 +214,16 @@ TurtleRockEntranceFix:
RTL
;--------------------------------------------------------------------------------
AnimatedEntranceFix: ;when an entrance animation tries to start
PHA
PHA : PHX
LDA.l InvertedMode : BEQ + ;If we are in inverted mode
LDA $8A : AND.b #$40 : BNE + ;and in the light world
PLA
LDA.l OWMode+1 : AND.b #!FLAG_OW_MIXED : BNE + ;If we are in Mixed OW shuffle mode
LDA $8A : AND #$40 : BNE + ;and in the light world
PLX : PLA
STZ $04C6 ; skip it.
LDA #$00
RTL
+
PLA
PLX : PLA
STA $02E4 ;what we wrote over
STA $0FC1 ;what we wrote over
STA $0710 ;what we wrote over

View File

@@ -59,9 +59,9 @@ RTL
OnUncleItemGet:
PHA
LDA.l EscapeAssist
BIT.b #$04 : BEQ + : STA !INFINITE_MAGIC : +
BIT.b #$02 : BEQ + : STA !INFINITE_BOMBS : +
BIT.b #$01 : BEQ + : STA !INFINITE_ARROWS : +
BIT.b #$04 : BEQ + : STA InfiniteMagicModifier : +
BIT.b #$02 : BEQ + : STA InfiniteBombsModifier : +
BIT.b #$01 : BEQ + : STA InfiniteArrowsModifier : +
LDA UncleItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID
PLA
@@ -70,53 +70,53 @@ OnUncleItemGet:
LDA.l UncleRefill : BIT.b #$04 : BEQ + : LDA.b #$80 : STA.l MagicFiller : + ; refill magic
LDA.l UncleRefill : BIT.b #$02 : BEQ + : LDA.b #50 : STA.l BombsFiller : + ; refill bombs
LDA.l UncleRefill : BIT.b #$01 : BEQ + ; refill arrows
LDA.b #70 : STA.l ArrowsFiller
LDA.b #70 : STA.l ArrowsFiller
LDA.l ArrowMode : BEQ +
LDA.l BowTracking : ORA.b #$80 : STA.l BowTracking ; enable bow toggle
REP #$20 ; set 16-bit accumulator
LDA.l CurrentRupees : !ADD.l FreeUncleItemAmount : STA.l CurrentRupees ; rupee arrows, so also give the player some money to start
SEP #$20 ; set 8-bit accumulator
LDA.l ArrowMode : BEQ +
LDA.l BowTracking : ORA #$80 : STA.l BowTracking ; enable bow toggle
REP #$20 ; set 16-bit accumulator
LDA.l CurrentRupees : !ADD.l FreeUncleItemAmount : STA.l CurrentRupees ; rupee arrows, so also give the player some money to start
SEP #$20 ; set 8-bit accumulator
+
LDA.l ProgressIndicator : BNE +
LDA.b #$01 : STA.l ProgressIndicator ; handle rain state
+
LDA.l ProgressIndicator : BNE +
LDA.b #$01 : STA.l ProgressIndicator ; handle rain state
+
RTL
;--------------------------------------------------------------------------------
OnAga2Defeated:
JSL.l Dungeon_SaveRoomData_justKeys ; thing we wrote over, make sure this is first
LDA.b #$01 : STA.l Aga2Duck
JML.l IncrementAgahnim2Sword
JSL.l Dungeon_SaveRoomData_justKeys ; thing we wrote over, make sure this is first
LDA.b #$01 : STA.l Aga2Duck
JML.l IncrementAgahnim2Sword
;--------------------------------------------------------------------------------
OnFileCreation:
; Copy initial SRAM state from ROM to cart SRAM
PHB
LDA.w #$03D7 ; \
LDX.w #$B000 ; | Copies from beginning of inital sram table up to file name
LDY.w #$0000 ; | (exclusively)
MVN $70, $30 ; /
; Skip file name and validity value
LDA.w #$010C ; \
LDX.w #$B3E3 ; | Rando-Specific Assignments & Game Stats block
LDY.w #$03E3 ; |
MVN $70, $30 ; /
PLB
; Copy initial SRAM state from ROM to cart SRAM
PHB
LDA.w #$03D7 ; \
LDX.w #$B000 ; | Copies from beginning of inital sram table up to file name
LDY.w #$0000 ; | (exclusively)
MVN $70, $30 ; /
; Skip file name and validity value
LDA.w #$010C ; \
LDX.w #$B3E3 ; | Rando-Specific Assignments & Game Stats block
LDY.w #$03E3 ; |
MVN $70, $30 ; /
PLB
; resolve instant post-aga if standard
SEP #$20
LDA.l InitProgressIndicator : BIT #$80 : BEQ +
LDA.b #$00 : STA.l ProgressIndicatorSRAM ; set post-aga after zelda rescue
LDA.b #$00 : STA.l OverworldEventDataSRAM+$02 ; keep rain state vanilla
+
REP #$20
; resolve instant post-aga if standard
SEP #$20
LDA.l InitProgressIndicator : BIT #$80 : BEQ +
LDA.b #$00 : STA.l ProgressIndicatorSRAM ; set post-aga after zelda rescue
LDA.b #$00 : STA.l OverworldEventDataSRAM+$02 ; keep rain state vanilla
+
REP #$20
; Set validity value and do some cleanup. Jump to checksum.
LDA.w #$55AA : STA.l $7003E1
STZ $00
STZ $01
LDX.b $00
LDY.w #$0000
TYA
; Set validity value and do some cleanup. Jump to checksum.
LDA.w #$55AA : STA.l $7003E1
STZ $00
STZ $01
LDX.b $00
LDY.w #$0000
TYA
JML.l InitializeSaveFile_build_checksum
;--------------------------------------------------------------------------------
@@ -254,17 +254,17 @@ PostItemAnimation:
LDA $0403 : STA !MULTIWORLD_ROOMDATA
+
LDA.w $02E9 : CMP.b #$01 : BNE +
LDA.b $2F : BEQ +
JSL.l IncrementChestTurnCounter
+
LDA !MULTIWORLD_ITEM_PLAYER_ID : BEQ +
STZ $02E9
LDA #$00 : STA !MULTIWORLD_ITEM_PLAYER_ID
JML.l Ancilla_ReceiveItem_objectFinished
+
LDA.w $02E9 : CMP.b #$01 : BNE +
LDA.b $2F : BEQ +
JSL.l IncrementChestTurnCounter
+
STZ $02E9 : LDA $0C5E, X ; thing we wrote over to get here
STZ $02E9 : LDA $0C5E, X ; thing we wrote over to get here
JML.l Ancilla_ReceiveItem_optimus+6
;--------------------------------------------------------------------------------

View File

@@ -268,15 +268,16 @@ DrawPlayerFileShared:
%fs_drawBottle(EquipmentSRAM+$1F,9,23)
; Sword
LDA.l SpecialWeapons : AND.w #$007F : CMP #$0001 : BEQ .bombSword
LDA.l EquipmentSRAM+$19 : AND.w #$00FF : BNE +
%fs_drawItemGray(3,26,FileSelectItems_fighters_sword)
BRA ++
JMP ++
+ : DEC : BNE +
%fs_drawItem(3,26,FileSelectItems_fighters_sword)
BRA ++
JMP ++
+ : DEC : BNE +
%fs_drawItem(3,26,FileSelectItems_master_sword)
BRA ++
JMP ++
+ : DEC : BNE +
%fs_drawItem(3,26,FileSelectItems_tempered_sword)
BRA ++
@@ -286,6 +287,29 @@ DrawPlayerFileShared:
+
; a sword value above 4 is either corrupted or 0xFF (a.k.a. swordless)
%fs_drawItemGray(3,26,FileSelectItems_fighters_sword)
BRA ++
.bombSword
LDA.l $70038F : AND.w #$00FF : BNE +
%fs_drawItemGray(3,26,FileSelectItems_fighters_bombs)
BRA ++
+ : DEC : BNE +
%fs_drawItem(3,26,FileSelectItems_fighters_bombs)
BRA ++
+ : DEC : BNE +
%fs_drawItem(3,26,FileSelectItems_master_bombs)
BRA ++
+ : DEC : BNE +
%fs_drawItem(3,26,FileSelectItems_tempered_bombs)
BRA ++
+ : DEC : BNE +
%fs_drawItem(3,26,FileSelectItems_gold_bombs)
BRA ++
+ : DEC : BNE +
%fs_drawItem(3,26,FileSelectItems_extra_gold_bombs)
BRA ++
+
; a bomb value above 5 is... who knows, let's just pretend it's 5
%fs_drawItem(3,26,FileSelectItems_extra_gold_bombs)
++
; Shield
@@ -556,6 +580,18 @@ FileSelectItems:
.good_bee_bottle
dw #$0240|!FS_COLOR_BW, #$0241|!FS_COLOR_BW, #$0254|!FS_COLOR_YELLOW, #$0246|!FS_COLOR_YELLOW
.fighters_bombs
dw #$020C|!FS_COLOR_GREEN, #$020D|!FS_COLOR_GREEN, #$021C|!FS_COLOR_GREEN, #$02A1|!FS_COLOR_GREEN
.master_bombs
dw #$020C|!FS_COLOR_BLUE, #$020D|!FS_COLOR_BLUE, #$021C|!FS_COLOR_BLUE, #$02A2|!FS_COLOR_BLUE
.tempered_bombs
dw #$020C|!FS_COLOR_RED, #$020D|!FS_COLOR_RED, #$021C|!FS_COLOR_RED, #$02A3|!FS_COLOR_RED
.gold_bombs
dw #$020C|!FS_COLOR_YELLOW, #$020D|!FS_COLOR_YELLOW, #$021C|!FS_COLOR_YELLOW, #$02A4|!FS_COLOR_YELLOW
.extra_gold_bombs
dw #$020C|!FS_COLOR_YELLOW, #$020D|!FS_COLOR_YELLOW, #$021C|!FS_COLOR_YELLOW, #$02A5|!FS_COLOR_YELLOW
;--------------------------------------------------------------------------------
FileSelectDrawHudBar:
LDA #$029B|!FS_COLOR_GREEN : %fs_draw16x8(0,10)
@@ -566,11 +602,29 @@ FileSelectDrawHudBar:
LDA $7F5006 : AND.w #$00FF : !ADD.w #$210+!FS_COLOR_BW : %fs_draw8x8(1,11)
LDA $7F5007 : AND.w #$00FF : !ADD.w #$210+!FS_COLOR_BW : %fs_draw8x8(1,12)
LDA SpecialWeapons : AND.w #$007F : CMP #$0001 : BEQ .colorBombs
LDA #$028B|!FS_COLOR_BLUE : %fs_draw16x8(0,14)
LDA EquipmentSRAM+$03 : AND.w #$00FF
JSL.l HexToDec
LDA $7F5006 : AND.w #$00FF : !ADD.w #$210+!FS_COLOR_BW : %fs_draw8x8(1,14)
LDA $7F5007 : AND.w #$00FF : !ADD.w #$210+!FS_COLOR_BW : %fs_draw8x8(1,15)
BRA ++
.colorBombs
LDA $70038F : AND.w #$00FF : BNE +
; no bombs, draw no icon
BRA ++
+ : DEC : BNE +
LDA #$028B|!FS_COLOR_GREEN : %fs_draw16x8(0,14)
BRA ++
+ : DEC : BNE +
LDA #$028B|!FS_COLOR_BLUE : %fs_draw16x8(0,14)
BRA ++
+ : DEC : BNE +
LDA #$028B|!FS_COLOR_RED : %fs_draw16x8(0,14)
BRA ++
+
LDA #$028B|!FS_COLOR_YELLOW : %fs_draw16x8(0,14)
++
LDA.l BowTrackingSRAM : AND.w #$0040 : BEQ +
LDA #$0299|!FS_COLOR_RED : %fs_draw16x8(0,17)

View File

@@ -135,3 +135,20 @@ protectff:
.spow
db $80, $81, $81, $FF, $FF, $FF, $FF, $FF
db $FF, $81, $81, $FF, $FF, $FF, $FF, $FF
FlipperScrollWarp:
STZ $00 : STZ $02 ; what we wrote over
LDA $308358 : BEQ .checkX : RTL
.checkX
LDA $22 : CMP.w $0604 : BCC +
CMP.w $0616 : BCS +
BRA .checkY
+ LDA $7EC186
STA $22
.checkY
LDA $20 : CMP.w $0600 : BCC +
CMP.w $0612 : BCS +
RTL
+ LDA $7EC184
STA $20
RTL

View File

@@ -7,12 +7,13 @@ SpawnHauntedGroveItem:
LDA.l HauntedGroveItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
%GetPossiblyEncryptedItem(HauntedGroveItem, HeartPieceOutdoorValues)
JSL.l PrepDynamicTile
LDA.b #$EB
STA $7FFE00
JSL Sprite_SpawnDynamically
LDA.b #$01 : STA.w !SPRITE_REDRAW, Y
LDX.b #$00
LDA $2F : CMP.b #$04 : BEQ + : INX : +
@@ -61,7 +62,10 @@ FluteBoy:
JML.l FluteBoy_Continue
;--------------------------------------------------------------------------------
FreeDuckCheck:
LDA.l InvertedMode : BEQ .done
LDA.l OWMode+1 : AND.b #!FLAG_OW_MIXED : BNE .skipInvertedCheck
LDA.l InvertedMode : BEQ .done
.skipInvertedCheck
LDA FluteEquipment : CMP.b #$03 : BEQ .done ; flute is already active
; check the area, is it #$18 = 30?

74
generate_bomb_table.rb Normal file
View File

@@ -0,0 +1,74 @@
def process_values(sprite, values)
ret = values.clone
if [1, 2].include?(ret[0]) # boomerang
if sprite == 0x53 # armos knight
ret[0] = 0 # do nothing
else
ret[0] = 5 # stun very briefly instead of damage
end
end
if ret[6] > 0 && sprite != 0x84 # bow and not red eyegore/mimic
ret[6] = 0
end
if ret[7] == 2 # hookshot
ret[7] = 1 # still want to stun
end
if [1, 2, 7].include?(ret[8]) && sprite != 0x92 # bomb and not helmasaur king
ret[8] = 0
end
if ret[9] > 0 && sprite != 0x84 # silver bow and not red eyegore/mimic
ret[9] = 0
end
if ret[10] == 4 # powder
ret[10] = 0
end
if ret[11] > 0 && ![0x23, 0xA1, 0xA3, 0xCD].include?(sprite) # fire rod
ret[11] = 0
end
if ret[12] != 3 && sprite != 0xCC # ice rod
ret[12] = 0
end
if ret[13] > 0 && ![0x23, 0xA1, 0xA3, 0xD1].include?(sprite) # bombos
ret[13] = 0
end
if ret[14] != 1 && ![0xD1].include?(sprite) # ether
ret[14] = 0
end
if [1, 2].include?(ret[15]) && ![0xD1].include?(sprite) # quake
ret[15] = 0
end
if sprite == 0x53 and ret[2] == 3
ret[2] = 1 # armos knight? let's make class 2 not suck
end
return ret
end
def split_value(byte)
return [byte >> 4, byte & 0x0F]
end
def join_values(value1, value2)
return (value1 & 0x0F) << 4 | (value2 & 0x0F)
end
File.open("damage_table.bin") do |input|
File.open("damage_table_sword_bombs.bin", "w") do |output|
i_enum = input.each_byte
(0...0xD7).each do |sprite|
values = []
(0...8).each do
values += split_value(i_enum.next)
end
v_enum = process_values(sprite, values).to_enum
(0...8).each do
output.putc(join_values(v_enum.next, v_enum.next))
end
end
begin
while true
output.putc(i_enum.next)
end
rescue StopIteration
end
end
end

View File

@@ -0,0 +1,38 @@
def process_values(sprite, values)
ret = values.clone
if (ret[1] == 0 && sprite != 0x40) || sprite == 0xCE
# fighter sword does no damage and it's not the evil barrier, or it's Blind
ret[5] = 0
end
return ret
end
def split_value(byte)
return [byte >> 4, byte & 0x0F]
end
def join_values(value1, value2)
return (value1 & 0x0F) << 4 | (value2 & 0x0F)
end
File.open("damage_table.bin") do |input|
File.open("damage_table_pseudo_sword.bin", "w") do |output|
i_enum = input.each_byte
(0...0xD7).each do |sprite|
values = []
(0...8).each do
values += split_value(i_enum.next)
end
v_enum = process_values(sprite, values).to_enum
(0...8).each do
output.putc(join_values(v_enum.next, v_enum.next))
end
end
begin
while true
output.putc(i_enum.next)
end
rescue StopIteration
end
end
end

View File

@@ -68,12 +68,12 @@ CheckGanonVulnerability:
.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)
LDA RoomDataWRAM[$0D].high : AND.b #$08 : 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
LDA RoomDataWRAM[$0D].high : AND.b #$08 : BEQ .fail ; check aga2 first then bleed in
; 04 = crystals only
.crystals

View File

@@ -76,12 +76,18 @@ GetItemDamageValue:
CPX.b #$04 : BEQ .boomerang
CPX.b #$05 : BEQ .boomerang
CPX.b #$39 : BEQ .hookshot
CPX.b #$3b : BEQ .hookshot
CPX.b #$3c : BEQ .hookshot
CPX.b #$3d : BEQ .hookshot
CPX.b #$3B : BEQ .hookshot
CPX.b #$3C : BEQ .hookshot
CPX.b #$3D : BEQ .hookshot
LDA.l SpecialWeapons : AND.b #$7F : CMP.b #$02 : BNE .normal
TXA : AND.b #$78 : CMP.b #$28 : BNE .normal
LDA.l $0DB8F1, X : BEQ .noDamage
LDA.b #$01
RTL
.normal
lda $0db8f1,x ;what we wrote over
LDA.l $0DB8F1, X ; what we wrote over
RTL
.boomerang
LDA.l StunItemAction : AND #$01 : BNE .normal

View File

@@ -49,28 +49,27 @@ HeartContainerGet:
BRA HeartPieceGet_skipLoad
;--------------------------------------------------------------------------------
!REDRAW = "$7F5000"
DrawHeartPieceGFX:
PHP
JSL.l Sprite_IsOnscreen : BCC .offscreen
PHA : PHY
LDA !REDRAW : BEQ .skipInit ; skip init if already ready
JSL.l HeartPieceSpritePrep
JMP .done ; don't draw on the init frame
LDA.w !SPRITE_REDRAW, X : BEQ .skipInit ; skip init if already ready
JSL.l HeartPieceSpritePrep
LDA.w !SPRITE_REDRAW, X : CMP.b #$02 : BEQ .skipInit
BRA .done ; don't draw on the init frame
.skipInit
LDA $0E80, X ; Retrieve stored item type
.skipLoad
JSL.l DrawDynamicTile
CMP #$03 : BNE +
PHA : LDA $0E60, X : ORA.b #$20 : STA $0E60, X : PLA
+
JSL.l Sprite_DrawShadowLong
JSL DrawSlottedTile : BCS .done
; draw shadow
CMP #$03 : BNE +
INC.b $00 : INC.b $00 : INC.b $00 : INC.b $00 ; move narrow sprite shadow over 4 pixels
PHA : LDA $0E60, X : ORA.b #$20 : STA $0E60, X : PLA
+
JSL.l Sprite_DrawShadowLong
.done
PLY : PLA
@@ -78,20 +77,17 @@ DrawHeartPieceGFX:
PLP
RTL
;--------------------------------------------------------------------------------
!REDRAW = "$7F5000"
DrawHeartContainerGFX:
PHP
JSL.l Sprite_IsOnscreen : BCC DrawHeartPieceGFX_offscreen
PHA : PHY
LDA !REDRAW : BEQ .skipInit ; skip init if already ready
JSL.l HeartContainerSpritePrep
BRA DrawHeartPieceGFX_done ; don't draw on the init frame
LDA.w !SPRITE_REDRAW, X : BEQ .skipInit ; skip init if already ready
JSL.l HeartContainerSpritePrep
BRA DrawHeartPieceGFX_done ; don't draw on the init frame
.skipInit
LDA $0E80, X ; Retrieve stored item type
BRA DrawHeartPieceGFX_skipLoad
BRA DrawHeartPieceGFX_skipInit
;--------------------------------------------------------------------------------
HeartContainerSound:
LDA !MULTIWORLD_ITEM_PLAYER_ID : BNE +
@@ -129,54 +125,60 @@ RTL
RTL
;--------------------------------------------------------------------------------
HeartUpgradeSpawnDecision: ; this should return #$00 to make the hp spawn
LDA !FORCE_HEART_SPAWN : BEQ .normal_behavior
LDA.l !FORCE_HEART_SPAWN : BEQ .bonk_prize_check
DEC : STA !FORCE_HEART_SPAWN
LDA #$00
LDA.b #$00 : STA.l !FORCE_HEART_SPAWN
RTL
.bonk_prize_check
PHX
LDA.b 5,S : TAX : LDA.w $0ED0, X : BEQ .normal_behavior-1
PLX
LDA.b #$00
RTL
PLX
.normal_behavior
LDA OverworldEventDataWRAM, X
LDA.l OverworldEventDataWRAM, X
RTL
;--------------------------------------------------------------------------------
SaveHeartCollectedStatus:
LDA !SKIP_HEART_SAVE : BEQ .normal_behavior
LDA !SKIP_HEART_SAVE : BEQ .save_flag
DEC : STA !SKIP_HEART_SAVE
LDA #$00 : STA !SKIP_HEART_SAVE
RTL
.save_flag
LDA 4,S : TAY : LDA $0ED0,Y : BEQ .normal_behavior
PHA
LDA OverworldEventDataWRAM, X : ORA 1,S : STA OverworldEventDataWRAM, X
PLA
RTL
.normal_behavior
LDA OverworldEventDataWRAM, X : ORA.b #$40 : STA OverworldEventDataWRAM, X
RTL
;--------------------------------------------------------------------------------
!REDRAW = "$7F5000"
HeartPieceSpritePrep:
PHA
LDA ServerRequestMode : BEQ + : : +
LDA #$01 : STA !REDRAW
LDA $5D : CMP #$14 : BEQ .skip ; skip if we're mid-mirror
LDA #$00 : STA !REDRAW
LDA.b #$01 : STA.w !SPRITE_REDRAW, X
JSL.l HeartPieceGetPlayer : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
JSL.l LoadHeartPieceRoomValue ; load item type
STA $0E80, X ; Store item type
JSL.l PrepDynamicTile
JSL.l RequestSlottedTile
.skip
PLA
RTL
;--------------------------------------------------------------------------------
!REDRAW = "$7F5000"
HeartContainerSpritePrep:
PHA
LDA #$00 : STA !REDRAW
JSL.l HeartPieceGetPlayer : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
JSL.l LoadHeartContainerRoomValue ; load item type
STA $0E80, X ; Store item type
JSL.l PrepDynamicTile
JSL.l RequestSlottedTile
PLA
RTL
@@ -191,7 +193,8 @@ LoadHeartPieceRoomValue:
.done
RTL
;--------------------------------------------------------------------------------
!REDRAW = "$7F5000"
!DynamicDropGFXSlotCount_UW = (FreeUWGraphics_end-FreeUWGraphics)>>1
!DynamicDropGFXSlotCount_OW = (FreeOWGraphics_end-FreeOWGraphics)>>1
HPItemReset:
PHA
LDA !MULTIWORLD_ITEM_PLAYER_ID : BNE .skip
@@ -201,7 +204,14 @@ HPItemReset:
.skip
PLA
.done
PHA : LDA #$01 : STA !REDRAW : PLA
PHA : PHY
LDY.b #$0F
- LDA.w $0DD0,Y : BEQ +
LDA.w !SPRITE_REDRAW, Y : CMP.b #$02 : BNE +
; attempt redraw of any sprite using the overflow slot
LDA.b #$01 : STA.w !SPRITE_REDRAW, Y
+ DEY : BPL -
PLY : PLA
RTL
;--------------------------------------------------------------------------------
MaybeMarkDigSpotCollected:
@@ -215,6 +225,13 @@ MaybeMarkDigSpotCollected:
PLP : PLA
RTL
;--------------------------------------------------------------------------------
HeartPieceSpawnDelayFix:
JSL Sprite_DrawRippleIfInWater
; Fix the delay when spawning a HeartPiece sprite
JSL.l Sprite_CheckIfPlayerPreoccupied : BCS + ; what we moved from $05F037
JSL.l Sprite_CheckDamageToPlayerSameLayerLong : RTL ; what we wrote over
+ CLC : RTL
;--------------------------------------------------------------------------------
macro GetPossiblyEncryptedItem(ItemLabel,TableLabel)
LDA IsEncrypted : BNE ?encrypted
LDA.l <ItemLabel>
@@ -229,7 +246,7 @@ macro GetPossiblyEncryptedItem(ItemLabel,TableLabel)
LDA.w #<ItemLabel>-<TableLabel>
JSL RetrieveValueFromEncryptedTable
PLX : STX $02 : PLX : STX $01
PLX : STX $02 : PLX : STX $00
PLP : PLX
?done:
endmacro
@@ -255,6 +272,9 @@ LoadIndoorValue:
++
%GetPossiblyEncryptedItem(HeartPiece_Graveyard_Warp, HeartPieceIndoorValues)
JMP .done
+ CMP.w #288 : BNE +
LDA.l UWBonkPrizeData+3
JMP .done
+ CMP.w #294 : BNE +
%GetPossiblyEncryptedItem(HeartPiece_Mire_Warp, HeartPieceIndoorValues)
JMP .done
@@ -283,7 +303,10 @@ LoadOutdoorValue:
PHP
REP #$20 ; set 16-bit accumulator
LDA $8A
CMP.w #$03 : BNE +
CMP.w #$00 : BNE +
LDA.l OWBonkPrizeTable[$00].loot
JMP .done
+ CMP.w #$03 : BNE +
LDA $22 : CMP.w #1890 : !BLT ++
%GetPossiblyEncryptedItem(HeartPiece_Spectacle, HeartPieceOutdoorValues)
JMP .done
@@ -291,14 +314,92 @@ LoadOutdoorValue:
%GetPossiblyEncryptedItem(EtherItem, SpriteItemValues)
JMP .done
+ CMP.w #$05 : BNE +
%GetPossiblyEncryptedItem(HeartPiece_Mountain_Warp, HeartPieceOutdoorValues)
LDA.w $0ED0,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 $0ED0,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 $0ED0,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 $0ED0,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 $0ED0,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 $0ED0,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 $0ED0,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
+ CMP.w #$28 : BNE +
%GetPossiblyEncryptedItem(HeartPiece_Maze, HeartPieceOutdoorValues)
JMP .done
+ CMP.w #$2A : BNE +
%GetPossiblyEncryptedItem(HauntedGroveItem, HeartPieceOutdoorValues)
LDA.w $0ED0,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
+ CMP.w #$2E : BNE +
LDA.w $0ED0,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 +
LDA $22 : CMP.w #512 : !BGE ++
%GetPossiblyEncryptedItem(HeartPiece_Desert, HeartPieceOutdoorValues)
@@ -306,6 +407,13 @@ LoadOutdoorValue:
++
%GetPossiblyEncryptedItem(BombosItem, SpriteItemValues)
JMP .done
+ CMP.w #$32 : BNE +
LDA.w $0ED0,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 +
%GetPossiblyEncryptedItem(HeartPiece_Lake, HeartPieceOutdoorValues)
JMP .done
@@ -313,17 +421,68 @@ LoadOutdoorValue:
%GetPossiblyEncryptedItem(HeartPiece_Swamp, HeartPieceOutdoorValues)
JMP .done
+ CMP.w #$42 : BNE +
%GetPossiblyEncryptedItem(HeartPiece_Cliffside, HeartPieceOutdoorValues)
JMP .done
LDA.w $0ED0,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$1A].loot
JMP .done
++
%GetPossiblyEncryptedItem(HeartPiece_Cliffside, HeartPieceOutdoorValues)
JMP .done
+ CMP.w #$4A : BNE +
%GetPossiblyEncryptedItem(HeartPiece_Cliffside, HeartPieceOutdoorValues)
JMP .done
+ CMP.w #$51 : BNE +
LDA.w $0ED0,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 $0ED0,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 $0ED0,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 +
%GetPossiblyEncryptedItem(HeartPiece_Pyramid, HeartPieceOutdoorValues)
LDA.w $0ED0,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
+ CMP.w #$68 : BNE +
%GetPossiblyEncryptedItem(HeartPiece_Digging, HeartPieceOutdoorValues)
JMP .done
+ CMP.w #$6E : BNE +
LDA.w $0ED0,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 +
%GetPossiblyEncryptedItem(HeartPiece_Zora, HeartPieceOutdoorValues)
JMP .done
@@ -489,6 +648,9 @@ HeartPieceGetPlayer:
++
LDA HeartPiece_Graveyard_Warp_Player
BRL .done
+ CMP.w #288 : BNE +
LDA.l OWBonkPrizeTable[$2A].mw_player
BRL .done
+ CMP.w #294 : BNE +
LDA HeartPiece_Mire_Warp_Player
BRL .done
@@ -502,7 +664,10 @@ HeartPieceGetPlayer:
PHP
REP #$20 ; set 16-bit accumulator
LDA $8A
CMP.w #$03 : BNE +
CMP.w #$00 : BNE +
LDA.l OWBonkPrizeTable[$00].mw_player
BRL .done
+ CMP.w #$03 : BNE +
LDA $22 : CMP.w #1890 : !BLT ++
LDA HeartPiece_Spectacle_Player
BRL .done
@@ -510,14 +675,92 @@ HeartPieceGetPlayer:
LDA EtherItem_Player
BRL .done
+ CMP.w #$05 : BNE +
LDA HeartPiece_Mountain_Warp_Player
LDA.w $0ED0,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$01].mw_player
BRL .done
++
LDA HeartPiece_Mountain_Warp_Player
BRL .done
+ CMP.w #$0A : BNE +
LDA.w $0ED0,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 $0ED0,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 $0ED0,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 $0ED0,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 $0ED0,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 $0ED0,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
+ CMP.w #$28 : BNE +
LDA HeartPiece_Maze_Player
BRL .done
+ CMP.w #$2A : BNE +
LDA HauntedGroveItem_Player
LDA.w $0ED0,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 HauntedGroveItem_Player
BRL .done
+ CMP.w #$2B : BNE +
LDA.l OWBonkPrizeTable[$16].mw_player
BRL .done
+ CMP.w #$2E : BNE +
LDA.w $0ED0,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 +
LDA $22 : CMP.w #512 : !BGE ++
LDA HeartPiece_Desert_Player
@@ -525,6 +768,13 @@ HeartPieceGetPlayer:
++
LDA BombosItem_Player
BRL .done
+ CMP.w #$32 : BNE +
LDA.w $0ED0,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 +
LDA HeartPiece_Lake_Player
BRL .done
@@ -532,17 +782,68 @@ HeartPieceGetPlayer:
LDA HeartPiece_Swamp_Player
BRL .done
+ CMP.w #$42 : BNE +
LDA HeartPiece_Cliffside_Player
BRL .done
LDA.w $0ED0,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$1B].mw_player
BRL .done
++
LDA HeartPiece_Cliffside_Player
BRL .done
+ CMP.w #$4A : BNE +
LDA HeartPiece_Cliffside_Player
BRL .done
+ CMP.w #$51 : BNE +
LDA.w $0ED0,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 $0ED0,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 $0ED0,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 +
LDA HeartPiece_Pyramid_Player
LDA.w $0ED0,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$24].mw_player
BRL .done
++
LDA HeartPiece_Pyramid_Player
BRL .done
+ CMP.w #$5E : BNE +
LDA.l OWBonkPrizeTable[$25].mw_player
BRL .done
+ CMP.w #$68 : BNE +
LDA HeartPiece_Digging_Player
BRL .done
+ CMP.w #$6E : BNE +
LDA.w $0ED0,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 +
LDA HeartPiece_Zora_Player
BRL .done
@@ -555,3 +856,37 @@ HeartPieceGetPlayer:
PLY
RTL
}
;--------------------------------------------------------------------------------
HeartPieceSetRedraw:
PHY
LDY.b #$0F
.next
LDA.w $0DD0,Y : BEQ ++
LDA.w $0E20,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 !SPRITE_REDRAW,Y
++ DEY : BPL .next
PLY
RTL
HeartPieceGetRedraw:
PHY
LDY.b #$0F
.next
LDA.w $0DD0,Y : BEQ ++
LDA.w $0E20,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 !SPRITE_REDRAW,Y : BEQ ++
PLY : SEC : RTL
++ DEY : BPL .next
PLY
CLC : RTL

338
hooks.asm
View File

@@ -36,6 +36,9 @@ org $00821B ; <- 21B - Bank00.asm : 329 (LDA $13 : STA $2100)
JML.l PostNMIHookAction : NOP
PostNMIHookReturn:
;--------------------------------------------------------------------------------
org $008F6C
JSL PostNMIUpdateBGCharHalf : NOP
;--------------------------------------------------------------------------------
;================================================================================
; Anti-ZSNES Hook
@@ -393,9 +396,6 @@ JSL.l LoadBombCount
org $098133 ; <- 48133 - ancilla_init.asm : 211 (STA $7EF343 : BNE .bombs_left_over)
JSL.l StoreBombCount
;--------------------------------------------------------------------------------
org $0DE4BF ; <- 6E4BF - equipment.asm : 1249 (LDA $7EF343 : AND.w #$00FF : BEQ .gotNoBombs)
JSL.l LoadBombCount16
;--------------------------------------------------------------------------------
org $0DDEB3 ; <- 6DEB3 - equipment.asm : 328 (LDA $7EF33F, X)
JSL.l IsItemAvailable
;--------------------------------------------------------------------------------
@@ -453,8 +453,12 @@ org $02EC8D ; <- bank02.asm : 11981 (LDA.w #$020F : LDX $8A : CPX.w #$0033 : BNE
JSL HardcodedRocks
NOP #19 ;23 bytes removed with the JSL
;--------------------------------------------------------------------------------
org $04E7AE ; <- bank0E.asm : 4230 (LDA $7EF287 : AND.w #$0020)
JSL.l TurtleRockPegSolved
;org $04E7AE ; <- bank0E.asm : 4230 (LDA $7EF287 : AND.w #$0020)
;JSL.l TurtleRockPegSolved
;--------------------------------------------------------------------------------
org $1BCAA1 ; <- bank_1B.asm (LDA.w #$0212 : LDX.w #$0720 : STA.l $7E2000,X : JSL : JSL)
JSL.l Overworld_InvertedTRPuzzle
BRA + : NOP #12 : +
org $04E7B9 ; <- bank0E.asm : 4237 (LDX $04C8)
JMP.w TurtleRockTrollPegs
@@ -471,9 +475,9 @@ PegProbability:
db $00 ; Probability out of 255. 0 = Vanilla behavior
TurtleRockTrollPegs:
SEP #$20
LDX.w $04C8 : CPX.w #$FFFF : BEQ .vanilla
JSL.l GetRandomInt
LDA.l PegProbability : BEQ .vanilla : CMP.l $7E0FA1
LDX.w $04C8 : CPX.w #$FFFF : BEQ .vanilla
JSL.l GetRandomInt
LDA.l PegProbability : BEQ .vanilla : CMP.l $7E0FA1
REP #$20 : !BGE .succeed
.fail
JMP.w TurtleRockPegFail
@@ -975,6 +979,9 @@ JSL.l ChestPrep
NOP #3
db $90 ; !BCC .cantOpen
;--------------------------------------------------------------------------------
org $008A9D
JSL ConditionalPushBlockTransfer : NOP
org $00D531 ; 5531 - Bank00.asm:3451 (LDY.b #$5D)
JML.l GetAnimatedSpriteGfxFile
@@ -985,9 +992,15 @@ org $00D557 ; 5557 - Bank00.asm:3486 (LDA $00 : ADC $D469, X)
JSL.l GetAnimatedSpriteBufferPointer
NOP
org $05FA50
JSL Sprite_ConditionalPrepOAMCoord
org $0799F7 ; 399F7 - Bank07.asm:4107 (JSL AddReceivedItem)
JSL.l AddReceivedItemExpanded
org $08C505
JSL Ancilla22_ItemReceipt_ContinueB : NOP #2
org $098605 ; 48605 - ancilla_init.asm:709 (TYA : STA $02E4 : PHX)
JML.l Multiworld_AddReceivedItem_notCrystal
NOP
@@ -1065,6 +1078,10 @@ JSL HandleBombAbsorbtion
;org $09873F ; <- 04873F - ancilla_init.asm : 960 (ADC [$00] : STA [$00] )
;JSL.l AddToStock
;--------------------------------------------------------------------------------
org $02EB18
JSL PostOverworldGfxLoad
org $18BD55
JSL PostUnderworldMap
;================================================================================
; Kholdstare Shell Fix
@@ -1320,7 +1337,7 @@ NOP #5
;--------------------------------------------------------------------------------
org $05EE5F ; <- 2EE5F - sprite_mushroom.asm : 30
JSL.l LoadMushroom
NOP
BRA + : NOP #7 : +
;--------------------------------------------------------------------------------
org $05EE78 ; <- 2EE78 - sprite_mushroom.asm : 58
JSL.l DrawMushroom
@@ -1367,6 +1384,8 @@ org $07A303 ; 3A303 - Bank07.asm : 5622
org $07A3A2 ; 3A3A2 - Bank07.asm : 5720 - JSL DiggingGameGuy_AttemptPrizeSpawn
JSL.l SpawnShovelItem
BRA _Bank07_5726
org $1DFDAC
JSL.l SpawnShovelGamePrize
org $07A3AB ; 3A3AB - Bank07.asm : 5726 - LDA.b #$12 : JSR Player_DoSfx2
_Bank07_5726:
;org $07A381 ; 3A381 - Bank07.asm : 5693 - ORA $035B
@@ -1712,7 +1731,6 @@ dw !REG_MUSIC_CONTROL
org $0CF05F
dw !REG_MUSIC_CONTROL
;--------------------------------------------------------------------------------
;================================================================================
@@ -1943,15 +1961,14 @@ NOP #8
;org $0AC012 ; <- 54012 - Bank0A.asm:1039 - (LDA $7EF2DB)
;JSL.l OnLoadMap
;================================================================================
org $028B8F ; <- 10B8F - Bank02.asm:2236 (LDA $7EF374 : LSR A : BCS BRANCH_BETA)
JSL CheckHeraBossDefeated : BNE + : NOP
LDX.b #$F1 : STX $012C
+
org $028B8F ; <- 10B8F - Bank02.asm:2236 (LDA $7EF374 : LSR A)
JSL CheckHeraBossDefeated : NOP
;================================================================================
org $029090 ; <- 11090 - Bank02.asm:3099 (LDA $7EF374 : LSR A : BCS BRANCH_GAMMA)
JSL CheckHeraBossDefeated : BNE + : NOP
STX $012C ; DON'T MOVE THIS FORWARD OR MADNESS AWAITS
+
org $028D6E
JSL FallingMusicFadeOut : BRA + : NOP #2 : +
;================================================================================
org $029090 ; <- 11090 - Bank02.asm:3099 (LDA $7EF374 : LSR A)
JSL CheckHeraBossDefeated : NOP
;================================================================================
org $029798 ; <- 11798 - Bank02.asm:4287 (CMP $02895C, X : BNE BRANCH_ALPHA)
NOP #6 ; remove crystal room cutscene check that causes softlocks
@@ -2122,6 +2139,9 @@ PHB : JSL.l DarkWorldSaveFix
org $028046 ; <- 10046 - Bank02.asm : 217 (JSL EnableForceBlank) (Start of Module_LoadFile)
JSL.l OnFileLoad
;--------------------------------------------------------------------------------
org $0280A2
JSL GetCurrentWorldForLoad
;--------------------------------------------------------------------------------
org $09F520 ; <- 4F520 - module_death.asm : 401 (LDA $7EF3C5 : CMP.b #$03 : BCS BRANCH_THETA)
JSL.l OnPlayerDead
JSL.l IncrementDeathCounter
@@ -2318,6 +2338,12 @@ AddReceivedItem_doneWithSoundEffects:
org $05F030 ; <- 2F030 - display item
JSL.l DrawHeartPieceGFX
;--------------------------------------------------------------------------------
; moving LinkBusy check to later time to avoid a delay in HP movement
org $05F037 ; (JSL CheckIfLinkIsBusy : BCS .exit)
BRA + : NOP #4 : +
org $05F083
JSL.l HeartPieceSpawnDelayFix
;--------------------------------------------------------------------------------
org $05F08A ; <- 2F08A - sprite_heart_upgrades.asm : 324 - (LDA $7EF36B : INC A : AND.b #$03 : STA $7EF36B : BNE .got_4_piecese) item determination
JSL.l HeartPieceGet
BCS $18 ; reinsert the near branch that appears midway through what we overrode
@@ -2356,18 +2382,20 @@ JSL.l OnLinkDamagedFromPit
org $01FFE7 ; <- FFE7 - Bank01.asm:16375 (LDA $7EF36D)
JSL.l OnLinkDamagedFromPitOutdoors
;--------------------------------------------------------------------------------
org $078F27 ; <- 38F27
JSL.l FlipperReset
;org $078F27 ; <- 38F27
;JSL.l FlipperReset
;--------------------------------------------------------------------------------
org $02B468
dw FakeFlipperProtection
dw FakeFlipperProtection
org $02FFC7
FakeFlipperProtection:
JSR.w $029485
JSL protectff
RTS
;--------------------------------------------------------------------------------
org $02B46C ; <- bank_02.asm:9722 (STZ.b $00 : STZ.b $02)
JSL FlipperScrollWarp
;--------------------------------------------------------------------------------
;org $09F40B ; <- 4F40B - module_death.asm:222 (LDX.b #$00)
;JSL.l IgnoreFairyCheck
@@ -2408,7 +2436,7 @@ JSL.l FreeDuckCheck : BEQ +
+
;================================================================================
org $07A9AC ; <- 3A9AC - Bank07.asm:6628 (LDA $0C : ORA $0E : STA $00 : AND.b #$0C : BEQ BRANCH_BETA)
JML.l MirrorBonk
JML MirrorBonk
MirrorBonk_NormalReturn:
org $07A9D1 ; <- 3A9D1 - Bank07.asm:6649 (BRANCH_GAMMA:)
MirrorBonk_BranchGamma:
@@ -2531,50 +2559,58 @@ JSL Overworld_MosaicDarkWorldChecks : NOP
org $05CC58 ; <- Bank05.asm:1307 (LDA $040A : CMP.b #$18)
JSL PsychoSolder_MusicCheck
NOP #1
;
org $06F96A
JSL PsychoSolder_MusicCheck
NOP #1
;--------------------------------------------------------------------------------
org $02B13A ; <- Bank02.asm:7647
dl Overworld_FinishMirrorWarp
;--------------------------------------------------------------------------------
org $0AB949 ; <- Bank0A.asm:270 (Different from US ROM)
JSL BirdTravel_LoadTargetAreaMusic
NOP #16
BRA + : NOP #14 : +
;--------------------------------------------------------------------------------
org $02B027 ; <- Bank02.asm:7535-7541
JSL Overworld_DetermineMusic
BRA + : NOP #42 : +
;================================================================================
;================================================================================
; Hooks for roomloading.asm
;--------------------------------------------------------------------------------
org $02895D ; <- Bank02.asm:1812 (JSL Dungeon_LoadRoom)
JSL LoadRoomHook
JSL LoadRoomHook
;--------------------------------------------------------------------------------
org $028BE7 ; <- Bank02.asm:2299 (JSL Dungeon_LoadRoom)
JSL LoadRoomHook_noStats
JSL LoadRoomHook_noStats
;--------------------------------------------------------------------------------
org $029309 ; <- Bank02.asm:3533 (JSL Dungeon_LoadRoom)
JSL LoadRoomHook_noStats
JSL LoadRoomHook_noStats
;--------------------------------------------------------------------------------
org $02C2F3 ; <- Bank02.asm:10391 (JSL Dungeon_LoadRoom)
JSL LoadRoomHook_noStats
JSL LoadRoomHook_noStats
;================================================================================
;================================================================================
; Hooks into the "Reloading all graphics" routine
;--------------------------------------------------------------------------------
org $00E64D ; <- Bank00.asm:5656 (STZ $00 : STX $01 : STA $02)
JML BgGraphicsLoading
BgGraphicsLoadingCancel:
RTS : NOP
BgGraphicsLoadingResume:
JML BgGraphicsLoading
BgGraphicsLoadingCancel:
RTS : NOP
BgGraphicsLoadingResume:
;================================================================================
;================================================================================
; Hook when updating the floor tileset in dungeons (such as between floors)
;--------------------------------------------------------------------------------
org $00DF62 ; <- Bank00.asm:4672 (LDX.w #$0000 : LDY.w #$0040)
JML ReloadingFloors
NOP : NOP
ReloadingFloorsResume:
JML ReloadingFloors
NOP : NOP
ReloadingFloorsResume:
org $00DF6E ; <- A few instructions later, right after JSR Do3To.high16Bit
ReloadingFloorsCancel:
ReloadingFloorsCancel:
;================================================================================
;================================================================================
@@ -2694,8 +2730,8 @@ JSL NewElderCode
;--------------------------------------------------------------------------------
; Add him to Castle Map post-rain, and post aga1
;--------------------------------------------------------------------------------
org $09D0AC
db #$18, #$0F, #$43, #$FF;remove heart from tree adjancent map [LW1]
org $09D0A9
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
org $09C937
db #$B0, #$D0 ;change [LW1] map 01C pointers
@@ -2860,6 +2896,176 @@ org $0AEEF2
org $008BE5 ; hijack stripes for boss GFX transfer
JSL DoDungeonMapBossIcon
;================================================================================
; Terrorpin AI fix
;--------------------------------------------------------------------------------
org $1EB2B1 ; sprite_terrorpin.asm(57) : AND.b #$03 : STA $0DE0, X ; 5 bytes
JSL FixTerrorpin ; 4 bytes
NOP ; 1 byte
;--------------------------------------------------------------------------------
;================================================================================
; Bomb-Only Mode
;--------------------------------------------------------------------------------
org $06ECC3 ; Bank06.asm@4704 (PHX : TAX : LDA.l .damage_classes, X : PLX)
JSL DamageClassCalc
BRA + : NOP #29 : +
;--------------------------------------------------------------------------------
org $0882D4 ; Bank08.asm@445 (PHX : TYX : ... )
JSL Utility_CheckAncillaOverlapWithSprite
BRA + : NOP #5 : +
;--------------------------------------------------------------------------------
org $088DB1 ; Bank08.asm@1207 (PHY : PHX : TYX : ... )
JSL Utility_CheckAncillaOverlapWithSprite
BRA + : NOP #7 : +
;--------------------------------------------------------------------------------
org $08E252 ; Bank08.asm@1770 (PHY : PHX : TYX : ... )
JSL Utility_CheckAncillaOverlapWithSprite
BRA + : NOP #7 : +
;--------------------------------------------------------------------------------
org $0882E8 ; Bank08.asm@456 (LDA $0DB0, Y : CMP.b #$03)
JSL Utility_CheckHelmasaurKingCollision
NOP
;--------------------------------------------------------------------------------
org $06ED94 ; Bank06.asm@4866 (LDA $0E60, X : AND.b #$40)
JSL Utility_CheckImpervious
NOP
;--------------------------------------------------------------------------------
org $068F94 ; sprite_prep.asm@1984 (INC $0BA0, X : JSL Sprite_InitializedSegmented)
JSL AllowBombingMoldorm
BRA + : NOP : +
;--------------------------------------------------------------------------------
org $06892F ; sprite_prep.asm@548 (LDA $0D00, X : SUB #$0C : STA $0D00, X : ...)
JSL AllowBombingBarrier
RTS : NOP #7
;--------------------------------------------------------------------------------
org $0DE4BF ; equipment.asm@1247 (LDA $7EF343 : AND.w #$00FF : BEQ .gotNoBombs : ...)
JSL DrawBombInMenu
BRA + : NOP #13 : +
;--------------------------------------------------------------------------------
org $0DFB6A ; headsup_display@727 (CPX #$0004 : BNE .bombsNotEquipped : LDA #$0001)
JSL DrawBombInYBox
BRA + : NOP #2 : +
;--------------------------------------------------------------------------------
org $0DEE05 ; equipment.asm@2065 (LDA $7EF359 : AND.w #$00FF : CMP.w #$00FF : ...)
JSL DrawSwordInMenu
BRA + : NOP #16 : +
;--------------------------------------------------------------------------------
org $0DFA92 ; headsup_display.asm@622 (PDB : LDA.w #$0149 : ...)
JSL DrawBombOnHud
BRA + : NOP #8 : +
;--------------------------------------------------------------------------------
org $089EF8 ; ancilla_bomb@1438 (LDA.w #$04 : STA $0B)
JSL SetBombSpriteColor
;--------------------------------------------------------------------------------
; bomb icons with numbers
org $0DFC51 ; we freed this up earlier in hooks; probably shouldn't use it but *shrug*
db $F5, $20, $F5, $20, $F5, $20, $F5, $20
db $B2, $3C, $B3, $3C, $C2, $3C, $17, $3C
db $B2, $2C, $B3, $2C, $C2, $2C, $18, $2C
db $B2, $24, $B3, $24, $C2, $24, $19, $24
db $B2, $28, $B3, $28, $C2, $28, $1A, $28
db $B2, $28, $B3, $28, $C2, $28, $1B, $28
; bomb icons without numbers
; $0DFC81
db $F5, $20, $F5, $20, $F5, $20, $F5, $20
db $B2, $3C, $B3, $3C, $C2, $3C, $C2, $7C
db $B2, $2C, $B3, $2C, $C2, $2C, $C2, $6C
db $B2, $24, $B3, $24, $C2, $24, $C2, $64
db $B2, $28, $B3, $28, $C2, $28, $C2, $68
db $B2, $28, $B3, $28, $C2, $28, $C2, $68
warnpc $0DFC51+197 ; we only filled in 197 NOPs so don't overwrite past that
;--------------------------------------------------------------------------------
org $1EDCF8 ; bank_1E.asm@16086 (LDX $0202 : ...)
JSL SetBeeType
BRA + : NOP #15 : +
;--------------------------------------------------------------------------------
org $1EB5E8 ; bank_1E.asm@9387 (LDA #$03 : STA $0D80, X)
JSL ArrghusBoing
;--------------------------------------------------------------------------------
org $1EDFAF ; bank_1E.asm@16607 (.next_sprite)
JSL BeeCheckTarget
BCS .bee_valid_target
BRA .bee_unsuitable_target
NOP #48
.bee_unsuitable_target
skip 11
.bee_valid_target
;--------------------------------------------------------------------------------
org $07F889 ; free rom from F877 - F88F; the starting part of this is used in quadrant glitch fix in overworld fork, however.
Link_UseItemLong:
PER .done-1
JMP.w ($0000)
.done
RTL
warnpc $07F890
;--------------------------------------------------------------------------------
org $06F2DC ; bank_06.asm@22763 (LDA.w $037A : AND.b #$10)
JSL CheckBugNet : NOP
org $06EB91 ; bank_06.asm@21178 (LDA.w $037A : AND.b #$10)
JSL CheckBugNet : NOP
;--------------------------------------------------------------------------------
org $06ED77 ; bank_06.asm@21597 (LDA.w $0301 : AND.b #$0A : ...)
JSL SetHammerClass
BRA + : NOP #7 : +
;--------------------------------------------------------------------------------
;================================================================================
; Variable Ganon Vulnerability
;--------------------------------------------------------------------------------
org $08BBD4 ; 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 $0DD676 ; Bank0D.asm@1303 (TYX : JSL Ancilla_CheckSpriteDamage.preset_class)
JSL Ganon_CheckBeeVulnerability
NOP
;--------------------------------------------------------------------------------
;================================================================================
; Pseudo-Sword Mode
;--------------------------------------------------------------------------------
org $06ED70 ; Bank06.asm@4842 (LDA $06ED39, X : STA $0CF2)
JSL StoreSwordDamage
;================================================================================
; Item-On-B
;--------------------------------------------------------------------------------
org $0DEB3C
JSL DrawBIndicator : BRA + : NOP #3 : +
;--------------------------------------------------------------------------------
org $079CE6 ; Bank07.asm@4632 (LDA #$80 : TSB $3A : ...)
JSL UseItem
BCC + : RTS : +
JSR $9C56
NOP #1
;--------------------------------------------------------------------------------
;================================================================================
; Fix quadrant glitch
org $07A879
JSR SwordSpinQuadrantFix
org $07F877 ; free rom
SwordSpinQuadrantFix:
LDA.l AllowAccidentalMajorGlitch
BEQ ++
JMP.w $07E8D9 ; HandleIndoorCameraAndDoors
++ RTS
warnpc $07F88C ; hammer-on-B hook uses the end of this free rom section
;================================================================================
org $01C4B8 : JSL FixJingleGlitch
@@ -2875,43 +3081,37 @@ org $028818
org $02A463
JSL OnMenuLoad
;================================================================================
; Terrorpin AI fix
;--------------------------------------------------------------------------------
org $1EB2B1 ; sprite_terrorpin.asm(57) : AND.b #$03 : STA $0DE0, X ; 5 bytes
JSL FixTerrorpin ; 4 bytes
NOP ; 1 byte
;--------------------------------------------------------------------------------
; Text Renderer
;--------------------------------------------------------------------------------
if !FEATURE_NEW_TEXT
org $0EF51B
JML RenderCharExtended
org $0EF520
RenderCharExtended_returnOriginal:
org $0EF567
RenderCharExtended_returnUncompressed:
org $0EF51B
JML RenderCharExtended
org $0EF520
RenderCharExtended_returnOriginal:
org $0EF567
RenderCharExtended_returnUncompressed:
org $0EF356
JSL RenderCharLookupWidth
org $0EF3BA
JSL RenderCharLookupWidth
org $0EF48E
JML RenderCharLookupWidthDraw
org $0EF499
RenderCharLookupWidthDraw_return:
org $0EF356
JSL RenderCharLookupWidth
org $0EF3BA
JSL RenderCharLookupWidth
org $0EF48E
JML RenderCharLookupWidthDraw
org $0EF499
RenderCharLookupWidthDraw_return:
org $0EF6AA
JML RenderCharToMapExtended
org $0EF6C2
RenderCharToMapExtended_return:
org $0EF6AA
JML RenderCharToMapExtended
org $0EF6C2
RenderCharToMapExtended_return:
org $0EFA50
JSL RenderCharSetColorExtended
org $0EEE5D
JSL RenderCharSetColorExtended_init
org $0EF285
JSL RenderCharSetColorExtended_close : NOP
org $0EFA50
JSL RenderCharSetColorExtended
org $0EEE5D
JSL RenderCharSetColorExtended_init
org $0EF285
JSL RenderCharSetColorExtended_close : NOP
endif
;--------------------------------------------------------------------------------
; Back of tavern fixes
@@ -2931,4 +3131,4 @@ JSL CheckStairsAdjustment
NOP
org $02D7D2 ; BEQ .face_up
NOP #2 ; this fixes Link's direction after mirroring and falling after entering through back of tavern
NOP #2 ; this fixes Link's direction after mirroring and falling after entering through back of tavern

View File

@@ -10,6 +10,7 @@ Init_Primary:
LDX #$00 ; initalize our ram
-
STA $7EC025, X
STA $7EC035, X
STA $7F5000, X
INX
CPX #$10 : !BLT -

View File

@@ -30,9 +30,10 @@
ProcessMenuButtons:
;LDA #$FD : STA InventoryTracking ; DEBUG MODE
;LDA $F6 : BIT #$20 : BNE .l_pressed ; check for P1 L-button
LDA $F4 : BIT #$40 : BNE .y_pressed ; check for P1 Y-button
BIT #$20 : BNE .sel_pressed ; check for P1 Select button
LDA $F0 : BIT #$20 : BNE .sel_held
LDA.b $F4 : BIT.b #$40 : BNE .y_pressed ; check for P1 Y-button
BIT.b #$20 : BNE .sel_pressed ; check for P1 Select button
BIT.b #$80 : BNE .b_pressed ; check for P1 B-button
LDA.b $F0 : BIT.b #$20 : BNE .sel_held
.sel_unheld
LDA HudFlag : AND #$20 : BEQ +
LDA HudFlag : AND #$DF : STA HudFlag ; select is released, unset hud flag
@@ -48,6 +49,18 @@ RTL
LDA HudFlag : ORA #$20 : STA HudFlag ; set hud flag
LDA.b #$20 : STA $012F ; menu select sound
JSL.l ResetEquipment
RTL
.b_pressed
JSR CanPressB : BCC .b_error
LDA.w $0202 : CMP.l ItemOnB : BNE .set_b
LDA.b #$00
.set_b
STA.l ItemOnB
BRA .b_done
.b_error
LDA.b #$3C : STA.w $012E ; error sound
.b_done
SEC
RTL
.y_pressed ; Note: used as entry point by quickswap code. Must preserve X.
LDA.b #$10 : STA $0207
@@ -115,6 +128,27 @@ RTL
SEC
RTL
;--------------------------------------------------------------------------------
CanPressB:
PHY : PHP : SEP #$30
LDA.l AllowedItemOnB : BEQ .no
CMP.b #$FF : BEQ .skip_allow_check
CMP.w $0202 : BNE .no
.skip_allow_check
PHX
LDA.w $0202 : TAX
LDA.l ValidItemOnB, X : BNE .plx_and_no
PLX
PLP : PLY
SEC
RTS
.plx_and_no
PLX
.no
PLP : PLY
CLC
RTS
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
;ProcessBottleMenu:
@@ -146,7 +180,7 @@ RTL
OpenBottleMenu:
LDA $F6 : AND #$40 : BEQ .x_not_pressed ; skip if X is not down
LDA.b #$10 : STA $0207 ; set 16 frame cool off
LDA.b #$20 : STA $012F ; make menu sound
LDA.b #$20 : STA $012F ; make menu sound
LDA.b #$07 : STA $0200 ; thing we wrote over - opens bottle menu
.x_not_pressed
RTL
@@ -159,10 +193,10 @@ CloseBottleMenu:
LDA $F6 : AND #$40 : BEQ .x_not_pressed ; skip if X is not down
LDA.b #$10 : STA $0207 ; set 16 frame cool off
LDA.b #$20 : STA $012F ; make menu sound
LDA.b #$20 : STA $012F ; make menu sound
INC $0200 ; return to normal menu
STZ $0205
STZ $0205
LDA #$00
RTL
@@ -337,9 +371,9 @@ AddInventory:
LDA PreMirrorLocations : INC : STA PreMirrorLocations ; Increment Pre Mirror Counter
SEP #$20
+
LDA FluteEquipment : BNE + ; Check for Mirror
LDA FluteEquipment : BNE + ; Check for Flute
REP #$20
LDA PreFluteLocations : INC : STA PreFluteLocations ; Increment Pre Mirror Counter
LDA PreFluteLocations : INC : STA PreFluteLocations ; Increment Pre Flute Counter
SEP #$20
+
REP #$20
@@ -354,32 +388,32 @@ AddInventory:
+
CPY.b #$00 : BNE + ; Fighter's Sword & Fighter's Shield
LDX #$01
LDX #$01
JSR .incrementSword
JSR .incrementShield
JMP .done
+ CPY.b #$01 : BNE + ; Master Sword
LDX #$02
LDX #$02
JSR .incrementSword
JMP .done
+ CPY.b #$02 : BNE + ; Tempered Sword
LDX #$03
LDX #$03
JSR .incrementSword
JMP .done
+ CPY.b #$03 : BNE + ; Golden Sword
LDX #$04
LDX #$04
JSR .incrementSword
JMP .done
+ CPY.b #$04 : BNE + ; Fighter's Shield
LDX #$01
LDX #$01
JSR .incrementShield
JMP .done
+ CPY.b #$05 : BNE + ; Red Shield
LDX #$02
LDX #$02
JSR .incrementShield
JMP .done
+ CPY.b #$06 : BNE + ; Mirror Shield
LDX #$03
LDX #$03
JSR .incrementShield
JMP .done
+ CPY.b #$07 : !BLT + ; Items $07 - $0D
@@ -420,16 +454,16 @@ AddInventory:
JSR .incrementY
JMP .done
+ CPY.b #$22 : BNE + ; Blue Mail
LDX #$01
JSR .incrementMail
LDX #$01
JSR .incrementMail
+ CPY.b #$23 : BNE + ; Red Mail
LDX #$02
JSR .incrementMail
LDX #$02
JSR .incrementMail
+ CPY.b #$24 : BNE + ; Small Key
JSR .incrementKey
JMP .done
+ CPY.b #$25 : BNE + ; Compass
JSL MaybeFlagCompassTotalPickup
JSL MaybeFlagCompassTotalPickup
JSR .incrementCompass
JMP .done
+ CPY.b #$26 : BNE + ; Liar Heart (Container)
@@ -460,7 +494,7 @@ AddInventory:
+ CPY.b #$37 : !BLT + ; Items $37 - $39 - Pendants
CPY.b #$3A : !BGE +
JSR .incrementPendant
JSR .setDungeonCompletion
JSR .setDungeonCompletion
JMP .done
+ CPY.b #$3A : !BLT + ; Items $3A - $3B - Bow & Silver Arrows
CPY.b #$3C : !BGE +
@@ -480,7 +514,7 @@ AddInventory:
JSR .incrementY
JMP .done
+ CPY.b #$49 : BNE + ; Fighter's Sword
LDX #$01
LDX #$01
JSR .incrementSword
JMP .done
+ CPY.b #$4A : BNE + ; Flute (Active)
@@ -500,15 +534,15 @@ AddInventory:
JSR .incrementCapacity
JMP .done
+ CPY.b #$50 : BNE + ; Master Sword (Safe)
LDX #$02
LDX #$02
JSR .incrementSword
JMP .done
+ CPY.b #$51 : BNE + ; 5 Bomb Capacity Upgrade
LDX #$02
LDX #$02
JSR .maybeIncrementBombs
JMP .done
+ CPY.b #$52 : BNE + ; 10 Bomb Capacity Upgrade
LDX #$02
LDX #$02
JSR .maybeIncrementBombs
JMP .done
+ CPY.b #$51 : !BLT + ; Items $51 - $54 - Capacity Upgrades
@@ -519,15 +553,15 @@ AddInventory:
JSR .incrementBow
JMP .done
+ CPY.b #$5E : BNE + ; Progressive Sword
LDA SwordEquipment : INC : TAX
LDA SwordEquipment : INC : TAX
JSR .incrementSword
JMP .done
+ CPY.b #$5F : BNE + ; Progressive Shield
LDA ShieldEquipment : INC : TAX
LDA ShieldEquipment : INC : TAX
JSR .incrementShield
JMP .done
+ CPY.b #$60 : BNE + ; Progressive Armor
LDA ArmorEquipment : INC : TAX
LDA ArmorEquipment : INC : TAX
JSR .incrementMail
JMP .done
+ CPY.b #$61 : BNE + ; Progressive Lifting Glove
@@ -542,18 +576,31 @@ AddInventory:
JSR .incrementMap
JMP .done
+ CPY.b #$80 : !BLT + ; Items $80 - $8F - Free Compasses
; there was a bug for all loot ID's >$7F
LDA.w AddReceivedItemExpanded_item_target_addr+$100, X : STA.b $00
LDA.w AddReceivedItemExpanded_item_target_addr+$101, X : STA.b $01
CPY.b #$90 : !BGE +
JSL MaybeFlagCompassTotalPickup
JSL MaybeFlagCompassTotalPickup
JSR .incrementCompass
JMP .done
BRA .done
+ CPY.b #$90 : !BLT + ; Items $90 - $9F - Free Big Keys
CPY.b #$A0 : !BGE +
JSR .incrementBigKey
JMP .done
BRA .done
+ CPY.b #$A0 : !BLT + ; Items $A0 - $AF - Free Small Keys
CPY.b #$B0 : !BGE +
JSR .incrementKey
JMP .done
BRA .done
+ CPY.b #$C0 : BEQ .special_weapon ; Item $C0 - Bomb Upgrade
CPY.b #$C1 : BEQ .special_weapon ; Item $C1 - Cane Upgrade
CPY.b #$C2 : BEQ .special_weapon ; Item $C2 - Bug Net Upgrade
BRA .done
.special_weapon
JSR .stampSword ; update "first bomb" timestamp
LDA.l SpecialWeaponLevel ; get current bomb level
CMP #$05 : !BGE ++ ; check if already maxed
INC : STA.l SpecialWeaponLevel
++ BRA .done
+
.done
PLP : PLX : PLA
@@ -603,21 +650,21 @@ RTS
.incrementSword
JSR .stampSword
LDA HighestSword
INC : STA $04 : CPX $04 : !BLT + ; don't increment unless we're getting a better sword
TXA : STA HighestSword
+
LDA HighestSword
INC : STA $04 : CPX $04 : !BLT + ; don't increment unless we're getting a better sword
TXA : STA HighestSword
+
RTS
.incrementShield
LDA HighestShield
INC : STA $04 : CPX $04 : !BLT + ; don't increment unless we're getting a better shield
TXA : STA HighestShield
+
LDA HighestShield
INC : STA $04 : CPX $04 : !BLT + ; don't increment unless we're getting a better shield
TXA : STA HighestShield
+
RTS
.incrementBow
LDA BowEquipment : BNE .dontCount ; Don't increment Y item count for extra bows
LDA BowEquipment : BNE .dontCount ; Don't increment Y item count for extra bows
.incrementY
LDA YAItemCounter : !ADD #$08 : STA YAItemCounter
.dontCount
@@ -650,11 +697,10 @@ RTS
RTS
.incrementMail
LDA HighestMail
INC : STA $04 : CPX $04 : !BLT + ; don't increment unless we're getting a better mail
TXA : STA HighestMail
+
LDA HighestMail
INC : STA $04 : CPX $04 : !BLT + ; don't increment unless we're getting a better mail
TXA : STA HighestMail
+
RTS
.incrementKeyLong
@@ -662,7 +708,7 @@ RTS
RTL
.incrementKey
LDA SmallKeyCounter : INC : STA SmallKeyCounter
LDA SmallKeyCounter : INC : STA SmallKeyCounter
RTS
.incrementCompass
@@ -674,7 +720,7 @@ RTS
RTS
.incrementGTowerPreBigKey
LDA PreGTBKLocations : INC : STA PreGTBKLocations
LDA PreGTBKLocations : INC : STA PreGTBKLocations
RTS
.maybeIncrementBombs
@@ -693,10 +739,17 @@ RTS
RTL
.incrementBossSword
LDA SwordEquipment
LDA.l SpecialWeapons : AND.b #$7F : CMP.b #$01 : BEQ +
CMP.b #$03 : BEQ +
CMP.b #$04 : BEQ +
CMP.b #$05 : BEQ +
CMP.b #$08 : BEQ +
LDA SwordEquipment : BRA ++
+ : LDA SpecialWeaponLevel
++
BNE + : -
LDA SwordlessBossKills : INC : STA SwordlessBossKills
RTS
LDA SwordlessBossKills : INC : STA SwordlessBossKills
RTS
+ CMP #$FF : BEQ -
+ CMP #$01 : BNE +
%TopHalf(SwordBossKills) : RTS
@@ -768,6 +821,7 @@ AddYMarker:
+ CMP.w #$10 : BEQ .drawJarMarker
.drawNormal
JSR CanPressB : BCS .drawBBubble
LDA.w #$7C60
BRA .drawTile
@@ -776,12 +830,20 @@ AddYMarker:
LDA $0207 : AND.w #$0020 : BNE .drawXBubble
.drawYBubble
JSR CanPressB : BCC .drawY
LDA.w $0207 : AND.w #$0020 : BNE .drawBBubble
.drawY
LDA.w #$3D4F
BRA .drawTile
.drawXBubble
JSR MakeCircleBlue
LDA.w #$2D3E
BRA .drawTile
.drawBBubble
JSR MakeCircleRed
LDA.w #$293F
.drawTile
STA $FFC4, Y
@@ -793,22 +855,40 @@ RTL
; this is horrible, make it better
;--------------------------------------------------------------------------------
MakeCircleBlue:
LDA $FFC0, Y : AND.w #$EFFF : STA $FFC0, Y
LDA $FFC2, Y : AND.w #$EFFF : STA $FFC2, Y
LDA $FFC0, Y : AND.w #$EFFF : STA $FFC0, Y
LDA $FFC2, Y : AND.w #$EFFF : STA $FFC2, Y
LDA $FFFE, Y : AND.w #$EFFF : STA $FFFE, Y
LDA $0004, Y : AND.w #$EFFF : STA $0004, Y
LDA $FFFE, Y : AND.w #$EFFF : STA $FFFE, Y
LDA $0004, Y : AND.w #$EFFF : STA $0004, Y
LDA $003E, Y : AND.w #$EFFF : STA $003E, Y
LDA $0044, Y : AND.w #$EFFF : STA $0044, Y
LDA $003E, Y : AND.w #$EFFF : STA $003E, Y
LDA $0044, Y : AND.w #$EFFF : STA $0044, Y
LDA $0080, Y : AND.w #$EFFF : STA $0080, Y
LDA $0082, Y : AND.w #$EFFF : STA $0082, Y
LDA $0080, Y : AND.w #$EFFF : STA $0080, Y
LDA $0082, Y : AND.w #$EFFF : STA $0082, Y
LDA $FFBE, Y : AND.w #$EFFF : STA $FFBE, Y
LDA $FFC4, Y : AND.w #$EFFF : STA $FFC4, Y
LDA $0084, Y : AND.w #$EFFF : STA $0084, Y
LDA $007E, Y : AND.w #$EFFF : STA $007E, Y
LDA $FFBE, Y : AND.w #$EFFF : STA $FFBE, Y
LDA $FFC4, Y : AND.w #$EFFF : STA $FFC4, Y
LDA $0084, Y : AND.w #$EFFF : STA $0084, Y
LDA $007E, Y : AND.w #$EFFF : STA $007E, Y
RTS
MakeCircleRed:
LDA.w $FFC0, Y : AND.w #$EBFF : STA.w $FFC0, Y
LDA.w $FFC2, Y : AND.w #$EBFF : STA.w $FFC2, Y
LDA.w $FFFE, Y : AND.w #$EBFF : STA.w $FFFE, Y
LDA.w $0004, Y : AND.w #$EBFF : STA.w $0004, Y
LDA.w $003E, Y : AND.w #$EBFF : STA.w $003E, Y
LDA.w $0044, Y : AND.w #$EBFF : STA.w $0044, Y
LDA.w $0080, Y : AND.w #$EBFF : STA.w $0080, Y
LDA.w $0082, Y : AND.w #$EBFF : STA.w $0082, Y
LDA.w $FFBE, Y : AND.w #$EBFF : STA.w $FFBE, Y
LDA.w $FFC4, Y : AND.w #$EBFF : STA.w $FFC4, Y
LDA.w $0084, Y : AND.w #$EBFF : STA.w $0084, Y
LDA.w $007E, Y : AND.w #$EBFF : STA.w $007E, Y
RTS
;--------------------------------------------------------------------------------
@@ -819,6 +899,8 @@ UpgradeFlute:
LDA InventoryTracking : AND #$FC : ORA #$01 : STA InventoryTracking ; switch to the working flute
LDA.b #$03 : STA FluteEquipment ; upgrade primary inventory
RTL
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
; FluteCallForDuck:
;--------------------------------------------------------------------------------
@@ -828,7 +910,7 @@ FluteCallForDuck:
LDA.l ProgressIndicator : CMP.b #$02 : BCS .vanilla ; must rescue Zelda first
.noDuck
LDA.b #$02 : RTL
LDA.b #$02 : RTL
.vanilla
LDA.l FluteEquipment ; what we wrote over
@@ -933,8 +1015,8 @@ RTL
; PrepItemScreenBigKey:
;--------------------------------------------------------------------------------
PrepItemScreenBigKey:
STZ $02
STZ $03
STZ $02
STZ $03
REP #$30 ; thing we wrote over - set 16-bit accumulator
RTL
;--------------------------------------------------------------------------------
@@ -947,8 +1029,7 @@ LoadPowder:
LDA.l WitchItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
%GetPossiblyEncryptedItem(WitchItem, SpriteItemValues)
STA $0DA0, Y ; Store item type
JSL.l PrepDynamicTile
STA $7F505E
LDA.b #$01 : STA.w !SPRITE_REDRAW, Y
LDA #$00
STA $7F505F
STA $7F5060
@@ -972,21 +1053,16 @@ RTL
;--------------------------------------------------------------------------------
; DrawPowder:
;--------------------------------------------------------------------------------
!REDRAW = "$7F5000"
;--------------------------------------------------------------------------------
DrawPowder:
LDA $02DA : BNE .defer ; defer if link is buying a potion
LDA.l !REDRAW : BEQ +
LDA.w !SPRITE_REDRAW, X : BEQ +
LDA.l WitchItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA $0DA0, X ; Retrieve stored item type
JSL.l PrepDynamicTile
LDA #$00 : STA.l !REDRAW ; reset redraw flag
BRA .defer
JML RequestSlottedTile
+
; this fights with the shopkeep code, so had to move the powder draw there when potion shop is custom
LDA !SHOP_TYPE : CMP.b #$FF : BNE .defer
LDA $0DA0, X ; Retrieve stored item type
JSL.l DrawDynamicTile
LDA $0DA0, X ; Retrieve stored item type
JML DrawSlottedTile
.defer
RTL
;--------------------------------------------------------------------------------
@@ -997,19 +1073,12 @@ RTL
LoadMushroom:
LDA.b #$00 : STA $0DC0, X ; thing we wrote over
.justGFX
;LDA MushroomItem
;JSL.l PrepDynamicTile
PHA
LDA #$01 : STA !REDRAW
LDA $5D : CMP #$14 : BEQ .skip ; skip if we're mid-mirror
LDA #$00 : STA !REDRAW
LDA.l MushroomItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
%GetPossiblyEncryptedItem(MushroomItem, SpriteItemValues)
STA $0E80, X ; Store item type
JSL.l PrepDynamicTile
JSL.l RequestSlottedTile
.skip
PLA
@@ -1019,19 +1088,18 @@ RTL
;--------------------------------------------------------------------------------
; DrawMushroom:
;--------------------------------------------------------------------------------
!REDRAW = "$7F5000"
;--------------------------------------------------------------------------------
DrawMushroom:
PHA : PHY
LDA !REDRAW : BEQ .skipInit ; skip init if already ready
JSL.l LoadMushroom_justGFX
BRA .done ; don't draw on the init frame
LDA.w !SPRITE_REDRAW, X : BEQ .skipInit ; skip init if already ready
JSL.l LoadMushroom_justGFX
LDA.w !SPRITE_REDRAW, X : CMP.b #$02 : BEQ .skipInit
BRA .done ; don't draw on the init frame
.skipInit
LDA $0E80, X ; Retrieve stored item type
JSL.l DrawDynamicTile
JSL.l DrawSlottedTile
.done
.done
PLY : PLA
RTL
;--------------------------------------------------------------------------------
@@ -1049,9 +1117,9 @@ CollectPowder:
LDA WitchItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID
LDA.b #$01 : STA.l !SHOP_ENABLE_COUNT
PLA
STZ $02E9 ; item from NPC
JSL.l Link_ReceiveItem
PHA : LDA.b #$00 : STA.l !SHOP_ENABLE_COUNT : PLA
STZ $02E9 ; item from NPC
JSL.l Link_ReceiveItem
PHA : LDA.b #$00 : STA.l !SHOP_ENABLE_COUNT : PLA
;JSL.l FullInventoryExternal
JSL.l ItemSet_Powder
RTL
@@ -1076,14 +1144,14 @@ RTL
DrawMagicHeader:
LDA MagicConsumption : AND.w #$00FF : CMP.w #$0002 : BEQ .quarterMagic
.halfMagic
LDA.w #$28F7 : STA $7EC704
LDA.w #$2851 : STA $7EC706
LDA.w #$28FA : STA $7EC708
LDA.w #$28F7 : STA $7EC704
LDA.w #$2851 : STA $7EC706
LDA.w #$28FA : STA $7EC708
RTL
.quarterMagic
LDA.w #$28F7 : STA $7EC704
LDA.w #$2800 : STA $7EC706
LDA.w #$2801 : STA $7EC708
LDA.w #$28F7 : STA $7EC704
LDA.w #$2800 : STA $7EC706
LDA.w #$2801 : STA $7EC708
RTL
;--------------------------------------------------------------------------------
@@ -1125,12 +1193,14 @@ RTL
;--------------------------------------------------------------------------------
; SpawnShovelItem:
;--------------------------------------------------------------------------------
!REDRAW = "$7F5000"
SpawnShovelGamePrize:
JSL Sprite_SpawnDynamically ; thing we wrote over
LDA.b #$01 : STA.w !SPRITE_REDRAW, Y
RTL
;--------------------------------------------------------------------------------
SpawnShovelItem:
LDA.b #$01 : STA !REDRAW
LDA $03FC : BEQ +
JSL DiggingGameGuy_AttemptPrizeSpawn
LDA $03FC : BEQ +
JSL DiggingGameGuy_AttemptPrizeSpawn
JMP .skip
+
@@ -1188,12 +1258,12 @@ RTL
{
.x_speeds
db $F0
db $10
db $F0
db $10
.x_offsets
db $00
db $13
db $00
db $13
}
;--------------------------------------------------------------------------------
@@ -1214,4 +1284,4 @@ CMP.b #$4A : BNE +
+ ; normal itemget sfx
JSL Sound_SetSfxPanWithPlayerCoords : ORA.b #$0F : STA.w $012F ; what we wrote over
RTL
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------

View File

@@ -3,7 +3,7 @@
; Does tile modification for... the pyramid of power hole
; after Ganon slams into it in bat form?
Overworld_CreatePyramidHoleModified:
LDA.l InvertedMode : BNE +
PHX : LDX $8A : LDA.l OWTileMapAlt, X : PLX : AND.b #$01 : BNE +
JMP .originalBehaviour
+
.invertedBehavior
@@ -80,7 +80,7 @@ Overworld_CreatePyramidHoleModified:
RTL
;------------------------------------------------------------------------------
Draw_PyramidOverlay:
LDA.l InvertedMode : AND.w #$00FF : BNE .done
PHX : LDA $8A : AND.w #$00FF : TAX : LDA.l OWTileMapAlt, X : PLX : AND.w #$0001 : BNE .done
.normal
LDA.w #$0E39 : STA $23BC
INC A : STA $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
Electric_Barrier:
LDA InvertedMode : BEQ .done
LDA SwapAgaGanonsTower : BEQ .done
LDA OverworldEventDataWRAM, X : ORA #$40 : STA OverworldEventDataWRAM, X ;set barrier dead
.done
LDA OverworldEventDataWRAM, X ; what we wrote over
@@ -138,7 +138,7 @@ RTL
GanonTowerAnimation:
LDA InvertedMode : BEQ .done
LDA SwapAgaGanonsTower : BEQ .done
LDA.b #$1B : STA $012F
STZ $04C6
STZ $B0
@@ -151,7 +151,9 @@ GanonTowerAnimation:
STZ $011B
STZ $011C
STZ $011D
LDA.b #$02 : STA $012C
PHX
JSL Overworld_DetermineMusic : STX !REG_MUSIC_CONTROL_REQUEST
PLX
LDA.b #$09 : STA $012D
RTL
.done
@@ -162,7 +164,7 @@ RTL
GanonTowerInvertedCheck:
{
LDA InvertedMode : BEQ .done
LDA SwapAgaGanonsTower : BEQ .done
LDA #$01 ; Load a random value so it doesn't BEQ
RTL
.done
@@ -174,7 +176,7 @@ GanonTowerInvertedCheck:
;Hard coded rock removed in LW for Inverted mode
HardcodedRocks:
LDA InvertedMode : AND.w #$00FF : BEQ .normalrocks
LDA $8A : AND.w #$00FF : TAX : LDA.l OWTileMapAlt, X : AND.w #$0001 : BEQ .normalrocks
BRA .noRock2
.normalrocks
LDA.w #$020F : LDX $8A : CPX.w #$0033 : BNE .noRock
@@ -186,7 +188,7 @@ HardcodedRocks:
RTL
TurtleRockPegSolved:
LDA.l InvertedMode : AND.w #$00FF : BNE +
PHX : LDA $8A : 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)
RTL
+
@@ -195,14 +197,17 @@ RTL
MirrorBonk:
; must preserve X/Y, and must preserve $00-$0F
LDA.l InvertedMode : BEQ .normal
PHX : LDX $8A : LDA.l OWTileMapAlt, X : PLX : AND.b #$01 : BEQ .normal
; Goal: use $20 and $22 to decide to force a bonk
; if we want to bonk branch to .forceBonk
; otherwise fall through to .normal
PHX : PHP
PHB : PHK : PLB
LDA $8A : AND.b #$40 : BEQ .endLoop ;World we're in? branch if we are in LW we don't want bonks
LDX $8A : LDA.l OWTileWorldAssoc, X
TAX : LDA.l InvertedMode : BEQ +
TXA : EOR #$40 : TAX
+ TXA : BNE .endLoop ;World we're in? branch if we are in LW we don't want bonks
REP #$30
LDX #$0000
.loop

File diff suppressed because it is too large Load Diff

98
item_on_b.asm Normal file
View File

@@ -0,0 +1,98 @@
;--------------------------------------------------------------------------------
ItemMenuLocations:
dw $11C8 ; Bow
dw $11CE ; Boomerang
dw $11D4 ; Hookshot
dw $11DA ; Bombs
dw $11E0 ; Powder / Mushroom
dw $1288 ; Fire Rod
dw $128E ; Ice Rod
dw $1294 ; Bombos
dw $129A ; Ether
dw $12A0 ; Quake
dw $1348 ; Lamp
dw $134E ; Hammer
dw $1354 ; Flute / Shovel
dw $135A ; Bug Net
dw $1360 ; Book
dw $1408 ; Bottles
dw $140E ; Somaria
dw $1414 ; Byrna
dw $141A ; Cape
dw $1420 ; Mirror
DrawBIndicator:
LDA.l ItemOnB : AND.w #$00FF : BEQ .done
DEC : ASL : TAX
LDA.l ItemMenuLocations, X : TAX
LDA.w #$3D3B
STA.w $0042, X
.done ; what we wrote over
LDA.w $0202
AND.w #$00FF
DEC
ASL
TAX
RTL
;--------------------------------------------------------------------------------
ItemHandlerLocs:
dw $A003 ; Bow
dw $A0B8 ; Boomerang
dw $AB23 ; Hookshot
dw $A139 ; Bombs
dw $FFFF ; Powder / Mushroom
dw $9EEC ; Fire Rod
dw $9EEC ; Ice Rod
dw $A55E ; Bombos
dw $A489 ; Ether
dw $A640 ; Quake
dw $A246 ; Lamp
dw $9F82 ; Hammer
dw $FFFF ; Flute / Shovel
dw $AFEE ; Bug Net
dw $A46E ; Book
dw $FFFF ; Bottles
dw $AEBB ; Somaria
dw $FFFF ; Byrna
dw $FFFF ; Cape
dw $A913 ; Mirror
ValidItemOnB:
db $FF
db $00, $00, $00, $00, $FF
db $00, $00, $00, $00, $00
db $00, $00, $FF, $00, $00
db $FF, $00, $FF, $FF, $00
UseItem:
JSL CheckDetonateBomb : BCS .normal
LDA.l ItemOnB : BEQ .normal
TAX
LDA.b $6C : BNE .prevent_swing
CPX.b #$11 : BNE .not_somaria
LDA.w $02F5 : BNE .prevent_swing
.not_somaria
LDA.l ValidItemOnB, X : BNE .normal
LDA.b $3A : ORA.b #$40 : STA.b $3A
LDA.l $0DFA35, X : STA.w $0304
CPX.b #$06 : BEQ .fire_rod
CPX.b #$07 : BNE .not_rod
.ice_rod
LDA.b #$02 : STA.w $0307
BRA .not_rod
.fire_rod
LDA.b #$01 : STA.w $0307
.not_rod
TXA : DEC : ASL : TAX
LDA.l ItemHandlerLocs+1, X : STA.b $01
LDA.l ItemHandlerLocs, X : STA.b $00
JSL Link_UseItemLong
.prevent_swing
SEC
RTL
.normal
LDA.b #$80 : TSB.b $3A
LDA.b #$01 : TSB.b $50
CLC
RTL

View File

@@ -9,29 +9,29 @@ RTL
ItemDowngradeFixMain:
JSL.l AddInventory
BMI .dontWrite ; thing we wrote over part 1
CPY.b #$1B : BEQ .isPowerGloves ; Power Gloves
CPY.b #$05 : BEQ .isRedShield ; Red Shield
CPY.b #$04 : BEQ .isBlueShield ; Blue Shield
CPY.b #$0C : BEQ .isBlueBoomerang ; Blue Boomerang
CPY.b #$0B : BEQ .isBow ; Bow
CPY.b #$3A : BEQ .isBowAndArrows ; Bow
CPY.b #$49 : BEQ .isSword ; Fighter's Sword
CPY.b #$01 : BEQ .isSword ; Master Sword
CPY.b #$50 : BEQ .isSword ; Master Sword (Safe)
CPY.b #$02 : BEQ .isSword ; Tempered Sword
CPY.b #$3B : BEQ .isSilverArrowBow ; Silver Arrow Bow
CPY.b #$2A : BEQ .isRedBoomerang ; Red Boomerang
CPY.b #$0D : BEQ .isMagicPowder ; Magic Powder
CPY.b #$14 : BEQ .isFlute ; Flute
CPY.b #$13 : BEQ .isShovel ; Shovel
CPY.b #$29 : BEQ .isMushroom ; Mushroom
CPY.b #$00 : BEQ .isUncleSwordShield ; Fighter's Sword & Shield
.done
.done
STA [$00] ; thing we wrote over part 2
.dontWrite
RTS
@@ -60,7 +60,7 @@ RTS
RTS
.isSword
PHA
LDA HighestSword : STA $04
LDA HighestSword : STA $04
TYA ; load sword item
CMP.b #$49 : BNE + : LDA.b #$00 : + ; convert extra fighter's sword to normal one
CMP.b #$50 : BNE + : LDA.b #$01 : + ; convert extra master sword to normal one
@@ -71,11 +71,11 @@ RTS
+
PLA
JMP .done
.isUncleSwordShield
.isUncleSwordShield
PHA
LDA HighestSword : STA [$00] ; already set to 1 if we had no sword, always keep highest
INC $00
LDA HighestShield : STA [$00]
LDA HighestSword : STA [$00] ; already set to 1 if we had no sword, always keep highest
INC $00
LDA HighestShield : STA [$00]
PLA
RTS
;================================================================================

View File

@@ -1,38 +1,38 @@
org $328000
; You have found
; the map of
; the Map of
Notice_MapOf:
db $74, $00, $C2, $00, $3E, $00, $44, $00, $FF, $00, $37, $00, $30, $00, $45, $00, $34, $00, $FF, $00, $35, $00, $3E, $00, $44, $00, $3D, $00, $33
db $75, $00, $43, $00, $37, $00, $34, $00, $FF, $00, $3C, $00, $30, $00, $3F, $00, $FF, $00, $3E, $00, $35
db $75, $00, $43, $00, $37, $00, $34, $00, $FF, $00, $B6, $00, $30, $00, $3F, $00, $FF, $00, $3E, $00, $35
dw #$7F7F
; You have found
; the compass of
; the Compass of
Notice_CompassOf:
db $74, $00, $C2, $00, $3E, $00, $44, $00, $FF, $00, $37, $00, $30, $00, $45, $00, $34, $00, $FF, $00, $35, $00, $3E, $00, $44, $00, $3D, $00, $33
db $75, $00, $43, $00, $37, $00, $34, $00, $FF, $00, $32, $00, $3E, $00, $3C, $00, $3F, $00, $30, $00, $42, $00, $42, $00, $FF, $00, $3E, $00, $35
db $75, $00, $43, $00, $37, $00, $34, $00, $FF, $00, $AC, $00, $3E, $00, $3C, $00, $3F, $00, $30, $00, $42, $00, $42, $00, $FF, $00, $3E, $00, $35
dw #$7F7F
; Oh look! it's
; the big key of
; the Big Key of
Notice_BigKeyOf:
db $74, $00, $B8, $00, $37, $00, $FF, $00, $3B, $00, $3E, $00, $3E, $00, $3A, $00, $C7, $00, $FF, $00, $38, $00, $43, $00, $D8, $00, $42
db $75, $00, $43, $00, $37, $00, $34, $00, $FF, $00, $31, $00, $38, $00, $36, $00, $FF, $00, $3A, $00, $34, $00, $48, $00, $FF, $00, $3E, $00, $35
db $75, $00, $43, $00, $37, $00, $34, $00, $FF, $00, $AB, $00, $38, $00, $36, $00, $FF, $00, $B4, $00, $34, $00, $48, $00, $FF, $00, $3E, $00, $35
dw #$7F7F
; this is a
; small key to
; This is a
; Small Key to
Notice_SmallKeyOf:
db $74, $00, $BD, $00, $37, $00, $38, $00, $42, $00, $FF, $00, $38, $00, $42, $00, $FF, $00, $30
db $75, $00, $42, $00, $3C, $00, $30, $00, $3B, $00, $3B, $00, $FF, $00, $3A, $00, $34, $00, $48, $00, $FF, $00, $43, $00, $3e
db $75, $00, $BC, $00, $3C, $00, $30, $00, $3B, $00, $3B, $00, $FF, $00, $B4, $00, $34, $00, $48, $00, $FF, $00, $43, $00, $3E
dw #$7F7F
; light world
; Light World
Notice_LightWorld:
db $76, $00, $B5, $00, $38, $00, $36, $00, $37, $00, $43, $00, $FF, $00, $C0, $00, $3E, $00, $41, $00, $3B, $00, $33
dw #$7F7F
; dark world
; Dark World
Notice_DarkWorld:
db $76, $00, $AD, $00, $30, $00, $41, $00, $3A, $00, $FF, $00, $C0, $00, $3E, $00, $41, $00, $3B, $00, $33
dw #$7F7F
@@ -44,12 +44,12 @@ Notice_GTower:
; Turtle Rock
Notice_TRock:
db $76, $00, $BD, $00, $44, $00, $41, $00, $43, $00, $3B, $00, $34, $00, $FF, $00, $BB, $00, $3E, $00, $32, $00, $3a
db $76, $00, $BD, $00, $44, $00, $41, $00, $43, $00, $3B, $00, $34, $00, $FF, $00, $BB, $00, $3E, $00, $32, $00, $3A
dw #$7F7F
; Thieves Town
Notice_Thieves:
db $76, $00, $BD, $00, $37, $00, $38, $00, $34, $00, $45, $00, $34, $00, $42, $00, $FF, $00, $BD, $00, $3E, $00, $46, $00, $3d
db $76, $00, $BD, $00, $37, $00, $38, $00, $34, $00, $45, $00, $34, $00, $42, $00, $FF, $00, $BD, $00, $3E, $00, $46, $00, $3D
dw #$7F7F
; Tower of Hera
@@ -107,7 +107,7 @@ Notice_Sewers:
db $76, $00, $B1, $00, $48, $00, $41, $00, $44, $00, $3B, $00, $34, $00, $FF, $00, $AC, $00, $30, $00, $42, $00, $43, $00, $3B, $00, $34
dw #$7F7F
; This Dungeon
; this dungeon
Notice_Self:
db $76, $00, $43, $00, $37, $00, $38, $00, $42, $00, $FF, $00, $33, $00, $44, $00, $3D, $00, $36, $00, $34, $00, $3E, $00, $3d
dw #$7F7F
db $76, $00, $43, $00, $37, $00, $38, $00, $42, $00, $FF, $00, $33, $00, $44, $00, $3D, $00, $36, $00, $34, $00, $3E, $00, $3D
dw #$7F7F

View File

@@ -1,77 +1,217 @@
; where we shove the decompressed graphics to send to WRAM
DynamicDropGFX = $7EF500
DynamicDropGFX = $7ECC00
; this will just count from 0 to 4 to determine which slot we're using
; we're expecting 5 items max per room, and order is irrelevant
; we just need to keep track of where they go
DynamicDropGFXIndex = $7E1E70
!DynamicDropGFXSlotCount_UW = (FreeUWGraphics_end-FreeUWGraphics)>>1
!DynamicDropGFXSlotCount_OW = (FreeOWGraphics_end-FreeOWGraphics)>>1
; this will keep track of the above for each item
SprItemGFX = $7E0780
; this is the item requested and a flag
DynamicDropRequest = $7E1E71
DynamicDropQueue = $7E1E72
; this is the item requested and a flag (we anticipate no more than 3 requests to be active, but built to support 8)
DynamicDropRequest = $7E1E71 ; bitfield indicating which request slot to process
DynamicDropQueue = $7E1E72 ; 0x08 bytes, occupies 1 byte for each slot in the request queue (loot id at first, but stores GFX index)
; Come in with
; A = item receipt ID
; X = slot
RequestStandingItemVRAMSlot:
STA.w DynamicDropQueue
LDA.b #$01
STA.w DynamicDropRequest
; X = sprite slot
RequestSlottedTile:
PHX : PHY
LDA.w DynamicDropGFXIndex
INC
CMP.b #$05 : BCC .fine
PHA
LDA.b #$01 : STA.w !SPRITE_REDRAW, X
JSL Sprite_IsOnscreen : BCC ++
; skip sending the request if busy with other things
LDA.b $11 : 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 $5D : CMP.b #$14 : BEQ ++ ; skip if we're mid-mirror
LDA.b $1B : BEQ + ; OW current doesn't occupy any slots that medallion gfx do
CMP.b #$08 : BCC + : CMP.b #$0A+1 : BCS + ; skip if we're mid-medallion
++ PLA : JMP .return
+
LDA.b #$00
LDA.w $0E20, X : CMP.b #$C0 : BNE + ; if catfish
TYX
+ CMP.b #$52 : BNE + ; if zora
TYX
+
.fine
STA.w DynamicDropGFXIndex
STA.w SprItemGFX,X
LDA.b 1,S : JSL.l GetSpritePalette : STA.w $0F50, X ; setup the palette
PLA
; gfx that are already present, 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 $1B : BEQ ++
LDA.b #!DynamicDropGFXSlotCount_UW
BRA +++
++ LDA.b #!DynamicDropGFXSlotCount_OW
+++ INC : STA.w SprItemGFX,X
JMP .success
+ CMP.b #$A0 : BCC + : CMP.b #$AF+1 : BCS + ; if key, use key OAM slot
LDY.b $5D : CPY.b #$19 : BCC ++ : CPY.b #$1A+1 : BCS ++ ; if getting tablet item, don't use key slot
BRA +
++
LDA.b $1B : BEQ ++
LDA.b #!DynamicDropGFXSlotCount_UW
BRA +++
++ LDA.b #!DynamicDropGFXSlotCount_OW
+++ INC : INC : STA.w SprItemGFX,X
JMP .success
+ CMP.b #$B5 : BNE + ; if good bee, use bee OAM slot
LDA.b $1B : BEQ ++
LDA.b #!DynamicDropGFXSlotCount_UW
BRA +++
++ LDA.b #!DynamicDropGFXSlotCount_OW
+++ INC : INC : INC : STA.w SprItemGFX,X
JMP .success
+ CMP.b #$B2 : BNE + ; if fairy, use fairy OAM slot
LDA.b $1B : BEQ ++
LDA.b #!DynamicDropGFXSlotCount_UW
BRA +++
++ LDA.b #!DynamicDropGFXSlotCount_OW
+++ INC : INC : STA.w SprItemGFX,X
JMP .success
+ CMP.b #$B1 : BNE + ; if apple, use apple OAM slot
LDA.b $1B : BEQ ++
LDA.b #!DynamicDropGFXSlotCount_UW
BRA +++
++ LDA.b #!DynamicDropGFXSlotCount_OW
+++ INC : INC : INC : STA.w SprItemGFX,X
JMP .success
+ CMP.b #$6A : BNE + ; if triforce, use cutscene OAM slot
PHA
LDA.b $1B : BEQ ++
LDA.b #!DynamicDropGFXSlotCount_UW
BRA +++
++ LDA.b #!DynamicDropGFXSlotCount_OW
+++ INC : STA.w SprItemGFX,X
JMP .initRequest ; don't jump to end, we need the TF GFX to draw at $E7
+
PHA
LDA.w DynamicDropGFXIndex
INC
PHX
LDX.b $1B : BEQ +
CMP.b #!DynamicDropGFXSlotCount_UW : BCC .setIndex
BRA ++
+ CMP.b #!DynamicDropGFXSlotCount_OW : BCC .setIndex
++ LDA.b #$00
.setIndex
PLX
STA.w DynamicDropGFXIndex
STA.w SprItemGFX,X
PHX
; loop thru other sprites, check if any use the same gfx slot
LDY.b #$0F
- TYA : CMP 1,S : BEQ + ; don't check self
LDA.w $0DD0,Y : BEQ +
LDA.w !SPRITE_REDRAW, Y : BNE +
LDA.w SprItemGFX,Y : CMP.w DynamicDropGFXIndex : BNE +
LDA.w $0E20,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 +
++
; slot already in use, use overflow slot
LDA.b #$02 : STA.w !SPRITE_REDRAW, X
LDA.b $1B : BEQ ++
LDA.b #!DynamicDropGFXSlotCount_UW
BRA +++
++ LDA.b #!DynamicDropGFXSlotCount_OW
+++ STA.w SprItemGFX,X
PLX : PLA : BRA .return
+ DEY : BPL -
PLX
.initRequest
PHX
LDY.b #$00
LDA.w DynamicDropRequest
- LSR : INY : BCS -
CPY.b #$08 : BCC +
; all request slots occupied, exit without drawing
PLX : PLA
LDY.b #$FE ; indicate failure
BRA .return
+ TYX
LDA.b #$00 : SEC
- ROL : DEX : BNE -
DEY ; y = slot index, a = new request bit flag
ORA.w DynamicDropRequest
STA.w DynamicDropRequest
PLX
PLA
STA.w DynamicDropQueue,Y
; decompress graphics
PHX
LDX.w DynamicDropQueue
PHX : PHY
REP #$20
LDA.w #DynamicDropGFX-$7E9000
STA.l !TILE_UPLOAD_OFFSET_OVERRIDE
TYX : BEQ +
- CLC : ADC.w #$0080 : DEX : BNE -
+ STA.l !TILE_UPLOAD_OFFSET_OVERRIDE
SEP #$20
LDA.w DynamicDropQueue
LDA.w DynamicDropQueue,Y
JSL.l GetSpriteID
JSL.l GetAnimatedSpriteTile_variable
SEP #$30
PLX
PLY : PLX
LDA.w DynamicDropQueue,Y : PHA ; we want A to return the loot id
LDA.w SprItemGFX,X : STA.w DynamicDropQueue,Y
PLA
.success
STZ.w !SPRITE_REDRAW, X
.return
PLY : PLX
RTL
;===================================================================================================
TransferPotGFX:
SEP #$10
REP #$20
LDX.w DynamicDropRequest
LDA.w DynamicDropRequest : AND.w #$00FF
BEQ .no
STZ.w DynamicDropRequest
.next
LDY.b #$00
- INY : LSR : BCC -
LDA.w DynamicDropGFXIndex
PHY
LDA.w #$0000
- ROL : DEY : BNE -
PLY
DEY ; y = slot index, a = request bit flag
EOR.w DynamicDropRequest : STA.w DynamicDropRequest
LDA.w DynamicDropQueue,Y
ASL
TAX
LDA.l FreeUWGraphics,X
STA.w $2116
LDA.b $1B : AND.w #$00FF : BEQ +
LDA.l FreeUWGraphics,X
BRA ++
+ LDA.l FreeOWGraphics,X
++ STA.w $2116
; calculate bottom row now
CLC : ADC.w #$0200>>1 : PHA
LDX.b #$7E : STX.w $4314
LDA.w #DynamicDropGFX : STA.w $4302
LDA.w #DynamicDropGFX
CPY.b #$00 : BEQ +
- CLC : ADC.w #$0080 : DEY : BNE -
+ STA.w $4302
LDX.b #$80 : STX.w $2115
LDA.w #$1801 : STA.w $4300
@@ -86,6 +226,9 @@ TransferPotGFX:
STA.w $2116
STY.w $420B
LDA.w DynamicDropRequest : AND.w #$00FF
BNE .next
.no
RTL
@@ -94,60 +237,133 @@ FreeUWGraphics:
dw $8800>>1
dw $8840>>1
dw $8980>>1
dw $9CA0>>1
dw $9DC0>>1
; dw $8800>>1
; dw $8840>>1
; dw $8980>>1
; dw $9960>>1 # Arghuss Splash apparently
; dw $9C00>>1
dw $9960>>1 ; Arghuss Splash apparently
dw $9C00>>1
; dw $9CA0>>1
; dw $9DC0>>1
dw $9DC0>>1
; add new slots above this line
.end
dw $0000 ; overflow slot, intentionally blank
dw $9CE0>>1 ; Triforce
; above this line, add slots that we want to draw to specific slots
FreeOWGraphics:
dw $8180>>1 ; Push Block
;dw $8800>>1 ; Shovel Dirt
dw $9960>>1 ; Arghuss/Zora Splash
dw $9C00>>1 ; Heart Piece
;dw $9CA0>>1 ; Apple
;dw $9DC0>>1 ; Whirlpool
; add new slots above this line
.end
dw $0000 ; overflow slot, intentionally blank
dw $9CE0>>1 ; Triforce
; above this line, add slots that we want to draw to specific slots
;===================================================================================================
DrawPotItem:
; Come in with
; A = item receipt ID
; X = sprite slot
; Returns with Carry flag set if gfx drawing was skipped
DrawSlottedTile:
PHA
; TODO: allow drawing if gfx are not using a VRAM slot that changes during medallion
LDA.b $5D : CMP.b #$08 : BCC + : CMP.b #$0A+1 : BCS + ; skip if we're mid-medallion
PLA : SEC : RTL
+
PLA
STA.b $07 ; store loot ID temporarily, will get overwritten in Sprite_DrawMultiple_quantity_preset call
JSL.l IsNarrowSprite : BCS .narrow
; TODO: Instead of loading the whole fixed 16 bytes from DynamicOAMTile**_** into !SPRITE_DYNAMIC_OAM
; Do something more like how DrawDynamicTile does it
; Then we won't need all the separate DynamicOAMTile**_** tables
.full
LDA.b #$01 : STA $06
LDA #$0C : JSL.l OAM_AllocateFromRegionC
LDA #$02 : PHA
REP #$20
LDA.w #DynamicOAMTile_full
BRA .draw
LDA.b $1B : AND.w #$00FF : BEQ +
LDA.w #DynamicOAMTileUW_full
BRA .transfer
+ LDA.w #DynamicOAMTileOW_full
BRA .transfer
.narrow
LDA.b #$02 : STA $06
LDA #$10 : JSL.l OAM_AllocateFromRegionC
LDA #$03 : PHA
REP #$20
LDA.w #DynamicOAMTile_thin
.draw
PHB : PHK : PLB
REP #$20
LDA.b $1B : AND.w #$00FF : BEQ +
LDA.w #DynamicOAMTileUW_thin
BRA .transfer
+ LDA.w #DynamicOAMTileOW_thin
.transfer
STA.b $08
LDA.w SprItemGFX,X
AND.w #$00FF
ASL : ASL : ASL : ASL
ADC.b $08
STA.b $08
SEP #$20
STZ.b $07
PHK : PLY : STY.b $0A
LDY #$7E : PHB : PHY : PLB
LDA.b #$00 : STA.l !SKIP_EOR
JSL Sprite_DrawMultiple_quantity_preset
; transfer fixed table data into WRAM
LDY.b #$0E
- LDA.b [$08],Y : STA.w !SPRITE_DYNAMIC_OAM,Y
DEY : DEY : BPL -
LDA.b $90 : CLC : ADC.b #$08 : STA.b $90
INC.b $92
INC.b $92
LDA.w SprItemFlags, X : AND.w #$00FF : BNE .draw
LDA.b $06 : LSR : BCC +
; full
LDA.w #$0000
STA.w !SPRITE_DYNAMIC_OAM : STA.w !SPRITE_DYNAMIC_OAM+2
BRA .draw
+ ; narrow
LDA.w $0E20, X : AND.w #$00FF : CMP.w #$003B : BEQ .draw ; bonk item
LDA.b $A0 : CMP.w #$0120 : BNE +
LDA.b $1B : BNE .draw ; good bee statue
+
; TODO: Figure out how to target bottle vendor fish item better than this
LDA.b $8A : AND.w #$00FF : CMP.w #$0018 : BNE +
LDA.b $1B : BEQ .draw ; bottle vendor key
+
LDA.w #$0004
STA.w !SPRITE_DYNAMIC_OAM : STA.w !SPRITE_DYNAMIC_OAM+8
.draw
; special handling
LDY.b $07 : CPY.b #$B2 : BNE + ; fairy
LDA.b $1A : AND.w #$0020 : BEQ ++ ; alternate every 32 frames
LDA.w !SPRITE_DYNAMIC_OAM+4 : CLC : ADC.w #$02 ; use other fairy GFX
STA.w !SPRITE_DYNAMIC_OAM+4
++ LDA.b $1A : SEC : SBC.w #$10 : AND.w #$0020 : BEQ + ; alternate every 32 frames
LDA.w !SPRITE_DYNAMIC_OAM+2 : SEC : SBC.w #$02 ; move fairy up 2 pixels
STA.w !SPRITE_DYNAMIC_OAM+2
+ CPY.b #$B5 : BNE + ; good bee
LDA.b $1A : AND.w #$0020 : BEQ ++ ; alternate every 32 frames
LDA.w !SPRITE_DYNAMIC_OAM+12 : SEC : SBC.w #$10 ; use other fairy GFX
STA.w !SPRITE_DYNAMIC_OAM+12
++ LDA.b $1A : SEC : SBC.w #$10 : AND.w #$0020 : BEQ + ; alternate every 32 frames
LDA.w !SPRITE_DYNAMIC_OAM+10 : SEC : SBC.w #$02 ; move fairy up 2 pixels
STA.w !SPRITE_DYNAMIC_OAM+10
+
LDA.w #!SPRITE_DYNAMIC_OAM : STA.b $08
SEP #$20
STZ.b $07
LDA.b #$00 : STA.l !SKIP_EOR
JSL Sprite_DrawMultiple_quantity_preset
PLB
LDA.b $90 : CLC : ADC.b #$08 : STA.b $90
INC.b $92 : INC.b $92
PLA
CLC
RTL
DynamicOAMTile_thin:
DynamicOAMTileUW_thin:
dw 0, 0 : db $40, $00, $20, $00
dw 0, 8 : db $50, $00, $20, $00
@@ -157,13 +373,32 @@ DynamicOAMTile_thin:
dw 0, 0 : db $4C, $00, $20, $00
dw 0, 8 : db $5C, $00, $20, $00
dw 0, 0 : db $E5, $00, $20, $00
dw 0, 8 : db $F5, $00, $20, $00
dw 0, 0 : db $CB, $00, $20, $00
dw 0, 8 : db $DB, $00, $20, $00
dw 0, 0 : db $E0, $00, $20, $00
dw 0, 8 : db $F0, $00, $20, $00
dw 0, 0 : db $EE, $00, $20, $00
dw 0, 8 : db $FE, $00, $20, $00
DynamicOAMTile_full:
; add new slots above this line
dw 0, 0 : db $E3, $00, $20, $00 ; overflow slot
dw 0, 8 : db $F3, $00, $20, $00
; above this line, add slots that we want to draw to specific slots
dw 0, 0 : db $0B, $00, $20, $00 ; animated rupees slot
dw 0, 8 : db $1B, $00, $20, $00
dw 0, 0 : db $6B, $00, $20, $00 ; key
dw 0, 8 : db $7B, $00, $20, $00
dw 0, 0 : db $7C, $00, $20, $00 ; good bee
dw 0, 8 : db $F4, $00, $20, $00
DynamicOAMTileUW_full:
dw -4, -1 : db $40, $00, $20, $02
dd 0, 0
@@ -173,8 +408,113 @@ DynamicOAMTile_full:
dw -4, -1 : db $4C, $00, $20, $02
dd 0, 0
dw -4, -1 : db $E5, $00, $20, $02
dw -4, -1 : db $CB, $00, $20, $02
dd 0, 0
dw -4, -1 : db $E0, $00, $20, $02
dd 0, 0
dw -4, -1 : db $EE, $00, $20, $02
dd 0, 0
dd 0, 0
; add new rotating slots above this line
dw -4, -1 : db $A0, $00, $20, $02 ; overflow slot
dd 0, 0
dw -4, -1 : db $E7, $00, $20, $02 ; triforce
dd 0, 0
; above this line, add slots that we want to draw to specific slots
dw -4, -1 : db $EA, $00, $20, $02 ; fairy
dd 0, 0
dw -4, -1 : db $E5, $00, $20, $02 ; apple
dd 0, 0
DynamicOAMTileOW_thin:
dw 0, 0 : db $0C, $00, $20, $00
dw 0, 8 : db $1C, $00, $20, $00
; dw 0, 0 : db $40, $00, $20, $00
; dw 0, 8 : db $50, $00, $20, $00
dw 0, 0 : db $CB, $00, $20, $00
dw 0, 8 : db $DB, $00, $20, $00
dw 0, 0 : db $E0, $00, $20, $00
dw 0, 8 : db $F0, $00, $20, $00
;dw 0, 0 : db $E5, $00, $20, $00
;dw 0, 8 : db $F5, $00, $20, $00
;dw 0, 0 : db $EE, $00, $20, $00
;dw 0, 8 : db $FE, $00, $20, $00
; add new slots above this line
dw 0, 0 : db $E3, $00, $20, $00 ; overflow slot
dw 0, 8 : db $F3, $00, $20, $00
; above this line, add slots that we want to draw to specific slots
dw 0, 0 : db $0B, $00, $20, $00 ; animated rupees slot
dw 0, 8 : db $1B, $00, $20, $00
dw 0, 0 : db $6B, $00, $20, $00 ; key
dw 0, 8 : db $7B, $00, $20, $00
dw 0, 0 : db $7C, $00, $20, $00 ; good bee
dw 0, 8 : db $F4, $00, $20, $00
DynamicOAMTileOW_full:
dw 0, 0 : db $0C, $00, $20, $02
dd 0, 0
; dw 0, 0 : db $40, $00, $20, $02
; dd 0, 0
dw 0, 0 : db $CB, $00, $20, $02
dd 0, 0
dw 0, 0 : db $E0, $00, $20, $02
dd 0, 0
;dw 0, 0 : db $E5, $00, $20, $02
;dd 0, 0
;dw 0, 0 : db $EE, $00, $20, $02
;dd 0, 0
; add new slots above this line
dw 0, 0 : db $A0, $00, $20, $02 ; overflow slot
dd 0, 0
dw 0, 0 : db $E7, $00, $20, $02 ; triforce
dd 0, 0
; above this line, add slots that we want to draw to specific slots
dw 0, 0 : db $EA, $00, $20, $02 ; fairy
dd 0, 0
dw 0, 0 : db $E5, $00, $20, $02 ; apple
dd 0, 0
ConditionalPushBlockTransfer:
LDA.b $1B : BNE +
LDA.b #$0F ; don't transfer push block when on the OW
BRA .return-3
+
LDA.b #$1F : STA.w $420B ; what we wrote over
.return
RTL
pushpc
; fix Arghuss/Zora splash graphics
org $068595
db $E7, $E7, $E7, $E7, $E7, $C0, $C0
pullpc

View File

@@ -75,6 +75,8 @@ org $868283
Sprite_SpawnSecret_NotRandomBush:
org $86828A
Sprite_SpawnSecret_SpriteSpawnDynamically:
org $8682A5
Sprite_SpawnSecret_SetCoords:
org $86d23a
Sprite_DrawAbsorbable:
org $9eff81
@@ -258,6 +260,12 @@ SaveMajorItemDrop:
LDA.w #$0018 : BRA .substitute
+ CPY.w #$0031 : BNE + ; 10 pack bombs
LDA.w #$0019 : BRA .substitute
+ CPY.w #$00B1 : BNE + ; Apples
LDA.w #$001A : BRA .substitute
+ CPY.w #$00B0 : BNE + ; Bee Trap
LDA.w #$001B : BRA .substitute
+ CPY.w #$00B5 : BNE + ; Good Bee
LDA.w #$001C : BRA .substitute
+ STA $0B9C ; indicates we should use the key routines or a substitute
RTL
.substitute
@@ -362,7 +370,7 @@ RevealSpriteDrop:
LDY.w $0CBA, X : BEQ .no_forced_drop
RTL
.no_forced_drop
PLA : PLA ; remove the JSL reswamturn lower 16 bits
PLA : PLA ; remove the JSL return lower 16 bits
PEA.w $06F996-1 ; change return address to .no_forced_drop of (Sprite_DoTheDeath)
RTL
@@ -373,7 +381,7 @@ RevealSpriteDrop2:
LDY.w $0CBA, X : BEQ .no_forced_drop
RTL
.no_forced_drop
PLA : PLA ; remove the JSL reswamturn lower 16 bits
PLA : PLA ; remove the JSL return lower 16 bits
PEA.w $06E3CE-1 ; change return address to .no_forced_drop of (Sprite_DoTheDeath)
RTL
@@ -381,7 +389,7 @@ BitFieldMasks:
dw $8000, $4000, $2000, $1000, $0800, $0400, $0200, $0100
dw $0080, $0040, $0020, $0010, $0008, $0004, $0002, $0001
; Runs during Sprite_E4_SmallKey and duning Sprite_E5_BigKey spawns
; Runs during Sprite_E4_SmallKey and during Sprite_E5_BigKey spawns
ShouldSpawnItem:
LDA $048E : CMP.b #$87 : BNE + ; check for hera basement cage
LDA $A8 : AND.b #$03 : CMP.b #$02 : BNE + ; we're not in that quadrant
@@ -436,53 +444,59 @@ SpriteKeyPrep:
LDA.w SpawnedItemMWPlayer : STA SprItemMWPlayer, X
LDA.w SpawnedItemFlag : STA SprItemFlags, X : BEQ +
LDA.l SpawnedItemID : STA $0E80, X
PHA
JSL.l GetSpritePalette : STA $0F50, X ; setup the palette
PLA
CMP #$24 : BNE ++ ;
JSL.l GetSpritePalette : STA.w $0F50, X ; setup the palette
LDA $A0 : CMP.b #$80 : BNE +
LDA SpawnedItemFlag : BNE +
LDA #$24 ; it's the big key drop?
++ JSL RequestStandingItemVRAMSlot
++ JSL RequestSlottedTile
+ PLA
RTL
SpriteKeyDrawGFX:
JSL Sprite_DrawRippleIfInWater
PHA
LDA $0E80, X
CMP.b #$24 : BNE +
LDA $A0 : CMP #$80 : BNE ++
LDA SpawnedItemFlag : BNE ++
LDA #$24 : BRA +
++ PLA
PHK : PEA.w .jslrtsreturn-1
PEA.w $068014 ; an rtl address - 1 in Bank06
JML Sprite_DrawAbsorbable
.jslrtsreturn
RTL
+ JSL DrawPotItem
CMP #$03 : BNE +
PHA : LDA $0E60, X : ORA.b #$20 : STA $0E60, X : PLA
+ JSL.l Sprite_DrawShadowLong
PLA : RTL
JSL Sprite_DrawRippleIfInWater
PHA
LDA.w !SPRITE_REDRAW, X : BEQ +
LDA $0E80, X
JSL RequestSlottedTile
LDA.w !SPRITE_REDRAW, X : CMP.b #$02 : BEQ +
BRA .skipDraw
+ LDA $0E80, X
CMP.b #$24 : BNE +
LDA $A0 : CMP #$80 : BNE ++
LDA SpawnedItemFlag : BNE ++
LDA #$24 : BRA +
++ PLA
PHK : PEA.w .jslrtsreturn-1
PEA.w $068014 ; an rtl address - 1 in Bank06
JML Sprite_DrawAbsorbable
.jslrtsreturn
RTL
+ JSL DrawSlottedTile : BCS .skipDraw
; draw shadow
CMP #$03 : BNE +
PHA : LDA $0E60, X : ORA.b #$20 : STA $0E60, X : PLA
+ JSL.l Sprite_DrawShadowLong
.skipDraw
PLA
RTL
KeyGet:
LDA CurrentSmallKeys ; what we wrote over
PHA
LDA.l StandingItemsOn : BNE +
PLA : RTL
+ LDY $0E80, X
LDA SprItemIndex, X : STA SpawnedItemIndex
LDA SprItemFlags, X : STA SpawnedItemFlag
LDA $A0 : CMP #$87 : BNE + ;check for hera cage
LDA SpawnedItemFlag : BNE + ; if it came from a pot, it's fine
JSR ShouldKeyBeCountedForDungeon : BCC ++
LDA CurrentSmallKeys ; what we wrote over
PHA
LDA.l StandingItemsOn : BNE +
PLA : RTL
+ LDY $0E80, X
LDA SprItemIndex, X : STA SpawnedItemIndex
LDA SprItemFlags, X : STA SpawnedItemFlag
LDA $A0 : CMP #$87 : BNE + ;check for hera cage
LDA SpawnedItemFlag : BNE + ; if it came from a pot, it's fine
JSR ShouldKeyBeCountedForDungeon : BCC ++
JSL CountChestKeyLong
++ PLA : RTL
+ STY $00
LDA SprItemMWPlayer, X : STA !MULTIWORLD_ITEM_PLAYER_ID : BNE .receive
PHX
++ PLA : RTL
+ STY $00
LDA SprItemMWPlayer, X : STA !MULTIWORLD_ITEM_PLAYER_ID : BNE .receive
PHX
LDA $040C : CMP #$FF : BNE +
LDA $00 : CMP.b #$AF : BNE .skip
LDA CurrentGenericKeys : INC : STA CurrentGenericKeys
@@ -495,10 +509,10 @@ KeyGet:
++ PLX : PLA : RTL
+ CMP.b #$AF : beq .countIt ; universal key
CMP.b #$24 : beq .countIt ; small key for this dungeon
.skip PLX
.receive
JSL $0791b3 ; Player_HaltDashAttackLong
JSL.l Link_ReceiveItem
.skip PLX
.receive
JSL $0791b3 ; Player_HaltDashAttackLong
JSL.l Link_ReceiveItem
PLA : DEC : RTL
KeyTable:
@@ -549,7 +563,10 @@ SubstitionTable:
db $DB ; RED RUPEE - 0x16
db $E2 ; ARROW REFILL 10 - 0x17
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:
@@ -567,6 +584,22 @@ RTS
CheckSprite_Spawn:
JSR SubstituteSpriteId
CPY.b #$1C : BNE + ; good bee handling
JSL Sprite_SpawnDynamically
BMI .check
PHX
TYX : JSL.l Sprite_LoadProperties
PLX
JSL.l 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 $0D ; lets the outside code treat this sprite like a Stal (most normal table values)
RTL
+
JSL Sprite_SpawnDynamically
BMI .check
RTL
@@ -608,7 +641,7 @@ CheckIfPotIsSpecial:
BEQ .specialpot
; Normal pot, so run the vanilla code
LDA.l $7EF3CA ; check for dark world
LDA.l CurrentWorld ; check for dark world
.specialpot ; zero flag already set, so gtg
RTL
@@ -618,6 +651,32 @@ SetTheSceneFix:
JSL LoadCommonSprites_long
RTL
pushpc
org $868072
JSL SetBottleVendorKey : NOP #4
pullpc
SetBottleVendorKey:
LDA.w $0E20,Y : CMP.b #$E4 : BNE +
; small key from bottle vendor
LDA.b #$AF : STA.w $0E80,Y
LDA.b #$01 : STA.w !SPRITE_REDRAW, Y
BRA .shift
+ CMP.b #$DE : BEQ .return
CMP.b #$E2 : BEQ .return
; shift narrow sprite to left by 4
.shift
LDA.b $00 : CLC : ADC.b #$04 : STA.w $0D10,Y ; what we wrote over
.return
RTL
ConditionalLoadCommonSprites_Do3To4Low:
LDA.b $10 : 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
;===================================================================================================

View File

@@ -297,3 +297,4 @@ MC_Masks:
; EP TH DP PD SK TR TT MM
db $20, $20, $10, $02, $80, $08, $10, $01, $40, $04, $04, $08, $40
warnpc $8AC3B1 ; above code should not exceed the space of the code segment it is overwriting

39
msu.asm
View File

@@ -76,7 +76,7 @@
;
; Additional tracks
;
; 60 - Light World OW (after ped pull)
; 60 - Light World OW (after aga kill)
; 61 - Dark World OW (with all crystals)
;
;=======================================
@@ -237,36 +237,43 @@ CheckMusicLoadRequest:
LDA !REG_MUSIC_CONTROL_REQUEST
CMP.b #02 : BEQ .lightworld
CMP.b #04 : BEQ .no_change+1 ; bunny
CMP.b #09 : BEQ .darkworld
CMP.b #13 : BEQ .darkwoods
CMP.b #15 : BEQ .darkwoods
CMP.b #16 : BEQ .castle
CMP.b #17 : BEQ .dungeon
CMP.b #22 : BEQ .dungeon
CMP.b #21 : BNE .check_fallback
CMP.b #21 : BEQ .boss
JMP .check_fallback
;.boss
.boss
LDA $040C : LSR : !ADD.b #45
BRA .check_fallback-3
.no_change
PLA : BRA .check_fallback-3
.lightworld
PHA
LDA OverworldEventDataWRAM+$80 : AND.b #$40 : BEQ +
PLA
LDA.b #60 : BRA .check_fallback-3
LDA InvertedMode : BNE +
;LDA OverworldEventDataWRAM+$80 : AND.b #$40 : BEQ + ; ped pull
LDA ProgressIndicator : CMP.b #03 : BNE .no_change ; aga1 killed
- PLA : LDA.b #60 : BRA .check_fallback-3
+
-- : PLA : BRA .check_fallback-3
LDA CrystalsField : CMP.b #$7F : BNE .no_change
BRA -
.darkworld
PHA
LDA CrystalsField : CMP.b #$7F : BNE --
- : PLA
LDA.b #61 : BRA .check_fallback-3
LDA InvertedMode : BNE +
LDA CrystalsField : CMP.b #$7F : BNE .no_change
- PLA : LDA.b #61 : BRA .check_fallback-3
+
LDA ProgressIndicator : CMP.b #03 : BNE .no_change ; aga1 killed
BRA -
.darkwoods
PHA
LDA CrystalsField : CMP.b #$7F : BEQ -
LDA CurrentWorld : BEQ --
LDA $8A : CMP #$40 : BNE --
PLA
LDA.b #15 : BRA .check_fallback-3
LDX $8A : LDA.l OWTileWorldAssoc,X : BEQ +
PLA : BRA .darkworld
+ PLA : BRA .lightworld
.castle
LDA $040C
CMP.b #$08 : BNE .check_fallback ; Hyrule Castle 2
@@ -416,7 +423,7 @@ SpiralStairsPreCheck:
SpiralStairsPostCheck:
LDA.l DRMode : BEQ + ; if door rando enabled
LDA.b $A2 : CMP.w #$0007 : BNE .done
LDX.b #$16 : STX !REG_MUSIC_CONTROL_REQUEST
LDA.l Music_Hera : TAX : STX !REG_MUSIC_CONTROL_REQUEST
BRA .done
+ LDA $A0
CMP.w #$000C : BNE +

View File

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

263
music.asm
View File

@@ -7,73 +7,16 @@ PreOverworld_LoadProperties_ChooseMusic:
LDY.b #$58 ; death mountain animated tileset.
LDX.b #$02 ; Default light world theme
LDA $8A : ORA #$40 ; check both light and dark world DM at the same time
CMP.b #$43 : BEQ .endOfLightWorldChecks
CMP.b #$45 : BEQ .endOfLightWorldChecks
CMP.b #$47 : BEQ .endOfLightWorldChecks
CMP.b #$43 : BEQ +
CMP.b #$45 : BEQ +
CMP.b #$47 : BEQ +
LDY.b #$5A ; Main overworld animated tileset
; Skip village and lost woods checks if entering dark world or a special area
LDA $8A : CMP.b #$40 : !BGE .notVillageOrWoods
LDX.b #$07 ; Default village theme
; Check what phase we're in
;LDA ProgressIndicator : CMP.b #$03 : !BLT +
; LDX.b #$02 ; Default light world theme (phase >=3)
;+
; Check if we're entering the village
LDA $8A : 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 OverworldEventDataWRAM+$80 : AND.b #$40 : BEQ +
LDX.b #$02 ; Default light world theme
+
; check if we are entering lost woods
LDA $8A : BEQ .endOfLightWorldChecks
.notVillageOrWoods
; Use the normal overworld (light world) music
LDX.b #$02
; Check phase ; In phase >= 2
LDA 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 CurrentWorld : BEQ .checkInverted+4
LDX.b #$0F ; dark woods theme
; This music is used in dark woods
LDA $8A
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 CurrentWorld : CLC : ROL #$03 : CMP InvertedMode : BEQ .lastCheck
; Does Link have a moon pearl?
LDA MoonPearlEquipment : BNE +
LDX.b #$04 ; bunny theme
+
;LDA CurrentWorld : BEQ .checkInverted+4
+ JSL Overworld_DetermineMusic
.lastCheck
LDA $0132 : CMP.b #$F2 : BNE +
@@ -114,58 +57,12 @@ Overworld_FinishMirrorWarp:
LDA.b #$80 : STA $9B
LDX.b #$04 ; bunny theme
JSL Overworld_DetermineAmbientSFX
JSL Overworld_DetermineMusic
; if not inverted and light world, or inverted and dark world, skip moon pearl check
LDA CurrentWorld : CLC : ROL #$03 : CMP InvertedMode : BEQ +
LDA MoonPearlEquipment : BEQ .endOfLightWorldChecks
+
LDX.b #$09 ; default dark world theme
LDA $8A : CMP.b #$40 : !BGE .endOfLightWorldChecks
LDX.b #$02 ; hyrule field theme
; Check if we're entering the lost woods
CMP.b #$00 : BNE +
LDA 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
; LDA ProgressIndicator : CMP.b #$03 : !BGE .endOfLightWorldChecks
LDX.b #$07 ; Default village theme (phase <3)
.endOfLightWorldChecks
.done
STX $012C
LDA $8A : CMP.b #$40 : BNE +
LDX #$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 $012D ; set storm ambient SFX
LDX.b #$0D ; dark mountain theme
.bunny
LDA MoonPearlEquipment : ORA InvertedMode : BNE +
LDX #$04 ; bunny theme
+
STX $012C
.notDarkMountain
LDA $11 : STA $010C
STZ $11
@@ -178,78 +75,85 @@ Overworld_FinishMirrorWarp:
;--------------------------------------------------------------------------------
BirdTravel_LoadTargetAreaMusic:
; Skip village and lost woods checks if entering dark world or a special area
LDA $8A : CMP.b #$43 : BEQ .endOfLightWorldChecks
CMP.b #$40 : !BGE .notVillageOrWoods
JSL Overworld_DetermineAmbientSFX
JSL Overworld_DetermineMusic
STZ $04C8 ; Clear peg puzzle count
RTL
;--------------------------------------------------------------------------------
LDX.b #$07 ; Default village theme
;--------------------------------------------------------------------------------
;X to be set to music track to load
Overworld_DetermineMusic:
LDA ProgressIndicator : CMP.b #$02 : !BGE +
LDX.b #$03 ; If phase < 2, play the rain music
BRA .done
+ LDA $8A : CMP.b #$43 : BEQ .darkMountain
CMP.b #$45 : BEQ .darkMountain
CMP.b #$47 : BEQ .darkMountain
; Check what phase we're in
;LDA ProgressIndicator : CMP.b #$03 : !BLT +
; LDX.b #$02 ; Default light world theme (phase >=3)
;+
LDX.b #$02 ; hyrule field theme
LDA CurrentWorld : BEQ +
LDX.b #$09 ; default dark world theme
; Check if we're entering the village
LDA $8A : 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 OverworldEventDataWRAM+$80 : AND.b #$40 : BEQ +
; LDX.b #$02 ; Default light world theme
;+
; check if we are entering lost woods
LDA $8A : BEQ .endOfLightWorldChecks
.notVillageOrWoods
; Use the normal overworld (light world) music
LDX.b #$02
; Check phase ; In phase >= 2
LDA 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 CurrentWorld : BEQ .checkInverted+4
LDX.b #$09 ; dark overworld theme
LDA $8A
; Misery Mire rain SFX
CMP.b #$70 : BNE ++
LDA OverworldEventDataWRAM+$70 : AND.b #$20 : BNE ++
LDA.b #$01 : CMP $0131 : BEQ +
STA $012D
+ : BRA .checkInverted
++
; This music is used in dark death mountain
CMP.b #$43 : BEQ .darkMountain
; CMP.b #$45 : BEQ .darkMountain
; CMP.b #$47 : BEQ .darkMountain
LDA.b #$05 : STA $012D
BRA .checkInverted
+ LDA $8A : CMP.b #$18 : BNE +
; Check what phase we're in
; LDA ProgressIndicator : CMP.b #$03 : !BGE .bunny
LDX.b #$07 ; Default village theme (phase <3)
BRA .bunny
; Check if we're entering the lost woods
+ CMP.b #$00 : BNE +
LDA OverworldEventDataWRAM+$80 : AND.b #$40 : BNE .bunny
LDX.b #$05 ; lost woods theme
BRA .bunny
+ CMP.b #$40 : BNE .bunny
LDX #$0F ; dark woods theme
BRA .bunny
.darkMountain
LDA CrystalsField : CMP.b #$7F : BEQ +
LDX.b #$0D ; dark death mountain theme
+ : LDA.b #$09 : STA $012D
LDX.b #$0D ; dark mountain theme
.bunny
; if not inverted and light world, or inverted and dark world, skip moon pearl check
.checkInverted
LDA CurrentWorld : CLC : ROL #$03 : CMP InvertedMode : BEQ .lastCheck
LDA CurrentWorld : CLC : ROL #$03 : CMP InvertedMode : BEQ .done
LDA MoonPearlEquipment : BNE .done
LDX #$04 ; bunny theme
; Does Link have a moon pearl?
LDA MoonPearlEquipment : BNE +
LDX.b #$04 ; bunny theme
+
.done
RTL
;--------------------------------------------------------------------------------
.lastCheck
;--------------------------------------------------------------------------------
;$012D to be set to any ambient SFX for the area
Overworld_DetermineAmbientSFX:
LDA ProgressIndicator : CMP.b #$02 : !BGE +
BRA .done ; rain state sfx handled elsewhere
+ LDA $8A : 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 $0131 : BEQ +
STA $012D
+ STZ $012D
.done
RTL
;--------------------------------------------------------------------------------
@@ -302,10 +206,17 @@ Underworld_DoorDown_Entry:
.done
LDA $A0 : RTL
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
; Check if the boss in ToH has been defeated (16-bit accumulator)
; This is for changing to/from ToH dungeon/boss music
;
; A=16bit XY=8bit
CheckHeraBossDefeated:
LDA RoomDataWRAM[$07].high : AND.w #$00FF : BEQ +
SEC : RTL
+ CLC : RTL
FallingMusicFadeOut:
CMP.w #$0017 ; what we wrote over
BNE .return
LDA.w $0130 : AND.w #$00FF : CMP.w #$0015 ; if boss music is playing, then fade out
.return
RTL

View File

@@ -3,18 +3,24 @@ NewDrawHud:
;================================================================================
; Draw bomb count
!BOMBCOUNT_DRAW_ADDRESS = "$7EC75A"
!INFINITE_BOMBS = "$7F50C9"
;================================================================================
LDA !INFINITE_BOMBS : BNE .infinite_bombs
LDA InfiniteBombsModifier : BNE .infinite_bombs
.finite_bombs
LDA.l $7EF343 ; bombs
LDA.l SpecialWeapons : AND.b #$7F : CMP #$01 : BNE .normal
LDA.l SpecialWeaponLevel : BEQ .no_bombs
.normal
LDA.l BombsEquipment ; bombs
JSR HudHexToDec2Digit ;requires 8 bit registers!
REP #$20
LDX.b $06 : TXA : ORA.w #$2400 : STA !BOMBCOUNT_DRAW_ADDRESS ; Draw bombs 10 digit
LDX.b $07 : TXA : ORA.w #$2400 : STA !BOMBCOUNT_DRAW_ADDRESS+2 ; Draw bombs 1 digit
BRA +
.no_bombs
REP #$20
LDA.w #$207F : STA !BOMBCOUNT_DRAW_ADDRESS ; blank
STA !BOMBCOUNT_DRAW_ADDRESS+2 ; blank
BRA +
.infinite_bombs
REP #$20
LDA.w #$2431 : STA !BOMBCOUNT_DRAW_ADDRESS ; infinity (left half)
@@ -36,14 +42,13 @@ NewDrawHud:
;================================================================================
; Draw arrow count
!ARROWCOUNT_DRAW_ADDRESS = "$7EC760"
!INFINITE_ARROWS = "$7F50C8"
;================================================================================
SEP #$20
LDA.l ArrowMode : BNE +
LDA !INFINITE_ARROWS : BNE .infinite_arrows
LDA InfiniteArrowsModifier : BNE .infinite_arrows
.finite_arrows
LDA.l $7EF377 ; arrows
LDA.l CurrentArrows ; arrows
JSR HudHexToDec2Digit
REP #$20
LDX.b $06 : TXA : ORA.w #$2400 : STA !ARROWCOUNT_DRAW_ADDRESS ; Draw arrows 10 digit
@@ -168,7 +173,6 @@ NewDrawHud:
;--------------------------------------------------------------------------------
; Draw Magic Meter
!INFINITE_MAGIC = "$7F50CA"
!DrawMagicMeter_mp_tilemap = "$0DFE0F"
;--------------------------------------------------------------------------------
LDA CurrentMagic : AND #$00FF ; crap we wrote over when placing the hook for OnDrawHud
@@ -176,7 +180,7 @@ NewDrawHud:
AND #$FFF8
TAX ; end of crap
LDA !INFINITE_MAGIC : AND.w #$00FF : BNE + : JMP .green : +
LDA InfiniteMagicModifier : AND.w #$00FF : BNE + : JMP .green : +
SEP #$20 : LDA.b #$80 : STA CurrentMagic : REP #$30 ; set magic to max
LDX.w #$0080 ; load full magic meter graphics
LDA $1A : AND.w #$000C : LSR #2

View File

@@ -40,6 +40,14 @@
; #$90 - Big Keys
; #$A0 - Small Keys
; #$B0 - Bee Trap
; #$B1 - Apples
; #$B2 - Fairy
; #$B3 - Chicken
; #$B4 - Big Magic
; #$B5 - Good Bee
; #$C0 - Progressive Bomb
; #$C1 - Progressive Cane
; #$C2 - Progressive Bug Net
; #$FE - Server Request (Asychronous Chest)
; #$FF - Null Chest
;--------------------------------------------------------------------------------
@@ -69,23 +77,29 @@
;JML GetAnimatedSpriteGfxFile_return
;--------------------------------------------------------------------------------
GetAnimatedSpriteGfxFile:
CMP.b #$0C : BNE +
CMP.b #$0C : BNE +
LDY.b #$5C : JML GetAnimatedSpriteGfxFile_return
+
CMP.b #$23 : BNE +
CMP.b #$23 : BNE +
LDY.b #$5D : JML GetAnimatedSpriteGfxFile_return
+
CMP.b #$48 : BNE +
CMP.b #$48 : BNE +
LDY.b #$60 : JML GetAnimatedSpriteGfxFile_return
+
CMP.b #$4B : BNE +
LDY.b #$50 : JML GetAnimatedSpriteGfxFile_return
+
CMP.b #$4C : BNE +
LDY.b #$5E : JML GetAnimatedSpriteGfxFile_return
+
CMP.b #$24 : !BGE +
CMP.b #$24 : !BGE +
LDY.b #$5B : JML GetAnimatedSpriteGfxFile_return
+
CMP.b #$37 : !BGE +
CMP.b #$37 : !BGE +
LDY.b #$5C : JML GetAnimatedSpriteGfxFile_return
+
CMP.b #$39 : !BGE +
CMP.b #$39 : !BGE +
LDY.b #$5D : JML GetAnimatedSpriteGfxFile_return
+
LDY.b #$32
@@ -117,6 +131,9 @@ dw $09F0 ; Null-Item
dw $09C0 ; Clock
dw $0A20 ; Triforce
dw $0A50 ; Power Star
dw $09F0 ; Chicken
dw $09C0 ; Fairy ($09F0 if using uncompressed version)
dw $0988 ; Apple
GetAnimatedSpriteBufferPointer:
;PHB : PHK : PLB
@@ -166,14 +183,18 @@ ProcessEventItems:
LDA RNGItem : INC : STA RNGItem
SEP #$10 ; set 8-bit index registers
REP #$20 ; set 16-bit accumulator
REP #$20 ; set 16-bit accumulator
LDA GoalItemRequirement : BEQ ++
LDA GoalCounter : INC : STA GoalCounter
CMP GoalItemRequirement : !BLT ++
LDA TurnInGoalItems : AND.w #$00FF : BNE ++
JSL.l ActivateGoal
SEP #$20 ; set 8-bit accumulator
LDA.b $8A : CMP.b #$80 : BNE +++
LDA.b $23 : BNE +++
JSL.l ActivateGoal
+++
++
SEP #$20 ; set 8-bit accumulator
SEP #$20 ; set 8-bit accumulator
LDX.b #$01 : BRA .done
+
LDX.b #$00
@@ -265,7 +286,7 @@ AddReceivedItemExpandedGetItem:
+ CMP.b #$57 : BNE + ; Programmable Object 3
%ProgrammableItemLogic(3)
JMP .done
+ CMP.b #$58 : BNE + ; Upgrade-Only Sivler Arrows
+ CMP.b #$58 : BNE + ; Upgrade-Only Silver Arrows
LDA.l SilverArrowsUseRestriction : BNE +++
LDA.l SilverArrowsAutoEquip : AND.b #$01 : BEQ +++
LDA BowEquipment : BEQ ++ : CMP.b #$03 : !BGE ++
@@ -315,20 +336,27 @@ AddReceivedItemExpandedGetItem:
+ CMP.b #$65 : BNE + ; Progressive Bow
JMP .done
+ CMP.b #$6A : BNE + ; Goal Collectable (Single/Triforce)
JSL.l ActivateGoal
LDA.b $8A : CMP.b #$80 : BNE ++
LDA.b $23 : BNE ++
JSL.l ActivateGoal
++
JMP .done
+ CMP.b #$6B : BNE + ; Goal Collectable (Multi/Power Star)
BRA .multi_collect
+ CMP.b #$6C : BNE + ; Goal Collectable (Multi/Power Star) Alternate Graphic
.multi_collect
REP #$20 ; set 16-bit accumulator
REP #$20 ; set 16-bit accumulator
LDA.l GoalItemRequirement : BEQ ++
LDA.l GoalCounter : INC : STA.l GoalCounter
CMP.w GoalItemRequirement : !BLT ++
LDA.l TurnInGoalItems : AND.w #$00FF : BNE ++
SEP #$20 ; set 8-bit accumulator
LDA.b $8A : CMP.b #$80 : BNE +++
LDA.b $23 : BNE +++
JSL.l ActivateGoal
+++
++
SEP #$20 ; set 8-bit accumulator
SEP #$20 ; set 8-bit accumulator
JMP .done
+ CMP.b #$6D : BNE + ; Server Request F0
JSL.l ItemGetServiceRequest_F0
@@ -395,14 +423,71 @@ AddReceivedItemExpandedGetItem:
++
JMP .done
+ CMP.b #$B0 : BNE + ; Bee Trap
LDA.b #$79 : JSL Sprite_SpawnDynamically : BMI + ; DashBeeHive_SpawnBee
LDA $22 : STA $0D10, Y : LDA $23 : STA $0D30, Y ; from enemizer's Spawn_Bees
LDA.b #$79 : JSL Sprite_SpawnDynamically : BMI ++ ; DashBeeHive_SpawnBee
LDA $22 : CLC : ADC.b #$03 : AND.b #$F8 : STA $0D10,Y
LDA $23 : ADC.b #$00 : STA $0D30,Y ; round X to nearest 8
LDA $20 : STA $0D00, Y : LDA $21 : STA $0D20, Y
LDA.b $EE : STA.w $0F20,Y ; spawns on same layer as link
++ JMP .done
+ CMP.b #$B1 : BNE + ; Apples
LDA.b #$AC : JSL Sprite_SpawnDynamically : BMI ++
LDA $22 : CLC : ADC.b #$03 : AND.b #$F8 : STA $0D10,Y
LDA $23 : ADC.b #$00 : STA $0D30,Y ; round X to nearest 8
LDA.b $20 : SEC : SBC.b #$10 : STA.w $0D00,Y
LDA.b $21 : SBC.b #$00 : STA.w $0D20,Y ; move up 16 pixels
LDA.b $EE : STA.w $0F20,Y ; spawns on same layer as link
LDA.b #$FF : STA.w $0B58,Y ; allows them to expire
++ JMP .done
+ CMP.b #$B2 : BNE + ; Fairy
LDA.b #$E3 : JSL Sprite_SpawnDynamically : BMI ++
LDA $22 : CLC : ADC.b #$03 : AND.b #$F8 : STA $0D10,Y
LDA $23 : ADC.b #$00 : STA $0D30,Y ; round X to nearest 8
LDA.b $20 : SEC : SBC.b #$10 : STA.w $0D00,Y
LDA.b $21 : SBC.b #$00 : STA.w $0D20,Y ; move up 16 pixels
LDA.b $EE : STA.w $0F20,Y ; spawns on same layer as link
LDA.b #$FF : STA.w $0B58,Y ; allows them to expire
++ JMP .done
+ CMP.b #$B3 : BNE + ; Chicken
LDA.b #$0B : JSL Sprite_SpawnDynamically : BMI ++
LDA $22 : CLC : ADC.b #$03 : AND.b #$F8 : STA $0D10,Y
LDA $23 : ADC.b #$00 : STA $0D30,Y ; round X to nearest 8
LDA.b $20 : SEC : SBC.b #$08 : STA.w $0D00,Y
LDA.b $21 : SBC.b #$00 : STA.w $0D20,Y ; move up 8 pixels
LDA.b $EE : STA.w $0F20,Y ; spawns on same layer as link
++ BRA .done
+ CMP.b #$B4 : BNE + ; Big Magic
LDA.b #$80 : STA MagicFiller ; fill magic
BRA .done
+ CMP.b #$B5 : BNE + ; Good Bee
LDA.b #$79 : JSL Sprite_SpawnDynamically : BMI .done
LDA $22 : CLC : ADC.b #$03 : AND.b #$F8 : STA $0D10,Y
LDA $23 : ADC.b #$00 : STA $0D30,Y ; round X to nearest 8
LDA $20 : STA $0D00, Y : LDA $21 : STA $0D20, Y
LDA.b $EE : STA.w $0F20,Y ; spawns on same layer as link
JSL GoldBee_SpawnSelf_SetProperties
BRA .done
+ CMP.b #$C0 : BNE + ; Bomb Upgrade
LDA #$01 : STA InfiniteBombsModifier ; infinite bombs
BRA .done
+ CMP.b #$C1 : BNE + ; Cane Upgrade
LDA.l SpecialWeapons : AND.b #$7F : CMP.b #$03 : BEQ .blue_cane
CMP.b #$04 : BEQ .red_cane
BRA .done
.blue_cane
LDA #$01 : STA ByrnaEquipment
BRA .done
.red_cane
LDA #$01 : STA SomariaEquipment
BRA .done
+ CMP.b #$C2 : BNE + ; Bug Net Upgrade
LDA.b #$01 : STA BugNetEquipment
BRA .done
+
.done
PLX
LDA $02E9 : CMP.b #$01 ; thing we wrote over
RTL
;--------------------------------------------------------------------------------
; #$70 - Maps
; #$80 - Compasses
; #$90 - Big Keys
@@ -519,9 +604,9 @@ AddReceivedItemExpanded:
LDA BowEquipment : INC : LSR : CMP.l ProgressiveBowLimit : !BLT +
LDA.l ProgressiveBowReplacement : STA $02D8 : JMP .done
+ LDA BowEquipment : INC : LSR : CMP.b #$00 : BNE + ; No Bow
LDA.b #$3A : STA $02D8 : BRA .done
LDA.b #$3A : STA $02D8 : JMP .done
+ ; Any Bow
LDA.b #$3B : STA $02D8 : BRA .done
LDA.b #$3B : STA $02D8 : JMP .done
++ : CMP.b #$65 : BNE ++ ; Progressive Bow 2
LDA !MULTIWORLD_ITEM_PLAYER_ID : BNE +++
LDA.l BowTracking : ORA #$20 : STA.l BowTracking
@@ -533,49 +618,46 @@ AddReceivedItemExpanded:
JSL.l GetRNGItemSingle : STA $02D8
XBA : JSR.w MarkRNGItemSingle
LDA #$FF : STA !LOCK_IN ; clear lock-in
BRA .done
JMP .done
++ : CMP.b #$63 : BNE ++ ; RNG Item (Multi)
JSL.l GetRNGItemMulti : STA $02D8
LDA #$FF : STA !LOCK_IN ; clear lock-in
BRA .done
JMP .done
++ : CMP.b #$B0 : BNE ++ ; Bee Trap
LDA !MULTIWORLD_ITEM_PLAYER_ID : BEQ +++
LDA.b #$0E : STA $02D8 : BRA .done ; Bee in a bottle
LDA.b #$0E : STA $02D8 : JMP .done ; Bee in a bottle
+++
++
.done
PLX : PLA
PHB : PHK ; we're skipping the corresponding instructions to grab the data bank
PHB : PHK ; we're skipping the corresponding instructions to grab the data bank
JML.l AddReceivedItem+2
}
;--------------------------------------------------------------------------------
;DATA AddReceivedItemExpanded
{
; This is a temporary measure for Fish to have consistent addresses
org $A08800
.y_offsets
db -5, -5, -5, -5, -5, -4, -4, -5
db -5, -4, -4, -4, -2, -4, -4, -4
db -5, -5, -5, -5, -5, -4, -4, -5
db -5, -4, -4, -4, -2, -4, -4, -4
db -4, -4, -4, -4, -4, -4, -4, -4
db -4, -4, -4, -4, -4, -4, -4, -4
db -4, -4, -4, -4, -4, -4, -4, -4
db -4, -4, -4, -4, -4, -4, -4, -4
db -4, -4, -4, -5, -4, -4, -4, -4
db -4, -4, -2, -4, -4, -4, -4, -4
db -4, -4, -4, -5, -4, -4, -4, -4
db -4, -4, -2, -4, -4, -4, -4, -4
db -4, -4, -4, -4, -2, -2, -2, -4
db -4, -4, -4, -4, -4, -4, -4, -4
db -4, -4, -4, -4, -2, -2, -2, -4
db -4, -4, -4, -4, -4, -4, -4, -4
db -4, -4, -2, -2, -4, -2, -4, -4
db -4, -5, -4, -4
db -4, -4, -2, -2, -4, -2, -4, -4
db -4, -5, -4, -4
;new
db -4, -4, -4, -4
db -5 ; Master Sword (Safe)
db -4, -4, -4, -4 ; +5/+10 Bomb Arrows
db -4, -4, -4 ; 3x Programmable Item
db -4 ; Upgrade-Only Sivler Arrows
db -4 ; Upgrade-Only Silver Arrows
db -4 ; 1 Rupoor
db -4 ; Null Item
db -4, -4, -4 ; Red, Blue & Green Clocks
@@ -590,32 +672,40 @@ org $A08800
db -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4 ; Free Big Key
db -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4 ; Free Small Key
db -4 ; Bee Trap
db -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4 ; Unused
db -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4 ; Unused
db -4 ; Apples
db -4 ; Fairy
db -4 ; Chicken
db -4 ; Big Magic
db -4 ; Good Bee
db -4, -4, -4, -4, -4, -4, -4, -4, -4, -4 ; Unused
db -4 ; Bomb Upgrade
db -4 ; Cane Upgrade
db -4 ; Bug Net Upgrade
db -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4 ; Unused
db -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4 ; Unused
db -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4 ; Unused
.x_offsets
db 4, 4, 4, 4, 4, 0, 0, 4
db 4, 4, 4, 4, 5, 0, 0, 0
db 4, 4, 4, 4, 4, 0, 0, 4
db 4, 4, 4, 4, 5, 0, 0, 0
db 0, 0, 0, 4, 0, 4, 0, 0
db 4, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 4, 0, 4, 0, 0
db 4, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 4, 0, 0, 0
db 0, 0, 5, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 4, 0, 0, 0
db 0, 0, 5, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 4, 4, 4, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 4, 4, 4, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 4, 4, 0, 4, 0, 0
db 0, 4, 0, 0
db 0, 0, 4, 4, 0, 4, 0, 0
db 0, 4, 0, 0
;new
db 0, 0, 0, 0
db 4 ; Master Sword (Safe)
db 0, 0, 0, 0 ; +5/+10 Bomb Arrows
db 0, 0, 0 ; 3x Programmable Item
db 0 ; Upgrade-Only Sivler Arrows
db 0 ; Upgrade-Only Silver Arrows
db 4 ; 1 Rupoor
db 0 ; Null Item
db 0, 0, 0 ; Red, Blue & Green Clocks
@@ -631,33 +721,41 @@ org $A08800
;db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ; *EVENT*
db 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 ; Free Small Key
db 0 ; Bee Trap
db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ; Unused
db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ; Unused
db 0 ; Apples
db 0 ; Fairy
db 0 ; Chicken
db 4 ; Big Magic
db 0 ; Good Bee
db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ; Unused
db 0 ; Bomb Upgrade
db 4 ; Cane Upgrade
db 0 ; Bug Net Upgrade
db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ; Unused
db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ; Unused
db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ; Unused
.item_graphics_indices
db $06, $18, $18, $18, $2D, $20, $2E, $09
db $09, $0A, $08, $05, $10, $0B, $2C, $1B
db $06, $18, $18, $18, $2D, $20, $2E, $09
db $09, $0A, $08, $05, $10, $0B, $2C, $1B
db $1A, $1C, $14, $19, $0C, $07, $1D, $2F
db $07, $15, $12, $0D, $0D, $0E, $11, $17
db $1A, $1C, $14, $19, $0C, $07, $1D, $2F
db $07, $15, $12, $0D, $0D, $0E, $11, $17
db $28, $27, $04, $04, $0F, $16, $03, $13
db $01, $1E, $10, $00, $00, $00, $00, $00
db $28, $27, $04, $04, $0F, $16, $03, $13
db $01, $1E, $10, $00, $00, $00, $00, $00
db $00, $30, $22, $21, $24, $24, $24, $23
db $23, $23, $29, $2A, $2C, $2B, $03, $03
db $00, $30, $22, $21, $24, $24, $24, $23
db $23, $23, $29, $2A, $2C, $2B, $03, $03
db $34, $35, $31, $33, $02, $32, $36, $37
db $2C, $06, $0C, $38
db $34, $35, $31, $33, $02, $32, $36, $37
db $2C, $06, $0C, $38
;new
db $39, $3A, $3B, $3C
;5x
db $18 ; Master Sword (Safe)
db $3D, $3E, $3F, $40 ; +5/+10 Bomb Arrows
db $00, $00, $00 ; 3x Programmable Item
db $41 ; Upgrade-Only Sivler Arrows
db $41 ; Upgrade-Only Silver Arrows
db $24 ; 1 Rupoor
db $47 ; Null Item
db $48, $48, $48 ; Red, Blue & Green Clocks
@@ -677,32 +775,40 @@ org $A08800
;db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; *EVENT*
db $47 ; Bee Trap
db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; Unused
db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; Unused
db $47 ; Apples
db $47 ; Fairy
db $47 ; Chicken
db $3B ; Big Magic
db $47 ; Good Bee
db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; Unused
db $13 ; Bomb Upgrade
db $07 ; Cane Upgrade
db $27 ; Bug Net Upgrade
db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; Unused
db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; Unused
db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; Unused
.wide_item_flag
db $00, $00, $00, $00, $00, $02, $02, $00
db $00, $00, $00, $00, $00, $02, $02, $02
db $00, $00, $00, $00, $00, $02, $02, $00
db $00, $00, $00, $00, $00, $02, $02, $02
db $02, $02, $02, $00, $02, $00, $02, $02
db $00, $02, $02, $02, $02, $02, $02, $02
db $02, $02, $02, $00, $02, $00, $02, $02
db $00, $02, $02, $02, $02, $02, $02, $02
db $02, $02, $02, $02, $00, $02, $02, $02
db $02, $02, $00, $02, $02, $02, $02, $02
db $02, $02, $02, $02, $00, $02, $02, $02
db $02, $02, $00, $02, $02, $02, $02, $02
db $02, $02, $02, $02, $00, $00, $00, $02
db $02, $02, $02, $02, $02, $02, $02, $02
db $02, $02, $02, $02, $00, $00, $00, $02
db $02, $02, $02, $02, $02, $02, $02, $02
db $02, $02, $00, $00, $02, $00, $02, $02
db $02, $00, $02, $02
db $02, $02, $00, $00, $02, $00, $02, $02
db $02, $00, $02, $02
;new
db $02, $02, $02, $02
db $00 ; Master Sword (Safe)
db $02, $02, $02, $02 ; +5/+10 Bomb Arrows
db $02, $02, $02 ; 3x Programmable Item
db $02 ; Upgrade-Only Sivler Arrows
db $02 ; Upgrade-Only Silver Arrows
db $00 ; 1 Rupoor
db $02 ; Null Item
db $02, $02, $02 ; Red, Blue & Green Clocks
@@ -717,34 +823,41 @@ org $A08800
db $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02 ; Free Big Key
db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; Free Small Key
db $02 ; Bee Trap
db $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02 ; Unused
db $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02 ; Unused
db $02 ; Apples
db $02 ; Fairy
db $02 ; Chicken
db $00 ; Big Magic
db $02 ; Good Bee
db $02, $02, $02, $02, $02, $02, $02, $02, $02, $02 ; Unused
db $02 ; Bomb Upgrade
db $00 ; Cane Upgrade
db $02 ; Bug Net Upgrade
db $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02 ; Unused
db $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02 ; Unused
db $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02 ; Unused
db $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02 ; Unused
.properties
db 5, -1, 5, 5, 5, 5, 5, 1
db 2, 1, 1, 1, 2, 2, 2, 4
db 5, -1, 5, 5, 5, 5, 5, 1
db 2, 1, 1, 1, 2, 2, 2, 4
db 4, 4, 1, 1, 2, 1, 1, 1
db 2, 1, 2, 1, 4, 4, 2, 1
db 4, 4, 1, 1, 2, 1, 1, 1
db 2, 1, 2, 1, 4, 4, 2, 1
db 6, 1, 2, 1, 2, 2, 1, 2
db 2, 4, 1, 1, 4, 2, 1, 4
db 6, 1, 2, 1, 2, 2, 1, 2
db 2, 4, 1, 1, 4, 2, 1, 4
db 2, 2, 4, 4, 4, 2, 1, 4
db 1, 2, 2, 1, 2, 2, 1, 1
db 2, 2, 4, 4, 4, 2, 1, 4
db 1, 2, 2, 1, 2, 2, 1, 1
db 4, 4, 1, 2, 2, 4, 4, 4
db 2, 5, 2, 1
db 4, 4, 1, 2, 2, 4, 4, 4
db 2, 5, 2, 1
;new
db 4, 4, 4, 4
db 5 ; Master Sword (Safe)
db 4, 4, 4, 4 ; +5/+10 Bomb Arrows
db 4, 4, 4 ; 3x Programmable Item
db 1 ; Upgrade-Only Sivler Arrows
db 1 ; Upgrade-Only Silver Arrows
db 3 ; 1 Rupoor
db 1 ; Null Item
db 1, 2, 4 ; Red, Blue & Green Clocks
@@ -759,28 +872,36 @@ org $A08800
db 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 ; Free Big Key
db 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 ; Free Small Key
db 1 ; Bee Trap
db 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 ; Unused
db 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 ; Unused
db 1 ; Apples
db 1 ; Fairy
db 1 ; Chicken
db 4 ; Big Magic
db 1 ; Good Bee
db 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 ; Unused
db 5 ; Bomb Upgrade
db 5 ; Cane Upgrade
db 1 ; Bug Net Upgrade
db 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 ; Unused
db 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 ; Unused
db 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 ; Unused
db 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 ; Unused
; \item Target SRAM addresses for items you receive
.item_target_addr
dw $F359, $F359, $F359, $F359, $F35A, $F35A, $F35A, $F345
dw $F346, $F34B, $F342, $F340, $F341, $F344, $F35C, $F347
dw $F359, $F359, $F359, $F359, $F35A, $F35A, $F35A, $F345
dw $F346, $F34B, $F342, $F340, $F341, $F344, $F35C, $F347
dw $F348, $F349, $F34A, $F34C, $F34C, $F350, $F35C, $F36B
dw $F351, $F352, $F353, $F354, $F354, $F34E, $F356, $F357
dw $F348, $F349, $F34A, $F34C, $F34C, $F350, $F35C, $F36B
dw $F351, $F352, $F353, $F354, $F354, $F34E, $F356, $F357
dw $F37A, $F34D, $F35B, $F35B, $F36F, $F364, $F36C, $F375
dw $F375, $F344, $F341, $F35C, $F35C, $F35C, $F36D, $F36E
dw $F37A, $F34D, $F35B, $F35B, $F36F, $F364, $F36C, $F375
dw $F375, $F344, $F341, $F35C, $F35C, $F35C, $F36D, $F36E
dw $F36E, $F375, $F366, $F368, $F360, $F360, $F360, $F374
dw $F374, $F374, $F340, $F340, $F35C, $F35C, $F36C, $F36C
dw $F36E, $F375, $F366, $F368, $F360, $F360, $F360, $F374
dw $F374, $F374, $F340, $F340, $F35C, $F35C, $F36C, $F36C
dw $F360, $F360, $F372, $F376, $F376, $F373, $F360, $F360
dw $F35C, $F359, $F34C, $F355
dw $F360, $F360, $F372, $F376, $F376, $F373, $F360, $F360
dw $F35C, $F359, $F34C, $F355
;new
dw $F375, $F376, $F373, $F373
dw $F359 ; Master Sword (Safe)
@@ -801,8 +922,16 @@ org $A08800
dw $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A ; Free Big Key
dw $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A ; Free Small Key
dw $F36A ; Bee Trap
dw $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A ; Unused
dw $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A ; Unused
dw $F36A ; Apples
dw $F36A ; Fairy
dw $F36A ; Chicken
dw $F373 ; Big Magic
dw $F36A ; Good Bee
dw $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A ; Unused
dw $F38F ; Bomb Upgrade
dw $F38F ; Cane Upgrade
dw $F38F ; Bug Net Upgrade
dw $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A ; Unused
dw $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A ; Unused
dw $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A ; Unused
dw $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A ; Unused
@@ -811,26 +940,26 @@ org $A08800
; DATA Values to write to the above SRAM locations.
{
.item_values
db $01, $02, $03, $04, $01, $02, $03, $01
db $01, $01, $01, $01, $01, $02, $FF, $01
db $01, $02, $03, $04, $01, $02, $03, $01
db $01, $01, $01, $01, $01, $02, $FF, $01
db $01, $01, $01, $01, $02, $01, $FF, $FF
db $01, $01, $02, $01, $02, $01, $01, $01
db $01, $01, $01, $01, $02, $01, $FF, $FF
db $01, $01, $02, $01, $02, $01, $01, $01
db $FF, $01, $FF, $02, $FF, $FF, $FF, $FF
db $FF, $FF, $02, $FF, $FF, $FF, $FF, $FF
db $FF, $01, $FF, $02, $FF, $FF, $FF, $FF
db $FF, $FF, $02, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FB, $EC, $FF
db $FF, $FF, $01, $03, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FB, $EC, $FF
db $FF, $FF, $01, $03, $FF, $FF, $FF, $FF
db $9C, $CE, $FF, $01, $0A, $FF, $FF, $FF
db $FF, $01, $03, $01
db $9C, $CE, $FF, $01, $0A, $FF, $FF, $FF
db $FF, $01, $03, $01
;new
db $32, $46, $80, $80
db $02 ; Master Sword (Safe)
db $FF, $FF, $FF, $FF ; +5/+10 Bomb Arrows
db $FF, $FF, $FF ; 3x Programmable Item
db $FF ; Upgrade-Only Sivler Arrows
db $FF ; Upgrade-Only Silver Arrows
db $FF ; 1 Rupoor
db $FF ; Null Item
db $FF, $FF, $FF ; Red, Blue & Green Clocks
@@ -845,72 +974,80 @@ org $A08800
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; Free Big Key
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; Free Small Key
db $FF ; Bee Trap
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; Unused
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; Unused
db $FF ; Apples
db $FF ; Fairy
db $FF ; Chicken
db $80 ; Big Magic
db $FF ; Good Bee
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; Unused
db $FF ; Bomb Upgrade
db $FF ; Cane Upgrade
db $FF ; Bug Net Upgrade
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; Unused
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; Unused
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; Unused
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; Unused
;0x00 - Sewer Passage
;0x02 - Hyrule Castle
;0x04 - Eastern Palace
;0x06 - Desert Palace
;0x08 - Hyrule Castle 2
;0x0A - Swamp Palace
;0x0C - Dark Palace
;0x0E - Misery Mire
;0x10 - Skull Woods
;0x12 - Ice Palace
;0x14 - Tower of Hera
;0x16 - Gargoyle's Domain
;0x18 - Turtle Rock
;0x1A - Ganon's Tower
;0x00 - Sewer Passage
;0x02 - Hyrule Castle
;0x04 - Eastern Palace
;0x06 - Desert Palace
;0x08 - Hyrule Castle 2
;0x0A - Swamp Palace
;0x0C - Dark Palace
;0x0E - Misery Mire
;0x10 - Skull Woods
;0x12 - Ice Palace
;0x14 - Tower of Hera
;0x16 - Gargoyle's Domain
;0x18 - Turtle Rock
;0x1A - Ganon's Tower
.item_masks ; these are dungeon correlations to $7EF364 - $7EF369 so it knows where to store compasses, etc
; sewers and castle get 2 bits active so that they can share their items elegantly
dw $C000, $C000, $2000, $1000, $0800, $0400, $0200, $0100
dw $0080, $0040, $0020, $0010, $0008, $0004, $4B8B, $20AB ; last two can be re-used
; sewers and castle get 2 bits active so that they can share their items elegantly
dw $C000, $C000, $2000, $1000, $0800, $0400, $0200, $0100
dw $0080, $0040, $0020, $0010, $0008, $0004, $4B8B, $20AB ; last two can be re-used
; caves
dw $9CCE, $0390, $2F82, $AD03, $02E9, $01C9, $06D0, $72A5
dw $A548, $4873, $01A0, $D8AD, $C902, $D020, $A002, $9802
dw $E48D, $DA02, $D8AC, $D002, $A215, $BD08, $84E2, $0085
dw $E3BD, $8584, $A901, $857E, $B902, $857A, $0087, $0A98
dw $BDAA, $84E2, $0085, $E3BD, $8584, $A901, $857E, $B902
dw $857A, $0230, $0087, $1FC0, $02D0, $5664, $04A9, $4BC0
dw $06F0, $1EC0, $0AD0, $02A9, $790F, $7EF3, $798F, $7EF3
dw $1BC0, $04F0, $1CC0, $07D0, $1B22, $1BEE, $0182, $A201
dw $C004, $F037, $A20C, $C001, $F038, $A206, $C002, $D039
dw $8A14, $0007, $0087, $00EE, $2902, $C907, $D007, $A906
dw $8F04, $F3C7, $C07E, $D022, $A70A, $D000, $A904, $8701
dw $8000, $C0C9, $F025, $C008, $F032, $C004, $D033, $AE11
dw $040C, $20C2, $C6BD, $0785, $8700, $E200, $8220, $00B0
dw $3EC0, $0AD0, $082C, $1003, $A905, $8D02, $0309, $20C0
dw $44D0
; caves
dw $9CCE, $0390, $2F82, $AD03, $02E9, $01C9, $06D0, $72A5
dw $A548, $4873, $01A0, $D8AD, $C902, $D020, $A002, $9802
dw $E48D, $DA02, $D8AC, $D002, $A215, $BD08, $84E2, $0085
dw $E3BD, $8584, $A901, $857E, $B902, $857A, $0087, $0A98
dw $BDAA, $84E2, $0085, $E3BD, $8584, $A901, $857E, $B902
dw $857A, $0230, $0087, $1FC0, $02D0, $5664, $04A9, $4BC0
dw $06F0, $1EC0, $0AD0, $02A9, $790F, $7EF3, $798F, $7EF3
dw $1BC0, $04F0, $1CC0, $07D0, $1B22, $1BEE, $0182, $A201
dw $C004, $F037, $A20C, $C001, $F038, $A206, $C002, $D039
dw $8A14, $0007, $0087, $00EE, $2902, $C907, $D007, $A906
dw $8F04, $F3C7, $C07E, $D022, $A70A, $D000, $A904, $8701
dw $8000, $C0C9, $F025, $C008, $F032, $C004, $D033, $AE11
dw $040C, $20C2, $C6BD, $0785, $8700, $E200, $8220, $00B0
dw $3EC0, $0AD0, $082C, $1003, $A905, $8D02, $0309, $20C0
dw $44D0
}
;--------------------------------------------------------------------------------
BottleListExpanded:
db $16, $2B, $2C, $2D, $3D, $3C, $48
db $16, $2B, $2C, $2D, $3D, $3C, $48
PotionListExpanded:
db $2E, $2F, $30, $FF, $0E
db $2E, $2F, $30, $FF, $0E
;--------------------------------------------------------------------------------
Link_ReceiveItemAlternatesExpanded:
{
db -1, -1, -1, -1, -1, -1, -1, -1
db -1, -1, -1, -1, -1, -1, -1, -1 ; db -1, -1, -1, -1, $44, -1, -1, -1
db -1, -1, -1, -1, -1, -1, -1, -1
db -1, -1, -1, -1, -1, -1, -1, -1 ; db -1, -1, -1, -1, $44, -1, -1, -1
db -1, -1, $35, -1, -1, -1, -1, -1
db -1, -1, -1, -1, -1, -1, -1, -1
db -1, -1, $35, -1, -1, -1, -1, -1
db -1, -1, -1, -1, -1, -1, -1, -1
db -1, -1, -1, -1, -1, -1, -1, -1
db -1, -1, -1, -1, -1, -1, -1, -1 ; db -1, -1, $46, -1, -1, -1, -1, -1
db -1, -1, -1, -1, -1, -1, -1, -1
db -1, -1, -1, -1, -1, -1, -1, -1 ; db -1, -1, $46, -1, -1, -1, -1, -1
db -1, -1, -1, -1, -1, -1, -1, -1
db -1, -1, -1, -1, -1, -1, -1, -1
db -1, -1, -1, -1, -1, -1, -1, -1
db -1, -1, -1, -1, -1, -1, -1, -1
db -1, -1, -1, -1, -1, -1, -1, -1
db -1, -1, -1, -1
db -1, -1, -1, -1, -1, -1, -1, -1
db -1, -1, -1, -1
db -1, -1, -1, -1
db -1 ; Master Sword (Safe)
@@ -931,8 +1068,16 @@ Link_ReceiveItemAlternatesExpanded:
db -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ; Free Big Key
db -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ; Free Small Key
db -1 ; Bee Trap
db -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ; Unused
db -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ; Unused
db -1 ; Apples
db -1 ; Fairy
db -1 ; Chicken
db -1 ; Big Magic
db -1 ; Good Bee
db -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ; Unused
db -1 ; Bomb Upgrade
db -1 ; Cane Upgrade
db -1 ; Bug Net Upgrade
db -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ; Unused
db -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ; Unused
db -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ; Unused
db -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ; Unused
@@ -957,10 +1102,10 @@ RTL
;DrawHUDSilverArrows:
; LDA BowEquipment : AND.w #$00FF : BNE +
; LDA BowTracking : AND.w #$0040 : BEQ +
; LDA.w #$2810 : STA $11C8
; LDA.w #$2811 : STA $11CA
; LDA.w #$2820 : STA $1208
; LDA.w #$2821 : STA $120A
; LDA.w #$2810 : STA $11C8
; LDA.w #$2811 : STA $11CA
; LDA.w #$2820 : STA $1208
; LDA.w #$2821 : STA $120A
; +
; LDA.w #$11CE : STA $00 ; thing we wrote over
;RTL
@@ -1140,76 +1285,97 @@ AttemptItemSubstitution:
RTS
;--------------------------------------------------------------------------------
CountBottles:
PHX
LDX.b #$00
LDA BottleContentsOne : BEQ ++ : INX
++ : LDA BottleContentsTwo : BEQ ++ : INX
++ : LDA BottleContentsThree : BEQ ++ : INX
++ : LDA BottleContentsFour : BEQ ++ : INX
++
TXA
PLX
PHX
LDX.b #$00
LDA BottleContentsOne : BEQ ++ : INX
++ : LDA BottleContentsTwo : BEQ ++ : INX
++ : LDA BottleContentsThree : BEQ ++ : INX
++ : LDA BottleContentsFour : BEQ ++ : INX
++
TXA
PLX
RTS
;--------------------------------------------------------------------------------
ActivateGoal:
STZ $11
STZ $B0
STZ $11
STZ $B0
JML.l StatsFinalPrep
;--------------------------------------------------------------------------------
ChestPrep:
LDA.b #$01 : STA $02E9
JSL.l IncrementChestCounter
JSL.l IncrementChestCounter
LDA.l ServerRequestMode : BEQ +
JSL.l ChestItemServiceRequest
RTL
+
LDY $0C ; get item value
LDY $0C ; get item value
SEC
RTL
;--------------------------------------------------------------------------------
Ancilla22_ItemReceipt_ContinueB:
CMP.b #$6A : BNE .return
JSL ActivateTriforceCutscene
.return
STZ.w $0C4A,X : STZ.w $0FC1 ; what we wrote over
RTL
;--------------------------------------------------------------------------------
; Set a flag in SRAM if we pick up a compass in its own dungeon with HUD compass
; counts on
MaybeFlagCompassTotalPickup:
LDA.l CompassMode : AND.b #$0F : BEQ .done
LDA $040C : CMP #$FF : BEQ .done
LSR : STA $04 : LDA #$0F : !SUB $04 ; Compute flag "index"
CPY #$25 : BEQ .setFlag ; Set flag if it's a compass for this dungeon
STA $04
TYA : AND #$0F : CMP $04 : BNE .done ; Check if compass is for this dungeon
.setFlag
CMP #$08 : !BGE ++
%ValueShift()
ORA CompassCountDisplay : STA CompassCountDisplay
BRA .done
++
!SUB #$08
%ValueShift()
BIT.b #$C0 : BEQ + : LDA.b #$C0 : + ; Make Hyrule Castle / Sewers Count for Both
ORA CompassCountDisplay+1 : STA CompassCountDisplay+1
.done
LDA.l CompassMode : AND.b #$0F : BEQ .done
LDA $040C : CMP #$FF : BEQ .done
LSR : STA $04 : LDA #$0F : !SUB $04 ; Compute flag "index"
CPY #$25 : BEQ .setFlag ; Set flag if it's a compass for this dungeon
STA $04
TYA : AND #$0F : CMP $04 : BNE .done ; Check if compass is for this dungeon
.setFlag
CMP #$08 : !BGE ++
%ValueShift()
ORA CompassCountDisplay : STA CompassCountDisplay
BRA .done
++
!SUB #$08
%ValueShift()
BIT.b #$C0 : BEQ + : LDA.b #$C0 : + ; Make Hyrule Castle / Sewers Count for Both
ORA CompassCountDisplay+1 : STA CompassCountDisplay+1
.done
RTL
;--------------------------------------------------------------------------------
; Set the compass count display flag if we're entering a dungeon and alerady have
; that compass
MaybeFlagCompassTotalEntrance:
LDX $040C : CPX #$FF : BEQ .done ; Skip if we're not entering dungeon
LDA.l CompassMode : AND.w #$000F : BEQ .done ; Skip if we're not showing compass counts
CMP.w #$0002 : BEQ .countShown
LDA CompassField : AND.l DungeonItemMasks, X : BEQ .done ; skip if we don't have compass
.countShown
SEP #$20
TXA : LSR : STA.b $04 : LDA.b #$0F : !SUB $04 ; Compute flag "index"
CMP #$08 : !BGE ++
%ValueShift()
ORA CompassCountDisplay : STA CompassCountDisplay
REP #$20
BRA .done
++
!SUB #$08
%ValueShift()
BIT.b #$C0 : BEQ + : LDA.b #$C0 : + ; Make Hyrule Castle / Sewers Count for Both
ORA CompassCountDisplay+1 : STA CompassCountDisplay+1
REP #$20
.done
LDX $040C : CPX #$FF : BEQ .done ; Skip if we're not entering dungeon
LDA.l CompassMode : AND.w #$000F : BEQ .done ; Skip if we're not showing compass counts
CMP.w #$0002 : BEQ .countShown
LDA CompassField : AND.l DungeonItemMasks, X : BEQ .done ; skip if we don't have compass
.countShown
SEP #$20
TXA : LSR : STA.b $04 : LDA.b #$0F : !SUB $04 ; Compute flag "index"
CMP #$08 : !BGE ++
%ValueShift()
ORA CompassCountDisplay : STA CompassCountDisplay
REP #$20
BRA .done
++
!SUB #$08
%ValueShift()
BIT.b #$C0 : BEQ + : LDA.b #$C0 : + ; Make Hyrule Castle / Sewers Count for Both
ORA CompassCountDisplay+1 : STA CompassCountDisplay+1
REP #$20
.done
RTL
;--------------------------------------------------------------------------------
LoadReceivedItemExpandedProperties:
CPX.b #$C0 : BEQ .bomb_upgrade
LDA.l AddReceivedItemExpanded_properties, X ; load from table
RTL
.bomb_upgrade
LDA SpecialWeaponLevel
CMP.b #$01 : BNE + ; L1 Bombs
LDA.b #4 : RTL
+ : CMP.b #$02 : BNE + ; L2 Bombs
LDA.b #2 : RTL
+ : CMP.b #$03 : BNE + ; L3 Bombs
LDA.b #1 : RTL
+ ; Everything Else
LDA.b #5 : RTL

1788
owrando.asm Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -33,6 +33,7 @@ QuickSwap:
CPX.b #$01 : BEQ + ; bow
CPX.b #$05 : BEQ + ; powder
CPX.b #$0D : BEQ + ; flute
CPX.b #$0E : BEQ + ; bug net
CPX.b #$10 : BEQ + ; bottle
BRA .store
+ STX $0202 : JSL ProcessMenuButtons_y_pressed

View File

@@ -1,6 +1,5 @@
!INFINITE_BOMBS = "$7F50C9"
IsItemAvailable:
LDA !INFINITE_BOMBS : BEQ .finite
LDA InfiniteBombsModifier : BEQ .finite
.infinite
CPX.b #$04 : BNE .finite
LDA.b #$01 : RTL
@@ -8,34 +7,39 @@ IsItemAvailable:
LDA EquipmentWRAM-1, X
RTL
LoadBombCount:
LDA !INFINITE_BOMBS : BNE .infinite
LDA InfiniteBombsModifier : BNE .infinite
.finite
LDA BombsEquipment
.infinite
RTL
LoadBombCount16:
LDA !INFINITE_BOMBS : AND.w #$00FF : BNE .infinite
LDA InfiniteBombsModifier : AND.w #$00FF : BNE .infinite
.finite
LDA BombsEquipment
.infinite
RTL
StoreBombCount:
PHA : LDA !INFINITE_BOMBS : BEQ .finite
JSL IncrementBombsPlacedCounter
PHA : LDA InfiniteBombsModifier : BEQ .finite
.infinite
PLA : LDA.b #$01 : RTL
.finite
PLA : STA BombsEquipment
PLA : STA.l BombsEquipment
BNE .done
LDA.l ItemOnB : CMP #$04 : BNE .done
LDA.b #$00 : STA.l ItemOnB
.done
LDA.l BombsEquipment
RTL
SearchForEquippedItem:
LDA !INFINITE_BOMBS : BEQ +
LDA InfiniteBombsModifier : BEQ +
LDA.b #$01 : LDX.b #$00 : RTL
+
LDA BowEquipment ; thing we wrote over
RTL
!INFINITE_ARROWS = "$7F50C8"
DecrementArrows:
LDA !INFINITE_ARROWS : BNE .infinite
LDA InfiniteArrowsModifier : BNE .infinite
LDA.l ArrowMode : BNE .rupees : BRA .normal
.infinite
LDA.b #$01 : RTL

View File

@@ -111,6 +111,10 @@ RTL
;--------------------------------------------------------------------------------
!RNG_POINTERS = "$7F5200"
GetStaticRNG:
LDA.l SeededRNG : BNE .seeded
JML GetRandomInt
RTL
.seeded
PHX : PHP
REP #$30 ; set 16-bit accumulator and index registers
AND.w #$000F

View File

@@ -340,22 +340,22 @@ org $1BD1DD : db #$A4, #$06, #$82, #$9E, #$06, #$82, #$FF, #$FF ;new data for ma
;;move pyramid exit overworld door
org $1BB96F+$35+$35 : dw $001b
org $1BBA71+$35+$35 : dw $06a4
org $1BBA71+$35+$35 : dw $011c
org $1BBB73+$35 : db $36
org $02DAEE+$37+$37 : dw $0010
org $02DB8C+$37 : db $1B
org $02DBDB+$37+$37 : dw $0418
org $02DC79+$37+$37 : dw $0679
org $02DD17+$37+$37 : dw $06b4
org $02DDB5+$37+$37 : dw $06c6
org $02DE53+$37+$37 : dw $0728
org $02DEF1+$37+$37 : dw $06e6
org $02DF8F+$37+$37 : dw $0733
org $02E02D+$37 : db $07
org $02E07C+$37 : db $f9
org $02DBDB+$37+$37 : dw $000e
org $02DC79+$37+$37 : dw $0600
org $02DD17+$37+$37 : dw $0676
org $02DDB5+$37+$37 : dw $0604
org $02DE53+$37+$37 : dw $06e8
org $02DEF1+$37+$37 : dw $066d
org $02DF8F+$37+$37 : dw $06f3
org $02E02D+$37 : db $00
org $02E07C+$37 : db $0a
org $02E0CB+$37+$37 : dw $0000
org $02E169+$37+$37 : dw $0000
org $02E169+$37+$37 : dw $811c
;org $02E849 ; Fly 1 to Sanctuary

View File

@@ -4,7 +4,6 @@
;--------------------------------------------------------------------------------
!BIGRAM = "$7EC900";
;--------------------------------------------------------------------------------
!SPRITE_OAM = "$7EC025"
; A = Tile ID
macro UploadOAM(dest)
PHA : PHP
@@ -770,8 +769,6 @@ RTS
;--------------------------------------------------------------------------------
;!SHOP_TYPE = "$7F5051"
;!SHOP_INVENTORY = "$7F5052"
!SPRITE_OAM = "$7EC025"
!REDRAW = "$7F5000"
Shopkeeper_DrawItems:
PHB : PHK : PLB
PHX : PHY
@@ -787,14 +784,6 @@ Shopkeeper_DrawItems:
+ CMP.b #$01 : BNE + : ++
JSR.w Shopkeeper_DrawNextItem
+
LDA $A0 : CMP.b #$09 : BNE + ; render powder slot if potion shop
LDA !REDRAW : BNE + ; if not redrawing
LDA $02DA : BNE + ; if not buying item
LDA $7F505E : BEQ + ; if potion slot filled
LDA $0ABF : BEQ + ; haven't left the room
LDA NpcFlags+1 : AND.b #$20 : BNE +
LDX.b #$0C : LDY.b #$03 : JSR.w Shopkeeper_DrawNextItem
+
PLY : PLX
PLB
RTS
@@ -820,14 +809,59 @@ Shopkeeper_DrawNextItem:
SEP #$20 ; set 8-bit accumulator
PLY
STZ $0E ; $0E will be used temporarily to store a non-zero value if VRAM slot is in OAM1
PHX : LDA #0 : XBA : TXA : LSR #2 : TAX : LDA.l !SHOP_INVENTORY_DISGUISE, X : PLX : CMP #$0 : BNE ++
LDA.l !SHOP_INVENTORY, X ; get item palette
LDA.l !SHOP_INVENTORY, X
++
CMP.b #$2E : BNE + : BRA .potion
+ CMP.b #$2F : BNE + : BRA .potion
+ CMP.b #$30 : BEQ .potion
CMP.b #$2E : BNE + : JMP .potion
+ CMP.b #$2F : BNE + : JMP .potion
+ CMP.b #$30 : BNE + : JMP .potion
+ CMP.b #$B1 : BNE + : BRA .apple
+ CMP.b #$B2 : BNE + : BRA .fairy
+ CMP.b #$B5 : BNE + : BRA .goodbee
+ CMP.b #$34 : BCC + : CMP.b #$36+1 : BCS +
BRA .rupee
+
.normal
LDA.w .tile_indices, Y : BRA + ; get item gfx index
.rupee
LDA.b #$0B ; rupee is #$0B because it's already there in VRAM
STA.b $0E
BRA .vramLoc
.fairy
REP #$20
LDA.b $1A : SEC : SBC.w #$10 : AND.w #$0020 : BEQ ++ ; alternate every 32 frames
LDA.l !SPRITE_OAM+2 : SEC : SBC.w #$02 ; move fairy up 2 pixels
STA.l !SPRITE_OAM+2
++
SEP #$20
LDA.b $1A : AND.b #$20 : BEQ ++ ; alternate every 32 frames
LDA.b #$EC ; use other fairy GFX
STA.b $0E
BRA .vramLoc
++
LDA.b #$EA ; fairy is #$EA/EC because it's already there in VRAM
STA.b $0E
BRA .vramLoc
.goodbee
REP #$20
LDA.b $1A : SEC : SBC.w #$10 : AND.w #$0020 : BEQ ++ ; alternate every 32 frames
LDA.l !SPRITE_OAM+2 : SEC : SBC.w #$02 ; move bee up 2 pixels
STA.l !SPRITE_OAM+2
++
SEP #$20
LDA.b $1A : AND.b #$20 : BEQ ++ ; alternate every 32 frames
LDA.b #$D4 ; use other bee GFX
STA.b $0E
BRA .vramLoc
++
LDA.b #$E4 ; good bee is #$E4/D4 because it's already there in VRAM
STA.b $0E
BRA .vramLoc
.apple
LDA.b #$E5 ; apple is #$E5 because it's already there in VRAM
STA.b $0E
BRA .vramLoc
.potion
LDA.b #$C0 ; potion is #$C0 because it's already there in VRAM
+
@@ -839,6 +873,7 @@ Shopkeeper_DrawNextItem:
XBA
AND #$FE
.vramLoc
STA.l !SPRITE_OAM+4
PHX : LDA #0 : XBA : TXA : LSR #2 : TAX : LDA.l !SHOP_INVENTORY_DISGUISE, X : PLX : CMP #$0 : BNE ++
@@ -846,11 +881,13 @@ Shopkeeper_DrawNextItem:
++
JSL.l GetSpritePalette : STA.l !SPRITE_OAM+5
LDA.w .tile_indices, Y : AND.b #$01 : BEQ +; get tile index sheet
LDA.b $0E : BNE .oam1 ; item uses VRAM in OAM1
LDA.w .tile_indices, Y : AND.b #$01 : BEQ ++ ; get tile index sheet
.oam1
LDA.l !SPRITE_OAM+5
ORA.b #$1
STA.l !SPRITE_OAM+5
+
++
LDA.b #$00 : STA.l !SPRITE_OAM+6
@@ -867,6 +904,10 @@ Shopkeeper_DrawNextItem:
LDA.b #$00
STA.l !SPRITE_OAM+7
JSR.w PrepNarrowLower
LDA.b $0E : AND.b #$0F : CMP.b #$04 : BNE +
; special exception for bee gfx, need top tile to be blank
LDA.b #$7C : STA.l !SPRITE_OAM+4
+
LDA.b #$02
++
PHX : PHA : LDA !SCRATCH_TEMP_X : TAX : PLA : JSR.w RequestItemOAM : PLX

600
special_weapons.asm Normal file
View File

@@ -0,0 +1,600 @@
;--------------------------------------------------------------------------------
!ANCILLA_DAMAGE = "$06EC84"
; start with X = sprite index, A = ancilla type index
;--------------------------------------------------------------------------------
DamageClassCalc:
PHA
LDA GanonVulnerabilityItem : BEQ +
LDA $0E20, X : CMP #$D7 : BNE +
PLA
JSL Ganon_CheckAncillaVulnerability
RTL
+
LDA SpecialWeapons : AND.b #$7F : CMP #$06 : BEQ .cane_immune ; only crystal switches in bee mode
PLA
CMP #$01 : BEQ .red_cane
CMP #$2C : BEQ .red_cane
CMP #$31 : BEQ .blue_cane
CMP #$0C : BEQ .beam
BRA .not_cane_or_beam
.red_cane
PHA
LDA SpecialWeapons : AND.b #$7F : CMP.b #$04 : BEQ .special_cane
CMP.b #$05 : BEQ .special_cane
LDA SpecialWeapons : AND.b #$80 : BNE .cane_immune
BRA .normal
.blue_cane
PHA
LDA SpecialWeapons : AND.b #$7F : CMP.b #$03 : BEQ .special_cane
CMP.b #$05 : BEQ .special_cane
LDA SpecialWeapons : AND.b #$80 : BNE .cane_immune
BRA .normal
.cane_immune
LDA $0E20, X : CMP.b #$1E : BEQ .normal ; crystal switch
PLA
BRA .impervious
.special_cane
PLA
LDA $0E20, X : CMP.b #$D6 : BEQ .unstunned_ganon
CMP.b #$88 : BEQ .mothula
BRA .special_level
.impervious
LDA #$FF
RTL
.beam
PHA
LDA SpecialWeapons : AND.b #$7F : CMP.b #$02 : BNE .normal
PLA
LDA #$05
RTL
.normal
PLA
.not_cane_or_beam
CMP #$07 : BNE .no_change
LDA SpecialWeapons : AND.b #$7F : CMP #$01 : BNE .normal_bombs
LDA SpecialWeaponLevel : BEQ .normal_bombs
LDA $0E20, X : CMP.b #$D6 : BEQ .unstunned_ganon
CMP.b #$D7 : BEQ .stunned_ganon
CMP.b #$88 : BEQ .mothula
CMP.b #$91 : BEQ .stalfos_knight
CMP.b #$92 : BEQ .helmasaur_king
.special_level
LDA SpecialWeaponLevel
BRA .done
.mothula
LDA SpecialWeaponLevel
CMP #$04 : !BGE .fix_mothula
BRA .done
.fix_mothula
LDA #$03
BRA .done
.stalfos_knight
LDA !StalfosBombDamage : BEQ .special_level
LDA #$08
BRA .done
.helmasaur_king
LDA $0DB0, X : CMP #$03 : !BGE .special_level
LDA #$08
BRA .done
.unstunned_ganon
LDA $04C5 : CMP.b #$02 : BNE .impervious
LDA $0EE0, X : BNE .impervious
LDA #$34 : STA $0EE0, X ; give the poor pig some iframes
BRA .special_level
.stunned_ganon
LDA $0EE0, X : BNE .impervious
LDA #$34 : STA $0EE0, X ; give the poor pig some iframes
LDA #$20 : STA $0F10, X ; knock ganon back or something? idk
LDA #$09
BRA .done
.normal_bombs
LDA #$07
.no_change
PHX : TAX
LDA.l !ANCILLA_DAMAGE, X
PLX
CMP.b #$06 : BNE .done ; not arrows
LDA BowEquipment : CMP.b #$03 : !BGE .actual_silver_arrows
.normal_arrows
LDA #$06
.done
RTL
.actual_silver_arrows
LDA $0E20, X : CMP.b #$D7 : BNE +
LDA SpecialWeapons : AND.b #$7F : CMP #$01 : BEQ .normal_arrows
LDA #$20 : STA $0F10, X
+
LDA #$09
RTL
; end with X = sprite index, A = damage class
;--------------------------------------------------------------------------------
!SPRITE_SETUP_HIT_BOX_LONG = "$0683EA"
!UTILITY_CHECK_IF_HIT_BOXES_OVERLAP_LONG = "$0683E6"
; start with X = ancilla index, Y = sprite index
;--------------------------------------------------------------------------------
Utility_CheckAncillaOverlapWithSprite:
LDA $0E20, Y : CMP #$09 : BEQ .giant_moldorm
CMP #$CB : BEQ .trinexx
.not_giant_moldorm ; ordinary collision checking
PHY : PHX
TYX
JSL !SPRITE_SETUP_HIT_BOX_LONG
PLX : PLY
JSL !UTILITY_CHECK_IF_HIT_BOXES_OVERLAP_LONG
RTL
.giant_moldorm
LDA.w $0E10, Y : BNE .ignore_collision ; Moldy can have little a I-Frames, as a treat
LDA.l SpecialWeapons : AND.b #$7F : CMP.b #$01 : BNE ++
LDA.w $0C4A, X : CMP.b #$07 : BEQ .check_collision_moldorm
BRA .ignore_collision ; don't collide with non-bombs
++ : CMP.b #$03 : BNE ++
LDA.w $0C4A, X : CMP.b #$31 : BEQ .check_collision_moldorm
BRA .ignore_collision ; don't collide with non-byrna
++ : CMP.b #$04 : BNE ++
LDA.w $0C4A, X : CMP.b #$01 : BEQ .check_collision_moldorm
CMP.b #$2C : BEQ .check_collision_moldorm
BRA .ignore_collision ; don't collide with non-somaria
++ : CMP.b #$05 : BNE .ignore_collision
LDA.w $0C4A, X : CMP.b #$01 : BEQ .check_collision_moldorm
CMP.b #$2C : BEQ .check_collision_moldorm
CMP.b #$31 : BEQ .check_collision_moldorm
BRA .ignore_collision ; don't collide with non-canes
.check_collision_moldorm
JSR SetUpMoldormHitbox
JSL !UTILITY_CHECK_IF_HIT_BOXES_OVERLAP_LONG
RTL
.ignore_collision
CLC
RTL
.trinexx
LDA.l SpecialWeapons : AND.b #$7F : CMP.b #$01 : BNE ++
LDA.w $0C4A, X : CMP.b #$07 : BEQ .check_collision_trinexx
BRA .ignore_collision ; don't collide with non-bombs
++ : CMP.b #$03 : BNE ++
LDA.w $0C4A, X : CMP.b #$31 : BEQ .check_collision_trinexx
JMP .ignore_collision ; don't collide with non-byrna
++ : CMP.b #$04 : BNE ++
LDA.w $0C4A, X : CMP.b #$01 : BEQ .check_collision_trinexx
CMP.b #$2C : BEQ .check_collision_trinexx
JMP .ignore_collision ; don't collide with non-somaria
++ : CMP #$05 : BNE .ignore_collision
LDA.w $0C4A, X : CMP.b #$01 : BEQ .check_collision_trinexx
CMP.b #$2C : BEQ .check_collision_trinexx
CMP.b #$31 : BEQ .check_collision_trinexx
JMP .ignore_collision ; don't collide with non-canes
.check_collision_trinexx
JSR SetUpTrinexxHitbox
JSL !UTILITY_CHECK_IF_HIT_BOXES_OVERLAP_LONG
RTL
; returns carry clear if there was no overlap
;--------------------------------------------------------------------------------
SetUpTrinexxHitbox:
; rearrange trinexx's hitbox to be her middle instead of her head
LDA $0CAA, Y : PHA
LDA $0E60, Y : PHA
LDA $0D10, Y : PHA
LDA $0D30, Y : PHA
LDA $0D00, Y : PHA
LDA $0D20, Y : PHA
LDA #$80 : STA $0CAA, Y
PHX
LDA $0E80, Y : !SUB.l $1DAF28 : AND.b #$7F : TAX
LDA $7FFC00, X : STA $0D10, Y
LDA $7FFC80, X : STA $0D30, Y
LDA $7FFD00, X : STA $0D00, Y
LDA $7FFD80, X : STA $0D20, Y
TYX
STZ $0E60, X
JSL !SPRITE_SETUP_HIT_BOX_LONG
PLX
PLA : STA $0D20, Y
PLA : STA $0D00, Y
PLA : STA $0D30, Y
PLA : STA $0D10, Y
PLA : STA $0E60, Y
PLA : STA $0CAA, Y
RTS
;--------------------------------------------------------------------------------
SetUpMoldormHitbox:
; rearrange moldorm's hitbox to be his tail instead of his head
LDA $0D90, Y : PHA
LDA $0F60, Y : PHA
LDA $0D10, Y : PHA
LDA $0D30, Y : PHA
LDA $0D00, Y : PHA
LDA $0D20, Y : PHA
PHY : PHX
LDA $0E80, Y : !SUB.b #$30 : AND.b #$7F : TAX
LDA $7FFC00, X : STA $0D10, Y
LDA $7FFC80, X : STA $0D30, Y
LDA $7FFD00, X : STA $0D00, Y
LDA $7FFD80, X : STA $0D20, Y
LDA #$01 : STA $09D0, Y
TYX
STZ $0F60, X
JSL !SPRITE_SETUP_HIT_BOX_LONG
PLX : PLY
PLA : STA $0D20, Y
PLA : STA $0D00, Y
PLA : STA $0D30, Y
PLA : STA $0D10, Y
PLA : STA $0F60, Y
PLA : STA $0D90, Y
RTS
;--------------------------------------------------------------------------------
; start with X = ancilla index, Y = sprite index
Utility_CheckHelmasaurKingCollision:
LDA.l SpecialWeapons : AND.b #$7F : CMP.b #$01 : BNE ++
LDA.w $0C4A, X : CMP.b #$07 : BEQ .collide
BRA .normal ; normal behavior with non-bombs
++ : CMP.b #$03 : BNE ++
LDA.w $0C4A, X : CMP.b #$31 : BEQ .collide
BRA .normal ; normal behavior with non-byrna
++ : CMP.b #$04 : BNE ++
LDA.w $0C4A, X : CMP.b #$01 : BEQ .collide
CMP.b #$2C : BEQ .collide
BRA .normal ; normal behavior with non-somaria
++ : CMP.b #$05 : BNE .normal
LDA.w $0C4A, X : CMP.b #$01 : BEQ .collide
CMP.b #$2C : BEQ .collide
CMP.b #$31 : BEQ .collide
BRA .normal ; normal behavior with non-canes
.collide
CLC
RTL
.normal
LDA.w $0DB0, Y : CMP.b #$03
RTL
; returns carry set if there is collision immunity
;--------------------------------------------------------------------------------
Utility_CheckImpervious:
LDA $0E20, X : CMP.b #$CB : BNE .normal
.trinexx
LDA SpecialWeapons : AND.b #$7F : CMP.b #$06 : BEQ .check_sidenexx
LDA SpecialWeapons : AND.b #$80 : BNE +
BRA .normal
+
LDA $0301 : AND.b #$0A : BNE .impervious ; impervious to hammer
.check_sidenexx
LDA.w $0DD1 : ORA.w $0DD2 : BNE .impervious ; at least one sidenexx alive
LDA.w $0D80, X : CMP.b #$02 : BCS .impervious ; at least one sidenexx alive
BRA .not_impervious
.normal
LDA $0E60, X : AND.b #$40 : BNE .impervious
LDA $0CF2 : CMP #$FF : BEQ .impervious ; special "always-impervious" class
LDA $0E20, X : CMP.b #$CC : BEQ .sidenexx : CMP.b #$CD : BEQ .sidenexx
LDA $0301 : AND.b #$0A : BEQ .not_impervious ; normal behavior if not hammer
JSL Ganon_CheckHammerVulnerability : BCS .not_impervious
LDA SpecialWeapons : AND.b #$80 : BEQ .not_impervious
LDA $0E20, X : CMP.b #$1E : BEQ .not_impervious ; crystal switch
CMP.b #$40 : BEQ .not_impervious ; aga barrier
BRA .impervious
.not_impervious
LDA #$00 : RTL
.impervious
LDA #$01 : RTL
.sidenexx
LDA $0CAA, X : AND.b #$04 : BEQ .vulnerable
LDA.l SpecialWeapons : AND.b #$80 : BEQ .not_impervious
LDA $0CF2 : CMP #$06 : !BLT .impervious ; swords are ineffective
BRA .not_impervious
.vulnerable
LDA.l SpecialWeapons : AND.b #$80 : BEQ .not_impervious
LDA $0CF2 : CMP #$06 : !BGE .impervious ; non-swords are ineffective
BRA .not_impervious
; returns nonzero A if impervious
;--------------------------------------------------------------------------------
!SPRITE_INITIALIZED_SEGMENTED = "$1DD6D1"
; start with X = sprite index
;--------------------------------------------------------------------------------
AllowBombingMoldorm:
LDA.l SpecialWeapons : AND.b #$7F : CMP.b #$01 : BEQ .no_disable_projectiles
CMP.b #$03 : BEQ .no_disable_projectiles
CMP.b #$04 : BEQ .no_disable_projectiles
CMP.b #$05 : BEQ .no_disable_projectiles
CMP.b #$06 : BEQ .no_disable_projectiles
INC $0BA0, X
.no_disable_projectiles
JSL !SPRITE_INITIALIZED_SEGMENTED
RTL
;--------------------------------------------------------------------------------
AllowBombingBarrier:
; what we wrote over
LDA $0D00, X : !SUB.b #$0C : STA $0D00, X
LDA $0E20, X : CMP #$40 : BNE .disable_projectiles
LDA.l SpecialWeapons : AND.b #$7F : CMP.b #$01 : BEQ .no_disable_projectiles
CMP.b #$03 : BEQ .no_disable_projectiles
CMP.b #$04 : BEQ .no_disable_projectiles
CMP.b #$05 : BEQ .no_disable_projectiles
CMP.b #$06 : BEQ .no_disable_projectiles
.disable_projectiles
INC $0BA0, X
.no_disable_projectiles
RTL
;--------------------------------------------------------------------------------
DrawBombInMenu:
JSL LoadBombCount16 : AND.w #$00FF : BEQ .noBombs
LDA SpecialWeapons : AND.w #$007F : CMP.w #$0001 : BNE .vanillaBombs
LDA.l SpecialWeaponLevel : AND.w #$00FF : BEQ .noBombs : STA $02
LDA.w #$FC81 : STA $04
BRA .done
.vanillaBombs
LDA.w #$0001 : STA $02
LDA.w #$F699 : STA $04
BRA .done
.noBombs
LDA.w #$0000 : STA $02
LDA.w #$F699 : STA $04
.done
RTL
;--------------------------------------------------------------------------------
DrawSwordInMenu:
LDA SpecialWeapons : AND.w #$007F : CMP.w #$0001 : BEQ .specialSword
CMP.w #$0003 : BEQ .specialSword
CMP.w #$0004 : BEQ .specialSword
CMP.w #$0005 : BEQ .specialSword
CMP.w #$0008 : BEQ .specialSword
LDA SwordEquipment : AND.w #$00FF : CMP.w #$00FF : BEQ .noSword
.hasSword
STA $02
LDA.w #$F859 : STA $04
RTL
.noSword
LDA.w #$0000 : STA $02
LDA.w #$F859 : STA $04
RTL
.specialSword
LDA SpecialWeaponLevel : AND.w #$00FF : STA $02
LDA.w #$FC51 : STA $04
RTL
;--------------------------------------------------------------------------------
DrawBombInYBox:
CPX.w #$0004 : BNE .done
LDA SpecialWeapons : AND.w #$007F : CMP.w #$0001 : BNE .vanilla
LDA SpecialWeaponLevel : AND.w #$00FF : CLC : ADC.w #$00BD : BRA .done
.vanilla
LDA.w #$0001
.done
RTL
;--------------------------------------------------------------------------------
BombIcon:
dw $207F, $207F, $3C88, $3C89, $2C88, $2C89, $2488, $2489, $2888, $2889,$2888, $2889
DrawBombOnHud:
PHB
LDA.w #$0149
LDX.w #$86B0
LDY.w #$C700
MVN $7E, $21
PLB
LDA.l SpecialWeapons : AND.w #$007F : CMP.w #$0001 : BNE .regularBombs
LDA.l SpecialWeaponLevel : AND.w #$00FF : ASL #2 : TAX
LDA.l BombIcon, X : STA.l $7EC71A
LDA.l BombIcon+2, X : STA.l $7EC71C
.regularBombs
RTL
;--------------------------------------------------------------------------------
BombSpriteColor:
db $04, $08, $04, $02, $0A, $0A
SetBombSpriteColor:
LDA.l SpecialWeapons : AND.b #$7F : CMP.b #$01 : BNE .normal
PHX
LDA.l SpecialWeaponLevel
TAX
LDA.l BombSpriteColor, X
STA $0B
PLX
RTL
.normal
LDA #$04 : STA $0B
RTL
;--------------------------------------------------------------------------------
StoreSwordDamage:
LDA.l SpecialWeapons : AND.b #$7F : CMP #$02 : BEQ +
LDA.l $06ED39, X : RTL
+
LDA #$05
RTL
;--------------------------------------------------------------------------------
BeeDamageClass:
db $FF
db $06, $00, $07, $08, $0A
db $0B, $0C, $0D, $0E, $0F
db $FF, $03, $FF, $FF, $FF
db $FF, $01, $01, $FF, $FF
;--------------------------------------------------------------------------------
CheckDetonateBomb:
LDA.l SpecialWeapons : AND.b #$7F : CMP.b #$01 : BEQ .detonate_bombs
CMP.b #$06 : BEQ .release_bee
CLC : RTL
.detonate_bombs
LDX.b #09
.check_ancilla
LDA.w $0C4A, X
CMP.b #$07
BNE .next_ancilla
LDA.b #03
STA.w $039F, X
.next_ancilla
DEX
BPL .check_ancilla
JMP .done
.release_bee
LDX.w $0202
LDA.l BeeDamageClass, X : CMP.b #$FF : BEQ .nope
JSL $1EDCC9
BMI .nope
LDX.w $0202
LDA.l BeeDamageClass, X
CMP.b #$06 : BNE .set_bee_class
LDA.l $7EF340 : CMP.b #$03 : !BGE .silver_arrows
LDA.b #$06
BRA .set_bee_class
.silver_arrows
LDA.b #$09
.set_bee_class
STA.w $0ED0, Y
BRA .done
.nope
LDA.b #$3C
STA.w $0CF8
JSL $0DBB67
ORA.w $0CF8
STA.w $012E
.done
SEC
RTL
;--------------------------------------------------------------------------------
SetBeeType:
LDA.l SpecialWeapons : AND.b #$7F : CMP.b #$06 : BEQ .bee_mode
LDX.w $0202
.check_bee_type
LDA.l $7EF33F, X
TAX
LDA.l $7EF35B, X
CMP.b #$08
BNE .regular_bee
LDA.b #$01
STA.w $0EB0, Y
.regular_bee
LDA.b #$01
STA.w $0ED0, Y
RTL
.bee_mode
LDX.w $0202
CPX.b #$10 : BEQ .check_bee_type
BRA .regular_bee
;--------------------------------------------------------------------------------
ArrghusBoing:
LDA.l SpecialWeapons : AND.b #$7F : CMP.b #$06 : BNE .done
LDA.w $0F60, X : AND.b #$BF : STA.w $0F60, X
.done
; what we wrote over
LDA.b #$03
STA.w $0D80, X
RTL
;--------------------------------------------------------------------------------
BeeCheckTarget:
CPY.w $0FA0
BEQ .unsuitable_target
LDA.w $0DD0,Y
CMP.b #$09
BCC .unsuitable_target
LDA.w $0F00,Y
BNE .unsuitable_target
; in bee-mode skip targets that the bee can't hurt
LDA.l SpecialWeapons : AND.b #$7F : CMP.b #$06 : BNE +
JSR BeeCheckDamage
CMP.b #$00 : BEQ .unsuitable_target
+
LDA.w $0E40,Y
BMI .potential_target
LDA.w $0F20,Y
CMP.w $0F20,X
BNE .unsuitable_target
LDA.w $0F60,Y
AND.b #$40
BEQ +
LDA.l SpecialWeapons : AND.b #$7F : CMP.b #$06 : BNE .unsuitable_target
; in bee mode, allow targetting anti-fairies, bunny beams, and keese
LDA.w $0E20,Y
CMP.b #$15 : BEQ + ; anti-fairy
CMP.b #$6F : BEQ + ; keese
CMP.b #$D1 : BEQ + ; bunny beam
BRA .unsuitable_target
+
LDA.w $0BA0,Y
BEQ .valid_target
BRA .unsuitable_target
.potential_target
LDA.w $0EB0,X
BEQ .unsuitable_target
LDA.w $0CD2,Y
AND.b #$40
BNE .valid_target
.unsuitable_target
CLC : RTL
.valid_target
SEC : RTL
;--------------------------------------------------------------------------------
BeeCheckDamage:
PHX : PHP
REP #$20
LDA.w $0E20,Y : AND.w #$00FF
ASL #4
SEP #$20
ORA.w $0ED0,X
REP #$30
TAX
SEP #$20
JSL LookupDamageLevel
SEP #$10
PLP : PLX
RTS
;--------------------------------------------------------------------------------
CheckBugNet:
LDA.w $037A : AND.b #$10 : BEQ .done ; normal behavior if not bugnet
PHP ; we want to preserve the carry bit
LDA.l SpecialWeapons : AND.b #$7F : CMP.b #$08 : BNE .return_10 ; normal behavior if not bugnet mode
.bugnet_mode
LDA.w $0E20, X : CMP.b #$E3 : BEQ .return_10 ; normal behavior if fairy
CMP.b #$79 : BEQ .return_10 ; normal behavior if bee
CMP.b #$B2 : BEQ .return_10 ; normal behavior if bee
PLP : LDA.b #$00 : RTL
.return_10
PLP : LDA.b #$10
.done
RTL
;--------------------------------------------------------------------------------
SetHammerClass:
LDA.l SpecialWeapons : AND.b #$7F : CMP.b #$08 : BNE .normal ; normal behavior if not bugnet mode
LDA.w $037A : AND.b #$10 : BEQ .normal ; normal behavior if not bugnet
LDA 4, S : TAX ; get sprite index off of stack
LDA.w $0E20, X : CMP.b #$88 : BNE .not_mothula
LDA.l SpecialWeaponLevel
CMP #$04 : !BGE .fix_mothula
BRA .done
.fix_mothula
LDA #$03
BRA .done
.not_mothula
LDA.l SpecialWeaponLevel
.done
STA.w $0CF2
RTL
.normal
LDA.w $0301
AND.b #$0A
BEQ .not_hammer
LDA.b #$03
STA.w $0CF2
.not_hammer
RTL
;--------------------------------------------------------------------------------

View File

@@ -53,11 +53,12 @@ endstruct align 2
; This label can be indexed with a plus symbol (e.g. The Hyrule Castle screen would
; be OverworldEventDataWRAM+$1B or OverworldEventDataWRAM+27)
;--------------------------------------------------------------------------------
; - i o - - - b -
; - i o t t t b -
;
; i = Free-standing item collected. Also used for sprites like the castle tower barrier
; o = Overlay active
; b = Bomb wall opened
; t = Tree/Rock/Statue prize collected (Bonk Drop Shuffle)
;--------------------------------------------------------------------------------
OverworldEventDataWRAM = $7EF280
@@ -167,13 +168,14 @@ CurrentGenericKeys: skip 1 ; Generic small keys
;================================================================================
; Tracking & Indicators ($7EF38C - $7EF3F0)
;--------------------------------------------------------------------------------
InventoryTracking: skip 2 ; b r m p n s k f - - - - - - o q (bitfield)
InventoryTracking: skip 2 ; - - - - - - o q b r m p n s k f (bitfield)
; b = Blue Boomerang | r = Red Boomerang | m = Mushroom Current
; p = Magic Powder | n = Mushroom Past | s = Shovel
; k = Inactive Flute | f = Active Flute | o = Any bomb acquired
; q = Quickswap locked
BowTracking: skip 2 ; b s p - - - - - - - - - - - - - (bitfield)
; b = Bow | s = Silver Arrows Upgrade | p = Second Progressive Bow
BowTracking: skip 2 ; - - - - - - - - b s p f - - - - (bitfield)
; b = Any Bow | s = Silver Arrows Upgrade | p = Second Progressive Bow
; f = First progressive bow
; The front end writes two distinct progressive bow items. p
; indicates whether the "second" has been found independent of
; the first
@@ -181,7 +183,9 @@ ItemLimitCounts: skip 16 ; Keeps track of limited non-progressive items s
; See: ItemSubstitutionRules in tables.asm
; Right now this is only used for three items but extra space is
; reserved
skip 37 ; Unused
skip 35 ; Unused
SpecialWeaponLevel: skip 1 ; Keeps track of level of weapon in item modes
ItemOnB: skip 1 ; same table as $0202; $01 = arrows .. $14 = mirror
ProgressIndicator: skip 1 ; $00 = Pre-Uncle | $01 = Post-Uncle item | $02 = Zelda Rescued
; $03 = Agahnim 1 defeated
; $04 and above don't do anything. $00-$02 used in standard mode
@@ -312,7 +316,8 @@ HeartPieceCounter: skip 1 ; Total Number of heartpieces collected (integer
CrystalCounter: skip 1 ; Total Number of crystals collected (integer)
DungeonsCompleted: skip 2 ; Bitfield indicating whether a dungeon's prize has been collected.
; This has the same shape as the dungeon item bitfields.
skip 44 ; Unused
BombsPlaced: skip 2 ; Total Number of bombs placed (16-bit integer)
skip 42 ; Unused
ServiceSequenceRx: ; Service sequence receive
ServiceSequenceTx: ; Service sequence transmit
ServiceSequence: skip 8 ; Service request block. See servicerequest.asm
@@ -370,6 +375,26 @@ FileMarker: skip 1 ; $FF = Active save file | $00 = Inactive save f
skip 13 ; Unused
InverseChecksum: skip 2 ; Vanilla Inverse Checksum. Don't write unless computing checksum.
;================================================================================
; Temporary Effects ($7F50C0 - $7F50CF)
;--------------------------------------------------------------------------------
base $7F50C0
SwordModifier: skip 1
ShieldModifier: skip 1 ; (not implemented)
ArmorModifier: skip 1
MagicModifier: skip 1
LightConeModifier: skip 1
CuccoStormModifier: skip 1
OldManDashModifier: skip 1
IcePhysicsModifier: skip 1
InfiniteArrowsModifier: skip 1
InfiniteBombsModifier: skip 1
InfiniteMagicModifier: skip 1
InvertDPadModifier: skip 1
TemporaryOHKO: skip 1
SpriteSwapper: skip 1
BootsModifier: skip 1 ; (0=Off, 1=Always, 2=Never)
;================================================================================
; Expanded SRAM ($7F6000 - $7F6FFF)
;--------------------------------------------------------------------------------
@@ -526,6 +551,7 @@ endmacro
;--------------------------------------------------------------------------------
%assertSRAM(InventoryTracking, $7EF38C)
%assertSRAM(BowTracking, $7EF38E)
%assertSRAM(SpecialWeaponLevel, $7EF3C3)
%assertSRAM(ItemLimitCounts, $7EF390)
;--------------------------------------------------------------------------------
%assertSRAM(GameCounter, $7EF3FF)

View File

@@ -7,8 +7,7 @@
;--------------------------------------------------------------------------------
IncrementBonkCounter:
LDA StatsLocked : BNE +
LDA BonkCounter : INC
CMP.b #100 : BEQ + ; decimal 100
LDA BonkCounter : INC : BEQ + ; overflow
STA BonkCounter
+
RTL
@@ -185,6 +184,16 @@ IncrementChestTurnCounter:
PLA
RTL
;--------------------------------------------------------------------------------
IncrementBombsPlacedCounter:
PHA
LDA StatsLocked : BNE +
PHP : REP #$20
LDA BombsPlaced : INC : STA BombsPlaced
PLP
+
PLA
RTL
;--------------------------------------------------------------------------------
IncrementChestCounter:
LDA.b #$01 : STA $02E9 ; thing we wrote over
PHA
@@ -205,9 +214,9 @@ RTL
DecrementItemCounter:
PHA
LDA StatsLocked : BNE +
REP #$20
REP #$20
LDA TotalItemCounter : DEC : STA TotalItemCounter
SEP #$20
SEP #$20
+
PLA
RTL
@@ -318,9 +327,7 @@ RTL
IndoorTileTransitionCounter:
JMP StatTransitionCounter
;--------------------------------------------------------------------------------
!REDRAW = "$7F5000"
IndoorSubtileTransitionCounter:
LDA.b #$01 : STA !REDRAW ; set redraw flag for items
STZ $0646 ; stuff we wrote over
STZ $0642
JMP StatTransitionCounter

View File

@@ -3,31 +3,67 @@
;===================================================================================================
table "creditscharmapbighi.txt"
YourSpriteCreditsHi:
db 2
db 55
db " " ; $238002
db 2, 55, " " ; $238002
table "creditscharmapbiglo.txt"
YourSpriteCreditsLo:
db 2
db 55
db " " ; $238020
db 2, 55, " " ; $238020
table "creditscharmapbighi.txt"
CollectionRateHi:
db 2, 55
db $5F, $6B, $68, $68, $61, $5F, $70, $65, $6B, $6A, $9F, $6E, $5D, $70, $61 ; "Collection Rate"
db $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F ; " " 8 spaces
print "Collection Rate High Start: ", pc
db $9F, $A2 ; " /"
db $55, $54, $59 ; 216
db 2, 55, "COLLECTION RATE /216" ; $23803E, "216" at $238057
table "creditscharmapbiglo.txt"
CollectionRateLo:
db 2, 55
db $85, $91, $8E, $8E, $87, $85, $96, $8B, $91, $90, $9F, $94, $83, $96, $87 ; "Collection Rate"
db $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F ; " " 8 spaces
print "Collection Rate Low Start: ", pc
db $9F, $C2 ; " /"
db $7B, $7A, $7F ; 216
db 2, 55, "COLLECTION RATE /216" ; $23805C, "216" at $238075
table "creditscharmapbighi.txt"
FirstSwordStatsHi:
db 2, 55, "FIRST SWORD " ; $23807A
table "creditscharmapbiglo.txt"
FirstSwordStatsLo:
db 2, 55, "FIRST SWORD " ; $238098
table "creditscharmapbighi.txt"
SwordlessKillsHi:
db 2, 55, "SWORDLESS /13" ; $2380B6
table "creditscharmapbiglo.txt"
SwordlessKillsLo:
db 2, 55, "SWORDLESS /13" ; $2380D4
table "creditscharmapbighi.txt"
FighterSwordKillsHi:
db 2, 55, "FIGHTER'S SWORD /13" ; $2380F2
table "creditscharmapbiglo.txt"
FighterSwordKillsLo:
db 2, 55, "FIGHTER'S SWORD /13" ; $238110
table "creditscharmapbighi.txt"
MasterSwordKillsHi:
db 2, 55, "MASTER SWORD /13" ; $23812E
table "creditscharmapbiglo.txt"
MasterSwordKillsLo:
db 2, 55, "MASTER SWORD /13" ; $23814C
table "creditscharmapbighi.txt"
TemperedSwordKillsHi:
db 2, 55, "TEMPERED SWORD /13" ; $23816A
table "creditscharmapbiglo.txt"
TemperedSwordKillsLo:
db 2, 55, "TEMPERED SWORD /13" ; $238188
table "creditscharmapbighi.txt"
GoldSwordKillsHi:
db 2, 55, "GOLD SWORD /13" ; $2381A6
table "creditscharmapbiglo.txt"
GoldSwordKillsLo:
db 2, 55, "GOLD SWORD /13" ; $2381C4
;===================================================================================================
@@ -442,7 +478,16 @@ CreditsLineBlank:
%blankline()
%blankline()
%smallcredits("FESTIVE RANDOMIZER", "yellow")
%smallcredits("OVERWORLD RANDOMIZER", "yellow")
%blankline()
%bigcredits("CODEMANN8 CATOBAT")
%blankline()
%blankline()
%smallcredits("FESTIVE RANDOMIZER", "green")
%blankline()
@@ -455,7 +500,7 @@ CreditsLineBlank:
%blankline()
%blankline()
%smallcredits("SPRITE DEVELOPMENT", "green")
%smallcredits("SPRITE DEVELOPMENT", "yellow")
%blankline()
@@ -479,7 +524,9 @@ CreditsLineBlank:
%blankline()
%blankline()
%smallcredits("YOUR SPRITE BY", "yellow")
%smallcredits("YOUR SPRITE BY", "green")
%blankline()
%addarbline(YourSpriteCreditsHi)
%addarbline(YourSpriteCreditsLo)
@@ -487,7 +534,7 @@ CreditsLineBlank:
%blankline()
%blankline()
%smallcredits("MSU SUPPORT", "green")
%smallcredits("MSU SUPPORT", "yellow")
%blankline()
@@ -496,7 +543,7 @@ CreditsLineBlank:
%blankline()
%blankline()
%smallcredits("PALETTE SHUFFLER", "yellow")
%smallcredits("PALETTE SHUFFLER", "green")
%blankline()
@@ -561,14 +608,6 @@ CreditsLineBlank:
%bigcredits("HTTPS://ALTTPR.COM/DISCORD")
%blankline()
%emptyline()
%emptyline()
%emptyline()
%emptyline()
%emptyline()
%emptyline()
%emptyline()
%emptyline()
%emptyline()
@@ -612,7 +651,8 @@ endif
%blankline()
%blankline()
%bigcreditsleft("FIRST SWORD")
%addarbline(FirstSwordStatsHi)
%addarbline(FirstSwordStatsLo)
%blankline()
@@ -635,23 +675,28 @@ endif
%blankline()
%blankline()
%bigcreditsleft("SWORDLESS /13")
%addarbline(SwordlessKillsHi)
%addarbline(SwordlessKillsLo)
%blankline()
%bigcreditsleft("FIGHTER'S SWORD /13")
%addarbline(FighterSwordKillsHi)
%addarbline(FighterSwordKillsLo)
%blankline()
%bigcreditsleft("MASTER SWORD /13")
%addarbline(MasterSwordKillsHi)
%addarbline(MasterSwordKillsLo)
%blankline()
%bigcreditsleft("TEMPERED SWORD /13")
%addarbline(TemperedSwordKillsHi)
%addarbline(TemperedSwordKillsLo)
%blankline()
%bigcreditsleft("GOLD SWORD /13")
%addarbline(GoldSwordKillsHi)
%addarbline(GoldSwordKillsLo)
%blankline()
%blankline()
@@ -673,6 +718,10 @@ endif
%blankline()
%bigcreditsleft("BOMBS PLACED")
%blankline()
%bigcreditsleft("SAVE AND QUITS")
%blankline()
@@ -692,11 +741,6 @@ endif
%bigcreditsleft("TOTAL LAG TIME")
%blankline()
%blankline()
%blankline()
%blankline()
%blankline()
@@ -728,42 +772,3 @@ endif
%emptyline()
;---------------------------------------------------------------------------------------------------
!FIRST_SWORD_X = 19
!FIRST_SWORD_Y = 310
!PEGASUS_BOOTS_X = 19
!PEGASUS_BOOTS_Y = 313
!FLUTE_X = 19
!FLUTE_Y = 316
!MIRROR_X = 19
!MIRROR_Y = 319
!SWORDLESS_X = 23
!SWORDLESS_Y = 327
!FIGHTERS_SWORD_X = 23
!FIGHTERS_SWORD_Y = 330
!MASTER_SWORD_X = 23
!MASTER_SWORD_Y = 333
!TEMPERED_SWORD_X = 23
!TEMPERED_SWORD_Y = 336
!GOLD_SWORD_X = 23
!GOLD_SWORD_Y = 339
!DAMAGETAKEN_X = 26
!DAMAGETAKEN_Y = 346
!MAGICUSED_X = 26
!MAGICUSED_Y = 349
!BONKS_X = 26
!BONKS_Y = 352
!SAVE_AND_QUITS_X = 26
!SAVE_AND_QUITS_Y = 355
!DEATHS_X = 26
!DEATHS_Y = 358
!FAERIE_REVIVALS_X = 26
!FAERIE_REVIVALS_Y = 361
!TOTAL_MENU_TIME_X = 19
!TOTAL_MENU_TIME_Y = 364
!TOTAL_LAG_TIME_X = 19
!TOTAL_LAG_TIME_Y = 367
!COLLECTION_RATE_X = 22
!COLLECTION_RATE_Y = 380
!TOTAL_TIME_X = 19
!TOTAL_TIME_Y = 383

Binary file not shown.

View File

@@ -635,6 +635,7 @@ RTS
FontTable:
incbin stats/fonttable.bin
print "Stats Config address: ", pc
CreditsStats:
incsrc stats/statConfig.asm
dw $FFFF
@@ -667,4 +668,4 @@ org $0ee86d
JMP.w AfterDeathCounterOutput
org $0ee8fd
AfterDeathCounterOutput:
AfterDeathCounterOutput:

View File

@@ -1,10 +1,51 @@
!FIRST_SWORD_X = 19
!FIRST_SWORD_Y = 310
!PEGASUS_BOOTS_X = 19
!PEGASUS_BOOTS_Y = 313
!FLUTE_X = 19
!FLUTE_Y = 316
!MIRROR_X = 19
!MIRROR_Y = 319
!SWORDLESS_X = 23
!SWORDLESS_Y = 327
!FIGHTERS_SWORD_X = 23
!FIGHTERS_SWORD_Y = 330
!MASTER_SWORD_X = 23
!MASTER_SWORD_Y = 333
!TEMPERED_SWORD_X = 23
!TEMPERED_SWORD_Y = 336
!GOLD_SWORD_X = 23
!GOLD_SWORD_Y = 339
!DAMAGETAKEN_X = 26
!DAMAGETAKEN_Y = 346
!MAGICUSED_X = 26
!MAGICUSED_Y = 349
!BONKS_X = 26
!BONKS_Y = 352
!BOMBS_X = 26
!BOMBS_Y = 355
!SAVE_AND_QUITS_X = 26
!SAVE_AND_QUITS_Y = 358
!DEATHS_X = 26
!DEATHS_Y = 361
!FAERIE_REVIVALS_X = 26
!FAERIE_REVIVALS_Y = 364
!TOTAL_MENU_TIME_X = 19
!TOTAL_MENU_TIME_Y = 367
!TOTAL_LAG_TIME_X = 19
!TOTAL_LAG_TIME_Y = 370
!COLLECTION_RATE_X = 22
!COLLECTION_RATE_Y = 380
!TOTAL_TIME_X = 19
!TOTAL_TIME_Y = 383
;(address, type, shiftRight, bits, digits, xPos, lineNumber)
%AddStat(SwordTime, 1, 0, 32, 4, !FIRST_SWORD_X, !FIRST_SWORD_Y)
%AddStat(BootsTime, 1, 0, 32, 4, !PEGASUS_BOOTS_X, !PEGASUS_BOOTS_Y)
%AddStat(FluteTime, 1, 0, 32, 4, !FLUTE_X, !FLUTE_Y)
%AddStat(MirrorTime, 1, 0, 32, 4, !MIRROR_X, !MIRROR_Y)
%AddStat(SwordlessBossKills, 0, 0, 08, 2, !SWORDLESS_X, !SWORDLESS_Y)
%AddStat(SwordlessBossKills, 0, 0, 04, 2, !SWORDLESS_X, !SWORDLESS_Y)
%AddStat(SwordBossKills, 0, 4, 04, 2, !FIGHTERS_SWORD_X, !FIGHTERS_SWORD_Y)
%AddStat(SwordBossKills, 0, 0, 04, 2, !MASTER_SWORD_X, !MASTER_SWORD_Y)
%AddStat(SwordBossKills+1, 0, 4, 04, 2, !TEMPERED_SWORD_X, !TEMPERED_SWORD_Y)
@@ -12,6 +53,7 @@
%AddStat(DamageCounter, 0, 0, 16, 5, !DAMAGETAKEN_X, !DAMAGETAKEN_Y)
%AddStat(MagicCounter, 0, 0, 16, 5, !MAGICUSED_X, !MAGICUSED_Y)
%AddStat(BonkCounter, 0, 0, 08, 3, !BONKS_X, !BONKS_Y)
%AddStat(BombsPlaced, 0, 0, 16, 4, !BOMBS_X, !BOMBS_Y)
%AddStat(SaveQuitCounter, 0, 0, 08, 2, !SAVE_AND_QUITS_X, !SAVE_AND_QUITS_Y)
%AddStat(DeathCounter, 0, 0, 08, 2, !DEATHS_X, !DEATHS_Y)
%AddStat(FaerieRevivalCounter, 0, 0, 08, 3, !FAERIE_REVIVALS_X, !FAERIE_REVIVALS_Y)

View File

@@ -39,25 +39,34 @@ LoadSwordForDamage:
JSR.w LoadModifiedSwordLevel ; load normal sword value
RTL
;================================================================================
macro LookupDamageSubclass(table_address)
PHP
REP #$20 ; set 16-bit accumulator
TXA : LSR : TAX : BCS +
PLP
LDA.l <table_address>, X
LSR #4
BRA ++
+
PLP
LDA.l <table_address>, X
AND.b #$0F
++
endmacro
;================================================================================
;!StalfosBombDamage = "$7F509D"
LookupDamageLevel:
CPX.w #$0918 : BNE +
LDA.l !StalfosBombDamage
RTL
+
PHP
REP #$20 ; set 16-bit accumulator
TXA : LSR : TAX : BCS .lower
.upper
PLP
LDA.l Damage_Table, X
LSR #4
RTL
.lower
PLP
LDA.l Damage_Table, X
AND.b #$0F
RTL
LDA SpecialWeapons : AND.b #$7F : CMP.b #$02 : BEQ .pseudo_table
LDA SpecialWeapons : AND.b #$80 : BNE .bomb_table
%LookupDamageSubclass(Damage_Table) : RTL
.bomb_table
%LookupDamageSubclass(Damage_Table_Bombs) : RTL
.pseudo_table
%LookupDamageSubclass(Damage_Table_Pseudo) : RTL
;================================================================================
; $7F50C0 - Sword Modifier
LoadModifiedSwordLevel: ; returns short
@@ -96,29 +105,40 @@ LoadModifiedMagicLevel:
RTL
;================================================================================
; $7E0348 - Ice Value
; $7F50C7 - Ice Modifier
; $7F50C7 - Temporary Ice Modifier
; $30802D - Permanent Ice Modifier ($01 bit)
LoadModifiedIceFloorValue:
LDA $A0 : CMP #$91 : BEQ + : CMP #$92 : BEQ + : CMP #$93 : BEQ + ; mire basement currently broken - not sure why
LDA $5D : CMP #$01 : BEQ + : CMP #$17 : BEQ + : CMP #$1C : BEQ +
LDA $5E : CMP #$02 : BEQ +
LDA $5B : BNE +
LDA.l $30802D : BIT #$01 : BEQ ++
LDA $A0 : CMP #$16 : BEQ ++ ; swamp supertile with current -- fine for temporary physics but impossible without boots for permanent
LDA.w $0348 : ORA $7F50C7 : ORA #$10 : RTS
++ : LDA.w $0348 : ORA $7F50C7 : RTS
+ : LDA.w $0348
RTS
LoadModifiedIceFloorValue_a11:
LDA $A0 : CMP #$91 : BEQ + : CMP #$92 : BEQ + : CMP #$93 : BEQ + ; mire basement currently broken - not sure why
LDA $5D : CMP #$01 : BEQ + : CMP #$17 : BEQ + : CMP #$1C : BEQ +
LDA $5E : CMP #$02 : BEQ +
LDA $5B : BNE +
LDA.w $0348 : ORA $7F50C7 : AND.b #$11 : RTL
+ : LDA.w $0348 : AND.b #$11
RTL
JSR LoadModifiedIceFloorValue : AND.b #$11 : RTL
LoadModifiedIceFloorValue_a01:
LDA $A0 : CMP #$91 : BEQ + : CMP #$92 : BEQ + : CMP #$93 : BEQ + ; mire basement currently broken - not sure why
LDA $5D : CMP #$01 : BEQ + : CMP #$17 : BEQ + : CMP #$1C : BEQ +
LDA $5E : CMP #$02 : BEQ +
LDA $5B : BNE +
LDA.w $0348 : ORA $7F50C7 : AND.b #$01 : RTL
+ : LDA.w $0348 : AND.b #$01
RTL
JSR LoadModifiedIceFloorValue : AND.b #$01 : RTL
;================================================================================
CheckTabletSword:
LDA.l AllowHammerTablets : BEQ +
LDA HammerEquipment : BEQ + ; check for hammer
LDA.b #$02 : RTL
LDA HammerEquipment : BNE .allow ; check for hammer
+
LDA.l SpecialWeapons : AND.b #$7F : CMP.b #$01 : BEQ .check_special
CMP.b #$03 : BEQ .check_special
CMP.b #$04 : BEQ .check_special
CMP.b #$05 : BEQ .check_special
CMP.b #$06 : BEQ .allow
CMP.b #$08 : BEQ .check_special
BRA .normal
.allow
LDA.b #$02 : RTL
.check_special
LDA SpecialWeaponLevel : CMP #$02 : !BGE .allow ; check for master bombs
.normal
LDA SwordEquipment ; get actual sword value
RTL
;================================================================================
@@ -126,15 +146,27 @@ GetSwordLevelForEvilBarrier:
LDA.l AllowHammerEvilBarrierWithFighterSword : BEQ +
LDA #$FF : RTL
+
LDA SwordEquipment
RTL
LDA.l SpecialWeapons : AND.b #$7F : CMP.b #$08 : BEQ +
LDA.l SwordEquipment : RTL
+
LDA.l SpecialWeaponLevel : RTL
;================================================================================
CheckGanonHammerDamage:
LDA.l HammerableGanon : BEQ +
LDA $0E20, X : CMP.b #$D8 ; original behavior except ganon
RTL
+
LDA.l GanonVulnerabilityItem : CMP.b #$0C : BEQ +
LDA $0E20, X : CMP.b #$D6 ; original behavior
RTL
+
LDA $0E20, X : CMP.b #$D8 : BCC +
RTL
+
CMP.b #$D6 : BNE +
RTL
+
CLC
RTL
;================================================================================
GetSmithSword:
@@ -161,7 +193,7 @@ GetSmithSword:
REP #$20 : LDA CurrentRupees : !SUB.w #$000A : STA CurrentRupees : SEP #$20 ; Take 10 rupees
JSL ItemSet_SmithSword
.done
JML.l Smithy_AlreadyGotSword
;================================================================================

View File

@@ -98,7 +98,44 @@ db #$02 ; #$02 = Tempered Sword (default)
;org $05EBD4 ; PC 0x2EBD4 - sprite_zelda.asm:23 - (LDA $7EF359 : CMP.b #$02 : BCS .hasMasterSword) - Zelda Spawnpoint Sword Check
;db #$05 ; #$02 = Tempered Sword (default) - #$05 = All Swords
;--------------------------------------------------------------------------------
; 0x18002B- 0x180030 (Unused)
; 0x18002B (Unused)
;--------------------------------------------------------------------------------
org $30802C ; PC 0x18002C
AllowedItemOnB:
db #$00
; $00 = None (default)
; $01 - $20 = Only selected item
; $FF = Any valid
;--------------------------------------------------------------------------------
org $30802D ; PC 0x18002D
ChallengeModes:
; ---- ---i
; i: Permanent Ice Physics
db #$00 ; #$00 = Default behavior;
;--------------------------------------------------------------------------------
org $30802E ; PC 0x18002E
GanonVulnerabilityItem:
db #$00 ; #$00 = Default behavior (silver arrows)
;--------------------------------------------------------------------------------
org $30802F ; PC 0x18002F
SpecialWeapons:
db #$00
; s - - - m m m m (bitfield)
; s - only swords damage can hurt enemies
; m - special weapon mode
; $00 = Off (default)
; $01 = Bomb mode
; $02 = Pseudosword
; $03 = Byrna mode
; $04 = Somaria mode
; $05 = Canes mode
; $06 = Bee mode
; $07 = Unused
; $08 = Bugnet mode
;--------------------------------------------------------------------------------
org $308030 ; PC 0x180030
EnableSRAMTrace:
db #$00 ; #$00 = Off (default) - #$01 = On
;--------------------------------------------------------------------------------
org $308031 ; PC 0x180031
EnableEasterEggs:
@@ -214,10 +251,13 @@ db #$00 ; #$00 = Off (default) - #$01 = On (frog/smith can enter multi-entrance
org $30804D ; PC 0x18004D
EscapeAssist: ; ScrubMode:
db #$00
;---- -mba
;m - Infinite Magic
;b - Infinite Bombs
;a - Infinite Arrows
;-MBA -mba
;M - Infinite Magic (after escape)
;B - Infinite Bombs (after escape)
;A - Infinite Arrows (after escape)
;m - Infinite Magic (during escape)
;b - Infinite Bombs (during escape)
;a - Infinite Arrows (during escape)
;--------------------------------------------------------------------------------
org $30804E ; PC 0x18004E
UncleRefill:
@@ -233,7 +273,7 @@ db #$01 ; #$00 = Off - #$01 = On (default)
;--------------------------------------------------------------------------------
org $308050 ; PC 0x180050 - 0x18005D
CrystalPendantFlags_2:
db $02 ; Ganons Tower - because 5D is not available right now - sewers doesn't get one
db $02 ; Ganons Tower - because 5D is not available right now - sewers doesn't get one
db $04 ; Hyrule Castle
db $00 ; Eastern Palace
db $00 ; Desert Palace
@@ -241,7 +281,7 @@ CrystalPendantFlags_2:
db $40 ; Swamp Palace
db $40 ; Palace of Darkness
db $40 ; Misery Mire
db $40 ; Skull Woods
db $40 ; Skull Woods
db $40 ; Ice Palace
.hera
db $00 ; Tower of Hera
@@ -253,6 +293,10 @@ CrystalPendantFlags_2:
;Aga2: $02
;HC special check $04
;--------------------------------------------------------------------------------
org $30805D ; PC 0x18005D
SmithDeleteOnSave:
db #$00 ; #$00 = Off (default) - #$01 = On (frog/smith gets deleted on S+Q)
;--------------------------------------------------------------------------------
org $30805E ; PC 0x18005E - Number of crystals required to enter GT
NumberOfCrystalsRequiredForTower:
db #$07 ; #$07 = 7 Crystals
@@ -376,7 +420,9 @@ org $30808E ; PC 0x18008E
FakeBoots:
db $00 ; #$00 = Off (default) - #$01 = On
;--------------------------------------------------------------------------------
; 0x18008F (unused)
org $30808F ; PC 0x18008F
SwapAgaGanonsTower:
db $00 ; #$00 = Off (default) - #$01 = On
;--------------------------------------------------------------------------------
org $308090 ; PC 0x180090 - 0x180097
ProgressiveSwordLimit:
@@ -418,7 +464,11 @@ org $30809D
DungeonMapIcons:
db $01
;--------------------------------------------------------------------------------
; 0x18009E - 0x18009F (unused)
; 0x18009E (unused)
;--------------------------------------------------------------------------------
org $30809F ; PC 0x18009F
SeededRNG:
db $01 ; #$00 = Off - #$01 = Seeded RNG (default for rando)
;--------------------------------------------------------------------------------
org $3080A0 ; PC 0x1800A0 - 0x1800A4
Bugfix_MirrorlessSQToLW:
@@ -636,7 +686,7 @@ dw $6434 ; #6434 - Crystal
;--------------------------------------------------------------------------------
org $02A09B ; PC 0x1209B - Bank02.asm:5802 - (pool MilestoneItem_Flags:)
CrystalPendantFlags:
db $00 ; Sewers
db $00 ; Sewers
db $00 ; Hyrule Castle
db $04 ; Eastern Palace
db $02 ; Desert Palace
@@ -644,7 +694,7 @@ CrystalPendantFlags:
db $10 ; Swamp Palace
db $02 ; Palace of Darkness
db $01 ; Misery Mire
db $40 ; Skull Woods
db $40 ; Skull Woods
db $04 ; Ice Palace
.hera
db $01 ; Tower of Hera
@@ -1396,6 +1446,16 @@ db $04
;AD - Small Key of Ganon's Tower
;AE - Reserved
;AF - Generic Small Key
;B0 - Bee Trap
;B1 - Apples
;B2 - Fairy
;B3 - Chicken
;B4 - Big Magic
;B5 - 5 Arrows
;C0 - Progressive Bomb
;C1 - Progressive Cane
;C2 - Progressive Bug Net
;================================================================================
;;Residual Portal
;org $0283E0 ; PC 0x103E0 (Bank02.asm:816) (BNE)
@@ -1462,8 +1522,9 @@ dw #9999 ; Rupee Limit
; $2F8000 - $2F83FF - RNG Block
;================================================================================
; $7EC025 - $7EC034 - Item OAM Table
; $7EC035 - $7EC044 - Dynamic Item OAM Table
;================================================================================
; $7F5000 - Redraw Flag
; $7F5000 - FREE (Old Global Redraw Flag)
; $7F5001 - Flipper Softlock Possible
; $7F5002 - L/R Rotate
; $7F5003 - HexToDec 1st Digit

View File

@@ -34,7 +34,6 @@ SpawnTabletItem:
JSL.l HeartPieceGetPlayer : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
JSL.l LoadOutdoorValue
PHA
JSL.l PrepDynamicTile
LDA.b #$01 : STA !FORCE_HEART_SPAWN : STA !SKIP_HEART_SAVE
JSL.l SetTabletItem
@@ -42,6 +41,8 @@ SpawnTabletItem:
LDA.b #$EB
STA $7FFE00
JSL Sprite_SpawnDynamically
LDA.b #$01 : STA.w !SPRITE_REDRAW, Y
PLA : STA $0E80, Y ; Store item type
LDA $22 : STA $0D10, Y

View File

@@ -2,7 +2,6 @@
; Challenge Timer
;================================================================================
!Temp = "$7F5020"
!TemporaryOHKO = "$7F50CC"
;--------------------------------------------------------------------------------
!CLOCK_HOURS = "$7F5080" ; $7F5080 - $7F5083 - Clock Hours
!CLOCK_MINUTES = "$7F5084" ; $7F5084 - $7F5087 - Clock Minutes
@@ -176,7 +175,7 @@ DrawChallengeTimer:
RTL
;--------------------------------------------------------------------------------
OHKOTimer:
LDA !TemporaryOHKO : BNE .kill
LDA TemporaryOHKO : BNE .kill
LDA.l TimeoutBehavior : CMP #$02 : BNE +
LDA !Status : AND.b #$02 : BEQ +
.kill

View File

@@ -107,19 +107,19 @@ RTL
;DATA - Loot Identifier to Sprite ID
{
.gfxSlots
db $06, $44, $45, $46, $2D, $20, $2E, $09
db $09, $0A, $08, $05, $10, $0B, $2C, $1B
db $06, $44, $45, $46, $2D, $20, $2E, $09
db $09, $0A, $08, $05, $10, $0B, $2C, $1B
db $1A, $1C, $14, $19, $0C, $07, $1D, $2F
db $07, $15, $12, $0D, $0D, $0E, $11, $17
db $1A, $1C, $14, $19, $0C, $07, $1D, $2F
db $07, $15, $12, $0D, $0D, $0E, $11, $17
db $28, $27, $04, $04, $0F, $16, $03, $13
db $01, $1E, $10, $00, $00, $00, $00, $00
db $28, $27, $04, $04, $0F, $16, $03, $13
db $01, $1E, $10, $00, $00, $00, $00, $00
db $00, $30, $22, $21, $24, $24, $24, $23
db $23, $23, $29, $2A, $2C, $2B, $03, $03
db $00, $30, $22, $21, $24, $24, $24, $23
db $23, $23, $29, $2A, $2C, $2B, $03, $03
db $34, $35, $31, $33, $02, $32, $36, $37
db $34, $35, $31, $33, $02, $32, $36, $37
db $2C, $43, $0C, $38, $39, $3A, $F9, $3C
; db $2C, $06, $0C, $38, $FF, $FF, $FF, $FF
@@ -153,9 +153,18 @@ RTL
;Ax
db $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F ; Free Small Key
;Bx
db $2C ; Bee Trap
db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; Unused
db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; Unused
db $4D ; Apples
db $4C ; Fairy
db $4B ; Chicken
db $3B ; Big Magic
db $4A ; Good Bee
db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; Unused
db $13 ; Bomb Upgrade
db $07 ; Cane Upgrade
db $27 ; Bug Net Upgrade
db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; Unused
db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; Unused
db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; Unused
db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; Reserved
@@ -188,7 +197,7 @@ GetSpritePalette:
;--------
TAX : LDA.l .gfxPalettes, X ; look up item gfx
PLB : PLX
CMP.b #$F8 : !BGE .specialHandling
CMP.b #$F6 : !BGE .specialHandling
RTL
.specialHandling
CMP.b #$FD : BNE ++ ; Progressive Sword
@@ -238,6 +247,16 @@ RTL
LDA.b #$08 : RTL
+ ; Any Bow
LDA.b #$02 : RTL
++ : CMP.b #$F7 : BNE ++ ; Progressive Bombs
LDA SpecialWeaponLevel
CMP.b #$00 : BNE + ; No Bombs
LDA.b #$08 : RTL
+ : CMP.b #$01 : BNE + ; L1 Bombs
LDA.b #$04 : RTL
+ : CMP.b #$02 : BNE + ; L2 Bombs
LDA.b #$02 : RTL
+ ; Everything Else
LDA.b #$0A : RTL
++ : CMP.b #$FA : BNE ++ ; RNG Item (Single)
JSL.l GetRNGItemSingle : JMP GetSpritePalette
++ : CMP.b #$FB : BNE ++ ; RNG Item (Multi)
@@ -284,8 +303,16 @@ RTL
db $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 ; Free Big Key
db $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 ; Free Small Key
db $04 ; Bee Trap
db $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 ; Unused
db $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 ; Unused
db $02 ; Apples
db $08 ; Fairy
db $02 ; Chicken
db $08 ; Big Magic
db $04 ; Good Bee
db $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 ; Unused
db $F7 ; Bomb Upgrade
db $0A ; Cane Upgrade
db $02 ; Bug Net Upgrade
db $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 ; Unused
db $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 ; Unused
db $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 ; Unused
db $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 ; Unused
@@ -340,19 +367,19 @@ IsNarrowSprite:
++ CMP.b #$63 : BNE ++ ; RNG Item (Multi)
JSL.l GetRNGItemMulti
++ CMP.b #$64 : BEQ + ; Progressive Bow
CMP.b #$65 : BNE .continue ; Progressive Bow (alt)
+ : LDA BowEquipment : INC : LSR
CMP.l ProgressiveBowLimit : !BLT +
CMP.b #$65 : BNE .continue ; Progressive Bow (alt)
+ : LDA BowEquipment : INC : LSR
CMP.l ProgressiveBowLimit : !BLT +
LDA.l ProgressiveBowReplacement
JSL.l IsNarrowSprite
JMP .done
JMP .done
.continue
;--------
LDX.b #$00 ; set index counter to 0
;----
-
CPX.b #$24 : !BGE .false ; finish if we've done the whole list
CPX.b #(.smallSprites_end-.smallSprites) : !BGE .false ; finish if we've done the whole list
CMP.l .smallSprites, X : BNE + ; skip to next if we don't match
;--
SEC ; set true state
@@ -375,7 +402,8 @@ RTL
db $15, $18, $24, $2A, $34, $35, $36, $42
db $43, $45, $59, $A0, $A1, $A2, $A3, $A4
db $A5, $A6, $A7, $A8, $A9, $AA, $AB, $AC
db $AD, $AE, $AF, $FF, $FF, $FF, $FF, $FF
db $AD, $AE, $AF, $B4, $B5, $C1
.smallSprites_end
}
;--------------------------------------------------------------------------------
@@ -399,9 +427,10 @@ PrepDynamicTile:
+
TXA
JSR.w LoadDynamicTileOAMTable
JSL.l GetSpriteID ; convert loot id to sprite id
JSL.l GetAnimatedSpriteTile_variable
LDA.b #$00 : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
CMP.b #$34 : BCC + : CMP.b #$36+1 : BCS + : BRA ++ ; if rupees, don't draw to OAM
+ JSL.l GetSpriteID ; convert loot id to sprite id
JSL.l GetAnimatedSpriteTile_variable
++ LDA.b #$00 : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
PLY : PLX : PLA
RTL
;--------------------------------------------------------------------------------
@@ -410,8 +439,6 @@ RTL
; LoadDynamicTileOAMTable
; in: A - Loot ID
;-------------------------------------------------------------------------------- 20/847B
!SPRITE_OAM = "$7EC025"
;--------------------------------------------------------------------------------
LoadDynamicTileOAMTable:
PHA : PHP
@@ -421,7 +448,11 @@ LoadDynamicTileOAMTable:
STA.l !SPRITE_OAM+2
LDA.w #$0200 : STA.l !SPRITE_OAM+6
SEP #$20 ; set 8-bit accumulator
LDA.b #$24 : STA.l !SPRITE_OAM+4
LDA $01,s
CMP.b #$34 : BCC + : CMP.b #$36+1 : BCS + ; if rupees, use animated gfx already in OAM
LDA.b #$0B : BRA ++
+ LDA.b #$24
++ STA.l !SPRITE_OAM+4
LDA $01,s
@@ -433,11 +464,16 @@ LoadDynamicTileOAMTable:
BRA .done
.narrow
REP #$20 ; set 16-bit accumulator
LDA $02,s
CMP.b #$34 : BCC + : CMP.b #$36+1 : BCS + ; if rupees, use animated gfx already in OAM
REP #$20
LDA.w #$1B00 : BRA ++
+ REP #$20
LDA.w #$3400
++ STA.l !SPRITE_OAM+11
LDA.w #$0000 : STA.l !SPRITE_OAM+7
STA.l !SPRITE_OAM+14
LDA.w #$0800 : STA.l !SPRITE_OAM+9
LDA.w #$3400 : STA.l !SPRITE_OAM+11
.done
PLP : PLA
@@ -451,7 +487,6 @@ RTS
;--------------------------------------------------------------------------------
; This wastes two OAM slots if you don't want a shadow - fix later - I wrote "fix later" over a year ago and it's still not fixed (Aug 6, 2017) - lol (May 25th, 2019)
;-------------------------------------------------------------------------------- 2084B8
!SPRITE_OAM = "$7EC025"
!SKIP_EOR = "$7F5008"
;--------------------------------------------------------------------------------
DrawDynamicTile:
@@ -545,12 +580,12 @@ LoadModifiedTileBufferAddress:
PHA
LDA !TILE_UPLOAD_OFFSET_OVERRIDE : BEQ +
TAX
LDY.w #$0002
LDY.w #$0002
LDA.w #$0000 : STA !TILE_UPLOAD_OFFSET_OVERRIDE
BRA .done
+
LDX.w #$2D40
LDY.w #$0002
LDX.w #$2D40
LDY.w #$0002
.done
PLA
RTL
@@ -562,7 +597,7 @@ RTL
; out: Carry - 1 = On Screen, 0 = Off Screen
;--------------------------------------------------------------------------------
Sprite_IsOnscreen:
JSR _Sprite_IsOnscreen_DoWork
JSR _Sprite_IsOnscreen_DoWork
BCS +
REP #$20
LDA $E2 : PHA : !SUB.w #$0F : STA $E2
@@ -577,11 +612,11 @@ Sprite_IsOnscreen:
RTL
_Sprite_IsOnscreen_DoWork:
LDA $0D10, X : CMP $E2
LDA $0D30, X : SBC $E3 : BNE .offscreen
LDA $0D10, X : CMP $E2
LDA $0D30, X : SBC $E3 : BNE .offscreen
LDA $0D00, X : CMP $E8
LDA $0D20, X : SBC $E9 : BNE .offscreen
LDA $0D00, X : CMP $E8
LDA $0D20, X : SBC $E9 : BNE .offscreen
SEC
RTS
.offscreen

View File

@@ -0,0 +1,141 @@
;--------------------------------------------------------------------------------
!ANCILLA_DAMAGE = "$06EC84"
; start with X = sprite index, A = ancilla type index
;--------------------------------------------------------------------------------
Ganon_CheckAncillaVulnerability:
PHA
LDA $0EE0, X : BNE .not_vulnerable_pla
PLA
PHX : PHA
LDA.l GanonVulnerabilityItem
TAX : PLA
CMP.l Ganon_CheckByAncilla, X : BNE +
PLX : BRA .vulnerable
+
PLX : PHA
LDA.l GanonVulnerabilityItem
CMP #$01 : BEQ .silver_arrows
CMP #$11 : BEQ .somaria
BRA .not_vulnerable_pla
.silver_arrows
PLA : CMP #$09 : BNE .not_vulnerable
LDA $7EF340 : CMP.b #$03 : !BGE +
LDA #$09 : BRA .not_vulnerable
+
BRA .vulnerable
.hammer
BRA .not_vulnerable_pla ; NYI
.golden_bee
BRA .not_vulnerable_pla ; NYI
.somaria
PLA : CMP #$01 : BEQ .vulnerable
CMP #$2C : BEQ .vulnerable
BRA .vulnerable
.vulnerable
PHX
LDA.l GanonVulnerabilityItem
TAX
LDA.l Ganon_IFrameDuration, X
PLX
STA $0EE0, X ; give the poor pig some iframes
LDA #$20 : STA $0F10, X
LDA #$09
RTL
.not_vulnerable_pla
PLA
.not_vulnerable
PHX : TAX
LDA.l !ANCILLA_DAMAGE, X
PLX
RTL
; end with X = sprite index, A = damage class
;--------------------------------------------------------------------------------
!ANCILLA_CHECK_SPRITE_DAMAGE_PRESET_CLASS = "$06ECE6"
;--------------------------------------------------------------------------------
Ganon_CheckPowderVulnerability: ; we know it's powder
LDA.l GanonVulnerabilityItem : CMP #$05 : BNE .normal ; ganon not vulnerable to powder
LDA $0E20, X : CMP #$D7 : BNE .normal ; not stunned ganon
LDA $0EE0, X : BNE .normal ; ganon has iframes
LDA.l Ganon_IFrameDuration+$05
STA $0EE0, X ; give the poor pig some iframes
LDA #$20 : STA $0F10, X
LDA #$09
BRA .done
.normal
LDA.b #$0A
.done
JSL.l !ANCILLA_CHECK_SPRITE_DAMAGE_PRESET_CLASS
RTL
;--------------------------------------------------------------------------------
Ganon_CheckBeeVulnerability: ; we know it's a bee
; X is bee sprite index
; Y is target sprite index
LDA.l GanonVulnerabilityItem : CMP #$10 : BNE .normal ; ganon not vulnerable to bee
LDA $0E20, Y : CMP #$D7 : BNE .normal ; not stunned ganon
LDA $0EE0, Y : BNE .normal ; ganon has iframes
LDA.l Ganon_IFrameDuration+$10
STA $0EE0, Y ; give the poor pig some iframes
LDA #$20 : STA $0F10, Y
LDA #$09
BRA .done
.normal
LDA.l SpecialWeapons : AND.b #$7F : CMP.b #$06 : BNE .regular_bee
LDA.w $0ED0, X
BRA .done
.regular_bee
LDA.b #$01
.done
TYX
JSL.l !ANCILLA_CHECK_SPRITE_DAMAGE_PRESET_CLASS
RTL
;--------------------------------------------------------------------------------
Ganon_CheckInvincible:
LDA $04C5 : CMP.b #$02 : BEQ .not_transparent
LDA $0E20, X : CMP #$D7 : BNE .transparent ; non-stunned ganon
LDA $0301 : AND.b #$0A : BEQ .transparent ; normal behavior if not hammer
LDA.l GanonVulnerabilityItem : CMP #$0C : BNE .transparent ; ganon not vulnerable to hammer
.not_transparent
LDA #$00 : RTL
.transparent
LDA #$01 : RTL
; return non-zero A if ganon should be invincible
;--------------------------------------------------------------------------------
Ganon_CheckHammerVulnerability: ; we know it's hammer
LDA.l GanonVulnerabilityItem : CMP #$0C : BNE .normal ; ganon not vulnerable to hammer
LDA $0E20, X : CMP #$D7 : BNE .normal ; not stunned ganon
LDA $0EE0, X : BNE .normal ; ganon has iframes
LDA.l Ganon_IFrameDuration+$0C
STA $0EE0, X ; give the poor pig some iframes
LDA #$20 : STA $0F10, X
LDA #$09 : STA $0CF2 ; set damage class to silver
SEC : RTL
.normal
CLC : RTL
; return carry set bit if stunned Ganon and Ganon vulnerable to hammer
;--------------------------------------------------------------------------------
CheckBeeBoss:
; Y is sprite index
LDA.l SpecialWeapons : AND.b #$7F : CMP #$06 : BNE .not_bee_mode
LDA #$00 : RTL
.not_bee_mode
LDA.l GanonVulnerabilityItem : CMP #$10 : BNE .normal ; ganon not vulnerable to bee
LDA $0E20, Y : CMP #$D7 : BNE .normal ; not stunned ganon
LDA #$00 : RTL
.normal
LDA $0B6B, Y : AND.b #$02
RTL
; return non-zero A if entity is a boss (and bee should not attack)
;--------------------------------------------------------------------------------
Ganon_CheckByAncilla:
db #$00 ; default behavior--we shouldn't be checking the table here anyway
db #$00, #$05, #$1F, #$07, #$00
db #$02, #$0B, #$19, #$18, #$1C
db #$00, #$00, #$00, #$00, #$00
db #$00, #$00, #$31, #$00, #$00
Ganon_IFrameDuration:
db #$00 ; default behavior--we shouldn't be here anyway
db #$00, #$00, #$00, #$34, #$00
db #$00, #$00, #$00, #$00, #$00
db #$00, #$00, #$00, #$00, #$00
db #$00, #$00, #$00, #$00, #$00
;--------------------------------------------------------------------------------

View File

@@ -9,11 +9,11 @@ SpawnZelda:
+ RTL
;--------------------------------------------------------------------------------
EndRainState:
LDA.l InitProgressIndicator : BIT.b #$80 : BNE + ; check for instant post-aga
LDA.b #$02 : STA.l ProgressIndicator
RTL
LDA.l InitProgressIndicator : BIT.b #$80 : BNE + ; check for instant post-aga
LDA.b #$02 : STA.l ProgressIndicator
RTL
+
LDA.b #$03 : STA.l ProgressIndicator
LDA.l InitLumberjackOW : STA.l OverworldEventDataWRAM+$02
LDA.b #$03 : STA.l ProgressIndicator
LDA.l InitLumberjackOW : STA.l OverworldEventDataWRAM+$02
RTL
;--------------------------------------------------------------------------------

View File

@@ -4,7 +4,7 @@
LoadZoraKingItemGFX:
LDA.l ZoraItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA.l $1DE1C3 ; location randomizer writes zora item to
JML.l PrepDynamicTile
JML RequestSlottedTile
;--------------------------------------------------------------------------------
JumpToSplashItemTarget:
LDA $0D90, X