diff --git a/clock.asm b/clock.asm index 8fa0c3e..c0eebd1 100644 --- a/clock.asm +++ b/clock.asm @@ -144,7 +144,7 @@ Clock_QuickStamp: LDX #$00; - LDA $002800 : AND.b #$0F : CMP #$0F : BEQ .ready ; check for clock chip ready signal - CPX.b #$0E : !BLT ++ : CLC : BRL .done : ++ ; if we've read 14 bytes with no success, unset carry and exit + CPX.b #$0E : !BLT ++ : CLC : JMP .done : ++ ; if we've read 14 bytes with no success, unset carry and exit INX BRA - SEC ; indicate success @@ -226,7 +226,7 @@ Clock_GetTime: LDX #$00; - LDA $002800 : AND.b #$0F : CMP #$0F : BEQ .ready ; check for clock chip ready signal - CPX.b #$0E : !BLT ++ : CLC : BRL .done : ++ ; if we've read 14 bytes with no success, unset carry and exit + CPX.b #$0E : !BLT ++ : CLC : JMP .done : ++ ; if we've read 14 bytes with no success, unset carry and exit INX BRA - SEC ; indicate success diff --git a/crypto.asm b/crypto.asm index e28580a..120344f 100644 --- a/crypto.asm +++ b/crypto.asm @@ -192,7 +192,7 @@ XXTEA_Decode: LDA.w !sum : !SUB.l CryptoDelta : STA.w !sum LDA.w !sum+2 : SBC.l CryptoDelta+2 : STA.w !sum+2 - DEC !rounds : BEQ + : BRL --- : + ; } while (--rounds); + DEC !rounds : BEQ + : JMP --- : + ; } while (--rounds); PLB : PLP RTL diff --git a/dialog.asm b/dialog.asm index 3216fe0..720f7b1 100644 --- a/dialog.asm +++ b/dialog.asm @@ -137,7 +137,7 @@ FreeDungeonItemNotice: LDA $02 : PHA ;-------------------------------- - LDA.l FreeItemText : BNE + : BRL .skip : + + LDA.l FreeItemText : BNE + : JMP .skip : + LDA #$00 : STA $7F5010 ; initialize scratch LDA.l FreeItemText : AND.b #$01 : CMP.b #$01 : BNE + ; show message for general small key @@ -145,48 +145,48 @@ FreeDungeonItemNotice: %CopyDialog(Notice_SmallKeyOf) LDA !OFFSET_RETURN : DEC #2 : STA !OFFSET_POINTER %CopyDialog(Notice_Self) - BRL .done + JMP .done + : LDA.l FreeItemText : AND.b #$02 : CMP.b #$02 : BNE + ; show message for general compass LDA !ITEM_TEMPORARY : CMP.b #$25 : BNE + ; general compass %CopyDialog(Notice_CompassOf) LDA !OFFSET_RETURN : DEC #2 : STA !OFFSET_POINTER %CopyDialog(Notice_Self) - BRL .done + JMP .done + : LDA.l FreeItemText : AND.b #$04 : CMP.b #$04 : BNE + ; show message for general map LDA !ITEM_TEMPORARY : CMP.b #$33 : BNE + ; general map %CopyDialog(Notice_MapOf) LDA !OFFSET_RETURN : DEC #2 : STA !OFFSET_POINTER %CopyDialog(Notice_Self) - BRL .done + JMP .done + : LDA.l FreeItemText : AND.b #$08 : CMP.b #$08 : BNE + ; show message for general big key LDA !ITEM_TEMPORARY : CMP.b #$32 : BNE + ; general big key %CopyDialog(Notice_BigKeyOf) LDA !OFFSET_RETURN : DEC #2 : STA !OFFSET_POINTER %CopyDialog(Notice_Self) - BRL .done + JMP .done + LDA.l FreeItemText : AND.b #$04 : CMP.b #$04 : BNE + ; show message for dungeon map LDA !ITEM_TEMPORARY : AND.b #$F0 ; looking at high bits only CMP.b #$70 : BNE + ; map of... %CopyDialog(Notice_MapOf) - BRL .dungeon + JMP .dungeon + : LDA.l FreeItemText : AND.b #$02 : CMP.b #$02 : BNE + ; show message for dungeon compass LDA !ITEM_TEMPORARY : AND.b #$F0 : CMP.b #$80 : BNE + ; compass of... %CopyDialog(Notice_CompassOf) - BRL .dungeon + JMP .dungeon + : LDA.l FreeItemText : AND.b #$08 : CMP.b #$08 : BNE + ; show message for dungeon big key LDA !ITEM_TEMPORARY : AND.b #$F0 : CMP.b #$90 : BNE + ; big key of... %CopyDialog(Notice_BigKeyOf) BRA .dungeon + : LDA.l FreeItemText : AND.b #$01 : CMP.b #$01 : BNE + ; show message for dungeon small key LDA !ITEM_TEMPORARY : AND.b #$F0 : CMP.b #$A0 : BNE + ; small key of... - LDA !ITEM_TEMPORARY : CMP.b #$AF : BNE ++ : BRL .skip : ++ + LDA !ITEM_TEMPORARY : CMP.b #$AF : BNE ++ : JMP .skip : ++ %CopyDialog(Notice_SmallKeyOf) PLA : AND.b #$0F : STA $7F5020 : LDA.b #$0F : !SUB $7F5020 : PHA LDA #$01 : STA $7F5010 ; set up a flip for small keys BRA .dungeon + - BRL .skip ; it's not something we are going to give a notice for + JMP .skip ; it's not something we are going to give a notice for .dungeon LDA !OFFSET_RETURN : DEC #2 : STA !OFFSET_POINTER @@ -199,31 +199,31 @@ FreeDungeonItemNotice: + LDA $7F5011 CMP.b #$00 : BNE + ; ...light world - %CopyDialog(Notice_LightWorld) : BRL .done + %CopyDialog(Notice_LightWorld) : JMP .done + : CMP.b #$01 : BNE + ; ...dark world - %CopyDialog(Notice_DarkWorld) : BRL .done + %CopyDialog(Notice_DarkWorld) : JMP .done + : CMP.b #$02 : BNE + ; ...ganon's tower - %CopyDialog(Notice_GTower) : BRL .done + %CopyDialog(Notice_GTower) : JMP .done + : CMP.b #$03 : BNE + ; ...turtle rock - %CopyDialog(Notice_TRock) : BRL .done + %CopyDialog(Notice_TRock) : JMP .done + : CMP.b #$04 : BNE + ; ...thieves' town - %CopyDialog(Notice_Thieves) : BRL .done + %CopyDialog(Notice_Thieves) : JMP .done + : CMP.b #$05 : BNE + ; ...tower of hera - %CopyDialog(Notice_Hera) : BRL .done + %CopyDialog(Notice_Hera) : JMP .done + : CMP.b #$06 : BNE + ; ...ice palace - %CopyDialog(Notice_Ice) : BRL .done + %CopyDialog(Notice_Ice) : JMP .done + : CMP.b #$07 : BNE + ; ...skull woods - %CopyDialog(Notice_Skull) : BRL .done + %CopyDialog(Notice_Skull) : JMP .done + : CMP.b #$08 : BNE + ; ...misery mire - %CopyDialog(Notice_Mire) : BRL .done + %CopyDialog(Notice_Mire) : JMP .done + : CMP.b #$09 : BNE + ; ...dark palace - %CopyDialog(Notice_PoD) : BRL .done + %CopyDialog(Notice_PoD) : JMP .done + : CMP.b #$0A : BNE + ; ...swamp palace - %CopyDialog(Notice_Swamp) : BRL .done + %CopyDialog(Notice_Swamp) : JMP .done + : CMP.b #$0B : BNE + ; ...agahnim's tower - %CopyDialog(Notice_AgaTower) : BRL .done + %CopyDialog(Notice_AgaTower) : JMP .done + : CMP.b #$0C : BNE + ; ...desert palace - %CopyDialog(Notice_Desert) : BRL .done + %CopyDialog(Notice_Desert) : JMP .done + : CMP.b #$0D : BNE + ; ...eastern palace %CopyDialog(Notice_Eastern) : BRA .done + : CMP.b #$0E : BNE + ; ...hyrule castle @@ -424,7 +424,7 @@ Sprite_ShowMessageMinimal_Alt: INY : LDA [$00], Y : CMP.b #$6b : BNE + INY : LDA [$00], Y : CMP.b #$04 : BNE + STZ $1CE8 - BRL .end + JMP .end + STZ $0223 ; Otherwise set it so we are in text mode. diff --git a/dpadinvert.asm b/dpadinvert.asm index 130455f..e030526 100644 --- a/dpadinvert.asm +++ b/dpadinvert.asm @@ -6,7 +6,7 @@ ; Filtered Joypad 1 Register: [BYST | udlr] [AXLR | ????] !INVERT_DPAD = "$7F50CB" InvertDPad: - LDA !INVERT_DPAD : BNE + : BRL .normal : + + LDA !INVERT_DPAD : BNE + : JMP .normal : + DEC : BEQ .dpadOnly DEC : BEQ .buttonsOnly DEC : BEQ .invertBoth diff --git a/entrances.asm b/entrances.asm index 9ffd45b..2b2f171 100644 --- a/entrances.asm +++ b/entrances.asm @@ -72,7 +72,7 @@ AllowStartFromSingleEntranceCave: LDA.l StartingAreaExitOffset, X BNE + - BRL .done + JMP .done + DEC diff --git a/heartpieces.asm b/heartpieces.asm index 1009d8a..5c20ebd 100644 --- a/heartpieces.asm +++ b/heartpieces.asm @@ -24,7 +24,7 @@ HeartPieceGet: JSL.l $0791B3 ; Player_HaltDashAttackLong JSL.l Link_ReceiveItem CLC ; return false - BRL .done ; finished + JMP .done ; finished .unfinished_heart SEC ; return true @@ -54,7 +54,7 @@ DrawHeartPieceGFX: PHA : PHY LDA !REDRAW : BEQ .skipInit ; skip init if already ready JSL.l HeartPieceSpritePrep - BRL .done ; don't draw on the init frame + JMP .done ; don't draw on the init frame .skipInit LDA $0E80, X ; Retrieve stored item type @@ -177,7 +177,7 @@ LoadHeartPieceRoomValue: LDA $1B : BEQ .outdoors ; check if we're indoors or outdoors .indoors JSL.l LoadIndoorValue - BRL .done + JMP .done .outdoors JSL.l LoadOutdoorValue .done @@ -225,30 +225,30 @@ LoadIndoorValue: LDA $A0 ; these are all decimal because i got them that way CMP.w #225 : BNE + %GetPossiblyEncryptedItem(HeartPiece_Forest_Thieves, HeartPieceIndoorValues) - BRL .done + JMP .done + CMP.w #226 : BNE + %GetPossiblyEncryptedItem(HeartPiece_Lumberjack_Tree, HeartPieceIndoorValues) - BRL .done + JMP .done + CMP.w #234 : BNE + %GetPossiblyEncryptedItem(HeartPiece_Spectacle_Cave, HeartPieceIndoorValues) - BRL .done + JMP .done + CMP.w #283 : BNE + LDA $22 : XBA : AND.w #$0001 ; figure out where link is BNE ++ %GetPossiblyEncryptedItem(HeartPiece_Circle_Bushes, HeartPieceIndoorValues) - BRL .done + JMP .done ++ %GetPossiblyEncryptedItem(HeartPiece_Graveyard_Warp, HeartPieceIndoorValues) - BRL .done + JMP .done + CMP.w #294 : BNE + %GetPossiblyEncryptedItem(HeartPiece_Mire_Warp, HeartPieceIndoorValues) - BRL .done + JMP .done + CMP.w #295 : BNE + %GetPossiblyEncryptedItem(HeartPiece_Smith_Pegs, HeartPieceIndoorValues) - BRL .done + JMP .done + CMP.w #135 : BNE + LDA StandingKey_Hera - BRL .done + JMP .done + LDA.w #$0017 ; default to a normal hp .done @@ -271,47 +271,47 @@ LoadOutdoorValue: CMP.w #$03 : BNE + LDA $22 : CMP.w #1890 : !BLT ++ %GetPossiblyEncryptedItem(HeartPiece_Spectacle, HeartPieceOutdoorValues) - BRL .done + JMP .done ++ %GetPossiblyEncryptedItem(EtherItem, SpriteItemValues) - BRL .done + JMP .done + CMP.w #$05 : BNE + %GetPossiblyEncryptedItem(HeartPiece_Mountain_Warp, HeartPieceOutdoorValues) - BRL .done + JMP .done + CMP.w #$28 : BNE + %GetPossiblyEncryptedItem(HeartPiece_Maze, HeartPieceOutdoorValues) - BRL .done + JMP .done + CMP.w #$2A : BNE + %GetPossiblyEncryptedItem(HauntedGroveItem, HeartPieceOutdoorValues) - BRL .done + JMP .done + CMP.w #$30 : BNE + LDA $22 : CMP.w #512 : !BGE ++ %GetPossiblyEncryptedItem(HeartPiece_Desert, HeartPieceOutdoorValues) - BRL .done + JMP .done ++ %GetPossiblyEncryptedItem(BombosItem, SpriteItemValues) - BRL .done + JMP .done + CMP.w #$35 : BNE + %GetPossiblyEncryptedItem(HeartPiece_Lake, HeartPieceOutdoorValues) - BRL .done + JMP .done + CMP.w #$3B : BNE + %GetPossiblyEncryptedItem(HeartPiece_Swamp, HeartPieceOutdoorValues) - BRL .done + JMP .done + CMP.w #$42 : BNE + %GetPossiblyEncryptedItem(HeartPiece_Cliffside, HeartPieceOutdoorValues) - BRL .done + JMP .done + CMP.w #$4A : BNE + %GetPossiblyEncryptedItem(HeartPiece_Cliffside, HeartPieceOutdoorValues) - BRL .done + JMP .done + CMP.w #$5B : BNE + %GetPossiblyEncryptedItem(HeartPiece_Pyramid, HeartPieceOutdoorValues) - BRL .done + JMP .done + CMP.w #$68 : BNE + %GetPossiblyEncryptedItem(HeartPiece_Digging, HeartPieceOutdoorValues) - BRL .done + JMP .done + CMP.w #$81 : BNE + %GetPossiblyEncryptedItem(HeartPiece_Zora, HeartPieceOutdoorValues) - BRL .done + JMP .done + LDA.w #$0017 ; default to a normal hp .done @@ -338,34 +338,34 @@ LoadBossValue: LDA $A0 ; these are all decimal because i got them that way CMP.w #200 : BNE + %GetPossiblyEncryptedItem(HeartContainer_ArmosKnights, HeartContainerBossValues) - BRL .done + JMP .done + CMP.w #51 : BNE + %GetPossiblyEncryptedItem(HeartContainer_Lanmolas, HeartContainerBossValues) - BRL .done + JMP .done + CMP.w #7 : BNE + %GetPossiblyEncryptedItem(HeartContainer_Moldorm, HeartContainerBossValues) - BRL .done + JMP .done + CMP.w #90 : BNE + %GetPossiblyEncryptedItem(HeartContainer_HelmasaurKing, HeartContainerBossValues) - BRL .done + JMP .done + CMP.w #6 : BNE + %GetPossiblyEncryptedItem(HeartContainer_Arrghus, HeartContainerBossValues) - BRL .done + JMP .done + CMP.w #41 : BNE + %GetPossiblyEncryptedItem(HeartContainer_Mothula, HeartContainerBossValues) - BRL .done + JMP .done + CMP.w #172 : BNE + %GetPossiblyEncryptedItem(HeartContainer_Blind, HeartContainerBossValues) - BRL .done + JMP .done + CMP.w #222 : BNE + %GetPossiblyEncryptedItem(HeartContainer_Kholdstare, HeartContainerBossValues) - BRL .done + JMP .done + CMP.w #144 : BNE + %GetPossiblyEncryptedItem(HeartContainer_Vitreous, HeartContainerBossValues) - BRL .done + JMP .done + CMP.w #164 : BNE + %GetPossiblyEncryptedItem(HeartContainer_Trinexx, HeartContainerBossValues) - BRL .done + JMP .done + LDA.w #$003E ; default to a normal boss heart .done @@ -380,25 +380,25 @@ CheckIfBossRoom: REP #$20 ; set 16-bit accumulator LDA $A0 ; these are all decimal because i got them that way CMP.w #200 : BNE + - SEC : BRL .done + SEC : JMP .done + CMP.w #51 : BNE + - SEC : BRL .done + SEC : JMP .done + CMP.w #7 : BNE + - SEC : BRL .done + SEC : JMP .done + CMP.w #90 : BNE + - SEC : BRL .done + SEC : JMP .done + CMP.w #6 : BNE + - SEC : BRL .done + SEC : JMP .done + CMP.w #41 : BNE + - SEC : BRL .done + SEC : JMP .done + CMP.w #172 : BNE + - SEC : BRL .done + SEC : JMP .done + CMP.w #222 : BNE + - SEC : BRL .done + SEC : JMP .done + CMP.w #144 : BNE + - SEC : BRL .done + SEC : JMP .done + CMP.w #164 : BNE + - SEC : BRL .done + SEC : JMP .done + CLC .done diff --git a/hooks.asm b/hooks.asm index e6c37f1..f084147 100755 --- a/hooks.asm +++ b/hooks.asm @@ -1640,7 +1640,7 @@ JSL.l ShowDungeonItems : NOP #5 ;================================================================================ org $0DEA5F ; <- 6EA5F - equipment.asm:1679 - (SEP #$30) ;NOP #5 -;BRL .skipCrystalInit +;JMP .skipCrystalInit ;org $0DEAA4 ; <- 6EAA4 - equipment.asm:1706 - (LDA $7EF37A : AND.w #$0001) ;.skipCrystalInit ;================================================================================ diff --git a/inventory.asm b/inventory.asm index e8e118e..240dc78 100644 --- a/inventory.asm +++ b/inventory.asm @@ -60,7 +60,7 @@ RTL LDA !INVENTORY_SWAP : AND #$C0 : CMP #$C0 : BNE .errorJump ; make sure we have both boomerangs LDA $7EF341 : EOR #$03 : STA $7EF341 ; swap blue & red boomerang LDA.b #$20 : STA $012F ; menu select sound - BRL .captured + JMP .captured + CMP #$01 : BNE + ; bow LDA !INVENTORY_SWAP_2 : AND #$C0 : CMP #$C0 : BNE .errorJump ; make sure we have both bows PHX : LDX.b #$00 ; scan ancilla table for arrows @@ -77,7 +77,7 @@ RTL ++ LDA $7EF340 : !SUB #$01 : EOR #$02 : !ADD #$01 : STA $7EF340 ; swap bows LDA.b #$20 : STA $012F ; menu select sound - BRL .captured + JMP .captured + BRA + .errorJump BRA .errorJump2 @@ -85,7 +85,7 @@ RTL LDA !INVENTORY_SWAP : AND #$30 : CMP #$30 : BNE .errorJump ; make sure we have mushroom & magic powder LDA $7EF344 : EOR #$03 : STA $7EF344 ; swap mushroom & magic powder LDA.b #$20 : STA $012F ; menu select sound - BRL .captured + JMP .captured + BRA + .errorJump2 BRA .error @@ -203,61 +203,61 @@ AddInventory: PHA : PHX : PHP CPY.b #$0C : BNE + ; Blue Boomerang LDA !INVENTORY_SWAP : ORA #$80 : STA !INVENTORY_SWAP - BRL .incrementCounts + JMP .incrementCounts + CPY.b #$2A : BNE + ; Red Boomerang LDA !INVENTORY_SWAP : ORA #$40 : STA !INVENTORY_SWAP - BRL .incrementCounts + JMP .incrementCounts + CPY.b #$29 : BNE + ; Mushroom LDA !INVENTORY_SWAP : ORA #$28 : STA !INVENTORY_SWAP - BRL .incrementCounts + JMP .incrementCounts + CPY.b #$0D : BNE + ; Magic Powder LDA !INVENTORY_SWAP : ORA #$10 : STA !INVENTORY_SWAP - BRL .incrementCounts + JMP .incrementCounts + CPY.b #$13 : BNE + ; Shovel LDA !INVENTORY_SWAP : ORA #$04 : STA !INVENTORY_SWAP - BRL .incrementCounts + JMP .incrementCounts + CPY.b #$14 : BNE + ; Flute (Inactive) LDA !INVENTORY_SWAP : ORA #$02 : STA !INVENTORY_SWAP - BRL .incrementCounts + JMP .incrementCounts + CPY.b #$4A : BNE + ; Flute (Active) LDA !INVENTORY_SWAP : ORA #$01 : STA !INVENTORY_SWAP - BRL .incrementCounts + JMP .incrementCounts + CPY.b #$0B : BNE + ; Bow LDA ArrowMode : BNE +++ LDA !INVENTORY_SWAP_2 : ORA #$80 : STA !INVENTORY_SWAP_2 +++ - BRL .incrementCounts + JMP .incrementCounts + CPY.b #$3A : BNE + ; Bow & Arrows LDA !INVENTORY_SWAP_2 : ORA #$80 : STA !INVENTORY_SWAP_2 - BRL .incrementCounts + JMP .incrementCounts + CPY.b #$3B : BNE + ; Bow & Silver Arrows LDA !INVENTORY_SWAP_2 : ORA #$40 : STA !INVENTORY_SWAP_2 LDA ArrowMode : BNE +++ LDA !INVENTORY_SWAP_2 : ORA #$80 : STA !INVENTORY_SWAP_2 ; activate wood arrows when not in rupee bow +++ - BRL .incrementCounts + JMP .incrementCounts + CPY.b #$43 : BNE + ; Single arrow LDA ArrowMode : BEQ +++ LDA !INVENTORY_SWAP_2 : ORA #$80 : STA !INVENTORY_SWAP_2 ; activate wood arrows in quick-swap +++ - BRL .incrementCounts + JMP .incrementCounts + CPY.b #$58 : BNE + ; Upgrade-Only Silver Arrows LDA !INVENTORY_SWAP_2 : ORA #$40 : STA !INVENTORY_SWAP_2 + .incrementCounts - LDA !LOCK_STATS : BEQ + : BRL .done : + + LDA !LOCK_STATS : BEQ + : JMP .done : + ; don't count any of this stuff - CPY.b #$20 : BNE + : BRL .itemCounts : + ; Crystal - CPY.b #$26 : BNE + : BRL .itemCounts : + ; Heart Piece Completion Heart - CPY.b #$2E : BNE + : BRL .itemCounts : + ; Red Potion (Refill) - CPY.b #$2F : BNE + : BRL .itemCounts : + ; Green Potion (Refill) - CPY.b #$30 : BNE + : BRL .itemCounts : + ; Blue Potion (Refill) - CPY.b #$37 : BNE + : BRL .itemCounts : + ; Pendant - CPY.b #$38 : BNE + : BRL .itemCounts : + ; Pendant - CPY.b #$39 : BNE + : BRL .itemCounts : + ; Pendant - CPY.b #$00 : BNE + : BRL .itemCounts : + ; Uncle Sword & Shield + CPY.b #$20 : BNE + : JMP .itemCounts : + ; Crystal + CPY.b #$26 : BNE + : JMP .itemCounts : + ; Heart Piece Completion Heart + CPY.b #$2E : BNE + : JMP .itemCounts : + ; Red Potion (Refill) + CPY.b #$2F : BNE + : JMP .itemCounts : + ; Green Potion (Refill) + CPY.b #$30 : BNE + : JMP .itemCounts : + ; Blue Potion (Refill) + CPY.b #$37 : BNE + : JMP .itemCounts : + ; Pendant + CPY.b #$38 : BNE + : JMP .itemCounts : + ; Pendant + CPY.b #$39 : BNE + : JMP .itemCounts : + ; Pendant + CPY.b #$00 : BNE + : JMP .itemCounts : + ; Uncle Sword & Shield CPY.b #$04 : !BLT .isSword ; Swords - Skip Shop/Fairy Check for Swords CPY.b #$49 : BEQ .isSword @@ -265,32 +265,32 @@ AddInventory: CPY.b #$5E : BEQ .isSword BRA + .isSword - BRL .dungeonCounts + JMP .dungeonCounts + - CPY.b #$3B : BNE + : BRL .dungeonCounts : + ; Silver Arrow Bow - Skip Shop/Fairy Check for Silver Arrow Bow + CPY.b #$3B : BNE + : JMP .dungeonCounts : + ; Silver Arrow Bow - Skip Shop/Fairy Check for Silver Arrow Bow LDA $1B : BEQ ++ ; skip shop check if outdoors LDA $02E9 : CMP.b #$01 : BEQ ++ ; skip shop check for chests PHP : REP #$20 ; set 16-bit accumulator LDA $048E - CMP.w #274 : BNE + : BRL .shop : + ; dark world death mountain shop, ornamental shield shop - CMP.w #271 : BNE + : BRL .shop : + ; villiage of outcasts shop, lumberjack shop, lake hylia shop, dark world magic shop - CMP.w #272 : BNE + : BRL .shop : + ; red shield shop - CMP.w #284 : BNE + : BRL .shop : + ; bomb shop - ;CMP.w #265 : BNE + : BRL .shop : + ; potion shop - commented this out because it's easier to just block potion refills because this one interferes with the powder item being counted - ;CMP.w #271 : BNE + : BRL .shop : + ; lake hylia shop - CMP.w #287 : BNE + : BRL .shop : + ; kakariko shop - CMP.w #255 : BNE + : BRL .shop : + ; light world death mountain shop - CMP.w #276 : BNE + : BRL .shop : + ; waterfall fairy - CMP.w #277 : BNE + : BRL .shop : + ; upgrade fairy (shop) - CMP.w #278 : BNE + : BRL .shop : + ; pyramid fairy + CMP.w #274 : BNE + : JMP .shop : + ; dark world death mountain shop, ornamental shield shop + CMP.w #271 : BNE + : JMP .shop : + ; villiage of outcasts shop, lumberjack shop, lake hylia shop, dark world magic shop + CMP.w #272 : BNE + : JMP .shop : + ; red shield shop + CMP.w #284 : BNE + : JMP .shop : + ; bomb shop + ;CMP.w #265 : BNE + : JMP .shop : + ; potion shop - commented this out because it's easier to just block potion refills because this one interferes with the powder item being counted + ;CMP.w #271 : BNE + : JMP .shop : + ; lake hylia shop + CMP.w #287 : BNE + : JMP .shop : + ; kakariko shop + CMP.w #255 : BNE + : JMP .shop : + ; light world death mountain shop + CMP.w #276 : BNE + : JMP .shop : + ; waterfall fairy + CMP.w #277 : BNE + : JMP .shop : + ; upgrade fairy (shop) + CMP.w #278 : BNE + : JMP .shop : + ; pyramid fairy PLP : BRA ++ .shop - PLP : BRL .done + PLP : JMP .done ++ .dungeonCounts - LDA $1B : BNE + : BRL .fullItemCounts : + + LDA $1B : BNE + : JMP .fullItemCounts : + ; ==BEGIN INDOOR-ONLY SECTION ;REP #$20 ; Set 16-bit Accumulator @@ -307,54 +307,54 @@ AddInventory: BRA ++ + CMP.b #$02 : BNE + ; Hyrule Castle (Escape) ++ - CPY.b #$32 : BNE ++ : BRL .itemCounts : ++ ; Ball & Chain Guard's Big Key + CPY.b #$32 : BNE ++ : JMP .itemCounts : ++ ; Ball & Chain Guard's Big Key %TopHalf($7EF434) - BRL .fullItemCounts + JMP .fullItemCounts + CMP.b #$04 : BNE + ; Eastern Palace LDA $7EF436 : INC : AND #$07 : TAX LDA $7EF436 : AND #$F8 : STA $7EF436 TXA : ORA $7EF436 : STA $7EF436 - BRL .fullItemCounts + JMP .fullItemCounts + CMP.b #$06 : BNE + ; Desert Palace LDA $7EF435 : !ADD #$20 : STA $7EF435 - BRL .fullItemCounts + JMP .fullItemCounts + CMP.b #$08 : BNE + ; Agahnim's Tower LDA $7EF435 : INC : AND #$03 : TAX LDA $7EF435 : AND #$FC : STA $7EF435 TXA : ORA $7EF435 : STA $7EF435 - BRL .fullItemCounts + JMP .fullItemCounts + CMP.b #$0A : BNE + ; Swamp Palace %BottomHalf($7EF439) - BRL .fullItemCounts + JMP .fullItemCounts + CMP.b #$0C : BNE + ; Palace of Darkness %BottomHalf($7EF434) - BRL .fullItemCounts + JMP .fullItemCounts + CMP.b #$0E : BNE + ; Misery Mire %BottomHalf($7EF438) - BRL .fullItemCounts + JMP .fullItemCounts + CMP.b #$10 : BNE + ; Skull Woods %TopHalf($7EF437) - BRL .fullItemCounts + JMP .fullItemCounts + CMP.b #$12 : BNE + ; Ice Palace %TopHalf($7EF438) - BRL .fullItemCounts + JMP .fullItemCounts + CMP.b #$14 : BNE + ; Tower of Hera LDA $7EF435 : !ADD #$04 : AND #$1C : TAX LDA $7EF435 : AND #$E3 : STA $7EF435 TXA : ORA $7EF435 : STA $7EF435 - BRL .fullItemCounts + JMP .fullItemCounts + CMP.b #$16 : BNE + ; Thieves' Town %BottomHalf($7EF437) - BRL .fullItemCounts + JMP .fullItemCounts + CMP.b #$18 : BNE + ; Turtle Rock %TopHalf($7EF439) - BRL .fullItemCounts + JMP .fullItemCounts + CMP.b #$1A : BNE + ; Ganon's Tower LDA $7EF436 : !ADD #$08 : STA $7EF436 LDA $7EF366 : AND #$04 : BNE ++ JSR .incrementGTowerPreBigKey ++ - ;BRL .fullItemCounts + ;JMP .fullItemCounts + ; == END INDOOR-ONLY SECTION @@ -379,178 +379,178 @@ AddInventory: CPY.b #$00 : BNE + ; Fighter's Sword & Fighter's Shield JSR .incrementSword JSR .incrementShield - BRL .done + JMP .done + CPY.b #$01 : BNE + ; Master Sword JSR .incrementSword - BRL .done + JMP .done + CPY.b #$02 : BNE + ; Tempered Sword JSR .incrementSword - BRL .done + JMP .done + CPY.b #$03 : BNE + ; Golden Sword JSR .incrementSword - BRL .done + JMP .done + CPY.b #$04 : BNE + ; Fighter's Shield JSR .incrementShield - BRL .done + JMP .done + CPY.b #$05 : BNE + ; Red Shield JSR .incrementShield - BRL .done + JMP .done + CPY.b #$06 : BNE + ; Mirror Shield JSR .incrementShield - BRL .done + JMP .done + CPY.b #$07 : !BLT + ; Items $07 - $0D CPY.b #$0E : !BGE + JSR .incrementY - BRL .done + JMP .done + CPY.b #$14 : BNE + ; Flute (Inactive) - LEAVE THIS ABOVE THE 0F-16 CONDITION - kkat JSR .stampFlute JSR .incrementY - BRL .done + JMP .done + CPY.b #$0F : !BLT + ; Items $0F - $16 CPY.b #$17 : !BGE + JSR .incrementY - BRL .done + JMP .done + CPY.b #$17 : BNE + ; Heart Piece JSR .incrementHeartPiece - BRL .done + JMP .done + CPY.b #$18 : !BLT + ; Items $18 - $19 CPY.b #$1A : !BGE + JSR .incrementY - BRL .done + JMP .done + CPY.b #$1A : BNE + ; Magic Mirror JSR .stampMirror JSR .incrementY - BRL .done + JMP .done + CPY.b #$1D : BNE + ; Book of Mudora - LEAVE THIS ABOVE THE 1B-1F CONDITION - kkat JSR .incrementY - BRL .done + JMP .done + CPY.b #$1B : !BLT + ; Items $1B - $1F CPY.b #$20 : !BGE + JSR .incrementA - BRL .done + JMP .done + CPY.b #$20 : BNE + ; Crystal JSR .incrementCrystal - BRL .done + JMP .done + CPY.b #$21 : BNE + ; Bug Net JSR .incrementY - BRL .done + JMP .done + CPY.b #$22 : !BLT + ; Items $22 - $23 CPY.b #$24 : !BGE + JSR .incrementMail - BRL .done + JMP .done + CPY.b #$24 : BNE + ; Small Key JSR .incrementKey - BRL .done + JMP .done + CPY.b #$25 : BNE + ; Compass JSR .incrementCompass - BRL .done + JMP .done + CPY.b #$26 : BNE + ; Liar Heart (Container) ;JSR .incrementHeartContainer - BRL .done + JMP .done + CPY.b #$27 : BNE + ; 1 Bomb JSR .maybeIncrementBombs - BRL .done + JMP .done + CPY.b #$28 : BNE + ; 3 Bombs JSR .maybeIncrementBombs - BRL .done + JMP .done + CPY.b #$29 : BNE + ; Musoroom JSR .incrementY - BRL .done + JMP .done + CPY.b #$2A : !BLT + ; Items $2A - $2D CPY.b #$2E : !BGE + JSR .incrementY - BRL .done + JMP .done + CPY.b #$31 : BNE + ; 10 Bombs JSR .maybeIncrementBombs - BRL .done + JMP .done + CPY.b #$32 : BNE + ; Big Key JSR .incrementBigKey - BRL .done + JMP .done + CPY.b #$33 : BNE + ; Map JSR .incrementMap - BRL .done + JMP .done + CPY.b #$37 : !BLT + ; Items $37 - $39 - Pendants CPY.b #$3A : !BGE + JSR .incrementPendant - BRL .done + JMP .done + CPY.b #$3A : !BLT + ; Items $3A - $3B - Bow & Silver Arrows CPY.b #$3C : !BGE + JSR .incrementBow - BRL .done + JMP .done + CPY.b #$3C : BNE + ; Bottle w/Bee JSR .incrementY - BRL .done + JMP .done + CPY.b #$3D : BNE + ; Bottle w/Fairy JSR .incrementY - BRL .done + JMP .done + CPY.b #$3E : !BLT + ; Items $3E - $3F - Heart Containers CPY.b #$40 : !BGE + JSR .incrementHeartContainer - BRL .done + JMP .done + CPY.b #$48 : BNE + ; Bottle w/Gold Bee JSR .incrementY - BRL .done + JMP .done + CPY.b #$49 : BNE + ; Fighter's Sword JSR .incrementSword - BRL .done + JMP .done + CPY.b #$4A : BNE + ; Flute (Active) JSR .stampFlute JSR .incrementY - BRL .done + JMP .done + CPY.b #$4B : BNE + ; Pegasus Boots JSR .stampBoots JSR .incrementA - BRL .done + JMP .done + CPY.b #$4C : BNE + ; Bomb Capacity Upgrade JSR .incrementCapacity JSR .maybeIncrementBombs - BRL .done + JMP .done + CPY.b #$4D : !BLT + ; Items $4D - $4F - Capacity Upgrades CPY.b #$50 : !BGE + JSR .incrementCapacity - BRL .done + JMP .done + CPY.b #$50 : BNE + ; Master Sword (Safe) JSR .incrementSword - BRL .done + JMP .done + CPY.b #$51 : !BLT + ; Items $51 - $54 - Capacity Upgrades CPY.b #$55 : !BGE + JSR .incrementCapacity - BRL .done + JMP .done + CPY.b #$58 : BNE + ; Upgrade-Only Sivler Arrows JSR .incrementBow - BRL .done + JMP .done + CPY.b #$5E : BNE + ; Progressive Sword JSR .incrementSword - BRL .done + JMP .done + CPY.b #$5F : BNE + ; Progressive Shield JSR .incrementShield - BRL .done + JMP .done + CPY.b #$60 : BNE + ; Progressive Armor JSR .incrementMail - BRL .done + JMP .done + CPY.b #$61 : BNE + ; Progressive Lifting Glove JSR .incrementA - BRL .done + JMP .done + CPY.b #$64 : !BLT + ; Items $64 & $65 - Progressive Bow CPY.b #$66 : !BGE + JSR .incrementBow - BRL .done + JMP .done + CPY.b #$70 : !BLT + ; Items $70 - $7F - Free Maps CPY.b #$80 : !BGE + JSR .incrementMap - BRL .done + JMP .done + CPY.b #$80 : !BLT + ; Items $80 - $8F - Free Compasses CPY.b #$90 : !BGE + JSR .incrementCompass - BRL .done + JMP .done + CPY.b #$90 : !BLT + ; Items $90 - $9F - Free Big Keys CPY.b #$A0 : !BGE + JSR .incrementBigKey - BRL .done + JMP .done + CPY.b #$A0 : !BLT + ; Items $A0 - $AF - Free Small Keys CPY.b #$B0 : !BGE + JSR .incrementKey - BRL .done + JMP .done + .done PLP : PLX : PLA @@ -1113,10 +1113,10 @@ SpawnShovelItem: LDA $03FC : BEQ + JSL DiggingGameGuy_AttemptPrizeSpawn - BRL .skip + JMP .skip + - LDA $035B : AND.b #$01 : BNE + : BRL .skip : + ; corner dig fix + LDA $035B : AND.b #$01 : BNE + : JMP .skip : + ; corner dig fix PHY : PHP PHB : PHK : PLB diff --git a/inverted.asm b/inverted.asm index 1e05ee1..b60085d 100644 --- a/inverted.asm +++ b/inverted.asm @@ -4,7 +4,7 @@ ; after Ganon slams into it in bat form? Overworld_CreatePyramidHoleModified: LDA.l InvertedMode : BNE + - BRL .originalBehaviour + JMP .originalBehaviour + .invertedBehavior REP #$30 @@ -37,7 +37,7 @@ Overworld_CreatePyramidHoleModified: LDA.w #$FFFF : STA $1012, Y - BRL .ending + JMP .ending .originalBehaviour REP #$30 diff --git a/itemdowngrade.asm b/itemdowngrade.asm index aab1763..9d08af2 100644 --- a/itemdowngrade.asm +++ b/itemdowngrade.asm @@ -66,8 +66,8 @@ RTS INC : CMP !HIGHEST_SWORD_LEVEL : !BGE + ; skip if highest is lower (this is an upgrade) LDA !HIGHEST_SWORD_LEVEL : DEC ; convert to item id TAY : PLA : LDA !HIGHEST_SWORD_LEVEL ; put sword id into the thing to write - BRL .done + JMP .done + PLA -BRL .done +JMP .done ;================================================================================ \ No newline at end of file diff --git a/msu.asm b/msu.asm index 4af1caf..3118f01 100644 --- a/msu.asm +++ b/msu.asm @@ -185,11 +185,11 @@ CheckMusicLoadRequest: LDA !REG_MUSIC_CONTROL_REQUEST : CMP #$08 : BEQ ++ ; Mirror SFX is not affected by NoBGM or pack $FE LDA NoBGM : BNE + LDA !REG_MSU_PACK_CURRENT : CMP #$FE : BNE ++ - + : BRL .mute + + : JMP .mute ++ LDX !REG_MSU_ID_01 : CPX !VAL_MSU_ID_01 : BEQ + - - : BRL .unmute + - : JMP .unmute + LDX !REG_MSU_ID_23 : CPX !VAL_MSU_ID_23 : BNE - LDX !REG_MSU_ID_45 : CPX !VAL_MSU_ID_45 : BNE - @@ -277,7 +277,7 @@ CheckMusicLoadRequest: PLY : STY $00 : SEP #$10 : PLB TAX : LDA MusicShuffleTable-1,X STA !REG_MUSIC_CONTROL_REQUEST - BRL .check_fallback + JMP .check_fallback .unmute LDA.b !VAL_COMMAND_UNMUTE_SPC @@ -481,7 +481,7 @@ MSUMain: LDA !REG_MSU_ID_45 : CMP !VAL_MSU_ID_45 : BNE .nomsu SEP #$30 LDX !REG_MUSIC_CONTROL : BEQ + - BRL .command_ff + JMP .command_ff + LDA !REG_MSU_DELAYED_COMMAND : BEQ .do_fade diff --git a/newhud.asm b/newhud.asm index e4aef54..f41ed75 100644 --- a/newhud.asm +++ b/newhud.asm @@ -63,7 +63,7 @@ SEP #$30 ;================================================================================ SEP #$20 - LDA.l GoalItemRequirement : BNE + : BRL .done : + ; Star Meter + LDA.l GoalItemRequirement : BNE + : JMP .done : + ; Star Meter LDA.l !GOAL_COUNTER JSR HudHexToDec3Digit @@ -144,13 +144,13 @@ SEP #$30 AND #$FFF8 TAX ; end of crap - LDA !INFINITE_MAGIC : AND.w #$00FF : BNE + : BRL .green : + + LDA !INFINITE_MAGIC : AND.w #$00FF : BNE + : JMP .green : + SEP #$20 : LDA.b #$80 : STA $7EF36E : REP #$30 ; set magic to max LDX.w #$0080 ; load full magic meter graphics LDA $1A : AND.w #$000C : LSR #2 BEQ .red CMP.w #0001 : BEQ .yellow - CMP.w #0002 : BNE + : BRL .green : + + CMP.w #0002 : BNE + : JMP .green : + .blue LDA !DrawMagicMeter_mp_tilemap+0, X : AND.w #$EFFF : STA $7EC746 LDA !DrawMagicMeter_mp_tilemap+2, X : AND.w #$EFFF : STA $7EC786 diff --git a/newitems.asm b/newitems.asm index 3ccc496..cc8ded7 100755 --- a/newitems.asm +++ b/newitems.asm @@ -195,7 +195,7 @@ AddReceivedItemExpandedGetItem: ; ;JSL.l Main_ShowTextMessage_Alt ; LDA !GOAL_COUNTER : INC : STA !GOAL_COUNTER ; LDA.b #$01 : STA $7F50XX - ; BRL .done + ; JMP .done ;++ ;STA $FFFFFF LDA $02D8 ; check inventory @@ -205,7 +205,7 @@ AddReceivedItemExpandedGetItem: LDA.l SilverArrowsUseRestriction : BNE ++ LDA.b #03 : STA $7EF340 ; set bow to silver ++ - BRL .done + JMP .done + CMP.b #$3B : BNE + ; Silver Bow LDA.l SilverArrowsUseRestriction : BNE .noequip LDA.l SilverArrowsAutoEquip : AND.b #$01 : BEQ .noequip @@ -217,56 +217,56 @@ AddReceivedItemExpandedGetItem: STA $7EF340 .noequip LDA !INVENTORY_SWAP_2 : ORA #$40 : STA !INVENTORY_SWAP_2 ; mark silver bow on y-toggle - BRL .done + JMP .done + CMP.b #$4C : BNE + ; 50 bombs ;LDA.b #$07 : STA $7EF370 ; upgrade bombs LDA.b #50 : !SUB.l StartingMaxBombs : STA $7EF370 ; upgrade bombs LDA.b #50 : STA $7EF375 ; fill bombs - BRL .done + JMP .done + CMP.b #$4D : BNE + ; 70 arrows ;LDA #$07 : STA $7EF371 ; upgrade arrows LDA.b #70 : !SUB.l StartingMaxArrows : STA $7EF371 ; upgrade arrows LDA.b #70 : STA $7EF376 ; fill arrows - BRL .done + JMP .done + CMP.b #$4E : BNE + ; 1/2 magic LDA $7EF37B : CMP #$02 : !BGE ++ INC : STA $7EF37B ; upgrade magic ++ LDA.b #$80 : STA $7EF373 ; fill magic - BRL .done + JMP .done + CMP.b #$4F : BNE + ; 1/4 magic LDA.b #$02 : STA $7EF37B ; upgrade magic LDA.b #$80 : STA $7EF373 ; fill magic - BRL .done + JMP .done + CMP.b #$50 : BNE + ; Master Sword (Safe) LDA $7EF359 : CMP.b #$02 : !BGE + ; skip if we have a better sword LDA.b #$02 : STA $7EF359 ; set master sword - BRL .done + JMP .done + CMP.b #$51 : BNE + ; +5 Bombs LDA $7EF370 : !ADD.b #$05 : STA $7EF370 ; upgrade bombs +5 LDA.l Upgrade5BombsRefill : STA $7EF375 ; fill bombs - BRL .done + JMP .done + CMP.b #$52 : BNE + ; +10 Bombs LDA $7EF370 : !ADD.b #$0A : STA $7EF370 ; upgrade bombs +10 LDA.l Upgrade10BombsRefill : STA $7EF375 ; fill bombs - BRL .done + JMP .done + CMP.b #$53 : BNE + ; +5 Arrows LDA $7EF371 : !ADD.b #$05 : STA $7EF371 ; upgrade arrows +5 LDA.l Upgrade5ArrowsRefill : STA $7EF376 ; fill arrows - BRL .done + JMP .done + CMP.b #$54 : BNE + ; +10 Arrows LDA $7EF371 : !ADD.b #$0A : STA $7EF371 ; upgrade arrows +10 LDA.l Upgrade10ArrowsRefill : STA $7EF376 ; fill arrows - BRL .done + JMP .done + CMP.b #$55 : BNE + ; Programmable Object 1 %ProgrammableItemLogic(1) - BRL .done + JMP .done + CMP.b #$56 : BNE + ; Programmable Object 2 %ProgrammableItemLogic(2) - BRL .done + JMP .done + CMP.b #$57 : BNE + ; Programmable Object 3 %ProgrammableItemLogic(3) - BRL .done + JMP .done + CMP.b #$58 : BNE + ; Upgrade-Only Sivler Arrows LDA.l SilverArrowsUseRestriction : BNE +++ LDA.l SilverArrowsAutoEquip : AND.b #$01 : BEQ +++ @@ -279,46 +279,46 @@ AddReceivedItemExpandedGetItem: ++ + CMP.b #$59 : BNE + ; 1 Rupoor REP #$20 : LDA $7EF360 : !SUB RupoorDeduction : STA $7EF360 : SEP #$20 ; Take 1 rupee - BRL .done + JMP .done + CMP.b #$5A : BNE + ; Null Item - BRL .done + JMP .done + CMP.b #$5B : BNE + ; Red Clock REP #$20 ; set 16-bit accumulator LDA !CHALLENGE_TIMER : !ADD.l RedClockAmount : STA !CHALLENGE_TIMER LDA !CHALLENGE_TIMER+2 : ADC.l RedClockAmount+2 : STA !CHALLENGE_TIMER+2 SEP #$20 ; set 8-bit accumulator - BRL .done + JMP .done + CMP.b #$5C : BNE + ; Blue Clock REP #$20 ; set 16-bit accumulator LDA !CHALLENGE_TIMER : !ADD.l BlueClockAmount : STA !CHALLENGE_TIMER LDA !CHALLENGE_TIMER+2 : ADC.l BlueClockAmount+2 : STA !CHALLENGE_TIMER+2 SEP #$20 ; set 8-bit accumulator - BRL .done + JMP .done + CMP.b #$5D : BNE + ; Green Clock REP #$20 ; set 16-bit accumulator LDA !CHALLENGE_TIMER : !ADD.l GreenClockAmount : STA !CHALLENGE_TIMER LDA !CHALLENGE_TIMER+2 : ADC.l GreenClockAmount+2 : STA !CHALLENGE_TIMER+2 SEP #$20 ; set 8-bit accumulator - BRL .done + JMP .done + CMP.b #$5E : BNE + ; Progressive Sword - BRL .done + JMP .done + CMP.b #$5F : BNE + ; Progressive Shield - BRL .done + JMP .done + CMP.b #$60 : BNE + ; Progressive Armor - BRL .done + JMP .done + CMP.b #$61 : BNE + ; Progressive Lifting Glove - BRL .done + JMP .done + CMP.b #$62 : BNE + ; RNG Pool Item (Single) - BRL .done + JMP .done + CMP.b #$63 : BNE + ; RNG Pool Item (Multi) - BRL .done + JMP .done + CMP.b #$64 : BNE + ; Progressive Bow - BRL .done + JMP .done + CMP.b #$65 : BNE + ; Progressive Bow - BRL .done + JMP .done + CMP.b #$6A : BNE + ; Goal Collectable (Single/Triforce) JSL.l ActivateGoal - BRL .done + JMP .done + CMP.b #$6B : BNE + ; Goal Collectable (Multi/Power Star) BRA .multi_collect + CMP.b #$6C : BNE + ; Goal Collectable (Multi/Power Star) Alternate Graphic @@ -329,52 +329,52 @@ AddReceivedItemExpandedGetItem: LDA TurnInGoalItems : BNE ++ JSL.l ActivateGoal ++ - BRL .done + JMP .done + CMP.b #$6D : BNE + ; Server Request F0 JSL.l ItemGetServiceRequest_F0 - BRL .done + JMP .done + CMP.b #$6E : BNE + ; Server Request F1 JSL.l ItemGetServiceRequest_F1 - BRL .done + JMP .done + CMP.b #$6F : BNE + ; Server Request F2 JSL.l ItemGetServiceRequest_F2 - BRL .done + JMP .done ;+ CMP.b #$FE : BNE + ; Server Request (Null Chest) ; JSL.l ItemGetServiceRequest - ; BRL .done + ; JMP .done + CMP.b #$70 : !BLT + : CMP.b #$80 : !BGE + ; Free Map AND #$0F : CMP #$08 : !BGE ++ %ValueShift() ORA $7EF368 : STA $7EF368 ; Map 1 - BRL .done + JMP .done ++ !SUB #$08 %ValueShift() BIT.b #$C0 : BEQ +++ : LDA.b #$C0 : +++ ; Make Hyrule Castle / Sewers Count for Both ORA $7EF369 : STA $7EF369 ; Map 2 - BRL .done + JMP .done + CMP.b #$80 : !BLT + : CMP.b #$90 : !BGE + ; Free Compass AND #$0F : CMP #$08 : !BGE ++ %ValueShift() ORA $7EF364 : STA $7EF364 ; Compass 1 - BRL .done + JMP .done ++ !SUB #$08 %ValueShift() BIT.b #$C0 : BEQ +++ : LDA.b #$C0 : +++ ; Make Hyrule Castle / Sewers Count for Both ORA $7EF365 : STA $7EF365 ; Compass 2 - BRL .done + JMP .done + CMP.b #$90 : !BLT + : CMP.b #$A0 : !BGE + ; Free Big Key AND #$0F : CMP #$08 : !BGE ++ %ValueShift() ORA $7EF366 : STA $7EF366 ; Big Key 1 - BRL .done + JMP .done ++ !SUB #$08 %ValueShift() BIT.b #$C0 : BEQ +++ : LDA.b #$C0 : +++ ; Make Hyrule Castle / Sewers Count for Both ORA $7EF367 : STA $7EF367 ; Big Key 2 - BRL .done + JMP .done + CMP.b #$A0 : !BLT + : CMP.b #$B0 : !BGE + ; Free Small Key AND #$0F : TAX LDA $7EF37C, X : INC : STA $7EF37C, X ; Increment Key Count @@ -388,12 +388,12 @@ AddReceivedItemExpandedGetItem: LDA.l GenericKeys : BEQ + .generic LDA $7EF36F : INC : STA $7EF36F - BRL .done + JMP .done .normal TXA : ASL : CMP $040C : BNE ++ LDA $7EF36F : INC : STA $7EF36F ++ - BRL .done + JMP .done + .done PLX @@ -432,66 +432,66 @@ AddReceivedItemExpanded: CMP.b #$16 : BNE ++ ; Bottle JSR.w CountBottles : CMP.l BottleLimit : !BLT +++ LDA.l BottleLimitReplacement : STA $02D8 - +++ : BRL .done + +++ : JMP .done ++ : CMP.b #$2B : BNE ++ ; Red Potion w/bottle JSR.w CountBottles : CMP.l BottleLimit : !BLT +++ LDA.l BottleLimitReplacement : STA $02D8 - +++ : BRL .done + +++ : JMP .done ++ : CMP.b #$2C : BNE ++ ; Green Potion w/bottle JSR.w CountBottles : CMP.l BottleLimit : !BLT +++ LDA.l BottleLimitReplacement : STA $02D8 - +++ : BRL .done + +++ : JMP .done ++ : CMP.b #$2D : BNE ++ ; Blue Potion w/bottle JSR.w CountBottles : CMP.l BottleLimit : !BLT +++ LDA.l BottleLimitReplacement : STA $02D8 - +++ : BRL .done + +++ : JMP .done ++ : CMP.b #$3C : BNE ++ ; Bee w/bottle JSR.w CountBottles : CMP.l BottleLimit : !BLT +++ LDA.l BottleLimitReplacement : STA $02D8 - +++ : BRL .done + +++ : JMP .done ++ : CMP.b #$3D : BNE ++ ; Fairy w/bottle JSR.w CountBottles : CMP.l BottleLimit : !BLT +++ LDA.l BottleLimitReplacement : STA $02D8 - +++ : BRL .done + +++ : JMP .done ++ : CMP.b #$48 : BNE ++ ; Gold Bee w/bottle JSR.w CountBottles : CMP.l BottleLimit : !BLT +++ LDA.l BottleLimitReplacement : STA $02D8 - +++ : BRL .done + +++ : JMP .done ++ : CMP.b #$4E : BNE ++ ; Progressive Magic LDA $7EF37B : BEQ +++ LDA.b #$4F : STA $02D8 - +++ : BRL .done + +++ : JMP .done ++ : CMP.b #$5E : BNE ++ ; Progressive Sword LDA $7EF359 : CMP.l ProgressiveSwordLimit : !BLT + - LDA.l ProgressiveSwordReplacement : STA $02D8 : BRL .done + LDA.l ProgressiveSwordReplacement : STA $02D8 : JMP .done + : CMP.b #$00 : BNE + ; No Sword - LDA.b #$49 : STA $02D8 : BRL .done + LDA.b #$49 : STA $02D8 : JMP .done + : CMP.b #$01 : BNE + ; Fighter Sword - LDA.b #$50 : STA $02D8 : BRL .done + LDA.b #$50 : STA $02D8 : JMP .done + : CMP.b #$02 : BNE + ; Master Sword - LDA.b #$02 : STA $02D8 : BRL .done + LDA.b #$02 : STA $02D8 : JMP .done + ; Everything Else - LDA.b #$03 : STA $02D8 : BRL .done + LDA.b #$03 : STA $02D8 : JMP .done ++ : CMP.b #$5F : BNE ++ ; Progressive Shield LDA !PROGRESSIVE_SHIELD : LSR #6 : CMP.l ProgressiveShieldLimit : !BLT + - LDA.l ProgressiveShieldReplacement : STA $02D8 : BRL .done + LDA.l ProgressiveShieldReplacement : STA $02D8 : JMP .done + LDA !PROGRESSIVE_SHIELD : AND.b #$C0 : BNE + ; No Shield LDA.b #$04 : STA $02D8 - LDA !PROGRESSIVE_SHIELD : !ADD.b #$40 : STA !PROGRESSIVE_SHIELD : BRL .done + LDA !PROGRESSIVE_SHIELD : !ADD.b #$40 : STA !PROGRESSIVE_SHIELD : JMP .done + : CMP.b #$40 : BNE + ; Fighter Shield LDA.b #$05 : STA $02D8 - LDA !PROGRESSIVE_SHIELD : !ADD.b #$40 : STA !PROGRESSIVE_SHIELD : BRL .done + LDA !PROGRESSIVE_SHIELD : !ADD.b #$40 : STA !PROGRESSIVE_SHIELD : JMP .done + ; Everything Else LDA.b #$06 : STA $02D8 - LDA !PROGRESSIVE_SHIELD : !ADD.b #$40 : STA !PROGRESSIVE_SHIELD : BRL .done + LDA !PROGRESSIVE_SHIELD : !ADD.b #$40 : STA !PROGRESSIVE_SHIELD : JMP .done ++ : CMP.b #$60 : BNE ++ ; Progressive Armor LDA $7EF35B : CMP.l ProgressiveArmorLimit : !BLT + - LDA.l ProgressiveArmorReplacement : STA $02D8 : BRL .done + LDA.l ProgressiveArmorReplacement : STA $02D8 : JMP .done + : CMP.b #$00 : BNE + ; No Armor - LDA.b #$22 : STA $02D8 : BRL .done + LDA.b #$22 : STA $02D8 : JMP .done + ; Everything Else - LDA.b #$23 : STA $02D8 : BRL .done + LDA.b #$23 : STA $02D8 : JMP .done ++ : CMP.b #$61 : BNE ++ ; Progressive Lifting Glove LDA $7EF354 : BNE + ; No Lift LDA.b #$1B : STA $02D8 : BRA .done @@ -499,7 +499,7 @@ AddReceivedItemExpanded: LDA.b #$1C : STA $02D8 : BRA .done ++ : CMP.b #$64 : BNE ++ : -- ; Progressive Bow LDA $7EF340 : INC : LSR : CMP.l ProgressiveBowLimit : !BLT + - LDA.l ProgressiveBowReplacement : STA $02D8 : BRL .done + LDA.l ProgressiveBowReplacement : STA $02D8 : JMP .done + : CMP.b #$00 : BNE + ; No Bow LDA.b #$3A : STA $02D8 : BRA .done + ; Any Bow diff --git a/newitems2.asm b/newitems2.asm new file mode 100644 index 0000000..4bfaa77 --- /dev/null +++ b/newitems2.asm @@ -0,0 +1,825 @@ +;=============================================================================== +; Complete fucking revamp of how item get works +;=============================================================================== + +Ancilla_ReceiveItem_rupee_anim_tiles: + db $24, $25, $26 + +Ancilla_ReceiveItem_rupee_anim_timers: + db 9, 5, 5 + +Ancilla_ReceiveItem_oam_props: + db $05, $01, $04 + +Ancilla_ReceiveItem_hp_messages: + dw -1, $0155, $0156, $0157 + + + + + + +AddReceiveItem: + + + + + + + +.routine + fillword $0000 : fill $FF*2 + +.y_offsets + fillbyte $00 : fill $FF + +.x_offsets + fillbyte $00 : fill $FF + +.gfx_offsets + fillword $0000 : fill $FF*2 + +.wideness + fillbyte $00 : fill $FF + +.pal + fillbyte $00 : fill $FF + +.sram_addr + fillword $0000 : fill $FF*2 + +.sram_write + fillbyte $00 : fill $FF + +.message + fillbyte $00 : fill $FF + +.sound + fillbyte $00 : fill $FF + +; Pal defines: +!r = 1 ; red +!b = 2 ; blue +!g = 4 ; green +!e = 5 ; sword/shield + +!t = $00 ; not wide +!w = $80 ; wide + +; song storage +; top 2 bits = which address to write +; 00 $00 Song +; 01 $40 SFX1 +; 10 $80 SFX2 +; 11 $C0 SFX3 +; bottom 6 bits = data to write + +!sfxsong = $00<<6 +!sfx1 = $01<<6 +!sfx2 = $02<<6 +!sfx3 = $03<<6 + +!dodododo = $0F|!sfx3 +!badgesong = $13|!sfxsong +!hpsfx = $2D|!sfx3 +!hcsfx = $0D|!sfx3 + +!itemx = -1 +macro ritem(name, routine, y_off, x_off, gfx_off, oam_props, sram_addr, sram_write, message, sfx) + !itemx #= !itemx+1 + !get_ #= !itemx + + #g: + pushpc + ; routine points to either a general handler + ; or a specific routine for this item or class of items + org AddReceiveItem_routine+!itemx*2 : dw + + ; gfx dictates an offset into uncompressed 4bpp graphics data + org AddReceiveItem_gfx_offsets+!itemx*2 : dw + + + ;org AddReceiveItem_routine+!itemx*2 : dw + ;org AddReceiveItem_y_offsets+!itemx : db + ;org AddReceiveItem_x_offsets+!itemx : db + ;org AddReceiveItem_gfx_offsets+!itemx*2 : dw + ;org AddReceiveItem_wideness+!itemx : db + ;org AddReceiveItem_pal+!itemx : db

