]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
imported winuaesrc0990b13.zip
authorToni Wilen <twilen@winuae.net>
Sat, 24 Jul 2004 10:59:47 +0000 (13:59 +0300)
committerToni Wilen <twilen@winuae.net>
Mon, 22 Feb 2010 19:24:03 +0000 (21:24 +0200)
22 files changed:
akiko.c
blitter.c
cfgfile.c
debug.c
disk.c
filesys.c
fsdb.c
hardfile.c
include/disk.h
include/fsdb.h
include/gui.h
inputdevice.c
newcpu.c
od-win32/dinput.c
od-win32/dxwrap.c
od-win32/fsdb_win32.c
od-win32/posixemu.c
od-win32/resources/winuae.rc
od-win32/win32.c
od-win32/win32.h
od-win32/win32gfx.c
od-win32/win32gui.c

diff --git a/akiko.c b/akiko.c
index cfdeb81df3ce3e4abe9bdc9dccc6f99f6f312eb0..dfbdaf9615c8306a7f8b921a7568a1a2100b34a3 100755 (executable)
--- a/akiko.c
+++ b/akiko.c
@@ -16,6 +16,7 @@
 
 #include "config.h"
 #include "options.h"
+#include "uae.h"
 #include "memory.h"
 #include "events.h"
 #include "savestate.h"
@@ -941,6 +942,7 @@ void AKIKO_hsync_handler (void)
            gui_cd_led (1);
        cdrom_run_read ();
        framecounter = 1000000 / (74 * 75 * cdrom_speed);
+       framecounter = 1000000 / (74 * 75 * cdrom_speed);
         cdrom_status1 |= CDSTATUS_FRAME;
     }
     akiko_internal ();
@@ -995,7 +997,7 @@ static void *akiko_thread (void *null)
            sector_buffer_sector_2 = tmp3;
        }
         uae_sem_post (&akiko_sem);
-       Sleep (10);
+       sleep_millis (10);
     }
     akiko_thread_running = -1;
     return 0;
index 7c485504d450a6e5bbf8dcf7084d0456505f5c44..d6b48541e37bd3f359673733ae4d7469e71ce84e 100755 (executable)
--- a/blitter.c
+++ b/blitter.c
@@ -53,7 +53,7 @@ uae_u32 blit_masktable[BLITTER_MAX_WORDS];
 static uae_u16 blit_trashtable[BLITTER_MAX_WORDS];
 enum blitter_states bltstate;
 
-static int blit_cyclecounter, blit_maxcyclecounter, blit_slowdown, blit_cycles_total;
+static int blit_cyclecounter, blit_maxcyclecounter, blit_slowdown;
 static int blit_linecyclecounter, blit_misscyclecounter;
 
 #ifdef CPUEMU_6
@@ -897,7 +897,6 @@ void do_blitter (int hpos)
         blit_firstline_cycles = blit_first_cycle + blit_diag[1] * blt_info.hblitsize * CYCLE_UNIT;
         cycles = blt_info.vblitsize * blt_info.hblitsize;
     }
-    blit_cycles_total = cycles;
 
 #ifdef BLITTER_DEBUG
     blitter_dontdo = 0;
@@ -998,33 +997,24 @@ int blitnasty (void)
 void blitter_slowdown (int ddfstrt, int ddfstop, int totalcycles, int freecycles)
 {
     static int oddfstrt, oddfstop, ototal, ofree;
-    static int cycles_used;
-    int slow;
+    static int slow;
     
     if (ddfstrt != oddfstrt || ddfstop != oddfstop || totalcycles != ototal || ofree != freecycles) {
-       int linecycles = ddfstop - ddfstrt;
-        cycles_used = 0;
-        if (linecycles > blit_cycles_total)
-           linecycles = blit_cycles_total;
-       if (linecycles < 0)
-           linecycles = 0;
-       if (totalcycles == 0)
-           return;
-       cycles_used = linecycles * (totalcycles - freecycles) / totalcycles;
+       int linecycles = ((ddfstop - ddfstrt + totalcycles - 1) / totalcycles) * totalcycles;
+       int freelinecycles = ((ddfstop - ddfstrt + totalcycles - 1) / totalcycles) * freecycles;
+       int dmacycles = (linecycles * blit_dmacount) / blit_diag[1];
        oddfstrt = ddfstrt;
        oddfstop = ddfstop;
        ototal = totalcycles;
        ofree = freecycles;
+       slow = 0;
+       if (dmacycles > freelinecycles)
+           slow = dmacycles - freelinecycles;
     }
-    if (blit_slowdown < 0 || blitline || totalcycles == 0)
-       return;
-    slow = cycles_used * blit_dmacount / blit_diag[1];
-    slow = slow * 6 / 10;
-    if (slow <= 0)
+    if (blit_slowdown <= 0 || blitline)
        return;
     blit_slowdown += slow;
     blit_misscyclecounter += slow;
-    blit_cycles_total -= maxhpos;
 }
 
 uae_u8 *restore_blitter (uae_u8 *src)
index 932c58a16cd7a9289397741d760527e87d322678..923b7213b272988fadefc02e48a475a7a8f46a7a 100755 (executable)
--- a/cfgfile.c
+++ b/cfgfile.c
@@ -2289,6 +2289,7 @@ static int bip_super (struct uae_prefs *p, int config, int compa, int romcheck)
     p->cachesize = 8192;
     p->dfxtype[0] = 1;
     p->dfxtype[1] = 1;
+    p->floppy_speed = 0;
     p->cpu_idle = 150;
     p->scsi = 1;
     p->socket_emu = 1;
diff --git a/debug.c b/debug.c
index 06805a530dbbb5d28719194d0f707515a33d2980..64c160452b89035a8f682cb2dbbb3ff9064ce334 100755 (executable)
--- a/debug.c
+++ b/debug.c
@@ -31,6 +31,7 @@
 #include "savestate.h"
 #include "autoconf.h"
 #include "akiko.h"
+#include "inputdevice.h"
 
 static int debugger_active;
 static uaecptr skipaddr_start, skipaddr_end;
@@ -1482,6 +1483,7 @@ void debug (void)
     if (lasthist == firsthist) {
        if (++firsthist == MAX_HIST) firsthist = 0;
     }
+    inputdevice_unacquire ();
     pause_sound ();
     do_skip = 0;
     skipaddr_start = 0xffffffff;
@@ -1513,6 +1515,7 @@ void debug (void)
        debugging = 1;
     }
     resume_sound ();
+    inputdevice_acquire ();
 }
 
 int notinrom (void)
