multiworld

This commit is contained in:
Bonta-kun
2019-12-09 19:23:01 +01:00
committed by caitsith2
parent ca210ffc05
commit ddd456c04e
17 changed files with 909 additions and 48 deletions

View File

@@ -88,6 +88,17 @@ db #$20, #$19, #$08, #$31 ; year/month/day
;================================================================================ ;================================================================================
!MULTIWORLD_ITEM = "$7EF4D2"
!MULTIWORLD_ITEM_FROM = "$7EF4D3"
!MULTIWORLD_ROOMID = "$7EF4D4"
!MULTIWORLD_ROOMDATA = "$7EF4D6"
!MULTIWORLD_RECEIVING_ITEM = "$7EC057" ; 0 = default | 1 = receiving
!MULTIWORLD_HUD_CHARACTER_DATA = "$7EC058" ; 0x40 bytes
!MULTIWORLD_ITEM_PLAYER_ID = "$7EC098" ; 0 = disabled
!MULTIWORLD_HUD_TIMER = "$7EC099"
!MULTIWORLD_HUD_DELAY = "#120"
!Dungeon_ChestData = "$01E96C"
incsrc hooks.asm incsrc hooks.asm
incsrc treekid.asm incsrc treekid.asm
incsrc spriteswap.asm incsrc spriteswap.asm
@@ -191,11 +202,12 @@ incsrc compasses.asm
incsrc save.asm incsrc save.asm
incsrc password.asm incsrc password.asm
incsrc enemy_adjustments.asm incsrc enemy_adjustments.asm
incsrc hudtext.asm ;incsrc hudtext.asm
incsrc servicerequest.asm incsrc servicerequest.asm
incsrc elder.asm incsrc elder.asm
incsrc toast.asm incsrc toast.asm
incsrc darkroomitems.asm incsrc darkroomitems.asm
incsrc multiworld.asm
warnpc $A58000 warnpc $A58000
;org $228000 ; contrib area ;org $228000 ; contrib area
@@ -207,6 +219,7 @@ incsrc stats/main.asm
org $308000 ; bank #$30 org $308000 ; bank #$30
incsrc tables.asm incsrc tables.asm
warnpc $318000
org $348000 org $348000
incsrc spc.asm incsrc spc.asm
@@ -533,6 +546,9 @@ Sprite_CheckIfPlayerPreoccupied:
org $08C3AE org $08C3AE
Ancilla_ReceiveItem: Ancilla_ReceiveItem:
org $08C505
Ancilla_ReceiveItem_objectFinished:
org $08CE93 org $08CE93
Ancilla_BreakTowerSeal_draw_single_crystal: Ancilla_BreakTowerSeal_draw_single_crystal:
@@ -548,6 +564,12 @@ Ancilla_SetOam_XY_Long:
org $0985E2 ; (break on $0985E4) org $0985E2 ; (break on $0985E4)
AddReceivedItem: AddReceivedItem:
org $098605
AddReceivedItem_notCrystal:
org $098766
AddReceivedItem_gfxHandling:
org $098BAD org $098BAD
AddPendantOrCrystal: AddPendantOrCrystal:

View File

@@ -60,6 +60,19 @@ GiveBonkItem:
LDA.b #$2F : JSL.l Sound_SetSfx3PanLong LDA.b #$2F : JSL.l Sound_SetSfx3PanLong
RTL RTL
.notKey .notKey
PHA
LDA $A0
CMP #115 : BNE + ; Desert Bonk Key
LDA.l BonkKey_Desert_Player
BRA ++
+ : CMP #140 : BNE + ; GTower Bonk Key
LDA.l BonkKey_GTower_Player
BRA ++
+
LDA.b #$00
++
STA !MULTIWORLD_ITEM_PLAYER_ID
PLA
PHY : TAY : JSL.l Link_ReceiveItem : PLY PHY : TAY : JSL.l Link_ReceiveItem : PLY
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------

View File

@@ -23,17 +23,21 @@ DrawThrownItem:
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
MarkThrownItem: MarkThrownItem:
JSL Link_ReceiveItem ; thing we wrote over PHA
LDA $8A : CMP.b #$81 : BNE .catfish LDA $8A : CMP.b #$81 : BNE .catfish
.zora .zora
JSL.l ItemSet_ZoraKing JSL.l ItemSet_ZoraKing
LDA ZoraItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID
BRA .done BRA .done
.catfish .catfish
JSL.l ItemSet_Catfish JSL.l ItemSet_Catfish
LDA CatfishItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID
.done .done
PLA
JSL Link_ReceiveItem ; thing we wrote over
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------

View File

@@ -55,6 +55,7 @@ OnQuit:
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
OnUncleItemGet: OnUncleItemGet:
PHA : LDA UncleItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID : PLA
JSL Link_ReceiveItem JSL Link_ReceiveItem
LDA.l EscapeAssist LDA.l EscapeAssist
@@ -214,6 +215,17 @@ PostItemAnimation:
LDA.b #$00 : STA $7F509F LDA.b #$00 : STA $7F509F
+ +
LDA $1B : BEQ +
REP #$20 : LDA $A0 : STA !MULTIWORLD_ROOMID : SEP #$20
LDA $0403 : STA !MULTIWORLD_ROOMDATA
+
LDA !MULTIWORLD_ITEM_PLAYER_ID : BEQ +
STZ $02E9
LDA #$00 : STA !MULTIWORLD_ITEM_PLAYER_ID
JML.l Ancilla_ReceiveItem_objectFinished
+
STZ $02E9 : LDA $0C5E, X ; thing we wrote over to get here STZ $02E9 : LDA $0C5E, X ; thing we wrote over to get here
RTL JML.l Ancilla_ReceiveItem_optimus+6
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------

View File

@@ -42,8 +42,30 @@ FrameHookAction:
PLP : PLA PLP : PLA
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
!NMI_AUX = "$7F5044"
NMIHookAction: NMIHookAction:
PHA : PHX : PHY : PHD ; thing we wrote over, push stuff PHA : PHX : PHY : PHD ; thing we wrote over, push stuff
LDA !NMI_AUX : BEQ ++
PHP
SEP #$30
LDA #$00 : STA !NMI_AUX
; Multiworld text
LDA !NMI_AUX+1 : BEQ +
LDA #$00 : STA !NMI_AUX+1
JSL.l WriteText
+
; Shops
LDA !NMI_AUX+2 : BEQ +
LDA #$00 : STA !NMI_AUX+2
JSL.l Shopkeeper_UploadVRAMTilesLong
+
PLP
++
LDA !LOCK_STATS : AND.w #$00FF : BNE ++ LDA !LOCK_STATS : AND.w #$00FF : BNE ++
LDA !NMI_FRAMES_LOW : INC : STA !NMI_FRAMES_LOW : BNE + LDA !NMI_FRAMES_LOW : INC : STA !NMI_FRAMES_LOW : BNE +

View File

@@ -6,6 +6,7 @@ GetMagicBatItem:
%GetPossiblyEncryptedItem(MagicBatItem, SpriteItemValues) %GetPossiblyEncryptedItem(MagicBatItem, SpriteItemValues)
CMP.b #$FF : BEQ .normalLogic CMP.b #$FF : BEQ .normalLogic
TAY TAY
PHA : LDA MagicBatItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID : PLA
STZ $02E9 ; 0 = Receiving item from an NPC or message STZ $02E9 ; 0 = Receiving item from an NPC or message
JSL.l Link_ReceiveItem JSL.l Link_ReceiveItem
RTL RTL

