]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
imported winuaesrc0992b5.zip
authorToni Wilen <twilen@winuae.net>
Sat, 6 Nov 2004 17:58:19 +0000 (19:58 +0200)
committerToni Wilen <twilen@winuae.net>
Mon, 22 Feb 2010 19:24:35 +0000 (21:24 +0200)
21 files changed:
cfgfile.c
cia.c
disk.c
drawing.c
driveclick.c
filesys.c
include/options.h
inputdevice.c
keybuf.c
od-win32/dinput.c
od-win32/keyboard_win32.c
od-win32/parser.c
od-win32/parser.h
od-win32/resources/resource.h
od-win32/resources/winuae.rc
od-win32/resources/xarcade-winuae.bmp [new file with mode: 0755]
od-win32/win32.c
od-win32/win32.h
od-win32/win32gfx.c
od-win32/win32gui.c
od-win32/winuae_msvc/winuae_msvc.vcproj

index 8366bc9906d09e6069d75a2d21d08157318f414d..479e3f749d959a198938e81db6ee941828010f4c 100755 (executable)
--- a/cfgfile.c
+++ b/cfgfile.c
@@ -1774,6 +1774,82 @@ void cfgfile_addcfgparam (char *line)
     temp_lines = u;
 }
 
+static int getconfigstoreline (struct zfile *z, char *option, char *value)
+{
+    char tmp[CONFIG_BLEN * 2];
+    int idx = 0;
+
+    for (;;) {
+       uae_u8 b = 0;
+       if (zfile_fread (&b, 1, 1, z) != 1)
+           return 0;
+       tmp[idx++] = b;
+       tmp[idx] = 0;
+       if (b == '\n')
+           break;
+    }
+    return separate_line (tmp, option, value);
+}
+       
+
+int cfgfile_handle_custom_event (char *custom, int mode)
+{
+    char option[CONFIG_BLEN], value[CONFIG_BLEN];
+    char option2[CONFIG_BLEN], value2[CONFIG_BLEN];
+    char *tmp, *p, *nextp;
+    struct zfile *configstore = NULL;
+    int cnt = 0, cnt_ok = 0;
+
+    if (!mode) {
+       uae_u8 zero = 0;
+       configstore = zfile_fopen_empty ("configstore", 50000);
+       save_options (configstore, &currprefs, 0);
+       zfile_fwrite (&zero, 1, 1, configstore);
+    }
+
+    nextp = NULL;
+    tmp = p = xcalloc (strlen (custom) + 2, 1);
+    strcpy (tmp, custom);
+    while (p && *p) {
+       if (*p == '\"') {
+           char *p2;
+           p++;
+           p2 = p;
+           while (*p2 != '\"' && *p2 != 0)
+               p2++;
+           if (*p2 == '\"') {
+               *p2++ = 0;
+               nextp = p2 + 1;
+               if (*nextp == ' ')
+                   nextp++;
+           }
+       }
+       if (separate_line (p, option, value)) {
+           cnt++;
+           if (mode) {
+               cfgfile_parse_option (&changed_prefs, option, value, 0);
+           } else {
+               zfile_fseek (configstore, 0, SEEK_SET);
+               for (;;) {
+                   if (!getconfigstoreline (configstore, option2, value2))
+                       break;
+                   if (!strcmpi (option, option2) && !strcmpi (value, value2)) {
+                       cnt_ok++;
+                       break;
+                   }
+               }   
+           }
+       }       
+       p = nextp;
+    }
+    xfree (tmp);
+    zfile_fclose (configstore);
+    if (cnt > 0 && cnt == cnt_ok)
+       return 1;
+    return 0;
+}
+
+
 int cmdlineparser (char *s, char *outp[], int max)
 {
     int j, cnt = 0;
@@ -2094,6 +2170,10 @@ void default_prefs (struct uae_prefs *p, int type)
     p->serial_demand = 0;
     p->serial_hwctsrts = 1;
     p->parallel_demand = 0;
+    p->parallel_postscript_emulation = 0;
+    p->parallel_postscript_detection = 0;
+    p->parallel_autoflush_time = 5;
+    p->ghostscript_parameters[0] = 0;
 
     p->jport0 = JSEM_MICE;
     p->jport1 = JSEM_KBDLAYOUT;
diff --git a/cia.c b/cia.c
index fdce3d83edb8f3c81876af477d67e1300f1b943d..cf1cd574e01a30bf0b0e3cf9e4f67e3660f4ae5e 100755 (executable)
--- a/cia.c
+++ b/cia.c
@@ -678,11 +678,10 @@ static void WriteCIAA (uae_u16 addr,uae_u8 val)
 #ifdef PARALLEL_PORT
        if (isprinter() > 0) {
            doprinter (val);
-           ciaaicr |= 0x10;
        } else if (isprinter() < 0) {
            parallel_direct_write_data (val, ciaadrb);
-           ciaaicr |= 0x10;
        }
+       cia_parallelack ();
 #endif
        break;
     case 2:
diff --git a/disk.c b/disk.c
index 2624ebf7be55952416cd713de54ab8c1f2fac2c9..ec079d740535a8879b83e484c111919d5d1cb3a2 100755 (executable)
--- a/disk.c
+++ b/disk.c
@@ -75,7 +75,7 @@
  * L   track length in bits
  */
 
-static int side, direction, writing;
+static int side, direction;
 static uae_u8 selected = 15, disabled;
 
 static uae_u8 writebuffer[544 * 11 * DDHDMULT];
@@ -572,22 +572,20 @@ static void reset_drive(int i)
 static void update_drive_gui (int num)
 {
     drive *drv = floppy + num;
+    int writ = dskdmaen == 3 && drv->state ? 1 : 0;
 
     if (drv->state == gui_data.drive_motor[num]
        && drv->cyl == gui_data.drive_track[num]
        && side == gui_data.drive_side
        && drv->crc32 == gui_data.crc32[num]
-       && ((writing && gui_data.drive_writing[num])
-           || (!writing && !gui_data.drive_writing[num]))) {
+       && writ == gui_data.drive_writing[num])
        return;
-    }
     strcpy (gui_data.df[num], currprefs.df[num]);
     gui_data.crc32[num] = drv->crc32;
     gui_data.drive_motor[num] = drv->state;
     gui_data.drive_track[num] = drv->cyl;
     gui_data.drive_side = side;
-    if (!gui_data.drive_writing[num])
-       gui_data.drive_writing[num] = writing;
+    gui_data.drive_writing[num] = writ;
     gui_ledstate &= ~(2 << num);
     if (drv->state)
        gui_ledstate |= 2 << num;
@@ -2010,7 +2008,13 @@ static void disk_dmafinished (void)
     INTREQ (0x8002);
     dskdmaen = 0;
 #ifdef DISK_DEBUG
-    write_dlog("disk dma finished %08.8X\n", dskpt);
+    {
+       int dr, mfmpos = -1;
+        write_dlog("disk dma finished %08.8X MFMpos=", dskpt);
+       for (dr = 0; dr < MAX_FLOPPY_DRIVES; dr++)
+           write_log ("%d%s", floppy[dr].mfmpos, dr < MAX_FLOPPY_DRIVES - 1 ? "," : "");
+       write_log ("\n");
+    }
 #endif
 }    
 
