From fd2235e678c58cebd6255b5e658e704ee5138591 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Sat, 11 Jun 2016 21:30:05 -0700 Subject: sync engine code with pokeyellow --- engine/overworld/card_key.asm | 2 +- engine/overworld/cut.asm | 2 +- engine/overworld/elevator.asm | 4 +-- engine/overworld/emotion_bubbles.asm | 8 ++--- engine/overworld/hidden_items.asm | 20 ++++++------- engine/overworld/movement.asm | 19 ++++++------ engine/overworld/oam.asm | 2 +- engine/overworld/player_animations.asm | 2 +- engine/overworld/pokemart.asm | 2 +- engine/overworld/trainers.asm | 54 +++++++++++++++++----------------- 10 files changed, 57 insertions(+), 58 deletions(-) (limited to 'engine/overworld') diff --git a/engine/overworld/card_key.asm b/engine/overworld/card_key.asm index 61e512de..afc55902 100755 --- a/engine/overworld/card_key.asm +++ b/engine/overworld/card_key.asm @@ -73,7 +73,7 @@ SilphCoMapList: CardKeySuccessText: TX_FAR _CardKeySuccessText1 - db $0b + TX_SFX_ITEM TX_FAR _CardKeySuccessText2 db "@" diff --git a/engine/overworld/cut.asm b/engine/overworld/cut.asm index 2f13dfba..f6ae6468 100755 --- a/engine/overworld/cut.asm +++ b/engine/overworld/cut.asm @@ -74,7 +74,7 @@ UsedCutText: InitCutAnimOAM: xor a ld [wWhichAnimationOffsets], a - ld a, $e4 + ld a, %11100100 ld [rOBP1], a ld a, [wCutTile] cp $52 diff --git a/engine/overworld/elevator.asm b/engine/overworld/elevator.asm index 4ec34922..929e4f22 100755 --- a/engine/overworld/elevator.asm +++ b/engine/overworld/elevator.asm @@ -34,7 +34,7 @@ ShakeElevator: call PlayMusic .musicLoop ld a, [wChannelSoundIDs + CH4] - cp $b9 + cp SFX_SAFARI_ZONE_PA jr z, .musicLoop call UpdateSprites jp PlayDefaultMusic @@ -56,7 +56,7 @@ ShakeElevatorRedrawRow: add hl, de ld a, h and $3 - or $98 + or vBGMap0 / $100 ld d, a ld a, l pop hl diff --git a/engine/overworld/emotion_bubbles.asm b/engine/overworld/emotion_bubbles.asm index 4df8b6f6..ac4276bd 100755 --- a/engine/overworld/emotion_bubbles.asm +++ b/engine/overworld/emotion_bubbles.asm @@ -17,11 +17,11 @@ EmotionBubble: ld [wUpdateSpritesEnabled], a ld a, [wd736] bit 6, a ; are the last 4 OAM entries reserved for a shadow or fishing rod? - ld hl, wOAMBuffer + $8f - ld de, wOAMBuffer + $9f + ld hl, wOAMBuffer + 4 * 35 + $3 ; $8f + ld de, wOAMBuffer + 4 * 39 + $3 ; $9f jr z, .next - ld hl, wOAMBuffer + $7f - ld de, wOAMBuffer + $8f + ld hl, wOAMBuffer + 4 * 31 + $3 ; $7f + ld de, wOAMBuffer + 4 * 35 + $3 ; $8f ; Copy OAM data 16 bytes forward to make room for emotion bubble OAM data at the ; start of the OAM buffer. diff --git a/engine/overworld/hidden_items.asm b/engine/overworld/hidden_items.asm index 11e6ad55..dae85c28 100755 --- a/engine/overworld/hidden_items.asm +++ b/engine/overworld/hidden_items.asm @@ -27,7 +27,7 @@ FoundHiddenItemText: ld b, a ld c, 1 call GiveItem - jr nc, .BagFull + jr nc, .bagFull ld hl, wObtainedHiddenItemsFlags ld a, [wHiddenItemOrCoinsIndex] ld c, a @@ -37,7 +37,7 @@ FoundHiddenItemText: call PlaySoundWaitForCurrent call WaitForSoundToFinish jp TextScriptEnd -.BagFull +.bagFull call WaitForTextScrollButtonPress ; wait for button press xor a ld [wDoNotWaitForButtonPressAfterDisplayingText], a @@ -77,24 +77,24 @@ HiddenCoins: cp 20 jr z, .bcd20 cp 40 - jr z, .bcd20 + jr z, .bcd20 ; should be bcd40 jr .bcd100 .bcd10 ld a, $10 ld [hCoins + 1], a - jr .bcddone + jr .bcdDone .bcd20 ld a, $20 ld [hCoins + 1], a - jr .bcddone + jr .bcdDone .bcd40 ; due to a typo, this is never used ld a, $40 ld [hCoins + 1], a - jr .bcddone + jr .bcdDone .bcd100 ld a, $1 ld [hCoins], a -.bcddone +.bcdDone ld de, wPlayerCoins + 1 ld hl, hCoins + 1 ld c, $2 @@ -107,13 +107,13 @@ HiddenCoins: call EnableAutoTextBoxDrawing ld a, [wPlayerCoins] cp $99 - jr nz, .RoomInCoinCase + jr nz, .roomInCoinCase ld a, [wPlayerCoins + 1] cp $99 - jr nz, .RoomInCoinCase + jr nz, .roomInCoinCase tx_pre_id DroppedHiddenCoinsText jr .done -.RoomInCoinCase +.roomInCoinCase tx_pre_id FoundHiddenCoinsText .done jp PrintPredefTextID diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm index e60f820a..9302b6e3 100644 --- a/engine/overworld/movement.asm +++ b/engine/overworld/movement.asm @@ -393,7 +393,7 @@ UpdateSpriteMovementDelay: ld l, a ld [hl], $1 ; c1x1 = 1 (mark as ready to move) notYetMoving: - ld h, $c1 + ld h, wSpriteStateData1 / $100 ld a, [H_CURRENTSPRITEOFFSET] add $8 ld l, a @@ -408,7 +408,6 @@ MakeNPCFacePlayer: ld a, [wd72d] bit 5, a jr nz, notYetMoving - res 7, [hl] ld a, [wPlayerDirection] bit PLAYER_DIR_BIT_UP, a @@ -449,7 +448,7 @@ InitializeSpriteStatus: ; calculates the spprite's scrren position form its map position and the player position InitializeSpriteScreenPosition: - ld h, $c2 + ld h, wSpriteStateData2 / $100 ld a, [H_CURRENTSPRITEOFFSET] add $4 ld l, a @@ -477,7 +476,7 @@ CheckSpriteAvailability: ld a, [$ffe5] and a jp nz, .spriteInvisible - ld h, $c2 + ld h, wSpriteStateData2 / $100 ld a, [H_CURRENTSPRITEOFFSET] add $6 ld l, a @@ -525,7 +524,7 @@ CheckSpriteAvailability: cp d jr c, .spriteVisible ; standing on tile with ID >=$60 (top right tile) .spriteInvisible - ld h, $c1 + ld h, wSpriteStateData1 / $100 ld a, [H_CURRENTSPRITEOFFSET] add $2 ld l, a @@ -579,7 +578,7 @@ UpdateSpriteImage: ; e: X movement delta (-1, 0 or 1) ; set carry on failure, clears carry on success CanWalkOntoTile: - ld h, $c2 + ld h, wSpriteStateData2 / $100 ld a, [H_CURRENTSPRITEOFFSET] add $6 ld l, a @@ -607,7 +606,7 @@ CanWalkOntoTile: ld a, [hl] ; $c2x6 (movement byte 1) inc a jr z, .impassable ; if $ff, no movement allowed (however, changing direction is) - ld h, $c1 + ld h, wSpriteStateData1 / $100 ld a, [H_CURRENTSPRITEOFFSET] add $4 ld l, a @@ -626,14 +625,14 @@ CanWalkOntoTile: call DetectCollisionBetweenSprites pop bc pop de - ld h, $c1 + ld h, wSpriteStateData1 / $100 ld a, [H_CURRENTSPRITEOFFSET] add $c ld l, a ld a, [hl] ; c1xc (directions in which sprite collision would occur) and b ; check against chosen direction (1,2,4 or 8) jr nz, .impassable ; collision between sprites, don't go there - ld h, $c2 + ld h, wSpriteStateData2 / $100 ld a, [H_CURRENTSPRITEOFFSET] add $2 ld l, a @@ -690,7 +689,7 @@ CanWalkOntoTile: ; this is always the lower left tile of the 2x2 tile blocks all sprites are snapped to ; hl: output pointer GetTileSpriteStandsOn: - ld h, $c1 + ld h, wSpriteStateData1 / $100 ld a, [H_CURRENTSPRITEOFFSET] add $4 ld l, a diff --git a/engine/overworld/oam.asm b/engine/overworld/oam.asm index 94082beb..2c2a3dff 100644 --- a/engine/overworld/oam.asm +++ b/engine/overworld/oam.asm @@ -6,7 +6,7 @@ PrepareOAMData: dec a jr z, .updateEnabled - cp 0 - 1 + cp -1 ret nz ld [wUpdateSpritesEnabled], a jp HideSprites diff --git a/engine/overworld/player_animations.asm b/engine/overworld/player_animations.asm index f7b63aaa..a17e67bd 100755 --- a/engine/overworld/player_animations.asm +++ b/engine/overworld/player_animations.asm @@ -388,7 +388,7 @@ FishingAnim: set 6, [hl] ; reserve the last 4 OAM entries ld de, RedSprite ld hl, vNPCSprites - lb bc, BANK(RedSprite), $0c + lb bc, BANK(RedSprite), $c call CopyVideoData ld a, $4 ld hl, RedFishingTiles diff --git a/engine/overworld/pokemart.asm b/engine/overworld/pokemart.asm index e50c508e..823939b1 100755 --- a/engine/overworld/pokemart.asm +++ b/engine/overworld/pokemart.asm @@ -85,7 +85,7 @@ DisplayPokemartDialogue_: lb bc, 14, 1 ; location that PrintText always prints to, this is useless call PrintText coord hl, 14, 7 - lb bc, 08, 15 + lb bc, 8, 15 ld a,TWO_OPTION_MENU ld [wTextBoxID],a call DisplayTextBoxID ; yes/no menu diff --git a/engine/overworld/trainers.asm b/engine/overworld/trainers.asm index 1d0340c9..655c6b2a 100755 --- a/engine/overworld/trainers.asm +++ b/engine/overworld/trainers.asm @@ -4,16 +4,16 @@ _GetSpritePosition1: ld a, [wSpriteIndex] ld [H_SPRITEINDEX], a call GetSpriteDataPointer - ld a, [hli] + ld a, [hli] ; c1x4 (screen Y pos) ld [$ffeb], a inc hl - ld a, [hl] + ld a, [hl] ; c1x6 (screen X pos) ld [$ffec], a - ld de, $fe + ld de, (wSpriteStateData2 + $4) - (wSpriteStateData1 + $6) add hl, de - ld a, [hli] + ld a, [hli] ; c2x4 (map Y pos) ld [$ffed], a - ld a, [hl] + ld a, [hl] ; c2x5 (map X pos) ld [$ffee], a ret @@ -28,7 +28,7 @@ _GetSpritePosition2: inc hl ld a, [hl] ; c1x6 (screen X pos) ld [wSavedSpriteScreenX], a - ld de, $104 - $6 + ld de, (wSpriteStateData2 + $4) - (wSpriteStateData1 + $6) add hl, de ld a, [hli] ; c2x4 (map Y pos) ld [wSavedSpriteMapY], a @@ -47,7 +47,7 @@ _SetSpritePosition1: inc hl ld a, [$ffec] ; c1x6 (screen X pos) ld [hl], a - ld de, $104 - $6 + ld de, (wSpriteStateData2 + $4) - (wSpriteStateData1 + $6) add hl, de ld a, [$ffed] ; c2x4 (map Y pos) ld [hli], a @@ -57,21 +57,21 @@ _SetSpritePosition1: _SetSpritePosition2: ld hl, wSpriteStateData1 - ld de, $0004 + ld de, 4 ld a, [wSpriteIndex] ld [H_SPRITEINDEX], a call GetSpriteDataPointer ld a, [wSavedSpriteScreenY] - ld [hli], a + ld [hli], a ; c1x4 (screen Y pos) inc hl ld a, [wSavedSpriteScreenX] - ld [hl], a - ld de, $00fe + ld [hl], a ; c1x6 (screen X pos) + ld de, (wSpriteStateData2 + $4) - (wSpriteStateData1 + $6) add hl, de ld a, [wSavedSpriteMapY] - ld [hli], a + ld [hli], a ; c2x4 (map Y pos) ld a, [wSavedSpriteMapX] - ld [hl], a + ld [hl], a ; c2x5 (map X pos) ret TrainerWalkUpToPlayer: @@ -80,11 +80,11 @@ TrainerWalkUpToPlayer: ld [wTrainerSpriteOffset], a call ReadTrainerScreenPosition ld a, [wTrainerFacingDirection] - and a + and a ; SPRITE_FACING_DOWN jr z, .facingDown - cp $4 + cp SPRITE_FACING_UP jr z, .facingUp - cp $8 + cp SPRITE_FACING_LEFT jr z, .facingLeft jr .facingRight .facingDown @@ -148,7 +148,7 @@ TrainerWalkUpToPlayer: jp MoveSprite_ ; input: de = offset within sprite entry -; output: de = pointer to sprite data +; output: hl = pointer to sprite data GetSpriteDataPointer: push de add hl, de @@ -225,7 +225,7 @@ TrainerEngage: set 0, [hl] call EngageMapTrainer ld a, $ff -.noEngage: +.noEngage ld [wTrainerSpriteOffset], a pop de pop hl @@ -239,7 +239,7 @@ ReadTrainerScreenPosition: ld e, a ld hl, wSpriteStateData1 add hl, de - ld a, [hl] + ld a, [hl] ; c1x4 (sprite Y pos) ld [wTrainerScreenY], a ld a, [wTrainerSpriteOffset] add $6 @@ -247,7 +247,7 @@ ReadTrainerScreenPosition: ld e, a ld hl, wSpriteStateData1 add hl, de - ld a, [hl] + ld a, [hl] ; c1x6 (sprite X pos) ld [wTrainerScreenX], a ret @@ -262,13 +262,13 @@ CheckSpriteCanSeePlayer: jr .notInLine ; player too far away .checkIfLinedUp ld a, [wTrainerFacingDirection] ; sprite facing direction - cp $0 ; down + cp SPRITE_FACING_DOWN jr z, .checkXCoord - cp $4 ; up + cp SPRITE_FACING_UP jr z, .checkXCoord - cp $8 ; left + cp SPRITE_FACING_LEFT jr z, .checkYCoord - cp $c ; right + cp SPRITE_FACING_RIGHT jr z, .checkYCoord jr .notInLine .checkXCoord @@ -315,21 +315,21 @@ CheckPlayerIsInFrontOfSprite: ld a, [hl] ; c1x6 (sprite screen X pos) ld [wTrainerScreenX], a ld a, [wTrainerFacingDirection] ; facing direction - cp $0 + cp SPRITE_FACING_DOWN jr nz, .notFacingDown ld a, [wTrainerScreenY] ; sprite screen Y pos cp $3c jr c, .engage ; sprite above player jr .noEngage ; sprite below player .notFacingDown - cp $4 + cp SPRITE_FACING_UP jr nz, .notFacingUp ld a, [wTrainerScreenY] ; sprite screen Y pos cp $3c jr nc, .engage ; sprite below player jr .noEngage ; sprite above player .notFacingUp - cp $8 + cp SPRITE_FACING_LEFT jr nz, .notFacingLeft ld a, [wTrainerScreenX] ; sprite screen X pos cp $40 -- cgit v1.3.1-sl0p From bcb251261dae3cd9ba423fc139c7db4433a1a802 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Sun, 12 Jun 2016 01:06:27 -0700 Subject: sync tileset WRAM labels --- engine/cable_club.asm | 10 +++++----- engine/items/items.asm | 2 +- engine/overworld/movement.asm | 4 ++-- home/overworld.asm | 18 +++++++++--------- main.asm | 4 ++-- wram.asm | 10 +++++----- 6 files changed, 24 insertions(+), 24 deletions(-) (limited to 'engine/overworld') diff --git a/engine/cable_club.asm b/engine/cable_club.asm index 9d72d220..c3a5e235 100755 --- a/engine/cable_club.asm +++ b/engine/cable_club.asm @@ -900,16 +900,16 @@ CableClub_Run: call CableClub_DoBattleOrTrade ld hl, Club_GFX ld a, h - ld [wTileSetGFXPtr + 1], a + ld [wTilesetGfxPtr + 1], a ld a, l - ld [wTileSetGFXPtr], a + ld [wTilesetGfxPtr], a ld a, Bank(Club_GFX) - ld [wTileSetBank], a + ld [wTilesetBank], a ld hl, Club_Coll ld a, h - ld [wTileSetCollisionPtr + 1], a + ld [wTilesetCollisionPtr + 1], a ld a, l - ld [wTileSetCollisionPtr], a + ld [wTilesetCollisionPtr], a xor a ld [wGrassRate], a inc a ; LINK_STATE_IN_CABLE_CLUB diff --git a/engine/items/items.asm b/engine/items/items.asm index a6717494..24489690 100755 --- a/engine/items/items.asm +++ b/engine/items/items.asm @@ -695,7 +695,7 @@ ItemUseSurfboard: ld hl,TilePairCollisionsWater call CheckForTilePairCollisions jr c,.cannotStopSurfing - ld hl,wTileSetCollisionPtr ; pointer to list of passable tiles + ld hl,wTilesetCollisionPtr ; pointer to list of passable tiles ld a,[hli] ld h,[hl] ld l,a ; hl now points to passable tiles diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm index 9302b6e3..6d05859e 100644 --- a/engine/overworld/movement.asm +++ b/engine/overworld/movement.asm @@ -589,9 +589,9 @@ CanWalkOntoTile: and a ret .notScripted - ld a, [wTileSetCollisionPtr] + ld a, [wTilesetCollisionPtr] ld l, a - ld a, [wTileSetCollisionPtr+1] + ld a, [wTilesetCollisionPtr+1] ld h, a .tilePassableLoop ld a, [hli] diff --git a/home/overworld.asm b/home/overworld.asm index fad9f29d..8ec457c1 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -854,13 +854,13 @@ INCLUDE "data/bike_riding_tilesets.asm" ; load the tile pattern data of the current tileset into VRAM LoadTilesetTilePatternData:: - ld a,[wTileSetGFXPtr] + ld a,[wTilesetGfxPtr] ld l,a - ld a,[wTileSetGFXPtr + 1] + ld a,[wTilesetGfxPtr + 1] ld h,a ld de,vTileset ld bc,$600 - ld a,[wTileSetBank] + ld a,[wTilesetBank] jp FarCopyData2 ; this loads the current maps complete tile map (which references blocks, not individual tiles) to C6E8 @@ -1100,7 +1100,7 @@ IsSpriteOrSignInFrontOfPlayer:: ; check if the player is front of a counter in a pokemon center, pokemart, etc. and if so, extend the range at which he can talk to the NPC .extendRangeOverCounter predef GetTileAndCoordsInFrontOfPlayer ; get the tile in front of the player in c - ld hl,wTileSetTalkingOverTiles ; list of tiles that extend talking range (counter tiles) + ld hl,wTilesetTalkingOverTiles ; list of tiles that extend talking range (counter tiles) ld b,3 ld d,$20 ; talking range in pixels (long range) .counterTilesLoop @@ -1242,7 +1242,7 @@ CheckTilePassable:: predef GetTileAndCoordsInFrontOfPlayer ; get tile in front of player ld a,[wTileInFrontOfPlayer] ; tile in front of player ld c,a - ld hl,wTileSetCollisionPtr ; pointer to list of passable tiles + ld hl,wTilesetCollisionPtr ; pointer to list of passable tiles ld a,[hli] ld h,[hl] ld l,a ; hl now points to passable tiles @@ -1354,7 +1354,7 @@ TilePairCollisionsWater:: LoadCurrentMapView:: ld a,[H_LOADEDROMBANK] push af - ld a,[wTileSetBank] ; tile data ROM bank + ld a,[wTilesetBank] ; tile data ROM bank ld [H_LOADEDROMBANK],a ld [MBC1RomBank],a ; switch to ROM bank that contains tile data ld a,[wCurrentTileBlockMapViewPointer] ; address of upper left corner of current map view @@ -1784,9 +1784,9 @@ ScheduleWestColumnRedraw:: ; Input: c = tile block ID, hl = destination address DrawTileBlock:: push hl - ld a,[wTileSetBlocksPtr] ; pointer to tiles + ld a,[wTilesetBlocksPtr] ; pointer to tiles ld l,a - ld a,[wTileSetBlocksPtr + 1] + ld a,[wTilesetBlocksPtr + 1] ld h,a ld a,c swap a @@ -1915,7 +1915,7 @@ CollisionCheckOnWater:: jr z,.noCollision ; keep surfing ; check if the [land] tile in front of the player is passable .checkIfNextTileIsPassable - ld hl,wTileSetCollisionPtr ; pointer to list of passable tiles + ld hl,wTilesetCollisionPtr ; pointer to list of passable tiles ld a,[hli] ld h,[hl] ld l,a diff --git a/main.asm b/main.asm index 6c51de59..53d2dfdb 100755 --- a/main.asm +++ b/main.asm @@ -2435,7 +2435,7 @@ GetTileTwoStepsInFrontOfPlayer: CheckForCollisionWhenPushingBoulder: call GetTileTwoStepsInFrontOfPlayer - ld hl, wTileSetCollisionPtr + ld hl, wTilesetCollisionPtr ld a, [hli] ld h, [hl] ld l, a @@ -2665,7 +2665,7 @@ LoadTilesetHeader: ld e, a ld hl, Tilesets add hl, de - ld de, wTileSetBank + ld de, wTilesetBank ld c, $b .copyTilesetHeaderLoop ld a, [hli] diff --git a/wram.asm b/wram.asm index d5d6a025..0321545c 100755 --- a/wram.asm +++ b/wram.asm @@ -2637,21 +2637,21 @@ wPlayerDirection:: ; d52a ; if the player is not moving, the last the direction in which the player moved ds 1 -wTileSetBank:: ; d52b +wTilesetBank:: ; d52b ds 1 -wTileSetBlocksPtr:: ; d52c +wTilesetBlocksPtr:: ; d52c ; maps blocks (4x4 tiles) to tiles ds 2 -wTileSetGFXPtr:: ; d52e +wTilesetGfxPtr:: ; d52e ds 2 -wTileSetCollisionPtr:: ; d530 +wTilesetCollisionPtr:: ; d530 ; list of all walkable tiles ds 2 -wTileSetTalkingOverTiles:: ; d532 +wTilesetTalkingOverTiles:: ; d532 ds 3 wGrassTile:: ; d535 -- cgit v1.3.1-sl0p