5 Commits

23 changed files with 131 additions and 58 deletions

View File

@@ -206,6 +206,7 @@ warnpc $A38000
org $B98000
incsrc gk/crystalswitchbook.asm
incsrc gk/orange_potion.asm
incsrc gk/mimicdash.asm
incsrc gk/gloom.asm
incsrc gk/special_weapons.asm

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -304,7 +304,7 @@ DialogGanon2:
BCS +
LDA.w #$018D : JMP .done
+
LDA.l GanonVulnerabilityItem : AND.w #$00FF
LDA.l GanonVulnerabilityItem : AND.w #$007F
BEQ .silver_arrows
CMP.w #$0001 : BEQ .silver_arrows
CMP.w #$0004 : BEQ .bombs

View File

@@ -1,14 +1,14 @@
OnPrepFileSelect:
LDA.b GameSubMode : CMP.b #$03 : BNE +
LDA.b #$06 : STA.b NMISTRIPES ; thing we wrote over
RTL
+
PHA : PHX
REP #$10
JSL LoadAlphabetTilemap
JSL LoadFullItemTiles
SEP #$10
PLX : PLA
LDA.b GameSubMode : CMP.b #$03 : BNE +
LDA.b #$06 : STA.b NMISTRIPES ; thing we wrote over
RTL
+
PHA : PHX
REP #$10
JSL LoadAlphabetTilemap
JSL LoadFullItemTiles
SEP #$10
PLX : PLA
RTL
;--------------------------------------------------------------------------------
OnDrawHud:
@@ -22,17 +22,17 @@ JML ReturnFromOnDrawHud
;--------------------------------------------------------------------------------
OnDungeonEntrance:
STA.l PegColor ; thing we wrote over
JSL MaybeFlagDungeonTotalsEntrance
LDA.w #$0001 : STA.l UpdateHUDFlag
SEP #$30
JSL DynamicDropGFXClear
REP #$30
JSL MaybeFlagDungeonTotalsEntrance
LDA.w #$0001 : STA.l UpdateHUDFlag
SEP #$30
JSL DynamicDropGFXClear
REP #$30
RTL
;--------------------------------------------------------------------------------
OnDungeonBossExit:
JSL StatTransitionCounter
JSL ClearMultiworldText
JSL DynamicDropGFXClear
JSL StatTransitionCounter
JSL ClearMultiworldText
JSL DynamicDropGFXClear
RTL
;--------------------------------------------------------------------------------
OnPlayerDead:
@@ -41,40 +41,44 @@ OnPlayerDead:
JSL DynamicDropGFXClear
JSL SetSilverBowMode
JSL RefreshRainAmmo
LDA.b #$00
STA.l InfiniteMagic
PLA
RTL
;--------------------------------------------------------------------------------
OnDungeonExit:
PHA : PHP
SEP #$20 ; set 8-bit accumulator
JSL SQEGFix
JSL DynamicDropGFXClear
PLP : PLA
PHA : PHP
SEP #$20 ; set 8-bit accumulator
JSL SQEGFix
JSL DynamicDropGFXClear
PLP : PLA
STA.w DungeonID : STZ.w Map16ChangeIndex ; thing we wrote over
STA.w DungeonID : STZ.w Map16ChangeIndex ; thing we wrote over
PHA : PHP
LDA.w #$0001 : STA.l UpdateHUDFlag
JSL HUD_RebuildLong
JSL FloodGateResetInner
JSL SetSilverBowMode
PLP : PLA
PHA : PHP
LDA.w #$0001 : STA.l UpdateHUDFlag
JSL HUD_RebuildLong
JSL FloodGateResetInner
JSL SetSilverBowMode
PLP : PLA
RTL
;--------------------------------------------------------------------------------
OnSave:
LDA.b #$70 : PHA : PLB ; thing we wrote over - data bank change
LDA.b #$70 : PHA : PLB ; thing we wrote over - data bank change
JSL DarkWorldSaveFix
JML MSUResumeReset
JML MSUResumeReset
;--------------------------------------------------------------------------------
OnQuit:
JSL SQEGFix
LDA.b #$00 : STA.l AltTextFlag ; bandaid patch bug with mirroring away from text
LDA.b #$10 : STA.b MAINDESQ ; thing we wrote over
LDA.b #$00
STA.l InfiniteMagic
RTL
;--------------------------------------------------------------------------------
OnDeathNoSave:
JSL MSUResumeReset
LDA.b #$05 : STA.b $10 ; what we wrote over
JSL MSUResumeReset
LDA.b #$05 : STA.b $10 ; what we wrote over
RTL
;--------------------------------------------------------------------------------
OnUncleItemGet:

