]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
imported winuaesrc0992b7.zip
authorToni Wilen <twilen@winuae.net>
Mon, 6 Dec 2004 18:04:54 +0000 (20:04 +0200)
committerToni Wilen <twilen@winuae.net>
Mon, 22 Feb 2010 19:24:45 +0000 (21:24 +0200)
custom.c
drawing.c
hardfile.c
od-win32/ahidsound.c
od-win32/avioutput.c
od-win32/hardfile_win32.c
od-win32/picasso96_win.c
od-win32/win32.h
od-win32/win32gui.c

index a8ca451ffe9aaf29d0097cabe45dfe176b4a9cd5..716c09ccae9ff8be321718c2c77a38d3fcc3bf98 100755 (executable)
--- a/custom.c
+++ b/custom.c
@@ -5634,7 +5634,7 @@ STATIC_INLINE void sync_copper (int hpos)
 
 STATIC_INLINE decide_fetch_ce (int hpos)
 {
-    if (ddf_change == vpos)
+    if (ddf_change == vpos && vpos < maxvpos)
        decide_fetch (hpos);
 }
 
index b8e7f7dde4f803d6927911ca4f88983f721c26a2..ab75926d52c858ce59a9b99c9e8303376df8aa78 100755 (executable)
--- a/drawing.c
+++ b/drawing.c
@@ -1951,14 +1951,8 @@ void vsync_handle_redraw (int long_frame, int lof_changed)
        last_redraw_point = 0;
        interlace_seen = 0;
 
-       if (framecnt == 0) {
+       if (framecnt == 0)
            finish_drawing_frame ();
-#ifdef AVIOUTPUT
-           frame_drawn ();
-       } else if (picasso_on) {
-           frame_drawn ();
-#endif
-       }
 
        /* At this point, we have finished both the hardware and the
         * drawing frame. Essentially, we are outside of all loops and
@@ -2014,6 +2008,9 @@ void vsync_handle_redraw (int long_frame, int lof_changed)
     }
     gui_hd_led (0);
     gui_cd_led (0);
+#ifdef AVIOUTPUT
+    frame_drawn ();
+#endif
 }
 
 void hsync_record_line_state (int lineno, enum nln_how how, int changed)
index ba5728aa20f87cb12472fbfcbcb4032ec2e5c84c..439b3bb40e75f567595b1a331a7893ad66ff9a56 100755 (executable)
@@ -449,7 +449,7 @@ static uae_u32 hardfile_expunge (void)
     return 0; /* Simply ignore this one... */
 }
 
