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 del ..\working.sfc
copy ..\alttp.sfc ..\working.sfc copy ..\alttp.sfc ..\working.sfc
xkas.exe LTTP_RND_GeneralBugfixes.asm ..\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 ; New Items
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $07B57B ; <- 3B57B - Bank07.asm : 8523 (BMI .cantOpen) ;org $07B57B ; <- 3B57B - Bank07.asm : 8523 (BMI .cantOpen)
NOP #2 ;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) org $00D531 ; 5531 - Bank00.asm:3451 (LDY.b #$5D)
JML.l GetAnimatedSpriteGfxFile JML.l GetAnimatedSpriteGfxFile

View File

@@ -32,12 +32,14 @@
; #$6A - Goal Item (Single/Triforce) ; #$6A - Goal Item (Single/Triforce)
; #$6B - Goal Item (Multi/Power Star) ; #$6B - Goal Item (Multi/Power Star)
; #$6C - Goal Item (Multi/Triforce Piece) ; #$6C - Goal Item (Multi/Triforce Piece)
; #$6D- Server Request ; #$6D - Server Request
; #$6E - Server Request (Dungeon Drop) ; #$6E - Server Request (Dungeon Drop)
; #$70 - Maps ; #$70 - Maps
; #$80 - Compasses ; #$80 - Compasses
; #$90 - Big Keys ; #$90 - Big Keys
; #$A0 - Small Keys ; #$A0 - Small Keys
; #$FE - Server Request (Null Chest)
; #$FF - Null Chest
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
;GetAnimatedSpriteGfxFile: ;GetAnimatedSpriteGfxFile:
; LDY.b #$32 ; LDY.b #$32
@@ -321,6 +323,9 @@ AddReceivedItemExpandedGetItem:
+ CMP.b #$6D : BNE + ; Server Request + CMP.b #$6D : BNE + ; Server Request
JSL ItemGetServiceRequest JSL ItemGetServiceRequest
BRL .done BRL .done
;+ CMP.b #$FE : BNE + ; Server Request (Null Chest)
; JSL ItemGetServiceRequest
; BRL .done
+ CMP.b #$6E : BNE + ; Server Request (Dungeon Drop) + CMP.b #$6E : BNE + ; Server Request (Dungeon Drop)
JSL ItemGetServiceRequest JSL ItemGetServiceRequest
BRL .done BRL .done
@@ -473,7 +478,7 @@ AddReceivedItemExpanded:
+ : CMP.b #$00 : BNE + ; No Armor + : CMP.b #$00 : BNE + ; No Armor
LDA.b #$22 : STA $02D8 : BRL .done LDA.b #$22 : STA $02D8 : BRL .done
+ ; Everything Else + ; Everything Else
LDA.b #$23 : STA $02D8 : BRA .done LDA.b #$23 : STA $02D8 : BRL .done
++ : CMP.b #$61 : BNE ++ ; Progressive Lifting Glove ++ : CMP.b #$61 : BNE ++ ; Progressive Lifting Glove
LDA $7EF354 : BNE + ; No Lift LDA $7EF354 : BNE + ; No Lift
LDA.b #$1B : STA $02D8 : BRA .done LDA.b #$1B : STA $02D8 : BRA .done
@@ -489,6 +494,9 @@ AddReceivedItemExpanded:
++ : CMP.b #$65 : BNE ++ ; Progressive Bow 2 ++ : CMP.b #$65 : BNE ++ ; Progressive Bow 2
LDA.l !INVENTORY_SWAP_2 : ORA #$20 : STA.l !INVENTORY_SWAP_2 LDA.l !INVENTORY_SWAP_2 : ORA #$20 : STA.l !INVENTORY_SWAP_2
BRA -- BRA --
++ : CMP.b #$FE : BNE ++ ; Server Request (Null Chest)
JSL ItemGetServiceRequest
BRA .done
++ : CMP.b #$62 : BNE ++ ; RNG Item (Single) ++ : CMP.b #$62 : BNE ++ ; RNG Item (Single)
JSL.l GetRNGItemSingle : STA $02D8 JSL.l GetRNGItemSingle : STA $02D8
XBA : JSR.w MarkRNGItemSingle XBA : JSR.w MarkRNGItemSingle
@@ -1071,7 +1079,6 @@ AttemptItemSubstitution:
CMP.l ItemSubstitutionRules+1, X : !BLT + CMP.l ItemSubstitutionRules+1, X : !BLT +
LDA.l ItemSubstitutionRules+2, X : STA 1,s LDA.l ItemSubstitutionRules+2, X : STA 1,s
+ +
BEQ .exit BEQ .exit
.noMatch .noMatch
INX #4 INX #4
@@ -1095,3 +1102,12 @@ ActivateGoal:
STZ $B0 STZ $B0
JML.l StatsFinalPrep 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) macro ServiceRequest(type)
LDA !TX_STATUS : BEQ + : SEC : RTL : + ; return fail if we don't have the lock LDA !TX_STATUS : BEQ + : SEC : RTL : + ; return fail if we don't have the lock
LDA $1B : STA !TX_BUFFER+8 ; indoor/outdoor LDA $1B : STA !TX_BUFFER+8 ; indoor/outdoor
LDA $A0 : STA !TX_BUFFER+9 ; roomid low BEQ +
LDA $A1 : STA !TX_BUFFER+10 ; roomid high LDA $A0 : STA !TX_BUFFER+9 ; roomid low
LDA $76 : STA !TX_BUFFER+11 ; object index (type 2 only) LDA $A1 : STA !TX_BUFFER+10 ; roomid high
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 <type> : STA !TX_BUFFER ; item get
LDA #$01 : STA !TX_STATUS ; mark ready for reading LDA #$01 : STA !TX_STATUS ; mark ready for reading
CLC ; mark request as successful CLC ; mark request as successful
@@ -84,6 +90,7 @@ endmacro
ItemVisualServiceRequest: ItemVisualServiceRequest:
%ServiceRequest(!SCM_SEEN) %ServiceRequest(!SCM_SEEN)
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
ChestItemServiceRequest:
ItemGetServiceRequest: ItemGetServiceRequest:
%ServiceRequest(!SCM_GET) %ServiceRequest(!SCM_GET)
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------