void catweasel_hsync (void)
{
- int x, y, i;
+ int i;
+ uae_u8 x, y;
if (cwc.type < CATWEASEL_TYPE_MK3)
return;
return;
cwhsync = 10;
if (handshake) {
+ /* keyboard handshake */
catweasel_do_bput (0xd0, 0);
handshake = 0;
}
+ if (cwc.type < CATWEASEL_TYPE_MK4)
+ return;
+ /* read MK4 mouse counters */
catweasel_do_bput (3, 0x81);
for (i = 0; i < 2; i++) {
x = catweasel_do_bget (0xc4 + i * 8);
}
model = *((uae_u32*)(buffer + 4));
base = *((uae_u32*)(buffer + 0));
- cwc.type = model == 0 ? 1 : model == 2 ? 4 : 2;
+ cwc.type = model == 0 ? 1 : model == 2 ? 4 : 3;
cwc.iobase = base;
- write_log ("Catweasel MK%d @%p (%s) detected and enabled\n", cwc.type, cwc.iobase, name);
+ write_log ("Catweasel MK%d @%p (%s) detected and enabled\n",
+ cwc.type, cwc.iobase, name);
catweasel_do_bput (3, 0x41); /* enable MK3-mode */
catweasel_init_controller (&cwc);
return 1;
cwc.type = 0;
}
+int catweasel_detect (void)
+{
+ char name[32];
+ int i;
+
+ if (handle != INVALID_HANDLE_VALUE)
+ return TRUE;
+ for (i = 0; i < 4; i++) {
+ sprintf (name, "\\\\.\\CAT%d_F0", i);
+ handle = CreateFile (name, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_WRITE|FILE_SHARE_READ, 0,
+ OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
+ if (handle != INVALID_HANDLE_VALUE)
+ break;
+ }
+ if (handle == INVALID_HANDLE_VALUE)
+ return FALSE;
+ CloseHandle (handle);
+ handle = INVALID_HANDLE_VALUE;
+ return TRUE;
+}
+
#define outb(v,port) catweasel_do_bput(port,v)
#define inb(port) catweasel_do_bget(port)
void default_prefs (struct uae_prefs *p, int type)
{
- int roms[] = { 6, 7, 8, 9, 10, 14, 5, 4, 3, 2, 1 };
+ int roms[] = { 6, 7, 8, 9, 10, 14, 5, 4, 3, 2, 1, -1 };
memset (p, 0, sizeof (*p));
strcpy (p->description, "UAE default configuration");
void uae_abort (const char *format,...)
{
+ static int nomore;
va_list parms;
char buffer[1000];
va_start (parms, format);
_vsnprintf( buffer, sizeof (buffer) -1, format, parms );
va_end (parms);
+ if (nomore) {
+ write_log(buffer);
+ return;
+ }
gui_message (buffer);
- activate_debugger ();
+ nomore = 1;
}
#if 0
{
int nrs[MAX_SPRITES], posns[MAX_SPRITES];
int count, i;
- int point = hpos * 2;
+ /* apparantly writes to custom registers happen in the 3/4th of cycle
+ * and sprite xpos comparator sees it immediately */
+ int point = hpos * 2 - 4;
int width = sprite_width;
int window_width = (width << lores_shift) >> sprres;
vsync_handler ();
}
- DISK_update (maxhpos);
+ DISK_hsync (maxhpos);
#ifdef JIT
if (compiled_code) {
int dskready_time;
int dskready_down_time;
int steplimit;
+ frame_time_t steplimitcycle;
int indexhack, indexhackmode;
int ddhd; /* 1=DD 2=HD */
int drive_id_scnt; /* drive id shift counter */
#endif
} drive;
+#define MIN_STEPLIMIT_CYCLE (CYCLE_UNIT * 150)
+
static uae_u16 bigmfmbufw[0x4000 * DDHDMULT];
static drive floppy[MAX_FLOPPY_DRIVES];
#define MAX_PREVIOUS_FLOPPIES 99
return;
}
#endif
- if (drv->steplimit) {
+ if (drv->steplimit && get_cycles() - drv->steplimitcycle < MIN_STEPLIMIT_CYCLE) {
#ifdef DISK_DEBUG2
- write_dlog (" step ignored");
+ write_dlog (" step ignored %d", (get_cycles() - drv->steplimitcycle) / CYCLE_UNIT);
#endif
return;
}
* but we'll use very small value for better compatibility with faster CPU emulation
* (stupid trackloaders with CPU delay loops)
*/
- drv->steplimit = 2;
+ drv->steplimit = 10;
+ drv->steplimitcycle = get_cycles ();
if (!drive_empty (drv))
drv->dskchange = 0;
if (direction) {
static int linecounter;
-void DISK_update (int tohpos)
+void DISK_hsync (int tohpos)
{
int dr;
- int cycles = (tohpos << 8) - disk_hpos;
- int startcycle = disk_hpos;
-
- disk_jitter = ((rand () >> 4) & 3) + 1;
- if (disk_jitter > 2)
- disk_jitter = 1;
- if (cycles <= 0)
- return;
- disk_hpos += cycles;
- if (disk_hpos >= (maxhpos << 8))
- disk_hpos -= maxhpos << 8;
for (dr = 0; dr < MAX_FLOPPY_DRIVES; dr++) {
drive *drv = &floppy[dr];
disk_dmafinished ();
return;
}
+ DISK_update (tohpos);
+}
+
+void DISK_update (int tohpos)
+{
+ int dr;
+ int cycles = (tohpos << 8) - disk_hpos;
+ int startcycle = disk_hpos;
+
+ disk_jitter = ((rand () >> 4) & 3) + 1;
+ if (disk_jitter > 2)
+ disk_jitter = 1;
+ if (cycles <= 0)
+ return;
+ disk_hpos += cycles;
+ if (disk_hpos >= (maxhpos << 8))
+ disk_hpos -= maxhpos << 8;
#if 0
dodmafetch ();
sprintf (tmp, "filesystem2=%s,%s:%s:%s,%d\n", uip[i].readonly ? "ro" : "rw",
uip[i].devname ? uip[i].devname : "", uip[i].volname, str, uip[i].bootpri);
zfile_fputs (f, tmp);
+ sprintf (tmp, "filesystem=%s,%s:%s\n", uip[i].readonly ? "ro" : "rw",
+ uip[i].volname, str);
+ zfile_fputs (f, tmp);
} else {
sprintf (tmp, "hardfile2=%s,%s:%s,%d,%d,%d,%d,%d,%s\n",
uip[i].readonly ? "ro" : "rw",
uip[i].hf.secspertrack, uip[i].hf.surfaces, uip[i].hf.reservedblocks, uip[i].hf.blocksize,
uip[i].bootpri,uip[i].filesysdir ? uip[i].filesysdir : "");
zfile_fputs (f, tmp);
+ sprintf (tmp, "hardfile=%s,%d,%d,%d,%d,%s\n",
+ uip[i].readonly ? "ro" : "rw", uip[i].hf.secspertrack,
+ uip[i].hf.surfaces, uip[i].hf.reservedblocks, uip[i].hf.blocksize, str);
+ zfile_fputs (f, tmp);
}
xfree (str);
}
extern int catweasel_read_keyboard (uae_u8 *keycode);
extern int catweasel_init (void);
extern void catweasel_free (void);
+extern int catweasel_detect (void);
extern uae_u32 catweasel_do_bget (uaecptr addr);
extern void catweasel_do_bput (uaecptr addr, uae_u32 b);
extern int catweasel_read_joystick (uae_u8 *dir, uae_u8 *buttons);
extern struct zfile *DISK_validate_filename (const char *, int, int *, uae_u32 *);
extern void DISK_handler (void);
extern void DISK_update (int hpos);
+extern void DISK_hsync (int hpos);
extern void DISK_reset (void);
extern int disk_getwriteprotect (const char *name);
extern int disk_setwriteprotect (int num, const char *name, int protect);
static int open_driver (SCSI *scgp)
{
+ char path[MAX_DPATH];
DWORD astatus;
BYTE HACount;
BYTE ASPIStatus;
int i;
+ int nero;
+ HKEY key;
+ DWORD type = REG_SZ;
+ DWORD size = sizeof (path);
/*
* Check if ASPI library is already loaded yet
*/
if (AspiLoaded == TRUE)
return TRUE;
+
+ nero = 0;
+ strcpy (path, "WNASPI32");
+ if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, "SOFTWARE\\Ahead\\shared", 0, KEY_ALL_ACCESS, &key) == ERROR_SUCCESS) {
+ if (RegQueryValueEx (key, "NeroAPI", 0, &type, (LPBYTE)path, &size) == ERROR_SUCCESS) {
+ strcat (path, "\\wnaspi32.dll");
+ RegCloseKey (key);
+ nero = 1;
+ }
+ }
/*
* Load the ASPI library
*/
- hAspiLib = LoadLibrary("WNASPI32");
+ write_log ("ASPI: driver location '%s'\n", path);
+ hAspiLib = LoadLibrary(path);
+ if (hAspiLib == NULL && nero) {
+ write_log ("ASPI: NERO ASPI failed to load, falling back to default\n");
+ hAspiLib = LoadLibrary("WNASPI32");
+ }
+
/*
* Check if ASPI library is loaded correctly
*/
if (DirectDrawState.directdraw.dd && DirectDrawState.modeset)
{
- IDirectDraw7_RestoreDisplayMode( DirectDrawState.directdraw.dd );
IDirectDraw7_SetCooperativeLevel( DirectDrawState.directdraw.dd, hAmigaWnd, DDSCL_NORMAL);
+ IDirectDraw7_RestoreDisplayMode( DirectDrawState.directdraw.dd );
}
DirectDrawState.modeset = 0;
write_log ("NATMEM: Our special area: 0x%x-0x%x\n", natmem_offset, natmem_offset + size);
VirtualFree (blah, 0, MEM_RELEASE);
while (address < (LPBYTE)0xa0000000) {
- address += add * 8;
+ address += add * 32;
if (!os_winnt) /* Windows 9x/ME sucks */
break;
blah = VirtualAlloc (address, size, MEM_RESERVE, PAGE_EXECUTE_READWRITE);
if (blah == NULL) {
- address -= add * 8;
+ address -= add * 32;
break;
}
VirtualFree (blah, 0, MEM_RELEASE);
#define IDS_SOUND_4CHANNEL 242
#define IDS_HF_FS_CUSTOM 243
#define IDS_SELECTFS 244
+#define IDS_KEYJOY 245
#define IDB_XARCADE 246
#define IDS_NUMSG_NEEDEXT2 300
#define IDS_NUMSG_NOROMKEY 301
#define IDC_AVIOUTPUT_FPS 1609
#define IDC_INPUTDEVICE 1609
#define IDC_MAPROM 1609
+#define IDC_NORECYCLEBIN 1609
#define IDC_AVIOUTPUT_FILETEXT 1610
#define IDC_INPUTDEVICETEXT 1610
#define IDC_ALWAYSONTOP 1610
#define IDC_AVIOUTPUT_FILE 1611
#define IDC_INPUTLIST 1611
-#define IDC_CLOCKSYNC2 1611
#define IDC_CATWEASEL 1611
#define IDC_AVIOUTPUT_FPS_STATIC 1612
#define IDC_INPUTAMIGA 1612
HIDC_MAPDRIVES
CONTROL "Disable UAEFSDB-support",IDC_NOUAEFSDB,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,5,229,115,10
+ CONTROL "Don't use Windows Recycle Bin",IDC_NORECYCLEBIN,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,114,216,115,10
END
IDD_SOUND DIALOGEX 0, 0, 300, 244
PUSHBUTTON "Delete",IDC_DELETE,255,225,40,15
END
-IDD_PORTS DIALOGEX 0, 0, 300, 242
+IDD_PORTS DIALOGEX 0, 0, 300, 222
STYLE DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
RTEXT "In:",IDC_MIDI2,150,115,29,15,SS_CENTERIMAGE
COMBOBOX IDC_MIDIINLIST,185,115,95,134,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
- GROUPBOX "Amiga Mouse/Joystick Port 0",IDC_PORT0,4,139,142,97
- CONTROL "",IDC_PORT0_JOYSC,"Button",BS_AUTORADIOBUTTON |
- WS_GROUP | WS_TABSTOP,10,156,9,11
- CONTROL "Keyboard Layout ""A"" []Numeric keypad, 0 and 5 = fire",
- IDC_PORT0_KBDA,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,
- 10,173,90,10
- CONTROL "Keyboard Layout ""B"" []Cursor keys, right CTRL and ALT = fire",
- IDC_PORT0_KBDB,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,
- 10,186,90,10
- CONTROL "Keyboard Layout ""C"" []T = up, B = down, F = left, H = right, left ALT = fire",
- IDC_PORT0_KBDC,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,
- 10,198,90,10
- CONTROL "X-Arcade (left) []#1",IDC_PORT0_KBDD,"Button",
- BS_AUTORADIOBUTTON | WS_TABSTOP,10,210,90,10
- CONTROL "X-Arcade (right) []#1",IDC_PORT0_KBDE,"Button",
- BS_AUTORADIOBUTTON | WS_TABSTOP,10,222,90,10
- COMBOBOX IDC_PORT0_JOYS,23,153,117,130,CBS_DROPDOWNLIST |
+ GROUPBOX "Amiga Mouse/Joystick Ports",IDC_PORT0,4,139,292,77
+ COMBOBOX IDC_PORT0_JOYS,45,155,241,130,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
- GROUPBOX "Amiga Joystick/Mouse Port 1",IDC_PORT1,150,139,146,98
- CONTROL "",IDC_PORT1_JOYSC,"Button",BS_AUTORADIOBUTTON |
- WS_GROUP | WS_TABSTOP,155,156,9,11
- CONTROL "Keyboard Layout ""A"" []Numeric keypad, 0 and 5 = fire",
- IDC_PORT1_KBDA,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,
- 155,173,90,10
- CONTROL "Keyboard Layout ""B"" []Cursor keys, right CTRL and ALT = fire",
- IDC_PORT1_KBDB,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,
- 155,186,90,10
- CONTROL "Keyboard Layout ""C"" []T = up, B = down, F = left, H = right, left ALT = fire",
- IDC_PORT1_KBDC,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,
- 155,198,90,10
- CONTROL "X-Arcade (left) []#1",IDC_PORT1_KBDD,"Button",
- BS_AUTORADIOBUTTON | WS_TABSTOP,155,210,90,10
- CONTROL "X-Arcade (right) []#1",IDC_PORT1_KBDE,"Button",
- BS_AUTORADIOBUTTON | WS_TABSTOP,155,222,90,10
- COMBOBOX IDC_PORT1_JOYS,168,153,123,130,CBS_DROPDOWNLIST |
+ COMBOBOX IDC_PORT1_JOYS,45,176,241,130,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
- PUSHBUTTON "Swap",IDC_SWAP,256,213,33,14
+ PUSHBUTTON "Swap Ports",IDC_SWAP,114,195,75,14
+ RTEXT "Port 0:",IDC_STATIC,11,154,25,15,SS_CENTERIMAGE
+ RTEXT "Port 1:",IDC_STATIC,11,175,25,15,SS_CENTERIMAGE
END
IDD_CONTRIBUTORS DIALOGEX 0, 0, 411, 242
IDS_SOUND_4CHANNEL "4 Channels"
IDS_HF_FS_CUSTOM "Custom"
IDS_SELECTFS "Select filesystem handler (FastFileSystem, SmartFilesystem,...)"
+ IDS_KEYJOY "Keyboard Layout A (Numeric keypad, 0 and 5 = fire)\nKeyboard Layout B (Cursor keys, right CTRL and ALT = fire)\nKeyboard Layout C (T=up B=down F=left H=right, left ALT = fire)\nX-Arcade (Left)\nX-Arcade (Right)"
END
STRINGTABLE
}
init_mmtimer();
- SetThreadPriority ( GetCurrentThread(), THREAD_PRIORITY_HIGHEST);
+ SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_HIGHEST);
sleep_millis (100);
dummythread_die = -1;
setmousebuttonstate (dinput_winmouse(), num, updown);
}
-static long FAR PASCAL AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
+static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
PAINTSTRUCT ps;
HDC hDC;
inserted = 1;
else if (wParam == DBT_DEVICEREMOVECOMPLETE)
inserted = 0;
- #ifdef WINDDK
+#ifdef WINDDK
win32_spti_media_change (drive, inserted);
win32_ioctl_media_change (drive, inserted);
- #endif
+#endif
win32_aspi_media_change (drive, inserted);
}
}
break;
}
break;
+
case WM_COMMAND:
switch (wParam & 0xffff)
{
return DefWindowProc (hWnd, message, wParam, lParam);
}
-static long FAR PASCAL MainWindowProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
+static LRESULT CALLBACK MainWindowProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
PAINTSTRUCT ps;
RECT rc;
HDC hDC;
- switch (message) {
-
+ switch (message)
+ {
case WM_MOUSEMOVE:
case WM_MOUSEWHEEL:
case WM_ACTIVATEAPP:
case WM_WINDOWPOSCHANGED:
WIN32GFX_WindowMove();
- if( hAmigaWnd && GetWindowRect (hAmigaWnd, &amigawin_rect) )
- {
+ if( hAmigaWnd && GetWindowRect(hAmigaWnd, &amigawin_rect)) {
if (in_sizemove > 0)
break;
- if( !isfullscreen() && hAmigaWnd )
- {
+ if (!isfullscreen() && hAmigaWnd) {
static int store_xy;
RECT rc2;
- if( GetWindowRect( hMainWnd, &rc2 )) {
- if (amigawin_rect.left & 3)
- {
+ if (GetWindowRect(hMainWnd, &rc2)) {
+ if (amigawin_rect.left & 3) {
MoveWindow (hMainWnd, rc2.left+ 4 - amigawin_rect.left % 4, rc2.top,
rc2.right - rc2.left, rc2.bottom - rc2.top, TRUE);
}
- if( hWinUAEKey && store_xy++)
- {
+ if (hWinUAEKey && store_xy++) {
DWORD left = rc2.left - win_x_diff;
DWORD top = rc2.top - win_y_diff;
- RegSetValueEx( hWinUAEKey, "xPos", 0, REG_DWORD, (LPBYTE)&left, sizeof( LONG ) );
- RegSetValueEx( hWinUAEKey, "yPos", 0, REG_DWORD, (LPBYTE)&top, sizeof( LONG ) );
+ RegSetValueEx(hWinUAEKey, "xPos", 0, REG_DWORD, (LPBYTE)&left, sizeof(LONG));
+ RegSetValueEx(hWinUAEKey, "yPos", 0, REG_DWORD, (LPBYTE)&top, sizeof(LONG));
}
}
return 0;
return DefWindowProc (hWnd, message, wParam, lParam);
}
-static long FAR PASCAL HiddenWindowProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
+static LRESULT CALLBACK HiddenWindowProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
return DefWindowProc (hWnd, message, wParam, lParam);
}
int WIN32_CleanupLibraries( void )
{
if (hRichEdit)
- FreeLibrary (hRichEdit);
+ FreeLibrary(hRichEdit);
- if( hHtmlHelp )
- FreeLibrary( hHtmlHelp );
+ if (hHtmlHelp)
+ FreeLibrary(hHtmlHelp);
- if( hUIDLL )
- FreeLibrary( hUIDLL );
+ if (hUIDLL)
+ FreeLibrary(hUIDLL);
return 1;
}
{
int result = 0;
if (zfile_exists (help_file)) {
- if( hHtmlHelp = LoadLibrary( "HHCTRL.OCX" ) )
- {
- pHtmlHelp = ( HWND(WINAPI *)(HWND, LPCSTR, UINT, LPDWORD ) )GetProcAddress( hHtmlHelp, "HtmlHelpA" );
+ if (hHtmlHelp = LoadLibrary("HHCTRL.OCX")) {
+ pHtmlHelp = (HWND(WINAPI *)(HWND, LPCSTR, UINT, LPDWORD))GetProcAddress(hHtmlHelp, "HtmlHelpA");
result = 1;
}
}
result = WIN32_LoadLibrary (dllbuf);
if( result)
{
- dwFileVersionInfoSize = GetFileVersionInfoSize(dllbuf, &dwVersionHandle );
- if( dwFileVersionInfoSize )
+ dwFileVersionInfoSize = GetFileVersionInfoSize(dllbuf, &dwVersionHandle);
+ if (dwFileVersionInfoSize)
{
- if( lpFileVersionData = calloc( 1, dwFileVersionInfoSize ) )
+ if (lpFileVersionData = calloc(1, dwFileVersionInfoSize))
{
- if( GetFileVersionInfo (dllbuf, dwVersionHandle, dwFileVersionInfoSize, lpFileVersionData ) )
+ if (GetFileVersionInfo(dllbuf, dwVersionHandle, dwFileVersionInfoSize, lpFileVersionData))
{
VS_FIXEDFILEINFO *vsFileInfo = NULL;
UINT uLen;
fail = 0;
- if( VerQueryValue( lpFileVersionData, TEXT("\\"), (void **)&vsFileInfo, &uLen ) )
+ if (VerQueryValue(lpFileVersionData, TEXT("\\"), (void **)&vsFileInfo, &uLen))
{
if( vsFileInfo &&
HIWORD(vsFileInfo->dwProductVersionMS) == UAEMAJOR
}
}
}
- free( lpFileVersionData );
+ free(lpFileVersionData);
}
}
}
#ifndef SINGLEFILE
if (currprefs.win32_logfile) {
sprintf (debugfilename, "%swinuaelog.txt", start_path);
- if( !debugfile )
+ if (!debugfile)
debugfile = fopen (debugfilename, "wt");
} else if (!first) {
sprintf (debugfilename, "%swinuaebootlog.txt", start_path);
- if( !debugfile )
+ if (!debugfile)
debugfile = fopen (debugfilename, "wt");
}
#endif
osVersion.dwMajorVersion, osVersion.dwMinorVersion, osVersion.szCSDVersion,
os_winnt_admin ? " Admin" : "");
write_log ("\n(c) 1995-2001 Bernd Schmidt - Core UAE concept and implementation."
- "\n(c) 1998-2004 Toni Wilen - Win32 port, core code updates."
+ "\n(c) 1998-2005 Toni Wilen - Win32 port, core code updates."
"\n(c) 1996-2001 Brian King - Win32 port, Picasso96 RTG, and GUI."
"\n(c) 1996-1999 Mathias Ortmann - Win32 port and bsdsocket support."
"\n(c) 2000-2001 Bernd Meyer - JIT engine."
cfgfile_write (f, "win32.cpu_idle=%d\n", p->cpu_idle);
cfgfile_write (f, "win32.notaskbarbutton=%s\n", p->win32_notaskbarbutton ? "true" : "false");
cfgfile_write (f, "win32.always_on_top=%s\n", p->win32_alwaysontop ? "true" : "false");
+ cfgfile_write (f, "win32.no_recyclebin=%s\n", p->win32_norecyclebin ? "true" : "false");
}
static int fetchpri (int pri, int defpri)
|| cfgfile_yesno (option, value, "iconified_pause", &p->win32_iconified_pause)
|| cfgfile_yesno (option, value, "iconified_nosound", &p->win32_iconified_nosound)
|| cfgfile_yesno (option, value, "ctrl_f11_is_quit", &p->win32_ctrl_F11_is_quit)
+ || cfgfile_yesno (option, value, "no_recyclebin", &p->win32_norecyclebin)
|| cfgfile_intval (option, value, "midi_device", &p->win32_midioutdev, 1)
|| cfgfile_intval (option, value, "midiout_device", &p->win32_midioutdev, 1)
|| cfgfile_intval (option, value, "midiin_device", &p->win32_midiindev, 1)
return 1;
}
- extern void test (void);
+extern void test (void);
+
static int PASCAL WinMain2 (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,
int nCmdShow)
{
extern int mouseactive, focus;
extern int ignore_messages_all;
#define WINUAEBETA 1
-#define WINUAEBETASTR " Beta 3"
+#define WINUAEBETASTR " Beta 4"
extern void my_kbd_handler (int, int, int);
extern void clearallkeys(void);
return 0;
}
+/*
+static void dhack(void)
+{
+ int i = 0;
+ while (DisplayModes[i].depth >= 0)
+ i++;
+ if (i >= MAX_PICASSO_MODES - 1)
+ return;
+ DisplayModes[i].res.width = 480;
+ DisplayModes[i].res.height = 640;
+ DisplayModes[i].depth = DisplayModes[i - 1].depth;
+ DisplayModes[i].refresh[0] = 0;
+ DisplayModes[i].refresh[1] = 0;
+ DisplayModes[i].colormodes = DisplayModes[i - 1].colormodes;
+ DisplayModes[i + 1].depth = -1;
+ sprintf(DisplayModes[i].name, "%dx%d, %d-bit",
+ DisplayModes[i].res.width, DisplayModes[i].res.height, DisplayModes[i].depth * 8);
+}
+*/
+
static HRESULT CALLBACK modesCallback( LPDDSURFACEDESC2 modeDesc, LPVOID context )
{
RGBFTYPE colortype;
int b = DirectDraw_GetSurfaceBitCount ();
write_log ("W=%d H=%d B=%d\n", w, h, b);
DirectDraw_EnumDisplayModes (DDEDM_REFRESHRATES , modesCallback);
+ //dhack();
sortmodes ();
modesList ();
DirectDraw_Release ();
/* DirectX will fail with "Mode not supported" if we try to switch to a full
* screen mode that doesn't match one of the dimensions we got during enumeration.
* So try to find a best match for the given resolution in our list. */
-int WIN32GFX_AdjustScreenmode( uae_u32 *pwidth, uae_u32 *pheight, uae_u32 *ppixbits )
+int WIN32GFX_AdjustScreenmode(uae_u32 *pwidth, uae_u32 *pheight, uae_u32 *ppixbits)
{
struct PicassoResolution *best;
uae_u32 selected_mask = (*ppixbits == 8 ? RGBMASK_8BIT
: RGBMASK_32BIT);
int pass, i = 0, index = 0;
- for (pass = 0; pass < 2; pass++)
- {
+ for (pass = 0; pass < 2; pass++) {
struct PicassoResolution *dm;
uae_u32 mask = (pass == 0
? selected_mask
best = &DisplayModes[0];
dm = &DisplayModes[1];
- while (dm->depth >= 0)
- {
- if ((dm->colormodes & mask) != 0)
- {
+ while (dm->depth >= 0) {
+
+ /* do we already have supported resolution? */
+ if (dm->res.width == *pwidth && dm->res.height == *pheight && dm->depth == (*ppixbits / 8))
+ return i;
+
+ if ((dm->colormodes & mask) != 0) {
if (dm->res.width <= best->res.width && dm->res.height <= best->res.height
&& dm->res.width >= *pwidth && dm->res.height >= *pheight)
{
dm++;
i++;
}
- if (best->res.width == *pwidth && best->res.height == *pheight)
- {
+ if (best->res.width == *pwidth && best->res.height == *pheight) {
selected_mask = mask; /* %%% - BERND, I added this - does it make sense? Otherwise, I'd specify a 16-bit display-mode for my
Workbench (using -H 2, but SHOULD have been -H 1), and end up with an 8-bit mode instead*/
break;
}
*pwidth = best->res.width;
*pheight = best->res.height;
- if( best->colormodes & selected_mask )
+ if (best->colormodes & selected_mask)
return index;
/* Ordering here is done such that 16-bit is preferred, followed by 15-bit, 8-bit, 32-bit and 24-bit */
else
#endif
{
- if( !isfullscreen() ) {
+ if (!isfullscreen()) {
surface_type_e s;
s = DirectDraw_GetLockableType();
if (s != overlay_surface && s != invalid_surface)
- DX_Blit( 0, 0, 0, 0, WIN32GFX_GetWidth(), WIN32GFX_GetHeight(), BLIT_SRC );
+ DX_Blit(0, 0, 0, 0, WIN32GFX_GetWidth(), WIN32GFX_GetHeight(), BLIT_SRC);
} else {
- DirectDraw_Blt( primary_surface, NULL, secondary_surface, NULL, DDBLT_WAIT, NULL );
+ DirectDraw_Blt(primary_surface, NULL, secondary_surface, NULL, DDBLT_WAIT, NULL);
}
}
}
#ifdef PROWIZARD
#include "moduleripper.h"
#endif
+#include "catweasel.h"
#define DISK_FORMAT_STRING "(*.adf;*.adz;*.gz;*.dms;*.fdi;*.ipf;*.zip;*.rar;*.7z;*.exe)\0*.adf;*.adz;*.gz;*.dms;*.fdi;*.ipf;*.zip;*.rar;*.7z;*.exe\0"
#define ROM_FORMAT_STRING "(*.rom;*.zip;*.rar;*.7z;*.roz)\0*.rom;*.zip;*.rar;*.7z;*.roz\0"
static int gui_width = 640, gui_height = 480;
+static int mm = 0;
+static void m(void)
+{
+ write_log ("%d:0: %dx%d %dx%d %dx%d\n", mm, currprefs.gfx_width, currprefs.gfx_height,
+ workprefs.gfx_width, workprefs.gfx_height, changed_prefs.gfx_width, changed_prefs.gfx_height);
+ write_log ("%d:1: %dx%d %dx%d %dx%d\n", mm, currprefs.gfx_width_fs, currprefs.gfx_height_fs,
+ workprefs.gfx_width_fs, workprefs.gfx_height_fs, changed_prefs.gfx_width_fs, changed_prefs.gfx_height_fs);
+ mm++;
+}
+
/* if drive is -1, show the full GUI, otherwise file-requester for DF[drive] */
void gui_display( int shortcut )
{
pause_sound ();
setmouseactive (0);
- if( ( !WIN32GFX_IsPicassoScreen() && currprefs.gfx_afullscreen && ( currprefs.gfx_width < gui_width || currprefs.gfx_height < gui_height ) )
+ if ((!WIN32GFX_IsPicassoScreen() && currprefs.gfx_afullscreen && (currprefs.gfx_width < gui_width || currprefs.gfx_height < gui_height))
#ifdef PICASSO96
- || ( WIN32GFX_IsPicassoScreen() && currprefs.gfx_pfullscreen && ( picasso96_state.Width < gui_width || picasso96_state.Height < gui_height ) )
+ || (WIN32GFX_IsPicassoScreen() && currprefs.gfx_pfullscreen && (picasso96_state.Width < gui_width || picasso96_state.Height < gui_height))
#endif
) {
flipflop = 1;
write_log ("FlipToGDISurface failed, %s\n", DXError (hr));
}
- if( shortcut == -1 ) {
+ if (shortcut == -1) {
int ret;
if (flipflop)
ShowWindow (hAmigaWnd, SW_MINIMIZE);
#ifdef PICASSO96
DX_SetPalette (0, 256);
#endif
-
}
static void prefs_to_gui (struct uae_prefs *p)
#define MAX_FRAMERATE_LENGTH 40
#define MAX_NTH_LENGTH 20
-static int display_mode_index( uae_u32 x, uae_u32 y, uae_u32 d )
+static int display_mode_index(uae_u32 x, uae_u32 y, uae_u32 d)
{
int i;
+
i = 0;
while (DisplayModes[i].depth >= 0) {
if( DisplayModes[i].res.width == x &&
{
int d, d2, index;
- switch( workprefs.color_mode )
+ switch (workprefs.color_mode)
{
case 2:
d = 16;
break;
}
- if( workprefs.gfx_afullscreen )
+ if (workprefs.gfx_afullscreen)
{
d2 = d;
- if( ( index = WIN32GFX_AdjustScreenmode( &workprefs.gfx_width_fs, &workprefs.gfx_height_fs, &d2 ) ) >= 0 )
+ if ((index = WIN32GFX_AdjustScreenmode(&workprefs.gfx_width_fs, &workprefs.gfx_height_fs, &d2)) >= 0)
{
- switch( d2 )
+ switch (d2)
{
case 15:
workprefs.color_mode = 1;
static void values_to_miscdlg (HWND hDlg)
{
char txt[100];
+ int cw;
CheckDlgButton (hDlg, IDC_SOCKETS, workprefs.socket_emu);
CheckDlgButton (hDlg, IDC_ILLEGAL, workprefs.illegal_mem);
CheckDlgButton (hDlg, IDC_ALWAYSONTOP, workprefs.win32_alwaysontop);
CheckDlgButton (hDlg, IDC_ASPI, workprefs.win32_aspi);
CheckDlgButton (hDlg, IDC_CLOCKSYNC, workprefs.tod_hack);
+ cw = catweasel_detect();
+ EnableWindow (GetDlgItem (hDlg, IDC_CATWEASEL), cw);
+ if (!cw)
+ workprefs.catweasel = 0;
CheckDlgButton (hDlg, IDC_CATWEASEL, workprefs.catweasel);
CheckDlgButton (hDlg, IDC_STATE_CAPTURE, workprefs.statecapture);
break;
case IDC_MAPDRIVES:
- workprefs.win32_automount_drives = IsDlgButtonChecked( hDlg, button );
+ workprefs.win32_automount_drives = IsDlgButtonChecked(hDlg, button);
break;
case IDC_NOUAEFSDB:
- workprefs.filesys_no_uaefsdb = IsDlgButtonChecked( hDlg, IDC_NOUAEFSDB );
+ workprefs.filesys_no_uaefsdb = IsDlgButtonChecked(hDlg, IDC_NOUAEFSDB);
+ break;
+
+ case IDC_NORECYCLEBIN:
+ workprefs.win32_norecyclebin = IsDlgButtonChecked(hDlg, IDC_NORECYCLEBIN);
break;
+
}
}
case WM_USER:
CheckDlgButton (hDlg, IDC_MAPDRIVES, workprefs.win32_automount_drives);
CheckDlgButton (hDlg, IDC_NOUAEFSDB, workprefs.filesys_no_uaefsdb);
+ CheckDlgButton (hDlg, IDC_NORECYCLEBIN, workprefs.win32_norecyclebin);
InitializeListView (hDlg);
hilitehd ();
break;
static char comports[MAX_SERIALS][8];
static int ghostscript_available;
-#define NUM_JOYKBD 5
-
+/*
static int joy0idc[] = {
IDC_PORT0_JOYSC, IDC_PORT0_KBDA, IDC_PORT0_KBDB, IDC_PORT0_KBDC, IDC_PORT0_KBDD, IDC_PORT0_KBDE,
IDC_PORT0_JOYS, -1
IDC_PORT1_JOYSC, IDC_PORT1_KBDA, IDC_PORT1_KBDB, IDC_PORT1_KBDC, IDC_PORT1_KBDD, IDC_PORT1_KBDE,
IDC_PORT1_JOYS, -1
};
+*/
static int joy0previous, joy1previous;
+
static BOOL bNoMidiIn = FALSE;
static void enable_for_portsdlg( HWND hDlg )
{
- int i, v;
+ int v;
v = workprefs.input_selected_setting > 0 ? FALSE : TRUE;
+/*
for (i = 0; joy0idc[i] >= 0; i++) {
EnableWindow (GetDlgItem (hDlg, joy0idc[i]), v);
EnableWindow (GetDlgItem (hDlg, joy1idc[i]), v);
}
+*/
EnableWindow (GetDlgItem (hDlg, IDC_SWAP), v);
#if !defined (SERIAL_PORT)
EnableWindow( GetDlgItem( hDlg, IDC_MIDIOUTLIST), FALSE );
static void updatejoyport (HWND hDlg)
{
- int i, j, v;
-
+ int i, j;
+ char tmp[MAX_DPATH];
+
enable_for_portsdlg (hDlg);
+/*
for (i = 0; i < 2; i++) {
int *idcs1 = i == 0 ? joy0idc : joy1idc;
int *idcs2 = i == 0 ? joy1idc : joy0idc;
for (j = 1; j < NUM_JOYKBD + 2; j++)
EnableWindow (GetDlgItem (hDlg, idcs2[j]), workprefs.input_selected_setting == 0 && j != v);
}
-
+*/
if (joy0previous < 0)
joy0previous = inputdevice_get_device_total (IDTYPE_JOYSTICK) + 1;
if (joy1previous < 0)
- joy1previous = 1;
+ joy1previous = JSEM_LASTKBD + 1;
for (i = 0; i < 2; i++) {
int total = 1;
int idx = i == 0 ? joy0previous : joy1previous;
- int id1 = i == 0 ? IDC_PORT0_JOYS : IDC_PORT1_JOYS;
- int id2 = i == 0 ? IDC_PORT0_JOYSC : IDC_PORT1_JOYSC;
+ int id = i == 0 ? IDC_PORT0_JOYS : IDC_PORT1_JOYS;
int v = i == 0 ? workprefs.jport0 : workprefs.jport1;
- SendDlgItemMessage (hDlg, id1, CB_RESETCONTENT, 0, 0L);
- SendDlgItemMessage (hDlg, id1, CB_ADDSTRING, 0, (LPARAM)"");
+ char *p1, *p2;
+
+ SendDlgItemMessage (hDlg, id, CB_RESETCONTENT, 0, 0L);
+ SendDlgItemMessage (hDlg, id, CB_ADDSTRING, 0, (LPARAM)"");
+ WIN32GUI_LoadUIString (IDS_KEYJOY, tmp, sizeof (tmp));
+ strcat (tmp, "\n");
+ p1 = tmp;
+ for (;;) {
+ p2 = strchr (p1, '\n');
+ if (p2 && strlen (p2) > 0) {
+ *p2++ = 0;
+ SendDlgItemMessage (hDlg, id, CB_ADDSTRING, 0, (LPARAM)p1);
+ total++;
+ p1 = p2;
+ } else break;
+ }
for (j = 0; j < inputdevice_get_device_total (IDTYPE_JOYSTICK); j++, total++)
- SendDlgItemMessage (hDlg, id1, CB_ADDSTRING, 0, (LPARAM)inputdevice_get_device_name(IDTYPE_JOYSTICK, j));
+ SendDlgItemMessage (hDlg, id, CB_ADDSTRING, 0, (LPARAM)inputdevice_get_device_name(IDTYPE_JOYSTICK, j));
for (j = 0; j < inputdevice_get_device_total (IDTYPE_MOUSE); j++, total++)
- SendDlgItemMessage (hDlg, id1, CB_ADDSTRING, 0, (LPARAM)inputdevice_get_device_name(IDTYPE_MOUSE, j));
+ SendDlgItemMessage (hDlg, id, CB_ADDSTRING, 0, (LPARAM)inputdevice_get_device_name(IDTYPE_MOUSE, j));
if (v >= JSEM_MICE) {
- idx = (v - JSEM_MICE) + 1;
- if (idx > inputdevice_get_device_total (IDTYPE_MOUSE))
+ idx = v - JSEM_MICE;
+ if (idx >= inputdevice_get_device_total (IDTYPE_MOUSE))
idx = 0;
else
idx += inputdevice_get_device_total (IDTYPE_JOYSTICK);
+ idx += JSEM_LASTKBD;
} else if (v >= JSEM_JOYS) {
- idx = v - JSEM_JOYS + 1;
- if (idx > inputdevice_get_device_total (IDTYPE_JOYSTICK))
+ idx = v - JSEM_JOYS;
+ if (idx >= inputdevice_get_device_total (IDTYPE_JOYSTICK))
idx = 0;
+ idx += JSEM_LASTKBD;
+ } else {
+ idx = v - JSEM_KBDLAYOUT;
}
+ idx++;
if (idx >= total)
idx = 0;
- SendDlgItemMessage (hDlg, id1, CB_SETCURSEL, idx, 0);
+ SendDlgItemMessage (hDlg, id, CB_SETCURSEL, idx, 0);
}
}
vv = 0;
vv += JSEM_MICE;
}
+ if (vv >= JSEM_KBDLAYOUT && vv < JSEM_LASTKBD) {
+ vv -= JSEM_KBDLAYOUT;
+ vv++;
+ if (vv >= JSEM_LASTKBD)
+ vv = 0;
+ vv += JSEM_KBDLAYOUT;
+ }
*port = vv;
}
static void values_from_portsdlg (HWND hDlg)
{
- int item, i, j, lastside = 0, changed = 0, v;
+ int item, i, lastside = 0, changed = 0, v;
char tmp[256];
BOOL success;
-
+
+ for (i = 0; i < 2; i++) {
+ int idx = 0;
+ int *port = i == 0 ? &workprefs.jport0 : &workprefs.jport1;
+ int prevport = *port;
+ int id = i == 0 ? IDC_PORT0_JOYS : IDC_PORT1_JOYS;
+ int v = SendDlgItemMessage (hDlg, id, CB_GETCURSEL, 0, 0L);
+ if (v != CB_ERR && v > 0) {
+ v--;
+ if (v < JSEM_LASTKBD)
+ *port = JSEM_KBDLAYOUT + v;
+ else if (v >= JSEM_LASTKBD + inputdevice_get_device_total (IDTYPE_JOYSTICK))
+ *port = JSEM_MICE + v - inputdevice_get_device_total (IDTYPE_JOYSTICK) - JSEM_LASTKBD;
+ else
+ *port = JSEM_JOYS + v - JSEM_LASTKBD;
+ }
+ if (*port != prevport) {
+ lastside = i;
+ changed = 1;
+ }
+ }
+ if (changed) {
+ if (lastside)
+ fixjport (&workprefs.jport0, workprefs.jport1);
+ else
+ fixjport (&workprefs.jport1, workprefs.jport0);
+ }
+
+/*
for (i = 0; i < 2; i++) {
int *idcs = i == 0 ? joy0idc : joy1idc;
int *port = i == 0 ? &workprefs.jport0 : &workprefs.jport1;
else
fixjport (&workprefs.jport1, workprefs.jport0);
}
+*/
item = SendDlgItemMessage( hDlg, IDC_PRINTERLIST, CB_GETCURSEL, 0, 0L );
if( item != CB_ERR )
}
end:
RegCloseKey (fkey);
- if (load)
+ if (load) {
values_to_hw3ddlg (hDlg);
+ SendMessage (hDlg, WM_HSCROLL, 0, 0);
+ }
enable_for_hw3ddlg (hDlg);
}