2023-03-29 19:51:49 -07:00
|
|
|
ParseMailLanguage:
|
|
|
|
ld c, MAIL_LANG_ENGLISH
|
2021-03-17 13:16:02 -07:00
|
|
|
ld hl, sPartyMon1MailNationality - sPartyMon1Mail
|
2017-12-15 17:10:54 -08:00
|
|
|
add hl, de
|
|
|
|
ld a, [hli]
|
|
|
|
cp "E"
|
|
|
|
ret nz
|
|
|
|
ld a, [hli]
|
2023-03-29 19:51:49 -07:00
|
|
|
inc c ; MAIL_LANG_FRENCH
|
2017-12-15 17:10:54 -08:00
|
|
|
cp "F"
|
|
|
|
ret z
|
2023-03-29 19:51:49 -07:00
|
|
|
inc c ; MAIL_LANG_GERMAN
|
2017-12-15 17:10:54 -08:00
|
|
|
cp "G"
|
|
|
|
ret z
|
2023-03-29 19:51:49 -07:00
|
|
|
inc c ; MAIL_LANG_ITALIAN
|
2017-12-15 17:10:54 -08:00
|
|
|
cp "I"
|
|
|
|
ret z
|
2023-03-29 19:51:49 -07:00
|
|
|
inc c ; MAIL_LANG_SPANISH
|
2017-12-15 17:10:54 -08:00
|
|
|
cp "S"
|
|
|
|
ret z
|
2023-03-29 19:51:49 -07:00
|
|
|
ld c, MAIL_LANG_ENGLISH
|
2017-12-15 17:10:54 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
; The regular font.
|
2018-06-24 07:09:41 -07:00
|
|
|
StandardEnglishFont:
|
2017-12-15 17:10:54 -08:00
|
|
|
INCBIN "gfx/font/english.1bpp"
|
|
|
|
|
|
|
|
; An extended font.
|
2018-06-24 07:09:41 -07:00
|
|
|
FrenchGermanFont:
|
2017-12-15 17:10:54 -08:00
|
|
|
INCBIN "gfx/font/french_german.1bpp"
|
|
|
|
|
|
|
|
; An even more extended font.
|
2018-06-24 07:09:41 -07:00
|
|
|
SpanishItalianFont:
|
2017-12-15 17:10:54 -08:00
|
|
|
INCBIN "gfx/font/spanish_italian.1bpp"
|
|
|
|
|
2019-11-03 17:34:02 -08:00
|
|
|
ConvertFrenchGermanMailToEnglish:
|
|
|
|
; Called if mail is French or German
|
|
|
|
; Converts 's 't 'v from French/German character set to English
|
2017-12-15 17:10:54 -08:00
|
|
|
ld b, sPartyMon1MailAuthor - sPartyMon1Mail
|
|
|
|
ld h, d
|
|
|
|
ld l, e
|
|
|
|
.loop
|
|
|
|
ld a, [hl]
|
2019-11-03 17:34:02 -08:00
|
|
|
cp $dc ; 's in French/German font
|
2017-12-15 17:10:54 -08:00
|
|
|
jr nz, .check_intermediate_chars
|
|
|
|
ld a, "'s"
|
|
|
|
jr .replace
|
|
|
|
|
|
|
|
.check_intermediate_chars
|
|
|
|
sub "'s"
|
|
|
|
jr c, .dont_replace
|
|
|
|
cp "'v" - "'s" + 1
|
|
|
|
jr nc, .dont_replace
|
|
|
|
add $cd
|
|
|
|
|
|
|
|
.replace
|
|
|
|
ld [hl], a
|
|
|
|
|
|
|
|
.dont_replace
|
|
|
|
inc hl
|
|
|
|
dec b
|
|
|
|
jr nz, .loop
|
|
|
|
ret
|
|
|
|
|
2019-11-03 17:34:02 -08:00
|
|
|
ConvertEnglishMailToFrenchGerman:
|
|
|
|
; Called if mail is English and game is French or German
|
|
|
|
; Converts 's 't 'v from English character set to French/German
|
2017-12-15 17:10:54 -08:00
|
|
|
ld b, sPartyMon1MailAuthor - sPartyMon1Mail
|
|
|
|
ld h, d
|
|
|
|
ld l, e
|
|
|
|
.loop
|
|
|
|
ld a, [hl]
|
|
|
|
cp "'s"
|
|
|
|
jr nz, .check_intermediate_chars
|
2019-11-03 17:34:02 -08:00
|
|
|
ld a, $dc ; 's in French/German font
|
2017-12-15 17:10:54 -08:00
|
|
|
jr .replace
|
|
|
|
|
|
|
|
.check_intermediate_chars
|
|
|
|
sub $cd
|
|
|
|
jr c, .dont_replace
|
|
|
|
cp "'v" - "'s" + 1
|
|
|
|
jr nc, .dont_replace
|
|
|
|
add "'s"
|
|
|
|
|
|
|
|
.replace
|
|
|
|
ld [hl], a
|
|
|
|
|
|
|
|
.dont_replace
|
|
|
|
inc hl
|
|
|
|
dec b
|
|
|
|
jr nz, .loop
|
|
|
|
ret
|
|
|
|
|
2019-11-03 17:34:02 -08:00
|
|
|
ConvertSpanishItalianMailToEnglish:
|
|
|
|
; Called if mail is Spanish or Italian
|
|
|
|
; Converts 'd 'l 'm 'r 's 't 'v from Spanish/Italian character set to English
|
|
|
|
ConvertEnglishMailToSpanishItalian:
|
|
|
|
; Called if mail is English and game is Spanish or Italian
|
|
|
|
; Converts 'd 'l 'm 'r 's 't 'v from English character set to Spanish/Italian
|
2017-12-15 17:10:54 -08:00
|
|
|
ld b, sPartyMon1MailAuthor - sPartyMon1Mail
|
|
|
|
ld h, d
|
|
|
|
ld l, e
|
|
|
|
.loop
|
|
|
|
ld a, [hl]
|
|
|
|
and $f0
|
|
|
|
cp $d0
|
|
|
|
jr nz, .dont_replace
|
|
|
|
ld a, [hl]
|
|
|
|
add $8
|
|
|
|
and $f
|
|
|
|
or $d0
|
|
|
|
ld [hl], a
|
|
|
|
|
|
|
|
.dont_replace
|
|
|
|
inc hl
|
|
|
|
dec b
|
|
|
|
jr nz, .loop
|
|
|
|
ret
|