92 Commits

Author SHA1 Message Date
0867a32ad4 Prevent bunny-throwing pots in Aga2's room 2023-04-02 20:46:14 -05:00
2bb66b0cb8 Speed up tile rooms 2023-03-20 18:32:26 -05:00
b86fdcfb32 Fix credits stats 2023-03-20 17:41:43 -05:00
702958f00f Fix no-dashing coming from brewery 2023-03-19 15:52:18 -05:00
28de11a4aa Merge branch 'main' into kara_troll 2023-03-19 15:37:39 -05:00
0e3e3bddbe Kholdstare used confusion! 2023-03-19 12:34:42 -05:00
256bb5ba19 Vitreous - bomb the small eyes 2023-03-19 12:25:06 -05:00
795ce782a9 Poor helmie, his mask is brittle 2023-03-19 11:50:55 -05:00
9d72aee7aa Make aga a lil less friendly 2023-03-19 11:32:16 -05:00
0e710a1b54 Ganon not vulnerable to "silverless" frame 2023-03-19 03:44:29 -05:00
1b36e7672e Randomize Ganon items 2023-03-19 03:07:47 -05:00
8b1f6b9074 Ganon invulverable with a mushroom in the room 2023-03-19 00:43:52 -05:00
1efd8f0f3d No dash Arrgus 2023-03-18 23:19:18 -05:00
136854436d Icy mothfloor 2023-03-18 23:10:23 -05:00
c30113df54 Faster (but still random) dash charge 2023-03-18 23:04:50 -05:00
9f6bd61bdf Faster lanmolas 2023-03-18 23:02:50 -05:00
083a93766c OHKO in Armos Knights room 2023-03-18 22:50:04 -05:00
0d58bb2568 Fix cucco stormer 2023-03-17 15:20:13 -05:00
e7818c8515 Speed up mini-moldorms 2023-03-17 14:18:01 -05:00
2f7a0f2c72 Sidnexx damaged by bombos/ether 2023-03-17 14:17:49 -05:00
0aafee3eae Moldorm stunnable with hookshot/boomerang; only damagable when stunned 2023-03-17 11:41:35 -05:00
e2cc059401 Sword swing slight delay as sword is upgraded 2023-03-17 11:41:29 -05:00
cf278af936 Fix bunny pot-throwing 2023-03-17 11:41:22 -05:00
fd9229ed6b Using shovel indoors bunnies link 2023-03-17 11:40:42 -05:00
d20c8d5d31 Initial trolls:
- random dash timer
- random bomb timer
- flute sometimes summons chickens
- ice physics while carrying things
- lowered i-frames with increased hearts/armor
- Blind impervious (TODO: allow hitting with bunny pots)
2023-03-17 11:40:23 -05:00
2a9b098dac Merge branch 'main' into kara 2023-03-13 21:33:27 -05:00
ad44b610fb Fix conflict between hammer-on-B code with bunny-pressing-A code 2022-11-19 10:11:10 -08:00
98b13507f1 Merge branch 'main' into kara 2022-11-16 14:52:02 -08:00
7d0ce859a3 Fix bomb on file select screen in swordless 2022-11-12 08:29:39 -08:00
a4962b3b8b Add Hammer-On-B mode 2022-11-11 13:30:51 -08:00
9d079dbd0f Revert "Fix mixing progressive/non-progressive swords and shields"
This reverts commit 9bcb72f7bc.
2022-10-12 15:55:18 -07:00
9bcb72f7bc Fix mixing progressive/non-progressive swords and shields 2022-10-08 15:38:20 -07:00
bfc361ad3e Remove non-progressive bomb/cane upgrades 2022-09-18 15:02:37 -07:00
f7070dd30f Merge branch 'main' into kara 2022-07-23 17:33:34 -07:00
9d485e86cd Merge branch 'main' into kara 2022-07-23 16:47:01 -07:00
ba660409bf Bees in beemode only target enemies they can actually affect 2022-05-21 17:50:20 -07:00
3d93b0160f Golden Bee fix 2022-05-21 15:34:44 -07:00
bb35409bc8 Fix checking tablets in bee mode 2022-05-14 11:45:38 -07:00
ffdb5e837a Fix Trinexx 2022-05-12 12:53:29 -07:00
4d4ae6b894 Fix Arrghus 2022-04-30 21:21:21 -07:00
4f4f46352d More improvement to bee mode? 2022-04-30 14:04:22 -07:00
103c41ae94 Bee Mode WIP 2022-04-29 15:23:47 -07:00
90a4c50a01 unscramble lowercase letters for new font 2022-04-02 10:07:03 -07:00
3acc2a3f45 Merge branch 'main' into kara 2022-01-24 13:58:12 -08:00
5fd285c767 Make non-seeded rng a rom flag instead of compile flag 2022-01-24 13:53:03 -08:00
7f551ad1a4 Fix boomerang instakilling Armos Knights 2022-01-24 13:50:44 -08:00
Thomas Prescott
96e3427868 update credits 2022-01-03 12:27:15 -08:00
f629bcb15a Merge branch 'main' into kara 2021-12-29 18:56:36 -08:00
02ea894a40 Add permanent ice physics bit 2021-12-29 18:52:38 -08:00
ac81fcbf0f Fix bee damage 2021-12-27 14:05:28 -08:00
265089cedb Fix moldorm/somaria issue and add both-canes mode 2021-12-22 00:29:56 -08:00
6279f32fe3 Fix width of special cane freestanding sprites 2021-12-21 02:10:16 -08:00
843f1cad6f Prevent hitting stunned ganon in cane-mode with default vulnerability 2021-12-21 01:40:23 -08:00
c23b4ad5b2 Fix mothula/ganon breaking things (hopefully) 2021-12-20 19:02:02 -08:00
22b9c17f09 Remove bomb damage in cane modes 2021-12-20 17:37:49 -08:00
e210c85710 Add cane-only modes 2021-12-20 16:10:11 -08:00
e50641db11 Merge branch 'main' into kara 2021-12-20 01:35:56 -08:00
1ec9f22cea Shorten duration of boomerang stun 2021-11-10 00:08:57 -08:00
18a2214b23 Make boomerang in bomb-only mode stun enemies it would normally damage 2021-11-08 16:37:22 -08:00
f2a0cfc098 Fix bomb icons on file select/endgame screens 2021-11-07 23:58:06 -08:00
6565fbfd65 Show bomb level on file select screen in bomb-only mode 2021-11-07 19:32:57 -08:00
ae0a5c685a Unify handling of bomb colors in bomb-only mode 2021-11-07 00:28:28 -07:00
c323a71340 Merge branch 'main' into kara 2021-10-30 16:37:59 -07:00
f3e0def5a2 Allow early detonation of bombs and add build flag to remove static RNG 2021-10-30 09:02:57 -07:00
1fcde00d09 Merge remote-tracking branch 'kara/pseudoswords' into kara 2021-10-12 13:31:37 -07:00
123dcddc94 Merge branch 'main' into kara 2021-09-21 11:50:40 -07:00
7c8ef3afce Merge branch 'main' into kara 2021-08-26 08:39:23 -07:00
74e2f96e0a Merge branch 'fix_ohko' into kara 2021-08-09 15:32:51 -07:00
dafef001be Merge branch 'main' into kara 2021-08-02 18:59:58 -07:00
3f4db583f5 Add pseudo-sword mode 2021-07-24 16:06:01 -07:00
44f3f10bc1 Merge branch 'main' into kara 2021-07-22 12:05:40 -07:00
2bb5ec87b0 Fix Stalfos Knights in bomb-mode to have bombs instakill while collapsed 2021-07-20 20:33:28 -07:00
86a1f82d23 Color bombs in the HUD according to bomb level in bomb-only mode 2021-07-16 03:48:23 -07:00
1071b834cd Adjust things for replacing sword stats with bomb stats 2021-07-15 13:14:49 -07:00
2693e73a21 move storage of BOMB_LEVEL to make it play nicely with starting equipment 2021-07-13 11:15:07 -07:00
6d52427696 Fix bomb downgrades and track bomb stats in bomb-mode 2021-07-11 13:58:04 -07:00
374abe7e88 Merge branch 'kara' of github.com:ardnaxelarak/z3randomizer into kara 2021-07-11 13:56:01 -07:00
1b698808c3 Add L-1 bombs as separate from no bombs in bomb-only mode 2021-07-11 12:52:20 -07:00
62c81f2cf3 Fix extra space in credits 2021-07-11 02:14:01 -07:00
08166fe669 Allow bombing barrier and getting tablet checks with L2+ bombs 2021-07-10 17:40:08 -07:00
70ec318204 Fix junk graphics appearing during GAME OVER screen 2021-07-10 11:32:33 -07:00
081411a448 Merge branch 'main' into kara 2021-07-08 19:26:55 -07:00
55fd818f55 Merge branch 'main' into kara 2021-07-07 10:27:58 -07:00
37b90894e3 Show bombs placed in credits 2021-07-05 17:57:12 -07:00
f6983cee35 Fix quake not blobbing some enemies in bomb-only mode 2021-07-05 15:40:25 -07:00
642205bc68 Fix hookshot and armos knights
- hookshot now stuns enemies it would normally damage
- armos knights with L-2 bombs now take same damage as L-1 or L-3
2021-07-04 18:28:46 -07:00
a8bc95bd1f NO BOMBOS DAMAGE 2021-07-04 15:43:02 -07:00
0dcef701df Merge commit 'f403ca10da9e009599a531be8cdcd20a61b4801c' of github.com:spannerisms/z3randomizer into kara 2021-07-03 18:25:27 -07:00
1dafb620b0 Merge branch 'main' into kara 2021-07-03 18:23:05 -07:00
828a9df7d9 Allow Ganon to be vulnerable to arbitrary item 2021-06-29 16:28:19 -07:00
ea72d70b1b Implement always-allowed medallions 2021-06-29 16:24:21 -07:00
bf953e7953 Add bomb-only mode 2021-06-29 16:23:15 -07:00
43 changed files with 2458 additions and 701 deletions

2
.gitignore vendored
View File

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

View File

@@ -156,6 +156,9 @@ incsrc darkroomitems.asm
incsrc fastcredits.asm
incsrc msu.asm
incsrc dungeonmap.asm
incsrc special_weapons.asm
incsrc variable_ganon_vulnerability.asm
incsrc trolls.asm
if !FEATURE_NEW_TEXT
incsrc textrenderer.asm
endif
@@ -228,6 +231,16 @@ InvertedCastleHole: ;address used by front end. DO NOT MOVE!
incbin "data/sheet73.gfx"
warnpc $31E501
org $31E800
Damage_Table_Bombs:
incbin damage_table_sword_bombs.bin
warnpc $31F000
org $31F000
Damage_Table_Pseudo:
incbin damage_table_pseudo_sword.bin
warnpc $31F800
org $338000
GFX_HUD_Palette:
incbin "data/hudpalette.pal"

View File

@@ -3,9 +3,13 @@
;--------------------------------------------------------------------------------
ModifyBoots:
PHA
LDA.b RoomIndex : CMP.b #$06 : BNE +
LDA.b RoomIndex+1 : CMP.b #$00 : BEQ .no_boots
+
LDA.l BootsModifier : CMP.b #$01 : BNE +
PLA : AND.l AbilityFlags : ORA.b #$04 : RTL ; yes boots
+ : CMP.b #$02 : BNE +
.no_boots
PLA : AND.l AbilityFlags : AND.b #$FB : RTL ; no boots
+ : LDA.l FakeBoots : CMP.b #$01 : BNE +
LDA.b LinkSlipping : BEQ ++ : LDA.b $59 : BNE + ; hover check

View File

@@ -23,7 +23,10 @@ InvertDPad:
.crowd_control
LDA.l ControllerInverter : BNE +
LDA.b RoomIndex : CMP.b #$DE : BNE .off
LDA.b #$01 : BRA +
.off
LDA.w JOY1L : STA.b Scrap00
LDA.w JOY1H : STA.b Scrap01
JML.l InvertDPadReturn

View File

@@ -9,7 +9,11 @@ CuccoStorm:
SEP #$30 ; set 8-bit accumulator index registers
LDA.l CuccoStormer : BEQ + ; only if storm is on
LDA.b GameMode : CMP.b #$09 : BNE + ; only if outdoors
LDA.b GameMode : CMP.b #$09 : BEQ .check ; only if outdoors
.indoors
LDA.b #$00 : STA.l CuccoStormer ; turn off cucco storm if indoors
BRA +
.check
LDA.l LoopFrames : AND.b #$7F : BNE + ; check every 128 frames
-
@@ -32,9 +36,9 @@ CuccoStorm:
LDA.w SpriteAuxTable, X : CMP.b #!CUCCO_ENRAGED : !BLT ++
PLA : BRA + ; we found an angry cucco, done
++ : INX : BRA -- : .ldone
;==== Create a Cucco
CPY.b #$FF : BNE ++
; we didn't find a cucco, so try to create one
PLY

Binary file not shown.

Binary file not shown.

View File

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

View File

@@ -143,6 +143,11 @@ SetEscapeAssist:
LDA.l EscapeAssist : BIT.b #$02 : BEQ + : LDA.b #$00 : STA.l InfiniteBombs : +
LDA.l EscapeAssist : BIT.b #$01 : BEQ + : LDA.b #$00 : STA.l InfiniteArrows : +
++
LDA.l SpecialWeapons : CMP #$01 : BNE +
LDA.l SpecialWeaponLevel : BEQ +
LDA #$01 : STA InfiniteBombs
+
RTL
;--------------------------------------------------------------------------------
SetSilverBowMode:

Binary file not shown.

Binary file not shown.

View File

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

View File

@@ -54,9 +54,9 @@ FlagAgahnimDoor:
;--------------------------------------------------------------------------------
LockAgahnimDoorsCore:
LDA.b LinkPosX : CMP.w #1992 : !BLT + ; door too far left, skip
CMP.w #2088 : !BGE + ; door too rat right, skip
CMP.w #2088 : !BGE + ; door too rat right, skip
LDA.b LinkPosY : CMP.w #1720 : !BGE + ; door too low, skip
LDA.w #$0001
LDA.w #$0001
RTS
+
LDA.w #$0000
@@ -81,7 +81,7 @@ AllowStartFromSingleEntranceCave:
PHA
TAX
LDA.l StartingAreaExitOffset, X
AND.w #$00FF
AND.w #$00FF
BNE +
JMP .done
@@ -126,7 +126,7 @@ AllowStartFromSingleEntranceCave:
LDA.l StartingEntrance : TAX
LDA.l StartingAreaOverworldDoor, X : STA.l PreviousOverworldDoor ;Load overworld door
REP #$20 ; reset 16-bit accumulator
JSL.l CacheDoorFrameData
JSL.l CacheDoorFrameData
.done
PLA

View File

@@ -16,7 +16,7 @@ JML.l ReturnFromOnDrawHud
;--------------------------------------------------------------------------------
OnDungeonEntrance:
STA.l PegColor ; thing we wrote over
JSL MaybeFlagDungeonTotalsEntrance
JSL MaybeFlagDungeonTotalsEntrance
RTL
;--------------------------------------------------------------------------------
OnPlayerDead:
@@ -70,44 +70,44 @@ OnUncleItemGet:
LDA.l CurrentRupees : !ADD.l FreeUncleItemAmount : STA.l CurrentRupees ; rupee arrows, so also give the player some money to start
SEP #$20 ; set 8-bit accumulator
+
LDA.l ProgressIndicator : BNE +
LDA.b #$01 : STA.l ProgressIndicator ; handle rain state
+
LDA.l ProgressIndicator : BNE +
LDA.b #$01 : STA.l ProgressIndicator ; handle rain state
+
RTL
;--------------------------------------------------------------------------------
OnAga2Defeated:
JSL.l Dungeon_SaveRoomData_justKeys ; thing we wrote over, make sure this is first
LDA.b #$01 : STA.l Aga2Duck
JML.l IncrementAgahnim2Sword
JSL.l Dungeon_SaveRoomData_justKeys ; thing we wrote over, make sure this is first
LDA.b #$01 : STA.l Aga2Duck
JML.l IncrementAgahnim2Sword
;--------------------------------------------------------------------------------
OnFileCreation:
; Copy initial SRAM state from ROM to cart SRAM
; If the inital SRAM table is move these addresses must be changed
PHB
LDA.w #$03D7 ; \
LDX.w #$B000 ; | Copies from beginning of inital sram table up to file name
LDY.w #$0000 ; | (exclusively)
MVN !SRAMBank, !SRAMTableBank ; /
; Skip file name and validity value
LDA.w #$010C ; \
LDX.w #$B3E3 ; | Rando-Specific Assignments & Game Stats block
LDY.w #$03E3 ; |
MVN !SRAMBank, !SRAMTableBank ; /
PLB
; Copy initial SRAM state from ROM to cart SRAM
; If the inital SRAM table is move these addresses must be changed
PHB
LDA.w #$03D7 ; \
LDX.w #$B000 ; | Copies from beginning of inital sram table up to file name
LDY.w #$0000 ; | (exclusively)
MVN !SRAMBank, !SRAMTableBank ; /
; Skip file name and validity value
LDA.w #$010C ; \
LDX.w #$B3E3 ; | Rando-Specific Assignments & Game Stats block
LDY.w #$03E3 ; |
MVN !SRAMBank, !SRAMTableBank ; /
PLB
; resolve instant post-aga if standard
SEP #$20
LDA.l InitProgressIndicator : BIT #$80 : BEQ +
LDA.b #$00 : STA.l ProgressIndicatorSRAM ; set post-aga after zelda rescue
LDA.b #$00 : STA.l OverworldEventDataSRAM+$02 ; keep rain state vanilla
+
REP #$20
; resolve instant post-aga if standard
SEP #$20
LDA.l InitProgressIndicator : BIT #$80 : BEQ +
LDA.b #$00 : STA.l ProgressIndicatorSRAM ; set post-aga after zelda rescue
LDA.b #$00 : STA.l OverworldEventDataSRAM+$02 ; keep rain state vanilla
+
REP #$20
; Set validity value and do some cleanup. Jump to checksum.
LDA.w #$55AA : STA.l FileValiditySRAM
JSL.l WriteNewFileChecksum
STZ.b Scrap00
STZ.b Scrap01
; Set validity value and do some cleanup. Jump to checksum.
LDA.w #$55AA : STA.l FileValiditySRAM
JSL.l WriteNewFileChecksum
STZ.b Scrap00
STZ.b Scrap01
JML.l InitializeSaveFile_done
;--------------------------------------------------------------------------------
@@ -151,12 +151,12 @@ OnNewFile:
STZ.w TreePullKills
STZ.w TreePullHits
STZ.w PrizePackIndexes
STZ.w PrizePackIndexes+1
STZ.w PrizePackIndexes+2
STZ.w PrizePackIndexes+3
STZ.w PrizePackIndexes+4
STZ.w PrizePackIndexes+5
STZ.w PrizePackIndexes+6
STZ.w PrizePackIndexes+1
STZ.w PrizePackIndexes+2
STZ.w PrizePackIndexes+3
STZ.w PrizePackIndexes+4
STZ.w PrizePackIndexes+5
STZ.w PrizePackIndexes+6
LDA.b #$00 : STA.l MosaicLevel
JSL InitRNGPointerTable
PLP : PLX
@@ -172,7 +172,7 @@ OnLinkDamaged:
JML.l OHKOTimer
;--------------------------------------------------------------------------------
;OnEnterWater:
; JSL.l UnequipCapeQuiet ; what we wrote over
; JSL.l UnequipCapeQuiet ; what we wrote over
;RTL
;--------------------------------------------------------------------------------
OnLinkDamagedFromPit:
@@ -233,6 +233,6 @@ PostItemAnimation:
JSL.l IncrementChestTurnCounter
+
STZ.w ItemReceiptMethod : LDA.w AncillaGet, X ; thing we wrote over to get here
STZ.w ItemReceiptMethod : LDA.w AncillaGet, X ; thing we wrote over to get here
RTL
;--------------------------------------------------------------------------------

