501 Commits

Author SHA1 Message Date
Lexi Rose
71ae68db77 Merge pull request #221 from aerinon/SancAndQuitFix
fix: sanc & quit fix
2024-10-25 14:16:06 -05:00
aerinon
fb35c96e11 fix: sanc & quit fix 2024-10-25 12:45:44 -06:00
Lexi Rose
758449b7b9 Merge pull request #220 from spannerisms/real
tourney stuff
2024-10-11 09:18:05 -07:00
spannerisms
27a19ce299 tourney stuff 2024-10-10 23:33:20 -04:00
Lexi Rose
86f641b710 Merge pull request #217 from hiimcody1/pseudoboots-visibility
Add indicator for pseudoboots to File Select screen
2024-06-13 13:36:07 -07:00
Lexi Rose
cc309ecb48 Merge pull request #215 from ardnaxelarak/use_text_table
Replace long sequences of dbs with strings using a text table
2024-06-10 08:07:46 -07:00
hiimcody1
474cfba250 Add indicator for pseudoboots to File Select screen 2024-06-08 21:29:20 -04:00
29d241bcbe Replace long strings of dbs with using a text table 2024-02-20 23:04:25 -06:00
Lexi Rose
dcb0a2b42d Merge pull request #214 from crossedstaves/master
Bomb count fix
2024-02-18 08:41:39 -08:00
crossedstaves
de8703e13f Update retro.asm
Fix to erroneous infinite bomb count
2024-02-17 16:27:42 -06:00
sporchia
2daa8daaae some register issues 2024-02-17 14:24:25 -06:00
Lexi Rose
ce8497e3d2 Merge pull request #213 from spannerisms/fixes
MSU, etc fix
2024-01-15 21:29:34 -06:00
spannerisms
014b3a719a fix things 2024-01-04 06:45:57 -05:00
Lexi Rose
85581b6813 Merge pull request #212 from cassidoxa/bonkkey
Update HUD when picking up bonk key
2024-01-02 11:33:56 -06:00
cassidoxa
cec4e0430b Fix narrow heart piece sprite shadow flickering 2024-01-02 00:26:12 -05:00
cassidoxa
d81a19c367 Update HUD when picking up bonk key 2024-01-01 22:29:14 -05:00
Lexi Rose
88ef1f385d Merge pull request #211 from cassidoxa/prize_ancilla
Fix dungeon prize ancilla spawn regression
2023-12-28 03:36:58 -06:00
cassidoxa
7001767c9b Fix dungeon prize ancilla spawn regression 2023-12-27 11:39:00 -05:00
Lexi Rose
7116cb6557 Merge pull request #210 from cassidoxa/bonkkey
Fix bonk key double count
2023-11-30 02:29:03 -06:00
cassidoxa
85e338ad67 Fix bonk key double count 2023-11-30 00:42:55 -05:00
Lexi Rose
032d15fba6 Merge pull request #209 from tcprescott/patreon
Names for Patreon Supporters
2023-09-22 23:43:22 -05:00
Thomas Prescott
f133ce7159 add some extra space 2023-09-22 23:09:35 -05:00
Thomas Prescott
c5d8c69396 fix PC addresses for patrons 2023-09-22 22:49:57 -05:00
Thomas Prescott
f71759754e patreon fields 2023-09-22 21:49:50 -05:00
Lexi Rose
507ba379cf Merge pull request #208 from cassidoxa/v31.2.0-fixes
Don't increment highest mail on final stats prep
2023-09-17 13:30:02 -05:00
cassidoxa
334f721a29 Don't increment highest mail on final stats prep 2023-09-17 12:02:54 -04:00
Lexi Rose
0fdb6ed133 Merge pull request #207 from cassidoxa/v31.2.0-fixes
Add time stamp for tossed fighter sword item
2023-09-10 01:31:32 -05:00
cassidoxa
cc36ccc0b1 Add time stamp for tossed fighter sword item 2023-09-10 00:55:03 -04:00
Lexi Rose
fcbde59a1e Merge pull request #206 from cassidoxa/v31.2.0-fixes
Fix HUD rebuild when releasing fairy
2023-09-09 04:21:01 -05:00
cassidoxa
70758bf5c0 Set silvers bit with silvers restriction 2023-09-08 15:43:31 -04:00
cassidoxa
f6842204d0 Fix BowTracking docs 2023-09-08 15:30:37 -04:00
cassidoxa
8af9c17cfe Fix stumpy double item 2023-09-08 13:57:26 -04:00
cassidoxa
57e537f12d Fix HUD rebuild when releasing fairy 2023-09-08 08:56:23 -04:00
Lexi Rose
bc3dd5c186 Merge pull request #205 from cassidoxa/v31.2.0-fixes
Fix HUD item icon not refreshing after last bomb spent
2023-09-08 02:30:29 -05:00
cassidoxa
71e86f7c1a Set our hud update flag on quickswap 2023-09-08 00:35:06 -04:00
cassidoxa
0f72e6fcec Better solution 2023-09-08 00:21:24 -04:00
cassidoxa
790f3f0ba3 Fix HUD item icon not refreshing after last bomb spent
Rename UpdateHUD to UpdateHUDFlag, replace with UpdateHUD vanilla JSR
label
2023-09-07 16:29:45 -04:00
Lexi Rose
6a55fc2b12 Merge pull request #204 from cassidoxa/v31.2.0-fixes
Fix some stats counting
2023-09-07 11:50:36 -05:00
cassidoxa
7dc71cf1ac Fix some stats counting 2023-09-07 11:53:24 -04:00
Lexi Rose
5a0bd6dbe0 Merge pull request #203 from cassidoxa/v31.2.0-fixes
Rework bow tracking to assign tracking bits to non-chest sprites
2023-09-05 03:23:35 -05:00
cassidoxa
f778674b83 Rework bow tracking to assign tracking bits to non-chest sprites
Fix small key palettes to be consistent with vanilla colors
2023-09-04 22:29:50 -04:00
Lexi Rose
2e433732f8 Merge pull request #202 from cassidoxa/v31.2.0-fixes
Fix HUD heart colors on credits end screen
2023-09-04 15:15:37 -05:00
cassidoxa
4ec523c8b3 Fix HUD heart colors on credits end screen
Small fix for counting menu HUD keys for "this dungeon"
2023-09-04 13:28:51 -04:00
Lexi Rose
23b6e1ae6b Merge pull request #201 from cassidoxa/v31.2.0-fixes
Palette fix for GT Torch/Hera cage items that load new palette
2023-09-03 16:11:15 -05:00
cassidoxa
9800a86189 Palette fix for GT Torch/Hera cage items that load new palette 2023-09-03 15:39:53 -04:00
Lexi Rose
74a31f5f11 Merge pull request #200 from cassidoxa/v31.2.0-fixes
Fix active flute standing item gfx
2023-09-02 23:23:42 -05:00
cassidoxa
73b2a180ba Fix AddInventory/stats tracking with 16 bit item properties 2023-09-02 22:57:50 -04:00
cassidoxa
2cead7ae92 Fix Active flute standing item gfx
Move setting dungeon completed to prize pickup (or after aga1/aga2)
Fix some inverted tiles
Remove text-related conditional assembly
Make InventoryTable_properties 16 bits wide
Fix expanded save slot writing to cart SRAM
Fix HUD resetting with red potion
2023-09-02 15:55:37 -04:00
Lexi Rose
6fbce240b8 Merge pull request #199 from cassidoxa/decompressed
Fix for item receipt after GT boss heart container collected
2023-08-31 17:39:17 -05:00
cassidoxa
3a5974b456 Only check if we're getting a chest item if boss heart flag is set 2023-08-31 16:38:53 -04:00
cassidoxa
71e6d54276 Fix for item receipt after GT boss heart container collected 2023-08-31 15:17:07 -04:00
Lexi Rose
139c963e6a Merge pull request #198 from spannerisms/decompressed
Absorb torch keys if they belong to the dungeon they're in.
2023-08-31 03:07:31 -05:00
cassidoxa
29176fa194 Absorb torch keys if they belong to the dungeon they're in. 2023-08-30 20:47:06 -04:00
Lexi Rose
d6ac9feae4 Merge pull request #197 from spannerisms/decompressed
Glitch fixes
2023-08-30 11:45:05 -05:00
cassidoxa
90c8e95f9b Fix overworld item duping
Fix setting dungeon completed when Aga 1 and 2 are defeated (prize drops)
2023-08-30 01:25:43 -04:00
S
c6e586fbb8 Merge pull request #196 from spannerisms/decompressed
Even more v31.2.0
2023-08-29 16:40:31 -04:00
cassidoxa
4c98268d81 Various fixes 2023-08-29 16:03:22 -04:00
Lexi Rose
e3a35ef5fc Merge pull request #195 from spannerisms/decompressed
More v31.2.0
2023-08-26 23:39:21 -05:00
cassidoxa
52d2616537 RomSpeed option 2023-08-26 23:24:34 -04:00
cassidoxa
05a79ad2d9 Fix Ped/GT open modes
Fix key colors
2023-08-26 20:29:38 -04:00
cassidoxa
7e513c4696 More sprite fixes 2023-08-26 14:30:39 -04:00
cassidoxa
77e269ff31 Ridiculous game 2023-08-26 01:42:31 -04:00
cassidoxa
90ffa8bd23 Fix cave state item cutscene flag with boss hearts
Add item substitutions
2023-08-25 21:11:48 -04:00
cassidoxa
5ac2f8c537 Fix GFX transfer, use stack
Fix HUD arrow icon after buying shop arrow
2023-08-25 12:29:52 -04:00
cassidoxa
3f5455b647 Fix key palettes
Fix HUD item counter when releasing bee
2023-08-25 09:48:29 -04:00
cassidoxa
1cbcd1d5ff Sprite fixes 2023-08-25 01:38:32 -04:00
Lexi Rose
188c965fbc Merge pull request #194 from spannerisms/decompressed
More v31.2.0 fixes
2023-08-23 21:10:13 -05:00
cassidoxa
247128b9f6 Move setting DungeonsCompleted bitfield to post-boss/prize transition 2023-08-23 13:24:46 -04:00
cassidoxa
9bde734ca3 Fix current dungeon items in menu 2023-08-22 16:22:39 -04:00
cassidoxa
80f94824f4 Small fixes 2023-08-22 10:18:02 -04:00
cassidoxa
e2525ebdb1 Rework menu dungeon item + select behavior
Fix colored heart animations
2023-08-22 01:40:53 -04:00
cassidoxa
66540f2819 Replace GT, Ganon vuln crystal checks, ped check with new system
InvincibleGanon 0x18003E -> GanonVulnerableMode 0x1801A8-0x1801A9
NumberOfCrystalsRequiredForTower 0x18005E -> GanonsTowerOpenTarget 0x18019A-0x18019B
NumberOfCrystalsRequiredForGanon 0x18005F -> GanonVulnerableTarget 0x1801A6-0x1801A7
Various fixes
Moved CrystalCounter to word length space $7EF471 -> $7EF476
2023-08-21 20:43:27 -04:00
spannerisms
59b16eeb05 optimize/fix inverted maps 2023-08-21 07:10:26 -04:00
cassidoxa
63ba27e93d Update item gfx/receipt documentation in itemdatatables.asm 2023-08-20 19:59:55 -04:00
cassidoxa
ca917404e5 Inverted maps 2023-08-20 11:51:12 -04:00
cassidoxa
ba080ef556 Fix HC/Sewers keys and inverted castle hole 2023-08-19 21:41:58 -04:00
cassidoxa
8a63b7ca91 v31.2.0 fixes 2023-08-19 14:33:24 -04:00
Lexi Rose
71d3f6cefe Merge pull request #193 from spannerisms/decompressed
Decompressed
2023-08-16 01:56:09 -05:00
cassidoxa
e206d6f368 Small fixes 2023-08-15 23:55:53 -04:00
cassidoxa
1b115ebb50 Fix pyramid map 2023-08-14 12:49:30 -04:00
cassidoxa
491e033ff0 Fix heart piece item resolution when mirroring
Fix HC big key incrementing total item count
Fix key tracking
Fix misc stat incrementing
2023-08-14 00:25:59 -04:00
cassidoxa
a3bc24c383 Quick fixes for shop fighter shield and retro shop arrow 2023-08-13 19:51:29 -04:00
cassidoxa
cc83fef9b0 Shops VRAM transfer 2023-08-13 18:55:52 -04:00
cassidoxa
aaf970b837 Heart colors 2023-08-13 13:46:21 -04:00
cassidoxa
ad17c8e88d More small fixes 2023-08-12 15:34:33 -04:00
cassidoxa
ed1a8f1bdb Update ROM version
Breaking changes:
Dungeon prize table at $81C6FC uses receipt id instead of vanilla index
Removed Gfx pointers from tables.asm
2023-08-12 10:21:34 -04:00
cassidoxa
858057d9c0 Lower case item text 2023-08-12 01:58:50 -04:00
cassidoxa
a2671e7ed5 A few font fixes 2023-08-11 20:11:50 -04:00
cassidoxa
103f072cf3 Add back some JP characters and re-arrange player name screen
Re-arrange a bunch of text-related stuff
Fix post-credits game counter
Fix bows
2023-08-11 02:10:54 -04:00
cassidoxa
56cb17a0a3 Small fixes 2023-08-08 01:00:49 -04:00
cassidoxa
39ac6c301a Fix mushroom gfx loading 2023-08-07 13:50:33 -04:00
cassidoxa
87e665965c Free crystals and ability to shuffle dungeon prizes
Overworld map code via Aerinon
2023-08-06 23:07:39 -04:00
cassidoxa
cb16ffc20b Merge branch 'master' into decompressed
Also some pendant receipt and palette fixes
2023-08-02 17:40:38 -04:00
cassidoxa
d446bd3c1b More fixes 2023-08-02 15:39:03 -04:00
cassidoxa
ddfb8eed0f Small fixes 2023-08-01 20:30:15 -04:00
cassidoxa
8ed4cbda1d Palette handling & sprite props data tables
Statically assign item data tables
Fix some save-related bugs
Fix dungeon item notice in "this dungeon" with free dungeon items
2023-08-01 17:13:47 -04:00
cassidoxa
d3ed95d639 Refactor inventory.asm
Refactor extended save data to use MVN
Free small keys can be place in their own dungeon
2023-07-29 00:48:34 -04:00
cassidoxa
0a073df728 Item receipt refactor
Inverted maps
Fix shops
2023-06-30 21:21:59 -04:00
spannerisms
83377b6bea fast hearts 2023-06-13 07:28:25 -04:00
Lexi Rose
421740cdae Merge pull request #192 from cassidoxa/hundo_mode
Add "completionist" goals and HUD item counter
2023-06-10 22:26:37 -05:00
cassidoxa
389e436b52 More HUD fixes 2023-06-10 22:05:55 -04:00
cassidoxa
bbd25c2543 Fix Bow icon
Set dungeon ID to $FF after Aga 2 kill for proper HUD draw
2023-06-10 12:26:01 -04:00
cassidoxa
d5b5a20862 OHKO HUD 2023-06-09 18:45:57 -04:00
cassidoxa
fed357141b Bump version 2023-06-09 16:16:02 -04:00
cassidoxa
c3c7078969 Fix HUD arrow icon 2023-06-08 23:59:55 -04:00
cassidoxa
aec3370f48 More HUD stuff 2023-06-08 19:26:31 -04:00
cassidoxa
815c2ab81f More fast hud
Added update hud flag
2023-06-08 11:21:42 -04:00
cassidoxa
3a90df5bd4 Fast HUD via kan 2023-06-07 19:44:52 -04:00
cassidoxa
878536903e Initial total item count HUD
Initial 100% item collection Ganon vulnerability
2023-06-05 15:05:31 -04:00
spannerisms
21522f29d1 credits 2023-03-30 01:51:12 -04:00
Lexi Rose
23ecf41b33 Merge pull request #191 from cassidoxa/keys_hud
Properly mask HUD item flags
2023-03-15 11:50:57 -05:00
cassidoxa
0505cc28e1 Properly mask HUD item flags 2023-03-15 12:42:45 -04:00
Lexi Rose
c7c5ac23a8 Merge pull request #190 from cassidoxa/keys_hud
Fix file select HUD I broke
2023-03-13 20:49:11 -05:00
cassidoxa
5ef08d934c Fix file select HUD I broke 2023-03-13 17:49:00 -04:00
Lexi Rose
5a0990638c Merge pull request #189 from cassidoxa/keys_hud
Fix small key stats tracker
2023-03-13 12:28:15 -05:00
cassidoxa
1f8389c446 Fix small key stats tracker 2023-03-13 13:15:30 -04:00
Lexi Rose
95f0e9eed2 Merge pull request #188 from cassidoxa/keys_hud
Compass and map HUD display modes properly skip or draw
2023-03-12 20:42:04 -05:00
cassidoxa
efa5d288a8 Fix typo 2023-03-12 19:14:14 -04:00
cassidoxa
df60b3641b Draw flute, shovel, powder, mushroom correctly on file select 2023-03-12 18:30:02 -04:00
cassidoxa
7968ddf020 Compass and map HUD display modes properly skip or draw
Minor key count refactor, count HC and Sewers as both in all cases
2023-03-12 17:20:54 -04:00
Thomas Prescott
c0986d6bbc Remove file select screen border 2023-03-08 08:20:07 -06:00
Lexi Rose
d0f9bf6b32 Merge pull request #186 from cassidoxa/init_save
Delete save backup when header name doesn't match SRAM
2023-03-07 02:11:58 -06:00
cassidoxa
af1df7cc6c Delete save backup when header name doesn't match SRAM
Ram init refactor
2023-02-28 11:19:20 -05:00
Lexi Rose
5e3fce17be Merge pull request #185 from cassidoxa/map_counts
Fix dungeon indexing for compass/map hud coutns
2023-02-24 16:56:53 -06:00
cassidoxa
af05d2df44 Merge branch 'master' into map_counts 2023-02-24 17:48:08 -05:00
cassidoxa
5546827c48 Fix dungeon indexing for compass/map hud 2023-02-24 17:47:28 -05:00
Lexi Rose
23427497b4 Merge pull request #184 from cassidoxa/map_counts
Add HUD map mode flag, "chest key" totals table, and seen-counter flags for tracking
2023-02-24 16:08:37 -06:00
cassidoxa
d76d4b4254 Skip HUD count drawing routine if nothing enabled 2023-02-24 16:09:07 -05:00
cassidoxa
068d4c2449 Port map key counter on HUD from DR 2023-02-23 21:46:27 -05:00
cassidoxa
a2020c9c76 Add HUD map mode flag, "chest key" totals table, and seen-counter flags
for tracking
2023-02-23 20:46:40 -05:00
Lexi Rose
66fd23fc61 Merge pull request #183 from cassidoxa/sram_checksum
Compute and write save checksum on new file creation
2023-02-21 15:13:49 -06:00
cassidoxa
af59265712 Don't lock inventory stats; temp fix for post-game progressive items 2023-02-21 15:39:55 -05:00
cassidoxa
02786974ad Compute and write save checksum on new file creation 2023-02-21 14:58:24 -05:00
Lexi Rose
aed9166f48 Merge pull request #182 from cassidoxa/fontstuff
Lower case stuff
2023-02-20 18:31:14 -06:00
cassidoxa
d5c8de0436 Fix inverted castle hole typo 2023-02-20 17:25:59 -05:00
cassidoxa
3b848f0586 Lower case stuff 2023-02-20 13:41:24 -05:00
spannerisms
aae1e2a1f3 fastrom 2023-02-14 01:24:43 -05:00
Thomas Prescott
d7887b2305 Merge pull request #181 from spannerisms/v31.1
file select
2023-02-13 17:17:42 -06:00
spannerisms
c0b7605c12 fix hearts 2023-02-13 13:53:23 -05:00
spannerisms
663ba966a1 file select 2023-02-13 13:14:35 -05:00
spannerisms
caac2877fc tiny fixes 2023-02-13 13:00:04 -05:00
spannerisms
830e86f199 inverted maps
untested, unfinished
2023-02-11 05:22:27 -05:00
Lexi Rose
c2ea144bfb Merge pull request #180 from cassidoxa/filename_numbers
Add numbers to file name screen
2023-01-25 09:21:53 -06:00
cassidoxa
7151093664 Add numbers to file name screen 2023-01-17 17:01:21 -05:00
Lexi Rose
35e1b3a659 updated name for contributor MATRETHEWEY 2023-01-09 01:15:27 -06:00
Lexi Rose
85b433fcd4 delete garbage empty file 2023-01-09 00:36:50 -06:00
spannerisms
4802107516 bug fixes 2023-01-02 06:21:15 -05:00
spannerisms
ff88437f8e fixes
turn a bunch of addresses into fast rom
bunch of consistency clean ups in hooks
move zsnes to failures
2022-12-30 03:07:15 -05:00
Thomas Prescott
05fdeaccb0 Pyramid sign fix from Zarby 2022-12-29 11:57:12 -06:00
Lexi Rose
c23facd617 Merge pull request #179 from cassidoxa/tablets
Fix tablet flags
2022-12-29 11:29:59 -06:00
cassidoxa
36ca193b75 Newitems
Fix magic bar & file select HUD
2022-12-29 12:09:50 -05:00
cassidoxa
5ab91e7137 Fix tablet check 2022-12-19 12:37:51 -05:00
Lexi Rose
186cbba855 Merge pull request #177 from cassidoxa/newfont
New font changes
2022-12-09 10:09:22 -06:00
Lexi Rose
1d64ee7926 Merge pull request #176 from cassidoxa/menu_dungeonhud
Allow menu free dungeon item toggle with no menu items
2022-12-09 10:07:46 -06:00
cassidoxa
6797e84696 Linux asar link against older glibc 2022-12-08 23:33:06 -05:00
cassidoxa
6e876b2d1f Update build scripts 2022-12-08 23:16:20 -05:00
cassidoxa
4437982063 Merge branch 'binaries' into newfont 2022-12-08 23:08:18 -05:00
cassidoxa
3c7399eb12 Add bin/ directory with asar executables
Removed execute permissions on a bunch of text and gfx files
2022-12-08 22:49:59 -05:00
spannerisms
89f2f555e5 fix rupees 2022-12-08 00:27:58 -05:00
spannerisms
03601d5df5 dumb thing i have to push before i stop 2022-12-06 03:07:19 -05:00
spannerisms
194e745f22 bees 2022-12-05 11:32:14 -05:00
spannerisms
918173523f faster HUD 2022-12-05 02:01:46 -05:00
spannerisms
0397623340 cassidy
item properties tabulated with a macro
new item graphics
better hex to dec code
some item code readability improvements
2022-12-05 00:18:27 -05:00
cassidoxa
dac500627c Update build scripts for new font 2022-12-01 18:48:53 -05:00
cassidoxa
d7431b6550 Allow menu free dungeon item toggle with no menu items 2022-11-27 23:35:59 -05:00
cassidoxa
aa65adbec5 New font changes
Added lower case text for free dungeon items (via Aerinon)
Changed credits gfx to properly include symbols on player name screen
2022-11-26 22:13:12 -05:00
Lexi Rose
b2fdeb6b84 Merge pull request #175 from cassidoxa/quickswap
RAM labels, Length Annotations, and Quickswap Fix
2022-11-25 18:58:17 -06:00
cassidoxa
69fd6015e6 Some more annotations 2022-11-25 01:08:07 -05:00
cassidoxa
8d0315e4c1 Reserve private, 3rd party WRAM block
Reserve large decompression buffer
2022-11-24 23:07:16 -05:00
cassidoxa
823166c4cd Re-organize vanillalabels.asm 2022-11-24 22:24:38 -05:00
cassidoxa
9425b1c3b1 Move zoraking.asm and catfish.asm into npcitems.asm 2022-11-24 22:02:55 -05:00
cassidoxa
d3cd3a86ca Move tree kid stuff into hooks.asm 2022-11-24 21:53:18 -05:00
cassidoxa
524a27d680 Merge branch 'master' into quickswap 2022-11-24 19:05:24 -05:00
cassidoxa
7426ce5945 More RAM labels
Fixed tablets checking for item collected, uses NpcFlags+1
Deleted mantle.asm, moved to lampmantlecone.asm
2022-11-24 18:34:35 -05:00
cassidoxa
da8576546d Move binary data to new data directory 2022-11-22 01:02:16 -05:00
cassidoxa
09d15f3294 Another WRAM label pass
Deleted compression.asm
2022-11-22 00:36:39 -05:00
cassidoxa
788cceaab9 Continue labeling and documentation in ram.asm, main rando block
Deleted several unused modules and some commented code
Reorganized some routines to clean up modules
Moved some memory into mirrored WRAM
Refactored NMI hook aux routine
Removed old fake flipper fix
2022-11-16 21:38:28 -05:00
cassidoxa
43f753b517 ram.asm initial commit. Replaced all address defines with labels
Value defines styled without quotes, # moved to load/store/cmp site
Added registers.asm (copied from spannerisms JP disassembly)
Added a bunch of length annotations
Deleted old or trivial commented out code
Deleted: ganonfixes.asm, map.asm, seedtag.asm
Replaced obsolete credits.asm with creditsnew.asm
Moved scratch space at $7F5020-3F to mirrored WRAM (7E1E70-8F)
Moved clock RAM to mirrored WRAM (7E1E90-9F)
dialog.asm: FreeDungeonItemNotice preserves callee-preserved scratch RAM
Toast buffer moved to mirrored WRAM (7E1E0E-0F)
servicerequest.asm: long store to $012E converted to word length store
2022-11-05 00:50:25 -04:00
Lexi Rose
9cf3cb0601 Merge pull request #174 from cassidoxa/hera_music
Fix check for Tower of Hera boss defeated
2022-10-25 21:47:11 -05:00
cassidoxa
6b2e7a5c34 Fix check for Tower of Hera boss defeated
Improve room data documentation
2022-10-25 22:38:19 -04:00
cassidoxa
cafb0908a0 Introduce bound to QS loop to prevent infinite loop on last bomb loss
Move !INFINITE_BOMB define to ram.asm, replace with labels
2022-10-23 22:02:36 -04:00
Lexi Rose
0e87fb3bc4 Merge pull request #172 from cassidoxa/shields
newitems: Progressive shields, swords, and mail use highest item level to determine upgrade
2022-10-22 16:32:16 -05:00
Lexi Rose
177452c853 Merge pull request #173 from cassidoxa/oldman_entrance
darkworldspawn: Add check for old man to fix post-aga spawn bug
2022-10-22 16:32:03 -05:00
cassidoxa
dbf674c9fd darkworldspawn: Add check for old man to fix post-aga spawn bug 2022-10-20 14:47:04 -04:00
cassidoxa
651d00d320 Progressive shields, swords, and mail use highest item level to
determine upgrade
2022-10-09 17:09:43 -04:00
Lexi Rose
48ccf03ac8 Merge pull request #170 from cassidoxa/ammo_capacity
Combine starting max ammo and capacity upgrade in SRAM into single, flat ammo capacity values
2022-10-01 08:08:26 -05:00
cassidoxa
f8d9be201a tables.asm: Add GFX pointer to table in utilities.asm 2022-09-09 19:30:16 -04:00
cassidoxa
031e3965b2 Requires frontend changes
Change SRAM ammo capacity upgrades to flatly represent max capacity
2022-08-08 13:42:19 -04:00
Lexi Rose
aba3ec930d Merge pull request #169 from cassidoxa/validate_sram
Compute checksum for extended SRAM
2022-08-01 08:40:19 -05:00
cassidoxa
95ee31f7c9 Remove some hard coded addresses for MVN instructions 2022-07-29 22:04:13 -04:00
cassidoxa
d8846a4ba9 Add backup save that gets checked and loaded if main save is corrupt
Add suffixes to instructions in save.asm
Disable HDMA, NMI, and joypad during extended save DMA
2022-07-29 20:57:54 -04:00
cassidoxa
10079a539b Compute checksum for extended SRAM
Validate SRAM on file screen load and delete if checksum incorrect
2022-07-25 22:19:06 -04:00
Lexi Rose
0e6e5d5b45 Merge pull request #167 from cassidoxa/elder_submodule
Check submodule during goal NPC interaction to prevent it from firing when menu is open
2022-07-14 22:40:37 -05:00
cassidoxa
9e5e9a17ed Check submodule during goal NPC interaction to prevent it from firing
when menu is open (via kan)
2022-07-05 12:49:00 -04:00
Lexi Rose
04906b5f87 Merge pull request #164 from aerinon/DungeonsCompletedReverse
Dungeons completed reverse
2022-06-11 10:32:21 -05:00
Lexi Rose
2297a8f0a2 Merge pull request #163 from cassidoxa/cavestate_dungeonitems
Add data after dungeon item masks to maintain expected glitch behavior
2022-06-11 10:31:14 -05:00
cassidoxa
da8ce3c6b1 Fix OW event data bit labels 2022-05-30 19:33:27 -04:00
aerinon
1ccc24f72f Fix dungeon completion bitfield (16-bit) 2022-05-26 09:14:08 -06:00
aerinon
bea2d24d4d Fix dungeon completion bitfield 2022-05-26 09:14:05 -06:00
cassidoxa
e1258eba06 Add data after dungeon item masks to maintain expected glitch behavior 2022-05-22 15:13:01 -04:00
Lexi Rose
6ff400776a Merge pull request #162 from cassidoxa/compasses
Fix checking compass mode for compass count display bitfield
2022-05-19 23:59:16 -05:00
cassidoxa
cc1d97466c Fix compass count stuff 2022-05-19 13:23:55 -04:00
cassidoxa
b095a0c337 Mask out high bits of CompassMode when maybe setting compass counts
displayed flag
2022-05-17 17:23:15 -04:00
Lexi Rose
6d39ea5872 Merge pull request #161 from aerinon/FontFix
Add lowercase letters to credits end screen
2022-04-29 10:17:45 -05:00
aerinon
55970bdff9 Delete test file 2022-04-28 16:38:50 -06:00
aerinon
326b8f294e Shifted uppercase font.
Used FEATURE_NEW_TEXT flag
2022-04-28 16:09:12 -06:00
aerinon
6def39ff58 Add lowercase letters to credits end screen 2022-04-27 14:16:24 -06:00
Lexi Rose
5861f546ad Merge pull request #160 from ardnaxelarak/main
Unscramble lowercase letters for new font
2022-04-17 03:17:31 -05:00
638967ee9c unscramble lowercase letters for new font 2022-04-17 00:42:10 -07:00
Lexi Rose
c6adf11a0d Merge pull request #159 from cassidoxa/sram_rework
SRAM Re-work
2022-04-05 09:38:27 -05:00
Lexi Rose
a754a6f22b Merge pull request #158 from spannerisms/master
Failures
2022-04-05 09:37:57 -05:00
cassidoxa
5d943d9a6d Add dungeons completed bitfield from door rando 2022-02-23 12:42:21 -05:00
cassidoxa
838d4e9bf8 Refactor dungeon locations checked incrementing
Fix BowTracking documentation
2022-02-18 17:45:33 -05:00
cassidoxa
905e897b52 Handle 16-bit GoalCounter and TotalItemCounter
Fix vanilla sword + shield item
Fix how progressive items handled
Clean up compasses.asm
2022-02-08 19:25:59 -05:00
cassidoxa
02932a2a9d Add comments to initsramtables.asm 2022-02-07 20:05:52 -05:00
cassidoxa
959aa40f58 Increment ROM version 2022-02-03 22:48:20 -05:00
cassidoxa
3c6c45ddb4 Fix some mangled labels 2022-02-03 22:01:34 -05:00
cassidoxa
dfc4284a70 Merge branch 'master' into sram_rework 2022-02-03 21:20:16 -05:00
cassidoxa
3e2362b7ca Implement initial SRAM table
Data in initialsramtable.asm gets copied to SRAM on save file init
Frontend will be responsible for setting this, requires frontend changes
Changed some label names to disambiguate WRAM and SRAM labels
Deleted open mode
2022-02-03 20:25:32 -05:00
cassidoxa
c048589c02 Add static file name feature by special request
Move compass count ram init to compasses.asm
Rename WRAMEquipment and SRAMEquipment to EquipmentWRAM/SRAM
2022-02-02 16:51:50 -05:00
spannerisms
8f74ddab05 fix
forgot to account for the stack pointer being screwed up when we start using the stack again

might as well add in better VWF control and move hex to BG2 for more space
2022-01-27 01:24:28 -05:00
spannerisms
a247a0ae01 tinker tinker 2022-01-26 08:22:44 -05:00
spannerisms
7ca4fd6467 Merge branch 'master' of https://github.com/spannerisms/z3randomizer 2022-01-26 06:41:56 -05:00
spannerisms
32d619c9e7 BSOD 2022-01-26 06:41:34 -05:00
Lexi Rose
c515beb853 Merge pull request #155 from tewtal/new-text-renderer
Improved dialog text rendering
2022-01-20 16:00:20 -06:00
Thomas Backmark
b46269b662 Moved the new text renderer behind a feature flag 2022-01-20 22:24:52 +01:00
cassidoxa
b91ac58b47 Merge branch 'master' into sram 2022-01-20 11:16:31 -05:00
Lexi Rose
02ed70442d Merge pull request #154 from cassidoxa/starting_area_exit
Fix reading starting area offset to prevent indexing out of bounds
2022-01-20 02:33:52 -06:00
Lexi Rose
df27e07221 Merge pull request #156 from Catobat/HeraBoss
Fix Tower of Hera boss music bug and witch item bug
2022-01-20 02:33:27 -06:00
cassidoxa
6c4acb1e5b Check new value in SRAM to determine if Aga 2 duck comes
Added pushpc/pullpc to sram.asm
2022-01-19 20:17:02 -05:00
Catobat
78148fb4f3 Fix witch item bug 2022-01-20 01:30:21 +01:00
Catobat
f3d1e99421 Fix Tower of Hera boss music bug 2022-01-19 19:52:01 +01:00
Thomas Backmark
b392eb7554 Improved text renderer with lowercase letters 2022-01-18 11:10:14 +01:00
cassidoxa
1d378211ba Initialize overworld door frame data when starting in single-exit cave 2022-01-13 15:51:50 -05:00
cassidoxa
cad5a43d4b Change bitfield letters to match JP disassembly
Add sprite item pot data block
2022-01-12 21:52:47 -05:00
cassidoxa
6d72a1a9c2 Fix reading starting area offset to prevent indexing out of bounds 2022-01-12 20:31:27 -05:00
Thomas Prescott
2a3d6fae58 update credits 2022-01-03 13:55:03 -06:00
cassidy
6f58b9f959 Merge branch 'master' into sram 2021-12-28 00:30:13 -05:00
Lexi Rose
4eafefb501 Merge pull request #153 from spannerisms/master
Fix EG
2021-12-21 23:19:16 -06:00
spannerisms
04fa0fc1a1 match expected usage 2021-12-20 16:42:56 -05:00
cassidy
e8623768af Merge branch 'sram' of https://github.com/cassidoxa/z3randomizer into sram 2021-12-17 13:56:15 -05:00
cassidy
ed225e044b Cleanup in sram.asm and compasses.asm 2021-12-17 13:53:53 -05:00
cassidy
c09839eb33 Fix sword and shield item downgrade 2021-12-16 17:19:55 -05:00
cassidy
be2d59eec8 Fix compass items collected counts on HUD 2021-12-16 17:19:55 -05:00
cassidy
c4c9065a79 Fix ROM version location
Remove comments, general cleanup
2021-12-16 17:19:55 -05:00
cassidy
c8ea2c6dce Move compass counts to ROM and trackable RAM
Add flag if compass HUD count has been displayed in SRAM
Move low hearts fix from tables.asm to bugfixes.asm
Rearrange dungeon stats in SRAM to match door rando ROM
2021-12-16 17:19:55 -05:00
cassidy
6c9b33ed93 Write macro for SRAM assertions
Change some label names to be clearer
Fix some of the progress flags and dungeon bitfields
2021-12-16 17:19:55 -05:00
cassidy
15d88b19a3 Fix dungeon key and locations checked tables, reserve unused indices
Swap locations checked with absorbed keys to match door rando
2021-12-16 17:19:55 -05:00
cassidy
e2bb55c1ba Fix asserts 2021-12-16 17:19:55 -05:00
cassidy
9e2382cbb2 Add absorbed keys
Adjust service request stuff
Change chest keys to "collected" keys
2021-12-16 17:19:55 -05:00
cassidy
ae0b57635c Remove defines from LTTP_RND_GeneralBugfixes
Replace more labels
Add ROM version and reserve extra 16 bytes in unused hardware vector in
LTTP_RND_GeneralBugfixes
Move IncrementChestCounter to ChestPrep in newitems.asm
Remove IncrementChestCounter hook which was getting overwritten
More revisions to sram.asm
2021-12-16 17:19:55 -05:00
cassidy
06d0c6e9f9 Removed SRAM trace from tables.asm
Fixed comments related to OpenMode, left open as default
2021-12-16 17:19:54 -05:00
cassidy
7f03cf68e8 Replace labels in fileselect.asm
Full file name has also been moved to the beginning of the new save
space at $7F6000 in WRAM and $700500 in SRAM
2021-12-16 17:19:54 -05:00
cassidy
ae82caca45 Replace more labels
Removed mask from rupeelimit.asm as total item counter is now a 16-bit
value
Commented out CountBits in utilities.asm in previous commit as I've
allocated a counter byte in SRAM
2021-12-16 17:19:54 -05:00
cassidy
fa76b61df0 Change addresses to labels and remove SRAM trace calls 2021-12-16 17:19:54 -05:00
cassidy
774aeb5e73 Next draft of sram.asm. Save/SRAM changes to save, init, and password
Deleted previewdatacopy.asm which was for SRAM Trace which we no longer
support. Password moved to $703000. 32-bits at $FFE0 in ROM (unused
hardware vector) now burned into $702015 in SRAM with ROM name.
2021-12-16 17:19:54 -05:00
cassidy
640e94153d Refactor inventory code and add more labels
Refactored highest sword, shield, and mail counting
Refactored how heart pieces, heart containers, and crystals are counted
Moved quickswap lock bit to high byte of InventoryTracking
Fixed sword and shield item downgrade
Added PreFluteLocations counter
2021-12-16 17:19:54 -05:00
cassidy
e4d917c47c First pass-through adding labels
Added items, equipment, and tracking/indicators
Added playername changes
Removed some defines
2021-12-16 17:19:54 -05:00
cassidy
d47dea6123 Initial SRAM module check in
Changes to save.asm and fileselect.asm to account for new WRAM buffer at
$7F6000 saved at $700500, length $1000.
Moves and additions noted at bottom of sram.asm, to be removed later.
2021-12-16 17:19:53 -05:00
Lexi Rose
7dda06cf11 Merge pull request #152 from spannerisms/master
Bug Fix and MSU
2021-12-16 04:40:15 -06:00
cassidy
7b263917ff Fix sword and shield item downgrade 2021-12-15 19:58:53 -05:00
cassidy
faaf89f584 Fix compass items collected counts on HUD 2021-12-15 19:26:32 -05:00
cassidy
b994668676 Fix ROM version location
Remove comments, general cleanup
2021-12-15 18:06:55 -05:00
spannerisms
42bc1d743a Merge branch 'KatDevsGames:master' into master 2021-12-15 01:12:07 -05:00
spannerisms
aa6aaffd2f prevent crashes 2021-12-15 01:11:26 -05:00
cassidy
7cc5f802f9 Move compass counts to ROM and trackable RAM
Add flag if compass HUD count has been displayed in SRAM
Move low hearts fix from tables.asm to bugfixes.asm
Rearrange dungeon stats in SRAM to match door rando ROM
2021-12-14 22:52:20 -05:00
cassidy
b943f86c15 Write macro for SRAM assertions
Change some label names to be clearer
Fix some of the progress flags and dungeon bitfields
2021-12-14 12:59:05 -05:00
cassidy
7edaedf3f8 Fix dungeon key and locations checked tables, reserve unused indices
Swap locations checked with absorbed keys to match door rando
2021-12-07 20:51:41 -05:00
cassidy
046a98fdaf Fix asserts 2021-12-07 20:51:41 -05:00
cassidy
7c6c5f4316 Add absorbed keys
Adjust service request stuff
Change chest keys to "collected" keys
2021-12-07 20:51:41 -05:00
cassidy
190653d70f Remove defines from LTTP_RND_GeneralBugfixes
Replace more labels
Add ROM version and reserve extra 16 bytes in unused hardware vector in
LTTP_RND_GeneralBugfixes
Move IncrementChestCounter to ChestPrep in newitems.asm
Remove IncrementChestCounter hook which was getting overwritten
More revisions to sram.asm
2021-12-07 20:51:06 -05:00
cassidy
1b9734d1af Removed SRAM trace from tables.asm
Fixed comments related to OpenMode, left open as default
2021-12-07 20:49:58 -05:00
cassidy
db8df2a12b Replace labels in fileselect.asm
Full file name has also been moved to the beginning of the new save
space at $7F6000 in WRAM and $700500 in SRAM
2021-12-07 20:49:58 -05:00
cassidy
c1e4ca0053 Replace more labels
Removed mask from rupeelimit.asm as total item counter is now a 16-bit
value
Commented out CountBits in utilities.asm in previous commit as I've
allocated a counter byte in SRAM
2021-12-07 20:49:58 -05:00
cassidy
c29de40484 Change addresses to labels and remove SRAM trace calls 2021-12-07 20:49:58 -05:00
cassidy
d5c4834b1d Next draft of sram.asm. Save/SRAM changes to save, init, and password
Deleted previewdatacopy.asm which was for SRAM Trace which we no longer
support. Password moved to $703000. 32-bits at $FFE0 in ROM (unused
hardware vector) now burned into $702015 in SRAM with ROM name.
2021-12-07 20:49:58 -05:00
cassidy
2e97329250 Refactor inventory code and add more labels
Refactored highest sword, shield, and mail counting
Refactored how heart pieces, heart containers, and crystals are counted
Moved quickswap lock bit to high byte of InventoryTracking
Fixed sword and shield item downgrade
Added PreFluteLocations counter
2021-12-07 20:49:58 -05:00
cassidy
14b899d47a First pass-through adding labels
Added items, equipment, and tracking/indicators
Added playername changes
Removed some defines
2021-12-07 20:49:58 -05:00
cassidy
fcd9b949e8 Initial SRAM module check in
Changes to save.asm and fileselect.asm to account for new WRAM buffer at
$7F6000 saved at $700500, length $1000.
Moves and additions noted at bottom of sram.asm, to be removed later.
2021-12-07 20:49:57 -05:00
Lexi Rose
df2bca00ee Merge pull request #151 from cassidoxa/rom_version
Add ROM version to unused hw vector and before filename in SRAM
2021-12-07 15:18:24 -06:00
cassidy
c82edadadd Change version defines to use ?= operator
Now these defines can be set via CLI, otherwise will be what they are in the file
2021-12-07 15:45:22 -05:00
cassidy
5fc5dc13b2 Add ROM version to unused hw vector and before filename in SRAM
Two 16 bit ints located at $FFE0 (0x7FE0 PC) in ROM and burned into SRAM
starting at $701FFC, just before the ROM name
2021-12-07 15:29:30 -05:00
spannerisms
580bbb7c67 Merge branch 'KatDevsGames:master' into master 2021-11-12 09:26:40 -05:00
spannerisms
24f6a4d8a8 abcd 2021-11-12 09:25:43 -05:00
Lexi Rose
2fe5f0c126 Merge pull request #150 from spannerisms/master
Fake flippers softlock improvement
2021-11-10 16:38:49 -06:00
spannerisms
553821885f prevent transition 2021-11-01 06:58:30 -04:00
spannerisms
2b1a3566d8 flibber 2021-10-31 10:38:38 -04:00
Thomas Prescott
7f749e9578 Merge pull request #148 from spannerisms/master
Major Glitches
2021-10-30 17:20:00 -05:00
Thomas Prescott
71ae648137 Merge pull request #149 from KatDevsGames/tcprescott-remove-zsnes-graphic
Remove ZSNES graphic
2021-10-30 17:19:52 -05:00
Thomas Prescott
798af49215 Update LTTP_RND_GeneralBugfixes.asm 2021-10-05 17:02:24 -05:00
Thomas Prescott
4ec6acfae7 Remove ZSNES graphic
This graphic takes up too much space.  Instead if the check fails just do a STP and don't include any of the ZSNES graphics.  If we want to add some other message here later we can, but it's more of a nice to have than a necessity.
2021-10-05 14:11:55 -05:00
spannerisms
501699e401 oops 2021-09-18 08:07:45 -04:00
KatDevsGames
1ef55470d5 Merge pull request #147 from cassidoxa/shield_overflow
Shield and Progressive Bow overflow
2021-09-14 13:37:48 -05:00
cassidy
aca809862d utilities: Rewrite prog bow narrow sprite overflow to check sram
This uses Bonta's method which is more efficient and reliable when it
comes to bow state and potential mixture of progressive,
none-progressive, and silver arrows upgrade.
2021-09-08 01:00:55 -04:00
cassidy
c37dcec6ea utilities: refactor some JSL X : RTL into JMP X 2021-09-06 20:20:12 -04:00
cassidy
9f1933d8c0 utilities: Progressive Bow overflow narrow sprites 2021-09-06 20:16:41 -04:00
cassidy
bbc8228175 utilities: Fix shields overflowing with narrow sprites 2021-09-06 17:21:48 -04:00
Thomas Prescott
0a93c3fa00 Merge pull request #146 from Catobat/PrizeIndicator
Fix check for wild maps
2021-09-04 16:09:27 -05:00
Catobat
086230bb8c Fix check for wild maps 2021-08-28 04:01:28 +02:00
qwertymodo
48d9a7d4bc Fix SPC un/mute race condition
Should fix mothula hardlock, for real this time
2021-08-23 11:24:24 -07:00
KatDevsGames
af8a47e743 Merge pull request #144 from spannerisms/master
Fix jingle glitch
2021-08-21 23:46:53 -05:00
Salvatore
9ebde3e5b7 Merge pull request #145 from KatDevsGames/tcprescott-patch-1
Add Pleasure to credits
2021-08-21 20:59:46 -04:00
Thomas Prescott
bd16b9ff92 Add Pleasure to credits
Credit the creator of the website logo
2021-08-21 07:43:23 -05:00
spannerisms
03c287a988 jingle jangle 2021-08-11 06:30:52 -04:00
KatDevsGames
910d63e886 Merge pull request #143 from spannerisms/master
fix quadrant glitch hopefully
2021-08-10 15:13:32 -05:00
KatDevsGames
9067790b20 Merge pull request #141 from compiling/master
Fix clearing frog/smith in inverted mode
2021-08-10 15:13:23 -05:00
KatDevsGames
f69a33aed0 Merge pull request #142 from ardnaxelarak/fix_ohko
Fix OHKO mode
2021-08-10 15:13:13 -05:00
KatDevsGames
f18eac796c Merge pull request #140 from cassidoxa/escape_drop_rng
rngfixes: make enemy drop rng static during the standard escape sequence
2021-08-10 15:13:04 -05:00
spannerisms
7057d984e2 fix quadrant glitch hopefully 2021-08-10 09:56:57 -04:00
230b15a294 Fix OHKO mode 2021-08-09 15:30:16 -07:00
compiling
e2e4db8237 Fix clearing frog/smith in inverted mode 2021-08-08 14:13:40 +10:00
cassidy
fd490cab9a rngfixes: make enemy drop rng static during the standard escape sequence
This only applies between picking up the Uncle item and dropping off
zelda, not rain state in general
2021-08-02 21:06:13 -04:00
KatDevsGames
39441eb0a6 Merge pull request #139 from spannerisms/master
Bug fix
2021-07-30 20:47:55 -05:00
spannerisms
187c2aa4a2 always fix 2021-07-29 09:44:21 -04:00
spannerisms
df66369f17 hopefully fix that text bug 2021-07-29 09:43:08 -04:00
KatDevsGames
8da0dcf3e0 Merge pull request #138 from spannerisms/master
Fix Aga door bug
2021-07-18 13:25:46 -05:00
KatDevsGames
df7ce30bbe Merge pull request #137 from ardnaxelarak/main
Fix drawing C/P indicator
2021-07-18 13:25:36 -05:00
KatDevsGames
a5d66bc5a8 Merge pull request #136 from ardnaxelarak/fix_aga_default
Minor Low-Priority Fixes
2021-07-18 13:25:27 -05:00
spannerisms
b726ea1d0a Merge branch 'KatDevsGames:master' into master 2021-07-17 05:48:21 -04:00
spannerisms
f0a00aea0d fix 2021-07-17 05:46:02 -04:00
a2547e9810 Minor credits fixes 2021-07-16 15:29:01 -07:00
12bc26bd5a Fix extra space in credits 2021-07-12 02:10:12 -07:00
e7d4f09871 Fix junk graphic appearing during GAME OVER screen 2021-07-10 11:27:34 -07:00
3944dadcab Change default for locked aga tower to no longer be inverted 2021-07-08 18:25:04 -07:00
5470b41f46 Fix drawing C/P indicator
- no longer show icon for sewer, HC, AT, or GT
- no longer show junk in map shuffle for dungeons without the map
2021-07-08 17:31:49 -07:00
KatDevsGames
264f7b26bc Merge pull request #134 from Bonta0/fakeboots
Fake boots
2021-07-06 22:25:42 -05:00
KatDevsGames
6f2383fafe Merge pull request #135 from ardnaxelarak/medallion
Implement always-allowed medallions
2021-07-06 17:44:41 -05:00
KatDevsGames
5d7bfde194 Merge pull request #133 from spannerisms/master
boss icons
2021-07-06 17:44:24 -05:00
3548a0bbf5 Implement always-allowed medallions 2021-07-06 12:24:06 -07:00
Bonta
27cb1b5459 Implement Fakeboots 2021-07-05 21:38:08 +02:00
spannerisms
270f0685ff add byrna/cape magic tracking 2021-07-04 05:21:48 -04:00
spannerisms
00c59c791f damage/magic stats 2021-07-03 09:25:33 -04:00
spannerisms
bdd16bc20f dungeon prizes 2021-07-03 09:06:17 -04:00
spannerisms
f403ca10da boss icons 2021-06-30 07:15:37 -04:00
KatDevsGames
04a07025ef Merge pull request #132 from ardnaxelarak/main
Temporary fix for broken missing defines
2021-06-28 20:47:15 -05:00
01537a7f2f Temporary fix for broken missing defines 2021-06-28 15:01:01 -07:00
KatDevsGames
69ec104027 Merge pull request #131 from Bonta0/chestturns
Credits: Add chest turns counter
2021-06-28 11:47:01 -05:00
KatDevsGames
ae0a712bdd Merge pull request #129 from spannerisms/master
OneMind
2021-06-28 11:08:44 -05:00
KatDevsGames
aa4dbde9d7 Merge pull request #125 from Bonta0/bowsprite
Utilities: Fix progressive bow sprite replacement
2021-06-28 11:07:49 -05:00
KatDevsGames
5e152e18ed Merge pull request #126 from Bonta0/quickswapfix
Quickswap: Fix consecutive special swaps
2021-06-28 11:07:23 -05:00
KatDevsGames
49f1f49ccb Merge pull request #127 from Bonta0/escapeassist
Events: Fix unusable infinite bombs with empty inventory
2021-06-28 11:06:51 -05:00
KatDevsGames
38fdf5442a Merge pull request #128 from Bonta0/bonkcounter
Stats: Fix bonk counter
2021-06-28 11:06:27 -05:00
KatDevsGames
72f2a875ca Merge pull request #130 from Bonta0/keycount
Stats: amend incorrect comment in CountChestKey
2021-06-28 11:06:08 -05:00
Bonta
d3db31b05e Events: Fix unusable infinite bombs with empty inventory 2021-06-24 23:12:58 +02:00
spannerisms
be0389ffbb stats 2021-06-24 08:36:04 -04:00
Bonta
1531f7a8e2 Credits: Display chest turns 2021-06-22 02:32:06 +02:00
Bonta
cc12372627 Stats: Track chest turns 2021-06-22 02:31:52 +02:00
qwertymodo
cc9c355ef7 More robust bank fix
Shouldn't crash on crystal/pendant anymore
2021-06-21 13:42:16 -07:00
Bonta
76878def98 Stats: amend incorrect comment in CountChestKey 2021-06-20 16:41:35 +02:00
spannerisms
49afe7ca9b onemind 2021-06-20 10:09:04 -04:00
Bonta
b16f7b4994 Stats: Fix bonk counter 2021-06-20 15:15:55 +02:00
Bonta
4b6d70a61b Quickswap: Fix consecutive special swaps 2021-06-20 12:57:17 +02:00
Bonta
c60cbbc869 Utilities: Fix progressive bow sprite replacement 2021-06-20 12:41:31 +02:00
qwertymodo
429fea004f Set DB/DP to 0 in frame hook
Possible fix for hole transition crashes
2021-06-18 16:50:49 -07:00
KatDevsGames
d0fbd11d0f Merge pull request #124 from cassidoxa/electroflashing
Rewrite electro palette flashing
2021-06-14 19:25:22 -05:00
cassidy
ac2aab4044 Additional comments and style cleanup for consistency 2021-06-14 15:55:21 -04:00
cassidy
77f742b25c Rewrite to handle electro palette, leave bunny alone
Should fix bunny issues
Big thank to kara for report, assistance, and testing
2021-06-14 13:14:38 -04:00
KatDevsGames
2276b5782a Merge pull request #122 from Bonta0/msuresume
MSU: Enable track resuming
2021-06-13 12:59:48 -05:00
KatDevsGames
55c5208652 Merge pull request #121 from tcprescott/patch-4
Update creditsnew.asm
2021-06-13 12:59:04 -05:00
Bonta
14844400b3 MSU1: Minor tweaks to avoid a long jump in main path 2021-06-13 00:38:00 +02:00
Bonta
183d439ff7 MSU1: Fade in on resume 2021-06-12 23:47:46 +02:00
Thomas Prescott
3d7e12a760 Update creditsnew.asm
Add Bonta and Emosaru to the Special Thanks section
2021-06-12 16:15:28 -05:00
Bonta
a9a929c6f4 MSU1: Dont resume track from Link's house 2021-06-12 22:35:07 +02:00
Bonta
3f86caf083 MSU1: Move msu.asm to bank A4 2021-06-12 21:16:30 +02:00
Bonta
ce7396ae35 MSU1: Allow resuming any track 2021-06-12 21:14:50 +02:00
Bonta
34bb99b7d0 MSU1: Resume overworld tracks 2021-06-12 21:14:50 +02:00
KatDevsGames
dca1bfbab2 Merge pull request #120 from spannerisms/master
Fast credits
2021-06-12 13:39:49 -05:00
spannerisms
a378bcf5c5 flag 2021-06-12 13:43:48 -04:00
spannerisms
775a970bcc yes 2021-06-12 07:47:27 -04:00
spannerisms
6261b9b8e0 improvement for UW 2021-06-12 07:46:20 -04:00
spannerisms
3204ad2ed5 fast credits 2021-06-12 07:43:18 -04:00
spannerisms
8f74212259 goals
easy-to-add AD no aga goal
2021-06-12 06:11:04 -04:00
spannerisms
feb27d71b9 heartbeeps 2021-06-12 06:07:38 -04:00
KatDevsGames
1bbf359198 Merge pull request #119 from cassidoxa/entrances
Revert "Update entrances.asm"
2021-05-22 13:11:59 -05:00
cassidy
327f08ce35 Revert "Update entrances.asm"
This reverts commit f4a336db9e.
2021-05-22 12:46:35 -04:00
KatDevsGames
b09b214ac0 Merge pull request #118 from cassidoxa/bombfix
Fix bombs count
2021-05-21 14:19:04 -05:00
cassidy
869706e50b Fix bombs count 2021-05-20 20:32:29 -04:00
KatDevsGames
feb3105c5a Merge pull request #116 from spannerisms/master
Fix
2021-05-18 20:29:58 -05:00
spannerisms
471a6da9ba Sorry, malmo 2021-05-18 05:30:23 -04:00
KatDevsGames
abd3dbe1fc Merge pull request #115 from aerinon/FixDefeatGanon
Fix a minor typo that makes Ganon invincible
2021-05-14 19:47:26 -05:00
aerinon
ce58e22496 Fix a minor typo that makes Ganon invincible 2021-05-14 16:50:35 -06:00
Kat
47e52d3fb2 cucco storm 2021-05-14 14:17:11 -05:00
Kat
a7f8bc8d91 Update tables.asm 2021-05-14 13:33:56 -05:00
KatDevsGames
b76efe6df4 Merge pull request #113 from cassidoxa/flashing
Fix S&Q bug on DDM with flashing disabled
2021-05-09 17:23:26 -05:00
cassidy
01e894a0b0 Fix S&Q bug on DDM with flashing enabled
Force push to fix dummy Y register. Doesn't make a difference but feels
cleaner if they're the same.
2021-05-09 17:28:54 -04:00
KatDevsGames
086721d035 Merge pull request #112 from cassidoxa/flashing
Remove flashing ancilla near pedestal item during cutscene
2021-05-09 14:20:56 -05:00
KatDevsGames
2048f75185 Merge pull request #111 from tcprescott/patch-3
Fix msu1 in credits
2021-05-09 14:19:04 -05:00
cassidy
3e09808536 Save a byte setting processor flags 2021-05-09 02:46:39 -04:00
cassidy
f389a2e737 DisableFlashing now disables electro palette changing
Affects Ether animation and enemies that electrocute Link
2021-05-09 02:17:09 -04:00
cassidy
12e30ba2db Remove flashing ancilla near pedestal item during cutscene 2021-05-08 22:59:09 -04:00
Thomas Prescott
03c0eb0475 Fix msu1 in credits
%smallcredits() can't have numbers, so we need to remove the 1 from MSU1
2021-05-06 21:45:10 -05:00
KatDevsGames
02ec4ded4b Merge pull request #110 from spannerisms/master
Share sewers and castle items
2021-05-04 04:45:15 -05:00
spannerisms
9744f846f7 sewers 2021-05-04 05:17:37 -04:00
spannerisms
6fdd5f636e Merge pull request #1 from KatDevsGames/master
A
2021-04-29 01:32:46 -04:00
KatDevsGames
8db9b67654 Merge pull request #109 from tcprescott/patch-2
Credits updates
2021-04-28 13:33:34 -05:00
KatDevsGames
d52e5f2037 Merge pull request #108 from cassidoxa/flashing
Flash toggle
2021-04-28 13:33:21 -05:00
Thomas Prescott
08abf980eb fix 2021-04-26 00:34:33 -05:00
Thomas Prescott
1efb19b88d update credits 2021-04-26 00:32:56 -05:00
cassidy
8881aa66b1 Save space with a jump to vanilla routine 2021-04-25 22:34:09 -04:00
cassidy
ca7eaf3385 Change how Ether flashing is handled
Removed SetEtherFlicker and hooked into new restore palette code instead
2021-04-25 21:13:23 -04:00
cassidy
7b4e3f5c95 Uncomment padding instructions 2021-04-25 16:38:28 -04:00
cassidy
fe708fd20f Restore invisible floors when flashing is disabled
Replace Seizure_Safety with FlashingDisabled
2021-04-25 16:09:42 -04:00
cassidy
edfecad1b2 Remove extra branch 2021-04-24 02:20:07 -04:00
cassidy
74cb39f666 Refactor whitening bg 2021-04-23 13:59:49 -04:00
cassidy
452a2db03d Aga 2 flashing 2021-04-22 17:05:04 -04:00
cassidy
6a34b5cbc4 Flash toggle rough draft 2021-04-21 13:34:10 -04:00
KatDevsGames
c04ff98269 Merge pull request #107 from spannerisms/master
Agahnim Light Speed message
2021-04-20 14:26:58 -05:00
spannerisms
bc91aac550 provide unchanging address for memeforce 2021-04-16 01:41:24 -04:00
spannerisms
c179bfcb64 credits update
add color (thanks synack)
add warning and errors for misalignment
2021-04-15 02:19:16 -04:00
spannerisms
12decaab45 ah that wouldn't work 2021-04-13 19:26:24 -04:00
spannerisms
975dd10db5 remove padding 2021-04-13 19:24:19 -04:00
spannerisms
44445b51ce autospacing 2021-04-13 00:00:34 -04:00
spannerisms
c9340e5aa8 Update creditsnew.asm 2021-04-12 22:48:21 -04:00
spannerisms
e9584597c4 new credits 2021-04-12 22:45:19 -04:00
spannerisms
fc29db2b46 reserve for v32 2021-04-11 10:18:07 -04:00
spannerisms
e6aee5c375 oops? 2021-04-07 04:58:02 -04:00
spannerisms
05af915fe2 synack request 2021-04-06 11:14:16 -04:00
KatDevsGames
2da2d16896 Merge pull request #106 from spannerisms/master
new goals
2021-04-06 03:39:23 -05:00
spannerisms
ed9c6681e8 new goals
make goals a jump table
add light speed
add crystals and bosses
add crystals only
move XY preservation to CountBits and utilize stack instead of Y for temp storage
2021-04-06 02:00:25 -04:00
KatDevsGames
182b23d4de Merge pull request #105 from spannerisms/master
WOW
2021-04-05 12:58:02 -05:00
spannerisms
70933b01f8 WOW 2021-04-05 12:48:32 -04:00
KatDevsGames
b0dda07ce1 Merge pull request #104 from tcprescott/patch-1
Remove Quickswap enforcement and fix firebars
2021-04-04 21:44:26 -05:00
Thomas Prescott
c5053b7847 Merge branch 'master' into patch-1 2021-04-04 21:38:41 -05:00
Thomas Prescott
ead4cf5ca8 new firebar layer fix from Zarby 2021-04-04 21:33:33 -05:00
Thomas Prescott
5def08afc0 remove quickswap enforcement 2021-04-04 21:24:37 -05:00
KatDevsGames
4614c4e0a9 Merge pull request #103 from spannerisms/master
General branch fixes
2021-04-03 13:59:59 -05:00
spannerisms
b95923fb9a Merge branch 'master' into master 2021-04-03 00:31:23 -04:00
spannerisms
9703195961 is this better? 2021-04-03 00:30:14 -04:00
KatDevsGames
b188024daa Merge pull request #99 from Catobat/Aga
Add Instant Post-Aga World State option
2021-04-02 13:18:28 -05:00
KatDevsGames
fab1c22d43 Merge pull request #101 from StructuralMike/nostartingbombs
Now possible to start with 0 bomb capacity
2021-04-02 13:18:15 -05:00
KatDevsGames
362e9d3b14 Merge pull request #102 from kedNalatacId/quickswap_bottle_y_pressed
Quickswap bottle y pressed
2021-04-02 13:17:57 -05:00
KatDevsGames
b84921e255 Merge pull request #100 from spannerisms/master
HUD Updates
2021-04-02 05:10:35 -05:00
spannerisms
36a21a7190 unkillaable enemies 2021-03-26 04:51:58 -04:00
spannerisms
f95351183c SEC
BEQ IMPLIES SET CARRY
2021-03-25 05:17:03 -04:00
spannerisms
1dca518150 Update halfmagicbat.asm
JML
2021-03-25 05:10:39 -04:00
spannerisms
3c891b526f Update zelda.asm
BEQ necessarily means set carry
2021-03-25 05:07:46 -04:00
spannerisms
8321a5ef59 zora
jml
2021-03-25 04:53:35 -04:00
spannerisms
6472553213 Update fileselect.asm
reverse
2021-03-24 08:24:44 -04:00
spannerisms
372b0ba599 Update fairyfixes.asm
JML
dont push yet if the branch just pulls
2021-03-24 08:21:44 -04:00
spannerisms
33dbe3003c Update events.asm
just JMLs here
2021-03-24 08:20:08 -04:00
spannerisms
f4a336db9e Update entrances.asm
labels
BIT instead of AND
2021-03-24 08:17:52 -04:00
spannerisms
5273112d9d Update enemy_adjustments.asm
this first since it can easily short circuit
2021-03-24 08:13:41 -04:00
spannerisms
d883b9a637 Update enemy_adjustments.asm
reverse branching
2021-03-24 08:13:00 -04:00
spannerisms
9ce7b9f9d2 Update dungeondrops.asm
JML
2021-03-24 08:11:32 -04:00
spannerisms
a5580621ef refactor dialog
PEI is a great opcode and should be used more!
change AND mask : CMP mask : BNE to just AND mask : BEQ
merge SEP and REPs across branches
change LDA : AND to BIT
2021-03-24 08:10:35 -04:00
spannerisms
8b9ea182d8 refactor darkworldspawn
reversed some labels
moved nomirror because 0 is already loaded
INC from 7 to 8
ORA instead of multiple branchings
SBC without SEC when carry is guaranteed
2021-03-24 07:55:51 -04:00
spannerisms
a28726d20e refactor compasses
reverse some branching for compactness
move SEP #$20 to macro
2021-03-24 07:46:53 -04:00
spannerisms
97e3a995e0 refactor clock
JSL : RTL to JML
SEC not necessary if we branch on BEQ, since BEQ implies a set carry
made carry_bit a sublabel
2021-03-24 07:42:34 -04:00
spannerisms
ffd1db722b refactor catfish
use JML instead of JSL : RTL
2021-03-24 07:39:20 -04:00
spannerisms
f6f28d89a9 refactor bugfixes
reverse some labels for compactness and readability
2021-03-24 07:37:32 -04:00
spannerisms
cd7260c5f4 refactor bookofmudora
unnecessary stack operations
2021-03-24 07:31:38 -04:00
ken
025b4941f3 don't require both shoulders twice; causes too much lag 2021-03-16 22:23:06 -07:00
ken
a19c72a062 bottles via double shoulder 2021-03-16 01:02:26 -07:00
StructuralMike
f2ce8aaf59 Now possible to start with 0 bomb capacity 2021-03-04 21:58:54 +01:00
KatDevsGames
37f7125198 Merge pull request #95 from CaitSith2/fix_aga_tower_compass
Fix Agahnim Tower compass counter
2021-02-18 17:31:12 -06:00
KatDevsGames
4ff4fde49b Merge pull request #96 from aerinon/ChestKeyCounter
Hera basement key fix
2021-02-18 17:30:52 -06:00
aerinon
5f1ea34646 Final fix for counting hera key 2021-02-17 11:52:10 -07:00
spannerisms
98ecf42fbf gfx for skull 2021-02-14 23:05:34 -05:00
spannerisms
6be396543e some obvious optimizations 2021-02-14 01:44:05 -05:00
spannerisms
d9946e8f2a boss kills 2021-02-14 01:33:48 -05:00
spannerisms
c97475f422 BRL -> JMP 2020-12-27 08:04:32 -05:00
KatDevsGames
265f9f3dfa Merge pull request #98 from Catobat/RNG
Reset prize packs and other things on certain occasions
2020-12-16 15:58:36 -06:00
Catobat
df45a9b451 Add Instant Post-Aga World State option 2020-12-16 21:32:30 +01:00
Catobat
0c608c1380 Fix starting equipment on file select 2020-12-16 19:58:33 +01:00
Catobat
078aebed8d Restore vanilla prize pack reset behavior 2020-12-16 18:42:40 +01:00
Catobat
99da1d3115 Reset boss RNG and other things on new file 2020-12-16 18:04:37 +01:00
aerinon
be3960bedb Hera basement key fix
Combine HC/Sewer chest key count into one variable
2020-11-30 09:27:47 -07:00
CaitSith2
5b6e23fcf5 Fix Agahnim Tower compass counter 2020-10-13 02:33:32 -07:00
qwertymodo
b10dc742c2 Give the people what they want 2020-10-10 10:03:52 -07:00
KatDevsGames
76f35b8786 Merge pull request #94 from tcprescott/patch-1
Re-order includes so the ROM will build correctly
2020-09-25 21:29:13 -04:00
Thomas Prescott
9dc35af9d3 re-order include to fix back overrun 2020-09-22 23:25:37 -05:00
KatDevsGames
9c9925fdda Merge pull request #75 from JonHanon/starting-menu-fix
Starting File Menu Fix
2020-09-21 02:14:47 -04:00
KatDevsGames
6e657f00db Merge pull request #78 from JonHanon/FreeItemText
Conditions for showing item text
2020-09-21 02:14:24 -04:00
KatDevsGames
f26a10a526 Merge pull request #82 from aerinon/CountBottleFix
Prevent CountBottles from overwriting what is in register X.
2020-09-20 02:00:27 -04:00
KatDevsGames
ba8c7c735b Merge pull request #86 from compiling/master
Triforce Hunt + Kill Ganon goal.
2020-09-20 01:59:56 -04:00
KatDevsGames
01dec8aef8 Merge pull request #87 from compiling/aga2_fw
Fix fake world when fluting to pyramid twice
2020-09-20 01:59:10 -04:00
KatDevsGames
c79f4b19b7 Merge pull request #83 from CaitSith2/patch-1
Reset inner floodgates if and only if the...
2020-09-20 01:58:58 -04:00
KatDevsGames
fab7c67909 Merge pull request #89 from Zarby89/patch-24
ganon room fix for multiworld
2020-09-20 01:58:43 -04:00
KatDevsGames
0e9e5d034c Merge pull request #90 from aerinon/ChestKeyCounter
Chest key counters
2020-09-20 01:58:02 -04:00
KatDevsGames
8814f8764a Merge pull request #88 from tcprescott/patch-1
Fix the shop fix and potentially fix a rare S&Q issue
2020-09-20 01:57:39 -04:00
KatDevsGames
a3c4fed33f Merge pull request #91 from CaitSith2/rupee-chest-game-fix
Low stakes and high stakes chest game no longer increments item counter.
2020-09-20 01:57:15 -04:00
KatDevsGames
af20beb472 Merge pull request #92 from Catobat/master
Fix Lost Woods chest game respawn
2020-09-20 01:56:50 -04:00
Catobat
e82f01ae2f Fix Lost Woods chest game respawn 2020-09-18 00:54:30 +02:00
CaitSith2
acf119d6a1 Low stakes and high stakes chest game no longer increments item counter. 2020-09-04 12:48:39 -07:00
aerinon
397da02e3f Converted file to tabs for consistency 2020-08-28 12:23:27 -06:00
aerinon
d58fa5d5b7 Starting keys accounted for 2020-08-28 12:15:31 -06:00
aerinon
cdd4199cf9 Fixed jumps and return to be proper for the banks the code is in 2020-08-27 10:14:52 -06:00
aerinon
f565fc93be Adds Chest Key counters to $7EF4E0-F 2020-08-27 10:14:33 -06:00
Zarby89
8d17f61f44 ganon room fix for multiworld 2020-07-29 22:12:21 -04:00
Thomas Prescott
5930406ecb Fix S&Q crash for certain SNES users
This was suggested by Kat, and seemed to work for a player who had been experiencing chronic game crashes during an S&Q.
2020-07-17 06:18:11 -05:00
Thomas Prescott
4a9f86ba85 Uncomment PostNMIHookAction 2020-07-17 06:14:09 -05:00
Kat
af7cce9ae5 shop maybe fix 2020-07-09 02:04:00 -04:00
Kat
7955a37cd9 asar 2020-07-08 23:43:10 -04:00
qwertymodo
ae85ec35b9 Fix broken fade-to-half music command (F2) 2020-06-23 14:09:38 -07:00
caitsith2
c3398b305a Check for flippers in room 55, and if not present, drain it.
(Allows for SW to NW, SW to East, and NW to East without flippers.)
no need to check for flippers on room 53, as getting to the west door is completely blocked, whether or not it is flooded without flippers.
2020-06-23 01:20:31 -07:00
compiling
c02285306a Fix fake world when fluting to pyramid twice 2020-06-18 21:41:02 +10:00
compiling
1d88d7479d Triforce Hunt + Kill Ganon goal. 2020-06-13 19:01:37 +10:00
randall.rupper
50ff7683ab Add PHX/PLX in a better spot to prevent CountBottles from overwritting X 2020-06-08 09:54:09 -06:00
CaitSith2
a20c432003 Reset inner floodgates if and only if the...
...small keys are actually flooded.
2020-05-13 10:23:22 -07:00
Jonathan Hanon
8f9f582250 Conditions for showing item text
Added conditions for FreeItemText so it isn't just a boolean.
2019-10-24 00:39:55 -04:00
Jonathan Hanon
a939bfcdbc Starting File Menu Fix
Copy starting equipment swaps to file select screen
2019-09-19 20:52:20 -04:00
181 changed files with 29727 additions and 14409 deletions

View File

@@ -3,99 +3,67 @@
;================================================================================
lorom
;================================================================================
;===================================================================================================
;org $00FFC0 ; <- 7FC0 - Bank00.asm : 9173 (db "THE LEGEND OF ZELDA " ; 21 bytes)
;db #$23, $4E
org $00FFD5 ; <- 7FD5 - Bank00.asm : 9175 (db $20 ; rom layout)
;db #$35 ; set fast exhirom
db #$30 ; set fast lorom
;org $00FFD6 ; <- 7FD6 - Bank00.asm : 9176 (db $02 ; cartridge type)
;db #$55 ; enable S-RTC
org $00FFD7 ; <- 7FD7 - Bank00.asm : 9177 (db $0A ; rom size)
db #$0B ; mark rom as 16mbit
org $00FFD8 ; <- 7FD8 - Bank00.asm : 9178 (db $03 ; ram size (sram size))
db #$05 ; mark sram as 32k
org $3FFFFF ; <- 1FFFFF
db #$00 ; expand file to 2mb
org $1FFFF8 ; <- FFFF8 timestamp rom
db #$20, #$19, #$08, #$31 ; year/month/day
; THIS NEEDS TO BE THE FIRST INCLUDE BECAUSE IT CHANGES THINGS EVERYWHERE
; If this were to be included later, it would almost certainly overwrite other changes
incsrc "fastrom.asm"
;================================================================================
;org $80FFC0 ; <- 7FC0 - Bank00.asm : 9173 (db "THE LEGEND OF ZELDA " ; 21 bytes)
;db $23, $4E
org $80FFD5 ; <- 7FD5 - Bank00.asm : 9175 (db $20 ; rom layout)
db $30 ; set fast lorom
;org $80FFD6 ; <- 7FD6 - Bank00.asm : 9176 (db $02 ; cartridge type)
;db $55 ; enable S-RTC
org $80FFD7 ; <- 7FD7 - Bank00.asm : 9177 (db $0A ; rom size)
db $0B ; mark rom as 16mbit
org $80FFD8 ; <- 7FD8 - Bank00.asm : 9178 (db $03 ; ram size (sram size))
db $05 ; mark sram as 32k
org $BFFFFF ; <- 1FFFFF
db $00 ; expand file to 2mb
org $9FFFF8 ; <- FFFF8 timestamp rom
db $20, $19, $08, $31 ; year/month/day
;================================================================================
!ROM_VERSION_LOW ?= 1 ; ROM version (two 16-bit integers)
!ROM_VERSION_HIGH ?= 4 ;
org $80FFE0 ; Unused hardware vector
RomVersion:
dw !ROM_VERSION_LOW
dw !ROM_VERSION_HIGH
;================================================================================
!ADD = "CLC : ADC"
!SUB = "SEC : SBC"
!BLT = "BCC"
!BGE = "BCS"
; Rando Specific SRAM assignments
!SHOP_PURCHASE_COUNTS = "$7EF302" ;$7EF302 - $7EF33F (temporary home)
!INVENTORY_SWAP = "$7EF38C" ; [w]
!INVENTORY_SWAP_2 = "$7EF38E" ; [w]
!ITEM_LIMIT_COUNTS = "$7EF390" ; $7EF390 - ????
!NPC_FLAGS = "$7EF410"
!NPC_FLAGS_2 = "$7EF411"
!MAP_OVERLAY = "$7EF414" ; [w]
!PROGRESSIVE_SHIELD = "$7EF416" ; ss-- ----
!HUD_FLAG = "$7EF416" ; --h- ----
!FORCE_PYRAMID = "$7EF416" ; ---- p---
!IGNORE_FAIRIES = "$7EF416" ; ---- -i--
!SHAME_CHEST = "$7EF416" ; ---s ----
!HAS_GROVE_ITEM = "$7EF416" ; ---- ---g general flags, don't waste these
!HIGHEST_SWORD_LEVEL = "$7EF417" ; --- -sss
;$7EF41A[w] - Programmable Item #1
;$7EF41C[w] - Programmable Item #2
;$7EF41E[w] - Programmable Item #3
!SRAM_SINK = "$7EF41E" ; <- change this (conflicts with Programmable item 3)
;$7EF418 - Goal Item Counter
;$7EF419 - Service Sequence
;$7EF420 - $7EF466 - Stat Tracking Bank 1 (overlaps with RNG Item Flags)
;$7EF450 - $7EF45F - RNG Item (Single) Flags
;$7EF4A0 - $7EF4A7 - Service Request Block
!FRESH_FILE_MARKER = "$7EF4F0" ; zero if fresh file
;$700500 - $70050F - Extended File Name
;$701000 - $70100F - Password (incorporate into log header)
;$702000 - $702014 - Rom title copy (incorporate into log header)
function hexto555(h) = ((((h&$FF)/8)<<10)|(((h>>8&$FF)/8)<<5)|(((h>>16&$FF)/8)<<0))
!MS_GOT = "$7F5031"
!DARK_WORLD = "$7EF3CA"
!REDRAW = "$7F5000"
!GANON_WARP_CHAIN = "$7F5032";
!TILE_UPLOAD_BUFFER = "$7EA180";
!FORCE_HEART_SPAWN = "$7F5033";
!SKIP_HEART_SAVE = "$7F5034";
; MSU-1
!REG_MSU_FALLBACK_TABLE = $7F50A0 ; 8 bytes
!REG_MSU_DELAYED_COMMAND = $7F50A9
!REG_MSU_PACK_COUNT = $7F50AA
!REG_MSU_PACK_CURRENT = $7F50AB
!REG_MSU_PACK_REQUEST = $7F50AC
!REG_SPC_LOADING = $7F50AD
!REG_MUSIC_CONTROL = $012B
;!REG_MUSIC_CONTROL = $012C
!REG_MUSIC_CONTROL_REQUEST = $012C
; Feature flags, run asar with -DFEATURE_X=1 to enable
;================================================================================
incsrc hooks.asm
incsrc treekid.asm
incsrc spriteswap.asm
incsrc hashalphabethooks.asm
incsrc sharedplayerpalettefix.asm
incsrc ram.asm
incsrc sram.asm
incsrc registers.asm
incsrc vanillalabels.asm
incsrc overworldmap.asm ; Overwrites some code in bank $8A
;org $208000 ; bank #$20
org $A08000 ; bank #$A0
org $A08000 ; bank $20
incsrc itemdowngrade.asm
incsrc bugfixes.asm
incsrc darkworldspawn.asm
@@ -103,9 +71,7 @@ incsrc lampmantlecone.asm
incsrc floodgatesoftlock.asm
incsrc heartpieces.asm
incsrc npcitems.asm
incsrc utilities.asm
incsrc flipperkill.asm
incsrc previewdatacopy.asm
incsrc pendantcrystalhud.asm
incsrc potions.asm
incsrc shopkeeper.asm
@@ -115,27 +81,16 @@ incsrc tablets.asm
incsrc fairyfixes.asm
incsrc rngfixes.asm
incsrc medallions.asm
incsrc inventory.asm
incsrc ganonfixes.asm
incsrc zelda.asm
incsrc maidencrystals.asm
incsrc zoraking.asm
incsrc catfish.asm
incsrc flute.asm
incsrc dungeondrops.asm
incsrc halfmagicbat.asm
incsrc newitems.asm
incsrc mantle.asm
incsrc swordswap.asm
incsrc stats.asm
incsrc scratchpad.asm
incsrc map.asm
incsrc msu.asm
incsrc dialog.asm
incsrc events.asm
incsrc entrances.asm
incsrc clock.asm
incsrc accessability.asm
incsrc accessibility.asm
incsrc heartbeep.asm
incsrc capacityupgrades.asm
incsrc timer.asm
@@ -145,9 +100,9 @@ incsrc roomloading.asm
incsrc icepalacegraphics.asm
warnpc $A18000
org $1C8000 ; text tables for translation
incbin i18n_en.bin
warnpc $1CF356
org $9C8000 ; text tables for translation
incbin "data/i18n_en.bin"
warnpc $9CF356
org $A18000 ; static mapping area
incsrc framehook.asm
@@ -158,13 +113,18 @@ incsrc hud.asm
warnpc $A18800
org $A18800 ; static mapping area
incsrc zsnes.asm
warnpc $A19000
org $A1A000 ; static mapping area. Referenced by front end. Do not move.
incsrc invertedstatic.asm
warnpc $A1A100
org $A1B000
incsrc failure.asm
warnpc $A1FF00
org $A1FF00 ; static mapping area
incsrc init.asm
@@ -172,14 +132,12 @@ org $A48000 ; code bank - PUT NEW CODE HERE
incsrc glitched.asm
incsrc hardmode.asm
incsrc goalitem.asm
incsrc openmode.asm
incsrc quickswap.asm
incsrc endingsequence.asm
incsrc cuccostorm.asm
incsrc compression.asm
incsrc retro.asm
incsrc dpadinvert.asm
incsrc controllerjank.asm
incsrc boots.asm
incsrc events.asm
incsrc fileselect.asm
incsrc playername.asm
incsrc decryption.asm
@@ -187,7 +145,6 @@ incsrc hashalphabet.asm
incsrc inverted.asm
incsrc invertedmaps.asm
incsrc newhud.asm
incsrc compasses.asm
incsrc save.asm
incsrc password.asm
incsrc enemy_adjustments.asm
@@ -195,99 +152,135 @@ incsrc hudtext.asm
incsrc servicerequest.asm
incsrc elder.asm
incsrc toast.asm
incsrc darkroomitems.asm
incsrc fastcredits.asm
incsrc msu.asm
incsrc dungeonmap.asm
incsrc hextodec.asm
incsrc textrenderer.asm
warnpc $A58000
;org $228000 ; contrib area
org $A28000 ; contrib area
incsrc contrib.asm
org $A28000
ItemReceiptGraphicsROM:
; we need some empty space here so that 0000 can mean nothing
fillbyte $00 : fill 32
incbin "data/customitems.4bpp"
warnpc $A2B000
org $A2B000
incsrc itemdatatables.asm ; Statically mapped
incsrc decompresseditemgraphics.asm
incsrc newitems.asm
incsrc utilities.asm
incsrc inventory.asm
org $A38000
incsrc stats/credits.asm ; Statically mapped
incsrc stats/main.asm
incsrc stats/statConfig.asm
FontTable:
incsrc stats/fonttable.asm
org $308000 ; bank #$30
org $B08000 ; bank $30
incsrc tables.asm
org $348000
org $B48000
incsrc spc.asm
; uncomment for inverted adjustments
;incsrc sandbox.asm
org $318000 ; bank #$31
org $B18000 ; bank $31
GFX_Mire_Bombos:
incbin 99ff1_bombos.gfx
warnpc $318800
incbin "data/99ff1_bombos.gfx"
warnpc $B18800
org $318800
org $B18800
GFX_Mire_Quake:
incbin 99ff1_quake.gfx
warnpc $319000
incbin "data/99ff1_quake.gfx"
warnpc $B19000
org $319000
org $B19000
GFX_TRock_Bombos:
incbin a6fc4_bombos.gfx
warnpc $319800
incbin "data/a6fc4_bombos.gfx"
warnpc $B19800
org $319800
org $B19800
GFX_TRock_Ether:
incbin a6fc4_ether.gfx
warnpc $31A000
incbin "data/a6fc4_ether.gfx"
warnpc $B1A000
org $31A000
org $B1A000
GFX_HUD_Items:
incbin c2807_v4.gfx
warnpc $31A800
incbin "data/c2807_v4.gfx"
warnpc $B1A800
org $31A800
GFX_New_Items:
incbin newitems.gfx
;incbin eventitems.gfx ; *EVENT*
warnpc $31B000
org $B1A800
org $31B000
warnpc $B1B000
org $B1B000
GFX_HUD_Main:
incbin c2e3e.gfx
warnpc $31B800
incbin "data/c2e3e.gfx"
warnpc $B1B800
org $31C000
org $B1C000
IcePalaceFloorGfx:
incbin ice_palace_floor.bin
warnpc $31C801
incbin "data/ice_palace_floor.bin"
warnpc $B1C801
org $31C800
org $B1C800
Damage_Table:
incbin damage_table.bin
warnpc $31D001
incbin "data/damage_table.bin"
warnpc $B1D001
org $31D000
org $B1D000
FileSelectNewGraphics:
incbin fileselect.chr.gfx
warnpc $31E001
incbin "data/fileselectgfx.2bpp"
warnpc $B1E001
org $31E000
org $B1E000
InvertedCastleHole: ;address used by front end. DO NOT MOVE!
incbin sheet73.gfx
warnpc $31E501
incbin "data/sheet73.gfx"
warnpc $B1E501
org $338000
org $B38000
GFX_HUD_Palette:
incbin hudpalette.pal
warnpc $338041
incbin "data/hudpalette.pal"
warnpc $B38041
org $339000
incbin sheet178.gfx
warnpc $339600
org $B39000
ExpandedTrinexx:
incbin "data/sheet178.gfx"
warnpc $B39600
org $328000
org $B39600
BossMapIconGFX:
incbin "data/bossicons.4bpp"
org $B39C00
NewFont:
incbin "data/newfont.bin"
NewFontInverted:
incbin "data/newfont_inverted.bin"
SmallCharacters:
incbin "data/smallchars.2bpp"
org $8CD7DF
incsrc data/playernamecharmap.asm
org $8CE73D
incbin data/playernamestripes_1.bin
org $8CE911
incbin data/playernamestripes_2.bin
incsrc data/kanjireplacements.asm ; Overwrites text gfx data and masks in bank $8E
org $B28000
Extra_Text_Table:
incsrc itemtext.asm
incsrc externalhooks.asm
;================================================================================
org $119100 ; PC 0x89100
incbin map_icons.gfx
warnpc $119401
org $919100 ; PC 0x89100
incbin "data/map_icons.gfx"
warnpc $919401
;================================================================================
org $9BB1E0
incsrc custompalettes.asm
warnpc $9BB880
;================================================================================
org $AF8000 ; PC 0x178000
Static_RNG: ; each line below is 512 bytes of rng
@@ -302,7 +295,7 @@ warnpc $B08000
;Bank Map
;$20 Code Bank
;$21 Reserved (Frame Hook & Init)
;$22 Contrib Code
;$22 Unused
;$23 Stats & Credits
;$24 Code Bank
;$29 External hooks (rest of bank not used)
@@ -312,375 +305,44 @@ warnpc $B08000
;$31 Graphics Bank
;$32 Text Bank
;$33 Graphics Bank
;$37 Don't Use ZSNES Graphics
;$38 Don't Use ZSNES Graphics (continued)
;$36 reserved for Enemizer
;$3A reserved for downstream use
;$3B reserved for downstream use
;$3F reserved for internal debugging
;================================================================================
;RAM
;$7EC900[0x1F00]: BIGRAM buffer
;RAM
;See ram.asm for label assignments
;$7EC900[0x1F00]: BigRAM buffer
;$7EF000[0x500]: SRAM mirror First 0x500 bytes of SRAM
; See sram.asm for labels and assignments
;$7F5000[0x800]: Rando's main free ram region
; See tables.asm for specific assignments
;$7F6000[0x500]: Free RAM (reclaimed from damage table) Not allocated yet
;$7F6500[0xB00]: SRAM mirror for last 0xB00 bytes of SRAM (extended sram)
; See ram.asm for specific assignments
;$7F6000[0x1000]: SRAM buffer mapped to vanilla save slots 1 and 2
; See sram.asm for labels and assignments
;$7F7667[0x6719] - free ram
;================================================================================
;SRAM Map
;$70:0000 ( 4K) Game state
; 0000-04FF Vanilla Slot 1 (mirrored at 0x7EF000)
; See earlier in this file for rando specific assignments
; 0500-0FFF Ext Slot 1 (not yet mirrored)
; See earlier in this file for rando specific assignments
;$70:1000 (20K) Log entries
;$70:6000 ( 8K) Scratch buffers
;See sram.asm for label assignments and documentation
;$70:0000 (5K) Game state
; 0000-04FF Vanilla Slot 1 (mirrored at $7EF000)
; 0500-14FF Ext Slot 1 (mirrored at $7F6000)
;$70:2000 (0x25) ROM Name and version number
;$70:3000 (0x16) Password
;$70:6000 (8K) Scratch buffers
;================================================================================
;org $0080DC ; <- 0xDC - Bank00.asm:179 - Kill Music
;db #$A9, #$00, #$EA
;LDA.b #$00 : NOP
;================================================================================
;org $0AC53E ; <- 5453E - Bank0A.asm:1103 - (LDA $0AC51F, X) - i have no idea what this is for anymore
;LDA.b #$7F
;NOP #2
;================================================================================
;org $05DF8B ; <- 2DF8B - Bank05.asm : 2483
;AND.w #$0100 ; allow Sprite_DrawMultiple to access lower half of sprite tiles
;================================================================================
;org $0DF8F1 ; this is required for the X-indicator in the HUD except not anymore obviously
;
;;red pendant
;db $2B, $31, $2C, $31, $3D, $31, $2E, $31
;db $2B, $25, $2C, $25, $2D, $25, $2E, $25
;
;;blue pendant
;db $2B, $31, $2C, $31, $3D, $31, $2E, $31
;db $2B, $2D, $2C, $2D, $2D, $2D, $2E, $2D
;
;;green pendant
;db $2B, $31, $2C, $31, $3D, $31, $2E, $31
;db $2B, $3D, $2C, $3D, $2D, $3D, $2E, $3D
;================================================================================
;org $00CFF2 ; 0x4FF2 - Mire H
;db GFX_Mire_Bombos>>16
;org $00D0D1 ; 0x50D1 - Mire M
;db GFX_Mire_Bombos>>8
;org $00D1B0 ; 0x51B0 - Mire L
;db GFX_Mire_Bombos
;org $00D020 ; 0x5020 - Trock H
;db GFX_TRock_Bombos>>16
;org $00D0FF ; 0x50FF - Trock M
;db GFX_TRock_Bombos>>8
;org $00D1DE ; 0x51DE - Trock L
;db GFX_TRock_Bombos
org $00D09C ; 0x509C - HUD Items H
org $80D09C ; 0x509C - HUD Items H
db GFX_HUD_Items>>16
org $00D17B ; 0x517B - HUD Items M
org $80D17B ; 0x517B - HUD Items M
db GFX_HUD_Items>>8
org $00D25A ; 0x525A - HUD Items L
org $80D25A ; 0x525A - HUD Items L
db GFX_HUD_Items
; this used to be a pointer to a dummy file
org $00D065 ; 005065 - New Items H
db GFX_New_Items>>16
org $00D144 ; 005114 - New Items M
db GFX_New_Items>>8
org $00D223 ; 005223 - New Items L
db GFX_New_Items
org $00D09D ; 0x509D - HUD Main H
org $80D09D ; 0x509D - HUD Main H
db GFX_HUD_Main>>16
org $00D17C ; 0x517C - HUD Main M
org $80D17C ; 0x517C - HUD Main M
db GFX_HUD_Main>>8
org $00D25B ; 0x525B - HUD Main L
org $80D25B ; 0x525B - HUD Main L
db GFX_HUD_Main
;================================================================================
org $008781
UseImplicitRegIndexedLocalJumpTable:
org $00879c
UseImplicitRegIndexedLongJumpTable:
org $008333
Vram_EraseTilemaps_triforce:
org $008913
Sound_LoadLightWorldSongBank:
org $00891D
.do_load
org $00893D
EnableForceBlank:
org $00D308
DecompSwordGfx:
org $00D348
DecompShieldGfx:
org $00D463
Tagalong_LoadGfx:
org $00D51B
GetAnimatedSpriteTile:
org $00D52D
GetAnimatedSpriteTile_variable:
org $00D84E
Attract_DecompressStoryGfx:
org $00E529
LoadSelectScreenGfx:
org $00F945
PrepDungeonExit:
org $00FDEE
Mirror_InitHdmaSettings:
org $01873A
Dungeon_LoadRoom:
org $02821E
Module_PreDungeon:
org $028296
.setAmbientSfx
org $02A0A8
Dungeon_SaveRoomData:
org $02A0BE
Dungeon_SaveRoomData_justKeys:
org $02B861
Dungeon_SaveRoomQuadrantData:
org $02FD8A ; 17D8A - Bank0E.asm: 3732 Note: Different bank
LoadGearPalettes_bunny:
org $02FD95 ; 17D95 - Bank0E.asm: 3742 Note: Different bank
LoadGearPalettes_variable:
org $05A51D
Sprite_SpawnFallingItem:
org $05DF6C ; 02DF6C - Bank05.asm : 2445
Sprite_DrawMultiple:
org $05DF70 ; 02DF70 - Bank05.asm : 2454
Sprite_DrawMultiple_quantity_preset:
org $05DF75 ; 02DF75 - Bank05.asm : 2461
Sprite_DrawMultiple_player_deferred:
org $05E1A7 ; 02E1A7 - Bank05.asm : 2592
Sprite_ShowSolicitedMessageIfPlayerFacing:
org $05E1F0
Sprite_ShowMessageFromPlayerContact:
org $05E219
Sprite_ShowMessageUnconditional:
org $05EC96
Sprite_ZeldaLong:
org $0683E6
Utility_CheckIfHitBoxesOverlapLong:
org $06A7DB
Chicken_SpawnAvengerChicken: ; returns short
org $06DC5C
Sprite_DrawShadowLong:
org $06DD40
DashKey_Draw:
org $06DBF8
Sprite_PrepAndDrawSingleLargeLong:
org $06DC00
Sprite_PrepAndDrawSingleSmallLong:
org $06EA18
Sprite_ApplySpeedTowardsPlayerLong:
org $06EAA6
Sprite_DirectionToFacePlayerLong:
org $06F12F
Sprite_CheckDamageToPlayerSameLayerLong:
org $06F86A
OAM_AllocateDeferToPlayerLong:
org $0791B3
Player_HaltDashAttackLong:
org $07999D
Link_ReceiveItem:
org $07E68F
Unknown_Method_0: ; In US version disassembly simply called "$3E6A6 IN ROM"
org $07F4AA
Sprite_CheckIfPlayerPreoccupied:
org $08C3AE
Ancilla_ReceiveItem:
org $08CE93
Ancilla_BreakTowerSeal_draw_single_crystal:
org $08CEC3
Ancilla_BreakTowerSeal_stop_spawning_sparkles:
org $08CF59
BreakTowerSeal_ExecuteSparkles:
org $08F710
Ancilla_SetOam_XY_Long:
org $0985E2 ; (break on $0985E4)
AddReceivedItem:
org $098BAD
AddPendantOrCrystal:
org $098CFD
AddWeathervaneExplosion:
org $0993DF
AddDashTremor:
org $099D04
AddAncillaLong:
org $09AE64
Sprite_SetSpawnedCoords:
org $09AD58
GiveRupeeGift:
org $0ABA4F
OverworldMap_InitGfx:
org $0ABA99
OverworldMap_DarkWorldTilemap:
org $0ABAB9
OverworldMap_LoadSprGfx:
org $0DBA71
GetRandomInt:
org $0DBA80
OAM_AllocateFromRegionA:
org $0DBA84
OAM_AllocateFromRegionB:
org $0DBA88
OAM_AllocateFromRegionC:
org $0DBA8C
OAM_AllocateFromRegionD:
org $0DBA90
OAM_AllocateFromRegionE:
org $0DBA94
OAM_AllocateFromRegionF:
org $0DBB67
Sound_SetSfxPanWithPlayerCoords:
org $0DBB6E
Sound_SetSfx1PanLong:
org $0DBB7C
Sound_SetSfx2PanLong:
org $0DBB8A
Sound_SetSfx3PanLong:
org $0DDB7F
HUD_RefreshIconLong:
org $0DDD32
Equipment_UpdateEquippedItemLong:
org $0DE01E ; 6E10E - equipment.asm : 787
BottleMenu_movingOn:
org $0DE346
RestoreNormalMenu:
org $0DE395
Equipment_SearchForEquippedItemLong:
org $0DE9C8
DrawProgressIcons: ; this returns short
org $0DED29
DrawEquipment: ; this returns short
org $0DFA78
HUD_RebuildLong:
org $0DFA88
HUD_RebuildIndoor_Palace:
org $0DFA88
HUD_RebuildLong2:
org $0EEE10
Messaging_Text:
org $0FFD94
Overworld_TileAttr:
org $1BC97C
Overworld_DrawPersistentMap16:
org $1BED03
Palette_Sword:
org $1BED29
Palette_Shield:
org $1BEDF9
Palette_ArmorAndGloves:
org $1BEE52
Palette_Hud:
org $1BEF96
Palette_SelectScreen:
org $1CFAAA
ShopKeeper_RapidTerminateReceiveItem:
org $1CF500
Sprite_NullifyHookshotDrag:
org $1CF537
Ancilla_CheckForAvailableSlot:
org $1DE9B6
Filter_MajorWhitenMain:
org $1DF65D
Sprite_SpawnDynamically:
org $1DF65F
Sprite_SpawnDynamically_arbitrary:
org $1DFD4B
DiggingGameGuy_AttemptPrizeSpawn:
org $1EDE28
Sprite_GetEmptyBottleIndex: ; this is totally in sprite_bees.asm
org $1EF4E7
Sprite_PlayerCantPassThrough:
;================================================================================

View File

@@ -1,36 +0,0 @@
;================================================================================
; Accessability Fixes
;================================================================================
FlipGreenPendant:
LDA $0C : CMP #$38 : BNE + ; check if we have green pendant
ORA #$40 : STA $0C ; flip it
+
LDA $0D : STA $0802, X ; stuff we wrote over "Set CHR, palette, and priority of the sprite"
LDA $0C : STA $0803, X
RTL
;================================================================================
!EPILEPSY_TIMER = "$7F5041"
SetEtherFlicker:
LDA.l Seizure_Safety : BNE +
LDA $031D : CMP.b #$0B : RTL
+
LDA !EPILEPSY_TIMER : INC : STA !EPILEPSY_TIMER
LDA.l Seizure_Safety : CMP !EPILEPSY_TIMER : BNE +++
LDA.b #$00 : STA !EPILEPSY_TIMER : BRA ++
+++
LSR : CMP !EPILEPSY_TIMER : !BLT ++
SEP #$02 : RTL
++
REP #$02
+
RTL
;================================================================================
SetAttractMaidenFlicker:
LDA.l Seizure_Safety : BNE +
JSL.l Filter_MajorWhitenMain : LDA $5F : RTL
+
LDA #$00
RTL
;================================================================================

285
accessibility.asm Normal file
View File

@@ -0,0 +1,285 @@
;================================================================================
; Accessibility Fixes
;================================================================================
ConditionalLightning:
CMP.b #$05 : BEQ ++
CMP.b #$2C : BEQ ++
CMP.b #$5A : BEQ ++
LDA.l DisableFlashing : BNE ++
LDA.b #$32 : STA.w CGADSUBQ
RTL
++
LDA.b #$72
STA.b CGADSUBQ
RTL
;================================================================================
ConditionalWhitenBg:
LDX.b #$00
LDA.l DisableFlashing : REP #$20 : BNE +
LDA.b Scrap00,X
JSR WhitenLoopReal
RTL
+
LDA.b Scrap00
JSR WhitenLoopDummy
RTL
;================================================================================
WhitenLoopReal:
-
LDA.l PaletteBufferAux+$40, X : JSL Filter_Majorly_Whiten_Color : STA.l PaletteBuffer+$40, X
LDA.l PaletteBufferAux+$50, X : JSL Filter_Majorly_Whiten_Color : STA.l PaletteBuffer+$50, X
LDA.l PaletteBufferAux+$60, X : JSL Filter_Majorly_Whiten_Color : STA.l PaletteBuffer+$60, X
LDA.l PaletteBufferAux+$70, X : JSL Filter_Majorly_Whiten_Color : STA.l PaletteBuffer+$70, X
LDA.l PaletteBufferAux+$80, X : JSL Filter_Majorly_Whiten_Color : STA.l PaletteBuffer+$80, X
LDA.l PaletteBufferAux+$90, X : JSL Filter_Majorly_Whiten_Color : STA.l PaletteBuffer+$90, X
LDA.l PaletteBufferAux+$A0, X : JSL Filter_Majorly_Whiten_Color : STA.l PaletteBuffer+$A0, X
LDA.l PaletteBufferAux+$B0, X : JSL Filter_Majorly_Whiten_Color : STA.l PaletteBuffer+$B0, X
LDA.l PaletteBufferAux+$C0, X : JSL Filter_Majorly_Whiten_Color : STA.l PaletteBuffer+$C0, X
LDA.l PaletteBufferAux+$D0, X : JSL Filter_Majorly_Whiten_Color : STA.l PaletteBuffer+$D0, X
LDA.l PaletteBufferAux+$E0, X : JSL Filter_Majorly_Whiten_Color : STA.l PaletteBuffer+$E0, X
INX #2 : CPX.b #$10 : BEQ +
JMP -
+
LDA.l PaletteBufferAux+$F0 : JSL Filter_Majorly_Whiten_Color : STA.l PaletteBuffer+$F0
LDA.l PaletteBufferAux+$F2 : JSL Filter_Majorly_Whiten_Color : STA.l PaletteBuffer+$F2
LDA.l PaletteBufferAux+$F4 : JSL Filter_Majorly_Whiten_Color : STA.l PaletteBuffer+$F4
LDA.b GameMode : CMP.w #$0007 : BNE +
LDA.b RoomIndex
CMP.w #$003C : BEQ ++
CMP.w #$009D : BEQ ++
CMP.w #$009C : BEQ ++
CMP.w #$00A5 : BEQ ++
+
LDA.l PaletteBufferAux+$F6 : JSL Filter_Majorly_Whiten_Color : STA.l PaletteBuffer+$F6
LDA.l PaletteBufferAux+$F8 : JSL Filter_Majorly_Whiten_Color : STA.l PaletteBuffer+$F8
BRA +++
++
LDA.l PaletteBuffer+$F6 : JSL Filter_Majorly_Whiten_Color : STA.l PaletteBuffer+$F6
LDA.l PaletteBuffer+$F8 : JSL Filter_Majorly_Whiten_Color : STA.l PaletteBuffer+$F8
BRA +++
+++
LDA.l PaletteBufferAux+$FA : JSL Filter_Majorly_Whiten_Color : STA.l PaletteBuffer+$FA
LDA.l PaletteBufferAux+$FC : JSL Filter_Majorly_Whiten_Color : STA.l PaletteBuffer+$FC
LDA.l PaletteBufferAux+$FE : JSL Filter_Majorly_Whiten_Color : STA.l PaletteBuffer+$FE
REP #$10
LDA.l PaletteBuffer+$40 : TAY
LDA.l PaletteBufferAux : BNE +
TAY
+
TYA : STA.l PaletteBuffer
SEP #$30
RTS
;================================================================================
WhitenLoopDummy:
-
LDA.l PaletteBufferAux+$40, X : JSL Filter_Majorly_Whiten_Color : LDA.l PaletteBuffer+$40, X
LDA.l PaletteBufferAux+$50, X : JSL Filter_Majorly_Whiten_Color : LDA.l PaletteBuffer+$50, X
LDA.l PaletteBufferAux+$60, X : JSL Filter_Majorly_Whiten_Color : LDA.l PaletteBuffer+$60, X
LDA.l PaletteBufferAux+$70, X : JSL Filter_Majorly_Whiten_Color : LDA.l PaletteBuffer+$70, X
LDA.l PaletteBufferAux+$80, X : JSL Filter_Majorly_Whiten_Color : LDA.l PaletteBuffer+$80, X
LDA.l PaletteBufferAux+$90, X : JSL Filter_Majorly_Whiten_Color : LDA.l PaletteBuffer+$90, X
LDA.l PaletteBufferAux+$A0, X : JSL Filter_Majorly_Whiten_Color : LDA.l PaletteBuffer+$A0, X
LDA.l PaletteBufferAux+$B0, X : JSL Filter_Majorly_Whiten_Color : LDA.l PaletteBuffer+$B0, X
LDA.l PaletteBufferAux+$C0, X : JSL Filter_Majorly_Whiten_Color : LDA.l PaletteBuffer+$C0, X
LDA.l PaletteBufferAux+$D0, X : JSL Filter_Majorly_Whiten_Color : LDA.l PaletteBuffer+$D0, X
LDA.l PaletteBufferAux+$E0, X : JSL Filter_Majorly_Whiten_Color : LDA.l PaletteBuffer+$E0, X
INX #2 : CPX.b #$10 : BEQ +
JMP -
+
LDA.l PaletteBufferAux+$F0 : JSL Filter_Majorly_Whiten_Color : LDA.l PaletteBuffer+$F0
LDA.l PaletteBufferAux+$F2 : JSL Filter_Majorly_Whiten_Color : LDA.l PaletteBuffer+$F2
LDA.l PaletteBufferAux+$F4 : JSL Filter_Majorly_Whiten_Color : LDA.l PaletteBuffer+$F4
LDA.b GameMode : CMP.w #$0007 : BNE + ; only light invisifloor if we're in dungeon submodule
LDA.b RoomIndex
CMP.w #$003C : BEQ ++ ; hookshot cave
CMP.w #$009D : BEQ ++ ; gt right
CMP.w #$009C : BEQ ++ ; gt big room
CMP.w #$00A5 : BEQ ++ ; wizzrobes 1
+
LDA.l PaletteBufferAux+$F6 : JSL Filter_Majorly_Whiten_Color : LDA.l PaletteBuffer+$F6
LDA.l PaletteBufferAux+$F8 : JSL Filter_Majorly_Whiten_Color : LDA.l PaletteBuffer+$F8
BRA +++
++
LDA.l PaletteBufferAux+$F6 : JSL Filter_Majorly_Whiten_Color : STA.l PaletteBuffer+$F6
LDA.l PaletteBufferAux+$F8 : JSL Filter_Majorly_Whiten_Color : STA.l PaletteBuffer+$F8
BRA +++
+++
LDA.l PaletteBufferAux+$FA : JSL Filter_Majorly_Whiten_Color : LDA.l PaletteBuffer+$FA
LDA.l PaletteBufferAux+$FC : JSL Filter_Majorly_Whiten_Color : LDA.l PaletteBuffer+$FC
LDA.l PaletteBufferAux+$FE : JSL Filter_Majorly_Whiten_Color : LDA.l PaletteBuffer+$FE
REP #$10
LDA.l PaletteBuffer+$40 : TAY
LDA.l PaletteBufferAux : BNE +
TAY
+
TYA : STA.l PaletteBuffer
SEP #$30
RTS
;================================================================================
RestoreBgEther:
LDX.b #$00
LDA.l DisableFlashing : REP #$20 : BNE +
-
LDA.b Scrap00,X
LDA.l PaletteBufferAux+$40, X : STA.l PaletteBuffer+$40, X
LDA.l PaletteBufferAux+$50, X : STA.l PaletteBuffer+$50, X
LDA.l PaletteBufferAux+$60, X : STA.l PaletteBuffer+$60, X
LDA.l PaletteBufferAux+$70, X : STA.l PaletteBuffer+$70, X
LDA.l PaletteBufferAux+$80, X : STA.l PaletteBuffer+$80, X
LDA.l PaletteBufferAux+$90, X : STA.l PaletteBuffer+$90, X
LDA.l PaletteBufferAux+$A0, X : STA.l PaletteBuffer+$A0, X
LDA.l PaletteBufferAux+$B0, X : STA.l PaletteBuffer+$B0, X
LDA.l PaletteBufferAux+$C0, X : STA.l PaletteBuffer+$C0, X
LDA.l PaletteBufferAux+$D0, X : STA.l PaletteBuffer+$D0, X
LDA.l PaletteBufferAux+$E0, X : STA.l PaletteBuffer+$E0, X
LDA.l PaletteBufferAux+$F0, X : STA.l PaletteBuffer+$F0, X
INX #2 : CPX.b #$10 : BNE -
BRA ++
+
-
LDA.b Scrap00
LDA.l PaletteBufferAux+$40, X : LDA.l PaletteBuffer+$40, X
LDA.l PaletteBufferAux+$50, X : LDA.l PaletteBuffer+$50, X
LDA.l PaletteBufferAux+$60, X : LDA.l PaletteBuffer+$60, X
LDA.l PaletteBufferAux+$70, X : LDA.l PaletteBuffer+$70, X
LDA.l PaletteBufferAux+$80, X : LDA.l PaletteBuffer+$80, X
LDA.l PaletteBufferAux+$90, X : LDA.l PaletteBuffer+$90, X
LDA.l PaletteBufferAux+$A0, X : LDA.l PaletteBuffer+$A0, X
LDA.l PaletteBufferAux+$B0, X : LDA.l PaletteBuffer+$B0, X
LDA.l PaletteBufferAux+$C0, X : LDA.l PaletteBuffer+$C0, X
LDA.l PaletteBufferAux+$D0, X : LDA.l PaletteBuffer+$D0, X
LDA.l PaletteBufferAux+$E0, X : LDA.l PaletteBuffer+$E0, X
LDA.l PaletteBufferAux+$F0, X : LDA.l PaletteBuffer+$F0, X
INX #2 : CPX.b #$10 : BNE -
BRA ++
++
JML $82FF51 ; Bank0E.asm : 3936 vanilla restore routine after loop which RTLs
;================================================================================
DDMConditionalLightning:
LDA.l DisableFlashing
REP #$20
BNE +
LDA.w Scrap
LDX.b #$02
JML $87FA7F ; Bank0E.asm : 4738 vanilla loop equivalent to below beginning at LDY #$00
+
LDA.b Scrap00 : LDX.b #$02 : LDY.b #$00
-
LDA.w $F4EB, Y : LDA.l PaletteBuffer+$60, X
LDA.w $F4F9, Y : LDA.l PaletteBuffer+$70, X
LDA.w $F507, Y : LDA.l PaletteBuffer+$90, X
LDA.w $F515, Y : LDA.l PaletteBuffer+$E0, X
LDA.w $F523, Y : LDA.l PaletteBuffer+$F0, X
INY #2
INX #2 : CPX.b #$10 : BNE -
JML $87FAAC ; Bank0E.asm : 4754 both branches converge here
;================================================================================
ConditionalGTFlash:
LDA.l DisableFlashing : REP #$20 : BNE +
LDA.w Scrap
-
LDA.w $F9C1, Y : STA.l PaletteBuffer+$D0, X
INY #2
INX #2 : CPX.b #$10 : BNE -
RTL
+
LDA.b Scrap00
-
LDA.w $F9C1, Y : LDA.l PaletteBuffer+$D0, X
INY #2
INX #2 : CPX.b #$10 : BNE -
RTL
;================================================================================
ConditionalRedFlash:
LDA.l DisableFlashing : REP #$20 : BNE +
LDA.b Scrap,X
LDA.w #$1D59 : STA.l PaletteBuffer+$DA
LDA.w #$25FF : STA.l PaletteBuffer+$DC
LDA.w #$001A
RTL
+
LDA.b Scrap00
LDA.w #$1D59 : LDA.l PaletteBuffer+$DA
LDA.w #$25FF : LDA.l PaletteBuffer+$DC
LDA.w #$0000
RTL
;================================================================================
ConditionalPedAncilla:
LDA.l DisableFlashing : REP #$20 : BNE +
LDA.b Scrap,X
LDA.b Scrap00 : STA.b Scrap04
LDA.b Scrap02 : STA.b Scrap06
RTL
+
LDA.b Scrap
LDA.b Scrap00 : LDA.b Scrap04
LDA.b Scrap02 : LDA.b Scrap06
RTL
;================================================================================
LoadElectroPalette:
REP #$20
LDA.w #$0202 : STA.b Scrap0C
LDA.w #$0404 : STA.b Scrap0E
LDA.w #$001B : STA.b Scrap02
SEP #$10
LDX.b Scrap0C : LDA.l $9BEBB4, X : AND.w #$00FF : ADC.w #$D630
REP #$10 : LDX.w #$01B2 : LDY.w #$0002
JSR ConditionalLoadGearPalette
SEP #$10
LDX.b Scrap0D
LDA.l $9BEBC1, X : AND.w #$00FF : ADC.w #$D648
REP #$10 : LDX.w #$01B8 : LDY.w #$0003
JSR ConditionalLoadGearPalette
SEP #$10
LDX.b Scrap0E
LDA.l $9BEC06, X : AND.w #$00FF : ASL A : ADC.w #$D308
REP #$10 : LDX.w #$01E2 : LDY.w #$000E
JSR ConditionalLoadGearPalette
SEP #$30
INC.b NMICGRAM
RTL
;================================================================================
ConditionalLoadGearPalette:
STA.b Scrap00
SEP #$20
LDA.l DisableFlashing : REP #$20 : BNE +
LDA.b Scrap,X
-
LDA.b [Scrap00]
STA.l PaletteBuffer, X
INC.b Scrap00 : INC.b Scrap00
INX #2
DEY
BPL -
RTS
+
LDA.b Scrap
-
LDA.b [Scrap00]
LDA.l PaletteBuffer, X
INC.b Scrap00 : INC.b Scrap00
INX #2
DEY
BPL -
RTS
;================================================================================
RestoreElectroPalette:
REP #$30
LDX.w #$01B2 : LDY.w #$0002
JSR FillPaletteBufferFromAux
LDX.w #$01B8 : LDY.w #$0003
JSR FillPaletteBufferFromAux
LDX.w #$01E2 : LDY.w #$000E
JSR FillPaletteBufferFromAux
SEP #$30
INC.b NMICGRAM
RTL
;================================================================================
FillPaletteBufferFromAux:
-
LDA.l PaletteBufferAux, X
STA.l PaletteBuffer, X
INX #2
DEY
BPL -
RTS

BIN
bin/linux/asar Executable file

Binary file not shown.

BIN
bin/macos/asar Executable file

Binary file not shown.

BIN
bin/windows/asar.exe Normal file

Binary file not shown.

View File

@@ -2,23 +2,23 @@
; Randomize Book of Mudora
;--------------------------------------------------------------------------------
LoadLibraryItemGFX:
%GetPossiblyEncryptedItem(LibraryItem, SpriteItemValues)
STA $0E80, X ; Store item type
JSL.l PrepDynamicTile
%GetPossiblyEncryptedItem(LibraryItem, SpriteItemValues)
JSL.l AttemptItemSubstitution
JSL.l ResolveLootIDLong
STA.w SpriteID, X
JSL.l PrepDynamicTile_loot_resolved
RTL
;--------------------------------------------------------------------------------
DrawLibraryItemGFX:
PHA
LDA $0E80, X ; Retrieve stored item type
JSL.l DrawDynamicTile
PLA
PHA
LDA.w SpriteID, X
JSL.l DrawDynamicTile
PLA
RTL
;--------------------------------------------------------------------------------
SetLibraryItem:
PHA
LDY $0E80, X ; Retrieve stored item type
PLA
JSL.l ItemSet_Library ; contains thing we wrote over
LDY.w SpriteID, X
JSL.l ItemSet_Library ; contains thing we wrote over
RTL
;--------------------------------------------------------------------------------
@@ -26,52 +26,76 @@ RTL
;================================================================================
; Randomize Bonk Keys
;--------------------------------------------------------------------------------
!REDRAW = "$7F5000"
;--------------------------------------------------------------------------------
LoadBonkItemGFX:
LDA.b #$08 : STA $0F50, X ; thing we wrote over
LDA.b #$08 : STA.w SpriteOAMProp, X ; thing we wrote over
LoadBonkItemGFX_inner:
LDA.b #$00 : STA !REDRAW
LDA.b #$00 : STA.l RedrawFlag
JSR LoadBonkItem
JSL.l AttemptItemSubstitution
JSL.l ResolveLootIDLong
STA.w SpriteItemType, X
STA.w SpriteID, X
JSL.l PrepDynamicTile
PHA : PHX
LDA.w SpriteID,X : TAX
LDA.l SpriteProperties_standing_width,X : BNE +
LDA.b #$00 : STA.l SpriteOAM : STA.l SpriteOAM+8
+
PLX : PLA
RTL
;--------------------------------------------------------------------------------
DrawBonkItemGFX:
PHA
LDA !REDRAW : BEQ .skipInit ; skip init if already ready
JSL.l LoadBonkItemGFX_inner
BRA .done ; don't draw on the init frame
PHA
LDA.l RedrawFlag : BEQ .skipInit
JSL.l LoadBonkItemGFX_inner
BRA .done ; don't draw on the init frame
.skipInit
JSR LoadBonkItem
JSL.l DrawDynamicTileNoShadow
.done
PLA
LDA.w SpriteID,X
JSL.l DrawDynamicTileNoShadow
.done
PLA
RTL
;--------------------------------------------------------------------------------
GiveBonkItem:
JSR LoadBonkItem
CMP #$24 : BNE .notKey
JSR.w AbsorbKeyCheck : BCC .notKey
.key
PHY : LDY.b #$24 : JSL.l AddInventory : PLY ; do inventory processing for a small key
LDA $7EF36F : INC A : STA $7EF36F
LDA.l CurrentSmallKeys : INC A : STA.l CurrentSmallKeys
LDA.b #$2F : JSL.l Sound_SetSfx3PanLong
LDA.b #$01 : STA.l UpdateHUDFlag
RTL
.notKey
PHY : TAY : JSL.l Link_ReceiveItem : PLY
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.b RoomIndex ; check room ID - only bonk keys in 2 rooms so we're just checking the lower byte
CMP.b #115 : BNE + ; Desert Bonk Key
LDA.l BonkKey_Desert
BRA ++
+ : CMP #140 : BNE + ; GTower Bonk Key
+ : CMP.b #140 : BNE + ; GTower Bonk Key
LDA.l BonkKey_GTower
BRA ++
+
LDA.b #$24 ; default to small key
++
RTS
RTS
;--------------------------------------------------------------------------------
AbsorbKeyCheck:
PHA
CMP.b #$24 : BEQ .key
CMP.b #$A0 : BCC .not_key
CMP.b #$B0 : BCS .not_key
AND.b #$0F : ASL
CMP.w DungeonID : BNE .not_key
.key
PLA
SEC
RTS
.not_key
PLA
CLC
RTS

View File

@@ -1,15 +1,76 @@
;================================================================================
; Boots State Modifier
;--------------------------------------------------------------------------------
!BOOTS_MODIFIER = "$7F50CE"
ModifyBoots:
PHA
LDA !BOOTS_MODIFIER : CMP.b #$01 : BNE +
PLA : AND $7EF379 : ORA.b #$04 : RTL ; yes boots
+ : CMP #$02 : BNE +
PLA : AND $7EF379 : AND.b #$FB : RTL ; no boots
+
PLA
AND $7EF379 ; regular boots
PHA
LDA.l BootsModifier : CMP.b #$01 : BNE +
PLA : AND.l AbilityFlags : ORA.b #$04 : RTL ; yes boots
+ : CMP.b #$02 : BNE +
PLA : AND.l AbilityFlags : AND.b #$FB : RTL ; no boots
+ : LDA.l FakeBoots : CMP.b #$01 : BNE +
LDA.b LinkSlipping : BEQ ++ : LDA.b $59 : BNE + ; hover check
++ : PLA : AND.l AbilityFlags : ORA.b #$04 : RTL ; yes boots, not hovering
+
PLA
AND.l AbilityFlags ; regular boots
RTL
;--------------------------------------------------------------------------------
AddBonkTremors:
PHA
LDA.b $46 : BNE + ; Check for incapacitated Link
JSL.l IncrementBonkCounter
+
LDA.l BootsModifier : CMP.b #$01 : BEQ +
LDA.l BootsEquipment : BNE + ; Check for Boots
PLA : RTL
+
PLA
JSL.l AddDashTremor : JSL.l Player_ApplyRumbleToSprites ; things we wrote over
RTL
;--------------------------------------------------------------------------------
BonkBreakableWall:
PHX : PHP
SEP #$30 ; set 8-bit accumulator and index registers
LDA.l BootsModifier : CMP.b #$01 : BEQ +
LDA.l BootsEquipment : BNE + ; Check for Boots
PLP : PLX : LDA.w #$0000 : RTL
+
PLP : PLX
LDA.w $0372 : AND.w #$00FF ; things we wrote over
RTL
;--------------------------------------------------------------------------------
BonkRockPile:
LDA.l BootsModifier : CMP.b #$01 : BEQ +
LDA.l BootsEquipment : BNE + ; Check for Boots
LDA.b #$00 : RTL
+
LDA.w TileActBE : AND.b #$70 ; things we wrote over
RTL
;--------------------------------------------------------------------------------
GravestoneHook:
LDA.l BootsModifier : CMP.b #$01 : BEQ +
LDA.l BootsEquipment : BEQ .done ; Check for Boots
+
LDA.w $0372 : BEQ .done ; things we wrote over
JML.l moveGravestone
.done
JML.l GravestoneHook_continue
;--------------------------------------------------------------------------------
JumpDownLedge:
LDA.l BootsModifier : CMP.b #$01 : BEQ +
LDA.l BootsEquipment : BNE + ; Check for Boots
; Disarm Waterwalk
LDA.b LinkSlipping : CMP.b #$01 : BNE +
STZ.b LinkSlipping
+
LDA.b IndoorsFlag : BNE .done : LDA.b #$02 : STA.b LinkLayer ; things we wrote over
.done
RTL
;--------------------------------------------------------------------------------
BonkRecoil:
LDA.l BootsModifier : CMP.b #$01 : BEQ +
LDA.l BootsEquipment : BNE + ; Check for Boots
LDA.b #$16 : STA.b LinkRecoilZ : RTL
+
LDA.b #$24 : STA.b LinkRecoilZ ; things we wrote over
RTL
;--------------------------------------------------------------------------------

View File

@@ -2,8 +2,8 @@
;--------------------------------------------------------------------------------
AssignKiki:
LDA.b #$00 : STA $7EF3D3 ; defuse bomb
LDA.b #$0A : STA $7EF3CC ; assign kiki as follower
LDA.b #$00 : STA.l FollowerDropped ; defuse bomb
LDA.b #$0A : STA.l FollowerIndicator ; assign kiki as follower
RTL
;--------------------------------------------------------------------------------
@@ -11,10 +11,9 @@ RTL
; Name: AllowSQ
; Returns: Accumulator = 0 if S&Q is disallowed, 1 if allowed
;--------------------------------------------------------------------------------
!ITEM_BUSY = "$7F5091"
AllowSQ:
LDA $7EF3C5 : BEQ .done ; thing we overwrote - check if link is in his bed
LDA !ITEM_BUSY : EOR #$01
LDA.l ProgressIndicator : BEQ .done ; thing we overwrote - check if link is in his bed
LDA.l BusyItem : EOR.b #$01
.done
RTL
;--------------------------------------------------------------------------------
@@ -23,8 +22,8 @@ RTL
;0 = Reset Music
;1 = Don't Reset Music
MSMusicReset:
LDA $8A : CMP.b #$80 : BNE +
LDA $23
LDA.b OverworldIndex : CMP.b #$80 : BNE +
LDA.b LinkPosX+1
+
RTL
;--------------------------------------------------------------------------------
@@ -32,11 +31,11 @@ RTL
;--------------------------------------------------------------------------------
;0 = Become (Perma)bunny
DecideIfBunny:
LDA $7EF357 : BEQ + : RTL : +
LDA $7EF3CA : AND.b #$40
LDA.l MoonPearlEquipment : BNE .done
LDA.l CurrentWorld : AND.b #$40
PHA : LDA.l InvertedMode : BNE .inverted
.normal
PLA : EOR #$40
PLA : EOR.b #$40
BRA .done
.inverted
PLA
@@ -47,9 +46,9 @@ RTL
DecideIfBunnyByScreenIndex:
; If indoors we don't have a screen index. Return non-bunny to make mirror-based
; superbunny work
LDA $1B : BEQ + : RTL : +
LDA $7EF357 : BEQ + : RTL : +
LDA $8A : AND.b #$40 : PHA
LDA.b IndoorsFlag : BNE .done
LDA.l MoonPearlEquipment : BNE .done
LDA.b OverworldIndex : AND.b #$40 : PHA
LDA.l InvertedMode : BNE .inverted
.normal
PLA : EOR #$40
@@ -58,23 +57,14 @@ DecideIfBunnyByScreenIndex:
PLA
.done
RTL
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
;ReadInventoryPond:
; CPX.b #$1B : BNE + : LDA.b #$01 : RTL : +
; LDA $7EF340, X
;RTL
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
FixBunnyOnExitToLightWorld:
LDA.w $02E0 : BEQ +
LDA.w BunnyFlag : BEQ +
JSL.l DecideIfBunny : BEQ +
STZ $5D ; set player mode to Normal
STZ $02E0 : STZ $56 ; return player graphics to normal
STZ.b LinkState ; set player mode to Normal
STZ.w BunnyFlag : STZ.b BunnyFlagDP ; return player graphics to normal
+
RTS
RTL
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
@@ -82,12 +72,18 @@ RTS
; bunny on the pyramid
FixAga2Bunny:
LDA.l FixFakeWorld : BEQ + ; Only use this fix is fakeworld fix is in use
LDA.l InvertedMode : BEQ +++
LDA.b #$00 : STA.l CurrentWorld ; Switch to light world
BRA ++
+++
LDA.b #$40 : STA.l CurrentWorld ; Switch to dark world
++
JSL DecideIfBunny : BNE +
JSR MakeBunny
LDA.b #$04 : STA.w $012C ; play bunny music
LDA.b #$04 : STA.w MusicControlRequest ; play bunny music
BRA .done
+
LDA.b #$09 : STA.w $012C ; what we wrote over
LDA.b #$09 : STA.w MusicControlRequest ; what we wrote over
.done
RTL
;--------------------------------------------------------------------------------
@@ -95,8 +91,8 @@ RTL
;--------------------------------------------------------------------------------
MakeBunny:
PHX : PHY
LDA.b #$17 : STA $5D ; set player mode to permabunny
LDA.b #$01 : STA $02E0 : STA $56 ; make player look like bunny
LDA.b #$17 : STA.b LinkState ; set player mode to permabunny
LDA.b #$01 : STA.w BunnyFlag : STA.b BunnyFlagDP ; make player look like bunny
JSL LoadGearPalettes_bunny
PLY : PLX
RTS
@@ -106,46 +102,45 @@ RTS
; fix issue where cross world caves (in Entrance randomizer) don't cause
; frog to become smith or vice versa.
FixFrogSmith:
LDA.l $7EF3CA : BNE .darkWorld
LDA.l $7EF3CC : CMP.b #$07 : BNE .done
LDA.b #$08 : STA.l $7EF3CC ; make frog into smith in light world
LDA.l CurrentWorld : BNE .darkWorld
LDA.l FollowerIndicator : CMP.b #$07 : BNE .done
LDA.b #$08 ; make frog into smith in light world
BRA .loadgfx
.darkWorld
LDA.l $7EF3CC : CMP.b #$08 : BNE .done
LDA.b #$07 : STA.l $7EF3CC ; make smith into frog in dark world
LDA.l FollowerIndicator : CMP.b #$08 : BNE .done
LDA.b #$07 ; make smith into frog in dark world
.loadgfx
STA.l FollowerIndicator
JSL Tagalong_LoadGfx
.done
RTS
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
;Fix for PoD causing accidental Exploration Glitch
PodEGFix:
LDA Bugfix_PodEG : BNE .done
LDA $040C : CMP.b #$0C : BNE .done ;check if we are in PoD
STZ $047A ;disarm exploration glitch
.done
RTL
; Fix for SQ jumping causing accidental Exploration Glitch
SQEGFix:
LDA.l Bugfix_PodEG : BEQ ++
STZ.w LayerAdjustment ; disarm exploration glitch
++ RTL
;--------------------------------------------------------------------------------
; Fix crystal not spawning when using somaria vs boss
TryToSpawnCrystalUntilSuccess:
STX $02D8 ; what we overwrote
JSL AddAncillaLong : BCC .spawned ; a clear carry flag indicates success
.failed
RTL
.spawned
STZ $AE ; the "trying to spawn crystal" flag
STZ $AF ; the "trying to spawn pendant" flag
STX.w ItemReceiptID ; what we overwrote
JSL AddAncillaLong : BCS .failed ; a clear carry flag indicates success
.spawned
STZ.b RoomTag ; the "trying to spawn crystal" flag
STZ.b RoomTag+1 ; the "trying to spawn pendant" flag
.failed
RTL
;--------------------------------------------------------------------------------
; Fix crystal not spawning when using somaria vs boss
WallmasterCameraFix:
STZ $A7 ; disable vertical camera scrolling for current room
STZ.b CameraBoundV ; disable vertical camera scrolling for current room
REP #$20
STZ $0618 ; something about scrolling, setting these to 0 tricks the game
STZ $061A ; into thinking we're at the edge of the room so it doesn't scroll.
STZ.w CameraScrollN ; something about scrolling, setting these to 0 tricks the game
STZ.w CameraScrollS ; into thinking we're at the edge of the room so it doesn't scroll.
SEP #$20
JML Sound_SetSfx3PanLong ; what we wrote over, also this will RTL
@@ -153,8 +148,8 @@ WallmasterCameraFix:
; Fix losing glove colors
LoadActualGearPalettesWithGloves:
REP #$20
LDA $7EF359 : STA $0C
LDA $7EF35B : AND.w #$00FF
LDA.l SwordEquipment : STA.b Scrap0C
LDA.l ArmorEquipment : AND.w #$00FF
JSL LoadGearPalettes_variable
JSL SpriteSwap_Palette_ArmorAndGloves_part_two
RTL
@@ -162,35 +157,98 @@ RTL
;--------------------------------------------------------------------------------
; Fix Bunny Palette Map Bug
LoadGearPalette_safe_for_bunny:
LDA $10
LDA.b GameMode
CMP.w #$030E : BEQ .new ; opening dungeon map
CMP.w #$070E : BEQ .new ; opening overworld map
.original
-
lda [$00]
sta $7ec300, x
sta $7ec500, x
inc $00 : inc $00
inx #2
dey
bpl -
LDA.b [Scrap00]
STA.l PaletteBufferAux, X
STA.l PaletteBuffer, X
INC.b Scrap00 : INC.b Scrap00
INX #2
DEY
BPL -
RTL
.new
-
lda [$00]
sta $7ec500, x
inc $00 : inc $00
inx #2
dey
bpl -
LDA.b [Scrap00]
STA.l PaletteBuffer, X
INC.b Scrap00 : INC.b Scrap00
INX #2
DEY
BPL -
RTL
;--------------------------------------------------------------------------------
; Fix pedestal pull overlay
PedestalPullOverlayFix:
LDA.b #$09 : STA $039F, X ; the thing we wrote over
LDA $1B : BNE +
LDA $8A : CMP.b #$80 : BNE +
LDA $8C : CMP.b #$97
LDA.b #$09 : STA.w AncillaGeneral, X ; the thing we wrote over
LDA.b IndoorsFlag : BNE +
LDA.b OverworldIndex : CMP.b #$80 : BNE +
LDA.b OverlayID : CMP.b #$97
+
RTL
;--------------------------------------------------------------------------------
FixJingleGlitch:
LDA.b GameSubMode
BEQ .set_doors
LDA.l AllowAccidentalMajorGlitch
BEQ .exit
.set_doors
LDA.b #$05
STA.b GameSubMode
.exit
RTL
;--------------------------------------------------------------------------------
; Fix spawning with more hearts than capacity when less than 3 heart containers
pushpc
org $09F4AC ; <- module_death.asm:331
db $08, $08, $10
pullpc
;--------------------------------------------------------------------------------
SetOverworldTransitionFlags:
LDA.b #$01
STA.w OWTransitionFlag
STA.w RaceGameFlag
RTL
;--------------------------------------------------------------------------------
ParadoxCaveGfxFix:
; Always upload line unless you're moving into paradox cave (0x0FF) from above (0x0EF)
LDA.b IndoorsFlag : BEQ .uploadLine
LDX.b RoomIndex : CPX.w #$00FF : BNE .uploadLine
LDX.b PreviousRoom : CPX.w #$00EF : BNE .uploadLine
;Ignore uploading four specific lines of tiles to VRAM
LDX.w VRAMUploadAddress
; Line 1
CPX.w #$1800 : BEQ .skipMostOfLine
; Line 2
CPX.w #$1A00 : BEQ .skipMostOfLine
; Line 3
CPX.w #$1C00 : BEQ .uploadLine
; Line 4
CPX.w #$1E00 : BEQ .uploadLine
.uploadLine
LDA.b #$01 : STA.w MDMAEN
.skipLine
RTL
.skipMostOfLine
; Set line length to 192 bytes (the first 6 8x8 tiles in the line)
LDX.w #$00C0 : STX.w DAS0L
BRA .uploadLine
;--------------------------------------------------------------------------------
SetItemRiseTimer:
LDA.w ItemReceiptMethod : CMP #$01 : BNE .not_from_chest
LDA.b #$38 : STA.w AncillaTimer, X
RTL
.not_from_chest
TYA : STA.w AncillaTimer, X ; What we wrote over
RTL

View File

@@ -1,4 +1,4 @@
del ..\working.sfc
copy ..\alttp.sfc ..\working.sfc
xkas.exe LTTP_RND_GeneralBugfixes.asm ..\working.sfc
cmd /k
%~dp0bin\windows\asar.exe LTTP_RND_GeneralBugfixes.asm ..\working.sfc
cmd /k

View File

@@ -2,4 +2,4 @@
rm ../working.sfc
cp ../alttp.sfc ../working.sfc
./xkas LTTP_RND_GeneralBugfixes.asm ../working.sfc
./bin/macos/asar LTTP_RND_GeneralBugfixes.asm ../working.sfc

5
build_linux.sh Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/bash
rm ../working.sfc
cp ../alttp.sfc ../working.sfc
./bin/linux/asar -DFEATURE_PATREON_SUPPORTERS=1 LTTP_RND_GeneralBugfixes.asm ../working.sfc

BIN
c2e3e.gfx

Binary file not shown.

View File

@@ -1,42 +1,27 @@
;================================================================================
; Capacity Logic
;================================================================================
!BOMB_UPGRADES = "$7EF370"
!BOMB_CURRENT = "$7EF343"
;--------------------------------------------------------------------------------
IncrementBombs:
LDA !BOMB_UPGRADES ; get bomb upgrades
!ADD.l StartingMaxBombs : DEC
CMP !BOMB_CURRENT
!BLT +
LDA !BOMB_CURRENT
CMP.b #99 : !BGE +
INC : STA !BOMB_CURRENT
+
LDA.l BombCapacity : BEQ + ; Skip if we can't have bombs
DEC
CMP.l BombsEquipment : !BLT +
LDA.l BombsEquipment
CMP.b #99 : !BGE +
INC : STA.l BombsEquipment
+
RTL
;--------------------------------------------------------------------------------
!ARROW_UPGRADES = "$7EF371"
!ARROW_CURRENT = "$7EF377"
;--------------------------------------------------------------------------------
IncrementArrows:
LDA !ARROW_UPGRADES ; get arrow upgrades
!ADD.l StartingMaxArrows : DEC
CMP !ARROW_CURRENT
!BLT +
LDA !ARROW_CURRENT
CMP.b #99 : !BGE +
INC : STA !ARROW_CURRENT
+
LDA.l ArrowCapacity : DEC
CMP.l CurrentArrows : !BLT +
LDA.l CurrentArrows
CMP.b #99 : !BGE +
INC : STA.l CurrentArrows
+
RTL
;--------------------------------------------------------------------------------
CompareBombsToMax:
LDA !BOMB_UPGRADES ; get bomb upgrades
!ADD.l StartingMaxBombs
CMP !BOMB_CURRENT
LDA.l BombCapacity
CMP.l BombsEquipment
RTL
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------

View File

@@ -1,39 +0,0 @@
;================================================================================
; Randomize Catfish
;--------------------------------------------------------------------------------
!HEART_REDRAW = "$7F5000"
LoadCatfishItemGFX:
LDA.l $1DE185 ; location randomizer writes catfish item to
JSL.l PrepDynamicTile
RTL
;--------------------------------------------------------------------------------
DrawThrownItem:
LDA $8A : CMP.b #$81 : BNE .catfish
.zora
LDA.b #$01 : STA !HEART_REDRAW
LDA.l $1DE1C3 ; location randomizer writes zora item to
BRA .draw
.catfish
LDA.l $1DE185 ; location randomizer writes catfish item to
.draw
JSL.l DrawDynamicTile
RTL
;--------------------------------------------------------------------------------
MarkThrownItem:
JSL Link_ReceiveItem ; thing we wrote over
LDA $8A : CMP.b #$81 : BNE .catfish
.zora
JSL.l ItemSet_ZoraKing
BRA .done
.catfish
JSL.l ItemSet_Catfish
.done
RTL
;--------------------------------------------------------------------------------

250
clock.asm
View File

@@ -1,250 +0,0 @@
;--------------------------------------------------------------------------------
; http://problemkaputt.de/fullsnes.htm
; 2800h-2801h S-RTC Real Time Clock I/O Ports
; cartridge type change from #$02 to #$55 to enable S-RTC
; SNES Cart S-RTC (Realtime Clock) (1 game)
;
; PCB "SHVC-LJ3R-01" with 24pin "Sharp S-RTC" chip. Used only by one japanese game:
; Dai Kaiju Monogatari 2 (1996) Birthday/Hudson Soft (JP)
;
; S-RTC I/O Ports
; 002800h S-RTC Read (R)
; 002801h S-RTC Write (W)
; Both registers are 4bits wide. When writing: Upper 4bit should be zero. When reading: Upper 4bit should be masked-off (they do possibly contain garbage, eg. open-bus).
;
; S-RTC Communication
; The sequence for setting, and then reading the time is:
; Send <0Eh,04h,0Dh,0Eh,00h,Timestamp(12 digits),0Dh> to [002801h]
; If ([002800h] AND 0F)=0Fh then read <Timestamp(13 digits)>
; If ([002800h] AND 0F)=0Fh then read <Timestamp(13 digits)>
; If ([002800h] AND 0F)=0Fh then read <Timestamp(13 digits)>
; If ([002800h] AND 0F)=0Fh then read <Timestamp(13 digits)>
; etc.
; The exact meaning of the bytes is unknown. 0Eh/0Dh seems to invoke/terminate commands, 04h might be some configuration stuff (like setting 24-hour mode). 00h is apparently the set-time command. There might be further commands (such like setting interrupts, alarm, 12-hour mode, reading battery low & error flags, etc.). When reading, 0Fh seems to indicate sth like "time available".
; The 12/13-digit "SSMMHHDDMYYY(D)" Timestamps are having the following format:
; Seconds.lo (BCD, 0..9)
; Seconds.hi (BCD, 0..5)
; Minutes.lo (BCD, 0..9)
; Minutes.hi (BCD, 0..5)
; Hours.lo (BCD, 0..9)
; Hours.hi (BCD, 0..2)
; Day.lo (BCD, 0..9)
; Day.hi (BCD, 0..3)
; Month (HEX, 01h..0Ch)
; Year.lo (BCD, 0..9)
; Year.hi (BCD, 0..9)
; Century (HEX, 09h..0Ah for 19xx..20xx)
; When READING the time, there is one final extra digit (the existing software doesn't transmit that extra digit on WRITING, though maybe it's possible to do writing, too):
; Day of Week? (0..6) (unknown if RTC assigns sth like 0=Sunday or 0=Monday)
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
macro A_x10()
ASL #1 : PHA
ASL #2 : !ADD 1,s
STA 1,s : PLA
endmacro
;--------------------------------------------------------------------------------
macro A_x24()
ASL #3 : PHA
ASL #1 : !ADD 1,s
STA 1,s : PLA
endmacro
;--------------------------------------------------------------------------------
macro A_x60()
ASL #2 : PHA
ASL #4 : !SUB 1,s
STA 1,s : PLA
endmacro
;--------------------------------------------------------------------------------
macro Clock_ReadBCD()
LDA $002800 : PHA
LDA $002800 : %A_x10() : !ADD 1,s
STA 1,s : PLA
endmacro
;--------------------------------------------------------------------------------
Clock_Test:
JSL.l Clock_Init
JSL.l Clock_IsSupported
RTL
;--------------------------------------------------------------------------------
; Clock_Init
;--------------------------------------------------------------------------------
Clock_Init:
LDA.b #$0E : STA $002801
LDA.b #$04 : STA $002801
LDA.b #$0D : STA $002801
LDA.b #$0E : STA $002801
LDA.b #$00 : STA $002801
LDA.b #$00 : STA $002801
LDA.b #$00 : STA $002801
LDA.b #$00 : STA $002801
LDA.b #$00 : STA $002801
LDA.b #$00 : STA $002801
LDA.b #$00 : STA $002801
LDA.b #$01 : STA $002801
LDA.b #$00 : STA $002801
LDA.b #$01 : STA $002801
LDA.b #$00 : STA $002801
LDA.b #$00 : STA $002801
LDA.b #$0A : STA $002801
LDA.b #$0D : STA $002801
RTL
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
; Clock_IsSupported
;--------------------------------------------------------------------------------
; Input: None (8-bit accumulator)
;--------------------------------------------------------------------------------
; Output:
; Carry - unset if unsupported, set if supported
; Zero - Undefined
;--------------------------------------------------------------------------------
; Side Effects:
; S-RTC is ready for reading upon exit if supported
;--------------------------------------------------------------------------------
Clock_IsSupported:
PHA : PHX
LDX #$00;
-
LDA $002800 : AND.b #$0F : CMP #$0F : BEQ + ; check for clock chip ready signal
CPX.b #$0E : !BLT ++ : CLC : BRA .done : ++ ; if we've read 14 bytes with no success, unset carry and exit
INX
BRA - : +
SEC ; found a clock chip
.done
PLX : PLA
RTL
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
; Clock_QuickStamp
;--------------------------------------------------------------------------------
; Input: None
;--------------------------------------------------------------------------------
; Output:
; $00.b - 24-bit timestamp (low)
; $01.b - 24-bit timestamp (mid)
; $02.b - 24-bit timestamp (high)
; $03.b - zero
; Carry - Unset if error, Set if success
; Zero - Undefined
;--------------------------------------------------------------------------------
; Side Effects:
; Requires Mode-7 Matrix Registers
;--------------------------------------------------------------------------------
Clock_QuickStamp:
PHA : PHX : PHP
SEP #$30 ; set 8-bit accumulator and index registers
LDX #$00;
-
LDA $002800 : AND.b #$0F : CMP #$0F : BEQ .ready ; check for clock chip ready signal
CPX.b #$0E : !BLT ++ : CLC : BRL .done : ++ ; if we've read 14 bytes with no success, unset carry and exit
INX
BRA -
SEC ; indicate success
.ready
%Clock_ReadBCD() : STA $00 ; seconds
%Clock_ReadBCD() : STA $01 ; minutes
%Clock_ReadBCD() : STA $02 ; hours
%Clock_ReadBCD() : STA $03 ; days
REP $20 ; set 16-bit accumulator
LDA $01 : AND #$00FF : %A_x60() ; convert minutes to seconds
STZ $01 : !ADD $00 : STA $00 ; store running total seconds to $00
LDA $03 : AND #$00FF : %A_x24() ; convert days to hours
STZ $03 : !ADD $02 ; get total hours
%A_x60() ; get total minutes
LDY #$60
JSL.l Multiply_A16Y8
STY $02 : STZ $03
!ADD $00 : BCC + : INC $02 : +
.done
PLP : PLX : PLA
RTL
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
; Multiply_A16Y8:
;--------------------------------------------------------------------------------
; Expects:
; Accumulator - 16-bit
; Index Registers - 8-bit
;--------------------------------------------------------------------------------
; Notes:
; Found a (wrong) version of this on wikibooks. This is cleaned up and fixed.
;--------------------------------------------------------------------------------
Multiply_A16Y8:
SEP #$20 ; set 8-bit accumulator
STY $4202
STA $4203
NOP #4
LDA $4216
LDY $4217
XBA
STA $4203
NOP #2
TYA
CLC
ADC $4216
LDY $4217
BCC carry_bit
INY
carry_bit:
XBA
REP #$20 ; set 16-bit accumulator
RTL
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
; Clock_GetTime
;--------------------------------------------------------------------------------
; Input: None
;--------------------------------------------------------------------------------
; Output:
; $00.b - Seconds
; $01.b - Minutes
; $02.b - Hours
; $03.b - Days
; $04.b - Months
; $05.w - Years
; Carry - Unset if error, Set if success
; Zero - Undefined
;--------------------------------------------------------------------------------
Clock_GetTime:
PHA : PHX : PHY : PHP
SEP #$30 ; set 8-bit accumulator and index registers
LDX #$00;
-
LDA $002800 : AND.b #$0F : CMP #$0F : BEQ .ready ; check for clock chip ready signal
CPX.b #$0E : !BLT ++ : CLC : BRL .done : ++ ; if we've read 14 bytes with no success, unset carry and exit
INX
BRA -
SEC ; indicate success
.ready
%Clock_ReadBCD() : STA $00 ; seconds
%Clock_ReadBCD() : STA $01 ; minutes
%Clock_ReadBCD() : STA $02 ; hours
%Clock_ReadBCD() : STA $03 ; days
LDA $002800 : STA $04 ; months
%Clock_ReadBCD() : STA $05 ; years
LDA $002800 : STA $06 ; century
REP $20 ; set 16-bit accumulator
STA $06 : AND #$00FF : %A_x10() : %A_x10() : !ADD #1000 ; multiply century digit by 100 and add 1000
STZ $06 : !ADD $05 : STA $05 ; add lower 2 digits of the year and store
.done
PLP : PLY : PLX : PLA
RTL
;--------------------------------------------------------------------------------

View File

@@ -1,152 +0,0 @@
;--------------------------------------------------------------------------------
; $7F5010 - Scratch Space
;--------------------------------------------------------------------------------
; The number of items in a dungeon never changes. use this macro instead of
; HexToDec when drawing the "??/XX" item counter
; %DrawConstantNumber(1,4) draws 14
;--------------------------------------------------------------------------------
macro DrawConstantNumber(digit1,digit2)
LDA.w #$2490+<digit1> : STA $7EC79A
LDA.w #$2490+<digit2> : STA $7EC79C
endmacro
;--------------------------------------------------------------------------------
DrawDungeonCompassCounts:
LDX $1B : BNE + : RTL : + ; Skip if outdoors
LDX $040C : CPX.b #$FF : BNE + : RTL : + ; Skip if not in a dungeon
CMP.w #$0002 : BEQ ++ ; if CompassMode==2, we don't check for the compass
LDA $7EF364 : AND.l .item_masks, X ; Load compass values to A, mask with dungeon item masks
BNE + : RTL : + ; skip if we don't have compass
++
JMP (CompassCountDungeonHandlers, X) : .return_spot
; we switch to 8-bit A in the jump before this
JSR HudHexToDec2Digit
REP #$20
LDX.b $06 : TXA : ORA #$2400 : STA $7EC794 ; Draw the item count
LDX.b $07 : TXA : ORA #$2400 : STA $7EC796
LDA.w #$2830 : STA $7EC798 ; draw the slash
.done
RTL
.item_masks ; these are dungeon correlations to $7EF364 - $7EF369 so it knows where to store compasses, etc
dw $8000, $4000, $2000, $1000, $0800, $0400, $0200, $0100
dw $0080, $0040, $0020, $0010, $0008, $0004
CompassCountDungeonHandlers: ; pointers to functions that handle dungeon-specific code
dw CompassCount_Escape, CompassCount_Escape ; (hyrule castle, sewers)
dw CompassCount_Eastern, CompassCount_Desert, CompassCount_Agah
dw CompassCount_Swamp, CompassCount_PoD, CompassCount_Mire
dw CompassCount_Skull, CompassCount_Ice, CompassCount_Hera
dw CompassCount_Thieves, CompassCount_Trock, CompassCount_Gt
}
CompassCount_Escape:
%DrawConstantNumber(0,8)
SEP #$20
LDA $7EF434 : LSR #4
JMP DrawDungeonCompassCounts_return_spot
CompassCount_Eastern:
%DrawConstantNumber(0,6)
SEP #$20
LDA $7EF436 : AND.b #$07
JMP DrawDungeonCompassCounts_return_spot
CompassCount_Desert:
%DrawConstantNumber(0,6)
SEP #$20
LDA $7EF435 : LSR #5
JMP DrawDungeonCompassCounts_return_spot
CompassCount_Agah:
%DrawConstantNumber(0,2)
SEP #$20
LDA $7EF435 : AND.b #$02
JMP DrawDungeonCompassCounts_return_spot
CompassCount_Swamp:
%DrawConstantNumber(1,0)
SEP #$20
LDA $7EF439 : AND.b #$0F
JMP DrawDungeonCompassCounts_return_spot
CompassCount_PoD:
%DrawConstantNumber(1,4)
SEP #$20
LDA $7EF434 : AND.b #$0F
JMP DrawDungeonCompassCounts_return_spot
CompassCount_Mire:
%DrawConstantNumber(0,8)
SEP #$20
LDA $7EF438 : AND.b #$0F
JMP DrawDungeonCompassCounts_return_spot
CompassCount_Skull:
%DrawConstantNumber(0,8)
SEP #$20
LDA $7EF437 : LSR #4
JMP DrawDungeonCompassCounts_return_spot
CompassCount_Ice:
%DrawConstantNumber(0,8)
SEP #$20
LDA $7EF438 : LSR #4
JMP DrawDungeonCompassCounts_return_spot
CompassCount_Hera:
%DrawConstantNumber(0,6)
SEP #$20
LDA $7EF435 : AND.b #$1C : LSR #2
JMP DrawDungeonCompassCounts_return_spot
CompassCount_Thieves:
%DrawConstantNumber(0,8)
SEP #$20
LDA $7EF437 : AND.b #$0F
JMP DrawDungeonCompassCounts_return_spot
CompassCount_Trock:
%DrawConstantNumber(1,2)
SEP #$20
LDA $7EF439 : LSR #4
JMP DrawDungeonCompassCounts_return_spot
CompassCount_Gt:
%DrawConstantNumber(2,7)
SEP #$20
LDA $7EF436 : LSR #3
JMP DrawDungeonCompassCounts_return_spot
;--------------------------------------------------------------------------------
; $7EF434 - hhhhdddd - item locations checked
; h - hyrule castle/sewers
; d - palace of darkness
;--------------------------------------------------------------------------------
; $7EF435 - dddhhhaa - item locations checked
; d - desert palace
; h - tower of hera
; a - agahnim's tower
;--------------------------------------------------------------------------------
; $7EF436 - gggggeee - item locations checked
; g - ganon's tower
; e - eastern palace
;--------------------------------------------------------------------------------
; $7EF437 - sssstttt - item locations checked
; s - skull woods
; t - thieves town
;--------------------------------------------------------------------------------
; $7EF438 - iiiimmmm - item locations checked
; i - ice palace
; m - misery mire
;--------------------------------------------------------------------------------
; $7EF439 - ttttssss - item locations checked
; t - turtle rock
; s - swamp palace
;--------------------------------------------------------------------------------

View File

@@ -1,29 +0,0 @@
;--------------------------------------------------------------------------------
ParadoxCaveGfxFix:
; Always upload line unless you're moving into paradox cave (0x0FF) from above (0x0EF)
LDA $1B : BEQ .uploadLine
LDX $A0 : CPX #$00FF : BNE .uploadLine
LDX $A2 : CPX #$00EF : BNE .uploadLine
;Ignore uploading four specific lines of tiles to VRAM
LDX $0118
; Line 1
CPX #$1800 : BEQ .skipMostOfLine
; Line 2
CPX #$1A00 : BEQ .skipMostOfLine
; Line 3
CPX #$1C00 : BEQ .uploadLine
; Line 4
CPX #$1E00 : BEQ .uploadLine
.uploadLine
LDA.b #$01 : STA $420B
.skipLine
RTL
.skipMostOfLine
; Set line length to 192 bytes (the first 6 8x8 tiles in the line)
LDX.w #$00C0 : STX $4305
BRA .uploadLine
;--------------------------------------------------------------------------------

View File

@@ -1,183 +0,0 @@
;================================================================
; Contributor: Myramong
;================================================================
;Sprite_ShowMessageFromPlayerContact_Edit:
;{
; STZ $1CE8
; JSL.l Sprite_CheckDamageToPlayerSameLayerLong : BCC .dont_show
;
; LDA $4D : CMP.b #$02 : BEQ .dont_show
;
; JSL.l Sprite_DirectionToFacePlayerLong : TYA : EOR.b #$03
; SEC
;RTL
;.dont_show
; LDA $0DE0, X
; CLC
;RTL
;}
;================================================================
;Sprite_ShowSolicitedMessageIfPlayerFacing_Edit:
;{
; JSL.l Sprite_CheckDamageToPlayerSameLayerLong : BCC .alpha
; JSL.l Sprite_CheckIfPlayerPreoccupied : BCS .alpha
; LDA $F6 : BPL .alpha
; LDA $0F10, X : BNE .alpha
;
; LDA $4D : CMP.b #$02 : BEQ .alpha
;
; STZ $1CE8 ; set text choice to 1st option (usually yes/confirm/etc)
; JSL.l Sprite_DirectionToFacePlayerLong : PHX : TYX
;
; ; Make sure that the sprite is facing towards the player, otherwise
; ; talking can't happen. (What sprites actually use this???)
; LDA $05E1A3, X : PLX : CMP $2F : BNE .not_facing_each_other
; PHY
; LDA.b #$40 : STA $0F10, X
; PLA : EOR.b #$03
; SEC
;RTL
;.not_facing_each_other
;.alpha
; LDA $0DE0, X
; CLC
;RTL
;}
;================================================================
;OldMountainMan_TransitionFromTagalong_Edit:
;{
; PHA
;
; LDA.b #$AD : JSL Sprite_SpawnDynamically
;
; PLA : PHX : TAX
;
; LDA $1A64, X : AND.b #$03 : STA $0EB0, Y
; STA $0DE0, Y
;
; LDA $1A00, X : CLC : ADC.b #$02 : STA $0D00, Y
; LDA $1A14, X : ADC.b #$00 : STA $0D20, Y
;
; LDA $1A28, X : CLC : ADC.b #$02 : STA $0D10, Y
; LDA $1A3C, X : ADC.b #$00 : STA $0D30, Y
;
; LDA $EE : STA $0F20, Y
;
; LDA.b #$01 : STA $0BA0, Y
; STA $0E80, Y
;
; LDA.b #$01 : STA $02E4 ; OldMountainMan_FreezePlayer
; STA $037B ; ^
;
; PLX
;
; LDA.b #$00 : STA $7EF3CC
;
; STZ $5E
;
; JML $09A6B6 ; <- 4A6B6 tagalong.asm:1194 (SEP #$30 : RTS)
;}
;================================================================
!MAP_OVERLAY = "$7EF414" ; [2]
Sprite_ShowSolicitedMessageIfPlayerFacing_Alt:
{
STA $1CF0
STY $1CF1
JSL Sprite_CheckDamageToPlayerSameLayerLong : BCC .alpha
JSL Sprite_CheckIfPlayerPreoccupied : BCS .alpha
LDA $F6 : BPL .alpha
LDA $0F10, X : BNE .alpha
LDA $4D : CMP.b #$02 : BEQ .alpha
JSL Sprite_DirectionToFacePlayerLong : PHX : TYX
; Make sure that the sprite is facing towards the player, otherwise
; talking can't happen. (What sprites actually use this???)
LDA $05E1A3, X : PLX : CMP $2F : BNE .not_facing_each_other
PHY
LDA $1CF0
LDY $1CF1
; Check what room we're in so we know which npc we're talking to
LDA.b $A0 : CMP #$05 : BEQ .SahasrahlaDialogs
CMP #$1C : BEQ .BombShopGuyDialog
BRA .SayNothing
.SahasrahlaDialogs
REP #$20 : LDA.l MapReveal_Sahasrahla : ORA !MAP_OVERLAY : STA !MAP_OVERLAY : SEP #$20
JSL DialogSahasrahla : BRA .SayNothing
.BombShopGuyDialog
REP #$20 : LDA.l MapReveal_BombShop : ORA !MAP_OVERLAY : STA !MAP_OVERLAY : SEP #$20
JSL DialogBombShopGuy
.SayNothing
LDA.b #$40 : STA $0F10, X
PLA : EOR.b #$03
SEC
RTL
.not_facing_each_other
.alpha
LDA $0DE0, X
CLC
RTL
}
;================================================================
Sprite_ShowSolicitedMessageIfPlayerFacing_PreserveMessage:
{
PHY
PHA
JSL Sprite_CheckDamageToPlayerSameLayerLong : BCC .alpha
JSL Sprite_CheckIfPlayerPreoccupied : BCS .alpha
LDA $F6 : BPL .alpha
LDA $0F10, X : BNE .alpha
LDA $4D : CMP.b #$02 : BEQ .alpha
JSL Sprite_DirectionToFacePlayerLong : PHX : TYX
; Make sure that the sprite is facing towards the player, otherwise
; talking can't happen. (What sprites actually use this???)
LDA $05E1A3, X : PLX : CMP $2F : BNE .not_facing_each_other
PLA : XBA : PLA
PHY
TAY : XBA
JSL Sprite_ShowMessageUnconditional
LDA.b #$40 : STA $0F10, X
PLA : EOR.b #$03
SEC
RTL
.not_facing_each_other
.alpha
PLY
PLA
LDA $0DE0, X
CLC
RTL
}
;================================================================

View File

@@ -4,49 +4,120 @@
;--------------------------------------------------------------------------------
; Filtered Joypad 1 Register: [AXLR | ????]
; Filtered Joypad 1 Register: [BYST | udlr] [AXLR | ????]
!INVERT_DPAD = "$7F50CB"
InvertDPad:
LDA !INVERT_DPAD : BNE + : BRL .normal : +
DEC : BEQ .dpadOnly
LDA.l OneMindPlayerCount : BEQ .crowd_control
LDA.l OneMindId
AND.b #$03
TAX
LDA.l .onemind_controller_offset, X
TAX
LDA.w JOY1L,X : STA.w Scrap00
LDA.w JOY1H,X : STA.w Scrap01
LDA.b #$80 : STA.w WRIO ; reset this so latch can read it, otherwise RNG breaks
JML.l InvertDPadReturn
.crowd_control
LDA.l ControllerInverter : BNE +
LDA.w JOY1L : STA.b Scrap00
LDA.w JOY1H : STA.b Scrap01
JML.l InvertDPadReturn
+ DEC : BEQ .dpadOnly
DEC : BEQ .buttonsOnly
DEC : BEQ .invertBoth
.swapSides
REP #$20 ; set 16-bit accumulator
LDA $4218
LDA.w JOY1L
BIT.w #$0840 : BEQ + : EOR.w #$0840 : + ; swap X/up
BIT.w #$0180 : BEQ + : EOR.w #$0180 : + ; swap A/right
BIT.w #$4200 : BEQ + : EOR.w #$4200 : + ; swap Y/left
BIT.w #$8400 : BEQ + : EOR.w #$8400 : + ; swap B/down
STA $00
STA.b Scrap00
SEP #$20 ; set 8-bit accumulator
JML.l InvertDPadReturn
.invertBoth
REP #$20 ; set 16-bit accumulator
LDA $4218
LDA.w JOY1L
BIT.w #$8040 : BEQ + : EOR.w #$8040 : + ; swap X/B
BIT.w #$4080 : BEQ + : EOR.w #$4080 : + ; swap Y/A
BIT.w #$0C00 : BEQ + : EOR.w #$0C00 : + ; swap up/down
BIT.w #$0300 : BEQ + : EOR.w #$0300 : + ; swap left/right
STA $00
STA.b Scrap00
SEP #$20 ; set 8-bit accumulator
JML.l InvertDPadReturn
.buttonsOnly
REP #$20 ; set 16-bit accumulator
LDA $4218
LDA.w JOY1L
BIT.w #$8040 : BEQ + : EOR.w #$8040 : + ; swap X/B
BIT.w #$4080 : BEQ + : EOR.w #$4080 : + ; swap Y/A
STA $00
STA.b Scrap00
SEP #$20 ; set 8-bit accumulator
JML.l InvertDPadReturn
.dpadOnly
LDA $4218 : STA $00
LDA $4219
LDA.w JOY1L : STA.b Scrap00
LDA.w JOY1H
BIT.b #$0C : BEQ + : EOR.b #$0C : + ; swap up/down
BIT.b #$03 : BEQ + : EOR.b #$03 : + ; swap left/right
STA $01
STA.b Scrap01
JML.l InvertDPadReturn
.normal
LDA $4218 : STA $00
LDA $4219 : STA $01
JML.l InvertDPadReturn
;--------------------------------------------------------------------------------
.onemind_controller_offset
db 0 ; player 0 - JOY1L - joy1d1
db 0 ; player 1 - JOY1L - joy1d1
db 2 ; player 2 - JOY2L - joy2d1
db 6 ; player 3 - JOY4L - joy2d2
db 2 ; player 4 - JOY2L - joy2d1
db 6 ; player 5 - JOY4L - joy2d2
;--------------------------------------------------------------------------------
HandleOneMindController:
LDA.l OneMindPlayerCount
BEQ .no_onemind
REP #$20
LDA.l OneMindTimerRAM
DEC
BPL .no_switch
SEP #$20
LDA.l OneMindId
INC
CMP.l OneMindPlayerCount
BCC .no_wrap
LDA.b #$01 ; reset to player 1
.no_wrap
STA.l OneMindId
REP #$20
LDA.l OneMindTimerInit
.no_switch
STA.l OneMindTimerRAM
SEP #$20
LDA.l OneMindId
CMP.b #$04 ; is it player 4 or 5?
BCC .no_multitap_switch
STZ.w WRIO
.no_multitap_switch
.no_onemind
STZ.b NMIDoneFlag
JML $808034 ; reset frame loop

View File

@@ -1,21 +1,6 @@
; $7F50D0 - $7F50FF - Block Cypher Parameters
; $7F5100 - $7F51FF - Block Cypher Buffer
!v = "$7F5100"
!n = "$04"
!MXResult = "$08" ; an alternate name for the lower 32 bits of dpScratch
!dpScratch = "$08"
!keyBase = "$7F50D0"
!y = "$7F50E0"
!z = "$7F50E4"
!sum = "$7F50E8"
!p = "$7F50EC"
!rounds = "$06"
!e = "$7F50F0"
!upperScratch = "$7F50F2"
; Scrap04 used for n
; Scrap06 used for rounds
; Scrap08 use for dpScratch/MXResult (lower 32 of dpScratch)
CryptoDelta:
dd #$9e3779b9
@@ -35,164 +20,144 @@ macro ASL32Single(value)
; ROL handles the carry from the lower byte for us
endmacro
;macro LSR32(value,k)
; LDX.b <k>
; ?loop:
; %LSR32Single(<value>,<k>)
; DEX : CPX.b #$00 : BNE ?loop
;endmacro
;macro ASL32(value,k)
; LDX.b <k>
; ?loop:
; %LSR32Single(<value>,<k>)
; DEX : CPX.b #$00 : BNE ?loop
;endmacro
CryptoMX:
PHX
; upperScratch = (z>>5 ^ y <<2)
LDA.w !z : STA.b !dpScratch
LDA.w !z+2 : STA.b !dpScratch+2
%LSR32Single(!dpScratch)
%LSR32Single(!dpScratch)
%LSR32Single(!dpScratch)
%LSR32Single(!dpScratch)
%LSR32Single(!dpScratch)
;%LSR32(!dpScratch,#$05)
LDA.w z : STA.b Scrap08
LDA.w z+2 : STA.b Scrap08+2
%LSR32Single(Scrap08)
%LSR32Single(Scrap08)
%LSR32Single(Scrap08)
%LSR32Single(Scrap08)
%LSR32Single(Scrap08)
;%LSR32(Scrap08,#$05)
LDA.w !y : STA.b !dpScratch+4
LDA.w !y+2 : STA.b !dpScratch+6
%ASL32Single(!dpScratch+4)
%ASL32Single(!dpScratch+4)
;%ASL32(!dpScratch+4,#$02)
LDA.w y : STA.b Scrap08+4
LDA.w y+2 : STA.b Scrap08+6
%ASL32Single(Scrap08+4)
%ASL32Single(Scrap08+4)
;%ASL32(Scrap08+4,#$02)
LDA.b !dpScratch : EOR.b !dpScratch+4 : STA.w !upperScratch
LDA.b !dpScratch+2 : EOR.b !dpScratch+6 : STA.w !upperScratch+2
LDA.b Scrap08 : EOR.b Scrap08+4 : STA.w CryptoScratch
LDA.b Scrap08+2 : EOR.b Scrap08+6 : STA.w CryptoScratch+2
;================================
; upperscratch2 = (y>>3^z<<4)
LDA.w !z : STA.b !dpScratch
LDA.w !z+2 : STA.b !dpScratch+2
%ASL32Single(!dpScratch)
%ASL32Single(!dpScratch)
%ASL32Single(!dpScratch)
%ASL32Single(!dpScratch)
;%ASL32(!dpScratch,#$04)
LDA.w z : STA.b Scrap08
LDA.w z+2 : STA.b Scrap08+2
%ASL32Single(Scrap08)
%ASL32Single(Scrap08)
%ASL32Single(Scrap08)
%ASL32Single(Scrap08)
;%ASL32(Scrap08,#$04)
LDA.w !y : STA.b !dpScratch+4
LDA.w !y+2 : STA.b !dpScratch+6
%LSR32Single(!dpScratch+4)
%LSR32Single(!dpScratch+4)
%LSR32Single(!dpScratch+4)
;%LSR32(!dpScratch+4,#$03)
LDA.w y : STA.b Scrap08+4
LDA.w y+2 : STA.b Scrap08+6
%LSR32Single(Scrap08+4)
%LSR32Single(Scrap08+4)
%LSR32Single(Scrap08+4)
;%LSR32(Scrap08+4,#$03)
LDA.b !dpScratch : EOR.b !dpScratch+4 : STA.w !upperScratch+4
LDA.b !dpScratch+2 : EOR.b !dpScratch+6 : STA.w !upperScratch+6
LDA.b Scrap08 : EOR.b Scrap08+4 : STA.w CryptoScratch+4
LDA.b Scrap08+2 : EOR.b Scrap08+6 : STA.w CryptoScratch+6
;================================
; upperscratch = upperscratch + upperscratch2 ( == (z>>5^y<<2) + (y>>3^z<<4) )
LDA.w !upperScratch : !ADD.w !upperScratch+4 : STA.w !upperScratch
LDA.w !upperScratch+2 : ADC.w !upperScratch+6 : STA.w !upperScratch+2
LDA.w CryptoScratch : !ADD.w CryptoScratch+4 : STA.w CryptoScratch
LDA.w CryptoScratch+2 : ADC.w CryptoScratch+6 : STA.w CryptoScratch+2
;================================
; dpscratch = sum^y
LDA.w !sum : EOR.w !y : STA.b !dpScratch
LDA.w !sum+2 : EOR.w !y+2 : STA.b !dpScratch+2
LDA.w Sum : EOR.w y : STA.b Scrap08
LDA.w Sum+2 : EOR.w y+2 : STA.b Scrap08+2
;================================
; dpscratch2 = (k[p&3^e]^z)
LDA.w !p : AND.w #$0003 : EOR.w !e : ASL #2 : TAX ; put (p&3)^e into X
LDA.w !keyBase, X : EOR.w !z : STA.b !dpScratch+4
LDA.w !keyBase+2, X : EOR.w !z+2 : STA.b !dpScratch+6
LDA.w p : AND.w #$0003 : EOR.w e : ASL #2 : TAX ; put (p&3)^e into X
LDA.w KeyBase, X : EOR.w z : STA.b Scrap08+4
LDA.w KeyBase+2, X : EOR.w z+2 : STA.b Scrap08+6
;================================
; upperscratch2 = dpscratch + dpscratch2 (== (sum^y) + (k[p&3^e]^z))
LDA.b !dpScratch : !ADD.b !dpScratch+4 : STA.w !upperScratch+4
LDA.b !dpScratch+2 : ADC.b !dpScratch+6 : STA.w !upperScratch+6
LDA.b Scrap08 : !ADD.b Scrap08+4 : STA.w CryptoScratch+4
LDA.b Scrap08+2 : ADC.b Scrap08+6 : STA.w CryptoScratch+6
;================================
; MXResult = uppserscratch ^ upperscratch2
LDA.w !upperScratch : EOR.w !upperScratch+4 : STA.b !MXResult
LDA.w !upperScratch+2 : EOR.w !upperScratch+6 : STA.b !MXResult+2
LDA.w CryptoScratch : EOR.w CryptoScratch+4 : STA.b Scrap08
LDA.w CryptoScratch+2 : EOR.w CryptoScratch+6 : STA.b Scrap08+2
PLX
RTS
;!DIVIDEND_LOW = $4204
;!DIVIDEND_HIGH = $4205
;!DIVISOR = $4206
;!QUOTIENT_LOW = $4214
;!QUOTIENT_HIGH = $4215
XXTEA_Decode:
PHP : PHB
SEP #$30 ; set 8-bit accumulator and index
LDA.b #$7F : PHA : PLB
STZ.b !n+1 ; set upper byte of n to be zero, so it can safely be accessed in 16-bit mode
STZ.b Scrap04+1 ; set upper byte of n to be zero, so it can safely be accessed in 16-bit mode
; search for lookup table index to avoid division and multiplication
LDX.b #0
-
LDA.l .n_lookup, X
CMP.b !n : !BLT +
CMP.b Scrap04 : !BLT +
INX
BRA -
+
; rounds = 6 + 52/n;
LDA.l .round_counts, X : STA.b !rounds : STZ.b !rounds+1
LDA.l .round_counts, X : STA.b Scrap06 : STZ.b Scrap06+1
REP #$20 ; set 16-bit accumulator
; sum = rounds*DELTA;
TXA : ASL #2 : TAX
LDA.l .initial_sums, X : STA.w !sum
LDA.l .initial_sums+2, X : STA.w !sum+2
LDA.l .initial_sums, X : STA.w Sum
LDA.l .initial_sums+2, X : STA.w Sum+2
; y = v[0];
LDA.w !v : STA.w !y
LDA.w !v+2 : STA.w !y+2
LDA.w v : STA.w y
LDA.w v+2 : STA.w y+2
---
LDA.w !sum : LSR #2 : AND.w #$0003 : STA.w !e ; e = (sum >> 2) & 3;
LDA.w Sum : LSR #2 : AND.w #$0003 : STA.w e ; e = (sum >> 2) & 3;
LDA.b !n : DEC : STA.w !p
LDA.b Scrap04 : DEC : STA.w p
-- BEQ + ; for (p=n-1; p>0; p--) {
; z = v[p-1];
ASL #2 : TAX
LDA.w !v-4, X : STA.w !z
LDA.w !v-4+2, X : STA.w !z+2
LDA.w v-4, X : STA.w z
LDA.w v-4+2, X : STA.w z+2
; y = v[p] -= MX;
JSR CryptoMX
LDA.w !p : ASL #2 : TAX
LDA.w !v, X : !SUB.b !MXResult : STA.w !v, X : STA.w !y
LDA.w !v+2, X : SBC.b !MXResult+2 : STA.w !v+2, X : STA.w !y+2
LDA.w p : ASL #2 : TAX
LDA.w v, X : !SUB.b Scrap08 : STA.w v, X : STA.w y
LDA.w v+2, X : SBC.b Scrap08+2 : STA.w v+2, X : STA.w y+2
LDA.w !p : DEC : STA.w !p : BRA -- ; }
LDA.w p : DEC : STA.w p : BRA -- ; }
+
; z = v[n-1];
LDA.b !n : DEC : ASL #2 : TAX
LDA.w !v, X : STA.w !z
LDA.w !v+2, X : STA.w !z+2
LDA.b Scrap04 : DEC : ASL #2 : TAX
LDA.w v, X : STA.w z
LDA.w v+2, X : STA.w z+2
; y = v[0] -= MX;
JSR CryptoMX
LDA.w !v : !SUB.b !MXResult : STA.w !v : STA.w !y
LDA.w !v+2 : SBC.b !MXResult+2 : STA.w !v+2 : STA.w !y+2
LDA.w v : !SUB.b Scrap08 : STA.w v : STA.w y
LDA.w v+2 : SBC.b Scrap08+2 : STA.w v+2 : STA.w y+2
; sum -= DELTA;
LDA.w !sum : !SUB.l CryptoDelta : STA.w !sum
LDA.w !sum+2 : SBC.l CryptoDelta+2 : STA.w !sum+2
LDA.w Sum : !SUB.l CryptoDelta : STA.w Sum
LDA.w Sum+2 : SBC.l CryptoDelta+2 : STA.w Sum+2
DEC !rounds : BEQ + : BRL --- : + ; } while (--rounds);
DEC.b Scrap06 : BEQ + : JMP --- : + ; } while (--rounds);
PLB : PLP
RTL
@@ -243,69 +208,3 @@ db 32 ; n is 2
;dd (23*$9e3779b9)&$ffffffff ; n is 3
dd (32*$9e3779b9)&$ffffffff ; n is 2
;void btea(uint32_t *v, int n, uint32_t const key[4]) {
; uint32_t y, z, sum;
; unsigned p, rounds, e;
; } else if (n < -1) { /* Decoding Part */
; n = -n;
; rounds = 6 + 52/n;
; sum = rounds*DELTA;
; y = v[0];
; do {
; e = (sum >> 2) & 3;
; for (p=n-1; p>0; p--) {
; z = v[p-1];
; y = v[p] -= MX;
; }
; z = v[n-1];
; y = v[0] -= MX;
; sum -= DELTA;
; } while (--rounds);
; }
;BTEA will encode or decode n words as a single block where n > 1
;
;v is the n word data vector
;k is the 4 word key
;n is negative for decoding
;if n is zero result is 1 and no coding or decoding takes place, otherwise the result is zero
;assumes 32 bit 'long' and same endian coding and decoding
;#include <stdint.h>
;#define DELTA 0x9e3779b9
;#define MX ((((z>>5)^(y<<2)) + ((y>>3)^(z<<4))) ^ ((sum^y) + (key[(p&3)^e] ^ z)))
;
;void btea(uint32_t *v, int n, uint32_t const key[4]) {
; uint32_t y, z, sum;
; unsigned p, rounds, e;
; if (n > 1) { /* Coding Part */
; rounds = 6 + 52/n;
; sum = 0;
; z = v[n-1];
; do {
; sum += DELTA;
; e = (sum >> 2) & 3;
; for (p=0; p<n-1; p++) {
; y = v[p+1];
; z = v[p] += MX;
; }
; y = v[0];
; z = v[n-1] += MX;
; } while (--rounds);
; } else if (n < -1) { /* Decoding Part */
; n = -n;
; rounds = 6 + 52/n;
; sum = rounds*DELTA;
; y = v[0];
; do {
; e = (sum >> 2) & 3;
; for (p=n-1; p>0; p--) {
; z = v[p-1];
; y = v[p] -= MX;
; }
; z = v[n-1];
; y = v[0] -= MX;
; sum -= DELTA;
; } while (--rounds);
; }
;}

View File

@@ -1,74 +1,61 @@
;================================================================================
StartCuccoStorm:
;STA $FFFFFF
PHA : PHX : PHY : PHP
SEP #$30 ; set 8-bit accumulator & index registers
LDA $1B : BNE .done ; skip if indoors
!CUCCO = $0B
!INERT = $00
!INIT = $08
!ALIVE = $09
!CUCCO_ENRAGED = $23
CuccoStorm:
SEP #$30 ; set 8-bit accumulator index registers
LDA.l CuccoStormer : BEQ + ; only if storm is on
LDA.b GameMode : CMP.b #$09 : BNE + ; only if outdoors
LDA.l LoopFrames : AND.b #$7F : BNE + ; check every 128 frames
-
;==== Find a Cucco
LDY.b #$FF : PHY ; push "cucco not found"
LDX.b #$00 : -- : CPX.b #$10 : !BGE .ldone
LDA.w SpriteAITable, X : CMP.b #!ALIVE : BEQ +++
; enemy not found
CMP.b #!INERT : BNE ++
; log inert enemy slot
PLA : PHX
BRA ++
+++
; found an enemy
LDA.l SpriteTypeTable, X : CMP.b #!CUCCO : BNE ++
; it's a cucco
TXY ; record where we found the living cucco in case we don't find any angry ones
LDA.w SpriteAuxTable, X : CMP.b #!CUCCO_ENRAGED : !BLT ++
PLA : BRA + ; we found an angry cucco, done
++ : INX : BRA -- : .ldone
LDY.b #$0A
LDA.b #$0B : JSL Sprite_SpawnDynamically_arbitrary : BMI .done ; spawn a chicken
JSL Sprite_SetSpawnedCoords
LDA.b #$24 : STA $0DA0, Y ; turn it into an attack chicken
LDA.b #$01 : STA $0DB0, Y
.done
PLP : PLY : PLX : PLA
;==== Create a Cucco
CPY.b #$FF : BNE ++
; we didn't find a cucco, so try to create one
PLY
CPY.b #$FF : BEQ + ; fail if no slots found
LDA.b #!CUCCO : STA.w SpriteTypeTable, Y
LDA.b #!INIT : STA.w SpriteAITable, Y
LDA.b LinkPosY : STA.w SpritePosYLow, Y
LDA.b LinkPosY+1 : STA.w SpritePosYHigh, Y
LDA.b LinkPosX : STA.w SpritePosXLow, Y
LDA.b LinkPosX+1 : STA.w SpritePosXHigh, Y
BRA +++
++
PLA
+++
;==== Enrage a Cucco
LDA.b #!CUCCO_ENRAGED : STA.w SpriteAuxTable, Y ; enrage the cucco
LDA.b #$00 : STA.w SpriteAuxTable+$10, Y : STA.w SpriteDirectionTable, Y
;====
+
RTL
;================================================================================
SpawnAngryCucco:
TXA : EOR $1A : AND.b #$0F : ORA $1B : BNE .spawn_delay
LDA.b #$0B
LDY.b #$0A
JSL Sprite_SpawnDynamically_arbitrary : BMI .spawn_failed
PHX
TYX
LDA.b #$1E : JSL Sound_SetSfx3PanLong
PLX
LDA.b #$01 : STA $0DB0, Y
PHX
JSL GetRandomInt : STA $0F : AND.b #$02 : BEQ .vertical_entry_point
LDA $0F : ADC $E2 : STA $0D10, Y
LDA $E3 : ADC.b #$00 : STA $0D30, Y
LDA $0F : AND.b #$01 : TAX
LDA $9F3C, X : ADC $E8 : STA $0D00, Y
LDA $E9 : ADC.b #$00 : STA $0D20, Y
BRA .set_velocity
.vertical_entry_point
LDA $0F : ADC $E8 : STA $0D00, Y
LDA $E9 : ADC.b #$00 : STA $0D20, Y
LDA $0F : AND.b #$01 : TAX
LDA $9F3C, X : ADC $E2 : STA $0D10, Y
LDA $E3 : ADC.b #$00 : STA $0D30, Y
.set_velocity
TYX
LDA.b #$20 : JSL Sprite_ApplySpeedTowardsPlayerLong
PLX
LDA.b #$30 : JSL Sound_SetSfx2PanLong
.spawn_failed
.spawn_delay
RTL
;================================================================================

17
custompalettes.asm Normal file
View File

@@ -0,0 +1,17 @@
PalettesCustom:
.master_sword
dw $0000, $7E4E, $6FF4, $1CF5, $7FFF, $1CE7, $7A10, $64A5
.tempered_sword
dw $7FFF, $093B, $169F, $7E8D, $7FFF, $1CE7, $7A10, $64A5
.golden_sword
dw $0000, $033F, $7FFF, $2640, $7FFF, $1CE7, $7A10, $64A5
.fighter_shield
dw $0000, $7FFF, $27FF, $5E2D, $7FFF, $1CE7, $7A10, $64A5
.red_shield
dw $0000, $7FFF, $27FF, $5E2D, $4F5F, $1CE7, $2E9C, $14B6
.mirror_shield
dw $0000, $7E4E, $6F44, $1CF5, $7399, $1CE7, $02F9, $0233
.crystal
dw $7FFF, $7FFF, $0000, $5907, $6E0E, $0000, $7FBB, $7672
.off_black
dw $0000, $14A5, $14A5, $14A5, $14A5, $14A5, $14A5, $14A5

View File

@@ -1,25 +0,0 @@
CheckReceivedItemPropertiesBeforeLoad:
LDA $7EC005 : BNE .lightOff
LDA.l AddReceivedItemExpanded_properties, X ;Restore Rando Code
RTL
.lightOff
PHX : PHY : PHB
LDA.l AddReceivedItemExpanded_properties, X ; get palette
REP #$30
AND #$0007 ; mask out palette
ASL #5 ; multiply by 32
ADC #$C610 ; offset to latter half
TAX ; give to destination
LDY #$C610 ; target palette SP0 colors 8-F
LDA #$000F ; 16 bytes
MVN $7E, $7E ; move palette
SEP #$30
PLB : PLY : PLX
INC $15
LDA #$00
RTL

View File

@@ -4,81 +4,84 @@
DarkWorldSaveFix:
LDA.b #$70 : PHA : PLB ; thing we wrote over - data bank change
JSL.l MasterSwordFollowerClear
JSL.l StatSaveCounter
RTL
JML.l StatSaveCounter
;--------------------------------------------------------------------------------
DoWorldFix:
LDA InvertedMode : BEQ +
LDA.l InvertedMode : BEQ +
JMP DoWorldFix_Inverted
+
LDA.l Bugfix_MirrorlessSQToLW : BEQ .skip_mirror_check
LDA $7EF353 : BEQ .noMirror ; check if we have the mirror
LDA.l FollowerIndicator : CMP.b #$04 : BEQ .setLightWorld ; check if old man is following
LDA.l MirrorEquipment : BEQ .noMirror ; check if we have the mirror
.skip_mirror_check ; alt entrance point
LDA $7EF3C5 : CMP.b #$03 : !BLT .aga1Alive ; check if agahnim 1 is alive
BRA .done
LDA.l ProgressIndicator : CMP.b #$03 : BCS .done ; check if agahnim 1 is alive
.setLightWorld
LDA.b #$00
.noMirror
.aga1Alive
LDA #$00 : STA $7EF3CA ; set flag to light world
LDA $7EF3CC : CMP #$07 : BNE + : LDA.b #$08 : STA $7EF3CC : + ; convert frog to dwarf
STA.l CurrentWorld ; set flag to light world
LDA.l FollowerIndicator : CMP.b #$07 : BNE .done : INC : STA.l FollowerIndicator ; convert frog to dwarf
.done
RTL
;--------------------------------------------------------------------------------
SetDeathWorldChecked:
LDA InvertedMode : BEQ +
LDA.l InvertedMode : BEQ +
JMP SetDeathWorldChecked_Inverted
+
LDA $1B : BEQ .outdoors
LDA $040C : CMP #$FF : BNE .dungeon
LDA $A0 : BNE ++
LDA GanonPyramidRespawn : BNE .pyramid ; if flag is set, force respawn at pyramid on death to ganon
LDA.b IndoorsFlag : BEQ .outdoors
LDA.w DungeonID : CMP.b #$FF : BNE .dungeon
LDA.b RoomIndex : ORA.b RoomIndex+1 : BNE ++
LDA.l GanonPyramidRespawn : BNE .pyramid ; if flag is set, force respawn at pyramid on death to ganon
++
.outdoors
JMP DoWorldFix
.dungeon
LDA Bugfix_PreAgaDWDungeonDeathToFakeDW : BNE .done ; if the bugfix is enabled, we do nothing on death in dungeon
JMP DoWorldFix_skip_mirror_check
LDA.l MosaicLevel : BNE .dontfix ; this is a sanc & quit
LDA.l Bugfix_PreAgaDWDungeonDeathToFakeDW : BNE .done ; if the bugfix is enabled, we do nothing on death in dungeon
.dontfix
JMP DoWorldFix_skip_mirror_check
.pyramid
LDA #$40 : STA $7EF3CA ; set flag to dark world
LDA $7EF3CC : CMP #$08 : BNE + : LDA.b #$07 : STA $7EF3CC : + ; convert dwarf to frog
LDA.b #$40 : STA.l CurrentWorld ; set flag to dark world
LDA.l FollowerIndicator : CMP.b #$08 : BNE .done : DEC : STA.l FollowerIndicator : + ; convert dwarf to frog
.done
RTL
;================================================================================
DoWorldFix_Inverted:
LDA.l Bugfix_MirrorlessSQToLW : BEQ .skip_mirror_check
LDA $7EF353 : BEQ .noMirror ; check if we have the mirror
LDA.l FollowerIndicator : CMP.b #$04 : BEQ .setDarkWorld ; check if old man is following
LDA.l MirrorEquipment : BEQ .setDarkWorld ; check if we have the mirror
.skip_mirror_check ; alt entrance point
LDA $7EF3C5 : CMP.b #$03 : !BLT .aga1Alive ; check if agahnim 1 is alive
BRA .done
.noMirror
.aga1Alive
LDA #$40 : STA $7EF3CA ; set flag to dark world
LDA $7EF3CC
CMP #$07 : BEQ .clear ; clear frog
CMP #$08 : BEQ .clear ; clear dwarf - consider flute implications
LDA.l ProgressIndicator : CMP.b #$03 : BCS .done ; check if agahnim 1 is alive
.setDarkWorld
LDA.b #$40 : STA.l CurrentWorld ; set flag to dark world
LDA.l FollowerIndicator
CMP.b #$07 : BEQ .clear ; clear frog
CMP.b #$08 : BEQ .clear ; clear dwarf - consider flute implications
BRA .done
.clear
LDA.b #$00 : STA $7EF3CC ; clear follower
LDA.b #$00 : STA.l FollowerIndicator ; clear follower
.done
RTL
;--------------------------------------------------------------------------------
SetDeathWorldChecked_Inverted:
LDA $1B : BEQ .outdoors
LDA $040C : CMP #$FF : BNE .dungeon
LDA $A0 : BNE ++
LDA GanonPyramidRespawn : BNE .castle ; if flag is set, force respawn at pyramid on death to ganon
LDA.b IndoorsFlag : BEQ .outdoors
LDA.w DungeonID : CMP.b #$FF : BNE .dungeon
LDA.b RoomIndex : ORA.b RoomIndex+1 : BNE ++
LDA.l GanonPyramidRespawn : BNE .castle ; if flag is set, force respawn at pyramid on death to ganon
++
.outdoors
JMP DoWorldFix
.dungeon
LDA Bugfix_PreAgaDWDungeonDeathToFakeDW : BNE .done ; if the bugfix is enabled, we do nothing on death in dungeon
JMP DoWorldFix_Inverted_skip_mirror_check
LDA.l MosaicLevel : BNE .dontfix ; this is a sanc & quit
LDA.l Bugfix_PreAgaDWDungeonDeathToFakeDW : BNE .done ; if the bugfix is enabled, we do nothing on death in dungeon
.dontfix
JMP DoWorldFix_Inverted_skip_mirror_check
.castle
LDA #$00 : STA $7EF3CA ; set flag to dark world
LDA $7EF3CC : CMP #$07 : BNE + : LDA.b #$08 : STA $7EF3CC : + ; convert frog to dwarf
LDA.b #$00 : STA.l CurrentWorld ; set flag to dark world
LDA.l FollowerIndicator : CMP.b #$07 : BNE + : LDA.b #$08 : STA.l FollowerIndicator : + ; convert frog to dwarf
.done
RTL
;================================================================================
@@ -86,23 +89,22 @@ RTL
;--------------------------------------------------------------------------------
FakeWorldFix:
LDA FixFakeWorld : BEQ +
LDA $8A : AND.b #$40 : STA $7EF3CA
LDA.l FixFakeWorld : BEQ +
LDA.b OverworldIndex : AND.b #$40 : STA.l CurrentWorld
+
RTL
;--------------------------------------------------------------------------------
MasterSwordFollowerClear:
LDA $7EF3CC
CMP #$0E : BEQ .clear ; clear master sword follower
RTL
.clear
LDA.b #$00 : STA $7EF3CC ; clear follower
RTL
LDA.l FollowerIndicator
CMP.b #$0E : BNE .exit ; clear master sword follower
LDA.b #$00 : STA.l FollowerIndicator ; clear follower
.exit
RTL
;--------------------------------------------------------------------------------
FixAgahnimFollowers:
LDA.b #$00 : STA $7EF3CC ; clear follower
JSL PrepDungeonExit ; thing we wrote over
RTL
LDA.b #$00 : STA.l FollowerIndicator ; clear follower
JML PrepDungeonExit ; thing we wrote over
;--------------------------------------------------------------------------------
macro SetMinimum(base,filler,compare)
LDA.l <compare> : !SUB.l <base> : !BLT ?done
@@ -110,49 +112,47 @@ macro SetMinimum(base,filler,compare)
?done:
endmacro
RefreshRainAmmo:
LDA $7EF3C5 : CMP.b #$01 : BEQ + : RTL : + ; check if we're in rain state
LDA.l ProgressIndicator : CMP.b #$01 : BEQ .rain ; check if we're in rain state
RTL
.rain
LDA $7EF3C8
LDA.l StartingEntrance
+ CMP.b #$03 : BNE + ; Uncle
%SetMinimum($7EF36E,$7EF373,RainDeathRefillMagic_Uncle)
%SetMinimum($7EF343,$7EF375,RainDeathRefillBombs_Uncle)
%SetMinimum($7EF377,$7EF376,RainDeathRefillArrows_Uncle)
%SetMinimum(CurrentMagic,MagicFiller,RainDeathRefillMagic_Uncle)
%SetMinimum(BombsEquipment,BombsFiller,RainDeathRefillBombs_Uncle)
%SetMinimum(CurrentArrows,ArrowsFiller,RainDeathRefillArrows_Uncle)
BRA .done
+ CMP.b #$02 : BNE + ; Cell
%SetMinimum($7EF36E,$7EF373,RainDeathRefillMagic_Cell)
%SetMinimum($7EF343,$7EF375,RainDeathRefillBombs_Cell)
%SetMinimum($7EF377,$7EF376,RainDeathRefillArrows_Cell)
%SetMinimum(CurrentMagic,MagicFiller,RainDeathRefillMagic_Cell)
%SetMinimum(BombsEquipment,BombsFiller,RainDeathRefillBombs_Cell)
%SetMinimum(CurrentArrows,ArrowsFiller,RainDeathRefillArrows_Cell)
BRA .done
+ CMP.b #$04 : BNE + ; Mantle
%SetMinimum($7EF36E,$7EF373,RainDeathRefillMagic_Mantle)
%SetMinimum($7EF343,$7EF375,RainDeathRefillBombs_Mantle)
%SetMinimum($7EF377,$7EF376,RainDeathRefillArrows_Mantle)
%SetMinimum(CurrentMagic,MagicFiller,RainDeathRefillMagic_Mantle)
%SetMinimum(BombsEquipment,BombsFiller,RainDeathRefillBombs_Mantle)
%SetMinimum(CurrentArrows,ArrowsFiller,RainDeathRefillArrows_Mantle)
+
.done
RTL
;--------------------------------------------------------------------------------
!INFINITE_ARROWS = "$7F50C8"
!INFINITE_BOMBS = "$7F50C9"
!INFINITE_MAGIC = "$7F50CA"
SetEscapeAssist:
LDA $7EF3C5 : CMP.b #$01 : BNE .notrain ; check if we're in rain state
LDA.l 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.l InfiniteArrows : +
BIT.b #$02 : BEQ + : STA.l InfiniteBombs : +
BIT.b #$01 : BEQ + : STA.l InfiniteArrows : +
BRA ++
.notrain
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 : +
.no_train ; choo choo
LDA.l EscapeAssist : BIT.b #$04 : BEQ + : LDA.b #$00 : STA.l InfiniteMagic : +
LDA.l EscapeAssist : BIT.b #$02 : BEQ + : LDA.b #$00 : STA.l InfiniteBombs : +
LDA.l EscapeAssist : BIT.b #$01 : BEQ + : LDA.b #$00 : STA.l InfiniteArrows : +
++
RTL
;--------------------------------------------------------------------------------
SetSilverBowMode:
LDA SilverArrowsUseRestriction : BEQ + ; fix bow type for restricted arrow mode
LDA $7EF340 : CMP.b #$3 : !BLT +
!SUB.b #$02 : STA $7EF340
LDA.l SilverArrowsUseRestriction : BEQ + ; fix bow type for restricted arrow mode
LDA.l BowEquipment : CMP.b #$3 : BCC +
SBC.b #$02 : STA.l BowEquipment
+
RTL
;================================================================================

0
99ff1_bombos.gfx → data/99ff1_bombos.gfx Executable file → Normal file
View File

0
99ff1_quake.gfx → data/99ff1_quake.gfx Executable file → Normal file
View File

0
a6fc4_bombos.gfx → data/a6fc4_bombos.gfx Executable file → Normal file
View File

0
a6fc4_ether.gfx → data/a6fc4_ether.gfx Executable file → Normal file
View File

BIN
data/bossicons.4bpp Normal file

Binary file not shown.

71
data/bsodencode.txt Normal file
View File

@@ -0,0 +1,71 @@
=00
A=01
a=01
B=02
b=02
C=03
c=03
D=04
d=04
E=05
e=05
F=06
f=06
G=07
g=07
H=08
h=08
I=09
i=09
J=0A
j=0A
K=0B
k=0B
L=0C
l=0C
M=0D
m=0D
N=0E
n=0E
O=0F
o=0F
P=10
p=10
Q=11
q=11
R=12
r=12
S=13
s=13
T=14
t=14
U=15
u=15
V=16
v=16
W=17
w=17
X=18
x=18
Y=19
y=19
Z=1A
z=1A
0=1B
1=1C
2=1D
3=1E
4=1F
5=20
6=21
7=22
8=23
9=24
.=25
#=26
?=27
-=28
/=29
,=2A
'=2B
;=2C

BIN
data/bsodfont.1bpp Normal file

Binary file not shown.

BIN
data/bsodhex.2bpp Normal file

Binary file not shown.

0
c2807_v3.gfx → data/c2807_v3.gfx Executable file → Normal file
View File

Binary file not shown.

BIN
data/c2e3e.gfx Normal file

Binary file not shown.

View File

@@ -0,0 +1,79 @@
=9F
0=53
1=54
2=55
3=56
4=57
5=58
6=59
7=5A
8=5B
9=5C
A=5D
B=5E
C=5F
D=60
E=61
F=62
G=63
H=64
I=65
J=66
K=67
L=68
M=69
N=6A
O=6B
P=6C
Q=6D
R=6E
S=6F
T=70
U=71
V=72
W=73
X=74
Y=75
Z=76
a=A0
b=A1
c=A2
d=A3
e=A4
f=A5
g=A6
h=A7
i=A8
j=A9
k=AA
l=AB
m=AC
n=AD
o=AE
p=AF
q=B0
r=B1
s=B2
t=B3
u=B4
v=B5
w=B6
x=B7
y=B8
z=B9
'=D9
"=DA
/=DB
.=DC
:=DD
_=DE
^=DF
&=E0
#=E1
@=E2
>=E3
?=E4
!=E5
~=E6
,=E7
-=E8

View File

@@ -0,0 +1,79 @@
=9F
0=79
1=7A
2=7B
3=7C
4=7D
5=7E
6=7F
7=80
8=81
9=82
A=83
B=84
C=85
D=86
E=87
F=88
G=89
H=8A
I=8B
J=8C
K=8D
L=8E
M=8F
N=90
O=91
P=92
Q=93
R=94
S=95
T=96
U=97
V=98
W=99
X=9A
Y=9B
Z=9C
a=BB
b=BC
c=BD
d=BE
e=BF
f=C0
g=C1
h=C2
i=C3
j=C4
k=C5
l=C6
m=C7
n=C8
o=C9
p=CA
q=CB
r=CC
s=CD
t=CE
u=CF
v=D0
w=D1
x=D2
y=D3
z=D4
'=EC
"=ED
/=EE
.=EF
:=F0
_=F1
^=F2
&=F3
#=F4
@=F5
>=F6
?=F7
!=F8
~=F9
,=FA
-=FB

View File

@@ -0,0 +1,28 @@
=9F
A=38
B=39
C=3A
D=3B
E=3C
F=3D
G=3E
H=3F
I=40
J=41
K=42
L=43
M=44
N=45
O=46
P=47
Q=48
R=49
S=4A
T=4B
U=4C
V=4D
W=4E
X=4F
Y=50
Z=51
.=52

View File

@@ -0,0 +1,27 @@
=9F
A=00
B=01
C=02
D=03
E=04
F=05
G=06
H=07
I=08
J=09
K=0A
L=0B
M=0C
N=0D
O=0E
P=0F
Q=10
R=11
S=12
T=13
U=14
V=15
W=16
X=17
Y=18
Z=19

View File

@@ -0,0 +1,31 @@
=9F
A=1A
B=1B
C=1C
D=1D
E=1E
F=1F
G=20
H=21
I=22
J=23
K=24
L=25
M=26
N=27
O=28
P=29
Q=2A
R=2B
S=2C
T=2D
U=2E
V=2F
W=30
X=31
Y=32
Z=33
,=34
'=35
-=36
.=37

BIN
data/customitems.4bpp Normal file

Binary file not shown.

BIN
data/customitems.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

BIN
fileselect.chr.gfx → data/fileselectgfx.2bpp Executable file → Normal file

Binary file not shown.

BIN
data/fileselectgfx.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

View File

@@ -0,0 +1,55 @@
; Kanji replacement characters
org $8E9AC9
;.charDD ; 𓄿
db $FB, $8C, $73, $CB, $30, $4B, $30, $54
db $2B, $5B, $24, $2D, $12, $13, $61, $1E
db $36, $09, $1B, $04, $14, $0B, $15, $0A
db $15, $0A, $21, $1E, $1E, $48, $30, $38
;.charDE ; ☥
db $1E, $33, $0C, $2D, $12, $2D, $12, $2D
db $12, $F3, $0C, $01, $01, $BF, $40, $C0
db $3F, $BF, $40, $F2, $0C, $12, $0C, $12
db $0C, $12, $0C, $1E, $50, $A0, $F0
;.charDF ; ≈
db $01, $3B, $6E, $11, $C4, $3B, $91, $6E
db $BB, $44, $26, $18, $3C, $E7, $3B, $6E
db $11, $C4, $3B, $91, $6E, $BB, $44, $EE
db $98, $60, $F0
;.charE0 ; 🡅
db $0C, $12, $0C, $21, $1E, $40, $3F, $80
db $7F, $02, $01, $01, $E1, $1E, $21, $1E
db $21, $1E, $21, $1E, $21, $1E, $21, $1E
db $21, $1E, $3F, $80, $80
;.charE1 ; 🡇
db $3F, $21, $1E, $21, $1E, $21, $1E, $21
db $1E, $21, $1E, $21, $1E, $E1, $1E, $80
db $7F, $40, $3F, $21, $1E, $12, $0C, $0C
db $28, $10, $30
;.charE2 ; 🡆
db $18, $14, $08, $12, $0C, $F1, $0E, $80
db $7F, $01, $80, $7F, $80, $7F, $80, $7F
db $F1, $0E, $12, $0C, $14, $08, $18, $20
db $C0, $C0
;.charE3 ; 🡄
db $06, $0A, $04, $12, $0C, $23, $1C, $40
db $3F, $02, $01, $03, $80, $7F, $80, $7F
db $40, $3F, $23, $1C, $12, $0C, $0A, $04
db $06, $10, $E0, $F0
org $8EBD94
;.charDD ; 𓄿
db $BF, $FE, $3F, $FF, $B8 ; 10111111 11111110 00111111 11111111 10111000
;.charDE ; ☥
db $BF, $FA, $3F, $FF, $B8 ; 10111111 11111010 00111111 11111111 10111000
;.charDF ; ≈
db $AF, $FE, $2B, $FE, $38 ; 10101111 11111110 00101011 11111110 00111000
;.charE0 ; 🡅
db $2F, $FE, $3F, $FF, $A8 ; 00101111 11111110 00111111 11111111 10101000
;.charE1 ; 🡇
db $2F, $F0, $3F, $FF, $B8 ; 00101111 11110000 00111111 11111111 10111000
;.charE2 ; 🡆
db $2F, $F8, $3F, $FE, $38 ; 00101111 11111000 00111111 11111110 00111000
;.charE3 ; 🡄
db $2F, $FE, $3F, $FE, $38 ; 00101111 11111110 00111111 11111110 00111000

BIN
data/newfont.bin Normal file

Binary file not shown.

BIN
data/newfont_inverted.bin Normal file

Binary file not shown.

0
newitems.gfx → data/newitems.gfx Executable file → Normal file
View File

View File

@@ -0,0 +1,59 @@
db $00, $01, $02, $03, $04, $CC, $CC ; あ い う え お ⎵ ⎵
db $15, $16, $17, $1D, $1E, $CC ; が ぎ ぐ げ ご ⎵
db $50, $51, $52, $53, $54, $CC, $CC ; ア イ ウ エ オ ⎵ ⎵
db $D0, $D1, $D2, $D3, $D4, $CC ; a b c d e ⎵
db $AA, $AB, $AC, $AD, $CC, $CC ; A B C D ⎵ ⎵
db $08, $09, $0A, $0B, $0C, $CC, $CC ; か き く け こ ⎵ ⎵
db $1F, $25, $26, $27, $2D, $CC ; ざ じ ず ぜ ぞ ⎵
db $58, $59, $5A, $5B, $5C, $CC, $CC ; カ キ ク ケ コ ⎵ ⎵
db $D5, $D6, $D7, $D8, $D9, $CC ; ザ ジ ズ ゼ ゾ ⎵
db $AE, $AF, $B0, $B1, $CC, $CC ; E F G H ⎵ ⎵
db $10, $11, $12, $13, $14, $CC, $CC ; さ し す せ そ ⎵ ⎵
db $2E, $2F, $35, $36, $37, $CC ; だ ぢ づ で ど ⎵
db $60, $61, $62, $63, $64, $CC, $CC ; サ シ ス セ ソ ⎵ ⎵
db $DA, $DB, $DC, $DD, $DE, $CC ; ダ ヂ ヅ デ ド ⎵
db $B2, $B3, $B4, $B5, $CC, $CC ; I J K L ⎵ ⎵
db $18, $19, $1A, $1B, $1C, $CC, $CC ; た ち つ て と ⎵ ⎵
db $3D, $3E, $3F, $40, $41, $CC ; ば び ぶ べ ぼ ⎵
db $68, $69, $6A, $6B, $6C, $CC, $CC ; タ チ ツ テ ト ⎵ ⎵
db $DF, $E0, $E1, $E2, $E3, $CC ; バ ビ ブ ベ ボ ⎵
db $B6, $B7, $B8, $B9, $CC, $CC ; M N O P ⎵ ⎵
db $20, $21, $22, $23, $24, $CC, $CC ; な に ぬ ね の ⎵ ⎵
db $42, $43, $44, $45, $46, $CC ; ぱ ぴ ぷ ぺ ぽ ⎵
db $70, $71, $72, $73, $74, $CC, $CC ; ナ ニ ヌ ネ ⎵ ⎵
db $E4, $E5, $E6, $E7, $E8, $CC ; パ ピ プ ペ ポ ⎵
db $BA, $BB, $BC, $BD, $CC, $CC ; Q R S T ⎵ ⎵
db $28, $29, $2A, $2B, $2C, $CC, $CC ; は ひ ふ へ ほ ⎵ ⎵
db $65, $66, $67, $6D, $6E, $CC
db $78, $79, $7A, $7B, $7C, $CC, $CC ; ハ ヒ フ ヘ ホ ⎵ ⎵
db $E9, $EA, $EB, $EC, $C6, $CC ; ァ ィ ゥ ェ ォ ⎵
db $BE, $BF, $C0, $C1, $CC, $CC ; U V W X ⎵ ⎵
db $30, $31, $32, $33, $34, $CC, $CC ; ま み む め も ⎵ ⎵
db $6F, $75, $76, $77, $7D, $CC ; ザ ジ ズ ゼ ゾ ⎵
db $80, $81, $82, $83, $84, $CC, $CC ; マ ミ ム メ モ ⎵ ⎵
db $CC, $CC, $CC, $CC, $9A, $CC ; ャ ュ ョ ⎵ ッ ⎵
db $C2, $C3, $C9, $CE, $CC, $CC ; Y Z 〜 ⎵ ⎵
db $05, $CC, $06, $CC, $07, $CC, $CC ; や ⎵ ゆ ⎵ よ ⎵ ⎵
db $7E, $7F, $85, $86, $87, $CC ; ダ ヂ ヅ デ ド ⎵
db $55, $CC, $56, $CC, $57, $CC, $CC ; ヤ ⎵ ユ ⎵ ヨ ⎵ ⎵
db $A0, $A1, $A2, $A3, $A4, $CC ; ⎵ ⎵ ⎵ ⎵ ⎵ ⎵
db $CC, $CC, $CC, $CC, $CC, $CC ; ⎵ ⎵ ⎵ ⎵ ⎵ ⎵
db $38, $39, $3A, $3B, $3C, $CC, $CC ; ら り る れ ろ ⎵ ⎵
db $8D, $8E, $8F, $90, $91, $CC ; バ ビ ブ ベ ボ ⎵
db $88, $89, $8A, $8B, $8C, $CC, $CC ; ラ リ ル レ ロ ⎵ ⎵
db $A5, $A6, $A7, $A8, $A9, $CC ; ⎵ ⎵ ⎵ ⎵ ⎵ ⎵
db $CA, $CB, $CD, $CD, $CC, $CC ; 🡄 🡆 END ⎵ ⎵
db $0D, $0E, $0F, $CC, $C9, $CC, $CC ; わ を ん ⎵ ⎵ ⎵
db $92, $93, $94, $95, $96, $CC ; パ ピ プ ペ ポ ⎵
db $5D, $5E, $5F, $CC, $C9, $CC, $CC ; ワ ヲ ン ⎵ ⎵ ⎵
db $CC, $CC, $CC, $CC, $CC, $CC ; ⎵ ⎵ ⎵ ⎵ ⎵ ⎵
db $CC, $CC, $CC, $CC, $CC, $CC ; ⎵ ⎵ ⎵ ⎵ ⎵ ⎵

BIN
data/playernamecharmap.bin Normal file

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,72 @@
dw $E164, $3900 ; VRAM $C9C2 | 58 bytes | Horizontal
dw $1CA2, $0188, $1CA3, $0188, $1CA4, $0188, $0188, $0188
dw $0188, $0188, $1DA0, $0188, $1DA1, $0188, $1DA2, $0188
dw $1DA3, $0188, $1DA4, $0188, $0188, $0188, $1D4A, $0188
dw $1D4B, $0188, $1D4C, $0188, $1D4D
dw $0165, $3900 ; VRAM $CA02 | 58 bytes | Horizontal
dw $1CB2, $0188, $1CB3, $0188, $1CB4, $0188, $0188, $0188
dw $0188, $0188, $1DB0, $0188, $1DB1, $0188, $1DB2, $0188
dw $1DB3, $0188, $1DB4, $0188, $0188, $0188, $1D5A, $0188
dw $1D5B, $0188, $1D5C, $0188, $1D5D
dw $2165, $3900 ; VRAM $CA42 | 58 bytes | Horizontal
dw $1CAA, $0188, $1CAB, $0188, $1CAC, $0188, $0188, $0188
dw $0188, $0188, $1DA5, $0188, $1DA6, $0188, $1DA7, $0188
dw $1DA8, $0188, $1DA9, $0188, $0188, $0188, $1D4E, $0188
dw $1D4F, $0188, $1D60, $0188, $1D61
dw $4165, $3900 ; VRAM $CA82 | 58 bytes | Horizontal
dw $1CBA, $0188, $1CBB, $0188, $1CBC, $0188, $0188, $0188
dw $0188, $0188, $1DB5, $0188, $1DB6, $0188, $1DB7, $0188
dw $1DB8, $0188, $1DB9, $0188, $0188, $0188, $1D5E, $0188
dw $1D5F, $0188, $1D70, $0188, $1D71
dw $6165, $3900 ; VRAM $CAC2 | 58 bytes | Horizontal
dw $1CC2, $0188, $1CC3, $0188, $1CC4, $0188, $0188, $0188
dw $0188, $0188, $1DAA, $0188, $1DAB, $0188, $1DAC, $0188
dw $1DAD, $0188, $1DAE, $0188, $0188, $0188, $1D62, $0188
dw $1D63, $0188, $1D64, $0188, $1D65
dw $8165, $3900 ; VRAM $CB02 | 58 bytes | Horizontal
dw $1CD2, $0188, $1CD3, $0188, $1CD4, $0188, $0188, $0188
dw $0188, $0188, $1DBA, $0188, $1DBB, $0188, $1DBC, $0188
dw $1DBD, $0188, $1DBE, $0188, $0188, $0188, $1D72, $0188
dw $1D73, $0188, $1D74, $0188, $1D75
dw $A165, $3900 ; VRAM $CB42 | 58 bytes | Horizontal
dw $1CCA, $0188, $1CCB, $0188, $1CCC, $0188, $0188, $0188
dw $0188, $0188, $1DAF, $0188, $1DC0, $0188, $1DC1, $0188
dw $1DC2, $0188, $1DC3, $0188, $0188, $0188, $1D66, $0188
dw $1D67, $0188, $1D68, $0188, $1D69
dw $C165, $3900 ; VRAM $CB82 | 58 bytes | Horizontal
dw $1CDA, $0188, $1CDB, $0188, $1CDC, $0188, $0188, $0188
dw $0188, $0188, $1DBF, $0188, $1DD0, $0188, $1DD1, $0188
dw $1DD2, $0188, $1DD3, $0188, $0188, $0188, $1D76, $0188
dw $1D77, $0188, $1D78, $0188, $1D79
dw $E165, $3900 ; VRAM $CBC2 | 58 bytes | Horizontal
dw $1CE2, $0188, $1CE3, $0188, $1CE4, $0188, $0188, $0188
dw $0188, $0188, $1DC4, $0188, $1DC5, $0188, $1DC6, $0188
dw $1DC7, $0188, $1DC8, $0188, $0188, $0188, $1D6A, $0188
dw $1D6B, $0188, $1D6C, $0188, $1D6D
dw $0166, $3900 ; VRAM $CC02 | 58 bytes | Horizontal
dw $1CF2, $0188, $1CF3, $0188, $1CF4, $0188, $0188, $0188
dw $0188, $0188, $1DD4, $0188, $1DD5, $0188, $1DD6, $0188
dw $1DD7, $0188, $1DD8, $0188, $0188, $0188, $1D7A, $0188
dw $1D7B, $0188, $1D7C, $0188, $1D7D
; dw $2166, $3900 ; VRAM $CC42 | 58 bytes | Horizontal
; dw $1CEA, $0188, $1CEB, $0188, $1CEC, $0188, $0188, $0188
; dw $0188, $0188, $1DC9, $0188, $1DCA, $0188, $1DCB, $0188
; dw $1DCC, $0188, $1D86, $0188, $0188, $0188, $1D6E, $0188
; dw $1D6F, $0188, $1D80, $0188, $1D81
;
; dw $4166, $3900 ; VRAM $CC82 | 58 bytes | Horizontal
; dw $1CFA, $0188, $1CFB, $0188, $1CFC, $0188, $0188, $0188
; dw $0188, $0188, $1DD9, $0188, $1DDA, $0188, $1DDB, $0188
; dw $1DDC, $0188, $1D96, $0188, $0188, $0188, $1D7E, $0188
; dw $1D7F, $0188, $1D90, $0188, $1D91

Binary file not shown.

View File

@@ -0,0 +1,72 @@
dw $E164, $3900 ; VRAM $C9C2 | 58 bytes | Horizontal
dw $1CA2, $0188, $1CA3, $0188, $1CA4, $0188, $0188, $0188
dw $0188, $0188, $1DA0, $0188, $1DA1, $0188, $1DA2, $0188
dw $1DA3, $0188, $1DA4, $0188, $0188, $0188, $1D4A, $0188
dw $1D4B, $0188, $1D4C, $0188, $1D4D
dw $0165, $3900 ; VRAM $CA02 | 58 bytes | Horizontal
dw $1CB2, $0188, $1CB3, $0188, $1CB4, $0188, $0188, $0188
dw $0188, $0188, $1DB0, $0188, $1DB1, $0188, $1DB2, $0188
dw $1DB3, $0188, $1DB4, $0188, $0188, $0188, $1D5A, $0188
dw $1D5B, $0188, $1D5C, $0188, $1D5D
dw $2165, $3900 ; VRAM $CA42 | 58 bytes | Horizontal
dw $1CAA, $0188, $1CAB, $0188, $1CAC, $0188, $0188, $0188
dw $0188, $0188, $1DA5, $0188, $1DA6, $0188, $1DA7, $0188
dw $1DA8, $0188, $1DA9, $0188, $0188, $0188, $1D4E, $0188
dw $1D4F, $0188, $1D60, $0188, $1D61
dw $4165, $3900 ; VRAM $CA82 | 58 bytes | Horizontal
dw $1CBA, $0188, $1CBB, $0188, $1CBC, $0188, $0188, $0188
dw $0188, $0188, $1DB5, $0188, $1DB6, $0188, $1DB7, $0188
dw $1DB8, $0188, $1DB9, $0188, $0188, $0188, $1D5E, $0188
dw $1D5F, $0188, $1D70, $0188, $1D71
dw $6165, $3900 ; VRAM $CAC2 | 58 bytes | Horizontal
dw $1CC2, $0188, $1CC3, $0188, $1CC4, $0188, $0188, $0188
dw $0188, $0188, $1DAA, $0188, $1DAB, $0188, $1DAC, $0188
dw $1DAD, $0188, $1DAE, $0188, $0188, $0188, $1D62, $0188
dw $1D63, $0188, $1D64, $0188, $1D65
dw $8165, $3900 ; VRAM $CB02 | 58 bytes | Horizontal
dw $1CD2, $0188, $1CD3, $0188, $1CD4, $0188, $0188, $0188
dw $0188, $0188, $1DBA, $0188, $1DBB, $0188, $1DBC, $0188
dw $1DBD, $0188, $1DBE, $0188, $0188, $0188, $1D72, $0188
dw $1D73, $0188, $1D74, $0188, $1D75
dw $A165, $3900 ; VRAM $CB42 | 58 bytes | Horizontal
dw $1CCA, $0188, $1CCB, $0188, $1CCC, $0188, $0188, $0188
dw $0188, $0188, $1DAF, $0188, $1DC0, $0188, $1DC1, $0188
dw $1DC2, $0188, $1DC3, $0188, $0188, $0188, $1D66, $0188
dw $1D67, $0188, $1D68, $0188, $1D69
dw $C165, $3900 ; VRAM $CB82 | 58 bytes | Horizontal
dw $1CDA, $0188, $1CDB, $0188, $1CDC, $0188, $0188, $0188
dw $0188, $0188, $1DBF, $0188, $1DD0, $0188, $1DD1, $0188
dw $1DD2, $0188, $1DD3, $0188, $0188, $0188, $1D76, $0188
dw $1D77, $0188, $1D78, $0188, $1D79
dw $E165, $3900 ; VRAM $CBC2 | 58 bytes | Horizontal
dw $1CE2, $0188, $1CE3, $0188, $1CE4, $0188, $0188, $0188
dw $0188, $0188, $1DC4, $0188, $1DC5, $0188, $1DC6, $0188
dw $1DC7, $0188, $1DC8, $0188, $0188, $0188, $1D6A, $0188
dw $1D6B, $0188, $1D6C, $0188, $1D6D
dw $0166, $3900 ; VRAM $CC02 | 58 bytes | Horizontal
dw $1CF2, $0188, $1CF3, $0188, $1CF4, $0188, $0188, $0188
dw $0188, $0188, $1DD4, $0188, $1DD5, $0188, $1DD6, $0188
dw $1DD7, $0188, $1DD8, $0188, $0188, $0188, $1D7A, $0188
dw $1D7B, $0188, $1D7C, $0188, $1D7D
dw $2166, $3900 ; VRAM $CC42 | 58 bytes | Horizontal
dw $1CEA, $0188, $1CEB, $0188, $1CEC, $0188, $0188, $0188
dw $0188, $0188, $1DC9, $0188, $1DCA, $0188, $1DCB, $0188
dw $1DCC, $0188, $1D86, $0188, $0188, $0188, $1D6E, $0188
dw $1D6F, $0188, $1D80, $0188, $1D81
dw $4166, $3900 ; VRAM $CC82 | 58 bytes | Horizontal
dw $1CFA, $0188, $1CFB, $0188, $1CFC, $0188, $0188, $0188
dw $0188, $0188, $1DD9, $0188, $1DDA, $0188, $1DDB, $0188
dw $1DDC, $0188, $1D96, $0188, $0188, $0188, $1D7E, $0188
dw $1D7F, $0188, $1D90, $0188, $1D91

View File

@@ -0,0 +1,25 @@
dw $2362, $3900 ; VRAM $C446 | 58 bytes | Horizontal
dw $1C48, $0188, $1C49, $0188, $1C4A, $0188, $1C4B, $0188
dw $1C4C, $0188, $0188, $0188, $0188, $0188, $1CC5, $0188
dw $1CC6, $0188, $1CC7, $0188, $1CCD, $0188, $1CCE, $0188
dw $0188, $0188, $1CE8, $0188, $1CE9
dw $4362, $3900 ; VRAM $C486 | 58 bytes | Horizontal
dw $1C58, $0188, $1C59, $0188, $1C5A, $0188, $1C5B, $0188
dw $1C5C, $0188, $0188, $0188, $0188, $0188, $1CD5, $0188
dw $1CD6, $0188, $1CD7, $0188, $1CDD, $0188, $1CDE, $0188
dw $0188, $0188, $1CF8, $0188, $1CF9
dw $6362, $3900 ; VRAM $C4C6 | 58 bytes | Horizontal
dw $1C60, $0188, $1C61, $0188, $1C62, $0188, $1C63, $0188
dw $1C64, $0188, $0188, $0188, $0188, $0188, $1CCF, $0188
dw $1CE5, $0188, $1CE6, $0188, $1CE7, $0188, $1CED, $0188
dw $0188, $0188, $1D00, $0188, $1D01
dw $8362, $3900 ; VRAM $C506 | 58 bytes | Horizontal
dw $1C70, $0188, $1C71, $0188, $1C72, $0188, $1C73, $0188
dw $1C74, $0188, $0188, $0188, $0188, $0188, $1CDF, $0188
dw $1CF5, $0188, $1CF6, $0188, $1CF7, $0188, $1CFD, $0188
dw $0188, $0188, $1D10, $0188, $1D11

BIN
data/smallchars.2bpp Normal file

Binary file not shown.

61
data/textbytecharmap.txt Normal file
View File

@@ -0,0 +1,61 @@
'=9D
A=AA
B=AB
C=AC
D=AD
E=AE
F=AF
G=B0
H=B1
I=B2
J=B3
K=B4
L=B5
M=B6
N=B7
O=B8
P=B9
Q=BA
R=BB
S=BC
T=BD
U=BE
V=BF
W=C0
X=C1
Y=C2
Z=C3
?=C6
!=C7
,=C8
-=C9
.=CD
~=CE
a=D0
b=D1
c=D2
d=D3
e=D4
f=D5
g=D6
h=D7
i=D8
j=D9
k=DA
l=DB
m=DC
n=DD
o=DE
p=DF
q=E0
r=E1
s=E2
t=E3
u=E4
v=E5
w=E6
x=E7
y=E8
z=E9
:=EA
=FF

61
data/textwordcharmap.txt Normal file
View File

@@ -0,0 +1,61 @@
'=9D00
A=AA00
B=AB00
C=AC00
D=AD00
E=AE00
F=AF00
G=B000
H=B100
I=B200
J=B300
K=B400
L=B500
M=B600
N=B700
O=B800
P=B900
Q=BA00
R=BB00
S=BC00
T=BD00
U=BE00
V=BF00
W=C000
X=C100
Y=C200
Z=C300
?=C600
!=C700
,=C800
-=C900
.=CD00
~=CE00
a=D000
b=D100
c=D200
d=D300
e=D400
f=D500
g=D600
h=D700
i=D800
j=D900
k=DA00
l=DB00
m=DC00
n=DD00
o=DE00
p=DF00
q=E000
r=E100
s=E200
t=E300
u=E400
v=E500
w=E600
x=E700
y=E800
z=E900
:=EA00
=FF00

View File

@@ -0,0 +1,539 @@
;===================================================================================================
; Get the item's graphic from WRAM/ROM
; Bit 7 set indicates an explicit WRAM address
; Bit 7 reset indicates an offset into the ROM buffer
;===================================================================================================
;---------------------------------------------------------------------------------------------------
; Enters with A for parameter
;---------------------------------------------------------------------------------------------------
TransferItemReceiptToBuffer_using_GraphicsID:
PHP
PHB
REP #$30
PHX
PHY
SEP #$30
LDX.b #$00
.find_reverse
CMP.l ItemReceipts_graphics,X
BEQ .found
INX
BNE .find_reverse
.found
TXA
REP #$30
BRA ++
;===================================================================================================
TransferRupeesProperly:
PHP
PHB
REP #$31
PHX
PHY
AND.w #$00FF
SBC.w #$0023
XBA
LSR
LSR
LSR
ADC.w #BigDecompressionBuffer+$800
BRA TransferItemReceiptToBuffer_using_ExplicitBufferAddress
;===================================================================================================
TransferItemReceiptToBuffer_using_ReceiptID:
PHP : PHB
REP #$30
PHX : PHY
++ AND.w #$00FF
ASL : TAX
LDA.l BusyItem : BNE +
LDA.l StandingItemGraphicsOffsets,X
BRA .have_address
+
LDA.l ItemReceiptGraphicsOffsets,X
.have_address
BMI TransferItemReceiptToBuffer_using_ExplicitBufferAddress
.rom_address
ADC.w #ItemReceiptGraphicsROM
PHK
BRA .continue
#TransferItemReceiptToBuffer_using_ExplicitBufferAddress:
PEA.w $7F7F
PLB
.continue
PLB
TAY
LDX.w #62
.next_write
LDA.w $003E,Y
STA.l ItemGetGFX+$00,X
LDA.w $023E,Y
STA.l ItemGetGFX+$40,X
DEY
DEY
DEX
DEX
BPL .next_write
REP #$30
PLY
PLX
PLB
PLP
RTL
;===================================================================================================
TransferItemToVRAM:
REP #$21
SEP #$10
LDA.w ItemGFXPtr
BEQ .exit
BMI .wram_address
.rom_address
ADC.w #ItemReceiptGraphicsROM
LDX.b #ItemReceiptGraphicsROM>>16
.set_address
STA.w $4302
ADC.w #$0200
STA.w $4312
STX.w $4304
STX.w $4314
LDX.b #$80
STX.w $2115
LDA.w #$1801
STA.w $4300
STA.w $4310
LDA.w #$0040
STA.w $4305
STA.w $4315
LDA.w ItemGFXTarget
STA.w $2116
LDX.b #$01
STX.w $420B
ADC.w #$0100
STA.w $2116
INX
STX.w $420B
STZ.w ItemGFXPtr
STZ.w ItemGFXTarget
.exit
RTL
.wram_address
LDX.b #$7F
BRA .set_address
;===================================================================================================
; Decompress everything at the start of the game
;===================================================================================================
DecompBufferOffset = $18
DecompTestByte = $04
DecompCommand = $02
DecompSize = $00
DecompTileCount = $1A
DecompSaveY = $1A
Decomp3BPPScratch = $20
;===================================================================================================
DecompressAllItemGraphics:
PHP
PHB
PHD
REP #$38
; Stack change for safety
TSX
LDA.w #$1400
TCS
PHX
; direct page change for speed
LDA.w #$1200
TCD
STZ.b DecompBufferOffset
SEP #$34
STA.l $4200 ; already 0 from the LDA above
LDX.b #$5D+$73 : JSR FastSpriteDecomp
LDX.b #$5C+$73 : JSR FastSpriteDecomp
LDX.b #$5B+$73 : JSR FastSpriteDecomp
LDX.b #$5A+$73 : JSR FastSpriteDecomp
REP #$30
PLX
TXS
SEP #$20
LDA.b #$81
STA.l $4200
PLD
PLB
PLP
RTL
;===================================================================================================
; I normally hate macros like this... but I don't feel like constantly rewriting this
;===================================================================================================
macro GetNextByte()
LDA.w $0000,Y
INY
BNE ?++
; Y pulls more than it needs, but that's fine
; the high byte should only be affected if we somehow have FF as our bank
; and if that happens, we have other problems
PHB
PLY
INY
PHY
PLB
LDY.w #$8000
?++
endmacro
;===================================================================================================
; There's no long vanilla routine, and we're going to make heavy use of this
; so might as well rewrite it to be fast
;===================================================================================================
FastSpriteDecomp:
SEP #$30
LDA.l $80CFC0,X : PHA : PLB ; bank
LDA.l $80D09F,X : XBA ; high
LDA.l $80D17E,X ; low
REP #$10
TAY
LDX.w #$0000
.next_command
%GetNextByte()
CMP.b #$FF
BNE .continue
;---------------------------------------------------------------------------------------------------
JMP Unrolled3BPPConvert
;---------------------------------------------------------------------------------------------------
.continue
CMP.b #$E0
BCS .expanded
STA.b DecompTestByte
REP #$20
AND.w #$001F
BRA .normal
;---------------------------------------------------------------------------------------------------
; Putting some commands up here for branch distance
;---------------------------------------------------------------------------------------------------
.nonrepeating
REP #$21
TYA
ADC.b DecompSize
ORA.w #$8000
STA.b DecompSize
SEP #$20
.next_nonrepeating
%GetNextByte()
STA.l DecompBuffer2,X
INX
CPY.b DecompSize
BNE .next_nonrepeating
BRA .next_command
;---------------------------------------------------------------------------------------------------
.repeating
%GetNextByte()
STY.b DecompSaveY
LDY.b DecompSize
.next_repeating
STA.l DecompBuffer2,X
INX
DEY
BNE .next_repeating
LDY.b DecompSaveY
BRA .next_command
;---------------------------------------------------------------------------------------------------
; Rest of command handling
;---------------------------------------------------------------------------------------------------
.expanded
STA.b DecompCommand
ASL
ASL
ASL
STA.b DecompTestByte
LDA.b DecompCommand
AND.b #$03
XBA
%GetNextByte()
REP #$20
;---------------------------------------------------------------------------------------------------
.normal
INC
STA.b DecompSize
SEP #$20
LDA.b DecompTestByte
AND.b #$E0
BEQ .nonrepeating
BMI .copy
ASL
BPL .repeating
ASL
BPL .repeating_word
;---------------------------------------------------------------------------------------------------
.incremental
%GetNextByte()
STY.b DecompSaveY
LDY.b DecompSize
.next_incremental
STA.l DecompBuffer2,X
INC
INX
DEY
BNE .next_incremental
LDY.b DecompSaveY
JMP .next_command
;---------------------------------------------------------------------------------------------------
.repeating_word
JSR .get_next_word
REP #$20
STY.b DecompSaveY
LDY.b DecompSize
DEY
.next_word
STA.l DecompBuffer2,X
INX
INX
DEY
DEY
BPL .next_word
INY
BEQ .not_too_far
DEX
.not_too_far
SEP #$20
LDY.b DecompSaveY
JMP .next_command
;---------------------------------------------------------------------------------------------------
.copy
JSR .get_next_word
STY.b DecompSaveY
TAY
LDA.b DecompSize
BNE ++
DEC.b DecompSize+1
++ PHB
LDA.b #$7F
PHA
PLB
.next_copy
LDA.w DecompBuffer2,Y
STA.w DecompBuffer2,X
INX
INY
DEC.b DecompSize+0
BNE .next_copy
DEC.b DecompSize+1
BPL .next_copy
PLB
LDY.b DecompSaveY
JMP .next_command
;---------------------------------------------------------------------------------------------------
; These are only used once per command, so I'm fine with letting them be a JSR I guess
;---------------------------------------------------------------------------------------------------
.get_next_word
%GetNextByte()
XBA
%GetNextByte()
XBA
RTS
;===================================================================================================
; More macros, because lazy
;===================================================================================================
macro DoPlanesA(offset)
LDA.w DecompBuffer2+<offset>+<offset>,Y
STA.w BigDecompressionBuffer+<offset>+<offset>,X
ORA.w DecompBuffer2+<offset>+<offset>-1,Y
AND.w #$FF00
STA.b Decomp3BPPScratch
LDA.w DecompBuffer2+$10+<offset>,Y
AND.w #$00FF
TSB.b Decomp3BPPScratch
XBA
ORA.b Decomp3BPPScratch
STA.w BigDecompressionBuffer+$10+<offset>+<offset>,X
endmacro
;===================================================================================================
Unrolled3BPPConvert:
LDA.b #$7F
PHA
PLB
REP #$21
LDY.w #$0000
LDX.b DecompBufferOffset
.next_3bpp_tile
%DoPlanesA(0) ; 8 times
%DoPlanesA(1)
%DoPlanesA(2)
%DoPlanesA(3)
%DoPlanesA(4)
%DoPlanesA(5)
%DoPlanesA(6)
%DoPlanesA(7)
; carry will always be clear
; don't worry
TXA
ADC.w #32
TAX
; just trust me
TYA
ADC.w #24
TAY
CMP.w #24*64
BCS .done
JMP .next_3bpp_tile
.done
STX.b DecompBufferOffset
SEP #$30
RTS
;===================================================================================================

View File

@@ -1,13 +1,10 @@
!CryptoBuffer = "$7F5100"
;!keyBase = "$7F50D0"
;--------------------------------------------------------------------------------
LoadStaticDecryptionKey:
PHB : PHA : PHX : PHY : PHP
REP #$30 ; set 16-bit accumulator & index registers
LDX.w #StaticDecryptionKey ; Source
LDY.w #!keyBase ; Target
LDY.w #KeyBase ; Target
LDA.w #$000F ; Length
MVN $307F
@@ -23,65 +20,63 @@ RetrieveValueFromEncryptedTable:
;Returns result in A
PHX : PHY
PHA
LDY $04 : PHY : LDY $06 : PHY : LDY $08 : PHY
LDY $0A : PHY : LDY $0C : PHY : LDY $0E : PHY
LDY.b Scrap04 : PHY : LDY.b Scrap06 : PHY : LDY.b Scrap08 : PHY
LDY.b Scrap0A : PHY : LDY.b Scrap0C : PHY : LDY.b Scrap0E : PHY
AND.w #$FFF8 : TAY
LDA [$00], Y : STA.l !CryptoBuffer : INY #2
LDA [$00], Y : STA.l !CryptoBuffer+2 : INY #2
LDA [$00], Y : STA.l !CryptoBuffer+4 : INY #2
LDA [$00], Y : STA.l !CryptoBuffer+6
LDA.b [$00], Y : STA.l CryptoBuffer : INY #2
LDA.b [$00], Y : STA.l CryptoBuffer+2 : INY #2
LDA.b [$00], Y : STA.l CryptoBuffer+4 : INY #2
LDA.b [$00], Y : STA.l CryptoBuffer+6
LDA.w #$0002 : STA $04 ;set block size
LDA.w #$0002 : STA.b Scrap04 ;set block size
JSL.l XXTEA_Decode
PLA : STA $0E : PLA : STA $0C : PLA : STA $0A
PLA : STA $08 : PLA : STA $06 : PLA : STA $04
PLA : STA.b Scrap0E : PLA : STA.b Scrap0C : PLA : STA.b Scrap0A
PLA : STA.b Scrap08 : PLA : STA.b Scrap06 : PLA : STA.b Scrap04
PLA : AND.w #$0007 : TAX
LDA.l !CryptoBuffer, X
LDA.l CryptoBuffer, X
PHA
LDA.w #$0000
STA.l !CryptoBuffer
STA.l !CryptoBuffer+2
STA.l !CryptoBuffer+4
STA.l !CryptoBuffer+6
STA.l CryptoBuffer
STA.l CryptoBuffer+2
STA.l CryptoBuffer+4
STA.l CryptoBuffer+6
PLA
PLY : PLX
RTL
;--------------------------------------------------------------------------------
!ChestData = "$01E96C"
!ChestData_Payload = "$1EABC" ; !ChestData+$0150
ChestData = $01E96C
ChestDataPayload = $01EABC ; ChestData+$0150
;--------------------------------------------------------------------------------
GetChestData:
LDA.l IsEncrypted : BNE .encrypted
INC $0E : LDX.w #$FFFD ; what we wrote over
INC.b Scrap0E : LDX.w #$FFFD ; what we wrote over
JML.l Dungeon_OpenKeyedObject_nextChest
.encrypted
INC $0E : LDX.w #$FFFE
INC.b Scrap0E : LDX.w #$FFFE
.nextChest
INX #2 : CPX.w #$0150 : BEQ .couldntFindChest
LDA !ChestData, X : AND.w #$7FFF : CMP $A0 : BNE .nextChest
LDA.l ChestData, X : AND.w #$7FFF : CMP.b RoomIndex : BNE .nextChest
DEC $0E : BNE .nextChest
DEC.b Scrap0E : BNE .nextChest
LDA $00 : PHA : LDA $02 : PHA
LDA.b Scrap00 : PHA : LDA.b Scrap02 : PHA
LDA.w #!ChestData_Payload : STA $00
LDA.w #!ChestData_Payload>>16 : STA $02
LDA.w #ChestDataPayload : STA.b Scrap00
LDA.w #ChestDataPayload>>16 : STA.b Scrap02
TXA : LSR
JSL RetrieveValueFromEncryptedTable
STA $0C
STA.b Scrap0C
PLA : STA $02 : PLA : STA $00
PLA : STA.b Scrap02 : PLA : STA.b Scrap00
LDA !ChestData, X : ASL A : BCC .smallChest
LDA.l ChestData, X : ASL A : BCC .smallChest
JML.l Dungeon_OpenKeyedObject_bigChest ;(bank01.asm line #13783)

View File

@@ -2,280 +2,256 @@
; Dialog Pointer Override
;--------------------------------------------------------------------------------
DialogOverride:
LDA $7F5035 : BEQ .skip
LDA $7F5700, X ; use alternate buffer
LDA.l AltTextFlag : BEQ .skip
LDA.l DialogBuffer, X ; use alternate buffer
RTL
.skip
LDA $7F1200, X
LDA.l DecompressionBuffer+$1200, X
RTL
;--------------------------------------------------------------------------------
; $7F5035 - Alternate Text Pointer Flag ; 0=Disable
; $7F5036 - Padding Byte (Must be Zero)
; $7F5700 - $7F57FF - Dialog Buffer
;--------------------------------------------------------------------------------
ResetDialogPointer:
STZ $1CF0 : STZ $1CF1 ; reset decompression buffer
LDA.b #$00 : STA $7F5035 ; zero out the alternate flag
LDA.b #$1C : STA $1CE9 ; thing we wrote over
STZ.w TextID : STZ.w TextID+1 ; reset decompression buffer
LDA.b #$00 : STA.l AltTextFlag ; zero out the alternate flag
LDA.b #$1C : STA.w DelayTimer ; thing we wrote over
RTL
;--------------------------------------------------------------------------------
;macro LoadDialog(index,table)
; PHA : PHX : PHY
; PHB : PHK : PLB
; LDA $00 : PHA
; LDA $01 : PHA
; LDA $02 : PHA
; LDA.b #$01 : STA $7F5035 ; set flag
;
; LDA <index> : ASL : !ADD.l <index> : TAX ; get quote offset *3, move to X
; LDA <table>, X : STA $00 ; write pointer to direct page
; LDA <table>+1, X : STA $01
; LDA <table>+2, X : STA $02
;
; LDX.b #$00 : LDY.b #$00
; -
; LDA [$00], Y ; load the next character from the pointer
; STA $7F5700, X ; write to the buffer
; INX : INY
; CMP.b #$7F : BNE -
; PLA : STA $02
; PLA : STA $01
; PLA : STA $00
; PLB
; PLY : PLX : PLA
;endmacro
;--------------------------------------------------------------------------------
;macro LoadDialogAddress(address)
; PHA : PHX : PHY
; PHP
; PHB : PHK : PLB
; SEP #$30 ; set 8-bit accumulator and index registers
; LDA $00 : PHA
; LDA $01 : PHA
; LDA $02 : PHA
; LDA.b #$01 : STA $7F5035 ; set flag
;
; LDA.b #<address> : STA $00 ; write pointer to direct page
; LDA.b #<address>>>8 : STA $01
; LDA.b #<address>>>16 : STA $02
;
; LDX.b #$00 : LDY.b #$00
; -
; LDA [$00], Y ; load the next character from the pointer
; STA $7F5700, X ; write to the buffer
; INX : INY
; CMP.b #$7F : BNE -
; PLA : STA $02
; PLA : STA $01
; PLA : STA $00
; PLB
; PLP
; PLY : PLX : PLA
;endmacro
;--------------------------------------------------------------------------------
!OFFSET_POINTER = "$7F5094"
!OFFSET_RETURN = "$7F5096"
!DIALOG_BUFFER = "$7F5700"
macro LoadDialogAddress(address)
PHA : PHX : PHY
PHP
PHB : PHK : PLB
SEP #$20 ; set 8-bit accumulator
REP #$10 ; set 16-bit index registers
LDA $00 : PHA
LDA $01 : PHA
LDA $02 : PHA
STZ $1CF0 : STZ $1CF1 ; reset decompression buffer
LDA.b #$01 : STA $7F5035 ; set flag
PEI.b ($00)
LDA.b Scrap02 : PHA
STZ.w TextID : STZ.w TextID+1 ; reset decompression buffer
LDA.b #$01 : STA.l AltTextFlag ; set flag
%CopyDialog(<address>)
PLA : STA $02
PLA : STA $01
PLA : STA $00
PLA : STA.b Scrap02
REP #$20
PLA : STA.b Scrap00
PLB
PLP
PLY : PLX : PLA
endmacro
;--------------------------------------------------------------------------------
macro CopyDialog(address)
LDA.b #<address> : STA $00 ; write pointer to direct page
LDA.b #<address>>>8 : STA $01
LDA.b #<address>>>16 : STA $02
LDA.b #<address> : STA.b Scrap00 ; write pointer to direct page
LDA.b #<address>>>8 : STA.b Scrap01
LDA.b #<address>>>16 : STA.b Scrap02
%CopyDialogIndirect()
endmacro
;--------------------------------------------------------------------------------
macro CopyDialogIndirect()
REP #$20 : LDA !OFFSET_POINTER : TAX : LDY.w #$0000 : SEP #$20 ; copy 2-byte offset pointer to X and set Y to 0
REP #$20 : LDA.l DialogOffsetPointer : TAX : LDY.w #$0000 : SEP #$20 ; copy 2-byte offset pointer to X and set Y to 0
?loop:
LDA [$00], Y ; load the next character from the pointer
STA !DIALOG_BUFFER, X ; write to the buffer
LDA.b [$00], Y ; load the next character from the pointer
STA.l DialogBuffer, X ; write to the buffer
INX : INY
CMP.b #$7F : BNE ?loop
REP #$20 ; set 16-bit accumulator
TXA : INC : STA !OFFSET_RETURN ; copy out X into
LDA.w #$0000 : STA !OFFSET_POINTER
TXA : INC : STA.l DialogReturnPointer ; copy out X into
LDA.w #$0000 : STA.l DialogOffsetPointer
SEP #$20 ; set 8-bit accumulator
endmacro
;--------------------------------------------------------------------------------
LoadDialogAddressIndirect:
STZ $1CF0 : STZ $1CF1 ; reset decompression buffer
LDA.b #$01 : STA $7F5035 ; set flag
STZ.w TextID : STZ.w TextID+1 ; reset decompression buffer
LDA.b #$01 : STA.l AltTextFlag ; set flag
%CopyDialogIndirect()
;%LoadDialogAddress(UncleText)
RTL
;--------------------------------------------------------------------------------
!ITEM_TEMPORARY = "$7F5040"
FreeDungeonItemNotice:
STA !ITEM_TEMPORARY
STA.l ScratchBufferV
PHA : PHX : PHY
PHP
PHB : PHK : PLB
SEP #$20 ; set 8-bit accumulator
REP #$10 ; set 16-bit index registers
LDA $00 : PHA
LDA $01 : PHA
LDA $02 : PHA
PHA : PHX : PHY
PHP
PHB : PHK : PLB
SEP #$20 ; set 8-bit accumulator
REP #$10 ; set 16-bit index registers
PEI.b (Scrap00)
LDA.b Scrap02 : PHA
LDA.l ScratchBufferNV : PHA
LDA.l ScratchBufferNV+1 : PHA
;--------------------------------
LDA.l FreeItemText : BNE + : BRL .skip : +
LDA.l FreeItemText : BNE + : JMP .skip : +
LDA #$00 : STA $7F5010 ; initialize scratch
LDA.l FreeItemText : AND.b #$01 : CMP.b #$01 : BNE + ; show message for general small key
LDA !ITEM_TEMPORARY : CMP.b #$24 : BNE + ; general small key
LDA.b #$00 : STA.l ScratchBufferNV ; initialize scratch
LDA.l FreeItemText : AND.b #$01 : BEQ + ; show message for general small key
LDA.l ScratchBufferV : CMP.b #$24 : BNE + ; general small key
%CopyDialog(Notice_SmallKeyOf)
LDA !OFFSET_RETURN : DEC #2 : STA !OFFSET_POINTER
LDA.l DialogReturnPointer : DEC #2 : STA.l DialogOffsetPointer
%CopyDialog(Notice_Self)
BRL .done
+ : LDA.l FreeItemText : AND.b #$02 : CMP.b #$02 : BNE + ; show message for general compass
LDA !ITEM_TEMPORARY : CMP.b #$25 : BNE + ; general compass
JMP .done
+ : LDA.l FreeItemText : AND.b #$02 : BEQ + ; show message for general compass
LDA.l ScratchBufferV : CMP.b #$25 : BNE + ; general compass
%CopyDialog(Notice_CompassOf)
LDA !OFFSET_RETURN : DEC #2 : STA !OFFSET_POINTER
LDA.l DialogReturnPointer : DEC #2 : STA.l DialogOffsetPointer
%CopyDialog(Notice_Self)
BRL .done
+ : LDA.l FreeItemText : AND.b #$04 : CMP.b #$04 : BNE + ; show message for general map
LDA !ITEM_TEMPORARY : CMP.b #$33 : BNE + ; general map
JMP .done
+ : LDA.l FreeItemText : AND.b #$04 : BEQ + ; show message for general map
LDA.l ScratchBufferV : CMP.b #$33 : BNE + ; general map
%CopyDialog(Notice_MapOf)
LDA !OFFSET_RETURN : DEC #2 : STA !OFFSET_POINTER
LDA.l DialogReturnPointer : DEC #2 : STA.l DialogOffsetPointer
%CopyDialog(Notice_Self)
BRL .done
+ : LDA.l FreeItemText : AND.b #$08 : CMP.b #$08 : BNE + ; show message for general big key
LDA !ITEM_TEMPORARY : CMP.b #$32 : BNE + ; general big key
JMP .done
+ : LDA.l FreeItemText : AND.b #$08 : BEQ + ; show message for general big key
LDA.l ScratchBufferV : CMP.b #$32 : BNE + ; general big key
%CopyDialog(Notice_BigKeyOf)
LDA !OFFSET_RETURN : DEC #2 : STA !OFFSET_POINTER
LDA.l DialogReturnPointer : DEC #2 : STA.l DialogOffsetPointer
%CopyDialog(Notice_Self)
BRL .done
JMP .done
+
LDA !ITEM_TEMPORARY : AND.b #$F0 ; looking at high bits only
LDA.l FreeItemText : AND.b #$04 : BEQ + ; show message for dungeon map
LDA.l ScratchBufferV : AND.b #$F0 ; looking at high bits only
CMP.b #$70 : BNE + ; map of...
%CopyDialog(Notice_MapOf)
BRL .dungeon
+ : CMP.b #$80 : BNE + ; compass of...
JMP .dungeon
+ : LDA.l FreeItemText : AND.b #$02 : BEQ + ; show message for dungeon compass
LDA.l ScratchBufferV : AND.b #$F0 : CMP.b #$80 : BNE + ; compass of...
%CopyDialog(Notice_CompassOf)
BRL .dungeon
+ : CMP.b #$90 : BNE + ; big key of...
JMP .dungeon
+ : LDA.l FreeItemText : AND.b #$08 : BEQ + ; show message for dungeon big key
LDA.l ScratchBufferV : AND.b #$F0 : CMP.b #$90 : BNE + ; big key of...
%CopyDialog(Notice_BigKeyOf)
BRA .dungeon
+ : CMP.b #$A0 : BNE + ; small key of...
LDA !ITEM_TEMPORARY : CMP.b #$AF : BNE ++ : BRL .skip : ++
JMP .dungeon
+ : LDA.l FreeItemText : AND.b #$01 : BEQ + ; show message for dungeon small key
LDA.l ScratchBufferV : AND.b #$F0 : CMP.b #$A0 : BNE + ; small key of...
LDA.l ScratchBufferV : CMP.b #$AF : BNE ++ : JMP .skip : ++
%CopyDialog(Notice_SmallKeyOf)
PLA : AND.b #$0F : STA $7F5020 : LDA.b #$0F : !SUB $7F5020 : PHA
LDA #$01 : STA $7F5010 ; set up a flip for small keys
LDA.b #$01 : STA.l ScratchBufferNV ; set up a flip for small keys
BRA .dungeon
+
BRL .skip ; it's not something we are going to give a notice for
+ : LDA.l FreeItemText : AND.b #$20 : BEQ + ; show message for crystal
LDA.l ScratchBufferV : CMP.b #$B0 : !BLT + ; crystal #
CMP.b #$B7 : !BGE +
%CopyDialog(Notice_Crystal)
JMP .crystal
+
JMP .skip ; it's not something we are going to give a notice for
.dungeon
LDA !OFFSET_RETURN : DEC #2 : STA !OFFSET_POINTER
LDA !ITEM_TEMPORARY
AND.b #$0F ; looking at low bits only
STA $7F5011
LDA $7F5010 : BEQ +
LDA $7F5010
LDA #$0F : !SUB $7F5011 : STA $7F5011 ; flip the values for small keys
LDA.l DialogReturnPointer : DEC #2 : STA.l DialogOffsetPointer
LDA.l ScratchBufferV
AND.b #$0F
STA.l ScratchBufferNV+1
LDA.l ScratchBufferNV : BEQ +
LDA.l ScratchBufferNV
LDA.b #$0F : !SUB.l ScratchBufferNV+1 : STA.l ScratchBufferNV+1 ; flip the values for small keys
+
LDA $7F5011
LDA.l ScratchBufferNV+1
ASL : TAX
REP #$20
LDA.l DungeonItemIDMap,X : CMP.w #$0003 : BCC .hc_sewers
CMP.w DungeonID : BNE +
BRA .self_notice
.hc_sewers
LDA.w DungeonID : CMP.w #$0003 : BCS +
.self_notice
SEP #$20
%CopyDialog(Notice_Self)
JMP.w .done
+
SEP #$20
LDA.l ScratchBufferNV+1
CMP.b #$00 : BNE + ; ...light world
%CopyDialog(Notice_LightWorld) : BRL .done
%CopyDialog(Notice_LightWorld) : JMP .done
+ : CMP.b #$01 : BNE + ; ...dark world
%CopyDialog(Notice_DarkWorld) : BRL .done
%CopyDialog(Notice_DarkWorld) : JMP .done
+ : CMP.b #$02 : BNE + ; ...ganon's tower
%CopyDialog(Notice_GTower) : BRL .done
%CopyDialog(Notice_GTower) : JMP .done
+ : CMP.b #$03 : BNE + ; ...turtle rock
%CopyDialog(Notice_TRock) : BRL .done
%CopyDialog(Notice_TRock) : JMP .done
+ : CMP.b #$04 : BNE + ; ...thieves' town
%CopyDialog(Notice_Thieves) : BRL .done
%CopyDialog(Notice_Thieves) : JMP .done
+ : CMP.b #$05 : BNE + ; ...tower of hera
%CopyDialog(Notice_Hera) : BRL .done
%CopyDialog(Notice_Hera) : JMP .done
+ : CMP.b #$06 : BNE + ; ...ice palace
%CopyDialog(Notice_Ice) : BRL .done
%CopyDialog(Notice_Ice) : JMP .done
+ : CMP.b #$07 : BNE + ; ...skull woods
%CopyDialog(Notice_Skull) : BRL .done
%CopyDialog(Notice_Skull) : JMP .done
+ : CMP.b #$08 : BNE + ; ...misery mire
%CopyDialog(Notice_Mire) : BRL .done
%CopyDialog(Notice_Mire) : JMP .done
+ : CMP.b #$09 : BNE + ; ...dark palace
%CopyDialog(Notice_PoD) : BRL .done
%CopyDialog(Notice_PoD) : JMP .done
+ : CMP.b #$0A : BNE + ; ...swamp palace
%CopyDialog(Notice_Swamp) : BRL .done
%CopyDialog(Notice_Swamp) : JMP .done
+ : CMP.b #$0B : BNE + ; ...agahnim's tower
%CopyDialog(Notice_AgaTower) : BRL .done
%CopyDialog(Notice_AgaTower) : JMP .done
+ : CMP.b #$0C : BNE + ; ...desert palace
%CopyDialog(Notice_Desert) : BRL .done
%CopyDialog(Notice_Desert) : JMP .done
+ : CMP.b #$0D : BNE + ; ...eastern palace
%CopyDialog(Notice_Eastern) : BRA .done
%CopyDialog(Notice_Eastern) : JMP .done
+ : CMP.b #$0E : BNE + ; ...hyrule castle
%CopyDialog(Notice_Castle) : BRA .done
%CopyDialog(Notice_Castle) : JMP .done
+ : CMP.b #$0F : BNE + ; ...sewers
%CopyDialog(Notice_Sewers)
+
JMP .done
.crystal
LDA.l DialogReturnPointer : DEC #2 : STA.l DialogOffsetPointer
LDA.l ScratchBufferV
AND.b #$0F ; looking at low bits only
CMP.b #$00 : BNE +
%CopyDialog(Notice_Six) : JMP .done
+ : CMP.b #$01 : BNE +
%CopyDialog(Notice_One) : JMP .done
+ : CMP.b #$02 : BNE +
%CopyDialog(Notice_Five) : JMP .done
+ : CMP.b #$03 : BNE +
%CopyDialog(Notice_Seven) : JMP .done
+ : CMP.b #$04 : BNE +
%CopyDialog(Notice_Two) : JMP .done
+ : CMP.b #$05 : BNE +
%CopyDialog(Notice_Four) : JMP .done
+ : CMP.b #$06 : BNE +
%CopyDialog(Notice_Three) : JMP .done
+
.done
STZ $1CF0 : STZ $1CF1 ; reset decompression buffer
LDA.b #$01 : STA $7F5035 ; set alternate dialog flag
LDA.b #$01 : STA $7F509F
STZ.w TextID : STZ.w TextID+1 ; reset decompression buffer
LDA.b #$01 : STA.l AltTextFlag ; set alternate dialog flag
STA.l TextBoxDefer
;--------------------------------
PLA : STA $02
PLA : STA $01
PLA : STA $00
PLB
PLP
PLY : PLX : PLA
;JSL.l Main_ShowTextMessage_Alt
RTL
.skip
;--------------------------------
PLA : STA $02
PLA : STA $01
PLA : STA $00
PLB
PLP
PLY : PLX : PLA
PLA : STA.l ScratchBufferNV+1
PLA : STA.l ScratchBufferNV
PLA : STA.b Scrap02
REP #$20
PLA : STA.b Scrap00
PLB
PLP
PLY : PLX : PLA
RTL
;--------------------------------------------------------------------------------
DialogResetSelectionIndex:
JSL.l Attract_DecompressStoryGfx ; what we wrote over
STZ $1CE8
STZ.w MessageCursor
RTL
;--------------------------------------------------------------------------------
DialogItemReceive:
BCS .noMessage ; if doubling the item value overflowed it must be a rando item
CPY #$98 : !BLT + ;if the item is $4C or greater it must be a rando item
.noMessage
LDA.w #$FFFF
BRA .done
+
LDA.w Ancilla_ReceiveItem_item_messages, Y
BCS .nomessage ; if doubling the item value overflowed it must be a rando item
CPY.b #$98 : BCC ++ ;if the item is $4C or greater it must be a rando item
.nomessage
LDA.w #$FFFF
BRA .done
++ LDA.w Ancilla_ReceiveItem_item_messages, Y
.done
CMP.w #$FFFF
RTL
;--------------------------------------------------------------------------------
DialogFairyThrow:
LDA.l Restrict_Ponds : BEQ .normal
LDA $7EF35C : ORA $7EF35D : ORA $7EF35E : ORA $7EF35F : BNE .normal
LDA.l BottleContentsOne
ORA.l BottleContentsTwo : ORA.l BottleContentsThree : ORA.l BottleContentsFour : BNE .normal
.noInventory
LDA $0D80, X : !ADD #$08 : STA $0D80, X
LDA.w SpriteActivity, X : !ADD #$08 : STA.w SpriteActivity, X
LDA.b #$51
LDY.b #$01
RTL
@@ -285,12 +261,13 @@ RTL
RTL
;--------------------------------------------------------------------------------
DialogGanon1:
JSL.l CheckGanonVulnerability : BCS +
REP #$20 : LDA.w #$018C : STA $1CF0 : SEP #$20
BRA ++
+
REP #$20 : LDA.w #$016D : STA $1CF0 : SEP #$20
++
JSL.l CheckGanonVulnerability
REP #$20
LDA.w #$018C
BCC +
LDA.w #$016D
+ STA.w TextID
SEP #$20
JSL.l Sprite_ShowMessageMinimal_Alt
RTL
;--------------------------------------------------------------------------------
@@ -298,146 +275,158 @@ RTL
; #$0193 - no silvers alternate
; #$0194 - no silvers
; #$0195 - silvers
; $7EF38E - bsp-- ---
; BowTracking - bsp-- ---
; b = bow
; s = silver arrow bow
; p = 2nd progressive bow
DialogGanon2:
JSL.l CheckGanonVulnerability : BCS +
REP #$20 : LDA.w #$018D : STA $1CF0 : SEP #$20
BRA ++
+
LDA.l $7EF38E : AND #$80 : BNE + ; branch if bow
REP #$20 : LDA.w #$0192 : STA $1CF0 : SEP #$20 ; no bow
BRA ++
+
LDA.l $7EF38E : AND #$40 : BEQ + ; branch if no silvers
REP #$20 : LDA.w #$0195 : STA $1CF0 : SEP #$20 ;has silvers
BRA ++
+
LDA.l $7EF38E : AND #$20 : BNE + ; branch if p bow
REP #$20 : LDA.w #$0194 : STA $1CF0 : SEP #$20 ; bow, no-silvers, no-p-bow
BRA ++
+
LDA.l $7EF38E : AND #$80 : BEQ + ; branch if no bow
REP #$20 : LDA.w #$0193 : STA $1CF0 : SEP #$20 ; bow, no-silvers, p-bow
BRA ++
+
REP #$20 : LDA.w #$016E : STA $1CF0 : SEP #$20 ; both bow and no bow. impossible.
++
JSL.l Sprite_ShowMessageMinimal_Alt
JSL.l CheckGanonVulnerability
REP #$20
BCS +
LDA.w #$018D : BRA ++
+
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
++
STA.w TextID
SEP #$20
JSL.l Sprite_ShowMessageMinimal_Alt
RTL
;--------------------------------------------------------------------------------
DialogEtherTablet:
PHA
LDA $0202 : CMP.b #$0F : BEQ + ; Show normal text if book is not equipped
LDA.w ItemCursor : CMP.b #$0F : BEQ + ; Show normal text if book is not equipped
-
PLA : JSL Sprite_ShowMessageUnconditional ; Wacky Hylian Text
RTL
PLA : JML Sprite_ShowMessageUnconditional ; Wacky Hylian Text
+
BIT $F4 : BVC - ; Show normal text if Y is not pressed
BIT.b Joy1A_New : BVC - ; Show normal text if Y is not pressed
LDA.l AllowHammerTablets : BEQ ++
LDA $7EF34B : BEQ .yesText : BRA .noText
LDA.l HammerEquipment : BEQ .yesText : BRA .noText
++
LDA $7EF359 : CMP.b #$FF : BEQ .yesText : CMP.b #$02 : !BGE .noText
LDA.l SwordEquipment : CMP.b #$FF : BEQ .yesText : CMP.b #$02 : BCS .noText
;++
.yesText
PLA
LDA.b #$0c
LDA.b #$0C
LDY.b #$01
JSL Sprite_ShowMessageUnconditional ; Text From MSPedestalText (tables.asm)
RTL
JML Sprite_ShowMessageUnconditional ; Text From MSPedestalText (tables.asm)
.noText
PLA
RTL
;--------------------------------------------------------------------------------
DialogBombosTablet:
PHA
LDA $0202 : CMP.b #$0F : BEQ + ; Show normal text if book is not equipped
LDA.w ItemCursor : CMP.b #$0F : BEQ + ; Show normal text if book is not equipped
-
PLA : JSL Sprite_ShowMessageUnconditional ; Wacky Hylian Text
RTL
PLA : JML Sprite_ShowMessageUnconditional ; Wacky Hylian Text
+
BIT $F4 : BVC - ; Show normal text if Y is not pressed
BIT.b Joy1A_New : BVC - ; Show normal text if Y is not pressed
LDA.l AllowHammerTablets : BEQ ++
LDA $7EF34B : BEQ .yesText : BRA .noText
LDA.l HammerEquipment : BEQ .yesText : BRA .noText
++
LDA $7EF359 : CMP.b #$FF : BEQ .yesText : CMP.b #$02 : !BGE .noText
LDA.l SwordEquipment : CMP.b #$FF : BEQ .yesText : CMP.b #$02 : !BGE .noText
;++
.yesText
PLA
LDA.b #$0D
LDY.b #$01
JSL Sprite_ShowMessageUnconditional ; Text From MSPedestalText (tables.asm)
RTL
JML Sprite_ShowMessageUnconditional ; Text From MSPedestalText (tables.asm)
.noText
PLA
RTL
;--------------------------------------------------------------------------------
DialogSahasrahla:
LDA.l $7EF374 : AND #$04 : BEQ + ;Check if player has green pendant
LDA.l PendantsField : AND.b #$04 : BEQ + ;Check if player has green pendant
LDA.b #$2F
LDY.b #$00
JSL.l Sprite_ShowMessageUnconditional
JML Sprite_ShowMessageUnconditional
+
RTL
;--------------------------------------------------------------------------------
DialogBombShopGuy:
LDA.l $7EF37A : AND #$05 : CMP #$05 : BEQ + ;Check if player has crystals 5 & 6
LDA.b #$15
LDY.b #$01
JSL.l Sprite_ShowMessageUnconditional
RTL
LDY.b #$15
LDA.l CrystalsField : AND.b #$05 : CMP.b #$05 : BNE + ;Check if player has crystals 5 & 6
INY ; from 15 to 16
+
LDA.b #$16
LDY.b #$01
TYA
LDY.b #$01
JSL.l Sprite_ShowMessageUnconditional
RTL
;---------------------------------------------------------------------------------------------------
AgahnimAsksAboutPed:
LDA.l GanonVulnerableMode
CMP.b #$06 : BNE .vanilla
LDA.l OverworldEventDataWRAM+$80 ; check ped flag
AND.b #$40
BNE .vanilla
LDA.b #$8C ; message 018C for no ped
STA.w TextID
.vanilla
JML $85FA8E ; Sprite_ShowMessageMinimal
;--------------------------------------------------------------------------------
Main_ShowTextMessage_Alt:
; Are we in text mode? If so then end the routine.
LDA $10 : CMP.b #$0E : BEQ .already_in_text_mode
LDA.b GameMode : CMP.b #$0E : BEQ .already_in_text_mode
Sprite_ShowMessageMinimal_Alt:
STZ $11
STZ.b GameSubMode
PHX : PHY
LDA.b $00 : PHA
LDA.b $01 : PHA
LDA.b $02 : PHA
PEI.b (Scrap00)
LDA.b Scrap02 : PHA
LDA.b #$1C : STA.b $02
LDA.b #$1C : STA.b Scrap02
REP #$30
LDA.w $1CF0 : ASL : TAX
LDA.l $7f71c0, X
STA.b $00
LDA.w TextID : ASL : TAX
LDA.l $7F71C0, X
STA.b Scrap00
SEP #$30
LDY.b #$00
LDA [$00], Y : CMP.b #$fe : BNE +
INY : LDA [$00], Y : CMP.b #$6e : BNE +
INY : LDA [$00], Y : : BNE +
INY : LDA [$00], Y : CMP.b #$fe : BNE +
INY : LDA [$00], Y : CMP.b #$6b : BNE +
INY : LDA [$00], Y : CMP.b #$04 : BNE +
STZ $1CE8
BRL .end
LDA.b [Scrap00], Y : CMP.b #$FE : BNE +
INY : LDA.b [Scrap00], Y : CMP.b #$6E : BNE +
INY : LDA.b [Scrap00], Y : : BNE +
INY : LDA.b [Scrap00], Y : CMP.b #$FE : BNE +
INY : LDA.b [Scrap00], Y : CMP.b #$6B : BNE +
INY : LDA.b [Scrap00], Y : CMP.b #$04 : BNE +
STZ.w MessageCursor
JMP .end
+
STZ $0223 ; Otherwise set it so we are in text mode.
STZ $1CD8 ; Initialize the step in the submodule
STZ.w MessageJunk ; Otherwise set it so we are in text mode.
STZ.w MessageSubModule
; Go to text display mode (as opposed to maps, etc)
LDA.b #$02 : STA $11
LDA.b #$02 : STA.b GameSubMode
; Store the current module in the temporary location.
LDA $10 : STA $010C
LDA.b GameMode : STA.w GameModeCache
; Switch the main module ($10) to text mode.
LDA.b #$0E : STA $10
LDA.b #$0E : STA.b GameMode
.end
PLA : STA.b $02
PLA : STA.b $01
PLA : STA.b $00
PLA : STA.b Scrap02
PLA : STA.b Scrap01
PLA : STA.b Scrap00
PLY : PLX
Main_ShowTextMessage_Alt_already_in_text_mode:
@@ -449,15 +438,15 @@ CalculateSignIndex:
; 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
LDA.b OverworldIndex : ASL A : TAY ;what we wrote over
LDA $0712 : BEQ .done ; If a small map, we can skip these calculations.
LDA.w OWScreenSize : BEQ .done ; If a small map, we can skip these calculations.
LDA $21 : AND.w #$0002 : ASL #2 : EOR $8A : AND.w #$0008 : BEQ +
LDA.b LinkPosY+1 : AND.w #$0002 : ASL #2 : EOR.b OverworldIndex : 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 +
LDA.b LinkPosX+1 : AND.w #$0002 : LSR : EOR.b OverworldIndex : 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:
@@ -466,6 +455,112 @@ CalculateSignIndex:
.done
RTL
;================================================================
; Contributor: Myramong
;================================================================
Sprite_ShowSolicitedMessageIfPlayerFacing_Alt:
{
STA.w TextID
STY.w TextID+1
JSL Sprite_CheckDamageToPlayerSameLayerLong : BCC .alpha
JSL Sprite_CheckIfPlayerPreoccupied : BCS .alpha
LDA.b Joy1B_New : BPL .alpha
LDA.w SpriteTimerE, X : BNE .alpha
LDA.b LinkJumping : CMP.b #$02 : BEQ .alpha
JSL Sprite_DirectionToFacePlayerLong : PHX : TYX
; Make sure that the sprite is facing towards the player, otherwise
; talking can't happen. (What sprites actually use this???)
LDA.l $85E1A3, X : PLX : CMP.b LinkDirection : BNE .not_facing_each_other
PHY
LDA.w TextID
LDY.w TextID+1
; Check what room we're in so we know which npc we're talking to
LDA.b RoomIndex
CMP.b #$05 : BEQ .SahasrahlaDialogs
CMP.b #$1C : BEQ .BombShopGuyDialog
BRA .SayNothing
.SahasrahlaDialogs
REP #$20 : LDA.l MapReveal_Sahasrahla : ORA.l MapOverlay : STA.l MapOverlay : SEP #$20
JSL DialogSahasrahla : BRA .SayNothing
.BombShopGuyDialog
REP #$20 : LDA.l MapReveal_BombShop : ORA.l MapOverlay : STA.l MapOverlay : SEP #$20
JSL DialogBombShopGuy
.SayNothing
LDA.b #$40 : STA.w SpriteTimerE, X
PLA : EOR.b #$03
SEC
RTL
.not_facing_each_other
.alpha
LDA.w SpriteMoveDirection, X
CLC
RTL
}
;================================================================
Sprite_ShowSolicitedMessageIfPlayerFacing_PreserveMessage:
{
PHY
PHA
JSL Sprite_CheckDamageToPlayerSameLayerLong : BCC .alpha
JSL Sprite_CheckIfPlayerPreoccupied : BCS .alpha
LDA.b Joy1B_New : BPL .alpha
LDA.w SpriteTimerE, X : BNE .alpha
LDA.b LinkJumping : CMP.b #$02 : BEQ .alpha
JSL Sprite_DirectionToFacePlayerLong : PHX : TYX
; Make sure that the sprite is facing towards the player, otherwise
; talking can't happen. (What sprites actually use this???)
LDA.l $85E1A3, X : PLX : CMP.b LinkDirection : BNE .not_facing_each_other
PLA : XBA : PLA
PHY
TAY : XBA
JSL Sprite_ShowMessageUnconditional
LDA.b #$40 : STA.w SpriteTimerE, X
PLA : EOR.b #$03
SEC
RTL
.not_facing_each_other
.alpha
PLY
PLA
LDA.w SpriteMoveDirection, X
CLC
RTL
}
;--------------------------------------------------------------------------------
; A0 - A9 - 0 - 9
; AA - C3 - A - Z

View File

@@ -7,8 +7,8 @@
;--------------------------------------------------------------------------------
StoreLastOverworldDoorID:
TXA : INC
STA $7F5099
LDA $1BBB73, X : STA $010E
STA.l PreviousOverworldDoor
LDA.l $9BBB73, X : STA.w EntranceIndex
RTL
;--------------------------------------------------------------------------------
@@ -16,14 +16,14 @@ RTL
; CacheDoorFrameData
;--------------------------------------------------------------------------------
CacheDoorFrameData:
LDA $7F5099 : BEQ .originalBehaviour
LDA.l PreviousOverworldDoor : BEQ .originalBehaviour
DEC : ASL : TAX
LDA EntranceDoorFrameTable, X : STA $0696
LDA EntranceAltDoorFrameTable, X : STA $0698
LDA.l EntranceDoorFrameTable, X : STA.w TileMapEntranceDoors
LDA.l EntranceAltDoorFrameTable, X : STA.w TileMapTile32
BRA .done
.originalBehaviour
LDA $D724, X : STA $0696
STZ $0698
LDA.w $D724, X : STA.w TileMapEntranceDoors
STZ.w TileMapTile32
.done
RTL
;--------------------------------------------------------------------------------
@@ -32,8 +32,8 @@ RTL
; WalkDownIntoTavern
;--------------------------------------------------------------------------------
WalkDownIntoTavern:
LDA $7F5099
LDA.l PreviousOverworldDoor
; tavern door has index 0x42 (saved off value is incremented by one)
CMP #$43
CMP.b #$43
RTL
;--------------------------------------------------------------------------------

View File

@@ -1,9 +1,329 @@
;================================================================================
; Dungeon & Boss Drop Fixes
;--------------------------------------------------------------------------------
DropSafeDungeon:
LDA $040C : CMP #$08 : BEQ +
LDA $01C6FC, X : JSL Sprite_SpawnFallingItem
+
SpawnDungeonPrize:
PHX : PHB
TAX
LDA.b $06,S : STA.b ScrapBuffer72 ; Store current RoomTag index
TXA
JSL.l AttemptItemSubstitution
JSL.l ResolveLootIDLong
STA.w ItemReceiptID
TAX
LDA.b #$29 : LDY.b #$06
JSL.l AddAncillaLong
BCS .failed_spawn
LDA.w ItemReceiptID
STA.w AncillaGet,X : STA.w SpriteID,X
JSR.w AddDungeonPrizeAncilla
LDX.b ScrapBuffer72 : STZ.b RoomTag,X
.failed_spawn
PLB : PLX
RTL
;--------------------------------------------------------------------------------
AddDungeonPrizeAncilla:
LDY.w ItemReceiptID
STZ.w AncillaVelocityY,X
STZ.w AncillaVelocityX,X
STZ.w AncillaGeneral,X
STZ.w $0385,X
STZ.w $0C54,X
LDA.b #$D0 : STA.w AncillaVelocityZ,X
LDA.b #$80 : STA.w AncillaZCoord,X
LDA.b #$09 : STA.w AncillaTimer,X
LDA.b #$00 : STA.w $0394,X
LDA.w AncillaGet,X : STA.w ItemReceiptID
LDA.w DungeonID : CMP.b #$14 : BNE .not_hera
LDA.b LinkAbsoluteY+1 : AND.b #$FE
INC A
STA.b Scrap01
STZ.b Scrap00
LDA.b LinkAbsoluteX+1 : AND.b #$FE
INC A
STA.b Scrap03
STZ.b Scrap02
BRA .set_coords_exit
.not_hera
TYA : ASL : TAY
REP #$20
LDA.w #$0078
CLC : ADC.b BG2V
STA.b Scrap00
LDA.w #$0078
CLC : ADC.b BG2H
STA.b Scrap02
SEP #$20
.set_coords_exit
LDA.b Scrap00 : STA.w AncillaCoordYLow,X
LDA.b Scrap01 : STA.w AncillaCoordYHigh,X
LDA.b Scrap02 : STA.w AncillaCoordXLow,X
LDA.b Scrap03 : STA.w AncillaCoordXHigh,X
RTS
PrepPrizeTile:
PHA : PHX : PHY
LDA.w AncillaGet, X
JSL.l AttemptItemSubstitution
JSL.l ResolveLootIDLong
STA.w SpriteID,X
JSL.l TransferItemReceiptToBuffer_using_ReceiptID
PLY : PLX : PLA
RTL
SetItemPose:
PHA
LDA.w DungeonID : BMI .one_handed
LDA.w RoomItemsTaken : BIT.b #$80 : BNE +
.one_handed
PLA
JML $8799F2
+
JSR.w CrystalOrPendantBehavior : BCC .one_handed
.two_handed
PLA
JML $8799EE ; cool pose
SetPrizeCoords:
PHX : PHY
STZ.b Scrap03
LDA.w ItemReceiptMethod : CMP.b #$03 : BEQ +
.regular_coords
PLY : PLX
LDY.w AncillaGet,X
RTL
+
JSR.w CrystalOrPendantBehavior : BCC .regular_coords
PLY : PLX
LDY.b #$20 ; Treat as crystal
RTL
SetCutsceneFlag:
; Out: c - Cutscene flag $02 if set, $01 if unset.
PHX
LDY.b #$01 ; wrote over
LDA.w DungeonID : BMI .no_cutscene
LDA.w RoomItemsTaken : BIT #$80 : BNE .dungeon_prize
.no_cutscene
SEP #$30
PLX
CLC
RTL
.dungeon_prize
LDA.w ItemReceiptMethod : CMP.b #$03 : BCC .no_cutscene
JSR.w SetDungeonCompleted
LDA.w ItemReceiptID
REP #$30
AND.w #$00FF : ASL : TAX
LDA.l InventoryTable_properties,X : BIT.w #$0080 : BEQ .no_cutscene
SEP #$31
PLX
RTL
AnimatePrizeCutscene:
LDA.w ItemReceiptMethod : CMP.b #$03 : BNE +
JSR.w CrystalOrPendantBehavior : BCC +
LDA.w DungeonID : BMI +
LDA.w RoomItemsTaken : BIT #$80 : BEQ +
SEC
RTL
+
CLC
RTL
PrizeDropSparkle:
LDA.w AncillaID,X : CMP.b #$29 : BNE .no_sparkle
JSR.w CrystalOrPendantBehavior : BCC .no_sparkle
SEC
RTL
.no_sparkle
CLC
RTL
HandleDropSFX:
LDA.w RoomItemsTaken : BIT #$80 : BEQ .no_sound
JSR.w CrystalOrPendantBehavior : BCC .no_sound
SEC
RTL
.no_sound
CLC
RTL
HandleCrystalsField:
TAX
LDA.w ItemReceiptID : CMP.b #$20 : BNE .not_crystal
TXA
STA.l CrystalsField
RTL
.not_crystal
RTL
MaybeKeepLootID:
PHA
LDA.w DungeonID : BMI .no_prize
LDA.w RoomItemsTaken : BIT #$80 : BNE .prize
.no_prize
STZ.w ItemReceiptID
STZ.w ItemReceiptPose
PLA
RTL
.prize
STZ.w ItemReceiptPose
PLA
RTL
CheckSpawnPrize:
; In: A - DungeonID
; Out: c - Spawn prize if set
REP #$20
LDX.w DungeonID
LDA.l DungeonItemMasks,X : AND.l DungeonsCompleted : BEQ .spawn
SEP #$20
CLC
RTL
.spawn
SEP #$21
RTL
CheckDungeonCompletion:
LDX.w DungeonID
REP #$20
LDA.l DungeonItemMasks,X : AND.l DungeonsCompleted
SEP #$20
RTL
PendantMusicCheck:
; In: A - Item receipt ID
PHX
TAY
LDA.w ItemReceiptMethod : CMP.b #$03 : BNE .dont_wait
TYA
REP #$30
AND.w #$00FF : ASL : TAX
LDA.l InventoryTable_properties,X : BIT.w #$0080 : BNE .dont_wait
SEP #$31
PLX
RTL
.dont_wait
SEP #$30
PLX
CLC
RTL
PrepPrizeOAMCoordinates:
PHX : PHY
LDY.w AncillaLayer,X
LDA.w $F67F,Y : STA.b $65
STZ.b $64
LDA.w AncillaCoordYLow,X : STA.b Scrap00
LDA.w AncillaCoordYHigh,X : STA.b Scrap01
LDA.w AncillaCoordXLow,X : STA.b Scrap02
LDA.w AncillaCoordXHigh,X : STA.b Scrap03
REP #$20
LDA.b Scrap00
SEC : SBC.w $0122
STA.b Scrap00
LDA.b Scrap02
SEC : SBC.w $011E
STA.b Scrap02
STA.b Scrap04
REP #$20
LDA.w $029E,X
AND.w #$00FF
STA.b $72
LDA.b $00
STA.b $06
SEC
SBC.b $72
STA.b $00
SEP #$20
TXY
LDA.w AncillaGet,X : TAX
LDA.l SpriteProperties_chest_width,X : BNE .wide
TYX
LDA.w AncillaID,X : CMP.b #$3E : BEQ .rising_crystal
REP #$20
LDA.b Scrap00
CLC : ADC.w #$0008
STA.b Scrap08
LDA.b Scrap02
CLC : ADC.w #$0004
STA.b Scrap02 : STA.b Scrap0A
BRA .wide
.rising_crystal
REP #$20
LDA.b Scrap00
CLC : ADC.w #$0008 : STA.b Scrap08
LDA.b Scrap02 : STA.b Scrap0A
.wide
SEP #$20
PLY : PLX
RTL
PrepPrizeShadow:
PHX
LDA.w ItemReceiptID : TAX
LDA.l SpriteProperties_standing_width,X : BNE .wide
LDA.b Scrap02
SEC : SBC.b #$04
STA.b Scrap02
.wide
LDA.b #$20 : STA.b Scrap04 ; What we wrote over
PLX
RTL
CheckPoseItemCoordinates:
PHX
LDA.w ItemReceiptPose : BEQ .done
BIT.b #$02 : BEQ .done
LDA.w AncillaGet,X : TAX
LDA.l SpriteProperties_chest_width,X : BNE .done
LDA.b Scrap02
CLC : ADC.b #$04
STA.b Scrap02
.done
PLX
LDA.w AncillaGet,X
TAX
RTL
CrystalOrPendantBehavior:
; Out: c - Crystal Behavior if set, pendant if unset
PHA : PHX
LDA.w AncillaGet,X
REP #$31
AND.w #$00FF : ASL : TAX
LDA.l InventoryTable_properties,X : BIT.w #$0080 : BNE .crystal_behavior
SEP #$30
PLX : PLA
RTS
.crystal_behavior
SEP #$31
PLX : PLA
RTS
CheckDungeonWorld:
; Maintain vanilla door opening behavior with dungeon prizes
TXA : CMP.b #$05 : BCS .dark_world
REP #$02
RTL
.dark_world
SEP #$02
RTL
SetDungeonCompleted:
LDX.w DungeonID : BMI +
REP #$20
LDA.l DungeonItemMasks, X : ORA.l DungeonsCompleted : STA.l DungeonsCompleted
SEP #$20
+
RTS

141
dungeonmap.asm Normal file
View File

@@ -0,0 +1,141 @@
DoDungeonMapBossIcon:
LDA.b NMISTRIPES
CMP.b #$09
BEQ .dungeonmap
.cave
RTL
.dungeonmap
LDX.w DungeonID
BMI .cave
; get dungeon boss room
++ REP #$30
LDA.l $8AE817,X
ASL
TAX
; get sprite pointer for room
LDA.l $89D62E,X
INC ; to skip the "sort"
TAX
; get first byte to make sure it isn't an empty room
SEP #$20
LDA.l $890000,X
CMP.b #$FF
BNE ++
SEP #$30
BRA .cave
; check first sprite
++ LDA.l $890002,X
SEP #$10
; match boss id
LDX.b #$0B
-- CMP.l .boss_id,X
BEQ .match
DEX
BPL --
TXA
BRA .cave
.match
LDA.b #$80
STA.w CGADD
REP #$30
TXA
ASL ; x32 for palette data
ASL
ASL
ASL
ASL
TAX
; prep dma
ASL ; x128 for graphics
ASL
ADC.w #BossMapIconGFX
STA.w A1T1L
PHY
LDY.w #32
SEP #$20
-- LDA.l .boss_palettes,X
STA.w CGDATA
INX
DEY
BNE --
PLY
; GFX DMA
REP #$20
SEP #$10
LDA.w #$1801
STA.w DMAP1
LDX.b #BossMapIconGFX>>16
STX.w A1B1
LDA.w #$A060>>1
STA.w VMADDL
LDA.w #$0040
STA.w DAS1L
LDX.b #$02
STX.w MDMAEN
STA.w DAS1L
LDA.w #$A260>>1
STA.w VMADDL
STX.w MDMAEN
; done
SEP #$30
RTL
.boss_id
db $53 ; armos
db $54 ; lanmolas
db $09 ; moldorm
db $7A ; agahnim
db $92 ; helma king
db $8C ; arrghus
db $88 ; mothula
db $CE ; blind
db $A3 ; khold shell
db $BD ; vitreous
db $CB ; trinexx
db $D6 ; ganon
.boss_palettes
dw hexto555($000000), hexto555($F8F8F8), hexto555($D86060), hexto555($5070C8), hexto555($B090F8), hexto555($282828), hexto555($F0A068), hexto555($B06028), hexto555($B88820), hexto555($E8A800), hexto555($F8F8F8), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000)
dw hexto555($000000), hexto555($F8F8F8), hexto555($50C090), hexto555($408858), hexto555($305830), hexto555($282828), hexto555($D8A800), hexto555($E06018), hexto555($787040), hexto555($585030), hexto555($484018), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000)
dw hexto555($000000), hexto555($F8F8F8), hexto555($903018), hexto555($D85800), hexto555($F8A828), hexto555($282828), hexto555($E88068), hexto555($B04038), hexto555($F8D018), hexto555($C8B818), hexto555($A89818), hexto555($806818), hexto555($503818), hexto555($000000), hexto555($000000), hexto555($000000)
dw hexto555($000000), hexto555($F8F8F8), hexto555($C04080), hexto555($B08828), hexto555($E8C070), hexto555($282828), hexto555($90D038), hexto555($688020), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000)
dw hexto555($000000), hexto555($F8F8F8), hexto555($4848B0), hexto555($7870E8), hexto555($A8A8F8), hexto555($282828), hexto555($F8F8F8), hexto555($181818), hexto555($A00028), hexto555($D03828), hexto555($E88820), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000)
dw hexto555($000000), hexto555($F8F8F8), hexto555($903018), hexto555($D85800), hexto555($F8A828), hexto555($282828), hexto555($E88068), hexto555($B04038), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000)
dw hexto555($000000), hexto555($F8F8F8), hexto555($4848B0), hexto555($7870E8), hexto555($A8A8F8), hexto555($282828), hexto555($F8A840), hexto555($D85820), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000)
dw hexto555($000000), hexto555($F8F8F8), hexto555($903018), hexto555($D85800), hexto555($F8A828), hexto555($282828), hexto555($E88068), hexto555($B04038), hexto555($88D0F8), hexto555($7890F8), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000)
dw hexto555($000000), hexto555($F8F8F8), hexto555($4828C8), hexto555($4828F0), hexto555($8070F8), hexto555($282828), hexto555($F8C8F8), hexto555($E088B0), hexto555($7098C0), hexto555($58B0E8), hexto555($D0F8F8), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000)
dw hexto555($000000), hexto555($F8F8F8), hexto555($50C090), hexto555($408858), hexto555($305830), hexto555($282828), hexto555($D8A800), hexto555($E06018), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000)
dw hexto555($000000), hexto555($F8F8F8), hexto555($4848B0), hexto555($7870E8), hexto555($A8A8F8), hexto555($282828), hexto555($989868), hexto555($78C0A8), hexto555($A00028), hexto555($D03828), hexto555($E88820), hexto555($503860), hexto555($505060), hexto555($788890), hexto555($484868), hexto555($707068)
dw hexto555($000000), hexto555($F8F8F8), hexto555($B090F8), hexto555($C0A028), hexto555($886008), hexto555($282828), hexto555($B83010), hexto555($E86040), hexto555($385088), hexto555($5088A8), hexto555($88C8A0), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000)

View File

@@ -1,11 +1,11 @@
NewElderCode:
{
LDA $8A : CMP #$1B : BEQ .newCodeContinue
LDA.b OverworldIndex : CMP.b #$1B : BEQ .newCodeContinue
;Restore Jump we can keep the RTL so JML
JML $05F0CD
JML $85F0CD
.newCodeContinue
PHB : PHK : PLB
LDA.b #$07 : STA $0F50, X ;Palette
LDA.b #$07 : STA.w SpriteOAMProp, X ; Palette
JSR Elder_Draw
JSL Sprite_PlayerCantPassThrough
JSR Elder_Code
@@ -17,12 +17,12 @@ RTL
Elder_Draw:
{
LDA.b #$02 : STA $06 : STZ $07 ;Number of Tiles
LDA.b #$02 : STA.b Scrap06 : STZ.b Scrap07 ;Number of Tiles
LDA $0DC0, X : ASL #04
LDA.w SpriteGFXControl, X : ASL #04
ADC.b #.animation_states : STA $08
LDA.b #.animation_states>>8 : ADC.b #$00 : STA $09
ADC.b #.animation_states : STA.b Scrap08
LDA.b #.animation_states>>8 : ADC.b #$00 : STA.b Scrap09
JSL Sprite_DrawMultiple_player_deferred
JSL Sprite_DrawShadowLong
@@ -40,24 +40,32 @@ RTL
Elder_Code:
{
LDA GoalItemRequirement : BEQ .despawn
LDA TurnInGoalItems : BNE +
REP #$20
LDA.l GoalItemRequirement : BEQ .despawn
LDA.l GanonVulnerableMode : AND.w #$00FF : CMP.w #$0005 : BEQ .despawn
LDA.l TurnInGoalItems : AND.w #$00FF : BNE +
.despawn
STZ $0DD0, X ; despawn self
SEP #$20
STZ.w SpriteAITable, X ; despawn self
RTS
+
SEP #$20
LDA.b GameSubMode
BNE .done
LDA.b #$96
LDY.b #$01
JSL Sprite_ShowSolicitedMessageIfPlayerFacing_PreserveMessage : BCC .dont_show
LDA !GOAL_COUNTER
CMP GoalItemRequirement : !BLT +
REP #$20
LDA.l GoalCounter
CMP.l GoalItemRequirement : !BLT +
SEP #$20
JSL.l ActivateGoal
+
.dont_show
.done
LDA $1A : LSR #5 : AND.b #$01 : STA $0DC0, X
SEP #$20
LDA.b FrameCounter : LSR #5 : AND.b #$01 : STA.w SpriteGFXControl, X
RTS
}
}

View File

@@ -1,22 +0,0 @@
;================================================================================
; Dialog Pointer Override
;--------------------------------------------------------------------------------
EndingSequenceTableOverride:
PHY
PHX
TYX
LDA.l EndingSequenceText, X
PLX
STA $1008, X
PLY
RTL
;--------------------------------------------------------------------------------
EndingSequenceTableLookupOverride:
PHY
PHX
TYX
LDA.l EndingSequenceText, X : AND #$00FF
PLX
PLY
RTL
;--------------------------------------------------------------------------------

View File

@@ -3,28 +3,25 @@
; make sure bats always load LW stats
;--------------------------------------------------------------------------------
NewBatInit:
CPY.b #$00 : BEQ .light_world
;check if map id == 240 or 241
LDA $A0 : CMP #$F0 : BNE + ;oldman cave1
BRA .light_world
+
CMP #$F1 : BNE + ;oldman cave2
BRA .light_world
+
CMP #$B0 : BNE + ;agahnim statue keese
BRA .light_world
+
CMP #$D0 : BNE + ;agahnim darkmaze
BRA .light_world
+
LDA.b RoomIndex : CMP.b #$F0 : BEQ .light_world ;oldman cave1
CMP.b #$F1 : BEQ .light_world ;oldman cave2
CMP.b #$B0 : BEQ .light_world ;agahnim statue keese
CMP.b #$D0 : BEQ .light_world ;agahnim darkmaze
CPY #$00 : BEQ .light_world
LDA.b #$85 : STA $0CD2, X
LDA.b #$04 : STA $0E50, X
LDA.b #$85 : STA.w SpriteBump, X
LDA.b #$04 : STA.w SpriteHitPoints, X
RTL
.light_world
LDA.b #$80 : STA $0CD2, X
LDA.b #$01 : STA $0E50, X
LDA.b #$80 : STA.w SpriteBump, X
LDA.b #$01 : STA.w SpriteHitPoints, X
RTL
;--------------------------------------------------------------------------------
NewFireBarDamage:
LDA.b LinkLayer : CMP.w SpriteLayer, X : BNE .NotSameLayer
JSL Sprite_AttemptDamageToPlayerPlusRecoilLong
RTL
.NotSameLayer
RTL

View File

@@ -8,29 +8,30 @@ LockAgahnimDoors:
;#$0 = Never Locked
LDA.w #$0000 : RTL
+ : CMP.w #$0001 : BNE +
LDA $7EF3C5 : AND.w #$000F : CMP.w #$0002 : !BGE .unlock ; if we rescued zelda, skip
LDA.l ProgressIndicator : AND.w #$000F : CMP.w #$0002 : !BGE .unlock ; if we rescued zelda, skip
JSR.w LockAgahnimDoorsCore : RTL
+ : CMP.w #$0002 : BNE +
JSR.w LockAgahnimDoorsCore : BEQ .unlock
PHX : PHY
SEP #$30
JSL.l CheckEnoughCrystalsForTower
JSL.l CheckTowerOpen
REP #$30
PLY : PLX
!BGE .crystalOrUnlock
LDA #$0001 : RTL
LDA.w #$0001 : RTL
.crystalOrUnlock
LDA InvertedMode : AND.w #$00FF : BEQ .unlock
LDA.l InvertedMode : AND.w #$00FF : BEQ .unlock
LDA $7EF2C3 : 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
LDA #$0001 : RTL ;Keep the door locked
LDA.l OverworldEventDataWRAM+$43 : AND.w #$0020 : BNE .unlock ; Check if GT overlay is already on or not
LDA.w AButtonAct : AND.w #$0080 : BEQ ++ ;If we are holding an item
.locked
LDA.w #$0001 : RTL ;Keep the door locked
++
SEP #$30
JSL $099B6F ;Add tower break seal
LDA $7EF2C3 : ORA #$20 : STA $7EF2C3 ; activate GT overlay
JSL $899B6F ;Add tower break seal
REP #$30
LDA #$0001 ;Prevent door from opening that frame otherwise it glitchy
LDA.w #$0001 ;Prevent door from opening that frame otherwise it glitchy
RTL
+
@@ -39,11 +40,22 @@ LockAgahnimDoors:
LDA.w #$0000 ; fallback to never locked
RTL
;---------------------------------------------------------------------------------
FlagAgahnimDoor:
LDA.l InvertedMode : BEQ .vanilla
LDA.l OverworldEventDataWRAM+$43 : ORA.b #$20 : STA.l OverworldEventDataWRAM+$43 ; activate GT overlay
.vanilla
LDA.b #$28 : STA.b ScrapBuffer72
RTL
;--------------------------------------------------------------------------------
LockAgahnimDoorsCore:
LDA $22 : CMP.w #1992 : !BLT + ; door too far left, skip
LDA.b LinkPosX : CMP.w #1992 : !BLT + ; door too far left, skip
CMP.w #2088 : !BGE + ; door too rat right, skip
LDA $20 : CMP.w #1720 : !BGE + ; door too low, skip
LDA.b LinkPosY : CMP.w #1720 : !BGE + ; door too low, skip
LDA.w #$0001
RTS
+
@@ -65,57 +77,56 @@ JML.l Overworld_Entrance_BRANCH_RHO
AllowStartFromSingleEntranceCave:
; 16 Bit A, 16 bit XY
; do not need to preserve A or X or Y
LDA $7EF3C8 : AND.w #$00FF ; What we wrote over
LDA.l StartingEntrance : AND.w #$00FF ; What we wrote over
PHA
TAX
LDA.l StartingAreaExitOffset, X
AND.w #$00FF
BNE +
BRL .done
JMP .done
+
DEC
STA $00
ASL #2 : !ADD $00 : ASL #2 ; mult by 20
STA.b Scrap00
ASL #2 : !ADD Scrap00 : ASL #2 ; mult by 20
TAX
LDA #$0016 : STA $7EC142 ; Cache the main screen designation
LDA.l StartingAreaExitTable+$05, X : STA $7EC144 ; Cache BG1 V scroll
LDA.l StartingAreaExitTable+$07, X : STA $7EC146 ; Cache BG1 H scroll
LDA.l StartingAreaExitTable+$09, X : !ADD.w #$0010 : STA $7EC148 ; Cache Link's Y coordinate
LDA.l StartingAreaExitTable+$0B, X : STA $7EC14A ; Cache Link's X coordinate
LDA.l StartingAreaExitTable+$0D, X : STA $7EC150 ; Cache Camera Y coord lower bound.
LDA.l StartingAreaExitTable+$0F, X : STA $7EC152 ; Cache Camera X coord lower bound.
LDA.l StartingAreaExitTable+$03, X : STA $7EC14E ; Cache Link VRAM Location
LDA.w #$0016 : STA.l EN_MAINDESQ ; Cache the main screen designation
LDA.l StartingAreaExitTable+$05, X : STA.l EN_BG2VERT ; Cache BG1 V scroll
LDA.l StartingAreaExitTable+$07, X : STA.l EN_BG2HORZ ; Cache BG1 H scroll
LDA.l StartingAreaExitTable+$09, X : !ADD.w #$0010 : STA.l EN_POSY ; Cache Link's Y coordinate
LDA.l StartingAreaExitTable+$0B, X : STA.l EN_POSX ; Cache Link's X coordinate
LDA.l StartingAreaExitTable+$0D, X : STA.l EN_SCROLLATN ; Cache Camera Y coord lower bound.
LDA.l StartingAreaExitTable+$0F, X : STA.l EN_SCROLLATW ; Cache Camera X coord lower bound.
LDA.l StartingAreaExitTable+$03, X : STA.l EN_OWTMAPI ; Cache Link VRAM Location
; Handle the 2 "unknown" bytes, which control what area of the backgound
; relative to the camera? gets loaded with new tile data as the player moves around
; (because some overworld areas like Kak are too big for a single VRAM tilemap)
LDA.l StartingAreaExitTable+$11, X : AND.w #$00FF
BIT.w #$0080 : BEQ + : ORA #$FF00 : + ; Sign extend
STA.l $7EC16A
BIT.w #$0080 : BEQ + : ORA.w #$FF00 : + ; Sign extend
STA.l EN_SCRMODYA
LDA.l StartingAreaExitTable+$12, X : AND.w #$00FF
BIT.w #$0080 : BEQ + : ORA #$FF00 : + ; Sign extend
STA.l $7EC16E
BIT.w #$0080 : BEQ + : ORA.w #$FF00 : + ; Sign extend
STA.l EN_SCRMODXA
LDA.w #$0000 : !SUB.l $7EC16A : STA $7EC16C
LDA.w #$0000 : !SUB.l $7EC16E : STA $7EC170
LDA.w #$0000 : !SUB.l EN_SCRMODYA : STA.l EN_SCRMODYB
LDA.w #$0000 : !SUB.l EN_SCRMODXA : STA.l EN_SCRMODXB
LDA.l StartingAreaExitTable+$02, X : AND.w #$00FF
STA $7EC14C ; Cache the overworld area number
STA $7EC140 ; Cache the aux overworld area number
STA.l EN_OWSCR ; Cache the overworld area number
STA.l EN_OWSCR2 ; Cache the aux overworld area number
STZ $0698 ;zero out door overlays in case starting overworld door is not set
STZ $0699 ;zero out door overlays in case starting overworld door is not set
STZ.w TileMapTile32 ;zero out door overlays in case starting overworld door is not set
STZ.w TileMapTile32+1 ;zero out door overlays in case starting overworld door is not set
SEP #$20 ; set 8-bit accumulator
LDX $00
LDA.l StartingAreaOverworldDoor, X : STA.l $7F5099 ;Load overworld door
LDA.l StartingEntrance : TAX
LDA.l StartingAreaOverworldDoor, X : STA.l PreviousOverworldDoor ;Load overworld door
REP #$20 ; reset 16-bit accumulator
JSL.l CacheDoorFrameData
.done
PLA
@@ -123,50 +134,50 @@ RTL
;--------------------------------------------------------------------------------
AllowStartFromExit:
LDX $1CE8
LDX.w MessageCursor
LDA.l ShouldStartatExit, X : BNE .doStart
LDA.l $7EF3C8 ; what we wrote over
LDA.l StartingEntrance ; what we wrote over
JML.l AllowStartFromExitReturn
.doStart
LDA.l $028481, X ;Module_LocationMenu_starting_points
LDA.l $828481, X ;Module_LocationMenu_starting_points
ASL : TAX
LDA.l $02D8D2, X : STA $A0
LDA.l $02D8D3, X : STA $A1
LDA.l $82D8D2, X : STA.b RoomIndex
LDA.l $82D8D3, X : STA.b RoomIndex+1
; Go to pre-overworld mode
LDA.b #$08 : STA $10
LDA.b #$08 : STA.b GameMode
STZ $11
STZ $B0
STZ.b GameSubMode
STZ.b SubSubModule
STZ.w DeathReloadFlag
STZ.w RespawnFlag
LDA.b #$01 : STA.l UpdateHUDFlag
STZ $010A
STZ $04AA
JSL Equipment_SearchForEquippedItemLong
JSL HUD_RebuildLong2
JSL $0DDD32 ; Equipment_UpdateEquippedItemLong
JSL Equipment_UpdateEquippedItemLong
RTL
;--------------------------------------------------------------------------------
CheckHole:
LDX.w #$0024
.nextHoleClassic
LDA.b $00 : CMP.l $1BB800, X
LDA.b Scrap00 : CMP.l $9BB800, X
BNE .wrongMap16Classic
LDA.w $040A : CMP.l $1BB826, X
LDA.b OverworldIndex : CMP.l $9BB826, X
BEQ .matchedHoleClassic
.wrongMap16Classic
DEX #2 : BPL .nextHoleClassic
LDX.w #$001E
.nextHoleExtra
LDA.b $00 : CMP.l ExtraHole_Map16, X
LDA.b Scrap00 : CMP.l ExtraHole_Map16, X
BNE .wrongMap16Extra
LDA.w $040A : CMP.l ExtraHole_Area, X
LDA.b OverworldIndex : CMP.l ExtraHole_Area, X
BEQ .matchedHoleExtra
.wrongMap16Extra
DEX #2 : BPL .nextHoleExtra
@@ -177,14 +188,14 @@ CheckHole:
.matchedHoleExtra
SEP #$30
TXA : LSR A : TAX
LDA.l ExtraHole_Entrance, X : STA.w $010E : STZ.w $010F
LDA.l ExtraHole_Entrance, X : STA.w EntranceIndex : STZ.w EntranceIndex+1
JML Overworld_Hole_End
;--------------------------------------------------------------------------------
PreventEnterOnBonk:
STA $00 ; part of what we wrote over
STA.b Scrap00 ; part of what we wrote over
LDA.l InvertedMode : AND.w #$00FF : 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 LinkState : AND.w #$00FF : CMP.w #$0014 : BNE .done ;in mirror mode?
LDA.b OverworldIndex : AND.w #$0040 : CMP.b WorldCache : BEQ .done ; Are we bonking, or doing the superbunny glitch?
; If in inverted, are in mirror mode, and are bonking then do not enter
JML.l PreventEnterOnBonk_BRANCH_IX
@@ -194,24 +205,24 @@ PreventEnterOnBonk:
JML.l PreventEnterOnBonk_return
;--------------------------------------------------------------------------------
TurtleRockEntranceFix:
LDA TurtleRockAutoOpenFix : BEQ .done
LDA $8A : CMP.b #$47 : BNE .done
LDA.l TurtleRockAutoOpenFix : BEQ .done
LDA.b OverworldIndex : CMP.b #$47 : BNE .done
;If exiting to turtle rock ensure the entrance is open
LDA.l $7EF2C7 : ORA.b #$20 : STA.l $7EF2C7
LDA.l OverworldEventDataWRAM+$47 : ORA.b #$20 : STA.l OverworldEventDataWRAM+$47
.done
RTL
;--------------------------------------------------------------------------------
AnimatedEntranceFix: ;when an entrance animation tries to start
PHA
LDA.l InvertedMode : BEQ + ;If we are in inverted mode
LDA $8A : AND.b #$40 : BNE + ;and in the light world
LDA.b OverworldIndex : AND.b #$40 : BNE + ;and in the light world
PLA
STZ $04C6 ; skip it.
LDA #$00
STZ.w OWEntranceCutscene ; skip it.
LDA.b #$00
RTL
+
PLA
STA $02E4 ;what we wrote over
STA $0FC1 ;what we wrote over
STA $0710 ;what we wrote over
STA.w CutsceneFlag ;what we wrote over
STA.w FreezeSprites ;what we wrote over
STA.w SkipOAM ;what we wrote over
RTL

View File

@@ -1,29 +1,33 @@
;--------------------------------------------------------------------------------
; OnLoadOW
;--------------------------------------------------------------------------------
;OnLoadMap:
; LDA $7EF2DB ; thing we wrote over
;RTL
;--------------------------------------------------------------------------------
OnPrepFileSelect:
LDA $11 : CMP.b #$03 : BNE +
LDA.b #$06 : STA $14 ; thing we wrote over
RTL
+
JSL.l LoadAlphabetTilemap
JSL.l LoadFullItemTiles
LDA.b GameSubMode : CMP.b #$03 : BNE +
LDA.b #$06 : STA.b NMISTRIPES ; thing we wrote over
RTL
+
PHA : PHX
REP #$10
JSL.l LoadAlphabetTilemap
JSL.l LoadFullItemTiles
SEP #$10
PLX : PLA
RTL
;--------------------------------------------------------------------------------
OnDrawHud:
JSL.l DrawChallengeTimer ; this has to come before NewDrawHud because the timer overwrites the compass counter
JSL.l NewDrawHud
JSL.l SwapSpriteIfNecissary
JSL.l SwapSpriteIfNecessary
JSL.l CuccoStorm
JSL.l PollService
JML.l ReturnFromOnDrawHud
;--------------------------------------------------------------------------------
;OnDungeonEntrance:
; STA $7EC172 ; thing we wrote over
;RTL
OnDungeonEntrance:
STA.l PegColor ; thing we wrote over
JSL MaybeFlagDungeonTotalsEntrance
LDA.w #$0001 : STA.l UpdateHUDFlag
RTL
;--------------------------------------------------------------------------------
OnDungeonBossExit:
JSL.l StatTransitionCounter
RTL
;--------------------------------------------------------------------------------
OnPlayerDead:
PHA
@@ -34,73 +38,125 @@ OnPlayerDead:
RTL
;--------------------------------------------------------------------------------
OnDungeonExit:
PHA : PHP
SEP #$20 ; set 8-bit accumulator
JSL.l PodEGFix
PLP : PLA
PHA : PHP
SEP #$20 ; set 8-bit accumulator
JSL.l SQEGFix
PLP : PLA
STA $040C : STZ $04AC ; thing we wrote over
STA.w DungeonID : STZ.w Map16ChangeIndex ; thing we wrote over
PHA : PHP
JSL.l HUD_RebuildLong
JSL.l FloodGateResetInner
JSL.l SetSilverBowMode
PLP : PLA
PHA : PHP
LDA.w #$0001 : STA.l UpdateHUDFlag
JSL.l HUD_RebuildLong
JSL.l FloodGateResetInner
JSL.l SetSilverBowMode
PLP : PLA
RTL
;--------------------------------------------------------------------------------
OnQuit:
JSL.l PodEGFix
LDA.b #$10 : STA $1C ; thing we wrote over
JSL.l SQEGFix
LDA.b #$00 : STA.l AltTextFlag ; bandaid patch bug with mirroring away from text
LDA.b #$10 : STA.b MAINDESQ ; thing we wrote over
RTL
;--------------------------------------------------------------------------------
OnUncleItemGet:
JSL Link_ReceiveItem
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.l InfiniteMagic : +
BIT.b #$02 : BEQ + : STA.l InfiniteBombs : +
BIT.b #$01 : BEQ + : STA.l InfiniteArrows : +
LDA.l UncleRefill : BIT.b #$04 : BEQ + : LDA.b #$80 : STA $7EF373 : + ; refill magic
LDA.l UncleRefill : BIT.b #$02 : BEQ + : LDA.b #50 : STA $7EF375 : + ; refill bombs
PLA
JSL.l Link_ReceiveItem
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 $7EF376
LDA.b #70 : STA.l ArrowsFiller
LDA.l ArrowMode : BEQ +
LDA !INVENTORY_SWAP_2 : ORA #$80 : STA !INVENTORY_SWAP_2 ; enable bow toggle
LDA.l BowTracking : ORA.b #$80 : STA.l BowTracking ; enable bow toggle
REP #$20 ; set 16-bit accumulator
LDA $7EF360 : !ADD.l FreeUncleItemAmount : STA $7EF360 ; rupee arrows, so also give the player some money to start
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
+
RTL
;--------------------------------------------------------------------------------
OnAga1Defeated:
STA.l ProgressIndicator ; vanilla game state stuff we overwrote
LDA.l GanonVulnerableMode
CMP.b #$06 : BNE +
.light_speed
REP #$20
LDA.w #$0019 : STA.b GameMode
SEP #$20
+
LDA.b #$08 : CMP.w DungeonID : BNE +
ORA.l DungeonsCompleted+1 : STA.l DungeonsCompleted+1
+
.exit
RTL
;--------------------------------------------------------------------------------
OnAga2Defeated:
JSL.l Dungeon_SaveRoomData_justKeys ; thing we wrote over, make sure this is first
JSL.l IncrementAgahnim2Sword
RTL
JSL.l Dungeon_SaveRoomData_justKeys ; thing we wrote over, make sure this is first
LDA.b #$01 : STA.l Aga2Duck
LDA.w DungeonID : CMP.b #$1A : BNE +
LDA.l DungeonsCompleted : ORA.b #$04 : STA.l DungeonsCompleted
+
LDA.b #$FF : STA.w DungeonID
JML.l IncrementAgahnim2Sword
;--------------------------------------------------------------------------------
OnFileCreation:
PHB
LDA.w #$03D7
LDX.w #$B000
LDY.w #$0000
MVN CartridgeSRAM>>16, InitSRAMTable>>16
; Skip file name and validity value
LDA.w #$010C
LDX.w #$B3E3
LDY.w #$03E3
MVN CartridgeSRAM>>16, InitSRAMTable>>16
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
; Set validity value and do some cleanup. Jump to checksum done.
LDA.w #$55AA : STA.l FileValiditySRAM
JSL.l WriteSaveChecksumAndBackup
STZ.b Scrap00
STZ.b Scrap01
JML.l InitializeSaveFile_checksum_done
;--------------------------------------------------------------------------------
!RNG_ITEM_LOCK_IN = "$7F5090"
OnFileLoad:
REP #$10 ; set 16 bit index registers
JSL.l EnableForceBlank ; what we wrote over
LDA.b #$07 : STA $210c ; Restore screen 3 to normal tile area
LDA.b #$07 : STA.w BG34NBA ; Restore screen 3 to normal tile area
LDA !FRESH_FILE_MARKER : BNE +
LDA.l FileMarker : BNE +
JSL.l OnNewFile
LDA.b #$FF : STA !FRESH_FILE_MARKER
LDA.b #$FF : STA.l FileMarker
+
LDA.w $010A : BNE + ; don't adjust the worlds for "continue" or "save-continue"
LDA.l $7EC011 : BNE + ; don't adjust worlds if mosiac is enabled (Read: mirroring in dungeon)
LDA.w DeathReloadFlag : BNE + ; don't adjust the worlds for "continue" or "save-continue"
LDA.l MosaicLevel : BNE + ; don't adjust worlds if mosiac is enabled (Read: mirroring in dungeon)
JSL.l DoWorldFix
+
JSL.l MasterSwordFollowerClear
JSL.l InitOpenMode
LDA #$FF : STA !RNG_ITEM_LOCK_IN ; reset rng item lock-in
LDA #$00 : STA $7F5001 ; mark fake flipper softlock as impossible
LDA.b #$FF : STA.l RNGLockIn ; reset rng item lock-in
LDA.l GenericKeys : BEQ +
LDA $7EF38B : STA $7EF36F ; copy generic keys to key counter
LDA.l CurrentGenericKeys : STA.l CurrentSmallKeys ; copy generic keys to key counter
+
JSL.l SetSilverBowMode
@@ -113,107 +169,128 @@ OnFileLoad:
SEP #$10 ; restore 8 bit index registers
RTL
;--------------------------------------------------------------------------------
!RNG_ITEM_LOCK_IN = "$7F5090"
OnNewFile:
PHX : PHP
REP #$20 ; set 16-bit accumulator
LDA.l LinkStartingRupees : STA $7EF362 : STA $7EF360
LDA.l StartingTime : STA $7EF454
LDA.l StartingTime+2 : STA $7EF454+2
LDX.w #$004E : - ; copy over starting equipment
LDA StartingEquipment, X : STA $7EF340, X
DEX : DEX
BPL -
; reset some values on new file that are otherwise only reset on hard reset
SEP #$20 ; set 8-bit accumulator
;LDA #$FF : STA !RNG_ITEM_LOCK_IN ; reset rng item lock-in
LDA.l PreopenCurtains : BEQ +
LDA.b #$80 : STA $7EF061 ; open aga tower curtain
LDA.b #$80 : STA $7EF093 ; open skull woods curtain
+
LDA.l PreopenPyramid : BEQ +
LDA.b #$20 : STA $7EF2DB ; pyramid hole already open
+
LDA.l PreopenGanonsTower : BEQ +
LDA.b #$20 : STA $7EF2C3 ; Ganons Tower already open
+
LDA StartingSword : STA $7EF359 ; set starting sword type
STZ.w AncillaSearch
STZ.w LayerAdjustment ; EG
STZ.w ArcVariable : STZ.w ArcVariable+1
STZ.w TreePullKills
STZ.w TreePullHits
STZ.w PrizePackIndexes
STZ.w PrizePackIndexes+1
STZ.w PrizePackIndexes+2
STZ.w PrizePackIndexes+3
STZ.w PrizePackIndexes+4
STZ.w PrizePackIndexes+5
STZ.w PrizePackIndexes+6
LDA.b #$00 : STA.l MosaicLevel
JSL InitRNGPointerTable
PLP : PLX
RTL
;--------------------------------------------------------------------------------
OnInitFileSelect:
; LDA.b #$10 : STA $BC ; init sprite pointer - does nothing unless spriteswap.asm is included
; JSL.l SpriteSwap_SetSprite
LDA.b #$51 : STA $0AA2 ;<-- Line missing from JP1.0, needed to ensure "extra" copy of naming screen graphics are loaded.
LDA.b #$51 : STA.w $0AA2 ;<-- Line missing from JP1.0, needed to ensure "extra" copy of naming screen graphics are loaded.
JSL.l EnableForceBlank
RTL
;--------------------------------------------------------------------------------
OnLinkDamaged:
JSL.l FlipperKill
JSL.l OHKOTimer
RTL
JSL.l IncrementDamageTakenCounter_Arb
JML.l OHKOTimer
;--------------------------------------------------------------------------------
OnEnterWater:
JSL.l RegisterWaterEntryScreen
JSL.l MysteryWaterFunction
LDX.b #$04
RTL
;OnEnterWater:
; JSL.l UnequipCapeQuiet ; what we wrote over
;RTL
;--------------------------------------------------------------------------------
OnLinkDamagedFromPit:
JSL.l OHKOTimer
LDA.b #$14 : STA $11 ; thing we wrote over
RTL
LDA.l AllowAccidentalMajorGlitch
BEQ ++
-- LDA.b #$14 : STA.b GameSubMode ; thing we wrote over
RTL
++ LDA.b GameMode : CMP.b #$12 : BNE --
STZ.b GameSubMode
RTL
;--------------------------------------------------------------------------------
OnLinkDamagedFromPitOutdoors:
JSL.l OHKOTimer ; make sure this is last
RTL
JML.l OHKOTimer ; make sure this is last
;--------------------------------------------------------------------------------
!RNG_ITEM_LOCK_IN = "$7F5090"
OnOWTransition:
JSL.l FloodGateReset
JSL.l FlipperFlag
JSL.l StatTransitionCounter
PHP
SEP #$20 ; set 8-bit accumulator
LDA.b #$FF : STA !RNG_ITEM_LOCK_IN ; clear lock-in
PLP
JSL.l FloodGateReset
JSL.l StatTransitionCounter
PHP
SEP #$20 ; set 8-bit accumulator
LDA.b #$FF : STA.l RNGLockIn ; clear lock-in
LDA.b #$01 : STA.l UpdateHUDFlag
PLP
RTL
;--------------------------------------------------------------------------------
!DARK_DUCK_TEMP = "$7F509C"
OnLoadDuckMap:
LDA !DARK_DUCK_TEMP
LDA.l DuckMapFlag
BNE +
INC : STA !DARK_DUCK_TEMP
JSL OverworldMap_InitGfx : DEC $0200
INC : STA.l DuckMapFlag
JSL OverworldMap_InitGfx : DEC.w SubModuleInterface
RTL
+
LDA.b #$00 : STA !DARK_DUCK_TEMP
JSL OverworldMap_DarkWorldTilemap
RTL
LDA.b #$00 : STA.l DuckMapFlag
JML OverworldMap_DarkWorldTilemap
;--------------------------------------------------------------------------------
PreItemGet:
LDA.b #$01 : STA !ITEM_BUSY ; mark item as busy
LDA.b #$01 : STA.l BusyItem ; mark item as busy
RTL
;--------------------------------------------------------------------------------
PostItemGet:
JSL.l MaybeWriteSRAMTrace
STZ.w ShopPurchaseFlag
LDA.w ItemReceiptMethod : CMP.b #$01 : BEQ +
LDX.w CurrentSpriteSlot
STZ.w SpriteMetaData,X
+
RTL
;--------------------------------------------------------------------------------
PostItemAnimation:
LDA.b #$00 : STA !ITEM_BUSY ; mark item as finished
PHB
LDA.b #$00 : STA.l BusyItem ; mark item as finished
LDA.l TextBoxDefer : BEQ +
STZ.w TextID : STZ.w TextID+1 ; reset decompression buffer
JSL.l Main_ShowTextMessage_Alt
LDA.b #$00 : STA.l TextBoxDefer
+
LDA.w ItemReceiptMethod : CMP.b #$01 : BNE +
LDA.b LinkDirection : BEQ +
JSL.l IncrementChestTurnCounter
+
REP #$20
PEA.w $7E00
PLB : PLB
LDA.w TransparencyFlag : BNE .SP05
LDA.l PalettesCustom_off_black+$00 : STA.w PaletteBuffer+$0170 : STA.w PaletteBufferAux+$0170
LDA.l PalettesCustom_off_black+$02 : STA.w PaletteBuffer+$0172 : STA.w PaletteBufferAux+$0172
STA.w PaletteBuffer+$0174 : STA.w PaletteBufferAux+$0174
STA.w PaletteBuffer+$0176 : STA.w PaletteBufferAux+$0176
STA.w PaletteBuffer+$0178 : STA.w PaletteBufferAux+$0178
STA.w PaletteBuffer+$017A : STA.w PaletteBufferAux+$017A
STA.w PaletteBuffer+$017C : STA.w PaletteBufferAux+$017C
STA.w PaletteBuffer+$017E : STA.w PaletteBufferAux+$017E
BRA .done
.SP05
LDA.l PalettesCustom_off_black+$00 : STA.w PaletteBuffer+$01B0 : STA.w PaletteBufferAux+$01B0
LDA.l PalettesCustom_off_black+$02 : STA.w PaletteBuffer+$01B2 : STA.w PaletteBufferAux+$01B2
STA.w PaletteBuffer+$01B4 : STA.w PaletteBufferAux+$01B4
STA.w PaletteBuffer+$01B6 : STA.w PaletteBufferAux+$01B6
STA.w PaletteBuffer+$01B8 : STA.w PaletteBufferAux+$01B8
STA.w PaletteBuffer+$01BA : STA.w PaletteBufferAux+$01BA
STA.w PaletteBuffer+$01BC : STA.w PaletteBufferAux+$01BC
STA.w PaletteBuffer+$01BE : STA.w PaletteBufferAux+$01BE
.done
INC.b NMICGRAM
SEP #$20
LDA $7F509F : BEQ +
STZ $1CF0 : STZ $1CF1 ; reset decompression buffer
JSL.l Main_ShowTextMessage_Alt
LDA.b #$00 : STA $7F509F
+
STZ $02E9 : LDA $0C5E, X ; thing we wrote over to get here
STZ.w ItemReceiptMethod : LDA.w AncillaGet, X ; thing we wrote over to get here
PLB
RTL
;--------------------------------------------------------------------------------

View File

@@ -1,4 +1,4 @@
org $298000 ; 0x148000
org $A98000 ; 0x148000
Ext_OnFileCreate: ;x
RTL : RTL : RTL : RTL : RTL
Ext_OnFileLoad: ;x immediately after load

574
failure.asm Normal file
View File

@@ -0,0 +1,574 @@
CheckZSNES:
SEP #$28
LDA.b #$FF
CLC
ADC.b #$FF
CMP.b #$64
REP #$28
BEQ .zsnes
LDA.w #$01FF : TCS ; thing we wrote over - initialize stack
JML ReturnCheckZSNES
.zsnes
JML DontUseZSNES
;===================================================================================================
pushtable
table "data/bsodencode.txt"
; Uncomment this to force a crash to test message
; pushpc : org $008132 : db 0 : pullpc
;===================================================================================================
DontUseZSNES:
SEP #$35 ; sets carry and I flag too
LDA.b #$00
STA.l NMITIMEN ; disable NMI and IRQ
STA.l HDMAEN ; disable HDMA
ROR ; A = 0x80 from carry
STA.l INIDISP
STA.l VMAIN
; Empty VRAM
LDA.b #AllZeros>>16 : STA.l A1B0
REP #$20
LDA.w #AllZeros
STA.l A1T0L
LDA.w #$1809
STA.l DMAP0
LDA.w #$0000
STA.l DAS0L
LDA.w #$0001
STA.l MDMAEN
JSR ConfigurePPUForFailureReport
JSR ConfigureBSODVWF
STZ.b VWFR
LDA.w #ZSNESMessage
JSR DrawVWFMessage
LDA.w #$0F0F
STA.w INIDISP
-- BRA --
ZSNESMessage:
db "It has been detected that you are attempting to load", $80
db "this ROM on a low-quality emulator.", $80
db "The randomizer is designed to work on real hardware,", $80
db "which this application cannot emulate properly;", $80
db "as such, this ROM file refuses to boot.", $80
db "Please upgrade to a more accurate emulator such as", $80
db "SNES9X or BSNES/higan.", $80
db $FF
;===================================================================================================
AllZeros:
db $00
UselessStackTooFar:
dw $137
Crashed:
;===================================================================================================
;===================================================================================================
;===================================================================================================
; !!!DO NOT TRY TO OPTIMIZE THIS CODE!!!
; IT IS INTENTIONALLY AVOIDING CHANGING CERTAIN REGISTERS, ESPECIALLY THE STACK.
;===================================================================================================
;===================================================================================================
;===================================================================================================
SEP #$35 ; sets carry and I flag too
LDA.b #$00
STA.l NMITIMEN ; disable NMI and IRQ
STA.l HDMAEN ; disable HDMA
ROR ; A = 0x80 from carry
STA.l INIDISP
STA.l VMAIN
; Empty VRAM
LDA.b #AllZeros>>16 : STA.l A1B0
REP #$38
LDA.w #AllZeros
STA.l A1T0L
LDA.w #$1809
STA.l DMAP0
LDA.w #$0000
STA.l DAS0L
LDA.w #$0001
STA.l MDMAEN
;===================================================================================================
; Create report
LDA.w #$2100
TCD
;---------------------------------------------------------------------------------------------------
; Report status
; stack pointer
LDA.w #$0C38>>1
STA.b VMADDL
TSC
XBA
AND.w #$00FF
ORA.w #$0100
STA.b VMDATAL
TSC
AND.w #$00FF
ORA.w #$0100
STA.l VMDATAL
; game module
LDA.w #$0C78>>1
STA.b VMADDL
LDA.l GameMode
AND.w #$00FF
ORA.w #$0100
STA.b VMDATAL
LDA.l GameSubMode
AND.w #$00FF
ORA.w #$0100
STA.b VMDATAL
;---------------------------------------------------------------------------------------------------
; Report stack
TSC
INC
STA.l $7F0100
LDA.l UselessStackTooFar
; For now, we can report as much of the stack as possible
; If desired later on, uncomment the code below to keep the stack limited to
; where it was last doing stuff
; TSC
;
; ; keep stack in a useful range
; CMP.w #$01FF ; this means we pulled too much and the stack is useless
; BCC .stack_fine
;
; JMP .skip_stack
;
;.stack_fine
; CMP.l UselessStackTooFar
; BCS .stack_adjusted
;
; ; this means we went too far in, and the stack contains little useful info
; LDA.l UselessStackTooFar
;
;.stack_adjusted
STA.l $7F0000
LDX.w #$01FF
LDA.w #$0C04>>1
.next_row
STA.l $7F0004
STA.b VMADDL
LDY.w #20
TXA
.next_char
; set carry to see if we should color this value as being in the stack
CMP.l $7F0100
LDA.l $000000,X
AND.w #$00FF
ORA.w #$0500
BCS .in_stack
AND.w #$01FF
.in_stack
STA.b VMDATAL
DEX
TXA
CMP.l $7F0000
BEQ .skip_stack
DEY
BNE .next_char
.done_row
CLC
LDA.l $7F0004
ADC.w #32
BRA .next_row
;===================================================================================================
;===================================================================================================
;===================================================================================================
; once the stack is reported, we can start doing stuff that mucks with it
.skip_stack
LDA.w #$0000
TCD
; TSC
; STA.b $80 ; remember stack for later messages
LDA.w #$01FF
TCS
JSR ConfigurePPUForFailureReport
JSR ConfigureBSODVWF
JSR LoadBSODHexFont
STZ.b VWFR
LDA.w #BSODMessage
JSR DrawVWFMessage
LDA.w #$0F0F
STA.w INIDISP
-- BRA --
BSODMessage:
db "A fatal error has occurred and resulted in an", $80
db "unrecoverable crash. ?", $80
db "If you believe this was the result of a bug caused by", $80
db "the randomizer itself, please screenshot this message", $80
db "and share it in the #bug-reports channel of the official", $80
db "ALTTPR discord along with a detailed description of", $80
db "what you were doing, including video if available.", $80
db "Please also make a savestate now and include that in", $80
db "your report.", $80
db $FF
;===================================================================================================
DrawVWFMessage:
STA.b Scrap06
.next
LDA.b (Scrap06)
INC.b Scrap06
AND.w #$00FF
CMP.w #$0080
BEQ .done_row
CMP.w #$00FF
BEQ .done_message
JSR DrawFailureVWFChar
BRA .next
.done_message
RTS
.done_row
LDA.b VWFR
ASL
TAX
LDA.w .row_offset,X
STA.w VMADDL
INC.b VWFR
LDA.w #$1800
STA.w DMAP0
LDA.w #20*16
STA.w DAS0L
LDA.w #$1000
STA.w A1T0L
SEP #$20
STZ.w VMAIN
STZ.w A1B0
LDA.b #$01
STA.w MDMAEN
REP #$20
JSR ResetVFW
BRA .next
.row_offset
dw $10F8
dw $11E8
dw $12D8
dw $13C8
dw $14B8
dw $15A8
dw $1698
dw $1788
dw $1878
dw $1968
dw $1A58
;===================================================================================================
VWFL = $40
VWFX = $44
VWFS = $46
VWFP = $48
VWFR = $4A
;===================================================================================================
DrawFailureVWFChar:
AND.w #$00FF
STA.b VWFL
TAX
ASL
ASL
ASL
ADC.w #BSODFontGFX
STA.b Scrap08
LDA.b VWFP
AND.w #$FFF8
STA.w VWFX
LDA.b VWFP
AND.w #$0007
STA.w VWFS
; carry set on purpose to add letter spacing
SEC
LDA.w BSODCharWidths,X
AND.w #$00FF
ADC.b VWFP
STA.b VWFP
LDY.w #$0000
.next_row
LDA.b ($08),Y
AND.w #$00FF
XBA
LDX.w VWFS
BEQ ++
-- LSR
DEX
BNE --
++ LDX.w VWFX
SEP #$20
ORA.w $1008,X
STA.w $1008,X
XBA
ORA.w $1000,X
STA.w $1000,X
REP #$20
INX
STX.w VWFX
INY
CPY.w #$0008
BCC .next_row
RTS
;===================================================================================================
LoadBSODHexFont:
REP #$20
LDA.w #BSODHex
STA.w A1T0L
LDA.w #$1801
STA.w DMAP0
LDA.w #$1000
STA.w DAS0L
LDA.w #$2800
STA.w VMADDL
SEP #$20
LDA.b #BSODHex>>16
STA.w A1B0
LDA.b #$01
STA.w MDMAEN
REP #$30
RTS
;===================================================================================================
ConfigureBSODVWF:
REP #$30
LDA.w #$2100
TCD
SEP #$30
LDX.b #$FF
LDY.b #$7F
STZ.b CGADD
STZ.b CGDATA : STZ.b CGDATA
STX.b CGDATA : STY.b CGDATA
LDA.b #$05
STA.b CGADD
LDA.b #$11 : STA.b CGDATA : STY.b CGDATA
LDA.b #$21 : STA.b CGADD
STX.b CGDATA : STY.b CGDATA
LDA.b #$25 : STA.b CGADD
LDA.b #$11 : STA.b CGDATA : STY.b CGDATA
REP #$30
PEA.w $0001
LDA.w #15
STA.w $28
LDA.w #$0042>>1
BRA .start
.next_row
PHA
LDA.w $20
CLC
LDA.w $20
ADC.w #32
.start
STA.w $20
STA.b VMADDL
PLA
LDY.w #30
.next_char
STA.b VMDATAL
INC
DEY
BNE .next_char
DEC.w $28
BNE .next_row
LDA.w #$0000
TCD
ResetVFW:
REP #$30
LDX.w #$0400
-- STZ.w $1000,X
DEX
DEX
BPL --
STZ.b VWFL
STZ.b VWFX
STZ.b VWFS
STZ.b VWFP
RTS
;===================================================================================================
ConfigurePPUForFailureReport:
SEP #$30
PHK
PLB
STZ.w BGMODE ; BG mode 0
STZ.w MOSAIC ; no mosaic
STZ.w BG1SC ; BG1 tilemap to $0000
STZ.w TS
STZ.w BG1HOFS : STZ.w BG1HOFS
STZ.w BG1VOFS : STZ.w BG1VOFS
STZ.w BG2HOFS : STZ.w BG2HOFS
STZ.w BG2VOFS : STZ.w BG2VOFS
STZ.w W12SEL
STZ.w CGADSUB
STZ.w SETINI
LDA.b #$04
STA.w BG2SC ; BG1 tilemap to $0800
LDA.b #$21
STA.w BG12NBA
LDA.b #$03
STA.w TM
RTS
;===================================================================================================
BSODHex:
incbin "data/bsodhex.2bpp"
BSODFontGFX:
incbin "data/bsodfont.1bpp"
BSODCharWidths:
; [space]
db 3
; A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
db 4, 4, 3, 4, 3, 3, 4, 3, 1, 4, 3, 3, 5, 4, 4, 4, 5, 4, 4, 3, 4, 5, 5, 3, 3, 3
; 0 1 2 3 4 5 6 7 8 9 . # ? - / , '
db 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 5, 8, 3, 3, 2, 1
;===================================================================================================
pulltable

View File

@@ -2,20 +2,20 @@
; Fairy Changes & Fixes
;--------------------------------------------------------------------------------
RefillHealthPlusMagic:
LDA BigFairyHealth : STA $7EF372
LDA.l BigFairyHealth : STA.l HeartsFiller
RTL
;--------------------------------------------------------------------------------
RefillHealthPlusMagic8bit:
LDA BigFairyHealth : STA $7EF372
LDA BigFairyMagic : STA $7EF373
LDA.l BigFairyHealth : STA.l HeartsFiller
LDA.l BigFairyMagic : STA.l MagicFiller
RTL
;--------------------------------------------------------------------------------
CheckFullHealth:
LDA BigFairyHealth : BEQ +
LDA $7EF36D : CMP $7EF36C : BNE .player_hp_not_full_yet
LDA.l BigFairyHealth : BEQ +
LDA.l CurrentHealth : CMP.l MaximumHealth : BNE .player_hp_not_full_yet
+
LDA BigFairyMagic : BEQ +
LDA $7EF36E : CMP.b #$80 : BNE .player_mp_not_full_yet
LDA.l BigFairyMagic : BEQ +
LDA.l CurrentMagic : CMP.b #$80 : BNE .player_mp_not_full_yet
+
LDA.b #$00
RTL
@@ -27,62 +27,60 @@ RTL
FairyPond_Init:
LDA.l Restrict_Ponds : BNE +
LDA.b #$48
JSL.l Sprite_ShowMessageFromPlayerContact
RTL
JML.l Sprite_ShowMessageFromPlayerContact
+
PHY : JSL.l Sprite_CheckDamageToPlayerSameLayerLong : BCC +
LDA $7EF35C : CMP.b #$02 : BNE ++ : LDA.b #$1C : PHA : BRA .emptyBottle : ++
LDA $7EF35D : CMP.b #$02 : BNE ++ : LDA.b #$1D : PHA : BRA .emptyBottle : ++
LDA $7EF35E : CMP.b #$02 : BNE ++ : LDA.b #$1E : PHA : BRA .emptyBottle : ++
LDA $7EF35F : CMP.b #$02 : BNE ++ : LDA.b #$1F : PHA : BRA .emptyBottle : ++
LDA.l BottleContentsOne : CMP.b #$02 : BNE ++ : LDA.b #$1C : PHA : BRA .emptyBottle : ++
LDA.l BottleContentsTwo : CMP.b #$02 : BNE ++ : LDA.b #$1D : PHA : BRA .emptyBottle : ++
LDA.l BottleContentsThree : CMP.b #$02 : BNE ++ : LDA.b #$1E : PHA : BRA .emptyBottle : ++
LDA.l BottleContentsFour : CMP.b #$02 : BNE ++ : LDA.b #$1F : PHA : BRA .emptyBottle : ++
.noInventory
LDA.b #$0A : STA $0D80, X
LDA.b #$0A : STA.w SpriteActivity, X
LDA.b #$51
LDY.b #$01
JSL.l Sprite_ShowMessageFromPlayerContact
JMP .cleanup
.emptyBottle
LDA.b #$02 : STA $0D80, X
;JSL Player_ResetState ; If we continue to have issues, add this in too. (After determining the address for it)
STZ $2F
LDA.b #$01 : STA $02E4
PLA : STA $1CE8
LDA.b #$02 : STA.w SpriteActivity, X
STZ.b LinkDirection
LDA.b #$01 : STA.w CutsceneFlag
PLA : STA.w MessageCursor
.cleanup
STZ $0EB0, X ; Clear the sprite's item-given variable
STZ.w SpriteDirectionTable, X ; Clear the sprite's item-given variable
CLC ; skip rest of original function
+ : PLY
RTL
;--------------------------------------------------------------------------------
HappinessPond_Check:
LDA $A0 : CMP.b #$15 ;what we wrote over
PHP
LDA.b RoomIndex : CMP.b #$15 ;what we wrote over
BNE .done
PHP
LDA.b #$72
JSL Sprite_SpawnDynamically
LDA $0FD8 : STA $0D10, Y
LDA $0FD9 : STA $0D30, Y
LDA.w SpriteCoordCacheX : STA.w SpritePosXLow, Y
LDA.w SpriteCoordCacheX+1 : STA.w SpritePosXHigh, Y
LDA $0FDA : !SUB.b #$40 : STA $0D00, Y
LDA $0FDB : SBC.b #$00 : STA $0D20, Y
LDA.w SpriteCoordCacheY : !SUB.b #$40 : STA.w SpritePosYLow, Y
LDA.w SpriteCoordCacheY+1 : SBC.b #$00 : STA.w SpritePosYHigh, Y
LDA.b #$01 : STA $0DA0, Y
LDA.b #$01 : STA.w SpriteAuxTable, Y
LDA.b #$BB
JSL Sprite_SpawnDynamically
LDA.b #$08 : STA $0DD0, Y ; ensure we run prep for the shopkeeper
LDA.b #$08 : STA.w SpriteAITable, Y ; ensure we run prep for the shopkeeper
LDA $0FD8 : STA $0D10, Y
LDA $0FD9 : STA $0D30, Y
LDA.w SpriteCoordCacheX : STA.w SpritePosXLow, Y
LDA.w SpriteCoordCacheX+1 : STA.w SpritePosXHigh, Y
LDA $0FDA : !SUB.b #$20 : STA $0D00, Y
LDA $0FDB : SBC.b #$00 : STA $0D20, Y
LDA.w SpriteCoordCacheY : !SUB.b #$20 : STA.w SpritePosYLow, Y
LDA.w SpriteCoordCacheY+1 : SBC.b #$00 : STA.w SpritePosYHigh, Y
STZ $0DD0, X ; self terminate
STZ.w SpriteAITable, X ; self terminate
.done
PLP
.done
RTL

157
fastcredits.asm Normal file
View File

@@ -0,0 +1,157 @@
FastCreditsActive = $50
;===================================================================================================
FlagFastCredits:
LDA.b #$40
TRB.b FastCreditsActive
AND.b Joy1B_All
TSB.b FastCreditsActive
LDA.b #$20
AND.b Joy1A_New
EOR.b FastCreditsActive
STA.b FastCreditsActive
LDA.b FastCreditsActive
AND.b #$60
BEQ .slow
LDA.b #$01
TSB.b FastCreditsActive
.slow
LDA.b $11
ASL
TAX
RTL
;===================================================================================================
FastCreditsCutsceneTimer:
LDA.b ScrapBufferBD+$0B
INC
JSR IsFastCredits
BCC .slow
INC
INC
INC
AND.w #$FFFE
.slow
STA.b ScrapBufferBD+$0B
SEP #$20
RTL
FastCreditsScrollOW:
JSR FastCreditsCutsceneScrollY
TAY
STY.b $30
JSR FastCreditsCutsceneScrollX
TAY
STY.b $31
RTL
FastCreditsCutsceneScrollX:
PHX
TXA
CLC
ADC.w #$0020
TAX
LDY.b #$00
JSR FastCreditsCutsceneScroll
PLX
RTS
FastCreditsCutsceneScrollY:
LDY.b #$06
FastCreditsCutsceneScroll:
LDA.w $00E2,Y
CMP.l $8EC308,X ; compare to target
ROL.b Scrap00 ; put carry in here
LDA.l $8EC348,X ; get movement
BPL ++ ; if positive, leave saved carry alone
INC.b Scrap00 ; otherwise, flip it
++ ROR.b Scrap00 ; recover carry
BCC ++ ; scroll if carry not set
LDA.w #$0000
++ JSR IsFastCredits
BCC .slow
AND.w #$FFFF ; get sign of A
BPL .positive
EOR.w #$FFFF
INC
ASL
ASL
EOR.w #$FFFF
INC
RTS
.positive
ASL
ASL
.slow
RTS
FastCreditsCutsceneUnderworldX:
JSR FastCreditsCutsceneScrollX
CLC
ADC.b BG2H
STA.b BG2H
RTL
FastCreditsCutsceneUnderworldY:
JSR FastCreditsCutsceneScrollY
CLC
ADC.b BG2V
STA.b BG2V
RTL
FastTextScroll:
LDA.b FrameCounter
SEP #$10
JSR IsFastCredits
BCC .slow
AND.w #$0000
REP #$10
RTL
.slow
AND.w #$0003
REP #$10
RTL
DumbFlagForMSU:
STA.l CurrentWorld
STZ.b FastCreditsActive
RTL
IsFastCredits:
LDY.b FastCreditsActive
CPY.b #$20
RTS

6591
fastrom.asm Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,70 +1,73 @@
;================================================================================
; Fake Flippers Softlock Fix
;--------------------------------------------------------------------------------
FlipperKill:
PHP
LDA $5D : CMP #$04 : BNE .done ; skip if we're not swimming
LDA $7EF356 : BNE .done ; skip if we have the flippers
LDA $7F5001 : BEQ .done ; skip if we're not marked in danger for softlock
LDA $8A : CMP $7F5098 : BEQ .done ; skip if we're on the same screen we entered the water on
;JSL.l KillFairies ; take away fairies
LDA !IGNORE_FAIRIES : ORA.b #$04 : STA !IGNORE_FAIRIES
LDA.b #$00 : STA $7EF36D ; kill link
LDA.b #$00 : STA $7F5001 ; mark fake flipper softlock as impossible
.done
PLP
LDA $7EF36D ; thing we wrote over
; Written over and used by OnEnterWater hook.
UnequipCapeQuiet:
LDA.b #$20 : STA.w PoofTimer
STZ.w NoDamage
STZ.b CapeOn
STZ.w LinkZap
RTL
;--------------------------------------------------------------------------------
IgnoreFairyCheck:
LDX.b #$00 ; thing we wrote over
LDA !IGNORE_FAIRIES : BIT.b #$04 : BEQ .normal
AND.b #$FB : STA !IGNORE_FAIRIES ; clear ignore fairy flag
LDA.b #$F0 ; set check to invalid entry
RTL
.normal
LDA.b #$06 ; set check to fairy
RTL
;--------------------------------------------------------------------------------
;KillFairies:
; LDA $7EF35C : CMP #$06 : BNE +
; LDA #$02 : STA $7EF35C
; + LDA $7EF35D : CMP #$06 : BNE +
; LDA #$02 : STA $7EF35D
; + LDA $7EF35E : CMP #$06 : BNE +
; LDA #$02 : STA $7EF35E
; + LDA $7EF35F : CMP #$06 : BNE +
; LDA #$02 : STA $7EF35F
; +
;RTL
;--------------------------------------------------------------------------------
FlipperReset:
JSL $0998E8 ; AddTransitionSplash
LDA #$00 : STA $7F5001 ; mark fake flipper softlock as impossible
.done
RTL
;--------------------------------------------------------------------------------
FlipperFlag:
LDA $5D : CMP #$04 : BNE .done ; skip if we're not swimming
LDA $7EF356 : BNE .safe ; skip if we have the flippers
LDA #$01 : STA $7F5001 ; mark fake flipper softlock as possible
BRA .done
.safe
LDA #$00 : STA $7F5001 ; mark fake flipper softlock as impossible
.done
RTL
;--------------------------------------------------------------------------------
RegisterWaterEntryScreen:
PHA
LDA $8A : STA $7F5098 ; store ow index
PLA
RTL
;--------------------------------------------------------------------------------
MysteryWaterFunction: ; *$3AE54 ALTERNATE ENTRY POINT
LDA.b #$20 : STA $02E2
STZ $037B
STZ $55
STZ $0360
RTL
;--------------------------------------------------------------------------------
protectff:
LDA.l AllowAccidentalMajorGlitch
BEQ .yes_protect
RTL
.yes_protect
REP #$30
LDA.b LinkPosY
AND.w #$1E00
ASL
ASL
ASL
STA.b Scrap06
LDA.b LinkPosX
AND.w #$1E00
ORA.b Scrap06
XBA
LSR
TAX
SEP #$30
; Remove dark world bit
; in game table that converts coordinates to actual screen ID
; special case for other areas
LDA.b OverworldIndex
BMI .special_overworld
AND.b #$3F
CMP.l $82A4E3,X
BEQ ++
.protect
LDA.b #$15
STA.b LinkState
STZ.b LinkAnimationStep
STZ.b LinkWalkDirection
LDA.b #$02
STA.b LinkDirection
STZ.w MedallionFlag
STZ.w CutsceneFlag
STZ.w NoMenu
++ RTL
.special_overworld
CMP.l .spow,X
BNE .protect
RTL
.spow
db $80, $81, $81, $FF, $FF, $FF, $FF, $FF
db $FF, $81, $81, $FF, $FF, $FF, $FF, $FF

View File

@@ -5,15 +5,21 @@ FloodGateAndMasterSwordFollowerReset:
JSL.l MasterSwordFollowerClear
FloodGateReset:
LDA.l PersistentFloodgate : BNE +
LDA $7EF2BB : AND.b #$DF : STA $7EF2BB ; reset water outside floodgate
LDA $7EF2FB : AND.b #$DF : STA $7EF2FB ; reset water outside swamp palace
LDA $7EF216 : AND.b #$7F : STA $7EF216 ; clear water inside floodgate
LDA $7EF051 : AND.b #$FE : STA $7EF051 ; clear water front room (room 40)
LDA.l OverworldEventDataWRAM+$3B : AND.b #$DF : STA.l OverworldEventDataWRAM+$3B ; reset water outside floodgate
LDA.l OverworldEventDataWRAM+$7B : AND.b #$DF : STA.l OverworldEventDataWRAM+$7B ; reset water outside swamp palace
LDA.l RoomDataWRAM[$010B].low : AND.b #$7F : STA.l RoomDataWRAM[$010B].low ; clear water inside floodgate
LDA.l RoomDataWRAM[$28].high : AND.b #$FE : STA.l RoomDataWRAM[$28].high ; clear water front room (room 40)
+
FloodGateResetInner:
LDA.l Bugfix_SwampWaterLevel : BEQ +
; LDA $7EF06E : AND.b #$7F : STA $7EF06E ; clear water room 55 - outer room you shouldn't be able to softlock except in major glitches
LDA $7EF06A : AND.b #$7F : STA $7EF06A ; clear water room 53 - inner room with the easy key flood softlock
LDA.l Bugfix_SwampWaterLevel : BEQ +++
LDA.l RoomDataWRAM[$37].low : AND.b #$04 : BEQ + ; Check if key in room 55 has been collected.
LDA.l FlippersEquipment : AND.b #$01 : BNE ++ ; Check for flippers. This can otherwise softlock doors if flooded without flippers and no way to reset.
+
LDA.l RoomDataWRAM[$37].low : AND.b #$7F : STA.l RoomDataWRAM[$37].low ; clear water room 55 - outer room you shouldn't be able to softlock except in major glitches
++
LDA.l RoomDataWRAM[$35].high : AND.b #$04 : BNE +++ ; Check if key in room 53 has been collected.
; no need to check for flippers on the inner room, as you can't get to the west door no matter what, without flippers.
LDA.l RoomDataWRAM[$35].low : AND.b #$7F : STA.l RoomDataWRAM[$35].low ; clear water room 53 - inner room with the easy key flood softlock
+++
RTL
;================================================================================
;================================================================================

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