diff --git a/disk.c b/disk.c
index 52ffb29bf445e765e8a196a62fd6974745eea132..96e638c1270c3b1725f9af8a129117d358c4ec1f 100755 (executable)
--- a/disk.c
+++ b/disk.c
@@ -162,6 +162,7 @@ typedef struct {
     int idbit;
     unsigned long drive_id; /* drive id to be reported */
     char newname[256]; /* storage space for new filename during eject delay */
+    uae_u32 crc32;
 #ifdef FDI2RAW
     FDI *fdi;
 #endif
@@ -543,6 +544,8 @@ static void reset_drive(int i)
     drv->motoroff = 1;
     disabled &= ~(1 << i);
     gui_data.drive_disabled[i] = 0;
+    gui_data.df[i][0] = 0;
+    gui_data.crc32[i] = 0;
     if (currprefs.dfxtype[i] < 0) {
         disabled |= 1 << i;
         gui_data.drive_disabled[i] = 1;
@@ -573,10 +576,13 @@ static void update_drive_gui (int num)
     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]))) {
        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;
@@ -590,8 +596,10 @@ static void update_drive_gui (int num)
 
 static void drive_fill_bigbuf (drive * drv,int);
 
-struct zfile *DISK_validate_filename (const char *fname, int leave_open, int *wrprot)
+struct zfile *DISK_validate_filename (const char *fname, int leave_open, int *wrprot, uae_u32 *crc32)
 {
+    if (crc32)
+       *crc32 = 0;
     if (leave_open) {
        struct zfile *f = zfile_fopen (fname, "r+b");
        if (f) {
@@ -602,11 +610,19 @@ struct zfile *DISK_validate_filename (const char *fname, int leave_open, int *wr
                *wrprot = 1;
            f = zfile_fopen (fname, "rb");
        }
+       if (f && crc32)
+           *crc32 = zfile_crc32 (f);
        return f;
     } else {
        if (zfile_exists (fname)) {
            if (wrprot)
                *wrprot = 0;
+           if (crc32) {
+               struct zfile *f = zfile_fopen (fname, "rb");
+               if (f)
+                   *crc32 = zfile_crc32 (f);
+               zfile_fclose (f);
+           }
            return (void*)1;
        } else {
            if (wrprot)
@@ -695,7 +711,7 @@ char *DISK_get_saveimagepath (const char *name)
 
 static struct zfile *getwritefile (const char *name, int *wrprot)
 {
-    return DISK_validate_filename (DISK_get_saveimagepath (name), 1, wrprot);
+    return DISK_validate_filename (DISK_get_saveimagepath (name), 1, wrprot, NULL);
 }
 
 static int iswritefileempty (const char *name)
@@ -750,7 +766,7 @@ static int diskfile_iswriteprotect (const char *fname, int *needwritefile, drive
     
     *needwritefile = 0;
     *drvtype = DRV_35_DD;
-    zf1 = DISK_validate_filename (fname, 1, &wrprot1);
+    zf1 = DISK_validate_filename (fname, 1, &wrprot1, NULL);
     if (!zf1) return 1;
     if (zfile_iscompressed (zf1)) {
        wrprot1 = 1;
@@ -791,14 +807,14 @@ static int drive_insert (drive * drv, struct uae_prefs *p, int dnum, const char
     int num_tracks;
 
     drive_image_free (drv);
-    drv->diskfile = DISK_validate_filename (fname, 1, &drv->wrprot);
+    drv->diskfile = DISK_validate_filename (fname, 1, &drv->wrprot, &drv->crc32);
     drv->ddhd = 1;
     drv->num_secs = 0;
     drv->hard_num_cyls = p->dfxtype[dnum] == DRV_525_SD ? 40 : 80;
     drv->tracktiming[0] = 0;
     drv->useturbo = 0;
     drv->indexoffset = 0;
-    
+
     if (!drv->motoroff) {
        drv->dskready_time = DSKREADY_TIME;
        drv->dskready_down_time = 0;
@@ -1509,6 +1525,7 @@ static void drive_eject (drive * drv)
     drv->dskready = 0;
     drv->dskready_time = 0;
     drv->dskready_down_time = 0;
+    drv->crc32 = 0;
     drive_settype_id(drv); /* Back to 35 DD */
 #ifdef DISK_DEBUG
     write_dlog ("eject drive %d\n", drv - &floppy[0]);
@@ -1651,7 +1668,7 @@ int disk_setwriteprotect (int num, const char *name, int protect)
     drive_type drvtype;
  
     oldprotect = diskfile_iswriteprotect (name, &needwritefile, &drvtype);
-    zf1 = DISK_validate_filename (name, 1, &wrprot1);
+    zf1 = DISK_validate_filename (name, 1, &wrprot1, NULL);
     if (!zf1) return 0;
     if (zfile_iscompressed (zf1)) wrprot1 = 1;
     zf2 = getwritefile (name, &wrprot2);
@@ -1681,6 +1698,7 @@ void disk_eject (int num)
     drive_eject (floppy + num);
     *currprefs.df[num] = *changed_prefs.df[num] = 0;
     floppy[num].newname[0] = 0;
+    update_drive_gui (num);
 }
 
 void DISK_history_add (const char *name, int idx)
@@ -1780,6 +1798,8 @@ void DISK_check_change (void)
 #ifdef DISK_DEBUG
                write_dlog ("delayed insert, drive %d, image '%s'\n", i, drv->newname);
 #endif
+               update_drive_gui (i);
+
            }
        }
     }
@@ -2700,7 +2720,8 @@ uae_u8 *restore_disk(int num,uae_u8 *src)
     strncpy(changed_prefs.df[num],src,255);
     src+=strlen(src)+1;
     drive_insert (floppy + num, &currprefs, num, changed_prefs.df[num]);
-    if (drive_empty (floppy + num)) drv->dskchange = 1;
+    if (drive_empty (floppy + num))
+       drv->dskchange = 1;
 
     return src;
 }
index 64537885f736cc69465d42cf62db1c1a13409c34..a7150bd9111f578430154959c28cd93c6521ba71 100755 (executable)
--- a/filesys.c
+++ b/filesys.c
@@ -3067,7 +3067,7 @@ action_rename_object (Unit *unit, dpacket packet)
        return;
     }
 
-    if (-1 == rename (a1->nname, a2->nname)) {
+    if (-1 == my_rename (a1->nname, a2->nname)) {
        int ret = -1;
        /* maybe we have open file handles that caused failure? */
        write_log ("rename '%s' -> '%s' failed, trying relocking..\n", a1->nname, a2->nname);
@@ -3080,7 +3080,7 @@ action_rename_object (Unit *unit, dpacket packet)
            }
         }
        /* try again... */
-       ret = rename (a1->nname, a2->nname);
+       ret = my_rename (a1->nname, a2->nname);
        for (k1 = unit->keys; k1; k1 = knext) {
            knext = k1->next;
            if (k1->aino == a1 && k1->fd >= 0) {
diff --git a/fsdb.c b/fsdb.c
index d8caada82b5745116134fb2a080e89d36b426927..57c04849a9d363e9e5434340165d9ad35df30aed 100755 (executable)
--- a/fsdb.c
+++ b/fsdb.c
  * Offset 518, 81 bytes, comment
  */
 
+#define TRACING_ENABLED 0
+#if TRACING_ENABLED
+#define TRACE(x)       do { write_log x; } while(0)
+#else
+#define TRACE(x)
+#endif
+
 char *nname_begin (char *nname)
 {
     char *p = strrchr (nname, FSDB_DIR_SEPARATOR);
@@ -96,7 +103,7 @@ static void fsdb_fixup (FILE *f, char *buf, int size, a_inode *base)
         free (nname);
        return;
     }
-    write_log ("uaefsdb '%s' deleted\n", nname);
+    TRACE (("uaefsdb '%s' deleted\n", nname));
     /* someone deleted this file/dir outside of emulation.. */
     buf[0] = 0;
     free (nname);
@@ -150,7 +157,8 @@ static a_inode *aino_from_buf (a_inode *base, char *buf, long off)
     aino->has_dbentry = 1;
     aino->dirty = 0;
     aino->db_offset = off;
-    write_log("aino=%d a='%s' n='%s' c='%s' mode=%d dir=%d\n",off,aino->aname,aino->nname,aino->comment,aino->amigaos_mode,aino->dir);
+    TRACE (("aino=%d a='%s' n='%s' c='%s' mode=%d dir=%d\n",
+       off, aino->aname, aino->nname, aino->comment, aino->amigaos_mode, aino->dir));
     return aino;
 }
 
@@ -245,7 +253,7 @@ static void write_aino (FILE *f, a_inode *aino)
     aino->db_offset = ftell (f);
     fwrite (buf, 1, sizeof buf, f);
     aino->has_dbentry = aino->needs_dbentry;
-    write_log ("%d '%s' '%s' written\n", aino->db_offset, aino->aname, aino->nname);
+    TRACE (("%d '%s' '%s' written\n", aino->db_offset, aino->aname, aino->nname));
 }
 
 /* Write back the db file for a directory.  */
@@ -259,6 +267,7 @@ void fsdb_dir_writeback (a_inode *dir)
     uae_u8 *tmpbuf;
     int size, i;
 
+    TRACE (("fsdb writeback %s\n", dir->aname));
     /* First pass: clear dirty bits where unnecessary, and see if any work
      * needs to be done.  */
     for (aino = dir->child; aino; aino = aino->sibling) {
@@ -280,20 +289,27 @@ void fsdb_dir_writeback (a_inode *dir)
     }
     if (! entries_needed) {
        kill_fsdb (dir);
+       TRACE (("fsdb removed\n"));
        return;
     }
 
-    if (! changes_needed)
+    if (! changes_needed) {
+       TRACE (("not modified\n"));
        return;
+    }
 
     f = get_fsdb (dir, "r+b");
     if (f == 0) {
-       if (currprefs.filesys_no_uaefsdb)
+       if (currprefs.filesys_no_uaefsdb) {
+           TRACE (("disabled\n"));
            return;
+       }
        f = get_fsdb (dir, "w+b");
-       if (f == 0)
+       if (f == 0) {
+           TRACE (("failed\n"));
            /* This shouldn't happen... */
            return;
+       }
     }
     fseek (f, 0, SEEK_END);
     size = ftell (f);
@@ -303,7 +319,7 @@ void fsdb_dir_writeback (a_inode *dir)
        tmpbuf = malloc (size);
        fread (tmpbuf, 1, size, f);
     }
-    write_log ("**** updating '%s'\n", dir->aname);
+    TRACE (("**** updating '%s' %d\n", dir->aname, size));
 
     for (aino = dir->child; aino; aino = aino->sibling) {
        if (! aino->dirty)
@@ -327,7 +343,7 @@ void fsdb_dir_writeback (a_inode *dir)
        }
        write_aino (f, aino);
     }
-    write_log ("end\n");
+    TRACE (("end\n"));
     fclose (f);
     free (tmpbuf);
 }