+ + ; SRAM address is an + org AddReceiveItem_sram_addr+!itemx*2 : dw + org AddReceiveItem_sram_write+!itemx : db + ;org AddReceiveItem_message+!itemx : db + ;org AddReceiveItem_sound+!itemx : db + pullpc +endmacro + +;=============================================================================== +; Vanilla Items +%ritem("fighter_sword", .directWrite,\ ; name, routine + -5, 4, $0420, !THIN|!e,\ ; OAM y/x offset, GFX char offset, props + $F359, 1,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("master_sword", .directWrite,\ ; name, routine + -5, 4, $09C0, !THIN|!e,\ ; OAM y/x offset, GFX char offset, props + $F359, 2,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("tempered_sword", .directWrite,\ ; name, routine + -5, 4, $09C0, !THIN|!e,\ ; OAM y/x offset, GFX char offset, props + $F359, 3,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("butter_sword", .directWrite,\ ; name, routine + -5, 4, $09C0, !THIN|!e,\ ; OAM y/x offset, GFX char offset, props + $F359, 4,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("fighter_shield", .fighterShield,\ ; name, routine + -5, 4, $11E0, !THIN|!e,\ ; OAM y/x offset, GFX char offset, props + $F35A, 1,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("red_shield", .directWrite,\ ; name, routine + -4, 0, $0140, !WIDE|!e,\ ; OAM y/x offset, GFX char offset, props + $F35A, 2,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("mirror_shield", .directWrite,\ ; name, routine + -4, 0, $1480, !WIDE|!e,\ ; OAM y/x offset, GFX char offset, props + $F35A, 3,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("fire_rod", .directWrite,\ ; name, routine + -5, 4, $0480, !THIN|!r,\ ; OAM y/x offset, GFX char offset, props + $F345, 1,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + + +; $08 +%ritem("ice_rod", .directWrite,\ ; name, routine + -5, 4, $0480, !THIN|!b,\ ; OAM y/x offset, GFX char offset, props + $F346, 1,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("hammer", .directWrite,\ ; name, routine + -4, 4, $04A0, !THIN|!r,\ ; OAM y/x offset, GFX char offset, props + $F34B, 1,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("hookshot", .directWrite,\ ; name, routine + -4, 4, $0460, !THIN|!r,\ ; OAM y/x offset, GFX char offset, props + $F342, 1,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("bow", .directWrite,\ ; name, routine + -4, 4, $0400, !THIN|!r,\ ; OAM y/x offset, GFX char offset, props + $F340, 1,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("boomerang", .directWrite,\ ; name, routine + -2, 5, $05E0, !THIN|!b,\ ; OAM y/x offset, GFX char offset, props + $F341, 1,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("powder", .directWrite,\ ; name, routine + -4, 0, $04C0, !WIDE|!b,\ ; OAM y/x offset, GFX char offset, props + $F344, 2,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("bee", .bottles,\ ; name, routine + -4, 0, $11A0, !WIDE|!b,\ ; OAM y/x offset, GFX char offset, props + $F35C, 7,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("bombos", .directWrite,\ ; name, routine + -4, 4, $0C40, !WIDE|!g,\ ; OAM y/x offset, GFX char offset, props + $F347, 1,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + + +; $10 +%ritem("ether", .directWrite,\ ; name, routine + -4, 0, $0C00, !WIDE|!g,\ ; OAM y/x offset, GFX char offset, props + $F348, 1,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("quake", .directWrite,\ ; name, routine + -4, 0, $0C80, !WIDE|!g,\ ; OAM y/x offset, GFX char offset, props + $F349, 1,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("lamp", .directWrite,\ ; name, routine + -4, 0, $08C0, !WIDE|!r,\ ; OAM y/x offset, GFX char offset, props + $F34A, 1,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("shovel", .directWrite,\ ; name, routine + -4, 4, $09E0, !THIN|!r,\ ; OAM y/x offset, GFX char offset, props + $F34C, 1,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("flute", .directWrite,\ ; name, routine + -4, 0, $1440, !WIDE|!b,\ ; OAM y/x offset, GFX char offset, props + $F34C, 3,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("somaria", .directWrite,\ ; name, routine + -4, 4, $0440, !THIN|!r,\ ; OAM y/x offset, GFX char offset, props + $F350, 1,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("bottle", .newBottle,\ ; name, routine + -4, 0, $0CC0, !WIDE|!r,\ ; OAM y/x offset, GFX char offset, props + $F35C, 0,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("hp", .hp,\ ; name, routine + -4, 0, $1400, !WIDE|!r,\ ; OAM y/x offset, GFX char offset, props + $F36B, 0,\ ; SRAM address, SRAM value + $FFFF,!hpsfx) ; Message, Sound + + + +; $18 +%ritem("byrna", .directWrite,\ ; name, routine + -4, 4, $0440, !THIN|!b,\ ; OAM y/x offset, GFX char offset, props + $F351, 1,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("cape", .directWrite,\ ; name, routine + -4, 0, $0900, !WIDE|!r,\ ; OAM y/x offset, GFX char offset, props + $F352, 1,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("mirror", .directWrite,\ ; name, routine + -4, 0, $0840, !WIDE|!b,\ ; OAM y/x offset, GFX char offset, props + $F353, 2,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("glove", .directWrite,\ ; name, routine + -4, 0, $0540, !WIDE|!r,\ ; OAM y/x offset, GFX char offset, props + $F354, 1,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("mitts", .directWrite,\ ; name, routine + -4, 0, $0540, !WIDE|!g,\ ; OAM y/x offset, GFX char offset, props + $F354, 2,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("book", .directWrite,\ ; name, routine + -4, 0, $0580, !WIDE|!g,\ ; OAM y/x offset, GFX char offset, props + $F34E, 1,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("flippers", .flippers,\ ; name, routine + -4, 0, $0800, !WIDE|!b,\ ; OAM y/x offset, GFX char offset, props + $F356, 1,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("pearl", .directWrite,\ ; name, routine + -4, 0, $0980, !WIDE|!r,\ ; OAM y/x offset, GFX char offset, props + $F357, 1,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + + +; $20 +%ritem("crystal", .palaceItem,\ ; name, routine + -4, 0, $10A0, !WIDE|6,\ ; OAM y/x offset, GFX char offset, props + $F37A, 0,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("net", .directWrite,\ ; name, routine + -4, 0, $1060, !WIDE|!r,\ ; OAM y/x offset, GFX char offset, props + $F34D, 1,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("blue_mail", .blueMail,\ ; name, routine + -4, 0, $0100, !WIDE|!b,\ ; OAM y/x offset, GFX char offset, props + $F35B, 1,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("red_mail", .directWrite,\ ; name, routine + -5, 0, $0100, !WIDE|!r,\ ; OAM y/x offset, GFX char offset, props + $F35B, 2,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("key", .addKey,\ ; name, routine + -4, 4, $05C0, !THIN|!b,\ ; OAM y/x offset, GFX char offset, props + $F36F, 1,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("compass", .palaceItem,\ ; name, routine + -4, 0, $0940, !WIDE|!b,\ ; OAM y/x offset, GFX char offset, props + $F364, 0,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("4hp", .4hp,\ ; name, routine + -4, 0, $00C0, !WIDE|!r,\ ; OAM y/x offset, GFX char offset, props + $F36C, 0,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("bomb", .addBombs,\ ; name, routine + -4, 0, $0880, !WIDE|!r,\ ; OAM y/x offset, GFX char offset, props + $F375, 1,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + + +; $28 +%ritem("3_bombs", .addBombs,\ ; name, routine + -4, 0, $0040, !WIDE|!r,\ ; OAM y/x offset, GFX char offset, props + $F375, 3,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("mushroom", .mushroom,\ ; name, routine + -4, 0, $0D40, !WIDE|!g,\ ; OAM y/x offset, GFX char offset, props + $F344, 1,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("red_boomerang", .directWrite,\ ; name, routine + -2, 5, $05E0, !THIN|!r,\ ; OAM y/x offset, GFX char offset, props + $F341, 2,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("red_cauldron", .bottles,\ ; name, routine + -4, 0, $0000, !WIDE|!r,\ ; OAM y/x offset, GFX char offset, props + $F35C, 3,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("green_cauldron", .bottles,\ ; name, routine + -4, 0, $0000, !WIDE|!g,\ ; OAM y/x offset, GFX char offset, props + $F35C, 4,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("blue_cauldron", .bottles,\ ; name, routine + -4, 0, $0000, !WIDE|!b,\ ; OAM y/x offset, GFX char offset, props + $F35C, 5,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("red_cauldron2", .bottles,\ ; name, routine + -4, 0, $0000, !WIDE|!r,\ ; OAM y/x offset, GFX char offset, props + $F36D, 0,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("green_cauldron2", .bottles,\ ; name, routine + -4, 0, $0000, !WIDE|!g,\ ; OAM y/x offset, GFX char offset, props + $F36E, 0,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + + +; $30 +%ritem("blue_cauldron2", .bottles,\ ; name, routine + -4, 0, $0000, !WIDE|!b,\ ; OAM y/x offset, GFX char offset, props + $F36E, 0,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("10_bombs", .addBombs,\ ; name, routine + -4, 0, $0500, !WIDE|!r,\ ; OAM y/x offset, GFX char offset, props + $F375, 10,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("big_key", .palaceItem,\ ; name, routine + -4, 0, $0DC0, !WIDE|!g,\ ; OAM y/x offset, GFX char offset, props + $F366, 0,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("map", .palaceItem,\ ; name, routine + -4, 0, $0D80, !WIDE|!g,\ ; OAM y/x offset, GFX char offset, props + $F368, 0,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("1_rupee", .addRupees,\ ; name, routine + -2, 4, $1000, !THIN|!g,\ ; OAM y/x offset, GFX char offset, props + $F360, 1,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("5_rupees", .addRupees,\ ; name, routine + -2, 4, $1000, !THIN|!b,\ ; OAM y/x offset, GFX char offset, props + $F360, 5,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("20_rupees", .addRupees,\ ; name, routine + -2, 4, $1000, !THIN|!r,\ ; OAM y/x offset, GFX char offset, props + $F360, 20,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("green_pendant", .palaceItem,\ ; name, routine + -4, 0, $1880, !WIDE|!g,\ ; OAM y/x offset, GFX char offset, props + $F374, 0,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + + +; $38 +%ritem("blue_pendant", .palaceItem,\ ; name, routine + -4, 0, $1880, !WIDE|!r,\ ; OAM y/x offset, GFX char offset, props + $F374, 0,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("red_pendant", .palaceItem,\ ; name, routine + -4, 0, $1880, !WIDE|!b,\ ; OAM y/x offset, GFX char offset, props + $F374, 0,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("tossed_bow", .directWrite,\ ; name, routine + -4, 0, $1120, !WIDE|!b,\ ; OAM y/x offset, GFX char offset, props + $F340, 1,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("silvers", .directWrite,\ ; name, routine + -4, 0, $10E0, !WIDE|!r,\ ; OAM y/x offset, GFX char offset, props + $F340, 3,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("good_bee", .bottles,\ ; name, routine + -4, 0, $11A0, !WIDE|!b,\ ; OAM y/x offset, GFX char offset, props + $F35C, 7,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("fairy", .bottles,\ ; name, routine + -4, 0, $1160, !WIDE|!b,\ ; OAM y/x offset, GFX char offset, props + $F35C, 6,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("boss_hc", .hc,\ ; name, routine + -4, 0, $00C0, !WIDE|!r,\ ; OAM y/x offset, GFX char offset, props + $F36C, 0,\ ; SRAM address, SRAM value + $FFFF,!hcsfx) ; Message, Sound + + +%ritem("sanc_hc", .4hp,\ ; name, routine + -4, 0, $00C0, !WIDE|!r,\ ; OAM y/x offset, GFX char offset, props + $F36C, 0,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + + +; $40 +%ritem("100_rupees", .addRupees,\ ; name, routine + -4, 0, $1520, !WIDE|!g,\ ; OAM y/x offset, GFX char offset, props + $F360, 100,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("50_rupees", .addRupees,\ ; name, routine + -4, 0, $1560, !WIDE|!g,\ ; OAM y/x offset, GFX char offset, props + $F360, 50,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("heart", .addHeart,\ ; name, routine + -2, 4, $14C0, !THIN|!r,\ ; OAM y/x offset, GFX char offset, props + $F372, 8,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("arrow", .addArrows,\ ; name, routine + -2, 4, $1500, !THIN|!b,\ ; OAM y/x offset, GFX char offset, props + $F376, 1,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("10_arrows", .addArrows,\ ; name, routine + -4, 0, $0080, !WIDE|!b,\ ; OAM y/x offset, GFX char offset, props + $F376, 10,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("small_magic", .addMagic,\ ; name, routine + -2, 4, $14E0, !THIN|!g,\ ; OAM y/x offset, GFX char offset, props + $F373, 16,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("300_rupees", .add300Rupees,\ ; name, routine + -4, 0, $15A0, !WIDE|!g,\ ; OAM y/x offset, GFX char offset, props + $F360, 0,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("20_rupees_green", .addRupees,\ ; name, routine + -4, 0, $1800, !WIDE|!g,\ ; OAM y/x offset, GFX char offset, props + $F360, 20,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + + +; $48 +%ritem("gold_bee", .bottles,\ ; name, routine + -4, 0, $11A0, !WIDE|!b,\ ; OAM y/x offset, GFX char offset, props + $F35C, 8,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("tossed_fighter_sword", .directWrite,\ ; name, routine + -5, 4, $0420, !THIN|!e,\ ; OAM y/x offset, GFX char offset, props + $F359, 1,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("active_flute", .directWrite,\ ; name, routine + -4, 0, $1440, !WIDE|!b,\ ; OAM y/x offset, GFX char offset, props + $F34C, 3,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("boots", .boots,\ ; name, routine + -4, 0, $1840, !WIDE|!r,\ ; OAM y/x offset, GFX char offset, props + $F355, 1,\ ; SRAM address, SRAM value + $FFFF,!dodododo) ; Message, Sound + + +%ritem("Bomb_50" +%ritem("Arrow_70" +%ritem("Half_Magic" +%ritem("Quarter_Magic" + +; $50 +%ritem("Safe_MS" +%ritem("Bomb_plus5" +%ritem("Bomb_plus10" +%ritem("Arrow_plus5" +%ritem("Arrow_plus10" +%ritem("PRGM_1" +%ritem("PRGM_2" +%ritem("PRGM_3" + +; $58 +%ritem("Upgrade_Silvers" +%ritem("Rupoor" +%ritem("NULL" +%ritem("Clock_red" +%ritem("Clock_blue" +%ritem("Clock_green" +%ritem("Prog_Sword" +%ritem("Prog_Shield" + +; $60 +%ritem("Prog_Mail" +%ritem("Prog_Glove" +%ritem("RNG_Single" +%ritem("RNG_Multi" +%ritem("Prog_Bow" +%ritem("Prog_Bow" +%ritem( +%ritem( + +; $68 +%ritem( +%ritem( +%ritem("Goal_Trifoce" +%ritem("Goal_Multi_Star" +%ritem("Goal_Multi_Triforce" +%ritem("Server_F0" +%ritem("Server_F1" +%ritem("Server_F2" + +; $70 +%ritem(" +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( + +; $78 +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( + +; $80 +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( + +; $88 +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( + +; $90 +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( + +; $98 +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( + +; $A0 +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( + +; $A8 +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( + +; $B0 +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( + +; $B8 +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( + +; $C0 +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( + +; $C8 +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( + +; $D0 +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( + +; $D8 +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( + +; $E0 +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( + +; $E8 +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( + +; $F0 +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( + +; $F8 +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem( +%ritem("Server_async" +%ritem("NULL_2" + + + + + +org $08C3AE +Ancilla_ReceiveItem: + + diff --git a/password.asm b/password.asm index 7ead174..595d1cd 100644 --- a/password.asm +++ b/password.asm @@ -167,7 +167,7 @@ ValidatePassword: LDX #$0F - LDA.l !PASSWORD_SRAM, X : BNE + - BRL .incorrect + JMP .incorrect + DEX : BPL - diff --git a/pendantcrystalhud.asm b/pendantcrystalhud.asm index be4eedb..048a2be 100644 --- a/pendantcrystalhud.asm +++ b/pendantcrystalhud.asm @@ -56,7 +56,7 @@ RTL !MAP_OVERLAY = "$7EF414" ; [2] OverworldMap_CheckObject: PHX - ;CPX.b #$01 : BNE + : BRL ++ : + : BRL .fail + ;CPX.b #$01 : BNE + : JMP ++ : + : JMP .fail LDA $7EF3CA : AND.b #$40 : BNE + ;LW Map LDA.l MapMode : BEQ +++ @@ -66,7 +66,7 @@ OverworldMap_CheckObject: LDA !INVENTORY_MAP, X : ORA !MAP_OVERLAY, X PLX AND.l .lw_map_masks, X : BNE +++ - BRL .fail + JMP .fail +++ LDA.l .lw_offsets, X BPL +++ : CLC : BRA .done : +++ ; don't display master sword @@ -80,7 +80,7 @@ OverworldMap_CheckObject: LDA.l !INVENTORY_MAP, X : ORA !MAP_OVERLAY, X PLX AND.l .dw_map_masks, X : BNE +++ - BRL .fail + JMP .fail +++ LDA.l .dw_offsets, X TAX : BRA ++ @@ -294,8 +294,8 @@ DrawHUDDungeonItems: LDA #$24F5 : STA $1686, X : STA $16C6, X INX #2 : CPX.w #$0020 : BCC - - LDA !HUD_FLAG : AND.w #$0020 : BEQ + : BRL +++ : + - LDA HUDDungeonItems : AND.w #$0001 : BNE + : BRL ++ : + + LDA !HUD_FLAG : AND.w #$0020 : BEQ + : JMP +++ : + + LDA HUDDungeonItems : AND.w #$0001 : BNE + : JMP ++ : + LDA.w #$2810 : STA $1684 ; small keys icon SEP #$20 ; set 8-bit accumulator ; Small Keys @@ -320,7 +320,7 @@ DrawHUDDungeonItems: ++ ; Big Keys - LDA HUDDungeonItems : AND.w #$0002 : BNE + : BRL ++ : + + LDA HUDDungeonItems : AND.w #$0002 : BNE + : JMP ++ : + LDA.w #$2811 : STA $16C4 ; big key icon LDA $7EF367 : AND.w #$0040 : BEQ + ; Hyrule Castle LDA.w #$2826 : STA $16C6 @@ -365,9 +365,9 @@ DrawHUDDungeonItems: ; This should only display if select is pressed in hud +++ - LDA !HUD_FLAG : AND.w #$0020 : BNE + : BRL +++ : + + LDA !HUD_FLAG : AND.w #$0020 : BNE + : JMP +++ : + ; Maps - LDA HUDDungeonItems : AND.w #$0004 : BNE + : BRL ++ : + + LDA HUDDungeonItems : AND.w #$0004 : BNE + : JMP ++ : + LDA.w #$2821 : STA $1684 ; map icon LDA $7EF369 : AND.w #$0040 : BEQ + ; Hyrule Castle LDA.w #$2826 : STA $1686 @@ -411,7 +411,7 @@ DrawHUDDungeonItems: ++ ; Compasses - LDA HUDDungeonItems : AND.w #$0008 : BNE + : BRL ++ : + + LDA HUDDungeonItems : AND.w #$0008 : BNE + : JMP ++ : + LDA.w #$2C20 : STA $16C4 ; compass icon LDA $7EF365 : AND.w #$0040 : BEQ + ; Hyrule Castle LDA.w #$2C26 : STA $16C6 diff --git a/shopkeeper.asm b/shopkeeper.asm index cc546eb..4132011 100644 --- a/shopkeeper.asm +++ b/shopkeeper.asm @@ -70,10 +70,10 @@ DrawPrice: LDY.b #$FF LDX #$00 ; clear bigram pointer - LDA $0C : CMP.w #1000 : !BLT + : BRL .len4 : + - CMP.w #100 : !BLT + : BRL .len3 : + - CMP.w #10 : !BLT + : BRL .len2 : + - CMP.w #1 : !BLT + : BRL .len1 : + + LDA $0C : CMP.w #1000 : !BLT + : JMP .len4 : + + CMP.w #100 : !BLT + : JMP .len3 : + + CMP.w #10 : !BLT + : JMP .len2 : + + CMP.w #1 : !BLT + : JMP .len1 : + .len4 %DrawDigit(#1000,#6) @@ -149,7 +149,7 @@ SpritePrep_ShopKeeper: .fail SEP #$20 ; set 8-bit accumulator LDA.b #$FF : STA !SHOP_TYPE ; $FF = error condition - BRL .done + JMP .done .success SEP #$20 ; set 8-bit accumulator @@ -157,10 +157,10 @@ SpritePrep_ShopKeeper: LDX.w #$0000 LDY.w #$0000 - - TYA : CMP !SHOP_CAPACITY : !BLT ++ : BRL .stop : ++ - LDA.l ShopContentsTable+1, X : CMP.b #$FF : BNE ++ : BRL .stop : ++ + TYA : CMP !SHOP_CAPACITY : !BLT ++ : JMP .stop : ++ + LDA.l ShopContentsTable+1, X : CMP.b #$FF : BNE ++ : JMP .stop : ++ - LDA.l ShopContentsTable, X : CMP !SHOP_ID : BEQ ++ : BRL .next : ++ + LDA.l ShopContentsTable, X : CMP !SHOP_ID : BEQ ++ : JMP .next : ++ LDA.l ShopContentsTable+1, X : PHX : TYX : STA.l !SHOP_INVENTORY, X : PLX LDA.l ShopContentsTable+2, X : PHX : TYX : STA.l !SHOP_INVENTORY+1, X : PLX LDA.l ShopContentsTable+3, X : PHX : TYX : STA.l !SHOP_INVENTORY+2, X : PLX @@ -191,7 +191,7 @@ SpritePrep_ShopKeeper: .next INX #8 - BRL - + JMP - .stop ;LDA $A0 : CMP.b #$FF : BNE .normal @@ -289,7 +289,7 @@ Shopkeeper_UploadVRAMTiles: LDA #$7E : STA $4304 LDA !SHOP_TYPE : AND.b #$10 : BNE .special - BRL .normal + JMP .normal .special @@ -322,7 +322,7 @@ Shopkeeper_UploadVRAMTiles: LDA #$80 : STA $2116 ; set VRAM register destination address LDA #$5B : STA $2117 LDA #$01 : STA $420B ; begin DMA transfer - BRL .end + JMP .end .normal LDA #$40 : STA $4305 : STZ $4306 ; set transfer size to 0x40 @@ -456,9 +456,9 @@ endmacro Shopkeeper_DrawMerchant: LDA.l !SHOP_MERCHANT : AND.b #$07 BEQ Shopkeeper_DrawMerchant_Type0 - CMP.b #$01 : BNE + : BRL Shopkeeper_DrawMerchant_Type1 : + - CMP.b #$02 : BNE + : BRL Shopkeeper_DrawMerchant_Type2 : + - CMP.b #$03 : BNE + : BRL Shopkeeper_DrawMerchant_Type3 : + + CMP.b #$01 : BNE + : JMP Shopkeeper_DrawMerchant_Type1 : + + CMP.b #$02 : BNE + : JMP Shopkeeper_DrawMerchant_Type2 : + + CMP.b #$03 : BNE + : JMP Shopkeeper_DrawMerchant_Type3 : + CMP.b #$04 : BNE + : RTS : + ;-------------------------------------------------------------------------------- Shopkeeper_DrawMerchant_Type0: @@ -546,13 +546,13 @@ Shopkeeper_BuyItem: LDY.b #$01 JSL.l Sprite_ShowMessageUnconditional LDA.b #$3C : STA $012E ; error sound - BRL .done + JMP .done .full_bottles LDA.b #$6B LDY.b #$01 JSL.l Sprite_ShowMessageUnconditional LDA.b #$3C : STA $012E ; error sound - BRL .done + JMP .done .buy LDA !SHOP_TYPE : AND.b #$80 : BNE ++ ; don't charge if this is a take-any REP #$20 : LDA $7EF360 : !SUB !SHOP_INVENTORY+1, X : STA $7EF360 : SEP #$20 ; Take price away @@ -707,7 +707,7 @@ RTS ;-------------------------------------------------------------------------------- Shopkeeper_DrawNextItem: - LDA.l !SHOP_STATE : AND.w Shopkeeper_ItemMasks, Y : BEQ + : BRL .next : + + LDA.l !SHOP_STATE : AND.w Shopkeeper_ItemMasks, Y : BEQ + : JMP .next : + PHY diff --git a/stats/main.asm b/stats/main.asm index b78b459..1131840 100755 --- a/stats/main.asm +++ b/stats/main.asm @@ -226,7 +226,7 @@ RenderCreditsStatCounter: JSR FindLine BCS + - BRL .endStats + JMP .endStats + ; XXXX X00L LLLL LLLL BBBB SSSS CCC- ---- ---- ---- AAAA AAAA AAAA AAAA AAAA AAAA @@ -237,7 +237,7 @@ RenderCreditsStatCounter: AND #$0003 ; TT CMP.w #$0000 BEQ .normalStat - BRL .timeStat + JMP .timeStat .normalStat ; == Write Stripe header (VRAM address, i.e. tile coordinates) == @@ -491,7 +491,7 @@ RenderCreditsStatCounter: %StripeTile() %StripeEnd() - BRL .endStats + JMP .endStats RenderLineNumber: diff --git a/swordswap.asm b/swordswap.asm index 170ce66..bfea58f 100644 --- a/swordswap.asm +++ b/swordswap.asm @@ -166,7 +166,7 @@ GetSmithSword: ;================================================================================ CheckMedallionSword: PHB : PHX : PHY - LDA.l AllowSwordlessMedallionUse : BNE +++ : BRL + : +++ + LDA.l AllowSwordlessMedallionUse : BNE +++ : JMP + : +++ LDA $1B : BEQ .outdoors .indoors REP #$20 ; set 16-bit accumulator @@ -174,11 +174,11 @@ CheckMedallionSword: CMP.w #$000E : BNE ++ : .freezor1 LDA $22 : AND.w #$01FF : CMP.w #368-8 : !BLT .normal : CMP.w #368+32-8 : !BGE .normal ; check x-coord LDA $20 : AND.w #$01FF : CMP.w #400-22 : !BLT .normal : CMP.w #400+32-22 : !BGE .normal ; check y-coord - BRL .permit + JMP .permit ++ : CMP.w #$007E : BNE ++ : .freezor2 LDA $22 : AND.w #$01FF : CMP.w #112-8 : !BLT .normal : CMP.w #112+32-8 : !BGE .normal ; check x-coord LDA $20 : AND.w #$01FF : CMP.w #400-22 : !BLT .normal : CMP.w #400+32-22 : !BGE .normal ; check y-coord - BRL .permit + JMP .permit ++ : CMP.w #$00DE : BNE ++ : .kholdstare LDA $22 : AND.w #$01FF : CMP.w #368-8 : !BLT .normal : CMP.w #368+32-8 : !BGE .normal ; check x-coord LDA $20 : AND.w #$01FF : CMP.w #144-22 : !BLT .normal : CMP.w #144+32-22 : !BGE .normal ; check y-coord diff --git a/tablets.asm b/tablets.asm index 460cecf..3e12429 100644 --- a/tablets.asm +++ b/tablets.asm @@ -79,13 +79,13 @@ IsMedallion: CMP.w #$03 : BNE + ; Death Mountain LDA $22 : CMP.w #1890 : !BGE ++ SEC - BRL .done + JMP .done ++ BRA .false + CMP.w #$30 : BNE + ; Desert LDA $22 : CMP.w #512 : !BLT ++ SEC - BRL .done + JMP .done ++ + .false diff --git a/utilities.asm b/utilities.asm index 730918b..1ae47ec 100644 --- a/utilities.asm +++ b/utilities.asm @@ -304,7 +304,7 @@ IsNarrowSprite: JSR.w CountBottles : CMP.l BottleLimit : !BLT + LDA.l BottleLimitReplacement JSL.l IsNarrowSprite - BRL .done + JMP .done + : BRA .continue .notBottle CMP.b #$5E : BNE ++ ; Progressive Sword