+#define AC_MEM_SIZE_8MB 0
+#define AC_MEM_SIZE_64KB 1
+#define AC_MEM_SIZE_128KB 2
+#define AC_MEM_SIZE_256KB 3
+#define AC_MEM_SIZE_512KB 4
+#define AC_MEM_SIZE_1MB 5
+#define AC_MEM_SIZE_2MB 6
+#define AC_MEM_SIZE_4MB 7
+
+static unsigned char ac_fast_ram_rom[] = {
+ 0xe, AC_MEM_SIZE_8MB, // 00/02, link into memory free list, 8 MB
+ 0x6, 0x9, // 04/06, product id
+ 0x8, 0x0, // 08/0a, preference to 8 MB space
+ 0x0, 0x0, // 0c/0e, reserved
+ 0x0, 0x7, 0xd, 0xb, // 10/12/14/16, mfg id
+ 0x0, 0x0, 0x0, 0x0, 0x0, 0x4, 0x2, 0x0 // 18/.../26, serial
+};
+
+static unsigned char ac_a314_rom[] = {
+ 0xc, AC_MEM_SIZE_64KB, // 00/02, 64 kB
+ 0xa, 0x3, // 04/06, product id
+ 0x0, 0x0, // 08/0a, any space okay
+ 0x0, 0x0, // 0c/0e, reserved
+ 0x0, 0x7, 0xd, 0xb, // 10/12/14/16, mfg id
+ 0xa, 0x3, 0x1, 0x4, 0x0, 0x0, 0x0, 0x0 // 18/.../26, serial
+};
+
+static unsigned int autoconfig_read_memory_8(unsigned int address) {
+ unsigned char *rom = NULL;
+
+ if (ac_current_pic == 0)
+ rom = ac_fast_ram_rom;
+ else if (ac_current_pic == 1)
+ rom = ac_a314_rom;
+
+ unsigned char val = 0;
+ if ((address & 1) == 0 && (address / 2) < sizeof(ac_fast_ram_rom))
+ val = rom[address / 2];
+ val <<= 4;
+ if (address != 0 && address != 2 && address != 40 && address != 42)
+ val ^= 0xf0;
+ return (unsigned int)val;