index 4a2cedfc2e4e472ff1339ef44acfb2fb4a94d785..4b23f0e800da8b80f9cea1976de265bb8dbf5fd9 100755 (executable)
@@ -138,13 +138,6 @@ static uae_u64 cmd_write (struct hardfiledata *hfd, uaecptr dataptr, uae_u64 off
 
     gui_hd_led (1);
     hf_log2 ("cmd_write: %p %04.4x-%08.8x %08.8x\n", dataptr, (uae_u32)(offset >> 32), (uae_u32)offset, (uae_u32)len);
-    if (offset + len >= hfd->size) {
-       write_log ("read access out of bounds %08.8X-%08.8X + %08.8X-%08.8X >= %08.8X-%08.8X\n",
-           (uae_u32)(offset >> 32),(uae_u32)offset,(uae_u32)(len >> 32),(uae_u32)len,
-           (uae_u32)((offset + len) >> 32),(uae_u32)(offset+len));
-       for (i = 0; i < len; i++)
-           put_byte (dataptr + i, 0);
-    }
     while (len > 0) {
         int got2;
         for (i = 0; i < hfd->blocksize; i++)
@@ -489,7 +482,7 @@ static void getchs (struct hardfiledata *hfd, int *cyl, int *cylsec, int *head,
 
 static void outofbounds (int cmd, uae_u64 offset, uae_u64 len, uae_u64 max)
 {
-    write_log ("cmd %d: out of bounds, %08.8X-%08.8X + %08.8X-%08.8X >= %08.8X-%08.8X\n", cmd,
+    write_log ("cmd %d: out of bounds, %08.8X-%08.8X + %08.8X-%08.8X > %08.8X-%08.8X\n", cmd,
        (uae_u32)(offset >> 32),(uae_u32)offset,(uae_u32)(len >> 32),(uae_u32)len,
        (uae_u32)(max >> 32),(uae_u32)max);
 }
index 199ccbca2d4791f04dad06e31d3bb7abca5cd2fd..8ca975a11812a23afaaa86c0ed831ad9bb1461e4 100755 (executable)
@@ -16,7 +16,7 @@ extern void disk_eject (int num);
 extern int disk_empty (int num);
 extern void disk_insert (int num, const char *name);
 extern void DISK_check_change (void);
-extern struct zfile *DISK_validate_filename (const char *, int, int *);
+extern struct zfile *DISK_validate_filename (const char *, int, int *, uae_u32 *);
 extern void DISK_handler (void);
 extern void DISK_update (int hpos);
 extern void DISK_reset (void);
index cd060e7223c86576ab0318388f1feae10c00f73f..1057b5bd63ae051f6f0be734bf1db4019529f53f 100755 (executable)
@@ -121,6 +121,7 @@ extern int my_readdir (void*, char*);
 extern int my_rmdir (const char*);
 extern int my_mkdir (const char*);
 extern int my_unlink (const char*);
+extern int my_rename (const char*, const char*);
 
 extern void *my_open (const char*, int);
 extern void my_close (void*);
index 88dfd0a21e7b34dd662eac128322a74c7f9a3b78..96e4cfe2594a95a789c0ada01656b3902080f8d4 100755 (executable)
@@ -34,6 +34,8 @@ struct gui_info
     uae_u8 hd;                     /* harddrive */
     uae_u8 cd;                     /* CD */
     int fps, idle;
+    char df[4][256];               /* inserted image */
+    uae_u32 crc32[4];              /* crc32 of image */
 };
 #define NUM_LEDS (1 + 1 + 1 + 1 + 1 + 4)
 
index 05e6f494b72218319bfa31c64c6bbf432918e604..1a0273015183640002f4d5814a8cdc2c7e346f23 100755 (executable)
@@ -909,7 +909,7 @@ static uae_u16 handle_joystick_potgor (uae_u16 potgor)
        if (mouse_port[i]) {
            /* mouse has pull-up resistors in button lines */
            if (!(potgo_value & p5dir))
-               potgor |= p5dir;
+               potgor |= p5dat;
            if (!(potgo_value & p9dir))
                potgor |= p9dat;
        }
@@ -918,7 +918,7 @@ static uae_u16 handle_joystick_potgor (uae_u16 potgor)
             * forces input-lines to zero
             */
            if (!(potgo_value & p5dir))
-               potgor &= ~p5dir;
+               potgor &= ~p5dat;
            if (!(potgo_value & p9dir))
                potgor &= ~p9dat;
        }
@@ -932,15 +932,15 @@ static uae_u16 handle_joystick_potgor (uae_u16 potgor)
            /* P5 output and 1 -> shift register is kept reset (Blue button) */
            if ((potgo_value & p5dir) && (potgo_value & p5dat))
                cd32_shifter[i] = 8;
-           /* shift at zero == return one, >1 = return button states */
+           /* shift at 1 == return one, >1 = return button states */
            if (cd32_shifter[i] == 0)
-               potgor &= ~p9dat; /* shift at one == return zero */
+               potgor &= ~p9dat; /* shift at zero == return zero */
            if (cd32_shifter[i] >= 2 && (joybutton[i] & ((1 << JOYBUTTON_CD32_PLAY) << (cd32_shifter[i] - 2))))
                potgor &= ~p9dat;
            //write_log ("%d:%04.4X %08.8X\n", cd32_shifter[i], potgor, m68k_getpc());
        } else {
            if (getbuttonstate (i, JOYBUTTON_3))
-               potgor &= ~p5dir;
+               potgor &= ~p5dat;
            if (getbuttonstate (i, JOYBUTTON_2))
                potgor &= ~p9dat;
        }
@@ -1245,7 +1245,7 @@ void handle_input_event (int nr, int state, int max, int autofire)
     
     if (nr <= 0) return;
     ie = &events[nr];
-//    write_log("'%s' %d %d\n", ie->name, state, max);
+    //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);
index 7859724a99d92c11731e999e0b7db6bb4f4ec7d5..3a7d871b337cc8a041ce1a060f379ef6da6f8b1b 100755 (executable)
--- a/newcpu.c
+++ b/newcpu.c
@@ -1102,7 +1102,8 @@ static int movec_illg (int regno)
     }
     if (currprefs.cpu_level == 2 || currprefs.cpu_level == 3) { /* 68020 */
        if (regno == 3) return 1; /* 68040 only */
-       if (regno2 < 4)
+        /* 4 is >=68040, but 0x804 is in 68020 */
+        if (regno2 < 4 || regno == 0x804)
            return 0;
        return 1;
     }
index 5a3765c1de89e09cf3c2d581af290d3f31fc0a47..950a17b40cb05c4b7940c86aa750f7f8bd73be72 100755 (executable)
@@ -316,11 +316,13 @@ static void initialize_windowsmouse (void)
        did->name = my_strdup (i ? "Mousehack mouse" : "Windows mouse");
        did->sortname = my_strdup (i ? "Windowsmouse2" : "Windowsmouse1");
        did->buttons = GetSystemMetrics (SM_CMOUSEBUTTONS);
+       if (did->buttons < 3)
+           did->buttons = 3;
        if (did->buttons > 5)
            did->buttons = 5; /* no non-direcinput support for >5 buttons */
        if (did->buttons > 3 && !os_winnt)
            did->buttons = 3; /* Windows 98/ME support max 3 non-DI buttons */
-       did->axles = GetSystemMetrics (SM_MOUSEWHEELPRESENT) ? 3 : 2;
+       did->axles = 3;
        did->axistype[0] = 1;
        did->axissort[0] = 0;
        did->axisname[0] = my_strdup ("X-Axis");
@@ -1156,8 +1158,11 @@ static int init_kb (void)
     keyboardlayoutid = GetKeyboardLayout(0);      
     keyboardlangid = LOWORD(keyboardlayoutid);
     keyboard_german = 0;
-    if (keyboardlangid == MAKELANGID (LANG_GERMAN, SUBLANG_GERMAN))
-       keyboard_german = 1;
+    if (keyboardlangid == 0x0407) keyboard_german = 1; //German Standard
+    if (keyboardlangid == 0x0807) keyboard_german = 1; //German Switzerland
+    if (keyboardlangid == 0x0c07) keyboard_german = 1; //German Austria
+    if (keyboardlangid == 0x1007) keyboard_german = 1; //German Louxembourg
+    if (keyboardlangid == 0x1407) keyboard_german = 1; //German Lichtenstein
     return 1;
 }
 
@@ -1261,8 +1266,6 @@ static int keyhack (int scancode,int pressed, int num)
  //available
  //so here need to change qulifier state and restore it when key
  //is release
-    if (!keyboard_german)
-       return scancode;
     if (scancode == DIK_BACKSLASH) // The # key
     {
        if (di_keycodes[num][DIK_LSHIFT] || di_keycodes[num][DIK_RSHIFT] || apostrophstate)
index 4667bab531d6ed813c5da9b5867d86e024d3392b..190d6aa8d22dca6ca6cb3f98044b8a0035ea9bd3 100755 (executable)
@@ -1011,10 +1011,6 @@ HRESULT DirectDraw_CreateOverlaySurface( int width, int height, int bits)
        ddrval = IDirectDraw7_CreateSurface ( DirectDrawState.directdraw.dd, &ddsd, &DirectDrawState.overlay.surface, NULL);
        if( ddrval == DD_OK )
        {
-#if 0
-           ddrval = IDirectDrawSurface7_QueryInterface( DirectDrawState.overlay.surface,
-                       &IID_IDirectDrawSurface7,(LPVOID *)&DirectDrawState.overlay.surface );
-#endif
            DirectDrawState.isoverlay = 1;
        }
        else
index 6d88f1e331e52aa9a329ee3387799601487da138..7a20f65441133e1008a2081d7edda31c76f681cf 100755 (executable)
@@ -198,14 +198,39 @@ int my_mkdir (const char *name)
     return CreateDirectory (name, NULL) == 0 ? -1 : 0;
 }
 
+static int recycle (const char *name)
+{
+    SHFILEOPSTRUCT fos;
+    /* name must be terminated by \0\0 */
+    char *p = xcalloc (strlen (name) + 2, 1);
+    int v;
+    
+    strcpy (p, name);
+    memset (&fos, 0, sizeof (fos));
+    fos.wFunc = FO_DELETE;
+    fos.pFrom = p;
+    fos.fFlags = FOF_ALLOWUNDO | FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_NORECURSION | FOF_SILENT;
+    v = SHFileOperation (&fos);
+    xfree (p);
+    return v ? -1 : 0;
+}
+
 int my_rmdir (const char *name)
 {
-    return RemoveDirectory (name) == 0 ? -1 : 0;
+    return recycle (name);
+    //return RemoveDirectory (name) == 0 ? -1 : 0;
 }
 