@@ -2161,7 +2165,7 @@ static void disk_doupdate_predict (drive * drv, int startcycle)
        if (mfmpos == drv->indexoffset) {
            diskevent_flag |= DISK_INDEXSYNC;
            indexhack = 0;
-       }   
+       }
        if (dskdmaen != 3 && mfmpos == drv->skipoffset) {
             int skipcnt = disk_jitter;
            while (skipcnt-- > 0) {
@@ -2332,6 +2336,7 @@ static void DISK_start (void)
            if (dskdmaen == 3) {
                drv->tracklen = FLOPPY_WRITE_LEN * drv->ddhd * 8 * 2;
                drv->trackspeed = get_floppy_speed ();
+               drv->skipoffset = -1;
                updatemfmpos (drv);
            }
            /* Ugh.  A nasty hack.  Assume ADF_EXT1 tracks are always read
@@ -2454,17 +2459,22 @@ void DSKLEN (uae_u16 v, int hpos)
        if ((selected & (1 << dr)) == 0)
            break;
     }
-    if (dr == 4)
+    if (dr == 4) {
         write_log ("disk %s DMA started but no drive selected!\n",
               dskdmaen == 3 ? "write" : "read");
-    else
+    } else {
         write_log ("disk %s DMA started, drv=%x track %d mfmpos %d\n",
            dskdmaen == 3 ? "write" : "read", selected ^ 15,
            floppy[dr].cyl * 2 + side, floppy[dr].mfmpos);
+       update_drive_gui (dr);
+    }
     write_dlog ("LEN=%04.4X (%d) SYNC=%04.4X PT=%08.8X ADKCON=%04.4X PC=%08.8X\n", 
        dsklength, dsklength, (adkcon & 0x400) ? dsksync : 0xffff, dskpt, adkcon, m68k_getpc());
 #endif
 
+    for (dr = 0; dr < MAX_FLOPPY_DRIVES; dr++)
+       update_drive_gui (dr);
+
     /* Try to make floppy access from Kickstart faster.  */
     if (dskdmaen != 2 && dskdmaen != 3)
        return;
index 8272c96c1584daa9ac0e9e9e5ce0cd2b84bc40eb..e11600a34c64ee4e7d774c8479f93f599a234bd8 100755 (executable)
--- a/drawing.c
+++ b/drawing.c
@@ -1749,17 +1749,20 @@ static void draw_status_line (int line)
     for (led = 0; led < NUM_LEDS; led++) {
        int side, pos, num1 = -1, num2 = -1, num3 = -1, num4 = -1, x, off_rgb, on_rgb, c, on = 0;
        if (led >= 1 && led <= 4) {
-           int track = gui_data.drive_track[led-1];
-           pos = 5 + (led - 1);
-           if (!gui_data.drive_disabled[led - 1]) {
+           int pled = led - 1;
+           int track = gui_data.drive_track[pled];
+           pos = 5 + pled;
+           on_rgb = 0x0c0;
+           off_rgb = 0x030;
+           if (!gui_data.drive_disabled[pled]) {
                num1 = -1;
                num2 = track / 10;
                num3 = track % 10;
-               on = gui_data.drive_motor[led-1];
+               on = gui_data.drive_motor[pled];
+               if (gui_data.drive_writing[pled])
+                   on_rgb = 0xc00;
            }
            side = gui_data.drive_side;
-           on_rgb = 0x0c0;
-           off_rgb = 0x030;
        } else if (led == 0) {
            pos = 2;
            on = gui_data.powerled;
@@ -1776,7 +1779,7 @@ static void draw_status_line (int line)
        } else if (led == 6) {
            pos = 3;
            on = gui_data.hd;
-           on_rgb = 0x00c;
+           on_rgb = on == 2 ? 0xc00 : 0x00c;
            off_rgb = 0x003;
            num1 = -1;
            num2 = 11;
index 9ac446a45c268ea7db588204e5d35c4d6b76d1ae..972987cf7670f3f48728faa88f1685ec93769ce7 100755 (executable)
@@ -149,10 +149,8 @@ void driveclick_init(void)
                v = 0;
                if (driveclick_loadresource (drvs[i], currprefs.dfxclick[i]))
                    v = 3;
-               for (j = 0; j < CLICK_TRACKS; j++)  {
-                   drvs[i][DS_CLICK].indexes[j] = 0;
-                   drvs[i][DS_CLICK].lengths[j] = drvs[i][DS_CLICK].len >> DS_SHIFT;
-               }
+               for (j = 0; j < CLICK_TRACKS; j++)
+                   drvs[i][DS_CLICK].lengths[j] = drvs[i][DS_CLICK].len;
            } else if (currprefs.dfxclick[i] == -1) {
                sprintf (tmp, "%suae_data%cdrive_click_%s", start_path, FSDB_DIR_SEPARATOR, currprefs.dfxclickexternal[i]);
                v = loadsample (tmp, &drvs[i][DS_CLICK]);
index da73ebf2608a26781eb0cfc009a03c6bdfd6e8ca..7397cd1aab731a498279046ee50c7119145e0ebb 100755 (executable)
--- a/filesys.c
+++ b/filesys.c
@@ -2470,7 +2470,7 @@ action_write (Unit *unit, dpacket packet)
        return;
     }
 
-    gui_hd_led (1);
+    gui_hd_led (2);
     TRACE(("ACTION_WRITE(%s,0x%lx,%ld)\n",k->aino->nname,addr,size));
 
     if (unit->ui.readonly) {
@@ -2583,7 +2583,7 @@ action_set_protect (Unit *unit, dpacket packet)
        PUT_PCK_RES1 (packet, DOS_TRUE);
     }
     notify_check (unit, a);
-    gui_hd_led (1);
+    gui_hd_led (2);
 }
 
 static void action_set_comment (Unit * unit, dpacket packet)
@@ -2626,7 +2626,7 @@ static void action_set_comment (Unit * unit, dpacket packet)
     a->comment = commented;
     fsdb_set_file_attrs (a);
     notify_check (unit, a);
-    gui_hd_led (1);
+    gui_hd_led (2);
 }
 
 static void
@@ -2812,7 +2812,7 @@ action_create_dir (Unit *unit, dpacket packet)
     notify_check (unit, aino);
     updatedirtime (aino, 0);
     PUT_PCK_RES1 (packet, make_lock (unit, aino->uniq, -2) >> 2);
-    gui_hd_led (1);
+    gui_hd_led (2);
 }
 
 static void
@@ -2950,7 +2950,7 @@ action_delete_object (Unit *unit, dpacket packet)
        delete_aino (unit, a);
     }
     PUT_PCK_RES1 (packet, DOS_TRUE);
