]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
2400b24
authorToni Wilen <twilen@winuae.net>
Thu, 22 Mar 2012 17:07:05 +0000 (19:07 +0200)
committerToni Wilen <twilen@winuae.net>
Thu, 22 Mar 2012 17:07:05 +0000 (19:07 +0200)
filesys.cpp
include/events_jit.h [deleted file]
include/isofs_api.h
isofs.cpp
od-win32/midi.cpp
od-win32/resources/winuae.rc
od-win32/serial_win32.cpp
od-win32/win32.h
od-win32/winuaechangelog.txt

index 1988697e6121e7321575ca1e66bd3119bf6720ee..e5714cd23bd60d24e1f2df9ccaf15b693329356b 100644 (file)
@@ -1554,6 +1554,13 @@ static void dispose_aino (Unit *unit, a_inode **aip, a_inode *aino)
                fsdb_dir_writeback (aino->parent);
 
        *aip = aino->sibling;
+
+       if (unit->volflags & MYVOLUMEINFO_ARCHIVE) {
+               ;
+       } else if (unit->volflags & MYVOLUMEINFO_CDFS) {
+               isofs_dispose_inode (unit->ui.cdfs_superblock, aino->uniq_external);
+       }
+
        xfree (aino->aname);
        xfree (aino->comment);
        xfree (aino->nname);
@@ -1905,11 +1912,13 @@ static int fill_file_attrs (Unit *u, a_inode *base, a_inode *c)
                return 1;
        } else if (u->volflags & MYVOLUMEINFO_CDFS) {
                int isdir, flags;
-               isofss_fill_file_attrs (u->ui.cdfs_superblock, base->uniq_external, &isdir, &flags, c->uniq_external);
+               TCHAR *comment;
+               isofss_fill_file_attrs (u->ui.cdfs_superblock, base->uniq_external, &isdir, &flags, &comment, c->uniq_external);
                c->dir = isdir;
                c->amigaos_mode = 0;
                if (flags >= 0)
                        c->amigaos_mode = flags;
+               c->comment = comment;
                return 1;
        } else {
                return fsdb_fill_file_attrs (base, c);
@@ -3344,7 +3353,7 @@ static int exalldo (uaecptr exalldata, uae_u32 exalldatasize, uae_u32 type, uaec
        if (unit->volflags & MYVOLUMEINFO_ARCHIVE)
                zfile_stat_archive (aino->nname, &statbuf);
        else if (unit->volflags & MYVOLUMEINFO_CDFS)
-               ;
+               isofs_stat (unit->cdfs_superblock, aino->uniq_external, &statbuf);
        else
                stat (aino->nname, &statbuf);
 
@@ -5881,6 +5890,13 @@ static void dump_partinfo (struct hardfiledata *hfd, uae_u8 *pp)
                write_log (L"First block %d read failed!\n", block);
        }
        xfree (s);
+
+       if ((uae_u64)highcyl * spt * surfaces * blocksize > hfd->virtsize) {
+               write_log (L"RDB: WARNING: end of partition > size of disk! (%I64u > %I64u)\n",
+                       (uae_u64)highcyl * spt * surfaces * blocksize, hfd->virtsize);
+       }
+
+
 }
 
 static void dump_rdb (UnitInfo *uip, struct hardfiledata *hfd, uae_u8 *bufrdb, uae_u8 *buf, int readblocksize)
@@ -6021,6 +6037,11 @@ static int rdb_mount (UnitInfo *uip, int unit_no, int partnum, uaecptr parmpacke
                write_log (L"RDSK dump end\n");
        }
 
+       if ((uae_u64)hfd->cylinders * hfd->sectors * hfd->heads * blocksize > hfd->virtsize) {
+               write_log (L"RDB: WARNING: RDSK header disk size > disk size! (%I64u > %I64u)\n",
+                       (uae_u64)hfd->cylinders * hfd->sectors * hfd->heads, hfd->virtsize);
+       }
+
        for (i = 0; i <= partnum; i++) {
                if (i == 0)
                        partblock = rl (bufrdb + 28);
@@ -6067,9 +6088,6 @@ static int rdb_mount (UnitInfo *uip, int unit_no, int partnum, uaecptr parmpacke
                goto error;
        }
 
-       if ((uae_u64)hfd->cylinders * hfd->sectors * hfd->heads * blocksize > hfd->virtsize)
-               write_log (L"RDB: WARNING: end of partition > size of disk!\n");
-
        err = 2;
 
        /* load custom filesystems if needed */
@@ -6324,7 +6342,7 @@ static uae_u32 REGPARAM2 filesys_dev_storeinfo (TrapContext *context)
                put_long (parmpacket + 64, 0); /* Buffer mem type */
                put_long (parmpacket + 68, 0x7FFFFFFF); /* largest transfer */
                put_long (parmpacket + 72, ~1); /* addMask (?) */
-               put_long (parmpacket + 76, scsi_get_cd_drive_media_mask () & (1 << cd_unit_no) ? -80 : -128); /* bootPri */
+               put_long (parmpacket + 76, scsi_get_cd_drive_media_mask () & (1 << cd_unit_no) ? -127 : -128); /* bootPri */
                put_long (parmpacket + 80, CDFS_DOSTYPE);
                put_long (parmpacket + 84, 0); /* baud */
                put_long (parmpacket + 88, cdfs_control >> 2); /* Control. BSTR! */
diff --git a/include/events_jit.h b/include/events_jit.h
deleted file mode 100644 (file)
index cbf96be..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-/* Let's see whether hiding this away somewhere where the compiler can't
-see it will cure it of its silly urge to mis-optimize the comparison */
-extern long int diff32(frame_time_t x, frame_time_t y);
-extern int pissoff_value;
-
-STATIC_INLINE void events_schedule (void)
-{
-       int i;
-
-       unsigned long int mintime = ~0L;
-       for (i = 0; i < ev_max; i++) {
-               if (eventtab[i].active) {
-                       unsigned long int eventtime = eventtab[i].evtime - currcycle;
-#ifdef EVENT_DEBUG
-                       if (eventtime == 0) {
-                               write_log ("event %d bug\n",i);
-                       }
-#endif
-                       if (eventtime < mintime)
-                               mintime = eventtime;
-               }
-       }
-       nextevent = currcycle + mintime;
-}
-
-extern signed long pissoff;
-
-STATIC_INLINE void cycles_do_special (void)
-{
-#ifdef JIT
-       if (currprefs.cachesize) {
-               if (pissoff >= 0)
-                       pissoff = -1;
-       } else
-#endif
-       {
-               pissoff = 0;
-       }
-}
-
-STATIC_INLINE void do_extra_cycles (unsigned long cycles_to_add)
-{
-       pissoff -= cycles_to_add;
-}
-
-STATIC_INLINE unsigned long int get_cycles (void)
-{
-       return currcycle;
-}
-
-STATIC_INLINE void set_cycles (unsigned long int x)
-{
-       currcycle = x;
-       eventtab[ev_hsync].oldcycles = x;
-#ifdef EVT_DEBUG
-       if (currcycle & (CYCLE_UNIT - 1))
-               write_log (L"%x\n", currcycle);
-#endif
-}
-
-extern volatile bool vblank_found_chipset;
-extern volatile bool vblank_found_rtg;
-
-STATIC_INLINE void do_cycles_slow (unsigned long cycles_to_add)
-{
-       if (vblank_found_chipset && pissoff > 0)
-               cycles_do_special ();
-
-       if ((pissoff -= cycles_to_add) >= 0)
-               return;
-
-       cycles_to_add = -pissoff;
-       pissoff = 0;
-
-       if (is_lastline && eventtab[ev_hsync].evtime - currcycle <= cycles_to_add) {
-               int rpt = read_processor_time ();
-               int v = rpt - vsyncmintime;
-               if (v > (int)syncbase || v < -((int)syncbase))
-                       vsyncmintime = rpt;
-               if (v < 0 && !vblank_found_chipset && !currprefs.turbo_emulation) {
-                       pissoff = pissoff_value * CYCLE_UNIT;
-                       return;
-               }
-       }
-       while ((nextevent - currcycle) <= cycles_to_add) {
-               int i;
-               cycles_to_add -= (nextevent - currcycle);
-               currcycle = nextevent;
-
-               for (i = 0; i < ev_max; i++) {
-                       if (eventtab[i].active && eventtab[i].evtime == currcycle) {
-                               (*eventtab[i].handler)();
-                       }
-               }
-               events_schedule ();
-       }
-       currcycle += cycles_to_add;
-#ifdef EVT_DEBUG
-       if (currcycle & (CYCLE_UNIT - 1))
-               write_log (L"%x\n", currcycle);
-#endif
-}
-
-#define do_cycles do_cycles_slow
-#define countdown pissoff
index 45c4f15b000a5aa259916adda653b58049986789..e72b8a94a8a359b29c65a37a597937f23e2b4fcb 100644 (file)
@@ -18,8 +18,9 @@ struct cd_opendir_s *isofs_opendir(void *sb, uae_u64 uniq);
 void isofs_closedir(struct cd_opendir_s*);
 bool isofs_readdir(struct cd_opendir_s*, TCHAR*, uae_u64 *uniq);
 void isofs_stat(void *sb, uae_u64, struct _stat64*);
-void isofss_fill_file_attrs(void *sb, uae_u64, int*, int*, uae_u64);
+void isofss_fill_file_attrs(void *sb, uae_u64, int*, int*, TCHAR**, uae_u64);
 bool isofs_exists(void *sb, uae_u64, const TCHAR*, uae_u64*);
+void isofs_dispose_inode(void *sb, uae_u64);
 
 struct cd_openfile_s *isofs_openfile(void*,uae_u64, int);
 void isofs_closefile(struct cd_openfile_s*);
index be31c53b1e14b0be22f8131f674a13edc3552e6a..703f03516138fa1394d744a00903b6ac94e8b797 100644 (file)
--- a/isofs.cpp
+++ b/isofs.cpp
@@ -64,6 +64,9 @@ struct inode
        bool linked;
        int usecnt;
        int lockcnt;
+       bool i_isaflags;
+       uae_u8 i_aflags;
+       TCHAR *i_comment;
 };
 
 struct super_block
