Add Unown ! and ?

Taken from https://github.com/pret/pokecrystal/wiki/Add-a-new-Unown-form

There's some embedded palette errors that need fixing.
This commit is contained in:
Llinos Evans 2024-09-01 14:54:29 +01:00
parent bd817d99f9
commit 6a44f96575
29 changed files with 93 additions and 18 deletions

View file

@ -1,3 +1,5 @@
; Modified to add ! and ?
; Used https://github.com/pret/pokecrystal/wiki/Add-a-new-Unown-form
GetUnownLetter:
; Return Unown letter in wUnownLetter based on DVs at hl
@ -31,20 +33,25 @@ GetUnownLetter:
srl a
or b
; Divide by 10 to get 0-25
; Divide by 9 to get 0-28 - changed to add ! and ?
ldh [hDividend + 3], a
xor a
ldh [hDividend], a
ldh [hDividend + 1], a
ldh [hDividend + 2], a
ld a, $ff / NUM_UNOWN + 1
ld a, 9
ldh [hDivisor], a
ld b, 4
call Divide
; Increment to get 1-26
; Increment to get 1-29
ldh a, [hQuotient + 3]
inc a
; The valid range is 1-28, so use UNOWN_E (5) instead of 29
cp NUM_UNOWN + 1
jr c, .valid
ld a, UNOWN_E
.valid
ld [wUnownLetter], a
ret