]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
imported winuaesrc1510rc1.zip
authorToni Wilen <twilen@winuae.net>
Wed, 30 Jul 2008 14:17:55 +0000 (17:17 +0300)
committerToni Wilen <twilen@winuae.net>
Mon, 22 Feb 2010 19:42:14 +0000 (21:42 +0200)
custom.c
disk.c
drawing.c
od-win32/direct3d.c
od-win32/direct3d.h
od-win32/win32.h
od-win32/win32gfx.c
od-win32/win32gui.c
od-win32/winuae_msvc/winuae_msvc.vcproj
od-win32/winuaechangelog.txt

index 865cd5baeb79f648f83b6fd8267bd47b0a0e0467..3a1715cc7ed4416cab22ebb86df8ce9fd9f07e8e 100755 (executable)
--- a/custom.c
+++ b/custom.c
@@ -243,8 +243,8 @@ enum diw_states
     DIW_waiting_start, DIW_waiting_stop
 };
 
-int plffirstline, plflastline;
-int plfstrt, plfstop;
+static int plffirstline, plflastline;
+static int plfstrt, plfstop;
 static int sprite_minx, sprite_maxx;
 static int first_bpl_vpos;
 static int last_diw_pix_hpos, last_ddf_pix_hpos;
@@ -2430,7 +2430,7 @@ void init_hz (void)
            minfirstline = maxvpos - 1;
        sprite_vblank_endline = minfirstline - 2;
        maxvpos_max = maxvpos;
-       doublescan = htotal <= 150;
+       doublescan = htotal <= 164;
        dumpsync ();
        hzc = 1;
     }
diff --git a/disk.c b/disk.c
index ac5738e2b9db615278ffb554073224b02a574cfb..a14f98d01514f9550f7d0b686493c7a0d499007b 100755 (executable)
--- a/disk.c
+++ b/disk.c
@@ -163,6 +163,7 @@ typedef struct {
     int dskready;
     int dskready_time;
     int dskready_down_time;
+    int writtento;
     int steplimit;
     frame_time_t steplimitcycle;
     int indexhack, indexhackmode;
@@ -2430,6 +2431,7 @@ static void disk_doupdate_write (drive * drv, int floppybits)
                    if (drives[dr]) {
                        drv2->bigmfmbuf[drv2->mfmpos >> 4] = w;
                        drv2->bigmfmbuf[(drv2->mfmpos >> 4) + 1] = 0x5555;
+                       drv2->writtento = 1;
                    }
 #ifdef AMAX
                    if (currprefs.amaxromfile[0])
@@ -2442,6 +2444,7 @@ static void disk_doupdate_write (drive * drv, int floppybits)
                    disk_dmafinished ();
                    for (dr = 0; dr < MAX_FLOPPY_DRIVES ; dr++) {
                        drive *drv2 = &floppy[dr];
+                       drv2->writtento = 0;
                        if (drives[dr])
                            drive_write_data (drv2);
                    }
@@ -2822,8 +2825,16 @@ void DSKLEN (uae_u16 v, int hpos)
            /* Megalomania and Knightmare does this */
            if (disk_debug_logging > 0 && dskdmaen == 2)
                write_log ("warning: Disk read DMA aborted, %d words left PC=%x\n", dsklength, M68K_GETPC);
-           if (dskdmaen == 3)
+           if (dskdmaen == 3) {
                write_log ("warning: Disk write DMA aborted, %d words left PC=%x\n", dsklength, M68K_GETPC);
+               // did program write something that needs to be stored to file?
+               for (dr = 0; dr < MAX_FLOPPY_DRIVES; dr++) {
+                   drive *drv2 = &floppy[dr];
+                   if (!drv2->writtento)
+                       continue;
+                   drive_write_data (drv2);
+               }
+           }
            dskdmaen = 0;
        }
     }
@@ -2867,6 +2878,7 @@ void DSKLEN (uae_u16 v, int hpos)
     motormask = 0;
     for (dr = 0; dr < MAX_FLOPPY_DRIVES; dr++) {
        drive *drv = &floppy[dr];
+       drv->writtento = 0;
        if (drv->motoroff)
            continue;
        motormask |= 1 << dr;
index 28179593692e650d3ed2c9d8c1772dd1a42deae8..aee583e4a23d397a8e9787c07c32ba44bfc2d1b6 100755 (executable)
--- a/drawing.c
+++ b/drawing.c
@@ -1487,8 +1487,8 @@ static void init_aspect_maps (void)
        xfree (amiga2aspect_line_map);
 
     /* At least for this array the +1 is necessary. */
-    amiga2aspect_line_map = malloc (sizeof (int) * (MAXVPOS + 1) * 2 + 1);
-    native2amiga_line_map = malloc (sizeof (int) * gfxvidinfo.height);
+    amiga2aspect_line_map = xmalloc (sizeof (int) * (MAXVPOS + 1) * 2 + 1);
+    native2amiga_line_map = xmalloc (sizeof (int) * gfxvidinfo.height);
 
     if (currprefs.gfx_correct_aspect)
        native_lines_per_amiga_line = ((double)gfxvidinfo.height
@@ -1538,7 +1538,7 @@ static void init_aspect_maps (void)
        }
     }
 
