Merge branch 'DRMain' into OWMain

This commit is contained in:
codemann8
2021-07-07 19:11:36 -05:00
21 changed files with 700 additions and 176 deletions

View File

@@ -55,7 +55,7 @@ db #$20, #$19, #$08, #$31 ; year/month/day
!SRAM_SINK = "$7EF41E" ; <- change this (conflicts with Programmable item 3)
;$7EF418 - Goal Item Counter
;$7EF419 - Service Sequence
;$7EF420 - $7EF466 - Stat Tracking Bank 1 (overlaps with RNG Item Flags)
;$7EF420 - $7EF46D - Stat Tracking Bank 1 (overlaps with RNG Item Flags)
;$7EF450 - $7EF45F - RNG Item (Single) Flags
;$7EF4A0 - $7EF4A7 - Service Request Block
!FRESH_FILE_MARKER = "$7EF4F0" ; zero if fresh file
@@ -91,6 +91,11 @@ db #$20, #$19, #$08, #$31 ; year/month/day
;!REG_MUSIC_CONTROL = $012C
!REG_MUSIC_CONTROL_REQUEST = $012C
!ONEMIND_ID = $7F5072
!ONEMIND_TIMER = $7F5073
function hexto555(h) = ((((h&$FF)/8)<<10)|(((h>>8&$FF)/8)<<5)|(((h>>16&$FF)/8)<<0))
;================================================================================
!MULTIWORLD_ITEM = "$7EF4D2"
@@ -197,7 +202,7 @@ incsrc endingsequence.asm
incsrc cuccostorm.asm
incsrc compression.asm
incsrc retro.asm
incsrc dpadinvert.asm
incsrc controllerjank.asm
incsrc boots.asm
incsrc events.asm
incsrc fileselect.asm
@@ -219,6 +224,7 @@ incsrc toast.asm
incsrc darkroomitems.asm
incsrc fastcredits.asm
incsrc msu.asm
incsrc dungeonmap.asm
incsrc multiworld.asm
incsrc terrorpin.asm
warnpc $A58000
@@ -309,6 +315,10 @@ org $339000
incbin sheet178.gfx
warnpc $339600
org $339600
BossMapIconGFX:
incbin bossicons.4bpp
org $328000
Extra_Text_Table:
incsrc itemtext.asm
@@ -528,6 +538,9 @@ Sprite_ShowMessageUnconditional:
org $05EC96
Sprite_ZeldaLong:
org $0680FA
Player_ApplyRumbleToSprites:
org $0683E6
Utility_CheckIfHitBoxesOverlapLong:
@@ -609,6 +622,9 @@ AddDashTremor:
org $099D04
AddAncillaLong:
org $099D1A
Ancilla_CheckIfAlreadyExistsLong:
org $09AE64
Sprite_SetSpawnedCoords:

View File

@@ -6,10 +6,72 @@ ModifyBoots:
PHA
LDA !BOOTS_MODIFIER : CMP.b #$01 : BNE +
PLA : AND $7EF379 : ORA.b #$04 : RTL ; yes boots
+ : CMP #$02 : BNE +
+ : CMP.b #$02 : BNE +
PLA : AND $7EF379 : AND.b #$FB : RTL ; no boots
+ : LDA FakeBoots : CMP.b #$01 : BNE +
LDA $5B : BEQ ++ : LDA $59 : BNE + ; hover check
++ : PLA : AND $7EF379 : ORA.b #$04 : RTL ; yes boots, not hovering
+
PLA
AND $7EF379 ; regular boots
RTL
;--------------------------------------------------------------------------------
AddBonkTremors:
PHA
LDA $46 : BNE + ; Check for incapacitated Link
JSL.l IncrementBonkCounter
+
LDA !BOOTS_MODIFIER : CMP.b #$01 : BEQ +
LDA $7EF355 : BNE + ; Check for Boots
PLA : RTL
+
PLA
JSL.l AddDashTremor : JSL.l Player_ApplyRumbleToSprites ; things we wrote over
RTL
;--------------------------------------------------------------------------------
BonkBreakableWall:
PHX : PHP
SEP #$30 ; set 8-bit accumulator and index registers
LDA !BOOTS_MODIFIER : CMP.b #$01 : BEQ +
LDA $7EF355 : BNE + ; Check for Boots
PLP : PLX : LDA.w #$0000 : RTL
+
PLP : PLX
LDA $0372 : AND.w #$00FF ; things we wrote over
RTL
;--------------------------------------------------------------------------------
BonkRockPile:
LDA !BOOTS_MODIFIER : CMP.b #$01 : BEQ +
LDA $7EF355 : BNE + ; Check for Boots
LDA.b #$00 : RTL
+
LDA $02EF : AND.b #$70 ; things we wrote over
RTL
;--------------------------------------------------------------------------------
GravestoneHook:
LDA !BOOTS_MODIFIER : CMP.b #$01 : BEQ +
LDA $7EF355 : BEQ .done ; Check for Boots
+
LDA $0372 : BEQ .done ; things we wrote over
JML.l moveGravestone
.done
JML.l GravestoneHook_continue
;--------------------------------------------------------------------------------
JumpDownLedge:
LDA !BOOTS_MODIFIER : CMP.b #$01 : BEQ +
LDA $7EF355 : BNE + ; Check for Boots
; Disarm Waterwalk
LDA $5B : CMP.b #$01 : BNE +
STZ $5B
+
LDA $1B : BNE .done : LDA.b #$02 : STA $EE ; things we wrote over
.done
RTL
;--------------------------------------------------------------------------------
BonkRecoil:
LDA !BOOTS_MODIFIER : CMP.b #$01 : BEQ +
LDA $7EF355 : BNE + ; Check for Boots
LDA.b #$16 : STA $29 : RTL
+
LDA.b #$24 : STA $29 ; things we wrote over
RTL

