Allow switching dungeons in doors mode

This commit is contained in:
2026-01-13 11:00:31 -06:00
parent 633453f386
commit a011bc9f4a
2 changed files with 127 additions and 0 deletions

View File

@@ -8,6 +8,11 @@ DrawWackyDoorRandoStuff:
STZ.w GFXStripes
LDA.l CachedDungeonID
AND.w #$00FF
CMP.w DungeonID
BNE .different_dungeon
LDA.w EntranceIndex
STA.l CurrentDoorEntrance
@@ -17,6 +22,24 @@ DrawWackyDoorRandoStuff:
ASL A : ASL A : ASL A : ASL A
ORA.b RoomIndex
STA.l CurrentDisplayedRoom
BRA DrawCurrentSupertile
.different_dungeon
JSL FindFirstEntrance
TYA
STA.l CurrentDoorEntrance
ASL A
TAX
LDA.l EntranceData_room_id, X
STA.l CurrentDisplayedRoom
JSL DetectEntranceSection
INC A
XBA
ASL A : ASL A : ASL A : ASL A
ORA.l CurrentDisplayedRoom
STA.l CurrentDisplayedRoom
DrawCurrentSupertile:
LDA.w #$0000
@@ -1484,6 +1507,101 @@ DoorsMapNextEntrance:
PLP
RTL
FindFirstEntrance:
PHP
REP #$30
LDY.w #$0000
.check_next
INY
CPY.w #$0085
BCC +
LDY.w #$FFFF
PLP
RTL
+
TYX
LDA.l $82D1EF, X
AND.w #$00FF
CMP.w DungeonID
BNE .check_next
TYA
ASL A
TAX
LDA.l EntranceData_room_id, X
STA.b $CA
JSR GetSpecificRoomVisibility
BNE .acceptable
LDA.w #$0001
STA.b $00
LDA.l EntranceData_x_coordinate, X
LSR A
AND.w #$00FF
CMP.w #$0080
BCS +
LDA.b $00
ASL A
STA.b $00
+
LDA.l EntranceData_y_coordinate, X
LSR A
AND.w #$00FF
CMP.w #$0080
BCS +
LDA.b $00
ASL A
ASL A
STA.b $00
+
LDA.b $00
AND.b $0E
BEQ .check_next
.acceptable
PLP
RTL
DoorsMapChangeDungeon:
PHP
SEP #$30
LDA.w DungeonID
STA.b $00
.next
LDA.w DungeonID
ASL A
TAX
LDA.b $F6
BIT.b #$20
BNE +
INX
+ LDA.l DungeonMapData.prev, X
CMP.b $00
BEQ .done
STA.w DungeonID
JSL FindFirstEntrance
CPY.b #$FF
BEQ .next
LDA.b #$04
STA.w SubModuleInterface
REP #$20
LDA.w #$0000
.done
PLP
RTL
ClearDoorsMapBG1:
LDA.w #$000B
STA.b $00

View File

@@ -7,8 +7,12 @@ CheckSwitchMap:
; fancy door map
SEP #$20
LDA.b $F6
BIT.b #$30
BNE .change_dungeon
BIT.b #$80
BNE .select_new_room
LDA.b $F4
BIT.b #$80
BNE .select_new_room
@@ -34,6 +38,11 @@ CheckSwitchMap:
.next_entrance
JSL DoorsMapNextEntrance
BRA .doors_done
.change_dungeon
JSL DoorsMapChangeDungeon
BRA .doors_done
.doors_done
REP #$20