]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
imported winuaesrc1450b16.zip
authorToni Wilen <twilen@winuae.net>
Wed, 12 Dec 2007 19:16:45 +0000 (21:16 +0200)
committerToni Wilen <twilen@winuae.net>
Mon, 22 Feb 2010 19:37:28 +0000 (21:37 +0200)
32 files changed:
audio.c
cfgfile.c
debug.c
enforcer.c
expansion.c
gayle.c
include/filesys.h
include/memory.h
include/options.h
main.c
memory.c
od-win32/bsdsock.c
od-win32/cloanto/RetroPlatformGuestIPC.c
od-win32/cloanto/RetroPlatformIPC.h
od-win32/dinput.c
od-win32/direct3d.c
od-win32/dxwrap.c
od-win32/dxwrap.h
od-win32/mman.c
od-win32/rp.c
od-win32/rp.h
od-win32/sounddep/sound.c
od-win32/win32.c
od-win32/win32.h
od-win32/win32_scale2x.c
od-win32/win32_uaenet.c
od-win32/win32gfx.c
od-win32/win32gui.c
od-win32/winuaechangelog.txt
sana2.c
uaeserial.c
zfile_archive.c

diff --git a/audio.c b/audio.c
index c00fe902bf8b75c3da17efd4bef6494ed3522bd7..c7812ab662b08152976d6e0c36f5d135584f0df1 100644 (file)
--- a/audio.c
+++ b/audio.c
@@ -1374,6 +1374,7 @@ void set_audio(void)
     currprefs.sound_volume = changed_prefs.sound_volume;
     currprefs.sound_stereo_swap_paula = changed_prefs.sound_stereo_swap_paula;
     currprefs.sound_stereo_swap_ahi = changed_prefs.sound_stereo_swap_ahi;
