From 87a3ab167cb9c60f3392277b4f363ce5ad4b55d1 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Tue, 25 Dec 2007 18:50:20 +0200 Subject: [PATCH] imported winuaesrc1460b2.zip --- cfgfile.c | 55 ++--- custom.c | 4 +- drawing.c | 20 +- filesys.c | 3 +- include/inputdevice.h | 2 + inputdevice.c | 281 +++++++++++++++++++----- od-win32/dinput.c | 29 ++- od-win32/mman.c | 19 +- od-win32/win32.h | 4 +- od-win32/win32gfx.c | 58 +++-- od-win32/win32gui.c | 3 +- od-win32/winuae_msvc/winuae_msvc.vcproj | 4 - od-win32/winuaechangelog.txt | 47 +++- 13 files changed, 376 insertions(+), 153 deletions(-) diff --git a/cfgfile.c b/cfgfile.c index 1f2f6ff9..4e102cff 100644 --- a/cfgfile.c +++ b/cfgfile.c @@ -454,7 +454,8 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) cfgfile_write (f, "override_dga_address=0x%08x\n", p->override_dga_address); for (i = 0; i < 2; i++) { - int v = p->jports[i].id; + struct jport *jp = &p->jports[i]; + int v = jp->id; char tmp1[100], tmp2[50]; if (v < 0) { strcpy (tmp2, "none"); @@ -469,6 +470,14 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) } sprintf (tmp1, "joyport%d=%s\n", i, tmp2); cfgfile_write (f, tmp1); + if (jp->name) { + sprintf (tmp1, "joyportfriendlyname%d=%s\n", i, jp->name); + cfgfile_write (f, tmp1); + } + if (jp->configname) { + sprintf (tmp1, "joyportname%d=%s\n", i, jp->configname); + cfgfile_write (f, tmp1); + } } cfgfile_write (f, "bsdsocket_emu=%s\n", p->socket_emu ? "true" : "false"); @@ -995,41 +1004,17 @@ static int cfgfile_parse_host (struct uae_prefs *p, char *option, char *value) return 1; } + if (strcmp (option, "joyportfriendlyname0") == 0 || strcmp (option, "joyportfriendlyname1") == 0) { + inputdevice_joyport_config (p, value, strcmp (option, "joyportfriendlyname0") == 0 ? 0 : 1, 2); + return 1; + } + if (strcmp (option, "joyportname0") == 0 || strcmp (option, "joyportname1") == 0) { + inputdevice_joyport_config (p, value, strcmp (option, "joyportname0") == 0 ? 0 : 1, 1); + return 1; + } + if (strcmp (option, "joyport0") == 0 || strcmp (option, "joyport1") == 0) { - int port = strcmp (option, "joyport0") == 0 ? 0 : 1; - int start = -1, got = 0; - char *pp = 0; - if (strncmp (value, "kbd", 3) == 0) { - start = JSEM_KBDLAYOUT; - pp = value + 3; - got = 1; - } else if (strncmp (value, "joy", 3) == 0) { - start = JSEM_JOYS; - pp = value + 3; - got = 1; - } else if (strncmp (value, "mouse", 5) == 0) { - start = JSEM_MICE; - pp = value + 5; - got = 1; - } else if (strcmp (value, "none") == 0) { - got = 2; - } - if (got) { - if (pp) { - int v = atol (pp); - if (start >= 0) { - if (start == JSEM_KBDLAYOUT) - v--; - if (v >= 0) { - start += v; - got = 2; - } - } - } - if (got == 2) { - p->jports[port].id = start; - } - } + inputdevice_joyport_config (p, value, strcmp (option, "joyport0") == 0 ? 0 : 1, 0); return 1; } diff --git a/custom.c b/custom.c index d3d9ef3a..a1d7cc5a 100644 --- a/custom.c +++ b/custom.c @@ -5752,10 +5752,8 @@ uae_u8 *save_custom_sprite(int num, int *len, uae_u8 *dstptr) void check_prefs_changed_custom (void) { currprefs.gfx_framerate = changed_prefs.gfx_framerate; - if (inputdevice_config_change_test ()) { + if (inputdevice_config_change_test ()) inputdevice_copyconfig (&changed_prefs, &currprefs); - inputdevice_updateconfig (&currprefs); - } currprefs.immediate_blits = changed_prefs.immediate_blits; currprefs.collision_level = changed_prefs.collision_level; diff --git a/drawing.c b/drawing.c index e5cf9beb..11e8cb58 100644 --- a/drawing.c +++ b/drawing.c @@ -373,15 +373,25 @@ static void pfield_init_linetoscr (void) #ifdef AGA if (brdsprt && dip_for_drawing->nr_sprites) { int min = visible_right_border, max = visible_left_border, i; + int posdiff = sprite_buffer_res - bplres; for (i = 0; i < dip_for_drawing->nr_sprites; i++) { int x; x = curr_sprite_entries[dip_for_drawing->first_sprite_entry + i].pos; - if (x < min) min = x; + if (x < min) + min = x; x = curr_sprite_entries[dip_for_drawing->first_sprite_entry + i].max; - if (x > max) max = x; + if (x > max) + max = x; + } + min += (DIW_DDF_OFFSET - DISPLAY_LEFT_SHIFT) << sprite_buffer_res; + max += (DIW_DDF_OFFSET - DISPLAY_LEFT_SHIFT) << sprite_buffer_res; + if (posdiff < 0) { + min <<= -posdiff; + max <<= -posdiff; + } else { + min >>= posdiff; + max >>= posdiff; } - min += (DIW_DDF_OFFSET - DISPLAY_LEFT_SHIFT) << (2 - lores_shift); - max += (DIW_DDF_OFFSET - DISPLAY_LEFT_SHIFT) << (2 - lores_shift); if (min < playfield_start) playfield_start = min; if (playfield_start < visible_left_border) @@ -1883,7 +1893,7 @@ static void pfield_draw_line (int lineno, int gfx_ypos, int follow_ypos) adjust_drawing_colors (dp_for_drawing->ctable, 0); #ifdef AGA /* this makes things complex.. */ - if (brdsprt && (currprefs.chipset_mask & CSMASK_AGA) && dip_for_drawing->nr_sprites > 0) { + if (brdsprt && dip_for_drawing->nr_sprites > 0) { dosprites = 1; pfield_expand_dp_bplcon (); pfield_init_linetoscr (); diff --git a/filesys.c b/filesys.c index c7c7a93a..317416c2 100644 --- a/filesys.c +++ b/filesys.c @@ -4269,7 +4269,8 @@ action_more_cache (Unit *unit, dpacket packet) { TRACE(("ACTION_MORE_CACHE()\n")); PUT_PCK_RES1 (packet, 50); /* bug but AmigaOS expects it */ - flush_cache(unit, 0); + if (GET_PCK_ARG1 (packet) != 0) + flush_cache(unit, 0); } static void diff --git a/include/inputdevice.h b/include/inputdevice.h index d0fbc395..843e7b32 100644 --- a/include/inputdevice.h +++ b/include/inputdevice.h @@ -24,6 +24,7 @@ struct inputdevice_functions { int (*get_widget_num)(int); int (*get_widget_type)(int,int,char*,uae_u32*); int (*get_widget_first)(int,int); + int (*get_flags)(int); }; extern struct inputdevice_functions idev[3]; extern struct inputdevice_functions inputdevicefunc_joystick; @@ -123,6 +124,7 @@ extern void inputdevice_reset (void); extern void write_inputdevice_config (struct uae_prefs *p, struct zfile *f); extern void read_inputdevice_config (struct uae_prefs *p, char *option, char *value); extern void reset_inputdevice_config (struct uae_prefs *pr); +extern void inputdevice_joyport_config (struct uae_prefs *p, char *value, int portnum, int type); extern void inputdevice_init (void); extern void inputdevice_close (void); diff --git a/inputdevice.c b/inputdevice.c index 245af917..a05b2e6b 100644 --- a/inputdevice.c +++ b/inputdevice.c @@ -3,7 +3,7 @@ * * joystick/mouse emulation * - * Copyright 2001-2006 Toni Wilen + * Copyright 2001-2007 Toni Wilen * * new fetures: * - very configurable (and very complex to configure :) @@ -47,6 +47,8 @@ #include "autoconf.h" #include "rp.h" +static int allmode = 1; + int inputdevice_logging = 0; #define DIR_LEFT 1 @@ -615,7 +617,6 @@ static void clear_id (struct uae_input_device *id) xfree (id->configname); xfree (id->name); memset (id, 0, sizeof (struct uae_input_device)); - id->enabled = 1; } void read_inputdevice_config (struct uae_prefs *pr, char *option, char *value) @@ -690,6 +691,7 @@ void read_inputdevice_config (struct uae_prefs *pr, char *option, char *value) if (!strcmp (p2, "empty")) { clear_id (id); + id->enabled = 1; return; } @@ -1938,43 +1940,120 @@ void inputdevice_reset (void) magicmouse_ibase = 0; } -static int switchdevice (struct uae_input_device *id, int num) +static int getoldport (struct uae_input_device *id) { -#if 0 - struct inputevent *ie, *ie2; - int i, j, k, event, unit; -#endif + int i, j; + + for (i = 0; i < MAX_INPUT_DEVICE_EVENTS; i++) { + for (j = 0; j < MAX_INPUT_SUB_EVENT; j++) { + int evt = id->eventid[i][j]; + if (evt > 0) { + int unit = events[evt].unit; + if (unit >= 1 && unit <= 4) + return unit; + } + } + } + return -1; +} + +static int switchdevice (struct uae_input_device *id, int num, int button) +{ + int i; + int ismouse = 0; + int newport = 0; + char *name = NULL; if (num >= 4) return 0; - return 0; - write_log ("switchdev %d\n", num); - if (!currprefs.input_selected_setting) + if (!button) + return 0; + for (i = 0; i < MAX_INPUT_DEVICES; i++) { + if (id == &joysticks[i]) { + name = idev[IDTYPE_JOYSTICK].get_uniquename (i); + newport = num == 0 ? 1 : 0; + if (currprefs.input_selected_setting && idev[IDTYPE_JOYSTICK].get_flags (i)) + return 0; + } + if (id == &mice[i]) { + ismouse = 1; + name = idev[IDTYPE_MOUSE].get_uniquename (i); + newport = num == 0 ? 0 : 1; + if (currprefs.input_selected_setting && idev[IDTYPE_MOUSE].get_flags (i)) + return 0; + } + } + if (!name) return 0; + write_log ("inputdevice change request '%s':%d->%d\n", name, num, newport); + if (!currprefs.input_selected_setting) { + if (num == 0 || num == 1) { + if (name) { + inputdevice_joyport_config (&changed_prefs, name, newport, 2); + inputdevice_copyconfig (&changed_prefs, &currprefs); + return 1; + } + } + return 0; + } else { + int oldport = getoldport (id); + int i, j, k, evt; + struct inputevent *ie, *ie2; -#if 0 - id->enabled = 1; - for (i = 0; i < MAX_INPUT_DEVICE_EVENTS; i++) { - for (j = 0; j < MAX_INPUT_SUB_EVENT; j++) { - event = id->eventid[i][j]; - if (event <= 0) - continue; - ie = &events[event]; - if (ie->unit <= 0) - continue; - unit = ie->unit; - k = 1; - while (events[k].confname) { - ie2 = &events[k]; - if (ie2->type == ie->type && ie2->data == ie->data && ie2->allow_mask == ie->allow_mask) { - id->eventid[i][j] = k; - break; + if (oldport <= 0) + return 0; + newport++; + /* do not switch if "supermouse" mouse is already selected + * in same port and new device is also mouse. + */ + if (ismouse) { + for (i = 0; i < MAX_INPUT_SETTINGS + 1; i++) { + if (getoldport (&mice[i]) == newport && mice[i].enabled) { + if (idev[IDTYPE_MOUSE].get_flags (i)) + return 0; } - k++; } } + for (i = 0; i < MAX_INPUT_SETTINGS + 1; i++) { + if (getoldport (&joysticks[i]) == newport) + joysticks[i].enabled = 0; + if (getoldport (&mice[i]) == newport) + mice[i].enabled = 0; + } + id->enabled = 1; + for (i = 0; i < MAX_INPUT_DEVICE_EVENTS; i++) { + for (j = 0; j < MAX_INPUT_SUB_EVENT; j++) { + evt = id->eventid[i][j]; + if (evt <= 0) + continue; + ie = &events[evt]; + if (ie->unit == oldport) { + k = 1; + while (events[k].confname) { + ie2 = &events[k]; + if (ie2->type == ie->type && ie2->data == ie->data && ie2->allow_mask == ie->allow_mask && ie2->unit == newport) { + id->eventid[i][j] = k; + break; + } + k++; + } + } else if (ie->unit == newport) { + k = 1; + while (events[k].confname) { + ie2 = &events[k]; + if (ie2->type == ie->type && ie2->data == ie->data && ie2->allow_mask == ie->allow_mask && ie2->unit == oldport) { + id->eventid[i][j] = k; + break; + } + k++; + } + } + } + } + inputdevice_copyconfig (&currprefs, &changed_prefs); + inputdevice_copyconfig (&changed_prefs, &currprefs); + return 1; } -#endif return 0; } @@ -2013,7 +2092,7 @@ static void setbuttonstateall (struct uae_input_device *id, struct uae_input_dev if (!id->enabled) { if (state) - switchdevice (id, button); + switchdevice (id, button, 1); return; } if (button >= ID_BUTTON_TOTAL) @@ -2184,20 +2263,30 @@ static void compatibility_mode (struct uae_prefs *prefs) int joy, i; int used[4] = { 0, 0, 0, 0}; + for (i = 0; i < 2; i++) { + xfree (prefs->jports[i].name); + xfree (prefs->jports[i].configname); + prefs->jports[i].name = NULL; + prefs->jports[i].configname = NULL; + } compatibility_device[0] = -1; compatibility_device[1] = -1; for (i = 0; i < MAX_INPUT_DEVICES; i++) { - memset (&mice[i], 0, sizeof (*mice)); - memset (&joysticks[i], 0, sizeof (*joysticks)); + clear_id (&mice[i]); + clear_id (&joysticks[i]); } if ((joy = jsem_ismouse (0, prefs)) >= 0) { input_get_default_mouse (mice, joy, 0); mice[joy].enabled = 1; + prefs->jports[0].name = my_strdup (idev[IDTYPE_MOUSE].get_friendlyname (joy)); + prefs->jports[0].configname = my_strdup (idev[IDTYPE_MOUSE].get_uniquename (joy)); } if ((joy = jsem_ismouse (1, prefs)) >= 0) { input_get_default_mouse (mice, joy, 1); mice[joy].enabled = 1; + prefs->jports[1].name = my_strdup (idev[IDTYPE_MOUSE].get_friendlyname (joy)); + prefs->jports[1].configname = my_strdup (idev[IDTYPE_MOUSE].get_uniquename (joy)); } joy = jsem_isjoy (1, prefs); @@ -2205,6 +2294,8 @@ static void compatibility_mode (struct uae_prefs *prefs) used[joy] = 1; input_get_default_joystick (joysticks, joy, 1); joysticks[joy].enabled = 1; + prefs->jports[1].name = my_strdup (idev[IDTYPE_JOYSTICK].get_friendlyname (joy)); + prefs->jports[1].configname = my_strdup (idev[IDTYPE_JOYSTICK].get_uniquename (joy)); } joy = jsem_isjoy (0, prefs); @@ -2212,7 +2303,9 @@ static void compatibility_mode (struct uae_prefs *prefs) used[joy] = 1; input_get_default_joystick (joysticks, joy, 0); joysticks[joy].enabled = 1; - } + prefs->jports[0].name = my_strdup (idev[IDTYPE_JOYSTICK].get_friendlyname (joy)); + prefs->jports[0].configname = my_strdup (idev[IDTYPE_JOYSTICK].get_uniquename (joy)); + } for (joy = 0; used[joy]; joy++); if (JSEM_ISANYKBD (0, prefs)) { @@ -2289,25 +2382,6 @@ static void matchdevices_all (struct uae_prefs *prefs) } } -/* called when devices get inserted or removed */ -void inputdevice_devicechange (struct uae_prefs *prefs) -{ - int acc = input_acquired; - - inputdevice_unacquire (); - idev[IDTYPE_JOYSTICK].close (); - idev[IDTYPE_MOUSE].close (); - idev[IDTYPE_KEYBOARD].close (); - idev[IDTYPE_JOYSTICK].init (); - idev[IDTYPE_MOUSE].init (); - idev[IDTYPE_KEYBOARD].init (); - matchdevices (&idev[IDTYPE_MOUSE], mice); - matchdevices (&idev[IDTYPE_JOYSTICK], joysticks); - matchdevices (&idev[IDTYPE_KEYBOARD], keyboards); - if (acc) - inputdevice_acquire (); -} - void inputdevice_updateconfig (struct uae_prefs *prefs) { int i; @@ -2368,6 +2442,29 @@ void inputdevice_updateconfig (struct uae_prefs *prefs) mousehack_enable(); } +/* called when devices get inserted or removed */ +void inputdevice_devicechange (struct uae_prefs *prefs) +{ + int acc = input_acquired; + + inputdevice_unacquire (); + idev[IDTYPE_JOYSTICK].close (); + idev[IDTYPE_MOUSE].close (); + idev[IDTYPE_KEYBOARD].close (); + idev[IDTYPE_JOYSTICK].init (); + idev[IDTYPE_MOUSE].init (); + idev[IDTYPE_KEYBOARD].init (); + if (prefs == &currprefs) { + inputdevice_copyconfig (&changed_prefs, &currprefs); + if (acc) + inputdevice_acquire (); + } else { + matchdevices (&idev[IDTYPE_MOUSE], mice); + matchdevices (&idev[IDTYPE_JOYSTICK], joysticks); + matchdevices (&idev[IDTYPE_KEYBOARD], keyboards); + } +} + static void set_kbr_default (struct uae_prefs *p, int index, int num) { int i, j, k, l; @@ -2899,11 +2996,11 @@ void inputdevice_acquire (void) inputdevice_unacquire (); for (i = 0; i < MAX_INPUT_DEVICES; i++) { - if (use_joysticks[i]) + if (use_joysticks[i] || (allmode && !idev[IDTYPE_JOYSTICK].get_flags (i))) idev[IDTYPE_JOYSTICK].acquire (i, 0); } for (i = 0; i < MAX_INPUT_DEVICES; i++) { - if (use_mice[i]) + if (use_mice[i] || (allmode && !idev[IDTYPE_MOUSE].get_flags (i))) idev[IDTYPE_MOUSE].acquire (i, 0); } for (i = 0; i < MAX_INPUT_DEVICES; i++) { @@ -2926,8 +3023,10 @@ void inputdevice_unacquire (void) idev[IDTYPE_KEYBOARD].unacquire (i); } -static int ignoreoldinput(int joy) +static int ignoreoldinput (int joy) { + if (!use_joysticks[joy]) + return 0; if (currprefs.input_selected_setting == 0) { if (jsem_isjoy (0, &currprefs) != joy && jsem_isjoy (1, &currprefs) != joy) return 1; @@ -2978,7 +3077,7 @@ void setjoybuttonstate (int joy, int button, int state) { if (ignoreoldinput(joy)) { if (state) - switchdevice (&joysticks[joy], button); + switchdevice (&joysticks[joy], button, 1); return; } setbuttonstateall (&joysticks[joy], &joysticks2[joy], button, state ? 1 : 0); @@ -3038,7 +3137,7 @@ void setjoystickstate (int joy, int axis, int state, int max) return; if (!joysticks[joy].enabled || ignoreoldinput(joy)) { if (v1) - switchdevice (&joysticks[joy], axis * 2 + (v1 < 0 ? 0 : 1)); + switchdevice (&joysticks[joy], axis * 2 + (v1 < 0 ? 0 : 1), 0); return; } for (i = 0; i < MAX_INPUT_SUB_EVENT; i++) @@ -3162,3 +3261,71 @@ int jsem_iskbdjoy (int port, const struct uae_prefs *p) return -1; return v; } + +void inputdevice_joyport_config (struct uae_prefs *p, char *value, int portnum, int type) +{ + switch (type) + { + case 1: + case 2: + { + int i, j; + for (j = 0; j < 2; j++) { + struct inputdevice_functions *idf; + int type = IDTYPE_MOUSE; + int idnum = JSEM_MICE; + if (j == 0) { + type = IDTYPE_JOYSTICK; + idnum = JSEM_JOYS; + } + idf = &idev[type]; + for (i = 0; i < idf->get_num (); i++) { + char *name1 = idf->get_friendlyname (i); + char *name2 = idf->get_uniquename (i); + if ((name1 && !strcmp (name1, value)) || (name2 && !strcmp (name2, value))) { + p->jports[portnum].id = idnum + i; + return; + } + } + } + } + break; + case 0: + { + int start = -1, got = 0; + char *pp = 0; + if (strncmp (value, "kbd", 3) == 0) { + start = JSEM_KBDLAYOUT; + pp = value + 3; + got = 1; + } else if (strncmp (value, "joy", 3) == 0) { + start = JSEM_JOYS; + pp = value + 3; + got = 1; + } else if (strncmp (value, "mouse", 5) == 0) { + start = JSEM_MICE; + pp = value + 5; + got = 1; + } else if (strcmp (value, "none") == 0) { + got = 2; + } + if (got) { + if (pp) { + int v = atol (pp); + if (start >= 0) { + if (start == JSEM_KBDLAYOUT && v > 0) + v--; + if (v >= 0) { + start += v; + got = 2; + } + } + } + if (got == 2) { + p->jports[portnum].id = start; + } + } + } + break; + } +} \ No newline at end of file diff --git a/od-win32/dinput.c b/od-win32/dinput.c index bf3f30cc..41ebae20 100644 --- a/od-win32/dinput.c +++ b/od-win32/dinput.c @@ -1215,11 +1215,22 @@ static void read_mouse (void) } } +static int get_mouse_flags (int num) +{ + if (di_mouse[num].rawinput) + return 0; + if (di_mouse[num].catweasel) + return 0; + if (di_mouse[num].wininput == 1 && !rawinput_available) + return 0; + return 1; +} struct inputdevice_functions inputdevicefunc_mouse = { init_mouse, close_mouse, acquire_mouse, unacquire_mouse, read_mouse, get_mouse_num, get_mouse_friendlyname, get_mouse_uniquename, get_mouse_widget_num, get_mouse_widget_type, - get_mouse_widget_first + get_mouse_widget_first, + get_mouse_flags }; @@ -1765,11 +1776,17 @@ static void unacquire_kb (int num) } } +static int get_kb_flags (int kb) +{ + return 0; +} + struct inputdevice_functions inputdevicefunc_keyboard = { init_kb, close_kb, acquire_kb, unacquire_kb, read_kb, get_kb_num, get_kb_friendlyname, get_kb_uniquename, get_kb_widget_num, get_kb_widget_type, - get_kb_widget_first + get_kb_widget_first, + get_kb_flags }; @@ -2011,11 +2028,17 @@ static void unacquire_joystick (int num) di_joystick[num].acquired = 0; } +static int get_joystick_flags (int num) +{ + return 0; +} + struct inputdevice_functions inputdevicefunc_joystick = { init_joystick, close_joystick, acquire_joystick, unacquire_joystick, read_joystick, get_joystick_num, get_joystick_friendlyname, get_joystick_uniquename, get_joystick_widget_num, get_joystick_widget_type, - get_joystick_widget_first + get_joystick_widget_first, + get_joystick_flags }; int dinput_wmkey (uae_u32 key) diff --git a/od-win32/mman.c b/od-win32/mman.c index 8a2e7702..e9edde9e 100644 --- a/od-win32/mman.c +++ b/od-win32/mman.c @@ -88,13 +88,12 @@ void preinit_shm (void) uae_u64 totalphys64; MEMORYSTATUS memstats; - max_allowed_mman = 512; + max_allowed_mman = 768; if (os_winnt) { max_allowed_mman = 1536; if (os_64bit) max_allowed_mman = 2048; } - max_z3fastmem = (max_allowed_mman >> 1) * 1024 * 1024; memstats.dwLength = sizeof(memstats); GlobalMemoryStatus(&memstats); @@ -113,17 +112,14 @@ void preinit_shm (void) } } } - - size64 = 16 * 1024 * 1024; - while (total64 >= (size64 << 1) - && size64 != ((uae_u64)2048) * 1024 * 1024) - size64 <<= 1; - if (size64 > max_allowed_mman * 1024 * 1024) - size64 = max_allowed_mman * 1024 * 1024; - if (size64 > 0x80000000) - size64 = 0x80000000; + size64 = total64 - (total64 >> 3); + if (size64 > 0x7f000000) + size64 = 0x7f000000; if (size64 < 8 * 1024 * 1024) size64 = 8 * 1024 * 1024; + if (max_allowed_mman * 1024 * 1024 > size64) + max_allowed_mman = size64 / (1024 * 1024); + max_z3fastmem = (max_allowed_mman - (max_allowed_mman >> 3)) * 1024 * 1024; write_log ("Max Z3FastRAM %dM. Total physical RAM %uM\n", max_z3fastmem >> 20, totalphys64 >> 20); } @@ -162,6 +158,7 @@ int init_shm (void) shmids[i].addr = NULL; shmids[i].name[0] = 0; } + for (;;) { int change; blah = VirtualAlloc(NULL, size + add, MEM_RESERVE, PAGE_EXECUTE_READWRITE); diff --git a/od-win32/win32.h b/od-win32/win32.h index 8156c034..e5f3f3b7 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -15,9 +15,9 @@ #define GETBDM(x) (((x) - ((x / 10000) * 10000)) / 100) #define GETBDD(x) ((x) % 100) -#define WINUAEBETA 1 +#define WINUAEBETA 2 #define WINUAEPUBLICBETA 1 -#define WINUAEDATE MAKEBD(2007, 12, 23) +#define WINUAEDATE MAKEBD(2007, 12, 25) #define WINUAEEXTRA "" #define WINUAEREV "" diff --git a/od-win32/win32gfx.c b/od-win32/win32gfx.c index ddb09d81..2e80de25 100644 --- a/od-win32/win32gfx.c +++ b/od-win32/win32gfx.c @@ -354,17 +354,14 @@ static int set_ddraw (void) write_log ( "set_ddraw: Trying %dx%d, bits=%d, refreshrate=%d\n", width, height, bits, freq ); ddrval = DirectDraw_SetDisplayMode (width, height, bits, freq); if (FAILED(ddrval)) { - if (ddrval == E_NOTIMPL) { - write_log ("set_ddraw: failed, trying without forced refresh rate\n"); - ddrval = DirectDraw_SetDisplayMode (width, height, bits, 0); - if (FAILED(ddrval)) { - write_log ( "set_ddraw: Couldn't SetDisplayMode()\n" ); - goto oops; - } + write_log ("set_ddraw: failed, trying without forced refresh rate\n"); + ddrval = DirectDraw_SetDisplayMode (width, height, bits, 0); + if (FAILED(ddrval)) { + write_log ( "set_ddraw: Couldn't SetDisplayMode()\n"); + goto oops; } } - - ddrval = DirectDraw_GetDisplayMode(); + ddrval = DirectDraw_GetDisplayMode (); if (FAILED(ddrval)) { write_log ( "set_ddraw: Couldn't GetDisplayMode()\n" ); goto oops; @@ -372,21 +369,21 @@ static int set_ddraw (void) } if (dd) { - ddrval = DirectDraw_CreateClipper(); + ddrval = DirectDraw_CreateClipper (); if (FAILED(ddrval)) { - write_log ( "set_ddraw: No clipping support\n" ); + write_log ("set_ddraw: No clipping support\n"); goto oops; } ddrval = DirectDraw_CreateSurface (width, height); if (FAILED(ddrval)) { - write_log ( "set_ddraw: Couldn't CreateSurface() for primary because %s.\n", DXError( ddrval ) ); + write_log ("set_ddraw: Couldn't CreateSurface() for primary because %s.\n", DXError (ddrval)); goto oops; } if (DirectDraw_GetPrimaryBitCount() != (unsigned)bits && overlay) { ddrval = DirectDraw_CreateOverlaySurface (width, height, bits, 0); if(FAILED(ddrval)) { - write_log ( "set_ddraw: Couldn't CreateOverlaySurface(%d,%d,%d) because %s.\n", width, height, bits, DXError( ddrval ) ); + write_log ("set_ddraw: Couldn't CreateOverlaySurface(%d,%d,%d) because %s.\n", width, height, bits, DXError (ddrval)); goto oops2; } } else { @@ -397,14 +394,14 @@ static int set_ddraw (void) if (!DirectDraw_DetermineLocking (dxfullscreen)) { - write_log ( "set_ddraw: Couldn't determine locking.\n" ); + write_log ("set_ddraw: Couldn't determine locking.\n"); goto oops; } ddrval = DirectDraw_SetClipper (hAmigaWnd); if (FAILED(ddrval)) { - write_log ( "set_ddraw: Couldn't SetHWnd()\n" ); + write_log ("set_ddraw: Couldn't SetHWnd()\n"); goto oops; } @@ -412,7 +409,7 @@ static int set_ddraw (void) ddrval = DirectDraw_CreatePalette (currentmode->pal); if (FAILED(ddrval)) { - write_log ( "set_ddraw: Couldn't CreatePalette()\n" ); + write_log ("set_ddraw: Couldn't CreatePalette()\n"); goto oops; } } @@ -1014,15 +1011,13 @@ static void close_hwnds( void ) AVIOutput_Restart (); #endif setmouseactive (0); - if (hMainWnd) { - addnotifications (hMainWnd, TRUE); - systray (hMainWnd, TRUE); - } if (hStatusWnd) { ShowWindow (hStatusWnd, SW_HIDE); DestroyWindow (hStatusWnd); } if (hAmigaWnd) { + addnotifications (hAmigaWnd, TRUE); + systray (hAmigaWnd, TRUE); #ifdef OPENGL OGL_free (); #endif @@ -2082,19 +2077,22 @@ static int create_windows (void) struct PicassoResolution *pr = &DisplayModes[i]; if (pr->res.width == currentmode->native_width && pr->res.height == currentmode->native_height) break; - if (pr->res.width >= currentmode->native_width && pr->res.height >= currentmode->native_height) { - write_log ("FS: %dx%d -> %dx%d\n", currentmode->native_width, currentmode->native_height, - pr->res.width, pr->res.height); - currentmode->native_width = pr->res.width; - currentmode->native_height = pr->res.height; - break; + } + if (DisplayModes[i].depth < 0) { + for (i = 0; DisplayModes[i].depth >= 0; i++) { + struct PicassoResolution *pr = &DisplayModes[i]; + if (pr->res.width >= currentmode->native_width && pr->res.height >= currentmode->native_height) { + write_log ("FS: %dx%d -> %dx%d\n", currentmode->native_width, currentmode->native_height, + pr->res.width, pr->res.height); + currentmode->native_width = pr->res.width; + currentmode->native_height = pr->res.height; + break; + } } } } - - hAmigaWnd = CreateWindowEx (dxfs ? WS_EX_ACCEPTFILES | WS_EX_TOPMOST : WS_EX_ACCEPTFILES | exstyle | (currprefs.win32_alwaysontop ? WS_EX_TOPMOST : 0), "AmigaPowah", "WinUAE", WS_CLIPCHILDREN | WS_CLIPSIBLINGS | (hMainWnd ? WS_VISIBLE | WS_CHILD : WS_VISIBLE | WS_POPUP | WS_SYSMENU | WS_MINIMIZEBOX), @@ -2108,8 +2106,8 @@ static int create_windows (void) return 0; } - systray (hMainWnd, FALSE); - addnotifications (hMainWnd, FALSE); + systray (hAmigaWnd, FALSE); + addnotifications (hAmigaWnd, FALSE); if (hMainWnd != hAmigaWnd) { ShowWindow (hMainWnd, SW_SHOWNORMAL); UpdateWindow (hMainWnd); diff --git a/od-win32/win32gui.c b/od-win32/win32gui.c index eb1aff04..c2fe2e9e 100644 --- a/od-win32/win32gui.c +++ b/od-win32/win32gui.c @@ -7595,7 +7595,8 @@ static void updatejoyport (HWND hDlg) SendDlgItemMessage (hDlg, id, CB_ADDSTRING, 0, (LPARAM)p1); total++; p1 = p2; - } else break; + } else + break; } for (j = 0; j < inputdevice_get_device_total (IDTYPE_JOYSTICK); j++, total++) SendDlgItemMessage (hDlg, id, CB_ADDSTRING, 0, (LPARAM)inputdevice_get_device_name(IDTYPE_JOYSTICK, j)); diff --git a/od-win32/winuae_msvc/winuae_msvc.vcproj b/od-win32/winuae_msvc/winuae_msvc.vcproj index 0b63883a..c7d21d80 100644 --- a/od-win32/winuae_msvc/winuae_msvc.vcproj +++ b/od-win32/winuae_msvc/winuae_msvc.vcproj @@ -2519,10 +2519,6 @@ RelativePath="..\hq2x32.obj" > - - diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index 23626e06..e8dd804c 100644 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -3,7 +3,52 @@ 1.4.6 will be the last Windows 98/ME compatible version. 1.5.0 will require Windows 2000 or newer. -Beta 1: +Beta 2: + +- sprites outside bitplane area (AGA feature) was not working in all + bitplane/sprite resolution combinations (broke when shres was added) +- relaxed Z3/RTG max RAM limits slightly (NOTE: it is 100% your + problem if you select too much RAM resulting in massive paging and + hd trashing) +- systray icon was not always removed +- fullscreen mode fallback fixes (145b18) +- do not flush directory filesystem cache if ACTION_MORE_CACHE is + called with dp_Arg == 0, return current number of buffers only +- ports-panel joystick/mouse friendly/guid name saved to config file, + no more changed selected devices if you save config, exit WinUAE, + insert or remove some input device(s) and then reload the config + +- joystick/mouse autoselection, input compatibility mode: + Press any unselected joystick's button 0 to "insert" it in + Amiga port 1 (joystick port) and button 1 to "insert" it in port 0 + (mouse port). Same with any unselected mouse except left mouse + button = port 0 (mouse port) and right mouse button = port 1 + (joystick port). + +- joystick/mouse autoselection, input configuration mode: + Differences compared to compatibility mode: + - because you can have mappings to multiple ports, device's first + port related mapping in input-panel is decided as the only port + number when doing remappings. When switching, only mappings that have + same port number are remapped to new port. Old mappings that already + have new port number will be remapped to old port number. Other + mappings are not changed. + - all other devices that are mapped to same port as new device will + be disabled + - only devices that are disabled (checkbox on right side of device + name is not ticked) are available for autoselection + - mouse switching is disabled if there are any "supermouse" mice + enabled (Windows mouse etc..) because it would cause total confusion. + Rawmouse or catweasel mouse are "safe". + + Note: joystick button 0 has to select port 1 because for example + Amiga joysticks in PC adapter may only have one button and generally + you want joysticks in port 1. + + Just insert any plug&play compatible joystick on the fly and press + first button. Can't get any easier! + +Beta 1: - ESS Mega (CDTV) "hidden" data track now reads properly on W2K/XP (uses SPTI READ_CD SCSI command if ReadFile() returns zero bytes. -- 2.47.3