BIN
bossicons.4bpp Normal file

Binary file not shown.

View File

@@ -7,7 +7,7 @@ DrawDungeonCompassCounts:
LDX $040C : CPX.b #$FF : BEQ .done ; Skip if not in a dungeon
CMP.w #$0002 : BEQ ++ ; if CompassMode==2, we don't check for the compass
LDA $7EF364 : AND.l .item_masks, X ; Load compass values to A, mask with dungeon item masks
LDA $7EF364 : AND.l DungeonItemMasks, X ; Load compass values to A, mask with dungeon item masks
BEQ .done ; skip if we don't have compass
++
@@ -36,7 +36,7 @@ DrawDungeonCompassCounts:
.done
RTL
.item_masks ; these are dungeon correlations to $7EF364 - $7EF369 so it knows where to store compasses, etc
DungeonItemMasks: ; these are dungeon correlations to $7EF364 - $7EF369 so it knows where to store compasses, etc
dw $8000, $4000, $2000, $1000, $0800, $0400, $0200, $0100
dw $0080, $0040, $0020, $0010, $0008, $0004

View File

@@ -5,9 +5,31 @@
; Filtered Joypad 1 Register: [AXLR | ????]
; Filtered Joypad 1 Register: [BYST | udlr] [AXLR | ????]
!INVERT_DPAD = "$7F50CB"
InvertDPad:
LDA !INVERT_DPAD : BNE + : JMP .normal : +
DEC : BEQ .dpadOnly
LDA.l OneMindPlayerCount : BEQ .crowd_control
LDA.l !ONEMIND_ID
AND.b #$03
TAX
LDA.l .onemind_controller_offset, X
TAX
LDA.w $4218,X : STA.w $00
LDA.w $4219,X : STA.w $01
LDA #$80 : STA $4201 ; reset this so latch can read it, otherwise RNG breaks
JML.l InvertDPadReturn
.crowd_control
LDA !INVERT_DPAD : BNE +
LDA $4218 : STA $00
LDA $4219 : STA $01
JML.l InvertDPadReturn
+ DEC : BEQ .dpadOnly
DEC : BEQ .buttonsOnly
DEC : BEQ .invertBoth
.swapSides
@@ -45,8 +67,61 @@ JML.l InvertDPadReturn
BIT.b #$03 : BEQ + : EOR.b #$03 : + ; swap left/right
STA $01
JML.l InvertDPadReturn
.normal
LDA $4218 : STA $00
LDA $4219 : STA $01
JML.l InvertDPadReturn
.onemind_controller_offset
db 0 ; player 0 - $4218 - joy1d1
db 0 ; player 1 - $4218 - joy1d1
db 2 ; player 2 - $421A - joy2d1
db 6 ; player 3 - $421E - joy2d2
db 2 ; player 4 - $421A - joy2d1
db 6 ; player 5 - $421E - joy2d2
;--------------------------------------------------------------------------------
HandleOneMindController:
LDA.l OneMindPlayerCount
BEQ .no_onemind
REP #$20
LDA.l !ONEMIND_TIMER
DEC
BPL .no_switch
SEP #$20
LDA.l !ONEMIND_ID
INC
CMP.l OneMindPlayerCount
BCC .no_wrap
LDA.b #$01 ; reset to player 1
.no_wrap
STA.l !ONEMIND_ID
REP #$20
LDA.l OneMindTimer
.no_switch
STA.l !ONEMIND_TIMER
SEP #$20
LDA.l !ONEMIND_ID
CMP.b #$04 ; is it player 4 or 5?
BCC .no_multitap_switch
STZ.w $4201
.no_multitap_switch
.no_onemind
STZ.b $12
JML $008034 ; reset frame loop

149
dungeonmap.asm Normal file
View File