View File

@@ -82,7 +82,10 @@ DrawBottle:
AND.w #$00FF : BNE +
LDX.w #FileSelectItems_empty_bottle
JMP DrawItemGray
+ : DEC #2 : BNE +
+ : DEC : BNE +
LDX.w #FileSelectItems_orange_potion
JMP DrawItem
+ : DEC : BNE +
LDX.w #FileSelectItems_empty_bottle
JMP DrawItem
+ : DEC : BNE +
@@ -619,6 +622,8 @@ FileSelectItems:
dw #$0282|!FS_COLOR_GREEN, #$0282|!FS_COLOR_GREEN|!FS_HFLIP, #$0292|!FS_COLOR_GREEN, #$0284|!FS_COLOR_GREEN
.blue_potion
dw #$0282|!FS_COLOR_BLUE, #$0282|!FS_COLOR_BLUE|!FS_HFLIP, #$0292|!FS_COLOR_BLUE, #$0285|!FS_COLOR_BLUE
.orange_potion
dw #$0282|!FS_COLOR_BROWN, #$0282|!FS_COLOR_BROWN|!FS_HFLIP, #$0292|!FS_COLOR_BROWN, #$0286|!FS_COLOR_BROWN
.fairy_bottle
dw #$0287|!FS_COLOR_YELLOW|!FS_HFLIP, #$0287|!FS_COLOR_YELLOW, #$0296|!FS_COLOR_BLUE, #$0297|!FS_COLOR_BLUE
.bee_bottle

View File

@@ -116,7 +116,7 @@ db !TIER_JUNK ; 62 - RNG pool item (single)
db !TIER_JUNK ; 63 - RNG pool item (multi)
db !TIER_MAJOR ; 64 - Progressive bow
db !TIER_MAJOR ; 65 - Progressive bow
db !TIER_JUNK ; 66 -
db !TIER_HEALTH ; 66 - Potion refill (orange)
db !TIER_JUNK ; 67 -
db !TIER_JUNK ; 68 -
db !TIER_JUNK ; 69 -

View File

@@ -101,7 +101,7 @@ db $00 ; 62 - RNG pool item (single)
db $00 ; 63 - RNG pool item (multi)
db $00 ; 64 - Progressive bow
db $00 ; 65 - Progressive bow
db $00 ; 66 -
db $00 ; 66 - Potion refill (orange)
db $00 ; 67 -
db $00 ; 68 -
db $00 ; 69 -

31
gk/orange_potion.asm Normal file
View File

@@ -0,0 +1,31 @@
CheckOrangePotion:
LDA.l BottleContents, X
CMP.b #$01
BEQ .orange
; return to vanilla behavior
CMP.b #$00
RTL
.orange
LDA.l InfiniteMagic
BNE .nope
LDA.b #$02
STA.l BottleContents, X
STZ.w $0301
LDA.b #$01
STA.l InfiniteMagic
JSL RebuildHUD_update_long
LDA.b #$00
RTL
.nope
JSL Sound_SetSfxPanWithPlayerCoords
ORA.b #$3C
STA.w SFX2
LDA.b #$00
RTL

View File

@@ -269,4 +269,4 @@ ItemSources:
; m - have map
; v - have visited dungeon
MapSwapping:
db $01 ; NYI
db $01

View File

@@ -1,6 +1,6 @@
DamageClassCalc:
PHA
LDA.l GanonVulnerabilityItem : BEQ +
LDA.l GanonVulnerabilityItem : AND.b #$7F : BEQ +
LDA.w SpriteTypeTable, X : CMP.b #$D7 : BNE +
PLA
JSL Ganon_CheckAncillaVulnerability

View File

