You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-09-08 08:13:02 -07:00
IsMailEuropean → ParseMailLanguage (and give it constants)
This commit is contained in:
@@ -1,29 +1,24 @@
|
||||
IsMailEuropean:
|
||||
; return 1 if French
|
||||
; return 2 if German
|
||||
; return 3 if Italian
|
||||
; return 4 if Spanish
|
||||
; return 0 if none of the above
|
||||
ld c, $0
|
||||
ParseMailLanguage:
|
||||
ld c, MAIL_LANG_ENGLISH
|
||||
ld hl, sPartyMon1MailNationality - sPartyMon1Mail
|
||||
add hl, de
|
||||
ld a, [hli]
|
||||
cp "E"
|
||||
ret nz
|
||||
ld a, [hli]
|
||||
inc c
|
||||
inc c ; MAIL_LANG_FRENCH
|
||||
cp "F"
|
||||
ret z
|
||||
inc c
|
||||
inc c ; MAIL_LANG_GERMAN
|
||||
cp "G"
|
||||
ret z
|
||||
inc c
|
||||
inc c ; MAIL_LANG_ITALIAN
|
||||
cp "I"
|
||||
ret z
|
||||
inc c
|
||||
inc c ; MAIL_LANG_SPANISH
|
||||
cp "S"
|
||||
ret z
|
||||
ld c, $0
|
||||
ld c, MAIL_LANG_ENGLISH
|
||||
ret
|
||||
|
||||
; The regular font.
|
||||
|
||||
@@ -31,14 +31,14 @@ ReadAnyMail:
|
||||
push de
|
||||
ld a, BANK(sPartyMail)
|
||||
call OpenSRAM
|
||||
farcall IsMailEuropean
|
||||
farcall ParseMailLanguage
|
||||
call CloseSRAM
|
||||
ld a, c
|
||||
ld de, StandardEnglishFont
|
||||
or a
|
||||
or a ; MAIL_LANG_ENGLISH
|
||||
jr z, .got_font
|
||||
ld de, FrenchGermanFont
|
||||
sub $3
|
||||
sub MAIL_LANG_ITALIAN
|
||||
jr c, .got_font
|
||||
ld de, SpanishItalianFont
|
||||
|
||||
|
||||
Reference in New Issue
Block a user