Basic framework for cartridge emulation