-static void getchs (struct hardfiledata *hfd, int *cyl, int *cylsec, int *head, int *tracksec)
+static void getchs2 (struct hardfiledata *hfd, int *cyl, int *cylsec, int *head, int *tracksec)
 {
     unsigned int total = (unsigned int)(hfd->size / 1024);
     int heads;
@@ -488,6 +488,14 @@ static void getchs (struct hardfiledata *hfd, int *cyl, int *cylsec, int *head,
     *head = heads;
 }
 
+static void getchs (struct hardfiledata *hfd, int *cyl, int *cylsec, int *head, int *tracksec)
+{
+    getchs2 (hfd, cyl, cylsec, head, tracksec);
+    hf_log ("CHS: %08.8X-%08.8X %d %d %d %d %d\n",
+       (uae_u32)(hfd->size >> 32),(uae_u32)hfd->size,
+       *cyl, *cylsec, *head, *tracksec);
+}
+
 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,
@@ -600,6 +608,7 @@ static uae_u32 hardfile_do_io (struct hardfiledata *hfd, struct hardfileprivdata
        break;
 
        bad_command:
+       error = -5; /* IOERR_BADADDRESS */
        break;
 
        case NSCMD_DEVICEQUERY:
@@ -680,7 +689,7 @@ static uae_u32 hardfile_do_io (struct hardfiledata *hfd, struct hardfileprivdata
 
        default:
            /* Command not understood. */
-           error = -3; /* io_Error */
+           error = -3; /* IOERR_NOCMD */
        break;
     }
     put_long (request + 32, actual);
index df9c25ba44d8bc0a6a6e2f6162ea6ff918371dd3..46041a8de8839b9b34773948ada2aab0af7495bc 100755 (executable)
@@ -67,7 +67,7 @@ static char *ahisndbuffer,*sndrecbuffer;
 static int ahisndbufsize,oldpos,*ahisndbufpt,ahitweak;;
 static unsigned int dwBytes,dwBytes1,dwBytes2,espstore;
 static LPVOID dwData1,dwData2;
-int ahi_pollrate;
+int ahi_pollrate = 40;
 
 int sound_freq_ahi;
 
index 9c6a4f96f1db03f5e8a7bdf9c880a3f83bb28081..c49477479ec97420832099c2c39ce27a33a269be 100755 (executable)
@@ -902,6 +902,7 @@ void AVIOutput_Initialize(void)
 void frame_drawn(void)
 {
     double diff, skipmode;
+    static int frame;
 
     if (!avioutput_video || !avioutput_enabled)
        return;
index 7f2f3a28d522c800c648c654477979364ee21591..1597085b86a947da6d12290f1060986b98471405 100755 (executable)
@@ -1,4 +1,5 @@
 #define WIN32_LEAN_AND_MEAN
+#define _WIN32_WINNT 0x500
 
 #include "sysconfig.h"
 #include "sysdeps.h"
@@ -437,6 +438,8 @@ Return Value:
                                         i, j;
     DRIVE_LAYOUT_INFORMATION           *dli;
     DISK_GEOMETRY                      dg;
+    GET_LENGTH_INFORMATION             gli;
+    int gli_ok;
     int ret = -1;
     struct uae_driveinfo *udi;
     char orgname[1024];
@@ -634,6 +637,12 @@ Return Value:
         ret = 1;
         goto end;
     }
+    gli_ok = 1;
+    if (!DeviceIoControl (hDevice, IOCTL_DISK_GET_LENGTH_INFO, NULL, 0, (void*)&gli, sizeof (gli), &returnedLength, NULL)) {
+        write_log ("IOCTL_DISK_GET_LENGTH_INFO failed with error code %d.\n", GetLastError());
+       gli_ok = 0;
+       write_log ("IOCTL_DISK_GET_LENGTH_INFO not supported, detected disk size may not be correct.\n");
+    }
     udi->bytespersector = dg.BytesPerSector;
     if (dg.BytesPerSector < 512) {
        write_log ("unsupported blocksize < 512 (%d)\n", dg.BytesPerSector);
@@ -646,8 +655,13 @@ Return Value:
        goto end;
     }
     udi->offset = udi->offset2 = 0;
-    udi->size = udi->size2 = (uae_u64)dg.BytesPerSector * (uae_u64)dg.Cylinders.QuadPart * (uae_u64)dg.TracksPerCylinder * (uae_u64)dg.SectorsPerTrack;
-    write_log ("device size %I64d bytes\n", udi->size);
+    write_log ("BytesPerSector=%d Cyls=%I64d TracksPerCyl=%d SecsPerTrack=%d\n",
+       dg.BytesPerSector, dg.Cylinders.QuadPart, dg.TracksPerCylinder, dg.SectorsPerTrack);
+    udi->size = udi->size2 = (uae_u64)dg.BytesPerSector * (uae_u64)dg.Cylinders.QuadPart *
+       (uae_u64)dg.TracksPerCylinder * (uae_u64)dg.SectorsPerTrack;
+    if (gli_ok)
+       udi->size = udi->size2 = gli.Length.QuadPart;
+    write_log ("device size %I64d (0x%I64x) bytes\n", udi->size, udi->size);
 
     memset (outBuf, 0, sizeof (outBuf));
     status = DeviceIoControl(hDevice, IOCTL_DISK_GET_DRIVE_LAYOUT, NULL, 0,
index 827bc8793c58413da823a4480380a6be72b6565c..d7cec7343c0383e00b43ab18bfb1893040696629 100755 (executable)
@@ -2039,6 +2039,8 @@ uae_u32 picasso_FillRect (void)
     struct RenderInfo ri;
     uae_u32 result = 0;
 
+    if (Width * Height <= 2500)
+       return 0;
     special_mem|=picasso_is_special_read|picasso_is_special;     
 
 #ifdef LOCK_UNLOCK_MADNESS
@@ -2650,6 +2652,8 @@ uae_u32 picasso_BlitTemplate (void)
     uae_u8 *tmpl_base;
     uae_u32 result = 0;
 
+    if (W * H <= 2500)
+       return 0;
     special_mem|=picasso_is_special_read|picasso_is_special;     
 
 #ifdef LOCK_UNLOCK_MADNESS
index c48a2d2b31384787602ce2adc4501df8a3e67b1c..6a1032a0b248a2f3a0c901434897ea8419c1cbdd 100755 (executable)
@@ -22,7 +22,7 @@ extern int manual_palette_refresh_needed;
 extern int mouseactive, focus;
 extern int ignore_messages_all;
 #define WINUAEBETA 1
-#define WINUAEBETASTR " Beta 6"
+#define WINUAEBETASTR " Beta 7"
 
 extern void my_kbd_handler (int, int, int);
 extern void clearallkeys(void);
index e7e31904ae3fd49ce1638e18b93950882a155dd8..f18c09f4d59df10af944fd05b76b79d0feca35c8 100755 (executable)
@@ -782,19 +782,19 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs
     char init_path[MAX_DPATH] = "";
     BOOL result = FALSE;
     char *amiga_path = NULL;
-    char description[ CFG_DESCRIPTION_LENGTH ] = "";
+    char description[CFG_DESCRIPTION_LENGTH] = "";
     char *p, *nextp;
     int all = 1;
     int next;
 
-    char szTitle[ MAX_DPATH ];
-    char szFormat[ MAX_DPATH ];
-    char szFilter[ MAX_DPATH ] = { 0 };
+    char szTitle[MAX_DPATH];
+    char szFormat[MAX_DPATH];
+    char szFilter[MAX_DPATH] = { 0 };
     
     memset (&openFileName, 0, sizeof (OPENFILENAME));
     
-    strncpy( init_path, start_path, MAX_DPATH );
-    switch( flag )
+    strncpy (init_path, start_path, MAX_DPATH);
+    switch (flag)
     {
        case 0:
        case 1:
@@ -8423,7 +8423,7 @@ static int GetSettings (int all_options, HWND hwnd)
        PORTS_ID = init_page (IDD_PORTS, IDI_PORTS, IDS_PORTS, PortsDlgProc, NULL, "gui/ports.htm");
        INPUT_ID = init_page (IDD_INPUT, IDI_INPUT, IDS_INPUT, InputDlgProc, NULL, "gui/input.htm");
        MISC1_ID = init_page (IDD_MISC1, IDI_MISC1, IDS_MISC1, MiscDlgProc1, NULL, "gui/misc.htm");
-       MISC2_ID = init_page (IDD_MISC2, IDI_MISC2, IDS_MISC2, MiscDlgProc2, NULL, "gui/misc.htm");
+       MISC2_ID = init_page (IDD_MISC2, IDI_MISC2, IDS_MISC2, MiscDlgProc2, NULL, "gui/misc2.htm");
 #ifdef AVIOUTPUT
        AVIOUTPUT_ID = init_page (IDD_AVIOUTPUT, IDI_AVIOUTPUT, IDS_AVIOUTPUT, AVIOutputDlgProc, NULL, "gui/output.htm");
 #endif