]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
2400b25
authorToni Wilen <twilen@winuae.net>
Sat, 24 Mar 2012 13:36:59 +0000 (15:36 +0200)
committerToni Wilen <twilen@winuae.net>
Sat, 24 Mar 2012 13:36:59 +0000 (15:36 +0200)
archivers/dms/crc_csum.cpp
archivers/dms/pfile.cpp
filesys.cpp
hardfile.cpp
include/filesys.h
isofs.cpp
od-win32/direct3d.cpp
od-win32/rp.cpp
od-win32/win32.h
od-win32/win32gui.cpp
od-win32/winuaechangelog.txt

index 8147c5b5fff56e6848a7a710d82db39a1111517b..d6baefe0e7fb48ddc91ce7e97fb5055c20f58b0d 100644 (file)
@@ -24,7 +24,7 @@ USHORT dms_Calc_CheckSum(UCHAR *mem, ULONG size){
 
 
 USHORT dms_CreateCRC(UCHAR* mem, ULONG size ){
-       static USHORT CRCTab[256]={
+       static const USHORT CRCTab[256]={
                0x0000,0xC0C1,0xC181,0x0140,0xC301,0x03C0,0x0280,0xC241,
                0xC601,0x06C0,0x0780,0xC741,0x0500,0xC5C1,0xC481,0x0440,
                0xCC01,0x0CC0,0x0D80,0xCD41,0x0F00,0xCFC1,0xCE81,0x0E40,
index 5112a98b2647da9accabe2b85d0250536a04f138..d02cd9c3b83520079fc21398f5ab419370af0b33 100644 (file)
@@ -242,6 +242,7 @@ USHORT DMS_Process_File(struct zfile *fi, struct zfile *fo, USHORT cmd, USHORT o
                if (cmd == CMD_SHOWBANNER) /*  Banner is in the first track  */
                        ret = Process_Track(fi,NULL,b1,b2,cmd,opt,geninfo,extra);
                else {
+                       Init_Decrunchers();
                        for (;;) {
                                int ok = 0;
                                ret = Process_Track(fi,fo,b1,b2,cmd,opt,geninfo,extra);
@@ -299,6 +300,7 @@ static USHORT Process_Track(struct zfile *fi, struct zfile *fo, UCHAR *b1, UCHAR
        USHORT hcrc, dcrc, usum, number, pklen1, pklen2, unpklen, l;
        UCHAR cmode, flags;
        int crcerr = 0;
+       bool normaltrack;
 
 
        l = (USHORT)zfile_fread(b1,1,THLEN,fi);
@@ -357,10 +359,12 @@ static USHORT Process_Track(struct zfile *fi, struct zfile *fo, UCHAR *b1, UCHAR
 
        //if (pwd && (number!=80)) dms_decrypt(b1,pklen1);
 
+       normaltrack = false;
        if ((cmd == CMD_UNPACK) && (number<80) && (unpklen>2048)) {
                memset(b2, 0, unpklen);
-               if (!crcerr)
+               if (!crcerr) {
                        Unpack_Track(b1, b2, pklen2, unpklen, cmode, flags, number, pklen1, usum, dmsflags & DMSFLAG_ENCRYPTED);
+               }
                if (number == 0 && zfile_ftell (fo) == 512 * 22) {
                        // did we have another cylinder 0 already?
                        uae_u8 *p;
@@ -373,6 +377,7 @@ static USHORT Process_Track(struct zfile *fi, struct zfile *fo, UCHAR *b1, UCHAR
                zfile_fseek (fo, number * 512 * 22 * ((dmsflags & DMSFLAG_HD) ? 2 : 1), SEEK_SET);
                if (zfile_fwrite(b2,1,(size_t)unpklen,fo) != unpklen)
                        return ERR_CANTWRITE;
+               normaltrack = true;
        } else if (number == 0 && unpklen == 1024) {
                memset(b2, 0, unpklen);
                if (!crcerr)
@@ -383,18 +388,25 @@ static USHORT Process_Track(struct zfile *fi, struct zfile *fo, UCHAR *b1, UCHAR
        if (crcerr)
                return NO_PROBLEM;
 
-       if (number == 0xffff && extra){
-               Unpack_Track(b1, b2, pklen2, unpklen, cmode, flags, number, pklen1, usum, dmsflags & DMSFLAG_ENCRYPTED);
-               addextra(L"Banner", extra, b2, unpklen);
+       if (number == 0xffff) {
+               if (extra){
+                       Unpack_Track(b1, b2, pklen2, unpklen, cmode, flags, number, pklen1, usum, dmsflags & DMSFLAG_ENCRYPTED);
+                       addextra(L"Banner", extra, b2, unpklen);
+               }
                //printbandiz(b2,unpklen);
        }
 
-       if (number == 80 && extra) {
-               Unpack_Track(b1, b2, pklen2, unpklen, cmode, flags, number, pklen1, usum, dmsflags & DMSFLAG_ENCRYPTED);
-               addextra(L"FILEID.DIZ", extra, b2, unpklen);
+       if (number == 80) {
+               if (extra) {
+                       Unpack_Track(b1, b2, pklen2, unpklen, cmode, flags, number, pklen1, usum, dmsflags & DMSFLAG_ENCRYPTED);
+                       addextra(L"FILEID.DIZ", extra, b2, unpklen);
+               }
                //printbandiz(b2,unpklen);
        }
 
+       if (!normaltrack)
+               Init_Decrunchers();
+
        return NO_PROBLEM;
 
 }
@@ -440,6 +452,7 @@ static USHORT Unpack_Track_2(UCHAR *b1, UCHAR *b2, USHORT pklen2, USHORT unpklen
                                if (Unpack_HEAVY(b1,b2,flags | 8,pklen2)) return ERR_BADDECR;
                        }
                        if (flags & 4) {
+                               memset(b1,0,unpklen);
                                /*  Unpack with RLE only if this flag is set  */
                                if (Unpack_RLE(b2,b1,unpklen)) return ERR_BADDECR;
                                memcpy(b2,b1,(size_t)unpklen);
index e5714cd23bd60d24e1f2df9ccaf15b693329356b..43cc12de2ad9577133fff7c75effbd4d477677d7 100644 (file)
@@ -1052,13 +1052,17 @@ static struct fs_dirhandle *fs_opendir (Unit *u, a_inode *aino)
        fsd->fstype = (u->volflags & MYVOLUMEINFO_ARCHIVE) ? FS_ARCHIVE : ((u->volflags & MYVOLUMEINFO_CDFS) ? FS_CDFS : FS_DIRECTORY);
        if (fsd->fstype == FS_ARCHIVE) {
                fsd->zd = zfile_opendir_archive (aino->nname);
+               if (fsd->zd)
+                       return fsd;
        } else if (fsd->fstype == FS_DIRECTORY) {
                fsd->od = my_opendir (aino->nname);
+               if (fsd->od)
+                       return fsd;
        } else if (fsd->fstype == FS_CDFS) {
                fsd->isod = isofs_opendir (u->ui.cdfs_superblock, aino->uniq_external);
+               if (fsd->isod)
+                       return fsd;
        }
-       if (fsd)
-               return fsd;
        xfree (fsd);
        return NULL;
 }
@@ -1080,26 +1084,32 @@ static struct fs_filehandle *fs_openfile (Unit *u, a_inode *aino, int flags)
        fsf->fstype = (u->volflags & MYVOLUMEINFO_ARCHIVE) ? FS_ARCHIVE : ((u->volflags & MYVOLUMEINFO_CDFS) ? FS_CDFS : FS_DIRECTORY);
        if (fsf->fstype == FS_ARCHIVE) {
                fsf->zf = zfile_open_archive (aino->nname, flags);
+               if (fsf->zf)
+                       return fsf;
        } else if (fsf->fstype == FS_DIRECTORY) {
                fsf->of = my_open (aino->nname, flags);
-       } else {
+               if (fsf->of)
+                       return fsf;
+       } else if (fsf->fstype == FS_CDFS) {
                fsf->isof = isofs_openfile (u->ui.cdfs_superblock, aino->uniq_external, flags);
+               if (fsf->isof)
+                       return fsf;
        }
-       if (fsf)
-               return fsf;
        xfree (fsf);
        return NULL;
 }
-static void fs_closefile (struct fs_filehandle *fd)
+static void fs_closefile (struct fs_filehandle *fsf)
 {
-       if (!fd)
+       if (!fsf)
                return;
-       if (fd->fstype == FS_ARCHIVE)
-               zfile_close_archive (fd->zf);
-       else if (fd->fstype == FS_DIRECTORY)
-               my_close (fd->of);
-       else if (fd->fstype == FS_CDFS)
-               isofs_closefile (fd->isof);
+       if (fsf->fstype == FS_ARCHIVE) {
+               zfile_close_archive (fsf->zf);
+       } else if (fsf->fstype == FS_DIRECTORY) {
+               my_close (fsf->of);
+       } else if (fsf->fstype == FS_CDFS) {
+               isofs_closefile (fsf->isof);
+       }
+       xfree (fsf);
 }
 static unsigned int fs_read (struct fs_filehandle *fsf, void *b, unsigned int size)
 {
@@ -1113,9 +1123,7 @@ static unsigned int fs_read (struct fs_filehandle *fsf, void *b, unsigned int si
 }
 static unsigned int fs_write (struct fs_filehandle *fsf, void *b, unsigned int size)
 {
-       if (fsf->fstype == FS_ARCHIVE)
-               return 0;
-       else if (fsf->fstype == FS_DIRECTORY)
+       if (fsf->fstype == FS_DIRECTORY)
                return my_write (fsf->of, b, size);
        return 0;
 }
@@ -1581,7 +1589,7 @@ static int flush_cache (Unit *unit, int num)
        int i = 0;
        int cnt = 100;
 
-       write_log (L"FILESYS: flushing cache unit %d (max %d items)\n", unit->unit, num);
+       //write_log (L"FILESYS: flushing cache unit %d (max %d items)\n", unit->unit, num);
        if (num == 0)
                num = -1;
        while (i < num || num < 0) {
@@ -3467,6 +3475,7 @@ static int action_examine_all_do (Unit *unit, uaecptr lock, ExAllKey *eak, uaecp
        if (base == 0)
                base = &unit->rootnode;
        for (;;) {
+               uae_u64 uniq = 0;
                d = eak->dirhandle;
                if (!eak->fn) {
                        do {
@@ -3474,6 +3483,8 @@ static int action_examine_all_do (Unit *unit, uaecptr lock, ExAllKey *eak, uaecp
                                        ok = zfile_readdir_archive (d->zd, fn);
                                else if (d->fstype == FS_DIRECTORY)
                                        ok = my_readdir (d->od, fn);
+                               else if (d->fstype == FS_CDFS)
+                                       ok = isofs_readdir (d->isod, fn, &uniq);
                                else
                                        ok = 0;
                        } while (ok && d->fstype == FS_DIRECTORY && fsdb_name_invalid (fn));
@@ -3484,7 +3495,7 @@ static int action_examine_all_do (Unit *unit, uaecptr lock, ExAllKey *eak, uaecp
                        xfree (eak->fn);
                        eak->fn = NULL;
                }
-               aino = lookup_child_aino_for_exnext (unit, base, fn, &err, 0);
+               aino = lookup_child_aino_for_exnext (unit, base, fn, &err, uniq);
                if (!aino)
                        return 0;
                eak->id = unit->exallid++;
@@ -3719,7 +3730,6 @@ static void populate_directory (Unit *unit, a_inode *base)
 {
        struct fs_dirhandle *d;
        a_inode *aino;
-       uae_u64 uniq = 0;
 
        d = fs_opendir (unit, base);
        if (!d)
@@ -3731,6 +3741,7 @@ static void populate_directory (Unit *unit, a_inode *base)
        TRACE((L"Populating directory, child %p, locked_children %d\n",
                base->child, base->locked_children));
        for (;;) {
+               uae_u64 uniq = 0;
                TCHAR fn[MAX_DPATH];
                int ok;
                uae_u32 err;
index f47f8dae90d39dc77e21deb3a76a4cfcd39f576d..1f34e7f798107e235f5077fb52d7e266f64bc82b 100644 (file)
@@ -142,36 +142,92 @@ static void getchs (struct hardfiledata *hfd, int *cyl, int *cylsec, int *head,
                *cyl, *cylsec, *head, *tracksec);
 }
 
-void getchsgeometry (uae_u64 size, int *pcyl, int *phead, int *psectorspertrack)
+static void getchsgeometry2 (uae_u64 size, int *pcyl, int *phead, int *psectorspertrack, int mode)
 {
-       int sptt[] = { 63, 127, 255, -1 };
+       int sptt[4];
        int i, spt, head, cyl;
        uae_u64 total = (unsigned int)(size / 512);
 
-       for (i = 0; sptt[i] >= 0; i++) {
-               spt = sptt[i];
-               for (head = 4; head <= 16;head++) {
-                       cyl = total / (head * spt);
-                       if (size <= 512 * 1024 * 1024) {
-                               if (cyl <= 1023)
-                                       break;
-                       } else {
-                               if (cyl < 16383)
-                                       break;
-                               if (cyl < 32767 && head >= 5)
-                                       break;
-                               if (cyl <= 65535)
-                                       break;
+       if (mode == 1) {
+               // old-style head=1, spt=32 always mode
+               head = 1;
+               spt = 32;
+               cyl = total / (head * spt);
+
+       } else {
+
+               sptt[0] = 63;
+               sptt[1] = 127;
+               sptt[2] = 255;
+               sptt[3] = -1;
+
+               for (i = 0; sptt[i] >= 0; i++) {
+                       spt = sptt[i];
+                       for (head = 4; head <= 16;head++) {
+                               cyl = total / (head * spt);
+                               if (size <= 512 * 1024 * 1024) {
+                                       if (cyl <= 1023)
+                                               break;
+                               } else {
+                                       if (cyl < 16383)
+                                               break;
+                                       if (cyl < 32767 && head >= 5)
+                                               break;
+                                       if (cyl <= 65535)
+                                               break;
+                               }
                        }
+                       if (head <= 16)
+                               break;
                }
-               if (head <= 16)
-                       break;
+
        }
+
        *pcyl = cyl;
        *phead = head;
        *psectorspertrack = spt;
 }
 
+void getchsgeometry (uae_u64 size, int *pcyl, int *phead, int *psectorspertrack)
+{
+       getchsgeometry2 (size, pcyl, phead, psectorspertrack, 0);
+}
+
+void getchsgeometry_hdf (struct hardfiledata *hfd, uae_u64 size, int *pcyl, int *phead, int *psectorspertrack)
+{
+       uae_u8 block[512];
+       int i;
+
+       if (size <= 512 * 1024 * 1024) {
+               *phead = 1;
+               *psectorspertrack = 32;
+       }
+       memset (block, 0, sizeof block);
+       if (hfd) {
+               hdf_read (hfd, block, 0, 512);
+               if (block[0] == 'D' && block[1] == 'O' && block[2] == 'S') {
+                       int mode;
+                       for (mode = 0; mode < 2; mode++) {
+                               uae_u32 rootblock;
+                               uae_u32 chk = 0;
+                               getchsgeometry2 (size, pcyl, phead, psectorspertrack, mode);
+                               rootblock = (2 + ((*pcyl) * (*phead) * (*psectorspertrack) - 1)) / 2;
+                               memset (block, 0, sizeof block);
+                               hdf_read (hfd, block, (uae_u64)rootblock * 512, 512);
+                               for (i = 0; i < 512; i += 4)
+                                       chk += (block[i] << 24) | (block[i + 1] << 16) | (block[i + 2] << 8) | (block[i + 3] << 0);
+                               if (!chk && block[0] == 0 && block[1] == 0 && block[2] == 0 && block[3] == 2 &&
+                                       block[4] == 0 && block[5] == 0 && block[6] == 0 && block[7] == 0 && 
+                                       block[8] == 0 && block[9] == 0 && block[10] == 0 && block[11] == 0 && 
+                                       block[508] == 0 && block[509] == 0 && block[510] == 0 && block[511] == 1) {
+                                               return;
+                               }
+                       }
+               }
+       }
+       getchsgeometry2 (size, pcyl, phead, psectorspertrack, 2);
+}
+
 static void getchshd (struct hardfiledata *hfd, int *pcyl, int *phead, int *psectorspertrack)
 {
        uae_u64 total = hfd->virtsize / 512;
index 7d5e447a8ef34902802e19fd1f18ea41f04ba17c..a01289c1f812b417f2a8136ea1b1b82e56d9ea75 100644 (file)
@@ -127,3 +127,4 @@ extern int hdf_read_target (struct hardfiledata *hfd, void *buffer, uae_u64 offs
 extern int hdf_write_target (struct hardfiledata *hfd, void *buffer, uae_u64 offset, int len);
 extern int hdf_resize_target (struct hardfiledata *hfd, uae_u64 newsize);
 extern void getchsgeometry (uae_u64 size, int *pcyl, int *phead, int *psectorspertrack);
+extern void getchsgeometry_hdf (struct hardfiledata *hfd, uae_u64 size, int *pcyl, int *phead, int *psectorspertrack);
index 703f03516138fa1394d744a00903b6ac94e8b797..2b90672db0d61d787f07e56f63a7bb8c368bfdc6 100644 (file)
--- a/isofs.cpp
+++ b/isofs.cpp
@@ -19,7 +19,8 @@
 #include "isofs.h"
 
 #define MAX_CACHED_BH_COUNT 100
-#define MAX_CACHE_INODE_COUNT 10
+//#define MAX_CACHE_INODE_COUNT 10
+#define HASH_SIZE 65536
 
 #define CD_BLOCK_SIZE 2048
 #define ISOFS_INVALID_MODE -1
@@ -69,6 +70,7 @@ struct inode
        TCHAR *i_comment;
 };
 
+
 struct super_block
 {
        int s_high_sierra;
@@ -81,12 +83,20 @@ struct super_block
        struct buffer_head *buffer_heads;
        int bh_count;
        bool unknown_media;
+       struct inode *hash[HASH_SIZE];
+       int hash_miss, hash_hit;
 };
 
+static int gethashindex(struct inode *inode)
+{
+       return inode->i_ino & (HASH_SIZE - 1);
+}
+
 static void free_inode(struct inode *inode)
 {
        if (!inode)
                return;
+       inode->i_sb->hash[gethashindex(inode)] = NULL;
        inode->i_sb->inode_cnt--;
        xfree(inode->name);
        xfree(inode->i_comment);
@@ -111,6 +121,7 @@ static void unlock_inode(struct inode *inode)
        inode->lockcnt--;
 }
 
+
 static void iput(struct inode *inode)
 {
        struct super_block *sb = inode->i_sb;
@@ -145,12 +156,21 @@ static void iput(struct inode *inode)
        sb->inodes = inode;
        inode->linked = true;
        sb->inode_cnt++;
+       sb->hash[gethashindex(inode)] = inode;
 }
 
 static struct inode *find_inode(struct super_block *sb, uae_u64 uniq)
 {
-       struct inode *inode = sb->inodes;
-       /* Need hash tables... Later... */
+       struct inode *inode;
+
+       inode = sb->hash[uniq & (HASH_SIZE - 1)];
+       if (inode && inode->i_ino == uniq) {
+               sb->hash_hit++;
+               return inode;
+       }
+       sb->hash_miss++;
+
+       inode = sb->inodes;
        while (inode) {
                if (inode->i_ino == uniq) {
                        inode->usecnt++;
@@ -2333,6 +2353,7 @@ void isofs_unmount(void *sbp)
 
        if (!sb)
                return;
+       write_log (L"miss: %d hit: %d\n", sb->hash_miss, sb->hash_hit);
        inode = sb->inodes;
        while (inode) {
                struct inode *next = inode->next;
index 89dc67cb0586b0374fc0fcb18e40a52b47f41807..f16a5fee8e6022920460588c36043009f465ffd2 100644 (file)
@@ -80,6 +80,7 @@ static D3DXMATRIXA16 m_matPreView;
 static D3DXMATRIXA16 m_matPreWorld;
 static D3DXMATRIXA16 postproj;
 static D3DXVECTOR4 maskmult, maskshift, texelsize;
+static D3DXVECTOR4 fakesize;
 
 static int ledwidth, ledheight;
 static int max_texture_w, max_texture_h;
@@ -959,8 +960,10 @@ static int psEffect_SetTextures (LPDIRECT3DTEXTURE9 lpSource, LPDIRECT3DTEXTURE9
                fDims.x = (FLOAT) Desc.Width;
                fDims.y = (FLOAT) Desc.Height;
        }
+
        fTexelSize.x = 1.0f / fDims.x;
        fTexelSize.y = 1.0f / fDims.y;
+
        if (m_SourceDimsEffectHandle) {
                hr = pEffect->SetVector (m_SourceDimsEffectHandle, &fDims);
                if (FAILED (hr)) {
@@ -1597,6 +1600,11 @@ static void setupscenecoords (void)
        w = sr.right - sr.left;
        h = sr.bottom - sr.top;
 
+       fakesize.x = w;
+       fakesize.y = h;
+       fakesize.w = 1;
+       fakesize.z = 1;
+
        MatrixOrthoOffCenterLH (&m_matProj, 0, w, 0, h, 0.0f, 1.0f);
 
        float tx, ty;
@@ -1637,6 +1645,9 @@ static void setupscenecoords (void)
                sw = dw * tin_w / window_w;
                sh = dh * tin_h / window_h;
 
+               sw -= 0.5f;
+               sh += 0.5f;
+
                tx += xshift;
                ty += yshift;
 
@@ -1734,14 +1745,14 @@ static void settransform (void)
        // Projection is (0,0,0) -> (1,1,1)
        MatrixOrthoOffCenterLH (&m_matPreProj, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f);
        // Align texels with pixels
-       MatrixTranslation (&m_matPreView, -0.5f / tin_w, 0.5f / tin_h, 0.0f);
+       MatrixTranslation (&m_matPreView, -0.5f / tout_w, 0.5f / tout_h, 0.0f);
        // Identity for world
        D3DXMatrixIdentity (&m_matPreWorld);
        psEffect_SetMatrices (&m_matProj, &m_matView, &m_matWorld);
 
        MatrixOrthoOffCenterLH (&m_matProj2, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f);
 
-       MatrixTranslation (&m_matView2, 0.5f - 0.5f / window_w, 0.5f + 0.5f / window_h, 0.0f);
+       MatrixTranslation (&m_matView2, 0.5f - 0.5f / tout_w, 0.5f + 0.5f / tout_h, 0.0f);
        D3DXMatrixIdentity (&m_matWorld2);
 }
 
index 361837abf92d1d143d7e79db53da125567dbbb92..eb7a779195f9caaad3c501da0529547fb8cecff9 100644 (file)
@@ -296,7 +296,7 @@ static void fixup_size (struct uae_prefs *prefs)
        write_log(L"-> %dx%d\n", prefs->gfx_size_win.width, prefs->gfx_size_win.height);
 }
 
-static int getmult(int mult)
+static int getmult (int mult)
 {
        if (mult >= 4 * 256)
                return 2;
@@ -928,16 +928,18 @@ void rp_fixup_options (struct uae_prefs *p)
 
        write_log (L"rp_fixup_options(escapekey=%d,escapeholdtime=%d,screenmode=%d,inputmode=%d)\n",
                rp_rpescapekey, rp_rpescapeholdtime, rp_screenmode, rp_inputmode);
-       write_log (L"w=%dx%d fs=%dx%d pos=%dx%d %dx%d\n",
-               p->gfx_size_win.width, p->gfx_size_win.height,
-               p->gfx_size_fs.width, p->gfx_size_fs.height,
-               p->gfx_xcenter_pos, p->gfx_ycenter_pos,
-               p->gfx_xcenter_size, p->gfx_ycenter_size);
 
        max_horiz_dbl = currprefs.gfx_max_horizontal;
        max_vert_dbl = currprefs.gfx_max_vertical;
        maxjports = (rp_version * 256 + rp_revision) >= 2 * 256 + 3 ? MAX_JPORTS : 2;
 
+       write_log (L"w=%dx%d fs=%dx%d pos=%dx%d %dx%d HV=%d,%d J=%d\n",
+               p->gfx_size_win.width, p->gfx_size_win.height,
+               p->gfx_size_fs.width, p->gfx_size_fs.height,
+               p->gfx_xcenter_pos, p->gfx_ycenter_pos,
+               p->gfx_xcenter_size, p->gfx_ycenter_size,
+               max_horiz_dbl, max_vert_dbl, maxjports);
+
        sendfeatures ();
        sendenum ();
 
index ee8cf37a52c3cfe02b74e7b813d80d541adfbc8c..7c3bc765684097b54c8c857984c41bcf624e3b89 100644 (file)
@@ -19,8 +19,8 @@
 #define LANG_DLL 1
 
 //#define WINUAEBETA L""
-#define WINUAEBETA L"Beta 24 (RC2)"
-#define WINUAEDATE MAKEBD(2012, 3, 22)
+#define WINUAEBETA L"Beta 25 (RC3)"
+#define WINUAEDATE MAKEBD(2012, 3, 24)
 #define WINUAEEXTRA L"RC1"
 //#define WINUAEEXTRA L"AmiKit Preview"
 #define WINUAEREV L""
index 1ddb66f065cd68b6b278701919726555e4166464..5405bdcb1a0291686c31f8132fabd1acb8d88654 100644 (file)
@@ -8958,7 +8958,7 @@ static void hardfile_testrdb (HWND hDlg, struct hfdlg_vals *hdf)
        sethardfile (hDlg);
 }
 
-static void updatehdfinfo (HWND hDlg, int force)
+static void updatehdfinfo (HWND hDlg, bool force)
 {
        static uae_u64 bsize;
        static uae_u8 id[512];
@@ -8967,12 +8967,14 @@ static void updatehdfinfo (HWND hDlg, int force)
        TCHAR idtmp[9];
 
        if (force) {
+               bool open = false;
                struct hardfiledata hfd;
                memset (id, 0, sizeof id);
                memset (&hfd, 0, sizeof hfd);
                hfd.readonly = 1;
                hfd.blocksize = 512;
                if (hdf_open (&hfd, current_hfdlg.filename)) {
+                       open = true;
                        for (i = 0; i < 16; i++) {
                                hdf_read (&hfd, id, i * 512, 512);
                                bsize = hfd.virtsize;
@@ -8981,16 +8983,16 @@ static void updatehdfinfo (HWND hDlg, int force)
                        }
                        if (i == 16)
                                hdf_read (&hfd, id, 0, 512);
-                       hdf_close (&hfd);
                }
+               if (current_hfdlg.blocksize * current_hfdlg.sectors * current_hfdlg.surfaces) {
+                       getchsgeometry_hdf (open ? &hfd : NULL, bsize, &current_hfdlg.cylinders, &current_hfdlg.surfaces, &current_hfdlg.sectors);
+                       current_hfdlg.original = 0;
+               }
+               hdf_close (&hfd);
        }
 
        cyls = 0;
        if (current_hfdlg.blocksize * current_hfdlg.sectors * current_hfdlg.surfaces) {
-               if (bsize >= 512 * 1024 * 1024 && current_hfdlg.original) {
-                       getchsgeometry (bsize, &current_hfdlg.cylinders, &current_hfdlg.surfaces, &current_hfdlg.sectors);
-                       current_hfdlg.original = 0;
-               }
                cyls = bsize / (current_hfdlg.blocksize * current_hfdlg.sectors * current_hfdlg.surfaces);
        }
        blocks = cyls * (current_hfdlg.sectors * current_hfdlg.surfaces);
@@ -9029,7 +9031,7 @@ static void hardfileselecthdf (HWND hDlg, TCHAR *newpath)
        fullpath (current_hfdlg.filename, sizeof current_hfdlg.filename / sizeof (TCHAR));
        inithardfile (hDlg);
        hardfile_testrdb (hDlg, &current_hfdlg);
-       updatehdfinfo (hDlg, 1);
+       updatehdfinfo (hDlg, true);
        sethardfile (hDlg);
 }
 
@@ -9066,7 +9068,7 @@ static INT_PTR CALLBACK HardfileSettingsProc (HWND hDlg, UINT msg, WPARAM wParam
                inithardfile (hDlg);
                sethardfile (hDlg);
                sethfdostype (hDlg, 0);
-               updatehdfinfo (hDlg, 1);
+               updatehdfinfo (hDlg, true);
                setac (hDlg, IDC_PATH_NAME);
                recursive--;
                customDlgType = IDD_HARDFILE;
@@ -9171,14 +9173,14 @@ static INT_PTR CALLBACK HardfileSettingsProc (HWND hDlg, UINT msg, WPARAM wParam
                GetDlgItemText (hDlg, IDC_PATH_NAME, tmp, sizeof tmp / sizeof (TCHAR));
                if (_tcscmp (tmp, current_hfdlg.filename)) {
                        _tcscpy (current_hfdlg.filename, tmp);
-                       updatehdfinfo (hDlg, 1);
+                       updatehdfinfo (hDlg, true);
                }
                GetDlgItemText (hDlg, IDC_PATH_FILESYS, current_hfdlg.fsfilename, sizeof current_hfdlg.fsfilename / sizeof (TCHAR));
                GetDlgItemText (hDlg, IDC_HARDFILE_DEVICE, current_hfdlg.devicename, sizeof current_hfdlg.devicename / sizeof (TCHAR));
                posn = SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_GETCURSEL, 0, 0);
                if (posn != CB_ERR)
                        current_hfdlg.controller = posn;
-               updatehdfinfo (hDlg, 0);
+               updatehdfinfo (hDlg, false);
                recursive--;
 
                break;
@@ -14143,7 +14145,7 @@ int dragdrop (HWND hDlg, HDROP hd, struct uae_prefs *prefs, int currentpage)
                if (customDlgType == IDD_HARDFILE) {
                        _tcscpy (current_hfdlg.filename, file);
                        SetDlgItemText (hDlg, IDC_PATH_NAME, current_hfdlg.filename);
-                       updatehdfinfo (customDlg, 1);
+                       updatehdfinfo (customDlg, true);
                        continue;
                }
 
index a7d513a66e00133de76c7dda944e4395c704e9b3..0dbb688f614596cf30a48c9c883129370edb19d1 100644 (file)
@@ -1,4 +1,14 @@
 
+Beta 25: (RC3)
+
+- CDFS ACTION_EXAMINE_ALL fixed.
+- CDFS file/directory search now uses simple hash table for better performance.
+- Fixed crash introduced in b23 if filesystem was asked to open directory that couldn't be opened.
+- Directory filesystem host memory leak fixed (leaked few bytes when filehandle was closed). Very old bug.
+- Autodetect old-style geometry if >512M OFS/FFS partition harddrive was created with older UAE version.
+- Some rare DMS files didn't unpack properly.
+- Possible fix for diagonal artifact in some D3D filter modes.
+
 Beta 24: (RC2)
 
 - CDFS Amiga Rock Ridge 'AS' extension support added. (comments and protection flags)