di->lun = 0;
di->media_inserted = 0;
di->bytespersector = 2048;
- if (ismedia (unitnum, 1))
+ di->mediapath[0] = 0;
+ if (ismedia (unitnum, 1)) {
di->media_inserted = 1;
+ _tcscpy (di->mediapath, currprefs.cdimagefile);
+ }
di->write_protected = 1;
di->type = INQ_ROMD;
di->id = 1;
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]);
*location = _tcstol (value, &endptr, base) * scale;
if (*endptr != '\0' || *value == '\0') {
+ if (strcasecmp (value, L"false") == 0 || strcasecmp (value, L"no") == 0) {
+ *location = 0;
+ return 1;
+ }
+ if (strcasecmp (value, L"true") == 0 || strcasecmp (value, L"yes") == 0) {
+ *location = 1;
+ return 1;
+ }
write_log (L"Option '%s' requires a numeric argument but got '%s'\n", option, value);
return -1;
}
|| 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;
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;
#include "uae.h"
#include "amax.h"
#include "ersatz.h"
+#include "sampler.h"
#include "dongle.h"
#define CIAA_DEBUG_R 0
} else if (arcadia_bios) {
tmp = arcadia_parport (0, ciaaprb, ciaadrb);
#endif
+ } else if (currprefs.parallel_sampler) {
+
+ tmp = sampler_getsample ();
+
} else
#endif
+
{
tmp = handle_parport_joystick (0, ciaaprb, ciaadrb);
tmp = dongle_cia_read (1, reg, tmp);
{
/* Last hpos = hpos + 0.5, eg. normal PAL end hpos is 227.5 * 2 = 455
OCS Denise: 9 bit hdiw counter does not reset during lines 0 to 9
- (PAL) or lines 0 to 10 (NTSC)
+ (PAL) or lines 0 to 10 (NTSC). A1000 PAL: 1 to 9, NTSC: 1 to 10.
ECS Denise and AGA: no above "features"
*/
cb = ledcolor (TD_BORDER, rc, gc, bc, alpha);
if (td_pos & TD_RIGHT)
- x_start = totalwidth - TD_PADX - NUM_LEDS * TD_WIDTH;
+ x_start = totalwidth - TD_PADX - VISIBLE_LEDS * TD_WIDTH;
else
x_start = TD_PADX;
- for (led = 0; led < NUM_LEDS; led++) {
+ for (led = 0; led < VISIBLE_LEDS; led++) {
int side, pos, num1 = -1, num2 = -1, num3 = -1, num4 = -1;
int x, c, on = 0, am = 2;
xcolnr on_rgb, on_rgb2, off_rgb, pen_rgb;
write_log (L"%s:\n", uip->rootdir);
if (hfd->drive_empty) {
rdbmnt
- write_log (L"ignored, drive is empty\n");
+ write_log (L"ignored, drive is empty\n");
return -2;
}
if (hfd->blocksize == 0) {
rdbmnt
- write_log (L"failed, blocksize == 0\n");
+ write_log (L"failed, blocksize == 0\n");
return -1;
}
if (lastblock * hfd->blocksize > hfd->virtsize) {
rdbmnt
- write_log (L"failed, too small (%d*%d > %I64u)\n", lastblock, hfd->blocksize, hfd->virtsize);
+ write_log (L"failed, too small (%d*%d > %I64u)\n", lastblock, hfd->blocksize, hfd->virtsize);
return -2;
}
for (rdblock = 0; rdblock < lastblock; rdblock++) {
}
if (rdblock == lastblock) {
rdbmnt
- write_log (L"failed, no RDB detected\n");
+ write_log (L"failed, no RDB detected\n");
return -2;
}
blocksize = rl (bufrdb + 16);
badblock = rl (bufrdb + 24);
if (badblock != -1) {
rdbmnt
- write_log (L"RDB: badblock list is not yet supported. Contact the author.\n");
+ write_log (L"RDB: badblock list is not yet supported. Contact the author.\n");
return -2;
}
driveinitblock = rl (bufrdb + 36);
if (driveinitblock != -1) {
rdbmnt
- write_log (L"RDB: driveinit is not yet supported. Contact the author.\n");
+ write_log (L"RDB: driveinit is not yet supported. Contact the author.\n");
return -2;
}
hfd->cylinders = rl (bufrdb + 64);
}
rdbmnt
- flags = rl (buf + 20);
+ flags = rl (buf + 20);
if (flags & 2) { /* do not mount */
err = -1;
write_log (L"RDB: Automount disabled, not mounting\n");
lsegblock = rl (buf + 16);
if (lsegblock == pb)
goto error;
+ if ((i + 1) * (blocksize - 20) >= 262144)
+ goto error;
memcpy (fsmem + i * (blocksize - 20), buf + 20, blocksize - 20);
i++;
if (lsegblock == -1)
if (using_ce020) {
switch (size) {
case sz_byte:
- printf ("\tput_byte_ce020 (%sa,%s);\n", to, from);
+ printf ("\tput_byte_ce020 (%sa, %s);\n", to, from);
count_write++;
break;
case sz_word:
if (cpu_level < 2 && (mode == PC16 || mode == PC8r))
abort ();
- printf ("\tput_word_ce020 (%sa,%s);\n", to, from);
+ printf ("\tput_word_ce020 (%sa, %s);\n", to, from);
count_write++;
break;
case sz_long:
} else if (using_ce) {
switch (size) {
case sz_byte:
- printf ("\tput_byte_ce (%sa,%s);\n", to, from);
+ printf ("\tput_byte_ce (%sa, %s);\n", to, from);
count_write++;
break;
case sz_word:
if (cpu_level < 2 && (mode == PC16 || mode == PC8r))
abort ();
- printf ("\tput_word_ce (%sa,%s);\n", to, from);
+ printf ("\tput_word_ce (%sa, %s);\n", to, from);
count_write++;
break;
case sz_long:
case sz_byte:
insn_n_cycles += 4;
if (flags & GF_FC)
- printf ("\tdfc_put_byte (%sa,%s);\n", to, from);
+ printf ("\tdfc_put_byte (%sa, %s);\n", to, from);
else
- printf ("\tput_byte_mmu (%sa,%s);\n", to, from);
+ printf ("\tput_byte_mmu (%sa, %s);\n", to, from);
break;
case sz_word:
insn_n_cycles += 4;
if (cpu_level < 2 && (mode == PC16 || mode == PC8r))
abort ();
if (flags & GF_FC)
- printf ("\tdfc_put_word (%sa,%s);\n", to, from);
+ printf ("\tdfc_put_word (%sa, %s);\n", to, from);
else
- printf ("\tput_word_mmu (%sa,%s);\n", to, from);
+ printf ("\tput_word_mmu (%sa, %s);\n", to, from);
break;
case sz_long:
insn_n_cycles += 8;
if (cpu_level < 2 && (mode == PC16 || mode == PC8r))
abort ();
if (flags & GF_FC)
- printf ("\tdfc_put_long (%sa,%s);\n", to, from);
+ printf ("\tdfc_put_long (%sa, %s);\n", to, from);
else
- printf ("\tput_long_mmu (%sa,%s);\n", to, from);
+ printf ("\tput_long_mmu (%sa, %s);\n", to, from);
break;
default:
abort ();
switch (size) {
case sz_byte:
insn_n_cycles += 4;
- printf ("\tput_byte (%sa,%s);\n", to, from);
+ printf ("\tput_byte (%sa, %s);\n", to, from);
count_write++;
break;
case sz_word:
insn_n_cycles += 4;
if (cpu_level < 2 && (mode == PC16 || mode == PC8r))
abort ();
- printf ("\tput_word (%sa,%s);\n", to, from);
+ printf ("\tput_word (%sa, %s);\n", to, from);
count_write++;
break;
case sz_long:
insn_n_cycles += 8;
if (cpu_level < 2 && (mode == PC16 || mode == PC8r))
abort ();
- printf ("\tput_long (%sa,%s);\n", to, from);
+ printf ("\tput_long (%sa, %s);\n", to, from);
count_write += 2;
break;
default:
printf ("\t}\n");
need_endlabel = 1;
}
- if (curi->smode == Ad16 || curi->smode == absw || curi->smode == PC16)
- addcycles000 (2);
- setpc ("srca");
- m68k_pc_offset = 0;
- fill_prefetch_1 (0);
- if (curi->smode == Ad8r || curi->smode == PC8r)
- addcycles000 (6);
- printf ("\tm68k_areg (regs, 7) -= 4;\n");
- if (using_ce) {
- printf ("\tput_word_ce (m68k_areg (regs, 7), oldpc >> 16);\n");
- printf ("\tput_word_ce (m68k_areg (regs, 7) + 2, oldpc);\n");
+ if (using_mmu) {
+ printf ("\t%s (m68k_areg (regs, 7) - 4, oldpc);\n", dstl);
+ printf ("\tm68k_areg (regs, 7) -= 4;\n");
+ setpc ("srca");
+ m68k_pc_offset = 0;
} else {
- printf ("\t%s (m68k_areg (regs, 7), oldpc);\n", dstl);
+ if (curi->smode == Ad16 || curi->smode == absw || curi->smode == PC16)
+ addcycles000 (2);
+ setpc ("srca");
+ m68k_pc_offset = 0;
+ fill_prefetch_1 (0);
+ if (curi->smode == Ad8r || curi->smode == PC8r)
+ addcycles000 (6);
+ printf ("\tm68k_areg (regs, 7) -= 4;\n");
+ if (using_ce) {
+ printf ("\tput_word_ce (m68k_areg (regs, 7), oldpc >> 16);\n");
+ printf ("\tput_word_ce (m68k_areg (regs, 7) + 2, oldpc);\n");
+ } else {
+ printf ("\t%s (m68k_areg (regs, 7), oldpc);\n", dstl);
+ }
}
count_write += 2;
fill_prefetch_next ();
#include "execio.h"
#include "zfile.h"
-//#undef DEBUGME
+#undef DEBUGME
#define hf_log
#define hf_log2
#define scsi_log
#define hf_log3
-#define DEBUGME
+//#define DEBUGME
#ifdef DEBUGME
#undef hf_log
#define hf_log write_log
case 0x25: /* READ_CAPACITY */
{
int pmi = cmdbuf[8] & 1;
- uae_u32 lba = (cmdbuf[2] << 24) | (cmdbuf[3] << 16) | (cmdbuf[2] << 8) | cmdbuf[3];
+ uae_u32 lba = (cmdbuf[2] << 24) | (cmdbuf[3] << 16) | (cmdbuf[4] << 8) | cmdbuf[5];
uae_u32 blocks;
int cyl, cylsec, head, tracksec;
if (nodisk (hfd))
} else {
getchs (hfd, &cyl, &cylsec, &head, &tracksec);
}
+ if (pmi == 0 && lba != 0)
+ goto errreq;
if (pmi) {
lba += tracksec * head;
lba /= tracksec * head;
default:
err:
- lr = -1;
write_log (L"UAEHF: unsupported scsi command 0x%02X\n", cmdbuf[0]);
+errreq:
+ lr = -1;
status = 2; /* CHECK CONDITION */
s[0] = 0x70;
s[2] = 5; /* ILLEGAL REQUEST */
int bus, target, lun;
int id;
TCHAR label[MAX_DPATH];
- TCHAR ident[16];
+ TCHAR mediapath[MAX_DPATH];
};
struct device_scsi_info {
uae_u32 crc32[4]; /* crc32 of image */
};
#define NUM_LEDS (LED_MAX)
+#define VISIBLE_LEDS (LED_MAX - 1)
extern struct gui_info gui_data;
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;
--- /dev/null
+
+extern uae_u8 sampler_getsample (void);
+extern int sampler_init (void);
+extern void sampler_free (void);
+
+
#include "gfxfilter.h"
#include "uaeresource.h"
#include "dongle.h"
+#include "sampler.h"
#include "consolehook.h"
#ifdef USE_SDL
#endif
native2amiga_reset ();
dongle_reset ();
+ sampler_init ();
}
/* Okay, this stuff looks strange, but it is here to encourage people who
void do_leave_program (void)
{
+ sampler_free ();
graphics_leave ();
inputdevice_close ();
DISK_free ();
if (!regs.stopped)
return;
regs.stopped = 0;
+ if (currprefs.cpu_cycle_exact) {
+ if (currprefs.cpu_model == 68000)
+ do_cycles_ce000 (6);
+ }
fill_prefetch_slow ();
unset_special (SPCFLAG_STOP);
}
di->lun = 0;
di->media_inserted = 0;
di->bytespersector = 2048;
+ _stprintf (di->mediapath, L"\\\\.\\%s", ciw32[unitnum].drvletter);
if (fetch_geometry (unitnum, di)) { // || ioctl_command_toc (unitnum))
di->media_inserted = 1;
ciw32[unitnum].blocksize = di->bytespersector;
return NULL;
dispti = &dev_info[unitnum];
_tcscpy (di->label, dispti->name);
+ _tcscpy (di->mediapath, dispti->drvpath);
di->bus = 0;
di->target = unitnum;
di->lun = 0;
static IDirect3DVertexBuffer9 *vertexBuffer;
static ID3DXSprite *sprite;
static HWND d3dhwnd;
+static int devicelost;
static D3DXMATRIX m_matProj;
static D3DXMATRIX m_matWorld;
static int ledwidth, ledheight;
static int twidth, theight, max_texture_w, max_texture_h;
static int tin_w, tin_h, window_h, window_w;
-static int t_depth;
+static int t_depth, mult;
static int required_sl_texture_w, required_sl_texture_h;
static int vsync2, guimode;
static int needclear;
write_log (L"D3D: Failed to lock box of volume texture: %s\n", D3D_ErrorString (hr));
return 0;
}
- //BuildHq2xLookupTexture(tin_w, tin_w, window_w, window_h, (unsigned char*)lockedBox.pBits);
- BuildHq2xLookupTexture(window_w, window_h, tin_w, tin_w, (unsigned char*)lockedBox.pBits);
+ //BuildHq2xLookupTexture(tin_w / mult, tin_w / mult, window_w, window_h, (unsigned char*)lockedBox.pBits);
+ BuildHq2xLookupTexture(window_w, window_h, tin_w / mult, tin_w / mult, (unsigned char*)lockedBox.pBits);
IDirect3DVolumeTexture9_UnlockBox (lpHq2xLookupTexture, 0);
}
//write_log (L"%dx%d %dx%d %dx%d\n", twidth, theight, tin_w, tin_h, window_w, window_h);
- getfilterrect2 (&dr, &sr, &zr, window_w, window_h, tin_w, tin_h, 1, tin_w, tin_h);
+ getfilterrect2 (&dr, &sr, &zr, window_w, window_h, tin_w / mult, tin_h / mult, mult, tin_w, tin_h);
//write_log (L"(%d %d %d %d) - (%d %d %d %d) (%d %d)\n",
// dr.left, dr.top, dr.right, dr.bottom, sr.left, sr.top, sr.right, sr.bottom, zr.left, zr.top);
int w, h;
*depth = t_depth;
- getfilterrect2 (&dr, &sr, &zr, window_w, window_h, tin_w, tin_h, 1, tin_w, tin_h);
+ getfilterrect2 (&dr, &sr, &zr, window_w, window_h, tin_w, tin_h, mult, tin_w, tin_h);
w = sr.right - sr.left;
h = sr.bottom - sr.top;
p = gfxvidinfo.bufmem;
psPreProcess = 0;
psActive = 0;
resetcount = 0;
+ devicelost = 0;
changed_prefs.leds_on_screen = currprefs.leds_on_screen = currprefs.leds_on_screen & ~STATUSLINE_TARGET;
}
flags = D3DCREATE_HARDWARE_VERTEXPROCESSING;
else
flags = D3DCREATE_SOFTWARE_VERTEXPROCESSING;
- flags |= D3DCREATE_NOWINDOWCHANGES | D3DCREATE_FPU_PRESERVE;
+ flags |= D3DCREATE_FPU_PRESERVE;
if (d3d_ex && D3DEX) {
ret = IDirect3D9Ex_CreateDeviceEx (d3dex, adapter, D3DDEVTYPE_HAL, d3dhwnd, flags, &dpp, &modeex, &d3ddevex);
tex_square, tex_pow2, tex_dynamic,
max_texture_w, max_texture_h);
- t_w *= S2X_getmult ();
- t_h *= S2X_getmult ();
+ mult = S2X_getmult ();
+ t_w *= mult;
+ t_h *= mult;
if (max_texture_w < t_w || max_texture_h < t_h) {
_stprintf (errmsg, L"Direct3D: %d * %d or bigger texture support required\nYour card's maximum texture size is only %d * %d",
return 0;
}
+static int isd3d (void)
+{
+ if (devicelost || !d3ddev || !d3d_enabled)
+ return 0;
+ return 1;
+}
+
int D3D_needreset (void)
{
- HRESULT hr = IDirect3DDevice9_TestCooperativeLevel (d3ddev);
+ HRESULT hr;
+
+ if (!devicelost)
+ return -1;
+ hr = IDirect3DDevice9_TestCooperativeLevel (d3ddev);
if (hr == D3DERR_DEVICENOTRESET) {
+ write_log (L"D3D: DEVICENOTRESET\n");
+ devicelost = 2;
+ invalidatedeviceobjects ();
hr = IDirect3DDevice9_Reset (d3ddev, &dpp);
if (FAILED (hr)) {
write_log (L"D3D: Reset failed %s\n", D3D_ErrorString (hr));
resetcount++;
- if (resetcount > 2)
- changed_prefs.gfx_filter = 0;
+ if (resetcount > 2) {
+ changed_prefs.gfx_api = 0;
+ write_log (L"D3D: Too many failed resets, disabling Direct3D mode\n");
+ }
+ return 1;
}
+ write_log (L"D3D: Reset succeeded\n");
+ restoredeviceobjects ();
return 1;
+ } else if (hr == D3DERR_DEVICELOST) {
+ invalidatedeviceobjects ();
+ Sleep (500);
+ } else if (SUCCEEDED (hr)) {
+ return -1;
}
+ write_log (L"D3D: TestCooperativeLevel %s\n", D3D_ErrorString (hr));
return 0;
}
int i;
HRESULT hr;
- if (!d3ddev)
- return;
- hr = IDirect3DDevice9_TestCooperativeLevel (d3ddev);
- if (FAILED (hr))
+ if (!isd3d ())
return;
for (i = 0; i < 2; i++) {
- IDirect3DDevice9_Clear (d3ddev, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 0), 0, 0);
- IDirect3DDevice9_Present (d3ddev, NULL, NULL, NULL, NULL);
+ hr = IDirect3DDevice9_Clear (d3ddev, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 0), 0, 0);
+ hr = IDirect3DDevice9_Present (d3ddev, NULL, NULL, NULL, NULL);
}
}
{
HRESULT hr;
- if (!d3d_enabled)
- return;
- if (FAILED (IDirect3DDevice9_TestCooperativeLevel (d3ddev)))
+ if (!isd3d ())
return;
if (clear) {
hr = IDirect3DDevice9_EndScene (d3ddev);
hr = IDirect3DDevice9_Present (d3ddev, NULL, NULL, NULL, NULL);
+ if (hr == D3DERR_DEVICELOST) {
+ write_log (L"D3D: DEVICELOST\n");
+ devicelost = 1;
+ }
}
void D3D_unlocktexture (void)
{
HRESULT hr;
- RECT r;
+ if (!isd3d ())
+ return;
if (currprefs.leds_on_screen & STATUSLINE_CHIPSET)
updateleds ();
hr = IDirect3DTexture9_UnlockRect (texture, 0);
- r.left = 0; r.right = window_w;
- r.top = 0; r.bottom = window_h;
- hr = IDirect3DTexture9_AddDirtyRect (texture, &r);
D3D_render2 (0);
if (vsync2 && !currprefs.turbo_emulation)
D3DLOCKED_RECT locked;
HRESULT hr;
- hr = IDirect3DDevice9_TestCooperativeLevel (d3ddev);
- if (FAILED (hr)) {
- if (hr == D3DERR_DEVICELOST) {
- if (!dpp.Windowed && IsWindow (d3dhwnd) && !IsIconic (d3dhwnd)) {
- write_log (L"D3D: minimize\n");
- ShowWindow (d3dhwnd, SW_MINIMIZE);
- }
- }
+ if (!isd3d ())
return NULL;
- }
locked.pBits = NULL;
locked.Pitch = 0;
- hr = IDirect3DTexture9_LockRect (texture, 0, &locked, NULL, D3DLOCK_NO_DIRTY_UPDATE);
+ hr = IDirect3DTexture9_LockRect (texture, 0, &locked, NULL, 0);
if (FAILED (hr)) {
if (hr != D3DERR_DRIVERINTERNALERROR) {
write_log (L"IDirect3DTexture9_LockRect failed: %s\n", D3D_ErrorString (hr));
}
}
if (locked.pBits == NULL || locked.Pitch == 0) {
- write_log (L"IDirect3DTexture9_LockRect return NULL texture\n");
+ write_log (L"IDirect3DTexture9_LockRect returned NULL texture\n");
D3D_unlocktexture ();
return NULL;
}
void D3D_refresh (void)
{
- if (!d3d_enabled)
+ if (!isd3d ())
return;
createscanlines (1);
D3D_render2 (1);
void D3D_guimode (int guion)
{
HRESULT hr;
- if (!d3d_enabled)
+ if (!isd3d ())
return;
hr = IDirect3DDevice9_SetDialogBoxMode (d3ddev, guion);
if (FAILED (hr))
static LPDIRECT3DSURFACE9 bb;
HRESULT hr;
- if (!d3d_enabled)
+ if (!isd3d ())
return 0;
if (!hdc) {
hr = IDirect3DDevice9_GetBackBuffer (d3ddev, 0, 0, D3DBACKBUFFER_TYPE_MONO, &bb);
case ERROR_SHARING_VIOLATION:
case ERROR_BUSY:
case ERROR_INVALID_HANDLE:
+ case ERROR_USER_MAPPED_FILE:
return ERROR_OBJECT_IN_USE;
case ERROR_CURRENT_DIRECTORY:
default:
{
- gui_message (L"Unimplemented error %d\nContact author!", e);
+ static int done;
+ if (!done)
+ gui_message (L"Unimplemented error %d\nContact author!", e);
+ done = 1;
}
return ERROR_NOT_IMPLEMENTED;
}
// Fill in the structure with info about this "document."
DocInfo.pDocName = L"WinUAE Document";
DocInfo.pOutputFile = NULL;
- DocInfo.pDatatype = currprefs.parallel_matrix_emulation ? L"TEXT" : L"RAW";
+ DocInfo.pDatatype = (currprefs.parallel_matrix_emulation || currprefs.parallel_postscript_detection) ? L"TEXT" : L"RAW";
// Inform the spooler the document is beginning.
if ((dwJob = StartDocPrinter (hPrt, 1, (LPSTR)&DocInfo)) == 0) {
ClosePrinter (hPrt );
}
}
+static int cd_insert (int num, const TCHAR *name)
+{
+ if (num != 0)
+ return 0;
+ _tcscpy (changed_prefs.cdimagefile, name);
+ return 1;
+}
+
static BOOL RPPostMessagex(UINT uMessage, WPARAM wParam, LPARAM lParam, const RPGUESTINFO *pInfo)
{
BOOL v = FALSE;
case RP_DEVICE_INPUTPORT:
ok = port_insert (num, n);
break;
-
+ case RP_DEVICE_CD:
+ ok = cd_insert (num, n);
+ break;
}
xfree (n);
return ok;
sys_command_info (DF_IOCTL, i, &di);
cd_mask |= 1 << i;
RPSendMessagex (RPIPCGM_DEVICES, RP_DEVICE_CD, cd_mask, NULL, 0, &guestinfo, NULL);
- rp_cd_image_change (i, v == 0 ? L"" : di.ident);
+ rp_cd_image_change (i, di.mediapath);
}
}
winuae_active (hWnd, minimized);
minimized = 0;
dx_check ();
- return 0;
+ break;
case WM_ACTIVATE:
if (LOWORD (wParam) == WA_INACTIVE) {
minimized = HIWORD (wParam) ? 1 : 0;
winuae_inactive (hWnd, minimized);
}
dx_check ();
- return 0;
+ break;
case WM_ACTIVATEAPP:
#ifdef RETROPLATFORM
rp_activate (wParam, lParam);
#endif
dx_check ();
- return 0;
+ break;
case WM_PALETTECHANGED:
if ((HWND)wParam != hWnd)
case WM_DISPLAYCHANGE:
if (isfullscreen() <= 0 && !currprefs.gfx_filter && (wParam + 7) / 8 != DirectDraw_GetBytesPerPixel ())
- WIN32GFX_DisplayChangeRequested();
+ WIN32GFX_DisplayChangeRequested ();
break;
case WM_GETMINMAXINFO:
}
changed_prefs.gfx_size_win.x = left;
changed_prefs.gfx_size_win.y = top;
- if (canstretch () && mainwin_rect.right - mainwin_rect.left != width && mainwin_rect.bottom - mainwin_rect.top != height) {
+ if (canstretch () && (mainwin_rect.right - mainwin_rect.left != width || mainwin_rect.bottom - mainwin_rect.top != height)) {
changed_prefs.gfx_size_win.width = width - window_extra_width;
changed_prefs.gfx_size_win.height = height - window_extra_height;
}
}
+ if (hStatusWnd)
+ SendMessage (hStatusWnd, WM_SIZE, wParam, lParam);
GetWindowRect (hMainWnd, &mainwin_rect);
return 0;
}
- GetWindowRect (hMainWnd, &mainwin_rect);
+ if (!iconic)
+ GetWindowRect (hMainWnd, &mainwin_rect);
}
break;
wc.lpfnWndProc = AmigaWindowProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = DLGWINDOWEXTRA;
- wc.hInstance = 0;
+ wc.hInstance = hInst;
wc.hIcon = LoadIcon (GetModuleHandle (NULL), MAKEINTRESOURCE (IDI_APPICON));
wc.hCursor = NULL; //LoadCursor (NULL, IDC_ARROW);
wc.lpszMenuName = 0;
wc.lpfnWndProc = MainWindowProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = DLGWINDOWEXTRA;
- wc.hInstance = 0;
+ wc.hInstance = hInst;
wc.hIcon = LoadIcon (GetModuleHandle (NULL), MAKEINTRESOURCE (IDI_APPICON));
wc.hCursor = NULL; //LoadCursor (NULL, IDC_ARROW);
wc.hbrBackground = CreateSolidBrush (black);
wc.lpfnWndProc = HiddenWindowProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = DLGWINDOWEXTRA;
- wc.hInstance = 0;
+ wc.hInstance = hInst;
wc.hIcon = LoadIcon (GetModuleHandle (NULL), MAKEINTRESOURCE (IDI_APPICON));
wc.hCursor = NULL; //LoadCursor (NULL, IDC_ARROW);
wc.hbrBackground = CreateSolidBrush (g_dwBackgroundColor);
#define WINUAEPUBLICBETA 1
#define LANG_DLL 1
-#define WINUAEBETA L"Beta 5"
-#define WINUAEDATE MAKEBD(2010, 1, 22)
+#define WINUAEBETA L"Beta 6"
+#define WINUAEDATE MAKEBD(2010, 1, 29)
#define WINUAEEXTRA L""
#define WINUAEREV L""
ret = 1;
if (currentmode->flags & DM_D3D) {
#ifdef D3D
- if (D3D_needreset ())
+ int v;
+ v = D3D_needreset ();
+ if (v > 0)
WIN32GFX_DisplayChangeRequested ();
+ if (v >= 0)
+ return 0;
if (currentmode->flags & DM_SWSCALE) {
ret = 1;
} else {
int fsw = currentmode->flags & (DM_W_FULLSCREEN);
DWORD exstyle = currprefs.win32_notaskbarbutton ? WS_EX_TOOLWINDOW : WS_EX_APPWINDOW;
DWORD flags = 0;
- HWND hhWnd = NULL;//currprefs.win32_notaskbarbutton ? hHiddenWnd : NULL;
int borderless = currprefs.win32_borderless;
DWORD style = NORMAL_WINDOW_STYLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
int cymenu = GetSystemMetrics (SM_CYMENU);
style,
rc.left, rc.top,
rc.right - rc.left + 1, rc.bottom - rc.top + 1,
- hhWnd, NULL, hInst, NULL);
+ NULL, NULL, hInst, NULL);
if (!hMainWnd) {
write_log (L"main window creation failed\n");
return 0;
x, y, w, h,
parent, NULL, hInst, NULL);
} else {
- hAmigaWnd = CreateWindowEx (dxfs || d3dfs ?
-WS_EX_TOPMOST :
- WS_EX_ACCEPTFILES | exstyle | (currprefs.win32_alwaysontop ? WS_EX_TOPMOST : 0),
+ hAmigaWnd = CreateWindowEx (
+ ((dxfs || d3dfs || currprefs.win32_alwaysontop) ? WS_EX_TOPMOST : WS_EX_ACCEPTFILES) | exstyle,
L"AmigaPowah", L"WinUAE",
- (dxfs || d3dfs || currprefs.headless ? WS_POPUP : (WS_CLIPCHILDREN | WS_CLIPSIBLINGS | (hMainWnd ? WS_VISIBLE | WS_CHILD : WS_VISIBLE | WS_POPUP | WS_SYSMENU | WS_MINIMIZEBOX))),
+ ((dxfs || d3dfs || currprefs.headless) ? WS_POPUP : (WS_CLIPCHILDREN | WS_CLIPSIBLINGS | (hMainWnd ? WS_VISIBLE | WS_CHILD : WS_VISIBLE | WS_POPUP | WS_SYSMENU | WS_MINIMIZEBOX))),
x, y, w, h,
- borderless ? NULL : (hMainWnd ? hMainWnd : hhWnd), NULL, hInst, NULL);
+ borderless ? NULL : (hMainWnd ? hMainWnd : NULL),
+ NULL, hInst, NULL);
}
if (!hAmigaWnd) {
write_log (L"creation of amiga window failed\n");
{
HWND hWnd;
RECT windowRect;
- int width, height, w2, h2;
+ int width, height, w2, h2, x, y;
struct MultiDisplay *md;
NMHDR *nmhdr;
int doit = FALSE;
- static int prevwidth, prevheight;
if (message == WM_NOTIFY) {
nmhdr = (LPNMHDR)lParam;
return FALSE;
w2 = WIN32GFX_GetWidth ();
h2 = WIN32GFX_GetHeight ();
- if (w2 == prevwidth && h2 == prevheight) {
- write_log (L"SAME %dx%d\n", w2, h2);
- return FALSE;
- }
- prevwidth = w2;
- prevheight = h2;
write_log (L"MOVEWINDOW %dx%d %dx%d (%dx%d)\n", md->rect.left, md->rect.top, md->rect.right, md->rect.bottom, w2, h2);
hWnd = GetParent (hDlg);
windowRect.left = windowRect.right = windowRect.top = windowRect.bottom = -1;
width = w2;
if (height > h2)
height = h2;
- SetWindowPos (hWnd, NULL, md->rect.left + (w2 - width) / 2, md->rect.top + (h2 - height) / 2, width, height, SWP_NOZORDER | SWP_NOACTIVATE);
+ x = md->rect.left + (w2 - width) / 2;
+ y = md->rect.top + (h2 - height) / 2;
+ write_log (L"X=%d Y=%d W=%d H=%d\n", x, y, width, height);
+ SetWindowPos (hWnd, NULL, x, y, width, height, SWP_NOZORDER | SWP_NOACTIVATE);
return FALSE;
}
return 1;
}
-static BOOL CreateHardFile (HWND hDlg, UINT hfsizem, TCHAR *dostype, TCHAR *newpath)
+static BOOL CreateHardFile (HWND hDlg, UINT hfsizem, TCHAR *dostype, TCHAR *newpath, TCHAR *outpath)
{
HANDLE hf;
int i = 0;
uae_u8 b;
int sparse, dynamic;
+ outpath[0] = 0;
sparse = 0;
dynamic = 0;
hfsize = (uae_u64)hfsizem * 1024 * 1024;
WIN32GUI_LoadUIString (IDS_FAILEDHARDFILECREATION, szMessage, MAX_DPATH);
WIN32GUI_LoadUIString (IDS_CREATIONERROR, szTitle, MAX_DPATH);
MessageBox (hDlg, szMessage, szTitle, MB_OK | MB_ICONERROR | MB_APPLMODAL | MB_SETFOREGROUND);
+ } else {
+ _tcscpy (outpath, init_path);
}
return result;
}
ew (guiDlg, IDC_RESETAMIGA, FALSE);
workprefs.nr_floppies = quickstart_floppy;
quickstart_ok = built_in_prefs (&workprefs, quickstart_model, quickstart_conf, quickstart_compa, romcheck);
- quickstart_cd = workprefs.dfxtype[0] == DRV_NONE;
+ quickstart_cd = workprefs.dfxtype[0] == DRV_NONE && (quickstart_model == 8 || quickstart_model == 9);
enable_for_quickstart (hDlg);
addfloppytype (hDlg, 0);
addfloppytype (hDlg, 1);
static void hardfilecreatehdf (HWND hDlg, TCHAR *newpath)
{
+ TCHAR hdfpath[MAX_DPATH];
LRESULT res;
UINT setting = CalculateHardfileSize (hDlg);
TCHAR dostype[16];
res = SendDlgItemMessage (hDlg, IDC_HF_TYPE, CB_GETCURSEL, 0, 0);
if (res == 0)
dostype[0] = 0;
- CreateHardFile (hDlg, setting, dostype, newpath);
+ if (CreateHardFile (hDlg, setting, dostype, newpath, hdfpath)) {
+ if (!current_hfdlg.filename[0])
+ _tcscpy (current_hfdlg.filename, hdfpath);
+ }
sethardfile (hDlg);
}
};
static struct filterxtra filter_3d_extra[] =
{
- L"Bilinear", &workprefs.gfx_filter_bilinear, &currprefs.gfx_filter_bilinear, 0, 1, 1,
+ L"Point/Bilinear", &workprefs.gfx_filter_bilinear, &currprefs.gfx_filter_bilinear, 0, 1, 1,
L"Scanline transparency", &workprefs.gfx_filter_scanlines, &currprefs.gfx_filter_scanlines, 0, 100, 10,
L"Scanline level", &workprefs.gfx_filter_scanlinelevel, &currprefs.gfx_filter_scanlinelevel, 0, 100, 10,
NULL
int i, got;
got = 0;
- SendDlgItemMessage (hDlg, id, CB_SETCURSEL, 0, 0);
for (i = 0; filtermultnames[i]; i++) {
if (filtermults[i] == val) {
SendDlgItemMessage (hDlg, id, CB_SETCURSEL, i, 0);
tmp[0] = 0;
if (val > 0)
_stprintf (tmp, L"%.2f", 1000.0 / val);
+ SendDlgItemMessage (hDlg, id, CB_SETCURSEL, 0, 0);
SetDlgItemText (hDlg, id, tmp);
}
}
static void setfiltermult (HWND hDlg)
{
- int i;
-
- SendDlgItemMessage (hDlg, IDC_FILTERHZMULT, CB_RESETCONTENT, 0, 0L);
- SendDlgItemMessage (hDlg, IDC_FILTERVZMULT, CB_RESETCONTENT, 0, 0L);
- for (i = 0; filtermultnames[i]; i++) {
- SendDlgItemMessage (hDlg, IDC_FILTERHZMULT, CB_ADDSTRING, 0, (LPARAM)filtermultnames[i]);
- SendDlgItemMessage (hDlg, IDC_FILTERVZMULT, CB_ADDSTRING, 0, (LPARAM)filtermultnames[i]);
- }
setfiltermult2 (hDlg, IDC_FILTERHZMULT, workprefs.gfx_filter_horiz_zoom_mult);
setfiltermult2 (hDlg, IDC_FILTERVZMULT, workprefs.gfx_filter_vert_zoom_mult);
}
TCHAR txt[100], tmp[100];
int i, j, fltnum, modenum;
struct uae_filter *uf;
- int fxidx = 0, fxcnt;
+ int fxidx, fxcnt;
UAEREG *fkey;
SendDlgItemMessage (hDlg, IDC_FILTERASPECT, CB_SETCURSEL,
}
SendDlgItemMessage (hDlg, IDC_FILTERMODE, CB_SETCURSEL, fltnum, 0);
+ fxidx = 0;
filter_extra[fxidx] = NULL;
SendDlgItemMessage (hDlg, IDC_FILTERFILTER, CB_RESETCONTENT, 0, 0L);
if (workprefs.gfx_api) {
if (idx == 0) {
filter_selected = &fx[i];
filter_selected_num = fxcnt;
+ prev = NULL;
}
fxcnt++;
idx--;
static int recursive;
LRESULT item;
TCHAR tmp[100];
+ int i;
switch (msg)
{
SendDlgItemMessage (hDlg, IDC_FILTERASPECT2, CB_ADDSTRING, 0, (LPARAM)L"VGA");
SendDlgItemMessage (hDlg, IDC_FILTERASPECT2, CB_ADDSTRING, 0, (LPARAM)L"TV");
+ SendDlgItemMessage (hDlg, IDC_FILTERHZMULT, CB_RESETCONTENT, 0, 0L);
+ SendDlgItemMessage (hDlg, IDC_FILTERVZMULT, CB_RESETCONTENT, 0, 0L);
+ for (i = 0; filtermultnames[i]; i++) {
+ SendDlgItemMessage (hDlg, IDC_FILTERHZMULT, CB_ADDSTRING, 0, (LPARAM)filtermultnames[i]);
+ SendDlgItemMessage (hDlg, IDC_FILTERVZMULT, CB_ADDSTRING, 0, (LPARAM)filtermultnames[i]);
+ }
+
enable_for_hw3ddlg (hDlg);
case WM_USER:
break;
case IDC_FILTERD3D:
workprefs.gfx_api = IsDlgButtonChecked (hDlg, IDC_FILTERD3D) ? 1 : 0;
+ enable_for_hw3ddlg (hDlg);
+ values_to_hw3ddlg (hDlg);
break;
case IDC_FILTERKEEPASPECT:
{
AdditionalOptions=""
Optimization="0"
AdditionalIncludeDirectories="..\..\include,..\..,..\,..\resources,..\osdep,..\sounddep,..\..\prowizard\include,..\tun"
- PreprocessorDefinitions="WINVER=0x0500,_DEBUG,WIN32_IE=0x0700;WIN32;CINTERFACE;COBJMACROS;_CRT_SECURE_NO_WARNINGS"
+ PreprocessorDefinitions="WINVER=0x0500,_DEBUG,WIN32_IE=0x0700;WIN32;CINTERFACE;COBJMACROS;_CRT_SECURE_NO_WARNINGS;D3D_DEBUG_INFO"
GeneratePreprocessedFile="0"
KeepComments="false"
ExceptionHandling="0"
RelativePath="..\..\rommgr.c"
>
</File>
+ <File
+ RelativePath="..\..\sampler.c"
+ >
+ </File>
<File
RelativePath="..\..\sana2.c"
>
+Beta 6:
+
+- filter panel GUI issues fixed
+- arcadia quickstart incorrectly enabled CD mode (b5)
+- directory filesystem ERROR_USER_MAPPED_FILE mapped to OBJECT_IN_USE
+- directory filesystem: complain about unimplemented error(s) only once
+- unminimize changed display size (update to b4 fix)
+- window resize was ignored unless both width and height changed (b4)
+- OSD had extra gap in right border (b1)
+- D3D fullscreen handling update, device loss handling improved,
+ possible ALT-TAB weirdness should be gone now, D3D debug runtime
+ warnings fixed
+
Beta 5:
- save cdimage path to statefile (if set)
--- /dev/null
+/*
+ * Parallel port audio digitizer
+ *
+ * Toni Wilen 2010
+ */
+
+#include "sysconfig.h"
+#include "sysdeps.h"
+
+#include "options.h"
+#include "events.h"
+
+#include "dxwrap.h"
+
+#include <dsound.h>
+
+#define RECORDBUFFER (10000 * 4)
+#define SAMPLEBUFFER (1024 * 4)
+
+static LPDIRECTSOUNDCAPTURE lpDS2r = NULL;
+static LPDIRECTSOUNDCAPTUREBUFFER lpDSBprimary2r = NULL;
+static LPDIRECTSOUNDCAPTUREBUFFER lpDSB2r = NULL;
+static int inited;
+static uae_u8 *samplebuffer;
+
+static int capture_init (void)
+{
+ HRESULT hr;
+ DSCBUFFERDESC sound_buffer_rec;
+ WAVEFORMATEX wavfmt;
+
+ wavfmt.wFormatTag = WAVE_FORMAT_PCM;
+ wavfmt.nChannels = 2;
+ wavfmt.nSamplesPerSec = 44100;
+ wavfmt.wBitsPerSample = 16;
+ wavfmt.nBlockAlign = wavfmt.wBitsPerSample / 8 * wavfmt.nChannels;
+ wavfmt.nAvgBytesPerSec = wavfmt.nBlockAlign * wavfmt.nSamplesPerSec;
+ wavfmt.cbSize = 0;
+
+ hr = DirectSoundCaptureCreate (NULL, &lpDS2r, NULL);
+ if (FAILED (hr)) {
+ write_log (L"SAMPLER: DirectSoundCaptureCreate() failure: %s\n", DXError (hr));
+ return 0;
+ }
+ memset (&sound_buffer_rec, 0, sizeof (DSCBUFFERDESC));
+ sound_buffer_rec.dwSize = sizeof (DSCBUFFERDESC);
+ sound_buffer_rec.dwBufferBytes = RECORDBUFFER;
+ sound_buffer_rec.lpwfxFormat = &wavfmt;
+ sound_buffer_rec.dwFlags = 0 ;
+
+ hr = IDirectSoundCapture_CreateCaptureBuffer (lpDS2r, &sound_buffer_rec, &lpDSB2r, NULL);
+ if (FAILED (hr)) {
+ write_log (L"SAMPLER: CreateCaptureSoundBuffer() failure: %s\n", DXError(hr));
+ return 0;
+ }
+
+ hr = IDirectSoundCaptureBuffer_Start (lpDSB2r, DSCBSTART_LOOPING);
+ if (FAILED (hr)) {
+ write_log (L"SAMPLER: DirectSoundCaptureBuffer_Start failed: %s\n", DXError (hr));
+ return 0;
+ }
+ samplebuffer = xcalloc (SAMPLEBUFFER, 1);
+ write_log (L"SAMPLER: Parallel port sampler initialized\n");
+ return 1;
+}
+
+static void capture_free (void)
+{
+ if (lpDSB2r)
+ IDirectSoundCaptureBuffer_Release (lpDSB2r);
+ lpDSB2r = NULL;
+ if (lpDS2r)
+ IDirectSound_Release (lpDS2r);
+ lpDS2r = NULL;
+ xfree (samplebuffer);
+ samplebuffer = NULL;
+}
+
+static evt oldcycles;
+
+uae_u8 sampler_getsample (void)
+{
+ HRESULT hr;
+ DWORD t, cur_pos, cap_pos;
+ void *p1, *p2;
+ DWORD len1, len2;
+ evt cycles;
+ int offset;
+
+ if (!inited) {
+ if (!capture_init ())
+ return 0;
+ inited = 1;
+ }
+ cycles = get_cycles ();
+ offset = (cycles - oldcycles) / CYCLE_UNIT;
+ if (offset >= SAMPLEBUFFER || offset < 0) {
+ oldcycles = cycles;
+ offset = 0;
+ cap_pos = 0;
+ hr = IDirectSoundCaptureBuffer_GetCurrentPosition (lpDSB2r, &t, &cur_pos);
+ if (FAILED (hr))
+ return 0;
+ hr = IDirectSoundCaptureBuffer_Lock (lpDSB2r, cap_pos, SAMPLEBUFFER, &p1, &len1, &p2, &len2, 0);
+ if (FAILED (hr))
+ return 0;
+ memcpy (samplebuffer, p1, len1);
+ if (p2)
+ memcpy (samplebuffer + len1, p2, len2);
+ IDirectSoundCaptureBuffer_Unlock (lpDSB2r, p1, len1, p2, len2);
+ }
+ return samplebuffer[offset * 4 + 1];
+}
+
+int sampler_init (void)
+{
+ if (!currprefs.parallel_sampler)
+ return 0;
+ return 0;
+}
+
+void sampler_free (void)
+{
+ inited = 0;
+ capture_free ();
+}
+