Iadvd / RetrocomputingZXSpectrum

Example applications to be used with the Android TCP/IP Virtual Joystick application
GNU General Public License v2.0
19 stars 3 forks source link

Using accents in Spanish #6

Closed Nextric closed 4 months ago

Nextric commented 5 months ago

Is it possible to use accents and ñ in Spanish? If I use them in the text it gives an error.

Iadvd commented 4 months ago

Yes you can, and indeed the engine is already prepared to use them.

I have set by default a font file that contains the Spanish special characters already, so if you call CREATE_GAME_TAP_ES.bat to create the tap file, the font in use is one that has already the Spanish characters. You can have a look to it with an image editor, is the

"C:\MUCHO128k_MK1boost\dev\MuCho_engine_v3_mod\fonts\font_elegante_pixel_xtra.png" .

BUT here is the trick: the font is an IMAGE it is not a real set of characters in memory, because the ZX Spectrum ROM is usually in English, so there are not "tildes" or ñ or opening exclamation or question marks. So when you write the content of the game in Spanish, you must replace as follows:

The character # its the opening exclamation mark ,

The character $ is the opening question mark,

The character % is a with "tilde",

The character & is e with "tilde",

The character ( is i with "tilde", ) is o with "tilde", and

The character + is u with "tilde", and finally

The character _ is ñ.

So for instance if you write in the story (text file) as follows:

$Eres espa_ol? #No lo sab(a!

What you will see at the screen is really the content of font_elegante_pixel_xtra.png image, so you will see when you play the game

¿Eres español? ¡No lo sabía!

It is important to clarify that this is not a problem of MuCho 128k "per se"... it is something that indeed cannot do MuCho 48k or any other game. Usually to write Spanish special characters you need to make the trick of replacing the "bitmap" of some usually unused characters by the ones you need. So I am making exactly the same trick. So, yes: just write at the story text file the mapped characters and it will work (but of course the restriction is that you will not be able to use for other purpose in Spanish the characters # $ % & ( ) + and _ .

Hope it helps!! Cheers.