IsMailEuropean → ParseMailLanguage (and give it constants)

This commit is contained in:
mid-kid
2023-03-30 04:51:49 +02:00
parent 1674b6ca5a
commit a6ac67dea2
5 changed files with 38 additions and 29 deletions

View File

@@ -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.

View File

@@ -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