63 Commits

Author SHA1 Message Date
a5b068b15f Bombos-only stuffs? 2022-09-28 23:08:55 -07:00
bfc361ad3e Remove non-progressive bomb/cane upgrades 2022-09-18 15:02:37 -07:00
f7070dd30f Merge branch 'main' into kara 2022-07-23 17:33:34 -07:00
9d485e86cd Merge branch 'main' into kara 2022-07-23 16:47:01 -07: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
ba660409bf Bees in beemode only target enemies they can actually affect 2022-05-21 17:50:20 -07:00
3d93b0160f Golden Bee fix 2022-05-21 15:34:44 -07:00
bb35409bc8 Fix checking tablets in bee mode 2022-05-14 11:45:38 -07:00
ffdb5e837a Fix Trinexx 2022-05-12 12:53:29 -07:00
4d4ae6b894 Fix Arrghus 2022-04-30 21:21:21 -07:00
4f4f46352d More improvement to bee mode? 2022-04-30 14:04:22 -07:00
103c41ae94 Bee Mode WIP 2022-04-29 15:23:47 -07:00
90a4c50a01 unscramble lowercase letters for new font 2022-04-02 10:07:03 -07:00
3acc2a3f45 Merge branch 'main' into kara 2022-01-24 13:58:12 -08:00
5fd285c767 Make non-seeded rng a rom flag instead of compile flag 2022-01-24 13:53:03 -08:00
7f551ad1a4 Fix boomerang instakilling Armos Knights 2022-01-24 13:50:44 -08:00
Thomas Prescott
96e3427868 update credits 2022-01-03 12:27:15 -08:00
f629bcb15a Merge branch 'main' into kara 2021-12-29 18:56:36 -08:00
02ea894a40 Add permanent ice physics bit 2021-12-29 18:52:38 -08:00
ac81fcbf0f Fix bee damage 2021-12-27 14:05:28 -08:00
265089cedb Fix moldorm/somaria issue and add both-canes mode 2021-12-22 00:29:56 -08:00
6279f32fe3 Fix width of special cane freestanding sprites 2021-12-21 02:10:16 -08:00
843f1cad6f Prevent hitting stunned ganon in cane-mode with default vulnerability 2021-12-21 01:40:23 -08:00
c23b4ad5b2 Fix mothula/ganon breaking things (hopefully) 2021-12-20 19:02:02 -08:00
22b9c17f09 Remove bomb damage in cane modes 2021-12-20 17:37:49 -08:00
e210c85710 Add cane-only modes 2021-12-20 16:10:11 -08:00
e50641db11 Merge branch 'main' into kara 2021-12-20 01:35:56 -08:00
1ec9f22cea Shorten duration of boomerang stun 2021-11-10 00:08:57 -08:00
18a2214b23 Make boomerang in bomb-only mode stun enemies it would normally damage 2021-11-08 16:37:22 -08:00
f2a0cfc098 Fix bomb icons on file select/endgame screens 2021-11-07 23:58:06 -08:00
6565fbfd65 Show bomb level on file select screen in bomb-only mode 2021-11-07 19:32:57 -08:00
ae0a5c685a Unify handling of bomb colors in bomb-only mode 2021-11-07 00:28:28 -07:00
c323a71340 Merge branch 'main' into kara 2021-10-30 16:37:59 -07:00
f3e0def5a2 Allow early detonation of bombs and add build flag to remove static RNG 2021-10-30 09:02:57 -07:00
1fcde00d09 Merge remote-tracking branch 'kara/pseudoswords' into kara 2021-10-12 13:31:37 -07:00
123dcddc94 Merge branch 'main' into kara 2021-09-21 11:50:40 -07:00
7c8ef3afce Merge branch 'main' into kara 2021-08-26 08:39:23 -07:00
74e2f96e0a Merge branch 'fix_ohko' into kara 2021-08-09 15:32:51 -07:00
dafef001be Merge branch 'main' into kara 2021-08-02 18:59:58 -07:00
3f4db583f5 Add pseudo-sword mode 2021-07-24 16:06:01 -07:00
44f3f10bc1 Merge branch 'main' into kara 2021-07-22 12:05:40 -07:00
2bb5ec87b0 Fix Stalfos Knights in bomb-mode to have bombs instakill while collapsed 2021-07-20 20:33:28 -07:00
86a1f82d23 Color bombs in the HUD according to bomb level in bomb-only mode 2021-07-16 03:48:23 -07:00
1071b834cd Adjust things for replacing sword stats with bomb stats 2021-07-15 13:14:49 -07:00
2693e73a21 move storage of BOMB_LEVEL to make it play nicely with starting equipment 2021-07-13 11:15:07 -07:00
6d52427696 Fix bomb downgrades and track bomb stats in bomb-mode 2021-07-11 13:58:04 -07:00
374abe7e88 Merge branch 'kara' of github.com:ardnaxelarak/z3randomizer into kara 2021-07-11 13:56:01 -07:00
1b698808c3 Add L-1 bombs as separate from no bombs in bomb-only mode 2021-07-11 12:52:20 -07:00
62c81f2cf3 Fix extra space in credits 2021-07-11 02:14:01 -07:00
08166fe669 Allow bombing barrier and getting tablet checks with L2+ bombs 2021-07-10 17:40:08 -07:00
70ec318204 Fix junk graphics appearing during GAME OVER screen 2021-07-10 11:32:33 -07:00
081411a448 Merge branch 'main' into kara 2021-07-08 19:26:55 -07:00
55fd818f55 Merge branch 'main' into kara 2021-07-07 10:27:58 -07:00
37b90894e3 Show bombs placed in credits 2021-07-05 17:57:12 -07:00
f6983cee35 Fix quake not blobbing some enemies in bomb-only mode 2021-07-05 15:40:25 -07:00
642205bc68 Fix hookshot and armos knights
- hookshot now stuns enemies it would normally damage
- armos knights with L-2 bombs now take same damage as L-1 or L-3
2021-07-04 18:28:46 -07:00
a8bc95bd1f NO BOMBOS DAMAGE 2021-07-04 15:43:02 -07:00
0dcef701df Merge commit 'f403ca10da9e009599a531be8cdcd20a61b4801c' of github.com:spannerisms/z3randomizer into kara 2021-07-03 18:25:27 -07:00
1dafb620b0 Merge branch 'main' into kara 2021-07-03 18:23:05 -07:00
828a9df7d9 Allow Ganon to be vulnerable to arbitrary item 2021-06-29 16:28:19 -07:00
ea72d70b1b Implement always-allowed medallions 2021-06-29 16:24:21 -07:00
bf953e7953 Add bomb-only mode 2021-06-29 16:23:15 -07:00
100 changed files with 3642 additions and 12445 deletions

2
.gitignore vendored
View File

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

View File

@@ -78,26 +78,6 @@ function hexto555(h) = ((((h&$FF)/8)<<10)|(((h>>8&$FF)/8)<<5)|(((h>>16&$FF)/8)<<
;================================================================================
!MULTIWORLD_ITEM = "$7EF4D2"
!MULTIWORLD_ITEM_FROM = "$7EF4D3"
!MULTIWORLD_ROOMID = "$7EF4D4"
!MULTIWORLD_ROOMDATA = "$7EF4D6"
!MULTIWORLD_SCOUT_LOCATION = "$7EF4D7"
!MULTIWORLD_SCOUTREPLY_LOCATION = "$7EF4D8"
!MULTIWORLD_SCOUTREPLY_ITEM = "$7EF4D9"
!MULTIWORLD_SCOUTREPLY_PLAYER = "$7EF4DA"
!MULTIWORLD_RECEIVING_ITEM = "$7EC057" ; 0 = default | 1 = receiving
!MULTIWORLD_HUD_CHARACTER_DATA = "$7EC058" ; 0x40 bytes
!MULTIWORLD_ITEM_PLAYER_ID = "$7EC098" ; 0 = disabled
!MULTIWORLD_SPRITEITEM_PLAYER_ID = "$7EC099"
!MULTIWORLD_HUD_TIMER = "$7EC09A"
!MULTIWORLD_HUD_DELAY = "#120"
!MULTIWORLD_ITEM_ID = "$7EC09B" ; for lua scripts?
!Dungeon_ChestData = "$01E96C"
!FLAG_OW_MIXED = $04
!FLAG_OW_CROSSED = $02
incsrc hooks.asm
incsrc treekid.asm
incsrc spriteswap.asm
@@ -138,6 +118,7 @@ incsrc dungeondrops.asm
incsrc halfmagicbat.asm
incsrc mantle.asm
incsrc swordswap.asm
incsrc stats.asm
incsrc scratchpad.asm
incsrc map.asm
incsrc dialog.asm
@@ -146,6 +127,12 @@ incsrc clock.asm
incsrc accessibility.asm
incsrc heartbeep.asm
incsrc capacityupgrades.asm
incsrc timer.asm
incsrc doorframefixes.asm
incsrc music.asm
incsrc roomloading.asm
incsrc icepalacegraphics.asm
incsrc firebarlayer.asm
warnpc $A18000
org $1C8000 ; text tables for translation
@@ -177,12 +164,6 @@ org $A1FF00 ; static mapping area
incsrc init.asm
org $A48000 ; code bank - PUT NEW CODE HERE
incsrc timer.asm
incsrc doorframefixes.asm
incsrc music.asm
incsrc roomloading.asm
incsrc icepalacegraphics.asm
incsrc firebarlayer.asm
incsrc glitched.asm
incsrc hardmode.asm
incsrc goalitem.asm
@@ -200,14 +181,12 @@ incsrc decryption.asm
incsrc hashalphabet.asm
incsrc inverted.asm
incsrc invertedmaps.asm
incsrc bonktreemaps.asm
incsrc newhud.asm
incsrc compasses.asm
incsrc save.asm
incsrc password.asm
incsrc enemy_adjustments.asm
incsrc stats.asm
;incsrc hudtext.asm
incsrc hudtext.asm
incsrc servicerequest.asm
incsrc elder.asm
incsrc toast.asm
@@ -215,8 +194,8 @@ incsrc darkroomitems.asm
incsrc fastcredits.asm
incsrc msu.asm
incsrc dungeonmap.asm
incsrc multiworld.asm
incsrc terrorpin.asm
incsrc special_weapons.asm
incsrc variable_ganon_vulnerability.asm
if !FEATURE_NEW_TEXT
incsrc textrenderer.asm
endif
@@ -225,24 +204,12 @@ warnpc $A58000
;org $228000 ; contrib area
org $A28000 ; contrib area
incsrc contrib.asm
incsrc special_weapons.asm
incsrc variable_ganon_vulnerability.asm
incsrc trolls.asm
warnpc $A38000
org $A38000
incsrc stats/main.asm
incsrc menu/overworldmap.asm ; overwrites some code in bank 0A
incsrc doorrando/doorrando.asm ; bank 27 likely A7 in the future
;bank 28/A8 for keydropshuffle / standing items
incsrc keydrop/standing_items.asm
incsrc owrando.asm ; bank AA
incsrc enemizer/main.asm ; this is originally in bank 36, but is currently in migratory status in bank 37
org $308000 ; bank #$30
incsrc tables.asm
warnpc $318000
org $348000
incsrc spc.asm
@@ -292,8 +259,8 @@ incbin ice_palace_floor.bin
warnpc $31C801
org $31C800
Damage_Table:
incbin damage_table.bin
Damage_Table_Bombos:
incbin damage_table_bombos.bin
warnpc $31D001
org $31D000
@@ -344,16 +311,7 @@ endif
org $328000
Extra_Text_Table:
if !FEATURE_NEW_TEXT
incsrc itemtext_lower.asm
else
incsrc itemtext.asm
endif
warnpc $32E000
org $32DFD0 ; PC 0x195FD0
incsrc multiworldplayernames.asm
warnpc $330000
incsrc itemtext.asm
incsrc externalhooks.asm
;================================================================================
@@ -377,11 +335,7 @@ warnpc $B08000
;$22 Contrib Code
;$23 Stats & Credits
;$24 Code Bank
;$27 DR Code Bank
;$28 Keydrop / Standing Items Code bank
;$29 External hooks (rest of bank not used)
;$2A Reserved for OWR
;$2B Room Data migration
;$2E Reserved for Tournament Use
;$2F Static RNG (rest is reserved for tournament use)
;$30 Main Configuration Table
@@ -534,24 +488,9 @@ Dungeon_SaveRoomData:
org $02A0BE
Dungeon_SaveRoomData_justKeys:
org $02A4E3
Overworld_ActualScreenID:
org $02B861
Dungeon_SaveRoomQuadrantData:
org $02C11D
CalculateTransitionLanding:
org $02C176
Overworld_FinalizeEntryOntoScreen_Data:
org $02D9B9
Underworld_LoadSpawnEntrance:
org $02E99D
FluteMenu_LoadTransport:
org $02FD8A ; 17D8A - Bank0E.asm: 3732 Note: Different bank
LoadGearPalettes_bunny:
@@ -561,18 +500,9 @@ LoadGearPalettes_variable:
org $02FEAB
Filter_Majorly_Whiten_Color:
org $04E780
Overworld_MemorizeMap16Change:
org $04E879
Overworld_CheckForSpecialOverworldTrigger_Direction:
org $05A51D
Sprite_SpawnFallingItem:
org $05AFF1
Sprite_6C_MirrorPortal_dont_do_warp:
org $05DF6C ; 02DF6C - Bank05.asm : 2445
Sprite_DrawMultiple:
@@ -603,9 +533,6 @@ Utility_CheckIfHitBoxesOverlapLong:
org $06A7DB
Chicken_SpawnAvengerChicken: ; returns short
org $06AD58
Sprite_TransmuteToBomb:
org $06DC5C
Sprite_DrawShadowLong:
@@ -636,27 +563,15 @@ Player_HaltDashAttackLong:
org $07999D
Link_ReceiveItem:
org $079F82
Link_UseHammer:
org $07A985
SetGameModeLikeMirror:
org $07E68F
Unknown_Method_0: ; In US version disassembly simply called "$3E6A6 IN ROM"
org $07F413
Link_CheckForEdgeScreenTransition:
org $07F4AA
Sprite_CheckIfPlayerPreoccupied:
org $08C3AE
Ancilla_ReceiveItem:
org $08C505
Ancilla_ReceiveItem_objectFinished:
org $08CE93
Ancilla_BreakTowerSeal_draw_single_crystal:
@@ -672,12 +587,6 @@ Ancilla_SetOam_XY_Long:
org $0985E2 ; (break on $0985E4)
AddReceivedItem:
org $098605
AddReceivedItem_notCrystal:
org $098766
AddReceivedItem_gfxHandling:
org $098BAD
AddPendantOrCrystal:
@@ -693,18 +602,12 @@ AddAncillaLong:
org $099D1A
Ancilla_CheckIfAlreadyExistsLong:
org $09AC57
Ancilla_TerminateSelectInteractives:
org $09AE64
Sprite_SetSpawnedCoords:
org $09AD58
GiveRupeeGift:
org $0AB7BD
FluteMenu_HandleSelection_NoSelection:
org $0ABA4F
OverworldMap_InitGfx:
@@ -714,9 +617,6 @@ OverworldMap_DarkWorldTilemap:
org $0ABAB9
OverworldMap_LoadSprGfx:
org $8AE817
DungeonMapBossRooms:
org $0CD7D1
NameFile_MakeScreenVisible:
org $0CDB3E
@@ -833,3 +733,5 @@ Sprite_GetEmptyBottleIndex: ; this is totally in sprite_bees.asm
org $1EF4E7
Sprite_PlayerCantPassThrough:
;================================================================================
incsrc bombos_only.asm

View File

@@ -1,15 +0,0 @@
# z3randomizer
Zelda 3 Randomizer Template ASM
How to create the bps patch:
* Assemble the ROM with asar (recommend to use a copy of original rom)
`asar LTTP_RND_GeneralBugfixes.asm copy_original_rom.sfc`
(copy_orignal_rom.sfc is now assembled_rom.sfc)
* Use flips to create a bps file
`flips original_rom.sfc assembled_rom.sfc base2current.bps`
* Update RANDOMIZERBASEHASH in DR with the md5 sum of assembled_rom.sfc. And put base2current.bps in the data directory.

Binary file not shown.

BIN
asar.dll

Binary file not shown.

421
asar.py
View File

@@ -1,421 +0,0 @@
#!/usr/bin/env python3
"""
python interface for asar.dll
by randomdude999
Usage: import asar, call asar.init, call asar.patch, then use the various
functions to get info about the patch
"""
import ctypes
import enum
import sys
from ctypes import c_int, c_char_p, POINTER
c_int_ptr = POINTER(c_int)
__all__ = ["errordata", "writtenblockdata", "mappertype", "version",
"apiversion", "init", "reset", "patch", "maxromsize", "close",
"geterrors", "getwarnings", "getprints", "getalllabels",
"getlabelval", "getdefine", "getalldefines", "resolvedefines",
"math", "getwrittenblocks", "getmapper", "getsymbolsfile"]
_target_api_ver = 303
_asar = None
class AsarArithmeticError(ArithmeticError):
pass
class errordata(ctypes.Structure):
_fields_ = [("fullerrdata", c_char_p),
("rawerrdata", c_char_p),
("block", c_char_p),
("filename", c_char_p),
("line", c_int),
("callerfilename", c_char_p),
("callerline", c_int),
("errid", c_int)]
def __repr__(self):
return "<asar error: {!r}>".format(self.fullerrdata.decode())
# for internal use only. getalllabels() returns a dict.
class _labeldata(ctypes.Structure):
_fields_ = [("name", c_char_p),
("location", c_int)]
# for internal use only. getalldefines() returns a dict.
class _definedata(ctypes.Structure):
_fields_ = [("name", c_char_p),
("contents", c_char_p)]
class writtenblockdata(ctypes.Structure):
_fields_ = [("pcoffset", c_int),
("snesoffset", c_int),
("numbytes", c_int)]
def __repr__(self):
return "<written block ${:06x} 0x{:x} size:{}>".format(
self.snesoffset, self.pcoffset, self.numbytes)
# internal use only. patch() accepts a dict.
class _memoryfile(ctypes.Structure):
_fields_ = [("path", c_char_p),
("buffer", c_char_p),
("length", ctypes.c_size_t)]
# internal use only. patch() accepts a dict.
class _warnsetting(ctypes.Structure):
_fields_ = [("warnid", c_char_p),
("enabled", ctypes.c_bool)]
# For internal use only.
class _patchparams(ctypes.Structure):
_fields_ = [("structsize", c_int),
("patchloc", c_char_p),
("romdata", c_char_p),
("buflen", c_int),
("romlen", c_int_ptr),
("includepaths", POINTER(c_char_p)),
("numincludepaths", c_int),
("should_reset", ctypes.c_bool),
("additional_defines", POINTER(_definedata)),
("additional_define_count", c_int),
("stdincludesfile", c_char_p),
("stddefinesfile", c_char_p),
("warning_settings", POINTER(_warnsetting)),
("warning_setting_count", c_int),
("memory_files", POINTER(_memoryfile)),
("memory_file_count", c_int),
("override_checksum_gen", ctypes.c_bool),
("generate_checksum", ctypes.c_bool)]
class mappertype(enum.Enum):
invalid_mapper = 0
lorom = 1
hirom = 2
sa1rom = 3
bigsa1rom = 4
sfxrom = 5
exlorom = 6
exhirom = 7
norom = 8
def _getall(func):
"""Helper that does the work common to all the getall* functions."""
count = c_int()
raw_errs = func(ctypes.byref(count))
errs = []
for i in range(count.value):
errs.append(raw_errs[i])
return errs
class _AsarDLL:
def __init__(self, dllname):
dll = ctypes.CDLL(dllname)
self.dll = dll
self.funcs = {}
try:
# argument/return type setup
# (also verifies that those functions are exported from the DLL)
# this is directly from asardll.h
# setup_func(name, argtypes, returntype)
self.setup_func("version", (), c_int)
self.setup_func("apiversion", (), c_int)
self.setup_func("init", (), ctypes.c_bool)
self.setup_func("reset", (), ctypes.c_bool)
self.setup_func("patch", (c_char_p, c_char_p, c_int, c_int_ptr),
ctypes.c_bool)
self.setup_func("patch_ex", (POINTER(_patchparams),), ctypes.c_bool)
self.setup_func("maxromsize", (), c_int)
self.setup_func("close", (), None)
self.setup_func("geterrors", (c_int_ptr,), POINTER(errordata))
self.setup_func("getwarnings", (c_int_ptr,), POINTER(errordata))
self.setup_func("getprints", (c_int_ptr,), POINTER(c_char_p))
self.setup_func("getalllabels", (c_int_ptr,), POINTER(_labeldata))
self.setup_func("getlabelval", (c_char_p,), c_int)
self.setup_func("getdefine", (c_char_p,), c_char_p)
self.setup_func("getalldefines", (c_int_ptr,), POINTER(_definedata))
self.setup_func("resolvedefines", (c_char_p, ctypes.c_bool),
c_char_p)
self.setup_func("math", (c_char_p, POINTER(c_char_p)),
ctypes.c_double)
self.setup_func("getwrittenblocks", (c_int_ptr,),
POINTER(writtenblockdata))
self.setup_func("getmapper", (), c_int)
self.setup_func("getsymbolsfile", (c_char_p,), c_char_p)
except AttributeError:
raise OSError("Asar DLL is missing some functions")
api_ver = dll.asar_apiversion()
if api_ver < _target_api_ver or \
(api_ver // 100) > (_target_api_ver // 100):
raise OSError("Asar DLL version "+str(api_ver)+" unsupported")
def setup_func(self, name, argtypes, restype):
"""Setup argument and return types for a function.
name: name of the function in the DLL. "asar_" is added automatically
argtypes and restype: see ctypes documentation
"""
func = getattr(self.dll, "asar_" + name)
func.argtypes = argtypes
func.restype = restype
def init(dll_path=None):
"""Load the Asar DLL.
You must call this before calling any other Asar functions. Raises OSError
if there was something wrong with the DLL (not found, wrong version,
doesn't have all necessary functions).
You can pass a custom DLL path if you want. If you don't, some common names
for the asar dll are tried.
"""
global _asar
if _asar is not None:
return
if dll_path is not None:
_asar = _AsarDLL(dll_path)
else:
if sys.platform == "win32":
libnames = ["./asar.dll", "asar", "./asar-x64.dll", "asar-x64"]
elif sys.platform == "darwin":
libnames = ["./libasar.dylib", "libasar"]
else:
libnames = ["./libasar.so", "libasar"]
for x in libnames:
try:
_asar = _AsarDLL(x)
except OSError:
continue
if _asar is None:
# Nothing in the search path is valid
raise OSError("Could not find asar DLL")
if not _asar.dll.asar_init():
_asar = None
return False
else:
return True
def close():
"""Free all of Asar's structures and unload the module.
Only asar.init() may be called after calling this.
"""
global _asar
if _asar is None:
return
_asar.dll.asar_close()
_asar = None
def version():
"""Return the version, in the format major*10000+minor*100+bugfix*1.
This means that 1.2.34 would be returned as 10234.
"""
return _asar.dll.asar_version()
def apiversion():
"""Return the API version, in the format major*100+minor.
Minor is incremented on backwards compatible changes; major is incremented
on incompatible changes. Does not have any correlation with the Asar
version. It's not very useful directly, since asar.init() verifies this
automatically.
"""
return _asar.dll.asar_apiversion()
def reset():
"""Clear out errors, warnings, printed statements and the file cache.
Not really useful, since asar.patch() already does this.
"""
return _asar.dll.asar_reset()
def patch(patch_name, rom_data, includepaths=[], should_reset=True,
additional_defines={}, std_include_file=None, std_define_file=None,
warning_overrides={}, memory_files={}, override_checksum=None):
"""Applies a patch.
Returns (success, new_rom_data). If success is False you should call
geterrors() to see what went wrong. rom_data is assumed to be headerless.
If includepaths is specified, it lists additional include paths for asar
to search.
should_reset specifies whether asar should clear out all defines, labels,
etc from the last inserted file. Setting it to False will make Asar act
like the currently patched file was directly appended to the previous one.
additional_defines specifies extra defines to give to the patch
(similar to the -D option).
std_include_file and std_define_file specify files where to look for extra
include paths and defines, respectively.
warning_overrides is a dict of str (warning ID) -> bool. It overrides
enabling/disabling specific warnings.
memory_files is a dict of str (file name) -> bytes (file contents). It
specifies memory files to use.
override_checksum specifies whether to override checksum generation. True
forces Asar to update the ROM's checksum, False forces Asar to not update
it.
"""
romlen = c_int(len(rom_data))
rom_ptr = ctypes.create_string_buffer(bytes(rom_data), maxromsize())
pp = _patchparams()
pp.structsize = ctypes.sizeof(_patchparams)
pp.patchloc = patch_name.encode()
pp.romdata = ctypes.cast(rom_ptr, c_char_p)
pp.buflen = maxromsize()
pp.romlen = ctypes.pointer(romlen)
# construct an array type of len(includepaths) elements and initialize
# it with elements from includepaths
pp.includepaths = (c_char_p*len(includepaths))(*includepaths)
pp.numincludepaths = len(includepaths)
defines = (_definedata * len(additional_defines))()
for i, (k, v) in enumerate(additional_defines.items()):
defines[i].name = k.encode()
defines[i].contents = v.encode()
pp.additional_defines = defines
pp.additional_define_count = len(additional_defines)
pp.should_reset = should_reset
pp.stdincludesfile = std_include_file.encode() if std_include_file else None
pp.stddefinesfile = std_define_file.encode() if std_define_file else None
warnsettings = (_warnsetting * len(warning_overrides))()
for i, (k, v) in enumerate(warning_overrides.items()):
warnsettings[i].warnid = k.encode()
warnsettings[i].enabled = v
pp.warning_settings = warnsettings
pp.warning_setting_count = len(warnsettings)
memoryfiles = (_memoryfile * len(memory_files))()
for i, (k, v) in enumerate(memory_files.items()):
memoryfiles[i].path = k.encode()
memoryfiles[i].buffer = v
memoryfiles[i].length = len(v)
pp.memory_files = memoryfiles
pp.memory_file_count = len(memory_files)
if override_checksum is not None:
pp.override_checksum_gen = True
pp.generate_checksum = override_checksum
else:
pp.override_checksum_gen = False
pp.generate_checksum = False
result = _asar.dll.asar_patch_ex(ctypes.byref(pp))
return result, rom_ptr.raw[:romlen.value]
def maxromsize():
"""Return the maximum possible size of the output ROM."""
return _asar.dll.asar_maxromsize()
def geterrors():
"""Get a list of all errors."""
return _getall(_asar.dll.asar_geterrors)
def getwarnings():
"""Get a list of all warnings."""
return _getall(_asar.dll.asar_getwarnings)
def getprints():
"""Get a list of all printed data."""
return [x.decode() for x in _getall(_asar.dll.asar_getprints)]
def getalllabels():
"""Get a dictionary of label name -> SNES address."""
labeldatas = _getall(_asar.dll.asar_getalllabels)
return {x.name.decode(): x.location for x in labeldatas}
def getlabelval(name):
"""Get the ROM location of one label. None means "not found"."""
val = _asar.dll.asar_getlabelval(name.encode())
return None if (val == -1) else val
def getdefine(name):
"""Get the value of a define."""
return _asar.dll.asar_getdefine(name.encode()).decode()
def getalldefines():
"""Get the names and values of all defines."""
definedatas = _getall(_asar.dll.asar_getalldefines)
return {x.name.decode(): x.contents.decode() for x in definedatas}
def resolvedefines(data, learnnew):
"""Parse all defines in the given data.
Returns the data with all defines evaluated.
learnnew controls whether it'll learn new defines in this string if it
finds any. Note that it may emit errors.
"""
return _asar.dll.asar_resolvedefines(data, learnnew)
def math(to_calculate):
"""Parse a string containing math.
It automatically assumes global scope (no namespaces), and has access to
all functions and labels from the last call to asar.patch(). If there was
an error, ArithmeticError is raised with the message returned by Asar.
"""
error = ctypes.c_char_p()
result = _asar.dll.asar_math(to_calculate.encode(), ctypes.byref(error))
if not bool(error):
# Null pointer, means no error
return result
else:
raise AsarArithmeticError(error.value.decode())
def getwrittenblocks():
"""Get a list of all the blocks written to the ROM."""
return _getall(_asar.dll.asar_getwrittenblocks)
def getmapper():
"""Get the ROM mapper currently used by Asar."""
return mappertype(_asar.dll.asar_getmapper())
def getsymbolsfile(fmt="wla"):
"""Generates the contents of a symbols file for in a specific format.
Returns the textual contents of the symbols file.
format specified the format of the symbols file that gets generated.
"""
return _asar.dll.asar_getsymbolsfile(fmt.encode()).decode()

203
bombos_only.asm Normal file
View File

@@ -0,0 +1,203 @@
!ITEMCOUNT = $F0
; ============== Replace all picked up item icons with bombos =================
org AddReceivedItemExpanded_y_offsets
fillbyte -4
fill !ITEMCOUNT
org AddReceivedItemExpanded_x_offsets
fillbyte 0
fill !ITEMCOUNT
org AddReceivedItemExpanded_item_graphics_indices
fillbyte $1B
fill !ITEMCOUNT
org AddReceivedItemExpanded_wide_item_flag
fillbyte $02
fill !ITEMCOUNT
org AddReceivedItemExpanded_properties
fillbyte 4
fill !ITEMCOUNT
org GetSpriteID_gfxSlots
fillbyte $1B
fill !ITEMCOUNT
org GetSpritePalette_gfxPalettes
fillbyte $08
fill !ITEMCOUNT
org IsNarrowSprite_smallSprites
padbyte $FF
pad PrepDynamicTile
; =============================================================================
; ===================== Remove attempt to animate rupees ======================
org $08C672
LDA.b #$0F : NOP
; =============================================================================
; ===================== Replace all menu icons with bombos ====================
macro bombos_icon()
dw $287D, $287E, $E87E, $E87D ; Bombos
endmacro
macro empty_icon()
dw $20F5, $20F5, $20F5, $20F5 ; No bombos
endmacro
org $0DF649
%empty_icon() ; No bow
%bombos_icon() ; Empty bow
%bombos_icon() ; Bow and arrows
%bombos_icon() ; Empty silvers bow
%bombos_icon() ; Silver bow and arrows
%empty_icon() ; No boomerang
%bombos_icon() ; Blue boomerang
%bombos_icon() ; Red boomerang
%empty_icon() ; No hookshot
%bombos_icon() ; Hookshot
%empty_icon() ; No bombs
%bombos_icon() ; Bombs
%empty_icon() ; No powder
%bombos_icon() ; Mushroom
%bombos_icon() ; Powder
%empty_icon() ; No fire rod
%bombos_icon() ; Fire rod
%empty_icon() ; No ice rod
%bombos_icon() ; Ice rod
%empty_icon() ; No bombos
%bombos_icon() ; Bombos
%empty_icon() ; No ether
%bombos_icon() ; Ether
%empty_icon() ; No quake
%bombos_icon() ; Quake
%empty_icon() ; No lamp
%bombos_icon() ; Lamp
%empty_icon() ; No hammer
%bombos_icon() ; Hammer
%empty_icon() ; No flute
%bombos_icon() ; Shovel
%bombos_icon() ; Flute (inactive)
%bombos_icon() ; Flute (active)
%empty_icon() ; No net
%bombos_icon() ; Net
%empty_icon() ; No book
%bombos_icon() ; Book of Mudora
%empty_icon() ; No bottle
%bombos_icon() ; Mushroom
%bombos_icon() ; Empty bottle
%bombos_icon() ; Red potion
%bombos_icon() ; Green potion
%bombos_icon() ; Blue potion
%bombos_icon() ; Fairy
%bombos_icon() ; Bee
%bombos_icon() ; Good bee
%empty_icon() ; No somaria
%bombos_icon() ; Cane of Somaria
%empty_icon() ; No byrna
%bombos_icon() ; Cane of Byrna
%empty_icon() ; No cape
%bombos_icon() ; Cape
%empty_icon() ; No mirror
%bombos_icon() ; Map
%bombos_icon() ; Mirror
%bombos_icon() ; Triforce (displays as arrows and bombs)
%empty_icon() ; No glove
%bombos_icon() ; Power glove
%bombos_icon() ; Titan's mitt
%empty_icon() ; No boots
%bombos_icon() ; Pegasus boots
%empty_icon() ; No flippers
%bombos_icon() ; Flippers
%empty_icon() ; No pearl
%bombos_icon() ; Moon pearl
%empty_icon() ; Nothing
%empty_icon() ; No sword
%bombos_icon() ; Fighter sword
%bombos_icon() ; Master sword
%bombos_icon() ; Tempered sword
%bombos_icon() ; Gold sword
%empty_icon() ; No shield
%bombos_icon() ; Fighter shield
%bombos_icon() ; Fire shield
%bombos_icon() ; Mirror shield
%bombos_icon() ; Green mail
%bombos_icon() ; Blue mail
%bombos_icon() ; Red mail
%empty_icon() ; No compass
%bombos_icon() ; Compass
%empty_icon() ; No big key
%bombos_icon() ; Big key
%bombos_icon() ; Big key and chest
%empty_icon() ; No map
%bombos_icon() ; Map
%empty_icon() ; No red pendant
%bombos_icon() ; Red pendant
%empty_icon() ; No blue pendant
%bombos_icon() ; Blue pendant
%empty_icon() ; No green pendant
%bombos_icon() ; Green pendant
%empty_icon() ; No white glove?
%bombos_icon() ; White glove?
%empty_icon() ; 0 heart pieces
dw $287D, $20F5, $20F5, $20F5 ; 1 heart piece
dw $287D, $20F5, $E87E, $20F5 ; 2 heart pieces
dw $287D, $287E, $E87E, $20F5 ; 3 heart pieces
; =============================================================================
; ===================== Replace menu pendants with bombos =====================
org DrawPendantCrystalDiagram_row0
dw $28FB, $28F9, $28F9, $28F9, $28F9, $28F9, $28F9, $28F9, $28F9, $68FB
dw $28FC, $24F5, $24F5, $24F5, $307D, $307E, $24F5, $24F5, $24F5, $68FC
dw $28FC, $24F5, $24F5, $24F5, $F07E, $F07D, $24F5, $24F5, $24F5, $68FC
dw $28FC, $24F5, $307D, $307E, $24F5, $24F5, $307D, $307E, $24F5, $68FC
dw $28FC, $24F5, $F07E, $F07D, $24F5, $24F5, $F07E, $F07D, $24F5, $68FC
dw $28FC, $24F5, $24F5, $24F5, $307D, $307E, $24F5, $24F5, $24F5, $68FC
dw $28FC, $24F5, $307D, $307E, $307D, $307E, $307D, $307E, $24F5, $68FC
dw $28FC, $24F5, $F07E, $F07D, $F07E, $F07D, $F07E, $F07D, $24F5, $68FC
dw $A8FB, $A8F9, $A8F9, $A8F9, $A8F9, $A8F9, $A8F9, $A8F9, $A8F9, $E8FB
; =============================================================================
; ===================== Replace menu pendants with bombos =====================
org $308022
db $00
; =============================================================================

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,6 @@
; Randomize Book of Mudora
;--------------------------------------------------------------------------------
LoadLibraryItemGFX:
LDA.l LibraryItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
%GetPossiblyEncryptedItem(LibraryItem, SpriteItemValues)
STA $0E80, X ; Store item type
JSL.l PrepDynamicTile
@@ -31,7 +30,6 @@ LoadBonkItemGFX:
LDA.b #$08 : STA $0F50, X ; thing we wrote over
LoadBonkItemGFX_inner:
LDA.b #$00 : STA !REDRAW
JSR LoadBonkItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
JSR LoadBonkItem
JSL.l PrepDynamicTile
RTL
@@ -52,7 +50,6 @@ DrawBonkItemGFX:
RTL
;--------------------------------------------------------------------------------
GiveBonkItem:
JSR LoadBonkItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID
JSR LoadBonkItem
CMP #$24 : BNE .notKey
.key
@@ -72,22 +69,9 @@ LoadBonkItem:
LDA.l BonkKey_Desert
BRA ++
+ : CMP #140 : BNE + ; GTower Bonk Key
LDA.l BonkKey_GTower
LDA.l BonkKey_GTower
BRA ++
+
LDA.b #$24 ; default to small key
++
RTS
;--------------------------------------------------------------------------------
LoadBonkItem_Player:
LDA $A0 ; check room ID - only bonk keys in 2 rooms so we're just checking the lower byte
CMP #115 : BNE + ; Desert Bonk Key
LDA.l BonkKey_Desert_Player
BRA ++
+ : CMP #140 : BNE + ; GTower Bonk Key
LDA.l BonkKey_GTower_Player
BRA ++
+
LDA.b #$00
++
RTS

View File

@@ -1,16 +1,11 @@
;================================================================================
; Boots State Modifier
;--------------------------------------------------------------------------------
!BOOTS_MODIFIER = "$7F50CE"
ModifyBoots:
PHA
LDA.b $A0 : CMP.b #$06 : BNE +
LDA.b $A1 : CMP.b #$00 : BEQ .no_boots
+
LDA !BOOTS_MODIFIER : CMP.b #$01 : BNE +
LDA BootsModifier : CMP.b #$01 : BNE +
PLA : AND AbilityFlags : ORA.b #$04 : RTL ; yes boots
+ : CMP.b #$02 : BNE +
.no_boots
PLA : AND AbilityFlags : AND.b #$FB : RTL ; no boots
+ : LDA FakeBoots : CMP.b #$01 : BNE +
LDA $5B : BEQ ++ : LDA $59 : BNE + ; hover check
@@ -25,7 +20,7 @@ AddBonkTremors:
LDA $46 : BNE + ; Check for incapacitated Link
JSL.l IncrementBonkCounter
+
LDA !BOOTS_MODIFIER : CMP.b #$01 : BEQ +
LDA BootsModifier : CMP.b #$01 : BEQ +
LDA BootsEquipment : BNE + ; Check for Boots
PLA : RTL
+
@@ -36,7 +31,7 @@ RTL
BonkBreakableWall:
PHX : PHP
SEP #$30 ; set 8-bit accumulator and index registers
LDA !BOOTS_MODIFIER : CMP.b #$01 : BEQ +
LDA BootsModifier : CMP.b #$01 : BEQ +
LDA BootsEquipment : BNE + ; Check for Boots
PLP : PLX : LDA.w #$0000 : RTL
+
@@ -45,7 +40,7 @@ BonkBreakableWall:
RTL
;--------------------------------------------------------------------------------
BonkRockPile:
LDA !BOOTS_MODIFIER : CMP.b #$01 : BEQ +
LDA BootsModifier : CMP.b #$01 : BEQ +
LDA BootsEquipment : BNE + ; Check for Boots
LDA.b #$00 : RTL
+
@@ -53,7 +48,7 @@ BonkRockPile:
RTL
;--------------------------------------------------------------------------------
GravestoneHook:
LDA !BOOTS_MODIFIER : CMP.b #$01 : BEQ +
LDA BootsModifier : CMP.b #$01 : BEQ +
LDA BootsEquipment : BEQ .done ; Check for Boots
+
LDA $0372 : BEQ .done ; things we wrote over
@@ -62,7 +57,7 @@ GravestoneHook:
JML.l GravestoneHook_continue
;--------------------------------------------------------------------------------
JumpDownLedge:
LDA !BOOTS_MODIFIER : CMP.b #$01 : BEQ +
LDA BootsModifier : CMP.b #$01 : BEQ +
LDA BootsEquipment : BNE + ; Check for Boots
; Disarm Waterwalk
LDA $5B : CMP.b #$01 : BNE +
@@ -73,7 +68,7 @@ JumpDownLedge:
RTL
;--------------------------------------------------------------------------------
BonkRecoil:
LDA !BOOTS_MODIFIER : CMP.b #$01 : BEQ +
LDA BootsModifier : CMP.b #$01 : BEQ +
LDA BootsEquipment : BNE + ; Check for Boots
LDA.b #$16 : STA $29 : RTL
+

View File

@@ -49,7 +49,7 @@ DecideIfBunnyByScreenIndex:
; superbunny work
LDA $1B : BNE .done
LDA MoonPearlEquipment : BNE .done
PHX : LDX $8A : LDA.l OWTileWorldAssoc, X : PLX : PHA
LDA $8A : AND.b #$40 : PHA
LDA.l InvertedMode : BNE .inverted
.normal
PLA : EOR #$40
@@ -123,7 +123,7 @@ FixFrogSmith:
STA.l FollowerIndicator
JSL Tagalong_LoadGfx
.done
RTL
RTS
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------

View File

@@ -1,2 +1,4 @@
py -3 build.py
@echo %cmdcmdline%|find /i """%~f0""">nul && cmd /k
del ..\working.sfc
copy ..\alttp.sfc ..\working.sfc
xkas.exe LTTP_RND_GeneralBugfixes.asm ..\working.sfc
cmd /k

115
build.py
View File

@@ -1,115 +0,0 @@
import os
import sys
import hashlib
from asar import init as asar_init, close as asar_close, patch as asar_patch, geterrors as asar_errors, getprints as asar_prints, getwarnings as asar_warnings
JAP10HASH = '03a63945398191337e896e5771f77173'
try:
from yaml import CLoader as Loader
except ImportError:
from yaml import Loader
def int16_as_bytes(value):
value = value & 0xFFFF
return [value & 0xFF, (value >> 8) & 0xFF]
def int32_as_bytes(value):
value = value & 0xFFFFFFFF
return [value & 0xFF, (value >> 8) & 0xFF, (value >> 16) & 0xFF, (value >> 24) & 0xFF]
def is_bundled():
return getattr(sys, 'frozen', False)
def local_path(path):
if local_path.cached_path:
return os.path.join(local_path.cached_path, path)
elif is_bundled():
if hasattr(sys, "_MEIPASS"):
# we are running in a PyInstaller bundle
local_path.cached_path = sys._MEIPASS # pylint: disable=protected-access,no-member
else:
# cx_Freeze
local_path.cached_path = os.path.dirname(os.path.abspath(sys.argv[0]))
else:
# we are running in a normal Python environment
import __main__
local_path.cached_path = os.path.dirname(os.path.abspath(__main__.__file__))
return os.path.join(local_path.cached_path, path)
local_path.cached_path = None
def make_new_base2current(old_rom_data, new_rom_data):
from collections import OrderedDict
import json
# extend to 2 mb
old_rom_data.extend(bytearray([0x00]) * (2097152 - len(old_rom_data)))
out_data = OrderedDict()
for idx, old in enumerate(old_rom_data):
new = new_rom_data[idx]
if old != new:
out_data[idx] = [int(new)]
for offset in reversed(list(out_data.keys())):
if offset - 1 in out_data:
out_data[offset-1].extend(out_data.pop(offset))
with open('../base2current.json', 'wt') as outfile:
json.dump([{key: value} for key, value in out_data.items()], outfile, separators=(",", ":"))
basemd5 = hashlib.md5()
basemd5.update(new_rom_data)
return "New Rom Hash: " + basemd5.hexdigest()
if __name__ == '__main__':
try:
asar_init()
print("Asar DLL initialized")
print("Opening Base rom")
with open('../alttp.sfc', 'rb') as stream:
old_rom_data = bytearray(stream.read())
if len(old_rom_data) % 0x400 == 0x200:
old_rom_data = old_rom_data[0x200:]
basemd5 = hashlib.md5()
basemd5.update(old_rom_data)
if JAP10HASH != basemd5.hexdigest():
raise Exception("Base rom is not 'Zelda no Densetsu - Kamigami no Triforce (J) (V1.0)'")
print("Patching Base Rom")
result, new_rom_data = asar_patch(os.path.abspath('LTTP_RND_GeneralBugfixes.asm'), old_rom_data)
if result:
with open('../working.sfc', 'wb') as stream:
stream.write(new_rom_data)
print("Success\n")
print(make_new_base2current(old_rom_data, new_rom_data))
prints = asar_prints()
for p in prints:
print(p)
else:
errors = asar_errors()
print("\nErrors: " + str(len(errors)))
for error in errors:
print (error)
warnings = asar_warnings()
print("\nWarnings: " + str(len(warnings)))
for w in warnings:
print(w)
asar_close()
except:
import traceback
traceback.print_exc()

View File

@@ -3,7 +3,6 @@
;--------------------------------------------------------------------------------
!HEART_REDRAW = "$7F5000"
LoadCatfishItemGFX:
LDA.l CatfishItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA.l $1DE185 ; location randomizer writes catfish item to
JML PrepDynamicTile
;--------------------------------------------------------------------------------
@@ -22,21 +21,14 @@ DrawThrownItem:
JML DrawDynamicTile
;--------------------------------------------------------------------------------
MarkThrownItem:
PHA
JSL Link_ReceiveItem ; thing we wrote over
LDA $8A : CMP.b #$81 : BNE .catfish
.zora
JSL.l ItemSet_ZoraKing
LDA ZoraItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID
BRA .done
JML ItemSet_ZoraKing
.catfish
JSL.l ItemSet_Catfish
LDA CatfishItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID
JML ItemSet_Catfish
.done
PLA
JSL Link_ReceiveItem ; thing we wrote over
RTL
;--------------------------------------------------------------------------------

View File

@@ -3,7 +3,6 @@
;--------------------------------------------------------------------------------
DrawDungeonCompassCounts:
SEP #$10
LDX $1B : BNE + : RTL : + ; Skip if outdoors
; extra hard safeties for getting dungeon ID to prevent crashes
@@ -11,42 +10,33 @@ DrawDungeonCompassCounts:
LDA.w $040C : AND.w #$00FE : TAX ; force dungeon ID to be multiple of 2
PLA
CPX.b #$1B : BCC + ; Skip if not in a valid dungeon ID
JMP .done
+
BIT.w #$0002 : BNE ++ ; if CompassMode==2, we don't check for the compass
TXY : TXA : LSR : TAX : LDA.l ExistsTransfer, X : TAX : LDA CompassExists, X : BEQ ++
TYX : LDA CompassField : AND.l DungeonItemMasks, X ; Load compass values to A, mask with dungeon item masks
BNE ++
JMP .done ; skip if we don't have compass
++
CPX.b #$1B : BCS .done ; Skip if not in a valid dungeon ID
LDA $040C : LSR
BNE +
INC
+ TAX : LDA.l CompassTotalsWRAM, X : AND #$00FF
PHX
PHA
JSL HexToDec_fast
PLA : CMP.w #100 : !BLT .two_digit
LDX.b $05 : TXA : ORA #$2490 : STA $7EC79A
LDX.b $06 : TXA : ORA #$2490 : STA $7EC79C
LDX.b $07 : TXA : ORA #$2490 : STA $7EC79E
BRA .end_total
.two_digit
LDX.b $06 : TXA : ORA #$2490 : STA $7EC79A
LDX.b $07 : TXA : ORA #$2490 : STA $7EC79C
.end_total
BIT.w #$0002 : BNE ++ ; if CompassMode==2, we don't check for the compass
LDA CompassField : AND.l DungeonItemMasks, X ; Load compass values to A, mask with dungeon item masks
BEQ .done ; skip if we don't have compass
++
TXA : LSR : TAX
BNE +
INC
+
LDA.l CompassTotalsWRAM, X : AND #$00FF
SEP #$20
JSR HudHexToDec2Digit
REP #$20
PHX
LDX.b $06 : TXA : ORA #$2400 : STA $7EC79A
LDX.b $07 : TXA : ORA #$2400 : STA $7EC79C
PLX
LDA DungeonLocationsChecked, X : AND #$00FF
PHA
JSL HexToDec_fast
PLA : CMP.w #100 : !BLT +
LDX.b $05 : TXA : ORA #$2490 : STA $7EC792 ; Draw the 100's digit
+
LDX.b $06 : TXA : ORA #$2490 : STA $7EC794 ; Draw the item count
LDX.b $07 : TXA : ORA #$2490 : STA $7EC796
LDA DungeonLocationsChecked, X : AND #$00FF
SEP #$20
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
@@ -55,13 +45,6 @@ RTL
DungeonItemMasks: ; 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
; maps from $040C to the odd order used in overworld map
ExistsTransfer:
db $0C, $0C, $00, $02, $0B, $09, $03, $07, $04, $08, $01, $06, $05, $0A
;--------------------------------------------------------------------------------
; $7EF4C0-7EF4CF - item locations checked indexed by $040C >> 1
;--------------------------------------------------------------------------------
InitCompassTotalsRAM:
LDX #$00
@@ -70,3 +53,4 @@ InitCompassTotalsRAM:
INX
CPX #$0F : !BLT -
RTL

View File

@@ -180,6 +180,3 @@ Sprite_ShowSolicitedMessageIfPlayerFacing_PreserveMessage:
RTL
}
;================================================================
incsrc menu/hudalpha.asm
incsrc util/utils.asm

View File

@@ -4,62 +4,6 @@
;--------------------------------------------------------------------------------
; Filtered Joypad 1 Register: [AXLR | ????]
; Filtered Joypad 1 Register: [BYST | udlr] [AXLR | ????]
!INVERT_DPAD = "$7F50CB"
InvertDPad_DPadOnly:
LDA $4218 : STA $00
LDA $4219
BIT.b #$0C : BEQ + : EOR.b #$0C : + ; swap up/down
BIT.b #$03 : BEQ + : EOR.b #$03 : + ; swap left/right
STA $01
JML.l InvertDPadReturn
InvertDPad_ButtonsOnly:
REP #$20 ; set 16-bit accumulator
LDA $4218
BIT.w #$8040 : BEQ + : EOR.w #$8040 : + ; swap X/B
BIT.w #$4080 : BEQ + : EOR.w #$4080 : + ; swap Y/A
STA $00
SEP #$20 ; set 8-bit accumulator
JML.l InvertDPadReturn
InvertDPad_Both:
REP #$20 ; set 16-bit accumulator
LDA $4218
BIT.w #$8040 : BEQ + : EOR.w #$8040 : + ; swap X/B
BIT.w #$4080 : BEQ + : EOR.w #$4080 : + ; swap Y/A
BIT.w #$0C00 : BEQ + : EOR.w #$0C00 : + ; swap up/down
BIT.w #$0300 : BEQ + : EOR.w #$0300 : + ; swap left/right
STA $00
SEP #$20 ; set 8-bit accumulator
JML.l InvertDPadReturn
InvertDPad_SwapSides:
REP #$20 ; set 16-bit accumulator
LDA $4218
BIT.w #$0840 : BEQ + : EOR.w #$0840 : + ; swap X/up
BIT.w #$0180 : BEQ + : EOR.w #$0180 : + ; swap A/right
BIT.w #$4200 : BEQ + : EOR.w #$4200 : + ; swap Y/left
BIT.w #$8400 : BEQ + : EOR.w #$8400 : + ; swap B/down
STA $00
SEP #$20 ; set 8-bit accumulator
JML.l InvertDPadReturn
InvertDPad_DPadLROnly:
LDA $4218 : STA $00
LDA $4219
BIT.b #$03 : BEQ + : EOR.b #$03 : + ; swap left/right
STA $01
JML.l InvertDPadReturn
InvertDPad_DPadUDOnly:
LDA $4218 : STA $00
LDA $4219
BIT.b #$0C : BEQ + : EOR.b #$0C : + ; swap up/down
STA $01
JML.l InvertDPadReturn
InvertDPad:
LDA.l OneMindPlayerCount : BEQ .crowd_control
@@ -78,27 +22,50 @@ InvertDPad:
JML.l InvertDPadReturn
.crowd_control
LDA !INVERT_DPAD : BNE +
LDA.b $A0 : CMP.b #$DE : BNE .off
LDA.b #$01 : BRA +
LDA InvertDPadModifier : BNE +
.off
LDA $4218 : STA $00
LDA $4219 : STA $01
JML.l InvertDPadReturn
+ DEC : BNE +
JMP.w InvertDPad_DPadOnly
+ DEC : BNE +
JMP.w InvertDPad_ButtonsOnly
+ DEC : BNE +
JMP.w InvertDPad_Both
+ DEC : BNE +
JMP.w InvertDPad_SwapSides
+ DEC : BNE +
JMP.w InvertDPad_DPadLROnly
+ JMP.w InvertDPad_DPadUDOnly
+ DEC : BEQ .dpadOnly
DEC : BEQ .buttonsOnly
DEC : BEQ .invertBoth
.swapSides
REP #$20 ; set 16-bit accumulator
LDA $4218
BIT.w #$0840 : BEQ + : EOR.w #$0840 : + ; swap X/up
BIT.w #$0180 : BEQ + : EOR.w #$0180 : + ; swap A/right
BIT.w #$4200 : BEQ + : EOR.w #$4200 : + ; swap Y/left
BIT.w #$8400 : BEQ + : EOR.w #$8400 : + ; swap B/down
STA $00
SEP #$20 ; set 8-bit accumulator
JML.l InvertDPadReturn
.invertBoth
REP #$20 ; set 16-bit accumulator
LDA $4218
BIT.w #$8040 : BEQ + : EOR.w #$8040 : + ; swap X/B
BIT.w #$4080 : BEQ + : EOR.w #$4080 : + ; swap Y/A
BIT.w #$0C00 : BEQ + : EOR.w #$0C00 : + ; swap up/down
BIT.w #$0300 : BEQ + : EOR.w #$0300 : + ; swap left/right
STA $00
SEP #$20 ; set 8-bit accumulator
JML.l InvertDPadReturn
.buttonsOnly
REP #$20 ; set 16-bit accumulator
LDA $4218
BIT.w #$8040 : BEQ + : EOR.w #$8040 : + ; swap X/B
BIT.w #$4080 : BEQ + : EOR.w #$4080 : + ; swap Y/A
STA $00
SEP #$20 ; set 8-bit accumulator
JML.l InvertDPadReturn
.dpadOnly
LDA $4218 : STA $00
LDA $4219
BIT.b #$0C : BEQ + : EOR.b #$0C : + ; swap up/down
BIT.b #$03 : BEQ + : EOR.b #$03 : + ; swap left/right
STA $01
JML.l InvertDPadReturn
.onemind_controller_offset
db 0 ; player 0 - $4218 - joy1d1
@@ -108,6 +75,8 @@ InvertDPad:
db 2 ; player 4 - $421A - joy2d1
db 6 ; player 5 - $421E - joy2d2
;--------------------------------------------------------------------------------
HandleOneMindController:

View File

@@ -1,5 +1,4 @@
;================================================================================
!CUCCO_STORM = "$7F50C5"
!IS_INDOORS = "$7E001B"
!ENEMY_STATE_TABLE = "$7E0DD0"
!ENEMY_TYPE_TABLE = "$7E0E20"
@@ -22,12 +21,8 @@
CuccoStorm:
SEP #$30 ; set 8-bit accumulator index registers
LDA.l !CUCCO_STORM : BEQ + ; only if storm is on
LDA.b $10 : CMP.b #$09 : BEQ .check ; only if outdoors
.indoors
LDA.b #$00 : STA.l !CUCCO_STORM
BRA +
.check
LDA.l CuccoStormModifier : BEQ + ; only if storm is on
LDA.b $10 : CMP.b #$09 : BNE + ; only if outdoors
LDA.l LoopFrames : AND.b #$7F : BNE + ; check every 128 frames
-

Binary file not shown.

BIN
damage_table_bombos.bin Normal file

Binary file not shown.

View File

@@ -10,23 +10,14 @@ DoWorldFix:
LDA InvertedMode : BEQ +
JMP DoWorldFix_Inverted
+
LDA FollowerIndicator : CMP #$04 : BEQ .aga1Alive ; if old man following, skip mirror/aga check
LDA.l Bugfix_MirrorlessSQToLW : BEQ .skip_mirror_check
LDA MirrorEquipment : AND #$02 : BEQ .noMirror ; check if we have the mirror
LDA MirrorEquipment : BEQ .noMirror ; check if we have the mirror
.skip_mirror_check ; alt entrance point
LDA ProgressIndicator : CMP.b #$03 : BCS .done ; check if agahnim 1 is alive
.aga1Alive
LDA #$00
.noMirror
STA CurrentWorld ; set flag to light world
LDA.l SmithDeleteOnSave : BEQ .transform
LDA FollowerIndicator
CMP #$07 : BEQ .clear ; clear frog
CMP #$08 : BEQ .clear ; clear dwarf - consider flute implications
BRA .done
.clear
LDA.b #$00 : STA FollowerIndicator : BRA .done ; clear follower
.transform
LDA FollowerIndicator : CMP #$07 : BNE .done : INC : STA FollowerIndicator ; convert frog to dwarf
.done
RTL
@@ -54,23 +45,19 @@ JMP DoWorldFix_skip_mirror_check
RTL
;================================================================================
DoWorldFix_Inverted:
LDA FollowerIndicator : CMP #$04 : BEQ .aga1Alive ; if old man following, skip mirror/aga check
LDA.l Bugfix_MirrorlessSQToLW : BEQ .skip_mirror_check
LDA.l MirrorEquipment : AND #$02 : BEQ .noMirror ; check if we have the mirror
LDA MirrorEquipment : BEQ .noMirror ; check if we have the mirror
.skip_mirror_check ; alt entrance point
LDA ProgressIndicator : CMP.b #$03 : BCS .done ; check if agahnim 1 is alive
.noMirror
.aga1Alive
LDA #$40 : STA CurrentWorld ; set flag to dark world
LDA.l SmithDeleteOnSave : BEQ .transform
LDA FollowerIndicator
CMP #$07 : BEQ .clear ; clear frog
CMP #$08 : BEQ .clear ; clear dwarf - consider flute implications
BRA .done
.clear
LDA.b #$00 : STA FollowerIndicator : BRA .done ; clear follower
.transform
LDA FollowerIndicator : CMP #$07 : BNE .done : INC : STA FollowerIndicator ; convert frog to dwarf
LDA FollowerIndicator
CMP #$07 : BEQ .clear ; clear frog
CMP #$08 : BEQ .clear ; clear dwarf - consider flute implications
BRA .done
.clear
LDA.b #$00 : STA FollowerIndicator ; clear follower
.done
RTL
;--------------------------------------------------------------------------------
@@ -81,7 +68,7 @@ SetDeathWorldChecked_Inverted:
LDA GanonPyramidRespawn : BNE .castle ; if flag is set, force respawn at pyramid on death to ganon
++
.outdoors
JMP DoWorldFix_Inverted
JMP DoWorldFix
.dungeon
LDA Bugfix_PreAgaDWDungeonDeathToFakeDW : BNE .done ; if the bugfix is enabled, we do nothing on death in dungeon
@@ -98,9 +85,7 @@ RTL
;--------------------------------------------------------------------------------
FakeWorldFix:
LDA FixFakeWorld : BEQ +
PHX
LDX $8A : LDA.l OWTileWorldAssoc, X : STA CurrentWorld
PLX
LDA $8A : AND.b #$40 : STA CurrentWorld
+
RTL
;--------------------------------------------------------------------------------

View File

@@ -268,7 +268,8 @@ RTL
DialogFairyThrow:
LDA.l Restrict_Ponds : BEQ .normal
LDA BottleContentsOne
ORA BottleContentsTwo : ORA BottleContentsThree : ORA BottleContentsFour : BNE .normal
ORA BottleContentsTwo : ORA BottleContentsThree : ORA BottleContentsFour : BNE .normal
.noInventory
LDA $0D80, X : !ADD #$08 : STA $0D80, X
LDA.b #$51
@@ -284,10 +285,7 @@ DialogGanon1:
REP #$20
LDA.w #$018C
BCC +
JSL CheckMushroom
LDA.w #$016D
BCC +
LDA.w #$0197
+ STA $1CF0
SEP #$20
JSL.l Sprite_ShowMessageMinimal_Alt
@@ -307,10 +305,6 @@ DialogGanon2:
REP #$20
BCS +
LDA.w #$018D : JMP .done
+
JSL CheckMushroom
BCC +
LDA.w #$0198 : JMP .done
+
LDA.l GanonVulnerabilityItem : AND #$00FF : BNE .special_item
LDA.l SpecialWeapons : AND.w #$00FF

View File

@@ -37,41 +37,3 @@ WalkDownIntoTavern:
CMP #$43
RTL
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
; TurnAroundOnUnderworld
;--------------------------------------------------------------------------------
TurnAroundOnUnderworld:
LDA $26 : BEQ .done
; turn around if ($010E == #$43) != ($7F5099 == #$43)
LDX #$00
LDA #$43 : CMP $010E : BEQ +
INX
+
CMP $7F5099 : BEQ +
DEX
+
CPX #$00 : BEQ .done
LDA $26 : EOR #$0C : STA $26
.done
JML $0FFD65 ; what we overwrote
;--------------------------------------------------------------------------------
; TurnUpOnOverworld
;--------------------------------------------------------------------------------
TurnUpOnOverworld:
LDA.l EntranceTavernBack : CMP #$43 : BEQ .done
LDA #$08 : STA $26 ; only fix this glitch if exit not vanilla
.done
JML $07E68F ; what we overwrote
;--------------------------------------------------------------------------------
; WalkUpOnOverworld
;--------------------------------------------------------------------------------
WalkUpOnOverworld:
LDA $20 : CMP #$091B : BNE .normal ; hardcoded Y coordinate
STZ $2F
RTL
.normal
LDA #$0002 : STA $2F ; what we overwrote
RTL

View File

@@ -1,59 +0,0 @@
!add = "clc : adc"
!addl = "clc : adc.l"
!sub = "sec : sbc"
!bge = "bcs"
!blt = "bcc"
; Free RAM notes
; Normal doors use $AB-AC for scrolling indicator
; Normal doors use $FE to store the trap door indicator
; Normal doors use $045e to store Y coordinate when transitioning to in-room stairs
; Normal doors use $045f to determine the order in which supertile quadrants are drawn
; Straight stairs use $046d to store X coordinate on animation start
; Spiral doors use $045e to store stair type
; Gfx uses $b1 to for sub-sub-sub-module thing
; Hooks into various routines
incsrc drhooks.asm
;Main Code
org $A78000 ;138000
db $44, $52 ;DR
DRMode:
dw 0
; xxpg rmse
; xxxx xBDM
; x - unused
; p - use the original palette for the dungeon rooms instead of the DR table
; g - fix the EG glitch in more places (should be off for no logic)
; r - The collection rate flag
; m - Whether to display keys Map Info
; s - Start with Mirror Scroll
; e - GT minibosses marked as defeated instead of spawning heart container in all dungeons
; B - Big Key doors can displayed and be opened on the "south" side in addition
; D - Enabled spawning as a bunny in the Dark World underworld
; M - hides the total number in the collection rate
DRFlags:
dw 0
DRScroll:
db 0
OffsetTable:
dw -8, 8
incsrc normal.asm
incsrc scroll.asm
incsrc spiral.asm
incsrc gfx.asm
incsrc keydoors.asm
incsrc overrides.asm
incsrc edges.asm
incsrc math.asm
incsrc hudadditions.asm
incsrc dr_lobby.asm
incsrc entrance_fixes.asm
warnpc $A79C00
incsrc doortables.asm
warnpc $A88000

View File

@@ -1,696 +0,0 @@
org $A79C00
KeyDoorOffset:
; 0 1 2 3 4 5 6 7 8 9 a b c d e f --Offset Ruler
dw $0000,$0001,$0003,$0000,$0006,$0000,$000b,$0000,$0000,$0000,$000c,$000d,$0010,$0011,$0012,$0000
dw $0000,$0015,$0018,$001c,$001e,$0025,$0027,$0000,$0000,$002b,$002d,$0033,$0035,$0038,$0039,$003d
dw $003f,$0040,$0043,$0045,$0047,$0000,$004f,$0000,$0053,$0000,$0055,$005b,$0000,$0000,$005f,$0000
dw $0060,$0062,$0064,$0065,$0066,$0068,$006e,$0074,$007a,$007c,$007e,$0081,$0000,$0082,$0086,$0088
dw $0089,$008a,$0000,$008b,$008e,$0092,$0096,$0000,$0000,$0099,$009d,$00a2,$00a5,$00a6,$00a8,$00aa
dw $00ab,$00ad,$00af,$00b2,$0000,$0000,$00b5,$00b9,$00bf,$00c5,$00c9,$00ca,$00cc,$00ce,$00d1,$00d5
dw $00d6,$00dc,$00e3,$00e9,$00ec,$00ed,$00ee,$00f2,$00f5,$0000,$00f7,$00f8,$00fc,$00ff,$0102,$0000
dw $0000,$0103,$0106,$0107,$010a,$010c,$010e,$0112,$0000,$0000,$0000,$0114,$0117,$011b,$011e,$0121
dw $0000,$0123,$0000,$0124,$0127,$0128,$0000,$012c,$0000,$0000,$0000,$012e,$0133,$0139,$013e,$0000
dw $013f,$0140,$0141,$0146,$0000,$0149,$014b,$014d,$014f,$0150,$0000,$0153,$0156,$015a,$015d,$0161
dw $0163,$0164,$0166,$016a,$016c,$016d,$0000,$0000,$0170,$0176,$017c,$0182,$0184,$0000,$0185,$0186
dw $0188,$018b,$018f,$0197,$019c,$019d,$019e,$01a3,$01a4,$01a6,$01aa,$01ad,$01b3,$0000,$01bb,$01be
dw $01bf,$01c2,$01ca,$01d2,$01d9,$01da,$01dd,$01e3,$01e6,$01e7,$0000,$01ec,$01ed,$0000,$01f0,$0000
dw $01f1,$01f3,$01f7,$0000,$0000,$01f8,$01fa,$0000,$01fd,$0200,$0203,$0204,$0206,$0000,$0000,$0000
dw $0207
org $A79E00
SpiralOffset:
; 0 1 2 3 4 5 6 7 8 9 a b c d e f --Offset Ruler
db $00,$01,$02,$00,$03,$00,$00,$04,$00,$05,$07,$00,$08,$00,$0b,$00
db $00,$0c,$00,$00,$00,$0d,$0e,$0f,$00,$00,$11,$00,$13,$14,$15,$00
db $00,$00,$00,$00,$00,$00,$16,$19,$1b,$00,$00,$00,$00,$00,$00,$00
db $00,$1c,$00,$00,$1f,$00,$00,$00,$20,$00,$21,$00,$00,$00,$00,$22
db $23,$24,$25,$00,$00,$26,$00,$00,$00,$00,$27,$00,$29,$2a,$2b,$00
db $00,$00,$00,$2c,$2d,$00,$00,$00,$00,$00,$00,$00,$2e,$2f,$00,$30
db $00,$00,$00,$35,$36,$00,$37,$00,$00,$00,$38,$3a,$3b,$00,$3c,$00
db $3d,$40,$41,$00,$00,$00,$42,$45,$00,$00,$00,$00,$00,$00,$00,$49
db $4a,$00,$00,$00,$00,$00,$00,$4b,$00,$00,$00,$00,$4f,$00,$53,$00
db $00,$54,$00,$55,$00,$00,$00,$56,$57,$58,$00,$00,$00,$00,$59,$00
db $5a,$00,$5b,$00,$00,$5c,$5d,$00,$00,$00,$00,$5e,$00,$00,$5f,$00
db $60,$00,$00,$00,$00,$63,$64,$00,$00,$00,$00,$00,$65,$00,$66,$00
db $67,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $6a,$6d,$6e,$00,$00,$00,$00,$00,$00,$00,$6f,$00,$00,$00,$00,$00
db $70
org $A79F00
DoorOffset:
db $00,$01,$02,$00,$03,$00,$04,$00,$00,$00,$00,$00,$9A,$05,$99,$00
db $00,$06,$07,$08,$09,$0A,$0B,$00,$00,$0C,$0D,$0E,$00,$0F,$10,$11
db $12,$13,$14,$15,$16,$00,$17,$00,$98,$00,$18,$19,$00,$00,$1A,$00
db $1B,$00,$1C,$1D,$1E,$1F,$20,$21,$22,$23,$24,$25,$00,$26,$27,$00
db $96,$28,$97,$29,$2A,$2B,$2C,$00,$00,$2D,$2E,$2F,$30,$31,$32,$00
db $33,$34,$35,$36,$00,$00,$37,$38,$39,$3A,$3B,$3C,$3D,$3E,$3F,$40
db $41,$42,$43,$A0,$00,$00,$44,$45,$46,$00,$47,$48,$49,$4A,$4B,$00
; 0 1 2 3 4 5 6 7 8 9 a b c d e f --Offset Ruler
db $00,$4C,$00,$00,$00,$4D,$4E,$9E,$00,$00,$00,$4F,$50,$51,$52,$53
db $00,$54,$00,$9C,$9D,$55,$00,$00,$00,$00,$00,$56,$57,$58,$59,$00
db $5A,$5B,$5C,$5D,$00,$5E,$5F,$00,$9B,$60,$00,$61,$62,$63,$64,$65
db $66,$67,$68,$69,$6A,$6B,$00,$00,$6C,$6D,$6E,$6F,$70,$00,$71,$72
db $00,$73,$74,$75,$76,$77,$78,$79,$7A,$7B,$7C,$7D,$7E,$00,$7F,$80
db $00,$81,$82,$83,$84,$85,$86,$87,$88,$89,$00,$8A,$8B,$00,$8C,$00
db $00,$8D,$8E,$00,$00,$8F,$90,$00,$91,$92,$93,$94,$95,$00,$00,$00
db $9f
org $A7A000
DoorTable:
;; NW 00 N 01 NE 02 WN 00 W 01 WS 02 SW 00 S 01 SE 02 EN 00 E 01 ES 02 - Door ruler
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Default/Garbage row
dw $0003, $0003, $0003, $0450, $0003, $0003, $0003, $0003, $0003, $0452, $0003, $0003 ; HC Back Hall (x01)
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Sewer Switches (x02)
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Crystaroller
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Arghus
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Aga 2
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Sewer Secret Room
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Sanc
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; TR Pokey
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; TR Lava Pipe
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; TR Pipes n Ledge
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Swap Canal
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Pod dark Maze
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Pod Bridge
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Pod Eye Statue
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; GT Pre Aga
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Ice Cross
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Ice BK
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; x20 Aga1
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Sewer Key Rat
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Sewer Waters
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; TR Eye Entrance
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; TR Chest Entrance
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Swamp Statue
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; PoD Arena (x2a)
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; PoD Statue (x2b)
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Ice Compass
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; x30 Aga's Altar
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Dark Cross
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Lanmolas
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Swamp West Wing
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Flooded Key
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Swamp Main Hub (x36)
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Swamp Hammer Time
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Swamp First Basement
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Drop to the Moth
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Pod 3 Catwalks
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Pod Conveyor
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; GT Minihelma
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Ice Conveyor
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Sewers
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Desert Torches
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; TT Big Chest
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; TT Cellblock
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Swamp Compass Loop
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Skull3 Torches
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Pod Entrance
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Pod Mimics 1
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; GT Conveyor Ice
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; GT Moldorm
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; IPBJ
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0401, $0003, $0003 ; HC West Hall (x50)
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; HC Throne Room (x51)
dw $0003, $0003, $0003, $0401, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; HC East Hall (x52)
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Desert Tiles 1
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Skull 2 Left Entrance
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Skull 2 Right Entrance
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Skull 1 Entrance
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Skull 3 Entrance
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Helmasaur
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; GT Spike Switch
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; GT Cannonball
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Gauntlet 1
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Ice Choice Cross
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Iced U
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; HC West Lobby (x60)
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; HC Main Lobby (x61)
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; HC East Lobby (x62)
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; x66 Swamp Waterfall
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; x67 Skull 1 Left Drop
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; x68 Skull 1 Pinball
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; x6a Pod Rupees
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; x6b GT Mimics
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; x6c GT Lanmolas
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; x6d Gauntlet 2
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; x6e Ice Gators
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; HC Armory
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Desert BK Chest
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Swamp Flooded Chests
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; GT DM's Tile
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; GT Randoroom
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; GT Warp Maze
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Ice Freezors
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Ice Hookpit
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; HC Catawalk
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Desert Right Entrance
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; GT Left
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; GT Hopeful Torch
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; GT Right
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Ice Lonely Freezor
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Vitreous (x90)
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Mire Rain
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Mire Dark Crystals
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Mire Blockswitch
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; GT Fallbridge
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; GT Torch Cross
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Eastern Darkness
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; GT Warp Maze 2
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; GT Invis Bridge
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; GT Compass Room
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Ice Big Chests
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Icy Pots
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Mire Pre-Vitreous (xa0)
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Mire Fishbone
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Mire Bridges
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Mire Corner
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Trinexx (xa4)
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; GT Wizzrobes
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Eastern Compass (xa8)
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Eastern Courtyard (xa9)
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Eastern Map (xaa)
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; TT Switch
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Blind
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Iced T
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Ice Slipway
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Mire Warpzone
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Mire ????
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Mire Spikes
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; TR Refill
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; TR Dark Maze
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; TR Chainchomp
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; TR Rollers
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Eastern Big Key
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Easter Cannonball
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Eastern Dark Circle
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; TT Hellway
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; TT Bossway
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Ice Blockswitch
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Ice Backtracker
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Mire Tiles
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Mire Main Hub
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Mire Big Chest
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; TR Switch Maze
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; TR Narrow
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; TR Early Hub
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; TR Floating Torches
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Armos
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Eastern Entrance
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; TT NW Quad
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; TT NE Quad
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Ice Boss Drop
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Mire BK
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Mire 2
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; TR Laser Bridge
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; TR Main Entrance
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Eastern Eyegores
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Eastern Attic Switches
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Eastern Attic Start
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; TT Entrance Quad
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; TT SE Quad
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Aga 6F
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Sewers Rope
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Swamp Lobby
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Ice Lobby
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; GT Lobby
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Mire Lobby
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Desert West Lobby
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Desert Main Lobby
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Hera Lobby
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Tower Lobby
dw $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003, $0003 ; Desert Back Lobby
; this should end at 27AF18 about (160 * 24 bytes = 3840 or F18)
; some values you can hardcode for spirals
;dw $0070, $36a0 ; ->HC Stairwell
;dw $0072, $4ff8 ; ->HC Map Room
;dw $0080, $1f50 ; ->zelda's cellblock
org $A7B000
SpiralTable: ;113 4 byte entries - should end at 27B1C4
dw $0203, $8080 ;null row
dw $0203, $8080 ;HC Backhallway
dw $0203, $8080 ;Sewer Pull
dw $0203, $8080 ;Crystaroller
dw $0203, $8080 ;Moldorm
dw $0203, $8080, $0203, $8080 ;Pod Basement
dw $0203, $8080 ;Pod Stalfos
dw $0203, $8080, $0203, $8080, $0203, $8080 ;GT Entrance
dw $0203, $8080 ;Ice Entrance
dw $0203, $8080 ;Escape
dw $0203, $8080 ;TR Pipe Ledge
dw $0203, $8080 ;Swamp Way
dw $0203, $8080, $0203, $8080 ;Hera Fallplace
dw $0203, $8080, $0203, $8080 ;PoD Bridge
dw $0203, $8080 ;GT Ice
dw $0203, $8080 ;GT F8
dw $0203, $8080 ;Ice Cross
dw $0203, $8080, $0203, $8080, $0203, $8080 ;Swamp Statue
dw $0203, $8080, $0203, $8080 ;Hera Big
dw $0203, $8080 ;Swamp Ent
dw $0203, $8080, $0203, $8080, $0203, $8080 ;Hera Startiles (middle value unused)
dw $0203, $8080 ;West Swamp
dw $0203, $8080 ;Swamp Basement
dw $0203, $8080 ;Pod Drops
dw $0203, $8080 ;Ice Hammer
dw $0203, $8080 ;Aga Guards
dw $0203, $8080 ;Sewer Begin
dw $0203, $8080 ;Sewer Rope
dw $0203, $8080 ;TT Cellblock
dw $0203, $8080, $0203, $8080 ;Pod Entrance
dw $0203, $8080 ;GT Icespike
dw $0203, $8080 ;GT Moldorm
dw $0203, $8080 ;IPBJ
dw $0203, $8080 ;Desert Prep
dw $0203, $8080 ;Swamp Attic
dw $0203, $8080 ;GT Cannonball
dw $0203, $8080 ;GT Gauntlet1
dw $0203, $8080, $0203, $8080, $0203, $8080, $0203, $8080, $0203, $8080 ;Ice U (1st three values unused)
dw $0203, $8080 ;Desert Back
dw $0203, $8080 ;TT Attic L
dw $0203, $8080 ;Swamp Waterf
dw $0203, $8080 ;Pod Rupees
dw $0203, $8080 ;Pod Rupees
dw $0203, $8080 ;GT Mimics
dw $0203, $8080 ;GT Lanmo
dw $0203, $8080 ;Ice Gators
dw $0203, $8080, $0203, $8080, $0203, $8080 ;HC Tiny (first value placeholder)
dw $0203, $8080 ;HC Boomer
dw $0203, $8080 ;HC Pits1
dw $0203, $8080, $0203, $8080, $0203, $8080 ;Swamp Sunken
dw $0203, $8080, $0203, $8080, $0203, $8080, $0203, $8080 ;Hera Entrance (first value unused)
dw $0203, $8080 ;Ice Hookshot
dw $0203, $8080 ;HC Cellblock
dw $0203, $8080, $0203, $8080, $0203, $8080, $0203, $8080 ;Hera Basement (first and third values unused)
dw $0203, $8080, $0203, $8080, $0203, $8080, $0203, $8080 ;GT Circle (third value unused)
dw $0203, $8080 ;Ice Last Freeze
dw $0203, $8080 ;Mire Drops
dw $0203, $8080 ;Mire Block
dw $0203, $8080 ;Mire Attic
dw $0203, $8080 ;Mire Entrance
dw $0203, $8080 ;East Dark
dw $0203, $8080 ;Ice Big
dw $0203, $8080 ;Mire Previtreous
dw $0203, $8080 ;Mire Bridges
dw $0203, $8080 ;GT Wizzrobes
dw $0203, $8080 ;GT Spikepit
dw $0203, $8080 ;TT Switch
dw $0203, $8080 ;Ice T
dw $0203, $8080, $0203, $8080, $0203, $8080 ;Tower Usains (2nd value unused)
dw $0203, $8080 ;TR PlatMaze
dw $0203, $8080 ;TR Chainchomp
dw $0203, $8080 ;TT Bossway
dw $0203, $8080 ;Ice FallZone
dw $0203, $8080, $0203, $8080, $0203, $8080 ;Tower Dark2 (2nd value unused)
dw $0203, $8080, $0203, $8080, $0203, $8080 ;Tower Dark1 (2nd value unused)
dw $0203, $8080 ;Mire BK Thang
dw $0203, $8080 ;Mire2
dw $0203, $8080 ;East Attic Start
dw $0203, $8080 ;Tower Entrance
org $A7C000 ;ends around 27C418
PairedDoorTable:
dw $0000 ; the bad template
dw $0000,$0000
dw $0000,$0000,$0000
dw $0000,$0000,$0000,$0000,$0000
dw $0000
dw $0000
dw $0000,$0000,$0000
dw $0000
dw $0000
dw $0000,$0000,$0000
dw $0000,$0000,$8021
dw $0000,$0000,$0000,$0000
dw $4014,$0000
dw $8024,$8013,$0000,$0000,$0000,$0000,$0000
dw $0000,$0000
dw $0000,$0000,$0000,$0000
dw $201a,$401a
dw $0000,$4019,$8019,$402a,$0000,$0000
dw $0000,$0000
dw $0000,$0000,$0000
dw $0000
dw $0000,$0000,$0000,$0000
dw $0000,$0000
dw $0000
dw $2011,$0000,$0000
dw $8032,$0000
dw $0000,$0000
dw $8014,$0000,$0000,$0000,$0000,$0000,$0000,$0000
dw $4036,$0000,$0000,$0000
dw $0000,$0000
dw $0000,$101a,$402b,$0000,$0000,$0000
dw $0000,$202a,$0000,$0000
dw $0000
dw $0000,$0000
dw $0000,$0000
dw $8022
dw $0000
dw $0000,$0000
dw $2036,$0000,$0000,$0000,$0000,$0000
dw $8037,$8026,$8035,$0000,$0000,$0000
dw $8036,$8038,$0000,$4038,$0000,$0000
dw $4037,$1037
dw $0000,$0000
dw $204a,$0000,$0000
dw $0000
dw $0000,$0000,$804d,$0000
dw $0000,$404e
dw $0000
dw $0000
dw $0000
dw $0000,$0000,$2053
dw $0000,$0000,$0000,$0000
dw $0000,$0000,$0000,$0000
dw $0000,$0000,$0000
dw $0000,$0000,$8059,$0000
dw $0000,$0000,$803a,$0000,$0000
dw $0000,$0000,$0000
dw $0000
dw $203d,$0000
dw $0000,$403e
dw $0000 ; this is the odd extra room - shouldn't be used
dw $0000,$0000
dw $0000,$0000
dw $0000,$0000,$0000
dw $0000,$0000,$2043
dw $0000,$0000,$0000,$0000
dw $0000,$0000,$4058,$0000,$0000,$0000
dw $0000,$2057,$4068,$0000,$0000,$0000
dw $2049,$0000,$0000,$0000
dw $0000
dw $806b,$0000
dw $0000,$0000
dw $0000,$0000,$0000
dw $805f,$0000,$0000,$0000
dw $805e
dw $0000,$0000,$0000,$0000,$0000,$0000
dw $0000,$0000,$0000,$0000,$0000,$0000,$0000
dw $0000,$0000,$0000,$0000,$0000,$0000
dw $0000,$0000,$0000
dw $0000
dw $0000
dw $0000,$0000,$0000,$0000
dw $0000,$0000,$0000
dw $0000,$2058
dw $0000
dw $805b,$0000,$0000,$0000
dw $0000,$0000,$0000
dw $0000,$0000,$0000
dw $0000
dw $0000,$0000,$0000
dw $0000
dw $0000,$0000,$0000
dw $0000,$0000
dw $0000,$0000
dw $0000,$0000,$0000,$0000
dw $0000,$0000
dw $0000,$207c,$0000
dw $0000,$407d,$407b,$0000
dw $0000,$407c,$0000
dw $808e,$0000,$0000
dw $0000,$0000
dw $0000
dw $0000,$0000,$0000
dw $0000
dw $0000,$0000,$0000,$0000
dw $0000,$0000
dw $0000,$0000,$0000,$0000,$0000
dw $0000,$0000,$0000,$0000,$0000,$0000
dw $0000,$0000,$0000,$0000,$0000
dw $807e
dw $0000
dw $0000
dw $0000,$0000,$0000,$0000,$0000
dw $0000,$0000,$0000
dw $0000,$0000
dw $0000,$0000
dw $0000,$0000
dw $0000
dw $0000,$20a9,$0000
dw $0000,$0000,$0000
dw $0000,$0000,$0000,$0000
dw $0000,$0000,$0000
dw $0000,$0000,$0000,$0000
dw $0000,$0000
dw $0000
dw $40b1,$0000
dw $80b2,$0000,$0000,$0000
dw $0000,$0000
dw $0000
dw $0000,$0000,$0000
dw $0000,$0000,$80b8,$0000,$0000,$0000
dw $0000,$0000,$4099,$0000,$0000,$0000
dw $0000,$0000,$0000,$0000,$0000,$0000
dw $0000,$0000
dw $0000
dw $0000
dw $0000,$0000
dw $0000,$0000,$0000
dw $0000,$80a1,$0000,$0000
dw $80a2,$0000,$0000,$0000,$0000,$0000,$0000,$0000
dw $0000,$0000,$0000,$0000,$0000
dw $0000
dw $0000
dw $0000,$0000,$80c6,$0000,$0000
dw $0000
dw $20a8,$0000
dw $80ba,$0000,$0000,$0000
dw $80b9,$0000,$0000
dw $0000,$0000,$0000,$0000,$0000,$0000
dw $0000,$80cc,$0000,$40cc,$0000,$0000,$0000,$0000
dw $0000,$80bf,$0000
dw $40be
dw $0000,$0000,$0000
dw $0000,$40c2,$0000,$0000,$0000,$0000,$0000,$0000
dw $80c3,$40c1,$0000,$0000,$0000,$0000,$0000,$0000
dw $80c2,$0000,$0000,$0000,$0000,$0000,$0000
dw $80c5
dw $80c4,$0000,$0000
dw $20b6,$0000,$0000,$0000,$0000,$0000
dw $0000,$0000,$0000
dw $0000
dw $0000,$0000,$0000,$0000,$0000
dw $20cc
dw $40bc,$10bc,$80cb
dw $0000
dw $0000,$0000
dw $0000,$0000,$0000,$0000
dw $0000
dw $0000,$0000
dw $0000,$0000,$0000
dw $0000,$0000,$0000
dw $0000,$0000,$0000
dw $0000
dw $0000,$0000
dw $0000
dw $0000,$0000,$0000,$0000
dw $ffff ; indicates the end - we can drop this
; Edge Transition Table (Target Room, Flags, MultiDiv ratio for edges)
org $A7C500 ;ends around 27C5F(9) 4 bytes would be 27C649
;I kind of want to split the 3rd byte into two
NorthOpenEdge:
db $00,$80,$11, $00,$80,$11, $00,$80,$11, $00,$80,$11
db $00,$80,$11, $00,$80,$11, $00,$80,$11, $00,$80,$11
db $00,$80,$11, $00,$80,$11, $00,$80,$11
SouthOpenEdge:
db $00,$80,$11, $00,$80,$11, $00,$80,$11, $00,$80,$11
db $00,$80,$11, $00,$80,$11, $00,$80,$11, $00,$80,$11
db $00,$80,$11, $00,$80,$11, $00,$80,$11
WestOpenEdge:
db $00,$80,$11, $00,$80,$11, $00,$80,$11
db $00,$80,$11, $00,$80,$11, $00,$80,$11
db $00,$80,$11, $00,$80,$11, $00,$80,$11
EastOpenEdge:
db $00,$80,$11, $00,$80,$11, $00,$80,$11
db $00,$80,$11, $00,$80,$11, $00,$80,$11
db $00,$80,$11, $00,$80,$11, $00,$80,$11
; Edge Info Table (Midpoint, Width, Min Coord)
; I kind of want to add a fourth byte to help indicate quadrant info on min coord
NorthEdgeInfo:
db $a8,$10,$a0, $2c,$08,$28 ;HC
db $b8,$20,$a8 ; DP West Wing
db $38,$20,$28, $f8,$a0,$a8, $b8,$20,$a8 ; DP Main
db $78,$20,$68 ; DP East Wing
db $f8,$10,$f0, $7c,$18,$70 ; TT Lobby
db $74,$18,$68, $f8,$10,$f0 ; TT Compass
SouthEdgeInfo:
db $a8,$10,$a0, $2c,$08,$28 ; HC
db $b8,$20,$a8 ; DP Sandworm
db $38,$20,$28, $f8,$a0,$a8, $b8,$20,$a8 ; DP North Hall & Dead End
db $78,$20,$68 ; DP Arrow Pot
db $f8,$10,$f0, $7c,$18,$70 ; TT Ambush
db $74,$18,$68, $f8,$10,$f0 ; TT BK Corner
WestEdgeInfo:
db $78,$30,$60 ; TT Attic
db $40,$20,$30 ; DP North Hall
db $40,$20,$30 ; DP Arrow Pot
db $84,$18,$78, $68,$10,$60 ; HC South
db $a0,$a0,$50 ; DP East Wing
db $58,$50,$30, $98,$50,$70 ; TT BK Corner
db $58,$50,$30 ; TT Compass
EastEdgeInfo:
db $78,$30,$60 ; TT Attic
db $40,$20,$30 ; DP Sandworm
db $40,$20,$30 ; DP North Hall
db $68,$10,$60, $84,$18,$78 ; HC Guards
db $a0,$a0,$50 ; DP Main Lobby
db $58,$50,$30, $98,$50,$70 ; TT Ambush
db $58,$50,$30 ; TT Nook
MultDivInfo: ; (1, 2, 3, 4, 5, 6, 10, 20)
db $01, $02, $03, $04, $05, $06, $0a, $14
; indices: 0-7
; In-room stairs in North/South pairs. From left to right:
; PoD, IP right side, IP Freezor chest and GT
org $A7C700
InroomStairsTable:
dw $0003,$0003, $0003,$0003, $0003,$0003, $0003,$0003
org $A7C720
InroomStairsRoom:
db $0B,$1B, $3F,$1F, $7E,$5E, $96,$3D
InroomStairsX:
dw $0190, $0160, $0040, $0178
InroomStairsY:
dw $0058, $0148, $0198, $0190
org $A7E000
CutoffRooms:
; TT Alcove, Mire Bridge Left & Right, Mire Bent Bridge, Mire Hub
; Pod Falling & Harmless, SW Star Pits, TR Lava Escape & TR Dual Pipes, Bob's Room & GT Big Chest
dw $00bc, $00a2, $00a3, $00c2, $001a, $0049, $0014, $008c
; Ice Many Pots, Swamp Waterfall, GT Gauntlet 3, Eastern Push Block, Eastern Courtyard, Eastern Map Valley
; Eastern Cannonball, HC East Hall
dw $009f, $0066, $005d, $00a8, $00a9, $00aa, $00b9, $0052
; HC West Hall, TR Dash Bridge, TR Hub, Pod Arena, GT Petting Zoo, Ice Spike Cross
dw $0050, $00c5, $00c6, $0009, $0003, $002a, $007d, $005e
; Sewer Drop, Mire Cross, GT Crystal Circles
dw $0011, $00b2, $003d
dw $ffff
; dungeon tables
; HC HC EP DP AT SP PD MM SW IP TH TT TR GT
org $A7f000
CompassBossIndicator:
dw $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
TotalKeys: ;27f020
db $04, $04, $02, $04, $04, $06, $06, $06, $05, $06, $01, $03, $06, $08, $00, $00
ChestKeys: ;27f030
db $01, $01, $00, $01, $02, $01, $06, $03, $03, $02, $01, $01, $04, $04, $00, $00
BigKeyStatus: ;27f040 (status 2 indicate BnC guard)
dw $0002, $0002, $0001, $0001, $0000, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0001, $0000, $0000
DungeonReminderTable: ;27f060
dw $2D50, $2D50, $2D51, $2D52, $2D54, $2D56, $2D55, $2D5A, $2D57, $2D59, $2D53, $2D58, $2D5B, $2D5C, $0000, $0000
TotalLocationsLow: ;27f080
db $08, $08, $06, $06, $02, $00, $04, $08, $08, $08, $06, $08, $02, $07, $00, $00
TotalLocationsHigh: ;27f090
db $00, $00, $00, $00, $00, $01, $01, $00, $00, $00, $00, $00, $01, $02, $00, $00
org $A7f0a0
TotalLocations:
db $08, $08, $06, $06, $02, $0a, $0e, $08, $08, $08, $06, $08, $0c, $1b, $00, $00
; no more room here
; Vert 0,6,0 Horz 2,0,8
org $A7f0b0
CoordIndex: ; Horizontal 1st
db 2, 0 ; Coordinate Index $20-$23
OppCoordIndex:
db 0, 2 ; Swapped coordinate Index $20-$23 (minor optimization)
CameraIndex: ; Horizontal 1st
db 0, 6 ; Camera Index $e2-$ea
CamQuadIndex: ; Horizontal 1st
db 8, 0 ; Camera quadrants $600-$60f
ShiftQuadIndex:
db 2, 1 ; see ShiftQuad func (relates to $a9,$aa)
CamBoundIndex: ; Horizontal 1st
db 0, 4 ; Camera Bounds $0618-$61f
OppCamBoundIndex: ; Horizontal 1st
db 4, 0 ; Camera Bounds $0618-$61f
CamBoundBaseLine: ; X camera stuff is 1st column todo Y camera needs more testing
dw $007f, $0077 ; Left/Top camera bounds when at edge or layout frozen
dw $0007, $000b ; Left/Top camera bounds when not frozen + appropriate low byte $22/$20 (preadj. by #$78/#$6c)
dw $00ff, $010b ; Right/Bot camera bounds when not frozen + appropriate low byte $20/$22
dw $017f, $0187 ; Right/Bot camera bound when at edge or layout frozen
;27f0ce next free byte
org $A7f0f0
RemoveRainDoorsRoom:
dw $0060, $0062, $ffff ; ffff indicates end of list
RainDoorMatch: ; org $A7f0f6 and f8 for now
dw $0081, $0061 ; not xba'd
BlockSanctuaryDoorInRain: ;27f0fa
dw $0000
org $A7f100
TilesetTable:
; 0 1 2 3 4 5 6 7 8 9 a b c d e f --Offset Ruler
db $13,$04,$04,$06,$0d,$ff,$08,$05,$06,$07,$07,$07,$0e,$0e,$0b,$ff
db $13,$04,$04,$0d,$0d,$0d,$08,$05,$06,$07,$07,$07,$0e,$0e,$0b,$0b
db $04,$04,$04,$0d,$0d,$ff,$08,$05,$08,$09,$07,$07,$06,$ff,$0b,$06
db $04,$05,$04,$12,$08,$08,$08,$08,$08,$09,$07,$07,$06,$0e,$0b,$0b
db $04,$04,$04,$12,$0a,$0a,$08,$ff,$ff,$09,$07,$07,$0e,$0e,$0b,$0b
db $04,$04,$04,$12,$08,$01,$09,$09,$09,$09,$07,$0e,$0e,$0e,$0b,$0b
db $04,$04,$04,$12,$0a,$0a,$08,$09,$09,$ff,$07,$0e,$0e,$0e,$0b,$ff
db $04,$04,$04,$12,$12,$12,$08,$05,$ff,$ff,$ff,$0e,$0e,$0e,$0b,$0b
db $04,$04,$04,$12,$12,$12,$ff,$05,$ff,$05,$ff,$0e,$0e,$0e,$0b,$ff
db $0c,$0c,$0c,$0c,$ff,$0e,$0e,$0c,$0c,$05,$ff,$0e,$0e,$0e,$0b,$0b
db $0c,$0c,$0c,$0c,$0d,$0e,$0e,$05,$05,$05,$05,$0a,$0a,$ff,$0b,$0b
db $04,$0c,$0c,$0c,$0d,$0d,$0d,$0d,$05,$05,$05,$0a,$0a,$ff,$0b,$0b
db $04,$0c,$0c,$0c,$0d,$0d,$0d,$0d,$05,$05,$ff,$0a,$0a,$ff,$0b,$ff
db $04,$0c,$0c,$ff,$ff,$0d,$0d,$ff,$05,$05,$05,$0a,$0a,$ff,$0b,$06
db $04,$06,$06,$06,$06,$06,$06,$06,$06,$ff,$06,$06,$ff,$06,$06,$06
db $06,$06,$03,$03,$03,$03,$ff,$ff,$06,$06,$06,$06,$ff,$06,$06,$06
;27f200
PaletteTable:
db $21,$00,$00,$07,$00,$08,$00,$00,$07,$00,$00,$00,$00,$00,$00,$21
db $21,$00,$00,$00,$00,$00,$00,$00,$07,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$0e,$00,$00,$07,$00,$00,$07
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$07,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$13
db $00,$00,$00,$00,$00,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
; 0 1 2 3 4 5 6 7 8 9 a b c d e f --Offset Ruler
db $00,$00,$00,$00,$00,$00,$00,$06,$00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$14,$20
db $00,$07,$20,$20,$07,$07,$07,$07,$07,$20,$20,$07,$20,$20,$20,$20
db $07,$07,$02,$02,$02,$02,$07,$07,$07,$20,$20,$07,$20,$20,$20,$07
;A7f300
DungeonTilesets:
db $04,$04,$05,$12,$04,$08,$07,$0C,$09,$0B,$05,$0A,$0D,$0E,$06,$06
;
;org $A7ff00
org $A7fff0
LinksHouseDarkWorld:
dw $ffff
SanctuaryDarkWorld:
dw $ffff
OldManDarkWorld:
dw $ffff

View File

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

View File

@@ -1,220 +0,0 @@
org $82b5c4 ; -- moving right routine 135c4
jsl WarpRight
org $82b665 ; -- moving left routine
jsl WarpLeft
org $82b713 ; -- moving down routine
jsl WarpDown
org $82b7b4 ; -- moving up routine
jsl WarpUp
org $82bd80
jsl AdjustTransition
nop
;turn off linking doors -- see .notRoomLinkDoor label in Bank02.asm
org $82b5a8 ; <- 135a8 - Bank02.asm : 8368 (LDA $7EC004 : STA $A0)
jsl CheckLinkDoorR
bcc NotLinkDoor1
org $82b5b6
NotLinkDoor1:
org $82b649 ; <- 135a8 - Bank02.asm : 8482 (LDA $7EC004 : STA $A0)
jsl CheckLinkDoorL
bcc NotLinkDoor2
org $82b657
NotLinkDoor2:
; Staircase routine
org $81c3d4 ; <- c3d4 - Bank01.asm : 9762-4 (Dungeon_DetectStaircase-> STA $A0 : LDA $063D, X)
jsl RecordStairType : nop
org $82a1e7 ;(PC: 121e7)
jsl SpiralWarp
org $8291b3 ; <- Bank02.asm : 3303 (LDA $0462 : AND.b #$04)
jsl SpiralPriorityHack : nop
org $8290f9 ; <- Bank02.asm : 3188 (LDA $0462 : AND.b #$04)
jsl SpiralPriorityHack : nop
org $829369 ; <- 11369 - Bank02.asm : 3610 (STX $0464 : STY $012E)
jsl StraightStairsAdj : nop #2
org $829383 ; <- 11384 - Bank02.asm : 3629 (.walkingDownStaircase-> ADD $20 : STA $20)
jsl StraightStairsFix : nop
org $8293aa ; <- 113aa - Bank02.asm : 3653 (ADD $20 : STA $20)
jsl StraightStairsFix : nop
org $8293d1 ; <- 113d1 - Bank02.asm : 3683 (ADD $20 : STA $20 BRANCH_IOTA)
jsl StraightStairsFix : nop
org $829396 ; <- 11396 - Bank02.asm : 3641 (LDA $01C322, X)
jsl StraightStairLayerFix
org $82c092 ; STA $0020, Y : LDX #$00
jsl DoorToInroom : nop
org $82c0f8 ; CMP $02C034, X
jsl DoorToInroomEnd
org $82941a ; <- Bank02.asm : 3748 module 7.12.11 (LDA $0464 : BNE BRANCH_$11513 : INC $B0 : RTS)
jsl StraightStairsTrapDoor : rts
org $828b54 ; <- Bank02.asm : 2200 (JSL UseImplicitRegIndexedLocalJumpTable)
jsl InroomStairsTrapDoor
org $82c146
jsl HandleSpecialDoorLanding
org $8289a0 ; JSL $0091C4
jsl QuadrantLoadOrderBeforeScroll
org $82bd9c ; JSL $0091C4
jsl QuadrantLoadOrderAfterScroll
; Graphics fix
org $82895d ; Bank 02 line 1812 (JSL Dungeon_LoadRoom : JSL Dungeon_InitStarTileChr : JSL $00D6F9 : INC $B0)
Splicer:
jsl GfxFixer
lda $b1 : beq .done
rts
nop #5
.done
org $81b618 ; Bank01.asm : 7963 Dungeon_LoadHeader (REP #$20 : INY : LDA [$0D], Y)
nop : jsl OverridePaletteHeader
org $82817e ; Bank02.asm : 414 (LDA $02811E, X)
jsl FixAnimatedTiles
org $8aef43 ; UnderworldMap_RecoverGFX
jsl FixCloseDungeonMap
org $828a06 ; Bank02.asm : 1941 Dungeon_ResetTorchBackgroundAndPlayer
JSL FixWallmasterLamp
org $80d377 ;Bank 00 line 3185
DecompDungAnimatedTiles:
org $80fda4 ;Bank 00 line 8882
Dungeon_InitStarTileCh:
org $80d6ae ;(PC: 56ae)
LoadTransAuxGfx:
org $80d739 ;
LoadTransAuxGfx_Alt:
org $80df5a ;(PC: 5f5a)
PrepTransAuxGfx:
org $8ffd65 ;(PC: 07fd65)
Dungeon_LoadCustomTileAttr:
org $81feb0
Dungeon_ApproachFixedColor:
;org $01fec1
;Dungeon_ApproachFixedColor_variable:
;org $a0f972 ; Rando version
;LoadRoomHook:
org $9bee74 ;(PC: 0dee74)
Palette_DungBgMain:
org $9bec77
Palette_SpriteAux3:
org $9becc5
Palette_SpriteAux2:
org $9bece4
Palette_SpriteAux1:
org $828046 ; <- 10046 - Bank02.asm : 217 (JSL EnableForceBlank) (Start of Module_LoadFile)
jsl OnFileLoadOverride
org $87A93F ; < 3A93F - Bank07.asm 6548 (LDA $8A : AND.b #$40 - Mirror checks)
jsl MirrorCheckOverride
org $85ef47
Sprite_HeartContainer_Override: ;sprite_heart_upgrades.asm : 96-100 (LDA $040C : CMP.b #$1A : BNE .not_in_ganons_tower)
jsl GtBossHeartCheckOverride : bcs .not_in_ganons_tower
nop : stz $0dd0, X : rts
.not_in_ganons_tower
org $87a955 ; <- Bank07.asm : around 6564 (JP is a bit different) (STZ $05FC : STZ $05FD)
jsl BlockEraseFix
nop #2
org $82A0A8
Mirror_SaveRoomData:
org $87A95B ; < bank_07.asm ; #_07A95B: JSL Mirror_SaveRoomData
jsl EGFixOnMirror
org $82b82a
jsl FixShopCode
org $9ddeea ; <- Bank1D.asm : 286 (JSL Sprite_LoadProperties)
jsl VitreousKeyReset
org $9ed024 ; f5024 sprite_guruguru_bar.asm : 27 (LDA $040C : CMP.b #$12 : INY #2
jsl GuruguruFix : bra .next
nop #3
.next
org $828fc9
nop #2 : jsl BlindAtticFix
org $828409
jsl SuctionOverworldFix
org $8ded04 ; <- rando's hooks.asm line 2192 - 6ED04 - equipment.asm : 1963 (REP #$30)
jsl DrHudDungeonItemsAdditions
;org $098638 ; rando's hooks.asm line 2192
;jsl CountChestKeys
org $86D192 ; rando's hooks.asm line 457
jsl CountAbsorbedKeys
; rando's hooks.asm line 1020
;org $05FC7E ; <- 2FC7E - sprite_dash_item.asm : 118 (LDA $7EF36F : INC A : STA $7EF36F)
;jsl CountBonkItem
org $819dbd ; <- Bank01.asm : 4465 of Object_Draw8xN (LDA $9B52, Y : STA $7E2000, X)
jsl CutoffEntranceRug : bra .nextTile : nop
.nextTile
;maybe set 02e2 to 0
org $8799de ; <- Bank07.asm : 4088 (LDA.b #$15 : STA $5D)
JSL StoreTempBunnyState
;
org $88c450 ; <- ancilla_receive_item.asm : 146-148 (STY $5D : STZ $02D8)
JSL RetrieveBunnyState : NOP
org $82d9ce ; <- Bank02.asm : Dungeon_LoadEntrance 10829 (STA $A0 : STA $048E)
JSL CheckDarkWorldSpawn : NOP
org $9edabf ; <- sprite_energy_ball.asm : 86-7 Sprite_EnergyBall (LDA.b #$10 : LDX.b #$00)
JSL StandardAgaDmg
org $89F7B2 ; 09F7B2 Module17_01 S&Q
JSL StandardSaveAndQuit
org $89a681 ; < - similar to talalong.asm : 1157 (JSL Main_ShowTextMessage)
JSL BlindsAtticHint : NOP #2
org $9cfd69
Main_ShowTextMessage:
; Conditionally disable UW music changes in Door Rando
org $828ADB ; <- Bank02.asm:2088-2095 (LDX.b #$14 : LDA $A0 ...)
JSL.l Underworld_DoorDown_Entry : CPX #$FF
BEQ + : db $80, $1C ; BRA $028B04
NOP #6 : +
org $82C3F2 ; <- Bank02.asm:10521 Unused call
Underworld_DoorDown_Call:
org $82C3F3
dw $8AD9 ; address of Bank02.asm:2085
org $81AA90
JSL BigKeyDoorCheck : NOP
org $81AAA2
RoomDraw_OneSidedShutters_South_onesided_shutter_or_big_key_door:
;Enable south facing bk graphic
org $80CE24
dw $2ac8
org $81b714 ; PC: b714
OpenableDoors:
jsl CheckIfDoorsOpen
bcs .normal
rts
.normal
; fixes an issue with edges -> normal doors (bombable, dashable, keydoor)
org $82C06A
JSL TransitionCalculateLanding_Fix : NOP #2
org $82C157
JSL AlwaysPushThroughFDoors

View File

@@ -1,325 +0,0 @@
; defines
; Ram usage
EdgeToNormalFlag = $7E1200
HorzEdge:
LDA.b #$00 : STA.l EdgeToNormalFlag
cpy #$ff : beq +
jsr DetectWestEdge : ldy #$02 : bra ++
+ jsr DetectEastEdge
++ cmp #$ff : beq +
sta $00 : asl : !add $00 : tax
cpy #$ff : beq ++
jsr LoadWestData : bra .main
++ jsr LoadEastData
.main
jsr LoadEdgeRoomHorz
sec : rts
+ clc : rts
VertEdge:
LDA.b #$00 : STA.l EdgeToNormalFlag
cpy #$ff : beq +
jsr DetectNorthEdge : bra ++
+ jsr DetectSouthEdge
++ cmp #$ff : beq +
sta $00 : asl : !add $00 : tax
cpy #$ff : beq ++
jsr LoadNorthData : bra .main
++ jsr LoadSouthData
.main
jsr LoadEdgeRoomVert
sec : rts
+ clc : rts
LoadEdgeRoomHorz:
lda $03 : sta $a0
sty $06
and.b #$0f : asl a : !sub $23 : !add $06 : sta $02
ldy #$00 : jsr ShiftVariablesMainDir
lda $04 : and #$80 : bne .edge
lda $04 : sta $01 ; load up flags in $01
jsr PrepScrollToNormal
bra .scroll
.edge
lda $04 : and #$10 : beq +
lda #$01
+ sta $ee ; layer stuff
jsr MathHorz
.scroll
jsr ScrollY
rts
LoadEdgeRoomVert:
lda $03 : sta $a0
sty $06
and.b #$f0 : lsr #3 : !sub $21 : !add $06 : sta $02
lda $04 : and #$80 : bne .edge
lda $04 : sta $01 ; load up flags in $01
and #$03 : cmp #$03 : beq .inroom
LDA.b #$01 : STA.l EdgeToNormalFlag
ldy #$01 : jsr ShiftVariablesMainDir
jsr PrepScrollToNormal
bra .scroll
.inroom
jsr ScrollToInroomStairs
rts
.edge
ldy #$01 : jsr ShiftVariablesMainDir
lda $04 : and #$10 : beq +
lda #$01
+ sta $ee ; layer stuff
jsr MathVert
lda $03
.scroll
jsr ScrollX
rts
MathHorz:
jsr MathStart : lda $20
jsr MathMid : and #$0040
jsr MathEnd
rts
MathVert:
jsr MathStart : lda $22
jsr MathMid : and #$0020
jsr MathEnd
rts
MathStart:
rep #$30
lda $08 : and #$00ff : sta $00
rts
MathMid:
and #$01ff : !sub $00 : and #$00ff : sta $00
; nothing should be bigger than $a0 at this point
lda $05 : and #$00f0 : lsr #4 : tax
lda MultDivInfo, x : and #$00ff : tay
lda $00 : jsr MultiplyByY : sta $02
lda $07 : and #$00ff : jsr MultiplyByY : tax
lda $05 : and #$000f : tay
lda MultDivInfo, y : and #$00ff : tay
lda $02 : jsr DivideByY : sta $00
lda $0c : and #$00ff : sta $02
lda $04
rts
MathEnd:
beq +
lda #$0100
+ !add $02 : !add $00
sta $04
sep #$30
rts
; don't need midpoint of edge Link is leaving (formerly in $06 - used by dir indicator)
; don't need width of edge Link is going to (currently in $0b)
LoadNorthData:
lda NorthOpenEdge, x : sta $03 : inx ; target room
lda NorthEdgeInfo, x : sta $07 ; needed for maths - (divide by 2 anyway)
lda NorthOpenEdge, x : sta $04 : inx ; bit field
lda NorthEdgeInfo, x : sta $08 ; needed for maths
lda NorthOpenEdge, x : sta $05 ; ratio
lda $04 : jsr LoadSouthMidpoint : inx ; needed now, and for nrml transition
lda SouthEdgeInfo, x : sta $0b : inx ; probably not needed todo: remove
lda SouthEdgeInfo, x : sta $0c ; needed for maths
rts
LoadSouthMidpoint:
and #$0f : sta $00 : asl : !add $00 : tax
lda SouthEdgeInfo, x : sta $0a ; needed now, and for nrml transition
rts
LoadSouthData:
lda SouthOpenEdge, x : sta $03 : inx
lda SouthEdgeInfo, x : sta $07
lda SouthOpenEdge, x : sta $04 : inx
lda SouthEdgeInfo, x : sta $08
lda SouthOpenEdge, x : sta $05
lda $04 : jsr LoadNorthMidpoint : inx
lda NorthEdgeInfo, x : sta $0b : inx
lda NorthEdgeInfo, x : sta $0c
rts
LoadNorthMidpoint:
and #$0f : sta $00 : asl : !add $00 : tax
lda NorthEdgeInfo, x : sta $0a ; needed now, and for nrml transition
rts
LoadWestData:
lda WestOpenEdge, x : sta $03 : inx
lda WestEdgeInfo, x : sta $07
lda WestOpenEdge, x : sta $04 : inx
lda WestEdgeInfo, x : sta $08
lda WestOpenEdge, x : sta $05
lda $04 : jsr LoadEastMidpoint : inx
lda EastEdgeInfo, x : sta $0b : inx
lda EastEdgeInfo, x : sta $0c
rts
LoadEastMidpoint:
and #$0f : sta $00 : asl : !add $00 : tax
lda EastEdgeInfo, x : sta $0a ; needed now, and for nrml transition
rts
LoadEastData:
lda EastOpenEdge, x : sta $03 : inx
lda EastEdgeInfo, x : sta $07
lda EastOpenEdge, x : sta $04 : inx
lda EastEdgeInfo, x : sta $08
lda EastOpenEdge, x : sta $05
lda $04 : jsr LoadWestMidpoint : inx
lda WestEdgeInfo, x : sta $0b : inx
lda WestEdgeInfo, x : sta $0c
LoadWestMidpoint:
and #$0f : sta $00 : asl : !add $00 : tax
lda WestEdgeInfo, x : sta $0a ; needed now, and for nrml transition
rts
DetectNorthEdge:
ldx #$ff
lda $a2
cmp #$82 : bne +
lda $22 : cmp #$50 : bcs ++
ldx #$01 : bra .end
++ ldx #$00 : bra .end
+ cmp #$83 : bne +
ldx #$02 : bra .end
+ cmp #$84 : bne +
lda $a9 : beq ++
lda $22 : cmp #$78 : bcs +++
ldx #$04 : bra .end
+++ ldx #$05 : bra .end
++ lda $22 : cmp #$78 : bcs ++
ldx #$03 : bra .end
++ ldx #$04 : bra .end
+ cmp #$85 : bne +
ldx #$06 : bra .end
+ cmp #$db : bne +
lda $a9 : beq ++
lda $22 : beq ++
ldx #$08 : bra .end
++ ldx #$07 : bra .end
+ cmp #$dc : bne .end
lda $a9 : bne ++
lda $22 : cmp #$b0 : bcs ++
ldx #$09 : bra .end
++ ldx #$0a
.end txa : rts
DetectSouthEdge:
ldx #$ff
lda $a2
cmp #$72 : bne +
lda $22 : cmp #$50 : bcs ++
ldx #$01 : bra .end
++ ldx #$00 : bra .end
+ cmp #$73 : bne +
ldx #$02 : bra .end
+ cmp #$74 : bne +
lda $a9 : beq ++
lda $22 : cmp #$78 : bcs +++
ldx #$04 : bra .end
+++ ldx #$05 : bra .end
++ lda $22 : cmp #$78 : bcs ++
ldx #$03 : bra .end
++ ldx #$04 : bra .end
+ cmp #$75 : bne +
ldx #$06 : bra .end
+ cmp #$cb : bne +
lda $a9 : beq ++
lda $22 : beq ++
ldx #$08 : bra .end
++ ldx #$07 : bra .end
+ cmp #$cc : bne .end
lda $a9 : bne ++
lda $22 : cmp #$b0 : bcs ++
ldx #$09 : bra .end
++ ldx #$0a
.end txa : rts
DetectWestEdge:
ldx #$ff
lda $a2
cmp #$65 : bne +
ldx #$00 : bra .end
+ cmp #$74 : bne +
ldx #$01 : bra .end
+ cmp #$75 : bne +
ldx #$02 : bra .end
+ cmp #$82 : bne +
lda $aa : beq ++
ldx #$03 : bra .end
++ ldx #$04 : bra .end
+ cmp #$85 : bne +
ldx #$05 : bra .end
+ cmp #$cc : bne +
lda $aa : beq ++
ldx #$06 : bra .end
++ ldx #$07 : bra .end
+ cmp #$dc : bne .end
ldx #$08
.end txa : rts
DetectEastEdge:
ldx #$ff
lda $a2
cmp #$64 : bne +
ldx #$00 : bra .end
+ cmp #$73 : bne +
ldx #$01 : bra .end
+ cmp #$74 : bne +
ldx #$02 : bra .end
+ cmp #$81 : bne +
lda $aa : beq ++
ldx #$04 : bra .end
++ ldx #$03 : bra .end
+ cmp #$84 : bne +
ldx #$05 : bra .end
+ cmp #$cb : bne +
lda $aa : beq ++
ldx #$06 : bra .end
++ ldx #$07 : bra .end
+ cmp #$db : bne .end
ldx #$08
.end txa : rts
TransitionCalculateLanding_Fix:
LDA.l EdgeToNormalFlag : BEQ +
LDX.w $0418 : CPX.b #$01 : BNE +
LDA.b $20 : SBC #$08 : STA.b $20
+ PHK : PEA.w .jslrtsreturn-1
PEA.w $02802C
JML CalculateTransitionLanding
.jslrtsreturn
LDX.w $0418 : CPX.b #$01 : BNE .zero ; the LDX is vanilla and needs to always run
LDA.l EdgeToNormalFlag : BEQ +
LDA.b $20 : ADC #$08 : STA.b $20
.zero LDA.b #$00 : STA.l EdgeToNormalFlag
+ JSL DoorToStraight
RTL
AlwaysPushThroughFDoors:
PHA : AND.b #$F0 : CMP.b #$F0 : BNE +
PLA : RTL
+ PLA : AND.b #$8E : CMP.b #$80
RTL

View File

@@ -1,274 +0,0 @@
;===================================================================================================
; The only specific concern to keep in mind with this code is that your databank will be $00
; Actually, it should be $80, if you're using my fastrom changes.
;
; Leave all your door data vanilla
; Do not try to adjust doors as I previously suggested (not worth the effort)
; We need a few hooks and some light hardcoding either way
; Might as well just do it in a brute, but reliable, way
;
; In brief, this is the hack we're making:
; 1) Let vanilla routines draw the door normally
; 2) Draw over what vanilla just drew
; 3) Hijack the door tile type routine
; and replace the vanilla value with that of solid collision
;===================================================================================================
pushpc
org $01892F
DoorDrawJankMove:
JML PrepDoorDraw
.return
JSL AdjustEscapeDoorGraphics
RTS
; we don't want to overwrite the JMP ($000E) that's already there
; Well, we could, but we don't need to
warnpc $018939
org $01BF43
JSL AdjustEscapeDoorCollision
pullpc
;===================================================================================================
PrepDoorDraw:
; first off, we need this routine to return to our jank hook
; otherwise, finding a reliable place to put the graphics change check will be a pin
; so push the address to return to the routine
; It's a lot to explain why this is necessary
; Much easier to just tell you to look at $01890D in the disassembly
; and you should understand the vanilla program flow we need to reject
PEA.w DoorDrawJankMove_return-1
; copy vanilla code (but fast rom)
LDA.l $8186F0,X
STA.b $0E
LDX.b $02
LDA.b $04
; and to execute the jump, we'll use the JMP ($000E) we carefully avoided overwriting
JML.l $818939
;===================================================================================================
; Adjustment stage 1: graphics
AdjustEscapeDoorGraphics:
JSR IdentifyBlockedEntrance
BCS .replace_graphics
JSR IdentifySancEntrance
BCS .fix_sanctuary_entrance
JSR IdentifySwampEntrance
BCS .fix_swamp_entrance
; Do nothing
RTL
;---------------------------------------------------------------------------------------------------
.replace_graphics ; for blocked doors
; using the value in $19A0 should be fine for finding the graphics
; the only caveat is that this appears to locate the tile just above the north-west corner
; so below, I've indicated that offset with a +$xxx after the base tilemap buffer
; The only odd thing I notice with this position is that some bad hardcoded adjust for
; exploding walls that shouldn't affect how we use this value at all!
LDY.w $0460 ; get door index
LDX.w $19A0-2,Y ; get tilemap index
; hardcoded shutter door graphics tile replacement
; the horizontal flips could easily be explicit LDAs
; but it's probably best the door is symmetrical
; using ORA makes your intent more clear
; and gives you fewer values to change if you experiment with other graphics
; row 1
LDA.w #$8838
STA.l $7E2000+$080,X
ORA.w #$4000 ; horizontally flip
STA.l $7E2000+$086,X
; row 2
LDA.w #$8828
STA.l $7E2000+$100,X
ORA.w #$4000 ; horizontally flip
STA.l $7E2000+$106,X
LDA.w #$8829
STA.l $7E2000+$102,X
ORA.w #$4000 ; horizontally flip
STA.l $7E2000+$104,X
; the state of the A, X, and Y registers is irrelevant when we exit
; they're all subsequently loaded with new values
RTL
.fix_sanctuary_entrance
LDY.w $0460 ; get door index
LDX.w $19A0-2,Y ; get tilemap index
; row 0
LDA.w #$14C4
STA.l $7E2000+$000,X ; sanity check = should calculate to 7e3bbc
ORA.w #$4000 ; horizontally flip
STA.l $7E2000+$006,X
LDA.w #$14C5
STA.l $7E2000+$002,X
ORA.w #$4000 ; horizontally flip
STA.l $7E2000+$004,X
; row 1
LDA.w #$14E8
STA.l $7E2000+$082,X
ORA.w #$4000 ; horizontally flip
STA.l $7E2000+$084,X
; row 2
LDA.w #$14F8
STA.l $7E2000+$102,X
ORA.w #$4000 ; horizontally flip
STA.l $7E2000+$104,X
.fix_swamp_entrance
LDY.w $0460 ; get door index
LDX.w $19A0-2,Y ; get tilemap index
; row 0
LDA.w #$9DfC
STA.l $7E2000+$000,X
STA.l $7E2000+$002,X
STA.l $7E2000+$004,X
STA.l $7E2000+$006,X
; row 1
LDA.w #$0908
STA.l $7E2000+$080,X
ORA.w #$4000 ; horizontally flip
STA.l $7E2000+$086,X
LDA.w #$14E8
STA.l $7E2000+$082,X
ORA.w #$4000 ; horizontally flip
STA.l $7E2000+$084,X
; row 2
LDA.w #$0918
STA.l $7E2000+$100,X
ORA.w #$4000 ; horizontally flip
STA.l $7E2000+$106,X
LDA.w #$14F8
STA.l $7E2000+$102,X
ORA.w #$4000 ; horizontally flip
STA.l $7E2000+$104,X
; row 3
LDA.w #$A82C
STA.l $7E2000+$180,X
ORA.w #$4000 ; horizontally flip
STA.l $7E2000+$186,X
LDA.w #$A82D
STA.l $7E2000+$182,X
ORA.w #$4000 ; horizontally flip
STA.l $7E2000+$184,X
RTL
IdentifySancEntrance:
LDA.b $A0 : CMP.w #$0012 : BNE +
LDA.b $0A : CMP.w #$0010 : BNE +
SEC : RTS
+ CLC : RTS
IdentifySwampEntrance:
LDA.b $A0 : CMP.w #$0036 : BNE +
LDA.b $0A : CMP.w #$0010 : BNE +
SEC : RTS
+ CLC : RTS
;===================================================================================================
; Leaving this here in case you desire a fully custom door later
; For now, we'll just hardcode the tiles, as I did above
; I put these in column order because that's how they're expected for the vanilla draw routines
; but I changed my mind on redefining things
; and am too lazy to change it to a row-wise listing
BlockedEntrance:
dw $8838, $8828, $A888 ; column 0
dw $14E8, $8829, $C888 ; column 1
dw $14E8, $8829, $A888 ; column 2
dw $C838, $C828, $C888 ; column 3
;===================================================================================================
; Adjustment stage 2: collision
AdjustEscapeDoorCollision:
LSR ; vanilla shift
; save our parameters
; but one or both of these may not be necessary depending on how you detect these doors
; all that matters is that after identifying blockage, we have:
; Y is the same as what we entered with
; X has A>>1, for whatever A entered with
PHA
LDA.w $1980, Y ; grab door info (type)
AND.w #$00FF
STA.b $0A ; store in temporary variable
JSR IdentifyBlockedEntrance
PLX ; this is a TAX in vanilla, just have X pull A instead
BCS .block_entrance
; vanilla value
LDA.b $00
RTL
.block_entrance
LDA.w #$0101 ; load tile type for solid collision
RTL
;===================================================================================================
; Enter with:
; $0A containing the door information: position and type bytes
; which should be from $1980, Y or [$B7], Y depending on where in the door process we are
; Exit with:
; carry clear - leave door alone
; carry set - block door
IdentifyBlockedEntrance:
LDA.l ProgressIndicator : AND.w #$00FF : CMP.w #$0002 : BCS .leave_alone ; only in rain states (0 or 1)
LDA.l ProgressFlags : AND.w #$0004 : BNE .leave_alone ; zelda's been rescued
LDA.l BlockSanctuaryDoorInRain : BEQ + ;flagged
LDA.b $A0 : CMP.w #$0012 : BNE +
; we're in the sanctuary
; this code could be removed because you can't reach sanc without zelda currently
; but that's enforced in the logic, so this is to catch that case in case some mode allows it
LDA.l FollowerIndicator : AND.w #$00FF : CMP.w #$0001 : BEQ .leave_alone ; zelda is following
LDA.b $0A
CMP.w #$000A : BCC .leave_alone
CMP.w #$0014 : BCS .leave_alone
.block_door
SEC : RTS
+ LDA.l BlockCastleDoorsInRain : AND.w #$00FF : BEQ .leave_alone
LDX #$FFFE
- INX #2
LDA.l RemoveRainDoorsRoom, X : CMP.w #$FFFF : BEQ .leave_alone
CMP $A0 : BNE -
LDA.b $0A
CMP.w #$000A : BCC .continue
CMP.w #$0014 : BCS .continue
BRA .block_door
.continue
BRA -
.leave_alone
CLC : RTS
;===================================================================================================

View File

@@ -1,95 +0,0 @@
GfxFixer:
{
lda.l DRMode : bne +
jsl LoadRoomHook ;this is the code we overwrote
jsl Dungeon_InitStarTileCh
jsl LoadTransAuxGfx_Alt
inc $b0
rtl
+ lda $b1 : bne .stage2
jsl LoadRoomHook ; this is the rando version - let's only call this guy once - may fix star tiles and slower loads
jsl Dungeon_InitStarTileCh
jsl LoadTransAuxGfx
jsl Dungeon_LoadCustomTileAttr
jsl PrepTransAuxGfx
lda.l DRMode : cmp #$02 : bne + ; only do this in crossed mode
ldx $a0 : lda.l TilesetTable, x
cmp $0aa1 : beq + ; already eq no need to decomp
sta $0aa1
tax : lda $02802e, x : tay
jsl DecompDungAnimatedTiles
+
lda #$09 : sta $17 : sta $0710
jsl Palette_SpriteAux3
jsl Palette_SpriteAux2
jsl Palette_SpriteAux1
jsl Palette_DungBgMain
jsr CgramAuxToMain
inc $b1
rtl
.stage2
lda #$0a : sta $17 : sta $0710
stz $b1 : inc $b0
rtl
}
FixAnimatedTiles:
LDA.L DRMode : CMP #$02 : BNE +
LDA $040C : CMP.b #$FF : BEQ +
PHX
LDX $A0 : LDA.l TilesetTable, x
CMP $0AA1 : beq ++
TAX : PLA : BRA +
++
PLX
+ LDA $02802E, X ; what we wrote over
RTL
FixCloseDungeonMap:
LDA.l DRMode : CMP #$02 : BNE .vanilla
LDA $040C : BMI .vanilla
LSR : TAX
LDA.l DungeonTilesets,x
RTL
.vanilla
LDA $7EC20E
RTL
FixWallmasterLamp:
ORA $0458
STY $1C : STA $1D : RTL ; what we wrote over
CgramAuxToMain: ; ripped this from bank02 because it ended with rts
{
rep #$20
ldx.b #$00
.loop
lda $7EC300, X : sta $7EC500, x
lda $7EC340, x : sta $7EC540, x
lda $7EC380, x : sta $7EC580, x
lda $7EC3C0, x : sta $7EC5C0, x
lda $7EC400, x : sta $7EC600, x
lda $7EC440, x : sta $7EC640, x
lda $7EC480, x : sta $7EC680, x
lda $7EC4C0, x : sta $7EC6C0, x
inx #2 : cpx.b #$40 : bne .loop
sep #$20
; tell NMI to upload new CGRAM data
inc $15
rts
}
OverridePaletteHeader:
lda.l DRMode : cmp #$02 : bne +
lda.l DRFlags : and #$20 : bne +
cpx #$01c2 : !bge +
rep #$20
txa : lsr : tax
lda.l PaletteTable, x
iny : rtl
+ rep #$20 : iny : lda [$0D], Y ; what we wrote over
rtl

View File

@@ -1,299 +0,0 @@
DrHudOverride:
{
jsl.l NewDrawHud
jsr HudAdditions
rtl
}
HudAdditions:
{
SEP #$10
LDA.l DRFlags : AND #$0008 : BNE + : JMP .end_item_count : +
LDA.l TotalItemCounter : PHA : CMP #1000 : !BLT +
JSL HexToDec4Digit_fast
LDX.b $04 : TXA : ORA.w #$2490 : STA !GOAL_DRAW_ADDRESS ; draw 1000's digit
BRA .skip
+ JSL HexToDec_fast
.skip
LDA #$207F : STA !GOAL_DRAW_ADDRESS+2 : STA !GOAL_DRAW_ADDRESS+4
PLA : PHA : CMP.w #100 : !BLT +
LDX.b $05 : TXA : ORA.w #$2490 : STA !GOAL_DRAW_ADDRESS+2 ; draw 100's digit
+ PLA : CMP.w #10 : !BLT +
LDX.b $06 : TXA : ORA.w #$2490 : STA !GOAL_DRAW_ADDRESS+4 ; draw 10's digit
+ LDX.b $07 : TXA : ORA.w #$2490 : STA !GOAL_DRAW_ADDRESS+6 ; draw 1's digit
LDA.w #$2830 : STA !GOAL_DRAW_ADDRESS+8 ; draw slash
LDA.l DRFlags : AND #$0100 : BNE +
LDA.l MultiClientFlagsWRAM+1 : CMP #1000 : !BLT .three_digit_goal
JSL HexToDec4Digit_fast
LDX.b $04 : TXA : ORA.w #$2490 : STA !GOAL_DRAW_ADDRESS+10 ; draw 1000's digit
LDX.b $05 : TXA : ORA.w #$2490 : STA !GOAL_DRAW_ADDRESS+12 ; draw 100's digit
LDX.b $06 : TXA : ORA.w #$2490 : STA !GOAL_DRAW_ADDRESS+14 ; draw 10's digit
LDX.b $07 : TXA : ORA.w #$2490 : STA !GOAL_DRAW_ADDRESS+16 ; draw 1's digit
BRA .end_item_count
.three_digit_goal
JSL HexToDec_fast
LDX.b $05 : TXA : ORA.w #$2490 : STA !GOAL_DRAW_ADDRESS+10 ; draw 100's digit
LDX.b $06 : TXA : ORA.w #$2490 : STA !GOAL_DRAW_ADDRESS+12 ; draw 10's digit
LDX.b $07 : TXA : ORA.w #$2490 : STA !GOAL_DRAW_ADDRESS+14 ; draw 1's digit
BRA .end_item_count
+ LDA.w #$2405 : STA !GOAL_DRAW_ADDRESS+10 : STA !GOAL_DRAW_ADDRESS+12
STA !GOAL_DRAW_ADDRESS+14 : STA !GOAL_DRAW_ADDRESS+16
.end_item_count
LDX $1B : BNE + ; if outdoors
lda.l OWMode : and.w #((!FLAG_OW_CROSSED+!FLAG_OW_MIXED)<<8)+$ff : bne ++ : rts ; Skip if vanilla ow rando
++ lda CurrentHealth : and #$00ff : beq ++
lda CurrentWorld : and #$00ff : beq +++
lda #$2d60 : bra .owdisplay
+++ lda #$2d68 : bra .owdisplay
++ lda #$207f
.owdisplay sta $7ec702 : rts
+ ldx $040c : cpx #$ff : bne + : rts : + ; Skip if not in dungeon
lda.l DRMode : bne + : rts : + ; Skip if not door rando
phb : phk : plb
lda CompassField : and.l $0098c0, x : beq +
lda.w CompassBossIndicator, x : and #$00ff : cmp $a0 : bne +
lda $1a : and #$0010 : beq +
lda #$345e : sta $7ec790 : bra .next
+ lda #$207f : sta $7ec790
.next lda.w DRMode : and #$0002 : bne + : plb : rts : +
lda CurrentHealth : and #$00ff : beq +
lda.w DungeonReminderTable, x : bra .reminder
+ lda #$207f
.reminder sta $7ec702
+ lda.w DRFlags : and #$0004 : beq .restore
; lda MapField : and.l $0098c0, x : beq .restore
txa : lsr : tax
lda.l GenericKeys : and #$00ff : bne +
lda DungeonCollectedKeys, x : jsr ConvertToDisplay : sta $7ec7a2
lda #$2830 : sta $7ec7a4
+
lda.w ChestKeys, x : jsr ConvertToDisplay : sta $7ec7a6
; todo 4b0 no longer in use
.restore
plb : rts
}
;column distance for BK/Smalls
HudOffsets:
; none hc east desert aga swamp pod mire skull ice hera tt tr gt
dw $fffe, $0000, $0006, $0008, $0002, $0010, $000e, $0018, $0012, $0016, $000a, $0014, $001a, $001e
; offset from 1644
RowOffsets:
dw $0000, $0000, $0040, $0080, $0000, $0080, $0040, $0080, $00c0, $0040, $00c0, $0000, $00c0, $0000
ColumnOffsets:
dw $0000, $0000, $0000, $0000, $000a, $000a, $000a, $0014, $000a, $0014, $0000, $0014, $0014, $001e
DrHudDungeonItemsAdditions:
{
jsl DrawHUDDungeonItems
lda.l HUDDungeonItems : and #$ff : bne + : rtl : +
lda.l DRMode : cmp #$02 : beq + : rtl : +
phx : phy : php
rep #$30
lda.w #$24f5 : sta $1606 : sta $1610 : sta $161a : sta $1624
sta $1644 : sta $164a : sta $1652 : sta $1662 : sta $1684 : sta $16c4
ldx #$0000
- sta $1704, x : sta $170e, x : sta $1718, x
inx #2 : cpx #$0008 : !blt -
lda HudFlag : and.w #$0020 : beq + : JMP ++ : +
lda HUDDungeonItems : and.w #$0007 : bne + : JMP ++ : +
; bk symbols
lda.w #$2811 : sta $1606 : sta $1610 : sta $161a : sta $1624
; sm symbols
lda.w #$2810 : sta $160a : sta $1614 : sta $161e : sta $16e4
; blank out stuff
lda.w #$24f5 : sta $1724
ldx #$0002
- lda #$0000 : !addl RowOffsets,x : !addl ColumnOffsets, x : tay
lda.l DungeonReminderTable, x : sta $1644, y : iny #2
lda.w #$24f5 : sta $1644, y
lda MapField : and.l $0098c0, x : beq + ; must have map
jsr BkStatus : sta $1644, y : bra .smallKey ; big key status
+ lda BigKeyField : and.l $0098c0, x : beq .smallKey
lda.w #$2826 : sta $1644, y
.smallKey
+ iny #2
cpx #$001a : bne +
tya : !add #$003c : tay
+ stx $00
txa : lsr : tax
lda.w #$24f5 : sta $1644, y
lda.l GenericKeys : and #$00FF : bne +
lda.l DungeonKeys, x : and #$00FF : beq +
jsr ConvertToDisplay2 : sta $1644, y
+ iny #2 : lda.w #$24f5 : sta $1644, y
phx : ldx $00
; lda MapField : and.l $0098c0, x : beq + ; must have map
plx : sep #$30 : lda.l ChestKeys, x : sta $02
lda.l GenericKeys : bne +++
lda $02 : !sub DungeonCollectedKeys, x : sta $02
+++ lda $02
rep #$30
jsr ConvertToDisplay2 : sta $1644, y ; small key totals
bra .skipStack
+ plx
.skipStack iny #2
cpx #$000d : beq +
lda.w #$24f5 : sta $1644, y
+
ldx $00
+ inx #2 : cpx #$001b : bcs ++ : JMP -
++
lda HudFlag : and.w #$0020 : bne + : JMP ++ : +
lda HUDDungeonItems : and.w #$000c : bne + : JMP ++ : +
; map symbols (do I want these) ; note compass symbol is 2c20
lda.w #$2821 : sta $1606 : sta $1610 : sta $161a : sta $1624
; blank out a couple thing from old hud
lda.w #$24f5 : sta $16e4 : sta $1724
sta $160a : sta $1614 : sta $161e ; blank out sm key indicators
ldx #$0002
- lda #$0000 ; start of hud area
!addl RowOffsets, x : !addl ColumnOffsets, x : tay
lda.l DungeonReminderTable, x : sta $1644, y
iny #2
lda.w #$24f5 : sta $1644, y ; blank out map spot
lda MapField : and.l $0098c0, x : beq + ; must have map
JSR MapIndicatorShort : STA $1644, Y
+ iny #2
cpx #$001a : bne +
tya : !add #$003c : tay
+ lda CompassField : and.l $0098c0, x : beq + ; must have compass
phx ; total chest counts
txa : lsr : tax
sep #$30
lda.l TotalLocations, x : !sub DungeonLocationsChecked, x : JSR HudHexToDec2DigitCopy
rep #$30
lda $06 : jsr ConvertToDisplay2 : sta $1644, y : iny #2
lda $07 : jsr ConvertToDisplay2 : sta $1644, y
plx
bra .skipBlanks
+ lda.w #$24f5 : sta $1644, y : iny #2 : sta $1644, y
.skipBlanks iny #2
cpx #$001a : beq +
lda.w #$24f5 : sta $1644, y ; blank out spot
+ inx #2 : cpx #$001b : !bge ++ : JMP -
++
plp : ply : plx : rtl
}
MapIndicatorLong:
PHX
LDA.l OldHudToNewHudTable, X : TAX
JSR MapIndicator
PLX
RTL
MapIndicatorShort:
PHX
TXA : LSR : TAX
JSR MapIndicator
PLX
RTS
OldHudToNewHudTable:
dw 1, 2, 3, 10, 4, 6, 5, 8, 11, 9, 7, 12, 13
IndicatorCharacters:
; check 1 2 3 4 5 6 7 G B R
dw $2426, $2817, $2818, $2819, $281A, $281B, $281C, $281D, $2590, $258B, $259B
MapIndicator:
LDA.l CrystalPendantFlags_3, X : AND #$00FF
PHX
ASL : TAX : LDA.l IndicatorCharacters, X
PLX
RTS
BkStatus:
lda BigKeyField : and.l $0098c0, x : bne +++ ; has the bk already
lda.l BigKeyStatus, x : bne ++
lda #$2827 : rts ; 0/O for no BK
++ cmp #$0002 : bne +
lda #$2420 : rts ; symbol for BnC
+ lda #$24f5 : rts ; black otherwise
+++ lda #$2826 : rts ; check mark
ConvertToDisplay:
and.w #$00ff : cmp #$000a : !blt +
!add #$2553 : rts
+ !add #$2490 : rts
ConvertToDisplay2:
and.w #$00ff : beq ++
cmp #$000a : !blt +
!add #$2553 : rts ; 2580 with 258A as "A" for non transparent digits
+ !add #$2816 : rts
++ lda #$2827 : rts ; 0/O for 0 or placeholder digit ;2483
CountAbsorbedKeys:
jsl IncrementSmallKeysNoPrimary : phx
lda $040c : cmp #$ff : beq +
lsr : tax
lda DungeonAbsorbedKeys, x : inc : sta DungeonAbsorbedKeys, x
+ plx : rtl
;================================================================================
; 16-bit A, 8-bit X
; in: A(b) - Byte to Convert
; out: $04 - $07 (high - low)
;================================================================================
HudHexToDec4DigitCopy:
LDY.b #$90
-
CMP.w #1000 : !BLT +
INY
SBC.w #1000 : BRA -
+
STY $04 : LDY #$90 ; Store 1000s digit & reset Y
-
CMP.w #100 : !BLT +
INY
SBC.w #100 : BRA -
+
STY $05 : LDY #$90 ; Store 100s digit & reset Y
-
CMP.w #10 : !BLT +
INY
SBC.w #10 : BRA -
+
STY $06 : LDY #$90 ; Store 10s digit & reset Y
CMP.w #1 : !BLT +
-
INY
DEC : BNE -
+
STY $07 ; Store 1s digit
RTS
;================================================================================
; 8-bit registers
; in: A(b) - Byte to Convert
; out: $06 - $07 (high - low)
;================================================================================
HudHexToDec2DigitCopy: ; modified
PHY
LDY.b #$00
-
CMP.b #10 : !BLT +
INY
SBC.b #10 : BRA -
+
STY $06 : LDY #$00 ; Store 10s digit and reset Y
CMP.b #1 : !BLT +
-
INY
DEC : BNE -
+
STY $07 ; Store 1s digit
PLY
RTS

View File

@@ -1,42 +0,0 @@
; code to un-pair or re-pair doors
; doorlist is loaded into 19A0 but no terminator
; new room is in A0
; for "each" door do the following: (each could mean the first four doors?)
; in lookup table, grab room and corresponding position
; find the info at 7ef000, x where x is twice the paired room
; check the corresponding bit (there are only 4)
; set the bit in 068C
; Note the carry bit is used to indicate if we should aborted (set) or not
CheckIfDoorsOpen: {
jsr TrapDoorFixer ; see normal.asm
; note we are 16bit mode right now
lda.l DRMode : beq +
lda $040c : cmp #$00ff : bne .gtg
+ lda $a0 : dec : tax : and #$000f ; hijacked code
sec : rtl ; set carry to indicate normal behavior
.gtg
phb : phk : plb
stx $00 : ldy #$0000
.nextDoor
lda $a0 : asl : tax
lda.w KeyDoorOffset, x : beq .skipDoor
asl : sty $05 : !add $05 : tax
lda.w PairedDoorTable, x : beq .skipDoor
sta $02 : and #$00ff : asl a : tax
lda $02 : and #$ff00 : sta $03
lda RoomDataWRAM.l, X : and #$f000 : and $03 : beq .skipDoor
tyx : lda $068c : ora $0098c0,x : sta $068c
.skipDoor
iny #2 : cpy $00 : bne .nextDoor
plb : clc : rtl
}
; outstanding issues
; how to indicate opening for other (non-first four doors?)
; Bank01 Door Register stores the 4 bits in 068c to 400 (depending on type)
; Key collision and others depend on F0-F3 attribute not sure if extendable to other numbers
; Dungeon_ProcessTorchAndDoorInteractives.isOpenableDoor is the likely culprit for collision problems
; Saving open status to other unused rooms is tricky -- Bank 2 13947 (line 8888)

View File

@@ -1,66 +0,0 @@
;divide by 2 example
; 0 1 2 3 4 5 6 7 8 9 a b c d e f 10--Offset Ruler
;v 00 01 01 02 02 03 03 04 04 04 05 05 06 06 07 07 08
;divide by 3 example
; 0 1 2 3 4 5 6 7 8 9 a b c d e f 10 11 12 13 14 15 16 17 18
;00 00 01 01 01 02 02 02 03 03 03 04 04 04 05 05 05 06 06 06 07 07 07 08 08
MultiplyByY:
.loop cpy #$0001 : beq .done
cpy #$0003 : bne ++
jsr MultiBy3 : bra .done
++ cpy #$0005 : bne ++
jsr MultiBy5 : bra .done
++ asl : sta $00 : tya : lsr : tay : lda $00 : bra .loop
.done rts
;Divisor in Y. Width of division is in X for rounding toward middle
DivideByY:
.loop
cpy #$0000 : beq .done
cpy #$0001 : beq .done
cpy #$0003 : bne ++
jsr DivideBy3 : bra .done
++ cpy #$0005 : bne ++
jsr DivideBy5 : bra .done
++ jsr DivideBy2 : sta $00
tya : lsr : tay
txa : lsr : tax
lda $00 : bra .loop
.done rts
MultiBy3:
sta $00 : asl : !add $00
rts
MultiBy5:
sta $00 : asl #2 : !add $00
rts
;width of divison in x: rounds toward X/2
DivideBy2:
sta $00
lsr : bcc .done
sta $02 : txa : lsr : cmp $00 : !blt +
lda $02 : inc : bra .done
+ lda $02
.done rts
DivideBy3:
sta $00
ldx #$0000
lda #$0002
.loop cmp $00 : !bge .store
inx : !add #$0003 : bra .loop
.store txa
rts
DivideBy5:
sta $00
ldx #$0000
lda #$0003
.loop cmp $00 : !bge .store
inx : !add #$0005 : bra .loop
.store txa
rts

View File

@@ -1,440 +0,0 @@
WarpLeft:
lda.l DRMode : beq .end
lda $040c : cmp.b #$ff : beq .end
lda $20 : ldx $aa
jsr CalcIndex
!add #$06 : ldy #$01 ; offsets in A, Y
jsr LoadRoomHorz
.end
jsr Cleanup
rtl
WarpRight:
lda.l DRMode : beq .end
lda $040c : cmp.b #$ff : beq .end
lda $20 : ldx $aa
jsr CalcIndex
!add #$12 : ldy #$ff ; offsets in A, Y
jsr LoadRoomHorz
.end
jsr Cleanup
rtl
WarpUp:
lda.l DRMode : beq .end
lda $040c : cmp.b #$ff : beq .end
lda $22 : ldx $a9
jsr CalcIndex
ldy #$02 ; offsets in A, Y
jsr LoadRoomVert
.end
jsr Cleanup
rtl
; Checks if $a0 is equal to <Room>. If it is, opens its stonewall if it's there
macro StonewallCheck(Room)
lda $a0 : cmp.b #<Room> : bne ?end
lda.l <Room>*2+$7ef000 : ora #$80 : sta.l <Room>*2+$7ef000
?end
endmacro
WarpDown:
lda.l DRMode : beq .end
lda $040c : cmp.b #$ff : beq .end
lda $22 : ldx $a9
jsr CalcIndex
!add #$0c : ldy #$ff ; offsets in A, Y
jsr LoadRoomVert
%StonewallCheck($43)
.end
jsr Cleanup
rtl
; carry set = use link door like normal
; carry clear = we are in dr mode, never use linking doors
CheckLinkDoorR:
lda.l DRMode : bne +
lda $7ec004 : sta $a0 ; what we wrote over
sec : rtl
+ clc : rtl
CheckLinkDoorL:
lda.l DRMode : bne +
lda $7ec003 : sta $a0 ; what we wrote over
sec : rtl
+ clc : rtl
TrapDoorFixer:
lda $fe : and #$0038 : beq .end
xba : asl #2 : sta $00
stz $0468 : lda $068c : ora $00 : sta $068c
.end
stz $fe ; clear our fe here because we don't need it anymore
rts
Cleanup:
lda.l DRFlags : and #$10 : beq +
stz $047a
+ inc $11
lda $ef
rts
;A needs be to the low coordinate, x needs to be either 0 for left,upper or non-zero for right,down
; This sets A (00,02,04) and stores half that at $04 for later use, (src door)
CalcIndex: ; A->low byte of Link's Coord, X-> Link's quadrant, DoorOffset x 2 -> A, DoorOffset -> $04 (vert/horz agnostic)
cpx.b #00 : bne .largeDoor
cmp.b #$d0 : bcc .smallDoor
lda #$01 : bra .done ; Middle Door
.smallDoor lda #$00 : bra .done
.largeDoor lda #$02
.done
sta $04
asl
rts
; Y is an adjustment for main direction of travel
; A is a door table row offset
LoadRoomHorz:
{
phb : phk : plb
sty $06 : sta $07 : lda $a0 : pha ; Store normal room on stack
lda $07 : jsr LookupNewRoom ; New room is in A, Room Data is in $00-$01
lda $00 : cmp #$03 : bne .gtg
jsr HorzEdge : pla : bcs .end
sta $a0 : bra .end ; Restore normal room, abort (straight staircases and open edges can get in this routine)
.gtg ;Good to Go!
pla ; Throw away normal room (don't fill up the stack)
lda $a0 : and.b #$0F : asl a : !sub $23 : !add $06 : sta $02
ldy #$00 : jsr ShiftVariablesMainDir
lda $01 : and #$80 : beq .normal
ldy $06 : cpy #$ff : beq +
lda $01 : jsr LoadEastMidpoint : bra ++
+ lda $01 : jsr LoadWestMidpoint
++ jsr PrepScrollToEdge : bra .scroll
.normal
jsr PrepScrollToNormal
.scroll
lda $01 : and #$40 : pha
jsr ScrollY
pla : beq .end
ldy #$06 : jsr ApplyScroll
.end
plb ; restore db register
rts
}
; Y is an adjustment for main direction of travel (stored at $06)
; A is a door table row offset (stored a $07)
LoadRoomVert:
{
phb : phk : plb
sty $06 : sta $07 : lda $a0 : pha ; Store normal room on stack
lda $07 : jsr LookupNewRoom ; New room is in A, Room Data is in $00-$01
lda $00 : cmp #$03 : bne .gtg
jsr VertEdge : pla : bcs .end
sta $a0 : bra .end ; Restore normal room, abort (straight staircases and open edges can get in this routine)
.gtg ;Good to Go!
pla ; Throw away normal room (don't fill up the stack)
lda $a0 : and.b #$F0 : lsr #3 : !sub $21 : !add $06 : sta $02
lda $01 : and #$80 : beq .notEdge
ldy #$01 : jsr ShiftVariablesMainDir
ldy $06 : cpy #$ff : beq +
lda $01 : jsr LoadSouthMidpoint : bra ++
+ lda $01 : jsr LoadNorthMidpoint
++ jsr PrepScrollToEdge : bra .scroll
.notEdge
lda $01 : and #$03 : cmp #$03 : bne .normal
jsr ScrollToInroomStairs
stz $046d
bra .end
.normal
ldy #$01 : jsr ShiftVariablesMainDir
jsr PrepScrollToNormal
.scroll
lda $01 : and #$40 : sta $046d
jsr ScrollX
.end
plb ; restore db register
rts
}
LookupNewRoom: ; expects data offset to be in A
{
rep #$30 : and #$00FF ;sanitize A reg (who knows what is in the high byte)
sta $00 ; offset in 00
lda $a2 : tax ; probably okay loading $a3 in the high byte
lda.w DoorOffset,x : and #$00FF ;we only want the low byte
asl #3 : sta $02 : !add $02 : !add $02 ;multiply by 24 (data size)
!add $00 ; should now have the offset of the address I want to load
tax : lda.w DoorTable,x : sta $00
and #$00FF : sta $a0 ; assign new room
sep #$30
rts
}
; INPUTS-- Y: Direction Index , $02: Shift Value
; Sets high bytes of various registers
ShiftVariablesMainDir:
{
lda.w CoordIndex,y : tax
lda $21,x : !add $02 : sta $21,x ; coordinate update
lda.w CameraIndex,y : tax
lda $e3,x : !add $02 : sta $e3,x ; scroll register high byte
lda.w CamQuadIndex,y : tax
lda $0605,x : !add $02 : sta $0605,x ; high bytes of these guys
lda $0607,x : !add $02 : sta $0607,x
lda $0601,x : !add $02 : sta $0601,x
lda $0603,x : !add $02 : sta $0603,x
rts
}
; Normal Flags should be in $01
ScrollToInroomStairs:
{
jsr PrepScrollToInroomStairs
ldy #$01 : jsr ShiftVariablesMainDir
jsr ScrollX
ldy #$00 : jsr ApplyScroll
lda $a0 : and #$0f : cmp #$0f : bne +
stz $e0 : stz $e2 ; special case camera fix
lda #$1f : sta $e1 : sta $e3
+
rts
}
; Direction should be in $06, Shift Value (see above) in $02 and other info in $01
; Sets $02, $04, $05, $ee, $045e, $045f and things related to Y coordinate
PrepScrollToInroomStairs:
{
lda $01 : and #$30 : lsr #3 : tay
lda.w InroomStairsX,y : sta $04
lda.w InroomStairsX+1,y : sta $05
lda $06 : cmp #$ff : beq .south
lda.w InroomStairsY+1,y : bne +
inc $045f ; flag indicating special screen transition
dec $02 ; shift variables further
stz $aa
lda $a8 : and #%11111101 : sta $a8
stz $0613 ; North scroll target
inc $0603 : inc $0607
dec $0619 : dec $061b
+
lda.w InroomStairsY,y : !add #$20 : sta $20
!sub #$38 : sta $045e
lda $01 : and #$40 : beq +
lda $20 : !add #$20 : sta $20
stz $045f
+
dec $21
%StonewallCheck($1b)
bra ++
.south
lda.w InroomStairsY+1,y : beq +
inc $045f ; flag indicating special screen transition
inc $02 ; shift variables further
lda #$02 : sta $aa
lda $a8 : ora #%00000010 : sta $a8
inc $0611 ; South scroll target
dec $0603 : dec $0607
inc $0619 : inc $061b
+
lda.w InroomStairsY,y : !sub #$20 : sta $20
!add #$38 : sta $045e
lda $01 : and #$40 : beq +
lda $20 : !sub #$20 : sta $20
stz $045f
+
inc $21
++
lda $01 : and #$04 : lsr #2 : sta $ee : bne +
stz $0476
+ rts
}
; Target pixel should be in A, other info in $01
; Sets $04 $05 and $ee
PrepScrollToEdge:
{
sta $04 : lda $01 : and #$20 : beq +
lda #01
+ sta $05
lda $01 : and #$10 : beq +
lda #01
+ sta $ee : bne +
stz $0476
+ rts
}
; Normal Flags should be in $01
; Sets $04 $05 and $ee, and $fe
PrepScrollToNormal:
{
lda $01 : sta $fe : and #$04 : lsr #2 : sta $ee ; trap door and layer
bne +
stz $0476
+ stz $05 : lda #$78 : sta $04
lda $01 : and #$03 : beq .end
cmp #$02 : !bge +
lda #$f8 : sta $04 : bra .end
+ inc $05
.end rts
}
StraightStairsAdj:
{
stx $0464 : sty $012e ; what we wrote over
lda.l DRMode : beq +
lda $045e : bne .toInroom
lda $046d : beq .noScroll
sta $22
ldy #$00 : jsr ApplyScroll
stz $046d
.noScroll
jsr GetTileAttribute : tax
lda $11 : cmp #$12 : beq .goingNorth
lda $a2 : cmp #$51 : bne ++
rep #$20 : lda #$0018 : !add $20 : sta $20 : sep #$20 ; special fix for throne room
jsr GetTileAttribute : tax
++ lda.l StepAdjustmentDown, X : bra .end
; lda $ee : beq .end
; rep #$20 : lda #$ffe0 : !add $20 : sta $20 : sep #$20
.goingNorth
cpx #$00 : bne ++
lda $a0 : cmp #$51 : bne ++
lda #$36 : bra .end ; special fix for throne room
++ ldy $ee : cpy #$00 : beq ++
inx
++ lda.l StepAdjustmentUp, X
.end
pha : lda $0462 : and #$04 : bne ++
pla : !add #$f6 : pha
++ pla : !add $0464 : sta $0464
+ rtl
.toInroom
lda #$32 : sta $0464 : stz $045e
rtl
}
GetTileAttribute:
{
phk : pea.w .jslrtsreturn-1
pea.w $02802c
jml CalculateTransitionLanding ; mucks with x/y sets a to Tile Attribute, I think
.jslrtsreturn
rts
}
; 0 open edge
; 1 nrm door high
; 2 straight str
; 3 nrm door low
; 4 trap door high
; 5 trap door low (none of these exist on North direction)
StepAdjustmentUp: ; really North Stairs
db $00, $f6, $1a, $18, $16, $38
StepAdjustmentDown: ; really South Stairs
db $d0, $f6, $10, $1a, $f0, $00
StraightStairsFix:
{
pha
lda.l DRMode : bne +
pla : !add $20 : sta $20 : rtl ;what we wrote over
+ pla : rtl
}
StraightStairLayerFix:
{
lda.l DRMode : beq +
lda $ee : rtl
+ lda $01c322, x : rtl ; what we wrote over
}
DoorToStraight:
{
pha
lda.l DRMode : beq .skip
pla : bne .end
pha
lda $a0 : cmp #$51 : bne .skip
lda #$04 : sta $4e
.skip pla
; the ldx $0418 is now taken care of by TransitionCalculateLanding_Fix
.end cmp #$02 ;what we wrote over
rtl
}
DoorToInroom:
{
ldx $045e : bne .end
sta $0020, y ; what we wrote over
.end
ldx #$00 ; what we wrote over
rtl
}
DoorToInroomEnd:
{
ldy $045e : beq .vanilla
cmp $045e : bne .return
stz $045e ; clear
.return
rtl
.vanilla
cmp $02c034, x ; what we wrote over
rtl
}
StraightStairsTrapDoor:
{
lda $0464 : bne +
; reset function
.reset phk : pea.w .jslrtsreturn-1
pea.w $02802c
jml $028c73 ; $10D71 .reset label of Bank02
.jslrtsreturn
lda $0468 : bne ++
lda $a0 : cmp.b #$ac : bne .animateTraps
lda $0403 : and.b #$20 : bne .animateTraps
lda $0403 : and.b #$10 : beq ++
.animateTraps
lda #$05 : sta $11
inc $0468 : stz $068e : stz $0690
++ JSL Underworld_DoorDown_Call : rtl
+ JML Dungeon_ApproachFixedColor ; what we wrote over
}
InroomStairsTrapDoor:
{
lda $0200 : cmp #$05 : beq .reset
lda $b0 : jml $008781 ; what we wrote over (essentially)
.reset
pla : pla : pla
jsl StraightStairsTrapDoor_reset
jml $028b15 ; just some RTS in bank 02
}
HandleSpecialDoorLanding: {
LDA.l $7F2000,X ; what we wrote over
SEP #$30
; A = tiletype
HandleIncomingDoorState:
PHA
LDA.l DRMode : BEQ .noDoor
PLA : PHA : AND.b #$FA : CMP.b #$80 : bne .noDoor
.setDoorState
LDA.w $0418 : AND.b #$02 : BNE + : INC
+ STA.b $6C
.noDoor
PLA
CMP #$34 : bne + ; inroom stairs
PHA : LDA #$26 : STA $045E : PLA
+ RTL
}

View File

@@ -1,131 +0,0 @@
GtBossHeartCheckOverride:
lda $a0 : cmp #$1c : beq ++
cmp #$6c : beq ++
cmp #$4d : bne +
++ lda.l DRFlags : and #$01 : bne ++ ;skip if flag on
lda $403 : ora #$80 : sta $403
++ clc
rtl
+ sec
rtl
OnFileLoadOverride:
jsl OnFileLoad ; what I wrote over
+ lda.l DRFlags : and #$02 : beq + ; Mirror Scroll
lda MirrorEquipment : bne +
lda #$01 : sta MirrorEquipment
+ rtl
MirrorCheckOverride:
lda.l DRFlags : and #$02 : beq ++
lda MirrorEquipment : cmp #$01 : beq +
;++ lda $8A : and #$40 ; what I wrote over
++ phx : ldx $8A : lda.l OWTileWorldAssoc,x : plx : and.b #$ff
rtl
+ lda.l DRScroll : rtl
EGFixOnMirror:
lda.l DRFlags : and #$10 : beq +
stz $047a
+ jsl Mirror_SaveRoomData
rtl
BlockEraseFix:
lda MirrorEquipment : and #$02 : beq +
stz $05fc : stz $05fd
+ rtl
FixShopCode:
cpx #$300 : !bge +
sta RoomDataWRAM[$00].l, x
+ rtl
VitreousKeyReset:
lda.l DRMode : beq +
stz $0cba, x
+ JML $0db818 ;restore old code
GuruguruFix:
lda $a0 : cmp #$df : !bge +
and #$0f : cmp #$0e : !blt +
iny #2
+ rtl
BlindAtticFix:
lda.l DRMode : beq +
lda #$01 : rtl
+ lda FollowerIndicator : cmp.b #$06
rtl
SuctionOverworldFix:
stz $50 : stz $5e
lda.l DRMode : beq +
stz $49
+ rtl
!CutoffTable = "$27E000"
CutoffEntranceRug:
PHA : PHX
LDA.l DRMode : BEQ .norm
LDA $04 : cmp #$000A : BEQ + ; only affect A & C objects
cmp #$000C : BNE .norm
+ LDX #$0000 : LDA !CutoffTable, x
- CMP.W $A0 : BEQ .check
INX #2 : LDA !CutoffTable, x : CMP.w #$FFFF : BNE -
.norm PLX : PLA : LDA $9B52, y : STA $7E2000, x ; what we wrote over
RTL
.check
LDA $0c : CMP #$0004 : !BGE .skip
LDA $0e : CMP #$0008 : !BGE .skip
CMP.l #$0004 : !BLT .skip
BRA .norm
.skip PLX : PLA : RTL
StoreTempBunnyState:
LDA $5D : CMP #$1C : BNE +
STA $5F
+ LDA #$15 : STA $5D ; what we wrote over
RTL
RetrieveBunnyState:
STY $5D : STZ $02D8 ; what we wrote over
LDA $5F : BEQ +
STA $5D
+ RTL
; A should be how much dmg to do to Aga when leaving this function
StandardAgaDmg:
LDX.b #$00 ; part of what we wrote over
LDA.l ProgressFlags : AND #$04 : BEQ + ; zelda's not been rescued
LDA.b #$10 ; hurt him!
+ RTL ; A is zero if the AND results in zero and then Agahnim's invincible!
StandardSaveAndQuit:
LDA.b #$0F : STA.b $95 ; what we wrote over
LDA.l ProgressFlags : AND #$04 : BNE +
LDA.l DRMode : BEQ +
LDA.l StartingEntrance : CMP.b #$02 : BCC +
LDA.b #$03 : STA.l StartingEntrance ; set spawn to uncle if >=
+ RTL
; note: this skips both maiden dialog triggers if the hole is open
BlindsAtticHint:
REP #$20
CMP.w #$0122 : BNE +
LDA RoomDataWRAM[$65].low : AND.w #$0100 : BEQ +
SEP #$20 : RTL ; skip the dialog box if the hole is already open
+ SEP #$20 : JML Main_ShowTextMessage
BlindZeldaDespawnFix:
CMP.b #06 : BEQ +
LDA.w $0D00,X : BEQ + ; don't despawn follower if maiden isn't "present"
PLA : PLA : PEA.w SpritePrep_BlindMaiden_despawn_follower-1 : RTL
+ PLA : PLA : PEA.w SpritePrep_BlindMaiden_kill_the_girl-1 : RTL
BigKeyDoorCheck:
CPY.w #$001E : BNE + ; skip if it isn't a BK door
LDA.l DRFlags : AND #$0400 : BNE + ; skip if the flag is set - bk doors can be double-sided
PLA : PEA.w RoomDraw_OneSidedShutters_South_onesided_shutter_or_big_key_door-1
+ LDA.w #$0000 : RTL

View File

@@ -1,222 +0,0 @@
AdjustTransition:
{
lda $ab : and #$01ff : beq .reset
phy : ldy #$06 ; operating on vertical registers during horizontal trans
cpx.b #$02 : bcs .horizontalScrolling
ldy #$00 ; operate on horizontal regs during vert trans
.horizontalScrolling
cmp #$0008 : bcs +
pha : lda $ab : and #$0200 : beq ++
pla : bra .add
++ pla : eor #$ffff : inc ; convert to negative
.add jsr AdjustCamAdd : ply : bra .reset
+ lda $ab : and #$0200 : xba : tax
lda.l OffsetTable,x : jsr AdjustCamAdd
lda $ab : !sub #$0008 : sta $ab
ply : bra .done
.reset ; clear the $ab variable so to not disturb intra-tile doors
stz $ab
.done
lda $00 : and #$01fc
rtl
}
AdjustCamAdd:
!add $00E2,y : pha
and #$01ff : cmp #$0111 : !blt +
cmp #$01f8 : !bge ++
pla : and #$ff10 : pha : bra +
++ pla : and #$ff00 : !add #$0100 : pha
+ pla : sta $00E2,y : sta $00E0,y : rts
; expects target quad in $05 (either 0 or 1) and target pixel in $04, target room should be in $a0
; $06 is either $ff or $01/02
; uses $00-$03 and $0e for calculation
; also set up $ac
ScrollY: ;change the Y offset variables
lda $a0 : and.b #$f0 : lsr #3 : sta $0603 : inc : sta $0607
lda $05 : bne +
lda $603 : sta $00 : stz $01 : bra ++
+ lda $607 : sta $00 : lda #$02 : sta $01
++ ; $01 now contains 0 or 2 and $00 contains the correct lat
stz $0e
rep #$30
lda $00 : pha
lda $e8 : and #$01ff : sta $02
lda $04 : jsr LimitYCamera : sta $00
jsr CheckRoomLayoutY : bcc +
lda $00 : cmp #$0080 : !bge ++
cmp #$0010 : !blt .cmpSrll
lda #$0010 : bra .cmpSrll
++ cmp #$0100 : !bge .cmpSrll
lda #$0100
.cmpSrll sta $00
; figures out scroll amt
+ lda $00 : cmp $02 : bne +
lda #$0000 : bra .next
+ !blt +
!sub $02 : inc $0e : bra .next
+ lda $02 : !sub $00
.next
sta $ab
jsr AdjustCameraBoundsY
pla : sta $00
sep #$30
lda $04 : sta $20
lda $00 : sta $21 : sta $0601 : sta $0605
lda $01 : sta $aa
lda $0e : asl : ora $ac : sta $ac
lda $e9 : and #$01 : asl #2 : tax : lda $0603, x : sta $e9
rts
LimitYCamera:
cmp #$006c : !bge +
lda #$0000 : bra .end
+ cmp #$017d : !blt +
lda #$0110 : bra .end
+ !sub #$006c
.end rts
CheckRoomLayoutY:
jsr LoadRoomLayout ;switches to 8-bit
cmp #$00 : beq .lock
cmp #$07 : beq .free
cmp #$01 : beq .free
cmp #$04 : !bge .lock
cmp #$02 : bne +
lda $06 : cmp #$ff : beq .lock
+ cmp #$03 : bne .free
lda $06 : cmp #$ff : bne .lock
.free rep #$30 : clc : rts
.lock rep #$30 : sec : rts
AdjustCameraBoundsY:
jsr CheckRoomLayoutY : bcc .free
; layouts that are camera locked (quads only)
lda $04 : and #$00ff : cmp #$007d : !blt +
lda #$0088 : bra ++
+ cmp #$006d : !bge +
lda #$0078 : bra ++
+ !add #$000b
; I think we no longer need the $02 variable
++ sta $02 : lda $04 : and #$0100 : !add $02 : bra .setBounds
; layouts where the camera is free
.free lda $04 : cmp #$006c : !bge +
lda #$0077 : bra .setBounds
+ cmp #$017c : !blt +
lda #$0187 : bra .setBounds
+ !add #$000b
.setBounds sta $0618 : inc #2 : sta $061a
rts
LoadRoomLayout:
lda $a0 : asl : !add $a0 : tax
lda $1f8001, x : sta $b8
lda $1f8000, x : sta $b7
sep #$30
ldy #$01 : lda [$b7], y : and #$1c : lsr #2
rts
; expects target quad in $05 (either 0 or 1) and target pixel in $04, target room should be in $a0
; uses $00-$03 and $0e for calculation
; also set up $ac
ScrollX: ;change the X offset variables
lda $a0 : and.b #$0f : asl : sta $060b : inc : sta $060f
lda $05 : bne +
lda $60b : sta $00 : stz $01 : bra ++
+ lda $60f : sta $00 : lda #$01 : sta $01
++ ; $01 now contains 0 or 1 and $00 contains the correct long
stz $0e ; pos/neg indicator
rep #$30
lda $00 : pha
lda $e2 : and #$01ff : sta $02
lda $04 : jsr LimitXCamera : sta $00
jsr CheckRoomLayoutX : bcc +
lda $00 : cmp #$0080 : !bge ++
lda #$0000 : bra .cmpSrll
++ lda #$0100
.cmpSrll sta $00
;figures out scroll amt
+ lda $00 : cmp $02 : bne +
lda #$0000 : bra .next
+ !blt +
!sub $02 : inc $0e : bra .next
+ lda $02 : !sub $00
.next
sta $ab : lda $04
cmp #$0078 : !bge +
lda #$007f : bra ++
+ cmp #$0178 : !blt +
lda #$017f : bra ++
+ !add #$0007
++ sta $061c : inc #2 : sta $061e
pla : sta $00
sep #$30
lda $04 : ldx $046d : bne .straight
sta $22 : bra +
.straight
sta $046d ; set X position later
+
lda $00 : sta $23 : sta $0609 : sta $060d
lda $01 : sta $a9
lda $0e : asl : ora $ac : sta $ac
lda $e3 : and #$01 : asl #2 : tax : lda $060b, x : sta $e3
rts
LimitXCamera:
cmp #$0079 : !bge +
lda #$0000 : bra .end
+ cmp #$0178 : !blt +
lda #$0178
+ !sub #$0078
.end rts
CheckRoomLayoutX:
jsr LoadRoomLayout ;switches to 8-bit
cmp #$04 : !blt .lock
cmp #$05 : bne +
lda $06 : cmp #$ff : beq .lock
+ cmp #$06 : bne .free
lda $06 : cmp #$ff : bne .lock
.free rep #$30 : clc : rts
.lock rep #$30 : sec : rts
ApplyScroll:
rep #$30
lda $ab : and #$01ff : sta $00
lda $ab : and #$0200 : beq +
lda $00e2, y : !add $00 : bra .end
+ lda $00e2, y : !sub $00
.end
sta $00e2, y
sta $00e0, y
stz $ab : sep #$30 : rts
QuadrantLoadOrderBeforeScroll:
lda $045f : beq .end
lda #$08 : sta $045c ; start with opposite quadrant row
.end
JML $0091c4 ; what we overwrote
QuadrantLoadOrderAfterScroll:
lda $045f : beq .end
stz $045c : stz $045f ; draw other row and clear flag
.end
JML $0091c4 ; what we overwrote

View File

@@ -1,329 +0,0 @@
RecordStairType: {
pha
lda.l DRMode : beq .norm
lda $040c : cmp #$ff : beq .norm
lda $0e
cmp #$25 : bcc ++ ; don't record straight staircases
sta $045e
++ pla : bra +
.norm pla : sta $a0
+ lda $063d, x
rtl
}
SpiralWarp: {
lda.l DRMode : beq .abort ; abort if not DR
lda $040c : cmp.b #$ff : beq .abort ; abort if not in dungeon
lda $045e : cmp #$5e : beq .gtg ; abort if not spiral - intended room is in A!
cmp #$5f : beq .gtg
cmp #$26 : beq .inroom
.abort
stz $045e : lda $a2 : and #$0f : rtl ; clear,run hijacked code and get out
.inroom
jsr InroomStairsWarp
lda $a2 : and #$0f ; this is the code we are hijacking
rtl
.gtg
phb : phk : plb : phx : phy ; push stuff
jsr LookupSpiralOffset
rep #$30 : and #$00FF : asl #2 : tax
lda.w SpiralTable, x : sta $00
lda.w SpiralTable+2, x : sta $02
sep #$30
lda $00 : sta $a0
; shift quadrant if necessary
stz $07 ; this is a x quad adjuster for those blasted staircase on the edges
lda $01 : and #$01 : !sub $a9
bne .xQuad
lda $0462 : and #$04 : bne .xqCont
inc $07
.xqCont lda $22 : bne .skipXQuad ; this is an edge case
dec $23 : bra .skipXQuad ; need to -1 if $22 is 0
.xQuad sta $06 : !add $a9 : sta $a9
lda $0462 : and #$04 : bne .xCont
inc $07 ; up stairs are going to -1 the quad anyway during transition, need to add this back
.xCont ldy #$00 : jsr ShiftQuadSimple
.skipXQuad
lda $aa : lsr : sta $06 : lda $01 : and #$02 : lsr : !sub $06
beq .skipYQuad
sta $06 : asl : !add $aa : sta $aa
ldy #$01 : jsr ShiftQuadSimple
.skipYQuad
lda $01 : and #$04 : lsr : sta $048a ;fix layer calc 0->0 2->1
lda $01 : and #$08 : lsr #2 : sta $0492 ;fix from layer calc 0->0 2->1
; shift lower coordinates
lda $02 : sta $22 : bne .adjY : lda $23 : !add $07 : sta $23
.adjY lda $03 : sta $20 : bne .upDownAdj : inc $21
.upDownAdj ldx #$08
lda $0462 : and #$04 : beq .upStairs
ldx #$fd
lda $01 : and #$80 : bne .set53
; if target is also down adjust by (6,-15)
lda #$06 : !add $20 : sta $20 : lda #$eb : !add $22 : sta $22 : bra .set53
.upStairs
lda $01 : and #$80 : beq .set53
; if target is also up adjust by (-6, 14)
lda #$fa : !add $20 : sta $20 : lda #$14 : !add $22 : sta $22
bne .set53 : inc $23
.set53
txa : !add $22 : sta $53
lda $01 : and #$10 : sta $07 ; zeroHzCam check
ldy #$00 : jsr SetCamera
lda $01 : and #$20 : sta $07 ; zeroVtCam check
ldy #$01 : jsr SetCamera
jsr StairCleanup
ply : plx : plb ; pull the stuff we pushed
lda $a2 : and #$0f ; this is the code we are hijacking
rtl
}
StairCleanup: {
stz $045e ; clear the staircase flag
; animated tiles fix
lda.l DRMode : cmp #$02 : bne + ; only do this in crossed mode
ldx $a0 : lda.l TilesetTable, x
cmp $0aa1 : beq + ; already eq no need to decomp
sta $0aa1
tax : lda $02802e, x : tay
jsl DecompDungAnimatedTiles
+
stz $047a
rts
}
;Sets the offset in A
LookupSpiralOffset: {
;where link currently is in $a2: quad in a8 & #$03
;count doors
stz $00 : ldx #$00 : stz $01
.loop
lda $047e, x : cmp $00 : bcc .continue
sta $00
.continue inx #2
cpx #$08 : bcc .loop
lda $00 : lsr
cmp #$01 : beq .done
; look up the quad
lda $a9 : ora $aa : and #$03 : beq .quad0
cmp #$01 : beq .quad1
cmp #$02 : beq .quad2
bra .quad3
.quad0
inc $01 : lda $a2
cmp #$0c : beq .q0diff ;gt ent
cmp #$70 : bne .done ;hc stairwell
.q0diff lda $22 : cmp #$00 : beq .secondDoor
cmp #$98 : bcc .done ;gt ent and hc stairwell
.secondDoor inc $01 : bra .done
.quad1
lda $a2
cmp #$1a : beq .q1diff ;pod compass
cmp #$26 : beq .q1diff ;swamp elbows
cmp #$6a : beq .q1diff ;pod dark basement
cmp #$76 : bne .done ;swamp drain
.q1diff lda $22 : cmp #$98 : bcc .done
inc $01 : bra .done
.quad2
lda #$03 : sta $01 : lda $a2
cmp #$5f : beq .iceu ;ice u room
cmp #$3f : bne .done ;hammer ice exception
stz $01 : bra .done
.iceu lda $22 : cmp #$78 : bcc .done
inc $01 : bra .done
.quad3
lda $a2 : cmp #$40 : beq .done ; top of aga exception
lda #$02 : sta $01 ; always 2
.done
lda $a2 : tax : lda.w SpiralOffset,x
!add $01 ;add a thing (0 in easy case)
rts
}
InroomStairsWarp: {
phb : phk : plb : phx : phy ; push stuff
; find stairs by room and store index in X
lda $a0 : ldx #$07
.loop
cmp.w InroomStairsRoom,x
beq .found
dex
bne .loop
.found
rep #$30
txa : and #$00ff : asl : tay
lda.w InroomStairsTable,y : sta $00
sep #$30
sta $a0
; set position and everything else based on target door type
txa : and #$01 : eor #$01 : sta $07
; should be the same as lda $0462 : and #$04 : lsr #2 : eor #$01 : sta $07
lda $01 : and #$80 : beq .notEdge
lda $07 : sta $03 : beq +
lda $01 : jsr LoadSouthMidpoint : sta $22 : lda #$f4
bra ++
+
lda $01 : jsr LoadNorthMidpoint : sta $22 : dec $21 : lda #$f7
++
sta $20
lda $01 : and #$20 : beq +
lda #$01
+
sta $02
stz $07
lda $01 : and #$10 : lsr #4
JMP .layer
.notEdge
lda $01 : and #$03 : cmp #$03 : bne .normal
txa : and #$06 : sta $07
lda $01 : and #$30 : lsr #3 : tay
lda.w InroomStairsX+1,y : sta $02
lda.w InroomStairsY+1,y : sta $03
cpy $07 : beq .vanillaTransition
lda.w InroomStairsX,y : sta $22
lda.w InroomStairsY,y
ldy $07 : beq +
!add #$07
+
sta $20
inc $07
bra ++
.vanillaTransition
lda #$c0 : sta $07 ; leave camera
++
%StonewallCheck($1b)
lda $01 : and #$04 : lsr #2
bra .layer
.normal
lda $01 : sta $fe ; trap door
lda $07 : sta $03 : beq +
lda $01 : and #$04 : bne .specialFix
lda #$e0 : bra ++
.specialFix
lda #$c8 : bra ++
+
%StonewallCheck($43)
lda $01 : and #$04 : bne +
lda #$1b : bra ++
+ lda #$33
++ sta $20
inc $07 : stz $02 : lda #$78 : sta $22
lda $01 : and #$03 : beq ++
cmp #$02 : !bge +
lda #$f8 : sta $22 : stz $07 : bra ++
+ inc $02
++
lda $01 : and #$04 : lsr #2
.layer
sta $ee
bne +
stz $0476
+
lda $02 : !sub $a9
beq .skipXQuad
sta $06 : !add $a9 : sta $a9
ldy #$00 : jsr ShiftQuadSimple
.skipXQuad
lda $aa : lsr : sta $06 : lda $03 : !sub $06
beq .skipYQuad
sta $06 : asl : !add $aa : sta $aa
ldy #$01 : jsr ShiftQuadSimple
.skipYQuad
lda $07 : bmi .skipCamera
ldy #$00 : jsr SetCamera ; horizontal camera
ldy #$01 : sty $07 : jsr SetCamera ; vertical camera
lda $20 : cmp #$e0 : bcc +
lda $e8 : bne +
lda #$10 : sta $e8 ; adjust vertical camera at bottom
+
.skipCamera
jsr StairCleanup
ply : plx : plb ; pull the stuff we pushed
rts
}
ShiftQuadSimple: {
lda.w CoordIndex,y : tax
lda $20,x : beq .skip
lda $21,x : !add $06 : sta $21,x ; coordinate update
.skip
lda.w CamQuadIndex,y : tax
lda $0601,x : !add $06 : sta $0601,x
lda $0605,x : !add $06 : sta $0605,x ; high bytes of these guys
rts
}
SetCamera: {
stz $04
tyx : lda $a9,x : bne .nonZeroHalf
lda.w CamQuadIndex,y : tax : lda $607,x : pha
lda.w CameraIndex,y : tax : pla : cmp $e3, x : bne .noQuadAdj
dec $e3,x
.noQuadAdj
lda $07 : bne .adj0
lda.w CoordIndex,y : tax
lda $20,x : beq .oddQuad
cmp #$79 : bcc .adj0
!sub #$78 : sta $04
tya : asl : !add #$04 : tax : jsr AdjCamBounds : bra .done
.oddQuad
lda #$80 : sta $04 : bra .adj1 ; this is such a weird case - quad cross boundary
.adj0
tya : asl : tax : jsr AdjCamBounds : bra .done
.nonZeroHalf ;meaning either right half or bottom half
lda $07 : bne .setQuad
lda.w CoordIndex,y : tax
lda $20,x : cmp #$78 : bcs .setQuad
!add #$78 : sta $04
lda.w CamQuadIndex,y : tax : lda $0603, x : pha
lda.w CameraIndex,y : tax : pla : sta $e3, x
.adj1
tya : asl : !add #$08 : tax : jsr AdjCamBounds : bra .done
.setQuad
lda.w CamQuadIndex,y : tax : lda $0607, x : pha
lda.w CameraIndex,y : tax : pla : sta $e3, x
tya : asl : !add #$0c : tax : jsr AdjCamBounds : bra .done
.done
lda.w CameraIndex,y : tax
lda $04 : sta $e2, x
rts
}
; input, expects X to be an appropriate offset into the CamBoundBaseLine table
; when $04 is 0 no coordinate are added
AdjCamBounds: {
rep #$20 : lda.w CamBoundBaseLine, x : sta $05
lda $04 : and #$00ff : beq .common
lda.w CoordIndex,y : tax
lda $20, x : and #$00ff : !add $05 : sta $05
.common
lda.w OppCamBoundIndex,y : tax
lda $05 : sta $0618, x
inc #2 : sta $061A, x : sep #$20
rts
}
SpiralPriorityHack: {
lda.l DRMode : beq +
lda #$01 : rtl ; always skip the priority code - until I figure out how to fix it
+ lda $0462 : and #$04 ; what we wrote over
rtl
}

View File

@@ -21,7 +21,7 @@ DoDungeonMapBossIcon:
; get dungeon boss room
++ REP #$30
LDA.l DungeonMapBossRooms, X
LDA.l $8AE817,X
ASL
TAX

View File

@@ -1,13 +0,0 @@
;================================================================================
; Blind Boss fight
;--------------------------------------------------------------------------------
print "Blind Spawn Code Check: ", pc
check_blind_boss_room:
LDA $A0 ; load room index (low byte)
CMP #172 : BNE + ; Is is Thieve Town Boss Room
LDA $09DE81 : BEQ + ; Blind maiden does not need rescuing
LDA FollowerIndicator : JML Check_for_Blind_Fight
+
JML Initialize_Blind_Fight

View File

@@ -1,13 +0,0 @@
;================================================================================
; Blind Boss fight
;--------------------------------------------------------------------------------
org $9DA081 ; Original Code
JML check_blind_boss_room
Check_for_Blind_Fight:
org $9DA090
Initialize_Blind_Fight:

View File

@@ -1 +0,0 @@
incsrc blindboss_hooks.asm

View File

@@ -1,35 +0,0 @@
; Intended to be a migration of code generated by enemizer
lorom
;================================================================================
!ADD = "CLC : ADC"
!SUB = "SEC : SBC"
!BLT = "BCC"
!BGE = "BCS"
;=Constants======================================================================
!BUSHES_FLAG = "$368100"
!BLIND_DOOR_FLAG = "$368101"
!MOLDORM_EYES_FLAG = "$368102"
!RANDOM_SPRITE_FLAG = "$368103"
!AGAHNIM_FUN_BALLS = "$368104"
!ENABLE_MIMIC_OVERRIDE = "$368105"
!ENABLE_TERRORPIN_AI_FIX = "$368106"
; Enemizer reserved memory
; $7F50B0 - $7F50BF - Downstream Reserved (Enemizer)
!SHELL_DMA_FLAG = "$7F50B0"
!SOUNDFX_LOADED = "$7F50B1"
;================================================================================
incsrc hooks.asm
org $B78000 ; the original org is 368000, but I'm putting this here for migration purposes, and I think B6 is the same bank but fastrom
EnemizerTablesStart:
;none migrated yet
EnemizerCodeStart:
incsrc blindboss.asm

View File

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

View File

@@ -15,7 +15,6 @@ OnPrepFileSelect:
;--------------------------------------------------------------------------------
OnDrawHud:
JSL.l DrawChallengeTimer ; this has to come before NewDrawHud because the timer overwrites the compass counter
JSL.l DrHudOverride
JSL.l NewDrawHud
JSL.l SwapSpriteIfNecessary
JSL.l CuccoStorm
@@ -58,25 +57,25 @@ RTL
;--------------------------------------------------------------------------------
OnUncleItemGet:
PHA
LDA.l EscapeAssist
BIT.b #$04 : BEQ + : STA InfiniteMagicModifier : +
BIT.b #$02 : BEQ + : STA InfiniteBombsModifier : +
BIT.b #$01 : BEQ + : STA InfiniteArrowsModifier : +
LDA UncleItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID
LDA.l EscapeAssist
BIT.b #$04 : BEQ + : STA InfiniteMagicModifier : +
BIT.b #$02 : BEQ + : STA InfiniteBombsModifier : +
BIT.b #$01 : BEQ + : STA InfiniteArrowsModifier : +
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.l ArrowsFiller
LDA.b #70 : STA.l ArrowsFiller
LDA.l ArrowMode : BEQ +
LDA.l BowTracking : ORA #$80 : STA.l BowTracking ; enable bow toggle
REP #$20 ; set 16-bit accumulator
LDA.l CurrentRupees : !ADD.l FreeUncleItemAmount : STA.l CurrentRupees ; rupee arrows, so also give the player some money to start
SEP #$20 ; set 8-bit accumulator
LDA.l ArrowMode : BEQ +
LDA.l BowTracking : ORA.b #$80 : STA.l BowTracking ; enable bow toggle
REP #$20 ; set 16-bit accumulator
LDA.l CurrentRupees : !ADD.l FreeUncleItemAmount : STA.l CurrentRupees ; rupee arrows, so also give the player some money to start
SEP #$20 ; set 8-bit accumulator
+
LDA.l ProgressIndicator : BNE +
LDA.b #$01 : STA.l ProgressIndicator ; handle rain state
@@ -124,8 +123,6 @@ JML.l InitializeSaveFile_build_checksum
OnFileLoad:
REP #$10 ; set 16 bit index registers
JSL.l EnableForceBlank ; what we wrote over
REP #$20 : LDA.l $30F010 : STA.l MultiClientFlagsWRAM+1 : SEP #$20
LDA MultiClientFlagsROM : STA.l MultiClientFlagsWRAM
LDA.b #$07 : STA $210C ; Restore screen 3 to normal tile area
@@ -249,22 +246,11 @@ PostItemAnimation:
LDA.b #$00 : STA $7F509F
+
LDA $1B : BEQ +
REP #$20 : LDA $A0 : STA !MULTIWORLD_ROOMID : SEP #$20
LDA $0403 : STA !MULTIWORLD_ROOMDATA
+
LDA.w $02E9 : CMP.b #$01 : BNE +
LDA.b $2F : BEQ +
JSL.l IncrementChestTurnCounter
+
LDA !MULTIWORLD_ITEM_PLAYER_ID : BEQ +
STZ $02E9
LDA #$00 : STA !MULTIWORLD_ITEM_PLAYER_ID
JML.l Ancilla_ReceiveItem_objectFinished
+
STZ $02E9 : LDA $0C5E, X ; thing we wrote over to get here
JML.l Ancilla_ReceiveItem_optimus+6
RTL
;--------------------------------------------------------------------------------

View File

@@ -35,6 +35,20 @@ macro fs_draw16x16(screenrow,screencol)
%fs_draw16x8(<screenrow>+1,<screencol>)
endmacro
macro fs_draw_bombos_top(screenrow,screencol,color)
LDA.w #$0207|<color>
%fs_draw8x8(<screenrow>,<screencol>)
LDA.w #$0217|<color>|!FS_HFLIP|!FS_VFLIP
%fs_draw8x8(<screenrow>,<screencol>+1)
endmacro
macro fs_draw_bombos_right(screenrow,screencol,color)
LDA.w #$0217|<color>|!FS_HFLIP|!FS_VFLIP
%fs_draw8x8(<screenrow>,<screencol>)
LDA.w #$0207|<color>|!FS_HFLIP|!FS_VFLIP
%fs_draw8x8(<screenrow>+1,<screencol>)
endmacro
macro fs_LDY_screenpos(screenrow,screencol)
LDY.w #<screenrow>*$20+<screencol>*2+$1004
endmacro
@@ -83,28 +97,28 @@ JMP DrawItemGray
DrawBottle:
AND.w #$00FF : BNE +
LDX #FileSelectItems_empty_bottle
LDX #FileSelectItems_bombos
JMP DrawItemGray
+ : DEC #2 : BNE +
LDX #FileSelectItems_empty_bottle
LDX #FileSelectItems_bombos
JMP DrawItem
+ : DEC : BNE +
LDX #FileSelectItems_red_potion
LDX #FileSelectItems_bombos
JMP DrawItem
+ : DEC : BNE +
LDX #FileSelectItems_green_potion
LDX #FileSelectItems_bombos
JMP DrawItem
+ : DEC : BNE +
LDX #FileSelectItems_blue_potion
LDX #FileSelectItems_bombos
JMP DrawItem
+ : DEC : BNE +
LDX #FileSelectItems_fairy_bottle
LDX #FileSelectItems_bombos
JMP DrawItem
+ : DEC : BNE +
LDX #FileSelectItems_bee_bottle
LDX #FileSelectItems_bombos
JMP DrawItem
+
LDX #FileSelectItems_good_bee_bottle
LDX #FileSelectItems_bombos
JMP DrawItem
@@ -155,111 +169,111 @@ DrawPlayerFileShared:
; Bow
LDA.l BowTrackingSRAM : AND.w #$0040 : BEQ +
LDA EquipmentSRAM+$00 : AND.w #$00FF : BEQ ++
%fs_drawItem(3,12,FileSelectItems_silver_bow)
%fs_drawItem(3,12,FileSelectItems_bombos)
BRA .bow_end
++
%fs_drawItem(3,12,FileSelectItems_silver_arrow)
%fs_drawItem(3,12,FileSelectItems_bombos)
BRA .bow_end
+
LDA.l EquipmentSRAM : AND.w #$00FF : BEQ +
%fs_drawItem(3,12,FileSelectItems_bow)
%fs_drawItem(3,12,FileSelectItems_bombos)
BRA .bow_end
+
%fs_drawItemGray(3,12,FileSelectItems_bow)
%fs_drawItemGray(3,12,FileSelectItems_bombos)
.bow_end
; Boomerang
LDA.l InventoryTrackingSRAM : AND.w #$00C0 : CMP.w #$00C0 : BNE +
%fs_drawItem(3,14,FileSelectItems_both_boomerang)
%fs_drawItem(3,14,FileSelectItems_bombos)
BRA .boomerang_end
+
LDA.l InventoryTrackingSRAM : AND.w #$0040 : BEQ +
%fs_drawItem(3,14,FileSelectItems_red_boomerang)
%fs_drawItem(3,14,FileSelectItems_bombos)
BRA .boomerang_end
+
LDA.l InventoryTrackingSRAM : AND.w #$0080 : BEQ +
%fs_drawItem(3,14,FileSelectItems_blue_boomerang)
%fs_drawItem(3,14,FileSelectItems_bombos)
BRA .boomerang_end
+
%fs_drawItemGray(3,14,FileSelectItems_blue_boomerang)
%fs_drawItemGray(3,14,FileSelectItems_bombos)
.boomerang_end
; Hookshot
%fs_drawItemBasic(EquipmentSRAM+$02,3,16,FileSelectItems_hookshot)
%fs_drawItemBasic(EquipmentSRAM+$02,3,16,FileSelectItems_bombos)
; Bombs
; %fs_drawItemBasic(EquipmentSRAM+$03,3,18,FileSelectItems_bombs)
; %fs_drawItemBasic(EquipmentSRAM+$03,3,18,FileSelectItems_bombos)
; Powder
LDA.l InventoryTrackingSRAM : AND.w #$0010 : BEQ +
%fs_drawItem(3,20,FileSelectItems_powder)
%fs_drawItem(3,20,FileSelectItems_bombos)
BRA ++
+
%fs_drawItemGray(3,20,FileSelectItems_powder)
%fs_drawItemGray(3,20,FileSelectItems_bombos)
++
; Mushroom
LDA.l InventoryTrackingSRAM : AND.w #$0008 : BEQ +
%fs_drawItem(3,18,FileSelectItems_mushroom)
%fs_drawItem(3,18,FileSelectItems_bombos)
BRA ++
+
%fs_drawItemGray(3,18,FileSelectItems_mushroom)
%fs_drawItemGray(3,18,FileSelectItems_bombos)
++
; Flute
LDA.l InventoryTrackingSRAM : AND.w #$0003 : BEQ +
%fs_drawItem(7,16,FileSelectItems_flute)
%fs_drawItem(7,16,FileSelectItems_bombos)
BRA ++
+
%fs_drawItemGray(7,16,FileSelectItems_flute)
%fs_drawItemGray(7,16,FileSelectItems_bombos)
++
; Shovel
LDA.l InventoryTrackingSRAM : AND.w #$0004 : BEQ +
%fs_drawItem(9,12,FileSelectItems_shovel)
%fs_drawItem(9,12,FileSelectItems_bombos)
BRA ++
+
%fs_drawItemGray(9,12,FileSelectItems_shovel)
%fs_drawItemGray(9,12,FileSelectItems_bombos)
++
; Fire Rod
%fs_drawItemBasic(EquipmentSRAM+$05,5,12,FileSelectItems_fire_rod)
%fs_drawItemBasic(EquipmentSRAM+$05,5,12,FileSelectItems_bombos)
; Ice Rod
%fs_drawItemBasic(EquipmentSRAM+$06,5,14,FileSelectItems_ice_rod)
%fs_drawItemBasic(EquipmentSRAM+$06,5,14,FileSelectItems_bombos)
; Bombos Medallion
%fs_drawItemBasic(EquipmentSRAM+$07,5,16,FileSelectItems_bombos)
; Ether Medallion
%fs_drawItemBasic(EquipmentSRAM+$08,5,18,FileSelectItems_ether)
%fs_drawItemBasic(EquipmentSRAM+$08,5,18,FileSelectItems_bombos)
; Quake Medallion
%fs_drawItemBasic(EquipmentSRAM+$09,5,20,FileSelectItems_quake)
%fs_drawItemBasic(EquipmentSRAM+$09,5,20,FileSelectItems_bombos)
; Lamp
%fs_drawItemBasic(EquipmentSRAM+$0A,7,12,FileSelectItems_lamp)
%fs_drawItemBasic(EquipmentSRAM+$0A,7,12,FileSelectItems_bombos)
; Hammer
%fs_drawItemBasic(EquipmentSRAM+$0B,7,14,FileSelectItems_hammer)
%fs_drawItemBasic(EquipmentSRAM+$0B,7,14,FileSelectItems_bombos)
; Bug Net
%fs_drawItemBasic(EquipmentSRAM+$0D,7,18,FileSelectItems_bugnet)
%fs_drawItemBasic(EquipmentSRAM+$0D,7,18,FileSelectItems_bombos)
; Book of Mudora
%fs_drawItemBasic(EquipmentSRAM+$0E,7,20,FileSelectItems_book)
%fs_drawItemBasic(EquipmentSRAM+$0E,7,20,FileSelectItems_bombos)
; Red Cane
%fs_drawItemBasic(EquipmentSRAM+$10,9,14,FileSelectItems_redcane)
%fs_drawItemBasic(EquipmentSRAM+$10,9,14,FileSelectItems_bombos)
; Blue Cane
%fs_drawItemBasic(EquipmentSRAM+$11,9,16,FileSelectItems_bluecane)
%fs_drawItemBasic(EquipmentSRAM+$11,9,16,FileSelectItems_bombos)
; Cape
%fs_drawItemBasic(EquipmentSRAM+$12,9,18,FileSelectItems_cape)
%fs_drawItemBasic(EquipmentSRAM+$12,9,18,FileSelectItems_bombos)
; Mirror
%fs_drawItemBasic(EquipmentSRAM+$13,9,20,FileSelectItems_mirror)
%fs_drawItemBasic(EquipmentSRAM+$13,9,20,FileSelectItems_bombos)
; Bottles
%fs_drawBottle(EquipmentSRAM+$1C,3,23)
@@ -270,71 +284,70 @@ DrawPlayerFileShared:
; Sword
LDA.l SpecialWeapons : AND.w #$00FF : CMP #$0001 : BEQ .bombSword
LDA.l EquipmentSRAM+$19 : AND.w #$00FF : BNE +
%fs_drawItemGray(3,26,FileSelectItems_fighters_sword)
%fs_drawItemGray(3,26,FileSelectItems_bombos)
JMP ++
+ : DEC : BNE +
%fs_drawItem(3,26,FileSelectItems_fighters_sword)
%fs_drawItem(3,26,FileSelectItems_bombos)
JMP ++
+ : DEC : BNE +
%fs_drawItem(3,26,FileSelectItems_master_sword)
%fs_drawItem(3,26,FileSelectItems_bombos)
JMP ++
+ : DEC : BNE +
%fs_drawItem(3,26,FileSelectItems_tempered_sword)
%fs_drawItem(3,26,FileSelectItems_bombos)
BRA ++
+ : DEC : BNE +
%fs_drawItem(3,26,FileSelectItems_gold_sword)
%fs_drawItem(3,26,FileSelectItems_bombos)
BRA ++
+
; a sword value above 4 is either corrupted or 0xFF (a.k.a. swordless)
%fs_drawItemGray(3,26,FileSelectItems_fighters_sword)
BRA ++
%fs_drawItemGray(3,26,FileSelectItems_bombos)
.bombSword
LDA.l $70038F : AND.w #$00FF : BNE +
%fs_drawItemGray(3,26,FileSelectItems_fighters_bombs)
%fs_drawItemGray(3,26,FileSelectItems_bombos)
BRA ++
+ : DEC : BNE +
%fs_drawItem(3,26,FileSelectItems_fighters_bombs)
%fs_drawItem(3,26,FileSelectItems_bombos)
BRA ++
+ : DEC : BNE +
%fs_drawItem(3,26,FileSelectItems_master_bombs)
%fs_drawItem(3,26,FileSelectItems_bombos)
BRA ++
+ : DEC : BNE +
%fs_drawItem(3,26,FileSelectItems_tempered_bombs)
%fs_drawItem(3,26,FileSelectItems_bombos)
BRA ++
+ : DEC : BNE +
%fs_drawItem(3,26,FileSelectItems_gold_bombs)
%fs_drawItem(3,26,FileSelectItems_bombos)
BRA ++
+ : DEC : BNE +
%fs_drawItem(3,26,FileSelectItems_extra_gold_bombs)
%fs_drawItem(3,26,FileSelectItems_bombos)
BRA ++
+
; a bomb value above 5 is... who knows, let's just pretend it's 5
%fs_drawItem(3,26,FileSelectItems_extra_gold_bombs)
%fs_drawItem(3,26,FileSelectItems_bombos)
++
; Shield
LDA.l EquipmentSRAM+$1A : AND.w #$00FF : BNE +
%fs_drawItemGray(5,26,FileSelectItems_fighters_shield)
%fs_drawItemGray(5,26,FileSelectItems_bombos)
BRA ++
+ : DEC : BNE +
%fs_drawItem(5,26,FileSelectItems_fighters_shield)
%fs_drawItem(5,26,FileSelectItems_bombos)
BRA ++
+ : DEC : BNE +
%fs_drawItem(5,26,FileSelectItems_fire_shield)
%fs_drawItem(5,26,FileSelectItems_bombos)
BRA ++
+
%fs_drawItem(5,26,FileSelectItems_mirror_shield)
%fs_drawItem(5,26,FileSelectItems_bombos)
++
; Mail
LDA.l EquipmentSRAM+$1B : AND.w #$00FF : BNE +
%fs_drawItem(7,26,FileSelectItems_green_mail)
%fs_drawItem(7,26,FileSelectItems_bombos)
BRA ++
+ : DEC : BNE +
%fs_drawItem(7,26,FileSelectItems_blue_mail)
%fs_drawItem(7,26,FileSelectItems_bombos)
BRA ++
+
%fs_drawItem(7,26,FileSelectItems_red_mail)
%fs_drawItem(7,26,FileSelectItems_bombos)
++
; Heart Pieces
@@ -357,24 +370,24 @@ DrawPlayerFileShared:
LDA $7F5007 : AND.w #$00FF : !ADD.w #$210+!FS_COLOR_BW : %fs_draw8x8(11,27)
; Boots
%fs_drawItemBasic(EquipmentSRAM+$15,3,28,FileSelectItems_boots)
%fs_drawItemBasic(EquipmentSRAM+$15,3,28,FileSelectItems_bombos)
; Gloves
LDA.l EquipmentSRAM+$14 : AND.w #$00FF : BNE +
%fs_drawItemGray(5,28,FileSelectItems_gloves)
%fs_drawItemGray(5,28,FileSelectItems_bombos)
BRA ++
+ : DEC : BNE +
%fs_drawItem(5,28,FileSelectItems_gloves)
%fs_drawItem(5,28,FileSelectItems_bombos)
BRA ++
+
%fs_drawItem(5,28,FileSelectItems_mitts)
%fs_drawItem(5,28,FileSelectItems_bombos)
++
; Flippers
%fs_drawItemBasic(EquipmentSRAM+$16,7,28,FileSelectItems_flippers)
%fs_drawItemBasic(EquipmentSRAM+$16,7,28,FileSelectItems_bombos)
; Moon Pearl
%fs_drawItemBasic(EquipmentSRAM+$17,9,28,FileSelectItems_pearl)
%fs_drawItemBasic(EquipmentSRAM+$17,9,28,FileSelectItems_bombos)
; Pendants
LDA EquipmentSRAM+$34 : AND.w #$0004 : BEQ +
@@ -400,53 +413,53 @@ DrawPlayerFileShared:
; Crystals
LDA EquipmentSRAM+$3A : AND.w #$0002 : BEQ +
LDA.w #$0297|!FS_COLOR_BLUE
%fs_draw_bombos_top(12,21,!FS_COLOR_YELLOW)
BRA ++
+
LDA.w #$0287|!FS_COLOR_GRAY
++ : %fs_draw16x8(13,18)
%fs_draw_bombos_top(12,21,!FS_COLOR_GRAY)
++
LDA EquipmentSRAM+$3A : AND.w #$0010 : BEQ +
LDA.w #$0297|!FS_COLOR_BLUE
LDA.w #$0207|!FS_COLOR_YELLOW
BRA ++
+
LDA.w #$0287|!FS_COLOR_GRAY
++ : %fs_draw16x8(12,19)
LDA.w #$0207|!FS_COLOR_GRAY
++ : %fs_draw8x16(13,19)
LDA EquipmentSRAM+$3A : AND.w #$0040 : BEQ +
LDA.w #$0297|!FS_COLOR_BLUE
%fs_draw_bombos_right(13,20,!FS_COLOR_YELLOW)
BRA ++
+
LDA.w #$0287|!FS_COLOR_GRAY
++ : %fs_draw16x8(13,20)
%fs_draw_bombos_right(13,20,!FS_COLOR_GRAY)
++
LDA EquipmentSRAM+$3A : AND.w #$0020 : BEQ +
LDA.w #$0297|!FS_COLOR_BLUE
LDA.w #$0207|!FS_COLOR_YELLOW
BRA ++
+
LDA.w #$0287|!FS_COLOR_GRAY
++ : %fs_draw16x8(12,21)
LDA.w #$0207|!FS_COLOR_GRAY
++ : %fs_draw8x16(13,21)
LDA EquipmentSRAM+$3A : AND.w #$0004 : BEQ +
LDA.w #$0297|!FS_COLOR_RED
%fs_draw_bombos_right(13,22,!FS_COLOR_RED)
BRA ++
+
LDA.w #$0287|!FS_COLOR_GRAY
++ : %fs_draw16x8(13,22)
%fs_draw_bombos_right(13,22,!FS_COLOR_GRAY)
++
LDA EquipmentSRAM+$3A : AND.w #$0001 : BEQ +
LDA.w #$0297|!FS_COLOR_RED
LDA.w #$0207|!FS_COLOR_RED
BRA ++
+
LDA.w #$0287|!FS_COLOR_GRAY
++ : %fs_draw16x8(12,23)
LDA.w #$0207|!FS_COLOR_GRAY
++ : %fs_draw8x16(13,23)
LDA EquipmentSRAM+$3A : AND.w #$0008 : BEQ +
LDA.w #$0297|!FS_COLOR_BLUE
%fs_draw_bombos_right(13,24,!FS_COLOR_YELLOW)
BRA ++
+
LDA.w #$0287|!FS_COLOR_GRAY
++ : %fs_draw16x8(13,24)
%fs_draw_bombos_right(13,24,!FS_COLOR_GRAY)
++
PLB : PLY : PLX
@@ -515,13 +528,13 @@ FileSelectItems:
dw #$0264|!FS_COLOR_RED, #$0265|!FS_COLOR_RED, #$0274|!FS_COLOR_RED, #$0275|!FS_COLOR_RED
.no_pendant
dw #$0285|!FS_COLOR_GRAY, #$0286|!FS_COLOR_GRAY, #$02B2|!FS_COLOR_GRAY, #$0296|!FS_COLOR_GRAY
dw #$0207|!FS_COLOR_GRAY, #$0217|!FS_COLOR_GRAY|!FS_HFLIP|!FS_VFLIP, #$0217|!FS_COLOR_GRAY, #$0207|!FS_COLOR_GRAY|!FS_HFLIP|!FS_VFLIP
.green_pendant
dw #$0285|!FS_COLOR_GREEN, #$0286|!FS_COLOR_GREEN, #$0295|!FS_COLOR_GREEN, #$0296|!FS_COLOR_GREEN
dw #$0207|!FS_COLOR_GREEN, #$0217|!FS_COLOR_GREEN|!FS_HFLIP|!FS_VFLIP, #$0217|!FS_COLOR_GREEN, #$0207|!FS_COLOR_GREEN|!FS_HFLIP|!FS_VFLIP
.blue_pendant
dw #$0285|!FS_COLOR_BLUE, #$0286|!FS_COLOR_BLUE, #$0295|!FS_COLOR_BLUE, #$0296|!FS_COLOR_BLUE
dw #$0207|!FS_COLOR_BLUE, #$0217|!FS_COLOR_BLUE|!FS_HFLIP|!FS_VFLIP, #$0217|!FS_COLOR_BLUE, #$0207|!FS_COLOR_BLUE|!FS_HFLIP|!FS_VFLIP
.red_pendant
dw #$0285|!FS_COLOR_RED, #$0286|!FS_COLOR_RED, #$0295|!FS_COLOR_RED, #$0296|!FS_COLOR_RED
dw #$0207|!FS_COLOR_RED, #$0217|!FS_COLOR_RED|!FS_HFLIP|!FS_VFLIP, #$0217|!FS_COLOR_RED, #$0207|!FS_COLOR_RED|!FS_HFLIP|!FS_VFLIP
.gloves
dw #$024E|!FS_COLOR_BROWN, #$024F|!FS_COLOR_BROWN, #$025E|!FS_COLOR_BROWN, #$025F|!FS_COLOR_BROWN
@@ -557,13 +570,13 @@ FileSelectItems:
dw #$026F|!FS_COLOR_RED, #$026F|!FS_COLOR_RED|!FS_HFLIP, #$027F|!FS_COLOR_RED, #$02B5|!FS_COLOR_RED
.heart_piece_0_of_4
dw #$0280|!FS_COLOR_RED, #$0280|!FS_COLOR_RED|!FS_HFLIP, #$0290|!FS_COLOR_RED, #$0290|!FS_COLOR_RED|!FS_HFLIP
dw #$0207|!FS_COLOR_GRAY, #$0217|!FS_COLOR_GRAY|!FS_HFLIP|!FS_VFLIP, #$0217|!FS_COLOR_GRAY, #$0207|!FS_COLOR_GRAY|!FS_HFLIP|!FS_VFLIP
.heart_piece_1_of_4
dw #$0281|!FS_COLOR_RED, #$0280|!FS_COLOR_RED|!FS_HFLIP, #$0290|!FS_COLOR_RED, #$0290|!FS_COLOR_RED|!FS_HFLIP
dw #$0207|!FS_COLOR_YELLOW, #$0217|!FS_COLOR_GRAY|!FS_HFLIP|!FS_VFLIP, #$0217|!FS_COLOR_GRAY, #$0207|!FS_COLOR_GRAY|!FS_HFLIP|!FS_VFLIP
.heart_piece_2_of_4
dw #$0281|!FS_COLOR_RED, #$0280|!FS_COLOR_RED|!FS_HFLIP, #$0291|!FS_COLOR_RED, #$0290|!FS_COLOR_RED|!FS_HFLIP
dw #$0207|!FS_COLOR_YELLOW, #$0217|!FS_COLOR_YELLOW|!FS_HFLIP|!FS_VFLIP, #$0217|!FS_COLOR_GRAY, #$0207|!FS_COLOR_GRAY|!FS_HFLIP|!FS_VFLIP
.heart_piece_3_of_4
dw #$0281|!FS_COLOR_RED, #$0281|!FS_COLOR_RED|!FS_HFLIP, #$0291|!FS_COLOR_RED, #$0290|!FS_COLOR_RED|!FS_HFLIP
dw #$0207|!FS_COLOR_YELLOW, #$0217|!FS_COLOR_YELLOW|!FS_HFLIP|!FS_VFLIP, #$0217|!FS_COLOR_YELLOW, #$0207|!FS_COLOR_GRAY|!FS_HFLIP|!FS_VFLIP
.empty_bottle
dw #$0240|!FS_COLOR_BW, #$0241|!FS_COLOR_BW, #$0250|!FS_COLOR_BW, #$0251|!FS_COLOR_BW

View File

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

View File

@@ -11,19 +11,15 @@ FloodGateReset:
LDA RoomDataWRAM[$28].high : AND.b #$FE : STA RoomDataWRAM[$28].high ; clear water front room (room 40)
+
FloodGateResetInner:
LDA.l Bugfix_SwampWaterLevel : BEQ .done
LDA DRMode : BEQ .check_room_35; Only do the check for room 37 if on door rando
LDA.l SwampDrain1HasItem : BEQ .flipper_check
LDA $7F666F : AND.b #$80 : BEQ .drain_room_37 ; Check if key in room 37 has been collected.
.flipper_check
LDA FlippersEquipment : AND.b #$01 : BNE .check_room_35 ; Check for flippers. This can otherwise softlock doors if flooded without flippers and no way to reset.
.drain_room_37
LDA RoomDataWRAM[$37].low : AND.b #$7F : STA RoomDataWRAM[$37].low ; clear water room 37 - outer room you shouldn't be able to softlock except in major glitches
.check_room_35
LDA.l SwampDrain2HasItem : BEQ .done
LDA $7F666B : AND.b #$80 : BNE .done ; Check if key in room 35 has been collected.
LDA.l Bugfix_SwampWaterLevel : BEQ +++
LDA RoomDataWRAM[$37].low : AND.b #$04 : BEQ + ; Check if key in room 55 has been collected.
LDA FlippersEquipment : AND.b #$01 : BNE ++ ; Check for flippers. This can otherwise softlock doors if flooded without flippers and no way to reset.
+
LDA RoomDataWRAM[$37].low : AND.b #$7F : STA RoomDataWRAM[$37].low ; clear water room 55 - outer room you shouldn't be able to softlock except in major glitches
++
LDA 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 RoomDataWRAM[$35].low : AND.b #$7F : STA RoomDataWRAM[$35].low ; clear water room 35 - inner room with the easy key flood softlock
.done
LDA RoomDataWRAM[$35].low : AND.b #$7F : STA RoomDataWRAM[$35].low ; clear water room 53 - inner room with the easy key flood softlock
+++
RTL
;================================================================================

View File

@@ -5,7 +5,6 @@ SpawnHauntedGroveItem:
LDA $8A : CMP.b #$2A : BEQ + : RTL : + ; Skip if not the haunted grove
LDA $1B : BEQ + : RTL : + ; Skip if indoors
LDA.l HauntedGroveItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
%GetPossiblyEncryptedItem(HauntedGroveItem, HeartPieceOutdoorValues)
JSL.l PrepDynamicTile
@@ -61,10 +60,7 @@ FluteBoy:
JML.l FluteBoy_Continue
;--------------------------------------------------------------------------------
FreeDuckCheck:
LDA.l OWMode+1 : AND.b #!FLAG_OW_MIXED : BNE .skipInvertedCheck
LDA.l InvertedMode : BEQ .done
.skipInvertedCheck
LDA.l InvertedMode : BEQ .done
LDA FluteEquipment : CMP.b #$03 : BEQ .done ; flute is already active
; check the area, is it #$18 = 30?

View File

@@ -20,25 +20,9 @@ FrameHookAction:
++
REP #$30 : PLA : PLP
RTL
!NMI_MW = "$7F5047"
;--------------------------------------------------------------------------------
NMIHookAction:
PHA : PHX : PHY : PHD ; thing we wrote over, push stuff
LDA !NMI_MW : BEQ ++
PHP
SEP #$30
LDA #$00 : STA !NMI_MW
; Multiworld text
LDA !NMI_MW+1 : BEQ +
LDA #$00 : STA !NMI_MW+1
JSL.l WriteText
+
PLP
++
LDA StatsLocked : AND.w #$00FF : BNE ++
LDA NMIFrames : INC : STA NMIFrames : BNE +
@@ -49,27 +33,27 @@ NMIHookAction:
JML.l NMIHookReturn
;--------------------------------------------------------------------------------
!NMI_AUX = "$7F5044"
PostNMIHookAction:
LDA.l !NMI_AUX+2 : BEQ .return
PHK
PEA .return-1
PHA
LDA.b #$00 : STA.l !NMI_AUX+2
REP #$20
LDA.l !NMI_AUX+0 : DEC : PHA
SEP #$20
RTL
.return
LDA.b $13 : STA.w $2100
JML.l PostNMIHookReturn
LDA !NMI_AUX : BEQ +
LDA $00 : PHA ; preserve DP ram
LDA $01 : PHA
LDA $02 : PHA
LDA !NMI_AUX+2 : STA $02 ; set up jump pointer
LDA !NMI_AUX+1 : STA $01
LDA !NMI_AUX+0 : STA $00
PHK : PER .return-1 ; push stack for RTL return
JMP [$0000]
.return
LDA.b #$00 : STA !NMI_AUX ; zero bank byte of NMI hook pointer
PLA : STA $02
PLA : STA $01
PLA : STA $00
+
LDA $13 : STA $2100 ; thing we wrote over, turn screen back on
JML.l PostNMIHookReturn
;--------------------------------------------------------------------------------

51
generate_bombos_table.rb Normal file
View File

@@ -0,0 +1,51 @@
def process_values(sprite, values)
ret = values.clone
case sprite
when 0x09, 0x53, 0x54, 0x88 # moldorm, armos knights, lanmola, mothula
ret[13] = 1 # bombos - 16 damage
when 0x83, 0x84, 0x91, 0xC3 # green and red eyegores, stalfos knight, gibo
ret[13] = 1 # bombos - 16 damage
when 0x8C, 0x92 # arrghus, helmasaur king
ret[13] = 2 # bombos - 64 damage
when 0xBD # vitreous big eye
ret[13] = 2 # bombos - 64 damage
when 0x8D, 0xBE, 0xA2 # arrghus puff, vitreous small eye, kholdstare puffs
ret[13] = 1 # bombos - 16 damage
when 0xCB, 0xCC, 0xCD # trinexx, firenexx, icenexx
ret[13] = 2 # bombos - 64 damage
when 0xD0 # lynel
ret[13] = 1 # bombos - 16 damage
end
return ret
end
def split_value(byte)
return [byte >> 4, byte & 0x0F]
end
def join_values(value1, value2)
return (value1 & 0x0F) << 4 | (value2 & 0x0F)
end
File.open("damage_table.bin") do |input|
File.open("damage_table_bombos.bin", "w") do |output|
i_enum = input.each_byte
(0...0xD7).each do |sprite|
values = []
(0...8).each do
values += split_value(i_enum.next)
end
v_enum = process_values(sprite, values).to_enum
(0...8).each do
output.putc(join_values(v_enum.next, v_enum.next))
end
end
begin
while true
output.putc(i_enum.next)
end
rescue StopIteration
end
end
end

View File

@@ -7,11 +7,8 @@
;--------------------------------------------------------------------------------
GoalItemGanonCheck:
LDA $0E20, X : CMP.b #$D6 : BNE .success ; skip if not ganon
LDA.w $0D80, X : CMP.b #$12 : BEQ .fail
JSL.l CheckGanonVulnerability
BCC .fail
JSL CheckMushroom
BCC .success
BCS .success
.fail
LDA $0D80, X : CMP.b #17 : !BLT .success ; decmial 17 because Acmlm's chart is decimal
@@ -49,7 +46,6 @@ CheckGanonVulnerability:
dw .crystals_and_bosses
dw .bosses_only
dw .all_dungeons_no_agahnim
dw .completionist
; 00 = always vulnerable
.vulnerable
@@ -71,12 +67,12 @@ CheckGanonVulnerability:
.all_dungeons_no_agahnim
LDA.l PendantsField : AND.b #$07 : CMP.b #$07 : BNE .fail ; require all pendants
LDA.l CrystalsField : AND.b #$7F : CMP.b #$7F : BNE .fail ; require all crystals
LDA RoomDataWRAM[$0D].high : AND.b #$08 : BEQ .fail ; require aga2 defeated (pyramid hole open)
LDA.l OverworldEventDataWRAM+$5B : AND.b #$20 : BEQ .fail ; require aga2 defeated (pyramid hole open)
BRA .success
; 03 = crystals and aga 2
.crystals_and_aga
LDA RoomDataWRAM[$0D].high : AND.b #$08 : BEQ .fail ; check aga2 first then bleed in
LDA.l OverworldEventDataWRAM+$5B : AND.b #$20 : BEQ .fail ; check aga2 first then bleed in
; 04 = crystals only
.crystals
@@ -103,15 +99,6 @@ CheckGanonVulnerability:
.bosses_only
JMP CheckForCrystalBossesDefeated
; 0a = Check Item counter
.completionist
REP #$20
LDA.l TotalItemCounter : CMP.l MaxItemCounter
SEP #$20
BCC .fail
BRA .all_dungeons
;--------------------------------------------------------------------------------
GetRequiredCrystalsForTower:
BEQ + : JSL.l BreakTowerSeal_ExecuteSparkles : + ; thing we wrote over

View File

@@ -6,7 +6,6 @@ GetMagicBatItem:
%GetPossiblyEncryptedItem(MagicBatItem, SpriteItemValues)
CMP.b #$FF : BEQ .normalLogic
TAY
PHA : LDA MagicBatItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID : PLA
STZ $02E9 ; 0 = Receiving item from an NPC or message
JML.l Link_ReceiveItem
.normalLogic

View File

@@ -12,12 +12,9 @@ HeartPieceGet:
.skipLoad
JSL.l HeartPieceGetPlayer : STA !MULTIWORLD_ITEM_PLAYER_ID
STZ $02E9 ; 0 = Receiving item from an NPC or message
CPY.b #$26 : BNE .notHeart ; don't add a 1/4 heart if it's not a heart piece
LDA !MULTIWORLD_ITEM_PLAYER_ID : BNE .notHeart
LDA HeartPieceQuarter : INC A : AND.b #$03 : STA HeartPieceQuarter : BNE .unfinished_heart ; add up heart quarters
BRA .giveItem
@@ -64,13 +61,16 @@ DrawHeartPieceGFX:
.skipLoad
JSL.l DrawDynamicTile
CMP #$03 : BNE +
PHA : LDA $0E60, X : ORA.b #$20 : STA $0E60, X : PLA
PHA
JSL.l IsNarrowSprite : BCC +
LDA $0E60, X : ORA.b #$20 : STA $0E60, X
+
JSL.l Sprite_DrawShadowLong
;LDA $0E60, X : ORA.b #$10 : STA $0E60, X
PLA
JSL.l DrawDynamicTile
JSL.l Sprite_DrawShadowLong
.done
PLY : PLA
@@ -94,7 +94,6 @@ DrawHeartContainerGFX:
BRA DrawHeartPieceGFX_skipLoad
;--------------------------------------------------------------------------------
HeartContainerSound:
LDA !MULTIWORLD_ITEM_PLAYER_ID : BNE +
CPY.b #$20 : BEQ + ; Skip for Crystal
CPY.b #$37 : BEQ + ; Skip for Pendants
CPY.b #$38 : BEQ +
@@ -108,11 +107,6 @@ HeartContainerSound:
RTL
;--------------------------------------------------------------------------------
NormalItemSkipSound:
LDA !MULTIWORLD_ITEM_PLAYER_ID : BEQ +
SEC
RTL
+
LDA $0C5E, X ; thing we wrote over
CPY.b #$20 : BEQ + ; Skip for Crystal
@@ -140,16 +134,11 @@ RTL
RTL
;--------------------------------------------------------------------------------
SaveHeartCollectedStatus:
LDA !SKIP_HEART_SAVE : BEQ .save_flag
LDA !SKIP_HEART_SAVE : BEQ .normal_behavior
DEC : STA !SKIP_HEART_SAVE
RTL
.save_flag
LDA 4,S : TAY : LDA $0ED0,Y : BEQ .normal_behavior
PHA : LDA OverworldEventDataWRAM, X : ORA 1,S : STA OverworldEventDataWRAM, X
PLA : RTL
.normal_behavior
LDA OverworldEventDataWRAM, X : ORA.b #$40 : STA OverworldEventDataWRAM, X
RTL
@@ -164,7 +153,6 @@ HeartPieceSpritePrep:
LDA $5D : CMP #$14 : BEQ .skip ; skip if we're mid-mirror
LDA #$00 : STA !REDRAW
JSL.l HeartPieceGetPlayer : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
JSL.l LoadHeartPieceRoomValue ; load item type
STA $0E80, X ; Store item type
JSL.l PrepDynamicTile
@@ -178,7 +166,6 @@ HeartContainerSpritePrep:
PHA
LDA #$00 : STA !REDRAW
JSL.l HeartPieceGetPlayer : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
JSL.l LoadHeartContainerRoomValue ; load item type
STA $0E80, X ; Store item type
JSL.l PrepDynamicTile
@@ -198,14 +185,7 @@ RTL
;--------------------------------------------------------------------------------
!REDRAW = "$7F5000"
HPItemReset:
PHA
LDA !MULTIWORLD_ITEM_PLAYER_ID : BNE .skip
PLA
JSL $09AD58 ; GiveRupeeGift - thing we wrote over
BRA .done
.skip
PLA
.done
JSL $09AD58 ; GiveRupeeGift - thing we wrote over
PHA : LDA #$01 : STA !REDRAW : PLA
RTL
;--------------------------------------------------------------------------------
@@ -220,12 +200,6 @@ MaybeMarkDigSpotCollected:
PLP : PLA
RTL
;--------------------------------------------------------------------------------
HeartPieceSpawnDelayFix:
; Fix the delay when spawning a HeartPiece sprite
JSL.l Sprite_CheckIfPlayerPreoccupied : BCS + ; what we moved from $05F037
JSL.l Sprite_CheckDamageToPlayerSameLayerLong : RTL ; what we wrote over
+ CLC : RTL
;--------------------------------------------------------------------------------
macro GetPossiblyEncryptedItem(ItemLabel,TableLabel)
LDA IsEncrypted : BNE ?encrypted
LDA.l <ItemLabel>
@@ -240,7 +214,7 @@ macro GetPossiblyEncryptedItem(ItemLabel,TableLabel)
LDA.w #<ItemLabel>-<TableLabel>
JSL RetrieveValueFromEncryptedTable
PLX : STX $02 : PLX : STX $00
PLX : STX $02 : PLX : STX $01
PLP : PLX
?done:
endmacro
@@ -294,10 +268,7 @@ LoadOutdoorValue:
PHP
REP #$20 ; set 16-bit accumulator
LDA $8A
CMP.w #$00 : BNE +
LDA.l OWBonkPrizeTable[$00].loot
JMP .done
+ CMP.w #$03 : BNE +
CMP.w #$03 : BNE +
LDA $22 : CMP.w #1890 : !BLT ++
%GetPossiblyEncryptedItem(HeartPiece_Spectacle, HeartPieceOutdoorValues)
JMP .done
@@ -305,92 +276,14 @@ LoadOutdoorValue:
%GetPossiblyEncryptedItem(EtherItem, SpriteItemValues)
JMP .done
+ CMP.w #$05 : BNE +
LDA.w $0ED0,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$01].loot
JMP .done
++
%GetPossiblyEncryptedItem(HeartPiece_Mountain_Warp, HeartPieceOutdoorValues)
JMP .done
+ CMP.w #$0A : BNE +
LDA.w $0ED0,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$02].loot
JMP .done
++
LDA.l OWBonkPrizeTable[$03].loot
JMP .done
+ CMP.w #$10 : BNE +
LDA.w $0ED0,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$04].loot
JMP .done
++
LDA.l OWBonkPrizeTable[$05].loot
JMP .done
+ CMP.w #$11 : BNE +
LDA.l OWBonkPrizeTable[$06].loot
JMP .done
+ CMP.w #$12 : BNE +
LDA.l OWBonkPrizeTable[$07].loot
JMP .done
+ CMP.w #$13 : BNE +
LDA.w $0ED0,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$08].loot
JMP .done
++
LDA.l OWBonkPrizeTable[$09].loot
JMP .done
+ CMP.w #$15 : BNE +
LDA.w $0ED0,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$0A].loot
JMP .done
++
LDA.l OWBonkPrizeTable[$0B].loot
JMP .done
+ CMP.w #$18 : BNE +
LDA.w $0ED0,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$0C].loot
JMP .done
++
LDA.l OWBonkPrizeTable[$0D].loot
JMP .done
+ CMP.w #$1A : BNE +
LDA.w $0ED0,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$0E].loot
JMP .done
++
LDA.l OWBonkPrizeTable[$0F].loot
JMP .done
+ CMP.w #$1B : BNE +
LDA.l OWBonkPrizeTable[$11].loot
JMP .done
+ CMP.w #$1D : BNE +
LDA.l OWBonkPrizeTable[$12].loot
JMP .done
+ CMP.w #$1E : BNE +
LDA.l OWBonkPrizeTable[$13].loot
%GetPossiblyEncryptedItem(HeartPiece_Mountain_Warp, HeartPieceOutdoorValues)
JMP .done
+ CMP.w #$28 : BNE +
%GetPossiblyEncryptedItem(HeartPiece_Maze, HeartPieceOutdoorValues)
JMP .done
+ CMP.w #$2A : BNE +
LDA.w $0ED0,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$14].loot
JMP .done
++ CMP.w #$0008 : BNE ++
LDA.l OWBonkPrizeTable[$15].loot
JMP .done
++
%GetPossiblyEncryptedItem(HauntedGroveItem, HeartPieceOutdoorValues)
JMP .done
+ CMP.w #$2B : BNE +
LDA.l OWBonkPrizeTable[$16].loot
%GetPossiblyEncryptedItem(HauntedGroveItem, HeartPieceOutdoorValues)
JMP .done
+ CMP.w #$2E : BNE +
LDA.w $0ED0,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$17].loot
JMP .done
++
LDA.l OWBonkPrizeTable[$18].loot
JMP .done
+ CMP.w #$30 : BNE +
LDA $22 : CMP.w #512 : !BGE ++
%GetPossiblyEncryptedItem(HeartPiece_Desert, HeartPieceOutdoorValues)
@@ -398,13 +291,6 @@ LoadOutdoorValue:
++
%GetPossiblyEncryptedItem(BombosItem, SpriteItemValues)
JMP .done
+ CMP.w #$32 : BNE +
LDA.w $0ED0,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$19].loot
JMP .done
++
LDA.l OWBonkPrizeTable[$1A].loot
JMP .done
+ CMP.w #$35 : BNE +
%GetPossiblyEncryptedItem(HeartPiece_Lake, HeartPieceOutdoorValues)
JMP .done
@@ -412,68 +298,17 @@ LoadOutdoorValue:
%GetPossiblyEncryptedItem(HeartPiece_Swamp, HeartPieceOutdoorValues)
JMP .done
+ CMP.w #$42 : BNE +
LDA.w $0ED0,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$1B].loot
JMP .done
++
%GetPossiblyEncryptedItem(HeartPiece_Cliffside, HeartPieceOutdoorValues)
JMP .done
%GetPossiblyEncryptedItem(HeartPiece_Cliffside, HeartPieceOutdoorValues)
JMP .done
+ CMP.w #$4A : BNE +
%GetPossiblyEncryptedItem(HeartPiece_Cliffside, HeartPieceOutdoorValues)
JMP .done
+ CMP.w #$51 : BNE +
LDA.w $0ED0,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$1C].loot
JMP .done
++
LDA.l OWBonkPrizeTable[$1D].loot
JMP .done
+ CMP.w #$54 : BNE +
LDA.w $0ED0,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$1E].loot
JMP .done
++ CMP.w #$0008 : BNE ++
LDA.l OWBonkPrizeTable[$1F].loot
JMP .done
++
LDA.l OWBonkPrizeTable[$20].loot
JMP .done
+ CMP.w #$55 : BNE +
LDA.w $0ED0,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$21].loot
JMP .done
++
LDA.l OWBonkPrizeTable[$22].loot
JMP .done
+ CMP.w #$56 : BNE +
LDA.l OWBonkPrizeTable[$23].loot
JMP .done
+ CMP.w #$5B : BNE +
LDA.w $0ED0,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$24].loot
JMP .done
++
%GetPossiblyEncryptedItem(HeartPiece_Pyramid, HeartPieceOutdoorValues)
JMP .done
+ CMP.w #$5E : BNE +
LDA.l OWBonkPrizeTable[$25].loot
%GetPossiblyEncryptedItem(HeartPiece_Pyramid, HeartPieceOutdoorValues)
JMP .done
+ CMP.w #$68 : BNE +
%GetPossiblyEncryptedItem(HeartPiece_Digging, HeartPieceOutdoorValues)
JMP .done
+ CMP.w #$6E : BNE +
LDA.w $0ED0,X : AND.w #$00FF : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$26].loot
JMP .done
++ CMP.w #$0008 : BNE ++
LDA.l OWBonkPrizeTable[$27].loot
JMP .done
++
LDA.l OWBonkPrizeTable[$28].loot
JMP .done
+ CMP.w #$74 : BNE +
LDA.l OWBonkPrizeTable[$29].loot
JMP .done
+ CMP.w #$81 : BNE +
%GetPossiblyEncryptedItem(HeartPiece_Zora, HeartPieceOutdoorValues)
JMP .done
@@ -579,268 +414,3 @@ RTL
;JSL $00D51B ; GetAnimatedSpriteTile
;JSL $00D52D ; GetAnimatedSpriteTile.variable
;================================================================================
HeartPieceGetPlayer:
{
PHY
LDA $1B : BNE +
BRL .outdoors
+
PHP
REP #$20 ; set 16-bit accumulator
LDA $A0 ; these are all decimal because i got them that way
CMP.w #135 : BNE +
LDA StandingKey_Hera_Player
BRL .done
+ CMP.w #200 : BNE +
LDA HeartContainer_ArmosKnights_Player
BRL .done
+ CMP.w #51 : BNE +
LDA HeartContainer_Lanmolas_Player
BRL .done
+ CMP.w #7 : BNE +
LDA HeartContainer_Moldorm_Player
BRL .done
+ CMP.w #90 : BNE +
LDA HeartContainer_HelmasaurKing_Player
BRL .done
+ CMP.w #6 : BNE +
LDA HeartContainer_Arrghus_Player
BRL .done
+ CMP.w #41 : BNE +
LDA HeartContainer_Mothula_Player
BRL .done
+ CMP.w #172 : BNE +
LDA HeartContainer_Blind_Player
BRL .done
+ CMP.w #222 : BNE +
LDA HeartContainer_Kholdstare_Player
BRL .done
+ CMP.w #144 : BNE +
LDA HeartContainer_Vitreous_Player
BRL .done
+ CMP.w #164 : BNE +
LDA HeartContainer_Trinexx_Player
BRL .done
+ CMP.w #225 : BNE +
LDA HeartPiece_Forest_Thieves_Player
BRL .done
+ CMP.w #226 : BNE +
LDA HeartPiece_Lumberjack_Tree_Player
BRL .done
+ CMP.w #234 : BNE +
LDA HeartPiece_Spectacle_Cave_Player
BRL .done
+ CMP.w #283 : BNE +
LDA $22 : XBA : AND.w #$0001 ; figure out where link is
BNE ++
LDA HeartPiece_Circle_Bushes_Player
BRL .done
++
LDA HeartPiece_Graveyard_Warp_Player
BRL .done
+ CMP.w #294 : BNE +
LDA HeartPiece_Mire_Warp_Player
BRL .done
+ CMP.w #295 : BNE +
LDA HeartPiece_Smith_Pegs_Player
BRL .done
LDA.w #$0000
BRL .done
.outdoors
PHP
REP #$20 ; set 16-bit accumulator
LDA $8A
CMP.w #$00 : BNE +
LDA.l OWBonkPrizeTable[$00].mw_player
BRL .done
+ CMP.w #$03 : BNE +
LDA $22 : CMP.w #1890 : !BLT ++
LDA HeartPiece_Spectacle_Player
BRL .done
++
LDA EtherItem_Player
BRL .done
+ CMP.w #$05 : BNE +
LDA.w $0ED0,X : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$01].mw_player
BRL .done
++
LDA HeartPiece_Mountain_Warp_Player
BRL .done
+ CMP.w #$0A : BNE +
LDA.w $0ED0,X : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$02].mw_player
BRL .done
++
LDA.l OWBonkPrizeTable[$03].mw_player
BRL .done
+ CMP.w #$10 : BNE +
LDA.w $0ED0,X : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$04].mw_player
BRL .done
++
LDA.l OWBonkPrizeTable[$05].mw_player
BRL .done
+ CMP.w #$11 : BNE +
LDA.l OWBonkPrizeTable[$06].mw_player
BRL .done
+ CMP.w #$12 : BNE +
LDA.l OWBonkPrizeTable[$07].mw_player
BRL .done
+ CMP.w #$13 : BNE +
LDA.w $0ED0,X : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$08].mw_player
BRL .done
++
LDA.l OWBonkPrizeTable[$09].mw_player
BRL .done
+ CMP.w #$15 : BNE +
LDA.w $0ED0,X : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$0A].mw_player
BRL .done
++
LDA.l OWBonkPrizeTable[$0B].mw_player
BRL .done
+ CMP.w #$18 : BNE +
LDA.w $0ED0,X : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$0C].mw_player
BRL .done
++
LDA.l OWBonkPrizeTable[$0D].mw_player
BRL .done
+ CMP.w #$1A : BNE +
LDA.w $0ED0,X : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$0E].mw_player
BRL .done
++
LDA.l OWBonkPrizeTable[$0F].mw_player
BRL .done
+ CMP.w #$1B : BNE +
LDA.l OWBonkPrizeTable[$11].mw_player
BRL .done
+ CMP.w #$1D : BNE +
LDA.l OWBonkPrizeTable[$12].mw_player
BRL .done
+ CMP.w #$1E : BNE +
LDA.l OWBonkPrizeTable[$13].mw_player
BRL .done
+ CMP.w #$28 : BNE +
LDA HeartPiece_Maze_Player
BRL .done
+ CMP.w #$2A : BNE +
LDA.w $0ED0,X : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$14].mw_player
BRL .done
++ CMP.w #$0008 : BNE ++
LDA.l OWBonkPrizeTable[$15].mw_player
BRL .done
++
LDA HauntedGroveItem_Player
BRL .done
+ CMP.w #$2B : BNE +
LDA.l OWBonkPrizeTable[$16].mw_player
BRL .done
+ CMP.w #$2E : BNE +
LDA.w $0ED0,X : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$17].mw_player
BRL .done
++
LDA.l OWBonkPrizeTable[$18].mw_player
BRL .done
+ CMP.w #$30 : BNE +
LDA $22 : CMP.w #512 : !BGE ++
LDA HeartPiece_Desert_Player
BRL .done
++
LDA BombosItem_Player
BRL .done
+ CMP.w #$32 : BNE +
LDA.w $0ED0,X : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$19].mw_player
BRL .done
++
LDA.l OWBonkPrizeTable[$1A].mw_player
BRL .done
+ CMP.w #$35 : BNE +
LDA HeartPiece_Lake_Player
BRL .done
+ CMP.w #$3B : BNE +
LDA HeartPiece_Swamp_Player
BRL .done
+ CMP.w #$42 : BNE +
LDA.w $0ED0,X : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$1B].mw_player
BRL .done
++
LDA HeartPiece_Cliffside_Player
BRL .done
+ CMP.w #$4A : BNE +
LDA HeartPiece_Cliffside_Player
BRL .done
+ CMP.w #$51 : BNE +
LDA.w $0ED0,X : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$1C].mw_player
BRL .done
++
LDA.l OWBonkPrizeTable[$1D].mw_player
BRL .done
+ CMP.w #$54 : BNE +
LDA.w $0ED0,X : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$1E].mw_player
BRL .done
++ CMP.w #$0008 : BNE ++
LDA.l OWBonkPrizeTable[$1F].mw_player
BRL .done
++
LDA.l OWBonkPrizeTable[$20].mw_player
BRL .done
+ CMP.w #$55 : BNE +
LDA.w $0ED0,X : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$21].mw_player
BRL .done
++
LDA.l OWBonkPrizeTable[$22].mw_player
BRL .done
+ CMP.w #$56 : BNE +
LDA.l OWBonkPrizeTable[$23].mw_player
BRL .done
+ CMP.w #$5B : BNE +
LDA.w $0ED0,X : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$24].mw_player
BRL .done
++
LDA HeartPiece_Pyramid_Player
BRL .done
+ CMP.w #$5E : BNE +
LDA.l OWBonkPrizeTable[$25].mw_player
BRL .done
+ CMP.w #$68 : BNE +
LDA HeartPiece_Digging_Player
BRL .done
+ CMP.w #$6E : BNE +
LDA.w $0ED0,X : CMP.w #$0010 : BNE ++
LDA.l OWBonkPrizeTable[$26].mw_player
BRL .done
++ CMP.w #$0008 : BNE ++
LDA.l OWBonkPrizeTable[$27].mw_player
BRL .done
++
LDA.l OWBonkPrizeTable[$28].mw_player
BRL .done
+ CMP.w #$74 : BNE +
LDA.l OWBonkPrizeTable[$29].mw_player
BRL .done
+ CMP.w #$81 : BNE +
LDA HeartPiece_Zora_Player
BRL .done
+
LDA.w #$0000
.done
AND.w #$00FF ; the loads are words but the values are 1-byte so we need to clear the top half of the accumulator - no guarantee it was 8-bit before
PLP
PLY
RTL
}

486
hooks.asm
View File

@@ -1,10 +1,3 @@
org $078102 ; no idea where that is, ask zarby
JSL GetMultiworldItem
org $01EC07 ; Dungeon_OpenKeyedObject .nextChest : LDA Dungeon_ChestData+2, X
JSL.l Multiworld_OpenKeyedObject
;================================================================================
; Init Hook
;--------------------------------------------------------------------------------
@@ -188,9 +181,6 @@ db Password_Tilemap>>16
org $0CD527 ; <- 65527 : Bank0C.asm : 2913 (LDA.w #$0004 : STA $02) [LDA.w #$0006 : STA $02]
JSL.l DrawPlayerFile : NOP ; hijack hearts draw routine to draw a full inventory
; Random incredible patch that I should add right now - File Select Fairy
org $1BF029+1 : db $10
org $0ccdd5 ; Bank0C.asm:1881 (LDX.w #$00FD)
JSL.l AltBufferTable : NOP #8 ; Selection screen
org $0cd393 ; Bank0c.asm:2674 (LDX.w #$00FD)
@@ -450,12 +440,8 @@ org $02EC8D ; <- bank02.asm : 11981 (LDA.w #$020F : LDX $8A : CPX.w #$0033 : BNE
JSL HardcodedRocks
NOP #19 ;23 bytes removed with the JSL
;--------------------------------------------------------------------------------
;org $04E7AE ; <- bank0E.asm : 4230 (LDA $7EF287 : AND.w #$0020)
;JSL.l TurtleRockPegSolved
;--------------------------------------------------------------------------------
org $1BCAA1 ; <- bank_1B.asm (LDA.w #$0212 : LDX.w #$0720 : STA.l $7E2000,X : JSL : JSL)
JSL.l Overworld_InvertedTRPuzzle
BRA + : NOP #12 : +
org $04E7AE ; <- bank0E.asm : 4230 (LDA $7EF287 : AND.w #$0020)
JSL.l TurtleRockPegSolved
org $04E7B9 ; <- bank0E.asm : 4237 (LDX $04C8)
JMP.w TurtleRockTrollPegs
@@ -472,9 +458,9 @@ PegProbability:
db $00 ; Probability out of 255. 0 = Vanilla behavior
TurtleRockTrollPegs:
SEP #$20
LDX.w $04C8 : CPX.w #$FFFF : BEQ .vanilla
JSL.l GetRandomInt
LDA.l PegProbability : BEQ .vanilla : CMP.l $7E0FA1
LDX.w $04C8 : CPX.w #$FFFF : BEQ .vanilla
JSL.l GetRandomInt
LDA.l PegProbability : BEQ .vanilla : CMP.l $7E0FA1
REP #$20 : !BGE .succeed
.fail
JMP.w TurtleRockPegFail
@@ -843,10 +829,10 @@ JSL.l ConditionalWhitenBg
org $02FEE6 ; <- 17EE6 - Bank0E.asm : 3907 (RTS)
RTL ; the whiten color routine is only JSL-ed to
;--------------------------------------------------------------------------------
org $07FA7B ; <- 3FA7B - Bank0E.asm : 4735 (REP #$20 : LDX.b #$02)
org $07FA7B ; <- 3FA7B - Bank0E.asm : 4735 (REP #$20 : LDX.b #$02)
JML DDMConditionalLightning
;--------------------------------------------------------------------------------
org $07FACB ; <- 3FACB - Bank0E.asm : 4773 (REP #$20 : LDA #$F531, Y)
org $07FACB ; <- 3FACB - Bank0E.asm : 4773 (REP #$20 : LDA #$F531, Y)
JSL.l ConditionalGTFlash : BRA + : NOP #11 : +
;--------------------------------------------------------------------------------
org $0AFF48 ; <- 57F48 - Bank0A.asm : 4935 (REP #$20 : LDA $7EC3DA)
@@ -858,7 +844,7 @@ JSL.l ConditionalPedAncilla : BRA + : NOP #4 : +
org $079976 ; <- 039976 - Bank07.asm : 4009 (JSL Palette_ElectroThemedGear)
JSL.l LoadElectroPalette
;--------------------------------------------------------------------------------
org $07997C ; <- 03997C - Bank07.asm : 4015 (JSL LoadActualGearPalettes)
org $07997C ; <- 03997C - Bank07.asm : 4015 (JSL LoadActualGearPalettes)
JSL.l RestoreElectroPalette
;--------------------------------------------------------------------------------
@@ -984,10 +970,6 @@ NOP
org $0799F7 ; 399F7 - Bank07.asm:4107 (JSL AddReceivedItem)
JSL.l AddReceivedItemExpanded
org $098605 ; 48605 - ancilla_init.asm:709 (TYA : STA $02E4 : PHX)
JML.l Multiworld_AddReceivedItem_notCrystal
NOP
org $098611 ; 48611 - ancilla_init.asm:720 (LDA .item_target_addr+0, X)
LDA.w AddReceivedItemExpanded_item_target_addr+0, X
org $098616 ; 48616 - ancilla_init.asm:721 (LDA .item_target_addr+1, X)
@@ -1037,11 +1019,6 @@ NOP
org $07B57D ; 3B57D - Bank07.asm:8527 (LDA Link_ReceiveItemAlternates, Y : STA $03)
JSL.l Link_ReceiveItemAlternatesExpanded_loadAlternate
NOP
org $08C563
JML ItemGetAlternateSFX : NOP
org $0988A5
JSL ItemGetOverworldAlternateSFX : NOP #5
;--------------------------------------------------------------------------------
org $09892E ; 4892E - ancilla_init.asm:1307 (LDA BottleList, X)
LDA.w BottleListExpanded, X
@@ -1293,9 +1270,6 @@ org $08D395 ; <- 45395 - ancilla_bird_travel_intro.asm : 253
JSL.l UpgradeFlute
NOP #2
;--------------------------------------------------------------------------------
org $07A408 ; LDA.l $7EF34C
JSL.l FluteCallForDuck
;--------------------------------------------------------------------------------
org $05E4D7 ; <- 2E4D7 - sprite_witch.asm : 213
JSL.l RemoveMushroom
NOP #2
@@ -1303,9 +1277,10 @@ NOP #2
org $05F55F ; <- 2F55F - sprite_potion_shop.asm : 59
JSL.l LoadPowder
;--------------------------------------------------------------------------------
org $05F67B ; <- 2F67B - sprite_potion_shop.asm : 234
JSL DrawPowder
org $05F681 ; <- 2F681 - sprite_potion_shop.asm : 234
JSL.l DrawPowder
RTS
NOP #8
;--------------------------------------------------------------------------------
org $05F65D ; <- 2F65D - sprite_potion_shop.asm : 198
JSL.l CollectPowder
@@ -1321,34 +1296,6 @@ JSL.l DrawMushroom
org $05EE97 ; <- 2EE97 - sprite_mushroom.asm : 81
NOP #14
;--------------------------------------------------------------------------------
org $06C09C ; <- - bank06.asm : 1885 (JSL SpritePrep_PotionShopLong)
JSL SpritePrep_ShopKeeper_PotionShop
org $05F521
SpritePrep_PotionShopLong:
org $05F539
SpawnMagicPowder:
;--------------------------------------------------------------------------------
org $05F568 ; <- 2F568 - sprite_potion_shop.asm
LDA #$b0 : STA $0D00, Y : LDA #$90 : STA $0D10, Y ; manually set position of powder item
LDA #$21 : STA $0D20, Y : LDA #$12 : STA $0D30, Y
JMP $F61D
;--------------------------------------------------------------------------------
org $05F633 ; <- 2F633 - sprite_potion_shop.asm
JSL Sprite_ShopKeeperPotion : RTS : NOP ;; TODO: i don't remember prices being set on top of the player
PotionShopkeeperJumpTable:
org $05F893 ; <- witch behavior here
Sprite_WitchAssistant:
org $05F644 ; <- powder behavior here
Sprite_MagicPowderItem:
;--------------------------------------------------------------------------------
org $05EB1D ; <- 2EB1D - sprite_bottle_vendor.asm : 158
JSL.l Multiworld_BottleVendor_GiveBottle
;--------------------------------------------------------------------------------
org $07A36F ; <- 3A36F - Bank07.asm : 5679
NOP #5
org $07A379 ; <- 3A379 - Bank07.asm : 5687
@@ -1784,17 +1731,6 @@ org $029A35 ; <- 11A35 : Bank02.asm:4789 - (JSL HUD.RebuildIndoor.palace)
JSL.l HUDRebuildIndoorHole
;--------------------------------------------------------------------------------
;================================================================================
; Skull Woods back entrance fire fix
;--------------------------------------------------------------------------------
org $099C42 ; ancilla_init.asm:4264 - (LDA $8A : AND.b #$40 : BEQ AddDoorDebris.spawn_failed)
JML.l Multiworld_ConsumingFire_TransmuteToSkullWoodsFire
NOP #2
ConsumingFire_TransmuteToSkullWoodsFire_continue:
org $099C39
AddDoorDebris_spawn_failed:
;================================================================================
; Pendant / Crystal Fixes
;--------------------------------------------------------------------------------
@@ -1855,13 +1791,13 @@ LDA CrystalPendantFlags_2, X
;NOP #10
;CLC
;================================================================================
;org $0AC5BB ; < 545BB - Bank0A.asm:1856 - (LDA $7EF3C7 : CMP.b #$03 : BNE .fail)
;JSL.l OverworldMap_CheckObject : RTS
;org $0AC5D8 ; < 545D8 - Bank0A.asm:1885 - (LDA $7EF3C7 : CMP.b #$07 : BNE OverworldMap_CheckPendant_fail)
;JSL.l OverworldMap_CheckObject : RTS
org $0AC5BB ; < 545BB - Bank0A.asm:1856 - (LDA $7EF3C7 : CMP.b #$03 : BNE .fail)
JSL.l OverworldMap_CheckObject : RTS
org $0AC5D8 ; < 545D8 - Bank0A.asm:1885 - (LDA $7EF3C7 : CMP.b #$07 : BNE OverworldMap_CheckPendant_fail)
JSL.l OverworldMap_CheckObject : RTS
;================================================================================
org $0AC53e ; <- 5453E - Bank0A.asm:1771 - (LDA $0AC50D, X : STA $0D)
LDA.l CrystalNumberTable-1, X
JSL.l GetCrystalNumber
;================================================================================
; EVERY INSTANCE OF STA $7EF3C7 IN THE ENTIRE CODEBASE
org $029D51 ; <- 11D51
@@ -1897,35 +1833,34 @@ JSL.l GetMapMode
org $0AC01A ; <- 5401A
JSL.l GetMapMode
;Overwritten
;org $0AC037 ; <- 54037
;JSL.l GetMapMode
;org $0AC079 ; <- 54079
;JSL.l GetMapMode
;org $0AC0B8 ; <- 540B8 x
;JSL.l GetMapMode
;org $0AC0F8 ; <- 540F8
;JSL.l GetMapMode
;org $0AC137 ; <- 54137
;JSL.l GetMapMode
;org $0AC179 ; <- 54179
;JSL.l GetMapMode
;org $0AC1B3 ; <- 541B3
;JSL.l GetMapMode
;org $0AC1F5 ; <- 541F5
;JSL.l GetMapMode
;org $0AC22F ; <- 5422F
;JSL.l GetMapMode
;org $0AC271 ; <- 54271
;JSL.l GetMapMode
;org $0AC2AB ; <- 542AB
;JSL.l GetMapMode
;org $0AC2ED ; <- 542ED
;JSL.l GetMapMode
;org $0AC327 ; <- 54327
;JSL.l GetMapMode
;org $0AC369 ; <- 54369
;JSL.l GetMapMode
org $0AC037 ; <- 54037
JSL.l GetMapMode
org $0AC079 ; <- 54079
JSL.l GetMapMode
org $0AC0B8 ; <- 540B8 x
JSL.l GetMapMode
org $0AC0F8 ; <- 540F8
JSL.l GetMapMode
org $0AC137 ; <- 54137
JSL.l GetMapMode
org $0AC179 ; <- 54179
JSL.l GetMapMode
org $0AC1B3 ; <- 541B3
JSL.l GetMapMode
org $0AC1F5 ; <- 541F5
JSL.l GetMapMode
org $0AC22F ; <- 5422F
JSL.l GetMapMode
org $0AC271 ; <- 54271
JSL.l GetMapMode
org $0AC2AB ; <- 542AB
JSL.l GetMapMode
org $0AC2ED ; <- 542ED
JSL.l GetMapMode
org $0AC327 ; <- 54327
JSL.l GetMapMode
org $0AC369 ; <- 54369
JSL.l GetMapMode
org $0DC849 ; <- 6C849
JSL.l GetMapMode
@@ -1935,11 +1870,15 @@ NOP #8
;org $0AC012 ; <- 54012 - Bank0A.asm:1039 - (LDA $7EF2DB)
;JSL.l OnLoadMap
;================================================================================
org $028B8F ; <- 10B8F - Bank02.asm:2236 (LDA $7EF374 : LSR A)
JSL CheckHeraBossDefeated : NOP
org $028B8F ; <- 10B8F - Bank02.asm:2236 (LDA $7EF374 : LSR A : BCS BRANCH_BETA)
JSL CheckHeraBossDefeated : BNE + : NOP
LDX.b #$F1 : STX $012C
+
;================================================================================
org $029090 ; <- 11090 - Bank02.asm:3099 (LDA $7EF374 : LSR A)
JSL CheckHeraBossDefeated : NOP
org $029090 ; <- 11090 - Bank02.asm:3099 (LDA $7EF374 : LSR A : BCS BRANCH_GAMMA)
JSL CheckHeraBossDefeated : BNE + : NOP
STX $012C ; DON'T MOVE THIS FORWARD OR MADNESS AWAITS
+
;================================================================================
org $029798 ; <- 11798 - Bank02.asm:4287 (CMP $02895C, X : BNE BRANCH_ALPHA)
NOP #6 ; remove crystal room cutscene check that causes softlocks
@@ -2128,18 +2067,8 @@ JSL FixAgahnimFollowers
org $028823 ; <- 10823 - Bank02.asm:1560 (LDA $7EF3C5 : BEQ .ignoreInput)
JSL.l AllowSQ
;--------------------------------------------------------------------------------
org $08C45F ; <- 4445F - ancilla_recieve_item.asm:157 (STZ $02E9 : LDA $0C5E, X)
Ancilla_ReceiveItem_optimus:
JML.l PostItemAnimation : NOP #2
org $08C548 ; <- 44548 - ancilla_recieve_item.asm:297 (CMP.b #$28 : BNE .dontGiveRupees)
JML.l Multiworld_Ancilla_ReceiveItem_stillInMotion
Ancilla_ReceiveItem_stillInMotion_moveon:
org $08C560 ; <- 44548 - ancilla_recieve_item.asm:307
Ancilla_ReceiveItem_dontGiveRupees:
org $08C45F ; <- 4445F - ancilla_recieve_item.asm:157 (STZ $02E9)
JSL.l PostItemAnimation : NOP #2
;--------------------------------------------------------------------------------
org $1EE90A ; <- F690A
JSL.l ItemCheck_OldMan
@@ -2267,12 +2196,8 @@ JSL.l MarkThrownItem
org $05FAFF ; <- 2FAFF - sprite_mad_batter.asm:57 (LDA $7EF37B : CMP.b #$01 : BCS .magic_already_doubled)
JSL.l ItemCheck_MagicBat : BEQ + : RTS : NOP : +
;================================================================================
org $06BD6C ; <- 33D6C - sprite_middle_aged_man.asm:143 (JSL Link_ReceiveItem)
JSL.l Multiworld_MiddleAgedMan_ReactToSecretKeepingResponse
org $06BE81 ; <- 33E81 - sprite_hobo.asm:150 (JSL Link_ReceiveItem)
JSL.l Multiworld_Hobo_GrantBottle
org $0589B4 ; <- 289B4 ; sprite_master_sword.asm:183 (JSL Link_ReceiveItem)
JSL.l Multiworld_MasterSword_GrantToPlayer
;================================================================================
; Boss Hearts
;--------------------------------------------------------------------------------
@@ -2306,12 +2231,6 @@ AddReceivedItem_doneWithSoundEffects:
org $05F030 ; <- 2F030 - display item
JSL.l DrawHeartPieceGFX
;--------------------------------------------------------------------------------
; moving LinkBusy check to later time to avoid a delay in HP movement
org $05F037 ; (JSL CheckIfLinkIsBusy : BCS .exit)
BRA + : NOP #4 : +
org $05F083
JSL.l HeartPieceSpawnDelayFix
;--------------------------------------------------------------------------------
org $05F08A ; <- 2F08A - sprite_heart_upgrades.asm : 324 - (LDA $7EF36B : INC A : AND.b #$03 : STA $7EF36B : BNE .got_4_piecese) item determination
JSL.l HeartPieceGet
BCS $18 ; reinsert the near branch that appears midway through what we overrode
@@ -2350,20 +2269,18 @@ JSL.l OnLinkDamagedFromPit
org $01FFE7 ; <- FFE7 - Bank01.asm:16375 (LDA $7EF36D)
JSL.l OnLinkDamagedFromPitOutdoors
;--------------------------------------------------------------------------------
;org $078F27 ; <- 38F27
;JSL.l FlipperReset
org $078F27 ; <- 38F27
JSL.l FlipperReset
;--------------------------------------------------------------------------------
org $02B468
dw FakeFlipperProtection
dw FakeFlipperProtection
org $02FFC7
FakeFlipperProtection:
JSR.w $029485
JSL protectff
RTS
;--------------------------------------------------------------------------------
org $02B46C ; <- bank_02.asm:9722 (STZ.b $00 : STZ.b $02)
JSL FlipperScrollWarp
;--------------------------------------------------------------------------------
;org $09F40B ; <- 4F40B - module_death.asm:222 (LDX.b #$00)
;JSL.l IgnoreFairyCheck
@@ -2397,18 +2314,17 @@ org $02EC2E ;<- 016C2E
JSL.l Overworld_LoadNewTiles
NOP #$02
;================================================================================
; org $07A3E2 ;<- 3A3E2 Bank07.asm:5764 (LDA.b #$80 : STA $03F0)
; JSL.l FreeDuckCheck : BEQ +
; NOP
; skip 3 ; a JSR we need to keep
; +
org $07A3E2 ;<- 3A3E2 Bank07.asm:5764 (LDA.b #$80 : STA $03F0)
JSL.l FreeDuckCheck : BEQ +
NOP
skip 3 ; a JSR we need to keep
+
;================================================================================
org $07A9AC ; <- 3A9AC - Bank07.asm:6628 (LDA $0C : ORA $0E : STA $00 : AND.b #$0C : BEQ BRANCH_BETA)
JML MirrorBonk
JML.l MirrorBonk
MirrorBonk_NormalReturn:
org $07A9D1 ; <- 3A9D1 - Bank07.asm:6649 (BRANCH_GAMMA:)
MirrorBonk_BranchGamma:
JML OWMirrorSpriteBonk
;================================================================================
;================================================================================
@@ -2449,9 +2365,6 @@ NOP #6 ; remove check
org $068841 ; <- 30841 - sprite_prep.asm:269 (LDA $0D00, X : ADD.b #$03 : STA $0D00, X)
JSL.l Mantle_CorrectPosition : NOP #2
;--------------------------------------------------------------------------------
org $0297FD ; <- bank02 : Module07_19_MirrorFade (STZ.b $11 : STZ.b $14)
JSL MirrorScrollSpawnZelda
;--------------------------------------------------------------------------------
org $0DFA53 ; <- 6FA53 - hud check for lantern
JSL.l LampCheck
;--------------------------------------------------------------------------------
@@ -2531,48 +2444,44 @@ dl Overworld_FinishMirrorWarp
;--------------------------------------------------------------------------------
org $0AB949 ; <- Bank0A.asm:270 (Different from US ROM)
JSL BirdTravel_LoadTargetAreaMusic
BRA + : NOP #14 : +
;--------------------------------------------------------------------------------
org $02B027 ; <- Bank02.asm:7535-7541
JSL Overworld_DetermineMusic
BRA + : NOP #42 : +
NOP #16
;================================================================================
;================================================================================
; Hooks for roomloading.asm
;--------------------------------------------------------------------------------
org $02895D ; <- Bank02.asm:1812 (JSL Dungeon_LoadRoom)
JSL LoadRoomHook
JSL LoadRoomHook
;--------------------------------------------------------------------------------
org $028BE7 ; <- Bank02.asm:2299 (JSL Dungeon_LoadRoom)
JSL LoadRoomHook_noStats
JSL LoadRoomHook_noStats
;--------------------------------------------------------------------------------
org $029309 ; <- Bank02.asm:3533 (JSL Dungeon_LoadRoom)
JSL LoadRoomHook_noStats
JSL LoadRoomHook_noStats
;--------------------------------------------------------------------------------
org $02C2F3 ; <- Bank02.asm:10391 (JSL Dungeon_LoadRoom)
JSL LoadRoomHook_noStats
JSL LoadRoomHook_noStats
;================================================================================
;================================================================================
; Hooks into the "Reloading all graphics" routine
;--------------------------------------------------------------------------------
org $00E64D ; <- Bank00.asm:5656 (STZ $00 : STX $01 : STA $02)
JML BgGraphicsLoading
BgGraphicsLoadingCancel:
RTS : NOP
BgGraphicsLoadingResume:
JML BgGraphicsLoading
BgGraphicsLoadingCancel:
RTS : NOP
BgGraphicsLoadingResume:
;================================================================================
;================================================================================
; Hook when updating the floor tileset in dungeons (such as between floors)
;--------------------------------------------------------------------------------
org $00DF62 ; <- Bank00.asm:4672 (LDX.w #$0000 : LDY.w #$0040)
JML ReloadingFloors
NOP : NOP
ReloadingFloorsResume:
JML ReloadingFloors
NOP : NOP
ReloadingFloorsResume:
org $00DF6E ; <- A few instructions later, right after JSR Do3To.high16Bit
ReloadingFloorsCancel:
ReloadingFloorsCancel:
;================================================================================
;================================================================================
@@ -2601,14 +2510,7 @@ JSL.l QuickSwap
org $0689AB ; <- 309AB - sprite_prep.asm: 647 (LDA $7EF3CC : CMP.b #$06 : BEQ .killSprite)
; Note: In JP 1.0 we have: (CMP.b #$00 : BNE .killSprite) appling US bugfix
; Prevent followers from causing blind/maiden to despawn:
; Door rando: let zelda despawn the maiden.
JSL BlindZeldaDespawnFix
org $0689AF
SpritePrep_BlindMaiden_despawn_follower: ; this is the normal execution path
org $0689C9
SpritePrep_BlindMaiden_kill_the_girl: ; not the follower
CMP.b #$06 : db #$F0 ; BEQ
;--------------------------------------------------------------------------------
; Fix old man purple chest issues using the same method as above
org $1EE906 ; <- F6906 - sprite_old_mountain_man.asm : 31 (LDA $7EF3CC : CMP.b #$00 : BNE .already_have_tagalong)
@@ -2692,8 +2594,8 @@ JSL NewElderCode
;--------------------------------------------------------------------------------
; Add him to Castle Map post-rain, and post aga1
;--------------------------------------------------------------------------------
org $09D0A9
db #$18, #$0A, #$D8, #$18, #$0F, #$43, #$FF;remove heart from tree adjancent map [LW1]
org $09D0AC
db #$18, #$0F, #$43, #$FF;remove heart from tree adjancent map [LW1]
db #$12, #$19, #$16 ;add sahasrala in castle Y, X, Sprite ID
org $09C937
db #$B0, #$D0 ;change [LW1] map 01C pointers
@@ -2776,9 +2678,11 @@ org $07839E ; bunny BAGE check
BunnyRead:
JSR.w $07B5A9 ; check A button
BCC .noA
JSL BunnyThrowPot
BRA .noA
NOP #3
JSR.w CheckIfReading
BNE .noread
JSR.w $07B4DB
NOP
.noread
.noA
org $07FFF4
@@ -2856,13 +2760,12 @@ org $0AEEF2
org $008BE5 ; hijack stripes for boss GFX transfer
JSL DoDungeonMapBossIcon
;================================================================================
; Terrorpin AI fix
;--------------------------------------------------------------------------------
org $1EB2B1 ; sprite_terrorpin.asm(57) : AND.b #$03 : STA $0DE0, X ; 5 bytes
JSL FixTerrorpin ; 4 bytes
NOP ; 1 byte
;--------------------------------------------------------------------------------
;================================================================================
org $01C4B8 : JSL FixJingleGlitch
org $01C536 : JSL FixJingleGlitch
org $01C592 : JSL FixJingleGlitch
org $01C65F : JSL FixJingleGlitch
;================================================================================
; Bomb-Only Mode
@@ -2943,9 +2846,6 @@ db $B2, $28, $B3, $28, $C2, $28, $C2, $68
org $079CE6 ; Bank07.asm@4632 (LDA #$80 : TSB $3A)
JSL CheckDetonateBomb
;--------------------------------------------------------------------------------
org $079D08 ; bank_07.asm@6068 (INC $3C : LDA $3C : CMP #$09)
JSL NoSwingHammerB : NOP #2
;--------------------------------------------------------------------------------
org $1EDCF8 ; bank_1E.asm@16086 (LDX $0202 : ...)
JSL SetBeeType
BRA + : NOP #15 : +
@@ -2962,11 +2862,6 @@ NOP #48
skip 11
.bee_valid_target
;--------------------------------------------------------------------------------
org $07F88C ; free rom from F877 - F88F; the starting part of this is used in quadrant glitch fix below, however.
Link_UseHammerLong:
JSR Link_UseHammer : RTL
warnpc $07F890
;--------------------------------------------------------------------------------
;================================================================================
; Variable Ganon Vulnerability
@@ -2993,183 +2888,36 @@ NOP
;--------------------------------------------------------------------------------
org $06ED70 ; Bank06.asm@4842 (LDA $06ED39, X : STA $0CF2)
JSL StoreSwordDamage
;================================================================================
; Fix quadrant glitch
org $07A879
JSR SwordSpinQuadrantFix
org $07F877 ; free rom
SwordSpinQuadrantFix:
LDA.l AllowAccidentalMajorGlitch
BEQ ++
JMP.w $07E8D9 ; HandleIndoorCameraAndDoors
++ RTS
warnpc $07F88C ; hammer-on-B hook uses the end of this free rom section
;================================================================================
org $01C4B8 : JSL FixJingleGlitch
org $01C536 : JSL FixJingleGlitch
org $01C592 : JSL FixJingleGlitch
org $01C65F : JSL FixJingleGlitch
;================================================================================
; Hooks for when submenu opens
;--------------------------------------------------------------------------------
org $028818
JSL OnMenuLoad
org $02A463
JSL OnMenuLoad
;--------------------------------------------------------------------------------
; Text Renderer
;--------------------------------------------------------------------------------
if !FEATURE_NEW_TEXT
org $0EF51B
JML RenderCharExtended
org $0EF520
RenderCharExtended_returnOriginal:
org $0EF567
RenderCharExtended_returnUncompressed:
org $0EF51B
JML RenderCharExtended
org $0EF520
RenderCharExtended_returnOriginal:
org $0EF567
RenderCharExtended_returnUncompressed:
org $0EF356
JSL RenderCharLookupWidth
org $0EF3BA
JSL RenderCharLookupWidth
org $0EF48E
JML RenderCharLookupWidthDraw
org $0EF499
RenderCharLookupWidthDraw_return:
org $0EF356
JSL RenderCharLookupWidth
org $0EF3BA
JSL RenderCharLookupWidth
org $0EF48E
JML RenderCharLookupWidthDraw
org $0EF499
RenderCharLookupWidthDraw_return:
org $0EF6AA
JML RenderCharToMapExtended
org $0EF6C2
RenderCharToMapExtended_return:
org $0EF6AA
JML RenderCharToMapExtended
org $0EF6C2
RenderCharToMapExtended_return:
org $0EFA50
JSL RenderCharSetColorExtended
org $0EEE5D
JSL RenderCharSetColorExtended_init
org $0EF285
JSL RenderCharSetColorExtended_close : NOP
org $0EFA50
JSL RenderCharSetColorExtended
org $0EEE5D
JSL RenderCharSetColorExtended_init
org $0EF285
JSL RenderCharSetColorExtended_close : NOP
endif
;--------------------------------------------------------------------------------
; Back of tavern fixes
;--------------------------------------------------------------------------------
org $028177 ; JSL Underworld_LoadCustomTileAttributes
JSL TurnAroundOnUnderworld
org $02ABC1 ; JSL Link_HandleMovingAnimation_FullLongEntry
JSL TurnUpOnOverworld
org $02E297 ; LDA.w #$0002 : STA.b $2F
JSL WalkUpOnOverworld
NOP
org $02D7D2 ; BEQ .face_up
NOP #2 ; this fixes Link's direction after mirroring and falling after entering through back of tavern
;--------------------------------------------------------------------------------
; Various nonsense
;--------------------------------------------------------------------------------
org $0780B9 ; LDA.b #$3A : STA.w $031F
JSL CalcIFrames
NOP
org $09814E ; LDA.w Bomb_timer : STA.w $039F, X
JSL SetBombTimer
NOP #2
org $07B282 ; LDA.b #$1D : STA.w $0374
JSL SetDashTimer
NOP
org $07A3E7 ; LDA.b #$13 : JSR PlaySFX_Set2 : ...
JSL ProcessFlute
BCS +
RTS
NOP #14 : +
org $08E073 ; LDA.b #$0E : STA.b $10
JSL FluteMap
org $07A329
JSL UseShovel
BCS +
RTS
NOP #4 : +
org $079D11
JSL SwordSwingDelay : NOP
org $079DAB
JSL SwordSwingDelay : NOP
org $079DEE
JSL SwordSwingDelay : NOP
org $088E4A
JSL MaybeRecoil
BRA + : NOP #6 : +
org $06EC4D
JSL MaybeRecoil2
BRA + : NOP #10 : +
; make moldorm check head for hitbox instead of tail
org $1DDADD
; BRA + : NOP #22 : +
BRA + : NOP #26 : +
org $1DDAF9
BRA + : NOP : +
org $1DDB01
BRA + : NOP #3 : +
; make moldorm repel sword when not stunned
org $06F354
JSL CheckMoldormRepel
BCC .not_moldorm
NOP
skip 17
.not_moldorm
; make mini moldorms faster
org $0697DF
db $30, $2C, $22, $12, $00, $EE, $DE, $D4
db $D0, $D4, $DE, $EE, $00, $12, $22, $2C
db $00, $12, $22, $2C, $30, $2C, $22, $12
db $00, $EE, $DE, $D4, $D0, $D4, $DE, $EE
; make lanmolas faster
org $05A4B7
LDA.b #$18
; ganon - silvers just don't work like they used to
org $0DB93D
db $08
; ganon - randomize vulnerability when stunned
org $1D9010
JSL StunGanon : NOP
; agahnim - pattern? we don't need no steenken pattern!
org $1ED637
JSL AgaDecision : NOP
; agahnim - no guaranteed normal balls
org $1ED6ED
NOP #2
; helmie's mask is brittle
org $1E8112
db $03, $03, $03, $03, $00
; vitreous - bombs work a bit better
org $0DB938
db $0C
; tile rooms - make them a bit faster
org $09BA20
LDA.b #$B8
org $1EBC56
LDA.b #$28

View File

@@ -146,7 +146,7 @@ RTL
OpenBottleMenu:
LDA $F6 : AND #$40 : BEQ .x_not_pressed ; skip if X is not down
LDA.b #$10 : STA $0207 ; set 16 frame cool off
LDA.b #$20 : STA $012F ; make menu sound
LDA.b #$20 : STA $012F ; make menu sound
LDA.b #$07 : STA $0200 ; thing we wrote over - opens bottle menu
.x_not_pressed
RTL
@@ -159,10 +159,10 @@ CloseBottleMenu:
LDA $F6 : AND #$40 : BEQ .x_not_pressed ; skip if X is not down
LDA.b #$10 : STA $0207 ; set 16 frame cool off
LDA.b #$20 : STA $012F ; make menu sound
LDA.b #$20 : STA $012F ; make menu sound
INC $0200 ; return to normal menu
STZ $0205
STZ $0205
LDA #$00
RTL
@@ -196,11 +196,6 @@ FullInventoryExternal:
;--------------------------------------------------------------------------------
AddInventory:
PHA : PHX : PHP
LDA !MULTIWORLD_ITEM_PLAYER_ID : BEQ +
BRL .incrementCounts
+
CPY.b #$0C : BNE + ; Blue Boomerang
LDA InventoryTracking : ORA #$80 : STA InventoryTracking
JMP .incrementCounts
@@ -248,19 +243,12 @@ AddInventory:
.incrementCounts
LDA StatsLocked : BEQ + : JMP .done : +
LDA !MULTIWORLD_ITEM_PLAYER_ID : BEQ +
BRL .dungeonCounts
+
; don't count any of this stuff
CPY.b #$20 : BNE + : JMP .itemCounts : + ; Crystal
CPY.b #$26 : BNE + : JMP .itemCounts : + ; Heart Piece Completion Heart
LDA.l !SHOP_ENABLE_COUNT : BNE ++
CPY.b #$2E : BNE + : JMP .itemCounts : + ; Red Potion (Refill)
CPY.b #$2F : BNE + : JMP .itemCounts : + ; Green Potion (Refill)
CPY.b #$30 : BNE + : JMP .itemCounts : + ; Blue Potion (Refill)
++
CPY.b #$2E : BNE + : JMP .itemCounts : + ; Red Potion (Refill)
CPY.b #$2F : BNE + : JMP .itemCounts : + ; Green Potion (Refill)
CPY.b #$30 : BNE + : JMP .itemCounts : + ; Blue Potion (Refill)
CPY.b #$37 : BNE + : JMP .itemCounts : + ; Pendant
CPY.b #$38 : BNE + : JMP .itemCounts : + ; Pendant
CPY.b #$39 : BNE + : JMP .itemCounts : + ; Pendant
@@ -275,7 +263,7 @@ AddInventory:
+
CPY.b #$3B : BNE + : JMP .dungeonCounts : + ; Silver Arrow Bow - Skip Shop/Fairy Check for Silver Arrow Bow
LDA $1B : BNE + : JMP .dungeonCounts : + ; skip shop check if outdoors
LDA $1B : BEQ ++ ; skip shop check if outdoors
LDA $02E9 : CMP.b #$01 : BEQ ++ ; skip shop check for chests
PHP : REP #$20 ; set 16-bit accumulator
LDA $048E
@@ -283,41 +271,35 @@ AddInventory:
CMP.w #271 : BNE + : JMP .shop : + ; villiage of outcasts shop, lumberjack shop, lake hylia shop, dark world magic shop
CMP.w #272 : BNE + : JMP .shop : + ; red shield shop
CMP.w #284 : BNE + : JMP .shop : + ; bomb shop
CMP.w #265 : BNE + : JMP .shop : + ; potion shop - commented this out because it's easier to just block potion refills because this one interferes with the powder item being counted
CMP.w #287 : BNE + : LDA.b $A9 : CMP.w #$0201 : BNE + ; kakariko shop
JMP .shop : + LDA.b $A0
CMP.w #255 : BNE + : LDA.b $A9 : BNE + ; light world death mountain shop
JMP .shop : + LDA.b $A0
CMP.w #276 : BNE + : LDA.b $A9 : CMP.w #$0200 : BNE + ; waterfall fairy
JMP .shop : + LDA.b $A0
;CMP.w #265 : BNE + : JMP .shop : + ; potion shop - commented this out because it's easier to just block potion refills because this one interferes with the powder item being counted
;CMP.w #271 : BNE + : JMP .shop : + ; lake hylia shop
CMP.w #287 : BNE + : JMP .shop : + ; kakariko shop
CMP.w #255 : BNE + : JMP .shop : + ; light world death mountain shop
CMP.w #276 : BNE + : JMP .shop : + ; waterfall fairy
CMP.w #277 : BNE + : JMP .shop : + ; upgrade fairy (shop)
CMP.w #278 : BNE + : JMP .shop : + ; pyramid fairy
PLP : BRA ++
.shop
PLP
LDA.l !SHOP_ENABLE_COUNT : BNE ++
JMP .done
PLP : JMP .done
++
.dungeonCounts
LDA !MULTIWORLD_RECEIVING_ITEM : CMP #$01 : BNE +
JMP .fullItemCounts
+
LDA $1B : BNE + : JMP .fullItemCounts : +
SEP #$20 ; Set 8-bit Accumulator
LDA $040C ; get dungeon id
BNE +
INC #2 ; treat sewers as HC
+ CMP #$FF : BEQ .fullItemCounts
CMP.b #$FF : BEQ .fullItemCounts
CMP.l BallNChainDungeon : BNE +
CPY.b #$32 : BNE +
JMP .done
JMP .done
+
CMP.b #$04 : BCS +
LDA SewersLocations : INC : STA SewersLocations
LDA HCLocations : INC : STA HCLocations
BRA .fullItemCounts
+ LSR : TAX : LDA DungeonLocationsChecked, X : INC : STA DungeonLocationsChecked, X
CPX.b #$0D : BNE +
++ CPX.b #$0D : BNE +
LDA BigKeyField : AND #$04 : BNE ++
JSR .incrementGTowerPreBigKey
++
@@ -325,34 +307,24 @@ AddInventory:
; == END INDOOR-ONLY SECTION
.fullItemCounts
LDA !MULTIWORLD_RECEIVING_ITEM : CMP #$01 : BEQ ++
LDA BootsEquipment : BNE + ; Check for Boots
REP #$20
LDA PreBootsLocations : INC : STA PreBootsLocations ; Increment Pre Boots Counter
SEP #$20
+
LDA BootsEquipment : BNE + ; Check for Boots
LDA PreBootsLocations : INC : STA PreBootsLocations ; Increment Pre Boots Counter
+
LDA MirrorEquipment : BNE + ; Check for Mirror
REP #$20
LDA PreMirrorLocations : INC : STA PreMirrorLocations ; Increment Pre Mirror Counter
SEP #$20
+
LDA FluteEquipment : BNE + ; Check for Flute
REP #$20
LDA PreFluteLocations : INC : STA PreFluteLocations ; Increment Pre Flute Counter
SEP #$20
+
REP #$20
LDA TotalItemCounter : INC : STA TotalItemCounter ; Increment Item Total
SEP #$20
++
LDA MirrorEquipment : BNE + ; Check for Mirror
LDA PreMirrorLocations : INC : STA PreMirrorLocations ; Increment Pre Mirror Counter
+
LDA FluteEquipment : BNE + ; Check for Flute
LDA PreFluteLocations : INC : STA PreFluteLocations ; Increment Pre Mirror Counter
+
REP #$20
LDA TotalItemCounter : INC : STA TotalItemCounter ; Increment Item Total
SEP #$20
.itemCounts
LDA !MULTIWORLD_ITEM_PLAYER_ID : BEQ +
BRL .done
+
CPY.b #$00 : BNE + ; Fighter's Sword & Fighter's Shield
LDX #$01
JSR .incrementSword
@@ -542,9 +514,6 @@ AddInventory:
JSR .incrementMap
JMP .done
+ CPY.b #$80 : !BLT + ; Items $80 - $8F - Free Compasses
; there was a bug for all loot ID's >$7F
LDA.w AddReceivedItemExpanded_item_target_addr+$100, X : STA.b $00
LDA.w AddReceivedItemExpanded_item_target_addr+$101, X : STA.b $01
CPY.b #$90 : !BGE +
JSL MaybeFlagCompassTotalPickup
JSR .incrementCompass
@@ -813,22 +782,22 @@ RTL
; this is horrible, make it better
;--------------------------------------------------------------------------------
MakeCircleBlue:
LDA $FFC0, Y : AND.w #$EFFF : STA $FFC0, Y
LDA $FFC2, Y : AND.w #$EFFF : STA $FFC2, Y
LDA $FFC0, Y : AND.w #$EFFF : STA $FFC0, Y
LDA $FFC2, Y : AND.w #$EFFF : STA $FFC2, Y
LDA $FFFE, Y : AND.w #$EFFF : STA $FFFE, Y
LDA $0004, Y : AND.w #$EFFF : STA $0004, Y
LDA $FFFE, Y : AND.w #$EFFF : STA $FFFE, Y
LDA $0004, Y : AND.w #$EFFF : STA $0004, Y
LDA $003E, Y : AND.w #$EFFF : STA $003E, Y
LDA $0044, Y : AND.w #$EFFF : STA $0044, Y
LDA $003E, Y : AND.w #$EFFF : STA $003E, Y
LDA $0044, Y : AND.w #$EFFF : STA $0044, Y
LDA $0080, Y : AND.w #$EFFF : STA $0080, Y
LDA $0082, Y : AND.w #$EFFF : STA $0082, Y
LDA $0080, Y : AND.w #$EFFF : STA $0080, Y
LDA $0082, Y : AND.w #$EFFF : STA $0082, Y
LDA $FFBE, Y : AND.w #$EFFF : STA $FFBE, Y
LDA $FFC4, Y : AND.w #$EFFF : STA $FFC4, Y
LDA $0084, Y : AND.w #$EFFF : STA $0084, Y
LDA $007E, Y : AND.w #$EFFF : STA $007E, Y
LDA $FFBE, Y : AND.w #$EFFF : STA $FFBE, Y
LDA $FFC4, Y : AND.w #$EFFF : STA $FFC4, Y
LDA $0084, Y : AND.w #$EFFF : STA $0084, Y
LDA $007E, Y : AND.w #$EFFF : STA $007E, Y
RTS
;--------------------------------------------------------------------------------
@@ -841,22 +810,6 @@ UpgradeFlute:
RTL
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
; FluteCallForDuck:
;--------------------------------------------------------------------------------
; sets A to #$02 to ignore summoning the duck
FluteCallForDuck:
LDA.l WarningFlags : AND.b #$20 : BNE .vanilla ; glitched modes allowed flute in rain state
LDA.l ProgressIndicator : CMP.b #$02 : BCS .vanilla ; must rescue Zelda first
.noDuck
LDA.b #$02 : RTL
.vanilla
LDA.l FluteEquipment ; what we wrote over
RTL
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
; CheckKeys:
;--------------------------------------------------------------------------------
@@ -955,8 +908,8 @@ RTL
; PrepItemScreenBigKey:
;--------------------------------------------------------------------------------
PrepItemScreenBigKey:
STZ $02
STZ $03
STZ $02
STZ $03
REP #$30 ; thing we wrote over - set 16-bit accumulator
RTL
;--------------------------------------------------------------------------------
@@ -966,15 +919,9 @@ RTL
;--------------------------------------------------------------------------------
LoadPowder:
JSL.l Sprite_SpawnDynamically ; thing we wrote over
LDA.l WitchItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
%GetPossiblyEncryptedItem(WitchItem, SpriteItemValues)
STA $0DA0, Y ; Store item type
JSL.l PrepDynamicTile
STA $7F505E
LDA #$00
STA $7F505F
STA $7F5060
STA $7F5061
RTL
;--------------------------------------------------------------------------------
@@ -999,16 +946,13 @@ RTL
DrawPowder:
LDA $02DA : BNE .defer ; defer if link is buying a potion
LDA.l !REDRAW : BEQ +
LDA.l WitchItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA $0DA0, X ; Retrieve stored item type
JSL.l PrepDynamicTile
LDA #$00 : STA.l !REDRAW ; reset redraw flag
BRA .defer
+
; this fights with the shopkeep code, so had to move the powder draw there when potion shop is custom
LDA !SHOP_TYPE : CMP.b #$FF : BNE .defer
LDA $0DA0, X ; Retrieve stored item type
JSL.l DrawDynamicTile
LDA $0DA0, X ; Retrieve stored item type
JSL.l DrawDynamicTile
.defer
RTL
;--------------------------------------------------------------------------------
@@ -1028,7 +972,6 @@ LoadMushroom:
LDA $5D : CMP #$14 : BEQ .skip ; skip if we're mid-mirror
LDA #$00 : STA !REDRAW
LDA.l MushroomItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
%GetPossiblyEncryptedItem(MushroomItem, SpriteItemValues)
STA $0E80, X ; Store item type
JSL.l PrepDynamicTile
@@ -1067,13 +1010,8 @@ CollectPowder:
; if for any reason the item value is 0 reload it, just in case
%GetPossiblyEncryptedItem(WitchItem, SpriteItemValues) : TAY
+
PHA
LDA WitchItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID
LDA.b #$01 : STA.l !SHOP_ENABLE_COUNT
PLA
STZ $02E9 ; item from NPC
JSL.l Link_ReceiveItem
PHA : LDA.b #$00 : STA.l !SHOP_ENABLE_COUNT : PLA
STZ $02E9 ; item from NPC
JSL.l Link_ReceiveItem
;JSL.l FullInventoryExternal
JSL.l ItemSet_Powder
RTL
@@ -1098,14 +1036,14 @@ RTL
DrawMagicHeader:
LDA MagicConsumption : AND.w #$00FF : CMP.w #$0002 : BEQ .quarterMagic
.halfMagic
LDA.w #$28F7 : STA $7EC704
LDA.w #$2851 : STA $7EC706
LDA.w #$28FA : STA $7EC708
LDA.w #$28F7 : STA $7EC704
LDA.w #$2851 : STA $7EC706
LDA.w #$28FA : STA $7EC708
RTL
.quarterMagic
LDA.w #$28F7 : STA $7EC704
LDA.w #$2800 : STA $7EC706
LDA.w #$2801 : STA $7EC708
LDA.w #$28F7 : STA $7EC704
LDA.w #$2800 : STA $7EC706
LDA.w #$2801 : STA $7EC708
RTL
;--------------------------------------------------------------------------------
@@ -1210,30 +1148,12 @@ RTL
{
.x_speeds
db $F0
db $10
db $F0
db $10
.x_offsets
db $00
db $13
db $00
db $13
}
;--------------------------------------------------------------------------------
; A = item id being collected
ItemGetAlternateSFX:
PEA.w $C567 ; SNES to RTS to in bank 08
LDA.w $0C5E,X : CMP.b #$4A : BNE +
; collecting pre-activated flute
LDA.b #$13 : JML $088007
+ ; normal itemget sfx
LDA.b #$0F : JML $08800E ; what we wrote over
; A = item id being collected
ItemGetOverworldAlternateSFX:
CMP.b #$4A : BNE +
JSL Sound_SetSfxPanWithPlayerCoords : ORA.b #$13 : STA.w $012E
RTL
+ ; normal itemget sfx
JSL Sound_SetSfxPanWithPlayerCoords : ORA.b #$0F : STA.w $012F ; what we wrote over
RTL
;--------------------------------------------------------------------------------

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -1,113 +0,0 @@
org $328000
; You have found
; the Map of
Notice_MapOf:
db $74, $00, $C2, $00, $3E, $00, $44, $00, $FF, $00, $37, $00, $30, $00, $45, $00, $34, $00, $FF, $00, $35, $00, $3E, $00, $44, $00, $3D, $00, $33
db $75, $00, $43, $00, $37, $00, $34, $00, $FF, $00, $B6, $00, $30, $00, $3F, $00, $FF, $00, $3E, $00, $35
dw #$7F7F
; You have found
; the Compass of
Notice_CompassOf:
db $74, $00, $C2, $00, $3E, $00, $44, $00, $FF, $00, $37, $00, $30, $00, $45, $00, $34, $00, $FF, $00, $35, $00, $3E, $00, $44, $00, $3D, $00, $33
db $75, $00, $43, $00, $37, $00, $34, $00, $FF, $00, $AC, $00, $3E, $00, $3C, $00, $3F, $00, $30, $00, $42, $00, $42, $00, $FF, $00, $3E, $00, $35
dw #$7F7F
; Oh look! it's
; the Big Key of
Notice_BigKeyOf:
db $74, $00, $B8, $00, $37, $00, $FF, $00, $3B, $00, $3E, $00, $3E, $00, $3A, $00, $C7, $00, $FF, $00, $38, $00, $43, $00, $D8, $00, $42
db $75, $00, $43, $00, $37, $00, $34, $00, $FF, $00, $AB, $00, $38, $00, $36, $00, $FF, $00, $B4, $00, $34, $00, $48, $00, $FF, $00, $3E, $00, $35
dw #$7F7F
; This is a
; Small Key to
Notice_SmallKeyOf:
db $74, $00, $BD, $00, $37, $00, $38, $00, $42, $00, $FF, $00, $38, $00, $42, $00, $FF, $00, $30
db $75, $00, $BC, $00, $3C, $00, $30, $00, $3B, $00, $3B, $00, $FF, $00, $B4, $00, $34, $00, $48, $00, $FF, $00, $43, $00, $3E
dw #$7F7F
; Light World
Notice_LightWorld:
db $76, $00, $B5, $00, $38, $00, $36, $00, $37, $00, $43, $00, $FF, $00, $C0, $00, $3E, $00, $41, $00, $3B, $00, $33
dw #$7F7F
; Dark World
Notice_DarkWorld:
db $76, $00, $AD, $00, $30, $00, $41, $00, $3A, $00, $FF, $00, $C0, $00, $3E, $00, $41, $00, $3B, $00, $33
dw #$7F7F
; Ganons Tower
Notice_GTower:
db $76, $00, $B0, $00, $30, $00, $3D, $00, $3E, $00, $3D, $00, $42, $00, $FF, $00, $BD, $00, $3E, $00, $46, $00, $34, $00, $41
dw #$7F7F
; Turtle Rock
Notice_TRock:
db $76, $00, $BD, $00, $44, $00, $41, $00, $43, $00, $3B, $00, $34, $00, $FF, $00, $BB, $00, $3E, $00, $32, $00, $3A
dw #$7F7F
; Thieves Town
Notice_Thieves:
db $76, $00, $BD, $00, $37, $00, $38, $00, $34, $00, $45, $00, $34, $00, $42, $00, $FF, $00, $BD, $00, $3E, $00, $46, $00, $3D
dw #$7F7F
; Tower of Hera
Notice_Hera:
db $76, $00, $BD, $00, $3E, $00, $46, $00, $34, $00, $41, $00, $FF, $00, $3E, $00, $35, $00, $FF, $00, $B1, $00, $34, $00, $41, $00, $30
dw #$7F7F
; Ice Palace
Notice_Ice:
db $76, $00, $B2, $00, $32, $00, $34, $00, $FF, $00, $B9, $00, $30, $00, $3B, $00, $30, $00, $32, $00, $34
dw #$7F7F
; Skull Woods
Notice_Skull:
db $76, $00, $BC, $00, $3A, $00, $44, $00, $3B, $00, $3B, $00, $FF, $00, $C0, $00, $3E, $00, $3E, $00, $33, $00, $42
dw #$7F7F
; Misery Mire
Notice_Mire:
db $76, $00, $B6, $00, $38, $00, $42, $00, $34, $00, $41, $00, $48, $00, $FF, $00, $B6, $00, $38, $00, $41, $00, $34
dw #$7F7F
; Dark Palace
Notice_PoD:
db $76, $00, $AD, $00, $30, $00, $41, $00, $3A, $00, $FF, $00, $B9, $00, $30, $00, $3B, $00, $30, $00, $32, $00, $34
dw #$7F7F
; Swamp Palace
Notice_Swamp:
db $76, $00, $BC, $00, $46, $00, $30, $00, $3C, $00, $3F, $00, $FF, $00, $B9, $00, $30, $00, $3B, $00, $30, $00, $32, $00, $34
dw #$7F7F
; Castle Tower
Notice_AgaTower:
db $76, $00, $AC, $00, $30, $00, $42, $00, $43, $00, $3B, $00, $34, $00, $FF, $00, $BD, $00, $3E, $00, $46, $00, $34, $00, $41
dw #$7F7F
; Desert Palace
Notice_Desert:
db $76, $00, $AD, $00, $34, $00, $42, $00, $34, $00, $41, $00, $43, $00, $FF, $00, $B9, $00, $30, $00, $3B, $00, $30, $00, $32, $00, $34
dw #$7F7F
; Eastern Palace
Notice_Eastern:
db $76, $00, $AE, $00, $30, $00, $42, $00, $43, $00, $34, $00, $41, $00, $3D, $00, $FF, $00, $B9, $00, $30, $00, $3B, $00, $30, $00, $32, $00, $34
dw #$7F7F
; Hyrule Castle
Notice_Castle:
db $76, $00, $B1, $00, $48, $00, $41, $00, $44, $00, $3B, $00, $34, $00, $FF, $00, $AC, $00, $30, $00, $42, $00, $43, $00, $3B, $00, $34
dw #$7F7F
; Hyrule Castle
Notice_Sewers:
db $76, $00, $B1, $00, $48, $00, $41, $00, $44, $00, $3B, $00, $34, $00, $FF, $00, $AC, $00, $30, $00, $42, $00, $43, $00, $3B, $00, $34
dw #$7F7F
; this dungeon
Notice_Self:
db $76, $00, $43, $00, $37, $00, $38, $00, $42, $00, $FF, $00, $33, $00, $44, $00, $3D, $00, $36, $00, $34, $00, $3E, $00, $3D
dw #$7F7F

View File

@@ -1,180 +0,0 @@
; where we shove the decompressed graphics to send to WRAM
DynamicDropGFX = $7EF500
; this will just count from 0 to 4 to determine which slot we're using
; we're expecting 5 items max per room, and order is irrelevant
; we just need to keep track of where they go
DynamicDropGFXIndex = $7E1E70
; this will keep track of the above for each item
SprItemGFX = $7E0780
; this is the item requested and a flag
DynamicDropRequest = $7E1E71
DynamicDropQueue = $7E1E72
; Come in with
; A = item receipt ID
; X = slot
RequestStandingItemVRAMSlot:
STA.w DynamicDropQueue
LDA.b #$01
STA.w DynamicDropRequest
LDA.w DynamicDropGFXIndex
INC
CMP.b #$05 : BCC .fine
LDA.b #$00
.fine
STA.w DynamicDropGFXIndex
STA.w SprItemGFX,X
; decompress graphics
PHX
LDX.w DynamicDropQueue
REP #$20
LDA.w #DynamicDropGFX-$7E9000
STA.l !TILE_UPLOAD_OFFSET_OVERRIDE
SEP #$20
LDA.w DynamicDropQueue
JSL.l GetSpriteID
JSL.l GetAnimatedSpriteTile_variable
SEP #$30
PLX
RTL
;===================================================================================================
TransferPotGFX:
SEP #$10
REP #$20
LDX.w DynamicDropRequest
BEQ .no
STZ.w DynamicDropRequest
LDA.w DynamicDropGFXIndex
ASL
TAX
LDA.l FreeUWGraphics,X
STA.w $2116
; calculate bottom row now
CLC : ADC.w #$0200>>1 : PHA
LDX.b #$7E : STX.w $4314
LDA.w #DynamicDropGFX : STA.w $4302
LDX.b #$80 : STX.w $2115
LDA.w #$1801 : STA.w $4300
LDA.w #$0040 : STA.w $4305
LDY.b #$01
STY.w $420B
STA.w $4305
PLA
STA.w $2116
STY.w $420B
.no
RTL
FreeUWGraphics:
dw $8800>>1
dw $8840>>1
dw $8980>>1
dw $9CA0>>1
dw $9DC0>>1
; dw $8800>>1
; dw $8840>>1
; dw $8980>>1
; dw $9960>>1 # Arghuss Splash apparently
; dw $9C00>>1
; dw $9CA0>>1
; dw $9DC0>>1
;===================================================================================================
DrawPotItem:
JSL.l IsNarrowSprite : BCS .narrow
.full
LDA.b #$01 : STA $06
LDA #$0C : JSL.l OAM_AllocateFromRegionC
LDA #$02 : PHA
REP #$20
LDA.w #DynamicOAMTile_full
BRA .draw
.narrow
LDA.b #$02 : STA $06
LDA #$10 : JSL.l OAM_AllocateFromRegionC
LDA #$03 : PHA
REP #$20
LDA.w #DynamicOAMTile_thin
.draw
PHB : PHK : PLB
STA.b $08
LDA.w SprItemGFX,X
AND.w #$00FF
ASL : ASL : ASL : ASL
ADC.b $08
STA.b $08
SEP #$20
STZ.b $07
LDA.b #$00 : STA.l !SKIP_EOR
JSL Sprite_DrawMultiple_quantity_preset
LDA.b $90 : CLC : ADC.b #$08 : STA.b $90
INC.b $92
INC.b $92
PLB
PLA
RTL
DynamicOAMTile_thin:
dw 0, 0 : db $40, $00, $20, $00
dw 0, 8 : db $50, $00, $20, $00
dw 0, 0 : db $42, $00, $20, $00
dw 0, 8 : db $52, $00, $20, $00
dw 0, 0 : db $4C, $00, $20, $00
dw 0, 8 : db $5C, $00, $20, $00
dw 0, 0 : db $E5, $00, $20, $00
dw 0, 8 : db $F5, $00, $20, $00
dw 0, 0 : db $EE, $00, $20, $00
dw 0, 8 : db $FE, $00, $20, $00
DynamicOAMTile_full:
dw -4, -1 : db $40, $00, $20, $02
dd 0, 0
dw -4, -1 : db $42, $00, $20, $02
dd 0, 0
dw -4, -1 : db $4C, $00, $20, $02
dd 0, 0
dw -4, -1 : db $E5, $00, $20, $02
dd 0, 0
dw -4, -1 : db $EE, $00, $20, $02
dd 0, 0

View File

@@ -1,656 +0,0 @@
; hooks
org $81E6B0
JSL RevealPotItem
RTS
org $829C25
JSL SetTheSceneFix
org $89C2BB
JSL ClearSpriteData
org $89C327
JSL LoadSpriteData
org $86F976
JSL RevealSpriteDrop : NOP
org $86E3C4
JSL RevealSpriteDrop2 : NOP
org $86926e ; <- 3126e - sprite_prep.asm : 2664 (LDA $0B9B : STA $0CBA, X)
JSL SpriteKeyPrep : NOP #2
org $86d049 ; <- 35049 sprite_absorbable : 31-32 (JSL Sprite_DrawRippleIfInWater : JSR Sprite_DrawAbsorbable)
JSL SpriteKeyDrawGFX : BRA + : NOP : +
org $86d03d
JSL ShouldSpawnItem : NOP #2
org $86D19F
JSL MarkSRAMForItem : NOP #2
org $86d180
JSL BigKeyGet : BCS $07 : NOP #5
org $86d18d ; <- 3518D - sprite_absorbable.asm : 274 (LDA $7EF36F : INC A : STA $7EF36F)
JSL KeyGet
org $86f9f3 ; bank06.asm : 6732 (JSL Sprite_LoadProperties)
JSL LoadProperties_PreserveCertainProps
org $808BAA ; NMI hook
JSL TransferPotGFX
org $86828A
JSL CheckSprite_Spawn
org $87B169
JSL PreventPotSpawn : NOP
org $87B17D
JSL PreventPotSpawn2
org $868275
JSL SubstitionFlow
org $80A9DC
dw $1928, $1938, $5928, $5938 ; change weird ugly black diagonal pot to blue-ish pot
org $818650
dw $B395 ; change tile type to normal pot
org $81B3D5
JSL CheckIfPotIsSpecial
; refs to other functions
org $8681F4
Sprite_SpawnSecret_pool_ID:
org $868283
Sprite_SpawnSecret_NotRandomBush:
org $86828A
Sprite_SpawnSecret_SpriteSpawnDynamically:
org $86d23a
Sprite_DrawAbsorbable:
org $9eff81
Sprite_DrawRippleIfInWater:
org $8db818
Sprite_LoadProperties:
org $86D038
KeyRoomFlagMasks:
org $80FDEE
InitializeMirrorHDMA:
org $80E3C4
LoadCommonSprites_long:
; defines
; Ram usage
SpawnedItemID = $7E0720 ; 0x02
SpawnedItemIndex = $7E0722 ; 0x02
SpawnedItemIsMultiWorld = $7E0724 ; 0x02
SpawnedItemFlag = $7E0726 ; 0x02 - one for pot, 2 for sprite drop
; (flag used as a bitmask in conjunction with StandingItemCounterMask)
SpawnedItemMWPlayer = $7E0728 ; 0x02
; clear all of them in a loop during room load
SprDropsItem = $7E0730 ; 0x16
SprItemReceipt = $7E0740 ; 0x16
SprItemIndex = $7E0750
SprItemMWPlayer = $7E0760 ; 0x16
SprItemFlags = $7E0770 ; 0x16 (used for both pots and drops) (combine with SprDropsItem?)
; todo: move sprites
;org $09D62E
;UWSpritesPointers ; 0x250 bytes for 0x128 rooms' 16-bit pointers
;org $09D87E
;UWPotsPointers ; 0x250 bytes for 0x128 rooms' 16-bit pointers
;org $09DACE
;UWPotsData ; variable number of bytes (max 0x11D1) for all pots data
;org $A88000
;UWSpritesData ; variable number of bytes (max 0x2800) for all sprites and sprite drop data
; First $2800 bytes of this bank (28) is reserved for the sprite tables
;org $09C297
;LDA.w UWSpritesPointers,Y
;org $01E6BF ; not sure this code is reachable anymore
;LDA.l UWPotsPointers,X
;STA.b $00
;LDA.w #UWPotsPointers>>16
; $2800 bytes reserved for sprites
; temporary pot table until sprites get moved:
org $A88000
UWPotsPointers: ; 0x250 bytes for 0x128 rooms' 16-bit pointers
org $A88250
UWPotsData:
org $A8A800
;tables:
PotMultiWorldTable:
; Reserved $250 296 * 2
org $A8AA50
StandingItemsOn: ; 142A50
db 0
MultiClientFlagsROM: ; 142A51-2 -> stored in SRAM at 7ef33d (for now)
dw 0
SwampDrain1HasItem: ; 142A53
db 1
SwampDrain2HasItem: ; 142A54
db 1
StandingItemCounterMask: ; 142A55
db 0 ; if 0x01 is set then pot should be counted, if 0x02 then sprite drops, 0x03 (both bits for both)
PotCountMode: ; 28AA56-7
; 0 is don't count pots
; 1 for check PotCollectionRateTable
dw 0
org $A8AA60
PotCollectionRateTable:
; Reserved $250 296 * 2
org $A8ACB0
RevealPotItem:
STA.b $04 ; save tilemap coordinates
STZ.w SpawnedItemFlag
STZ.w SpawnedItemMWPlayer
LDA.w $0B9C : AND.w #$FF00 : STA.w $0B9C
LDA.b $A0 : ASL : TAX
LDA.l UWPotsPointers,X : STA.b $00 ; we may move this
LDA.w #UWPotsPointers>>16 : STA.b $02
LDY.w #$FFFD : LDX.w #$FFFF
.next_pot
INY : INY : INY
LDA.b [$00],Y
CMP.w #$FFFF : BEQ .exit
INX
STA.w $08 ; remember the exact value
AND.w #$3FFF
CMP.b $04 : BNE .next_pot ; not the correct value
STZ.w SpawnedItemIsMultiWorld
BIT.b $08
BVS LoadMultiWorldPotItem
BMI LoadMajorPotItem
.normal_secret
STA $08
PHX : PHY
; set bit and count if first time lifting this pot
TXA : ASL : TAX : LDA.l BitFieldMasks, X : STA $0A
LDA.b $A0 : ASL : TAX
JSR ShouldCountNormalPot : BCC .obtained
LDA.l RoomPotData, X : BIT $0A : BNE .obtained
ORA $0A : STA RoomPotData, X
; increment dungeon counts
SEP #$30
LDA $040C : CMP #$FF : BEQ +
BNE ++
INC #2 ; treat sewers as HC
++ LSR : TAX : LDA DungeonLocationsChecked, X : INC : STA DungeonLocationsChecked, X
; Could increment GT Tower Pre Big Key but we aren't showing that stat right now
+ REP #$30
LDA TotalItemCounter : INC : STA TotalItemCounter ; Increment Item Total
.obtained
PLY : PLX
PLA ; remove the JSL return lower 16 bits
LDA $08
PEA.w $01E6E2-1 ; change return address to go back to the vanilla routine
.exit
RTL
LoadMultiWorldPotItem:
INY : INY
LDA.b [$00],Y : AND.w #$00FF
INC.w SpawnedItemIsMultiWorld
PHX
ASL : TAX
LDA.l PotMultiWorldTable+1,X : AND.w #$00FF : STA.w SpawnedItemMWPlayer
LDA.l PotMultiWorldTable+0,X : AND.w #$00FF
PLX
BRA SaveMajorItemDrop
MultiItemExit:
LDA.w #$0008 : STA.w $0B9C
RTL
LoadMajorPotItem:
INY : INY
LDA.b [$00],Y : AND.w #$00FF
SaveMajorItemDrop:
; A currently holds the item receipt ID
; X currently holds the pot item index
STA.w SpawnedItemID
STX.w SpawnedItemIndex
INC.w SpawnedItemFlag
TAY
LDA.l SpawnedItemIsMultiWorld : BNE MultiItemExit
LDA.w #$0008
CPY.w #$0036 : BNE + ; Red Rupee
LDA.w #$0016 : BRA .substitute
+ CPY.w #$0044 : BNE + ; 10 pack arrows
LDA.w #$0017 : BRA .substitute
+ CPY.w #$0028 : BNE + ; 3 pack bombs
LDA.w #$0018 : BRA .substitute
+ CPY.w #$0031 : BNE + ; 10 pack bombs
LDA.w #$0019 : BRA .substitute
+ STA $0B9C ; indicates we should use the key routines or a substitute
RTL
.substitute
PHA
TXA : ASL : STA.b $00
LDA.w #$001F : SBC $00
TAX : LDA.l BitFieldMasks, X : STA $00
LDA.b $A0 : ASL : TAX
LDA.l $7EF580, X
AND.b $00
BNE .exit
LDA.l $7EF580, X : ORA $00 : STA.l $7EF580, X
PLA : STA $0B9C
RTL
.exit
PLA : STZ.w $0B9C
RTL
ShouldCountNormalPot:
INY : INY : LDA [$00], Y : AND #$00FF : CMP #$0080 : BCS .clear
LDA.l PotCountMode : BEQ .clear
LDA.l PotCollectionRateTable, X : BIT $0A : BEQ .clear ; don't count if clear
.set
SEC
RTS
.clear
CLC
RTS
IncrementCountsForSubstitute:
PHX : REP #$30
LDA.w SpawnedItemIndex : ASL : TAX : LDA.l BitFieldMasks, X : STA $0A
LDA.b $A0 : ASL : TAX
LDA.l RoomPotData, X : BIT $0A : BNE .obtained
ORA $0A : STA RoomPotData, X
SEP #$30
LDA $040C : CMP #$FF : BEQ +
BNE ++
INC #2 ; treat sewers as HC
++ LSR : TAX : LDA DungeonLocationsChecked, X : INC : STA DungeonLocationsChecked, X
; Could increment GT Tower Pre Big Key but we aren't showing that stat right now
+ REP #$30
LDA TotalItemCounter : INC : STA TotalItemCounter ; Increment Item Total
.obtained
SEP #$30 : PLX
RTS
ClearSpriteData:
STZ.b $02 : STZ.b $03 ; what we overrode
PHX
LDA #$00 : LDX #$00
.loop
STA SprDropsItem, X : STA SprItemReceipt, X : STA SprItemIndex, X
STA SprItemMWPlayer, X : STA SprItemFlags, X
INX : CPX #$10 : BCC .loop
PLX
RTL
; Runs during sprite load of the room
LoadSpriteData:
INY : INY
LDA.b ($00), Y
CMP #$F3 : BCC .normal
PHA
DEC.b $02 ; standing items shouldn't consume a sprite slot
LDX.b $02
CMP #$F9 : BNE .not_multiworld
DEY : LDA.b ($00), Y : STA.l SprItemMWPlayer, X
LDA.b #$02 : STA.l SprDropsItem, X : BRA .common
.not_multiworld
LDA.b #$00 : STA.l SprItemMWPlayer, X
LDA.b #$01 : STA.l SprDropsItem, X
DEY
.common
DEY : LDA.b ($00), Y : STA.l SprItemReceipt, X
INY : INY
PLA
PLA : PLA ; remove the JSL return lower 16 bits
PEA.w $09C344-1 ; change return address to exit from Underworld_LoadSingleSprite
RTL
.normal
RTL
; Run when a sprite dies ... Sets Flag to #$02 and Index to sprite slot for
RevealSpriteDrop:
LDA.l SprDropsItem, X : BEQ .normal
LDA #$02 : STA.l SpawnedItemFlag
STX.w SpawnedItemIndex
LDA.l SprItemReceipt, X : STA SpawnedItemID
LDA.l SprItemMWPlayer, X : STA SpawnedItemMWPlayer
LDY.b #$01 ; trigger the small key routines
LDA SpawnedItemID : CMP #$32 : BNE +
LDA.l StandingItemsOn : BNE +
INY ; big key routine
+ RTL ; unstun if stunned
.normal
LDY.w $0CBA, X : BEQ .no_forced_drop
RTL
.no_forced_drop
PLA : PLA ; remove the JSL reswamturn lower 16 bits
PEA.w $06F996-1 ; change return address to .no_forced_drop of (Sprite_DoTheDeath)
RTL
RevealSpriteDrop2:
LDY.w SprDropsItem, X : BEQ .normal
BRA .no_forced_drop
.normal
LDY.w $0CBA, X : BEQ .no_forced_drop
RTL
.no_forced_drop
PLA : PLA ; remove the JSL reswamturn lower 16 bits
PEA.w $06E3CE-1 ; change return address to .no_forced_drop of (Sprite_DoTheDeath)
RTL
BitFieldMasks:
dw $8000, $4000, $2000, $1000, $0800, $0400, $0200, $0100
dw $0080, $0040, $0020, $0010, $0008, $0004, $0002, $0001
; Runs during Sprite_E4_SmallKey and duning Sprite_E5_BigKey spawns
ShouldSpawnItem:
LDA $048E : CMP.b #$87 : BNE + ; check for hera basement cage
LDA $A8 : AND.b #$03 : CMP.b #$02 : BNE + ; we're not in that quadrant
LDA.w $0403 : AND.w KeyRoomFlagMasks,Y : RTL
+
; checking our sram table
PHX : PHY
REP #$30
LDA.b $A0 : ASL : TAY
LDA.w SprItemIndex, X : AND #$00FF : ASL
PHX
TAX : LDA.l BitFieldMasks, X : STA $00
PLX ; restore X again
LDA.w SprItemFlags, X : AND #$00FF : CMP #$0001 : BEQ +
TYX : LDA.l SpritePotData, X : BIT $00 : BEQ .notObtained
BRA .obtained
+ TYX : LDA.l RoomPotData, X : BIT $00 : BEQ .notObtained
.obtained
SEP #$30 : PLY : PLX : LDA #$01 : RTL ; already obtained
.notObtained
SEP #$30 : PLY : PLX
LDA #$00
RTL
MarkSRAMForItem:
LDA $048E : CMP.b #$87 : BNE + ; check for hera basement cage
LDA $A8 : AND.b #$03 : CMP.b #$02 : BNE +
LDA.w $0403 : ORA.w KeyRoomFlagMasks, Y : RTL
+ PHX : PHY : REP #$30
LDA.b $A0 : ASL : TAY
LDA.l SpawnedItemIndex : ASL
TAX : LDA.l BitFieldMasks, X : STA $00
TYX
LDA.w SpawnedItemFlag : CMP #$0001 : BEQ +
LDA SpritePotData, X : ORA $00 : STA SpritePotData, X : BRA .end
+ LDA RoomPotData, X : ORA $00 : STA RoomPotData, X
.end
SEP #$30 : PLY : PLX
LDA.w $0403
RTL
SpriteKeyPrep:
LDA.w $0B9B : STA.w $0CBA, X ; what we wrote over
PHA
LDA $A0 : CMP #$87 : BNE .continue
LDA $A9 : ORA $AA : AND #$03 : CMP #$02 : BNE .continue
LDA #$00 : STA.w SpawnedItemFlag : STA SprItemFlags, X
LDA #$24 : STA $0E80, X
BRA +
.continue
LDA.w SpawnedItemIndex : STA SprItemIndex, X
LDA.w SpawnedItemMWPlayer : STA SprItemMWPlayer, X
LDA.w SpawnedItemFlag : STA SprItemFlags, X : BEQ +
LDA.l SpawnedItemID : STA $0E80, X
PHA
JSL.l GetSpritePalette : STA $0F50, X ; setup the palette
PLA
CMP #$24 : BNE ++ ;
LDA $A0 : CMP.b #$80 : BNE +
LDA SpawnedItemFlag : BNE +
LDA #$24 ; it's the big key drop?
++ JSL RequestStandingItemVRAMSlot
+ PLA
RTL
SpriteKeyDrawGFX:
JSL Sprite_DrawRippleIfInWater
PHA
LDA $0E80, X
CMP.b #$24 : BNE +
LDA $A0 : CMP #$80 : BNE ++
LDA SpawnedItemFlag : BNE ++
LDA #$24 : BRA +
++ PLA
PHK : PEA.w .jslrtsreturn-1
PEA.w $068014 ; an rtl address - 1 in Bank06
JML Sprite_DrawAbsorbable
.jslrtsreturn
RTL
+ JSL DrawPotItem
CMP #$03 : BNE +
PHA : LDA $0E60, X : ORA.b #$20 : STA $0E60, X : PLA
+ JSL.l Sprite_DrawShadowLong
PLA : RTL
KeyGet:
LDA CurrentSmallKeys ; what we wrote over
PHA
LDA.l StandingItemsOn : BNE +
PLA : RTL
+ LDY $0E80, X
LDA SprItemIndex, X : STA SpawnedItemIndex
LDA SprItemFlags, X : STA SpawnedItemFlag
LDA $A0 : CMP #$87 : BNE + ;check for hera cage
LDA SpawnedItemFlag : BNE + ; if it came from a pot, it's fine
JSR ShouldKeyBeCountedForDungeon : BCC ++
JSL CountChestKeyLong
++ PLA : RTL
+ STY $00
LDA SprItemMWPlayer, X : STA !MULTIWORLD_ITEM_PLAYER_ID : BNE .receive
PHX
LDA $040C : CMP #$FF : BNE +
LDA $00 : CMP.b #$AF : BNE .skip
LDA CurrentGenericKeys : INC : STA CurrentGenericKeys
LDA $00 : BRA .countIt
+ LSR : TAX
LDA $00 : CMP.l KeyTable, X : BNE +
.countIt
LDA.l StandingItemCounterMask : AND SpawnedItemFlag : BEQ ++
JSL.l FullInventoryExternal : JSL CountChestKeyLong
++ PLX : PLA : RTL
+ CMP.b #$AF : beq .countIt ; universal key
CMP.b #$24 : beq .countIt ; small key for this dungeon
.skip PLX
.receive
JSL $0791b3 ; Player_HaltDashAttackLong
JSL.l Link_ReceiveItem
PLA : DEC : RTL
KeyTable:
db $A0, $A0, $A2, $A3, $A4, $A5, $A6, $A7, $A8, $A9, $AA, $AB, $AC, $AD
; Input Y - the item type
ShouldKeyBeCountedForDungeon:
PHX
LDA $040C : CMP #$FF : BEQ .done
LSR : TAX
TYA : cmp KeyTable, X : BNE +
- PLX : SEC : RTS
+ CMP.B #$24 : BEQ -
.done
PLX : CLC : RTS
BigKeyGet:
LDY $0E80, X
CPY #$32 : BNE +
STZ $02E9 : LDY.b #$32 ; what we wrote over
PHX : JSL Link_ReceiveItem : PLX ; what we wrote over
CLC : RTL
+ SEC : RTL
LoadProperties_PreserveCertainProps:
LDA $0E20, X : CMP #$E4 : BEQ +
CMP #$E5 : BEQ +
JML Sprite_LoadProperties
+ LDA $0F50, X : PHA
LDA $0E80, X : PHA
JSL Sprite_LoadProperties
PLA : STA $0E80, X
PLA : STA $0F50, X
RTL
SubstitionFlow:
CPY.b #$04 : BNE +
RTL ; let enemizer/vanilla take care of it
+ PLA : PLA ; remove JSL stuff
CPY.b #$16 : BCS +
PEA.w Sprite_SpawnSecret_NotRandomBush-1 : RTL ; jump to not_random_bush spot
; jump directly to new code
+ PEA.w Sprite_SpawnSecret_SpriteSpawnDynamically-1
RTL
SubstitionTable:
db $DB ; RED RUPEE - 0x16
db $E2 ; ARROW REFILL 10 - 0x17
db $DD ; BOMB REFILL 4 - 0x18
db $DE ; BOMB REFILL 8 - 0x19
SubstituteSpriteId:
CPY.b #$16 : BCS +
RTS
+ LDA.b #$01
CPY.b #$18 : BCC +
LDA.b #$05
+ STA.b $0D
JSR IncrementCountsForSubstitute
PHB : PHK : PLB
LDA.w SubstitionTable-$16, Y ; Do substitute
PLB
RTS
CheckSprite_Spawn:
JSR SubstituteSpriteId
JSL Sprite_SpawnDynamically
BMI .check
RTL
.check
LDA $0D : CMP #$08 : BNE +
LDA $0372 : BNE .error
LDX #$0F
; loop looking for a Sprite with state 0A (carried by the player)
- LDA $0DD0, X : CMP #$0A : BEQ .foundIt
DEX : BMI .error : BRA -
.foundIt
LDA #$00 : STZ $0DD0, X
LDA #$E4 : JSL Sprite_SpawnDynamically
BMI .error
LDA #$40 : TSB $0308 : RTL
.error
LDA.b #$3C ; SFX2_3C - error beep
STA.w $012E
+ LDA #$FF
RTL
PreventPotSpawn:
LDA #$40 : BIT $0308 : BEQ +
STZ $0308 : RTL
+ LDA.b #$80 : STA.w $0308 ; what we wrote over
RTL
PreventPotSpawn2:
LDA $0308 : BEQ +
LDA.b #$01 : TSB.b $50 ; what we wrote over
+ RTL
CheckIfPotIsSpecial:
TXA ; give index to A so we can do a CMP.l
CMP.l $018550 ; see if our current index is that of object 230
BEQ .specialpot
; Normal pot, so run the vanilla code
LDA.l CurrentWorld ; check for dark world
.specialpot ; zero flag already set, so gtg
RTL
SetTheSceneFix:
STZ.b $6C
JSL InitializeMirrorHDMA
JSL LoadCommonSprites_long
RTL
incsrc dynamic_si_vram.asm
;===================================================================================================
; Pot items
;===================================================================================================
;Vanilla:
; Data starts at $01DDE7 formatted:
; dw aaaa : db i
; aaaa is a 14 bit number: ..tt tttt tttt tttt indicating the tilemap ID
; i is the secrets ID
;Drop shuffle changes:
; normal secrets stay vanilla
; major items (anything not a secret) use the bits 14 and 15 to produce different behavior
; aaaa is now a 16 bit number:
; imtt tttt tttt tttt
; t - is still tilemap id (aaaa & #$3FFF)
; i - flag indicates a major item
; m - indicates a multiworld item
; for major items (non multiworld), i indicates the item receipt ID
; for multi world items, i indicates the multiworld id
; multiworld id indexes a new table of 256 entries of 2 bytes each
; MultiWorldTable:
; db <item receipt ID>, <player ID>
;===================================================================================================
; Sprite items
;===================================================================================================
;Vanilla:
;If this value appears in the sprite table, then the sprite that preceded it is given a key drop
; db $FE, $00, $E4
;Drop shuffle changes:
; db <receipt id>, $00, $F8 ; this denotes the previous sprite is given a major item (non MW)
; db <receipt id>, <player>, $F9 ; this denotes the previous sprite is given a MW item

View File

@@ -4,17 +4,20 @@
; Output: 0 for darkness, 1 for lamp cone
;--------------------------------------------------------------------------------
LampCheck:
LDA $7F50C4 : CMP.b #$01 : BNE + : RTL : +
CMP.b #$FF : BNE + : INC : RTL : +
LDA LightConeModifier : CMP.b #$01 : BNE + : RTL : +
CMP.b #$FF : BNE + : INC : RTL : +
LDA LampEquipment : BNE .done ; skip if we already have lantern
LDA $040C : CMP.b #$FF : BEQ +
CMP.b #$04 : BCS + ; check if we're in HC
LDA CurrentWorld : BNE +
.lightWorld
LDA $040C : BNE ++ ; check if we're in sewers
LDA LampConeSewers : BRA .done
+ LDA CurrentWorld : BNE +
LDA LampConeLightWorld : BRA .done
+ LDA LampConeDarkWorld
++
LDA LampConeLightWorld : BRA .done
+
.darkWorld
LDA LampConeDarkWorld
.done
;BNE + : STZ $1D : + ; remember to turn cone off after a torch
RTL

View File

@@ -2,9 +2,7 @@
; Mantle Object Changes
;--------------------------------------------------------------------------------
Mantle_CorrectPosition:
LDA.l ProgressFlags : AND.b #$04 : BNE .spawnOpen
LDA.l StartingEntrance : CMP.b #$04 : BNE +
.spawnOpen
LDA ProgressFlags : AND.b #$04 : BEQ +
LDA.b #$0A : STA $0D10, X ; just spawn it off to the side where we know it should be
LDA.b #$03 : STA $0D30, X
LDA.b #$90 : STA $0ED0, X
@@ -12,11 +10,3 @@ Mantle_CorrectPosition:
LDA $0D00, X : !ADD.b #$03 ; thing we did originally
RTL
;--------------------------------------------------------------------------------
MirrorScrollSpawnZelda:
LDA.l MirrorEquipment : CMP.b #$01 : BNE + ;mirror scroll
LDA.l StartingEntrance : CMP.b #$02 : BEQ ++ ; zelda's cell
CMP.b #$04 : BNE +
++ INC $04AA
; what we replaced
+ STZ.b $11 : STZ.b $14
RTL

View File

@@ -40,8 +40,8 @@ TryOpenTRock:
RTL
;--------------------------------------------------------------------------------
MedallionTrigger_Bombos:
STZ $50 ; stuff we wrote over
STZ $0FC1
STZ $50 ; stuff we wrote over
STZ $0FC1
PHA
LDA.l MireRequiredMedallion : BNE +

View File

@@ -1,23 +0,0 @@
OnMenuLoad:
LDA.b #UploadMenuOnlyIcons>>0 : STA !NMI_AUX
LDA.b #UploadMenuOnlyIcons>>8 : STA !NMI_AUX+1
LDA.b #UploadMenuOnlyIcons>>16 : STA !NMI_AUX+2
LDA.b #$0E : STA.b $10 ; what we overwrote
RTL
UploadMenuOnlyIcons:
REP #$20
LDA.w #MenuOnlyIcons : STA.w $4342
LDA.w #$1801 : STA.w $4340
LDA.w #$0240 : STA.w $4345
LDA.w #$0F800>>1 : STA.w $2116
SEP #$20
LDA.b #MenuOnlyIcons>>16 : STA.w $4344
LDA.b #$80 : STA.w $2118
LDA.b #$10 : STA.w $420B
RTL
MenuOnlyIcons:
incbin "menuonly.2bpp"

Binary file not shown.

View File

@@ -1,300 +0,0 @@
; adding support for up to 13 markers
!MC_FLAG = "$7F5420"
; tables
org $8ABDF6
WorldMapIcon_posx_vanilla:
dw $0F31 ; prize1
dw $08D0 ; prize2
dw $0108
dw $0F40
dw $0082
dw $0F11
dw $01D0
dw $0100
dw $0CA0
dw $0759
dw $FF00
dw $FF00
dw $FF00
dw $FFFF ; reserved - not used
dw $FFFF
dw $FFFF
org $8ABE16
WorldMapIcon_posy_vanilla:
dw $0620 ; prize1
dw $0080 ; prize2
dw $0D70
dw $0620
dw $00B0
dw $0103
dw $0780
dw $0CA0
dw $0DA0
dw $0ED0
dw $FF00
dw $FF00
dw $FF00
dw $FFFF ; reserved - not used
dw $FFFF
dw $FFFF
org $8ABE36
WorldMapIcon_posx_located:
dw $FF00 ; prize1
dw $FF00 ; prize2
dw $FF00
dw $FF00
dw $FF00
dw $FF00
dw $FF00
dw $FF00
dw $FF00
dw $FF00
dw $FF00
dw $FF00
dw $FF00
dw $FFFF ; reserved - not used
dw $FFFF
dw $FFFF
org $8ABE56
WorldMapIcon_posy_located:
dw $FF00 ; prize1
dw $FF00 ; prize2
dw $FF00
dw $FF00
dw $FF00
dw $FF00
dw $FF00
dw $FF00
dw $FF00
dw $FF00
dw $FF00
dw $FF00
dw $FF00
dw $FFFF ; reserved - not used
dw $FFFF
dw $FFFF
org $8ABE76
WorldMapIcon_tile:
db $38, $62 ; green pendant
db $32, $60 ; red pendant
db $34, $60 ; blue pendant
db $34, $64 ; crystal
db $34, $64 ; crystal
db $34, $64 ; crystal
db $34, $64 ; crystal
db $34, $64 ; crystal
db $34, $64 ; crystal
db $34, $64 ; crystal
db $32, $66 ; skull looking thing
db $00, $00 ; red x
db $00, $00 ; red x
db $00, $00 ; unused red x's
db $00, $00
db $00, $00
org $8ABE96
CompassExists:
; dw $37FC ; todo: convert to two bytes with masks? so much extra code...
; eastern hera desert pod skull trock thieves mire ice swamp gt at escape
db $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $00, $00, $00, $00, $00
; 0 = light world, 1 = dark world
org $8ABEA6
WorldCompassMask:
db $00, $00, $00, $01, $01, $01, $01, $01, $01, $01, $01, $00, $00, $00, $00, $00
; eastern desert hera pod skull trock thieves mire ice swamp gt at escape x1 x2 x3
; refs
org $8AC59B
WorldMapIcon_AdjustCoordinate:
org $8AC3B1
WorldMap_CalculateOAMCoordinates:
org $8AC52E
WorldMap_HandleSpriteBlink:
org $8ABF70
WorldMap_RedXChars:
org $8AC02B
DrawPrizesOverride:
LDX.b #$FF
.loopStart
INX : PHX
JSR OverworldMap_CheckForPrize
BCC + : JMP .skip_draw : +
TXA : ASL A : TAX
LDA.l !MC_FLAG
AND #$01 : BNE +
LDA.l WorldMapIcon_posx_vanilla+1, X : STA.l $7EC10B
LDA.l WorldMapIcon_posx_vanilla, X : STA.l $7EC10A
LDA.l WorldMapIcon_posy_vanilla+1, X : STA.l $7EC109
LDA.l WorldMapIcon_posy_vanilla, X : STA.l $7EC108
BRA .adjustment
+ LDA.l WorldMapIcon_posx_located+1, X : STA.l $7EC10B
LDA.l WorldMapIcon_posx_located, X : STA.l $7EC10A
LDA.l WorldMapIcon_posy_located+1, X : STA.l $7EC109
LDA.l WorldMapIcon_posy_located, X : STA.l $7EC108
.adjustment
LDA.l WorldMapIcon_tile, X : CMP #$FF : BEQ .skip_draw
LDA.l WorldMapIcon_tile+1, X : BEQ .dont_adjust
CMP.b #$64 : BEQ .is_crystal
LDA.b $1A : AND.b #$10 : BNE .skip_draw
.is_crystal
JSR WorldMapIcon_AdjustCoordinate
.dont_adjust
JSR WorldMap_CalculateOAMCoordinates
BCC .skip_draw
PLX : PHX : TXA : ASL A : TAX
LDA.l WorldMapIcon_tile+1, X : BEQ .is_red_x
LDA.l !MC_FLAG : CMP.b #$01 : BEQ .is_red_x
LDA.l WorldMapIcon_tile+1, X : STA.b $0D
LDA.l WorldMapIcon_tile, X : STA.b $0C
LDA.b #$02 : BRA .continue
.is_red_x
LDA.b $1A : LSR #3 : AND.b #$03 : TAX
LDA.l WorldMap_RedXChars,X : STA.b $0D
LDA.b #$32 : STA.b $0C : LDA.b #$00
.continue
STA.b $0B
PLX : PHX
INX : JSR WorldMap_HandleSpriteBlink
.skip_draw
; end of loop
PLX : CPX #12 : BCS + : JMP .loopStart : +
PLA : STA.l $7EC10B
PLA : STA.l $7EC10A
PLA : STA.l $7EC109
PLA : STA.l $7EC108
RTS
; X - the index of the prize marker
OverworldMap_CheckForPrize:
PHX
LDA #$00 : STA.l !MC_FLAG
JSR OverworldMap_CheckForCompass
BCC +
LDA.l !MC_FLAG : ORA #$01 : STA.l !MC_FLAG
LDA CurrentWorld : AND #$40 : BNE ++ ; is the compass position on LW or DW?
LDA.l WorldCompassMask, X : BEQ + : JMP .fail
++ LDA.l WorldCompassMask, X : BNE + : JMP .fail
+ JSR OverworldMap_CheckForMap
BCC +
LDA.l !MC_FLAG : ORA #$02 : STA.l !MC_FLAG
+
LDA.l !MC_FLAG : BEQ .fail
CMP #$02 : BNE .checkIfObtained
LDA CurrentWorld : AND #$40 : BNE +
CPX #3 : BCS .fail : BRA .checkIfObtained
+ CPX #10 : BCS .fail
CPX #3 : BCC .fail
.checkIfObtained
LDA.l MC_DungeonIdsForPrize, X
BPL +++ : CLC : BRA .done : +++ ; non-prize flags
TAX : LDA.l CrystalPendantFlags_2, X : BEQ .checkPendant
AND.b #$40 : BNE .checkCrystal
LDA.l CrystalPendantFlags_2, X : AND.b #$01 : BNE .checkAga1
LDA.l CrystalPendantFlags_2, X : AND.b #$02 : BNE .checkAga2
; see if hyrule castle has been completely cleared
LDA.l CompassTotalsWRAM, X : SEC : SBC DungeonLocationsChecked, X : BEQ .fail
CLC : BRA .done
.checkPendant
LDA PendantsField : AND.l CrystalPendantFlags, X : BNE .fail
CLC : BRA .done
.checkCrystal
LDA CrystalsField : AND.l CrystalPendantFlags, X : BNE .fail
CLC : BRA .done
.checkAga1
LDA ProgressIndicator : CMP #$03 : BEQ .fail
CLC : BRA .done
.checkAga2
LDA RoomDataWRAM[$0D].high : AND #$08 : BNE .fail
CLC : BRA .done
.fail
SEC
.done
PLX
RTS
; X - which compass in question
; CLC - should not move indicator
; SEC - yep indicator can move
OverworldMap_CheckForCompass:
LDA.l CompassMode : AND #$80 : BEQ .unset ; should I check for compass logic
LDA.l CompassMode : AND #$40 : BEQ .set ; compasses/maps aren't shuffled
LDA.l CompassMode : AND #$20 : BNE +
JSR OverworldMap_CheckForMap : BCC .unset : BRA .set
+ LDA.l CompassExists, X : BEQ .set ; compass doesn't exist
PHX
LDA.l MC_SRAM_Offsets, X : TAX ; put compass offset into X
LDA CompassField, X : ORA MapOverlay, X
PLX
AND.l MC_Masks, X : BNE .set ; is the compass obtained
.unset
CLC
RTS
.set
SEC
RTS
; map - which map in question
; CLC - should not show exact prize
; SEC - yep should show exact prize
OverworldMap_CheckForMap:
LDA.l MapMode : BEQ .set ; obtaining map doesn't change anything
LDA CurrentWorld : AND #$40 : BNE + ; not really sure on this check
LDA MapField : ORA MapOverlay : AND.b #$01 : BNE .set : BRA .continue
+ LDA MapField : ORA MapOverlay : AND.b #$02 : BNE .set
.continue
PHX
LDA.l MC_SRAM_Offsets, X : TAX ; put map offset into X
LDA MapField, X : ORA MapOverlay, X
PLX
AND.l MC_Masks, X : BNE .set ; is the map obtained?
.unset
CLC
RTS
.set
SEC
RTS
; eastern desert hera pod skull trock thieves mire ice swamp gt at escape
MC_DungeonIdsForPrize:
db $02, $0A, $03, $06, $08, $0C, $0B, $07, $09, $05, $00, $04, $01
MC_SRAM_Offsets:
db $01, $00, $01, $01, $00, $00, $00, $01, $00, $01, $00, $01, $01
MC_Masks:
; EP TH DP PD SK TR TT MM
db $20, $20, $10, $02, $80, $08, $10, $01, $40, $04, $04, $08, $40
warnpc $8AC3B1 ; above code should not exceed the space of the code segment it is overwriting

36
msu.asm
View File

@@ -76,7 +76,7 @@
;
; Additional tracks
;
; 60 - Light World OW (after aga kill)
; 60 - Light World OW (after ped pull)
; 61 - Dark World OW (with all crystals)
;
;=======================================
@@ -237,7 +237,6 @@ CheckMusicLoadRequest:
LDA !REG_MUSIC_CONTROL_REQUEST
CMP.b #02 : BEQ .lightworld
CMP.b #04 : BEQ .no_change+1 ; bunny
CMP.b #09 : BEQ .darkworld
CMP.b #13 : BEQ .darkwoods
CMP.b #15 : BEQ .darkwoods
@@ -249,30 +248,25 @@ CheckMusicLoadRequest:
;.boss
LDA $040C : LSR : !ADD.b #45
BRA .check_fallback-3
.no_change
PLA : BRA .check_fallback-3
.lightworld
PHA
LDA InvertedMode : BNE +
;LDA OverworldEventDataWRAM+$80 : AND.b #$40 : BEQ + ; ped pull
LDA ProgressIndicator : CMP.b #03 : BNE .no_change ; aga1 killed
- PLA : LDA.b #60 : BRA .check_fallback-3
LDA OverworldEventDataWRAM+$80 : AND.b #$40 : BEQ +
PLA
LDA.b #60 : BRA .check_fallback-3
+
LDA CrystalsField : CMP.b #$7F : BNE .no_change
BRA -
-- : PLA : BRA .check_fallback-3
.darkworld
PHA
LDA InvertedMode : BNE +
LDA CrystalsField : CMP.b #$7F : BNE .no_change
- PLA : LDA.b #61 : BRA .check_fallback-3
+
LDA ProgressIndicator : CMP.b #03 : BNE .no_change ; aga1 killed
BRA -
LDA CrystalsField : CMP.b #$7F : BNE --
- : PLA
LDA.b #61 : BRA .check_fallback-3
.darkwoods
LDA.b #15 : PHA
LDX $8A : LDA.l OWTileWorldAssoc,X : BEQ +
PLA : BRA .darkworld
+ PLA : BRA .lightworld
PHA
LDA CrystalsField : CMP.b #$7F : BEQ -
LDA CurrentWorld : BEQ --
LDA $8A : CMP #$40 : BNE --
PLA
LDA.b #15 : BRA .check_fallback-3
.castle
LDA $040C
CMP.b #$08 : BNE .check_fallback ; Hyrule Castle 2
@@ -377,7 +371,6 @@ CheckMusicLoadRequest:
;--------------------------------------------------------------------------------
SpiralStairsPreCheck:
REP #$20 ; thing we wrote over
LDA.l DRMode : BNE .done ; exit if door rando enabled
LDA $A0
CMP.w #$000C : BNE +
LDA !REG_CURRENT_MSU_TRACK : AND.w #$00FF : CMP.w #59 : BNE .done
@@ -407,7 +400,6 @@ SpiralStairsPreCheck:
; Change music on stair transition (ToH/GT)
;--------------------------------------------------------------------------------
SpiralStairsPostCheck:
LDA.l DRMode : BNE .done ; exit if door rando enabled
LDA $A0
CMP.w #$000C : BNE +
; Ganon's tower entrance

View File

@@ -1,285 +0,0 @@
macro Print_Text(hdr, hdr_len, player_id)
PHX : PHY : PHP
REP #$30
LDX #$0000
-
CPX <hdr_len> : !BGE ++
LDA <hdr>, X
STA !MULTIWORLD_HUD_CHARACTER_DATA, X
INX #2
BRA -
++
LDY <hdr_len>
LDA <player_id>
AND #$00FF
DEC
CMP #$00FF : !BGE .textdone
ASL #5
TAX
-
CPY <hdr_len>+$20 : !BGE ++
LDA PlayerNames, X
PHX : TYX : STA !MULTIWORLD_HUD_CHARACTER_DATA, X : PLX
INX #2 : INY #2
BRA -
++
TYX
-
CPX #$0040 : !BGE ++
LDA #$007F
STA !MULTIWORLD_HUD_CHARACTER_DATA, X
INX #2
BRA -
++
SEP #$20
LDA #$01 : STA !NMI_MW+1 : STA !NMI_MW
LDA !MULTIWORLD_HUD_DELAY
STA !MULTIWORLD_HUD_TIMER
.textdone
PLP : PLY : PLX
endmacro
WriteText:
{
PHA : PHX : PHP
SEP #$10
LDX $4340 : PHX ; preserve DMA parameters
LDX $4341 : PHX ; preserve DMA parameters
LDX $4342 : PHX ; preserve DMA parameters
LDX $4343 : PHX ; preserve DMA parameters
LDX $4344 : PHX ; preserve DMA parameters
LDX $4345 : PHX ; preserve DMA parameters
LDX $4346 : PHX ; preserve DMA parameters
LDX $2115 : PHX ; preserve DMA parameters
LDX $2116 : PHX ; preserve DMA parameters
LDX $2117 : PHX ; preserve DMA parameters
LDX $2100 : PHX : LDX.b #$80 : STX $2100 ; save screen state & turn screen off
REP #$20
LDX #$80 : STX $2115
LDA #$6000+$0340 : STA $2116
LDA.w #!MULTIWORLD_HUD_CHARACTER_DATA : STA $4342
LDX.b #!MULTIWORLD_HUD_CHARACTER_DATA>>16 : STX $4344
LDA #$0040 : STA $4345
LDA #$1801 : STA $4340
LDX #$10 : STX $420B
PLX : STX $2100 ; put screen back however it was before
PLX : STX $2117 ; restore DMA parameters
PLX : STX $2116 ; restore DMA parameters
PLX : STX $2115 ; restore DMA parameters
PLX : STX $4346 ; restore DMA parameters
PLX : STX $4345 ; restore DMA parameters
PLX : STX $4344 ; restore DMA parameters
PLX : STX $4343 ; restore DMA parameters
PLX : STX $4342 ; restore DMA parameters
PLX : STX $4341 ; restore DMA parameters
PLX : STX $4340 ; restore DMA parameters
PLP : PLX : PLA
RTL
}
GetMultiworldItem:
{
PHP
LDA !MULTIWORLD_ITEM : BNE +
LDA !MULTIWORLD_HUD_TIMER : BNE +
BRL .return
+
LDA $10
CMP #$07 : BEQ +
CMP #$09 : BEQ +
CMP #$0B : BEQ +
BRL .return
+
LDA !MULTIWORLD_HUD_TIMER : BEQ .textend
DEC #$01 : STA !MULTIWORLD_HUD_TIMER
CMP #$00 : BNE .textend
; Clear text
PHP : REP #$30
LDX #$0000
-
CPX #$0040 : !BGE ++
LDA #$007F
STA !MULTIWORLD_HUD_CHARACTER_DATA, X
INX #2
BRA -
++
PLP
LDA #$01 : STA !NMI_MW+1 : STA !NMI_MW
.textend
LDA $5D
CMP #$00 : BEQ +
CMP #$04 : BEQ +
CMP #$17 : BEQ +
BRL .return
+
LDA !MULTIWORLD_ITEM : BNE +
BRL .return
+
PHA
LDA #$22
LDY #$04
JSL Ancilla_CheckForAvailableSlot : BPL +
PLA
BRL .return
+
PLA
; Check if we have a key for the dungeon we are currently in
LDX $040C
; Escape
CMP #$A0 : BNE + : CPX #$00 : BEQ ++ : CPX #$02 : BEQ ++ : BRL .keyend : ++ : BRL .thisdungeon : +
; Eastern
CMP #$A2 : BNE + : CPX #$04 : BEQ .thisdungeon : BRA .keyend : +
; Desert
CMP #$A3 : BNE + : CPX #$06 : BEQ .thisdungeon : BRA .keyend : +
; Hera
CMP #$AA : BNE + : CPX #$14 : BEQ .thisdungeon : BRA .keyend : +
; Aga
CMP #$A4 : BNE + : CPX #$08 : BEQ .thisdungeon : BRA .keyend : +
; PoD
CMP #$A6 : BNE + : CPX #$0C : BEQ .thisdungeon : BRA .keyend : +
; Swamp
CMP #$A5 : BNE + : CPX #$0A : BEQ .thisdungeon : BRA .keyend : +
; SW
CMP #$A8 : BNE + : CPX #$10 : BEQ .thisdungeon : BRA .keyend : +
; TT
CMP #$AB : BNE + : CPX #$16 : BEQ .thisdungeon : BRA .keyend : +
; Ice
CMP #$A9 : BNE + : CPX #$12 : BEQ .thisdungeon : BRA .keyend : +
; Mire
CMP #$A7 : BNE + : CPX #$0E : BEQ .thisdungeon : BRA .keyend : +
; TR
CMP #$AC : BNE + : CPX #$18 : BEQ .thisdungeon : BRA .keyend : +
; GT
CMP #$AD : BNE + : CPX #$1A : BEQ .thisdungeon : BRA .keyend : +
; GT BK
CMP #$92 : BNE .keyend : CPX #$1A : BNE .keyend : LDA #$32 : BRA .keyend
.thisdungeon
LDA #$24
.keyend
STA $02D8 ;Set Item to receive
TAY
LDA #$01 : STA !MULTIWORLD_RECEIVING_ITEM
LDA #$00 : STA !MULTIWORLD_ITEM_PLAYER_ID
STZ $02E9
JSL.l $0791B3 ; Player_HaltDashAttackLong
JSL Link_ReceiveItem
LDA #$00 : STA !MULTIWORLD_ITEM : STA !MULTIWORLD_RECEIVING_ITEM
%Print_Text(HUD_ReceivedFrom, #$001C, !MULTIWORLD_ITEM_FROM)
.return
PLP
LDA $5D : ASL A : TAX
RTL
}
Multiworld_OpenKeyedObject:
{
PHP
SEP #$20
LDA ChestData_Player+2, X : STA !MULTIWORLD_ITEM_PLAYER_ID
PLP
LDA !Dungeon_ChestData+2, X ; thing we wrote over
RTL
}
Multiworld_BottleVendor_GiveBottle:
{
PHA : PHP
SEP #$20
LDA BottleMerchant_Player : STA !MULTIWORLD_ITEM_PLAYER_ID
PLP : PLA
JSL Link_ReceiveItem ; thing we wrote over
RTL
}
Multiworld_MiddleAgedMan_ReactToSecretKeepingResponse:
{
PHA : PHP
SEP #$20
LDA PurpleChest_Item_Player : STA !MULTIWORLD_ITEM_PLAYER_ID
PLP : PLA
JSL Link_ReceiveItem ; thing we wrote over
RTL
}
Multiworld_Hobo_GrantBottle:
{
PHA : PHP
SEP #$20
LDA HoboItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID
PLP : PLA
JSL Link_ReceiveItem ; thing we wrote over
RTL
}
Multiworld_MasterSword_GrantToPlayer:
{
PHA : PHP
SEP #$20
LDA PedestalSword_Player : STA !MULTIWORLD_ITEM_PLAYER_ID
PLP : PLA
JSL Link_ReceiveItem ; thing we wrote over
RTL
}
Multiworld_AddReceivedItem_notCrystal:
{
TYA : STA $02E4 : PHX ; things we wrote over
LDA !MULTIWORLD_ITEM_PLAYER_ID : BEQ +
PHY : LDY $02D8 : JSL AddInventory : PLY
%Print_Text(HUD_SentTo, #$0010, !MULTIWORLD_ITEM_PLAYER_ID)
LDA #$33 : STA $012F
JML.l AddReceivedItem_gfxHandling
+
JML.l AddReceivedItem_notCrystal+5
}
Multiworld_Ancilla_ReceiveItem_stillInMotion:
{
CMP.b #$28 : BNE + ; thing we wrote over
LDA !MULTIWORLD_ITEM_PLAYER_ID : BNE +
JML.l Ancilla_ReceiveItem_stillInMotion_moveon
+
JML.l Ancilla_ReceiveItem_dontGiveRupees
}
Multiworld_ConsumingFire_TransmuteToSkullWoodsFire:
{
LDA $8A : AND.b #$40 : BEQ .failed ; things we wrote over
LDA $0C4A : CMP #$22 : BEQ .failed
LDA $0C4B : CMP #$22 : BEQ .failed
LDA $0C4C : CMP #$22 : BEQ .failed
LDA $0C4D : CMP #$22 : BEQ .failed
LDA $0C4E : CMP #$22 : BEQ .failed
LDA $0C4F : CMP #$22 : BEQ .failed
JML.l ConsumingFire_TransmuteToSkullWoodsFire_continue
.failed
JML.l AddDoorDebris_spawn_failed
}

View File

@@ -1,525 +0,0 @@
;org $32DFD0 ; PC 0x195FD0
;"received from " 28 bytes
HUD_ReceivedFrom:
dw $296E, $2961, $295F, $2961, $2965, $2972, $2961, $2960, $007F, $2962, $296E, $296B, $2969, $007F
;org $32DFEC ; PC 0x195FEC
;"sent to " 16 bytes
HUD_SentTo:
dw $296F, $2961, $296A, $2970, $007F, $2970, $296B, $007F
;org $32DFFC ; PC 0x195FFC
;--------------------------------------------------------------------------------
; Player names (32 bytes/player) - 255 players
;--------------------------------------------------------------------------------
PlayerNames:
; Player1
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player2
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player3
dw $296C, $2968, $295D, $2975, $2961, $296E, $297A, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player4
dw $296C, $2968, $295D, $2975, $2961, $296E, $297B, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player5
dw $296C, $2968, $295D, $2975, $2961, $296E, $297C, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player6
dw $296C, $2968, $295D, $2975, $2961, $296E, $297D, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player7
dw $296C, $2968, $295D, $2975, $2961, $296E, $297E, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player8
dw $296C, $2968, $295D, $2975, $2961, $296E, $297F, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player9
dw $296C, $2968, $295D, $2975, $2961, $296E, $294B, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player10
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2977, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player11
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2978, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player12
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2979, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player13
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297A, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player14
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297B, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player15
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297C, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player16
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297D, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player17
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297E, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player18
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297F, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player19
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $294B, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player20
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2977, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player21
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2978, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player22
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2979, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player23
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297A, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player24
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297B, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player25
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297C, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player26
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297D, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player27
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297E, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player28
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297F, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player29
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $294B, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player30
dw $296C, $2968, $295D, $2975, $2961, $296E, $297A, $2977, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player31
dw $296C, $2968, $295D, $2975, $2961, $296E, $297A, $2978, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player32
dw $296C, $2968, $295D, $2975, $2961, $296E, $297A, $2979, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player33
dw $296C, $2968, $295D, $2975, $2961, $296E, $297A, $297A, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player34
dw $296C, $2968, $295D, $2975, $2961, $296E, $297A, $297B, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player35
dw $296C, $2968, $295D, $2975, $2961, $296E, $297A, $297C, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player36
dw $296C, $2968, $295D, $2975, $2961, $296E, $297A, $297D, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player37
dw $296C, $2968, $295D, $2975, $2961, $296E, $297A, $297E, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player38
dw $296C, $2968, $295D, $2975, $2961, $296E, $297A, $297F, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player39
dw $296C, $2968, $295D, $2975, $2961, $296E, $297A, $294B, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player40
dw $296C, $2968, $295D, $2975, $2961, $296E, $297B, $2977, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player41
dw $296C, $2968, $295D, $2975, $2961, $296E, $297B, $2978, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player42
dw $296C, $2968, $295D, $2975, $2961, $296E, $297B, $2979, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player43
dw $296C, $2968, $295D, $2975, $2961, $296E, $297B, $297A, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player44
dw $296C, $2968, $295D, $2975, $2961, $296E, $297B, $297B, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player45
dw $296C, $2968, $295D, $2975, $2961, $296E, $297B, $297C, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player46
dw $296C, $2968, $295D, $2975, $2961, $296E, $297B, $297D, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player47
dw $296C, $2968, $295D, $2975, $2961, $296E, $297B, $297E, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player48
dw $296C, $2968, $295D, $2975, $2961, $296E, $297B, $297F, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player49
dw $296C, $2968, $295D, $2975, $2961, $296E, $297B, $294B, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player50
dw $296C, $2968, $295D, $2975, $2961, $296E, $297C, $2977, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player51
dw $296C, $2968, $295D, $2975, $2961, $296E, $297C, $2978, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player52
dw $296C, $2968, $295D, $2975, $2961, $296E, $297C, $2979, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player53
dw $296C, $2968, $295D, $2975, $2961, $296E, $297C, $297A, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player54
dw $296C, $2968, $295D, $2975, $2961, $296E, $297C, $297B, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player55
dw $296C, $2968, $295D, $2975, $2961, $296E, $297C, $297C, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player56
dw $296C, $2968, $295D, $2975, $2961, $296E, $297C, $297D, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player57
dw $296C, $2968, $295D, $2975, $2961, $296E, $297C, $297E, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player58
dw $296C, $2968, $295D, $2975, $2961, $296E, $297C, $297F, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player59
dw $296C, $2968, $295D, $2975, $2961, $296E, $297C, $294B, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player60
dw $296C, $2968, $295D, $2975, $2961, $296E, $297D, $2977, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player61
dw $296C, $2968, $295D, $2975, $2961, $296E, $297D, $2978, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player62
dw $296C, $2968, $295D, $2975, $2961, $296E, $297D, $2979, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player63
dw $296C, $2968, $295D, $2975, $2961, $296E, $297D, $297A, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player64
dw $296C, $2968, $295D, $2975, $2961, $296E, $297D, $297B, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player65
dw $296C, $2968, $295D, $2975, $2961, $296E, $297D, $297C, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player66
dw $296C, $2968, $295D, $2975, $2961, $296E, $297D, $297D, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player67
dw $296C, $2968, $295D, $2975, $2961, $296E, $297D, $297E, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player68
dw $296C, $2968, $295D, $2975, $2961, $296E, $297D, $297F, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player69
dw $296C, $2968, $295D, $2975, $2961, $296E, $297D, $294B, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player70
dw $296C, $2968, $295D, $2975, $2961, $296E, $297E, $2977, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player71
dw $296C, $2968, $295D, $2975, $2961, $296E, $297E, $2978, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player72
dw $296C, $2968, $295D, $2975, $2961, $296E, $297E, $2979, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player73
dw $296C, $2968, $295D, $2975, $2961, $296E, $297E, $297A, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player74
dw $296C, $2968, $295D, $2975, $2961, $296E, $297E, $297B, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player75
dw $296C, $2968, $295D, $2975, $2961, $296E, $297E, $297C, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player76
dw $296C, $2968, $295D, $2975, $2961, $296E, $297E, $297D, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player77
dw $296C, $2968, $295D, $2975, $2961, $296E, $297E, $297E, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player78
dw $296C, $2968, $295D, $2975, $2961, $296E, $297E, $297F, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player79
dw $296C, $2968, $295D, $2975, $2961, $296E, $297E, $294B, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player80
dw $296C, $2968, $295D, $2975, $2961, $296E, $297F, $2977, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player81
dw $296C, $2968, $295D, $2975, $2961, $296E, $297F, $2978, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player82
dw $296C, $2968, $295D, $2975, $2961, $296E, $297F, $2979, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player83
dw $296C, $2968, $295D, $2975, $2961, $296E, $297F, $297A, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player84
dw $296C, $2968, $295D, $2975, $2961, $296E, $297F, $297B, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player85
dw $296C, $2968, $295D, $2975, $2961, $296E, $297F, $297C, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player86
dw $296C, $2968, $295D, $2975, $2961, $296E, $297F, $297D, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player87
dw $296C, $2968, $295D, $2975, $2961, $296E, $297F, $297E, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player88
dw $296C, $2968, $295D, $2975, $2961, $296E, $297F, $297F, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player89
dw $296C, $2968, $295D, $2975, $2961, $296E, $297F, $294B, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player90
dw $296C, $2968, $295D, $2975, $2961, $296E, $294B, $2977, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player91
dw $296C, $2968, $295D, $2975, $2961, $296E, $294B, $2978, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player92
dw $296C, $2968, $295D, $2975, $2961, $296E, $294B, $2979, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player93
dw $296C, $2968, $295D, $2975, $2961, $296E, $294B, $297A, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player94
dw $296C, $2968, $295D, $2975, $2961, $296E, $294B, $297B, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player95
dw $296C, $2968, $295D, $2975, $2961, $296E, $294B, $297C, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player96
dw $296C, $2968, $295D, $2975, $2961, $296E, $294B, $297D, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player97
dw $296C, $2968, $295D, $2975, $2961, $296E, $294B, $297E, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player98
dw $296C, $2968, $295D, $2975, $2961, $296E, $294B, $297F, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player99
dw $296C, $2968, $295D, $2975, $2961, $296E, $294B, $294B, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player100
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2977, $2977, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player101
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2977, $2978, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player102
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2977, $2979, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player103
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2977, $297A, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player104
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2977, $297B, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player105
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2977, $297C, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player106
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2977, $297D, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player107
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2977, $297E, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player108
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2977, $297F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player109
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2977, $294B, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player110
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2978, $2977, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player111
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2978, $2978, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player112
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2978, $2979, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player113
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2978, $297A, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player114
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2978, $297B, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player115
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2978, $297C, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player116
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2978, $297D, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player117
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2978, $297E, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player118
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2978, $297F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player119
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2978, $294B, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player120
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2979, $2977, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player121
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2979, $2978, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player122
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2979, $2979, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player123
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2979, $297A, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player124
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2979, $297B, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player125
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2979, $297C, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player126
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2979, $297D, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player127
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2979, $297E, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player128
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2979, $297F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player129
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2979, $294B, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player130
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297A, $2977, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player131
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297A, $2978, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player132
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297A, $2979, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player133
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297A, $297A, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player134
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297A, $297B, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player135
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297A, $297C, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player136
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297A, $297D, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player137
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297A, $297E, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player138
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297A, $297F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player139
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297A, $294B, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player140
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297B, $2977, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player141
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297B, $2978, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player142
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297B, $2979, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player143
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297B, $297A, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player144
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297B, $297B, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player145
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297B, $297C, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player146
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297B, $297D, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player147
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297B, $297E, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player148
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297B, $297F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player149
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297B, $294B, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player150
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297C, $2977, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player151
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297C, $2978, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player152
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297C, $2979, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player153
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297C, $297A, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player154
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297C, $297B, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player155
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297C, $297C, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player156
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297C, $297D, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player157
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297C, $297E, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player158
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297C, $297F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player159
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297C, $294B, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player160
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297D, $2977, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player161
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297D, $2978, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player162
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297D, $2979, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player163
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297D, $297A, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player164
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297D, $297B, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player165
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297D, $297C, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player166
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297D, $297D, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player167
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297D, $297E, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player168
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297D, $297F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player169
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297D, $294B, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player170
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297E, $2977, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player171
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297E, $2978, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player172
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297E, $2979, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player173
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297E, $297A, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player174
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297E, $297B, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player175
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297E, $297C, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player176
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297E, $297D, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player177
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297E, $297E, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player178
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297E, $297F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player179
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297E, $294B, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player180
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297F, $2977, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player181
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297F, $2978, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player182
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297F, $2979, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player183
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297F, $297A, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player184
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297F, $297B, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player185
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297F, $297C, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player186
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297F, $297D, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player187
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297F, $297E, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player188
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297F, $297F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player189
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297F, $294B, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player190
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $294B, $2977, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player191
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $294B, $2978, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player192
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $294B, $2979, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player193
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $294B, $297A, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player194
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $294B, $297B, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player195
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $294B, $297C, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player196
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $294B, $297D, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player197
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $294B, $297E, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player198
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $294B, $297F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player199
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $294B, $294B, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player200
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2977, $2977, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player201
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2977, $2978, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player202
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2977, $2979, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player203
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2977, $297A, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player204
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2977, $297B, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player205
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2977, $297C, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player206
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2977, $297D, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player207
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2977, $297E, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player208
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2977, $297F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player209
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2977, $294B, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player210
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2978, $2977, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player211
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2978, $2978, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player212
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2978, $2979, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player213
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2978, $297A, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player214
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2978, $297B, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player215
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2978, $297C, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player216
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2978, $297D, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player217
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2978, $297E, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player218
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2978, $297F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player219
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2978, $294B, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player220
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2979, $2977, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player221
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2979, $2978, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player222
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2979, $2979, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player223
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2979, $297A, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player224
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2979, $297B, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player225
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2979, $297C, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player226
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2979, $297D, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player227
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2979, $297E, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player228
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2979, $297F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player229
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2979, $294B, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player230
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297A, $2977, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player231
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297A, $2978, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player232
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297A, $2979, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player233
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297A, $297A, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player234
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297A, $297B, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player235
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297A, $297C, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player236
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297A, $297D, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player237
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297A, $297E, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player238
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297A, $297F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player239
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297A, $294B, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player240
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297B, $2977, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player241
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297B, $2978, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player242
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297B, $2979, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player243
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297B, $297A, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player244
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297B, $297B, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player245
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297B, $297C, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player246
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297B, $297D, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player247
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297B, $297E, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player248
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297B, $297F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player249
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297B, $294B, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player250
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297C, $2977, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player251
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297C, $2978, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player252
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297C, $2979, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player253
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297C, $297A, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player254
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297C, $297B, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player255
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297C, $297C, $007F, $007F, $007F, $007F, $007F, $007F, $007F

267
music.asm
View File

@@ -3,20 +3,77 @@ PreOverworld_LoadProperties_ChooseMusic:
; A: scratch space (value never used)
; Y: set to overworld animated tileset
; X: set to music track/command id
JSL.l FixFrogSmith ; Just a convenient spot to install this hook
JSR.w FixFrogSmith ; Just a convenient spot to install this hook
LDY.b #$58 ; death mountain animated tileset.
LDX.b #$02 ; Default light world theme
LDA $8A : ORA #$40 ; check both light and dark world DM at the same time
CMP.b #$43 : BEQ +
CMP.b #$45 : BEQ +
CMP.b #$47 : BEQ +
CMP.b #$43 : BEQ .endOfLightWorldChecks
CMP.b #$45 : BEQ .endOfLightWorldChecks
CMP.b #$47 : BEQ .endOfLightWorldChecks
LDY.b #$5A ; Main overworld animated tileset
; Skip village and lost woods checks if entering dark world or a special area
LDA $8A : CMP.b #$40 : !BGE .notVillageOrWoods
LDX.b #$07 ; Default village theme
; Check what phase we're in
;LDA ProgressIndicator : CMP.b #$03 : !BLT +
; LDX.b #$02 ; Default light world theme (phase >=3)
;+
; Check if we're entering the village
LDA $8A : CMP.b #$18 : BEQ .endOfLightWorldChecks
; For NA release would we also branch on indexes #$22 #$28 #$29
LDX.b #$05 ; Lost woods theme
; check if we've pulled from the master sword pedestal
LDA OverworldEventDataWRAM+$80 : AND.b #$40 : BEQ +
LDX.b #$02 ; Default light world theme
+
; check if we are entering lost woods
LDA $8A : BEQ .endOfLightWorldChecks
.notVillageOrWoods
; Use the normal overworld (light world) music
LDX.b #$02
; Check phase ; In phase >= 2
LDA ProgressIndicator : CMP.b #$02 : !BGE +
; If phase < 2, play the legend music
LDX.b #$03
+
.endOfLightWorldChecks
; if we are in the light world go ahead and set chosen selection
;LDA CurrentWorld : BEQ .checkInverted+4
+ JSL Overworld_DetermineMusic
LDA CurrentWorld : BEQ .checkInverted+4
LDX.b #$0F ; dark woods theme
; This music is used in dark woods
LDA $8A
CMP.b #$40 : BEQ +
LDX.b #$0D ; dark death mountain theme
; This music is used in dark death mountain
CMP.b #$43 : BEQ + : CMP.b #$45 : BEQ + : CMP.b #$47 : BEQ +
LDX.b #$09 ; dark overworld theme
+
; if not inverted and light world, or inverted and dark world, skip moon pearl check
.checkInverted
LDA CurrentWorld : CLC : ROL #$03 : CMP InvertedMode : BEQ .lastCheck
; Does Link have a moon pearl?
LDA MoonPearlEquipment : BNE +
LDX.b #$04 ; bunny theme
+
.lastCheck
LDA $0132 : CMP.b #$F2 : BNE +
@@ -57,12 +114,58 @@ Overworld_FinishMirrorWarp:
LDA.b #$80 : STA $9B
JSL Overworld_DetermineAmbientSFX
JSL Overworld_DetermineMusic
LDX.b #$04 ; bunny theme
.done
; if not inverted and light world, or inverted and dark world, skip moon pearl check
LDA CurrentWorld : CLC : ROL #$03 : CMP InvertedMode : BEQ +
LDA MoonPearlEquipment : BEQ .endOfLightWorldChecks
+
LDX.b #$09 ; default dark world theme
LDA $8A : CMP.b #$40 : !BGE .endOfLightWorldChecks
LDX.b #$02 ; hyrule field theme
; Check if we're entering the lost woods
CMP.b #$00 : BNE +
LDA OverworldEventDataWRAM+$80 : AND.b #$40 : BNE .endOfLightWorldChecks
LDX.b #$05 ; lost woods theme
BRA .endOfLightWorldChecks
+
; Check if we're entering the village
CMP.b #$18 : BNE .endOfLightWorldChecks
; Check what phase we're in
; LDA ProgressIndicator : CMP.b #$03 : !BGE .endOfLightWorldChecks
LDX.b #$07 ; Default village theme (phase <3)
.endOfLightWorldChecks
STX $012C
LDA $8A : CMP.b #$40 : BNE +
LDX #$0F ; dark woods theme
BRA .bunny
+
CMP.b #$43 : BEQ .darkMountain
CMP.b #$45 : BEQ .darkMountain
CMP.b #$47 : BNE .notDarkMountain
.darkMountain
LDA.b #$09 : STA $012D ; set storm ambient SFX
LDX.b #$0D ; dark mountain theme
.bunny
LDA MoonPearlEquipment : ORA InvertedMode : BNE +
LDX #$04 ; bunny theme
+
STX $012C
.notDarkMountain
LDA $11 : STA $010C
STZ $11
@@ -75,85 +178,78 @@ Overworld_FinishMirrorWarp:
;--------------------------------------------------------------------------------
BirdTravel_LoadTargetAreaMusic:
JSL Overworld_DetermineAmbientSFX
JSL Overworld_DetermineMusic
STZ $04C8 ; Clear peg puzzle count
RTL
;--------------------------------------------------------------------------------
; Skip village and lost woods checks if entering dark world or a special area
LDA $8A : CMP.b #$43 : BEQ .endOfLightWorldChecks
CMP.b #$40 : !BGE .notVillageOrWoods
;--------------------------------------------------------------------------------
;X to be set to music track to load
Overworld_DetermineMusic:
LDA ProgressIndicator : CMP.b #$02 : !BGE +
LDX.b #$03 ; If phase < 2, play the rain music
BRA .done
+ LDA $8A : CMP.b #$43 : BEQ .darkMountain
CMP.b #$45 : BEQ .darkMountain
CMP.b #$47 : BEQ .darkMountain
LDX.b #$07 ; Default village theme
LDX.b #$02 ; hyrule field theme
LDA CurrentWorld : BEQ +
LDX.b #$09 ; default dark world theme
; Check what phase we're in
;LDA ProgressIndicator : CMP.b #$03 : !BLT +
; LDX.b #$02 ; Default light world theme (phase >=3)
;+
; Check if we're entering the village
+ LDA $8A : CMP.b #$18 : BNE +
; Check what phase we're in
; LDA ProgressIndicator : CMP.b #$03 : !BGE .bunny
LDX.b #$07 ; Default village theme (phase <3)
BRA .bunny
; Check if we're entering the lost woods
+ CMP.b #$00 : BNE +
LDA OverworldEventDataWRAM+$80 : AND.b #$40 : BNE .bunny
LDX.b #$05 ; lost woods theme
BRA .bunny
+ LDA $8A : CMP.b #$40 : BNE +
LDX #$0F ; dark woods theme
BRA .bunny
LDA $8A : CMP.b #$18 : BEQ .endOfLightWorldChecks
; For NA release would we also branch on indexes #$22 #$28 #$29
.darkMountain
LDX.b #$0D ; dark mountain theme
;LDX.b #$05 ; Lost woods theme
.bunny
; if not inverted and light world, or inverted and dark world, skip moon pearl check
LDA CurrentWorld : CLC : ROL #$03 : CMP InvertedMode : BEQ .done
LDA MoonPearlEquipment : BNE .done
LDX #$04 ; bunny theme
; check if we've pulled from the master sword pedestal
;LDA OverworldEventDataWRAM+$80 : AND.b #$40 : BEQ +
; LDX.b #$02 ; Default light world theme
;+
.done
RTL
;--------------------------------------------------------------------------------
; check if we are entering lost woods
LDA $8A : BEQ .endOfLightWorldChecks
;--------------------------------------------------------------------------------
;$012D to be set to any ambient SFX for the area
Overworld_DetermineAmbientSFX:
.notVillageOrWoods
; Use the normal overworld (light world) music
LDX.b #$02
; Check phase ; In phase >= 2
LDA ProgressIndicator : CMP.b #$02 : !BGE +
BRA .done ; rain state sfx handled elsewhere
+ LDA $8A : CMP.b #$43 : BEQ .darkMountain
CMP.b #$45 : BEQ .darkMountain
CMP.b #$47 : BEQ .darkMountain
; If phase < 2, play the legend music
LDX.b #$03
+
CMP.b #$70 : BEQ .mire
.endOfLightWorldChecks
; if we are in the light world go ahead and set chosen selection
LDA CurrentWorld : BEQ .checkInverted+4
LDA.b #$05 : BRA .setSfx ; silence
LDX.b #$09 ; dark overworld theme
.mire
LDA OverworldEventDataWRAM+$70 : AND.b #$20 : BNE .done
LDA.b #$01 : BRA .setSfx ; Misery Mire rain SFX
LDA $8A
; Misery Mire rain SFX
CMP.b #$70 : BNE ++
LDA OverworldEventDataWRAM+$70 : AND.b #$20 : BNE ++
LDA.b #$01 : CMP $0131 : BEQ +
STA $012D
+ : BRA .checkInverted
++
; This music is used in dark death mountain
CMP.b #$43 : BEQ .darkMountain
; CMP.b #$45 : BEQ .darkMountain
; CMP.b #$47 : BEQ .darkMountain
LDA.b #$05 : STA $012D
BRA .checkInverted
.darkMountain
LDA.b #$09 : BRA .setSfx ; set storm ambient SFX
LDA CrystalsField : CMP.b #$7F : BEQ +
LDX.b #$0D ; dark death mountain theme
+ : LDA.b #$09 : STA $012D
.setSfx
CMP $0131 : BEQ +
STA $012D
+ STZ $012D
; if not inverted and light world, or inverted and dark world, skip moon pearl check
.checkInverted
LDA CurrentWorld : CLC : ROL #$03 : CMP InvertedMode : BEQ .lastCheck
.done
; Does Link have a moon pearl?
LDA MoonPearlEquipment : BNE +
LDX.b #$04 ; bunny theme
+
.lastCheck
RTL
;--------------------------------------------------------------------------------
@@ -189,27 +285,8 @@ Overworld_MosaicDarkWorldChecks:
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
; This is the where the music can change due to an UW transition
;
; On entry, A=16bit XY=8bit, A & X safe to mod, Y unknown
Underworld_DoorDown_Entry:
LDX #$FF ; some junk value to be used later to determine if the below lines will change the track
LDA.l ProgressIndicator : AND.w #$00FF : CMP.w #2 : !BLT .vanilla
LDA.l DRMode : BNE .done
.vanilla ; thing we wrote over
LDA $A0 : CMP.w #$0012 : BNE +
LDX.b #$14 ; value for Sanc music
BRA .done
+ LDA $A2 : CMP.w #$0012 : BNE .done
LDX.b #$10 ; value for Hyrule Castle music
.done
LDA $A0 : RTL
;--------------------------------------------------------------------------------
; This is for changing to/from ToH dungeon/boss music
;
; A=16bit XY=8bit
; Check if the boss in ToH has been defeated (16-bit accumulator)
CheckHeraBossDefeated:
LDA RoomDataWRAM[$08].high : AND.w #$00FF : BEQ +
SEC : RTL
+ CLC : RTL
LDA $7EF00F : AND #$00FF
RTL
;--------------------------------------------------------------------------------

View File

@@ -1,300 +1,307 @@
NewDrawHud:
SEP #$30
;================================================================================
; Draw bomb count
!BOMBCOUNT_DRAW_ADDRESS = "$7EC75A"
;================================================================================
JSL CheckInfiniteBombs : BNE .infinite_bombs
.finite_bombs
LDA.l SpecialWeapons : CMP #$01 : BNE .normal
NewDrawHud:
SEP #$30
;================================================================================
; Draw bomb count
!BOMBCOUNT_DRAW_ADDRESS = "$7EC75A"
;================================================================================
LDA InfiniteBombsModifier : BNE .infinite_bombs
.finite_bombs
LDA.l SpecialWeapons : CMP #$01 : BNE .normal
LDA.l SpecialWeaponLevel : BEQ .no_bombs
.normal
LDA.l BombsEquipment ; bombs
JSR HudHexToDec2Digit ;requires 8 bit registers!
REP #$20
LDX.b $06 : TXA : ORA.w #$2400 : STA !BOMBCOUNT_DRAW_ADDRESS ; Draw bombs 10 digit
LDX.b $07 : TXA : ORA.w #$2400 : STA !BOMBCOUNT_DRAW_ADDRESS+2 ; Draw bombs 1 digit
BRA +
.no_bombs
REP #$20
LDA.w #$207F : STA !BOMBCOUNT_DRAW_ADDRESS ; blank
STA !BOMBCOUNT_DRAW_ADDRESS+2 ; blank
BRA +
.infinite_bombs
REP #$20
LDA.w #$2431 : STA !BOMBCOUNT_DRAW_ADDRESS ; infinity (left half)
INC A : STA !BOMBCOUNT_DRAW_ADDRESS+2 ; infinity (right half)
+
;================================================================================
; Draw rupee counter
!RUPEE_DRAW_ADDRESS = "$7EC750"
;================================================================================
LDA.l $7EF362 ; Drawing bombs (above) always ends with 16-bit A, so, no need to REP here
JSR HudHexToDec4Digit
LDX.b $04 : TXA : ORA.w #$2400 : STA !RUPEE_DRAW_ADDRESS ; 1000s
LDX.b $05 : TXA : ORA.w #$2400 : STA !RUPEE_DRAW_ADDRESS+2 ; 100s
LDX.b $06 : TXA : ORA.w #$2400 : STA !RUPEE_DRAW_ADDRESS+4 ; 10s
LDX.b $07 : TXA : ORA.w #$2400 : STA !RUPEE_DRAW_ADDRESS+6 ; 1s
;================================================================================
; Draw arrow count
!ARROWCOUNT_DRAW_ADDRESS = "$7EC760"
;================================================================================
SEP #$20
LDA.l ArrowMode : BNE +
LDA InfiniteArrowsModifier : BNE .infinite_arrows
.finite_arrows
LDA.l CurrentArrows ; arrows
JSR HudHexToDec2Digit
REP #$20
LDX.b $06 : TXA : ORA.w #$2400 : STA !ARROWCOUNT_DRAW_ADDRESS ; Draw arrows 10 digit
LDX.b $07 : TXA : ORA.w #$2400 : STA !ARROWCOUNT_DRAW_ADDRESS+2 ; Draw arrows 1 digit
BRA +
.infinite_arrows
REP #$20
LDA.w #$2431 : STA !ARROWCOUNT_DRAW_ADDRESS ; infinity (left half)
INC A : STA !ARROWCOUNT_DRAW_ADDRESS+2 ; infinity (right half)
+
;================================================================================
; Draw Goal Item Indicator
!GOAL_DRAW_ADDRESS = "$7EC72A"
;================================================================================
REP #$20
LDA.l GoalItemRequirement : BNE + : JMP .done : + ; Star Meter
LDA.l GoalCounter
JSR HudHexToDec4Digit
LDA.l GoalItemIcon : STA !GOAL_DRAW_ADDRESS ; draw star icon
LDX.b $05 : TXA : ORA.w #$2400 : STA !GOAL_DRAW_ADDRESS+2 ; draw 100's digit
LDX.b $06 : TXA : ORA.w #$2400 : STA !GOAL_DRAW_ADDRESS+4 ; draw 10's digit
LDX.b $07 : TXA : ORA.w #$2400 : STA !GOAL_DRAW_ADDRESS+6 ; draw 1's digit
LDA.l GoalItemRequirement : CMP.w #$FFFF : BEQ .skip
LDA.l GoalItemRequirement
JSR HudHexToDec4Digit
LDA.w #$2830 : STA !GOAL_DRAW_ADDRESS+8 ; draw slash
LDX.b $05 : TXA : ORA.w #$2400 : STA !GOAL_DRAW_ADDRESS+10 ; draw 100's digit
LDX.b $06 : TXA : ORA.w #$2400 : STA !GOAL_DRAW_ADDRESS+12 ; draw 10's digit
LDX.b $07 : TXA : ORA.w #$2400 : STA !GOAL_DRAW_ADDRESS+14 ; draw 1's digit
BRA .done
.skip
LDA.w #$207F ; transparent tile
STA !GOAL_DRAW_ADDRESS+8
STA !GOAL_DRAW_ADDRESS+10
STA !GOAL_DRAW_ADDRESS+12
.done
;================================================================================
; Draw Dungeon Compass Counts
;================================================================================
LDA.l CompassMode : AND #$003F : BEQ + ; skip if CompassMode is 0.
JSL.l DrawDungeonCompassCounts ; compasses.asm
+
;================================================================================
; Draw key count
!KEY_DIGITS_ADDRESS = "$7EC764"
!KEY_ICON_ADDRESS = "$7EC726"
;================================================================================
SEP #$20
LDA.l CurrentSmallKeys : CMP.b #$FF : BEQ .not_in_dungeon
.in_dungeon
JSR HudHexToDec2Digit : REP #$20
; if 10s digit is 0, draw transparent tile instead of 0
LDX.b $06 : TXA : CPX.b #$90 : BNE +
LDA.w #$007F
+
ORA.w #$2400 : STA !KEY_DIGITS_ADDRESS
; 1s digit
LDX.b $07 : TXA : ORA.w #$2400 : STA !KEY_DIGITS_ADDRESS+2
BRA .done_keys
.not_in_dungeon
REP #$20
;in the overworld, draw transparent tiles instead of key count
LDA.w #$247F : STA !KEY_DIGITS_ADDRESS : STA !KEY_DIGITS_ADDRESS+2
STA !KEY_ICON_ADDRESS
.done_keys
;--------------------------------------------------------------------------------
; Draw pendant/crystal icon
;--------------------------------------------------------------------------------
!PRIZE_ICON = $7EC742
!P_ICON = $296C
!C_ICON = $295F
SEP #$20
LDA.b $1B : BEQ .noprize
LDX.w $040C
CPX #$1A : !BGE .noprize
CPX #$04 : !BLT .noprize
CPX #$08 : BEQ .noprize
LDA $10 : CMP #$12 : BEQ .noprize
LDA.l MapMode
REP #$20
BEQ .drawprize
LDA.l MapField
AND.l DungeonItemMasks,X
BEQ .noprize
.drawprize
TXA : LSR : TAX
LDA.l CrystalPendantFlags_2, X
AND.w #$0040 : BNE .is_crystal
LDA.w #!P_ICON
BRA .doneprize
.is_crystal
LDA.w #!C_ICON
BRA .doneprize
.noprize
REP #$20
LDA.w #$207F
.doneprize
STA.l !PRIZE_ICON
;--------------------------------------------------------------------------------
; Draw Magic Meter
!DrawMagicMeter_mp_tilemap = "$0DFE0F"
;--------------------------------------------------------------------------------
LDA CurrentMagic : AND #$00FF ; crap we wrote over when placing the hook for OnDrawHud
!ADD #$0007
AND #$FFF8
TAX ; end of crap
LDA InfiniteMagicModifier : AND.w #$00FF : BNE + : JMP .green : +
SEP #$20 : LDA.b #$80 : STA CurrentMagic : REP #$30 ; set magic to max
LDX.w #$0080 ; load full magic meter graphics
LDA $1A : AND.w #$000C : LSR #2
BEQ .red
CMP.w #0001 : BEQ .yellow
CMP.w #0002 : BNE + : JMP .green : +
.blue
LDA !DrawMagicMeter_mp_tilemap+0, X : AND.w #$EFFF : STA $7EC746
LDA !DrawMagicMeter_mp_tilemap+2, X : AND.w #$EFFF : STA $7EC786
LDA !DrawMagicMeter_mp_tilemap+4, X : AND.w #$EFFF : STA $7EC7C6
LDA !DrawMagicMeter_mp_tilemap+6, X : AND.w #$EFFF : STA $7EC806
RTL
.red
LDA !DrawMagicMeter_mp_tilemap+0, X : AND.w #$E7FF : STA $7EC746
LDA !DrawMagicMeter_mp_tilemap+2, X : AND.w #$E7FF : STA $7EC786
LDA !DrawMagicMeter_mp_tilemap+4, X : AND.w #$E7FF : STA $7EC7C6
LDA !DrawMagicMeter_mp_tilemap+6, X : AND.w #$E7FF : STA $7EC806
RTL
.yellow
LDA !DrawMagicMeter_mp_tilemap+0, X : AND.w #$EBFF : STA $7EC746
LDA !DrawMagicMeter_mp_tilemap+2, X : AND.w #$EBFF : STA $7EC786
LDA !DrawMagicMeter_mp_tilemap+4, X : AND.w #$EBFF : STA $7EC7C6
LDA !DrawMagicMeter_mp_tilemap+6, X : AND.w #$EBFF : STA $7EC806
RTL
.orange
LDA !DrawMagicMeter_mp_tilemap+0, X : AND.w #$E3FF : STA $7EC746
LDA !DrawMagicMeter_mp_tilemap+2, X : AND.w #$E3FF : STA $7EC786
LDA !DrawMagicMeter_mp_tilemap+4, X : AND.w #$E3FF : STA $7EC7C6
LDA !DrawMagicMeter_mp_tilemap+6, X : AND.w #$E3FF : STA $7EC806
RTL
.green
LDA !DrawMagicMeter_mp_tilemap+0, X : STA $7EC746
LDA !DrawMagicMeter_mp_tilemap+2, X : STA $7EC786
LDA !DrawMagicMeter_mp_tilemap+4, X : STA $7EC7C6
LDA !DrawMagicMeter_mp_tilemap+6, X : STA $7EC806
RTL
;================================================================================
; 16-bit A, 8-bit X
; in: A(b) - Byte to Convert
; out: $04 - $07 (high - low)
;================================================================================
HudHexToDec4Digit:
LDY.b #$90
-
CMP.w #1000 : !BLT +
INY
SBC.w #1000 : BRA -
+
STY $04 : LDY #$90 ; Store 1000s digit & reset Y
-
CMP.w #100 : !BLT +
INY
SBC.w #100 : BRA -
+
STY $05 : LDY #$90 ; Store 100s digit & reset Y
-
CMP.w #10 : !BLT +
INY
SBC.w #10 : BRA -
+
STY $06 : LDY #$90 ; Store 10s digit & reset Y
CMP.w #1 : !BLT +
-
INY
DEC : BNE -
+
STY $07 ; Store 1s digit
RTS
;================================================================================
; 8-bit registers
; in: A(b) - Byte to Convert
; out: $05 - $07 (high - low)
;================================================================================
;HudHexToDec3Digit: ; this may be overkill, could have used the 4 digit one...
; LDY.b #$90
; -
; CMP.b #100 : !BLT +
; INY
; SBC.b #100 : BRA -
; +
; STY $05 : LDY.b #$90 ; Store 100s digit and reset Y
; -
; CMP.b #10 : !BLT +
; INY
; SBC.b #10 : BRA -
; +
; STY $06 : LDY #$90 ; Store 10s digit and reset Y
; CMP.b #1 : !BLT +
; -
; INY
; DEC : BNE -
; +
; STY $07 ; Store 1s digit
;RTS
;================================================================================
; 8-bit registers
; in: A(b) - Byte to Convert
; out: $06 - $07 (high - low)
;================================================================================
HudHexToDec2Digit:
LDY.b #$90
-
CMP.b #10 : !BLT +
INY
SBC.b #10 : BRA -
+
STY $06 : LDY #$90 ; Store 10s digit and reset Y
CMP.b #1 : !BLT +
-
INY
DEC : BNE -
+
STY $07 ; Store 1s digit
RTS
.normal
LDA.l BombsEquipment ; bombs
JSR HudHexToDec2Digit ; requires 8 bit registers!
REP #$20
LDX.b $06 : TXA : ORA.w #$2400 : STA !BOMBCOUNT_DRAW_ADDRESS ; Draw bombs 10 digit
LDX.b $07 : TXA : ORA.w #$2400 : STA !BOMBCOUNT_DRAW_ADDRESS+2 ; Draw bombs 1 digit
BRA +
.no_bombs
REP #$20
LDA.w #$207F : STA !BOMBCOUNT_DRAW_ADDRESS
STA !BOMBCOUNT_DRAW_ADDRESS+2
BRA +
.infinite_bombs
REP #$20
LDA.w #$2431 : STA !BOMBCOUNT_DRAW_ADDRESS ; infinity (left half)
INC A : STA !BOMBCOUNT_DRAW_ADDRESS+2 ; infinity (right half)
+
;================================================================================
; Draw rupee counter
!RUPEE_DRAW_ADDRESS = "$7EC750"
;================================================================================
LDA.l DisplayRupees ; Drawing bombs (above) always ends with 16-bit A, so, no need to REP here
JSR HudHexToDec4Digit
LDX.b $04 : TXA : ORA.w #$2400 : STA !RUPEE_DRAW_ADDRESS ; 1000s
LDX.b $05 : TXA : ORA.w #$2400 : STA !RUPEE_DRAW_ADDRESS+2 ; 100s
LDX.b $06 : TXA : ORA.w #$2400 : STA !RUPEE_DRAW_ADDRESS+4 ; 10s
LDX.b $07 : TXA : ORA.w #$2400 : STA !RUPEE_DRAW_ADDRESS+6 ; 1s
;================================================================================
; Draw arrow count
!ARROWCOUNT_DRAW_ADDRESS = "$7EC760"
;================================================================================
SEP #$20
LDA.l ArrowMode : BNE +
LDA InfiniteArrowsModifier : BNE .infinite_arrows
.finite_arrows
LDA.l CurrentArrows ; arrows
JSR HudHexToDec2Digit
REP #$20
LDX.b $06 : TXA : ORA.w #$2400 : STA !ARROWCOUNT_DRAW_ADDRESS ; Draw arrows 10 digit
LDX.b $07 : TXA : ORA.w #$2400 : STA !ARROWCOUNT_DRAW_ADDRESS+2 ; Draw arrows 1 digit
BRA +
.infinite_arrows
REP #$20
LDA.w #$2431 : STA !ARROWCOUNT_DRAW_ADDRESS ; infinity (left half)
INC A : STA !ARROWCOUNT_DRAW_ADDRESS+2 ; infinity (right half)
+
;================================================================================
; Draw Goal Item Indicator
!GOAL_DRAW_ADDRESS = "$7EC72A"
;================================================================================
REP #$20
LDA.l GoalItemRequirement : BNE + : JMP .done : + ; Star Meter
LDA.l GoalCounter
JSR HudHexToDec4Digit
LDA.l GoalItemIcon : STA.l !GOAL_DRAW_ADDRESS ; draw star icon
LDX.b $05 : TXA : ORA.w #$2400 : STA !GOAL_DRAW_ADDRESS+2 ; draw 100's digit
LDX.b $06 : TXA : ORA.w #$2400 : STA !GOAL_DRAW_ADDRESS+4 ; draw 10's digit
LDX.b $07 : TXA : ORA.w #$2400 : STA !GOAL_DRAW_ADDRESS+6 ; draw 1's digit
LDA.l GoalItemRequirement : CMP.w #$FFFF : BEQ .skip
LDA.l GoalItemRequirement
JSR HudHexToDec4Digit
LDA.w #$2830 : STA !GOAL_DRAW_ADDRESS+8 ; draw slash
LDX.b $05 : TXA : ORA.w #$2400 : STA !GOAL_DRAW_ADDRESS+10 ; draw 100's digit
LDX.b $06 : TXA : ORA.w #$2400 : STA !GOAL_DRAW_ADDRESS+12 ; draw 10's digit
LDX.b $07 : TXA : ORA.w #$2400 : STA !GOAL_DRAW_ADDRESS+14 ; draw 1's digit
BRA .done
.skip
LDA.w #$207F ; transparent tile
STA !GOAL_DRAW_ADDRESS+8
STA !GOAL_DRAW_ADDRESS+10
STA !GOAL_DRAW_ADDRESS+12
.done
;================================================================================
; Draw Dungeon Compass Counts
;================================================================================
LDA.l CompassMode : AND #$00FF : BEQ + ; skip if CompassMode is 0.
JSL.l DrawDungeonCompassCounts ; compasses.asm
+
;================================================================================
; Draw key count
!KEY_DIGITS_ADDRESS = "$7EC764"
!KEY_ICON_ADDRESS = "$7EC726"
;================================================================================
SEP #$20
LDA.l CurrentSmallKeys : CMP.b #$FF : BEQ .not_in_dungeon
.in_dungeon
JSR HudHexToDec2Digit : REP #$20
; if 10s digit is 0, draw transparent tile instead of 0
LDX.b $06 : TXA : CPX.b #$90 : BNE +
LDA.w #$007F
+
ORA.w #$2400 : STA !KEY_DIGITS_ADDRESS
; 1s digit
LDX.b $07 : TXA : ORA.w #$2400 : STA !KEY_DIGITS_ADDRESS+2
BRA .done_keys
.not_in_dungeon
REP #$20
;in the overworld, draw transparent tiles instead of key count
LDA.w #$247F : STA !KEY_DIGITS_ADDRESS : STA !KEY_DIGITS_ADDRESS+2
STA !KEY_ICON_ADDRESS
.done_keys
;--------------------------------------------------------------------------------
; Draw pendant/crystal icon
;--------------------------------------------------------------------------------
!PRIZE_ICON = $7EC742
!P_ICON = $296C
!C_ICON = $295F
SEP #$20
LDA.b $1B : BEQ .noprize
LDX.w $040C
CPX #$1A : !BGE .noprize
CPX #$04 : !BLT .noprize
CPX #$08 : BEQ .noprize
LDA $10 : CMP #$12 : BEQ .noprize
LDA.l MapMode
REP #$20
BEQ .drawprize
LDA.l MapField
AND.l DungeonItemMasks,X
BEQ .noprize
.drawprize
TXA : LSR : TAX
LDA.l CrystalPendantFlags_2, X
AND.w #$0040 : BNE .is_crystal
LDA.w #!P_ICON
BRA .doneprize
.is_crystal
LDA.w #!C_ICON
BRA .doneprize
.noprize
REP #$20
LDA.w #$207F
.doneprize
STA.l !PRIZE_ICON
;--------------------------------------------------------------------------------
; Draw Magic Meter
!DrawMagicMeter_mp_tilemap = "$0DFE0F"
;--------------------------------------------------------------------------------
LDA CurrentMagic : AND #$00FF ; crap we wrote over when placing the hook for OnDrawHud
!ADD #$0007
AND #$FFF8
TAX ; end of crap
LDA InfiniteMagicModifier : AND.w #$00FF : BNE + : JMP .green : +
SEP #$20 : LDA.b #$80 : STA CurrentMagic : REP #$30 ; set magic to max
LDX.w #$0080 ; load full magic meter graphics
LDA $1A : AND.w #$000C : LSR #2
BEQ .red
CMP.w #0001 : BEQ .yellow
CMP.w #0002 : BNE + : JMP .green : +
.blue
LDA !DrawMagicMeter_mp_tilemap+0, X : AND.w #$EFFF : STA $7EC746
LDA !DrawMagicMeter_mp_tilemap+2, X : AND.w #$EFFF : STA $7EC786
LDA !DrawMagicMeter_mp_tilemap+4, X : AND.w #$EFFF : STA $7EC7C6
LDA !DrawMagicMeter_mp_tilemap+6, X : AND.w #$EFFF : STA $7EC806
RTL
.red
LDA !DrawMagicMeter_mp_tilemap+0, X : AND.w #$E7FF : STA $7EC746
LDA !DrawMagicMeter_mp_tilemap+2, X : AND.w #$E7FF : STA $7EC786
LDA !DrawMagicMeter_mp_tilemap+4, X : AND.w #$E7FF : STA $7EC7C6
LDA !DrawMagicMeter_mp_tilemap+6, X : AND.w #$E7FF : STA $7EC806
RTL
.yellow
LDA !DrawMagicMeter_mp_tilemap+0, X : AND.w #$EBFF : STA $7EC746
LDA !DrawMagicMeter_mp_tilemap+2, X : AND.w #$EBFF : STA $7EC786
LDA !DrawMagicMeter_mp_tilemap+4, X : AND.w #$EBFF : STA $7EC7C6
LDA !DrawMagicMeter_mp_tilemap+6, X : AND.w #$EBFF : STA $7EC806
RTL
.orange
LDA !DrawMagicMeter_mp_tilemap+0, X : AND.w #$E3FF : STA $7EC746
LDA !DrawMagicMeter_mp_tilemap+2, X : AND.w #$E3FF : STA $7EC786
LDA !DrawMagicMeter_mp_tilemap+4, X : AND.w #$E3FF : STA $7EC7C6
LDA !DrawMagicMeter_mp_tilemap+6, X : AND.w #$E3FF : STA $7EC806
RTL
.green
LDA !DrawMagicMeter_mp_tilemap+0, X : STA $7EC746
LDA !DrawMagicMeter_mp_tilemap+2, X : STA $7EC786
LDA !DrawMagicMeter_mp_tilemap+4, X : STA $7EC7C6
LDA !DrawMagicMeter_mp_tilemap+6, X : STA $7EC806
RTL
;================================================================================
; 16-bit A, 8-bit X
; in: A(b) - Byte to Convert
; out: $04 - $07 (high - low)
;================================================================================
HudHexToDec4Digit:
LDY.b #$90
-
CMP.w #1000 : !BLT +
INY
SBC.w #1000 : BRA -
+
STY $04 : LDY #$90 ; Store 1000s digit & reset Y
-
CMP.w #100 : !BLT +
INY
SBC.w #100 : BRA -
+
STY $05 : LDY #$90 ; Store 100s digit & reset Y
-
CMP.w #10 : !BLT +
INY
SBC.w #10 : BRA -
+
STY $06 : LDY #$90 ; Store 10s digit & reset Y
CMP.w #1 : !BLT +
-
INY
DEC : BNE -
+
STY $07 ; Store 1s digit
RTS
;================================================================================
; 8-bit registers
; in: A(b) - Byte to Convert
; out: $05 - $07 (high - low)
;================================================================================
;HudHexToDec3Digit: ; this may be overkill, could have used the 4 digit one...
; LDY.b #$90
; -
; CMP.b #100 : !BLT +
; INY
; SBC.b #100 : BRA -
; +
; STY $05 : LDY.b #$90 ; Store 100s digit and reset Y
; -
; CMP.b #10 : !BLT +
; INY
; SBC.b #10 : BRA -
; +
; STY $06 : LDY #$90 ; Store 10s digit and reset Y
; CMP.b #1 : !BLT +
; -
; INY
; DEC : BNE -
; +
; STY $07 ; Store 1s digit
;RTS
;================================================================================
; 8-bit registers
; in: A(b) - Byte to Convert
; out: $06 - $07 (high - low)
;================================================================================
HudHexToDec2Digit:
LDY.b #$90
-
CMP.b #10 : !BLT +
INY
SBC.b #10 : BRA -
+
STY $06 : LDY #$90 ; Store 10s digit and reset Y
CMP.b #1 : !BLT +
-
INY
DEC : BNE -
+
STY $07 ; Store 1s digit
RTS

View File

@@ -39,12 +39,12 @@
; #$80 - Compasses
; #$90 - Big Keys
; #$A0 - Small Keys
; #$B0 - Bee Trap
; #$B1 - Apples
; #$B2 - Fairy
; #$B3 - Chicken
; #$B4 - Big Magic
; #$B5 - 5 Arrows
; #$B0 - reserved for bee traps
; #$B1 - reserved for bonk shuffle
; #$B2 - reserved for bonk shuffle
; #$B3 - reserved for bonk shuffle
; #$B4 - reserved for bonk shuffle
; #$B5 - reserved for bonk shuffle
; #$B6 - Progressive Bomb
; #$B7 - Progressive Cane
; #$FE - Server Request (Asychronous Chest)
@@ -197,14 +197,6 @@ AddReceivedItemExpandedGetItem:
LDA $02D8 ; check inventory
JSL.l FreeDungeonItemNotice
PHA
LDA !MULTIWORLD_ITEM_PLAYER_ID : BEQ +
PLA
BRL .done
+
PLA
CMP.b #$0B : BNE + ; Bow
LDA BowTracking : AND.b #$40 : BEQ ++
LDA.l SilverArrowsUseRestriction : BNE ++
@@ -401,47 +393,8 @@ AddReceivedItemExpandedGetItem:
LDA CurrentSmallKeys : INC : STA CurrentSmallKeys
++
JMP .done
+ CMP.b #$B0 : BNE + ; Bee Trap
LDA.b #$79 : JSL Sprite_SpawnDynamically : BMI ++ ; DashBeeHive_SpawnBee
LDA $22 : CLC : ADC.b #$03 : AND.b #$F8 : STA $0D10,Y
LDA $23 : ADC.b #$00 : STA $0D30,Y ; round X to nearest 8
LDA $20 : STA $0D00, Y : LDA $21 : STA $0D20, Y
LDA.b $EE : STA.w $0F20,Y ; spawns on same layer as link
++ JMP .done
+ CMP.b #$B1 : BNE + ; Apples
LDA.b #$AC : JSL Sprite_SpawnDynamically : BMI ++
LDA $22 : CLC : ADC.b #$03 : AND.b #$F8 : STA $0D10,Y
LDA $23 : ADC.b #$00 : STA $0D30,Y ; round X to nearest 8
LDA.b $20 : SEC : SBC.b #$10 : STA.w $0D00,Y
LDA.b $21 : SBC.b #$00 : STA.w $0D20,Y ; move up 16 pixels
LDA.b $EE : STA.w $0F20,Y ; spawns on same layer as link
LDA.b #$FF : STA.w $0B58,Y ; allows them to expire
++ JMP .done
+ CMP.b #$B2 : BNE + ; Fairy
LDA.b #$E3 : JSL Sprite_SpawnDynamically : BMI ++
LDA $22 : CLC : ADC.b #$03 : AND.b #$F8 : STA $0D10,Y
LDA $23 : ADC.b #$00 : STA $0D30,Y ; round X to nearest 8
LDA.b $20 : SEC : SBC.b #$10 : STA.w $0D00,Y
LDA.b $21 : SBC.b #$00 : STA.w $0D20,Y ; move up 16 pixels
LDA.b $EE : STA.w $0F20,Y ; spawns on same layer as link
LDA.b #$FF : STA.w $0B58,Y ; allows them to expire
++ JMP .done
+ CMP.b #$B3 : BNE + ; Chicken
LDA.b #$0B : JSL Sprite_SpawnDynamically : BMI .done
LDA $22 : CLC : ADC.b #$03 : AND.b #$F8 : STA $0D10,Y
LDA $23 : ADC.b #$00 : STA $0D30,Y ; round X to nearest 8
LDA.b $20 : SEC : SBC.b #$08 : STA.w $0D00,Y
LDA.b $21 : SBC.b #$00 : STA.w $0D20,Y ; move up 8 pixels
LDA.b $EE : STA.w $0F20,Y ; spawns on same layer as link
BRA .done
+ CMP.b #$B4 : BNE + ; Big Magic
LDA.b #$80 : STA MagicFiller ; fill magic
BRA .done
+ CMP.b #$B5 : BNE + ; 5 Arrows
LDA.b #$05 : STA ArrowsFiller ; add 5 arrows
BRA .done
+ CMP.b #$B6 : BNE + ; Bomb Upgrade
LDA #$01 : STA InfiniteBombsModifier ; infinite bombs
LDA #$01 : STA InfiniteBombsModifier
JMP .done
+ : CMP.b #$B7 : BNE + ; Cane Upgrade
LDA.l SpecialWeapons : CMP #$03 : BEQ .blue_cane
@@ -453,6 +406,7 @@ AddReceivedItemExpandedGetItem:
.red_cane
LDA #$01 : STA SomariaEquipment
BRA .done
BRA .done
+
.done
PLX
@@ -479,55 +433,49 @@ RTL
AddReceivedItemExpanded:
{
PHA : PHX
LDA RemoteItems : BEQ + : LDA !MULTIWORLD_ITEM_PLAYER_ID : BEQ +
LDA $02E9 : BEQ ++ : CMP #$03 : BNE +++ : ++
; fromTextOrObject
LDA $0345 : BEQ ++ : LDA.b #$04 : ++ : STA $5D ; Restore Link to his swimming state
STZ $02DA : STZ $037B : STZ $02E4
LDA #$0E : STA $012F
+++
STZ $02D8 : STZ $02D9 : STZ $02E9
PHY : LDY.b #$00 : JSL AddInventory : PLY
PLX : PLA : RTL
+
JSL.l PreItemGet
LDA !MULTIWORLD_ITEM_PLAYER_ID : BNE +
LDA $02D8
JSR AttemptItemSubstitution
STA $02D8
JSR IncrementItemCounters
+
LDA $02D8 ; Item Value
STA !MULTIWORLD_ITEM_ID
JSR AttemptItemSubstitution
STA $02D8
CMP.b #$16 : BEQ .bottle ; Bottle
CMP.b #$2B : BEQ .bottle ; Red Potion w/bottle
CMP.b #$2C : BEQ .bottle ; Green Potion w/bottle
CMP.b #$2D : BEQ .bottle ; Blue Potion w/bottle
CMP.b #$3C : BEQ .bottle ; Bee w/bottle
CMP.b #$3D : BEQ .bottle ; Fairy w/bottle
CMP.b #$48 : BEQ .bottle ; Gold Bee w/bottle
BRA .notBottle
.bottle
JSR.w CountBottles : CMP.l BottleLimit : !BLT +++
LDA !MULTIWORLD_ITEM_PLAYER_ID : BNE +++
LDA.l BottleLimitReplacement : STA $02D8
+++ : JMP .done
.notBottle
JSR IncrementItemCounters
CMP.b #$16 : BNE ++ ; Bottle
JSR.w CountBottles : CMP.l BottleLimit : !BLT +++
LDA.l BottleLimitReplacement : STA $02D8
+++ : JMP .done
++ : CMP.b #$2B : BNE ++ ; Red Potion w/bottle
JSR.w CountBottles : CMP.l BottleLimit : !BLT +++
LDA.l BottleLimitReplacement : STA $02D8
+++ : JMP .done
++ : CMP.b #$2C : BNE ++ ; Green Potion w/bottle
JSR.w CountBottles : CMP.l BottleLimit : !BLT +++
LDA.l BottleLimitReplacement : STA $02D8
+++ : JMP .done
++ : CMP.b #$2D : BNE ++ ; Blue Potion w/bottle
JSR.w CountBottles : CMP.l BottleLimit : !BLT +++
LDA.l BottleLimitReplacement : STA $02D8
+++ : JMP .done
++ : CMP.b #$3C : BNE ++ ; Bee w/bottle
JSR.w CountBottles : CMP.l BottleLimit : !BLT +++
LDA.l BottleLimitReplacement : STA $02D8
+++ : JMP .done
++ : CMP.b #$3D : BNE ++ ; Fairy w/bottle
JSR.w CountBottles : CMP.l BottleLimit : !BLT +++
LDA.l BottleLimitReplacement : STA $02D8
+++ : JMP .done
++ : CMP.b #$48 : BNE ++ ; Gold Bee w/bottle
JSR.w CountBottles : CMP.l BottleLimit : !BLT +++
LDA.l BottleLimitReplacement : STA $02D8
+++ : JMP .done
++ : CMP.b #$4E : BNE ++ ; Progressive Magic
LDA MagicConsumption : BEQ +++
LDA.b #$4F : STA $02D8
+++ : JMP .done
++ : CMP.b #$5E : BNE ++ ; Progressive Sword
LDA !MULTIWORLD_ITEM_PLAYER_ID : BNE +
LDA HighestSword : CMP.l ProgressiveSwordLimit : !BLT +
LDA SwordEquipment : CMP.l ProgressiveSwordLimit : !BLT +
LDA.l ProgressiveSwordReplacement : STA $02D8 : JMP .done
+
LDA SwordEquipment : CMP.b #$FF : BNE + ; Swordless
LDA.b #$49 : STA $02D8 : JMP .done
+ : CMP.b #$00 : BNE + ; No Sword
LDA.b #$49 : STA $02D8 : JMP .done
+ : CMP.b #$01 : BNE + ; Fighter Sword
@@ -537,31 +485,18 @@ AddReceivedItemExpanded:
+ ; Everything Else
LDA.b #$03 : STA $02D8 : JMP .done
++ : CMP.b #$5F : BNE ++ ; Progressive Shield
LDA !MULTIWORLD_ITEM_PLAYER_ID : BEQ +
LDA ShieldEquipment : BNE +++ ; No Shield
LDA.b #$04 : STA $02D8 : JMP .done
+++ : CMP.b #$40 : BNE +++ ; Fighter Shield
LDA.b #$05 : STA $02D8 : JMP .done
+++ ; Everything Else
LDA.b #$06 : STA $02D8 : JMP .done
+
LDA HighestShield : CMP.l ProgressiveShieldLimit : !BLT +
LDA ShieldEquipment : CMP.l ProgressiveShieldLimit : !BLT +
LDA.l ProgressiveShieldReplacement : STA $02D8 : JMP .done
+
LDA HighestShield : BNE + ; No Shield
LDA.b #$04 : BRA .shielddone
+ : CMP.b #$00 : BNE + ; No Shield
LDA.b #$04 : STA $02D8 : JMP .done
+ : CMP.b #$01 : BNE + ; Fighter Shield
LDA.b #$05 : BRA .shielddone
LDA.b #$05 : STA $02D8 : JMP .done
+ ; Everything Else
LDA.b #$06
.shielddone : STA $02D8
JMP .done
LDA.b #$06 : STA $02D8 : JMP .done
++ : CMP.b #$60 : BNE ++ ; Progressive Armor
LDA !MULTIWORLD_ITEM_PLAYER_ID : BNE +
LDA HighestMail : CMP.l ProgressiveArmorLimit : !BLT +
LDA ArmorEquipment : CMP.l ProgressiveArmorLimit : !BLT +
LDA.l ProgressiveArmorReplacement : STA $02D8 : JMP .done
+
LDA ArmorEquipment : CMP.b #$00 : BNE + ; No Armor
+ : CMP.b #$00 : BNE + ; No Armor
LDA.b #$22 : STA $02D8 : JMP .done
+ ; Everything Else
LDA.b #$23 : STA $02D8 : JMP .done
@@ -571,17 +506,15 @@ AddReceivedItemExpanded:
+ ; Everything Else
LDA.b #$1C : STA $02D8 : JMP .done
++ : CMP.b #$64 : BNE ++ : -- ; Progressive Bow
LDA !MULTIWORLD_ITEM_PLAYER_ID : BNE +
LDA BowEquipment : INC : LSR : CMP.l ProgressiveBowLimit : !BLT +
LDA.l ProgressiveBowReplacement : STA $02D8 : JMP .done
+ LDA BowEquipment : INC : LSR : CMP.b #$00 : BNE + ; No Bow
+ : CMP.b #$00 : BNE + ; No Bow
LDA.b #$3A : STA $02D8 : JMP .done
+ ; Any Bow
LDA.b #$3B : STA $02D8 : JMP .done
++ : CMP.b #$65 : BNE ++ ; Progressive Bow 2
LDA !MULTIWORLD_ITEM_PLAYER_ID : BNE +++
LDA.l BowTracking : ORA #$20 : STA.l BowTracking
+++ : BRA --
LDA.l BowTracking : ORA #$20 : STA.l BowTracking
BRA --
; ++ : CMP.b #$FE : BNE ++ ; Server Request (Null Chest)
; JSL ChestItemServiceRequest
; BRA .done
@@ -594,10 +527,6 @@ AddReceivedItemExpanded:
JSL.l GetRNGItemMulti : STA $02D8
LDA #$FF : STA !LOCK_IN ; clear lock-in
JMP .done
++ : CMP.b #$B0 : BNE ++ ; Bee Trap
LDA !MULTIWORLD_ITEM_PLAYER_ID : BEQ +++
LDA.b #$0E : STA $02D8 : JMP .done ; Bee in a bottle
+++
++
.done
PLX : PLA
@@ -642,12 +571,8 @@ AddReceivedItemExpanded:
db -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4 ; Free Compass
db -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4 ; Free Big Key
db -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4 ; Free Small Key
db -4 ; Bee Trap
db -4 ; Apples
db -4 ; Fairy
db -4 ; Chicken
db -4 ; Big Magic
db -4 ; 5 Arrows
db -4 ; reserved for bee traps
db -4, -4, -4, -4, -4 ; reserved for bonk shuffle
db -4 ; Bomb Upgrade
db -4 ; Cane Upgrade
db -4, -4, -4, -4, -4, -4, -4, -4 ; Unused
@@ -690,12 +615,8 @@ AddReceivedItemExpanded:
db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ; Free Big Key
;db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ; *EVENT*
db 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 ; Free Small Key
db 0 ; Bee Trap
db 0 ; Apples
db 0 ; Fairy
db 0 ; Chicken
db 4 ; Big Magic
db 0 ; 5 Arrows
db 0 ; reserved for bee traps
db 0, 0, 0, 0, 0 ; reserved for bonk shuffle
db 0 ; Bomb Upgrade
db 4 ; Cane Upgrade
db 0, 0, 0, 0, 0, 0, 0, 0 ; Unused
@@ -742,13 +663,8 @@ AddReceivedItemExpanded:
;db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; *EVENT*
;db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; *EVENT*
;db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; *EVENT*
db $47 ; Bee Trap
db $47 ; Apples
db $47 ; Fairy
db $47 ; Chicken
db $3B ; Big Magic
db $02 ; 5 Arrows
db $49 ; reserved for bee traps
db $49, $49, $49, $49, $49 ; reserved for bonk shuffle
db $13 ; Bomb Upgrade
db $07 ; Cane Upgrade
db $49, $49, $49, $49, $49, $49, $49, $49 ; Unused
@@ -790,12 +706,8 @@ AddReceivedItemExpanded:
db $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02 ; Free Compass
db $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02 ; Free Big Key
db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; Free Small Key
db $02 ; Bee Trap
db $02 ; Apples
db $02 ; Fairy
db $02 ; Chicken
db $00 ; Big Magic
db $02 ; 5 Arrows
db $02 ; reserved for bee traps
db $02, $02, $02, $02, $02 ; reserved for bonk shuffle
db $02 ; Bomb Upgrade
db $00 ; Cane Upgrade
db $02, $02, $02, $02, $02, $02, $02, $02 ; Unused
@@ -838,12 +750,8 @@ AddReceivedItemExpanded:
db 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ; Free Compass
db 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 ; Free Big Key
db 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 ; Free Small Key
db 1 ; Bee Trap
db 1 ; Apples
db 1 ; Fairy
db 1 ; Chicken
db 4 ; Big Magic
db 2 ; 5 Arrows
db 4 ; reserved for bee traps
db 4, 4, 4, 4, 4 ; reserved for bonk shuffle
db 5 ; Bomb Upgrade
db 5 ; Cane Upgrade
db 4, 4, 4, 4, 4, 4, 4, 4 ; Unused
@@ -887,12 +795,8 @@ AddReceivedItemExpanded:
dw $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A ; Free Compass
dw $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A ; Free Big Key
dw $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A ; Free Small Key
dw $F36A ; Bee Trap
dw $F36A ; Apples
dw $F36A ; Fairy
dw $F36A ; Chicken
dw $F373 ; Big Magic
dw $F376 ; 5 Arrows
dw $F36A ; reserved for bee traps
dw $F36A, $F36A, $F36A, $F36A, $F36A ; reserved for bonk shuffle
dw $F38F ; Bomb Upgrade
dw $F38F ; Cane Upgrade
dw $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A ; Unused
@@ -938,12 +842,8 @@ AddReceivedItemExpanded:
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; Free Compass
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; Free Big Key
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; Free Small Key
db $FF ; Bee Trap
db $FF ; Apples
db $FF ; Fairy
db $FF ; Chicken
db $80 ; Big Magic
db $05 ; 5 Arrows
db $FF ; reserved for bee traps
db $FF, $FF, $FF, $FF, $FF ; reserved for bonk shuffle
db $FF ; Bomb Upgrade
db $FF ; Cane Upgrade
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; Unused
@@ -968,26 +868,26 @@ AddReceivedItemExpanded:
;0x1A - Ganon's Tower
.item_masks ; these are dungeon correlations to $7EF364 - $7EF369 so it knows where to store compasses, etc
; sewers and castle get 2 bits active so that they can share their items elegantly
dw $C000, $C000, $2000, $1000, $0800, $0400, $0200, $0100
dw $0080, $0040, $0020, $0010, $0008, $0004, $4B8B, $20AB ; last two can be re-used
; sewers and castle get 2 bits active so that they can share their items elegantly
dw $C000, $C000, $2000, $1000, $0800, $0400, $0200, $0100
dw $0080, $0040, $0020, $0010, $0008, $0004, $4B8B, $20AB ; last two can be re-used
; caves
dw $9CCE, $0390, $2F82, $AD03, $02E9, $01C9, $06D0, $72A5
dw $A548, $4873, $01A0, $D8AD, $C902, $D020, $A002, $9802
dw $E48D, $DA02, $D8AC, $D002, $A215, $BD08, $84E2, $0085
dw $E3BD, $8584, $A901, $857E, $B902, $857A, $0087, $0A98
dw $BDAA, $84E2, $0085, $E3BD, $8584, $A901, $857E, $B902
dw $857A, $0230, $0087, $1FC0, $02D0, $5664, $04A9, $4BC0
dw $06F0, $1EC0, $0AD0, $02A9, $790F, $7EF3, $798F, $7EF3
dw $1BC0, $04F0, $1CC0, $07D0, $1B22, $1BEE, $0182, $A201
dw $C004, $F037, $A20C, $C001, $F038, $A206, $C002, $D039
dw $8A14, $0007, $0087, $00EE, $2902, $C907, $D007, $A906
dw $8F04, $F3C7, $C07E, $D022, $A70A, $D000, $A904, $8701
dw $8000, $C0C9, $F025, $C008, $F032, $C004, $D033, $AE11
dw $040C, $20C2, $C6BD, $0785, $8700, $E200, $8220, $00B0
dw $3EC0, $0AD0, $082C, $1003, $A905, $8D02, $0309, $20C0
dw $44D0
; caves
dw $9CCE, $0390, $2F82, $AD03, $02E9, $01C9, $06D0, $72A5
dw $A548, $4873, $01A0, $D8AD, $C902, $D020, $A002, $9802
dw $E48D, $DA02, $D8AC, $D002, $A215, $BD08, $84E2, $0085
dw $E3BD, $8584, $A901, $857E, $B902, $857A, $0087, $0A98
dw $BDAA, $84E2, $0085, $E3BD, $8584, $A901, $857E, $B902
dw $857A, $0230, $0087, $1FC0, $02D0, $5664, $04A9, $4BC0
dw $06F0, $1EC0, $0AD0, $02A9, $790F, $7EF3, $798F, $7EF3
dw $1BC0, $04F0, $1CC0, $07D0, $1B22, $1BEE, $0182, $A201
dw $C004, $F037, $A20C, $C001, $F038, $A206, $C002, $D039
dw $8A14, $0007, $0087, $00EE, $2902, $C907, $D007, $A906
dw $8F04, $F3C7, $C07E, $D022, $A70A, $D000, $A904, $8701
dw $8000, $C0C9, $F025, $C008, $F032, $C004, $D033, $AE11
dw $040C, $20C2, $C6BD, $0785, $8700, $E200, $8220, $00B0
dw $3EC0, $0AD0, $082C, $1003, $A905, $8D02, $0309, $20C0
dw $44D0
}
;--------------------------------------------------------------------------------
BottleListExpanded:
@@ -1031,12 +931,8 @@ Link_ReceiveItemAlternatesExpanded:
db -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ; Free Compass
db -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ; Free Big Key
db -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ; Free Small Key
db -1 ; Bee Trap
db -1 ; Apples
db -1 ; Fairy
db -1 ; Chicken
db -1 ; Big Magic
db -1 ; 5 Arrows
db -1 ; reserved for bee traps
db -1, -1, -1, -1, -1 ; reserved for bonk shuffle
db -1 ; Bomb Upgrade
db -1 ; Cane Upgrade
db -1, -1, -1, -1, -1, -1, -1, -1 ; Unused
@@ -1050,14 +946,7 @@ Link_ReceiveItemAlternatesExpanded:
PHB : PHK : PLB
;TYA : JSR IncrementItemCounters
;LDA Link_ReceiveItemAlternatesExpanded, Y : STA $03
LDA !MULTIWORLD_ITEM_PLAYER_ID : BNE +
TYA
JSR AttemptItemSubstitution
BRA ++
+
TYA
++
STA $03
TYA : JSR AttemptItemSubstitution : STA $03
CPY $03 : BNE + : LDA.b #$FF : STA $03 : +
PLB
RTL
@@ -1065,10 +954,10 @@ RTL
;DrawHUDSilverArrows:
; LDA BowEquipment : AND.w #$00FF : BNE +
; LDA BowTracking : AND.w #$0040 : BEQ +
; LDA.w #$2810 : STA $11C8
; LDA.w #$2811 : STA $11CA
; LDA.w #$2820 : STA $1208
; LDA.w #$2821 : STA $120A
; LDA.w #$2810 : STA $11C8
; LDA.w #$2811 : STA $11CA
; LDA.w #$2820 : STA $1208
; LDA.w #$2821 : STA $120A
; +
; LDA.w #$11CE : STA $00 ; thing we wrote over
;RTL

View File

@@ -115,7 +115,6 @@ ItemSet_MagicBat:
RTL
ItemSet_OldMan:
PHA : LDA OldManItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID : PLA
JSL.l Link_ReceiveItem ; thing we wrote over
PHA : LDA NpcFlags : ORA.b #$01 : STA NpcFlags : PLA
RTL
@@ -126,19 +125,16 @@ ItemSet_ZoraKing:
RTL
ItemSet_SickKid:
PHA : LDA SickKidItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID : PLA
JSL.l Link_ReceiveItem ; thing we wrote over
PHA : LDA NpcFlags : ORA.b #$04 : STA NpcFlags : PLA
RTL
ItemSet_TreeKid:
PHA : LDA TreeKidItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID : PLA
JSL.l Link_ReceiveItem ; thing we wrote over
PHA : LDA NpcFlags : ORA.b #$08 : STA NpcFlags : PLA
RTL
ItemSet_Sahasrala:
PHA : LDA SahasralaItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID : PLA
JSL.l Link_ReceiveItem ; thing we wrote over
PHA : LDA NpcFlags : ORA.b #$10 : STA NpcFlags : PLA
RTL
@@ -150,7 +146,6 @@ ItemSet_Catfish:
RTL
ItemSet_Library:
PHA : LDA LibraryItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID : PLA
JSL.l Link_ReceiveItem ; thing we wrote over
PHA : LDA NpcFlags : ORA.b #$80 : STA NpcFlags : PLA
RTL
@@ -163,7 +158,6 @@ ItemSet_Mushroom:
; if for any reason the item value is 0 reload it, just in case
%GetPossiblyEncryptedItem(MushroomItem, SpriteItemValues) : TAY
+
LDA MushroomItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID
PLA
;LDY.b #$29
STZ $02E9 ; thing we wrote over - the mushroom is an npc for item purposes apparently
@@ -186,19 +180,14 @@ Set300RupeeNPCItem:
CMP.w #291 : BNE +
%GetPossiblyEncryptedItem(RupeeNPC_MoldormCave, SpriteItemValues)
TAY ; load moldorm cave value into Y
LDA RupeeNPC_MoldormCave_Player
BRA .done
+ CMP.w #286 : BNE +
%GetPossiblyEncryptedItem(RupeeNPC_NortheastDarkSwampCave, SpriteItemValues)
TAY ; load northeast dark swamp cave value into Y
LDA RupeeNPC_NortheastDarkSwampCave_Player
BRA .done
+
LDA #$0000
LDY.b #$46 ; default to a normal 300 rupees
.done
SEP #$20
STA !MULTIWORLD_ITEM_PLAYER_ID
PLP : PLA
RTL
;================================================================================

File diff suppressed because it is too large Load Diff

View File

@@ -42,6 +42,80 @@ RTL
LDA.b #$FF ; don't show keys
RTL
;================================================================================
GetCrystalNumber:
PHX
TXA : ASL : TAX
LDA CurrentWorld : EOR.b #$40 : BNE +
INX
+
LDA.l CrystalNumberTable-16, X
PLX
RTL
;================================================================================
OverworldMap_CheckObject:
PHX
;CPX.b #$01 : BNE + : JMP ++ : + : JMP .fail
LDA CurrentWorld : AND.b #$40 : BNE +
;LW Map
LDA.l MapMode : BEQ +++
LDA MapField : ORA MapOverlay : AND.b #$01 : BNE +++
PHX
LDA.l .lw_map_offsets, X : TAX ; put map offset into X
LDA MapField, X : ORA MapOverlay, X
PLX
AND.l .lw_map_masks, X : BNE +++
JMP .fail
+++
LDA.l .lw_offsets, X
BPL +++ : CLC : BRA .done : +++ ; don't display master sword
TAX : BRA ++
+
;DW Map
LDA.l MapMode : BEQ +++
LDA MapField : ORA MapOverlay : AND.b #$02 : BNE +++
PHX
LDA.l .dw_map_offsets, X : TAX ; put map offset into X
LDA.l MapField, X : ORA MapOverlay, X
PLX
AND.l .dw_map_masks, X : BNE +++
JMP .fail
+++
LDA.l .dw_offsets, X
TAX : BRA ++
SEC
PLX
RTL
++
LDA.l CrystalPendantFlags_2, X
AND.b #$40 : BNE .checkCrystal
.checkPendant
LDA PendantsField : AND.l CrystalPendantFlags, X : BNE .fail
CLC : BRA .done
.checkCrystal
LDA CrystalsField : AND.l CrystalPendantFlags, X : BNE .fail
CLC : BRA .done
.fail
SEC
.done
PLX
RTL
.lw_offsets
db $02, $0A, $03, $FF
.dw_offsets
db $06, $08, $0C, $0B, $07, $09, $05
.lw_map_offsets
db $01, $00, $01
; pod skull trock thieves mire ice swamp
.dw_map_offsets
db $01, $00, $00, $00, $01, $00, $01
.lw_map_masks
db $20, $20, $10, $00
.dw_map_masks
db $02, $80, $08, $10, $01, $40, $04
;================================================================================
SetLWDWMap:
PHP
SEP #$20 ; set 8-bit accumulator
@@ -397,18 +471,16 @@ DrawHUDDungeonItems:
.next_map
BIT.w .dungeon_bitmasks,X
BNE ..draw_map
; MapMode indicates if maps are needed for the info
LDA.l MapMode : AND #$00FF : BNE ..skip_map
BEQ ..skip_map
..draw_map
LDY.w .dungeon_positions,X
JSL MapIndicatorLong
LDA.w #$2826
STA.w $1686,Y
..skip_map
; reload
LDA.l MapField
..skip_map
INX : INX
CPX.w #26 : BCC .next_map
@@ -471,60 +543,117 @@ DrawPendantCrystalDiagram:
LDA PendantsField
LSR : BCC + ; pendant of wisdom (red)
LDX.w #$252B
LDX.w #$247D
STX.w $13B6
INX : STX.w $13B8
INX : STX.w $13F6
INX : STX.w $13F8
LDX.w #$E47E
STX.w $13F6
DEX : STX.w $13F8
; LDX.w #$252B
; STX.w $13B6
; INX : STX.w $13B8
; INX : STX.w $13F6
; INX : STX.w $13F8
+ LSR : BCC + ; pendant of power (blue)
LDX.w #$2D2B
LDX.w #$2C7D
STX.w $13AE
INX : STX.w $13B0
INX : STX.w $13EE
INX : STX.w $13F0
LDX.w #$EC7E
STX.w $13EE
DEX : STX.w $13F0
; LDX.w #$2D2B
; STX.w $13AE
; INX : STX.w $13B0
; INX : STX.w $13EE
; INX : STX.w $13F0
+ LSR : BCC + ; pendant of courage (green)
LDX.w #$3D2B
LDX.w #$3C7D
STX.w $1332
INX : STX.w $1334
INX : STX.w $1372
INX : STX.w $1374
LDX.w #$FC7E
STX.w $1372
DEX : STX.w $1374
; LDX.w #$3D2B
; STX.w $1332
; INX : STX.w $1334
; INX : STX.w $1372
; INX : STX.w $1374
+
; ; crystals
; LDA CrystalsField
; LDX.w #$2D44
; LDY.w #$2D45
; BIT.w #$0002 : BEQ + ; crystal 1
; STX.w $14AC
; STY.w $14AE
; + BIT.w #$0010 : BEQ + ; crystal 2
; STX.w $146E
; STY.w $1470
; + BIT.w #$0040 : BEQ + ; crystal 3
; STX.w $14B0
; STY.w $14B2
; + BIT.w #$0020 : BEQ + ; crystal 4
; STX.w $1472
; STY.w $1474
; + BIT.w #$0008 : BEQ + ; crystal 7
; STX.w $14B8
; STY.w $14BA
; +
; LDX.w #$2544
; LDY.w #$2545
; BIT.w #$0004 : BEQ + ; crystal 5
; STX.w $14B4
; STY.w $14B6
; + BIT.w #$0001 : BEQ + ; crystal 6
; STX.w $1476
; STY.w $1478
; +
; crystals
LDA CrystalsField
LDX.w #$2D44
LDY.w #$2D45
BIT.w #$0002 : BEQ + ; crystal 1
STX.w $14AC
STY.w $14AE
LDX.w #$287D
STX.w $1432
LDX.w #$287E
STX.w $1434
+ BIT.w #$0010 : BEQ + ; crystal 2
LDX.w #$287D
STX.w $146E
STY.w $1470
LDX.w #$E87E
STX.w $14AE
+ BIT.w #$0040 : BEQ + ; crystal 3
LDX.w #$287E
STX.w $1470
LDX.w #$E87D
STX.w $14B0
STY.w $14B2
+ BIT.w #$0020 : BEQ + ; crystal 4
LDX.w #$287D
STX.w $1472
STY.w $1474
+ BIT.w #$0008 : BEQ + ; crystal 7
STX.w $14B8
STY.w $14BA
+
LDX.w #$2544
LDY.w #$2545
BIT.w #$0004 : BEQ + ; crystal 5
LDX.w #$E87E
STX.w $14B2
+ BIT.w #$0004 : BEQ + ; crystal 5
LDX.w #$247E
STX.w $1474
LDX.w #$E47D
STX.w $14B4
STY.w $14B6
+ BIT.w #$0001 : BEQ + ; crystal 6
LDX.w #$247D
STX.w $1476
STY.w $1478
LDX.w #$E47E
STX.w $14B6
+ BIT.w #$0008 : BEQ + ; crystal 7
LDX.w #$287E
STX.w $1478
LDX.w #$E87D
STX.w $14B8
+
PLB : PLP

View File

@@ -1,33 +1,33 @@
IsItemAvailable:
JSL CheckInfiniteBombs : BEQ .finite
LDA InfiniteBombsModifier : BEQ .finite
.infinite
CPX.b #$04 : BNE .finite
LDA.b #$01 : RTL
.finite
LDA EquipmentWRAM-1, X
LDA EquipmentWRAM-1, X
RTL
LoadBombCount:
JSL CheckInfiniteBombs : BNE .infinite
LDA InfiniteBombsModifier : BNE .infinite
.finite
LDA BombsEquipment
.infinite
RTL
LoadBombCount16:
JSL CheckInfiniteBombs16 : BNE .infinite
LDA InfiniteBombsModifier : AND.w #$00FF : BNE .infinite
.finite
LDA BombsEquipment
.infinite
RTL
StoreBombCount:
JSL IncrementBombsPlacedCounter
PHA : JSL CheckInfiniteBombs : BEQ .finite
PHA : LDA InfiniteBombsModifier : BEQ .finite
.infinite
PLA : LDA.b #$01 : RTL
.finite
PLA : STA BombsEquipment
RTL
SearchForEquippedItem:
JSL CheckInfiniteBombs : BEQ +
LDA InfiniteBombsModifier : BEQ +
LDA.b #$01 : LDX.b #$00 : RTL
+
LDA BowEquipment ; thing we wrote over

View File

@@ -22,7 +22,6 @@ RTL
.forceHeart
LDA #$33 : STA $C8 ; assure the correct state if player talked to shopkeeper
LDA $0403 : AND.b #$40 : BNE .notHeart
LDA ChestGameItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID
LDA #$07 ; give prize item
RTL
.notHeart

View File

@@ -83,14 +83,69 @@ IcePalaceBombosNE:
%DrawBombosPlatform(14, 18, 1, 0)
RTL
CastleEastEntrance: ; new solution (see Rain Prevention)
CastleEastEntrance:
LDA ProgressIndicator : CMP.b #$02 : !BLT + : RTL : + ; only apply in rain states (0 or 1)
LDA.l BlockCastleDoorsInRain : BNE + : RTL : +
REP #$20 ; 16 A
LDA.w #$08e1 ; square peg
%writeTileAt(11,21,0,1)
%writeTileAt(11,26,0,1)
%writeTileAt(20,21,0,1)
%writeTileAt(20,26,0,1)
INC ;horizontal rail
%writeTileAt(12,21,0,1)
%writeTileAt(13,21,0,1)
%writeTileAt(14,21,0,1)
%writeTileAt(15,21,0,1)
%writeTileAt(16,21,0,1)
%writeTileAt(17,21,0,1)
%writeTileAt(18,21,0,1)
%writeTileAt(19,21,0,1)
INC ;vertical rail
%writeTileAt(11,22,0,1)
%writeTileAt(11,23,0,1)
%writeTileAt(11,24,0,1)
%writeTileAt(11,25,0,1)
%writeTileAt(20,22,0,1)
%writeTileAt(20,23,0,1)
%writeTileAt(20,24,0,1)
%writeTileAt(20,25,0,1)
SEP #$20 ; 8 A
RTL
CastleWestEntrance: ; new solution (see Rain Prevention)
CastleWestEntrance:
LDA ProgressIndicator : CMP.b #$02 : !BLT + : RTL : + ; only apply in rain states (0 or 1)
LDA.l BlockCastleDoorsInRain : BNE + : RTL : +
REP #$20 ; 16 A
LDA.w #$08e1 ; square peg
%writeTileAt(11,21,1,1)
%writeTileAt(11,26,1,1)
%writeTileAt(20,21,1,1)
%writeTileAt(20,26,1,1)
INC ;horizontal rail
%writeTileAt(12,21,1,1)
%writeTileAt(13,21,1,1)
%writeTileAt(14,21,1,1)
%writeTileAt(15,21,1,1)
%writeTileAt(16,21,1,1)
%writeTileAt(17,21,1,1)
%writeTileAt(18,21,1,1)
%writeTileAt(19,21,1,1)
INC ;vertical rail
%writeTileAt(11,22,1,1)
%writeTileAt(11,23,1,1)
%writeTileAt(11,24,1,1)
%writeTileAt(11,25,1,1)
%writeTileAt(20,22,1,1)
%writeTileAt(20,23,1,1)
%writeTileAt(20,24,1,1)
%writeTileAt(20,25,1,1)
SEP #$20 ; 8 A
RTL
RoomCallbackTable:
; 0 1 2 3 4 5 6 7 8 9 A B C D E F
db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $01, $00 ; 00x
db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; 01x
db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; 02x

View File

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

View File

@@ -57,7 +57,6 @@ macro DrawDigit(value,offset)
+
LDA $0E : STA !BIGRAM, X : INX : INX
LDA.w #56 : STA !BIGRAM, X : INX : INX
LDA $A0 : CMP.l #$109 : BNE + : LDA.w #$FFCA : STA !BIGRAM-2, X : +
LDY $0A : TYA : ASL : TAY : LDA.w .digit_properties, Y : STA !BIGRAM, X : INX : INX
LDA.w #$0000 : STA !BIGRAM, X : INX : INX
@@ -67,7 +66,6 @@ endmacro
!COLUMN_LOW = "$7F5022"
!COLUMN_HIGH = "$7F5023"
DrawPrice:
STX $07
PHX : PHY : PHP
LDY.b #$FF
LDX #$00 ; clear bigram pointer
@@ -88,7 +86,7 @@ DrawPrice:
.len1
%DrawDigit(#1,#0)
SEP #$20 ; set 8-bit accumulator
TXA : LSR #3 : STA $06 ; request 1-4 OAM slots
ASL #2
@@ -106,19 +104,15 @@ RTS
;--------------------------------------------------------------------------------
!TILE_UPLOAD_OFFSET_OVERRIDE = "$7F5042"
!FREE_TILE_BUFFER = "#$1180"
!SHOP_ENABLE_COUNT = "$7F504F"
!SHOP_ID = "$7F5050"
!SHOP_TYPE = "$7F5051"
!SHOP_INVENTORY = "$7F5052" ; $7F5056 - 5a - 5e
!SHOP_INVENTORY_PLAYER = "$7F5062"
!SHOP_INVENTORY_DISGUISE = "$7F5065" ; was going to remove this, but this lets more than one bee trap exist with its own icon.
!SHOP_STATE = "$7F5069"
!SHOP_CAPACITY = "$7F506A"
!SCRATCH_TEMP_X = "$7F506B"
!SHOP_SRAM_INDEX = "$7F506C"
!SHOP_MERCHANT = "$7F506D"
!SHOP_DMA_TIMER = "$7F506E"
!SHOP_KEEP_REFILL = "$7F506F"
!SHOP_INVENTORY = "$7F5052" ; $7F505E
!SHOP_STATE = "$7F505F"
!SHOP_CAPACITY = "$7F5060"
!SCRATCH_TEMP_X = "$7F5061"
!SHOP_SRAM_INDEX = "$7F5062"
!SHOP_MERCHANT = "$7F5063"
!SHOP_DMA_TIMER = "$7F5064"
;--------------------------------------------------------------------------------
!NMI_AUX = "$7F5044"
;--------------------------------------------------------------------------------
@@ -128,23 +122,11 @@ dw $0230, $0231, $0202, $0203, $0212, $0213, $0222, $0223, $0232, $0233
.digit_offsets
dw 4, 0, -4, -8
;--------------------------------------------------------------------------------
SpritePrep_ShopKeeper_PotionShop:
JSL SpritePrep_ShopKeeper
LDA.l !SHOP_TYPE : CMP.b #$FF : BNE +
JSL SpritePrep_PotionShopLong
RTL
+ LDX #$0
PHK : PEA.w .jslrtsreturn-1
PEA.w $05f527 ; an rtl address - 1 in Bank05
JML SpawnMagicPowder
.jslrtsreturn
RTL
SpritePrep_ShopKeeper:
PHX : PHY : PHP
REP #$30 ; set 16-bit accumulator & index registers
;LDA $A0
LDX.w #$0000
-
LDA ShopTable+1, X : CMP $A0 : BNE +
@@ -182,37 +164,25 @@ SpritePrep_ShopKeeper:
LDA.l ShopContentsTable+1, X : PHX : TYX : STA.l !SHOP_INVENTORY, X : PLX
LDA.l ShopContentsTable+2, X : PHX : TYX : STA.l !SHOP_INVENTORY+1, X : PLX
LDA.l ShopContentsTable+3, X : PHX : TYX : STA.l !SHOP_INVENTORY+2, X : PLX
LDA.l ShopContentsTable+8, X : PHX : PHA : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA #0 : XBA : TYA : LSR #2 : TAX ; This will convert the value back to the slot number (in 8-bit accumulator mode)
PLA : STA.l !SHOP_INVENTORY_PLAYER, X : LDA #0 : STA.l !SHOP_INVENTORY_DISGUISE, X : PLX
PHY
PHX
LDA.b #$00 : XBA : TYA : LSR #2 : !ADD !SHOP_SRAM_INDEX : TAX
LDA PurchaseCounts, X : TYX : STA.l !SHOP_INVENTORY+3, X : TAY
PLX
LDA.l ShopContentsTable+4, X : BEQ +
LDA.l ShopContentsTable+4, X : BEQ ++
TYA : CMP.l ShopContentsTable+4, X : !BLT ++
PLY
LDA.l ShopContentsTable+5, X : PHX : TYX : STA.l !SHOP_INVENTORY, X : PLX
LDA.l ShopContentsTable+6, X : PHX : TYX : STA.l !SHOP_INVENTORY+1, X : PLX
LDA.l ShopContentsTable+7, X : PHX : TYX : STA.l !SHOP_INVENTORY+2, X : PLX
LDA #$40 : PHX : TYX : STA.l !SHOP_INVENTORY+3, X : PLX
PHX : LDA #0 : XBA : TYA : LSR #2 : TAX ; This will convert the value back to the slot number (in 8-bit accumulator mode)
LDA #0 : STA.l !SHOP_INVENTORY_PLAYER, X : PLX
BRA +++
+ : PLY : LDA #$40 : PHX : TYX : STA.l !SHOP_INVENTORY+3, X : PLX : BRA +++
++
PLY : +++
PHX : PHY
PHX : TYX : LDA.l !SHOP_INVENTORY, X : PLX
CMP #$B0 : BNE +
PHX : LDA #0 : XBA : TYA : LSR #2 : TAX ; This will convert the value back to the slot number (in 8-bit accumulator mode)
JSL GetRandomInt : AND #$3F
BNE ++ : LDA #$49 : ++ : CMP #$26 : BNE ++ : LDA #$6A : ++ ; if 0 (fighter's sword + shield), set to just sword, if filled container (bugged palette), switch to triforce piece
STA.l !SHOP_INVENTORY_DISGUISE, X : PLX
+ : TAY
PHX : TYX : LDA.l !SHOP_INVENTORY, X : PLX : TAY
REP #$20 ; set 16-bit accumulator
LDA 1,s : TAX : LDA.l .tile_offsets, X : TAX
JSR LoadTile
@@ -220,24 +190,24 @@ SpritePrep_ShopKeeper:
INY #4
.next
INX #9
INX #8
JMP -
.stop
LDA $A0 : CMP.b #$FF : BNE .normal
.dumb
LDA $2137
LDA $213F
LDA $213D
CMP.b #60
!BLT .dumb
.normal
LDA #$80 : STA $2100
JSR Shopkeeper_UploadVRAMTiles
LDA #$0F : STA $2100
; LDA.b #Shopkeeper_UploadVRAMTilesLong>>16 : STA !NMI_AUX+2
; LDA.b #Shopkeeper_UploadVRAMTilesLong>>8 : STA !NMI_AUX+1
; LDA.b #Shopkeeper_UploadVRAMTilesLong>>0 : STA !NMI_AUX
;LDA $A0 : CMP.b #$FF : BNE .normal
;.dumb
; LDA $2137
; LDA $213F
; LDA $213D
; CMP.b #60
; !BLT .dumb
;.normal
;LDA #$80 : STA $2100
;JSR Shopkeeper_UploadVRAMTiles
;LDA #$0F : STA $2100
LDA.b #Shopkeeper_UploadVRAMTilesLong>>16 : STA !NMI_AUX+2
LDA.b #Shopkeeper_UploadVRAMTilesLong>>8 : STA !NMI_AUX+1
LDA.b #Shopkeeper_UploadVRAMTilesLong>>0 : STA !NMI_AUX
.done
LDA.l !SHOP_TYPE : BIT.b #$20 : BEQ .notTakeAll ; Take-all
@@ -265,9 +235,7 @@ SpritePrep_ShopKeeper:
PLP : PLY : PLX
LDA.l !SHOP_TYPE : CMP.b #$FF : BNE +
LDA $A0 : CMP.b #$09 : BNE ++
RTL
++ PLA : PLA : PLA
PLA : PLA : PLA
INC $0BA0, X
LDA $0E40, X
JML.l ShopkeeperFinishInit
@@ -394,16 +362,6 @@ Shopkeeper_UploadVRAMTiles:
PLA : STA $4301 ; restore DMA parameters
PLA : STA $4300 ; restore DMA parameters
RTS
;--------------------------------------------------------------------------------
ShopkepeerPotion_CallOriginal:
PLA : PLA : PLA
LDA.b #PotionShopkeeperJumpTable>>16 : PHA
LDA.b #PotionShopkeeperJumpTable>>8 : PHA
LDA.b #PotionShopkeeperJumpTable : PHA
LDA $0E80, X
JML.l UseImplicitRegIndexedLocalJumpTable
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
Shopkepeer_CallOriginal:
PLA : PLA : PLA
@@ -416,31 +374,6 @@ Shopkepeer_CallOriginal:
;!SHOP_TYPE = "$7F5051"
;!SHOP_CAPACITY = "$7F5020"
;!SCRATCH_TEMP_X = "$7F5021"
Sprite_ShopKeeperPotion:
LDA.l !SHOP_TYPE : CMP.b #$FF : BNE + : JMP.w ShopkepeerPotion_CallOriginal : +
TXA : BEQ +
PHK : PEA.w .jslrtsreturn2-1
PEA.w $05f527 ; an rtl address - 1 in Bank05
JML Sprite_MagicPowderItem
.jslrtsreturn2
RTL
+
PHB : PHK : PLB ;; we can just call the default shopkeeper but the potion shopkeeper refills your health
LDA $A0 : CMP.b #$09 : BNE +
JSR.w Shopkeeper_DrawItems
JSR.w Shopkeeper_SetupHitboxes
+
PLB
LDA $0E80, X : BNE +
PHK : PEA.w .jslrtsreturn-1
PEA.w $05f527 ; an rtl address - 1 in Bank05
JML Sprite_WitchAssistant
.jslrtsreturn
+
RTL
Sprite_ShopKeeper:
LDA.l !SHOP_TYPE : CMP.b #$FF : BNE + : JMP.w Shopkepeer_CallOriginal : +
@@ -577,7 +510,6 @@ Shopkeeper_SetupHitboxes:
JSR.w Setup_ShopItemInteractionHitbox
JSL.l Utility_CheckIfHitBoxesOverlapLong : BCC .no_interaction
LDA $02DA : BNE .no_interaction ; defer if link is buying a potion (this is faster than the potion buying speed before potion shop shuffle)
LDA $F6 : AND.b #$80 : BEQ .no_interaction ; check for A-press
LDA $10 : CMP.b #$0C : !BGE .no_interaction ; don't interact in other modes besides game action
JSR.w Shopkeeper_BuyItem
@@ -588,13 +520,12 @@ Shopkeeper_SetupHitboxes:
PLP : PLY : PLX
RTS
;--------------------
;!SHOP_STATE
Shopkeeper_BuyItem:
PHX : PHY
TYX
LDA.l !SHOP_INVENTORY, X
CMP.b #$0E : BEQ .refill ; Bee Refill
CMP.b #$2E : BEQ .refill ; Red Potion Refill
@@ -603,7 +534,6 @@ Shopkeeper_BuyItem:
BRA +
.refill
JSL.l Sprite_GetEmptyBottleIndex : BMI .full_bottles
LDA #$1 : STA !SHOP_KEEP_REFILL ; If this is on, don't toggle bit to remove from shop
+
LDA !SHOP_TYPE : AND.b #$80 : BNE .buy ; don't charge if this is a take-any
@@ -625,22 +555,12 @@ Shopkeeper_BuyItem:
LDA !SHOP_TYPE : AND.b #$80 : BNE ++ ; don't charge if this is a take-any
REP #$20 : LDA CurrentRupees : !SUB !SHOP_INVENTORY+1, X : STA CurrentRupees : SEP #$20 ; Take price away
++
PHX
LDA #0 : XBA : TXA : LSR #2 : TAX : LDA.l !SHOP_INVENTORY_PLAYER, X : STA !MULTIWORLD_ITEM_PLAYER_ID
TXA : !ADD !SHOP_SRAM_INDEX : TAX
LDA.l PurchaseCounts, X : BNE +++ ;Is this the first time buying this slot?
LDA.l EnableShopItemCount, X : STA.l !SHOP_ENABLE_COUNT ; If so, store the permission to count the item here.
+++
PLX
LDA.l !SHOP_INVENTORY, X : TAY : JSL.l Link_ReceiveItem
LDA.l !SHOP_INVENTORY+3, X : INC : STA.l !SHOP_INVENTORY+3, X
LDA.b #0 : STA.l !SHOP_ENABLE_COUNT
TXA : LSR #2 : TAX
LDA !SHOP_TYPE : BIT.b #$80 : BNE +
LDA !SHOP_KEEP_REFILL : BNE +++
LDA.l !SHOP_STATE : ORA.w Shopkeeper_ItemMasks, X : STA.l !SHOP_STATE
+++
LDA.l !SHOP_STATE : ORA.w Shopkeeper_ItemMasks, X : STA.l !SHOP_STATE
PHX
TXA : !ADD !SHOP_SRAM_INDEX : TAX
LDA PurchaseCounts, X : INC : BEQ +++ : STA PurchaseCounts, X : +++
@@ -651,24 +571,17 @@ Shopkeeper_BuyItem:
BIT.b #$20 : BNE .takeAll
.takeAny
LDA.l !SHOP_STATE : ORA.b #$07 : STA.l !SHOP_STATE
PHX
LDA.l !SHOP_SRAM_INDEX : TAX : LDA.b #$01 : STA.l PurchaseCounts, X
LDA.l EnableShopItemCount, X : STA.l !SHOP_ENABLE_COUNT
PLX
PHX : LDA.l !SHOP_SRAM_INDEX : TAX : LDA.b #$01 : STA.l PurchaseCounts, X : PLX
BRA ++
.takeAll
LDA.l !SHOP_STATE : ORA.w Shopkeeper_ItemMasks, X : STA.l !SHOP_STATE
PHX
LDA.l !SHOP_SRAM_INDEX : TAX : LDA.l !SHOP_STATE : STA.l PurchaseCounts, X
LDA.l EnableShopItemCount, X : STA.l !SHOP_ENABLE_COUNT
PLX
PHX : LDA.l !SHOP_SRAM_INDEX : TAX : LDA.l !SHOP_STATE : STA.l PurchaseCounts, X : PLX
++
.done
LDA #$0 : STA !SHOP_KEEP_REFILL
PLY : PLX
RTS
Shopkeeper_ItemMasks:
db #$01, #$02, #$04, #$08
db #$01, #$02, #$04
;--------------------
;!SHOP_ID = "$7F5050"
;!SHOP_SRAM_INDEX = "$7F5062"
@@ -687,7 +600,6 @@ Setup_ShopItemCollisionHitbox:
REP #$20 ; set 16-bit accumulator
PHA : PHY
LDA !SHOP_TYPE : AND.w #$0003 : DEC : ASL : TAY
LDA $A0 : CMP.l #$109 : BNE + : INY #6 : +
LDA.w Shopkeeper_DrawNextItem_item_offsets_idx, Y : STA $00 ; get table from the table table
PLY : PLA
@@ -771,7 +683,6 @@ RTS
;!SHOP_TYPE = "$7F5051"
;!SHOP_INVENTORY = "$7F5052"
!SPRITE_OAM = "$7EC025"
!REDRAW = "$7F5000"
Shopkeeper_DrawItems:
PHB : PHK : PLB
PHX : PHY
@@ -787,14 +698,6 @@ Shopkeeper_DrawItems:
+ CMP.b #$01 : BNE + : ++
JSR.w Shopkeeper_DrawNextItem
+
LDA $A0 : CMP.b #$09 : BNE + ; render powder slot if potion shop
LDA !REDRAW : BNE + ; if not redrawing
LDA $02DA : BNE + ; if not buying item
LDA $7F505E : BEQ + ; if potion slot filled
LDA $0ABF : BEQ + ; haven't left the room
LDA NpcFlags+1 : AND.b #$20 : BNE +
LDX.b #$0C : LDY.b #$03 : JSR.w Shopkeeper_DrawNextItem
+
PLY : PLX
PLB
RTS
@@ -807,7 +710,6 @@ Shopkeeper_DrawNextItem:
LDA !SHOP_TYPE : AND.b #$03 : DEC : ASL : TAY
REP #$20 ; set 16-bit accumulator
LDA $A0 : CMP.l #$109 : BNE + : INY #6 : +
LDA.w .item_offsets_idx, Y : STA $00 ; get table from the table table
LDA 1,s : ASL #2 : TAY ; set Y to the item index
LDA ($00), Y : STA.l !SPRITE_OAM ; load X-coordinate
@@ -820,9 +722,7 @@ Shopkeeper_DrawNextItem:
SEP #$20 ; set 8-bit accumulator
PLY
PHX : LDA #0 : XBA : TXA : LSR #2 : TAX : LDA.l !SHOP_INVENTORY_DISGUISE, X : PLX : CMP #$0 : BNE ++
LDA.l !SHOP_INVENTORY, X ; get item palette
++
LDA.l !SHOP_INVENTORY, X ; get item id
CMP.b #$2E : BNE + : BRA .potion
+ CMP.b #$2F : BNE + : BRA .potion
+ CMP.b #$30 : BEQ .potion
@@ -838,25 +738,14 @@ Shopkeeper_DrawNextItem:
+
XBA
AND #$FE
STA.l !SPRITE_OAM+4
PHX : LDA #0 : XBA : TXA : LSR #2 : TAX : LDA.l !SHOP_INVENTORY_DISGUISE, X : PLX : CMP #$0 : BNE ++
LDA.l !SHOP_INVENTORY, X ; get item palette
++
LDA.l !SHOP_INVENTORY, X ; get item palette
JSL.l GetSpritePalette : STA.l !SPRITE_OAM+5
LDA.w .tile_indices, Y : AND.b #$01 : BEQ +; get tile index sheet
LDA.l !SPRITE_OAM+5
ORA.b #$1
STA.l !SPRITE_OAM+5
+
LDA.b #$00 : STA.l !SPRITE_OAM+6
PHX : LDA #0 : XBA : TXA : LSR #2 : TAX : LDA.l !SHOP_INVENTORY_DISGUISE, X : PLX : CMP #$0 : BNE ++
LDA.l !SHOP_INVENTORY, X ; get item id for narrowness
++
LDA.l !SHOP_INVENTORY, X ; get item palette
JSL.l IsNarrowSprite : BCS .narrow
.full
LDA.b #$02
@@ -872,7 +761,6 @@ Shopkeeper_DrawNextItem:
PHX : PHA : LDA !SCRATCH_TEMP_X : TAX : PLA : JSR.w RequestItemOAM : PLX
LDA !SHOP_TYPE : AND.b #$80 : BNE +
CPX.b #12 : BEQ + ; don't render potion price
JSR.w Shopkeeper_DrawNextPrice
+
@@ -881,14 +769,10 @@ Shopkeeper_DrawNextItem:
INX #4
RTS
;--------------------------------------------------------------------------------
.item_offsets_idx ; 112 60
.item_offsets_idx
dw #.item_offsets_1
dw #.item_offsets_2
dw #.item_offsets_3
.item_offsets_idx_Potion ; 160 176 - (112 64) = (48 112)
dw #.item_offsets_1p
dw #.item_offsets_2p
dw #.item_offsets_3p
.item_offsets_1
dw 8, 40
.item_offsets_2
@@ -898,19 +782,8 @@ dw 32, 40
dw -40, 40
dw 8, 40
dw 56, 40
.item_offsets_1p
dw -40, -72
.item_offsets_2p
dw -64, -72
dw -16, -72
.item_offsets_3p
dw -88, -72
dw -40, -72
dw 8, -72
.potion_offset
dw -16, 0
.tile_indices
db $C6, $C8, $CA, $25 ; last bit is for sheet change
db $C6, $C8, $CA
;--------------------------------------------------------------------------------
!COLUMN_LOW = "$7F5022"
!COLUMN_HIGH = "$7F5023"
@@ -921,7 +794,6 @@ Shopkeeper_DrawNextPrice:
REP #$20 ; set 16-bit accumulator
PHY
LDA !SHOP_TYPE : AND.w #$0003 : DEC : ASL : TAY
LDA $A0 : CMP.l #$109 : BNE + : INY #6 : +
LDA.w Shopkeeper_DrawNextItem_item_offsets_idx, Y : STA $00 ; get table from the table table
LDA.w .price_columns_idx, Y : STA $02 ; get table from the table table
PLY : PHY
@@ -932,7 +804,7 @@ Shopkeeper_DrawNextPrice:
INY : LDA ($02), Y : STA !COLUMN_HIGH
PLY
LDA.l !SHOP_INVENTORY+1, X : STA $0C ; set value
BEQ .free
JSR.w DrawPrice
SEP #$20 : STA $06 : STZ $07 ; set 8-bit accumulator & store result
@@ -942,7 +814,7 @@ Shopkeeper_DrawNextPrice:
LDA.b #$7E : PHA : PLB ; set data bank to $7E
PHX : PHA : LDA !SCRATCH_TEMP_X : TAX : PLA : JSL.l Sprite_DrawMultiple_quantity_preset : PLX
LDA 1,s
ASL #2 : !ADD $90 : STA $90 ; increment oam pointer
PLA
@@ -960,7 +832,7 @@ db #$00, #$FF
.price_columns_2
db #$00, #$80, #$80, $FF
.price_columns_3
db #$00, #$60, #$60, #$90, #$90, $FF, $FF, $FF
db #$00, #$60, #$60, #$90, #$90, $FF
;--------------------------------------------------------------------------------
RequestItemOAM:
PHX : PHY : PHA

View File

@@ -126,8 +126,6 @@ Utility_CheckAncillaOverlapWithSprite:
RTL
.giant_moldorm
LDA $0E10, Y : BNE .ignore_collision ; Moldy can have little a I-Frames, as a treat
LDA $0C4A, X : CMP #$1F : BEQ .check_collision_moldorm ; hookshot
CMP #$05 : BEQ .check_collision_moldorm ; boomerang
LDA.l SpecialWeapons : CMP #$01 : BNE ++
LDA $0C4A, X : CMP #$07 : BEQ .check_collision_moldorm
BRA .ignore_collision ; don't collide with non-bombs
@@ -276,8 +274,7 @@ Utility_CheckHammerHelmasaurKingMask:
RTL
;--------------------------------------------------------------------------------
Utility_CheckImpervious:
LDA $0E20, X : CMP.b #$CE : BEQ .blind
CMP.b #$CB : BNE .normal
LDA $0E20, X : CMP.b #$CB : BNE .normal
.trinexx
LDA SpecialWeapons : CMP #$01 : BEQ +
CMP #$03 : BEQ +
@@ -285,9 +282,6 @@ Utility_CheckImpervious:
CMP #$05 : BEQ +
CMP #$06 : BEQ .check_sidenexx
BRA .normal
.blind
LDA.w $0301 : AND.b #$0A : BNE .impervious ; impervious to hammer
BRA .normal
+
LDA $0301 : AND.b #$0A : BNE .impervious ; impervious to hammer
.check_sidenexx
@@ -338,6 +332,12 @@ Utility_CheckImpervious:
; start with X = sprite index
;--------------------------------------------------------------------------------
AllowBombingMoldorm:
LDA SpecialWeapons : CMP #$01 : BEQ .no_disable_projectiles
CMP #$03 : BEQ .no_disable_projectiles
CMP #$04 : BEQ .no_disable_projectiles
CMP #$05 : BEQ .no_disable_projectiles
CMP #$06 : BEQ .no_disable_projectiles
INC $0BA0, X
.no_disable_projectiles
JSL !SPRITE_INITIALIZED_SEGMENTED
RTL
@@ -422,7 +422,7 @@ BombSpriteColor:
SetBombSpriteColor:
LDA.l SpecialWeapons : CMP.b #$01 : BNE .normal
PHX
LDA.l SpecialWeaponLevel
LDA.l SpecialWeaponLevel
TAX
LDA.l BombSpriteColor, X
STA $0B
@@ -445,7 +445,6 @@ BeeDamageClass:
db $0B, $0C, $0D, $0E, $0F
db $FF, $03, $FF, $FF, $FF
db $FF, $01, $01, $FF, $FF
;--------------------------------------------------------------------------------
CheckDetonateBomb:
LDA.l SpecialWeapons : CMP.b #$01 : BNE .not_bomb_mode
.detonate_bombs
@@ -461,14 +460,7 @@ CheckDetonateBomb:
BPL .check_ancilla
BRA .done
.not_bomb_mode
LDA.l SpecialWeapons : CMP.b #$06 : BEQ .release_bee
CMP.b #$07 : BNE .done
LDA.l HammerEquipment : BEQ .done
LDA.b $3A : ORA.b #$40 : STA.b $3A
LDA.b #$04 : STA.w $0304
JSL Link_UseHammerLong
BRA .done
.release_bee
LDA.l SpecialWeapons : CMP.b #$06 : BNE .done
LDX.w $0202
LDA.l BeeDamageClass, X : CMP.b #$FF : BEQ .nope
JSL $1EDCC9
@@ -476,7 +468,7 @@ CheckDetonateBomb:
LDX.w $0202
LDA.l BeeDamageClass, X
CMP.b #$06 : BNE .set_bee_class
LDA.l $7EF340 : CMP.b #$03 : !BGE .silver_arrows
LDA.l BowEquipment : CMP.b #$03 : !BGE .silver_arrows
LDA.b #$06
BRA .set_bee_class
.silver_arrows
@@ -500,9 +492,9 @@ SetBeeType:
LDA.l SpecialWeapons : CMP.b #$06 : BEQ .bee_mode
LDX.w $0202
.check_bee_type
LDA.l $7EF33F, X
LDA.l EquipmentWRAM-1, X
TAX
LDA.l $7EF35B, X
LDA.l BottleContents-1, X
CMP.b #$08
BNE .regular_bee
LDA.b #$01
@@ -593,13 +585,3 @@ JSL LookupDamageLevel
SEP #$10
PLP : PLX
RTS
;--------------------------------------------------------------------------------
NoSwingHammerB:
LDA.l SpecialWeapons : CMP.b #$07 : BNE .normal
LDA.l HammerEquipment : BEQ .normal
SEC : RTL
.normal ; what we wrote over
INC.b $3C
LDA.b $3C
CMP.b #$09
RTL

View File

@@ -10,7 +10,6 @@ org $1BEE1B
JSL SpriteSwap_Palette_ArmorAndGloves_part_two
RTL
!SPRITE_SWAP = "$7F50CD"
;!STABLE_SCRATCH = "$7EC178"
!BANK_BASE = "#$29"
@@ -18,7 +17,7 @@ org $BF8000
SwapSpriteIfNecessary:
PHP
SEP #$20 ; set 8-bit accumulator
LDA !SPRITE_SWAP : BEQ + : !ADD !BANK_BASE : CMP $BC : BEQ +
LDA SpriteSwapper : BEQ + : !ADD !BANK_BASE : CMP $BC : BEQ +
STA $BC
STZ $0710 ; Set Normal Sprite NMI
JSL.l SpriteSwap_Palette_ArmorAndGloves_part_two
@@ -29,7 +28,7 @@ RTL
SpriteSwap_Palette_ArmorAndGloves:
{
;DEDF9
LDA !SPRITE_SWAP : BNE .continue
LDA SpriteSwapper : BNE .continue
LDA.b #$10 : STA $BC ; Load Original Sprite Location
REP #$21
LDA ArmorEquipment
@@ -37,7 +36,7 @@ SpriteSwap_Palette_ArmorAndGloves:
RTL
.part_two
SEP #$30
LDA !SPRITE_SWAP : BNE .continue
LDA SpriteSwapper : BNE .continue
REP #$30
LDA GloveEquipment
JSL $1BEE21 ; Read Original Palette Code

View File

@@ -53,17 +53,14 @@ endstruct align 2
; This label can be indexed with a plus symbol (e.g. The Hyrule Castle screen would
; be OverworldEventDataWRAM+$1B or OverworldEventDataWRAM+27)
;--------------------------------------------------------------------------------
; - i o t t t b -
; - i o - - - b -
;
; i = Free-standing item collected. Also used for sprites like the castle tower barrier
; o = Overlay active
; b = Bomb wall opened
; t = Tree/Rock/Statue prize collected (Bonk Drop Shuffle)
;--------------------------------------------------------------------------------
OverworldEventDataWRAM = $7EF280
; Temp location
MultiClientFlagsWRAM = $7EF33D
;================================================================================
; Items & Equipment ($7EF340 - $7EF38B)
;--------------------------------------------------------------------------------
@@ -392,7 +389,6 @@ InvertDPadModifier: skip 1
TemporaryOHKO: skip 1
SpriteSwapper: skip 1
BootsModifier: skip 1 ; (0=Off, 1=Always, 2=Never)
GanonVulnerabilityItem: skip 1 ; item ganon is vulnerable to while stunned
;================================================================================
; Expanded SRAM ($7F6000 - $7F6FFF)
@@ -662,6 +658,22 @@ endmacro
%assertSRAM(GTCollectedKeys, $7EF4ED)
%assertSRAM(FileMarker, $7EF4F0)
;--------------------------------------------------------------------------------
%assertSRAM(SwordModifier, $7F50C0)
%assertSRAM(ShieldModifier, $7F50C1)
%assertSRAM(ArmorModifier, $7F50C2)
%assertSRAM(MagicModifier, $7F50C3)
%assertSRAM(LightConeModifier, $7F50C4)
%assertSRAM(CuccoStormModifier, $7F50C5)
%assertSRAM(OldManDashModifier, $7F50C6)
%assertSRAM(IcePhysicsModifier, $7F50C7)
%assertSRAM(InfiniteArrowsModifier, $7F50C8)
%assertSRAM(InfiniteBombsModifier, $7F50C9)
%assertSRAM(InfiniteMagicModifier, $7F50CA)
%assertSRAM(InvertDPadModifier, $7F50CB)
%assertSRAM(TemporaryOHKO, $7F50CC)
%assertSRAM(SpriteSwapper, $7F50CD)
%assertSRAM(BootsModifier, $7F50CE)
;--------------------------------------------------------------------------------
%assertSRAM(ExtendedFileNameWRAM, $7F6000)
%assertSRAM(RoomPotData, $7F6018)
%assertSRAM(SpritePotData, $7F6268)

View File

@@ -51,7 +51,7 @@ DungeonStairsTransition:
JSL Dungeon_SaveRoomQuadrantData
BRA StatTransitionCounter
DungeonExitTransition:
LDA $7F50C7 : BEQ + ; ice physics
LDA IcePhysicsModifier : BEQ + ; ice physics
JSL Player_HaltDashAttackLong
LDA.b #$00 : STA $0301 ; stop item dashing
+
@@ -95,12 +95,9 @@ IncrementSmallKeysNoPrimary:
JSL.l UpdateKeys
LDA $1B : BEQ + ; skip room check if outdoors
PHP : REP #$20 ; set 16-bit accumulator
LDA $048E : CMP.w #$0087 : BNE ++ ; check for hera basement cage
LDA $A8 : AND #$0003 : CMP #$0002 : BNE ++ ; must be quadrant 2
LDA $048E : CMP.w #$0087 : BNE ++ ; hera basement
PLP : PHY : LDY.b #$24 : JSL.l FullInventoryExternal
LDA StandingItemsOn : BNE +++
JSR CountChestKey
+++ PLY : BRA +
JSR CountChestKey : PLY : BRA +
++
PLP
+
@@ -119,7 +116,6 @@ RTL
;--------------------------------------------------------------------------------
CountChestKey: ; called by neighbor functions
PHA : PHX
LDA !MULTIWORLD_ITEM_PLAYER_ID : bne .end
CPY #$24 : BEQ + ; small key for this dungeon - use $040C
CPY #$A0 : !BLT .end ; Ignore most items
CPY #$AE : !BGE .end ; Ignore reserved key and generic key
@@ -215,9 +211,9 @@ RTL
DecrementItemCounter:
PHA
LDA StatsLocked : BNE +
REP #$20
REP #$20
LDA TotalItemCounter : DEC : STA TotalItemCounter
SEP #$20
SEP #$20
+
PLA
RTL

View File

@@ -459,7 +459,6 @@ CreditsLine151:
CreditsLine152:
;GAME STATS
db $0B, $13, $06, $00, $0C, $04, $9F, $12, $13, $00, $13, $12
print "GT Big Key Credit Start: ", pc
CreditsLine153:
;GT BIG KEY $$$$/22
db $02, $37, $63, $70, $9F, $5E, $65, $63, $9F, $67, $61, $75, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $55, $55

View File

@@ -9,61 +9,53 @@ table "creditscharmapbiglo.txt"
YourSpriteCreditsLo:
db 2, 55, " " ; $238020
table "creditscharmapbighi.txt"
CollectionRateHi:
db 2, 55, "COLLECTION RATE /216" ; $23803E, "216" at $238057
table "creditscharmapbiglo.txt"
CollectionRateLo:
db 2, 55, "COLLECTION RATE /216" ; $23805C, "216" at $238075
table "creditscharmapbighi.txt"
FirstSwordStatsHi:
db 2, 55, "FIRST SWORD " ; $23807A
db 2, 55, "FIRST BOMBOS " ; $23803E
table "creditscharmapbiglo.txt"
FirstSwordStatsLo:
db 2, 55, "FIRST SWORD " ; $238098
db 2, 55, "FIRST BOMBOS " ; $23805C
table "creditscharmapbighi.txt"
SwordlessKillsHi:
db 2, 55, "SWORDLESS /13" ; $2380B6
db 2, 55, "BOMBOSLESS /13" ; $23807A
table "creditscharmapbiglo.txt"
SwordlessKillsLo:
db 2, 55, "SWORDLESS /13" ; $2380D4
db 2, 55, "BOMBOSLESS /13" ; $238098
table "creditscharmapbighi.txt"
FighterSwordKillsHi:
db 2, 55, "FIGHTER'S SWORD /13" ; $2380F2
db 2, 55, "FIGHTER'S BOMBOS /13" ; $2380B6
table "creditscharmapbiglo.txt"
FighterSwordKillsLo:
db 2, 55, "FIGHTER'S SWORD /13" ; $238110
db 2, 55, "FIGHTER'S BOMBOS /13" ; $2380D4
table "creditscharmapbighi.txt"
MasterSwordKillsHi:
db 2, 55, "MASTER SWORD /13" ; $23812E
db 2, 55, "MASTER BOMBOS /13" ; $2380F2
table "creditscharmapbiglo.txt"
MasterSwordKillsLo:
db 2, 55, "MASTER SWORD /13" ; $23814C
db 2, 55, "MASTER BOMBOS /13" ; $238110
table "creditscharmapbighi.txt"
TemperedSwordKillsHi:
db 2, 55, "TEMPERED SWORD /13" ; $23816A
db 2, 55, "TEMPERED BOMBOS /13" ; $23812E
table "creditscharmapbiglo.txt"
TemperedSwordKillsLo:
db 2, 55, "TEMPERED SWORD /13" ; $238188
db 2, 55, "TEMPERED BOMBOS /13" ; $23814C
table "creditscharmapbighi.txt"
GoldSwordKillsHi:
db 2, 55, "GOLD SWORD /13" ; $2381A6
db 2, 55, "GOLD BOMBOS /13" ; $23816A
table "creditscharmapbiglo.txt"
GoldSwordKillsLo:
db 2, 55, "GOLD SWORD /13" ; $2381C4
db 2, 55, "GOLD BOMBOS /13" ; $238188
;===================================================================================================
@@ -414,8 +406,6 @@ CreditsLineBlank:
%blankline()
%emptyline()
%emptyline()
%emptyline()
%emptyline()
@@ -478,16 +468,7 @@ CreditsLineBlank:
%blankline()
%blankline()
%smallcredits("OVERWORLD RANDOMIZER", "yellow")
%blankline()
%bigcredits("CODEMANN8 CATOBAT")
%blankline()
%blankline()
%smallcredits("FESTIVE RANDOMIZER", "green")
%smallcredits("FESTIVE RANDOMIZER", "yellow")
%blankline()
@@ -500,7 +481,7 @@ CreditsLineBlank:
%blankline()
%blankline()
%smallcredits("SPRITE DEVELOPMENT", "yellow")
%smallcredits("SPRITE DEVELOPMENT", "green")
%blankline()
@@ -524,9 +505,7 @@ CreditsLineBlank:
%blankline()
%blankline()
%smallcredits("YOUR SPRITE BY", "green")
%blankline()
%smallcredits("YOUR SPRITE BY", "yellow")
%addarbline(YourSpriteCreditsHi)
%addarbline(YourSpriteCreditsLo)
@@ -534,7 +513,7 @@ CreditsLineBlank:
%blankline()
%blankline()
%smallcredits("MSU SUPPORT", "yellow")
%smallcredits("MSU SUPPORT", "green")
%blankline()
@@ -543,7 +522,7 @@ CreditsLineBlank:
%blankline()
%blankline()
%smallcredits("PALETTE SHUFFLER", "green")
%smallcredits("PALETTE SHUFFLER", "yellow")
%blankline()
@@ -608,9 +587,25 @@ CreditsLineBlank:
%bigcredits("HTTPS://ALTTPR.COM/DISCORD")
%blankline()
%emptyline()
%emptyline()
%emptyline()
%emptyline()
%emptyline()
%smallcredits("BOMBOS MOD BY KARAFRUIT", "yellow")
%blankline()
%smallcredits("CREATED FOR SAKURATSUBASA", "green")
%blankline()
%blankline()
%smallcredits("THANKS FOR PLAYING", "red")
%emptyline()
%emptyline()
%emptyline()
@@ -656,15 +651,15 @@ endif
%blankline()
%bigcreditsleft("PEGASUS BOOTS")
%bigcreditsleft("BOMBOS")
%blankline()
%bigcreditsleft("FLUTE")
%bigcreditsleft("BOMBOS")
%blankline()
%bigcreditsleft("MIRROR")
%bigcreditsleft("BOMBOS")
%blankline()
%blankline()
@@ -714,11 +709,11 @@ endif
%blankline()
%bigcreditsleft("BONKS")
%bigcreditsleft("BONKBOS")
%blankline()
%bigcreditsleft("BOMBS PLACED")
%bigcreditsleft("BOMBOS PLACED")
%blankline()
@@ -730,7 +725,7 @@ endif
%blankline()
%bigcreditsleft("FAERIE REVIVALS")
%bigcreditsleft("BOMBOS REVIVALS")
%blankline()
@@ -755,8 +750,7 @@ endif
%emptyline()
%emptyline()
%addarbline(CollectionRateHi)
%addarbline(CollectionRateLo)
%bigcreditsleft("BOMBOS RATE /216")
%blankline()

Binary file not shown.

View File

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

View File

@@ -1,23 +1,22 @@
;(address, type, shiftRight, bits, digits, xPos, lineNumber)
%AddStat(SwordTime, 1, 0, 32, 4, !FIRST_SWORD_X, !FIRST_SWORD_Y)
%AddStat(BootsTime, 1, 0, 32, 4, !PEGASUS_BOOTS_X, !PEGASUS_BOOTS_Y)
%AddStat(FluteTime, 1, 0, 32, 4, !FLUTE_X, !FLUTE_Y)
%AddStat(MirrorTime, 1, 0, 32, 4, !MIRROR_X, !MIRROR_Y)
%AddStat(SwordlessBossKills, 0, 0, 04, 2, !SWORDLESS_X, !SWORDLESS_Y)
%AddStat(SwordBossKills, 0, 4, 04, 2, !FIGHTERS_SWORD_X, !FIGHTERS_SWORD_Y)
%AddStat(SwordBossKills, 0, 0, 04, 2, !MASTER_SWORD_X, !MASTER_SWORD_Y)
%AddStat(SwordBossKills+1, 0, 4, 04, 2, !TEMPERED_SWORD_X, !TEMPERED_SWORD_Y)
%AddStat(SwordBossKills+1, 0, 0, 04, 2, !GOLD_SWORD_X, !GOLD_SWORD_Y)
%AddStat(DamageCounter, 0, 0, 16, 5, !DAMAGETAKEN_X, !DAMAGETAKEN_Y)
%AddStat(MagicCounter, 0, 0, 16, 5, !MAGICUSED_X, !MAGICUSED_Y)
%AddStat(BonkCounter, 0, 0, 08, 3, !BONKS_X, !BONKS_Y)
%AddStat(BombsPlaced, 0, 0, 16, 4, !BOMBS_X, !BOMBS_Y)
%AddStat(SaveQuitCounter, 0, 0, 08, 2, !SAVE_AND_QUITS_X, !SAVE_AND_QUITS_Y)
%AddStat(DeathCounter, 0, 0, 08, 2, !DEATHS_X, !DEATHS_Y)
%AddStat(FaerieRevivalCounter, 0, 0, 08, 3, !FAERIE_REVIVALS_X, !FAERIE_REVIVALS_Y)
%AddStat(MenuFrames, 1, 8, 32, 4, !TOTAL_MENU_TIME_X, !TOTAL_MENU_TIME_Y)
%AddStat($7F5038, 1, 0, 32, 4, !TOTAL_LAG_TIME_X, !TOTAL_LAG_TIME_Y)
print "Colletion Rate config: ", pc
%AddStat(TotalItemCounter, 0, 0, 16, 3, !COLLECTION_RATE_X, !COLLECTION_RATE_Y)
%AddStat(NMIFrames, 1, 0, 32, 4, !TOTAL_TIME_X, !TOTAL_TIME_Y)
;(address, type, shiftRight, bits, digits, xPos, lineNumber)
%AddStat(SwordTime, 1, 0, 32, 4, !FIRST_SWORD_X, !FIRST_SWORD_Y)
%AddStat(BootsTime, 1, 0, 32, 4, !PEGASUS_BOOTS_X, !PEGASUS_BOOTS_Y)
%AddStat(FluteTime, 1, 0, 32, 4, !FLUTE_X, !FLUTE_Y)
%AddStat(MirrorTime, 1, 0, 32, 4, !MIRROR_X, !MIRROR_Y)
%AddStat(SwordlessBossKills, 0, 0, 08, 2, !SWORDLESS_X, !SWORDLESS_Y)
%AddStat(SwordBossKills, 0, 4, 04, 2, !FIGHTERS_SWORD_X, !FIGHTERS_SWORD_Y)
%AddStat(SwordBossKills, 0, 0, 04, 2, !MASTER_SWORD_X, !MASTER_SWORD_Y)
%AddStat(SwordBossKills+1, 0, 4, 04, 2, !TEMPERED_SWORD_X, !TEMPERED_SWORD_Y)
%AddStat(SwordBossKills+1, 0, 0, 04, 2, !GOLD_SWORD_X, !GOLD_SWORD_Y)
%AddStat(DamageCounter, 0, 0, 16, 5, !DAMAGETAKEN_X, !DAMAGETAKEN_Y)
%AddStat(MagicCounter, 0, 0, 16, 5, !MAGICUSED_X, !MAGICUSED_Y)
%AddStat(BonkCounter, 0, 0, 08, 3, !BONKS_X, !BONKS_Y)
%AddStat(BombsPlaced, 0, 0, 16, 4, !BOMBS_X, !BOMBS_Y)
%AddStat(SaveQuitCounter, 0, 0, 08, 2, !SAVE_AND_QUITS_X, !SAVE_AND_QUITS_Y)
%AddStat(DeathCounter, 0, 0, 08, 2, !DEATHS_X, !DEATHS_Y)
%AddStat(FaerieRevivalCounter, 0, 0, 08, 3, !FAERIE_REVIVALS_X, !FAERIE_REVIVALS_Y)
%AddStat(MenuFrames, 1, 8, 32, 4, !TOTAL_MENU_TIME_X, !TOTAL_MENU_TIME_Y)
%AddStat($7F5038, 1, 0, 32, 4, !TOTAL_LAG_TIME_X, !TOTAL_LAG_TIME_Y)
%AddStat(TotalItemCounter, 0, 0, 16, 3, !COLLECTION_RATE_X, !COLLECTION_RATE_Y)
%AddStat(NMIFrames, 1, 0, 32, 4, !TOTAL_TIME_X, !TOTAL_TIME_Y)

View File

@@ -36,10 +36,6 @@ LoadSwordForDamage:
CMP.b #$04 : !BLT + : DEC : + ; if it's gold sword, change it to tempered
RTL
.notMoth
CMP.b #$CE : BNE .notBlind
LDA.b #$01
RTL
.notBlind
JSR.w LoadModifiedSwordLevel ; load normal sword value
RTL
;================================================================================
@@ -69,15 +65,14 @@ LookupDamageLevel:
CMP #$03 : BEQ .bomb_table
CMP #$04 : BEQ .bomb_table
CMP #$05 : BEQ .bomb_table
%LookupDamageSubclass(Damage_Table) : RTL
%LookupDamageSubclass(Damage_Table_Bombos) : RTL
.bomb_table
%LookupDamageSubclass(Damage_Table_Bombs) : RTL
.pseudo_table
%LookupDamageSubclass(Damage_Table_Pseudo) : RTL
;================================================================================
; $7F50C0 - Sword Modifier
LoadModifiedSwordLevel: ; returns short
LDA $7F50C0 : BEQ +
LDA SwordModifier : BEQ +
!ADD SwordEquipment ; add normal sword value to modifier
BNE ++ : LDA.b #$01 : RTS : ++
CMP.b #$05 : !BLT ++ : LDA.b #$04 : RTS : ++
@@ -87,11 +82,10 @@ LoadModifiedSwordLevel: ; returns short
RTS
;================================================================================
; ArmorEquipment - Armor Inventory
; $7F50C2 - Armor Modifier
; $7F5020 - Scratch Space (Caller Preserved)
LoadModifiedArmorLevel:
PHA
LDA ArmorEquipment : !ADD $7F50C2
LDA ArmorEquipment : !ADD ArmorModifier
CMP.b #$FF : BNE + : LDA.b #$00 : +
CMP.b #$03 : !BLT + : LDA.b #$02 : +
STA $7F5020
@@ -100,9 +94,8 @@ LoadModifiedArmorLevel:
RTL
;================================================================================
; MagicConsumption - Magic Inventory
; $7F50C3 - Magic Modifier
LoadModifiedMagicLevel:
LDA $7F50C3 : BEQ +
LDA MagicModifier : BEQ +
!ADD MagicConsumption ; add normal magic value to modifier
CMP.b #$FF : BNE ++ : LDA.b #$00 : RTL : ++
CMP.b #$03 : !BLT ++ : LDA.b #$02 : ++
@@ -112,20 +105,16 @@ LoadModifiedMagicLevel:
RTL
;================================================================================
; $7E0348 - Ice Value
; $7F50C7 - Temporary Ice Modifier
; $30802D - Permanent Ice Modifier ($01 bit)
; ChallengeModes - Permanent Ice Modifier ($01 bit)
LoadModifiedIceFloorValue:
LDA $A0 : CMP #$91 : BEQ + : CMP #$92 : BEQ + : CMP #$93 : BEQ + ; mire basement currently broken - not sure why
LDA $5D : CMP #$01 : BEQ + : CMP #$17 : BEQ + : CMP #$1C : BEQ +
LDA $5E : CMP #$02 : BEQ +
LDA $5B : BNE +
LDA.b $A0 : CMP.b #$29 : BEQ .yes
LDA.w $0308 : BIT #$80 : BNE .yes
LDA.l $30802D : BIT #$01 : BEQ ++
LDA.l ChallengeModes : BIT #$01 : BEQ ++
LDA $A0 : CMP #$16 : BEQ ++ ; swamp supertile with current -- fine for temporary physics but impossible without boots for permanent
.yes
LDA.w $0348 : ORA $7F50C7 : ORA #$10 : RTS
++ : LDA.w $0348 : ORA $7F50C7 : RTS
LDA.w $0348 : ORA IcePhysicsModifier : ORA #$10 : RTS
++ : LDA.w $0348 : ORA IcePhysicsModifier : RTS
+ : LDA.w $0348
RTS
LoadModifiedIceFloorValue_a11:
@@ -166,14 +155,14 @@ RTL
LDA.l GanonVulnerabilityItem : CMP.b #$0C : BEQ +
LDA $0E20, X : CMP.b #$D6 ; original behavior
RTL
+
+
LDA $0E20, X : CMP.b #$D8 : BCC +
RTL
+
CMP.b #$D6 : BNE +
+
CMP.b #$D6 : BNE +
RTL
+
CLC
+
CLC
RTL
;================================================================================
GetSmithSword:
@@ -193,7 +182,6 @@ GetSmithSword:
BRA .done
.buy
LDA SmithItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID
LDA.l SmithItem : TAY
STZ $02E9 ; Item from NPC
PHX : JSL Link_ReceiveItem : PLX

1194
tables.asm

File diff suppressed because it is too large Load Diff

View File

@@ -18,6 +18,7 @@ ItemCheck_BombosTablet:
RTL
;--------------------------------------------------------------------------------
SetTabletItem:
JSL.l GetSpriteID
PHA
LDA $8A : CMP.b #$03 : BEQ .ether ; if we're on the map where ether is, we're the ether tablet
.bombos
@@ -31,7 +32,6 @@ RTL
SpawnTabletItem:
; JSL.l HeartPieceGet
;RTL
JSL.l HeartPieceGetPlayer : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
JSL.l LoadOutdoorValue
PHA
JSL.l PrepDynamicTile

View File

@@ -1,19 +0,0 @@
;================================================================================
; Terrorpin AI Fixes
;================================================================================
FixTerrorpin:
{
PHA ;save A so that checking the option doesn't smoke A
LDA.b Enable_TerrorPin_AI_Fix : BNE .new ; check if option is on
PLA ;restore A
; do the old code that smokes A
AND.b #$03 : STA $0DE0, X
RTL
.new
PLA ; Restore A
PHA ; save A so the orignal code doesn't kill it
AND.b #$03 : STA $0DE0, X ; restore what we overwrote
PLA ; restore A so the AND/BNE in the original code actually does something
RTL
}

View File

@@ -120,28 +120,25 @@ dw #$003C, #$0000
.halfCycle
dw #$FFFF, #$7FFF
;--------------------------------------------------------------------------------
!TEMPORARY_OHKO = "$7F50CC"
DrawChallengeTimer:
LDA.b $A0 : AND.w #$00FF : CMP.w #$00C8 : BEQ .is_ohko
LDA !TEMPORARY_OHKO : AND.w #$00FF : BEQ +
.is_ohko
LDA TemporaryOHKO : AND.w #$00FF : BEQ +
LDA.w #$2807 : STA $7EC790
LDA.w #$280A : STA $7EC792
LDA.w #$280B : STA $7EC794
LDA.w #$280C : STA $7EC796
RTL
+
LDA.w #$247F : STA $7EC790
LDA.w #$247F : STA $7EC790
STA $7EC792
STA $7EC794
STA $7EC796
++
LDA.l TimerStyle : BNE + : RTL : + ; Hud Timer
LDA.w #$2807 : STA $7EC792
LDA.l !Status : AND.w #$0002 : BEQ + ; DNF / OKHO
LDA.w #$2807 : STA $7EC792
LDA.l !Status : AND.w #$0002 : BEQ + ; DNF / OKHO
LDA.l TimeoutBehavior : AND.w #$00FF : BNE ++ ; DNF
LDA.w #$2808 : STA $7EC794
LDA.w #$2809 : STA $7EC796
@@ -162,13 +159,13 @@ DrawChallengeTimer:
LDA.l TimerRestart : BNE +++ : RTL : +++
BRA ++
+ ; Show Timer
LDA.l !Status : AND.w #$0001 : !ADD.w #$2804 : STA $7EC794
LDA.l !Status : AND.w #$0001 : !ADD.w #$2804 : STA $7EC794
LDA !CLOCK_HOURS+2 : STA $7EC796
LDA !CLOCK_HOURS : STA $7EC798
LDA.w #$2806 : STA $7EC79A
LDA.w #$2806 : STA $7EC79A
LDA !CLOCK_MINUTES+2 : STA $7EC79C
LDA !CLOCK_MINUTES : STA $7EC79E
LDA.w #$2806 : STA $7EC7A0
LDA.w #$2806 : STA $7EC7A0
LDA !CLOCK_SECONDS+2 : STA $7EC7A2
LDA !CLOCK_SECONDS : STA $7EC7A4
++
@@ -177,7 +174,6 @@ DrawChallengeTimer:
RTL
;--------------------------------------------------------------------------------
OHKOTimer:
LDA.b $A0 : CMP.b #$C8 : BEQ .kill
LDA TemporaryOHKO : BNE .kill
LDA.l TimeoutBehavior : CMP #$02 : BNE +
LDA !Status : AND.b #$02 : BEQ +

View File

@@ -1,220 +0,0 @@
IFrameData:
db $00, $10, $20
CalcIFrames:
LDA.l ArmorEquipment
PHX : TAX
LDA.l MaximumHealth : LSR #3
CLC : ADC.l IFrameData, X
EOR.b #$FF
CLC : ADC.b #$3E
PLX
STA.w $031F
RTL
SetBombTimer:
JSL GetRandomInt
STA.w $039F, X
RTL
SetDashTimer:
JSL GetRandomInt
AND.b #$1F
STA.w $0374
JSL GetRandomInt
AND.b #$0F
CLC : ADC.w $0374
STA.w $0374
RTL
ProcessFlute:
LDA.b $1B
BNE .play_and_leave ; indoors
LDA.b $10
CMP.b #$0B
BEQ .play_and_leave ; special overworld
JSL GetRandomInt
BIT #$08
BNE .cucco
.normal
LDA.b $8A
AND.b #$40
BNE .play_and_leave ; dark world
JSR PlayDuck
SEC : RTL ; light world; play duck sound and resume normal behavior
.cucco
JSR PlayCluck ; outdoors; play cucco sound
LDA.b #$01
STA.l !CUCCO_STORM ; turn on cucco storm
CLC : RTL ; do not summon duck
.play_and_leave
JSR PlayDuck
CLC : RTL
PlayDuck:
LDA.b #$13
STA.w $0CF8
JSL Sound_SetSfxPanWithPlayerCoords
ORA.w $0CF8
STA.w $012E
RTS
PlayCluck:
LDA.b #$30
STA.w $0CF8
JSL Sound_SetSfxPanWithPlayerCoords
ORA.w $0CF8
STA.w $012E
RTS
FluteMap:
LDA.b #$00
STA.l !CUCCO_STORM ; turn off cuccos
LDA.b #$0E
STA.b $10
RTL
UseShovel:
LDA.b $1B
BEQ .normal
.indoors
REP #$20
LDA.w #$0200
STA.w $03F5
SEP #$20
CLC
RTL
.normal
LDA.l $07A310
STA.b $3D
STZ.w $030D
STZ.w $0300
SEC
RTL
BunnyThrowPot:
LDA.b $A0 : CMP.b #$0D : BNE .throw
LDA.b $A1 : CMP.b #$00 : BEQ .no_throw
.throw
LDA.b #$02
JSL $068156
LDA.b $3B
AND.b #$7F
STA.b $3B
.no_throw
RTL
SwordSwingDelay:
LDA.l SwordEquipment : CMP.b #$02 : !BLT .normal
CMP.b #$FF : BEQ .normal
CPX.b #$04 : BEQ .section_4
CPX.b #$05 : BEQ .section_5
CPX.b #$06 : BNE .normal
.section_6
LDA.l SwordEquipment : CMP.b #$04 : !BGE .normal
BRA .add_one
.section_5
LDA.l SwordEquipment : CMP.b #$02 : !BGE .normal
BRA .add_one
.section_4
LDA.l SwordEquipment : CMP.b #$03 : !BGE .normal
.add_one
LDA.l $079CAF, X
STA.b $3D
INC
RTL
.normal
LDA.l $079CAF, X
STA.b $3D
RTL
MaybeRecoil:
LDA.w $0E20, Y
CMP.b #$09 ; skip recoil on the giant 'dorm
BEQ .done
LDA.l $088E75, X
STA.w $0F40, Y
LDA.l $088E79, X
STA.w $0F30, Y
.done
RTL
MaybeRecoil2:
LDA.w $0E20, X
CMP.b #$09
BEQ .moldorm
LDA.b $00
EOR.b #$FF
INC
STA.w $0F30, X
LDA.b $01
EOR.b #$FF
INC
STA.w $0F40, X
RTL
.moldorm ; skip recoil on the giant 'dorm and unstun
STZ.w $0B58, X
STZ.w $0D90, X
RTL
CheckMoldormRepel:
CMP.b #$09
BNE .not_moldorm
LDA.w $0D90, X
BEQ .repel
LDA.w $0B58, X
BEQ .repel
.no_repel
LDA.b #$01
SEC : RTL
.repel
LDA.b #$00
SEC : RTL
.not_moldorm
CLC : RTL
CheckMushroom:
PHP
SEP #$20
LDA.l InventoryTracking
AND.b #$20
BEQ +
PLP : SEC : RTL
+ PLP : CLC : RTL
AgaDecision:
LDA.b $A0
CMP.b #$20
BNE .aga2
JSL RNG_Agahnim1
AND.b #$04
STA.w $0E30, X
CMP.b #$04
RTL
.aga2
STZ.w $0E30, X
CMP.b #$04
RTL
CheckInfiniteBombs:
LDA.l InfiniteBombsModifier : BNE .yes
LDA.b $A0
CMP.b #$90
BEQ .yes
.no
LDA.b #$00
RTL
.yes
LDA.b #$01
RTL
CheckInfiniteBombs16:
LDA.l InfiniteBombsModifier : AND.w #$00FF : BNE .yes
LDA.b $A0 : AND.w #$00FF
CMP.w #$0090
BEQ .yes
.no
LDA.w #$0000
RTL
.yes
LDA.w #$0001
RTL

View File

@@ -1,128 +0,0 @@
HexToDec4Digit_fast:
LDY.b #$00
-
CMP.w #1000 : !BLT +
INY
SBC.w #1000 : BRA -
+
STY $04
JSR hex_to_dec_fast
RTL
HexToDec_fast:
JSR hex_to_dec_fast
RTL
hex_to_dec_fast:
PHP
REP #$30
ASL : TAX
LDA.l hex_to_dec_fast_table,X
TAY : XBA : AND.w #$000F : STA.b $05
TYA : AND.w #$00F0 : LSR #4 : STA.b $06
TYA : AND.w #$000F : STA.b $07
PLP
RTS
hex_to_dec_fast_table:
dw $000, $001, $002, $003, $004, $005, $006, $007, $008, $009
dw $010, $011, $012, $013, $014, $015, $016, $017, $018, $019
dw $020, $021, $022, $023, $024, $025, $026, $027, $028, $029
dw $030, $031, $032, $033, $034, $035, $036, $037, $038, $039
dw $040, $041, $042, $043, $044, $045, $046, $047, $048, $049
dw $050, $051, $052, $053, $054, $055, $056, $057, $058, $059
dw $060, $061, $062, $063, $064, $065, $066, $067, $068, $069
dw $070, $071, $072, $073, $074, $075, $076, $077, $078, $079
dw $080, $081, $082, $083, $084, $085, $086, $087, $088, $089
dw $090, $091, $092, $093, $094, $095, $096, $097, $098, $099
dw $100, $101, $102, $103, $104, $105, $106, $107, $108, $109
dw $110, $111, $112, $113, $114, $115, $116, $117, $118, $119
dw $120, $121, $122, $123, $124, $125, $126, $127, $128, $129
dw $130, $131, $132, $133, $134, $135, $136, $137, $138, $139
dw $140, $141, $142, $143, $144, $145, $146, $147, $148, $149
dw $150, $151, $152, $153, $154, $155, $156, $157, $158, $159
dw $160, $161, $162, $163, $164, $165, $166, $167, $168, $169
dw $170, $171, $172, $173, $174, $175, $176, $177, $178, $179
dw $180, $181, $182, $183, $184, $185, $186, $187, $188, $189
dw $190, $191, $192, $193, $194, $195, $196, $197, $198, $199
dw $200, $201, $202, $203, $204, $205, $206, $207, $208, $209
dw $210, $211, $212, $213, $214, $215, $216, $217, $218, $219
dw $220, $221, $222, $223, $224, $225, $226, $227, $228, $229
dw $230, $231, $232, $233, $234, $235, $236, $237, $238, $239
dw $240, $241, $242, $243, $244, $245, $246, $247, $248, $249
dw $250, $251, $252, $253, $254, $255, $256, $257, $258, $259
dw $260, $261, $262, $263, $264, $265, $266, $267, $268, $269
dw $270, $271, $272, $273, $274, $275, $276, $277, $278, $279
dw $280, $281, $282, $283, $284, $285, $286, $287, $288, $289
dw $290, $291, $292, $293, $294, $295, $296, $297, $298, $299
dw $300, $301, $302, $303, $304, $305, $306, $307, $308, $309
dw $310, $311, $312, $313, $314, $315, $316, $317, $318, $319
dw $320, $321, $322, $323, $324, $325, $326, $327, $328, $329
dw $330, $331, $332, $333, $334, $335, $336, $337, $338, $339
dw $340, $341, $342, $343, $344, $345, $346, $347, $348, $349
dw $350, $351, $352, $353, $354, $355, $356, $357, $358, $359
dw $360, $361, $362, $363, $364, $365, $366, $367, $368, $369
dw $370, $371, $372, $373, $374, $375, $376, $377, $378, $379
dw $380, $381, $382, $383, $384, $385, $386, $387, $388, $389
dw $390, $391, $392, $393, $394, $395, $396, $397, $398, $399
dw $400, $401, $402, $403, $404, $405, $406, $407, $408, $409
dw $410, $411, $412, $413, $414, $415, $416, $417, $418, $419
dw $420, $421, $422, $423, $424, $425, $426, $427, $428, $429
dw $430, $431, $432, $433, $434, $435, $436, $437, $438, $439
dw $440, $441, $442, $443, $444, $445, $446, $447, $448, $449
dw $450, $451, $452, $453, $454, $455, $456, $457, $458, $459
dw $460, $461, $462, $463, $464, $465, $466, $467, $468, $469
dw $470, $471, $472, $473, $474, $475, $476, $477, $478, $479
dw $480, $481, $482, $483, $484, $485, $486, $487, $488, $489
dw $490, $491, $492, $493, $494, $495, $496, $497, $498, $499
dw $500, $501, $502, $503, $504, $505, $506, $507, $508, $509
dw $510, $511, $512, $513, $514, $515, $516, $517, $518, $519
dw $520, $521, $522, $523, $524, $525, $526, $527, $528, $529
dw $530, $531, $532, $533, $534, $535, $536, $537, $538, $539
dw $540, $541, $542, $543, $544, $545, $546, $547, $548, $549
dw $550, $551, $552, $553, $554, $555, $556, $557, $558, $559
dw $560, $561, $562, $563, $564, $565, $566, $567, $568, $569
dw $570, $571, $572, $573, $574, $575, $576, $577, $578, $579
dw $580, $581, $582, $583, $584, $585, $586, $587, $588, $589
dw $590, $591, $592, $593, $594, $595, $596, $597, $598, $599
dw $600, $601, $602, $603, $604, $605, $606, $607, $608, $609
dw $610, $611, $612, $613, $614, $615, $616, $617, $618, $619
dw $620, $621, $622, $623, $624, $625, $626, $627, $628, $629
dw $630, $631, $632, $633, $634, $635, $636, $637, $638, $639
dw $640, $641, $642, $643, $644, $645, $646, $647, $648, $649
dw $650, $651, $652, $653, $654, $655, $656, $657, $658, $659
dw $660, $661, $662, $663, $664, $665, $666, $667, $668, $669
dw $670, $671, $672, $673, $674, $675, $676, $677, $678, $679
dw $680, $681, $682, $683, $684, $685, $686, $687, $688, $689
dw $690, $691, $692, $693, $694, $695, $696, $697, $698, $699
dw $700, $701, $702, $703, $704, $705, $706, $707, $708, $709
dw $710, $711, $712, $713, $714, $715, $716, $717, $718, $719
dw $720, $721, $722, $723, $724, $725, $726, $727, $728, $729
dw $730, $731, $732, $733, $734, $735, $736, $737, $738, $739
dw $740, $741, $742, $743, $744, $745, $746, $747, $748, $749
dw $750, $751, $752, $753, $754, $755, $756, $757, $758, $759
dw $760, $761, $762, $763, $764, $765, $766, $767, $768, $769
dw $770, $771, $772, $773, $774, $775, $776, $777, $778, $779
dw $780, $781, $782, $783, $784, $785, $786, $787, $788, $789
dw $790, $791, $792, $793, $794, $795, $796, $797, $798, $799
dw $800, $801, $802, $803, $804, $805, $806, $807, $808, $809
dw $810, $811, $812, $813, $814, $815, $816, $817, $818, $819
dw $820, $821, $822, $823, $824, $825, $826, $827, $828, $829
dw $830, $831, $832, $833, $834, $835, $836, $837, $838, $839
dw $840, $841, $842, $843, $844, $845, $846, $847, $848, $849
dw $850, $851, $852, $853, $854, $855, $856, $857, $858, $859
dw $860, $861, $862, $863, $864, $865, $866, $867, $868, $869
dw $870, $871, $872, $873, $874, $875, $876, $877, $878, $879
dw $880, $881, $882, $883, $884, $885, $886, $887, $888, $889
dw $890, $891, $892, $893, $894, $895, $896, $897, $898, $899
dw $900, $901, $902, $903, $904, $905, $906, $907, $908, $909
dw $910, $911, $912, $913, $914, $915, $916, $917, $918, $919
dw $920, $921, $922, $923, $924, $925, $926, $927, $928, $929
dw $930, $931, $932, $933, $934, $935, $936, $937, $938, $939
dw $940, $941, $942, $943, $944, $945, $946, $947, $948, $949
dw $950, $951, $952, $953, $954, $955, $956, $957, $958, $959
dw $960, $961, $962, $963, $964, $965, $966, $967, $968, $969
dw $970, $971, $972, $973, $974, $975, $976, $977, $978, $979
dw $980, $981, $982, $983, $984, $985, $986, $987, $988, $989
dw $990, $991, $992, $993, $994, $995, $996, $997, $998, $999

View File

@@ -6,7 +6,7 @@
; out: A - Sprite GFX ID
;--------------------------------------------------------------------------------
GetSpriteID:
;JSR AttemptItemSubstitution
JSR AttemptItemSubstitution
CMP.b #$16 : BEQ .bottle ; Bottle
CMP.b #$2B : BEQ .bottle ; Red Potion w/bottle
CMP.b #$2C : BEQ .bottle ; Green Potion w/bottle
@@ -20,7 +20,6 @@ GetSpriteID:
BRA .normal
.bottle
PHA : JSR.w CountBottles : CMP.l BottleLimit : !BLT +
LDA !MULTIWORLD_SPRITEITEM_PLAYER_ID : BNE +
PLA : LDA.l BottleLimitReplacement
JMP GetSpriteID
+
@@ -53,21 +52,16 @@ RTL
++ CMP.b #$FB : BNE ++ ; RNG Item (Multi)
JSL.l GetRNGItemMulti : JMP GetSpriteID
++ CMP.b #$FD : BNE ++ ; Progressive Armor
LDA !MULTIWORLD_SPRITEITEM_PLAYER_ID : BNE +
LDA ArmorEquipment : CMP.l ProgressiveArmorLimit : !BLT + ; Progressive Armor Limit
LDA.l ProgressiveArmorReplacement
JMP GetSpriteID
+
LDA.b #$04 : RTL
++ CMP.b #$FE : BNE ++ ; Progressive Sword
LDA !MULTIWORLD_SPRITEITEM_PLAYER_ID : BNE .skipswordlimit
LDA HighestSword
CMP.l ProgressiveSwordLimit : !BLT + ; Progressive Sword Limit
LDA.l ProgressiveSwordReplacement
JMP GetSpriteID
.skipswordlimit : LDA SwordEquipment
+ : CMP.b #$FF : BNE + ; Swordless
LDA.b #$43 : RTL
+ : CMP.b #$00 : BNE + ; No Sword
LDA.b #$43 : RTL
+ : CMP.b #$01 : BNE + ; Fighter Sword
@@ -78,12 +72,10 @@ RTL
LDA.b #$46 : RTL
+
++ : CMP.b #$FF : BNE ++ ; Progressive Shield
LDA !MULTIWORLD_SPRITEITEM_PLAYER_ID : BNE .skipshieldlimit
LDA HighestShield
CMP.l ProgressiveShieldLimit : !BLT + ; Progressive Shield Limit
LDA.l ProgressiveShieldReplacement
JMP GetSpriteID
.skipshieldlimit : LDA.l HighestShield
+ : CMP.b #$00 : BNE + ; No Shield
LDA.b #$2D : RTL
+ : CMP.b #$01 : BNE + ; Fighter Shield
@@ -91,12 +83,10 @@ RTL
+ ; Everything Else
LDA.b #$2E : RTL
++ : CMP.b #$F8 : BNE ++ ; Progressive Bow
LDA !MULTIWORLD_SPRITEITEM_PLAYER_ID : BNE .skipbowlimit
LDA BowEquipment : INC : LSR
CMP.l ProgressiveBowLimit : !BLT +
LDA.l ProgressiveBowReplacement
JMP GetSpriteID
.skipbowlimit : LDA BowEquipment : INC : LSR
+ : CMP.b #$00 : BNE + ; No Bow
LDA.b #$29 : RTL
+ ; Any Bow
@@ -154,12 +144,8 @@ RTL
db $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F ; Free Small Key
;Bx
db $2C ; Bee Trap
db $4A ; Apples
db $4A ; Fairy
db $4A ; Chicken
db $3B ; Big Magic
db $02 ; 5 Arrows
db $49 ; reserved for bee traps
db $13, $13, $13, $13, $13 ; reserved for bonk shuffle
db $13 ; Bomb Upgrade
db $07 ; Cane Upgrade
db $49, $49, $49, $49, $49, $49, $49, $49 ; Unused
@@ -176,7 +162,7 @@ RTL
; out: A - Palette
;--------------------------------------------------------------------------------
GetSpritePalette:
;JSR AttemptItemSubstitution
JSR AttemptItemSubstitution
CMP.b #$16 : BEQ .bottle ; Bottle
CMP.b #$2B : BEQ .bottle ; Red Potion w/bottle
CMP.b #$2C : BEQ .bottle ; Green Potion w/bottle
@@ -301,12 +287,8 @@ RTL
;db $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 ; *EVENT*
db $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 ; Free Big Key
db $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 ; Free Small Key
db $04 ; Bee Trap
db $08 ; Apples
db $08 ; Fairy
db $08 ; Chicken
db $08 ; Big Magic
db $04 ; 5 Arrows
db $08 ; reserved for bee traps
db $08, $08, $08, $08, $08 ; reserved for bonk shuffle
db $F7 ; Bomb Upgrade
db $0A ; Cane Upgrade
db $08, $08, $08, $08, $08, $08, $08, $08 ; Unused
@@ -325,7 +307,7 @@ RTL
IsNarrowSprite:
PHA : PHX
PHB : PHK : PLB
;JSR AttemptItemSubstitution
JSR AttemptItemSubstitution
;--------
CMP.b #$16 : BEQ .bottle ; Bottle
CMP.b #$2B : BEQ .bottle ; Red Potion w/bottle
@@ -400,7 +382,8 @@ RTL
db $15, $18, $24, $2A, $34, $35, $36, $42
db $43, $45, $59, $A0, $A1, $A2, $A3, $A4
db $A5, $A6, $A7, $A8, $A9, $AA, $AB, $AC
db $AD, $AE, $AF, $B4, $B7, $FF, $FF, $FF
db $AD, $AE, $AF, $B7, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
}
;--------------------------------------------------------------------------------
@@ -410,23 +393,9 @@ RTL
;-------------------------------------------------------------------------------- 20/8477
PrepDynamicTile:
PHA : PHX : PHY
TAX : LDA RemoteItems : BEQ +
TXA
CMP !MULTIWORLD_SCOUTREPLY_LOCATION : BNE ++
LDA !MULTIWORLD_SCOUTREPLY_PLAYER : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA !MULTIWORLD_SCOUTREPLY_ITEM
TAX
BRA +
++
STA !MULTIWORLD_SCOUT_LOCATION
LDA #$00 : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDX #$6B
+
TXA
JSR.w LoadDynamicTileOAMTable
JSL.l GetSpriteID ; convert loot id to sprite id
JSL.l GetAnimatedSpriteTile_variable
LDA.b #$00 : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
PLY : PLX : PLA
RTL
;--------------------------------------------------------------------------------
@@ -480,8 +449,6 @@ RTS
!SKIP_EOR = "$7F5008"
;--------------------------------------------------------------------------------
DrawDynamicTile:
JSR PrepDrawRemoteItemSprite
JSL.l IsNarrowSprite : BCS .narrow
.full
@@ -511,8 +478,6 @@ DrawDynamicTile:
RTL
;--------------------------------------------------------------------------------
DrawDynamicTileNoShadow:
JSR PrepDrawRemoteItemSprite
JSL.l IsNarrowSprite : BCS .narrow
.full
@@ -539,31 +504,6 @@ DrawDynamicTileNoShadow:
RTL
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
PrepDrawRemoteItemSprite:
PHA
LDA RemoteItems : BEQ +
PLA
CMP !MULTIWORLD_SCOUTREPLY_LOCATION : BNE ++
LDA !MULTIWORLD_SCOUT_LOCATION : BEQ +++
LDA !MULTIWORLD_SCOUTREPLY_LOCATION
JSL PrepDynamicTile
LDA #$00
BRA ++
+++
LDA !MULTIWORLD_SCOUTREPLY_PLAYER : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA !MULTIWORLD_SCOUTREPLY_ITEM
RTS
++
STA !MULTIWORLD_SCOUT_LOCATION
LDA #$00 : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA #$6B
RTS
+
PLA
RTS
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
!TILE_UPLOAD_OFFSET_OVERRIDE = "$7F5042"
LoadModifiedTileBufferAddress:

View File

@@ -19,7 +19,7 @@ Ganon_CheckAncillaVulnerability:
BRA .not_vulnerable_pla
.silver_arrows
PLA : CMP #$09 : BNE .not_vulnerable
LDA $7EF340 : CMP.b #$03 : !BGE +
LDA BowEquipment : CMP.b #$03 : !BGE +
LDA #$09 : BRA .not_vulnerable
+
BRA .vulnerable
@@ -126,53 +126,6 @@ CheckBeeBoss:
RTL
; return non-zero A if entity is a boss (and bee should not attack)
;--------------------------------------------------------------------------------
StunGanon:
JSL RNG_Ganon
BIT.b #$30
BEQ .non_magic
.magic
AND.b #$0E
LSR
BRA .chosen
.non_magic
AND.b #$0C
LSR #2
ORA.b #$08
.chosen
PHX
TAX
LDA.l Ganon_RandomizeItem, X
STA.l GanonVulnerabilityItem
PLX
JSL DialogItem
LDA.b #$D7
STA.w $0E20, X
RTL
;--------------------------------------------------------------------------------
DialogItem:
PHX : PHY
LDA.l GanonVulnerabilityItem
ASL
TAX
LDA.l Ganon_TextBox+1, X
TAY
LDA.l Ganon_TextBox, X
JSL Sprite_ShowMessageUnconditional
PLY : PLX
RTL
;--------------------------------------------------------------------------------
Ganon_RandomizeItem:
db #$05, #$06, #$07, #$08
db #$09, #$0A, #$11, #$12
db #$01, #$02, #$03, #$0C
;--------------------------------------------------------------------------------
Ganon_TextBox:
dw #$0000 ; default behavior--assume silvers
dw #$0199, #$019A, #$019B, #$019C, #$019D
dw #$019E, #$019F, #$01A0, #$01A1, #$01A2
dw #$0000, #$01A3, #$0000, #$0000, #$0000
dw #$01A4, #$01A5, #$01A6, #$0000, #$0000
;--------------------------------------------------------------------------------
Ganon_CheckByAncilla:
db #$00 ; default behavior--we shouldn't be checking the table here anyway
db #$00, #$05, #$1F, #$07, #$00

BIN
xkas.exe Normal file

Binary file not shown.

View File

@@ -2,7 +2,6 @@
; Randomize Zora King
;--------------------------------------------------------------------------------
LoadZoraKingItemGFX:
LDA.l ZoraItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA.l $1DE1C3 ; location randomizer writes zora item to
JML.l PrepDynamicTile
;--------------------------------------------------------------------------------