+/* "move to Recycle Bin" (if enabled) -version of DeleteFile() */
 int my_unlink (const char *name)
 {
-    return DeleteFile (name) == 0 ? -1 : 0;
+    return recycle (name);
+    //return DeleteFile (name) == 0 ? -1 : 0;
+}
+
+int my_rename (const char *oldname, const char *newname)
+{
+    return MoveFile (oldname, newname) == 0 ? -1 : 0;
 }
 
 struct my_opendirs {
@@ -332,12 +357,11 @@ int my_truncate (const char *name, long int len)
             if (SetEndOfFile (hFile) == TRUE)
                 result = 0;
         } else {
-            write_log ("SetFilePointer() failure for %s to posn %d\n", name, len);
+            write_log ("truncate: SetFilePointer() failure for %s to posn %d\n", name, len);
         }
         CloseHandle( hFile );
     } else {
-        write_log ("CreateFile() failed to open %s\n", name);
+        write_log ("truncate: CreateFile() failed to open %s\n", name);
     }
     return result;
 }
-    
\ No newline at end of file
index 9a8e459fdb256040a02214789f88249442c6a5dc..9335aebf3af286f365a36d4a2a8f5798fa62e955 100755 (executable)
 /* Our Win32 implementation of this function */
 void gettimeofday( struct timeval *tv, void *blah )
 {
+#if 1
     struct timeb time;
-    ftime( &time );
+    ftime (&time);
 
     tv->tv_sec = time.time;
     tv->tv_usec = time.millitm * 1000;
+#else
+    SYSTEMTIME st;
+    FILETIME ft;
+    uae_u64 v, sec;
+    GetSystemTime (&st);
+    SystemTimeToFileTime (&st, &ft);
+    v = (ft.dwHighDateTime << 32) | ft.dwLowDateTime;
+    v /= 10;
+    sec = v / 1000000;
+    tv->tv_usec = (unsigned long)(v - (sec * 1000000));
+    tv->tv_sec = (unsigned long)(sec - 11644463600);
+#endif
 }
 
 /* convert time_t to/from AmigaDOS time */
index a49857d1c5c284c1e1457968e7e9738278f3623e..eb81970d246361f75cc711770137582e2898fcd1 100755 (executable)
@@ -45,20 +45,20 @@ BEGIN
     COMBOBOX        IDC_ROMFILE2,89,31,186,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | 
                     CBS_SORT | WS_VSCROLL | WS_TABSTOP
     PUSHBUTTON      "...",IDC_ROMCHOOSER2,280,30,10,15
+    CONTROL         "MAPROM emulation [] Creates BlizKick-compatible memory area.",
+                    IDC_MAPROM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,95,54,
+                    82,10
+    CONTROL         "ShapeShifter support [] Patches Kickstart ROM for ShapeShifter compatibility.",
+                    IDC_KICKSHIFTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
+                    187,54,80,10
+    GROUPBOX        "Misc settings:",-1,5,76,290,57
     RTEXT           "Cartridge ROM File:",IDC_FLASHTEXT2,8,93,75,10
     COMBOBOX        IDC_CARTFILE,89,90,186,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | 
                     CBS_SORT | WS_VSCROLL | WS_TABSTOP
     PUSHBUTTON      "...",IDC_CARTCHOOSER,280,90,10,15
-    GROUPBOX        "Misc settings:",-1,5,76,290,57
     RTEXT           "Flash RAM File:",IDC_FLASHTEXT,8,112,75,10
     EDITTEXT        IDC_FLASHFILE,89,110,185,15,ES_AUTOHSCROLL
     PUSHBUTTON      "...",IDC_FLASHCHOOSER,280,110,10,15
-    CONTROL         "MAPROM emulation [] Creates BlizKick-compatible memory area.",
-                    IDC_MAPROM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,95,54,
-                    82,10
-    CONTROL         "ShapeShifter support [] Patches Kickstart ROM for ShapeShifter compatibility.",
-                    IDC_KICKSHIFTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
-                    187,54,80,10
 END
 
 IDD_DISPLAY DIALOGEX 0, 0, 300, 194
@@ -82,16 +82,17 @@ BEGIN
     GROUPBOX        "Settings",IDC_SETTINGSTEXT,12,77,199,73
     CONTROL         "Full Screen",IDC_AFULLSCREEN,"Button",BS_AUTOCHECKBOX | 
                     BS_LEFT | WS_TABSTOP,35,89,90,10
-    CONTROL         "Correct aspect ratio",IDC_ASPECT,"Button",
-                    BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,35,106,90,10
     CONTROL         "Full Screen RTG",IDC_PFULLSCREEN,"Button",
                     BS_AUTOCHECKBOX | WS_TABSTOP,131,89,70,10,0,
                     HIDC_PFULLSCREEN
+    CONTROL         "Correct aspect ratio",IDC_ASPECT,"Button",
+                    BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,35,106,90,10
     CONTROL         "Lo-res",IDC_LORES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
                     131,106,70,10,0,HIDC_LORES
     LTEXT           "Refresh:",IDC_REFRESHTEXT,18,129,28,8
     CONTROL         "Slider1",IDC_FRAMERATE,"msctls_trackbar32",
                     TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,46,124,75,20
+    EDITTEXT        IDC_RATETEXT,126,128,77,12,ES_CENTER | ES_READONLY
     GROUPBOX        "Centering",IDC_STATIC,221,0,61,67
     CONTROL         "Horizontal",IDC_XCENTER,"Button",BS_AUTOCHECKBOX | 
                     WS_TABSTOP,229,16,45,10
@@ -111,7 +112,6 @@ BEGIN
                     TBS_TOP | NOT WS_VISIBLE | WS_TABSTOP,97,161,101,20
     PUSHBUTTON      "Detect pixel format",IDC_TEST16BIT,210,161,73,14,0,0,
                     HIDC_TEST16BIT
-    EDITTEXT        IDC_RATETEXT,126,128,77,12,ES_CENTER | ES_READONLY
 END
 
 IDD_MEMORY DIALOGEX 0, 0, 300, 175
@@ -165,6 +165,9 @@ BEGIN
     CONTROL         "More compatible [] Emulate 68000's prefetch registers. More compatible but slower.",
                     IDC_COMPATIBLE,"Button",BS_AUTOCHECKBOX | BS_LEFT | 
                     WS_GROUP | WS_TABSTOP,10,130,70,10
+    CONTROL         "JIT [] Enable Just-In-Time CPU emulator. Increases the speed of CPU emulation 10-100x. Requires 68020 or 68040 CPU.",
+                    IDC_JITENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,
+                    145,64,10
     GROUPBOX        "CPU Emulation Speed:",IDC_STATIC,90,5,205,86
     CONTROL         "Fastest possible, but maintain chipset timing",
                     IDC_CS_HOST,"Button",BS_AUTORADIOBUTTON | BS_LEFT | 
@@ -206,9 +209,6 @@ BEGIN
                     WS_TABSTOP,230,142,45,10
     CONTROL         "After Picasso96",IDC_TRUST2,"Button",BS_AUTORADIOBUTTON | 
                     WS_TABSTOP,230,155,64,10
-    CONTROL         "JIT [] Enable Just-In-Time CPU emulator. Increases the speed of CPU emulation 10-100x. Requires 68020 or 68040 CPU.",
-                    IDC_JITENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,
-                    145,64,10
 END
 
 IDD_FLOPPY DIALOGEX 0, 0, 300, 230
@@ -291,11 +291,11 @@ BEGIN
     PUSHBUTTON      "Add &Directory...",IDC_NEW_FS,5,196,60,15
     PUSHBUTTON      "Add &Hardfile...",IDC_NEW_HF,70,196,60,15
     PUSHBUTTON      "Add Ha&rddrive...",IDC_NEW_HD,135,196,60,15
+    PUSHBUTTON      "Remove",IDC_REMOVE,135,218,60,15
+    PUSHBUTTON      "&Properties",IDC_EDIT,200,218,60,15
     CONTROL         "Add PC Drives at Startup",IDC_MAPDRIVES,"Button",
                     BS_AUTOCHECKBOX | WS_TABSTOP,5,216,105,10,0,
                     HIDC_MAPDRIVES
-    PUSHBUTTON      "Remove",IDC_REMOVE,135,218,60,15
-    PUSHBUTTON      "&Properties",IDC_EDIT,200,218,60,15
     CONTROL         "Disable UAEFSDB-support",IDC_NOUAEFSDB,"Button",
                     BS_AUTOCHECKBOX | WS_TABSTOP,5,229,115,10
 END
@@ -316,6 +316,14 @@ BEGIN
                     WS_TABSTOP,13,69,42,10
     CONTROL         "Enabled, 100% accurate",IDC_SOUND3,"Button",
                     BS_AUTORADIOBUTTON | WS_TABSTOP,13,81,93,10