-    gui_hd_led (1);
+    gui_hd_led (2);
 }
 
 static void
@@ -2982,7 +2982,7 @@ action_set_date (Unit *unit, dpacket packet)
     } else
        PUT_PCK_RES1 (packet, DOS_TRUE);
     notify_check (unit, a);
-    gui_hd_led (1);
+    gui_hd_led (2);
 }
 
 static void
@@ -3115,7 +3115,7 @@ action_rename_object (Unit *unit, dpacket packet)
     if (a2->elock > 0 || a2->shlock > 0 || wehavekeys > 0)
        de_recycle_aino (unit, a2);
     PUT_PCK_RES1 (packet, DOS_TRUE);
-    gui_hd_led (1);
+    gui_hd_led (2);
 }
 
 static void
index a26e7f91cb6e93d0e4c9e3ae11645cd586c10a20..93a864111b9448afbf7c6f57debc5312aeb4a007 100755 (executable)
@@ -272,6 +272,7 @@ extern uae_u32 cfgfile_uaelib_modify (uae_u32 mode, uae_u32 parms, uae_u32 size,
 extern void cfgfile_addcfgparam (char *);
 extern int build_in_prefs (struct uae_prefs *p, int model, int config, int compa, int romcheck);
 extern int cmdlineparser (char *s, char *outp[], int max);
+extern int cfgfile_handle_custom_event (char *custom, int mode);
 
 extern void fixup_prefs_dimensions (struct uae_prefs *prefs);
 extern void fixup_prefs (struct uae_prefs *prefs);
index 906568551780fb3cd2afa2f88d3683646888f264..bf68ab28418bfda4e5f848cbe9fe6e31b8c27c44 100755 (executable)
@@ -197,7 +197,7 @@ static void write_config2 (struct zfile *f, int idnum, int i, int offset, char *
            *p = 0;
        }
        if (custom)
-           sprintf (p, "\"%s\".%d", custom, id->flags[i + offset][j]);
+           sprintf (p, "'%s'.%d", custom, id->flags[i + offset][j]);
        else if (event <= 0)
            sprintf (p, "NULL");
        else
@@ -280,7 +280,7 @@ static void write_kbr_config (struct zfile *f, int idnum, int devnum, struct uae
                *p = 0;
            }
            if (custom)
-               sprintf (p, "\"%s\".%d", custom, kbr->flags[i][j]);
+               sprintf (p, "'%s'.%d", custom, kbr->flags[i][j]);
            else if (event > 0)
                sprintf (p, "%s.%d", events[event].confname, kbr->flags[i][j]);
            else
@@ -329,7 +329,7 @@ static int getnum (char **pp)
 static char *getstring (char **pp)
 {
     int i;
-    static char str[100];
+    static char str[1000];
     char *p = *pp;
 
     if (*p == 0)
@@ -467,7 +467,7 @@ void read_inputdevice_config (struct uae_prefs *pr, char *option, char *value)
        ie = &events[i];
        if (!ie->name) {
            ie = &events[0];
-           if (strlen (p2) > 2 && p2[0] == '"' && p2[strlen (p2) - 1] == '"') {
+           if (strlen (p2) > 2 && p2[0] == '\'' && p2[strlen (p2) - 1] == '\'') {
                custom = my_strdup (p2 + 1);
                custom[strlen (custom) - 1] = 0;
            }
@@ -1118,6 +1118,8 @@ static void queue_input_event (int event, int state, int max, int framecnt, int
     struct input_queue_struct *iq;
     int i = check_input_queue (event);
 
+    if (event <= 0)
+       return;
     if (state < 0 && i >= 0) {
         iq = &input_queue[i];
        iq->nextframecnt = -1;
@@ -1305,13 +1307,14 @@ void handle_input_event (int nr, int state, int max, int autofire)
     struct inputevent *ie;
     int joy;
     
-    if (nr <= 0) return;
+    if (nr <= 0)
+       return;
     ie = &events[nr];
     //write_log("'%s' %d %d\n", ie->name, state, max);
     if (autofire) {
        if (state)
            queue_input_event (nr, state, max, currprefs.input_autofire_framecnt, 1);
-           else
+       else
            queue_input_event (nr, -1, 0, 0, 1);
     }
     switch (ie->unit)
@@ -1455,12 +1458,14 @@ static void setbuttonstateall (struct uae_input_device *id, struct uae_input_dev
     uae_u32 mask = 1 << button;
     uae_u32 omask = id2->buttonmask & mask;
     uae_u32 nmask = (state ? 1 : 0) << button;
+    char *custom;
     
     if (button >= ID_BUTTON_TOTAL)
        return;
     for (i = 0; i < MAX_INPUT_SUB_EVENT; i++) {
        event = id->eventid[ID_BUTTON_OFFSET + button][sublevdir[state <= 0 ? 1 : 0][i]];
-       if (event <= 0)
+       custom = id->custom[ID_BUTTON_OFFSET + button][sublevdir[state <= 0 ? 1 : 0][i]];
+       if (event <= 0 && custom == NULL)
            continue;
        autofire = (id->flags[ID_BUTTON_OFFSET + button][sublevdir[state <= 0 ? 1 : 0][i]] & ID_FLAG_AUTOFIRE) ? 1 : 0;
        if (state < 0) {
@@ -1838,6 +1843,7 @@ int inputdevice_translatekeycode (int keyboard, int scancode, int state)
            for (k = 0; k < MAX_INPUT_SUB_EVENT; k++) {/* send key release events in reverse order */
                int autofire = (na->flags[j][sublevdir[state == 0 ? 1 : 0][k]] & ID_FLAG_AUTOFIRE) ? 1 : 0;
                int event = na->eventid[j][sublevdir[state == 0 ? 1 : 0][k]];
+               char *custom = na->custom[j][sublevdir[state == 0 ? 1 : 0][k]];
                handle_input_event (event, state, 1, autofire);
                //write_log ("'%s' %d ('%s') %d\n", na->name, event, events[event].name,  state);
            }
@@ -2345,7 +2351,8 @@ void setjoystickstate (int joy, int axis, int state, int max)
     if (v1 == v2)
        return;
     for (i = 0; i < MAX_INPUT_SUB_EVENT; i++)
-       handle_input_event (id->eventid[ID_AXIS_OFFSET + axis][i], state, max, id->flags[ID_AXIS_OFFSET + axis][i]);
+       handle_input_event (id->eventid[ID_AXIS_OFFSET + axis][i], state, max,
+       id->flags[ID_AXIS_OFFSET + axis][i]);
     id2->states[axis] = state;
 }
 
index b3483d1f9ccdd23b740330cf11349f99e5dc4a7b..5388bcce7e2cf6f23a6f484517b78751d97d8d24 100755 (executable)
--- a/keybuf.c
+++ b/keybuf.c
@@ -114,8 +114,8 @@ void record_key (int kc)
        case AK_NP4: fs = 1; fs_xa1[1] = b; break;
        case AK_NP6: fs = 1; fs_xa1[2] = b; break;
        case AK_NP2: fs = 1; fs_xa1[3] = b; break;
-       case AK_RCTRL: fs = 1; fs_xa1[4] = b; break;
-       case AK_RALT: fs = 1; fs_xa1[5] = b; break;
+       case AK_CTRL: fs = 1; fs_xa1[4] = b; break;
+       case AK_LALT: fs = 1; fs_xa1[5] = b; break;
        case AK_SPC: fs = 1; fs_xa1[6] = b; break;
        }
     }
@@ -144,18 +144,28 @@ void record_key (int kc)
        }
        if (fs_xa1 || fs_xa2) {
            int k2 = k;
+           if (k == AK_1)
+               k2 = AK_F1;
+           if (k == AK_2)
+               k2 = AK_F2;
            if (k == AK_3)
                k2 = AK_LALT;
            if (k == AK_4)
                k2 = AK_RALT;
            if (k == AK_6)
                k2 = AK_DN;
-           if (k == AK_1)
-               k2 = AK_F1;
-           if (k == AK_2)
-               k2 = AK_F2;
-           if (k == AK_X || k == AK_LBRACKET)
+           if (k == AK_LBRACKET || k == AK_LSH)
                k2 = AK_SPC;
+           if (k == AK_RBRACKET)
+               k2 = AK_RET;
+           if (k == AK_C)
+               k2 = AK_1;
+           if (k == AK_5)
+               k2 = AK_2;
+           if (k == AK_Z)
+               k2 = AK_3;
+           if (k == AK_X)
+               k2 = AK_4;
            if (k != k2)
                kc = (k2 << 1) | (b ? 0 : 1);
        }
index 0534d6287a7aa522516eca6d62d1becd868ff82b..50ce2b0691fb2838c7fc924de1c8a24ad2ba6f80 100755 (executable)
@@ -535,7 +535,7 @@ static void sortobjects (struct didata *did, int *mappings, int *sort, char **na
     if (num > 0) {
        write_log ("%s (GUID=%s):\n", did->name, outGUID (&did->guid));
        for (i = 0; i < num; i++)
-           write_log ("%d '%s' (%d,%d)\n", mappings[i], names[i], sort[i], types ? types[i] : -1);
+           write_log ("%02.2X %0.03d '%s' (%d,%d)\n", mappings[i], mappings[i], names[i], sort[i], types ? types[i] : -1);
     }
 #endif
 }
index 2b62ff74f0b11a102438e2bf5657d52457dd4f9e..5683ef0667a56adea2f77929385e638f0960a2b7 100755 (executable)
@@ -244,7 +244,7 @@ static int handlecd32 (int scancode, int state)
     }
     if (!e)
        return 0;
-    handle_input_event (e, state, 1, 0);
+    handle_input_event (e, state, 1, 0, NULL);
     return 1;
 }
 #endif
index 4aaf06e980cec61a94d0ae0e63d3e04bd971bb20..db12f248dc53b954e5a895943e3f578640fe7637 100755 (executable)
@@ -218,14 +218,14 @@ static void flushprtbuf (void)
        prtbufbytes = 0;
        return;
     } else if (hPrt != INVALID_HANDLE_VALUE) {
-       if( WritePrinter( hPrt, prtbuf, prtbufbytes, &written ) ) {
-           if( written != prtbufbytes )
-               write_log( "PRINTER: Only wrote %d of %d bytes!\n", written, prtbufbytes );
+       if (WritePrinter(hPrt, prtbuf, prtbufbytes, &written)) {
+           if (written != prtbufbytes)
+               write_log("PRINTER: Only wrote %d of %d bytes!\n", written, prtbufbytes);
        } else {
-           write_log( "PRINTER: Couldn't write data!\n" );
+           write_log("PRINTER: Couldn't write data!\n");
        }
     } else {
-       write_log( "PRINTER: Not open!\n" );
+       write_log("PRINTER: Not open!\n");
     }
     prtbufbytes = 0;
 }
@@ -401,7 +401,8 @@ void openprinter( void )
        prtopen = 1;
        return;
     } else if (hPrt == INVALID_HANDLE_VALUE) {
-       if( OpenPrinter(currprefs.prtname, &hPrt, NULL ) ) {
+       flushprtbuf ();
+       if (OpenPrinter(currprefs.prtname, &hPrt, NULL)) {
            // Fill in the structure with info about this "document."
            DocInfo.pDocName = "My Document";
            DocInfo.pOutputFile = NULL;
index cee1bf6be1216bcb39c18a22f4ce8eb9721eda08..867187fcafbcdedfcc072f1daaa05cec422f9240 100755 (executable)
@@ -7,7 +7,7 @@
  * Copyright 1998-1999 Brian King
  */
 
-#define PRTBUFSIZE 4096
+#define PRTBUFSIZE 65536
 
 int setbaud (long baud );
 void getserstat(int *status);
index 4cefdb032d6581cd29112273a291d72eed8fef70..9873e3039cc7598368716bd21a654005e08244b0 100755 (executable)
 #define IDS_SOUND_4CHANNEL              242
 #define IDS_HF_FS_CUSTOM                243
 #define IDS_SELECTFS                    244
+#define IDB_BITMAP1                     246
+#define IDB_XARCADE                     246
 #define IDS_NUMSG_NEEDEXT2              300
 #define IDS_NUMSG_NOROMKEY              301
 #define IDS_NUMSG_KSROMCRCERROR         302
 #define IDC_PORT1_KBDC                  1311
 #define IDC_PORT1_KBDD                  1312
 #define IDC_PORT1_KBDE                  1313
-#define IDC_PORT0                       1342
-#define IDC_PORT1                       1343
 #define IDC_MIDIFRAME                   1314
 #define IDC_SERPARFRAME                 1315
 #define IDC_SERIALFRAME                 1316
 #define IDC_NEW_FS                      1339
 #define IDC_NEW_HF                      1340
 #define IDC_NEW_HD                      1341
+#define IDC_PORT0                       1342
+#define IDC_PORT1                       1343
 #define IDC_PATH_NAME                   1362
 #define IDC_SELECTOR                    1363
 #define IDC_VOLUME_NAME                 1364
 #ifndef APSTUDIO_READONLY_SYMBOLS
 #define _APS_NO_MFC                     1
 #define _APS_3D_CONTROLS                     1
-#define _APS_NEXT_RESOURCE_VALUE        245
+#define _APS_NEXT_RESOURCE_VALUE        247
 #define _APS_NEXT_COMMAND_VALUE         40021
 #define _APS_NEXT_CONTROL_VALUE         1699
 #define _APS_NEXT_SYMED_VALUE           101
index 3f4128ada74e6b44ae0cb851207c6fee88ebd1e2..51259dd60b9a7eb0770c2c9fe458514eab87c321 100755 (executable)
@@ -445,9 +445,9 @@ BEGIN
     CONTROL         "Keyboard Layout ""C"" []T = up, B = down, F = left, H = right, left ALT = fire",
                     IDC_PORT0_KBDC,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,
                     10,198,90,10
-    CONTROL         "X-Arcade (left)",IDC_PORT0_KBDD,"Button",
+    CONTROL         "X-Arcade (left) []#1",IDC_PORT0_KBDD,"Button",
                     BS_AUTORADIOBUTTON | WS_TABSTOP,10,210,90,10
-    CONTROL         "X-Arcade (right)",IDC_PORT0_KBDE,"Button",
+    CONTROL         "X-Arcade (right) []#1",IDC_PORT0_KBDE,"Button",
                     BS_AUTORADIOBUTTON | WS_TABSTOP,10,222,90,10
     COMBOBOX        IDC_PORT0_JOYS,23,153,117,130,CBS_DROPDOWNLIST | 
                     WS_VSCROLL | WS_TABSTOP
@@ -463,9 +463,9 @@ BEGIN
     CONTROL         "Keyboard Layout ""C"" []T = up, B = down, F = left, H = right, left ALT = fire",
                     IDC_PORT1_KBDC,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,
                     155,198,90,10
-    CONTROL         "X-Arcade (left)",IDC_PORT1_KBDD,"Button",
+    CONTROL         "X-Arcade (left) []#1",IDC_PORT1_KBDD,"Button",
                     BS_AUTORADIOBUTTON | WS_TABSTOP,155,210,90,10
-    CONTROL         "X-Arcade (right)",IDC_PORT1_KBDE,"Button",
+    CONTROL         "X-Arcade (right) []#1",IDC_PORT1_KBDE,"Button",
                     BS_AUTORADIOBUTTON | WS_TABSTOP,155,222,90,10
     COMBOBOX        IDC_PORT1_JOYS,168,153,123,130,CBS_DROPDOWNLIST | 
                     WS_VSCROLL | WS_TABSTOP
@@ -1445,6 +1445,25 @@ END
 /////////////////////////////////////////////////////////////////////////////
 
 
+/////////////////////////////////////////////////////////////////////////////
+// Finnish resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FIN)
+#ifdef _WIN32
+LANGUAGE LANG_FINNISH, SUBLANG_DEFAULT
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Bitmap
+//
+
+IDB_XARCADE             BITMAP                  "xarcade-winuae.bmp"
+#endif    // Finnish resources
+/////////////////////////////////////////////////////////////////////////////
+
+
 
 #ifndef APSTUDIO_INVOKED
 /////////////////////////////////////////////////////////////////////////////
diff --git a/od-win32/resources/xarcade-winuae.bmp b/od-win32/resources/xarcade-winuae.bmp
new file mode 100755 (executable)
index 0000000..acb6f91
Binary files /dev/null and b/od-win32/resources/xarcade-winuae.bmp differ
index ac94883994fa4ede201a4f3be61a7792bd37a7af..86deb208d72a0fb8551214ede85bf97a90a2c1e2 100755 (executable)
@@ -781,8 +781,7 @@ static long FAR PASCAL AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam,
     break;
 
     case WM_CLOSE:
-       if (!currprefs.win32_ctrl_F11_is_quit)
-           uae_quit ();
+        uae_quit ();
     return 0;
 
     case WM_WINDOWPOSCHANGED:
@@ -877,6 +876,11 @@ static long FAR PASCAL AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam,
        }
     break;
 
+    case WM_SYSKEYDOWN:
+        if(currprefs.win32_ctrl_F11_is_quit && wParam == VK_F4)
+           return 0;
+    break;
+
     case 0xff: // WM_INPUT:
     handle_rawinput (lParam);
     break;
@@ -1987,22 +1991,21 @@ static void WIN32_HandleRegistryStuff( void )
        }
         
        RegQueryValueEx( hWinUAEKey, "DisplayInfo", 0, &dwType, (LPBYTE)&colortype, &dwDisplayInfoSize );
-       if( colortype == 0 ) /* No color information stored in the registry yet */
+       if (colortype == 0) /* No color information stored in the registry yet */
        {
-           char szMessage[ 4096 ];
-           char szTitle[ MAX_DPATH ];
-           WIN32GUI_LoadUIString( IDS_GFXCARDCHECK, szMessage, 4096 );
-           WIN32GUI_LoadUIString( IDS_GFXCARDTITLE, szTitle, MAX_DPATH );
+           char szMessage[4096];
+           char szTitle[MAX_DPATH];
+           WIN32GUI_LoadUIString(IDS_GFXCARDCHECK, szMessage, 4096);
+           WIN32GUI_LoadUIString(IDS_GFXCARDTITLE, szTitle, MAX_DPATH);
                    
-           if( MessageBox( NULL, szMessage, szTitle, MB_YESNO | MB_ICONWARNING | MB_TASKMODAL | MB_SETFOREGROUND ) == IDYES )
-           {
+           if(MessageBox(NULL, szMessage, szTitle, MB_YESNO | MB_ICONWARNING | MB_TASKMODAL | MB_SETFOREGROUND ) == IDYES) {
                colortype = WIN32GFX_FigurePixelFormats(0);
                RegSetValueEx( hWinUAEKey, "DisplayInfo", 0, REG_DWORD, (CONST BYTE *)&colortype, sizeof( colortype ) );
            }
        }
-       if( colortype ) {
+       if (colortype) {
            /* Set the 16-bit pixel format for the appropriate modes */
-           WIN32GFX_FigurePixelFormats( colortype );
+           WIN32GFX_FigurePixelFormats(colortype);
        }
        size = sizeof (quickstart);
        RegQueryValueEx( hWinUAEKey, "QuickStartMode", 0, &dwType, (LPBYTE)&quickstart, &size );
@@ -2282,18 +2285,23 @@ int execute_command (char *cmd)
     return 0;
 }
 
+#include "driveclick.h"
 static int drvsampleres[] = {
-    IDR_DRIVE_CLICK_A500_1, IDR_DRIVE_SPIN_A500_1, IDR_DRIVE_SPINND_A500_1,
-    IDR_DRIVE_STARTUP_A500_1, IDR_DRIVE_SNATCH_A500_1
+    IDR_DRIVE_CLICK_A500_1, DS_CLICK,
+    IDR_DRIVE_SPIN_A500_1, DS_SPIN,
+    IDR_DRIVE_SPINND_A500_1, DS_SPINND,
+    IDR_DRIVE_STARTUP_A500_1, DS_START,
+    IDR_DRIVE_SNATCH_A500_1, DS_SNATCH,
+    -1
 };
-#include "driveclick.h"
-int driveclick_loadresource (struct drvsample *s, int drivetype)
+int driveclick_loadresource (struct drvsample *sp, int drivetype)
 {
     int i, ok;
 
     ok = 1;
-    for (i = 0; i < DS_END; i++) {
-        HRSRC res = FindResource(NULL, MAKEINTRESOURCE(drvsampleres[i]), "WAVE");
+    for (i = 0; drvsampleres[i] >= 0; i += 2) {
+       struct drvsample *s = sp + drvsampleres[i + 1];
+        HRSRC res = FindResource(NULL, MAKEINTRESOURCE(drvsampleres[i + 0]), "WAVE");
        if (res != 0) {
            HANDLE h = LoadResource(NULL, res);
            int len = SizeofResource(NULL, res);
@@ -2303,7 +2311,6 @@ int driveclick_loadresource (struct drvsample *s, int drivetype)
        } else {
            ok = 0;
        }
-       s++;
     }
     return ok;
 }
index a851395dfad3221fcd14e687970816ee73defb90..6d25d4805e19aa09384981e65bd03c1bbf97ed17 100755 (executable)
@@ -22,7 +22,7 @@ extern int manual_palette_refresh_needed;
 extern int mouseactive, focus;
 extern int ignore_messages_all;
 #define WINUAEBETA 1
-#define WINUAEBETASTR " Beta 4"
+#define WINUAEBETASTR " Beta 5"
 
 extern void my_kbd_handler (int, int, int);
 extern void clearallkeys(void);
index 51c4ebf6d14b70f6e3e735b73b7763a3e0a3600a..852a3dbb2623ec17a6b35ffd735a996d2738039d 100755 (executable)
@@ -1076,10 +1076,12 @@ int check_prefs_changed_gfx (void)
     }
 
     if (strcmp (currprefs.prtname, changed_prefs.prtname) ||
+       currprefs.parallel_autoflush_time != changed_prefs.parallel_autoflush_time ||
        currprefs.parallel_postscript_emulation != changed_prefs.parallel_postscript_emulation ||
        currprefs.parallel_postscript_detection != changed_prefs.parallel_postscript_detection ||
        strcmp (currprefs.ghostscript_parameters, changed_prefs.ghostscript_parameters)) {
        strcpy (currprefs.prtname, changed_prefs.prtname);
+       currprefs.parallel_autoflush_time = changed_prefs.parallel_autoflush_time;
        currprefs.parallel_postscript_emulation = changed_prefs.parallel_postscript_emulation;
        currprefs.parallel_postscript_detection = changed_prefs.parallel_postscript_detection;
        strcpy (currprefs.ghostscript_parameters, changed_prefs.ghostscript_parameters);
index 0f6b98a367c005be49c026779bdbd2695ce73e91..ff6229aafb071f42b6e63360499402a976a05351 100755 (executable)
@@ -114,8 +114,15 @@ static int LOADSAVE_ID = -1, MEMORY_ID = -1, KICKSTART_ID = -1, CPU_ID = -1,
     HARDDISK_ID = -1, PORTS_ID = -1, INPUT_ID = -1, MISC1_ID = -1, MISC2_ID = -1, AVIOUTPUT_ID = -1,
     PATHS_ID = -1, QUICKSTART_ID = -1, ABOUT_ID = -1;
 static HWND pages[MAX_C_PAGES];
+#define MAX_IMAGETOOLTIPS 10
 static HWND guiDlg, panelDlg, ToolTipHWND;
 static HACCEL hAccelTable;
+struct ToolTipHWNDS {
+    WNDPROC proc;
+    HWND hwnd;
+    int imageid;
+};
+static struct ToolTipHWNDS ToolTipHWNDS2[MAX_IMAGETOOLTIPS + 1];
 
 void exit_gui (int ok)
 {
@@ -989,6 +996,8 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs
        }
     }
     nextp = full_path2 + openFileName.nFileOffset;
+    if (nextp[strlen(nextp) + 1] == 0)
+       multi = 0;
     while (result && next >= 0)
     {
        next = -1;
@@ -1088,6 +1097,8 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs
                     RegSetValueEx(hWinUAEKey, "hdfPath", 0, REG_SZ, (CONST BYTE *)openFileName.lpstrFile, strlen(openFileName.lpstrFile) + 1);
             }
         }
+        if (!multi)
+           next = -1;
         if (next >= 0)
            wParam = next;
     }
@@ -1110,8 +1121,16 @@ static int loopmulti (char *s, char *out)
        index = strlen (s) + 1;
        return 1;
     }
