--- uae/src/expansion.c 2018/04/24 16:42:04 1.1.1.4 +++ uae/src/expansion.c 2018/04/24 16:56:35 1.1.1.7 @@ -184,24 +184,28 @@ addrbank expamem_bank = { static uae_u32 REGPARAM2 expamem_lget (uaecptr addr) { + special_mem |= S_READ; write_log ("warning: READ.L from address $%lx \n", addr); return 0xfffffffful; } static uae_u32 REGPARAM2 expamem_wget (uaecptr addr) { + special_mem |= S_READ; write_log ("warning: READ.W from address $%lx \n", addr); return 0xffff; } static uae_u32 REGPARAM2 expamem_bget (uaecptr addr) { + special_mem |= S_READ; addr &= 0xFFFF; return expamem[addr]; } static void REGPARAM2 expamem_write (uaecptr addr, uae_u32 value) { + special_mem |= S_WRITE; addr &= 0xffff; if (addr == 00 || addr == 02 || addr == 0x40 || addr == 0x42) { expamem[addr] = (value & 0xf0); @@ -219,11 +223,13 @@ static int REGPARAM2 expamem_type (void) static void REGPARAM2 expamem_lput (uaecptr addr, uae_u32 value) { + special_mem |= S_WRITE; write_log ("warning: WRITE.L to address $%lx : value $%lx\n", addr, value); } static void REGPARAM2 expamem_wput (uaecptr addr, uae_u32 value) { + special_mem |= S_WRITE; if (expamem_type() != zorroIII) write_log ("warning: WRITE.W to address $%lx : value $%x\n", addr, value); else { @@ -234,7 +240,7 @@ static void REGPARAM2 expamem_wput (uaec (*card_map[ecard]) (); write_log (" Card %d (Zorro%s) done.\n", ecard + 1, expamem_type() == 0xc0 ? "II" : "III"); ++ecard; - if (ecard <= MAX_EXPANSION_BOARDS) + if (ecard < MAX_EXPANSION_BOARDS) (*card_init[ecard]) (); else expamem_init_clear (); @@ -246,6 +252,7 @@ static void REGPARAM2 expamem_wput (uaec static void REGPARAM2 expamem_bput (uaecptr addr, uae_u32 value) { + special_mem |= S_WRITE; switch (addr & 0xff) { case 0x30: case 0x32: @@ -260,7 +267,7 @@ static void REGPARAM2 expamem_bput (uaec (*card_map[ecard]) (); write_log (" Card %d (Zorro%s) done.\n", ecard + 1, expamem_type() == 0xc0 ? "II" : "III"); ++ecard; - if (ecard <= MAX_EXPANSION_BOARDS) + if (ecard < MAX_EXPANSION_BOARDS) (*card_init[ecard]) (); else expamem_init_clear (); @@ -276,7 +283,7 @@ static void REGPARAM2 expamem_bput (uaec case 0x4c: write_log (" Card %d (Zorro %s) had no success.\n", ecard + 1, expamem_type() == 0xc0 ? "II" : "III"); ++ecard; - if (ecard <= MAX_EXPANSION_BOARDS) + if (ecard < MAX_EXPANSION_BOARDS) (*card_init[ecard]) (); else expamem_init_clear (); @@ -393,6 +400,7 @@ uae_u8 filesysory[65536]; uae_u32 REGPARAM2 filesys_lget (uaecptr addr) { uae_u8 *m; + special_mem |= S_READ; addr -= filesys_start & 65535; addr &= 65535; m = filesysory + addr; @@ -402,6 +410,7 @@ uae_u32 REGPARAM2 filesys_lget (uaecptr uae_u32 REGPARAM2 filesys_wget (uaecptr addr) { uae_u8 *m; + special_mem |= S_READ; addr -= filesys_start & 65535; addr &= 65535; m = filesysory + addr; @@ -410,6 +419,7 @@ uae_u32 REGPARAM2 filesys_wget (uaecptr uae_u32 REGPARAM2 filesys_bget (uaecptr addr) { + special_mem |= S_READ; addr -= filesys_start & 65535; addr &= 65535; return filesysory[addr]; @@ -417,16 +427,19 @@ uae_u32 REGPARAM2 filesys_bget (uaecptr static void REGPARAM2 filesys_lput (uaecptr addr, uae_u32 l) { + special_mem |= S_WRITE; write_log ("filesys_lput called\n"); } static void REGPARAM2 filesys_wput (uaecptr addr, uae_u32 w) { + special_mem |= S_WRITE; write_log ("filesys_wput called\n"); } static void REGPARAM2 filesys_bput (uaecptr addr, uae_u32 b) { + special_mem |= S_WRITE; fprintf (stderr, "filesys_bput called. This usually means that you are using\n"); fprintf (stderr, "Kickstart 1.2. Please give UAE the \"-a\" option next time\n"); fprintf (stderr, "you start it. If you are _not_ using Kickstart 1.2, then\n"); @@ -590,7 +603,7 @@ static void expamem_map_filesys (void) filesys_start = ((expamem_hi | (expamem_lo >> 4)) << 16); map_banks (&filesys_bank, filesys_start >> 16, 1); - write_log ("Filesystem: mapped memory.\n"); + write_log ("Filesystem: mapped memory @$%lx.\n", filesys_start); /* 68k code needs to know this. */ a = here (); org (0xF0FFFC); @@ -600,7 +613,12 @@ static void expamem_map_filesys (void) static void expamem_init_filesys (void) { - uae_u8 diagarea[] = { 0x90, 0x00, 0x01, 0x0C, 0x01, 0x00, 0x01, 0x06 }; + /* struct DiagArea - the size has to be large enough to store several device ROMTags */ + uae_u8 diagarea[] = { 0x90, 0x00, /* da_Config, da_Flags */ + 0x02, 0x00, /* da_Size */ + 0x01, 0x00, /* da_DiagPoint */ + 0x01, 0x06 /* da_BootPoint */ + }; expamem_init_clear(); expamem_write (0x00, Z2_MEM_64KB | rom_card | zorroII); @@ -616,6 +634,7 @@ static void expamem_init_filesys (void) expamem_write (0x20, 0x00); /* ser.no. Byte 2 */ expamem_write (0x24, 0x01); /* ser.no. Byte 3 */ + /* er_InitDiagVec */ expamem_write (0x28, 0x10); /* Rom-Offset hi */ expamem_write (0x2c, 0x00); /* ROM-Offset lo */