diff --git a/dungeon_map/check_loot.asm b/dungeon_map/check_loot.asm index 28ecc4a..6fcb6c5 100644 --- a/dungeon_map/check_loot.asm +++ b/dungeon_map/check_loot.asm @@ -110,6 +110,7 @@ CheckChests: CMP.b $00 BNE .next_chest + LDA.b $06 JSR CheckChestSection INC.b $06 BCC .increment_mask @@ -257,6 +258,7 @@ CheckPots: TXA : ASL A TAX LDA.l DungeonMask, X : STA.b $08 + TXA : LSR A : TAX .mask_set TXA @@ -363,6 +365,7 @@ CheckEnemies: TXA : ASL A TAX LDA.l DungeonMask, X : STA.b $08 + TXA : LSR A : TAX .mask_set TXA @@ -458,7 +461,7 @@ GetSection: .not_this_section PLX - TXA : CLC : ADC.w #$000A : TAX + TXA : CLC : ADC.w #$000D : TAX DEC.b $CE BNE .check_next_section BRA .found @@ -498,12 +501,51 @@ CheckSection: RTS endmacro -%DefineGetFooSection(Door, 2) -%DefineGetFooSection(Chest, 4) -%DefineGetFooSection(Pot, 6) -%DefineGetFooSection(Enemy, 8) +%DefineGetFooSection(Door, 3) +%DefineGetFooSection(Stair, 5) +%DefineGetFooSection(Chest, 7) +%DefineGetFooSection(Pot, 9) +%DefineGetFooSection(Enemy, 11) %DefineCheckFooSection(Door) +%DefineCheckFooSection(Stair) %DefineCheckFooSection(Chest) %DefineCheckFooSection(Pot) %DefineCheckFooSection(Enemy) + +GetIncomingStairSection: + PHX + AND.w #$0300 + XBA + ASL A + TAX + LDA.l $8098D8, X + STA.b $CC + + LDA.b $CA + AND.w #$00FF + ASL A + TAX + LDA.l SplitRooms, X + TAX + + LDA.l SplitRooms, X + AND.w #$00FF + STA.b $CE + BEQ .found + + INX +.check_next_section + LDA.l SplitRooms+0, X + AND.w #$00FF + AND.b $CC + BNE .found + TXA : CLC : ADC.w #$000D : TAX + DEC.b $CE + BNE .check_next_section + BRA .found + +.found + PLX + LDA.b $CE + RTS diff --git a/dungeon_map/current_room_map.asm b/dungeon_map/current_room_map.asm index 553e3f7..43896b3 100644 --- a/dungeon_map/current_room_map.asm +++ b/dungeon_map/current_room_map.asm @@ -525,6 +525,12 @@ DrawStairs: CLC : ADC.b $00 TAX + LDA.l CurrentDisplayedRoom + STA.b $CA + LDA.b $02 + JSR CheckStairSection + BCC .skip + PHY LDA.b $02 CLC : ADC.w #$0015 @@ -533,9 +539,17 @@ DrawStairs: LDA.l SpiralTable, X AND.w #$00FF + STA.b $CA + + LDA.l SpiralTable, X + JSR GetIncomingStairSection + INC A + ASL A : ASL A : ASL A : ASL A + XBA + ORA.b $CA + STA.b $CA TYX STA.l DoorSlots, X - STA.b $CA LDA.w DoorSlotsBG2, Y CLC : ADC.w #!CenterTile @@ -550,6 +564,7 @@ DrawStairs: JSL DrawFullRoomTile PLY +.skip INY : INY INC.b $02 DEC.b $06 @@ -675,7 +690,6 @@ DrawDropOrWarp: RTS DrawSingleConnectedRoom: - AND.w #$00FF STA.b $CA LDA.w DoorSlotsBG2, Y CLC : ADC.w #!CenterTile @@ -1586,6 +1600,15 @@ DrawDoorsStairs: ASL A TAX + REP #$30 + LDA.l CurrentDisplayedRoom + STA.b $CA + LDA.b $0D + AND.w #$00FF + JSR CheckStairSection + SEP #$30 + BCC .skip + LDA.b $0A CMP.b #$04 BCS .draw @@ -1658,7 +1681,7 @@ DetectLinksSection: INX .next_section PHX - LDA.l SplitRooms, X + LDA.l SplitRooms+1, X TAX .next_area LDA.l SplitRooms, X @@ -1699,7 +1722,7 @@ DetectLinksSection: .not_this_section PLX - TXA : CLC : ADC.w #$000A : TAX + TXA : CLC : ADC.w #$000D : TAX DEC.b $00 BNE .next_section BRA .done diff --git a/dungeon_map/data/doors_display.asm b/dungeon_map/data/doors_display.asm index 7206e3b..98654bd 100644 --- a/dungeon_map/data/doors_display.asm +++ b/dungeon_map/data/doors_display.asm @@ -222,7 +222,7 @@ EdgePositions: .west db $02 ; TT Attic db $02, $02 ; Desert North Hall - db $02, $00 ; HC Basement + db $00, $02 ; HC Basement db $00 ; Desert East Wing db $02, $00 ; TT Triple db $02 ; TT Big Key Chest @@ -236,7 +236,7 @@ EdgePositions: .east db $02 ; TT Attic db $02, $02 ; Desert North Hall - db $00, $02 ; HC Basement + db $02, $00 ; HC Basement db $00 ; Desert East Wing db $02, $00 ; TT Triple db $02 ; TT Big Key Chest diff --git a/dungeon_map/data/spiral_stairs.asm b/dungeon_map/data/spiral_stairs.asm index 508eb6b..91fa3e7 100644 --- a/dungeon_map/data/spiral_stairs.asm +++ b/dungeon_map/data/spiral_stairs.asm @@ -24,13 +24,13 @@ db $01, $00, $02 ; ($07) Single Top-Right Staircase db $01, $00, $05 ; ($0A) Single Staircase at Top of Bottom Left Quadrant db $01, $00, $04 ; ($0D) Moldorm -db $02, $00, $02, $01, $00 ; ($10) Pod Basement +db $02, $01, $00, $00, $02 ; ($10) Pod Basement db $03, $01, $0A, $02, $01, $00, $0B ; ($15) GT Entrance db $02, $00, $03, $01, $04 ; ($1C) Hera Below Moldorm db $02, $00, $01, $01, $0B ; ($21) PoD Bridge db $01, $00, $08 ; ($26) GT Ice Armos db $03, $00, $01, $01, $0B, $02, $09 ; ($29) Swamp Statue -db $02, $00, $03, $01, $04 ; ($30) Hera Big Chest +db $02, $01, $03, $00, $04 ; ($30) Hera Big Chest db $02, $00, $04, $02, $09 ; ($35) Hera Startiles (middle value unused) db $01, $00, $08 ; ($3A) West Swamp db $01, $00, $05 ; ($3D) Ice Hamlift diff --git a/dungeon_map/data/split_room.asm b/dungeon_map/data/split_room.asm index b508bbd..83183c6 100644 --- a/dungeon_map/data/split_room.asm +++ b/dungeon_map/data/split_room.asm @@ -12,10 +12,14 @@ macro d(label) dw