diff options
| author | luckytyphlosion <alan.rj.huang@gmail.com> | 2015-10-29 14:23:30 -0400 |
|---|---|---|
| committer | luckytyphlosion <alan.rj.huang@gmail.com> | 2015-10-29 14:23:30 -0400 |
| commit | cb414f1480e9117e5d6ee0ab5cb81903e83cde9a (patch) | |
| tree | e44bd6299c61335a9a0476db57b565aadcd0b4d7 /home | |
| parent | Revert "Revert "data/facing.asm, titlescreen functions, oam/sprite related fu... (diff) | |
| download | pokeyellow-cb414f1480e9117e5d6ee0ab5cb81903e83cde9a.tar.gz pokeyellow-cb414f1480e9117e5d6ee0ab5cb81903e83cde9a.tar.xz pokeyellow-cb414f1480e9117e5d6ee0ab5cb81903e83cde9a.zip | |
overworld item & movement code, cable club code, remove more instances of W_, add PIKAHAPPY_TRADE
Also make replace.sh take args
Diffstat (limited to '')
| -rw-r--r-- | home.asm | 68 | ||||
| -rw-r--r-- | home/audio.asm | 2 | ||||
| -rw-r--r-- | home/fade.asm | 2 | ||||
| -rw-r--r-- | home/overworld.asm | 134 |
4 files changed, 103 insertions, 103 deletions
@@ -289,7 +289,7 @@ DrawHPBar:: ; 10f8 (0:10f8) ; loads pokemon data from one of multiple sources to wLoadedMon -; loads base stats to W_MONHEADER +; loads base stats to wMonHeader ; INPUT: ; [wWhichPokemon] = index of pokemon within party/box ; [wMonDataLocation] = source @@ -618,7 +618,7 @@ GetwMoves:: ; 1326 (0:1326) ld a,[hl] ret -; copies the base stat data of a pokemon to W_MONHEADER +; copies the base stat data of a pokemon to wMonHeader ; INPUT: ; [wd0b5] = pokemon ID GetMonHeader:: ; 132f (0:132f) @@ -651,12 +651,12 @@ GetMonHeader:: ; 132f (0:132f) ld bc,28 ld hl,BaseStats call AddNTimes - ld de,W_MONHEADER + ld de,wMonHeader ld bc,28 call CopyData jr .done .specialID - ld hl,W_MONHSPRITEDIM + ld hl,wMonHSpriteDim ld [hl],b ; write sprite dimensions inc hl ld [hl],e ; write front sprite pointer @@ -664,7 +664,7 @@ GetMonHeader:: ; 132f (0:132f) ld [hl],d .done ld a,[wd0b5] - ld [W_MONHINDEX],a + ld [wMonHIndex],a pop af ld [wd11e],a pop hl @@ -775,7 +775,7 @@ PrintBCDDigit:: ; 13e4 (0:13e4) ; assumes the corresponding mon header is already loaded ; hl contains offset to sprite pointer ($b for front or $d for back) UncompressMonSprite:: ; 1407 (0:1407) - ld bc,W_MONHEADER + ld bc,wMonHeader add hl,bc ld a,[hli] ld [W_SPRITEINPUTPTR],a ; fetch sprite input pointer @@ -821,9 +821,9 @@ UncompressMonSprite:: ; 1407 (0:1407) ; de: destination location LoadMonFrontSprite:: ; 143e (0:143e) push de - ld hl, W_MONHFRONTSPRITE - W_MONHEADER + ld hl, wMonHFrontSprite - wMonHeader call UncompressMonSprite - ld hl, W_MONHSPRITEDIM + ld hl, wMonHSpriteDim ld a, [hli] ld c, a pop de @@ -1242,7 +1242,7 @@ DisplayTextID:: ; 2817 (0:2817) bit 0,[hl] res 0,[hl] jr nz,.skipSwitchToMapBank - ld a,[W_CURMAP] + ld a,[wCurMap] call SwitchToMapRomBank .skipSwitchToMapBank ld a,30 ; half a second @@ -1266,7 +1266,7 @@ DisplayTextID:: ; 2817 (0:2817) jp z,DisplayPlayerBlackedOutText cp a,TEXT_REPEL_WORE_OFF jp z,DisplayRepelWoreOffText - ld a,[W_NUMSPRITES] + ld a,[wNumSprites] ld e,a ld a,[hSpriteIndexOrTextID] ; sprite ID cp e @@ -1280,7 +1280,7 @@ DisplayTextID:: ; 2817 (0:2817) ;callba UpdateSpriteFacingOffsetAndDelayMovement ; update the graphics of the sprite the player is talking to (to face the right direction) ;pop bc ;pop de - ld hl,W_MAPSPRITEDATA ; NPC text entries + ld hl,wMapSpriteData ; NPC text entries ld a,[hSpriteIndexOrTextID] dec a add a @@ -1343,7 +1343,7 @@ HoldTextDisplayOpen:: ; 28cf (0:28cf) jr nz,HoldTextDisplayOpen CloseTextDisplay:: ; 28d8 (0:28d8) - ld a,[W_CURMAP] + ld a,[wCurMap] call SwitchToMapRomBank ld a,$90 ld [hWY],a ; move the window off the screen @@ -1440,7 +1440,7 @@ DisplayPlayerBlackedOutText:: ; 2988 (0:2988) bit 7,a jr z,.didnotblackoutinsafari xor a - ld [W_NUMSAFARIBALLS],a + ld [wNumSafariBalls],a ld [wSafariSteps],a ld [wSafariSteps+1],a ld [wd790],a @@ -2203,7 +2203,7 @@ GetMoveName:: ; 2f4d (0:2f4d) ReloadMapData:: ; 2f66 (0:2f66) ld a,[H_LOADEDROMBANK] push af - ld a,[W_CURMAP] + ld a,[wCurMap] call SwitchToMapRomBank call DisableLCD call LoadTextBoxTilePatterns @@ -2218,7 +2218,7 @@ ReloadMapData:: ; 2f66 (0:2f66) ReloadTilesetTilePatterns:: ; 2f83 (0:2f83) ld a,[H_LOADEDROMBANK] push af - ld a,[W_CURMAP] + ld a,[wCurMap] call SwitchToMapRomBank call DisableLCD call LoadTilesetTilePatternData @@ -2459,12 +2459,12 @@ EndNPCMovementScript:: ; 30ea (0:30ea) EmptyFunc2:: ; 30f2 (0:30f2) ret -; stores hl in [W_TRAINERHEADERPTR] +; stores hl in [wTrainerHeaderPtr] StoreTrainerHeaderPointer:: ; 30f3 (0:30f3) ld a, h - ld [W_TRAINERHEADERPTR], a + ld [wTrainerHeaderPtr], a ld a, l - ld [W_TRAINERHEADERPTR+1], a + ld [wTrainerHeaderPtr+1], a ret ; executes the current map script from the function pointer array provided in hl. @@ -2498,7 +2498,7 @@ LoadGymLeaderAndCityName:: ; 311b (0:311b) ld bc, NAME_LENGTH jp CopyData ; load gym leader name -; reads specific information from trainer header (pointed to at W_TRAINERHEADERPTR) +; reads specific information from trainer header (pointed to at wTrainerHeaderPtr) ; a: offset in header data ; 0 -> flag's bit (into wTrainerHeaderFlagBit) ; 2 -> flag's byte ptr (into hl) @@ -2510,7 +2510,7 @@ ReadTrainerHeaderInfo:: ; 312f (0:312f) push af ld d, $0 ld e, a - ld hl, W_TRAINERHEADERPTR + ld hl, wTrainerHeaderPtr ld a, [hli] ld l, [hl] ld h, a @@ -2643,7 +2643,7 @@ EndTrainerBattle:: ; 3211 (0:3211) res 7, [hl] ld hl, wFlags_0xcd60 res 0, [hl] ; player is no longer engaged by any trainer - ld a, [W_ISINBATTLE] + ld a, [wIsInBattle] cp $ff jp z, ResetButtonPressedAndMapScript ld a, $2 @@ -2655,7 +2655,7 @@ EndTrainerBattle:: ; 3211 (0:3211) ld a, [W_ENEMYMONORTRAINERCLASS] cp 200 jr nc, .skipRemoveSprite ; test if trainer was fought (in that case skip removing the corresponding sprite) - ld hl, W_MISSABLEOBJECTLIST + ld hl, wMissableObjectList ld de, $2 ld a, [wSpriteIndex] call IsInArray ; search for sprite ID @@ -2685,7 +2685,7 @@ TrainerWalkUpToPlayer_Bank0:: ; 326b (0:326b) ; sets opponent type and mon set/lvl based on the engaging trainer data InitBattleEnemyParameters:: ; 3273 (0:3273) ld a, [wEngagedTrainerClass] - ld [W_CUROPPONENT], a + ld [wCurOpponent], a ld [W_ENEMYMONORTRAINERCLASS], a cp 200 ld a, [wEngagedTrainerSet] @@ -2693,7 +2693,7 @@ InitBattleEnemyParameters:: ; 3273 (0:3273) ld [W_TRAINERNO], a ret .noTrainer - ld [W_CURENEMYLVL], a + ld [wCurEnemyLVL], a ret GetSpritePosition1:: ; 328b (0:328b) @@ -2778,7 +2778,7 @@ SaveEndBattleTextPointers:: ; 32f0 (0:32f0) ; loads data of some trainer on the current map and plays pre-battle music ; [wSpriteIndex]: sprite ID of trainer who is engaged EngageMapTrainer:: ; 3306 (0:3306) - ld hl, W_MAPSPRITEEXTRADATA + ld hl, wMapSpriteExtraData ld d, $0 ld a, [wSpriteIndex] dec a @@ -2846,7 +2846,7 @@ PlayTrainerMusic:: ; 3379 (0:3379) ret z cp OPP_SONY3 ret z - ld a, [W_GYMLEADERNO] + ld a, [wGymLeaderNo] and a ret nz xor a @@ -3060,9 +3060,9 @@ SpriteFunc_34a1:: ; 34a1 (0:34a1) ; [wCoordIndex] = if there is match, the matching array index ; sets carry if the coordinates are in the array, clears carry if not ArePlayerCoordsInArray:: ; 34bc (0:34bc) - ld a,[W_YCOORD] + ld a,[wYCoord] ld b,a - ld a,[W_XCOORD] + ld a,[wXCoord] ld c,a ; fallthrough @@ -3197,7 +3197,7 @@ GetSpriteMovementByte1Pointer:: ; 354b (0:354b) ; returns the sprite movement byte 2 pointer for sprite [H_SPRITEINDEX] in hl GetSpriteMovementByte2Pointer:: ; 3555 (0:3555) push de - ld hl,W_MAPSPRITEDATA + ld hl,wMapSpriteData ld a,[H_SPRITEINDEX] dec a add a @@ -3826,7 +3826,7 @@ PrintLetterDelay:: ; 38c8 (0:38c8) ld a,[wLetterPrintingDelayFlags] bit 0,a jr z,.waitOneFrame - ld a,[W_OPTIONS] + ld a,[wOptions] and $f ld [H_FRAMECOUNTER],a jr .checkButtons @@ -3916,7 +3916,7 @@ CalcStat:: ; 393f (0:393f) ld a, b ld d, a push hl - ld hl, W_MONHEADER + ld hl, wMonHeader ld b, $0 add hl, bc ld a, [hl] ; read base value of stat @@ -4030,7 +4030,7 @@ CalcStat:: ; 393f (0:393f) ld [H_MULTIPLICAND+1], a xor a ld [H_MULTIPLICAND], a - ld a, [W_CURENEMYLVL] + ld a, [wCurEnemyLVL] ld [H_MULTIPLIER], a call Multiply ; ((Base + IV) * 2 + ceil(Sqrt(stat exp)) / 4) * Level ld a, [H_MULTIPLICAND] @@ -4048,7 +4048,7 @@ CalcStat:: ; 393f (0:393f) cp $1 ld a, 5 ; + 5 for non-HP stat jr nz, .notHPStat - ld a, [W_CURENEMYLVL] + ld a, [wCurEnemyLVL] ld b, a ld a, [H_MULTIPLICAND+2] add b @@ -4854,7 +4854,7 @@ GivePokemon:: ; 3e59 (0:3e59) ld a, b ld [wcf91], a ld a, c - ld [W_CURENEMYLVL], a + ld [wCurEnemyLVL], a xor a ; PLAYER_PARTY_DATA ld [wMonDataLocation], a jpba _GivePokemon ; 3d:66fa diff --git a/home/audio.asm b/home/audio.asm index e165d80d..d22990fb 100644 --- a/home/audio.asm +++ b/home/audio.asm @@ -69,7 +69,7 @@ PlayDefaultMusicCommon:: ; 2118 (0:2118) Func_21c8:: ; 21c8 (0:21c8) ; probably used to not change music upon getting on bike - ld a,[W_CURMAP] + ld a,[wCurMap] cp ROUTE_23 jr z,.asm_21e1 cp VICTORY_ROAD_1 diff --git a/home/fade.asm b/home/fade.asm index 2bdcbf01..7ac2e1c2 100644 --- a/home/fade.asm +++ b/home/fade.asm @@ -1,7 +1,7 @@ ; These routines manage gradual fading ; (e.g., entering a doorway) LoadGBPal:: ; 1e6f (0:1e6f) - ld a, [wMapPalOffset] ; tells if W_CURMAP is dark (requires HM5_FLASH?) + ld a, [wMapPalOffset] ; tells if wCurMap is dark (requires HM5_FLASH?) ld b, a ld hl, FadePal4 ld a, l diff --git a/home/overworld.asm b/home/overworld.asm index d851db7e..9d9b804a 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -62,7 +62,7 @@ OverworldLoopLessDelay:: ; 0245 (0:0245) ld a,[wd732] and a,1 << 4 | 1 << 3 ; fly warp or dungeon warp jp nz,HandleFlyWarpOrDungeonWarp - ld a,[W_CUROPPONENT] + ld a,[wCurOpponent] and a jp nz,.newBattle ld a,[wd730] @@ -117,15 +117,15 @@ OverworldLoopLessDelay:: ; 0245 (0:0245) ld [wLinkTimeoutCounter],a jp EnterMap ; predef LoadSAV -; ld a,[W_CURMAP] +; ld a,[wCurMap] ; ld [wDestinationMap],a ; call SpecialWarpIn -; ld a,[W_CURMAP] +; ld a,[wCurMap] ; call SwitchToMapRomBank ; switch to the ROM bank of the current map ; ld hl,wCurMapTileset ; set 7,[hl] .checkForOpponent - ld a,[W_CUROPPONENT] + ld a,[wCurOpponent] and a jp nz,.newBattle jp OverworldLoop @@ -252,7 +252,7 @@ OverworldLoopLessDelay:: ; 0245 (0:0245) and a jp nz,WarpFound2 .notSafariZone - ld a,[W_ISINBATTLE] + ld a,[wIsInBattle] and a jp nz,CheckWarpsNoCollision predef ApplyOutOfBattlePoisonDamage ; also increment daycare mon exp @@ -274,7 +274,7 @@ OverworldLoopLessDelay:: ; 0245 (0:0245) set 6,[hl] xor a ld [hJoyHeld],a - ld a,[W_CURMAP] + ld a,[wCurMap] cp a,CINNABAR_GYM jr nz,.notCinnabarGym ld hl,wd79b @@ -282,7 +282,7 @@ OverworldLoopLessDelay:: ; 0245 (0:0245) .notCinnabarGym ld hl,wd72e set 5,[hl] - ld a,[W_CURMAP] + ld a,[wCurMap] cp a,OAKS_LAB jp z,.noFaintCheck ; no blacking out if the player lost to the rival in Oak's lab callab AnyPartyAlive @@ -314,7 +314,7 @@ StepCountCheck:: ; 0457 (0:0457) AllPokemonFainted:: ; 0475 (0:0475) ld a,$ff - ld [W_ISINBATTLE],a + ld [wIsInBattle],a call RunMapScript jp HandleBlackOut @@ -344,7 +344,7 @@ DoBikeSpeedup:: ; 049d (0:049d) ld a,[wNPCMovementScriptPointerTableNum] and a ret nz - ld a,[W_CURMAP] + ld a,[wCurMap] cp ROUTE_17 ; cycling road jr nz,.goFaster ld a,[hJoyHeld] @@ -362,9 +362,9 @@ CheckWarpsNoCollision:: ; 04bd (0:04bd) ld b,0 ld a,[wNumberOfWarps] ld c,a - ld a,[W_YCOORD] + ld a,[wYCoord] ld d,a - ld a,[W_XCOORD] + ld a,[wXCoord] ld e,a ld hl,wWarpEntries CheckWarpsNoCollisionLoop:: ; 04d5 (0:04d5) @@ -422,12 +422,12 @@ CheckWarpsCollision:: ; 051a (0:051a) .loop ld a,[hli] ; Y coordinate of warp ld b,a - ld a,[W_YCOORD] + ld a,[wYCoord] cp b jr nz,.retry1 ld a,[hli] ; X coordinate of warp ld b,a - ld a,[W_XCOORD] + ld a,[wXCoord] cp b jr nz,.retry2 ld a,[hli] @@ -454,17 +454,17 @@ WarpFound2:: ; 054a (0:054a) ld a,[wNumberOfWarps] sub c ld [wWarpedFromWhichWarp],a ; save ID of used warp - ld a,[W_CURMAP] + ld a,[wCurMap] ld [wWarpedFromWhichMap],a call CheckIfInOutsideMap jr nz,.indoorMaps ; this is for handling "outside" maps that can't have the 0xFF destination map - ld a,[W_CURMAP] + ld a,[wCurMap] ld [wLastMap],a - ld a,[W_CURMAPWIDTH] + ld a,[wCurMapWidth] ld [wUnusedD366],a ; not read ld a,[hWarpDestinationMap] - ld [W_CURMAP],a + ld [wCurMap],a cp a,ROCK_TUNNEL_1 jr nz,.notRockTunnel ld a,$06 @@ -480,7 +480,7 @@ WarpFound2:: ; 054a (0:054a) cp a,$ff jr z,.goBackOutside ; if not going back to the previous map - ld [W_CURMAP],a + ld [wCurMap],a callba IsPlayerStandingOnWarpPadOrHole ld a,[wStandingOnWarpPadOrHole] dec a ; is the player on a warp pad? @@ -501,7 +501,7 @@ WarpFound2:: ; 054a (0:054a) .goBackOutside callab Func_fc69a ; 3f:469a ld a,[wLastMap] - ld [W_CURMAP],a + ld [wCurMap],a call PlayMapChangeSound xor a ld [wMapPalOffset],a @@ -514,19 +514,19 @@ WarpFound2:: ; 054a (0:054a) ; if no matching warp was found CheckMapConnections:: ; 05db (0:05db) .checkWestMap - ld a,[W_XCOORD] + ld a,[wXCoord] cp a,$ff jr nz,.checkEastMap ld a,[W_MAPCONN3PTR] - ld [W_CURMAP],a + ld [wCurMap],a ld a,[wWestConnectedMapXAlignment] ; new X coordinate upon entering west map - ld [W_XCOORD],a - ld a,[W_YCOORD] + ld [wXCoord],a + ld a,[wYCoord] ld c,a ld a,[wWestConnectedMapYAlignment] ; Y adjustment upon entering west map add c ld c,a - ld [W_YCOORD],a + ld [wYCoord],a ld a,[wWestConnectedMapViewPointer] ; pointer to upper left corner of map without adjustment for Y position ld l,a ld a,[wWestConnectedMapViewPointer + 1] @@ -554,15 +554,15 @@ CheckMapConnections:: ; 05db (0:05db) cp b jr nz,.checkNorthMap ld a,[W_MAPCONN4PTR] - ld [W_CURMAP],a + ld [wCurMap],a ld a,[wEastConnectedMapXAlignment] ; new X coordinate upon entering east map - ld [W_XCOORD],a - ld a,[W_YCOORD] + ld [wXCoord],a + ld a,[wYCoord] ld c,a ld a,[wEastConnectedMapYAlignment] ; Y adjustment upon entering east map add c ld c,a - ld [W_YCOORD],a + ld [wYCoord],a ld a,[wEastConnectedMapViewPointer] ; pointer to upper left corner of map without adjustment for Y position ld l,a ld a,[wEastConnectedMapViewPointer + 1] @@ -585,19 +585,19 @@ CheckMapConnections:: ; 05db (0:05db) ld [wCurrentTileBlockMapViewPointer + 1],a jp .loadNewMap .checkNorthMap - ld a,[W_YCOORD] + ld a,[wYCoord] cp a,$ff jr nz,.checkSouthMap ld a,[W_MAPCONN1PTR] - ld [W_CURMAP],a + ld [wCurMap],a ld a,[wNorthConnectedMapYAlignment] ; new Y coordinate upon entering north map - ld [W_YCOORD],a - ld a,[W_XCOORD] + ld [wYCoord],a + ld a,[wXCoord] ld c,a ld a,[wNorthConnectedMapXAlignment] ; X adjustment upon entering north map add c ld c,a - ld [W_XCOORD],a + ld [wXCoord],a ld a,[wNorthConnectedMapViewPointer] ; pointer to upper left corner of map without adjustment for X position ld l,a ld a,[wNorthConnectedMapViewPointer + 1] @@ -616,15 +616,15 @@ CheckMapConnections:: ; 05db (0:05db) cp b jr nz,.didNotEnterConnectedMap ld a,[W_MAPCONN2PTR] - ld [W_CURMAP],a + ld [wCurMap],a ld a,[wSouthConnectedMapYAlignment] ; new Y coordinate upon entering south map - ld [W_YCOORD],a - ld a,[W_XCOORD] + ld [wYCoord],a + ld a,[wXCoord] ld c,a ld a,[wSouthConnectedMapXAlignment] ; X adjustment upon entering south map add c ld c,a - ld [W_XCOORD],a + ld [wXCoord],a ld a,[wSouthConnectedMapViewPointer] ; pointer to upper left corner of map without adjustment for X position ld l,a ld a,[wSouthConnectedMapViewPointer + 1] @@ -690,7 +690,7 @@ CheckIfInOutsideMap:: ; 0712 (0:0712) ; "function 2" passes when the the tile in front of the player is among a certain set ; sets carry if the check passes, otherwise clears carry ExtraWarpCheck:: ; 071a (0:071a) - ld a, [W_CURMAP] + ld a, [wCurMap] cp SS_ANNE_3 jr z, .useFunction1 cp ROCKET_HIDEOUT_1 @@ -755,7 +755,7 @@ HandleFlyWarpOrDungeonWarp:: ; 0794 (0:0794) call Delay3 xor a ld [wBattleResult], a - ld [W_ISINBATTLE], a + ld [wIsInBattle], a ld [wMapPalOffset], a ld hl, wd732 set 2, [hl] ; fly warp or dungeon warp @@ -823,7 +823,7 @@ IsBikeRidingAllowed:: ; 0805 (0:0805) ; or maps with tilesets in BikeRidingTilesets. ; Return carry if biking is allowed. - ld a, [W_CURMAP] + ld a, [wCurMap] cp ROUTE_23 jr z, .allowed cp INDIGO_PLATEAU @@ -849,13 +849,13 @@ INCLUDE "data/bike_riding_tilesets.asm" ; load the tile pattern data of the current tileset into VRAM LoadTilesetTilePatternData:: ; 0828 (0:0828) - ld a,[W_TILESETGFXPTR] + ld a,[wTilesetGFXPtr] ld l,a - ld a,[W_TILESETGFXPTR + 1] + ld a,[wTilesetGFXPtr + 1] ld h,a ld de,vTileset ld bc,$600 - ld a,[W_TILESETBANK] + ld a,[wTilesetBank] jp FarCopyData ; this loads the current maps complete tile map (which references blocks, not individual tiles) to C6E8 @@ -869,7 +869,7 @@ LoadTileBlockMap:: ; 083c (0:083c) ; load tile map of current map (made of tile block IDs) ; a 3-byte border at the edges of the map is kept so that there is space for map connections ld hl,wOverworldMap - ld a,[W_CURMAPWIDTH] + ld a,[wCurMapWidth] ld [hMapWidth],a add a,MAP_BORDER * 2 ; east and west ld [hMapStride],a ; map width + border @@ -885,7 +885,7 @@ LoadTileBlockMap:: ; 083c (0:083c) ld e,a ld a,[W_MAPDATAPTR + 1] ld d,a ; de = tile map pointer - ld a,[W_CURMAPHEIGHT] + ld a,[wCurMapHeight] ld b,a .rowLoop ; copy one row each iteration push hl @@ -1003,7 +1003,7 @@ LoadNorthSouthConnectionsTileMap:: ; 0919 (0:0919) jr nc,.noCarry1 inc h .noCarry1 - ld a,[W_CURMAPWIDTH] + ld a,[wCurMapWidth] add a,MAP_BORDER * 2 add e ld e,a @@ -1032,7 +1032,7 @@ LoadEastWestConnectionsTileMap:: ; 093d (0:093d) jr nc,.noCarry1 inc h .noCarry1 - ld a,[W_CURMAPWIDTH] + ld a,[wCurMapWidth] add a,MAP_BORDER * 2 add e ld e,a @@ -1359,7 +1359,7 @@ TilePairCollisionsWater:: ; 0afc (0:0afc) LoadCurrentMapView:: ; 0b06 (0:0b06) ld a,[H_LOADEDROMBANK] push af - ld a,[W_TILESETBANK] ; tile data ROM bank + ld a,[wTilesetBank] ; tile data ROM bank call BankswitchCommon ; switch to ROM bank that contains tile data ld a,[wCurrentTileBlockMapViewPointer] ; address of upper left corner of current map view ld e,a @@ -1390,7 +1390,7 @@ LoadCurrentMapView:: ; 0b06 (0:0b06) jr nz,.rowInnerLoop ; update tile block map pointer to next row's address pop de - ld a,[W_CURMAPWIDTH] + ld a,[wCurMapWidth] add a,MAP_BORDER * 2 add e ld e,a @@ -1410,13 +1410,13 @@ LoadCurrentMapView:: ; 0b06 (0:0b06) ld hl,wTileMapBackup ld bc,$0000 .adjustForYCoordWithinTileBlock - ld a,[W_YBLOCKCOORD] + ld a,[wYBlockCoord] and a jr z,.adjustForXCoordWithinTileBlock ld bc,$0030 add hl,bc .adjustForXCoordWithinTileBlock - ld a,[W_XBLOCKCOORD] + ld a,[wXBlockCoord] and a jr z,.copyToVisibleAreaBuffer ld bc,$0002 @@ -1606,7 +1606,7 @@ ForceBikeDown:: ; 0c65 (0:0c65) ld a,[W_FLAGS_D733] bit 3,a ; check if a trainer wants a challenge ret nz - ld a,[W_CURMAP] + ld a,[wCurMap] cp a,ROUTE_17 ; Cycling Road ret nz ld a,[hJoyHeld] @@ -1743,7 +1743,7 @@ RunMapScript:: ; 0d2c (0:0d2c) pop de pop hl call RunNPCMovementScript - ld a,[W_CURMAP] ; current map number + ld a,[wCurMap] ; current map number call SwitchToMapRomBank ; change to the ROM bank the map's data is in ld hl,W_MAPSCRIPTPTR ld a,[hli] @@ -1816,7 +1816,7 @@ LoadMapHeader:: ; 0dab (0:0dab) .asm_0dbd ld a,[wCurMapTileset] ld [wUnusedD119],a - ld a,[W_CURMAP] + ld a,[wCurMap] call SwitchToMapRomBank ld a,[wCurMapTileset] ld b,a @@ -1914,13 +1914,13 @@ LoadMapHeader:: ; 0dab (0:0dab) .asm_0e73 callab LoadWildData ; 3:4b62 pop hl ; restore hl from before going to the warp/sign/sprite data (this value was saved for seemingly no purpose) - ld a,[W_CURMAPHEIGHT] ; map height in 4x4 tile blocks + ld a,[wCurMapHeight] ; map height in 4x4 tile blocks add a ; double it ld [wCurrentMapHeight2],a ; store map height in 2x2 tile blocks - ld a,[W_CURMAPWIDTH] ; map width in 4x4 tile blocks + ld a,[wCurMapWidth] ; map width in 4x4 tile blocks add a ; double it ld [wCurrentMapWidth2],a ; map width in 2x2 tile blocks - ld a,[W_CURMAP] + ld a,[wCurMap] ld c,a ld b,$00 ld a,[H_LOADEDROMBANK] @@ -2010,7 +2010,7 @@ Func_0f16:: ; 0f16 (0:0f16) push af call DisableLCD call ResetMapVariables - ld a,[W_CURMAP] + ld a,[wCurMap] call SwitchToMapRomBank call LoadScreenRelatedData call CopyMapViewToVRAM @@ -2024,7 +2024,7 @@ Func_0f16:: ; 0f16 (0:0f16) Func_0f3d:: ; 0f3d (0:0f3d) ld a,[H_LOADEDROMBANK] push af - ld a,[W_CURMAP] + ld a,[wCurMap] call SwitchToMapRomBank call LoadTileBlockMap pop af @@ -2097,7 +2097,7 @@ GetMapHeaderPointer:: ; 0fa7 (0:0fa7) push af switchbank MapHeaderPointers ; 3f:41f2 push de - ld a,[W_CURMAP] + ld a,[wCurMap] ld e,a ld d,$0 ld hl,MapHeaderPointers @@ -2154,20 +2154,20 @@ Func_0ffe:: ; 0ffe (0:0ffe) InitSprites:: ; 1006 (0:1006) ld a,[hli] - ld [W_NUMSPRITES],a ; save the number of sprites + ld [wNumSprites],a ; save the number of sprites push hl push de push bc call ZeroSpriteStateData call DisableRegularSprites - ld hl,W_MAPSPRITEDATA + ld hl,wMapSpriteData ld bc,$20 xor a call FillMemory pop bc pop de pop hl - ld a,[W_NUMSPRITES] + ld a,[wNumSprites] and a ; are sprites existant? ret z ; don't copy sprite data if not ld b,a @@ -2236,7 +2236,7 @@ DisableRegularSprites:: ; 1060 (0:1060) LoadSprite:: ; 106f (0:106f) push hl ld b,$0 - ld hl,W_MAPSPRITEDATA + ld hl,wMapSpriteData add hl,bc ld a,[$ff8d] ld [hli],a ; store movement byte 2 in byte 0 of sprite entry @@ -2254,7 +2254,7 @@ LoadSprite:: ; 106f (0:106f) jr nz,.itemBallSprite ; for regular sprites push hl - ld hl,W_MAPSPRITEEXTRADATA + ld hl,wMapSpriteExtraData add hl,bc ; zero both bytes, since regular sprites don't use this extra space xor a @@ -2269,7 +2269,7 @@ LoadSprite:: ; 106f (0:106f) ld a,[hli] ld [$ff8e],a ; save trainer number (within class) push hl - ld hl,W_MAPSPRITEEXTRADATA + ld hl,wMapSpriteExtraData add hl,bc ld a,[$ff8d] ld [hli],a ; store trainer class in byte 0 of the entry @@ -2282,7 +2282,7 @@ LoadSprite:: ; 106f (0:106f) ld a,[hli] ld [$ff8d],a ; save item number push hl - ld hl,W_MAPSPRITEEXTRADATA + ld hl,wMapSpriteExtraData add hl,bc ld a,[$ff8d] ld [hli],a ; store item number in byte 0 of the entry |
