First steps
This commit is contained in:
@@ -20,6 +20,17 @@ BlinkLoot:
|
||||
|
||||
StartDoubleWrite:
|
||||
; what we wrote over
|
||||
LDA.l DRMode
|
||||
BEQ .draw
|
||||
LDA.l DungeonMapMode
|
||||
BNE .draw
|
||||
|
||||
INC.w $020D ; next subsubmode
|
||||
PLA : PLA : PLA ; pull our jump to here off the stack
|
||||
PLB
|
||||
RTL
|
||||
|
||||
.draw
|
||||
REP #$30
|
||||
STZ.w GFXStripes
|
||||
|
||||
|
||||
397
dungeon_map/current_room_map.asm
Normal file
397
dungeon_map/current_room_map.asm
Normal file
@@ -0,0 +1,397 @@
|
||||
!CenterTile = $036A
|
||||
!ConnectorPalette = $0800
|
||||
|
||||
DrawWackyDoorRandoStuff:
|
||||
JSL DrawBorder
|
||||
|
||||
LDA.b RoomIndex
|
||||
AND.w #$00FF
|
||||
STA.l CurrentDisplayedRoom
|
||||
STA.b $CA
|
||||
LDX.w #!CenterTile
|
||||
JSL DrawFullRoomTile
|
||||
|
||||
; multiply room id by 24 to get index in doors table
|
||||
LDA.l CurrentDisplayedRoom
|
||||
TAX
|
||||
LDA.l DoorOffset, X
|
||||
AND.w #$00FF
|
||||
STA.l DisplayedRoomDoorIndex
|
||||
ASL A
|
||||
CLC : ADC.l DisplayedRoomDoorIndex
|
||||
ASL A : ASL A : ASL A
|
||||
STA.l DisplayedRoomDoorIndex
|
||||
|
||||
JSL DrawConnectedRooms
|
||||
RTL
|
||||
|
||||
DrawFullRoomTile:
|
||||
LDA.b $CA
|
||||
PHX
|
||||
ASL A
|
||||
TAX
|
||||
LDA.l SaveDataWRAM, X
|
||||
STA.b $0E
|
||||
PLX
|
||||
PHY
|
||||
JSL DrawDungeonMapRoom
|
||||
PLY
|
||||
RTL
|
||||
|
||||
DrawConnectedRooms:
|
||||
PHB : PHK : PLB
|
||||
LDA.l DisplayedRoomDoorIndex
|
||||
TAX
|
||||
STZ.b $00
|
||||
|
||||
.next_side
|
||||
JSR DrawSide
|
||||
INC.b $00
|
||||
LDA.b $00
|
||||
CMP.w #$0004
|
||||
BCC .next_side
|
||||
|
||||
PLB
|
||||
RTL
|
||||
|
||||
print "DrawSide: ", pc
|
||||
; $00 - Side
|
||||
; $02 - Door position number on side
|
||||
; $04 - Target door position
|
||||
; $06 - Number of doors on side
|
||||
; $08 - Room Drawn Address
|
||||
; $0A - Door Index on side
|
||||
DrawSide:
|
||||
STZ.b $06
|
||||
LDY.w #$0002
|
||||
|
||||
-
|
||||
LDA.l DoorTable, X
|
||||
AND.w #$00FF
|
||||
CMP.w #$0003
|
||||
BEQ +
|
||||
INC.b $06
|
||||
+ INX : INX
|
||||
DEY
|
||||
BPL -
|
||||
|
||||
LDY.b $06
|
||||
LDA.w DoorsCurrentRoomOffsets_offsets, Y
|
||||
AND.w #$00FF
|
||||
STA.b $02
|
||||
|
||||
LDY.b $00
|
||||
LDA.w DoorsCurrentRoomOffsets_index, Y
|
||||
AND.w #$00FF
|
||||
CLC : ADC.b $02
|
||||
TAY
|
||||
|
||||
DEX #6
|
||||
STZ.b $02
|
||||
STZ.b $0A
|
||||
|
||||
-
|
||||
LDA.l DoorTable, X
|
||||
AND.w #$00FF
|
||||
CMP.w #$0003
|
||||
BEQ +
|
||||
JSR DrawSingleConnectedRoom
|
||||
+
|
||||
INX : INX
|
||||
INC.b $02
|
||||
LDA.b $02
|
||||
CMP.w #$0003
|
||||
BCC -
|
||||
|
||||
LDA.b $06
|
||||
CMP.w #$0002
|
||||
BEQ .two
|
||||
BCS .three
|
||||
|
||||
.other
|
||||
RTS
|
||||
|
||||
.two
|
||||
PHX
|
||||
JSR DrawDoubleConnector
|
||||
PLX
|
||||
RTS
|
||||
|
||||
.three
|
||||
PHX
|
||||
JSR DrawTripleConnector
|
||||
PLX
|
||||
RTS
|
||||
|
||||
DrawSingleConnectedRoom:
|
||||
STA.b $CA
|
||||
PHX
|
||||
LDA.w DoorsCurrentRoomOffsets, Y
|
||||
CLC : ADC.w #!CenterTile
|
||||
STA.b $08
|
||||
TAX
|
||||
JSL DrawFullRoomTile
|
||||
INY : INY
|
||||
PLX
|
||||
|
||||
PHY
|
||||
|
||||
LDA.b $06
|
||||
BEQ ++
|
||||
CMP.w #$0001
|
||||
BEQ .single
|
||||
|
||||
JSR GetWhichDoorPosition
|
||||
STA.b $04
|
||||
BRA .draw
|
||||
|
||||
.single
|
||||
LDA.b $02
|
||||
ASL A
|
||||
CLC : ADC.b $02
|
||||
STA.b $04
|
||||
|
||||
JSR GetWhichDoorPosition
|
||||
CLC : ADC.b $04
|
||||
STA.b $04
|
||||
ASL A
|
||||
CLC : ADC.b $04
|
||||
ASL A : ASL A
|
||||
TAY
|
||||
|
||||
.draw
|
||||
LDA.b $00
|
||||
BNE + : JSR DrawNorthConnectors : BRA ++ : +
|
||||
DEC A : BNE + : JSR DrawWestConnectors : BRA ++ : +
|
||||
DEC A : BNE + : JSR DrawSouthConnectors : BRA ++ : +
|
||||
DEC A : BNE + : JSR DrawEastConnectors : BRA ++ : +
|
||||
++
|
||||
|
||||
PLY
|
||||
.done
|
||||
INC.b $0A
|
||||
RTS
|
||||
|
||||
GetWhichDoorPosition:
|
||||
LDA.l DoorTable, X
|
||||
BMI .edge
|
||||
AND.w #$0300
|
||||
XBA
|
||||
RTS
|
||||
|
||||
.edge
|
||||
AND.w #$0F00
|
||||
XBA
|
||||
PHX
|
||||
PHA
|
||||
|
||||
LDA.b $00
|
||||
BIT.w #$0001
|
||||
BEQ .north_south
|
||||
|
||||
.east_west
|
||||
PLX
|
||||
LDA.l EdgePositions_east_west, X
|
||||
AND.w #$00FF
|
||||
PLX
|
||||
RTS
|
||||
|
||||
.north_south
|
||||
PLX
|
||||
LDA.l EdgePositions_north_south, X
|
||||
AND.w #$00FF
|
||||
PLX
|
||||
RTS
|
||||
|
||||
macro Draw3x2Connector(offset, label)
|
||||
LDA.w SingleEdgeCurrentRoomConnectors_<label>+0, Y
|
||||
EOR.w #!ConnectorPalette
|
||||
STA.l $7F0000+!CenterTile+<offset>+$00
|
||||
LDA.w SingleEdgeCurrentRoomConnectors_<label>+2, Y
|
||||
EOR.w #!ConnectorPalette
|
||||
STA.l $7F0000+!CenterTile+<offset>+$02
|
||||
LDA.w SingleEdgeCurrentRoomConnectors_<label>+4, Y
|
||||
EOR.w #!ConnectorPalette
|
||||
STA.l $7F0000+!CenterTile+<offset>+$04
|
||||
LDA.w SingleEdgeCurrentRoomConnectors_<label>+6, Y
|
||||
EOR.w #!ConnectorPalette
|
||||
STA.l $7F0000+!CenterTile+<offset>+$40
|
||||
LDA.w SingleEdgeCurrentRoomConnectors_<label>+8, Y
|
||||
EOR.w #!ConnectorPalette
|
||||
STA.l $7F0000+!CenterTile+<offset>+$42
|
||||
LDA.w SingleEdgeCurrentRoomConnectors_<label>+10, Y
|
||||
EOR.w #!ConnectorPalette
|
||||
STA.l $7F0000+!CenterTile+<offset>+$44
|
||||
endmacro
|
||||
|
||||
macro Draw2x3Connector(offset, label)
|
||||
LDA.w SingleEdgeCurrentRoomConnectors_<label>+0, Y
|
||||
EOR.w #!ConnectorPalette
|
||||
STA.l $7F0000+!CenterTile+<offset>+$00
|
||||
LDA.w SingleEdgeCurrentRoomConnectors_<label>+2, Y
|
||||
EOR.w #!ConnectorPalette
|
||||
STA.l $7F0000+!CenterTile+<offset>+$02
|
||||
LDA.w SingleEdgeCurrentRoomConnectors_<label>+4, Y
|
||||
EOR.w #!ConnectorPalette
|
||||
STA.l $7F0000+!CenterTile+<offset>+$40
|
||||
LDA.w SingleEdgeCurrentRoomConnectors_<label>+6, Y
|
||||
EOR.w #!ConnectorPalette
|
||||
STA.l $7F0000+!CenterTile+<offset>+$42
|
||||
LDA.w SingleEdgeCurrentRoomConnectors_<label>+8, Y
|
||||
EOR.w #!ConnectorPalette
|
||||
STA.l $7F0000+!CenterTile+<offset>+$80
|
||||
LDA.w SingleEdgeCurrentRoomConnectors_<label>+10, Y
|
||||
EOR.w #!ConnectorPalette
|
||||
STA.l $7F0000+!CenterTile+<offset>+$82
|
||||
endmacro
|
||||
|
||||
macro Draw2TileConnector(offset1, offset2, flip, sublabel)
|
||||
LDX.b $08
|
||||
LDA.w DoorConnectionTiles_<sublabel>, Y
|
||||
BEQ ?+
|
||||
ORA.w #!ConnectorPalette
|
||||
EOR.w #<flip>
|
||||
STA.l $7F0000+<offset1>, X
|
||||
?+
|
||||
|
||||
LDA.w DoorConnectionTiles_<sublabel>+2, Y
|
||||
BEQ ?+
|
||||
ORA.w #!ConnectorPalette
|
||||
EOR.w #<flip>
|
||||
STA.l $7F0000+<offset2>, X
|
||||
?+
|
||||
endmacro
|
||||
|
||||
GetConnectorIndex:
|
||||
+ LDY.b $0A
|
||||
LDA.b $06
|
||||
CMP.w #$0002
|
||||
BEQ +
|
||||
INY : INY
|
||||
+ LDA.w MultiConnectorMapping, Y
|
||||
AND.w #$00FF
|
||||
INC A
|
||||
CLC : ADC.b $04 : ADC.b $04 : ADC.b $04
|
||||
ASL A : ASL A
|
||||
TAY
|
||||
RTS
|
||||
|
||||
DrawEastConnectors:
|
||||
LDA.b $06 : DEC A
|
||||
BNE +
|
||||
%Draw3x2Connector($04, east)
|
||||
RTS
|
||||
|
||||
+ JSR GetConnectorIndex
|
||||
PHX
|
||||
%Draw2TileConnector(-$02, $3E, $4000, horizontal)
|
||||
PLX
|
||||
RTS
|
||||
RTS
|
||||
|
||||
DrawWestConnectors:
|
||||
LDA.b $06 : DEC A
|
||||
BNE +
|
||||
%Draw3x2Connector(-$06, west)
|
||||
RTS
|
||||
|
||||
+ JSR GetConnectorIndex
|
||||
PHX
|
||||
%Draw2TileConnector($04, $44, $0000, horizontal)
|
||||
PLX
|
||||
RTS
|
||||
RTS
|
||||
|
||||
DrawNorthConnectors:
|
||||
LDA.b $06 : DEC A
|
||||
BNE +
|
||||
%Draw2x3Connector(-$C0, north)
|
||||
RTS
|
||||
|
||||
+ JSR GetConnectorIndex
|
||||
PHX
|
||||
%Draw2TileConnector($80, $82, $0000, vertical)
|
||||
PLX
|
||||
RTS
|
||||
|
||||
DrawSouthConnectors:
|
||||
LDA.b $06 : DEC A
|
||||
BNE +
|
||||
%Draw2x3Connector($80, south)
|
||||
RTS
|
||||
|
||||
+ JSR GetConnectorIndex
|
||||
PHX
|
||||
%Draw2TileConnector(-$40, -$3E, $8000, vertical)
|
||||
PLX
|
||||
RTS
|
||||
|
||||
DrawBorder:
|
||||
LDA.w #$0F19
|
||||
STA.l $7F01DE
|
||||
LDA.w #$4F19
|
||||
STA.l $7F01F8
|
||||
LDA.w #$8F19
|
||||
STA.l $7F051E
|
||||
LDA.w #$CF19
|
||||
STA.l $7F0538
|
||||
|
||||
LDX.w #$0016
|
||||
-
|
||||
LDA.w #$0F1A
|
||||
STA.l $7F01E0, X
|
||||
LDA.w #$8F1A
|
||||
STA.l $7F0520, X
|
||||
DEX : DEX
|
||||
BPL -
|
||||
|
||||
LDX.w #$02C0
|
||||
-
|
||||
LDA.w #$0F1B
|
||||
STA.l $7F021E, X
|
||||
LDA.w #$4F1B
|
||||
STA.l $7F0238, X
|
||||
TXA
|
||||
SEC : SBC.w #$0040
|
||||
TAX
|
||||
BPL -
|
||||
|
||||
RTL
|
||||
|
||||
DrawDoubleConnector:
|
||||
LDA.b $00
|
||||
AND.w #$0001
|
||||
TAY
|
||||
LDA.w MultiConnectorTiles_increment, Y
|
||||
AND.w #$00FF
|
||||
STA.b $0C
|
||||
|
||||
LDA.b $00
|
||||
ASL A
|
||||
TAY
|
||||
LDA.w MultiConnectorTiles_start_offset, Y
|
||||
CLC : ADC.w #!CenterTile
|
||||
TAX
|
||||
|
||||
LDY.b $00
|
||||
LDA.w MultiConnectorTiles_direction_index, Y
|
||||
AND.w #$00FF
|
||||
TAY
|
||||
|
||||
LDA.w #$0003
|
||||
STA.b $0E
|
||||
-
|
||||
LDA.w MultiConnectorTiles, Y
|
||||
ORA.w #!ConnectorPalette
|
||||
STA.l $7F0000, X
|
||||
TXA
|
||||
CLC : ADC.b $0C
|
||||
TAX
|
||||
INY : INY
|
||||
DEC.b $0E
|
||||
BPL -
|
||||
|
||||
RTS
|
||||
|
||||
DrawTripleConnector:
|
||||
RTS
|
||||
@@ -1,4 +1,5 @@
|
||||
DoorConnectionTiles:
|
||||
.vertical
|
||||
dw $0000, $0000 ; $00
|
||||
dw $01C0, $0000 ; $01 left -> left
|
||||
dw $01D0, $01D1 ; $02 left -> middle
|
||||
@@ -19,3 +20,24 @@ DoorConnectionTiles:
|
||||
dw $81D0, $C1D2 ; $11 middle-right -> left-right
|
||||
dw $01C1, $01C2 ; $12 middle-right -> middle-right
|
||||
dw $41C2, $01C2 ; $13 triple -> triple
|
||||
.horizontal
|
||||
dw $0300, $0300 ; $00
|
||||
dw $01C4, $0300 ; $01 top -> top
|
||||
dw $C1D5, $C1D4 ; $02 top -> middle
|
||||
dw $81C7, $41C7 ; $03 top -> bottom
|
||||
dw $81D4, $81D5 ; $04 middle -> top
|
||||
dw $01C5, $41C5 ; $05 middle -> middle
|
||||
dw $01D5, $01D4 ; $06 middle -> bottom
|
||||
dw $C1C7, $01C7 ; $07 bottom -> top
|
||||
dw $41D5, $41D4 ; $08 bottom -> middle
|
||||
dw $0300, $01C4 ; $09 bottom -> bottom
|
||||
dw $41C6, $41C5 ; $0A top-middle -> top-middle
|
||||
dw $81D6, $81D4 ; $0B top-middle -> top-bottom
|
||||
dw $41D7, $81D7 ; $0C top-middle -> middle-bottom
|
||||
dw $01D6, $01D4 ; $0D top-bottom -> top-middle
|
||||
dw $01C4, $01C4 ; $0E top-bottom -> top-bottom
|
||||
dw $01D4, $41D6 ; $0F top-bottom -> middle-bottom
|
||||
dw $C1D7, $01D7 ; $10 middle-bottom -> top-middle
|
||||
dw $81D4, $C1D6 ; $11 middle-bottom -> top-bottom
|
||||
dw $01C5, $01C6 ; $12 middle-bottom -> middle-bottom
|
||||
dw $41C6, $01C6 ; $13 triple -> triple
|
||||
|
||||
127
dungeon_map/data/doors_display.asm
Normal file
127
dungeon_map/data/doors_display.asm
Normal file
@@ -0,0 +1,127 @@
|
||||
DoorsCurrentRoomOffsets:
|
||||
.north
|
||||
..3
|
||||
dw $FEBA, $FEC0, $FEC6
|
||||
..2
|
||||
dw $FEBC, $FEC4
|
||||
..1
|
||||
dw $FEC0
|
||||
.west
|
||||
..3
|
||||
dw $FF36, $FFF6, $00B6
|
||||
..2
|
||||
dw $FF76, $0076
|
||||
..1
|
||||
dw $FFF6
|
||||
.south
|
||||
..3
|
||||
dw $013A, $0140, $0146
|
||||
..2
|
||||
dw $013C, $0144
|
||||
..1
|
||||
dw $0140
|
||||
.east
|
||||
..3
|
||||
dw $FF4A, $000A, $00CA
|
||||
..2
|
||||
dw $FF8A, $008A
|
||||
..1
|
||||
dw $000A
|
||||
.index
|
||||
db $00, $0C, $18, $24
|
||||
.offsets
|
||||
db $00, $0A, $06, $00
|
||||
|
||||
SingleEdgeCurrentRoomConnectors:
|
||||
.north
|
||||
dw $01C0, $0300, $01C0, $0300, $01C0, $0300 ; left -> left
|
||||
dw $01C1, $41C1, $81D0, $81D1, $01C0, $0300 ; left -> middle
|
||||
dw $41D1, $41D0, $01C1, $41C1, $81D0, $81D1 ; left -> right
|
||||
dw $01C0, $0300, $01D0, $01D1, $01C1, $41C1 ; middle -> left
|
||||
dw $01C1, $41C1, $01C1, $41C1, $01C1, $41C1 ; middle -> middle
|
||||
dw $0300, $01C0, $41D1, $41D0, $01C1, $41C1 ; middle -> right
|
||||
dw $01D0, $01D1, $01C1, $41C1, $C1D1, $C1D0 ; right -> left
|
||||
dw $01C1, $41C1, $C1D1, $C1D0, $0300, $01C0 ; right -> middle
|
||||
dw $0300, $01C0, $0300, $01C0, $0300, $01C0 ; right -> right
|
||||
.west
|
||||
dw $01C4, $01C4, $01C4, $0300, $0300, $0300 ; top -> top
|
||||
dw $01C5, $81D4, $01C4, $C1C5, $81D5, $0300 ; top -> middle
|
||||
dw $41D5, $01C5, $81D4, $41D4, $C1C5, $81D5 ; top -> bottom
|
||||
dw $01C4, $C1D4, $01C5, $0300, $C1D5, $C1C5 ; middle -> top
|
||||
dw $01C5, $01C5, $01C5, $C1C5, $C1C5, $C1C5 ; middle -> middle
|
||||
dw $0300, $41D5, $01C5, $01C4, $41D4, $C1C5 ; middle -> bottom
|
||||
dw $C1D4, $01C5, $01D5, $C1D5, $C1C5, $01D4 ; bottom -> top
|
||||
dw $01C5, $01D5, $0300, $C1C5, $01D4, $01C4 ; bottom -> middle
|
||||
dw $0300, $0300, $0300, $01C4, $01C4, $01C4 ; bottom -> bottom
|
||||
.south
|
||||
dw $01C0, $0300, $01C0, $0300, $01C0, $0300 ; left -> left
|
||||
dw $01C0, $0300, $01D0, $01D1, $01C1, $41C1 ; left -> middle
|
||||
dw $01D0, $01D1, $01C1, $41C1, $C1D1, $C1D0 ; left -> right
|
||||
dw $01C1, $41C1, $81D0, $81D1, $01C0, $0300 ; middle -> left
|
||||
dw $01C1, $41C1, $01C1, $41C1, $01C1, $41C1 ; middle -> middle
|
||||
dw $01C1, $41C1, $C1D1, $C1D0, $0300, $01C0 ; middle -> right
|
||||
dw $41D1, $41D0, $01C1, $41C1, $81D0, $81D1 ; right -> left
|
||||
dw $0300, $01C0, $41D1, $41D0, $01C1, $41C1 ; right -> middle
|
||||
dw $0300, $01C0, $0300, $01C0, $0300, $01C0 ; right -> right
|
||||
.east
|
||||
dw $01C4, $01C4, $01C4, $0300, $0300, $0300 ; top -> top
|
||||
dw $01C4, $C1D4, $01C5, $0300, $C1D5, $81C5 ; top -> middle
|
||||
dw $C1D4, $01C5, $01D5, $C1D5, $81C5, $01D4 ; top -> bottom
|
||||
dw $01C5, $81D4, $01C4, $81C5, $81D5, $0300 ; middle -> top
|
||||
dw $01C5, $01C5, $01C5, $81C5, $81C5, $81C5 ; middle -> middle
|
||||
dw $01C5, $01D5, $0300, $81C5, $01D4, $01C4 ; middle -> bottom
|
||||
dw $41D5, $01C5, $81D4, $41D4, $81C5, $81D5 ; bottom -> top
|
||||
dw $0300, $41D5, $01C5, $01C4, $41D4, $81C5 ; bottom -> middle
|
||||
dw $0300, $0300, $0300, $01C4, $01C4, $01C4 ; bottom -> bottom
|
||||
|
||||
MultiConnectorMapping:
|
||||
.two
|
||||
db $02, $00
|
||||
.three
|
||||
db $02, $01, $00
|
||||
|
||||
MultiConnectorTiles:
|
||||
.north
|
||||
..two
|
||||
dw $41CF, $81CF, $C1CF, $01CF
|
||||
..three
|
||||
dw $41CF, $01C4, $81EF, $C1EF, $01C4, $01CF
|
||||
.west
|
||||
..two
|
||||
dw $81CF, $41CF, $C1CF, $01CF
|
||||
..three
|
||||
dw $81CF, $01C0, $41DF, $C1DF, $01C0, $01CF
|
||||
.south
|
||||
..two
|
||||
dw $C1CF, $01CF, $41CF, $81CF
|
||||
..three
|
||||
dw $C1CF, $01C4, $01EF, $41EF, $01C4, $81CF
|
||||
.east
|
||||
..two
|
||||
dw $C1CF, $01CF, $81CF, $41CF
|
||||
..three
|
||||
dw $C1CF, $01C0, $01DF, $81DF, $01C0, $41CF
|
||||
.direction_index
|
||||
db $00, $14, $28, $3C
|
||||
.start_offset
|
||||
..two
|
||||
dw $FF7E, $FFBC, $00BE, $FFC6
|
||||
..three
|
||||
.increment
|
||||
db $02, $40
|
||||
|
||||
EdgePositions:
|
||||
.north_south
|
||||
db $01, $00 ; HC Basement
|
||||
db $02 ; Desert West Wing
|
||||
db $00, $01, $02 ; Desert Lobby
|
||||
db $00 ; Desert East Wing
|
||||
db $01, $02 ; TT
|
||||
db $00, $01 ; different TT
|
||||
.east_west
|
||||
db $02 ; TT Attic
|
||||
db $02, $02 ; Desert North Hall
|
||||
db $02, $00 ; HC Basement
|
||||
db $00 ; Desert East Wing
|
||||
db $00, $02 ; TT Triple
|
||||
db $02 ; TT Big Key Chest
|
||||
@@ -98,8 +98,8 @@ dw $FFFF, $8379, $FFFF, $036A ; 60
|
||||
dw $C387, $8385, $4356, $0356 ; 61
|
||||
dw $C346, $8354, $4352, $0340 ; 62
|
||||
dw $039A, $FFFF, $0361, $FFFF ; 63
|
||||
dw $FFFF, $FFFF, $8399, $C3B1 ; 64
|
||||
dw $FFFF, $FFFF, $83B1, $0381 ; 65
|
||||
dw $FFFF, $FFFF, $8399, $0367 ; 64
|
||||
dw $FFFF, $FFFF, $0367, $0381 ; 65
|
||||
dw $038F, $039A, $0362, $83B2 ; 66
|
||||
dw $83B4, $83B5, $03B7, $039F ; 67
|
||||
dw $C340, $8350, $4341, $0340 ; 68
|
||||
|
||||
@@ -14,7 +14,13 @@ FinishRoom:
|
||||
TAX
|
||||
JML $8AE7F6
|
||||
|
||||
NormalDrawDungeonMapRoom:
|
||||
JSL DrawDungeonMapRoom
|
||||
JMP FinishRoom
|
||||
|
||||
; $CA has room_id
|
||||
; $0E has quadrant flags
|
||||
; X has address to draw at
|
||||
DrawDungeonMapRoom:
|
||||
REP #$20
|
||||
PHB : PHK : PLB ; need to keep this in same bank as data, or else specify bank
|
||||
@@ -136,7 +142,7 @@ DrawDungeonMapRoom:
|
||||
.done
|
||||
PLA : STA.b $0A
|
||||
PLB
|
||||
JMP FinishRoom
|
||||
RTL
|
||||
|
||||
DrawEntrances:
|
||||
REP #$30
|
||||
|
||||
@@ -1,4 +1,14 @@
|
||||
CheckSwitchMap:
|
||||
LDA.l DRMode
|
||||
BEQ +
|
||||
LDA.l DungeonMapMode
|
||||
BNE +
|
||||
|
||||
; fancy door map, will figure out later
|
||||
LDA.w #$0002 ; ignore input! nothing to see here!
|
||||
RTL
|
||||
|
||||
+
|
||||
SEP #$20
|
||||
LDA.b $F6
|
||||
AND.b #$30
|
||||
@@ -6,7 +16,7 @@ CheckSwitchMap:
|
||||
|
||||
; what we wrote over
|
||||
REP #$20
|
||||
LDA.w $8AF5E9, X
|
||||
LDA.w DungeonMapFloorCountData, X
|
||||
AND.w #$000F
|
||||
CLC : ADC.b $00
|
||||
RTL
|
||||
@@ -99,7 +109,11 @@ SkipMapSprites:
|
||||
|
||||
LDA.l DRMode
|
||||
BEQ +
|
||||
JML $8AEAEE
|
||||
LDA.l DungeonMapMode
|
||||
BEQ .draw_none
|
||||
JML $8AEADE
|
||||
.draw_none
|
||||
JML $8AEAFC
|
||||
+
|
||||
|
||||
LDA.l CachedDungeonID
|
||||
|
||||
@@ -38,13 +38,13 @@ db $61, $56, $57, $62
|
||||
|
||||
; unused chest data
|
||||
org $81E9A5
|
||||
dw $00F0 ; freezor room, second chest (only one chest in supertile)
|
||||
dw $000F ; freezor room, second chest (only one chest in supertile)
|
||||
|
||||
org $81EA6E
|
||||
dw $00F0 ; mire spike room, second chest (only one chest in supertile)
|
||||
dw $000F ; mire spike room, second chest (only one chest in supertile)
|
||||
|
||||
org $81EAF8
|
||||
dw $00F0 ; GT button/switch/bladetrap room (no chest in supertile)
|
||||
dw $000F ; GT button/switch/bladetrap room (no chest in supertile)
|
||||
|
||||
; Dungeon Map Palettes 2-5 left half
|
||||
org $9BE544
|
||||
@@ -75,7 +75,7 @@ org $8AEE2B
|
||||
;--------------------------------------------------------------------------------
|
||||
org $8AE64D
|
||||
PLX
|
||||
JML DrawDungeonMapRoom
|
||||
JML NormalDrawDungeonMapRoom
|
||||
|
||||
org $8AE606
|
||||
PLX
|
||||
@@ -221,3 +221,53 @@ org $8AE8F9
|
||||
org $8AEBC6
|
||||
JSL GetLocationMarkerLeft
|
||||
NOP
|
||||
|
||||
;================================================================================
|
||||
; Draw Wacky Door Rando Layouts
|
||||
;--------------------------------------------------------------------------------
|
||||
org $8AE3D7
|
||||
LDA.l DungeonMapMode
|
||||
BNE .normal
|
||||
LDA.l DRMode
|
||||
BEQ .normal
|
||||
|
||||
JSL DrawWackyDoorRandoStuff
|
||||
JMP.w $8AE422
|
||||
NOP
|
||||
|
||||
.normal
|
||||
warnpc $8AE3EB
|
||||
|
||||
org $8AE439
|
||||
dw $0F19, $4F19, $8F19, $CF19
|
||||
|
||||
org $8AE449
|
||||
dw $0F1A, $8F1A
|
||||
|
||||
org $8AE451
|
||||
dw $0F1B, $4F1B
|
||||
|
||||
org $8AE473
|
||||
NOP #2
|
||||
|
||||
org $8AE4A4
|
||||
NOP #2
|
||||
|
||||
org $8AE4DC
|
||||
NOP #2
|
||||
|
||||
org $8AE4F9
|
||||
dw $0F1E, $0F1F, $0F20, $0F21
|
||||
dw $0F22, $0F23, $0F24, $0F25
|
||||
|
||||
org $8AE539
|
||||
LDA.w #$0F1C
|
||||
|
||||
org $8AE573
|
||||
LDA.w #$0F1D
|
||||
|
||||
org $8AE555
|
||||
NOP #2
|
||||
|
||||
org $8AE576
|
||||
NOP #2
|
||||
|
||||
@@ -27,9 +27,11 @@ endmacro
|
||||
pullpc
|
||||
|
||||
incsrc mappable_doors.asm
|
||||
incsrc current_room_map.asm
|
||||
incsrc draw_rooms.asm
|
||||
incsrc map_bg3.asm
|
||||
incsrc dungeon_switch.asm
|
||||
incsrc draw_loot.asm
|
||||
incsrc check_loot.asm
|
||||
incsrc blink_loot.asm
|
||||
incsrc data/doors_display.asm
|
||||
|
||||
@@ -12,23 +12,34 @@ LoadStripes:
|
||||
|
||||
.dungeon_map
|
||||
LDA.l DungeonMapMode
|
||||
BNE .doors
|
||||
BNE .4x3
|
||||
LDA.l DRMode
|
||||
BNE .6x6
|
||||
|
||||
.not_doors
|
||||
LDA.b #BG3DungeonMapStripes>>0
|
||||
.5x5
|
||||
LDA.b #BG3DungeonMap5x5Stripes>>0
|
||||
STA.b $00
|
||||
LDA.b #BG3DungeonMapStripes>>8
|
||||
LDA.b #BG3DungeonMap5x5Stripes>>8
|
||||
STA.b $01
|
||||
LDA.b #BG3DungeonMapStripes>>16
|
||||
LDA.b #BG3DungeonMap5x5Stripes>>16
|
||||
STA.b $02
|
||||
RTL
|
||||
|
||||
.doors
|
||||
LDA.b #BG3DungeonMapDoorStripes>>0
|
||||
.4x3
|
||||
LDA.b #BG3DungeonMap4x3Stripes>>0
|
||||
STA.b $00
|
||||
LDA.b #BG3DungeonMapDoorStripes>>8
|
||||
LDA.b #BG3DungeonMap4x3Stripes>>8
|
||||
STA.b $01
|
||||
LDA.b #BG3DungeonMapDoorStripes>>16
|
||||
LDA.b #BG3DungeonMap4x3Stripes>>16
|
||||
STA.b $02
|
||||
RTL
|
||||
|
||||
.6x6
|
||||
LDA.b #BG3DungeonMap6x6Stripes>>0
|
||||
STA.b $00
|
||||
LDA.b #BG3DungeonMap6x6Stripes>>8
|
||||
STA.b $01
|
||||
LDA.b #BG3DungeonMap6x6Stripes>>16
|
||||
STA.b $02
|
||||
RTL
|
||||
|
||||
@@ -71,7 +82,7 @@ macro VanillaCommonMapStripes()
|
||||
endmacro
|
||||
|
||||
|
||||
BG3DungeonMapStripes:
|
||||
BG3DungeonMap5x5Stripes:
|
||||
%VanillaCommonMapStripes()
|
||||
; left edge of map border, from vanilla
|
||||
dw $4E60, $0100, $2100
|
||||
@@ -122,7 +133,7 @@ endmacro
|
||||
|
||||
db $FF
|
||||
|
||||
BG3DungeonMapDoorStripes:
|
||||
BG3DungeonMap4x3Stripes:
|
||||
%VanillaCommonMapStripes()
|
||||
; left edge of map border, adjusted from vanilla
|
||||
dw $4D60, $0100, $2100
|
||||
@@ -174,3 +185,116 @@ endmacro
|
||||
%FullDoorRow($6311)
|
||||
|
||||
db $FF
|
||||
|
||||
BG3DungeonMap6x6Stripes:
|
||||
; vanilla
|
||||
dw $4260, $0100, $2100
|
||||
dw $4360, $0E40, $2101
|
||||
dw $4B60, $0100, $6100
|
||||
dw $8460, $0B00, $2102, $2103, $2104, $2105, $2106, $2107
|
||||
dw $A460, $0B00, $2112, $2113, $2114, $2115, $2116, $2117
|
||||
dw $0060, $7E40, $2111
|
||||
dw $8063, $3E41, $2111
|
||||
dw $0060, $3EC0, $2111
|
||||
dw $0160, $3EC0, $2111
|
||||
dw $0C60, $3EC0, $2111
|
||||
dw $0D60, $3EC0, $2111
|
||||
dw $1E60, $3EC0, $2111
|
||||
dw $1F60, $3EC0, $2111
|
||||
|
||||
; left side border
|
||||
dw $6260, $2AC0, $2110
|
||||
dw $6B60, $2AC0, $6110
|
||||
dw $2263, $0100, $A100
|
||||
dw $2363, $0E40, $A101
|
||||
dw $2B63, $0100, $E100
|
||||
|
||||
; right side border
|
||||
dw $CE60, $0100, $2100
|
||||
dw $CF60, $1A40, $2101
|
||||
dw $DD60, $0100, $6100
|
||||
dw $EE60, $1AC0, $2110
|
||||
dw $FD60, $1AC0, $6110
|
||||
dw $AE62, $0100, $A100
|
||||
dw $AF62, $1A40, $A101
|
||||
dw $BD62, $0100, $E100
|
||||
|
||||
; blank above and below
|
||||
dw $4E60, $1E40, $2111
|
||||
dw $6E60, $1E40, $2111
|
||||
dw $8E60, $1E40, $2111
|
||||
dw $AE60, $1E40, $2111
|
||||
|
||||
dw $CE62, $1E40, $2111
|
||||
dw $EE62, $1E40, $2111
|
||||
dw $0E63, $1E40, $2111
|
||||
dw $2E63, $1E40, $2111
|
||||
|
||||
dw $4063, $4640, $2111
|
||||
dw $6063, $4640, $2111
|
||||
|
||||
; horizontal borders
|
||||
dw $EF60, $1A40, $1D11
|
||||
dw $0F61, $1A40, $1D11
|
||||
dw $2F61, $1A40, $1D11
|
||||
dw $4F61, $1A40, $1D11
|
||||
dw $6F61, $1A40, $1D11
|
||||
dw $8F61, $1A40, $1D11
|
||||
dw $AF61, $1A40, $1D11
|
||||
dw $CF61, $1A40, $1D11
|
||||
dw $EF61, $1A40, $1D11
|
||||
dw $0F62, $1A40, $1D11
|
||||
dw $2F62, $1A40, $1D11
|
||||
dw $4F62, $1A40, $1D11
|
||||
dw $6F62, $1A40, $1D11
|
||||
dw $8F62, $1A40, $1D11
|
||||
|
||||
dw $B561, $0300
|
||||
dw $5D4C, $1D4C
|
||||
|
||||
dw $D561, $0300
|
||||
dw $DD4C, $9D4C
|
||||
|
||||
; ; horizontal borders
|
||||
; dw $B160, $1440, $1D11
|
||||
; dw $1161, $1440, $1D11
|
||||
; dw $7161, $1440, $1D11
|
||||
; dw $D161, $1440, $1D11
|
||||
; dw $3162, $1440, $1D11
|
||||
; dw $9162, $1440, $1D11
|
||||
; dw $F162, $1440, $1D11
|
||||
; dw $5163, $1440, $1D11
|
||||
;
|
||||
; ; vertical borders
|
||||
; dw $B060, $12C0, $1D11
|
||||
; dw $BC60, $12C0, $1D11
|
||||
; dw $3062, $12C0, $1D11
|
||||
; dw $3C62, $12C0, $1D11
|
||||
;
|
||||
; macro TopOfDoorSquares(start)
|
||||
; ; silly Big Endian
|
||||
; db <start>>>8, <start>, $00, $15
|
||||
; dw $5D4C, $1D4C, $1D11, $5D4C, $1D4C, $1D11, $5D4C, $1D4C, $1D11, $5D4C, $1D4C
|
||||
; endmacro
|
||||
;
|
||||
; macro BottomOfDoorSquares(start)
|
||||
; ; silly Big Endian
|
||||
; db <start>>>8, <start>, $00, $15
|
||||
; dw $DD4C, $9D4C, $1D11, $DD4C, $9D4C, $1D11, $DD4C, $9D4C, $1D11, $DD4C, $9D4C
|
||||
; endmacro
|
||||
;
|
||||
; macro FullDoorRow(start)
|
||||
; %TopOfDoorSquares(<start>)
|
||||
; %BottomOfDoorSquares(<start>+$20)
|
||||
; endmacro
|
||||
;
|
||||
; ; top grid
|
||||
; %FullDoorRow($60D1)
|
||||
; %FullDoorRow($6131)
|
||||
; %FullDoorRow($6191)
|
||||
;
|
||||
; %FullDoorRow($6251)
|
||||
; %FullDoorRow($62B1)
|
||||
; %FullDoorRow($6311)
|
||||
|
||||
db $FF
|
||||
|
||||
@@ -197,11 +197,12 @@ org $B9FF10
|
||||
ItemSources:
|
||||
db $09
|
||||
|
||||
; $B9FF11
|
||||
AlwaysShowCompass:
|
||||
db $01
|
||||
|
||||
; $00 - vanilla 5x5 maps
|
||||
; $01 - special DR 4x3 maps
|
||||
; $B9FF12
|
||||
; $0000 - vanilla 5x5 maps
|
||||
; $0001 - special DR 4x3 maps
|
||||
DungeonMapMode:
|
||||
dw $0000
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3
ram.asm
3
ram.asm
@@ -566,6 +566,9 @@ GameOverSongCache = $7EC227 ;
|
||||
CachedDungeonID = $7EC22A ; Cached while opening dungeon map
|
||||
CachedCurrentFloor = $7EC22B ; to restore when closing
|
||||
;
|
||||
CurrentDisplayedRoom = $7EC22C ; 2 bytes, used by dungeon map
|
||||
DisplayedRoomDoorIndex = $7EC22E ; 2 bytes, used by dungeon map
|
||||
;
|
||||
LastBGSet = $7EC2F8 ; Lists loaded sheets to check for decompression. 4 bytes.
|
||||
;
|
||||
PaletteBufferAux = $7EC300 ; Secondary and main palette buffer. See symbols_wram.asm
|
||||
|
||||
Reference in New Issue
Block a user