@@ -4,12 +4,14 @@ Ganon_CheckAncillaVulnerability:
PLA
PHX : PHA
LDA.l GanonVulnerabilityItem
BMI .no_weakness
BVS .no_weakness
AND.b #$7F
TAX : PLA
CMP.l Ganon_CheckByAncilla, X : BNE +
PLX : BRA .vulnerable
+ PLX : PHA
LDA.l GanonVulnerabilityItem
AND.b #$7F
BEQ .silver_arrows
CMP.b #$01 : BEQ .silver_arrows
CMP.b #$11 : BEQ .somaria
@@ -34,6 +36,7 @@ Ganon_CheckAncillaVulnerability:
.vulnerable
PHX
LDA.l GanonVulnerabilityItem
AND.b #$7F
TAX
LDA.l Ganon_IFrameDuration, X
PLX
@@ -52,7 +55,7 @@ Ganon_CheckAncillaVulnerability:
RTL
;--------------------------------------------------------------------------------
Ganon_CheckPowderVulnerability:
LDA.l GanonVulnerabilityItem : CMP.b #$05 : BNE .normal
LDA.l GanonVulnerabilityItem : AND.b #$7F : CMP.b #$05 : BNE .normal
LDA.w SpriteTypeTable, X : CMP.b #$D7 : BNE .normal
LDA.w $0EE0, X : BNE .normal ; ganon has i-frames
LDA.l Ganon_IFrameDuration+$05
@@ -69,7 +72,7 @@ Ganon_CheckPowderVulnerability:
Ganon_CheckBeeVulnerability:
; X is bee sprite index
; Y is target sprite index
LDA.l GanonVulnerabilityItem : CMP.b #$10 : BNE .normal
LDA.l GanonVulnerabilityItem : AND.b #$7F : CMP.b #$10 : BNE .normal
LDA.w SpriteTypeTable, Y : CMP.b #$D7 : BNE .normal
LDA.w $0EE0, Y : BNE .normal ; ganon has i-frames
LDA.l Ganon_IFrameDuration+$10
@@ -88,14 +91,14 @@ Ganon_CheckInvincible:
LDA.w $04C5 : CMP.b #$02 : BEQ .not_transparent
LDA.w SpriteTypeTable, X : CMP.b #$D7 : BNE .transparent ; non-stunned ganon
LDA.w UseY1 : AND.b #$0A : BEQ .transparent ; normal behavior if not hammering
LDA.l GanonVulnerabilityItem : CMP.b #$0C : BNE .transparent
LDA.l GanonVulnerabilityItem : AND.b #$7F : CMP.b #$0C : BNE .transparent
.not_transparent
LDA.b #$00 : RTL
.transparent
LDA.b #$01 : RTL
;--------------------------------------------------------------------------------
Ganon_CheckHammerVulnerability:
LDA.l GanonVulnerabilityItem : CMP.b #$0C : BNE .normal
LDA.l GanonVulnerabilityItem : AND.b #$7F : CMP.b #$0C : BNE .normal
LDA.w SpriteTypeTable, X : CMP.b #$D7 : BNE .normal
LDA.w $0EE0, X : BNE .normal ; ganon has i-frames
LDA.l Ganon_IFrameDuration+$0C
@@ -108,7 +111,7 @@ Ganon_CheckHammerVulnerability:
;--------------------------------------------------------------------------------
CheckBeeBoss:
; Y is sprite index
LDA.l GanonVulnerabilityItem : CMP.b #$10 : BNE .normal
LDA.l GanonVulnerabilityItem : AND.b #$7F : CMP.b #$10 : BNE .normal
LDA.w SpriteTypeTable, Y : CMP.b #$D7 : BNE .normal
LDA.b #$00 : RTL
.normal

View File

@@ -1,5 +1,8 @@
GoalItemGanonCheck:
LDA.w SpriteTypeTable, X : CMP.b #$D6 : BNE .success ; skip if not ganon
LDA.l GanonVulnerabilityItem : BPL +
LDA.w SpriteActivity, X : CMP.b #$12 : BEQ .fail
+
LDA.b #$01 : JSL CheckConditionPass
BCS .success

View File

