From 147d0964d8d8cddc4749f301692d495cd9b6f49a Mon Sep 17 00:00:00 2001 From: Tauwasser Date: Sun, 24 Jun 2018 23:09:15 +0200 Subject: hram: rename hTextErrno to hEventID Signed-off-by: Tauwasser --- home/text.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'home') diff --git a/home/text.asm b/home/text.asm index b3cd75c..d528d08 100644 --- a/home/text.asm +++ b/home/text.asm @@ -232,7 +232,7 @@ NullChar:: ; 00:0f66 ret .Text: - deciram hTextErrno, 1, 2 + deciram hEventID, 1, 2 text "エラー" done -- cgit v1.2.3 From 57481cc9421d2ea830480d3c1cb5b9f5c7d907aa Mon Sep 17 00:00:00 2001 From: Tauwasser Date: Sun, 24 Jun 2018 23:10:16 +0200 Subject: home/copy2: rename Function0d02 to RedrawPlayerSprite Signed-off-by: Tauwasser --- home/copy2.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'home') diff --git a/home/copy2.asm b/home/copy2.asm index 9baad62..7274d8d 100644 --- a/home/copy2.asm +++ b/home/copy2.asm @@ -2,7 +2,7 @@ INCLUDE "constants.asm" SECTION "Video Copy functions", ROM0[$0D02] -Function0d02:: +RedrawPlayerSprite:: jpab Function14000 LoadFont:: ; 00:0d0a -- cgit v1.2.3 From 906ea8bdfcf024cb5011948a319764047f8fa41f Mon Sep 17 00:00:00 2001 From: Tauwasser Date: Sun, 24 Jun 2018 23:15:07 +0200 Subject: engine: disassemble player movement (WIP) Signed-off-by: Tauwasser --- home/map.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'home') diff --git a/home/map.asm b/home/map.asm index 8105781..8c03d9f 100644 --- a/home/map.asm +++ b/home/map.asm @@ -1679,7 +1679,7 @@ Function2b87:: call GetJoypad call OverworldStartButtonCheck ret nz - callab Functionc000 + callab OverworldMovementCheck call Function2ba8 jr nc, .asm_2b87 callba Function824c -- cgit v1.2.3 From 3c966f7df4170f58f8274f444977c5a29225d9be Mon Sep 17 00:00:00 2001 From: Pokeglitch Date: Mon, 25 Jun 2018 22:43:31 -0400 Subject: Disassembled all routines related to sprite movement/collisions. Added in constants --- home/copy2.asm | 2 +- home/map.asm | 16 ++++++++-------- home/map_objects.asm | 26 +++++++++++++++++--------- home/tileset.asm | 20 ++++++++++---------- 4 files changed, 36 insertions(+), 28 deletions(-) (limited to 'home') diff --git a/home/copy2.asm b/home/copy2.asm index 7274d8d..e74ef8b 100644 --- a/home/copy2.asm +++ b/home/copy2.asm @@ -3,7 +3,7 @@ INCLUDE "constants.asm" SECTION "Video Copy functions", ROM0[$0D02] RedrawPlayerSprite:: - jpab Function14000 + jpab _RedrawPlayerSprite LoadFont:: ; 00:0d0a jpab LoadFontGraphics diff --git a/home/map.asm b/home/map.asm index 8c03d9f..21e41c8 100644 --- a/home/map.asm +++ b/home/map.asm @@ -448,8 +448,8 @@ FadeIn:: ; 23e5 ; This is not OverworldFadeIn, but I don't know what it is ret Function2407:: ; 00:2407 - ld a, $2a - ld [wcb77], a + ld a, NO_MOVEMENT + ld [wPlayerMovement], a xor a ld [wPlayerAction], a ld a, [wPlayerFacing] @@ -505,7 +505,7 @@ CheckMovingOffEdgeOfMap:: ; 245e ret .down - ld a, [wPlayerStandingMapY] + ld a, [wPlayerNextMapY] sub 4 ld b, a ld a, [wMapHeight] @@ -516,7 +516,7 @@ CheckMovingOffEdgeOfMap:: ; 245e ret .up - ld a, [wPlayerStandingMapY] + ld a, [wPlayerNextMapY] sub 4 cp -1 jr z, .ok @@ -524,7 +524,7 @@ CheckMovingOffEdgeOfMap:: ; 245e ret .left - ld a, [wPlayerStandingMapX] + ld a, [wPlayerNextMapX] sub 4 cp -1 jr z, .ok @@ -532,7 +532,7 @@ CheckMovingOffEdgeOfMap:: ; 245e ret .right - ld a, [wPlayerStandingMapX] + ld a, [wPlayerNextMapX] sub 4 ld b, a ld a, [wMapWidth] @@ -701,10 +701,10 @@ WarpCheck:: ; 259f ret GetDestinationWarpPointer: ; 25b9 - ld a, [wPlayerStandingMapY] + ld a, [wPlayerNextMapY] sub 4 ld d, a - ld a, [wPlayerStandingMapX] + ld a, [wPlayerNextMapX] sub 4 ld e, a ld a, [wCurrMapWarpCount] diff --git a/home/map_objects.asm b/home/map_objects.asm index 70cba50..cc82ef3 100644 --- a/home/map_objects.asm +++ b/home/map_objects.asm @@ -334,26 +334,34 @@ Function17cb:: call Bankswitch ret -Function17de:: +; sets carry flag if the sprite data includes "in-motion" sprites +IsAnimatedSprite:: ; 00:17de push hl push bc ld c, a - ld b, $ff - ld hl, .Data -.asm_17e6: ; 00:17e6 + ld b, -1 + ld hl, .NonAnimatedSprites +.loop ld a, [hli] cp b - jr z, .asm_17ee + jr z, .done cp c - jr nz, .asm_17e6 + jr nz, .loop scf -.asm_17ee: ; 00:17ee +.done pop bc pop hl ret -.Data: ; 00:17f1 - db $51, $55, $56, $57, $58, $5a, $5b, $ff +.NonAnimatedSprites: ; 00:17f1 + db SPRITE_KABIGON + db SPRITE_POKE_BALL + db SPRITE_POKEDEX + db SPRITE_PAPER + db SPRITE_OLD_LINK_RECEPTIONIST + db SPRITE_EGG + db SPRITE_BOULDER + db -1 Function17f9:: call GetMapObject diff --git a/home/tileset.asm b/home/tileset.asm index aabf249..4929159 100644 --- a/home/tileset.asm +++ b/home/tileset.asm @@ -50,7 +50,7 @@ RefreshPlayerCoords:: ; 2d74 ld a, [wXCoord] add a, 4 ld d, a - ld hl, wPlayerStandingMapX + ld hl, wPlayerNextMapX sub [hl] ld [hl], d ld hl, wPlayerObjectXCoord @@ -61,7 +61,7 @@ RefreshPlayerCoords:: ; 2d74 ld a, [wYCoord] add a, 4 ld e, a - ld hl, wPlayerStandingMapY + ld hl, wPlayerNextMapY sub [hl] ld [hl], e ld hl, wPlayerObjectYCoord @@ -211,18 +211,18 @@ SaveScreen:: ; 2df1 RefreshTiles:: ; 2e52 call .left_right call .up_down - ld a, [wPlayerStandingMapX] + ld a, [wPlayerNextMapX] ld d, a - ld a, [wPlayerStandingMapY] + ld a, [wPlayerNextMapY] ld e, a call GetCoordTile ld [wPlayerStandingTile], a ret .up_down ; 2e67 - ld a, [wPlayerStandingMapX] + ld a, [wPlayerNextMapX] ld d, a - ld a, [wPlayerStandingMapY] + ld a, [wPlayerNextMapY] ld e, a push de inc e @@ -235,9 +235,9 @@ RefreshTiles:: ; 2e52 ret .left_right ; 2e80 - ld a, [wPlayerStandingMapX] + ld a, [wPlayerNextMapX] ld d, a - ld a, [wPlayerStandingMapY] + ld a, [wPlayerNextMapY] ld e, a push de dec d @@ -270,10 +270,10 @@ GetFacingTileCoord:: ; 2e99 ld h, [hl] ld l, a - ld a, [wPlayerStandingMapX] + ld a, [wPlayerNextMapX] add a, d ld d, a - ld a, [wPlayerStandingMapY] + ld a, [wPlayerNextMapY] add a, e ld e, a ld a, [hl] -- cgit v1.2.3