diff options
| author | Linus Unnebäck <linus@folkdatorn.se> | 2023-11-17 19:50:27 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-17 12:50:27 -0600 |
| commit | 83b373ad734fb0bf4b476b0f38dbeec8ea205f19 (patch) | |
| tree | b4178b8d993b12ec11fa5369c3f924e27fe2cfcb /home/overworld.asm | |
| parent | Use map object consts in data/maps/hide_show_data.asm (#432) (diff) | |
| download | pokeyellow-83b373ad734fb0bf4b476b0f38dbeec8ea205f19.tar.gz pokeyellow-83b373ad734fb0bf4b476b0f38dbeec8ea205f19.tar.xz pokeyellow-83b373ad734fb0bf4b476b0f38dbeec8ea205f19.zip | |
Add constants for wMapConnections bits and group map header wram labels
* Add constants for wMapConnections bits
* Apply Vulcandth and Rangi42 feedback
---------
Co-authored-by: vulcandth <vulcandth@gmail.com>
Diffstat (limited to 'home/overworld.asm')
| -rw-r--r-- | home/overworld.asm | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/home/overworld.asm b/home/overworld.asm index 1ebc794b..defa1728 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -910,9 +910,9 @@ LoadTileBlockMap:: add hl, bc ld c, MAP_BORDER add hl, bc ; this puts us past the (west) border - ld a, [wMapDataPtr] ; tile map pointer + ld a, [wCurMapDataPtr] ; tile map pointer ld e, a - ld a, [wMapDataPtr + 1] + ld a, [wCurMapDataPtr + 1] ld d, a ; de = tile map pointer ld a, [wCurMapHeight] ld b, a @@ -1966,7 +1966,7 @@ RunMapScript:: call RunNPCMovementScript ld a, [wCurMap] ; current map number call SwitchToMapRomBank ; change to the ROM bank the map's data is in - ld hl, wMapScriptPtr + ld hl, wCurMapScriptPtr ld a, [hli] ld h, [hl] ld l, a @@ -2035,9 +2035,8 @@ LoadMapHeader:: ld a, [hli] ld h, [hl] ld l, a ; hl = base of map header -; copy the first 10 bytes (the fixed area) of the map data to D367-D370 - ld de, wCurMapTileset - ld c, $0a + ld de, wCurMapHeader + ld c, wCurMapHeaderEnd - wCurMapHeader .copyFixedHeaderLoop ld a, [hli] ld [de], a @@ -2051,25 +2050,25 @@ LoadMapHeader:: ld [wWestConnectedMap], a ld [wEastConnectedMap], a ; copy connection data (if any) to WRAM - ld a, [wMapConnections] + ld a, [wCurMapConnections] ld b, a .checkNorth - bit 3, b + bit NORTH_F, b jr z, .checkSouth ld de, wNorthConnectionHeader call CopyMapConnectionHeader .checkSouth - bit 2, b + bit SOUTH_F, b jr z, .checkWest ld de, wSouthConnectionHeader call CopyMapConnectionHeader .checkWest - bit 1, b + bit WEST_F, b jr z, .checkEast ld de, wWestConnectionHeader call CopyMapConnectionHeader .checkEast - bit 0, b + bit EAST_F, b jr z, .getObjectDataPointer ld de, wEastConnectionHeader call CopyMapConnectionHeader |
