Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are the labels in CheckPikachuFaintedOrStatused wrong? #103

Open
bbbbbbbbba opened this issue Dec 19, 2022 · 0 comments
Open

Are the labels in CheckPikachuFaintedOrStatused wrong? #103

bbbbbbbbba opened this issue Dec 19, 2022 · 0 comments

Comments

@bbbbbbbbba
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant