This commit is contained in:
Kat
2020-02-07 15:06:25 -05:00
parent c1628dcb0e
commit b9e2bb3e23
4 changed files with 37 additions and 8 deletions

View File

@@ -1,3 +1,4 @@
del ..\working.sfc
copy ..\alttp.sfc ..\working.sfc
xkas.exe LTTP_RND_GeneralBugfixes.asm ..\working.sfc
cmd /k

View File

@@ -803,8 +803,13 @@ db $03 ; fade out speed. Should be power of 2 minus 1
;================================================================================
; New Items
;--------------------------------------------------------------------------------
org $07B57B ; <- 3B57B - Bank07.asm : 8523 (BMI .cantOpen)
NOP #2
;org $07B57B ; <- 3B57B - Bank07.asm : 8523 (BMI .cantOpen)
;NOP #2
;--------------------------------------------------------------------------------
org $07B574 ; <- 3B574 - Bank07.asm : 8523 (BMI .cantOpen)
JSL.l ChestPrep
NOP #3
db $90 ; !BLT .cantOpen
;--------------------------------------------------------------------------------
org $00D531 ; 5531 - Bank00.asm:3451 (LDY.b #$5D)
JML.l GetAnimatedSpriteGfxFile

View File

@@ -32,12 +32,14 @@
; #$6A - Goal Item (Single/Triforce)
; #$6B - Goal Item (Multi/Power Star)
; #$6C - Goal Item (Multi/Triforce Piece)
; #$6D- Server Request
; #$6D - Server Request
; #$6E - Server Request (Dungeon Drop)
; #$70 - Maps
; #$80 - Compasses
; #$90 - Big Keys
; #$A0 - Small Keys
; #$FE - Server Request (Null Chest)
; #$FF - Null Chest
;--------------------------------------------------------------------------------
;GetAnimatedSpriteGfxFile:
; LDY.b #$32
@@ -321,6 +323,9 @@ AddReceivedItemExpandedGetItem:
+ CMP.b #$6D : BNE + ; Server Request
JSL ItemGetServiceRequest
BRL .done
;+ CMP.b #$FE : BNE + ; Server Request (Null Chest)
; JSL ItemGetServiceRequest
; BRL .done
+ CMP.b #$6E : BNE + ; Server Request (Dungeon Drop)
JSL ItemGetServiceRequest
BRL .done
@@ -473,7 +478,7 @@ AddReceivedItemExpanded:
+ : CMP.b #$00 : BNE + ; No Armor
LDA.b #$22 : STA $02D8 : BRL .done
+ ; Everything Else
LDA.b #$23 : STA $02D8 : BRA .done
LDA.b #$23 : STA $02D8 : BRL .done
++ : CMP.b #$61 : BNE ++ ; Progressive Lifting Glove
LDA $7EF354 : BNE + ; No Lift
LDA.b #$1B : STA $02D8 : BRA .done
@@ -489,6 +494,9 @@ AddReceivedItemExpanded:
++ : CMP.b #$65 : BNE ++ ; Progressive Bow 2
LDA.l !INVENTORY_SWAP_2 : ORA #$20 : STA.l !INVENTORY_SWAP_2
BRA --
++ : CMP.b #$FE : BNE ++ ; Server Request (Null Chest)
JSL ItemGetServiceRequest
BRA .done
++ : CMP.b #$62 : BNE ++ ; RNG Item (Single)
JSL.l GetRNGItemSingle : STA $02D8
XBA : JSR.w MarkRNGItemSingle
@@ -1071,7 +1079,6 @@ AttemptItemSubstitution:
CMP.l ItemSubstitutionRules+1, X : !BLT +
LDA.l ItemSubstitutionRules+2, X : STA 1,s
+
BEQ .exit
.noMatch
INX #4
@@ -1095,3 +1102,12 @@ ActivateGoal:
STZ $B0
JML.l StatsFinalPrep
;--------------------------------------------------------------------------------
ChestPrep:
LDA.b #$01 : STA $02E9
LDA.l ServerRequestMode : BEQ +
JSL.l ChestItemServiceRequest
+
LDY $0C ; get item value
CMP #$F0
RTL
;--------------------------------------------------------------------------------

View File

@@ -72,9 +72,15 @@ RTL
macro ServiceRequest(type)
LDA !TX_STATUS : BEQ + : SEC : RTL : + ; return fail if we don't have the lock
LDA $1B : STA !TX_BUFFER+8 ; indoor/outdoor
BEQ +
LDA $A0 : STA !TX_BUFFER+9 ; roomid low
LDA $A1 : STA !TX_BUFFER+10 ; roomid high
LDA $76 : STA !TX_BUFFER+11 ; object index (type 2 only)
BRA ++
+
LDA $040A : STA !TX_BUFFER+9 ; area id
LDA.b #$00 : STA !TX_BUFFER+10 ; protocol defines this as a ushort
++
LDA $76 : !SUB #$58 : STA !TX_BUFFER+11 ; object index (type 2 only)
LDA <type> : STA !TX_BUFFER ; item get
LDA #$01 : STA !TX_STATUS ; mark ready for reading
CLC ; mark request as successful
@@ -84,6 +90,7 @@ endmacro
ItemVisualServiceRequest:
%ServiceRequest(!SCM_SEEN)
;--------------------------------------------------------------------------------
ChestItemServiceRequest:
ItemGetServiceRequest:
%ServiceRequest(!SCM_GET)
;--------------------------------------------------------------------------------