+
     if (currprefs.produce_sound >= 2) {
        if (!init_audio ()) {
            if (! sound_available) {
index 6b182f04073f8537bdc0112fd81203aa0f98dddc..9dcab2a51d32be9ddbea51afe6295fb78c9e09ac 100644 (file)
--- a/cfgfile.c
+++ b/cfgfile.c
@@ -722,7 +722,7 @@ static int getintval (char **p, int *result, int delim)
 
     *p2++ = '\0';
 
-    if (value[0] == '0' && value[1] == 'x')
+    if (value[0] == '0' && toupper (value[1]) == 'X')
        value += 2, base = 16;
     *result = strtol (value, &endptr, base);
     *p = p2;
@@ -750,7 +750,7 @@ static int getintval2 (char **p, int *result, int delim)
     if (*p2 != 0)
        *p2++ = '\0';
 
-    if (value[0] == '0' && value[1] == 'x')
+    if (value[0] == '0' && toupper (value[1]) == 'X')
        value += 2, base = 16;
     *result = strtol (value, &endptr, base);
     *p = p2;
@@ -1252,6 +1252,22 @@ struct uaedev_config_info *add_filesys_config (struct uae_prefs *p, int index,
     return uci;
 }
 
+static void parse_addmem (struct uae_prefs *p, char *buf, int num)
+{
+    uae_u32 size = 0, addr = 0;
+
+    if (!getintval2 (&buf, &addr, ','))
+       return;
+    if (!getintval2 (&buf, &size, 0))
+       return;
+    if (addr & 0xffff)
+       return;
+    if ((size & 0xffff) || (size & 0xffff0000) == 0)
+       return;
+    p->custom_memory_addrs[num] = addr;
+    p->custom_memory_sizes[num] = size;
+}
+
 static int cfgfile_parse_hardware (struct uae_prefs *p, char *option, char *value)
 {
     int tmpval, dummy, i;
@@ -1395,6 +1411,15 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, char *option, char *valu
        return 1;
     }
 
+    if (cfgfile_string (option, value, "addmem1", tmpbuf, sizeof tmpbuf)) {
+       parse_addmem (p, tmpbuf, 0);
+       return 1;
+    }
+    if (cfgfile_string (option, value, "addmem2", tmpbuf, sizeof tmpbuf)) {
+       parse_addmem (p, tmpbuf, 1);
+       return 1;
+    }
+
     if (cfgfile_strval (option, value, "chipset", &tmpval, csmode, 0)) {
        set_chipset_mask (p, tmpval);
        return 1;
@@ -2928,6 +2953,10 @@ void default_prefs (struct uae_prefs *p, int type)
     p->chipmem_size = 0x00080000;
     p->bogomem_size = 0x00080000;
     p->gfxmem_size = 0x00000000;
+    p->custom_memory_addrs[0] = 0;
+    p->custom_memory_sizes[0] = 0;
+    p->custom_memory_addrs[1] = 0;
+    p->custom_memory_sizes[1] = 0;
 
     p->nr_floppies = 2;
     p->dfxtype[0] = DRV_35_DD;
diff --git a/debug.c b/debug.c
index 195839f890bd2ecfac7865b579ebd76bbdd12aff..c2f7da1460175670370cd762f95a1489223c039a 100644 (file)
--- a/debug.c
+++ b/debug.c
@@ -514,7 +514,7 @@ static void dump_vectors (uaecptr addr)
     while (int_labels[i].name || trap_labels[j].name) {
        if (int_labels[i].name) {
            console_out ("$%08X: %s  \t $%08X\t", int_labels[i].adr + addr,
-               int_labels[i].name, get_long (int_labels[i].adr + (int_labels[i].adr == 4 ? 0 : addr)));
+               int_labels[i].name, get_long (int_labels[i].adr + addr));
            i++;
        } else {
            console_out ("\t\t\t\t");
index 8705ed1119d5df60355747a10ae954acf04cdeec..3051ebced630963b5a3515bc3b7486912965fd79 100644 (file)
@@ -43,7 +43,7 @@ static int enforcer_installed = 0;
 int enforcermode = 0;
 static int enforcer_hit = 0; /* set to 1 if displaying the hit */
 
-#define ENFORCER_BUF_SIZE 4096
+#define ENFORCER_BUF_SIZE 8192
 static char enforcer_buf[ENFORCER_BUF_SIZE];
 
 uae_u32 (REGPARAM3 *saved_chipmem_lget) (uaecptr addr);
index f57efa2d8a4712dc0dc12ff8a77db006b9a70e0b..4c3991fdff061efa8ef0b50237e4543fdbeafebf 100644 (file)
@@ -966,6 +966,7 @@ static void expamem_init_gfxcard (void)
 }
 #endif
 
+
 #ifdef SAVESTATE
 static size_t fast_filepos, z3_filepos, p96_filepos;
 #endif
@@ -1119,7 +1120,8 @@ void p96memstart(void)
 {
     /* make sure there is always empty space between Z3 and P96 RAM */
     p96ram_start = currprefs.z3fastmem_start + ((currprefs.z3fastmem_size + 0xffffff) & ~0xffffff);
-    if (p96ram_start == currprefs.z3fastmem_start + currprefs.z3fastmem_size)
+    if (p96ram_start == currprefs.z3fastmem_start + currprefs.z3fastmem_size &&
+       (currprefs.z3fastmem_size < 512 * 1024 * 1024 || currprefs.gfxmem_size < 128 * 1024 * 1024))
        p96ram_start += 0x1000000;
 }
 
diff --git a/gayle.c b/gayle.c
index 3bc105bb167be697eeff1c2fc9115996ccf9ee87..42a43cc0df76de44e8e0d06ee9b5fbe4dd0e25d8 100644 (file)
--- a/gayle.c
+++ b/gayle.c
 #include "ncr_scsi.h"
 
 /*
-D80000 to D8FFFF               64 KB SPARE chip select
-D90000 to D9FFFF               64 KB ARCNET chip select
-DA0000 to DA3FFF               16 KB IDE drive
-DA4000 to DA4FFF               16 KB IDE reserved
-DA8000 to DAFFFF               32 KB Credit Card and IDE configregisters
-DB0000 to DBFFFF               64 KB Not used (reserved for external IDE)
-* DC0000 to DCFFFF             64 KB Real Time Clock (RTC)
-DD0000 to DDFFFF               64 KB A3000 DMA controller
-DD0000 to DD1FFF                      A4000 DMAC
-DD2000 to DDFFFF                      A4000 IDE
-DE0000 to DEFFFF               64 KB Motherboard resources
+600000 to 9FFFFF       4 MB    Credit Card memory if CC present
+AOOOOO to A1FFFF       128 KB  Credit Card Attributes
+A20000 to A3FFFF       128 KB  Credit Card I/O
+A40000 to A5FFFF       128 KB  Credit Card Bits
+A60000 to A7FFFF       128 KB  PC I/O
+
+D80000 to D8FFFF       64 KB SPARE chip select
+D90000 to D9FFFF       64 KB ARCNET chip select
+DA0000 to DA3FFF       16 KB IDE drive
+DA4000 to DA4FFF       16 KB IDE reserved
+DA8000 to DAFFFF       32 KB Credit Card and IDE configregisters
+DB0000 to DBFFFF       64 KB Not used (reserved for external IDE)
+* DC0000 to DCFFFF     64 KB Real Time Clock (RTC)
+DD0000 to DDFFFF       64 KB A3000 DMA controller
+DD0000 to DD1FFF        A4000 DMAC
+DD2000 to DDFFFF        A4000 IDE
+DE0000 to DEFFFF       64 KB Motherboard resources
 */
 
 #define NCR_OFFSET 0x40
@@ -1016,37 +1022,96 @@ void gayle_hsync (void)
     }
 }
 
+#define PCMCIA_COMMON_MAX 0x400000
+static int pcmcia_common_size, pcmcia_attrs_size;
+static uae_u8 *pcmcia_common;
+static uae_u8 *pcmcia_attrs;
+
 static uae_u32 gayle_attr_read (uaecptr addr)
 {
     uae_u8 v = 0;
-    write_log ("R: %x %x\n", addr, M68K_GETPC);
-    addr &= 262144 - 1;
-    switch (addr)
-    {
-       case 0:
-       v = 0x91;
-       break;
-       case 2:
-       v = 0x05;
-       break;
-       case 4:
-       v = 0x23;
-       break;
+    write_log ("PCMCIA ATTR R: %x %x\n", addr, M68K_GETPC);
+    addr &= 0x80000 - 1;
+    if (addr >= 0x40000) {
+        write_log ("GAYLE: Reset disabled\n");
+       gayle_irq |= GAYLE_IRQ_CCDET | GAYLE_IRQ_SC | GAYLE_CS_IRQ;
+       if (gayle_intena & GAYLE_CS_IRQ)
+           INTREQ_f (0x8000 | 0x0008);
+       return v;
     }
+    if (addr >= pcmcia_attrs_size)
+       return v;
+    v = pcmcia_attrs[addr / 2];
     return v;
 }
 static void gayle_attr_write (uaecptr addr, uae_u32 v)
 {
-    write_log ("W: %x=%x %x\n", addr, v, M68K_GETPC);
-    addr &= 262144 - 1;
-    if (addr == 0x40000) {
-       if (v)
-           write_log ("GAYLE: Reset active\n");
-       else
-           write_log ("GAYLE: Reset non-active\n");
+    write_log ("PCMCIA ATTR W: %x=%x %x\n", addr, v, M68K_GETPC);
+    addr &= 0x80000 - 1;
+    if (addr >= 0x40000) {
+        write_log ("GAYLE: Reset active\n");
+    } else if (addr < pcmcia_attrs_size) {
+       ;
     }
 }
 
+static void initsramattr (void)
+{
+    int wps = 1;
+    uae_u8 *p = pcmcia_attrs;
+
+    *p++ = 0x01; /* CISTPL_DEVICE */
+    *p++ = 3;
+    *p++ = (6 /* DTYPE_SRAM */ << 4) | (wps ? 8 : 0) | (3 /* DSPEED_150NS */);
+    *p++ = (4 << 3) | 4;
+    *p++ = 0xff;
+
+    *p++ = 0xff; /* CISTPL_END */
+}
+
+static void initpcmcia (void)
+{
+    pcmcia_common_size = 4 * 1024 * 1024;
+    xfree (pcmcia_common);
+    pcmcia_common = xcalloc (pcmcia_common_size, 1);
+    pcmcia_attrs_size = 256;
+    xfree (pcmcia_attrs);
+    pcmcia_attrs = xmalloc (pcmcia_attrs_size);
+    initsramattr();
+}
+
+static uae_u32 gayle_common_read (uaecptr addr)
+{
+    uae_u8 v = 0;
+    write_log ("PCMCIA COMMON R: %x %x\n", addr, M68K_GETPC);
+    addr &= PCMCIA_COMMON_MAX - 1;
+    if (addr < pcmcia_common_size)
+       v = pcmcia_common[addr];
+    return v;
+}
+static void gayle_common_write (uaecptr addr, uae_u32 v)
+{
+    write_log ("PCMCIA COMMON W: %x=%x %x\n", addr, v, M68K_GETPC);
+    addr &= PCMCIA_COMMON_MAX - 1;
+    if (addr < pcmcia_common_size)
+       pcmcia_common[addr] = v;
+}
+
+static uae_u32 REGPARAM3 gayle_common_lget (uaecptr) REGPARAM;
+static uae_u32 REGPARAM3 gayle_common_wget (uaecptr) REGPARAM;
+static uae_u32 REGPARAM3 gayle_common_bget (uaecptr) REGPARAM;
+static void REGPARAM3 gayle_common_lput (uaecptr, uae_u32) REGPARAM;
+static void REGPARAM3 gayle_common_wput (uaecptr, uae_u32) REGPARAM;
+static void REGPARAM3 gayle_common_bput (uaecptr, uae_u32) REGPARAM;
+
+addrbank gayle_common_bank = {
+    gayle_common_lget, gayle_common_wget, gayle_common_bget,
+    gayle_common_lput, gayle_common_wput, gayle_common_bput,
+    default_xlate, default_check, NULL, "Gayle PCMCIA Common",
+    dummy_lgeti, dummy_wgeti, ABFLAG_RAM
+};
+
+
 static uae_u32 REGPARAM3 gayle_attr_lget (uaecptr) REGPARAM;
 static uae_u32 REGPARAM3 gayle_attr_wget (uaecptr) REGPARAM;
 static uae_u32 REGPARAM3 gayle_attr_bget (uaecptr) REGPARAM;
@@ -1057,8 +1122,8 @@ static void REGPARAM3 gayle_attr_bput (uaecptr, uae_u32) REGPARAM;
 addrbank gayle_attr_bank = {
     gayle_attr_lget, gayle_attr_wget, gayle_attr_bget,
     gayle_attr_lput, gayle_attr_wput, gayle_attr_bput,
-    default_xlate, default_check, NULL, "Gayle PCMCIA attribute",
-    dummy_lgeti, dummy_wgeti, ABFLAG_IO
+    default_xlate, default_check, NULL, "Gayle PCMCIA Attribute/Misc",
+    dummy_lgeti, dummy_wgeti, ABFLAG_IO | ABFLAG_SAFE
 };
 
 static uae_u32 REGPARAM2 gayle_attr_lget (uaecptr addr)
@@ -1088,7 +1153,6 @@ static uae_u32 REGPARAM2 gayle_attr_bget (uaecptr addr)
 #endif
     return gayle_attr_read (addr);
 }
-
 static void REGPARAM2 gayle_attr_lput (uaecptr addr, uae_u32 value)
 {
 #ifdef JIT
@@ -1097,7 +1161,6 @@ static void REGPARAM2 gayle_attr_lput (uaecptr addr, uae_u32 value)
     gayle_attr_wput (addr, value >> 16);
     gayle_attr_wput (addr + 2, value & 0xffff);
 }
-
 static void REGPARAM2 gayle_attr_wput (uaecptr addr, uae_u32 value)
 {
 #ifdef JIT
@@ -1106,7 +1169,6 @@ static void REGPARAM2 gayle_attr_wput (uaecptr addr, uae_u32 value)
     gayle_attr_bput (addr, value >> 8);
     gayle_attr_bput (addr + 1, value & 0xff);
 }
-
 static void REGPARAM2 gayle_attr_bput (uaecptr addr, uae_u32 value)
 {
 #ifdef JIT
@@ -1116,6 +1178,58 @@ static void REGPARAM2 gayle_attr_bput (uaecptr addr, uae_u32 value)
 }
 
 
+static uae_u32 REGPARAM2 gayle_common_lget (uaecptr addr)
+{
+    uae_u32 v;
+#ifdef JIT
+    special_mem |= S_READ;
+#endif
+    v = gayle_common_wget (addr) << 16;
+    v |= gayle_common_wget (addr + 2);
+    return v;
+}
+static uae_u32 REGPARAM2 gayle_common_wget (uaecptr addr)
+{
+    uae_u16 v;
+#ifdef JIT
+    special_mem |= S_READ;
+#endif
+    v = gayle_common_bget (addr) << 8;
+    v |= gayle_common_bget (addr + 1);
+    return v;
+}
+static uae_u32 REGPARAM2 gayle_common_bget (uaecptr addr)
+{
+#ifdef JIT
+    special_mem |= S_READ;
+#endif
+    return gayle_common_read (addr);
+}
+static void REGPARAM2 gayle_common_lput (uaecptr addr, uae_u32 value)
+{
+#ifdef JIT
+    special_mem |= S_WRITE;
+#endif
+    gayle_common_wput (addr, value >> 16);
+    gayle_common_wput (addr + 2, value & 0xffff);
+}
+static void REGPARAM2 gayle_common_wput (uaecptr addr, uae_u32 value)
+{
+#ifdef JIT
+    special_mem |= S_WRITE;
+#endif
+    gayle_common_bput (addr, value >> 8);
+    gayle_common_bput (addr + 1, value & 0xff);
+}
+static void REGPARAM2 gayle_common_bput (uaecptr addr, uae_u32 value)
+{
+#ifdef JIT
+    special_mem |= S_WRITE;
+#endif
+    gayle_common_write (addr, value);
+}
+
+
 static int rl (uae_u8 *p)
 {
     return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | (p[3]);
@@ -1192,6 +1306,8 @@ void gayle_reset (int hardreset)
        ncr_reset ();
     }
     gayle_bank.name = bankname;
+
+    initpcmcia();
 }
 
 uae_u8 *restore_gayle (uae_u8 *src)
index 9945faf77e4333af815c15da808edec1bdad6aef..8a5c67f67b54968c8189b25dd06ae5bf276c64e2 100644 (file)
@@ -67,6 +67,8 @@ struct hd_hardfiledata {
 #define HD_CONTROLLER_SCSI4 9
 #define HD_CONTROLLER_SCSI5 10
 #define HD_CONTROLLER_SCSI6 11
+#define HD_CONTROLLER_PCMCIA_SRAM 12
+#define HD_CONTROLLER_PCMCIA_IDE 13
 
 #define FILESYS_VIRTUAL 0
 #define FILESYS_HARDFILE 1
index 1b2f6e5e665070142516c5bf9b85a83942b6c9ab..28ef34ebf2029aed611bb2a22e72a1bf6f1cb693 100644 (file)
@@ -112,6 +112,7 @@ extern addrbank gfxmem_bank, gfxmem_bankx;
 extern addrbank gayle_bank;
 extern addrbank gayle2_bank;
 extern addrbank gayle_attr_bank;
+extern addrbank gayle_common_bank;
 extern addrbank mbres_bank;
 extern addrbank akiko_bank;
 extern addrbank cardmem_bank;
@@ -324,7 +325,6 @@ extern uae_u8 *mapped_malloc (size_t, char *);
 extern void mapped_free (uae_u8 *);
 extern void clearexec (void);
 extern void mapkick (void);
-extern int read_kickstart (struct zfile *f, uae_u8 *mem, int size, int dochecksum, int *cloanto_rom);
 extern int decode_cloanto_rom_do (uae_u8 *mem, int size, int real_size);
 extern void init_shm(void);
 extern void a3000_fakekick(int);
index 9032390e5d1039aef8a1140c32523fdbbf50d7fd..90e3c4b48f643788d055051bfc94e8e84c85423d 100644 (file)
@@ -40,6 +40,7 @@ struct uae_input_device {
 };
 
 #define MAX_SPARE_DRIVES 20
+#define MAX_CUSTOM_MEMORY_ADDRS 2
 
 #define CONFIG_TYPE_HARDWARE 1
 #define CONFIG_TYPE_HOST 2
@@ -253,6 +254,8 @@ struct uae_prefs {
     uae_u32 mbresmem_low_size;
     uae_u32 mbresmem_high_size;
     uae_u32 gfxmem_size;
+    uae_u32 custom_memory_addrs[MAX_CUSTOM_MEMORY_ADDRS];
+    uae_u32 custom_memory_sizes[MAX_CUSTOM_MEMORY_ADDRS];
 
     int kickshifter;
     int filesys_no_uaefsdb;
diff --git a/main.c b/main.c
index 0804bd69b6deea5f6633e1859f38ad67322d5491..bdc64d30e7fa1c2a79209f89143d1378e9728d85 100644 (file)
--- a/main.c
+++ b/main.c
@@ -768,8 +768,10 @@ static void real_main2 (int argc, char **argv)
        if (currprefs.start_debugger && debuggable ())
            activate_debugger ();
 
-       if (sound_available && currprefs.produce_sound > 1 && ! init_audio ()) {
-           write_log ("Sound driver unavailable: Sound output disabled\n");
+       if (!init_audio ()) {
+           if (sound_available && currprefs.produce_sound > 1) {
+               write_log ("Sound driver unavailable: Sound output disabled\n");
+           }
            currprefs.produce_sound = 0;
        }
 
index cbc9de3009194b7f64df0fab05c1723a29592a95..430d4734b6be8e1c118cfcd9e17e1c349cf90ddf 100644 (file)
--- a/memory.c
+++ b/memory.c
@@ -1832,6 +1832,156 @@ addrbank extendedkickmem_bank = {
     extendedkickmem_lget, extendedkickmem_wget, ABFLAG_ROM
 };
 
+
+static uae_u32 allocated_custmem1, allocated_custmem2;
+static uae_u32 custmem1_mask, custmem2_mask;
+static uae_u8 *custmem1, *custmem2;
+
+static uae_u32 REGPARAM3 custmem1_lget (uaecptr) REGPARAM;
+static uae_u32 REGPARAM3 custmem1_wget (uaecptr) REGPARAM;
+static uae_u32 REGPARAM3 custmem1_bget (uaecptr) REGPARAM;
+static void REGPARAM3 custmem1_lput (uaecptr, uae_u32) REGPARAM;
+static void REGPARAM3 custmem1_wput (uaecptr, uae_u32) REGPARAM;
+static void REGPARAM3 custmem1_bput (uaecptr, uae_u32) REGPARAM;
+static int REGPARAM3 custmem1_check (uaecptr addr, uae_u32 size) REGPARAM;
+static uae_u8 *REGPARAM3 custmem1_xlate (uaecptr addr) REGPARAM;
+
+static uae_u32 REGPARAM2 custmem1_lget (uaecptr addr)
+{
+    uae_u8 *m;
+    addr -= currprefs.custom_memory_addrs[0] & custmem1_mask;
+    addr &= custmem1_mask;
+    m = custmem1 + addr;
+    return do_get_mem_long ((uae_u32 *)m);
+}
+static uae_u32 REGPARAM2 custmem1_wget (uaecptr addr)
+{
+    uae_u8 *m;
+    addr -= currprefs.custom_memory_addrs[0] & custmem1_mask;
+    addr &= custmem1_mask;
+    m = custmem1 + addr;
+    return do_get_mem_word ((uae_u16 *)m);
+}
+static uae_u32 REGPARAM2 custmem1_bget (uaecptr addr)
+{
+    addr -= currprefs.custom_memory_addrs[0] & custmem1_mask;
+    addr &= custmem1_mask;
+    return custmem1[addr];
+}
+static void REGPARAM2 custmem1_lput (uaecptr addr, uae_u32 l)
+{
+    uae_u8 *m;
+    addr -= currprefs.custom_memory_addrs[0] & custmem1_mask;
+    addr &= custmem1_mask;
+    m = custmem1 + addr;
+    do_put_mem_long ((uae_u32 *)m, l);
+}
+static void REGPARAM2 custmem1_wput (uaecptr addr, uae_u32 w)
+{
+    uae_u8 *m;
+    addr -= currprefs.custom_memory_addrs[0] & custmem1_mask;
+    addr &= custmem1_mask;
+    m = custmem1 + addr;
+    do_put_mem_word ((uae_u16 *)m, w);
+}
+static void REGPARAM2 custmem1_bput (uaecptr addr, uae_u32 b)
+{
+    addr -= currprefs.custom_memory_addrs[0] & custmem1_mask;
+    addr &= custmem1_mask;
+    custmem1[addr] = b;
+}
+static int REGPARAM2 custmem1_check (uaecptr addr, uae_u32 size)
+{
+    addr -= currprefs.custom_memory_addrs[0] & custmem1_mask;
+    addr &= custmem1_mask;
+    return (addr + size) <= currprefs.custom_memory_sizes[0];
+}
+static uae_u8 *REGPARAM2 custmem1_xlate (uaecptr addr)
+{
+    addr -= currprefs.custom_memory_addrs[0] & custmem1_mask;
+    addr &= custmem1_mask;
+    return custmem1 + addr;
+}
+
+static uae_u32 REGPARAM3 custmem2_lget (uaecptr) REGPARAM;
+static uae_u32 REGPARAM3 custmem2_wget (uaecptr) REGPARAM;
+static uae_u32 REGPARAM3 custmem2_bget (uaecptr) REGPARAM;
+static void REGPARAM3 custmem2_lput (uaecptr, uae_u32) REGPARAM;
+static void REGPARAM3 custmem2_wput (uaecptr, uae_u32) REGPARAM;
+static void REGPARAM3 custmem2_bput (uaecptr, uae_u32) REGPARAM;
+static int REGPARAM3 custmem2_check (uaecptr addr, uae_u32 size) REGPARAM;
+static uae_u8 *REGPARAM3 custmem2_xlate (uaecptr addr) REGPARAM;
+
+static uae_u32 REGPARAM2 custmem2_lget (uaecptr addr)
+{
+    uae_u8 *m;
+    addr -= currprefs.custom_memory_addrs[1] & custmem2_mask;
+    addr &= custmem2_mask;
+    m = custmem2 + addr;
+    return do_get_mem_long ((uae_u32 *)m);
+}
+static uae_u32 REGPARAM2 custmem2_wget (uaecptr addr)
+{
+    uae_u8 *m;
+    addr -= currprefs.custom_memory_addrs[1] & custmem2_mask;
+    addr &= custmem2_mask;
+    m = custmem2 + addr;
+    return do_get_mem_word ((uae_u16 *)m);
+}
+static uae_u32 REGPARAM2 custmem2_bget (uaecptr addr)
+{
+    addr -= currprefs.custom_memory_addrs[1] & custmem2_mask;
+    addr &= custmem2_mask;
+    return custmem2[addr];
+}
+static void REGPARAM2 custmem2_lput (uaecptr addr, uae_u32 l)
+{
+    uae_u8 *m;
+    addr -= currprefs.custom_memory_addrs[1] & custmem2_mask;
+    addr &= custmem2_mask;
+    m = custmem2 + addr;
+    do_put_mem_long ((uae_u32 *)m, l);
+}
+static void REGPARAM2 custmem2_wput (uaecptr addr, uae_u32 w)
+{
+    uae_u8 *m;
+    addr -= currprefs.custom_memory_addrs[1] & custmem2_mask;
+    addr &= custmem2_mask;
+    m = custmem2 + addr;
+    do_put_mem_word ((uae_u16 *)m, w);
+}
+static void REGPARAM2 custmem2_bput (uaecptr addr, uae_u32 b)
+{
+    addr -= currprefs.custom_memory_addrs[1] & custmem2_mask;
+    addr &= custmem2_mask;
+    custmem2[addr] = b;
+}
+static int REGPARAM2 custmem2_check (uaecptr addr, uae_u32 size)
+{
+    addr -= currprefs.custom_memory_addrs[1] & custmem2_mask;
+    addr &= custmem2_mask;
+    return (addr + size) <= currprefs.custom_memory_sizes[1];
+}
+static uae_u8 *REGPARAM2 custmem2_xlate (uaecptr addr)
+{
+    addr -= currprefs.custom_memory_addrs[1] & custmem2_mask;
+    addr &= custmem2_mask;
+    return custmem2 + addr;
+}
+
+addrbank custmem1_bank = {
+    custmem1_lget, custmem1_wget, custmem1_bget,
+    custmem1_lput, custmem1_wput, custmem1_bput,
+    custmem1_xlate, custmem1_check, NULL, "Non-autoconfig RAM #1",
+    custmem1_lget, custmem1_wget, ABFLAG_RAM
+};
+addrbank custmem2_bank = {
+    custmem1_lget, custmem1_wget, custmem1_bget,
+    custmem1_lput, custmem1_wput, custmem1_bput,
+    custmem1_xlate, custmem1_check, NULL, "Non-autoconfig RAM #2",
+    custmem1_lget, custmem1_wget, ABFLAG_RAM
+};
+
 #define fkickmem_size 524288
 void a3000_fakekick(int map)
 {
@@ -1890,7 +2040,7 @@ static int kickstart_checksum (uae_u8 *mem, int size)
 }
 
 static char *kickstring = "exec.library";
-static int read_kickstart (struct zfile *f, uae_u8 *mem, int size, int dochecksum, int *cloanto_rom)
+static int read_kickstart (struct zfile *f, uae_u8 *mem, int size, int dochecksum, int *cloanto_rom, int noalias)
 {
     unsigned char buffer[20];
     int i, j, oldpos;
@@ -1925,7 +2075,7 @@ static int read_kickstart (struct zfile *f, uae_u8 *mem, int size, int dochecksu
        notify_user (NUMSG_KSROMREADERROR);
        return 0;
     }
-    if (i == size / 2)
+    if (!noalias && i == size / 2)
        memcpy (mem + size / 2, mem, size / 2);
 
     if (cr) {
@@ -1975,19 +2125,24 @@ static int load_extendedkickstart (void)
     }
     zfile_fseek (f, 0, SEEK_END);
     size = zfile_ftell (f);
+    extendedkickmem_size = 524288;
     off = 0;
-    if (size > 300000) {
-       extendedkickmem_size = 524288;
+    if (currprefs.cs_cd32cd) {
+       extendedkickmem_type = EXTENDED_ROM_CD32;
+       if (size >= 524288 * 2)
+           off = 524288;
+    } else if (currprefs.cs_cdtvcd || currprefs.cs_cdtvram) {
+       extendedkickmem_type = EXTENDED_ROM_CDTV;
+    } else if (size > 300000) {
        extendedkickmem_type = EXTENDED_ROM_CD32;
        if (size >= 524288 * 2)
            off = 524288;
     } else {
-       extendedkickmem_size = 262144;
        extendedkickmem_type = EXTENDED_ROM_CDTV;
     }
+
     zfile_fseek (f, off, SEEK_SET);
     switch (extendedkickmem_type) {
-
     case EXTENDED_ROM_CDTV:
        extendedkickmemory = (uae_u8 *) mapped_malloc (extendedkickmem_size, "rom_f0");
        extendedkickmem_bank.baseaddr = (uae_u8 *) extendedkickmemory;
@@ -1997,7 +2152,7 @@ static int load_extendedkickstart (void)
        extendedkickmem_bank.baseaddr = (uae_u8 *) extendedkickmemory;
        break;
     }
-    read_kickstart (f, extendedkickmemory, extendedkickmem_size,  0, 0);
+    read_kickstart (f, extendedkickmemory, extendedkickmem_size,  0, 0, 1);
     extendedkickmem_mask = extendedkickmem_size - 1;
     zfile_fclose (f);
     return 1;
@@ -2164,7 +2319,7 @@ static int load_kickstart (void)
            }
            zfile_fseek (f, kspos, SEEK_SET);
        }
-       size = read_kickstart (f, kickmemory, maxsize, 1, &cloanto_rom);
+       size = read_kickstart (f, kickmemory, maxsize, 1, &cloanto_rom, 0);
        if (size == 0)
            goto err;
        kickmem_mask = size - 1;
@@ -2175,7 +2330,7 @@ static int load_kickstart (void)
            extendedkickmemory = (uae_u8 *) mapped_malloc (extendedkickmem_size, "rom_e0");
            extendedkickmem_bank.baseaddr = (uae_u8 *) extendedkickmemory;
            zfile_fseek (f, extpos, SEEK_SET);
-           read_kickstart (f, extendedkickmemory, 0x80000,  0, 0);
+           read_kickstart (f, extendedkickmemory, 0x80000,  0, 0, 1);
            extendedkickmem_mask = extendedkickmem_size - 1;
        }
     }
@@ -2318,7 +2473,7 @@ uae_u8 *mapped_malloc (size_t s, char *file)
 
     if (!canbang) {
        nocanbang();
-       return xmalloc (s + 4);
+       return xcalloc (s + 4, 1);
     }
 
     id = shmget (IPC_PRIVATE, s, 0x1ff, file);
@@ -2451,6 +2606,31 @@ static void allocate_memory (void)
        }
        cdtv_loadcardmem(cardmemory, allocated_cardmem);
     }
+    if (allocated_custmem1 != currprefs.custom_memory_sizes[0]) {
+       if (custmem1)
+           mapped_free (custmem1);
+       custmem1 = 0;
+       allocated_custmem1 = currprefs.custom_memory_sizes[0];
+       custmem1_mask = allocated_custmem1 - 1;
+       if (allocated_custmem1) {
+           custmem1 = mapped_malloc (allocated_custmem1, "custmem1");
+           if (!custmem1)
+               allocated_custmem1 = 0;
+       }
+    }
+    if (allocated_custmem2 != currprefs.custom_memory_sizes[1]) {
+       if (custmem2)
+           mapped_free (custmem2);
+       custmem2 = 0;
+       allocated_custmem2 = currprefs.custom_memory_sizes[1];
+       custmem2_mask = allocated_custmem2 - 1;
+       if (allocated_custmem2) {
+           custmem2 = mapped_malloc (allocated_custmem2, "custmem2");
+           if (!custmem2)
+               allocated_custmem2 = 0;
+       }
+    }
+
     if (savestate_state == STATE_RESTORE) {
        restore_ram (bootrom_filepos, rtarea);
        restore_ram (chip_filepos, chipmemory);
@@ -2603,7 +2783,8 @@ void memory_reset (void)
        if (currprefs.cs_ide == 1) {
            map_banks (&gayle_bank, 0xD8, 6, 0);
            map_banks (&gayle2_bank, 0xDD, 2, 0);
-           // map_banks (&gayle_attr_bank, 0xA0, 8, 0); only if PCMCIA card inserted */
+           //map_banks (&gayle_attr_bank, 0xA0, 8, 0); // only if PCMCIA card inserted
+           //map_banks (&gayle_common_bank, 0x60, 64, 0); // only if PCMCIA card inserted
        }
        if (currprefs.cs_ide == 2 || currprefs.cs_mbdmac == 2) {
            map_banks (&gayle_bank, 0xDD, 1, 0);
@@ -2661,7 +2842,7 @@ void memory_reset (void)
        break;
 #ifdef CDTV
     case EXTENDED_ROM_CDTV:
-       map_banks (&extendedkickmem_bank, 0xF0, 4, 0);
+       map_banks (&extendedkickmem_bank, 0xF0, 8, 0);
        break;
 #endif
 #ifdef CD32
@@ -2680,6 +2861,18 @@ void memory_reset (void)
            map_banks (&kickmem_bank, 0xB0, 8, 0);
        }
     }
+
+    if (currprefs.custom_memory_sizes[0]) {
+       map_banks (&custmem1_bank,
+           currprefs.custom_memory_addrs[0] >> 16,
+           currprefs.custom_memory_sizes[0] >> 16, 0);
+    }
+    if (currprefs.custom_memory_sizes[1]) {
+       map_banks (&custmem2_bank,
+           currprefs.custom_memory_addrs[1] >> 16,
+           currprefs.custom_memory_sizes[1] >> 16, 0);
+    }
+
 #ifdef ARCADIA
     if (is_arcadia_rom (currprefs.romextfile) == ARCADIA_BIOS) {
        if (strcmp (currprefs.romextfile, changed_prefs.romextfile) != 0)
@@ -2717,6 +2910,8 @@ void memory_init (void)
     a3000lmemory = a3000hmemory = 0;
     bogomemory = 0;
     cardmemory = 0;
+    custmem1 = 0;
+    custmem2 = 0;
 
     kickmemory = mapped_malloc (0x80000, "kick");
     memset (kickmemory, 0, 0x80000);
@@ -2757,6 +2952,10 @@ void memory_cleanup (void)
        cdtv_savecardmem (cardmemory, allocated_cardmem);
        mapped_free (cardmemory);
     }
+    if (custmem1)
+       mapped_free (custmem1);
+    if (custmem2)
+       mapped_free (custmem2);
 
     bogomemory = 0;
     kickmemory = 0;
@@ -2765,6 +2964,8 @@ void memory_cleanup (void)
     a1000_kickstart_mode = 0;
     chipmemory = 0;
     cardmemory = 0;
+    custmem1 = 0;
+    custmem2 = 0;
 
     #ifdef ACTION_REPLAY
     action_replay_cleanup();
index db79bb49be459ba9c85c02a6e4b09d3fcc88a1dc..f41e95bb80dac9e56b8bff21e53b23a5fed2aa31 100644 (file)
@@ -701,25 +701,25 @@ void host_accept(TrapContext *context, SB, uae_u32 sd, uae_u32 name, uae_u32 nam
     if (s != INVALID_SOCKET) {
                BEGINBLOCKING;
 
-               s2 = accept(s,rp_name,&hlen);
+               s2 = accept(s, rp_name, &hlen);
 
                if (s2 == INVALID_SOCKET) {
                        SETERRNO;
 
-                       if ((sb->ftable[sd-1] & SF_BLOCKING) && sb->sb_errno == WSAEWOULDBLOCK - WSABASEERR) {
-                               if (sb->mtable[sd-1] || (wMsg = allocasyncmsg(sb,sd,s)) != 0) {
-                                       if (sb->mtable[sd-1] == 0) {
+                       if ((sb->ftable[sd - 1] & SF_BLOCKING) && sb->sb_errno == WSAEWOULDBLOCK - WSABASEERR) {
+                               if (sb->mtable[sd - 1] || (wMsg = allocasyncmsg(sb, sd, s)) != 0) {
+                                       if (sb->mtable[sd - 1] == 0) {
                                                WSAAsyncSelect(s,hWndSelector ? hAmigaWnd : bsd->hSockWnd, wMsg, FD_ACCEPT);
                                        } else {
-                                               setWSAAsyncSelect(sb,sd,s,FD_ACCEPT);
+                                               setWSAAsyncSelect(sb, sd, s, FD_ACCEPT);
                                        }
 
                                        WAITSIGNAL;
 
-                                       if (sb->mtable[sd-1] == 0) {
+                                       if (sb->mtable[sd - 1] == 0) {
                                                cancelasyncmsg(context, wMsg);
                                        } else {
-                                               setWSAAsyncSelect(sb,sd,s,0);
+                                               setWSAAsyncSelect(sb, sd, s, 0);
                                        }
 
                                        if (sb->eintr) {
@@ -728,7 +728,7 @@ void host_accept(TrapContext *context, SB, uae_u32 sd, uae_u32 name, uae_u32 nam
                                                return;
                                        }
 
-                                       s2 = accept(s,rp_name,&hlen);
+                                       s2 = accept(s, rp_name, &hlen);
 
                                        if (s2 == INVALID_SOCKET) {
                                                SETERRNO;
@@ -745,23 +745,23 @@ void host_accept(TrapContext *context, SB, uae_u32 sd, uae_u32 name, uae_u32 nam
                        TRACE(("failed (%d)\n",sb->sb_errno));
                } else {
                        sb->resultval = getsd(sb, s2);
-                       sb->ftable[sb->resultval-1] = sb->ftable[sd-1]; // new socket inherits the old socket's properties
+                       sb->ftable[sb->resultval - 1] = sb->ftable[sd - 1]; // new socket inherits the old socket's properties
                        sb->resultval--;
                        if (rp_name != 0) { // 1.11.2002 XXX
                                if (hlen <= hlenuae) { // Fix for CNET BBS Part 2
-                                       prepamigaaddr(rp_name,hlen);
+                                       prepamigaaddr(rp_name, hlen);
                                        if (namelen != 0) {
-                                               put_long (namelen,hlen);
+                                               put_long (namelen, hlen);
                                        }
                                } else { // Copy only the number of bytes requested
                                        if (hlenuae != 0) {
-                                               prepamigaaddr(rp_name,hlenuae);
-                                               memcpy(rp_nameuae,rp_name,hlenuae);
-                                               put_long (namelen,hlenuae);
+                                               prepamigaaddr(rp_name, hlenuae);
+                                               memcpy(rp_nameuae, rp_name, hlenuae);
+                                               put_long (namelen, hlenuae);
                                        }
                                }
                        }
-                       TRACE(("%d/%d\n",sb->resultval,hlen));
+                       TRACE(("%d/%d\n", sb->resultval, hlen));
                }
 
                ENDBLOCKING;
@@ -817,11 +817,15 @@ struct threadsock_packet
     SB;
 } sockreq;
 
+// sockreg.sb may be gone if thread dies at right time.. fixme.. */
+
 static BOOL HandleStuff(void)
 {
        BOOL quit = FALSE;
        SB = NULL;
        BOOL handled = TRUE;
+       int rv;
+
        if (bsd->hSockReq) {
        // 100ms sleepiness might need some tuning...
        //if(WaitForSingleObject( hSockReq, 100 ) == WAIT_OBJECT_0 )
@@ -840,19 +844,19 @@ static BOOL HandleStuff(void)
                                break;
                                case recvfrom_req:
                                        if(sockreq.params.recvfrom_s.addr) {
-                                               sockreq.sb->resultval = recvfrom( sockreq.s, sockreq.params.recvfrom_s.realpt, sockreq.params.recvfrom_s.len,
+                                               sockreq.sb->resultval = recvfrom(sockreq.s, sockreq.params.recvfrom_s.realpt, sockreq.params.recvfrom_s.len,
                                                        sockreq.params.recvfrom_s.flags, sockreq.params.recvfrom_s.rp_addr,
-                                                       sockreq.params.recvfrom_s.hlen );
+                                                       sockreq.params.recvfrom_s.hlen);
 
                                        } else {
-                                               sockreq.sb->resultval = recv( sockreq.s, sockreq.params.recvfrom_s.realpt, sockreq.params.recvfrom_s.len,
-                                                       sockreq.params.recvfrom_s.flags );
+                                               sockreq.sb->resultval = recv(sockreq.s, sockreq.params.recvfrom_s.realpt, sockreq.params.recvfrom_s.len,
+                                                       sockreq.params.recvfrom_s.flags);
                                        }
                                break;
                                case abort_req:
                                        *(sockreq.params.abort_s.newsock) = socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
                                        if (*(sockreq.params.abort_s.newsock) != sb->sockAbort) {
-                                               shutdown( sb->sockAbort, 1 );
+                                               shutdown(sb->sockAbort, 1);
                                                closesocket(sb->sockAbort);
                                        }
                                        handled = FALSE; /* Don't bother the SETERRNO section after the switch() */
index 18fb4d3f334693f97ed6b6765a4cb0b99515bd2f..a09123675ff8978debbb6f12ba9523b82ecac323 100644 (file)
@@ -44,6 +44,7 @@ HRESULT RPInitializeGuest(RPGUESTINFO *pInfo, HINSTANCE hInstance, LPCTSTR pszHo
        _TCHAR szGuestClass[(sizeof(g_szGuestWndClass)/sizeof(_TCHAR))+20];
        _TCHAR *pszHostClass;
        LRESULT lr;
+       int n;
 
        if (!pInfo || !pszHostInfo)
                return E_POINTER;
index f2b5814836abdf92545cce2c542d7a607e154065..013b91d7c5e4405d06084d7b74fa7d3804c7b9b7 100644 (file)
 //    the guest sends this message when the mouse is captured/released
 //    (the mouse is "captured" when its movements are restricted to the guest window area
 //    and the system cursor is not visible);
+//    mouse capture changes requested by the host
+//    (see the RPIPCHM_MOUSECAPTURE message) must not be notified;
 //    for consistency across different guests, a guest which sends RPIPCGM_MOUSECAPTURE
-//    messages should also implement a keyboard-actuated mouse release functionality
+//    messages should also implement a keyboard-actuated escape functionality
 //    (the preferred key for this purpose is included in the parameters sent from the
 //    host at startup time - see RPLaunchGuest() in RetroPlatformPlugin.h);
 //    note that in order not to interfere with the window dragging functionality,
 //
 #define RPIPCGM_VOLUME (WM_APP + 19)
 
+// Message:
+//    RPIPCGM_ESCAPED
+// Description:
+//    this message is sent to notify the host
+//    that the escape key has been held down
+// Data sent:
+//    none
+// Response:
+//    none
+//
+#define RPIPCGM_ESCAPED        (WM_APP + 20)
 
 
 
 #define RPIPCHM_VOLUME (WM_APP + 209)
 
 // Message:
-//    RPIPCHM_RELEASEMOUSEKEY
+//    RPIPCHM_ESCAPEKEY
 // Description:
-//    the host uses the RPIPCHM_RELEASEMOUSEKEY message
-//    to change the release mouse key information
+//    the host uses the RPIPCHM_ESCAPEKEY message
+//    to change the escape key information
 // Data sent:
-//    WPARAM = VK_* identifier of the mouse-release key
-//             (e.g. "0x1B" for the Esc key - see VK_* constants in winuser.h)
+//    WPARAM = DirectInput DIK_* identifier of the escape key
+//             (e.g. 1 for the Esc key - see DIK_* constants in dinput.h)
 //    LPARAM = milliseconds value
-//             (amount of time the user has to hold the above key to release the mouse)
+//             (amount of time the user has to hold the above key to trigger the escape functionality)
 // Response:
 //    LRESULT = non-zero if the guest accepted the new settings
 //
-#define RPIPCHM_RELEASEMOUSEKEY        (WM_APP + 210)
+#define RPIPCHM_ESCAPEKEY      (WM_APP + 210)
 
 // Message:
 //    RPIPCHM_EVENT
 //
 #define RPIPCHM_EVENT  (WM_APP + 211)
 
+// Message:
+//    RPIPCHM_MOUSECAPTURE
+// Description:
+//    the host uses this message to ask the guest
+//    to capture or release the mouse
+// Data sent:
+//    WPARAM = non-zero if the mouse should be captured,
+//             zero if the mouse should be released
+// Response:
+//    LRESULT = non-zero if the guest executed the command
+//
+#define RPIPCHM_MOUSECAPTURE   (WM_APP + 212)
+
 
 
 // ****************************************************************************
index d10f482fe388be4387239cb28f367afd985ffe85..eaa70295a93e62484c6ae2a7add280ffcc3b1985 100644 (file)
@@ -1126,7 +1126,7 @@ static void read_mouse (void)
            continue;
        elements = DI_BUFFER;
        hr = IDirectInputDevice8_GetDeviceData (lpdi, sizeof (DIDEVICEOBJECTDATA), didod, &elements, 0);
-       if (hr == DI_OK) {
+       if (hr == DI_OK || hr == DI_BUFFEROVERFLOW) {
            if (supermouse && !did->superdevice)
                continue;
            for (j = 0; j < elements; j++) {
@@ -1264,16 +1264,16 @@ static void set_leds (uae_u32 led)
 {
     if (os_winnt && currprefs.win32_kbledmode) {
        if((oldusbleds & KBLED_NUMLOCK) != (led & KBLED_NUMLOCK)) {
-           keybd_event (VK_NUMLOCK, 0, KEYEVENTF_EXTENDEDKEY, 0);
-           keybd_event (VK_NUMLOCK, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
+           keybd_event (VK_NUMLOCK, 0x45, KEYEVENTF_EXTENDEDKEY, 0);
+           keybd_event (VK_NUMLOCK, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
        }
        if((oldusbleds & KBLED_CAPSLOCK) != (led & KBLED_CAPSLOCK)) {
-           keybd_event (VK_CAPITAL, 0, KEYEVENTF_EXTENDEDKEY, 0);
-           keybd_event (VK_CAPITAL, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
+           keybd_event (VK_CAPITAL, 0x3a, KEYEVENTF_EXTENDEDKEY, 0);
+           keybd_event (VK_CAPITAL, 0x3a, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
        }
        if((oldusbleds & KBLED_SCROLLLOCK) != (led & KBLED_SCROLLLOCK)) {
-           keybd_event (VK_SCROLL, 0, KEYEVENTF_EXTENDEDKEY, 0);
-           keybd_event (VK_SCROLL, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
+           keybd_event (VK_SCROLL, 0x46, KEYEVENTF_EXTENDEDKEY, 0);
+           keybd_event (VK_SCROLL, 0x46, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
        }
        oldusbleds = led;
     } else if (os_winnt && kbhandle != INVALID_HANDLE_VALUE) {
@@ -1530,8 +1530,8 @@ static int keyhack (int scancode,int pressed, int num)
            }
            else
            {
-           backslashstate=0;
-           return DIK_BACKSLASH;
+               backslashstate=0;
+               return DIK_BACKSLASH;
            }
        }
     }
@@ -1561,7 +1561,7 @@ static void read_kb (void)
        }
        elements = DI_KBBUFFER;
        hr = IDirectInputDevice8_GetDeviceData(lpdi, sizeof(DIDEVICEOBJECTDATA), didod, &elements, 0);
-       if (hr == DI_OK) {
+       if (hr == DI_OK || hr == DI_BUFFEROVERFLOW) {
            if (did->superdevice && (normalkb || rawkb))
                continue;
            for (j = 0; j < elements; j++) {
@@ -1593,11 +1593,11 @@ static void read_kb (void)
 
 void wait_keyrelease (void)
 {
-    int i, j, maxcount = 10, found;
     stopoutput++;
 
+#if 0
+    int i, j, maxcount = 10, found;
     while (maxcount-- > 0) {
-       sleep_millis (10);
        read_kb ();
        found = 0;
        for (j = 0; j < MAX_INPUT_DEVICES; j++) {
@@ -1608,7 +1608,9 @@ void wait_keyrelease (void)
        }
        if (!found)
            break;
+       sleep_millis (10);
     }
+#endif
     release_keys ();
 #if 0
     for (;;) {
@@ -1795,7 +1797,7 @@ static void read_joystick (void)
            continue;
        elements = DI_BUFFER;
        hr = IDirectInputDevice8_GetDeviceData (lpdi, sizeof (DIDEVICEOBJECTDATA), didod, &elements, 0);
-       if (hr == DI_OK) {
+       if (hr == DI_OK || hr == DI_BUFFEROVERFLOW) {
            for (j = 0; j < elements; j++) {
                int dimofs = didod[j].dwOfs;
                int data = didod[j].dwData;
index 87bcc2bc64ae4e9e22c4d610df6cf548a16b319c..eab8492acc18d45287042bfc5da4addeab685713 100644 (file)
@@ -383,7 +383,10 @@ const char *D3D_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth)
     window_h = w_h;
     tin_w = t_w;
     tin_h = t_h;
-    createtexture (t_w, t_h);
+    if (!createtexture (t_w, t_h)) {
+       sprintf (errmsg, "Direct3D: %d * %d texture creation failed.\n", t_w, t_h);
+       return  errmsg;
+    }
     if (currprefs.gfx_filter_scanlines > 0)
        createsltexture ();
     createscanlines (1);
index 91ccf728e6f9f52c945581069f98677bebabe4fa..cffc547e7431793dc8da02237f100d73f3510b61 100644 (file)
@@ -1269,11 +1269,11 @@ HRESULT DirectDraw_GetClipList(LPRGNDATA cliplist, LPDWORD size)
  *   1999.08.02  Brian King             Creation
  *
  */
-BYTE DirectDraw_GetBytesPerPixel(void)
+int DirectDraw_GetBytesPerPixel(void)
 {
-    int bpp;
-    bpp = (DirectDrawState.lockable.lpdesc->ddpfPixelFormat.dwRGBBitCount + 7) >> 3;
-    return bpp;
+    if(DirectDrawState.lockable.lpdesc)
+       return (DirectDrawState.lockable.lpdesc->ddpfPixelFormat.dwRGBBitCount + 7) >> 3;
+    return 0;
 }
 
 /*
index 4141774c15367fd10702392ef06e807f4b02fb6a..de3389844495f5bab4f0fc5a8dd02fc211c006de 100644 (file)
@@ -234,7 +234,7 @@ DWORD DirectDraw_GetSurfaceBitCount( void );
 DWORD DirectDraw_GetPrimaryBitCount( void );
 void DirectDraw_GetPrimaryWidthHeight(int *w, int *h);
 int DirectDraw_DetermineLocking( int wantfull );
-BYTE DirectDraw_GetBytesPerPixel( void );
+int DirectDraw_GetBytesPerPixel( void );
 RGBFTYPE DirectDraw_GetSurfacePixelFormat( LPDDSURFACEDESC2 surface );
 surface_type_e DirectDraw_GetLockableType( void );
 int DirectDraw_SurfaceLock( surface_type_e surface_type );
index 9f37850c936887d373a1cd4104c4eb89a9443d19..59669adbedac1248a66059935111a13f4d6bc3f2 100644 (file)
@@ -77,7 +77,7 @@ void init_shm(void)
     // Letting the system decide doesn't seem to work on some systems (Win9x..)
     LPBYTE address = (LPBYTE)0x10000000;
     uae_u32 size;
-    uae_u32 add = 0x11000000;
+    uae_u32 add = 0x10000000 + 128 * 1024 * 1024;
     uae_u32 inc = 0x100000;
     uae_u64 size64, total64;
     uae_u64 totalphys64;
@@ -116,6 +116,8 @@ void init_shm(void)
     if (size64 < 8 * 1024 * 1024)
        size64 = 8 * 1024 * 1024;
     size = max_z3fastmem = (uae_u32)size64;
+    if (size < 1024 * 1024 * 1024)
+       max_z3fastmem = 512 * 1024 * 1024;
 
     canbang = 0;
     shm_start = 0;
@@ -131,7 +133,7 @@ void init_shm(void)
        if (blah)
            break;
        write_log ("NATMEM: %dM area failed to allocate, err=%d\n", (size + add) >> 20, GetLastError());
-       size >>= 1;
+       size -= 128 * 1024 * 1024;
        if (size < 0x10000000) {
            write_log ("NATMEM: No special area could be allocated (2)!\n");
            return;
@@ -165,8 +167,10 @@ void init_shm(void)
        write_log ("NATMEM: No special area could be allocated! (1)\n");
     } else {
        max_z3fastmem = size;
-       write_log ("NATMEM: Our special area: 0x%p-0x%p (%dM)\n",
-           natmem_offset, (uae_u8*)natmem_offset + size + add, (size + add) >> 20);
+       write_log ("NATMEM: Our special area: 0x%p-0x%p (%08x %dM)\n",
+           natmem_offset, (uae_u8*)natmem_offset + size + add,
+           size + add,
+           (size + add) >> 20);
        canbang = 1;
        allocated = 1;
     }
@@ -346,6 +350,14 @@ void *shmat(int shmid, void *shmaddr, int shmflg)
            shmaddr=natmem_offset + 0x00e00000;
            got = TRUE;
        }
+       if(!strcmp(shmids[shmid].name,"custmem1")) {
+           shmaddr=natmem_offset + currprefs.custom_memory_addrs[0];
+           got = TRUE;
+       }
+       if(!strcmp(shmids[shmid].name,"custmem2")) {
+           shmaddr=natmem_offset + currprefs.custom_memory_addrs[1];
+           got = TRUE;
+       }
 }
 #endif
 
index de463258dc7cbc1d52ded575e1c8bcbaad7294e1..6cb5ab0d53403a997b46395ee2df579e52df753c 100644 (file)
@@ -26,8 +26,8 @@ static int initialized;
 static RPGUESTINFO guestinfo;
 
 char *rp_param = NULL;
-int rp_rmousevkey = 0x01;
-int rp_rmouseholdtime = 600;
+int rp_rpescapekey = 0x01;
+int rp_rpescapeholdtime = 600;
 int rp_screenmode = 0;
 int rp_inputmode = 0;
 int log_rp = 1;
@@ -84,6 +84,8 @@ static const char *getmsg (int msg)
        case RPIPCHM_INPUTMODE: return "RPIPCHM_INPUTMODE";
        case RPIPCHM_VOLUME: return "RPIPCHM_VOLUME";
        case RPIPCHM_EVENT: return "RPIPCHM_EVENT";
+       case RPIPCHM_ESCAPEKEY: return "RPIPCHM_ESCAPEKEY";
+       case RPIPCHM_MOUSECAPTURE: return "RPIPCHM_MOUSECAPTURE";
 
        default: return "UNKNOWN";
     }
@@ -125,6 +127,8 @@ static int get_x (void)
 {
     int res = currprefs.gfx_resolution;
 
+    if (currprefs.gfx_afullscreen)
+       return RP_SCREENMODE_FULLSCREEN;
     if (res == 0)
        return RP_SCREENMODE_1X;
     if (res == 1)
@@ -168,6 +172,16 @@ static LRESULT CALLBACK RPHostMsgFunction(UINT uMessage, WPARAM wParam, LPARAM l
            if (ShowWindow (hAmigaWnd, SW_MINIMIZE))
                return TRUE;
        break;
+       case RPIPCHM_ESCAPEKEY:
+           rp_rpescapekey = wParam;
+           rp_rpescapeholdtime = lParam;
+        return TRUE;
+       case RPIPCHM_MOUSECAPTURE:
+           if (wParam)
+               setmouseactive (1);
+           else
+               setmouseactive (0);
+       return TRUE;
        case RPIPCHM_DEVICEIMAGE:
        {
            RPDEVICEIMAGE *di = (RPDEVICEIMAGE*)pData;
@@ -195,6 +209,7 @@ static LRESULT CALLBACK RPHostMsgFunction(UINT uMessage, WPARAM wParam, LPARAM l
            res = 1 << res;
            changed_prefs.gfx_size_win.width = default_width * res;
            changed_prefs.gfx_size_win.height = default_height * res;
+           updatewinfsmode (&changed_prefs);
            WIN32GFX_DisplayChangeRequested();
            hwndset = 0;
            return (LRESULT)INVALID_HANDLE_VALUE;
@@ -252,8 +267,8 @@ void rp_fixup_options (struct uae_prefs *p)
 
     if (!initialized)
        return;
-    write_log ("rp_fixup_options(rmousevkey=%d,rmouseholdtime=%d,screenmode=%d,inputmode=%d)\n",
-       rp_rmousevkey, rp_rmouseholdtime, rp_screenmode, rp_inputmode);
+    write_log ("rp_fixup_options(rpescapekey=%d,rpescapeholdtime=%d,screenmode=%d,inputmode=%d)\n",
+       rp_rpescapekey, rp_rpescapeholdtime, rp_screenmode, rp_inputmode);
 
     res = 1 << currprefs.gfx_resolution;
     default_width = currprefs.gfx_size_win.width / res;
@@ -277,7 +292,7 @@ void rp_fixup_options (struct uae_prefs *p)
        p->gfx_linedbl = 1;
 
     RPSendMessagex(RPIPCGM_FEATURES,
-       RP_FEATURE_POWERLED | RP_FEATURE_SCREEN1X | RP_FEATURE_SCREEN2X |
+       RP_FEATURE_POWERLED | RP_FEATURE_SCREEN1X | RP_FEATURE_SCREEN2X | RP_FEATURE_FULLSCREEN |
        RP_FEATURE_PAUSE | RP_FEATURE_TURBO | RP_FEATURE_INPUTMODE | RP_FEATURE_VOLUME,
        0, NULL, 0, &guestinfo, NULL);
     /* floppy drives */
@@ -344,15 +359,14 @@ void rp_turbo (int active)
     RPSendMessagex(RPIPCGM_TURBO, RP_TURBO_CPU, active, NULL, 0, &guestinfo, NULL);
 }
 
-void rp_set_hwnd (void)
+void rp_set_hwnd (HWND hWnd)
 {
     int rx;
     if (!initialized)
        return;
     rx = get_x ();
     hwndset = 1;
-    RPSendMessagex(RPIPCGM_SCREENMODE, rx, (LPARAM)hAmigaWnd, NULL, 0, &guestinfo, NULL); 
-    rp_mousecapture (1);
+    RPSendMessagex(RPIPCGM_SCREENMODE, rx, (LPARAM)hWnd, NULL, 0, &guestinfo, NULL); 
 }
 
 void rp_moved (int zorder)
@@ -384,6 +398,8 @@ void rp_hsync (void)
     uae_u64 t;
     static int cnt;
 
+    if (!initialized)
+       return;
     cnt--;
     if (cnt > 0)
        return;
@@ -392,7 +408,7 @@ void rp_hsync (void)
        return;
     t = gett ();
     if (t >= esctime) {
-       setmouseactive (0);
+       RPSendMessagex(RPIPCGM_ESCAPED, 0, 0, NULL, 0, &guestinfo, NULL);
        ignorerelease = 1;
        esctime = 0;
     }
@@ -404,7 +420,7 @@ int rp_checkesc (int scancode, uae_u8 *codes, int pressed, int num)
 
     if (!initialized)
        goto end;
-    if (scancode != rp_rmousevkey)
+    if (scancode != rp_rpescapekey)
        goto end;
     if (ignorerelease && !pressed) {
        ignorerelease = 0;
@@ -414,7 +430,7 @@ int rp_checkesc (int scancode, uae_u8 *codes, int pressed, int num)
     if (!t)
        goto end;
     if (pressed) {
-       esctime = t + rp_rmouseholdtime;
+       esctime = t + rp_rpescapeholdtime;
        return 1;
     }
     my_kbd_handler (num, scancode, 1);
index 6c34bca1ab57012650634359ee91f8dc0ffdb019..c133f3c784bd3f3f7e7581258f49aa0867dd34ca 100644 (file)
@@ -8,14 +8,14 @@ extern void rp_activate (int, LPARAM);
 extern void rp_minimize (int);
 extern void rp_mousecapture (int);
 extern void rp_turbo (int);
-extern void rp_set_hwnd (void);
+extern void rp_set_hwnd (HWND);
 extern void rp_moved (int);
 extern int rp_checkesc (int, uae_u8*, int, int);
 extern int rp_isactive (void);
 extern void rp_hsync (void);
 
 extern char *rp_param;
-extern int rp_rmousevkey;
-extern int rp_rmouseholdtime;
+extern int rp_rpescapekey;
+extern int rp_rpescapeholdtime;
 extern int rp_screenmode;
 extern int rp_inputmode;
index 20dd096c27466502edbaefef2f65008109b68948..b43511bf2621d966ad8b793dbf022197ff5b9889 100644 (file)
@@ -474,16 +474,23 @@ static int open_sound (void)
 
 void close_sound (void)
 {
+    gui_data.sndbuf = 0;
+    gui_data.sndbuf_status = 3;
     if (! have_sound)
        return;
     pause_sound ();
     close_audio_ds ();
     have_sound = 0;
-    gui_data.sndbuf = 0;
 }
 
 int init_sound (void)
 {
+    gui_data.sndbuf_status = 3;
+    gui_data.sndbuf = 0;
+    if (!sound_available)
+       return 0;
+    if (currprefs.produce_sound <= 1)
+       return 0;
     if (have_sound)
        return 1;
     if (!open_sound ())
index d5ba4bac5d3ceadc7863c4170fff5cf6b5186270..c04904db37651a1fd623eae57e4caa8a1185e254 100644 (file)
@@ -74,7 +74,7 @@
 #endif
 
 extern int harddrive_dangerous, do_rdbdump, aspi_allow_all, no_rawinput;
-int log_scsi, log_net;
+int log_scsi, log_net = 1;
 
 extern FILE *debugfile;
 extern int console_logging;
@@ -902,6 +902,9 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam,
     return 0;
 
     case WM_CREATE:
+#ifdef RETROPLATFORM
+       rp_set_hwnd (hWnd);
+#endif
        DragAcceptFiles (hWnd, TRUE);
     return 0;
 
@@ -3034,14 +3037,14 @@ static int process_arg(char **xargv)
                rp_param = my_strdup (np);
                continue;
            }
-           if (!strcmp (arg, "-rprmousevkey")) {
+           if (!strcmp (arg, "-rpescapekey")) {
                i++;
-               rp_rmousevkey = getval (np);
+               rp_rpescapekey = getval (np);
                continue;
            }
-           if (!strcmp (arg, "-rprmouseholdtime")) {
+           if (!strcmp (arg, "-rpescapeholdtime")) {
                i++;
-               rp_rmouseholdtime = getval (np);
+               rp_rpescapeholdtime = getval (np);
                continue;
            }
            if (!strcmp (arg, "-rpscreenmode")) {
index ddcc47b1b2f1a3e79296f2e1df8aa01f59411e39..f9547582596a5f58f2197adb06948c89117c7786 100644 (file)
@@ -15,9 +15,9 @@
 #define GETBDM(x) (((x) - ((x / 10000) * 10000)) / 100)
 #define GETBDD(x) ((x) % 100)
 
-#define WINUAEBETA 15
+#define WINUAEBETA 16
 #define WINUAEPUBLICBETA 1
-#define WINUAEDATE MAKEBD(2007, 12, 2)
+#define WINUAEDATE MAKEBD(2007, 12, 12)
 #define WINUAEEXTRA ""
 #define WINUAEREV ""
 
index 12a5486ba92c8f90a8a6e00dbee4ccd9443c4660..21b4a8e07c95146fd0f13bf3684827cce8b463e4 100644 (file)
@@ -222,6 +222,9 @@ void S2X_render (void)
        pitch = DirectDraw_GetSurfacePitch ();
     }
 
+    if (!dptr) /* weird things can happen */
+       goto end;
+
     if (usedfilter->type == UAE_FILTER_SCALE2X ) { /* 16+32/2X */
 
        if (amiga_depth == 16 && dst_depth == 16) {
@@ -313,6 +316,7 @@ void S2X_render (void)
        changed_prefs.gfx_filter = usedfilter->type;
     }
 
+end:
     if (temp_needed) {
        IDirectDrawSurface7_Unlock (dds, NULL);
        DirectDraw_Blt (DirectDraw_GetLockableType(), &dr, temporary_surface, &sr, 0, NULL);
index 9d1ca219413f945188d11e41173163d82687bcc5..4a2f8db4f092573ed783d2d602ffde728114da4e 100644 (file)
@@ -8,22 +8,12 @@
 
 #include "sysconfig.h"
 
+#include <stdio.h>
+
 #define HAVE_REMOTE
 #define WPCAP
 #include "pcap.h"
 
-#include <winspool.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <mmsystem.h>
-#include <ddraw.h>
-#include <commctrl.h>
-#include <commdlg.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <io.h>
-#include <setupapi.h>
 #include <windows.h>
 
 #include "packet32.h"
@@ -32,7 +22,6 @@
 #include "sysdeps.h"
 #include "options.h"
 
-
 #include "threaddep/thread.h"
 #include "win32_uaenet.h"
 #include "win32.h"
index d6419021006091b4ad3c66cd06067124b05a0606..f09e76578b5ba023975e2a8cf06e22ebed03da43 100644 (file)
@@ -2096,9 +2096,6 @@ static int create_windows (void)
        UpdateWindow (hMainWnd);
     }
     ShowWindow (hAmigaWnd, SW_SHOWNORMAL);
-#ifdef RETROPLATFORM
-    rp_set_hwnd ();
-#endif
     UpdateWindow (hAmigaWnd);
     return 1;
 }
index 693caeb37fddb72efd3d82ea1f964d2f20e03e9b..eb57354a282dcac14910156442bd26f82c9dbc5e 100644 (file)
@@ -486,9 +486,12 @@ static int addrom (UAEREG *fkey, struct romdata *rd, char *name)
 
 static int isromext(char *path)
 {
-    char *ext = strrchr (path, '.');
+    char *ext;
     int i;
 
+    if (!path)
+       return 0;
+    ext = strrchr (path, '.');
     if (!ext)
        return 0;
     ext++;
@@ -2705,7 +2708,7 @@ static urlinfo urls[] =
     {IDC_THEROOTS, FALSE, "Back To The Roots", "http://www.back2roots.org/"},
     {IDC_ABIME, FALSE, "abime.net", "http://www.abime.net/"},
     {IDC_CAPS, FALSE, "SPS", "http://www.softpres.org/"},
-    {IDC_AMIGASYS, FALSE, "AmigaSYS", "http://amigasys.fw.hu/"},
+    {IDC_AMIGASYS, FALSE, "AmigaSYS", "http://amigasys.extra.hu/"},
     {IDC_AMIKIT, FALSE, "AmiKit", "http://amikit.amiga.sk/"},
     { -1, FALSE, NULL, NULL }
 };
@@ -8118,7 +8121,7 @@ static void init_inputdlg( HWND hDlg )
        sprintf (buf, "%d", i + 1);
        SendDlgItemMessage (hDlg, IDC_INPUTAMIGACNT, CB_ADDSTRING, 0, (LPARAM)buf);
     }
-    SendDlgItemMessage( hDlg, IDC_INPUTAMIGACNT, CB_SETCURSEL, input_selected_sub_num, 0 );
+    SendDlgItemMessage (hDlg, IDC_INPUTAMIGACNT, CB_SETCURSEL, input_selected_sub_num, 0);
 
     SendDlgItemMessage (hDlg, IDC_INPUTDEVICE, CB_RESETCONTENT, 0, 0L);
     for (i = 0; i < inputdevice_get_device_total (IDTYPE_JOYSTICK); i++) {
@@ -8143,7 +8146,7 @@ static void enable_for_inputdlg (HWND hDlg)
     int v = workprefs.input_selected_setting == 0 ? FALSE : TRUE;
     ew (hDlg, IDC_INPUTLIST, TRUE);
     ew (hDlg, IDC_INPUTAMIGA, v);
-    ew (hDlg, IDC_INPUTAMIGACNT, v);
+    ew (hDlg, IDC_INPUTAMIGACNT, TRUE);
     ew (hDlg, IDC_INPUTDEADZONE, TRUE);
     ew (hDlg, IDC_INPUTAUTOFIRERATE, v);
     ew (hDlg, IDC_INPUTSPEEDA, v);
index c6f7e4406f9b3c8929c28cf17f49120714b39931..9dc06e9c299be7058ce50b3b97916685cdafe2af 100644 (file)
@@ -1,4 +1,18 @@
 
+Beta 16:
+
+- added 2 non-autoconfig ram configuration entries
+  addmem1/addmem2=<address>,<size>
+  Adds fast ram to specified address without autoconfiguring it. Size
+  must be power of 2 and min size is 64k. GUI support in future.
+- uaenet.device unit number >0 abortio fixed
+- 512M Z3Fast and 128M RTG RAM now works without overflowing allocated
+  JIT direct access memory (no garbage gfx modes in display prefs)
+- map extended ROM location depending on advanced chipset CDTV/CD32
+  settings (previously 256k = 0xF0, 512k = 0xE0)
+- Direct3D CreateTexture() return code was ignored, crashed if texture
+  creation failed for some reason (out of video memory?)
+
 Beta 15:
 
 - fullscreen switching should work correctly again
diff --git a/sana2.c b/sana2.c
index 270682944f819663a3c6199fecfa0d09c232e66e..36349e0fec537d02efb685b6243c27fdecee3157 100644 (file)
--- a/sana2.c
+++ b/sana2.c
@@ -366,6 +366,7 @@ static uae_u32 REGPARAM2 dev_open_2 (TrapContext *context)
 
     dev->opencnt = get_word (m68k_areg (&context->regs, 6) + 32);
     if (dev->opencnt == 0) {
+       dev->unit = unit;
        dev->sysdata = xcalloc (uaenet_getdatalenght(), 1);
        if (!uaenet_open (dev->sysdata, pdev->td, dev, pdev->promiscuous)) {
            xfree (dev->sysdata);
@@ -588,7 +589,7 @@ static void abort_async (struct devstruct *dev, uaecptr request)
 {
     struct asyncreq *ar = get_async_request (dev, request, 1);
     if (!ar) {
-       write_log ("%s:%d: abort sync but no request %x found!\n", getdevname(), dev->unit, request);
+       write_log ("%s:%d: abort async but no request %x found!\n", getdevname(), dev->unit, request);
        return;
     }
     if (log_net)
@@ -1119,10 +1120,12 @@ static int dev_do_io (struct devstruct *dev, uaecptr request, int quick)
        break;
 
        case S2_ONLINE:
+#if 0
            if (!dev->configured) {
                io_error = S2ERR_BAD_STATE;
                wire_error = S2WERR_NOT_CONFIGURED;
            }
+#endif
            if (!dev->adapter) {
                io_error = S2ERR_OUTOFSERVICE;
                wire_error = S2WERR_RCVREL_HDW_ERR;
@@ -1333,13 +1336,22 @@ static uae_u32 REGPARAM2 dev_init (TrapContext *context)
 static uae_u32 REGPARAM2 dev_abortio (TrapContext *context)
 {
     uae_u32 request = m68k_areg (&context->regs, 1);
-    struct devstruct *dev = getdevstruct (get_long (request + 24));
+    struct priv_devstruct *pdev = getpdevstruct (request);
+    struct devstruct *dev;
 
-    write_log ("%s abortio %08x\n", getdevname(), request);
+    if (!pdev) {
+       write_log ("%s abortio but no request %08x found!\n", getdevname(), request);
+       put_byte (request + 31, 32);
+       return get_byte (request + 31);
+    }
+    dev = getdevstruct (pdev->unit);
     if (!dev) {
+       write_log ("%s (%d) abortio but no request %08x found!\n", getdevname(), pdev->unit, request);
        put_byte (request + 31, 32);
        return get_byte (request + 31);
     }
+    if (log_net)
+       write_log ("%s:%d abortio %08x\n", getdevname(), dev->unit, request);
     abort_async (dev, request);
     return 0;
 }
index 9fa86cac031413f033603311d8e1cfded17bc8c1..9dba05ec11a0464c226683ccbd08e7694d5fb990 100644 (file)
@@ -390,7 +390,7 @@ static void abort_async (struct devstruct *dev, uaecptr request)
 {
     struct asyncreq *ar = get_async_request (dev, request, 1);
     if (!ar) {
-       write_log ("%s:%d: abort sync but no request %x found!\n", getdevname(), dev->unit, request);
+       write_log ("%s:%d: abort async but no request %x found!\n", getdevname(), dev->unit, request);
        return;
     }
     if (log_uaeserial)
index fe66df3034b603b2c36bc94b01e3152db0ae4c3d..f3e1e9d98980d9548a9e3217bc678d7f6c6f8f57 100644 (file)
@@ -623,13 +623,13 @@ static void arcacc_free (void)
     arcacc_mod = NULL;
 }
 
-static int arcacc_init (void)
+static int arcacc_init (struct zfile *zf)
 {
     if (arcacc_mod)
        return 1;
     arcacc_mod = WIN32_LoadLibrary ("archiveaccess.dll");
     if (!arcacc_mod) {
-       write_log ("failed to open archiveaccess.dll\n");
+       write_log ("failed to open archiveaccess.dll ('%s')\n", zfile_getname (zf));
        return 0;
     }
     aaOpenArchive = (aapOpenArchive) GetProcAddress (arcacc_mod, "aaOpenArchive");
@@ -695,7 +695,7 @@ struct zvolume *archive_directory_arcacc (struct zfile *z, unsigned int id)
     struct zvolume *zv;
     int skipsize = 0;
 
-    if (!arcacc_init ())
+    if (!arcacc_init (z))
        return NULL;
     zv = zvolume_alloc(z, id, NULL);
     id_r = arcacc_push (z);