View File

@@ -12,9 +12,12 @@ HeartPieceGet:
.skipLoad .skipLoad
JSL.l HeartPieceGetPlayer
STZ $02E9 ; 0 = Receiving item from an NPC or message STZ $02E9 ; 0 = Receiving item from an NPC or message
CPY.b #$26 : BNE .notHeart ; don't add a 1/4 heart if it's not a heart piece CPY.b #$26 : BNE .notHeart ; don't add a 1/4 heart if it's not a heart piece
LDA !MULTIWORLD_ITEM_PLAYER_ID : BNE .notHeart
LDA $7EF36B : INC A : AND.b #$03 : STA $7EF36B : BNE .unfinished_heart ; add up heart quarters LDA $7EF36B : INC A : AND.b #$03 : STA $7EF36B : BNE .unfinished_heart ; add up heart quarters
BRA .giveItem BRA .giveItem
@@ -94,6 +97,7 @@ DrawHeartContainerGFX:
BRA DrawHeartPieceGFX_skipLoad BRA DrawHeartPieceGFX_skipLoad
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
HeartContainerSound: HeartContainerSound:
LDA !MULTIWORLD_ITEM_PLAYER_ID : BNE +
CPY.b #$20 : BEQ + ; Skip for Crystal CPY.b #$20 : BEQ + ; Skip for Crystal
CPY.b #$37 : BEQ + ; Skip for Pendants CPY.b #$37 : BEQ + ; Skip for Pendants
CPY.b #$38 : BEQ + CPY.b #$38 : BEQ +
@@ -107,6 +111,11 @@ HeartContainerSound:
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
NormalItemSkipSound: NormalItemSkipSound:
LDA !MULTIWORLD_ITEM_PLAYER_ID : BEQ +
SEC
RTL
+
LDA $0C5E, X ; thing we wrote over LDA $0C5E, X ; thing we wrote over
CPY.b #$20 : BEQ + ; Skip for Crystal CPY.b #$20 : BEQ + ; Skip for Crystal
@@ -185,7 +194,14 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
!REDRAW = "$7F5000" !REDRAW = "$7F5000"
HPItemReset: HPItemReset:
JSL $09AD58 ; GiveRupeeGift - thing we wrote over PHA
LDA !MULTIWORLD_ITEM_PLAYER_ID : BNE .skip
PLA
JSL $09AD58 ; GiveRupeeGift - thing we wrote over
BRA .done
.skip
PLA
.done
PHA : LDA #$01 : STA !REDRAW : PLA PHA : LDA #$01 : STA !REDRAW : PLA
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -425,3 +441,130 @@ RTL
;JSL $00D51B ; GetAnimatedSpriteTile ;JSL $00D51B ; GetAnimatedSpriteTile
;JSL $00D52D ; GetAnimatedSpriteTile.variable ;JSL $00D52D ; GetAnimatedSpriteTile.variable
;================================================================================ ;================================================================================
HeartPieceGetPlayer:
{
PHY
LDA $1B : BNE +
BRL .outdoors
+
PHP
REP #$20 ; set 16-bit accumulator
LDA $A0 ; these are all decimal because i got them that way
CMP.w #135 : BNE +
LDA StandingKey_Hera_Player
BRL .done
+ CMP.w #200 : BNE +
LDA HeartContainer_ArmosKnights_Player
BRL .done
+ CMP.w #51 : BNE +
LDA HeartContainer_Lanmolas_Player
BRL .done
+ CMP.w #7 : BNE +
LDA HeartContainer_Moldorm_Player
BRL .done
+ CMP.w #90 : BNE +
LDA HeartContainer_HelmasaurKing_Player
BRL .done
+ CMP.w #6 : BNE +
LDA HeartContainer_Arrghus_Player
BRL .done
+ CMP.w #41 : BNE +
LDA HeartContainer_Mothula_Player
BRL .done
+ CMP.w #172 : BNE +
LDA HeartContainer_Blind_Player
BRL .done
+ CMP.w #222 : BNE +
LDA HeartContainer_Kholdstare_Player
BRL .done
+ CMP.w #144 : BNE +
LDA HeartContainer_Vitreous_Player
BRL .done
+ CMP.w #164 : BNE +
LDA HeartContainer_Trinexx_Player
BRL .done
+ CMP.w #225 : BNE +
LDA HeartPiece_Forest_Thieves_Player
BRL .done
+ CMP.w #226 : BNE +
LDA HeartPiece_Lumberjack_Tree_Player
BRL .done
+ CMP.w #234 : BNE +
LDA HeartPiece_Spectacle_Cave_Player
BRL .done
+ CMP.w #283 : BNE +
LDA $22 : XBA : AND.w #$0001 ; figure out where link is
BNE ++
LDA HeartPiece_Circle_Bushes_Player
BRL .done
++
LDA HeartPiece_Graveyard_Warp_Player
BRL .done
+ CMP.w #294 : BNE +
LDA HeartPiece_Mire_Warp_Player
BRL .done
+ CMP.w #295 : BNE +
LDA HeartPiece_Smith_Pegs_Player
BRL .done
LDA.w #$0000
BRL .done
.outdoors
PHP
REP #$20 ; set 16-bit accumulator
LDA $8A
CMP.w #$03 : BNE +
LDA $22 : CMP.w #1890 : !BLT ++
LDA HeartPiece_Spectacle_Player
BRL .done
++
LDA EtherItem_Player
BRL .done
+ CMP.w #$05 : BNE +
LDA HeartPiece_Mountain_Warp_Player
BRL .done
+ CMP.w #$28 : BNE +
LDA HeartPiece_Maze_Player
BRL .done
+ CMP.w #$2A : BNE +
LDA HauntedGroveItem_Player
BRL .done
+ CMP.w #$30 : BNE +
LDA $22 : CMP.w #512 : !BGE ++
LDA HeartPiece_Desert_Player
BRL .done
++
LDA BombosItem_Player
BRL .done
+ CMP.w #$35 : BNE +
LDA HeartPiece_Lake_Player
BRL .done
+ CMP.w #$3B : BNE +
LDA HeartPiece_Swamp_Player
BRL .done
+ CMP.w #$42 : BNE +
LDA HeartPiece_Cliffside_Player
BRL .done
+ CMP.w #$4A : BNE +
LDA HeartPiece_Cliffside_Player
BRL .done
+ CMP.w #$5B : BNE +
LDA HeartPiece_Pyramid_Player
BRL .done
+ CMP.w #$68 : BNE +
LDA HeartPiece_Digging_Player
BRL .done
+ CMP.w #$81 : BNE +
LDA HeartPiece_Zora_Player
BRL .done
+
LDA.w #$0000
.done
AND.w #$00FF ; the loads are words but the values are 1-byte so we need to clear the top half of the accumulator - no guarantee it was 8-bit before
PLP
STA !MULTIWORLD_ITEM_PLAYER_ID
PLY
RTL
}

View File

