diff options
author | surskitty <surskitty@gmail.com> | 2017-12-13 19:55:03 -0500 |
---|---|---|
committer | surskitty <surskitty@gmail.com> | 2017-12-13 19:55:03 -0500 |
commit | 4b36a9d2e1d6b6ac823fbb14e8f0ba750b0eecc2 (patch) | |
tree | fcbbd0247503a200c4c1d8df690a676b49a09efd /engine | |
parent | e3ee39f3344107f666099448401d28b04c983cd6 (diff) | |
parent | a6656a986bf9dde51561cab090648e0117b173ad (diff) |
Merge branch 'master' of github.com:pret/pokecrystal
Diffstat (limited to 'engine')
-rwxr-xr-x | engine/anim_hp_bar.asm | 4 | ||||
-rw-r--r-- | engine/battle_start.asm | 7 | ||||
-rwxr-xr-x | engine/intro_menu.asm | 6 | ||||
-rwxr-xr-x | engine/items.asm | 2 | ||||
-rwxr-xr-x | engine/mon_icons.asm | 9 | ||||
-rw-r--r-- | engine/movement.asm | 1 | ||||
-rwxr-xr-x | engine/player_movement.asm | 83 | ||||
-rwxr-xr-x | engine/player_object.asm | 2 | ||||
-rwxr-xr-x | engine/pokegear.asm | 4 | ||||
-rw-r--r-- | engine/scripting.asm | 1 | ||||
-rwxr-xr-x | engine/search.asm | 4 | ||||
-rwxr-xr-x | engine/sprite_anims.asm | 20 | ||||
-rwxr-xr-x | engine/tile_events.asm | 68 | ||||
-rwxr-xr-x | engine/trade/animation.asm | 1 | ||||
-rwxr-xr-x | engine/trainer_card.asm | 2 |
15 files changed, 111 insertions, 103 deletions
diff --git a/engine/anim_hp_bar.asm b/engine/anim_hp_bar.asm index 6272ff7ea..a26c40b91 100755 --- a/engine/anim_hp_bar.asm +++ b/engine/anim_hp_bar.asm @@ -382,7 +382,10 @@ ShortHPBar_CalcPixelFrame: ; d839 and a jr z, .return_zero call AddNTimes + ld b, 0 +; This routine is buggy. If [wCurHPAnimMaxHP] * [wCurHPBarPixels] is divisible +; by 48, the loop runs one extra time. To fix, uncomment the line below. .loop ld a, l sub 6 * 8 @@ -390,6 +393,7 @@ ShortHPBar_CalcPixelFrame: ; d839 ld a, h sbc $0 ld h, a + ; jr z, .done jr c, .done inc b jr .loop diff --git a/engine/battle_start.asm b/engine/battle_start.asm index b16bbbd67..7a16c3b82 100644 --- a/engine/battle_start.asm +++ b/engine/battle_start.asm @@ -196,9 +196,10 @@ FlashyTransitionToBattle: ; 8c314 StartTrainerBattle_DetermineWhichAnimation: ; 8c365 (23:4365) -; The screen flashes a different number of -; times depending on the level of your lead -; Pokemon relative to the opponent's. +; The screen flashes a different number of times depending on the level of +; your lead Pokemon relative to the opponent's. +; BUG: BattleMonLevel and EnemyMonLevel are not set at this point, so whatever +; values happen to be there will determine the animation. ld de, 0 ld a, [BattleMonLevel] add 3 diff --git a/engine/intro_menu.asm b/engine/intro_menu.asm index e0ecd41fe..5127a9895 100755 --- a/engine/intro_menu.asm +++ b/engine/intro_menu.asm @@ -1341,7 +1341,7 @@ Function639b: ; unreferenced ld h, 0 add hl, hl add hl, hl - ld de, Data63ca + ld de, .Data63ca add hl, de ; If bit 2 of [wTitleScreenTimer] is set, get the second dw; else, get the first dw ld a, [wTitleScreenTimer] @@ -1357,12 +1357,12 @@ Function639b: ; unreferenced ret z ld e, a ld d, [hl] - ld a, SPRITE_ANIM_INDEX_01 + ld a, SPRITE_ANIM_INDEX_GS_TITLE_TRAIL call _InitSpriteAnimStruct ret ; 63ca -Data63ca: ; 63ca +.Data63ca: ; 63ca ; frame 0 y, x; frame 1 y, x db 11 * 8 + 4, 10 * 8, 0 * 8, 0 * 8 db 11 * 8 + 4, 13 * 8, 11 * 8 + 4, 11 * 8 diff --git a/engine/items.asm b/engine/items.asm index 0124489e5..b0bffb6d6 100755 --- a/engine/items.asm +++ b/engine/items.asm @@ -554,7 +554,7 @@ GetItemAttr: ; d460 ld a, [CurItem] dec a ld c, a - ld a, NUM_ITEMATTRS + ld a, ITEMATTR_STRUCT_LENGTH call AddNTimes ld a, BANK(ItemAttributes) call GetFarByte diff --git a/engine/mon_icons.asm b/engine/mon_icons.asm index 0aade6985..70c439863 100755 --- a/engine/mon_icons.asm +++ b/engine/mon_icons.asm @@ -144,11 +144,11 @@ PartyMenu_InitAnimatedMonIcon: ; 8e8d5 (23:68d5) pop bc pop hl jr c, .mail - ld a, SPRITE_ANIM_FRAMESET_03 + ld a, SPRITE_ANIM_FRAMESET_PARTY_MON_WITH_ITEM jr .okay .mail - ld a, SPRITE_ANIM_FRAMESET_02 + ld a, SPRITE_ANIM_FRAMESET_PARTY_MON_WITH_MAIL .okay ld hl, SPRITEANIMSTRUCT_FRAMESET_ID add hl, bc @@ -297,7 +297,7 @@ GetMemIconGFX: ; 8e9db (23:69db) ld a, [wCurIconTile] GetIconGFX: ; 8e9de call GetIcon_a - ld de, $80 ; 8 tiles + ld de, 8 tiles add hl, de ld de, HeldItemIcons lb bc, BANK(HeldItemIcons), 2 @@ -468,9 +468,6 @@ ReadMonMenuIcon: ; 8eab3 INCLUDE "data/mon_menu_icons.asm" - INCLUDE "gfx/icon_pointers.asm" -Icons: INCLUDE "gfx/icons.asm" - diff --git a/engine/movement.asm b/engine/movement.asm index 7b58e4023..ea661abbb 100644 --- a/engine/movement.asm +++ b/engine/movement.asm @@ -1,4 +1,5 @@ MovementPointers: ; 5075 +; entries correspond to macros/movement.asm enumeration dw Movement_turn_head_down ; 00 dw Movement_turn_head_up ; 01 dw Movement_turn_head_left ; 02 diff --git a/engine/player_movement.asm b/engine/player_movement.asm index 89593da5d..7ccb36551 100755 --- a/engine/player_movement.asm +++ b/engine/player_movement.asm @@ -128,13 +128,13 @@ DoPlayerMovement:: ; 80000 .not_whirlpool and $f0 - cp $30 ; moving water + cp HI_NYBBLE_CURRENT jr z, .water - cp $40 ; moving land 1 + cp HI_NYBBLE_WALK jr z, .land1 - cp $50 ; moving land 2 + cp HI_NYBBLE_WALK_ALT jr z, .land2 - cp $70 ; warps + cp HI_NYBBLE_WARPS jr z, .warps jr .no_walk @@ -150,10 +150,10 @@ DoPlayerMovement:: ; 80000 jr .continue_walk .water_table - db RIGHT - db LEFT - db UP - db DOWN + db RIGHT ; COLL_WATERFALL_RIGHT + db LEFT ; COLL_WATERFALL_LEFT + db UP ; COLL_WATERFALL_UP + db DOWN ; COLL_WATERFALL .land1 ld a, c @@ -169,14 +169,14 @@ DoPlayerMovement:: ; 80000 jr .continue_walk .land1_table - db STANDING - db RIGHT - db LEFT - db UP - db DOWN - db STANDING - db STANDING - db STANDING + db STANDING ; COLL_BRAKE + db RIGHT ; COLL_WALK_RIGHT + db LEFT ; COLL_WALK_LEFT + db UP ; COLL_WALK_UP + db DOWN ; COLL_WALK_DOWN + db STANDING ; COLL_BRAKE_45 + db STANDING ; COLL_BRAKE_46 + db STANDING ; COLL_BRAKE_47 .land2 ld a, c @@ -192,24 +192,24 @@ DoPlayerMovement:: ; 80000 jr .continue_walk .land2_table - db RIGHT - db LEFT - db UP - db DOWN - db STANDING - db STANDING - db STANDING - db STANDING + db RIGHT ; COLL_WALK_RIGHT_ALT + db LEFT ; COLL_WALK_LEFT_ALT + db UP ; COLL_WALK_UP_ALT + db DOWN ; COLL_WALK_DOWN_ALT + db STANDING ; COLL_BRAKE_ALT + db STANDING ; COLL_BRAKE_55 + db STANDING ; COLL_BRAKE_56 + db STANDING ; COLL_BRAKE_57 .warps ld a, c - cp $71 ; door + cp COLL_DOOR jr z, .down - cp $79 + cp COLL_DOOR_79 jr z, .down - cp $7a ; stairs + cp COLL_STAIRCASE jr z, .down - cp $7b ; cave + cp COLL_CAVE jr nz, .no_walk .down @@ -365,7 +365,7 @@ DoPlayerMovement:: ; 80000 ld a, [PlayerStandingTile] ld e, a and $f0 - cp $a0 ; ledge + cp HI_NYBBLE_LEDGES jr nz, .DontJump ld a, e @@ -391,14 +391,14 @@ DoPlayerMovement:: ; 80000 ret .data_8021e - db FACE_RIGHT - db FACE_LEFT - db FACE_UP - db FACE_DOWN - db FACE_RIGHT | FACE_DOWN - db FACE_DOWN | FACE_LEFT - db FACE_UP | FACE_RIGHT - db FACE_UP | FACE_LEFT + db FACE_RIGHT ; COLL_HOP_RIGHT + db FACE_LEFT ; COLL_HOP_LEFT + db FACE_UP ; COLL_HOP_UP + db FACE_DOWN ; COLL_HOP_DOWN + db FACE_RIGHT | FACE_DOWN ; COLL_HOP_DOWN_RIGHT + db FACE_DOWN | FACE_LEFT ; COLL_HOP_DOWN_LEFT + db FACE_UP | FACE_RIGHT ; COLL_HOP_UP_RIGHT + db FACE_UP | FACE_LEFT ; COLL_HOP_UP_LEFT ; 80226 .CheckWarp: ; 80226 @@ -443,7 +443,10 @@ DoPlayerMovement:: ; 80000 ret .EdgeWarps: - db $70, $78, $76, $7e + db COLL_WARP_CARPET_DOWN + db COLL_WARP_CARPET_UP + db COLL_WARP_CARPET_LEFT + db COLL_WARP_CARPET_RIGHT ; 8025f .DoStep: @@ -759,7 +762,7 @@ DoPlayerMovement:: ; 80000 ; Return 0 if tile a is land. Otherwise, return carry. call GetTileCollision - and a ; land + and a ; LANDTILE? ret z scf ret @@ -774,7 +777,7 @@ DoPlayerMovement:: ; 80000 jr z, .Water ; Can walk back onto land from water. - and a + and a ; LANDTILE? jr z, .Land jr .Neither diff --git a/engine/player_object.asm b/engine/player_object.asm index a4796043b..232d31bc2 100755 --- a/engine/player_object.asm +++ b/engine/player_object.asm @@ -193,7 +193,7 @@ CopyMapObjectToObjectStruct: ; 8116 and $f0 jr z, .skip_color_override swap a - and $7 ; OAM_PALETTE + and PALETTE_MASK ld [wTempObjectCopyPalette], a .skip_color_override diff --git a/engine/pokegear.asm b/engine/pokegear.asm index 901053c9f..561ece400 100755 --- a/engine/pokegear.asm +++ b/engine/pokegear.asm @@ -141,7 +141,7 @@ INCBIN "gfx/pokegear/fast_ship.2bpp" InitPokegearModeIndicatorArrow: ; 90d32 (24:4d32) depixel 4, 2, 4, 0 - ld a, SPRITE_ANIM_INDEX_0D + ld a, SPRITE_ANIM_INDEX_POKEGEAR_ARROW call _InitSpriteAnimStruct ld hl, SPRITEANIMSTRUCT_TILE_ID add hl, bc @@ -685,7 +685,7 @@ PokegearMap_InitPlayerIcon: ; 9106a PokegearMap_InitCursor: ; 91098 push af depixel 0, 0 - ld a, SPRITE_ANIM_INDEX_0D + ld a, SPRITE_ANIM_INDEX_POKEGEAR_ARROW call _InitSpriteAnimStruct ld hl, SPRITEANIMSTRUCT_TILE_ID add hl, bc diff --git a/engine/scripting.asm b/engine/scripting.asm index df22995b5..ed6221d6e 100644 --- a/engine/scripting.asm +++ b/engine/scripting.asm @@ -64,6 +64,7 @@ RunScriptCommand: ScriptCommandTable: +; entries correspond to macros/event.asm enumeration dw Script_scall ; 00 dw Script_farscall ; 01 dw Script_ptcall ; 02 diff --git a/engine/search.asm b/engine/search.asm index 9543ecfbb..76be0e159 100755 --- a/engine/search.asm +++ b/engine/search.asm @@ -219,7 +219,7 @@ CheckOwnMon: ; 0x4a7ba ld hl, PlayerName - rept 4 +rept NAME_LENGTH_JAPANESE +- 2 ; should be PLAYER_NAME_LENGTH +- 2 ld a, [de] cp [hl] jr nz, .notfound @@ -227,7 +227,7 @@ CheckOwnMon: ; 0x4a7ba jr z, .found ; reached end of string inc hl inc de - endr +endr ld a, [de] cp [hl] diff --git a/engine/sprite_anims.asm b/engine/sprite_anims.asm index e6681c8ac..32c91b07f 100755 --- a/engine/sprite_anims.asm +++ b/engine/sprite_anims.asm @@ -18,8 +18,8 @@ DoAnimFrame: ; 8d24b dw .PartyMon dw .PartyMonSwitch dw .PartyMonSelected - dw .sprite_anim_seq_04 - dw .namingscreencursor + dw .GSTitleTrail + dw .NamingScreenCursor dw .GameFreakLogo dw .GSIntroStar dw .GSIntroSparkle @@ -27,9 +27,9 @@ DoAnimFrame: ; 8d24b dw .SlotsChansey dw .SlotsChanseyEgg dw .MailCursor - dw .sprite_anim_seq_0D - dw .sprite_anim_seq_0E - dw .sprite_anim_seq_0F + dw .ForUnusedCursor + dw .DummyGameCursor + dw .PokegearArrow dw .TradePokeBall dw .TradeTubeBulge dw .TrademonInTube @@ -132,7 +132,7 @@ DoAnimFrame: ; 8d24b ld [hl], 8 * 3 ret -.sprite_anim_seq_04 ; 8d302 (23:5302) +.GSTitleTrail ; 8d302 (23:5302) call .AnonymousJumptable jp hl ; 8d306 (23:5306) @@ -217,7 +217,7 @@ DoAnimFrame: ; 8d24b ld [hl], a ret -.namingscreencursor ; 8d36c (23:536c) +.NamingScreenCursor ; 8d36c (23:536c) callab NamingScreen_AnimateCursor ret @@ -404,15 +404,15 @@ DoAnimFrame: ; 8d24b ld [hl], a ret -.sprite_anim_seq_0D ; 8d46e (23:546e) +.ForUnusedCursor ; 8d46e (23:546e) callab ret_e00ed ret -.sprite_anim_seq_0F ; 8d475 (23:5475) +.PokegearArrow ; 8d475 (23:5475) callab AnimatePokegearModeIndicatorArrow ret -.sprite_anim_seq_0E ; 8d47c (23:547c) +.DummyGameCursor ; 8d47c (23:547c) callab DummyGame_InterpretJoypad_AnimateCursor ret diff --git a/engine/tile_events.asm b/engine/tile_events.asm index 1595d436f..23a7a3c85 100755 --- a/engine/tile_events.asm +++ b/engine/tile_events.asm @@ -1,12 +1,12 @@ CheckWarpCollision:: ; 1499a ; Is this tile a warp? ld a, [PlayerStandingTile] - cp $60 + cp COLL_PIT jr z, .warp - cp $68 + cp COLL_PIT_68 jr z, .warp and $f0 - cp $70 + cp HI_NYBBLE_WARPS jr z, .warp and a ret @@ -20,13 +20,13 @@ CheckDirectionalWarp:: ; 149af ; If this is a directional warp, clear carry (press the designated button to warp). ; Else, set carry (immediate warp). ld a, [PlayerStandingTile] - cp $70 ; Warp on down + cp COLL_WARP_CARPET_DOWN jr z, .directional - cp $76 ; Warp on left + cp COLL_WARP_CARPET_LEFT jr z, .directional - cp $78 ; Warp on up + cp COLL_WARP_CARPET_UP jr z, .directional - cp $7e ; Warp on right + cp COLL_WARP_CARPET_RIGHT jr z, .directional scf ret @@ -45,15 +45,15 @@ CheckWarpFacingDown: ; 149c6 ; 149d3 .blocks ; 149d3 - db $71 ; door - db $79 - db $7a ; stairs - db $73 - db $7b ; cave entrance - db $74 - db $7c ; warp pad - db $75 - db $7d + db COLL_DOOR + db COLL_DOOR_79 + db COLL_STAIRCASE + db COLL_STAIRCASE_73 + db COLL_CAVE + db COLL_CAVE_74 + db COLL_WARP_PANEL + db COLL_DOOR_75 + db COLL_DOOR_7D db -1 ; 149dd @@ -66,16 +66,16 @@ CheckGrassCollision:: ; 149dd ; 149ea .blocks ; 149ea - db $08 - db $18 ; tall grass - db $14 ; tall grass - db $28 - db $29 - db $48 - db $49 - db $4a - db $4b - db $4c + db COLL_CUT_08 + db COLL_TALL_GRASS + db COLL_LONG_GRASS + db COLL_CUT_28 + db COLL_WATER + db COLL_GRASS_48 + db COLL_GRASS_49 + db COLL_GRASS_4A + db COLL_GRASS_4B + db COLL_GRASS_4C db -1 ; 149f5 @@ -88,22 +88,22 @@ CheckCutCollision: ; 149f5 ; 14a00 .blocks ; 14a00 - db $12 ; cut tree - db $1a ; cut tree - db $10 ; tall grass - db $18 ; tall grass - db $14 ; tall grass - db $1c ; tall grass + db COLL_CUT_TREE + db COLL_CUT_TREE_1A + db COLL_TALL_GRASS_10 + db COLL_TALL_GRASS + db COLL_LONG_GRASS + db COLL_LONG_GRASS_1C db -1 ; 14a07 GetWarpSFX:: ; 14a07 ld a, [PlayerStandingTile] ld de, SFX_ENTER_DOOR - cp $71 ; door + cp COLL_DOOR ret z ld de, SFX_WARP_TO - cp $7c ; warp pad + cp COLL_WARP_PANEL ret z ld de, SFX_EXIT_BUILDING ret diff --git a/engine/trade/animation.asm b/engine/trade/animation.asm index 31c1578c2..7100bd558 100755 --- a/engine/trade/animation.asm +++ b/engine/trade/animation.asm @@ -236,6 +236,7 @@ DoTradeAnimation: ; 29082 ; 290af .JumpTable: ; 290af +; entries correspond to macros/trade_anim.asm enumeration dw TradeAnim_AdvanceScriptPointer ; 00 dw TradeAnim_ShowGivemonData ; 01 dw TradeAnim_ShowGetmonData ; 02 diff --git a/engine/trainer_card.asm b/engine/trainer_card.asm index 499891fb0..fdf17acc9 100755 --- a/engine/trainer_card.asm +++ b/engine/trainer_card.asm @@ -448,7 +448,7 @@ TrainerCard_Page1_PrintGameTime: ; 25415 (9:5415) ret nz hlcoord 15, 12 ld a, [hl] - xor %01010001 ; $7F (space) <--> $2E (colon) + xor $7f ^ $2e ; $7F (space) <--> $2E (colon) ld [hl], a ret |