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
BNE .skip_draw ; Timer to make it flash
.noflash ; ALTERNATE ENTRY POINT
JSR WorldMapIcon_AdjustCoordinate
LDA.l $7EC025 : TAX
JSR WorldMap_CalculateOAMCoordinates
@@ -439,14 +438,9 @@ restore_coords_and_exit:
WorldMap_CalculateOAMCoordinates:
; =========================================================
; Gfx Notes
; 0x0C4000 to 0x0C8000 for the map gfx
; patch a new rom with your map data/gfx
; 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
; =========================================================
@@ -454,106 +448,105 @@ WorldMap_CalculateOAMCoordinates:
; =========================================================
org $008E54 ;STZ $2115
JSL DMAOwMap
RTS
JSL DMAOwMap
RTS
org $00E399
JSL DMAOwMapGfx
RTL
JSL DMAOwMapGfx
RTL
; =========================================================
; DW OVERWORLD MAP
; =========================================================
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
LWWorldMap_Tiles:
LWWorldMap_Tiles:
incbin world_map/LwMapTileset.bin
LWWorldMap_Gfx:
LWWorldMap_Gfx:
incbin world_map/LwMapGfx.bin
org $3E8000
DWWorldMap_Tiles:
DWWorldMap_Tiles:
incbin world_map/DwMapTileset.bin
DWWorldMap_Gfx:
DWWorldMap_Gfx:
incbin world_map/DwMapGfx.bin
DMAOwMap:
{
JSL Palette_ArmorAndGloves
LDA $8A : AND #$40 : BEQ .LWMAP
JMP .DWMAP
LDA $8A : AND #$40 : BEQ .LWMAP
JMP .DWMAP
.LWMAP
.LWMAP
STZ.w $2115
STZ.w $2115
LDA.b #LWWorldMap_Tiles>>16
STA.w $4304
LDA.b #LWWorldMap_Tiles>>16
STA.w $4304
REP #$20
REP #$20
LDA.w #$1800
STA.w $4300
LDA.w #$1800
STA.w $4300
STZ.b $04
STZ.b $02
STZ.b $04
STZ.b $02
LDY.b #$01
LDX.b #$00
LDY.b #$01
LDX.b #$00
.next_quadrant
.next_quadrant
LDA.w #$0020
STA.b $06
LDA.w #$0020
STA.b $06
LDA.l .vram_offset,X
STA.b $00
LDA.l .vram_offset,X
STA.b $00
.next_row
.next_row
LDA.b $00
STA.w $2116
LDA.b $00
STA.w $2116
CLC
ADC.w #$0080
STA.b $00
CLC
ADC.w #$0080
STA.b $00
LDA.b $02
CLC
ADC.w #LWWorldMap_Tiles
STA.w $4302
LDA.b $02
CLC
ADC.w #LWWorldMap_Tiles
STA.w $4302
LDA.w #$0020
STA.w $4305
LDA.w #$0020
STA.w $4305
STY.w $420B
STY.w $420B
CLC
ADC.b $02
STA.b $02
CLC
ADC.b $02
STA.b $02
DEC.b $06
BNE .next_row
DEC.b $06
BNE .next_row
INC.b $04
INC.b $04
INC.b $04
INC.b $04
LDX.b $04
CPX.b #$08
BNE .next_quadrant
LDX.b $04
CPX.b #$08
BNE .next_quadrant
SEP #$20
SEP #$20
RTL
RTL
.vram_offset
.vram_offset
dw $0000, $0020, $1000, $1020
.DWMAP
.DWMAP
STZ.w $2115
@@ -573,43 +566,43 @@ DMAOwMap:
.next_quadrant2
LDA.w #$0020
STA.b $06
LDA.w #$0020
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
.next_row2
LDA.b $02
CLC
ADC.w #DWWorldMap_Tiles
STA.w $4302
LDA.b $00
STA.w $2116
LDA.w #$0020
STA.w $4305
CLC
ADC.w #$0080
STA.b $00
STY.w $420B
LDA.b $02
CLC
ADC.w #DWWorldMap_Tiles
STA.w $4302
CLC
ADC.b $02
STA.b $02
LDA.w #$0020
STA.w $4305
DEC.b $06
BNE .next_row2
STY.w $420B
INC.b $04
INC.b $04
CLC
ADC.b $02
STA.b $02
DEC.b $06
BNE .next_row2
INC.b $04
INC.b $04
LDX.b $04
CPX.b #$08
LDX.b $04
CPX.b #$08
BNE .next_quadrant2
SEP #$20
@@ -620,30 +613,30 @@ DMAOwMap:
DMAOwMapGfx:
{
LDA $8A : AND #$40 : BNE .DWMAP
LDA.b #LWWorldMap_Gfx>>16 : STA $02
LDA $8A : AND #$40 : BNE .DWMAP
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
CPY.w #$4000 : BNE .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
CPY.w #$4000 : BNE .writeChr
SEP #$10
SEP #$10
RTL
RTL
.DWMAP
@@ -673,5 +666,5 @@ DMAOwMapGfx:
}
org $0ADC27
DWPalettes:
DWPalettes:
incbin world_map/dw_palette.bin