Key Hud redesign continued
Keydropshuffle prototype
This commit is contained in:
@@ -37,3 +37,7 @@ incsrc hudadditions.asm
|
||||
warnpc $279700
|
||||
|
||||
incsrc doortables.asm
|
||||
warnpc $288000
|
||||
|
||||
; deals with own hooks
|
||||
incsrc keydropshuffle.asm
|
||||
|
||||
@@ -32,8 +32,10 @@ HudAdditions:
|
||||
lda $7ef368 : and.l $0098c0, x : beq .restore
|
||||
txa : lsr : tax
|
||||
|
||||
lda $7ef4e0, x : jsr ConvertToDisplay : sta $7ec7a2
|
||||
lda #$2830 : sta $7ec7a4
|
||||
lda.l GenericKeys : bne +
|
||||
lda $7ef4e0, x : jsr ConvertToDisplay : sta $7ec7a2
|
||||
lda #$2830 : sta $7ec7a4
|
||||
+
|
||||
lda.w ChestKeys, x : jsr ConvertToDisplay : sta $7ec7a6
|
||||
; todo 4b0 no longer in use
|
||||
|
||||
@@ -63,32 +65,58 @@ DrHudDungeonItemsAdditions:
|
||||
phx : phy : php
|
||||
rep #$30
|
||||
|
||||
lda !HUD_FLAG : and.w #$0020 : beq + : bra ++ : +
|
||||
lda HUDDungeonItems : and.w #$0003 : bne + : bra ++ : +
|
||||
lda.w #$24f5 : sta $1606 : sta $1610 : sta $161a : sta $1624
|
||||
sta $1644 : sta $164a : sta $1652 : sta $1662 : sta $1684 : sta $16c4
|
||||
ldx #$0000
|
||||
- sta $1704, x : sta $170e, x : sta $1718, x
|
||||
inx #2 : cpx #$0008 : !blt -
|
||||
|
||||
lda !HUD_FLAG : and.w #$0020 : beq + : brl ++ : +
|
||||
lda HUDDungeonItems : and.w #$0007 : bne + : brl ++ : +
|
||||
; bk symbols
|
||||
lda.w #$2811 : sta $1606 : sta $1610 : sta $161a : sta $1624
|
||||
; sm symbols
|
||||
lda.w #$2810 : sta $160a : sta $1614 : sta $161e : sta $16e4
|
||||
; blank out stuff
|
||||
lda.w #$24f5 : sta $1606 : sta $1610 : sta $161a : sta $1624 : sta $1644
|
||||
sta $164a : sta $1652 : sta $1662
|
||||
ldy #$0000
|
||||
- sta $1706, y : iny #2 : cpy #$001c : bcc -
|
||||
lda.w #$2810 : sta $1684 ; small keys icon
|
||||
lda.w #$2811 : sta $16c4 ; big key icon
|
||||
lda.w #$2810 : sta $1704 ; small keys icon
|
||||
lda.w #$24f5 : sta $1724
|
||||
|
||||
ldx #$0002
|
||||
- lda $7ef368 : and.l $0098c0, x : beq + ; must have map
|
||||
lda.l HudOffsets, x : tay
|
||||
jsr BkStatus : sta $16C6, y ; big key status
|
||||
phx
|
||||
txa : lsr : tax
|
||||
lda.l ChestKeys, x : jsr ConvertToDisplay2 : sta $1706, y ; small key totals
|
||||
plx
|
||||
+ inx #2 : cpx #$001b : bcc -
|
||||
- lda #$0000 : !addl RowOffsets,x : !addl ColumnOffsets, x : tay
|
||||
lda.l DungeonReminderTable, x : sta $1644, y : iny #2
|
||||
lda.w #$24f5 : sta $1644, y
|
||||
lda $7ef368 : and.l $0098c0, x : beq + ; must have map
|
||||
jsr BkStatus : sta $1644, y : bra .smallKey ; big key status
|
||||
+ lda $7ef366 : and.l $0098c0, x : beq .smallKey
|
||||
lda.w #$2826 : sta $1644, y
|
||||
.smallKey
|
||||
+ iny #2
|
||||
cpx #$001a : bne +
|
||||
tya : !add #$003c : tay
|
||||
+ stx $00
|
||||
txa : lsr : tax
|
||||
lda.w #$24f5 : sta $1644, y
|
||||
lda.l $7ef37c, x : beq +
|
||||
jsr ConvertToDisplay2 : sta $1644, y
|
||||
+ iny #2 : lda.w #$24f5 : sta $1644, y
|
||||
phx : ldx $00
|
||||
lda $7ef368 : and.l $0098c0, x : beq + ; must have map
|
||||
plx : lda.l ChestKeys, x : jsr ConvertToDisplay2 : sta $1644, y ; small key totals
|
||||
bra .skipStack
|
||||
+ plx
|
||||
.skipStack iny #2
|
||||
cpx #$000d : beq +
|
||||
lda.w #$24f5 : sta $1644, y
|
||||
+
|
||||
ldx $00
|
||||
+ inx #2 : cpx #$001b : bcs ++ : brl -
|
||||
++
|
||||
lda !HUD_FLAG : and.w #$0020 : bne + : brl ++ : +
|
||||
lda HUDDungeonItems : and.w #$000f : bne + : brl ++ : +
|
||||
lda HUDDungeonItems : and.w #$000c : bne + : brl ++ : +
|
||||
; map symbols (do I want these) ; note compass symbol is 2c20
|
||||
lda.w #$2821 : sta $1606 : sta $1610 : sta $161a : sta $1624
|
||||
; blank out a couple thing from old hud
|
||||
lda.w #$24f5 : sta $16e4 : sta $1724
|
||||
sta $160a : sta $1614 : sta $161e ; blank out sm key indicators
|
||||
ldx #$0002
|
||||
- lda #$0000 ; start of hud area
|
||||
!addl RowOffsets, x : !addl ColumnOffsets, x : tay
|
||||
|
||||
167
asm/keydropshuffle.asm
Normal file
167
asm/keydropshuffle.asm
Normal file
@@ -0,0 +1,167 @@
|
||||
org $06926e ; <- 3126e - sprite_prep.asm : 2664 (LDA $0B9B : STA $0CBA, X)
|
||||
jsl SpriteKeyPrep : nop #2
|
||||
|
||||
org $06d049 ; <- 35049 sprite_absorbable : 31-32 (JSL Sprite_DrawRippleIfInWater : JSR Sprite_DrawAbsorbable)
|
||||
jsl SpriteKeyDrawGFX : bra + : nop : +
|
||||
|
||||
org $06d180
|
||||
jsl BigKeyGet : bcs $07
|
||||
|
||||
org $06d18d ; <- 3518D - sprite_absorbable.asm : 274 (LDA $7EF36F : INC A : STA $7EF36F)
|
||||
jsl KeyGet
|
||||
|
||||
org $06f9f3 ; bank06.asm : 6732 (JSL Sprite_LoadProperties)
|
||||
jsl LoadProperties_PreserveItemMaybe
|
||||
|
||||
|
||||
|
||||
|
||||
org $06d23a
|
||||
Sprite_DrawAbsorbable:
|
||||
org $1eff81
|
||||
Sprite_DrawRippleIfInWater:
|
||||
org $0db818
|
||||
Sprite_LoadProperties:
|
||||
|
||||
org $288000 ;140000
|
||||
ShuffleKeyDrops:
|
||||
db 0
|
||||
ShuffleKeyDropsReserved:
|
||||
db 0
|
||||
|
||||
LootTable: ;PC: 140002
|
||||
db $0e, $00, $24 ;; ice jelly key
|
||||
db $13, $00, $24 ;; pokey 2
|
||||
db $16, $00, $24 ;; swamp waterway pot
|
||||
db $21, $00, $24 ;; key rat
|
||||
db $35, $00, $24 ;; swamp trench 2 pot
|
||||
db $36, $00, $24 ;; hookshot pot
|
||||
db $37, $00, $24 ;; trench 1 pot
|
||||
db $38, $00, $24 ;; pot row pot
|
||||
db $39, $00, $24 ;; skull gibdo
|
||||
db $3d, $00, $24 ;; gt minihelma
|
||||
db $3e, $00, $24 ;; ice conveyor
|
||||
db $3f, $00, $24 ;; ice hammer block ??? is this a dungeon secret?
|
||||
db $43, $00, $24 ;; tiles 2 pot
|
||||
db $53, $00, $24 ;; beamos hall pot
|
||||
db $56, $00, $24 ;; skull west lobby pot
|
||||
db $63, $00, $24 ;; desert tiles 1 pot
|
||||
db $71, $00, $24 ;; boomerang guard
|
||||
db $72, $00, $24 ;; hc map guard
|
||||
db $7b, $00, $24 ;; gt star pits pot
|
||||
db $80, $00, $32 ;; a big key (for the current dungeon)
|
||||
db $8b, $00, $24 ;; gt conv cross block
|
||||
db $9b, $00, $24 ;; gt dlb switch pot
|
||||
db $9f, $00, $24 ;; ice many pots
|
||||
db $99, $00, $24 ;; eastern eyegore
|
||||
db $a1, $00, $24 ;; mire fishbone pot
|
||||
db $ab, $00, $24 ;; tt spike switch pot
|
||||
db $b0, $00, $24 ;; tower circle of pots usain
|
||||
db $b3, $00, $24 ;; mire spikes pot
|
||||
db $b6, $00, $24 ;; pokey 1
|
||||
db $ba, $00, $24 ;; eastern dark pot
|
||||
db $bc, $00, $24 ;; tt hallway pot
|
||||
db $c0, $00, $24 ;; tower dark archer
|
||||
db $c1, $00, $24 ;; mire glitchy jelly
|
||||
db $ff, $00, $ff
|
||||
;140068
|
||||
|
||||
KeyTable:
|
||||
db $a0, $a0, $a2, $a3, $a4, $a5, $a6, $a7, $a8, $a9, $aa, $ab, $ac, $ad
|
||||
|
||||
SpriteKeyPrep:
|
||||
{
|
||||
lda $0b9b : sta $0cba, x ; what we wrote over
|
||||
pha
|
||||
lda.l ShuffleKeyDrops : beq +
|
||||
phx
|
||||
ldx #$fd
|
||||
- inx #3 : lda.l LootTable, x : cmp #$ff : beq ++ : cmp $a0 : bne -
|
||||
inx : lda.l LootTable, x : sta !MULTIWORLD_SPRITEITEM_PLAYER_ID
|
||||
inx : lda.l LootTable, x
|
||||
plx : sta $0e80, x
|
||||
cmp #$24 : beq +
|
||||
jsl PrepDynamicTile : bra +
|
||||
++ plx : lda #$24 : sta $0e80, x
|
||||
+ pla
|
||||
rtl
|
||||
}
|
||||
|
||||
SpriteKeyDrawGFX:
|
||||
{
|
||||
jsl Sprite_DrawRippleIfInWater
|
||||
pha
|
||||
lda.l ShuffleKeyDrops : bne +
|
||||
- pla
|
||||
phk : pea.w .jslrtsreturn-1
|
||||
pea.w $068014 ; an rtl address - 1 in Bank06
|
||||
jml Sprite_DrawAbsorbable
|
||||
.jslrtsreturn
|
||||
rtl
|
||||
+ lda $0e80, x
|
||||
cmp #$24 : beq -
|
||||
jsl DrawDynamicTile ; see DrawHeartPieceGFX if problems
|
||||
cmp #$03 : bne +
|
||||
pha : lda $0e60, x : ora.b #$20 : sta $0E60, x : pla
|
||||
+
|
||||
jsl.l Sprite_DrawShadowLong
|
||||
|
||||
pla : rtl
|
||||
}
|
||||
|
||||
KeyGet:
|
||||
{
|
||||
lda $7ef36f ; what we wrote over
|
||||
pha
|
||||
lda.l ShuffleKeyDrops : bne +
|
||||
pla : rtl
|
||||
+
|
||||
ldy $0e80, x
|
||||
phy
|
||||
jsr KeyGetPlayer : sta !MULTIWORLD_ITEM_PLAYER_ID
|
||||
jsl.l $0791b3 ; Player_HaltDashAttackLong
|
||||
jsl.l Link_ReceiveItem
|
||||
pla : sta $00
|
||||
lda !MULTIWORLD_ITEM_PLAYER_ID : bne .end
|
||||
phx
|
||||
lda $040c : lsr : tax
|
||||
lda $00 : cmp KeyTable, x : bne +
|
||||
- plx : pla : rtl
|
||||
+ cmp #$af : beq - ; universal key
|
||||
cmp #$24 : beq - ; small key for this dungeon
|
||||
plx
|
||||
.end
|
||||
pla : dec : rtl
|
||||
}
|
||||
|
||||
|
||||
BigKeyGet:
|
||||
{
|
||||
lda.l ShuffleKeyDrops : bne +
|
||||
- stz $02e9 : ldy.b #$32 : phx ; what we wrote over
|
||||
clc : rtl
|
||||
+
|
||||
ldy $0e80, x
|
||||
cpy #$32 : beq -
|
||||
+ sec : rtl
|
||||
}
|
||||
|
||||
KeyGetPlayer:
|
||||
{
|
||||
phx
|
||||
ldx #$fd
|
||||
- inx #3 : lda.l LootTable, x : cmp #$ff : beq ++ : cmp $a0 : bne -
|
||||
++ inx : lda.l LootTable, x
|
||||
plx
|
||||
rts
|
||||
}
|
||||
|
||||
LoadProperties_PreserveItemMaybe:
|
||||
{
|
||||
lda.l ShuffleKeyDrops : bne +
|
||||
jsl Sprite_LoadProperties : rtl
|
||||
+ lda $0e80, x : pha
|
||||
jsl Sprite_LoadProperties
|
||||
pla : sta $0e80, x
|
||||
rtl
|
||||
}
|
||||
Reference in New Issue
Block a user