View File

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

74
generate_bomb_table.rb Normal file
View File

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

View File

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

View File

@@ -1,7 +1,10 @@
GoalItemGanonCheck:
LDA.w SpriteTypeTable, X : CMP.b #$D6 : BNE .success ; skip if not ganon
LDA.w $0D80, X : CMP.b #$12 : BEQ .fail
JSL.l CheckGanonVulnerability
BCS .success
BCC .fail
JSL.l CheckMushroom
BCC .success
.fail
LDA.w SpriteActivity, X : CMP.b #17 : !BLT .success ; decmial 17 because Acmlm's chart is decimal

View File

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

266
hooks.asm
View File

@@ -383,9 +383,6 @@ JSL.l LoadBombCount
org $098133 ; <- 48133 - ancilla_init.asm : 211 (STA $7EF343 : BNE .bombs_left_over)
JSL.l StoreBombCount
;--------------------------------------------------------------------------------
org $0DE4BF ; <- 6E4BF - equipment.asm : 1249 (LDA $7EF343 : AND.w #$00FF : BEQ .gotNoBombs)
JSL.l LoadBombCount16
;--------------------------------------------------------------------------------
org $0DDEB3 ; <- 6DEB3 - equipment.asm : 328 (LDA $7EF33F, X)
JSL.l IsItemAvailable
;--------------------------------------------------------------------------------
@@ -893,12 +890,9 @@ 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 $098624 ; 48624 - ancilla_init.asm:728 (TYA : ASL A : TAX)
JSL.l UpdateInventoryLocationExpanded
BRA + : NOP #18 : +
org $0986AA ; 486AA - ancilla_init.asm:848 (LDA .item_masks, X)
LDA.w AddReceivedItemExpanded_item_masks, X
@@ -2020,11 +2014,11 @@ JSL.l Overworld_LoadNewTiles : NOP #$02
org $02EC2E ;<- 016C2E
JSL.l Overworld_LoadNewTiles : NOP #$02
;================================================================================
org $07A3E2 ;<- 3A3E2 Bank07.asm:5764 (LDA.b #$80 : STA $03F0)
JSL.l FreeDuckCheck : BEQ +
NOP
skip 3 ; a JSR we need to keep
+
; org $07A3E2 ;<- 3A3E2 Bank07.asm:5764 (LDA.b #$80 : STA $03F0)
; JSL.l FreeDuckCheck : BEQ +
; NOP
; skip 3 ; a JSR we need to keep
; +
;================================================================================
org $07A9AC ; <- 3A9AC - Bank07.asm:6628 (LDA $0C : ORA $0E : STA $00 : AND.b #$0C : BEQ BRANCH_BETA)
JML.l MirrorBonk
@@ -2055,9 +2049,6 @@ JSL.l BeepLogic : NOP #6
;--------------------------------------------------------------------------------
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
;================================================================================
;================================================================================
@@ -2372,11 +2363,9 @@ org $07839E ; bunny BAGE check
BunnyRead:
JSR.w $07B5A9 ; check A button
BCC .noA
JSR.w CheckIfReading
BNE .noread
JSR.w $07B4DB
NOP
.noread
JSL BunnyThrowPot
BRA .noA
NOP #3
.noA
org $07FFF4
@@ -2458,6 +2447,136 @@ JSL FixJingleGlitch
org $01C65F
JSL FixJingleGlitch
;================================================================================
; Bomb-Only Mode
;--------------------------------------------------------------------------------
org $06ECC3 ; Bank06.asm@4704 (PHX : TAX : LDA.l .damage_classes, X : PLX)
JSL DamageClassCalc
BRA + : NOP #29 : +
;--------------------------------------------------------------------------------
org $0882D4 ; Bank08.asm@445 (PHX : TYX : ... )
JSL Utility_CheckAncillaOverlapWithSprite
BRA + : NOP #5 : +
;--------------------------------------------------------------------------------
org $088DB1 ; Bank08.asm@1207 (PHY : PHX : TYX : ... )
JSL Utility_CheckAncillaOverlapWithSprite
BRA + : NOP #7 : +
;--------------------------------------------------------------------------------
org $08E252 ; Bank08.asm@1770 (PHY : PHX : TYX : ... )
JSL Utility_CheckAncillaOverlapWithSprite
BRA + : NOP #7 : +
;--------------------------------------------------------------------------------
org $0882E8 ; Bank08.asm@456 (LDA $0DB0, Y : CMP.b #$03)
JSL Utility_CheckHelmasaurKingCollision
NOP
;--------------------------------------------------------------------------------
org $1E838C ; sprite_helmasaur_king.asm@522 (LDA $0301 : AND.b #$0A)
JSL Utility_CheckHammerHelmasaurKingMask
NOP
;--------------------------------------------------------------------------------
org $06ED94 ; Bank06.asm@4866 (LDA $0E60, X : AND.b #$40)
JSL Utility_CheckImpervious
NOP
;--------------------------------------------------------------------------------
org $068F94 ; sprite_prep.asm@1984 (INC $0BA0, X : JSL Sprite_InitializedSegmented)
JSL AllowBombingMoldorm
BRA + : NOP : +
;--------------------------------------------------------------------------------
org $06892F ; sprite_prep.asm@548 (LDA $0D00, X : SUB #$0C : STA $0D00, X : ...)
JSL AllowBombingBarrier
RTS : NOP #7
;--------------------------------------------------------------------------------
org $0DE4BF ; equipment.asm@1247 (LDA $7EF343 : AND.w #$00FF : BEQ .gotNoBombs : ...)
JSL DrawBombInMenu
BRA + : NOP #13 : +
;--------------------------------------------------------------------------------
org $0DFB6A ; headsup_display@727 (CPX #$0004 : BNE .bombsNotEquipped : LDA #$0001)
JSL DrawBombInYBox
BRA + : NOP #2 : +
;--------------------------------------------------------------------------------
org $0DEE05 ; equipment.asm@2065 (LDA $7EF359 : AND.w #$00FF : CMP.w #$00FF : ...)
JSL DrawSwordInMenu
BRA + : NOP #16 : +
;--------------------------------------------------------------------------------
org $0DFA92 ; headsup_display.asm@622 (PDB : LDA.w #$0149 : ...)
JSL DrawBombOnHud
BRA + : NOP #8 : +
;--------------------------------------------------------------------------------
org $089EF8 ; ancilla_bomb@1438 (LDA.w #$04 : STA $0B)
JSL SetBombSpriteColor
;--------------------------------------------------------------------------------
; bomb icons with numbers
org $0DFC51 ; is this being used? I hope not! let's find out if anything breaks!
db $F5, $20, $F5, $20, $F5, $20, $F5, $20
db $B2, $3C, $B3, $3C, $C2, $3C, $17, $3C
db $B2, $2C, $B3, $2C, $C2, $2C, $18, $2C
db $B2, $24, $B3, $24, $C2, $24, $19, $24
db $B2, $28, $B3, $28, $C2, $28, $1A, $28
db $B2, $28, $B3, $28, $C2, $28, $1B, $28
; bomb icons without numbers
org $0DFC81
db $F5, $20, $F5, $20, $F5, $20, $F5, $20
db $B2, $3C, $B3, $3C, $C2, $3C, $C2, $7C
db $B2, $2C, $B3, $2C, $C2, $2C, $C2, $6C
db $B2, $24, $B3, $24, $C2, $24, $C2, $64
db $B2, $28, $B3, $28, $C2, $28, $C2, $68
db $B2, $28, $B3, $28, $C2, $28, $C2, $68
;--------------------------------------------------------------------------------
org $079CE6 ; Bank07.asm@4632 (LDA #$80 : TSB $3A)
JSL CheckDetonateBomb
;--------------------------------------------------------------------------------
org $079D08 ; bank_07.asm@6068 (INC $3C : LDA $3C : CMP #$09)
JSL NoSwingHammerB : NOP #2
;--------------------------------------------------------------------------------
org $1EDCF8 ; bank_1E.asm@16086 (LDX $0202 : ...)
JSL SetBeeType
BRA + : NOP #15 : +
;--------------------------------------------------------------------------------
org $1EB5E8 ; bank_1E.asm@9387 (LDA #$03 : STA $0D80, X)
JSL ArrghusBoing
;--------------------------------------------------------------------------------
org $1EDFAF ; bank_1E.asm@16607 (.next_sprite)
JSL BeeCheckTarget
BCS .bee_valid_target
BRA .bee_unsuitable_target
NOP #48
.bee_unsuitable_target
skip 11
.bee_valid_target
;--------------------------------------------------------------------------------
org $07F88C ; free rom from F877 - F88F; the starting part of this is used in quadrant glitch fix in overworld fork, however.
Link_UseHammerLong:
JSR Link_UseHammer : RTL
warnpc $07F890
;--------------------------------------------------------------------------------
;================================================================================
; Variable Ganon Vulnerability
;--------------------------------------------------------------------------------
org $08BBD4 ; ancilla_magic_powder.asm@253 (LDA #$0A : JSL Ancilla_CheckSpriteDamage.preset_class)
JSL Ganon_CheckPowderVulnerability
NOP #2
;--------------------------------------------------------------------------------
org $1D8F4E ; sprite_ganon.asm@325 (LDA $04C5 : CMP #$02)
JSL Ganon_CheckInvincible
NOP
;--------------------------------------------------------------------------------
org $0DD628 ; Bank0D.asm@1266 (LDA $0B6B, Y : AND #$02)
JSL CheckBeeBoss
NOP
;--------------------------------------------------------------------------------
org $0DD676 ; Bank0D.asm@1303 (TYX : JSL Ancilla_CheckSpriteDamage.preset_class)
JSL Ganon_CheckBeeVulnerability
NOP
;--------------------------------------------------------------------------------
;================================================================================
; Pseudo-Sword Mode
;--------------------------------------------------------------------------------
org $06ED70 ; Bank06.asm@4842 (LDA $06ED39, X : STA $0CF2)
JSL StoreSwordDamage
;================================================================================
; Text Renderer
;--------------------------------------------------------------------------------
@@ -2502,3 +2621,106 @@ JSL.l TransferVRAMStripes
;===================================================================================================
org $9BF029+1 : db $10
;--------------------------------------------------------------------------------
; Various nonsense
;--------------------------------------------------------------------------------
org $0780B9 ; LDA.b #$3A : STA.w $031F
JSL CalcIFrames
NOP
org $09814E ; LDA.w Bomb_timer : STA.w $039F, X
JSL SetBombTimer
NOP #2
org $07B282 ; LDA.b #$1D : STA.w $0374
JSL SetDashTimer
NOP
org $07A3E7 ; LDA.b #$13 : JSR PlaySFX_Set2 : ...
JSL ProcessFlute
BCS +
RTS
NOP #14 : +
org $08E073 ; LDA.b #$0E : STA.b $10
JSL FluteMap
org $07A329
JSL UseShovel
BCS +
RTS
NOP #4 : +
org $079D11
JSL SwordSwingDelay : NOP
org $079DAB
JSL SwordSwingDelay : NOP
org $079DEE
JSL SwordSwingDelay : NOP
org $088E4A
JSL MaybeRecoil
BRA + : NOP #6 : +
org $06EC4D
JSL MaybeRecoil2
BRA + : NOP #10 : +
; make moldorm check head for hitbox instead of tail
org $1DDADD
; BRA + : NOP #22 : +
BRA + : NOP #26 : +
org $1DDAF9
BRA + : NOP : +
org $1DDB01
BRA + : NOP #3 : +
; make moldorm repel sword when not stunned
org $06F354
JSL CheckMoldormRepel
BCC .not_moldorm
NOP
skip 17
.not_moldorm
; make mini moldorms faster
org $0697DF
db $30, $2C, $22, $12, $00, $EE, $DE, $D4
db $D0, $D4, $DE, $EE, $00, $12, $22, $2C
db $00, $12, $22, $2C, $30, $2C, $22, $12
db $00, $EE, $DE, $D4, $D0, $D4, $DE, $EE
; make lanmolas faster
org $05A4B7
LDA.b #$18
; ganon - silvers just don't work like they used to
org $0DB93D
db $08
; ganon - randomize vulnerability when stunned
org $1D9010
JSL StunGanon : NOP
; agahnim - pattern? we don't need no steenken pattern!
org $1ED637
JSL AgaDecision : NOP
; agahnim - no guaranteed normal balls
org $1ED6ED
NOP #2
; helmie's mask is brittle
org $1E8112
db $03, $03, $03, $03, $00
; vitreous - bombs work a bit better
org $0DB938
db $0C
; tile rooms - make them a bit faster
org $09BA20
LDA.b #$B8
org $1EBC56
LDA.b #$28

View File

@@ -140,7 +140,7 @@ RTL
OpenBottleMenu:
LDA.b Joy1B_New : AND.b #$40 : BEQ .x_not_pressed ; skip if X is not down
LDA.b #$10 : STA.w MenuBlink ; set 16 frame cool off
LDA.b #$20 : STA.w SFX3 ; make menu sound
LDA.b #$20 : STA.w SFX3 ; make menu sound
LDA.b #$07 : STA.w SubModuleInterface ; thing we wrote over - opens bottle menu
.x_not_pressed
RTL
@@ -148,16 +148,16 @@ RTL
;CloseBottleMenu:
;--------------------------------------------------------------------------------
CloseBottleMenu:
LDA.b Joy1B_New : AND.b #$40 : BEQ .x_not_pressed ; skip if X is not down
LDA.b #$10 : STA.w MenuBlink ; set 16 frame cool off
LDA.b #$20 : STA.w SFX3 ; make menu sound
LDA.b Joy1B_New : AND.b #$40 : BEQ .x_not_pressed ; skip if X is not down
LDA.b #$10 : STA.w MenuBlink ; set 16 frame cool off
LDA.b #$20 : STA.w SFX3 ; make menu sound
INC.w SubModuleInterface ; return to normal menu
STZ.w BottleMenuCounter
LDA.b #$00
INC.w SubModuleInterface ; return to normal menu
STZ.w BottleMenuCounter
LDA.b #$00
RTL
.x_not_pressed
LDA.b Joy1A_New : AND.b #$0C ; thing we wrote over (probably)
.x_not_pressed
LDA.b Joy1A_New : AND.b #$0C ; thing we wrote over (probably)
RTL
;--------------------------------------------------------------------------------
; AddInventory:
@@ -269,17 +269,17 @@ AddInventory:
SEP #$20 ; Set 8-bit Accumulator
LDA.w DungeonID ; get dungeon id
CMP.b #$FF : BEQ .fullItemCounts
CMP.b #$FF : BEQ .fullItemCounts
CMP.l BallNChainDungeon : BNE +
CPY.b #$32 : BNE +
JMP .done
CMP.l BallNChainDungeon : BNE +
CPY.b #$32 : BNE +
JMP .done
+
CMP.b #$04 : BCS +
LDA.l SewersLocations : INC : STA.l SewersLocations
LDA.l HCLocations : INC : STA.l HCLocations
BRA .fullItemCounts
+ LSR : TAX : LDA.l DungeonLocationsChecked, X : INC : STA.l DungeonLocationsChecked, X
CMP.b #$04 : BCS +
LDA.l SewersLocations : INC : STA.l SewersLocations
LDA.l HCLocations : INC : STA.l HCLocations
BRA .fullItemCounts
+ LSR : TAX : LDA.l DungeonLocationsChecked, X : INC : STA.l DungeonLocationsChecked, X
++ CPX.b #$0D : BNE +
LDA.l BigKeyField : AND.b #$04 : BNE ++
JSR .incrementGTowerPreBigKey
@@ -300,39 +300,39 @@ AddInventory:
LDA.l PreFluteLocations : INC : STA.l PreFluteLocations ; Increment Pre Mirror Counter
+
REP #$20
REP #$20
LDA.l TotalItemCounter : INC : STA.l TotalItemCounter ; Increment Item Total
SEP #$20
SEP #$20
.itemCounts
CPY.b #$00 : BNE + ; Fighter's Sword & Fighter's Shield
LDX.b #$01
LDX.b #$01
JSR .incrementSword
JSR .incrementShield
JMP .done
+ CPY.b #$01 : BNE + ; Master Sword
LDX.b #$02
LDX.b #$02
JSR .incrementSword
JMP .done
+ CPY.b #$02 : BNE + ; Tempered Sword
LDX.b #$03
LDX.b #$03
JSR .incrementSword
JMP .done
+ CPY.b #$03 : BNE + ; Golden Sword
LDX.b #$04
LDX.b #$04
JSR .incrementSword
JMP .done
+ CPY.b #$04 : BNE + ; Fighter's Shield
LDX.b #$01
LDX.b #$01
JSR .incrementShield
JMP .done
+ CPY.b #$05 : BNE + ; Red Shield
LDX.b #$02
LDX.b #$02
JSR .incrementShield
JMP .done
+ CPY.b #$06 : BNE + ; Mirror Shield
LDX.b #$03
LDX.b #$03
JSR .incrementShield
JMP .done
+ CPY.b #$07 : !BLT + ; Items $07 - $0D
@@ -367,22 +367,22 @@ AddInventory:
JMP .done
+ CPY.b #$20 : BNE + ; Crystal
JSR .incrementCrystal
JSR .setDungeonCompletion
JSR .setDungeonCompletion
JMP .done
+ CPY.b #$21 : BNE + ; Bug Net
JSR .incrementY
JMP .done
+ CPY.b #$22 : BNE + ; Blue Mail
LDX.b #$01
JSR .incrementMail
LDX.b #$01
JSR .incrementMail
+ CPY.b #$23 : BNE + ; Red Mail
LDX.b #$02
JSR .incrementMail
LDX.b #$02
JSR .incrementMail
+ CPY.b #$24 : BNE + ; Small Key
JSR .incrementVanillaKey
JMP .done
+ CPY.b #$25 : BNE + ; Compass
JSL MaybeFlagCompassTotalPickup
JSL MaybeFlagCompassTotalPickup
JSR .incrementCompass
JMP .done
+ CPY.b #$26 : BNE + ; Liar Heart (Container)
@@ -408,13 +408,13 @@ AddInventory:
JSR .incrementBigKey
JMP .done
+ CPY.b #$33 : BNE + ; Map
JSL MaybeFlagMapTotalPickup
JSL MaybeFlagMapTotalPickup
JSR .incrementMap
JMP .done
+ CPY.b #$37 : !BLT + ; Items $37 - $39 - Pendants
CPY.b #$3A : !BGE +
JSR .incrementPendant
JSR .setDungeonCompletion
JSR .setDungeonCompletion
JMP .done
+ CPY.b #$3A : !BLT + ; Items $3A - $3B - Bow & Silver Arrows
CPY.b #$3C : !BGE +
@@ -434,7 +434,7 @@ AddInventory:
JSR .incrementY
JMP .done
+ CPY.b #$49 : BNE + ; Fighter's Sword
LDX.b #$01
LDX.b #$01
JSR .incrementSword
JMP .done
+ CPY.b #$4A : BNE + ; Flute (Active)
@@ -454,15 +454,15 @@ AddInventory:
JSR .incrementCapacity
JMP .done
+ CPY.b #$50 : BNE + ; Master Sword (Safe)
LDX.b #$02
LDX.b #$02
JSR .incrementSword
JMP .done
+ CPY.b #$51 : BNE + ; 5 Bomb Capacity Upgrade
LDX.b #$02
LDX.b #$02
JSR .maybeIncrementBombs
JMP .done
+ CPY.b #$52 : BNE + ; 10 Bomb Capacity Upgrade
LDX.b #$02
LDX.b #$02
JSR .maybeIncrementBombs
JMP .done
+ CPY.b #$51 : !BLT + ; Items $51 - $54 - Capacity Upgrades
@@ -473,15 +473,15 @@ AddInventory:
JSR .incrementBow
JMP .done
+ CPY.b #$5E : BNE + ; Progressive Sword
LDA.l SwordEquipment : INC : TAX
LDA.l SwordEquipment : INC : TAX
JSR .incrementSword
JMP .done
+ CPY.b #$5F : BNE + ; Progressive Shield
LDA.l ShieldEquipment : INC : TAX
LDA.l ShieldEquipment : INC : TAX
JSR .incrementShield
JMP .done
+ CPY.b #$60 : BNE + ; Progressive Armor
LDA.l ArmorEquipment : INC : TAX
LDA.l ArmorEquipment : INC : TAX
JSR .incrementMail
JMP .done
+ CPY.b #$61 : BNE + ; Progressive Lifting Glove
@@ -493,12 +493,12 @@ AddInventory:
JMP .done
+ CPY.b #$70 : !BLT + ; Items $70 - $7F - Free Maps
CPY.b #$80 : !BGE +
JSL MaybeFlagMapTotalPickup
JSL MaybeFlagMapTotalPickup
JSR .incrementMap
JMP .done
+ CPY.b #$80 : !BLT + ; Items $80 - $8F - Free Compasses
CPY.b #$90 : !BGE +
JSL MaybeFlagCompassTotalPickup
JSL MaybeFlagCompassTotalPickup
JSR .incrementCompass
JMP .done
+ CPY.b #$90 : !BLT + ; Items $90 - $9F - Free Big Keys
@@ -509,6 +509,18 @@ AddInventory:
CPY.b #$B0 : !BGE +
JSR .incrementKey
JMP .done
+ CPY.b #$B6 : BNE + ; Item $B6 - Bomb Upgrade
JSR .stampSword ; update "first bomb" timestamp
LDA.l SpecialWeaponLevel ; get current bomb level
CMP #$05 : !BGE ++ ; check if already maxed
INC : STA.l SpecialWeaponLevel
++ JMP .done
+ CPY.b #$B7 : BNE + ; Item $B7 - Cane Upgrade
JSR .stampSword ; update "first cane" timestamp
LDA.l SpecialWeaponLevel ; get current cane level
CMP #$05 : !BGE ++ ; check if already maxed
INC : STA.l SpecialWeaponLevel
++ JMP .done
+
.done
PLP : PLX : PLA
@@ -558,21 +570,21 @@ RTS
.incrementSword
JSR .stampSword
LDA.l HighestSword
INC : STA.b Scrap04 : CPX.b Scrap04 : !BLT + ; don't increment unless we're getting a better sword
TXA : STA.l HighestSword
+
LDA.l HighestSword
INC : STA.b Scrap04 : CPX.b Scrap04 : !BLT + ; don't increment unless we're getting a better sword
TXA : STA.l HighestSword
+
RTS
.incrementShield
LDA.l HighestShield
INC : STA.b Scrap04 : CPX.b Scrap04 : !BLT + ; don't increment unless we're getting a better shield
TXA : STA.l HighestShield
+
LDA.l HighestShield
INC : STA.b Scrap04 : CPX.b Scrap04 : !BLT + ; don't increment unless we're getting a better shield
TXA : STA.l HighestShield
+
RTS
.incrementBow
LDA.l BowEquipment : BNE .dontCount ; Don't increment Y item count for extra bows
LDA.l BowEquipment : BNE .dontCount ; Don't increment Y item count for extra bows
.incrementY
LDA.l YAItemCounter : !ADD #$08 : STA.l YAItemCounter
.dontCount
@@ -605,10 +617,10 @@ RTS
RTS
.incrementMail
LDA.l HighestMail
INC : STA.b Scrap04 : CPX.b Scrap04 : !BLT + ; don't increment unless we're getting a better mail
TXA : STA.l HighestMail
+
LDA.l HighestMail
INC : STA.b Scrap04 : CPX.b Scrap04 : !BLT + ; don't increment unless we're getting a better mail
TXA : STA.l HighestMail
+
RTS
.incrementKeyLong
@@ -616,11 +628,11 @@ RTS
RTL
.incrementVanillaKey
LDA.l SmallKeyCounter : INC : STA.l SmallKeyCounter
JSL.l UpdateKeys
LDA.l SmallKeyCounter : INC : STA.l SmallKeyCounter
JSL.l UpdateKeys
.incrementKey
LDA.l SmallKeyCounter : INC : STA.l SmallKeyCounter
LDA.l SmallKeyCounter : INC : STA.l SmallKeyCounter
RTS
.incrementCompass
@@ -632,7 +644,7 @@ RTS
RTS
.incrementGTowerPreBigKey
LDA.l PreGTBKLocations : INC : STA.l PreGTBKLocations
LDA.l PreGTBKLocations : INC : STA.l PreGTBKLocations
RTS
.maybeIncrementBombs
@@ -651,10 +663,16 @@ RTS
RTL
.incrementBossSword
LDA.l SwordEquipment
LDA.l SpecialWeapons : CMP.b #$01 : BEQ +
CMP.b #$03 : BEQ +
CMP.b #$04 : BEQ +
CMP.b #$05 : BEQ +
LDA.l SwordEquipment : BRA ++
+ : LDA.l SpecialWeaponLevel
++
BNE + : -
LDA.l SwordlessBossKills : INC : STA.l SwordlessBossKills
RTS
LDA.l SwordlessBossKills : INC : STA.l SwordlessBossKills
RTS
+ CMP.b #$FF : BEQ -
+ CMP.b #$01 : BNE +
%TopHalf(SwordBossKills) : RTS
@@ -749,22 +767,22 @@ RTL
; this is horrible, make it better
;--------------------------------------------------------------------------------
MakeCircleBlue:
LDA.w $FFC0, Y : AND.w #$EFFF : STA.w $FFC0, Y
LDA.w $FFC2, Y : AND.w #$EFFF : STA.w $FFC2, Y
LDA.w $FFC0, Y : AND.w #$EFFF : STA.w $FFC0, Y
LDA.w $FFC2, Y : AND.w #$EFFF : STA.w $FFC2, Y
LDA.w $FFFE, Y : AND.w #$EFFF : STA.w $FFFE, Y
LDA.w $0004, Y : AND.w #$EFFF : STA.w $0004, Y
LDA.w $003E, Y : AND.w #$EFFF : STA.w $003E, Y
LDA.w $0044, Y : AND.w #$EFFF : STA.w $0044, Y
LDA.w $0080, Y : AND.w #$EFFF : STA.w $0080, Y
LDA.w $0082, Y : AND.w #$EFFF : STA.w $0082, Y
LDA.w $FFFE, Y : AND.w #$EFFF : STA.w $FFFE, Y
LDA.w $0004, Y : AND.w #$EFFF : STA.w $0004, Y
LDA.w $FFBE, Y : AND.w #$EFFF : STA.w $FFBE, Y
LDA.w $FFC4, Y : AND.w #$EFFF : STA.w $FFC4, Y
LDA.w $0084, Y : AND.w #$EFFF : STA.w $0084, Y
LDA.w $007E, Y : AND.w #$EFFF : STA.w $007E, Y
LDA.w $003E, Y : AND.w #$EFFF : STA.w $003E, Y
LDA.w $0044, Y : AND.w #$EFFF : STA.w $0044, Y
LDA.w $0080, Y : AND.w #$EFFF : STA.w $0080, Y
LDA.w $0082, Y : AND.w #$EFFF : STA.w $0082, Y
LDA.w $FFBE, Y : AND.w #$EFFF : STA.w $FFBE, Y
LDA.w $FFC4, Y : AND.w #$EFFF : STA.w $FFC4, Y
LDA.w $0084, Y : AND.w #$EFFF : STA.w $0084, Y
LDA.w $007E, Y : AND.w #$EFFF : STA.w $007E, Y
RTS
;--------------------------------------------------------------------------------
@@ -811,18 +829,18 @@ RTL
; SaveKeys:
;--------------------------------------------------------------------------------
SaveKeys:
PHA
LDA.l GenericKeys : BEQ +
PLA : STA.l CurrentGenericKeys
RTL
+
PLA : STA.l DungeonKeys, X
CPX.b #$00 : BNE +
STA.l HyruleCastleKeys ; copy HC to sewers
+
CPX.b #$01 : BNE +
STA.l SewerKeys ; copy sewers to HC
+
PHA
LDA.l GenericKeys : BEQ +
PLA : STA.l CurrentGenericKeys
RTL
+
PLA : STA.l DungeonKeys, X
CPX.b #$00 : BNE +
STA.l HyruleCastleKeys ; copy HC to sewers
+
CPX.b #$01 : BNE +
STA.l SewerKeys ; copy sewers to HC
+
RTL
;--------------------------------------------------------------------------------
@@ -847,8 +865,8 @@ RTL
; PrepItemScreenBigKey:
;--------------------------------------------------------------------------------
PrepItemScreenBigKey:
STZ.b Scrap02
STZ.b Scrap03
STZ.b Scrap02
STZ.b Scrap03
REP #$30 ; thing we wrote over - set 16-bit accumulator
RTL
;--------------------------------------------------------------------------------
@@ -943,8 +961,8 @@ CollectPowder:
; if for any reason the item value is 0 reload it, just in case
%GetPossiblyEncryptedItem(WitchItem, SpriteItemValues) : TAY
+
STZ.w ItemReceiptMethod ; item from NPC
JSL.l Link_ReceiveItem
STZ.w ItemReceiptMethod ; item from NPC
JSL.l Link_ReceiveItem
;JSL.l FullInventoryExternal
JSL.l ItemSet_Powder
RTL
@@ -969,14 +987,14 @@ RTL
DrawMagicHeader:
LDA.l MagicConsumption : AND.w #$00FF : CMP.w #$0002 : BEQ .quarterMagic
.halfMagic
LDA.w #$28F7 : STA.l HUDTileMapBuffer+$04
LDA.w #$2851 : STA.l HUDTileMapBuffer+$06
LDA.w #$28FA : STA.l HUDTileMapBuffer+$08
RTL
.quarterMagic
LDA.w #$28F7 : STA.l HUDTileMapBuffer+$04
LDA.w #$2800 : STA.l HUDTileMapBuffer+$06
LDA.w #$2801 : STA.l HUDTileMapBuffer+$08
LDA.w #$28F7 : STA.l HUDTileMapBuffer+$04
LDA.w #$2851 : STA.l HUDTileMapBuffer+$06
LDA.w #$28FA : STA.l HUDTileMapBuffer+$08
RTL
.quarterMagic
LDA.w #$28F7 : STA.l HUDTileMapBuffer+$04
LDA.w #$2800 : STA.l HUDTileMapBuffer+$06
LDA.w #$2801 : STA.l HUDTileMapBuffer+$08
RTL
;--------------------------------------------------------------------------------
@@ -1010,8 +1028,8 @@ RTL
SpawnShovelItem:
LDA.b #$01 : STA.l RedrawFlag
LDA.w YButtonOverride : BEQ +
JSL DiggingGameGuy_AttemptPrizeSpawn
LDA.w YButtonOverride : BEQ +
JSL DiggingGameGuy_AttemptPrizeSpawn
JMP .skip
+
@@ -1023,8 +1041,8 @@ SpawnShovelItem:
LDA.b IndoorsFlag : BEQ + : JMP .no_drop : + ; skip if indoors
LDA.b OverworldIndex : CMP.b #$2A : BEQ .no_drop ; don't drop in the haunted grove
CMP.b #$68 : BEQ .no_drop ; don't drop in the digging game area
LDA.b OverworldIndex : CMP.b #$2A : BEQ .no_drop ; don't drop in the haunted grove
CMP.b #$68 : BEQ .no_drop ; don't drop in the digging game area
JSL GetRandomInt : BIT.b #$03 : BNE .no_drop ; drop with 1/4 chance
@@ -1048,11 +1066,12 @@ SpawnShovelItem:
LDA.b #$30 : STA.w SpriteTimerE, Y
LDA.b LinkPosX : !ADD.l .x_offsets, X
AND.b #$F0 : STA.w SpritePosXLow, Y
LDA.b LinkPosX+1 : ADC.b #$00 : STA.w SpritePosXHigh, Y
AND.b #$F0 : STA.w SpritePosXLow, Y
LDA.b LinkPosX+1 : ADC.b #$00 : STA.w SpritePosXHigh, Y
LDA.b LinkPosY : !ADD.b #$16 : AND.b #$F0 : STA.w SpritePosYLow, Y
LDA.b LinkPosY+1 : ADC.b #$00 : STA.w SpritePosYHigh, Y
LDA.b LinkPosY : !ADD.b #$16
AND.b #$F0 : STA.w SpritePosYLow, Y
LDA.b LinkPosY+1 : ADC.b #$00 : STA.w SpritePosYHigh, Y
LDA.b #$00 : STA.w SpriteLayer, Y
TYX
@@ -1069,12 +1088,12 @@ RTL
{
.x_speeds
db $F0
db $10
db $F0
db $10
.x_offsets
db $00
db $13
db $00
db $13
}
;--------------------------------------------------------------------------------

View File

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

View File

@@ -5,28 +5,28 @@
;--------------------------------------------------------------------------------
LampCheck:
LDA.l LightConeModifier : CMP.b #$01 : BNE + : RTL : +
CMP.b #$FF : BNE + : INC : RTL : +
LDA.l LampEquipment : BNE .lamp ; skip if we already have lantern
LDA.w DungeonID : BNE + ; check if we're in sewers
LDA.l LampConeSewers : RTL
+ : TDC
.lamp
CMP.b #$FF : BNE + : INC : RTL : +
LDA.l LampEquipment : BNE .lamp ; skip if we already have lantern
LDA.w DungeonID : BNE + ; check if we're in sewers
LDA.l LampConeSewers : RTL
+ : TDC
.lamp
RTL
;================================================================================
;--------------------------------------------------------------------------------
; Output: 0 locked, 1 open
;--------------------------------------------------------------------------------
CheckForZelda:
LDA.l ProgressIndicator : CMP.b #$02 : !BLT + ; Skip if rain is falling
LDA.b #$01 ; pretend we have zelda anyway
RTL
+
LDA.l FollowerIndicator
LDA.l ProgressIndicator : CMP.b #$02 : !BLT + ; Skip if rain is falling
LDA.b #$01 ; pretend we have zelda anyway
RTL
+
LDA.l FollowerIndicator
RTL
;================================================================================
SetOverlayIfLamp:
JSL.l LampCheck
STA.b SUBDESQ ; write it directly to the overlay, this isn't a terrible idea at all
JSL.l LampCheck
STA.b SUBDESQ ; write it directly to the overlay, this isn't a terrible idea at all
RTL
;================================================================================
; Mantle Object Changes

View File

@@ -1,18 +1,27 @@
NewDrawHud:
SEP #$30
SEP #$30
;================================================================================
; Draw bomb count
;================================================================================
LDA.l InfiniteBombs : BNE .infinite_bombs
JSL CheckInfiniteBombs : BNE .infinite_bombs
.finite_bombs
LDA.l SpecialWeapons : CMP #$01 : BNE .normal
LDA.l SpecialWeaponLevel : BEQ .no_bombs
.normal
LDA.l BombsEquipment ; bombs
JSR HudHexToDec2Digit ;requires 8 bit registers!
JSR HudHexToDec2Digit ; requires 8 bit registers!
REP #$20
LDX.b Scrap06 : TXA : ORA.w #$2400 : STA.l HUDBombCount ; Draw bombs 10 digit
LDX.b Scrap07 : TXA : ORA.w #$2400 : STA.l HUDBombCount+2 ; Draw bombs 1 digit
BRA +
.no_bombs
REP #$20
LDA.w #$207F : STA HUDBombCount
STA HUDBombCount+2
BRA +
.infinite_bombs
REP #$20
LDA.w #$2431 : STA.l HUDBombCount ; infinity (left half)
@@ -179,35 +188,35 @@ DrawMagicMeter_mp_tilemap = $0DFE0F
CMP.w #0001 : BEQ .yellow
CMP.w #0002 : BNE + : JMP .green : +
.blue
LDA.l DrawMagicMeter_mp_tilemap+0, X : AND.w #$EFFF : STA.l HUDTileMapBuffer+$46
LDA.l DrawMagicMeter_mp_tilemap+2, X : AND.w #$EFFF : STA.l HUDTileMapBuffer+$86
LDA.l DrawMagicMeter_mp_tilemap+4, X : AND.w #$EFFF : STA.l HUDTileMapBuffer+$C6
LDA.l DrawMagicMeter_mp_tilemap+6, X : AND.w #$EFFF : STA.l HUDTileMapBuffer+$06
RTL
LDA.l DrawMagicMeter_mp_tilemap+0, X : AND.w #$EFFF : STA.l HUDTileMapBuffer+$46
LDA.l DrawMagicMeter_mp_tilemap+2, X : AND.w #$EFFF : STA.l HUDTileMapBuffer+$86
LDA.l DrawMagicMeter_mp_tilemap+4, X : AND.w #$EFFF : STA.l HUDTileMapBuffer+$C6
LDA.l DrawMagicMeter_mp_tilemap+6, X : AND.w #$EFFF : STA.l HUDTileMapBuffer+$06
RTL
.red
LDA.l DrawMagicMeter_mp_tilemap+0, X : AND.w #$E7FF : STA.l HUDTileMapBuffer+$46
LDA.l DrawMagicMeter_mp_tilemap+2, X : AND.w #$E7FF : STA.l HUDTileMapBuffer+$86
LDA.l DrawMagicMeter_mp_tilemap+4, X : AND.w #$E7FF : STA.l HUDTileMapBuffer+$C6
LDA.l DrawMagicMeter_mp_tilemap+6, X : AND.w #$E7FF : STA.l HUDTileMapBuffer+$06
RTL
LDA.l DrawMagicMeter_mp_tilemap+0, X : AND.w #$E7FF : STA.l HUDTileMapBuffer+$46
LDA.l DrawMagicMeter_mp_tilemap+2, X : AND.w #$E7FF : STA.l HUDTileMapBuffer+$86
LDA.l DrawMagicMeter_mp_tilemap+4, X : AND.w #$E7FF : STA.l HUDTileMapBuffer+$C6
LDA.l DrawMagicMeter_mp_tilemap+6, X : AND.w #$E7FF : STA.l HUDTileMapBuffer+$06
RTL
.yellow
LDA.l DrawMagicMeter_mp_tilemap+0, X : AND.w #$EBFF : STA.l HUDTileMapBuffer+$46
LDA.l DrawMagicMeter_mp_tilemap+2, X : AND.w #$EBFF : STA.l HUDTileMapBuffer+$86
LDA.l DrawMagicMeter_mp_tilemap+4, X : AND.w #$EBFF : STA.l HUDTileMapBuffer+$C6
LDA.l DrawMagicMeter_mp_tilemap+6, X : AND.w #$EBFF : STA.l HUDTileMapBuffer+$0106
RTL
LDA.l DrawMagicMeter_mp_tilemap+0, X : AND.w #$EBFF : STA.l HUDTileMapBuffer+$46
LDA.l DrawMagicMeter_mp_tilemap+2, X : AND.w #$EBFF : STA.l HUDTileMapBuffer+$86
LDA.l DrawMagicMeter_mp_tilemap+4, X : AND.w #$EBFF : STA.l HUDTileMapBuffer+$C6
LDA.l DrawMagicMeter_mp_tilemap+6, X : AND.w #$EBFF : STA.l HUDTileMapBuffer+$0106
RTL
.orange
LDA.l DrawMagicMeter_mp_tilemap+0, X : AND.w #$E3FF : STA.l HUDTileMapBuffer+$46
LDA.l DrawMagicMeter_mp_tilemap+2, X : AND.w #$E3FF : STA.l HUDTileMapBuffer+$86
LDA.l DrawMagicMeter_mp_tilemap+4, X : AND.w #$E3FF : STA.l HUDTileMapBuffer+$C6
LDA.l DrawMagicMeter_mp_tilemap+6, X : AND.w #$E3FF : STA.l HUDTileMapBuffer+$0106
RTL
LDA.l DrawMagicMeter_mp_tilemap+0, X : AND.w #$E3FF : STA.l HUDTileMapBuffer+$46
LDA.l DrawMagicMeter_mp_tilemap+2, X : AND.w #$E3FF : STA.l HUDTileMapBuffer+$86
LDA.l DrawMagicMeter_mp_tilemap+4, X : AND.w #$E3FF : STA.l HUDTileMapBuffer+$C6
LDA.l DrawMagicMeter_mp_tilemap+6, X : AND.w #$E3FF : STA.l HUDTileMapBuffer+$0106
RTL
.green
LDA.l DrawMagicMeter_mp_tilemap+0, X : STA.l HUDTileMapBuffer+$46
LDA.l DrawMagicMeter_mp_tilemap+2, X : STA.l HUDTileMapBuffer+$86
LDA.l DrawMagicMeter_mp_tilemap+4, X : STA.l HUDTileMapBuffer+$C6
LDA.l DrawMagicMeter_mp_tilemap+6, X : STA.l HUDTileMapBuffer+$0106
RTL
LDA.l DrawMagicMeter_mp_tilemap+0, X : STA.l HUDTileMapBuffer+$46
LDA.l DrawMagicMeter_mp_tilemap+2, X : STA.l HUDTileMapBuffer+$86
LDA.l DrawMagicMeter_mp_tilemap+4, X : STA.l HUDTileMapBuffer+$C6
LDA.l DrawMagicMeter_mp_tilemap+6, X : STA.l HUDTileMapBuffer+$0106
RTL
;================================================================================
; 16-bit A, 8-bit X

514
newitems.asm Normal file → Executable file
View File

@@ -39,6 +39,14 @@
; #$80 - Compasses
; #$90 - Big Keys
; #$A0 - Small Keys
; #$B0 - reserved for bee traps
; #$B1 - reserved for bonk shuffle
; #$B2 - reserved for bonk shuffle
; #$B3 - reserved for bonk shuffle
; #$B4 - reserved for bonk shuffle
; #$B5 - reserved for bonk shuffle
; #$B6 - Progressive Bomb
; #$B7 - Progressive Cane
; #$FE - Server Request (Asychronous Chest)
; #$FF - Null Chest
;--------------------------------------------------------------------------------
@@ -49,23 +57,23 @@
; 0xF3 - tablet/pedestal
;--------------------------------------------------------------------------------
GetAnimatedSpriteGfxFile:
CMP.b #$0C : BNE +
CMP.b #$0C : BNE +
LDY.b #$5C : JML GetAnimatedSpriteGfxFile_return
+
CMP.b #$23 : BNE +
CMP.b #$23 : BNE +
LDY.b #$5D : JML GetAnimatedSpriteGfxFile_return
+
CMP.b #$48 : BNE +
CMP.b #$48 : BNE +
LDY.b #$60 : JML GetAnimatedSpriteGfxFile_return
+
CMP.b #$24 : !BGE +
CMP.b #$24 : !BGE +
LDY.b #$5B : JML GetAnimatedSpriteGfxFile_return
+
CMP.b #$37 : !BGE +
CMP.b #$37 : !BGE +
LDY.b #$5C : JML GetAnimatedSpriteGfxFile_return
+
CMP.b #$39 : !BGE +
CMP.b #$39 : !BGE +
LDY.b #$5D : JML GetAnimatedSpriteGfxFile_return
+
LDY.b #$32
@@ -145,14 +153,14 @@ ProcessEventItems:
LDA.l RNGItem : INC : STA.l RNGItem
SEP #$10 ; set 8-bit index registers
REP #$20 ; set 16-bit accumulator
REP #$20 ; set 16-bit accumulator
LDA.l GoalItemRequirement : BEQ ++
LDA.l GoalCounter : INC : STA.l GoalCounter
CMP.l GoalItemRequirement : !BLT ++
LDA.l TurnInGoalItems : AND.w #$00FF : BNE ++
JSL.l ActivateGoal
++
SEP #$20 ; set 8-bit accumulator
SEP #$20 ; set 8-bit accumulator
LDX.b #$01 : BRA .done
+
LDX.b #$00
@@ -234,7 +242,7 @@ AddReceivedItemExpandedGetItem:
+ CMP.b #$57 : BNE + ; Programmable Object 3
%ProgrammableItemLogic(3)
JMP .done
+ CMP.b #$58 : BNE + ; Upgrade-Only Sivler Arrows
+ CMP.b #$58 : BNE + ; Upgrade-Only Silver Arrows
LDA.l SilverArrowsUseRestriction : BNE +++
LDA.l SilverArrowsAutoEquip : AND.b #$01 : BEQ +++
LDA.l BowEquipment : BEQ ++ : CMP.b #$03 : !BGE ++
@@ -290,14 +298,14 @@ AddReceivedItemExpandedGetItem:
BRA .multi_collect
+ CMP.b #$6C : BNE + ; Goal Collectable (Multi/Power Star) Alternate Graphic
.multi_collect
REP #$20 ; set 16-bit accumulator
REP #$20 ; set 16-bit accumulator
LDA.l GoalItemRequirement : BEQ ++
LDA.l GoalCounter : INC : STA.l GoalCounter
CMP.w GoalItemRequirement : !BLT ++
LDA.l TurnInGoalItems : AND.w #$00FF : BNE ++
JSL.l ActivateGoal
++
SEP #$20 ; set 8-bit accumulator
SEP #$20 ; set 8-bit accumulator
JMP .done
+ CMP.b #$6D : BNE + ; Server Request F0
JSL.l ItemGetServiceRequest_F0
@@ -363,11 +371,26 @@ AddReceivedItemExpandedGetItem:
LDA.l CurrentSmallKeys : INC : STA.l CurrentSmallKeys
++
JMP .done
+ CMP.b #$B6 : BNE + ; Bomb Upgrade
LDA #$01 : STA InfiniteBombs
JMP .done
+ : CMP.b #$B7 : BNE + ; Cane Upgrade
LDA.l SpecialWeapons : CMP #$03 : BEQ .blue_cane
CMP #$04 : BEQ .red_cane
BRA .done
.blue_cane
LDA #$01 : STA ByrnaEquipment
BRA .done
.red_cane
LDA #$01 : STA SomariaEquipment
BRA .done
BRA .done
+
.done
PLX
LDA.w ItemReceiptMethod : CMP.b #$01 ; thing we wrote over
RTL
;--------------------------------------------------------------------------------
; #$70 - Maps
; #$80 - Compasses
; #$90 - Big Keys
@@ -480,36 +503,33 @@ AddReceivedItemExpanded:
.done
PLX : PLA
PHB : PHK ; we're skipping the corresponding instructions to grab the data bank
PHB : PHK ; we're skipping the corresponding instructions to grab the data bank
JML.l AddReceivedItem+2
}
;--------------------------------------------------------------------------------
;DATA AddReceivedItemExpanded
{
; This is a temporary measure for Fish to have consistent addresses
org $A08800
.y_offsets
db -5, -5, -5, -5, -5, -4, -4, -5
db -5, -4, -4, -4, -2, -4, -4, -4
db -5, -5, -5, -5, -5, -4, -4, -5
db -5, -4, -4, -4, -2, -4, -4, -4
db -4, -4, -4, -4, -4, -4, -4, -4
db -4, -4, -4, -4, -4, -4, -4, -4
db -4, -4, -4, -4, -4, -4, -4, -4
db -4, -4, -4, -4, -4, -4, -4, -4
db -4, -4, -4, -5, -4, -4, -4, -4
db -4, -4, -2, -4, -4, -4, -4, -4
db -4, -4, -4, -5, -4, -4, -4, -4
db -4, -4, -2, -4, -4, -4, -4, -4
db -4, -4, -4, -4, -2, -2, -2, -4
db -4, -4, -4, -4, -4, -4, -4, -4
db -4, -4, -4, -4, -2, -2, -2, -4
db -4, -4, -4, -4, -4, -4, -4, -4
db -4, -4, -2, -2, -4, -2, -4, -4
db -4, -5, -4, -4
db -4, -4, -2, -2, -4, -2, -4, -4
db -4, -5, -4, -4
;new
db -4, -4, -4, -4
db -5 ; Master Sword (Safe)
db -4, -4, -4, -4 ; +5/+10 Bomb Arrows
db -4, -4, -4 ; 3x Programmable Item
db -4 ; Upgrade-Only Sivler Arrows
db -4 ; Upgrade-Only Silver Arrows
db -4 ; 1 Rupoor
db -4 ; Null Item
db -4, -4, -4 ; Red, Blue & Green Clocks
@@ -523,32 +543,36 @@ org $A08800
db -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4 ; Free Compass
db -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4 ; Free Big Key
db -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4 ; Free Small Key
db -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4 ; Unused
db -4 ; reserved for bee traps
db -4, -4, -4, -4, -4 ; reserved for bonk shuffle
db -4 ; Bomb Upgrade
db -4 ; Cane Upgrade
db -4, -4, -4, -4, -4, -4, -4, -4 ; Unused
db -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4 ; Unused
db -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4 ; Unused
db -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4 ; Unused
.x_offsets
db 4, 4, 4, 4, 4, 0, 0, 4
db 4, 4, 4, 4, 5, 0, 0, 0
db 4, 4, 4, 4, 4, 0, 0, 4
db 4, 4, 4, 4, 5, 0, 0, 0
db 0, 0, 0, 4, 0, 4, 0, 0
db 4, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 4, 0, 4, 0, 0
db 4, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 4, 0, 0, 0
db 0, 0, 5, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 4, 0, 0, 0
db 0, 0, 5, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 4, 4, 4, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 4, 4, 4, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 4, 4, 0, 4, 0, 0
db 0, 4, 0, 0
db 0, 0, 4, 4, 0, 4, 0, 0
db 0, 4, 0, 0
;new
db 0, 0, 0, 0
db 4 ; Master Sword (Safe)
db 0, 0, 0, 0 ; +5/+10 Bomb Arrows
db 0, 0, 0 ; 3x Programmable Item
db 0 ; Upgrade-Only Sivler Arrows
db 0 ; Upgrade-Only Silver Arrows
db 4 ; 1 Rupoor
db 0 ; Null Item
db 0, 0, 0 ; Red, Blue & Green Clocks
@@ -563,33 +587,37 @@ org $A08800
db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ; Free Big Key
;db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ; *EVENT*
db 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 ; Free Small Key
db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ; Unused
db 0 ; reserved for bee traps
db 0, 0, 0, 0, 0 ; reserved for bonk shuffle
db 0 ; Bomb Upgrade
db 4 ; Cane Upgrade
db 0, 0, 0, 0, 0, 0, 0, 0 ; Unused
db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ; Unused
db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ; Unused
db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ; Unused
.item_graphics_indices
db $06, $18, $18, $18, $2D, $20, $2E, $09
db $09, $0A, $08, $05, $10, $0B, $2C, $1B
db $06, $18, $18, $18, $2D, $20, $2E, $09
db $09, $0A, $08, $05, $10, $0B, $2C, $1B
db $1A, $1C, $14, $19, $0C, $07, $1D, $2F
db $07, $15, $12, $0D, $0D, $0E, $11, $17
db $1A, $1C, $14, $19, $0C, $07, $1D, $2F
db $07, $15, $12, $0D, $0D, $0E, $11, $17
db $28, $27, $04, $04, $0F, $16, $03, $13
db $01, $1E, $10, $00, $00, $00, $00, $00
db $28, $27, $04, $04, $0F, $16, $03, $13
db $01, $1E, $10, $00, $00, $00, $00, $00
db $00, $30, $22, $21, $24, $24, $24, $23
db $23, $23, $29, $2A, $2C, $2B, $03, $03
db $00, $30, $22, $21, $24, $24, $24, $23
db $23, $23, $29, $2A, $2C, $2B, $03, $03
db $34, $35, $31, $33, $02, $32, $36, $37
db $2C, $06, $0C, $38
db $34, $35, $31, $33, $02, $32, $36, $37
db $2C, $06, $0C, $38
;new
db $39, $3A, $3B, $3C
;5x
db $18 ; Master Sword (Safe)
db $3D, $3E, $3F, $40 ; +5/+10 Bomb Arrows
db $00, $00, $00 ; 3x Programmable Item
db $41 ; Upgrade-Only Sivler Arrows
db $41 ; Upgrade-Only Silver Arrows
db $24 ; 1 Rupoor
db $47 ; Null Item
db $48, $48, $48 ; Red, Blue & Green Clocks
@@ -607,33 +635,36 @@ org $A08800
;db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; *EVENT*
;db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; *EVENT*
;db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; *EVENT*
db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; Unused
db $49 ; reserved for bee traps
db $49, $49, $49, $49, $49 ; reserved for bonk shuffle
db $13 ; Bomb Upgrade
db $07 ; Cane Upgrade
db $49, $49, $49, $49, $49, $49, $49, $49 ; Unused
db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; Unused
db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; Unused
db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; Unused
.wide_item_flag
db $00, $00, $00, $00, $00, $02, $02, $00
db $00, $00, $00, $00, $00, $02, $02, $02
db $00, $00, $00, $00, $00, $02, $02, $00
db $00, $00, $00, $00, $00, $02, $02, $02
db $02, $02, $02, $00, $02, $00, $02, $02
db $00, $02, $02, $02, $02, $02, $02, $02
db $02, $02, $02, $00, $02, $00, $02, $02
db $00, $02, $02, $02, $02, $02, $02, $02
db $02, $02, $02, $02, $00, $02, $02, $02
db $02, $02, $00, $02, $02, $02, $02, $02
db $02, $02, $02, $02, $00, $02, $02, $02
db $02, $02, $00, $02, $02, $02, $02, $02
db $02, $02, $02, $02, $00, $00, $00, $02
db $02, $02, $02, $02, $02, $02, $02, $02
db $02, $02, $02, $02, $00, $00, $00, $02
db $02, $02, $02, $02, $02, $02, $02, $02
db $02, $02, $00, $00, $02, $00, $02, $02
db $02, $00, $02, $02
db $02, $02, $00, $00, $02, $00, $02, $02
db $02, $00, $02, $02
;new
db $02, $02, $02, $02
db $00 ; Master Sword (Safe)
db $02, $02, $02, $02 ; +5/+10 Bomb Arrows
db $02, $02, $02 ; 3x Programmable Item
db $02 ; Upgrade-Only Sivler Arrows
db $02 ; Upgrade-Only Silver Arrows
db $00 ; 1 Rupoor
db $02 ; Null Item
db $02, $02, $02 ; Red, Blue & Green Clocks
@@ -647,34 +678,37 @@ org $A08800
db $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02 ; Free Compass
db $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02 ; Free Big Key
db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; Free Small Key
db $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02 ; Unused
db $02 ; reserved for bee traps
db $02, $02, $02, $02, $02 ; reserved for bonk shuffle
db $02 ; Bomb Upgrade
db $00 ; Cane Upgrade
db $02, $02, $02, $02, $02, $02, $02, $02 ; Unused
db $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02 ; Unused
db $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02 ; Unused
db $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02 ; Unused
db $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02 ; Unused
.properties
db 5, -1, 5, 5, 5, 5, 5, 1
db 2, 1, 1, 1, 2, 2, 2, 4
db 5, -1, 5, 5, 5, 5, 5, 1
db 2, 1, 1, 1, 2, 2, 2, 4
db 4, 4, 1, 1, 2, 1, 1, 1
db 2, 1, 2, 1, 4, 4, 2, 1
db 4, 4, 1, 1, 2, 1, 1, 1
db 2, 1, 2, 1, 4, 4, 2, 1
db 6, 1, 2, 1, 2, 2, 1, 2
db 2, 4, 1, 1, 4, 2, 1, 4
db 6, 1, 2, 1, 2, 2, 1, 2
db 2, 4, 1, 1, 4, 2, 1, 4
db 2, 2, 4, 4, 4, 2, 1, 4
db 1, 2, 2, 1, 2, 2, 1, 1
db 2, 2, 4, 4, 4, 2, 1, 4
db 1, 2, 2, 1, 2, 2, 1, 1
db 4, 4, 1, 2, 2, 4, 4, 4
db 2, 5, 2, 1
db 4, 4, 1, 2, 2, 4, 4, 4
db 2, 5, 2, 1
;new
db 4, 4, 4, 4
db 5 ; Master Sword (Safe)
db 4, 4, 4, 4 ; +5/+10 Bomb Arrows
db 4, 4, 4 ; 3x Programmable Item
db 1 ; Upgrade-Only Sivler Arrows
db 1 ; Upgrade-Only Silver Arrows
db 3 ; 1 Rupoor
db 1 ; Null Item
db 1, 2, 4 ; Red, Blue & Green Clocks
@@ -688,7 +722,11 @@ org $A08800
db 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 ; Free Compass
db 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 ; Free Big Key
db 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 ; Free Small Key
db 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 ; Unused
db 4 ; reserved for bee traps
db 4, 4, 4, 4, 4 ; reserved for bonk shuffle
db 5 ; Bomb Upgrade
db 5 ; Cane Upgrade
db 4, 4, 4, 4, 4, 4, 4, 4 ; Unused
db 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 ; Unused
db 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 ; Unused
db 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 ; Unused
@@ -696,20 +734,20 @@ org $A08800
; \item Target SRAM addresses for items you receive
.item_target_addr
dw $F359, $F359, $F359, $F359, $F35A, $F35A, $F35A, $F345
dw $F346, $F34B, $F342, $F340, $F341, $F344, $F35C, $F347
dw $F359, $F359, $F359, $F359, $F35A, $F35A, $F35A, $F345
dw $F346, $F34B, $F342, $F340, $F341, $F344, $F35C, $F347
dw $F348, $F349, $F34A, $F34C, $F34C, $F350, $F35C, $F36B
dw $F351, $F352, $F353, $F354, $F354, $F34E, $F356, $F357
dw $F348, $F349, $F34A, $F34C, $F34C, $F350, $F35C, $F36B
dw $F351, $F352, $F353, $F354, $F354, $F34E, $F356, $F357
dw $F37A, $F34D, $F35B, $F35B, $F36F, $F364, $F36C, $F375
dw $F375, $F344, $F341, $F35C, $F35C, $F35C, $F36D, $F36E
dw $F37A, $F34D, $F35B, $F35B, $F36F, $F364, $F36C, $F375
dw $F375, $F344, $F341, $F35C, $F35C, $F35C, $F36D, $F36E
dw $F36E, $F375, $F366, $F368, $F360, $F360, $F360, $F374
dw $F374, $F374, $F340, $F340, $F35C, $F35C, $F36C, $F36C
dw $F36E, $F375, $F366, $F368, $F360, $F360, $F360, $F374
dw $F374, $F374, $F340, $F340, $F35C, $F35C, $F36C, $F36C
dw $F360, $F360, $F372, $F376, $F376, $F373, $F360, $F360
dw $F35C, $F359, $F34C, $F355
dw $F360, $F360, $F372, $F376, $F376, $F373, $F360, $F360
dw $F35C, $F359, $F34C, $F355
;new
dw $F375, $F376, $F373, $F373
dw $F359 ; Master Sword (Safe)
@@ -729,7 +767,11 @@ org $A08800
dw $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A ; Free Compass
dw $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A ; Free Big Key
dw $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A ; Free Small Key
dw $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A ; Unused
dw $F36A ; reserved for bee traps
dw $F36A, $F36A, $F36A, $F36A, $F36A ; reserved for bonk shuffle
dw $F38F ; Bomb Upgrade
dw $F38F ; Cane Upgrade
dw $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A ; Unused
dw $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A ; Unused
dw $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A ; Unused
dw $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A, $F36A ; Unused
@@ -739,26 +781,26 @@ org $A08800
; DATA Values to write to the above SRAM locations.
{
.item_values
db $01, $02, $03, $04, $01, $02, $03, $01
db $01, $01, $01, $01, $01, $02, $FF, $01
db $01, $02, $03, $04, $01, $02, $03, $01
db $01, $01, $01, $01, $01, $02, $FF, $01
db $01, $01, $01, $01, $02, $01, $FF, $FF
db $01, $01, $02, $01, $02, $01, $01, $01
db $01, $01, $01, $01, $02, $01, $FF, $FF
db $01, $01, $02, $01, $02, $01, $01, $01
db $FF, $01, $FF, $02, $FF, $FF, $FF, $FF
db $FF, $FF, $02, $FF, $FF, $FF, $FF, $FF
db $FF, $01, $FF, $02, $FF, $FF, $FF, $FF
db $FF, $FF, $02, $FF, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FB, $EC, $FF
db $FF, $FF, $01, $03, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FB, $EC, $FF
db $FF, $FF, $01, $03, $FF, $FF, $FF, $FF
db $9C, $CE, $FF, $01, $0A, $FF, $FF, $FF
db $FF, $01, $03, $01
db $9C, $CE, $FF, $01, $0A, $FF, $FF, $FF
db $FF, $01, $03, $01
;new
db $32, $46, $80, $80
db $02 ; Master Sword (Safe)
db $FF, $FF, $FF, $FF ; +5/+10 Bomb Arrows
db $FF, $FF, $FF ; 3x Programmable Item
db $FF ; Upgrade-Only Sivler Arrows
db $FF ; Upgrade-Only Silver Arrows
db $FF ; 1 Rupoor
db $FF ; Null Item
db $FF, $FF, $FF ; Red, Blue & Green Clocks
@@ -772,26 +814,30 @@ org $A08800
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; Free Compass
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; Free Big Key
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; Free Small Key
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; Unused
db $FF ; reserved for bee traps
db $FF, $FF, $FF, $FF, $FF ; reserved for bonk shuffle
db $FF ; Bomb Upgrade
db $FF ; Cane Upgrade
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; Unused
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; Unused
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; Unused
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; Unused
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF ; Unused
;0x00 - Sewer Passage
;0x02 - Hyrule Castle
;0x04 - Eastern Palace
;0x06 - Desert Palace
;0x08 - Hyrule Castle 2
;0x0A - Swamp Palace
;0x0C - Dark Palace
;0x0E - Misery Mire
;0x10 - Skull Woods
;0x12 - Ice Palace
;0x14 - Tower of Hera
;0x16 - Gargoyle's Domain
;0x18 - Turtle Rock
;0x1A - Ganon's Tower
;0x00 - Sewer Passage
;0x02 - Hyrule Castle
;0x04 - Eastern Palace
;0x06 - Desert Palace
;0x08 - Hyrule Castle 2
;0x0A - Swamp Palace
;0x0C - Dark Palace
;0x0E - Misery Mire
;0x10 - Skull Woods
;0x12 - Ice Palace
;0x14 - Tower of Hera
;0x16 - Gargoyle's Domain
;0x18 - Turtle Rock
;0x1A - Ganon's Tower
.item_masks ; these are dungeon correlations to $7EF364 - $7EF369 so it knows where to store compasses, etc
; sewers and castle get 2 bits active so that they can share their items elegantly
@@ -817,27 +863,27 @@ org $A08800
}
;--------------------------------------------------------------------------------
BottleListExpanded:
db $16, $2B, $2C, $2D, $3D, $3C, $48
db $16, $2B, $2C, $2D, $3D, $3C, $48
PotionListExpanded:
db $2E, $2F, $30, $FF, $0E
db $2E, $2F, $30, $FF, $0E
;--------------------------------------------------------------------------------
Link_ReceiveItemAlternatesExpanded:
{
db -1, -1, -1, -1, -1, -1, -1, -1
db -1, -1, -1, -1, -1, -1, -1, -1 ; db -1, -1, -1, -1, $44, -1, -1, -1
db -1, -1, -1, -1, -1, -1, -1, -1
db -1, -1, -1, -1, -1, -1, -1, -1 ; db -1, -1, -1, -1, $44, -1, -1, -1
db -1, -1, $35, -1, -1, -1, -1, -1
db -1, -1, -1, -1, -1, -1, -1, -1
db -1, -1, $35, -1, -1, -1, -1, -1
db -1, -1, -1, -1, -1, -1, -1, -1
db -1, -1, -1, -1, -1, -1, -1, -1
db -1, -1, -1, -1, -1, -1, -1, -1 ; db -1, -1, $46, -1, -1, -1, -1, -1
db -1, -1, -1, -1, -1, -1, -1, -1
db -1, -1, -1, -1, -1, -1, -1, -1 ; db -1, -1, $46, -1, -1, -1, -1, -1
db -1, -1, -1, -1, -1, -1, -1, -1
db -1, -1, -1, -1, -1, -1, -1, -1
db -1, -1, -1, -1, -1, -1, -1, -1
db -1, -1, -1, -1, -1, -1, -1, -1
db -1, -1, -1, -1, -1, -1, -1, -1
db -1, -1, -1, -1
db -1, -1, -1, -1, -1, -1, -1, -1
db -1, -1, -1, -1
db -1, -1, -1, -1
db -1 ; Master Sword (Safe)
@@ -857,7 +903,11 @@ Link_ReceiveItemAlternatesExpanded:
db -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ; Free Compass
db -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ; Free Big Key
db -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ; Free Small Key
db -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ; Unused
db -1 ; reserved for bee traps
db -1, -1, -1, -1, -1 ; reserved for bonk shuffle
db -1 ; Bomb Upgrade
db -1 ; Cane Upgrade
db -1, -1, -1, -1, -1, -1, -1, -1 ; Unused
db -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ; Unused
db -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ; Unused
db -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ; Unused
@@ -1038,126 +1088,156 @@ AttemptItemSubstitution:
RTS
;--------------------------------------------------------------------------------
CountBottles:
PHX
LDX.b #$00
LDA.l BottleContentsOne : BEQ ++ : INX
++ : LDA.l BottleContentsTwo : BEQ ++ : INX
++ : LDA.l BottleContentsThree : BEQ ++ : INX
++ : LDA.l BottleContentsFour : BEQ ++ : INX
++
TXA
PLX
PHX
LDX.b #$00
LDA.l BottleContentsOne : BEQ ++ : INX
++ : LDA.l BottleContentsTwo : BEQ ++ : INX
++ : LDA.l BottleContentsThree : BEQ ++ : INX
++ : LDA.l BottleContentsFour : BEQ ++ : INX
++
TXA
PLX
RTS
;--------------------------------------------------------------------------------
ActivateGoal:
STZ.b GameSubMode
STZ.b SubSubModule
STZ.b GameSubMode
STZ.b SubSubModule
JML.l StatsFinalPrep
;--------------------------------------------------------------------------------
ChestPrep:
LDA.b #$01 : STA.w ItemReceiptMethod
JSL.l IncrementChestCounter
JSL.l IncrementChestCounter
LDA.l ServerRequestMode : BEQ +
JSL.l ChestItemServiceRequest
RTL
+
LDY.b Scrap0C ; get item value
LDY.b Scrap0C ; get item value
SEC
RTL
;--------------------------------------------------------------------------------
UpdateInventoryLocationExpanded:
{
REP #$30
TYA : AND #$00FF : ASL A : TAX
; Tells what inventory location to write to.
LDA.w AddReceivedItemExpanded_item_target_addr, X : STA $00
SEP #$30
LDA.b #$7E : STA $02
LDA.w AddReceivedItemExpanded_item_values, Y
JSL ItemDowngradeFix
RTL
}
;--------------------------------------------------------------------------------
; Set a flag in SRAM if we pick up a compass in its own dungeon with HUD compass
; counts on
MaybeFlagCompassTotalPickup:
LDA.l CompassMode : AND.b #$0F : BEQ .done
LDA.w DungeonID : CMP.b #$FF : BEQ .done
LSR : STA.b Scrap04 : LDA.b #$0F : !SUB Scrap04 ; Compute flag "index"
CPY.b #$25 : BEQ .setFlag ; Set flag if it's a compass for this dungeon
STA.b Scrap04
TYA : AND.b #$0F : CMP.b Scrap04 : BNE .done ; Check if compass is for this dungeon
.setFlag
CMP.b #$08 : !BGE ++
%ValueShift()
ORA.l CompassCountDisplay : STA.l CompassCountDisplay
BRA .done
++
!SUB #$08
%ValueShift()
BIT.b #$C0 : BEQ + : LDA.b #$C0 : + ; Make Hyrule Castle / Sewers Count for Both
ORA.l CompassCountDisplay+1 : STA.l CompassCountDisplay+1
.done
LDA.l CompassMode : AND.b #$0F : BEQ .done
LDA.w DungeonID : CMP.b #$FF : BEQ .done
LSR : STA.b Scrap04 : LDA.b #$0F : !SUB Scrap04 ; Compute flag "index"
CPY.b #$25 : BEQ .setFlag ; Set flag if it's a compass for this dungeon
STA.b Scrap04
TYA : AND.b #$0F : CMP.b Scrap04 : BNE .done ; Check if compass is for this dungeon
.setFlag
CMP.b #$08 : !BGE ++
%ValueShift()
ORA.l CompassCountDisplay : STA.l CompassCountDisplay
BRA .done
++
!SUB #$08
%ValueShift()
BIT.b #$C0 : BEQ + : LDA.b #$C0 : + ; Make Hyrule Castle / Sewers Count for Both
ORA.l CompassCountDisplay+1 : STA.l CompassCountDisplay+1
.done
RTL
;--------------------------------------------------------------------------------
; Set the dungeon item count display flags if we're entering a dungeon and have the
; corresponding dungeon item
MaybeFlagDungeonTotalsEntrance:
LDX.w DungeonID : CPX.b #$FF : BEQ .done ; Skip if we're not entering dungeon
LDA.l CompassMode : AND.w #$000F : BEQ .maps ; Skip if we're not showing compass counts
JSR.w FlagCompassCount
.maps
LDA.l MapHUDMode : AND.w #$000F : BEQ .done
LDX.w DungeonID
JSR.w FlagMapCount
.done
LDX.w DungeonID : CPX.b #$FF : BEQ .done ; Skip if we're not entering dungeon
LDA.l CompassMode : AND.w #$000F : BEQ .maps ; Skip if we're not showing compass counts
JSR.w FlagCompassCount
.maps
LDA.l MapHUDMode : AND.w #$000F : BEQ .done
LDX.w DungeonID
JSR.w FlagMapCount
.done
RTL
;--------------------------------------------------------------------------------
FlagCompassCount:
CMP.w #$0002 : BEQ .compassShown
LDA.l CompassField : AND.l DungeonItemMasks, X : BEQ .done ; skip if we don't have compass
.compassShown
SEP #$20
TXA : LSR : STA.b Scrap04 : LDA.b #$0F : !SUB Scrap04 ; Compute flag index
CMP.b #$08 : !BGE ++
%ValueShift()
ORA.l CompassCountDisplay : STA.l CompassCountDisplay
REP #$20
BRA .done
++
!SUB #$08
%ValueShift()
BIT.b #$C0 : BEQ + : LDA.b #$C0 : + ; Make Hyrule Castle / Sewers Count for Both
ORA.l CompassCountDisplay+1 : STA.l CompassCountDisplay+1
REP #$20
.done
CMP.w #$0002 : BEQ .compassShown
LDA.l CompassField : AND.l DungeonItemMasks, X : BEQ .done ; skip if we don't have compass
.compassShown
SEP #$20
TXA : LSR : STA.b Scrap04 : LDA.b #$0F : !SUB Scrap04 ; Compute flag index
CMP.b #$08 : !BGE ++
%ValueShift()
ORA.l CompassCountDisplay : STA.l CompassCountDisplay
REP #$20
BRA .done
++
!SUB #$08
%ValueShift()
BIT.b #$C0 : BEQ + : LDA.b #$C0 : + ; Make Hyrule Castle / Sewers Count for Both
ORA.l CompassCountDisplay+1 : STA.l CompassCountDisplay+1
REP #$20
.done
RTS
;--------------------------------------------------------------------------------
FlagMapCount:
CMP.w #$0002 : BEQ .mapShown
LDA.l MapField : AND.l DungeonItemMasks, X : BEQ .done ; skip if we don't have map
.mapShown
SEP #$20
TXA : LSR : STA.b Scrap04 : LDA.b #$0F : !SUB Scrap04 ; Compute flag index
CMP.b #$08 : !BGE ++
%ValueShift()
ORA.l MapCountDisplay : STA.l MapCountDisplay
REP #$20
BRA .done
++
!SUB #$08
%ValueShift()
BIT.b #$C0 : BEQ + : LDA.b #$C0 : + ; Make Hyrule Castle / Sewers Count for Both
ORA.l MapCountDisplay+1 : STA.l MapCountDisplay+1
REP #$20
.done
CMP.w #$0002 : BEQ .mapShown
LDA.l MapField : AND.l DungeonItemMasks, X : BEQ .done ; skip if we don't have map
.mapShown
SEP #$20
TXA : LSR : STA.b Scrap04 : LDA.b #$0F : !SUB Scrap04 ; Compute flag index
CMP.b #$08 : !BGE ++
%ValueShift()
ORA.l MapCountDisplay : STA.l MapCountDisplay
REP #$20
BRA .done
++
!SUB #$08
%ValueShift()
BIT.b #$C0 : BEQ + : LDA.b #$C0 : + ; Make Hyrule Castle / Sewers Count for Both
ORA.l MapCountDisplay+1 : STA.l MapCountDisplay+1
REP #$20
.done
RTS
;--------------------------------------------------------------------------------
MaybeFlagMapTotalPickup:
LDA.l MapHUDMode : AND.b #$0F : BEQ .done
LDA.w DungeonID : CMP.b #$FF : BEQ .done
LSR : STA.b Scrap04 : LDA.b #$0F : !SUB Scrap04 ; Compute flag "index"
CPY.b #$33 : BEQ .setFlag ; Set flag if it's a compass for this dungeon
STA.b Scrap04
TYA : AND.b #$0F : CMP.b Scrap04 : BNE .done ; Check if map is for this dungeon
.setFlag
CMP.b #$08 : !BGE ++
%ValueShift()
ORA.l MapCountDisplay : STA.l MapCountDisplay
BRA .done
++
!SUB #$08
%ValueShift()
BIT.b #$C0 : BEQ + : LDA.b #$C0 : + ; Make Hyrule Castle / Sewers Count for Both
ORA.l MapCountDisplay+1 : STA.l MapCountDisplay+1
.done
LDA.l MapHUDMode : AND.b #$0F : BEQ .done
LDA.w DungeonID : CMP.b #$FF : BEQ .done
LSR : STA.b Scrap04 : LDA.b #$0F : !SUB Scrap04 ; Compute flag "index"
CPY.b #$33 : BEQ .setFlag ; Set flag if it's a compass for this dungeon
STA.b Scrap04
TYA : AND.b #$0F : CMP.b Scrap04 : BNE .done ; Check if map is for this dungeon
.setFlag
CMP.b #$08 : !BGE ++
%ValueShift()
ORA.l MapCountDisplay : STA.l MapCountDisplay
BRA .done
++
!SUB #$08
%ValueShift()
BIT.b #$C0 : BEQ + : LDA.b #$C0 : + ; Make Hyrule Castle / Sewers Count for Both
ORA.l MapCountDisplay+1 : STA.l MapCountDisplay+1
.done
RTL
;--------------------------------------------------------------------------------
LoadReceivedItemExpandedProperties:
CPX.b #$B6 : BEQ .bomb_upgrade
LDA.l AddReceivedItemExpanded_properties, X ; load from table
RTL
.bomb_upgrade
LDA.l SpecialWeaponLevel
CMP.b #$01 : BNE + ; L1 Bombs
LDA.b #4 : RTL
+ : CMP.b #$02 : BNE + ; L2 Bombs
LDA.b #2 : RTL
+ : CMP.b #$03 : BNE + ; L3 Bombs
LDA.b #1 : RTL
+ ; Everything Else
LDA.b #5 : RTL

View File

@@ -11,7 +11,7 @@ QuickSwap:
LDA.l QuickSwapFlag : BEQ .done
LDA.w ItemCursor : BEQ .done ; Skip everything if we don't have any items
LDY.b #$14
LDY.b #$14
PHX
XBA ; restore the stashed value
CMP.b #$30 : BNE +
@@ -59,10 +59,10 @@ RCode:
-
+ CPX.b #$14 : BNE + : LDX.b #$00 ;will wrap around to 1
+ INX
DEY : BEQ +
DEY : BEQ +
.nextItem
JSL.l IsItemAvailable : BEQ -
+
+
RTS
LCode:
@@ -76,17 +76,17 @@ LCode:
-
+ CPX.b #$01 : BNE + : LDX.b #$15 ; will wrap around to $14
+ DEX
DEY : BEQ +
DEY : BEQ +
.nextItem
JSL.l IsItemAvailable : BEQ -
+
+
RTS
IsItemAvailable:
LDA.l InfiniteBombs : BEQ .finite
.infinite
CPX.b #$04 : BNE .finite
LDA.b #$01 : RTL
.finite
LDA.l EquipmentWRAM-1, X
JSL CheckInfiniteBombs : BEQ .finite
.infinite
CPX.b #$04 : BNE .finite
LDA.b #$01 : RTL
.finite
LDA.l EquipmentWRAM-1, X
RTL

View File

@@ -525,7 +525,7 @@ OHKOFlag: skip 1 ; Any non-zero write sets OHKO mode
SpriteSwapper: skip 1 ; Loads new link sprite and glove/armor palette. No gfx or
; code currently in base ROM for this.
BootsModifier: skip 1 ; $01 = Give dash ability
skip 1 ; Unused
GanonVulnerabilityItem: skip 1 ; Item Ganon is vulnerable to while stunned
; Crypto Block ($7F50D0 - $7F51FF)
KeyBase: skip $10 ;
y: skip 4 ;

View File

@@ -1,24 +1,25 @@
LoadBombCount:
LDA.l InfiniteBombs : BNE .infinite
JSL CheckInfiniteBombs : BNE .infinite
.finite
LDA.l BombsEquipment
.infinite
RTL
LoadBombCount16:
LDA.l InfiniteBombs : AND.w #$00FF : BNE .infinite
JSL CheckInfiniteBombs16 : BNE .infinite
.finite
LDA.l BombsEquipment
.infinite
RTL
StoreBombCount:
PHA : LDA.l InfiniteBombs : BEQ .finite
JSL IncrementBombsPlacedCounter
PHA : JSL CheckInfiniteBombs : BEQ .finite
.infinite
PLA : LDA.b #$01 : RTL
.finite
PLA : STA.l BombsEquipment
RTL
SearchForEquippedItem:
LDA.l InfiniteBombs : BEQ +
JSL CheckInfiniteBombs : BEQ +
LDA.b #$01 : LDX.b #$00 : RTL
+
LDA.l BowEquipment ; thing we wrote over
@@ -39,11 +40,11 @@ DecrementArrows:
LDA.b IndoorsFlag : BEQ .not_archery_game ; in overworld
LDA.w $0B9A : BEQ .shoot_arrow ; arrow game active
LDA.b #$00 : BRA .done
.not_archery_game
LDA.l CurrentArrows : BNE .shoot_arrow ; check if we have arrows
BRA .done
.shoot_arrow
PHX
REP #$20

View File

@@ -108,6 +108,10 @@ RTL
; Out: A = RNG Result
;--------------------------------------------------------------------------------
GetStaticRNG:
LDA.l SeededRNG : BNE .seeded
JML GetRandomInt
RTL
.seeded
PHX : PHP
REP #$30 ; set 16-bit accumulator and index registers
AND.w #$000F

605
special_weapons.asm Normal file
View File

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

View File

@@ -18,7 +18,7 @@ SwapSpriteIfNecessary:
SEP #$20 ; set 8-bit accumulator
LDA.l SpriteSwapper : BEQ + : !ADD #!BANK_BASE : CMP.b PlayerSpriteBank : BEQ +
STA.b PlayerSpriteBank
STZ.w SkipOAM ; Set Normal Sprite NMI
STZ.w SkipOAM ; Set Normal Sprite NMI
JSL.l SpriteSwap_Palette_ArmorAndGloves_part_two
+
PLP
@@ -47,34 +47,34 @@ SpriteSwap_Palette_ArmorAndGloves:
; Load armor palette
PHB : PHK : PLB
REP #$20 ; set 16-bit accumulator
; Check what Link's armor value is.
LDA.l ArmorEquipment : AND.w #$00FF : TAX
LDA.l $1BEC06, X : AND.w #$00FF : ASL A : ADC.w #$F000 : STA.b Scrap00
;replace D308 by 7000 and search
REP #$10 ; set 16-bit index registers
LDA.w #$01E2 ; Target SP-7 (sprite palette 6)
LDX.w #$000E ; Palette has 15 colors
TXY : TAX
LDA.b PlayerSpriteBank : AND.w #$00FF : STA.b Scrap02
.loop
LDA.b [Scrap00] : STA.l PaletteBufferAux, X : STA.l PaletteBuffer, X
INC.b Scrap00 : INC.b Scrap00
INX #2
DEY : BPL .loop
SEP #$30
PLB
INC.b NMICGRAM
PLA : PLY : PLX

View File

@@ -177,11 +177,12 @@ InventoryTracking: skip 2 ; - - - - - - o q b r m p n s k f (bitfield)
; p = Magic Powder | n = Mushroom Past | s = Shovel
; k = Inactive Flute | f = Active Flute | o = Any bomb acquired
; q = Quickswap locked
BowTracking: skip 2 ; b s p - - - - - - - - - - - - - (bitfield)
BowTracking: skip 1 ; b s p - - - - - (bitfield)
; b = Bow | s = Silver Arrows Upgrade | p = Second Progressive Bow
; The front end writes two distinct progressive bow items. p
; indicates whether the "second" has been found independent of
; the first
SpecialWeaponLevel: skip 1 ; Keeps track of level of weapon in bomb-only and cane-only modes
ItemLimitCounts: skip 16 ; Keeps track of limited non-progressive items such as lamp.
; See: ItemSubstitutionRules in tables.asm
; Right now this is only used for three items but extra space is
@@ -318,7 +319,8 @@ CrystalCounter: skip 1 ; Total Number of crystals collected (integer)
DungeonsCompleted: skip 2 ; Bitfield indicating whether a dungeon's prize has been collected.
; This has the same shape as the dungeon item bitfields.
MapCountDisplay: skip 2 ;
skip 42 ; Unused
BombsPlaced: skip 2 ; Total Number of bombs placed (16-bit integer)
skip 40 ; Unused
ServiceSequence: ; See servicerequest.asm
ServiceSequenceRx: skip 8 ; Service sequence receive
ServiceSequenceTx: skip 8 ; Service sequence transmit
@@ -544,6 +546,7 @@ endmacro
;--------------------------------------------------------------------------------
%assertSRAM(InventoryTracking, $7EF38C)
%assertSRAM(BowTracking, $7EF38E)
%assertSRAM(SpecialWeaponLevel, $7EF38F)
%assertSRAM(ItemLimitCounts, $7EF390)
;--------------------------------------------------------------------------------
%assertSRAM(GameCounter, $7EF3FF)

View File

@@ -115,25 +115,25 @@ CountChestKeyLong: ; called from ItemDowngradeFix in itemdowngrade.asm
RTL
;--------------------------------------------------------------------------------
CountChestKey: ; called by neighbor functions
PHA : PHX
CPY.b #$24 : BEQ + ; small key for this dungeon - use DungeonID
CPY.b #$A0 : !BLT .end ; Ignore most items
CPY.b #$AE : !BGE .end ; Ignore reserved key and generic key
TYA : AND.B #$0F
TAX : BRA .count ; use Key id instead of DungeonID (Keysanity)
+
LDA.w DungeonID : LSR : TAX
.count
LDA.l DungeonCollectedKeys, X : INC : STA.l DungeonCollectedKeys, X
PHA : PHX
CPY.b #$24 : BEQ + ; small key for this dungeon - use DungeonID
CPY.b #$A0 : !BLT .end ; Ignore most items
CPY.b #$AE : !BGE .end ; Ignore reserved key and generic key
TYA : AND.B #$0F
TAX : BRA .count ; use Key id instead of DungeonID (Keysanity)
+
LDA.w DungeonID : LSR : TAX
.count
LDA.l DungeonCollectedKeys, X : INC : STA.l DungeonCollectedKeys, X
CPX.b #$00 : BNE +
STA.l HCCollectedKeys ; copy HC to sewers
+
CPX.b #$01 : BNE +
STA.l SewerCollectedKeys ; copy sewers to HC
+
.end
PLX : PLA
CPX.b #$00 : BNE +
STA.l HCCollectedKeys ; copy HC to sewers
+
CPX.b #$01 : BNE +
STA.l SewerCollectedKeys ; copy sewers to HC
+
.end
PLX : PLA
RTS
;--------------------------------------------------------------------------------
CountBonkItem: ; called from GetBonkItem in bookofmudora.asm
@@ -185,6 +185,16 @@ IncrementChestTurnCounter:
PLA
RTL
;--------------------------------------------------------------------------------
IncrementBombsPlacedCounter:
PHA
LDA StatsLocked : BNE +
PHP : REP #$20
LDA BombsPlaced : INC : STA BombsPlaced
PLP
+
PLA
RTL
;--------------------------------------------------------------------------------
IncrementChestCounter:
LDA.b #$01 : STA.w ItemReceiptMethod ; thing we wrote over
PHA
@@ -205,9 +215,9 @@ RTL
DecrementItemCounter:
PHA
LDA.l StatsLocked : BNE +
REP #$20
REP #$20
LDA.l TotalItemCounter : DEC : STA.l TotalItemCounter
SEP #$20
SEP #$20
+
PLA
RTL
@@ -280,13 +290,13 @@ IncrementMagicUseCounterOne:
;--------------------------------------------------------------------------------
IncrementOWMirror:
PHA
LDA.b #$08 : STA.w RaceGameFlag ; fail race game
LDA.l StatsLocked : BNE +
LDA.l CurrentWorld : BEQ + ; only do this for DW->LW
LDA.l OverworldMirrors : INC : STA.l OverworldMirrors
+
PLA
PHA
LDA.b #$08 : STA.w RaceGameFlag ; fail race game
LDA.l StatsLocked : BNE +
LDA.l CurrentWorld : BEQ + ; only do this for DW->LW
LDA.l OverworldMirrors : INC : STA.l OverworldMirrors
+
PLA
JMP StatTransitionCounter
;--------------------------------------------------------------------------------
IncrementUWMirror:
@@ -302,8 +312,8 @@ IncrementUWMirror:
RTL
;--------------------------------------------------------------------------------
IncrementSpentRupees:
DEC A : BPL .subtractRupees
LDA.w #$0000 : STA.l CurrentRupees
DEC A : BPL .subtractRupees
LDA.w #$0000 : STA.l CurrentRupees
RTL
.subtractRupees
PHA : PHP
@@ -319,28 +329,28 @@ IndoorTileTransitionCounter:
JMP StatTransitionCounter
;--------------------------------------------------------------------------------
IndoorSubtileTransitionCounter:
LDA.b #$01 : STA.l RedrawFlag ; set redraw flag for items
STZ.w SomariaSwitchFlag ; stuff we wrote over
STZ.w SpriteRoomTag
LDA.b #$01 : STA.l RedrawFlag ; set redraw flag for items
STZ.w SomariaSwitchFlag ; stuff we wrote over
STZ.w SpriteRoomTag
JMP StatTransitionCounter
;--------------------------------------------------------------------------------
StatsFinalPrep:
PHA : PHX : PHP
SEP #$30 ; set 8-bit accumulator and index registers
LDA.l StatsLocked : BNE .ramPostOnly
INC : STA.l StatsLocked
JSL.l AddInventory_incrementBossSwordLong
LDA.l HighestMail : INC : STA.l HighestMail ; add green mail to mail count
LDA.l ScreenTransitions : DEC : STA.l ScreenTransitions ; remove extra transition from exiting gtower via duck
.ramPostOnly
LDA.l SwordBossKills : LSR #4 : !ADD SwordBossKills : STA.l BossKills
LDA.l SwordBossKills+1 : LSR #4 : !ADD SwordBossKills+1 : !ADD BossKills : AND.b #$0F : STA.l BossKills
LDA.l NMIFrames : !SUB LoopFrames : STA.l LagTime
LDA.l NMIFrames+1 : SBC LoopFrames+1 : STA.l LagTime+1
LDA.l NMIFrames+2 : SBC LoopFrames+2 : STA.l LagTime+2
@@ -349,14 +359,14 @@ StatsFinalPrep:
LDA.l RupeesSpent : !ADD DisplayRupees : STA.l RupeesCollected
LDA.l RupeesSpent+1 : ADC DisplayRupees+1 : STA.l RupeesCollected+1
REP #$20
REP #$20
LDA.l TotalItemCounter : !SUB ChestsOpened : STA.l NonChestCounter
.done
PLP : PLX : PLA
LDA.b #$19 : STA.b GameMode ; thing we wrote over, load triforce room
STZ.b GameSubMode
STZ.b SubSubModule
STZ.b GameSubMode
STZ.b SubSubModule
RTL
;--------------------------------------------------------------------------------
; Notes:

View File

@@ -3,15 +3,59 @@
;===================================================================================================
table "data/creditscharmapbighi.txt"
YourSpriteCreditsHi:
db 2
db 55
db " " ; $238002
db 2, 55, " " ; $238002
table "data/creditscharmapbiglo.txt"
YourSpriteCreditsLo:
db 2
db 55
db " " ; $238020
db 2, 55, " " ; $238020
table "data/creditscharmapbighi.txt"
FirstSwordStatsHi:
db 2, 55, "FIRST SWORD " ; $23803E
table "data/creditscharmapbiglo.txt"
FirstSwordStatsLo:
db 2, 55, "FIRST SWORD " ; $23805C
table "data/creditscharmapbighi.txt"
SwordlessKillsHi:
db 2, 55, "SWORDLESS /13" ; $23807A
table "data/creditscharmapbiglo.txt"
SwordlessKillsLo:
db 2, 55, "SWORDLESS /13" ; $238098
table "data/creditscharmapbighi.txt"
FighterSwordKillsHi:
db 2, 55, "FIGHTER'S SWORD /13" ; $2380B6
table "data/creditscharmapbiglo.txt"
FighterSwordKillsLo:
db 2, 55, "FIGHTER'S SWORD /13" ; $2380D4
table "data/creditscharmapbighi.txt"
MasterSwordKillsHi:
db 2, 55, "MASTER SWORD /13" ; $2380F2
table "data/creditscharmapbiglo.txt"
MasterSwordKillsLo:
db 2, 55, "MASTER SWORD /13" ; $238110
table "data/creditscharmapbighi.txt"
TemperedSwordKillsHi:
db 2, 55, "TEMPERED SWORD /13" ; $23812E
table "data/creditscharmapbiglo.txt"
TemperedSwordKillsLo:
db 2, 55, "TEMPERED SWORD /13" ; $23814C
table "data/creditscharmapbighi.txt"
GoldSwordKillsHi:
db 2, 55, "GOLD SWORD /13" ; $23816A
table "data/creditscharmapbiglo.txt"
GoldSwordKillsLo:
db 2, 55, "GOLD SWORD /13" ; $238188
;===================================================================================================
@@ -439,6 +483,16 @@ CreditsLineBlank:
%blankline()
%blankline()
%smallcredits("WHATEVER THIS NONSENSE IS", "yellow")
%blankline()
%blankline()
%bigcredits("KARAFRUIT")
%blankline()
%blankline()
%smallcredits("SPRITE DEVELOPMENT", "green")
%blankline()
@@ -559,13 +613,6 @@ CreditsLineBlank:
%emptyline()
%emptyline()
%emptyline()
%emptyline()
%emptyline()
%emptyline()
%emptyline()
%emptyline()
%emptyline()
%emptyline()
;===================================================================================================
@@ -596,7 +643,8 @@ endif
%blankline()
%blankline()
%bigcreditsleft("FIRST SWORD")
%addarbline(FirstSwordStatsHi)
%addarbline(FirstSwordStatsLo)
%blankline()
@@ -619,23 +667,28 @@ endif
%blankline()
%blankline()
%bigcreditsleft("SWORDLESS /13")
%addarbline(SwordlessKillsHi)
%addarbline(SwordlessKillsLo)
%blankline()
%bigcreditsleft("FIGHTER'S SWORD /13")
%addarbline(FighterSwordKillsHi)
%addarbline(FighterSwordKillsLo)
%blankline()
%bigcreditsleft("MASTER SWORD /13")
%addarbline(MasterSwordKillsHi)
%addarbline(MasterSwordKillsLo)
%blankline()
%bigcreditsleft("TEMPERED SWORD /13")
%addarbline(TemperedSwordKillsHi)
%addarbline(TemperedSwordKillsLo)
%blankline()
%bigcreditsleft("GOLD SWORD /13")
%addarbline(GoldSwordKillsHi)
%addarbline(GoldSwordKillsLo)
%blankline()
%blankline()
@@ -657,6 +710,10 @@ endif
%blankline()
%bigcreditsleft("BOMBS PLACED")
%blankline()
%bigcreditsleft("SAVE AND QUITS")
%blankline()
@@ -676,11 +733,6 @@ endif
%bigcreditsleft("TOTAL LAG TIME")
%blankline()
%blankline()
%blankline()
%blankline()
%blankline()
@@ -709,5 +761,3 @@ endif
%emptyline()
%emptyline()
%emptyline()
;---------------------------------------------------------------------------------------------------

View File

@@ -22,16 +22,18 @@
!MAGICUSED_Y = 349
!BONKS_X = 26
!BONKS_Y = 352
!BOMBS_X = 26
!BOMBS_Y = 355
!SAVE_AND_QUITS_X = 26
!SAVE_AND_QUITS_Y = 355
!SAVE_AND_QUITS_Y = 358
!DEATHS_X = 26
!DEATHS_Y = 358
!DEATHS_Y = 361
!FAERIE_REVIVALS_X = 26
!FAERIE_REVIVALS_Y = 361
!FAERIE_REVIVALS_Y = 364
!TOTAL_MENU_TIME_X = 19
!TOTAL_MENU_TIME_Y = 364
!TOTAL_MENU_TIME_Y = 367
!TOTAL_LAG_TIME_X = 19
!TOTAL_LAG_TIME_Y = 367
!TOTAL_LAG_TIME_Y = 370
!COLLECTION_RATE_X = 22
!COLLECTION_RATE_Y = 380
!TOTAL_TIME_X = 19
@@ -58,6 +60,7 @@ endmacro
%AddStat(DamageCounter, 0, 0, 16, 5, !DAMAGETAKEN_X, !DAMAGETAKEN_Y)
%AddStat(MagicCounter, 0, 0, 16, 5, !MAGICUSED_X, !MAGICUSED_Y)
%AddStat(BonkCounter, 0, 0, 08, 3, !BONKS_X, !BONKS_Y)
%AddStat(BombsPlaced, 0, 0, 16, 4, !BOMBS_X, !BOMBS_Y)
%AddStat(SaveQuitCounter, 0, 0, 08, 2, !SAVE_AND_QUITS_X, !SAVE_AND_QUITS_Y)
%AddStat(DeathCounter, 0, 0, 08, 2, !DEATHS_X, !DEATHS_Y)
%AddStat(FaerieRevivalCounter, 0, 0, 08, 3, !FAERIE_REVIVALS_X, !FAERIE_REVIVALS_Y)

View File

@@ -9,27 +9,43 @@ LoadSwordForDamage:
CMP.b #$04 : !BLT + : DEC : + ; if it's gold sword, change it to tempered
RTL
.notMoth
CMP.b #$CE : BNE .notBlind
LDA.b #$01
RTL
.notBlind
JSR.w LoadModifiedSwordLevel ; load normal sword value
RTL
;================================================================================
macro LookupDamageSubclass(table_address)
PHP
REP #$20 ; set 16-bit accumulator
TXA : LSR : TAX : BCS +
PLP
LDA.l <table_address>, X
LSR #4
BRA ++
+
PLP
LDA.l <table_address>, X
AND.b #$0F
++
endmacro
;================================================================================
LookupDamageLevel:
CPX.w #$0918 : BNE +
LDA.l StalfosBombDamage
RTL
+
PHP
REP #$20 ; set 16-bit accumulator
TXA : LSR : TAX : BCS .lower
.upper
PLP
LDA.l Damage_Table, X
LSR #4
RTL
.lower
PLP
LDA.l Damage_Table, X
AND.b #$0F
RTL
LDA SpecialWeapons : CMP #$01 : BEQ .bomb_table
CMP #$02 : BEQ .pseudo_table
CMP #$03 : BEQ .bomb_table
CMP #$04 : BEQ .bomb_table
CMP #$05 : BEQ .bomb_table
%LookupDamageSubclass(Damage_Table) : RTL
.bomb_table
%LookupDamageSubclass(Damage_Table_Bombs) : RTL
.pseudo_table
%LookupDamageSubclass(Damage_Table_Pseudo) : RTL
;================================================================================
LoadModifiedSwordLevel: ; returns short
LDA.l SwordModifier : BEQ +
@@ -63,29 +79,41 @@ LoadModifiedMagicLevel:
LDA.l MagicConsumption ; load normal magic value
RTL
;================================================================================
; $7E0348 - Ice Value
LoadModifiedIceFloorValue_a11:
LDA.b RoomIndex : CMP.b #$91 : BEQ + : CMP.b #$92 : BEQ + : CMP.b #$93 : BEQ + ; mire basement currently broken - not sure why
LDA.b LinkState : CMP.b #$01 : BEQ + : CMP.b #$17 : BEQ + : CMP.b #$1C : BEQ +
LDA.b LinkSpeed : CMP.b #$02 : BEQ +
LDA.b LinkSlipping : BNE +
LDA.w TileActIce : ORA.l IceModifier : AND.b #$11 : RTL
+ : LDA.w TileActIce : AND.b #$11
RTL
LoadModifiedIceFloorValue_a01:
; ChallengeModes - Permanent Ice Modifier ($01 bit)
LoadModifiedIceFloorValue:
LDA.b RoomIndex : CMP.b #$91 : BEQ + : CMP.b #$92 : BEQ + : CMP.b #$93 : BEQ + ; mire basement currently broken - not sure why
LDA.b LinkState : CMP.b #$01 : BEQ + : CMP.b #$17 : BEQ + : CMP.b #$1C : BEQ +
LDA.b LinkSpeed : CMP.b #$02 : BEQ +
LDA.b LinkSlipping : BNE +
LDA.w TileActIce : ORA.l IceModifier : AND.b #$01 : RTL
+ : LDA.w TileActIce : AND.b #$01
RTL
LDA.b RoomIndex : CMP.b #$29 : BEQ .yes
LDA.w $0308 : BIT #$80 : BNE .yes
LDA.l ChallengeModes : BIT #$01 : BEQ ++
LDA.l RoomIndex : CMP #$16 : BEQ ++ ; swamp supertile with current -- fine for temporary physics but impossible without boots for permanent
.yes
LDA.w TileActIce : ORA.l IceModifier : ORA.b #$10 : RTS
++ : LDA.w TileActIce : ORA.l IceModifier : RTS
+ : LDA.w TileActIce
RTS
LoadModifiedIceFloorValue_a11:
JSR LoadModifiedIceFloorValue : AND.b #$11 : RTL
LoadModifiedIceFloorValue_a01:
JSR LoadModifiedIceFloorValue : AND.b #$01 : RTL
;================================================================================
CheckTabletSword:
LDA.l AllowHammerTablets : BEQ +
LDA.l HammerEquipment : BEQ + ; check for hammer
LDA.b #$02 : RTL
LDA.l HammerEquipment : BNE .allow ; check for hammer
+
LDA.l SpecialWeapons : CMP.b #$01 : BEQ .check_special
CMP.b #$03 : BEQ .check_special
CMP.b #$04 : BEQ .check_special
CMP.b #$05 : BEQ .check_special
CMP.b #$06 : BEQ .allow
BRA .normal
.allow
LDA.b #$02 : RTL
.check_special
LDA.l SpecialWeaponLevel : CMP.b #$02 : !BGE .allow ; check for master bombs
.normal
LDA.l SwordEquipment ; get actual sword value
RTL
;================================================================================
@@ -101,7 +129,17 @@ CheckGanonHammerDamage:
LDA.w SpriteTypeTable, X : CMP.b #$D8 ; original behavior except ganon
RTL
+
LDA.l GanonVulnerabilityItem : CMP.b #$0C : BEQ +
LDA.w SpriteTypeTable, X : CMP.b #$D6 ; original behavior
RTL
+
LDA $0E20, X : CMP.b #$D8 : BCC +
RTL
+
CMP.b #$D6 : BNE +
RTL
+
CLC
RTL
;================================================================================
GetSmithSword:
@@ -127,7 +165,7 @@ GetSmithSword:
REP #$20 : LDA.l CurrentRupees : !SUB.w #$000A : STA.l CurrentRupees : SEP #$20 ; Take 10 rupees
JSL ItemSet_SmithSword
.done
JML.l Smithy_AlreadyGotSword
;================================================================================

View File

@@ -96,7 +96,33 @@ SmithSword:
db #$02 ; #$02 = Tempered Sword (default)
;--------------------------------------------------------------------------------
; 0x18002B- 0x180030 (Unused)
; 0x18002B- 0x18002C (Unused)
;--------------------------------------------------------------------------------
org $30802D ; PC 0x18003D
ChallengeModes:
; ---- ---i
; i: Permanent Ice Physics
db #$00 ; #$00 = Default behavior;
;--------------------------------------------------------------------------------
org $30802E ; PC 0x18003E
DONOTUSE__GanonVulnerabilityItem:
db #$00 ; #$00 = Default behavior (silver arrows)
;--------------------------------------------------------------------------------
org $30802F ; PC 0x18003F
SpecialWeapons:
db #$00
; $00 = Off (default)
; $01 = Bomb-Only mode
; $02 = Pseudosword
; $03 = Byrna-Only mode
; $04 = Somaria-Only mode
; $05 = Canes-Only mode
; $06 = Bee mode
; $07 = Hammer on B (for use with swordless)
;--------------------------------------------------------------------------------
org $308030 ; PC 0x180030
EnableSRAMTrace:
db #$00 ; #$00 = Off (default) - #$01 = On
;--------------------------------------------------------------------------------
org $308031 ; PC 0x180031
EnableEasterEggs:
@@ -205,10 +231,13 @@ db #$00 ; #$00 = Off (default) - #$01 = On (frog/smith can enter multi-entrance
org $30804D ; PC 0x18004D
EscapeAssist: ; ScrubMode:
db #$00
;---- -mba
;m - Infinite Magic
;b - Infinite Bombs
;a - Infinite Arrows
;-MBA -mba
;M - Infinite Magic (after escape)
;B - Infinite Bombs (after escape)
;A - Infinite Arrows (after escape)
;m - Infinite Magic (during escape)
;b - Infinite Bombs (during escape)
;a - Infinite Arrows (during escape)
;--------------------------------------------------------------------------------
org $30804E ; PC 0x18004E
UncleRefill:
@@ -224,7 +253,7 @@ db #$01 ; #$00 = Off - #$01 = On (default)
;--------------------------------------------------------------------------------
org $308050 ; PC 0x180050 - 0x18005C
CrystalPendantFlags_2:
db $00 ; Sewers
db $00 ; Sewers
db $00 ; Hyrule Castle
db $00 ; Eastern Palace
db $00 ; Desert Palace
@@ -232,7 +261,7 @@ CrystalPendantFlags_2:
db $40 ; Swamp Palace
db $40 ; Palace of Darkness
db $40 ; Misery Mire
db $40 ; Skull Woods
db $40 ; Skull Woods
db $40 ; Ice Palace
.hera
db $00 ; Tower of Hera
@@ -364,7 +393,9 @@ org $30808E ; PC 0x18008E
FakeBoots:
db $00 ; #$00 = Off (default) - #$01 = On
;--------------------------------------------------------------------------------
; 0x18008F (unused)
org $30808F ; PC 0x18008F
SeededRNG:
db $01 ; #$00 = Off - #$01 = Seeded RNG (default for rando)
;--------------------------------------------------------------------------------
org $308090 ; PC 0x180090 - 0x180097
ProgressiveSwordLimit:
@@ -624,7 +655,7 @@ dw $6434 ; #6434 - Crystal
;--------------------------------------------------------------------------------
org $02A09B ; PC 0x1209B - Bank02.asm:5802 - (pool MilestoneItem_Flags:)
CrystalPendantFlags:
db $00 ; Sewers
db $00 ; Sewers
db $00 ; Hyrule Castle
db $04 ; Eastern Palace
db $02 ; Desert Palace
@@ -632,7 +663,7 @@ CrystalPendantFlags:
db $10 ; Swamp Palace
db $02 ; Palace of Darkness
db $01 ; Misery Mire
db $40 ; Skull Woods
db $40 ; Skull Woods
db $04 ; Ice Palace
.hera
db $01 ; Tower of Hera
@@ -1385,6 +1416,15 @@ db $04
;AD - Small Key of Ganon's Tower
;AE - Reserved
;AF - Generic Small Key
;B0 - reserved for bee traps
;B1 - reserved for bonk shuffle
;B2 - reserved for bonk shuffle
;B3 - reserved for bonk shuffle
;B4 - reserved for bonk shuffle
;B5 - reserved for bonk shuffle
;B6 - Progressive Bomb
;B7 - Progressive Cane
;================================================================================
;;Residual Portal
;org $0283E0 ; PC 0x103E0 (Bank02.asm:816) (BNE)

View File

@@ -110,22 +110,24 @@ dw #$003C, #$0000
dw #$FFFF, #$7FFF
;--------------------------------------------------------------------------------
DrawChallengeTimer:
LDA.b RoomIndex : AND.w #$00FF : CMP.w #$00C8 : BEQ .is_ohko
LDA.l OHKOFlag : AND.w #$00FF : BEQ +
LDA.w #$2807 : STA.l HUDTileMapBuffer+$90
LDA.w #$280A : STA.l HUDTileMapBuffer+$92
LDA.w #$280B : STA.l HUDTileMapBuffer+$94
LDA.w #$280C : STA.l HUDTileMapBuffer+$96
RTL
+
LDA.w #$247F : STA.l HUDTileMapBuffer+$90
STA.l HUDTileMapBuffer+$92
STA.l HUDTileMapBuffer+$94
STA.l HUDTileMapBuffer+$96
++
.is_ohko
LDA.w #$2807 : STA.l HUDTileMapBuffer+$90
LDA.w #$280A : STA.l HUDTileMapBuffer+$92
LDA.w #$280B : STA.l HUDTileMapBuffer+$94
LDA.w #$280C : STA.l HUDTileMapBuffer+$96
RTL
+
LDA.w #$247F : STA.l HUDTileMapBuffer+$90
STA.l HUDTileMapBuffer+$92
STA.l HUDTileMapBuffer+$94
STA.l HUDTileMapBuffer+$96
++
LDA.l TimerStyle : BNE + : RTL : + ; Hud Timer
LDA.w #$2807 : STA.l HUDTileMapBuffer+$92
LDA.l ClockStatus : AND.w #$0002 : BEQ + ; DNF / OKHO
LDA.l TimerStyle : BNE + : RTL : + ; Hud Timer
LDA.w #$2807 : STA.l HUDTileMapBuffer+$92
LDA.l ClockStatus : AND.w #$0002 : BEQ + ; DNF / OKHO
LDA.l TimeoutBehavior : AND.w #$00FF : BNE ++ ; DNF
LDA.w #$2808 : STA.l HUDTileMapBuffer+$94
@@ -147,13 +149,13 @@ DrawChallengeTimer:
LDA.l TimerRestart : BNE +++ : RTL : +++
BRA ++
+ ; Show Timer
LDA.l ClockStatus : AND.w #$0001 : !ADD.w #$2804 : STA.l HUDTileMapBuffer+$94
LDA.l ClockStatus : AND.w #$0001 : !ADD.w #$2804 : STA.l HUDTileMapBuffer+$94
LDA.w ClockHours+2 : STA.l HUDTileMapBuffer+$96
LDA.w ClockHours : STA.l HUDTileMapBuffer+$98
LDA.w #$2806 : STA.l HUDTileMapBuffer+$9A
LDA.w #$2806 : STA.l HUDTileMapBuffer+$9A
LDA.w ClockMinutes+2 : STA.l HUDTileMapBuffer+$9C
LDA.w ClockMinutes : STA.l HUDTileMapBuffer+$9E
LDA.w #$2806 : STA.l HUDTileMapBuffer+$A0
LDA.w #$2806 : STA.l HUDTileMapBuffer+$A0
LDA.w ClockSeconds+2 : STA.l HUDTileMapBuffer+$A2
LDA.w ClockSeconds : STA.l HUDTileMapBuffer+$A4
++
@@ -162,6 +164,7 @@ DrawChallengeTimer:
RTL
;--------------------------------------------------------------------------------
OHKOTimer:
LDA.b RoomIndex : CMP.b #$C8 : BEQ .kill
LDA.l OHKOFlag : BNE .kill
LDA.l TimeoutBehavior : CMP.b #$02 : BNE +
LDA.l ClockStatus : AND.b #$02 : BEQ +

220
trolls.asm Normal file
View File

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

View File

@@ -97,19 +97,19 @@ RTL
;DATA - Loot Identifier to Sprite ID
{
.gfxSlots
db $06, $44, $45, $46, $2D, $20, $2E, $09
db $09, $0A, $08, $05, $10, $0B, $2C, $1B
db $06, $44, $45, $46, $2D, $20, $2E, $09
db $09, $0A, $08, $05, $10, $0B, $2C, $1B
db $1A, $1C, $14, $19, $0C, $07, $1D, $2F
db $07, $15, $12, $0D, $0D, $0E, $11, $17
db $1A, $1C, $14, $19, $0C, $07, $1D, $2F
db $07, $15, $12, $0D, $0D, $0E, $11, $17
db $28, $27, $04, $04, $0F, $16, $03, $13
db $01, $1E, $10, $00, $00, $00, $00, $00
db $28, $27, $04, $04, $0F, $16, $03, $13
db $01, $1E, $10, $00, $00, $00, $00, $00
db $00, $30, $22, $21, $24, $24, $24, $23
db $23, $23, $29, $2A, $2C, $2B, $03, $03
db $00, $30, $22, $21, $24, $24, $24, $23
db $23, $23, $29, $2A, $2C, $2B, $03, $03
db $34, $35, $31, $33, $02, $32, $36, $37
db $34, $35, $31, $33, $02, $32, $36, $37
db $2C, $43, $0C, $38, $39, $3A, $F9, $3C
; db $2C, $06, $0C, $38, $FF, $FF, $FF, $FF
@@ -143,7 +143,12 @@ RTL
;Ax
db $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F ; Free Small Key
db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; Unused
;Bx
db $49 ; reserved for bee traps
db $13, $13, $13, $13, $13 ; reserved for bonk shuffle
db $13 ; Bomb Upgrade
db $07 ; Cane Upgrade
db $49, $49, $49, $49, $49, $49, $49, $49 ; Unused
db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; Unused
db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; Unused
db $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49, $49 ; Unused
@@ -177,7 +182,7 @@ GetSpritePalette:
;--------
TAX : LDA.l GfxPalettes, X ; look up item gfx
PLB : PLX
CMP.b #$F8 : !BGE .specialHandling
CMP.b #$F6 : !BGE .specialHandling
RTL
.specialHandling
CMP.b #$FD : BNE ++ ; Progressive Sword
@@ -227,6 +232,16 @@ RTL
LDA.b #$08 : RTL
+ ; Any Bow
LDA.b #$02 : RTL
++ : CMP.b #$F7 : BNE ++ ; Progressive Bombs
LDA SpecialWeaponLevel
CMP.b #$00 : BNE + ; No Bombs
LDA.b #$08 : RTL
+ : CMP.b #$01 : BNE + ; L1 Bombs
LDA.b #$04 : RTL
+ : CMP.b #$02 : BNE + ; L2 Bombs
LDA.b #$02 : RTL
+ ; Everything Else
LDA.b #$0A : RTL
++ : CMP.b #$FA : BNE ++ ; RNG Item (Single)
JSL.l GetRNGItemSingle : JMP GetSpritePalette
++ : CMP.b #$FB : BNE ++ ; RNG Item (Multi)
@@ -272,7 +287,11 @@ GfxPalettes:
;db $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 ; *EVENT*
db $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 ; Free Big Key
db $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 ; Free Small Key
db $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 ; Unused
db $08 ; reserved for bee traps
db $08, $08, $08, $08, $08 ; reserved for bonk shuffle
db $F7 ; Bomb Upgrade
db $0A ; Cane Upgrade
db $08, $08, $08, $08, $08, $08, $08, $08 ; Unused
db $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 ; Unused
db $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 ; Unused
db $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08, $08 ; Unused
@@ -328,19 +347,19 @@ IsNarrowSprite:
++ CMP.b #$63 : BNE ++ ; RNG Item (Multi)
JSL.l GetRNGItemMulti
++ CMP.b #$64 : BEQ + ; Progressive Bow
CMP.b #$65 : BNE .continue ; Progressive Bow (alt)
+ : LDA.l BowEquipment : INC : LSR
CMP.l ProgressiveBowLimit : !BLT +
CMP.b #$65 : BNE .continue ; Progressive Bow (alt)
+ : LDA.l BowEquipment : INC : LSR
CMP.l ProgressiveBowLimit : !BLT +
LDA.l ProgressiveBowReplacement
JSL.l IsNarrowSprite
JMP .done
JMP .done
.continue
;--------
LDX.b #$00 ; set index counter to 0
;----
-
CPX.b #$24 : !BGE .false ; finish if we've done the whole list
CPX.b #$2A : !BGE .false ; finish if we've done the whole list
CMP.l .smallSprites, X : BNE + ; skip to next if we don't match
;--
SEC ; set true state
@@ -363,7 +382,8 @@ RTL
db $15, $18, $24, $2A, $34, $35, $36, $42
db $43, $45, $59, $A0, $A1, $A2, $A3, $A4
db $A5, $A6, $A7, $A8, $A9, $AA, $AB, $AC
db $AD, $AE, $AF, $FF, $FF, $FF, $FF, $FF
db $AD, $AE, $AF, $B7, $FF, $FF, $FF, $FF
db $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF
}
;--------------------------------------------------------------------------------
@@ -484,12 +504,12 @@ LoadModifiedTileBufferAddress:
PHA
LDA.l TileUploadOffsetOverride : BEQ +
TAX
LDY.w #$0002
LDY.w #$0002
LDA.w #$0000 : STA.l TileUploadOffsetOverride
BRA .done
+
LDX.w #$2D40
LDY.w #$0002
LDX.w #$2D40
LDY.w #$0002
.done
PLA
RTL
@@ -501,30 +521,30 @@ RTL
; out: Carry - 1 = On Screen, 0 = Off Screen
;--------------------------------------------------------------------------------
Sprite_IsOnscreen:
JSR _Sprite_IsOnscreen_DoWork
BCS +
REP #$20
LDA.b BG2H : PHA : !SUB.w #$0F : STA.b BG2H
LDA.b BG2V : PHA : !SUB.w #$0F : STA.b BG2V
SEP #$20
JSR _Sprite_IsOnscreen_DoWork
REP #$20
PLA : STA.b BG2V
PLA : STA.b BG2H
SEP #$20
+
JSR _Sprite_IsOnscreen_DoWork
BCS +
REP #$20
LDA.b BG2H : PHA : !SUB.w #$0F : STA.b BG2H
LDA.b BG2V : PHA : !SUB.w #$0F : STA.b BG2V
SEP #$20
JSR _Sprite_IsOnscreen_DoWork
REP #$20
PLA : STA.b BG2V
PLA : STA.b BG2H
SEP #$20
+
RTL
_Sprite_IsOnscreen_DoWork:
LDA.w SpritePosXLow, X : CMP.b BG2H
LDA.w SpritePosXHigh, X : SBC.b BG2H+1 : BNE .offscreen
LDA.w SpritePosXLow, X : CMP.b BG2H
LDA.w SpritePosXHigh, X : SBC.b BG2H+1 : BNE .offscreen
LDA.w SpritePosYLow, X : CMP.b BG2V
LDA.w SpritePosYHigh, X : SBC.b BG2V+1 : BNE .offscreen
SEC
LDA.w SpritePosYLow, X : CMP.b BG2V
LDA.w SpritePosYHigh, X : SBC.b BG2V+1 : BNE .offscreen
SEC
RTS
.offscreen
CLC
.offscreen
CLC
RTS
;--------------------------------------------------------------------------------

View File

@@ -56,6 +56,7 @@ Sprite_CheckDamageToPlayerSameLayerLong = $06F12F
OAM_AllocateDeferToPlayerLong = $06F86A
Player_HaltDashAttackLong = $0791B3
Link_ReceiveItem = $07999D
Link_UseHammer = $079F82
Sprite_CheckIfPlayerPreoccupied = $07F4AA
Ancilla_ReceiveItem = $08C3AE
Ancilla_BreakTowerSeal_draw_single_crystal = $08CE93

View File

@@ -0,0 +1,188 @@
;--------------------------------------------------------------------------------
!ANCILLA_DAMAGE = "$06EC84"
; start with X = sprite index, A = ancilla type index
;--------------------------------------------------------------------------------
Ganon_CheckAncillaVulnerability:
PHA
LDA $0EE0, X : BNE .not_vulnerable_pla
PLA
PHX : PHA
LDA.l GanonVulnerabilityItem
TAX : PLA
CMP.l Ganon_CheckByAncilla, X : BNE +
PLX : BRA .vulnerable
+
PLX : PHA
LDA.l GanonVulnerabilityItem
CMP #$01 : BEQ .silver_arrows
CMP #$11 : BEQ .somaria
BRA .not_vulnerable_pla
.silver_arrows
PLA : CMP #$09 : BNE .not_vulnerable
LDA BowEquipment : CMP.b #$03 : !BGE +
LDA #$09 : BRA .not_vulnerable
+
BRA .vulnerable
.hammer
BRA .not_vulnerable_pla ; NYI
.golden_bee
BRA .not_vulnerable_pla ; NYI
.somaria
PLA : CMP #$01 : BEQ .vulnerable
CMP #$2C : BEQ .vulnerable
BRA .vulnerable
.vulnerable
PHX
LDA.l GanonVulnerabilityItem
TAX
LDA.l Ganon_IFrameDuration, X
PLX
STA $0EE0, X ; give the poor pig some iframes
LDA #$20 : STA $0F10, X
LDA #$09
RTL
.not_vulnerable_pla
PLA
.not_vulnerable
PHX : TAX
LDA.l !ANCILLA_DAMAGE, X
PLX
RTL
; end with X = sprite index, A = damage class
;--------------------------------------------------------------------------------
!ANCILLA_CHECK_SPRITE_DAMAGE_PRESET_CLASS = "$06ECE6"
;--------------------------------------------------------------------------------
Ganon_CheckPowderVulnerability: ; we know it's powder
LDA.l GanonVulnerabilityItem : CMP #$05 : BNE .normal ; ganon not vulnerable to powder
LDA $0E20, X : CMP #$D7 : BNE .normal ; not stunned ganon
LDA $0EE0, X : BNE .normal ; ganon has iframes
LDA.l Ganon_IFrameDuration+$05
STA $0EE0, X ; give the poor pig some iframes
LDA #$20 : STA $0F10, X
LDA #$09
BRA .done
.normal
LDA.b #$0A
.done
JSL.l !ANCILLA_CHECK_SPRITE_DAMAGE_PRESET_CLASS
RTL
;--------------------------------------------------------------------------------
Ganon_CheckBeeVulnerability: ; we know it's a bee
; X is bee sprite index
; Y is target sprite index
LDA.l GanonVulnerabilityItem : CMP #$10 : BNE .normal ; ganon not vulnerable to bee
LDA $0E20, Y : CMP #$D7 : BNE .normal ; not stunned ganon
LDA $0EE0, Y : BNE .normal ; ganon has iframes
LDA.l Ganon_IFrameDuration+$10
STA $0EE0, Y ; give the poor pig some iframes
LDA #$20 : STA $0F10, Y
LDA #$09
BRA .done
.normal
LDA.l SpecialWeapons : CMP.b #$06 : BNE .regular_bee
LDA.w $0ED0, X
BRA .done
.regular_bee
LDA.b #$01
.done
TYX
JSL.l !ANCILLA_CHECK_SPRITE_DAMAGE_PRESET_CLASS
RTL
;--------------------------------------------------------------------------------
Ganon_CheckInvincible:
LDA $04C5 : CMP.b #$02 : BEQ .not_transparent
LDA $0E20, X : CMP #$D7 : BNE .transparent ; non-stunned ganon
LDA $0301 : AND.b #$0A : BEQ .transparent ; normal behavior if not hammer
LDA.l GanonVulnerabilityItem : CMP #$0C : BNE .transparent ; ganon not vulnerable to hammer
.not_transparent
LDA #$00 : RTL
.transparent
LDA #$01 : RTL
; return non-zero A if ganon should be invincible
;--------------------------------------------------------------------------------
Ganon_CheckHammerVulnerability: ; we know it's hammer
LDA.l GanonVulnerabilityItem : CMP #$0C : BNE .normal ; ganon not vulnerable to hammer
LDA $0E20, X : CMP #$D7 : BNE .normal ; not stunned ganon
LDA $0EE0, X : BNE .normal ; ganon has iframes
LDA.l Ganon_IFrameDuration+$0C
STA $0EE0, X ; give the poor pig some iframes
LDA #$20 : STA $0F10, X
LDA #$09 : STA $0CF2 ; set damage class to silver
SEC : RTL
.normal
CLC : RTL
; return carry set bit if stunned Ganon and Ganon vulnerable to hammer
;--------------------------------------------------------------------------------
CheckBeeBoss:
; Y is sprite index
LDA.l SpecialWeapons : CMP #$06 : BNE .not_bee_mode
LDA #$00 : RTL
.not_bee_mode
LDA.l GanonVulnerabilityItem : CMP #$10 : BNE .normal ; ganon not vulnerable to bee
LDA $0E20, Y : CMP #$D7 : BNE .normal ; not stunned ganon
LDA #$00 : RTL
.normal
LDA $0B6B, Y : AND.b #$02
RTL
; return non-zero A if entity is a boss (and bee should not attack)
;--------------------------------------------------------------------------------
StunGanon:
JSL RNG_Ganon
BIT.b #$30
BEQ .non_magic
.magic
AND.b #$0E
LSR
BRA .chosen
.non_magic
AND.b #$0C
LSR #2
ORA.b #$08
.chosen
PHX
TAX
LDA.l Ganon_RandomizeItem, X
STA.l GanonVulnerabilityItem
PLX
JSL DialogItem
LDA.b #$D7
STA.w $0E20, X
RTL
;--------------------------------------------------------------------------------
DialogItem:
PHX : PHY
LDA.l GanonVulnerabilityItem
ASL
TAX
LDA.l Ganon_TextBox+1, X
TAY
LDA.l Ganon_TextBox, X
JSL Sprite_ShowMessageUnconditional
PLY : PLX
RTL
;--------------------------------------------------------------------------------
Ganon_RandomizeItem:
db #$05, #$06, #$07, #$08
db #$09, #$0A, #$11, #$12
db #$01, #$02, #$03, #$0C
;--------------------------------------------------------------------------------
Ganon_TextBox:
dw #$0000 ; default behavior--assume silvers
dw #$0199, #$019A, #$019B, #$019C, #$019D
dw #$019E, #$019F, #$01A0, #$01A1, #$01A2
dw #$0000, #$01A3, #$0000, #$0000, #$0000
dw #$01A4, #$01A5, #$01A6, #$0000, #$0000
;--------------------------------------------------------------------------------
Ganon_CheckByAncilla:
db #$00 ; default behavior--we shouldn't be checking the table here anyway
db #$00, #$05, #$1F, #$07, #$00
db #$02, #$0B, #$19, #$18, #$1C
db #$00, #$00, #$00, #$00, #$00
db #$00, #$00, #$31, #$00, #$00
Ganon_IFrameDuration:
db #$00 ; default behavior--we shouldn't be here anyway
db #$00, #$00, #$00, #$34, #$00
db #$00, #$00, #$00, #$00, #$00
db #$00, #$00, #$00, #$00, #$00
db #$00, #$00, #$00, #$00, #$00
;--------------------------------------------------------------------------------

View File

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