diff options
-rw-r--r-- | data/tilesets/spinner_tiles.asm | 29 | ||||
-rw-r--r-- | engine/overworld/spinners.asm | 65 | ||||
-rwxr-xr-x | scripts/RocketHideoutB2F.asm | 94 |
3 files changed, 95 insertions, 93 deletions
diff --git a/data/tilesets/spinner_tiles.asm b/data/tilesets/spinner_tiles.asm new file mode 100644 index 00000000..82506b6d --- /dev/null +++ b/data/tilesets/spinner_tiles.asm @@ -0,0 +1,29 @@ +spinner: MACRO +; \1: source +; \2: offset (BANK() chokes on literals) +; \3: dest + dw \1 tile \2 + db 1 + db BANK(\1) + dw vTileset tile \3 +ENDM + +FacilitySpinnerArrows: + spinner SpinnerArrowAnimTiles, 0, $20 + spinner SpinnerArrowAnimTiles, 1, $21 + spinner SpinnerArrowAnimTiles, 2, $30 + spinner SpinnerArrowAnimTiles, 3, $31 + spinner Facility_GFX, $20, $20 + spinner Facility_GFX, $21, $21 + spinner Facility_GFX, $30, $30 + spinner Facility_GFX, $31, $31 + +GymSpinnerArrows: + spinner SpinnerArrowAnimTiles, 1, $3c + spinner SpinnerArrowAnimTiles, 3, $3d + spinner SpinnerArrowAnimTiles, 0, $4c + spinner SpinnerArrowAnimTiles, 2, $4d + spinner Gym_GFX, $3c, $3c + spinner Gym_GFX, $3d, $3d + spinner Gym_GFX, $4c, $4c + spinner Gym_GFX, $4d, $4d diff --git a/engine/overworld/spinners.asm b/engine/overworld/spinners.asm new file mode 100644 index 00000000..0ac6380d --- /dev/null +++ b/engine/overworld/spinners.asm @@ -0,0 +1,65 @@ +LoadSpinnerArrowTiles:: + ld a, [wSpritePlayerStateData1ImageIndex] + srl a + srl a + ld hl, SpinnerPlayerFacingDirections + ld c, a + ld b, $0 + add hl, bc + ld a, [hl] + ld [wSpritePlayerStateData1ImageIndex], a + ld a, [wCurMapTileset] + cp FACILITY + ld hl, FacilitySpinnerArrows + jr z, .asm_44ff6 + ld hl, GymSpinnerArrows +.asm_44ff6 + ld a, [wSimulatedJoypadStatesIndex] + bit 0, a + jr nz, .asm_45001 + ld de, $18 + add hl, de +.asm_45001 + ld a, $4 + ld bc, $0 +.asm_45006 + push af + push hl + push bc + add hl, bc + ld a, [hli] + ld e, a + ld a, [hli] + ld d, a + ld a, [hli] + ld c, a + ld a, [hli] + ld b, a + ld a, [hli] + ld h, [hl] + ld l, a + call CopyVideoData + pop bc + ld a, $6 + add c + ld c, a + pop hl + pop af + dec a + jr nz, .asm_45006 + ret + +INCLUDE "data/tilesets/spinner_tiles.asm" + +SpinnerPlayerFacingDirections: +; This isn't the order of the facing directions. Rather, it's a list of +; the facing directions that come next. For example, when the player is +; facing down (00), the next facing direction is left (08). + db $08 ; down -> left + db $0C ; up -> right + db $04 ; left -> up + db $00 ; right -> down + +; these tiles are the animation for the tiles that push the player in dungeons like Rocket HQ +SpinnerArrowAnimTiles: + INCBIN "gfx/overworld/spinners.2bpp" diff --git a/scripts/RocketHideoutB2F.asm b/scripts/RocketHideoutB2F.asm index 47c0581c..c4cda325 100755 --- a/scripts/RocketHideoutB2F.asm +++ b/scripts/RocketHideoutB2F.asm @@ -313,99 +313,7 @@ RocketHideout2Script3: ld [wCurMapScript], a ret -LoadSpinnerArrowTiles:: - ld a, [wSpritePlayerStateData1ImageIndex] - srl a - srl a - ld hl, SpinnerPlayerFacingDirections - ld c, a - ld b, $0 - add hl, bc - ld a, [hl] - ld [wSpritePlayerStateData1ImageIndex], a - ld a, [wCurMapTileset] - cp FACILITY - ld hl, FacilitySpinnerArrows - jr z, .asm_44ff6 - ld hl, GymSpinnerArrows -.asm_44ff6 - ld a, [wSimulatedJoypadStatesIndex] - bit 0, a - jr nz, .asm_45001 - ld de, $18 - add hl, de -.asm_45001 - ld a, $4 - ld bc, $0 -.asm_45006 - push af - push hl - push bc - add hl, bc - ld a, [hli] - ld e, a - ld a, [hli] - ld d, a - ld a, [hli] - ld c, a - ld a, [hli] - ld b, a - ld a, [hli] - ld h, [hl] - ld l, a - call CopyVideoData - pop bc - ld a, $6 - add c - ld c, a - pop hl - pop af - dec a - jr nz, .asm_45006 - ret - -spinner: MACRO -; \1: source -; \2: offset (BANK() chokes on literals) -; \3: dest - dw \1 tile \2 - db 1 - db BANK(\1) - dw vTileset tile \3 -ENDM - -FacilitySpinnerArrows: - spinner SpinnerArrowAnimTiles, 0, $20 - spinner SpinnerArrowAnimTiles, 1, $21 - spinner SpinnerArrowAnimTiles, 2, $30 - spinner SpinnerArrowAnimTiles, 3, $31 - spinner Facility_GFX, $20, $20 - spinner Facility_GFX, $21, $21 - spinner Facility_GFX, $30, $30 - spinner Facility_GFX, $31, $31 - -GymSpinnerArrows: - spinner SpinnerArrowAnimTiles, 1, $3c - spinner SpinnerArrowAnimTiles, 3, $3d - spinner SpinnerArrowAnimTiles, 0, $4c - spinner SpinnerArrowAnimTiles, 2, $4d - spinner Gym_GFX, $3c, $3c - spinner Gym_GFX, $3d, $3d - spinner Gym_GFX, $4c, $4c - spinner Gym_GFX, $4d, $4d - -SpinnerPlayerFacingDirections: -; This isn't the order of the facing directions. Rather, it's a list of -; the facing directions that come next. For example, when the player is -; facing down (00), the next facing direction is left (08). - db $08 ; down -> left - db $0C ; up -> right - db $04 ; left -> up - db $00 ; right -> down - -; these tiles are the animation for the tiles that push the player in dungeons like Rocket HQ -SpinnerArrowAnimTiles: - INCBIN "gfx/overworld/spinners.2bpp" +INCLUDE "engine/overworld/spinners.asm" RocketHideoutB2F_TextPointers: dw RocketHideout2Text1 |