static struct cd_toc *gettoc (struct cd_toc_head *th, int block)
{
- for (int i = th->first_track_offset; i < th->last_track_offset; i++) {
+ for (int i = th->first_track_offset + 1; i <= th->last_track_offset; i++) {
struct cd_toc *t = &th->toc[i];
- if (block < t->paddress) {
- if (i == th->first_track_offset)
- return t;
- else
- return t - 1;
- }
+ if (block < t->paddress)
+ return t - 1;
}
return &th->toc[th->last_track_offset];
}
goto errreq;
if (format == 1) {
p[0] = 0;
- p[1] = 8;
+ p[1] = 2 + 8;
p[2] = 1;
p[3] = 1;
p[4] = 0;
}
if (!addtocentry (&p2, &maxlen, 0xa2, 0xaa, msf, p, toc))
goto errreq;
- int tlen = p2 - (p + 4);
+ int tlen = p2 - (p + 2);
p[0] = tlen >> 8;
p[1] = tlen >> 0;
- scsi_len = tlen + 4;
+ scsi_len = tlen + 2 + 4;
}
}
break;
dl (datatable);
dl (*sockfuncvecs);
- write_log (_T("bsdsocked.library installed\n"));
+ write_log (_T("bsdsocket.library installed\n"));
}
#endif /* ! BSDSOCKET */
struct mystat st;
int mode, oldmode;
- if (my_stat (name, &st))
+ if (!my_stat (name, &st))
return;
oldmode = mode = st.mode;
mode &= ~FILEFLAG_WRITE;
uaecptr start = resaddr;
uaecptr residents, tmp;
- TRACEI ((_T("filesystem: diagentry called\n")));
+ write_log (_T("filesystem: diagentry called: %x\n"), resaddr);
filesys_configdev = m68k_areg (regs, 3);
init_filesys_diagentry ();
extern int getjoystickstate (int mouse);
void setmousestate (int mouse, int axis, int data, int isabs);
extern int getmousestate (int mouse);
-extern void inputdevice_updateconfig (struct uae_prefs *prefs);
-extern void inputdevice_updateconfig_internal (struct uae_prefs *prefs);
+extern void inputdevice_updateconfig (const struct uae_prefs *srcprefs, struct uae_prefs *dstprefs);
+extern void inputdevice_updateconfig_internal (const struct uae_prefs *srcprefs, struct uae_prefs *dstprefs);
extern void inputdevice_devicechange (struct uae_prefs *prefs);
#define INTERNALEVENT_CPURESET 0
extern int getDivs68kCycles (uae_s32 dividend, uae_s16 divisor);
extern void m68k_do_rte (void);
extern void protect_roms (bool);
+extern void unprotect_maprom (void);
extern void mmu_op (uae_u32, uae_u32);
extern void mmu_op30 (uaecptr, uae_u32, uae_u16, uaecptr);
}
static void copyjport (const struct uae_prefs *src, struct uae_prefs *dst, int num)
{
+ if (!src)
+ return;
freejport (dst, num);
_tcscpy (dst->jports[num].configname, src->jports[num].configname);
_tcscpy (dst->jports[num].name, src->jports[num].name);
case AKS_INPUT_CONFIG_3:
case AKS_INPUT_CONFIG_4:
changed_prefs.input_selected_setting = currprefs.input_selected_setting = code - AKS_INPUT_CONFIG_1;
- inputdevice_updateconfig (&currprefs);
+ inputdevice_updateconfig (&changed_prefs, &currprefs);
break;
case AKS_DISK_PREV0:
case AKS_DISK_PREV1:
currprefs.input_autofire_linecnt = changed_prefs.input_autofire_linecnt;
currprefs.input_mouse_speed = changed_prefs.input_mouse_speed;
- inputdevice_updateconfig (&currprefs);
+ inputdevice_updateconfig (&changed_prefs, &currprefs);
}
if (currprefs.dongle != changed_prefs.dongle) {
currprefs.dongle = changed_prefs.dongle;
}
-void inputdevice_updateconfig_internal (struct uae_prefs *prefs)
+void inputdevice_updateconfig_internal (const struct uae_prefs *srcprrefs, struct uae_prefs *dstprefs)
{
int i;
keyboard_default = keyboard_default_table[currprefs.input_keyboard_type];
- copyjport (&changed_prefs, &currprefs, 0);
- copyjport (&changed_prefs, &currprefs, 1);
- copyjport (&changed_prefs, &currprefs, 2);
- copyjport (&changed_prefs, &currprefs, 3);
+ copyjport (srcprrefs, dstprefs, 0);
+ copyjport (srcprrefs, dstprefs, 1);
+ copyjport (srcprrefs, dstprefs, 2);
+ copyjport (srcprrefs, dstprefs, 3);
resetinput ();
- joysticks = prefs->joystick_settings[prefs->input_selected_setting];
- mice = prefs->mouse_settings[prefs->input_selected_setting];
- keyboards = prefs->keyboard_settings[prefs->input_selected_setting];
- internalevents = prefs->internalevent_settings[prefs->input_selected_setting];
+ joysticks = dstprefs->joystick_settings[dstprefs->input_selected_setting];
+ mice = dstprefs->mouse_settings[dstprefs->input_selected_setting];
+ keyboards = dstprefs->keyboard_settings[dstprefs->input_selected_setting];
+ internalevents = dstprefs->internalevent_settings[dstprefs->input_selected_setting];
- matchdevices_all (prefs);
+ matchdevices_all (dstprefs);
memset (joysticks2, 0, sizeof joysticks2);
memset (mice2, 0, sizeof mice2);
- joysticks = prefs->joystick_settings[GAMEPORT_INPUT_SETTINGS];
- mice = prefs->mouse_settings[GAMEPORT_INPUT_SETTINGS];
- keyboards = prefs->keyboard_settings[GAMEPORT_INPUT_SETTINGS];
- internalevents = prefs->internalevent_settings[GAMEPORT_INPUT_SETTINGS];
+ joysticks = dstprefs->joystick_settings[GAMEPORT_INPUT_SETTINGS];
+ mice = dstprefs->mouse_settings[GAMEPORT_INPUT_SETTINGS];
+ keyboards = dstprefs->keyboard_settings[GAMEPORT_INPUT_SETTINGS];
+ internalevents = dstprefs->internalevent_settings[GAMEPORT_INPUT_SETTINGS];
for (i = 0; i < MAX_INPUT_SETTINGS; i++) {
joysticks[i].enabled = 0;
mice[i].enabled = 0;
}
- compatibility_copy (prefs, true);
- joysticks = prefs->joystick_settings[prefs->input_selected_setting];
- mice = prefs->mouse_settings[prefs->input_selected_setting];
- keyboards = prefs->keyboard_settings[prefs->input_selected_setting];
- internalevents = prefs->internalevent_settings[prefs->input_selected_setting];
+ compatibility_copy (dstprefs, true);
+ joysticks = dstprefs->joystick_settings[dstprefs->input_selected_setting];
+ mice = dstprefs->mouse_settings[dstprefs->input_selected_setting];
+ keyboards = dstprefs->keyboard_settings[dstprefs->input_selected_setting];
+ internalevents = dstprefs->internalevent_settings[dstprefs->input_selected_setting];
- if (prefs->input_selected_setting != GAMEPORT_INPUT_SETTINGS) {
- compatibility_copy (prefs, false);
+ if (dstprefs->input_selected_setting != GAMEPORT_INPUT_SETTINGS) {
+ compatibility_copy (dstprefs, false);
}
- disableifempty (prefs);
- scanevents (prefs);
+ disableifempty (dstprefs);
+ scanevents (dstprefs);
}
-void inputdevice_updateconfig (struct uae_prefs *prefs)
+void inputdevice_updateconfig (const struct uae_prefs *srcprefs, struct uae_prefs *dstprefs)
{
- inputdevice_updateconfig_internal (prefs);
+ inputdevice_updateconfig_internal (srcprefs, dstprefs);
config_changed = 1;
int i, idx;
TCHAR *jports[MAX_JPORTS];
int jportskb[MAX_JPORTS], jportsmode[MAX_JPORTS];
+ int jportid[MAX_JPORTS], jportaf[MAX_JPORTS];
for (i = 0; i < MAX_JPORTS; i++) {
jports[i] = NULL;
jportskb[i] = -1;
+ jportid[i] = prefs->jports[i].id;
+ jportaf[i] = prefs->jports[i].autofire;
idx = inputdevice_getjoyportdevice (i, prefs->jports[i].id);
if (idx >= JSEM_LASTKBD) {
struct inputdevice_functions *idf;
for (i = 0; i < MAX_JPORTS; i++) {
freejport (prefs, i);
- if (jports[i]) {
+ if (jportid[i] == JPORT_CUSTOM) {
+ inputdevice_joyport_config (prefs, _T("custom"), i, jportsmode[i], 0);
+ } else if (jports[i]) {
inputdevice_joyport_config (prefs, jports[i], i, jportsmode[i], 2);
- xfree (jports[i]);
} else if (jportskb[i] >= 0) {
TCHAR tmp[10];
_stprintf (tmp, _T("kbd%d"), jportskb[i]);
inputdevice_joyport_config (prefs, tmp, i, jportsmode[i], 0);
}
+ prefs->jports[i].autofire = jportaf[i];
+ xfree (jports[i]);
}
if (prefs == &changed_prefs)
}
}
- inputdevice_updateconfig (dst);
+ inputdevice_updateconfig (src, dst);
}
static void swapjoydevice (struct uae_input_device *uid, int **swaps)
memcpy (&tmp, &prefs->jports[portswap], sizeof (struct jport));
memcpy (&prefs->jports[portswap], &prefs->jports[portswap + 1], sizeof (struct jport));
memcpy (&prefs->jports[portswap + 1], &tmp, sizeof (struct jport));
- inputdevice_updateconfig (prefs);
+ inputdevice_updateconfig (NULL, prefs);
}
// swap device "devnum" ports 0<>1 and 2<>3
{
struct mystat st;
int mode, oldmode;
- if (my_stat (fname, &st))
+ if (!my_stat (fname, &st))
return;
oldmode = mode = st.mode;
mode &= ~FILEFLAG_WRITE;
void keybuf_init (void)
{
kpb_first = kpb_last = 0;
- inputdevice_updateconfig (&currprefs);
+ inputdevice_updateconfig (&changed_prefs, &currprefs);
}
if (canbang && candirect < 0)
candirect = 1;
/* Do a reset on startup. Whether this is elegant is debatable. */
- inputdevice_updateconfig (&currprefs);
+ inputdevice_updateconfig (&changed_prefs, &currprefs);
if (quit_program >= 0)
quit_program = UAE_RESET;
#if (defined (_WIN32) || defined (_WIN64)) && !defined (NO_WIN32_EXCEPTION_HANDLER)
#endif
#ifdef AUTOCONFIG
expansion_init ();
+ emulib_install ();
+ uaeexe_install ();
#endif
#ifdef FILESYS
filesys_install ();
#endif
+#if defined (BSDSOCKET)
+ bsdlib_install ();
+#endif
}
static int real_main2 (int argc, TCHAR **argv)
memory_reset ();
#ifdef AUTOCONFIG
-#if defined (BSDSOCKET)
- bsdlib_install ();
-#endif
- emulib_install ();
- uaeexe_install ();
native2amiga_install ();
#endif
{
int result = 0;
+ if (bsd)
+ return -1;
deinit_socket_layer ();
if (currprefs.socket_emu) {
if((result = mySockStartup())) {
}
close_selectget_threads ();
WSACleanup();
+ xfree (bsd);
+ bsd = NULL;
}
#ifdef BSDSOCKET
// FILE_FLAG_BACKUP_SEMANTICS = can also "open" directories
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) {
- write_log (_T("Stat CreateFile(%s) failed: %d\n"), name, GetLastError ());
+ if (h == INVALID_HANDLE_VALUE)
return false;
- }
ok = GetFileInformationByHandle (h, &fi);
CloseHandle (h);
void clearallkeys (void)
{
- inputdevice_updateconfig (&currprefs);
+ inputdevice_updateconfig (&changed_prefs, &currprefs);
}
static const int np[] = {
p96mem_offset = NULL;
GetSystemInfo (&si);
- max_allowed_mman = 512;
+ max_allowed_mman = 512 + 256;
+#if 1
if (os_64bit) {
#ifdef WIN64
max_allowed_mman = 3072;
max_allowed_mman = 2048;
#endif
}
+#endif
memstats.dwLength = sizeof(memstats);
GlobalMemoryStatus(&memstats);
size64 = 8 * 1024 * 1024;
if (max_allowed_mman * 1024 * 1024 > size64)
max_allowed_mman = size64 / (1024 * 1024);
+ if (!os_64bit) {
+ if (max_allowed_mman * 1024 * 1024 > (size64 / 2))
+ max_allowed_mman = (size64 / 2) / (1024 * 1024);
+ }
natmem_size = (max_allowed_mman + 1) * 1024 * 1024;
if (natmem_size < 256 * 1024 * 1024)
write_log (_T("Total physical RAM %lluM. Attempting to reserve: %uM.\n"), totalphys64 >> 20, natmem_size >> 20);
natmem_offset = 0;
- if (natmem_size <= 640 * 1024 * 1024) {
+ if (natmem_size <= 768 * 1024 * 1024) {
uae_u32 p = 0x78000000 - natmem_size;
for (;;) {
natmem_offset = (uae_u8*)VirtualAlloc ((void*)p, natmem_size, MEM_RESERVE | (VAMODE == 1 ? MEM_WRITE_WATCH : 0), PAGE_READWRITE);
if (natmem_offset)
break;
- p -= 256 * 1024 * 1024;
- if (p <= 256 * 1024 * 1024)
+ p -= 128 * 1024 * 1024;
+ if (p <= 128 * 1024 * 1024)
break;
}
}
uae_u32 size, totalsize, z3size, natmemsize;
uae_u32 rtgbarrier, z3chipbarrier, rtgextra;
int rounds = 0;
- ULONG z3rtgmem_size = changed_prefs.rtgmem_type ? changed_prefs.rtgmem_size : 0;
+ ULONG z3rtgmem_size;
for (;;) {
int lowround = 0;
rtgextra = 0;
z3chipbarrier = 0;
rtgbarrier = si.dwPageSize;
+ z3rtgmem_size = changed_prefs.rtgmem_type ? changed_prefs.rtgmem_size : 0;
if (changed_prefs.cpu_model >= 68020)
size = 0x10000000;
if (changed_prefs.z3fastmem_size || changed_prefs.z3fastmem2_size || changed_prefs.z3chipmem_size) {
void *shmat (int shmid, void *shmaddr, int shmflg)
{
void *result = (void *)-1;
- BOOL got = FALSE, readonly = FALSE;
+ BOOL got = FALSE, readonly = FALSE, maprom = FALSE;
int p96special = FALSE;
#ifdef NATMEM_OFFSET
got = TRUE;
size += BARRIER;
readonly = TRUE;
+ maprom = TRUE;
} else if(!_tcscmp (shmids[shmid].name, _T("rom_a8"))) {
shmaddr=natmem_offset + 0xa80000;
got = TRUE;
readonly = TRUE;
+ maprom = TRUE;
} else if(!_tcscmp (shmids[shmid].name, _T("rom_e0"))) {
shmaddr=natmem_offset + 0xe00000;
got = TRUE;
readonly = TRUE;
+ maprom = TRUE;
} else if(!_tcscmp (shmids[shmid].name, _T("rom_f0"))) {
shmaddr=natmem_offset + 0xf00000;
got = TRUE;
shmids[shmid].mode = protect;
shmids[shmid].rosize = readonlysize;
shmids[shmid].natmembase = natmem_offset;
+ shmids[shmid].maprom = maprom ? 1 : 0;
if (shmaddr)
virtualfreewithlock (shmaddr, size, MEM_DECOMMIT);
result = virtualallocwithlock (shmaddr, size, MEM_COMMIT, PAGE_READWRITE);
return result;
}
+void unprotect_maprom (void)
+{
+ bool protect = false;
+ for (int i = 0; i < MAX_SHMID; i++) {
+ DWORD old;
+ struct shmid_ds *shm = &shmids[i];
+ if (shm->mode != PAGE_READONLY)
+ continue;
+ if (!shm->attached || !shm->rosize)
+ continue;
+ if (shm->maprom <= 0)
+ continue;
+ shm->maprom = -1;
+ if (!VirtualProtect (shm->attached, shm->rosize, protect ? PAGE_READONLY : PAGE_READWRITE, &old)) {
+ write_log (_T("VP %08X - %08X %x (%dk) failed %d\n"),
+ (uae_u8*)shm->attached - natmem_offset, (uae_u8*)shm->attached - natmem_offset + shm->size,
+ shm->size, shm->size >> 10, GetLastError ());
+ }
+ }
+}
+
void protect_roms (bool protect)
{
- struct shmid_ds *shm;
-
if (protect) {
// protect only if JIT enabled, always allow unprotect
if (!currprefs.cachesize || currprefs.comptrustbyte || currprefs.comptrustword || currprefs.comptrustlong)
}
for (int i = 0; i < MAX_SHMID; i++) {
DWORD old;
- shm = &shmids[i];
+ struct shmid_ds *shm = &shmids[i];
if (shm->mode != PAGE_READONLY)
continue;
if (!shm->attached || !shm->rosize)
continue;
+ if (shm->maprom < 0 && protect)
+ continue;
if (!VirtualProtect (shm->attached, shm->rosize, protect ? PAGE_READONLY : PAGE_READWRITE, &old)) {
write_log (_T("VP %08X - %08X %x (%dk) failed %d\n"),
(uae_u8*)shm->attached - natmem_offset, (uae_u8*)shm->attached - natmem_offset + shm->size,
\r
IDD_IOPORTS, DIALOG\r
BEGIN\r
- BOTTOMMARGIN, 275\r
+ BOTTOMMARGIN, 293\r
END\r
\r
IDD_GAMEPORTS, DIALOG\r
kb = inputdevice_get_device_total (IDTYPE_JOYSTICK) + inputdevice_get_device_total (IDTYPE_MOUSE);
- inputdevice_updateconfig_internal (&changed_prefs);
+ inputdevice_updateconfig_internal (NULL, &changed_prefs);
inputdevice_compa_prepare_custom (&changed_prefs, inputmap_port, devicetype);
- inputdevice_updateconfig_internal (&changed_prefs);
+ inputdevice_updateconfig_internal (NULL, &changed_prefs);
max = inputdevice_get_compatibility_input (&changed_prefs, inputmap_port, &mode, &events, &axistable);
write_log (_T("custom='%s' max=%d port=%d dt=%d kb=%d kbnum=%d\n"), custom, max, inputmap_port, devicetype, kb, inputdevice_get_device_total (IDTYPE_KEYBOARD));
if (!max)
}
}
- inputdevice_updateconfig_internal (&changed_prefs);
- inputdevice_updateconfig (&currprefs);
+ inputdevice_updateconfig_internal (NULL, &changed_prefs);
+ inputdevice_updateconfig (NULL, &currprefs);
return TRUE;
}
case RP_DEVICECATEGORY_INPUTPORT:
ok = port_insert (num, dc->dwInputDevice, dc->dwFlags, n);
if (ok)
- inputdevice_updateconfig (&currprefs);
+ inputdevice_updateconfig (&changed_prefs, &currprefs);
break;
case RP_DEVICECATEGORY_CD:
ok = cd_insert (num, n);
num = enumerate_sound_devices ();
if (currprefs.win32_soundcard >= num)
currprefs.win32_soundcard = changed_prefs.win32_soundcard = 0;
+ if (num == 0)
+ return 0;
ch = get_audio_nativechannels (currprefs.sound_stereo);
ret = open_sound_device (sdp, currprefs.win32_soundcard, size, currprefs.sound_freq, ch);
if (!ret)
copy winuaesrc.zip d:\amiga\winuaepackets\winuaesrc%1.zip
move winuaesrc.zip d:\amiga
cd c:\projects\winuae\src\od-win32
-zip -9 winuaedebug%1 winuae_msvc11\release\winuae.pdb winuae_msvc11\fullrelease\winuae.pdb
+zip -9 winuaedebug%1 winuae_msvc10\release\winuae.pdb winuae_msvc10\fullrelease\winuae.pdb
move winuaedebug%1.zip d:\amiga\winuaepackets\debug\
-copy winuae_msvc11\fullrelease\winuae.pdb d:\amiga\dump
+copy winuae_msvc10\fullrelease\winuae.pdb d:\amiga\dump
copy d:\amiga\winuae.exe d:\amiga\dump
int mode;
void *natmembase;
bool fake;
+ int maprom;
};
int mprotect (void *addr, size_t len, int prot);
HWND (WINAPI *pHtmlHelp)(HWND, LPCWSTR, UINT, LPDWORD) = NULL;
HWND hAmigaWnd, hMainWnd, hHiddenWnd, hGUIWnd;
RECT amigawin_rect, mainwin_rect;
+int setcursoroffset_x, setcursoroffset_y;
static int mouseposx, mouseposy;
static UINT TaskbarRestart;
static HWND TaskbarRestartHWND;
static void setcursor (int oldx, int oldy)
{
- int x = (amigawin_rect.right - amigawin_rect.left) / 2;
- int y = (amigawin_rect.bottom - amigawin_rect.top) / 2;
+ int x = abs (amigawin_rect.right - amigawin_rect.left) / 2;
+ int y = abs (amigawin_rect.bottom - amigawin_rect.top) / 2;
mouseposx = oldx - x;
mouseposy = oldy - y;
return;
}
#if 0
- write_log (_T("%d %d %d %d %d - %d %d %d %d %d\n"),
- x, amigawin_rect.left, amigawin_rect.right, mouseposx, oldx,
- y, amigawin_rect.top, amigawin_rect.bottom, mouseposy, oldy);
+ write_log (_T("%dx%d %dx%d %dx%d (%dx%d %dx%d)\n"),
+ x, y,
+ mouseposx, mouseposy, oldx, oldy,
+ amigawin_rect.left, amigawin_rect.top,
+ amigawin_rect.right, amigawin_rect.bottom);
#endif
if (oldx >= 30000 || oldy >= 30000 || oldx <= -30000 || oldy <= -30000) {
mouseposx = mouseposy = 0;
amigawin_rect.left, amigawin_rect.top, amigawin_rect.right, amigawin_rect.bottom);
return;
}
- SetCursorPos (amigawin_rect.left + x, amigawin_rect.top + y);
+ int cx = amigawin_rect.left + x;
+ int cy = amigawin_rect.top + y;
+ //write_log (_T("SetCursorPos(%d,%d)\n"), cx, cy);
+ SetCursorPos (cx, cy);
}
static int pausemouseactive;
{
if (showcursor) {
ClipCursor (&amigawin_rect);
- write_log (_T("CLIP %dx%d %dx%d\n"), amigawin_rect.left, amigawin_rect.top, amigawin_rect.right, amigawin_rect.bottom);
+ write_log (_T("CLIP %dx%d %dx%d %d\n"), amigawin_rect.left, amigawin_rect.top, amigawin_rect.right, amigawin_rect.bottom, isfullscreen ());
}
}
-void updatewinrect (void)
+void updatewinrect (bool allowfullscreen)
{
+ int f = isfullscreen ();
+ if (!allowfullscreen && f > 0)
+ return;
GetWindowRect (hAmigaWnd, &amigawin_rect);
- if (isfullscreen () == 0) {
+ write_log (_T("GetWindowRect %dx%d %dx%d %d\n"), amigawin_rect.left, amigawin_rect.top, amigawin_rect.right, amigawin_rect.bottom, f);
+ if (f == 0) {
changed_prefs.gfx_size_win.x = amigawin_rect.left;
changed_prefs.gfx_size_win.y = amigawin_rect.top;
currprefs.gfx_size_win.x = changed_prefs.gfx_size_win.x;
if (!showcursor) {
ShowCursor (FALSE);
SetCapture (hAmigaWnd);
- updatewinrect ();
+ updatewinrect (false);
showcursor = 1;
updatemouseclip ();
}
WINDOWPOS *wp = (WINDOWPOS*)lParam;
if (isfullscreen () <= 0) {
if (!IsIconic (hWnd) && hWnd == hAmigaWnd) {
- updatewinrect ();
+ updatewinrect (false);
config_changed = 1;
updatemouseclip ();
}
mx = (signed short) LOWORD (lParam);
my = (signed short) HIWORD (lParam);
+ //write_log (_T("%d %d %d %d %d %d %dx%d %dx%d\n"), wm, mouseactive, focus, showcursor, recapture, isfullscreen (), mx, my, mouseposx, mouseposy);
mx -= mouseposx;
my -= mouseposy;
- //write_log (_T("%d %d %d %d %d %d %dx%d %dx%d\n"), wm, mouseactive, focus, showcursor, recapture, isfullscreen (), mx, my, mouseposx, mouseposy);
if (recapture && isfullscreen () <= 0) {
enablecapture ();
return 0;
TranslateMessage (&msg);
DispatchMessage (&msg);
}
- sleep_millis (20);
+ sleep_millis (100);
inputdevicefunc_keyboard.read ();
inputdevicefunc_mouse.read ();
inputdevicefunc_joystick.read ();
while (checkIPC (globalipc, &currprefs));
#endif
if (was_paused) {
+ updatedisplayarea ();
+ manual_painting_needed--;
pause_emulation = was_paused;
+ setmouseactive (0);
resumepaused (was_paused);
sound_closed = 0;
- manual_painting_needed--;
}
cnt1--;
if (cnt1 <= 0) {
}
}
#endif
-#ifndef _DEBUG
+//#ifndef _DEBUG
if (lRet == EXCEPTION_CONTINUE_SEARCH) {
TCHAR path[MAX_DPATH];
TCHAR path2[MAX_DPATH];
__time64_t now;
if (os_winnt && GetModuleFileName (NULL, path, MAX_DPATH)) {
+ TCHAR dumpfilename[100];
TCHAR beta[100];
+ TCHAR path3[MAX_DPATH];
TCHAR *slash = _tcsrchr (path, '\\');
_time64 (&now);
when = *_localtime64 (&now);
p = slash + 1;
else
p = path2;
+ p[0] = 0;
beta[0] = 0;
if (WINUAEPUBLICBETA > 0)
_stprintf (beta, _T("b%s"), WINUAEBETA);
- _stprintf (p, _T("winuae_%d%d%d%s_%d%02d%02d_%02d%02d%02d.dmp"),
+ _stprintf (dumpfilename, _T("winuae_%d%d%d%s_%d%02d%02d_%02d%02d%02d.dmp"),
UAEMAJOR, UAEMINOR, UAESUBREV, beta,
when.tm_year + 1900, when.tm_mon + 1, when.tm_mday, when.tm_hour, when.tm_min, when.tm_sec);
if (dll == NULL)
if (dll) {
MINIDUMPWRITEDUMP dump = (MINIDUMPWRITEDUMP)GetProcAddress (dll, "MiniDumpWriteDump");
if (dump) {
- HANDLE f = CreateFile (path2, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ _tcscpy (path3, path2);
+ _tcscat (path3, dumpfilename);
+ HANDLE f = CreateFile (path3, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ if (f == INVALID_HANDLE_VALUE) {
+ _tcscpy (path3, start_path_data);
+ _tcscat (path3, dumpfilename);
+ f = CreateFile (path3, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ }
+ if (f == INVALID_HANDLE_VALUE) {
+ if (GetTempPath (MAX_DPATH, path3) > 0) {
+ _tcscat (path3, dumpfilename);
+ f = CreateFile (path3, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ }
+ }
if (f != INVALID_HANDLE_VALUE) {
flush_log ();
savedump (dump, f, pExceptionPointers);
CloseHandle (f);
if (isfullscreen () <= 0) {
- _stprintf (msg, _T("Crash detected. MiniDump saved as:\n%s\n"), path2);
+ _stprintf (msg, _T("Crash detected. MiniDump saved as:\n%s\n"), path3);
MessageBox (NULL, msg, _T("Crash"), MB_OK | MB_ICONWARNING | MB_TASKMODAL | MB_SETFOREGROUND);
}
}
}
}
}
-#endif
+//#endif
#if 0
HMODULE hFaultRepDll = LoadLibrary (_T("FaultRep.dll")) ;
if (hFaultRepDll) {
#define LANG_DLL 1
//#define WINUAEBETA _T("")
-#define WINUAEBETA _T("2")
-#define WINUAEDATE MAKEBD(2012, 12, 12)
+#define WINUAEBETA _T("4")
+#define WINUAEDATE MAKEBD(2012, 12, 18)
#define WINUAEEXTRA _T("")
//#define WINUAEEXTRA _T("AmiKit Preview")
#define WINUAEREV _T("")
extern void minimizewindow (void);
extern uae_u32 OSDEP_minimize_uae (void);
extern void updatemouseclip (void);
-extern void updatewinrect (void);
+extern void updatewinrect (bool);
extern void resumepaused (int priority);
extern void setpaused (int priority);
goto oops;
return -1;
}
- GetWindowRect (hAmigaWnd, &amigawin_rect);
+ updatewinrect (true);
}
if (dd) {
void flush_clear_screen (struct vidbuffer *vb)
{
+ struct vidbuffer vb2 = { 0 };
+
+ if (!vb)
+ vb = &vb2;
if (lockscr (vb, true)) {
int y;
for (y = 0; y < vb->height_allocated; y++) {
}
-static int open_windows (bool full)
+static int open_windows (bool mousecapture)
{
static bool started = false;
int ret, i;
bool startpaused = !started && ((currprefs.win32_start_minimized && currprefs.win32_iconified_pause) || (currprefs.win32_start_uncaptured && currprefs.win32_inactive_pause && isfullscreen () <= 0));
bool startminimized = !started && currprefs.win32_start_minimized && isfullscreen () <= 0;
- if (!rp_isactive () && full && startactive)
+ if (!rp_isactive () && mousecapture && startactive)
setmouseactive (-1);
if (startactive) {
static void reopen_gfx (void)
{
- open_windows (0);
+ open_windows (false);
if (isvsync () < 0)
vblank_calibrate (0, false);
unacquired = true;
}
close_windows ();
- graphics_init (false);
+ graphics_init (dontcapture ? false : true);
graphics_mode_changed = 1;
}
init_custom ();
static void open_screen (void)
{
close_windows ();
- open_windows (1);
+ open_windows (true);
}
static int ifs (struct uae_prefs *p)
goto end;
}
if (mode < 0) {
- open_windows (0);
+ open_windows (true);
} else {
open_screen (); // reopen everything
}
if (need > 0) {
open_screen ();
} else if (need < 0) {
- open_windows (0);
+ open_windows (true);
}
#ifdef RETROPLATFORM
rp_set_hwnd (hAmigaWnd);
#endif
}
-int graphics_init (bool first)
+int graphics_init (bool mousecapture)
{
systray (hHiddenWnd, TRUE);
systray (hHiddenWnd, FALSE);
gfxmode_reset ();
graphics_mode_changed = 1;
- return open_windows (first);
+ return open_windows (mousecapture);
}
int graphics_setup (void)
return -1;
}
+static void movecursor (int x, int y)
+{
+ write_log (_T("SetCursorPos %dx%d\n"), x, y);
+ SetCursorPos (x, y);
+}
+
static int create_windows_2 (void)
{
static bool firstwindow = true;
y = ny;
}
createstatuswindow ();
- updatewinrect ();
+ updatewinrect (false);
GetWindowRect (hMainWnd, &mainwin_rect);
if (d3dfs || dxfs)
- SetCursorPos (x + w / 2, y + h / 2);
+ movecursor (x + w / 2, y + h / 2);
write_log (_T("window already open (%dx%d %dx%d)\n"),
amigawin_rect.left, amigawin_rect.top, amigawin_rect.right - amigawin_rect.left, amigawin_rect.bottom - amigawin_rect.top);
updatemouseclip ();
hMainWnd = hAmigaWnd;
}
- updatewinrect ();
+ updatewinrect (true);
GetWindowRect (hMainWnd, &mainwin_rect);
if (dxfs || d3dfs)
- SetCursorPos (x + w / 2, y + h / 2);
+ movecursor (x + w / 2, y + h / 2);
addnotifications (hAmigaWnd, FALSE, FALSE);
createblankwindows ();
goto oops;
}
target_graphics_buffer_update ();
+ updatewinrect (true);
}
screen_is_initialized = 1;
return;
if (dx_islost ())
return;
- if (picasso_on)
- return;
#if defined (GFXFILTER)
if (currentmode->flags & DM_D3D) {
#if defined (D3D)
#endif
if (currentmode->flags & DM_DDRAW) {
#if defined (GFXFILTER)
- if (currentmode->flags & DM_SWSCALE)
- S2X_refresh ();
+ if (!picasso_on) {
+ if (currentmode->flags & DM_SWSCALE)
+ S2X_refresh ();
+ }
#endif
DirectDraw_Flip (0);
}
ConfigToRegistry (config, configtypepanel);
InitializeConfig (hDlg, config);
if (full_property_sheet) {
- inputdevice_updateconfig (&workprefs);
+ inputdevice_updateconfig (NULL, &workprefs);
} else {
uae_restart (-1, *pcfgfile);
exit_gui(1);
ConfigToRegistry (config, configtypepanel);
InitializeConfig (hDlg, config);
if (full_property_sheet) {
- inputdevice_updateconfig (&workprefs);
+ inputdevice_updateconfig (NULL, &workprefs);
} else {
uae_restart (-1, *pcfgfile);
exit_gui(1);
CheckDlgButton (hDlg, IDC_NOUAEFSDB, workprefs.filesys_no_uaefsdb);
CheckDlgButton (hDlg, IDC_NORECYCLEBIN, workprefs.win32_norecyclebin);
CheckDlgButton (hDlg, IDC_MAPDRIVES_LIMIT, workprefs.filesys_limit != 0);
+ InitializeListView (hDlg);
+ setautocomplete (hDlg, IDC_CD_TEXT);
addfloppyhistory_2 (hDlg, 0, IDC_CD_TEXT, HISTORY_CD);
addcdtype (hDlg, IDC_CD_TYPE);
- InitializeListView (hDlg);
hilitehd (hDlg);
break;
values_from_gameportsdlg (hDlg, 0);
enable_for_gameportsdlg (hDlg);
updatejoyport (hDlg);
- inputdevice_updateconfig (&workprefs);
+ inputdevice_updateconfig (NULL, &workprefs);
inputdevice_config_change ();
}
SendDlgItemMessage (hDlg, id, CB_ADDSTRING, 0, (LPARAM)tmp);
}
- inputdevice_updateconfig (&workprefs);
+ inputdevice_updateconfig (NULL, &workprefs);
enable_for_gameportsdlg (hDlg);
updatejoyport (hDlg);
recursive--;
pages[IOPORTS_ID] = hDlg;
currentpage = IOPORTS_ID;
init_portsdlg (hDlg);
- inputdevice_updateconfig (&workprefs);
+ inputdevice_updateconfig (NULL, &workprefs);
enable_for_portsdlg (hDlg);
values_to_portsdlg (hDlg);
recursive--;
case IDC_MIDIINLIST:
case IDC_DONGLELIST:
values_from_portsdlg (hDlg);
- inputdevice_updateconfig (&workprefs);
+ inputdevice_updateconfig (NULL, &workprefs);
inputdevice_config_change ();
enable_for_portsdlg (hDlg);
break;
if (item != workprefs.input_selected_setting) {
workprefs.input_selected_setting = (int)item;
input_selected_widget = -1;
- inputdevice_updateconfig (&workprefs);
+ inputdevice_updateconfig (NULL, &workprefs);
enable_for_inputdlg (hDlg);
InitializeListView (hDlg);
doselect = 1;
eventnames[input_selected_event], _tcslen (custom) == 0 ? NULL : custom,
flags, -1, input_selected_sub_num);
update_listview_input (hDlg);
- inputdevice_updateconfig (&workprefs);
+ inputdevice_updateconfig (NULL, &workprefs);
}
}
{
pages[INPUTMAP_ID] = hDlg;
currentpage = INPUTMAP_ID;
- inputdevice_updateconfig (&workprefs);
+ inputdevice_updateconfig (NULL, &workprefs);
if (inputmap_remap_counter == 0) {
inputdevice_compa_prepare_custom (&workprefs, inputmap_port, -1);
- inputdevice_updateconfig (&workprefs);
+ inputdevice_updateconfig (NULL, &workprefs);
}
InitializeListView (hDlg);
HWND h = GetDlgItem (hDlg, IDC_INPUTMAPLIST);
recursive++;
pages[INPUT_ID] = hDlg;
currentpage = INPUT_ID;
- inputdevice_updateconfig (&workprefs);
+ inputdevice_updateconfig (NULL, &workprefs);
inputdevice_config_change ();
input_selected_widget = -1;
init_inputdlg (hDlg);
-1,
IDD_DISPLAY, IDC_DISPLAYSELECT,
-1,
- IDD_FILTER, IDC_FILTERPRESETS,
+ IDD_FILTER, IDC_FILTERMODE, IDC_FILTEROVERLAY, IDC_FILTERPRESETS,
-1,
- IDD_HARDDISK, IDC_VOLUMELIST,
+ IDD_HARDDISK, IDC_VOLUMELIST, IDC_CD_TEXT,
-1,
IDD_INPUT, IDC_INPUTDEVICE, IDC_INPUTLIST, IDC_INPUTAMIGA,
-1,
-1,
IDD_LOADSAVE, IDC_CONFIGTREE, IDC_EDITNAME, IDC_EDITDESCRIPTION, IDC_CONFIGLINK, IDC_EDITPATH,
-1,
- IDD_MISC1, IDC_LANGUAGE,
+ IDD_MISC1, IDC_LANGUAGE, IDC_STATENAME,
-1,
- IDD_PATHS, IDC_PATHS_ROM, IDC_PATHS_CONFIG, IDC_PATHS_SCREENSHOT, IDC_PATHS_SAVESTATE, IDC_PATHS_AVIOUTPUT, IDC_PATHS_SAVEIMAGE, IDC_PATHS_RIP,
+ IDD_PATHS, IDC_PATHS_ROM, IDC_PATHS_CONFIG, IDC_PATHS_SCREENSHOT, IDC_PATHS_SAVESTATE, IDC_PATHS_AVIOUTPUT, IDC_PATHS_SAVEIMAGE, IDC_PATHS_RIP, IDC_LOGPATH,
-1,
- IDD_IOPORTS, IDC_PRINTERLIST, IDC_SAMPLERLIST, IDC_PS_PARAMS, IDC_SERIAL, IDC_MIDIOUTLIST, IDC_MIDIINLIST,
+ IDD_IOPORTS, IDC_PRINTERLIST, IDC_SAMPLERLIST, IDC_PS_PARAMS, IDC_SERIAL, IDC_MIDIOUTLIST, IDC_MIDIINLIST, IDC_DONGLELIST,
-1,
IDD_SOUND, IDC_SOUNDCARDLIST, IDC_SOUNDDRIVESELECT,
-1,
+ IDD_EXPANSION, IDC_RTG_DISPLAYSELECT,
+ -1,
+ IDD_GAMEPORTS, IDC_PORT0_JOYS, IDC_PORT1_JOYS, IDC_PORT2_JOYS, IDC_PORT3_JOYS,
+ -1,
0
};
{
if (filesys_insert (-1, NULL, root, 0, 0) == 0)
return filesys_media_change (root, 2, NULL);
- return 1;
+ return 0;
}
int dragdrop (HWND hDlg, HDROP hd, struct uae_prefs *prefs, int currentpage)
if (drvdrag) {
type = ZFILE_DISKIMAGE;
- } else if (zip || harddrive) {
- do_filesys_insert (file);
- continue;
+ } else if ((zip || harddrive) && type != ZFILE_DISKIMAGE) {
+ if (do_filesys_insert (file))
+ continue;
+ if (zip) {
+ struct zfile *z2 = zfile_fopen (file, _T("rb"), mask);
+ if (z2) {
+ type = zfile_gettype (z2);
+ zfile_fclose (z2);
+ }
+ }
}
switch (type)
case ZFILE_CONFIGURATION:
if (target_cfgfile_load (&workprefs, file, 0, 0)) {
if (full_property_sheet) {
- inputdevice_updateconfig (&workprefs);
+ inputdevice_updateconfig (NULL, &workprefs);
if (!workprefs.start_gui)
ret = 1;
} else {
int ret;
read_rom_list ();
- inputdevice_updateconfig (&workprefs);
+ inputdevice_updateconfig (NULL, &workprefs);
for (;;) {
ret = GetSettings (1, currprefs.win32_notaskbarbutton ? hHiddenWnd : NULL);
if (!restart_requested)
This is usual quick 2.5.0 bug fix version. Estimated release date: before Christmas.
I try not to do any GUI changes this time, 2.5.0 translation DLLs should still work with 2.5.1.
+Beta 4:
+
+- Floppy read/write checkboxes didn't work (b1 filesystem update)
+- Writing to Maprom region crashed in JIT mode, ROM protection introduced in 25b6 is now disabled when maprom address is queried for the first time.
+- Inserting or ejecting USB game controller removed all Game Ports panel custom mappings. (older bug)
+- Only attempt to mount dragged zip as a harddrive if harddrive emulation is enabled, if no harddrives, attempt to insert as a disk image in DF0:.
+- Some mouse tweaks when fullscreen mode on secondary monitor positioned on left side of primary monitor (negative coordinates).
+- Harddrives panel CD file selection box file name was truncated if path contained "][" string.
+- uaeexe_server UAE boot ROM hook was set even if uae boot rom was disabled (Does something use this hook? seems ancient..)
+ This corrupted part of CDTV extended ROM in b2 and 2.5.0 versions. (b3 initialization order change partially fixed it)
+
+Beta 3:
+
+- bsdsocket was initialized too early, didn't configure if memory config changed due to not enough physical memory etc.. (old bug)
+- 32-bit Windows memory reservation limit was too small, some old configs had more memory available under 2.4.x and older versions (2.5)
+- Crash dump file is written to data path or TEMP if winuae.exe directory is write protected.
+- Do not crash if sound is enabled and number of sound output devices is zero.
+- Archive directory filesystem crash fixed (b1)
+- SCSI emulation READ commands returned data from wrong track (following track if CD had more than 1 tracks). Argh.
+- Back to MSVC 2010, 2012 seems to have some optimization and XP compatibility issues to solve, later..
+
Beta 2:
- Resuming pause with input event didn't restore sound. (b1)
{
uaecptr loop;
+ if (!uae_boot_rom)
+ return;
loop = here ();
org (UAEEXE_ORG);
calltrap (deftrapres (uaeexe_server, 0, _T("uaeexe_server")));
case 70: return 0; /* RESERVED. Something uses this.. */
- case 80: return currprefs.maprom ? currprefs.maprom : 0xffffffff;
+ case 80:
+ if (!currprefs.maprom)
+ return 0xffffffff;
+ /* Disable possible ROM protection */
+ unprotect_maprom ();
+ return currprefs.maprom;
case 81: return cfgfile_uaelib (ARG1, ARG2, ARG3, ARG4);
case 82: return cfgfile_uaelib_modify (ARG1, ARG2, ARG3, ARG4, ARG5);
case 83: currprefs.mmkeyboard = ARG1 ? 1 : 0; return currprefs.mmkeyboard;
struct zvolume *zv = get_zvolume (path);
struct znode *zn = get_znode (zv, path, TRUE);
- memset (s, 0, sizeof (struct _stat64));
+ memset (s, 0, sizeof (struct mystat));
if (!zn)
return 0;
s->size = zn->size;