@@ -0,0 +1,149 @@
DoDungeonMapBossIcon:
LDA.b $14
CMP.b #$09
BEQ .dungeonmap
.cave
CMP.b #$01
RTL
.dungeonmap
LDX.w $040C
BMI .cave
; LDA.l DungeonMapIcons
; AND.b #$01
; BNE ++
;
; INC ; so it's not equal to $01
; BRA .cave
; get dungeon boss room
++ REP #$30
LDA.l $8AE817,X
ASL
TAX
; get sprite pointer for room
LDA.l $89D62E,X
INC ; to skip the "sort"
TAX
; get first byte to make sure it isn't an empty room
SEP #$20
LDA.l $890000,X
CMP.b #$FF
BNE ++
SEP #$30
BRA .cave
; check first sprite
++ LDA.l $890002,X
SEP #$10
; match boss id
LDX.b #$0B
-- CMP.l .boss_id,X
BEQ .match
DEX
BPL --
TXA
BRA .cave
.match
LDA.b #$80
STA.w $2121
REP #$30
TXA
ASL ; x32 for palette data
ASL
ASL
ASL
ASL
TAX
; prep dma
ASL ; x128 for graphics
ASL
ADC.w #BossMapIconGFX
STA.w $4312
PHY
LDY.w #32
SEP #$20
-- LDA.l .boss_palettes,X
STA.w $2122
INX
DEY
BNE --
PLY
; GFX DMA
REP #$20
SEP #$10
LDA.w #$1801
STA.w $4310
LDX.b #BossMapIconGFX>>16
STX.w $4314
LDA.w #$A060>>1
STA.w $2116
LDA.w #$0040
STA.w $4315
LDX.b #$02
STX.w $420B
STA.w $4315
LDA.w #$A260>>1
STA.w $2116
STX.w $420B
; done
SEP #$30
RTL
.boss_id
db $53 ; armos
db $54 ; lanmolas
db $09 ; moldorm
db $7A ; agahnim
db $92 ; helma king
db $8C ; arrghus
db $88 ; mothula
db $CE ; blind
db $A3 ; khold shell
db $BD ; vitreous
db $CB ; trinexx
db $D6 ; ganon
.boss_palettes
dw hexto555($000000), hexto555($F8F8F8), hexto555($D86060), hexto555($5070C8), hexto555($B090F8), hexto555($282828), hexto555($F0A068), hexto555($B06028), hexto555($B88820), hexto555($E8A800), hexto555($F8F8F8), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000)
dw hexto555($000000), hexto555($F8F8F8), hexto555($50C090), hexto555($408858), hexto555($305830), hexto555($282828), hexto555($D8A800), hexto555($E06018), hexto555($787040), hexto555($585030), hexto555($484018), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000)
dw hexto555($000000), hexto555($F8F8F8), hexto555($903018), hexto555($D85800), hexto555($F8A828), hexto555($282828), hexto555($E88068), hexto555($B04038), hexto555($F8D018), hexto555($C8B818), hexto555($A89818), hexto555($806818), hexto555($503818), hexto555($000000), hexto555($000000), hexto555($000000)
dw hexto555($000000), hexto555($F8F8F8), hexto555($C04080), hexto555($B08828), hexto555($E8C070), hexto555($282828), hexto555($90D038), hexto555($688020), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000)
dw hexto555($000000), hexto555($F8F8F8), hexto555($4848B0), hexto555($7870E8), hexto555($A8A8F8), hexto555($282828), hexto555($F8F8F8), hexto555($181818), hexto555($A00028), hexto555($D03828), hexto555($E88820), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000)
dw hexto555($000000), hexto555($F8F8F8), hexto555($903018), hexto555($D85800), hexto555($F8A828), hexto555($282828), hexto555($E88068), hexto555($B04038), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000)
dw hexto555($000000), hexto555($F8F8F8), hexto555($4848B0), hexto555($7870E8), hexto555($A8A8F8), hexto555($282828), hexto555($F8A840), hexto555($D85820), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000)
dw hexto555($000000), hexto555($F8F8F8), hexto555($903018), hexto555($D85800), hexto555($F8A828), hexto555($282828), hexto555($E88068), hexto555($B04038), hexto555($88D0F8), hexto555($7890F8), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000)
dw hexto555($000000), hexto555($F8F8F8), hexto555($4828C8), hexto555($4828F0), hexto555($8070F8), hexto555($282828), hexto555($F8C8F8), hexto555($E088B0), hexto555($7098C0), hexto555($58B0E8), hexto555($D0F8F8), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000)
dw hexto555($000000), hexto555($F8F8F8), hexto555($50C090), hexto555($408858), hexto555($305830), hexto555($282828), hexto555($D8A800), hexto555($E06018), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000)
dw hexto555($000000), hexto555($F8F8F8), hexto555($4848B0), hexto555($7870E8), hexto555($A8A8F8), hexto555($282828), hexto555($989868), hexto555($78C0A8), hexto555($A00028), hexto555($D03828), hexto555($E88820), hexto555($503860), hexto555($505060), hexto555($788890), hexto555($484868), hexto555($707068)
dw hexto555($000000), hexto555($F8F8F8), hexto555($B090F8), hexto555($C0A028), hexto555($886008), hexto555($282828), hexto555($B83010), hexto555($E86040), hexto555($385088), hexto555($5088A8), hexto555($88C8A0), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000)

View File

@@ -256,6 +256,11 @@ PostItemAnimation:
JML.l Ancilla_ReceiveItem_objectFinished
+
LDA.w $02E9 : CMP.b #$01 : BNE +
LDA.b $2F : BEQ +
JSL.l IncrementChestTurnCounter
+
STZ $02E9 : LDA $0C5E, X ; thing we wrote over to get here
JML.l Ancilla_ReceiveItem_optimus+6
;--------------------------------------------------------------------------------

View File

@@ -33,7 +33,7 @@ CalculateByrnaUsage:
PLX
++
LDA $7EF36E ; thing we wrote over
RTL
JML IncrementMagicUseCounterByrna
;--------------------------------------------------------------------------------
CalculateCapeUsage:
LDA $1B : BEQ ++
@@ -51,8 +51,7 @@ CalculateCapeUsage:
LDA.l HardModeExclusionCapeUsage, X : STA $4C ; set cape decrement timer
PLX
++
LDA $7EF36E ; thing we wrote over
RTL
JML IncrementMagicUseCounterOne
;--------------------------------------------------------------------------------
ActivateInvulnerabilityOrDont:
LDA $1B : BEQ .nowhere_special

