From b9a180b8c67b3bd307aaf5991fc63fc99db91c57 Mon Sep 17 00:00:00 2001 From: Karkat Date: Thu, 14 Dec 2017 15:43:20 -0500 Subject: [PATCH] 12/14/2017 --- LTTP_RND_GeneralBugfixes.asm | 21 +++++++++- contrib.asm | 6 +-- cuccostorm.asm | 74 ++++++++++++++++++++++++++++++++++++ hooks.asm | 28 ++++++++++++++ inventory.asm | 3 ++ lampmantlecone.asm | 3 ++ newitems.asm | 2 +- swordswap.asm | 38 +++++++++++++++++- tables.asm | 9 +++++ 9 files changed, 178 insertions(+), 6 deletions(-) create mode 100644 cuccostorm.asm diff --git a/LTTP_RND_GeneralBugfixes.asm b/LTTP_RND_GeneralBugfixes.asm index 184d038..8f0ce5f 100644 --- a/LTTP_RND_GeneralBugfixes.asm +++ b/LTTP_RND_GeneralBugfixes.asm @@ -122,6 +122,7 @@ incsrc goalitem.asm incsrc compasses.asm incsrc doorframefixes.asm ;incsrc shopkeeper.asm +incsrc cuccostorm.asm incsrc hashalphabet.asm ; <- TAKE OUT THE EXTRA ORGS IN HERE - THIS IS WHY WE COULDN'T ADD MORE FILES EARLIER warnpc $A18000 @@ -357,6 +358,9 @@ Sprite_ShowMessageMinimal: org $05EC96 Sprite_ZeldaLong: +org $06A7DB +Chicken_SpawnAvengerChicken: ; returns short + org $06DC5C Sprite_DrawShadowLong: @@ -369,8 +373,11 @@ Sprite_PrepAndDrawSingleLargeLong: org $06DC00 Sprite_PrepAndDrawSingleSmallLong: +org $06EA18 +Sprite_ApplySpeedTowardsPlayerLong: + org $06EAA6 -Sprite_DirectionToFacePlayer: +Sprite_DirectionToFacePlayerLong: org $06F12F Sprite_CheckDamageToPlayerSameLayerLong: @@ -402,6 +409,9 @@ AddPendantOrCrystal: org $0993DF AddDashTremor: +org $09AE64 +Sprite_SetSpawnedCoords: + org $09AD58 GiveRupeeGift: @@ -427,6 +437,12 @@ OAM_AllocateFromRegionF: org $0DBB67 Sound_SetSfxPanWithPlayerCoords: +org $0DBB6E +Sound_SetSfx1PanLong: + +org $0DBB7C +Sound_SetSfx2PanLong: + org $0DBB8A Sound_SetSfx3PanLong: @@ -469,6 +485,9 @@ ShopKeeper_RapidTerminateReceiveItem: org $1DF65D Sprite_SpawnDynamically: +org $1DF65F +Sprite_SpawnDynamically_arbitrary: + org $1DFD4B DiggingGameGuy_AttemptPrizeSpawn: diff --git a/contrib.asm b/contrib.asm index 0c0ec5b..cd2c361 100644 --- a/contrib.asm +++ b/contrib.asm @@ -8,7 +8,7 @@ Sprite_ShowMessageFromPlayerContact_Edit: LDA $4D : CMP.b #$02 : BEQ .dont_show - JSL.l Sprite_DirectionToFacePlayer : TYA : EOR.b #$03 + JSL.l Sprite_DirectionToFacePlayerLong : TYA : EOR.b #$03 SEC RTL .dont_show @@ -27,7 +27,7 @@ Sprite_ShowSolicitedMessageIfPlayerFacing_Edit: LDA $4D : CMP.b #$02 : BEQ .alpha STZ $1CE8 ; set text choice to 1st option (usually yes/confirm/etc) - JSL.l Sprite_DirectionToFacePlayer : PHX : TYX + JSL.l Sprite_DirectionToFacePlayerLong : PHX : TYX ; Make sure that the sprite is facing towards the player, otherwise ; talking can't happen. (What sprites actually use this???) @@ -90,7 +90,7 @@ Sprite_ShowSolicitedMessageIfPlayerFacing_Alt: LDA $0F10, X : BNE .alpha LDA $4D : CMP.b #$02 : BEQ .alpha - JSL Sprite_DirectionToFacePlayer : PHX : TYX + JSL Sprite_DirectionToFacePlayerLong : PHX : TYX ; Make sure that the sprite is facing towards the player, otherwise ; talking can't happen. (What sprites actually use this???) diff --git a/cuccostorm.asm b/cuccostorm.asm new file mode 100644 index 0000000..f21ec1c --- /dev/null +++ b/cuccostorm.asm @@ -0,0 +1,74 @@ +;================================================================================ +StartCuccoStorm: + ;STA $FFFFFF + PHA : PHX : PHY : PHP + SEP #$30 ; set 8-bit accumulator & index registers + LDA $1B : BNE .done ; skip if indoors + + LDY.b #$0A + LDA.b #$0B : JSL Sprite_SpawnDynamically_arbitrary : BMI .done ; spawn a chicken + JSL Sprite_SetSpawnedCoords + LDA.b #$24 : STA $0DA0, Y ; turn it into an attack chicken + LDA.b #$01 : STA $0DB0, Y + + .done + PLP : PLY : PLX : PLA +RTL +;================================================================================ +SpawnAngryCucco: + TXA : EOR $1A : AND.b #$0F : ORA $1B : BNE .spawn_delay + + LDA.b #$0B + LDY.b #$0A + + JSL Sprite_SpawnDynamically_arbitrary : BMI .spawn_failed + + PHX + + TYX + + LDA.b #$1E : JSL Sound_SetSfx3PanLong + + PLX + + LDA.b #$01 : STA $0DB0, Y + + PHX + + JSL GetRandomInt : STA $0F : AND.b #$02 : BEQ .vertical_entry_point + + LDA $0F : ADC $E2 : STA $0D10, Y + LDA $E3 : ADC.b #$00 : STA $0D30, Y + + LDA $0F : AND.b #$01 : TAX + + LDA $9F3C, X : ADC $E8 : STA $0D00, Y + LDA $E9 : ADC.b #$00 : STA $0D20, Y + + BRA .set_velocity + +.vertical_entry_point + + LDA $0F : ADC $E8 : STA $0D00, Y + LDA $E9 : ADC.b #$00 : STA $0D20, Y + + LDA $0F : AND.b #$01 : TAX + + LDA $9F3C, X : ADC $E2 : STA $0D10, Y + LDA $E3 : ADC.b #$00 : STA $0D30, Y + +.set_velocity + + TYX + + LDA.b #$20 : JSL Sprite_ApplySpeedTowardsPlayerLong + + PLX + + LDA.b #$30 : JSL Sound_SetSfx2PanLong + +.spawn_failed +.spawn_delay + +RTL +;================================================================================ \ No newline at end of file diff --git a/hooks.asm b/hooks.asm index bda975b..c1ac148 100644 --- a/hooks.asm +++ b/hooks.asm @@ -357,6 +357,34 @@ JSL.l MSMusicReset : NOP ; $22 = $0100 - $00FF - Hobo ;-------------------------------------------------------------------------------- +;================================================================================ +; Temporary Nerfs and Buffs +;-------------------------------------------------------------------------------- +org $06F400 ; <- 37F400 - Bank06.asm : 5963 (CLC : ADC $7EF35B) +JSL.l LoadModifiedArmorLevel : NOP +;-------------------------------------------------------------------------------- +org $07ADDB ; <- 3ADDB - Bank07.asm : 7251 (LDA $7EF37B : TAY) +JSL.l LoadModifiedMagicLevel +;-------------------------------------------------------------------------------- +org $07AE0D ; <- 3AE0D - Bank07.asm : 7279 (LDA $7EF37B : TAY) +JSL.l LoadModifiedMagicLevel +;-------------------------------------------------------------------------------- +org $07AE8E ; <- 3AE8E - Bank07.asm : 7376 (LDA $7EF37B : TAY) +JSL.l LoadModifiedMagicLevel +;-------------------------------------------------------------------------------- +org $08DCB9 ; <- 45CB9 - ancilla_cane_spark.asm : 256 (LDA $7EF37B : TAY) +JSL.l LoadModifiedMagicLevel +;-------------------------------------------------------------------------------- +org $07B08B +LinkItem_MagicCostBaseIndices: +;-------------------------------------------------------------------------------- +org $07B096 ; <- 3B096 - Bank07.asm : 7731 (LDA LinkItem_MagicCostBaseIndices, X : CLC : ADC $7EF37B : TAX) +JSL.l LoadModifiedMagicLevel : !ADD.w LinkItem_MagicCostBaseIndices +;-------------------------------------------------------------------------------- +org $07B0D5 ; <- 3B0D5 - Bank07.asm : 7783 (LDA LinkItem_MagicCostBaseIndices, X : CLC : ADC $7EF37B : TAX) +JSL.l LoadModifiedMagicLevel : !ADD.w LinkItem_MagicCostBaseIndices +;-------------------------------------------------------------------------------- + ;================================================================================ ; New Items ;-------------------------------------------------------------------------------- diff --git a/inventory.asm b/inventory.asm index 2f68807..d40e71b 100644 --- a/inventory.asm +++ b/inventory.asm @@ -45,6 +45,9 @@ ProcessMenuButtons: .sel_held CLC ; no buttons RTL + ;.l_pressed + ;JSL.l SpawnAngryCucco +;RTL .sel_pressed LDA !HUD_FLAG : ORA #$20 : STA !HUD_FLAG ; set hud flag LDA.b #$20 : STA $012F ; menu select sound diff --git a/lampmantlecone.asm b/lampmantlecone.asm index 5013d48..371203c 100644 --- a/lampmantlecone.asm +++ b/lampmantlecone.asm @@ -4,6 +4,9 @@ ; Output: 0 for darkness, 1 for lamp cone ;-------------------------------------------------------------------------------- LampCheck: + LDA $7F50C4 : CMP.b #$01 : BNE + : RTL : + + CMP.b #$FF : BNE + : INC : RTL : + + LDA $7EF34A : BNE .done ; skip if we already have lantern LDA $7EF3CA : BNE + diff --git a/newitems.asm b/newitems.asm index 069d360..e04f4bf 100755 --- a/newitems.asm +++ b/newitems.asm @@ -847,7 +847,7 @@ GetRNGItemSingle: CMP.l RNGSingleTableSize : !BLT +++ : LDA.b #$00 : +++ ; rollover index if needed STA !SINGLE_INDEX_TEMP ; store index INX : CPX.l RNGSingleTableSize : !BLT .recheck - LDA.b #$5A ; everything is gone, default to null item + LDA.b #$5A ; everything is gone, default to null item - MAKE THIS AN OPTION FOR THIS AND THE OTHER ONE BRA .single_done .single_unused LDA !SINGLE_INDEX_TEMP diff --git a/swordswap.asm b/swordswap.asm index 2ddefca..5c39f08 100644 --- a/swordswap.asm +++ b/swordswap.asm @@ -32,11 +32,47 @@ JMP.l PyramidFairy_BRANCH_GAMMA ;================================================================================ LoadSwordForDamage: LDA $0E20, X : CMP.b #$88 : BNE .notMoth - LDA $7EF359 ; load normal sword value + JSR.w LoadModifiedSwordLevel ; load normal sword value CMP.b #$04 : !BLT + : DEC : + RTL .notMoth + JSR.w LoadModifiedSwordLevel ; load normal sword value +RTL +;================================================================================ +; $7F50C0 - Sword Modifier +LoadModifiedSwordLevel: ; returns short + LDA $7F50C0 : BEQ + + !ADD $7EF359 ; add normal sword value to modifier + BNE ++ : LDA.b #$01 : RTS : ++ + CMP.b #$05 : !BLT ++ : LDA.b #$04 : RTS : ++ + RTS + + LDA $7EF359 ; load normal sword value +RTS +;================================================================================ +; $7EF35B - Armor Inventory +; $7F50C2 - Armor Modifier +; $7F5020 - Scratch Space (Caller Preserved) +LoadModifiedArmorLevel: + PHA + LDA $7EF35B : !ADD $7F50C2 + CMP.b #$FF : BNE + : LDA.b #$00 : + + CMP.b #$03 : !BLT + : LDA.b #$02 : + + STA $7F5020 + PLA + !ADD $7F5020 +RTL +;================================================================================ +; $7EF37B - Magic Inventory +; $7F50C3 - Magic Modifier +LoadModifiedMagicLevel: + LDA $7F50C3 : BEQ + + !ADD $7EF37B ; add normal magic value to modifier + CMP.b #$FF : BNE + : LDA.b #$00 : + + CMP.b #$03 : !BLT ++ : LDA.b #$02 : RTS : ++ + RTL + + + LDA $7F50C3 ; load normal magic value RTL ;================================================================================ CheckTabletSword: diff --git a/tables.asm b/tables.asm index 75541df..f5a7246 100644 --- a/tables.asm +++ b/tables.asm @@ -1285,6 +1285,15 @@ dw #9999 ; Rupee Limit ; $7F50B0 - $7F50BF - Downstream Reserved (Enemizer) +; $7F50C0 - Sword Modifier +; $7F50C1 - Shield Modifier (Not Implemented) +; $7F50C2 - Armor Modifier +; $7F50C3 - Magic Modifier +; $7F50C4 - Light Cone Modifier +; $7F50C5 - Cucco Attack Modifier +; $7F50C6 - Old Man Dash Modifier +; $7F50C7 - Ice Physics Modifier + ; $7F50D0 - $7F50FF - Block Cypher Parameters ; $7F5100 - $7F51FF - Block Cypher Buffer ; $7F5200 - $7F52FF - RNG Pointer Block