@@ -1,3 +1,10 @@
org $078102 ; no idea where that is, ask zarby
JSL GetMultiworldItem
org $01EC07 ; Dungeon_OpenKeyedObject .nextChest : LDA Dungeon_ChestData+2, X
JSL.l Multiworld_OpenKeyedObject
;================================================================================ ;================================================================================
; Init Hook ; Init Hook
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -824,6 +831,10 @@ NOP
org $0799F7 ; 399F7 - Bank07.asm:4107 (JSL AddReceivedItem) org $0799F7 ; 399F7 - Bank07.asm:4107 (JSL AddReceivedItem)
JSL.l AddReceivedItemExpanded JSL.l AddReceivedItemExpanded
org $098605 ; 48605 - ancilla_init.asm:709 (TYA : STA $02E4 : PHX)
JML.l Multiworld_AddReceivedItem_notCrystal
NOP
org $098611 ; 48611 - ancilla_init.asm:720 (LDA .item_target_addr+0, X) org $098611 ; 48611 - ancilla_init.asm:720 (LDA .item_target_addr+0, X)
LDA.w AddReceivedItemExpanded_item_target_addr+0, X LDA.w AddReceivedItemExpanded_item_target_addr+0, X
org $098616 ; 48616 - ancilla_init.asm:721 (LDA .item_target_addr+1, X) org $098616 ; 48616 - ancilla_init.asm:721 (LDA .item_target_addr+1, X)
@@ -1150,6 +1161,9 @@ JSL.l DrawMushroom
org $05EE97 ; <- 2EE97 - sprite_mushroom.asm : 81 org $05EE97 ; <- 2EE97 - sprite_mushroom.asm : 81
NOP #14 NOP #14
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $05EB1D ; <- 2EB1D - sprite_bottle_vendor.asm : 158
JSL.l Multiworld_BottleVendor_GiveBottle
;--------------------------------------------------------------------------------
org $07A36F ; <- 3A36F - Bank07.asm : 5679 org $07A36F ; <- 3A36F - Bank07.asm : 5679
NOP #5 NOP #5
org $07A379 ; <- 3A379 - Bank07.asm : 5687 org $07A379 ; <- 3A379 - Bank07.asm : 5687
@@ -1578,6 +1592,17 @@ org $029A35 ; <- 11A35 : Bank02.asm:4789 - (JSL HUD.RebuildIndoor.palace)
JSL.l HUDRebuildIndoorHole JSL.l HUDRebuildIndoorHole
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
;================================================================================
; Skull Woods back entrance fire fix
;--------------------------------------------------------------------------------
org $099C42 ; ancilla_init.asm:4264 - (LDA $8A : AND.b #$40 : BEQ AddDoorDebris.spawn_failed)
JML.l Multiworld_ConsumingFire_TransmuteToSkullWoodsFire
NOP #2
ConsumingFire_TransmuteToSkullWoodsFire_continue:
org $099C39
AddDoorDebris_spawn_failed:
;================================================================================ ;================================================================================
; Pendant / Crystal Fixes ; Pendant / Crystal Fixes
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -1914,8 +1939,18 @@ JSL FixAgahnimFollowers
org $028823 ; <- 10823 - Bank02.asm:1560 (LDA $7EF3C5 : BEQ .ignoreInput) org $028823 ; <- 10823 - Bank02.asm:1560 (LDA $7EF3C5 : BEQ .ignoreInput)
JSL.l AllowSQ JSL.l AllowSQ
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $08C45F ; <- 4445F - ancilla_recieve_item.asm:157 (STZ $02E9)
JSL.l PostItemAnimation : NOP #2 org $08C45F ; <- 4445F - ancilla_recieve_item.asm:157 (STZ $02E9 : LDA $0C5E, X)
Ancilla_ReceiveItem_optimus:
JML.l PostItemAnimation : NOP #2
org $08C548 ; <- 44548 - ancilla_recieve_item.asm:297 (CMP.b #$28 : BNE .dontGiveRupees)
JML.l Multiworld_Ancilla_ReceiveItem_stillInMotion
Ancilla_ReceiveItem_stillInMotion_moveon:
org $08C560 ; <- 44548 - ancilla_recieve_item.asm:307
Ancilla_ReceiveItem_dontGiveRupees:
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $1EE90A ; <- F690A org $1EE90A ; <- F690A
JSL.l ItemCheck_OldMan JSL.l ItemCheck_OldMan
@@ -2043,8 +2078,12 @@ JSL.l MarkThrownItem
org $05FAFF ; <- 2FAFF - sprite_mad_batter.asm:57 (LDA $7EF37B : CMP.b #$01 : BCS .magic_already_doubled) org $05FAFF ; <- 2FAFF - sprite_mad_batter.asm:57 (LDA $7EF37B : CMP.b #$01 : BCS .magic_already_doubled)
JSL.l ItemCheck_MagicBat : BEQ + : RTS : NOP : + JSL.l ItemCheck_MagicBat : BEQ + : RTS : NOP : +
;================================================================================ ;================================================================================
org $06BD6C ; <- 33D6C - sprite_middle_aged_man.asm:143 (JSL Link_ReceiveItem)
JSL.l Multiworld_MiddleAgedMan_ReactToSecretKeepingResponse
org $06BE81 ; <- 33E81 - sprite_hobo.asm:150 (JSL Link_ReceiveItem)
JSL.l Multiworld_Hobo_GrantBottle
org $0589B4 ; <- 289B4 ; sprite_master_sword.asm:183 (JSL Link_ReceiveItem)
JSL.l Multiworld_MasterSword_GrantToPlayer
;================================================================================ ;================================================================================
; Boss Hearts ; Boss Hearts
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------

View File

@@ -201,6 +201,11 @@ FullInventoryExternal:
!SHAME_CHEST = "$7EF416" ; ---s ---- !SHAME_CHEST = "$7EF416" ; ---s ----
AddInventory: AddInventory:
PHA : PHX : PHP PHA : PHX : PHP
LDA !MULTIWORLD_ITEM_PLAYER_ID : BEQ +
BRL .incrementCounts
+
CPY.b #$0C : BNE + ; Blue Boomerang CPY.b #$0C : BNE + ; Blue Boomerang
LDA !INVENTORY_SWAP : ORA #$80 : STA !INVENTORY_SWAP LDA !INVENTORY_SWAP : ORA #$80 : STA !INVENTORY_SWAP
BRL .incrementCounts BRL .incrementCounts
@@ -247,6 +252,10 @@ AddInventory:
.incrementCounts .incrementCounts
LDA !LOCK_STATS : BEQ + : BRL .done : + LDA !LOCK_STATS : BEQ + : BRL .done : +
LDA !MULTIWORLD_ITEM_PLAYER_ID : BEQ +
BRL .dungeonCounts
+
; don't count any of this stuff ; don't count any of this stuff
CPY.b #$20 : BNE + : BRL .itemCounts : + ; Crystal CPY.b #$20 : BNE + : BRL .itemCounts : + ; Crystal
@@ -290,6 +299,11 @@ AddInventory:
++ ++
.dungeonCounts .dungeonCounts
LDA !MULTIWORLD_RECEIVING_ITEM : CMP #$01 : BNE +
BRL .fullItemCounts
+
LDA $1B : BNE + : BRL .fullItemCounts : + LDA $1B : BNE + : BRL .fullItemCounts : +
; ==BEGIN INDOOR-ONLY SECTION ; ==BEGIN INDOOR-ONLY SECTION
@@ -360,22 +374,28 @@ AddInventory:
; == END INDOOR-ONLY SECTION ; == END INDOOR-ONLY SECTION
.fullItemCounts .fullItemCounts
CPY.b #$3B : BNE + ; Skip Total Counts for Repeat Silver Arrows LDA !MULTIWORLD_ITEM_PLAYER_ID : BNE +
LDA $7EF42A : BIT #$20 : BEQ + : BRA .itemCounts CPY.b #$3B : BNE + ; Skip Total Counts for Repeat Silver Arrows
LDA $7EF42A : BIT #$20 : BEQ + : BRA .itemCounts
+ +
LDA $7EF355 : BNE + ; Check for Boots LDA !MULTIWORLD_RECEIVING_ITEM : CMP #$01 : BEQ ++
LDA $7EF432 : INC : STA $7EF432 ; Increment Pre Boots Counter LDA $7EF355 : BNE + ; Check for Boots
+ LDA $7EF432 : INC : STA $7EF432 ; Increment Pre Boots Counter
+
LDA $7EF353 : BNE + ; Check for Mirror LDA $7EF353 : BNE + ; Check for Mirror
LDA $7EF433 : INC : STA $7EF433 ; Increment Pre Mirror Counter LDA $7EF433 : INC : STA $7EF433 ; Increment Pre Mirror Counter
+ +
LDA $7EF423 : INC : STA $7EF423 ; Increment Item Total
LDA $7EF423 : INC : STA $7EF423 ; Increment Item Total ++
.itemCounts .itemCounts
LDA !MULTIWORLD_ITEM_PLAYER_ID : BEQ +
BRL .done
+
CPY.b #$00 : BNE + ; Fighter's Sword & Fighter's Shield CPY.b #$00 : BNE + ; Fighter's Sword & Fighter's Shield
JSR .incrementSword JSR .incrementSword
JSR .incrementShield JSR .incrementShield
@@ -1032,6 +1052,7 @@ CollectPowder:
; if for any reason the item value is 0 reload it, just in case ; if for any reason the item value is 0 reload it, just in case
%GetPossiblyEncryptedItem(WitchItem, SpriteItemValues) : TAY %GetPossiblyEncryptedItem(WitchItem, SpriteItemValues) : TAY
+ +
PHA : LDA WitchItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID : PLA
STZ $02E9 ; item from NPC STZ $02E9 ; item from NPC
JSL.l Link_ReceiveItem JSL.l Link_ReceiveItem
;JSL.l FullInventoryExternal ;JSL.l FullInventoryExternal

291
multiworld.asm Normal file
View File

@@ -0,0 +1,291 @@
;"received from " 28 bytes
HUD_ReceivedFrom:
dw $296E, $2961, $295F, $2961, $2965, $2972, $2961, $2960, $007F, $2962, $296E, $296B, $2969, $007F
;"sent to " 16 bytes
HUD_SentTo:
dw $296F, $2961, $296A, $2970, $007F, $2970, $296B, $007F
macro Print_Text(hdr, hdr_len, player_id)
PHX : PHY : PHP
REP #$30
LDX #$0000
-
CPX <hdr_len> : !BGE ++
LDA <hdr>, X
STA !MULTIWORLD_HUD_CHARACTER_DATA, X
INX #2
BRA -
++
LDY <hdr_len>
LDA <player_id>
AND #$00FF
DEC
CMP #$0040 : !BGE .textdone
ASL #5
TAX
-
CPY <hdr_len>+#$20 : !BGE ++
LDA PlayerNames, X
PHX : TYX : STA !MULTIWORLD_HUD_CHARACTER_DATA, X : PLX
INX #2 : INY #2
BRA -
++
TYX
-
CPX #$0040 : !BGE ++
LDA #$007F
STA !MULTIWORLD_HUD_CHARACTER_DATA, X
INX #2
BRA -
++
SEP #$20
LDA #$01 : STA !NMI_AUX+1 : STA !NMI_AUX
LDA !MULTIWORLD_HUD_DELAY
STA !MULTIWORLD_HUD_TIMER
.textdone
PLP : PLY : PLX
endmacro
WriteText:
{
PHA : PHX : PHP
SEP #$10
LDX $4340 : PHX ; preserve DMA parameters
LDX $4341 : PHX ; preserve DMA parameters
LDX $4342 : PHX ; preserve DMA parameters
LDX $4343 : PHX ; preserve DMA parameters
LDX $4344 : PHX ; preserve DMA parameters
LDX $4345 : PHX ; preserve DMA parameters
LDX $4346 : PHX ; preserve DMA parameters
LDX $2115 : PHX ; preserve DMA parameters
LDX $2116 : PHX ; preserve DMA parameters
LDX $2117 : PHX ; preserve DMA parameters
LDX $2100 : PHX : LDX.b #$80 : STX $2100 ; save screen state & turn screen off
REP #$20
LDX #$80 : STX $2115
LDA #$6000+$0340 : STA $2116
LDA.w #!MULTIWORLD_HUD_CHARACTER_DATA : STA $4342
LDX.b #!MULTIWORLD_HUD_CHARACTER_DATA>>16 : STX $4344
LDA #$0040 : STA $4345
LDA #$1801 : STA $4340
LDX #$10 : STX $420B
PLX : STX $2100 ; put screen back however it was before
PLX : STX $2117 ; restore DMA parameters
PLX : STX $2116 ; restore DMA parameters
PLX : STX $2115 ; restore DMA parameters
PLX : STX $4346 ; restore DMA parameters
PLX : STX $4345 ; restore DMA parameters
PLX : STX $4344 ; restore DMA parameters
PLX : STX $4343 ; restore DMA parameters
PLX : STX $4342 ; restore DMA parameters
PLX : STX $4341 ; restore DMA parameters
PLX : STX $4340 ; restore DMA parameters
PLP : PLX : PLA
RTL
}
GetMultiworldItem:
{
PHP
LDA !MULTIWORLD_ITEM : BNE +
LDA !MULTIWORLD_HUD_TIMER : BNE +
BRL .return
+
LDA $10
CMP #$07 : BEQ +
CMP #$09 : BEQ +
CMP #$0B : BEQ +
BRL .return
+
LDA !MULTIWORLD_HUD_TIMER : BEQ .textend
DEC #$01 : STA !MULTIWORLD_HUD_TIMER
CMP #$00 : BNE .textend
; Clear text
PHP : REP #$30
LDX #$0000
-
CPX #$0040 : !BGE ++
LDA #$007F
STA !MULTIWORLD_HUD_CHARACTER_DATA, X
INX #2
BRA -
++
PLP
LDA #$01 : STA !NMI_AUX+1 : STA !NMI_AUX
.textend
LDA $5D
CMP #$00 : BEQ +
CMP #$04 : BEQ +
CMP #$17 : BEQ +
BRL .return
+
LDA !MULTIWORLD_ITEM : BNE +
BRL .return
+
PHA
LDA #$22
LDY #$04
JSL Ancilla_CheckForAvailableSlot : BPL +
PLA
BRL .return
+
PLA
; Check if we have a key for the dungeon we are currently in
LDX $040C
; Escape
CMP #$A0 : BNE + : CPX #$00 : BEQ ++ : CPX #$02 : BEQ ++ : BRL .keyend : ++ : BRL .thisdungeon : +
; Eastern
CMP #$A2 : BNE + : CPX #$04 : BEQ .thisdungeon : BRA .keyend : +
; Desert
CMP #$A3 : BNE + : CPX #$06 : BEQ .thisdungeon : BRA .keyend : +
; Hera
CMP #$AA : BNE + : CPX #$14 : BEQ .thisdungeon : BRA .keyend : +
; Aga
CMP #$A4 : BNE + : CPX #$08 : BEQ .thisdungeon : BRA .keyend : +
; PoD
CMP #$A6 : BNE + : CPX #$0C : BEQ .thisdungeon : BRA .keyend : +
; Swamp
CMP #$A5 : BNE + : CPX #$0A : BEQ .thisdungeon : BRA .keyend : +
; SW
CMP #$A8 : BNE + : CPX #$10 : BEQ .thisdungeon : BRA .keyend : +
; TT
CMP #$AB : BNE + : CPX #$16 : BEQ .thisdungeon : BRA .keyend : +
; Ice
CMP #$A9 : BNE + : CPX #$12 : BEQ .thisdungeon : BRA .keyend : +
; Mire
CMP #$A7 : BNE + : CPX #$0E : BEQ .thisdungeon : BRA .keyend : +
; TR
CMP #$AC : BNE + : CPX #$18 : BEQ .thisdungeon : BRA .keyend : +
; GT
CMP #$AD : BNE + : CPX #$1A : BEQ .thisdungeon : BRA .keyend : +
; GT BK
CMP #$92 : BNE .keyend : CPX #$1A : BNE .keyend : LDA #$32 : BRA .keyend
.thisdungeon
LDA #$24
.keyend
STA $02D8 ;Set Item to receive
TAY
LDA #$01 : STA !MULTIWORLD_RECEIVING_ITEM
LDA #$00 : STA !MULTIWORLD_ITEM_PLAYER_ID
STZ $02E9
JSL.l $0791B3 ; Player_HaltDashAttackLong
JSL Link_ReceiveItem
LDA #$00 : STA !MULTIWORLD_ITEM : STA !MULTIWORLD_RECEIVING_ITEM
%Print_Text(HUD_ReceivedFrom, #$001C, !MULTIWORLD_ITEM_FROM)
.return
PLP
LDA $5D : ASL A : TAX
RTL
}
Multiworld_OpenKeyedObject:
{
PHP
SEP #$20
LDA ChestData_Player+2, X : STA !MULTIWORLD_ITEM_PLAYER_ID
PLP
LDA !Dungeon_ChestData+2, X ; thing we wrote over
RTL
}
Multiworld_BottleVendor_GiveBottle:
{
PHA : PHP
SEP #$20
LDA BottleMerchant_Player : STA !MULTIWORLD_ITEM_PLAYER_ID
PLP : PLA
JSL Link_ReceiveItem ; thing we wrote over
RTL
}
Multiworld_MiddleAgedMan_ReactToSecretKeepingResponse:
{
PHA : PHP
SEP #$20
LDA PurpleChest_Item_Player : STA !MULTIWORLD_ITEM_PLAYER_ID
PLP : PLA
JSL Link_ReceiveItem ; thing we wrote over
RTL
}
Multiworld_Hobo_GrantBottle:
{
PHA : PHP
SEP #$20
LDA HoboItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID
PLP : PLA
JSL Link_ReceiveItem ; thing we wrote over
RTL
}
Multiworld_MasterSword_GrantToPlayer:
{
PHA : PHP
SEP #$20
LDA PedestalSword_Player : STA !MULTIWORLD_ITEM_PLAYER_ID
PLP : PLA
JSL Link_ReceiveItem ; thing we wrote over
RTL
}
Multiworld_AddReceivedItem_notCrystal:
{
TYA : STA $02E4 : PHX ; things we wrote over
LDA !MULTIWORLD_ITEM_PLAYER_ID : BEQ +
PHY : LDY $02D8 : JSL AddInventory : PLY
%Print_Text(HUD_SentTo, #$0010, !MULTIWORLD_ITEM_PLAYER_ID)
LDA #$33 : STA $012F
JML.l AddReceivedItem_gfxHandling
+
JML.l AddReceivedItem_notCrystal+5
}
Multiworld_Ancilla_ReceiveItem_stillInMotion:
{
CMP.b #$28 : BNE + ; thing we wrote over
LDA !MULTIWORLD_ITEM_PLAYER_ID : BNE +
JML.l Ancilla_ReceiveItem_stillInMotion_moveon
+
JML.l Ancilla_ReceiveItem_dontGiveRupees
}
Multiworld_ConsumingFire_TransmuteToSkullWoodsFire:
{
LDA $8A : AND.b #$40 : BEQ .failed ; things we wrote over
LDA $0C4A : CMP #$22 : BEQ .failed
LDA $0C4B : CMP #$22 : BEQ .failed
LDA $0C4C : CMP #$22 : BEQ .failed
LDA $0C4D : CMP #$22 : BEQ .failed
LDA $0C4E : CMP #$22 : BEQ .failed
LDA $0C4F : CMP #$22 : BEQ .failed
JML.l ConsumingFire_TransmuteToSkullWoodsFire_continue
.failed
JML.l AddDoorDebris_spawn_failed
}

View File

@@ -200,6 +200,14 @@ AddReceivedItemExpandedGetItem:
;STA $FFFFFF ;STA $FFFFFF
LDA $02D8 ; check inventory LDA $02D8 ; check inventory
JSL.l FreeDungeonItemNotice JSL.l FreeDungeonItemNotice
PHA
LDA !MULTIWORLD_ITEM_PLAYER_ID : BEQ +
PLA
BRL .done
+
PLA
CMP.b #$0B : BNE + ; Bow CMP.b #$0B : BNE + ; Bow
LDA !INVENTORY_SWAP_2 : AND.b #$40 : BEQ ++ LDA !INVENTORY_SWAP_2 : AND.b #$40 : BEQ ++
LDA.l SilverArrowsUseRestriction : BNE ++ LDA.l SilverArrowsUseRestriction : BNE ++
@@ -423,11 +431,17 @@ AddReceivedItemExpanded:
PHA : PHX PHA : PHX
JSL.l PreItemGet JSL.l PreItemGet
LDA $02D8 ; Item Value LDA $02D8 : PHA ; Item Value
JSR AttemptItemSubstitution LDA !MULTIWORLD_ITEM_PLAYER_ID : BNE +
STA $02D8 PLA
JSR AttemptItemSubstitution
STA $02D8
JSR IncrementItemCounters JSR IncrementItemCounters
BRA ++
+
PLA
++
CMP.b #$16 : BNE ++ ; Bottle CMP.b #$16 : BNE ++ ; Bottle
JSR.w CountBottles : CMP.l BottleLimit : !BLT +++ JSR.w CountBottles : CMP.l BottleLimit : !BLT +++
@@ -478,12 +492,15 @@ AddReceivedItemExpanded:
+ +
LDA !PROGRESSIVE_SHIELD : AND.b #$C0 : BNE + ; No Shield LDA !PROGRESSIVE_SHIELD : AND.b #$C0 : BNE + ; No Shield
LDA.b #$04 : STA $02D8 LDA.b #$04 : STA $02D8
LDA !MULTIWORLD_ITEM_PLAYER_ID : BEQ +++ : BRL .done : +++
LDA !PROGRESSIVE_SHIELD : !ADD.b #$40 : STA !PROGRESSIVE_SHIELD : BRL .done LDA !PROGRESSIVE_SHIELD : !ADD.b #$40 : STA !PROGRESSIVE_SHIELD : BRL .done
+ : CMP.b #$40 : BNE + ; Fighter Shield + : CMP.b #$40 : BNE + ; Fighter Shield
LDA.b #$05 : STA $02D8 LDA.b #$05 : STA $02D8
LDA !MULTIWORLD_ITEM_PLAYER_ID : BEQ +++ : BRL .done : +++
LDA !PROGRESSIVE_SHIELD : !ADD.b #$40 : STA !PROGRESSIVE_SHIELD : BRL .done LDA !PROGRESSIVE_SHIELD : !ADD.b #$40 : STA !PROGRESSIVE_SHIELD : BRL .done
+ ; Everything Else + ; Everything Else
LDA.b #$06 : STA $02D8 LDA.b #$06 : STA $02D8
LDA !MULTIWORLD_ITEM_PLAYER_ID : BEQ +++ : BRL .done : +++
LDA !PROGRESSIVE_SHIELD : !ADD.b #$40 : STA !PROGRESSIVE_SHIELD : BRL .done LDA !PROGRESSIVE_SHIELD : !ADD.b #$40 : STA !PROGRESSIVE_SHIELD : BRL .done
++ : CMP.b #$60 : BNE ++ ; Progressive Armor ++ : CMP.b #$60 : BNE ++ ; Progressive Armor
LDA $7EF35B : CMP.l ProgressiveArmorLimit : !BLT + LDA $7EF35B : CMP.l ProgressiveArmorLimit : !BLT +
@@ -494,9 +511,9 @@ AddReceivedItemExpanded:
LDA.b #$23 : STA $02D8 : BRL .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 : BRL .done
+ ; Everything Else + ; Everything Else
LDA.b #$1C : STA $02D8 : BRA .done LDA.b #$1C : STA $02D8 : BRL .done
++ : CMP.b #$64 : BNE ++ : -- ; Progressive Bow ++ : CMP.b #$64 : BNE ++ : -- ; Progressive Bow
LDA $7EF340 : INC : LSR : CMP.l ProgressiveBowLimit : !BLT + LDA $7EF340 : INC : LSR : CMP.l ProgressiveBowLimit : !BLT +
LDA.l ProgressiveBowReplacement : STA $02D8 : BRL .done LDA.l ProgressiveBowReplacement : STA $02D8 : BRL .done
@@ -505,8 +522,9 @@ AddReceivedItemExpanded:
+ ; Any Bow + ; Any Bow
LDA.b #$3B : STA $02D8 : BRA .done LDA.b #$3B : STA $02D8 : BRA .done
++ : 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 !MULTIWORLD_ITEM_PLAYER_ID : BNE +++
BRA -- LDA.l !INVENTORY_SWAP_2 : ORA #$20 : STA.l !INVENTORY_SWAP_2
+++ : BRA --
; ++ : CMP.b #$FE : BNE ++ ; Server Request (Null Chest) ; ++ : CMP.b #$FE : BNE ++ ; Server Request (Null Chest)
; JSL ChestItemServiceRequest ; JSL ChestItemServiceRequest
; BRA .done ; BRA .done
@@ -909,7 +927,14 @@ Link_ReceiveItemAlternatesExpanded:
PHB : PHK : PLB PHB : PHK : PLB
;TYA : JSR IncrementItemCounters ;TYA : JSR IncrementItemCounters
;LDA Link_ReceiveItemAlternatesExpanded, Y : STA $03 ;LDA Link_ReceiveItemAlternatesExpanded, Y : STA $03
TYA : JSR AttemptItemSubstitution : STA $03 LDA !MULTIWORLD_ITEM_PLAYER_ID : BNE +
TYA
JSR AttemptItemSubstitution
BRA ++
+
TYA
++
STA $03
CPY $03 : BNE + : LDA.b #$FF : STA $03 : + CPY $03 : BNE + : LDA.b #$FF : STA $03 : +
PLB PLB
RTL RTL

View File

@@ -117,6 +117,7 @@ ItemSet_MagicBat:
RTL RTL
ItemSet_OldMan: ItemSet_OldMan:
PHA : LDA OldManItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID : PLA
JSL.l Link_ReceiveItem ; thing we wrote over JSL.l Link_ReceiveItem ; thing we wrote over
PHA : LDA !NPC_FLAGS : ORA.b #$01 : STA !NPC_FLAGS : PLA PHA : LDA !NPC_FLAGS : ORA.b #$01 : STA !NPC_FLAGS : PLA
RTL RTL
@@ -127,16 +128,19 @@ ItemSet_ZoraKing:
RTL RTL
ItemSet_SickKid: ItemSet_SickKid:
PHA : LDA SickKidItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID : PLA
JSL.l Link_ReceiveItem ; thing we wrote over JSL.l Link_ReceiveItem ; thing we wrote over
PHA : LDA !NPC_FLAGS : ORA.b #$04 : STA !NPC_FLAGS : PLA PHA : LDA !NPC_FLAGS : ORA.b #$04 : STA !NPC_FLAGS : PLA
RTL RTL
ItemSet_TreeKid: ItemSet_TreeKid:
PHA : LDA TreeKidItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID : PLA
JSL.l Link_ReceiveItem ; thing we wrote over JSL.l Link_ReceiveItem ; thing we wrote over
PHA : LDA !NPC_FLAGS : ORA.b #$08 : STA !NPC_FLAGS : PLA PHA : LDA !NPC_FLAGS : ORA.b #$08 : STA !NPC_FLAGS : PLA
RTL RTL
ItemSet_Sahasrala: ItemSet_Sahasrala:
PHA : LDA SahasralaItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID : PLA
JSL.l Link_ReceiveItem ; thing we wrote over JSL.l Link_ReceiveItem ; thing we wrote over
PHA : LDA !NPC_FLAGS : ORA.b #$10 : STA !NPC_FLAGS : PLA PHA : LDA !NPC_FLAGS : ORA.b #$10 : STA !NPC_FLAGS : PLA
RTL RTL
@@ -148,6 +152,7 @@ ItemSet_Catfish:
RTL RTL
ItemSet_Library: ItemSet_Library:
PHA : LDA LibraryItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID : PLA
JSL.l Link_ReceiveItem ; thing we wrote over JSL.l Link_ReceiveItem ; thing we wrote over
PHA : LDA !NPC_FLAGS : ORA.b #$80 : STA !NPC_FLAGS : PLA PHA : LDA !NPC_FLAGS : ORA.b #$80 : STA !NPC_FLAGS : PLA
RTL RTL
@@ -160,6 +165,7 @@ ItemSet_Mushroom:
; if for any reason the item value is 0 reload it, just in case ; if for any reason the item value is 0 reload it, just in case
%GetPossiblyEncryptedItem(MushroomItem, SpriteItemValues) : TAY %GetPossiblyEncryptedItem(MushroomItem, SpriteItemValues) : TAY
+ +
LDA MushroomItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID
PLA PLA
;LDY.b #$29 ;LDY.b #$29
STZ $02E9 ; thing we wrote over - the mushroom is an npc for item purposes apparently STZ $02E9 ; thing we wrote over - the mushroom is an npc for item purposes apparently
@@ -182,14 +188,19 @@ Set300RupeeNPCItem:
CMP.w #291 : BNE + CMP.w #291 : BNE +
%GetPossiblyEncryptedItem(RupeeNPC_MoldormCave, SpriteItemValues) %GetPossiblyEncryptedItem(RupeeNPC_MoldormCave, SpriteItemValues)
TAY ; load moldorm cave value into Y TAY ; load moldorm cave value into Y
LDA RupeeNPC_MoldormCave_Player
BRA .done BRA .done
+ CMP.w #286 : BNE + + CMP.w #286 : BNE +
%GetPossiblyEncryptedItem(RupeeNPC_NortheastDarkSwampCave, SpriteItemValues) %GetPossiblyEncryptedItem(RupeeNPC_NortheastDarkSwampCave, SpriteItemValues)
TAY ; load northeast dark swamp cave value into Y TAY ; load northeast dark swamp cave value into Y
LDA RupeeNPC_NortheastDarkSwampCave_Player
BRA .done BRA .done
+ +
LDA #$0000
LDY.b #$46 ; default to a normal 300 rupees LDY.b #$46 ; default to a normal 300 rupees
.done .done
SEP #$20
STA !MULTIWORLD_ITEM_PLAYER_ID
PLP : PLA PLP : PLA
RTL RTL
;================================================================================ ;================================================================================

View File

@@ -23,6 +23,7 @@ RTL
.forceHeart .forceHeart
LDA #$33 : STA $C8 ; assure the correct state if player talked to shopkeeper LDA #$33 : STA $C8 ; assure the correct state if player talked to shopkeeper
LDA $0403 : AND.b #$40 : BNE .notHeart LDA $0403 : AND.b #$40 : BNE .notHeart
LDA ChestGameItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID
LDA #$07 ; give prize item LDA #$07 ; give prize item
RTL RTL
.notHeart .notHeart

View File

@@ -194,19 +194,7 @@ SpritePrep_ShopKeeper:
BRL - BRL -
.stop .stop
;STA $FFFFFF LDA #$01 : STA !NMI_AUX+2 : STA !NMI_AUX
LDA $A0 : CMP.b #$FF : BNE .normal
.dumb
LDA $2137
LDA $213F
LDA $213D
CMP.b #60
!BLT .dumb
.normal
LDA #$80 : STA $2100
JSR Shopkeeper_UploadVRAMTiles
LDA #$0F : STA $2100
;JSR.w QueueItemDMA
.done .done
LDA.l !SHOP_TYPE : BIT.b #$20 : BEQ .notTakeAll ; Take-all LDA.l !SHOP_TYPE : BIT.b #$20 : BEQ .notTakeAll ; Take-all

View File

@@ -154,6 +154,7 @@ GetSmithSword:
BRA .done BRA .done
.buy .buy
LDA SmithItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID
LDA.l SmithItem : TAY LDA.l SmithItem : TAY
STZ $02E9 ; Item from NPC STZ $02E9 ; Item from NPC
PHX : JSL Link_ReceiveItem : PLX PHX : JSL Link_ReceiveItem : PLX

View File

@@ -1683,5 +1683,272 @@ dw $0000
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; 0x185A00 - 187FFF (unused) ; 0x185A00 - 0x18613F (unused)
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
; 0x186140 - 0x18636B Multiworld Item's PlayerID
;--------------------------------------------------------------------------------
org $30E140 ; PC 0x186140 - 0x186337
ChestData_Player:
dl $000000, $000000, $000000, $000000, $000000, $000000, $000000, $000000
dl $000000, $000000, $000000, $000000, $000000, $000000, $000000, $000000
dl $000000, $000000, $000000, $000000, $000000, $000000, $000000, $000000
dl $000000, $000000, $000000, $000000, $000000, $000000, $000000, $000000
dl $000000, $000000, $000000, $000000, $000000, $000000, $000000, $000000
dl $000000, $000000, $000000, $000000, $000000, $000000, $000000, $000000
dl $000000, $000000, $000000, $000000, $000000, $000000, $000000, $000000
dl $000000, $000000, $000000, $000000, $000000, $000000, $000000, $000000
dl $000000, $000000, $000000, $000000, $000000, $000000, $000000, $000000
dl $000000, $000000, $000000, $000000, $000000, $000000, $000000, $000000
dl $000000, $000000, $000000, $000000, $000000, $000000, $000000, $000000
dl $000000, $000000, $000000, $000000, $000000, $000000, $000000, $000000
dl $000000, $000000, $000000, $000000, $000000, $000000, $000000, $000000
dl $000000, $000000, $000000, $000000, $000000, $000000, $000000, $000000
dl $000000, $000000, $000000, $000000, $000000, $000000, $000000, $000000
dl $000000, $000000, $000000, $000000, $000000, $000000, $000000, $000000
dl $000000, $000000, $000000, $000000, $000000, $000000, $000000, $000000
dl $000000, $000000, $000000, $000000, $000000, $000000, $000000, $000000
dl $000000, $000000, $000000, $000000, $000000, $000000, $000000, $000000
dl $000000, $000000, $000000, $000000, $000000, $000000, $000000, $000000
dl $000000, $000000, $000000, $000000, $000000, $000000, $000000, $000000
MushroomItem_Player: ; 0x186338
db #$00
BottleMerchant_Player: ; 0x186339
db #$00
StandingKey_Hera_Player: ; 0x18633A
db #$00
EtherItem_Player: ; 0x18633B
db #$00
BombosItem_Player: ; 0x18633C
db #$00
HauntedGroveItem_Player: ; 0x18633D
db #$00
HeartContainer_ArmosKnights_Player: ; 0x18633E
db #$00
HeartContainer_Lanmolas_Player: ; 0x18633F
db #$00
HeartContainer_Moldorm_Player: ; 0x186340
db #$00
HeartContainer_HelmasaurKing_Player: ; 0x186341
db #$00
HeartContainer_Arrghus_Player: ; 0x186342
db #$00
HeartContainer_Mothula_Player: ; 0x186343
db #$00
HeartContainer_Blind_Player: ; 0x186344
db #$00
HeartContainer_Kholdstare_Player: ; 0x186345
db #$00
HeartContainer_Vitreous_Player: ; 0x186346
db #$00
HeartContainer_Trinexx_Player: ; 0x186347
db #$00
HeartPiece_Forest_Thieves_Player: ; 0x186348
db #$00
HeartPiece_Lumberjack_Tree_Player: ; 0x186349
db #$00
HeartPiece_Spectacle_Cave_Player: ; 0x18634A
db #$00
HeartPiece_Circle_Bushes_Player: ; 0x18634B
db #$00
HeartPiece_Graveyard_Warp_Player: ; 0x18634C
db #$00
HeartPiece_Mire_Warp_Player: ; 0x18634D
db #$00
HeartPiece_Smith_Pegs_Player: ; 0x18634E
db #$00
HeartPiece_Spectacle_Player: ; 0x18634F
db #$00
HeartPiece_Mountain_Warp_Player: ; 0x186350
db #$00
HeartPiece_Maze_Player: ; 0x186351
db #$00
HeartPiece_Desert_Player: ; 0x186352
db #$00
HeartPiece_Lake_Player: ; 0x186353
db #$00
HeartPiece_Swamp_Player: ; 0x186354
db #$00
HeartPiece_Cliffside_Player: ; 0x186355
db #$00
HeartPiece_Pyramid_Player: ; 0x186356
db #$00
HeartPiece_Digging_Player: ; 0x186357
db #$00
HeartPiece_Zora_Player: ; 0x186358
db #$00
PurpleChest_Item_Player: ; 0x186359
db #$00
RupeeNPC_MoldormCave_Player: ; 0x18635A
db #$00
RupeeNPC_NortheastDarkSwampCave_Player: ; 0x18635B
db #$00
LibraryItem_Player: ; 0x18635C
db #$00
WitchItem_Player: ; 0x18635D
db #$00
MagicBatItem_Player: ; 0x18635E
db #$00
UncleItem_Player: ; 0x18635F
db #$00
ZoraItem_Player: ; 0x186360
db #$00
CatfishItem_Player: ; 0x186361
db #$00
BonkKey_Desert_Player: ; 0x186362
db #$00
BonkKey_GTower_Player: ; 0x186363
db #$00
OldManItem_Player: ; 0x186364
db #$00
SahasralaItem_Player: ; 0x186365
db #$00
SmithItem_Player: ; 0x186366
db #$00
SickKidItem_Player: ; 0x186367
db #$00
HoboItem_Player: ; 0x186368
db #$00
PedestalSword_Player: ; 0x186369
db #$00
TreeKidItem_Player: ; 0x18636A
db #$00
ChestGameItem_Player: ; 0x18636B
db #$00
;--------------------------------------------------------------------------------
; Player names (32 bytes/player)
;--------------------------------------------------------------------------------
org $30E380 ; PC 0x186380
PlayerNames:
; Player1
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player2
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player3
dw $296C, $2968, $295D, $2975, $2961, $296E, $297A, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player4
dw $296C, $2968, $295D, $2975, $2961, $296E, $297B, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player5
dw $296C, $2968, $295D, $2975, $2961, $296E, $297C, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player6
dw $296C, $2968, $295D, $2975, $2961, $296E, $297D, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player7
dw $296C, $2968, $295D, $2975, $2961, $296E, $297E, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player8
dw $296C, $2968, $295D, $2975, $2961, $296E, $297F, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player9
dw $296C, $2968, $295D, $2975, $2961, $296E, $294B, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player10
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2977, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player11
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2978, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player12
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $2979, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player13
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297A, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player14
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297B, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player15
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297C, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player16
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297D, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player17
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297E, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player18
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $297F, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player19
dw $296C, $2968, $295D, $2975, $2961, $296E, $2978, $294B, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player20
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2977, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player21
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2978, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player22
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $2979, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player23
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297A, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player24
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297B, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player25
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297C, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player26
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297D, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player27
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297E, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player28
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $297F, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player29
dw $296C, $2968, $295D, $2975, $2961, $296E, $2979, $294B, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player30
dw $296C, $2968, $295D, $2975, $2961, $296E, $297A, $2977, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player31
dw $296C, $2968, $295D, $2975, $2961, $296E, $297A, $2978, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player32
dw $296C, $2968, $295D, $2975, $2961, $296E, $297A, $2979, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player33
dw $296C, $2968, $295D, $2975, $2961, $296E, $297A, $297A, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player34
dw $296C, $2968, $295D, $2975, $2961, $296E, $297A, $297B, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player35
dw $296C, $2968, $295D, $2975, $2961, $296E, $297A, $297C, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player36
dw $296C, $2968, $295D, $2975, $2961, $296E, $297A, $297D, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player37
dw $296C, $2968, $295D, $2975, $2961, $296E, $297A, $297E, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player38
dw $296C, $2968, $295D, $2975, $2961, $296E, $297A, $297F, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player39
dw $296C, $2968, $295D, $2975, $2961, $296E, $297A, $294B, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player40
dw $296C, $2968, $295D, $2975, $2961, $296E, $297B, $2977, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player41
dw $296C, $2968, $295D, $2975, $2961, $296E, $297B, $2978, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player42
dw $296C, $2968, $295D, $2975, $2961, $296E, $297B, $2979, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player43
dw $296C, $2968, $295D, $2975, $2961, $296E, $297B, $297A, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player44
dw $296C, $2968, $295D, $2975, $2961, $296E, $297B, $297B, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player45
dw $296C, $2968, $295D, $2975, $2961, $296E, $297B, $297C, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player46
dw $296C, $2968, $295D, $2975, $2961, $296E, $297B, $297D, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player47
dw $296C, $2968, $295D, $2975, $2961, $296E, $297B, $297E, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player48
dw $296C, $2968, $295D, $2975, $2961, $296E, $297B, $297F, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player49
dw $296C, $2968, $295D, $2975, $2961, $296E, $297B, $294B, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player50
dw $296C, $2968, $295D, $2975, $2961, $296E, $297C, $2977, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player51
dw $296C, $2968, $295D, $2975, $2961, $296E, $297C, $2978, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player52
dw $296C, $2968, $295D, $2975, $2961, $296E, $297C, $2979, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player53
dw $296C, $2968, $295D, $2975, $2961, $296E, $297C, $297A, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player54
dw $296C, $2968, $295D, $2975, $2961, $296E, $297C, $297B, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player55
dw $296C, $2968, $295D, $2975, $2961, $296E, $297C, $297C, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player56
dw $296C, $2968, $295D, $2975, $2961, $296E, $297C, $297D, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player57
dw $296C, $2968, $295D, $2975, $2961, $296E, $297C, $297E, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player58
dw $296C, $2968, $295D, $2975, $2961, $296E, $297C, $297F, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player59
dw $296C, $2968, $295D, $2975, $2961, $296E, $297C, $294B, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player60
dw $296C, $2968, $295D, $2975, $2961, $296E, $297D, $2977, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player61
dw $296C, $2968, $295D, $2975, $2961, $296E, $297D, $2978, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player62
dw $296C, $2968, $295D, $2975, $2961, $296E, $297D, $2979, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player63
dw $296C, $2968, $295D, $2975, $2961, $296E, $297D, $297A, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
; Player64
dw $296C, $2968, $295D, $2975, $2961, $296E, $297D, $297B, $007F, $007F, $007F, $007F, $007F, $007F, $007F, $007F
;--------------------------------------------------------------------------------
; 0x186B80 - 187FFF (unused)
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------

View File

@@ -8,7 +8,7 @@
; out: A - Sprite GFX ID ; out: A - Sprite GFX ID
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
GetSpriteID: GetSpriteID:
JSR AttemptItemSubstitution ;JSR AttemptItemSubstitution
CMP.b #$16 : BEQ .bottle ; Bottle CMP.b #$16 : BEQ .bottle ; Bottle
CMP.b #$2B : BEQ .bottle ; Red Potion w/bottle CMP.b #$2B : BEQ .bottle ; Red Potion w/bottle
CMP.b #$2C : BEQ .bottle ; Green Potion w/bottle CMP.b #$2C : BEQ .bottle ; Green Potion w/bottle
@@ -160,7 +160,7 @@ RTL
; out: A - Palette ; out: A - Palette
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
GetSpritePalette: GetSpritePalette:
JSR AttemptItemSubstitution ;JSR AttemptItemSubstitution
CMP.b #$16 : BEQ .bottle ; Bottle CMP.b #$16 : BEQ .bottle ; Bottle
CMP.b #$2B : BEQ .bottle ; Red Potion w/bottle CMP.b #$2B : BEQ .bottle ; Red Potion w/bottle
CMP.b #$2C : BEQ .bottle ; Green Potion w/bottle CMP.b #$2C : BEQ .bottle ; Green Potion w/bottle
@@ -290,7 +290,7 @@ RTL
IsNarrowSprite: IsNarrowSprite:
PHA : PHX PHA : PHX
PHB : PHK : PLB PHB : PHK : PLB
JSR AttemptItemSubstitution ;JSR AttemptItemSubstitution
;-------- ;--------
CMP.b #$16 : BEQ .bottle ; Bottle CMP.b #$16 : BEQ .bottle ; Bottle
CMP.b #$2B : BEQ .bottle ; Red Potion w/bottle CMP.b #$2B : BEQ .bottle ; Red Potion w/bottle