Build a ROM with different keyboard layouts
Posted: Thu Dec 24, 2020 9:55 pm
The x16-rom source tree includes a fairly large collection of keyboard layouts (presumably sourced from elsewhere? I could not find attribution) but can only build 12 into ROM. Here is what you need to do to build a ROM with different layouts.
What you need
- git
- python3
- cc65 (old versions without x16 cfg files work)
I have done this on Linux. The build process is incredibly straight-forward, I imagine it will build anywhere those tools will run.
Clone & Checkout
$ git clone https://github.com/commanderx16/x16-rom.git
$ cd x16-rom
$ git checkout r38
Replacing "r38" with the version of the emulator you are using (or a different version at your own discretion).
Choose Layouts
$ cd keymap/
The `klc` directory contains all available keyboard layouts. Make a note of which keyboards you wish to add to the ROM. Only the first part of the file name is needed. Eg. "klc/80A Latin American.klc" is identified by "80A".
Add these to the first line of the file `make_keytab_asm.sh` (in the variable `layouts`). Layouts that will be removed from the ROM do not need to be changed here, and this list does not need to be in any order.
Execute that script,
$ ./make_keytab_asm.sh
NB some keyboard layouts that do not produce any printable characters on the x16 will produce an error and empty output files. Other layouts that do not produce any printable characters will not produce an error. Keep in mind that all keyboard layouts will produce no output for any characters not available in PETSCII or 8859.
Edit `keymays.s`.
This file specifies which keymaps will make it into the final rom and in what order they will be cycled through. Under the comment, "; PETSCII", modify the list of includes to match your own keyboard layout. Each line should be of the form `.include "asm/___.asm"` with the same identifier in the blank. Keyboard layouts you no longer want can be removed by removing the `.include` line. There should be at least one layout and no more than 12.
Following this section, a similar list appears under the comment "; ISO". This list should match the petscii list except that each filename is of the form "asm/i___.asm".
Build the ROM
$ make
If successful, the useable rom is in the file "build/x16/rom.bin". To use this rom in the emulator, either replace the "rom.bin" in the same directory as the emulator, or specify the ROM on the command line with `x16emu -rom custom-rom.bin`