]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
imported winuaesrc1340b5.zip
authorToni Wilen <twilen@winuae.net>
Thu, 21 Dec 2006 18:55:41 +0000 (20:55 +0200)
committerToni Wilen <twilen@winuae.net>
Mon, 22 Feb 2010 19:30:37 +0000 (21:30 +0200)
15 files changed:
bsdsocket.c
custom.c
drawing.c
fpp.c
include/newcpu.h
newcpu.c
od-win32/mman.c
od-win32/posixemu.c
od-win32/sounddep/sound.c
od-win32/win32.c
od-win32/win32.h
od-win32/win32gfx.c
od-win32/win32gui.c
od-win32/winuae_msvc/winuae_msvc.vcproj
od-win32/winuaechangelog.txt

index 440ca79b5739108f53e8a0cdc8e14c77b0b69c7b..e5224bd3bce980e6eb40ad4e84fe220b18a36a4e 100644 (file)
@@ -274,6 +274,7 @@ static uae_u32 REGPARAM2 bsdsock_int_handler (TrapContext *context)
     SB;
 
     locksigqueue ();
+    bsd_int_requested = 0;
 
     if (sbsigqueue != NULL) {
 
@@ -292,7 +293,6 @@ static uae_u32 REGPARAM2 bsdsock_int_handler (TrapContext *context)
        sbsigqueue = NULL;
     }
 
-    bsd_int_requested = 0;
     unlocksigqueue ();
 
     return 0;
index bcd4ed7243ae785484141a13839f55d6d406276d..c72a6516058ce277323f7423ec0559a7f0bac194 100644 (file)
--- a/custom.c
+++ b/custom.c
@@ -4383,7 +4383,6 @@ static void hsync_handler (void)
 #if 1
 #ifdef FILESYS
     if (uae_int_requested) {
-       set_uae_int_flag ();
        INTREQ (0x8000 | 0x0008);
     }
 #endif
index e0d8ae8b1ade5b22460734c19a28d0f52fd0bc1b..dd7936afdb518a31ffbbac5c66020f8f9da8e560 100644 (file)
--- a/drawing.c
+++ b/drawing.c
@@ -146,6 +146,7 @@ static void xlinecheck (int start, int end)
 
 static int *amiga2aspect_line_map, *native2amiga_line_map;
 static uae_u8 *row_map[MAX_VIDHEIGHT + 1];
+static uae_u8 row_tmp[MAX_PIXELS_PER_LINE * 32 / 8];
 static int max_drawn_amiga_line;
 
 /* line_draw_funcs: pfield_do_linetoscr, pfield_do_fill_line, decode_ham */
@@ -1088,6 +1089,8 @@ void init_row_map (void)
        abort ();
     }
     j = 0;
+    for (i = 0; i < MAX_VIDHEIGHT + 1; i++)
+       row_map[i] = row_tmp;
     for (i = 0; i < gfxvidinfo.height + 1; i++, j += gfxvidinfo.rowbytes)
        row_map[i] = gfxvidinfo.bufmem + j;
 }
@@ -2094,6 +2097,7 @@ STATIC_INLINE void check_picasso (void)
 
     notice_screen_contents_lost ();
     notice_new_xcolors ();
+    count_frame ();
 #endif
 }
 
diff --git a/fpp.c b/fpp.c
index 7eb57a3b5175e5158e08ee260a1bde45d430ffd3..79fd0a5dfdf87a624e086635a53f5c36524d9bc4 100644 (file)
--- a/fpp.c
+++ b/fpp.c
@@ -1267,24 +1267,24 @@ void fpp_opp (uae_u32 opcode, struct regstruct *regs, uae_u16 extra)
              regs->fp[reg] = tmp_fp;
            }
 #else /* no X86_MSVC */