+    GROUPBOX        "Volume",IDC_STATIC,131,30,164,31
+    CONTROL         "",IDC_SOUNDVOLUME,"msctls_trackbar32",TBS_AUTOTICKS | 
+                    TBS_TOP | WS_TABSTOP,137,38,105,20
+    EDITTEXT        IDC_SOUNDVOLUME2,247,41,40,12,ES_CENTER | ES_READONLY
+    GROUPBOX        "Sound buffer size",IDC_STATIC,132,67,164,31
+    CONTROL         "Slider1",IDC_SOUNDBUFFERRAM,"msctls_trackbar32",
+                    TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,138,75,106,19
+    EDITTEXT        IDC_SOUNDBUFFERMEM,248,78,40,12,ES_CENTER | ES_READONLY
     GROUPBOX        "Settings",IDC_SOUNDINTERPOLATION2,6,101,290,60
     RTEXT           "Frequency:",IDC_SOUNDFREQTXT,34,110,37,8,SS_CENTERIMAGE
     COMBOBOX        IDC_SOUNDFREQ,36,119,67,75,CBS_DROPDOWN | WS_VSCROLL | 
@@ -332,36 +340,28 @@ BEGIN
                     SS_CENTERIMAGE
     COMBOBOX        IDC_SOUNDINTERPOLATION,116,144,67,75,CBS_DROPDOWNLIST | 
                     WS_VSCROLL | WS_TABSTOP
+    RTEXT           "Stereo separation:",IDC_SOUNDSTEREOSEPTXT,196,110,58,8,
+                    SS_CENTERIMAGE
+    COMBOBOX        IDC_SOUNDSTEREOSEP,197,119,67,75,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    RTEXT           "Stereo mixing delay:",IDC_SOUNDSTEREOMIXTXT,196,135,63,
+                    8,SS_CENTERIMAGE
+    COMBOBOX        IDC_SOUNDSTEREOMIX,197,144,67,75,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
     GROUPBOX        "Disk Drive Sound Emulation",IDC_STATIC,6,164,290,46
+    CONTROL         "",IDC_SOUNDDRIVEVOLUME,"msctls_trackbar32",
+                    TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,14,172,107,19
+    EDITTEXT        IDC_SOUNDDRIVEVOLUME2,124,178,40,12,ES_CENTER | 
+                    ES_READONLY
     COMBOBOX        IDC_SOUNDDRIVE,237,174,46,75,CBS_DROPDOWNLIST | 
                     WS_VSCROLL | WS_TABSTOP
     COMBOBOX        IDC_SOUNDDRIVESELECT,18,192,265,75,CBS_DROPDOWNLIST | 
                     WS_VSCROLL | WS_TABSTOP
-    CONTROL         "",IDC_SOUNDDRIVEVOLUME,"msctls_trackbar32",
-                    TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,14,172,107,19
-    GROUPBOX        "Sound buffer size",IDC_STATIC,132,67,164,31
-    CONTROL         "Slider1",IDC_SOUNDBUFFERRAM,"msctls_trackbar32",
-                    TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,138,75,106,19
     GROUPBOX        "Sound driver lag compensation",IDC_STATIC,6,211,290,31
     CONTROL         "Slider1",IDC_SOUNDADJUST,"msctls_trackbar32",
                     TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,14,221,107,19
-    PUSHBUTTON      "Calibrate",IDC_SOUNDCALIBRATE,183,223,40,14
-    GROUPBOX        "Volume",IDC_STATIC,131,30,164,31
-    CONTROL         "",IDC_SOUNDVOLUME,"msctls_trackbar32",TBS_AUTOTICKS | 
-                    TBS_TOP | WS_TABSTOP,137,38,105,20
-    EDITTEXT        IDC_SOUNDBUFFERMEM,248,78,40,12,ES_CENTER | ES_READONLY
     EDITTEXT        IDC_SOUNDADJUSTNUM,124,224,40,12,ES_CENTER | ES_READONLY
-    EDITTEXT        IDC_SOUNDVOLUME2,247,41,40,12,ES_CENTER | ES_READONLY
-    EDITTEXT        IDC_SOUNDDRIVEVOLUME2,124,178,40,12,ES_CENTER | 
-                    ES_READONLY
-    RTEXT           "Stereo separation:",IDC_SOUNDSTEREOSEPTXT,196,110,58,8,
-                    SS_CENTERIMAGE
-    COMBOBOX        IDC_SOUNDSTEREOSEP,197,119,67,75,CBS_DROPDOWNLIST | 
-                    WS_VSCROLL | WS_TABSTOP
-    RTEXT           "Stereo mixing delay:",IDC_SOUNDSTEREOMIXTXT,196,135,63,
-                    8,SS_CENTERIMAGE
-    COMBOBOX        IDC_SOUNDSTEREOMIX,197,144,67,75,CBS_DROPDOWNLIST | 
-                    WS_VSCROLL | WS_TABSTOP
+    PUSHBUTTON      "Calibrate",IDC_SOUNDCALIBRATE,183,223,40,14
 END
 
 IDD_LOADSAVE DIALOGEX 0, 0, 302, 241
@@ -371,14 +371,22 @@ BEGIN
     CONTROL         "",IDC_CONFIGTREE,"SysTreeView32",TVS_HASLINES | 
                     TVS_DISABLEDRAGDROP | TVS_SHOWSELALWAYS | WS_BORDER | 
                     WS_TABSTOP,6,3,289,153,WS_EX_CLIENTEDGE
+    RTEXT           "Name:",IDC_STATIC,0,161,40,15,SS_CENTERIMAGE
+    EDITTEXT        IDC_EDITNAME,44,162,150,13,ES_AUTOHSCROLL,0,
+                    HIDC_EDITNAME
     RTEXT           "Description:",IDC_STATIC,4,183,37,15,SS_CENTERIMAGE
     EDITTEXT        IDC_EDITDESCRIPTION,44,183,150,13,ES_AUTOHSCROLL,0,
                     HIDC_EDITDESCRIPTION
+    RTEXT           "Link:",IDC_STATIC,0,204,40,15,SS_CENTERIMAGE
+    COMBOBOX        IDC_CONFIGLINK,44,205,97,150,CBS_DROPDOWN | 
+                    CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+    CONTROL         "Ignore link",IDC_CONFIGNOLINK,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,146,206,48,10
     EDITTEXT        IDC_EDITPATH,199,161,49,15,ES_AUTOHSCROLL | WS_DISABLED,
                     0,HIDC_EDITPATH
-    RTEXT           "Name:",IDC_STATIC,0,161,40,15,SS_CENTERIMAGE
-    EDITTEXT        IDC_EDITNAME,44,162,150,13,ES_AUTOHSCROLL,0,
-                    HIDC_EDITNAME
+    CONTROL         "Autoload",IDC_CONFIGAUTO,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,253,163,42,10
+    GROUPBOX        "Extra info",IDC_STATIC,199,179,96,38,BS_LEFT
     PUSHBUTTON      "View",IDC_VIEWINFO,210,195,35,15
     PUSHBUTTON      "Set",IDC_SETINFO,250,195,35,15
     PUSHBUTTON      "Load",IDC_QUICKLOAD,5,225,40,15
@@ -386,14 +394,6 @@ BEGIN
     PUSHBUTTON      "Load From...",IDC_LOAD,125,225,45,15
     PUSHBUTTON      "Save As...",IDC_SAVE,175,225,40,15
     PUSHBUTTON      "Delete",IDC_DELETE,255,225,40,15
-    CONTROL         "Autoload",IDC_CONFIGAUTO,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,253,163,42,10
-    COMBOBOX        IDC_CONFIGLINK,44,205,97,150,CBS_DROPDOWN | 
-                    CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
-    RTEXT           "Link:",IDC_STATIC,0,204,40,15,SS_CENTERIMAGE
-    GROUPBOX        "Extra info",IDC_STATIC,199,179,96,38,BS_LEFT
-    CONTROL         "Ignore link",IDC_CONFIGNOLINK,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,146,206,48,10
 END
 
 IDD_PORTS DIALOGEX 0, 0, 300, 194
@@ -515,6 +515,8 @@ BEGIN
                     WS_TABSTOP,29,51,115,10
     CONTROL         "UAEscsi.device",IDC_SCSIDEVICE,"Button",BS_AUTOCHECKBOX | 
                     WS_TABSTOP,29,66,117,10
+    CONTROL         "Don't show Taskbar button",IDC_NOTASKBARBUTTON,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,29,80,117,10
     CONTROL         "BSDsocket.library emulation",IDC_SOCKETS,"Button",
                     BS_AUTOCHECKBOX | WS_TABSTOP,159,21,120,10
     CONTROL         "Use CTRL-F11 to quit",IDC_CTRLF11,"Button",
@@ -523,6 +525,8 @@ BEGIN
                     BS_AUTOCHECKBOX | WS_TABSTOP,159,51,120,10
     CONTROL         "Use ASPI SCSI layer",IDC_ASPI,"Button",BS_AUTOCHECKBOX | 
                     WS_TABSTOP,159,66,115,10
+    CONTROL         "Syncronize clock",IDC_CLOCKSYNC,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,159,80,115,10
     GROUPBOX        "Keyboard LEDs:",IDC_STATIC,7,99,85,73
     COMBOBOX        IDC_KBLED1,22,112,56,65,CBS_DROPDOWNLIST | WS_VSCROLL | 
                     WS_TABSTOP
@@ -549,10 +553,6 @@ BEGIN
                     182,83,10,SS_CENTERIMAGE | WS_TABSTOP
     COMBOBOX        IDC_STATE_BUFFERSIZE,248,180,38,65,CBS_DROPDOWN | 
                     WS_VSCROLL | WS_TABSTOP