@@ -86,6 +89,7 @@ static void free_inode(struct inode *inode)
                return;
        inode->i_sb->inode_cnt--;
        xfree(inode->name);
+       xfree(inode->i_comment);
        xfree(inode);
 }
 
@@ -110,11 +114,11 @@ static void unlock_inode(struct inode *inode)
 static void iput(struct inode *inode)
 {
        struct super_block *sb = inode->i_sb;
-       struct inode *in;
 
        if (!inode || inode->linked)
                return;
 #if 0
+       struct inode *in;
        while (inode->i_sb->inode_cnt > MAX_CACHE_INODE_COUNT) {
                /* not very fast but better than nothing.. */
                struct inode *minin = NULL, *mininprev = NULL;
@@ -143,9 +147,10 @@ static void iput(struct inode *inode)
        sb->inode_cnt++;
 }
 
-static struct inode *find_inode(struct super_block *sb, uae_u32 uniq)
+static struct inode *find_inode(struct super_block *sb, uae_u64 uniq)
 {
        struct inode *inode = sb->inodes;
+       /* Need hash tables... Later... */
        while (inode) {
                if (inode->i_ino == uniq) {
                        inode->usecnt++;
@@ -878,9 +883,6 @@ repeat:
                        goto out;       /* Something got screwed up here */
 
                switch (sig) {
-               case SIG('A', 'S'):
-                       write_log (L"Amiga rockridge extension not yet implemented!\n");
-                       break;
                case SIG('R', 'R'):
                        if ((rr->u.RR.flags[0] & RR_NM) == 0)
                                goto out;
@@ -985,13 +987,26 @@ repeat:
                        goto out;       /* Something got screwed up here */
 
                switch (sig) {
-#ifndef CONFIG_ZISOFS          /* No flag for SF or ZF */
-               case SIG('R', 'R'):
-                       if ((rr->u.RR.flags[0] &
-                            (RR_PX | RR_TF | RR_SL | RR_CL)) == 0)
-                               goto out;
+               case SIG('A', 'S'):
+               {
+                       char *p = &rr->u.AS.data[0];
+                       if (rr->u.AS.flags & 1) { // PROTECTION
+                               inode->i_isaflags = true;
+                               inode->i_aflags = p[3];
+                               p += 4;
+                       }
+                       if (rr->u.AS.flags & 2) { // COMMENT
+                               const int maxcomment = 80;
+                               if (!inode->i_comment)
+                                       inode->i_comment = xcalloc (TCHAR, maxcomment + 1);
+                               int l = p[0];
+                               char t = p[l];
+                               p[l] = 0;
+                               au_copy (inode->i_comment + _tcslen (inode->i_comment), maxcomment + 1 - l, p + 1);
+                               p[l] = t;
+                       }
                        break;
-#endif
+               }
                case SIG('S', 'P'):
                        if (check_sp(rr, inode))
                                goto out;
@@ -2386,15 +2401,21 @@ bool isofs_readdir(struct cd_opendir_s *od, TCHAR *name, uae_u64 *uniq)
        return do_isofs_readdir(od->inode, &od->f, od->tmp1, (struct iso_directory_record*)od->tmp2, name, uniq) != 0;
 }
 
-void isofss_fill_file_attrs(void *sbp, uae_u64 parent, int *dir, int *flags, uae_u64 uniq)
+void isofss_fill_file_attrs(void *sbp, uae_u64 parent, int *dir, int *flags, TCHAR **comment, uae_u64 uniq)
 {
        struct super_block *sb = (struct super_block*)sbp;
        struct inode *inode = find_inode(sb, uniq);
        if (!inode)
                return;
 
+       *comment = NULL;
        *dir = XS_ISDIR(inode->i_mode) ? 1 : 0;
-       *flags = 0;
+       if (inode->i_isaflags)
+               *flags = inode->i_aflags;
+       else
+               *flags = 0;
+       if (inode->i_comment)
+               *comment = my_strdup(inode->i_comment);
 }
 
 void isofs_stat(void *sbp, uae_u64 uniq, struct _stat64 *statbuf)
@@ -2434,6 +2455,31 @@ bool isofs_exists(void *sbp, uae_u64 parent, const TCHAR *name, uae_u64 *uniq)
        return false;
 }
 
+void isofs_dispose_inode(void *sbp, uae_u64 uniq)
+{
+       struct super_block *sb = (struct super_block*)sbp;
+       struct inode *inode;
+       struct inode *old = NULL, *prev = NULL;
+
+       inode = sb->inodes;
+       while (inode) {
+               if (inode->i_ino == uniq) {
+                       old = inode;
+                       break;
+               }
+               prev = inode;
+               inode = inode->next;
+       }
+       if (!old)
+               return;
+
+       if (prev)
+               prev->next = old->next;
+       else
+               sb->inodes = old->next;
+       free_inode(old);
+}
+
 struct cd_openfile_s
 {
        struct super_block *sb;
index 43b8a6cd51470aa42ac556db962d0a27ebf24c6c..31783d6e8c3a940484ca2bbbbd130c7d2bd295c6 100644 (file)
@@ -311,7 +311,7 @@ static const uae_u8 plen[128] = {
        1,1,2,1,0,0,0,0,0,0,0,0,0,0,0,0
 };
 
-#define DBGOUT_MIDI_BYTE(x) TRACE(( "MIDI: 0x%02x\n", (x) ))
+#define DBGOUT_MIDI_BYTE(x) TRACE((L"MIDI: 0x%02x\n", (x) ))
 
 /*
 * FUNCTION:   Midi_Parse
@@ -345,16 +345,16 @@ int Midi_Parse(midi_direction_e direction, BYTE *dataptr)
                                switch(data)
                                {
                                case MIDI_CLOCK:
-                                       TRACE(( "MIDI: MIDI_CLOCK\n" ));
+                                       TRACE((L"MIDI: MIDI_CLOCK\n" ));
                                        break;
                                case MIDI_START:
-                                       TRACE(( "MIDI: MIDI_START\n" ));
+                                       TRACE((L"MIDI: MIDI_START\n" ));
                                        break;
                                case MIDI_CONTINUE:
-                                       TRACE(( "MIDI: MIDI_CONTINUE\n" ));
+                                       TRACE((L"MIDI: MIDI_CONTINUE\n" ));
                                        break;
                                case MIDI_STOP:
-                                       TRACE(( "MIDI: MIDI_STOP\n" ));
+                                       TRACE((L"MIDI: MIDI_STOP\n" ));
                                        break;
                                default:
                                        break;
@@ -432,7 +432,7 @@ static long midi_inptr = 0, midi_inlast = 0;
 static void add1byte(DWORD_PTR w) //put 1 Byte to Midibuffer
 {
        if(midi_inlast >= BUFFLEN - 10) {
-               TRACE(("add1byte buffer full %d %d (%02X)\n", midi_inlast, midi_inptr, w));
+               TRACE((L"add1byte buffer full %d %d (%02X)\n", midi_inlast, midi_inptr, w));
                return;
        }
        midibuf[midi_inlast++] = (uae_u8)w;
@@ -440,7 +440,7 @@ static void add1byte(DWORD_PTR w) //put 1 Byte to Midibuffer
 static void add2byte(DWORD_PTR w) //put 2 Byte to Midibuffer
 {
        if(midi_inlast >= BUFFLEN - 10) {
-               TRACE(("add2byte buffer full %d %d (%04X)\n", midi_inlast, midi_inptr, w));
+               TRACE((L"add2byte buffer full %d %d (%04X)\n", midi_inlast, midi_inptr, w));
                return;
        }
        midibuf[midi_inlast++] = (uae_u8)w;
@@ -450,7 +450,7 @@ static void add2byte(DWORD_PTR w) //put 2 Byte to Midibuffer
 static void add3byte(DWORD_PTR w) //put 3 Byte to Midibuffer
 {
        if(midi_inlast >= BUFFLEN - 10) {
-               TRACE(("add3byte buffer full %d %d (%08X)\n", midi_inlast, midi_inptr, w));
+               TRACE((L"add3byte buffer full %d %d (%08X)\n", midi_inlast, midi_inptr, w));
                return;
        }
        midibuf[midi_inlast++] = (uae_u8)w;
@@ -479,7 +479,7 @@ LONG getmidibyte(void) //return midibyte or -1 if none
                gui_message(szMessage);
                overflow = 0;
        }
-       TRACE(("getmidibyte(%02X)\n", midibuf[midi_inptr]));
+       TRACE((L"getmidibyte(%02X)\n", midibuf[midi_inptr]));
        if (midibuf[midi_inptr] >= 0xf0) { // only check for free buffers if status sysex
                for (i = 0;i < MIDI_INBUFFERS;i++) {
                        if (midiin[i].dwFlags == (MHDR_DONE|MHDR_PREPARED)) {
@@ -503,23 +503,23 @@ static void CALLBACK MidiInProc(HMIDIIN hMidiIn,UINT wMsg,DWORD_PTR dwInstance,D
 {
        EnterCriticalSection (&cs_proc);
        if(wMsg == MIM_ERROR) {
-               TRACE(("MIDI Data Lost\n"));
+               TRACE((L"MIDI Data Lost\n"));
        }
        if(wMsg == MIM_LONGDATA) {
                LPMIDIHDR midiin = (LPMIDIHDR)dwParam1;
-               TRACE(("MIM_LONGDATA bytes=%d ts=%u\n", midiin->dwBytesRecorded, dwParam2));
+               TRACE((L"MIM_LONGDATA bytes=%d ts=%u\n", midiin->dwBytesRecorded, dwParam2));
                if (exitin == 1)
                        goto end; //for safeness midi want close
                if ((midi_inlast + midiin->dwBytesRecorded) >= (BUFFLEN-6)) {
                        overflow = 1;
-                       TRACE(("MIDI overflow1\n"));
+                       TRACE((L"MIDI overflow1\n"));
                        //for safeness if buffer too full (should not occur)
                        goto end;
                }
                if (midiin->dwBufferLength == midiin->dwBytesRecorded) {
                        //for safeness if buffer too full (should not occur)
                        overflow = 1;
-                       TRACE(("MIDI overflow2\n"));
+                       TRACE((L"MIDI overflow2\n"));
                        goto end;
                }
                memcpy(&midibuf[midi_inlast], midiin->lpData, midiin->dwBytesRecorded);
@@ -528,7 +528,7 @@ static void CALLBACK MidiInProc(HMIDIIN hMidiIn,UINT wMsg,DWORD_PTR dwInstance,D
 
        if(wMsg == MM_MIM_DATA || wMsg == MM_MIM_MOREDATA) {
                BYTE state = (BYTE)dwParam1;
-               TRACE(("%s %08X\n", wMsg == MM_MIM_DATA ? "MM_MIM_DATA" : "MM_MIM_MOREDATA", dwParam1));
+               TRACE((L"%s %08X\n", wMsg == MM_MIM_DATA ? "MM_MIM_DATA" : "MM_MIM_MOREDATA", dwParam1));
                if(state == 254)
                        goto end;
                if(state < 0xf0)
index b4b9706b36533d2ab9edec4e86c9b3a1457e69ca..01cb3c0ebfa4201c5384c3fac1cedc5a90ffd876 100644 (file)
@@ -305,7 +305,7 @@ BEGIN
     CONTROL         "Disable UAEFSDB-support",IDC_NOUAEFSDB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,110,154,119,10\r
     CONTROL         "Don't use Windows Recycle Bin",IDC_NORECYCLEBIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,110,166,121,10\r
     CONTROL         "Include network drives..",IDC_MAPDRIVES_NET,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,178,101,10\r
-    CONTROL         "CDFS automount CD/DVD drives.",IDC_MAPDRIVES_CD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,190,160,10\r
+    CONTROL         "CDFS automount CD/DVD drives",IDC_MAPDRIVES_CD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,190,160,10\r
     CONTROL         "Automount removable drives",IDC_MAPDRIVES_AUTO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,110,178,115,10\r
     CONTROL         "Include removable drives..",IDC_MAPDRIVES_REMOVABLE,\r
                     "Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,166,100,10\r
index 4d70d7f4f8337a4470575f9fedb0f99b79c334f1..9da9904f0b936d9fc4122f954e4a7b3500d452bb 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "od-win32/parser.h"
 
-#define SERIALLOGGING 1
+#define SERIALLOGGING 0
 #define SERIALDEBUG 0 /* 0, 1, 2 3 */
 #define SERIALHSDEBUG 0
 #define MODEMTEST   0 /* 0 or 1 */
index 400bb3a88b8e6192cb9b67d7f30d14fbb8311311..ee8cf37a52c3cfe02b74e7b813d80d541adfbc8c 100644 (file)
@@ -19,8 +19,8 @@
 #define LANG_DLL 1
 
 //#define WINUAEBETA L""
-#define WINUAEBETA L"Beta 23"
-#define WINUAEDATE MAKEBD(2012, 3, 21)
+#define WINUAEBETA L"Beta 24 (RC2)"
+#define WINUAEDATE MAKEBD(2012, 3, 22)
 #define WINUAEEXTRA L"RC1"
 //#define WINUAEEXTRA L"AmiKit Preview"
 #define WINUAEREV L""
index 291332b327cd9f240f6b518f9e02f793a88c58fb..a7d513a66e00133de76c7dda944e4395c704e9b3 100644 (file)
@@ -1,4 +1,13 @@
 
+Beta 24: (RC2)
+
+- CDFS Amiga Rock Ridge 'AS' extension support added. (comments and protection flags)
+- Free CDFS inodes if they are not needed anymore, previously only freed when media was changed,
+  better performance and less (host) memory used when CD has 10000+ files or directories.
+- More logical "RDB: WARNING: end of partition > size of disk" message. Check RDSK header size and partition(s)
+  size separately.
+- CDFS boot priority changed to -127 (lowest possible).
+  
 Beta 23:
 
 - CPU Idle change improved, b22 caused major slowdowns on some systems.