From e7fef859246c7914a5b3d6663d54d5b15030d05f Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sat, 10 Jul 2004 19:31:41 +0300 Subject: [PATCH] imported winuaesrc0990b9.zip --- audio.c | 48 ++++--- cfgfile.c | 63 +++++---- driveclick.c | 4 +- filesys.c | 23 +++- hardfile.c | 74 ++++++++--- include/gui.h | 2 +- include/memory.h | 1 + include/options.h | 7 +- main.c | 4 +- memory.c | 97 ++++++++------ newcpu.c | 9 +- od-win32/avioutput.c | 6 +- od-win32/dinput.c | 2 +- od-win32/hardfile_win32.c | 8 +- od-win32/resources/resource.h | 9 +- od-win32/resources/winuae.rc | 67 ++++++---- od-win32/sounddep/sound.c | 16 ++- od-win32/win32.c | 44 ++++++- od-win32/win32.h | 13 +- od-win32/win32gfx.c | 167 ++++++++++++++---------- od-win32/win32gui.c | 144 ++++++++++++-------- od-win32/win32gui.h | 1 + od-win32/winuae_msvc/winuae_msvc.vcproj | 5 +- 23 files changed, 503 insertions(+), 311 deletions(-) diff --git a/audio.c b/audio.c index b1b92db8..bbf8b10c 100755 --- a/audio.c +++ b/audio.c @@ -74,7 +74,7 @@ void init_sound_table16 (void) for (i = 0; i < 256; i++) for (j = 0; j < 64; j++) - sound_table[j][i] = j * (uae_s8)i * (currprefs.stereo ? 2 : 1); + sound_table[j][i] = j * (uae_s8)i * (currprefs.sound_stereo ? 2 : 1); } void init_sound_table8 (void) @@ -83,7 +83,7 @@ void init_sound_table8 (void) for (i = 0; i < 256; i++) for (j = 0; j < 64; j++) - sound_table[j][i] = (j * (uae_s8)i * (currprefs.stereo ? 2 : 1)) / 256; + sound_table[j][i] = (j * (uae_s8)i * (currprefs.sound_stereo ? 2 : 1)) / 256; } #define MULTIPLICATION_PROFITABLE @@ -101,14 +101,14 @@ typedef uae_u8 sample8_t; #endif /* Always put the right word before the left word. */ -#define DELAY_BUFFER 32 -static uae_u32 right_word_saved[DELAY_BUFFER]; -static uae_u32 left_word_saved[DELAY_BUFFER]; +#define MAX_DELAY_BUFFER 1024 +static uae_u32 right_word_saved[MAX_DELAY_BUFFER]; +static uae_u32 left_word_saved[MAX_DELAY_BUFFER]; static int saved_ptr; STATIC_INLINE void put_sound_word_right (uae_u32 w) { - if (currprefs.mixed_stereo) { + if (currprefs.sound_mixed_stereo) { right_word_saved[saved_ptr] = w; return; } @@ -117,21 +117,27 @@ STATIC_INLINE void put_sound_word_right (uae_u32 w) STATIC_INLINE void put_sound_word_left (uae_u32 w) { - if (currprefs.mixed_stereo) { + if (currprefs.sound_mixed_stereo) { uae_u32 rold, lold, rnew, lnew, tmp; + int mul1 = 32 - currprefs.sound_stereo_separation; + int mul2 = 32 + currprefs.sound_stereo_separation; left_word_saved[saved_ptr] = w; lnew = w - SOUND16_BASE_VAL; rnew = right_word_saved[saved_ptr] - SOUND16_BASE_VAL; - saved_ptr = (saved_ptr + 1) & (DELAY_BUFFER - 1); + if (currprefs.sound_mixed_stereo > 0) + saved_ptr = (saved_ptr + 1) & ((1 << (currprefs.sound_mixed_stereo - 1)) - 1); + else + saved_ptr = 0; + lold = left_word_saved[saved_ptr] - SOUND16_BASE_VAL; - tmp = (rnew * 5 + lold * 3) >> 3; + tmp = (rnew * mul1 + lold * mul2) >> 6; tmp += SOUND16_BASE_VAL; PUT_SOUND_WORD_RIGHT (tmp); rold = right_word_saved[saved_ptr] - SOUND16_BASE_VAL; - w = (lnew * 5 + rold * 3) >> 3; + w = (lnew * mul1 + rold * mul2) >> 6; } PUT_SOUND_WORD_LEFT (w); } @@ -328,14 +334,14 @@ void sample16s_handler (void) data0 += data3; { - uae_u32 data = SBASEVAL16(1) + data0; + uae_u32 data = SBASEVAL16(1) + data0; FINISH_DATA (data, 16, 1); put_sound_word_right (data); } data1 += data2; { - uae_u32 data = SBASEVAL16(1) + data1; + uae_u32 data = SBASEVAL16(1) + data1; FINISH_DATA (data, 16, 1); put_sound_word_left (data); } @@ -407,13 +413,13 @@ void sample16si_crux_handler (void) data1 += data2; data0 += data3; { - uae_u32 data = SBASEVAL16 (1) + data0; + uae_u32 data = SBASEVAL16(1) + data0; FINISH_DATA (data, 16, 1); put_sound_word_right (data); } { - uae_u32 data = SBASEVAL16 (1) + data1; + uae_u32 data = SBASEVAL16(1) + data1; FINISH_DATA (data, 16, 1); put_sound_word_left (data); } @@ -465,13 +471,13 @@ void sample16si_rh_handler (void) ratio = ((audio_channel[3].evtime % delta) << 8) / delta; data0 += (data3 * (256 - ratio) + data3p * ratio) >> 8; { - uae_u32 data = SBASEVAL16 (1) + data0; + uae_u32 data = SBASEVAL16(1) + data0; FINISH_DATA (data, 16, 1); put_sound_word_right (data); } { - uae_u32 data = SBASEVAL16 (1) + data1; + uae_u32 data = SBASEVAL16(1) + data1; FINISH_DATA (data, 16, 1); put_sound_word_left (data); } @@ -733,8 +739,9 @@ STATIC_INLINE int sound_prefs_changed (void) { return (changed_prefs.produce_sound != currprefs.produce_sound || changed_prefs.win32_soundcard != currprefs.win32_soundcard - || changed_prefs.stereo != currprefs.stereo - || changed_prefs.mixed_stereo != currprefs.mixed_stereo + || changed_prefs.sound_stereo != currprefs.sound_stereo + || changed_prefs.sound_stereo_separation != currprefs.sound_stereo_separation + || changed_prefs.sound_mixed_stereo != currprefs.sound_mixed_stereo || changed_prefs.sound_maxbsiz != currprefs.sound_maxbsiz || changed_prefs.sound_freq != currprefs.sound_freq || changed_prefs.sound_adjust != currprefs.sound_adjust @@ -756,8 +763,9 @@ void check_prefs_changed_audio (void) currprefs.produce_sound = changed_prefs.produce_sound; currprefs.win32_soundcard = changed_prefs.win32_soundcard; - currprefs.stereo = changed_prefs.stereo; - currprefs.mixed_stereo = changed_prefs.mixed_stereo; + currprefs.sound_stereo = changed_prefs.sound_stereo; + currprefs.sound_stereo_separation = changed_prefs.sound_stereo_separation; + currprefs.sound_mixed_stereo = changed_prefs.sound_mixed_stereo; currprefs.sound_adjust = changed_prefs.sound_adjust; currprefs.sound_interpol = changed_prefs.sound_interpol; currprefs.sound_freq = changed_prefs.sound_freq; diff --git a/cfgfile.c b/cfgfile.c index b85c4bb9..2e706735 100755 --- a/cfgfile.c +++ b/cfgfile.c @@ -129,9 +129,7 @@ static const char *soundmode1[] = { "none", "interrupts", "normal", "exact", 0 } static const char *soundmode2[] = { "none", "interrupts", "good", "best", 0 }; static const char *centermode1[] = { "none", "simple", "smart", 0 }; static const char *centermode2[] = { "false", "true", "smart", 0 }; -static const char *stereomode1[] = { "mono", "stereo", "mixed", 0 }; -static const char *stereomode2[] = { "m", "s", "x", 0 }; -static const char *stereomode3[] = { "1", "2", "3", 0 }; +static const char *stereomode[] = { "mono", "stereo", "mixed", 0 }; static const char *interpolmode[] = { "none", "rh", "crux", 0 }; static const char *collmode[] = { "none", "sprites", "playfields", "full", 0 }; static const char *compmode[] = { "direct", "indirect", "indirectKS", "afterPic", 0 }; @@ -257,7 +255,10 @@ void save_options (FILE *f, struct uae_prefs *p, int type) cfgfile_write (f, "sound_output=%s\n", soundmode1[p->produce_sound]); cfgfile_write (f, "sound_bits=%d\n", p->sound_bits); - cfgfile_write (f, "sound_channels=%s\n", stereomode1[p->stereo + p->mixed_stereo]); + cfgfile_write (f, "sound_channels=%s\n", stereomode[p->sound_stereo]); + cfgfile_write (f, "sound_stereo_separation=%d\n", p->sound_stereo_separation); + cfgfile_write (f, "sound_stereo_mixing_delay=%d\n", p->sound_mixed_stereo); + cfgfile_write (f, "sound_max_buff=%d\n", p->sound_maxbsiz); cfgfile_write (f, "sound_frequency=%d\n", p->sound_freq); cfgfile_write (f, "sound_interpol=%s\n", interpolmode[p->sound_interpol]); @@ -576,6 +577,8 @@ static int cfgfile_parse_host (struct uae_prefs *p, char *option, char *value) || cfgfile_intval (option, value, "sound_frequency", &p->sound_freq, 1) || cfgfile_intval (option, value, "sound_adjust", &p->sound_adjust, 1) || cfgfile_intval (option, value, "sound_volume", &p->sound_volume, 1) + || cfgfile_intval (option, value, "sound_stereo_separation", &p->sound_stereo_separation, 1) + || cfgfile_intval (option, value, "sound_stereo_mixing", &p->sound_mixed_stereo, 1) || cfgfile_intval (option, value, "gfx_display", &p->gfx_display, 1) || cfgfile_intval (option, value, "gfx_framerate", &p->gfx_framerate, 1) @@ -708,14 +711,11 @@ static int cfgfile_parse_host (struct uae_prefs *p, char *option, char *value) return 1; } - if (cfgfile_strval (option, value, "sound_channels", &p->stereo, stereomode1, 1) - || cfgfile_strval (option, value, "sound_channels", &p->stereo, stereomode2, 1) - || cfgfile_strval (option, value, "sound_channels", &p->stereo, stereomode3, 0)) - { - p->mixed_stereo = 0; - if (p->stereo == 2) { - p->stereo = 1; - p->mixed_stereo = 1; + if (cfgfile_strval (option, value, "sound_channels", &p->sound_stereo, stereomode, 1)) { + if (p->sound_stereo > 1) { /* "mixed stereo" compatibility hack */ + p->sound_stereo = 1; + p->sound_mixed_stereo = 5; + p->sound_stereo_separation = 21; } return 1; } @@ -1397,13 +1397,14 @@ static void parse_sound_spec (struct uae_prefs *p, char *spec) } p->produce_sound = atoi (x0); if (x1) { - p->mixed_stereo = 0; - if (*x1 == 'S') - p->stereo = p->mixed_stereo = 1; - else if (*x1 == 's') - p->stereo = 1; + p->sound_stereo_separation = 32; + if (*x1 == 'S') { + p->sound_stereo = 1; + p->sound_stereo_separation = 20; + } else if (*x1 == 's') + p->sound_stereo = 1; else - p->stereo = 0; + p->sound_stereo = 0; } if (x2) p->sound_bits = atoi (x2); @@ -1830,7 +1831,9 @@ void default_prefs (struct uae_prefs *p, int type) p->keyboard_lang = KBD_LANG_US; p->produce_sound = 3; - p->stereo = 1; + p->sound_stereo = 1; + p->sound_stereo_separation = 21; + p->sound_mixed_stereo = -1; p->sound_bits = DEFAULT_SOUND_BITS; p->sound_freq = DEFAULT_SOUND_FREQ; p->sound_maxbsiz = DEFAULT_SOUND_MAXB; @@ -1994,7 +1997,9 @@ static void buildin_default_prefs (struct uae_prefs *p) p->tod_hack = 0; p->maprom = 0; p->sound_filter = 1; - p->stereo = 1; + p->sound_stereo = 1; + p->sound_stereo_separation = 21; + p->sound_mixed_stereo = -1; p->chipmem_size = 0x00080000; p->bogomem_size = 0x00080000; @@ -2082,7 +2087,8 @@ static int bip_cdtv (struct uae_prefs *p, int config, int compa, int romcheck) return 0; roms[0] = 20; roms[1] = 21; - roms[2] = -1; + roms[2] = 22; + roms[3] = -1; if (!configure_rom (p, roms, romcheck)) return 0; p->bogomem_size = 0; @@ -2214,14 +2220,13 @@ static int bip_super (struct uae_prefs *p, int config, int compa, int romcheck) { int roms[8]; - roms[0] = 17; - roms[1] = 16; - roms[2] = 31; - roms[3] = 15; - roms[4] = 14; - roms[5] = 12; - roms[6] = 11; - roms[7] = -1; + roms[0] = 16; + roms[1] = 31; + roms[2] = 15; + roms[3] = 14; + roms[4] = 12; + roms[5] = 11; + roms[6] = -1; p->bogomem_size = 0; p->chipmem_size = 0x400000; p->z3fastmem_size = 8 * 1024 * 1024; diff --git a/driveclick.c b/driveclick.c index f9c364f3..f2f36ce2 100755 --- a/driveclick.c +++ b/driveclick.c @@ -205,7 +205,7 @@ static int clickcnt; static void mix (void) { - int total = ((uae_u8*)sndbufpt - (uae_u8*)sndbuffer) / (currprefs.stereo ? 4 : 2); + int total = ((uae_u8*)sndbufpt - (uae_u8*)sndbuffer) / (currprefs.sound_stereo ? 4 : 2); if (currprefs.dfxclickvolume > 0) { while (clickcnt < total) { @@ -235,7 +235,7 @@ void driveclick_mix (uae_s16 *sndbuffer, int size) return; mix(); clickcnt = 0; - if (currprefs.stereo) { + if (currprefs.sound_stereo) { for (i = 0; i < size / 2; i++) { uae_s16 s = clickbuffer[i]; sndbuffer[0] = limit(((sndbuffer[0] + s) * 2) / 3); diff --git a/filesys.c b/filesys.c index 170db9b7..fb93a7cd 100755 --- a/filesys.c +++ b/filesys.c @@ -174,7 +174,6 @@ typedef struct { int rdb_filesyssize; char *filesysdir; - } UnitInfo; struct uaedev_mount_info { @@ -1295,6 +1294,8 @@ static a_inode *get_aino (Unit *unit, a_inode *base, const char *rel, uae_u32 *e static void startup_update_unit (Unit *unit, UnitInfo *uinfo) { + if (!unit) + return; unit->ui.devname = uinfo->devname; xfree (unit->ui.volname); unit->ui.volname = my_strdup (uinfo->volname); /* might free later for rename */ @@ -3489,11 +3490,22 @@ static uae_u32 filesys_handler (void) return 0; } +static void init_filesys_diagentry (void) +{ + do_put_mem_long ((uae_u32 *)(filesysory + 0x2100), EXPANSION_explibname); + do_put_mem_long ((uae_u32 *)(filesysory + 0x2104), filesys_configdev); + do_put_mem_long ((uae_u32 *)(filesysory + 0x2108), EXPANSION_doslibname); + do_put_mem_long ((uae_u32 *)(filesysory + 0x210c), current_mountinfo->num_units); + native2amiga_startup(); +} + void filesys_start_threads (void) { UnitInfo *uip; int i; + if (savestate_state == STATE_RESTORE) + init_filesys_diagentry (); current_mountinfo = currprefs.mountinfo; uip = current_mountinfo->ui; for (i = 0; i < current_mountinfo->num_units; i++) { @@ -3594,11 +3606,7 @@ static uae_u32 filesys_diagentry (void) TRACE (("filesystem: diagentry called\n")); filesys_configdev = m68k_areg (regs, 3); - - do_put_mem_long ((uae_u32 *)(filesysory + 0x2100), EXPANSION_explibname); - do_put_mem_long ((uae_u32 *)(filesysory + 0x2104), filesys_configdev); - do_put_mem_long ((uae_u32 *)(filesysory + 0x2108), EXPANSION_doslibname); - do_put_mem_long ((uae_u32 *)(filesysory + 0x210c), current_mountinfo->num_units); + init_filesys_diagentry (); uae_sem_init (&singlethread_int_sem, 0, 1); if (ROM_hardfile_resid != 0) { @@ -3625,7 +3633,6 @@ static uae_u32 filesys_diagentry (void) * diag entry. */ resaddr = scsidev_startup(resaddr); - native2amiga_startup(); /* scan for Residents and return pointer to array of them */ residents = resaddr; @@ -4462,6 +4469,7 @@ uae_u8 *save_filesys (int num, int *len) save_u8 (ui->bootpri); save_u8 (ui->readonly); save_u32 (ui->startup); + save_u32 (filesys_configdev); if (type == FILESYS_VIRTUAL) dst = save_filesys_virtual (ui, dst); *len = dst - dstbak; @@ -4494,6 +4502,7 @@ uae_u8 *restore_filesys (uae_u8 *src) } ui = ¤t_mountinfo->ui[devno]; ui->startup = restore_u32 (); + filesys_configdev = restore_u32 (); if (type == FILESYS_VIRTUAL) src = restore_filesys_virtual (ui, src); end: diff --git a/hardfile.c b/hardfile.c index c5ec6ad5..5acb6382 100755 --- a/hardfile.c +++ b/hardfile.c @@ -111,11 +111,12 @@ static uae_u64 cmd_read (struct hardfiledata *hfd, uaecptr dataptr, uae_u64 offs { uae_u64 got = 0; uae_u8 buffer[FILESYS_MAX_BLOCKSIZE]; + int i; gui_hd_led (1); hf_log2 ("cmd_read: %p %04.4x-%08.8x %08.8x\n", dataptr, (uae_u32)(offset >> 32), (uae_u32)offset, (uae_u32)len); while (len > 0) { - int i, got2; + int got2; got2 = hdf_read (hfd, buffer, offset, hfd->blocksize); if (got2 != hfd->blocksize) break; @@ -133,11 +134,19 @@ static uae_u64 cmd_write (struct hardfiledata *hfd, uaecptr dataptr, uae_u64 off { uae_u64 got = 0; uae_u8 buffer[FILESYS_MAX_BLOCKSIZE]; + int i; gui_hd_led (1); hf_log2 ("cmd_write: %p %04.4x-%08.8x %08.8x\n", dataptr, (uae_u32)(offset >> 32), (uae_u32)offset, (uae_u32)len); + if (offset + len >= hfd->size) { + write_log ("read access out of bounds %08.8X-%08.8X + %08.8X-%08.8X >= %08.8X-%08.8X\n", + (uae_u32)(offset >> 32),(uae_u32)offset,(uae_u32)(len >> 32),(uae_u32)len, + (uae_u32)((offset + len) >> 32),(uae_u32)(offset+len)); + for (i = 0; i < len; i++) + put_byte (dataptr + i, 0); + } while (len > 0) { - int i, got2; + int got2; for (i = 0; i < hfd->blocksize; i++) buffer[i] = get_byte (dataptr + i); got2 = hdf_write (hfd, buffer, offset, hfd->blocksize); @@ -447,6 +456,19 @@ static uae_u32 hardfile_expunge (void) return 0; /* Simply ignore this one... */ } +static void outofbounds (int cmd, uae_u64 offset, uae_u64 len, uae_u64 max) +{ + write_log ("cmd %d: out of bounds, %08.8X-%08.8X + %08.8X-%08.8X >= %08.8X-%08.8X\n", cmd, + (uae_u32)(offset >> 32),(uae_u32)offset,(uae_u32)(len >> 32),(uae_u32)len, + (uae_u32)(max >> 32),(uae_u32)max); +} +static void unaligned (int cmd, uae_u64 offset, uae_u64 len, int blocksize) +{ + write_log ("cmd %d: unaligned access, %08.8X-%08.8X, %08.8X-%08.8X, %08.8X\n", cmd, + (uae_u32)(offset >> 32),(uae_u32)offset,(uae_u32)(len >> 32),(uae_u32)len, + blocksize); +} + static uae_u32 hardfile_do_io (struct hardfiledata *hfd, struct hardfileprivdata *hfpd, uaecptr request) { uae_u32 dataptr, offset, actual = 0, cmd; @@ -461,31 +483,39 @@ static uae_u32 hardfile_do_io (struct hardfiledata *hfd, struct hardfileprivdata switch (cmd) { case CMD_READ: +#if 0 if (dataptr & 1) goto bad_command; +#endif offset = get_long (request + 44); - if (offset & bmask) - goto bad_command; len = get_long (request + 36); /* io_Length */ - if (len & bmask) + if ((offset & bmask) || (len & bmask)) { + unaligned (cmd, offset, len, hfd->blocksize); goto bad_command; - if (len + offset > hfd->size) + } + if (len + offset > hfd->size) { + outofbounds (cmd, offset, len, hfd->size); goto bad_command; + } actual = (uae_u32)cmd_read (hfd, dataptr, offset, len); break; case TD_READ64: case NSCMD_TD_READ64: +#if 0 if (dataptr & 1) goto bad_command; +#endif offset64 = get_long (request + 44) | ((uae_u64)get_long (request + 32) << 32); - if (offset64 & bmask) - goto bad_command; len = get_long (request + 36); /* io_Length */ - if (len & bmask) + if ((offset64 & bmask) || (len & bmask)) { + unaligned (cmd, offset64, len, hfd->blocksize); goto bad_command; - if (len + offset64 > hfd->size) + } + if (len + offset64 > hfd->size) { + outofbounds (cmd, offset64, len, hfd->size); goto bad_command; + } actual = (uae_u32)cmd_read (hfd, dataptr, offset64, len); break; @@ -494,16 +524,20 @@ static uae_u32 hardfile_do_io (struct hardfiledata *hfd, struct hardfileprivdata if (hfd->readonly) { error = 28; /* write protect */ } else { +#if 0 if (dataptr & 1) goto bad_command; +#endif offset = get_long (request + 44); - if (offset & bmask) - goto bad_command; len = get_long (request + 36); /* io_Length */ - if (len & bmask) + if ((offset & bmask) || (len & bmask)) { + unaligned (cmd, offset, len, hfd->blocksize); goto bad_command; - if (len + offset > hfd->size) + } + if (len + offset > hfd->size) { + outofbounds (cmd, offset, len, hfd->size); goto bad_command; + } actual = (uae_u32)cmd_write (hfd, dataptr, offset, len); } break; @@ -515,16 +549,20 @@ static uae_u32 hardfile_do_io (struct hardfiledata *hfd, struct hardfileprivdata if (hfd->readonly) { error = 28; /* write protect */ } else { +#if 0 if (dataptr & 1) goto bad_command; +#endif offset64 = get_long (request + 44) | ((uae_u64)get_long (request + 32) << 32); - if (offset64 & bmask) - goto bad_command; len = get_long (request + 36); /* io_Length */ - if (len & bmask) + if ((offset64 & bmask) || (len & bmask)) { + unaligned (cmd, offset64, len, hfd->blocksize); goto bad_command; - if (len + offset64 > hfd->size) + } + if (len + offset64 > hfd->size) { + outofbounds (cmd, offset64, len, hfd->size); goto bad_command; + } put_long (request + 32, (uae_u32)cmd_write (hfd, dataptr, offset64, len)); } break; diff --git a/include/gui.h b/include/gui.h index e865ce19..89638e01 100755 --- a/include/gui.h +++ b/include/gui.h @@ -47,7 +47,7 @@ int translate_message (int msg, char *out); typedef enum { NUMSG_NEEDEXT2, NUMSG_NOROMKEY, NUMSG_KSROMCRCERROR, NUMSG_KSROMREADERROR, NUMSG_NOEXTROM, NUMSG_MODRIP_NOTFOUND, NUMSG_MODRIP_FINISHED, NUMSG_MODRIP_SAVE, - NUMSG_KS68020, NUMSG_ROMNEED, NUMSG_NOZLIB, NUMSG_STATEHD, + NUMSG_KS68EC020, NUMSG_KS68020, NUMSG_ROMNEED, NUMSG_NOZLIB, NUMSG_STATEHD, NUMSG_NOCAPS, NUMSG_OLDCAPS, } notify_user_msg; diff --git a/include/memory.h b/include/memory.h index e7bf3501..485d9b25 100755 --- a/include/memory.h +++ b/include/memory.h @@ -250,6 +250,7 @@ struct romdata { uae_u32 size; int id; int cpu; + int cloanto; int type; }; diff --git a/include/options.h b/include/options.h index 44b1ff12..737627f0 100755 --- a/include/options.h +++ b/include/options.h @@ -72,8 +72,9 @@ struct uae_prefs { int test_drawing_speed; int produce_sound; - int stereo; - int mixed_stereo; + int sound_stereo; + int sound_stereo_separation; + int sound_mixed_stereo; int sound_bits; int sound_freq; int sound_maxbsiz; @@ -190,8 +191,10 @@ struct uae_prefs { int x11_use_dgamode; int x11_hide_cursor; int svga_no_linear; + int win32_middle_mouse; int win32_logfile; + int win32_notaskbarbutton; int win32_active_priority; int win32_inactive_priority; diff --git a/main.c b/main.c index 88658040..cd7d04c4 100755 --- a/main.c +++ b/main.c @@ -156,7 +156,7 @@ static void fix_options (void) write_log ("Can't use a graphics card or Zorro III fastmem when using a 24 bit\n" "address space - sorry.\n"); } - if (currprefs.bogomem_size != 0 && currprefs.bogomem_size != 0x80000 && currprefs.bogomem_size != 0x100000 && currprefs.bogomem_size != 0x180000) + if (currprefs.bogomem_size != 0 && currprefs.bogomem_size != 0x80000 && currprefs.bogomem_size != 0x100000 && currprefs.bogomem_size != 0x180000 && currprefs.bogomem_size != 0x1c0000) { currprefs.bogomem_size = 0; write_log ("Unsupported bogomem size!\n"); @@ -506,6 +506,8 @@ void reset_all_systems (void) void do_start_program (void) { + if (quit_program == -1) + return; /* Do a reset on startup. Whether this is elegant is debatable. */ inputdevice_updateconfig (&currprefs); quit_program = 2; diff --git a/memory.c b/memory.c index 918869bb..e5926f2a 100755 --- a/memory.c +++ b/memory.c @@ -91,46 +91,46 @@ void romlist_clear (void) } static struct romdata roms[] = { - { "Cloanto Amiga Forever ROM key", 0, 0, 0x869ae1b1, 2069, 0, 68000, ROMTYPE_KEY }, - - { "Kickstart v1.0 (A1000)(NTSC)", 0, 0, 0x299790ff, 262144, 1, 68000, ROMTYPE_KICK }, - { "Kickstart v1.1 (A1000)(NTSC)", 31, 34, 0xd060572a, 262144, 2, 68000, ROMTYPE_KICK }, - { "Kickstart v1.1 (A1000)(PAL)", 31, 34, 0xec86dae2, 262144, 3, 68000, ROMTYPE_KICK }, - { "Kickstart v1.2 (A1000)", 33, 166, 0x0ed783d0, 262144, 4, 68000, ROMTYPE_KICK }, - { "Kickstart v1.2 (A500,A1000,A2000)", 33, 180, 0xa6ce1636, 262144, 5, 68000, ROMTYPE_KICK }, - { "Kickstart v1.3 (A500,A1000,A2000)", 34, 5, 0xc4f0f55f, 262144, 6, 68000, ROMTYPE_KICK }, - { "Kickstart v1.3 (A3000)", 34, 5, 0xe0f37258, 262144, 32, 68000, ROMTYPE_KICK }, - - { "Kickstart v2.04 (A500+)", 37, 175, 0xc3bdb240, 524288, 7, 68000, ROMTYPE_KICK }, - { "Kickstart v2.05 (A600)", 37, 299, 0x83028fb5, 524288, 8, 68000, ROMTYPE_KICK }, - { "Kickstart v2.05 (A600HD)", 37, 300, 0x64466c2a, 524288, 9, 68000, ROMTYPE_KICK }, - { "Kickstart v2.05 (A600HD)", 37, 350, 0x43b0df7b, 524288, 10, 68000, ROMTYPE_KICK }, - - { "Kickstart v3.0 (A1200)", 39, 106, 0x6c9b07d2, 524288, 11, 68000, ROMTYPE_KICK }, - { "Kickstart v3.0 (A4000)", 39, 106, 0x9e6ac152, 524288, 12, 68020, ROMTYPE_KICK }, -// { "Kickstart v3.1", 40, 55, 0x14e93bcc, 524288, 13, 68020, ROMTYPE_KICK }, !! HACK - { "Kickstart v3.1 (A500,A600,A2000)", 40, 63, 0xfc24ae0d, 524288, 14, 68000, ROMTYPE_KICK }, - { "Kickstart v3.1 (A1200)", 40, 68, 0x1483a091, 524288, 15, 68020, ROMTYPE_KICK }, - { "Kickstart v3.1 (A4000)(Cloanto)", 40, 68, 0x43b6dd22, 524288, 31, 68020, ROMTYPE_KICK }, - { "Kickstart v3.1 (A4000)", 40, 68, 0xd6bae334, 524288, 16, 68020, ROMTYPE_KICK }, - { "Kickstart v3.1 (A4000T)", 40, 70, 0x75932c3a, 524288, 17, 68020, ROMTYPE_KICK }, - - { "CD32 Kickstart v3.1", 40, 60, 0x1e62d4a5, 524288, 18, 68020, ROMTYPE_KICKCD32 }, - { "CD32 Extended", 40, 60, 0x87746be2, 524288, 19, 68020, ROMTYPE_EXTCD32 }, - - { "CDTV Extended v1.0", 0, 0, 0x42baa124, 262144, 20, 68000, ROMTYPE_EXTCDTV }, - { "CDTV Extended v2.3", 0, 0, 0x30b54232, 262144, 21, 68000, ROMTYPE_EXTCDTV }, -// { "CDTV Extended v2.7", 0, 0, 0xceae68d2, 262144, 22, 68000, ROMTYPE_EXTCDTV }, !! Non Confirmed - - { "A1000 Bootstrap", 0, 0, 0x62f11c04, 8192, 23, 68000, ROMTYPE_KICK }, - { "A1000 Bootstrap", 0, 0, 0x0b1ad2d0, 65536, 24, 68000, ROMTYPE_KICK }, - - { "Action Replay Mk I v1.50", 0, 0, 0xd4ce0675, 65536, 25, 68000, ROMTYPE_AR }, - { "Action Replay Mk II v2.05", 0, 0, 0x1287301f , 131072, 26, 68000, ROMTYPE_AR }, - { "Action Replay Mk II v2.12", 0, 0, 0x804d0361 , 131072, 27, 68000, ROMTYPE_AR }, - { "Action Replay Mk II v2.14", 0, 0, 0x49650e4f, 131072, 28, 68000, ROMTYPE_AR }, - { "Action Replay Mk III v3.09", 0, 0, 0x0ed9b5aa, 262144, 29, 68000, ROMTYPE_AR }, - { "Action Replay Mk III v3.17", 0, 0, 0xc8a16406, 262144, 30, 68000, ROMTYPE_AR }, + { "Cloanto Amiga Forever ROM key", 0, 0, 0x869ae1b1, 2069, 0, 0, 1, ROMTYPE_KEY }, + + { "Kickstart v1.0 (A1000)(NTSC)", 0, 0, 0x299790ff, 262144, 1, 0, 0, ROMTYPE_KICK }, + { "Kickstart v1.1 (A1000)(NTSC)", 31, 34, 0xd060572a, 262144, 2, 0, 0, ROMTYPE_KICK }, + { "Kickstart v1.1 (A1000)(PAL)", 31, 34, 0xec86dae2, 262144, 3, 0, 0, ROMTYPE_KICK }, + { "Kickstart v1.2 (A1000)", 33, 166, 0x0ed783d0, 262144, 4, 0, 0, ROMTYPE_KICK }, + { "Kickstart v1.2 (A500,A1000,A2000)", 33, 180, 0xa6ce1636, 262144, 5, 0, 0, ROMTYPE_KICK }, + { "Kickstart v1.3 (A500,A1000,A2000)", 34, 5, 0xc4f0f55f, 262144, 6, 60, 0, ROMTYPE_KICK }, + { "Kickstart v1.3 (A3000)", 34, 5, 0xe0f37258, 262144, 32, 0, 0, ROMTYPE_KICK }, + + { "Kickstart v2.04 (A500+)", 37, 175, 0xc3bdb240, 524288, 7, 0, 0, ROMTYPE_KICK }, + { "Kickstart v2.05 (A600)", 37, 299, 0x83028fb5, 524288, 8, 0, 0, ROMTYPE_KICK }, + { "Kickstart v2.05 (A600HD)", 37, 300, 0x64466c2a, 524288, 9, 0, 0, ROMTYPE_KICK }, + { "Kickstart v2.05 (A600HD)", 37, 350, 0x43b0df7b, 524288, 10, 0, 0, ROMTYPE_KICK }, + + { "Kickstart v3.0 (A1200)", 39, 106, 0x6c9b07d2, 524288, 11, 0, 0, ROMTYPE_KICK }, + { "Kickstart v3.0 (A4000)", 39, 106, 0x9e6ac152, 524288, 12, 2, 0, ROMTYPE_KICK }, +// { "Kickstart v3.1 (A4000)", 40, 70, 0x2b4566f1, 524288, 13, 2, 0, ROMTYPE_KICK }, + { "Kickstart v3.1 (A500,A600,A2000)", 40, 63, 0xfc24ae0d, 524288, 14, 0, 0, ROMTYPE_KICK }, + { "Kickstart v3.1 (A1200)", 40, 68, 0x1483a091, 524288, 15, 1, 0, ROMTYPE_KICK }, + { "Kickstart v3.1 (A4000)(Cloanto)", 40, 68, 0x43b6dd22, 524288, 31, 2, 1, ROMTYPE_KICK }, + { "Kickstart v3.1 (A4000)", 40, 68, 0xd6bae334, 524288, 16, 2, 0, ROMTYPE_KICK }, +// { "Kickstart v3.1 (A4000T)", 40, 70, 0x75932c3a, 524288, 17, 1, 0, ROMTYPE_KICK }, + + { "CD32 Kickstart v3.1", 40, 60, 0x1e62d4a5, 524288, 18, 1, 0, ROMTYPE_KICKCD32 }, + { "CD32 Extended", 40, 60, 0x87746be2, 524288, 19, 1, 0, ROMTYPE_EXTCD32 }, + + { "CDTV Extended v1.00", 0, 0, 0x42baa124, 262144, 20, 0, 0, ROMTYPE_EXTCDTV }, + { "CDTV Extended v2.30", 0, 0, 0x30b54232, 262144, 21, 0, 0, ROMTYPE_EXTCDTV }, + { "CDTV Extended v2.07", 0, 0, 0xceae68d2, 262144, 22, 0, 0, ROMTYPE_EXTCDTV }, + + { "A1000 Bootstrap", 0, 0, 0x62f11c04, 8192, 23, 0, 0, ROMTYPE_KICK }, + { "A1000 Bootstrap", 0, 0, 0x0b1ad2d0, 65536, 24, 0, 0, ROMTYPE_KICK }, + + { "Action Replay Mk I v1.50", 0, 0, 0xd4ce0675, 65536, 25, 0, 0, ROMTYPE_AR }, + { "Action Replay Mk II v2.05", 0, 0, 0x1287301f , 131072, 26, 0, 0, ROMTYPE_AR }, + { "Action Replay Mk II v2.12", 0, 0, 0x804d0361 , 131072, 27, 0, 0, ROMTYPE_AR }, + { "Action Replay Mk II v2.14", 0, 0, 0x49650e4f, 131072, 28, 0, 0, ROMTYPE_AR }, + { "Action Replay Mk III v3.09", 0, 0, 0x0ed9b5aa, 262144, 29, 0, 0, ROMTYPE_AR }, + { "Action Replay Mk III v3.17", 0, 0, 0xc8a16406, 262144, 30, 0, 0, ROMTYPE_AR }, { 0 } }; @@ -1673,11 +1673,26 @@ void memory_reset (void) #else uae_restart (-1, NULL); #endif + } else { + struct romdata *rd = getromdatabydata (kickmemory, kickmem_size); + if (rd) { + if (rd->cpu == 1 && currprefs.cpu_level < 2) { + notify_user (NUMSG_KS68EC020); + uae_restart (-1, NULL); + } else if (rd->cpu == 2 && (currprefs.cpu_level < 2 || currprefs.address_space_24)) { + notify_user (NUMSG_KS68020); + uae_restart (-1, NULL); + } + if (rd->cloanto) + cloanto_rom = 1; + } } } - custom_start = 0xC0; + if (cloanto_rom) + currprefs.maprom = changed_prefs.maprom = 0; + custom_start = 0xC0; map_banks (&custom_bank, custom_start, 0xE0 - custom_start, 0); map_banks (&cia_bank, 0xA0, 32, 0); map_banks (&clock_bank, 0xDC, 1, 0); diff --git a/newcpu.c b/newcpu.c index e02444e7..7859724a 100755 --- a/newcpu.c +++ b/newcpu.c @@ -1515,7 +1515,6 @@ unsigned long REGPARAM2 op_illg (uae_u32 opcode) { uaecptr pc = m68k_getpc (); static int warned; - static int cpu68020; if (cloanto_rom && (opcode & 0xF100) == 0x7100) { m68k_dreg (regs, (opcode >> 9) & 7) = (uae_s8)(opcode & 0xFF); @@ -1524,9 +1523,9 @@ unsigned long REGPARAM2 op_illg (uae_u32 opcode) return 4; } - if (opcode == 0x4E7B && get_long (0x10) == 0 && in_rom (pc) && !cpu68020) { - notify_user (NUMSG_KS68020); - cpu68020 = 1; + if (opcode == 0x4E7B && in_rom (pc) && get_long (0x10) == 0) { + notify_user (NUMSG_KS68020); + uae_restart (-1, NULL); } #ifdef AUTOCONFIG @@ -1794,6 +1793,8 @@ static void m68k_run_1 (void) uae_u32 opcode = regs.ir; #if 0 int pc = m68k_getpc(); + if (pc == 0xdff002) + write_log("hip\n"); if (pc != pcs[0] && (pc < 0xd00000 || pc > 0x1000000)) { memmove (pcs + 1, pcs, 998 * 4); pcs[0] = pc; diff --git a/od-win32/avioutput.c b/od-win32/avioutput.c index 546bda3a..26951a30 100755 --- a/od-win32/avioutput.c +++ b/od-win32/avioutput.c @@ -173,13 +173,13 @@ LPSTR AVIOutput_ChooseAudioCodec(HWND hwnd) // set the source format wfxSrc.wFormatTag = WAVE_FORMAT_PCM; - wfxSrc.nChannels = workprefs.stereo ? 2 : 1; + wfxSrc.nChannels = workprefs.sound_stereo ? 2 : 1; wfxSrc.nSamplesPerSec = workprefs.sound_freq; wfxSrc.nBlockAlign = wfxSrc.nChannels * (workprefs.sound_bits / 8); wfxSrc.nAvgBytesPerSec = wfxSrc.nBlockAlign * wfxSrc.nSamplesPerSec; wfxSrc.wBitsPerSample = workprefs.sound_bits; wfxSrc.cbSize = 0; - + if(!(pwfxDst = (LPWAVEFORMATEX) malloc(wfxMaxFmtSize))) return NULL; @@ -613,7 +613,7 @@ static void writewavheader (uae_u32 size) { uae_u16 tw; uae_u32 tl; - int bits = 16, channels = currprefs.stereo ? 2 : 1; + int bits = 16, channels = currprefs.sound_stereo ? 2 : 1; fseek (wavfile, 0, SEEK_SET); fwrite ("RIFF", 1, 4, wavfile); diff --git a/od-win32/dinput.c b/od-win32/dinput.c index 121c143c..55d1ad7f 100755 --- a/od-win32/dinput.c +++ b/od-win32/dinput.c @@ -440,7 +440,7 @@ static int acquire (LPDIRECTINPUTDEVICE8 lpdi, char *txt) HRESULT hr = DI_OK; if (lpdi) { hr = IDirectInputDevice8_Acquire (lpdi); - if (hr != DI_OK) { + if (hr != DI_OK && hr != 0x80070005) { write_log ("acquire %s failed, %s\n", txt, DXError (hr)); } } diff --git a/od-win32/hardfile_win32.c b/od-win32/hardfile_win32.c index 783a0243..7f2f3a28 100755 --- a/od-win32/hardfile_win32.c +++ b/od-win32/hardfile_win32.c @@ -3,10 +3,14 @@ #include "sysconfig.h" #include "sysdeps.h" +#include +#include "resource.h" + #include "config.h" #include "threaddep/thread.h" #include "filesys.h" #include "blkdev.h" +#include "win32gui.h" #define hfd_log write_log @@ -112,9 +116,7 @@ static int safetycheck (HANDLE *h, uae_u64 offset, uae_u8 *buf, int blocksize) write_log ("hd accepted (empty)\n"); return 1; } - gui_message ("WARNING: Non-empty or Amiga formatted\n" - "harddrive detected and safety test was disabled\n\n" - "Harddrives marked with 'HD_*_' are not empty\n"); + gui_message_id (IDS_HARDDRIVESAFETYWARNING); return 2; } diff --git a/od-win32/resources/resource.h b/od-win32/resources/resource.h index 44ee7892..050cc430 100755 --- a/od-win32/resources/resource.h +++ b/od-win32/resources/resource.h @@ -224,6 +224,8 @@ #define IDS_ROMSCANEND 319 #define IDS_ROM_AVAILABLE 320 #define IDS_ROM_UNAVAILABLE 321 +#define IDS_HARDDRIVESAFETYWARNING 322 +#define IDS_NUMSG_KS68EC020 323 #define IDS_QS_MODELS 1000 #define IDS_QS_MODEL_A500 1001 #define IDS_QS_MODEL_A500P 1002 @@ -589,6 +591,7 @@ #define IDC_SCSIDEVICE2 1608 #define IDC_CLOCKSYNC 1608 #define IDC_NOUAEFSDB 1608 +#define IDC_NOTASKBARBUTTON 1608 #define IDC_AVIOUTPUT_FPS 1609 #define IDC_INPUTDEVICE 1609 #define IDC_MAPROM 1609 @@ -711,6 +714,7 @@ #define IDC_CONFIGTYPE 1655 #define IDC_SOUNDDRIVETXT 1656 #define IDC_PATHS_ROM 1656 +#define IDC_SOUNDSTEREOSEP 1656 #define IDC_SOUNDSTEREOTXT 1657 #define IDC_PATHS_CONFIG 1657 #define IDC_SOUNDINTERPOLATIONTXT 1658 @@ -718,8 +722,11 @@ #define IDC_DISK 1659 #define IDC_DISKLIST 1659 #define IDC_PATHS_SAVEIMAGE 1659 +#define IDC_SOUNDSTEREOSEPTXT 1659 #define IDC_PATHS_SAVESTATE 1660 +#define IDC_SOUNDSTEREOMIXTXT 1660 #define IDC_PATHS_ROMS 1661 +#define IDC_SOUNDSTEREOMIX 1661 #define IDC_PATHS_CONFIGS 1662 #define IDC_PATHS_SCREENSHOTS 1663 #define IDC_PATHS_SAVESTATES 1664 @@ -776,7 +783,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NO_MFC 1 #define _APS_3D_CONTROLS 1 -#define _APS_NEXT_RESOURCE_VALUE 205 +#define _APS_NEXT_RESOURCE_VALUE 242 #define _APS_NEXT_COMMAND_VALUE 40021 #define _APS_NEXT_CONTROL_VALUE 1694 #define _APS_NEXT_SYMED_VALUE 101 diff --git a/od-win32/resources/winuae.rc b/od-win32/resources/winuae.rc index f26c7211..55f4ebe1 100755 --- a/od-win32/resources/winuae.rc +++ b/od-win32/resources/winuae.rc @@ -307,53 +307,61 @@ BEGIN RTEXT "Sound device:",IDC_SOUNDCARD,8,9,51,13,SS_CENTERIMAGE COMBOBOX IDC_SOUNDCARDLIST,64,9,229,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - GROUPBOX "Sound Emulation",IDC_SOUNDSETTINGS,7,30,120,68 + GROUPBOX "Sound Emulation",IDC_SOUNDSETTINGS,5,30,120,68 CONTROL "Disabled",IDC_SOUND0,"Button",BS_AUTORADIOBUTTON | - WS_GROUP | WS_TABSTOP,15,45,43,10 + WS_GROUP | WS_TABSTOP,13,45,43,10 CONTROL "Disabled, but emulated",IDC_SOUND1,"Button", - BS_AUTORADIOBUTTON | WS_TABSTOP,15,57,88,10 + BS_AUTORADIOBUTTON | WS_TABSTOP,13,57,88,10 CONTROL "Enabled",IDC_SOUND2,"Button",BS_AUTORADIOBUTTON | - WS_TABSTOP,15,69,42,10 + WS_TABSTOP,13,69,42,10 CONTROL "Enabled, 100% accurate",IDC_SOUND3,"Button", - BS_AUTORADIOBUTTON | WS_TABSTOP,15,81,93,10 - GROUPBOX "Settings",IDC_SOUNDINTERPOLATION2,133,30,160,68 - RTEXT "Frequency:",IDC_SOUNDFREQTXT,138,40,37,8,SS_CENTERIMAGE - COMBOBOX IDC_SOUNDFREQ,140,49,67,75,CBS_DROPDOWN | WS_VSCROLL | + BS_AUTORADIOBUTTON | WS_TABSTOP,13,81,93,10 + GROUPBOX "Settings",IDC_SOUNDINTERPOLATION2,6,101,290,60 + RTEXT "Frequency:",IDC_SOUNDFREQTXT,34,110,37,8,SS_CENTERIMAGE + COMBOBOX IDC_SOUNDFREQ,36,119,67,75,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP - RTEXT "Audio filter:",IDC_SOUNDFILTERTXT,140,65,36,8, + RTEXT "Audio filter:",IDC_SOUNDFILTERTXT,36,135,36,8, SS_CENTERIMAGE - COMBOBOX IDC_SOUNDFILTER,140,74,67,75,CBS_DROPDOWNLIST | + COMBOBOX IDC_SOUNDFILTER,36,144,67,75,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - RTEXT "Stereo mode:",IDC_SOUNDSTEREOTXT,223,40,41,8, + RTEXT "Stereo mode:",IDC_SOUNDSTEREOTXT,116,110,43,8, SS_CENTERIMAGE - COMBOBOX IDC_SOUNDSTEREO,220,49,67,75,CBS_DROPDOWNLIST | + COMBOBOX IDC_SOUNDSTEREO,116,119,67,75,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - RTEXT "Interpolation:",IDC_SOUNDINTERPOLATIONTXT,222,65,41,8, + RTEXT "Interpolation:",IDC_SOUNDINTERPOLATIONTXT,115,135,41,8, SS_CENTERIMAGE - COMBOBOX IDC_SOUNDINTERPOLATION,220,74,67,75,CBS_DROPDOWNLIST | + COMBOBOX IDC_SOUNDINTERPOLATION,116,144,67,75,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - GROUPBOX "Disk Drive Sound Emulation",IDC_STATIC,8,100,285,46 - COMBOBOX IDC_SOUNDDRIVE,237,111,46,75,CBS_DROPDOWNLIST | + GROUPBOX "Disk Drive Sound Emulation",IDC_STATIC,6,164,290,46 + COMBOBOX IDC_SOUNDDRIVE,237,174,46,75,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_SOUNDDRIVESELECT,18,129,265,75,CBS_DROPDOWNLIST | + COMBOBOX IDC_SOUNDDRIVESELECT,18,192,265,75,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP CONTROL "",IDC_SOUNDDRIVEVOLUME,"msctls_trackbar32", - TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,14,108,107,19 - GROUPBOX "Sound buffer size",IDC_STATIC,8,180,164,31 + TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,14,172,107,19 + GROUPBOX "Sound buffer size",IDC_STATIC,132,67,164,31 CONTROL "Slider1",IDC_SOUNDBUFFERRAM,"msctls_trackbar32", - TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,14,188,106,19 - GROUPBOX "Sound driver lag compensation",IDC_STATIC,7,212,286,31 + TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,138,75,106,19 + GROUPBOX "Sound driver lag compensation",IDC_STATIC,6,211,290,31 CONTROL "Slider1",IDC_SOUNDADJUST,"msctls_trackbar32", TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,14,221,107,19 PUSHBUTTON "Calibrate",IDC_SOUNDCALIBRATE,183,223,40,14 - GROUPBOX "Volume",IDC_STATIC,8,147,164,31 + GROUPBOX "Volume",IDC_STATIC,131,30,164,31 CONTROL "",IDC_SOUNDVOLUME,"msctls_trackbar32",TBS_AUTOTICKS | - TBS_TOP | WS_TABSTOP,14,155,105,20 - EDITTEXT IDC_SOUNDBUFFERMEM,124,191,40,12,ES_CENTER | ES_READONLY + TBS_TOP | WS_TABSTOP,137,38,105,20 + EDITTEXT IDC_SOUNDBUFFERMEM,248,78,40,12,ES_CENTER | ES_READONLY EDITTEXT IDC_SOUNDADJUSTNUM,124,224,40,12,ES_CENTER | ES_READONLY - EDITTEXT IDC_SOUNDVOLUME2,124,158,40,12,ES_CENTER | ES_READONLY - EDITTEXT IDC_SOUNDDRIVEVOLUME2,124,111,40,12,ES_CENTER | + EDITTEXT IDC_SOUNDVOLUME2,247,41,40,12,ES_CENTER | ES_READONLY + EDITTEXT IDC_SOUNDDRIVEVOLUME2,124,178,40,12,ES_CENTER | ES_READONLY + RTEXT "Stereo separation:",IDC_SOUNDSTEREOSEPTXT,196,110,58,8, + SS_CENTERIMAGE + COMBOBOX IDC_SOUNDSTEREOSEP,197,119,67,75,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP + RTEXT "Stereo mixing delay:",IDC_SOUNDSTEREOMIXTXT,196,135,63, + 8,SS_CENTERIMAGE + COMBOBOX IDC_SOUNDSTEREOMIX,197,144,67,75,CBS_DROPDOWNLIST | + WS_VSCROLL | WS_TABSTOP END IDD_LOADSAVE DIALOGEX 0, 0, 302, 241 @@ -541,6 +549,8 @@ BEGIN 182,83,10,SS_CENTERIMAGE | WS_TABSTOP COMBOBOX IDC_STATE_BUFFERSIZE,248,180,38,65,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP + CONTROL "Don't show Taskbar button",IDC_NOTASKBARBUTTON,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,29,80,117,10 END IDD_HARDFILE DIALOGEX 0, 0, 299, 180 @@ -1344,7 +1354,7 @@ BEGIN IDS_NUMSG_MODRIP_NOTFOUND "No modules or compressed data found." IDS_NUMSG_MODRIP_FINISHED "Scan finished." IDS_NUMSG_MODRIP_SAVE "Module/packer found\n%s\nDo you want to save it?" - IDS_NUMSG_KS68020 "Your Kickstart requires a 68020 CPU. This message does not appear again." + IDS_NUMSG_KS68020 "Your Kickstart requires a 68020 CPU or later CPU." IDS_NUMSG_ROMNEED "You need any of following ROM(s)\n\n%s" IDS_NUMSG_NOZLIB "Zip and gzip support disabled because zlib1.dll is missing." IDS_NUMSG_STATEHD "WARNING: State saves do not support harddrive emulation. This message does not appear again." @@ -1363,6 +1373,9 @@ STRINGTABLE BEGIN IDS_ROM_AVAILABLE "available" IDS_ROM_UNAVAILABLE "unavailable" + IDS_HARDDRIVESAFETYWARNING + "WARNING: Non-empty or Amiga formatted\nharddrive detected and safety test was disabled\n\nHarddrives marked with 'HD_*_' are not empty" + IDS_NUMSG_KS68EC020 "Your Kickstart requires a 68EC020 or later CPU." END STRINGTABLE diff --git a/od-win32/sounddep/sound.c b/od-win32/sounddep/sound.c index b3036ea0..c242784e 100755 --- a/od-win32/sounddep/sound.c +++ b/od-win32/sounddep/sound.c @@ -181,7 +181,7 @@ static int calibrate (void) { int len = 1000; int pos, lastpos, tpos, expected, diff; - int mult = currprefs.stereo ? 4 : 2; + int mult = currprefs.sound_stereo ? 4 : 2; double qv, pct; if (!QueryPerformanceFrequency(&qpf)) { @@ -259,7 +259,7 @@ static int open_audio_ds (int size) size <<= 3; } else { size <<= 1; - if (currprefs.stereo) + if (currprefs.sound_stereo) size <<= 1; } snd_configsize = size; @@ -319,7 +319,7 @@ static int open_audio_ds (int size) } wavfmt.wFormatTag = WAVE_FORMAT_PCM; - wavfmt.nChannels = dsound_hardware_mixing ? 4 : (currprefs.stereo ? 2 : 1); + wavfmt.nChannels = dsound_hardware_mixing ? 4 : (currprefs.sound_stereo ? 2 : 1); wavfmt.nSamplesPerSec = freq; wavfmt.wBitsPerSample = 16; wavfmt.nBlockAlign = 16 / 8 * wavfmt.nChannels; @@ -367,10 +367,12 @@ static int open_audio_ds (int size) if (dsound_hardware_mixing) sample_handler = sample16ss_handler; else - sample_handler = currprefs.stereo ? sample16s_handler : sample16_handler; + sample_handler = currprefs.sound_stereo ? sample16s_handler : sample16_handler; write_log ("DS driver '%s'/%d/%d bits/%d Hz/buffer %d/dist %d\n", - sound_devices[currprefs.win32_soundcard], dsound_hardware_mixing ? 4 : (currprefs.stereo ? 2 : 1), 16, freq, max_sndbufsize, snd_configsize); + sound_devices[currprefs.win32_soundcard], + dsound_hardware_mixing ? 4 : (currprefs.sound_stereo ? 2 : 1), + 16, freq, max_sndbufsize, snd_configsize); obtainedfreq = currprefs.sound_freq; return 1; @@ -581,7 +583,7 @@ static void finish_sound_buffer_ds (void) static void filtercheck (uae_s16 *sndbuffer, int len) { - int ch = dsound_hardware_mixing ? 4 : (currprefs.stereo ? 2 : 1); + int ch = dsound_hardware_mixing ? 4 : (currprefs.sound_stereo ? 2 : 1); int i; static double cold[4]; double old0, old1, v; @@ -668,7 +670,7 @@ int sound_calibrate (HWND hwnd, struct uae_prefs *p) hMainWnd = hwnd; currprefs.sound_freq = p->sound_freq; - currprefs.stereo = p->stereo; + currprefs.sound_stereo = p->sound_stereo; if (open_sound ()) { SetThreadPriority (GetCurrentThread(), THREAD_PRIORITY_HIGHEST); pct = calibrate (); diff --git a/od-win32/win32.c b/od-win32/win32.c index f0a30075..21028263 100755 --- a/od-win32/win32.c +++ b/od-win32/win32.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "sysdeps.h" #include "options.h" @@ -73,7 +74,7 @@ static int no_rdtsc; HINSTANCE hInst = NULL; HMODULE hUIDLL = NULL; HWND (WINAPI *pHtmlHelp)(HWND, LPCSTR, UINT, LPDWORD ) = NULL; -HWND hAmigaWnd, hMainWnd; +HWND hAmigaWnd, hMainWnd, hHiddenWnd; RECT amigawin_rect; static UINT TaskbarRestart; static int TaskbarRestartOk; @@ -947,6 +948,11 @@ static long FAR PASCAL MainWindowProc (HWND hWnd, UINT message, WPARAM wParam, L return DefWindowProc (hWnd, message, wParam, lParam); } +static long FAR PASCAL HiddenWindowProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + return DefWindowProc (hWnd, message, wParam, lParam); +} + void handle_events (void) { MSG msg; @@ -997,11 +1003,11 @@ void remove_brkhandler (void) int WIN32_RegisterClasses( void ) { WNDCLASS wc; - HDC hDC = GetDC( NULL ); + HDC hDC = GetDC( NULL ); - if( GetDeviceCaps( hDC, NUMCOLORS ) != -1 ) + if (GetDeviceCaps (hDC, NUMCOLORS) != -1) g_dwBackgroundColor = RGB( 255, 0, 255 ); - ReleaseDC( NULL, hDC ); + ReleaseDC (NULL, hDC); wc.style = CS_BYTEALIGNCLIENT | CS_BYTEALIGNWINDOW | CS_DBLCLKS | CS_OWNDC; wc.lpfnWndProc = AmigaWindowProc; @@ -1012,7 +1018,7 @@ int WIN32_RegisterClasses( void ) wc.hCursor = LoadCursor (NULL, IDC_ARROW); wc.lpszMenuName = 0; wc.lpszClassName = "AmigaPowah"; - wc.hbrBackground = CreateSolidBrush( g_dwBackgroundColor ); + wc.hbrBackground = CreateSolidBrush (g_dwBackgroundColor); if (!RegisterClass (&wc)) return 0; @@ -1023,11 +1029,34 @@ int WIN32_RegisterClasses( void ) wc.hInstance = 0; wc.hIcon = LoadIcon (GetModuleHandle (NULL), MAKEINTRESOURCE( IDI_APPICON ) ); wc.hCursor = LoadCursor (NULL, IDC_ARROW); - wc.hbrBackground = CreateSolidBrush( g_dwBackgroundColor ); + wc.hbrBackground = CreateSolidBrush (g_dwBackgroundColor); wc.lpszMenuName = 0; wc.lpszClassName = "PCsuxRox"; if (!RegisterClass (&wc)) return 0; + + wc.style = CS_BYTEALIGNCLIENT | CS_BYTEALIGNWINDOW | CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW; + wc.lpfnWndProc = HiddenWindowProc; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hInstance = 0; + wc.hIcon = LoadIcon (GetModuleHandle (NULL), MAKEINTRESOURCE( IDI_APPICON ) ); + wc.hCursor = LoadCursor (NULL, IDC_ARROW); + wc.hbrBackground = CreateSolidBrush (g_dwBackgroundColor); + wc.lpszMenuName = 0; + wc.lpszClassName = "Useless"; + if (!RegisterClass (&wc)) + return 0; + + hHiddenWnd = CreateWindowEx (0, + "Useless", "You don't see me", + WS_POPUP, + 0, 0, + 1, 1, + NULL, NULL, 0, NULL); + if (!hHiddenWnd) + return 0; + return 1; } @@ -1422,6 +1451,7 @@ void target_default_options (struct uae_prefs *p, int type) p->win32_active_priority = 0; p->win32_inactive_priority = 2; p->win32_iconified_priority = 3; + p->win32_notaskbarbutton = 0; } if (type == 1 || type == 0) { p->win32_midioutdev = -2; @@ -1452,6 +1482,7 @@ void target_save_options (FILE *f, struct uae_prefs *p) cfgfile_write (f, "win32.aspi=%s\n", p->win32_aspi ? "true" : "false" ); cfgfile_write (f, "win32.soundcard=%d\n", p->win32_soundcard ); cfgfile_write (f, "win32.cpu_idle=%d\n", p->cpu_idle); + cfgfile_write (f, "win32.notaskbarbutton=%s\n", p->win32_notaskbarbutton ? "true" : "false"); } static int fetchpri (int pri, int defpri) @@ -1493,6 +1524,7 @@ int target_parse_option (struct uae_prefs *p, char *option, char *value) || cfgfile_intval (option, value, "soundcard", &p->win32_soundcard, 1) || cfgfile_string (option, value, "serial_port", &p->sername[0], 256) || cfgfile_string (option, value, "parallel_port", &p->prtname[0], 256) + || cfgfile_yesno (option, value, "notaskbarbutton", &p->win32_notaskbarbutton) || cfgfile_intval (option, value, "cpu_idle", &p->cpu_idle, 1)); if (cfgfile_intval (option, value, "active_priority", &v, 1)) { diff --git a/od-win32/win32.h b/od-win32/win32.h index a1633510..583756d6 100755 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -14,14 +14,14 @@ #define NORMAL_WINDOW_STYLE (WS_VISIBLE | WS_BORDER | WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU ) extern HMODULE hUIDLL; -extern HWND hAmigaWnd, hMainWnd; +extern HWND hAmigaWnd, hMainWnd, hHiddenWnd; extern RECT amigawin_rect; extern int in_sizemove; extern int manual_painting_needed; extern int manual_palette_refresh_needed; extern int mouseactive, focus; #define WINUAEBETA 1 -#define WINUAEBETASTR " Beta 8" +#define WINUAEBETASTR " Beta 9" extern void my_kbd_handler (int, int, int); extern void clearallkeys(void); @@ -57,15 +57,6 @@ extern int paraport_mask; extern int gui_active; extern DWORD quickstart; -/* For StatusBar when running in a Window */ -#define LED_NUM_PARTS 10 -#define LED_POWER_WIDTH 42 -#define LED_HD_WIDTH 24 -#define LED_CD_WIDTH 24 -#define LED_DRIVE_WIDTH 24 -#define LED_FPS_WIDTH 64 -#define LED_IDLE_WIDTH 64 - extern HKEY hWinUAEKey; extern int screen_is_picasso; extern HINSTANCE hInst; diff --git a/od-win32/win32gfx.c b/od-win32/win32gfx.c index fb1d19cd..3391a673 100755 --- a/od-win32/win32gfx.c +++ b/od-win32/win32gfx.c @@ -606,7 +606,7 @@ RGBFTYPE WIN32GFX_FigurePixelFormats( RGBFTYPE colortype ) CW_USEDEFAULT, CW_USEDEFAULT, 1,//GetSystemMetrics (SM_CXSCREEN), 1,//GetSystemMetrics (SM_CYSCREEN), - 0, NULL, 0, NULL); + hHiddenWnd, NULL, 0, NULL); if( hAmigaWnd ) { window_created = 1; @@ -1608,97 +1608,130 @@ void WIN32GFX_ToggleFullScreen( void ) currprefs.gfx_afullscreen ^= 1; } +static void createstatuswindow (void) +{ + HDC hdc; + RECT rc; + HLOCAL hloc; + LPINT lpParts; + int drive_width, hd_width, cd_width, power_width, fps_width, idle_width; + int num_parts = 10; + double scaleX, scaleY; + + hStatusWnd = CreateStatusWindow (WS_CHILD | WS_VISIBLE, "", hMainWnd, 1); + if (!hStatusWnd) + return; + + hdc = GetDC (hStatusWnd); + scaleX = GetDeviceCaps (hdc, LOGPIXELSX) / 96.0; + scaleY = GetDeviceCaps (hdc, LOGPIXELSY) / 96.0; + ReleaseDC (hStatusWnd, hdc); + drive_width = 24 * scaleX; + hd_width = 24 * scaleX; + cd_width = 24 * scaleX; + power_width = 42 * scaleX; + fps_width = 64 * scaleX; + idle_width = 64 * scaleX; + GetClientRect (hMainWnd, &rc); + /* Allocate an array for holding the right edge coordinates. */ + hloc = LocalAlloc (LHND, sizeof (int) * num_parts); + if (hloc) { + lpParts = LocalLock (hloc); + /* Calculate the right edge coordinate for each part, and copy the coords + * to the array. */ + lpParts[0] = rc.right - (drive_width * 4) - power_width - idle_width - fps_width - cd_width - hd_width - 2; + lpParts[1] = lpParts[0] + idle_width; + lpParts[2] = lpParts[1] + fps_width; + lpParts[3] = lpParts[2] + power_width; + lpParts[4] = lpParts[3] + cd_width; + lpParts[5] = lpParts[4] + hd_width; + lpParts[6] = lpParts[5] + drive_width; + lpParts[7] = lpParts[6] + drive_width; + lpParts[8] = lpParts[7] + drive_width; + lpParts[9] = lpParts[8] + drive_width; + + /* Create the parts */ + SendMessage (hStatusWnd, SB_SETPARTS, (WPARAM) num_parts, (LPARAM) lpParts); + LocalUnlock (hloc); + LocalFree (hloc); + } +} + static int create_windows (void) { int fs = currentmode->flags & (DM_W_FULLSCREEN | DM_DX_FULLSCREEN | DM_D3D_FULLSCREEN); - if (!fs) - { + DWORD exstyle = currprefs.win32_notaskbarbutton ? 0 : WS_EX_APPWINDOW; + + if (!fs) { RECT rc; - LONG stored_x = 1, stored_y = GetSystemMetrics( SM_CYMENU ) + GetSystemMetrics( SM_CYBORDER ); + LONG stored_x = 1, stored_y = GetSystemMetrics (SM_CYMENU) + GetSystemMetrics (SM_CYBORDER); DWORD regkeytype; - DWORD regkeysize = sizeof(LONG); - HLOCAL hloc; - LPINT lpParts; + DWORD regkeysize = sizeof (LONG); int cx = GetSystemMetrics(SM_CXBORDER), cy = GetSystemMetrics(SM_CYBORDER); int oldx, oldy; + int first = 2; RegQueryValueEx( hWinUAEKey, "xPos", 0, ®keytype, (LPBYTE)&stored_x, ®keysize ); RegQueryValueEx( hWinUAEKey, "yPos", 0, ®keytype, (LPBYTE)&stored_y, ®keysize ); - if( stored_x < GetSystemMetrics (SM_XVIRTUALSCREEN) ) - stored_x = GetSystemMetrics (SM_XVIRTUALSCREEN); - if( stored_y < GetSystemMetrics (SM_YVIRTUALSCREEN) + GetSystemMetrics( SM_CYMENU ) + cy) - stored_y = GetSystemMetrics (SM_YVIRTUALSCREEN) + GetSystemMetrics( SM_CYMENU ) + cy; + while (first) { + first--; + if (stored_x < GetSystemMetrics (SM_XVIRTUALSCREEN)) + stored_x = GetSystemMetrics (SM_XVIRTUALSCREEN); + if (stored_y < GetSystemMetrics (SM_YVIRTUALSCREEN) + GetSystemMetrics (SM_CYMENU) + cy) + stored_y = GetSystemMetrics (SM_YVIRTUALSCREEN) + GetSystemMetrics (SM_CYMENU) + cy; - if( stored_x > GetSystemMetrics( SM_CXVIRTUALSCREEN ) ) - rc.left = 1; - else - rc.left = stored_x; - - if( stored_y > GetSystemMetrics( SM_CYVIRTUALSCREEN ) ) - rc.top = 1; - else - rc.top = stored_y; + if (stored_x > GetSystemMetrics (SM_CXVIRTUALSCREEN)) + rc.left = 1; + else + rc.left = stored_x; + + if (stored_y > GetSystemMetrics (SM_CYVIRTUALSCREEN)) + rc.top = 1; + else + rc.top = stored_y; + + rc.right = rc.left + 2 + currentmode->current_width + 2; + rc.bottom = rc.top + 2 + currentmode->current_height + 2 + GetSystemMetrics (SM_CYMENU); + + oldx = rc.left; + oldy = rc.top; + AdjustWindowRect (&rc, NORMAL_WINDOW_STYLE, FALSE); + win_x_diff = rc.left - oldx; + win_y_diff = rc.top - oldy; - rc.right = rc.left + 2 + currentmode->current_width + 2; - rc.bottom = rc.top + 2 + currentmode->current_height + 2 + GetSystemMetrics (SM_CYMENU); + if (MonitorFromRect (&rc, MONITOR_DEFAULTTONULL) == NULL) { + write_log ("window coordinates are not visible on any monitor, reseting..\n"); + stored_x = stored_y = 0; + continue; + } + break; + } - oldx = rc.left; - oldy = rc.top; - AdjustWindowRect (&rc, NORMAL_WINDOW_STYLE, FALSE); - win_x_diff = rc.left - oldx; - win_y_diff = rc.top - oldy; - hMainWnd = CreateWindowEx( picasso_on ? WS_EX_ACCEPTFILES : WS_EX_ACCEPTFILES | WS_EX_APPWINDOW, + hMainWnd = CreateWindowEx ((picasso_on ? WS_EX_ACCEPTFILES : WS_EX_ACCEPTFILES) | exstyle, "PCsuxRox", "WinUAE", NORMAL_WINDOW_STYLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, rc.left, rc.top, rc.right - rc.left + 1, rc.bottom - rc.top + 1, - NULL, NULL, 0, NULL); + hHiddenWnd, NULL, 0, NULL); if (! hMainWnd) { write_log ("main window creation failed\n"); return 0; } - hStatusWnd = CreateStatusWindow (WS_CHILD | WS_VISIBLE, "", hMainWnd, 1); - if (hStatusWnd) - { - GetClientRect (hMainWnd, &rc); - /* Allocate an array for holding the right edge coordinates. */ - hloc = LocalAlloc (LHND, sizeof (int) * LED_NUM_PARTS); - if (hloc) - { - lpParts = LocalLock (hloc); - - /* Calculate the right edge coordinate for each part, and copy the coords - * to the array. */ - lpParts[0] = rc.right - (LED_DRIVE_WIDTH * 4) - LED_POWER_WIDTH - LED_IDLE_WIDTH - LED_FPS_WIDTH - LED_CD_WIDTH - LED_HD_WIDTH - 2; - lpParts[1] = lpParts[0] + LED_IDLE_WIDTH; - lpParts[2] = lpParts[1] + LED_FPS_WIDTH; - lpParts[3] = lpParts[2] + LED_POWER_WIDTH; - lpParts[4] = lpParts[3] + LED_CD_WIDTH; - lpParts[5] = lpParts[4] + LED_HD_WIDTH; - lpParts[6] = lpParts[5] + LED_DRIVE_WIDTH; - lpParts[7] = lpParts[6] + LED_DRIVE_WIDTH; - lpParts[8] = lpParts[7] + LED_DRIVE_WIDTH; - lpParts[9] = lpParts[8] + LED_DRIVE_WIDTH; - - /* Create the parts */ - SendMessage (hStatusWnd, SB_SETPARTS, (WPARAM) LED_NUM_PARTS, (LPARAM) lpParts); - - LocalUnlock (hloc); - LocalFree (hloc); - } - } + + createstatuswindow (); + } else hMainWnd = NULL; - hAmigaWnd = CreateWindowEx (fs ? WS_EX_ACCEPTFILES | WS_EX_TOPMOST : WS_EX_ACCEPTFILES | WS_EX_APPWINDOW, + hAmigaWnd = CreateWindowEx (fs ? WS_EX_ACCEPTFILES | WS_EX_TOPMOST : WS_EX_ACCEPTFILES | exstyle, "AmigaPowah", "WinUAE", WS_CLIPCHILDREN | WS_CLIPSIBLINGS | (hMainWnd ? WS_VISIBLE | WS_CHILD : WS_VISIBLE | WS_POPUP), hMainWnd ? 2 : CW_USEDEFAULT, hMainWnd ? 2 : CW_USEDEFAULT, currentmode->current_width, currentmode->current_height, - hMainWnd, NULL, 0, NULL); + hMainWnd ? hMainWnd : hHiddenWnd, NULL, 0, NULL); if (! hAmigaWnd) { write_log ("creation of amiga window failed\n"); @@ -1710,7 +1743,7 @@ static int create_windows (void) systray (hMainWnd, FALSE); if (hMainWnd != hAmigaWnd) { ShowWindow (hMainWnd, SW_SHOWNORMAL); - UpdateWindow( hMainWnd ); + UpdateWindow (hMainWnd); } if (hAmigaWnd) { UpdateWindow (hAmigaWnd); @@ -1733,11 +1766,11 @@ static void setoverlay(void) if (!GetMonitorInfo (hm, &mi)) return; - GetClientRect(hMainWnd, &dr); + GetClientRect (hMainWnd, &dr); // adjust the dest-rect to avoid the status-bar if( hStatusWnd ) { - if( GetWindowRect( hStatusWnd, &statusr ) ) + if (GetWindowRect (hStatusWnd, &statusr)) dr.bottom = dr.bottom - ( statusr.bottom - statusr.top ); } @@ -1961,7 +1994,7 @@ static BOOL doInit (void) if ((currentmode->flags & DM_DDRAW) && !(currentmode->flags & (DM_D3D | DM_SWSCALE))) { int flags; - if( !DirectDraw_SurfaceLock( lockable_surface ) ) + if(!DirectDraw_SurfaceLock (lockable_surface)) goto oops; flags = DirectDraw_GetPixelFormatFlags(); DirectDraw_SurfaceUnlock(); @@ -1969,8 +2002,8 @@ static BOOL doInit (void) write_log( "%s mode (bits: %d, pixbytes: %d)\n", currentmode->flags & DM_DX_FULLSCREEN ? "Full screen" : "Window", DirectDraw_GetSurfaceBitCount(), currentmode->current_depth >> 3 ); } else { - char szMessage[ MAX_DPATH ]; - WIN32GUI_LoadUIString( IDS_UNSUPPORTEDPIXELFORMAT, szMessage, MAX_DPATH ); + char szMessage[MAX_DPATH]; + WIN32GUI_LoadUIString (IDS_UNSUPPORTEDPIXELFORMAT, szMessage, MAX_DPATH); gui_message( szMessage); goto oops; } diff --git a/od-win32/win32gui.c b/od-win32/win32gui.c index c39c4fc0..11a0497b 100755 --- a/od-win32/win32gui.c +++ b/od-win32/win32gui.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "config.h" #include "resource.h" @@ -81,6 +82,7 @@ static int qs_request_reset; int gui_active; extern HWND (WINAPI *pHtmlHelp)(HWND, LPCSTR, UINT, LPDWORD ); + #undef HtmlHelp #ifndef HH_DISPLAY_TOPIC #define HH_DISPLAY_TOPIC 0 @@ -141,7 +143,7 @@ static HWND cachedlist = NULL; #define MIN_FAST_MEM 0 #define MAX_FAST_MEM 4 #define MIN_SLOW_MEM 0 -#define MAX_SLOW_MEM 3 +#define MAX_SLOW_MEM 4 #define MIN_Z3_MEM 0 #define MAX_Z3_MEM 10 #define MIN_P96_MEM 0 @@ -323,7 +325,7 @@ static void show_rom_list (void) p2 = strchr (p1, '\n'); if (!p2) goto end; *p2++= 0; strcat (p, p1); strcat (p, ": "); - roms[0] = 20; roms[1] = 21; roms[2] = -1; + roms[0] = 20; roms[1] = 21; roms[2] = 22; roms[3] = -1; if (listrom (roms)) { roms[0] = 6; roms[1] = 32; roms[2] = -1; if (listrom (roms)) @@ -511,7 +513,7 @@ void gui_display( int shortcut ) int ret; if (flipflop) ShowWindow (hAmigaWnd, SW_MINIMIZE); - ret = GetSettings (0, flipflop ? GetDesktopWindow () : hAmigaWnd); + ret = GetSettings (0, flipflop ? (currprefs.win32_notaskbarbutton ? hHiddenWnd : GetDesktopWindow()) : hAmigaWnd); if (flipflop > 0) ShowWindow (hAmigaWnd, SW_RESTORE); if (!ret) { @@ -974,6 +976,7 @@ static const char *memsize_names[] = { /* 12*/ "512 MB", /* 13*/ "1 GB", /* 14*/ "1.5MB", +/* 15*/ "1.8MB", }; static unsigned long memsizes[] = { @@ -992,10 +995,11 @@ static unsigned long memsizes[] = { /* 12*/ 0x20000000, //512 Meg The correct size is set in mman.c /* 13*/ 0x40000000, //1GB /* 14*/ 0x00180000, //1.5MB +/* 15*/ 0x001C0000, //1.8MB }; static int msi_chip[] = { 1, 2, 3, 4, 5, 6 }; -static int msi_bogo[] = { 0, 2, 3, 14, 4 }; +static int msi_bogo[] = { 0, 2, 3, 14, 15 }; static int msi_fast[] = { 0, 3, 4, 5, 6 }; static int msi_z3fast[] = { 0, 3, 4, 5, 6, 7, 8, 9, 10,11,12,13 }; static int msi_gfx[] = { 0, 3, 4, 5, 6,7,8}; @@ -2330,7 +2334,7 @@ static void addfloppytype (HWND hDlg, int n); static void enable_for_quickstart (HWND hDlg) { int v = quickstart_ok && quickstart_ok_floppy ? TRUE : FALSE; - EnableWindow (GetDlgItem (guiDlg, IDC_RESETAMIGA), v && !full_property_sheet ? TRUE : FALSE); + EnableWindow (GetDlgItem (guiDlg, IDC_RESETAMIGA), !full_property_sheet ? TRUE : FALSE); } static void load_quickstart (HWND hDlg, int romcheck) @@ -3464,7 +3468,7 @@ static void values_to_memorydlg (HWND hDlg) case 0x00080000: mem_size = 1; break; case 0x00100000: mem_size = 2; break; case 0x00180000: mem_size = 3; break; - case 0x00200000: mem_size = 4; break; + case 0x001C0000: mem_size = 4; break; } SendDlgItemMessage (hDlg, IDC_SLOWMEM, TBM_SETPOS, TRUE, mem_size); SetDlgItemText (hDlg, IDC_SLOWRAM, memsize_names[msi_bogo[mem_size]]); @@ -3855,6 +3859,7 @@ static void values_to_miscdlg (HWND hDlg) CheckDlgButton (hDlg, IDC_NOOVERLAY, workprefs.win32_no_overlay); CheckDlgButton (hDlg, IDC_SHOWLEDS, workprefs.leds_on_screen); CheckDlgButton (hDlg, IDC_SCSIDEVICE, workprefs.scsi); + CheckDlgButton (hDlg, IDC_NOTASKBARBUTTON, workprefs.win32_notaskbarbutton); CheckDlgButton (hDlg, IDC_ASPI, workprefs.win32_aspi); CheckDlgButton (hDlg, IDC_STATE_CAPTURE, workprefs.tod_hack); @@ -3967,29 +3972,32 @@ static BOOL MiscDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) workprefs.start_gui = IsDlgButtonChecked (hDlg, IDC_SHOWGUI); break; case IDC_CREATELOGFILE: - workprefs.win32_logfile = IsDlgButtonChecked( hDlg, IDC_CREATELOGFILE ); + workprefs.win32_logfile = IsDlgButtonChecked (hDlg, IDC_CREATELOGFILE); enable_for_miscdlg( hDlg ); break; case IDC_INACTIVE_PAUSE: - workprefs.win32_inactive_pause = IsDlgButtonChecked( hDlg, IDC_INACTIVE_PAUSE ); + workprefs.win32_inactive_pause = IsDlgButtonChecked (hDlg, IDC_INACTIVE_PAUSE); break; case IDC_INACTIVE_NOSOUND: - workprefs.win32_inactive_nosound = IsDlgButtonChecked( hDlg, IDC_INACTIVE_NOSOUND ); + workprefs.win32_inactive_nosound = IsDlgButtonChecked (hDlg, IDC_INACTIVE_NOSOUND); break; case IDC_MINIMIZED_PAUSE: - workprefs.win32_iconified_pause = IsDlgButtonChecked( hDlg, IDC_MINIMIZED_PAUSE ); + workprefs.win32_iconified_pause = IsDlgButtonChecked (hDlg, IDC_MINIMIZED_PAUSE); break; case IDC_MINIMIZED_NOSOUND: - workprefs.win32_iconified_nosound = IsDlgButtonChecked( hDlg, IDC_MINIMIZED_NOSOUND ); + workprefs.win32_iconified_nosound = IsDlgButtonChecked (hDlg, IDC_MINIMIZED_NOSOUND); break; case IDC_CTRLF11: - workprefs.win32_ctrl_F11_is_quit = IsDlgButtonChecked( hDlg, IDC_CTRLF11 ); + workprefs.win32_ctrl_F11_is_quit = IsDlgButtonChecked (hDlg, IDC_CTRLF11); break; case IDC_SCSIDEVICE: - workprefs.scsi = IsDlgButtonChecked( hDlg, IDC_SCSIDEVICE ); + workprefs.scsi = IsDlgButtonChecked (hDlg, IDC_SCSIDEVICE); break; case IDC_ASPI: - workprefs.win32_aspi = IsDlgButtonChecked( hDlg, IDC_ASPI ); + workprefs.win32_aspi = IsDlgButtonChecked (hDlg, IDC_ASPI); + break; + case IDC_NOTASKBARBUTTON: + workprefs.win32_notaskbarbutton = IsDlgButtonChecked (hDlg, IDC_NOTASKBARBUTTON); break; } return TRUE; @@ -4273,33 +4281,35 @@ static void enable_for_sounddlg (HWND hDlg) enumerate_sound_devices (&numdevs); if( numdevs == 0 ) - EnableWindow( GetDlgItem( hDlg, IDC_SOUNDCARDLIST ), FALSE ); + EnableWindow (GetDlgItem (hDlg, IDC_SOUNDCARDLIST), FALSE); else - EnableWindow( GetDlgItem( hDlg, IDC_SOUNDCARDLIST ), workprefs.produce_sound ); - - EnableWindow( GetDlgItem( hDlg, IDC_FREQUENCY ), workprefs.produce_sound ); - EnableWindow( GetDlgItem( hDlg, IDC_SOUNDFREQ ), workprefs.produce_sound ? TRUE : FALSE ); - EnableWindow( GetDlgItem( hDlg, IDC_SOUNDSTEREO ), workprefs.produce_sound ); - EnableWindow( GetDlgItem( hDlg, IDC_SOUNDINTERPOLATION ), workprefs.produce_sound ); - EnableWindow( GetDlgItem( hDlg, IDC_SOUNDVOLUME ), workprefs.produce_sound ); - EnableWindow( GetDlgItem( hDlg, IDC_SOUNDVOLUME2 ), workprefs.produce_sound ); - - EnableWindow( GetDlgItem( hDlg, IDC_SOUNDBUFFERMEM ), workprefs.produce_sound ); - EnableWindow( GetDlgItem( hDlg, IDC_SOUNDBUFFERRAM ), workprefs.produce_sound ); - EnableWindow( GetDlgItem( hDlg, IDC_SOUNDADJUST ), workprefs.produce_sound ); - EnableWindow( GetDlgItem( hDlg, IDC_SOUNDADJUSTNUM ), workprefs.produce_sound ); - EnableWindow( GetDlgItem( hDlg, IDC_SOUNDBUFFERTEXT ), workprefs.produce_sound ); - - EnableWindow( GetDlgItem( hDlg, IDC_SOUNDDRIVE ), workprefs.produce_sound ); - EnableWindow( GetDlgItem( hDlg, IDC_SOUNDDRIVESELECT ), workprefs.produce_sound ); - EnableWindow( GetDlgItem( hDlg, IDC_SOUNDDRIVEVOLUME ), workprefs.produce_sound ); - EnableWindow( GetDlgItem( hDlg, IDC_SOUNDDRIVEVOLUME2 ), workprefs.produce_sound ); - - EnableWindow( GetDlgItem( hDlg, IDC_AUDIOSYNC ), workprefs.produce_sound ); + EnableWindow (GetDlgItem (hDlg, IDC_SOUNDCARDLIST), workprefs.produce_sound); + + EnableWindow (GetDlgItem (hDlg, IDC_FREQUENCY), workprefs.produce_sound); + EnableWindow (GetDlgItem (hDlg, IDC_SOUNDFREQ), workprefs.produce_sound ? TRUE : FALSE); + EnableWindow (GetDlgItem (hDlg, IDC_SOUNDSTEREO), workprefs.produce_sound); + EnableWindow (GetDlgItem (hDlg, IDC_SOUNDINTERPOLATION), workprefs.produce_sound); + EnableWindow (GetDlgItem (hDlg, IDC_SOUNDVOLUME), workprefs.produce_sound); + EnableWindow (GetDlgItem (hDlg, IDC_SOUNDVOLUME2), workprefs.produce_sound); + EnableWindow (GetDlgItem (hDlg, IDC_SOUNDSTEREOSEP), workprefs.sound_stereo && workprefs.produce_sound); + EnableWindow (GetDlgItem (hDlg, IDC_SOUNDSTEREOMIX), workprefs.sound_stereo && workprefs.produce_sound); + + EnableWindow (GetDlgItem (hDlg, IDC_SOUNDBUFFERMEM), workprefs.produce_sound); + EnableWindow (GetDlgItem (hDlg, IDC_SOUNDBUFFERRAM), workprefs.produce_sound); + EnableWindow (GetDlgItem (hDlg, IDC_SOUNDADJUST), workprefs.produce_sound); + EnableWindow (GetDlgItem (hDlg, IDC_SOUNDADJUSTNUM), workprefs.produce_sound); + EnableWindow (GetDlgItem (hDlg, IDC_SOUNDBUFFERTEXT), workprefs.produce_sound); + + EnableWindow (GetDlgItem (hDlg, IDC_SOUNDDRIVE), workprefs.produce_sound); + EnableWindow (GetDlgItem (hDlg, IDC_SOUNDDRIVESELECT), workprefs.produce_sound); + EnableWindow (GetDlgItem (hDlg, IDC_SOUNDDRIVEVOLUME), workprefs.produce_sound); + EnableWindow (GetDlgItem (hDlg, IDC_SOUNDDRIVEVOLUME2), workprefs.produce_sound); + + EnableWindow (GetDlgItem (hDlg, IDC_AUDIOSYNC), workprefs.produce_sound); - EnableWindow( GetDlgItem( hDlg, IDC_SOUNDFILTER ), workprefs.produce_sound ); + EnableWindow (GetDlgItem (hDlg, IDC_SOUNDFILTER), workprefs.produce_sound); - EnableWindow( GetDlgItem( hDlg, IDC_SOUNDCALIBRATE ), workprefs.produce_sound && full_property_sheet); + EnableWindow (GetDlgItem (hDlg, IDC_SOUNDCALIBRATE), workprefs.produce_sound && full_property_sheet); } static int exact_log2 (int v) @@ -4386,7 +4396,7 @@ static void values_to_sounddlg (HWND hDlg) int which_button; int sound_freq = workprefs.sound_freq; int produce_sound = workprefs.produce_sound; - int stereo = workprefs.stereo; + int stereo = workprefs.sound_stereo; char txt[100], *p; int i, idx, selected; @@ -4405,19 +4415,25 @@ static void values_to_sounddlg (HWND hDlg) SendDlgItemMessage(hDlg, IDC_SOUNDSTEREO, CB_RESETCONTENT, 0, 0); WIN32GUI_LoadUIString (IDS_SOUND_MONO, txt, sizeof (txt)); SendDlgItemMessage(hDlg, IDC_SOUNDSTEREO, CB_ADDSTRING, 0, (LPARAM)txt); - WIN32GUI_LoadUIString (IDS_SOUND_MIXED, txt, sizeof (txt)); - SendDlgItemMessage(hDlg, IDC_SOUNDSTEREO, CB_ADDSTRING, 0, (LPARAM)txt); WIN32GUI_LoadUIString (IDS_SOUND_STEREO, txt, sizeof (txt)); SendDlgItemMessage(hDlg, IDC_SOUNDSTEREO, CB_ADDSTRING, 0, (LPARAM)txt); - which_button = 0; - if (workprefs.stereo) { - if (workprefs.mixed_stereo) - which_button = 1; - else - which_button = 2; + SendDlgItemMessage (hDlg, IDC_SOUNDSTEREO, CB_SETCURSEL, workprefs.sound_stereo ? 1 : 0, 0); + + SendDlgItemMessage(hDlg, IDC_SOUNDSTEREOSEP, CB_RESETCONTENT, 0, 0); + for (i = 10; i >= 0; i--) { + sprintf (txt, "%d%%", i * 10); + SendDlgItemMessage(hDlg, IDC_SOUNDSTEREOSEP, CB_ADDSTRING, 0, (LPARAM)txt); } - SendDlgItemMessage (hDlg, IDC_SOUNDSTEREO, CB_SETCURSEL, which_button, 0); + SendDlgItemMessage (hDlg, IDC_SOUNDSTEREOSEP, CB_SETCURSEL, 10 - (workprefs.sound_stereo_separation / 3), 0); + SendDlgItemMessage(hDlg, IDC_SOUNDSTEREOMIX, CB_RESETCONTENT, 0, 0); + SendDlgItemMessage(hDlg, IDC_SOUNDSTEREOMIX, CB_ADDSTRING, 0, (LPARAM)"-"); + for (i = 0; i < 10; i++) { + sprintf (txt, "%d", i + 1); + SendDlgItemMessage(hDlg, IDC_SOUNDSTEREOMIX, CB_ADDSTRING, 0, (LPARAM)txt); + } + SendDlgItemMessage (hDlg, IDC_SOUNDSTEREOMIX, CB_SETCURSEL, workprefs.sound_mixed_stereo > 0 ? workprefs.sound_mixed_stereo : 0, 0); + SendDlgItemMessage(hDlg, IDC_SOUNDINTERPOLATION, CB_RESETCONTENT, 0, 0); WIN32GUI_LoadUIString (IDS_SOUND_INTERPOL_DISABLED, txt, sizeof (txt)); SendDlgItemMessage(hDlg, IDC_SOUNDINTERPOLATION, CB_ADDSTRING, 0, (LPARAM)txt); @@ -4516,13 +4532,21 @@ static void values_from_sounddlg (HWND hDlg) : IsDlgButtonChecked (hDlg, IDC_SOUND1) ? 1 : IsDlgButtonChecked (hDlg, IDC_SOUND2) ? 2 : 3); idx = SendDlgItemMessage (hDlg, IDC_SOUNDSTEREO, CB_GETCURSEL, 0, 0); - workprefs.mixed_stereo = 0; - workprefs.stereo = 0; - if (idx > 0) { - workprefs.stereo = 1; - if (idx == 1) - workprefs.mixed_stereo = 1; + workprefs.sound_stereo = idx == 1 ? 1 : 0; + workprefs.sound_stereo_separation = 0; + workprefs.sound_mixed_stereo = 0; + if (workprefs.sound_stereo > 0) { + idx = SendDlgItemMessage (hDlg, IDC_SOUNDSTEREOSEP, CB_GETCURSEL, 0, 0); + if (idx >= 0) { + if (idx < 10) + workprefs.sound_mixed_stereo = -1; + workprefs.sound_stereo_separation = (10 - idx) * 3; + } + idx = SendDlgItemMessage (hDlg, IDC_SOUNDSTEREOMIX, CB_GETCURSEL, 0, 0); + if (idx > 0) + workprefs.sound_mixed_stereo = idx; } + workprefs.sound_interpol = SendDlgItemMessage (hDlg, IDC_SOUNDINTERPOLATION, CB_GETCURSEL, 0, 0); workprefs.win32_soundcard = SendDlgItemMessage (hDlg, IDC_SOUNDCARDLIST, CB_GETCURSEL, 0, 0L); workprefs.sound_filter = SendDlgItemMessage (hDlg, IDC_SOUNDFILTER, CB_GETCURSEL, 0, 0); @@ -7402,7 +7426,7 @@ int dragdrop (HWND hDlg, HDROP hd, struct uae_prefs *prefs, int currentpage) static BOOL CALLBACK DialogProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) { static int recursive = 0; - + switch(msg) { case WM_INITDIALOG: @@ -7561,7 +7585,7 @@ int gui_init (void) { int ret; - ret = GetSettings(1, GetDesktopWindow ()); + ret = GetSettings(1, currprefs.win32_notaskbarbutton ? hHiddenWnd : GetDesktopWindow()); if (ret > 0) { #ifdef AVIOUTPUT AVIOutput_Begin (); @@ -7796,6 +7820,13 @@ void gui_message (const char *format,...) setmouseactive (focuso); } +void gui_message_id (int id) +{ + char msg[MAX_DPATH]; + WIN32GUI_LoadUIString (id, msg, sizeof (msg)); + gui_message (msg); +} + void pre_gui_message (const char *format,...) { char msg[2048]; @@ -7823,6 +7854,7 @@ static int transla[] = { NUMSG_MODRIP_NOTFOUND,IDS_NUMSG_MODRIP_NOTFOUND, NUMSG_MODRIP_FINISHED,IDS_NUMSG_MODRIP_FINISHED, NUMSG_MODRIP_SAVE,IDS_NUMSG_MODRIP_SAVE, + NUMSG_KS68EC020,IDS_NUMSG_KS68EC020, NUMSG_KS68020,IDS_NUMSG_KS68020, NUMSG_ROMNEED,IDS_NUMSG_ROMNEED, NUMSG_NOZLIB,IDS_NUMSG_NOZLIB, diff --git a/od-win32/win32gui.h b/od-win32/win32gui.h index 03227bed..6281cb16 100755 --- a/od-win32/win32gui.h +++ b/od-win32/win32gui.h @@ -14,6 +14,7 @@ extern int GetSettings (int all_options, HWND); extern int DiskSelection( HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs, char *); void InitializeListView( HWND hDlg ); extern void pre_gui_message (const char*,...); +extern void gui_message_id (int id); int dragdrop (HWND hDlg, HDROP hd, struct uae_prefs *prefs, int currentpage); HKEY read_disk_history (void); diff --git a/od-win32/winuae_msvc/winuae_msvc.vcproj b/od-win32/winuae_msvc/winuae_msvc.vcproj index aceabe93..235fcf32 100755 --- a/od-win32/winuae_msvc/winuae_msvc.vcproj +++ b/od-win32/winuae_msvc/winuae_msvc.vcproj @@ -196,7 +196,7 @@ RelativePath="..\resources\folder.ico"> + RelativePath="..\resources\h_arrow.cur"> @@ -210,9 +210,6 @@ - - -- 2.47.3