Skip to content

Are the labels in CheckPikachuFaintedOrStatused wrong? #103

@bbbbbbbbba

Description

@bbbbbbbbba

CheckPikachuFaintedOrStatused::
; function to test if Pikachu is alive?
xor a
ld [wWhichPokemon], a
ld hl, wPartyCount
.loop
inc hl
ld a, [hl]
cp $ff
jr z, .dead_or_not_in_party
push hl
call IsThisPartymonStarterPikachu_Party
pop hl
jr nc, .next
ld a, [wWhichPokemon]
ld hl, wPartyMon1HP
ld bc, wPartyMon2 - wPartyMon1
call AddNTimes
ld a, [hli]
or [hl]
ld d, a
inc hl
inc hl
ld a, [hl] ; status
and a
jr nz, .alive
jr .dead_or_not_in_party
.next
ld a, [wWhichPokemon]
inc a
ld [wWhichPokemon], a
jr .loop
.alive
scf
ret
.dead_or_not_in_party
and a
ret

From a glance, it seems that the two labels are wrong: At lines 162-164, a nonzero value of a means there is a status ailment, and 0 means no status ailment. The bitwise OR of the two HP bytes is also stored in d, but I don't know if it is ever used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions