# The font

The font used by TempGBA is similar to the Pictochat font. To modify it,
see `source/dstwo/font/README.txt`.

# Translations

Translations for TempGBA may be submitted to the author(s) under many forms,
one of which is the Github pull request. To complete a translation, you will
need to do the following:

* Open `source/dstwo/TEMPGBA/system/language.msg`.
* Copy what's between `STARTENGLISH` and `ENDENGLISH` and paste it at the end
  of the file.
* Change the tags. For example, if you want to translate to Japanese, the tags
  will become `STARTJAPANESE` and `ENDJAPANESE`.
* Translate each of the messages, using the lines starting with `#MSG_` as a
  guide to the context in which the messages will be used.

If you are not comfortable editing C code, or cannot compile TempGBA after
changes, you may instead test your translation in the English block and submit
it. That allows you to look for message length issues and to align the option
names and values to your liking with spaces.

If you wish to also hook your language into the user interface, you will need
to do the following:

* Edit `source/dstwo/message.h`. Find `enum LANGUAGE` and add the name of your
  language there. For the example of Japanese, you would add this at the end of
  the list:
  ```
	,
	JAPANESE
  ```
* Still in `source/dstwo/message.h`, just below `enum LANGUAGE`, you will find
  `extern char* lang[` *some number* `]`. Add 1 to that number.
* Edit `source/dstwo/gui.c`. Find `char *lang[` *some number* `] =`.
  Add the name of your language, in the language itself. For the example of
  Japanese, you would add this at the end of the list:
  ```
	,
	"日本語"
  ```
* Still in `source/dstwo/gui.c`, find `char* language_options[]`, which is below
  the language names. Add an entry similar to the others, with the last number
  plus 1. For example, if the last entry is `, (char *) &lang[7]`, yours would
  be `, (char *) &lang[8]`.
* Still in `source/dstwo/gui.c`, find `case CHINESE_SIMPLIFIED`. Copy the lines
  starting at the `case` and ending with `break`, inclusively. Paste them
  before the `}`. Change the language name and tags. For the example of
  Japanese, you would use:
  ```
	case JAPANESE:
		strcpy(start, "STARTJAPANESE");
		strcpy(end, "ENDJAPANESE");
		break;
  ```

Compile again, copy the plugin and your new `language.msg` to your card
under `TEMPGBA/system`, and you can now select your new language in TempGBA!

# Compiling

Compiling TempGBA is best done on Linux. Make sure you have access to a Linux
system to perform these steps.

## The DS2 SDK
To compile TempGBA, you need to have the Supercard team's DS2 SDK.
The Makefile expects it at `/opt/ds2sdk`, but you can move it anywhere,
provided that you update the Makefile's `DS2SDKPATH` variable to point to it.

For best results, download version 0.13 of the DS2 SDK, which will have the
MIPS compiler (`gcc`), extract it to `/opt/ds2sdk`, follow the instructions,
then download version 1.2 of the DS2 SDK and extract its files into
`opt/ds2sdk`, overwriting version 0.13.

Additionally, you will need to add the updated `zlib`, DMA
(Direct Memory Access) and filesystem access routines provided by BassAceGold
and recompile `libds2a.a`. To do this:

> sudo rm -r /opt/ds2sdk/libsrc/{console,core,fs,key,zlib,Makefile} /opt/ds2sdk/include
> sudo cp -r source/dstwo/sdk-modifications/{libsrc,include} /opt/ds2sdk
> sudo chmod -R 600 /opt/ds2sdk/{libsrc,include}
> sudo chmod -R a+rX /opt/ds2sdk/{libsrc,include}
> cd /opt/ds2sdk/libsrc
> sudo rm libds2a.a ../lib/libds2a.a
> sudo make

## The MIPS compiler (`gcc`)
You also need the MIPS compiler from the DS2 SDK.
The Makefile expects it at `/opt/mipsel-4.1.2-nopic`, but you can move it
anywhere, provided that you update the Makefile's `CROSS` variable to point to
it.

## Making the plugin
To make the plugin, `tempgba.plg`, use the `cd` command to change to the
directory containing your copy of the TempGBA source, then type
`cd source/dstwo; make`. `tempgba.plg` should appear in the same directory.

## Making a release
To make a zip archive containing a release of TempGBA, use `make release`
instead of `make`, or after `make`.