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;
}
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);
save_u32 (acd->lc);
save_u32 (acd->pt);
save_u32 (acd->evtime);
+ save_u8 (acd->drhpos);
*len = dst - dstbak;
return dstbak;
}
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) {
}
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");
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
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);
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);
extern int savestate_dorewind (int);
extern void savestate_listrewind (void);
extern void statefile_save_recording (const TCHAR*);
+extern void savestate_capture_request (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
}
}
- 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;
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;
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];
*/
#define INPUTRECORD_DEBUG 1
+#define ENABLE_DEBUGGER 0
#define HEADERSIZE 12
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;
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 ();
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)
{
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;
}
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) {
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)
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;
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);
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);
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;
}
#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
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;
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;
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;
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;
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;
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));
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;
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 ();
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) {
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));
return effect;
}
-static int psEffect_SetMatrices (D3DXMATRIX *matProj, D3DXMATRIX *matView, D3DXMATRIX *matWorld)
+static int psEffect_SetMatrices (D3DXMATRIXA16 *matProj, D3DXMATRIXA16 *matView, D3DXMATRIXA16 *matWorld)
{
HRESULT hr;
}
}
if (m_MatWorldViewEffectHandle) {
- D3DXMATRIX matWorldView;
+ D3DXMATRIXA16 matWorldView;
D3DXMatrixMultiply (&matWorldView, matWorld, matView);
hr = pEffect->SetMatrix (m_MatWorldViewEffectHandle, &matWorldView);
if (FAILED (hr)) {
}
}
if (m_MatViewProjEffectHandle) {
- D3DXMATRIX matViewProj;
+ D3DXMATRIXA16 matViewProj;
D3DXMatrixMultiply (&matViewProj, matView, matProj);
hr = pEffect->SetMatrix (m_MatViewProjEffectHandle, &matViewProj);
if (FAILED (hr)) {
}
}
if (m_MatWorldViewProjEffectHandle) {
- D3DXMATRIX tmp, matWorldViewProj;
+ D3DXMATRIXA16 tmp, matWorldViewProj;
D3DXMatrixMultiply (&tmp, matWorld, matView);
D3DXMatrixMultiply (&matWorldViewProj, &tmp, matProj);
hr = pEffect->SetMatrix (m_MatWorldViewProjEffectHandle, &matWorldViewProj);
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)
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)
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 ();
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;
sprite->SetTransform (&t);
}
if (mask2texture) {
- D3DXMATRIX t;
+ D3DXMATRIXA16 t;
RECT r;
float srcw = mask2texture_w;
float srch = mask2texture_h;
#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""
+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
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
#include "disk.h"
int savestate_state = 0;
-bool savestate_first_capture;
+static int savestate_first_capture;
static bool new_blitter = false;
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);
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);
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)
if (hsync_counter % currprefs.statecapturerate)
return;
}
+ savestate_first_capture = false;
retrycnt = 0;
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);
}
save_inputstate (&len, p);
tlen += len;
p += len;
+
#ifdef AUTOCONFIG
if (bufcheck (st, p, len))
goto retry;
tlen += len;
p += len;
#endif
+
#ifdef PICASSO96
if (bufcheck (st, p, 0))
goto retry;
p += len;
}
#endif
+
dst = save_cram (&len);
if (bufcheck (st, p, len))
goto retry;
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;
}
}