-    CONTROL         "Don't show Taskbar button",IDC_NOTASKBARBUTTON,"Button",
-                    BS_AUTOCHECKBOX | WS_TABSTOP,29,80,117,10
-    CONTROL         "Syncronize clock",IDC_CLOCKSYNC,"Button",
-                    BS_AUTOCHECKBOX | WS_TABSTOP,159,80,115,10
 END
 
 IDD_HARDFILE DIALOGEX 0, 0, 299, 180
@@ -568,27 +568,27 @@ BEGIN
     RTEXT           "FileSys:",IDC_HARDFILE_FILESYS_TEXT,16,36,26,10
     EDITTEXT        IDC_PATH_FILESYS,44,34,221,15,ES_AUTOHSCROLL
     PUSHBUTTON      "...",IDC_FILESYS_SELECTOR,271,34,11,15
-    CONTROL         "Read/Write",IDC_RW,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,110,57,50,10
     RTEXT           "Device:",IDC_HARDFILE_DEVICE_TEXT,16,58,25,10
     EDITTEXT        IDC_HARDFILE_DEVICE,44,54,40,15,ES_AUTOHSCROLL
+    RTEXT           "BootPri:",IDC_HARDFILE_BOOTPRI_TEXT,11,80,30,8
+    EDITTEXT        IDC_HARDFILE_BOOTPRI,44,75,40,15
+    CONTROL         "Read/Write",IDC_RW,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,110,57,50,10
+    PUSHBUTTON      "Enable RDB-mode",IDC_HDF_RDB,192,55,92,14
     RTEXT           "Surfaces:",IDC_SURFACES_TEXT,112,79,30,10
     EDITTEXT        IDC_HEADS,147,75,35,15,ES_NUMBER
     RTEXT           "Reserved:",IDC_RESERVED_TEXT,197,79,35,10
     EDITTEXT        IDC_RESERVED,237,75,35,15,ES_NUMBER
-    RTEXT           "BootPri:",IDC_HARDFILE_BOOTPRI_TEXT,11,80,30,8
-    EDITTEXT        IDC_HARDFILE_BOOTPRI,44,75,40,15
     RTEXT           "Sectors:",IDC_SECTORS_TEXT,112,101,30,10
     EDITTEXT        IDC_SECTORS,147,96,35,15,ES_NUMBER
     RTEXT           "Block-Size:",IDC_BLOCKSIZE_TEXT,197,101,35,10
     EDITTEXT        IDC_BLOCKSIZE,237,96,35,15,ES_NUMBER
     GROUPBOX        "New Hard File",IDC_STATIC,10,120,280,35
-    PUSHBUTTON      "Enable RDB-mode",IDC_HDF_RDB,192,55,92,14
+    PUSHBUTTON      "Create",IDC_CREATEHF,40,135,85,14
     EDITTEXT        IDC_HFSIZE,141,135,61,15,ES_NUMBER
     LTEXT           "MB",IDC_RESERVED_TEXT2,214,138,39,9,NOT WS_GROUP
     PUSHBUTTON      "OK",IDOK,102,161,50,14
     PUSHBUTTON      "Cancel",IDCANCEL,158,161,50,14
-    PUSHBUTTON      "Create",IDC_CREATEHF,40,135,85,14
 END
 
 IDD_FILESYS DIALOGEX 15, 25, 299, 111
@@ -762,28 +762,28 @@ BEGIN
     RTEXT           "Horizontal Size",-1,25,44,57,10,SS_CENTERIMAGE
     CONTROL         "Slider1",IDC_FILTERHZ,"msctls_trackbar32",TBS_AUTOTICKS | 
                     TBS_TOP | WS_TABSTOP,89,37,158,19
+    EDITTEXT        IDC_FILTERHZV,248,40,34,12,ES_CENTER | ES_READONLY
     RTEXT           "Vertical Size",-1,26,64,57,10,SS_CENTERIMAGE
     CONTROL         "Slider1",IDC_FILTERVZ,"msctls_trackbar32",TBS_AUTOTICKS | 
                     TBS_TOP | WS_TABSTOP,89,57,157,19
+    EDITTEXT        IDC_FILTERVZV,248,59,34,12,ES_CENTER | ES_READONLY
     RTEXT           "Horizontal Position",-1,26,84,57,10,SS_CENTERIMAGE
     CONTROL         "Slider1",IDC_FILTERHO,"msctls_trackbar32",TBS_AUTOTICKS | 
                     TBS_TOP | WS_TABSTOP,89,77,157,19
+    EDITTEXT        IDC_FILTERHOV,248,79,34,12,ES_CENTER | ES_READONLY
     RTEXT           "Vertical Position",-1,26,103,57,10,SS_CENTERIMAGE
     CONTROL         "Slider1",IDC_FILTERVO,"msctls_trackbar32",TBS_AUTOTICKS | 
                     TBS_TOP | WS_TABSTOP,89,97,157,19
+    EDITTEXT        IDC_FILTERVOV,248,101,34,12,ES_CENTER | ES_READONLY
     RTEXT           "Scanlines",-1,27,133,57,10,SS_CENTERIMAGE
     CONTROL         "Slider1",IDC_FILTERSL,"msctls_trackbar32",TBS_AUTOTICKS | 
                     TBS_TOP | WS_TABSTOP,89,126,157,19
+    EDITTEXT        IDC_FILTERSLV,248,128,34,12,ES_CENTER | ES_READONLY
     COMBOBOX        IDC_FILTERSLR,56,146,27,150,CBS_DROPDOWNLIST | 
                     CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
     CONTROL         "Slider1",IDC_FILTERSL2,"msctls_trackbar32",
                     TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,89,146,157,19
     EDITTEXT        IDC_FILTERSL2V,248,151,34,12,ES_CENTER | ES_READONLY
-    EDITTEXT        IDC_FILTERSLV,248,128,34,12,ES_CENTER | ES_READONLY
-    EDITTEXT        IDC_FILTERVOV,248,101,34,12,ES_CENTER | ES_READONLY
-    EDITTEXT        IDC_FILTERHOV,248,79,34,12,ES_CENTER | ES_READONLY
-    EDITTEXT        IDC_FILTERVZV,248,59,34,12,ES_CENTER | ES_READONLY
-    EDITTEXT        IDC_FILTERHZV,248,40,34,12,ES_CENTER | ES_READONLY
     GROUPBOX        "Presets",-1,0,176,296,36
     COMBOBOX        IDC_FILTERPRESETS,8,190,119,150,CBS_DROPDOWN | CBS_SORT | 
                     CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
@@ -887,6 +887,10 @@ BEGIN
                     SS_CENTERIMAGE
     EDITTEXT        IDC_PATHS_SAVESTATE,14,114,261,15,ES_AUTOHSCROLL
     PUSHBUTTON      "...",IDC_PATHS_SAVESTATES,281,114,11,15
+    LTEXT           "Video path:",IDC_PATHS_AVIOUTPUTL,14,132,260,8,
+                    SS_CENTERIMAGE
+    EDITTEXT        IDC_PATHS_AVIOUTPUT,14,144,261,15,ES_AUTOHSCROLL
+    PUSHBUTTON      "...",IDC_PATHS_AVIOUTPUTS,282,144,11,15
     LTEXT           "Saveimage path:",IDC_PATHS_SAVEIMAGEL,14,163,260,8,
                     SS_CENTERIMAGE
     EDITTEXT        IDC_PATHS_SAVEIMAGE,14,175,261,15,ES_AUTOHSCROLL
@@ -894,10 +898,6 @@ BEGIN
     PUSHBUTTON      "Reset to defaults",IDC_PATHS_DEFAULT,13,199,73,14
     PUSHBUTTON      "Rescan ROMs",IDC_ROM_RESCAN,97,199,73,14
     PUSHBUTTON      "Clear registry",IDC_RESETREGISTRY,219,199,73,14
-    LTEXT           "Video path:",IDC_PATHS_AVIOUTPUTL,14,132,260,8,
-                    SS_CENTERIMAGE
-    EDITTEXT        IDC_PATHS_AVIOUTPUT,14,144,261,15,ES_AUTOHSCROLL
-    PUSHBUTTON      "...",IDC_PATHS_AVIOUTPUTS,282,144,11,15
 END
 
 IDD_QUICKSTART DIALOGEX 0, 0, 300, 242
@@ -912,8 +912,18 @@ BEGIN
     RTEXT           "Configuration:",IDC_STATIC,5,33,56,10,SS_CENTERIMAGE
     COMBOBOX        IDC_QUICKSTART_CONFIGURATION,65,31,225,50,
                     CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+    GROUPBOX        "Compatibility vs required CPU power ",
+                    IDC_QUICKSTART_COMPA,3,56,294,33
     RTEXT           "Best compatibility",IDC_STATIC,13,70,67,10,
                     SS_CENTERIMAGE
+    CONTROL         "",IDC_QUICKSTART_COMPATIBILITY,"msctls_trackbar32",
+                    TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,88,65,115,21
+    RTEXT           "Low compatibility",IDC_STATIC,215,70,63,10,
+                    SS_CENTERIMAGE
+    GROUPBOX        "Host configuration",IDC_QUICKSTART_HOST,3,91,294,33
+    RTEXT           "Configuration:",IDC_STATIC,5,105,55,10,SS_CENTERIMAGE
+    COMBOBOX        IDC_QUICKSTART_HOSTCONFIG,65,103,225,50,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
     GROUPBOX        "Disk Drives",IDC_QUICKSTART_DF,3,126,294,84
     LTEXT           "Disk Drive DF0:",IDC_STATIC,10,138,56,10,SS_CENTERIMAGE
     PUSHBUTTON      "Select Disk Image",IDC_DF0QQ,77,135,98,15
