]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
2310b3
authorToni Wilen <twilen@winuae.net>
Tue, 26 Oct 2010 15:27:12 +0000 (18:27 +0300)
committerToni Wilen <twilen@winuae.net>
Tue, 26 Oct 2010 15:27:12 +0000 (18:27 +0300)
12 files changed:
audio.cpp
blitter.cpp
expansion.cpp
include/savestate.h
inputdevice.cpp
inputrecord.cpp
newcpu.cpp
od-win32/caps/caps_win32.cpp
od-win32/direct3d.cpp
od-win32/win32.h
od-win32/winuaechangelog.txt
savestate.cpp

index 5cad8700bd0eda0a9b1345269810f73b67f7a7c8..02fb7e73268c038b09221c97cda7b7dc756da72d 100644 (file)
--- a/audio.cpp
+++ b/audio.cpp
@@ -1987,27 +1987,29 @@ void restore_audio_finish (void)
 uae_u8 *restore_audio (int nr, uae_u8 *src)
 {
        struct audio_channel_data *acd = audio_channel + nr;
-       uae_u16 p;
 
        zerostate (nr);
        acd->state = restore_u8 ();
        acd->vol = restore_u8 ();
        acd->intreq2 = restore_u8 () ? true : false;
-       p = restore_u8 ();
+       uae_u8 flags = restore_u8 ();
        acd->dr = acd->dsr = false;
-       if (p & 1)
+       if (flags & 1)
                acd->dr = true;
-       if (p & 2)
+       if (flags & 2)
                acd->dsr = true;
-       acd->drhpos = 1;
        acd->len = restore_u16 ();
        acd->wlen = restore_u16 ();
-       p = restore_u16 ();
+       uae_u16 p = restore_u16 ();
        acd->per = p ? p * CYCLE_UNIT : PERIOD_MAX;
        acd->dat = acd->dat2 = restore_u16 ();
        acd->lc = restore_u32 ();
        acd->pt = restore_u32 ();
        acd->evtime = restore_u32 ();
+       if (flags & 0x80)
+               acd->drhpos = restore_u8 ();
+       else
+               acd->drhpos = 1;
        acd->dmaenstore = (dmacon & DMA_MASTER) && (dmacon & (1 << nr));
        return src;
 }
@@ -2024,7 +2026,7 @@ uae_u8 *save_audio (int nr, int *len, uae_u8 *dstptr)
        save_u8 (acd->state);
        save_u8 (acd->vol);
        save_u8 (acd->intreq2);
-       save_u8 ((acd->dr ? 1 : 0) | (acd->dsr ? 2 : 0));
+       save_u8 ((acd->dr ? 1 : 0) | (acd->dsr ? 2 : 0) | 0x80);
        save_u16 (acd->len);
        save_u16 (acd->wlen);
        save_u16 (acd->per == PERIOD_MAX ? 0 : acd->per / CYCLE_UNIT);
@@ -2032,6 +2034,7 @@ uae_u8 *save_audio (int nr, int *len, uae_u8 *dstptr)
        save_u32 (acd->lc);
        save_u32 (acd->pt);
        save_u32 (acd->evtime);
+       save_u8 (acd->drhpos);
        *len = dst - dstbak;
        return dstbak;
 }
index e8eaeaf48ffa80c89c02177efebb7f448d532a82..6a5ec5aee753305f133cd2d34717d42d790a5bc2 100644 (file)
@@ -1161,10 +1161,17 @@ static void blit_bltset (int con)
        blitline = bltcon1 & 1;
        blitfill = !!(bltcon1 & 0x18);
 
+       // disable line draw if bltcon0 is written while it is active
+       if (!savestate_state && bltstate != BLT_done && blitline) {
+               blitline = 0;
+               bltstate = BLT_done;
+               write_log (L"BLITTER: register modification during linedraw!\n");
+       }
+
        if (blitline) {
                if (blt_info.hblitsize != 2)
                        debugtest (DEBUGTEST_BLITTER, L"weird blt_info.hblitsize in linemode: %d vsize=%d\n",
-                       blt_info.hblitsize, blt_info.vblitsize);
+                               blt_info.hblitsize, blt_info.vblitsize);
                blit_diag = blit_cycle_diagram_line;
        } else {
                if (con & 2) {
@@ -1177,7 +1184,7 @@ static void blit_bltset (int con)
                }
                if (blitfill && !blitdesc)
                        debugtest (DEBUGTEST_BLITTER, L"fill without desc\n");
-               blit_diag = blitfill &&  blit_cycle_diagram_fill[blit_ch][0] ? blit_cycle_diagram_fill[blit_ch] : blit_cycle_diagram[blit_ch];
+               blit_diag = blitfill && blit_cycle_diagram_fill[blit_ch][0] ? blit_cycle_diagram_fill[blit_ch] : blit_cycle_diagram[blit_ch];
        }
        if ((bltcon1 & 0x80) && (currprefs.chipset_mask & CSMASK_ECS_AGNUS))
                debugtest (DEBUGTEST_BLITTER, L"ECS BLTCON1 DOFF-bit set\n");
@@ -1339,9 +1346,10 @@ static void do_blitter2 (int hpos, int copper)
                        ch++;
                if (blit_ch & 8)
                        ch++;
-               write_log (L"blitstart: %dx%d ch=%d %d*%d=%d d=%d f=%02X n=%d pc=%p l=%d dma=%04X\n",
+               write_log (L"blitstart: %dx%d ch=%d %d*%d=%d d=%d f=%02X n=%d pc=%p l=%d dma=%04X %s\n",
                        blt_info.hblitsize, blt_info.vblitsize, ch, blit_diag[0], cycles, blit_diag[0] * cycles,
-                       blitdesc ? 1 : 0, blitfill, dmaen (DMA_BLITPRI) ? 1 : 0, M68K_GETPC, blitline, dmacon);
+                       blitdesc ? 1 : 0, blitfill, dmaen (DMA_BLITPRI) ? 1 : 0, M68K_GETPC, blitline,
+                       dmacon, ((dmacon & (DMA_MASTER | DMA_BLITTER)) == (DMA_MASTER | DMA_BLITTER)) ? L"" : L" off!");
                blitter_dump ();
        }
 #endif
