Cleanup world_map.asm

This commit is contained in:
scawful
2024-09-29 21:16:11 -04:00
parent 863b3eaf5d
commit 1b013499f6

View File

@@ -396,7 +396,6 @@ HandleMapDrawIcon:
AND.b #$10 AND.b #$10
BNE .skip_draw ; Timer to make it flash BNE .skip_draw ; Timer to make it flash
.noflash ; ALTERNATE ENTRY POINT .noflash ; ALTERNATE ENTRY POINT
JSR WorldMapIcon_AdjustCoordinate JSR WorldMapIcon_AdjustCoordinate
LDA.l $7EC025 : TAX LDA.l $7EC025 : TAX
JSR WorldMap_CalculateOAMCoordinates JSR WorldMap_CalculateOAMCoordinates
@@ -439,14 +438,9 @@ restore_coords_and_exit:
WorldMap_CalculateOAMCoordinates: WorldMap_CalculateOAMCoordinates:
; ========================================================= ; =========================================================
; Gfx Notes
; 0x0C4000 to 0x0C8000 for the map gfx ; 0x0C4000 to 0x0C8000 for the map gfx
; patch a new rom with your map data/gfx ; patch a new rom with your map data/gfx
; create a new bin file out of these bytes ; create a new bin file out of these bytes
; OverworldMap.asm you can copy everything from start to line 214
; and 264 to 272 if you want palettes in asm too
; 0AC727 (pc: 054727) to 0AD726 (pc: 055726) 0x1000 bytes ; 0AC727 (pc: 054727) to 0AD726 (pc: 055726) 0x1000 bytes
; ========================================================= ; =========================================================
@@ -454,106 +448,105 @@ WorldMap_CalculateOAMCoordinates:
; ========================================================= ; =========================================================
org $008E54 ;STZ $2115 org $008E54 ;STZ $2115
JSL DMAOwMap JSL DMAOwMap
RTS RTS
org $00E399 org $00E399
JSL DMAOwMapGfx JSL DMAOwMapGfx
RTL RTL
; ========================================================= ; =========================================================
; DW OVERWORLD MAP ; DW OVERWORLD MAP
; ========================================================= ; =========================================================
org $008FF3 org $008FF3
RTS ; do not do anything during the DW update we'll handle it in the LW routine RTS ; do nothing during DW update, we'll handle it in the LW routine
org $3D8000 org $3D8000
LWWorldMap_Tiles: LWWorldMap_Tiles:
incbin world_map/LwMapTileset.bin incbin world_map/LwMapTileset.bin
LWWorldMap_Gfx: LWWorldMap_Gfx:
incbin world_map/LwMapGfx.bin incbin world_map/LwMapGfx.bin
org $3E8000 org $3E8000
DWWorldMap_Tiles: DWWorldMap_Tiles:
incbin world_map/DwMapTileset.bin incbin world_map/DwMapTileset.bin
DWWorldMap_Gfx: DWWorldMap_Gfx:
incbin world_map/DwMapGfx.bin incbin world_map/DwMapGfx.bin
DMAOwMap: DMAOwMap:
{ {
JSL Palette_ArmorAndGloves JSL Palette_ArmorAndGloves
LDA $8A : AND #$40 : BEQ .LWMAP LDA $8A : AND #$40 : BEQ .LWMAP
JMP .DWMAP JMP .DWMAP
.LWMAP
.LWMAP STZ.w $2115
STZ.w $2115 LDA.b #LWWorldMap_Tiles>>16
STA.w $4304
LDA.b #LWWorldMap_Tiles>>16 REP #$20
STA.w $4304
REP #$20 LDA.w #$1800
STA.w $4300
LDA.w #$1800 STZ.b $04
STA.w $4300 STZ.b $02
STZ.b $04 LDY.b #$01
STZ.b $02 LDX.b #$00
LDY.b #$01 .next_quadrant
LDX.b #$00
.next_quadrant LDA.w #$0020
STA.b $06
LDA.w #$0020 LDA.l .vram_offset,X
STA.b $06 STA.b $00
LDA.l .vram_offset,X .next_row
STA.b $00
.next_row LDA.b $00
STA.w $2116
LDA.b $00 CLC
STA.w $2116 ADC.w #$0080
STA.b $00
CLC LDA.b $02
ADC.w #$0080 CLC
STA.b $00 ADC.w #LWWorldMap_Tiles
STA.w $4302
LDA.b $02 LDA.w #$0020
CLC STA.w $4305
ADC.w #LWWorldMap_Tiles
STA.w $4302
LDA.w #$0020 STY.w $420B
STA.w $4305
STY.w $420B CLC
ADC.b $02
STA.b $02
CLC DEC.b $06
ADC.b $02 BNE .next_row
STA.b $02
DEC.b $06 INC.b $04
BNE .next_row INC.b $04
INC.b $04 LDX.b $04
INC.b $04 CPX.b #$08
BNE .next_quadrant
LDX.b $04 SEP #$20
CPX.b #$08
BNE .next_quadrant
SEP #$20 RTL
RTL .vram_offset
.vram_offset
dw $0000, $0020, $1000, $1020 dw $0000, $0020, $1000, $1020
.DWMAP .DWMAP
STZ.w $2115 STZ.w $2115
@@ -573,43 +566,43 @@ DMAOwMap:
.next_quadrant2 .next_quadrant2
LDA.w #$0020 LDA.w #$0020
STA.b $06 STA.b $06
LDA.l .vram_offset,X LDA.l .vram_offset,X
STA.b $00
.next_row2
LDA.b $00
STA.w $2116
CLC
ADC.w #$0080
STA.b $00 STA.b $00
.next_row2 LDA.b $02
CLC
ADC.w #DWWorldMap_Tiles
STA.w $4302
LDA.b $00 LDA.w #$0020
STA.w $2116 STA.w $4305
CLC STY.w $420B
ADC.w #$0080
STA.b $00
LDA.b $02 CLC
CLC ADC.b $02
ADC.w #DWWorldMap_Tiles STA.b $02
STA.w $4302
LDA.w #$0020 DEC.b $06
STA.w $4305 BNE .next_row2
STY.w $420B INC.b $04
INC.b $04
CLC LDX.b $04
ADC.b $02 CPX.b #$08
STA.b $02
DEC.b $06
BNE .next_row2
INC.b $04
INC.b $04
LDX.b $04
CPX.b #$08
BNE .next_quadrant2 BNE .next_quadrant2
SEP #$20 SEP #$20
@@ -620,30 +613,30 @@ DMAOwMap:
DMAOwMapGfx: DMAOwMapGfx:
{ {
LDA $8A : AND #$40 : BNE .DWMAP LDA $8A : AND #$40 : BNE .DWMAP
LDA.b #LWWorldMap_Gfx>>16 : STA $02 LDA.b #LWWorldMap_Gfx>>16 : STA $02
LDA.b #$80 : STA $2115 LDA.b #$80 : STA $2115
STZ $2116 : STZ $2117 STZ $2116 : STZ $2117
REP #$10 REP #$10
LDY.w #LWWorldMap_Gfx : STY $00 LDY.w #LWWorldMap_Gfx : STY $00
LDY.w #$0000 LDY.w #$0000
.writeChr .writeChr
LDA [$00], Y : STA $2119 : INY LDA [$00], Y : STA $2119 : INY
LDA [$00], Y : STA $2119 : INY LDA [$00], Y : STA $2119 : INY
LDA [$00], Y : STA $2119 : INY LDA [$00], Y : STA $2119 : INY
LDA [$00], Y : STA $2119 : INY LDA [$00], Y : STA $2119 : INY
CPY.w #$4000 : BNE .writeChr CPY.w #$4000 : BNE .writeChr
SEP #$10 SEP #$10
RTL RTL
.DWMAP .DWMAP
@@ -673,5 +666,5 @@ DMAOwMapGfx:
} }
org $0ADC27 org $0ADC27
DWPalettes: DWPalettes:
incbin world_map/dw_palette.bin incbin world_map/dw_palette.bin