From 9a48c07a5e071cca70a12194899983ef69e92a0d Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Mon, 6 Dec 2004 20:04:54 +0200 Subject: [PATCH] imported winuaesrc0992b7.zip --- custom.c | 2 +- drawing.c | 11 ++++------- hardfile.c | 13 +++++++++++-- od-win32/ahidsound.c | 2 +- od-win32/avioutput.c | 1 + od-win32/hardfile_win32.c | 18 ++++++++++++++++-- od-win32/picasso96_win.c | 4 ++++ od-win32/win32.h | 2 +- od-win32/win32gui.c | 14 +++++++------- 9 files changed, 46 insertions(+), 21 deletions(-) diff --git a/custom.c b/custom.c index a8ca451f..716c09cc 100755 --- 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); } diff --git a/drawing.c b/drawing.c index b8e7f7dd..ab75926d 100755 --- 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) diff --git a/hardfile.c b/hardfile.c index ba5728aa..439b3bb4 100755 --- a/hardfile.c +++ b/hardfile.c @@ -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); diff --git a/od-win32/ahidsound.c b/od-win32/ahidsound.c index df9c25ba..46041a8d 100755 --- a/od-win32/ahidsound.c +++ b/od-win32/ahidsound.c @@ -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; diff --git a/od-win32/avioutput.c b/od-win32/avioutput.c index 9c6a4f96..c4947747 100755 --- a/od-win32/avioutput.c +++ b/od-win32/avioutput.c @@ -902,6 +902,7 @@ void AVIOutput_Initialize(void) void frame_drawn(void) { double diff, skipmode; + static int frame; if (!avioutput_video || !avioutput_enabled) return; diff --git a/od-win32/hardfile_win32.c b/od-win32/hardfile_win32.c index 7f2f3a28..1597085b 100755 --- a/od-win32/hardfile_win32.c +++ b/od-win32/hardfile_win32.c @@ -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, diff --git a/od-win32/picasso96_win.c b/od-win32/picasso96_win.c index 827bc879..d7cec734 100755 --- a/od-win32/picasso96_win.c +++ b/od-win32/picasso96_win.c @@ -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 diff --git a/od-win32/win32.h b/od-win32/win32.h index c48a2d2b..6a1032a0 100755 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -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); diff --git a/od-win32/win32gui.c b/od-win32/win32gui.c index e7e31904..f18c09f4 100755 --- a/od-win32/win32gui.c +++ b/od-win32/win32gui.c @@ -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 -- 2.47.3