-
Notifications
You must be signed in to change notification settings - Fork 53
/
hooks.asm
2545 lines (2325 loc) · 120 KB
/
hooks.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
;================================================================================
; Init Hook
; this needs to be a JML, otherwise we're not using fast ROM when we return
;--------------------------------------------------------------------------------
org $80802F
JML Init_Primary
NOP
ReturnFromInit:
org $8CC1AC ; <- 63 D4 00 - Bank0C.asm:8 (dl Tagalong_LoadGfx)
dl Init_PostRAMClear
;--------------------------------------------------------------------------------
;================================================================================
; Frame Hook
;--------------------------------------------------------------------------------
org $808056 ; <- 56 - Bank00.asm : 77
JSL FrameHookAction
;--------------------------------------------------------------------------------
org $80805D
JML HandleOneMindController
;================================================================================
; NMI Hook
;--------------------------------------------------------------------------------
org $8080CC ; <- CC - Bank00.asm : 164 (PHA : PHX : PHY : PHD : PHB)
JML NMIHookAction
NMIHookReturn = $8080D0
;--------------------------------------------------------------------------------
org $80821B ; <- 21B - Bank00.asm : 329 (LDA $13 : STA $2100)
JML PostNMIHookAction : NOP
PostNMIHookReturn:
;--------------------------------------------------------------------------------
;================================================================================
; Anti-ZSNES Hook
;--------------------------------------------------------------------------------
org $808023 ;<- 23 - Bank00.asm : 36 (LDA.w #$01FF : TCS)
JML CheckZSNES
ReturnCheckZSNES:
;--------------------------------------------------------------------------------
;================================================================================
; Ok so basically, in rare cases, major glitches may try to read far into the
; A bus until they reach a value of $FFFF
; For maximum security of vanilla behavior, I am reserving this space
; that could otherwise be considered free ROM.
;--------------------------------------------------------------------------------
org $8089C2
dw $FFFF, $FFFF, $FFFF, $FFFF
dw $FFFF, $FFFF, $FFFF, $FFFF
dw $FFFF, $FFFF, $FFFF, $FFFF
;===================================================================================================
; fastrom interrupts
;===================================================================================================
org $00FFEA : dw NMIBounce
org $00FFEE : dw IRQBounce
org $8098AB
NMIBounce: JML.l $8080C9
IRQBounce: JML.l $8082D8
warnpc $8098C0
;================================================================================
; BSOD for BRK and COP opcodes
;--------------------------------------------------------------------------------
org $80FFB7
SoftwareInterrupt:
JML Crashed
org $80FFE4
dw SoftwareInterrupt
org $80FFE6
dw SoftwareInterrupt
org $80FFF4
dw SoftwareInterrupt
;================================================================================
; Dungeon Entrance Hook (works, but not needed at the moment)
;--------------------------------------------------------------------------------
org $82D8C7 ; <- 158C7 - Bank02.asm : 10981 (STA $7EC172)
JSL OnDungeonEntrance
;--------------------------------------------------------------------------------
;================================================================================
; D-Pad Invert
;--------------------------------------------------------------------------------
org $8083D1 ; <- 3D1 - Bank00.asm (STZ.w JOYPAD - useless instruction here)
JML InvertDPad : SKIP 9
InvertDPadReturn:
;--------------------------------------------------------------------------------
;================================================================================
; Enable/Disable Boots
;--------------------------------------------------------------------------------
org $879C22 ; <- 39222 - Bank07.asm : 4494 (AND $7EF379 : BEQ .cantDoAction)
JSL ModifyBoots
;--------------------------------------------------------------------------------
;================================================================================
; Enable/Disable Bonk Tremors
;--------------------------------------------------------------------------------
org $879202 ; 39202 <- Bank07.asm : 2859 (JSL AddDashTremor : JSL Player_ApplyRumbleToSprites)
JSL AddBonkTremors : NOP #4
;--------------------------------------------------------------------------------
;================================================================================
; Bonk Breakable Walls
;--------------------------------------------------------------------------------
org $81CF8E ; CF8E <- Bank01.asm : 11641 (LDA $0372 : AND.w #$00FF)
JSL BonkBreakableWall : NOP #2
;--------------------------------------------------------------------------------
;================================================================================
; Bonk Rock Pile
;--------------------------------------------------------------------------------
org $87C196 ; 3C196 <- Bank07.asm : 10310 (LDA $02EF : AND.b #$70)
JSL BonkRockPile : NOP
;--------------------------------------------------------------------------------
;================================================================================
; Move Gravestone
;--------------------------------------------------------------------------------
org $87C0FD ; 3C0FD <- Bank07.asm : 10197 (LDA $0372 : BNE .moveGravestone)
JML GravestoneHook : NOP
GravestoneHook_continue:
org $87C106
moveGravestone:
;--------------------------------------------------------------------------------
;================================================================================
; Jump Down Ledge
;--------------------------------------------------------------------------------
org $878966 ; 38966 <- Bank07.asm : 1618 (LDA $1B : BNE .indoors : LDA.b #$02 : STA $EE)
JSL JumpDownLedge : NOP #4
;--------------------------------------------------------------------------------
;================================================================================
; Bonk Recoil
;--------------------------------------------------------------------------------
org $87922C ; 3922C <- Bank07.asm : 2869 (LDA.b #$24 : STA $29)
JSL BonkRecoil
;--------------------------------------------------------------------------------
;================================================================================
; Dungeon Exit Hook
;--------------------------------------------------------------------------------
org $82E21B ; <- 1621B - Bank02.asm : 11211 (STA $040C)
JSL OnDungeonExit : NOP #2
;--------------------------------------------------------------------------------
;================================================================================
; Quit Hook (for both types of save and quit)
;--------------------------------------------------------------------------------
org $89F60B ; <- 4F60B - module_death.asm : 530 (LDA.b #$10 : STA $1C)
JSL OnQuit
;--------------------------------------------------------------------------------
;================================================================================
; Title Screen
;--------------------------------------------------------------------------------
org $8CCDA5 ; <- Bank0C.asm : 1650 (JSL Palette_SelectScreen)
JSL SetFileSelectPalette
;--------------------------------------------------------------------------------
org $8CCE41 ; <- 64E41 - Bank0C.asm : 1907 (DEC $C8 : BPL .done)
JSL FSCursorUp : NOP #4 ; set cursor to only select first file and erase
org $8CCE50 ; <- 64E50 - Bank0C.asm : 1918 (INC $C8)
JSL FSCursorDown : NOP #6 ; set cursor to only select first file and erase
org $8CCE0F ; < 64E0F - Bank0C.asm : 1880 (LDX $00 : INX #2 : CPX.w #$0006 : BCC .nextFile)
NOP #9 ; don't draw the other two save files
;--------------------------------------------------------------------------------
org $8CCE71 ; <- Bank0C.asm : 1941 (LDA.b #$F1 : STA $012C)
JML FSSelectFile : NOP
FSSelectFile_continue:
FSSelectFile_return = $8CCEB1
;--------------------------------------------------------------------------------
; Replace copy file module with a fully custom module
org $808061+$02 ; <- Bank00.asm : 103 (dl Module_CopyFile)
db Module_Password
org $80807D+$02 ; <- Bank00.asm : 103 (dl Module_CopyFile)
db Module_Password>>8
org $808099+$02 ; <- Bank00.asm : 103 (dl Module_CopyFile)
db Module_Password>>16
; Hook up password screen tilemap
org $80937A+$07
db Password_Tilemap
org $809383+$07
db Password_Tilemap>>8
org $80938C+$07
db Password_Tilemap>>16
;--------------------------------------------------------------------------------
org $8CD527 ; <- 65527 : Bank0C.asm : 2913 (LDA.w #$0004 : STA $02) [LDA.w #$0006 : STA $02]
JSL DrawPlayerFile : NOP ; hijack hearts draw routine to draw a full inventory
org $8CCDD5 ; Bank0C.asm:1881 (LDX.w #$00FD)
JSL AltBufferTable : NOP #8 ; Selection screen
org $8CD393 ; Bank0c.asm:2674 (LDX.w #$00FD)
JSL AltBufferTable : NOP #8 ; Delete screen
;--------------------------------------------------------------------------------
org $8CCCCC ;<- 64CCC - Bank0C.asm : 1628 (JSL Intro_ValidateSram) / Bank02.asm : 75 (REP #$30)
; Explanation: In JP 1.0 the code for Intro_ValidateSram was inline in Bank 0C
JML ValidateSRAM ;(Return via RTL. Original code JML'd to Intro_LoadSpriteStats which returns with RTL, but we want to skip that)
org $8CCD57 ;<- 64D57 - Bank0C.asm :
RTL ;Just in case anybody ever removes the previous hook
;--------------------------------------------------------------------------------
org $80E55D ; <- 0655D - Bank00.asm : 5473 (LDA.w #$7000 : STA $2116)
LDA.w #$2000 ; Load file select screen graphics to VRAM word addres 0x2000 instead of 0x7000
;--------------------------------------------------------------------------------
org $80E568 : LDX.w #$0EFF ; Load full decompressed character set into VRAM
;--------------------------------------------------------------------------------
org $80E581 : JSL.l LoadFileSelectVanillaItems : BRA + : NOP #13 : +
;--------------------------------------------------------------------------------
org $80833A ; <- 0033A - Bank00.asm : 481 (LDA.w #$007F)
LDA.w #$0180 ; change which character is used as the blank character for the select screen
;--------------------------------------------------------------------------------
org $8CD50C ; <- 6550C (Not in disassembly, would be in bank0c.asm if it were) Position table for Name and Hearts
dw $00CC, $014A, $01CA ; repositioned, only the first value matters
dw $002A, $0192, $0112
org $8CD53B ; <- 6553B : Bank0c.asm : 2919 (ADD.w #$0010 : STA $102C, Y) [... : STA $1034, Y]
STA.w $1042, Y ; Make 2nd half of names line up properly
org $8CD540 ; <- 65540 : Bank0c.asm : 2923 (INY #2) [INY #4]
NOP #2 ; Remove space between name characters
org $8CD571 ; <- 65571 : Bank0c.asm : 2943 (LDA $04 : ADD.w #$002A : TAY) [... : ADD.w #$0032 : ...]
ADC.w #$0040 ;make Hearts line up properly
;--------------------------------------------------------------------------------
org $8CCC67 ; <- Y position table for File select fairy
db $42, $00, $00, $AF, $C7
org $8CD308 ; <- Y position table for File Delete fairy
db $42, $00, $00, $C7
org $8CD57E ; <- Y position table for File select link sprite
db $3D
org $8CD6BD ; <- Y position table for Death Counts
db $51
;--------------------------------------------------------------------------------
org $8CD55F : JSL.l CheckHeartPaletteFileSelect : NOP #2
;================================================================================
; Name Entry Screen
;--------------------------------------------------------------------------------
org $8CD7BE ; <- 657BE : Bank0C.asm : 3353 (STA $7003D9, X)
JSL WriteBlanksToPlayerName
org $8CDB11 ; <- 65B11 : Bank0C.asm : 3605 (LDA $00 : AND.w #$FFF0 : ASL A : ORA $02 : STA $7003D9, X)
JSL WriteCharacterToPlayerName
org $8CDCA9 ; <- 65CA9 : Bank0C.asm : 3853 (LDA $7003D9, X)
JSL ReadCharacterFromPlayerName
org $8CDC90 ; <- 65C90 : Bank0C.asm : 3847 (ORA $DD24, Y) [ORA $DC82, Y]
JSL GetCharacterPosition
org $8CDA79 ; <- 65A79 : Bank0C.asm : 3518 (LDA $0CDA13, X : STA $0800, Y) [LDA $0CD98F, X : ...]
LDA.l HeartCursorPositions, X
org $8CDAEB ; <- 65AEB : Bank0C.asm : 3571-3575,3581-3587 (...) [LDA $0B12 : AND #$03]
; JP here is different. Indicated line number implement the US version of the same functionality
JSL WrapCharacterPosition : NOP
org $8CD75E ; bank_0C.asm (dl NameFile_MakeScreenVisible)
dl MaybeForceFileName
;--------------------------------------------------------------------------------
org $8CE43A ; No assembly source. Makes name entry box wider
db $2C
org $8CE448
db $2D, $40, $1E
org $8CE45C
db $4D, $40, $1E
org $8CE462
db $6D, $40, $1E
org $8CE468
db $8D, $40, $1E
org $8CE46E
db $AD, $40, $1E
;--------------------------------------------------------------------------------
org $8CE41A
; Fix name screen background to use the not-overwritten copy of its graphics
db $09 : SKIP 5 : db $09 : SKIP 5 : db $09 : SKIP 5 : db $09 : SKIP 5 : db $09 : SKIP 5
db $09 : SKIP 5 : db $49 : SKIP 1 : db $49 : SKIP 1 : db $49 : SKIP 1 : db $49 : SKIP 1
db $C9 : SKIP 5 : db $09 : SKIP 5 : db $09 : SKIP 1 : db $09 : SKIP 1 : db $09 : SKIP 1
db $09 : SKIP 1 : db $89 : SKIP 4 : db $80, $09 : SKIP 4 : db $80, $09 : SKIP 4
db $80, $09 : SKIP 5 : db $89 : SKIP 5
db $49 : SKIP 5 : db $09 : SKIP 5 : db $09 : SKIP 5 : db $49 : SKIP 5 : db $09 : SKIP 5
db $C9 : SKIP 5 : db $89 : SKIP 5 : db $89 : SKIP 5 : db $09 : SKIP 1 : db $09 : SKIP 1
db $09 : SKIP 1 : db $09 : SKIP 1 : db $09 : SKIP 1 : db $09 : SKIP 1 : db $09 : SKIP 1
db $09 : SKIP 5 : db $09 : SKIP 1 : db $09 : SKIP 1 : db $09 : SKIP 1 : db $09 : SKIP 1
db $09 : SKIP 1 : db $09 : SKIP 1 : db $09 : SKIP 1 : db $09 : SKIP 5 : db $05
;--------------------------------------------------------------------------------
;================================================================================
; Delete file Screen
;--------------------------------------------------------------------------------
; Remove code that tries to hide non-selected player files
org $8CD435 ; <- 65435 - Bank0C.asm : 2772 (LDX.b #$64) [LDX.b #$50]
LDX.b #$44
LDA.w $D324, X
org $8CD446 ; <- 65446 - Bank0C.asm : 2782 (LDX $C8 : CPX.b #$02 : BEQ BRANCH_11)
db $80 ; BRA
;--------------------------------------------------------------------------------
;================================================================================
; Remove Mirrored copy of save file
;--------------------------------------------------------------------------------
; Saving to mirrored copy
org $80895D ; <- 0095D - Bank00.asm : 1286 (LDA $7EF000, X : STA $0000, Y : STA $0F00, Y)
SKIP 7 : NOP #3
SKIP 7 : NOP #3
SKIP 7 : NOP #3
SKIP 7 : NOP #3
SKIP 7 : NOP #3
;--------------------------------------------------------------------------------
; remove Clearing mirrored copy on file erase, instead clearing the extended save file too
org $8CD4E3 ; <- Bank0C.asm : 2282 (STA $700400, X : STA $700F00, X : STA $701000, X : STA $701100, X)
JSL ClearExtendedSaveFile
BRA + : NOP #18 : +
;--------------------------------------------------------------------------------
;================================================================================
; Extended SRAM Save file
;--------------------------------------------------------------------------------
org $8CCF08 ; <- Bank0C.asm : 2036 (LDA.w #$0007 : STA $7EC00D : STA $7EC013)
JSL CopyExtendedSaveFileToWRAM
;--------------------------------------------------------------------------------
org $808998 ; <- Bank00.asm : 1296 (LDX.w #$0000)
JSL CopyExtendedWRAMSaveFileToSRAM
;--------------------------------------------------------------------------------
org $80899C ; <- bank_00.asm : #_00899C (CLC)
JSL WriteSaveChecksumAndBackup
PLA : SEP #$30 : PLB : RTL
padbyte $FF : pad $0089C2 ; Fill adjacent free rom forward. See bank_00.asm: #_0089C2
;--------------------------------------------------------------------------------
org $8CD7AB ; <- Bank0C.asm : 3342 (STA $700400, X)
JSL ClearExtendedSaveFile
;--------------------------------------------------------------------------------
org $8CC2EB ; <- Bank0C.asm : 348 (STA $7EF000, X : STA $7EF100, X : STA $7EF200, X : STA $7EF300, X : STA $7EF400, X)
JSL ClearExtendedWRAMSaveFile
;--------------------------------------------------------------------------------
org $89F653 ; <- module_death.asm : 556 (STA $7EF400, X)
JSL ClearExtendedWRAMSaveFile
;--------------------------------------------------------------------------------
;================================================================================
; Remove storage of selected file index from end of vanilla SRAM
;--------------------------------------------------------------------------------
org $8087EB ; <- Bank00.asm : 986 (STA $7EC500 : STA $701FFE)
BRA AfterFileWrittenChecks
;Also skip totally redundant checking and clearing the "file written" marker,
;since it is not even useful in the original code, much less with only one save slot
org $80881F ; <- Bank00.asm : 1011 (STY $01FE)
AfterFileWrittenChecks:
;--------------------------------------------------------------------------------
org $808951 ; <- Bank00.asm : 1278 (LDX $1FFE : LDA $00848A, X : TAY : PHY)
LDX.w #$0002
;--------------------------------------------------------------------------------
org $8CCE85 ; <- Bank0C.asm : 1953 (LDA $C8 : ASL A : INC #2 : STA $701FFE)
NOP #4
;--------------------------------------------------------------------------------
org $8CDB4C ; <- Bank0C.asm : 3655 (LDA $C8 : ASL A : INC #2 : STA $701FFE : TAX)
JML OnFileCreation : NOP
;--------------------------------------------------------------------------------
org $89F5EA ; <- module_death.asm : 510 (LDA $701FFE : TAX : DEX #2)
LDA.w #$0002 : NOP
;--------------------------------------------------------------------------------
org $8EEFEB ; <- vwf.asm : 310 (LDA $701FFE : TAX)
LDA.w #$0002 : NOP
;--------------------------------------------------------------------------------
;================================================================================
; Cross World Damage fixes
;--------------------------------------------------------------------------------
org $868891 ; Sprite_Prep.asm : 378 //LDA .damage_class, Y : STA $0CD2, X
NOP #8
JSL NewBatInit
;================================================================================
; Damage table Relocation from WRAM
;--------------------------------------------------------------------------------
org $86EDB5 ;<- 36DBE - Bank06.asm : 4882 (LDA $7F6000, X : STA $02)
JSL LookupDamageLevel
;--------------------------------------------------------------------------------
org $9EAB5E ;<- F2B5E - sprite_stalfos_knight.asm : 135 (LDA.b #$00 : STA $7F6918)
STA.l StalfosBombDamage
org $9EAAD6 ;<- F2AB6 - sprite_stalfos_knight.asm : 32 (LDA.b #$02 : STA $7F6918)
STA.l StalfosBombDamage
;--------------------------------------------------------------------------------
;================================================================================
; Duck Map Load Hook
;--------------------------------------------------------------------------------
org $8AB76E ; <- 5376E - Bank0A.asm : 30 (JSL OverworldMap_InitGfx)
JSL OnLoadDuckMap
;================================================================================
; Infinite Bombs / Arrows / Magic
;--------------------------------------------------------------------------------
org $88A17A ; <- 4217A - ancilla_arrow.asm : 42 (AND.b #$04 : BEQ .dont_spawn_sparkle)
CMP.b #$03 : db $90 ; !BLT
org $88A40E ; <- 4240E - ancilla_arrow.asm : 331 (AND.b #$04 : BNE .use_silver_palette)
CMP.b #$03 : db $B0 ; !BGE
;--------------------------------------------------------------------------------
org $898127 ; <- 48127 - ancilla_init.asm : 202 (LDA $7EF343 : BNE .player_has_bombs)
JSL LoadBombCount
org $898133 ; <- 48133 - ancilla_init.asm : 211 (STA $7EF343 : BNE .bombs_left_over)
JSL StoreBombCount
;--------------------------------------------------------------------------------
org $8DE4BF ; <- 6E4BF - equipment.asm : 1249 (LDA $7EF343 : AND.w #$00FF : BEQ .gotNoBombs)
JSL LoadBombCount16
;--------------------------------------------------------------------------------
org $8DDEB3 ; <- 6DEB3 - equipment.asm : 328 (LDA $7EF33F, X)
JSL IsItemAvailable
;--------------------------------------------------------------------------------
org $8DDDE8 ; <- 6DDE8 - equipment.asm : 148 (LDA $7EF340)
JSL SearchForEquippedItem
;--------------------------------------------------------------------------------
org $8DDE70 ; <- 6DE70 - equipment.asm : 273 (LDA $7EF340)
JSL SearchForEquippedItem
;--------------------------------------------------------------------------------
org $8DE39D ; <- 6E39D - equipment.asm : 1109 (LDA $7EF340)
JSL SearchForEquippedItem
;--------------------------------------------------------------------------------
;================================================================================
; Inverted Mode
;--------------------------------------------------------------------------------
org $828413 ; <- 10413 - Bank02.asm : 853 (LDA $7EF357 : BNE .notBunny)
NOP #6
JSL DecideIfBunny : db $D0 ; BNE
;--------------------------------------------------------------------------------
org $87AA44 ; <- 3AA44 - Bank07.asm : 853 (LDA $7EF357 : BNE .playerHasMoonPearl)
NOP #6
JSL DecideIfBunnyByScreenIndex : db $D0 ; BNE
;--------------------------------------------------------------------------------
org $82D9B9 ; <- 159B9 - Bank02.asm : 11089 (LDA $7EF3C8)
JSL AllowStartFromSingleEntranceCave
;--------------------------------------------------------------------------------
org $828496 ; <- 15496 - Bank02.asm : 959 (LDA $7EF3C8 : PHA)
JML AllowStartFromExit
AllowStartFromExitReturn:
;--------------------------------------------------------------------------------
org $9BC2A7 ; <- DC2A7 - Bank1B.asm : 1143 (Overworld_CreatePyramidHole:)
JSL Overworld_CreatePyramidHoleModified : RTL
C9DE_LONG:
JSR.w $1BC9DE : RTL ; surprisingly same address as US
;--------------------------------------------------------------------------------
org $87FF5F ; <- 3ff5f - Bank0E.asm : 5252 (LDA.w #$0E3F : STA $23BC)
JSL Draw_PyramidOverlay : RTS
;--------------------------------------------------------------------------------
;Remove Electric Barrier Hook
org $86891E ; <- sprite_prep.asm : 537 (LDA $7EF280, X : PLX : AND.b #$40 : BEQ .not_dead)
JSL Electric_Barrier
;--------------------------------------------------------------------------------
org $88CDAC ; <- ancilla_break_tower_seal.asm : 117 (LDA.b #$05 : STA $04C6)
JSL GanonTowerAnimation : NOP #05
;--------------------------------------------------------------------------------
org $9AF5C1 ; <- sprite_waterfall.asm : 40 (LDA $8A : CMP.b #$43)
JSL GanonTowerInvertedCheck
;--------------------------------------------------------------------------------
org $82EC8D ; <- bank02.asm : 11981 (LDA.w #$020F : LDX $8A : CPX.w #$0033 : BNE .noRock)
JSL HardcodedRocks : NOP #19 ;23 bytes removed with the JSL
;--------------------------------------------------------------------------------
org $84E7AE ; <- bank0E.asm : 4230 (LDA $7EF287 : AND.w #$0020)
JSL TurtleRockPegSolved
org $84E7B9 ; <- bank0E.asm : 4237 (LDX $04C8)
JMP.w TurtleRockTrollPegs
TurtleRockPegCheck:
org $84E7C9
TurtleRockPegSuccess:
org $84E7F5
TurtleRockPegFail:
org $84E96F
PegProbability:
db $00 ; Probability out of 255. 0 = Vanilla behavior
TurtleRockTrollPegs:
SEP #$20
LDX.w $04C8 : CPX.w #$FFFF : BEQ .vanilla
JSL GetRandomInt
LDA.l PegProbability : BEQ .vanilla : CMP.l $7E0FA1
REP #$20 : !BGE .succeed
.fail
JMP.w TurtleRockPegFail
.succeed
JMP.w TurtleRockPegSuccess
.vanilla
REP #$20 : JMP.w TurtleRockPegCheck
;--------------------------------------------------------------------------------
org $9BBD05 ; <- bank1B.asm : 261 (TYA : STA $00) ; hook starts at the STA
JML PreventEnterOnBonk : NOP
PreventEnterOnBonk_return:
org $9BBD77 ; <- bank1B.asm : 308 (SEP #$30)
PreventEnterOnBonk_BRANCH_IX:
;--------------------------------------------------------------------------------
;================================================================================
; Crystals Mode
;--------------------------------------------------------------------------------
org $899B7F ; <- ancilla_init.asm : 4136 (LDA $7EF37A : AND.b #$7F : CMP.b #$7F)
JSL CheckTowerOpen : BCC $899B6D
;--------------------------------------------------------------------------------
org $88CE0C ; <- 44E0C - ancilla_break_tower_seal.asm : 168 (BEQ #$03 : JSR BreakTowerSeal_ExecuteSparkles : LDX.b #$06)
JML GetRequiredCrystalsForTower : NOP #3
GetRequiredCrystalsForTower_continue:
;--------------------------------------------------------------------------------
org $88CF19 ; <- 44F19 - ancilla_break_tower_seal.asm : 336 (TXA : AND.b #$07 : TAX)
JSL GetRequiredCrystalsInX
;--------------------------------------------------------------------------------
org $88CFC9 ; <- 44FC9 - ancilla_break_tower_seal.asm : 414 (RTS)
RTL
;--------------------------------------------------------------------------------
;================================================================================
; Hash Key Display
;--------------------------------------------------------------------------------
org $8CCDB5 ; <- 64DB5 - Bank0C.asm : 1776 (LDA.b #$06 : STA $14)
JSL OnPrepFileSelect
;================================================================================
; Light speed
;--------------------------------------------------------------------------------
; Message
org $9ED4FF
JSL AgahnimAsksAboutPed
; Spam blue balls if ped not pulled
org $9ED6E8
JSL CheckAgaForPed : NOP
;================================================================================
; Zelda Sprite Fixes
;--------------------------------------------------------------------------------
org $85EBCF ; <- 2EBCF - sprite_zelda.asm : 23 (LDA $7EF359 : CMP.b #$02 : BCS .hasMasterSword)
JSL SpawnZelda : NOP #2
;================================================================================
; Alternate Goal
;--------------------------------------------------------------------------------
;Invincible Ganon
org $86F2C8 ; <- 372C8 - Bank06.asm : 5776 (LDA $44 : CMP.b #$80 : BEQ .no_collision)
JSL GoalItemGanonCheck
;--------------------------------------------------------------------------------
;Hammerable Ganon
org $86F2EA ; <- 372EA - Bank06.asm : 5791 (LDA $0E20, X : CMP.b #$D6 : BCS .no_collision)
JSL CheckGanonHammerDamage : NOP
;--------------------------------------------------------------------------------
org $858922
JSL.l CheckPedestalPull : BCC MasterSword_InPedestal_exit
;================================================================================
; Stat Hooks
;--------------------------------------------------------------------------------
org $82B797 ; <- 13797 - Bank02.asm : 8712 (LDA.b #$19 : STA $10)
JSL StatsFinalPrep
;--------------------------------------------------------------------------------
org $87A95B ; <- 3A95B - Bank07.asm : 6565 (JSL Dungeon_SaveRoomDataWRAM)
JSL IncrementUWMirror
;--------------------------------------------------------------------------------
org $8288D1 ; <- 108D1 - Bank02.asm : 1690 (STZ $0646)
JSL IndoorSubtileTransitionCounter : NOP #2
org $86D192 ; <- 35192 - sprite_absorbable.asm : 274 (STA $7EF36F)
JSL IncrementSmallKeysNoPrimary
;--------------------------------------------------------------------------------
org $80F945 ; <- 7945 - Bank00.asm : 8557 (JSL SavePalaceDeaths)
JSL OnDungeonBossExit
;--------------------------------------------------------------------------------
org $89F443 ; <- 4F443 - module_death.asm : 257 (STA $7EF35C, X)
JSL IncrementFairyRevivalCounter
;--------------------------------------------------------------------------------
org $82B6F3 ; <- 136F3 - Bank02.asm : 8600 (LDA.b #$0F : STA $10)
JSL DungeonExitTransition
;--------------------------------------------------------------------------------
org $9BBD6A ; <- DBD6A - Bank1B.asm : 301 (LDA.b #$0F : STA $10)
JSL DungeonExitTransition
;--------------------------------------------------------------------------------
org $81C3A7 ; <- C3A7 - Bank01.asm : 9733 (JSL Dungeon_SaveRoomQuadrantData)
JSL DungeonStairsTransition
;--------------------------------------------------------------------------------
org $8BFFAC ; <- 5FFAC - Bank0B.asm : 170 (JSL Dungeon_SaveRoomQuadrantData)
JSL DungeonStairsTransition
;--------------------------------------------------------------------------------
org $829A17 ; <- 11A17 - Bank02.asm : 4770 (JSL EnableForceBlank)
JSL DungeonHoleEntranceTransition
;--------------------------------------------------------------------------------
org $8794EB ; <- 394EB - Bank07.asm : 3325 (LDA $01C31F, X : STA $0476)
JSL DungeonHoleWarpTransition
;--------------------------------------------------------------------------------
org $8CC999 ; <- 64999 - Bank0C.asm : 1087 (LDA.b #$0F : STA $13)
NOP #4
;--------------------------------------------------------------------------------
org $81ED75 ; <- ED75 - Bank01.asm : 13963 (JSL Dungeon_SaveRoomQuadrantData)
JSL IncrementBigChestCounter
;--------------------------------------------------------------------------------
org $8EE67A : STA.l PostGameCounter : BRA + : NOP #18 : +
;================================================================================
; DialogOverride
;--------------------------------------------------------------------------------
org $8EF1FF : JSL DialogOverride ; DialogOverride
org $8EF2DC : JSL DialogOverride ; DialogOverride
org $8EF315 : JSL DialogOverride ; DialogOverride
org $8EF332 : JSL DialogOverride ; DialogOverride
org $8EF375 : JSL DialogOverride ; DialogOverride
org $8EF394 : JSL DialogOverride ; DialogOverride
org $8EF511 : JSL DialogOverride ; DialogOverride
org $8EF858 : JSL DialogOverride ; DialogOverride
org $8EFA26 : JSL DialogOverride ; DialogOverride
org $8EFA4C : JSL DialogOverride ; DialogOverride
org $8EFAB4 : JSL DialogOverride ; DialogOverride
org $8EFAC8 : JSL DialogOverride ; DialogOverride
org $8EFAE1 : JSL DialogOverride ; DialogOverride
org $8EFB11 : JSL DialogOverride ; DialogOverride
;--------------------------------------------------------------------------------
org $8EFBC6 ; <- 77BC6 - vwf.asm : 2717 (LDA.b #$1C : STA $1CE9)
JSL ResetDialogPointer : RTS
;--------------------------------------------------------------------------------
org $8EED0B ; <- PC 0x76D0B - Bank0E.asm : 3276 (LDA $E924, Y : STA $1008, X)
JSL EndingSequenceTableOverride : NOP #2
;--------------------------------------------------------------------------------
org $8EED15 ; <- PC 0x76D15 - Bank0E.asm : 3282 (LDA $E924, Y : STA $1008, X)
JSL EndingSequenceTableOverride : NOP #2
;--------------------------------------------------------------------------------
org $8EED2A ; <- PC 0x76D2A - Bank0E.asm : 3295 (LDA $E924, Y : AND.w #$00FF)
JSL EndingSequenceTableLookupOverride : NOP #7
;--------------------------------------------------------------------------------
;================================================================================
; Master Sword Overlay Fix
;--------------------------------------------------------------------------------
org $8987B2 ; <- ancilla_init.asm : 1051 (LDA.b #$09)
JSL PedestalPullOverlayFix
org $8987B8 ; <- ancilla_init.asm : 1055 (STA $039F, X)
NOP #3
org $8987DF ; <- ancilla_init.asm : 1077 (STA $039F, X)
NOP #3
;--------------------------------------------------------------------------------
;================================================================================
; File Select Init Event
;--------------------------------------------------------------------------------
org $8CCC89 ; <- 0x64C89 Bank0C.asm : 1598 (JSL EnableForceBlank)
JSL OnInitFileSelect
;================================================================================
; Hyrule Castle Rain Sequence Guards (allowing Gloves in Link's house)
;--------------------------------------------------------------------------------
org $89C8B7 ; <- 4C8B7
dw CastleRainSpriteData
org $89F7BD ; <- 4F7BD
CastleRainSpriteData:
db $06, $1F, $40, $12, $01, $3F, $14, $01, $3F, $13, $1F, $42, $1A, $1F, $4B, $1A, $20, $4B, $25, $2D, $3F, $29, $20, $3F, $2A, $3C, $3F, $FF
;--------------------------------------------------------------------------------
;================================================================================
; Sprite_DrawMultiple
;--------------------------------------------------------------------------------
org $85DFB1 ; <- 2DFB1 - Bank05.asm : 2499
JSL SkipDrawEOR
;================================================================================
; Kiki Big Bomb Fix
;--------------------------------------------------------------------------------
org $9EE4AF ; <- f64af sprite_kiki.asm : 285 (LDA.b #$0A : STA $7EF3CC)
JSL AssignKiki : NOP #2
;================================================================================
; Wallmaster camera fix
;--------------------------------------------------------------------------------
org $9EAF77 ; <- F2F77 sprite_wallmaster.asm : 141 (LDA.b #$2A : JSL Sound_SetSfx3PanLong)
JSL WallmasterCameraFix
;================================================================================
; Hard & Masochist Mode Fixes
;--------------------------------------------------------------------------------
org $87D22B ; <- 3D22B - Bank05.asm : 12752 (LDA $D055, Y : STA $0373)
JSL CalculateSpikeFloorDamage : NOP #2
;--------------------------------------------------------------------------------
org $88DCC3 ; <- 45CC3 - ancilla_cane_spark.asm : 272 (LDA $7EF36E)
JSL CalculateByrnaUsage
;--------------------------------------------------------------------------------
org $87AE17 ; <- 3AE17 - Bank07.asm : 7285 (LDA $7EF36E)
JSL CalculateCapeUsage
;--------------------------------------------------------------------------------
org $87AE98 ; <- 3AE98 - Bank07.asm : 7380 (LDA $7EF36E)
JSL CalculateCapeUsage
;--------------------------------------------------------------------------------
org $88DCA7 ; <- 45CA7 - ancilla_cane_spark.asm : 256 (LDA.b #$01 : STA $037B)
JSL ActivateInvulnerabilityOrDont : NOP
;--------------------------------------------------------------------------------
org $86EDC6 ; <- 36DC6 - Bank06.asm : 4890 (LDA $0DB8F1, X)
JSL GetItemDamageValue
;--------------------------------------------------------------------------------
;================================================================================
; Misc Stats
;--------------------------------------------------------------------------------
org $80F970
JSL OnAga1Defeated
org $829E2E ; <- 11E2E - module_ganon_emerges.asm : 59 (JSL Dungeon_SaveRoomDataWRAM.justKeys)
JSL OnAga2Defeated
;--------------------------------------------------------------------------------
org $8DDBDE ; <- 6DBDE - headsup_display.asm : 105 (DEC A : BPL .subtractRupees)
JSL IncrementSpentRupees : NOP #6
;================================================================================
; Remove Item Menu Text
;--------------------------------------------------------------------------------
org $8DEBB0 ; <- 6EBB0 - equipment.asm : 1810 (LDA $0202)
JMP DrawItem_finished
org $8DECE6 ; <- 6ECE6 - equipment.asm : 1934 (SEP #$30)
DrawItem_finished:
org $8DEB48 ; <- 6EB48 - equipment.asm : 1784 (LDA $0000)
LDA.w $0000, Y : STA.w GFXStripes+$01F2
LDA.w $0002, Y : STA.w GFXStripes+$01F4
LDA.w $0040, Y : STA.w GFXStripes+$0232
LDA.w $0042, Y : STA.w GFXStripes+$0234
;---------------------------
org $8DE24B ; <- 6E24B - equipment.asm : 951 (LDA $0000)
LDA.w $0000, Y : STA.w GFXStripes+$01F2
LDA.w $0002, Y : STA.w GFXStripes+$01F4
LDA.w $0040, Y : STA.w GFXStripes+$0232
LDA.w $0042, Y : STA.w GFXStripes+$0234
;--------------------------------------------------------------------------------
org $8DE2DC ; <- 6E2DC - equipment.asm : 989 (LDA $F449, X : STA $122C, Y)
JMP UpdateBottleMenu_return
UpdateBottleMenu_return = $8DE2F1 ; <- 6E2F1 - equipment.asm : 1000 (SEP #$30)
;--------------------------------------------------------------------------------
org $8DE6F4 ; <- 6E6F4 - equipment.asm : 1474 (BCC .lacksAbility)
db $80 ; BRA
org $8DE81A ; <- 6E81A - equipment.asm : 1597 (STA $00)
RTS
org $8DE7B9 ; <- 6E7B9 - equipment.asm : 1548 (LDA.w #$16D0 : STA $00)
JSL DrawGlovesInMenuLocation : NOP
org $8DE7CF ; <- 6E7CF - equipment.asm : 1554 (LDA.w #$16C8 : STA $00)
JSL DrawBootsInMenuLocation : NOP
org $8DE7E5 ; <- 6E7E5 - equipment.asm : 1560 (LDA.w #$16D8 : STA $00)
JSL DrawFlippersInMenuLocation : NOP
org $8DECEB ; <- 6ECEB - equipment.asm : 1946 (LDA.w #$16E0 : STA $00)
JSL DrawMoonPearlInMenuLocation : NOP
;================================================================================
; Zelda S&Q Mirror Fix
;--------------------------------------------------------------------------------
org $82D9A4 ; <- 159A4 - Bank02.asm : 11077 (dw $0000, $0002, $0002, $0032, $0004, $0006, $0030)
dw $0000, $0002, $0004, $0032, $0004, $0006, $0030
;================================================================================
; Accessibility
;--------------------------------------------------------------------------------
org $82A3F4 ; <- 123F4 - Bank02.asm : 6222 (LDA.b #$72 : BRA .setBrightness)
BRA + : NOP #2 : +
org $82A3FD ; <- 123FD - Bank02.asm : 6233 (LDA.b #$32 : STA $9A)
JSL ConditionalLightning
;--------------------------------------------------------------------------------
org $9DE9CD ; <- EE9CD - Bank1D.asm : 568 (JSL Filter_Majorly_Whiten_Bg)
JSL ConditionalWhitenBg
;--------------------------------------------------------------------------------
org $88AAE9 ; <- 042AE9 - ancilla_ether_spell.asm : 34 (JSL Palette_ElectroThemedGear)
JSL LoadElectroPalette
;--------------------------------------------------------------------------------
org $88AAF5 ; <- 042AF5 - ancilla_ether_spell.asm : 45 (JSL LoadActualGearPalettes)
JSL RestoreElectroPalette
;--------------------------------------------------------------------------------
org $88AAF9 ; -< 42AF9 - ancilla_ether_spell.asm : 46 (JSL Palette_Restore_BG_From_Flash)
JSL RestoreBgEther
;--------------------------------------------------------------------------------
org $88AAED ; <- 42AED - ancilla_ether_spell.asm : 35 (JSL Filter_Majorly_Whiten_Bg)
JSL ConditionalWhitenBg
;--------------------------------------------------------------------------------
org $82FEE6 ; <- 17EE6 - Bank0E.asm : 3907 (RTS)
RTL ; the whiten color routine is only JSL-ed to
;--------------------------------------------------------------------------------
org $87FA7B ; <- 3FA7B - Bank0E.asm : 4735 (REP #$20 : LDX.b #$02)
JML DDMConditionalLightning
;--------------------------------------------------------------------------------
org $87FACB ; <- 3FACB - Bank0E.asm : 4773 (REP #$20 : LDA #$F531, Y)
JSL ConditionalGTFlash : BRA + : NOP #11 : +
;--------------------------------------------------------------------------------
org $8AFF48 ; <- 57F48 - Bank0A.asm : 4935 (REP #$20 : LDA $7EC3DA)
JSL ConditionalRedFlash : BRA + : NOP #13 : +
;--------------------------------------------------------------------------------
org $88C2A1 ; <- 442A3 - ancilla_sword_ceremony.asm : 54 (REP #$20)
JSL ConditionalPedAncilla : BRA + : NOP #4 : +
;--------------------------------------------------------------------------------
org $879976 ; <- 039976 - Bank07.asm : 4009 (JSL Palette_ElectroThemedGear)
JSL LoadElectroPalette
;--------------------------------------------------------------------------------
org $87997C ; <- 03997C - Bank07.asm : 4015 (JSL LoadActualGearPalettes)
JSL RestoreElectroPalette
;================================================================================
; Ice Floor Toggle
;--------------------------------------------------------------------------------
org $87D234 ; <- 3D234 - Bank07.asm : 12758 (LDA $0348 : AND.b #$11 : BEQ .notWalkingOnIce)
JSL LoadModifiedIceFloorValue_a11 : NOP
;--------------------------------------------------------------------------------
org $87D26E ; <- 3D26E - Bank07.asm : 12786 (LDA $0348 : AND.b #$01 : BNE BRANCH_RESH)
JSL LoadModifiedIceFloorValue_a01 : NOP
;================================================================================
; Sword Upgrade Randomization
;--------------------------------------------------------------------------------
org $83FC16 ; <- 1FC16 ($A8, $B8, $3D, $D0, $B8, $3D)
db $B1, $C6, $F9, $C9, $C6, $F9 ; data insert - 2 chests, fat fairy room
; unused item receipts
org $81E97E
dw $0116 : db $08
dw $0116 : db $25
;--------------------------------------------------------------------------------
PyramidFairy_BRANCH_IOTA = $86C936
PyramidFairy_BRANCH_GAMMA = $86C948
;--------------------------------------------------------------------------------
org $9EE16E ; <- F616E - sprite_bomb_shop_entity.asm : 73
NOP #8 ; fix bomb shop dialog for dwarfless big bomb
org $868A14 ; <- 30A14 - sprite_prep.asm : 716
NOP #8 ; fix bomb shop spawn for dwarfless big bomb
;--------------------------------------------------------------------------------
org $86B489 ; <- 33489 - sprite_smithy_bros.asm : 473 (LDA $7EF359 : CMP.b #$03 : BCS .tempered_sword_or_better)
JML GetSmithSword : NOP #4
Smithy_DoesntHaveSword:
org $86B49D ; <- 3349D - sprite_smithy_bros.asm : 485 (.tempered_sword_or_better)
Smithy_AlreadyGotSword:
;--------------------------------------------------------------------------------
org $86ED55 ; <- 36D55 - Bank06.asm : 4817
JSL LoadSwordForDamage ; moth gold sword fix
;--------------------------------------------------------------------------------
org $88C5F7 ; <- 445F7 - ancilla_receive_item.asm : 400 (LDA.b #$09 : STA $012D)
NOP #5 ; remove spooky telepathy sound
;--------------------------------------------------------------------------------
org $88C431 ; <- 44431 - ancilla_receive_item.asm : 125 (LDA $0C5E, X : CMP.b #$01 : BNE .notMasterSword2)
JSL MSMusicReset : NOP
;================================================================================
; Temporary Nerfs and Buffs
;--------------------------------------------------------------------------------
org $86F400 ; <- 37F400 - Bank06.asm : 5963 (CLC : ADC $7EF35B)
JSL LoadModifiedArmorLevel : NOP
;--------------------------------------------------------------------------------
org $87ADDB ; <- 3ADDB - Bank07.asm : 7251 (LDA $7EF37B : TAY)
JSL LoadModifiedMagicLevel
;--------------------------------------------------------------------------------
org $87AE0D ; <- 3AE0D - Bank07.asm : 7279 (LDA $7EF37B : TAY)
JSL LoadModifiedMagicLevel
;--------------------------------------------------------------------------------
org $87AE8E ; <- 3AE8E - Bank07.asm : 7376 (LDA $7EF37B : TAY)
JSL LoadModifiedMagicLevel
;--------------------------------------------------------------------------------
org $88DCB9 ; <- 45CB9 - ancilla_cane_spark.asm : 256 (LDA $7EF37B : TAY)
JSL LoadModifiedMagicLevel
;--------------------------------------------------------------------------------
org $87B08B
LinkItem_MagicCostBaseIndices:
;--------------------------------------------------------------------------------
org $87B096 ; <- 3B096 - Bank07.asm : 7731 (LDA LinkItem_MagicCostBaseIndices, X : CLC : ADC $7EF37B : TAX)
JSL LoadModifiedMagicLevel : !ADD.w LinkItem_MagicCostBaseIndices, X
;--------------------------------------------------------------------------------
org $87B0D5 ; <- 3B0D5 - Bank07.asm : 7783 (LDA LinkItem_MagicCostBaseIndices, X : CLC : ADC $7EF37B : TAX)
JSL LoadModifiedMagicLevel : !ADD.w LinkItem_MagicCostBaseIndices, X
;================================================================================
; Faster Great Fairies
;--------------------------------------------------------------------------------
org $86C83D ; <- sprite_ponds.asm : 784 ( LDA.b #$FF : STA $0DF0, X )
db $30 ; (any faster and she appears as link is still throwing the bottle)
;--------------------------------------------------------------------------------
org $86C896 ; <- sprite_ponds.asm : 844 ( LDA $1A : AND.b #$07 : BNE BRANCH_ALPHA )
db $03 ; fade in speed. Should be power of 2 minus 1
org $86C985 ; <- sprite_ponds.asm : 1025 ( LDA $1A : AND.b #$07 : BNE BRANCH_ALPHA )
db $03 ; fade out speed. Should be power of 2 minus 1
;================================================================================
; New Items
;--------------------------------------------------------------------------------
org $87B574 ; <- 3B574 - Bank07.asm : 8519 (LDA.b #$01 : STA $02E9)
JSL ChestPrep : NOP #3
db $90 ; !BCC .cantOpen
;--------------------------------------------------------------------------------
org $80D531 ; 5531 - Bank00.asm:3451 (LDY.b #$5D)
JML GetAnimatedSpriteGfxFile
org $80D547 ; 5547 - Bank00.asm:3467 (JSR Decomp_spr_high)
GetAnimatedSpriteGfxFile_return:
org $80D557 ; 5557 - Bank00.asm:3486 (LDA $00 : ADC $D469, X)
JSL GetAnimatedSpriteBufferPointer : NOP
org $8799F7 ; 399F7 - Bank07.asm:4107 (JSL AddReceivedItem)
JSL AddReceivedItemExpanded
org $898611 ; 48611 - ancilla_init.asm:720 (LDA .item_target_addr+0, X)
LDA.w ItemReceipts_target+0, X
org $898616 ; 48616 - ancilla_init.asm:721 (LDA .item_target_addr+1, X)
LDA.w ItemReceipts_target+1, X
org $89861F ; 4861F - ancilla_init.asm:724 (LDA .item_values, Y)
LDA.w ItemReceipts_value, Y
org $898627 ; 48627 - ancilla_init.asm:731 (LDA .item_target_addr+0, X)
LDA.w ItemReceipts_target+0, X
org $89862C ; 4862C - ancilla_init.asm:722 (LDA .item_target_addr+1, X)
LDA.w ItemReceipts_target+1, X
org $898635 ; 48635 - ancilla_init.asm:727 (LDA .item_values, Y)
LDA.w ItemReceipts_value, Y
org $8986AA ; 486AA - ancilla_init.asm:848 (LDA .item_masks, X)
LDA.w DungeonItemMasks, X
org $898769 ; 48769 - ancilla_init.asm:1005 (LDA .item_graphics_indices, Y)
LDA.w ItemReceipts_graphics, Y
org $898811
JSL.l SetItemRiseTimer
org $89884D ; 4884D - ancilla_init.asm:1137 (LDA $836C, Y)
LDA.w ItemReceipts_offset_y, Y
org $89885B ; 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 ItemReceipts_offset_x, Y
org $8988B7 ; 488B7 - ancilla_init.asm:1199 (LDA .wide_item_flag, Y)
LDA.w SpriteProperties_chest_width, Y
org $8988EF ; 488EF - ancilla_init.asm:1248 (LDA $836C, Y)
LDA.w ItemReceipts_offset_y, Y
org $898908 ; 48908 - ancilla_init.asm:1258 (LDA .x_offsets, Y)
LDA.w ItemReceipts_offset_x, Y
org $88C6C8 ; 446C8 - ancilla_receive_item.asm:538 (LDA AddReceiveItem.properties, X)
JSL CheckReceivedItemPropertiesBeforeLoad
org $88C6DE ; 446DE - ancilla_receive_item.asm:550 (LDA .wide_item_flag, X)
JSL.l ItemReceiptWidthCheck
org $88C6F9 ; 446F9 - ancilla_receive_item.asm:570 (LDA AddReceiveItem.properties, X)
JSL CheckReceivedItemPropertiesBeforeLoad
org $8985ED ; 485ED - ancilla_init.asm:693 (LDA $02E9 : CMP.b #$01)
JSL AddReceivedItemExpandedGetItem : NOP
org $87B57D ; 3B57D - Bank07.asm:8527 (LDA Link_ReceiveItemAlternates, Y : STA $03)
BRA Link_PerformOpenChest_no_replacement
;--------------------------------------------------------------------------------
org $89892E ; 4892E - ancilla_init.asm:1307 (LDA BottleList, X)
LDA.w BottleListExpanded, X
org $89895C ; 4895C - ancilla_init.asm:1344 (LDA PotionList, X)
LDA.w PotionListExpanded, X
;--------------------------------------------------------------------------------
org $86D1EB ; 351EB - sprite_absorbable.asm:364 (STA $7EF375) ; bugbug commented out until i figure out why it doesn't work
JSL HandleBombAbsorbtion
;================================================================================
; Kholdstare Shell Fix
;--------------------------------------------------------------------------------
org $80EC88 ; <- 6C88 - Bank00.asm:6671 - (LDA $7EC380, X : STA $7EC580, X)
LDA.l $7EC3A0, X : STA.l $7EC5A0, X
;--------------------------------------------------------------------------------
org $80ECEB ; <- 6CEB - Bank00.asm:6730 - (LDX.w #$0080)
LDX.w #$00A0 : LDA.w #$00B0
;================================================================================
; Potion Refill Fixes
;--------------------------------------------------------------------------------
org $80F8FB ; <- 78FB - Bank00.asm:8507 - (JSL HUD.RefillHealth : BCC BRANCH_ALPHA)
JSL RefillHealth
;--------------------------------------------------------------------------------
org $80F911 ; <- 7911 - Bank00.asm:8528 - (JSL HUD.RefillMagicPower : BCS BRANCH_$7901)
JSL RefillMagic
;--------------------------------------------------------------------------------
org $80F918 ; <- 7918 - Bank00.asm:8537 - (JSL HUD.RefillHealth : BCC .alpha)
JSL RefillHealth
;--------------------------------------------------------------------------------
org $80F922 ; <- 7922 - Bank00.asm:8543 - (JSL HUD.RefillMagicPower : BCC .beta)
JSL RefillMagic
;================================================================================
; Early Bottle Fix
;--------------------------------------------------------------------------------
org $89894C ; <- 4894C - ancilla_init.asm:1327
JSL InitializeBottles
;================================================================================
; Agahnim Doors Fix
;--------------------------------------------------------------------------------
org $899BBA
JSL FlagAgahnimDoor
org $9BBC94 ; <- DBC94 - Bank1B.asm : 201 (LDA $7EF3C5 : AND.w #$000F : CMP.w #$0003 : BCS BRANCH_EPSILON)
JSL LockAgahnimDoors : BNE Overworld_Entrance_BRANCH_EPSILON : NOP #6
org $9BBCC1 ; <- DBCC1 - Bank1B.asm : 223 (LDA $0F8004, X : AND.w #$01FF : STA $00)
Overworld_Entrance_BRANCH_EPSILON: ; go here to lock doors
;--------------------------------------------------------------------------------
; Dungeon Drops
;--------------------------------------------------------------------------------
org $81C50D : JSL.l CheckDungeonWorld
org $81C517 : JSL.l CheckDungeonCompletion
org $81C523 : JSL.l CheckDungeonCompletion