diff --git a/dungeon_map/check_loot.asm b/dungeon_map/check_loot.asm index 12cfae4..799b2d4 100644 --- a/dungeon_map/check_loot.asm +++ b/dungeon_map/check_loot.asm @@ -225,7 +225,7 @@ CheckPots: LDA.b [$04], Y CMP.w #$FFFF : BEQ .done INX : INY : INY - BIT.w #$8000 : BNE .we_care ; marked as major item + BIT.w #$8000 : BNE .major_item ; marked as major item LDA.b [$04], Y AND.w #$00FF CMP.w #$0008 : BEQ .small_key @@ -234,10 +234,13 @@ CheckPots: .small_key LDA.w #$0024 -.we_care - INY + BRA .continue +.major_item + LDA.b [$04], Y +.continue PHA PHX + INY TXA : ASL A EOR.w #$FFFF CLC : ADC.w #$001F ; bit mask table is in opposite order of what we want diff --git a/dungeon_map/draw_rooms.asm b/dungeon_map/draw_rooms.asm index 3e0e2d7..e84cf7f 100644 --- a/dungeon_map/draw_rooms.asm +++ b/dungeon_map/draw_rooms.asm @@ -1,51 +1,54 @@ ; $CA has room_id DrawDungeonMapRoom: PHB : PHK : PLB ; need to keep this in same bank as data, or else specify bank + LDA.b $0A : PHA - ; base no-info palette - LDA.w #$0C00 - STA.b $0C + LDA.l ShowRooms_default + AND.w #$00FF + STA.b $0A PHX + LDX.w DungeonID LDA.l MapField AND.l DungeonMask, X - BEQ + - LDA.w #$1400 - STA.b $0C - LDA.b $0E - ORA.w #$8000 - STA.b $0E - + + LDA.l ShowRooms_have_map + AND.w #$00FF + CMP.b $0A + BCC + + STA.b $0A ++ + LDX.w DungeonID LDA.l CompassField AND.l DungeonMask, X - BEQ + - LDA.b $0E - ORA.w #$4000 - STA.b $0E - + - PLX + LDA.l ShowRooms_have_compass + AND.w #$00FF + CMP.b $0A + BCC + + STA.b $0A ++ LDA.b $0E - BNE + - ; we haven't seen the supertile at all and don't have map or compass - LDA.w #$0F7B - STA.l $7F0042, X - ORA.w #$4000 - STA.l $7F0040, X - ORA.w #$8000 - STA.l $7F0000, X - AND.w #$BFFF - STA.l $7F0002, X - JMP .done - + - AND.w #$000F BEQ + - LDA.w #$1400 - STA.b $0C - + + LDA.l ShowRooms_visited_tile + AND.w #$00FF + CMP.b $0A + BCC + + STA.b $0A ++ + + LDA.b $0A : BNE + : LDA.w #$0F00 : BRA ++ ++ DEC A : BNE + : LDA.w #$0F7B : BRA ++ ++ DEC A : BNE + : LDA.w #$0F7B : BRA ++ ++ DEC A : BNE + : LDA.w #$0C00 : BRA ++ ++ DEC A : BNE + : LDA.w #$1000 : BRA ++ ++ DEC A : BNE + : LDA.w #$1400 : BRA ++ ++ LDA.w #$0800 +++ STA.b $0C + + PLX LDA.b $CA AND.w #$00FF @@ -58,20 +61,45 @@ DrawDungeonMapRoom: AND.w #$00FF CMP.w #$00FF : BEQ ?.empty CLC : ADC.w #$0340 - ORA.w #(3-)<<14 PHA LDA.b $0E AND.w #1<<(3-) BNE ?.visited - PLA - ORA.b $0C - BRA ?.write + + ?.unvisited + LDA.b $0A + CMP.w #$0003 + BCS ?.shape + + ?.square + PLA + LDA.b $0C + BRA ?.write + + ?.shape + PLA + ORA.b $0C + BRA ?.write + ?.visited - PLA - ORA.w #$0800 - ?.write - STA.l $7F0000+, X + PLA + ORA.w #$0800 + BRA ?.write + ?.empty + LDA.b $0A + CMP.w #$0001 + BEQ ?.full_square + LDA.w #$0F00 + BRA ?.write + + ?.full_square + LDA.w #$0F7B + + ?.write + ORA.w #(3-)<<14 + STA.l $7F0000+, X + ?.done endmacro %DrawQuadrant(0, $00) @@ -80,5 +108,6 @@ DrawDungeonMapRoom: %DrawQuadrant(3, $42) .done + PLA : STA.b $0A PLB RTL diff --git a/dungeon_map/hooks.asm b/dungeon_map/hooks.asm index 74710a7..843ec74 100644 --- a/dungeon_map/hooks.asm +++ b/dungeon_map/hooks.asm @@ -14,10 +14,10 @@ org $9BE564 dw $0000, $34E0, $7FFF, $34E0, $34E0, $0000, $7EB5, $1CE7 org $9BE584 -dw $0000, $71E7, $7FFF, $3B5F, $71E7, $0000, $7EB5, $1CE7 +dw $0000, $4100, $7FFF, $2656, $4100, $0000, $7EB5, $1CE7 org $9BE5A4 -dw $0000, $34E0, $7FFF, $2656, $34E0, $0000, $7EB5, $1CE7 +dw $0000, $5565, $7FFF, $2BE9, $0000, $0000, $7EB5, $1CE7 ; move BG1 to main screen in dungeon map screen org $8AE130 diff --git a/dungeon_map/settings.asm b/dungeon_map/settings.asm index 679f3b8..bf83d99 100644 --- a/dungeon_map/settings.asm +++ b/dungeon_map/settings.asm @@ -38,7 +38,7 @@ dw $2B07, $6B07, $2B17, $2B18 ; 03 - small key dw $2B0B, $6B0B, $2B3B, $6B3B ; 04 - triforce piece dw $6B08, $2B08, $EB08, $AB08 ; 05 - safety - plus dw $AB3A, $EB3A, $2B3A, $6B3A ; 06 - compass -dw $2B07, $2B08, $2B17, $2B18 ; 07 - small key +dw $2B07, $6B07, $2B17, $2B18 ; 07 - small key dw $2B05, $6B05, $2B15, $2B16 ; 08 - big key dw $2B09, $2B0A, $2B39, $6B39 ; 09 - pendant dw $2B0F, $6B0F, $2B3F, $6B3F ; 0A - inventory item - big chest @@ -105,23 +105,22 @@ warnpc $B9FF00 org $B9FF00 ; $00 - do not show anything ; $01 - show presence of supertile as dark square -; $02 - show shape of quadrants -; $03 - show outline of shape but no details -; $04 - show dark but detailed -; $05 - show lit with detail -ShowRooms: ; NYI +; $02 - show presence of quadrants as dark squares +; $03 - show outline of shape with walls but no interior details (palette 3) +; $04 - show dark with stairs but no hole/internal walls (palette 4) +; $05 - show mostly lit with stairs and holes/internal walls (palette 5) +; $06 - show fully lit with stairs and holes/internal walls (palette 2) +ShowRooms: .default - db $02 + db $01 .have_map db $04 .have_compass db $03 .visited_tile - db $04 -.visited_quadrant db $05 .reserved - skip 3 + skip 4 org $B9FF08 ; $00 - do not show anything