@@ -997,6 +997,12 @@ LDA.w BottleListExpanded, X
org $89895C ; 4895C - ancilla_init.asm:1344 (LDA PotionList, X)
LDA.w PotionListExpanded, X
org $89895A
LDX.b #$06
org $89896A
ADC.b #$01
;--------------------------------------------------------------------------------
org $86D1EB ; 351EB - sprite_absorbable.asm:364 (STA $7EF375) ; bugbug commented out until i figure out why it doesn't work
JSL HandleBombAbsorbtion
@@ -1029,6 +1035,7 @@ JSL RefillHealth
;--------------------------------------------------------------------------------
org $80F922 ; <- 7922 - Bank00.asm:8543 - (JSL HUD.RefillMagicPower : BCC .beta)
JSL RefillMagic
;--------------------------------------------------------------------------------
;================================================================================
; Early Bottle Fix
@@ -1165,6 +1172,8 @@ ORA.w #$8000 : STA.w $007E, Y
ORA.w #$4000 : STA.w $0084, Y
JSL AddYMarker : NOP #2
;--------------------------------------------------------------------------------
org $8DF779 ; <- 6F779 (not in disassembly) - mushroom bottle hud tile
dw $20D2, $60D2, $20E2, $202D ; (Orig: $2044, $2045, $2046, $2047)
org $8DF789+6 ; <- 6F789+6 (not in disassembly) - red bottle hud tile, lower right
dw $2413 ; (Orig: #$24E3)
org $8DF789+6+8 ; green bottle hud tile, lower right
@@ -2847,3 +2856,10 @@ org $8DFB63 ; bank_0D.asm@18092 (LDA.l $7EF33F, X : AND.w #$00FF)
JSL CheckFluteInHUD
NOP #3
;--------------------------------------------------------------------------------
;================================================================================
; Orange Potion (Chateau Romani)
;--------------------------------------------------------------------------------
org $87A15C ; bank_07.asm@6963 (LDA.l $7EF35C, X)
JSL CheckOrangePotion
;--------------------------------------------------------------------------------

View File

@@ -239,7 +239,7 @@ endmacro
%ReceiptProps($63, -4, 0, $FF, $F36A, $FF, skip, rng_multi) ; 63 - RNG pool item (multi)
%ReceiptProps($64, -4, 0, $FF, $F340, $FF, skip, progressive_bow) ; 64 - Progressive bow
%ReceiptProps($65, -4, 0, $FF, $F340, $FF, skip, progressive_bow_2) ; 65 - Progressive bow
%ReceiptProps($66, -4, 0, $FF, $F36A, $FF, skip, skip) ; 66 -
%ReceiptProps($66, -4, 0, $51, $F36E, $FF, skip, skip) ; 66 - Potion refill (yellow)
%ReceiptProps($67, -4, 0, $FF, $F36A, $FF, skip, skip) ; 67 -
%ReceiptProps($68, -4, 0, $FF, $F36A, $FF, skip, skip) ; 68 -
%ReceiptProps($69, -4, 0, $FF, $F36A, $FF, skip, skip) ; 69 -
@@ -518,7 +518,7 @@ endmacro
%SpriteProps($63, 2, 2, $FF, $FF, $0000) ; 63 - RNG pool item (multi)
%SpriteProps($64, 2, 2, $FF, $FF, $0000) ; 64 - Progressive bow
%SpriteProps($65, 2, 2, $FF, $FF, $0000) ; 65 - Progressive bow
%SpriteProps($66, 2, 2, $00, $00, $0000) ; 66 -
%SpriteProps($66, 2, 2, $02, $02, $0000) ; 66 - Potion refill (yellow)
%SpriteProps($67, 2, 2, $00, $00, $0000) ; 67 -
%SpriteProps($68, 2, 2, $00, $00, $0000) ; 68 -
%SpriteProps($69, 2, 2, $00, $00, $0000) ; 69 -
@@ -794,7 +794,7 @@ endmacro
%InventoryItem($63, $0001, $0000, $0000) ; 63 - RNG pool item (multi)
%InventoryItem($64, $00A5, $0000, $0000) ; 64 - Progressive bow
%InventoryItem($65, $00A5, $0000, $0000) ; 65 - Progressive bow
%InventoryItem($66, $0001, $0000, $0000) ; 66 -
%InventoryItem($66, $0081, $0000, $0000) ; 66 - Potion refill (yellow)
%InventoryItem($67, $0001, $0000, $0000) ; 67 -
%InventoryItem($68, $0001, $0000, $0000) ; 68 -
%InventoryItem($69, $0001, $0000, $0000) ; 69 -
@@ -1054,7 +1054,7 @@ ItemReceiptGraphicsOffsets:
dw $0 ; 63 - RNG pool item (multi)
dw $0 ; 64 - Progressive bow
dw $0 ; 65 - Progressive bow
dw $0 ; 66 -
dw $0CE0 ; 66 - Potion refill (yellow)
dw $0 ; 67 -
dw $0 ; 68 -
dw $0 ; 69 -
@@ -1324,7 +1324,7 @@ StandingItemGraphicsOffsets:
dw $0 ; 63 - RNG pool item (multi)
dw $0 ; 64 - Progressive bow
dw $0 ; 65 - Progressive bow
dw $0 ; 66 -
dw $0CA0 ; 66 - Potion refill (yellow)
dw $0 ; 67 -
dw $0 ; 68 -
dw $0 ; 69 -
@@ -1590,7 +1590,7 @@ VRAMAddressOffset:
dw $0024 ; 63 - RNG pool item (multi)
dw $0024 ; 64 - Progressive bow
dw $0024 ; 65 - Progressive bow
dw $0024 ; 66 -
dw $0024 ; 66 - Potion refill (yellow)
dw $0024 ; 67 -
dw $0024 ; 68 -
dw $0024 ; 69 -

View File

@@ -273,10 +273,15 @@ NewHUD_DrawMagicMeter:
STA.w CurrentMagic
TAY
LDA.b FrameCounter
REP #$30
AND.w #$000C
LSR
LDA.w #$0002
; ; cycle through colors
; LDA.b FrameCounter
; REP #$30
; AND.w #$000C
; LSR
BRA .recolor
.set_index ; this branch is always 0000 when taken

View File

@@ -935,7 +935,7 @@ BottleListExpanded:
db $16, $2B, $2C, $2D, $3D, $3C, $48
PotionListExpanded:
db $2E, $2F, $30, $FF, $0E
db $66, $FF, $2E, $2F, $30, $FF, $0E
;--------------------------------------------------------------------------------
HandleBowTracking:
; In: A - Item Receipt ID

View File

@@ -433,6 +433,7 @@ Shopkeeper_BuyItem:
CMP.b #$2E : BEQ .refill ; Red Potion Refill
CMP.b #$2F : BEQ .refill ; Green Potion Refill
CMP.b #$30 : BEQ .refill ; Blue Potion Refill
CMP.b #$66 : BEQ .refill ; Yellow Potion Refill
CMP.b #$AF : BEQ .generic_key
BRA +
.refill

View File

@@ -174,7 +174,7 @@ FindLine:
!FRAMES_PER_SECOND = 60
!FRAMES_PER_MINUTE = 60*60
!FRAMES_PER_HOUR = 60*60*60
!MAX_FRAME_COUNT = (99*60)+(59*60)+(59*60)+59
!MAX_FRAME_COUNT = (99*60*60*60)+(59*60*60)+(59*60)+59
macro CountUnits(framesPerUnit, unitCounter)
STZ.b <unitCounter>

View File

@@ -101,7 +101,7 @@ CheckGanonHammerDamage:
LDA.w SpriteTypeTable, X : CMP.b #$D8 ; original behavior except ganon
RTL
+
LDA.l GanonVulnerabilityItem : CMP.b #$0C : BEQ .hammer_silvers
LDA.l GanonVulnerabilityItem : AND.b #$7F : CMP.b #$0C : BEQ .hammer_silvers
LDA.w SpriteTypeTable, X : CMP.b #$D6 ; original behavior
RTL

View File

@@ -105,6 +105,10 @@ db $00
;--------------------------------------------------------------------------------
org $B0802E
GanonVulnerabilityItem:
; sn-i iiii
; s - immune to sword spins in phase 4
; n - immune to all items
; i - index of item vulnerability
db $00 ; $00 = default behavior (silver arrows)
;--------------------------------------------------------------------------------
org $B0902F