mirror of
https://github.com/LIV2/WinUAE.git
synced 2025-12-06 00:12:52 +00:00
imported winuaesrc0991.zip
This commit is contained in:
parent
24c69bf4d0
commit
f3f8ed2876
11
audio.c
11
audio.c
@ -106,21 +106,21 @@ static uae_u32 right_word_saved[MAX_DELAY_BUFFER];
|
||||
static uae_u32 left_word_saved[MAX_DELAY_BUFFER];
|
||||
static int saved_ptr;
|
||||
|
||||
#define MIXED_STEREO_MAX 32
|
||||
static int mixed_on, mixed_stereo_size, mixed_mul1, mixed_mul2;
|
||||
|
||||
STATIC_INLINE void put_sound_word_right (uae_u32 w)
|
||||
{
|
||||
if (currprefs.sound_mixed_stereo) {
|
||||
if (mixed_on) {
|
||||
right_word_saved[saved_ptr] = w;
|
||||
return;
|
||||
}
|
||||
PUT_SOUND_WORD_RIGHT (w);
|
||||
}
|
||||
|
||||
#define MIXED_STEREO_MAX 32
|
||||
static int mixed_stereo_size, mixed_mul1, mixed_mul2;
|
||||
|
||||
STATIC_INLINE void put_sound_word_left (uae_u32 w)
|
||||
{
|
||||
if (currprefs.sound_mixed_stereo) {
|
||||
if (mixed_on) {
|
||||
uae_u32 rold, lold, rnew, lnew, tmp;
|
||||
|
||||
left_word_saved[saved_ptr] = w;
|
||||
@ -789,6 +789,7 @@ void check_prefs_changed_audio (void)
|
||||
mixed_mul1 = MIXED_STEREO_MAX / 2 - ((currprefs.sound_stereo_separation * 3) / 2);
|
||||
mixed_mul2 = MIXED_STEREO_MAX / 2 + ((currprefs.sound_stereo_separation * 3) / 2);
|
||||
mixed_stereo_size = currprefs.sound_mixed_stereo > 0 ? (1 << (currprefs.sound_mixed_stereo - 1)) - 1 : 0;
|
||||
mixed_on = (currprefs.sound_stereo_separation > 0 || currprefs.sound_mixed_stereo > 0) ? 1 : 0;
|
||||
|
||||
/* Select the right interpolation method. */
|
||||
if (sample_handler == sample16_handler
|
||||
|
||||
@ -999,7 +999,7 @@ void blitter_slowdown (int ddfstrt, int ddfstop, int totalcycles, int freecycles
|
||||
static int oddfstrt, oddfstop, ototal, ofree;
|
||||
static int slow;
|
||||
|
||||
if (!totalcycles)
|
||||
if (!totalcycles || ddfstrt < 0 || ddfstop < 0)
|
||||
return;
|
||||
if (ddfstrt != oddfstrt || ddfstop != oddfstop || totalcycles != ototal || ofree != freecycles) {
|
||||
int linecycles = ((ddfstop - ddfstrt + totalcycles - 1) / totalcycles) * totalcycles;
|
||||
@ -1013,7 +1013,7 @@ void blitter_slowdown (int ddfstrt, int ddfstop, int totalcycles, int freecycles
|
||||
if (dmacycles > freelinecycles)
|
||||
slow = dmacycles - freelinecycles;
|
||||
}
|
||||
if (blit_slowdown <= 0 || blitline)
|
||||
if (blit_slowdown < 0 || blitline)
|
||||
return;
|
||||
blit_slowdown += slow;
|
||||
blit_misscyclecounter += slow;
|
||||
|
||||
224
cfgfile.c
224
cfgfile.c
@ -24,6 +24,8 @@
|
||||
#include "savestate.h"
|
||||
#include "memory.h"
|
||||
#include "gui.h"
|
||||
#include "newcpu.h"
|
||||
#include "zfile.h"
|
||||
|
||||
#define CONFIG_BLEN 2560
|
||||
|
||||
@ -143,7 +145,8 @@ static const char *filtermode2[] = { "0x", "1x", "2x", "3x", "4x", 0 };
|
||||
static const char *obsolete[] = {
|
||||
"accuracy", "gfx_opengl", "gfx_32bit_blits", "32bit_blits",
|
||||
"gfx_immediate_blits", "gfx_ntsc", "win32", "gfx_filter_bits",
|
||||
"sound_pri_cutoff", "sound_pri_time", "sound_min_buff", 0 };
|
||||
"sound_pri_cutoff", "sound_pri_time", "sound_min_buff",
|
||||
"gfx_test_speed", "gfxlib_replacement", "enforcer", 0 };
|
||||
|
||||
#define UNEXPANDED "$(FILE_PATH)"
|
||||
|
||||
@ -175,18 +178,18 @@ char *cfgfile_subst_path (const char *path, const char *subst, const char *file)
|
||||
return my_strdup (file);
|
||||
}
|
||||
|
||||
void cfgfile_write (FILE *f, char *format,...)
|
||||
void cfgfile_write (struct zfile *f, char *format,...)
|
||||
{
|
||||
va_list parms;
|
||||
char tmp[CONFIG_BLEN];
|
||||
|
||||
va_start (parms, format);
|
||||
vsprintf (tmp, format, parms);
|
||||
fprintf (f, tmp);
|
||||
zfile_fwrite (tmp, 1, strlen (tmp), f);
|
||||
va_end (parms);
|
||||
}
|
||||
|
||||
void save_options (FILE *f, struct uae_prefs *p, int type)
|
||||
static void save_options (struct zfile *f, struct uae_prefs *p, int type)
|
||||
{
|
||||
struct strlist *sl;
|
||||
char *str;
|
||||
@ -1344,7 +1347,7 @@ end:
|
||||
|
||||
int cfgfile_save (struct uae_prefs *p, const char *filename, int type)
|
||||
{
|
||||
FILE *fh = fopen (filename, "w");
|
||||
struct zfile *fh = zfile_fopen (filename, "w");
|
||||
write_log ("save config '%s'\n", filename);
|
||||
if (! fh)
|
||||
return 0;
|
||||
@ -1352,7 +1355,7 @@ int cfgfile_save (struct uae_prefs *p, const char *filename, int type)
|
||||
if (!type)
|
||||
type = CONFIG_TYPE_HARDWARE | CONFIG_TYPE_HOST;
|
||||
save_options (fh, p, type);
|
||||
fclose (fh);
|
||||
zfile_fclose (fh);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1759,8 +1762,209 @@ void cfgfile_addcfgparam (char *line)
|
||||
temp_lines = u;
|
||||
}
|
||||
|
||||
static int cmdlineparser (char *s, char *outp[], int max)
|
||||
{
|
||||
int j, cnt = 0;
|
||||
int slash = 0;
|
||||
int quote = 0;
|
||||
char tmp1[MAX_DPATH];
|
||||
char *prev;
|
||||
int doout;
|
||||
|
||||
uae_u32 cfgfile_uaelib(int mode, uae_u32 name, uae_u32 dst, uae_u32 maxlen)
|
||||
doout = 0;
|
||||
prev = s;
|
||||
j = 0;
|
||||
while (cnt < max) {
|
||||
char c = *s++;
|
||||
if (!c)
|
||||
break;
|
||||
if (c < 32)
|
||||
continue;
|
||||
if (c == '\\')
|
||||
slash = 1;
|
||||
if (!slash && c == '"') {
|
||||
if (quote) {
|
||||
quote = 0;
|
||||
doout = 1;
|
||||
} else {
|
||||
quote = 1;
|
||||
j = -1;
|
||||
}
|
||||
}
|
||||
if (!quote && c == ' ')
|
||||
doout = 1;
|
||||
if (!doout) {
|
||||
if (j >= 0) {
|
||||
tmp1[j] = c;
|
||||
tmp1[j + 1] = 0;
|
||||
}
|
||||
j++;
|
||||
}
|
||||
if (doout) {
|
||||
outp[cnt++] = my_strdup (tmp1);
|
||||
tmp1[0] = 0;
|
||||
doout = 0;
|
||||
j = 0;
|
||||
}
|
||||
slash = 0;
|
||||
}
|
||||
if (j > 0 && cnt < max)
|
||||
outp[cnt++] = my_strdup (tmp1);
|
||||
return cnt;
|
||||
}
|
||||
|
||||
#define UAELIB_MAX_PARSE 100
|
||||
uae_u32 cfgfile_uaelib_modify (uae_u32 index, uae_u32 parms, uae_u32 size, uae_u32 out, uae_u32 outsize)
|
||||
{
|
||||
char *p;
|
||||
char *argc[UAELIB_MAX_PARSE];
|
||||
int argv, i;
|
||||
uae_u32 err;
|
||||
uae_u8 zero = 0;
|
||||
static struct zfile *configstore;
|
||||
static char *configsearch;
|
||||
static int configsearchfound;
|
||||
|
||||
err = 0;
|
||||
argv = 0;
|
||||
p = 0;
|
||||
if (index != 0xffffffff) {
|
||||
if (!configstore) {
|
||||
err = 20;
|
||||
goto end;
|
||||
}
|
||||
if (configsearch) {
|
||||
char tmp[CONFIG_BLEN];
|
||||
int j = 0;
|
||||
char *in = configsearch;
|
||||
int inlen = strlen (configsearch);
|
||||
int joker = 0;
|
||||
|
||||
if (in[inlen - 1] == '*') {
|
||||
joker = 1;
|
||||
inlen--;
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
uae_u8 b = 0;
|
||||
|
||||
if (zfile_fread (&b, 1, 1, configstore) != 1) {
|
||||
err = 10;
|
||||
if (configsearch)
|
||||
err = 5;
|
||||
if (configsearchfound)
|
||||
err = 0;
|
||||
goto end;
|
||||
}
|
||||
if (j >= sizeof (tmp) - 1)
|
||||
j = sizeof (tmp) - 1;
|
||||
if (b == 0) {
|
||||
err = 10;
|
||||
if (configsearch)
|
||||
err = 5;
|
||||
if (configsearchfound)
|
||||
err = 0;
|
||||
goto end;
|
||||
}
|
||||
if (b == '\n') {
|
||||
if (configsearch && !strncmp (tmp, in, inlen) &&
|
||||
((inlen > 0 && strlen (tmp) > inlen && tmp[inlen] == '=') || (joker))) {
|
||||
char *p;
|
||||
if (joker)
|
||||
p = tmp - 1;
|
||||
else
|
||||
p = strchr (tmp, '=');
|
||||
if (p) {
|
||||
for (i = 0; i < outsize - 1; i++) {
|
||||
uae_u8 b = *++p;
|
||||
put_byte (out + i, b);
|
||||
put_byte (out + i + 1, 0);
|
||||
if (!b)
|
||||
break;
|
||||
}
|
||||
}
|
||||
err = 0xffffffff;
|
||||
configsearchfound++;
|
||||
goto end;
|
||||
}
|
||||
index--;
|
||||
j = 0;
|
||||
} else {
|
||||
tmp[j++] = b;
|
||||
tmp[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
err = 0xffffffff;
|
||||
for (i = 0; i < outsize - 1; i++) {
|
||||
uae_u8 b = 0;
|
||||
if (zfile_fread (&b, 1, 1, configstore) != 1)
|
||||
err = 0;
|
||||
if (b == 0)
|
||||
err = 0;
|
||||
if (b == '\n')
|
||||
b = 0;
|
||||
put_byte (out + i, b);
|
||||
put_byte (out + i + 1, 0);
|
||||
if (!b)
|
||||
break;
|
||||
}
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (size > 10000)
|
||||
return 10;
|
||||
p = xmalloc (size + 1);
|
||||
if (!p)
|
||||
return 10;
|
||||
for (i = 0; i < size; i++) {
|
||||
p[i] = get_byte (parms + i);
|
||||
if (p[i] == 10 || p[i] == 13 || p[i] == 0)
|
||||
break;
|
||||
}
|
||||
p[i] = 0;
|
||||
argv = cmdlineparser (p, argc, UAELIB_MAX_PARSE);
|
||||
|
||||
if (argv <= 1 && index == 0xffffffff) {
|
||||
zfile_fclose (configstore);
|
||||
xfree (configsearch);
|
||||
configstore = zfile_fopen_empty ("configstore", 50000);
|
||||
configsearch = NULL;
|
||||
if (argv > 0 && strlen (argc[0]) > 0)
|
||||
configsearch = my_strdup (argc[0]);
|
||||
if (!configstore) {
|
||||
err = 20;
|
||||
goto end;
|
||||
}
|
||||
zfile_fseek (configstore, 0, SEEK_SET);
|
||||
save_options (configstore, &currprefs, 0);
|
||||
zfile_fwrite (&zero, 1, 1, configstore);
|
||||
zfile_fseek (configstore, 0, SEEK_SET);
|
||||
err = 0xffffffff;
|
||||
configsearchfound = 0;
|
||||
goto end;
|
||||
}
|
||||
|
||||
for (i = 0; i < argv; i++) {
|
||||
if (i + 2 <= argv) {
|
||||
if (!inputdevice_uaelib (argc[i], argc[i + 1])) {
|
||||
if (!cfgfile_parse_option (&changed_prefs, argc[i], argc[i + 1], 0)) {
|
||||
err = 5;
|
||||
break;
|
||||
}
|
||||
}
|
||||
set_special (SPCFLAG_BRK);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
end:
|
||||
for (i = 0; i < argv; i++)
|
||||
xfree (argc[i]);
|
||||
xfree (p);
|
||||
return err;
|
||||
}
|
||||
|
||||
uae_u32 cfgfile_uaelib (int mode, uae_u32 name, uae_u32 dst, uae_u32 maxlen)
|
||||
{
|
||||
char tmp[CONFIG_BLEN];
|
||||
int i;
|
||||
@ -1886,7 +2090,7 @@ void default_prefs (struct uae_prefs *p, int type)
|
||||
p->produce_sound = 3;
|
||||
p->sound_stereo = 1;
|
||||
p->sound_stereo_separation = 7;
|
||||
p->sound_mixed_stereo = -1;
|
||||
p->sound_mixed_stereo = 0;
|
||||
p->sound_bits = DEFAULT_SOUND_BITS;
|
||||
p->sound_freq = DEFAULT_SOUND_FREQ;
|
||||
p->sound_maxbsiz = DEFAULT_SOUND_MAXB;
|
||||
@ -2055,7 +2259,8 @@ static void buildin_default_prefs (struct uae_prefs *p)
|
||||
p->sound_filter = 1;
|
||||
p->sound_stereo = 1;
|
||||
p->sound_stereo_separation = 7;
|
||||
p->sound_mixed_stereo = -1;
|
||||
p->sound_mixed_stereo = 0;
|
||||
p->cachesize = 0;
|
||||
|
||||
p->chipmem_size = 0x00080000;
|
||||
p->bogomem_size = 0x00080000;
|
||||
@ -2103,6 +2308,7 @@ static void set_68000_compa (struct uae_prefs *p, int compa)
|
||||
p->fast_copper = 0;
|
||||
break;
|
||||
case 1:
|
||||
p->fast_copper = 0;
|
||||
break;
|
||||
case 2:
|
||||
p->cpu_compatible = 0;
|
||||
|
||||
7
custom.c
7
custom.c
@ -743,11 +743,13 @@ STATIC_INLINE void compute_delay_offset (void)
|
||||
delayoffset = 8;
|
||||
else if (delayoffset == 16) /* Overkill AGA */
|
||||
delayoffset = 48;
|
||||
else if (delayoffset == 24) /* AB 2 */
|
||||
delayoffset = 8;
|
||||
else if (delayoffset == 32)
|
||||
delayoffset = 32;
|
||||
else if (delayoffset == 48) /* Pinball Illusions AGA, ingame */
|
||||
delayoffset = 16;
|
||||
else
|
||||
else /* what about 40 and 56? */
|
||||
delayoffset = 0;
|
||||
}
|
||||
|
||||
@ -4332,7 +4334,8 @@ static void hsync_handler (void)
|
||||
last_custom_value = 0xffff;
|
||||
|
||||
if (!currprefs.blitter_cycle_exact && bltstate != BLT_done && dmaen (DMA_BITPLANE) && diwstate == DIW_waiting_stop)
|
||||
blitter_slowdown (ddfstrt, ddfstop, cycle_diagram_total_cycles[fmode][GET_RES (bplcon0)][GET_PLANES (bplcon0)],
|
||||
blitter_slowdown (thisline_decision.plfleft, thisline_decision.plfright - (16 << fetchmode),
|
||||
cycle_diagram_total_cycles[fmode][GET_RES (bplcon0)][GET_PLANES (bplcon0)],
|
||||
cycle_diagram_free_cycles[fmode][GET_RES (bplcon0)][GET_PLANES (bplcon0)]);
|
||||
|
||||
if (currprefs.produce_sound)
|
||||
|
||||
@ -1346,7 +1346,7 @@ static void pfield_expand_dp_bplcon (void)
|
||||
|
||||
brdsprt = (currprefs.chipset_mask & CSMASK_AGA) && (dp_for_drawing->bplcon0 & 1) && (dp_for_drawing->bplcon3 & 0x02);
|
||||
/* FIXME: we must update top and bottom borders when BRDBLANK changes */
|
||||
brdblank = (currprefs.chipset_mask & CSMASK_AGA) && (dp_for_drawing->bplcon0 & 1) && (dp_for_drawing->bplcon3 & 0x20);
|
||||
brdblank = (currprefs.chipset_mask & CSMASK_ECS_DENISE) && (dp_for_drawing->bplcon0 & 1) && (dp_for_drawing->bplcon3 & 0x20);
|
||||
if (brdblank)
|
||||
brdsprt = 0;
|
||||
#endif
|
||||
|
||||
@ -14,6 +14,7 @@
|
||||
#include "memory.h"
|
||||
#include "custom.h"
|
||||
#include "newcpu.h"
|
||||
#include "uae.h"
|
||||
#include "enforcer.h"
|
||||
|
||||
/* Configurable options */
|
||||
@ -352,6 +353,7 @@ static void enforcer_display_hit(const char *addressmode, uae_u32 pc, uaecptr ad
|
||||
|
||||
console_out(enforcer_buf);
|
||||
write_log(enforcer_buf);
|
||||
sleep_millis (5);
|
||||
|
||||
enforcer_hit = 0;
|
||||
flashscreen = 30;
|
||||
|
||||
69
filesys.c
69
filesys.c
@ -83,36 +83,6 @@ static void aino_test_init (a_inode *aino)
|
||||
#endif
|
||||
}
|
||||
|
||||
static long dos_errno(void)
|
||||
{
|
||||
int e = errno;
|
||||
|
||||
switch (e) {
|
||||
case ENOMEM: return ERROR_NO_FREE_STORE;
|
||||
case EEXIST: return ERROR_OBJECT_EXISTS;
|
||||
case EACCES: return ERROR_WRITE_PROTECTED;
|
||||
case ENOENT: return ERROR_OBJECT_NOT_AROUND;
|
||||
case ENOTDIR: return ERROR_OBJECT_WRONG_TYPE;
|
||||
case ENOSPC: return ERROR_DISK_IS_FULL;
|
||||
case EBUSY: return ERROR_OBJECT_IN_USE;
|
||||
case EISDIR: return ERROR_OBJECT_WRONG_TYPE;
|
||||
#if defined(ETXTBSY)
|
||||
case ETXTBSY: return ERROR_OBJECT_IN_USE;
|
||||
#endif
|
||||
#if defined(EROFS)
|
||||
case EROFS: return ERROR_DISK_WRITE_PROTECTED;
|
||||
#endif
|
||||
#if defined(ENOTEMPTY)
|
||||
#if ENOTEMPTY != EEXIST
|
||||
case ENOTEMPTY: return ERROR_DIRECTORY_NOT_EMPTY;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
default:
|
||||
TRACE(("Unimplemented error %s\n", strerror(e)));
|
||||
return ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
}
|
||||
|
||||
uaecptr filesys_initcode;
|
||||
static uae_u32 fsdevname, filesys_configdev;
|
||||
@ -403,32 +373,26 @@ int sprintf_filesys_unit (struct uaedev_mount_info *mountinfo, char *buffer, int
|
||||
}
|
||||
|
||||
void write_filesys_config (struct uaedev_mount_info *mountinfo,
|
||||
const char *unexpanded, const char *default_path, FILE *f)
|
||||
const char *unexpanded, const char *default_path, struct zfile *f)
|
||||
{
|
||||
UnitInfo *uip = mountinfo->ui;
|
||||
int i;
|
||||
char tmp[MAX_DPATH];
|
||||
|
||||
for (i = 0; i < mountinfo->num_units; i++) {
|
||||
char *str;
|
||||
str = cfgfile_subst_path (default_path, unexpanded, uip[i].rootdir);
|
||||
if (uip[i].volname != 0) {
|
||||
fprintf (f, "filesystem2=%s,%s:%s:%s,%d\n", uip[i].readonly ? "ro" : "rw",
|
||||
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);
|
||||
#if 0
|
||||
fprintf (f, "filesystem=%s,%s:%s\n", uip[i].readonly ? "ro" : "rw",
|
||||
uip[i].volname, str);
|
||||
#endif
|
||||
zfile_fputs (f, tmp);
|
||||
} else {
|
||||
fprintf (f, "hardfile2=%s,%s:%s,%d,%d,%d,%d,%d,%s\n",
|
||||
sprintf (tmp, "hardfile2=%s,%s:%s,%d,%d,%d,%d,%d,%s\n",
|
||||
uip[i].readonly ? "ro" : "rw",
|
||||
uip[i].devname ? uip[i].devname : "", str,
|
||||
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 : "");
|
||||
#if 0
|
||||
fprintf (f, "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);
|
||||
#endif
|
||||
zfile_fputs (f, tmp);
|
||||
}
|
||||
xfree (str);
|
||||
}
|
||||
@ -1685,6 +1649,12 @@ action_add_notify (Unit *unit, dpacket packet)
|
||||
name = my_strdup (char1 (get_long (nr + 4)));
|
||||
flags = get_long (nr + 12);
|
||||
|
||||
if (!(flags & (NRF_SEND_MESSAGE | NRF_SEND_SIGNAL))) {
|
||||
PUT_PCK_RES1 (packet, DOS_FALSE);
|
||||
PUT_PCK_RES2 (packet, ERROR_BAD_NUMBER);
|
||||
return;
|
||||
}
|
||||
|
||||
#if 0
|
||||
write_log ("Notify:\n");
|
||||
write_log ("nr_Name '%s'\n", char1 (get_long (nr + 0)));
|
||||
@ -2123,6 +2093,7 @@ static void action_examine_next (Unit *unit, dpacket packet)
|
||||
uae_u32 uniq;
|
||||
|
||||
TRACE(("ACTION_EXAMINE_NEXT(0x%lx,0x%lx)\n", lock, info));
|
||||
gui_hd_led (1);
|
||||
DUMPLOCK(unit, lock);
|
||||
|
||||
if (lock != 0)
|
||||
@ -2315,7 +2286,7 @@ action_fh_from_lock (Unit *unit, dpacket packet)
|
||||
|
||||
fd = my_open (aino->nname, openmode | O_BINARY);
|
||||
|
||||
if (fd < 0) {
|
||||
if (fd == NULL) {
|
||||
PUT_PCK_RES1 (packet, DOS_FALSE);
|
||||
PUT_PCK_RES2 (packet, dos_errno());
|
||||
return;
|
||||
@ -2324,7 +2295,7 @@ action_fh_from_lock (Unit *unit, dpacket packet)
|
||||
k->fd = fd;
|
||||
k->aino = aino;
|
||||
|
||||
put_long (fh+36, k->uniq);
|
||||
put_long (fh + 36, k->uniq);
|
||||
/* I don't think I need to play with shlock count here, because I'm
|
||||
opening from an existing lock ??? */
|
||||
|
||||
@ -2548,6 +2519,7 @@ action_seek (Unit *unit, dpacket packet)
|
||||
if (mode < 0) whence = SEEK_SET;
|
||||
|
||||
TRACE(("ACTION_SEEK(%s,%d,%d)\n", k->aino->nname, pos, mode));
|
||||
gui_hd_led (1);
|
||||
|
||||
old = my_lseek (k->fd, 0, SEEK_CUR);
|
||||
{
|
||||
@ -2607,6 +2579,7 @@ action_set_protect (Unit *unit, dpacket packet)
|
||||
PUT_PCK_RES1 (packet, DOS_TRUE);
|
||||
}
|
||||
notify_check (unit, a);
|
||||
gui_hd_led (1);
|
||||
}
|
||||
|
||||
static void action_set_comment (Unit * unit, dpacket packet)
|
||||
@ -2649,6 +2622,7 @@ static void action_set_comment (Unit * unit, dpacket packet)
|
||||
a->comment = commented;
|
||||
a->dirty = 1;
|
||||
notify_check (unit, a);
|
||||
gui_hd_led (1);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -2834,6 +2808,7 @@ action_create_dir (Unit *unit, dpacket packet)
|
||||
notify_check (unit, aino);
|
||||
updatedirtime (aino, 0);
|
||||
PUT_PCK_RES1 (packet, make_lock (unit, aino->uniq, -2) >> 2);
|
||||
gui_hd_led (1);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -2883,6 +2858,7 @@ action_set_file_size (Unit *unit, dpacket packet)
|
||||
return;
|
||||
}
|
||||
|
||||
gui_hd_led (1);
|
||||
k->notifyactive = 1;
|
||||
/* If any open files have file pointers beyond this size, truncate only
|
||||
* so far that these pointers do not become invalid. */
|
||||
@ -2970,6 +2946,7 @@ action_delete_object (Unit *unit, dpacket packet)
|
||||
delete_aino (unit, a);
|
||||
}
|
||||
PUT_PCK_RES1 (packet, DOS_TRUE);
|
||||
gui_hd_led (1);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -3001,6 +2978,7 @@ action_set_date (Unit *unit, dpacket packet)
|
||||
} else
|
||||
PUT_PCK_RES1 (packet, DOS_TRUE);
|
||||
notify_check (unit, a);
|
||||
gui_hd_led (1);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -3096,7 +3074,7 @@ action_rename_object (Unit *unit, dpacket packet)
|
||||
k1->fd = my_open (a2->nname, mode);
|
||||
write_log ("restoring new handle '%s' %d\n", a2->nname, k1->dosmode);
|
||||
}
|
||||
if (k1->fd < 0) {
|
||||
if (k1->fd == NULL) {
|
||||
write_log ("relocking failed '%s' -> '%s'\n", a1->nname, a2->nname);
|
||||
free_key (unit, k1);
|
||||
} else {
|
||||
@ -3133,6 +3111,7 @@ action_rename_object (Unit *unit, dpacket packet)
|
||||
if (a2->elock > 0 || a2->shlock > 0 || wehavekeys > 0)
|
||||
de_recycle_aino (unit, a2);
|
||||
PUT_PCK_RES1 (packet, DOS_TRUE);
|
||||
gui_hd_led (1);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
37
fpp.c
37
fpp.c
@ -24,6 +24,11 @@
|
||||
|
||||
#if 1
|
||||
|
||||
STATIC_INLINE int isinrom (void)
|
||||
{
|
||||
return (munge24 (m68k_getpc ()) & 0xFFF80000) == 0xF80000;
|
||||
}
|
||||
|
||||
#define DEBUG_FPP 0
|
||||
|
||||
#define FFLAG_Z 0x4000
|
||||
@ -366,6 +371,10 @@ STATIC_INLINE int put_fp_value (fptype value, uae_u32 opcode, uae_u16 extra)
|
||||
static int sz1[8] = { 4, 4, 12, 12, 2, 8, 1, 0 };
|
||||
static int sz2[8] = { 4, 4, 12, 12, 2, 8, 2, 0 };
|
||||
|
||||
#if DEBUG_FPP
|
||||
if (!isinrom ())
|
||||
write_log ("PUTFP: %f %04.4X %04.4X\n", value, opcode, extra);
|
||||
#endif
|
||||
if ((extra & 0x4000) == 0) {
|
||||
regs.fp[(extra >> 10) & 7] = value;
|
||||
return 1;
|
||||
@ -635,8 +644,8 @@ void fdbcc_opp (uae_u32 opcode, uae_u16 extra)
|
||||
int cc;
|
||||
|
||||
#if DEBUG_FPP
|
||||
printf ("fdbcc_opp at %08lx\n", m68k_getpc ());
|
||||
fflush (stdout);
|
||||
if (!isinrom ())
|
||||
write_log ("fdbcc_opp at %08lx\n", m68k_getpc ());
|
||||
#endif
|
||||
cc = fpp_cond (opcode, extra & 0x3f);
|
||||
if (cc == -1) {
|
||||
@ -658,8 +667,8 @@ void fscc_opp (uae_u32 opcode, uae_u16 extra)
|
||||
int cc;
|
||||
|
||||
#if DEBUG_FPP
|
||||
printf ("fscc_opp at %08lx\n", m68k_getpc ());
|
||||
fflush (stdout);
|
||||
if (!isinrom ())
|
||||
write_log ("fscc_opp at %08lx\n", m68k_getpc ());
|
||||
#endif
|
||||
cc = fpp_cond (opcode, extra & 0x3f);
|
||||
if (cc == -1) {
|
||||
@ -681,8 +690,8 @@ void ftrapcc_opp (uae_u32 opcode, uaecptr oldpc)
|
||||
int cc;
|
||||
|
||||
#if DEBUG_FPP
|
||||
printf ("ftrapcc_opp at %08lx\n", m68k_getpc ());
|
||||
fflush (stdout);
|
||||
if (!isinrom ())
|
||||
write_log ("ftrapcc_opp at %08lx\n", m68k_getpc ());
|
||||
#endif
|
||||
cc = fpp_cond (opcode, opcode & 0x3f);
|
||||
if (cc == -1) {
|
||||
@ -698,8 +707,8 @@ void fbcc_opp (uae_u32 opcode, uaecptr pc, uae_u32 extra)
|
||||
int cc;
|
||||
|
||||
#if DEBUG_FPP
|
||||
printf ("fbcc_opp at %08lx\n", m68k_getpc ());
|
||||
fflush (stdout);
|
||||
if (!isinrom ())
|
||||
write_log ("fbcc_opp at %08lx\n", m68k_getpc ());
|
||||
#endif
|
||||
cc = fpp_cond (opcode, opcode & 0x3f);
|
||||
if (cc == -1) {
|
||||
@ -722,8 +731,8 @@ void fsave_opp (uae_u32 opcode)
|
||||
|
||||
|
||||
#if DEBUG_FPP
|
||||
printf ("fsave_opp at %08lx\n", m68k_getpc ());
|
||||
fflush (stdout);
|
||||
if (!isinrom ())
|
||||
write_log ("fsave_opp at %08lx\n", m68k_getpc ());
|
||||
#endif
|
||||
if (get_fp_ad (opcode, &ad) == 0) {
|
||||
m68k_setpc (m68k_getpc () - 2);
|
||||
@ -774,8 +783,8 @@ void frestore_opp (uae_u32 opcode)
|
||||
int incr = (opcode & 0x38) == 0x20 ? -1 : 1;
|
||||
|
||||
#if DEBUG_FPP
|
||||
printf ("frestore_opp at %08lx\n", m68k_getpc ());
|
||||
fflush (stdout);
|
||||
if (!isinrom ())
|
||||
write_log ("frestore_opp at %08lx\n", m68k_getpc ());
|
||||
#endif
|
||||
if (get_fp_ad (opcode, &ad) == 0) {
|
||||
m68k_setpc (m68k_getpc () - 2);
|
||||
@ -850,8 +859,8 @@ void fpp_opp (uae_u32 opcode, uae_u16 extra)
|
||||
fptype src;
|
||||
|
||||
#if DEBUG_FPP
|
||||
printf ("FPP %04lx %04x at %08lx\n", opcode & 0xffff, extra & 0xffff, m68k_getpc () - 4);
|
||||
fflush (stdout);
|
||||
if (!isinrom ())
|
||||
write_log ("FPP %04lx %04x at %08lx\n", opcode & 0xffff, extra, m68k_getpc () - 4);
|
||||
#endif
|
||||
switch ((extra >> 13) & 0x7) {
|
||||
case 3:
|
||||
|
||||
@ -60,7 +60,7 @@ extern int kill_filesys_unit (struct uaedev_mount_info *mountinfo, int);
|
||||
extern int move_filesys_unit (struct uaedev_mount_info *mountinfo, int nr, int to);
|
||||
extern int sprintf_filesys_unit (struct uaedev_mount_info *mountinfo, char *buffer, int num);
|
||||
extern void write_filesys_config (struct uaedev_mount_info *mountinfo, const char *unexpanded,
|
||||
const char *defaultpath, FILE *f);
|
||||
const char *defaultpath, struct zfile *f);
|
||||
|
||||
extern struct uaedev_mount_info *alloc_mountinfo (void);
|
||||
extern struct uaedev_mount_info *dup_mountinfo (struct uaedev_mount_info *);
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
#endif
|
||||
|
||||
/* AmigaOS errors */
|
||||
#define ERROR_BAD_NUMBER 6
|
||||
#define ERROR_NO_FREE_STORE 103
|
||||
#define ERROR_OBJECT_IN_USE 202
|
||||
#define ERROR_OBJECT_EXISTS 203
|
||||
@ -129,5 +130,5 @@ extern unsigned int my_lseek (void*, unsigned int, int);
|
||||
extern unsigned int my_read (void*, void*, unsigned int);
|
||||
extern unsigned int my_write (void*, void*, unsigned int);
|
||||
extern int my_truncate (const char *name, long int len);
|
||||
|
||||
extern int dos_errno (void);
|
||||
|
||||
|
||||
@ -118,7 +118,7 @@ extern void inputdevice_vsync (void);
|
||||
extern void inputdevice_hsync (void);
|
||||
extern void inputdevice_reset (void);
|
||||
|
||||
extern void write_inputdevice_config (struct uae_prefs *p, FILE *f);
|
||||
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);
|
||||
|
||||
@ -151,3 +151,4 @@ extern int jsem_isjoy (int port, struct uae_prefs *p);
|
||||
extern int jsem_ismouse (int port, struct uae_prefs *p);
|
||||
extern int jsem_iskbdjoy (int port, struct uae_prefs *p);
|
||||
|
||||
extern int inputdevice_uaelib (char*, char*);
|
||||
|
||||
@ -108,8 +108,7 @@ extern struct regstruct
|
||||
uae_u32 kick_mask;
|
||||
uae_u32 address_space_mask;
|
||||
|
||||
uae_u16 irc;
|
||||
uae_u16 ir;
|
||||
uae_u16 irc, ir;
|
||||
|
||||
uae_u8 panic;
|
||||
uae_u32 panic_pc, panic_addr;
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
|
||||
#define UAEMAJOR 0
|
||||
#define UAEMINOR 9
|
||||
#define UAESUBREV 90
|
||||
#define UAESUBREV 91
|
||||
|
||||
typedef enum { KBD_LANG_US, KBD_LANG_DK, KBD_LANG_DE, KBD_LANG_SE, KBD_LANG_FR, KBD_LANG_IT, KBD_LANG_ES } KbdLang;
|
||||
|
||||
@ -235,8 +235,8 @@ struct uae_prefs {
|
||||
|
||||
/* Contains the filename of .uaerc */
|
||||
extern char optionsfile[];
|
||||
extern void save_options (FILE *, struct uae_prefs *, int);
|
||||
extern void cfgfile_write (FILE *f, char *format,...);
|
||||
extern void save_options (struct zfile *, struct uae_prefs *, int);
|
||||
extern void cfgfile_write (struct zfile *, char *format,...);
|
||||
|
||||
extern void default_prefs (struct uae_prefs *, int);
|
||||
extern void discard_prefs (struct uae_prefs *, int);
|
||||
@ -250,9 +250,9 @@ extern int cfgfile_string (char *option, char *value, char *name, char *location
|
||||
extern char *cfgfile_subst_path (const char *path, const char *subst, const char *file);
|
||||
|
||||
extern int target_parse_option (struct uae_prefs *, char *option, char *value);
|
||||
extern void target_save_options (FILE *, struct uae_prefs *);
|
||||
extern void target_save_options (struct zfile*, struct uae_prefs *);
|
||||
extern void target_default_options (struct uae_prefs *, int type);
|
||||
extern int target_cfgfile_load (struct uae_prefs *, char *filename, int type);
|
||||
extern int target_cfgfile_load (struct uae_prefs *, char *filename, int type, int isdefault);
|
||||
|
||||
extern int cfgfile_load (struct uae_prefs *p, const char *filename, int *type, int ignorelink);
|
||||
extern int cfgfile_save (struct uae_prefs *, const char *filename, int);
|
||||
@ -260,7 +260,8 @@ extern void cfgfile_parse_line (struct uae_prefs *p, char *, int);
|
||||
extern int cfgfile_parse_option (struct uae_prefs *p, char *option, char *value, int);
|
||||
extern int cfgfile_get_description (const char *filename, char *description, char *hostlink, char *hardwarelink, int *type);
|
||||
extern void cfgfile_show_usage (void);
|
||||
extern uae_u32 cfgfile_uaelib(int mode, uae_u32 name, uae_u32 dst, uae_u32 maxlen);
|
||||
extern uae_u32 cfgfile_uaelib (int mode, uae_u32 name, uae_u32 dst, uae_u32 maxlen);
|
||||
extern uae_u32 cfgfile_uaelib_modify (uae_u32 mode, uae_u32 parms, uae_u32 size, uae_u32 out, uae_u32 outsize);
|
||||
extern void cfgfile_addcfgparam (char *);
|
||||
extern int build_in_prefs (struct uae_prefs *p, int model, int config, int compa, int romcheck);
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ extern void real_main (int, char **);
|
||||
extern void usage (void);
|
||||
extern void parse_cmdline (int argc, char **argv);
|
||||
extern void sleep_millis (int ms);
|
||||
|
||||
extern int sleep_resolution;
|
||||
|
||||
extern void uae_reset (int);
|
||||
extern void uae_quit (void);
|
||||
|
||||
@ -19,6 +19,7 @@ extern int zfile_fseek (struct zfile *z, long offset, int mode);
|
||||
extern long zfile_ftell (struct zfile *z);
|
||||
extern size_t zfile_fread (void *b, size_t l1, size_t l2, struct zfile *z);
|
||||
extern size_t zfile_fwrite (void *b, size_t l1, size_t l2, struct zfile *z);
|
||||
extern size_t zfile_fputs (struct zfile *z, char *s);
|
||||
extern void zfile_exit (void);
|
||||
extern int execute_command (char *);
|
||||
extern int zfile_iscompressed (struct zfile *z);
|
||||
|
||||
@ -119,6 +119,19 @@ static int isdevice (struct uae_input_device *id)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int inputdevice_uaelib (char *s, char *parm)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 1; events[i].name; i++) {
|
||||
if (!strcmp (s, events[i].confname)) {
|
||||
handle_input_event (i, atol (parm), 1, 0);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct uae_input_device *joysticks;
|
||||
static struct uae_input_device *mice;
|
||||
static struct uae_input_device *keyboards;
|
||||
@ -155,13 +168,13 @@ struct input_queue_struct {
|
||||
};
|
||||
static struct input_queue_struct input_queue[INPUT_QUEUE_SIZE];
|
||||
|
||||
static void out_config (FILE *f, int id, int num, char *s1, char *s2)
|
||||
static void out_config (struct zfile *f, int id, int num, char *s1, char *s2)
|
||||
{
|
||||
cfgfile_write (f, "input.%d.%s%d=%s\n", id, s1, num, s2);
|
||||
//write_log ("-input.%d.%s%d=%s\n", id, s1, num, s2);
|
||||
}
|
||||
|
||||
static void write_config2 (FILE *f, int idnum, int i, int offset, char *tmp1, struct uae_input_device *id)
|
||||
static void write_config2 (struct zfile *f, int idnum, int i, int offset, char *tmp1, struct uae_input_device *id)
|
||||
{
|
||||
char tmp2[200], *p;
|
||||
int event, got, j, k;
|
||||
@ -191,7 +204,7 @@ static void write_config2 (FILE *f, int idnum, int i, int offset, char *tmp1, st
|
||||
out_config (f, idnum, i, tmp1, tmp2);
|
||||
}
|
||||
|
||||
static void write_config (FILE *f, int idnum, int devnum, char *name, struct uae_input_device *id, struct uae_input_device2 *id2)
|
||||
static void write_config (struct zfile *f, int idnum, int devnum, char *name, struct uae_input_device *id, struct uae_input_device2 *id2)
|
||||
{
|
||||
char tmp1[100];
|
||||
int i;
|
||||
@ -216,7 +229,7 @@ static void kbrlabel (char *s)
|
||||
}
|
||||
}
|
||||
|
||||
static void write_kbr_config (FILE *f, int idnum, int devnum, struct uae_input_device *kbr)
|
||||
static void write_kbr_config (struct zfile *f, int idnum, int devnum, struct uae_input_device *kbr)
|
||||
{
|
||||
char tmp1[200], tmp2[200], tmp3[200], *p;
|
||||
int i, j, k, event, skip;
|
||||
@ -275,7 +288,7 @@ static void write_kbr_config (FILE *f, int idnum, int devnum, struct uae_input_d
|
||||
}
|
||||
}
|
||||
|
||||
void write_inputdevice_config (struct uae_prefs *p, FILE *f)
|
||||
void write_inputdevice_config (struct uae_prefs *p, struct zfile *f)
|
||||
{
|
||||
int i, id;
|
||||
|
||||
|
||||
7
keybuf.c
7
keybuf.c
@ -24,7 +24,7 @@
|
||||
#include "custom.h"
|
||||
#include "savestate.h"
|
||||
|
||||
static int fakestate[3][6] = { { 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0 } };
|
||||
static int fakestate[4][6] = { { 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0 } };
|
||||
|
||||
static int *fs_np;
|
||||
static int *fs_ck;
|
||||
@ -92,7 +92,7 @@ void record_key (int kc)
|
||||
case AK_LF: fs = 1; fs_ck[1] = !(kc & 1); break;
|
||||
case AK_RT: fs = 1; fs_ck[2] = !(kc & 1); break;
|
||||
case AK_DN: fs = 1; fs_ck[3] = !(kc & 1); break;
|
||||
case AK_RCTRL: fs = 1; fs_ck[4] = !(kc & 1); break;
|
||||
case AK_RCTRL: case AK_RALT: fs = 1; fs_ck[4] = !(kc & 1); break;
|
||||
case AK_RSH: fs = 1; fs_ck[5] = !(kc & 1); break;
|
||||
}
|
||||
}
|
||||
@ -142,7 +142,8 @@ void joystick_setting_changed (void)
|
||||
fs_se = fakestate[0];
|
||||
else if (JSEM_ISSOMEWHEREELSE (1, &currprefs))
|
||||
fs_se = fakestate[1];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void keybuf_init (void)
|
||||
{
|
||||
|
||||
8
main.c
8
main.c
@ -389,7 +389,7 @@ static void parse_cmdline (int argc, char **argv)
|
||||
if (i + 1 < argc)
|
||||
i++;
|
||||
} else if (strncmp (argv[i], "-config=", 8) == 0) {
|
||||
target_cfgfile_load (&currprefs, argv[i] + 8, 0);
|
||||
target_cfgfile_load (&currprefs, argv[i] + 8, 0, 1);
|
||||
}
|
||||
/* Check for new-style "-f xxx" argument, where xxx is config-file */
|
||||
else if (strcmp (argv[i], "-f") == 0) {
|
||||
@ -400,7 +400,7 @@ static void parse_cmdline (int argc, char **argv)
|
||||
free_mountinfo (currprefs.mountinfo);
|
||||
currprefs.mountinfo = alloc_mountinfo ();
|
||||
#endif
|
||||
target_cfgfile_load (&currprefs, argv[++i], 0);
|
||||
target_cfgfile_load (&currprefs, argv[++i], 0, 1);
|
||||
}
|
||||
} else if (strcmp (argv[i], "-s") == 0) {
|
||||
if (i + 1 == argc)
|
||||
@ -444,12 +444,12 @@ static void parse_cmdline_and_init_file (int argc, char **argv)
|
||||
|
||||
strcat (optionsfile, restart_config);
|
||||
|
||||
if (! target_cfgfile_load (&currprefs, optionsfile, 0)) {
|
||||
if (! target_cfgfile_load (&currprefs, optionsfile, 0, 0)) {
|
||||
write_log ("failed to load config '%s'\n", optionsfile);
|
||||
#ifdef OPTIONS_IN_HOME
|
||||
/* sam: if not found in $HOME then look in current directory */
|
||||
strcpy (optionsfile, restart_config);
|
||||
target_cfgfile_load (&currprefs, optionsfile);
|
||||
target_cfgfile_load (&currprefs, optionsfile, 0);
|
||||
#endif
|
||||
}
|
||||
fix_options ();
|
||||
|
||||
53
newcpu.c
53
newcpu.c
@ -241,7 +241,7 @@ void check_prefs_changed_cpu (void)
|
||||
|| currprefs.cpu_cycle_exact != changed_prefs.cpu_cycle_exact) {
|
||||
|
||||
if (!currprefs.cpu_compatible && changed_prefs.cpu_compatible)
|
||||
regs.ir = get_word (m68k_getpc()); /* non-prefetch to prefetch fix */
|
||||
fill_prefetch_slow ();
|
||||
|
||||
currprefs.cpu_level = changed_prefs.cpu_level;
|
||||
currprefs.cpu_compatible = changed_prefs.cpu_compatible;
|
||||
@ -912,7 +912,7 @@ static void Exception_ce (int nr, uaecptr oldpc)
|
||||
put_word_ce (m68k_areg(regs, 7) + 4, last_fault_for_exception_3);
|
||||
put_word_ce (m68k_areg(regs, 7) + 0, mode);
|
||||
put_word_ce (m68k_areg(regs, 7) + 2, last_fault_for_exception_3 >> 16);
|
||||
write_log ("Exception %d at %x -> %x!\n", nr, currpc, get_long (4 * nr));
|
||||
write_log ("Exception %d (%x) at %x -> %x!\n", nr, oldpc, currpc, get_long (4 * nr));
|
||||
goto kludge_me_do;
|
||||
}
|
||||
m68k_areg (regs, 7) -= 6;
|
||||
@ -1002,7 +1002,7 @@ static void Exception_normal (int nr, uaecptr oldpc)
|
||||
m68k_areg(regs, 7) -= 2;
|
||||
put_word (m68k_areg(regs, 7), 0xb000 + nr * 4);
|
||||
}
|
||||
write_log ("Exception %d at %p!\n", nr, currpc);
|
||||
write_log ("Exception %d (%x) at %x -> %x!\n", nr, oldpc, currpc, get_long (regs.vbr + 4*nr));
|
||||
} else if (nr ==5 || nr == 6 || nr == 7 || nr == 9) {
|
||||
m68k_areg(regs, 7) -= 4;
|
||||
put_long (m68k_areg(regs, 7), oldpc);
|
||||
@ -1034,7 +1034,7 @@ static void Exception_normal (int nr, uaecptr oldpc)
|
||||
put_word (m68k_areg(regs, 7) + 6, last_op_for_exception_3);
|
||||
put_word (m68k_areg(regs, 7) + 8, regs.sr);
|
||||
put_long (m68k_areg(regs, 7) + 10, last_addr_for_exception_3);
|
||||
write_log ("Exception %d at %x -> %x!\n", nr, currpc, get_long (regs.vbr + 4*nr));
|
||||
write_log ("Exception %d (%x) at %x -> %x!\n", nr, oldpc, currpc, get_long (regs.vbr + 4*nr));
|
||||
goto kludge_me_do;
|
||||
}
|
||||
m68k_areg(regs, 7) -= 4;
|
||||
@ -1042,7 +1042,7 @@ static void Exception_normal (int nr, uaecptr oldpc)
|
||||
m68k_areg(regs, 7) -= 2;
|
||||
put_word (m68k_areg(regs, 7), regs.sr);
|
||||
kludge_me_do:
|
||||
newpc = get_long (regs.vbr + 4*nr);
|
||||
newpc = get_long (regs.vbr + 4 * nr);
|
||||
if (newpc & 1) {
|
||||
if (nr == 2 || nr == 3)
|
||||
uae_reset (1); /* there is nothing else we can do.. */
|
||||
@ -1637,8 +1637,6 @@ static void do_trace (void)
|
||||
}
|
||||
}
|
||||
|
||||
#define CPU_IDLE_LINES 60
|
||||
|
||||
static int do_specialties (int cycles)
|
||||
{
|
||||
#ifdef ACTION_REPLAY
|
||||
@ -1727,11 +1725,11 @@ static int do_specialties (int cycles)
|
||||
sleepcnt--;
|
||||
if (pissoff == 0 && compiled_code && --zerocnt < 0) {
|
||||
sleepcnt = -1;
|
||||
zerocnt = currprefs.cpu_idle / 2;
|
||||
zerocnt = (currprefs.cpu_idle * sleep_resolution / 1000) / 4;
|
||||
}
|
||||
lvpos = vpos;
|
||||
if (sleepcnt < 0) {
|
||||
sleepcnt = currprefs.cpu_idle;
|
||||
sleepcnt = (currprefs.cpu_idle * sleep_resolution / 1000) / 2;
|
||||
sleep_millis (1);
|
||||
}
|
||||
}
|
||||
@ -1745,11 +1743,12 @@ static int do_specialties (int cycles)
|
||||
/* interrupt takes at least 2 cycles (maybe 4) to reach the CPU and
|
||||
* there are programs that require this delay (which is not too surprising..)
|
||||
*/
|
||||
if ((regs.spcflags & SPCFLAG_DOINT)
|
||||
#ifdef JIT
|
||||
|| (!currprefs.cachesize && (regs.spcflags & SPCFLAG_INT))
|
||||
#ifdef JIT
|
||||
if ((regs.spcflags & SPCFLAG_DOINT)
|
||||
|| (!currprefs.cachesize && (regs.spcflags & SPCFLAG_INT))) {
|
||||
#else
|
||||
if (regs.spcflags & SPCFLAG_INT) {
|
||||
#endif
|
||||
) {
|
||||
int intr = intlev ();
|
||||
#ifdef JIT
|
||||
if (currprefs.cachesize)
|
||||
@ -2139,6 +2138,15 @@ STATIC_INLINE void m68k_run1 (void (*func)(void))
|
||||
|
||||
int in_m68k_go = 0;
|
||||
|
||||
static void exception2_handle (uaecptr addr, uaecptr fault)
|
||||
{
|
||||
last_addr_for_exception_3 = addr;
|
||||
last_fault_for_exception_3 = fault;
|
||||
last_writeaccess_for_exception_3 = 0;
|
||||
last_instructionaccess_for_exception_3 = 0;
|
||||
Exception (2, addr);
|
||||
}
|
||||
|
||||
void m68k_go (int may_quit)
|
||||
{
|
||||
if (in_m68k_go || !may_quit) {
|
||||
@ -2196,7 +2204,7 @@ void m68k_go (int may_quit)
|
||||
if (regs.isp & 1)
|
||||
regs.panic = 1;
|
||||
if (!regs.panic)
|
||||
exception2 (regs.panic_pc, regs.panic_addr);
|
||||
exception2_handle (regs.panic_pc, regs.panic_addr);
|
||||
if (regs.panic) {
|
||||
/* system is very badly confused */
|
||||
write_log ("double bus error or corrupted stack, forcing reboot..\n");
|
||||
@ -2549,7 +2557,7 @@ static void exception3f (uae_u32 opcode, uaecptr addr, uaecptr fault, int writea
|
||||
last_op_for_exception_3 = opcode;
|
||||
last_writeaccess_for_exception_3 = writeaccess;
|
||||
last_instructionaccess_for_exception_3 = instructionaccess;
|
||||
Exception (3,0);
|
||||
Exception (3, fault);
|
||||
}
|
||||
|
||||
void exception3 (uae_u32 opcode, uaecptr addr, uaecptr fault)
|
||||
@ -2563,11 +2571,16 @@ void exception3i (uae_u32 opcode, uaecptr addr, uaecptr fault)
|
||||
|
||||
void exception2 (uaecptr addr, uaecptr fault)
|
||||
{
|
||||
last_addr_for_exception_3 = addr;
|
||||
last_fault_for_exception_3 = fault;
|
||||
last_writeaccess_for_exception_3 = 0;
|
||||
last_instructionaccess_for_exception_3 = 0;
|
||||
Exception (2, 0);
|
||||
write_log ("delayed exception2!\n");
|
||||
regs.panic_pc = m68k_getpc();
|
||||
regs.panic_addr = addr;
|
||||
regs.panic = 2;
|
||||
set_special (SPCFLAG_BRK);
|
||||
m68k_setpc (0xf80000);
|
||||
#ifdef JIT
|
||||
set_special(SPCFLAG_END_COMPILE);
|
||||
#endif
|
||||
fill_prefetch_slow ();
|
||||
}
|
||||
|
||||
void cpureset (void)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
!define PRODUCT_NAME "WinUAE"
|
||||
!define PRODUCT_VERSION "0.9.90"
|
||||
!define PRODUCT_VERSION "0.9.91"
|
||||
!define PRODUCT_PUBLISHER "Toni Wilen"
|
||||
!define PRODUCT_WEB_SITE "http://www.winuae.net/"
|
||||
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\winuae.exe"
|
||||
@ -7,49 +7,68 @@
|
||||
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
|
||||
|
||||
;-- Your path here
|
||||
!define DISTPATH "c:\projects\winuae\distribution"
|
||||
!define DISTPATH "C:\projects\winuae\distribution"
|
||||
|
||||
SetCompressor lzma
|
||||
|
||||
!include "StrFunc.nsh"
|
||||
!include "WinMessages.nsh"
|
||||
|
||||
; MUI begins ---
|
||||
!include "MUI.nsh"
|
||||
|
||||
; MUI Settings
|
||||
!define MUI_ABORTWARNING
|
||||
!define MUI_COMPONENTSPAGE_SMALLDESC
|
||||
;!define MUI_FINISHPAGE_NOAUTOCLOSE
|
||||
!define MUI_FINISHPAGE_RUN_NOTCHECKED
|
||||
!define MUI_ICON "graphics\installer_icon.ico"
|
||||
!define MUI_UNICON "graphics\installer_icon.ico"
|
||||
|
||||
; MUI Bitmaps
|
||||
!define MUI_HEADERIMAGE
|
||||
!define MUI_HEADERIMAGE_BITMAP "graphics\amiga_header.bmp"
|
||||
!define MUI_WELCOMEFINISHPAGE_BITMAP "graphics\amiga_welcome.bmp"
|
||||
|
||||
; Welcome page
|
||||
!insertmacro MUI_PAGE_WELCOME
|
||||
|
||||
; Components page
|
||||
!insertmacro MUI_PAGE_COMPONENTS
|
||||
|
||||
; Directory page
|
||||
!insertmacro MUI_PAGE_DIRECTORY
|
||||
|
||||
; Instfiles page
|
||||
!insertmacro MUI_PAGE_INSTFILES
|
||||
|
||||
; Finish page
|
||||
!define MUI_FINISHPAGE_RUN "$INSTDIR\winuae.exe"
|
||||
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\Docs\Readme.txt"
|
||||
!insertmacro MUI_PAGE_FINISH
|
||||
|
||||
; Uninstaller pages
|
||||
!insertmacro MUI_UNPAGE_INSTFILES
|
||||
|
||||
; Language files
|
||||
!insertmacro MUI_LANGUAGE "English"
|
||||
; MUI end ---
|
||||
|
||||
Function .onInit
|
||||
;Find WinUAE Properties Window and close it when it's open
|
||||
System::Call 'kernel32::CreateMutexA(i 0, i 0, t "WinUAE Instantiated") i .r1 ?e'
|
||||
Pop $1
|
||||
StrCmp $1 183 0 Continue
|
||||
MessageBox MB_OK|MB_ICONEXCLAMATION "WinUAE is still running in the background, the installer will terminate it.$\nYou can do this by yourself as well before proceeding with the installation."
|
||||
FindWindow $2 "" "WinUAE Properties"
|
||||
FindWindow $3 "" "WinUAE"
|
||||
SendMessage $2 ${WM_CLOSE} 0 0
|
||||
SendMessage $3 ${WM_CLOSE} 0 0
|
||||
|
||||
Continue:
|
||||
ReadRegStr $0 HKCU "Software\Arabuusimiehet\WinUAE" "InstallDir"
|
||||
StrCmp $0 "" No_WinUAE
|
||||
;Code if WinUAE is installed
|
||||
StrCpy $INSTDIR $0
|
||||
Goto +2
|
||||
No_WinUAE:
|
||||
;Code if WinUAE is not installed
|
||||
StrCpy $INSTDIR "$PROGRAMFILES\WinUAE"
|
||||
FunctionEnd
|
||||
|
||||
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
|
||||
OutFile "InstallWinUAE.exe"
|
||||
InstallDir "$PROGRAMFILES\WinUAE"
|
||||
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
|
||||
ShowInstDetails show
|
||||
ShowUnInstDetails show
|
||||
@ -61,7 +80,7 @@ InstType "Basic with Shortcuts" ;3
|
||||
Section "WinUAE (required)" secWinUAE_files
|
||||
SectionIn 1 2 3 RO
|
||||
SetOutPath "$INSTDIR\"
|
||||
SetOverwrite ifnewer
|
||||
;SetOverwrite ifnewer
|
||||
;-- Copy WinUAE and zlib.dll
|
||||
File "${DISTPATH}\zlib1.dll"
|
||||
File "${DISTPATH}\winuae.exe"
|
||||
@ -115,6 +134,9 @@ SubSection "Additional files" secAdditionalFiles
|
||||
File "${DISTPATH}\Amiga Programs\uaectrl"
|
||||
File "${DISTPATH}\Amiga Programs\uae-control.info"
|
||||
File "${DISTPATH}\Amiga Programs\uae-control"
|
||||
File "${DISTPATH}\Amiga Programs\uae-configuration"
|
||||
File "${DISTPATH}\Amiga Programs\uae-configuration.s"
|
||||
File "${DISTPATH}\Amiga Programs\uae-configuration.c"
|
||||
File "${DISTPATH}\Amiga Programs\uae_rcli"
|
||||
File "${DISTPATH}\Amiga Programs\UAE_German.info"
|
||||
File "${DISTPATH}\Amiga Programs\UAE_German"
|
||||
@ -172,7 +194,7 @@ Section -Post
|
||||
WriteUninstaller "$INSTDIR\uninstall_winuae.exe"
|
||||
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\winuae.exe"
|
||||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
|
||||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
|
||||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninstall_winuae.exe"
|
||||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\winuae.exe"
|
||||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
|
||||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
|
||||
@ -219,6 +241,7 @@ Section Uninstall
|
||||
Delete "$INSTDIR\Docs\Whatsnew-jit"
|
||||
Delete "$INSTDIR\Amiga Programs\ahidriver.zip"
|
||||
Delete "$INSTDIR\Amiga Programs\amigaprog.txt"
|
||||
Delete "$INSTDIR\Amiga Programs\german_KeyMap_new.zip"
|
||||
Delete "$INSTDIR\Amiga Programs\mousehack"
|
||||
Delete "$INSTDIR\Amiga Programs\p96_uae_tweak"
|
||||
Delete "$INSTDIR\Amiga Programs\p96refresh"
|
||||
@ -232,6 +255,9 @@ Section Uninstall
|
||||
Delete "$INSTDIR\Amiga Programs\UAE_German"
|
||||
Delete "$INSTDIR\Amiga Programs\UAE_German.info"
|
||||
Delete "$INSTDIR\Amiga Programs\uae_rcli"
|
||||
Delete "$INSTDIR\Amiga Programs\uae-configuration"
|
||||
Delete "$INSTDIR\Amiga Programs\uae-configuration.s"
|
||||
Delete "$INSTDIR\Amiga Programs\uae-configuration.c"
|
||||
Delete "$INSTDIR\Amiga Programs\uae-control"
|
||||
Delete "$INSTDIR\Amiga Programs\uae-control.info"
|
||||
Delete "$INSTDIR\Amiga Programs\uaectrl"
|
||||
@ -242,20 +268,34 @@ Section Uninstall
|
||||
Delete "$INSTDIR\Amiga Programs\winuaeenforcer.txt"
|
||||
Delete "$INSTDIR\Amiga Programs\winxpprinthelper"
|
||||
Delete "$INSTDIR\Amiga Programs\winxpprinthelper.info"
|
||||
Delete "$INSTDIR\Configurations\Host\Fullscreen (640x480).uae"
|
||||
Delete "$INSTDIR\Configurations\Host\Fullscreen (800x600).uae"
|
||||
Delete "$INSTDIR\Configurations\Host\Windowed.uae"
|
||||
Delete "$INSTDIR\winuaebootlog.txt"
|
||||
Delete "$INSTDIR\winuaelog.txt"
|
||||
Delete "$INSTDIR\winuae.exe"
|
||||
Delete "$INSTDIR\zlib1.dll"
|
||||
Delete "$INSTDIR\WinUAE_German.dll"
|
||||
|
||||
Delete "$SMPROGRAMS\WinUAE\Uninstall.lnk"
|
||||
Delete "$DESKTOP\WinUAE.lnk"
|
||||
Delete "$SMPROGRAMS\WinUAE\WinUAE.lnk"
|
||||
Delete "$SMPROGRAMS\WinUAE\ReadMe.lnk"
|
||||
Delete "$DESKTOP\WinUAE.lnk"
|
||||
Delete "$QUICKLAUNCH\WinUAE.lnk"
|
||||
|
||||
RMDir "$SMPROGRAMS\WinUAE"
|
||||
RMDir "$INSTDIR\Docs\Windows"
|
||||
RMDir "$INSTDIR\Docs"
|
||||
RMDir "$INSTDIR\Amiga Programs"
|
||||
RMDir /r "$INSTDIR\"
|
||||
RMDir "$INSTDIR\Configurations\Host"
|
||||
RMDir "$INSTDIR\Configurations\Hardware"
|
||||
RMDir "$INSTDIR\Configurations"
|
||||
RMDir "$INSTDIR\Roms"
|
||||
RMDir "$INSTDIR\SaveImages"
|
||||
RMDir "$INSTDIR\SaveStates"
|
||||
RMDir "$INSTDIR\ScreenShots"
|
||||
|
||||
RMDir "$SMPROGRAMS\WinUAE"
|
||||
RMDir "$INSTDIR\"
|
||||
RMDir ""
|
||||
|
||||
DeleteRegKey HKCU "Software\Arabuusimiehet"
|
||||
|
||||
@ -2037,6 +2037,28 @@ uae_u32 host_inet_addr(uae_u32 cp)
|
||||
return addr;
|
||||
}
|
||||
|
||||
int isfullscreen (void);
|
||||
BOOL CheckOnline(SB)
|
||||
{
|
||||
DWORD dwFlags;
|
||||
BOOL bReturn = TRUE;
|
||||
if (InternetGetConnectedState(&dwFlags,0) == FALSE)
|
||||
{ // Internet is offline
|
||||
if (InternetAttemptConnect(0) != ERROR_SUCCESS)
|
||||
{ // Show Dialer window
|
||||
sb->sb_errno = 10001;
|
||||
sb->sb_herrno = 1;
|
||||
bReturn = FALSE;
|
||||
// No success or aborted
|
||||
}
|
||||
if (isfullscreen())
|
||||
{
|
||||
ShowWindow (hAmigaWnd, SW_RESTORE);
|
||||
SetActiveWindow(hAmigaWnd);
|
||||
}
|
||||
}
|
||||
return(bReturn);
|
||||
}
|
||||
|
||||
static unsigned int __stdcall thread_get(void *index2)
|
||||
{
|
||||
@ -2063,33 +2085,36 @@ static unsigned int __stdcall thread_get(void *index2)
|
||||
if (args[1] == 0)
|
||||
{ // gethostbyname or gethostbyaddr
|
||||
struct hostent *host;
|
||||
|
||||
name = args[2];
|
||||
namelen = args[3];
|
||||
addrtype = args[4];
|
||||
buf = (char*) args[5];
|
||||
name_rp = get_real_address(name);
|
||||
|
||||
if (addrtype == -1)
|
||||
if (CheckOnline(sb) == TRUE)
|
||||
{
|
||||
host = gethostbyname(name_rp);
|
||||
}
|
||||
else
|
||||
{
|
||||
host = gethostbyaddr(name_rp,namelen,addrtype);
|
||||
}
|
||||
if (threadGetargs[index] != -1)
|
||||
{ // No CTRL-C Signal
|
||||
if (host == 0)
|
||||
|
||||
name = args[2];
|
||||
namelen = args[3];
|
||||
addrtype = args[4];
|
||||
buf = (char*) args[5];
|
||||
name_rp = get_real_address(name);
|
||||
|
||||
if (addrtype == -1)
|
||||
{
|
||||
// Error occured
|
||||
SETERRNO;
|
||||
TRACE(("failed (%d) - ",sb->sb_errno));
|
||||
host = gethostbyname(name_rp);
|
||||
}
|
||||
else
|
||||
{
|
||||
seterrno(sb,0);
|
||||
memcpy(buf,host,sizeof(HOSTENT));
|
||||
host = gethostbyaddr(name_rp,namelen,addrtype);
|
||||
}
|
||||
if (threadGetargs[index] != -1)
|
||||
{ // No CTRL-C Signal
|
||||
if (host == 0)
|
||||
{
|
||||
// Error occured
|
||||
SETERRNO;
|
||||
TRACE(("failed (%d) - ",sb->sb_errno));
|
||||
}
|
||||
else
|
||||
{
|
||||
seterrno(sb,0);
|
||||
memcpy(buf,host,sizeof(HOSTENT));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2174,6 +2199,7 @@ static unsigned int __stdcall thread_get(void *index2)
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
void host_gethostbynameaddr(SB, uae_u32 name, uae_u32 namelen, long addrtype)
|
||||
{
|
||||
HOSTENT *h;
|
||||
@ -2190,8 +2216,12 @@ void host_gethostbynameaddr(SB, uae_u32 name, uae_u32 namelen, long addrtype)
|
||||
char buf[MAXGETHOSTSTRUCT];
|
||||
unsigned int wMsg = 0;
|
||||
|
||||
char on = 1;
|
||||
InternetSetOption(0,INTERNET_OPTION_SETTINGS_CHANGED,&on,strlen(&on));
|
||||
|
||||
|
||||
|
||||
// char on = 1;
|
||||
// InternetSetOption(0,INTERNET_OPTION_SETTINGS_CHANGED,&on,strlen(&on));
|
||||
// Do not use: Causes locks with some machines
|
||||
|
||||
name_rp = get_real_address(name);
|
||||
|
||||
|
||||
@ -1205,6 +1205,7 @@ HRESULT DirectDraw_CreateSurface( int width, int height )
|
||||
#endif
|
||||
}
|
||||
out:
|
||||
DirectDraw_ClearSurfaces ();
|
||||
return ddrval;
|
||||
}
|
||||
|
||||
@ -1737,7 +1738,7 @@ static int DirectDraw_BltStub( LPDIRECTDRAWSURFACE7 dstsurf, LPRECT dstrect, LPD
|
||||
if (ddrval == DDERR_SURFACELOST)
|
||||
{
|
||||
if (errcnt > 10)
|
||||
break;
|
||||
return 1;
|
||||
errcnt++;
|
||||
ddrval = restoresurface ( dstsurf );
|
||||
if (ddrval != DD_OK)
|
||||
|
||||
@ -217,6 +217,29 @@ static int recycle (const char *name)
|
||||
|
||||
int my_rmdir (const char *name)
|
||||
{
|
||||
void *od;
|
||||
int cnt;
|
||||
char tname[MAX_DPATH];
|
||||
|
||||
/* SHFileOperation() ignores FOF_NORECURSION when deleting directories.. */
|
||||
od = my_opendir (name);
|
||||
if (!od) {
|
||||
SetLastError (ERROR_FILE_NOT_FOUND);
|
||||
return -1;
|
||||
}
|
||||
cnt = 0;
|
||||
while (my_readdir (od, tname)) {
|
||||
if (!strcmp (tname, ".") || !strcmp (tname, ".."))
|
||||
continue;
|
||||
cnt++;
|
||||
break;
|
||||
}
|
||||
my_closedir (od);
|
||||
if (cnt > 0) {
|
||||
SetLastError (ERROR_CURRENT_DIRECTORY);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return recycle (name);
|
||||
//return RemoveDirectory (name) == 0 ? -1 : 0;
|
||||
}
|
||||
@ -317,7 +340,7 @@ void *my_open (const char *name, int flags)
|
||||
{
|
||||
struct my_opens *mos;
|
||||
HANDLE h;
|
||||
DWORD DesiredAccess = GENERIC_READ | GENERIC_WRITE;
|
||||
DWORD DesiredAccess = GENERIC_READ;
|
||||
DWORD ShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE;
|
||||
DWORD CreationDisposition = OPEN_EXISTING;
|
||||
DWORD FlagsAndAttributes = FILE_ATTRIBUTE_NORMAL;
|
||||
@ -326,19 +349,29 @@ void *my_open (const char *name, int flags)
|
||||
if (!mos)
|
||||
return NULL;
|
||||
if (flags & O_TRUNC)
|
||||
CreationDisposition = TRUNCATE_EXISTING;
|
||||
if (flags & O_CREAT)
|
||||
CreationDisposition = CREATE_ALWAYS;
|
||||
else if (flags & O_CREAT)
|
||||
CreationDisposition = OPEN_ALWAYS;
|
||||
if (flags & O_WRONLY)
|
||||
DesiredAccess = GENERIC_WRITE;
|
||||
if (flags & O_RDONLY)
|
||||
if (flags & O_RDONLY) {
|
||||
DesiredAccess = GENERIC_READ;
|
||||
CreationDisposition = OPEN_EXISTING;
|
||||
}
|
||||
if (flags & O_RDWR)
|
||||
DesiredAccess = GENERIC_READ | GENERIC_WRITE;
|
||||
h = CreateFile (name, DesiredAccess, ShareMode, NULL, CreationDisposition, FlagsAndAttributes, NULL);
|
||||
if (h == INVALID_HANDLE_VALUE) {
|
||||
xfree (mos);
|
||||
return 0;
|
||||
if (DesiredAccess & GENERIC_WRITE) {
|
||||
DesiredAccess &= ~GENERIC_WRITE;
|
||||
CreationDisposition = OPEN_EXISTING;
|
||||
h = CreateFile (name, DesiredAccess, ShareMode, NULL, CreationDisposition, FlagsAndAttributes, NULL);
|
||||
}
|
||||
if (h == INVALID_HANDLE_VALUE) {
|
||||
write_log ("failed to open '%s' %x %x\n", name, DesiredAccess, CreationDisposition);
|
||||
xfree (mos);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
mos->h = h;
|
||||
return mos;
|
||||
@ -365,3 +398,44 @@ int my_truncate (const char *name, long int len)
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
int dos_errno (void)
|
||||
{
|
||||
DWORD e = GetLastError ();
|
||||
|
||||
switch (e) {
|
||||
case ERROR_NOT_ENOUGH_MEMORY:
|
||||
case ERROR_OUTOFMEMORY:
|
||||
return ERROR_NO_FREE_STORE;
|
||||
|
||||
case ERROR_FILE_EXISTS:
|
||||
case ERROR_ALREADY_EXISTS:
|
||||
return ERROR_OBJECT_EXISTS;
|
||||
|
||||
case ERROR_WRITE_PROTECT:
|
||||
case ERROR_ACCESS_DENIED:
|
||||
return ERROR_WRITE_PROTECTED;
|
||||
|
||||
case ERROR_FILE_NOT_FOUND:
|
||||
case ERROR_INVALID_DRIVE:
|
||||
return ERROR_OBJECT_NOT_AROUND;
|
||||
|
||||
case ERROR_HANDLE_DISK_FULL:
|
||||
return ERROR_DISK_IS_FULL;
|
||||
|
||||
case ERROR_SHARING_VIOLATION:
|
||||
case ERROR_BUSY:
|
||||
return ERROR_OBJECT_IN_USE;
|
||||
|
||||
case ERROR_CURRENT_DIRECTORY:
|
||||
return ERROR_DIRECTORY_NOT_EMPTY;
|
||||
|
||||
case ERROR_NEGATIVE_SEEK:
|
||||
case ERROR_SEEK_ON_DEVICE:
|
||||
return ERROR_SEEK_ERROR;
|
||||
|
||||
default:
|
||||
write_log ("Unimplemented error %d\n", e);
|
||||
return ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,7 +23,11 @@ int ioport_init (void)
|
||||
if (initialized)
|
||||
return 1;
|
||||
#ifndef IOPORT_EMU
|
||||
initialized = InitializeWinIo();
|
||||
__try {
|
||||
initialized = InitializeWinIo();
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
initialized = 0;
|
||||
}
|
||||
#else
|
||||
initialized = 1;
|
||||
#endif
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
del *.zip
|
||||
copy d:\amiga\winuae.exe c:\projects\winuae\distribution
|
||||
copy resourcedll\release\resourcedll.dll d:\amiga\WinUAE_default.dll
|
||||
makensis.exe winuae
|
||||
"c:\Program Files\NSIS\makensis.exe" winuae_install
|
||||
cd c:\projects\winuae\distribution
|
||||
copy docs\windows\translation.txt d:\amiga
|
||||
zip -9 -r c:\projects\winuae\src\od-win32\winuae.zip *
|
||||
|
||||
@ -933,7 +933,7 @@ STATIC_INLINE void do_fillrect_frame_buffer( struct RenderInfo *ri, int X, int Y
|
||||
|
||||
void picasso_handle_vsync (void)
|
||||
{
|
||||
DX_Invalidate(1,4000); //so a flushpixel is done every vsync if pixel are in buffer
|
||||
DX_Invalidate(0,4000); //so a flushpixel is done every vsync if pixel are in buffer
|
||||
PICASSO96_Unlock();
|
||||
if (palette_changed) {
|
||||
DX_SetPalette (0,256);
|
||||
@ -950,7 +950,7 @@ static int set_panning_called = 0;
|
||||
* 3. whenever the graphics code notifies us that the screen contents have been lost.
|
||||
*/
|
||||
extern unsigned int new_beamcon0;
|
||||
void picasso_refresh( int call_setpalette )
|
||||
void picasso_refresh ( int call_setpalette )
|
||||
{
|
||||
struct RenderInfo ri;
|
||||
|
||||
@ -3195,7 +3195,7 @@ static void flushpixels( void )
|
||||
//panoffset=picasso96_state.Address+(picasso96_state.XOffset*picasso96_state.BytesPerPixel)
|
||||
// +(picasso96_state.YOffset*picasso96_state.BytesPerRow);
|
||||
|
||||
DX_Invalidate (1,4000);
|
||||
DX_Invalidate (0,4000);
|
||||
#ifndef _DEBUG
|
||||
if(DirectDraw_IsLocked()==FALSE) {
|
||||
dst = gfx_lock_picasso ();
|
||||
|
||||
1046
od-win32/resources/WinUAE_German.rc
Executable file
1046
od-win32/resources/WinUAE_German.rc
Executable file
File diff suppressed because it is too large
Load Diff
@ -145,14 +145,22 @@
|
||||
#define IDS_BOOTPRI 178
|
||||
#define IDS_WRONGDXVERSION 179
|
||||
#define IDI_MISC2 180
|
||||
#define IDS_FLOPPY_COMPATIBLE 180
|
||||
#define IDR_DRIVE_SNATCH_A500_1 181
|
||||
#define IDS_FLOPPY_TURBO 181
|
||||
#define IDI_DISK 182
|
||||
#define IDR_DRIVE_SPINND_A500_1 182
|
||||
#define IDS_YES 182
|
||||
#define IDD_PANEL 183
|
||||
#define IDS_NO 183
|
||||
#define IDD_PATHS 184
|
||||
#define IDS_PRI_ABOVENORMAL 184
|
||||
#define IDI_CONFIGFILE 185
|
||||
#define IDD_QUICKSTART 185
|
||||
#define IDS_PRI_NORMAL 185
|
||||
#define IDM_SYSTRAY 186
|
||||
#define IDS_PRI_BELOWNORMAL 186
|
||||
#define IDS_PRI_LOW 187
|
||||
#define IDI_FOLDER 188
|
||||
#define IDI_DISPLAY 190
|
||||
#define IDI_ROOT 192
|
||||
@ -788,7 +796,7 @@
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NO_MFC 1
|
||||
#define _APS_3D_CONTROLS 1
|
||||
#define _APS_NEXT_RESOURCE_VALUE 244
|
||||
#define _APS_NEXT_RESOURCE_VALUE 245
|
||||
#define _APS_NEXT_COMMAND_VALUE 40021
|
||||
#define _APS_NEXT_CONTROL_VALUE 1695
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
|
||||
@ -427,7 +427,7 @@ BEGIN
|
||||
CONTROL "Keyboard Layout ""A"" []Numeric keypad, 0 and 5 = fire",
|
||||
IDC_PORT0_KBDA,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,
|
||||
10,127,90,10
|
||||
CONTROL "Keyboard Layout ""B"" []Cursor keys, right CTRL = fire",
|
||||
CONTROL "Keyboard Layout ""B"" []Cursor keys, right CTRL and ALT = fire",
|
||||
IDC_PORT0_KBDB,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,
|
||||
10,142,90,10
|
||||
CONTROL "Keyboard Layout ""C"" []T = up, B = down, F = left, H = right, left ALT = fire",
|
||||
@ -441,7 +441,7 @@ BEGIN
|
||||
CONTROL "Keyboard Layout ""A"" []Numeric keypad, 0 and 5 = fire",
|
||||
IDC_PORT1_KBDA,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,
|
||||
155,127,90,10
|
||||
CONTROL "Keyboard Layout ""B"" []Cursor keys, right CTRL = fire",
|
||||
CONTROL "Keyboard Layout ""B"" []Cursor keys, right CTRL and ALT = fire",
|
||||
IDC_PORT1_KBDB,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,
|
||||
155,142,90,10
|
||||
CONTROL "Keyboard Layout ""C"" []T = up, B = down, F = left, H = right, left ALT = fire",
|
||||
@ -1016,8 +1016,8 @@ IDI_PATHS ICON "paths.ico"
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 0,9,90,0
|
||||
PRODUCTVERSION 0,9,90,0
|
||||
FILEVERSION 0,9,91,0
|
||||
PRODUCTVERSION 0,9,91,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
@ -1033,12 +1033,12 @@ BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "FileDescription", "WinUAE"
|
||||
VALUE "FileVersion", "0.9.90"
|
||||
VALUE "FileVersion", "0.9.91"
|
||||
VALUE "InternalName", "WinUAE"
|
||||
VALUE "LegalCopyright", "© 1996-2004 under the GNU Public License (GPL)"
|
||||
VALUE "OriginalFilename", "WinUAE.exe"
|
||||
VALUE "ProductName", "WinUAE"
|
||||
VALUE "ProductVersion", "0.9.90"
|
||||
VALUE "ProductVersion", "0.9.91"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
@ -1261,6 +1261,14 @@ BEGIN
|
||||
IDS_DEVICE "Device"
|
||||
IDS_BOOTPRI "BootPri"
|
||||
IDS_WRONGDXVERSION "WinUAE requires DirectX 8 or newer."
|
||||
IDS_FLOPPY_COMPATIBLE " (compatible)"
|
||||
IDS_FLOPPY_TURBO "Turbo"
|
||||
IDS_YES "yes"
|
||||
IDS_NO "no"
|
||||
IDS_PRI_ABOVENORMAL "Above Normal"
|
||||
IDS_PRI_NORMAL "Normal"
|
||||
IDS_PRI_BELOWNORMAL "Below Normal"
|
||||
IDS_PRI_LOW "Low"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
@ -1399,7 +1407,7 @@ BEGIN
|
||||
IDS_QS_MODEL_A600 "Basic non-expanded configuration\nA600 is basically smaller Amiga 500+ with updated Kickstart 2.0 ROM.\n2M Chip RAM expanded configuration\n\n4M Fast RAM expanded configuration\n"
|
||||
IDS_QS_MODEL_A1000 "0.5M Chip\nThe Amiga 1000 was the first Amiga ever produced, configuration is basically an OCS A500. You should never use this configuration unless you are nostalgic and you want to hear short special A1000 boot tune\n256K Chip\nUnexpanded Amiga 1000. All later A1000 models were sold with 256K RAM expansion build-in."
|
||||
IDS_QS_MODEL_A1200 "Basic non-expanded configuration\nUse this configuration to run most AGA demos and games\n4M Fast RAM expanded configuration\nSome newer AGA games and demos need an expanded A1200 to run."
|
||||
IDS_QS_MODEL_CD32 "CD32\nCD32 was the first 32bit console. It is basically an A1200 with build-in CDROM. Insert your CD32 or CDTV CDROM into a free CDROM drive before starting emulation."
|
||||
IDS_QS_MODEL_CD32 "CD32\nCD32 was one the first 32-bit consoles on the market. It is basically an A1200 with build-in CDROM. Insert your CD32 or CDTV CDROM into a free CDROM drive before starting emulation."
|
||||
IDS_QS_MODEL_CDTV "CDTV\nCDTV was Commodore`s first attempt at making a CD-ROM equipped computer. It is an 1MB ECS Amiga 500 in a black box that looks like a CD player."
|
||||
END
|
||||
|
||||
|
||||
@ -427,7 +427,7 @@ BEGIN
|
||||
CONTROL "Keyboard Layout ""A"" []Numeric keypad, 0 and 5 = fire",
|
||||
IDC_PORT0_KBDA,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,
|
||||
10,127,90,10
|
||||
CONTROL "Keyboard Layout ""B"" []Cursor keys, right CTRL = fire",
|
||||
CONTROL "Keyboard Layout ""B"" []Cursor keys, right CTRL and ALT = fire",
|
||||
IDC_PORT0_KBDB,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,
|
||||
10,142,90,10
|
||||
CONTROL "Keyboard Layout ""C"" []T = up, B = down, F = left, H = right, left ALT = fire",
|
||||
@ -441,7 +441,7 @@ BEGIN
|
||||
CONTROL "Keyboard Layout ""A"" []Numeric keypad, 0 and 5 = fire",
|
||||
IDC_PORT1_KBDA,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,
|
||||
155,127,90,10
|
||||
CONTROL "Keyboard Layout ""B"" []Cursor keys, right CTRL = fire",
|
||||
CONTROL "Keyboard Layout ""B"" []Cursor keys, right CTRL and ALT = fire",
|
||||
IDC_PORT1_KBDB,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,
|
||||
155,142,90,10
|
||||
CONTROL "Keyboard Layout ""C"" []T = up, B = down, F = left, H = right, left ALT = fire",
|
||||
@ -1016,8 +1016,8 @@ IDI_PATHS ICON "paths.ico"
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 0,9,90,0
|
||||
PRODUCTVERSION 0,9,90,0
|
||||
FILEVERSION 0,9,91,0
|
||||
PRODUCTVERSION 0,9,91,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
@ -1033,12 +1033,12 @@ BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "FileDescription", "WinUAE"
|
||||
VALUE "FileVersion", "0.9.90"
|
||||
VALUE "FileVersion", "0.9.91"
|
||||
VALUE "InternalName", "WinUAE"
|
||||
VALUE "LegalCopyright", "© 1996-2004 under the GNU Public License (GPL)"
|
||||
VALUE "OriginalFilename", "WinUAE.exe"
|
||||
VALUE "ProductName", "WinUAE"
|
||||
VALUE "ProductVersion", "0.9.90"
|
||||
VALUE "ProductVersion", "0.9.91"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
@ -1132,6 +1132,7 @@ BEGIN
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// RT_MANIFEST
|
||||
@ -1249,6 +1250,14 @@ BEGIN
|
||||
IDS_DEVICE "Device"
|
||||
IDS_BOOTPRI "BootPri"
|
||||
IDS_WRONGDXVERSION "WinUAE requires DirectX 8 or newer."
|
||||
IDS_FLOPPY_COMPATIBLE " (compatible)"
|
||||
IDS_FLOPPY_TURBO "Turbo"
|
||||
IDS_YES "yes"
|
||||
IDS_NO "no"
|
||||
IDS_PRI_ABOVENORMAL "Above Normal"
|
||||
IDS_PRI_NORMAL "Normal"
|
||||
IDS_PRI_BELOWNORMAL "Below Normal"
|
||||
IDS_PRI_LOW "Low"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
@ -1387,7 +1396,7 @@ BEGIN
|
||||
IDS_QS_MODEL_A600 "Basic non-expanded configuration\nA600 is basically smaller Amiga 500+ with updated Kickstart 2.0 ROM.\n2M Chip RAM expanded configuration\n\n4M Fast RAM expanded configuration\n"
|
||||
IDS_QS_MODEL_A1000 "0.5M Chip\nThe Amiga 1000 was the first Amiga ever produced, configuration is basically an OCS A500. You should never use this configuration unless you are nostalgic and you want to hear short special A1000 boot tune\n256K Chip\nUnexpanded Amiga 1000. All later A1000 models were sold with 256K RAM expansion build-in."
|
||||
IDS_QS_MODEL_A1200 "Basic non-expanded configuration\nUse this configuration to run most AGA demos and games\n4M Fast RAM expanded configuration\nSome newer AGA games and demos need an expanded A1200 to run."
|
||||
IDS_QS_MODEL_CD32 "CD32\nCD32 was the first 32bit console. It is basically an A1200 with build-in CDROM. Insert your CD32 or CDTV CDROM into a free CDROM drive before starting emulation."
|
||||
IDS_QS_MODEL_CD32 "CD32\nCD32 was one the first 32-bit consoles on the market. It is basically an A1200 with build-in CDROM. Insert your CD32 or CDTV CDROM into a free CDROM drive before starting emulation."
|
||||
IDS_QS_MODEL_CDTV "CDTV\nCDTV was Commodore`s first attempt at making a CD-ROM equipped computer. It is an 1MB ECS Amiga 500 in a black box that looks like a CD player."
|
||||
END
|
||||
|
||||
|
||||
@ -271,7 +271,7 @@ static int open_audio_ds (int size)
|
||||
return 0;
|
||||
}
|
||||
memset (&DSCaps, 0, sizeof (DSCaps));
|
||||
DSCaps.dwSize = sizeof(DSCaps);
|
||||
DSCaps.dwSize = sizeof (DSCaps);
|
||||
hr = IDirectSound_GetCaps (lpDS, &DSCaps);
|
||||
if (hr!= DS_OK) {
|
||||
write_log ("SOUND: Error getting DirectSound capabilities: %s\n", DXError (hr));
|
||||
@ -283,7 +283,7 @@ static int open_audio_ds (int size)
|
||||
minfreq = DSCaps.dwMinSecondarySampleRate;
|
||||
maxfreq = DSCaps.dwMaxSecondarySampleRate;
|
||||
if (maxfreq > 11000) {
|
||||
if (minfreq > freq) {
|
||||
if (minfreq > freq && minfreq < 22050) {
|
||||
freq = minfreq;
|
||||
changed_prefs.sound_freq = currprefs.sound_freq = freq;
|
||||
write_log("SOUND: minimum supported frequency: %d\n", minfreq);
|
||||
|
||||
319
od-win32/win32.c
319
od-win32/win32.c
@ -149,6 +149,7 @@ static void init_mmtimer (void)
|
||||
timehandle = CreateEvent (NULL, TRUE, FALSE, NULL);
|
||||
}
|
||||
|
||||
int sleep_resolution;
|
||||
void sleep_millis (int ms)
|
||||
{
|
||||
UINT TimerEvent;
|
||||
@ -328,14 +329,17 @@ static int figure_processor_speed (void)
|
||||
|
||||
SetThreadPriority ( GetCurrentThread(), THREAD_PRIORITY_NORMAL);
|
||||
dummythread_die = 1;
|
||||
|
||||
|
||||
sleep_resolution = 1;
|
||||
if (clkdiv >= 0.90 && clkdiv <= 1.10 && rpt_available) {
|
||||
limit = 2.5;
|
||||
if ((ratea2 / ratecnt) < limit * clockrate1000) { /* regular Sleep() is ok */
|
||||
timermode = 1;
|
||||
sleep_resolution = ratea2 * clockrate1000 / (ratecnt * 1000000);
|
||||
write_log ("Using Sleep() (resolution < %.1fms)\n", limit);
|
||||
} else if (mm_timerres && (ratea1 / ratecnt) < limit * clockrate1000) { /* MM-timer is ok */
|
||||
timermode = 0;
|
||||
sleep_resolution = ratea1 * clockrate1000 / (ratecnt * 1000000);
|
||||
timebegin ();
|
||||
write_log ("Using MultiMedia timers (resolution < %.1fms)\n", limit);
|
||||
} else {
|
||||
@ -346,6 +350,8 @@ static int figure_processor_speed (void)
|
||||
timermode = -1;
|
||||
write_log ("forcing busy-loop wait mode\n");
|
||||
}
|
||||
if (sleep_resolution < 1000)
|
||||
sleep_resolution = 1000;
|
||||
syncbase = (unsigned long)clockrate;
|
||||
return 1;
|
||||
}
|
||||
@ -483,6 +489,8 @@ static void winuae_inactive (HWND hWnd, int minimized)
|
||||
{
|
||||
struct threadpriorities *pri;
|
||||
|
||||
if (minimized)
|
||||
exit_gui (0);
|
||||
focus = 0;
|
||||
write_log( "WinUAE now inactive via WM_ACTIVATE\n" );
|
||||
wait_keyrelease ();
|
||||
@ -562,7 +570,6 @@ static void handleXbutton (WPARAM wParam, int updown)
|
||||
|
||||
static long FAR PASCAL AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
static int ignorenextactivateapp;
|
||||
PAINTSTRUCT ps;
|
||||
HDC hDC;
|
||||
LPMINMAXINFO lpmmi;
|
||||
@ -594,12 +601,15 @@ static long FAR PASCAL AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam,
|
||||
v = TRUE;
|
||||
break;
|
||||
}
|
||||
exit_gui (0);
|
||||
if (v != minimized) {
|
||||
minimized = v;
|
||||
if (v)
|
||||
if (v) {
|
||||
winuae_inactive (hWnd, wParam == SIZE_MINIMIZED);
|
||||
else
|
||||
} else {
|
||||
pausemode (0);
|
||||
winuae_active (hWnd, minimized);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -611,8 +621,6 @@ static long FAR PASCAL AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam,
|
||||
minimized = HIWORD (wParam);
|
||||
if (LOWORD (wParam) != WA_INACTIVE) {
|
||||
winuae_active (hWnd, minimized);
|
||||
if (ignorenextactivateapp > 0)
|
||||
ignorenextactivateapp--;
|
||||
} else {
|
||||
winuae_inactive (hWnd, minimized);
|
||||
}
|
||||
@ -625,8 +633,6 @@ static long FAR PASCAL AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam,
|
||||
if (!minimized)
|
||||
winuae_active (hWnd, minimized);
|
||||
}
|
||||
if (ignorenextactivateapp > 0)
|
||||
ignorenextactivateapp--;
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
@ -634,19 +640,18 @@ static long FAR PASCAL AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam,
|
||||
case WM_ACTIVATEAPP:
|
||||
write_log ("WM_ACTIVATEAPP %d %d\n", wParam, minimized);
|
||||
if (!wParam) {
|
||||
if (gui_active && isfullscreen())
|
||||
exit_gui (0);
|
||||
setmouseactive (0);
|
||||
if (normal_display_change_starting == 0)
|
||||
normal_display_change_starting = 4;
|
||||
} else {
|
||||
if (minimized)
|
||||
minimized = 0;
|
||||
winuae_active (hWnd, minimized);
|
||||
if (!ignorenextactivateapp && isfullscreen () && is3dmode ()) {
|
||||
WIN32GFX_DisplayChangeRequested ();
|
||||
ignorenextactivateapp = 3;
|
||||
if (normal_display_change_starting) {
|
||||
if (isfullscreen () && is3dmode () && normal_display_change_starting == 4)
|
||||
WIN32GFX_DisplayChangeRequested ();
|
||||
normal_display_change_starting--;
|
||||
}
|
||||
if (gui_active && isfullscreen())
|
||||
exit_gui (0);
|
||||
}
|
||||
manual_palette_refresh_needed = 1;
|
||||
return 0;
|
||||
@ -719,19 +724,26 @@ static long FAR PASCAL AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam,
|
||||
return 0;
|
||||
|
||||
case WM_PAINT:
|
||||
notice_screen_contents_lost ();
|
||||
hDC = BeginPaint (hWnd, &ps);
|
||||
/* Check to see if this WM_PAINT is coming while we've got the GUI visible */
|
||||
if (manual_painting_needed)
|
||||
updatedisplayarea ();
|
||||
EndPaint (hWnd, &ps);
|
||||
if (manual_palette_refresh_needed) {
|
||||
WIN32GFX_SetPalette();
|
||||
{
|
||||
static int recursive = 0;
|
||||
if (recursive == 0) {
|
||||
recursive++;
|
||||
notice_screen_contents_lost ();
|
||||
hDC = BeginPaint (hWnd, &ps);
|
||||
/* Check to see if this WM_PAINT is coming while we've got the GUI visible */
|
||||
if (manual_painting_needed)
|
||||
updatedisplayarea ();
|
||||
EndPaint (hWnd, &ps);
|
||||
if (manual_palette_refresh_needed) {
|
||||
WIN32GFX_SetPalette();
|
||||
#ifdef PICASSO96
|
||||
DX_SetPalette (0, 256);
|
||||
DX_SetPalette (0, 256);
|
||||
#endif
|
||||
}
|
||||
manual_palette_refresh_needed = 0;
|
||||
recursive--;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_DROPFILES:
|
||||
@ -1090,6 +1102,7 @@ void handle_events (void)
|
||||
inputdevicefunc_mouse.read();
|
||||
inputdevicefunc_joystick.read();
|
||||
inputdevice_handle_inputcode ();
|
||||
check_prefs_changed_gfx ();
|
||||
}
|
||||
while (PeekMessage (&msg, 0, 0, 0, PM_REMOVE)) {
|
||||
TranslateMessage (&msg);
|
||||
@ -1214,209 +1227,210 @@ static HMODULE LoadGUI( void )
|
||||
HMODULE result = NULL;
|
||||
LPCTSTR dllname = NULL;
|
||||
LANGID language = GetUserDefaultLangID() & 0x3FF; // low 9-bits form the primary-language ID
|
||||
char dllbuf[MAX_DPATH];
|
||||
|
||||
switch( language )
|
||||
{
|
||||
case LANG_AFRIKAANS:
|
||||
dllname = "WinUAE_Afrikaans.dll";
|
||||
dllname = "Afrikaans";
|
||||
break;
|
||||
case LANG_ARABIC:
|
||||
dllname = "WinUAE_Arabic.dll";
|
||||
dllname = "Arabic";
|
||||
break;
|
||||
case LANG_ARMENIAN:
|
||||
dllname = "WinUAE_Armenian.dll";
|
||||
dllname = "Armenian";
|
||||
break;
|
||||
case LANG_ASSAMESE:
|
||||
dllname = "WinUAE_Assamese.dll";
|
||||
dllname = "Assamese";
|
||||
break;
|
||||
case LANG_AZERI:
|
||||
dllname = "WinUAE_Azeri.dll";
|
||||
dllname = "Azeri";
|
||||
break;
|
||||
case LANG_BASQUE:
|
||||
dllname = "WinUAE_Basque.dll";
|
||||
dllname = "Basque";
|
||||
break;
|
||||
case LANG_BELARUSIAN:
|
||||
dllname = "WinUAE_Belarusian.dll";
|
||||
dllname = "Belarusian";
|
||||
break;
|
||||
case LANG_BENGALI:
|
||||
dllname = "WinUAE_Bengali.dll";
|
||||
dllname = "Bengali";
|
||||
break;
|
||||
case LANG_BULGARIAN:
|
||||
dllname = "WinUAE_Bulgarian.dll";
|
||||
dllname = "Bulgarian";
|
||||
break;
|
||||
case LANG_CATALAN:
|
||||
dllname = "WinUAE_Catalan.dll";
|
||||
dllname = "Catalan";
|
||||
break;
|
||||
case LANG_CHINESE:
|
||||
dllname = "WinUAE_Chinese.dll";
|
||||
dllname = "Chinese";
|
||||
break;
|
||||
case LANG_CROATIAN:
|
||||
dllname = "WinUAE_CroatianSerbian.dll";
|
||||
dllname = "CroatianSerbian";
|
||||
break;
|
||||
case LANG_CZECH:
|
||||
dllname = "WinUAE_Czech.dll";
|
||||
dllname = "Czech";
|
||||
break;
|
||||
case LANG_DANISH:
|
||||
dllname = "WinUAE_Danish.dll";
|
||||
dllname = "Danish";
|
||||
break;
|
||||
case LANG_DUTCH:
|
||||
dllname = "WinUAE_Dutch.dll";
|
||||
dllname = "Dutch";
|
||||
break;
|
||||
case LANG_ESTONIAN:
|
||||
dllname = "WinUAE_Estonian.dll";
|
||||
dllname = "Estonian";
|
||||
break;
|
||||
case LANG_FAEROESE:
|
||||
dllname = "WinUAE_Faeroese.dll";
|
||||
dllname = "Faeroese";
|
||||
break;
|
||||
case LANG_FARSI:
|
||||
dllname = "WinUAE_Farsi.dll";
|
||||
dllname = "Farsi";
|
||||
break;
|
||||
case LANG_FINNISH:
|
||||
dllname = "WinUAE_Finnish.dll";
|
||||
dllname = "Finnish";
|
||||
break;
|
||||
case LANG_FRENCH:
|
||||
dllname = "WinUAE_French.dll";
|
||||
dllname = "French";
|
||||
break;
|
||||
case LANG_GEORGIAN:
|
||||
dllname = "WinUAE_Georgian.dll";
|
||||
dllname = "Georgian";
|
||||
break;
|
||||
case LANG_GERMAN:
|
||||
dllname = "WinUAE_German.dll";
|
||||
dllname = "German";
|
||||
break;
|
||||
case LANG_GREEK:
|
||||
dllname = "WinUAE_Greek.dll";
|
||||
dllname = "Greek";
|
||||
break;
|
||||
case LANG_GUJARATI:
|
||||
dllname = "WinUAE_Gujarati.dll";
|
||||
dllname = "Gujarati";
|
||||
break;
|
||||
case LANG_HEBREW:
|
||||
dllname = "WinUAE_Hebrew.dll";
|
||||
dllname = "Hebrew";
|
||||
break;
|
||||
case LANG_HINDI:
|
||||
dllname = "WinUAE_Hindi.dll";
|
||||
dllname = "Hindi";
|
||||
break;
|
||||
case LANG_HUNGARIAN:
|
||||
dllname = "WinUAE_Hungarian.dll";
|
||||
dllname = "Hungarian";
|
||||
break;
|
||||
case LANG_ICELANDIC:
|
||||
dllname = "WinUAE_Icelandic.dll";
|
||||
dllname = "Icelandic";
|
||||
break;
|
||||
case LANG_INDONESIAN:
|
||||
dllname = "WinUAE_Indonesian.dll";
|
||||
dllname = "Indonesian";
|
||||
break;
|
||||
case LANG_ITALIAN:
|
||||
dllname = "WinUAE_Italian.dll";
|
||||
dllname = "Italian";
|
||||
break;
|
||||
case LANG_JAPANESE:
|
||||
dllname = "WinUAE_Japanese.dll";
|
||||
dllname = "Japanese";
|
||||
break;
|
||||
case LANG_KANNADA:
|
||||
dllname = "WinUAE_Kannada.dll";
|
||||
dllname = "Kannada";
|
||||
break;
|
||||
case LANG_KASHMIRI:
|
||||
dllname = "WinUAE_Kashmiri.dll";
|
||||
dllname = "Kashmiri";
|
||||
break;
|
||||
case LANG_KAZAK:
|
||||
dllname = "WinUAE_Kazak.dll";
|
||||
dllname = "Kazak";
|
||||
break;
|
||||
case LANG_KONKANI:
|
||||
dllname = "WinUAE_Konkani.dll";
|
||||
dllname = "Konkani";
|
||||
break;
|
||||
case LANG_KOREAN:
|
||||
dllname = "WinUAE_Korean.dll";
|
||||
dllname = "Korean";
|
||||
break;
|
||||
case LANG_LATVIAN:
|
||||
dllname = "WinUAE_Latvian.dll";
|
||||
dllname = "Latvian";
|
||||
break;
|
||||
case LANG_LITHUANIAN:
|
||||
dllname = "WinUAE_Lithuanian.dll";
|
||||
dllname = "Lithuanian";
|
||||
break;
|
||||
case LANG_MACEDONIAN:
|
||||
dllname = "WinUAE_Macedonian.dll";
|
||||
dllname = "Macedonian";
|
||||
break;
|
||||
case LANG_MALAY:
|
||||
dllname = "WinUAE_Malay.dll";
|
||||
dllname = "Malay";
|
||||
break;
|
||||
case LANG_MALAYALAM:
|
||||
dllname = "WinUAE_Malayalam.dll";
|
||||
dllname = "Malayalam";
|
||||
break;
|
||||
case LANG_MANIPURI:
|
||||
dllname = "WinUAE_Manipuri.dll";
|
||||
dllname = "Manipuri";
|
||||
break;
|
||||
case LANG_MARATHI:
|
||||
dllname = "WinUAE_Marathi.dll";
|
||||
dllname = "Marathi";
|
||||
break;
|
||||
case LANG_NEPALI:
|
||||
dllname = "WinUAE_Nepali.dll";
|
||||
dllname = "Nepali";
|
||||
break;
|
||||
case LANG_NORWEGIAN:
|
||||
dllname = "WinUAE_Norwegian.dll";
|
||||
dllname = "Norwegian";
|
||||
break;
|
||||
case LANG_ORIYA:
|
||||
dllname = "WinUAE_Oriya.dll";
|
||||
dllname = "Oriya";
|
||||
break;
|
||||
case LANG_POLISH:
|
||||
dllname = "WinUAE_Polish.dll";
|
||||
dllname = "Polish";
|
||||
break;
|
||||
case LANG_PORTUGUESE:
|
||||
dllname = "WinUAE_Portuguese.dll";
|
||||
dllname = "Portuguese";
|
||||
break;
|
||||
case LANG_PUNJABI:
|
||||
dllname = "WinUAE_Punjabi.dll";
|
||||
dllname = "Punjabi";
|
||||
break;
|
||||
case LANG_ROMANIAN:
|
||||
dllname = "WinUAE_Romanian.dll";
|
||||
dllname = "Romanian";
|
||||
break;
|
||||
case LANG_RUSSIAN:
|
||||
dllname = "WinUAE_Russian.dll";
|
||||
dllname = "Russian";
|
||||
break;
|
||||
case LANG_SANSKRIT:
|
||||
dllname = "WinUAE_Sanskrit.dll";
|
||||
dllname = "Sanskrit";
|
||||
break;
|
||||
case LANG_SINDHI:
|
||||
dllname = "WinUAE_Sindhi.dll";
|
||||
dllname = "Sindhi";
|
||||
break;
|
||||
case LANG_SLOVAK:
|
||||
dllname = "WinUAE_Slovak.dll";
|
||||
dllname = "Slovak";
|
||||
break;
|
||||
case LANG_SLOVENIAN:
|
||||
dllname = "WinUAE_Slovenian.dll";
|
||||
dllname = "Slovenian";
|
||||
break;
|
||||
case LANG_SPANISH:
|
||||
dllname = "WinUAE_Spanish.dll";
|
||||
dllname = "Spanish";
|
||||
break;
|
||||
case LANG_SWAHILI:
|
||||
dllname = "WinUAE_Swahili.dll";
|
||||
dllname = "Swahili";
|
||||
break;
|
||||
case LANG_SWEDISH:
|
||||
dllname = "WinUAE_Swedish.dll";
|
||||
dllname = "Swedish";
|
||||
break;
|
||||
case LANG_TAMIL:
|
||||
dllname = "WinUAE_Tamil.dll";
|
||||
dllname = "Tamil";
|
||||
break;
|
||||
case LANG_TATAR:
|
||||
dllname = "WinUAE_Tatar.dll";
|
||||
dllname = "Tatar";
|
||||
break;
|
||||
case LANG_TELUGU:
|
||||
dllname = "WinUAE_Telugu.dll";
|
||||
dllname = "Telugu";
|
||||
break;
|
||||
case LANG_THAI:
|
||||
dllname = "WinUAE_Thai.dll";
|
||||
dllname = "Thai";
|
||||
break;
|
||||
case LANG_TURKISH:
|
||||
dllname = "WinUAE_Turkish.dll";
|
||||
dllname = "Turkish";
|
||||
break;
|
||||
case LANG_UKRAINIAN:
|
||||
dllname = "WinUAE_Ukrainian.dll";
|
||||
dllname = "Ukrainian";
|
||||
break;
|
||||
case LANG_URDU:
|
||||
dllname = "WinUAE_Urdu.dll";
|
||||
dllname = "Urdu";
|
||||
break;
|
||||
case LANG_UZBEK:
|
||||
dllname = "WinUAE_Uzbek.dll";
|
||||
dllname = "Uzbek";
|
||||
break;
|
||||
case LANG_VIETNAMESE:
|
||||
dllname = "WinUAE_Vietnamese.dll";
|
||||
dllname = "Vietnamese";
|
||||
break;
|
||||
case 0x400:
|
||||
dllname = "guidll.dll";
|
||||
@ -1425,22 +1439,28 @@ static HMODULE LoadGUI( void )
|
||||
|
||||
if( dllname )
|
||||
{
|
||||
TCHAR szFilename[ MAX_DPATH ];
|
||||
DWORD dwVersionHandle, dwFileVersionInfoSize;
|
||||
LPVOID lpFileVersionData = NULL;
|
||||
BOOL success = FALSE;
|
||||
result = LoadLibrary( dllname );
|
||||
if( result && GetModuleFileName( result, (LPTSTR)&szFilename, MAX_DPATH ) )
|
||||
int fail = 1;
|
||||
|
||||
if (language == 0x400)
|
||||
sprintf (dllbuf, "%sguidll.dll", start_path);
|
||||
else
|
||||
sprintf (dllbuf, "%sWinUAE_%s.dll", start_path, dllname);
|
||||
result = LoadLibrary (dllbuf);
|
||||
if( result)
|
||||
{
|
||||
dwFileVersionInfoSize = GetFileVersionInfoSize( szFilename, &dwVersionHandle );
|
||||
dwFileVersionInfoSize = GetFileVersionInfoSize(dllbuf, &dwVersionHandle );
|
||||
if( dwFileVersionInfoSize )
|
||||
{
|
||||
if( lpFileVersionData = calloc( 1, dwFileVersionInfoSize ) )
|
||||
{
|
||||
if( GetFileVersionInfo( szFilename, 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( vsFileInfo &&
|
||||
@ -1449,9 +1469,9 @@ static HMODULE LoadGUI( void )
|
||||
&& HIWORD(vsFileInfo->dwProductVersionLS) == UAESUBREV)
|
||||
{
|
||||
success = TRUE;
|
||||
write_log ("Translation DLL '%s' loaded and used\n", dllname);
|
||||
write_log ("Translation DLL '%s' loaded and enabled\n", dllbuf);
|
||||
} else {
|
||||
write_log ("Translation DLL '%s' version mismatch (%d.%d.%d)\n", dllname,
|
||||
write_log ("Translation DLL '%s' version mismatch (%d.%d.%d)\n", dllbuf,
|
||||
HIWORD(vsFileInfo->dwProductVersionMS),
|
||||
LOWORD(vsFileInfo->dwProductVersionMS),
|
||||
HIWORD(vsFileInfo->dwProductVersionLS));
|
||||
@ -1462,6 +1482,8 @@ static HMODULE LoadGUI( void )
|
||||
}
|
||||
}
|
||||
}
|
||||
if (fail)
|
||||
write_log ("Translation DLL '%s' failed to load, error %d\n", dllbuf, GetLastError ());
|
||||
if( result && !success )
|
||||
{
|
||||
FreeLibrary( result );
|
||||
@ -1472,6 +1494,24 @@ static HMODULE LoadGUI( void )
|
||||
return result;
|
||||
}
|
||||
|
||||
struct threadpriorities priorities[] = {
|
||||
{ NULL, THREAD_PRIORITY_ABOVE_NORMAL, ABOVE_NORMAL_PRIORITY_CLASS, IDS_PRI_ABOVENORMAL },
|
||||
{ NULL, THREAD_PRIORITY_NORMAL, NORMAL_PRIORITY_CLASS, IDS_PRI_NORMAL },
|
||||
{ NULL, THREAD_PRIORITY_BELOW_NORMAL, BELOW_NORMAL_PRIORITY_CLASS, IDS_PRI_BELOWNORMAL },
|
||||
{ NULL, THREAD_PRIORITY_LOWEST, IDLE_PRIORITY_CLASS, IDS_PRI_LOW },
|
||||
{ 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static void pritransla (void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; priorities[i].id; i++) {
|
||||
char tmp[MAX_DPATH];
|
||||
WIN32GUI_LoadUIString (priorities[i].id, tmp, sizeof (tmp));
|
||||
priorities[i].name = my_strdup (tmp);
|
||||
}
|
||||
}
|
||||
|
||||
/* try to load COMDLG32 and DDRAW, initialize csDraw */
|
||||
int WIN32_InitLibraries( void )
|
||||
@ -1487,6 +1527,7 @@ int WIN32_InitLibraries( void )
|
||||
hRichEdit = LoadLibrary( "RICHED32.DLL" );
|
||||
|
||||
hUIDLL = LoadGUI();
|
||||
pritransla ();
|
||||
|
||||
return result;
|
||||
}
|
||||
@ -1577,7 +1618,7 @@ void target_default_options (struct uae_prefs *p, int type)
|
||||
}
|
||||
}
|
||||
|
||||
void target_save_options (FILE *f, struct uae_prefs *p)
|
||||
void target_save_options (struct zfile *f, struct uae_prefs *p)
|
||||
{
|
||||
cfgfile_write (f, "win32.middle_mouse=%s\n", p->win32_middle_mouse ? "true" : "false");
|
||||
cfgfile_write (f, "win32.logfile=%s\n", p->win32_logfile ? "true" : "false");
|
||||
@ -1693,9 +1734,16 @@ void fetch_configurationpath (char *out, int size)
|
||||
fetch_path ("ConfigurationPath", out, size);
|
||||
}
|
||||
|
||||
static void strip_slashes (char *p)
|
||||
{
|
||||
while (strlen (p) > 0 && (p[strlen (p) - 1] == '\\' || p[strlen (p) - 1] == '/'))
|
||||
p[strlen (p) - 1] = 0;
|
||||
}
|
||||
|
||||
void fetch_path (char *name, char *out, int size)
|
||||
{
|
||||
int size2 = size;
|
||||
|
||||
strcpy (out, start_path);
|
||||
if (!strcmp (name, "FloppyPath"))
|
||||
strcat (out, "..\\shared\\adf\\");
|
||||
@ -1714,10 +1762,18 @@ void fetch_path (char *name, char *out, int size)
|
||||
RegQueryValueEx (hWinUAEKey, name, 0, NULL, out + strlen (out) - 1, &size2);
|
||||
}
|
||||
}
|
||||
strip_slashes (out);
|
||||
if (!strcmp (name, "KickstartPath")) {
|
||||
DWORD v = GetFileAttributes (out);
|
||||
if (v == INVALID_FILE_ATTRIBUTES || !(v & FILE_ATTRIBUTE_DIRECTORY))
|
||||
strcpy (out, start_path);
|
||||
}
|
||||
strncat (out, "\\", size);
|
||||
}
|
||||
void set_path (char *name, char *path)
|
||||
{
|
||||
char tmp[MAX_DPATH];
|
||||
|
||||
if (!path) {
|
||||
strcpy (tmp, start_path);
|
||||
if (!strcmp (name, "KickstartPath"))
|
||||
@ -1733,8 +1789,14 @@ void set_path (char *name, char *path)
|
||||
} else {
|
||||
strcpy (tmp, path);
|
||||
}
|
||||
if (tmp[strlen (tmp) - 1] != '\\' && tmp[strlen (tmp) - 1] != '/')
|
||||
strcat (tmp, "\\");
|
||||
strip_slashes (tmp);
|
||||
if (!strcmp (name, "KickstartPath")) {
|
||||
DWORD v = GetFileAttributes (tmp);
|
||||
if (v == INVALID_FILE_ATTRIBUTES || !(v & FILE_ATTRIBUTE_DIRECTORY))
|
||||
strcpy (tmp, start_path);
|
||||
}
|
||||
strcat (tmp, "\\");
|
||||
|
||||
if (hWinUAEKey)
|
||||
RegSetValueEx (hWinUAEKey, name, 0, REG_SZ, (CONST BYTE *)tmp, strlen (tmp) + 1);
|
||||
}
|
||||
@ -1812,13 +1874,13 @@ static int checkversion (char *vs)
|
||||
if (memcmp (vs, "WinUAE ", 7))
|
||||
return 0;
|
||||
vs += 7;
|
||||
if (parseversion (&vs) < UAEMAJOR)
|
||||
return 1;
|
||||
if (parseversion (&vs) < UAEMINOR)
|
||||
return 1;
|
||||
if (parseversion (&vs) < UAESUBREV)
|
||||
return 1;
|
||||
return 0;
|
||||
if (parseversion (&vs) > UAEMAJOR)
|
||||
return 0;
|
||||
if (parseversion (&vs) > UAEMINOR)
|
||||
return 0;
|
||||
if (parseversion (&vs) >= UAESUBREV)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void WIN32_HandleRegistryStuff( void )
|
||||
@ -1833,7 +1895,6 @@ static void WIN32_HandleRegistryStuff( void )
|
||||
HKEY hWinUAEKeyLocal = NULL;
|
||||
HKEY fkey;
|
||||
int forceroms = 0;
|
||||
int updateversion = 1;
|
||||
|
||||
/* Create/Open the hWinUAEKey which points to our config-info */
|
||||
if( RegCreateKeyEx( HKEY_CLASSES_ROOT, ".uae", 0, "", REG_OPTION_NON_VOLATILE,
|
||||
@ -1889,18 +1950,19 @@ static void WIN32_HandleRegistryStuff( void )
|
||||
RegSetValueEx( hWinUAEKey, "yPosGUI", 0, REG_DWORD, (CONST BYTE *)&colortype, sizeof( colortype ) );
|
||||
}
|
||||
size = sizeof (version);
|
||||
if (RegQueryValueEx( hWinUAEKey, "Version", 0, &dwType, (LPBYTE)&version, &size) == ERROR_SUCCESS) {
|
||||
if (RegQueryValueEx (hWinUAEKey, "Version", 0, &dwType, (LPBYTE)&version, &size) == ERROR_SUCCESS) {
|
||||
if (checkversion (version))
|
||||
forceroms = 1;
|
||||
else
|
||||
updateversion = 0;
|
||||
} else {
|
||||
forceroms = 1;
|
||||
RegSetValueEx (hWinUAEKey, "Version", 0, REG_SZ, (CONST BYTE *)VersionStr, strlen (VersionStr) + 1);
|
||||
}
|
||||
if (updateversion) {
|
||||
// Set this even when we're opening an existing key, so that the version info is always up to date.
|
||||
if (RegSetValueEx( hWinUAEKey, "Version", 0, REG_SZ, (CONST BYTE *)VersionStr, strlen( VersionStr ) + 1 ) != ERROR_SUCCESS)
|
||||
forceroms = 0;
|
||||
size = sizeof (version);
|
||||
if (RegQueryValueEx (hWinUAEKey, "ROMCheckVersion", 0, &dwType, (LPBYTE)&version, &size) == ERROR_SUCCESS) {
|
||||
if (checkversion (version)) {
|
||||
if (RegSetValueEx (hWinUAEKey, "ROMCheckVersion", 0, REG_SZ, (CONST BYTE *)VersionStr, strlen (VersionStr) + 1) == ERROR_SUCCESS)
|
||||
forceroms = 1;
|
||||
}
|
||||
} else {
|
||||
if (RegSetValueEx (hWinUAEKey, "ROMCheckVersion", 0, REG_SZ, (CONST BYTE *)VersionStr, strlen (VersionStr) + 1) == ERROR_SUCCESS)
|
||||
forceroms = 1;
|
||||
}
|
||||
|
||||
RegQueryValueEx( hWinUAEKey, "DisplayInfo", 0, &dwType, (LPBYTE)&colortype, &dwDisplayInfoSize );
|
||||
@ -2218,14 +2280,6 @@ int execute_command (char *cmd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct threadpriorities priorities[] = {
|
||||
{ "Above Normal", THREAD_PRIORITY_ABOVE_NORMAL, ABOVE_NORMAL_PRIORITY_CLASS },
|
||||
{ "Normal", THREAD_PRIORITY_NORMAL, NORMAL_PRIORITY_CLASS },
|
||||
{ "Below Normal", THREAD_PRIORITY_BELOW_NORMAL, BELOW_NORMAL_PRIORITY_CLASS },
|
||||
{ "Low", THREAD_PRIORITY_LOWEST, IDLE_PRIORITY_CLASS },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static int drvsampleres[] = {
|
||||
IDR_DRIVE_CLICK_A500_1, IDR_DRIVE_SPIN_A500_1, IDR_DRIVE_SPINND_A500_1,
|
||||
IDR_DRIVE_STARTUP_A500_1, IDR_DRIVE_SNATCH_A500_1
|
||||
@ -2273,6 +2327,7 @@ static void efix (DWORD *regp, void *p, void *ps, int *got)
|
||||
|
||||
static LONG WINAPI ExceptionFilter( struct _EXCEPTION_POINTERS * pExceptionPointers, DWORD ec)
|
||||
{
|
||||
static uae_u8 *prevpc;
|
||||
LONG lRet = EXCEPTION_CONTINUE_SEARCH;
|
||||
PEXCEPTION_RECORD er = pExceptionPointers->ExceptionRecord;
|
||||
PCONTEXT ctx = pExceptionPointers->ContextRecord;
|
||||
@ -2281,7 +2336,9 @@ static LONG WINAPI ExceptionFilter( struct _EXCEPTION_POINTERS * pExceptionPoint
|
||||
if (ec == EXCEPTION_ACCESS_VIOLATION && !er->ExceptionFlags &&
|
||||
er->NumberParameters >= 2 && !er->ExceptionInformation[0] && regs.pc_p) {
|
||||
void *p = (void*)er->ExceptionInformation[1];
|
||||
if (p >= (void*)regs.pc_p && p < (void*)(regs.pc_p + 32)) {
|
||||
write_log ("%p %p %p\n", p, regs.pc_p, prevpc);
|
||||
if ((p >= (void*)regs.pc_p && p < (void*)(regs.pc_p + 32))
|
||||
|| (p >= (void*)prevpc && p < (void*)(prevpc + 32))) {
|
||||
int got = 0;
|
||||
uaecptr opc = m68k_getpc();
|
||||
void *ps = get_real_address (0);
|
||||
@ -2301,7 +2358,11 @@ static LONG WINAPI ExceptionFilter( struct _EXCEPTION_POINTERS * pExceptionPoint
|
||||
if (got == 0) {
|
||||
write_log ("failed to find and fix the problem (%p). crashing..\n", p);
|
||||
} else {
|
||||
void *ppc = regs.pc_p;
|
||||
m68k_setpc (0);
|
||||
if (ppc != regs.pc_p) {
|
||||
prevpc = (uae_u8*)ppc;
|
||||
}
|
||||
exception2 (opc, (uaecptr)p);
|
||||
lRet = EXCEPTION_CONTINUE_EXECUTION;
|
||||
}
|
||||
@ -2402,7 +2463,7 @@ void systraymenu (HWND hwnd)
|
||||
winuae_inactive (hwnd, FALSE);
|
||||
WIN32GUI_LoadUIString( IDS_STMENUNOFLOPPY, text, sizeof (text));
|
||||
GetCursorPos (&pt);
|
||||
menu = LoadMenu (hInst, MAKEINTRESOURCE (IDM_SYSTRAY));
|
||||
menu = LoadMenu (hUIDLL ? hUIDLL : hInst, MAKEINTRESOURCE (IDM_SYSTRAY));
|
||||
if (!menu)
|
||||
return;
|
||||
menu2 = GetSubMenu (menu, 0);
|
||||
|
||||
@ -75,6 +75,7 @@ struct threadpriorities {
|
||||
char *name;
|
||||
int value;
|
||||
int classvalue;
|
||||
int id;
|
||||
};
|
||||
extern struct threadpriorities priorities[];
|
||||
extern void setpriority (struct threadpriorities *pri);
|
||||
|
||||
@ -86,7 +86,8 @@ struct MultiDisplay Displays[MAX_DISPLAYS];
|
||||
GUID *displayGUID;
|
||||
|
||||
static struct winuae_currentmode currentmodestruct;
|
||||
int display_change_requested;
|
||||
static int screen_is_initialized;
|
||||
int display_change_requested, normal_display_change_starting;
|
||||
extern int console_logging;
|
||||
|
||||
#define SM_WINDOW 0
|
||||
@ -884,6 +885,7 @@ void gfx_unlock_picasso (void)
|
||||
|
||||
static void close_hwnds( void )
|
||||
{
|
||||
screen_is_initialized = 0;
|
||||
#ifdef AVIOUTPUT
|
||||
AVIOutput_Restart ();
|
||||
#endif
|
||||
@ -900,10 +902,6 @@ static void close_hwnds( void )
|
||||
#endif
|
||||
#ifdef D3D
|
||||
D3D_free ();
|
||||
#endif
|
||||
#if 0
|
||||
if (currentmode->flags & DM_W_FULLSCREEN)
|
||||
ChangeDisplaySettings (NULL, 0);
|
||||
#endif
|
||||
ShowWindow (hAmigaWnd, SW_HIDE);
|
||||
DestroyWindow (hAmigaWnd);
|
||||
@ -970,6 +968,9 @@ int check_prefs_changed_gfx (void)
|
||||
{
|
||||
int c = 0;
|
||||
|
||||
if (normal_display_change_starting > 0 && normal_display_change_starting < 4)
|
||||
normal_display_change_starting--;
|
||||
|
||||
c |= currprefs.gfx_width_fs != changed_prefs.gfx_width_fs ? 1 : 0;
|
||||
c |= currprefs.gfx_height_fs != changed_prefs.gfx_height_fs ? 1 : 0;
|
||||
c |= currprefs.gfx_width_win != changed_prefs.gfx_width_win ? 2 : 0;
|
||||
@ -986,6 +987,8 @@ int check_prefs_changed_gfx (void)
|
||||
c |= currprefs.gfx_display != changed_prefs.gfx_display? 1 : 0;
|
||||
if (display_change_requested || c)
|
||||
{
|
||||
if (!display_change_requested)
|
||||
normal_display_change_starting = 4;
|
||||
display_change_requested = 0;
|
||||
fixup_prefs_dimensions (&changed_prefs);
|
||||
currprefs.gfx_width_win = changed_prefs.gfx_width_win;
|
||||
@ -2073,6 +2076,7 @@ static BOOL doInit (void)
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
screen_is_initialized = 1;
|
||||
return 1;
|
||||
|
||||
oops:
|
||||
@ -2127,6 +2131,8 @@ void WIN32GFX_WindowMove ( void )
|
||||
|
||||
void updatedisplayarea (void)
|
||||
{
|
||||
if (!screen_is_initialized)
|
||||
return;
|
||||
if (picasso_on)
|
||||
return;
|
||||
/* Update the display area */
|
||||
@ -2156,7 +2162,9 @@ void updatedisplayarea (void)
|
||||
#endif
|
||||
{
|
||||
if( !isfullscreen() ) {
|
||||
if(DirectDraw_GetLockableType() != overlay_surface)
|
||||
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 );
|
||||
} else {
|
||||
DirectDraw_Blt( primary_surface, NULL, secondary_surface, NULL, DDBLT_WAIT, NULL );
|
||||
|
||||
@ -31,6 +31,7 @@ extern HWND hStatusWnd;
|
||||
extern HINSTANCE hDDraw;
|
||||
extern char *start_path;
|
||||
extern uae_u32 default_freq;
|
||||
extern int normal_display_change_starting;
|
||||
|
||||
extern HDC gethdc (void);
|
||||
extern void releasehdc (HDC hdc);
|
||||
|
||||
@ -79,6 +79,7 @@ static struct uae_prefs *pguiprefs;
|
||||
struct uae_prefs workprefs;
|
||||
static int currentpage;
|
||||
static int qs_request_reset;
|
||||
static int qs_override;
|
||||
int gui_active;
|
||||
|
||||
extern HWND (WINAPI *pHtmlHelp)(HWND, LPCSTR, UINT, LPDWORD );
|
||||
@ -117,8 +118,11 @@ static HWND guiDlg, panelDlg, ToolTipHWND;
|
||||
|
||||
void exit_gui (int ok)
|
||||
{
|
||||
if (!gui_active)
|
||||
return;
|
||||
if (guiDlg == NULL)
|
||||
return;
|
||||
write_log ("exit_gui %d\n", ok);
|
||||
SendMessage (guiDlg, WM_COMMAND, ok ? IDOK : IDCANCEL, 0);
|
||||
}
|
||||
|
||||
@ -431,12 +435,14 @@ static struct ConfigStruct *getconfigstorefrompath (char *path, char *out, int t
|
||||
return 0;
|
||||
}
|
||||
|
||||
int target_cfgfile_load (struct uae_prefs *p, char *filename, int type)
|
||||
int target_cfgfile_load (struct uae_prefs *p, char *filename, int type, int isdefault)
|
||||
{
|
||||
int v, i, type2;
|
||||
DWORD ct, ct2, size;
|
||||
char tmp1[MAX_DPATH], tmp2[MAX_DPATH];
|
||||
|
||||
if (isdefault)
|
||||
qs_override = 1;
|
||||
if (type == 0 || type == 1) {
|
||||
if (p->mountinfo == currprefs.mountinfo)
|
||||
currprefs.mountinfo = 0;
|
||||
@ -482,7 +488,6 @@ void gui_display( int shortcut )
|
||||
int flipflop = 0;
|
||||
HRESULT hr;
|
||||
|
||||
gui_active = 1;
|
||||
#ifdef D3D
|
||||
D3D_guimode (TRUE);
|
||||
#endif
|
||||
@ -508,9 +513,11 @@ void gui_display( int shortcut )
|
||||
WIN32GFX_ClearPalette();
|
||||
manual_painting_needed++; /* So that WM_PAINT will refresh the display */
|
||||
|
||||
hr = DirectDraw_FlipToGDISurface();
|
||||
if (hr != DD_OK)
|
||||
write_log ("FlipToGDISurface failed, %s\n", DXError (hr));
|
||||
if (isfullscreen ()) {
|
||||
hr = DirectDraw_FlipToGDISurface();
|
||||
if (hr != DD_OK)
|
||||
write_log ("FlipToGDISurface failed, %s\n", DXError (hr));
|
||||
}
|
||||
|
||||
if( shortcut == -1 ) {
|
||||
int ret;
|
||||
@ -557,7 +564,6 @@ void gui_display( int shortcut )
|
||||
#ifdef PICASSO96
|
||||
DX_SetPalette (0, 256);
|
||||
#endif
|
||||
gui_active = 0;
|
||||
|
||||
}
|
||||
|
||||
@ -871,7 +877,7 @@ int DiskSelection( HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs,
|
||||
disk_creatediskfile( full_path, 1, SendDlgItemMessage( hDlg, IDC_FLOPPYTYPE, CB_GETCURSEL, 0, 0L ));
|
||||
break;
|
||||
case IDC_LOAD:
|
||||
if (target_cfgfile_load(&workprefs, full_path, 0) == 0)
|
||||
if (target_cfgfile_load(&workprefs, full_path, 0, 0) == 0)
|
||||
{
|
||||
char szMessage[MAX_DPATH];
|
||||
WIN32GUI_LoadUIString (IDS_COULDNOTLOADCONFIG, szMessage, MAX_DPATH);
|
||||
@ -1230,7 +1236,7 @@ static char *HandleConfiguration (HWND hDlg, int flag, struct ConfigStruct *conf
|
||||
WIN32GUI_LoadUIString( IDS_MUSTSELECTCONFIG, szMessage, MAX_DPATH );
|
||||
pre_gui_message (szMessage);
|
||||
} else {
|
||||
if (target_cfgfile_load (&workprefs, path, configtypepanel) == 0) {
|
||||
if (target_cfgfile_load (&workprefs, path, configtypepanel, 0) == 0) {
|
||||
char szMessage[ MAX_DPATH ];
|
||||
WIN32GUI_LoadUIString( IDS_COULDNOTLOADCONFIG, szMessage, MAX_DPATH );
|
||||
pre_gui_message (szMessage);
|
||||
@ -1323,9 +1329,9 @@ static void set_lventry_input (HWND list, int index)
|
||||
|
||||
inputdevice_get_mapped_name (input_selected_device, index, &flags, name, input_selected_sub_num);
|
||||
if (flags & IDEV_MAPPED_AUTOFIRE_SET)
|
||||
strcpy (af, "yes");
|
||||
WIN32GUI_LoadUIString (IDS_YES, af, sizeof (af));
|
||||
else if (flags & IDEV_MAPPED_AUTOFIRE_POSSIBLE)
|
||||
strcpy (af, "no");
|
||||
WIN32GUI_LoadUIString (IDS_YES, af, sizeof (af));
|
||||
else
|
||||
strcpy (af,"-");
|
||||
ListView_SetItemText(list, index, 1, name);
|
||||
@ -1372,7 +1378,7 @@ void InitializeListView( HWND hDlg )
|
||||
RECT rect;
|
||||
char column_heading[ HARDDISK_COLUMNS ][ MAX_COLUMN_HEADING_WIDTH ];
|
||||
char blocksize_str[6] = "";
|
||||
char readwrite_str[4] = "";
|
||||
char readwrite_str[10] = "";
|
||||
char size_str[32] = "";
|
||||
char volname_str[ MAX_DPATH ] = "";
|
||||
char devname_str[ MAX_DPATH ] = "";
|
||||
@ -1523,7 +1529,10 @@ void InitializeListView( HWND hDlg )
|
||||
strcpy (size_str, "n/a");
|
||||
sprintf (bootpri_str, "%d", bootpri);
|
||||
}
|
||||
sprintf( readwrite_str, "%s", readonly ? "no" : "yes" );
|
||||
if (readonly)
|
||||
WIN32GUI_LoadUIString (IDS_NO, readwrite_str, sizeof (readwrite_str));
|
||||
else
|
||||
WIN32GUI_LoadUIString (IDS_YES, readwrite_str, sizeof (readwrite_str));
|
||||
|
||||
lvstruct.mask = LVIF_TEXT | LVIF_PARAM;
|
||||
lvstruct.pszText = devname_str;
|
||||
@ -5352,10 +5361,15 @@ HKEY read_disk_history (void)
|
||||
static void out_floppyspeed (HWND hDlg)
|
||||
{
|
||||
char txt[30];
|
||||
char tmp1[MAX_DPATH];
|
||||
char tmp2[MAX_DPATH];
|
||||
|
||||
WIN32GUI_LoadUIString (IDS_FLOPPY_COMPATIBLE, tmp1, sizeof (tmp1));
|
||||
WIN32GUI_LoadUIString (IDS_FLOPPY_TURBO, tmp2, sizeof (tmp2));
|
||||
if (workprefs.floppy_speed)
|
||||
sprintf (txt, "%d%%%s", workprefs.floppy_speed, workprefs.floppy_speed == 100 ? " (compatible)" : "");
|
||||
sprintf (txt, "%d%%%s", workprefs.floppy_speed, workprefs.floppy_speed == 100 ? tmp1 : "");
|
||||
else
|
||||
strcpy (txt, "Turbo");
|
||||
strcpy (txt, tmp2);
|
||||
SetDlgItemText (hDlg, IDC_FLOPPYSPDTEXT, txt);
|
||||
}
|
||||
|
||||
@ -7616,7 +7630,7 @@ int dragdrop (HWND hDlg, HDROP hd, struct uae_prefs *prefs, int currentpage)
|
||||
strcpy (prefs->flashfile, file);
|
||||
break;
|
||||
case ZFILE_CONFIGURATION:
|
||||
if (target_cfgfile_load (&workprefs, file, 0)) {
|
||||
if (target_cfgfile_load (&workprefs, file, 0, 0)) {
|
||||
if (full_property_sheet) {
|
||||
inputdevice_updateconfig (&workprefs);
|
||||
if (!workprefs.start_gui)
|
||||
@ -7737,6 +7751,8 @@ static int GetSettings (int all_options, HWND hwnd)
|
||||
static int init_called = 0;
|
||||
int psresult;
|
||||
|
||||
gui_active = 1;
|
||||
|
||||
full_property_sheet = all_options;
|
||||
allow_quit = all_options;
|
||||
pguiprefs = &currprefs;
|
||||
@ -7775,7 +7791,7 @@ static int GetSettings (int all_options, HWND hwnd)
|
||||
ABOUT_ID = init_page (IDD_ABOUT, IDI_ABOUT, IDS_ABOUT, AboutDlgProc, NULL);
|
||||
C_PAGES = ABOUT_ID + 1;
|
||||
init_called = 1;
|
||||
if (quickstart)
|
||||
if (quickstart && !qs_override)
|
||||
currentpage = QUICKSTART_ID;
|
||||
else
|
||||
currentpage = LOADSAVE_ID;
|
||||
@ -7794,6 +7810,7 @@ static int GetSettings (int all_options, HWND hwnd)
|
||||
|
||||
qs_request_reset = 0;
|
||||
full_property_sheet = 0;
|
||||
gui_active = 0;
|
||||
return psresult;
|
||||
}
|
||||
|
||||
|
||||
2
uaelib.c
2
uaelib.c
@ -361,6 +361,7 @@ static uae_u32 uaelib_demux (void)
|
||||
#define ARG2 (get_long (m68k_areg (regs, 7) + 12))
|
||||
#define ARG3 (get_long (m68k_areg (regs, 7) + 16))
|
||||
#define ARG4 (get_long (m68k_areg (regs, 7) + 20))
|
||||
#define ARG5 (get_long (m68k_areg (regs, 7) + 24))
|
||||
|
||||
switch (ARG0) {
|
||||
case 0: return emulib_GetVersion ();
|
||||
@ -414,6 +415,7 @@ static uae_u32 uaelib_demux (void)
|
||||
|
||||
case 80: return currprefs.maprom ? currprefs.maprom : 0xffffffff;
|
||||
case 81: return cfgfile_uaelib (ARG1, ARG2, ARG3, ARG4);
|
||||
case 82: return cfgfile_uaelib_modify (ARG1, ARG2, ARG3, ARG4, ARG5);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
2191
winuaechangelog.txt
2191
winuaechangelog.txt
File diff suppressed because it is too large
Load Diff
15
zfile.c
15
zfile.c
@ -745,8 +745,11 @@ size_t zfile_fread (void *b, size_t l1, size_t l2,struct zfile *z)
|
||||
{
|
||||
long len = l1 * l2;
|
||||
if (z->data) {
|
||||
if (z->seek + len > z->size)
|
||||
if (z->seek + len > z->size) {
|
||||
len = z->size - z->seek;
|
||||
if (len < 0)
|
||||
len = 0;
|
||||
}
|
||||
memcpy (b, z->data + z->seek, len);
|
||||
z->seek += len;
|
||||
return len;
|
||||
@ -754,12 +757,20 @@ size_t zfile_fread (void *b, size_t l1, size_t l2,struct zfile *z)
|
||||
return fread (b, l1, l2, z->f);
|
||||
}
|
||||
|
||||
size_t zfile_fputs (struct zfile *z, char *s)
|
||||
{
|
||||
return zfile_fwrite (s, strlen (s), 1, z);
|
||||
}
|
||||
|
||||
size_t zfile_fwrite (void *b, size_t l1, size_t l2, struct zfile *z)
|
||||
{
|
||||
long len = l1 * l2;
|
||||
if (z->data) {
|
||||
if (z->seek + len > z->size)
|
||||
if (z->seek + len > z->size) {
|
||||
len = z->size - z->seek;
|
||||
if (len < 0)
|
||||
len = 0;
|
||||
}
|
||||
memcpy (z->data + z->seek, b, len);
|
||||
z->seek += len;
|
||||
return len;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user