diff options
Diffstat (limited to 'engine/overworld')
-rwxr-xr-x | engine/overworld/cable_club_npc.asm | 2 | ||||
-rw-r--r-- | engine/overworld/check_player_state.asm | 2 | ||||
-rw-r--r-- | engine/overworld/get_coords_tile_in_front_of_player.asm | 4 | ||||
-rw-r--r-- | engine/overworld/is_player_just_outside_map.asm | 2 | ||||
-rw-r--r-- | engine/overworld/load_wild_data.asm | 2 | ||||
-rw-r--r-- | engine/overworld/map_sprite_functions1.asm | 4 | ||||
-rwxr-xr-x | engine/overworld/map_sprites.asm | 31 | ||||
-rw-r--r-- | engine/overworld/movement.asm | 24 | ||||
-rwxr-xr-x | engine/overworld/npc_movement_2.asm | 24 | ||||
-rw-r--r-- | engine/overworld/oam.asm | 12 | ||||
-rwxr-xr-x | engine/overworld/player_animations.asm | 4 | ||||
-rwxr-xr-x | engine/overworld/pokecenter.asm | 6 | ||||
-rw-r--r-- | engine/overworld/step_functions.asm | 2 |
13 files changed, 71 insertions, 48 deletions
diff --git a/engine/overworld/cable_club_npc.asm b/engine/overworld/cable_club_npc.asm index f60042de..bc1a553a 100755 --- a/engine/overworld/cable_club_npc.asm +++ b/engine/overworld/cable_club_npc.asm @@ -165,7 +165,7 @@ Serial_SyncAndExchangeNybbleDouble: ; 7131 (1:7131) ld [wUnknownSerialCounter], a ld [wUnknownSerialCounter + 1], a ret - + CableClubNPCAreaReservedFor2FriendsLinkedByCableText: ; 7188 (1:7188) TX_FAR _CableClubNPCAreaReservedFor2FriendsLinkedByCableText db "@" diff --git a/engine/overworld/check_player_state.asm b/engine/overworld/check_player_state.asm index 0fc73bc7..5dd91c4c 100644 --- a/engine/overworld/check_player_state.asm +++ b/engine/overworld/check_player_state.asm @@ -83,7 +83,7 @@ CheckForceBikeOrSurf: ; c0d2 (3:40d2) ld [wWalkBikeSurfStateCopy], a call ForceBikeOrSurf ret - + INCLUDE "data/force_bike_surf.asm" IsPlayerFacingEdgeOfMap: ; c148 (3:4148) diff --git a/engine/overworld/get_coords_tile_in_front_of_player.asm b/engine/overworld/get_coords_tile_in_front_of_player.asm index ce45e79c..1003570b 100644 --- a/engine/overworld/get_coords_tile_in_front_of_player.asm +++ b/engine/overworld/get_coords_tile_in_front_of_player.asm @@ -1,6 +1,6 @@ GetTileAndCoordsInFrontOfPlayer: ; c2d4 (3:42d1) call GetPredefRegisters - + _GetTileAndCoordsInFrontOfPlayer: ; c2d4 (3:42d4) ld a, [wYCoord] ld d, a @@ -37,7 +37,7 @@ _GetTileAndCoordsInFrontOfPlayer: ; c2d4 (3:42d4) ld c, a ld [wTileInFrontOfPlayer], a ret - + GetTileTwoStepsInFrontOfPlayer: ; c309 (3:4309) xor a ld [$ffdb], a diff --git a/engine/overworld/is_player_just_outside_map.asm b/engine/overworld/is_player_just_outside_map.asm index e9ba204a..19823c53 100644 --- a/engine/overworld/is_player_just_outside_map.asm +++ b/engine/overworld/is_player_just_outside_map.asm @@ -1,5 +1,5 @@ ; returns whether the player is one tile outside the map in Z -IsPlayerJustOutsideMap: ; 128d8 (4:68d8) +IsPlayerJustOutsideMap: ; e876c (3a:476c) ld a, [wYCoord] ld b, a ld a, [wCurMapHeight] diff --git a/engine/overworld/load_wild_data.asm b/engine/overworld/load_wild_data.asm index 083e08bf..71e3fe2a 100644 --- a/engine/overworld/load_wild_data.asm +++ b/engine/overworld/load_wild_data.asm @@ -29,5 +29,5 @@ LoadWildData: ; cb62 (3:4b62) ld de,wWaterMons ; otherwise, load surfing data ld bc,$0014 jp CopyData - + INCLUDE "data/wild_mons.asm"
\ No newline at end of file diff --git a/engine/overworld/map_sprite_functions1.asm b/engine/overworld/map_sprite_functions1.asm index 46479a9f..722fc14e 100644 --- a/engine/overworld/map_sprite_functions1.asm +++ b/engine/overworld/map_sprite_functions1.asm @@ -55,7 +55,7 @@ UpdateNonPlayerSprite: ; 4be3 (1:4be3) ; multiple of $10 to make comparisons easier. DetectCollisionBetweenSprites: ; 4bf7 (1:4bf7) ; nop - + ld h, wSpriteStateData1 / $100 ld a, [H_CURRENTSPRITEOFFSET] ld l, a @@ -355,7 +355,7 @@ Func_4d0a: ; 4d0a (1:4d0a) inc l inc l ret - + SetSpriteCollisionValues: ; 4d22 (1:4d22) and a ld b, 0 diff --git a/engine/overworld/map_sprites.asm b/engine/overworld/map_sprites.asm index 68f6b006..10f0362e 100755 --- a/engine/overworld/map_sprites.asm +++ b/engine/overworld/map_sprites.asm @@ -16,7 +16,7 @@ _InitMapSprites: ; 1401b (5:401b) call LoadMapSpriteTilePatterns call Func_14150 ret - + ; Loads sprite set for outside maps (cities and routes) and sets VRAM slots. ; sets carry if the map is a city or route, unsets carry if not InitOutsideMapSprites: ; 14029 (5:4029) @@ -49,7 +49,7 @@ InitOutsideMapSprites: ; 14029 (5:4029) call Func_14150 scf ret - + LoadSpriteSetFromMapHeader: ; 14061 (5:4061) ; This loop stores the correct VRAM tile pattern slots according the sprite ; data from the map's header. Since the VRAM tile pattern slots are filled in @@ -81,7 +81,7 @@ LoadSpriteSetFromMapHeader: ; 14061 (5:4061) jr .continue .isFourTileSprite -; loop through the space reserved for regular picture IDs +; loop through the space reserved for regular picture IDs ld de, wSpriteSet ld b, 9 call CheckIfPictureIDAlreadyLoaded @@ -100,11 +100,11 @@ CheckIfPictureIDAlreadyLoaded: ; 1409b (5:409b) .loop ld a, [de] and a ; is sprite set slot not taken up yet? - jr z, .spriteSlotNotTaken ; if so, load it as it signifies we've reached + jr z, .spriteSlotNotTaken ; if so, load it as it signifies we've reached ; the end of data for the last sprite set cp c ; is the tile pattern already loaded? - ret z ; don't redundantly load + ret z ; don't redundantly load dec b ; have we reached the end of the sprite set? jr z, .spriteNotAlreadyLoaded ; if so, we're done here inc de @@ -124,7 +124,7 @@ CheckForFourTileSprite: ; 140ac (5:40ac) ; Else, returns carry if the sprite uses 4 tiles cp SPRITE_PIKACHU ; is this the Pikachu Sprite? ret z ; return if yes - + cp SPRITE_BALL ; is this a four tile sprite? jr nc, .notYellowSprite ; set carry if yes ; regular sprite @@ -132,7 +132,7 @@ CheckForFourTileSprite: ; 140ac (5:40ac) ret .notYellowSprite - scf + scf ret LoadMapSpriteTilePatterns: ; 140b7 (5:40b7) @@ -153,7 +153,7 @@ LoadMapSpriteTilePatterns: ; 140b7 (5:40b7) cp 11 jr nz, .loop ret - + ReloadWalkingTilePatterns: ; 140d2 (5:40d2) xor a .loop @@ -167,7 +167,7 @@ ReloadWalkingTilePatterns: ; 140d2 (5:40d2) cp 11 jr nz, .loop ret - + LoadStillTilePattern: ; 140e4 (5:40e4) ld a, [wFontLoaded] bit 0, a ; reloading upper half of tile patterns after displaying text? @@ -177,7 +177,7 @@ LoadStillTilePattern: ; 140e4 (5:40e4) call GetSpriteVRAMAddress call CopyVideoDataAlternate ; new yellow function ret - + LoadWalkingTilePattern: ; 140f5 (5:40f5) call ReadSpriteSheetData ret nc @@ -189,7 +189,7 @@ LoadWalkingTilePattern: ; 140f5 (5:40f5) set 3, h ; add $800 to hl call CopyVideoDataAlternate ret - + GetSpriteVRAMAddress: ; 14018 (5:4108) push bc ld a, [hVRAMSlot] @@ -203,7 +203,7 @@ GetSpriteVRAMAddress: ; 14018 (5:4108) ld l, a pop bc ret - + SpriteVRAMAddresses: ; 14118 (5:4118) ; Equivalent to multiplying $C0 (number of bytes in 12 tiles) times the VRAM ; slot and adding the result to $8000 (the VRAM base address). @@ -218,7 +218,7 @@ SpriteVRAMAddresses: ; 14118 (5:4118) dw vChars0 + $6c0 dw vChars0 + $780 ; 4-tile sprites dw vChars0 + $7c0 ; 4-tile sprites - + ReadSpriteSheetData: ; 1412e (5:412e) ld a, [hVRAMSlot] ld e, a @@ -248,13 +248,12 @@ ReadSpriteSheetData: ; 1412e (5:412e) inc hl scf ret - + Func_14150: ; 14150 (5:4150) ld a, $1 ld [wPlayerSpriteImageBaseOffset], a ; vram slot for player ld a, $2 ld [wPikachuSpriteImageBaseOffset], a ; vram slot for Pikachu - ld a, $e ld hl, wSprite01SpriteStateData1 .loop @@ -275,7 +274,7 @@ Func_14150: ; 14150 (5:4150) dec a jr nz, .loop ret - + Func_14179: ; 14179 (5:4179) push de push bc diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm index 6bd28dad..5f929ce3 100644 --- a/engine/overworld/movement.asm +++ b/engine/overworld/movement.asm @@ -93,7 +93,7 @@ Func_4e32: ; 4e32 (1:4e32) add b ld [wSpriteStateData1 + 2], a ret - + UpdateNPCSprite: ; 4e3e (1:4e3e) ld a, [H_CURRENTSPRITEOFFSET] swap a @@ -836,7 +836,7 @@ AdvanceScriptedNPCAnimFrameCounter: ; 5264 (1:5264) and $3 ld [hSpriteAnimFrameCounter], a ret - + Func_5274: ; 5274 (1:5274) ld a, [H_CURRENTSPRITEOFFSET] add $7 @@ -853,7 +853,7 @@ Func_5274: ; 5274 (1:5274) and $3 ld [hl], a ; advance to next animation frame every 4 ticks (16 ticks total for one step) ret - + Func_5288: ; 5288 (1:5288) ; nice lookup table ; a is supposedly [wNPCMovementDirections + $fe] @@ -914,7 +914,7 @@ Func_5288: ; 5288 (1:5288) .asm_52e1 call Func_532b jr .asm_530b - + .asm_52e6 call Func_5337 call Func_5349 @@ -939,7 +939,7 @@ Func_5288: ; 5288 (1:5288) call UpdateSpriteImage scf ret - + .asm_530b call Func_5337 call Func_5349 @@ -952,27 +952,27 @@ Func_5288: ; 5288 (1:5288) call UpdateSpriteImage scf ret - + Func_531f: ; 531f (1:531f) lb de, 1, 0 ld c, SPRITE_FACING_DOWN ret - + Func_5325: ; 5325 (1:5325) lb de, -1, 0 ld c, SPRITE_FACING_UP ret - + Func_532b: ; 532b (1:532b) lb de, 0, 1 ld c, SPRITE_FACING_RIGHT ret - + Func_5331: ; 5331 (1:5331) lb de, 0, -1 ld c, SPRITE_FACING_LEFT ret - + Func_5337: ; 5337 (1:5337) ld a, [H_CURRENTSPRITEOFFSET] add $9 @@ -987,7 +987,7 @@ Func_5337: ; 5337 (1:5337) inc l ld [hl], e ; c1x5 (update X movement delta) ret - + Func_5349: ; 5349 (1:5349) ld h, wSpriteStateData2 / $100 ld a, [H_CURRENTSPRITEOFFSET] @@ -1000,7 +1000,7 @@ Func_5349: ; 5349 (1:5349) add e ld [hl], a ; update X position ret - + Func_5357: ; 5357 (1:5357) call Func_5274 ld a, [H_CURRENTSPRITEOFFSET] diff --git a/engine/overworld/npc_movement_2.asm b/engine/overworld/npc_movement_2.asm new file mode 100755 index 00000000..c5e11aa0 --- /dev/null +++ b/engine/overworld/npc_movement_2.asm @@ -0,0 +1,24 @@ +FreezeEnemyTrainerSprite: ; eaa02 (3a:6a02) + ld a, [wCurMap] + cp POKEMONTOWER_7 + ret z ; the Rockets on Pokemon Tower 7F leave after battling, so don't freeze them + ld hl, RivalIDs + ld a, [wEngagedTrainerClass] + ld b, a +.loop + ld a, [hli] + cp $ff + jr z, .notRival + cp b + ret z ; the rival leaves after battling, so don't freeze him + jr .loop +.notRival + ld a, [wSpriteIndex] + ld [H_SPRITEINDEX], a + jp SetSpriteMovementBytesToFF + +RivalIDs: ; eaa20 (3a:6a20) + db OPP_SONY1 + db OPP_SONY2 + db OPP_SONY3 + db $ff diff --git a/engine/overworld/oam.asm b/engine/overworld/oam.asm index f51c839f..ede025cd 100644 --- a/engine/overworld/oam.asm +++ b/engine/overworld/oam.asm @@ -19,10 +19,10 @@ PrepareOAMData: ; 499b (1:499b) .spriteLoop ld [hSpriteOffset2], a - + ld e, a ld d, wSpriteStateData1 / $100 - + ld a, [de] ; c1x0 and a jp z, .nextSprite @@ -42,7 +42,7 @@ PrepareOAMData: ; 499b (1:499b) jr c, .usefacing ; unchanging - ld a, $0 + ld a, $0 jr .next .usefacing @@ -81,7 +81,7 @@ PrepareOAMData: ; 499b (1:499b) call Func_4a7b ld [wd5cd], a ld a, [hOAMBufferOffset] - + ld e, a ld d, wOAMBuffer / $100 @@ -185,7 +185,7 @@ GetSpriteScreenXY: ; 4a5f (1:4a5f) and $f0 ld [de], a ; c1xb (x) ret - + Func_4a7b: ; 4a7b (1:4a7b) push bc ld a, [wd5cd] ; temp copy of c1x2 @@ -228,5 +228,5 @@ _IsTilePassable:: ; 4aaa (1:4aaa) .tileNotPassable scf ret - + INCLUDE "data/collision.asm" ; probably
\ No newline at end of file diff --git a/engine/overworld/player_animations.asm b/engine/overworld/player_animations.asm index d0b1cde4..bea43308 100755 --- a/engine/overworld/player_animations.asm +++ b/engine/overworld/player_animations.asm @@ -418,7 +418,7 @@ FishingAnim: ; 70816 (1c:4816) cp $2 ld hl, NothingHereText jr z, .done - + ; there was a bite ; shake the player's sprite vertically @@ -432,7 +432,7 @@ FishingAnim: ; 70816 (1c:4816) call Delay3 dec b jr nz, .loop - + ; If the player is facing up, hide the fishing rod so it doesn't overlap with ; the exclamation bubble that will be shown next. ld a, [wSpriteStateData1 + 2] diff --git a/engine/overworld/pokecenter.asm b/engine/overworld/pokecenter.asm index 63137433..65dfcd87 100755 --- a/engine/overworld/pokecenter.asm +++ b/engine/overworld/pokecenter.asm @@ -106,7 +106,7 @@ Func_6eaa: ; 6eaa (1:6eaa) ld c, 64 call DelayFrames ret - + Func_6ebb: ; 6ebb (1:6ebb) ld a, b ld [H_SPRITEINDEX], a @@ -121,7 +121,7 @@ Func_6ebb: ; 6ebb (1:6ebb) ld [hSpriteImageIndex], a call SpriteFunc_34a1 ret - + PokemonCenterWelcomeText: ; 6de0 (1:6de0) TX_FAR _PokemonCenterWelcomeText db "@" @@ -143,7 +143,7 @@ PokemonCenterFarewellText: ; 6ee5 (1:6ee5) db $a TX_FAR _PokemonCenterFarewellText db "@" - + LooksContentText: ; 6eeb (1:6eeb) TX_FAR _LooksContentText db "@"
\ No newline at end of file diff --git a/engine/overworld/step_functions.asm b/engine/overworld/step_functions.asm index 64d215a1..bc1a74aa 100644 --- a/engine/overworld/step_functions.asm +++ b/engine/overworld/step_functions.asm @@ -123,7 +123,7 @@ ApplyOutOfBattlePoisonDamage: ; c3de (3:43de) .done ld [wOutOfBattleBlackout], a ret - + Func_c4c7: ; c4c7 (3:44c7) ld a, [wStepCounter] and a |