I'm experimenting with implementing a video card which has an 8k BIOS ROM at 0xC0000, as expected. But it also has the ability to page in 2k of RAM over the last 2k of ROM (ie, at 0xC1800).
My question is, what's the best way to implement this in PCEM? I've tried using rom_init() to load the ROM, and mem_mapping_add() to create the RAM mapping:
Code: Select all
rom_init(&sigma->bios_rom, "sigma400_bios.rom", 0xC0000, 0x2000, 0x1FFF, 0, MEM_MAPPING_EXTERNAL);
mem_mapping_add(&sigma->bios_ram, 0xC1800, 0x0800, sigma_bread, NULL, NULL, sigma_bwrite, NULL, NULL, NULL, MEM_MAPPING_EXTERNAL, sigma);
but memory reads outside the 0xC1800-0xC2000 range end up being handled by the sigma_bread / sigma_bwrite handlers, and even if I forward them to the ROM the processor ends up in a tight loop with 'Bad getpccache' errors in the log.