Merge in beta changes to pikit mode #4

Open
karafruit wants to merge 36 commits from pikit_mode_merge into pikit_mode
4 changed files with 76 additions and 61 deletions
Showing only changes of commit 333159ac53 - Show all commits
+47 -22
View File
@@ -146,32 +146,57 @@ macro SetMinimum(base,filler,compare)
endmacro endmacro
RefreshRainAmmo: RefreshRainAmmo:
LDA.l ProgressIndicator : CMP.b #$01 : BEQ .rain ; check if we're in rain state LDA.l ProgressIndicator : CMP.b #$01 : BEQ .rain ; check if we're in rain state
RTL RTL
.rain .rain
LDA.l StartingEntrance LDA.l StartingEntrance : BEQ .uncle
+ CMP.b #$03 : BNE + ; Uncle CMP.b #$03 : BNE + ; Uncle
%SetMinimum(CurrentMagic,MagicFiller,RainDeathRefillMagic_Uncle) .uncle
%SetMinimum(BombsEquipment,BombsFiller,RainDeathRefillBombs_Uncle) LDA.l RainDeathRefillMagic_Uncle : JSR .refillMagic
LDA.l ArrowMode : BEQ ++ LDA.l RainDeathRefillBombs_Uncle : JSR .refillBombs
LDA.l BowEquipment : BEQ +++ LDA.l ArrowMode : BNE .rupeeBow
++ %SetMinimum(CurrentArrows,ArrowsFiller,RainDeathRefillArrows_Uncle) LDA.l RainDeathRefillArrows_Uncle : JSR .refillArrows
+++ BRA .done BRA .done
+ CMP.b #$02 : BNE + ; Cell + CMP.b #$02 : BNE + ; Cell
%SetMinimum(CurrentMagic,MagicFiller,RainDeathRefillMagic_Cell) LDA.l RainDeathRefillMagic_Cell : JSR .refillMagic
%SetMinimum(BombsEquipment,BombsFiller,RainDeathRefillBombs_Cell) LDA.l RainDeathRefillBombs_Cell : JSR .refillBombs
LDA.l ArrowMode : BEQ ++ LDA.l ArrowMode : BNE .rupeeBow
LDA.l BowEquipment : BEQ .done LDA.l RainDeathRefillArrows_Cell : JSR .refillArrows
++ %SetMinimum(CurrentArrows,ArrowsFiller,RainDeathRefillArrows_Cell)
BRA .done BRA .done
+ CMP.b #$04 : BNE + ; Mantle + CMP.b #$04 : BNE + ; Mantle
%SetMinimum(CurrentMagic,MagicFiller,RainDeathRefillMagic_Mantle) LDA.l RainDeathRefillMagic_Mantle : JSR .refillMagic
%SetMinimum(BombsEquipment,BombsFiller,RainDeathRefillBombs_Mantle) LDA.l RainDeathRefillBombs_Mantle : JSR .refillBombs
LDA.l ArrowMode : BEQ ++ LDA.l ArrowMode : BNE .rupeeBow
LDA.l BowEquipment : BEQ .done LDA.l RainDeathRefillArrows_Mantle : JSR .refillArrows
++ %SetMinimum(CurrentArrows,ArrowsFiller,RainDeathRefillArrows_Mantle) BRA .done
+ + BRA .done
.done
.rupeeBow
REP #$20
LDA.l RainDeathRefillRupeeBow : JSR .refillRupees
SEP #$20
.done
RTL RTL
.refillMagic
SEC : SBC.l CurrentMagic : BCC +
STA.l MagicFiller
+ RTS
.refillBombs
SEC : SBC.l BombsEquipment : BCC +
STA.l BombsFiller
+ RTS
.refillArrows
SEC : SBC.l CurrentArrows : BCC +
STA.l ArrowsFiller
+ RTS
.refillRupees
CMP.l CurrentRupees : BCC +
STA.l CurrentRupees
+ RTS
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
SetEscapeAssist: SetEscapeAssist:
LDA.l ProgressIndicator : CMP.b #$01 : BNE .no_train ; check if we're in rain state LDA.l ProgressIndicator : CMP.b #$01 : BNE .no_train ; check if we're in rain state
+8 -18
View File
@@ -79,29 +79,19 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
OnUncleItemGet: OnUncleItemGet:
PHA PHA
LDA.l EscapeAssist
BIT.b #$04 : BEQ + : STA.l InfiniteMagic : +
BIT.b #$02 : BEQ + : STA.l InfiniteBombs : +
BIT.b #$01 : BEQ + : STA.l InfiniteArrows : +
LDA.l UncleItem_Player : STA.l !MULTIWORLD_ITEM_PLAYER_ID LDA.l UncleItem_Player : STA.l !MULTIWORLD_ITEM_PLAYER_ID
PLA PLA
JSL Link_ReceiveItem JSL Link_ReceiveItem
LDA.l UncleRefill : BIT.b #$04 : BEQ + : LDA.b #$80 : STA.l MagicFiller : + ; refill magic
LDA.l UncleRefill : BIT.b #$02 : BEQ + : LDA.b #50 : STA.l BombsFiller : + ; refill bombs
LDA.l UncleRefill : BIT.b #$01 : BEQ + ; refill arrows
LDA.b #70 : STA.l ArrowsFiller
LDA.l ArrowMode : BEQ +
LDA.l BowTracking : ORA.b #$80 : STA.l BowTracking ; enable bow toggle
REP #$20 ; set 16-bit accumulator
LDA.l CurrentRupees : !ADD.l FreeUncleItemAmount : STA.l CurrentRupees ; rupee arrows, so also give the player some money to start
SEP #$20 ; set 8-bit accumulator
+
LDA.l ProgressIndicator : BNE + LDA.l ProgressIndicator : BNE +
LDA.b #$01 : STA.l ProgressIndicator ; handle rain state LDA.b #$01 : STA.l ProgressIndicator ; set rain state
JSL SetEscapeAssist
JSL RefreshRainAmmo
; grant arrows if we started with a bow in retro mode
LDA.l ArrowMode : BEQ +
LDA.l RainDeathRefillRupeeBow : ORA.l RainDeathRefillRupeeBow+1 : BEQ +
LDA.b #$01 : STA.l ArrowsFiller
+ +
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
+3 -7
View File
@@ -237,12 +237,8 @@ db $00
;a - Infinite Arrows ;a - Infinite Arrows
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $B0804E ; PC 0x18004E org $B0804E ; PC 0x18004E
UncleRefill: UncleRefill_deprecated: ; no longer used
db $00 db $00
;---- -mba
;m - Refill Magic
;b - Refill Bombs
;a - Refill Arrows
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $B0804F ; PC 0x18004F org $B0804F ; PC 0x18004F
ByrnaInvulnerability: ByrnaInvulnerability:
@@ -890,8 +886,8 @@ SilverArrowsAutoEquip:
db $01 ; #$00 = Off - #$01 = Collection Time (Default) - #$02 = Entering Ganon - #$03 = Collection Time & Entering Ganon db $01 ; #$00 = Off - #$01 = Collection Time (Default) - #$02 = Entering Ganon - #$03 = Collection Time & Entering Ganon
;================================================================================ ;================================================================================
org $B08183 ; PC 0x180183 org $B08183 ; PC 0x180183
FreeUncleItemAmount: RainDeathRefillRupeeBow:
dw $12C ; 300 rupees (Default) dw $012C ; 300 rupees (Default)
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $B08185 ; PC 0x180185 org $B08185 ; PC 0x180185
RainDeathRefillTable: RainDeathRefillTable:
+9 -5
View File
@@ -1,10 +1,14 @@
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
EndRainState: EndRainState:
LDA.l InitProgressIndicator : BIT.b #$80 : BNE + ; check for instant post-aga LDA.l InitProgressIndicator : BIT.b #$80 : BEQ + ; check for instant post-aga
LDA.b #$02 : STA.l ProgressIndicator
RTL
+
LDA.b #$03 : STA.l ProgressIndicator
LDA.l InitLumberjackOW : STA.l OverworldEventDataWRAM+$02 LDA.l InitLumberjackOW : STA.l OverworldEventDataWRAM+$02
LDA.b #$03
BRA ++
+
LDA.b #$02
++
STA.l ProgressIndicator
JSL SetEscapeAssist
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------