index 581569d22ccd2289f0474adeddaf75244526ef24..c959f1a0668e64b932078ba7a99d53850b971413 100644 (file)
@@ -983,7 +983,7 @@ static void expamem_init_filesys (void)
 
        expamem_write (0x08, no_shutup);
 
-       expamem_write (0x04, 82);
+       expamem_write (0x04, currprefs.maprom ? 2 : 82);
        expamem_write (0x10, uae_id >> 8);
        expamem_write (0x14, uae_id & 0xff);
 
@@ -1063,7 +1063,7 @@ static void expamem_init_z3fastmem_2 (addrbank *bank, uae_u32 start, uae_u32 siz
 
        expamem_write (0x08, care_addr | no_shutup | force_z3 | (allocated > 0x800000 ? ext_size : Z3_MEM_AUTO));
 
-       expamem_write (0x04, 83);
+       expamem_write (0x04, currprefs.maprom ? 3 : 83);
 
        expamem_write (0x10, uae_id >> 8);
        expamem_write (0x14, uae_id & 0xff);
index 5ac119c3c05e4e0e4be75832f015739eaa0efcc6..d73d09727cef8686764c73b740b0e6fe74eb617f 100644 (file)
@@ -222,3 +222,4 @@ extern void savestate_rewind (void);
 extern int savestate_dorewind (int);
 extern void savestate_listrewind (void);
 extern void statefile_save_recording (const TCHAR*);
+extern void savestate_capture_request (void);
index fb7bdf92afc796d50a9e179cc59e885daae93c3d..25703aab003007a81aa92fda300d458335cabcc1 100644 (file)
@@ -2334,7 +2334,7 @@ void inputdevice_handle_inputcode (void)
 
        if (code == 0)
                goto end;
-       if (needcputrace (code) && can_cpu_tracer () == true && is_cpu_tracer () == false) {
+       if (needcputrace (code) && can_cpu_tracer () == true && is_cpu_tracer () == false && !input_play && !input_record) {
                if (set_cpu_tracer (true)) {
                        tracer_enable = 1;
                        return; // wait for next frame
@@ -3315,9 +3315,6 @@ static void scanevents (struct uae_prefs *p)
                }
        }
 
-       for (i = 0; i < MAX_JPORTS; i++)
-               joydir[i] = 0;
-
        for (i = 0; i < MAX_INPUT_DEVICES; i++) {
                use_joysticks[i] = 0;
                use_mice[i] = 0;
@@ -4413,36 +4410,20 @@ bool inputdevice_set_gameports_mapping (struct uae_prefs *prefs, int devnum, int
        return true;
 }
 
-void inputdevice_updateconfig (struct uae_prefs *prefs)
+static void resetinput (void)
 {
-       int i;
-
-       copyjport (&changed_prefs, &currprefs, 0);
-       copyjport (&changed_prefs, &currprefs, 1);
-       copyjport (&changed_prefs, &currprefs, 2);
-       copyjport (&changed_prefs, &currprefs, 3);
-
-#ifdef RETROPLATFORM
-       rp_input_change (0);
-       rp_input_change (1);
-       rp_input_change (2);
-       rp_input_change (3);
-       for (i = 0; i < MAX_JPORTS; i++)
-               rp_update_gameport (i, -1, 0);
-#endif
-
-       joybutton[0] = joybutton[1] = 0;
-       joydir[0] = joydir[1] = 0;
-       oldmx[0] = oldmx[1] = -1;
-       oldmy[0] = oldmy[1] = -1;
+       if ((input_play || input_record) && hsync_counter > 0)
+               return;
        cd32_shifter[0] = cd32_shifter[1] = 8;
-       for (i = 0; i < 4; i++) {
+       for (int i = 0; i < MAX_JPORTS; i++) {
                oleft[i] = 0;
                oright[i] = 0;
                otop[i] = 0;
                obot[i] = 0;
-       }
-       for (i = 0; i < MAX_JPORTS; i++) {
+               oldmx[i] = -1;
+               oldmy[i] = -1;
+               joybutton[i] = 0;
+               joydir[i] = 0;
                mouse_deltanoreset[i][0] = 0;
                mouse_delta[i][0] = 0;
                mouse_deltanoreset[i][1] = 0;
@@ -4451,14 +4432,34 @@ void inputdevice_updateconfig (struct uae_prefs *prefs)
                mouse_delta[i][2] = 0;
        }
        memset (keybuf, 0, sizeof keybuf);
-
-       for (i = 0; i < INPUT_QUEUE_SIZE; i++)
+       for (int i = 0; i < INPUT_QUEUE_SIZE; i++)
                input_queue[i].linecnt = input_queue[i].nextlinecnt = -1;
 
-       for (i = 0; i < MAX_INPUT_SUB_EVENT; i++) {
+       for (int i = 0; i < MAX_INPUT_SUB_EVENT; i++) {
                sublevdir[0][i] = i;
                sublevdir[1][i] = MAX_INPUT_SUB_EVENT - i - 1;
        }
+}
+
+void inputdevice_updateconfig (struct uae_prefs *prefs)
+{
+       int i;
+
+       copyjport (&changed_prefs, &currprefs, 0);
+       copyjport (&changed_prefs, &currprefs, 1);
+       copyjport (&changed_prefs, &currprefs, 2);
+       copyjport (&changed_prefs, &currprefs, 3);
+
+#ifdef RETROPLATFORM
+       rp_input_change (0);
+       rp_input_change (1);
+       rp_input_change (2);
+       rp_input_change (3);
+       for (i = 0; i < MAX_JPORTS; i++)
+               rp_update_gameport (i, -1, 0);
+#endif
+
+       resetinput ();
 
        joysticks = prefs->joystick_settings[prefs->input_selected_setting];
        mice = prefs->mouse_settings[prefs->input_selected_setting];
index 9c7e4d67d11be2840402b9c908150da291731f9d..a63dc71c280b0645a7dca474a2f0ea2fe9a509da 100644 (file)
@@ -8,6 +8,7 @@
 */
 
 #define INPUTRECORD_DEBUG 1
+#define ENABLE_DEBUGGER 0
 
 #define HEADERSIZE 12
 
@@ -228,8 +229,11 @@ static int inprec_pstart (uae_u8 type)
                                        write_log (L"\n");
                                }
                                cycleoffset = cycles - cycles2;
+#if ENABLE_DEBUGGER == 0
                                gui_message (L"INPREC OFFSET=%d\n", (int)cycleoffset / CYCLE_UNIT);
+#else
                                activate_debugger ();
+#endif
                        }
                        lastcycle = cycles;
                        inprec_plast = p;
@@ -444,7 +448,6 @@ int inprec_open (const TCHAR *fname, const TCHAR *statefilename)
        if (inputrecord_debug) {
                if (disk_debug_logging < 1)
                        disk_debug_logging = 1 | 2;
-               inputdevice_logging |= 4 | 2;
        }
        write_log (L"inprec initialized '%s', play=%d rec=%d\n", fname ? fname : L"<internal>", input_play, input_record);
        refreshtitle ();
@@ -753,6 +756,8 @@ void inprec_playtorecord (void)
                p += len;
        }
        zfile_fwrite (inprec_buffer + header_end2, inprec_size - header_end2, 1, inprec_zf);
+       inprec_realtime (false);
+       savestate_capture_request ();
 }
 
 void inprec_setposition (int offset, int replaycounter)
index 10c4acc19ee54e9330ce67c0750b9f55f3991436..c6cdcbeb24e7f27916680e84da3be5ba4ae973dc 100644 (file)
@@ -546,16 +546,16 @@ static void cputracefunc_x_do_cycles_post (unsigned long cycles, uae_u32 v)
 {
        struct cputracememory *ctm = &cputrace.ctm[cputrace.memoryoffset - 1];
        ctm->data = v;
-       cputrace.cyclecounter_post = 0;
+       cputrace.cyclecounter_post = cycles;
        cputrace.cyclecounter_pre = 0;
        while (cycles >= CYCLE_UNIT) {
                cycles -= CYCLE_UNIT;
-               cputrace.cyclecounter_post += CYCLE_UNIT;
+               cputrace.cyclecounter_post -= CYCLE_UNIT;
                x2_do_cycles (CYCLE_UNIT);
        }
        if (cycles > 0) {
+               cputrace.cyclecounter_post -= cycles;
                x2_do_cycles (cycles);
-               cputrace.cyclecounter_post += cycles;
        }
        cputrace.cyclecounter_post = 0;
 }
@@ -573,6 +573,8 @@ static void cputracefunc2_x_do_cycles (unsigned long cycles)
        if (cycles > 0)
                x_do_cycles (cycles);
 }
+// cyclecounter_pre = how many cycles we need to SWALLOW
+// -1 = rerun whole access
 static void cputracefunc2_x_do_cycles_pre (unsigned long cycles)
 {
        if (cputrace.cyclecounter_pre == -1) {
@@ -591,17 +593,19 @@ static void cputracefunc2_x_do_cycles_pre (unsigned long cycles)
        if (cycles > 0)
                x_do_cycles (cycles);
 }
+// cyclecounter_post = how many cycles we need to WAIT
 static void cputracefunc2_x_do_cycles_post (unsigned long cycles, uae_u32 v)
 {
-       if (cputrace.cyclecounter_post > cycles) {
-               cputrace.cyclecounter_post -= cycles;
-               return;
+       uae_u32 c;
+       if (cputrace.cyclecounter_post) {
+               c = cputrace.cyclecounter_post;
+               cputrace.cyclecounter_post = 0;
+       } else {
+               c = cycles;
        }
-       cycles -= cputrace.cyclecounter_post;
-       cputrace.cyclecounter_post = 0;
        check_trace ();
-       if (cycles > 0)
-               x_do_cycles (cycles);
+       if (c > 0)
+               x_do_cycles (c);
 }
 
 static void do_cycles_post (unsigned long cycles, uae_u32 v)
@@ -3539,11 +3543,18 @@ static void m68k_run_1_ce (void)
                r->intmask = cputrace.intmask;
                r->stopped = cputrace.stopped;
                m68k_setpc (cputrace.pc);
-               if (cputrace.state > 1)
-                       Exception (cputrace.state);
-               else if (cputrace.state == 1)
-                       (*cpufunctbl[cputrace.opcode])(cputrace.opcode);
-               if (regs.stopped)
+               if (!r->stopped) {
+                       if (cputrace.state > 1) {
+                               write_log (L"CPU TRACE: EXCEPTION %d\n", cputrace.state);
+                               Exception (cputrace.state);
+                       } else if (cputrace.state == 1) {
+                               write_log (L"CPU TRACE: %04X\n", cputrace.opcode);
+                               (*cpufunctbl[cputrace.opcode])(cputrace.opcode);
+                       }
+               } else {
+                       write_log (L"CPU TRACE: STOPPED\n");
+               }
+               if (r->stopped)
                        set_special (SPCFLAG_STOP);
                set_cpu_tracer (false);
                goto cont;
@@ -3848,10 +3859,12 @@ static void m68k_run_2ce (void)
                memcpy (&caches020, &cputrace.caches020, sizeof caches020);
 
                m68k_setpc (cputrace.pc);
-               if (cputrace.state > 1)
-                       Exception (cputrace.state);
-               else if (cputrace.state == 1)
-                       docodece020 (cputrace.opcode);
+               if (!r->stopped) {
+                       if (cputrace.state > 1)
+                               Exception (cputrace.state);
+                       else if (cputrace.state == 1)
+                               docodece020 (cputrace.opcode);
+               }
                if (regs.stopped)
                        set_special (SPCFLAG_STOP);
                set_cpu_tracer (false);
@@ -4773,7 +4786,7 @@ uae_u8 *save_cpu_trace (int *len, uae_u8 *dstptr)
        save_u32 (cputrace.isp);
        save_u16 (cputrace.sr);
        save_u16 (cputrace.intmask);
-       save_u16 (cputrace.stopped);
+       save_u16 ((cputrace.stopped ? 1 : 0) | (regs.stopped ? 2 : 0));
        save_u16 (cputrace.state);
        save_u32 (cputrace.cyclecounter);
        save_u32 (cputrace.cyclecounter_pre);
index 0fe7059cee0ca28d059637bddabcb3b8cb9297e9..0b45df63235c1760af032e013c7792e017b5973c 100644 (file)
@@ -199,17 +199,30 @@ static void mfmcopy (uae_u16 *mfm, uae_u8 *data, int len)
 static int load (struct CapsTrackInfoT2 *ci, int drv, int track)
 {
        int flags;
+       struct CapsTrackInfoT1 ci1;
        
-       ci->type = 1;
        flags = caps_flags;
-
        if (canseed) {
                flags |= DI_LOCK_SETWSEED;
                ci->type = 2;
                ci->wseed = uaerand ();
+               if (pCAPSLockTrack ((PCAPSTRACKINFO)ci, caps_cont[drv], track / 2, track & 1, flags) != imgeOk)
+                       return 0;
+       } else {
+               ci1.type = 1;
+               if (pCAPSLockTrack ((PCAPSTRACKINFO)&ci1, caps_cont[drv], track / 2, track & 1, flags) != imgeOk)
+                       return 0;
+               ci->type = ci1.type;
+               ci->cylinder = ci1.cylinder;
+               ci->head = ci1.head;
+               ci->timebuf = ci1.timebuf;
+               ci->trackbuf = ci1.trackbuf;
+               ci->overlap = ci1.overlap;
+               ci->sectorcnt = ci1.sectorcnt;
+               ci->startbit = 0;
+               ci->timelen = ci1.timelen;
+               ci->tracklen = ci1.tracklen;
        }
-       if (pCAPSLockTrack ((PCAPSTRACKINFO)ci, caps_cont[drv], track / 2, track & 1, flags) != imgeOk)
-               return 0;
        return 1;
 }
 
index 92f9ec555201fea8f7bbab253be5835aaad57fc9..7e9c17868b2c8467552fe20d8f7fcc66b2cbfba6 100644 (file)
@@ -7,6 +7,13 @@
 
 #if defined (D3D) && defined (GFXFILTER)
 
+#define D3DXFX_LARGEADDRESS_HANDLE
+#ifdef D3DXFX_LARGEADDRESS_HANDLE
+#define EFFECTCOMPILERFLAGS D3DXFX_LARGEADDRESSAWARE
+#else
+#define EFFECTCOMPILERFLAGS 0
+#endif
+
 #define EFFECT_VERSION 2
 #define D3DX9DLL L"d3dx9_43.dll"
 #define TWOPASS 1
@@ -58,13 +65,13 @@ static int cursor_offset_x, cursor_offset_y;
 static float maskmult_x, maskmult_y;
 static RECT mask2rect;
 
-static D3DXMATRIX m_matProj, m_matProj2;
-static D3DXMATRIX m_matWorld, m_matWorld2;
-static D3DXMATRIX m_matView, m_matView2;
-static D3DXMATRIX m_matPreProj;
-static D3DXMATRIX m_matPreView;
-static D3DXMATRIX m_matPreWorld;
-static D3DXMATRIX postproj;
+static D3DXMATRIXA16 m_matProj, m_matProj2;
+static D3DXMATRIXA16 m_matWorld, m_matWorld2;
+static D3DXMATRIXA16 m_matView, m_matView2;
+static D3DXMATRIXA16 m_matPreProj;
+static D3DXMATRIXA16 m_matPreView;
+static D3DXMATRIXA16 m_matPreWorld;
+static D3DXMATRIXA16 postproj;
 static D3DXVECTOR4 maskmult, maskshift;
 
 static int ledwidth, ledheight;
@@ -151,7 +158,7 @@ static TCHAR *D3D_ErrorString (HRESULT dival)
        return dierr;
 }
 
-static D3DXMATRIX* MatrixOrthoOffCenterLH (D3DXMATRIX *pOut, float l, float r, float b, float t, float zn, float zf)
+static D3DXMATRIX* MatrixOrthoOffCenterLH (D3DXMATRIXA16 *pOut, float l, float r, float b, float t, float zn, float zf)
 {
        pOut->_11=2.0f/r; pOut->_12=0.0f;   pOut->_13=0.0f;  pOut->_14=0.0f;
        pOut->_21=0.0f;   pOut->_22=2.0f/t; pOut->_23=0.0f;  pOut->_24=0.0f;
@@ -160,7 +167,7 @@ static D3DXMATRIX* MatrixOrthoOffCenterLH (D3DXMATRIX *pOut, float l, float r, f
        return pOut;
 }
 
-static D3DXMATRIX* MatrixScaling (D3DXMATRIX *pOut, float sx, float sy, float sz)
+static D3DXMATRIX* MatrixScaling (D3DXMATRIXA16 *pOut, float sx, float sy, float sz)
 {
        pOut->_11=sx;     pOut->_12=0.0f;   pOut->_13=0.0f;  pOut->_14=0.0f;
        pOut->_21=0.0f;   pOut->_22=sy;     pOut->_23=0.0f;  pOut->_24=0.0f;
@@ -169,7 +176,7 @@ static D3DXMATRIX* MatrixScaling (D3DXMATRIX *pOut, float sx, float sy, float sz
        return pOut;
 }
 
-static D3DXMATRIX* MatrixTranslation (D3DXMATRIX *pOut, float tx, float ty, float tz)
+static D3DXMATRIX* MatrixTranslation (D3DXMATRIXA16 *pOut, float tx, float ty, float tz)
 {
        pOut->_11=1.0f;   pOut->_12=0.0f;   pOut->_13=0.0f;  pOut->_14=0.0f;
        pOut->_21=0.0f;   pOut->_22=1.0f;   pOut->_23=0.0f;  pOut->_24=0.0f;
@@ -264,6 +271,7 @@ static int psEffect_ParseParameters (LPD3DXEFFECTCOMPILER EffectCompiler, LPD3DX
        for(iParam = 0; iParam < EffectDesc.Parameters; iParam++) {
                LPCSTR pstrName = NULL;
                LPCSTR pstrFunction = NULL;
+               D3DXHANDLE pstrFunctionHandle = NULL;
                LPCSTR pstrTarget = NULL;
                LPCSTR pstrTextureType = NULL;
                INT Width = D3DX_DEFAULT;
@@ -310,21 +318,18 @@ static int psEffect_ParseParameters (LPD3DXEFFECTCOMPILER EffectCompiler, LPD3DX
                                        m_Hq2xLookupTextureHandle = hParam;
                        } else if(ParamDesc.Class == D3DXPC_OBJECT && ParamDesc.Type == D3DXPT_STRING) {
                                LPCSTR pstrTechnique = NULL;
-
                                if(strcmpi(ParamDesc.Semantic, "COMBINETECHNIQUE") == 0) {
                                        hr = effect->GetString(hParam, &pstrTechnique);
                                        m_CombineTechniqueEffectHandle = effect->GetTechniqueByName(pstrTechnique);
-                               }
-                               else if(strcmpi(ParamDesc.Semantic, "PREPROCESSTECHNIQUE") == 0) {
+                               } else if(strcmpi(ParamDesc.Semantic, "PREPROCESSTECHNIQUE") == 0) {
                                        hr = effect->GetString(hParam, &pstrTechnique);
                                        m_PreprocessTechnique1EffectHandle = effect->GetTechniqueByName(pstrTechnique);
-                               }
-                               else if(strcmpi(ParamDesc.Semantic, "PREPROCESSTECHNIQUE1") == 0) {
+                               } else if(strcmpi(ParamDesc.Semantic, "PREPROCESSTECHNIQUE1") == 0) {
                                        hr = effect->GetString(hParam, &pstrTechnique);
                                        m_PreprocessTechnique2EffectHandle = effect->GetTechniqueByName(pstrTechnique);
-                               }
-                               else if(strcmpi(ParamDesc.Semantic, "NAME") == 0)
+                               } else if(strcmpi(ParamDesc.Semantic, "NAME") == 0) {
                                        hr = effect->GetString(hParam, &m_strName);
+                               }
                        }
                        if (FAILED (hr)) {
                                write_log (L"ParamDesc.Semantic failed: %s\n", D3DHEAD, D3DX_ErrorString (hr, NULL));
@@ -340,27 +345,29 @@ static int psEffect_ParseParameters (LPD3DXEFFECTCOMPILER EffectCompiler, LPD3DX
                                return 0;
                        }
                        hr = S_OK;
-                       if(strcmpi(AnnotDesc.Name, "name") == 0)
+                       if(strcmpi(AnnotDesc.Name, "name") == 0) {
                                hr = effect->GetString(hAnnot, &pstrName);
-                       else if(strcmpi(AnnotDesc.Name, "function") == 0)
+                       } else if(strcmpi(AnnotDesc.Name, "function") == 0) {
                                hr = effect->GetString(hAnnot, &pstrFunction);
-                       else if(strcmpi(AnnotDesc.Name, "target") == 0)
+                               pstrFunctionHandle = effect->GetFunctionByName(pstrFunction);
+                       } else if(strcmpi(AnnotDesc.Name, "target") == 0) {
                                hr = effect->GetString(hAnnot, &pstrTarget);
-                       else if(strcmpi(AnnotDesc.Name, "width") == 0)
+                       } else if(strcmpi(AnnotDesc.Name, "width") == 0) {
                                hr = effect->GetInt(hAnnot, &Width);
-                       else if(strcmpi(AnnotDesc.Name, "height") == 0)
+                       } else if(strcmpi(AnnotDesc.Name, "height") == 0) {
                                hr = effect->GetInt(hAnnot, &Height);
-                       else if(strcmpi(AnnotDesc.Name, "depth") == 0)
+                       } else if(strcmpi(AnnotDesc.Name, "depth") == 0) {
                                hr = effect->GetInt(hAnnot, &Depth);
-                       else if(strcmpi(AnnotDesc.Name, "type") == 0)
+                       } else if(strcmpi(AnnotDesc.Name, "type") == 0) {
                                hr = effect->GetString(hAnnot, &pstrTextureType);
+                       }
                        if (FAILED (hr)) {
                                write_log (L"GetString/GetInt(%d) failed: %s\n", D3DHEAD, iAnnot, D3DX_ErrorString (hr, NULL));
                                return 0;
                        }
                }
 
-               if(pstrFunction != NULL) {
+               if(pstrFunctionHandle != NULL) {
                        LPD3DXBUFFER pTextureShader = NULL;
                        LPD3DXBUFFER lpErrors = 0;
 
@@ -368,7 +375,7 @@ static int psEffect_ParseParameters (LPD3DXEFFECTCOMPILER EffectCompiler, LPD3DX
                                pstrTarget = "tx_1_0";
 
                        if(SUCCEEDED(hr = EffectCompiler->CompileShader(
-                               pstrFunction, pstrTarget, 0, &pTextureShader, &lpErrors, NULL))) {
+                               pstrFunctionHandle, pstrTarget, D3DXSHADER_SKIPVALIDATION|D3DXSHADER_DEBUG, &pTextureShader, &lpErrors, NULL))) {
                                        LPD3DXTEXTURESHADER ppTextureShader;
                                        if (lpErrors)
                                                lpErrors->Release ();
@@ -710,6 +717,7 @@ static LPD3DXEFFECT psEffect_LoadEffect (const TCHAR *shaderfile, int full)
        DWORD compileflags = psEnabled ? 0 : D3DXSHADER_USE_LEGACY_D3DX9_31_DLL;
        int canusefile = 0, existsfile = 0;
 
+       compileflags |= EFFECTCOMPILERFLAGS;
        get_plugin_path (tmp, sizeof tmp / sizeof (TCHAR), L"filtershaders\\direct3d");
        _tcscat (tmp, shaderfile);
        if (!full) {
@@ -773,7 +781,7 @@ static LPD3DXEFFECT psEffect_LoadEffect (const TCHAR *shaderfile, int full)
        hr = D3DXCreateEffect (d3ddev,
                bp, bplen,
                NULL, NULL,
-               0,
+               EFFECTCOMPILERFLAGS,
                NULL, &effect, &Errors);
        if (FAILED (hr)) {
                write_log (L"%s: D3DXCreateEffect failed: %s\n", D3DHEAD, D3DX_ErrorString (hr, Errors));
@@ -816,7 +824,7 @@ end:
        return effect;
 }
 
-static int psEffect_SetMatrices (D3DXMATRIX *matProj, D3DXMATRIX *matView, D3DXMATRIX *matWorld)
+static int psEffect_SetMatrices (D3DXMATRIXA16 *matProj, D3DXMATRIXA16 *matView, D3DXMATRIXA16 *matWorld)
 {
        HRESULT hr;
 
@@ -842,7 +850,7 @@ static int psEffect_SetMatrices (D3DXMATRIX *matProj, D3DXMATRIX *matView, D3DXM
                }
        }
        if (m_MatWorldViewEffectHandle) {
-               D3DXMATRIX matWorldView;
+               D3DXMATRIXA16 matWorldView;
                D3DXMatrixMultiply (&matWorldView, matWorld, matView);
                hr = pEffect->SetMatrix (m_MatWorldViewEffectHandle, &matWorldView);
                if (FAILED (hr)) {
@@ -851,7 +859,7 @@ static int psEffect_SetMatrices (D3DXMATRIX *matProj, D3DXMATRIX *matView, D3DXM
                }
        }
        if (m_MatViewProjEffectHandle) {
-               D3DXMATRIX matViewProj;
+               D3DXMATRIXA16 matViewProj;
                D3DXMatrixMultiply (&matViewProj, matView, matProj);
                hr = pEffect->SetMatrix (m_MatViewProjEffectHandle, &matViewProj);
                if (FAILED (hr)) {
@@ -860,7 +868,7 @@ static int psEffect_SetMatrices (D3DXMATRIX *matProj, D3DXMATRIX *matView, D3DXM
                }
        }
        if (m_MatWorldViewProjEffectHandle) {
-               D3DXMATRIX tmp, matWorldViewProj;
+               D3DXMATRIXA16 tmp, matWorldViewProj;
                D3DXMatrixMultiply (&tmp, matWorld, matView);
                D3DXMatrixMultiply (&matWorldViewProj, &tmp, matProj);
                hr = pEffect->SetMatrix (m_MatWorldViewProjEffectHandle, &matWorldViewProj);
@@ -1555,9 +1563,9 @@ static void setupscenecoords (void)
        maskshift.x = 1.0f / maskmult_x;
        maskshift.y = 1.0f / maskmult_y;
 
-       D3DXMATRIX tmp;
-       D3DXMatrixMultiply (&tmp, &m_matWorld, &m_matView);
-       D3DXMatrixMultiply (&postproj, &tmp, &m_matProj);
+       D3DXMATRIXA16 tmpmatrix;
+       D3DXMatrixMultiply (&tmpmatrix, &m_matWorld, &m_matView);
+       D3DXMatrixMultiply (&postproj, &tmpmatrix, &m_matProj);
 }
 
 uae_u8 *getfilterbuffer3d (int *widthp, int *heightp, int *pitch, int *depth)
@@ -1716,6 +1724,8 @@ static void invalidatedeviceobjects (void)
        m_PreprocessTechnique2EffectHandle = NULL;
        m_CombineTechniqueEffectHandle = NULL;
        locked = 0;
+       maskshift.x = maskshift.y = maskshift.z = maskshift.w = 0;
+       maskmult.x = maskmult.y = maskmult.z = maskmult.w = 0;
 }
 
 static int restoredeviceobjects (void)
@@ -1776,8 +1786,6 @@ static int restoredeviceobjects (void)
 
        hr = d3ddev->SetRenderState (D3DRS_CULLMODE, D3DCULL_NONE);
        hr = d3ddev->SetRenderState (D3DRS_LIGHTING, FALSE);
-       hr = d3ddev->SetRenderState (D3DRS_ZENABLE, FALSE);
-       hr = d3ddev->SetRenderState (D3DRS_ALPHABLENDENABLE, FALSE);
 
        setupscenecoords ();
        settransform ();
@@ -2305,7 +2313,7 @@ static void D3D_render22 (void)
                D3DXVECTOR3 v;
                sprite->Begin (D3DXSPRITE_ALPHABLEND);
                if (cursorsurfaced3d && cursor_v) {
-                       D3DXMATRIX t;
+                       D3DXMATRIXA16 t;
 
                        MatrixScaling (&t, ((float)(window_w) / (tout_w + 2 * cursor_offset_x)), ((float)(window_h) / (tout_h + 2 * cursor_offset_y)), 0);
                        v.x = cursor_x + cursor_offset_x;
@@ -2318,7 +2326,7 @@ static void D3D_render22 (void)
                        sprite->SetTransform (&t);
                }
                if (mask2texture) {
-                       D3DXMATRIX t;
+                       D3DXMATRIXA16 t;
                        RECT r;
                        float srcw = mask2texture_w;
                        float srch = mask2texture_h;
index 64725fda63153656b6a786a9911841138afa5a40..a7897e0584d17f5af31bc2ef83c841484447e341 100644 (file)
@@ -18,8 +18,8 @@
 #define WINUAEPUBLICBETA 1
 #define LANG_DLL 1
 
-#define WINUAEBETA L"2"
-#define WINUAEDATE MAKEBD(2010, 10, 24)
+#define WINUAEBETA L"3"
+#define WINUAEDATE MAKEBD(2010, 10, 26)
 #define WINUAEEXTRA L""
 #define WINUAEREV L""
 
index a13187e7452f069f2494038bd1a10a147ec6a233..b7c8c739001b6b766010fde68f6c1bd1bc9b6f4a 100644 (file)
@@ -1,4 +1,71 @@
 
+Rerecorder features:
+
+Re-recorder = combined input and state recorder.
+
+- automatic (every n seconds) or manual ("Save state capture checkpoint" input event) in-memory state capture
+- circular buffered multiple state capture checkpoints (note that each state capture takes as much RAM as one uncompressed normal statefile), use "Load current state capture" to return to previous checkpoint and "Load previous state capture checkpoint" to return to previous (if more than 0.5s) or to older (if less than 0.5s to previous checkpoint) check points.
+- recording can be started from boot or you can use already existing statefile
+- When saving recording (can be done as many times as needed), following files will be created:
+  - input file (*.inp) Note that currently this includes debugging data.
+  - startup statefile (*.uss) This gets automatically loaded when starting playback.
+  - all disk image(s) that were used during recording. Used automatically when playing back.
+- during playback you can switch to recording mode any time by clicking "re-recording enabled" button (do not touch playback button). First state capture check point will be created automatically.
+- playback is 100% cycle-exactly identical to recording. Even single emulated clock cycle difference will be reported and can cause desynchs! (Amiga's shared chip ram between custom chip DMA and CPU makes this very difficult, even one incorrectly timed audio DMA fetch stealing single CPU cycle can mess up the timing completely)
+
+Requirements:
+
+MUST BE A500 most compatible (cycle-exact) Quickstart configuration.
+Only following hardware configuration entries can be modified:
+- chipset (ocs/ecs)
+- number of disk drives
+- memory size
+- Kickstart ROM
+
+This means no harddrives. Even unused or dismounted harddrive will mess up the timing.
+
+- standard and extended adf supported (including all compressed variants).
+- compatible ipf support requires 4.1 or newer library version (not yet released)
+
+- Warp mode is safe to use.
+- Most host GUI options can be changed while recording or playing. Changing input options may not be fully supported.
+
+All other hardware settings MUST BE exactly same as in original Quickstart configuration.
+(it may still work but you are on your own and you should keep your hands away from keyboard)
+
+Input file most likely won't be compatible with newer emulator versions if there is even single cycle exact mode
+timing update.
+
+It took over a month to make this usable. It takes less than one second to move this to "unsupported stupid feature" category. Think about it before posting anything stupid. (I don't care about this feature, I was bribed to do this :))
+
+
+
+- input recorder and state recorder completely rewritten and merged, it is now "re-recorder"
+  - desynch issues fixed
+  - input recording file is linked to statefile, statefile is automatically loaded with input file
+  - statefile/inputfile pair plus including all used disk images will be saved to disk when
+    "save recording" button is clicked (does not stop recording, can be saved multiple times)
+  - buffer size configuration replaced with number of states buffered (circular buffer)
+  - rewind operation change, less than 0.5s from latest state: remove newest state and jump to
+    previous state, more than 0.5s from last state: jump to newest save
+  - "rewind" = "Load previous state capture checkpoint" input event or "Load current state capture
+    cheakpoint" = "rewind" to newest capture checkpoint, never earlier
+  - rewind restore graphics glitches fixed
+  - cdtv/cd32 support (state recorder only, cd timing is not compatible with input recorder)
+  - automatic in-memory input recording, rewind automatically starts input recorder playback (if enabled),
+    any user input event (or end of input data) restarts recording.
+  - save checkpoints manually by using "Save state capture checkpoint" input event
+
+
+Beta 3:
+
+- ipf support only worked with not yet released library version (b1)
+- use original autoconfig IDs if maprom is enabled (blizkick detection checks for IDs, update probably needed in future)
+- stop blitter linedraw if bltcon0 is accessed while line draw is active (workaround for Boundless Void / Nemol)
+- Direct3D + LARGEADDRESSAWARE fix (possible fix for D3D blank screen problem?)
+
+Beta 2:
+
 - CIA timing issue in some situations (b1)
 - some 68020+ exceptions had wrong return address (b1)
 - do not attempt to save log window position if it is minimized
@@ -68,22 +135,6 @@ in this thread will disappear. !!!!!
   enabled in normal state saving because it is very difficult to keep state saving compatibility
   between versions when state is hardcoded to current emulation implementation.
 
-- input recorder and state recorder completely rewritten and merged, it is now "re-recorder"
-  - desynch issues fixed
-  - input recording file is linked to statefile, statefile is automatically loaded with input file
-  - statefile/inputfile pair plus including all used disk images will be saved to disk when
-    "save recording" button is clicked (does not stop recording, can be saved multiple times)
-  - buffer size configuration replaced with number of states buffered (circular buffer)
-  - rewind operation change, less than 0.5s from latest state: remove newest state and jump to
-    previous state, more than 0.5s from last state: jump to newest save
-  - "rewind" = "Load previous state capture checkpoint" input event or "Load current state capture
-    cheakpoint" = "rewind" to newest capture checkpoint, never earlier
-  - rewind restore graphics glitches fixed
-  - cdtv/cd32 support (state recorder only, cd timing is not compatible with input recorder)
-  - automatic in-memory input recording, rewind automatically starts input recorder playback (if enabled),
-    any user input event (or end of input data) restarts recording.
-  - save checkpoints manually by using "Save state capture checkpoint" input event
-
 
 Final 2.3.0
 
index 6d24567afe6c83aaea993349fccd8f36c714bbc9..e3b4d0123ccd97056bbe2750aa628faa001e95fc 100644 (file)
@@ -65,7 +65,7 @@
 #include "disk.h"
 
 int savestate_state = 0;
-bool savestate_first_capture;
+static int savestate_first_capture;
 
 static bool new_blitter = false;
 
@@ -632,9 +632,10 @@ void restore_state (const TCHAR *filename)
                        end = restore_ide (chunk);
                else if (!_tcsncmp (name, L"CDU", 3))
                        end = restore_cd (name[3] - '0', chunk);
+#ifdef A2065
                else if (!_tcsncmp (name, L"2065", 4))
                        end = restore_a2065 (chunk);
-
+#endif
                else if (!_tcsncmp (name, L"DMWP", 4))
                        end = restore_debug_memwatch (chunk);
 
@@ -871,8 +872,10 @@ static int save_state_internal (struct zfile *f, const TCHAR *description, int c
        dst = save_expansion (&len, 0);
        save_chunk (f, dst, len, L"EXPA", 0);
 #endif
+#ifdef A2065
        dst = save_a2065 (&len, NULL);
        save_chunk (f, dst, len, L"2065", 0);
+#endif
 #ifdef PICASSO96
        dst = save_p96 (&len, 0);
        save_chunk (f, dst, len, L"P96 ", 0);
@@ -1272,11 +1275,13 @@ void savestate_capture (int force)
                return;
        if (!input_record)
                return;
-       if (currprefs.statecapturerate && hsync_counter == 0 && input_record == INPREC_RECORD_START && savestate_first_capture) {
+       if (currprefs.statecapturerate && hsync_counter == 0 && input_record == INPREC_RECORD_START && savestate_first_capture > 0) {
                // first capture
                force = true;
                firstcapture = true;
-               savestate_first_capture = false;
+       } else if (savestate_first_capture < 0) {
+               force = true;
+               firstcapture = false;
        }
        if (!force) {
                if (currprefs.statecapturerate <= 0)
@@ -1284,6 +1289,7 @@ void savestate_capture (int force)
                if (hsync_counter % currprefs.statecapturerate)
                        return;
        }
+       savestate_first_capture = false;
 
        retrycnt = 0;
 retry2:
@@ -1292,6 +1298,7 @@ retry2:
                st = (struct staterecord*)xmalloc (uae_u8, statefile_alloc);
                st->len = statefile_alloc;
        } else if (retrycnt > 0) {
+               write_log (L"realloc %d -> %d\n", st->len, st->len + STATEFILE_ALLOC_SIZE);
                st->len += STATEFILE_ALLOC_SIZE;
                st = (struct staterecord*)xrealloc (uae_u8, st, st->len);
        }
@@ -1444,6 +1451,7 @@ retry2:
        save_inputstate (&len, p);
        tlen += len;
        p += len;
+
 #ifdef AUTOCONFIG
        if (bufcheck (st, p, len))
                goto retry;
@@ -1451,6 +1459,7 @@ retry2:
        tlen += len;
        p += len;
 #endif
+
 #ifdef PICASSO96
        if (bufcheck (st, p, 0))
                goto retry;
@@ -1463,6 +1472,7 @@ retry2:
                p += len;
        }
 #endif
+
        dst = save_cram (&len);
        if (bufcheck (st, p, len))
                goto retry;
@@ -1616,19 +1626,24 @@ void savestate_free (void)
        staterecords = NULL;
 }
 
+void savestate_capture_request (void)
+{
+       savestate_first_capture = -1;
+}
+
 void savestate_init (void)
 {
        savestate_free ();
        replaycounter = 0;
        staterecords_max = currprefs.statecapturebuffersize;
+       staterecords = xcalloc (struct staterecord*, staterecords_max);
+       statefile_alloc = STATEFILE_ALLOC_SIZE;
        if (input_record && savestate_state != STATE_DORESTORE) {
                zfile_fclose (staterecord_statefile);
                staterecord_statefile = NULL;
                inprec_close (false);
-               staterecords = xcalloc (struct staterecord*, staterecords_max);
-               statefile_alloc = STATEFILE_ALLOC_SIZE;
                inprec_open (NULL, NULL);
-               savestate_first_capture = true;
+               savestate_first_capture = 1;
        }
 }