This commit is contained in:
Kat
2020-02-13 21:35:58 -05:00
parent b9e2bb3e23
commit f14657ae05
3 changed files with 84 additions and 19 deletions

View File

@@ -32,15 +32,22 @@
; #$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 F0 (Hearts / Powder / Mushroom / Bonkable)
; #$6E - Server Request (Dungeon Drop) ; #$6E - Server Request F1 (Hearts / Boss Heart / NPC)
; #$6F - Server Request F2 (Tablets / Pedestal)
; #$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) ; #$FE - Server Request (Asychronous Chest)
; #$FF - Null Chest ; #$FF - Null Chest
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; Service Indexes
; 0x00 - 0x04 - chests
; 0xF0 - freestanding heart / powder / mushroom / bonkable
; 0xF1 - freestanding heart 2 / boss heart / npc
; 0xF3 - tablet/pedestal
;--------------------------------------------------------------------------------
;GetAnimatedSpriteGfxFile: ;GetAnimatedSpriteGfxFile:
; LDY.b #$32 ; LDY.b #$32
; CMP.b #$39 : BCS + ; If tile index >= 0x39, use sprite file 0x32 (Blank file) ; CMP.b #$39 : BCS + ; If tile index >= 0x39, use sprite file 0x32 (Blank file)
@@ -320,15 +327,18 @@ AddReceivedItemExpandedGetItem:
JSL.l ActivateGoal JSL.l ActivateGoal
++ ++
BRL .done BRL .done
+ CMP.b #$6D : BNE + ; Server Request + CMP.b #$6D : BNE + ; Server Request F0
JSL ItemGetServiceRequest JSL.l ItemGetServiceRequest_F0
BRL .done
+ CMP.b #$6E : BNE + ; Server Request F1
JSL.l ItemGetServiceRequest_F1
BRL .done
+ CMP.b #$6F : BNE + ; Server Request F2
JSL.l ItemGetServiceRequest_F2
BRL .done BRL .done
;+ CMP.b #$FE : BNE + ; Server Request (Null Chest) ;+ CMP.b #$FE : BNE + ; Server Request (Null Chest)
; JSL ItemGetServiceRequest ; JSL.l ItemGetServiceRequest
; BRL .done ; BRL .done
+ CMP.b #$6E : BNE + ; Server Request (Dungeon Drop)
JSL ItemGetServiceRequest
BRL .done
+ CMP.b #$70 : !BLT + : CMP.b #$80 : !BGE + ; Free Map + CMP.b #$70 : !BLT + : CMP.b #$80 : !BGE + ; Free Map
AND #$0F : CMP #$08 : !BGE ++ AND #$0F : CMP #$08 : !BGE ++
%ValueShift() %ValueShift()
@@ -494,9 +504,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) ; ++ : CMP.b #$FE : BNE ++ ; Server Request (Null Chest)
JSL ItemGetServiceRequest ; JSL ChestItemServiceRequest
BRA .done ; 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

View File

@@ -14,6 +14,12 @@
; #$01 - Ready to Read ; #$01 - Ready to Read
; #$FF - Busy ; #$FF - Busy
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; Service Indexes
; 0x00 - 0x04 - chests
; 0xF0 - freestanding heart / powder / mushroom / bonkable
; 0xF1 - freestanding heart 2 / boss heart / npc
; 0xF2 - tablet/pedestal
;--------------------------------------------------------------------------------
; Block Commands ; Block Commands
!SCM_WAIT = "#$00" !SCM_WAIT = "#$00"
@@ -69,7 +75,7 @@ PollService:
CLC ; mark request as successful CLC ; mark request as successful
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
macro ServiceRequest(type) macro ServiceRequestChest(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
BEQ + BEQ +
@@ -87,10 +93,42 @@ macro ServiceRequest(type)
RTL RTL
endmacro endmacro
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
ItemVisualServiceRequest: macro ServiceRequest(type,index)
%ServiceRequest(!SCM_SEEN) 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
BRA ++
+
LDA $040A : STA !TX_BUFFER+9 ; area id
LDA.b #$00 : STA !TX_BUFFER+10 ; protocol defines this as a ushort
++
LDA <index> : 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
RTL
endmacro
;--------------------------------------------------------------------------------
ItemVisualServiceRequest_F0:
%ServiceRequest(!SCM_SEEN, #$F0)
;--------------------------------------------------------------------------------
ItemVisualServiceRequest_F1:
%ServiceRequest(!SCM_SEEN, #$F1)
;--------------------------------------------------------------------------------
ItemVisualServiceRequest_F2:
%ServiceRequest(!SCM_SEEN, #$F2)
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
ChestItemServiceRequest: ChestItemServiceRequest:
ItemGetServiceRequest: %ServiceRequestChest(!SCM_GET)
%ServiceRequest(!SCM_GET) ;--------------------------------------------------------------------------------
ItemGetServiceRequest_F0:
%ServiceRequest(!SCM_GET, #$F0)
;--------------------------------------------------------------------------------
ItemGetServiceRequest_F1:
%ServiceRequest(!SCM_GET, #$F1)
;--------------------------------------------------------------------------------
ItemGetServiceRequest_F2:
%ServiceRequest(!SCM_GET, #$F2)
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------

View File

@@ -16,14 +16,31 @@ GetSpriteID:
CMP.b #$3C : BEQ .bottle ; Bee w/bottle CMP.b #$3C : BEQ .bottle ; Bee w/bottle
CMP.b #$3D : BEQ .bottle ; Fairy w/bottle CMP.b #$3D : BEQ .bottle ; Fairy w/bottle
CMP.b #$48 : BEQ .bottle ; Gold Bee w/bottle CMP.b #$48 : BEQ .bottle ; Gold Bee w/bottle
BRA .notBottle CMP.b #$6D : BEQ .server ; Server Request F0
CMP.b #$6E : BEQ .server ; Server Request F1
CMP.b #$6F : BEQ .server ; Server Request F2
BRA .normal
.bottle .bottle
PHA : JSR.w CountBottles : CMP.l BottleLimit : !BLT + PHA : JSR.w CountBottles : CMP.l BottleLimit : !BLT +
PLA : LDA.l BottleLimitReplacement PLA : LDA.l BottleLimitReplacement
JSL.l GetSpriteID JSL.l GetSpriteID
RTL RTL
+ +
PLA : .notBottle PLA : BRA .normal
.server_F0
ItemVisualServiceRequest_F0
LDA.b #$14
RTL
.server_F1
ItemVisualServiceRequest_F1
LDA.b #$14
RTL
.server_F2
ItemVisualServiceRequest_F2
LDA.b #$14
RTL
.normal
PHX PHX
PHB : PHK : PLB PHB : PHK : PLB
;-------- ;--------