-    for (i = maxl-1; i >= min_ypos_for_screen; i--) {
+    for (i = maxl - 1; i >= min_ypos_for_screen; i--) {
        int j;
        if (amiga2aspect_line_map[i] == -1)
            continue;
@@ -1591,7 +1591,7 @@ STATIC_INLINE void do_flush_screen (int start, int stop)
        Should be corrected.
        (sjo 26.9.99) */
 
-    xlinecheck(start, stop);
+    xlinecheck (start, stop);
     if (gfxvidinfo.maxblocklines != 0 && first_block_line != NO_BLOCK) {
        flush_block (first_block_line, last_block_line);
     }
index ddd07c7a3e89fe98d5ad91ebb93d139b521feb23..6fb297d59f036c293fb708ec926945a9a2fc5388 100755 (executable)
@@ -303,6 +303,25 @@ static int psEffect_ParseParameters (LPD3DXEFFECTCOMPILER EffectCompiler)
 static int psEffect_hasPreProcess (void) { return m_PreprocessTechnique1EffectHandle != 0; }
 static int psEffect_hasPreProcess2 (void) { return m_PreprocessTechnique2EffectHandle != 0; }
 
+int D3D_canshaders (void)
+{
+    static int yesno = 0;
+    HANDLE h;
+
+    if (yesno < 0)
+       return 0;
+    if (yesno > 0)
+       return 1;
+    h = LoadLibrary ("d3dx9_36.dll");
+    if (h == NULL) {
+       yesno = -1;
+       return 0;
+    }
+    FreeLibrary (h);
+    yesno = 1;
+    return 1;
+}
+
 static int psEffect_LoadEffect (const char *shaderfile)
 {
     int ret = 0;
@@ -311,8 +330,15 @@ static int psEffect_LoadEffect (const char *shaderfile)
     LPD3DXBUFFER BufferEffect = NULL;
     HRESULT hr;
     char tmp[MAX_DPATH];
+    static int first;
 
-    sprintf (tmp, "%s%sfiltershaders\\%s", start_path_exe, WIN32_PLUGINDIR, shaderfile);
+    if (!D3D_canshaders ()) {
+       if (!first)
+           gui_message ("Installed DirectX is too old\nD3D shaders disabled.");
+       first = 1;
+       return 0;
+    }
+    sprintf (tmp, "%s%sfiltershaders\\direct3d\\%s", start_path_exe, WIN32_PLUGINDIR, shaderfile);
     hr = D3DXCreateEffectCompilerFromFile (tmp, NULL, NULL, 0, &EffectCompiler, &Errors);
     if (FAILED (hr)) {
        write_log ("D3D: D3DXCreateEffectCompilerFromFile failed: %s\n", D3DX_ErrorString (hr, Errors));
@@ -558,12 +584,31 @@ static void invalidatedeviceobjects (void)
        IDirect3DVolumeTexture9_Release (lpHq2xLookupTexture);
        lpHq2xLookupTexture = NULL;
     }
+    if (pEffect) {
+       pEffect->lpVtbl->Release (pEffect);
+       pEffect = NULL;
+    }
     if (d3ddev)
        IDirect3DDevice9_SetStreamSource (d3ddev, 0, NULL, 0, 0);
     if (vertexBuffer) {
        IDirect3DVertexBuffer9_Release (vertexBuffer);
        vertexBuffer = NULL;
     }
+    m_MatWorldEffectHandle = NULL;
+    m_MatViewEffectHandle = NULL;
+    m_MatProjEffectHandle = NULL;
+    m_MatWorldViewEffectHandle = NULL;
+    m_MatViewProjEffectHandle = NULL;
+    m_MatWorldViewProjEffectHandle = NULL;
+    m_SourceDimsEffectHandle = NULL;
+    m_TexelSizeEffectHandle = NULL;
+    m_SourceTextureEffectHandle = NULL;
+    m_WorkingTexture1EffectHandle = NULL;
+    m_WorkingTexture2EffectHandle = NULL;
+    m_Hq2xLookupTextureHandle = NULL;
+    m_PreprocessTechnique1EffectHandle = NULL;
+    m_PreprocessTechnique2EffectHandle = NULL;
+    m_CombineTechniqueEffectHandle = NULL;
 }
 
 void D3D_free (void)
index a1fef5405d72e99483020f6852d62e2c631d014a..d8233307dbc921e56bef2e6484271dbf54364fda 100755 (executable)
@@ -12,3 +12,4 @@ extern HDC D3D_getDC(HDC hdc);
 extern int D3D_isenabled (void);
 extern int D3D_needreset (void);
 extern void D3D_clear (void);
+extern int D3D_canshaders (void);
index ba16ee02ebfa8563c5aeb5534b0da0fb8396ad7b..073d2a9cdbaf6c279a240b5ad4fc053094cb1310 100755 (executable)
 #define GETBDM(x) (((x) - ((x / 10000) * 10000)) / 100)
 #define GETBDD(x) ((x) % 100)
 
-#define WINUAEBETA 8
+#define WINUAEBETA 0
 #define WINUAEPUBLICBETA 1
-#define WINUAEDATE MAKEBD(2008, 7, 27)
-#define WINUAEEXTRA ""
+#define WINUAEDATE MAKEBD(2008, 7, 30)
+#define WINUAEEXTRA "RC1"
 #define WINUAEREV ""
 
 #define IHF_WINDOWHIDDEN 6
index d6cddbfdb960db2fc480b6595419fb09a740e15e..b97520f0db18b26d4e57db6c09cd49e5a06082d7 100755 (executable)
@@ -1542,6 +1542,7 @@ void gfx_set_picasso_modeinfo (uae_u32 w, uae_u32 h, uae_u32 depth, RGBFTYPE rgb
     int need;
     if (!screen_is_picasso)
        return;
+    clearscreen ();
     gfx_set_picasso_colors (rgbfmt);
     updatemodes ();
     need = modeswitchneeded (currentmode);
index 90a09e706b61bca7e72f2be5dba76aad0ff1d11e..6b5a4440104d334137a0e0714b056701d6ef15d1 100755 (executable)
@@ -9669,11 +9669,11 @@ static void values_to_hw3ddlg (HWND hDlg)
        }
        i++;
     }
-    {
+    if (D3D_canshaders ()) {
         HANDLE h;
         WIN32_FIND_DATA wfd;
         char tmp[MAX_DPATH];
-        sprintf (tmp, "%s%sfiltershaders\\*.fx", start_path_exe, WIN32_PLUGINDIR);
+        sprintf (tmp, "%s%sfiltershaders\\direct3d\\*.fx", start_path_exe, WIN32_PLUGINDIR);
         h = FindFirstFile(tmp, &wfd);
         while (h) {
            SendDlgItemMessage (hDlg, IDC_FILTERMODE, CB_ADDSTRING, 0, (LPARAM)wfd.cFileName);
index 702f7183bf70fef58b74c3af4e6811b80dc26ebe..6f4ffafd96f6fd70c55103f6eeeb3d7dddd91956 100755 (executable)
@@ -92,7 +92,7 @@
                                LinkIncremental="2"
                                SuppressStartupBanner="true"
                                GenerateManifest="false"
-                               DelayLoadDLLs="wpcap.dll;packet.dll"
+                               DelayLoadDLLs="wpcap.dll;packet.dll;d3dx9_36.dll"
                                GenerateDebugInformation="true"
                                ProgramDatabaseFile=".\Debug/winuae.pdb"
                                SubSystem="2"
                                AdditionalLibraryDirectories=""
                                GenerateManifest="true"
                                AdditionalManifestDependencies=""
-                               DelayLoadDLLs="wpcap.dll;packet.dll"
+                               DelayLoadDLLs="wpcap.dll;packet.dll;d3dx9_36.dll"
                                GenerateDebugInformation="true"
                                ProgramDatabaseFile=".\Release/winuae.pdb"
                                SubSystem="2"
                                AdditionalLibraryDirectories=""
                                GenerateManifest="true"
                                AdditionalManifestDependencies=""
-                               DelayLoadDLLs="wpcap.dll;packet.dll"
+                               DelayLoadDLLs="wpcap.dll;packet.dll;d3dx9_36.dll"
                                GenerateDebugInformation="true"
                                ProgramDatabaseFile=".\FullRelease/winuae.pdb"
                                SubSystem="2"
index 689f3c02e360e690b4d17a4db1d2267a9f82321c..47657e27fe69a41b3ee76b20f057d610bc1e3910 100755 (executable)
@@ -1,4 +1,14 @@
 
+Beta 9:
+
+- clear RTG screen when switching to different RTG mode
+- d9dx9_36.dll set to delay load, winuae now runs without recent DX
+  redistributable installed as long as D3D filter(s) aren't used
+- shaders moved to plugins\filtershaders\direct3d (perhaps opengl
+  shaders will be implemented someday..)
+- pixel shader filter on the fly change crashes fixed (I hope)
+- adf was not updated if disk write DMA was aborted (Cadaver save)
+
 Beta 8:
 
 - PAL filter preset fixed