lold = left_word_saved[saved_ptr] - SOUND16_BASE_VAL;
tmp = (rnew * mixed_mul2 + lold * mixed_mul1) / MIXED_STEREO_SCALE;
tmp += SOUND16_BASE_VAL;
- PUT_SOUND_WORD_RIGHT (tmp);
rold = right_word_saved[saved_ptr] - SOUND16_BASE_VAL;
w = (lnew * mixed_mul2 + rold * mixed_mul1) / MIXED_STEREO_SCALE;
+
+ PUT_SOUND_WORD_LEFT (w);
+ PUT_SOUND_WORD_RIGHT (tmp);
+ } else {
+ PUT_SOUND_WORD_LEFT (w);
}
- PUT_SOUND_WORD_LEFT (w);
}
STATIC_INLINE void put_sound_word_right2 (uae_u32 w)
lold = left2_word_saved[saved_ptr2] - SOUND16_BASE_VAL;
tmp = (rnew * mixed_mul2 + lold * mixed_mul1) / MIXED_STEREO_SCALE;
tmp += SOUND16_BASE_VAL;
- PUT_SOUND_WORD_RIGHT2 (tmp);
rold = right2_word_saved[saved_ptr2] - SOUND16_BASE_VAL;
w = (lnew * mixed_mul2 + rold * mixed_mul1) / MIXED_STEREO_SCALE;
+
+ PUT_SOUND_WORD_LEFT2 (w);
+ PUT_SOUND_WORD_RIGHT2 (tmp);
+ } else {
+ PUT_SOUND_WORD_LEFT2 (w);
}
- PUT_SOUND_WORD_LEFT2 (w);
}
L"-", L"Generic", L"CDTV", L"CD32", L"A500", L"A500+", L"A600",
L"A1000", L"A1200", L"A2000", L"A3000", L"A3000T", L"A4000", L"A4000T", 0
};
+static const TCHAR *qsmodes[] = {
+ L"A500", L"A500+", L"A600", L"A1000", L"A1200", L"A3000", L"A4000", L"", L"CD32", L"CDTV", L"ARCADIA", NULL };
/* 3-state boolean! */
static const TCHAR *fullmodes[] = { L"false", L"true", /* "FILE_NOT_FOUND", */ L"fullwindow", 0 };
/* bleh for compatibility */
L"rugby coach", L"cricket captain", L"leviathan",
NULL
};
-static const TCHAR *parportsampler[] = { L"none", L"mono", L"stereo", NULL };
static const TCHAR *obsolete[] = {
L"accuracy", L"gfx_opengl", L"gfx_32bit_blits", L"32bit_blits",
cfgfile_write_bool (f, L"parallel_postscript_detection", p->parallel_postscript_detection);
cfgfile_write_str (f, L"ghostscript_parameters", p->ghostscript_parameters);
cfgfile_write (f, L"parallel_autoflush", L"%d", p->parallel_autoflush_time);
- cfgfile_dwrite_str (f, L"parallel_sampler", parportsampler[p->parallel_sampler]);
cfgfile_dwrite (f, L"uae_hide", L"%d", p->uae_hide);
cfgfile_dwrite_bool (f, L"magic_mouse", p->input_magic_mouse);
cfgfile_dwrite_str (f, L"magic_mousecursor", magiccursors[p->input_magic_mouse_cursor]);
|| cfgfile_strval (option, value, L"comp_trustnaddr", &p->comptrustnaddr, compmode, 0)
|| cfgfile_strval (option, value, L"collision_level", &p->collision_level, collmode, 0)
|| cfgfile_strval (option, value, L"parallel_matrix_emulation", &p->parallel_matrix_emulation, epsonprinter, 0)
- || cfgfile_strval (option, value, L"parallel_sampler", &p->parallel_sampler, parportsampler, 0)
|| cfgfile_strval (option, value, L"comp_flushmode", &p->comp_hardflush, flushmode, 0))
return 1;
return 1;
}
+ if (strcasecmp (option, L"quickstart") == 0) {
+ int model = -1;
+ TCHAR *tmpp = _tcschr (value, ',');
+ if (tmpp) {
+ *tmpp++ = 0;
+ TCHAR *tmpp2 = _tcschr (value, ',');
+ if (tmpp2)
+ *tmpp2 = 0;
+ cfgfile_strval (option, value, option, &model, qsmodes, 0);
+ if (model >= 0) {
+ int config = _tstol (tmpp);
+ built_in_prefs (p, model, config, 0, 0);
+ }
+ }
+ return 1;
+ }
+
for (i = 0; i < MAX_FILESYSTEM_UNITS; i++) {
TCHAR tmp[100];
_stprintf (tmp, L"uaehf%d", i);
p->parallel_postscript_emulation = 0;
p->parallel_postscript_detection = 0;
p->parallel_autoflush_time = 5;
- p->parallel_sampler = 0;
p->ghostscript_parameters[0] = 0;
p->uae_hide = 0;
} else if (arcadia_bios) {
tmp = arcadia_parport (0, ciaaprb, ciaadrb);
#endif
- } else if (currprefs.parallel_sampler) {
+ } else if (currprefs.win32_samplersoundcard >= 0) {
tmp = sampler_getsample ();
#include "a2065.h"
#include "ncr_scsi.h"
#include "blkdev.h"
+#include "sampler.h"
#define CUSTOM_DEBUG 0
#define SPRITE_DEBUG 0
int vpos;
static int vpos_count, vpos_count_prev;
-static int lof, lol;
+static int lof_store, lof_current, lol;
static int next_lineno, prev_lineno;
static enum nln_how nextline_how;
static int lof_changed = 0;
if (doflickerfix () && interlace_seen && !scandoubled_line) {
int i;
for (i = 0; i < 8; i++) {
- prevbpl[lof][vpos][i] = bplptx[i];
- if (!lof && (bplcon0 & 4))
- bplpt[i] = prevbpl[1 - lof][vpos][i];
+ prevbpl[lof_store][vpos][i] = bplptx[i];
+ if (!lof_store && (bplcon0 & 4))
+ bplpt[i] = prevbpl[1 - lof_store][vpos][i];
if (!(bplcon0 & 4) || interlace_seen < 0)
- prevbpl[1 - lof][vpos][i] = prevbpl[lof][vpos][i] = 0;
+ prevbpl[1 - lof_store][vpos][i] = prevbpl[lof_store][vpos][i] = 0;
}
}
updatedisplayarea ();
}
if (currprefs.produce_sound > 1)
- update_sound (fake_vblank_hz, (bplcon0 & 4) ? -1 : lof, islinetoggle ());
+ update_sound (fake_vblank_hz, (bplcon0 & 4) ? -1 : lof_current, islinetoggle ());
}
if (hp + HPOS_OFFSET >= maxhpos) {
vp++;
- if (vp >= maxvpos + lof)
+ if (vp >= maxvpos + lof_current)
vp = 0;
}
vp = (vp >> 8) & 7;
if (!(currprefs.chipset_mask & CSMASK_ECS_AGNUS))
vp &= 1;
- vp = vp | (lof ? 0x8000 : 0) | csbit;
+ vp = vp | (lof_current ? 0x8000 : 0) | csbit;
if (currprefs.chipset_mask & CSMASK_ECS_AGNUS)
vp |= lol ? 0x80 : 0;
#if 0
static void VPOSW (uae_u16 v)
{
#if 0
- if (M68K_GETPC < 0xf00000)
+ if (M68K_GETPC < 0xf00000 || 1)
write_log (L"VPOSW %04X PC=%08x\n", v, M68K_GETPC);
#endif
- if (lof != ((v & 0x8000) ? 1 : 0))
+ if (lof_current != ((v & 0x8000) ? 1 : 0)) {
lof_changed = 1;
- lof = (v & 0x8000) ? 1 : 0;
+ lof_current = (v & 0x8000) ? 1 : 0;
+ }
if (currprefs.chipset_mask & CSMASK_ECS_AGNUS)
lol = (v & 0x0080) ? 1 : 0;
if (lof_changed)
static void VHPOSW (uae_u16 v)
{
#if 0
- if (M68K_GETPC < 0xf00000)
+ if (M68K_GETPC < 0xf00000 || 1)
write_log (L"VHPOSW %04X PC=%08x\n", v, M68K_GETPC);
#endif
v >>= 8; // lets ignore hpos for now
if (hp >= maxhpos) {
hp -= maxhpos;
vp++;
- if (vp >= maxvpos + lof)
+ if (vp >= maxvpos + lof_current)
vp = 0;
}
hp += 1;
decide_sprites (hpos);
if (hpos - 1 != spr[num].ptxhpos) {
spr[num].pt &= ~0xffff;
- spr[num].pt |= v;
+ spr[num].pt |= v & ~1;
}
#if SPRITE_DEBUG > 0
if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) {
{
int v;
- debug_wputpeek (0xdff000 + addr, value);
+ debug_wputpeekdma (0xdff000 + addr, value);
copper_access = 1;
v = custom_wput_1 (hpos, addr, value, noget);
copper_access = 0;
write_log (L"vblank interrupt not cleared\n");
#endif
if (bplcon0 & 4)
- lof ^= 1;
+ lof_current = lof_current ? 0 : 1;
+ lof_store = lof_current;
#ifdef PICASSO96
picasso_handle_vsync ();
if (debug_dma)
record_dma_reset ();
- vsync_handle_redraw (lof, lof_changed);
+ vsync_handle_redraw (lof_store, lof_changed);
if (p96refresh_active) {
vpos_count = p96refresh_active;
timehack_alive--;
inputdevice_vsync ();
filesys_vsync ();
+ sampler_vsync ();
init_hardware_frame ();
int diff;
bpltmp[i] = bplpt[i];
bpltmpx[i] = bplptx[i];
- if (prevbpl[lof][vpos][i] && prevbpl[1 - lof][vpos][i]) {
- diff = prevbpl[lof][vpos][i] - prevbpl[1 - lof][vpos][i];
- if (lof) {
+ if (prevbpl[lof_store][vpos][i] && prevbpl[1 - lof_store][vpos][i]) {
+ diff = prevbpl[lof_store][vpos][i] - prevbpl[1 - lof_store][vpos][i];
+ if (lof_store) {
if (bplcon0 & 4)
- bplpt[i] = prevbpl[lof][vpos][i] - diff;
+ bplpt[i] = prevbpl[lof_store][vpos][i] - diff;
} else {
if (bplcon0 & 4)
- bplpt[i] = prevbpl[lof][vpos][i];
+ bplpt[i] = prevbpl[lof_store][vpos][i];
else
bplpt[i] = bplpt[i] - diff;
vpos_count++;
if (vpos >= maxvpos_total)
vpos = 0;
- if (vpos == maxvpos + lof || vpos == maxvpos + lof + 1 || vpos_count >= MAXVPOS) {
+ if (vpos == maxvpos + lof_current || vpos == maxvpos + lof_current + 1 || vpos_count >= MAXVPOS) {
// vpos_count >= MAXVPOS just to not crash if VPOSW writes prevent vsync completely
if ((bplcon0 & 8) && !lightpen_triggered) {
vpos_lpen = vpos - 1;
strobe = 0x38;
else if (vpos < minfirstline)
strobe = 0x3a;
- else if (vpos + 1 == maxvpos + lof)
+ else if (vpos + 1 == maxvpos + lof_current)
strobe = 0x38;
else if ((currprefs.chipset_mask & CSMASK_ECS_AGNUS) && lol)
strobe = 0x3e;
}
} else {
#endif
- is_lastline = vpos + 1 == maxvpos + lof && currprefs.m68k_speed == -1;
+ is_lastline = vpos + 1 == maxvpos + lof_current && currprefs.m68k_speed == -1;
#ifdef JIT
}
#endif
} else if (currprefs.gfx_linedbl && (doublescan <= 0 || interlace_seen > 0)) {
lineno *= 2;
nextline_how = currprefs.gfx_linedbl == 1 ? nln_doubled : nln_nblack;
- if ((bplcon0 & 4) || (interlace_seen > 0 && !lof)) {
- if (!lof) {
+ if ((bplcon0 & 4) || (interlace_seen > 0 && !lof_store)) {
+ if (!lof_store) {
lineno++;
nextline_how = nln_lower;
} else {
console_out_f (L"COP1LC: %08lx, COP2LC: %08lx COPPTR: %08lx\n", (unsigned long)cop1lc, (unsigned long)cop2lc, cop_state.ip);
console_out_f (L"DIWSTRT: %04x DIWSTOP: %04x DDFSTRT: %04x DDFSTOP: %04x\n",
(unsigned int)diwstrt, (unsigned int)diwstop, (unsigned int)ddfstrt, (unsigned int)ddfstop);
- console_out_f (L"BPLCON 0: %04x 1: %04x 2: %04x 3: %04x 4: %04x\n", bplcon0, bplcon1, bplcon2, bplcon3, bplcon4);
+ console_out_f (L"BPLCON 0: %04x 1: %04x 2: %04x 3: %04x 4: %04x LOF=%d/%d\n", bplcon0, bplcon1, bplcon2, bplcon3, bplcon4, lof_current, lof_store);
if (timeframes) {
console_out_f (L"Average frame time: %.2f ms [frames: %d time: %d]\n",
(double)frametime / timeframes, timeframes, frametime);
dsklen = RW; /* 024 DSKLEN */
RW; /* 026 DSKDAT */
RW; /* 028 REFPTR */
- i = RW; lof = (i & 0x8000) ? 1 : 0; lol = (i & 0x0080) ? 1 : 0; /* 02A VPOSW */
+ i = RW; lof_current = (i & 0x8000) ? 1 : 0; lol = (i & 0x0080) ? 1 : 0; /* 02A VPOSW */
RW; /* 02C VHPOSW */
COPCON (RW); /* 02E COPCON */
RW; /* 030 SERDAT* */
SW (dsklen); /* 024 DSKLEN */
SW (0); /* 026 DSKDAT */
SW (0); /* 028 REFPTR */
- SW ((lof ? 0x8001 : 0) | (lol ? 0x0080 : 0));/* 02A VPOSW */
+ SW ((lof_current ? 0x8001 : 0) | (lol ? 0x0080 : 0));/* 02A VPOSW */
SW (0); /* 02C VHPOSW */
SW (copcon); /* 02E COPCON */
SW (serper); /* 030 SERDAT * */
{
return debug_mem_banks[munge24 (addr) >> 16]->xlateaddr (addr);
}
-void debug_putlpeek(uaecptr addr, uae_u32 v)
+
+void debug_wputpeekdma (uaecptr addr, uae_u32 v)
+{
+ if (!memwatch_enabled)
+ return;
+ memwatch_func (addr, 2, 2, &v);
+}
+void debug_wgetpeekdma (uaecptr addr, uae_u32 v)
+{
+ uae_u32 vv = v;
+ if (!memwatch_enabled)
+ return;
+ memwatch_func (addr, 1, 2, &vv);
+}
+
+void debug_putlpeek (uaecptr addr, uae_u32 v)
{
if (!memwatch_enabled)
return;
memwatch_func (addr, 2, 4, &v);
}
-void debug_wputpeek(uaecptr addr, uae_u32 v)
+void debug_wputpeek (uaecptr addr, uae_u32 v)
{
if (!memwatch_enabled)
return;
memwatch_func (addr, 2, 2, &v);
}
-void debug_bputpeek(uaecptr addr, uae_u32 v)
+void debug_bputpeek (uaecptr addr, uae_u32 v)
{
if (!memwatch_enabled)
return;
extern void memwatch_dump2 (TCHAR *buf, int bufsize, int num);
+void debug_wgetpeekdma (uaecptr addr, uae_u32 v);
+void debug_wputpeekdma (uaecptr addr, uae_u32 v);
void debug_lgetpeek (uaecptr addr, uae_u32 v);
void debug_wgetpeek (uaecptr addr, uae_u32 v);
void debug_bgetpeek (uaecptr addr, uae_u32 v);
int parallel_postscript_emulation;
int parallel_postscript_detection;
int parallel_autoflush_time;
- int parallel_sampler;
TCHAR ghostscript_parameters[256];
int use_gfxlib;
int socket_emu;
int win32_midiindev;
int win32_uaescsimode;
int win32_soundcard;
+ int win32_samplersoundcard;
int win32_soundexclusive;
int win32_norecyclebin;
int win32_specialkey;
extern uae_u8 sampler_getsample (void);
extern int sampler_init (void);
extern void sampler_free (void);
-
+extern void sampler_vsync (void);
ismouse (ei);
isdigitalbutton (ei);
if (ei > 0)
- scancodeused[i][keyboards[i].extra[j][k]] = 1;
+ scancodeused[i][keyboards[i].extra[j][k]] = ei;
}
j++;
}
TCHAR *txt = parsetext (argv[i] + 13);
parse_diskswapper (txt);
xfree (txt);
+ } else if (_tcsncmp (argv[i], L"-cfgparam=", 10) == 0) {
+ ;
} else if (_tcscmp (argv[i], L"-cfgparam") == 0) {
if (i + 1 < argc)
i++;
#include <windows.h>
+#include <resource>
+
#include "sysconfig.h"
#include "sysdeps.h"
#if defined (D3D) && defined (GFXFILTER)
+#define EFFECT_VERSION 2
#include "options.h"
#include "xwin.h"
return d3d_yesno > 0 ? 1 : 0;
}
+static const char *fx10 = {
+
+"// 2 (version)\n"
+"//\n"
+"// WinUAE Direct3D post processing shader\n"
+"//\n"
+"// by Toni Wilen 2010\n"
+"\n"
+"uniform extern float4x4 mtx;\n"
+"uniform extern float2 maskmult;\n"
+"uniform extern float2 maskshift;\n"
+"uniform extern int filtermode;\n"
+"\n"
+"// final possibly filtered Amiga output\n"
+"texture SourceTexture : SOURCETEXTURE;\n"
+"\n"
+"sampler SourceSampler = sampler_state {\n"
+" Texture = (SourceTexture);\n"
+" MinFilter = POINT;\n"
+" MagFilter = POINT;\n"
+" MipFilter = NONE;\n"
+" AddressU = Clamp;\n"
+" AddressV = Clamp;\n"
+"};\n"
+"\n"
+"\n"
+"texture OverlayTexture : OVERLAYTEXTURE;\n"
+"\n"
+"sampler OverlaySampler = sampler_state {\n"
+" Texture = (OverlayTexture);\n"
+" MinFilter = POINT;\n"
+" MagFilter = POINT;\n"
+" MipFilter = NONE;\n"
+" AddressU = Wrap;\n"
+" AddressV = Wrap;\n"
+"};\n"
+"\n"
+"struct VS_OUTPUT_POST\n"
+"{\n"
+" float4 Position : POSITION;\n"
+" float2 CentreUV : TEXCOORD0;\n"
+" float2 Selector : TEXCOORD1;\n"
+"};\n"
+"\n"
+"VS_OUTPUT_POST VS_Post(float3 pos : POSITION, float2 TexCoord : TEXCOORD0)\n"
+"{\n"
+" VS_OUTPUT_POST Out = (VS_OUTPUT_POST)0;\n"
+"\n"
+" Out.Position = mul(float4(pos, 1.0f), mtx);\n"
+" Out.CentreUV = TexCoord;\n"
+" Out.Selector = TexCoord * maskmult + maskshift;\n"
+" return Out;\n"
+"}\n"
+"\n"
+"float4 PS_Post(in VS_OUTPUT_POST inp) : COLOR\n"
+"{\n"
+" float4 s = tex2D(SourceSampler, inp.CentreUV);\n"
+" float4 o = tex2D(OverlaySampler, inp.Selector);\n"
+" return s * o;\n"
+"}\n"
+"\n"
+"float4 PS_PostAlpha(in VS_OUTPUT_POST inp) : COLOR\n"
+"{\n"
+" float4 s = tex2D(SourceSampler, inp.CentreUV);\n"
+" float4 o = tex2D(OverlaySampler, inp.Selector);\n"
+" return s * (1 - o.a) + (o * o.a);\n"
+"}\n"
+"\n"
+"float4 PS_PostPlain(in VS_OUTPUT_POST inp) : COLOR\n"
+"{\n"
+" float4 s = tex2D(SourceSampler, inp.CentreUV);\n"
+" return s;\n"
+"}\n"
+"\n"
+"// source and overlay texture\n"
+"technique PostTechnique\n"
+"{\n"
+" pass P0\n"
+" {\n"
+" VertexShader = compile vs_1_0 VS_Post();\n"
+" PixelShader = compile ps_1_0 PS_Post();\n"
+" } \n"
+"}\n"
+"\n"
+"// source and scanline texture with alpha\n"
+"technique PostTechniqueAlpha\n"
+"{\n"
+" pass P0\n"
+" {\n"
+" VertexShader = compile vs_1_0 VS_Post();\n"
+" PixelShader = compile ps_1_0 PS_PostAlpha();\n"
+" } \n"
+"}\n"
+"\n"
+"// only source texture\n"
+"technique PostTechniquePlain\n"
+"{\n"
+" pass P0\n"
+" {\n"
+" VertexShader = compile vs_1_0 VS_Post();\n"
+" PixelShader = compile ps_1_0 PS_PostPlain();\n"
+" }\n"
+"}\n"
+};
+
+static const char *fx20 = {
+
+"// 2 (version)\n"
+"//\n"
+"// WinUAE Direct3D post processing shader\n"
+"//\n"
+"// by Toni Wilen 2010\n"
+"\n"
+"uniform extern float4x4 mtx;\n"
+"uniform extern float2 maskmult;\n"
+"uniform extern float2 maskshift;\n"
+"uniform extern int filtermode;\n"
+"\n"
+"// final possibly filtered Amiga output\n"
+"texture SourceTexture : SOURCETEXTURE;\n"
+"\n"
+"sampler SourceSampler = sampler_state {\n"
+" Texture = (SourceTexture);\n"
+" MinFilter = filtermode;\n"
+" MagFilter = filtermode;\n"
+" MipFilter = NONE;\n"
+" AddressU = Clamp;\n"
+" AddressV = Clamp;\n"
+"};\n"
+"\n"
+"\n"
+"texture OverlayTexture : OVERLAYTEXTURE;\n"
+"\n"
+"sampler OverlaySampler = sampler_state {\n"
+" Texture = (OverlayTexture);\n"
+" MinFilter = POINT;\n"
+" MagFilter = POINT;\n"
+" MipFilter = NONE;\n"
+" AddressU = Wrap;\n"
+" AddressV = Wrap;\n"
+"};\n"
+"\n"
+"struct VS_OUTPUT_POST\n"
+"{\n"
+" float4 Position : POSITION;\n"
+" float2 CentreUV : TEXCOORD0;\n"
+" float2 Selector : TEXCOORD1;\n"
+"};\n"
+"\n"
+"VS_OUTPUT_POST VS_Post(float3 pos : POSITION, float2 TexCoord : TEXCOORD0)\n"
+"{\n"
+" VS_OUTPUT_POST Out = (VS_OUTPUT_POST)0;\n"
+"\n"
+" Out.Position = mul(float4(pos, 1.0f), mtx);\n"
+" Out.CentreUV = TexCoord;\n"
+" Out.Selector = TexCoord * maskmult + maskshift;\n"
+" return Out;\n"
+"}\n"
+"\n"
+"float4 PS_Post(in VS_OUTPUT_POST inp) : COLOR\n"
+"{\n"
+" float4 s = tex2D(SourceSampler, inp.CentreUV);\n"
+" float4 o = tex2D(OverlaySampler, inp.Selector);\n"
+" return s * o;\n"
+"}\n"
+"\n"
+"float4 PS_PostAlpha(in VS_OUTPUT_POST inp) : COLOR\n"
+"{\n"
+" float4 s = tex2D(SourceSampler, inp.CentreUV);\n"
+" float4 o = tex2D(OverlaySampler, inp.Selector);\n"
+" return s * (1 - o.a) + (o * o.a);\n"
+"}\n"
+"\n"
+"float4 PS_PostPlain(in VS_OUTPUT_POST inp) : COLOR\n"
+"{\n"
+" float4 s = tex2D(SourceSampler, inp.CentreUV);\n"
+" return s;\n"
+"}\n"
+"\n"
+"// source and overlay texture\n"
+"technique PostTechnique\n"
+"{\n"
+" pass P0\n"
+" {\n"
+" VertexShader = compile vs_1_0 VS_Post();\n"
+" PixelShader = compile ps_2_0 PS_Post();\n"
+" } \n"
+"}\n"
+"\n"
+"// source and scanline texture with alpha\n"
+"technique PostTechniqueAlpha\n"
+"{\n"
+" pass P0\n"
+" {\n"
+" VertexShader = compile vs_1_0 VS_Post();\n"
+" PixelShader = compile ps_2_0 PS_PostAlpha();\n"
+" } \n"
+"}\n"
+"\n"
+"// only source texture\n"
+"technique PostTechniquePlain\n"
+"{\n"
+" pass P0\n"
+" {\n"
+" VertexShader = compile vs_1_0 VS_Post();\n"
+" PixelShader = compile ps_2_0 PS_PostPlain();\n"
+" }\n"
+"}\n"
+};
+
static LPD3DXEFFECT psEffect_LoadEffect (const TCHAR *shaderfile, int full)
{
int ret = 0;
LPD3DXBUFFER Errors = NULL;
LPD3DXBUFFER BufferEffect = NULL;
HRESULT hr;
- TCHAR tmp[MAX_DPATH];
+ TCHAR tmp[MAX_DPATH], tmp2[MAX_DPATH];
LPD3DXEFFECT effect = NULL;
static int first;
DWORD compileflags = psEnabled ? 0 : D3DXSHADER_USE_LEGACY_D3DX9_31_DLL;
+ int canusefile = 0, existsfile = 0;
_stprintf (tmp, L"%s%sfiltershaders\\direct3d\\%s", start_path_data, WIN32_PLUGINDIR, shaderfile);
- hr = D3DXCreateEffectCompilerFromFile (tmp, NULL, NULL, compileflags, &EffectCompiler, &Errors);
- if (FAILED (hr)) {
- write_log (L"%s: D3DXCreateEffectCompilerFromFile failed: %s\n", D3DHEAD, D3DX_ErrorString (hr, Errors));
- goto end;
+ if (!full) {
+ struct zfile *z = zfile_fopen (tmp, L"r", 0);
+ if (z) {
+ existsfile = 1;
+ zfile_fgets (tmp2, sizeof tmp2 / sizeof (TCHAR), z);
+ zfile_fclose (z);
+ int ver = _tstol (tmp2 + 2);
+ if (ver == EFFECT_VERSION) {
+ canusefile = 1;
+ } else {
+ write_log (L"'%s' mismatched version (%d != %d)\n", tmp, ver, EFFECT_VERSION);
+ }
+ }
+ hr = E_FAIL;
+ if (canusefile) {
+ write_log (L"%s: Attempting to load '%s'\n", D3DHEAD, tmp);
+ hr = D3DXCreateEffectCompilerFromFile (tmp, NULL, NULL, compileflags, &EffectCompiler, &Errors);
+ if (FAILED (hr))
+ write_log (L"%s: D3DXCreateEffectCompilerFromFile failed: %s\n", D3DHEAD, D3DX_ErrorString (hr, Errors));
+ }
+ if (FAILED (hr)) {
+ const char *str = psEnabled ? fx20 : fx10;
+ int len = strlen (str);
+ if (!existsfile) {
+ struct zfile *z = zfile_fopen (tmp, L"w", 0);
+ if (z) {
+ zfile_fwrite ((void*)str, len, 1, z);
+ zfile_fclose (z);
+ }
+ }
+ hr = D3DXCreateEffectCompiler (str, len, NULL, NULL, compileflags, &EffectCompiler, &Errors);
+ if (FAILED (hr)) {
+ write_log (L"%s: D3DXCreateEffectCompilerFromResource failed: %s\n", D3DHEAD, D3DX_ErrorString (hr, Errors));
+ goto end;
+ }
+ }
+ } else {
+ hr = D3DXCreateEffectCompilerFromFile (tmp, NULL, NULL, compileflags, &EffectCompiler, &Errors);
+ if (FAILED (hr)) {
+ write_log (L"%s: D3DXCreateEffectCompilerFromFile failed: %s\n", D3DHEAD, D3DX_ErrorString (hr, Errors));
+ goto end;
+ }
}
+
hr = EffectCompiler->CompileEffect (0, &BufferEffect, &Errors);
if (FAILED (hr)) {
write_log (L"%s: CompileEffect failed: %s\n", D3DHEAD, D3DX_ErrorString (hr, Errors));
}
}
if (ret)
- write_log (L"%s: pixelshader filter '%s' loaded\n", D3DHEAD, tmp);
+ write_log (L"%s: pixelshader filter '%s' enabled\n", D3DHEAD, tmp);
else
write_log (L"%s: pixelshader filter '%s' failed to initialize\n", D3DHEAD, tmp);
return effect;
static int cursorwidth, cursorheight, cursorok;
static uae_u8 *cursordata;
static uae_u32 cursorrgb[4], cursorrgbn[4];
-static int cursorvisible, cursordeactivate;
+static int cursorvisible, cursordeactivate, setupcursor_needed;
static HCURSOR wincursor;
static int wincursor_shown;
static uaecptr boardinfo, ABI_interrupt;
}
}
+static void setupcursor (void)
+{
+ uae_u8 *dptr = NULL;
+ int bpp = 4;
+ DWORD pitch;
+ D3DLOCKED_RECT locked;
+ HRESULT hr;
+
+ setupcursor_needed = 1;
+ if (cursorsurfaced3d && cursordata && cursorwidth && cursorheight) {
+ if (SUCCEEDED (hr = cursorsurfaced3d->LockRect (0, &locked, NULL, 0))) {
+ dptr = (uae_u8*)locked.pBits;
+ pitch = locked.Pitch;
+ for (int y = 0; y < cursorheight; y++) {
+ uae_u8 *p1 = cursordata + cursorwidth * bpp * y;
+ uae_u8 *p2 = dptr + pitch * y;
+ memcpy (p2, p1, cursorwidth * bpp);
+ }
+ cursorsurfaced3d->UnlockRect (0);
+ setupcursor_needed = 0;
+ P96TRACE_SPR((L"cursorsurface3d updated\n"));
+ return;
+ } else {
+ P96TRACE_SPR((L"cursorsurfaced3d LockRect() failed %08x\n", hr));
+ }
+ }
+}
+
static void disablemouse (void)
{
cursorok = FALSE;
if (!flushed)
gfx_unlock_picasso ();
}
+ if (setupcursor_needed)
+ setupcursor ();
}
static int set_panning_called = 0;
RGBFB_CLUT_8
};
-static void setupcursor (void)
-{
- uae_u8 *dptr = NULL;
- int bpp = 4;
- DWORD pitch;
- D3DLOCKED_RECT locked;
-
- if (cursorsurfaced3d == NULL)
- return;
- if (SUCCEEDED (cursorsurfaced3d->LockRect (0, &locked, NULL, 0))) {
- dptr = (uae_u8*)locked.pBits;
- pitch = locked.Pitch;
- for (int y = 0; y < cursorheight; y++) {
- uae_u8 *p1 = cursordata + cursorwidth * bpp * y;
- uae_u8 *p2 = dptr + pitch * y;
- memcpy (p2, p1, cursorwidth * bpp);
- }
- cursorsurfaced3d->UnlockRect (0);
- }
-}
-
static uae_u32 setspriteimage (uaecptr bi);
static void recursor (void)
{
#define IDS_PRINTER_EPSON48 359
#define IDS_SELECTCD 360
#define IDS_CD 361
+#define IDS_PS_FX_10 363
#define IDS_QS_MODELS 1000
#define IDS_QS_MODEL_A500 1001
#define IDS_QS_MODEL_A500P 1002
#define IDC_MBMEM1 1028
#define IDC_PORT_TABLET_CURSOR 1028
#define IDC_SHOWLEDSRTG 1028
+#define IDC_SAMPLERLIST 1028
#define IDC_PORT0_JOYSMODE 1029
#define IDC_SLOWMEM 1030
#define IDC_PORT1_JOYSMODE 1030
#define IDC_PORT3_JOYS 1032
#define IDC_PARALLEL 1033
#define IDC_JULIAN 1040
-#define IDC_JULIAN2 1041
#define IDC_FOCUSMINIMIZE 1041
#define IDC_FASTTEXT 1043
#define IDC_FASTRAM 1044
STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD\r
FONT 8, "MS Sans Serif", 0, 0, 0x1\r
BEGIN\r
- GROUPBOX "Parallel Port",IDC_STATIC,5,2,291,86\r
+ GROUPBOX "Parallel Port",IDC_STATIC,5,2,291,105\r
RTEXT "Printer:",IDC_STATIC,12,15,25,15,SS_CENTERIMAGE\r
COMBOBOX IDC_PRINTERLIST,49,15,232,134,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
PUSHBUTTON "Flush print job",IDC_FLUSHPRINTER,114,51,58,12\r
EDITTEXT IDC_PRINTERAUTOFLUSH,255,50,25,12,ES_NUMBER\r
RTEXT "Type:",IDC_STATIC,15,33,21,15,SS_CENTERIMAGE\r
EDITTEXT IDC_PS_PARAMS,114,67,167,12,ES_AUTOHSCROLL\r
- GROUPBOX "Serial Port",IDC_STATIC,4,92,292,48\r
- COMBOBOX IDC_SERIAL,49,104,232,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
- CONTROL "Shared",IDC_SER_SHARED,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,15,123,48,12\r
- CONTROL "RTS/CTS",IDC_SER_CTSRTS,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,75,123,55,12\r
- RTEXT "Out:",IDC_MIDI,10,154,34,15,SS_CENTERIMAGE\r
- COMBOBOX IDC_MIDIOUTLIST,49,154,232,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
- RTEXT "In:",IDC_MIDI2,10,174,29,15,SS_CENTERIMAGE\r
- COMBOBOX IDC_MIDIINLIST,49,174,232,134,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
+ GROUPBOX "Serial Port",IDC_STATIC,4,110,292,48\r
+ COMBOBOX IDC_SERIAL,49,122,232,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
+ CONTROL "Shared",IDC_SER_SHARED,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,15,141,48,12\r
+ CONTROL "RTS/CTS",IDC_SER_CTSRTS,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,75,141,55,12\r
+ RTEXT "Out:",IDC_MIDI,10,172,19,15,SS_CENTERIMAGE\r
+ COMBOBOX IDC_MIDIOUTLIST,36,173,108,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
+ RTEXT "In:",IDC_MIDI2,150,171,22,15,SS_CENTERIMAGE\r
+ COMBOBOX IDC_MIDIINLIST,181,173,108,134,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
CONTROL "Direct []Use when emulating serial-link games on two PCs running WinUAE",IDC_SER_DIRECT,\r
- "Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,135,123,65,12\r
- CONTROL "uaeserial.device",IDC_UAESERIAL,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,200,123,78,12\r
+ "Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,135,141,65,12\r
+ CONTROL "uaeserial.device",IDC_UAESERIAL,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,200,141,78,12\r
COMBOBOX IDC_PRINTERTYPELIST,49,33,232,134,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
RTEXT "Ghostscript extra parameters:",IDC_STATIC,10,66,102,15,SS_CENTERIMAGE\r
- GROUPBOX "MIDI",IDC_STATIC,5,143,291,51,BS_LEFT\r
+ GROUPBOX "MIDI",IDC_STATIC,5,161,291,34,BS_LEFT\r
GROUPBOX "Protection Dongle",IDC_STATIC,5,197,292,30,BS_LEFT\r
COMBOBOX IDC_DONGLELIST,50,208,232,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
+ RTEXT "Sampler:",IDC_STATIC,12,84,31,15,SS_CENTERIMAGE\r
+ COMBOBOX IDC_SAMPLERLIST,49,85,232,134,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
END\r
\r
IDD_GAMEPORTS DIALOGEX 0, 0, 300, 236\r
BEGIN\r
END\r
\r
+ IDD_IOPORTS, DIALOG\r
+ BEGIN\r
+ END\r
+\r
+ IDD_GAMEPORTS, DIALOG\r
+ BEGIN\r
+ END\r
+\r
IDD_MISC1, DIALOG\r
BEGIN\r
END\r
IDD_DISK, DIALOG\r
BEGIN\r
END\r
+\r
+ IDD_FRONTEND, DIALOG\r
+ BEGIN\r
+ END\r
END\r
#endif // APSTUDIO_INVOKED\r
\r
wasapi_enum (sound_devices);
if ((1 || force_directsound || !os_vista) && (sounddrivermask & SOUNDDRIVER_DS)) {
DirectSoundEnumerate ((LPDSENUMCALLBACK)DSEnumProc, sound_devices);
- //DirectSoundCaptureEnumerate ((LPDSENUMCALLBACK)DSEnumProc, record_devices);
}
+ DirectSoundCaptureEnumerate ((LPDSENUMCALLBACK)DSEnumProc, record_devices);
if (sounddrivermask & SOUNDDRIVER_OPENAL) {
__try {
if (isdllversion (L"openal32.dll", 6, 14, 357, 22)) {
/*
- * UAE - The Un*x Amiga Emulator
- *
- * Support for Linux/USS sound
- *
- * Copyright 1997 Bernd Schmidt
- */
+* UAE - The Un*x Amiga Emulator
+*
+* Support for Linux/USS sound
+*
+* Copyright 1997 Bernd Schmidt
+*/
#define SOUNDSTUFF 1
struct sound_data
{
- int waiting_for_buffer;
- int devicetype;
- int obtainedfreq;
- int paused;
- int mute;
- int channels;
- int freq;
- int samplesize;
- int sndbufsize;
- struct sound_dp *data;
+ int waiting_for_buffer;
+ int devicetype;
+ int obtainedfreq;
+ int paused;
+ int mute;
+ int channels;
+ int freq;
+ int samplesize;
+ int sndbufsize;
+ struct sound_dp *data;
};
STATIC_INLINE void set_sound_buffers (void)
{
#if SOUNDSTUFF > 1
- paula_sndbufpt_prev = paula_sndbufpt_start;
- paula_sndbufpt_start = paula_sndbufpt;
+ paula_sndbufpt_prev = paula_sndbufpt_start;
+ paula_sndbufpt_start = paula_sndbufpt;
#endif
}
STATIC_INLINE void check_sound_buffers (void)
{
#if SOUNDSTUFF > 1
- int len;
+ int len;
#endif
- if (currprefs.sound_stereo == SND_4CH_CLONEDSTEREO) {
- ((uae_u16*)paula_sndbufpt)[0] = ((uae_u16*)paula_sndbufpt)[-2];
- ((uae_u16*)paula_sndbufpt)[1] = ((uae_u16*)paula_sndbufpt)[-1];
- paula_sndbufpt = (uae_u16 *)(((uae_u8 *)paula_sndbufpt) + 2 * 2);
- } else if (currprefs.sound_stereo == SND_6CH_CLONEDSTEREO) {
- uae_s16 *p = ((uae_s16*)paula_sndbufpt);
- uae_s32 sum;
- p[2] = p[-2];
- p[3] = p[-1];
- sum = (uae_s32)(p[-2]) + (uae_s32)(p[-1]) + (uae_s32)(p[2]) + (uae_s32)(p[3]);
- p[0] = sum / 8;
- p[1] = sum / 8;
- paula_sndbufpt = (uae_u16 *)(((uae_u8 *)paula_sndbufpt) + 4 * 2);
- }
+ if (currprefs.sound_stereo == SND_4CH_CLONEDSTEREO) {
+ ((uae_u16*)paula_sndbufpt)[0] = ((uae_u16*)paula_sndbufpt)[-2];
+ ((uae_u16*)paula_sndbufpt)[1] = ((uae_u16*)paula_sndbufpt)[-1];
+ paula_sndbufpt = (uae_u16 *)(((uae_u8 *)paula_sndbufpt) + 2 * 2);
+ } else if (currprefs.sound_stereo == SND_6CH_CLONEDSTEREO) {
+ uae_s16 *p = ((uae_s16*)paula_sndbufpt);
+ uae_s32 sum;
+ p[2] = p[-2];
+ p[3] = p[-1];
+ sum = (uae_s32)(p[-2]) + (uae_s32)(p[-1]) + (uae_s32)(p[2]) + (uae_s32)(p[3]);
+ p[0] = sum / 8;
+ p[1] = sum / 8;
+ paula_sndbufpt = (uae_u16 *)(((uae_u8 *)paula_sndbufpt) + 4 * 2);
+ }
#if SOUNDSTUFF > 1
- if (outputsample == 0)
- return;
- len = paula_sndbufpt - paula_sndbufpt_start;
- if (outputsample < 0) {
- int i;
- uae_s16 *p1 = (uae_s16*)paula_sndbufpt_prev;
- uae_s16 *p2 = (uae_s16*)paula_sndbufpt_start;
- for (i = 0; i < len; i++) {
- *p1 = (*p1 + *p2) / 2;
+ if (outputsample == 0)
+ return;
+ len = paula_sndbufpt - paula_sndbufpt_start;
+ if (outputsample < 0) {
+ int i;
+ uae_s16 *p1 = (uae_s16*)paula_sndbufpt_prev;
+ uae_s16 *p2 = (uae_s16*)paula_sndbufpt_start;
+ for (i = 0; i < len; i++) {
+ *p1 = (*p1 + *p2) / 2;
+ }
+ paula_sndbufpt = paula_sndbufpt_start;
}
- paula_sndbufpt = paula_sndbufpt_start;
- }
#endif
- if ((uae_u8*)paula_sndbufpt - (uae_u8*)paula_sndbuffer >= paula_sndbufsize) {
- finish_sound_buffer ();
- paula_sndbufpt = paula_sndbuffer;
- }
-#if SOUNDSTUFF > 1
- while (doublesample-- > 0) {
- memcpy (paula_sndbufpt, paula_sndbufpt_start, len * 2);
- paula_sndbufpt += len;
if ((uae_u8*)paula_sndbufpt - (uae_u8*)paula_sndbuffer >= paula_sndbufsize) {
- finish_sound_buffer ();
- paula_sndbufpt = paula_sndbuffer;
+ finish_sound_buffer ();
+ paula_sndbufpt = paula_sndbuffer;
+ }
+#if SOUNDSTUFF > 1
+ while (doublesample-- > 0) {
+ memcpy (paula_sndbufpt, paula_sndbufpt_start, len * 2);
+ paula_sndbufpt += len;
+ if ((uae_u8*)paula_sndbufpt - (uae_u8*)paula_sndbuffer >= paula_sndbufsize) {
+ finish_sound_buffer ();
+ paula_sndbufpt = paula_sndbuffer;
+ }
}
- }
#endif
}
STATIC_INLINE void clear_sound_buffers (void)
{
- memset (paula_sndbuffer, 0, paula_sndbufsize);
- paula_sndbufpt = paula_sndbuffer;
+ memset (paula_sndbuffer, 0, paula_sndbufsize);
+ paula_sndbufpt = paula_sndbuffer;
}
#define PUT_SOUND_WORD(b) do { *(uae_u16 *)paula_sndbufpt = b; paula_sndbufpt = (uae_u16 *)(((uae_u8 *)paula_sndbufpt) + 2); } while (0)
#define FILTER_SOUND_TYPE_A1200 1
struct dsaudiomodes {
- int ch;
- DWORD ksmode;
+ int ch;
+ DWORD ksmode;
};
extern int sounddrivermask;
p->win32_inactive_pause = 0;
p->win32_ctrl_F11_is_quit = 0;
p->win32_soundcard = 0;
+ p->win32_samplersoundcard = -1;
p->win32_soundexclusive = 0;
p->win32_minimize_inactive = 0;
p->win32_active_priority = 1;
if (sound_devices[p->win32_soundcard].cfgname)
cfgfile_target_dwrite_str (f, L"soundcardname", sound_devices[p->win32_soundcard].cfgname);
cfgfile_target_dwrite_bool (f, L"soundcard_exclusive", p->win32_soundexclusive);
+ if (p->win32_samplersoundcard >= 0) {
+ cfgfile_target_dwrite (f, L"samplersoundcard", L"%d", p->win32_samplersoundcard);
+ if (record_devices[p->win32_samplersoundcard].cfgname)
+ cfgfile_target_dwrite_str (f, L"samplersoundcardname", record_devices[p->win32_samplersoundcard].cfgname);
+ }
+
cfgfile_target_dwrite (f, L"cpu_idle", L"%d", p->cpu_idle);
cfgfile_target_dwrite_bool (f, L"notaskbarbutton", p->win32_notaskbarbutton);
cfgfile_target_dwrite_bool (f, L"always_on_top", p->win32_alwaysontop);
|| cfgfile_intval (option, value, L"midiout_device", &p->win32_midioutdev, 1)
|| cfgfile_intval (option, value, L"midiin_device", &p->win32_midiindev, 1)
|| cfgfile_intval (option, value, L"soundcard", &p->win32_soundcard, 1)
+ || cfgfile_intval (option, value, L"samplersoundcard", &p->win32_samplersoundcard, 1)
|| cfgfile_yesno (option, value, L"soundcard_exclusive", &p->win32_soundexclusive)
|| cfgfile_yesno (option, value, L"notaskbarbutton", &p->win32_notaskbarbutton)
|| cfgfile_yesno (option, value, L"always_on_top", &p->win32_alwaysontop)
p->win32_soundcard = num;
return 1;
}
+ if (cfgfile_string (option, value, L"samplersoundcardname", tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) {
+ int i, num;
+
+ num = p->win32_samplersoundcard;
+ p->win32_samplersoundcard = -1;
+ for (i = 0; record_devices[i].cfgname; i++) {
+ if (i < num)
+ continue;
+ if (!_tcscmp (record_devices[i].cfgname, tmpbuf)) {
+ p->win32_samplersoundcard = i;
+ break;
+ }
+ }
+ if (p->win32_samplersoundcard < 0) {
+ for (i = 0; record_devices[i].cfgname; i++) {
+ if (!_tcscmp (record_devices[i].cfgname, tmpbuf)) {
+ p->win32_samplersoundcard = i;
+ break;
+ }
+ }
+ }
+ return 1;
+ }
if (cfgfile_yesno (option, value, L"aspi", &v)) {
p->win32_uaescsimode = 0;
_tcscpy (rpath1, L"Software\\Classes\\");
_tcscpy (rpath2, rpath1);
_tcscat (rpath2, extension);
- if (RegDeleteKey (rkey, rpath2) != ERROR_SUCCESS)
- return 0;
+ RegDeleteKey (rkey, rpath2);
_tcscpy (rpath2, rpath1);
_tcscat (rpath2, progid);
if (!def)
return 1;
}
-static int shell_associate_2 (const TCHAR *extension, const TCHAR *shellcommand, const TCHAR *command, const TCHAR *perceivedtype,
+static int shell_associate_2 (const TCHAR *extension, TCHAR *shellcommand, TCHAR *command, struct contextcommand *cc, const TCHAR *perceivedtype,
const TCHAR *description, const TCHAR *ext2, int icon)
{
TCHAR rpath1[MAX_DPATH], rpath2[MAX_DPATH], progid2[MAX_DPATH];
RegCloseKey (key1);
}
}
- if (command) {
- _tcscat (rpath2, L"\\shell\\");
- if (shellcommand)
- _tcscat (rpath2, shellcommand);
- else
- _tcscat (rpath2, L"open");
- _tcscat (rpath2, L"\\command");
- if (RegCreateKeyEx (rkey, rpath2, 0, NULL, REG_OPTION_NON_VOLATILE,
- KEY_WRITE | KEY_READ, NULL, &key1, &disposition) == ERROR_SUCCESS) {
- TCHAR path[MAX_DPATH];
- _stprintf (path, L"\"%sWinUAE.exe\" %s", start_path_exe, command);
- RegSetValueEx (key1, L"", 0, REG_SZ, (CONST BYTE *)path, (_tcslen (path) + 1) * sizeof (TCHAR));
- RegCloseKey (key1);
+ cc = NULL;
+ struct contextcommand ccs[2];
+ if ((command || shellcommand)) {
+ ccs[0].command = command;
+ ccs[0].shellcommand = shellcommand;
+ ccs[1].command = NULL;
+ cc = &ccs[0];
+ }
+ if (cc) {
+ TCHAR path2[MAX_DPATH];
+ for (int i = 0; cc[i].command; i++) {
+ _tcscpy (path2, rpath2);
+ _tcscat (path2, L"\\shell\\");
+ if (cc[i].shellcommand)
+ _tcscat (path2, cc[i].shellcommand);
+ else
+ _tcscat (path2, L"open");
+ if (cc[i].icon) {
+ if (RegCreateKeyEx (rkey, path2, 0, NULL, REG_OPTION_NON_VOLATILE,
+ KEY_WRITE | KEY_READ, NULL, &key1, &disposition) == ERROR_SUCCESS) {
+ TCHAR tmp[MAX_DPATH];
+ _stprintf (tmp, L"%s,%d", _wpgmptr, -cc[i].icon);
+ RegSetValueEx (key1, L"Icon", 0, REG_SZ, (CONST BYTE *)tmp, (_tcslen (tmp) + 1) * sizeof (TCHAR));
+ RegCloseKey (key1);
+ }
+ }
+ _tcscat (path2, L"\\command");
+ if (RegCreateKeyEx (rkey, path2, 0, NULL, REG_OPTION_NON_VOLATILE,
+ KEY_WRITE | KEY_READ, NULL, &key1, &disposition) == ERROR_SUCCESS) {
+ TCHAR path[MAX_DPATH];
+ _stprintf (path, L"\"%sWinUAE.exe\" %s", start_path_exe, cc[i].command);
+ RegSetValueEx (key1, L"", 0, REG_SZ, (CONST BYTE *)path, (_tcslen (path) + 1) * sizeof (TCHAR));
+ RegCloseKey (key1);
+ }
}
}
fkey = regcreatetree (NULL, L"FileAssociations");
regclosetree (fkey);
return 1;
}
-static int shell_associate (const TCHAR *extension, const TCHAR *command, const TCHAR *perceivedtype, const TCHAR *description, const TCHAR *ext2, int icon)
+static int shell_associate (const TCHAR *extension, TCHAR *command, struct contextcommand *cc, const TCHAR *perceivedtype, const TCHAR *description, const TCHAR *ext2, int icon)
{
- int v = shell_associate_2 (extension, NULL, command, perceivedtype, description, ext2, icon);
+ int v = shell_associate_2 (extension, NULL, command, cc, perceivedtype, description, ext2, icon);
if (!_tcscmp (extension, L".uae"))
- shell_associate_2 (extension, L"edit", L"-f \"%1\" -s use_gui=yes", L"text", description, NULL, 0);
+ shell_associate_2 (extension, L"edit", L"-f \"%1\" -s use_gui=yes", NULL, L"text", description, NULL, 0);
return v;
}
}
return 0;
}
-
+static struct contextcommand cc_cd[] = {
+ { L"CDTV", L"-cdimage=\"%1\" -s use_gui=no -cfgparam=quickstart=CDTV,0", IDI_APPICON },
+ { L"CD32", L"-cdimage=\"%1\" -s use_gui=no -cfgparam=quickstart=CD32,0", IDI_APPICON },
+ { NULL }
+};
+static struct contextcommand cc_disk[] = {
+ { L"A500", L"-0 \"%1\" -s use_gui=no -cfgparam=quickstart=A500,0", IDI_DISKIMAGE },
+ { L"A1200", L"-0 \"%1\" -s use_gui=no -cfgparam=quickstart=A1200,0", IDI_DISKIMAGE },
+ { NULL }
+};
struct assext exts[] = {
- { L".uae", L"-f \"%1\"", L"WinUAE configuration file", IDI_CONFIGFILE },
- { L".adf", L"-0 \"%1\" -s use_gui=no", L"WinUAE floppy disk image", IDI_DISKIMAGE },
- { L".adz", L"-0 \"%1\" -s use_gui=no", L"WinUAE floppy disk image", IDI_DISKIMAGE },
- { L".dms", L"-0 \"%1\" -s use_gui=no", L"WinUAE floppy disk image", IDI_DISKIMAGE },
- { L".fdi", L"-0 \"%1\" -s use_gui=no", L"WinUAE floppy disk image", IDI_DISKIMAGE },
- { L".ipf", L"-0 \"%1\" -s use_gui=no", L"WinUAE floppy disk image", IDI_DISKIMAGE },
- { L".uss", L"-s statefile=\"%1\" -s use_gui=no", L"WinUAE statefile", IDI_APPICON },
+// { L".cue", L"-cdimage=\"%1\" -s use_gui=no", L"WinUAE CD image", IDI_DISKIMAGE, cc_cd },
+// { L".iso", L"-cdimage=\"%1\" -s use_gui=no", L"WinUAE CD image", IDI_DISKIMAGE, cc_cd },
+ { L".uae", L"-f \"%1\"", L"WinUAE configuration file", IDI_CONFIGFILE, NULL },
+ { L".adf", L"-0 \"%1\" -s use_gui=no", L"WinUAE floppy disk image", IDI_DISKIMAGE, cc_disk },
+ { L".adz", L"-0 \"%1\" -s use_gui=no", L"WinUAE floppy disk image", IDI_DISKIMAGE, cc_disk },
+ { L".dms", L"-0 \"%1\" -s use_gui=no", L"WinUAE floppy disk image", IDI_DISKIMAGE, cc_disk },
+ { L".fdi", L"-0 \"%1\" -s use_gui=no", L"WinUAE floppy disk image", IDI_DISKIMAGE, cc_disk },
+ { L".ipf", L"-0 \"%1\" -s use_gui=no", L"WinUAE floppy disk image", IDI_DISKIMAGE, cc_disk },
+ { L".uss", L"-s statefile=\"%1\" -s use_gui=no", L"WinUAE statefile", IDI_APPICON, NULL },
{ NULL }
};
if (!regexiststree (NULL, L"FileAssociations")) {
UAEREG *fkey;
if (exts[0].enabled == 0) {
- shell_associate (exts[0].ext, exts[0].cmd, NULL, exts[0].desc, NULL, exts[0].icon);
+ shell_associate (exts[0].ext, exts[0].cmd, exts[0].cc, NULL, exts[0].desc, NULL, exts[0].icon);
exts[0].enabled = shell_associate_is (exts[0].ext);
}
fkey = regcreatetree (NULL, L"FileAssociations");
exts[i].enabled = shell_associate_is (exts[i].ext);
if (exts[i].enabled) {
modified = 1;
- shell_associate (exts[i].ext, exts[i].cmd, NULL, exts[i].desc, NULL, exts[i].icon);
+ shell_associate (exts[i].ext, exts[i].cmd, exts[i].cc, NULL, exts[i].desc, NULL, exts[i].icon);
}
} else if (exts[i].enabled) {
- shell_associate (exts[i].ext, exts[i].cmd, NULL, exts[i].desc, NULL, exts[i].icon);
+ shell_associate (exts[i].ext, exts[i].cmd, exts[i].cc, NULL, exts[i].desc, NULL, exts[i].icon);
exts[i].enabled = shell_associate_is (exts[i].ext);
if (exts[i].enabled != already)
modified = 1;
case ZFILE_STATEFILE:
_stprintf (tmp, L"-statefile=%s", f);
break;
+ case ZFILE_CDIMAGE:
+ _stprintf (tmp, L"-cdimage=%s", f);
+ break;
case ZFILE_DISKIMAGE:
if (fd < 4)
_stprintf (tmp, L"-cfgparam=floppy%d=%s", fd++, f);
#define WINUAEPUBLICBETA 1
#define LANG_DLL 1
-#define WINUAEBETA L"18"
-#define WINUAEDATE MAKEBD(2010, 3, 20)
+#define WINUAEBETA L"19"
+#define WINUAEDATE MAKEBD(2010, 3, 27)
#define WINUAEEXTRA L""
#define WINUAEREV L""
extern struct sound_device sound_devices[MAX_SOUND_DEVICES];
extern struct sound_device record_devices[MAX_SOUND_DEVICES];
+struct contextcommand
+{
+ TCHAR *shellcommand;
+ TCHAR *command;
+ int icon;
+};
struct assext {
TCHAR *ext;
TCHAR *cmd;
TCHAR *desc;
int icon;
+ struct contextcommand *cc;
int enabled;
};
struct assext exts[];
static void enable_for_portsdlg (HWND hDlg)
{
int v;
+ int isprinter, issampler;
v = workprefs.input_selected_setting > 0 ? FALSE : TRUE;
ew (hDlg, IDC_SWAP, v);
ew (hDlg, IDC_SER_DIRECT, v);
ew (hDlg, IDC_UAESERIAL, full_property_sheet);
#endif
+ isprinter = true;
+ issampler = true;
#if !defined (PARALLEL_PORT)
- ew (hDlg, IDC_PRINTERLIST, FALSE);
- ew (hDlg, IDC_FLUSHPRINTER, FALSE);
- ew (hDlg, IDC_PSPRINTER, FALSE);
- ew (hDlg, IDC_PS_PARAMS, FALSE);
- ew (hDlg, IDC_PRINTER_AUTOFLUSH, FALSE);
-#else
- ew (hDlg, IDC_FLUSHPRINTER, isprinteropen () ? TRUE : FALSE);
- ew (hDlg, IDC_PSPRINTER, full_property_sheet && ghostscript_available ? TRUE : FALSE);
- ew (hDlg, IDC_PSPRINTERDETECT, full_property_sheet ? TRUE : FALSE);
- ew (hDlg, IDC_PS_PARAMS, full_property_sheet && ghostscript_available);
+ isprinter = false;
+ issampler = false;
#endif
+ if (workprefs.prtname[0]) {
+ issampler = false;
+ workprefs.win32_samplersoundcard = -1;
+ } else if (workprefs.win32_samplersoundcard >= 0) {
+ isprinter = false;
+ }
+ ew (hDlg, IDC_PRINTERLIST, isprinter);
+ ew (hDlg, IDC_SAMPLERLIST, issampler);
+ ew (hDlg, IDC_PRINTERAUTOFLUSH, isprinter);
+ ew (hDlg, IDC_PRINTERTYPELIST, isprinter);
+ ew (hDlg, IDC_FLUSHPRINTER, isprinteropen () && isprinter ? TRUE : FALSE);
+ ew (hDlg, IDC_PSPRINTER, full_property_sheet && ghostscript_available && isprinter ? TRUE : FALSE);
+ ew (hDlg, IDC_PSPRINTERDETECT, full_property_sheet && isprinter ? TRUE : FALSE);
+ ew (hDlg, IDC_PS_PARAMS, full_property_sheet && ghostscript_available && isprinter);
}
static int joys[] = { IDC_PORT0_JOYS, IDC_PORT1_JOYS, IDC_PORT2_JOYS, IDC_PORT3_JOYS };
BOOL success;
LRESULT item;
+ item = SendDlgItemMessage (hDlg, IDC_SAMPLERLIST, CB_GETCURSEL, 0, 0L);
+ if(item != CB_ERR) {
+ workprefs.win32_samplersoundcard = item - 1;
+ if (item > 0)
+ workprefs.prtname[0] = 0;
+ }
+
item = SendDlgItemMessage (hDlg, IDC_PRINTERLIST, CB_GETCURSEL, 0, 0L);
if(item != CB_ERR) {
int got = 0;
_tcscpy (tmp, workprefs.prtname);
if (item > 0) {
+ workprefs.win32_samplersoundcard = -1;
item--;
if (item < dwEnumeratedPrinters) {
_tcscpy (workprefs.prtname, pInfo[item].pName);
static void values_to_portsdlg (HWND hDlg)
{
- LRESULT result = 0;
+ LRESULT result;
int idx;
+ SendDlgItemMessage (hDlg, IDC_SAMPLERLIST, CB_SETCURSEL, workprefs.win32_samplersoundcard + 1, 0);
+
+ result = 0;
if(workprefs.prtname[0]) {
int i, got = 1;
TCHAR tmp[10];
WIN32GUI_LoadUIString (IDS_PRINTER_POSTSCRIPT_EMULATION, tmp, MAX_DPATH);
SendDlgItemMessage (hDlg, IDC_PRINTERTYPELIST, CB_ADDSTRING, 0, (LPARAM)tmp);
+ SendDlgItemMessage (hDlg, IDC_SAMPLERLIST, CB_RESETCONTENT, 0, 0L);
+ SendDlgItemMessage (hDlg, IDC_SAMPLERLIST, CB_ADDSTRING, 0, (LPARAM)szNone);
+ enumerate_sound_devices ();
+ for (int card = 0; record_devices[card].type; card++) {
+ int type = record_devices[card].type;
+ TCHAR tmp[MAX_DPATH];
+ _stprintf (tmp, L"%s: %s",
+ type == SOUND_DEVICE_DS ? L"DSOUND" : (type == SOUND_DEVICE_AL ? L"OpenAL" : (type == SOUND_DEVICE_PA ? L"PortAudio" : L"WASAPI")),
+ record_devices[card].name);
+ if (type == SOUND_DEVICE_DS)
+ SendDlgItemMessage (hDlg, IDC_SAMPLERLIST, CB_ADDSTRING, 0, (LPARAM)tmp);
+ }
+
SendDlgItemMessage (hDlg, IDC_PRINTERLIST, CB_RESETCONTENT, 0, 0L);
SendDlgItemMessage (hDlg, IDC_PRINTERLIST, CB_ADDSTRING, 0, (LPARAM)szNone);
if(!pInfo) {
if (HIWORD (wParam) == CBN_SELCHANGE) {
switch (LOWORD (wParam))
{
+ case IDC_SAMPLERLIST:
case IDC_PRINTERLIST:
case IDC_SERIAL:
case IDC_MIDIOUTLIST:
values_from_portsdlg (hDlg);
inputdevice_updateconfig (&workprefs);
inputdevice_config_change ();
+ enable_for_portsdlg (hDlg);
break;
case IDC_PRINTERTYPELIST:
{
-1,
IDD_PATHS, IDC_PATHS_ROM, IDC_PATHS_CONFIG, IDC_PATHS_SCREENSHOT, IDC_PATHS_SAVESTATE, IDC_PATHS_AVIOUTPUT, IDC_PATHS_SAVEIMAGE, IDC_PATHS_RIP,
-1,
- IDD_IOPORTS, IDC_PRINTERLIST, IDC_PS_PARAMS, IDC_SERIAL, IDC_MIDIOUTLIST, IDC_MIDIINLIST,
+ IDD_IOPORTS, IDC_PRINTERLIST, IDC_SAMPLERLIST, IDC_PS_PARAMS, IDC_SERIAL, IDC_MIDIOUTLIST, IDC_MIDIINLIST,
-1,
IDD_SOUND, IDC_SOUNDCARDLIST, IDC_SOUNDDRIVESELECT,
-1,
#include "options.h"
#include "events.h"
#include "custom.h"
+#include "sampler.h"
#include "dxwrap.h"
#include <dsound.h>
+#include "win32.h"
+
#define RECORDBUFFER (10000 * 4)
-#define SAMPLEBUFFER (1024 * 4)
+#define SAMPLEBUFFER (2048 * 4)
static LPDIRECTSOUNDCAPTURE lpDS2r = NULL;
static LPDIRECTSOUNDCAPTUREBUFFER lpDSBprimary2r = NULL;
static uae_u8 *samplebuffer;
static int samplerate = 44100;
static float clockspersample;
+static int vsynccnt;
static int capture_init (void)
{
wavfmt.nAvgBytesPerSec = wavfmt.nBlockAlign * wavfmt.nSamplesPerSec;
wavfmt.cbSize = 0;
- hr = DirectSoundCaptureCreate (NULL, &lpDS2r, NULL);
+ hr = DirectSoundCaptureCreate (&record_devices[currprefs.win32_samplersoundcard].guid, &lpDS2r, NULL);
if (FAILED (hr)) {
write_log (L"SAMPLER: DirectSoundCaptureCreate() failure: %s\n", DXError (hr));
return 0;
if (lpDSB2r) {
lpDSB2r->Stop ();
lpDSB2r->Release ();
+ write_log (L"SAMPLER: Parallel port sampler freed\n");
}
lpDSB2r = NULL;
if (lpDS2r)
DWORD len1, len2;
evt cycles;
int offset;
- int sample, samplecnt;
+ int sample, samplecnt, diff;
+ int channel = 0;
uae_s16 *sbuf = (uae_s16*)samplebuffer;
if (!inited) {
- if (!capture_init ())
+ if (!capture_init ()) {
+ capture_free ();
return 0;
+ }
inited = 1;
+ oldcycles = get_cycles ();
+ oldoffset = -1;
+ hr = lpDSB2r->GetCurrentPosition (&t, &cap_pos);
+ if (FAILED (hr)) {
+ sampler_free ();
+ return 0;
+ }
}
+ vsynccnt = 0;
sample = 0;
samplecnt = 0;
cycles = get_cycles () - oldcycles;
offset = cycles / clockspersample;
- if (offset >= SAMPLEBUFFER || offset < 0) {
- if (offset >= SAMPLEBUFFER) {
+ if (oldoffset < 0 || offset >= SAMPLEBUFFER || offset < 0) {
+ if (oldoffset >= 0 && offset >= SAMPLEBUFFER) {
while (oldoffset < SAMPLEBUFFER) {
- sample += sbuf[oldoffset * 2];
+ sample += sbuf[oldoffset * 2 + channel];
oldoffset++;
samplecnt++;
}
hr = lpDSB2r->GetCurrentPosition (&t, &cur_pos);
if (FAILED (hr))
return 0;
+ write_log (L"%d\n", cur_pos - cap_pos);
+ if (cur_pos >= cap_pos)
+ diff = cur_pos - cap_pos;
+ else
+ diff = RECORDBUFFER - cap_pos + cur_pos;
+ if (diff > SAMPLEBUFFER * 4) {
+ cap_pos = cur_pos;
+ oldoffset = 0;
+ oldcycles = get_cycles ();
+ }
hr = lpDSB2r->Lock (cap_pos, SAMPLEBUFFER, &p1, &len1, &p2, &len2, 0);
if (FAILED (hr))
return 0;
if (p2)
memcpy (samplebuffer + len1, p2, len2);
lpDSB2r->Unlock (p1, len1, p2, len2);
+ cap_pos += SAMPLEBUFFER;
+ cap_pos += diff;
+ if (cap_pos >= RECORDBUFFER)
+ cap_pos -= RECORDBUFFER;
+ if (cap_pos < 0)
+ cap_pos = 0;
offset = 0;
+ if (oldoffset < 0)
+ oldoffset = 0;
}
while (oldoffset <= offset) {
- sample += ((uae_s16*)samplebuffer)[oldoffset * 2];
+ sample += ((uae_s16*)samplebuffer)[oldoffset * 2 + channel];
oldoffset++;
samplecnt++;
}
int sampler_init (void)
{
clockspersample = (float)maxvpos * maxhpos * vblank_hz * CYCLE_UNIT / samplerate;
- oldcycles = get_cycles ();
- if (!currprefs.parallel_sampler)
+ if (currprefs.win32_samplersoundcard < 0)
return 0;
return 1;
}
void sampler_free (void)
{
inited = 0;
+ vsynccnt = 0;
capture_free ();
}
+void sampler_vsync (void)
+{
+ if (!inited)
+ return;
+ vsynccnt++;
+ if (vsynccnt > 50) {
+ sampler_free ();
+ return;
+ }
+}
\ No newline at end of file
return ZFILE_NVR;
if (strcasecmp (ext, L"uae") == 0)
return ZFILE_CONFIGURATION;
- if (strcasecmp (ext, L"cue") == 0)
+ if (strcasecmp (ext, L"cue") == 0 || strcasecmp (ext, L"iso") == 0)
return ZFILE_CDIMAGE;
}
memset (buf, 0, sizeof (buf));