-           switch ((regs.fpcr >> 4) & 3) {
+           switch ((regs->fpcr >> 4) & 3) {
                case 0: /* to nearest */
-                   regs.fp[reg] = floor (src + 0.5);
+                   regs->fp[reg] = floor (src + 0.5);
                    break;
                case 1: /* to zero */
                    if (src >= 0.0)
-                       regs.fp[reg] = floor (src);
+                       regs->fp[reg] = floor (src);
                    else
-                       regs.fp[reg] = ceil (src);
+                       regs->fp[reg] = ceil (src);
                    break;
                case 2: /* down */
-                   regs.fp[reg] = floor (src);
+                   regs->fp[reg] = floor (src);
                    break;
                case 3: /* up */
-                   regs.fp[reg] = ceil (src);
+                   regs->fp[reg] = ceil (src);
                    break;
                default: /* never reached */
-                   regs.fp[reg] = src;
+                   regs->fp[reg] = src;
            }
 #endif /* X86_MSVC */
            break;
index f59247970a450b405d017630fa337f6c10cd0217..58c15f0bf7b35289d69fdbcfb48731d98b9eed07 100644 (file)
@@ -175,13 +175,13 @@ STATIC_INLINE void m68k_setpc (struct regstruct *regs, uaecptr newpc)
 
 STATIC_INLINE uaecptr m68k_getpc (struct regstruct *regs)
 {
-    return regs->pc + ((char *)regs->pc_p - (char *)regs->pc_oldp);
+    return (uaecptr)(regs->pc + ((char *)regs->pc_p - (char *)regs->pc_oldp));
 }
 #define M68K_GETPC m68k_getpc(&regs)
 
 STATIC_INLINE uaecptr m68k_getpc_p (struct regstruct *regs, uae_u8 *p)
 {
-    return regs->pc + ((char *)p - (char *)regs->pc_oldp);
+    return (uaecptr)(regs->pc + ((char *)p - (char *)regs->pc_oldp));
 }
 
 STATIC_INLINE void m68k_setpci(struct regstruct *regs, uaecptr newpc)
index b10137bccbc61aa2486e7b8b523de91fb467e863..27468d4735a097f88e0d095bb052750609280d10 100644 (file)
--- a/newcpu.c
+++ b/newcpu.c
@@ -1901,6 +1901,8 @@ void exec_nostats(void)
 
 static int triggered;
 
+extern volatile int bsd_int_requested;
+
 void execute_normal(void)
 {
     struct regstruct *r = &regs;
@@ -1930,7 +1932,7 @@ void execute_normal(void)
        total_cycles += cpu_cycles;
        pc_hist[blocklen].specmem = special_mem;
        blocklen++;
-       if (end_block(opcode) || blocklen >= MAXRUN || r->spcflags) {
+       if (end_block(opcode) || blocklen >= MAXRUN || r->spcflags || uae_int_requested || bsd_int_requested) {
            compile_block(pc_hist,blocklen,total_cycles);
            return; /* We will deal with the spcflags in the caller */
        }
@@ -1946,6 +1948,14 @@ static void m68k_run_2a (void)
     for (;;) {
        ((compiled_handler*)(pushall_call_handler))();
        /* Whenever we return from that, we should check spcflags */
+       if (uae_int_requested) {
+           intreq |= 0x0008;
+           set_special (&regs, SPCFLAG_INT);
+       }
+       if (bsd_int_requested) {
+           intreq |= 0x2000;
+           set_special (&regs, SPCFLAG_INT);
+       }
        if (regs.spcflags) {
            if (do_specialties (0, &regs)) {
                return;
index 613620eac0f7138669d0e1ced4347207bf25b546..ce5fcf29e20020a449ec23f7823b8b6e23ad975b 100644 (file)
@@ -98,6 +98,7 @@ void init_shm(void)
        blah = VirtualAlloc(NULL, size + add, MEM_RESERVE, PAGE_EXECUTE_READWRITE);
        if (blah)
            break;
+       write_log("NATMEM: %dM area failed to allocate, err=%d\n", (size + add) >> 20, GetLastError());
        size >>= 1;
        if (size < 0x10000000) {
            write_log("NATMEM: No special area could be allocated (2)!\n");
index 171303481d8e46ae64dc6ca43be5fe14d65952d7..45517d7fae82fea85cc7a048e15ed2542a472bf7 100644 (file)
@@ -34,6 +34,7 @@ void gettimeofday (struct timeval *tv, void *blah)
 {
 #if 1
     struct timeb time;
+
     ftime (&time);
 
     tv->tv_sec = time.time;
@@ -56,7 +57,7 @@ void gettimeofday (struct timeval *tv, void *blah)
 #define secs_per_day (24 * 60 * 60)
 #define diff ((8 * 365 + 2) * secs_per_day)
 
-static void get_time(time_t t, long* days, long* mins, long* ticks)
+static void get_time(time_t t, long *days, long *mins, long *ticks)
 {
     /* time_t is secs since 1-1-1970 */
     /* days since 1-1-1978 */
@@ -163,7 +164,8 @@ static int setfiletime(const char *name, unsigned int days, int minute, int tick
 int posixemu_utime( const char *name, struct utimbuf *ttime )
 {
     int result = -1, tolocal;
-    long days, mins, ticks, actime;
+    long days, mins, ticks;
+    time_t actime;
 
     if (!ttime) {
        actime = time (NULL);
@@ -232,7 +234,7 @@ int uae_start_thread (void *(*f)(void *), void *arg, uae_thread_id *tid)
     return result;
 }
 
-int cpu_affinity = 1;
+DWORD_PTR cpu_affinity = 1;
 
 void uae_set_thread_priority (int pri)
 {
index 07caf8072bf28eaf1286e0f302da607c2d3e4186..e625e4ceceae386a2df787c60662f53f60be9288 100644 (file)
@@ -36,6 +36,9 @@
 #define ADJUST_SIZE 30
 #define EXP 2.1
 
+#define ADJUST_VSSIZE 10
+#define EXPVS 1.3
+
 int sound_debug = 0;
 
 static int obtainedfreq;
@@ -80,6 +83,11 @@ int setup_sound (void)
     return 1;
 }
 
+static int isvsync(void)
+{
+    return (currprefs.gfx_vsync && currprefs.gfx_afullscreen) ? 1 : 0;
+}
+
 int scaled_sample_evtime_orig;
 static int lastfreq;
 void update_sound (int freq)
@@ -88,7 +96,7 @@ void update_sound (int freq)
        freq = lastfreq;
     lastfreq = freq;
     if (have_sound) {
-       if ((currprefs.gfx_vsync && currprefs.gfx_afullscreen) || currprefs.chipset_refreshrate) {
+       if (isvsync() || currprefs.chipset_refreshrate) {
            if (currprefs.ntscmode)
                scaled_sample_evtime_orig = (unsigned long)(MAXHPOS_NTSC * MAXVPOS_NTSC * freq * CYCLE_UNIT + obtainedfreq - 1) / obtainedfreq;
            else
@@ -309,12 +317,13 @@ static int open_audio_ds (int size)
         dsoundbuf = DSBSIZE_MIN;
     if (dsoundbuf > DSBSIZE_MAX)
         dsoundbuf = DSBSIZE_MAX;
-    if (max_sndbufsize > dsoundbuf)
-        max_sndbufsize = dsoundbuf;
+
+    if (max_sndbufsize * 2 > dsoundbuf)
+        max_sndbufsize = dsoundbuf / 2;
 
     snd_writeoffset = max_sndbufsize * 5 / 8;
     snd_maxoffset = max_sndbufsize;
-    snd_totalmaxoffset_of = max_sndbufsize + (dsoundbuf - max_sndbufsize) / 3;
+    snd_totalmaxoffset_of = max_sndbufsize + (dsoundbuf - max_sndbufsize) * 1 / 3;
     snd_totalmaxoffset_uf = max_sndbufsize + (dsoundbuf - max_sndbufsize) * 2 / 3;
 
     memset (&sound_buffer, 0, sizeof (sound_buffer));
@@ -467,7 +476,7 @@ void sound_setadjust (double v)
        vsynctime = (long)(((double)vsynctime_orig) * mult / 1000.0);
        scaled_sample_evtime = scaled_sample_evtime_orig;
     } else {
-       vsynctime = vsynctime_orig * mult / 1000.0;
+       vsynctime = (long)(((double)vsynctime_orig) * mult / 1000.0);
        scaled_sample_evtime = scaled_sample_evtime_orig;
     }
 }
@@ -637,14 +646,28 @@ static void finish_sound_buffer_ds (void)
 
     vdiff = diff - snd_writeoffset;
     m = 100.0 * vdiff / max_sndbufsize;
-    skipmode = pow (m < 0 ? -m : m, EXP) / 2;
-
-    if (m < 0)
-       skipmode = -skipmode;
-    if (skipmode < -ADJUST_SIZE)
-       skipmode = -ADJUST_SIZE;
-    if (skipmode > ADJUST_SIZE)
-       skipmode = ADJUST_SIZE;
+
+    if (isvsync()) {
+
+       skipmode = pow (m < 0 ? -m : m, EXP) / 10;
+       if (m < 0)
+           skipmode = -skipmode;
+       if (skipmode < -ADJUST_VSSIZE)
+           skipmode = -ADJUST_VSSIZE;
+       if (skipmode > ADJUST_VSSIZE)
+           skipmode = ADJUST_VSSIZE;
+
+    } else {
+
+       skipmode = pow (m < 0 ? -m : m, EXP) / 2;
+       if (m < 0)
+           skipmode = -skipmode;
+       if (skipmode < -ADJUST_SIZE)
+           skipmode = -ADJUST_SIZE;
+       if (skipmode > ADJUST_SIZE)
+           skipmode = ADJUST_SIZE;
+
+    }
 
     if (tfprev != timeframes) {
        if (sound_debug && !(tfprev % 10))
index ee5c6209178a6db508f11771a57826fd841582c9..8247be5e2e842b4a6dddc323167ec1cf6bfe0292 100644 (file)
@@ -2529,9 +2529,10 @@ static void getstartpaths(int start_data)
 
 extern void test (void);
 extern int screenshotmode, b0rken_ati_overlay, postscript_print_debugging, sound_debug, log_uaeserial;
-extern int force_direct_catweasel, cpu_affinity, max_allowed_mman;
+extern int force_direct_catweasel, max_allowed_mman;
 
-static int original_affinity;
+extern DWORD_PTR cpu_affinity;
+static DWORD_PTR original_affinity;
 
 static int getval(char *s)
 {
index 307308bd6ddda20cfc0f9d3a3a01104473d3e35a..7339e6de7f8d96edf3f3dee8d0a378ed93374f70 100644 (file)
@@ -15,9 +15,9 @@
 #define GETBDM(x) (((x) - ((x / 10000) * 10000)) / 100)
 #define GETBDD(x) ((x) % 100)
 
-#define WINUAEBETA 4
+#define WINUAEBETA 5
 #define WINUAEPUBLICBETA 1
-#define WINUAEDATE MAKEBD(2006, 12, 20)
+#define WINUAEDATE MAKEBD(2006, 12, 21)
 
 #define IHF_WINDOWHIDDEN 6
 #define NORMAL_WINDOW_STYLE (WS_VISIBLE | WS_BORDER | WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU)
index 40bef5b24b1e687fad3de34fbf5670450babcb1e..1a3647f16fbd2c0bd6ea5fd38beed866f8d1f899 100644 (file)
@@ -889,7 +889,7 @@ static int DX_Flip(void)
     }
 #endif
     result = DirectDraw_Flip(0);
-    if( result )
+    if (result)
     {
 //     result = DirectDraw_BltFast(primary_surface, 0, 0, secondary_surface, NULL);
 //     result = DirectDraw_BltFast(primary_surface, 0, 0, tertiary_surface, NULL);
index e81b0025d6460d61ff9fe442045c1aa55ec16523..676c191fb35a6468e8fc285000f0892459249632 100644 (file)
@@ -367,7 +367,7 @@ static HWND cachedlist = NULL;
 #define MIN_SLOW_MEM 0
 #define MAX_SLOW_MEM 4
 #define MIN_Z3_MEM 0
-#define MAX_Z3_MEM ((max_z3fastmem >> 20) <= 512 ? 10 : ((max_z3fastmem >> 20) == 1024) ? 11 : 12)
+#define MAX_Z3_MEM ((max_z3fastmem >> 20) < 1024 ? 10 : ((max_z3fastmem >> 20) < 2048) ? 11 : 12)
 #define MIN_P96_MEM 0
 #define MAX_P96_MEM 7
 #define MIN_M68K_PRIORITY 1
@@ -7974,7 +7974,7 @@ static void filter_handle (HWND hDlg)
 
 static int getfiltermult(HWND hDlg, DWORD dlg)
 {
-    int v = SendDlgItemMessage (hDlg, dlg, CB_GETCURSEL, 0, 0L);
+    LRESULT v = SendDlgItemMessage (hDlg, dlg, CB_GETCURSEL, 0, 0L);
     if (v == CB_ERR)
        return 1000;
     return filtermults[v];
index 76e658299a8b523c88491e204725d5d873580efa..bda12a29aa5266e914ac27b742444001737ce372 100644 (file)
                        />
                        <Tool
                                Name="VCLinkerTool"
-                               AdditionalDependencies="opengl32.lib glu32.lib ws2_32.lib ddraw.lib dxguid.lib winmm.lib comctl32.lib version.lib vfw32.lib msacm32.lib dsound.lib dinput8.lib d3d9.lib d3dx9.lib winio.lib setupapi.lib wininet.lib dxerr8.lib shlwapi.lib zlib.lib"
+                               AdditionalDependencies="opengl32.lib glu32.lib ws2_32.lib ddraw.lib dxguid.lib winmm.lib comctl32.lib version.lib vfw32.lib msacm32.lib dsound.lib dinput8.lib d3d9.lib d3dx9.lib setupapi.lib wininet.lib dxerr8.lib shlwapi.lib zlibstat.lib libpng.lib lglcd.lib"
                                OutputFile="d:\amiga\winuae64.exe"
                                LinkIncremental="1"
                                SuppressStartupBanner="true"
                                GenerateDebugInformation="true"
                                ProgramDatabaseFile=".\Release64/winuae.pdb"
                                SubSystem="2"
-                               StackReserveSize="2621440"
-                               StackCommitSize="2621440"
                                OptimizeReferences="2"
                                EnableCOMDATFolding="2"
                                OptimizeForWindows98="0"
index cacdcc088c6e48b40e41d0621fb1a1578f281d09..cd6f1062f4e5c87d1a21db14e14976ba0e0dde34 100644 (file)
@@ -1,20 +1,27 @@
 
 Beta 5:
 
-- added -maxmem command line parameter, "-maxmem 1536" enables
-  1G Z3Fast support. (32-bit max) Note: not default because it
-  can cause weird side-effects and is not compatible with all Windows
-  versions.
 - remove winuae-specific command line parameters before passing
   them to configuration parser.
 - internal serial and parallel port selection updates
   (partially in b4 + fixes in b5)
+- Paula serial port emulation fixed (broke in b4)
+- more uaeserial.device tweaks
 - defined more Picasso96 modeIDs, now most PC display modes have
   unique ID (updating display card/drivers, moving between PCs
   does not anymore cause mysterious mode changes)
-  NOTE: you may need to reset your Picasso96 display mode if your
-  current mode was not defined in previous WinUAE versions.
-- serial port emulation fixed (broke in b4)
+  NOTE: you may need to reset your Picasso96 display mode if you
+  used mode other than 640x480, 800x600, 1024x768, 1280x1024 or
+  1600x1200.
+- fixed another random Picasso96<>native switching crash
+- added -maxmem command line parameter, "-maxmem 1024" enables 1G
+  Z3Fast support. (32-bit max) Note: can cause random side-effects
+  depending on total memory and/or Windows version.. Large RTG RAM
+  sizes require larger maxmem parameter (but values over ~1060 may
+  not work, check winuaebootlog.txt). Pointless but fun option :)
+- vsync mode sound pitch shifting fixed. Pitch can still shift
+  slightly in some cases.
+- bsdsocket stability fix
 
 Beta 4: