![]() |
| Credit: Evan-Amos CC BY-SA 3.0 (unmodified) |
The Commodore 128 has an extra 26 keys, with 24 additional keys in the key matrix, and 2 additional keys hardwired inputs to 8502 (Caps Lock) and MMU (40/80 Display or ASCII/DIN).
Unfortunately, these keys are not normally accessible when in Commodore 64 mode -- until now, via KERNAL patches.
To try out, run the program "64MODE PATCH" which copies the BASIC & KERNAL ROMs into RAM, applies patches in RAM, and switches operation to run the ROMs from RAM. It is expected that extra keys do not work before the patch, and do work after the patch. Only the numeric keypad and separate cursor keys work with this patch.
Alternatively, the folder 64mode-ROM-patches/ contains two .txt files, one for patching BASIC ROM, and another for patching KERNAL ROM. For instance, if you are running VICE emulator, there are ROMs in the C128 directory for 64mode: three versions for KERNAL, one for BASIC. Copy the desired ROM images to new files, and use the xxd command (Linux, BASH git, etc.) to patch them.
WARNING: if you do not make your own copies, xxd will modify the binaries in place without backups.
xxd -r 64mode-BASIC-patch.txt basic64.bin
xxd -r 64mode-KERNAL-patch.txt kernal64.bin
Once you have modified ROM files, you can configure VICE options to use these instead.
It is recommended to try with VICE first. Then you can use an option like One ROM to apply to real hardware.
How does it work? There is limited unused bytes in the ROMs, that's why both BASIC and KERNAL are patched. 56 more bytes in the ROMs are used for code to scan the additional 3 rows, and 23 bytes are used to help translate these extra keys back to keyboard scan codes compatible with C64. Seven keys were not mapped because one is never available to 64 mode (MMU is disabled in 64 mode), and they don't translate well to unshifted or shifted keys. There are now 2+5=7 additional unused bytes, feel free to try to use these for additional changes. Good luck!!!
And enjoy access to your cursor keys and numeric keypad!
All the files are on github: c-keymaps project including other keyboard utilities for testing, and remapping the keyboard, including kernal patches to remap all keys (and support for more systems).