View File

@@ -21,6 +21,8 @@ dl Init_PostRAMClear
org $008056 ; <- 56 - Bank00.asm : 77
JSL.l FrameHookAction
;--------------------------------------------------------------------------------
org $00805D
JML HandleOneMindController
;================================================================================
; NMI Hook
@@ -55,8 +57,8 @@ ReturnCheckZSNES:
;--------------------------------------------------------------------------------
;org $0083D9 ; <- 3D9 - Bank00.asm : 611 (LDA $4219 : STA $01)
;JSL.l InvertDPad : NOP
org $0083D4 ; <- 3D4 - Bank00.asm : 610 (LDA $4218 : STA $00)
JML.l InvertDPad : SKIP 6
org $0083D1 ; <- 3D1 - Bank00.asm (STZ.w JOYPAD - useless instruction here)
JML.l InvertDPad : SKIP 9
InvertDPadReturn:
;--------------------------------------------------------------------------------
@@ -67,6 +69,51 @@ org $079C22 ; <- 39222 - Bank07.asm : 4494 (AND $7EF379 : BEQ .cantDoAction)
JSL.l ModifyBoots
;--------------------------------------------------------------------------------
;================================================================================
; Enable/Disable Bonk Tremors
;--------------------------------------------------------------------------------
org $079202 ; 39202 <- Bank07.asm : 2859 (JSL AddDashTremor : JSL Player_ApplyRumbleToSprites)
JSL.l AddBonkTremors : NOP #4
;--------------------------------------------------------------------------------
;================================================================================
; Bonk Breakable Walls
;--------------------------------------------------------------------------------
org $01CF8E ; CF8E <- Bank01.asm : 11641 (LDA $0372 : AND.w #$00FF)
JSL.l BonkBreakableWall : NOP #2
;--------------------------------------------------------------------------------
;================================================================================
; Bonk Rock Pile
;--------------------------------------------------------------------------------
org $07C196 ; 3C196 <- Bank07.asm : 10310 (LDA $02EF : AND.b #$70)
JSL.l BonkRockPile : NOP
;--------------------------------------------------------------------------------
;================================================================================
; Move Gravestone
;--------------------------------------------------------------------------------
org $07C0FD ; 3C0FD <- Bank07.asm : 10197 (LDA $0372 : BNE .moveGravestone)
JML.l GravestoneHook : NOP
GravestoneHook_continue:
org $07C106
moveGravestone:
;--------------------------------------------------------------------------------
;================================================================================
; Jump Down Ledge
;--------------------------------------------------------------------------------
org $078966 ; 38966 <- Bank07.asm : 1618 (LDA $1B : BNE .indoors : LDA.b #$02 : STA $EE)
JSL.l JumpDownLedge : NOP #4
;--------------------------------------------------------------------------------
;================================================================================
; Bonk Recoil
;--------------------------------------------------------------------------------
org $07922C ; 3922C <- Bank07.asm : 2869 (LDA.b #$24 : STA $29)
JSL.l BonkRecoil
;--------------------------------------------------------------------------------
;================================================================================
; Dungeon Exit Hook
;--------------------------------------------------------------------------------
@@ -326,6 +373,12 @@ JSL.l LoadBombCount16
org $0DDEB3 ; <- 6DEB3 - equipment.asm : 328 (LDA $7EF33F, X)
JSL.l IsItemAvailable
;--------------------------------------------------------------------------------
org $0DDDE8 ; <- 6DDE8 - equipment.asm : 148 (LDA $7EF340)
JSL.l SearchForEquippedItem
;--------------------------------------------------------------------------------
org $0DDE70 ; <- 6DE70 - equipment.asm : 273 (LDA $7EF340)
JSL.l SearchForEquippedItem
;--------------------------------------------------------------------------------
org $0DE39D ; <- 6E39D - equipment.asm : 1109 (LDA $7EF340)
JSL.l SearchForEquippedItem
;--------------------------------------------------------------------------------
@@ -485,9 +538,6 @@ JSL.l CheckGanonHammerDamage : NOP
;================================================================================
; Stat Hooks
;--------------------------------------------------------------------------------
org $079202 ; 39202 <- Bank07.asm : 2859 (JSL AddDashTremor)
JSL.l StatBonkCounter
;--------------------------------------------------------------------------------
org $02B797 ; <- 13797 - Bank02.asm : 8712 (LDA.b #$19 : STA $10)
JSL.l StatsFinalPrep
;--------------------------------------------------------------------------------
@@ -2711,6 +2761,30 @@ JSL FastCreditsCutsceneTimer
org $0EE773
JSL FastTextScroll : NOP
;================================================================================
org $01FFEE : JSL IncrementDamageTakenCounter_Eight ; overworld pit
org $079506 : JSL IncrementDamageTakenCounter_Eight ; underworld pit
org $0780C6 : JSL IncrementDamageTakenCounter_Arb
org $07B0B1 : JSL IncrementMagicUseCounter
;================================================================================
; Boss icons
org $0AEEDF : db $02 ; big icon
org $0AEAFF : db $48 ; X position
org $0AEED4 ; disable flashing
BRA ++ : NOP #6 : ++
org $0AEEF2
SBC.b #$03 : STA.w $0801,X
LDA.b #$03 : STA.w $0802,X
LDA.b #$31 : STA.w $0803,X
org $008BE5 ; hijack stripes for boss GFX transfer
JSL DoDungeonMapBossIcon
;================================================================================
; Terrorpin AI fix
;--------------------------------------------------------------------------------
@@ -2718,4 +2792,3 @@ org $1EB2B1 ; sprite_terrorpin.asm(57) : AND.b #$03 : STA $0DE0, X ; 5 bytes
JSL FixTerrorpin ; 4 bytes
NOP ; 1 byte
;--------------------------------------------------------------------------------

View File

@@ -41,7 +41,12 @@ Init_Primary:
CPX #$15 : !BLT -
.done
REP #$20
LDA.l OneMindTimer : STA.l !ONEMIND_TIMER
SEP #$20
LDA.b #$01 : STA $420D ; enable fastrom access on upper banks
STA.l !ONEMIND_ID
LDA.b #$10 : STA $BC ; set default player sprite bank

View File

@@ -23,7 +23,7 @@
; -
; -
; -
; -
; q = quickswap lock
;--------------------------------------------------------------------------------
; ProcessMenuButtons:
; out: Carry - 0 = No Button, 1 = Yes Button

View File

@@ -134,6 +134,48 @@ SEP #$30
;--------------------------------------------------------------------------------
; Draw pendant/crystal icon
;--------------------------------------------------------------------------------
!PRIZE_ICON = $7EC742
!P_ICON = $296C
!C_ICON = $295F
SEP #$20
LDA.b $1B : BEQ .noprize
LDX.w $040C : BMI .noprize
REP #$20
LDA.l MapMode
BEQ .drawprize
LDA.l $7EF368
AND.l DungeonItemMasks,X
BEQ .doneprize
.drawprize
LDA.l CrystalPendantFlags_2, X
AND.w #$0040 : BNE .is_crystal
LDA.w #!P_ICON
BRA .doneprize
.is_crystal
LDA.w #!C_ICON
BRA .doneprize
.noprize
REP #$20
LDA.w #$207F
.doneprize
STA.l !PRIZE_ICON
;--------------------------------------------------------------------------------
; Draw Magic Meter
!INFINITE_MAGIC = "$7F50CA"

View File

@@ -28,6 +28,7 @@ QuickSwap:
BRA .store
.special_swap
LDA !INVENTORY_SWAP_2 : ORA #$01 : STA !INVENTORY_SWAP_2
CPX.b #$02 : BEQ + ; boomerang
CPX.b #$01 : BEQ + ; bow
CPX.b #$05 : BEQ + ; powder
@@ -47,22 +48,14 @@ QuickSwap:
LDA.b $F6 : AND.b #$40 ;what we wrote over
RTL
RCode:
LDA.w $0202 : TAX
LDX.w $0202
LDA.b $F2 : BIT #$20 : BNE ++ ; Still holding L from a previous frame
LDA !INVENTORY_SWAP_2 : AND #$FE : STA !INVENTORY_SWAP_2
BRA +
++
LDA !INVENTORY_SWAP_2 : BIT #$01 : BEQ +
RTS
-
; CPX.b #$0F : BNE + ; incrementing into bottle
; LDX.b #$00 : BRA ++
; + CPX.b #$10 : BNE + ; incrementing bottle
; LDA.l $7EF34F : TAX
; -- : ++
; CPX.b #$04 : BEQ .noMoreBottles
; INX
; LDA.l $7EF35B,X : BEQ --
; TXA : STA.l $7EF34F
; LDX #$10
; RTS
; .noMoreBottles
; LDX #$11
; BRA .nextItem
+ CPX.b #$14 : BNE + : LDX.b #$00 ;will wrap around to 1
+ INX
.nextItem
@@ -70,21 +63,14 @@ RCode:
RTS
LCode:
LDA.w $0202 : TAX
LDX.w $0202
LDA.b $F2 : BIT #$10 : BNE ++ ; Still holding R from a previous frame
LDA !INVENTORY_SWAP_2 : AND #$FE : STA !INVENTORY_SWAP_2
BRA +
++
LDA !INVENTORY_SWAP_2 : BIT #$01 : BEQ +
RTS
-
; CPX.b #$11 : BNE + ; decrementing into bottle
; LDX.b #$05 : BRA ++
; + CPX.b #$10 : BNE + ; decrementing bottle
; LDA.l $7EF34F : TAX
; -- : ++
; CPX.b #$01 : BEQ .noMoreBottles
; DEX
; LDA.l $7EF35B,X : BEQ --
; TXA : STA.l $7EF34F
; LDX.b #$10
; RTS
; .noMoreBottles
; LDX.b #$0F : BRA .nextItem
+ CPX.b #$01 : BNE + : LDX.b #$15 ; will wrap around to $14
+ DEX
.nextItem

View File

@@ -74,15 +74,15 @@ macro DrawBombosPlatform(roomX, roomY, quadX, quadY)
endMacro
IcePalaceBombosSE:
LDA AllowSwordlessMedallionUse : BNE + : RTL : +
LDA AllowSwordlessMedallionUse : CMP #$01 : BEQ + : RTL : +
%DrawBombosPlatform(14, 18, 1, 1)
RTL
IcePalaceBombosSW:
LDA AllowSwordlessMedallionUse : BNE + : RTL : +
LDA AllowSwordlessMedallionUse : CMP #$01 : BEQ + : RTL : +
%DrawBombosPlatform(14, 18, 0, 1)
RTL
IcePalaceBombosNE:
LDA AllowSwordlessMedallionUse : BNE + : RTL : +
LDA AllowSwordlessMedallionUse : CMP #$01 : BEQ + : RTL : +
%DrawBombosPlatform(14, 18, 1, 0)
RTL

View File

@@ -1,7 +1,7 @@
;================================================================================
; Stat Tracking
;================================================================================
; $7EF420 - $7EF466 - Stat Tracking
; $7EF420 - $7EF468 - Stat Tracking
;--------------------------------------------------------------------------------
; $7EF420 - bonk counter
;--------------------------------------------------------------------------------
@@ -108,7 +108,7 @@
;--------------------------------------------------------------------------------
; $7EF466w[2] - mirror timestamp (high)
;--------------------------------------------------------------------------------
; $7EF468w[2] - locations before mirror
; $7EF468 - chest turn counter
;--------------------------------------------------------------------------------
; $7EF46A mmkkkkkk
; m - mail counter
@@ -139,24 +139,16 @@
; 7EF4FEw[2] - Save Checksum
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
!LOCK_STATS = "$7EF443"
;--------------------------------------------------------------------------------
!BONK_COUNTER = "$7EF420"
!BONK_REPEAT = "$7F503F"
!LOOP_FRAMES_LOW = "$7EF42E"
StatBonkCounter:
PHA
IncrementBonkCounter:
LDA !LOCK_STATS : BNE +
LDA !LOOP_FRAMES_LOW : !SUB !BONK_REPEAT : CMP #30 : !BLT +
LDA !LOOP_FRAMES_LOW : STA !BONK_REPEAT
LDA !BONK_COUNTER : INC
CMP.b #100 : BEQ + ; decimal 100
STA !BONK_COUNTER
+
PLA
JSL.l AddDashTremor ; thing we wrote over
RTL
;--------------------------------------------------------------------------------
!SAVE_COUNTER = "$7EF42D"
@@ -269,7 +261,7 @@ CountChestKey: ; called by neighbor functions
CPY #$24 : BEQ + ; small key for this dungeon - use $040C
CPY #$A0 : !BLT .end ; Ignore most items
CPY #$AE : !BGE .end ; Ignore reserved key and generic key
TYA : AND.B #$0F : BNE ++ ; If this is a sewers key, instead count it as an HC key
TYA : AND.B #$0F : BNE ++ ; If this is an HC key, instead count it as a sewers key
INC
++ TAX : BRA .count ; use Key id instead of $040C (Keysanity)
+ LDA $040C : LSR
@@ -326,6 +318,15 @@ IncrementFairyRevivalCounter:
PLA
RTL
;--------------------------------------------------------------------------------
!CHESTTURN_COUNTER = "$7EF468"
IncrementChestTurnCounter:
PHA
LDA !LOCK_STATS : BNE +
LDA !CHESTTURN_COUNTER : INC : STA !CHESTTURN_COUNTER
+
PLA
RTL
;--------------------------------------------------------------------------------
!CHEST_COUNTER = "$7EF442"
IncrementChestCounter:
LDA.b #$01 : STA $02E9 ; thing we wrote over
@@ -364,6 +365,66 @@ IncrementBigChestCounter:
+
PLA
RTL
;--------------------------------------------------------------------------------
!DAMAGE_COUNTER = $7EF46A
!MAGIC_COUNTER = $7EF46C
IncrementDamageTakenCounter_Eight:
STA.l $7EF36D
PHA : PHP
LDA !LOCK_STATS : BNE +
REP #$21
LDA.l !DAMAGE_COUNTER
ADC.w #$0008
BCC ++
LDA.w #$FFFF
++ STA.l !DAMAGE_COUNTER
+ PLP
PLA
RTL
IncrementDamageTakenCounter_Arb:
PHP
LDA !LOCK_STATS : BNE +
REP #$21
LDA.b $00
AND.w #$00FF
ADC.l !DAMAGE_COUNTER
BCC ++
LDA.w #$FFFF
++ STA.l !DAMAGE_COUNTER
+ PLP
LDA.l $7EF36D
RTL
IncrementMagicUseCounter:
STA.l $7EF36E
IncrementMagicUseCounterByrna:
PHA : PHP
LDA !LOCK_STATS : BNE +
REP #$21
LDA.b $00
AND.w #$00FF
ADC.l !MAGIC_COUNTER
BCC ++
LDA.w #$FFFF
++ STA.l !MAGIC_COUNTER
+ PLP : PLA
RTL
IncrementMagicUseCounterOne:
LDA !LOCK_STATS : BNE +
REP #$20
LDA.l !MAGIC_COUNTER
INC
BEQ ++
STA.l !MAGIC_COUNTER
++ SEP #$20
+ LDA.l $7EF36E
RTL
;--------------------------------------------------------------------------------
!OW_MIRROR_COUNTER = "$7EF43A"
IncrementOWMirror:

View File

@@ -564,7 +564,7 @@ CreditsLineBlank:
;===================================================================================================
print "Line number: !CLINE | Expected: 302"
print "Credits line number: !CLINE | Expected: 302"
if !CLINE > 302
error "Too many credits lines. !CLINE > 302"
@@ -640,8 +640,11 @@ endif
%blankline()
%blankline()
print "GT Big Key Credit Start: ", pc
%bigcreditsleft("GT BIG KEY /22")
%bigcreditsleft("DAMAGE TAKEN")
%blankline()
%bigcreditsleft("MAGIC USED")
%blankline()
@@ -685,9 +688,6 @@ print "GT Big Key Credit Start: ", pc
%blankline()
%emptyline()
%emptyline()
%emptyline()
%emptyline()
%emptyline()
print "Collection Rate Credit Start: ", pc
@@ -726,20 +726,22 @@ print "Collection Rate Credit Start: ", pc
!TEMPERED_SWORD_Y = 336
!GOLD_SWORD_X = 23
!GOLD_SWORD_Y = 339
!GT_BIG_KEY_X = 23
!GT_BIG_KEY_Y = 346
!DAMAGETAKEN_X = 26
!DAMAGETAKEN_Y = 346
!MAGICUSED_X = 26
!MAGICUSED_Y = 349
!BONKS_X = 26
!BONKS_Y = 349
!BONKS_Y = 352
!SAVE_AND_QUITS_X = 26
!SAVE_AND_QUITS_Y = 352
!SAVE_AND_QUITS_Y = 355
!DEATHS_X = 26
!DEATHS_Y = 355
!DEATHS_Y = 358
!FAERIE_REVIVALS_X = 26
!FAERIE_REVIVALS_Y = 358
!FAERIE_REVIVALS_Y = 361
!TOTAL_MENU_TIME_X = 19
!TOTAL_MENU_TIME_Y = 361
!TOTAL_MENU_TIME_Y = 364
!TOTAL_LAG_TIME_X = 19
!TOTAL_LAG_TIME_Y = 364
!TOTAL_LAG_TIME_Y = 367
!COLLECTION_RATE_X = 22
!COLLECTION_RATE_Y = 380
!TOTAL_TIME_X = 19

View File

@@ -60,6 +60,7 @@ ValueCaps:
dw 99
dw 999
dw 9999
dw 9999 ; TODO - 5 digits need to be fixed at a later date
BitMasks:
dw $FFFF

View File

@@ -9,7 +9,8 @@
%AddStat($7EF425, 0, 0, 04, 2, !MASTER_SWORD_X, !MASTER_SWORD_Y)
%AddStat($7EF426, 0, 4, 04, 2, !TEMPERED_SWORD_X, !TEMPERED_SWORD_Y)
%AddStat($7EF426, 0, 0, 04, 2, !GOLD_SWORD_X, !GOLD_SWORD_Y)
%AddStat($7EF42A, 0, 0, 05, 2, !GT_BIG_KEY_X, !GT_BIG_KEY_Y)
%AddStat($7EF46A, 0, 0, 16, 5, !DAMAGETAKEN_X, !DAMAGETAKEN_Y)
%AddStat($7EF46C, 0, 0, 16, 5, !MAGICUSED_X, !MAGICUSED_Y)
%AddStat($7EF420, 0, 0, 08, 3, !BONKS_X, !BONKS_Y)
%AddStat($7EF42D, 0, 0, 08, 2, !SAVE_AND_QUITS_X, !SAVE_AND_QUITS_Y)
%AddStat($7EF449, 0, 0, 08, 2, !DEATHS_X, !DEATHS_Y)

View File

@@ -166,50 +166,68 @@ GetSmithSword:
JML.l Smithy_AlreadyGotSword
;================================================================================
CheckMedallionSword:
LDA.l AllowSwordlessMedallionUse : BEQ .check_sword
CMP #$01 : BEQ .check_pad
LDA.b #$02 ; Pretend we have master sword
RTL
.check_sword
LDA $7EF359
RTL
.check_pad
PHB : PHX : PHY
LDA.l AllowSwordlessMedallionUse : BNE +++ : JMP + : +++
LDA $1B : BEQ .outdoors
.indoors
REP #$20 ; set 16-bit accumulator
LDA $A0 ; load room ID
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
CMP.w #$000E : BNE + ; freezor1
LDA $22 : AND.w #$01FF ; check x-coord
CMP.w #368-8 : !BLT .normal
CMP.w #368+32-8 : !BGE .normal
LDA $20 : AND.w #$01FF ; check y-coord
CMP.w #400-22 : !BLT .normal
CMP.w #400+32-22 : !BGE .normal
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
+ : CMP.w #$007E : BNE + ; freezor2
LDA $22 : AND.w #$01FF ; check x-coord
CMP.w #112-8 : !BLT .normal
CMP.w #112+32-8 : !BGE .normal
LDA $20 : AND.w #$01FF ; check y-coord
CMP.w #400-22 : !BLT .normal
CMP.w #400+32-22 : !BGE .normal
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
+ : CMP.w #$00DE : BNE + ; kholdstare
LDA $22 : AND.w #$01FF ; check x-coord
CMP.w #368-8 : !BLT .normal
CMP.w #368+32-8 : !BGE .normal
LDA $20 : AND.w #$01FF ; check y-coord
CMP.w #144-22 : !BLT .normal
CMP.w #144+32-22 : !BGE .normal
BRA .permit
++ : .normal
+ : .normal
SEP #$20 ; set 8-bit accumulator
BRA .done
.outdoors
LDA $8A : CMP.b #$70 : BNE ++
LDA.l MireRequiredMedallion : TAX : LDA.l .medallion_type, X : CMP $0303 : BNE +
LDA $7EF2F0 : AND.b #$20 : BNE +
LDA $8A : CMP.b #$70 : BNE +
LDA.l MireRequiredMedallion : TAX : LDA.l .medallion_type, X : CMP $0303 : BNE .done
LDA $7EF2F0 : AND.b #$20 : BNE .done
LDA.b #$08 : PHA : PLB ; set data bank to $08
LDY.b #$02 : JSL.l Ancilla_CheckIfEntranceTriggered : BCS .permit ; misery mire
BRA +
++ : CMP.b #$47 : BNE ++
LDA.l TRockRequiredMedallion : TAX : LDA.l .medallion_type, X : CMP $0303 : BNE +
LDA $7EF2C7 : AND.b #$20 : BNE +
BRA .done
+ : CMP.b #$47 : BNE +
LDA.l TRockRequiredMedallion : TAX : LDA.l .medallion_type, X : CMP $0303 : BNE .done
LDA $7EF2C7 : AND.b #$20 : BNE .done
LDA.b #$08 : PHA : PLB ; set data bank to $08
LDY.b #$03 : JSL.l Ancilla_CheckIfEntranceTriggered : BCS .permit ; turtle rock
++
.done
+
.done
PLY : PLX : PLB
LDA $7EF359
RTL
RTL
.permit
SEP #$20 ; set 8-bit accumulator
PLY : PLX : PLB
LDA.b #$02 ; Pretend we have master sword
RTL
RTL
.medallion_type
db #$0F, #$10, #$11
;================================================================================

View File

@@ -167,7 +167,7 @@ db #$00 ; #$00 = Off (default) - #$01 = On
;--------------------------------------------------------------------------------
org $308041 ; PC 0x180041
AllowSwordlessMedallionUse:
db #$00 ; #$00 = Off (default) - #$01 = Medallion Pads - #$02 = Always (Not Implemented)
db #$00 ; #$00 = Off (default) - #$01 = Medallion Pads - #$02 = Always
;--------------------------------------------------------------------------------
org $308042 ; PC 0x180042
PermitSQFromBosses:
@@ -388,7 +388,11 @@ org $30808D ; PC 0x18008D
InstantPostAgaWorldState:
db $00 ; #$00 = Off (default) - #$01 = On
;--------------------------------------------------------------------------------
; 0x18008E - 0x18008F (unused)
org $30808E ; PC 0x18008E
FakeBoots:
db $00 ; #$00 = Off (default) - #$01 = On
;--------------------------------------------------------------------------------
; 0x18008F (unused)
;--------------------------------------------------------------------------------
org $308090 ; PC 0x180090 - 0x180097
ProgressiveSwordLimit:
@@ -412,7 +416,25 @@ db #$02 ; #$02 - 2 Bows (default)
ProgressiveBowReplacement:
db #$47 ; #$47 - 20 Rupees (default)
;--------------------------------------------------------------------------------
; 0x18009A - 0x18009F (unused)
; 0x18009A - 0x18009C one mind
;--------------------------------------------------------------------------------
org $30809A ; PC 0x18009A
OneMindPlayerCount:
db 0
org $30809B ; PC 0x18009B - 0x18009C
OneMindTimer:
dw 0
;--------------------------------------------------------------------------------
; 0x18009D - Dungeon map icons
; .... ...b
;
; b - boss icon
;--------------------------------------------------------------------------------
org $30809D
DungeonMapIcons:
db $01
;--------------------------------------------------------------------------------
; 0x18009E - 0x18009F (unused)
;--------------------------------------------------------------------------------
org $3080A0 ; PC 0x1800A0 - 0x1800A4
Bugfix_MirrorlessSQToLW:
@@ -1471,7 +1493,7 @@ dw #9999 ; Rupee Limit
; $7F503C - Stats Rupee Total
; $7F503D - Stats Rupee Total
; $7F503E - Stats Item Total
; $7F503F - Bonk Repeat
; $7F503F - Unused
; $7F5040 - Free Item Dialog Temporary
; $7F5041 - Epilepsy Safety Timer
; $7F5042 - Tile Upload Offset Override (Low)
@@ -1481,7 +1503,9 @@ dw #9999 ; Rupee Limit
; $7F504F - $7F506F - Shop Block
; $7F5070 - Reserved for OneMind
; $7F5071 - Reserved for OneMind
; $7F5072 - $7F507D - Unused
; $7F5072 - OneMind player ID
; $7F5073 - $7F5074 - OneMind timer
; $7F5075 - $7F507D - Unused
; $7F507E - Clock Status
; $7F507F - Always Zero
; $7F5080 - $7F5083 - Clock Hours

View File

@@ -240,7 +240,12 @@ RTL
+ ; Everything Else
LDA.b #$08 : RTL
++ : CMP.b #$F8 : BNE ++ ; Progressive Bow
LDA $7EF354 : BNE + ; No Bow
LDA $7EF340 : INC : LSR
CMP.l ProgressiveBowLimit : !BLT +
LDA.l ProgressiveBowReplacement
JSL.l GetSpritePalette
RTL
+ : CMP.b #$00 : BNE + ; No Bow
LDA.b #$08 : RTL
+ ; Any Bow
LDA.b #$02 : RTL