-    if (!s[index])
+    if (index < 0)
+       return 0;
+    if (!s[index]) {
+       if (s[strlen (s) + 1] == 0) {
+           strcpy (out, s);
+           index = -1;
+           return 1;
+       }
        return 0;
+    }
     sprintf (out, "%s\\%s", s, s + index);
     index += strlen (s + index) + 1;
     return 1;
@@ -6074,7 +6093,7 @@ static void addswapperfile (HWND hDlg, int entry)
     if (MultiDiskSelection (hDlg, -1, 0, &changed_prefs, path)) {
         char dpath[MAX_DPATH];
         loopmulti (path, NULL);
-        while (loopmulti(path, dpath) && entry < MAX_SPARE_DRIVES - 1) {
+        while (loopmulti(path, dpath) && entry < MAX_SPARE_DRIVES) {
             strcpy (workprefs.dfxlist[entry], dpath);
             entry++;
         }
@@ -7779,6 +7798,57 @@ static int GetPanelRect (HWND hDlg, RECT *r)
     return 1;
 }
 
+static int ToolTipImageIDs[] = { 1, IDB_XARCADE, -1 };
+
+static WNDPROC ToolTipWndProcOld;
+static long FAR PASCAL ToolTipWndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+    RECT r1;
+    POINT p1;
+    PAINTSTRUCT ps;
+    HBITMAP bm;
+    BITMAP binfo;
+    HDC hdc, memdc;
+    int w, h, i;
+
+    for (i = 0; ToolTipHWNDS2[i].hwnd; i++) {
+       if (hwnd == ToolTipHWNDS2[i].hwnd)
+           break;
+    }
+    if (!ToolTipHWNDS2[i].hwnd)
+        return CallWindowProc (ToolTipHWNDS2[i].proc, hwnd, message, wParam, lParam);
+
+    switch (message)
+    {
+       case WM_PAINT:
+       bm = LoadBitmap (hInst, MAKEINTRESOURCE (ToolTipHWNDS2[i].imageid));
+       GetObject (bm, sizeof (binfo), &binfo);
+       w = binfo.bmWidth;
+       h = binfo.bmHeight;
+       GetWindowRect (hwnd, &r1);
+       GetCursorPos (&p1);
+       r1.right = r1.left + w;
+       r1.bottom = r1.top + h;
+       ShowWindow (hwnd, SW_SHOWNA);
+       MoveWindow (hwnd, r1.left, r1.top, r1.right - r1.left, r1.bottom - r1.top, TRUE);
+       hdc = GetDC (hwnd);
+       memdc = CreateCompatibleDC (hdc);
+       SelectObject (memdc, bm);
+       BeginPaint (hwnd, &ps);
+       SetBkMode (ps.hdc, TRANSPARENT);
+       BitBlt (hdc, 0, 0, w, h, memdc, 0, 0, SRCCOPY);
+       DeleteObject (bm);
+       EndPaint (hwnd, &ps);
+       DeleteDC (memdc);
+       ReleaseDC (hwnd, hdc);
+       return FALSE;
+       case WM_PRINT:
+       PostMessage (hwnd, WM_PAINT, 0, 0);
+       return TRUE;
+    }
+    return CallWindowProc (ToolTipHWNDS2[i].proc, hwnd, message, wParam, lParam);
+}
+
 static BOOL CALLBACK childenumproc (HWND hwnd, LPARAM lParam)
 {
     TOOLINFO ti;
@@ -7789,19 +7859,52 @@ static BOOL CALLBACK childenumproc (HWND hwnd, LPARAM lParam)
     SendMessage (hwnd, WM_GETTEXT, (WPARAM)sizeof (tmp), (LPARAM)tmp);
     p = strchr (tmp, '[');
     if (strlen (tmp) > 0 && p && strlen(p) > 2 && p[1] == ']') {
+       int imageid = 0;
         *p++ = 0;
         *p++ = 0;
         if (p[0] == ' ')
            *p++;
+       if (p[0] == '#')
+           imageid = atol (p + 1);
         tmp[strlen(tmp) - 1] = 0;
-        SendMessage(hwnd, WM_SETTEXT, 0, (LPARAM)tmp);
         ti.cbSize = sizeof (TOOLINFO);
         ti.uFlags = TTF_SUBCLASS | TTF_IDISHWND;
         ti.hwnd = GetParent (hwnd);
         ti.hinst = hInst;
         ti.uId = (UINT)hwnd;
         ti.lpszText = p;
-        SendMessage(ToolTipHWND, TTM_ADDTOOL, 0, (LPARAM) (LPTOOLINFO) &ti);
+       if (imageid > 0) {
+           int idx, i;
+
+           idx = 0;
+           while (ToolTipHWNDS2[idx].hwnd)
+               idx++;
+           for (i = 0; ToolTipImageIDs[i] >= 0; i += 2) {
+               if (ToolTipImageIDs[i] == imageid)
+                   break;
+           }
+           if (ToolTipImageIDs[i] >= 0 && idx < MAX_IMAGETOOLTIPS) {
+               HWND ToolTipHWND2 = CreateWindowEx (WS_EX_TOPMOST,
+                   TOOLTIPS_CLASS, NULL,
+                   WS_POPUP | TTS_NOPREFIX,
+                   CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
+                   panelDlg, NULL, hInst, NULL);
+               ToolTipHWNDS2[idx].hwnd = ToolTipHWND2;
+               ToolTipHWNDS2[idx+1].hwnd = NULL;
+               ToolTipHWNDS2[idx].proc = (WNDPROC)GetWindowLongPtr (ToolTipHWND2, GWL_WNDPROC);
+               ToolTipHWNDS2[idx].imageid = ToolTipImageIDs[i + 1];
+               SetWindowLongPtr (ToolTipHWND2, GWL_WNDPROC, (LONG_PTR)ToolTipWndProc);
+               SetWindowPos (ToolTipHWND2, HWND_TOPMOST, 0, 0, 0, 0,
+                   SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
+               SendMessage(ToolTipHWND2, TTM_SETDELAYTIME, (WPARAM)TTDT_AUTOPOP, (LPARAM)MAKELONG(20000, 0));
+               SendMessage(ToolTipHWND2, TTM_SETMAXTIPWIDTH, 0, 400);
+               SendMessage(hwnd, WM_SETTEXT, 0, (LPARAM)tmp);
+               SendMessage(ToolTipHWND2, TTM_ADDTOOL, 0, (LPARAM) (LPTOOLINFO) &ti);
+           }
+       } else {
+           SendMessage(hwnd, WM_SETTEXT, 0, (LPARAM)tmp);
+           SendMessage(ToolTipHWND, TTM_ADDTOOL, 0, (LPARAM) (LPTOOLINFO) &ti);
+       }
         return 1;
     }
     p = strchr (tmp, ']');
@@ -7840,7 +7943,7 @@ static HWND updatePanel (HWND hDlg, int id)
 {
     static HWND hwndTT;
     RECT r1c, r1w, r2c, r2w, r3c, r3w;
-    int w, h, pw, ph, x , y;
+    int w, h, pw, ph, x , y, i;
 
     EnableWindow (GetDlgItem (guiDlg, IDC_RESETAMIGA), full_property_sheet ? FALSE : TRUE);
     EnableWindow (GetDlgItem (guiDlg, IDOK), TRUE);
@@ -7853,6 +7956,10 @@ static HWND updatePanel (HWND hDlg, int id)
        DestroyWindow (ToolTipHWND);
        ToolTipHWND = NULL;
     }
+    for (i = 0; ToolTipHWNDS2[i].hwnd; i++) {
+       DestroyWindow (ToolTipHWNDS2[i].hwnd);
+       ToolTipHWNDS2[i].hwnd = NULL;
+    }
     hAccelTable = NULL;
     if (id < 0) {
        if (!isfullscreen ()) {
@@ -7903,12 +8010,14 @@ static HWND updatePanel (HWND hDlg, int id)
         panelDlg, NULL, hInst, NULL);
     SetWindowPos (ToolTipHWND, HWND_TOPMOST, 0, 0, 0, 0,
        SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
+
 #if 0
     SendMessage(ToolTipHWND, TTM_SETDELAYTIME, (WPARAM)TTDT_INITIAL, (LPARAM)MAKELONG(100, 0));
     SendMessage(ToolTipHWND, TTM_SETDELAYTIME, (WPARAM)TTDT_RESHOW, (LPARAM)MAKELONG(0, 0));
 #endif
     SendMessage(ToolTipHWND, TTM_SETDELAYTIME, (WPARAM)TTDT_AUTOPOP, (LPARAM)MAKELONG(20000, 0));
     SendMessage(ToolTipHWND, TTM_SETMAXTIPWIDTH, 0, 400);
+
     EnumChildWindows (panelDlg, &childenumproc, (LPARAM)NULL);
     SendMessage (panelDlg, WM_NULL, 0, 0);
 
index f02f240be3e518b75409cae557f88f9553d6aff6..f93cba54cc2d6e311355465c68dffc635fed349c 100755 (executable)
                                                AdditionalIncludeDirectories="\projects\winuae\src\od-win32\resources;$(NoInherit)"/>
                                </FileConfiguration>
                        </File>
+                       <File
+                               RelativePath="..\resources\xarcade-winuae.bmp">
+                       </File>
                </Filter>
                <Filter
                        Name="win32"