Start improving sprite movement engine (to do: identify bit flags)

Introduce maskbits N[, S]: optionally shift the bitmask
This commit is contained in:
Rangi
2018-05-23 12:48:14 -04:00
parent 4e776d4fa6
commit 32b92ca51c
8 changed files with 150 additions and 135 deletions

View File

@@ -1497,29 +1497,29 @@ CalcMonStatC: ; e17b
jr z, .Special
cp STAT_SDEF
jr z, .Special
; DV_HP = (DV_ATK & 1) << 3 + (DV_DEF & 1) << 2 + (DV_SPD & 1) << 1 + (DV_SPC & 1)
; DV_HP = (DV_ATK & 1) << 3 | (DV_DEF & 1) << 2 | (DV_SPD & 1) << 1 | (DV_SPC & 1)
push bc
ld a, [hl]
swap a
and $1
and 1
add a
add a
add a
ld b, a
ld a, [hli]
and $1
and 1
add a
add a
add b
ld b, a
ld a, [hl]
swap a
and $1
and 1
add a
add b
ld b, a
ld a, [hl]
and $1
and 1
add b
pop bc
jr .GotDV