Jani made an tutorial about building a cartridge for the Commodore C128. The C128 cartridge functionality is different than in the C64. The maximum size is 32K and it is possible to use an internal socket in addition to the cartridge port. A schematic for the cartridge is available.