The 6502 doesn't have separate io addresses so you need to fit all devices in a 64k space, not just ROM.