From f755a63925d816ec4b6d705dc35638a12bc53a30 Mon Sep 17 00:00:00 2001 From: Karkat Date: Wed, 17 May 2017 13:00:32 -0400 Subject: [PATCH] initial checkin --- 99ff1_bombos.gfx | Bin 0 -> 1283 bytes 99ff1_quake.gfx | Bin 0 -> 1283 bytes LICENSE | 21 - LTTP_RND_GeneralBugfixes.asm | 424 +++++++++ a6fc4_bombos.gfx | Bin 0 -> 1337 bytes a6fc4_ether.gfx | Bin 0 -> 1336 bytes accessability.asm | 12 + bookofmudora.asm | 75 ++ bugfixes.asm | 20 + build.sh | 5 + c2807_v3.gfx | Bin 0 -> 1448 bytes c2e3e.gfx | Bin 0 -> 1310 bytes capacityupgrades.asm | 42 + catfish.asm | 37 + clock.asm | 251 ++++++ compasses.asm | 143 ++++ contrib.asm | 138 +++ crypto.asm | 284 +++++++ darkworldspawn.asm | 63 ++ dialog.asm | 399 +++++++++ dungeondrops.asm | 9 + entrances.asm | 15 + events.asm | 82 ++ externalhooks.asm | 35 + fairyfixes.asm | 26 + flipperkill.asm | 44 + floodgatesoftlock.asm | 13 + flute.asm | 61 ++ framehook.asm | 54 ++ ganonfixes.asm | 16 + glitched.asm | 16 + goalitem.asm | 27 + halfmagicbat.asm | 15 + hardmode.asm | 17 + hashalphabet.asm | 329 +++++++ hashalphabet.chr.gfx | 1 + heartbeep.asm | 12 + heartpieces.asm | 395 +++++++++ hooks.asm | 1555 ++++++++++++++++++++++++++++++++++ hud.asm | 45 + hudpalette.pal | Bin 0 -> 64 bytes init.asm | 27 + inventory.asm | 984 +++++++++++++++++++++ itemdowngrade.asm | 68 ++ lampmantlecone.asm | 33 + license.txt | 7 + maidencrystals.asm | 24 + map.asm | 16 + medallions.asm | 74 ++ newitems.asm | 732 ++++++++++++++++ newitems.gfx | Bin 0 -> 909 bytes npcitems.asm | 172 ++++ openmode.asm | 18 + output.txt | 3 + pendantcrystalhud.asm | 247 ++++++ potions.asm | 77 ++ previewdatacopy.asm | 60 ++ rngfixes.asm | 37 + rupeelimit.asm | 40 + sandbox.asm | 70 ++ scratchpad.asm | 0 seedtag.asm | 34 + shopkeeper.asm | 24 + stats.asm | 380 +++++++++ stats/credits.asm | 930 ++++++++++++++++++++ stats/font.gb | Bin 0 -> 8192 bytes stats/fonttable.bin | 1 + stats/main.asm | 599 +++++++++++++ stats/statConfig.asm | 57 ++ swordswap.asm | 44 + tables.asm | 1097 ++++++++++++++++++++++++ tablets.asm | 135 +++ timer.asm | 168 ++++ translations.asm | 202 +++++ treekid.asm | 9 + utilities.asm | 463 ++++++++++ xkas | Bin 0 -> 88148 bytes zoraking.asm | 8 + 78 files changed, 11500 insertions(+), 21 deletions(-) create mode 100755 99ff1_bombos.gfx create mode 100755 99ff1_quake.gfx delete mode 100644 LICENSE create mode 100644 LTTP_RND_GeneralBugfixes.asm create mode 100755 a6fc4_bombos.gfx create mode 100755 a6fc4_ether.gfx create mode 100644 accessability.asm create mode 100644 bookofmudora.asm create mode 100644 bugfixes.asm create mode 100755 build.sh create mode 100755 c2807_v3.gfx create mode 100644 c2e3e.gfx create mode 100644 capacityupgrades.asm create mode 100644 catfish.asm create mode 100644 clock.asm create mode 100644 compasses.asm create mode 100644 contrib.asm create mode 100644 crypto.asm create mode 100644 darkworldspawn.asm create mode 100644 dialog.asm create mode 100644 dungeondrops.asm create mode 100644 entrances.asm create mode 100644 events.asm create mode 100644 externalhooks.asm create mode 100644 fairyfixes.asm create mode 100644 flipperkill.asm create mode 100644 floodgatesoftlock.asm create mode 100644 flute.asm create mode 100644 framehook.asm create mode 100644 ganonfixes.asm create mode 100644 glitched.asm create mode 100644 goalitem.asm create mode 100644 halfmagicbat.asm create mode 100644 hardmode.asm create mode 100644 hashalphabet.asm create mode 100644 hashalphabet.chr.gfx create mode 100644 heartbeep.asm create mode 100644 heartpieces.asm create mode 100644 hooks.asm create mode 100644 hud.asm create mode 100644 hudpalette.pal create mode 100644 init.asm create mode 100644 inventory.asm create mode 100644 itemdowngrade.asm create mode 100644 lampmantlecone.asm create mode 100644 license.txt create mode 100644 maidencrystals.asm create mode 100644 map.asm create mode 100644 medallions.asm create mode 100755 newitems.asm create mode 100755 newitems.gfx create mode 100644 npcitems.asm create mode 100644 openmode.asm create mode 100644 output.txt create mode 100644 pendantcrystalhud.asm create mode 100644 potions.asm create mode 100644 previewdatacopy.asm create mode 100644 rngfixes.asm create mode 100644 rupeelimit.asm create mode 100644 sandbox.asm create mode 100644 scratchpad.asm create mode 100644 seedtag.asm create mode 100644 shopkeeper.asm create mode 100644 stats.asm create mode 100755 stats/credits.asm create mode 100755 stats/font.gb create mode 100755 stats/fonttable.bin create mode 100755 stats/main.asm create mode 100755 stats/statConfig.asm create mode 100644 swordswap.asm create mode 100644 tables.asm create mode 100644 tablets.asm create mode 100644 timer.asm create mode 100644 translations.asm create mode 100644 treekid.asm create mode 100644 utilities.asm create mode 100755 xkas create mode 100644 zoraking.asm diff --git a/99ff1_bombos.gfx b/99ff1_bombos.gfx new file mode 100755 index 0000000000000000000000000000000000000000..d25f6cb17805c379193f1575244bcc4a93732edd GIT binary patch literal 1283 zcmWNRZ)_8F7{{Mq@3!my*&8L$Wo4~xrD!ngA|xQC9lfE0MW!q`gJmna3=$0^S%jI* z-ZdR;!_Fa?FcMj#kia4^j0QICcEyT)!CX;PBshAtX2lG9B@Jug+Wx#(Px8EYUVOfv z?<4GXOlGX$b5{~nI3r2n{`RUQ zajC4e;Xx2{c(g}&l%CX4parW^OKt-OLTDVafU#u4r1N5*&$<0#pIN2C9eLA7ob6Y3 zT&(|X=)npDp+&T%vqY0v7uxAr)Mu9G9U=F$6*N|@Qeks909F)WsR905b_pf`P|31o zJ6{J35@g`oE6_!v~H4NzmUn{a6mPtG<4j5%g$l@W-S z7^12cn_)S|JU=)0%Pmn{NF@IiA3}YdU1!i%PmOh37e1U#k0vY;!5_3A6s~(ImClaA z<8B&0fB>GOg)Id(&r8vaC}yG(pJxk&yp$26Je&BuFq98TiS9@`(vxUUX%In;jD&?i zx)8&FmDq>J66f!P-$h0c^q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(R-V$maX4PysQQMwHR zzsYVk?A$tYd47IjA)V%D<`)jx4ceM~HEN_)wYdkPRJ-W!X`HSe)rE`pl4_d$!Duog zuL=*0Yk4|N^$;gLvvrL1Kr)kcI{@dfM#JWiPRAu4Q2;rNbLHh;jyUWj3d+k930Xce zOX?X#iwjkMjPO+D(+Ek`AE^*7(E|cmc=mpi{L-N>y~oHh?gd7RA;63LaHsD>&e!Q} zK^kCmX6DFE(z_h>)eM*bo+fb!haXZ>3W2mq2) zm&V(-CnxKBcXdq0+wc86?Qz@OAurO~+!(TuBqW*(7@rr`3s#J?NlCg92JFU8ydA%V koAE(hHn1EOs4dN;pl-v9sr literal 0 HcmV?d00001 diff --git a/LICENSE b/LICENSE deleted file mode 100644 index e5ef632e..00000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 Karkat - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/LTTP_RND_GeneralBugfixes.asm b/LTTP_RND_GeneralBugfixes.asm new file mode 100644 index 00000000..8e7194ea --- /dev/null +++ b/LTTP_RND_GeneralBugfixes.asm @@ -0,0 +1,424 @@ +;================================================================================ +; The Legend of Zelda, A Link to the Past - Randomizer General Development & Bugfixes +;================================================================================ + +lorom + +;================================================================================ + +;org $00FFC0 ; <- 7FC0 - Bank00.asm : 9173 (db "THE LEGEND OF ZELDA " ; 21 bytes) +;db #$23, $4E + +org $00FFD5 ; <- 7FD5 - Bank00.asm : 9175 (db $20 ; rom layout) +;db #$35 ; set fast exhirom +db #$30 ; set fast lorom + +;org $00FFD6 ; <- 7FD6 - Bank00.asm : 9176 (db $02 ; cartridge type) +;db #$55 ; enable S-RTC + +org $00FFD7 ; <- 7FD7 - Bank00.asm : 9177 (db $0A ; rom size) +db #$0B ; mark rom as 16mbit + +org $00FFD8 ; <- 7FD8 - Bank00.asm : 9178 (db $03 ; ram size (sram size)) +db #$07 ; mark sram as 128k + +org $3FFFFF ; <- 1FFFFF +db #$00 ; expand file to 2mb + +;================================================================================ + +!ADD = "CLC : ADC" +!SUB = "SEC : SBC" +!BLT = "BCC" +!BGE = "BCS" + +!NPC_FLAGS = "$7EF410" +!NPC_FLAGS_2 = "$7EF411" +!INVENTORY_SWAP = "$7EF412" +!HUD_FLAG = "$7EF416" ; --h- ---- +!PROGRESSIVE_SHIELD = "$7EF416" ; ss-- ---- +!INVENTORY_SWAP_2 = "$7EF414" +!MAP_ZOOM = "$7EF415" +!HAS_GROVE_ITEM = "$7EF416" ; ---- ---g general flags, don't waste these +!HIGHEST_SWORD_LEVEL = "$7EF417" ; --- -sss +!FRESH_FILE_MARKER = "$7EF4F0" ; zero if fresh file +!SRAM_SINK = "$7EF41E" ; <- change this +;$7EF41A[w] - Programmable Item #1 +;$7EF41C[w] - Programmable Item #3 +;$7EF41E[w] - Programmable Item #3 +;$7EF420 - $7EF44F - Stat Tracking Bank 1 +;$7EF450 - $7EF45F - RNG Item (Single) Flags +;$7EF460 - Goal Item Counter + +!MS_GOT = "$7F5031" +!DARK_WORLD = "$7EF3CA" + +!REDRAW = "$7F5000" +!GANON_WARP_CHAIN = "$7F5032"; + +!FORCE_HEART_SPAWN = "$7F5033"; +!SKIP_HEART_SAVE = "$7F5034"; + +;================================================================================ + +incsrc hooks.asm +incsrc treekid.asm + +;org $208000 ; bank #$20 +org $A08000 ; bank #$A0 +incsrc itemdowngrade.asm +incsrc bugfixes.asm +incsrc darkworldspawn.asm +incsrc lampmantlecone.asm +incsrc floodgatesoftlock.asm +incsrc heartpieces.asm +incsrc npcitems.asm +incsrc utilities.asm +incsrc flipperkill.asm +incsrc previewdatacopy.asm +incsrc pendantcrystalhud.asm +incsrc potions.asm +incsrc shopkeeper.asm +incsrc bookofmudora.asm +incsrc crypto.asm +incsrc tablets.asm +incsrc rupeelimit.asm +incsrc fairyfixes.asm +incsrc rngfixes.asm +incsrc medallions.asm +incsrc inventory.asm +incsrc ganonfixes.asm +incsrc maidencrystals.asm +incsrc zoraking.asm +incsrc catfish.asm +incsrc flute.asm +incsrc dungeondrops.asm +incsrc halfmagicbat.asm +incsrc newitems.asm +incsrc swordswap.asm +incsrc stats.asm +incsrc scratchpad.asm +incsrc map.asm +incsrc dialog.asm +incsrc events.asm +incsrc entrances.asm +incsrc clock.asm +incsrc accessability.asm +incsrc heartbeep.asm +incsrc capacityupgrades.asm +incsrc hud.asm +incsrc timer.asm +incsrc glitched.asm +incsrc hardmode.asm +incsrc goalitem.asm +incsrc compasses.asm +incsrc hashalphabet.asm ; <- TAKE OUT THE EXTRA ORGS IN HERE - THIS IS WHY WE COULDN'T ADD MORE FILES EARLIER +warnpc $A18000 + +incsrc translations.asm + +org $A18000 ; static mapping area +incsrc framehook.asm +warnpc $A19000 + +org $A1FF00 ; static mapping area +incsrc init.asm + +org $A48000 ; code bank - PUT NEW CODE HERE +incsrc openmode.asm + +;org $228000 ; contrib area +org $A28000 ; contrib area +incsrc contrib.asm + +org $A38000 +incsrc stats/main.asm + +;incsrc sandbox.asm + +org $308000 ; bank #$30 +incsrc tables.asm + +org $318000 ; bank #$31 +GFX_Mire_Bombos: +incbin 99ff1_bombos.gfx +warnpc $318800 + +org $318800 +GFX_Mire_Quake: +incbin 99ff1_quake.gfx +warnpc $319000 + +org $319000 +GFX_TRock_Bombos: +incbin a6fc4_bombos.gfx +warnpc $319800 + +org $319800 +GFX_TRock_Ether: +incbin a6fc4_ether.gfx +warnpc $31A000 + +org $31A000 +GFX_HUD_Items: +incbin c2807_v3.gfx +warnpc $31A800 + +org $31A800 +GFX_New_Items: +incbin newitems.gfx +warnpc $31B000 + +org $31B000 +GFX_HUD_Main: +incbin c2e3e.gfx +warnpc $31B800 + +org $31B800 +GFX_Hash_Alphabet: +incbin hashalphabet.chr.gfx +warnpc $31C001 + +org $338000 +GFX_HUD_Palette: +incbin hudpalette.pal +warnpc $348000 + +org $320000 +Extra_Text_Table: + +incsrc externalhooks.asm +;================================================================================ +org $2F8000 ; PC 0x178000 +Static_RNG: +warnpc $2F8400 +;================================================================================ +;bank $3A reserved for downstream use (Plandomizer) +;bank $3B reserved for downstream use (Plandomizer) +;bank $3F reserved for internal debugging +;$7F5700 - $7F57FF reserved for downstream use +;================================================================================ +org $0080DC ; <- 0xDC - Bank00.asm:179 - Kill Music +;db #$A9, #$00, #$EA +;LDA.b #$00 : NOP +;================================================================================ +org $0AC53E ; <- 5453E - Bank0A.asm:1103 - (LDA $0AC51F, X) - i have no idea what this is for anymore +;LDA.b #$7F +;NOP #2 +;================================================================================ +;org $05DF8B ; <- 2DF8B - Bank05.asm : 2483 +;AND.w #$0100 ; allow Sprite_DrawMultiple to access lower half of sprite tiles +;================================================================================ +;org $0DF8F1 ; this is required for the X-indicator in the HUD +; +;;red pendant +;db $2B, $31, $2C, $31, $3D, $31, $2E, $31 +;db $2B, $25, $2C, $25, $2D, $25, $2E, $25 +; +;;blue pendant +;db $2B, $31, $2C, $31, $3D, $31, $2E, $31 +;db $2B, $2D, $2C, $2D, $2D, $2D, $2E, $2D +; +;;green pendant +;db $2B, $31, $2C, $31, $3D, $31, $2E, $31 +;db $2B, $3D, $2C, $3D, $2D, $3D, $2E, $3D +;================================================================================ +;org $00CFF2 ; 0x4FF2 - Mire H +;db GFX_Mire_Bombos>>16 +;org $00D0D1 ; 0x50D1 - Mire M +;db GFX_Mire_Bombos>>8 +;org $00D1B0 ; 0x51B0 - Mire L +;db GFX_Mire_Bombos + +;org $00D020 ; 0x5020 - Trock H +;db GFX_TRock_Bombos>>16 +;org $00D0FF ; 0x50FF - Trock M +;db GFX_TRock_Bombos>>8 +;org $00D1DE ; 0x51DE - Trock L +;db GFX_TRock_Bombos + +org $00D09C ; 0x509C - HUD Items H +db GFX_HUD_Items>>16 +org $00D17B ; 0x517B - HUD Items M +db GFX_HUD_Items>>8 +org $00D25A ; 0x525A - HUD Items L +db GFX_HUD_Items + +; this used to be a pointer to a dummy file +org $00D065 ; 005065 - New Items H +db GFX_New_Items>>16 +org $00D144 ; 005114 - New Items M +db GFX_New_Items>>8 +org $00D223 ; 005223 - New Items L +db GFX_New_Items + +org $00D09D ; 0x509D - HUD Main H +db GFX_HUD_Main>>16 +org $00D17C ; 0x517C - HUD Main M +db GFX_HUD_Main>>8 +org $00D25B ; 0x525B - HUD Main L +db GFX_HUD_Main +;================================================================================ +org $008333 +Vram_EraseTilemaps_triforce: + +org $00893D +EnableForceBlank: + +org $00D308 +DecompSwordGfx: + +org $00D348 +DecompShieldGfx: + +org $00D51B +GetAnimatedSpriteTile: + +org $00D52D +GetAnimatedSpriteTile_variable: + +org $00E529 +LoadSelectScreenGfx: + +org $00F945 +PrepDungeonExit: + +org $00FDEE +Mirror_InitHdmaSettings: + +org $01873A +Dungeon_LoadRoom: + +org $02A0A8 +Dungeon_SaveRoomData: + +org $02A0BE +Dungeon_SaveRoomData_justKeys: + +org $02B861 +Dungeon_SaveRoomQuadrantData: + +org $05A51D +Sprite_SpawnFallingItem: + +org $05DF6C ; 02DF6C - Bank05.asm : 2445 +Sprite_DrawMultiple: + +org $05DF70 ; 02DF70 - Bank05.asm : 2454 +Sprite_DrawMultiple_quantity_preset: + +org $05DF75 ; 02DF75 - Bank05.asm : 2461 +Sprite_DrawMultiple_player_deferred: + +org $05E1A7 ; 02E1A7 - Bank05.asm : 2592 +Sprite_ShowSolicitedMessageIfPlayerFacing: + +org $05E219 +Sprite_ShowMessageUnconditional: + +org $05FA8E +Sprite_ShowMessageMinimal: + +org $06DC5C +Sprite_DrawShadowLong: + +org $06DD40 +DashKey_Draw: + +org $06DBF8 +Sprite_PrepAndDrawSingleLargeLong: + +org $06DC00 +Sprite_PrepAndDrawSingleSmallLong: + +org $06EAA6 +Sprite_DirectionToFacePlayer: + +org $06F12F +Sprite_CheckDamageToPlayerSameLayerLong: + +org $07999D +Link_ReceiveItem: + +org $07E68F +Unknown_Method_0: ; In US version disassembly simply called "$3E6A6 IN ROM" + +org $07F4AA +Sprite_CheckIfPlayerPreoccupied: + +org $08C3AE +Ancilla_ReceiveItem: + +org $08F710 +Ancilla_SetOam_XY_Long: + +org $0985E2 ; (break on $0985E4) +AddReceivedItem: + +org $0993DF +AddDashTremor: + +org $09AD58 +GiveRupeeGift: + +org $1CFD69 +Main_ShowTextMessage: + +org $0DBA71 +GetRandomInt: + +org $0DBA80 +OAM_AllocateFromRegionA: +org $0DBA84 +OAM_AllocateFromRegionB: +org $0DBA88 +OAM_AllocateFromRegionC: +org $0DBA8C +OAM_AllocateFromRegionD: +org $0DBA90 +OAM_AllocateFromRegionE: +org $0DBA94 +OAM_AllocateFromRegionF: + +org $0DBB67 +Sound_SetSfxPanWithPlayerCoords: + +org $0DBB8A +Sound_SetSfx3PanLong: + +org $0DDB7F +HUD_RefreshIconLong: + +org $0DE01E ; 6E10E - equipment.asm : 787 +BottleMenu_movingOn: + +org $0DE346 +RestoreNormalMenu: + +org $0DE9C8 +DrawProgressIcons: ; this returns short + +org $0DED29 +DrawEquipment: ; this returns short + +org $0EEE10 +Messaging_Text: + +org $1BED03 +Palette_Sword: + +org $1BED29 +Palette_Shield: + +org $1BEDF9 +Palette_ArmorAndGloves: + +org $1BEE52 +Palette_Hud: + +org $1DF65D +Sprite_SpawnDynamically: + +org $1DFD4B +DiggingGameGuy_AttemptPrizeSpawn: +;================================================================================ \ No newline at end of file diff --git a/a6fc4_bombos.gfx b/a6fc4_bombos.gfx new file mode 100755 index 0000000000000000000000000000000000000000..38db80944e2c1f632c11a65b0e50f96477134449 GIT binary patch literal 1337 zcmWNQZ%h++7{{OMAFfF4f&Zwq@WU3t8Rx1PhthDJ1%&C=xfdoz7t1s>%a&P3GP>Du z=c>RmoG)CWnMv!5EpARHdoyuHdZZ4W31OX;T;o9BSMvU#|3t~gDoNq$H#@3=nDoyF4js;G7c!_ zc|nxqm*t)JTmNml5<0_;vMB;URe-qaf#rt1`GckD^8w#zH0pL2IXlf(S4$!ol%3# z_oaSjpl-sBFjNx@$JGA*I=d5W2#h2mAv~X#mjy(Sh{$CT&iRKt+lRIp7TaRnIR3TW>t-~|sqM2ipv76|P39P$T)87CUz zv6BbI`6+MJ|VBw|b&?K^K@+Vkni@RLV`Fxw~EHY|S;@{-&+zrbO4 zmrmy)o@1wV`AN%kW&5ex;nK6ayWnK(?v{C(L*W^6d^;D}K|K#u*l=MleAl@D92NIC3|eWQ zTk*K$Ny%fAl>gK=wf64%yW`^zQxoF@10(Je;o;ED&_AK%z7spYI;ht>Xq~g#<~8u>*Q0{;d4QhqVT4qZpYlquUO;;u@ znyUId%}O6&6*5hIJNn-4JJR>o*Y#iC-*~IWNn49;i|O9Px56di`tM)-jcE)c*o&8d z@z|eGk6^MO$&nc{M;u_V5L;1^@50_H!z*)yy0*8nC~x^E{?oy0A@B9DG1@U$Coz#0 zN~fo&de9XZpg_NjUdQYsSNk1kQF7^tMua$<+>d_A@09~Z^R3`1C&X%9DH7R)FzWKA zti~rr2*k7+3fh#e5JK8KV>$epmldF=lL6yG$3o-6?uLa%-PJ~Pg0ql@i_eA#Lcmb|WR1~Cafz!^ zcZY**#vv~-fk?9QLW3g6d?Q1`dP@m&f*Xn=Axn0ng9<9Uu58z_>pkAPC!ajeoA2}e zum~ERWio7v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yO$FzAK_g_OU#2RQ>*;`Xt%I)&2FHVa*DSiE^+&T=c`NGWWE N1H8xnqE4=(@qhdmSP1|C literal 0 HcmV?d00001 diff --git a/accessability.asm b/accessability.asm new file mode 100644 index 00000000..9bc46abd --- /dev/null +++ b/accessability.asm @@ -0,0 +1,12 @@ +;================================================================================ +; Accessability Fixes +;================================================================================ +FlipGreenPendant: + LDA $0C : CMP #$38 : BNE + ; check if we have green pendant + ORA #$40 : STA $0C ; flip it + + + + LDA $0D : STA $0802, X ; stuff we wrote over "Set CHR, palette, and priority of the sprite" + LDA $0C : STA $0803, X +RTL +;================================================================================ \ No newline at end of file diff --git a/bookofmudora.asm b/bookofmudora.asm new file mode 100644 index 00000000..2af234bc --- /dev/null +++ b/bookofmudora.asm @@ -0,0 +1,75 @@ +;================================================================================ +; Randomize Book of Mudora +;-------------------------------------------------------------------------------- +LoadLibraryItemGFX: + LDA.l LibraryItem + JSL.l PrepDynamicTile +RTL +;-------------------------------------------------------------------------------- +DrawLibraryItemGFX: + PHA + LDA.l LibraryItem + JSL.l DrawDynamicTile + PLA +RTL +;-------------------------------------------------------------------------------- +SetLibraryItem: + PHA + LDA LibraryItem : TAY + PLA + JSL.l ItemSet_Library ; contains thing we wrote over +RTL +;-------------------------------------------------------------------------------- + +;0x0087 - Hera Room w/key +;================================================================================ +; Randomize Bonk Keys +;-------------------------------------------------------------------------------- +!REDRAW = "$7F5000" +;-------------------------------------------------------------------------------- +LoadBonkItemGFX: + LDA.b #$08 : STA $0F50, X ; thing we wrote over +LoadBonkItemGFX_inner: + LDA.b #$00 : STA !REDRAW + JSR LoadBonkItem + JSL.l PrepDynamicTile +RTL +;-------------------------------------------------------------------------------- +DrawBonkItemGFX: + PHA + LDA !REDRAW : BEQ .skipInit ; skip init if already ready + JSL.l LoadBonkItemGFX_inner + BRA .done ; don't draw on the init frame + + .skipInit + + JSR LoadBonkItem + JSL.l DrawDynamicTile + + .done + PLA +RTL +;-------------------------------------------------------------------------------- +GiveBonkItem: + JSR LoadBonkItem + CMP #$24 : BNE .notKey + .key + LDA $7EF36F : INC A : STA $7EF36F + LDA.b #$2F : JSL.l Sound_SetSfx3PanLong +RTL + .notKey + PHY : TAY : JSL.l Link_ReceiveItem : PLY +RTL +;-------------------------------------------------------------------------------- +LoadBonkItem: + LDA $A0 ; check room ID - only bonk keys in 2 rooms so we're just checking the lower byte + CMP #115 : BNE + ; Desert Bonk Key + LDA.l BonkKey_Desert + BRA ++ + + : CMP #140 : BNE + ; GTower Bonk Key + LDA.l BonkKey_GTower + BRA ++ + + + LDA.b #$24 ; default to small key + ++ +RTS \ No newline at end of file diff --git a/bugfixes.asm b/bugfixes.asm new file mode 100644 index 00000000..a5e53196 --- /dev/null +++ b/bugfixes.asm @@ -0,0 +1,20 @@ +;================================================================================ + +;-------------------------------------------------------------------------------- +AssignKiki: + LDA.b #$00 : STA $7EF3D3 ; defuse bomb + LDA.b #$0A : STA $7EF3CC ; assign kiki as follower +RTL +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; Name: AllowSQ +; Returns: Accumulator = 0 if S&Q is disallowed, 1 if allowed +;-------------------------------------------------------------------------------- +!ITEM_BUSY = "$7F5091" +AllowSQ: + LDA $7EF3C5 : BEQ .done ; thing we overwrote - check if link is in his bed + LDA !ITEM_BUSY : EOR #$01 + .done +RTL +;-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100755 index 00000000..fe7d050e --- /dev/null +++ b/build.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +rm ../working.sfc +cp ../alttp.sfc ../working.sfc +./xkas LTTP_RND_GeneralBugfixes.asm ../working.sfc diff --git a/c2807_v3.gfx b/c2807_v3.gfx new file mode 100755 index 0000000000000000000000000000000000000000..7bad55170f2a4c3d0b3a185740c81d3a9d905770 GIT binary patch literal 1448 zcmWktYitx%6uxt3@9g#=YfBSrKw7sC#Kb_d95N$c`q#zTl}=^rfXa9rmKtSUCKgM%9roSMbr1>Dye2| zU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IO$hEGCYm(+xH0(e%l?w{(W#SWB6`!cp$5a0*VRrd4UZ zL)yl#fAWpQo*x+S5RqSQWdkqw3mvVk4TNI@{rwI9Uoy*N}1Y3R; zhMYT_bH=^iy&3j+EmM96(`KqTO^cHa&ao99Y(Ylef+Vt_u+yu6l5tVLR7eyv_!ZFt zkdnva=kHK#Sr?FvYU_{=zRo!!ec@eGtK)67(;S=)AiJAj*D!-05yF1DVs2E*w9IGm z8b;BL=V;tf)^6&^V2T39`!IryOy~?(3)Vzlg2tv13tnLDG%UKorABtBi?ff@A~7+8 zdV>$xG6tK6b(aL^;2AF1#w$&XsKRE@&fPGEbB4ONf>jnVLK~VX!!h*KflNtIiP8jS zcVI2ZfeD@^bi2ieukm~e3X;^XR1y#2sQfvRw=#k=M2KYvos&0lX>W5uOB_wL=$@m1G4X}G7sTn#5Yj0F*dRhByy2&1~F;F_%yih4LTMs@8Se3~Pgm`ZcsPY$WU7dh6O zbBczQn_E1wCe+5+jkpmpoF%Jy7&x>R=g0^35Wd9c_zYiQ8$BO|AL}T?qxB%yC49@C z!}WTIQHWkBcH#jqVH@5FW-N6Ox^V@sVjA7y2rCvK>X5SFR<87}61~mU@(bn(ZOG?) zbUYs~W$9Fz5{l*6UP$TDEY*N4!Rw%U_}4J!?;DedVAu`oLoDP>*sFbZ+7Z mUZJCYvmTBj{RsYkbZ0jC*AEjHF7NBLlqvG&;nh to [002801h] +; If ([002800h] AND 0F)=0Fh then read +; If ([002800h] AND 0F)=0Fh then read +; If ([002800h] AND 0F)=0Fh then read +; If ([002800h] AND 0F)=0Fh then read +; etc. +; The exact meaning of the bytes is unknown. 0Eh/0Dh seems to invoke/terminate commands, 04h might be some configuration stuff (like setting 24-hour mode). 00h is apparently the set-time command. There might be further commands (such like setting interrupts, alarm, 12-hour mode, reading battery low & error flags, etc.). When reading, 0Fh seems to indicate sth like "time available". +; The 12/13-digit "SSMMHHDDMYYY(D)" Timestamps are having the following format: +; Seconds.lo (BCD, 0..9) +; Seconds.hi (BCD, 0..5) +; Minutes.lo (BCD, 0..9) +; Minutes.hi (BCD, 0..5) +; Hours.lo (BCD, 0..9) +; Hours.hi (BCD, 0..2) +; Day.lo (BCD, 0..9) +; Day.hi (BCD, 0..3) +; Month (HEX, 01h..0Ch) +; Year.lo (BCD, 0..9) +; Year.hi (BCD, 0..9) +; Century (HEX, 09h..0Ah for 19xx..20xx) +; When READING the time, there is one final extra digit (the existing software doesn't transmit that extra digit on WRITING, though maybe it's possible to do writing, too): +; Day of Week? (0..6) (unknown if RTC assigns sth like 0=Sunday or 0=Monday) +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +macro A_x10() + ASL #1 : PHA + ASL #2 : !ADD 1,s + STA 1,s : PLA +endmacro +;-------------------------------------------------------------------------------- +macro A_x24() + ASL #3 : PHA + ASL #1 : !ADD 1,s + STA 1,s : PLA +endmacro +;-------------------------------------------------------------------------------- +macro A_x60() + ASL #2 : PHA + ASL #4 : !SUB 1,s + STA 1,s : PLA +endmacro +;-------------------------------------------------------------------------------- +macro Clock_ReadBCD() + LDA $002800 : PHA + LDA $002800 : %A_x10() : !ADD 1,s + STA 1,s : PLA +endmacro +;-------------------------------------------------------------------------------- + +Clock_Test: + LDA $FFFFFF + JSL.l Clock_Init + JSL.l Clock_IsSupported +RTL + +;-------------------------------------------------------------------------------- +; Clock_Init +;-------------------------------------------------------------------------------- +Clock_Init: + LDA.b #$0E : STA $002801 + LDA.b #$04 : STA $002801 + LDA.b #$0D : STA $002801 + LDA.b #$0E : STA $002801 + LDA.b #$00 : STA $002801 + + LDA.b #$00 : STA $002801 + LDA.b #$00 : STA $002801 + LDA.b #$00 : STA $002801 + LDA.b #$00 : STA $002801 + LDA.b #$00 : STA $002801 + LDA.b #$00 : STA $002801 + LDA.b #$01 : STA $002801 + LDA.b #$00 : STA $002801 + LDA.b #$01 : STA $002801 + LDA.b #$00 : STA $002801 + LDA.b #$00 : STA $002801 + LDA.b #$0A : STA $002801 + + LDA.b #$0D : STA $002801 +RTL +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; Clock_IsSupported +;-------------------------------------------------------------------------------- +; Input: None (8-bit accumulator) +;-------------------------------------------------------------------------------- +; Output: +; Carry - unset if unsupported, set if supported +; Zero - Undefined +;-------------------------------------------------------------------------------- +; Side Effects: +; S-RTC is ready for reading upon exit if supported +;-------------------------------------------------------------------------------- +Clock_IsSupported: + PHA : PHX + LDX #$00; + - + LDA $002800 : AND.b #$0F : CMP #$0F : BEQ + ; check for clock chip ready signal + CPX.b #$0E : !BLT ++ : CLC : BRA .done : ++ ; if we've read 14 bytes with no success, unset carry and exit + INX + BRA - : + + SEC ; found a clock chip + .done + PLX : PLA +RTL +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; Clock_QuickStamp +;-------------------------------------------------------------------------------- +; Input: None +;-------------------------------------------------------------------------------- +; Output: +; $00.b - 24-bit timestamp (low) +; $01.b - 24-bit timestamp (mid) +; $02.b - 24-bit timestamp (high) +; $03.b - zero +; Carry - Unset if error, Set if success +; Zero - Undefined +;-------------------------------------------------------------------------------- +; Side Effects: +; Requires Mode-7 Matrix Registers +;-------------------------------------------------------------------------------- +Clock_QuickStamp: + PHA : PHX : PHP + SEP #$30 ; set 8-bit accumulator and index registers + LDX #$00; + - + LDA $002800 : AND.b #$0F : CMP #$0F : BEQ .ready ; check for clock chip ready signal + CPX.b #$0E : !BLT ++ : CLC : BRL .done : ++ ; if we've read 14 bytes with no success, unset carry and exit + INX + BRA - + SEC ; indicate success + + .ready + %Clock_ReadBCD() : STA $00 ; seconds + %Clock_ReadBCD() : STA $01 ; minutes + %Clock_ReadBCD() : STA $02 ; hours + %Clock_ReadBCD() : STA $03 ; days + + REP $20 ; set 16-bit accumulator + LDA $01 : AND #$00FF : %A_x60() ; convert minutes to seconds + STZ $01 : !ADD $00 : STA $00 ; store running total seconds to $00 + + LDA $03 : AND #$00FF : %A_x24() ; convert days to hours + STZ $03 : !ADD $02 ; get total hours + %A_x60() ; get total minutes + + LDY #$60 + JSL.l Multiply_A16Y8 + STY $02 : STZ $03 + !ADD $00 : BCC + : INC $02 : + + + .done + PLP : PLX : PLA +RTL +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; Multiply_A16Y8: +;-------------------------------------------------------------------------------- +; Expects: +; Accumulator - 16-bit +; Index Registers - 8-bit +;-------------------------------------------------------------------------------- +; Notes: +; Found a (wrong) version of this on wikibooks. This is cleaned up and fixed. +;-------------------------------------------------------------------------------- +Multiply_A16Y8: + SEP #$20 ; set 8-bit accumulator + STY $4202 + STA $4203 + NOP #4 + LDA $4216 + LDY $4217 + XBA + STA $4203 + NOP #2 + TYA + CLC + ADC $4216 + LDY $4217 + BCC carry_bit + INY + carry_bit: + XBA + REP #$20 ; set 16-bit accumulator +RTL +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; Clock_GetTime +;-------------------------------------------------------------------------------- +; Input: None +;-------------------------------------------------------------------------------- +; Output: +; $00.b - Seconds +; $01.b - Minutes +; $02.b - Hours +; $03.b - Days +; $04.b - Months +; $05.w - Years +; Carry - Unset if error, Set if success +; Zero - Undefined +;-------------------------------------------------------------------------------- +Clock_GetTime: + PHA : PHX : PHY : PHP + SEP #$30 ; set 8-bit accumulator and index registers + LDX #$00; + - + LDA $002800 : AND.b #$0F : CMP #$0F : BEQ .ready ; check for clock chip ready signal + CPX.b #$0E : !BLT ++ : CLC : BRL .done : ++ ; if we've read 14 bytes with no success, unset carry and exit + INX + BRA - + SEC ; indicate success + + .ready + %Clock_ReadBCD() : STA $00 ; seconds + %Clock_ReadBCD() : STA $01 ; minutes + %Clock_ReadBCD() : STA $02 ; hours + %Clock_ReadBCD() : STA $03 ; days + LDA $002800 : STA $04 ; months + %Clock_ReadBCD() : STA $05 ; years + LDA $002800 : STA $06 ; century + + REP $20 ; set 16-bit accumulator + STA $06 : AND #$00FF : %A_x10() : %A_x10() : !ADD #1000 ; multiply century digit by 100 and add 1000 + STZ $06 : !ADD $05 : STA $05 ; add lower 2 digits of the year and store + + .done + PLP : PLY : PLX : PLA +RTL +;-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/compasses.asm b/compasses.asm new file mode 100644 index 00000000..c6b85470 --- /dev/null +++ b/compasses.asm @@ -0,0 +1,143 @@ +;-------------------------------------------------------------------------------- +; $7F5010 - Scratch Space (Callee Preserved) +;-------------------------------------------------------------------------------- +!GOAL_COUNTER = "$7EF460" +DrawDungeonCompassCounts: + LDA.l CompassMode : AND.w #$00FF : BNE + : RTL : + ; Item Counts + LDA $1B : AND.w #$00FF : BNE + : RTL : + ; Skip if outdoors + LDA $040C : CMP.w #$00FF : BNE + : RTL : + ; Skip if not in a dungeon + PHX + LDX $040C ; Load dungeon ID to X + LDA $7EF364 : AND .item_masks, X ; Load compass values to A, mask with dungeon item masks + BNE + : BRL .done : + ; skip if we don't have compass + + LDA $040C + CMP.w #$0000 : BNE + ; Sewer Passage + + : CMP.w #$0002 : BNE + ; Hyrule Castle + LDA $7EF434 : AND.w #$00F0 : LSR #4 + BRL ++ + + : CMP.w #$0004 : BNE + ; Eastern Palace + LDA $7EF436 : AND.w #$0007 + BRL ++ + + : CMP.w #$0006 : BNE + ; Desert Palace + LDA $7EF435 : AND.w #$00E0 : LSR #5 + BRL ++ + + : CMP.w #$0008 : BNE + ; Agahnim's Tower + LDA $7EF435 : AND.w #$0002 + BRL ++ + + : CMP.w #$000A : BNE + ; Swamp Palace + LDA $7EF439 : AND.w #$000F + BRL ++ + + : CMP.w #$000C : BNE + ; Dark Palace + LDA $7EF434 : AND.w #$000F + BRA ++ + + : CMP.w #$000E : BNE + ; Misery Mire + LDA $7EF438 : AND.w #$000F + BRA ++ + + : CMP.w #$0010 : BNE + ; Skull Woods + LDA $7EF437 : AND.w #$00F0 : LSR #4 + BRA ++ + + : CMP.w #$0012 : BNE + ; Ice Palace + LDA $7EF438 : AND.w #$00F0 : LSR #4 + BRA ++ + + : CMP.w #$0014 : BNE + ; Tower of Hera + LDA $7EF435 : AND.w #$001C : LSR #5 + BRA ++ + + : CMP.w #$0016 : BNE + ; Thieves' Town + LDA $7EF437 : AND.w #$000F + BRA ++ + + : CMP.w #$0018 : BNE + ; Turtle Rock + LDA $7EF439 : AND.w #$00F0 : LSR #4 + BRA ++ + + : CMP.w #$001A : BNE + ; Ganon's Tower + LDA $7EF436 : AND.w #$00F8 : LSR #5 + BRA ++ + + : ++ + JSL.l HexToDec + + LDA $7F5006 : AND.w #$00FF : ORA #$2400 : STA $7EC794 + LDA $7F5007 : AND.w #$00FF : ORA #$2400 : STA $7EC796 + + LDA.w #$2830 : STA $7EC798 + + LDA $040C + CMP.w #$0000 : BNE + ; Sewer Passage + + : CMP.w #$0002 : BNE + ; Hyrule Castle + LDA.w #$0008 + BRL ++ + + : CMP.w #$0004 : BNE + ; Eastern Palace + LDA.w #$0006 + BRL ++ + + : CMP.w #$0006 : BNE + ; Desert Palace + LDA.w #$0006 + BRL ++ + + : CMP.w #$0008 : BNE + ; Agahnim's Tower + LDA.w #$0002 + BRL ++ + + : CMP.w #$000A : BNE + ; Swamp Palace + LDA.w #$000A + BRL ++ + + : CMP.w #$000C : BNE + ; Dark Palace + LDA.w #$000E + BRA ++ + + : CMP.w #$000E : BNE + ; Misery Mire + LDA.w #$0008 + BRA ++ + + : CMP.w #$0010 : BNE + ; Skull Woods + LDA.w #$0008 + BRA ++ + + : CMP.w #$0012 : BNE + ; Ice Palace + LDA.w #$0008 + BRA ++ + + : CMP.w #$0014 : BNE + ; Tower of Hera + LDA.w #$0006 + BRA ++ + + : CMP.w #$0016 : BNE + ; Thieves' Town + LDA.w #$0008 + BRA ++ + + : CMP.w #$0018 : BNE + ; Turtle Rock + LDA.w #$000C + BRA ++ + + : CMP.w #$001A : BNE + ; Ganon's Tower + LDA.w #$001B + BRA ++ + + : ++ + JSL.l HexToDec + + LDA $7F5006 : AND.w #$00FF : ORA #$2400 : STA $7EC79A + LDA $7F5007 : AND.w #$00FF : ORA #$2400 : STA $7EC79C + + .done + PLX +RTL + +.item_masks ; these are dungeon correlations to $7EF364 - $7EF369 so it knows where to store compasses, etc + dw $8000, $4000, $2000, $1000, $0800, $0400, $0200, $0100 + dw $0080, $0040, $0020, $0010, $0008, $0004 +} +;-------------------------------------------------------------------------------- +; $7EF434 - hhhhdddd - item locations checked +; h - hyrule castle +; d - palace of darkness +;-------------------------------------------------------------------------------- +; $7EF435 - dddhhhaa - item locations checked +; d - desert palace +; h - tower of hera +; a - agahnim's tower +;-------------------------------------------------------------------------------- +; $7EF436 - gggggeee - item locations checked +; g - ganon's tower +; e - eastern palace +;-------------------------------------------------------------------------------- +; $7EF437 - sssstttt - item locations checked +; s - skull woods +; t - thieves town +;-------------------------------------------------------------------------------- +; $7EF438 - iiiimmmm - item locations checked +; i - ice palace +; m - misery mire +;-------------------------------------------------------------------------------- +; $7EF439 - ttttssss - item locations checked +; t - turtle rock +; s - swamp palace +;-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/contrib.asm b/contrib.asm new file mode 100644 index 00000000..0c0ec5bc --- /dev/null +++ b/contrib.asm @@ -0,0 +1,138 @@ +;================================================================ +; Contributor: Myramong +;================================================================ +Sprite_ShowMessageFromPlayerContact_Edit: +{ + STZ $1CE8 + JSL.l Sprite_CheckDamageToPlayerSameLayerLong : BCC .dont_show + + LDA $4D : CMP.b #$02 : BEQ .dont_show + + JSL.l Sprite_DirectionToFacePlayer : TYA : EOR.b #$03 + SEC +RTL +.dont_show + LDA $0DE0, X + CLC +RTL +} +;================================================================ +Sprite_ShowSolicitedMessageIfPlayerFacing_Edit: +{ + JSL.l Sprite_CheckDamageToPlayerSameLayerLong : BCC .alpha + JSL.l Sprite_CheckIfPlayerPreoccupied : BCS .alpha + LDA $F6 : BPL .alpha + LDA $0F10, X : BNE .alpha + + LDA $4D : CMP.b #$02 : BEQ .alpha + + STZ $1CE8 ; set text choice to 1st option (usually yes/confirm/etc) + JSL.l Sprite_DirectionToFacePlayer : PHX : TYX + + ; Make sure that the sprite is facing towards the player, otherwise + ; talking can't happen. (What sprites actually use this???) + LDA $05E1A3, X : PLX : CMP $2F : BNE .not_facing_each_other + PHY + LDA.b #$40 : STA $0F10, X + PLA : EOR.b #$03 + SEC +RTL +.not_facing_each_other +.alpha + LDA $0DE0, X + CLC +RTL +} +;================================================================ +OldMountainMan_TransitionFromTagalong_Edit: +{ + PHA + + LDA.b #$AD : JSL Sprite_SpawnDynamically + + PLA : PHX : TAX + + LDA $1A64, X : AND.b #$03 : STA $0EB0, Y + STA $0DE0, Y + + LDA $1A00, X : CLC : ADC.b #$02 : STA $0D00, Y + LDA $1A14, X : ADC.b #$00 : STA $0D20, Y + + LDA $1A28, X : CLC : ADC.b #$02 : STA $0D10, Y + LDA $1A3C, X : ADC.b #$00 : STA $0D30, Y + + LDA $EE : STA $0F20, Y + + LDA.b #$01 : STA $0BA0, Y + STA $0E80, Y + + LDA.b #$01 : STA $02E4 ; OldMountainMan_FreezePlayer + STA $037B ; ^ + + PLX + + LDA.b #$00 : STA $7EF3CC + + STZ $5E + + JML $09A6B6 ; <- 4A6B6 tagalong.asm:1194 (SEP #$30 : RTS) +} +;================================================================ +Sprite_ShowSolicitedMessageIfPlayerFacing_Alt: +{ + STA $1CF0 + STY $1CF1 + + JSL Sprite_CheckDamageToPlayerSameLayerLong : BCC .alpha + JSL Sprite_CheckIfPlayerPreoccupied : BCS .alpha + + LDA $F6 : BPL .alpha + LDA $0F10, X : BNE .alpha + LDA $4D : CMP.b #$02 : BEQ .alpha + + JSL Sprite_DirectionToFacePlayer : PHX : TYX + + ; Make sure that the sprite is facing towards the player, otherwise + ; talking can't happen. (What sprites actually use this???) + LDA $05E1A3, X : PLX : CMP $2F : BNE .not_facing_each_other + + PHY + + LDA $1CF0 + LDY $1CF1 + + ; Check what room we're in so we know which npc we're talking to + LDA.b $A0 : CMP #$03 : BEQ .AlcoholicDialog + CMP #$05 : BEQ .SahasrahlaDialogs + CMP #$1C : BEQ .BombShopGuyDialog + BRA .SayNothing + + .AlcoholicDialog + JSL DialogAlcoholic : BRA .SayNothing + + .SahasrahlaDialogs + JSL DialogSahasrahla : BRA .SayNothing + + .BombShopGuyDialog + JSL DialogBombShopGuy + + .SayNothing + + LDA.b #$40 : STA $0F10, X + + PLA : EOR.b #$03 + + SEC + + RTL + +.not_facing_each_other +.alpha + + LDA $0DE0, X + + CLC + + RTL +} +;================================================================ \ No newline at end of file diff --git a/crypto.asm b/crypto.asm new file mode 100644 index 00000000..a2de7543 --- /dev/null +++ b/crypto.asm @@ -0,0 +1,284 @@ +; $7F50D0 - $7F50FF - Block Cypher Parameters +; $7F5100 - $7F51FF - Block Cypher Buffer +!v = "$7F5100" +!n = "$04" +!MXResult = "$06" +!dpScratch = "$08" +!keyBase = "$7F50D0" + + +!y = "$7F50E0" +!z = "$7F50E4" +!sum = "$7F50E8" + +!p = "$7F50EC" +!rounds = "$05" +!e = "$7F50F0" + +!upperScratch = "$7F50F2" + +CryptoDelta: +dl #$9e3779b9 + +macro LSR32(value,k) + LDX.w + + ?loop: + LDA +2 + LSR : STA +2 ; do top part + PHP ; push carry + LDA + LSR ; do bottom part + PLP ; pull carry + BCC ?nc + ORA #$80 ; pull in carry + ?nc: + STA + + DEX + CPX.w #$0000 : BNE ?loop +endmacro + +macro ASL32(value,k) + LDX.w + + ?loop: + LDA + LSR : STA ; do bottom part + PHP ; push carry + LDA +2 + LSR + PLP ; pull carry + ADC.w #$0000 + STA +2 ; do top part + + DEX + CPX.w #$0000 : BNE ?loop +endmacro + +CryptoMX: + PHX + LDA !z : STA !dpScratch + LDA !z+2 : STA !dpScratch+2 + %LSR32(!dpScratch,#$05) + + LDA !y : STA !dpScratch+4 + LDA !y+2 : STA !dpScratch+6 + %ASL32(!dpScratch+4,#$02) + + LDA !dpScratch : EOR !dpScratch+4 : STA !upperScratch + LDA !dpScratch+2 : EOR !dpScratch+6 : STA !upperScratch+2 + + ;================================ + + LDA !z : STA !dpScratch + LDA !z+2 : STA !dpScratch+2 + %ASL32(!dpScratch,#$04) + + LDA !y : STA !dpScratch+4 + LDA !y+2 : STA !dpScratch+6 + %LSR32(!dpScratch,#$03) + + LDA !dpScratch : EOR !dpScratch+4 : STA !upperScratch+4 + LDA !dpScratch+2 : EOR !dpScratch+6 : STA !upperScratch+6 + + ;================================ + + LDA !upperScratch : !ADD !upperScratch+4 : STA !upperScratch + LDA !upperScratch+2 : ADC !upperScratch+6 : STA !upperScratch+2 + + ;================================ + + LDA !sum : EOR !y : STA !dpScratch + LDA !sum+2 : EOR !y+2 : STA !dpScratch+2 + + ;================================ + + LDA !p : AND.w #$0003 : EOR !e : ASL #2 : TAX ; put (p&3)^e into X + LDA !keyBase, X : EOR !z : STA !upperScratch+4 + LDA !keyBase+2, X : EOR !z+2 : STA !upperScratch+6 + + ;================================ + + LDA !upperScratch : EOR !upperScratch+4 : STA !MXResult + LDA !upperScratch+2 : EOR !upperScratch+6 : STA !MXResult+2 + PLX +RTS + +!DIVIDEND_LOW = $4204 +!DIVIDEND_HIGH = $4205 +!DIVISOR = $4206 +!QUOTIENT_LOW = $4214 +!QUOTIENT_HIGH = $4215 + +XXTEA_Decode: + PHP + SEP #$20 ; set 8-bit accumulator + + ; rounds = 6 + 52/n; + LDA.b #52 : STA !DIVIDEND_LOW ; decimal 52 + STZ !DIVIDEND_HIGH + LDA !n : STA !DIVISOR + ; NOP #8 ; do something useful here? + LDA.b #$06 + NOP #6 + !ADD !QUOTIENT_LOW + STA !rounds + + ; sum = rounds*DELTA; + LDA CryptoDelta : STA !dpScratch + LDA CryptoDelta+1 : STA !dpScratch+1 + LDA CryptoDelta+2 : STA !dpScratch+2 + LDA CryptoDelta+3 : STA !dpScratch+3 + JSR .multiply + LDA !dpScratch + STA !sum + + ; y = v[0]; + REP #$20 ; set 16-bit accumulator + LDA !v : STA !y + LDA !v+2 : STA !y+2 + --- + LDA !sum : LSR #2 : AND #$03 : STA !e ; e = (sum >> 2) & 3; + + LDA !n : !SUB #$01 : STA !p ; for (p=n-1; p>0; p--) { + -- + ; z = v[p-1]; + DEC : ASL #2 : TAX + LDA !v, X : STA !z + LDA !v+2, X : STA !z+2 + + ; y = v[p] -= MX; + JSR CryptoMX + LDA !p : ASL #2 : TAX + LDA !v, X : !SUB !MXResult : STA !v, X : STA !y + LDA !v+2, X : SBC !MXResult+2 : STA !v+2, X : STA !y+2 + + LDA !p : DEC : STA !p : BNE -- ; } + + ; z = v[n-1]; + LDA !n : DEC : ASL #2 : TAX + LDA !v, X : STA !z + LDA !v+2, X : STA !z+2 + + ; y = v[0] -= MX; + JSR CryptoMX + LDA !v : !SUB !MXResult : STA !v : STA !y + LDA !v+2 : SBC !MXResult+2 : STA !v+2 : STA !y+2 + + ; sum -= DELTA; + LDA !sum : !SUB CryptoDelta : STA !sum + LDA !sum+2 : !SUB CryptoDelta+2 : STA !sum+2 + + LDA !rounds : BEQ + : BRL --- : + ; } while (--rounds); + PLP +RTL + +;void btea(uint32_t *v, int n, uint32_t const key[4]) { +; uint32_t y, z, sum; +; unsigned p, rounds, e; + +; } else if (n < -1) { /* Decoding Part */ +; n = -n; +; rounds = 6 + 52/n; +; sum = rounds*DELTA; +; y = v[0]; +; do { +; e = (sum >> 2) & 3; +; for (p=n-1; p>0; p--) { +; z = v[p-1]; +; y = v[p] -= MX; +; } +; z = v[n-1]; +; y = v[0] -= MX; +; sum -= DELTA; +; } while (--rounds); +; } + +.multiply + LDA #$00 + STA !upperScratch+4 ;Clear upper half of + STA !upperScratch+5 ;!upperScratchuct + STA !upperScratch+6 + STA !upperScratch+7 + LDX #$20 ;Set binary count to 32 +.shift_r + LSR !dpScratch+3 ;Shift multiplyer right + ROR !dpScratch+2 + ROR !dpScratch+1 + ROR !dpScratch + BCC .rotate_r ;Go rotate right if c = 0 + LDA !upperScratch+4 ;Get upper half of !upperScratchuct + !ADD !rounds ; and add multiplicand to it + STA !upperScratch+4 + LDA !upperScratch+5 + ADC.w #$00 + STA !upperScratch+5 + LDA !upperScratch+6 + ADC.w #$00 + STA !upperScratch+6 + LDA !upperScratch+7 + ADC.w #$00 +.rotate_r + ROR a ;Rotate partial !upperScratchuct + STA !upperScratch+7 ; right + ROR !upperScratch+6 + ROR !upperScratch+5 + ROR !upperScratch+4 + ROR !upperScratch+3 + ROR !upperScratch+2 + ROR !upperScratch+1 + ROR !upperScratch + DEX ;Decrement bit count and + BNE .shift_r ; loop until 32 bits are done + ;LDA MULXP1 ;Add dps and put sum in MULXP2 + ;!ADD MULXP2 + ;STA MULXP2 +RTS + +;BTEA will encode or decode n words as a single block where n > 1 +; +;v is the n word data vector +;k is the 4 word key +;n is negative for decoding +;if n is zero result is 1 and no coding or decoding takes place, otherwise the result is zero +;assumes 32 bit 'long' and same endian coding and decoding +;#include +;#define DELTA 0x9e3779b9 +;#define MX (((z>>5^y<<2) + (y>>3^z<<4)) ^ ((sum^y) + (key[(p&3)^e] ^ z))) +;#define MX ((((z>>5)^(y<<2)) + ((y>>3)^(z<<4))) ^ ((sum^y) + (key[(p&3)^e] ^ z))) +; +;void btea(uint32_t *v, int n, uint32_t const key[4]) { +; uint32_t y, z, sum; +; unsigned p, rounds, e; +; if (n > 1) { /* Coding Part */ +; rounds = 6 + 52/n; +; sum = 0; +; z = v[n-1]; +; do { +; sum += DELTA; +; e = (sum >> 2) & 3; +; for (p=0; p> 2) & 3; +; for (p=n-1; p>0; p--) { +; z = v[p-1]; +; y = v[p] -= MX; +; } +; z = v[n-1]; +; y = v[0] -= MX; +; sum -= DELTA; +; } while (--rounds); +; } +;} \ No newline at end of file diff --git a/darkworldspawn.asm b/darkworldspawn.asm new file mode 100644 index 00000000..aa0be02f --- /dev/null +++ b/darkworldspawn.asm @@ -0,0 +1,63 @@ +;================================================================================ +; Dark World Spawn Location Fix & Master Sword Grove Fix +;-------------------------------------------------------------------------------- +DarkWorldSaveFix: + LDA.b #$70 : PHA : PLB ; thing we wrote over - data bank change + JSL.l DarkWorldFlagSet + JSL.l MasterSwordFollowerClear + JSL.l StatSaveCounter +RTL +;-------------------------------------------------------------------------------- +DarkWorldLoadFix: + SEP #$20 ; set 8 bit accumulator + JSL.l OnFileLoad + REP #$20 ; restore 16 bit accumulator + LDA.w #$0007 : STA $7EC00D : STA $7EC013 ; thing we wrote over - sets up some graphics timers +RTL +;-------------------------------------------------------------------------------- +DarkWorldFlagSet: + PHA + LDA Bugfix_PreAgaDWDungeonDeathToFakeDW : BEQ + + LDA $10 : CMP #$12 : BEQ .done ; don't do anything in death mode + + + LDA.l Bugfix_MirrorlessSQToLW : BEQ + + LDA $7EF353 : BEQ .noMirror ; check if we have the mirror + + + LDA $7EF3C5 : CMP.b #$03 : !BLT .aga1Alive ; check if agahnim 1 is alive + BRA .done + .noMirror + .aga1Alive + LDA #$00 : STA $7EF3CA ; set flag to light world + ;LDA $7EF3CC : CMP #$07 : BNE + : LDA.b #$00 : STA $7EF3CC : + ; clear frog + .done + PLA +RTL +;-------------------------------------------------------------------------------- +SetDeathWorldChecked: + PHA + LDA $1B : BEQ + ; skip this for indoors + LDA $040C : CMP #$FF : BNE .done ; unless it's a cave + + + LDA $7EF3C5 : CMP.b #$03 : !BGE .done; thing we originally did - skip if agahnim 1 is dead + LDA $A0 : CMP.b #$00 : BEQ .done ; skip if we died in ganon's room + LDA.b #$00 : STA $7EF3CA : STA $7E0FFF ; set the world to the light world if he's still alive + ;LDA $7EF3CC : CMP #$07 : BNE .done : LDA.b #$00 : STA $7EF3CC ; clear dwarf tagalong + .done + PLA +RTL +;-------------------------------------------------------------------------------- +MasterSwordFollowerClear: + LDA $7EF3CC + CMP #$0E : BEQ .clear ; clear master sword follower + CMP #$07 : BEQ .clear ; clear frog + ;CMP #$08 : BEQ .clear ; clear dwarf - consider flute implications +RTL + .clear + LDA.b #$00 : STA $7EF3CC ; clear follower +RTL +;-------------------------------------------------------------------------------- +FixAgahnimFollowers: + LDA.b #$00 : STA $7EF3CC ; clear follower + JSL PrepDungeonExit ; thing we wrote over +RTL +;================================================================================ \ No newline at end of file diff --git a/dialog.asm b/dialog.asm new file mode 100644 index 00000000..5312859c --- /dev/null +++ b/dialog.asm @@ -0,0 +1,399 @@ +;================================================================================ +; Dialog Pointer Override +;-------------------------------------------------------------------------------- +DialogOverride: + LDA $7F5035 : BEQ .skip + LDA $7F5700, X ; use alternate buffer +RTL + .skip + LDA $7F1200, X +RTL +;-------------------------------------------------------------------------------- +; $7F5035 - Alternate Text Pointer Flag ; 0=Disable +; $7F5036 - Padding Byte (Must be Zero) +; $7F5700 - $7F57FF - Dialog Buffer +;-------------------------------------------------------------------------------- +ResetDialogPointer: + LDA.b #$00 : STA $7F5035 ; zero out the alternate flag + LDA.b #$1C : STA $1CE9 ; thing we wrote over +RTL +;-------------------------------------------------------------------------------- +;macro LoadDialog(index,table) +; PHA : PHX : PHY +; PHB : PHK : PLB +; LDA $00 : PHA +; LDA $01 : PHA +; LDA $02 : PHA +; LDA.b #$01 : STA $7F5035 ; set flag +; +; LDA : ASL : !ADD.l : TAX ; get quote offset *3, move to X +; LDA , X : STA $00 ; write pointer to direct page +; LDA
+1, X : STA $01 +; LDA
+2, X : STA $02 +; +; LDX.b #$00 : LDY.b #$00 +; - +; LDA [$00], Y ; load the next character from the pointer +; STA $7F5700, X ; write to the buffer +; INX : INY +; CMP.b #$7F : BNE - +; PLA : STA $02 +; PLA : STA $01 +; PLA : STA $00 +; PLB +; PLY : PLX : PLA +;endmacro +;-------------------------------------------------------------------------------- +macro LoadDialogAddress(address) + PHP + PHA : PHX : PHY + PHB : PHK : PLB + SEP #$30 ; set 8-bit accumulator and index registers + LDA $00 : PHA + LDA $01 : PHA + LDA $02 : PHA + LDA.b #$01 : STA $7F5035 ; set flag + + LDA.b #
: STA $00 ; write pointer to direct page + LDA.b #
>>8 : STA $01 + LDA.b #
>>16 : STA $02 + + LDX.b #$00 : LDY.b #$00 + - + LDA [$00], Y ; load the next character from the pointer + STA $7F5700, X ; write to the buffer + INX : INY + CMP.b #$7F : BNE - + PLA : STA $02 + PLA : STA $01 + PLA : STA $00 + PLB + PLY : PLX : PLA + PLP +endmacro +;-------------------------------------------------------------------------------- +DialogBlind: + %LoadDialogAddress(BlindText) + JSL.l Sprite_ShowMessageMinimal +RTL +;-------------------------------------------------------------------------------- +DialogFatFairy: + %LoadDialogAddress(FatFairyText) + JSL.l Sprite_ShowMessageUnconditional +RTL +;-------------------------------------------------------------------------------- +DialogTriforce: + %LoadDialogAddress(TriforceText) + JSL.l Messaging_Text +RTL +;-------------------------------------------------------------------------------- +DialogGanon1: + %LoadDialogAddress(GanonText1) + JSL.l Sprite_ShowMessageMinimal +RTL +;-------------------------------------------------------------------------------- +DialogGanon2: + %LoadDialogAddress(GanonText2) + JSL.l Sprite_ShowMessageMinimal +RTL +;-------------------------------------------------------------------------------- +DialogPedestal: + PHA + LDA $0202 : CMP.b #$0F : BEQ + ; Show normal text if book is not equipped + - + PLA : JSL Sprite_ShowMessageUnconditional ; Wacky Hylian Text +RTL + + + BIT $F4 : BVC - ; Show normal text if Y is not pressed + %LoadDialogAddress(MSPedestalText) + PLA : JSL Sprite_ShowMessageUnconditional ; Text From MSPedestalText (tables.asm) +RTL +;-------------------------------------------------------------------------------- +DialogUncle: + ;%LoadDialog(UncleQuote,DialogUncleData) + %LoadDialogAddress(UncleText) + JSL Sprite_ShowMessageUnconditional +RTL +;-------------------------------------------------------------------------------- +DialogSahasrahla: + LDA.l $7EF374 : AND #$04 : BEQ + ;Check if player has green pendant + %LoadDialogAddress(SahasrahlaAfterItemText) + JSL.l Sprite_ShowMessageUnconditional + RTL + + + %LoadDialogAddress(SahasrahlaNoPendantText) + JSL.l Sprite_ShowMessageUnconditional +RTL +;-------------------------------------------------------------------------------- +DialogAlcoholic: + %LoadDialogAddress(AlcoholicText) + JSL.l Sprite_ShowMessageUnconditional +RTL +;-------------------------------------------------------------------------------- +DialogBombShopGuy: + LDA.l $7EF37A : AND #$05 : CMP #$05 : BEQ + ;Check if player has crystals 5 & 6 + %LoadDialogAddress(BombShopGuyNoCrystalsText) + JSL.l Sprite_ShowMessageUnconditional + RTL + + + %LoadDialogAddress(BombShopGuyText) + JSL.l Sprite_ShowMessageUnconditional +RTL +;-------------------------------------------------------------------------------- +; A0 - A9 - 0 - 9 +; AA - C3 - A - Z +; C6 - ? +; C7 - ! +; C8 - , +; C9 - - Hyphen +; CD - Japanese period +; CE - ~ +; D8 - ` apostraphe +;;-------------------------------------------------------------------------------- +;DialogUncleData: +;;-------------------------------------------------------------------------------- +; .pointers +; dl #DialogUncleData_weetabix +; dl #DialogUncleData_bootlessUntilBoots +; dl #DialogUncleData_onlyOneBed +; dl #DialogUncleData_onlyTextBox +; dl #DialogUncleData_mothTutorial +; dl #DialogUncleData_seedWorst +; dl #DialogUncleData_chasingTail +; dl #DialogUncleData_doneBefore +; dl #DialogUncleData_capeCanPass +; dl #DialogUncleData_bootsAtRace +; dl #DialogUncleData_kanzeonSeed +; dl #DialogUncleData_notRealUncle +; dl #DialogUncleData_haveAVeryBadTime +; dl #DialogUncleData_todayBadLuck +; dl #DialogUncleData_leavingGoodbye +; dl #DialogUncleData_iGotThis +; dl #DialogUncleData_raceToCastle +; dl #DialogUncleData_69BlazeIt +; dl #DialogUncleData_hi +; dl #DialogUncleData_gettingSmokes +; dl #DialogUncleData_dangerousSeeYa +; dl #DialogUncleData_badEnoughDude +; dl #DialogUncleData_iAmError +; dl #DialogUncleData_sub2Guaranteed +; dl #DialogUncleData_chestSecretEverybody +; dl #DialogUncleData_findWindFish +; dl #DialogUncleData_shortcutToGanon +; dl #DialogUncleData_moonCrashing +; dl #DialogUncleData_fightVoldemort +; dl #DialogUncleData_redMailForCowards +; dl #DialogUncleData_heyListen +; dl #DialogUncleData_excuseMePrincess +;;-------------------------------------------------------------------------------- +; .weetabix +; ; We’re out of / Weetabix. To / the store! +; db $00, $c0, $00, $ae, $00, $d8, $00, $bb, $00, $ae, $00, $ff, $00, $b8, $00, $be, $00, $bd, $00, $ff, $00, $b8, $00, $af +; db $75, $00, $c0, $00, $ae, $00, $ae, $00, $bd, $00, $aa, $00, $ab, $00, $b2, $00, $c1, $00, $cD, $00, $ff, $00, $bd, $00, $b8 +; db $76, $00, $bd, $00, $b1, $00, $ae, $00, $ff, $00, $bc, $00, $bd, $00, $b8, $00, $bb, $00, $ae, $00, $c7 +; db $7f, $7f +;;-------------------------------------------------------------------------------- +; .bootlessUntilBoots +; ; This seed is / bootless / until boots. +; db $00, $bd, $00, $b1, $00, $b2, $00, $bc, $00, $ff, $00, $bc, $00, $ae, $00, $ae, $00, $ad, $00, $ff, $00, $b2, $00, $bc +; db $75, $00, $ab, $00, $b8, $00, $b8, $00, $bd, $00, $b5, $00, $ae, $00, $bc, $00, $bc +; db $76, $00, $be, $00, $b7, $00, $bd, $00, $b2, $00, $b5, $00, $ff, $00, $ab, $00, $b8, $00, $b8, $00, $bd, $00, $bc, $00, $cD +; db $7f, $7f +;;-------------------------------------------------------------------------------- +; .onlyOneBed +; ; Why do we only / have one bed? +; db $00, $c0, $00, $b1, $00, $c2, $00, $ff, $00, $ad, $00, $b8, $00, $ff, $00, $c0, $00, $ae, $00, $ff, $00, $b8, $00, $b7, $00, $b5, $00, $c2 +; db $75, $00, $b1, $00, $aa, $00, $bf, $00, $ae, $00, $ff, $00, $b8, $00, $b7, $00, $ae, $00, $ff, $00, $ab, $00, $ae, $00, $ad, $00, $c6 +; db $7f, $7f +;;-------------------------------------------------------------------------------- +; .onlyTextBox +; ; This is the / only textbox. +; db $00, $bd, $00, $b1, $00, $b2, $00, $bc, $00, $ff, $00, $b2, $00, $bc, $00, $ff, $00, $bd, $00, $b1, $00, $ae +; db $75, $00, $b8, $00, $b7, $00, $b5, $00, $c2, $00, $ff, $00, $bd, $00, $ae, $00, $c1, $00, $bd, $00, $ab, $00, $b8, $00, $c1, $00, $cD +; db $7f, $7f +;;-------------------------------------------------------------------------------- +; .mothTutorial +; ; I'm going to / go watch the / Moth tutorial. +; db $00, $b2, $00, $d8, $00, $b6, $00, $ff, $00, $b0, $00, $b8, $00, $b2, $00, $b7, $00, $b0, $00, $ff, $00, $bd, $00, $b8 +; db $75, $00, $b0, $00, $b8, $00, $ff, $00, $c0, $00, $aa, $00, $bd, $00, $ac, $00, $b1, $00, $ff, $00, $bd, $00, $b1, $00, $ae +; db $76, $00, $b6, $00, $b8, $00, $bd, $00, $b1, $00, $ff, $00, $bd, $00, $be, $00, $bd, $00, $b8, $00, $bb, $00, $b2, $00, $aa, $00, $b5, $00, $cD +; db $7f, $7f +;;-------------------------------------------------------------------------------- +; .seedWorst +; ; This seed is / the worst. +; db $00, $bd, $00, $b1, $00, $b2, $00, $bc, $00, $ff, $00, $bc, $00, $ae, $00, $ae, $00, $ad, $00, $ff, $00, $b2, $00, $bc +; db $75, $00, $bd, $00, $b1, $00, $ae, $00, $ff, $00, $c0, $00, $b8, $00, $bb, $00, $bc, $00, $bd, $00, $cD +; db $7f, $7f +;;-------------------------------------------------------------------------------- +; .chasingTail +; ; Chasing tail. / Fly ladies. / Do not follow. +; db $00, $ac, $00, $b1, $00, $aa, $00, $bc, $00, $b2, $00, $b7, $00, $b0, $00, $ff, $00, $bd, $00, $aa, $00, $b2, $00, $b5, $00, $cD +; db $75, $00, $af, $00, $b5, $00, $c2, $00, $ff, $00, $b5, $00, $aa, $00, $ad, $00, $b2, $00, $ae, $00, $bc, $00, $cD +; db $76, $00, $ad, $00, $b8, $00, $ff, $00, $b7, $00, $b8, $00, $bd, $00, $ff, $00, $af, $00, $b8, $00, $b5, $00, $b5, $00, $b8, $00, $c0, $00, $cD +; db $7f, $7f +;;-------------------------------------------------------------------------------- +; .doneBefore +; ; I feel like / I’ve done this / before… +; db $00, $b2, $00, $ff, $00, $af, $00, $ae, $00, $ae, $00, $b5, $00, $ff, $00, $b5, $00, $b2, $00, $b4, $00, $ae +; db $75, $00, $b2, $00, $d8, $00, $bf, $00, $ae, $00, $ff, $00, $ad, $00, $b8, $00, $b7, $00, $ae, $00, $ff, $00, $bd, $00, $b1, $00, $b2, $00, $bc +; db $76, $00, $ab, $00, $ae, $00, $af, $00, $b8, $00, $bb, $00, $ae, $00, $cD, $00, $cD, $00, $cD +; db $7f, $7f +;;-------------------------------------------------------------------------------- +; .capeCanPass +; ; Magic cape can / pass through / the barrier! +; db $00, $b6, $00, $aa, $00, $b0, $00, $b2, $00, $ac, $00, $ff, $00, $ac, $00, $aa, $00, $b9, $00, $ae, $00, $ff, $00, $ac, $00, $aa, $00, $b7 +; db $75, $00, $b9, $00, $aa, $00, $bc, $00, $bc, $00, $ff, $00, $bd, $00, $b1, $00, $bb, $00, $b8, $00, $be, $00, $b0, $00, $b1 +; db $76, $00, $bd, $00, $b1, $00, $ae, $00, $ff, $00, $ab, $00, $aa, $00, $bb, $00, $bb, $00, $b2, $00, $ae, $00, $bb, $00, $c7 +; db $7f, $7f +;;-------------------------------------------------------------------------------- +; .bootsAtRace +; ; Boots at race? / Seed confirmed / impossible. +; db $00, $ab, $00, $b8, $00, $b8, $00, $bd, $00, $bc, $00, $ff, $00, $aa, $00, $bd, $00, $ff, $00, $bb, $00, $aa, $00, $ac, $00, $ae, $00, $c6 +; db $75, $00, $bc, $00, $ae, $00, $ae, $00, $ad, $00, $ff, $00, $ac, $00, $b8, $00, $b7, $00, $af, $00, $b2, $00, $bb, $00, $b6, $00, $ae, $00, $ad +; db $76, $00, $b2, $00, $b6, $00, $b9, $00, $b8, $00, $bc, $00, $bc, $00, $b2, $00, $ab, $00, $b5, $00, $ae, $00, $cD +; db $7f, $7f +;;-------------------------------------------------------------------------------- +; .kanzeonSeed +; ; If this is a / Kanzeon seed, / I'm quitting. +; db $00, $b2, $00, $af, $00, $ff, $00, $bd, $00, $b1, $00, $b2, $00, $bc, $00, $ff, $00, $b2, $00, $bc, $00, $ff, $00, $aa +; db $75, $00, $b4, $00, $aa, $00, $b7, $00, $c3, $00, $ae, $00, $b8, $00, $b7, $00, $ff, $00, $bc, $00, $ae, $00, $ae, $00, $ad, $00, $c8 +; db $76, $00, $b2, $00, $d8, $00, $b6, $00, $ff, $00, $ba, $00, $be, $00, $b2, $00, $bd, $00, $bd, $00, $b2, $00, $b7, $00, $b0, $00, $cD +; db $7f, $7f +;;-------------------------------------------------------------------------------- +; .notRealUncle +; ; I am not your / real uncle. +; db $00, $b2, $00, $ff, $00, $aa, $00, $b6, $00, $ff, $00, $b7, $00, $b8, $00, $bd, $00, $ff, $00, $c2, $00, $b8, $00, $be, $00, $bb +; db $75, $00, $bb, $00, $ae, $00, $aa, $00, $b5, $00, $ff, $00, $be, $00, $b7, $00, $ac, $00, $b5, $00, $ae, $00, $cD +; db $7f, $7f +;;-------------------------------------------------------------------------------- +; .haveAVeryBadTime +; ; You're going / to have a very / bad time. +; db $00, $c2, $00, $b8, $00, $be, $00, $d8, $00, $bb, $00, $ae, $00, $ff, $00, $b0, $00, $b8, $00, $b2, $00, $b7, $00, $b0 +; db $75, $00, $bd, $00, $b8, $00, $ff, $00, $b1, $00, $aa, $00, $bf, $00, $ae, $00, $ff, $00, $aa, $00, $ff, $00, $bf, $00, $ae, $00, $bb, $00, $c2 +; db $76, $00, $ab, $00, $aa, $00, $ad, $00, $ff, $00, $bd, $00, $b2, $00, $b6, $00, $ae, $00, $cD +; db $7f, $7f +;;-------------------------------------------------------------------------------- +; .todayBadLuck +; ; Today you / will have / bad luck. +; db $00, $bd, $00, $b8, $00, $ad, $00, $aa, $00, $c2, $00, $ff, $00, $c2, $00, $b8, $00, $be, $00, $ff, $00, $c0, $00, $b2, $00, $b5, $00, $b5 +; db $75, $00, $b1, $00, $aa, $00, $bf, $00, $ae, $00, $ff, $00, $ab, $00, $aa, $00, $ad, $00, $ff, $00, $b5, $00, $be, $00, $ac, $00, $b4, $00, $c7 +; db $7f, $7f +;;-------------------------------------------------------------------------------- +; .leavingGoodbye +; ; I am leaving / forever. / Goodbye. +; db $00, $b2, $00, $ff, $00, $aa, $00, $b6, $00, $ff, $00, $b5, $00, $ae, $00, $aa, $00, $bf, $00, $b2, $00, $b7, $00, $b0 +; db $75, $00, $af, $00, $b8, $00, $bb, $00, $ae, $00, $bf, $00, $ae, $00, $bb, $00, $cD +; db $76, $00, $b0, $00, $b8, $00, $b8, $00, $ad, $00, $ab, $00, $c2, $00, $ae, $00, $cD +; db $7f, $7f +;;-------------------------------------------------------------------------------- +; .iGotThis +; ; Don’t worry. / I got this / covered. +; db $00, $ad, $00, $b8, $00, $b7, $00, $d8, $00, $bd, $00, $ff, $00, $c0, $00, $b8, $00, $bb, $00, $bb, $00, $c2, $00, $cD +; db $75, $00, $b2, $00, $ff, $00, $b0, $00, $b8, $00, $bd, $00, $ff, $00, $bd, $00, $b1, $00, $b2, $00, $bc +; db $76, $00, $ac, $00, $b8, $00, $bf, $00, $ae, $00, $bb, $00, $ae, $00, $ad, $00, $cD +; db $7f, $7f +;;-------------------------------------------------------------------------------- +; .raceToCastle +; ; Race you to / the castle! +; db $00, $bb, $00, $aa, $00, $ac, $00, $ae, $00, $ff, $00, $c2, $00, $b8, $00, $be, $00, $ff, $00, $bd, $00, $b8 +; db $75, $00, $bd, $00, $b1, $00, $ae, $00, $ff, $00, $ac, $00, $aa, $00, $bc, $00, $bd, $00, $b5, $00, $ae, $00, $c7 +; db $7f, $7f +;;-------------------------------------------------------------------------------- +; .69BlazeIt +; ; ~69 Blaze It!~ +; db $75, $00, $cE, $00, $a6, $00, $a9, $00, $ff, $00, $ab, $00, $b5, $00, $aa, $00, $c3, $00, $ae, $00, $ff, $00, $b2, $00, $bd, $00, $c7, $00, $cE +; db $7f, $7f +;;-------------------------------------------------------------------------------- +; .hi +; ; hi +; db $75, $00, $ff, $00, $ff, $00, $ff, $00, $ff, $00, $ff, $00, $ff, $00, $b1, $00, $b2 +; db $7f, $7f +;;-------------------------------------------------------------------------------- +; .gettingSmokes +; ; I'M JUST GOING / OUT FOR A / PACK OF SMOKES. +; db $00, $b2, $00, $d8, $00, $b6, $00, $ff, $00, $b3, $00, $be, $00, $bc, $00, $bd, $00, $ff, $00, $b0, $00, $b8, $00, $b2, $00, $b7, $00, $b0 +; db $75, $00, $b8, $00, $be, $00, $bd, $00, $ff, $00, $af, $00, $b8, $00, $bb, $00, $ff, $00, $aa +; db $76, $00, $b9, $00, $aa, $00, $ac, $00, $b4, $00, $ff, $00, $b8, $00, $af, $00, $ff, $00, $bc, $00, $b6, $00, $b8, $00, $b4, $00, $ae, $00, $bc, $00, $cD +; db $7f, $7f +;;-------------------------------------------------------------------------------- +; .dangerousSeeYa +; ; It's dangerous / to go alone. / See ya! +; db $00, $b2, $00, $bd, $00, $d8, $00, $bc, $00, $ff, $00, $ad, $00, $aa, $00, $b7, $00, $b0, $00, $ae, $00, $bb, $00, $b8, $00, $be, $00, $bc +; db $75, $00, $bd, $00, $b8, $00, $ff, $00, $b0, $00, $b8, $00, $ff, $00, $aa, $00, $b5, $00, $b8, $00, $b7, $00, $ae, $00, $cD +; db $76, $00, $bc, $00, $ae, $00, $ae, $00, $ff, $00, $c2, $00, $aa, $00, $c7 +; db $7f, $7f +;;-------------------------------------------------------------------------------- +; .badEnoughDude +; ; ARE YOU A BAD / ENOUGH DUDE TO / RESCUE ZELDA? +; db $00, $aa, $00, $bb, $00, $ae, $00, $ff, $00, $c2, $00, $b8, $00, $be, $00, $ff, $00, $aa, $00, $ff, $00, $ab, $00, $aa, $00, $ad +; db $75, $00, $ae, $00, $b7, $00, $b8, $00, $be, $00, $b0, $00, $b1, $00, $ff, $00, $ad, $00, $be, $00, $ad, $00, $ae, $00, $ff, $00, $bd, $00, $b8 +; db $76, $00, $bb, $00, $ae, $00, $bc, $00, $ac, $00, $be, $00, $ae, $00, $ff, $00, $c3, $00, $ae, $00, $b5, $00, $ad, $00, $aa, $00, $c6 +; db $7f, $7f +;;-------------------------------------------------------------------------------- +; .iAmError +; ; I AM ERROR +; db $76, $00, $ff, $00, $ff, $00, $ff, $00, $ff, $00, $b2, $00, $ff, $00, $aa, $00, $b6, $00, $ff, $00, $ae, $00, $bb, $00, $bb, $00, $b8, $00, $bb +; db $7f, $7f +;;-------------------------------------------------------------------------------- +; .sub2Guaranteed +; ; This seed is / sub 2 hours, / guaranteed. +; db $00, $bd, $00, $b1, $00, $b2, $00, $bc, $00, $ff, $00, $bc, $00, $ae, $00, $ae, $00, $ad, $00, $ff, $00, $b2, $00, $bc +; db $75, $00, $bc, $00, $be, $00, $ab, $00, $ff, $00, $a2, $00, $ff, $00, $b1, $00, $b8, $00, $be, $00, $bb, $00, $bc, $00, $c8 +; db $76, $00, $b0, $00, $be, $00, $aa, $00, $bb, $00, $aa, $00, $b7, $00, $bd, $00, $ae, $00, $ae, $00, $ad, $00, $cD +; db $7f, $7f +;;-------------------------------------------------------------------------------- +; .chestSecretEverybody +; ; The chest is / a secret to / everybody. +; db $00, $bd, $00, $b1, $00, $ae, $00, $ff, $00, $ac, $00, $b1, $00, $ae, $00, $bc, $00, $bd, $00, $ff, $00, $b2, $00, $bc +; db $75, $00, $aa, $00, $ff, $00, $bc, $00, $ae, $00, $ac, $00, $bb, $00, $ae, $00, $bd, $00, $ff, $00, $bd, $00, $b8 +; db $76, $00, $ae, $00, $bf, $00, $ae, $00, $bb, $00, $c2, $00, $ab, $00, $b8, $00, $ad, $00, $c2, $00, $cD +; db $7f, $7f +;;-------------------------------------------------------------------------------- +; .findWindFish +; ; I'm off to / find the / wind fish. +; db $00, $b2, $00, $d8, $00, $b6, $00, $ff, $00, $b8, $00, $af, $00, $af, $00, $ff, $00, $bd, $00, $b8 +; db $75, $00, $af, $00, $b2, $00, $b7, $00, $ad, $00, $ff, $00, $bd, $00, $b1, $00, $ae +; db $76, $00, $c0, $00, $b2, $00, $b7, $00, $ad, $00, $ff, $00, $af, $00, $b2, $00, $bc, $00, $b1, $00, $cD +; db $7f, $7f +;;-------------------------------------------------------------------------------- +; .shortcutToGanon +; ; The shortcut / to Ganon / is this way! +; db $00, $bd, $00, $b1, $00, $ae, $00, $ff, $00, $bc, $00, $b1, $00, $b8, $00, $bb, $00, $bd, $00, $ac, $00, $be, $00, $bd +; db $75, $00, $bd, $00, $b8, $00, $ff, $00, $b0, $00, $aa, $00, $b7, $00, $b8, $00, $b7 +; db $76, $00, $b2, $00, $bc, $00, $ff, $00, $bd, $00, $b1, $00, $b2, $00, $bc, $00, $ff, $00, $c0, $00, $aa, $00, $c2, $00, $c7 +; db $7f, $7f +;;-------------------------------------------------------------------------------- +; .moonCrashing +; ; THE MOON IS / CRASHING! RUN / FOR YOUR LIFE! +; db $00, $bd, $00, $b1, $00, $ae, $00, $ff, $00, $b6, $00, $b8, $00, $b8, $00, $b7, $00, $ff, $00, $b2, $00, $bc +; db $75, $00, $ac, $00, $bb, $00, $aa, $00, $bc, $00, $b1, $00, $b2, $00, $b7, $00, $b0, $00, $c7, $00, $ff, $00, $bb, $00, $be, $00, $b7 +; db $76, $00, $af, $00, $b8, $00, $bb, $00, $ff, $00, $c2, $00, $b8, $00, $be, $00, $bb, $00, $ff, $00, $b5, $00, $b2, $00, $af, $00, $ae, $00, $c7 +; db $7f, $7f +;;-------------------------------------------------------------------------------- +; .fightVoldemort +; ; Time to fight / he who must / not be named. +; db $00, $bd, $00, $b2, $00, $b6, $00, $ae, $00, $ff, $00, $bd, $00, $b8, $00, $ff, $00, $af, $00, $b2, $00, $b0, $00, $b1, $00, $bd +; db $75, $00, $b1, $00, $ae, $00, $ff, $00, $c0, $00, $b1, $00, $b8, $00, $ff, $00, $b6, $00, $be, $00, $bc, $00, $bd +; db $76, $00, $b7, $00, $b8, $00, $bd, $00, $ff, $00, $ab, $00, $ae, $00, $ff, $00, $b7, $00, $aa, $00, $b6, $00, $ae, $00, $ad, $00, $cD +; db $7f, $7f +;;-------------------------------------------------------------------------------- +; .redMailForCowards +; ; RED MAIL / IS FOR / COWARDS. +; db $00, $bb, $00, $ae, $00, $ad, $00, $ff, $00, $b6, $00, $aa, $00, $b2, $00, $b5 +; db $75, $00, $b2, $00, $bc, $00, $ff, $00, $af, $00, $b8, $00, $bb +; db $76, $00, $ac, $00, $b8, $00, $c0, $00, $aa, $00, $bb, $00, $ad, $00, $bc, $00, $cD +; db $7f, $7f +;;-------------------------------------------------------------------------------- +; .heyListen +; ; HEY! / / LISTEN! +; db $00, $b1, $00, $ae, $00, $c2, $00, $c7 +; db $76, $00, $b5, $00, $b2, $00, $bc, $00, $bd, $00, $ae, $00, $b7, $00, $c7 +; db $7f, $7f +;;-------------------------------------------------------------------------------- +; .excuseMePrincess +; ; Well / excuuuuuse me, / princess! +; db $00, $c0, $00, $ae, $00, $b5, $00, $b5 +; db $75, $00, $ae, $00, $c1, $00, $ac, $00, $be, $00, $be, $00, $be, $00, $be, $00, $be, $00, $bc, $00, $ae, $00, $ff, $00, $b6, $00, $ae, $00, $c8 +; db $76, $00, $b9, $00, $bb, $00, $b2, $00, $b7, $00, $ac, $00, $ae, $00, $bc, $00, $bc, $00, $c7 +; db $7f, $7f +;;-------------------------------------------------------------------------------- ^32nd \ No newline at end of file diff --git a/dungeondrops.asm b/dungeondrops.asm new file mode 100644 index 00000000..ac40e11d --- /dev/null +++ b/dungeondrops.asm @@ -0,0 +1,9 @@ +;================================================================================ +; Dungeon & Boss Drop Fixes +;-------------------------------------------------------------------------------- +DropSafeDungeon: + LDA $040C : CMP #$08 : BEQ + + LDA $01C6FC, X : JSL Sprite_SpawnFallingItem + + +RTL +;-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/entrances.asm b/entrances.asm new file mode 100644 index 00000000..cdf9e315 --- /dev/null +++ b/entrances.asm @@ -0,0 +1,15 @@ +;-------------------------------------------------------------------------------- +; LockAgahnimDoors: +; Returns: 0=Unlocked - 1=Locked +;-------------------------------------------------------------------------------- +LockAgahnimDoors: + LDA $7EF3C5 : AND.w #$000F : CMP.w #$0002 : !BGE + ; if we rescued zelda, skip + LDA $22 : CMP.w #1992 : !BLT + ; door too far left, skip + CMP.w #2088 : !BGE + ; door too rat right, skip + LDA $20 : CMP.w #1720 : !BGE + ; door too low, skip + LDA.w #$0001 +RTL + + + LDA.w #$0000 +RTL +;-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/events.asm b/events.asm new file mode 100644 index 00000000..443eb4df --- /dev/null +++ b/events.asm @@ -0,0 +1,82 @@ +;-------------------------------------------------------------------------------- +; OnLoadOW +;-------------------------------------------------------------------------------- +OnLoadMap: + JSL.l SetLWDWMap + LDA $7EF2DB ; thing we wrote over +RTL +;-------------------------------------------------------------------------------- +OnDrawHud: + JSL.l Draw4DigitRupees + JSL.l DrawChallengeTimer + JSL.l DrawGoalIndicator + JSL.l DrawDungeonCompassCounts +RTL +;-------------------------------------------------------------------------------- +OnDungeonEntrance: + PHA : PHP + SEP #$20 ; set 8-bit accumulator + LDA $040C : CMP #$FF : BEQ + ; don't do this unless it's a real dungeon + LDA $7EF3CC ; load follower + CMP #$0C : BNE + ; skip if not the purple chest + LDA #$00 : STA $7EF3CC + + + PLP : PLA + STA $7EC172 ; thing we wrote over +RTL +;-------------------------------------------------------------------------------- +!RNG_ITEM_LOCK_IN = "$7F5090" +OnFileLoad: + LDA !FRESH_FILE_MARKER : BNE + + JSL.l OnNewFile + LDA.b #$FF : STA !FRESH_FILE_MARKER + + + JSL.l DarkWorldFlagSet + JSL.l MasterSwordFollowerClear + JSL.l InitOpenMode + LDA #$FF : STA !RNG_ITEM_LOCK_IN ; reset rng item lock-in +RTL +;-------------------------------------------------------------------------------- +!RNG_ITEM_LOCK_IN = "$7F5090" +OnNewFile: + REP #$20 ; set 16-bit accumulator + LDA.l StartingTime : STA $7EF454 + LDA.l StartingTime+2 : STA $7EF454+2 + SEP #$20 ; set 8-bit accumulator + ;LDA #$FF : STA !RNG_ITEM_LOCK_IN ; reset rng item lock-in +RTL +;-------------------------------------------------------------------------------- +OnLinkDamaged: + ;JSL.l FlipperKill + JSL.l OHKOTimer +RTL +;-------------------------------------------------------------------------------- +OnLinkDamagedFromPit: + JSL.l OHKOTimer + LDA.b #$14 : STA $11 ; thing we wrote over +RTL +;-------------------------------------------------------------------------------- +!RNG_ITEM_LOCK_IN = "$7F5090" +OnOWTransition: + JSL.l FloodGateReset + JSL.l FlipperFlag + JSL.l StatTransitionCounter + PHP + SEP #$20 ; set 8-bit accumulator + LDA.b #$FF : STA !RNG_ITEM_LOCK_IN ; clear lock-in + PLP +RTL +;-------------------------------------------------------------------------------- +PreItemGet: + LDA.b #$01 : STA !ITEM_BUSY ; mark item as busy +RTL +;-------------------------------------------------------------------------------- +PostItemGet: + ;LDA.b #$00 : STA !ITEM_BUSY ; mark item as finished +RTL +;-------------------------------------------------------------------------------- +PostItemAnimation: + LDA.b #$00 : STA !ITEM_BUSY ; mark item as finished + STZ $02E9 : LDA $0C5E, X ; thing we wrote over to get here +RTL +;-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/externalhooks.asm b/externalhooks.asm new file mode 100644 index 00000000..c3f751e6 --- /dev/null +++ b/externalhooks.asm @@ -0,0 +1,35 @@ +org $298000 ; 0x148000 +Ext_OnFileCreate: ;x +RTL : RTL : RTL : RTL : RTL +Ext_OnFileLoad: ;x immediately after load +RTL : RTL : RTL : RTL : RTL +Ext_OnFileSave: ;x immediately before save +RTL : RTL : RTL : RTL : RTL +Ext_OnPlayerDeath: ;x +RTL : RTL : RTL : RTL : RTL +Ext_OnMapUse: ;x +RTL : RTL : RTL : RTL : RTL +Ext_OnFairyRevive: ;x +RTL : RTL : RTL : RTL : RTL +Ext_OnYItemUse: ;x +RTL : RTL : RTL : RTL : RTL +Ext_OnIemMenuOpen: ;x +RTL : RTL : RTL : RTL : RTL +Ext_OnItemMenuClose: ;x +RTL : RTL : RTL : RTL : RTL +Ext_OnItemChange: ;x +RTL : RTL : RTL : RTL : RTL +Ext_OnPlayerDamaged: ;x +RTL : RTL : RTL : RTL : RTL +Ext_OnPlayerAttack: ;x +RTL : RTL : RTL : RTL : RTL +Ext_OnBossDeath: ;x +RTL : RTL : RTL : RTL : RTL +Ext_OnDungeonEnter: ;x +RTL : RTL : RTL : RTL : RTL +Ext_OnDungeonExit: ;x +RTL : RTL : RTL : RTL : RTL +Ext_OnDungeonCompleted: ;x +RTL : RTL : RTL : RTL : RTL +Ext_OnZeldaRescued: ;x +RTL : RTL : RTL : RTL : RTL diff --git a/fairyfixes.asm b/fairyfixes.asm new file mode 100644 index 00000000..c13b91cf --- /dev/null +++ b/fairyfixes.asm @@ -0,0 +1,26 @@ +;================================================================================ +; Fairy Changes & Fixes +;-------------------------------------------------------------------------------- +RefillHealthPlusMagic: + LDA BigFairyHealth : STA $7EF372 +RTL +;-------------------------------------------------------------------------------- +RefillHealthPlusMagic8bit: + LDA BigFairyHealth : STA $7EF372 + LDA BigFairyMagic : STA $7EF373 +RTL +;-------------------------------------------------------------------------------- +CheckFullHealth: + LDA BigFairyHealth : BEQ + + LDA $7EF36D : CMP $7EF36C : BNE .player_hp_not_full_yet + + + LDA BigFairyMagic : BEQ + + LDA $7EF36E : CMP.b #$80 : BNE .player_mp_not_full_yet + + + LDA.b #$00 +RTL + .player_hp_not_full_yet + .player_mp_not_full_yet + LDA.b #$01 +RTL +;-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/flipperkill.asm b/flipperkill.asm new file mode 100644 index 00000000..bb5d683d --- /dev/null +++ b/flipperkill.asm @@ -0,0 +1,44 @@ +;================================================================================ +; Fake Flippers Softlock Fix +;-------------------------------------------------------------------------------- +FlipperKill: + PHP + LDA $5D : CMP #$04 : BNE .done ; skip if we're not swimming + LDA $7EF356 : BNE .done ; skip if we have the flippers + LDA $7F5001 : BEQ .done ; skip if we're not marked in danger for softlock + JSL.l KillFairies ; take away fairies + LDA.b #$00 : STA $7EF36D ; kill link + LDA.b #$00 : STA $7F5001 ; mark fake flipper softlock as impossible + .done + PLP + LDA $7EF36D ; thing we wrote over +RTL +;-------------------------------------------------------------------------------- +KillFairies: + LDA $7EF35C : CMP #$06 : BNE + + LDA #$02 : STA $7EF35C + + LDA $7EF35D : CMP #$06 : BNE + + LDA #$02 : STA $7EF35D + + LDA $7EF35E : CMP #$06 : BNE + + LDA #$02 : STA $7EF35E + + LDA $7EF35F : CMP #$06 : BNE + + LDA #$02 : STA $7EF35F + + +RTL +;-------------------------------------------------------------------------------- +FlipperReset: + JSL $0998E8 ; AddTransitionSplash + LDA #$00 : STA $7F5001 ; mark fake flipper softlock as impossible + .done +RTL +;-------------------------------------------------------------------------------- +FlipperFlag: + LDA $5D : CMP #$04 : BNE .done ; skip if we're not swimming + LDA $7EF356 : BNE .safe ; skip if we have the flippers + LDA #$01 : STA $7F5001 ; mark fake flipper softlock as possible + BRA .done + .safe + LDA #$00 : STA $7F5001 ; mark fake flipper softlock as impossible + .done +RTL +;-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/floodgatesoftlock.asm b/floodgatesoftlock.asm new file mode 100644 index 00000000..63e0774c --- /dev/null +++ b/floodgatesoftlock.asm @@ -0,0 +1,13 @@ +;================================================================================ +; Floodgate Softlock Fix +;-------------------------------------------------------------------------------- +FloodGateAndMasterSwordFollowerReset: + JSL.l MasterSwordFollowerClear +FloodGateReset: + LDA.l Bugfix_SwampWaterLevel : BEQ + + LDA $7EF06E : AND.b #$7F : STA $7EF06E ; clear water room 55 + LDA $7EF06A : AND.b #$7F : STA $7EF06A ; clear water room 53 + + + LDA $7EF051 : AND.b #$FE : STA $7EF051 ; clear water room 40 - thing we wrote over +RTL +;================================================================================ \ No newline at end of file diff --git a/flute.asm b/flute.asm new file mode 100644 index 00000000..9afaaef6 --- /dev/null +++ b/flute.asm @@ -0,0 +1,61 @@ +;================================================================================ +; Randomize Flute Dig Item +;-------------------------------------------------------------------------------- +SpawnHauntedGroveItem: + LDA $8A : CMP.b #$2A : BEQ + : RTL : + ; Skip if not the haunted grove + LDA $1B : BEQ + : RTL : + ; Skip if indoors + + LDA.l HauntedGroveItem + JSL.l PrepDynamicTile + + LDA.b #$EB + STA $7FFE00 + JSL Sprite_SpawnDynamically + + LDX.b #$00 + LDA $2F : CMP.b #$04 : BEQ + : INX : + + + LDA .x_speeds, X : STA $0D50, Y + + LDA.b #$00 : STA $0D40, Y + LDA.b #$18 : STA $0F80, Y + LDA.b #$FF : STA $0B58, Y + LDA.b #$30 : STA $0F10, Y + + LDA $22 : !ADD .x_offsets, X + AND.b #$F0 : STA $0D10, Y + LDA $23 : ADC.b #$00 : STA $0D30, Y + + LDA $20 : !ADD.b #$16 : AND.b #$F0 : STA $0D00, Y + LDA $21 : ADC.b #$00 : STA $0D20, Y + + LDA.b #$00 : STA $0F20, Y + TYX + + LDX $8A ; haunted grove (208D0A) + LDA $7EF280, X : AND.b #$40 : BNE + + LDA.b #$1B : JSL Sound_SetSfx3PanLong + + +RTL + +;DATA - Flute Spawn Information +{ + +.x_speeds + db $F0 + db $10 + +.x_offsets + db $00 + db $13 + +} +;-------------------------------------------------------------------------------- +FluteBoy: + LDA $10 : CMP.b #$1A : BEQ + + LDA.b #$01 : STA $0FDD + JMP.l FluteBoy_Abort + + + LDA $0D80, X : CMP.b #$03 ; thing we wrote over +JMP.l FluteBoy_Continue +;-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/framehook.asm b/framehook.asm new file mode 100644 index 00000000..d4ed9815 --- /dev/null +++ b/framehook.asm @@ -0,0 +1,54 @@ +;================================================================================ +; Frame Hook +;-------------------------------------------------------------------------------- +; $7EF42Ew[2] - loop frame counter (low) +!LOOP_FRAMES_LOW = "$7EF42E" +;-------------------------------------------------------------------------------- +; $7EF430w[2] - loop frame counter (high) +!LOOP_FRAMES_HIGH = "$7EF430" +;-------------------------------------------------------------------------------- +; $7EF43Ew[2] - nmi frame counter (low) +!NMI_FRAMES_LOW = "$7EF43E" +;-------------------------------------------------------------------------------- +; $7EF440w[2] - nmi frame counter (high) +!NMI_FRAMES_HIGH = "$7EF440" +;-------------------------------------------------------------------------------- +; $7EF444w[2] - item menu frame counter (low) +!ITEM_FRAMES_LOW = "$7EF444" +;-------------------------------------------------------------------------------- +; $7EF446w[2] - item menu frame counter (high) +!ITEM_FRAMES_HIGH = "$7EF446" +;-------------------------------------------------------------------------------- +!LOCK_STATS = "$7EF443" +FrameHookAction: + JSL $0080B5 ; Module_MainRouting + PHA : PHP + LDA EnableSRAMTrace : AND.l TournamentSeedInverse : BEQ + + LDA $1A : BNE ++ : JSL.l WriteStatusPreview : ++ ; write every 256 frames + + + + LDA !LOCK_STATS : BNE ++ + REP #$20 ; set 16-bit accumulator + LDA !LOOP_FRAMES_LOW : INC : STA !LOOP_FRAMES_LOW : BNE + + LDA !LOOP_FRAMES_HIGH : INC : STA !LOOP_FRAMES_HIGH + + + LDA $10 : CMP.w #$010E : BNE + ; move this to nmi hook? + LDA !ITEM_FRAMES_LOW : INC : STA !ITEM_FRAMES_LOW : BNE + + LDA !ITEM_FRAMES_HIGH : INC : STA !ITEM_FRAMES_HIGH + + + SEP #$20 ; set 8-bit accumulator ?? check this + ++ + PLP : PLA +RTL +;-------------------------------------------------------------------------------- +NMIHookAction: + PHA : PHX : PHY : PHD ; thing we wrote over, push stuff + + LDA !LOCK_STATS : AND.w #$00FF : BNE ++ + LDA !NMI_FRAMES_LOW : INC : STA !NMI_FRAMES_LOW : BNE + + LDA !NMI_FRAMES_HIGH : INC : STA !NMI_FRAMES_HIGH + + + ++ + +JML.l NMIHookReturn +;-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/ganonfixes.asm b/ganonfixes.asm new file mode 100644 index 00000000..bff755c2 --- /dev/null +++ b/ganonfixes.asm @@ -0,0 +1,16 @@ +;================================================================================ +; Ganon Fixes +;================================================================================ + +;-------------------------------------------------------------------------------- +; GanonWarpRNG +; out: Accumulator - #$00 or #01 randomly, with no repeated #$01s +;-------------------------------------------------------------------------------- +GanonWarpRNG: + JSL GetRandomInt : AND.b #$01 : BEQ .zero + LDA !GANON_WARP_CHAIN : EOR #$01 : STA !GANON_WARP_CHAIN +RTL + .zero + STA !GANON_WARP_CHAIN +RTL +;-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/glitched.asm b/glitched.asm new file mode 100644 index 00000000..dbcf8c2a --- /dev/null +++ b/glitched.asm @@ -0,0 +1,16 @@ +;================================================================================ +; Glitched Mode Fixes +;================================================================================ +GetAgahnimType: + PHP + REP #$20 ; set 16-bit accumulator + LDA $A0 ; these are all decimal because i got them that way + CMP.w #13 : BNE + ; Agahnim 2 room + LDA.w #$0006 ; Use Agahnim 2 + BRA .done + + ; Elsewhere + LDA.w #$0001 ; Use Agahnim 1 + .done + PLP +RTL +;-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/goalitem.asm b/goalitem.asm new file mode 100644 index 00000000..238ee7db --- /dev/null +++ b/goalitem.asm @@ -0,0 +1,27 @@ +;-------------------------------------------------------------------------------- +; $7F5010 - Scratch Space (Callee Preserved) +;-------------------------------------------------------------------------------- +!GOAL_COUNTER = "$7EF460" +DrawGoalIndicator: + LDA.l GoalItemRequirement : AND.w #$00FF : BNE + : RTL : + ; Star Meter + PHX + LDX.w #$0000 + + LDA.l GoalItemIcon : STA $7EC72C, X : INX #2 ; draw star icon and move the cursor + + LDA.l !GOAL_COUNTER + AND.w #$00FF + JSL.l HexToDec + LDA $7F5006 : AND.w #$00FF : ORA.w #$2400 : STA $7EC72C, X : INX #2 ; draw 10's digit and move the cursor + LDA $7F5007 : AND.w #$00FF : ORA.w #$2400 : STA $7EC72C, X : INX #2 ; draw 1's and move the cursor + + LDA.w #$2830 : STA $7EC72C, X : INX #2 ; draw slash and move the cursor + + LDA.l GoalItemRequirement + AND.w #$00FF + JSL.l HexToDec + LDA $7F5006 : AND.w #$00FF : ORA.w #$2400 : STA $7EC72C, X : INX #2 ; draw 10's digit and move the cursor + LDA $7F5007 : AND.w #$00FF : ORA.w #$2400 : STA $7EC72C, X : INX #2 ; draw 1's and move the cursor + PLX +RTL +;-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/halfmagicbat.asm b/halfmagicbat.asm new file mode 100644 index 00000000..52fab05a --- /dev/null +++ b/halfmagicbat.asm @@ -0,0 +1,15 @@ +;================================================================================ +; Randomize Half Magic Bat +;-------------------------------------------------------------------------------- +GetMagicBatItem: + JSL.l ItemSet_MagicBat + LDA MagicBatItem : CMP.b #$FF : BEQ .normalLogic + TAY + STZ $02E9 ; 0 = Receiving item from an NPC or message + JSL.l Link_ReceiveItem +RTL +.normalLogic + LDA HalfMagic + STA $7EF37B +RTL +;-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/hardmode.asm b/hardmode.asm new file mode 100644 index 00000000..5ec395f7 --- /dev/null +++ b/hardmode.asm @@ -0,0 +1,17 @@ +;================================================================================ +; Hard & Masochist Mode +;================================================================================ +CalculateSpikeFloorDamage: + REP #$20 ; set 16-bit accumulator + LDA $A0 ; these are all decimal because i got them that way + CMP.w #279 + SEP #$20 ; set 8-bit accumulator + BNE + + LDA.l ByrnaCaveSpikeDamage + STA $0373 + RTL + + + LDA $D055, Y + STA $0373 +RTL +;-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/hashalphabet.asm b/hashalphabet.asm new file mode 100644 index 00000000..50f77330 --- /dev/null +++ b/hashalphabet.asm @@ -0,0 +1,329 @@ +;-------------------------------------------------------------------------------- +; PrepHashAlphabet: +;-------------------------------------------------------------------------------- +PrepHashAlphabet: + LDA $11 : CMP.b #$03 : BNE + + LDA.b #$06 : STA $14 ; thing we wrote over + RTL + + + + LDA $00 : PHA + LDA $01 : PHA + LDA $02 : PHA + LDA $03 : PHA + LDA $04 : PHA + LDA $05 : PHA + LDA $06 : PHA + LDA $07 : PHA + + JSL.l NameHash + JSL.l LoadAlphabetTiles + JSL.l LoadAlphabetTilemap + + PLA : STA $07 + PLA : STA $06 + PLA : STA $05 + PLA : STA $04 + PLA : STA $03 + PLA : STA $02 + PLA : STA $01 + PLA : STA $00 +RTL +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; GetAlphabetPalette: +; In: X = Alphabet Index +; Out: A = Palette +;-------------------------------------------------------------------------------- +GetAlphabetPalette: + LDA.l .table, X +RTL +;-------------------------------------------------------------------------------- +.table +db $00, $0C, $04, $0C, $04, $00, $0C, $18 +db $08, $08, $08, $04, $00, $00, $0C, $08 +db $18, $0C, $18, $04, $04, $0C, $14, $00 +db $0C, $04, $08, $18, $04, $08, $04, $08 +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; GetAlphabetTileAddr: +; Notes: +; Assumes 16-bit accumulator +;-------------------------------------------------------------------------------- +GetAlphabetTileAddr: + ASL #6 + !ADD.w #$B800 ; $31:B800 +RTL +;-------------------------------------------------------------------------------- + +!ALPHA_TILE_WIDTH = "#$40" +!ALPHA_VRAM_DEST_BASE = "#$FA00" + +;-------------------------------------------------------------------------------- +; LoadAlphabetTiles +; In: +; $00 - Tile 0 +; $01 - Tile 1 +; $02 - Tile 2 +; $03 - Tile 3 +; $04 - Tile 4 +;-------------------------------------------------------------------------------- +LoadAlphabetTiles: + PHA : PHX + LDA $4300 : PHA ; preserve DMA parameters + LDA $4301 : PHA ; preserve DMA parameters + LDA $4302 : PHA ; preserve DMA parameters + LDA $4303 : PHA ; preserve DMA parameters + LDA $4304 : PHA ; preserve DMA parameters + LDA $4305 : PHA ; preserve DMA parameters + LDA $4306 : PHA ; preserve DMA parameters + ;-------------------------------------------------------------------------------- + LDA.b #$80 : STA $2115 ; write read increment on $2119 + LDA.b #$01 : STA $4300 ; set DMA transfer direction A -> B, bus A auto increment, double-byte mode + LDA.b #$18 : STA $4301 ; set bus B destination to VRAM register + + LDA.b !ALPHA_VRAM_DEST_BASE>>1 : STA $2116 ; write VRAM destination address + LDA.b !ALPHA_VRAM_DEST_BASE>>9 : STA $2117 ; write VRAM destination address + + LDA.b #GFX_Hash_Alphabet>>16 : STA $4304 ; set bus A source bank + + LDA $2100 : PHA : LDA.b #$80 : STA $2100 ; save screen state & turn screen off + LDX.b #$00 : - + + LDA $00, X + REP #$20 ; set 16-bit accumulator + AND.w #$001F ; mask to alphabet of 32 + JSL.l GetAlphabetTileAddr : STA $4302 ; set bus A source address to SRAM + + SEP #$20 ; set 8-bit accumulator + + LDA.b !ALPHA_TILE_WIDTH : STA $4305 : STZ $4306 ; set transfer size to 0x40 + LDA #$01 : STA $420B ; begin DMA transfer + + INX + CPX.b #$05 : !BLT - + PLA : STA $2100 ; put screen back however it was before + ;-------------------------------------------------------------------------------- + PLA : STA $4306 ; restore DMA parameters + PLA : STA $4305 ; restore DMA parameters + PLA : STA $4304 ; restore DMA parameters + PLA : STA $4303 ; restore DMA parameters + PLA : STA $4302 ; restore DMA parameters + PLA : STA $4301 ; restore DMA parameters + PLA : STA $4300 ; restore DMA parameters + PLX : PLA +RTL +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +;Hash Alphabet +!ALPHA_BOW = "#$0000" +!ALPHA_BOOM = "#$0001" +!ALPHA_HOOK = "#$0002" +!ALPHA_BOMB = "#$0003" +!ALPHA_SHROOM = "#$0004" +!ALPHA_POWDER = "#$0005" +!ALPHA_ROD = "#$0006" +!ALPHA_PENDANT = "#$0007" +!ALPHA_BOMBOS = "#$0008" +!ALPHA_ETHER = "#$0009" +!ALPHA_QUAKE = "#$000A" +!ALPHA_LAMP = "#$000B" +!ALPHA_HAMMER = "#$000C" +!ALPHA_SHOVEL = "#$000D" +!ALPHA_FLUTE = "#$000E" +!ALPHA_NET = "#$000F" +!ALPHA_BOOK = "#$0010" +!ALPHA_BOTTLE = "#$0011" +!ALPHA_POTION = "#$0012" +!ALPHA_CANE = "#$0013" +!ALPHA_CAPE = "#$0014" +!ALPHA_MIRROR = "#$0015" +!ALPHA_BOOTS = "#$0016" +!ALPHA_GLOVES = "#$0017" +!ALPHA_FLIPPERS = "#$0018" +!ALPHA_PEARL = "#$0019" +!ALPHA_SHIELD = "#$001A" +!ALPHA_TUNIC = "#$001B" +!ALPHA_HEART = "#$001C" +!ALPHA_MAP = "#$001D" +!ALPHA_COMPASS = "#$001E" +!ALPHA_KEY = "#$001F" +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +!BIGRAM = "$7EC900"; +;-------------------------------------------------------------------------------- +LoadAlphabetTilemap: + PHA : PHX : PHY : PHP + SEP #$10 ; 8-bit index registers + REP #$20 ; 16-bit accumulator + + LDX.b #$00 : - + LDA FileSelect_PlayerSelectText_Top, X + STA !BIGRAM, X + INX #2 + CPX #128 : !BLT - + + + SEP #$20 ; 8-bit accumulator + + LDY.b #00 + LDX.b #$00 : - + PHX : TYX : LDA $00, X : PLX + AND.b #$1F ; mask to alphabet of 32 + PHX : TAX : JSL.l GetAlphabetPalette : PLX + ORA.b #$01 + + STA !BIGRAM+28+1, X + STA !BIGRAM+28+1+2, X + STA !BIGRAM+28+64+1, X + STA !BIGRAM+28+64+1+2, X + INX #6 : INY + CPX #25 : !BLT - + + JSR DMAAlphabetTilemap: + + PLP : PLY : PLX : PLA +RTL +;-------------------------------------------------------------------------------- +; DMAAlphabetTilemap: +;-------------------------------------------------------------------------------- +DMAAlphabetTilemap: + PHA : PHX + LDA $4300 : PHA ; preserve DMA parameters + LDA $4301 : PHA ; preserve DMA parameters + LDA $4302 : PHA ; preserve DMA parameters + LDA $4303 : PHA ; preserve DMA parameters + LDA $4304 : PHA ; preserve DMA parameters + LDA $4305 : PHA ; preserve DMA parameters + LDA $4306 : PHA ; preserve DMA parameters + ;-------------------------------------------------------------------------------- + LDA.b #$01 : STA $4300 ; set DMA transfer direction A -> B, bus A auto increment, double-byte mode + LDA.b #$80 : STA $2115 ; write read increment on $2119 + LDA.b #$18 : STA $4301 ; set bus B destination to VRAM register + + LDA.b #$60 : STA $2116 ; write VRAM destination address + STA $2117 ; write VRAM destination address + + LDA.b #!BIGRAM : STA $4302 ; set bus A source address to WRAM + LDA.b #!BIGRAM>>8 : STA $4303 ; set bus A source address to WRAM + LDA.b #!BIGRAM>>16 : STA $4304 ; set bus A source bank + + LDA.b #$80 : STA $4305 : STZ $4306 ; set transfer size to 0x40 + + LDA $2100 : PHA : LDA.b #$80 : STA $2100 ; save screen state & turn screen off + LDA #$01 : STA $420B ; begin DMA transfer + PLA : STA $2100 ; put screen back however it was before + ;-------------------------------------------------------------------------------- + LDA.b #$00 : STA $4300 ; set DMA transfer direction A -> B, bus A auto increment, single-byte mode + LDA.b #$22 : STA $4301 ; set bus B destination to CGRAM register + + STZ $2121 ; write CGRAM destination address + + LDA.b #GFX_HUD_Palette : STA $4302 ; set bus A source address to WRAM + LDA.b #GFX_HUD_Palette>>8 : STA $4303 ; set bus A source address to WRAM + LDA.b #GFX_HUD_Palette>>16 : STA $4304 ; set bus A source bank + + LDA.b #$80 : STA $4305 : STZ $4306 ; set transfer size to 0x40 + + LDA $2100 : PHA : LDA.b #$80 : STA $2100 ; save screen state & turn screen off + LDA #$01 : STA $420B ; begin DMA transfer + PLA : STA $2100 ; put screen back however it was before + ;-------------------------------------------------------------------------------- + PLA : STA $4306 ; restore DMA parameters + PLA : STA $4305 ; restore DMA parameters + PLA : STA $4304 ; restore DMA parameters + PLA : STA $4303 ; restore DMA parameters + PLA : STA $4302 ; restore DMA parameters + PLA : STA $4301 ; restore DMA parameters + PLA : STA $4300 ; restore DMA parameters + PLX : PLA +RTS +;-------------------------------------------------------------------------------- +!FSTILE_SPACE = "$0188" + +!FSTILE_BRACKET_OPEN_TOP = "$1D8A" +!FSTILE_BRACKET_OPEN_BOTTOM = "$1D9A" + +!FSTILE_BRACKET_CLOSE_TOP = "$1D8B" +!FSTILE_BRACKET_CLOSE_BOTTOM = "$1D9B" +;-------------------------------------------------------------------------------- +FileSelect_PlayerSelectText_Top: +;db $60, $62, $00, $37 +dw !FSTILE_SPACE, !FSTILE_SPACE +dw !FSTILE_BRACKET_OPEN_TOP +dw !FSTILE_SPACE, $1D6C +dw !FSTILE_SPACE, $1D4E +dw !FSTILE_SPACE, $1D4E +dw !FSTILE_SPACE, $1D4D +dw !FSTILE_SPACE, !FSTILE_SPACE +dw !FSTILE_SPACE, $05A0, $05A1 +dw !FSTILE_SPACE, $05A4, $05A5 +dw !FSTILE_SPACE, $05A8, $05A9 +dw !FSTILE_SPACE, $05AC, $05AD +dw !FSTILE_SPACE, $05B0, $05B1 +dw !FSTILE_SPACE +dw !FSTILE_BRACKET_CLOSE_TOP +dw !FSTILE_SPACE, !FSTILE_SPACE +;-------------------------------------------------------------------------------- +FileSelect_PlayerSelectText_Bottom: +;db $60, $82, $00, $37 +dw !FSTILE_SPACE, !FSTILE_SPACE +dw !FSTILE_BRACKET_OPEN_BOTTOM +dw !FSTILE_SPACE, $1D7C +dw !FSTILE_SPACE, $1D5E +dw !FSTILE_SPACE, $1D5E +dw !FSTILE_SPACE, $1D5D +dw !FSTILE_SPACE, !FSTILE_SPACE +dw !FSTILE_SPACE, $05A2, $05A3 +dw !FSTILE_SPACE, $05A6, $05A7 +dw !FSTILE_SPACE, $05AA, $05AB +dw !FSTILE_SPACE, $05AE, $05AF +dw !FSTILE_SPACE, $05B2, $05B3 +dw !FSTILE_SPACE +dw !FSTILE_BRACKET_CLOSE_BOTTOM +dw !FSTILE_SPACE, !FSTILE_SPACE +;-------------------------------------------------------------------------------- +org $0CDE60 ; <- 65E60 +FileSelect_CopyFile_Top: +db $62, $A5, $00, $15 +dw $1D4C, !FSTILE_SPACE, $1D68, !FSTILE_SPACE, $1D69, !FSTILE_SPACE, $1D82, !FSTILE_SPACE, !FSTILE_SPACE, !FSTILE_SPACE, !FSTILE_SPACE +;dw $1CAC, !FSTILE_SPACE, $1D23, !FSTILE_SPACE, $1D89, !FSTILE_SPACE, $1D04, !FSTILE_SPACE, $1D89, !FSTILE_SPACE, $1D07 +;-------------------------------------------------------------------------------- +org $0CDE7A ; <- 65E7A +FileSelect_CopyFile_Bottom: +db $62, $C5, $00, $15 +dw $1D5C, !FSTILE_SPACE, $1D78, !FSTILE_SPACE, $1D79, !FSTILE_SPACE, $1D92, !FSTILE_SPACE, !FSTILE_SPACE, !FSTILE_SPACE, !FSTILE_SPACE +;dw $1CBC, !FSTILE_SPACE, $1D33, !FSTILE_SPACE, $1D99, !FSTILE_SPACE, $1D14, !FSTILE_SPACE, $1D99, !FSTILE_SPACE, $1D17 +;-------------------------------------------------------------------------------- +org $0CDE94 ; <- 65E94 +FileSelect_KillFile_Top: +db $63, $25, $00, $19 +dw $1D64, !FSTILE_SPACE, $1D62, !FSTILE_SPACE, $1D65, !FSTILE_SPACE, $1D65, !FSTILE_SPACE, !FSTILE_SPACE, !FSTILE_SPACE, !FSTILE_SPACE, !FSTILE_SPACE, !FSTILE_SPACE +;dw $1D64, !FSTILE_SPACE, $1D62, !FSTILE_SPACE, $1D65, !FSTILE_SPACE, $1D65, !FSTILE_SPACE, $1D04, !FSTILE_SPACE, $1D89, !FSTILE_SPACE, $1D07 +;-------------------------------------------------------------------------------- +;org $0CDEB2 ; <- 65EB2 +;FileSelect_KillFile_Bottom: +db $63, $45, $00, $19 +dw $1D74, !FSTILE_SPACE, $1D72, !FSTILE_SPACE, $1D75, !FSTILE_SPACE, $1D75, !FSTILE_SPACE, !FSTILE_SPACE, !FSTILE_SPACE, !FSTILE_SPACE, !FSTILE_SPACE, !FSTILE_SPACE +;dw $1D74, !FSTILE_SPACE, $1D72, !FSTILE_SPACE, $1D75, !FSTILE_SPACE, $1D75, !FSTILE_SPACE, $1D14, !FSTILE_SPACE, $1D99, !FSTILE_SPACE, $1D17 +;-------------------------------------------------------------------------------- +;org $0CDDE8 ; <- 65DE8 +;FileSelect_PlayerSelectText_Top: +;db $60, $62, $00, $37 +;db $8A, $1D, $88, $01, $69, $1D, $88, $01, $65, $1D, $88, $01, $4A, $1D, $88, $01 +;db $82, $1D, $88, $01, $4E, $1D, $88, $01, $6B, $1D, $88, $01, $88, $01, $6C, $1D +;db $88, $01, $4E, $1D, $88, $01, $65, $1D, $88, $01, $4E, $1D, $88, $01, $4C, $1D +;db $88, $01, $6D, $1D, $88, $01, $8B, $1D +;-------------------------------------------------------------------------------- +;org $0CDE24 ; <- 65E24 +;FileSelect_PlayerSelectText_Bottom: +;db $60, $82, $00, $37 +;db $9A, $1D, $88, $01, $79, $1D, $88, $01, $75, $1D, $88, $01, $5A, $1D, $88, $01 +;db $92, $1D, $88, $01, $5E, $1D, $88, $01, $7B, $1D, $88, $01, $88, $01, $7C, $1D +;db $88, $01, $5E, $1D, $88, $01, $75, $1D, $88, $01, $5E, $1D, $88, $01, $5C, $1D +;db $88, $01, $7D, $1D, $88, $01, $9B, $1D +;-------------------------------------------------------------------------------- diff --git a/hashalphabet.chr.gfx b/hashalphabet.chr.gfx new file mode 100644 index 00000000..b2579bfc --- /dev/null +++ b/hashalphabet.chr.gfx @@ -0,0 +1 @@ +ÿÿÿÇÿ€ÿ¸ŸþÏÿçÿóÿÿÿÿáÿñÿ1ÿ-ÿßÿ§ÿgûþÿýÎûŸ÷ûïóÿ÷ÿÿÿÿãÿóó?ùŸùÏùïóÿÿÿÿÿÿÿÿÀÿÿ¿ÿ€ÿÀÿÿÿÿÿÿÿÿÿçÿ÷÷÷ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ÷Ÿ÷Ÿ÷Ÿ÷Ÿ÷Ÿ÷ŸÿÏÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿáÿùÿåÿýÿOÿÿÿüÿøÿõÿïóßç¿ÏÿŸÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþýÿòÿá÷èÿÀÿÿŸÿmÿs¿ÿOÿ‡Ï7çïÐïÐÿÀÿàÿàÿðÿüÿÿ÷ ÷ ÿÿÿÿÿ?ÿÿÿÿÿþÿøÿðÿðÿàÿÀÿ€ÿÿÿÿ¿Oïwïçÿ€ÿ€ÿÀûÿðÿðÿøÿÿÿÿÿaŸóÿÿÿÿÿÿÿÿýû½ó¾ù×üãÿÖÿ¿ùÿÿ߻ϷÙÿÿçÿÿç¿ðÿàÿàÿàÿàÿðÿüÿÿs‡yÇ9Ï1ÿÿÿÿÿÿÿÿÿÿÿÿÿþÿýÿýÿþÿÿÿÿÁÝãÝ£ãw‰oןÿüÿøÿõÿïóßç¿ÏÿŸÿÿoÿŸÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿøÿ÷ÿïÿîÿñÿÿÿÿoÿ÷ÿ{ÿ»ÿÝÿÝÿûÿçùÇøÎñáÞ÷ÈÿáÿÿÝÿ½ÿ½ÿ½ÿÛÿçÿÿÿÿÿÿÿüÿðÿéöÙæÛäºÅ¼Ãÿÿ?ÿÏ?÷ûƒaŸ9Çœã†ùÁþßàïðóüüÿÿÿ=Ã]£Û'›g—oÿ?ÿÿÿÿÿüÿòýîñÜãÜã¸Ç¸Çÿÿ?ÿÏ?÷ûûý ó°Ï¿Àßàßàïðóüüÿÿÿãã;Ç;ÇwO¿?ÿÿÿÿÿüÿóüïðßàßà¹Æïÿÿ?ÿÏ?÷ûûíÅ;£Ü·Èßàßàïðóüüÿÿÿ ÷cûû÷Ï??ÿÿÿÿÿþÿüÿýÿÿðÿà÷ÿ÷þÿÿÿ?ÿ¿ÿÿÿïÿï÷þ÷þ÷ü÷ü÷þóþÿàÿÿ/ÿ/ÿï?¯¯Ïÿÿÿÿþÿüþùýòûäÿàÿðÿøÿ÷?sŸ9ÏŸgÏ3ÿó ÿüóþáÿÁÿƒÿ‡ÿÏÿÿÿûÿÿÿ‡ÿÏÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ÷ÿçÿÃþÿÿÿç÷Ëÿáßá¿ËŸÿ?Çü‡üƒÿ¨ÿ°ÿ˜ÿÁÿÿÿÿÿÿÿÿ?ÿÿÿÿÿÿÿÿÿÿÿÿÿþÿúÿðùî÷èÿÿÿÿÿÃÿ £ÿÿ‡ÿÿÀÿÐÿÁÿÀÿÁÿãÿÿÿÿÿÿßÿ?ÿÿ_ÿ¿ÿÿÿÿÿÿðÿåÿÊÿ…ÿŠÿ…ÿÀÿÿÿÿÿ¯ÿWÿ£ÿ]ÿ=ÿàÿüÿþÿþóÿãÿÇÿÏÿÿ}ÿûÿ÷ÿïÿÿÿÿÿÿÿÿÿÿÿàÿÀøÇøÇÿÀÿÀÿÀÿÿÿÿççÿÿÿÿÅÿÀÿÀÿÏøßÿÏÿàÿÿÿWÿÿÿÿÿÿÿÿÿÿÿÿøÿóÿðÿøÿ÷ÿïÿßÿÿÿÿÏÿÿÿïÿ×ÿëÿßÿßÿßÿßÿßÿçÿøÿÿÿãÿãÿãÿëÿÛÿçÿÿÿÿÿÿøÿóÿðÿøÿ÷ÿïÿ×ïÿÿÿÏÿÿÿïÿ÷ÿë÷ØçßàßàßàÞáçøøÿÿÿç£_ãëÛ'çÿÿÿÿÿÿÿÿÿÿþÿþÿþÿþÿüÿÿÿ‡ÿÿ1ÿyÿyñ¿aÿüýúÿñÿãÿÇÿÿŸÿÿ¿sÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿŸàçø¹ÞÞçßáÿÿÿ¿ÿÿÿ?¿oÏÿßàßà¿À¿À¿ÀÎñðÿÿÿÿÿ‡ÿA=ãcÿÿÿÿÿÿÿÿÿøÿóýçúÏôŸùžóÿÿÿÿÏ?ç_³Ïyù/ùö›øÏýçÿóÿþÿüÿüÿÿoùßó¿çÿÏÿÿ?ÿ?ÿÿÿÿÿÿÿüÿüÿüÿþÿýÿüÿÿÿÿÿ;ƒsÿÿÿûþýýþþûýãóÌÿ€ÿ€ÿÿÿsƒÿ‡ÿ ÿÿ#ÿÿÿÿòÿóý÷ÿøÿøÿËÿÇüÿÿÿo¿oÿŸ÷÷ÿûÿ÷ãÿàÿòÿüÿøÿøÿþÿÿÿûÿwÿÿÿ—ÿ—ÿÿÿÿÿþÿ¿ú¿âÿ’ÿ’ÿÊÿÊÿÿÿ}ßýGÿIÿIÿSÿSÿÄÿàÿáÿãÿóýóþùÿüÿ#ÿÿ‡ÿÇÿÏ¿ÏŸÿ?ÿÿÿÿüÿóüïóï÷×ïßíÿÿÿÿ?ÿÏÿ·ÿÿ»ÿÛÿÛöÕïìóàÿðÿüÿÿÿÿÿËÿû÷¯÷Ï??ÿÿÿÿÿÿÿÇÿÀÿØÿßïÜïÙïÓîÿÿóï+ÿïÿƒ}ïÿ«{¯ÞåÝâûäïùÆ»éÿüïÿÿû7Ûw»÷wïïßß??ÿÿÿÿÿÿüÿóûÏûûýþ“ÿÿÿ?ÿÏßóßñßð¿àÉÿÑÿàçÿøÿÿçÿøÿÿÿÿÿ‹ÿçÿÿÿçÿÿÿÿÿÿÿÿÿãÿÝã¾Á¿À¿À¿ÀÿÿÿÿÇÿ»Ç}ƒýýýßàïð÷øûüýþþÿÿÿÿÿû÷ïß?¿ÿÿÿÿÿÿÿÿøþñüóþáøçüãðÏÿÿÿ÷;g¹{½­ÿMïUùÆážýŸûߺïÜÿãÿÿç›Ã¿Ã?ƒ‡‡ÿ‡ÿÿÿÿøÿçÿßþßü¿ø¹ÿ¸ÿÿÿÿçÿûû?ýÿÿÜ¿Þ¿çŸøÇÿÀÿàÿøÿÿ;ý{ýçùãÿÿÿÿÿÿÿÿßÿÌÿàÿàÿôÿæÿâÿÿÿûÿ3ÿÿÿ/ÿgÿGÿðÿüÿþÿþÿþÿþÿþÿÿÿÿ?ÿÿÿ?ÿÿÿÿ \ No newline at end of file diff --git a/heartbeep.asm b/heartbeep.asm new file mode 100644 index 00000000..e8f9bd1d --- /dev/null +++ b/heartbeep.asm @@ -0,0 +1,12 @@ +;================================================================================ +; Heart Beep Logic +;================================================================================ +BeepLogic: + LDA.l HeartBeep : BEQ + + STA $04CA + LDA.b #$2B : STA $012E +RTL + + + LDA.b #$FF : STA $04CA +RTL +;================================================================================ \ No newline at end of file diff --git a/heartpieces.asm b/heartpieces.asm new file mode 100644 index 00000000..37f7116b --- /dev/null +++ b/heartpieces.asm @@ -0,0 +1,395 @@ +;================================================================================ +; Randomize Heart Pieces +;-------------------------------------------------------------------------------- +HeartPieceGet: + PHX : PHY + JSL.l LoadHeartPieceRoomValue : TAY ; load item value into Y register + JSL.l MaybeMarkDigSpotCollected + + .skipLoad + + 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 $7EF36B : INC A : AND.b #$03 : STA $7EF36B : BNE .unfinished_heart ; add up heart quarters + BRA .giveItem + + .notHeart + + .giveItem + JSL.l $0791B3 ; Player_HaltDashAttackLong + JSL.l Link_ReceiveItem + CLC ; return false + BRL .done ; finished + + .unfinished_heart + SEC ; return true + .done + + JSL MaybeUnlockTabletAnimation + + PLY : PLX +RTL +;-------------------------------------------------------------------------------- +HeartContainerGet: + PHX : PHY + JSL.l LoadHeartContainerRoomValue : TAY ; load item value into Y register + + BRA HeartPieceGet_skipLoad +;-------------------------------------------------------------------------------- +!REDRAW = "$7F5000" +DrawHeartPieceGFX: + PHP + JSL.l Sprite_IsOnscreen : BCC .offscreen + + PHA : PHY + LDA !REDRAW : BEQ .skipInit ; skip init if already ready + JSL.l HeartPieceSpritePrep + BRL .done ; don't draw on the init frame + + .skipInit + JSL.l LoadHeartPieceRoomValue + + .skipLoad + + PHA + JSL.l IsNarrowSprite : BCC + + LDA $0E60, X : ORA.b #$20 : STA $0E60, X + + + ;LDA $0E60, X : ORA.b #$10 : STA $0E60, X + + PLA + + JSL.l DrawDynamicTile + JSL.l Sprite_DrawShadowLong + + .done + PLY : PLA + .offscreen + PLP +RTL +;-------------------------------------------------------------------------------- +!REDRAW = "$7F5000" +DrawHeartContainerGFX: + PHP + JSL.l Sprite_IsOnscreen : BCC DrawHeartPieceGFX_offscreen + + PHA : PHY + LDA !REDRAW : BEQ .skipInit ; skip init if already ready + JSL.l HeartContainerSpritePrep + BRA DrawHeartPieceGFX_done ; don't draw on the init frame + + .skipInit + JSL.l LoadHeartContainerRoomValue + + BRA DrawHeartPieceGFX_skipLoad +;-------------------------------------------------------------------------------- +HeartContainerSound: + CPY.b #$20 : BEQ + ; Skip for Crystal + CPY.b #$37 : BEQ + ; Skip for Pendants + CPY.b #$38 : BEQ + + CPY.b #$39 : BEQ + + JSL.l CheckIfBossRoom : BCC + ; Skip if not in a boss room + LDA.b #$2E + SEC + RTL + + + CLC +RTL +;-------------------------------------------------------------------------------- +NormalItemSkipSound: + LDA $0C5E, X ; thing we wrote over + + CPY.b #$20 : BEQ + ; Skip for Crystal + CPY.b #$37 : BEQ + ; Skip for Pendants + CPY.b #$38 : BEQ + + CPY.b #$39 : BEQ + + + PHA + JSL.l CheckIfBossRoom + PLA +RTL + + + CLC +RTL +;-------------------------------------------------------------------------------- +HeartUpgradeSpawnDecision: ; this should return #$00 to make the hp spawn + LDA !FORCE_HEART_SPAWN : BEQ .normal_behavior + + DEC : STA !FORCE_HEART_SPAWN + LDA #$00 +RTL + + .normal_behavior + LDA $7EF280, X +RTL +;-------------------------------------------------------------------------------- +SaveHeartCollectedStatus: + LDA !SKIP_HEART_SAVE : BEQ .normal_behavior + + DEC : STA !SKIP_HEART_SAVE +RTL + + .normal_behavior + LDA $7EF280, X : ORA.b #$40 : STA $7EF280, X +RTL +;-------------------------------------------------------------------------------- +!REDRAW = "$7F5000" +HeartPieceSpritePrep: + PHA + + LDA #$01 : STA !REDRAW + LDA $5D : CMP #$14 : BEQ .skip ; skip if we're mid-mirror + + LDA #$00 : STA !REDRAW + JSL.l LoadHeartPieceRoomValue ; load item type + JSL.l PrepDynamicTile + + .skip + PLA +RTL +;-------------------------------------------------------------------------------- +!REDRAW = "$7F5000" +HeartContainerSpritePrep: + PHA + + LDA #$00 : STA !REDRAW + JSL.l LoadHeartContainerRoomValue ; load item type + JSL.l PrepDynamicTile + + PLA +RTL +;-------------------------------------------------------------------------------- +LoadHeartPieceRoomValue: + LDA $1B : BEQ .outdoors ; check if we're indoors or outdoors + .indoors + JSL.l LoadIndoorValue + BRL .done + .outdoors + JSL.l LoadOutdoorValue + .done +RTL +;-------------------------------------------------------------------------------- +!REDRAW = "$7F5000" +HPItemReset: + JSL $09AD58 ; GiveRupeeGift - thing we wrote over + PHA : LDA #$01 : STA !REDRAW : PLA +RTL +;-------------------------------------------------------------------------------- +MaybeMarkDigSpotCollected: + PHA : PHP + LDA $1B : BNE + + REP #$20 ; set 16-bit accumulator + LDA $8A + CMP.w #$2A : BNE + + LDA !HAS_GROVE_ITEM : ORA.w #$0001 : STA !HAS_GROVE_ITEM + + + PLP : PLA +RTL +;-------------------------------------------------------------------------------- +LoadIndoorValue: + PHP + REP #$20 ; set 16-bit accumulator + LDA $A0 ; these are all decimal because i got them that way + CMP.w #225 : BNE + + LDA HeartPiece_Forest_Thieves + BRL .done + + CMP.w #226 : BNE + + LDA HeartPiece_Lumberjack_Tree + BRL .done + + CMP.w #234 : BNE + + LDA HeartPiece_Spectacle_Cave + BRL .done + + CMP.w #283 : BNE + + LDA $22 : XBA : AND.w #$0001 ; figure out where link is + BNE ++ + LDA HeartPiece_Circle_Bushes + BRL .done + ++ + LDA HeartPiece_Graveyard_Warp + BRL .done + + CMP.w #294 : BNE + + LDA HeartPiece_Mire_Warp + BRL .done + + CMP.w #295 : BNE + + LDA HeartPiece_Smith_Pegs + BRL .done + + CMP.w #135 : BNE + + LDA StandingKey_Hera + BRL .done + + + LDA.w #$0017 ; default to a normal hp + .done + AND.w #$00FF ; the loads are words but the values are 1-byte so we need to clear the top half of the accumulator - no guarantee it was 8-bit before + PLP +RTL +;-------------------------------------------------------------------------------- +;225 - HeartPiece_Forest_Thieves +;226 - HeartPiece_Lumberjack_Tree +;234 - HeartPiece_Spectacle_Cave +;283 - HeartPiece_Circle_Bushes +;283 - HeartPiece_Graveyard_Warp +;294 - HeartPiece_Mire_Warp +;295 - HeartPiece_Smith_Pegs +;-------------------------------------------------------------------------------- +LoadOutdoorValue: + PHP + REP #$20 ; set 16-bit accumulator + LDA $8A + CMP.w #$03 : BNE + + LDA $22 : CMP.w #1890 : !BLT ++ + LDA HeartPiece_Spectacle + BRL .done + ++ + LDA EtherItem + BRL .done + + CMP.w #$05 : BNE + + LDA HeartPiece_Mountain_Warp + BRL .done + + CMP.w #$28 : BNE + + LDA HeartPiece_Maze + BRL .done + + CMP.w #$2A : BNE + + LDA HauntedGroveItem + BRL .done + + CMP.w #$30 : BNE + + LDA $22 : CMP.w #512 : !BGE ++ + LDA HeartPiece_Desert + BRL .done + ++ + LDA BombosItem + BRL .done + + CMP.w #$35 : BNE + + LDA HeartPiece_Lake + BRL .done + + CMP.w #$3B : BNE + + LDA HeartPiece_Swamp + BRL .done + + CMP.w #$42 : BNE + + LDA HeartPiece_Cliffside + BRL .done + + CMP.w #$4A : BNE + + LDA HeartPiece_Cliffside + BRL .done + + CMP.w #$5B : BNE + + LDA HeartPiece_Pyramid + BRL .done + + CMP.w #$68 : BNE + + LDA HeartPiece_Digging + BRL .done + + CMP.w #$81 : BNE + + LDA HeartPiece_Zora + BRL .done + + + LDA.w #$0017 ; default to a normal hp + .done + AND.w #$00FF ; the loads are words but the values are 1-byte so we need to clear the top half of the accumulator - no guarantee it was 8-bit before + PLP +RTL +;-------------------------------------------------------------------------------- +;$03 - HeartPiece_Spectacle +;$05 - HeartPiece_Mountain_Warp +;$28 - HeartPiece_Maze +;$30 - HeartPiece_Desert +;$35 - HeartPiece_Lake +;$3B - HeartPiece_Swamp +;$42 - HeartPiece_Cliffside - not really but the gfx load weird otherwise +;$4A - HeartPiece_Cliffside +;$5B - HeartPiece_Pyramid +;$68 - HeartPiece_Digging +;$81 - HeartPiece_Zora +;-------------------------------------------------------------------------------- +LoadHeartContainerRoomValue: +LoadBossValue: + PHP + REP #$20 ; set 16-bit accumulator + LDA $A0 ; these are all decimal because i got them that way + CMP.w #200 : BNE + + LDA HeartContainer_ArmosKnights + BRL .done + + CMP.w #51 : BNE + + LDA HeartContainer_Lanmolas + BRL .done + + CMP.w #7 : BNE + + LDA HeartContainer_Moldorm + BRL .done + + CMP.w #90 : BNE + + LDA HeartContainer_HelmasaurKing + BRL .done + + CMP.w #6 : BNE + + LDA HeartContainer_Arrghus + BRL .done + + CMP.w #41 : BNE + + LDA HeartContainer_Mothula + BRL .done + + CMP.w #172 : BNE + + LDA HeartContainer_Blind + BRL .done + + CMP.w #222 : BNE + + LDA HeartContainer_Kholdstare + BRL .done + + CMP.w #144 : BNE + + LDA HeartContainer_Vitreous + BRL .done + + CMP.w #164 : BNE + + LDA HeartContainer_Trinexx + BRL .done + + + LDA.w #$003E ; default to a normal boss heart + .done + AND.w #$00FF ; the loads are words but the values are 1-byte so we need to clear the top half of the accumulator - no guarantee it was 8-bit before + PLP +RTL +;-------------------------------------------------------------------------------- +CheckIfBossRoom: +;-------------------------------------------------------------------------------- +; Carry set if we're in a boss room, unset otherwise. +;-------------------------------------------------------------------------------- + REP #$20 ; set 16-bit accumulator + LDA $A0 ; these are all decimal because i got them that way + CMP.w #200 : BNE + + SEC : BRL .done + + CMP.w #51 : BNE + + SEC : BRL .done + + CMP.w #7 : BNE + + SEC : BRL .done + + CMP.w #90 : BNE + + SEC : BRL .done + + CMP.w #6 : BNE + + SEC : BRL .done + + CMP.w #41 : BNE + + SEC : BRL .done + + CMP.w #172 : BNE + + SEC : BRL .done + + CMP.w #222 : BNE + + SEC : BRL .done + + CMP.w #144 : BNE + + SEC : BRL .done + + CMP.w #164 : BNE + + SEC : BRL .done + + + CLC + .done + SEP #$20 ; set 8-bit accumulator +RTL +;-------------------------------------------------------------------------------- +;#200 - Eastern Palace - Armos Knights +;#51 - Desert Palace - Lanmolas +;#7 - Tower of Hera - Moldorm +;#32 - Agahnim's Tower - Agahnim I +;#90 - Palace of Darkness - Helmasaur King +;#6 - Swamp Palace - Arrghus +;#41 - Skull Woods - Mothula +;#172 - Thieves' Town - Blind +;#222 - Ice Palace - Kholdstare +;#144 - Misery Mire - Vitreous +;#164 - Turtle Rock - Trinexx +;#13 - Ganon's Tower - Agahnim II +;#0 - Pyramid of Power - Ganon +;-------------------------------------------------------------------------------- +;JSL $06DD40 ; DashKey_Draw +;JSL $06DBF8 ; Sprite_PrepAndDrawSingleLargeLong +;JSL $06DC00 ; Sprite_PrepAndDrawSingleSmallLong ; draw first cell correctly +;JSL $00D51B ; GetAnimatedSpriteTile +;JSL $00D52D ; GetAnimatedSpriteTile.variable +;================================================================================ diff --git a/hooks.asm b/hooks.asm new file mode 100644 index 00000000..f8775f3a --- /dev/null +++ b/hooks.asm @@ -0,0 +1,1555 @@ +;================================================================================ +; Init Hook +;-------------------------------------------------------------------------------- +org $00802F ; <- 2F - Bank00.asm : 45 +JSL.l Init_Primary +NOP +;-------------------------------------------------------------------------------- + +;================================================================================ +; Frame Hook +;-------------------------------------------------------------------------------- +org $008056 ; <- 56 - Bank00.asm : 77 +JSL.l FrameHookAction +;-------------------------------------------------------------------------------- + +;================================================================================ +; NMI Hook +;-------------------------------------------------------------------------------- +org $0080CC ; <- CC - Bank00.asm : 164 (PHA : PHX : PHY : PHD : PHB) +JML.l NMIHookAction +org $0080D0 ; <- D0 - Bank00.asm : 164 (PHA : PHX : PHY : PHD : PHB) +NMIHookReturn: +;-------------------------------------------------------------------------------- + +;================================================================================ +; Dungeon Entrance Hook +;-------------------------------------------------------------------------------- +org $02D8C7 ; <- 158C7 - Bank02.asm : 10981 (STA $7EC172) +JSL.l OnDungeonEntrance +;-------------------------------------------------------------------------------- + +;================================================================================ +; Hash Key Display +;-------------------------------------------------------------------------------- +org $0CCDB5 ; <- 64DB5 - Bank0C.asm : 1776 (LDA.b #$06 : STA $14) +JSL.l PrepHashAlphabet +;-------------------------------------------------------------------------------- + +;================================================================================ +; Agahnim 0bb +;-------------------------------------------------------------------------------- +org $1ED6EF ; <- F56EF - sprite_agahnim.asm : 636 (JSL GetRandomInt : AND.b #$01 : BNE BRANCH_GAMMA) +NOP #18 +;-------------------------------------------------------------------------------- + +;================================================================================ +; Stat Hooks +;-------------------------------------------------------------------------------- +org $079202 ; 39202 <- Bank07.asm : 2859 (JSL AddDashTremor) +JSL.l StatBonkCounter +;-------------------------------------------------------------------------------- +org $02B797 ; <- 13797 - Bank02.asm : 8712 (LDA.b #$19 : STA $10) +JSL.l StatsFinalPrep +;-------------------------------------------------------------------------------- +org $07A95B ; <- 3A95B - Bank07.asm : 6565 (JSL Dungeon_SaveRoomData) +JSL.l IncrementUWMirror +;-------------------------------------------------------------------------------- +org $0288D1 ; <- 108D1 - Bank02.asm : 1690 (STZ $0646) +JSL.l IndoorSubtileTransitionCounter +NOP #2 +;-------------------------------------------------------------------------------- +org $02895D ; <- 1095D - Bank02.asm : 1812 (JSL Dungeon_LoadRoom) +JSL.l IndoorTileTransitionCounter +;-------------------------------------------------------------------------------- +org $07B574 ; <- 3B574 - Bank07.asm : 8519 (LDA.b #$01 : STA $02E9) +JSL.l IncrementChestCounter +NOP +;-------------------------------------------------------------------------------- +;org $05FC7E ; <- 2FC7E - sprite_dash_item.asm : 118 (LDA $7EF36F : INC A : STA $7EF36F) +;JSL.l IncrementSmallKeys +;-------------------------------------------------------------------------------- +org $06D18D ; <- 3518D - sprite_absorbable.asm : 274 (LDA $7EF36F : INC A : STA $7EF36F) +JSL.l IncrementSmallKeys +;-------------------------------------------------------------------------------- +org $00F945 ; <- 7945 - Bank00.asm : 8557 (JSL SavePalaceDeaths) +JSL.l StatTransitionCounter ; we're not bothering to restore the instruction we wrote over +;-------------------------------------------------------------------------------- +org $02B6F3 ; <- 136F3 - Bank02.asm : 8600 (LDA.b #$0F : STA $10) +JSL.l DungeonExitTransition +;-------------------------------------------------------------------------------- +org $1BBD6A ; <- DBD6A - Bank1B.asm : 301 (LDA.b #$0F : STA $10) +JSL.l DungeonExitTransition +;-------------------------------------------------------------------------------- +org $01C3A7 ; <- C3A7 - Bank01.asm : 9733 (JSL Dungeon_SaveRoomQuadrantData) +JSL.l DungeonStairsTransition +;-------------------------------------------------------------------------------- +org $0BFFAC ; <- 5FFAC - Bank0B.asm : 170 (JSL Dungeon_SaveRoomQuadrantData) +JSL.l DungeonStairsTransition +;-------------------------------------------------------------------------------- +org $029A17 ; <- 11A17 - Bank02.asm : 4770 (JSL EnableForceBlank) +JSL.l DungeonHoleEntranceTransition +;-------------------------------------------------------------------------------- +org $0794EB ; <- 394EB - Bank07.asm : 3325 (LDA $01C31F, X : STA $0476) +JSL.l DungeonHoleWarpTransition +;-------------------------------------------------------------------------------- +org $0CC999 ; <- 64999 - Bank0C.asm : 1087 (LDA.b #$0F : STA $13) +NOP #4 +;-------------------------------------------------------------------------------- +org $01ED75 ; <- ED75 - Bank01.asm : 13963 (JSL Dungeon_SaveRoomQuadrantData) +JSL.l IncrementBigChestCounter +;-------------------------------------------------------------------------------- + +;================================================================================ +; Dialog Override +;-------------------------------------------------------------------------------- +;org $0EEE8D ; 0x76E8D <- vwf.asm : 152 (LDA $7F71C0, X : STA $04) +;JSL.l DialogOverride +;NOP #7 +;-------------------------------------------------------------------------------- +org $0EF1FF ; 0x771FF <- vwf.asm : 1212 (LDA $7F1200, X : AND.w #$007F : SUB.w #$0066 : BPL .commandByte) +JSL.l DialogOverride +org $0EF2DC ; every other LDA $7F1200, X in vwf.asm +JSL.l DialogOverride +org $0EF315 +JSL.l DialogOverride +org $0EF332 +JSL.l DialogOverride +org $0EF375 +JSL.l DialogOverride +org $0EF394 +JSL.l DialogOverride +org $0EF511 +JSL.l DialogOverride +org $0EF858 +JSL.l DialogOverride +org $0EFA26 +JSL.l DialogOverride +org $0EFA4C +JSL.l DialogOverride +org $0EFAB4 +JSL.l DialogOverride +org $0EFAC8 +JSL.l DialogOverride +org $0EFAE1 +JSL.l DialogOverride +org $0EFB11 +JSL.l DialogOverride +;-------------------------------------------------------------------------------- +org $0EFBC6 ; <- 77BC6 - vwf.asm : 2717 (LDA.b #$1C : STA $1CE9) +JSL.l ResetDialogPointer +RTS +;-------------------------------------------------------------------------------- + +;================================================================================ +; Master Sword Chest Fix +;-------------------------------------------------------------------------------- +;org $0987d7 ; <- ancilla_init.asm : 1071 +;NOP #4 +;-------------------------------------------------------------------------------- + +;================================================================================ +; Sprite_DrawMultiple +;-------------------------------------------------------------------------------- +org $05DFB1 ; <- 2DFB1 - Bank05.asm : 2499 +JSL.l SkipDrawEOR +;-------------------------------------------------------------------------------- + +;================================================================================ +; Kiki Big Bomb Fix +;-------------------------------------------------------------------------------- +org $1EE4AF ; <- f64af sprite_kiki.asm : 285 (LDA.b #$0A : STA $7EF3CC) +JSL.l AssignKiki +NOP #2 +;-------------------------------------------------------------------------------- + +;================================================================================ +; Hard & Masochist Mode Fixes +;-------------------------------------------------------------------------------- +org $07D22B ; <- 3D22B - Bank05.asm : 12752 (LDA $D055, Y : STA $0373) +JSL.l CalculateSpikeFloorDamage : NOP #2 +;-------------------------------------------------------------------------------- + +;================================================================================ +; Misc Stats +;-------------------------------------------------------------------------------- +org $029E2E ; <- 11E2E - module_ganon_emerges.asm : 59 (JSL Dungeon_SaveRoomData.justKeys) +JSL.l IncrementAgahnim2Sword +;-------------------------------------------------------------------------------- +org $0DDBDE ; <- 6DBDE - headsup_display.asm : 105 (DEC A : BPL .subtractRupees) +JSL.l IncrementSpentRupees +NOP #6 +;org $0DDBF7 ; <- 6DBF7 - headsup_display.asm : 121 (STA $7EF362) +;RefillLogic_subtractRupees: +;-------------------------------------------------------------------------------- + +;================================================================================ +; Remove Item Menu Text +;-------------------------------------------------------------------------------- +org $0DEBB0 ; <- 6EBB0 - equipment.asm : 1810 (LDA $0202) +JMP DrawItem_finished +org $0DECE6 ; <- 6ECE6 - equipment.asm : 1934 (SEP #$30) +DrawItem_finished: +org $0DEB48 ; <- 6EB48 - equipment.asm : 1784 (LDA $0000) +LDA $0000, Y : STA $11F2 +LDA $0002, Y : STA $11F4 +LDA $0040, Y : STA $1232 +LDA $0042, Y : STA $1234 +;--------------------------- +org $0DE24B ; <- 6E24B - equipment.asm : 951 (LDA $0000) +LDA $0000, Y : STA $11F2 +LDA $0002, Y : STA $11F4 +LDA $0040, Y : STA $1232 +LDA $0042, Y : STA $1234 +;-------------------------------------------------------------------------------- +org $0DE2DC ; <- 6E2DC - equipment.asm : 989 (LDA $F449, X : STA $122C, Y) +JMP UpdateBottleMenu_return +org $0DE2F1 ; <- 6E2F1 - equipment.asm : 1000 (SEP #$30) +UpdateBottleMenu_return: +;-------------------------------------------------------------------------------- +;org $0DDDC3 ; <- 6DDC3 - equipment.asm : 131 (JSR DrawAbilityText) +;NOP #3 +org $0DE6F4 ; <- 6E6F4 - equipment.asm : 1474 (BCC .lacksAbility) +db #$80 ; BRA +org $0DE81A ; <- 6E81A - equipment.asm : 1597 (STA $00) +RTS +org $0DE7B9 ; <- 6E7B9 - equipment.asm : 1548 (LDA.w #$16D0) +LDA.w #$1610 +org $0DE7CF ; <- 6E7CF - equipment.asm : 1554 (LDA.w #$16C8) +LDA.w #$1608 +org $0DE7E5 ; <- 6E7E5 - equipment.asm : 1560 (LDA.w #$16D8) +LDA.w #$1618 +org $0DECEB ; <- 6ECEB - equipment.asm : 1946 (LDA.w #$16E0) +LDA.w #$1620 +;-------------------------------------------------------------------------------- +;org $0DE9D8 ; <- 6E9D8 - equipment.asm : 1635 (LDA $E860, X : STA $12EA, X) +;BRA DrawProgressIcons_initPendantDiagram_notext +;org $0DEA0E ; <- 6EA0E - equipment.asm : 1645 (INX #2) +;DrawProgressIcons_initPendantDiagram_notext: +;-------------------------------------------------------------------------------- + +;================================================================================ +; Map Always Zoomed +;-------------------------------------------------------------------------------- +;org $0ABA49 ; <- 53A49 - Bank0A.asm : 447 (LDA.b #$80 : STA $211A) +;JSL.l PrepMapZoom : RTL +;org $0ABB32 ; <- 53B32 - Bank0A.asm : 626 (LDA $F6 : AND.b #$70) +;JSL.l ForceMapZoom +;-------------------------------------------------------------------------------- + +;================================================================================ +; Zelda S&Q Mirror Fix +;-------------------------------------------------------------------------------- +org $02D9A4 ; <- 159A4 - Bank02.asm : 11077 (dw $0000, $0002, $0002, $0032, $0004, $0006, $0030) +dw $0000, $0002, $0004, $0032, $0004, $0006, $0030 +;-------------------------------------------------------------------------------- + +;================================================================================ +; Accessability +;-------------------------------------------------------------------------------- +org $0AC574 ; <- 54574 - Bank0A.asm : 1797 (LDA $0D : STA $0802, X) +JSL FlipGreenPendant +NOP #6 +;-------------------------------------------------------------------------------- + +;================================================================================ +; Sword Upgrade Randomization +;-------------------------------------------------------------------------------- +org $03FC16 ; <- 1FC16 ($A8, $B8, $3D, $D0, $B8, $3D) +db $B1, $C6, $F9, $C9, $C6, $F9 ; data insert - 2 chests, fat fairy room +org $01E97E ; <- E97E ($280016, $250016) +dl $080116, $070116; <- E97E +;-------------------------------------------------------------------------------- +;org $06C9BC ; <- 349BC - sprite_ponds.asm : 1066 +;org $06C9C0 ; <- 349C0 - sprite_ponds.asm : 1068 +org $06C926 ; <- 34926 - sprite_ponds.asm : 945 +JMP.l GetFairySword +NOP #12 +org $06C936 ; <- 34936 - sprite_ponds.asm : 952 +PyramidFairy_BRANCH_IOTA: +org $06C948 ; <- 34948 - sprite_ponds.asm : 961 +PyramidFairy_BRANCH_GAMMA: +;-------------------------------------------------------------------------------- +org $1EE16E ; <- F616E - sprite_bomb_shop_entity.asm : 73 +NOP #8 ; fix bomb shop dialog for dwarfless big bomb +org $068A14 ; <- 30A14 - sprite_prep.asm : 716 +NOP #8 ; fix bomb shop spawn for dwarfless big bomb +;-------------------------------------------------------------------------------- +org $06B489 ; <- 33489 - sprite_smithy_bros.asm : 473 (LDA $7EF359 : CMP.b #$03 : BCS .tempered_sword_or_better) +JMP.l GetSmithSword +NOP #4 +Smithy_DoesntHaveSword: +org $06B49D ; <- 3349D - sprite_smithy_bros.asm : 485 (.tempered_sword_or_better) +Smithy_AlreadyGotSword: +;-------------------------------------------------------------------------------- +org $06ED55 ; <- 36D55 - Bank06.asm : 4817 +JSL.l LoadSwordForDamage ; moth gold sword fix +;-------------------------------------------------------------------------------- +org $08C5F7 ; <- 445F7 - ancilla_receive_item.asm : 400 (LDA.b #$09 : STA $012D) +NOP #5 ; remove spooky telepathy sound +;-------------------------------------------------------------------------------- +org $1EE094 ; PC 0xF6094 - sprite_hylian_plaque.asm : 79 (JSL Sprite_ShowMessageUnconditional) +JSL.l DialogPedestal +;-------------------------------------------------------------------------------- +org $08C431 ; <- 44431 - ancilla_receive_item.asm : 125 (LDA $0C5E, X : CMP.b #$01 : BNE .notMasterSword2) +LDA $8A : CMP.b #$80 : NOP +;-------------------------------------------------------------------------------- + +;================================================================================ +; New Items +;-------------------------------------------------------------------------------- +org $07B57B ; <- 3B57B - Bank07.asm : 8523 (BMI .cantOpen) +NOP #2 +;-------------------------------------------------------------------------------- +org $00D531 ; 5531 - Bank00.asm:3451 (LDY.b #$5D) +JMP.l GetAnimatedSpriteGfxFile + +org $00D547 ; 5547 - Bank00.asm:3467 (JSR Decomp_spr_high) +GetAnimatedSpriteGfxFile_return: + +org $00D557 ; 5557 - Bank00.asm:3486 (LDA $00 : ADC $D469, X) +JSL.l GetAnimatedSpriteBufferPointer +NOP + +org $0799F7 ; 399F7 - Bank07.asm:4107 (JSL AddReceivedItem) +JSL.l AddReceivedItemExpanded + +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) +LDA.w AddReceivedItemExpanded_item_target_addr+1, X +org $09861F ; 4861F - ancilla_init.asm:724 (LDA .item_values, Y) +LDA.w AddReceivedItemExpanded_item_values, Y + +org $098627 ; 48627 - ancilla_init.asm:731 (LDA .item_target_addr+0, X) +LDA.w AddReceivedItemExpanded_item_target_addr+0, X +org $09862C ; 4862C - ancilla_init.asm:722 (LDA .item_target_addr+1, X) +LDA.w AddReceivedItemExpanded_item_target_addr+1, X +org $098635 ; 48635 - ancilla_init.asm:727 (LDA .item_values, Y) +LDA.w AddReceivedItemExpanded_item_values, Y + +org $0986AA ; 486AA - ancilla_init.asm:848 (LDA .item_masks, X) +LDA.w AddReceivedItemExpanded_item_masks, X + +org $098769 ; 48769 - ancilla_init.asm:1005 (LDA .item_graphics_indices, Y) +LDA.w AddReceivedItemExpanded_item_graphics_indices, Y + +org $09884D ; 4884D - ancilla_init.asm:1137 (LDA $836C, Y) +LDA.w AddReceivedItemExpanded_y_offsets, Y +org $09885B ; 4885B - ancilla_init.asm:1139 (LDA .x_offsets, X) - I think the disassembly is wrong here, should have been LDA .x_offsets, Y +LDA.w AddReceivedItemExpanded_x_offsets, Y + +org $0988B7 ; 488B7 - ancilla_init.asm:1199 (LDA .wide_item_flag, Y) +LDA.w AddReceivedItemExpanded_wide_item_flag, Y + +org $0988EF ; 488EF - ancilla_init.asm:1248 (LDA $836C, Y) +LDA.w AddReceivedItemExpanded_y_offsets, Y +org $098908 ; 48908 - ancilla_init.asm:1258 (LDA .x_offsets, Y) +LDA.w AddReceivedItemExpanded_x_offsets, Y + +org $08C6C8 ; 446C8 - ancilla_receive_item.asm:538 (LDA AddReceiveItem.properties, X) +LDA.l AddReceivedItemExpanded_properties, X +org $00C6F9 ; 446F9 - ancilla_receive_item.asm:570 (LDA AddReceiveItem.properties, X) +LDA.l AddReceivedItemExpanded_properties, X + +org $08C6DE ; 446DE - ancilla_receive_item.asm:550 (LDA .wide_item_flag, X) +LDA.l AddReceivedItemExpanded_wide_item_flag, X + +org $0985ED ; 485ED - ancilla_init.asm:693 (LDA $02E9 : CMP.b #$01) +JSL.l AddReceivedItemExpandedGetItem +NOP + +org $07B57D ; 3B57D - Bank07.asm:8527 (LDA Link_ReceiveItemAlternates, Y : STA $03) +JSL.l Link_ReceiveItemAlternatesExpanded_loadAlternate +NOP +;-------------------------------------------------------------------------------- +org $09892E ; 4892E - ancilla_init.asm:1307 (LDA BottleList, X) +LDA.w BottleListExpanded, X + +org $09895C ; 4895C - ancilla_init.asm:1344 (LDA PotionList, X) +LDA.w PotionListExpanded, X +;-------------------------------------------------------------------------------- +;org $06D1EB ; 351EB - sprite_absorbable.asm:364 (STA $7EF375) ; bugbug commented out until i figure out why it doesn't work +;JSL HandleBombAbsorbtion +;-------------------------------------------------------------------------------- + +;================================================================================ +; Kholdstare Shell Fix +;-------------------------------------------------------------------------------- +org $00EC88 ; <- 6C88 - Bank00.asm:6671 - (LDA $7EC380, X : STA $7EC580, X) +LDA $7EC3A0, X : STA $7EC5A0, X +;-------------------------------------------------------------------------------- +org $00ECEB ; <- 6CEB - Bank00.asm:6730 - (LDX.w #$0080) +LDX.w #$00A0 +LDA.w #$00B0 +;-------------------------------------------------------------------------------- + +;================================================================================ +; Potion Refill Fixes +;-------------------------------------------------------------------------------- +;org $0DF1B3 ; <- 6F1B3 - headsup_display.asm:492 - (SEP #$30) +;JSL.l RefillMagic +;RTL +;-------------------------------------------------------------------------------- +;org $0DF128 ; <- 6F128 - headsup_display.asm:407 - (LDA $7EF36D : CMP $7EF36C : BCC .refillAllHealth) +;JSL.l RefillHealth +;RTL +;-------------------------------------------------------------------------------- +org $00F8FB ; <- 78FB - Bank00.asm:8507 - (JSL HUD.RefillHealth : BCC BRANCH_ALPHA) +JSL.l RefillHealth +;-------------------------------------------------------------------------------- +org $00F911 ; <- 7911 - Bank00.asm:8528 - (JSL HUD.RefillMagicPower : BCS BRANCH_$7901) +JSL.l RefillMagic +;-------------------------------------------------------------------------------- +org $00F918 ; <- 7918 - Bank00.asm:8537 - (JSL HUD.RefillHealth : BCC .alpha) +JSL.l RefillHealth +;-------------------------------------------------------------------------------- +org $00F922 ; <- 7922 - Bank00.asm:8543 - (JSL HUD.RefillMagicPower : BCC .beta) +JSL.l RefillMagic +;-------------------------------------------------------------------------------- + +;================================================================================ +; Early Bottle Fix +;-------------------------------------------------------------------------------- +org $09894C ; <- 4894C - ancilla_init.asm:1327 +JSL.l InitializeBottles +;-------------------------------------------------------------------------------- + +;================================================================================ +; Agahnim Doors Fix +;-------------------------------------------------------------------------------- +org $1BBC94 ; <- DBC94 - Bank1B.asm : 201 (LDA $7EF3C5 : AND.w #$000F : CMP.w #$0003 : BCS BRANCH_EPSILON) +JSL.l LockAgahnimDoors : BNE Overworld_Entrance_BRANCH_EPSILON : NOP #6 + +org $1BBCC1 ; <- DBCC1 - Bank1B.asm : 223 (LDA $0F8004, X : AND.w #$01FF : STA $00) +Overworld_Entrance_BRANCH_EPSILON: ; go here to lock doors +;-------------------------------------------------------------------------------- +; -- HOOK THIS LATER TO FUCK WITH BOSS DROPS -- +org $01C73E ; <- C73E - Bank01.asm : 10377 (LDA $01C6FC, X : JSL Sprite_SpawnFallingItem) +JSL.l DropSafeDungeon +NOP #4 +;-------------------------------------------------------------------------------- + +;================================================================================ +; Uncle / Sage Fixes - Old Man Fixes - Link's House Fixes +;-------------------------------------------------------------------------------- +org $05DA4F ; <- 2DA4F - sprite_uncle_and_priest.asm : 45 (BCC .agahnim_not_defeated) +db 80 ; BRA +;-------------------------------------------------------------------------------- +org $05DA61 ; <- 2DA61 - sprite_uncle_and_priest.asm : 51 (BEQ .priest_not_already_dead) +db 80 ; BRA +;-------------------------------------------------------------------------------- +org $05DA81 ; <- 2DA81 - sprite_uncle_and_priest.asm : 65 (BCC .dontHaveMasterSword) +db 80 ; BRA +;-------------------------------------------------------------------------------- +;org $05DE1D ; <- 2DE1D - sprite_uncle_and_priest.asm : 725 (LDA.b #$A0 : STA $7EF372) +;JSL.l RefillHealthPlusMagic8bit +;NOP #2 +;-------------------------------------------------------------------------------- +org $05DEF8 ; <- 2DEF8 - sprite_uncle_and_priest.asm : 917 (LDA.b #$05) +LDA.b #$00 +;-------------------------------------------------------------------------------- +org $05DE6A ; <- 2DE6A - sprite_uncle_and_priest.asm : 796 (JSL Sprite_ShowMessageUnconditional) +NOP #4 +;-------------------------------------------------------------------------------- +org $05DE9E ; <- 2DE9E - sprite_uncle_and_priest.asm : 845 (JSL Sprite_ShowMessageUnconditional) +JSL.l DialogUncle +;-------------------------------------------------------------------------------- +;org $1EEAB6 ; <- F6AB6 - sprite_old_mountain_man.asm : 338 (LDA.b #$A0 : STA $7EF372) +;JSL.l RefillHealthPlusMagic8bit +;NOP #2 +;-------------------------------------------------------------------------------- +;org $01E5B2 ; <- E5B8 - lower pot link's house +;db $14 ; fairy +;org $01E5B5 ; <- E5B8 - lower pot link's house +;db $14 ; fairy +;org $01E5B8 ; <- E5B8 - lower pot link's house +;db $0D ; big magic +;-------------------------------------------------------------------------------- + +;================================================================================ +; Ganon's Tower Basement Door Fix +;-------------------------------------------------------------------------------- +;org $1FF3F4 ; <- 0FF3F4 +;db $00 +;-------------------------------------------------------------------------------- +; Misery Mire Basement Door Fix +;-------------------------------------------------------------------------------- +;org $1FB8E4 ; <- 0FB8E4 +;db $00 +;-------------------------------------------------------------------------------- + +;================================================================================ +; Bomb & Arrow Capacity Updates +;-------------------------------------------------------------------------------- +org $0DDC27 ; <- 6DC27 - headsup_display.asm:151 (LDA $7EF370 : TAY) +JSL.l IncrementBombs +NOP #15 +;-------------------------------------------------------------------------------- +org $0DDC49 ; <- 6DC49 - headsup_display.asm:169 (LDA $7EF371 : TAY) +JSL.l IncrementArrows +NOP #15 +;-------------------------------------------------------------------------------- +org $1EE199 ; <- F6199 - sprite_bomb_shop_entity.asm:102 (LDA $7EF370 : PHX : TAX) +JSL.l CompareBombsToMax +NOP #11 +;-------------------------------------------------------------------------------- + +;================================================================================ +; Bonk Items +;-------------------------------------------------------------------------------- +org $05FC7E ; <- 2FC7E - sprite_dash_item.asm : 118 (LDA $7EF36F : INC A : STA $7EF36F) +JSL.l GiveBonkItem : NOP #5 +org $05FC97 ; <- 2FC97 - sprite_dash_item.asm : 126 (LDA.b #$2F : JSL Sound_SetSfx3PanLong) +NOP #6 +;-------------------------------------------------------------------------------- +org $068D39 ; <- 30D39 - sprite_prep.asm : 1435 - (LDA.b #$08 : STA $0F50, X) +JSL.l LoadBonkItemGFX +;-------------------------------------------------------------------------------- +org $05FC04 ; <- 2FC04 - sprite_dash_item.asm : 38 - (JSL DashKey_Draw) +JSL.l DrawBonkItemGFX +;-------------------------------------------------------------------------------- + +;================================================================================ +; Library Item +;-------------------------------------------------------------------------------- +org $05FD44 ; <- 2FD44 - sprite_dash_item.asm : 244 - (JSL Link_ReceiveItem) +JSL.l SetLibraryItem +;-------------------------------------------------------------------------------- +org $068D1B ; <- 30D1B - sprite_prep.asm : 1414 - (JSL GetAnimatedSpriteTile.variable) +JSL.l LoadLibraryItemGFX +;-------------------------------------------------------------------------------- +org $05FC9E ; <- 2FC9E - sprite_dash_item.asm : 138 - (JSL Sprite_PrepAndDrawSingleLargeLong) +JSL.l DrawLibraryItemGFX +;-------------------------------------------------------------------------------- +org $068D0E ; <- 30D0E - sprite_prep.asm : 1401 - (LDA $7EF34E : BEQ .book_of_mudora) +JSL.l ItemCheck_Library +;-------------------------------------------------------------------------------- + +;================================================================================ +; Inventory Updates +;-------------------------------------------------------------------------------- +org $0DDF38 ; <- 6DF38 - equipment.asm : 480 +JSL.l ProcessMenuButtons +BCC _equipment_497 +JMP.w _equipment_544 +;NOP #7 +ResetEquipment: +JSR.w RestoreNormalMenu ; (short) +RTL +NOP #3 + +warnpc $0DDF49 +org $0DDF49 ; <- 6DF49 - equipment.asm : 497 +_equipment_497: ; LDA $F4 : AND.b #$08 : BEQ .notPressingUp - NO BUTTON CAPTURE +;org $0DDF7E ; <- 6DF7E - equipment.asm : 539 +org $0DDF88 ; <- 6DF88 - equipment.asm : 544 +;org $0DE10E ; <- 6E10E - equipment.asm : 806 +_equipment_544: +;-------------------------------------------------------------------------------- +org $0DEB98 ; <- 6EB98 - equipment.asm : 1803 +;LDA.w #$3C60 : STA $FFBE, Y +;ORA.w #$4000 : STA $FFC4, Y +;ORA.w #$8000 : STA $0084, Y +;EOR.w #$4000 : STA $007E, Y +LDA.w #$3C60 : STA $FFBE, Y +ORA.w #$8000 : STA $007E, Y +ORA.w #$4000 : STA $0084, Y +JSL.l AddYMarker +NOP #2 +;-------------------------------------------------------------------------------- +;org $0DDE9B ; <- 6DE9B equipment.asm:296 - LDA $0202 : CMP.b #$10 : BNE .notOnBottleMenu (CMP instruction) +;CMP.b #$FF +;-------------------------------------------------------------------------------- +org $0DDE9F ; <- 6DE9F equipment.asm:300 - LDA.b #$0A : STA $0200 +LDA.b #$04 +;-------------------------------------------------------------------------------- +org $0DDE3D ; <- 6DE3D equipment.asm:217 - BNE .equippedItemIsntBottle +db $80 ; BRA +;-------------------------------------------------------------------------------- +org $0DE12D ; <- 6E12D - equipment.asm : 828 +JSL.l ProcessBottleMenu +;-------------------------------------------------------------------------------- +org $0DDF9A ; <- 6DF9A - equipment.asm : 554 +JSL.l OpenBottleMenu +NOP +;-------------------------------------------------------------------------------- +org $0DE12D ; <- 6E12D - equipment.asm : 828 +JSL.l CloseBottleMenu +;-------------------------------------------------------------------------------- +org $0DEE70 ; <- 6EE70 - equipment.asm : 2137 +JSL.l PrepItemScreenBigKey +NOP +;-------------------------------------------------------------------------------- +org $08D395 ; <- 45395 - ancilla_bird_travel_intro.asm : 253 +JSL.l UpgradeFlute +NOP #2 +;-------------------------------------------------------------------------------- +org $05E4D7 ; <- 2E4D7 - sprite_witch.asm : 213 +JSL.l RemoveMushroom +NOP #2 +;-------------------------------------------------------------------------------- +org $05F55F ; <- 2F55F - sprite_potion_shop.asm : 59 +JSL.l LoadPowder +;-------------------------------------------------------------------------------- +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 +NOP #5 +;-------------------------------------------------------------------------------- +org $05EE5F ; <- 2EE5F - sprite_mushroom.asm : 30 +JSL.l LoadMushroom +NOP +;-------------------------------------------------------------------------------- +org $05EE78 ; <- 2EE78 - sprite_mushroom.asm : 58 +JSL.l DrawMushroom +;-------------------------------------------------------------------------------- +org $05EE97 ; <- 2EE97 - sprite_mushroom.asm : 81 +NOP #14 +;-------------------------------------------------------------------------------- +org $07A36F ; <- 3A36F - Bank07.asm : 5679 +NOP #5 +org $07A379 ; <- 3A379 - Bank07.asm : 5687 +JSL.l SpawnHauntedGroveItem +;-------------------------------------------------------------------------------- +org $07A303 ; 3A303 - Bank07.asm : 5622 +;JSL.l FixShovelLock +;-------------------------------------------------------------------------------- +org $07A3A2 ; 3A3A2 - Bank07.asm : 5720 - JSL DiggingGameGuy_AttemptPrizeSpawn +JSL.l SpawnShovelItem +BRA _Bank07_5726 +org $07A3AB ; 3A3AB - Bank07.asm : 5726 - LDA.b #$12 : JSR Player_DoSfx2 +_Bank07_5726: +;org $07A381 ; 3A381 - Bank07.asm : 5693 - ORA $035B +;ORA $035B +;-------------------------------------------------------------------------------- +org $079A0E ; 39A0E - Bank07.asm : 4117 - JSL HUD.RefreshIconLong +JSL.l Link_ReceiveItem_HUDRefresh +;-------------------------------------------------------------------------------- +org $08C6F9 ; 446F9 - ancilla_receive_item.asm : 538 - (LDA AddReceiveItem.properties, X : BPL .valid_upper_properties) +LDA AddReceivedItemExpanded_properties, X +;-------------------------------------------------------------------------------- +org $08C70F ; 4470F - ancilla_receive_item.asm : 550 - (LDA .wide_item_flag, X : STA ($92), Y ; AddReceiveItem.wide_item_flag? ; LDA.b #$00 : STA ($92), Y in the japanese version) +JMP.l LoadNarrowObject +NOP +LoadNarrowObjectReturn: +;-------------------------------------------------------------------------------- + +;================================================================================ +; Medallion Tablets +;-------------------------------------------------------------------------------- +org $05F274 ; <- 2F274 +JSL.l ItemCheck_BombosTablet +;-------------------------------------------------------------------------------- +org $05F285 ; <- 2F285 +JSL.l ItemCheck_EtherTablet +;-------------------------------------------------------------------------------- +org $098BCC ; <- 48BCC - ancilla_init.asm : 1679 (LDA AddReceiveItem.item_graphics_indices, Y : STA $72) +;JSL.l SetTabletItem +JSL SpawnTabletItem : PLX : PLB : RTL +;-------------------------------------------------------------------------------- + +;================================================================================ +; Medallion Entrances +;-------------------------------------------------------------------------------- +org $08B504 ; <- 43504 - ancilla_bombos_spell.asm : 671 +JSL.l MedallionTrigger_Bombos +NOP +;-------------------------------------------------------------------------------- +org $08ACC8 ; <- 42CC8 - ancilla_ether_spell.asm : 350 +JSL.l MedallionTrigger_Ether +JMP _ancilla_ether_spell_363 +warnpc $08ACE6 +org $08ACE6 ; <- 42CE6 - ancilla_quake_spell.asm : 363 +_ancilla_ether_spell_363: +;-------------------------------------------------------------------------------- +org $08B6EA ; <- 436EA - ancilla_quake_spell.asm : 67 +JSL.l MedallionTrigger_Quake +JMP _ancilla_quake_spell_83 +Ancilla_CheckIfEntranceTriggered: + JSR $F856 +RTL +warnpc $08B708 +org $08B708 ; <- 43708 - ancilla_quake_spell.asm : 83 +_ancilla_quake_spell_83: +;-------------------------------------------------------------------------------- + +;================================================================================ +; Big & Great Fairies +;-------------------------------------------------------------------------------- +org $1DC475 ; <- EC475 - sprite_big_fairie.asm : 70 (LDA.w #$00A0 : ADD $7EF372 : STA $7EF372) +JSL.l RefillHealthPlusMagic +NOP #8 + +org $1DC489 ; <- EC489 - sprite_big_fairie.asm : 88 (LDA $7EF36D : CMP $7EF36C : BNE .player_hp_not_full_yet) +NOP #4 +JSL.l CheckFullHealth +;-------------------------------------------------------------------------------- + +;================================================================================ +; RNG Fix +;-------------------------------------------------------------------------------- +org $1DFD9E ; <- EFD9E - sprite_diggin_guy.asm : 307 +NOP #8 +;-------------------------------------------------------------------------------- +org $1DFD67 ; <- EFD67 - sprite_diggin_guy.asm : 242 +JSL.l RigDigRNG +;-------------------------------------------------------------------------------- +org $01EE94 ; <- EE94 - Bank01.asm : 14121 +JSL.l RigChestRNG +;-------------------------------------------------------------------------------- +;org $01EDB2 ; <- EDB2 - Bank01.asm : 14038 +;INC $04C4 +;-------------------------------------------------------------------------------- + +;================================================================================ +; HUD Changes +;-------------------------------------------------------------------------------- +org $0DFC77 ; <- 6FC77 - headsup_display.asm : 845 +NOP #$2D ; #45 +org $0DFC77 ; <- 6FC77 +JSL.l OnDrawHud +BRA $27 + +org $0DFCB8 ; <- 6FCB8 +STA $7EC75A ; nudge bomb 10s digit right + +org $0DFCC4 ; <- 6FCC4 +STA $7EC75C ; nudge bomb 1s digit right + +org $0DFCDC ; <- 6FCDC +STA $7EC760 ; nudge arrow 10s digit right + +org $0DFCE8 ; <- 6FCE8 +STA $7EC762 ; nudge arrow 1s digit right + +org $0DFD0A ; <- 6FD0A - headsup_display.asm : 900 +STA $7EC766 ; nudge key digit right + +org $0DFD13 ; <- 6FD13 - headsup_display.asm : 905 +STA $7EC726 ; key icon blank + +org $0DFC37 ; <- 6FC37 - headsup_display.asm : 828 (LDA.w #$28F7) +JSL.l DrawMagicHeader +NOP #17 +;-------------------------------------------------------------------------------- +org $0DFB29 ; <- - headsup_display.asm : 688 (LDA.b #$86 : STA $7EC71E) +LDA.b #$86 : STA $7EC720 ; nudge silver arrow right +LDA.b #$24 : STA $7EC721 +LDA.b #$87 : STA $7EC722 +LDA.b #$24 : STA $7EC723 +;-------------------------------------------------------------------------------- +; Insert our version of the hud tilemap +org $0DFA96 ; <- 6FA96 - headsup_display.asm : 626 (LDX.w #.hud_tilemap) +LDX.w #HUD_TileMap +org $0DFA9C ; <- 6FA9C - headsup_display.asm : 629 (MVN $0D, $7E ; $Transfer 0x014A bytes from $6FE77 -> $7EC700) +MVN $207E +;-------------------------------------------------------------------------------- +org $0DE48E ; <- 6E48E - equipment.asm : 1233 (LDA.w #$11CE : STA $00) +JSL.l DrawHUDSilverArrows +NOP +;-------------------------------------------------------------------------------- + +;================================================================================ +; 300 Rupee NPC +;-------------------------------------------------------------------------------- +org $1EF060 ; <- F7060 - sprite_shopkeeper.asm:242 (INC $0D80, X) +JSL.l Set300RupeeNPCItem +NOP +;-------------------------------------------------------------------------------- + +;================================================================================ +; Glitched Mode Fixes +;-------------------------------------------------------------------------------- +org $1ED4E6 ; <- F54E6 +JSL.l GetAgahnimType +NOP #2 +;-------------------------------------------------------------------------------- + +;================================================================================ +; Half Magic Bat +;-------------------------------------------------------------------------------- +org $05FBD3 ; <- 2FBD3 - sprite_mad_batter.asm:209 - (STA $7EF37B) +JSL.l GetMagicBatItem +;-------------------------------------------------------------------------------- + +;================================================================================ +; Open Mode Fixes +;-------------------------------------------------------------------------------- +org $05DF65 ; <- 2DF65 - sprite_uncle_and_priest.asm:994 - (LDA.b #$01 : STA $7EF3C5) +JSL.l SetUncleRainState : RTS +;-------------------------------------------------------------------------------- +;org $0280DD ; <- 100DD - Bank02.asm:298 - (LDA $7EF3C5 : CMP.b #$02 : BCC .indoors) +;JSL.l ForceLinksHouse +;-------------------------------------------------------------------------------- + +;================================================================================ +; Pendant / Crystal Fixes +;-------------------------------------------------------------------------------- +;org $0DE9C8 ; <- 6E9C8 - original check for agahnim 1 being defeated +;;LDA $7EF3CA : CMP.b #$40 ; check for dark world instead +;JSL.l CheckPendantHUD +;NOP #2 +;================================================================================ +org $0DE9C8 ; <- 6E9C8 - equipment.asm:1623 - (LDA $7EF3C5 : CMP.b #$03 : BCC .beforeAgahnim) +JSL.l DrawPendantCrystalDiagram : RTS +;NOP #11 +;================================================================================ +org $0DEDCC ; <- 6EDCC - equipment.asm:2043 - (LDA $040C : AND.w #$00FF : CMP.w #$00FF : BNE .inSpecificDungeon) +JSL.l ShowDungeonItems : NOP #5 + +org $0DEE59 ; <- 6EE59 - equipment.asm:2126 - (LDA $040C : AND.w #$00FF : CMP.w #$00FF : BEQ .notInPalace) +JSL.l ShowDungeonItems : NOP #5 + +org $0DEE8A ; <- 6EE8A - equipment.asm:2151 - (LDA $040C : AND.w #$00FF : CMP.w #$00FF : BEQ .notInPalaceAgain) +JSL.l ShowDungeonItems : NOP #5 + +org $0DEF3B ; <- 6EF3B - equipment.asm:2290 - (LDA $040C : AND.w #$00FF : CMP.w #$00FF : BEQ .notInPalace) +JSL.l ShowDungeonItems : NOP #5 +;================================================================================ +org $0DEA5F ; <- 6EA5F - equipment.asm:1679 - (SEP #$30) +;NOP #5 +;BRL .skipCrystalInit +;org $0DEAA4 ; <- 6EAA4 - equipment.asm:1706 - (LDA $7EF37A : AND.w #$0001) +;.skipCrystalInit +;================================================================================ +org $0DE9D8 ; <- 6E9D8 - equipment.asm:1635 - (LDA $E860, X : STA $12EA, X) +org $0DEA15 ; <- 6EA15 - equipment.asm:1647 - (LDA.w #$13B2 : STA $00) +;================================================================================ +org $00F97E ; <- 797E - Bank00.asm:8586 - (LDA $7EF3CA : EOR.b #$40 : STA $7EF3CA) +JSL.l FlipLWDWFlag : NOP #6 +;================================================================================ +org $02B162 ; <- 13162 - Bank02.asm:7672 - (LDA $7EF3CA : EOR.b #$40 : STA $7EF3CA) +JSL.l IncrementOWMirror +JSL.l FlipLWDWFlag +NOP #2 +;================================================================================ +;Clear level to open doors +org $01C50D ; 0xC50D - Bank01.asm:10032 - (LDA $7EF3CA : BNE .inDarkWorld) +LDA CrystalPendantFlags_2, X +;================================================================================ +;Kill enemy to clear level +org $01C715 ; <- C715 - Bank01.asm:10358 - (LDA $7EF3CA : BNE .inDarkWorld) +LDA CrystalPendantFlags_2, X +;JSL.l GetPendantCrystalWorld +;================================================================================ +;org $0AC5C3 ; <- 545C3 - Bank0A.asm:1859 - (LDA $7EF374 : AND $0AC5A6, X : BEQ .fail) +;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 $0AC012 ; <- 54012 - Bank0A.asm:1039 - (LDA $7EF2DB) +JSL.l OnLoadMap +;================================================================================ +org $0AC53e ; <- 5453E - Bank0A.asm:1771 - (LDA $0AC50D, X : STA $0D) +JSL.l GetCrystalNumber +;================================================================================ +; EVERY INSTANCE OF STA $7EF3C7 IN THE ENTIRE CODEBASE +org $029D51 ; <- 11D51 +JSL.l SetLWDWMap +org $0589BB ; <- 289BB +JSL.l SetLWDWMap +org $05DD9A ; <- 2DD9A +JSL.l SetLWDWMap + +org $05F1F6 ; <- 2F1F6 +JSL.l SetLWDWMap +org $05F209 ; <- 2F209 +JSL.l SetLWDWMap +org $05FF91 ; <- 2FF91 +JSL.l SetLWDWMap + +org $098687 ; <- 48687 +JSL.l SetLWDWMap +org $1ECEDD ; <- F4EDD +JSL.l SetLWDWMap +org $1ECF0D ; <- F4F0D +JSL.l SetLWDWMap +;================================================================================ +; EVERY INSTANCE OF LDA $7EF3C7 IN THE ENTIRE CODEBASE +org $05DDFE ; <- 2DDFE +JSL.l GetMapMode +org $05EE25 ; <- 2EE25 +JSL.l GetMapMode +org $05F17D ; <- 2F17D +JSL.l GetMapMode +org $05FF7D ; <- 2FF7D +JSL.l GetMapMode + +org $0AC01A ; <- 5401A +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 +;================================================================================ +org $028B8F ; <- 10B8F - Bank02.asm:2236 (LDA $7EF374 : LSR A : BCS BRANCH_BETA) +JSL.l CheckHeraObject : BNE + : NOP +LDX.b #$F1 : STX $012C ++ +;================================================================================ +org $029090 ; <- 11090 - Bank02.asm:3099 (LDA $7EF374 : LSR A : BCS BRANCH_GAMMA) +JSL.l CheckHeraObject : BNE + : NOP +STX $012C ++ +;================================================================================ +org $029798 ; <- 11798 - Bank02.asm:4287 (CMP $02895C, X : BNE BRANCH_ALPHA) +NOP #6 ; remove crystal room cutscene check that causes softlocks +;================================================================================ + +;================================================================================ +; Text Changes +;-------------------------------------------------------------------------------- +org $02A005 ; <- 12005 - Bank02.asm:5667 (JSL Main_ShowTextMessage) +JSL.l DialogTriforce : NOP #4 +;-------------------------------------------------------------------------------- +org $1D92EC ; <- E92EC - sprite_ganon.asm:947 (JSL Sprite_ShowMessageMinimal) +JSL.l DialogGanon1 +;-------------------------------------------------------------------------------- +org $1D9078 ; <- E9078 - sprite_ganon.asm:552 (LDA.b #$70 : STA $1CF0) +JSL.l DialogGanon2 : RTS +;-------------------------------------------------------------------------------- +org $1DA4EC ; <- EA4EC - sprite_blind_entities.asm:845 (JSL Sprite_ShowMessageMinimal) +JSL.l DialogBlind +;-------------------------------------------------------------------------------- +org $06C94C ; <- 3494C - sprite_ponds.asm:970 (JSL Sprite_ShowMessageUnconditional) +JSL.l DialogFatFairy +;-------------------------------------------------------------------------------- +;-- Sahasrahla (no green pendant) +org $05F16C ; <- 2F16C sprite_elder.asm:137 (JSL Sprite_ShowSolicitedMessageIfPlayerFacing) +JSL.l Sprite_ShowSolicitedMessageIfPlayerFacing_Alt +;-------------------------------------------------------------------------------- +;-- Sahasrahla (have boots) +org $05F1A8 ; <- 2F1A8 sprite_elder.asm:170 (JSL Sprite_ShowSolicitedMessageIfPlayerFacing) +JSL.l Sprite_ShowSolicitedMessageIfPlayerFacing_Alt +;-------------------------------------------------------------------------------- +;-- Sahasrahla (have boots, have ice rod) +org $05F1BC ; <- 2F1BC sprite_elder.asm:182 (JSL Sprite_ShowSolicitedMessageIfPlayerFacing) +JSL.l Sprite_ShowSolicitedMessageIfPlayerFacing_Alt +;-------------------------------------------------------------------------------- +;-- Sahasrahla (have boots, have ice rod, have 3 pendants) +org $05F1CE ; <- 2F1CE sprite_elder.asm:194 (JSL Sprite_ShowSolicitedMessageIfPlayerFacing) +JSL.l Sprite_ShowSolicitedMessageIfPlayerFacing_Alt +;-------------------------------------------------------------------------------- +;-- Sahasrahla (have boots, have ice rod, have 3 pendants, have master sword) +org $05F1D8 ; <- 2F1D8 sprite_elder.asm:204 (JSL Sprite_ShowSolicitedMessageIfPlayerFacing) +JSL.l Sprite_ShowSolicitedMessageIfPlayerFacing_Alt +;-------------------------------------------------------------------------------- +;-- drinking guy +org $1EF61C ; <- F761C sprite_drinking_guy.asm:29 (JSL Sprite_ShowSolicitedMessageIfPlayerFacing) +JSL.l Sprite_ShowSolicitedMessageIfPlayerFacing_Alt +;================================================================================ + +;================================================================================ +; Text Removal +;-------------------------------------------------------------------------------- +;-- Music restarting at zelda fix +org $05ED10 ; <- 2ED10 - sprite_zelda.asm : 233 - (LDA.b #$19 : STA $012C) +NOP #5 +;-------------------------------------------------------------------------------- +org $1ECE47 ; <- F4E47 - sprite_crystal_maiden.asm : 220 +JMP.l MaidenCrystalScript +;-------------------------------------------------------------------------------- +org $1ECCEB ; <- F4CEB - sprite_crystal_maiden.asm : 25 ; skip all palette nonsense +JMP.l SkipCrystalPalette +org $1ECD39 +SkipCrystalPalette: +;-------------------------------------------------------------------------------- +org $08C3FD ; <- 443FD - ancilla_receive_item.asm : 89 +!MS_GOT = "$7F5031" +LDA #$40 : STA !MS_GOT +;;NOP #6 ; don't set master sword follower +;-------------------------------------------------------------------------------- +org $08C5FE ; <- 445FE - ancilla_receive_item.asm : 408 +NOP #4 +;-------------------------------------------------------------------------------- +org $1ED467 ; <- F5467 - sprite_agahnim.asm : 202 +NOP #4 +;-------------------------------------------------------------------------------- +org $1ED4FF ; <- F54FF - sprite_agahnim.asm : 328 +NOP #4 +;-------------------------------------------------------------------------------- +;org $029C94 ; <- 11C94 - Bank02.asm : 5197 (JSL Main_ShowTextMessage) +;NOP #4 +;-------------------------------------------------------------------------------- +org $029CBD ; <- 11CBD - Bank02.asm : 5227 (JSL Messaging_Text) +STZ $11 +NOP #2 +;-------------------------------------------------------------------------------- +;org $029CD3 ; <- 11CD3 - Bank02.asm : 5237 (BNE BRANCH_BETA) +;db $80 ; BRA +;-------------------------------------------------------------------------------- +org $029CDF ; <- 11CDF - Bank02.asm : 5245 (JSL Main_ShowTextMessage) +NOP #4 +;-------------------------------------------------------------------------------- +org $029CF0 ; <- 11CF0 - Bank02.asm : 5266 +STZ $11 +NOP #2 +;-------------------------------------------------------------------------------- +org $05FB70 ; <- 2FB70 - sprite_mad_batter.asm:131 - (JSL Sprite_ShowMessageUnconditional) +NOP #4 +;-------------------------------------------------------------------------------- +org $05FBC2 ; <- 2FBC3 - sprite_mad_batter.asm:195 - (JSL Sprite_ShowMessageUnconditional) +NOP #4 +;-------------------------------------------------------------------------------- +;org $05F16C ; <- 2F16C - sprite_elder.asm : 137 (JSL Sprite_ShowSolicitedMessageIfPlayerFacing : BCC .dont_show) +;NOP #4 +;-------------------------------------------------------------------------------- +;org $05F190 ; <- 2F190 - sprite_elder.asm : 170 (JSL Sprite_ShowSolicitedMessageIfPlayerFacing) +;NOP #4 +;-------------------------------------------------------------------------------- +;org $05F1A8 ; <- 2F1A8 - sprite_elder.asm : 182 (JSL Sprite_ShowSolicitedMessageIfPlayerFacing) +;NOP #4 +;-------------------------------------------------------------------------------- +;org $05F1BC ; <- 2F1BC - sprite_elder.asm : 194 (JSL Sprite_ShowSolicitedMessageIfPlayerFacing) +;NOP #4 +;-------------------------------------------------------------------------------- +;org $05F1CE ; <- 2F1CE - sprite_elder.asm : 194 (JSL Sprite_ShowSolicitedMessageIfPlayerFacing) +;NOP #4 +;-------------------------------------------------------------------------------- +;-- Old mountain man healing text +org $1EEAD7 ; F6AD7 sprite_old_mountain_man.asm : (JSL Sprite_ShowSolicitedMessageIfPlayerFacing : BCC .didnt_speak) +JSL Sprite_ShowSolicitedMessageIfPlayerFacing_Edit +;-------------------------------------------------------------------------------- +;-- Priest healing text +org $05DE11 ; 2DE11 sprite_uncle_and_priest.asm : 720 (JSL Sprite_ShowSolicitedMessageIfPlayerFacing : BCC .gamma) +JSL Sprite_ShowSolicitedMessageIfPlayerFacing_Edit +;-------------------------------------------------------------------------------- +;-- zelda's heal text +org $05EE38 ; <- 2ee38 sprite_zelda.asm : 474 - (JSL Sprite_ShowSolicitedMessageIfPlayerFacing) +JSL Sprite_ShowSolicitedMessageIfPlayerFacing_Edit +;-------------------------------------------------------------------------------- +;-- zelda in jail +org $05ED06 ; <- 2ED06 sprite_zelda.asm : 227 - (JSL Sprite_ShowMessageUnconditional) +STZ $1CE8 : NOP +org $05ED27 ; <- 2ED27 sprite_zelda.asm : 256 - (JSL Sprite_ShowMessageUnconditional) +NOP #4 +org $05ED35 ; <- 2ED35 sprite_zelda.asm : 272 - (JSL Sprite_ShowMessageUnconditional) +NOP #4 +;---------------------------------------------------- +;-- sanctuary +org $05DD83 ; <- 2DD83 sprite_uncle_and_priest.asm : 608 - (JSL Sprite_ShowMessageUnconditional) +STZ $1CE8 : NOP +org $05EDC8 ; <- 2EDC8 sprite_zelda.asm : 388 - (JSL Sprite_ShowMessageUnconditional) +NOP #4 +org $05DDAB ; <- 2DDAB sprite_uncle_and_priest.asm : 635 - (JSL Sprite_ShowMessageUnconditional) +NOP #4 +;---------------------------------------------------- +;-- Sick Kid +org $06B9C6 ; <- 339C6 sprite_bug_net_kid.asm : 92 - (JSL Sprite_ShowMessageUnconditional) +NOP #4 +;---------------------------------------------------- +;-- Hobo +org $06BE5F ; <- 33E5F sprite_hobo.asm : 121 - (JSL Sprite_ShowMessageUnconditional) +Nop #4 +;---------------------------------------------------------- +;-- Sahasrahla +org $05F190 ; <- 2F190 sprite_elder.asm : 154 - (JSL Sprite_ShowSolicitedMessageIfPlayerFacing : BCC .dont_show_2) - "Blah blah blah, take the boots" +JSL Sprite_ShowSolicitedMessageIfPlayerFacing_Edit +org $05F212 ; <- 2F212 sprite_elder.asm : 261 - (JSL Sprite_ShowMessageUnconditional) - "Gave you the boots but I'm not doing talking yet" +NOP #4 +org $05F1ED ; <- 2F1ED sprite_elder.asm : 225 - (JSL Sprite_ShowMessageUnconditional) +NOP #4 +;---------------------------------------------------------- +;-- Shopkeepers +org $1EEF7C ; <- F6F7C sprite_shopkeeper.asm : 85 (JSL Sprite_ShowMessageUnconditional) +NOP #4 +org $1EF375 ; <- F7375 sprite_shopkeeper.asm : 810 (JSL Sprite_ShowMessageUnconditional : JSL ShopKeeper_RapidTerminateReceiveItem) +NOP #8 +;---------------------------------------------------------- +;-- Bomb shop guy (buying small bombs, and buying big bomb) +org $1EE1C0 ; <- F61C0 sprite_bomb_shop_entity.asm : 120 (JSL Sprite_ShowMessageUnconditional) +NOP #4 +org $1EE208 ; <- F6208 sprite_bomb_shop_entity.asm : 178 (JSL Sprite_ShowMessageUnconditional) +NOP #4 +;-- Text hook for the actual npc +org $1EE181 ; <- F6181 sprite_bomb_shop_entity.asm : 85 (JSL Sprite_ShowSolicitedMessageIfPlayerFacing) +JSL Sprite_ShowSolicitedMessageIfPlayerFacing_Alt +;---------------------------------------------------------- +;-- Catfish +org $1DE112 ; <- EE112 sprite_great_catfish.asm : 341 (JSL Sprite_ShowMessageMinimal) +NOP #4 +;---------------------------------------------------- +;-- King Zora +org $059A7D ; <- 29A7D sprite_zora_king.asm : 223 - (JSL Sprite_ShowMessageMinimal) +STZ $1CE8 : NOP +;---------------------------------------------------- +;-- Before Agah 1 fight +org $1DD299 ; <- ED299 sprite_chatty_agahnim.asm : 111 (JSL Sprite_ShowMessageMinimal) +NOP #4 +org $1DD35E ; <- ED35E sprite_chatty_agahnim.asm : 253 (JSL Sprite_ShowMessageMinimal) +NOP #4 +;---------------------------------------------------- +;-- Blind Maiden (in jail) +;org $1EE8CD ; <- F68CD sprite_blind_maiden.asm : 18 - (JSL Sprite_ShowMessageFromPlayerContact : BCC .didnt_speak) +;NOP #4 +;---------------------------------------------------- +;-- Blind (Maiden) in Jail +org $1EE8CD ; <- F68CD sprite_blind_maiden.asm : 18 - (JSL Sprite_ShowMessageFromPlayerContact : BCC .didnt_speak) +JSL Sprite_ShowMessageFromPlayerContact_Edit +;---------------------------------------------------- +;-- Kiki +org $1EE3E6 ; <- F63E6 sprite_kiki.asm : 157 pay kiki 10 rupees +STZ $1CE8 : NOP +org $1EE400 ; <- F6400 sprite_kiki.asm : 178 thanks for giving kiki rupees +NOP #4 +org $1EE4FB ; <- F64FB sprite_kiki.asm : 340 pay 100 rupees +STZ $1CE8 : NOP +org $1EE523 ; <- F6523 sprite_kiki.asm : 373 kiki will open door +NOP #4 + +org $1EE414 ; <- F6414 sprite_kiki.asm : 193 don't have 10 rupees +NOP #4 +org $1EE50C ; <- F650C sprite_kiki.asm : 356 don't have 100 rupees +NOP #4 +;---------------------------------------------------- +;-- Witch +org $05E4FB ; <- 2E4FB sprite_witch.asm : 165 (JSL Sprite_ShowSolicitedMessageIfPlayerFacing) +NOP #4 +;---------------------------------------------------- +;-- Breaking Ganon's Tower Seal +org $08CD3A ; <- 44D3A ancilla_break_tower_seal.asm : 55 (JSL Main_ShowTextMessage) +NOP #4 +;---------------------------------------------------- +;-- Bombos tablet +org $05F3BF ; <- 2F3BF sprite_medallion_tablet.asm : 254 (JSL Sprite_ShowMessageUnconditional) +NOP #4 +;---------------------------------------------------- +;-- Ether tablet +org $05F429 ; <- 2F429 sprite_medallion_tablet.asm : 317 (JSL Sprite_ShowMessageUnconditional) +NOP #4 +;---------------------------------------------------- +;-- Agahnim 1 Defeated +org $068475 ; <- 30475 Bank06.asm : 762 - (JSL Sprite_ShowMessageMinimal) +JSL.l AddInventory_incrementBossSwordLong +;NOP #4 +;---------------------------------------------------- +;-- Old Mountain Man Encounter Text +org $1EE9BC ; <- sprite_old_mountain_man.asm : 157 - (Sprite_ShowMessageFromPlayerContact) +JSL Sprite_ShowMessageFromPlayerContact_Edit + +org $09A67D ; <- 4A67D tagalong.asm : 1152 (JSL OldMountainMan_TransitionFromTagalong) +JML OldMountainMan_TransitionFromTagalong_Edit +;---------------------------------------------------------- +;-- Purple Chest Encounter Text +org $1EE0E7 ; <- F60E7 sprite_thief_chest.asm : 16 (JSL Sprite_ShowMessageFromPlayerContact : BCC .didnt_touch) +JSL Sprite_ShowMessageFromPlayerContact_Edit +;---------------------------------------------------------- +;-- Middle aged man opens purple chest +org $06BD44 ; <- 33D44 sprite_middle_aged_man.asm : 107 (JSL Sprite_ShowMessageFromPlayerContact : BCC .return) +JSL Sprite_ShowMessageFromPlayerContact_Edit +;---------------------------------------------------------- +;-- Smiths +;-- Ribbit +org $06B2AA ; <- 332AA sprite_smithy_bros.asm : 152 (JSL Sprite_ShowSolicitedMessageIfPlayerFacing) +JSL Sprite_ShowSolicitedMessageIfPlayerFacing_Edit + +;-- Ask us to do anything +org $06B418 ; <- 33418 sprite_smithy_bros.asm : 371 (JSL Sprite_ShowSolicitedMessageIfPlayerFacing : BCC .player_didnt_speak) +JSL Sprite_ShowSolicitedMessageIfPlayerFacing_Edit + +;-- Your sword is tempered! +org $06B538 ; <- 33538 sprite_smithy_bros.asm : 602 (JSL Sprite_ShowSolicitedMessageIfPlayerFacing : BCC .no_player_dialogue) +JSL Sprite_ShowSolicitedMessageIfPlayerFacing_Edit + +;-- Brought dwarf home +org $06B438 ; <- 33438 sprite_smithy_bros.asm : 399 (JSL Sprite_ShowMessageUnconditional) +NOP #4 + +;-- 10 rupees to temper +org $06B470 ; <- 33470 sprite_smithy_bros.asm : 447 (JSL Sprite_ShowMessageUnconditional) +NOP #4 + +;-- Yes, I'm sure +org $06B495 ; <- 33495 sprite_smithy_bros.asm : 479 (JSL Sprite_ShowMessageUnconditional) +NOP #4 + +;-- We'll take your sword +org $06B4F3 ; <- 334F3 sprite_smithy_bros.asm : 556 (JSL Sprite_ShowMessageUnconditional) +JSL ItemSet_SmithSword +;NOP #4 + +;-- Smiths can't make your sword any stronger +org $06B4A1 ; <- 334A1 sprite_smithy_bros.asm : 491 - (Sprite_ShowMessageUnconditional) +NOP #4 +;---------------------------------------------------------- +;-- Not enough magic text +org $07B0CC ; <- 3B0CC Bank07.asm : 7767 - (JSL Main_ShowTextMessage) +NOP #4 +;---------------------------------------------------------- +;-- Witch's Assistant +org $05F8F5 ; <- 2F8F5 sprite_potion_shop.asm : 620 - (JSL Sprite_ShowSolicitedMessageIfPlayerFacing) +JSL Sprite_ShowSolicitedMessageIfPlayerFacing_Edit +;---------------------------------------------------------- +;-- Bottle Vendor +org $05EAE3 ; <- 2EAE3 sprite_bottle_vendor.asm : 104 - (JSL Sprite_ShowSolicitedMessageIfPlayerFacing : BCC .didnt_converse) +JSL Sprite_ShowSolicitedMessageIfPlayerFacing_Edit +org $05EB03 ; <- 2EB03 sprite_bottle_vendor.asm : 129 - (JSL Sprite_ShowMessageUnconditional) +NOP #4 +;---------------------------------------------------------- +;-- Digging Game Guy +org $1DFC76 ; <- EFC76 sprite_digging_game_guy.asm : 46 (JSL Sprite_ShowSolicitedMessageIfPlayerFacing : BCC .return) +JSL Sprite_ShowSolicitedMessageIfPlayerFacing_Edit +org $1DFCA6 ; <- EFCA6 sprite_digging_game_guy.asm : 89 (JSL Sprite_ShowMessageUnconditional) +NOP #4 +;---------------------------------------------------------- +;-- Flute Boy +org $06B078 ; <- 33078 sprite_flute_boy.asm : 244 - (JSL Sprite_ShowSolicitedMessageIfPlayerFacing : BCC .didnt_speak) +JSL Sprite_ShowSolicitedMessageIfPlayerFacing_Edit +org $06B0AF ; <- 330AF sprite_flute_boy.asm : 308 - (JSL Sprite_ShowMessageUnconditional) +NOP #4 +;---------------------------------------------------------- +;-- 300 rupee npcs +org $1EF047 ; <- F7047 sprite_shopkeeper.asm : 227 - (JSL Sprite_ShowSolicitedMessageIfPlayerFacing) (probably) +JSL Sprite_ShowSolicitedMessageIfPlayerFacing_Edit +;---------------------------------------------------------- +;-- Chest Game Guy +org $1EEFBF ; <- F6FBF sprite_shopkeeper.asm : 121 - (JSL Sprite_ShowSolicitedMessageIfPlayerFacing : BCC BRANCH_ALPHA) +JSL Sprite_ShowSolicitedMessageIfPlayerFacing_Edit +org $1EEFE0 ; <- F6FE0 sprite_shopkeeper.asm : 144 - (JSL Sprite_ShowMessageUnconditional) +NOP #4 +;---------------------------------------------------------- +;-- Desert Palace plaque (opening desert with book) +org $1EE0D2 ; <- F60D2 Sprite_Hylian_Plaque.asm : 127 - (JSL Sprite_ShowMessageUnconditional) +NOP #4 +;---------------------------------------------------------- +;-- Uncle gives sword +org $05DF34 ; <- 2DF34 sprite_uncle_and_priest.asm : 961 - (JSL Sprite_ShowMessageFromPlayerContact : BCC .player_not_close_2) +JSL Sprite_ShowMessageFromPlayerContact_Edit +;---------------------------------------------------------- + +;=================================== +;-- Escort Text +;-- dw coordinate, coordinate, flag, text message number, tagalong number +;=================================== +org $09A4C2 ; <- 4A4C2 tagalong.asm : 967 - (.room_data_1) +dw $1EF0, $0288, $0001, $0097, $00F0 ; Old man first text after encounter text +dw $1E58, $02F0, $0002, $0098, $00F0 ; Old man "dead end" (when you run to the pot) +dw $1EA8, $03B8, $0004, $0099, $00F0 ; Old man "turn right here" +dw $0CF8, $025B, $0001, $001F, $00F0 ; Zelda "there's a secret passage" +dw $0CF8, $039D, $0002, $001F, $00F0 ; Zelda "there's a secret passage" +dw $0C78, $0238, $0004, $001F, $00F0 ; Zelda "there's a secret passage" +dw $0A30, $02F8, $0001, $0020, $00F0 ; Zelda "we can push this" +dw $0178, $0550, $0001, $0021, $00F0 ; Zelda "pull the lever" +dw $0168, $04F8, $0002, $0028, $00F0 ; Zelda room before sanctuary +dw $1BD8, $16FC, $0001, $0122, $00F0 ; Blind (maiden) "don't take me outside!" +dw $1520, $167C, $0001, $0122, $00F0 ; Blind (maiden) "don't take me outside!" +dw $05AC, $04FC, $0001, $0027, $00F0 ; Zelda in the water room +;---------------------------------------------------------- +;---------------------------------------------------------- +;-- Speed up Walls (Desert, Mire, and Palace of Darkness) +; org $01CA66 ; <- CA66 Bank01.asm : 10864 - (LDA.w #$2200 : ADD $041C : STA $041C) +; LDA.w #$4400 ; #$2200 is the normal speed, $#FF00 is max. +;---------------------------------------------------------- +;-- Hobo gives item faster +; org $06BE3A ; <- 33E3A sprite_hobo.asm : 90 - (db 6, 2, 6, 6, 2, 100, 30) +; db 6, 2, 6, 6, 2, 6, 30 +;---------------------------------------------------------- +;-- Sick kid gives item faster +; org $06B9A1 ; <- 339A1 sprite_bug_net_kid : 62 - (db 8, 12, 8, 12, 8, 96, 16) +; db 8, 12, 8, 12, 8, 32, 16 +;---------------------------------------------------------- + +;================================================================================ +; Ganon Fixes +;-------------------------------------------------------------------------------- +org $1D91E3 ; <- E91E3 - sprite_ganon.asm : 778 +;JSL.l GanonWarpRNG +;NOP #2 +LDA #$00 : NOP #4 +;-------------------------------------------------------------------------------- + +;================================================================================ +; Dark World Spawn Location Fix & Follower Fixes +;-------------------------------------------------------------------------------- +org $00894A ; <- 94A +PHB : JSL.l DarkWorldSaveFix +;-------------------------------------------------------------------------------- +org $0CCF05 ; <- 64F05 +JSL.l DarkWorldLoadFix +NOP #7 +;-------------------------------------------------------------------------------- +org $09F520 ; <- 4F520 - module_death.asm : 401 (LDA $7EF3C5 : CMP.b #$03 : BCS BRANCH_THETA) +JSL.l SetDeathWorldChecked +JSL.l IncrementDeathCounter +NOP #6 +;-------------------------------------------------------------------------------- +;org $02D61A ; <- 1561A +;LDA.b #$01 : STA $1B ; fix something i wrote over i shouldn't have +;-------------------------------------------------------------------------------- +org $1ED379 ; <- F5379 - sprite_agahnim.asm:75 - JSL PrepDungeonExit +JSL FixAgahnimFollowers +;================================================================================ + +;================================================================================ +; Randomize NPC Items +;-------------------------------------------------------------------------------- +org $028823 ; <- 10823 - Bank02.asm:1560 (LDA $7EF3C5 : BEQ .ignoreInput) +JSL.l AllowSQ +;-------------------------------------------------------------------------------- +org $08C45F ; <- 4445F - ancilla_recieve_item.asm:157 (STZ $02E9) +JSL.l PostItemAnimation : NOP #2 +;-------------------------------------------------------------------------------- +org $1EE90A ; <- F690A +JSL.l ItemCheck_OldMan +NOP #2 +;-------------------------------------------------------------------------------- +org $0280F2 ; <- 100F2 +JSL.l ItemCheck_OldMan +NOP #2 +;-------------------------------------------------------------------------------- +org $1EE9FE ; <- F69FE +JSL.l ItemSet_OldMan +;-------------------------------------------------------------------------------- +org $068F16 ; <- 30F16 +JSL.l ItemCheck_ZoraKing +;-------------------------------------------------------------------------------- +org $059ACA ; <- 29ACA +JSL $1DE1AA ; Sprite_SpawnFlippersItem +;-------------------------------------------------------------------------------- +org $1DE1E4 ; <- EE1E4 - sprite_great_catfish.asm : 489 +JSL.l LoadZoraKingItemGFX +NOP #2 +;-------------------------------------------------------------------------------- +org $1DE1A1 ; <- EE1A1 - sprite_great_catfish.asm : 45 +JSL.l LoadCatfishItemGFX +NOP #2 +;-------------------------------------------------------------------------------- +org $068D86 ; <- 30D86 +JSL.l ItemCheck_SickKid +;-------------------------------------------------------------------------------- +org $06B9D4 ; <- 339D4 - sprite_bug_net_kid.asm : 111 (JSL Link_ReceiveItem) +JSL.l ItemSet_SickKid +;-------------------------------------------------------------------------------- +org $068BAC ; <- 30BAC - SpritePrep_FluteBoy : 1068 +JSL.l ItemCheck_TreeKid2 + +org $06908D ; <- 3108D - SpritePrep_FluteBoy : 2175 +JSL.l ItemCheck_TreeKid +CMP.b #$08 +BEQ $0A + +org $069095 ; <- 31095 - SpritePrep_FluteBoy : 2177 +JSL.l ItemCheck_TreeKid +CMP.b #$08 + +org $0690BD ; <- 310BD - SpritePrep_FluteBoy : 2202 +JSL.l ItemCheck_TreeKid2 + +org $06AF9B ; <- 32F9B - FluteBoy_Chillin : 73 : LDA $7EF34C : CMP.b #$02 : BCS .player_has_flute +;NOP #8 +LDA !HAS_GROVE_ITEM : AND.b #$01 +db #$D0 ; BNE + +org $06B062 ; <- 33062 - FluteAardvark_InitialStateFromFluteState : 225 : LDA $7EF34C : AND.b #$03 : !BGE #$05 +JSL.l ItemCheck_TreeKid2 +NOP #$02 ; remove pointless AND + +org $06B048 ; <- 33048 +JSL.l ItemCheck_TreeKid3 + +org $06AF59 ; <- 32F59 - sprite_flute_boy.asm : 36 (LDA $0D80, X : CMP.b #$03 : BEQ .invisible) +JMP.l FluteBoy +FluteBoy_Abort: +RTS +FluteBoy_Continue: + +;org $1E9968 ; <- F1968 - sprite_flute_boy_ostrich.asm : 14 (dw FluteBoyOstrich_Chillin) +;dw #$9991 ; FluteBoyOstrich_RunAway +;-------------------------------------------------------------------------------- +org $06B0C9 ; <- 330C9 +JSL.l ItemSet_TreeKid +;-------------------------------------------------------------------------------- +org $05F177 ; <- 2F177 +JSL.l ItemCheck_Sahasrala +;-------------------------------------------------------------------------------- +org $05F200 ; <- 2F200 +JSL.l ItemSet_Sahasrala +;-------------------------------------------------------------------------------- +org $1DE102 ; <- EE102 +JSL.l ItemCheck_Catfish +org $1DE11C ; <- EE11C +JSL.l ItemCheck_Catfish +;-------------------------------------------------------------------------------- +org $1DE1A1 ; <- EE1A1 - sprite_great_catfish.asm : 445 +JSL.l LoadCatfishItemGFX +NOP #2 +;-------------------------------------------------------------------------------- +org $1DDF81 ; <- EDF81 - sprite_great_catfish.asm : 61 +JSL.l DrawThrownItem +;-------------------------------------------------------------------------------- +org $05EE53 ; <- 2EE53 - mushroom.asm : 22 +JSL.l ItemCheck_Mushroom +NOP #2 +;-------------------------------------------------------------------------------- +org $05EE8C ; <- 2EE8C - mushroom.asm : 69 +JSL.l ItemSet_Mushroom +NOP +;-------------------------------------------------------------------------------- +org $05F53E ; <- 2F53E - sprite_potion_shop.asm : 40 +JSL.l ItemCheck_Powder +CMP.b #$20 +;-------------------------------------------------------------------------------- +; the quake medallion AND FLIPPERS +org $1DDF71 ; <- EDF71 - sprite_great_catfish.asm : 47 +JSL.l MarkThrownItem +;-------------------------------------------------------------------------------- +;org $05F65D ; <- 2F65D - DONE IN INVENTORY +;JSL.l ItemSet_Powder +;NOP #2 +;-------------------------------------------------------------------------------- +;JSL.l ItemCheck_RupeeNPC +;-------------------------------------------------------------------------------- +;JSL.l ItemSet_RupeeNPC +;-------------------------------------------------------------------------------- +;org $08D01B ; PC 0x4501B - ancilla_flute.asm - 55 +;JSL.l ItemSet_Flute +;-------------------------------------------------------------------------------- +org $05FAFF ; <- 2FAFF - sprite_mad_batter.asm:57 (LDA $7EF37B : CMP.b #$01 : BCS .magic_already_doubled) +JSL.l ItemCheck_MagicBat : BEQ + : RTS : NOP : + +;================================================================================ + + +;================================================================================ +; Boss Hearts +;-------------------------------------------------------------------------------- +org $05EF5D ; <- 2EF5D - sprite_heart_upgrades.asm:110 (JSL GetAnimatedSpriteTile.variable) +JSL.l HeartContainerSpritePrep +;-------------------------------------------------------------------------------- +org $05EF79 ; <- 2EF79 - sprite_heart_upgrades.asm:128 (JSL Sprite_PrepAndDrawSingleLargeLong) +JSL.l DrawHeartContainerGFX +;-------------------------------------------------------------------------------- +org $05EFCE ; <- 2EFCE - sprite_heart_upgrades.asm:176 (JSL Link_ReceiveItem) +;org $05EFEE ; <- 2EFEE - sprite_heart_upgrades.asm:202 (JSL Link_ReceiveItem) +JSL.l HeartContainerGet +;-------------------------------------------------------------------------------- +;-------------------------------------------------------------------------------- +org $0799B1 ; 399B1 - Bank07.asm:4063 (CPY.b #$3E : BNE .notHeartContainer) +JSL.l HeartContainerSound +BCC Link_ReceiveItem_notHeartContainer +; JSR Player_DoSfx3 +org $0799BA ; 399BA - Bank07.asm:4070 (LDA.b #$60 : STA $02D9) +Link_ReceiveItem_notHeartContainer: +;-------------------------------------------------------------------------------- +org $09887F ; <- 4887F - ancilla_init.asm : 1163 (LDA $0C5E, X : CMP.b #$3E : BEQ .doneWithSoundEffects) +JSL NormalItemSkipSound +NOP +BCS AddReceivedItem_doneWithSoundEffects +org $0988AE ; <- 488AE - ancilla_init.asm : 1193 (LDA.b #$0A : STA $02) +AddReceivedItem_doneWithSoundEffects: +;================================================================================ +; Heart Pieces +;-------------------------------------------------------------------------------- +org $05F030 ; <- 2F030 - display item +JSL.l DrawHeartPieceGFX +;-------------------------------------------------------------------------------- +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 +NOP #22 +;-------------------------------------------------------------------------------- +org $06C0B0 ; <- 340B0 - sprite prep +JSL.l HeartPieceSpritePrep +;-------------------------------------------------------------------------------- +org $08C45B ; <- 4445B - ancilla_receive_item.asm : 152 +JSL.l HPItemReset +;-------------------------------------------------------------------------------- +org $05EF1E ; <- 2EF1E - sprite_heart_upgrades.asm : 48 (LDA $7EF280, X : AND.b #$40 : BEQ .dont_self_terminate) +JSL.l HeartUpgradeSpawnDecision +;-------------------------------------------------------------------------------- +org $05EFFA ; <- 2EFFA - sprite_heart_upgrades.asm : 216 (LDA $7EF280, X : ORA.b #$40 : STA $7EF280, X) +JSL.l SaveHeartCollectedStatus +NOP #6 +;================================================================================ + +;================================================================================ +; Fake Flippers Softlock Fix + General Damage Hooks +;-------------------------------------------------------------------------------- +org $0780C6 ; <- 380C6 - Bank07.asm:174 (LDA $7EF36D) +JSL.l OnLinkDamaged +;-------------------------------------------------------------------------------- +org $0794FB ; <- 394FB - Bank07.asm:3336 (LDA.b #$14 : STA $11) +JSL.l OnLinkDamagedFromPit +;-------------------------------------------------------------------------------- +org $078F27 ; <- 38F27 +JSL.l FlipperReset +;-------------------------------------------------------------------------------- + +;================================================================================ +; Floodgate Softlock Fix +;-------------------------------------------------------------------------------- +org $0AB903 ; <- 53903 +JSL.l FloodGateAndMasterSwordFollowerReset +JSL.l IncrementFlute +NOP #2 +;-------------------------------------------------------------------------------- +org $02AAA5 ; <- 12AA5 +JSL.l OnOWTransition +NOP #6 +;================================================================================ + +;================================================================================ +; Heart Beep Timer +;-------------------------------------------------------------------------------- +org $0DDC9B ; <- 6DC9B +JSL.l BeepLogic +NOP #6 +;================================================================================ + +;================================================================================ +; Item Downgrade Fix +;-------------------------------------------------------------------------------- +org $09865E ; <- 4865E +JSL.l $1BEE1B ; fix something i wrote over i shouldn't have +;-------------------------------------------------------------------------------- +org $098638 ; <- 48638 - ancilla_init.asm:737 - LDA .item_values, Y : BMI .dontWrite (BMI) +JSL.l ItemDowngradeFix +;================================================================================ + +;================================================================================ +; Lamp Mantle & Light Cone Fix +;-------------------------------------------------------------------------------- +org $1AFC4D ; <- D7C4D - sprite_movable_mantle.asm:31 (LDA $7EF3CC : CMP.b #$01 : BNE .return) +JSL.l CheckForZelda +;-------------------------------------------------------------------------------- +org $1AFC55 ; <- D7C55 - sprite_movable_mantle.asm:34 (LDA $7EF34A : BEQ .return) +NOP #6 ; remove check +;-------------------------------------------------------------------------------- +org $0DFA53 ; <- 6FA53 - hud check for lantern +JSL.l LampCheck +;================================================================================ \ No newline at end of file diff --git a/hud.asm b/hud.asm new file mode 100644 index 00000000..bb015302 --- /dev/null +++ b/hud.asm @@ -0,0 +1,45 @@ +;org $0DFE97 ; <- 6FE97 - headsup_display.asm:1009 (.hud_tilemap) +HUD_TileMap: + dw $207F, $207F, $2850, $A856 + dw $2852, $285B, $285B, $285C + ;dw $207F, $3CA8, $207F, $207F, $207F + dw $207F, $3C02, $3C03, $207F, $207F + dw $2C88, $2C89, $207F, $20A7 + dw $20A9, $207F, $2871 ;, $207F + dw $207F, $207F, $288B, $288F + dw $24AB, $24AC, $688F, $688B + dw $207F, $207F, $207F, $207F + dw $207F, $207F, $2854, $2871 + dw $2858, $207F, $207F, $285D + dw $207F, $207F, $207F, $207F + dw $207F, $207F, $207F, $207F + dw $207F, $207F, $207F, $207F + dw $207F, $207F, $207F, $207F + dw $207F, $207F, $207F, $207F + dw $207F, $207F, $207F, $207F + dw $207F, $207F, $2854, $304E + dw $2858, $207F, $207F, $285D + dw $207F, $207F, $207F, $207F + dw $207F, $207F, $207F, $207F + dw $207F, $207F, $207F, $207F + dw $207F, $207F, $207F, $207F + dw $207F, $207F, $207F, $207F + dw $207F, $207F, $207F, $207F + dw $207F, $207F, $2854, $305E + dw $2859, $A85B, $A85B, $A85C + dw $207F, $207F, $207F, $207F + dw $207F, $207F, $207F, $207F + dw $207F, $207F, $207F, $207F + dw $207F, $207F, $207F, $207F + dw $207F, $207F, $207F, $207F + dw $207F, $207F, $207F, $207F + dw $207F, $207F, $2854, $305E + dw $6854, $207F, $207F, $207F + dw $207F, $207F, $207F, $207F + dw $207F, $207F, $207F, $207F + dw $207F, $207F, $207F, $207F + dw $207F, $207F, $207F, $207F + dw $207F, $207F, $207F, $207F + dw $207F, $207F, $207F, $207F + dw $207F, $207F, $A850, $2856 + dw $E850 \ No newline at end of file diff --git a/hudpalette.pal b/hudpalette.pal new file mode 100644 index 0000000000000000000000000000000000000000..72ae3e8eb740597c58c5bcb38f85439136588c74 GIT binary patch literal 64 vcmZQzn8CO;i~$HF82;CT=sipj`eY`AJ|?l&5+uHZ!PXf>vxq~)8NliR-}eqW literal 0 HcmV?d00001 diff --git a/init.asm b/init.asm new file mode 100644 index 00000000..aed405c0 --- /dev/null +++ b/init.asm @@ -0,0 +1,27 @@ +;-------------------------------------------------------------------------------- +; Init_Primary +;-------------------------------------------------------------------------------- +; This can be as inefficient as we want. Interrupts are off when this gets +; called and it only gets called once ever during RESET. +;-------------------------------------------------------------------------------- +Init_Primary: + LDA #$00 + + LDX #$00 ; initalize our ram + - + STA $7EC025, X + STA $7F5000, X + INX + CPX #$10 : !BLT - + + LDX #$10 ; initalize more ram + - + STA $7F5000, X + INX + CPX #$FF : !BLT - + + LDA.b #$01 : STA $420D ; enable fastrom access on upper banks + + LDA.b #$81 : STA $4200 ; thing we wrote over, turn on NMI & gamepad +RTL +;-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/inventory.asm b/inventory.asm new file mode 100644 index 00000000..902bf494 --- /dev/null +++ b/inventory.asm @@ -0,0 +1,984 @@ +;================================================================================ +; Inventory Updates +;================================================================================ +!INVENTORY_SWAP = "$7EF412" +; Item Tracking Slot +; brmp-skf +; b = blue boomerang +; r = red boomerang +; m = mushroom +; p = magic powder +; - +; s = shovel +; k = fake flute +; f = working flute +;-------------------------------------------------------------------------------- +!INVENTORY_SWAP_2 = "$7EF414" +; Item Tracking Slot #2 +; bs------ +; b = bow +; s = silver arrow bow +; - +; - +; - +; - +; - +; - +;-------------------------------------------------------------------------------- +; ProcessMenuButtons: +; out: Carry - 0 = No Button, 1 = Yes Button +;-------------------------------------------------------------------------------- +ProcessMenuButtons: + ;LDA #$FD : STA !INVENTORY_SWAP ; DEBUG MODE + ;LDA $F6 : BIT #$20 : BNE .l_pressed ; check for P1 L-button + LDA $F4 : BIT #$40 : BNE .y_pressed ; check for P1 Y-button + BIT #$20 : BNE .sel_pressed ; check for P1 Select button + LDA $F0 : BIT #$20 : BNE .sel_held + .sel_unheld + LDA !HUD_FLAG : AND #$20 : BEQ + + LDA !HUD_FLAG : AND #$DF : STA !HUD_FLAG ; select is released, unset hud flag + LDA $1B : BEQ + ; skip if outdoors + LDA.b #$20 : STA $012F ; menu select sound + + + JSL.l ResetEquipment + + + .sel_held + CLC ; no buttons +RTL + .sel_pressed + LDA !HUD_FLAG : ORA #$20 : STA !HUD_FLAG ; set hud flag + LDA.b #$20 : STA $012F ; menu select sound + JSL.l ResetEquipment +RTL + .y_pressed + LDA.b #$10 : STA $0207 + LDA $0202 ; check selected item + CMP #$02 : BNE + ; boomerang + LDA !INVENTORY_SWAP : AND #$C0 : CMP #$C0 : BNE .errorJump ; make sure we have both boomerangs + LDA $7EF341 : EOR #$03 : STA $7EF341 ; swap blue & red boomerang + LDA.b #$20 : STA $012F ; menu select sound + BRL .captured + + CMP #$01 : BNE + ; bow + LDA !INVENTORY_SWAP_2 : AND #$C0 : CMP #$C0 : BNE .errorJump ; make sure we have both bows + LDA $7EF340 : !SUB #$01 : EOR #$02 : !ADD #$01 : STA $7EF340 ; swap bows + LDA.b #$20 : STA $012F ; menu select sound + BRL .captured + + CMP #$05 : BNE + ; powder + LDA !INVENTORY_SWAP : AND #$30 : CMP #$30 : BNE .errorJump ; make sure we have mushroom & magic powder + LDA $7EF344 : EOR #$03 : STA $7EF344 ; swap mushroom & magic powder + LDA.b #$20 : STA $012F ; menu select sound + BRL .captured + ;+ BRA + + .errorJump + BRA .error + + CMP #$0D : BNE + ; flute + LDA $037A : CMP #$01 : BEQ .midShovel ; inside a shovel animation, force the shovel & make error sound + LDA !INVENTORY_SWAP : BIT #$04 : BEQ .error ; make sure we have shovel + AND #$03 : BEQ .error ; make sure we have one of the flutes + LDA $7EF34C : CMP #01 : BNE .toShovel ; not shovel + + LDA !INVENTORY_SWAP : AND #$01 : BEQ .toFakeFlute ; check for real flute + LDA #$03 ; set real flute + BRA .fluteSuccess + .toFakeFlute + LDA #$02 ; set fake flute + BRA .fluteSuccess + .toShovel + LDA #$01 ; set shovel + .fluteSuccess + STA $7EF34C ; store set item + LDA.b #$20 : STA $012F ; menu select sound + BRA .captured + + + CMP #$10 : BNE .error : JSL.l ProcessBottleMenu : BRA .captured : + + CLC +RTL + .midShovel + LDA #$01 : STA $7EF34C ; set shovel + .error + LDA.b #$3C : STA $012E ; error sound + .captured + SEC +RTL +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +;ProcessBottleMenu: +;-------------------------------------------------------------------------------- +ProcessBottleMenu: + LDA $F4 : AND #$40 : BEQ .y_not_pressed ; skip if Y is not down + LDA $7EF34F ; check bottle state + BEQ .no_bottles ; skip if we have no bottles + PHX + INC : CMP #$05 : !BLT + : LDA #$01 : + ;increment and wrap 1-4 + TAX : LDA $7EF35C-1, X ; check bottle + BNE + : LDX #$01 : + ; wrap if we reached the last bottle + TXA : STA $7EF34F ; set bottle index + LDA.b #$20 : STA $012F ; menu select sound + PLX + .no_bottles + LDA #$00 ; pretend like the controller state was 0 from the overridden load +RTL + .y_not_pressed + LDA $F4 : AND.b #$0C ; thing we wrote over - load controller state +RTL +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +;OpenBottleMenu: +;-------------------------------------------------------------------------------- +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 #$07 : STA $0200 ; thing we wrote over - opens bottle menu + .x_not_pressed +RTL +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +;CloseBottleMenu: +;-------------------------------------------------------------------------------- +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 + + INC $0200 ; return to normal menu + STZ $0205 + + LDA #$00 +RTL + .x_not_pressed + LDA $F4 : AND.b #$0C ; thing we wrote over (probably) +RTL +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; AddInventory: +;-------------------------------------------------------------------------------- +!LOCK_STATS = "$7EF443" + +macro TopHalf(address) + LDA
: !ADD #$10 : STA
+endmacro + +macro BottomHalf(address) + PHA : PHX + LDA
: INC : AND #$0F : TAX + LDA
: AND #$F0 : STA
+ TXA : ORA
: STA
+ PLX : PLA +endmacro +;-------------------------------------------------------------------------------- +FullInventoryExternal: + LDA !LOCK_STATS : BEQ + : RTL : + + PHA : PHX : PHP : JMP AddInventory_fullItemCounts +;-------------------------------------------------------------------------------- +AddInventory: + PHA : PHX : PHP + + CPY.b #$0C : BNE + ; Blue Boomerang + LDA !INVENTORY_SWAP : ORA #$80 : STA !INVENTORY_SWAP + BRL .incrementCounts + + CPY.b #$2A : BNE + ; Red Boomerang + LDA !INVENTORY_SWAP : ORA #$40 : STA !INVENTORY_SWAP + BRL .incrementCounts + + CPY.b #$29 : BNE + ; Mushroom + LDA !INVENTORY_SWAP : ORA #$20 : STA !INVENTORY_SWAP + BRL .incrementCounts + + CPY.b #$0D : BNE + ; Magic Powder + LDA !INVENTORY_SWAP : ORA #$10 : STA !INVENTORY_SWAP + BRL .incrementCounts + + CPY.b #$13 : BNE + ; Shovel + LDA !INVENTORY_SWAP : ORA #$04 : STA !INVENTORY_SWAP + BRL .incrementCounts + + CPY.b #$14 : BNE + ; Flute (Inactive) + LDA !INVENTORY_SWAP : ORA #$02 : STA !INVENTORY_SWAP + BRL .incrementCounts + + CPY.b #$4A : BNE + ; Flute (Active) + LDA !INVENTORY_SWAP : ORA #$01 : STA !INVENTORY_SWAP + BRL .incrementCounts + + CPY.b #$0B : BNE + ; Bow + LDA !INVENTORY_SWAP_2 : ORA #$80 : STA !INVENTORY_SWAP_2 + BRL .incrementCounts + + CPY.b #$3A : BNE + ; Bow & Arrows + LDA !INVENTORY_SWAP_2 : ORA #$80 : STA !INVENTORY_SWAP_2 + BRL .incrementCounts + + CPY.b #$3B : BNE + ; Bow & Silver Arrows + LDA !INVENTORY_SWAP_2 : ORA #$40 : STA !INVENTORY_SWAP_2 + BRL .incrementCounts + + CPY.b #$58 : BNE + ; Upgrade-Only Silver Arrows + LDA !INVENTORY_SWAP_2 : ORA #$40 : STA !INVENTORY_SWAP_2 + + + + .incrementCounts + LDA !LOCK_STATS : BEQ + : BRL .done : + + + ; don't count any of this stuff + CPY.b #$20 : BNE + : BRL .itemCounts : + ; Crystal + CPY.b #$26 : BNE + : BRL .itemCounts : + ; Heart Piece Completion Heart + CPY.b #$2E : BNE + : BRL .itemCounts : + ; Red Potion (Refill) + CPY.b #$2F : BNE + : BRL .itemCounts : + ; Green Potion (Refill) + CPY.b #$30 : BNE + : BRL .itemCounts : + ; Blue Potion (Refill) + CPY.b #$37 : BNE + : BRL .itemCounts : + ; Pendant + CPY.b #$38 : BNE + : BRL .itemCounts : + ; Pendant + CPY.b #$39 : BNE + : BRL .itemCounts : + ; Pendant + CPY.b #$00 : BNE + : BRL .itemCounts : + ; Uncle Sword & Shield + + CPY.b #$04 : !BLT .isSword ; Swords - Skip Shop/Fairy Check for Swords + CPY.b #$50 : BEQ .isSword + BRA + + .isSword + LDA $7EF42A : AND #$40 : BNE ++ ; skip additional processing if we have the fairy sword flag yet + BRL .dungeonCounts + ++ + BRL .itemCounts + + + CPY.b #$3B : BNE + : BRL .dungeonCounts : + ; Silver Arrow Bow - Skip Shop/Fairy Check for Silver Arrow Bow + + LDA $02E9 : CMP #$01 : BEQ ++ ; skip shop check for chests + PHP : REP #$20 ; set 16-bit accumulator + LDA $048E + CMP.w #274 : BNE + : BRL .shop : + ; dark world death mountain shop, ornamental shield shop + CMP.w #271 : BNE + : BRL .shop : + ; villiage of outcasts shop, lumberjack shop, lake hylia shop, dark world magic shop + CMP.w #272 : BNE + : BRL .shop : + ; red shield shop + CMP.w #284 : BNE + : BRL .shop : + ; bomb shop + ;CMP.w #265 : BNE + : BRL .shop : + ; potion shop - commented this out because it's easier to just block potion refills + ;CMP.w #271 : BNE + : BRL .shop : + ; lake hylia shop + CMP.w #287 : BNE + : BRL .shop : + ; kakariko shop + CMP.w #255 : BNE + : BRL .shop : + ; light world death mountain shop + CMP.w #276 : BNE + : BRL .shop : + ; waterfall fairy + CMP.w #278 : BNE + : BRL .shop : + ; pyramid fairy + PLP : BRA ++ + .shop + PLP : BRL .done + ++ + + .dungeonCounts + LDA $1B : BNE + : BRL .fullItemCounts : + + + LDA $040C ; get dungeon id + + CMP.b #$00 : BNE + ; Sewers (Escape) + BRA ++ + + CMP.b #$02 : BNE + ; Hyrule Castle (Escape) + ++ + CPY.b #$32 : BNE ++ : BRL .itemCounts : ++ ; Ball & Chain Guard's Big Key + %TopHalf($7EF434) + BRL .fullItemCounts + + CMP.b #$04 : BNE + ; Eastern Palace + LDA $7EF436 : INC : AND #$07 : TAX + LDA $7EF436 : AND #$F8 : STA $7EF436 + TXA : ORA $7EF436 : STA $7EF436 + BRL .fullItemCounts + + CMP.b #$06 : BNE + ; Desert Palace + LDA $7EF435 : !ADD #$20 : STA $7EF435 + BRL .fullItemCounts + + CMP.b #$08 : BNE + ; Agahnim's Tower + LDA $7EF435 : INC : AND #$03 : TAX + LDA $7EF435 : AND #$FC : STA $7EF435 + TXA : ORA $7EF435 : STA $7EF435 + BRL .fullItemCounts + + CMP.b #$0A : BNE + ; Swamp Palace + %BottomHalf($7EF439) + BRL .fullItemCounts + + CMP.b #$0C : BNE + ; Palace of Darkness + %BottomHalf($7EF434) + BRL .fullItemCounts + + CMP.b #$0E : BNE + ; Misery Mire + %BottomHalf($7EF438) + BRL .fullItemCounts + + CMP.b #$10 : BNE + ; Skull Woods + %TopHalf($7EF437) + BRL .fullItemCounts + + CMP.b #$12 : BNE + ; Ice Palace + %TopHalf($7EF438) + BRL .fullItemCounts + + CMP.b #$14 : BNE + ; Tower of Hera + LDA $7EF435 : !ADD #$04 : AND #$1C : TAX + LDA $7EF435 : AND #$E3 : STA $7EF435 + TXA : ORA $7EF435 : STA $7EF435 + BRL .fullItemCounts + + CMP.b #$16 : BNE + ; Thieves' Town + %BottomHalf($7EF437) + BRL .fullItemCounts + + CMP.b #$18 : BNE + ; Turtle Rock + %TopHalf($7EF439) + BRL .fullItemCounts + + CMP.b #$1A : BNE + ; Ganon's Tower + LDA $7EF436 : !ADD #$08 : STA $7EF436 + LDA $7EF366 : AND #$04 : BNE ++ + JSR .incrementGTowerPreBigKey + ++ + ;BRL .fullItemCounts + + + + .fullItemCounts + + CPY.b #$3B : BNE + ; Skip Total Counts for Repeat Silver Arrows + LDA $7EF42A : BIT #$20 : BEQ + : BRA .itemCounts + + + + LDA $7EF355 : BNE + ; Check for Boots + LDA $7EF432 : INC : STA $7EF432 ; Increment Pre Boots Counter + + + + LDA $7EF353 : BNE + ; Check for Mirror + LDA $7EF433 : INC : STA $7EF433 ; Increment Pre Mirror Counter + + + + LDA $7EF423 : INC : STA $7EF423 ; Increment Item Total + + .itemCounts + + CPY.b #$00 : BNE + ; Fighter's Sword & Fighter's Shield + JSR .incrementSword + JSR .incrementShield + BRL .done + + CPY.b #$01 : BNE + ; Master Sword + JSR .incrementSword + BRL .done + + CPY.b #$02 : BNE + ; Tempered Sword + JSR .incrementSword + BRL .done + + CPY.b #$03 : BNE + ; Golden Sword + JSR .incrementSword + BRL .done + + CPY.b #$04 : BNE + ; Fighter's Shield + JSR .incrementShield + BRL .done + + CPY.b #$05 : BNE + ; Red Shield + JSR .incrementShield + BRL .done + + CPY.b #$06 : BNE + ; Mirror Shield + JSR .incrementShield + BRL .done + + CPY.b #$07 : !BLT + ; Items 7 - D + CPY.b #$0E : !BGE + + JSR .incrementY + BRL .done + + CPY.b #$0F : !BLT + ; Items F - 16 + CPY.b #$17 : !BGE + + JSR .incrementY + BRL .done + + CPY.b #$17 : BNE + ; Heart Piece + JSR .incrementHeartPiece + BRL .done + + CPY.b #$18 : !BLT + ; Items 18 - 1A + CPY.b #$1B : !BGE + + JSR .incrementY + BRL .done + + CPY.b #$1D : BNE + ; Book of Mudora - leave this above the 1B-1F condition + JSR .incrementY + BRL .done + + CPY.b #$1B : !BLT + ; Items 1B - 1F + CPY.b #$20 : !BGE + + JSR .incrementA + BRL .done + + CPY.b #$20 : BNE + ; Crystal + JSR .incrementCrystal + BRL .done + + CPY.b #$21 : BNE + ; Bug Net + JSR .incrementY + BRL .done + + CPY.b #$22 : !BLT + ; Items 22 - 23 + CPY.b #$24 : !BGE + + JSR .incrementMail + BRL .done + + CPY.b #$24 : BNE + ; Small Key + JSR .incrementKey + BRL .done + + CPY.b #$25 : BNE + ; Compass + JSR .incrementCompass + BRL .done + + CPY.b #$26 : BNE + ; Liar Heart (Container) + ;JSR .incrementHeartContainer + BRL .done + + CPY.b #$27 : BNE + ; 1 Bomb + JSR .maybeIncrementBombs + BRL .done + + CPY.b #$28 : BNE + ; 3 Bombs + JSR .maybeIncrementBombs + BRL .done + + CPY.b #$29 : BNE + ; Musoroom + JSR .incrementY + BRL .done + + CPY.b #$2A : !BLT + ; Items 2A - 2D + CPY.b #$2E : !BGE + + JSR .incrementY + BRL .done + + CPY.b #$31 : BNE + ; 10 Bombs + JSR .maybeIncrementBombs + BRL .done + + CPY.b #$32 : BNE + ; Big Key + JSR .incrementBigKey + BRL .done + + CPY.b #$33 : BNE + ; Map + JSR .incrementMap + BRL .done + + CPY.b #$37 : !BLT + ; Items 37 - 39 - Pendants + CPY.b #$3A : !BGE + + JSR .incrementPendant + BRL .done + + CPY.b #$3A : !BLT + ; Items 3A - 3B - Bow & Silver Arrows + CPY.b #$3C : !BGE + + JSR .incrementBow + BRL .done + + CPY.b #$3C : BNE + ; Bottle w/Bee + JSR .incrementY + BRL .done + + CPY.b #$3D : BNE + ; Bottle w/Fairy + JSR .incrementY + BRL .done + + CPY.b #$3E : !BLT + ; Items 3E - 3F - Heart Containers + CPY.b #$40 : !BGE + + JSR .incrementHeartContainer + BRL .done + + CPY.b #$48 : BNE + ; Bottle w/Gold Bee + JSR .incrementY + BRL .done + + CPY.b #$49 : BNE + ; Fighter's Sword + JSR .incrementSword + BRL .done + + CPY.b #$4A : BNE + ; Flute (Active) + JSR .incrementY + BRL .done + + CPY.b #$4B : BNE + ; Pegasus Boots + JSR .incrementA + BRL .done + + CPY.b #$4C : BNE + ; Bomb Capacity Upgrade + JSR .incrementCapacity + JSR .maybeIncrementBombs + BRL .done + + CPY.b #$4D : !BLT + ; Items 4D - 4F - Capacity Upgrades + CPY.b #$50 : !BGE + + JSR .incrementCapacity + BRL .done + + CPY.b #$50 : BNE + ; Master Sword (Safe) + JSR .incrementSword + BRL .done + + CPY.b #$51 : !BLT + ; Items 4D - 4F - Capacity Upgrades + CPY.b #$55 : !BGE + + JSR .incrementCapacity + BRL .done + + CPY.b #$58 : BNE + ; Upgrade-Only Sivler Arrows + JSR .incrementBow + BRL .done + + + .done + PLP : PLX : PLA +RTL +; WHICH BEE IS BOTTLED? +; MAKE SURE FAIRY FOUNTAINS DON'T FUCK THE COUNTS UP + +.incrementSword + ; CHECK FOR DUPLICATE SWORDS + TYA ; load sword item + CMP.b #$50 : BNE + : LDA.b #$01 : + ; convert extra master sword to normal one + CMP.b #$49 : BNE + : LDA.b #$00 : + ; convert extra fighter sword to normal one + INC : CMP !HIGHEST_SWORD_LEVEL : !BLT + ; skip if highest is higher + PHA + LDA !HIGHEST_SWORD_LEVEL : AND #$F8 : ORA 1,s : STA !HIGHEST_SWORD_LEVEL + PLA + + + + LDA $00 : PHA + LDA.l FairySword : STA $00 + CPY $00 : BNE + ; increment if not the fairy sword + LDA $7EF42A : BIT #$40 : BNE ++ ; skip if we have the fairy sword flag yet + ORA.b #$40 : STA $7EF42A ; set fairy sword flag + + + LDA $7EF422 : !ADD #$20 : STA $7EF422 ; increment sword counter + ++ + PLA : STA $00 +RTS + +.incrementShield + ; CHECK FOR DUPLICATE SHIELDS + LDA $7EF422 : !ADD #$08 : AND #$18 : TAX + LDA $7EF422 : AND #$E7 : STA $7EF422 + TXA : ORA $7EF422 : STA $7EF422 +RTS + +.incrementBow + CPY.b #$3B : BNE ++ + LDA $7EF42A : BIT #$20 : BEQ + : RTS : + + ORA #$20 : STA $7EF42A + ++ +.incrementY + LDA $7EF421 : !ADD #$08 : STA $7EF421 +RTS + +.incrementA + LDA $7EF421 : INC : AND #$07 : TAX + LDA $7EF421 : AND #$F8 : STA $7EF421 + TXA : ORA $7EF421 : STA $7EF421 +RTS + +.incrementPendant + LDA $7EF429 : INC : AND #$03 : TAX + LDA $7EF429 : AND #$FC : STA $7EF429 + TXA : ORA $7EF429 : STA $7EF429 + JSR .incrementBossSword +RTS + +.incrementCapacity + %BottomHalf($7EF452) +RTS + +.incrementHeartPiece + LDA $7EF448 : INC : AND #$1F : TAX + LDA $7EF448 : AND #$E0 : STA $7EF448 + TXA : ORA $7EF448 : STA $7EF448 +RTS + +.incrementHeartContainer + %TopHalf($7EF429) +RTS + +.incrementCrystal + LDA $7EF422 : INC : AND #$07 : TAX + LDA $7EF422 : AND #$F8 : STA $7EF422 + TXA : ORA $7EF422 : STA $7EF422 + JSR .incrementBossSword +RTS + +.incrementMail + LDA $7EF424 : !ADD #$40 : STA $7EF424 +RTS + +.incrementKeyLong + JSR .incrementKey +RTL + +.incrementKey + PHA : PHX + LDA $7EF424 : INC : AND #$3F : TAX + LDA $7EF424 : AND #$C0 : STA $7EF424 + TXA : ORA $7EF424 : STA $7EF424 + PLX : PLA +RTS + +.incrementCompass + %BottomHalf($7EF428) +RTS + +.incrementBigKey + LDA $7EF427 : !ADD #$10 : STA $7EF427 +RTS + +.incrementGTowerPreBigKey + LDA $7EF42A : INC : AND #$1F : TAX + LDA $7EF42A : AND #$E0 : STA $7EF42A + TXA : ORA $7EF42A : STA $7EF42A +RTS + +.maybeIncrementBombs + LDA $7EF42A : AND #$80 : BNE + + LDA $7EF42A : ORA #$80 : STA $7EF42A + JSR .incrementY + + +RTS + +.incrementMap + LDA $7EF428 : !ADD #$10 : STA $7EF428 +RTS + +.incrementBossSwordLong + JSR .incrementBossSword +RTL + +.incrementBossSword + LDA $7EF359 + CMP #$01 : BNE + + %TopHalf($7EF425) + + CMP #$02 : BNE + + %BottomHalf($7EF425) + + CMP #$03 : BNE + + %TopHalf($7EF426) + + CMP #$04 : BNE + + %BottomHalf($7EF426) + + +RTS +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; Link_ReceiveItem_HUDRefresh: +;-------------------------------------------------------------------------------- +Link_ReceiveItem_HUDRefresh: + LDA $7EF343 : BNE + ; skip if we have bombs + LDA $7EF375 : BEQ + ; skip if we are filling no bombs + DEC : STA $7EF375 ; decrease bomb fill count + LDA.b #$01 : STA $7EF343 ; increase actual bomb count + + + + JSL.l HUD_RefreshIconLong ; thing we wrote over + JSL.l PostItemGet +RTL +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; HandleBombAbsorbtion: ; NOTE CAREFULLY HOW THESE TWO FUNCTIONS ARE PARTIALLY COMMENTED OUT +;-------------------------------------------------------------------------------- +HandleBombAbsorbtion: + STA $7EF375 ; thing we wrote over +;RTL ; don't return, fall throgh to next function +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; Link_ReceiveItem_PreselectItems: +;-------------------------------------------------------------------------------- +;Link_ReceiveItem_PreselectItems: + LDA $0202 : BNE + ; skip if we already have some item selected +; LDA $7EF343 : BEQ + ; skip if we have no bombs + LDA.b #$04 : STA $0202 ; set selected item to bombs + + +RTL +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; AddYMarker: +;-------------------------------------------------------------------------------- +;!JAR_STATUS = "$7F5030"; +AddYMarker: + LDA $0202 : AND.w #$FF ; load item value + CMP.w #$02 : BNE + ; boomerang + LDA !INVENTORY_SWAP : AND.w #$C0 : CMP.w #$C0 : BEQ .drawYBubble : BRA .drawNormal + + CMP.w #$01 : BNE + ; bow + LDA !INVENTORY_SWAP_2 : AND.w #$C0 : CMP.w #$C0 : BEQ .drawYBubble : BRA .drawNormal + + CMP.w #$05 : BNE + ; powder + LDA !INVENTORY_SWAP : AND.w #$30 : CMP.w #$30 : BEQ .drawYBubble : BRA .drawNormal + + CMP.w #$0D : BNE + ; flute + LDA !INVENTORY_SWAP : BIT.w #$04 : BEQ .drawNormal ; make sure we have shovel + AND.w #$03 : BNE .drawYBubble ; make sure we have one of the flutes + BRA .drawNormal + + CMP.w #$10 : BEQ .drawJarMarker + + .drawNormal + LDA.w #$7C60 + BRA .drawTile + + .drawJarMarker + ;SEP #$20 : LDA !JAR_STATUS : INC : AND.b #$01 : STA !JAR_STATUS : REP #$20 : BEQ .drawXBubble + LDA $0207 : AND.w #$0020 : BNE .drawXBubble + + .drawYBubble + LDA.w #$3D4F + BRA .drawTile + + .drawXBubble + JSR MakeCircleBlue + LDA.w #$2D3E + + .drawTile + STA $FFC4, Y +RTL +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; MakeCircleBlue +; 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 $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 $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 +RTS +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; UpgradeFlute: +;-------------------------------------------------------------------------------- +UpgradeFlute: + LDA !INVENTORY_SWAP : AND #$FC : ORA #$01 : STA !INVENTORY_SWAP ; switch to the working flute + LDA.b #$03 : STA $7EF34C ; upgrade primary inventory +RTL +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; GetWitchLootOAMTableIndex +; in: A - Loot ID +; out: A - Loot OAM Table Index +;-------------------------------------------------------------------------------- +GetWitchLootOAMTableIndex: + PHX + PHB : PHK : PLB + ;-------- + TAX : LDA .gfxSlots, X ; look up item gfx + PLB : PLX +RTL + +;DATA - Loot Identifier to Sprite ID +{ + .gfxSlots + db $FF, $FF, $FF, $FF, $05, $06, $FF, $0C + db $0B, $0D, $0A, $07, $13, $0E, $FF, $FF + + db $FF, $FF, $FF, $FF, $FF, $09, $FF, $FF + db $08, $FF, $FF, $10, $11, $12, $FF, $FF + + db $FF, $FF, $03, $04, $FF, $FF, $02, $FF + db $FF, $FF, $14, $15, $17, $16, $15, $17 + + db $16, $0F, $FF, $FF, $FF, $FF, $FF, $FF + db $FF, $FF, $FF, $FF, $FF, $FF, $02, $02 + + db $FF, $FF, $FF, $FF, $01, $FF, $FF, $FF + db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF +} +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; PrepItemScreenBigKey: +;-------------------------------------------------------------------------------- +PrepItemScreenBigKey: + STZ $02 + STZ $03 + REP #$30 ; thing we wrote over - set 16-bit accumulator +RTL +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; LoadPowder: +;-------------------------------------------------------------------------------- +LoadPowder: + JSL.l Sprite_SpawnDynamically ; thing we wrote over + LDA WitchItem + JSL.l PrepDynamicTile +RTL +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; InitializeBottles: +;-------------------------------------------------------------------------------- +InitializeBottles: + STA $7EF35C, X ; thing we wrote over + PHA + LDA $7EF34F : BNE + + TXA : INC : STA $7EF34F ; write bottle index to menu properly + + + PLA +RTL +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; DrawPowder: +;-------------------------------------------------------------------------------- +!REDRAW = "$7F5000" +;-------------------------------------------------------------------------------- +DrawPowder: + LDA $02DA : BNE .defer ; defer if link is buying a potion + LDA.l !REDRAW : BEQ + + LDA WitchItem + JSL.l PrepDynamicTile + LDA #$00 : STA.l !REDRAW ; reset redraw flag + BRA .defer + + + LDA WitchItem + JSL.l DrawDynamicTile + .defer +RTL +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; LoadMushroom: +;-------------------------------------------------------------------------------- +LoadMushroom: + LDA.b #$00 : STA $0DC0, X ; thing we wrote over + .justGFX + ;LDA MushroomItem + ;JSL.l PrepDynamicTile + + PHA + + LDA #$01 : STA !REDRAW + LDA $5D : CMP #$14 : BEQ .skip ; skip if we're mid-mirror + + LDA #$00 : STA !REDRAW + LDA MushroomItem + JSL.l PrepDynamicTile + + .skip + PLA +RTL +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; DrawMushroom: +;-------------------------------------------------------------------------------- +!REDRAW = "$7F5000" +;-------------------------------------------------------------------------------- +DrawMushroom: + PHA : PHY + LDA !REDRAW : BEQ .skipInit ; skip init if already ready + JSL.l LoadMushroom_justGFX + BRA .done ; don't draw on the init frame + + .skipInit + LDA MushroomItem + JSL.l DrawDynamicTile + + .done + PLY : PLA +RTL +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; CollectPowder: +;-------------------------------------------------------------------------------- +CollectPowder: + LDA.l WitchItem : TAY ; load witch item + STZ $02E9 ; item from NPC + JSL.l Link_ReceiveItem + ;JSL.l FullInventoryExternal + JSL.l ItemSet_Powder +RTL +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; RemoveMushroom: +;-------------------------------------------------------------------------------- +RemoveMushroom: + LDA !INVENTORY_SWAP : AND #$DF : STA !INVENTORY_SWAP ; remove the mushroom + AND #$10 : BEQ .empty ; check if we have powder + LDA.b #$02 : STA $7EF344 ; give powder if we have it +RTL + .empty + LDA.b #$00 : STA $7EF344 ; clear the inventory slot if we don't have powder +RTL +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; DrawMagicHeader: +;-------------------------------------------------------------------------------- +DrawMagicHeader: + LDA $7EF37B : AND.w #$00FF : CMP.w #$0002 : BEQ .quarterMagic + .halfMagic + 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 +RTL +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; FixShovelLock: +;-------------------------------------------------------------------------------- +;FixShovelLock: +; LDA $037A : CMP #$01 : BEQ + ; skip if link is shoveling +; LDA $7EF34C ; load shovel/flute item ID +; + +; CMP #$00 +;RTL +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; SpawnShovelItem: +;-------------------------------------------------------------------------------- +!REDRAW = "$7F5000" +SpawnShovelItem: + LDA.b #$01 : STA !REDRAW + + LDA $03FC : BEQ + + JSL DiggingGameGuy_AttemptPrizeSpawn + BRL .skip + + + + LDA $035B : AND.b #$01 : BNE + : BRL .skip : + ; corner dig fix + + PHY : PHP + PHB : PHK : PLB + SEP #$30 ; set 8-bit accumulator and index registers + + LDA $1B : BEQ + : JMP .no_drop : + ; skip if indoors + + LDA $8A : CMP #$2A : BEQ .no_drop ; don't drop in the haunted grove + CMP #$68 : BEQ .no_drop ; don't drop in the digging game area + + JSL GetRandomInt : BIT #$03 : BNE .no_drop ; drop with 1/4 chance + + LSR #2 : TAX ; clobber lower 2 bis - we have 64 slots now + + LDA .spawn_table, X ; look up the drop on the table + + ;most of this part below is copied from the digging game + + STA $7FFE00 + JSL Sprite_SpawnDynamically + + LDX.b #$00 + LDA $2F : CMP.b #$04 : BEQ + : INX : + + + LDA .x_speeds, X : STA $0D50, Y + + LDA.b #$00 : STA $0D40, Y + LDA.b #$18 : STA $0F80, Y + LDA.b #$FF : STA $0B58, Y + LDA.b #$30 : STA $0F10, Y + + LDA $22 : !ADD .x_offsets, X + AND.b #$F0 : STA $0D10, Y + LDA $23 : ADC.b #$00 : STA $0D30, Y + + LDA $20 : !ADD.b #$16 : AND.b #$F0 : STA $0D00, Y + LDA $21 : ADC.b #$00 : STA $0D20, Y + + LDA.b #$00 : STA $0F20, Y + TYX + + LDA.b #$30 : JSL Sound_SetSfx3PanLong + + .no_drop + PLB + PLP : PLY + .skip +RTL + +;DATA - Shovel Spawn Information +{ + +.x_speeds + db $F0 + db $10 + +.x_offsets + db $00 + db $13 + +.spawn_table + db $B2 ; Gold Bee + db $D8, $D8, $D8 ; Single Heart + db $D8, $D8, $D8, $D8, $D8 ; Single Heart + db $D9, $D9, $D9, $D9, $D9 ; Green Rupee + db $DA, $DA, $DA, $DA, $DA ; Blue Rupee + db $DB, $DB, $DB, $DB, $DB ; Red Rupee + db $DC, $DC, $DC, $DC, $DC ; 1 Bomb + db $DD, $DD, $DD, $DD, $DD ; 4 Bombs + db $DE, $DE, $DE, $DE, $DE ; 8 Bombs + db $DF, $DF, $DF, $DF, $DF ; Small Magic + db $E0, $E0, $E0, $E0, $E0 ; Large Magic + db $E1, $E1, $E1, $E1, $E1 ; 5 Arrows + db $E2, $E2, $E2, $E2, $E2 ; 10 Arrows + db $E3, $E3, $E3, $E3, $E3 ; Fairy + +} +;-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/itemdowngrade.asm b/itemdowngrade.asm new file mode 100644 index 00000000..86a8cbab --- /dev/null +++ b/itemdowngrade.asm @@ -0,0 +1,68 @@ +;================================================================================ +; Item Downgrade Fix +;-------------------------------------------------------------------------------- +ItemDowngradeFix: + JSL.l AddInventory + BMI .dontWrite ; thing we wrote over part 1 + + CPY.b #$1B : BEQ .isPowerGloves ; Power Gloves + CPY.b #$05 : BEQ .isRedShield ; Red Shield + CPY.b #$04 : BEQ .isBlueShield ; Blue Shield + CPY.b #$0C : BEQ .isBlueBoomerang ; Blue Boomerang + CPY.b #$0B : BEQ .isBow ; Bow + CPY.b #$3A : BEQ .isBowAndArrows ; Bow + + CPY.b #$49 : BEQ .isFightersSword ; Fighter's Sword + CPY.b #$01 : BEQ .isMasterSword ; Master Sword + CPY.b #$50 : BEQ .isMasterSword ; Master Sword (Safe) + CPY.b #$02 : BEQ .isTemperedSword ; Tempered Sword + + CPY.b #$3B : BEQ .isSilverArrowBow ; Silver Arrow Bow + CPY.b #$2A : BEQ .isRedBoomerang ; Red Boomerang + CPY.b #$0D : BEQ .isMagicPowder ; Magic Powder + CPY.b #$14 : BEQ .isFlute ; Flute + CPY.b #$13 : BEQ .isShovel ; Shovel + CPY.b #$29 : BEQ .isMushroom ; Mushroom + + .done + STA [$00] ; thing we wrote over part 2 + .dontWrite +RTL + .isPowerGloves + .isBlueShield + .isRedShield + .isBlueBoomerang + .isBow + .isBowAndArrows + CMP [$00] : !BGE .done ; finished if we're upgrading + LDA [$00] ; reload old value +RTL + .isSilverArrowBow + .isRedBoomerang + .isMagicPowder + .isFlute + .isShovel + .isMushroom + PHA + LDA [$00] : BNE + ; don't upgrade if we already have the toggle for it + PLA + STA [$00] + RTL + + + PLA +RTL + .isFightersSword + .isMasterSword + .isTemperedSword + PHA + TYA ; load sword item + CMP.b #$49 : BNE + : LDA.b #$00 : + ; convert extra fighter's sword to normal one + CMP.b #$50 : BNE + : LDA.b #$01 : + ; convert extra master sword to normal one + INC : CMP !HIGHEST_SWORD_LEVEL : !BGE + ; skip if highest is lower (this is an upgrade) + LDA !HIGHEST_SWORD_LEVEL : DEC ; convert to item id + TAY : PLA : LDA !HIGHEST_SWORD_LEVEL ; put sword id into the thing to write + BRL .done + + + PLA +BRL .done +;================================================================================ \ No newline at end of file diff --git a/lampmantlecone.asm b/lampmantlecone.asm new file mode 100644 index 00000000..7437bece --- /dev/null +++ b/lampmantlecone.asm @@ -0,0 +1,33 @@ +;================================================================================ +; Lamp Mantle & Light Cone Fix +;-------------------------------------------------------------------------------- +; Output: 0 for darkness, 1 for lamp cone +;-------------------------------------------------------------------------------- +LampCheck: + LDA $7EF34A : BNE .done ; skip if we already have lantern + + LDA $7EF3CA : BNE + + .lightWorld + LDA $040C : BNE ++ ; check if we're in sewers + LDA LampConeSewers : BRA .done + ++ + LDA LampConeLightWorld : BRA .done + + + .darkWorld + LDA LampConeDarkWorld + .done + ;BNE + : STZ $1D : + ; remember to turn cone off after a torch +RTL +;================================================================================ +;-------------------------------------------------------------------------------- +; Output: 0 locked, 1 open +;-------------------------------------------------------------------------------- +CheckForZelda: + LDA.l OpenMode : BEQ + ; Skip if not open mode + LDA.b #$01 ; open mode, pretend we have zelda anyway + RTL + + + LDA $7EF3CC +RTL +;================================================================================ +;LDA $7EF3CA : EOR #$40 : LSR #6 : AND #$01 ; return the same result as having the lantern in the light world \ No newline at end of file diff --git a/license.txt b/license.txt new file mode 100644 index 00000000..3b52e96e --- /dev/null +++ b/license.txt @@ -0,0 +1,7 @@ +Copyright 2016, 2017 ALT Computer Solutions + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/maidencrystals.asm b/maidencrystals.asm new file mode 100644 index 00000000..bae163a0 --- /dev/null +++ b/maidencrystals.asm @@ -0,0 +1,24 @@ +;================================================================================ +; Maiden Crystal Fixes +;================================================================================ + +;-------------------------------------------------------------------------------- +; MaidenCrystalScript +;-------------------------------------------------------------------------------- +MaidenCrystalScript: + STZ $02D8 + STZ $02DA + STZ $2E + LDA #$02 : STA $2F + + ; Load the dungeon index. Is it the Dark Palace? + ;LDA $040C : !SUB.b #$0A : TAY : CPY.b #$02 : BNE + + ; LDA $7EF3C7 : CMP.b #$07 : BCS ++ : LDA.b #$07 : STA $7EF3C7 : ++ + ;+ + + LDA $7EF37A : AND.b #$7F : CMP.b #$7F : BNE + ; check if we have all crystals + LDA.b #$08 : STA $7EF3C7 ; Update the map icon to just be Ganon's Tower + + + +JMP $1ECF35 ; <- F4F35 - sprite_crystal_maiden.asm : 426 +;-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/map.asm b/map.asm new file mode 100644 index 00000000..1dfb6419 --- /dev/null +++ b/map.asm @@ -0,0 +1,16 @@ +; ============================================================================== +PrepMapZoom: + LDA.b #$80 : STA $211A ; thing we wrote over + + LDA.b #$00 : STA !MAP_ZOOM +RTL +; ============================================================================== +ForceMapZoom: + LDA !MAP_ZOOM : BNE .isPreset + LDA.b #$01 + LDA.b #$01 : STA !MAP_ZOOM +RTL + .isPreset + LDA $F6 : AND.b #$70 +RTL +; ============================================================================== \ No newline at end of file diff --git a/medallions.asm b/medallions.asm new file mode 100644 index 00000000..f25b35dd --- /dev/null +++ b/medallions.asm @@ -0,0 +1,74 @@ +;================================================================================ +; Medallion Changes & Fixes +;-------------------------------------------------------------------------------- +TryOpenMire: + ; Checks if we're in the Swamp of Evil. + LDA $8A : CMP.b #$70 : BNE .untriggered + + ; Checks whether the Misery Mire dungeon is already revealed. + LDA $7EF2F0 : AND.b #$20 : BNE .untriggered + + ; You have to be in the trigger window. + LDY.b #$02 : JSL.l Ancilla_CheckIfEntranceTriggered : BCC .untriggered + + ; Do the 3rd animation for opening entrances + LDA.b #$03 : STA $04C6 + + STZ $B0 ; reset the sub-submodule index + STZ $C8 ; reset this other index. + + .untriggered +RTL +;-------------------------------------------------------------------------------- +TryOpenTRock: + ; Checks if we're at Turtle Rock. + LDA $8A : CMP.b #$47 : BNE .untriggered + + ; Checks whether the Turtle Rock dungeon is already revealed. + LDA $7EF2C7 : AND.b #$20 : BNE .untriggered + + ; You have to be in the trigger window. + LDY.b #$03 : JSL.l Ancilla_CheckIfEntranceTriggered : BCC .untriggered + + ; Do the 4rd animation for opening entrances + LDA.b #$04 : STA $04C6 + + STZ $B0 ; reset the sub-submodule index + STZ $C8 ; reset this other index. + + .untriggered +RTL +;-------------------------------------------------------------------------------- +MedallionTrigger_Bombos: + STZ $50 ; stuff we wrote over + STZ $0FC1 + + PHA + LDA.l MireRequiredMedallion : BNE + + JSL.l TryOpenMire + + LDA.l TRockRequiredMedallion : BNE + + JSL.l TryOpenTRock + + + PLA +RTL +;-------------------------------------------------------------------------------- +MedallionTrigger_Ether: + PHA + LDA.l MireRequiredMedallion : CMP #$01 : BNE + + JSL.l TryOpenMire + + LDA.l TRockRequiredMedallion : CMP #$01 : BNE + + JSL.l TryOpenTRock + + + PLA +RTL +;-------------------------------------------------------------------------------- +MedallionTrigger_Quake: + PHA + LDA.l MireRequiredMedallion : CMP #$02 : BNE + + JSL.l TryOpenMire + + LDA.l TRockRequiredMedallion : CMP #$02 : BNE + + JSL.l TryOpenTRock + + + PLA +RTL +;-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/newitems.asm b/newitems.asm new file mode 100755 index 00000000..4fa56864 --- /dev/null +++ b/newitems.asm @@ -0,0 +1,732 @@ +;================================================================================ +; New Item Handlers +;-------------------------------------------------------------------------------- +; REMEMBER TO UPDATE THE TABLES IN UTILITIES.ASM! +;-------------------------------------------------------------------------------- +; #$4C - Bomb Capacity (50) +; #$4D - Arrow Capacity (70) +; #$4E - 1/2 Magic +; #$4F - 1/4 Magic +; #$50 - Safe Master Sword +; #$51 - Bomb Capacity (+5) +; #$52 - Bomb Capacity (+10) +; #$53 - Arrow Capacity (+5) +; #$54 - Arrow Capacity (+10) +; #$55 - Programmable Item 1 +; #$56 - Programmable Item 2 +; #$57 - Programmable Item 3 +; #$58 - Upgrade-Only Silver Arrows +; #$59 - Rupoor +; #$5A - Null Item +; #$5B - Red Clock +; #$5C - Blue Clock +; #$5D - Green Clock +; #$5E - Progressive Sword +; #$5F - Progressive Shield +; #$60 - Progressive Armor +; #$61 - Progressive Lifting Glove +; #$62 - RNG Pool Item (Single) +; #$63 - RNG Pool Item (Multi) +; #$6A - Goal Item (Single/Triforce) +; #$6B - Goal Item (Multi/Power Star) +; #$70 - Maps +; #$80 - Compasses +; #$90 - Big Keys +; #$A0 - Small Keys +;-------------------------------------------------------------------------------- +;GetAnimatedSpriteGfxFile: +; LDY.b #$32 +; CMP.b #$39 : BCS + ; If tile index >= 0x39, use sprite file 0x32 (Blank file) +; +; LDY.b #$5D +; +; CMP.b #$23 : BEQ + ; If tile index is 0x23 (Pendant)... +; CMP.b #$37 : BCS + ; ...or tile index >= 0x37, use sprite file 0x5D (Pendant, Boots, 20 Rupees) +; +; LDY.b #$5C +; +; CMP.b #$0C : BEQ + ; If tile index is 0x0C (Flute)... +; CMP.b #$24 : BCS + ; ...or tile index >= 24, use sprite file 0x5C (Rupees, Crystal, Heart Piece ... ...) +; +; ; Otherwise, use sprite file 0x5B (Medallions, Mirror, Flippers, Lantern, Compass...) +; LDY.b #$5B +;+ +;JML GetAnimatedSpriteGfxFile_return +;-------------------------------------------------------------------------------- +GetAnimatedSpriteGfxFile: + CMP.b #$0C : BNE + + LDY.b #$5C : JML GetAnimatedSpriteGfxFile_return + + + CMP.b #$23 : BNE + + LDY.b #$5D : JML GetAnimatedSpriteGfxFile_return + + + CMP.b #$48 : BNE + + LDY.b #$60 : JML GetAnimatedSpriteGfxFile_return + + + + CMP.b #$24 : !BGE + + LDY.b #$5B : JML GetAnimatedSpriteGfxFile_return + + + CMP.b #$37 : !BGE + + LDY.b #$5C : JML GetAnimatedSpriteGfxFile_return + + + CMP.b #$39 : !BGE + + LDY.b #$5D : JML GetAnimatedSpriteGfxFile_return + + + LDY.b #$32 +JML GetAnimatedSpriteGfxFile_return +;-------------------------------------------------------------------------------- +GetAnimatedSpriteBufferPointer_table: +; Original data: +dw $09C0, $0030, $0060, $0090, $00C0, $0300, $0318, $0330 +dw $0348, $0360, $0378, $0390, $0930, $03F0, $0420, $0450 + +dw $0468, $0600, $0630, $0660, $0690, $06C0, $06F0, $0720 ; disassembly (incorrectly?) says this is $0270 +dw $0750, $0768, $0900, $0930, $0960, $0990, $09F0, $0000 + +dw $00F0, $0A20, $0A50, $0660, $0600, $0618, $0630, $0648 +dw $0678, $06D8, $06A8, $0708, $0738, $0768, $0960, $0900 + +dw $03C0, $0990, $09A8, $09C0, $09D8, $0A08, $0A38, $0600 +dw $0630 +; New data: +dw $0600, $0630, $0660, $0690 ; 50 Bombs / 70 Arrows / Half Magic / Quarter Magic +dw $06C0, $06F0, $0720 ; +5/+10 Bomb Arrows + +;#$4x +dw $0750 ; +10 Arrows +dw $0900 ; Upgrade-Only Silver Arrows +dw $09D8 ; Unused +dw $0930, $0960, $0990, $09C0 ; Lvl 1/2/3/4 Sword (Freestanding) +dw $09F0 ; Null-Item +dw $09C0 ; Clock +dw $0A20 ; Triforce +dw $0A50 ; Power Star + +GetAnimatedSpriteBufferPointer: + ;PHB : PHK : PLB + LDA.b $00 : ADC.l GetAnimatedSpriteBufferPointer_table, X + ;PLB +RTL +;-------------------------------------------------------------------------------- +macro ProgrammableItemLogic(index) + LDA.l ProgrammableItemLogicPointer_ : BNE ?jump + LDA.l ProgrammableItemLogicPointer_+1 : BNE ?jump + LDA.l ProgrammableItemLogicPointer_+2 : BNE ?jump + BRA ?end + ?jump: + JSL.l ProgrammableItemLogicJump_ + ?end: +endmacro + +macro ValueShift() + TAX : LDA.b #$01 + ?start: + CPX #$00 : BEQ ?end + ASL + DEX + BRA ?start : ?end: +endmacro +;-------------------------------------------------------------------------------- +!CHALLENGE_TIMER = "$7EF454" +!GOAL_COUNTER = "$7EF460" +AddReceivedItemExpandedGetItem: + ;STA $FFFFFF + PHX + LDA $02D8 ; check inventory + CMP.b #$4C : BNE + ; 50 bombs + ;LDA.b #$07 : STA $7EF370 ; upgrade bombs + LDA.b #50 : !SUB.l StartingMaxBombs : STA $7EF370 ; upgrade bombs + LDA.b #50 : STA $7EF375 ; fill bombs + BRL .done + + CMP.b #$4D : BNE + ; 70 arrows + ;LDA #$07 : STA $7EF371 ; upgrade arrows + LDA.b #70 : !SUB.l StartingMaxArrows : STA $7EF371 ; upgrade arrows + LDA.b #70 : STA $7EF376 ; fill arrows + BRL .done + + CMP.b #$4E : BNE + ; 1/2 magic + LDA $7EF37B : CMP #$02 : !BGE ++ + INC : STA $7EF37B ; upgrade magic + ++ + LDA.b #$80 : STA $7EF373 ; fill magic + BRL .done + + CMP.b #$4F : BNE + ; 1/4 magic + LDA.b #$02 : STA $7EF37B ; upgrade magic + LDA.b #$80 : STA $7EF373 ; fill magic + BRL .done + + CMP.b #$50 : BNE + ; Master Sword (Safe) + LDA $7EF359 : CMP.b #$02 : !BGE + ; skip if we have a better sword + LDA.b #$02 : STA $7EF359 ; set master sword + BRL .done + + CMP.b #$51 : BNE + ; +5 Bombs + LDA $7EF370 : !ADD.b #$05 : STA $7EF370 ; upgrade bombs +5 + LDA.l Upgrade5BombsRefill : STA $7EF375 ; fill bombs + BRL .done + + CMP.b #$52 : BNE + ; +10 Bombs + LDA $7EF370 : !ADD.b #$0A : STA $7EF370 ; upgrade bombs +10 + LDA.l Upgrade10BombsRefill : STA $7EF375 ; fill bombs + BRL .done + + CMP.b #$53 : BNE + ; +5 Arrows + LDA $7EF371 : !ADD.b #$05 : STA $7EF371 ; upgrade arrows +5 + LDA.l Upgrade5ArrowsRefill : STA $7EF376 ; fill arrows + BRL .done + + CMP.b #$54 : BNE + ; +10 Arrows + LDA $7EF371 : !ADD.b #$0A : STA $7EF371 ; upgrade arrows +10 + LDA.l Upgrade10ArrowsRefill : STA $7EF376 ; fill arrows + BRL .done + + CMP.b #$55 : BNE + ; Programmable Object 1 + %ProgrammableItemLogic(1) + BRL .done + + CMP.b #$56 : BNE + ; Programmable Object 2 + %ProgrammableItemLogic(2) + BRL .done + + CMP.b #$57 : BNE + ; Programmable Object 3 + %ProgrammableItemLogic(3) + BRL .done + + CMP.b #$58 : BNE + ; Upgrade-Only Sivler Arrows + + CMP.b #$59 : BNE + ; 1 Rupoor + REP #$20 : LDA $7EF360 : !SUB RupoorDeduction : STA $7EF360 : SEP #$20 ; Take 1 rupee + BRL .done + + CMP.b #$5A : BNE + ; Null Item + BRL .done + + CMP.b #$5B : BNE + ; Red Clock + REP #$20 ; set 16-bit accumulator + LDA !CHALLENGE_TIMER : !ADD.l RedClockAmount : STA !CHALLENGE_TIMER + LDA !CHALLENGE_TIMER+2 : ADC.l RedClockAmount+2 : STA !CHALLENGE_TIMER+2 + SEP #$20 ; set 8-bit accumulator + BRL .done + + CMP.b #$5C : BNE + ; Blue Clock + REP #$20 ; set 16-bit accumulator + LDA !CHALLENGE_TIMER : !ADD.l BlueClockAmount : STA !CHALLENGE_TIMER + LDA !CHALLENGE_TIMER+2 : ADC.l BlueClockAmount+2 : STA !CHALLENGE_TIMER+2 + SEP #$20 ; set 8-bit accumulator + BRL .done + + CMP.b #$5D : BNE + ; Green Clock + REP #$20 ; set 16-bit accumulator + LDA !CHALLENGE_TIMER : !ADD.l GreenClockAmount : STA !CHALLENGE_TIMER + LDA !CHALLENGE_TIMER+2 : ADC.l GreenClockAmount+2 : STA !CHALLENGE_TIMER+2 + SEP #$20 ; set 8-bit accumulator + BRL .done + + CMP.b #$5E : BNE + ; Progressive Sword + BRL .done + + CMP.b #$5F : BNE + ; Progressive Shield + BRL .done + + CMP.b #$60 : BNE + ; Progressive Armor + BRL .done + + CMP.b #$61 : BNE + ; Progressive Lifting Glove + BRL .done + + CMP.b #$62 : BNE + ; RNG Pool Item (Single) + BRL .done + + CMP.b #$63 : BNE + ; RNG Pool Item (Multi) + BRL .done + + CMP.b #$6A : BNE + ; Goal Collectable (Single/Triforce) + JSL.l StatsFinalPrep + BRL .done + + CMP.b #$6B : BNE + ; Goal Collectable (Multi/Power Star) + BRA .multi_collect + + CMP.b #$6C : BNE + ; Goal Collectable (Multi/Power Star) Alternate Graphic + .multi_collect + LDA GoalItemRequirement : BEQ ++ + LDA !GOAL_COUNTER : INC : STA !GOAL_COUNTER + CMP GoalItemRequirement : !BLT ++ : JSL.l StatsFinalPrep : ++ + BRL .done + + CMP.b #$70 : !BLT + : CMP.b #$80 : !BGE + ; Free Map + AND #$0F : CMP #$08 : !BGE ++ + %ValueShift() + ORA $73F368 : STA $7EF368 ; Map 1 + ++ + !SUB #$08 + %ValueShift() + ORA $73F369 : STA $7EF369 ; Map 2 + BRL .done + + CMP.b #$80 : !BLT + : CMP.b #$90 : !BGE + ; Free Compass + AND #$0F : CMP #$08 : !BGE ++ + %ValueShift() + ORA $73F364 : STA $7EF364 ; Compass 1 + ++ + !SUB #$08 + %ValueShift() + ORA $73F365 : STA $7EF365 ; Compass 2 + BRL .done + + CMP.b #$90 : !BLT + : CMP.b #$A0 : !BGE + ; Free Big Key + AND #$0F : CMP #$08 : !BGE ++ + %ValueShift() + ORA $73F366 : STA $7EF366 ; Big Key 1 + ++ + !SUB #$08 + %ValueShift() + ORA $73F367 : STA $7EF367 ; Big Key 2 + BRL .done + + CMP.b #$A0 : !BLT + : CMP.b #$B0 : !BGE + ; Free Small Key + AND #$0F : TAX + LDA $7EF37C, X : INC : STA $7EF37C, X ; Increment Key Count + BRL .done + + + .done + PLX + LDA $02E9 : CMP.b #$01 ; thing we wrote over +RTL +; #$70 - Maps +; #$80 - Compasses +; #$90 - Big Keys +;-------------------------------------------------------------------------------- +!PROGRESSIVE_SHIELD = "$7EF416" ; ss-- ---- +!RNG_ITEM = "$7EF450" +!SCRATCH_AREA = "$7F5020" +!SINGLE_INDEX_TEMP = "$7F5020" +!SINGLE_INDEX_OFFSET_TEMP = "$7F5021" +!SINGLE_INDEX_BITMASK_TEMP = "$7F5022" +!LOCK_IN = "$7F5090" +!ITEM_BUSY = "$7F5091" +AddReceivedItemExpanded: +{ + PHA : PHX + JSL.l PreItemGet + + LDA $02D8 : CMP #$5E : BNE ++ ; Progressive Sword + LDA $7EF359 : BNE + ; No Sword + LDA.b #$49 : STA $02D8 : BRL .done + + : CMP.b #$01 : BNE + ; Fighter Sword + LDA.b #$50 : STA $02D8 : BRL .done + + : CMP.b #$02 : BNE + ; Master Sword + LDA.b #$02 : STA $02D8 : BRL .done + + ; Everything Else + LDA.b #$03 : STA $02D8 : BRL .done + ++ : CMP.b #$5F : BNE ++ ; Progressive Shield + LDA !PROGRESSIVE_SHIELD : AND.b #$C0 : BNE + ; No Shield + LDA.b #$04 : STA $02D8 + LDA !PROGRESSIVE_SHIELD : AND.b #$3F : ORA.b #$40 : STA !PROGRESSIVE_SHIELD : BRA .done + + : CMP.b #$40 : BNE + ; Fighter Shield + LDA.b #$05 : STA $02D8 + LDA !PROGRESSIVE_SHIELD : AND.b #$3F : ORA.b #$80 : STA !PROGRESSIVE_SHIELD : BRA .done + + ; Everything Else + LDA.b #$06 : STA $02D8 : BRA .done + ++ : CMP.b #$60 : BNE ++ ; Progressive Armor + LDA $7EF35B : BNE + ; No Shield + LDA.b #$22 : STA $02D8 : BRA .done + + ; Everything Else + LDA.b #$23 : STA $02D8 : BRA .done + ++ : CMP.b #$61 : BNE ++ ; Progressive Lifting Glove + LDA $7EF354 : BNE + ; No Lift + LDA.b #$1B : STA $02D8 : BRA .done + + ; Everything Else + LDA.b #$1C : STA $02D8 : BRA .done + ++ : CMP.b #$62 : BNE ++ ; RNG Item (Single) + JSL.l GetRNGItemSingle : STA $02D8 + XBA : JSR.w MarkRNGItemSingle + LDA #$FF : STA !LOCK_IN ; clear lock-in + BRA .done + ++ : CMP.b #$63 : BNE ++ ; RNG Item (Multi) + JSL.l GetRNGItemMulti : STA $02D8 + LDA #$FF : STA !LOCK_IN ; clear lock-in + BRA .done + ++ + .done + PLX : PLA + + PHB : PHK ; we're skipping the corresponding instructions to grab the data bank + JMP.l AddReceivedItem+2 +} +;-------------------------------------------------------------------------------- +;DATA AddReceivedItemExpanded +{ + +.y_offsets + db -5, -5, -5, -5, -5, -4, -4, -5 + db -5, -4, -4, -4, -2, -4, -4, -4 + + db -4, -4, -4, -4, -4, -4, -4, -4 + db -4, -4, -4, -4, -4, -4, -4, -4 + + db -4, -4, -4, -5, -4, -4, -4, -4 + db -4, -4, -2, -4, -4, -4, -4, -4 + + db -4, -4, -4, -4, -2, -2, -2, -4 + db -4, -4, -4, -4, -4, -4, -4, -4 + + db -4, -4, -2, -2, -4, -2, -4, -4 + db -4, -5, -4, -4 + ;new + db -4, -4, -4, -4 + db -5 ; Master Sword (Safe) + db -4, -4, -4, -4 ; +5/+10 Bomb Arrows + db -4, -4, -4 ; 3x Programmable Item + db -4 ; Upgrade-Only Sivler Arrows + db -4 ; 1 Rupoor + db -4 ; Null Item + db -4, -4, -4 ; Red, Blue & Green Clocks + db -4, -4, -4, -4 ; Progressive Sword, Shield, Armor & Gloves + db -4, -4 ; RNG Single & Multi + db -4, -4, -4, -4, -4, -4 ; Unused + db -4, -4, -4 ; Goal Item Single, Multi & Alt Multi + db -4, -4, -4 ; Unused + db -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4 ; Free Map + 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 + +.x_offsets + db 4, 4, 4, 4, 4, 0, 0, 4 + db 4, 4, 4, 4, 5, 0, 0, 0 + + db 0, 0, 0, 4, 0, 4, 0, 0 + db 4, 0, 0, 0, 0, 0, 0, 0 + + db 0, 0, 0, 0, 4, 0, 0, 0 + db 0, 0, 5, 0, 0, 0, 0, 0 + + db 0, 0, 0, 0, 4, 4, 4, 0 + db 0, 0, 0, 0, 0, 0, 0, 0 + + db 0, 0, 4, 4, 0, 4, 0, 0 + db 0, 4, 0, 0 + ;new + db 0, 0, 0, 0 + db 4 ; Master Sword (Safe) + db 0, 0, 0, 0 ; +5/+10 Bomb Arrows + db 0, 0, 0 ; 3x Programmable Item + db 0 ; Upgrade-Only Sivler Arrows + db 4 ; 1 Rupoor + db 0 ; Null Item + db 0, 0, 0 ; Red, Blue & Green Clocks + db 0, 0, 0, 0 ; Progressive Sword, Shield, Armor & Gloves + db 0, 0 ; RNG Single & Multi + db 0, 0, 0, 0, 0, 0 ; Unused + db 0, 0, 0 ; Goal Item Single, Multi & Alt Multi + db 0, 0, 0 ; Unused + db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ; Free Map + db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ; Free Compass + db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ; Free Big Key + db 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 ; Free Small Key + +.item_graphics_indices + db $06, $18, $18, $18, $2D, $20, $2E, $09 + db $09, $0A, $08, $05, $10, $0B, $2C, $1B + + db $1A, $1C, $14, $19, $0C, $07, $1D, $2F + db $07, $15, $12, $0D, $0D, $0E, $11, $17 + + db $28, $27, $04, $04, $0F, $16, $03, $13 + db $01, $1E, $10, $00, $00, $00, $00, $00 + + db $00, $30, $22, $21, $24, $24, $24, $23 + db $23, $23, $29, $2A, $2C, $2B, $03, $03 + + db $34, $35, $31, $33, $02, $32, $36, $37 + db $2C, $06, $0C, $38 + ;new + db $39, $3A, $3B, $3C + db $18 ; Master Sword (Safe) + db $3D, $3E, $3F, $40 ; +5/+10 Bomb Arrows + db $00, $00, $00 ; 3x Programmable Item + db $41 ; Upgrade-Only Sivler Arrows + db $24 ; 1 Rupoor + db $47 ; Null Item + db $48, $48, $48 ; Red, Blue & Green Clocks + db $FF, $FF, $04, $0D ; Progressive Sword, Shield, Armor & Gloves + db $FF, $FF ; RNG Single & Multi + db $FF, $FF, $FF, $FF, $FF, $FF ; Unused + db $49, $4A, $49 ; Goal Item Single, Multi & Alt Multi + db $FF, $FF, $FF ; Unused + db $21, $21, $21, $21, $21, $21, $21, $21, $21, $21, $21, $21, $21, $21, $21, $21 ; Free Map + db $16, $16, $16, $16, $16, $16, $16, $16, $16, $16, $16, $16, $16, $16, $16, $16 ; Free Compass + db $22, $22, $22, $22, $22, $22, $22, $22, $22, $22, $22, $22, $22, $22, $22, $22 ; Free Big Key + db $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F ; Free Small Key + +.wide_item_flag + db $00, $00, $00, $00, $00, $02, $02, $00 + db $00, $00, $00, $00, $00, $02, $02, $02 + + db $02, $02, $02, $00, $02, $00, $02, $02 + db $00, $02, $02, $02, $02, $02, $02, $02 + + db $02, $02, $02, $02, $00, $02, $02, $02 + db $02, $02, $00, $02, $02, $02, $02, $02 + + db $02, $02, $02, $02, $00, $00, $00, $02 + db $02, $02, $02, $02, $02, $02, $02, $02 + + db $02, $02, $00, $00, $02, $00, $02, $02 + db $02, $00, $02, $02 + ;new + db $02, $02, $02, $02 + db $00 ; Master Sword (Safe) + db $02, $02, $02, $02 ; +5/+10 Bomb Arrows + db $02, $02, $02 ; 3x Programmable Item + db $02 ; Upgrade-Only Sivler Arrows + db $00 ; 1 Rupoor + db $02 ; Null Item + db $02, $02, $02 ; Red, Blue & Green Clocks + db $02, $02, $02, $02 ; Progressive Sword, Shield, Armor & Gloves + db $02, $02 ; RNG Single & Multi + db $02, $02, $02, $02, $02, $02 ; Unused + db $02, $02, $02 ; Goal Item Single, Multi & Alt Multi + db $02, $02, $02 ; Unused + db $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02 ; Free Map + 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 + +.properties + db 5, -1, 5, 5, 5, 5, 5, 1 + db 2, 1, 1, 1, 2, 2, 2, 4 + db 4, 4, 1, 1, 2, 1, 1, 1 + db 2, 1, 2, 1, 4, 4, 2, 1 + db 6, 1, 2, 1, 2, 2, 1, 2 + db 2, 4, 1, 1, 4, 2, 1, 4 + db 2, 2, 4, 4, 4, 2, 1, 4 + db 1, 2, 2, 1, 2, 2, 1, 1 + db 4, 4, 1, 2, 2, 4, 4, 4 + db 2, 5, 2, 1 + ;new + db 4, 4, 4, 4 + db 5 ; Master Sword (Safe) + db 4, 4, 4, 4 ; +5/+10 Bomb Arrows + db 4, 4, 4 ; 3x Programmable Item + db 1 ; Upgrade-Only Sivler Arrows + db 3 ; 1 Rupoor + db 1 ; Null Item + db 1, 2, 4 ; Red, Blue & Green Clocks + db $FF, $FF, $FF, $FF ; Progressive Sword, Shield, Armor & Gloves + db $FF, $FF ; RNG Single & Multi + db 0, 0, 0, 0, 0, 0 ; Unused + db 4, 4, 4 ; Goal Item Single, Multi & Alt Multi + db 0, 0, 0 ; Unused + db 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 ; Free Map + 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 + +; \item Target SRAM addresses for items you receive +.item_target_addr + dw $F359, $F359, $F359, $F359, $F35A, $F35A, $F35A, $F345 + dw $F346, $F34B, $F342, $F340, $F341, $F344, $F35C, $F347 + + dw $F348, $F349, $F34A, $F34C, $F34C, $F350, $F35C, $F36B + dw $F351, $F352, $F353, $F354, $F354, $F34E, $F356, $F357 + + dw $F37A, $F34D, $F35B, $F35B, $F36F, $F364, $F36C, $F375 + dw $F375, $F344, $F341, $F35C, $F35C, $F35C, $F36D, $F36E + + dw $F36E, $F375, $F366, $F368, $F360, $F360, $F360, $F374 + dw $F374, $F374, $F340, $F340, $F35C, $F35C, $F36C, $F36C + + dw $F360, $F360, $F372, $F376, $F376, $F373, $F360, $F360 + dw $F35C, $F359, $F34C, $F355 + ;new + dw $F375, $F376, $F373, $F373 + dw $F359 ; Master Sword (Safe) + dw $F375, $F375, $F376, $F376 ; +5/+10 Bomb Arrows + dw $F41A, $F41C, $F41E ; 3x Programmable Item + dw $F340 ; Upgrade-Only Sivler Arrows + dw $F360 ; 1 Rupoor + dw $F36A ; Null Item + dw $F454, $F454, $F454 ; Red, Blue & Green Clocks + dw $F359, $F35A, $F35B, $F354 ; Progressive Sword, Shield, Armor & Gloves + dw $F36A, $F36A ; RNG Single & Multi + dw $F36A, $F36A, $F36A, $F36A, $F36A, $F36A ; Unused + dw $F36A, $F36A, $F36A ; Goal Item Single, Multi & Alt Multi + dw $F36A, $F36A, $F36A ; Unused + dw $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A ; Free Map + 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 +} + +; DATA Values to write to the above SRAM locations. +{ +.item_values + db $01, $02, $03, $04, $01, $02, $03, $01 + db $01, $01, $01, $01, $01, $02, $FF, $01 + + db $01, $01, $01, $01, $02, $01, $FF, $FF + db $01, $01, $02, $01, $02, $01, $01, $01 + + db $FF, $01, $FF, $02, $FF, $FF, $FF, $FF + db $FF, $FF, $02, $FF, $FF, $FF, $FF, $FF + + db $FF, $FF, $FF, $FF, $FF, $FB, $EC, $FF + db $FF, $FF, $01, $03, $FF, $FF, $FF, $FF + + db $9C, $CE, $FF, $01, $0A, $FF, $FF, $FF + db $FF, $01, $03, $01 + ;new + db $32, $46, $80, $80 + db $02 ; Master Sword (Safe) + db $FF, $FF, $FF, $FF ; +5/+10 Bomb Arrows + db $FF, $FF, $FF ; 3x Programmable Item + db $FF ; Upgrade-Only Sivler Arrows + db $FF ; 1 Rupoor + db $FF ; Null Item + db $FF, $FF, $FF ; Red, Blue & Green Clocks + db $FF, $FF, $FF, $FF ; Progressive Sword, Shield, Armor & Gloves + db $FF, $FF ; RNG Single & Multi + db $FF, $FF, $FF, $FF, $FF, $FF ; Unused + db $FF, $FF, $FF ; Goal Item Single, Multi & Alt Multi + db $FF, $FF, $FF ; Unused + db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; Free Map + 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 + + ;0x00 - Sewer Passage + ;0x02 - Hyrule Castle + ;0x04 - Eastern Palace + ;0x06 - Desert Palace + ;0x08 - Hyrule Castle 2 + ;0x0A - Swamp Palace + ;0x0C - Dark Palace + ;0x0E - Misery Mire + ;0x10 - Skull Woods + ;0x12 - Ice Palace + ;0x14 - Tower of Hera + ;0x16 - Gargoyle's Domain + ;0x18 - Turtle Rock + ;0x1A - Ganon's Tower + +.item_masks ; these are dungeon correlations to $7EF364 - $7EF369 so it knows where to store compasses, etc + dw $8000, $4000, $2000, $1000, $0800, $0400, $0200, $0100 + dw $0080, $0040, $0020, $0010, $0008, $0004 +} +;-------------------------------------------------------------------------------- +BottleListExpanded: + db $16, $2B, $2C, $2D, $3D, $3C, $48 + +PotionListExpanded: + db $2E, $2F, $30, $FF, $0E +;-------------------------------------------------------------------------------- +Link_ReceiveItemAlternatesExpanded: +{ + db -1, -1, -1, -1, -1, -1, -1, -1 + db -1, -1, -1, -1, -1, -1, -1, -1 ; db -1, -1, -1, -1, $44, -1, -1, -1 + + db -1, -1, $35, -1, -1, -1, -1, -1 + db -1, -1, -1, -1, -1, -1, -1, -1 + + db -1, -1, -1, -1, -1, -1, -1, -1 + db -1, -1, -1, -1, -1, -1, -1, -1 ; db -1, -1, $46, -1, -1, -1, -1, -1 + + db -1, -1, -1, -1, -1, -1, -1, -1 + db -1, -1, -1, -1, -1, -1, -1, -1 + + db -1, -1, -1, -1, -1, -1, -1, -1 + db -1, -1, -1, -1 + + db -1, -1, -1, -1 + db -1 ; Master Sword (Safe) + db -1, -1, -1, -1 ; +5/+10 Bomb Arrows + db -1, -1, -1 ; 3x Programmable Item + db -1 ; Upgrade-Only Sivler Arrows + db -1 ; 1 Rupoor + db -1 ; Null Item + db -1, -1, -1 ; Red, Blue & Green Clocks + db -1, -1, -1, -1 ; Progressive Sword, Shield, Armor & Gloves + db -1, -1 ; RNG Single & Multi + db -1, -1, -1, -1, -1, -1 ; Unused + db -1, -1 ; Goal Item Single, Multi & Alt Multi + db -1, -1, -1, -1 ; Unused + db -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ; Free Map + 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 +} +;-------------------------------------------------------------------------------- +.loadAlternate + PHB : PHK : PLB + LDA Link_ReceiveItemAlternatesExpanded, Y : STA $03 + PLB +RTL +;-------------------------------------------------------------------------------- +DrawHUDSilverArrows: + LDA $7EF340 : AND.w #$00FF : BNE + + LDA $7EF414 : 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 #$11CE : STA $00 ; thing we wrote over +RTL +;-------------------------------------------------------------------------------- +!RNG_ITEM = "$7EF450" +!SCRATCH_AREA = "$7F5020" +!SINGLE_INDEX_TEMP = "$7F5020" +!SINGLE_INDEX_OFFSET_TEMP = "$7F5021" +!SINGLE_INDEX_BITMASK_TEMP = "$7F5022" +!LOCK_IN = "$7F5090" +GetRNGItemSingle: + LDA !LOCK_IN : CMP #$FF : BEQ + : TAX : XBA : LDA.l RNGSingleItemTable, X : RTL : + + LDX.b #$00 + .single_reroll + JSL.l GetRandomInt : AND.b #$7F ; select random value + INX : CPX #$7F : !BLT + : LDA.b #$00 : BRA +++ : + ; default to 0 if too many attempts + CMP.l RNGSingleTableSize : !BGE .single_reroll + +++ + + STA !SINGLE_INDEX_TEMP ; put our index value here + LDX #$00 + .recheck + JSR.w CheckSingleItem : BEQ .single_unused ; already used + LDA !SINGLE_INDEX_TEMP : INC ; increment index + CMP.l RNGSingleTableSize : !BLT +++ : LDA.b #$00 : +++ ; rollover index if needed + STA !SINGLE_INDEX_TEMP ; store index + INX : CPX.l RNGSingleTableSize : !BLT .recheck + LDA.b #$5A ; everything is gone, default to null item + BRA .single_done + .single_unused + LDA !SINGLE_INDEX_TEMP + .single_done + TAX : LDA.l RNGSingleItemTable, X + XBA : LDA.l !SINGLE_INDEX_TEMP : STA !LOCK_IN : XBA +RTL +;-------------------------------------------------------------------------------- +CheckSingleItem: + LSR #3 : TAX + LDA.l !RNG_ITEM, X : STA !SINGLE_INDEX_BITMASK_TEMP ; load value to temporary + PHX + LDA !SINGLE_INDEX_TEMP : AND #$07 : TAX ; load 0-7 part into X + LDA !SINGLE_INDEX_BITMASK_TEMP + --- + CPX.b #$00 : BEQ +++ + LSR + DEX + BRA --- + +++ + PLX + AND.b #$01 +RTS +;-------------------------------------------------------------------------------- +MarkRNGItemSingle: + ;STA !SINGLE_INDEX_TEMP + + LSR #3 : STA !SINGLE_INDEX_OFFSET_TEMP : TAX + LDA.l !RNG_ITEM, X + STA.l !SINGLE_INDEX_BITMASK_TEMP + LDA.l !SINGLE_INDEX_TEMP : AND #$07 : TAX ; load 0-7 part into X + LDA.b #01 + --- + CPX.b #$00 : BEQ +++ + ASL + DEX + BRA --- + +++ + + PHA + LDA.l !SINGLE_INDEX_OFFSET_TEMP : TAX + PLA + ORA.l !SINGLE_INDEX_BITMASK_TEMP + STA.l !RNG_ITEM, X +RTS +;-------------------------------------------------------------------------------- +GetRNGItemMulti: + LDA !LOCK_IN : CMP #$FF : BEQ + : TAX : XBA : LDA.l RNGMultiItemTable, X : RTL : + + LDX.b #$00 + - ; reroll + JSL.l GetRandomInt : AND.b #$7F ; select random value + INX : CPX #$7F : !BLT + : LDA.b 00 : BRA .done : + ; default to 0 if too many attempts + CMP.l RNGMultiTableSize : !BGE - + .done + STA !LOCK_IN + TAX : XBA : LDA.l RNGMultiItemTable, X +RTL +;-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/newitems.gfx b/newitems.gfx new file mode 100755 index 0000000000000000000000000000000000000000..a1b42c151611b6b7aab138baab85b2d613af7f8c GIT binary patch literal 909 zcmWMlU5Fc16#nkaB$=++ne1+gZ8GG>Nw&6ibtmGkSu>qUGaxl+3OF(OoT`vy zat8Yx{C@V|MF;u;>zTwpI3Hec@)Hw)rvZ8mO2h!fWL{0e@C$YLPjc|*0e?~hKSPgY ztdcTD<5ZHt!!!*eLnYo`-c8Jg=;yc4*(v-pwO-gtiqDD-aX#xFcEyt*P|Q~wj&p(l zt2GR)P4rcT?8;yzW6sLD1gFk_&T;47I_GV3m^*=xp9ALF@3X=$XgC6n zAbkjgq;l|VL~R7{nHH=;zPg;qu4p_l$v6%YLk5*fsmAo~8{4l0zTcBa#%H^qh?-xk zGv(V&KALG5yY_ao-R7gzbO(EZe{UKVfyDzc6+9t4?@bEhuv)NsU`VUg>v>0nu^6I6 z;U7l+9amn>e!78_8t#@%@$?i14sJ=7UTe(RRV9$4E(Q!_qh41kf!uAKk zqh}CDt9E1R#>UHWCZtFOGvyYWns&T5H4%aSRuJ>B2j2%|7=>;TKUS0d`i|faYt9?PZg8{y7KM{#A>!N(e z`t~caqMM)smCWvaVSk79*kqiLStX8Mr@QvcH&4g!F;~Z`kSz+!gy_a(_G3(w8LMyk zumZ&QFzEMvKM3{)S!yNZXpT-QcCo1fruSt;wwoyW3w^C$^xs>si#o#t?}rFy>j?h` DF>?z; literal 0 HcmV?d00001 diff --git a/npcitems.asm b/npcitems.asm new file mode 100644 index 00000000..89db8456 --- /dev/null +++ b/npcitems.asm @@ -0,0 +1,172 @@ +;================================================================================ +; Randomize NPC Items +;-------------------------------------------------------------------------------- +; Old Man - Zora King - Sick Kid - Tree Kid - Sahasrala - Catfish - Rupee NPC +;=SET 1 +;OLD_MAN = "#$01" +;ZORA_KING = "#$02" +;SICK_KID = "#$04" +;TREE_KID = "#$08" +;SAHASRALA = "#$10" +;CATFISH = "#$20" +;UNUSED = "#$40" +;BOOK_MUDORA = "#$80" +;=SET 2 +;ETHER_TABLET = "#$01" +;BOMBOS_TABLET = "#$02" +;SMITH_SWORD = "#$04" +;FAIRY_SWORD = "#$08" +;MUSHROOM = "#$10" +;POWDER = "#$20" +;UNUSED = "#$40" +;MAGIC_BAT = "#$80" +;-------------------------------------------------------------------------------- +!NPC_FLAGS = "$7EF410" +!NPC_FLAGS_2 = "$7EF411" + +ItemCheck_FairySword: + LDA !NPC_FLAGS_2 : AND.b #$08 +RTL + +ItemCheck_SmithSword: + LDA !NPC_FLAGS_2 : AND.b #$04 +RTL + +ItemCheck_MagicBat: + LDA !NPC_FLAGS_2 : AND.b #$80 +RTL + +ItemCheck_OldMan: + LDA !NPC_FLAGS : AND.b #$01 : CMP #$01 +RTL + +ItemCheck_ZoraKing: + LDA !NPC_FLAGS : AND.b #$02 +RTL + +ItemCheck_SickKid: + LDA !NPC_FLAGS : AND.b #$04 +RTL + +ItemCheck_TreeKid: + LDA !NPC_FLAGS : AND.b #$08 ; FluteBoy_Chillin - 73: LDA $7EF34C +RTL + +ItemCheck_TreeKid2: + LDA !NPC_FLAGS : AND.b #$08 : LSR #$02 ; FluteAardvark_InitialStateFromFluteState - 225: LDA $7EF34C : AND.b #$03 +RTL + +ItemCheck_TreeKid3: + JSL $0DD030 ; FluteAardvark_Draw - thing we wrote over + LDA !NPC_FLAGS : AND.b #$08 + BEQ .normal + BRA .done + LDA.b #$05 + .normal + LDA $0D80, X + .done +RTL + +ItemCheck_Sahasrala: + LDA !NPC_FLAGS : AND.b #$10 +RTL + +ItemCheck_Library: + LDA !NPC_FLAGS : AND.b #$80 +RTL + +ItemCheck_Mushroom: + LDA !NPC_FLAGS_2 : ROL #4 ; does the same thing as below +; LDA !NPC_FLAGS_2 : AND.b #$10 : BEQ .clear +; SEC +;RTL +; .clear +; CLC +RTL + +ItemCheck_Powder: + LDA !NPC_FLAGS_2 : AND.b #$20 +RTL + +ItemCheck_Catfish: + ;LDA CatfishGoodItem : BEQ .junk + ;PHX + ; LDA CatfishGoodItem+1 : TAX + ; LDA $7EF340-1, X + ;PLX + ;-- + ;CMP CatfishGoodItem : !BLT .oursNewer + ;.theirsNewer + ;LDA #$20 : RTL ; don't give item + ;.oursNewers + ;LDA #$00 : RTL ; give item + ;.junk + LDA !NPC_FLAGS : AND.b #$20 +RTL +;-------------------------------------------------------------------------------- +ItemSet_FairySword: + PHA : LDA !NPC_FLAGS_2 : ORA.b #$08 : STA !NPC_FLAGS_2 : PLA +RTL + +ItemSet_SmithSword: + PHA : LDA !NPC_FLAGS_2 : ORA.b #$04 : STA !NPC_FLAGS_2 : PLA +RTL + +ItemSet_MagicBat: + PHA : LDA !NPC_FLAGS_2 : ORA.b #$80 : STA !NPC_FLAGS_2 : PLA +RTL + +ItemSet_OldMan: + JSL.l Link_ReceiveItem ; thing we wrote over + PHA : LDA !NPC_FLAGS : ORA.b #$01 : STA !NPC_FLAGS : PLA +RTL + +ItemSet_ZoraKing: + ;JSL $1DE1AA ; Sprite_SpawnFlippersItem ; thing we wrote over + PHA : LDA !NPC_FLAGS : ORA.b #$02 : STA !NPC_FLAGS : PLA +RTL + +ItemSet_SickKid: + JSL.l Link_ReceiveItem ; thing we wrote over + PHA : LDA !NPC_FLAGS : ORA.b #$04 : STA !NPC_FLAGS : PLA +RTL + +ItemSet_TreeKid: + JSL.l Link_ReceiveItem ; thing we wrote over + PHA : LDA !NPC_FLAGS : ORA.b #$08 : STA !NPC_FLAGS : PLA +RTL + +ItemSet_Sahasrala: + JSL.l Link_ReceiveItem ; thing we wrote over + PHA : LDA !NPC_FLAGS : ORA.b #$10 : STA !NPC_FLAGS : PLA +RTL + +ItemSet_Catfish: + ;JSL $00D52D ; GetAnimatedSpriteTile.variable ; thing we wrote over + ;JSL.l LoadCatfishItemGFX + PHA : LDA !NPC_FLAGS : ORA.b #$20 : STA !NPC_FLAGS : PLA +RTL + +ItemSet_Library: + JSL.l Link_ReceiveItem ; thing we wrote over + PHA : LDA !NPC_FLAGS : ORA.b #$80 : STA !NPC_FLAGS : PLA +RTL + +ItemSet_Mushroom: + PHA + LDA !NPC_FLAGS_2 : ORA.b #$10 : STA !NPC_FLAGS_2 + LDA.l MushroomItem : TAY + PLA + ;LDY.b #$29 + STZ $02E9 ; thing we wrote over - the mushroom is an npc for item purposes apparently +RTL + +ItemSet_Powder: + PHA + LDA !NPC_FLAGS_2 : ORA.b #$20 : STA !NPC_FLAGS_2 + LDA.l WitchItem : TAY + PLA + ;LDY.b #$0D + STZ $02E9 ; thing we wrote over +RTL +;================================================================================ \ No newline at end of file diff --git a/openmode.asm b/openmode.asm new file mode 100644 index 00000000..2f87a13d --- /dev/null +++ b/openmode.asm @@ -0,0 +1,18 @@ +;================================================================================ +; Open Mode Uncle Rain State Check +;================================================================================ +SetUncleRainState: + LDA.l OpenMode : BEQ + : RTL : + ; we're done if open mode is on + LDA.b #$01 : STA $7EF3C5 +RTL +;-------------------------------------------------------------------------------- +InitOpenMode: + LDA.l OpenMode : BEQ + ; Skip if not open mode + LDA $7EF3C5 : CMP #$02 : !BGE + ; Skip if already past escape + LDA.b #02 : STA $7EF3C5 ; Go to post-escape phase (pre aga1) + LDA $7EF3C6 : ORA #$14 : STA $7EF3C6 ; remove uncle + LDA $7EF3C8 : CMP #$05 : BEQ ++ : LDA.b #$01 : ++ : STA $7EF3C8 ; set spawn points to house+sanc unless already house+sanc+mountain + LDA $7EF29B : ORA.b #$20 : STA $7EF29B ; open castle gate + + +RTL +;-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/output.txt b/output.txt new file mode 100644 index 00000000..2962db9e --- /dev/null +++ b/output.txt @@ -0,0 +1,3 @@ +llh@tinymagnet.com:~/DBMS/Run$ ./dbms -? +(Lena Hellstrom) bad option...should be "f" or "b" or "a" +llh@tinymagnet.com:~/DBMS/Run$ \ No newline at end of file diff --git a/pendantcrystalhud.asm b/pendantcrystalhud.asm new file mode 100644 index 00000000..96a1927c --- /dev/null +++ b/pendantcrystalhud.asm @@ -0,0 +1,247 @@ +;================================================================================ +; Pendant / Crystal HUD Fix +;-------------------------------------------------------------------------------- +;CheckPendantHUD: +; LDA !HUD_FLAG : CMP.b #$40 ; check for hud flag instead +;RTL +;================================================================================ +FlipLWDWFlag: + PHP + SEP #$20 ; set 8-bit accumulator + LDA $7EF3CA : EOR.b #$40 : STA $7EF3CA + BEQ + + LDA.b #07 : BRA ++ ; dark world - crystals + + + LDA.b #03 ; light world - pendants + ++ + STA $7EF3C7 + PLP +RTL +;================================================================================ +GetCrystalNumber: + PHX + TXA : ASL : TAX + LDA $7EF3CA : EOR.b #$40 : BNE + + INX + + + LDA.l CrystalNumberTable-16, X + PLX +RTL +;================================================================================ +OverworldMap_CheckObject: + LDA $FFFFFF + PHX + LDA $7EF3C7 : CMP.b #$03 : BNE + + ;LW Map + LDA.l .lw_offsets, X + BPL +++ : CLC : BRA .done : +++ + TAX : BRA ++ + + : CMP.b #$07 : BNE .fail + ;DW Map + LDA.l .dw_offsets, X : TAX + BRA ++ + SEC + PLX +RTL +++ + LDA.l CrystalPendantFlags_2, X + AND.b #$40 : BNE .checkCrystal + + .checkPendant + LDA $7EF374 : AND.l CrystalPendantFlags, X : BNE .fail + CLC : BRA .done + + .checkCrystal + LDA $7EF37A : 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 +;================================================================================ +SetLWDWMap: + PHP + SEP #$20 ; set 8-bit accumulator + LDA $7EF3CA : EOR.b #$40 + BNE + + LDA.b #07 : BRA ++ ; dark world - crystals + + + LDA.b #03 ; light world - pendants + ++ + STA $7EF3C7 + PLP +RTL +;================================================================================ +GetMapMode: + LDA $7EF3CA : AND.b #$40 : BEQ + + LDA.b #07 ; dark world - crystals +RTL + + + LDA.b #03 ; light world - pendants +RTL +;================================================================================ +CheckHeraObject: + LDA CrystalPendantFlags_2_hera : BNE .crystal + + .pendant + LDA $7EF374 : AND.l CrystalPendantFlags_hera +RTL + .crystal + LDA $7EF37A : AND.l CrystalPendantFlags_hera +RTL +;================================================================================ +;GetPendantCrystalWorld: +; PHB : PHK : PLB +; PHX +; LDA $040C : LSR : TAX +; LDA .dungeon_worlds, X +; PLX : PLB +; CMP.b #$00 +;RTL +;================================================================================ +ShowDungeonItems: + LDA $040C : AND.w #$00FF : CMP.w #$00FF : BNE + : RTL : + ; return normal result if outdoors or in a cave + ;LDA $F0 : AND.w #$0020 ; check for select + LDA !HUD_FLAG : AND.w #$0020 ; check hud flag + BEQ + : LDA.w #$0000 : RTL : + ; if set, send the zero onwards + LDA $040C : AND.w #$00FF : CMP.w #$00FF ; original logic +RTL +;================================================================================ +DrawPendantCrystalDiagram: + PHP : PHB : PHK : PLB + REP #$30 ; Set 16-bit accumulator & index registers + LDX.w #$0000 ; Paint entire box black & draw empty pendants and crystals + - + LDA .row0, X : STA $12EA, X + LDA .row1, X : STA $132A, X + LDA .row2, X : STA $136A, X + LDA .row3, X : STA $13AA, X + LDA .row4, X : STA $13EA, X + LDA .row5, X : STA $142A, X + LDA .row6, X : STA $146A, X + LDA .row7, X : STA $14AA, X + LDA .row8, X : STA $14EA, X + INX #2 : CPX.w #$0014 : BCC - + + ;pendants + LDA $7EF374 : AND.w #$0004 : BEQ + ; pendant of courage (green) + LDA.w #$3D2B : STA $1332 + LDA.w #$3D2C : STA $1334 + LDA.w #$3D2D : STA $1372 + LDA.w #$3D2E : STA $1374 + + LDA $7EF374 : AND.w #$0002 : BEQ + ; pendant of power (blue) + LDA.w #$2D2B : STA $13AE + LDA.w #$2D2C : STA $13B0 + LDA.w #$2D2D : STA $13EE + LDA.w #$2D2E : STA $13F0 + + LDA $7EF374 : AND.w #$0001 : BEQ + ; pendant of wisdom (red) + LDA.w #$252B : STA $13B6 + LDA.w #$252C : STA $13B8 + LDA.w #$252D : STA $13F6 + LDA.w #$252E : STA $13F8 + + + + ;crystals + LDA $7EF37A : AND.w #$0002 : BEQ + ; crystal 1 + LDA.w #$2D44 : STA $14AC + LDA.w #$2D45 : STA $14AE + + LDA $7EF37A : AND.w #$0010 : BEQ + ; crystal 2 + LDA.w #$2D44 : STA $146E + LDA.w #$2D45 : STA $1470 + + LDA $7EF37A : AND.w #$0040 : BEQ + ; crystal 3 + LDA.w #$2D44 : STA $14B0 + LDA.w #$2D45 : STA $14B2 + + LDA $7EF37A : AND.w #$0020 : BEQ + ; crystal 4 + LDA.w #$2D44 : STA $1472 + LDA.w #$2D45 : STA $1474 + + LDA $7EF37A : AND.w #$0004 : BEQ + ; crystal 5 + LDA.w #$2D44 : STA $14B4 + LDA.w #$2D45 : STA $14B6 + + LDA $7EF37A : AND.w #$0001 : BEQ + ; crystal 6 + LDA.w #$2D44 : STA $1476 + LDA.w #$2D45 : STA $1478 + + LDA $7EF37A : AND.w #$0008 : BEQ + ; crystal 7 + LDA.w #$2D44 : STA $14B8 + LDA.w #$2D45 : STA $14BA + + + PLB : PLP +RTL +;================================================================================ +.row0 dw $28FB, $28F9, $28F9, $28F9, $28F9, $28F9, $28F9, $28F9, $28F9, $68FB +.row1 dw $28FC, $24F5, $24F5, $24F5, $312B, $312C, $24F5, $24F5, $24F5, $68FC +.row2 dw $28FC, $24F5, $24F5, $24F5, $313D, $312E, $24F5, $24F5, $24F5, $68FC +.row3 dw $28FC, $24F5, $312B, $312C, $24F5, $24F5, $312B, $312C, $24F5, $68FC +.row4 dw $28FC, $24F5, $313D, $312E, $24F5, $24F5, $313D, $312E, $24F5, $68FC +.row5 dw $28FC, $24F5, $24F5, $24F5, $24F5, $24F5, $24F5, $24F5, $24F5, $68FC +.row6 dw $28FC, $24F5, $3146, $3147, $3146, $3147, $3146, $3147, $24F5, $68FC +.row7 dw $28FC, $3146, $3147, $3146, $3147, $3146, $3147, $3146, $3147, $68FC +.row8 dw $A8FB, $A8F9, $A8F9, $A8F9, $A8F9, $A8F9, $A8F9, $A8F9, $A8F9, $E8FB +;================================================================================ +;Crystal 1: $02 +;Crystal 2: $10 +;Crystal 3: $40 +;Crystal 4: $20 +;Crystal 5: $04 +;Crystal 6: $01 +;Crystal 7: $08 +;;blank pendant +;db $2B, $31, $2C, $31, $3D, $31, $2E, $31 +; +;;red pendant +;db $2B, $25, $2C, $25, $2D, $25, $2E, $25 +; +;;blue pendant +;db $2B, $2D, $2C, $2D, $2D, $2D, $2E, $2D +; +;;green pendant +;db $2B, $3D, $2C, $3D, $2D, $3D, $2E, $3D +;================================================================================ +.pendants +dw $28FB, $28F9, $28F9, $28F9, $28F9, $28F9, $28F9, $28F9, $28F9, $68FB +dw $28FC, $2521, $2522, $2523, $2524, $253F, $24F5, $24F5, $24F5, $68FC +dw $28FC, $24F5, $24F5, $24F5, $24F5, $24F5, $24F5, $24F5, $24F5, $68FC +dw $28FC, $24F5, $24F5, $24F5, $213B, $213C, $24F5, $24F5, $24F5, $68FC +dw $28FC, $24F5, $24F5, $24F5, $213D, $213E, $24F5, $24F5, $24F5, $68FC +dw $28FC, $24F5, $24F5, $24F5, $24F5, $24F5, $24F5, $24F5, $24F5, $68FC +dw $28FC, $24F5, $213B, $213C, $24F5, $24F5, $213B, $213C, $24F5, $68FC +dw $28FC, $24F5, $213D, $213E, $24F5, $24F5, $213D, $213E, $24F5, $68FC +dw $A8FB, $A8F9, $A8F9, $A8F9, $A8F9, $A8F9, $A8F9, $A8F9, $A8F9, $E8FB +.crystals +dw $28FB, $28F9, $28F9, $28F9, $28F9, $28F9, $28F9, $28F9, $28F9, $68FB +dw $28FC, $252F, $2534, $2535, $2536, $2537, $24F5, $24F5, $24F5, $68FC +dw $28FC, $24F5, $24F5, $24F5, $24F5, $24F5, $24F5, $24F5, $24F5, $68FC +dw $28FC, $24F5, $24F5, $3146, $3147, $3146, $3147, $24F5, $24F5, $68FC +dw $28FC, $24F5, $24F5, $24F5, $24F5, $24F5, $24F5, $24F5, $24F5, $68FC +dw $28FC, $24F5, $3146, $3147, $3146, $3147, $3146, $3147, $24F5, $68FC +dw $28FC, $24F5, $24F5, $24F5, $24F5, $24F5, $24F5, $24F5, $24F5, $68FC +dw $28FC, $24F5, $24F5, $3146, $3147, $3146, $3147, $24F5, $24F5, $68FC +dw $A8FB, $A8F9, $A8F9, $A8F9, $A8F9, $A8F9, $A8F9, $A8F9, $A8F9, $E8FB +;================================================================================ +; DATA - Dungeon Worlds +;.dungeon_worlds +;db $00, $00, $00, $00, $00, $40, $40, $40 +;db $40, $40, $00, $40, $40, $40, $FF, $FF +;================================================================================ +;0x00 - Sewer Passage +;0x02 - Hyrule Castle +;0x04 - Eastern Palace +;0x06 - Desert Palace +;0x08 - Hyrule Castle 2 +;0x0A - Swamp Palace +;0x0C - Palace of Darkness +;0x0E - Misery Mire +;0x10 - Skull Woods +;0x12 - Ice Palace +;0x14 - Tower of Hera +;0x16 - Thieves' Town +;0x18 - Turtle Rock +;0x1A - Ganon's Tower +;0x1C - ??? possibly unused. (Were they planning two extra dungeons perhaps?) +;0x1E - ??? possibly unused. +;================================================================================ \ No newline at end of file diff --git a/potions.asm b/potions.asm new file mode 100644 index 00000000..2d4710fc --- /dev/null +++ b/potions.asm @@ -0,0 +1,77 @@ +;-------------------------------------------------------------------------------- +; $7F5092 - Potion Animation Busy Flags (Health) +; $7F5093 - Potion Animation Busy Flags (Magic) +;-------------------------------------------------------------------------------- +!BUSY_HEALTH = $7F5092 +RefillHealth: + ;STA $FFFFFF + LDA.l PotionHealthRefill : CMP.b #$A0 : !BGE + + LDA !BUSY_HEALTH : BNE ++ + LDA.l PotionHealthRefill ; load refill amount + !ADD $7EF36D ; add to current health + CMP $7EF36C : !BLT +++ : LDA $7EF36C : +++ + STA !BUSY_HEALTH + ++ + + LDA $7EF36D : CMP.l !BUSY_HEALTH : !BLT ++ + LDA.b #$00 : STA $7EF372 + LDA $020A : BNE .notDone + LDA.b #$00 : STA !BUSY_HEALTH + SEC + RTL + ++ + LDA.b #$08 : STA $7EF372 ; refill some health + .notDone + CLC + RTL + + + + ; Check goal health versus actual health. + ; if(actual < goal) then branch. + LDA $7EF36D : CMP $7EF36C : BCC .refillAllHealth + LDA $7EF36C : STA $7EF36D + LDA.b #$00 : STA $7EF372 + ; ??? not sure what purpose this branch serves. + LDA $020A : BNE .beta + SEC + RTL +.refillAllHealth + ; Fill up ze health. + LDA.b #$A0 : STA $7EF372 +.beta + CLC +RTL +;-------------------------------------------------------------------------------- +!BUSY_MAGIC = $7F5093 +RefillMagic: + LDA.l PotionMagicRefill : CMP.b #$80 : !BGE + + LDA !BUSY_MAGIC : BNE ++ + LDA.l PotionMagicRefill ; load refill amount + !ADD $7EF36E ; add to current magic + CMP.b #$80 : !BLT +++ : LDA.b #$80 : +++ + STA !BUSY_MAGIC + ++ + + LDA $7EF36E : CMP.l !BUSY_MAGIC : !BLT ++ + LDA.b #$00 : STA !BUSY_MAGIC + SEC + RTL + ++ + LDA.b #$01 : STA $7EF373 ; refill some magic + CLC + RTL + + + + SEP #$30 + ; Check if Link's magic meter is full + LDA $7EF36E : CMP.b #$80 + BCS .itsFull + ; Tell the magic meter to fill up until it's full. + LDA.b #$80 : STA $7EF373 + SEP #$30 + RTL +.itsFull + ; Set the carry, signifying we're done filling it. + SEP #$31 +RTL +;-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/previewdatacopy.asm b/previewdatacopy.asm new file mode 100644 index 00000000..f2841c45 --- /dev/null +++ b/previewdatacopy.asm @@ -0,0 +1,60 @@ +;================================================================================ +; RTPreview SRAM Hook +;-------------------------------------------------------------------------------- +WriteStatusPreview: + PHA + LDA $4300 : PHA ; preserve DMA parameters + LDA $4301 : PHA ; preserve DMA parameters + LDA $4302 : PHA ; preserve DMA parameters + LDA $4303 : PHA ; preserve DMA parameters + LDA $4304 : PHA ; preserve DMA parameters + LDA $4305 : PHA ; preserve DMA parameters + LDA $4306 : PHA ; preserve DMA parameters + ;-------------------------------------------------------------------------------- + LDA #$80 : STA $4300 ; set DMA transfer direction B -> A, bus A auto increment, single-byte mode + + STA $4301 ; set bus B source to WRAM register + + LDA #$40 : STA $2181 ; set WRAM register source address + LDA #$F3 : STA $2182 + LDA #$7E : STA $2183 + + STZ $4302 ; set bus A destination address to SRAM + LDA #$1E : STA $4303 + LDA #$70 : STA $4304 + + LDA #$80 : STA $4305 ; set transfer size to 0x180 + LDA #$01 : STA $4306 ; STZ $4306 + + LDA #$01 : STA $420B ; begin DMA transfer + ;-------------------------------------------------------------------------------- + PLA : STA $4306 ; restore DMA parameters + PLA : STA $4305 ; restore DMA parameters + PLA : STA $4304 ; restore DMA parameters + PLA : STA $4303 ; restore DMA parameters + PLA : STA $4302 ; restore DMA parameters + PLA : STA $4301 ; restore DMA parameters + PLA : STA $4300 ; restore DMA parameters + PLA +RTL +;-------------------------------------------------------------------------------- +;WriteStatusPreview: +; PHA : PHX : PHP +; +; REP #$20 ; set 16-bit accumulator +; CLC +; LDX.b #$00 +; - +; LDA $7EF340, X : STA $701E00, X +; LDA $7EF340+2, X : STA $701E00+2, X +; LDA $7EF340+4, X : STA $701E00+4, X +; TXA : ADC.b #$06 : TAX +; CPX #$24 : !BLT - +; +; SEP #$20 ; set 8-bit accumulator +; LDA $7EF374 : STA $701E24 +; LDA $7EF37A : STA $701E25 +; +; PLP : PLX : PLA +;RTL +;-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/rngfixes.asm b/rngfixes.asm new file mode 100644 index 00000000..0a73cb18 --- /dev/null +++ b/rngfixes.asm @@ -0,0 +1,37 @@ +;================================================================================ +; RNG Fixes +;-------------------------------------------------------------------------------- +RigDigRNG: + LDA $7FFE01 : CMP.l DiggingGameRNG : !BGE .forceHeart + .normalItem + JSL $0DBA71 ; GetRandomInt +RTL + .forceHeart + LDA $7FFE00 : BNE .normalItem + LDA #$04 +RTL +;-------------------------------------------------------------------------------- +RigChestRNG: + JSL.l DecrementChestCounter + LDA $04C4 : CMP.l ChestGameRNG : BEQ .forceHeart + .normalItem + JSL $0DBA71 ; GetRandomInt + AND.b #$07 ; restrict values to 0-7 + CMP #$07 : BEQ .notHeart + JSL.l DecrementItemCounter +RTL + .forceHeart + LDA $0403 : AND.b #$40 : BNE .notHeart + LDA #$07 ; give prize item +RTL + .notHeart + JSL.l DecrementItemCounter + ;LDA #$00 ; bullshit rupee farming in chest game + + JSL $0DBA71 ; GetRandomInt ; spam RNG until we stop getting the prize item + AND.b #$07 ; restrict values to 0-7 + CMP #$07 : BNE + ; player got prize item AGAIN + LDA.b #$00 ; give them money instead + + +RTL +;-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/rupeelimit.asm b/rupeelimit.asm new file mode 100644 index 00000000..c4cd2b96 --- /dev/null +++ b/rupeelimit.asm @@ -0,0 +1,40 @@ +;================================================================================ +; Four Digit Rupees +;-------------------------------------------------------------------------------- +Draw4DigitRupees: + LDA $7EF362 + JSL.l HexToDec + + ;REP #$30 + LDA $7F5004 : AND.w #$00FF : ORA.w #$2400 : STA $7EC750 + LDA $7F5005 : AND.w #$00FF : ORA.w #$2400 : STA $7EC752 + LDA $7F5006 : AND.w #$00FF : ORA.w #$2400 : STA $7EC754 + LDA $7F5007 : AND.w #$00FF : ORA.w #$2400 : STA $7EC756 + + ;LDA.w #$247F ; clear other hud cells + ;STA $7EC758 + ;STA $7EC75E + ;STA $7EC764 + + ;STA $7EC718 ; bombs + ;STA $7EC71E ; arrows + ;STA $7EC724 ; keys + + ;LDA.w #$2C88 : STA $7EC71A ; bomb icon + ;LDA.w #$2C89 : STA $7EC71C + + ;LDA $7EF340 : AND.w #$00FF : CMP.w #$0003 : !BGE .silverArrows + + ;.woodArrows + ;LDA.w #$20A7 : STA $7EC720 ; wood arrow icon + ;LDA.w #$20A9 : STA $7EC722 + ;BRA + + + ;.silverArrows + ;LDA.w #$2486 : STA $7EC720 ; silver arrow icon + ;LDA.w #$2487 : STA $7EC722 + ;+ + + ;LDA.w #$2871 : STA $7EC726 ; key icon +RTL +;================================================================================ \ No newline at end of file diff --git a/sandbox.asm b/sandbox.asm new file mode 100644 index 00000000..444a5ac3 --- /dev/null +++ b/sandbox.asm @@ -0,0 +1,70 @@ +;org $06FA78 ; set all prize packs to bombs +;dd #$DDDDDDDD +;dd #$DDDDDDDD +;dd #$DDDDDDDD +;dd #$DDDDDDDD +;dd #$DDDDDDDD +;dd #$DDDDDDDD +;dd #$DDDDDDDD +;dd #$DDDDDDDD +; +;;Zarby +;org $09E329 +;db #$6D +;org $01E306 +;db #$00 +;org $01E397 +;db #$00 +;org $09DDC1 +;db #$07, #$17, #$26, #$0A, #$0A, #$26, #$07, #$18, #$26 +;org $09E410 +;db #$05, #$09, #$8B +;org $01E28A +;db #$00 +;org $01E2E8 +;db #$00 +;org $1BBBCE +;db #$82, #$82 +; +;;-- +; +;;Skuj +;org $0A84B9 ; Ganon Basement Remodel +;db #$E1, #$04, #$93, #$13, #$C4, #$B8, #$38, #$C2, #$FC, #$A1, #$00, #$2B, #$22, #$61, #$FC, #$A9, #$04, #$FD, #$21, #$02, #$4B, #$23, #$62, #$FC, #$69, #$00, #$1A, #$A1, #$61, #$FC, #$6E, #$81, #$48, #$9A, #$62, #$FD, #$2A, #$86, #$58, #$AA, #$01, #$FD, #$AA, #$82, #$FE, #$2A, #$80, #$98, #$AA, #$01, #$FE, #$AA, #$84, #$A9, #$81, #$61, #$FE, #$A7, #$05, #$90, #$73, #$02, #$FE, #$07, #$01, #$83, #$10, #$61, #$FE, #$00, #$00, #$93, #$00, #$01, #$FF, #$C0, #$02, #$F3, #$10, #$62, #$FF, #$C7, #$03, #$D8, #$73, #$02, #$FF, #$27, #$07, #$CA, #$82, #$62, #$FF, #$2D, #$03, #$99, #$D2, #$02, #$FE, #$2D, #$01, #$D1, #$13, #$C4, #$90, #$51, #$C4, #$E0, #$51, #$C4, #$FE, #$92, #$48, #$B4, #$26, #$03, #$FF, #$32, #$4A, #$A4, #$36, #$63, #$FE, #$94, #$C9, #$B4, #$4E, #$04, #$FF, #$34, #$CB, #$CC, #$36, #$64, #$FE, #$C3, #$18, #$B8, #$31, #$07, #$FF, #$23, #$1A, #$B0, #$39, #$67, #$FE, #$C4, #$99, #$B8, #$49, #$08, #$FF, #$24, #$9B, #$C8, #$39, #$68, #$A3, #$20, #$22, #$A3, #$20, #$69, #$A3, #$5C, #$22, #$DF, #$20, #$69, #$B8, #$70, #$A4, #$08, #$00, #$60, #$10, #$00, #$60, #$18, #$13, #$C0, #$18, #$53, #$C0, #$59, #$13, #$C0, #$59, #$53, #$C0, #$59, #$89, #$C0, #$89, #$81, #$C0, #$89, #$A0, #$00, #$8B, #$E1, #$C0, #$CA, #$E1, #$C0, #$D9, #$83, #$C0, #$D9, #$C1, #$C0, #$FF, #$FF, #$2B, #$14, #$FF, #$FF, #$FF, #$F0, #$FF, #$61, #$0A, #$82, #$18 +; +;org $04F4F3 ; Ganon Basement to Hera +;db #$07 +; +;org $02D26A ; Pyramid Hole is Hera Entrance +;db #$14 +; +;org $02E849 ; Fly 1 to Sanctuary +;db #$13, #$00, #$16, #$00, #$18, #$00, #$2C, #$00, #$2F, #$00, #$30, #$00, #$3B, #$00, #$3F, #$00, #$5B, #$00, #$35, #$00, #$0F, #$00, #$15, #$00, #$33, #$00, #$12, #$00, #$3F, #$00, #$55, #$00, #$7F, #$00, #$1A, #$00, #$88, #$08, #$30, #$0B, #$88, #$05, #$98, #$07, #$80, #$18, #$9E, #$06, #$10, #$08, #$2E, #$00, #$42, #$12, #$80, #$06, #$12, #$01, #$9E, #$05, #$8E, #$04, #$80, #$02, #$12, #$01, #$80, #$02, #$00, #$04, #$16, #$05, #$59, #$07, #$B9, #$0A, #$FA, #$0A, #$1E, #$0F, #$DF, #$0E, #$05, #$0F, #$00, #$06, #$46, #$0E, #$C6, #$02, #$2A, #$04, #$BA, #$0C, #$9A, #$04, #$56, #$0E, #$2A, #$04, #$56, #$0E, #$D6, #$06, #$4E, #$0C, #$7E, #$01, #$40, #$08, #$B2, #$0E, #$00, #$00, #$F2, #$06, #$75, #$0E, #$78, #$07, #$0A, #$0C, #$06, #$0E, #$8A, #$0A, #$EA, #$06, #$62, #$04, #$00, #$0E, #$8A, #$0A, #$00, #$0E, #$68, #$04, #$78, #$05, #$B7, #$07, #$17, #$0B, #$58, #$0B, #$A8, #$0F, #$3D, #$0F, #$67, #$0F, #$5C, #$06, #$A8, #$0E, #$28, #$03, #$88, #$04, #$18, #$0D, #$F8, #$04, #$B8, #$0E, #$88, #$04, #$B8, #$0E, #$56, #$07, #$C8, #$0C, #$00, #$02, #$B8, #$08, #$30, #$0F, #$78, #$00, #$78, #$07, #$F3, #$0E, #$F0, #$07, #$90, #$0C, #$80, #$0E, #$10, #$0B, #$70, #$07, #$E8, #$04, #$68, #$0E, #$10, #$0B, #$68, #$0E, #$70, #$04, #$83, #$05, #$C6, #$07, #$26, #$0B, #$67, #$0B, #$8D, #$0F, #$4C, #$0F, #$72, #$0F, #$6D, #$06, #$B3, #$0E, #$33, #$03, #$97, #$04, #$27, #$0D, #$07, #$05, #$C3, #$0E, #$97, #$04, #$C3, #$0E, #$56, #$07, #$D3, #$0C, #$0B, #$02, #$BF, #$08, #$37, #$0F, #$8D, #$00, #$7F, #$07, #$FA, #$0E, #$F7, #$07, #$97, #$0C, #$8B, #$0E, #$17, #$0B, #$77, #$07, #$EF, #$04, #$85, #$0E, #$17, #$0B, #$85, #$0E, #$F6, #$FF, #$FA, #$FF, #$07, #$00, #$F7, #$FF, #$F6, #$FF, #$00, #$00, #$F1, #$FF, #$FB, #$FF, #$00, #$00, #$FA, #$FF, #$0A, #$00, #$F6, #$FF, #$F6, #$FF, #$F6, #$FF, #$FA, #$FF, #$F6, #$FF, #$FA, #$FF, #$F2, #$FF, #$F2, #$FF, #$02, #$00, #$00, #$00, #$0E, #$00, #$00, #$00, #$FE, #$FF, #$0B, #$00, #$F8, #$FF, #$06, #$00, #$FA, #$FF, #$FA, #$FF, #$06, #$00, #$0E, #$00, #$00, #$00, #$FA, #$FF, #$00, #$00 +; +;;--- +; +;org $02A451 ; Disable OW Map +;LDA.b #$00 +; +;org $0287FB ; Disable UW Map +;LDA.b #$00 +; +;org $06C913 ; 34913 sprite_ponds.asm:933 (LDA.b #$3B : STA $0DC0, X ; silver arrows) +;LDA.b #$43 +; +;org $1D9532 ; E9532 +;JSL CanGanonTakeDamage : NOP +; +;org $2F8000 +;CanGanonTakeDamage: +; LDA $7EF359 : CMP.b #$02 : BEQ .normal +; .invincible +; LDA.b #$01 : STA $0D80, X +; LDA.b #$80 : STA $0DF0, X +;RTL +; .normal +; LDA.b #$11 : STA $0D80, X +; LDA.b #$68 : STA $0DF0, X +;RTL +; +; \ No newline at end of file diff --git a/scratchpad.asm b/scratchpad.asm new file mode 100644 index 00000000..e69de29b diff --git a/seedtag.asm b/seedtag.asm new file mode 100644 index 00000000..bfebb57d --- /dev/null +++ b/seedtag.asm @@ -0,0 +1,34 @@ +;-------------------------------------------------------------------------------- +; GenerateSeedTags +;-------------------------------------------------------------------------------- +GenerateSeedTags: + PHA : PHX : PHY : PHP + REP #$20 ; set 16-bit accumulator + LDA $00 : PHA + LDA $02 : PHA + LDA $04 : PHA + LDA $06 : PHA + JSL.l NameHash ; get the titlecard hashes + + LDA $00 : AND.w #$1F1F : STA $00 ; keep it under 0x20 or we'll run out of items + LDA $02 : AND.w #$1F1F : STA $02 + LDA $04 : AND.w #$1F1F : STA $04 + LDA $06 : AND.w #$1F1F : STA $06 + + REP #$30 ; set 8-bit accumulator & index registers + + LDY #$08 + - + + + DEY : BNE - + + + REP #20 ; set 16-bit accumulator + PLA : STA $06 + PLA : STA $04 + PLA : STA $02 + PLA : STA $00 + PLP : PLY : PLX : PLA +RTL +;-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/shopkeeper.asm b/shopkeeper.asm new file mode 100644 index 00000000..5132dc6d --- /dev/null +++ b/shopkeeper.asm @@ -0,0 +1,24 @@ +;================================================================================ +; Randomize 300 Rupee NPC +;-------------------------------------------------------------------------------- +Set300RupeeNPCItem: + INC $0D80, X ; thing we wrote over + + PHA : PHP + REP #$20 ; set 16-bit accumulator + LDA $A0 ; these are all decimal because i got them that way + CMP.w #291 : BNE + + LDA RupeeNPC_MoldormCave : TAY ; load moldorm cave value into Y + BRA .done + + CMP.w #286 : BNE + + LDA RupeeNPC_NortheastDarkSwampCave : TAY ; load northeast dark swamp cave value into Y + BRA .done + + + LDY.b #$46 ; default to a normal 300 rupees + .done + PLP : PLA +RTL +;-------------------------------------------------------------------------------- +; 291 - Moldorm Cave +; 286 - Northeast Dark Swamp Cave +;-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/stats.asm b/stats.asm new file mode 100644 index 00000000..5ef3a1cf --- /dev/null +++ b/stats.asm @@ -0,0 +1,380 @@ +;================================================================================ +; Stat Tracking +;================================================================================ +; $7EF420 - $7EF441 - Stat Tracking +;-------------------------------------------------------------------------------- +; $7EF420 - bonk counter +;-------------------------------------------------------------------------------- +; $7EF421 yyyyyaaa +; y - y item counter +; a - a item counter +;-------------------------------------------------------------------------------- +; $7EF422 ssshhccc +; s - sword counter +; h - shield counter +; c - crystal counter +;-------------------------------------------------------------------------------- +; $7EF423 - item counter +;-------------------------------------------------------------------------------- +; $7EF424 mmkkkkkk +; m - mail counter +; k - small keys +;-------------------------------------------------------------------------------- +; $7EF425w[2] 1111 2222 3333 4444 +; 1 - lvl 1 sword bosses +; 2 - lvl 2 sword bosses +; 3 - lvl 3 sword bosses +; 4 - lvl 4 sword bosses +;-------------------------------------------------------------------------------- +; $7EF427 kkkkcccc +; k - big keys +; c - big chests +;-------------------------------------------------------------------------------- +; $7EF428 mmmmcccc +; k - maps +; c - compases +;-------------------------------------------------------------------------------- +; $7EF429 bbbb--pp +; b - heart containers +; p - pendant upgrades +;-------------------------------------------------------------------------------- +; $7EF42A bfsccccc +; b - bomb acquired +; f - fairy sword acquired +; s - silver arrow bow acquired +; c - chests before gtower big key +;-------------------------------------------------------------------------------- +; $7EF42Bw[2] - rupees spent +;-------------------------------------------------------------------------------- +; $7EF42D - s&q counter +;-------------------------------------------------------------------------------- +; $7EF42Ew[2] - loop frame counter (low) +;-------------------------------------------------------------------------------- +; $7EF430w[2] - loop frame counter (high) +;-------------------------------------------------------------------------------- +; $7EF432 - locations before boots +;-------------------------------------------------------------------------------- +; $7EF433 - locations before mirror +;-------------------------------------------------------------------------------- +; $7EF434 - hhhhdddd - item locations checked +; h - hyrule castle +; d - palace of darkness +;-------------------------------------------------------------------------------- +; $7EF435 - dddhhhaa - item locations checked +; d - desert palace +; h - tower of hera +; a - agahnim's tower +;-------------------------------------------------------------------------------- +; $7EF436 - gggggeee - item locations checked +; g - ganon's tower +; e - eastern palace +;-------------------------------------------------------------------------------- +; $7EF437 - sssstttt - item locations checked +; s - skull woods +; t - thieves town +;-------------------------------------------------------------------------------- +; $7EF438 - iiiimmmm - item locations checked +; i - ice palace +; m - misery mire +;-------------------------------------------------------------------------------- +; $7EF439 - ttttssss - item locations checked +; t - turtle rock +; s - swamp palace +;-------------------------------------------------------------------------------- +; $7EF43A - times mirrored outdoors +;-------------------------------------------------------------------------------- +; $7EF43B - times mirrored in dungeons +;-------------------------------------------------------------------------------- +; $7EF43Cw[2] - screen transition counter +;-------------------------------------------------------------------------------- +; $7EF43Ew[2] - nmi frame counter (low) +;-------------------------------------------------------------------------------- +; $7EF440w[2] - nmi frame counter (high) +;-------------------------------------------------------------------------------- +; $7EF442 - chest counter +;-------------------------------------------------------------------------------- +; $7EF443 - lock stats +;-------------------------------------------------------------------------------- +; $7EF444w[2] - item menu frame counter (low) +;-------------------------------------------------------------------------------- +; $7EF446w[2] - item menu frame counter (high) +;-------------------------------------------------------------------------------- +; $7EF448 - ---hhhhh +; h - heart pieces +;-------------------------------------------------------------------------------- +; $7EF449 - death counter +;-------------------------------------------------------------------------------- +; $7EF44A - reserved +;-------------------------------------------------------------------------------- +; $7EF44B - flute counter +;-------------------------------------------------------------------------------- +; $7EF44Cl[3] - RTA-Timestamp (Start) +;-------------------------------------------------------------------------------- +; $7EF44Fl[3] - RTA-Timestamp (End) +;-------------------------------------------------------------------------------- +; $7EF452 - ----cccc +; c - capacity upgrades +;-------------------------------------------------------------------------------- +; $7EF452 - unused +;-------------------------------------------------------------------------------- +; $7EF454w[2] - challenge timer (low) +;-------------------------------------------------------------------------------- +; $7EF456w[2] - challenge timer (high) +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +!LOCK_STATS = "$7EF443" +;-------------------------------------------------------------------------------- +!BONK_COUNTER = "$7EF420" +!BONK_REPEAT = "$7F503F" +!LOOP_FRAMES_LOW = "$7EF42E" +StatBonkCounter: + PHA + LDA !LOCK_STATS : BNE + + LDA !LOOP_FRAMES_LOW : !SUB !BONK_REPEAT : CMP #30 : !BLT + + LDA !LOOP_FRAMES_LOW : STA !BONK_REPEAT + LDA !BONK_COUNTER : INC + CMP.b #100 : BEQ + ; decimal 100 + STA !BONK_COUNTER + + + PLA + JSL.l AddDashTremor ; thing we wrote over +RTL +;-------------------------------------------------------------------------------- +!SAVE_COUNTER = "$7EF42D" +StatSaveCounter: + PHA + LDA !LOCK_STATS : BNE + + LDA $10 : CMP.b #$17 : BNE + ; not a proper s&q, link probably died + LDA !SAVE_COUNTER : INC + CMP.b #100 : BEQ + ; decimal 100 + STA !SAVE_COUNTER + + + PLA +RTL +;-------------------------------------------------------------------------------- +!SAVE_COUNTER = "$7EF42D" +DecrementSaveCounter: + PHA + LDA !LOCK_STATS : BNE + + LDA !SAVE_COUNTER : DEC : STA !SAVE_COUNTER + + + PLA +RTL +;-------------------------------------------------------------------------------- +!TRANSITION_COUNTER = "$7EF43C" +DungeonHoleWarpTransition: + LDA $01C31F, X + BRA StatTransitionCounter +DungeonHoleEntranceTransition: + JSL EnableForceBlank + BRA StatTransitionCounter +DungeonStairsTransition: + JSL Dungeon_SaveRoomQuadrantData + BRA StatTransitionCounter +DungeonExitTransition: + LDA.b #$0F : STA $10 +StatTransitionCounter: + PHA : PHP + LDA !LOCK_STATS : BNE + + REP #$20 ; set 16-bit accumulator + LDA !TRANSITION_COUNTER : INC + CMP.w #999 : BEQ + ; decimal 999 + STA !TRANSITION_COUNTER + + + PLP : PLA +RTL +;-------------------------------------------------------------------------------- +!FLUTE_COUNTER = "$7EF44B" +IncrementFlute: + LDA !LOCK_STATS : BNE + + LDA !FLUTE_COUNTER : INC : STA !FLUTE_COUNTER + + + JSL.l StatTransitionCounter ; also increment transition counter +RTL +;-------------------------------------------------------------------------------- +IncrementSmallKeys: + LDA !LOCK_STATS : BNE + + JSL AddInventory_incrementKeyLong + + + LDA $7EF36F ; thing we wrote over, read small key count +RTL +;-------------------------------------------------------------------------------- +IncrementAgahnim2Sword: + JSL.l Dungeon_SaveRoomData_justKeys ; thing we wrote over + PHA + LDA !LOCK_STATS : BNE + + JSL AddInventory_incrementBossSwordLong + + + PLA +RTL +;-------------------------------------------------------------------------------- +!DEATH_COUNTER = "$7EF449" +IncrementDeathCounter: + PHA + LDA !LOCK_STATS : BNE + + LDA $7EF36D : BNE + ; link is still alive, skip + LDA !DEATH_COUNTER : INC : STA !DEATH_COUNTER + ;JSL.l DecrementSaveCounter + + + PLA +RTL +;-------------------------------------------------------------------------------- +!CHEST_COUNTER = "$7EF442" +IncrementChestCounter: + LDA.b #$01 : STA $02E9 ; thing we wrote over + PHA + LDA !LOCK_STATS : BNE + + LDA !CHEST_COUNTER : INC : STA !CHEST_COUNTER + + + PLA +RTL +;-------------------------------------------------------------------------------- +!CHEST_COUNTER = "$7EF442" +DecrementChestCounter: + PHA + LDA !LOCK_STATS : BNE + + LDA !CHEST_COUNTER : DEC : STA !CHEST_COUNTER + + + PLA +RTL +;-------------------------------------------------------------------------------- +!ITEM_TOTAL = "$7EF423" +DecrementItemCounter: + PHA + LDA !LOCK_STATS : BNE + + LDA !ITEM_TOTAL : DEC : STA !ITEM_TOTAL + + + PLA +RTL +;-------------------------------------------------------------------------------- +IncrementBigChestCounter: + JSL.l Dungeon_SaveRoomQuadrantData ; thing we wrote over + PHA + LDA !LOCK_STATS : BNE + + %BottomHalf($7EF427) + + + PLA +RTL +;-------------------------------------------------------------------------------- +!OW_MIRROR_COUNTER = "$7EF43A" +IncrementOWMirror: + PHA + LDA !LOCK_STATS : BNE + + LDA $7EF3CA : BEQ + ; only do this for DW->LW + LDA !OW_MIRROR_COUNTER : INC : STA !OW_MIRROR_COUNTER + + + PLA +JMP StatTransitionCounter +;-------------------------------------------------------------------------------- +!UW_MIRROR_COUNTER = "$7EF43B" +IncrementUWMirror: + PHA + LDA !LOCK_STATS : BNE + + LDA $040C : CMP #$FF : BEQ + ; skip if we're in a cave or house + LDA !UW_MIRROR_COUNTER : INC : STA !UW_MIRROR_COUNTER + JSL.l StatTransitionCounter + + + PLA + JSL.l Dungeon_SaveRoomData ; thing we wrote over +RTL +;-------------------------------------------------------------------------------- +!SPENT_RUPEES = "$7EF42B" +IncrementSpentRupees: + DEC A : BPL .subtractRupees + LDA.w #$0000 : STA $7EF360 +RTL + .subtractRupees + PHA : PHP + LDA !LOCK_STATS : AND.w #$00FF : BNE + + LDA !SPENT_RUPEES : INC + CMP.w #9999 : BEQ + ; decimal 9999 + STA !SPENT_RUPEES + + + PLP : PLA +RTL +;-------------------------------------------------------------------------------- +IndoorTileTransitionCounter: + JSL.l Dungeon_LoadRoom ; thing we wrote over +JMP StatTransitionCounter +;-------------------------------------------------------------------------------- +!REDRAW = "$7F5000" +IndoorSubtileTransitionCounter: + LDA.b #$01 : STA !REDRAW ; set redraw flag for items + STZ $0646 ; stuff we wrote over + STZ $0642 +JMP StatTransitionCounter +;-------------------------------------------------------------------------------- +!CHEST_COUNTER = "$7EF442" +!MAIL_COUNTER = "$7EF424" ; mmkkkkkk +!BOSS_KILLS = "$7F5037" +!SWORD_KILLS_1 = "$7EF425" +!SWORD_KILLS_2 = "$7EF426" +!GTOWER_PRE_BIG_KEY = "$7EF42A" ; ---ccccc +!NONCHEST_COUNTER = "$7F503E" +!SAVE_COUNTER = "$7EF42D" +!TRANSITION_COUNTER = "$7EF43C" + +!NMI_COUNTER = "$7EF43E" +!LOOP_COUNTER = "$7EF42E" +!LAG_TIME = "$7F5038" + +!RUPEES_COLLECTED = "$7F503C" +!ITEM_TOTAL = "$7EF423" + +!RTA_END = "$7EF44F" +StatsFinalPrep: + PHA : PHX : PHP + SEP #$30 ; set 8-bit accumulator and index registers + + LDA !LOCK_STATS : BNE .ramPostOnly + INC : STA !LOCK_STATS + + JSL.l AddInventory_incrementBossSwordLong + + LDA !MAIL_COUNTER : !ADD #$40 : STA !MAIL_COUNTER ; add green mail to mail count + + ;LDA !GTOWER_PRE_BIG_KEY : DEC : AND #$1F : TAX + ;LDA !GTOWER_PRE_BIG_KEY : AND #$E0 : STA !GTOWER_PRE_BIG_KEY + ;TXA : ORA !GTOWER_PRE_BIG_KEY : STA !GTOWER_PRE_BIG_KEY + + LDA !TRANSITION_COUNTER : DEC : STA !TRANSITION_COUNTER ; remove extra transition from exiting gtower via duck + + .ramPostOnly + LDA !SWORD_KILLS_1 : LSR #4 : !ADD !SWORD_KILLS_1 : STA !BOSS_KILLS + LDA !SWORD_KILLS_2 : LSR #4 : !ADD !SWORD_KILLS_2 : !ADD !BOSS_KILLS : AND #$0F : STA !BOSS_KILLS + + LDA !NMI_COUNTER : !SUB !LOOP_COUNTER : STA !LAG_TIME + LDA !NMI_COUNTER+1 : SBC !LOOP_COUNTER+1 : STA !LAG_TIME+1 + LDA !NMI_COUNTER+2 : SBC !LOOP_COUNTER+2 : STA !LAG_TIME+2 + LDA !NMI_COUNTER+3 : SBC !LOOP_COUNTER+3 : STA !LAG_TIME+3 + + LDA !SPENT_RUPEES : !ADD $7EF362 : STA !RUPEES_COLLECTED + LDA !SPENT_RUPEES+1 : ADC $7EF363 : STA !RUPEES_COLLECTED+1 + + LDA !ITEM_TOTAL : !SUB !CHEST_COUNTER : STA !NONCHEST_COUNTER + + ;LDA $FFFFFF + ;JSL.l Clock_IsSupported + BRA + + REP #$20 ; set 16-bit accumulator + + LDA $00 : PHA + LDA $02 : PHA + + JSL.l Clock_QuickStamp + LDA $00 : STA !RTA_END + LDA $02 : STA !RTA_END+2 + + PLA : STA $02 + PLA : STA $00 + + + + .done + PLP : PLX : PLA + LDA.b #$19 : STA $10 ; thing we wrote over, load triforce room +RTL +;-------------------------------------------------------------------------------- +; Notes: +; s&q counter +;================================================================================ \ No newline at end of file diff --git a/stats/credits.asm b/stats/credits.asm new file mode 100755 index 00000000..b3214502 --- /dev/null +++ b/stats/credits.asm @@ -0,0 +1,930 @@ +; SIZE: 5199 + +CreditsLine000: + ;ORIGINAL ALTTP STAFF + db $06, $27, $28, $2B, $22, $20, $22, $27, $1A, $25, $9F, $1A, $25, $2D, $2D, $29, $9F, $2C, $2D, $1A, $1F, $1F +CreditsLine001: + ;------------------------------ + db $00, $01, $9F +CreditsLine002: + ;EXECUTIVE PRODUCER + db $07, $23, $3C, $4F, $3C, $3A, $4C, $4B, $40, $4D, $3C, $9F, $47, $49, $46, $3B, $4C, $3A, $3C, $49 +CreditsLine003: + ;HIROSHI YAMAUCHI + db $08, $1F, $64, $65, $6E, $6B, $6F, $64, $65, $9F, $75, $5D, $69, $5D, $71, $5F, $64, $65 +CreditsLine004: + ;HIROSHI YAMAUCHI + db $08, $1F, $8A, $8B, $94, $91, $95, $8A, $8B, $9F, $9B, $83, $8F, $83, $97, $85, $8A, $8B +CreditsLine005: + ;PRODUCER + db $0C, $0F, $29, $2B, $28, $1D, $2E, $1C, $1E, $2B +CreditsLine006: + ;SHIGERU MIYAMOTO + db $08, $1F, $6F, $64, $65, $63, $61, $6E, $71, $9F, $69, $65, $75, $5D, $69, $6B, $70, $6B +CreditsLine007: + ;SHIGERU MIYAMOTO + db $08, $1F, $95, $8A, $8B, $89, $87, $94, $97, $9F, $8F, $8B, $9B, $83, $8F, $91, $96, $91 +CreditsLine008: + ;DIRECTOR + db $0C, $0F, $03, $08, $11, $04, $02, $13, $0E, $11 +CreditsLine009: + ;TAKASHI TEZUKA + db $09, $1B, $70, $5D, $67, $5D, $6F, $64, $65, $9F, $70, $61, $76, $71, $67, $5D +CreditsLine010: + ;TAKASHI TEZUKA + db $09, $1B, $96, $83, $8D, $83, $95, $8A, $8B, $9F, $96, $87, $9C, $97, $8D, $83 +CreditsLine011: + ;SCRIPT WRITER + db $09, $19, $4A, $3A, $49, $40, $47, $4B, $9F, $4E, $49, $40, $4B, $3C, $49 +CreditsLine012: + ;KENSUKE TANABE + db $09, $1B, $67, $61, $6A, $6F, $71, $67, $61, $9F, $70, $5D, $6A, $5D, $5E, $61 +CreditsLine013: + ;KENSUKE TANABE + db $09, $1B, $8D, $87, $90, $95, $97, $8D, $87, $9F, $96, $83, $90, $83, $84, $87 +CreditsLine014: + ;ASSISTANT DIRECTORS + db $06, $25, $1A, $2C, $2C, $22, $2C, $2D, $1A, $27, $2D, $9F, $1D, $22, $2B, $1E, $1C, $2D, $28, $2B, $2C +CreditsLine015: + ;YASUHISA YAMAMURA + db $07, $21, $75, $5D, $6F, $71, $64, $65, $6F, $5D, $9F, $75, $5D, $69, $5D, $69, $71, $6E, $5D +CreditsLine016: + ;YASUHISA YAMAMURA + db $07, $21, $9B, $83, $95, $97, $8A, $8B, $95, $83, $9F, $9B, $83, $8F, $83, $8F, $97, $94, $83 +CreditsLine017: + ;YOICHI YAMADA + db $09, $19, $75, $6B, $65, $5F, $64, $65, $9F, $75, $5D, $69, $5D, $60, $5D +CreditsLine018: + ;YOICHI YAMADA + db $09, $19, $9B, $91, $8B, $85, $8A, $8B, $9F, $9B, $83, $8F, $83, $86, $83 +CreditsLine019: + ;SCREEN GRAPHICS DESIGNERS + db $03, $31, $4A, $3A, $49, $3C, $3C, $45, $9F, $3E, $49, $38, $47, $3F, $40, $3A, $4A, $9F, $3B, $3C, $4A, $40, $3E, $45, $3C, $49, $4A +CreditsLine020: + ;OBJECT DESIGNERS + db $08, $1F, $28, $1B, $23, $1E, $1C, $2D, $9F, $1D, $1E, $2C, $22, $20, $27, $1E, $2B, $2C +CreditsLine021: + ;SOICHIRO TOMITA + db $08, $1D, $6F, $6B, $65, $5F, $64, $65, $6E, $6B, $9F, $70, $6B, $69, $65, $70, $5D +CreditsLine022: + ;SOICHIRO TOMITA + db $08, $1D, $95, $91, $8B, $85, $8A, $8B, $94, $91, $9F, $96, $91, $8F, $8B, $96, $83 +CreditsLine023: + ;TAKAYA IMAMURA + db $09, $1B, $70, $5D, $67, $5D, $75, $5D, $9F, $65, $69, $5D, $69, $71, $6E, $5D +CreditsLine024: + ;TAKAYA IMAMURA + db $09, $1B, $96, $83, $8D, $83, $9B, $83, $9F, $8B, $8F, $83, $8F, $97, $94, $83 +CreditsLine025: + ;BACK GROUND DESIGNERS + db $05, $29, $1B, $1A, $1C, $24, $9F, $20, $2B, $28, $2E, $27, $1D, $9F, $1D, $1E, $2C, $22, $20, $27, $1E, $2B, $2C +CreditsLine026: + ;MASANAO ARIMOTO + db $08, $1D, $69, $5D, $6F, $5D, $6A, $5D, $6B, $9F, $5D, $6E, $65, $69, $6B, $70, $6B +CreditsLine027: + ;MASANAO ARIMOTO + db $08, $1D, $8F, $83, $95, $83, $90, $83, $91, $9F, $83, $94, $8B, $8F, $91, $96, $91 +CreditsLine028: + ;TSUYOSHI WATANABE + db $07, $21, $70, $6F, $71, $75, $6B, $6F, $64, $65, $9F, $73, $5D, $70, $5D, $6A, $5D, $5E, $61 +CreditsLine029: + ;TSUYOSHI WATANABE + db $07, $21, $96, $95, $97, $9B, $91, $95, $8A, $8B, $9F, $99, $83, $96, $83, $90, $83, $84, $87 +CreditsLine030: + ;PROGRAM DIRECTOR + db $08, $1F, $0F, $11, $0E, $06, $11, $00, $0C, $9F, $03, $08, $11, $04, $02, $13, $0E, $11 +CreditsLine031: + ;TOSHIHIKO NAKAGO + db $08, $1F, $70, $6B, $6F, $64, $65, $64, $65, $67, $6B, $9F, $6A, $5D, $67, $5D, $63, $6B +CreditsLine032: + ;TOSHIHIKO NAKAGO + db $08, $1F, $96, $91, $95, $8A, $8B, $8A, $8B, $8D, $91, $9F, $90, $83, $8D, $83, $89, $91 +CreditsLine033: + ;MAIN PROGRAMMER + db $08, $1D, $44, $38, $40, $45, $9F, $47, $49, $46, $3E, $49, $38, $44, $44, $3C, $49 +CreditsLine034: + ;YASUNARI SOEJIMA + db $08, $1F, $75, $5D, $6F, $71, $6A, $5D, $6E, $65, $9F, $6F, $6B, $61, $66, $65, $69, $5D +CreditsLine035: + ;YASUNARI SOEJIMA + db $08, $1F, $9B, $83, $95, $97, $90, $83, $94, $8B, $9F, $95, $91, $87, $8C, $8B, $8F, $83 +CreditsLine036: + ;OBJECT PROGRAMMER + db $07, $21, $46, $39, $41, $3C, $3A, $4B, $9F, $47, $49, $46, $3E, $49, $38, $44, $44, $3C, $49 +CreditsLine037: + ;KAZUAKI MORITA + db $09, $1B, $67, $5D, $76, $71, $5D, $67, $65, $9F, $69, $6B, $6E, $65, $70, $5D +CreditsLine038: + ;KAZUAKI MORITA + db $09, $1B, $8D, $83, $9C, $97, $83, $8D, $8B, $9F, $8F, $91, $94, $8B, $96, $83 +CreditsLine039: + ;PROGRAMMERS + db $0A, $15, $29, $2B, $28, $20, $2B, $1A, $26, $26, $1E, $2B, $2C +CreditsLine040: + ;TATSUO NISHIYAMA + db $08, $1F, $70, $5D, $70, $6F, $71, $6B, $9F, $6A, $65, $6F, $64, $65, $75, $5D, $69, $5D +CreditsLine041: + ;TATSUO NISHIYAMA + db $08, $1F, $96, $83, $96, $95, $97, $91, $9F, $90, $8B, $95, $8A, $8B, $9B, $83, $8F, $83 +CreditsLine042: + ;YUICHI YAMAMOTO + db $08, $1D, $75, $71, $65, $5F, $64, $65, $9F, $75, $5D, $69, $5D, $69, $6B, $70, $6B +CreditsLine043: + ;YUICHI YAMAMOTO + db $08, $1D, $9B, $97, $8B, $85, $8A, $8B, $9F, $9B, $83, $8F, $83, $8F, $91, $96, $91 +CreditsLine044: + ;YOSHIHIRO NOMOTO + db $08, $1F, $75, $6B, $6F, $64, $65, $64, $65, $6E, $6B, $9F, $6A, $6B, $69, $6B, $70, $6B +CreditsLine045: + ;YOSHIHIRO NOMOTO + db $08, $1F, $9B, $91, $95, $8A, $8B, $8A, $8B, $94, $91, $9F, $90, $91, $8F, $91, $96, $91 +CreditsLine046: + ;EIJI NOTO + db $0B, $11, $61, $65, $66, $65, $9F, $6A, $6B, $70, $6B +CreditsLine047: + ;EIJI NOTO + db $0B, $11, $87, $8B, $8C, $8B, $9F, $90, $91, $96, $91 +CreditsLine048: + ;SATORU TAKAHATA + db $08, $1D, $6F, $5D, $70, $6B, $6E, $71, $9F, $70, $5D, $67, $5D, $64, $5D, $70, $5D +CreditsLine049: + ;SATORU TAKAHATA + db $08, $1D, $95, $83, $96, $91, $94, $97, $9F, $96, $83, $8D, $83, $8A, $83, $96, $83 +CreditsLine050: + ;TOSHIO IWAWAKI + db $09, $1B, $70, $6B, $6F, $64, $65, $6B, $9F, $65, $73, $5D, $73, $5D, $67, $65 +CreditsLine051: + ;TOSHIO IWAWAKI + db $09, $1B, $96, $91, $95, $8A, $8B, $91, $9F, $8B, $99, $83, $99, $83, $8D, $8B +CreditsLine052: + ;SHIGEHIRO KASAMATSU + db $06, $25, $6F, $64, $65, $63, $61, $64, $65, $6E, $6B, $9F, $67, $5D, $6F, $5D, $69, $5D, $70, $6F, $71 +CreditsLine053: + ;SHIGEHIRO KASAMATSU + db $06, $25, $95, $8A, $8B, $89, $87, $8A, $8B, $94, $91, $9F, $8D, $83, $95, $83, $8F, $83, $96, $95, $97 +CreditsLine054: + ;YASUNARI NISHIDA + db $08, $1F, $75, $5D, $6F, $71, $6A, $5D, $6E, $65, $9F, $6A, $65, $6F, $64, $65, $60, $5D +CreditsLine055: + ;YASUNARI NISHIDA + db $08, $1F, $9B, $83, $95, $97, $90, $83, $94, $8B, $9F, $90, $8B, $95, $8A, $8B, $86, $83 +CreditsLine056: + ;SOUND COMPOSER + db $09, $1B, $12, $0E, $14, $0D, $03, $9F, $02, $0E, $0C, $0F, $0E, $12, $04, $11 +CreditsLine057: + ;KOJI KONDO + db $0B, $13, $67, $6B, $66, $65, $9F, $67, $6B, $6A, $60, $6B +CreditsLine058: + ;KOJI KONDO + db $0B, $13, $8D, $91, $8C, $8B, $9F, $8D, $91, $90, $86, $91 +CreditsLine059: + ;COORDINATORS + db $0A, $17, $3A, $46, $46, $49, $3B, $40, $45, $38, $4B, $46, $49, $4A +CreditsLine060: + ;KEIZO KATO + db $0B, $13, $67, $61, $65, $76, $6B, $9F, $67, $5D, $70, $6B +CreditsLine061: + ;KEIZO KATO + db $0B, $13, $8D, $87, $8B, $9C, $91, $9F, $8D, $83, $96, $91 +CreditsLine062: + ;TAKAO SHIMIZU + db $09, $19, $70, $5D, $67, $5D, $6B, $9F, $6F, $64, $65, $69, $65, $76, $71 +CreditsLine063: + ;TAKAO SHIMIZU + db $09, $19, $96, $83, $8D, $83, $91, $9F, $95, $8A, $8B, $8F, $8B, $9C, $97 +CreditsLine064: + ;PRINTED ART WORK + db $08, $1F, $29, $2B, $22, $27, $2D, $1E, $1D, $9F, $1A, $2B, $2D, $9F, $30, $28, $2B, $24 +CreditsLine065: + ;YOICHI KOTABE + db $09, $19, $75, $6B, $65, $5F, $64, $65, $9F, $67, $6B, $70, $5D, $5E, $61 +CreditsLine066: + ;YOICHI KOTABE + db $09, $19, $9B, $91, $8B, $85, $8A, $8B, $9F, $8D, $91, $96, $83, $84, $87 +CreditsLine067: + ;HIDEKI FUJII + db $0A, $17, $64, $65, $60, $61, $67, $65, $9F, $62, $71, $66, $65, $65 +CreditsLine068: + ;HIDEKI FUJII + db $0A, $17, $8A, $8B, $86, $87, $8D, $8B, $9F, $88, $97, $8C, $8B, $8B +CreditsLine069: + ;YOSHIAKI KOIZUMI + db $08, $1F, $75, $6B, $6F, $64, $65, $5D, $67, $65, $9F, $67, $6B, $65, $76, $71, $69, $65 +CreditsLine070: + ;YOSHIAKI KOIZUMI + db $08, $1F, $9B, $91, $95, $8A, $8B, $83, $8D, $8B, $9F, $8D, $91, $8B, $9C, $97, $8F, $8B +CreditsLine071: + ;YASUHIRO SAKAI + db $09, $1B, $75, $5D, $6F, $71, $64, $65, $6E, $6B, $9F, $6F, $5D, $67, $5D, $65 +CreditsLine072: + ;YASUHIRO SAKAI + db $09, $1B, $9B, $83, $95, $97, $8A, $8B, $94, $91, $9F, $95, $83, $8D, $83, $8B +CreditsLine073: + ;TOMOAKI KUROUME + db $08, $1D, $70, $6B, $69, $6B, $5D, $67, $65, $9F, $67, $71, $6E, $6B, $71, $69, $61 +CreditsLine074: + ;TOMOAKI KUROUME + db $08, $1D, $96, $91, $8F, $91, $83, $8D, $8B, $9F, $8D, $97, $94, $91, $97, $8F, $87 +CreditsLine075: + ;SPECIAL THANKS TO + db $07, $21, $12, $0F, $04, $02, $08, $00, $0B, $9F, $13, $07, $00, $0D, $0A, $12, $9F, $13, $0E +CreditsLine076: + ;NOBUO OKAJIMA + db $09, $19, $6A, $6B, $5E, $71, $6B, $9F, $6B, $67, $5D, $66, $65, $69, $5D +CreditsLine077: + ;NOBUO OKAJIMA + db $09, $19, $90, $91, $84, $97, $91, $9F, $91, $8D, $83, $8C, $8B, $8F, $83 +CreditsLine078: + ;YASUNORI TAKETANI + db $07, $21, $75, $5D, $6F, $71, $6A, $6B, $6E, $65, $9F, $70, $5D, $67, $61, $70, $5D, $6A, $65 +CreditsLine079: + ;YASUNORI TAKETANI + db $07, $21, $9B, $83, $95, $97, $90, $91, $94, $8B, $9F, $96, $83, $8D, $87, $96, $83, $90, $8B +CreditsLine080: + ;KIYOSHI KODA + db $0A, $17, $67, $65, $75, $6B, $6F, $64, $65, $9F, $67, $6B, $60, $5D +CreditsLine081: + ;KIYOSHI KODA + db $0A, $17, $8D, $8B, $9B, $91, $95, $8A, $8B, $9F, $8D, $91, $86, $83 +CreditsLine082: + ;TAKAMITSU KUZUHARA + db $07, $23, $70, $5D, $67, $5D, $69, $65, $70, $6F, $71, $9F, $67, $71, $76, $71, $64, $5D, $6E, $5D +CreditsLine083: + ;TAKAMITSU KUZUHARA + db $07, $23, $96, $83, $8D, $83, $8F, $8B, $96, $95, $97, $9F, $8D, $97, $9C, $97, $8A, $83, $94, $83 +CreditsLine084: + ;HIRONOBU KAKUI + db $09, $1B, $64, $65, $6E, $6B, $6A, $6B, $5E, $71, $9F, $67, $5D, $67, $71, $65 +CreditsLine085: + ;HIRONOBU KAKUI + db $09, $1B, $8A, $8B, $94, $91, $90, $91, $84, $97, $9F, $8D, $83, $8D, $97, $8B +CreditsLine086: + ;SHIGEKI YAMASHIRO + db $07, $21, $6F, $64, $65, $63, $61, $67, $65, $9F, $75, $5D, $69, $5D, $6F, $64, $65, $6E, $6B +CreditsLine087: + ;SHIGEKI YAMASHIRO + db $07, $21, $95, $8A, $8B, $89, $87, $8D, $8B, $9F, $9B, $83, $8F, $83, $95, $8A, $8B, $94, $91 +CreditsLine088: + ;ALTTP RANDOMIZER CONTRIBUTORS + db $01, $39, $38, $43, $4B, $4B, $47, $9F, $49, $38, $45, $3B, $46, $44, $40, $51, $3C, $49, $9F, $3A, $46, $45, $4B, $49, $40, $39, $4C, $4B, $46, $49, $4A +CreditsLine089: + ;APPLICATION DEVELOPMENT + db $04, $2D, $1A, $29, $29, $25, $22, $1C, $1A, $2D, $22, $28, $27, $9F, $1D, $1E, $2F, $1E, $25, $28, $29, $26, $1E, $27, $2D +CreditsLine090: + ;DESSYREQT + db $0B, $11, $60, $61, $6F, $6F, $75, $6E, $61, $6D, $70 +CreditsLine091: + ;DESSYREQT + db $0B, $11, $86, $87, $95, $95, $9B, $94, $87, $93, $96 +CreditsLine092: + ;SNES DEVELOPMENT + db $08, $1F, $12, $0D, $04, $12, $9F, $03, $04, $15, $04, $0B, $0E, $0F, $0C, $04, $0D, $13 +CreditsLine093: + ;KARKAT / MMXBASS + db $08, $1F, $67, $5D, $6E, $67, $5D, $70, $9F, $A2, $9F, $69, $69, $74, $5E, $5D, $6F, $6F +CreditsLine094: + ;KARKAT / MMXBASS + db $08, $1F, $8D, $83, $94, $8D, $83, $96, $9F, $C2, $9F, $8F, $8F, $9A, $84, $83, $95, $95 +CreditsLine095: + ;SMALLHACKER + db $0A, $15, $6F, $69, $5D, $68, $68, $64, $5D, $5F, $67, $61, $6E +CreditsLine096: + ;SMALLHACKER + db $0A, $15, $95, $8F, $83, $8E, $8E, $8A, $83, $85, $8D, $87, $94 +CreditsLine097: + ;LOGIC AND ROUTING + db $07, $21, $43, $46, $3E, $40, $3A, $9F, $38, $45, $3B, $9F, $49, $46, $4C, $4B, $40, $45, $3E +CreditsLine098: + ;CHRISTOSOWEN + db $0A, $17, $5F, $64, $6E, $65, $6F, $70, $6B, $6F, $6B, $73, $61, $6A +CreditsLine099: + ;CHRISTOSOWEN + db $0A, $17, $85, $8A, $94, $8B, $95, $96, $91, $95, $91, $99, $87, $90 +CreditsLine100: + ;VEETORP + db $0C, $0D, $72, $61, $61, $70, $6B, $6E, $6C +CreditsLine101: + ;VEETORP + db $0C, $0D, $98, $87, $87, $96, $91, $94, $92 +CreditsLine102: + ;SPECIAL THANKS + db $09, $1B, $2C, $29, $1E, $1C, $22, $1A, $25, $9F, $2D, $21, $1A, $27, $24, $2C +CreditsLine103: + ;SUPERSKUJ + db $0B, $11, $6F, $71, $6C, $61, $6E, $6F, $67, $71, $66 +CreditsLine104: + ;SUPERSKUJ + db $0B, $11, $95, $97, $92, $87, $94, $95, $8D, $97, $8C +CreditsLine105: + ;BLUEVIPER85 + db $0A, $15, $5E, $68, $71, $61, $72, $65, $6C, $61, $6E, $5B, $58 +CreditsLine106: + ;BLUEVIPER85 + db $0A, $15, $84, $8E, $97, $87, $98, $8B, $92, $87, $94, $81, $7E +CreditsLine107: + ;ZARBY89 + db $0C, $0D, $76, $5D, $6E, $5E, $75, $5B, $5C +CreditsLine108: + ;ZARBY89 + db $0C, $0D, $9C, $83, $94, $84, $9B, $81, $82 +CreditsLine109: + ;MATHONNAPKINS + db $09, $19, $69, $5D, $70, $64, $6B, $6A, $6A, $5D, $6C, $67, $65, $6A, $6F +CreditsLine110: + ;MATHONNAPKINS + db $09, $19, $8F, $83, $96, $8A, $91, $90, $90, $83, $92, $8D, $8B, $90, $95 +CreditsLine111: + ;ACMLM + db $0D, $09, $5D, $5F, $69, $68, $69 +CreditsLine112: + ;ACMLM + db $0D, $09, $83, $85, $8F, $8E, $8F +CreditsLine113: + ;DARKMAGICIAN1184 + db $08, $1F, $60, $5D, $6E, $67, $69, $5D, $63, $65, $5F, $65, $5D, $6A, $54, $54, $5B, $57 +CreditsLine114: + ;DARKMAGICIAN1184 + db $08, $1F, $86, $83, $94, $8D, $8F, $83, $89, $8B, $85, $8B, $83, $90, $7A, $7A, $81, $7D +CreditsLine115: + ;JOSH + db $0E, $07, $66, $6B, $6F, $64 +CreditsLine116: + ;JOSH + db $0E, $07, $8C, $91, $95, $8A +CreditsLine117: + ;MISHRAK109 + db $0B, $13, $69, $65, $6F, $64, $6E, $5D, $67, $54, $53, $5C +CreditsLine118: + ;MISHRAK109 + db $0B, $13, $8F, $8B, $95, $8A, $94, $83, $8D, $7A, $79, $82 +CreditsLine119: + ;SEANCASS + db $0C, $0F, $6F, $61, $5D, $6A, $5F, $5D, $6F, $6F +CreditsLine120: + ;SEANCASS + db $0C, $0F, $95, $87, $83, $90, $85, $83, $95, $95 +CreditsLine121: + ;SCREEVO + db $0C, $0D, $6F, $5F, $6E, $61, $61, $72, $6B +CreditsLine122: + ;SCREEVO + db $0C, $0D, $95, $85, $94, $87, $87, $98, $91 +CreditsLine123: + ;GREENHAM + db $0C, $0F, $63, $6E, $61, $61, $6A, $64, $5D, $69 +CreditsLine124: + ;GREENHAM + db $0C, $0F, $89, $94, $87, $87, $90, $8A, $83, $8F +CreditsLine125: + ;GREENLINENSHIRT + db $08, $1D, $63, $6E, $61, $61, $6A, $68, $65, $6A, $61, $6A, $6F, $64, $65, $6E, $70 +CreditsLine126: + ;GREENLINENSHIRT + db $08, $1D, $89, $94, $87, $87, $90, $8E, $8B, $90, $87, $90, $95, $8A, $8B, $94, $96 +CreditsLine127: + ;WIZZROBEZC + db $0B, $13, $73, $65, $76, $76, $6E, $6B, $5E, $61, $76, $5F +CreditsLine128: + ;WIZZROBEZC + db $0B, $13, $99, $8B, $9C, $9C, $94, $91, $84, $87, $9C, $85 +CreditsLine129: + ;MYRAMONG + db $0C, $0F, $69, $75, $6E, $5D, $69, $6B, $6A, $63 +CreditsLine130: + ;MYRAMONG + db $0C, $0F, $8F, $9B, $94, $83, $8F, $91, $90, $89 +CreditsLine131: + ;BARNOWL + db $0C, $0D, $5E, $5D, $6E, $6A, $6B, $73, $68 +CreditsLine132: + ;BARNOWL + db $0C, $0D, $84, $83, $94, $90, $91, $99, $8E +CreditsLine133: + ;EVILASH25 + db $0B, $11, $61, $72, $65, $68, $5D, $6F, $64, $55, $58 +CreditsLine134: + ;EVILASH25 + db $0B, $11, $87, $98, $8B, $8E, $83, $95, $8A, $7B, $7E +CreditsLine135: + ;KANZEON + db $0C, $0D, $67, $5D, $6A, $76, $61, $6B, $6A +CreditsLine136: + ;KANZEON + db $0C, $0D, $8D, $83, $90, $9C, $87, $91, $90 +CreditsLine137: + ;RAMBLY + db $0D, $0B, $6E, $5D, $69, $5E, $68, $75 +CreditsLine138: + ;RAMBLY + db $0D, $0B, $94, $83, $8F, $84, $8E, $9B +CreditsLine139: + ;FECHDOG + db $0C, $0D, $62, $61, $5F, $64, $60, $6B, $63 +CreditsLine140: + ;FECHDOG + db $0C, $0D, $88, $87, $85, $8A, $86, $91, $89 +CreditsLine141: + ;FLUFFGUCK + db $0B, $11, $62, $68, $71, $62, $62, $63, $71, $5F, $67 +CreditsLine142: + ;FLUFFGUCK + db $0B, $11, $88, $8E, $97, $88, $88, $89, $97, $85, $8D +CreditsLine143: + ;MOPPLETON + db $0B, $11, $69, $6B, $6C, $6C, $68, $61, $70, $6B, $6A +CreditsLine144: + ;MOPPLETON + db $0B, $11, $8F, $91, $92, $92, $8E, $87, $96, $91, $90 +CreditsLine145: + ;DUST N STUFF + db $0A, $17, $60, $71, $6F, $70, $9F, $6A, $9F, $6F, $70, $71, $62, $62 +CreditsLine146: + ;DUST N STUFF + db $0A, $17, $86, $97, $95, $96, $9F, $90, $9F, $95, $96, $97, $88, $88 +CreditsLine147: + ;MRJ + db $0E, $05, $69, $6E, $66 +CreditsLine148: + ;MRJ + db $0E, $05, $8F, $94, $8C +CreditsLine149: + ;QUEST PERFORMANCE + db $07, $21, $2A, $2E, $1E, $2C, $2D, $9F, $29, $1E, $2B, $1F, $28, $2B, $26, $1A, $27, $1C, $1E +CreditsLine150: + ;ITEM LOCATIONS CHECKED + db $05, $2B, $40, $4B, $3C, $44, $9F, $43, $46, $3A, $38, $4B, $40, $46, $45, $4A, $9F, $3A, $3F, $3C, $3A, $42, $3C, $3B +CreditsLine151: + ;CHESTS $$$$/160 + db $01, $3B, $5F, $64, $61, $6F, $70, $6F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $54, $59, $53 +CreditsLine152: + ;CHESTS $$$$/160 + db $01, $3B, $85, $8A, $87, $95, $96, $95, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $7A, $7F, $79 +CreditsLine153: + ;OTHER $$$$/ 56 + db $01, $3B, $6B, $70, $64, $61, $6E, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $9F, $58, $59 +CreditsLine154: + ;OTHER $$$$/ 56 + db $01, $3B, $91, $96, $8A, $87, $94, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $9F, $7E, $7F +CreditsLine155: + ;TOTAL $$$$/216 + db $01, $3B, $70, $6B, $70, $5D, $68, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $55, $54, $59 +CreditsLine156: + ;TOTAL $$$$/216 + db $01, $3B, $96, $91, $96, $83, $8E, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $7B, $7A, $7F +CreditsLine157: + ;ITEM COMPLETION + db $08, $1D, $08, $13, $04, $0C, $9F, $02, $0E, $0C, $0F, $0B, $04, $13, $08, $0E, $0D +CreditsLine158: + ;Y ITEMS $$$$/ 26 + db $01, $3B, $75, $9F, $65, $70, $61, $69, $6F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $9F, $55, $59 +CreditsLine159: + ;Y ITEMS $$$$/ 26 + db $01, $3B, $9B, $9F, $8B, $96, $87, $8F, $95, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $9F, $7B, $7F +CreditsLine160: + ;A ITEMS $$$$/ 5 + db $01, $3B, $5D, $9F, $65, $70, $61, $69, $6F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $9F, $9F, $58 +CreditsLine161: + ;A ITEMS $$$$/ 5 + db $01, $3B, $83, $9F, $8B, $96, $87, $8F, $95, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $9F, $9F, $7E +CreditsLine162: + ;SWORDS $$$$/ 4 + db $01, $3B, $6F, $73, $6B, $6E, $60, $6F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $9F, $9F, $57 +CreditsLine163: + ;SWORDS $$$$/ 4 + db $01, $3B, $95, $99, $91, $94, $86, $95, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $9F, $9F, $7D +CreditsLine164: + ;SHIELDS $$$$/ 3 + db $01, $3B, $6F, $64, $65, $61, $68, $60, $6F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $9F, $9F, $56 +CreditsLine165: + ;SHIELDS $$$$/ 3 + db $01, $3B, $95, $8A, $8B, $87, $8E, $86, $95, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $9F, $9F, $7C +CreditsLine166: + ;MAILS $$$$/ 3 + db $01, $3B, $69, $5D, $65, $68, $6F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $9F, $9F, $56 +CreditsLine167: + ;MAILS $$$$/ 3 + db $01, $3B, $8F, $83, $8B, $8E, $95, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $9F, $9F, $7C +CreditsLine168: + ;CAPACITY UPGRADES $$$$/ 15 + db $01, $3B, $5F, $5D, $6C, $5D, $5F, $65, $70, $75, $9F, $71, $6C, $63, $6E, $5D, $60, $61, $6F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $9F, $54, $58 +CreditsLine169: + ;CAPACITY UPGRADES $$$$/ 15 + db $01, $3B, $85, $83, $92, $83, $85, $8B, $96, $9B, $9F, $97, $92, $89, $94, $83, $86, $87, $95, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $9F, $7A, $7E +CreditsLine170: + ;HEART PIECES $$$$/ 24 + db $01, $3B, $64, $61, $5D, $6E, $70, $9F, $6C, $65, $61, $5F, $61, $6F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $9F, $55, $57 +CreditsLine171: + ;HEART PIECES $$$$/ 24 + db $01, $3B, $8A, $87, $83, $94, $96, $9F, $92, $8B, $87, $85, $87, $95, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $9F, $7B, $7D +CreditsLine172: + ;HEART CONTAINERS $$$$/ 11 + db $01, $3B, $64, $61, $5D, $6E, $70, $9F, $5F, $6B, $6A, $70, $5D, $65, $6A, $61, $6E, $6F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $9F, $54, $54 +CreditsLine173: + ;HEART CONTAINERS $$$$/ 11 + db $01, $3B, $8A, $87, $83, $94, $96, $9F, $85, $91, $90, $96, $83, $8B, $90, $87, $94, $95, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $9F, $7A, $7A +CreditsLine174: + ;DUNGEON COMPLETION + db $07, $23, $3B, $4C, $45, $3E, $3C, $46, $45, $9F, $3A, $46, $44, $47, $43, $3C, $4B, $40, $46, $45 +CreditsLine175: + ;MAPS $$$$/ 12 + db $01, $3B, $69, $5D, $6C, $6F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $9F, $54, $55 +CreditsLine176: + ;MAPS $$$$/ 12 + db $01, $3B, $8F, $83, $92, $95, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $9F, $7A, $7B +CreditsLine177: + ;COMPASSES $$$$/ 11 + db $01, $3B, $5F, $6B, $69, $6C, $5D, $6F, $6F, $61, $6F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $9F, $54, $54 +CreditsLine178: + ;COMPASSES $$$$/ 11 + db $01, $3B, $85, $91, $8F, $92, $83, $95, $95, $87, $95, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $9F, $7A, $7A +CreditsLine179: + ;SMALL KEYS $$$$/ 61 + db $01, $3B, $6F, $69, $5D, $68, $68, $9F, $67, $61, $75, $6F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $9F, $59, $54 +CreditsLine180: + ;SMALL KEYS $$$$/ 61 + db $01, $3B, $95, $8F, $83, $8E, $8E, $9F, $8D, $87, $9B, $95, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $9F, $7F, $7A +CreditsLine181: + ;BIG KEYS $$$$/ 12 + db $01, $3B, $5E, $65, $63, $9F, $67, $61, $75, $6F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $9F, $54, $55 +CreditsLine182: + ;BIG KEYS $$$$/ 12 + db $01, $3B, $84, $8B, $89, $9F, $8D, $87, $9B, $95, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $9F, $7A, $7B +CreditsLine183: + ;BIG CHESTS $$$$/ 11 + db $01, $3B, $5E, $65, $63, $9F, $5F, $64, $61, $6F, $70, $6F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $9F, $54, $54 +CreditsLine184: + ;BIG CHESTS $$$$/ 11 + db $01, $3B, $84, $8B, $89, $9F, $85, $8A, $87, $95, $96, $95, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $9F, $7A, $7A +CreditsLine185: + ;PENDANTS $$$$/ 3 + db $01, $3B, $6C, $61, $6A, $60, $5D, $6A, $70, $6F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $9F, $9F, $56 +CreditsLine186: + ;PENDANTS $$$$/ 3 + db $01, $3B, $92, $87, $90, $86, $83, $90, $96, $95, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $9F, $9F, $7C +CreditsLine187: + ;CRYSTALS $$$$/ 7 + db $01, $3B, $5F, $6E, $75, $6F, $70, $5D, $68, $6F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $9F, $9F, $5A +CreditsLine188: + ;CRYSTALS $$$$/ 7 + db $01, $3B, $85, $94, $9B, $95, $96, $83, $8E, $95, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $9F, $9F, $80 +CreditsLine189: + ;BOSSES $$$$/ 13 + db $01, $3B, $5E, $6B, $6F, $6F, $61, $6F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $9F, $54, $56 +CreditsLine190: + ;BOSSES $$$$/ 13 + db $01, $3B, $84, $91, $95, $95, $87, $95, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $9F, $7A, $7C +CreditsLine191: + ;DUNGEON PERFORMANCE + db $06, $25, $1D, $2E, $27, $20, $1E, $28, $27, $9F, $29, $1E, $2B, $1F, $28, $2B, $26, $1A, $27, $1C, $1E +CreditsLine192: + ;HYRULE CASTLE $$$$/ 8 + db $01, $3B, $64, $75, $6E, $71, $68, $61, $9F, $5F, $5D, $6F, $70, $68, $61, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $9F, $9F, $5B +CreditsLine193: + ;HYRULE CASTLE $$$$/ 8 + db $01, $3B, $8A, $9B, $94, $97, $8E, $87, $9F, $85, $83, $95, $96, $8E, $87, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $9F, $9F, $81 +CreditsLine194: + ;EASTERN PALACE $$$$/ 6 + db $01, $3B, $61, $5D, $6F, $70, $61, $6E, $6A, $9F, $6C, $5D, $68, $5D, $5F, $61, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $9F, $9F, $59 +CreditsLine195: + ;EASTERN PALACE $$$$/ 6 + db $01, $3B, $87, $83, $95, $96, $87, $94, $90, $9F, $92, $83, $8E, $83, $85, $87, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $9F, $9F, $7F +CreditsLine196: + ;DESERT PALACE $$$$/ 6 + db $01, $3B, $60, $61, $6F, $61, $6E, $70, $9F, $6C, $5D, $68, $5D, $5F, $61, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $9F, $9F, $59 +CreditsLine197: + ;DESERT PALACE $$$$/ 6 + db $01, $3B, $86, $87, $95, $87, $94, $96, $9F, $92, $83, $8E, $83, $85, $87, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $9F, $9F, $7F +CreditsLine198: + ;TOWER OF HERA $$$$/ 5 + db $01, $3B, $70, $6B, $73, $61, $6E, $9F, $6B, $62, $9F, $64, $61, $6E, $5D, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $9F, $9F, $58 +CreditsLine199: + ;TOWER OF HERA $$$$/ 5 + db $01, $3B, $96, $91, $99, $87, $94, $9F, $91, $88, $9F, $8A, $87, $94, $83, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $9F, $9F, $7E +CreditsLine200: + ;AGAHNIM'S TOWER $$$$/ 2 + db $01, $3B, $5D, $63, $5D, $64, $6A, $65, $69, $77, $6F, $9F, $70, $6B, $73, $61, $6E, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $9F, $9F, $55 +CreditsLine201: + ;AGAHNIM'S TOWER $$$$/ 2 + db $01, $3B, $83, $89, $83, $8A, $90, $8B, $8F, $9D, $95, $9F, $96, $91, $99, $87, $94, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $9F, $9F, $7B +CreditsLine202: + ;PALACE OF DARKNESS $$$$/ 14 + db $01, $3B, $6C, $5D, $68, $5D, $5F, $61, $9F, $6B, $62, $9F, $60, $5D, $6E, $67, $6A, $61, $6F, $6F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $9F, $54, $57 +CreditsLine203: + ;PALACE OF DARKNESS $$$$/ 14 + db $01, $3B, $92, $83, $8E, $83, $85, $87, $9F, $91, $88, $9F, $86, $83, $94, $8D, $90, $87, $95, $95, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $9F, $7A, $7D +CreditsLine204: + ;SWAMP PALACE $$$$/ 10 + db $01, $3B, $6F, $73, $5D, $69, $6C, $9F, $6C, $5D, $68, $5D, $5F, $61, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $9F, $54, $53 +CreditsLine205: + ;SWAMP PALACE $$$$/ 10 + db $01, $3B, $95, $99, $83, $8F, $92, $9F, $92, $83, $8E, $83, $85, $87, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $9F, $7A, $79 +CreditsLine206: + ;SKULL WOODS $$$$/ 8 + db $01, $3B, $6F, $67, $71, $68, $68, $9F, $73, $6B, $6B, $60, $6F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $9F, $9F, $5B +CreditsLine207: + ;SKULL WOODS $$$$/ 8 + db $01, $3B, $95, $8D, $97, $8E, $8E, $9F, $99, $91, $91, $86, $95, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $9F, $9F, $81 +CreditsLine208: + ;THIEVES' TOWN $$$$/ 8 + db $01, $3B, $70, $64, $65, $61, $72, $61, $6F, $77, $9F, $70, $6B, $73, $6A, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $9F, $9F, $5B +CreditsLine209: + ;THIEVES' TOWN $$$$/ 8 + db $01, $3B, $96, $8A, $8B, $87, $98, $87, $95, $9D, $9F, $96, $91, $99, $90, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $9F, $9F, $81 +CreditsLine210: + ;ICE PALACE $$$$/ 8 + db $01, $3B, $65, $5F, $61, $9F, $6C, $5D, $68, $5D, $5F, $61, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $9F, $9F, $5B +CreditsLine211: + ;ICE PALACE $$$$/ 8 + db $01, $3B, $8B, $85, $87, $9F, $92, $83, $8E, $83, $85, $87, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $9F, $9F, $81 +CreditsLine212: + ;MISERY MIRE $$$$/ 8 + db $01, $3B, $69, $65, $6F, $61, $6E, $75, $9F, $69, $65, $6E, $61, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $9F, $9F, $5B +CreditsLine213: + ;MISERY MIRE $$$$/ 8 + db $01, $3B, $8F, $8B, $95, $87, $94, $9B, $9F, $8F, $8B, $94, $87, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $9F, $9F, $81 +CreditsLine214: + ;TURTLE ROCK $$$$/ 12 + db $01, $3B, $70, $71, $6E, $70, $68, $61, $9F, $6E, $6B, $5F, $67, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $9F, $54, $55 +CreditsLine215: + ;TURTLE ROCK $$$$/ 12 + db $01, $3B, $96, $97, $94, $96, $8E, $87, $9F, $94, $91, $85, $8D, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $9F, $7A, $7B +CreditsLine216: + ;GANON'S TOWER $$$$/ 27 + db $01, $3B, $63, $5D, $6A, $6B, $6A, $77, $6F, $9F, $70, $6B, $73, $61, $6E, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $9F, $55, $5A +CreditsLine217: + ;GANON'S TOWER $$$$/ 27 + db $01, $3B, $89, $83, $90, $91, $90, $9D, $95, $9F, $96, $91, $99, $87, $94, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $9F, $7B, $80 +CreditsLine218: + ;THE IMPORTANT STUFF + db $06, $25, $2D, $21, $1E, $9F, $22, $26, $29, $28, $2B, $2D, $1A, $27, $2D, $9F, $2C, $2D, $2E, $1F, $1F +CreditsLine219: + ;ITEMS PRE GANON KEY $$$$/ 22 + db $01, $3B, $65, $70, $61, $69, $6F, $9F, $6C, $6E, $61, $9F, $63, $5D, $6A, $6B, $6A, $9F, $67, $61, $75, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $9F, $55, $55 +CreditsLine220: + ;ITEMS PRE GANON KEY $$$$/ 22 + db $01, $3B, $8B, $96, $87, $8F, $95, $9F, $92, $94, $87, $9F, $89, $83, $90, $91, $90, $9F, $8D, $87, $9B, $9F, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $9F, $7B, $7B +CreditsLine221: + ;LEVEL 1 SWORD BOSSES $$$$/ 13 + db $01, $3B, $68, $61, $72, $61, $68, $9F, $54, $9F, $6F, $73, $6B, $6E, $60, $9F, $5E, $6B, $6F, $6F, $61, $6F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $9F, $54, $56 +CreditsLine222: + ;LEVEL 1 SWORD BOSSES $$$$/ 13 + db $01, $3B, $8E, $87, $98, $87, $8E, $9F, $7A, $9F, $95, $99, $91, $94, $86, $9F, $84, $91, $95, $95, $87, $95, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $9F, $7A, $7C +CreditsLine223: + ;LEVEL 2 SWORD BOSSES $$$$/ 13 + db $01, $3B, $68, $61, $72, $61, $68, $9F, $55, $9F, $6F, $73, $6B, $6E, $60, $9F, $5E, $6B, $6F, $6F, $61, $6F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $9F, $54, $56 +CreditsLine224: + ;LEVEL 2 SWORD BOSSES $$$$/ 13 + db $01, $3B, $8E, $87, $98, $87, $8E, $9F, $7B, $9F, $95, $99, $91, $94, $86, $9F, $84, $91, $95, $95, $87, $95, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $9F, $7A, $7C +CreditsLine225: + ;LEVEL 3 SWORD BOSSES $$$$/ 13 + db $01, $3B, $68, $61, $72, $61, $68, $9F, $56, $9F, $6F, $73, $6B, $6E, $60, $9F, $5E, $6B, $6F, $6F, $61, $6F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $9F, $54, $56 +CreditsLine226: + ;LEVEL 3 SWORD BOSSES $$$$/ 13 + db $01, $3B, $8E, $87, $98, $87, $8E, $9F, $7C, $9F, $95, $99, $91, $94, $86, $9F, $84, $91, $95, $95, $87, $95, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $9F, $7A, $7C +CreditsLine227: + ;LEVEL 4 SWORD BOSSES $$$$/ 13 + db $01, $3B, $68, $61, $72, $61, $68, $9F, $57, $9F, $6F, $73, $6B, $6E, $60, $9F, $5E, $6B, $6F, $6F, $61, $6F, $9F, $9F, $9F, $9F, $9F, $9F, $A2, $9F, $54, $56 +CreditsLine228: + ;LEVEL 4 SWORD BOSSES $$$$/ 13 + db $01, $3B, $8E, $87, $98, $87, $8E, $9F, $7D, $9F, $95, $99, $91, $94, $86, $9F, $84, $91, $95, $95, $87, $95, $9F, $9F, $9F, $9F, $9F, $9F, $C2, $9F, $7A, $7C +CreditsLine229: + ;LOCATIONS PRE BOOTS $$$$ + db $01, $25, $68, $6B, $5F, $5D, $70, $65, $6B, $6A, $6F, $9F, $6C, $6E, $61, $9F, $5E, $6B, $6B, $70, $6F +CreditsLine230: + ;LOCATIONS PRE BOOTS $$$$ + db $01, $25, $8E, $91, $85, $83, $96, $8B, $91, $90, $95, $9F, $92, $94, $87, $9F, $84, $91, $91, $96, $95 +CreditsLine231: + ;LOCATIONS PRE MIRROR $$$$ + db $01, $27, $68, $6B, $5F, $5D, $70, $65, $6B, $6A, $6F, $9F, $6C, $6E, $61, $9F, $69, $65, $6E, $6E, $6B, $6E +CreditsLine232: + ;LOCATIONS PRE MIRROR $$$$ + db $01, $27, $8E, $91, $85, $83, $96, $8B, $91, $90, $95, $9F, $92, $94, $87, $9F, $8F, $8B, $94, $94, $91, $94 +CreditsLine233: + ;NUMBER OF BONKS $$$$ + db $01, $1D, $6A, $71, $69, $5E, $61, $6E, $9F, $6B, $62, $9F, $5E, $6B, $6A, $67, $6F +CreditsLine234: + ;NUMBER OF BONKS $$$$ + db $01, $1D, $90, $97, $8F, $84, $87, $94, $9F, $91, $88, $9F, $84, $91, $90, $8D, $95 +CreditsLine235: + ;MIRROR USES OUTDOORS $$$$ + db $01, $27, $69, $65, $6E, $6E, $6B, $6E, $9F, $71, $6F, $61, $6F, $9F, $6B, $71, $70, $60, $6B, $6B, $6E, $6F +CreditsLine236: + ;MIRROR USES OUTDOORS $$$$ + db $01, $27, $8F, $8B, $94, $94, $91, $94, $9F, $97, $95, $87, $95, $9F, $91, $97, $96, $86, $91, $91, $94, $95 +CreditsLine237: + ;MIRROR USES IN DUNGEONS $$$$ + db $01, $2D, $69, $65, $6E, $6E, $6B, $6E, $9F, $71, $6F, $61, $6F, $9F, $65, $6A, $9F, $60, $71, $6A, $63, $61, $6B, $6A, $6F +CreditsLine238: + ;MIRROR USES IN DUNGEONS $$$$ + db $01, $2D, $8F, $8B, $94, $94, $91, $94, $9F, $97, $95, $87, $95, $9F, $8B, $90, $9F, $86, $97, $90, $89, $87, $91, $90, $95 +CreditsLine239: + ;TIMES FLUTED $$$$ + db $01, $17, $70, $65, $69, $61, $6F, $9F, $62, $68, $71, $70, $61, $60 +CreditsLine240: + ;TIMES FLUTED $$$$ + db $01, $17, $96, $8B, $8F, $87, $95, $9F, $88, $8E, $97, $96, $87, $86 +CreditsLine241: + ;SCREEN TRANSITIONS $$$$ + db $01, $23, $6F, $5F, $6E, $61, $61, $6A, $9F, $70, $6E, $5D, $6A, $6F, $65, $70, $65, $6B, $6A, $6F +CreditsLine242: + ;SCREEN TRANSITIONS $$$$ + db $01, $23, $95, $85, $94, $87, $87, $90, $9F, $96, $94, $83, $90, $95, $8B, $96, $8B, $91, $90, $95 +CreditsLine243: + ;TOTAL RUPEES COLLECTED $$$$ + db $01, $2B, $70, $6B, $70, $5D, $68, $9F, $6E, $71, $6C, $61, $61, $6F, $9F, $5F, $6B, $68, $68, $61, $5F, $70, $61, $60 +CreditsLine244: + ;TOTAL RUPEES COLLECTED $$$$ + db $01, $2B, $96, $91, $96, $83, $8E, $9F, $94, $97, $92, $87, $87, $95, $9F, $85, $91, $8E, $8E, $87, $85, $96, $87, $86 +CreditsLine245: + ;TOTAL RUPEES SPENT $$$$ + db $01, $23, $70, $6B, $70, $5D, $68, $9F, $6E, $71, $6C, $61, $61, $6F, $9F, $6F, $6C, $61, $6A, $70 +CreditsLine246: + ;TOTAL RUPEES SPENT $$$$ + db $01, $23, $96, $91, $96, $83, $8E, $9F, $94, $97, $92, $87, $87, $95, $9F, $95, $92, $87, $90, $96 +CreditsLine247: + ;SAVE AND QUITS $$$$ + db $01, $1B, $6F, $5D, $72, $61, $9F, $5D, $6A, $60, $9F, $6D, $71, $65, $70, $6F +CreditsLine248: + ;SAVE AND QUITS $$$$ + db $01, $1B, $95, $83, $98, $87, $9F, $83, $90, $86, $9F, $93, $97, $8B, $96, $95 +CreditsLine249: + ;DEATHS $$$$ + db $01, $0B, $60, $61, $5D, $70, $64, $6F +CreditsLine250: + ;DEATHS $$$$ + db $01, $0B, $86, $87, $83, $96, $8A, $95 +CreditsLine251: + ;TIME IN ITEM MENU $$$$$$$$$$$ + db $01, $21, $70, $65, $69, $61, $9F, $65, $6A, $9F, $65, $70, $61, $69, $9F, $69, $61, $6A, $71 +CreditsLine252: + ;TIME IN ITEM MENU $$$$$$$$$$$ + db $01, $21, $96, $8B, $8F, $87, $9F, $8B, $90, $9F, $8B, $96, $87, $8F, $9F, $8F, $87, $90, $97 +CreditsLine253: + ;TOTAL LAG TIME $$$$$$$$$$$ + db $01, $1B, $70, $6B, $70, $5D, $68, $9F, $68, $5D, $63, $9F, $70, $65, $69, $61 +CreditsLine254: + ;TOTAL LAG TIME $$$$$$$$$$$ + db $01, $1B, $96, $91, $96, $83, $8E, $9F, $8E, $83, $89, $9F, $96, $8B, $8F, $87 +CreditsLine255: + ;TOTAL TIME $$$$$$$$$$$ + db $04, $13, $70, $6B, $70, $5D, $68, $9F, $70, $65, $69, $61 +CreditsLine256: + ;TOTAL TIME $$$$$$$$$$$ + db $04, $13, $96, $91, $96, $83, $8E, $9F, $96, $8B, $8F, $87 +CreditsLine257: + ;(Blank line) + db $FF + +CreditsLineTable: + dw CreditsLine000, CreditsLine001, CreditsLine002, CreditsLine003, CreditsLine004, CreditsLine257, CreditsLine005, CreditsLine006 + dw CreditsLine007, CreditsLine257, CreditsLine008, CreditsLine009, CreditsLine010, CreditsLine257, CreditsLine011, CreditsLine012 + dw CreditsLine013, CreditsLine257, CreditsLine014, CreditsLine015, CreditsLine016, CreditsLine257, CreditsLine017, CreditsLine018 + dw CreditsLine257, CreditsLine019, CreditsLine001, CreditsLine020, CreditsLine021, CreditsLine022, CreditsLine257, CreditsLine023 + dw CreditsLine024, CreditsLine257, CreditsLine025, CreditsLine026, CreditsLine027, CreditsLine257, CreditsLine028, CreditsLine029 + dw CreditsLine257, CreditsLine030, CreditsLine031, CreditsLine032, CreditsLine257, CreditsLine033, CreditsLine034, CreditsLine035 + dw CreditsLine257, CreditsLine036, CreditsLine037, CreditsLine038, CreditsLine257, CreditsLine039, CreditsLine040, CreditsLine041 + dw CreditsLine257, CreditsLine042, CreditsLine043, CreditsLine257, CreditsLine044, CreditsLine045, CreditsLine257, CreditsLine046 + dw CreditsLine047, CreditsLine257, CreditsLine048, CreditsLine049, CreditsLine257, CreditsLine050, CreditsLine051, CreditsLine257 + dw CreditsLine052, CreditsLine053, CreditsLine257, CreditsLine054, CreditsLine055, CreditsLine257, CreditsLine056, CreditsLine057 + dw CreditsLine058, CreditsLine257, CreditsLine059, CreditsLine060, CreditsLine061, CreditsLine257, CreditsLine062, CreditsLine063 + dw CreditsLine257, CreditsLine064, CreditsLine065, CreditsLine066, CreditsLine257, CreditsLine067, CreditsLine068, CreditsLine257 + dw CreditsLine069, CreditsLine070, CreditsLine257, CreditsLine071, CreditsLine072, CreditsLine257, CreditsLine073, CreditsLine074 + dw CreditsLine257, CreditsLine075, CreditsLine076, CreditsLine077, CreditsLine257, CreditsLine078, CreditsLine079, CreditsLine257 + dw CreditsLine080, CreditsLine081, CreditsLine257, CreditsLine082, CreditsLine083, CreditsLine257, CreditsLine084, CreditsLine085 + dw CreditsLine257, CreditsLine086, CreditsLine087, CreditsLine257, CreditsLine088, CreditsLine001, CreditsLine089, CreditsLine090 + dw CreditsLine091, CreditsLine257, CreditsLine092, CreditsLine093, CreditsLine094, CreditsLine257, CreditsLine095, CreditsLine096 + dw CreditsLine257, CreditsLine097, CreditsLine098, CreditsLine099, CreditsLine257, CreditsLine100, CreditsLine101, CreditsLine257 + dw CreditsLine102, CreditsLine103, CreditsLine104, CreditsLine257, CreditsLine105, CreditsLine106, CreditsLine257, CreditsLine107 + dw CreditsLine108, CreditsLine257, CreditsLine109, CreditsLine110, CreditsLine257, CreditsLine111, CreditsLine112, CreditsLine257 + dw CreditsLine113, CreditsLine114, CreditsLine257, CreditsLine115, CreditsLine116, CreditsLine257, CreditsLine117, CreditsLine118 + dw CreditsLine257, CreditsLine119, CreditsLine120, CreditsLine257, CreditsLine121, CreditsLine122, CreditsLine257, CreditsLine123 + dw CreditsLine124, CreditsLine257, CreditsLine125, CreditsLine126, CreditsLine257, CreditsLine127, CreditsLine128, CreditsLine257 + dw CreditsLine129, CreditsLine130, CreditsLine257, CreditsLine131, CreditsLine132, CreditsLine257, CreditsLine133, CreditsLine134 + dw CreditsLine257, CreditsLine135, CreditsLine136, CreditsLine257, CreditsLine137, CreditsLine138, CreditsLine257, CreditsLine139 + dw CreditsLine140, CreditsLine257, CreditsLine141, CreditsLine142, CreditsLine257, CreditsLine143, CreditsLine144, CreditsLine257 + dw CreditsLine145, CreditsLine146, CreditsLine257, CreditsLine147, CreditsLine148, CreditsLine257, CreditsLine149, CreditsLine001 + dw CreditsLine150, CreditsLine151, CreditsLine152, CreditsLine257, CreditsLine153, CreditsLine154, CreditsLine257, CreditsLine155 + dw CreditsLine156, CreditsLine257, CreditsLine157, CreditsLine158, CreditsLine159, CreditsLine257, CreditsLine160, CreditsLine161 + dw CreditsLine257, CreditsLine162, CreditsLine163, CreditsLine257, CreditsLine164, CreditsLine165, CreditsLine257, CreditsLine166 + dw CreditsLine167, CreditsLine257, CreditsLine168, CreditsLine169, CreditsLine257, CreditsLine170, CreditsLine171, CreditsLine257 + dw CreditsLine172, CreditsLine173, CreditsLine257, CreditsLine174, CreditsLine175, CreditsLine176, CreditsLine257, CreditsLine177 + dw CreditsLine178, CreditsLine257, CreditsLine179, CreditsLine180, CreditsLine257, CreditsLine181, CreditsLine182, CreditsLine257 + dw CreditsLine183, CreditsLine184, CreditsLine257, CreditsLine185, CreditsLine186, CreditsLine257, CreditsLine187, CreditsLine188 + dw CreditsLine257, CreditsLine189, CreditsLine190, CreditsLine257, CreditsLine191, CreditsLine001, CreditsLine150, CreditsLine192 + dw CreditsLine193, CreditsLine257, CreditsLine194, CreditsLine195, CreditsLine257, CreditsLine196, CreditsLine197, CreditsLine257 + dw CreditsLine198, CreditsLine199, CreditsLine257, CreditsLine200, CreditsLine201, CreditsLine257, CreditsLine202, CreditsLine203 + dw CreditsLine257, CreditsLine204, CreditsLine205, CreditsLine257, CreditsLine206, CreditsLine207, CreditsLine257, CreditsLine208 + dw CreditsLine209, CreditsLine257, CreditsLine210, CreditsLine211, CreditsLine257, CreditsLine212, CreditsLine213, CreditsLine257 + dw CreditsLine214, CreditsLine215, CreditsLine257, CreditsLine216, CreditsLine217, CreditsLine257, CreditsLine218, CreditsLine219 + dw CreditsLine220, CreditsLine257, CreditsLine221, CreditsLine222, CreditsLine257, CreditsLine223, CreditsLine224, CreditsLine257 + dw CreditsLine225, CreditsLine226, CreditsLine257, CreditsLine227, CreditsLine228, CreditsLine257, CreditsLine229, CreditsLine230 + dw CreditsLine257, CreditsLine231, CreditsLine232, CreditsLine257, CreditsLine233, CreditsLine234, CreditsLine257, CreditsLine235 + dw CreditsLine236, CreditsLine257, CreditsLine237, CreditsLine238, CreditsLine257, CreditsLine239, CreditsLine240, CreditsLine257 + dw CreditsLine241, CreditsLine242, CreditsLine257, CreditsLine243, CreditsLine244, CreditsLine257, CreditsLine245, CreditsLine246 + dw CreditsLine257, CreditsLine247, CreditsLine248, CreditsLine257, CreditsLine249, CreditsLine250, CreditsLine257, CreditsLine251 + dw CreditsLine252, CreditsLine257, CreditsLine253, CreditsLine254, CreditsLine257, CreditsLine257, CreditsLine257, CreditsLine257 + dw CreditsLine257, CreditsLine257, CreditsLine257, CreditsLine001, CreditsLine001, CreditsLine001, CreditsLine001, CreditsLine001 + dw CreditsLine001, CreditsLine001, CreditsLine001, CreditsLine001, CreditsLine001, CreditsLine001, CreditsLine255, CreditsLine256 + +!CHESTS_X = 23 +!CHESTS_Y = 217 +!OTHER_X = 23 +!OTHER_Y = 220 +!TOTAL_X = 23 +!TOTAL_Y = 223 +!Y_ITEMS_X = 23 +!Y_ITEMS_Y = 227 +!A_ITEMS_X = 23 +!A_ITEMS_Y = 230 +!SWORDS_X = 23 +!SWORDS_Y = 233 +!SHIELDS_X = 23 +!SHIELDS_Y = 236 +!MAILS_X = 23 +!MAILS_Y = 239 +!CAPACITY_UPGRADES_X = 23 +!CAPACITY_UPGRADES_Y = 242 +!HEART_PIECES_X = 23 +!HEART_PIECES_Y = 245 +!HEART_CONTAINERS_X = 23 +!HEART_CONTAINERS_Y = 248 +!MAPS_X = 23 +!MAPS_Y = 252 +!COMPASSES_X = 23 +!COMPASSES_Y = 255 +!SMALL_KEYS_X = 23 +!SMALL_KEYS_Y = 258 +!BIG_KEYS_X = 23 +!BIG_KEYS_Y = 261 +!BIG_CHESTS_X = 23 +!BIG_CHESTS_Y = 264 +!PENDANTS_X = 23 +!PENDANTS_Y = 267 +!CRYSTALS_X = 23 +!CRYSTALS_Y = 270 +!BOSSES_X = 23 +!BOSSES_Y = 273 +!HYRULE_CASTLE_X = 23 +!HYRULE_CASTLE_Y = 279 +!EASTERN_PALACE_X = 23 +!EASTERN_PALACE_Y = 282 +!DESERT_PALACE_X = 23 +!DESERT_PALACE_Y = 285 +!TOWER_OF_HERA_X = 23 +!TOWER_OF_HERA_Y = 288 +!AGAHNIMS_TOWER_X = 23 +!AGAHNIMS_TOWER_Y = 291 +!PALACE_OF_DARKNESS_X = 23 +!PALACE_OF_DARKNESS_Y = 294 +!SWAMP_PALACE_X = 23 +!SWAMP_PALACE_Y = 297 +!SKULL_WOODS_X = 23 +!SKULL_WOODS_Y = 300 +!THIEVES_TOWN_X = 23 +!THIEVES_TOWN_Y = 303 +!ICE_PALACE_X = 23 +!ICE_PALACE_Y = 306 +!MISERY_MIRE_X = 23 +!MISERY_MIRE_Y = 309 +!TURTLE_ROCK_X = 23 +!TURTLE_ROCK_Y = 312 +!GANONS_TOWER_X = 23 +!GANONS_TOWER_Y = 315 +!ITEMS_PRE_GANON_KEY_X = 23 +!ITEMS_PRE_GANON_KEY_Y = 319 +!LEVEL_1_SWORD_BOSSES_X = 23 +!LEVEL_1_SWORD_BOSSES_Y = 322 +!LEVEL_2_SWORD_BOSSES_X = 23 +!LEVEL_2_SWORD_BOSSES_Y = 325 +!LEVEL_3_SWORD_BOSSES_X = 23 +!LEVEL_3_SWORD_BOSSES_Y = 328 +!LEVEL_4_SWORD_BOSSES_X = 23 +!LEVEL_4_SWORD_BOSSES_Y = 331 +!LOCATIONS_PRE_BOOTS_X = 27 +!LOCATIONS_PRE_BOOTS_Y = 334 +!LOCATIONS_PRE_MIRROR_X = 27 +!LOCATIONS_PRE_MIRROR_Y = 337 +!NUMBER_OF_BONKS_X = 27 +!NUMBER_OF_BONKS_Y = 340 +!MIRROR_USES_OUTDOORS_X = 27 +!MIRROR_USES_OUTDOORS_Y = 343 +!MIRROR_USES_IN_DUNGEONS_X = 27 +!MIRROR_USES_IN_DUNGEONS_Y = 346 +!TIMES_FLUTED_X = 27 +!TIMES_FLUTED_Y = 349 +!SCREEN_TRANSITIONS_X = 27 +!SCREEN_TRANSITIONS_Y = 352 +!TOTAL_RUPEES_COLLECTED_X = 27 +!TOTAL_RUPEES_COLLECTED_Y = 355 +!TOTAL_RUPEES_SPENT_X = 27 +!TOTAL_RUPEES_SPENT_Y = 358 +!SAVE_AND_QUITS_X = 27 +!SAVE_AND_QUITS_Y = 361 +!DEATHS_X = 27 +!DEATHS_Y = 364 +!TIME_IN_ITEM_MENU_X = 20 +!TIME_IN_ITEM_MENU_Y = 367 +!TOTAL_LAG_TIME_X = 20 +!TOTAL_LAG_TIME_Y = 370 +!TOTAL_TIME_X = 17 +!TOTAL_TIME_Y = 390 diff --git a/stats/font.gb b/stats/font.gb new file mode 100755 index 0000000000000000000000000000000000000000..a7cb4e7a30962d97343c6cc3458e7fca0b1a7a83 GIT binary patch literal 8192 zcmd^EeRNaTksr&FtQf@>E(yYMY}q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Esz26S#x1hE3H3n#=vS5{ zX#n4PkUEtCMUsB>_>Ug{!OG%aW&Lg}EjJ|%?}wN7`h%v3KWGbwAqdfEoBW3Q^&3i? z9E~cd*B+%+?v{J-jUK_bN7^Hih#3E6{N|_<2+(>GpIZM)zmE!oq=!aHwiRo~uj(f^ zHw!6O1=BI-Gg-yA6;8cx%Dq$EPAA@9gd{2S8#NYEJUErGcP;-XO{Ow*9y@0bNi3mw zKg~EfW3KA&+{TEe_Xt>r%n{>QYLxG598l&s+}y0R$SpF-C-OmX1$$km@y6w}Em0m& z@W6wQDi5C?BKj(F>hq^Q!avU;N@(Bomo{IJAG)b>dO@$V@PpVpUf9@R_w;72)ZR>Tpg2DK5CFMw9b;$#H zcV?!ik=!zrEDtFCf$EZ3c~dhdsq)i9z2U^~6%~8r%R~wy)-8D@yVH(-?v^B}q$Iy& zZb??|=khD^2^o!oy>=i{+vFW;|M)`wpT0!UE1B3|M@PGqt>|qXN|(|xN>7*ax5|qO z`D>RlI?Ddb+NSux@q=PVx2*X$Mb|e}|JLNJZ%I0av0*?N$MNWU^6X0r*^9{OWP57k z3;vu!b|ra7j6%wPD^4e^?>ou~d2Qeym4nL22=^aQ7z5Nlq<<2|<<9|>>8 + db + db <<4| + db <<5 + db $00 + dl
+endmacro + +macro StripeStart(xPos, length) + LDA $C8 + CLC + ADC.w # + XBA + STA $1002,x + + LDA.w #*2-1 + XBA + LDA #$0500 + STA $1004,x +endmacro + +macro StripeTile() + STA $1006,x + INX + INX +endmacro + +macro StripeEnd() + INX + INX + INX + INX +endmacro + +HexToDecStats: + PHA + PHA + LDA.w #$0000 + STA $7F5003 : STA $7F5005 : STA $7F5006 ; clear digit storage + PLA + - + CMP.w #10000 : !BLT + + PHA : SEP #$20 : LDA $7F5003 : INC : STA $7F5003 : REP #$20 : PLA + !SUB.w #10000 : BRA - + + - + CMP.w #1000 : !BLT + + PHA : SEP #$20 : LDA $7F5004 : INC : STA $7F5004 : REP #$20 : PLA + !SUB.w #1000 : BRA - + + - + CMP.w #100 : !BLT + + PHA : SEP #$20 : LDA $7F5005 : INC : STA $7F5005 : REP #$20 : PLA + !SUB.w #100 : BRA - + + - + CMP.w #10 : !BLT + + PHA : SEP #$20 : LDA $7F5006 : INC : STA $7F5006 : REP #$20 : PLA + !SUB.w #10 : BRA - + + - + CMP.w #1 : !BLT + + PHA : SEP #$20 : LDA $7F5007 : INC : STA $7F5007 : REP #$20 : PLA + !SUB.w #1 : BRA - + + + PLA +RTL + +LastHexDigit: + TYA + AND #$000F + PHA + TYA + LSR #4 + TAY + CLC + LDA !StatsBottom + BNE + + ; Upper half + PLA + ADC #$3D40 + RTS ++ ; Lower half + PLA + ADC #$3D50 + RTS + +FindLine: + LDY.w #$0000 + +- LDA.w CreditsStats,y + STZ !StatsBottom + CMP #$FFFF + BEQ .noLine + + XBA + AND #$01FF + CMP !LineNumber + BEQ .lineFound + + INC + INC !StatsBottom + CMP !LineNumber + BEQ .lineFound + + INY #8 + BRA - + +.lineFound + SEC + RTS + +.noLine + CLC + RTS + +!FRAMES_PER_SECOND = 60 +!FRAMES_PER_MINUTE = 60*60 +!FRAMES_PER_HOUR = 60*60*60 +!MAX_FRAME_COUNT = 59*60+59*60+59*60+99 + +macro CountUnits(framesPerUnit, unitCounter) + STZ +?loop: + LDA !ValueLow + SEC + SBC.w # + STA !Temp + LDA !ValueHigh + SBC.w #>>16 + BCC ?end + STA !ValueHigh + LDA !Temp + STA !ValueLow + INC + BRA ?loop +?end: +endmacro + +!ColonOffset = $83 +!PeriodOffset = $80 +!BlankTile = $883D + +RenderCreditsStatCounter: + PHB + PHK + PLB + + JSR FindLine + BCS + + BRL .endStats ++ + + ; XXXX X00L LLLL LLLL BBBB SSSS CCC- ---- ---- ---- AAAA AAAA AAAA AAAA AAAA AAAA + + ; == Determine stat type == + LDA CreditsStats,y ; LLLL LLLL XXXX XTTL + LSR + AND #$0003 ; TT + CMP.w #$0000 + BEQ .normalStat + BRL .timeStat + +.normalStat + ; == Write Stripe header (VRAM address, i.e. tile coordinates) == + LDA CreditsStats,y ; LLLL LLLL XXXX XTTL + LSR #3 + AND #$001F ; X XXXX + CLC + ADC $C8 + XBA + STA $1002,x + + ; == Write Stripe header (Length of data) == + LDA.w #4*2-1 ; 4 tiles = 8 bytes + XBA + STA $1004,x + PHX + + ; == Load tile base (upper or lower half of white two-line zero) == + LDA !StatsBottom + BNE + + LDA #$3D40 + BRA ++ ++ LDA #$3D50 +++ STA !Temp + + ; == Load the actual stat word == + LDA.w CreditsStats+5,y + STA.b !StatsPtr + LDA.w CreditsStats+6,y + STA.b !StatsPtr+1 + LDA.b [!StatsPtr] + STA !ValueLow + + ; == Shift value == + LDA CreditsStats+2,y; CCC- ---- BBBB SSSS + AND.w #$000F ; SSSS + BEQ + + TAX + LDA !ValueLow +- LSR + DEX + BNE - + STA !ValueLow ++ + ; == Mask value == + LDA CreditsStats+2,y; CCC- ---- BBBB SSSS + ;LSR #4 + ;AND.w #$000F ; BBBB + LSR #3 + AND.w #$001E + TAX + LDA BitMasks,x + AND !ValueLow + STA !ValueLow + + ; == Cap value == + LDA CreditsStats+3,y; ---- ---- CCC- ---- + LSR #5 + AND.w #$0007 ; CCC + BEQ + + ASL : TAX + LDA ValueCaps,x + CMP !ValueLow + !BGE + + STA !ValueLow ++ + ; == Display value == + LDA !ValueLow + JSL HexToDecStats + PLX + STZ !RemoveZero + + LDA $7F5004 + AND #$00FF + CMP !RemoveZero + BNE + + LDA !BlankTile + BRA ++ ++ DEC !RemoveZero + CLC + ADC !Temp +++ %StripeTile() + + LDA $7F5005 + AND #$00FF + CMP !RemoveZero + BNE + + LDA !BlankTile + BRA ++ ++ DEC !RemoveZero + CLC + ADC !Temp +++ %StripeTile() + + LDA $7F5006 + AND #$00FF + CMP !RemoveZero + BNE + + LDA !BlankTile + BRA ++ ++ DEC !RemoveZero + CLC + ADC !Temp +++ %StripeTile() + + LDA $7F5007 + AND #$00FF + CLC + ADC !Temp + %StripeTile() + + %StripeEnd() +.endStats + + ;JSR RenderLineNumber + + PLB + RTL + +.timeStat + ; Output format: HH:MM:SS.FF + + ; == Write Stripe header (VRAM address, i.e. tile coordinates) == + LDA CreditsStats,y ; LLLL LLLL XXXX XTTL + LSR #3 + AND #$001F ; X XXXX + CLC + ADC $C8 + XBA + STA $1002,x + + ; == Write Stripe header (Length of data) == + LDA.w #11*2-1 ; 11 tiles = 22 bytes + XBA + STA $1004,x + PHX + + ; == Load the actual stat words == + LDA.w CreditsStats+5,y + STA.b !StatsPtr + LDA.w CreditsStats+6,y + STA.b !StatsPtr+1 + LDA.b [!StatsPtr] + STA !ValueLow + INC !StatsPtr + INC !StatsPtr + LDA.b [!StatsPtr] + STA !ValueHigh + + CMP.w #!MAX_FRAME_COUNT>>16+1 + !BGE ++ + + ; == Convert total frames into hours, minutes, seconds and frames == + %CountUnits(!FRAMES_PER_HOUR, !Hours) + %CountUnits(!FRAMES_PER_MINUTE, !Minutes) + %CountUnits(!FRAMES_PER_SECOND, !Seconds) + + ; == Cap at 99:59:59.59 == + LDA !Hours + CMP.w #100 + !BLT + +++ LDA.w #99 + STA !Hours + LDA.w #59 + STA !Minutes + STA !Seconds + STA !ValueLow ++ + + ; == Load tile base (upper or lower half of white two-line zero) == + LDA !StatsBottom + BNE + + LDA #$3D40 + BRA ++ ++ LDA #$3D50 +++ STA !Temp + + PLX + + ; == Display value == + LDA !Hours + JSL HexToDecStats + + LDA $7F5006 + AND #$00FF + CLC + ADC !Temp + %StripeTile() + + LDA $7F5007 + AND #$00FF + CLC + ADC !Temp + %StripeTile() + + LDA.w #!ColonOffset + CLC + ADC !Temp + %StripeTile() + + LDA !Minutes + JSL HexToDecStats + LDA $7F5006 + AND #$00FF + CLC + ADC !Temp + %StripeTile() + + LDA $7F5007 + AND #$00FF + CLC + ADC !Temp + %StripeTile() + + LDA.w #!ColonOffset + CLC + ADC !Temp + %StripeTile() + + LDA !Seconds + JSL HexToDecStats + LDA $7F5006 + AND #$00FF + CLC + ADC !Temp + %StripeTile() + + LDA $7F5007 + AND #$00FF + CLC + ADC !Temp + %StripeTile() + + LDA.w #!PeriodOffset + CLC + ADC !Temp + %StripeTile() + + LDA !ValueLow + JSL HexToDecStats + LDA $7F5006 + AND #$00FF + CLC + ADC !Temp + %StripeTile() + + LDA $7F5007 + AND #$00FF + CLC + ADC !Temp + %StripeTile() + + %StripeEnd() + BRL .endStats + + +RenderLineNumber: + %StripeStart(0, 3) + + STZ !StatsBottom + LDA $CA + TAY + AND #$0001 + BEQ + + DEY + INC !StatsBottom ++ + JSR LastHexDigit + PHA + JSR LastHexDigit + PHA + JSR LastHexDigit + %StripeTile() + PLA + %StripeTile() + PLA + %StripeTile() + + %StripeEnd() + + RTS + +LoadModifiedFont: + ; Based on CopyFontToVram(Bank00) + ; copies font graphics to VRAM (for BG3) + + ; set name base table to vram $4000 (word) + LDA.b #$02 : STA $2101 + + ; increment on writes to $2119 + LDA.b #$80 : STA $2115 + + ; set bank of the source address (see below) + LDA.b #FontGfx>>16 : STA $02 + + REP #$30 + + ; vram target address is $7000 (word) + LDA.w #$7000 : STA $2116 + + ; $00[3] = $0E8000 (offset for the font data) + LDA.w #FontGfx : STA $00 + + ; going to write 0x1000 bytes (0x800 words) + LDX.w #FontGfxEnd-FontGfx/2-1 + +.nextWord + + ; read a word from the font data + LDA [$00] : STA $2118 + + ; increment source address by 2 + INC $00 : INC $00 + + DEX : BPL .nextWord + + SEP #$30 + + RTL + +CheckFontTable: + TAY + PHB + PHK + PLB + LDA.w FontTable,Y + PLB + RTL + +FontTable: + incbin stats/fonttable.bin + +CreditsStats: +incsrc stats/statConfig.asm +dw $FFFF + +org $0EE651 + JSL LoadModifiedFont + +org $0EE828 + JSL PreparePointer + LDA [!CreditsPtr],Y + NOP +org $0EE83F + LDA [!CreditsPtr],Y + NOP +org $0EE853 + LDA [!CreditsPtr],Y + NOP + AND.w #$00ff + ASL A + JSL CheckFontTable + +org $0ee86d + JSL RenderCreditsStatCounter + JMP.w AfterDeathCounterOutput + +org $0ee8fd + AfterDeathCounterOutput: \ No newline at end of file diff --git a/stats/statConfig.asm b/stats/statConfig.asm new file mode 100755 index 00000000..fe990cf5 --- /dev/null +++ b/stats/statConfig.asm @@ -0,0 +1,57 @@ +;(address, type, shiftRight, bits, digits, xPos, lineNumber) + +%AddStat($7EF442, 0, 0, 08, 3, !CHESTS_X, !CHESTS_Y) +%AddStat($7F503E, 0, 0, 06, 2, !OTHER_X, !OTHER_Y) +%AddStat($7EF423, 0, 0, 08, 3, !TOTAL_X, !TOTAL_Y) +%AddStat($7EF421, 0, 3, 05, 2, !Y_ITEMS_X, !Y_ITEMS_Y) +%AddStat($7EF421, 0, 0, 03, 1, !A_ITEMS_X, !A_ITEMS_Y) +%AddStat($7EF422, 0, 5, 03, 1, !SWORDS_X, !SWORDS_Y) +%AddStat($7EF422, 0, 3, 02, 1, !SHIELDS_X, !SHIELDS_Y) +%AddStat($7EF424, 0, 6, 02, 1, !MAILS_X, !MAILS_Y) +%AddStat($7EF452, 0, 0, 04, 2, !CAPACITY_UPGRADES_X, !CAPACITY_UPGRADES_Y) +%AddStat($7EF448, 0, 0, 05, 2, !HEART_PIECES_X, !HEART_PIECES_Y) +%AddStat($7EF429, 0, 4, 04, 2, !HEART_CONTAINERS_X, !HEART_CONTAINERS_Y) +%AddStat($7EF428, 0, 4, 04, 2, !MAPS_X, !MAPS_Y) +%AddStat($7EF428, 0, 0, 04, 2, !COMPASSES_X, !COMPASSES_Y) +%AddStat($7EF424, 0, 0, 06, 2, !SMALL_KEYS_X, !SMALL_KEYS_Y) +%AddStat($7EF427, 0, 4, 04, 2, !BIG_KEYS_X, !BIG_KEYS_Y) +%AddStat($7EF427, 0, 0, 04, 2, !BIG_CHESTS_X, !BIG_CHESTS_Y) +;%AddStat($7E0000, 0, 8, 16, 4, !DOORS_UNLOCKED_X, !DOORS_UNLOCKED_Y) +%AddStat($7EF429, 0, 0, 02, 1, !PENDANTS_X, !PENDANTS_Y) +%AddStat($7EF422, 0, 0, 03, 1, !CRYSTALS_X, !CRYSTALS_Y) +%AddStat($7F5037, 0, 0, 08, 2, !BOSSES_X, !BOSSES_Y) +%AddStat($7EF434, 0, 4, 04, 1, !HYRULE_CASTLE_X, !HYRULE_CASTLE_Y) +%AddStat($7EF436, 0, 0, 03, 1, !EASTERN_PALACE_X, !EASTERN_PALACE_Y) +%AddStat($7EF435, 0, 5, 03, 1, !DESERT_PALACE_X, !DESERT_PALACE_Y) +%AddStat($7EF435, 0, 2, 03, 1, !TOWER_OF_HERA_X, !TOWER_OF_HERA_Y) +%AddStat($7EF435, 0, 0, 02, 1, !AGAHNIMS_TOWER_X, !AGAHNIMS_TOWER_Y) +%AddStat($7EF434, 0, 0, 04, 2, !PALACE_OF_DARKNESS_X, !PALACE_OF_DARKNESS_Y) +%AddStat($7EF439, 0, 0, 04, 2, !SWAMP_PALACE_X, !SWAMP_PALACE_Y) + +;(address, type, shiftRight, bits, digits, xPos, lineNumber) + +%AddStat($7EF437, 0, 4, 04, 1, !SKULL_WOODS_X, !SKULL_WOODS_Y) +%AddStat($7EF437, 0, 0, 04, 1, !THIEVES_TOWN_X, !THIEVES_TOWN_Y) +%AddStat($7EF438, 0, 4, 04, 1, !ICE_PALACE_X, !ICE_PALACE_Y) +%AddStat($7EF438, 0, 0, 04, 1, !MISERY_MIRE_X, !MISERY_MIRE_Y) +%AddStat($7EF439, 0, 4, 04, 2, !TURTLE_ROCK_X, !TURTLE_ROCK_Y) +%AddStat($7EF436, 0, 3, 05, 2, !GANONS_TOWER_X, !GANONS_TOWER_Y) +%AddStat($7EF42A, 0, 0, 05, 2, !ITEMS_PRE_GANON_KEY_X, !ITEMS_PRE_GANON_KEY_Y) +%AddStat($7EF425, 0, 4, 04, 2, !LEVEL_1_SWORD_BOSSES_X, !LEVEL_1_SWORD_BOSSES_Y) +%AddStat($7EF425, 0, 0, 04, 2, !LEVEL_2_SWORD_BOSSES_X, !LEVEL_2_SWORD_BOSSES_Y) +%AddStat($7EF426, 0, 4, 04, 2, !LEVEL_3_SWORD_BOSSES_X, !LEVEL_3_SWORD_BOSSES_Y) +%AddStat($7EF426, 0, 0, 04, 2, !LEVEL_4_SWORD_BOSSES_X, !LEVEL_4_SWORD_BOSSES_Y) +%AddStat($7EF432, 0, 0, 08, 3, !LOCATIONS_PRE_BOOTS_X, !LOCATIONS_PRE_BOOTS_Y) +%AddStat($7EF433, 0, 0, 08, 3, !LOCATIONS_PRE_MIRROR_X, !LOCATIONS_PRE_MIRROR_Y) +%AddStat($7EF420, 0, 0, 08, 3, !NUMBER_OF_BONKS_X, !NUMBER_OF_BONKS_Y) +%AddStat($7EF43A, 0, 0, 08, 2, !MIRROR_USES_OUTDOORS_X, !MIRROR_USES_OUTDOORS_Y) +%AddStat($7EF43B, 0, 0, 08, 2, !MIRROR_USES_IN_DUNGEONS_X, !MIRROR_USES_IN_DUNGEONS_Y) +%AddStat($7EF44B, 0, 0, 08, 2, !TIMES_FLUTED_X, !TIMES_FLUTED_Y) +%AddStat($7EF43C, 0, 0, 16, 3, !SCREEN_TRANSITIONS_X, !SCREEN_TRANSITIONS_Y) +%AddStat($7F503C, 0, 0, 16, 5, !TOTAL_RUPEES_COLLECTED_X, !TOTAL_RUPEES_COLLECTED_Y) +%AddStat($7EF42B, 0, 0, 16, 5, !TOTAL_RUPEES_SPENT_X, !TOTAL_RUPEES_SPENT_Y) +%AddStat($7EF42D, 0, 0, 08, 2, !SAVE_AND_QUITS_X, !SAVE_AND_QUITS_Y) +%AddStat($7EF449, 0, 0, 08, 2, !DEATHS_X, !DEATHS_Y) +%AddStat($7EF444, 1, 8, 32, 4, !TIME_IN_ITEM_MENU_X, !TIME_IN_ITEM_MENU_Y) +%AddStat($7F5038, 1, 0, 32, 4, !TOTAL_LAG_TIME_X, !TOTAL_LAG_TIME_Y) +%AddStat($7EF43E, 1, 0, 32, 4, !TOTAL_TIME_X, !TOTAL_TIME_Y) \ No newline at end of file diff --git a/swordswap.asm b/swordswap.asm new file mode 100644 index 00000000..5f8eb3ce --- /dev/null +++ b/swordswap.asm @@ -0,0 +1,44 @@ +;================================================================================ +; Master / Tempered / Golden Sword Swap +;================================================================================ +;$03348E: smith sword check (to see if uprade-able) +;================================================================================ +GetFairySword: + CMP.b #$49 : BNE + : LDA.b #$00 : + ; convert single fighter sword to low id one + CMP.b #$50 : BNE + : LDA.b #$01 : + ; convert safe master sword to normal one + CMP #$04 : !BLT + : JMP.l PyramidFairy_BRANCH_IOTA : + ; for any sword, incl newer + JSL ItemCheck_FairySword : BEQ + : JMP.l PyramidFairy_BRANCH_IOTA : + ; skip if we already flagged getting this + JSL ItemSet_FairySword ; mark as got + LDA FairySword : STA $0DC0, X ; whichever sword + LDA.b #$05 : STA $0EB0, X ; something we overwrote, documentation unclear on purpose + +JMP.l PyramidFairy_BRANCH_GAMMA +;================================================================================ +;GetSmithSword: +; JSL ItemCheck_SmithSword : BEQ + : JMP.l Smithy_AlreadyGotSword : + ; check if we're not already done +; ;JSL ItemSet_SmithSword - too early +;JMP.l Smithy_DoesntHaveSword +;================================================================================ +LoadSwordForDamage: + LDA $7EF359 : CMP #$04 : BNE .done ; skip if not gold sword + LDA $1B : BEQ + ; skip if outdoors + LDA $A0 : CMP #41 : BNE + ; decimal 41 ; skip if not in the mothula room + LDA #$03 ; pretend we're using tempered + BRA .done + + + LDA #$04 ; nvm gold sword is fine + .done +RTL +;================================================================================ +GetSmithSword: + JSL ItemCheck_SmithSword : BEQ + : JMP.l Smithy_AlreadyGotSword : + + LDA.l SmithItemMode : BNE + + JMP.l Smithy_DoesntHaveSword ; Classic Smithy + + + LDA.l SmithItem : TAY + STZ $02E9 ; Item from NPC + PHX : JSL Link_ReceiveItem : PLX + REP #$20 : LDA $7EF360 : !SUB.w #$000A : STA $7EF360 : SEP #$20 ; Take 10 rupees + JSL ItemSet_SmithSword + JMP.l Smithy_AlreadyGotSword +;================================================================================ \ No newline at end of file diff --git a/tables.asm b/tables.asm new file mode 100644 index 00000000..70560739 --- /dev/null +++ b/tables.asm @@ -0,0 +1,1097 @@ +;================================================================================ +; Item Tables +;-------------------------------------------------------------------------------- +org $308000 ; bank #$30 ; PC 0x180000 +HeartPieceIndoorValues: +HeartPiece_Forest_Thieves: + db #$17 ; #$17 = Heart Piece +HeartPiece_Lumberjack_Tree: + db #$17 +HeartPiece_Spectacle_Cave: + db #$17 +HeartPiece_Circle_Bushes: + db #$61 +HeartPiece_Graveyard_Warp: + db #$17 +HeartPiece_Mire_Warp: + db #$17 +HeartPiece_Smith_Pegs: + db #$17 +;-------------------------------------------------------------------------------- +org $308010 ; PC 0x180010 +RupeeNPC_MoldormCave: + db #$46 ; #$46 = 300 Rupees +RupeeNPC_NortheastDarkSwampCave: + db #$46 +LibraryItem: + db #$1D ; #$1D = Book of Mudora +MushroomItem: + db #$29 ; #$29 = Mushroom +WitchItem: + db #$0D ; #$0D = Magic Powder +MagicBatItem: + db #$4E ; #$4E = Half Magic Item (Default) - #$FF = Use Original Logic - See "HalfMagic" Below +EtherItem: + db #$10 ; #$10 = Ether Medallion +BombosItem: + db #$0F ; #$0F = Bombos Medallion +;-------------------------------------------------------------------------------- +org $308020 ; PC 0x180020 +DiggingGameRNG: + db #$0F ; #$0F = 15 digs (default) (max ~30) +org $1DFD95 ; PC 0xEFD95 + db #$0F ; #$0F = 15 digs (default) (max ~30) +org $308021 ; PC 0x180021 +ChestGameRNG: +db #$00 ; #$00 = 2nd chest (default) - #$01 = 1st chest +;-------------------------------------------------------------------------------- +;0 = Bombos +;1 = Ether +;2 = Quake +org $308022 ; PC 0x180022 +MireRequiredMedallion: +db #$01 ; #$01 = Ether (default) + +org $308023 ; PC 0x180023 +TRockRequiredMedallion: +db #$02 ; #$02 = Quake (default) +;-------------------------------------------------------------------------------- +org $308024 ; PC 0x180024 +BigFairyHealth: +db #$A0 ; #$A0 = Refill Health (default) - #$00 = Don't Refill Health +BigFairyMagic: +db #$00 ; #$80 = Refill Magic - #$00 = Don't Refill Magic (default) +SpawnNPCHealth: +db #$A0 ; #$A0 = Refill Health (default) - #$00 = Don't Refill Health +SpawnNPCMagic: +db #$00 ; #$80 = Refill Magic - #$00 = Don't Refill Magic (default) +;-------------------------------------------------------------------------------- +org $308028 ; PC 0x180028 +FairySword: +db #$03 ; #$03 = Golden Sword (default) + +PedestalMusicCheck: +;org $08C435 ; <- 44435 - ancilla_receive_item.asm : 125 +;db #$01 ; #$01 = Master Sword (default) +org $0589B0 ; PC 0x289B0 ; sprite_master_sword.asm : 179 +PedestalSword: +db #$01 ; #$01 = Master Sword (default) + +org $308029 ; PC 0x180029 +SmithItemMode: +db #$01 ; #$00 = Classic Tempering Process - #$01 = Quick Item Get (default) +SmithItem: +db #$02 ; #$02 = Tempered Sword (default) + +;org $06B48E ; PC 0x3348E ; sprite_smithy_bros.asm : 473 +;SmithSwordCheck: +;db #$03 ; #$03 = Tempered Sword (default) ; THESE VALUES ARE +1 +org $06B55C ; PC 0x3355C ; sprite_smithy_bros.asm : 634 +SmithSword: +db #$02 ; #$02 = Tempered Sword (default) + +org $05EBD4 ; PC 0x2EBD4 - sprite_zelda.asm:23 - (LDA $7EF359 : CMP.b #$02 : BCS .hasMasterSword) - Zelda Spawnpoint Sword Check +db #$05 ; #$02 = Tempered Sword (default) - #$05 = All Swords +;-------------------------------------------------------------------------------- +org $308030 ; PC 0x180030 +EnableSRAMTrace: +db #$00 ; #$00 = Off (default) - #$01 = On +;-------------------------------------------------------------------------------- +org $308031 ; PC 0x180031 +EnableEasterEggs: +db #$00 ; #$00 = Off (default) - #$01 = On +;-------------------------------------------------------------------------------- +org $308032 ; PC 0x180032 +OpenMode: +db #$00 ; #$00 = Classic (default) - #$01 = Open +;-------------------------------------------------------------------------------- +org $308033 ; PC 0x180033 +HeartBeep: +db #$20 ; #$00 = Off - #$20 = Normal (default) - #$40 = Half Speed - #$80 = Quarter Speed +;-------------------------------------------------------------------------------- +org $308034 ; PC 0x180034 +StartingMaxBombs: +db #10 ; #10 = Default (10 decimal) +StartingMaxArrows: +db #30 ; #30 = Default (30 decimal) +;-------------------------------------------------------------------------------- +org $308036 ; PC 0x180036 +RupoorDeduction: +dw #$000A ; #$0A - Default (10 decimal) +;-------------------------------------------------------------------------------- +org $308038 ; PC 0x180038 +LampConeSewers: +db #$01 ; #$00 = Off - #$01 = On (default) +LampConeLightWorld: +db #$01 ; #$00 = Off - #$01 = On (default) +LampConeDarkWorld: +db #$00 ; #$00 = Off (default) - #$01 = On +;-------------------------------------------------------------------------------- +org $30803B ; PC 0x18003B +MapMode: +db #$00 ; #$00 = Always On (default) - #$01 = Require Map Item +CompassMode: +db #$01 ; #$00 = Off (default) - #$01 = Display Dungeon Count +;-------------------------------------------------------------------------------- +org $308080 ; PC 0x180080 +Upgrade5BombsRefill: +db #$00 +Upgrade10BombsRefill: +db #$00 +Upgrade5ArrowsRefill: +db #$00 +Upgrade10ArrowsRefill: +db #$00 +;-------------------------------------------------------------------------------- +org $308084 ; PC 0x180084 +PotionHealthRefill: +db #$08 ; #$A0 - Full Refill (Default) +PotionMagicRefill: +db #$08 ; #$80 - Full Refill (Default) +;-------------------------------------------------------------------------------- +org $308040 ; PC 0x180040 +UncleQuote: +db #$00 ; #$00 - #$1F +;-------------------------------------------------------------------------------- +org $098B7C ; PC 0x48B7C +EtherTablet: + db #$10 ; #$10 = Ether +org $08CAA9 ; PC 0x44AA9 + db #$10 ; #$10 = Ether + +org $098B81 ; PC 0x48B81 +BombosTablet: + db #$0F ; #$0F = Bombos +org $08CAAE ; PC 0x44AAE + db #$0F ; #$0F = Bombos +;-------------------------------------------------------------------------------- +org $05FBD2 ; PC 0x2FBD2 - sprite_mad_batter.asm:209 - (#$01) +HalfMagic: +db $01 ; #$01 = 1/2 Magic (default) - #$02 = 1/4 Magic +;-------------------------------------------------------------------------------- +org $07ADA7 ; PC 0x3ADA7 - Bank07.asm:7216 - (db 4, 8, 8) +CapeMagicUse: +db $04, $08, $10 ; change to db $04, $08, $08 for original cape behavior +;-------------------------------------------------------------------------------- +;Dungeon Music +;org $02D592 ; PC 0x15592 +;11 - Pendant Dungeon +;16 - Crystal Dungeon + +org $02D592+$08 +Music_Eastern: +db $11 + +org $02D592+$09 +Music_Desert: +db $11, $11, $11, $11 + +org $02D592+$33 +Music_Hera: +db $11 +org $02907A ; 0x1107A - Bank02.asm:3089 (#$11) +Music_Hera2: +db $11 +org $028B8C ; 0x10B8C - Bank02.asm:2231 (#$11) +Music_Hera3: +db $11 + +org $02D592+$26 +Music_Darkness: +db $16 + +org $02D592+$25 +Music_Swamp: +db $16 + +org $02D592+$28 +Music_Skull: +db $16, $16, $16, $16 + +org $02D592+$76 +Music_Skul_Drop: +db $16, $16, $16, $16 + +org $02D592+$34 +Music_Thieves: +db $16 + +org $02D592+$2D +Music_Ice: +db $16 + +org $02D592+$27 +Music_Mire: +db $16 + +org $02D592+$35 +Music_TRock: +db $16 +org $02D592+$15 +Music_TRock2: +db $16 +org $02D592+$18 +Music_TRock3: +db $16, $16 + +org $02D592+$37 +Music_GTower: +db $16 +;-------------------------------------------------------------------------------- +; THIS ENTIRE TABLE IS DEPRECATED +;Map Crystal Locations +;org $0AC5B8 ; PC 0x545B8 +;PendantLoc_Eastern: ; Green/Courage/Eastern Palace +;db $04 ; 04 +;PendantLoc_Hera: ; Red/Wisdom/Hera +;db $01 ; 01 +;PendantLoc_Desert: ; Blue/Power/Desert +;db $02 ; 02 +; +;org $0AC5D1 ; PC 0x545D1 +;CrystalLoc_Darkness: +;db $02 +;CrystalLoc_Skull: +;db $40 ; 40 +;CrystalLoc_TRock: +;db $08 ; 08 +;CrystalLoc_Thieves: +;db $20 +;CrystalLoc_Mire: +;db $01 +;CrystalLoc_Ice: +;db $04 +;CrystalLoc_Swamp: +;db $10 +; +;Pendant 1: $04 +;Pendant 2: $02 +;Pendant 3: $01 +;Crystal 1: $02 +;Crystal 2: $10 +;Crystal 3: $40 +;Crystal 4: $20 +;Crystal 5: $04 +;Crystal 6: $01 +;Crystal 7: $08 +;-------------------------------------------------------------------------------- +;Map Pendant / Crystal Indicators + +org $0ABF2E ; PC 0x53F02 +dw $0100 ; #$6234 - Master Sword + +org $0ABEF8 ; PC 0x53EF8 +MapObject_Eastern: +dw $6038 ; #$6038 - Green Pendant / Courage + +org $0ABF1C ; PC 0x53F1C +MapObject_Desert: +dw $6034 ; #$6034 - Blue Pendant / Power + +org $0ABF0A ; PC 0x53F0A +MapObject_Hera: +dw $6032 ; #$6032 - Red Pendant / Wisdom + +org $0ABF00 ; PC 0x53F00 +MapObject_Darkness: +dw $6434 ; #6434 - Crystal + +org $0ABF6C ; PC 0x53F6C +MapObject_Swamp: +dw $6434 ; #6434 - Crystal + +org $0ABF12 ; PC 0x53F12 +MapObject_Skull: +dw $6434 ; #6434 - Crystal + +org $0ABF36 ; PC 0x53F36 +MapObject_Thieves: +dw $6434 ; #6434 - Crystal + +org $0ABF5A ; PC 0x53F5A +MapObject_Ice: +dw $6434 ; #6434 - Crystal + +org $0ABF48 ; PC 0x53F48 +MapObject_Mire: +dw $6434 ; #6434 - Crystal + +org $0ABF24 ; PC 0x53F24 +MapObject_TRock: +dw $6434 ; #6434 - Crystal + +;-------------------------------------------------------------------------------- +org $308070 ; PC 0x180070 +CrystalNumberTable: +db $00 ; +db $79 ; Swamp +db $00 ; +db $6E ; Ice +db $00 ; +db $6F ; Mire +db $00 ; +db $6D ; Thieves +db $69 ; Desert +db $7C ; TRock +db $69 ; Hera +db $6C ; Skull +db $69 ; Eastern +db $7F ; Darkness +db $00 ; +db $00 ; +; Values are as the table below. +;-------------------------------------------------------------------------------- +; THIS ENTIRE TABLE IS DEPRECATED +;org $0AC52D ; PC 0x5452D +;CrystalNum_Darkness: +;db $7F +; +;org $0AC527 ; PC 0x54527 +;CrystalNum_Swamp: +;db $79 +; +;org $0AC52C ; PC 0x5452C +;CrystalNum_Skull: +;db $6C ; 6C +; +;org $0AC52A ; PC 0x5452A +;CrystalNum_Thieves: +;db $6D +; +;org $0AC528 ; PC 0x54528 +;CrystalNum_Ice: +;db $6E +; +;org $0AC529 ; PC 0x54529 +;CrystalNum_Mire: +;db $6F +; +;org $0AC52B ; PC 0x5452B +;CrystalNum_TRock: +;db $7C ; 7C + +;1 Indicator : 7F +;2 Indicator : 79 +;3 Indicator : 6C +;4 Indicator : 6D +;5 Indicator : 6E +;6 Indicator : 6F +;7 Indicator : 7C +;8 Indicator : 7D +;9 Indicator : 7E + +;Dark Red X : 69 +;Light Red X : 78 +;White X : 68 + +;Pendant UL : 60 +;Pendant UR : 61 +;Pendant BL : 70 +;Pendant BR : 71 + +;Sword UL : 62 +;Sword UR : 63 +;Sword BL : 72 +;Sword BR : 73 + +;Crystal UL : 64 +;Crystal UR : 65 +;Crystal BL : 74 +;Crystal BR : 75 + +;Skull UL : 66 +;Skull UR : 67 +;Skull BL : 76 +;Skull BR : 77 + +;Warp UL : 6A +;Warp UR : 6B +;Warp BL : 7A +;Warp BR : 7B +;-------------------------------------------------------------------------------- +org $02A09B ; PC 0x1209B - Bank02.asm:5802 - (pool MilestoneItem_Flags:) +CrystalPendantFlags: + db $00 ; Sewers + db $00 ; Hyrule Castle + db $04 ; Eastern Palace + db $02 ; Desert Palace + db $00 ; Agahnim's Tower + db $10 ; Swamp Palace + db $02 ; Palace of Darkness + db $01 ; Misery Mire + db $40 ; Skull Woods + db $04 ; Ice Palace +.hera + db $01 ; Tower of Hera + db $20 ; Thieves' Town + db $08 ; Turtle Rock +;Pendant 1: $04 +;Pendant 2: $02 +;Pendant 3: $01 +;Crystal 1: $02 +;Crystal 2: $10 +;Crystal 3: $40 +;Crystal 4: $20 +;Crystal 5: $04 +;Crystal 6: $01 +;Crystal 7: $08 +;-------------------------------------------------------------------------------- +org $308050 ; PC 0x180050 +CrystalPendantFlags_2: + db $00 ; Sewers + db $00 ; Hyrule Castle + db $00 ; Eastern Palace + db $00 ; Desert Palace + db $00 ; Agahnim's Tower + db $40 ; Swamp Palace + db $40 ; Palace of Darkness + db $40 ; Misery Mire + db $40 ; Skull Woods + db $40 ; Ice Palace +.hera + db $00 ; Tower of Hera + db $40 ; Thieves' Town + db $40 ; Turtle Rock +;Pendant: $00 +;Crystal: $40 +;Dungeons with no drops should match their respective world's normal vanilla prize ;xxx +;-------------------------------------------------------------------------------- +org $01C6FC ; PC 0xC6FC - Bank01.asm:10344 - (db $00, $00, $01, $02, $00, $06, $06, $06, $06, $06, $03, $06, $06) + db $00 ; Sewers + db $00 ; Hyrule Castle + db $01 ; Eastern Palace + db $02 ; Desert Palace + db $00 ; Agahnim's Tower + db $06 ; Swamp Palace + db $06 ; Palace of Darkness + db $06 ; Misery Mire + db $06 ; Skull Woods + db $06 ; Ice Palace + db $03 ; Tower of Hera + db $06 ; Thieves' Town + db $06 ; Turtle Rock +;Ether/Nothing: $00 +;Green Pendant: $01 +;Blue Pendant: $02 +;Red Pendant: $03 +;Heart Container: $04 +;Bombos: $05 +;Crystal: $06 +;-------------------------------------------------------------------------------- +org $02885E ; PC 0x1085E - Bank02.asm:1606 - (dw $0006, $005A, $0029, $0090, $00DE, $00A4, $00AC, $000D) ; DEPRECATED - DISCONTINUE USE +dw $0006 ; Crystal 2 Location +dw $005A ; Crystal 1 Location +dw $0029 ; Crystal 3 Location +dw $0090 ; Crystal 6 Location +dw $00DE ; Crystal 5 Location +dw $00A4 ; Crystal 7 Location +dw $00AC ; Crystal 4 Location ; AC +dw $000D ; Agahnim II Location ; 0D + +;C8 = Armos Room +;33 = Lanmolas Room +;07 = Moldorm Room + +;06 = Arrghus Room +;5A = Helmasaur Room +;29 = Mothula Room +;90 = Viterous Room +;DE = Kholdstare Room +;A4 = Trinexx Room +;AC = Blind Room +;0D = Agahnim 2 Room +;-------------------------------------------------------------------------------- +;org $098B7D ; PC 0x48B7D - ancilla_init.asm:1630 - (db $37, $39, $38) ; DEPRECATED - DISCONTINUE USE +;PendantEastern: +;db #$37 +;PendantDesert: +;db #$39 +;PendantHera: +;db #$38 + +;37:Pendant 1 Green / Courage +;38:Pendant 3 Red / Wisdom +;39:Pendant 2 Blue / Power +;-------------------------------------------------------------------------------- +org $07B51D ; PC 0x3B51D +BlueBoomerangSubstitution: +db #$FF ; no substitution +org $07B53B ; PC 0x3B53B +RedBoomerangSubstitution: +db #$FF ; no substitution +;-------------------------------------------------------------------------------- +org $308060 ; PC 0x180060 +ProgrammableItemLogicJump_1: +JSL.l $000000 : RTL +ProgrammableItemLogicJump_2: +JSL.l $000000 : RTL +ProgrammableItemLogicJump_3: +JSL.l $000000 : RTL +;-------------------------------------------------------------------------------- +org $308061 ; PC 0x180061 +ProgrammableItemLogicPointer_1: +dl #$000000 +org $308066 ; PC 0x180066 +ProgrammableItemLogicPointer_2: +dl #$000000 +org $30806B ; PC 0x18006B +ProgrammableItemLogicPointer_3: +dl #$000000 +;-------------------------------------------------------------------------------- +org $3080A0 ; PC 0x1800A0 +Bugfix_MirrorlessSQToLW: +db #$01 ; #$00 = Original Behavior - #$01 = Randomizer Behavior (Default) +Bugfix_SwampWaterLevel: +db #$01 ; #$00 = Original Behavior - #$01 = Randomizer Behavior (Default) +Bugfix_PreAgaDWDungeonDeathToFakeDW: +db #$01 ; #$00 = Original Behavior - #$01 = Randomizer Behavior (Default) +;-------------------------------------------------------------------------------- +;org $08D01A ; PC 0x4501A - ancilla_flute.asm - 42 +;OldHauntedGroveItem: +; db #$14 ; #$14 = Flute +;-------------------------------------------------------------------------------- +;2B:Bottle Already Filled w/ Red Potion +;2C:Bottle Already Filled w/ Green Potion +;2D:Bottle Already Filled w/ Blue Potion +;3C:Bottle Already Filled w/ Bee +;3D:Bottle Already Filled w/ Fairy +;48:Bottle Already Filled w/ Gold Bee +org $06C8FF ; PC 0x348FF +WaterfallPotion: ; <-------------------------- FAIRY POTION STUFF HERE + db #$2C ; #$2C = Green Potion +org $06C93B ; PC 0x3493B +PyramidPotion: + db #$2C ; #$2C = Green Potion +;-------------------------------------------------------------------------------- +org $308140 ; PC 0x180140 +HeartPieceOutdoorValues: +HeartPiece_Spectacle: + db #$17 +HeartPiece_Mountain_Warp: + db #$17 +HeartPiece_Maze: + db #$17 +HeartPiece_Desert: + db #$17 +HeartPiece_Lake: + db #$17 +HeartPiece_Swamp: + db #$17 +HeartPiece_Cliffside: + db #$17 +HeartPiece_Pyramid: + db #$17 +HeartPiece_Digging: + db #$17 +HeartPiece_Zora: + db #$17 +HauntedGroveItem: + db #$14 ; #$14 = Flute +;================================================================================ +org $308150 ; PC 0x180150 +HeartContainerBossValues: +HeartContainer_ArmosKnights: + db #$3E ; #$3E = Boss Heart (putting pendants here cause main pendant to not drop for obvious (in retrospect) reasons) +HeartContainer_Lanmolas: + db #$3E +HeartContainer_Moldorm: + db #$3E +HeartContainer_HelmasaurKing: + db #$3E +HeartContainer_Arrghus: + db #$3E +HeartContainer_Mothula: + db #$3E +HeartContainer_Blind: + db #$3E +HeartContainer_Kholdstare: + db #$3E +HeartContainer_Vitreous: + db #$3E +HeartContainer_Trinexx: + db #$3E +;================================================================================ +org $308160 ; PC 0x180160 +BonkKey_Desert: + db #$24 ; #$24 = Small Key (default) +BonkKey_GTower: + db #$24 ; #$24 = Small Key (default) +StandingKey_Hera: + db #$24 ; #$24 = Small Key (default) +;================================================================================ +org $308165 ; PC 0x180165 +GoalItemIcon: +dw #$280D ; #280D = Star (default) - #$280E = Triforce Piece +;================================================================================ +org $308167 ; PC 0x180167 +GoalItemRequirement: +db #$00 ; #00 = Off (default) - #$XX = Require $XX Goal Items +;================================================================================ +org $308168 ; PC 0x180168 +ByrnaCaveSpikeDamage: +db #$08 ; #08 = 1 Heart (default) - #$02 = 1/4 Heart +;================================================================================ +org $308190 ; PC 0x180190 +TimerStyle: +db #$00 ; #$00 = Off (Default) - #$01 Countdown - #$02 = Stopwatch +TimeoutBehavior: +db #$00 ; #$00 = DNF (Default) - #$01 = Sign Change (Requires TimerRestart == 1) - #$02 = OHKO +TimerRestart: +db #$00 ; #$00 = Locked (Default) - #$01 = Restart +;================================================================================ +org $308200 ; PC 0x180200 +RedClockAmount: +dw #$4650, #$0000 ; $00004650 = +5 minutes +BlueClockAmount: +dw #$B9B0, #$FFFF ; $FFFFB9B0 = -5 minutes +GreenClockAmount: +dw #$0000, #$0000 +StartingTime: +dw #$4650, #$0000 ; #$A5E0, #$0001 = 30 minutes +;================================================================================ +org $09E3BB ; PC 0x4E3BB +db $EB ; Hera Big Key (Set to programmable HP $EB) (set to $E4 for original hookable/boomable key behavior) +;================================================================================ +org $308210 ; PC 0x180210 +RandomizerSeedType: +db #$00 ; #$00 = Casual (default) - #$01 = Glitched - #$02 = Speedrunner - #$FF = Not Randomizer +;-------------------------------------------------------------------------------- +org $308211 ; PC 0x180211 +GameType: +db #$00 ; #$00 = Randomizer (default) - #$01 = Plandomizer - #$FF = Other Editors +;-------------------------------------------------------------------------------- +;dgGe mutT +;d - Nonstandard Dungeon Configuration (Not Map/Compass/BigKey/SmallKeys in same quantity as vanilla) +;g - Requires Minor Glitches (Fake flippers, bomb jumps, etc) +;G - Requires Major Glitches (OW YBA/Clips, etc) +;e - Requires EG +; +;m - Contains Multiples of Major Items +;u - Contains Unreachable Items +;t - Minor Trolling (Swapped around levers, etc) +;T - Major Trolling (Forced-guess softlocks, impossible seed, etc) +org $308212 ; PC 0x180212 +WarningFlags: +db #$00 +;-------------------------------------------------------------------------------- +org $308213 ; PC 0x180213 +TournamentSeed: +db #$00 ; #$00 = Off (default) - #$01 = On +TournamentSeedInverse: +db #$01 ; #$00 = On - #$01 = Off (Default) +;================================================================================ +; $308220 (0x180220) - $30823F (0x18023F) +; Plandomizer Author Name (ASCII) - Leave unused chars as 0 +org $308220 ; PC 0x180220 +;================================================================================ +; $308300 (0x180300) - $3083FF (0x1803FF) +; MS Pedestal Text (ALTTP JP Text Format) +org $308300 ; PC 0x180300 +MSPedestalText: +db $00, $c0, $00, $ae, $00, $d8, $00, $bb, $00, $ae, $00, $ff, $00, $b8, $00, $be, $00, $bd, $00, $ff, $00, $b8, $00, $af +db $75, $00, $c0, $00, $ae, $00, $ae, $00, $bd, $00, $aa, $00, $ab, $00, $b2, $00, $c1, $00, $cD, $00, $ff, $00, $bd, $00, $b8 +db $76, $00, $bd, $00, $b1, $00, $ae, $00, $ff, $00, $bc, $00, $bd, $00, $b8, $00, $bb, $00, $ae, $00, $c7 +db $7f, $7f +;-------------------------------------------------------------------------------- +; $308400 (0x180400) - $3084FF (0x1804FF) +; Triforce Text (ALTTP JP Text Format) +org $308400 ; PC 0x180400 +TriforceText: +db $74, $75, $00, $FF, $00, $FF, $00, $FF, $00, $FF, $00, $FF, $00, $B0, $00, $FF, $00, $B0, $7F +;-------------------------------------------------------------------------------- +; $308500 (0x180500) - $3085FF (0x1805FF) +; Uncle Text (ALTTP JP Text Format) +org $308500 ; PC 0x180500 +UncleText: +db $00, $c0, $00, $ae, $00, $d8, $00, $bb, $00, $ae, $00, $ff, $00, $b8, $00, $be, $00, $bd, $00, $ff, $00, $b8, $00, $af +db $75, $00, $c0, $00, $ae, $00, $ae, $00, $bd, $00, $aa, $00, $ab, $00, $b2, $00, $c1, $00, $cD, $00, $ff, $00, $bd, $00, $b8 +db $76, $00, $bd, $00, $b1, $00, $ae, $00, $ff, $00, $bc, $00, $bd, $00, $b8, $00, $bb, $00, $ae, $00, $c7 +db $7f, $7f +;-------------------------------------------------------------------------------- +; $308600 (0x180600) - $3086FF (0x1806FF) +; Ganon Text 1 (ALTTP JP Text Format) +org $308600 ; PC 0x180600 +GanonText1: +db $00, $c0, $00, $ae, $00, $d8, $00, $bb, $00, $ae, $00, $ff, $00, $b8, $00, $be, $00, $bd, $00, $ff, $00, $b8, $00, $af +db $75, $00, $c0, $00, $ae, $00, $ae, $00, $bd, $00, $aa, $00, $ab, $00, $b2, $00, $c1, $00, $cD, $00, $ff, $00, $bd, $00, $b8 +db $76, $00, $bd, $00, $b1, $00, $ae, $00, $ff, $00, $bc, $00, $bd, $00, $b8, $00, $bb, $00, $ae, $00, $c7 +db $7f, $7f +;-------------------------------------------------------------------------------- +; $308700 (0x180700) - $3087FF (0x1807FF) +; Ganon Text 2 (ALTTP JP Text Format) +org $308700 ; PC 0x180700 +GanonText2: +db $00, $c2, $00, $b8, $00, $be, $00, $d8, $00, $bb, $00, $ae, $00, $ff, $00, $b0, $00, $b8, $00, $b2, $00, $b7, $00, $b0 +db $75, $00, $bd, $00, $b8, $00, $ff, $00, $b1, $00, $aa, $00, $bf, $00, $ae, $00, $ff, $00, $aa, $00, $ff, $00, $bf, $00, $ae, $00, $bb, $00, $c2 +db $76, $00, $ab, $00, $aa, $00, $ad, $00, $ff, $00, $bd, $00, $b2, $00, $b6, $00, $ae, $00, $cD +db $7f, $7f +;-------------------------------------------------------------------------------- +; $308800 (0x180800) - $3088FF (0x1808FF) +; Blind Text +org $308800 ; PC 0x180800 +BlindText: +db $75, $00, $cE, $00, $a6, $00, $a9, $00, $ff, $00, $ab, $00, $b5, $00, $aa, $00, $c3, $00, $ae, $00, $ff, $00, $b2, $00, $bd, $00, $c7, $00, $cE +db $7f, $7f +;-------------------------------------------------------------------------------- +; $308900 (0x180900) - $3089FF (0x1809FF) +; Fat Fairy Text +org $308900 ; PC 0x180900 +FatFairyText: +db $00, $b1, $00, $ae, $00, $c2, $00, $c7 +db $76, $00, $b5, $00, $b2, $00, $bc, $00, $bd, $00, $ae, $00, $b7, $00, $c7 +db $7f, $7f +;-------------------------------------------------------------------------------- +; $308A00 (0x180A00) - $308AFF (0x180AFF) +; SahasrahlaNoPendantText +org $308A00 ; PC 0x180A00 +SahasrahlaNoPendantText: +; Want something|for free? Tell|you what…|bring me the|green pendant. +db $74, $00, $C0, $00, $AA, $00, $B7, $00, $BD, $00, $FF, $00, $BC, $00, $B8, $00, $B6, $00, $AE, $00, $BD, $00, $B1, $00, $B2, $00, $B7, $00, $B0, $75, $00, $AF, $00, $B8, $00, $BB, $00, $FF, $00, $AF, $00, $BB, $00, $AE, $00, $AE, $00, $C6, $00, $FF, $00, $BD, $00, $AE, $00, $B5, $00, $B5, $76, $00, $C2, $00, $B8, $00, $BE, $00, $FF, $00, $C0, $00, $B1, $00, $AA, $00, $BD, $00, $CC, $7E, $73, $76, $00, $AB, $00, $BB, $00, $B2, $00, $B7, $00, $B0, $00, $FF, $00, $B6, $00, $AE, $00, $FF, $00, $BD, $00, $B1, $00, $AE, $73, $76, $00, $B0, $00, $BB, $00, $AE, $00, $AE, $00, $B7, $00, $FF, $00, $B9, $00, $AE, $00, $B7, $00, $AD, $00, $AA, $00, $B7, $00, $BD, $00, $CD +db $7f, $7f +;-------------------------------------------------------------------------------- +; $308B00 (0x180B00) - $308BFF (0x180BFF) +; SahasrahlaAfterItemText +org $308B00 ; PC 0x180B00 +SahasrahlaAfterItemText: +; I already gave|you all I have|Why don't you|go bother|someone else? +db $74, $00, $B2, $00, $FF, $00, $AA, $00, $B5, $00, $BB, $00, $AE, $00, $AA, $00, $AD, $00, $C2, $00, $FF, $00, $B0, $00, $AA, $00, $BF, $00, $AE, $75, $00, $C2, $00, $B8, $00, $BE, $00, $FF, $00, $AA, $00, $B5, $00, $B5, $00, $FF, $00, $B2, $00, $FF, $00, $B1, $00, $AA, $00, $BF, $00, $AE, $76, $00, $C0, $00, $B1, $00, $C2, $00, $FF, $00, $AD, $00, $B8, $00, $B7, $00, $D8, $00, $BD, $00, $FF, $00, $C2, $00, $B8, $00, $BE, $7E, $73, $76, $00, $B0, $00, $B8, $00, $FF, $00, $AB, $00, $B8, $00, $BD, $00, $B1, $00, $AE, $00, $BB, $73, $76, $00, $BC, $00, $B8, $00, $B6, $00, $AE, $00, $B8, $00, $B7, $00, $AE, $00, $FF, $00, $AE, $00, $B5, $00, $BC, $00, $AE, $00, $C6 +db $7f, $7f +;-------------------------------------------------------------------------------- +; $308C00 (0x180C00) - $308CFF (0x180CFF) +; AlcoholicText +org $308C00 ; PC 0x180C00 +AlcoholicText: +; If you haven't|found Quake|yet…|it's not your|fault. +db $74, $00, $B2, $00, $AF, $00, $FF, $00, $C2, $00, $B8, $00, $BE, $00, $FF, $00, $B1, $00, $AA, $00, $BF, $00, $AE, $00, $B7, $00, $D8, $00, $BD, $75, $00, $AF, $00, $B8, $00, $BE, $00, $B7, $00, $AD, $00, $FF, $00, $BA, $00, $BE, $00, $AA, $00, $B4, $00, $AE, $76, $00, $C2, $00, $AE, $00, $BD, $00, $CC, $7E, $73, $76, $00, $B2, $00, $BD, $00, $D8, $00, $BC, $00, $FF, $00, $B7, $00, $B8, $00, $BD, $00, $FF, $00, $C2, $00, $B8, $00, $BE, $00, $BB, $73, $76, $00, $AF, $00, $AA, $00, $BE, $00, $B5, $00, $BD, $00, $CD +db $7f, $7f +;-------------------------------------------------------------------------------- +; $308D00 (0x180D00) - $308DFF (0x180DFF) +; BombShopGuyText +org $308D00 ; PC 0x180D00 +BombShopGuyText: +; please deliver|this big bomb|to my fairy|friend in the|pyramid? +db $74, $00, $B9, $00, $B5, $00, $AE, $00, $AA, $00, $BC, $00, $AE, $00, $FF, $00, $AD, $00, $AE, $00, $B5, $00, $B2, $00, $BF, $00, $AE, $00, $BB, $75, $00, $BD, $00, $B1, $00, $B2, $00, $BC, $00, $FF, $00, $AB, $00, $B2, $00, $B0, $00, $FF, $00, $AB, $00, $B8, $00, $B6, $00, $AB, $76, $00, $BD, $00, $B8, $00, $FF, $00, $B6, $00, $C2, $00, $FF, $00, $AF, $00, $AA, $00, $B2, $00, $BB, $00, $C2, $7E, $73, $76, $00, $AF, $00, $BB, $00, $B2, $00, $AE, $00, $B7, $00, $AD, $00, $FF, $00, $B2, $00, $B7, $00, $FF, $00, $BD, $00, $B1, $00, $AE, $73, $76, $00, $B9, $00, $C2, $00, $BB, $00, $AA, $00, $B6, $00, $B2, $00, $AD, $00, $C6 +db $7f, $7f +;-------------------------------------------------------------------------------- +; $308E00 (0x180E00) - $308EFF (0x180EFF) +; BombShopGuyNoCrystalsText +org $308E00 ; PC 0x180E00 +BombShopGuyNoCrystalsText: +; bring me the|5th and 6th|crystals so I|can make a big|bomb! +db $74, $00, $AB, $00, $BB, $00, $B2, $00, $B7, $00, $B0, $00, $FF, $00, $B6, $00, $AE, $00, $FF, $00, $BD, $00, $B1, $00, $AE, $75, $00, $A5, $00, $BD, $00, $B1, $00, $FF, $00, $AA, $00, $B7, $00, $AD, $00, $FF, $00, $A6, $00, $BD, $00, $B1, $76, $00, $AC, $00, $BB, $00, $C2, $00, $BC, $00, $BD, $00, $AA, $00, $B5, $00, $BC, $00, $FF, $00, $BC, $00, $B8, $00, $FF, $00, $B2, $7E, $73, $76, $00, $AC, $00, $AA, $00, $B7, $00, $FF, $00, $B6, $00, $AA, $00, $B4, $00, $AE, $00, $FF, $00, $AA, $00, $FF, $00, $AB, $00, $B2, $00, $B0, $73, $76, $00, $AB, $00, $B8, $00, $B6, $00, $AB, $00, $C7 +db $7f, $7f +;================================================================================ +org $30A000 ; $30A000 (0x182000) - $30A07F (0x18007F) +RNGSingleItemTable: +db $08, $09, $0A, $0B, $FF, $FF, $FF, $FF +db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF +db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF +db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF +db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF +db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF +db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF +db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF +db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF +db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF +db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF +db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF +db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF +db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF +db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF +db $FF, $FF, $FF, $FF, $FF, $FF, $FF +RNGSingleTableSize: +db $04 +org $30A080 ; $30A080 (0x182080) - $30A0FF (0x1800FF) +RNGMultiItemTable: +db $31, $36, $40, $46, $FF, $FF, $FF, $FF +db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF +db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF +db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF +db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF +db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF +db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF +db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF +db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF +db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF +db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF +db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF +db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF +db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF +db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF +db $FF, $FF, $FF, $FF, $FF, $FF, $FF +RNGMultiTableSize: +db $04 +;================================================================================ +;PC 0x50563: $C5, $76 ; move tile and turn into chest orig: $3F, $14 +;PC 0x50599: $38; lock door into room orig: $00 +;PC 0xE9A5: $10, $00, $58 ; borrow unused Ice Palace dungeon secret to fill chest orig: $7E, $00, $24 +;-------------------------------------------------------------------------------- +;00:Fighter's Sword (1) and Fighter's Shield (1) +;01:Master Sword (2) +;02:Tempered Sword (3) +;03:Golden Sword (4) +;04:Fighter's Shield (1) +;05:Red Shield (2) +;06:Mirror Shield (3) +;07:FireRod +;08:IceRod +;09:Hammer +;0A:HookShot +;0B:Bow +;0C:Boomerang (Alternate = 10 Arrows) +;0D:Powder +;0E:Bee +;0F:Bombos + +;10:Ether +;11:Quake +;12:Lamp (Alternate = 5 Rupees) +;13:Shovel +;14:Flute +;15:Red Cane +;16:Bottle +;17:Heart Piece +;18:Blue Cane +;19:Cape +;1A:Mirror +;1B:Power Glove (1) +;1C:Titan Mitts (2) +;1D:Book +;1E:Flippers +;1F:Moon Pearl + +;20:Crystal +;21:Net +;22:Blue Mail (2) +;23:Red Mail (3) +;24:Small Key +;25:Compass +;26:Heart Piece Completion Heart +;27:Bomb +;28:3 Bombs +;29:Mushroom +;2A:Red Boomerang (Alternate = 300 Rupees) +;2B:Red Potion (with bottle) +;2C:Green Potion (with bottle) +;2D:Blue Potion (with bottle) +;2E:Red Potion (without bottle) +;2F:Green Potion (without bottle) + +;30:Blue Potion (without bottle) +;31:10 Bombs +;32:Big Key +;33:Map +;34:1 Rupee +;35:5 Rupees +;36:20 Rupees +;37:Pendant 1 +;38:Pendant 2 +;39:Pendant 3 +;3A:Bow And Arrows (Different from "Bow", thrown into Fairy Fountains) +;3B:Bow And Silver Arrows +;3C:Bee +;3D:Fairy +;3E:Boss Heart +;3F:Sanctuary Heart + +;40:100 Rupees +;41:50 Rupees +;42:Heart +;43:Arrow +;44:10 Arrows +;45:Magic +;46:300 Rupees +;47:20 Rupees +;48:Gold Bee +;49:Fighter's Sword (1) (without shield, thrown into Fairy Fountains) +;4A:Flute +;4B:Boots + +;4C:Max Bombs +;4D:Max Arrows +;4E:Half Magic +;4F:Quarter Magic + +;50:Master Sword (No Special Handling) + +;51:+5 Bombs +;52:+10 Bombs +;53:+5 Arrows +;54:+10 Arrows + +;55:Programmable Item 1 +;56:Programmable Item 2 +;57:Programmable Item 3 + +;58:Upgrade-Only Silver Arrows + +;59:Rupoor +;5A:Null Item + +;5B:Red Clock +;5C:Blue Clock +;5D:Green Clock + +;5E:Progressive Sword +;5F:Progressive Shield +;60:Progressive Armor +;61:Progressive Lifting Glove + +;62:RNG Pool Item (Single) +;63:RNG Pool Item (Multi) + +;6A:Goal Item (Single/Triforce) +;6B:Goal Item (Multi/Power Star) + +;70 - Map of --- +;71 - Map of --- +;72 - Map of Ganon's Tower +;73 - Map of Turtle Rock +;74 - Map of Thieves' Town +;75 - Map of Tower of Hera +;76 - Map of Ice Palace +;77 - Map of Skull Woods +;78 - Map of Misery Mire +;79 - Map of Dark Palace +;7A - Map of Swamp Palace +;7B - Map of Agahnim's Tower +;7C - Map of Desert Palace +;7D - Map of Eastern Palace +;7E - Map of Hyrule Castle +;7F - Map of Sewers + +;80 - Compass of --- +;81 - Compass of --- +;82 - Compass of Ganon's Tower +;83 - Compass of Turtle Rock +;84 - Compass of Thieves' Town +;85 - Compass of Tower of Hera +;86 - Compass of Ice Palace +;87 - Compass of Skull Woods +;88 - Compass of Misery Mire +;89 - Compass of Dark Palace +;8A - Compass of Swamp Palace +;8B - Compass of Agahnim's Tower +;8C - Compass of Desert Palace +;8D - Compass of Eastern Palace +;8E - Compass of Hyrule Castle +;8F - Compass of Sewers + +;90 - Big Key of --- +;91 - Big Key of --- +;92 - Big Key of Ganon's Tower +;93 - Big Key of Turtle Rock +;94 - Big Key of Thieves' Town +;95 - Big Key of Tower of Hera +;96 - Big Key of Ice Palace +;97 - Big Key of Skull Woods +;98 - Big Key of Misery Mire +;99 - Big Key of Dark Palace +;9A - Big Key of Swamp Palace +;9B - Big Key of Agahnim's Tower +;9C - Big Key of Desert Palace +;9D - Big Key of Eastern Palace +;9E - Big Key of Hyrule Castle +;9F - Big Key of Sewers + +;A0 - Small Key of Sewers +;A1 - Small Key of Hyrule Castle +;A2 - Small Key of Eastern Palace +;A3 - Small Key of Desert Palace +;A4 - Small Key of Agahnim's Tower +;A5 - Small Key of Swamp Palace +;A6 - Small Key of Dark Palace +;A7 - Small Key of Misery Mire +;A8 - Small Key of Skull Woods +;A9 - Small Key of Ice Palace +;AA - Small Key of Tower of Hera +;AB - Small Key of Thieves' Town +;AC - Small Key of Turtle Rock +;AD - Small Key of Ganon's Tower +;AE - Small Key of --- +;AF - Small Key of --- +;-------------------------------------------------------------------------------- +org $308400 ; PC 0x180400 +;================================================================================ +org $0DDBEC ; <- 6DBEC +dw #10000 ; Rupee Limit +1 +org $0DDBF1 ; <- 6DBF1 +dw #9999 ; Rupee Limit +;================================================================================ +;2B:Bottle Already Filled w/ Red Potion +;2C:Bottle Already Filled w/ Green Potion +;2D:Bottle Already Filled w/ Blue Potion +;3C:Bottle Already Filled w/ Bee +;3D:Bottle Already Filled w/ Fairy +;48:Bottle Already Filled w/ Gold Bee +;================================================================================ +; $2F8000 - $2F83FF - RNG Block +;================================================================================ +; $7EC025 - $7EC034 - Item OAM Table +;================================================================================ +; $7F5000 - Redraw Flag +; $7F5001 - Flipper Softlock Possible +; $7F5002 - L/R Rotate +; $7F5003 - HexToDec 1st Digit +; $7F5004 - HexToDec 2nd Digit +; $7F5005 - HexToDec 3rd Digit +; $7F5006 - HexToDec 4th Digit +; $7F5007 - HexToDec 5th Digit +; $7F5008 - Skip Sprite_DrawMultiple EOR +; $7F5009 - Always Zero +; $7F5010 - Scratch Space (Callee Preserved) +; $7F5020 - Scratch Space (Caller Preserved) +; $7F5030 - Jar Cursor Status +; $7F5031 - HUD Master Sword Flag +; $7F5032 - Ganon Warp Chain Flag +; $7F5033 - Force Heart Spawn Counter +; $7F5034 - Skip Heart Collection Save Counter +; $7F5035 - Alternate Text Pointer Flag ; 0=Disable +; $7F5036 - Padding Byte (Must be Zero) +; $7F5037 - Stats Boss Kills +; $7F5038 - Stats Lag Time +; $7F5039 - Stats Lag Time +; $7F503A - Stats Lag Time +; $7F503B - Stats Lag Time +; $7F503C - Stats Rupee Total +; $7F503D - Stats Rupee Total +; $7F503E - Stats Item Total +; $7F503F - Bonk Repeat +; $7F5040 - $7F507E - Unused +; $7F507E - Clock Status +; $7F507F - Always Zero +; $7F5080 - $7F5083 - Clock Hours +; $7F5084 - $7F5087 - Clock Minutes +; $7F5088 - $7F508B - Clock Seconds +; $7F508C - $7F508F - Clock Temporary +; $7F5090 - RNG Item Lock-In +; $7F5091 - Item Animation Busy Flag +; $7F5092 - Potion Animation Busy Flags (Health) +; $7F5093 - Potion Animation Busy Flags (Magic) +; $7F50D0 - $7F50FF - Block Cypher Parameters +; $7F5100 - $7F51FF - Block Cypher Buffer +; +; $7F5700 - $7F57FF - Dialog Buffer +;================================================================================ +!BIGRAM = "$7EC900"; +; $7EC900 - Big RAM Buffer ($1F00) +;================================================================================ +org $309000 ; PC 0x181000 +NameHashTable: ; change this for each new version - MOVE THIS TO BANK $30 +db $57, $41, $D6, $7A, $E0, $10, $8A, $97, $A2, $89, $82, $45, $46, $1C, $DF, $F7 +db $55, $0F, $1D, $56, $AC, $29, $DC, $D1, $25, $2A, $C5, $92, $42, $B7, $BE, $50 +db $64, $62, $31, $E8, $49, $63, $40, $5F, $C9, $47, $F6, $0B, $FA, $FC, $E4, $F0 +db $E6, $8F, $6D, $B1, $68, $A4, $D3, $0E, $54, $5D, $6B, $CF, $20, $69, $33, $07 +db $2C, $4D, $32, $77, $C1, $95, $7B, $DE, $66, $8C, $35, $84, $86, $7C, $44, $1A +db $3E, $15, $D4, $0C, $B5, $90, $4C, $B2, $26, $1E, $38, $C0, $76, $9C, $2B, $7F +db $5E, $D5, $75, $B6, $E3, $7D, $8D, $72, $3A, $CB, $6F, $5B, $AD, $BD, $F1, $BB +db $05, $9A, $F4, $03, $02, $FF, $DA, $4F, $93, $B3, $14, $EC, $EE, $D7, $F9, $96 +db $A7, $13, $CA, $BF, $88, $19, $A3, $78, $24, $87, $3C, $9E, $B4, $27, $C2, $AF +db $80, $C4, $C8, $6C, $E9, $94, $F8, $8B, $3D, $34, $A6, $53, $17, $22, $F3, $A5 +db $1B, $2E, $06, $39, $D2, $43, $73, $12, $09, $58, $30, $5C, $99, $98, $9F, $ED +db $37, $67, $EA, $BA, $E7, $D9, $81, $08, $7E, $BC, $70, $5A, $51, $C3, $B9, $61 +db $36, $4B, $A8, $01, $65, $3B, $EF, $59, $04, $18, $79, $0D, $DD, $CE, $CC, $AE +db $83, $21, $EB, $6E, $0A, $71, $B0, $11, $85, $C7, $A1, $FD, $E5, $16, $48, $FB +db $F2, $23, $2F, $28, $9B, $AA, $AB, $D0, $6A, $9D, $C6, $2D, $00, $FE, $E1, $3F +db $A0, $4A, $B8, $4E, $74, $1F, $8E, $A9, $F5, $CD, $60, $91, $DB, $D8, $52, $E2 +;================================================================================ \ No newline at end of file diff --git a/tablets.asm b/tablets.asm new file mode 100644 index 00000000..c0eb7c1c --- /dev/null +++ b/tablets.asm @@ -0,0 +1,135 @@ +;================================================================================ +; Randomize Tablets +;-------------------------------------------------------------------------------- +ItemSet_EtherTablet: + PHA : LDA !NPC_FLAGS_2 : ORA.b #$01 : STA !NPC_FLAGS_2 : PLA +RTL +;-------------------------------------------------------------------------------- +ItemSet_BombosTablet: + PHA : LDA !NPC_FLAGS_2 : ORA.b #$02 : STA !NPC_FLAGS_2 : PLA +RTL +;-------------------------------------------------------------------------------- +ItemCheck_EtherTablet: + LDA !NPC_FLAGS_2 : AND.b #$01 +RTL +;-------------------------------------------------------------------------------- +ItemCheck_BombosTablet: + LDA !NPC_FLAGS_2 : AND.b #$02 +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 + JSL.l ItemSet_BombosTablet : BRA .done + .ether + JSL.l ItemSet_EtherTablet + .done + PLA +RTL +;-------------------------------------------------------------------------------- +SpawnTabletItem: +; JSL.l HeartPieceGet +;RTL + JSL.l LoadOutdoorValue + JSL.l PrepDynamicTile + + LDA.b #$01 : STA !FORCE_HEART_SPAWN : STA !SKIP_HEART_SAVE + JSL.l SetTabletItem + + LDA.b #$EB + STA $7FFE00 + JSL Sprite_SpawnDynamically + + LDA $22 : STA $0D10, Y + LDA $23 : STA $0D30, Y + + LDA $20 : STA $0D00, Y + LDA $21 : STA $0D20, Y + + LDA.b #$00 : STA $0F20, Y + + LDA.b #$7F : STA $0F70, Y ; spawn WAY up high +RTL +;-------------------------------------------------------------------------------- +MaybeUnlockTabletAnimation: + PHA : PHP + JSL.l IsMedallion : BCC + + STZ $0112 ; disable falling-medallion mode + STZ $03EF ; release link from item-up pose + LDA.b #$00 : STA $5D ; set link to ground state + + REP #$20 ; set 16-bit accumulator + LDA $8A : CMP.w #$0030 : BNE ++ ; Desert + SEP #$20 ; set 8-bit accumulator + LDA.b #$02 : STA $2F ; face link forward + LDA.b #$3C : STA $46 ; lock link for 60f + ++ + SEP #$20 ; set 8-bit accumulator + + + PLP : PLA +RTL +;-------------------------------------------------------------------------------- +IsMedallion: + REP #$20 ; set 16-bit accumulator + LDA $8A + CMP.w #$03 : BNE + ; Death Mountain + LDA $22 : CMP.w #1890 : !BGE ++ + SEC + BRL .done + ++ + BRA .false + + CMP.w #$30 : BNE + ; Desert + LDA $22 : CMP.w #512 : !BLT ++ + SEC + BRL .done + ++ + + + .false + CLC + .done + SEP #$20 ; set 8-bit accumulator +RTL +;-------------------------------------------------------------------------------- +LoadNarrowObject: + LDA AddReceivedItemExpanded_wide_item_flag, X : STA ($92), Y ; AddReceiveItem.wide_item_flag? ; LDA.b #$00 : STA ($92), Y in the japanese version + PLY + ;JSL.l DrawNarrowDroppedObject +JMP.l LoadNarrowObjectReturn +;-------------------------------------------------------------------------------- +DrawNarrowDroppedObject: + ; If it's a 16x16 sprite, we'll only draw one, otherwise we'll end up drawing + ; two 8x8 sprites stack on top of each other + CMP.b #$02 : BEQ .large_sprite + + REP #$20 + + ; Shift Y coordinate 8 pixels down + LDA $08 : STA $00 + + SEP #$20 + + JSL.l Ancilla_SetOam_XY_Long + + ; always use the same character graphic (0x34) + LDA.b #$34 : STA ($90), Y : INY + + LDA AddReceivedItemExpanded_properties, X : BPL .valid_lower_properties + + LDA $74 + +.valid_lower_properties + + ASL A : ORA.b #$30 : STA ($90), Y + + INY : PHY + + TYA : !SUB.b #$04 : LSR #2 : TAY + + LDA.b #$00 : STA ($92), Y + + PLY +.large_sprite +RTL +;-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/timer.asm b/timer.asm new file mode 100644 index 00000000..eee92874 --- /dev/null +++ b/timer.asm @@ -0,0 +1,168 @@ +;================================================================================ +; Challenge Timer +;================================================================================ +!Temp = "$7F5020" +!BaseTimer = "$7EF43E" +!ChallengeTimer = "$7EF454" +;-------------------------------------------------------------------------------- +!CLOCK_HOURS = "$7F5080" ; $7F5080 - $7F5083 - Clock Hours +!CLOCK_MINUTES = "$7F5084" ; $7F5084 - $7F5087 - Clock Minutes +!CLOCK_SECONDS = "$7F5088" ; $7F5088 - $7F508B - Clock Seconds +!CLOCK_TEMPORARY = "$7F508C" ; $7F508C - $7F508F - Clock Temporary +;-------------------------------------------------------------------------------- +!FRAMES_PER_SECOND = #60 +!FRAMES_PER_MINUTE = #60*60 +!FRAMES_PER_HOUR = #60*60*60 +;-------------------------------------------------------------------------------- +!Status = "$7F507E" +; ---- --dn +; d - dnf +; n - negative +;-------------------------------------------------------------------------------- +macro DecIncr(value) + LDA.l : INC + CMP.w #$000A : !BLT ?noIncr + LDA.l +2 : INC : STA.l +2 + LDA.w #$0000 + ?noIncr: + STA.l +endmacro +;-------------------------------------------------------------------------------- +macro Sub32(minuend,subtrahend,result) + LDA.l + !SUB.l ; perform subtraction on the LSBs + STA.l + LDA.l +2 ; do the same for the MSBs, with carry + SBC.l +2 ; set according to the previous result + STA.l +2 +endmacro +;-------------------------------------------------------------------------------- +macro Blt32(value1,value2) + LDA.l +2 + CMP.l +2 + !BLT ?done + BNE ?done + LDA.l + CMP.l + ?done: +endmacro +;-------------------------------------------------------------------------------- +CalculateTimer: + LDA $FFFFFF + LDA.w #$0000 + STA.l !CLOCK_HOURS ; clear digit storage + STA.l !CLOCK_HOURS+2 + STA.l !CLOCK_MINUTES + STA.l !CLOCK_MINUTES+2 + STA.l !CLOCK_SECONDS + STA.l !CLOCK_SECONDS+2 + + LDA.l TimerStyle : AND.w #$00FF : CMP.w #$0002 : BNE + ; Stopwatch Mode + %Sub32(!BaseTimer,!ChallengeTimer,!CLOCK_TEMPORARY) + BRA ++ + + CMP.w #$0001 : BNE ++ ; Countdown Mode + %Sub32(!ChallengeTimer,!BaseTimer,!CLOCK_TEMPORARY) + ++ + + %Blt32(!CLOCK_TEMPORARY,.halfCycle) : !BLT + + LDA.l TimeoutBehavior : AND.w #$00FF : BNE ++ ; DNF + LDA.w #$0002 : STA.l !Status ; Set DNF Mode + LDA.l !BaseTimer : STA.l !ChallengeTimer + LDA.l !BaseTimer+2 : STA.l !ChallengeTimer+2 + RTS + ++ CMP.w #$0001 : BNE ++ ; Negative Time + LDA.l !CLOCK_TEMPORARY : EOR.w #$FFFF : !ADD.w #$0001 : STA.l !CLOCK_TEMPORARY + LDA.l !CLOCK_TEMPORARY+2 : EOR.w #$FFFF : ADC.w #$0000 : STA.l !CLOCK_TEMPORARY+2 + LDA.w #$0001 : STA.l !Status ; Set Negative Mode + BRA .prepDigits + ++ ; OHKO + LDA.w #$0002 : STA.l !Status ; Set DNF Mode + LDA.l !BaseTimer : STA.l !ChallengeTimer + LDA.l !BaseTimer+2 : STA.l !ChallengeTimer+2 + RTS + + + + LDA.l TimerRestart : AND.w #$00FF : BEQ + + LDA.w #$0000 : STA.l !Status ; Set Positive Mode + + + .prepDigits + + - + %Blt32(!CLOCK_TEMPORARY,.hour) : !BLT + + %DecIncr(!CLOCK_HOURS) + %Sub32(!CLOCK_TEMPORARY,.hour,!CLOCK_TEMPORARY) : BRA - + + - + %Blt32(!CLOCK_TEMPORARY,.minute) : !BLT + + %DecIncr(!CLOCK_MINUTES) + %Sub32(!CLOCK_TEMPORARY,.minute,!CLOCK_TEMPORARY) : BRA - + + - + %Blt32(!CLOCK_TEMPORARY,.second) : !BLT + + %DecIncr(!CLOCK_SECONDS) + %Sub32(!CLOCK_TEMPORARY,.second,!CLOCK_TEMPORARY) : BRA - + + + + LDA !CLOCK_HOURS : !ADD.w #$2490 : STA !CLOCK_HOURS ; convert decimal values to tiles + LDA !CLOCK_HOURS+2 : !ADD.w #$2490 : STA !CLOCK_HOURS+2 + LDA !CLOCK_MINUTES : !ADD.w #$2490 : STA !CLOCK_MINUTES + LDA !CLOCK_MINUTES+2 : !ADD.w #$2490 : STA !CLOCK_MINUTES+2 + LDA !CLOCK_SECONDS : !ADD.w #$2490 : STA !CLOCK_SECONDS + LDA !CLOCK_SECONDS+2 : !ADD.w #$2490 : STA !CLOCK_SECONDS+2 +RTS +;-------------------------------------------------------------------------------- +.hour +dw #$4BC0, #$0003 +.minute +dw #$0E10, #$0000 +.second +dw #$003C, #$0000 +.halfCycle +dw #$FFFF, #$7FFF +;-------------------------------------------------------------------------------- +DrawChallengeTimer: + LDA.l TimerStyle : BNE + : RTL : + ; Hud Timer + 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 + LDA.w #$247F : STA $7EC798 + STA $7EC79A + BRA +++ + ++ ; OHKO + LDA.w #$280A : STA $7EC794 + LDA.w #$280B : STA $7EC796 + LDA.w #$280C : STA $7EC798 + LDA.w #$247F : STA $7EC79A + +++ + STA $7EC79C + STA $7EC79E + STA $7EC7A0 + STA $7EC7A2 + STA $7EC7A4 + LDA.l TimerRestart : BNE +++ : RTL : +++ + BRA ++ + + ; Show Timer + 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 !CLOCK_MINUTES+2 : STA $7EC79C + LDA !CLOCK_MINUTES : STA $7EC79E + LDA.w #$2806 : STA $7EC7A0 + LDA !CLOCK_SECONDS+2 : STA $7EC7A2 + LDA !CLOCK_SECONDS : STA $7EC7A4 + ++ + LDA $1A : AND.w #$001F : BNE + : JSR CalculateTimer : + + +RTL +;-------------------------------------------------------------------------------- +OHKOTimer: + LDA.l TimeoutBehavior : CMP #$02 : BNE + + LDA.l !Status : AND.b #$02 : BEQ + + LDA.b #$00 : STA $7EF36D ; kill link + + + LDA $7EF36D +RTL +;-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/translations.asm b/translations.asm new file mode 100644 index 00000000..e81eaa44 --- /dev/null +++ b/translations.asm @@ -0,0 +1,202 @@ +;-------------------------------------------------------------------------------- +org $1C801B ; <- E001B - E003E ; game over menu - 0x24 +db $FC, $00, $BC, $AA, $BF, $AE, $C9, $AC, $B8, $B7, $BD, $B2, $B7, $BE, $AE, $F8, $BC, $AA, $BF, $AE, $C9, $BA, $BE, $B2, $BD, $F9, $AC, $B8, $B7, $BD, $B2, $B7, $BE, $AE, $FB, $FC +;-------------------------------------------------------------------------------- +org $1C818F ; <- E018F - E01B6 ; tutorial guard's text 1 - 0x28 +db $B8, $B7, $B5, $C2, $FF, $AA, $AD, $BE, $B5, $BD, $BC, $FF, $FF, $FF, $F8, $BC, $B1, $B8, $BE, $B5, $AD, $FF, $BD, $BB, $AA, $BF, $AE, $B5, $FF, $F9, $AA, $BD, $FF, $B7, $B2, $B0, $B1, $BD, $FF, $FB +;-------------------------------------------------------------------------------- +;org $1C81B7 ; <- E01B7 - E01E3 ; tutorial guard's text 2 - 0x2D +db $C2, $B8, $BE, $FF, $AC, $AA, $B7, $FF, $B9, $BE, $BC, $B1, $FF, $C1, $F8, $BD, $B8, $FF, $BF, $B2, $AE, $C0, $FF, $BD, $B1, $AE, $FF, $FF, $FF, $F9, $B6, $AA, $B9, $CD, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FB +;-------------------------------------------------------------------------------- +;org $1C81E4 ; <- E01E4 - E0210 ; tutorial guard's text 3 - 0x2D +db $B9, $BB, $AE, $BC, $BC, $FF, $BD, $B1, $AE, $FF, $AA, $FF, $FF, $FF, $F8, $AB, $BE, $BD, $BD, $B8, $B7, $FF, $BD, $B8, $FF, $B5, $B2, $AF, $BD, $F9, $BD, $B1, $B2, $B7, $B0, $BC, $FF, $AB, $C2, $FF, $C2, $B8, $BE, $FF, $FB +;-------------------------------------------------------------------------------- +;org $1C8211 ; <- E0211 - E023D ; tutorial guard's text 4 - 0x2D +db $C0, $B1, $AE, $B7, $FF, $C2, $B8, $BE, $FF, $B1, $AA, $BC, $FF, $AA, $FF, $FF, $F8, $BC, $C0, $B8, $BB, $AD, $FF, $B9, $BB, $AE, $BC, $BC, $FF, $AB, $F9, $BD, $B8, $FF, $BC, $B5, $AA, $BC, $B1, $FF, $FF, $FF, $FF, $FF, $FB +;-------------------------------------------------------------------------------- +;org $1C823E ; <- E023E - E0269 ; tutorial guard's text 5 - 0x2C +db $BE, $BC, $AE, $FF, $C2, $B8, $BE, $BB, $FF, $B6, $AA, $B9, $FF, $FF, $F8, $BD, $B8, $FF, $AF, $B2, $B7, $AD, $FF, $BD, $B1, $AE, $FF, $FF, $FF, $F9, $AC, $BB, $C2, $BC, $BD, $AA, $B5, $BC, $FF, $FF, $FF, $FF, $FF, $FB +;-------------------------------------------------------------------------------- +;org $1C826A ; <- E026A - E0296 ; tutorial guard's text 6 - 0x2D +db $AA, $BB, $AE, $FF, $C0, $AE, $FF, $BB, $AE, $AA, $B5, $B5, $C2, $F8, $BC, $BD, $B2, $B5, $B5, $FF, $BB, $AE, $AA, $AD, $B2, $B7, $B0, $F9, $BD, $B1, $AE, $BC, $AE, $C6, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $F9, $F9, $FB +;-------------------------------------------------------------------------------- +;org $1C8297 ; <- E0297 - E02BF ; tutorial guard's text 7 - 0x29 +db $B3, $AE, $AE, $C3, $AE, $FF, $BD, $B1, $AE, $BB, $AE, $F8, $BB, $AE, $AA, $B5, $B5, $C2, $FF, $AA, $BB, $AE, $FF, $AA, $FF, $F9, $B5, $B8, $BD, $FF, $B8, $AF, $FF, $BD, $B1, $B2, $B7, $B0, $BC, $FF, $FB +;-------------------------------------------------------------------------------- +;org $1C8CB0 ; <- E0CB0 - ; Saharala text (skipping selection) Eventual text +; free space +;-------------------------------------------------------------------------------- +org $1C935A ; <- E135A - E1388 ; first sign (rain state) - 0x2F +db $E0, $FF, $AD, $C2, $B2, $B7, $B0, $FF, $BE, $B7, $AC, $B5, $AE, $FF, $F8, $FF, $FF, $BD, $B1, $B2, $BC, $FF, $C0, $AA, $C2, $FF, $FF, $FF, $FF, $F9, $F9, $F9, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FB +;-------------------------------------------------------------------------------- +org $1C9389 ; <- E1389 - E13B4 ; first sign - 0x2C +db $D2, $D3, $FF, $BB, $AA, $B7, $AD, $B8, $B6, $B2, $C3, $AE, $BB, $FF, $F8, $AD, $B8, $B7, $D8, $BD, $FF, $BB, $AE, $AA, $AD, $FF, $B6, $AE, $C8, $F9, $B0, $B8, $FF, $AB, $AE, $AA, $BD, $FF, $B0, $AA, $B7, $B8, $B7, $FB +;-------------------------------------------------------------------------------- +org $1C93B5 ; <- E13B5 - E13D7 ; DM cave sign - 0x23 +db $AC, $AA, $BF, $AE, $FF, $BD, $B8, $FF, $BD, $B1, $AE, $F8, $B5, $B8, $BC, $BD, $FF, $B8, $B5, $AD, $FF, $B6, $AA, $B7, $F9, $B0, $B8, $B8, $AD, $FF, $B5, $BE, $AC, $B4, $FB +;-------------------------------------------------------------------------------- +org $1C93D8 ; <- E13D8 - E13E6 ; Skull Woods sign - 0xF +db $E0, $FF, $B5, $B8, $BC, $BD, $FF, $C0, $B8, $B8, $AD, $BC, $FF, $FF, $FB +;-------------------------------------------------------------------------------- +org $1C944B ; <- E144B - E145B ; {left} kakariko sign - 0x11 (0x12) +db $E3, $FF, $B4, $AA, $B4, $AA, $BB, $B2, $B4, $B8, $F8, $FF, $FF, $BD, $B8, $C0, $B7, $FB +;-------------------------------------------------------------------------------- +org $1C94FE ; <- E14FE - E150E ; {down} kakariko sign - 0x11 +db $E1, $FF, $B4, $AA, $B4, $AA, $BB, $B2, $B4, $B8, $F8, $FF, $FF, $BD, $B8, $C0, $B7, $FB +;-------------------------------------------------------------------------------- +org $1C9631 ; <- E1631 - E164F ; Potion Shop no empty bottles - 0x1F (0x20) +db $C0, $B1, $B8, $AA, $FF, $AB, $BE, $AC, $B4, $B8, $C8, $F8, $B7, $B8, $FF, $AE, $B6, $B9, $BD, $C2, $FF, $FF, $F9, $AB, $B8, $BD, $BD, $B5, $AE, $BC, $CD, $FB +;-------------------------------------------------------------------------------- +org $1C9E13 ; <- E1E13 ; no big key +db $BC, $B8, $B6, $AE, $BD, $B1, $B2, $B7, $B0, $FF, $B2, $BC, $F8, $B6, $B2, $BC, $BC, $B2, $B7, $B0, $CC, $FF, $FF, $F9, $BD, $B1, $AE, $FF, $AB, $B2, $B0, $FF, $B4, $AE, $C2, $C6, $FB +;-------------------------------------------------------------------------------- +org $1CA96D ; <- E296D - E29F1 ; unkown - 0x85 (0x2D) +db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $F8, $FF, $FF, $FF, $FF, $FF, $C2, $B8, $C7, $FF, $FF, $FF, $FF, $FF, $FF, $F9, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FB +;-------------------------------------------------------------------------------- +;org $1CA9F2 ; <- E29F2 - E2A0E ; Old Man in Tavern - 0x1D (0x70) +db $B5, $B2, $AF, $AE, $C6, $FF, $B5, $B8, $BF, $AE, $C6, $FF, $FF, $FF, $F8, $B1, $AA, $B9, $B9, $B2, $B7, $AE, $BC, $BC, $C6, $FF, $BD, $B1, $AE, $F9, $BA, $BE, $AE, $BC, $BD, $B2, $B8, $B7, $FF, $C2, $B8, $BE, $FF, $FF, $FA, $F6, $BC, $B1, $B8, $BE, $B5, $AD, $FF, $BB, $AE, $AA, $B5, $B5, $C2, $F6, $AA, $BC, $B4, $FF, $B2, $BC, $C8, $FF, $C0, $AA, $BC, $F6, $BD, $B1, $B2, $BC, $FF, $B0, $AE, $B7, $AE, $BB, $AA, $BD, $AE, $AD, $FA, $F6, $AB, $C2, $FF, $BC, $BD, $B8, $B8, $B9, $BC, $FF, $AA, $B5, $BE, $F6, $B8, $BB, $FF, $BC, $BD, $B8, $B8, $B9, $BC, $FF, $B3, $AE, $BD, $C6, $FB +;-------------------------------------------------------------------------------- +;org $1CAA0F ; <- E2A0F - E2A3D ; Chicken hut lady - 0x2F (0x36) +db $BD, $B1, $B2, $BC, $FF, $B2, $BC, $F8, $AC, $B1, $BB, $B2, $BC, $BD, $B8, $BC, $D8, $FF, $B1, $BE, $BD, $C8, $FA, $F9, $B1, $AE, $D8, $BC, $FF, $B8, $BE, $BD, $F6, $BC, $AE, $AA, $BB, $AC, $B1, $B2, $B7, $B0, $F6, $AF, $B8, $BB, $FF, $AA, $FF, $AB, $B8, $C0, $CD, $FB +;-------------------------------------------------------------------------------- +;org $1CAA3E ; <- E2A3E - E2AD2 ; Running Man - 0x95 (0x8E) +db $B1, $B2, $C8, $FF, $AD, $B8, $FF, $C2, $B8, $BE, $F8, $B4, $B7, $B8, $C0, $FF, $BF, $AE, $AE, $BD, $B8, $BB, $B9, $C6, $F9, $FA, $F6, $C2, $B8, $BE, $FF, $BB, $AE, $AA, $B5, $B5, $C2, $F6, $BC, $B1, $B8, $BE, $B5, $AD, $CD, $FF, $AA, $B7, $AD, $F6, $AA, $B5, $B5, $FF, $BD, $B1, $AE, $FF, $B8, $BD, $B1, $AE, $BB, $FA, $F6, $B0, $BB, $AE, $AA, $BD, $FF, $B0, $BE, $C2, $BC, $FF, $C0, $B1, $B8, $F6, $B6, $AA, $AD, $AE, $FF, $BD, $B1, $B2, $BC, $F6, $B9, $B8, $BC, $BC, $B2, $AB, $B5, $AE, $CD, $FA, $F6, $B0, $B8, $FF, $BD, $B1, $AA, $B7, $B4, $FF, $BD, $B1, $AE, $B6, $F6, $F6, $FA, $F6, $B2, $AF, $FF, $C2, $B8, $BE, $FF, $AC, $AA, $B7, $FF, $F6, $AC, $AA, $BD, $AC, $B1, $FF, $BD, $B1, $AE, $B6, $CC, $FB +;-------------------------------------------------------------------------------- +org $1CAAD3 ; <- E2AD3 ; race game sign +db $C0, $B1, $C2, $FF, $AA, $BB, $AE, $FF, $C2, $B8, $BE, $FF, $F8, $BB, $AE, $AA, $AD, $B2, $B7, $B0, $FF, $BD, $B1, $B2, $BC, $F9, $BC, $B2, $B0, $B7, $C6, $FF, $BB, $BE, $B7, $C7, $C7, $C7, $FB +;-------------------------------------------------------------------------------- +org $1CAAFA ; <- E2AFA ; cape cave sign +db $C2, $B8, $BE, $FF, $B7, $AE, $AE, $AD, $FF, $AC, $AA, $B9, $AE, $F8, $AB, $BE, $BD, $FF, $B7, $B8, $BD, $F9, $B1, $B8, $B8, $B4, $BC, $B1, $B8, $BD, $FB +;-------------------------------------------------------------------------------- +org $1CAB34 ; <- E2B34 ; north of outcasts +db $E0, $FF, $BC, $B4, $BE, $B5, $B5, $FF, $C0, $B8, $B8, $AD, $BC, $F9, $E1, $FF, $BC, $BD, $AE, $BF, $AE, $D8, $BC, $FF, $BD, $B8, $C0, $B7, $FB +;-------------------------------------------------------------------------------- +org $1CAB51 ; <- E2B51 ; there is a cave sign +db $F8, $E2, $FF, $B4, $AA, $BB, $B4, $AA, $BD, $BC, $FF, $AC, $AA, $BF, $AE, $FB +;-------------------------------------------------------------------------------- +org $1CAB61 ; <- E2B61 ; temple of Yami sign +db $F8, $E2, $FF, $AD, $AA, $BB, $B4, $FF, $B9, $AA, $B5, $AA, $AC, $AE, $FB +;-------------------------------------------------------------------------------- +org $1CAB70 ; <- E2B70 ; bomb shop sign +db $F8, $E3, $FF, $AB, $B8, $B6, $AB, $FF, $BC, $B1, $B8, $B9, $B9, $AE, $FB +;-------------------------------------------------------------------------------- +org $1CAB7F ; <- E2B7F ; Misery Mire sign +db $E3, $FF, $B6, $B2, $BC, $AE, $BB, $C2, $FF, $B6, $B2, $BB, $AE, $FF, $F8, $B7, $B8, $FF, $C0, $AA, $C2, $FF, $B2, $B7, $FF, $AA, $B7, $AD, $FF, $F9, $B7, $B8, $FF, $C0, $AA, $C2, $FF, $B8, $BE, $BD, $CD, $FF, $FF, $FF, $F9, $F9, $F9, $F9, $FB +;-------------------------------------------------------------------------------- +org $1CABB0 ; <- E2BB0 ; outcasts sign +db $B1, $AA, $BF, $AE, $FF, $AA, $FF, $BD, $BB, $BE, $B5, $B2, $AE, $F8, $AA, $C0, $AE, $BC, $B8, $B6, $AE, $FF, $AD, $AA, $C2, $C7, $FB +;-------------------------------------------------------------------------------- +org $1CABED ; <- E2BED - E2C1C ; guard on top of castle - 0x30 +db $B5, $B8, $B8, $B4, $B2, $B7, $B0, $FF, $AF, $B8, $BB, $FF, $AA, $FF, $F8, $B9, $BB, $B2, $B7, $AC, $AE, $BC, $BC, $C6, $FF, $B5, $B8, $B8, $B4, $F9, $AD, $B8, $C0, $B7, $BC, $BD, $AA, $B2, $BB, $BC, $CD, $FF, $FF, $FF, $F9, $F9, $F9, $FB +;-------------------------------------------------------------------------------- +org $1CAC1D ; <- E2C1D - E2C40 ; Gate guard - 0x24 +db $B7, $B8, $FF, $B5, $B8, $B7, $B4, $BC, $FF, $FF, $FF, $FF, $FF, $FF, $F8, $AA, $B5, $B5, $B8, $C0, $AE, $AD, $C7, $FF, $FF, $FF, $FF, $FF, $F9, $FF, $FF, $FF, $FF, $FF, $FF, $FB +;-------------------------------------------------------------------------------- +org $1CB019 ; <- E3019 - E3067 ; telepathic tile: Ice Palace large ice room - 0x4F +db $FE, $6B, $02, $AA, $B5, $B5, $FF, $BB, $B2, $B0, $B1, $BD, $FF, $BC, $BD, $B8, $B9, $F8, $AC, $B8, $B5, $B5, $AA, $AB, $B8, $BB, $AA, $BD, $AE, $F9, $AA, $B7, $AD, $FF, $B5, $B2, $BC, $BD, $AE, $B7, $FF, $B2, $AC, $AE, $FA, $F6, $B2, $BC, $FF, $AB, $AA, $AC, $B4, $FF, $C0, $B2, $BD, $B1, $F6, $B6, $C2, $FF, $AB, $BB, $AA, $B7, $AD, $FF, $B7, $AE, $C0, $F6, $B2, $B7, $BF, $AE, $B7, $BD, $B2, $B8, $B7, $FB +;-------------------------------------------------------------------------------- +;org $1CB068 ; <- E3068 - E3098 ; telepathic tile: Turtle Rock entrance - 0x31 +db $FE, $6B, $02, $C2, $B8, $BE, $FF, $BC, $B1, $AA, $B5, $B5, $FF, $B7, $B8, $BD, $FF, $F8, $B9, $AA, $BC, $BC, $CC, $FF, $C0, $B2, $BD, $B1, $B8, $BE, $BD, $FF, $F9, $BD, $B1, $AE, $FF, $BB, $AE, $AD, $FF, $AC, $AA, $B7, $AE, $FB +;-------------------------------------------------------------------------------- +org $1CB099 ; <- E3099 - E30C1 ; telepathic tile: Ice Palace entrance - 0x24 +db $FE, $6B, $02, $C2, $B8, $BE, $FF, $AC, $AA, $B7, $FF, $BE, $BC, $AE, $FF, $FF, $F8, $AF, $B2, $BB, $AE, $FF, $BB, $B8, $AD, $FF, $B8, $BB, $F9, $AB, $B8, $B6, $AB, $B8, $BC, $FF, $BD, $B8, $FF, $B9, $AA, $BC, $BC, $FB +;-------------------------------------------------------------------------------- +;org $1CB0C2 ; <- E30C2 - E30F3 ; telepathic tile: Ice Palace Stalfos Knights room - 0x32 +db $FE, $6B, $02, $B4, $B7, $B8, $AC, $B4, $FF, $AE, $B6, $FF, $AD, $B8, $C0, $B7, $FF, $F8, $AA, $B7, $AD, $FF, $BD, $B1, $AE, $B7, $FF, $AB, $B8, $B6, $AB, $F9, $BD, $B1, $AE, $B6, $FF, $AD, $AE, $AA, $AD, $FF, $FF, $FF, $FF, $FF, $FB +;-------------------------------------------------------------------------------- +org $1CB176 ; <- E3176 ; catch a bee +db $AC, $AA, $BE, $B0, $B1, $BD, $FF, $AA, $FF, $AB, $AE, $AE, $FF, $FF, $F8, $FF, $FF, $E4, $FF, $FF, $B4, $AE, $AE, $B9, $FF, $FF, $FF, $FF, $FF, $F9, $FF, $FF, $FF, $FF, $FF, $BB, $AE, $B5, $AE, $AA, $BC, $AE, $FE, $68 +;-------------------------------------------------------------------------------- +org $1CB1A3 ; <- E31A3 ; catch a fairy +db $AC, $AA, $BE, $B0, $B1, $BD, $FF, $AF, $AA, $B2, $BB, $C2, $C7, $FF, $FF, $FF, $E4, $FF, $B4, $AE, $AE, $B9, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $BB, $AE, $B5, $AE, $AA, $BC, $AE, $FE, $68 +;-------------------------------------------------------------------------------- +org $1CB1CD ; <- E31CD ; no empty bottles +db $C0, $B1, $B8, $AA, $FF, $AB, $BE, $AC, $B4, $B8, $C8, $F8, $B7, $B8, $FF, $AE, $B6, $B9, $BD, $C2, $FF, $FF, $F9, $AB, $B8, $BD, $BD, $B5, $AE, $BC, $CD +;-------------------------------------------------------------------------------- +org $1CB1ED ; <- E31ED ; race game boy +db $C2, $B8, $BE, $BB, $FF, $BD, $B2, $B6, $AE, $F8, $C0, $AA, $BC, $F9, $FE, $6C, $03, $FE, $6C, $02, $FF, $B6, $B2, $B7, $FF, $FE, $6C, $01, $FE, $6C, $00, $FF, $BC, $AE, $AC, $CD +;-------------------------------------------------------------------------------- +org $1CB212 ; <- E3212 ; race game girl +db $C2, $B8, $BE, $FF, $B1, $AA, $BF, $AE, $FF, $A1, $A5, $FF, $FF, $FF, $F8, $BC, $AE, $AC, $B8, $B7, $AD, $BC, $C8, $FF, $FF, $FF, $FF, $FF, $FF, $F9, $B0, $B8, $CC, $FF, $B0, $B8, $CC, $FF, $B0, $B8, $CC, $FF, $FF +;-------------------------------------------------------------------------------- +org $1CB23E ; <- E323E ; race game boy success +db $B7, $B2, $AC, $AE, $C7, $FF, $FF, $FF, $FF, $F8, $C2, $B8, $BE, $FF, $AC, $AA, $B7, $FF, $B1, $AA, $BF, $AE, $F9, $BD, $B1, $B2, $BC, $FF, $BD, $BB, $AA, $BC, $B1, $C7, $FB +;-------------------------------------------------------------------------------- +org $1CB261 ; <- E3261 ; race game boy fail +db $BD, $B8, $B8, $FF, $BC, $B5, $B8, $C0, $C7, $FF, $F8, $B2, $FF, $B4, $AE, $AE, $B9, $FF, $B6, $C2, $F9, $B9, $BB, $AE, $AC, $B2, $B8, $BE, $BC, $C7, $FB +;-------------------------------------------------------------------------------- +org $1CB280 ; <- E3280 - E3299 ; race game already collected - 0x1A (E32A2 - 0x23) +db $C2, $B8, $BE, $FF, $AA, $B5, $BB, $AE, $AA, $AD, $C2, $F8, $B1, $AA, $BF, $AE, $FF, $C2, $B8, $BE, $BB, $F9, $B9, $BB, $B2, $C3, $AE, $FF, $AD, $B2, $B7, $B0, $BE, $BC, $FB +;-------------------------------------------------------------------------------- +org $1CBE1D ; <- E3E1D - E3E4B ; sick kid no bottle - 0x2F +db $FE, $6D, $01, $B2, $D8, $B6, $FF, $BC, $B2, $AC, $B4, $C7, $FF, $BC, $B1, $B8, $C0, $F8, $B6, $AE, $FF, $AA, $FF, $AB, $B8, $BD, $BD, $B5, $AE, $C8, $FF, $F9, $B0, $AE, $BD, $FF, $BC, $B8, $B6, $AE, $BD, $B1, $B2, $B7, $B0, $C7, $FB +;-------------------------------------------------------------------------------- +;org $1CBE4C ; <- E3E4C - E3ED3 ; sick kid get item - 0x88 +; free space +;-------------------------------------------------------------------------------- +org $1CBEC8 ; <- E3ED4 - E3EF3 ; sick kid after bottle - 0x20 (0x2B) +db $FB ; close free space +db $B5, $AE, $AA, $BF, $AE, $FF, $B6, $AE, $FF, $AA, $B5, $B8, $B7, $AE, $F8, $B2, $D8, $B6, $FF, $BC, $B2, $AC, $B4, $CD, $FF, $C2, $B8, $BE, $F9, $B1, $AA, $BF, $AE, $FF, $B6, $C2, $FF, $B2, $BD, $AE, $B6, $CD, $FB +;-------------------------------------------------------------------------------- +org $1CC2AA : db $FF ; <- E42AA ; overwrite end boxes for intro +org $1CC2EA : db $FF ; <- E42EA ; overwrite end boxes for intro +org $1CC32B : db $FF ; <- E432B ; overwrite end boxes for intro +org $1CC369 : db $FF ; <- E4369 ; overwrite end boxes for intro +org $1CC0DD ; <- E40DD - E438C ; Intro sequence - 0x2B0 +; Main intro +db $FE, $6E, $00, $FE, $77, $07, $FC, $03, $FE, $6B, $02, $FE, $67, $FF, $AE, $B9, $B2, $BC, $B8, $AD, $AE, $FF, $FF, $B2, $B2, $B2, $FF, $FE, $78, $03, $F8, $FF, $AA, $FF, $B5, $B2, $B7, $B4, $FF, $BD, $B8, $FF, $FF, $FF, $FF, $F9, $FF, $FF, $FF, $BD, $B1, $AE, $FF, $B9, $AA, $BC, $BD, $FF, $FF, $FF, $FE, $78, $03, $F6, $F9, $FF, $FF, $BB, $AA, $B7, $AD, $B8, $B6, $B2, $C3, $AE, $BB, $FE, $78, $03, $F6, $F9, $AA, $AF, $BD, $AE, $BB, $FF, $B6, $B8, $BC, $BD, $B5, $C2, $F6, $F9, $AD, $B2, $BC, $BB, $AE, $B0, $AA, $BB, $AD, $B2, $B7, $B0, $F6, $F9, $C0, $B1, $AA, $BD, $FF, $B1, $AA, $B9, $B9, $AE, $B7, $AE, $AD, $F6, $F9, $B2, $B7, $FF, $BD, $B1, $AE, $FF, $AF, $B2, $BB, $BC, $BD, $F6, $F9, $BD, $C0, $B8, $FF, $B0, $AA, $B6, $AE, $BC, $CD, $FE, $78, $03, $F6, $F9, $B5, $B2, $B7, $B4, $FF, $AA, $C0, $AA, $B4, $AE, $B7, $BC, $F6, $F9, $BD, $B8, $FF, $B1, $B2, $BC, $FF, $BE, $B7, $AC, $B5, $AE, $F6, $F9, $B5, $AE, $AA, $BF, $B2, $B7, $B0, $FF, $BD, $B1, $AE, $F6, $F9, $B1, $B8, $BE, $BC, $AE, $C8, $FE, $78, $03, $F6, $F9, $B1, $AE, $FF, $B3, $BE, $BC, $BD, $FF, $BB, $BE, $B7, $BC, $F6, $F9, $B8, $BE, $BD, $FF, $BD, $B1, $AE, $FF, $AD, $B8, $B8, $BB, $FE, $78, $03, $F6, $F9, $B2, $B7, $BD, $B8, $FF, $BD, $B1, $AE, $FF, $BB, $AA, $B2, $B7, $C2, $F6, $F9, $B7, $B2, $B0, $B1, $BD, $CD, $FE, $78, $03, $FE, $67, $FE, $67, $F6, $F9, $B0, $AA, $B7, $B8, $B7, $FF, $B1, $AA, $BC, $F6, $F9, $B6, $B8, $BF, $AE, $AD, $FF, $AA, $B5, $B5, $FF, $BD, $B1, $AE, $F6, $F9, $B2, $BD, $AE, $B6, $BC, $FF, $AA, $BB, $B8, $BE, $B7, $AD, $F6, $F9, $B1, $C2, $BB, $BE, $B5, $AE, $CD, $FE, $78, $07, $F6, $F9, $C2, $B8, $BE, $FF, $C0, $B2, $B5, $B5, $FF, $B1, $AA, $BF, $AE, $F6, $F9, $BD, $B8, $FF, $AF, $B2, $B7, $AD, $FF, $AA, $B5, $B5, $F6, $F9, $BD, $B1, $AE, $FF, $B2, $BD, $AE, $B6, $BC, $F6, $F9, $B7, $AE, $AC, $AE, $BC, $BC, $AA, $BB, $C2, $FF, $BD, $B8, $F6, $F9, $AB, $AE, $AA, $BD, $FF, $B0, $AA, $B7, $B8, $B7, $CD, $FE, $78, $07, $F6, $F9, $BD, $B1, $B2, $BC, $FF, $B2, $BC, $FF, $C2, $B8, $BE, $BB, $F6, $F9, $AC, $B1, $AA, $B7, $AC, $AE, $FF, $BD, $B8, $FF, $AB, $AE, $FF, $AA, $F6, $F9, $B1, $AE, $BB, $B8, $FE, $78, $03, $FE, $67, $FE, $67, $F6, $F9, $C2, $B8, $BE, $FF, $B6, $BE, $BC, $BD, $FF, $B0, $AE, $BD, $F6, $F9, $BD, $B1, $AE, $FF, $A7, $FF, $AC, $BB, $C2, $BC, $BD, $AA, $B5, $BC, $F6, $F9, $BD, $B8, $FF, $AB, $AE, $AA, $BD, $FF, $B0, $AA, $B7, $B8, $B7, $CD, $FE, $78, $09, $FE, $67, $FE, $67, $FB +; Skeleton King +db $FE, $6B, $02, $FE, $77, $07, $FC, $03, $F7, $B5, $B8, $B8, $B4, $FF, $AA, $BD, $FF, $BD, $B1, $B2, $BC, $FF, $FF, $F8, $BC, $BD, $AA, $B5, $AF, $B8, $BC, $FF, $B8, $B7, $FF, $BD, $B1, $AE, $F9, $BD, $B1, $BB, $B8, $B7, $AE, $CD, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FB +; Zelda's cell +db $FE, $6B, $02, $FE, $77, $07, $FC, $03, $F7, $B2, $BD, $FF, $B2, $BC, $FF, $C2, $B8, $BE, $BB, $FF, $FF, $FF, $FF, $F8, $BD, $B2, $B6, $AE, $FF, $BD, $B8, $FF, $BC, $B1, $B2, $B7, $AE, $C7, $FB +; Agahnim magic'ing +db $FE, $6B, $02, $FE, $77, $07, $FC, $03, $F7, $AA, $B5, $BC, $B8, $FF, $C2, $B8, $BE, $FF, $B7, $AE, $AE, $AD, $FF, $F8, $BD, $B8, $FF, $AD, $AE, $AF, $AE, $AA, $BD, $FF, $BD, $B1, $B2, $BC, $F9, $B0, $BE, $C2, $C7, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FB +;-------------------------------------------------------------------------------- +org $1CC820 ; <- E4820 - E484A ; Lumberjack left - 0x2B +db $B8, $B7, $AE, $FF, $B8, $AF, $FF, $BE, $BC, $FF, $FF, $FF, $FF, $F8, $AA, $B5, $C0, $AA, $C2, $BC, $FF, $B5, $B2, $AE, $BC, $CD, $FF, $FF, $F9, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FB +;-------------------------------------------------------------------------------- +org $1CC84B ; <- E484B - E4874 ; Lumberjack right - 0x2A +db $B8, $B7, $AE, $FF, $B8, $AF, $FF, $BE, $BC, $FF, $FF, $FF, $FF, $F8, $AA, $B5, $C0, $AA, $C2, $BC, $FF, $BD, $AE, $B5, $B5, $BC, $F9, $BD, $B1, $AE, $FF, $BD, $BB, $BE, $BD, $B1, $CD, $FF, $FF, $FF, $FF, $FB +;-------------------------------------------------------------------------------- +org $1CE792 ; <- E6792 - E67B8 ; treasure chest game not played yet - 0x27 +db $C2, $B8, $BE, $FF, $C0, $AA, $B7, $BD, $FF, $BD, $B8, $FF, $FF, $F8, $B9, $B5, $AA, $C2, $FF, $B0, $AA, $B6, $AE, $C6, $F9, $BD, $AA, $B5, $B4, $FF, $BD, $B8, $FF, $B6, $AE, $CD, $FF, $FF, $FB +;-------------------------------------------------------------------------------- +org $1CE7B9 ; <- E67B9 - E67DD ; treasure chest game played - 0x25 +db $C2, $B8, $BE, $D8, $BF, $AE, $FF, $B8, $B9, $AE, $B7, $AE, $AD, $F8, $BD, $B1, $AE, $FF, $AC, $B1, $AE, $BC, $BD, $BC, $CD, $F9, $BD, $B2, $B6, $AE, $FF, $BD, $B8, $FF, $B0, $B8, $FB +;-------------------------------------------------------------------------------- +org $1CE91B ; <- E691B ; no empty bottles +db $AE, $B6, $B9, $BD, $C2, $FF, $AB, $B8, $BD, $BD, $B5, $AE, $BC, $FF, $F8, $AA, $BB, $AE, $FF, $C0, $B1, $AA, $BD, $FF, $C2, $B8, $BE, $FF, $FF, $F9, $BB, $AE, $AA, $B5, $B5, $C2, $FF, $B7, $AE, $AE, $AD, $C7, $FF, $FF, $FB +;-------------------------------------------------------------------------------- +org $1CEF09 ; <- E6F09 - E6F24 ; powdered pickle - 0x1C +db $B2, $D8, $B6, $FF, $AA, $FF, $B5, $B8, $B7, $AE, $B5, $C2, $F8, $AD, $AA, $B7, $AC, $B2, $B7, $B0, $FF, $B9, $B2, $AC, $B4, $B5, $AE, $FB +;-------------------------------------------------------------------------------- +org $1CEF45 ; <- E6F45 - E6F61 ; potion shop no cash - 0x1D (0x24) +db $C2, $B8, $C7, $FF, $B2, $D8, $B6, $FF, $B7, $B8, $BD, $F8, $BB, $BE, $B7, $B7, $B2, $B7, $B0, $FF, $AA, $F9, $AC, $B1, $AA, $BB, $B2, $BD, $C2, $FF, $B1, $AE, $BB, $AE, $CD, $FB +;-------------------------------------------------------------------------------- +org $1CEFEA ; <- E6FEA - E7039 ; LW chest game south of Kakriko do you want to play? - 0x4F +db $B9, $AA, $C2, $FF, $A2, $A0, $FF, $BB, $BE, $B9, $AE, $AE, $BC, $F8, $B8, $B9, $AE, $B7, $FF, $A1, $FF, $AC, $B1, $AE, $BC, $BD, $F9, $AA, $BB, $AE, $FF, $C2, $B8, $BE, $FF, $B5, $BE, $AC, $B4, $C2, $C6, $FA, $F6, $BC, $B8, $C8, $FF, $B9, $B5, $AA, $C2, $FF, $B0, $AA, $B6, $AE, $C6, $F6, $FF, $FF, $E4, $FF, $B9, $B5, $AA, $C2, $F6, $FF, $FF, $FF, $FF, $B7, $AE, $BF, $AE, $BB, $C7, $FE, $68, $FB +;-------------------------------------------------------------------------------- +;org $1CF03A ; <- E703A - E704B ; LW chest game yes play - 0x12 +db $B0, $B8, $B8, $AD, $FF, $B5, $BE, $AC, $B4, $FF, $BD, $B1, $AE, $B7, $F8, $FF, $FF, $FB +;-------------------------------------------------------------------------------- +;org $1CF04C ; <- E704C - E7071 ; LW chest game no play - 0x26 +db $C0, $AE, $B5, $B5, $FF, $AF, $B2, $B7, $AE, $C8, $FF, $B2, $F8, $AD, $B2, $AD, $B7, $D8, $BD, $FF, $C0, $AA, $B7, $BD, $F9, $C2, $B8, $BE, $BB, $FF, $BB, $BE, $B9, $AE, $AE, $BC, $CD, $FB +;-------------------------------------------------------------------------------- +org $1CF072; <- E7072 - E7039 ; LW chest game south of Kakriko do you want to play? - 0x50 +db $B9, $AA, $C2, $FF, $A1, $A0, $A0, $FF, $BB, $BE, $B9, $AE, $AE, $BC, $F8, $B8, $B9, $AE, $B7, $FF, $A1, $FF, $AC, $B1, $AE, $BC, $BD, $F9, $AA, $BB, $AE, $FF, $C2, $B8, $BE, $FF, $B5, $BE, $AC, $B4, $C2, $C6, $FA, $F6, $BC, $B8, $C8, $FF, $B9, $B5, $AA, $C2, $FF, $B0, $AA, $B6, $AE, $C6, $F6, $FF, $FF, $E4, $FF, $B9, $B5, $AA, $C2, $F6, $FF, $FF, $FF, $FF, $B7, $AE, $BF, $AE, $BB, $C7, $FE, $68, $FB +;-------------------------------------------------------------------------------- +org $1CF1E4 ; <- E71E4 ; translate house/sanc spawn menu +db $FE, $6D, $00, $FC, $00, $E4, $FE, $6A, $D8, $BC, $FF, $B1, $B8, $BE, $BC, $AE, $FF, $FF, $F8, $FF, $BC, $AA, $B7, $AC, $BD, $BE, $AA, $BB, $C2, $FE, $72, $FB +;-------------------------------------------------------------------------------- +org $1CF204 ; <- E7204 ; translate house/sanc/mountain spawn menu +db $FE, $6D, $00, $FC, $00, $E4, $FE, $6A, $D8, $BC, $FF, $B1, $B8, $BE, $BC, $AE, $F8, $FF, $BC, $AA, $B7, $AC, $BD, $BE, $AA, $BB, $C2, $F9, $FF, $B6, $B8, $BE, $B7, $BD, $AA, $B2, $B7, $FF, $AC, $AA, $BF, $AE, $FE, $71, $FB +;-------------------------------------------------------------------------------- +org $1CF2C8 ; <- E72C8 ; digging game no cash +db $C2, $B8, $BE, $FF, $C0, $AA, $B7, $BD, $FF, $BD, $B8, $F8, $AD, $B2, $B0, $C6, $FF, $B2, $FF, $C0, $AA, $B7, $BD, $F9, $A8, $A0, $FF, $BB, $BE, $B9, $AE, $AE, $BC, $CD, $FF, $FB +;-------------------------------------------------------------------------------- +org $1CF231 ; <- E7231 - Save and quit +db $FC, $00, $E4, $AC, $B8, $B7, $BD, $B2, $B7, $BE, $AE, $F8, $FF, $BC, $AA, $BF, $AE, $FF, $AA, $B7, $AD, $FF, $BA, $BE, $B2, $BD, $FE, $72, $FB +;-------------------------------------------------------------------------------- +org $1CF325 ; <- E7325 ; digging game, no follower +db $BC, $B8, $B6, $AE, $BD, $B1, $B2, $B7, $B0, $FF, $B2, $BC, $FF, $F8, $AF, $B8, $B5, $B5, $B8, $C0, $B2, $B7, $B0, $FF, $C2, $B8, $BE, $F9, $B2, $FF, $AD, $B8, $B7, $D8, $BD, $FF, $B5, $B2, $B4, $AE, $CD, $F9, $F9, $F9, $F9, $F9, $F9, $F9 +;-------------------------------------------------------------------------------- diff --git a/treekid.asm b/treekid.asm new file mode 100644 index 00000000..07e853e1 --- /dev/null +++ b/treekid.asm @@ -0,0 +1,9 @@ +;================================================================================ +; Tree Kid Fix +;-------------------------------------------------------------------------------- +org $06B12B ; <- 3312B - tree status set - 418 - LDA $7EF3C9 : ORA.b #$08 : STA $7EF3C9 +LDA $7EF3C9 : AND.b #$F7 : STA $7EF3C9 ; unset arboration instead of setting it +;-------------------------------------------------------------------------------- +org $06B072 ; <- 33072 - FluteAardvark_InitialStateFromFluteState - 418 : dw FluteAardvark_AlreadyArborated +db #$8B +;================================================================================ \ No newline at end of file diff --git a/utilities.asm b/utilities.asm new file mode 100644 index 00000000..d8d1651f --- /dev/null +++ b/utilities.asm @@ -0,0 +1,463 @@ +;================================================================================ +; Utility Functions +;================================================================================ +!PROGRESSIVE_SHIELD = "$7EF416" ; ss-- ---- +;-------------------------------------------------------------------------------- +; GetSpriteTile +; in: A - Loot ID +; out: A - Sprite GFX ID +;-------------------------------------------------------------------------------- +GetSpriteID: + PHX + PHB : PHK : PLB + ;-------- + TAX : LDA .gfxSlots, X ; look up item gfx + PLB : PLX + CMP.b #$FA : !BGE .specialHandling +RTL + .specialHandling + CMP.b #$FA : BNE ++ ; RNG Item (Single) + JSL.l GetRNGItemSingle : JMP GetSpriteID + ++ CMP.b #$FB : BNE ++ ; RNG Item (Multi) + JSL.l GetRNGItemMulti : JMP GetSpriteID + ++ CMP.b #$FE : BNE ++ ; Progressive Sword + LDA $7EF359 : BNE + ; No Sword + LDA.b #$43 : RTL + + : CMP.b #$01 : BNE + ; Fighter Sword + LDA.b #$44 : RTL + + : CMP.b #$02 : BNE + ; Master Sword + LDA.b #$45 : RTL + + ; Everything Else + LDA.b #$46 : RTL + ++ : CMP.b #$FF : BNE ++ ; Progressive Shield + LDA !PROGRESSIVE_SHIELD : AND #$C0 : BNE + ; No Shield + LDA.b #$2D : RTL + + : CMP.b #$40 : BNE + ; Fighter Shield + LDA.b #$20 : RTL + + ; Everything Else + LDA.b #$2E : RTL + ++ +RTL + +;DATA - Loot Identifier to Sprite ID +{ + .gfxSlots + db $06, $44, $45, $46, $2D, $20, $2E, $09 + db $09, $0A, $08, $05, $10, $0B, $2C, $1B + + db $1A, $1C, $14, $19, $0C, $07, $1D, $2F + db $07, $15, $12, $0D, $0D, $0E, $11, $17 + + db $28, $27, $04, $04, $0F, $16, $03, $13 + db $01, $1E, $10, $00, $00, $00, $00, $00 + + db $00, $30, $22, $21, $24, $24, $24, $23 + db $23, $23, $29, $2A, $2C, $2B, $03, $03 + + db $34, $35, $31, $33, $02, $32, $36, $37 + db $2C, $43, $0C, $38, $39, $3A, $3B, $3C + ; db $2C, $06, $0C, $38, $FF, $FF, $FF, $FF + + ;5x + db $44 ; Safe Master Sword + db $3D, $3E, $3F, $40 ; Bomb & Arrow +5/+10 + db $00, $00, $00 ; 3x Programmable Item + db $41 ; Upgrade-Only Silver Arrows + db $24 ; 1 Rupoor + db $47 ; Null Item + db $48, $48, $48 ; Red, Blue & Green Clocks + db $FE, $FF ; Progressive Sword & Shield + + ;6x + db $04, $0D ; Progressive Armor & Gloves + db $FA, $FB ; RNG Single & Multi + db $FF, $FF, $FF, $FF, $FF, $FF ; Unused + db $49, $4A, $49 ; Goal Item Single, Multi & Alt Multi + db $FF, $FF, $FF ; Unused + + ;7x + db $21, $21, $21, $21, $21, $21, $21, $21, $21, $21, $21, $21, $21, $21, $21, $21 ; Free Map + + ;7x + db $16, $16, $16, $16, $16, $16, $16, $16, $16, $16, $16, $16, $16, $16, $16, $16 ; Free Compass + + ;7x + db $22, $22, $22, $22, $22, $22, $22, $22, $22, $22, $22, $22, $22, $22, $22, $22 ; Free Big Key + + ;7x + db $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F ; Free Small Key +} +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; GetSpritePalette +; in: A - Loot ID +; out: A - Palette +;-------------------------------------------------------------------------------- +GetSpritePalette: + PHX + PHB : PHK : PLB + ;-------- + TAX : LDA .gfxPalettes, X ; look up item gfx + PLB : PLX + CMP.b #$FA : !BGE .specialHandling +RTL + .specialHandling + CMP.b #$FD : BNE ++ ; Progressive Sword + LDA $7EF359 : BNE + ; No Sword + LDA.b #$04 : RTL + + : CMP.b #$01 : BNE + ; Fighter Sword + LDA.b #$04 : RTL + + : CMP.b #$02 : BNE + ; Master Sword + LDA.b #$02 : RTL + + ; Everything Else + LDA.b #$08 : RTL + ++ : CMP.b #$FE : BNE ++ ; Progressive Shield + LDA $7EF35A : BNE + ; No Shield + LDA.b #$04 : RTL + + : CMP.b #$01 : BNE + ; Fighter Shield + LDA.b #$02 : RTL + + ; Everything Else + LDA.b #$08 : RTL + ++ : CMP.b #$FF : BNE ++ ; Progressive Armor + LDA $7EF35B : BNE + ; Green Tunic + LDA.b #$04 : RTL + + ; Everything Else + LDA.b #$02 : RTL + ++ : CMP.b #$FC : BNE ++ ; Progressive Gloves + LDA $7EF354 : BNE + ; No Gloves + LDA.b #$02 : RTL + + ; Everything Else + LDA.b #$08 : RTL + ++ : CMP.b #$FA : BNE ++ ; RNG Item (Single) + JSL.l GetRNGItemSingle : JMP GetSpritePalette + ++ : CMP.b #$FB : BNE ++ ; RNG Item (Multi) + JSL.l GetRNGItemMulti : JMP GetSpritePalette + ++ +RTL + +;DATA - Loot Identifier to Sprite Palette +{ + .gfxPalettes + db $00, $04, $02, $08, $04, $02, $08, $02 + db $04, $02, $02, $02, $04, $04, $04, $08 + + db $08, $08, $02, $02, $04, $02, $02, $02 + db $04, $02, $04, $02, $08, $08, $04, $02 + + db $0A, $02, $04, $02, $04, $04, $00, $04 + db $04, $08, $02, $02, $08, $04, $02, $08 + + db $04, $04, $08, $08, $08, $04, $02, $08 + db $02, $04, $08, $02, $04, $04, $02, $02 + + db $08, $08, $02, $04, $04, $08, $08, $08 + db $04, $04, $04, $02, $08, $08, $08, $08 + ; db $04, $0A, $04, $02, $FF, $FF, $FF, $FF + + db $04 ; Safe Master Sword + db $08, $08, $08, $08 ; Bomb & Arrow +5/+10 + db $00, $00, $00 ; Programmable Items 1-2 + db $02 ; Upgrade-Only Silver Arrows + db $06 ; 1 Rupoor + db $02 ; Null Item + db $02, $04, $08 ; Red, Blue & Green Clocks + db $FD, $FE, $FF, $FC ; Progressive Sword, Shield, Armor & Gloves + db $FA, $FB ; RNG Single & Multi + db $00, $00, $00, $00, $00, $00 ; Unused + db $08, $08, $08 ; Goal Item Single, Multi & Alt Multi + db $00, $00, $00 ; Unused + db $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 ; Free Map + db $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04, $04 ; Free Compass + 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 +} +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; IsNarrowSprite +; in: A - Loot ID +; out: Carry - 0 = Full, 1 = Narrow +;-------------------------------------------------------------------------------- +IsNarrowSprite: + PHA : PHX + PHB : PHK : PLB + + ;-------- + CMP.b #$5F : BNE ++ ; Special Handler for Progressive Shield + LDA $7EF35A : BNE + : SEC : BRA .done : +; No Shield + BRA .false ; Everything Else + ++ CMP.b #$62 : BNE ++ ; RNG Item (Single) + JSL.l GetRNGItemSingle : BRA .continue + ++ CMP.b #$63 : BNE ++ ; RNG Item (Multi) + JSL.l GetRNGItemMulti + ++ + + .continue + ;-------- + + LDX.b #$00 ; set index counter to 0 + ;---- + - + CPX.b #$24 : !BGE .false ; finish if we've done the whole list + CMP .smallSprites, X : BNE + ; skip to next if we don't match + ;-- + SEC ; set true state + BRA .done ; we're done + ;-- + + + INX ; increment index + BRA - ; go back to beginning of loop + ;---- + .false + CLC + .done + PLB : PLX : PLA +RTL + +;DATA - Half-Size Sprite Markers +{ + .smallSprites + db $04, $07, $08, $09, $0A, $0B, $0C, $13 + db $15, $18, $24, $2A, $31, $34, $35, $36 + db $42, $43, $45, $59, $A0, $A1, $A2, $A3 + db $A4, $A5, $A6, $A7, $A8, $A9, $AA, $AB + db $AC, $AD, $AE, $AF, $FF, $FF, $FF, $FF +} +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; PrepDynamicTile +; in: A - Loot ID +;-------------------------------------------------------------------------------- 20/8477 +PrepDynamicTile: + PHA : PHX : PHY + JSR.w LoadDynamicTileOAMTable + JSL.l GetSpriteID ; convert loot id to sprite id + JSL.l GetAnimatedSpriteTile_variable + PLY : PLX : PLA +RTL +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; LoadDynamicTileOAMTable +; in: A - Loot ID +;-------------------------------------------------------------------------------- 20/847B +!SPRITE_OAM = "$7EC025" +;-------------------------------------------------------------------------------- +LoadDynamicTileOAMTable: + PHA : PHP + + PHA + REP #$20 ; set 16-bit accumulator + LDA.w #$0000 : STA.l !SPRITE_OAM + STA.l !SPRITE_OAM+2 + LDA.w #$0200 : STA.l !SPRITE_OAM+6 + SEP #$20 ; set 8-bit accumulator + LDA.b #$24 : STA.l !SPRITE_OAM+4 + + LDA $01,s + + JSL.l GetSpritePalette + STA !SPRITE_OAM+5 : STA !SPRITE_OAM+13 + PLA + JSL.l IsNarrowSprite : BCS .narrow + + BRA .done + + .narrow + REP #$20 ; set 16-bit accumulator + LDA.w #$0000 : STA.l !SPRITE_OAM+7 + STA.l !SPRITE_OAM+14 + LDA.w #$0800 : STA.l !SPRITE_OAM+9 + LDA.w #$3400 : STA.l !SPRITE_OAM+11 + + .done + PLP : PLA +RTS +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; DrawDynamicTile +; in: A - Loot ID +; out: A - OAM Slots Taken +;-------------------------------------------------------------------------------- +; This wastes two OAM slots if you don't want a shadow - fix later +;-------------------------------------------------------------------------------- 2084B8 +!SPRITE_OAM = "$7EC025" +!SKIP_EOR = "$7F5008" +;-------------------------------------------------------------------------------- +DrawDynamicTile: + JSL.l IsNarrowSprite : BCS .narrow + + .full + LDA.b #$01 : STA $06 + LDA #$0C : JSL.l OAM_AllocateFromRegionC + LDA #$02 : PHA + BRA .draw + + .narrow + LDA.b #$02 : STA $06 + LDA #$10 : JSL.l OAM_AllocateFromRegionC + LDA #$03 : PHA + + .draw + LDA.b #!SPRITE_OAM>>0 : STA $08 + LDA.b #!SPRITE_OAM>>8 : STA $09 + STZ $07 + LDA #$7E : PHB : PHA : PLB + LDA.b #$01 : STA.l !SKIP_EOR + JSL Sprite_DrawMultiple_quantity_preset + PLB + + LDA $90 : !ADD.b #$08 : STA $90 ; leave the pointer in the right spot to draw the shadow, if desired + LDA $92 : INC #2 : STA $92 + PLA +RTL +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; Sprite_IsOnscreen +; in: X - Sprite Slot +; out: Carry - 1 = On Screen, 0 = Off Screen +;-------------------------------------------------------------------------------- +Sprite_IsOnscreen: + JSR _Sprite_IsOnscreen_DoWork + BCS + + REP #$20 + LDA $E2 : PHA : !SUB.w #$0F : STA $E2 + LDA $E8 : PHA : !SUB.w #$0F : STA $E8 + SEP #$20 + JSR _Sprite_IsOnscreen_DoWork + REP #$20 + PLA : STA $E8 + PLA : STA $E2 + SEP #$20 + + +RTL + +_Sprite_IsOnscreen_DoWork: + LDA $0D10, X : CMP $E2 + LDA $0D30, X : SBC $E3 : BNE .offscreen + + LDA $0D00, X : CMP $E8 + LDA $0D20, X : SBC $E9 : BNE .offscreen + SEC +RTS + .offscreen + CLC +RTS +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; Sprite_GetScreenRelativeCoords: +; out: $00.w Sprite Y +; out: $02.w Sprite X +; out: $06.b Sprite Y Relative +; out: $07.b Sprite X Relative +;-------------------------------------------------------------------------------- +; Copied from bank $06 +;-------------------------------------------------------------------------------- +!spr_y_lo = $00 +!spr_y_hi = $01 + +!spr_x_lo = $02 +!spr_x_hi = $03 + +!spr_y_screen_rel = $06 +!spr_x_screen_rel = $07 +;-------------------------------------------------------------------------------- +Sprite_GetScreenRelativeCoords: + STY $0B + + STA $08 + + LDA $0D00, X : STA $00 + !SUB $E8 : STA $06 + LDA $0D20, X : STA $01 + + LDA $0D10, X : STA $02 + !SUB $E2 : STA $07 + LDA $0D30, X : STA $03 +RTL +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; SkipDrawEOR - Shims in Bank05.asm : 2499 +;-------------------------------------------------------------------------------- +!SKIP_EOR = "$7F5008" +;-------------------------------------------------------------------------------- +SkipDrawEOR: + LDA.l !SKIP_EOR : BEQ .normal + LDA.w #$0000 : STA.l !SKIP_EOR + LDA $04 : AND.w #$F0FF : STA $04 + .normal + LDA ($08), Y : EOR $04 ; thing we wrote over +RTL +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; HexToDec +; in: A(w) - Word to Convert +; out: $7F5003 - $7F5007 (high - low) +;-------------------------------------------------------------------------------- +HexToDec: + PHA + PHA + LDA.w #$9090 + STA $7F5003 : STA $7F5005 : STA $7F5006 ; clear digit storage + PLA + - + CMP.w #10000 : !BLT + + PHA : SEP #$20 : LDA $7F5003 : INC : STA $7F5003 : REP #$20 : PLA + !SUB.w #10000 : BRA - + + - + CMP.w #1000 : !BLT + + PHA : SEP #$20 : LDA $7F5004 : INC : STA $7F5004 : REP #$20 : PLA + !SUB.w #1000 : BRA - + + - + CMP.w #100 : !BLT + + PHA : SEP #$20 : LDA $7F5005 : INC : STA $7F5005 : REP #$20 : PLA + !SUB.w #100 : BRA - + + - + CMP.w #10 : !BLT + + PHA : SEP #$20 : LDA $7F5006 : INC : STA $7F5006 : REP #$20 : PLA + !SUB.w #10 : BRA - + + - + CMP.w #1 : !BLT + + PHA : SEP #$20 : LDA $7F5007 : INC : STA $7F5007 : REP #$20 : PLA + !SUB.w #1 : BRA - + + + PLA +RTL +;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; NameHash +; out: +; $00 - $07 - 64-bit Seed Hash +;-------------------------------------------------------------------------------- +NameHash: + PHP + SEP #$30 ; set 8-bit accumulator & index registers + LDY #$00; ; for (j = 0; j < 8; ++j) { + - + CPY #$08 : !BGE + + LDA $00FFC0 : PHY : !ADD 1,s : STA 1,s : PLX : LDA.l NameHashTable, X ; h = T[(x[0] + j) % 256]; + PHY + LDY #$01 ; for (i = 1; i < len; ++i) { + -- + CPY #21 : !BGE ++ ; 21 decimal + TYX : EOR $00FFC0, X : TAX : LDA.l NameHashTable, X ; h = T[h ^ x[i]]; + INY + BRA -- + ++ ; } + PLY : TYX + STA $00, X + INY + BRA - + + ; } + PLP +RTL +;-------------------------------------------------------------------------------- +;================================================================================ \ No newline at end of file diff --git a/xkas b/xkas new file mode 100755 index 0000000000000000000000000000000000000000..6e31af538f279c6b29ed0b7f5a7c6053f63a2642 GIT binary patch literal 88148 zcmeFad3aOR_CB7p0SZ=96tQ5zf*_!X)B&ii$kYNV&T>_TB7=f5SrP^r45SH75295UDL-3#bTsMFa#CkP}k10s^H-e(zd)pJeCcpnks3@6X%kX|m7R`+fIX zYp=cba8AzIeDdehjchhsGX9hB-xUA_rTlP45Rb-733q?yBY1p48;YadAv`%7scI2tmBzy;&RPM9*bkdNc_ z=yViz0l3qClN^$RSPKg7A3eHY?2OT4r??7S_l`2lG4gkt?PYL`JYeD=u>3117(LZh zIDXRo(c^eI9LH_8`(Q-JK?5PasU3~Kf&%xX>EkDjDHuQLzR5Ugmg9lbHrqnT@xU(z zBJsPRVC=Yp`wH)!I9BADIZi|%1KRe)ufmTK8HBB=o`Qn@eeUR^lt?2Z&@sNjK|Vpg zNPa01*OrAJ# z@+9Mw*`Du$BV&ZfRqX-mM*k=+`t^;2Zn`0_|DZc$))eI2f;2ep7%198#kI59Jl&`$ z^3(B^j_)b>E|$k6{{{fYonyC6z@(h2q=yZK7@+f9y;6D}rm%FDHUOr*`sLRL9oG=E*2pKHH`SuqxvTM43{MP3= zpVW8#_WSlY4|ju-P3V*TjZ`On`8=Kc8-Em&to}%rtME_ylO4oSqnLbAEmIrz@z!O|{xy2SnZI`UIx4B*7+k|6_=^CZ#&BmSjhPa6@fyO<-`XHn=u8$Q~G66Yiw1x%UKT zMzZJBPCZ|nQ>)$hkt2}$(Eu$4g@SiSviB6$AUn`A;3_$#rDPATEv)pePZ?1#l&k%F zqC!5Mq`4bI*4k{nBf0=c*~Vj)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UD3$l{WYQ;m+O(9$8teY4%w7j4kiyTPJT`u*&rctiGNk2c7(1lm!asuJJ z#z_J+aTql=*->&c<-FOr{zp?XVwbUec)0u{Q<`&?CLXTR5gf3jbRY*TDIHIDN$Idk zIfFcGEfR!!0N!W!Ld5M*po0T;y)YuR4Qlr_X}Yb|^Z>yA)rlbp5y9 ze}Qu-Sx5WpHvRH}FQspHB859h`RKcQ(RWE{EvDw2PjfKa=XBELgXMzjNxW>Syn5gG zrbb--P%n84u$PwsVktvh(&zMLM4z*_Z1m66fF(}0`W&pG;!C+;VPY8Bkhejv5l&41 z%??~7=~F~1nuN~wU%y|xtlZRy@qrT<0hXDNRphGjcU^ZS6}|MHEc5-6wC&@I#XR8~^*R`8g(`Tb^U*`Xp$tHZ686Qe12oR%NVmsP1hKMe=FIc^$0_eiQQ}VaT`XYm6Titi{ zLguuJC}I!u@l>a0O8P1Y@obgRyY>ZXg4=D9(&bjTX5J4u96rVJcOT9CHp02&s3Y+({&f*O6crTSsFA_ zGA`@cqkwFdSMsx?i*MR9Bbtzn^D&+Ar#LPd93wn^2;qT52(4kES&~5}j!l$CD+k-l zZQnebkiF=8$T3EKM++qH?;b4tAkpqAb`U$uS?-U`C1*;R=S+DAN~`%IiwA4_1D&%> z(iyv8n6pM|!T-P$CeFd~<05AMUq1iY{X)$sJqP&Di6c*PJotPX9C?x}wW#|);>ius zKDG2IsUa7XlCtZJJjvO+X0lW&ympN|$!UYIR4mTJne&E7p6%p%KbS0wq&9Nyf8$Ax zw~2r7fec9u(suS+nCo4V}j67M5JXzVttbgpu%8nd@_P?F- z4MusC5PSn1Fo;M3SFa$i!>cB17Cp+GYopL?QbA*@j&@Kap^}z@3{{oGe BDK`KB literal 0 HcmV?d00001 diff --git a/zoraking.asm b/zoraking.asm new file mode 100644 index 00000000..8c516657 --- /dev/null +++ b/zoraking.asm @@ -0,0 +1,8 @@ +;================================================================================ +; Randomize Zora King +;-------------------------------------------------------------------------------- +LoadZoraKingItemGFX: + LDA.l $1DE1C3 ; location randomizer writes zora item to + JSL.l PrepDynamicTile +RTL +;-------------------------------------------------------------------------------- \ No newline at end of file