@@ -924,30 +934,20 @@ BEGIN
     PUSHBUTTON      "Eject",IDC_EJECT0Q,260,136,30,15
     COMBOBOX        IDC_DF0TEXTQ,9,154,282,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | 
                     WS_VSCROLL | WS_TABSTOP
-    COMBOBOX        IDC_DF1TEXTQ,9,190,282,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | 
-                    WS_VSCROLL | WS_TABSTOP
-    CONTROL         "",IDC_DF1WPQ,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | 
-                    WS_TABSTOP,245,173,10,15
-    PUSHBUTTON      "Eject",IDC_EJECT1Q,260,172,30,15
-    CONTROL         "Start in Quickstart-mode",IDC_QUICKSTARTMODE,"Button",
-                    BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,199,222,94,10
-    COMBOBOX        IDC_QUICKSTART_HOSTCONFIG,65,103,225,50,CBS_DROPDOWNLIST | 
-                    WS_VSCROLL | WS_TABSTOP
-    GROUPBOX        "Host configuration",IDC_QUICKSTART_HOST,3,91,294,33
-    RTEXT           "Configuration:",IDC_STATIC,5,105,55,10,SS_CENTERIMAGE
     LTEXT           "Disk Drive DF1:",IDC_STATIC,10,176,56,10,SS_CENTERIMAGE
     PUSHBUTTON      "Select Disk Image",IDC_DF1QQ,77,172,98,15
     RTEXT           "Write Protected",IDC_STATIC,180,175,58,10,
                     SS_CENTERIMAGE
-    CONTROL         "",IDC_QUICKSTART_COMPATIBILITY,"msctls_trackbar32",
-                    TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,88,65,115,21
-    RTEXT           "Low compatibility",IDC_STATIC,215,70,63,10,
-                    SS_CENTERIMAGE
-    GROUPBOX        "Compatibility vs required CPU power ",
-                    IDC_QUICKSTART_COMPA,3,56,294,33
-    GROUPBOX        "Mode",IDC_STATIC,190,211,107,27,BS_LEFT
+    CONTROL         "",IDC_DF1WPQ,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | 
+                    WS_TABSTOP,245,173,10,15
+    PUSHBUTTON      "Eject",IDC_EJECT1Q,260,172,30,15
+    COMBOBOX        IDC_DF1TEXTQ,9,190,282,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | 
+                    WS_VSCROLL | WS_TABSTOP
     PUSHBUTTON      "Set Configuration",IDC_QUICKSTART_SETCONFIG,9,219,72,15,
                     NOT WS_VISIBLE
+    GROUPBOX        "Mode",IDC_STATIC,190,211,107,27,BS_LEFT
+    CONTROL         "Start in Quickstart-mode",IDC_QUICKSTARTMODE,"Button",
+                    BS_AUTOCHECKBOX | BS_LEFT | WS_TABSTOP,199,222,94,10
 END
 
 
@@ -1390,7 +1390,7 @@ END
 
 STRINGTABLE 
 BEGIN
-    IDS_QS_MODELS           "Amiga 500 (Amiga 2000)\nAmiga 500+\nAmiga 600\nAmiga 1000\nAmiga 1200\nCD32\nCDTV (CDROM emulation not yet working)\nExpanded UAE example configuration"
+    IDS_QS_MODELS           "Amiga 500 / Amiga 2000\nAmiga 500+\nAmiga 600\nAmiga 1000\nAmiga 1200\nCD32\nCDTV (CDROM emulation not yet working)\nExpanded UAE example configuration"
     IDS_QS_MODEL_A500       "KS 1.3, OCS Agnus, 0.5M Chip + 0.5M Slow (most common)\nThis configuration is capable of running most games and demos ever produced for the first Amiga line. Only few exceptions need different configuration. Oldest Amiga games tend to be incompatible with this configuration.\nKS 1.3, ECS Agnus, 0.5M Chip + 0.5M Slow\nLater hardware revision of Amiga 500. Nearly 100% compatible with previous configuration.\nKS 1.3, ECS Agnus, 1.0M Chip\nFew newer games and demos require this configuration.\nKS 1.3, OCS Agnus, 0.5M Chip\nVery old (~1987 and older) games and demos may require this configuration.\nKS 1.2, OCS Agnus, 0.5M Chip\nThe first Amiga 500 produced had this configuration. Some very old programs only work correctly with this configuration. NOTE: This configuration cannot boot the Amiga OS installed on an emulated HD.\nKS 1.2, OCS Agnus, 0.5M Chip + 0.5M Slow\nThis configuration adds expansion memory to the first Amiga 500 ever produced. Try this if your game do not work with newer configurations but works with the previous one. It could add some features to the game and faster game loading. NOTE: This configuration cannot boot the Amiga OS installed on an emulated HD."
     IDS_QS_MODEL_A500P      "Basic non-expanded configuration\nA500+ is basically an Amiga 500 with ECS Agnus,  1MB of Chip RAM and Kickstart 2.0 ROM. Many Amiga 500 games and demos won't work properly on an Amiga 500+.\n2M Chip RAM expanded configuration\n\n4M Fast RAM expanded configuration\n"
     IDS_QS_MODEL_A600       "Basic non-expanded configuration\nA600 is basically smaller Amiga 500+ with updated Kickstart 2.0 ROM.\n2M Chip RAM expanded configuration\n\n4M Fast RAM expanded configuration\n"
