void a2065_reset (void)
{
am_initialized = 0;
- csr[0] = csr[1] = csr[2] = csr[3] = 0;
+ csr[0] = CSR0_STOP;
+ csr[1] = csr[2] = csr[3] = 0;
rap = 0;
uaenet_close (sysdata);
csr[0] = CSR0_STOP;
if (log_a2065)
- write_log (_T("A2065: STOP.\n"));
+ write_log (_T("A2065: STOP. %04X -> %04X -> %04X\n"), oreg, v, csr[0]);
csr[3] = 0;
- am_initialized = 0;
- } else if ((csr[0] & CSR0_STRT) && !(oreg & CSR0_STRT) && (oreg & CSR0_STOP)) {
+ } else if ((csr[0] & CSR0_STRT) && !(oreg & CSR0_STRT) && (oreg & (CSR0_STOP | CSR0_INIT))) {
csr[0] &= ~CSR0_STOP;
if (!(am_mode & MODE_DTX))
csr[0] |= CSR0_TXON;
if (!(am_mode & MODE_DRX))
csr[0] |= CSR0_RXON;
+ if ((csr[0] & CSR0_INIT) && !(oreg & CSR0_INIT)) {
+ chip_init ();
+ csr[0] |= CSR0_IDON;
+ am_initialized = 1;
+ if (log_a2065)
+ write_log (_T("A2065: INIT+START. %04X -> %04X -> %04X\n"), oreg, v, csr[0]);
+ }
if (log_a2065)
- write_log (_T("A2065: START.\n"));
+ write_log (_T("A2065: START. %04X -> %04X -> %04X\n"), oreg, v, csr[0]);
- } else if ((csr[0] & CSR0_INIT) && (oreg & CSR0_STOP) && !(oreg & CSR0_INIT)) {
+ } else if ((csr[0] & CSR0_INIT) && !(oreg & CSR0_INIT) && (oreg & CSR0_STOP)) {
- if (log_a2065)
- write_log (_T("A2065: INIT.\n"));
chip_init ();
csr[0] |= CSR0_IDON;
csr[0] &= ~(CSR0_RXON | CSR0_TXON | CSR0_STOP);
am_initialized = 1;
-
+ if (log_a2065)
+ write_log (_T("A2065: INIT. %04X -> %04X -> %04X\n"), oreg, v, csr[0]);
}
if ((csr[0] & CSR0_STRT) && am_initialized) {
TCHAR *str;
int bp = ci->bootpri;
- if (!ci->autoboot)
- bp = -128;
- if (ci->donotmount)
- bp = -129;
str = cfgfile_put_multipath (&p->path_hardfile, ci->rootdir);
if (ci->type == UAEDEV_DIR) {
_stprintf (tmp, _T("%s,%s:%s:%s,%d"), ci->readonly ? _T("ro") : _T("rw"),
memcpy (&uci->ci, ci, sizeof (struct uaedev_config_info));
validatedevicename (uci->ci.devname);
validatevolumename (uci->ci.volname);
- if (uci->ci.bootpri < -128)
- uci->ci.donotmount = true;
- else if (uci->ci.bootpri >= -127)
- uci->ci.autoboot = true;
if (!uci->ci.devname[0] && ci->type != UAEDEV_CD) {
TCHAR base[32];
TCHAR base2[32];
if (!_tcsicmp (key, _T("forceload")))
uci->forceload = v;
if (!_tcsicmp (key, _T("bootpri"))) {
+ if (v < -129)
+ v = -129;
+ if (v > 127)
+ v = 127;
uci->bootpri = v;
- uci->donotmount = false;
- if (uci->bootpri <= -128) {
- uci->bootpri = -128;
- uci->donotmount = true;
- }
}
if (!_tcsicmp (key, _T("filesystem")))
_tcscpy (uci->filesys, val);
goto invalid_fs;
}
empty_fs:
- uci.autoboot = uci.bootpri >= -127;
- uci.donotmount = uci.bootpri == -129;
if (uci.rootdir[0]) {
if (_tcslen (uci.rootdir) > 3 && uci.rootdir[0] == 'H' && uci.rootdir[1] == 'D' && uci.rootdir[2] == '_') {
memmove (uci.rootdir, uci.rootdir + 2, (_tcslen (uci.rootdir + 2) + 1) * sizeof (TCHAR));
/* Would the old value be good enough? If so, leave it as it is if we want to
* be clever. */
- if (currprefs.gfx_ycenter == 2) {
- if (center_reset || (thisframe_y_adjust != prev_y_adjust
- && prev_y_adjust <= thisframe_first_drawn_line
- && prev_y_adjust + max_drawn_amiga_line > thisframe_last_drawn_line))
+ if (currprefs.gfx_ycenter == 2 && thisframe_y_adjust != prev_y_adjust) {
+ if (center_reset || (prev_y_adjust <= thisframe_first_drawn_line && prev_y_adjust + max_drawn_amiga_line > thisframe_last_drawn_line))
thisframe_y_adjust = prev_y_adjust;
}
}
mi->size = -1;
mi->ismounted = true;
if (blkdev_get_info (p, ui->hf.ci.cd_emu_unit, &di)) {
- mi->ismedia = di.media_inserted;
+ mi->ismedia = di.media_inserted != 0;
_tcscpy (mi->rootdir, di.label);
}
#if 0
uci->surfaces = 1;
}
uci->blocksize = 512;
- uci->autoboot = true;
uci->maxtransfer = 0x7fffffff;
uci->mask = 0xffffffff;
uci->bufmemtype = 1;
if (c.filesys[0])
ui->filesysdir = my_strdup (c.filesys);
ui->readonly = c.readonly;
- if (!c.autoboot)
- c.bootpri = -128;
- if (c.donotmount)
- c.bootpri = -129;
if (c.bootpri < -129)
c.bootpri = -129;
if (c.bootpri > 127)
_tcscpy (ci.devname, devname);
_tcscpy (ci.volname, volptr);
_tcscpy (ci.rootdir, rootdir);
- ci.autoboot = true;
ci.flags = MYVOLUMEINFO_REUSABLE;
nr = add_filesys_unit (&ci);
if (nr < 0)
m68k_areg (regs, 7) -= 4;
x_put_long (m68k_areg (regs, 7), ea);
m68k_areg (regs, 7) -= 2;
- x_put_long (m68k_areg (regs, 7), 0x4000 + 11 * 4);
- m68k_areg (regs, 7) -= 4;
+ x_put_word (m68k_areg (regs, 7), 0x4000 + 11 * 4);
} else {
m68k_areg (regs, 7) -= 4;
x_put_long (m68k_areg (regs, 7), ea);
m68k_areg (regs, 7) -= 2;
- x_put_long (m68k_areg (regs, 7), 0x2000 + 11 * 4);
- m68k_areg (regs, 7) -= 4;
+ x_put_word (m68k_areg (regs, 7), 0x2000 + 11 * 4);
}
+ m68k_areg (regs, 7) -= 4;
x_put_long (m68k_areg (regs, 7), newpc);
m68k_areg (regs, 7) -= 2;
- x_put_long (m68k_areg (regs, 7), regs.sr);
+ x_put_word (m68k_areg (regs, 7), regs.sr);
write_log (_T("68040/060 FPU disabled exception OP=%04X EA=%08X PC=%08X\n"), opcode, ea, oldpc);
newpc = x_get_long (regs.vbr + 11 * 4);
m68k_setpc (newpc);
ide->data_offset = 0;
get_lbachs (ide, &lba, &cyl, &head, &sec, ide->lba48);
nsec = get_nsec (ide->lba48);
- if (nsec * ide->blocksize > ide->hdhfd.size - lba * ide->blocksize)
+ if (IDE_LOG > 1)
+ write_log (_T("IDE%d off=%d, nsec=%d (%d) lba%d\n"), ide->num, (uae_u32)lba, nsec, ide->multiple_mode, ide->lba48 ? 48 : 28);
+ if (nsec * ide->blocksize > ide->hdhfd.size - lba * ide->blocksize) {
nsec = (ide->hdhfd.size - lba * ide->blocksize) / ide->blocksize;
+ if (IDE_LOG > 1)
+ write_log (_T("IDE%d nsec changed to %d\n"), ide->num, nsec);
+ }
if (nsec <= 0) {
ide_data_ready ();
ide_fail_err (IDE_ERR_IDNF);
if (IDE_LOG > 1)
write_log (_T("IDE%d write finished\n"), ide->num);
ide->regs.ide_status &= ~IDE_STATUS_DRQ;
- } else {
- if (IDE_LOG > 1)
- write_log (_T("IDE%d read finished\n"), ide->num);
}
}
ide->irq_delay = 1;
gui_flicker_led (LED_HD, ide->num, 1);
nsec = get_nsec (lba48);
get_lbachs (ide, &lba, &cyl, &head, &sec, lba48);
- if (IDE_LOG > 0)
- write_log (_T("IDE%d read off=%d, sec=%d (%d) lba%d\n"), ide->num, (uae_u32)lba, nsec, ide->multiple_mode, lba48 ? 48 : 28);
if (lba * ide->blocksize >= ide->hdhfd.size) {
ide_data_ready ();
ide_fail_err (IDE_ERR_IDNF);
static int need_endlabel;
static int n_braces, limit_braces;
-static int m68k_pc_offset;
+static int m68k_pc_offset, m68k_pc_offset_old;
static int insn_n_cycles, insn_n_cycles020;
static int ir2irc;
static void sync_m68k_pc (void)
{
+ m68k_pc_offset_old = m68k_pc_offset;
if (m68k_pc_offset == 0)
return;
incpc ("%d", m68k_pc_offset);
m68k_pc_offset = 0;
}
+static void sync_m68k_pc_noreset (void)
+{
+ sync_m68k_pc ();
+ m68k_pc_offset = m68k_pc_offset_old;
+}
+
static void addmmufixup (char *reg)
{
if (!using_mmu)
srcb = "x_get_byte";
dstb = "x_put_byte";
do_cycles = "do_cycles_ce000";
- } else if (using_ce020) {
+ } else if (using_ce020 == 1) {
/* x_ not used if it redirects to
* get_word_ce020_prefetch()
*/
do_cycles = "do_cycles_ce020";
nextw = "next_iword_020ce";
nextl = "next_ilong_020ce";
+ } else if (using_ce020 == 2) {
+ // 68030/40/60 CE
+ prefetch_long = "get_long_ce030_prefetch";
+ prefetch_word = "get_word_ce030_prefetch";
+ srcli = "x_get_ilong";
+ srcwi = "x_get_iword";
+ srcbi = "x_get_ibyte";
+ srcl = "x_get_long";
+ dstl = "x_put_long";
+ srcw = "x_get_word";
+ dstw = "x_put_word";
+ srcb = "x_get_byte";
+ dstb = "x_put_byte";
+ nextw = "next_iword_030ce";
+ nextl = "next_ilong_030ce";
} else if (using_prefetch_020) {
prefetch_word = "get_word_020_prefetch";
prefetch_long = "get_long_020_prefetch";
nextw = "next_iword_020";
nextl = "next_ilong_020";
}
-
+#if 0
} else if (using_ce020) {
disp020 = "x_get_disp_ea_020";
do_cycles = "do_cycles_ce020";
if (using_ce020 == 2) {
- // 68030 CE
+ // 68030/40/60 CE
prefetch_long = "get_long_ce030_prefetch";
prefetch_word = "get_word_ce030_prefetch";
nextw = "next_iword_030ce";
srcb = "get_byte_ce020";
dstb = "put_byte_ce020";
}
+#endif
} else if (using_mmu == 68030) {
// 68030 MMU
disp020 = "get_disp_ea_020_mmu030";
}
if (curi->dmode == Aipi || curi->dmode == Apdi)
printf ("\t\tm68k_areg (regs, dstreg) %c= %d;\n", curi->dmode == Aipi ? '-' : '+', 1 << curi->size);
- printf ("\t\top_unimpl ();\n");
+ sync_m68k_pc_noreset ();
+ printf ("\t\top_unimpl (opcode);\n");
printf ("\t\tgoto %s;\n", endlabelstr);
printf ("\t}\n");
need_endlabel = 1;
read_counts ();
for (rp = 0; rp < nr_cpuop_funcs; rp++)
opcode_next_clev[rp] = cpu_level;
- } else if (id == 22 || id == 23 || id == 24) { // 68030+ "cycle-exact"
+ } else if (id == 22 || id == 23 || id == 24) { // 68030/040/60 "cycle-exact"
cpu_level = 3 + (24 - id);
using_ce020 = 2;
if (id == 22) {
}
break;
-bad_command:
- error = IOERR_BADADDRESS;
- break;
-bad_len:
- error = IOERR_BADLENGTH;
- break;
-no_disk:
- error = 29; /* no disk */
- break;
-
case NSCMD_DEVICEQUERY:
put_long (dataptr + 0, 0);
put_long (dataptr + 4, 16); /* size */
}
break;
+bad_command:
+ error = IOERR_BADADDRESS;
+ break;
+bad_len:
+ error = IOERR_BADLENGTH;
+ break;
+no_disk:
+ error = 29; /* no disk */
+ break;
+
default:
/* Command not understood. */
error = IOERR_NOCMD;
#endif
extern uae_u32 REGPARAM3 op_illg (uae_u32) REGPARAM;
-extern void REGPARAM3 op_unimpl (void) REGPARAM;
+extern void REGPARAM3 op_unimpl (uae_u16) REGPARAM;
typedef uae_u8 flagtype;
extern void REGPARAM3 MakeSR (void) REGPARAM;
extern void REGPARAM3 MakeFromSR (void) REGPARAM;
extern void REGPARAM3 Exception (int) REGPARAM;
+extern void REGPARAM3 Exception (int, uaecptr) REGPARAM;
extern void NMI (void);
extern void NMI_delayed (void);
extern void prepare_interrupt (uae_u32);
extern void exception3 (uae_u32 opcode, uaecptr addr);
extern void exception3i (uae_u32 opcode, uaecptr addr);
-extern void exception3 (uae_u32 opcode, uaecptr addr, int w, int i, uaecptr pc);
+extern void exception3 (uae_u32 opcode, uaecptr addr, bool w, bool i, uaecptr pc);
extern void exception2 (uaecptr addr);
extern void cpureset (void);
extern void cpu_halt (int id);
#define UAEDEV_DIR 0
#define UAEDEV_HDF 1
#define UAEDEV_CD 2
+
+#define BOOTPRI_NOAUTOBOOT -128
+#define BOOTPRI_NOAUTOMOUNT -129
+#define ISAUTOBOOT(ci) ((ci)->bootpri > BOOTPRI_NOAUTOBOOT)
+#define ISAUTOMOUNT(ci) ((ci)->bootpri > BOOTPRI_NOAUTOMOUNT)
struct uaedev_config_info {
int type;
TCHAR devname[MAX_DPATH];
TCHAR rootdir[MAX_DPATH];
bool readonly;
int bootpri;
- bool autoboot;
- bool donotmount;
TCHAR filesys[MAX_DPATH];
int lowcyl;
int highcyl; // zero if detected from size
break;
}
+ if (p->cpu_model >= 68040 && p->cachesize && p->cpu_compatible)
+ p->cpu_compatible = false;
+
if (p->cpu_model < 68030 || p->cachesize)
p->mmu_model = 0;
if ((opcode & 0xf000) == 0xf000 || currprefs.cpu_model < 68060)
op_illg (opcode);
else
- op_unimpl ();
+ op_unimpl (opcode);
return 4;
}
Exception_build_stack_frame(oldpc, currpc, regs.mmu_ssw, nr, 0x2);
} else if (regs.m && nr >= 24 && nr < 32) { /* M + Interrupt */
Exception_build_stack_frame(oldpc, currpc, regs.mmu_ssw, nr, 0x1);
+ } else if (nr == 61) {
+ Exception_build_stack_frame(oldpc, regs.instruction_pc, regs.mmu_ssw, nr, 0x0);
} else {
Exception_build_stack_frame(oldpc, currpc, regs.mmu_ssw, nr, 0x0);
}
exception_trace (nr);
}
-void REGPARAM2 Exception (int nr)
+// address = format $2 stack frame address field
+static void ExceptionX (int nr, uaecptr address)
{
regs.exception = nr;
if (cpu_tracer) {
cputrace.state = nr;
}
+#ifdef JIT
if (currprefs.cachesize)
- regs.instruction_pc = m68k_getpc ();
+ regs.instruction_pc = address == -1 ? m68k_getpc () : address;
+#endif
#ifdef CPUEMU_12
if (currprefs.cpu_cycle_exact && currprefs.cpu_model == 68000)
Exception_ce000 (nr);
}
}
+void REGPARAM2 Exception (int nr)
+{
+ ExceptionX (nr, -1);
+}
+void REGPARAM2 Exception (int nr, uaecptr address)
+{
+ ExceptionX (nr, address);
+}
+
STATIC_INLINE void do_interrupt (int nr)
{
if (debug_dma)
void m68k_divl (uae_u32 opcode, uae_u32 src, uae_u16 extra)
{
if ((extra & 0x400) && currprefs.cpu_compatible && currprefs.cpu_model == 68060) {
- op_unimpl ();
+ op_unimpl (opcode);
return;
}
if (src == 0) {
void m68k_mull (uae_u32 opcode, uae_u32 src, uae_u16 extra)
{
if ((extra & 0x400) && currprefs.cpu_compatible && currprefs.cpu_model == 68060) {
- op_unimpl ();
+ op_unimpl (opcode);
return;
}
#if defined (uae_s64)
fill_prefetch_quick ();
}
-void REGPARAM2 op_unimpl (void)
+void REGPARAM2 op_unimpl (uae_u16 opcode)
{
- Exception (61);
+ static int warned;
+ if (warned < 20) {
+ write_log (_T("68060 unimplemented opcode %04X, PC=%08x\n"), opcode, regs.instruction_pc);
+ warned++;
+ }
+ Exception (61, regs.instruction_pc);
}
uae_u32 REGPARAM2 op_illg (uae_u32 opcode)
/* Take note: This is the do-it-normal loop */
uae_u16 opcode;
+ regs.instruction_pc = m68k_getpc ();
if (currprefs.cpu_compatible) {
- opcode = get_word_020_prefetchf (m68k_getpc ());
+ opcode = get_word_020_prefetchf (regs.instruction_pc);
} else {
opcode = get_iword (0);
}
if (currprefs.cpu_model >= 68040)
addr &= ~1;
if (currprefs.cpu_model >= 68020) {
- last_addr_for_exception_3 = regs.instruction_pc;
+ if (pc == 0xffffffff)
+ last_addr_for_exception_3 = regs.instruction_pc;
+ else
+ last_addr_for_exception_3 = pc;
} else if (pc == 0xffffffff) {
last_addr_for_exception_3 = m68k_getpc () + 2;
} else {
{
exception3f (opcode, addr, 0, 1, 0xffffffff);
}
-void exception3 (uae_u32 opcode, uaecptr addr, int w, int i, uaecptr pc)
+void exception3 (uae_u32 opcode, uaecptr addr, bool w, bool i, uaecptr pc)
{
exception3f (opcode, addr, w, i, pc);
}
struct shaderdata
{
- int type; // 0 = before , 1 = after, 2 = post
+ int type;
int psPreProcess;
LPDIRECT3DTEXTURE9 lpWorkTexture1;
LPDIRECT3DTEXTURE9 lpWorkTexture2;
LPDIRECT3DTEXTURE9 lpTempTexture;
LPD3DXEFFECT pEffect;
- D3DXEFFECT_DESC EffectDesc;
// Technique stuff
D3DXHANDLE m_PreprocessTechnique1EffectHandle;
D3DXHANDLE m_PreprocessTechnique2EffectHandle;
return true;
}
-static int psEffect_ParseParameters (LPD3DXEFFECTCOMPILER EffectCompiler, LPD3DXEFFECT effect, struct shaderdata *s)
+static int psEffect_ParseParameters (LPD3DXEFFECTCOMPILER EffectCompiler, LPD3DXEFFECT effect, D3DXEFFECT_DESC EffectDesc, struct shaderdata *s)
{
HRESULT hr = S_OK;
// Look at parameters for semantics and annotations that we know how to interpret
LPDIRECT3DBASETEXTURE9 pTex = NULL;
UINT iParam, iAnnot;
+
if(effect == NULL)
return 0;
- for(iParam = 0; iParam < s->EffectDesc.Parameters; iParam++) {
+ for(iParam = 0; iParam < EffectDesc.Parameters; iParam++) {
LPCSTR pstrName = NULL;
LPCSTR pstrFunction = NULL;
D3DXHANDLE pstrFunctionHandle = NULL;
DWORD compileflags = psEnabled ? 0 : D3DXSHADER_USE_LEGACY_D3DX9_31_DLL;
int canusefile = 0, existsfile = 0;
bool plugin_path;
+ D3DXEFFECT_DESC EffectDesc;
compileflags |= EFFECTCOMPILERFLAGS;
plugin_path = get_plugin_path (tmp, sizeof tmp / sizeof (TCHAR), _T("filtershaders\\direct3d"));
write_log (_T("%s: D3DXCreateEffect failed: %s\n"), D3DHEAD, D3DX_ErrorString (hr, Errors));
goto end;
}
- hr = effect->GetDesc (&s->EffectDesc);
+ hr = effect->GetDesc (&EffectDesc);
if (FAILED (hr)) {
write_log (_T("%s: effect->GetDesc() failed: %s\n"), D3DHEAD, D3DX_ErrorString (hr, Errors));
goto end;
}
if (full) {
- if (!psEffect_ParseParameters (EffectCompiler, effect, s))
+ if (!psEffect_ParseParameters (EffectCompiler, effect, EffectDesc, s))
goto end;
} else {
if (!postEffect_ParseParameters (EffectCompiler, effect, s))
}
ret = 1;
if (plugin_path && filenotificationhandle == NULL)
- filenotificationhandle = FindFirstChangeNotification (tmp3, FALSE, FILE_NOTIFY_CHANGE_LAST_WRITE);
+ filenotificationhandle = FindFirstChangeNotification (tmp3, FALSE, FILE_NOTIFY_CHANGE_LAST_WRITE);
end:
if (Errors)
Errors->Release ();
static int createtexture (int ow, int oh, int win_w, int win_h)
{
HRESULT hr;
+ bool haveafter = false;
int w, h;
#if 0
return 0;
}
if (shaders[i].type == SHADERTYPE_AFTER) {
+ haveafter = true;
if (!allocextratextures (&shaders[i], window_w, window_h))
return 0;
}
}
}
- if (FAILED (hr = d3ddev->CreateTexture (window_w, window_h, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &lpPostTempTexture, NULL))) {
- write_log (_T("%s: Failed to create working texture1: %s\n"), D3DHEAD, D3D_ErrorString (hr));
- return 0;
+
+
+ if (haveafter) {
+ if (FAILED (hr = d3ddev->CreateTexture (window_w, window_h, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &lpPostTempTexture, NULL))) {
+ write_log (_T("%s: Failed to create working texture1: %s\n"), D3DHEAD, D3D_ErrorString (hr));
+ return 0;
+ }
}
write_log (_T("%s: working texture allocated pre %d*%d, post %d*%d, bits per pixel %d\n"), D3DHEAD, w, h, window_w, window_h, t_depth);
texelsize.x = 1.0f / w; texelsize.y = 1.0f / h; texelsize.z = 1; texelsize.w = 1;
lpHq2xLookupTexture->Release ();
lpHq2xLookupTexture = NULL;
}
+ for (int i = 0; i < MAX_SHADERS; i++) {
+ struct shaderdata *s = &shaders[i];
+ if (s->lpTempTexture) {
+ s->lpTempTexture->Release ();
+ s->lpTempTexture = NULL;
+ }
+ if (s->lpWorkTexture1) {
+ s->lpWorkTexture1->Release ();
+ s->lpWorkTexture1 = NULL;
+ }
+ if (s->lpWorkTexture2) {
+ s->lpWorkTexture2->Release ();
+ s->lpWorkTexture2 = NULL;
+ }
+ }
+ if (lpPostTempTexture) {
+ lpPostTempTexture->Release();
+ lpPostTempTexture = NULL;
+ }
}
static void getswapchain (void)
static void invalidatedeviceobjects (void)
{
- if (filenotificationhandle != NULL)
+ if (filenotificationhandle != NULL)
FindCloseChangeNotification (filenotificationhandle);
filenotificationhandle = NULL;
freetextures ();
shaders[i].pEffect->Release ();
shaders[i].pEffect = NULL;
}
- if (shaders[i].lpTempTexture) {
- shaders[i].lpTempTexture->Release ();
- shaders[i].lpTempTexture = NULL;
- }
- if (shaders[i].lpWorkTexture1) {
- shaders[i].lpWorkTexture1->Release ();
- shaders[i].lpWorkTexture1 = NULL;
- }
- if (shaders[i].lpWorkTexture2) {
- shaders[i].lpWorkTexture2->Release ();
- shaders[i].lpWorkTexture2 = NULL;
- }
memset (&shaders[i], 0, sizeof (struct shaderdata));
}
- if (lpPostTempTexture) {
- lpPostTempTexture->Release();
- lpPostTempTexture = NULL;
- }
if (d3ddev)
d3ddev->SetStreamSource (0, NULL, 0, 0);
if (vertexBuffer) {
d3d = NULL;
}
d3d_enabled = 0;
- psActive = 0;
+ psActive = FALSE;
resetcount = 0;
devicelost = 0;
renderdisabled = false;
}
}
-typedef BOOL (CALLBACK* GETVOLUMEPATHNAME)
- (LPCTSTR lpszFileName, LPTSTR lpszVolumePathName, DWORD cchBufferLength);
-
int my_getvolumeinfo (const TCHAR *root)
{
DWORD v, err;
int ret = 0;
- GETVOLUMEPATHNAME pGetVolumePathName;
TCHAR volume[MAX_DPATH];
v = GetFileAttributesSafe (root);
if (v & FILE_ATTRIBUTE_READONLY)
ret |= MYVOLUMEINFO_READONLY;
*/
- pGetVolumePathName = (GETVOLUMEPATHNAME)GetProcAddress(
- GetModuleHandle (_T("kernel32.dll")), "GetVolumePathNameW");
- if (pGetVolumePathName && pGetVolumePathName (root, volume, sizeof (volume))) {
+ if (GetVolumePathName (root, volume, sizeof (volume))) {
TCHAR fsname[MAX_DPATH];
DWORD comlen;
DWORD flags;
- if (GetVolumeInformation (volume, NULL, 0, NULL, &comlen, &flags, fsname, sizeof (fsname))) {
+ if (GetVolumeInformation (volume, NULL, 0, NULL, &comlen, &flags, fsname, sizeof fsname / sizeof (TCHAR))) {
//write_log (_T("Volume %s FS=%s maxlen=%d flags=%08X\n"), volume, fsname, comlen, flags);
if (flags & FILE_NAMED_STREAMS)
ret |= MYVOLUMEINFO_STREAMS;
return _tfopen (name, _T("r"));
}
+typedef BOOL (CALLBACK* GETVOLUMEINFORMATIONBYHANDLEW)
+ (_In_ HANDLE hFile,
+ LPWSTR lpVolumeNameBuffer,
+ DWORD nVolumeNameSize,
+ LPDWORD lpVolumeSerialNumber,
+ LPDWORD lpMaximumComponentLength,
+ LPDWORD lpFileSystemFlags,
+ LPWSTR lpFileSystemNameBuffer,
+ DWORD nFileSystemNameSize);
+
+
+static bool isfat (HANDLE h)
+{
+ TCHAR fsname[MAX_DPATH];
+ DWORD comlen;
+ DWORD flags;
+ GETVOLUMEINFORMATIONBYHANDLEW pGetVolumeInformationByHandleW;
+
+ pGetVolumeInformationByHandleW = (GETVOLUMEINFORMATIONBYHANDLEW)GetProcAddress(
+ GetModuleHandle (_T("kernel32.dll")), "GetVolumeInformationByHandleW");
+ if (!pGetVolumeInformationByHandleW)
+ return false;
+ if (pGetVolumeInformationByHandleW (h, NULL, NULL, NULL, &comlen, &flags, fsname, sizeof fsname / sizeof (TCHAR))) {
+ if (!_tcsncmp (fsname, _T("FAT"), 3)) {
+ return true;
+ }
+ }
+ return false;
+}
+
bool my_stat (const TCHAR *name, struct mystat *statbuf)
{
DWORD attr, ok;
HANDLE h;
BY_HANDLE_FILE_INFORMATION fi;
const TCHAR *namep;
+ bool fat;
TCHAR path[MAX_DPATH];
-
+
if (currprefs.win32_filesystem_mangle_reserved_names == false) {
_tcscpy (path, PATHPREFIX);
_tcscat (path, name);
h = CreateFile (namep, 0, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS, NULL);
if (h == INVALID_HANDLE_VALUE)
return false;
+ fat = isfat (h);
+
ok = GetFileInformationByHandle (h, &fi);
CloseHandle (h);
ft.dwHighDateTime = ft.dwLowDateTime = 0;
if (ok) {
attr = fi.dwFileAttributes;
- ft = fi.ftLastWriteTime;
+ if (fat) {
+ // fat lastwritetime only has 2 second resolution
+ // fat creationtime has 10ms resolution
+ // use creationtime if creationtime is inside lastwritetime 2s resolution
+ ULARGE_INTEGER ct, wt;
+ ct.HighPart = fi.ftCreationTime.dwHighDateTime;
+ ct.LowPart = fi.ftCreationTime.dwLowDateTime;
+ wt.HighPart = fi.ftLastWriteTime.dwHighDateTime;
+ wt.LowPart = fi.ftLastWriteTime.dwLowDateTime;
+ uae_u64 ctsec = ct.QuadPart / 10000000;
+ uae_u64 wtsec = wt.QuadPart / 10000000;
+ if (wtsec == ctsec || wtsec + 1 == ctsec) {
+ ft = fi.ftCreationTime;
+ } else {
+ ft = fi.ftLastAccessTime;
+ }
+ } else {
+ ft = fi.ftLastWriteTime;
+ }
statbuf->size = ((uae_u64)fi.nFileSizeHigh << 32) | fi.nFileSizeLow;
} else {
write_log (_T("GetFileInformationByHandle(%s) failed: %d\n"), namep, GetLastError ());
#define LANG_DLL 1
#if WINUAEPUBLICBETA
-#define WINUAEBETA _T("6")
+#define WINUAEBETA _T("7")
#else
#define WINUAEBETA _T("")
#endif
-#define WINUAEDATE MAKEBD(2013, 2, 3)
+#define WINUAEDATE MAKEBD(2013, 2, 9)
#define WINUAEEXTRA _T("")
//#define WINUAEEXTRA _T("AmiKit Preview")
#define WINUAEREV _T("")
#endif
ci.readonly = !rw;
ci.bootpri = -20 - drvnum;
- ci.autoboot = true;
//write_log (_T("Drive type %d: '%s' '%s'\n"), drivetype, volumepath, volumename);
add_filesys_unit (&ci);
drvnum++;
pDwmEnableMMCSS (state);
}
+static void freesoftbuffer (struct vidbuffer *buf)
+{
+ xfree (buf->realbufmem);
+ memset (buf, 0, sizeof (struct vidbuffer));
+}
+
void close_windows (void)
{
changevblankthreadmode (VBLANKTH_IDLE);
#if defined (GFXFILTER)
S2X_free ();
#endif
- xfree (gfxvidinfo.drawbuffer.realbufmem);
- xfree (gfxvidinfo.tempbuffer.realbufmem);
- memset (&gfxvidinfo.drawbuffer, 0, sizeof (struct vidbuffer));
- memset (&gfxvidinfo.tempbuffer, 0, sizeof (struct vidbuffer));
+ freesoftbuffer (&gfxvidinfo.drawbuffer);
+ freesoftbuffer (&gfxvidinfo.tempbuffer);
DirectDraw_Release ();
close_hwnds ();
}
buf->bufmemend = buf->realbufmem + size - buf->rowbytes;
buf->bufmem_lockable = true;
- write_log (_T("Allocated %s temp buffer (%d*%d*%d)\n"), name, width, height, depth);
+ write_log (_T("Allocated %s temp buffer (%d*%d*%d) = %p\n"), name, width, height, depth, buf->realbufmem);
}
}
#endif
gfxvidinfo.drawbuffer.emergmem = scrlinebuf; // memcpy from system-memory to video-memory
- xfree (gfxvidinfo.drawbuffer.realbufmem);
+ freesoftbuffer (&gfxvidinfo.drawbuffer);
+ freesoftbuffer (&gfxvidinfo.tempbuffer);
gfxvidinfo.drawbuffer.realbufmem = NULL;
gfxvidinfo.drawbuffer.bufmem = NULL;
gfxvidinfo.drawbuffer.bufmem_allocated = NULL;
static void default_fsvdlg (struct fsvdlg_vals *f)
{
memset (f, 0, sizeof (struct fsvdlg_vals));
- f->ci.autoboot = true;
f->ci.type = UAEDEV_DIR;
}
static void default_hfdlg (struct hfdlg_vals *f, bool rdb)
SetDlgItemText (hDlg, IDC_VOLUME_NAME, current_fsvdlg.ci.volname);
SetDlgItemText (hDlg, IDC_VOLUME_DEVICE, current_fsvdlg.ci.devname);
SetDlgItemText (hDlg, IDC_PATH_NAME, current_fsvdlg.ci.rootdir);
- SetDlgItemInt (hDlg, IDC_VOLUME_BOOTPRI, current_fsvdlg.ci.bootpri >= -127 ? current_fsvdlg.ci.bootpri : -127, TRUE);
+ SetDlgItemInt (hDlg, IDC_VOLUME_BOOTPRI, current_fsvdlg.ci.bootpri, TRUE);
if (archivehd > 0)
current_fsvdlg.ci.readonly = true;
CheckDlgButton (hDlg, IDC_FS_RW, !current_fsvdlg.ci.readonly);
- CheckDlgButton (hDlg, IDC_FS_AUTOBOOT, current_fsvdlg.ci.autoboot);
- current_fsvdlg.ci.donotmount = 0;
+ CheckDlgButton (hDlg, IDC_FS_AUTOBOOT, ISAUTOBOOT(¤t_fsvdlg.ci));
ew (hDlg, IDC_FS_RW, archivehd <= 0);
recursive--;
}
GetDlgItemText (hDlg, IDC_VOLUME_DEVICE, current_fsvdlg.ci.devname, sizeof current_fsvdlg.ci.devname / sizeof (TCHAR));
current_fsvdlg.ci.readonly = !ischecked (hDlg, IDC_FS_RW);
current_fsvdlg.ci.bootpri = GetDlgItemInt (hDlg, IDC_VOLUME_BOOTPRI, NULL, TRUE);
- current_fsvdlg.ci.autoboot = ischecked (hDlg, IDC_FS_AUTOBOOT);
+ if(LOWORD (wParam) == IDC_FS_AUTOBOOT) {
+ if (!ischecked (hDlg, IDC_FS_AUTOBOOT)) {
+ current_fsvdlg.ci.bootpri = BOOTPRI_NOAUTOBOOT;
+ } else {
+ current_fsvdlg.ci.bootpri = 0;
+ }
+ SetDlgItemInt (hDlg, IDC_VOLUME_BOOTPRI, current_fsvdlg.ci.bootpri, TRUE);
+ }
recursive--;
break;
}
SetDlgItemInt (hDlg, IDC_HEADS, current_hfdlg.ci.surfaces, FALSE);
SetDlgItemInt (hDlg, IDC_RESERVED, current_hfdlg.ci.reserved, FALSE);
SetDlgItemInt (hDlg, IDC_BLOCKSIZE, current_hfdlg.ci.blocksize, FALSE);
- SetDlgItemInt (hDlg, IDC_HARDFILE_BOOTPRI, current_hfdlg.ci.bootpri >= -127 ? current_hfdlg.ci.bootpri : -127, TRUE);
+ SetDlgItemInt (hDlg, IDC_HARDFILE_BOOTPRI, current_hfdlg.ci.bootpri, TRUE);
CheckDlgButton (hDlg, IDC_HDF_RW, !current_hfdlg.ci.readonly);
- CheckDlgButton (hDlg, IDC_HDF_AUTOBOOT, current_hfdlg.ci.autoboot);
- CheckDlgButton (hDlg, IDC_HDF_DONOTMOUNT, current_hfdlg.ci.donotmount);
+ CheckDlgButton (hDlg, IDC_HDF_AUTOBOOT, ISAUTOBOOT(¤t_hfdlg.ci));
+ CheckDlgButton (hDlg, IDC_HDF_DONOTMOUNT, !ISAUTOMOUNT(¤t_hfdlg.ci));
ew (hDlg, IDC_HDF_RDB, !rdb);
ew (hDlg, IDC_HDF_AUTOBOOT, TRUE);
ew (hDlg, IDC_HDF_DONOTMOUNT, TRUE);
hdf->ci.reserved = 0;
hdf->ci.filesys[0] = 0;
hdf->ci.bootpri = 0;
- hdf->ci.autoboot = 1;
- hdf->ci.donotmount = 0;
hdf->ci.devname[0] = 0;
break;
}
#endif
_tcscpy (fs, current_hfdlg.ci.filesys);
_tcscpy (dev, current_hfdlg.ci.devname);
- bool autoboot = current_hfdlg.ci.autoboot;
bool rw = current_hfdlg.ci.readonly;
- bool donot = current_hfdlg.ci.donotmount;
int bootpri = current_hfdlg.ci.bootpri;
hdctrlr = current_hfdlg.ci.controller;
default_hfdlg (¤t_hfdlg, false);
_tcscpy (current_hfdlg.ci.devname, dev);
current_hfdlg.ci.controller = hdctrlr;
current_hfdlg.ci.bootpri = bootpri;
- current_hfdlg.ci.autoboot = autoboot;
current_hfdlg.ci.readonly = rw;
- current_hfdlg.ci.donotmount = donot;
hardfileselecthdf (hDlg, NULL);
#if 0
if (oldsize > 0 && oldsize == current_hfdlg.size) {
current_hfdlg.ci.readonly = !ischecked (hDlg, IDC_HDF_RW);
break;
case IDC_HDF_AUTOBOOT:
- current_hfdlg.ci.autoboot = ischecked (hDlg, IDC_HDF_AUTOBOOT);
- if (current_hfdlg.ci.autoboot && current_hfdlg.ci.donotmount) {
- current_hfdlg.ci.donotmount = false;
+ if (ischecked (hDlg, IDC_HDF_AUTOBOOT)) {
+ current_hfdlg.ci.bootpri = 0;
setchecked (hDlg, IDC_HDF_DONOTMOUNT, false);
+ } else {
+ current_hfdlg.ci.bootpri = BOOTPRI_NOAUTOBOOT;
}
+ SetDlgItemInt (hDlg, IDC_HARDFILE_BOOTPRI, current_hfdlg.ci.bootpri, TRUE);
break;
case IDC_HDF_DONOTMOUNT:
- current_hfdlg.ci.donotmount = ischecked (hDlg, IDC_HDF_DONOTMOUNT);
- if (current_hfdlg.ci.donotmount && current_hfdlg.ci.autoboot) {
- current_hfdlg.ci.autoboot = false;
+ if (ischecked (hDlg, IDC_HDF_DONOTMOUNT)) {
+ current_hfdlg.ci.bootpri = BOOTPRI_NOAUTOMOUNT;
setchecked (hDlg, IDC_HDF_AUTOBOOT, false);
+ } else {
+ current_hfdlg.ci.bootpri = BOOTPRI_NOAUTOBOOT;
+ setchecked (hDlg, IDC_HDF_AUTOBOOT, true);
}
+ SetDlgItemInt (hDlg, IDC_HARDFILE_BOOTPRI, current_hfdlg.ci.bootpri, TRUE);
break;
case IDC_HDF_RDB:
SetDlgItemInt (hDlg, IDC_SECTORS, 0, FALSE);
SetDlgItemText (hDlg, IDC_HARDFILE_DEVICE, _T(""));
current_hfdlg.ci.sectors = current_hfdlg.ci.reserved = current_hfdlg.ci.surfaces = 0;
current_hfdlg.ci.bootpri = 0;
- current_hfdlg.ci.autoboot = true;
- current_hfdlg.ci.donotmount = false;
sethardfile (hDlg);
break;
case IDC_SECTORS:
return FALSE;
}
-static int tweakbootpri (int bp, int ab, int dnm)
-{
- if (dnm)
- return -129;
- if (!ab)
- return -128;
- if (bp < -127)
- bp = -127;
- return bp;
-}
-
static void new_filesys (HWND hDlg, int entry)
{
struct uaedev_config_data *uci;
struct uaedev_config_info ci;
- int bp = tweakbootpri (current_fsvdlg.ci.bootpri, current_fsvdlg.ci.autoboot, current_fsvdlg.ci.donotmount);
memcpy (&ci, ¤t_fsvdlg.ci, sizeof (struct uaedev_config_info));
- ci.bootpri = bp;
uci = add_filesys_config (&workprefs, entry, &ci);
if (uci) {
if (uci->ci.rootdir[0])
{
struct uaedev_config_data *uci;
struct uaedev_config_info ci;
- int bp = tweakbootpri (current_hfdlg.ci.bootpri, current_hfdlg.ci.autoboot, current_hfdlg.ci.donotmount);
memcpy (&ci, ¤t_hfdlg.ci, sizeof (struct uaedev_config_info));
- ci.bootpri = bp;
uci = add_filesys_config (&workprefs, entry, &ci);
if (uci) {
struct hardfiledata *hfd = get_hardfile_data (uci->configoffset);
- restore only single input target to default.
-MMU emulation is now considered mostly done. Some minor bugs probably still exist but Amix, NetBSD, Debian
-Linux, Enforcer and WHDLoad MMU option seem to work fine.
+Beta 7:
+
+- In JIT mode format 2 stack frames had wrong address field contents, this also broke 68060 unimplemented integer
+ instruction exceptions (64-bit variants of DIVL and MULL).
+- GUI boot priority/autoboot/automount handling fixed and simplified.
+- 68030 "cycle-exact" mode used 020 instruction cache emulation code. No guarantees that this fixes all 68030 "CE" problems.
+- D3D texture memory leak fixed (b6)
+- A2024/Graffiti extra display buffer memory leak fixed.
+- 1/50s file modification date also supported on FAT volumes. Returns FAT file creation date (which has 10ms resolution,
+ file modification date only has 2s resolution) if it is inside file modifcation date's 2s resolution.
+- 68040+ "no FPU" exception stack frame still had incorrect data.
+- Disable 68040/060 CPU "More compatible" option if JIT is enabled. JIT active and not emulating unimplemented
+ instructions isn't safe because JIT and normal emulation does not always agree which instructions are supported.
+- A2065 emulation tweak, Ethernet chip documentation STOP/STRT/INIT bit documentation is not very clear.
Beta 6:
+MMU emulation is now considered mostly done. Some minor bugs probably still exist but Amix, NetBSD, Debian
+Linux, Enforcer and WHDLoad MMU option seem to work fine.
+
- SCSI and IDE emulation HD and CD read and write commands are now executed in background thread, slow devices
(for example real optical drive) won't temporarily pause the emulation anymore.
- ATAPI CD emulation didn't support split data transfers. Fixes NetBSD installer unpack error.