index dbda486cfe7798047c300643ca4852df3e2156c8..1d67a0b38e30ee264cfcc1a2d59c83dc918f0385 100755 (executable)
@@ -581,6 +581,7 @@ static long FAR PASCAL AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam,
     {
     case WM_SIZE:
     {
+       write_log ("WM_SIZE %d %d\n", wParam, minimized);
        if (isfullscreen ()) {
            v = minimized;
            switch (wParam)
@@ -605,6 +606,7 @@ static long FAR PASCAL AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam,
     }
            
     case WM_ACTIVATE:
+       write_log ("WM_ACTIVE %d %d %d\n", HIWORD (wParam), LOWORD (wParam), minimized);
        if (!isfullscreen ()) {
            minimized = HIWORD (wParam);
            if (LOWORD (wParam) != WA_INACTIVE) {
@@ -615,14 +617,14 @@ static long FAR PASCAL AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam,
                winuae_inactive (hWnd, minimized);
            }
            return 0;
-       } else if (LOWORD (wParam) == WA_INACTIVE) {
-           minimized = 1;
-           if (isfullscreen ())
+       } else {
+           if (LOWORD (wParam) == WA_INACTIVE) {
+               minimized = HIWORD (wParam);
                winuae_inactive (hWnd, minimized);
-           if (ignorenextactivateapp > 0)
-               ignorenextactivateapp--;
-       } else if (!minimized && LOWORD (wParam) != WA_INACTIVE) {
-           winuae_active (hWnd, minimized);
+           } else {
+               if (!minimized)
+                   winuae_active (hWnd, minimized);
+           }
            if (ignorenextactivateapp > 0)
                ignorenextactivateapp--;
            return 0;
@@ -630,15 +632,15 @@ static long FAR PASCAL AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam,
        break;
 
     case WM_ACTIVATEAPP:
+       write_log ("WM_ACTIVATEAPP %d %d\n", wParam, minimized);
        if (!wParam) {
            if (gui_active && isfullscreen())
                exit_gui (0);
            setmouseactive (0);
        } else {
-           if (minimized) {
+           if (minimized)
                minimized = 0;
-               winuae_active (hWnd, minimized);
-           }   
+           winuae_active (hWnd, minimized);
            if (!ignorenextactivateapp && isfullscreen () && is3dmode ()) {
                WIN32GFX_DisplayChangeRequested ();
                ignorenextactivateapp = 3;
@@ -681,13 +683,22 @@ static long FAR PASCAL AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam,
            setmousebuttonstate (dinput_winmouse(), 1, 1);
     return 0;
     case WM_MBUTTONUP:
-       if (dinput_winmouse () >= 0)
-           setmousebuttonstate (dinput_winmouse(), 2, 0);
+       if (!currprefs.win32_middle_mouse) {
+           if (dinput_winmouse () >= 0)
+               setmousebuttonstate (dinput_winmouse(), 2, 0);
+       }
     return 0;
     case WM_MBUTTONDOWN:
     case WM_MBUTTONDBLCLK:
-       if (dinput_winmouse () >= 0)
-           setmousebuttonstate (dinput_winmouse(), 2, 1);
+       if (currprefs.win32_middle_mouse) {
+           if (isfullscreen ())
+               minimizewindow ();
+           if (mouseactive)
+               setmouseactive(0);
+       } else {
+           if (dinput_winmouse () >= 0)
+               setmousebuttonstate (dinput_winmouse(), 2, 1);
+       }
     return 0;
     case WM_XBUTTONUP:
        if (dinput_winmouse () >= 0) {
@@ -743,7 +754,7 @@ static long FAR PASCAL AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam,
     return 0;
 
     case WM_WINDOWPOSCHANGED:
-       GetWindowRecthWnd, &amigawin_rect);
+       GetWindowRect (hWnd, &amigawin_rect);
     break;
 
     case WM_MOUSEMOVE:
@@ -838,7 +849,40 @@ static long FAR PASCAL AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam,
     handle_rawinput (lParam);
     break;
     
-     case WM_USER + 1: /* Systray icon */
+    case WM_NOTIFY:
+    {
+        LPNMHDR nm = (LPNMHDR)lParam;
+        if (nm->hwndFrom == hStatusWnd) {
+           switch (nm->code)
+           {
+               /* status bar clicks */
+               case NM_CLICK:
+               case NM_RCLICK:
+               {
+                   LPNMMOUSE lpnm = (LPNMMOUSE) lParam; 
+                   int num = lpnm->dwItemSpec;
+                   if (num >= 6 && num <= 9) {
+                       num -= 6;
+                       if (nm->code == NM_RCLICK) {
+                           disk_eject (num);
+                       } else {
+                           DiskSelection (hWnd, IDC_DF0 + num, 0, &changed_prefs, 0);
+                           disk_insert (num, changed_prefs.df[num]);
+                       }
+                   } else if (num == 3) {
+                       if (nm->code == NM_CLICK)
+                           gui_display (-1);
+                       else
+                           uae_reset (0);
+                   }
+                   return TRUE;
+               }
+           }
+       }
+    }
+    break;
+    
+    case WM_USER + 1: /* Systray icon */
         switch (lParam)
         {
            case WM_LBUTTONDOWN:
@@ -946,6 +990,7 @@ static long FAR PASCAL MainWindowProc (HWND hWnd, UINT message, WPARAM wParam, L
      case 0xff: // WM_INPUT
      case WM_USER + 1:
      case WM_COMMAND:
+     case WM_NOTIFY:
        return AmigaWindowProc (hWnd, message, wParam, lParam);
 
      case WM_DISPLAYCHANGE:
index f36d171cbfaa4ec89c4ae34e0a1c8a777d1d9fd5..d203e6753397bf81555daa07bce3ef24a81c901e 100755 (executable)
@@ -21,7 +21,7 @@ extern int manual_painting_needed;
 extern int manual_palette_refresh_needed;
 extern int mouseactive, focus;
 #define WINUAEBETA 1
-#define WINUAEBETASTR " Beta 12"
+#define WINUAEBETASTR " Beta 13"
 
 extern void my_kbd_handler (int, int, int);
 extern void clearallkeys(void);
index b06d77b37d7a31c952403550f8272e44aba3c048..d9625901e17855cedb73c77ac02f2502f5db8fd0 100755 (executable)
@@ -889,9 +889,9 @@ static void close_hwnds( void )
 #endif
     setmouseactive (0);
     if (hMainWnd)
-       systray(hMainWnd, TRUE);
+       systray (hMainWnd, TRUE);
     if (hStatusWnd) {
-        ShowWindow( hStatusWnd, SW_HIDE );
+        ShowWindow (hStatusWnd, SW_HIDE);
        DestroyWindow (hStatusWnd);
     }
     if (hAmigaWnd) {
@@ -1617,7 +1617,10 @@ static void createstatuswindow (void)
     int num_parts = 10;
     double scaleX, scaleY;
 
-    hStatusWnd = CreateStatusWindow (WS_CHILD | WS_VISIBLE, "", hMainWnd, 1);
+    
+    hStatusWnd = CreateWindowEx(
+       0, STATUSCLASSNAME, (LPCTSTR) NULL, SBT_TOOLTIPS | WS_CHILD | WS_VISIBLE,
+        0, 0, 0, 0, hMainWnd, (HMENU) 1, hInst, NULL);
     if (!hStatusWnd)
        return;
 
index 0a93d13dd4a19cf461b50e229ce03824f1cf184f..81a6c720496c0669483a8cc33465d7731fe19641 100755 (executable)
@@ -2670,6 +2670,8 @@ static BOOL CALLBACK QuickstartDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPAR
            pages[QUICKSTART_ID] = hDlg;
            currentpage = QUICKSTART_ID;
            enable_for_quickstart (hDlg);
+           strcpy (df0, workprefs.df[0]);
+           strcpy (df1, workprefs.df[1]);
            doinit = 1;
            break;
        case WM_NULL:
@@ -2780,7 +2782,7 @@ static BOOL CALLBACK QuickstartDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPAR
        recursive--;
        break;
     }
-    if (recursive == 0) {
+    if (recursive == 0 && quickstart) {
        recursive++;
        if (strcmp (workprefs.df[0], df0) || workprefs.dfxtype[0] != dfxtype[0]) {
            strcpy (df0, workprefs.df[0]);
@@ -5439,7 +5441,7 @@ static void addfloppytype (HWND hDlg, int n)
     chk = disk_getwriteprotect (workprefs.df[n]) && state == TRUE ? BST_CHECKED : 0;
     if (f_wp >= 0)
        CheckDlgButton(hDlg, f_wp, chk);
-    chk = state && DISK_validate_filename (workprefs.df[n], 0, 0) ? TRUE : FALSE;
+    chk = state && DISK_validate_filename (workprefs.df[n], 0, NULL, NULL) ? TRUE : FALSE;
     if (f_wp >= 0)
        EnableWindow(GetDlgItem(hDlg, f_wp), chk);
  
@@ -5887,7 +5889,7 @@ static void updatejoyport (HWND hDlg)
     if (joy1previous < 0)
        joy1previous = 1;
     for (i = 0; i < 2; i++) {
-       int total = 0;
+       int total = 1;
        int idx = i == 0 ? joy0previous : joy1previous;
        int id1 = i == 0 ? IDC_PORT0_JOYS : IDC_PORT1_JOYS;
        int id2 = i == 0 ? IDC_PORT0_JOYSC : IDC_PORT1_JOYSC;
@@ -7868,43 +7870,60 @@ void gui_led (int led, int on)
 {
     WORD type;
     static char drive_text[NUM_LEDS * 16];
-    char *ptr;
-    int pos = -1;
+    static char dfx[4][300];
+    char *ptr, *tt, *p;
+    int pos = -1, j;
 
     indicator_leds (led, on);
-    if( hStatusWnd )
-    {
-        if (on)
-           type = SBT_POPOUT;
+    if (!hStatusWnd)
+       return;
+    if (on)
+        type = SBT_POPOUT;
+    else
+        type = 0;
+    tt = NULL;
+    if (led >= 1 && led <= 4) {
+        pos = 5 + (led - 1);
+        ptr = drive_text + pos * 16;
+        if (gui_data.drive_disabled[led - 1])
+           strcpy (ptr, "");
        else
-           type = 0;
-       if (led >= 1 && led <= 4) {
-           pos = 5 + (led - 1);
-           ptr = drive_text + pos * 16;
-           if (gui_data.drive_disabled[led - 1])
-               strcpy (ptr, "");
-           else
-               sprintf (ptr , "%02d", gui_data.drive_track[led - 1]);
-       } else if (led == 0) {
-           pos = 2;
-           ptr = strcpy (drive_text + pos * 16, "Power");
-       } else if (led == 5) {
-           pos = 3;
-           ptr = strcpy (drive_text + pos * 16, "HD");
-       } else if (led == 6) {
-           pos = 4;
-           ptr = strcpy (drive_text + pos * 16, "CD");
-       } else if (led == 7) {
-           pos = 1;
-           ptr = drive_text + pos * 16;
-           sprintf(ptr, "FPS: %.1f", (double)((gui_data.fps + 5) / 10.0));
-       } else if (led == 8) {
-           pos = 0;
-           ptr = drive_text + pos * 16;
-           sprintf(ptr, "CPU: %.0f%%", (double)((gui_data.idle) / 10.0));
-       }
-       if (pos >= 0)
-           PostMessage (hStatusWnd, SB_SETTEXT, (WPARAM) ((pos + 1) | type), (LPARAM) ptr);
+           sprintf (ptr , "%02d  .", gui_data.drive_track[led - 1]);
+        p = gui_data.df[led - 1];
+        j = strlen (p) - 1;
+       if (j < 0)
+           j = 0;
+       while (j > 0) {
+           if (p[j - 1] == '\\' || p[j - 1] == '/')
+               break;
+           j--;
+       }
+        tt = dfx[led - 1]; 
+        tt[0] = 0;
+       if (strlen (p + j) > 0)
+           sprintf (tt, "%s (CRC=%08.8X)", p + j, gui_data.crc32[led - 1]);
+    } else if (led == 0) {
+        pos = 2;
+        ptr = strcpy (drive_text + pos * 16, "Power");
+    } else if (led == 5) {
+        pos = 3;
+        ptr = strcpy (drive_text + pos * 16, "HD");
+    } else if (led == 6) {
+        pos = 4;
+        ptr = strcpy (drive_text + pos * 16, "CD");
+    } else if (led == 7) {
+       pos = 1;
+       ptr = drive_text + pos * 16;
+       sprintf(ptr, "FPS: %.1f", (double)((gui_data.fps + 5) / 10.0));
+    } else if (led == 8) {
+        pos = 0;
+        ptr = drive_text + pos * 16;
+        sprintf(ptr, "CPU: %.0f%%", (double)((gui_data.idle) / 10.0));
+    }
+    if (pos >= 0) {
+        PostMessage (hStatusWnd, SB_SETTEXT, (WPARAM) ((pos + 1) | type), (LPARAM) ptr);
+        if (tt != NULL)
+           PostMessage (hStatusWnd, SB_SETTIPTEXT, (WPARAM) (pos + 1), (LPARAM) tt);
     }
 }