if (bltcon0 & 0x800) {
bltadatptr = bltapt;
- bltapt += (blt_info.hblitsize*2 + blt_info.bltamod)*blt_info.vblitsize;
+ bltapt += (blt_info.hblitsize * 2 + blt_info.bltamod) * blt_info.vblitsize;
}
if (bltcon0 & 0x400) {
bltbdatptr = bltbpt;
- bltbpt += (blt_info.hblitsize*2 + blt_info.bltbmod)*blt_info.vblitsize;
+ bltbpt += (blt_info.hblitsize * 2 + blt_info.bltbmod) * blt_info.vblitsize;
}
if (bltcon0 & 0x200) {
bltcdatptr = bltcpt;
- bltcpt += (blt_info.hblitsize*2 + blt_info.bltcmod)*blt_info.vblitsize;
+ bltcpt += (blt_info.hblitsize * 2 + blt_info.bltcmod) * blt_info.vblitsize;
}
if (bltcon0 & 0x100) {
bltddatptr = bltdpt;
- bltdpt += (blt_info.hblitsize*2 + blt_info.bltdmod)*blt_info.vblitsize;
+ bltdpt += (blt_info.hblitsize * 2 + blt_info.bltdmod) * blt_info.vblitsize;
}
#ifdef SPEEDUP
blitter_stuck = 0;
if (blit_slowdown > 0 && !currprefs.immediate_blits) {
event2_newevent (ev2_blitter, blit_slowdown);
+ blit_misscyclecounter = blit_slowdown;
blit_slowdown = -1;
return;
}
#ifdef BLITTER_DEBUG
blitter_dontdo = 0;
if (1) {
+ int ch = 0;
if (oldstate != BLT_done)
write_log ("blitter was already active!\n");
- write_log ("blitstart: v=%03.3d h=%03.3d %dx%d %d (%d) d=%d f=%02X n=%d pc=%p l=%d dma=%04X\n",
- vpos, hpos, blt_info.hblitsize, blt_info.vblitsize, cycles, blit_ch,
- blitdesc ? 1 : 0, blitfill,
- dmaen (DMA_BLITPRI) ? 1 : 0, M68K_GETPC, blitline, dmacon);
+ if (blit_ch & 1)
+ ch++;
+ if (blit_ch & 2)
+ ch++;
+ if (blit_ch & 4)
+ ch++;
+ if (blit_ch & 8)
+ ch++;
+ write_log ("blitstart: v=%03d h=%03d %dx%d ch=%d %d*%d=%d d=%d f=%02X n=%d pc=%p l=%d dma=%04X\n",
+ vpos, hpos, blt_info.hblitsize, blt_info.vblitsize, ch, blit_diag[1], cycles, blit_diag[1] * cycles,
+ blitdesc ? 1 : 0, blitfill, dmaen (DMA_BLITPRI) ? 1 : 0, M68K_GETPC, blitline, dmacon);
blitter_dump ();
}
#endif
if (currprefs.immediate_blits)
cycles = 1;
- event2_newevent(ev2_blitter, cycles * blit_diag[1]);
+ blit_cyclecounter = cycles * blit_diag[1];
+ event2_newevent (ev2_blitter, blit_cyclecounter);
}
void maybe_blit (int hpos, int hack)
for (i = 0; i < 2; i++) {
struct jport *jp = &p->jports[i];
int v = jp->id;
- char tmp1[100], tmp2[50];
+ char tmp1[MAX_DPATH], tmp2[MAX_DPATH];
if (v < 0) {
strcpy (tmp2, "none");
} else if (v < JSEM_JOYS) {
#ifdef FULLMMU
-mmu_atc_l1_array atc_l1[2];
-mmu_atc_l1_array *current_atc;
-struct mmu_atc_line atc_l2[2][ATC_L2_SIZE];
+static mmu_atc_l1_array atc_l1[2];
+static mmu_atc_l1_array *current_atc;
+static struct mmu_atc_line atc_l2[2][ATC_L2_SIZE];
# ifdef ATC_STATS
static unsigned int mmu_atc_hits[ATC_L2_SIZE];
SAVE_EXCEPTION;
TRY(prb) {
mmu_put_byte(addr, val >> 8, data, sz_word);
- mmu_put_byte(addr + 1, val, data, sz_word);
+ mmu_put_byte(addr + 1, (uae_u8)val, data, sz_word);
RESTORE_EXCEPTION;
}
CATCH(prb) {
mmu_put_user_word(addr, val, super, data, sz_word);
else {
mmu_put_user_byte(addr, val >> 8, super, data, sz_word);
- mmu_put_user_byte(addr + 1, val, super, data, sz_word);
+ mmu_put_user_byte(addr + 1, (uae_u8)val, super, data, sz_word);
}
RESTORE_EXCEPTION;
}
static int isvsync (void)
{
- return currprefs.gfx_avsync && currprefs.gfx_afullscreen;
+ return currprefs.gfx_avsync && currprefs.gfx_afullscreen && !picasso_on;
}
int vsynctime_orig;
if (currprefs.cpu_model == 68000 && currprefs.cpu_compatible) {
/* ignore single-word unconditional jump instructions
* (instruction prefetch from PC+2 can cause false positives) */
- if (regs.irc == 0x4e75 || regs.irc == 4e74 || regs.irc == 0x4e72 || regs.irc == 4e77)
+ if (regs.irc == 0x4e75 || regs.irc == 4e74 || regs.irc == 0x4e72 || regs.irc == 0x4e77)
return; /* RTS, RTD, RTE, RTR */
if ((regs.irc & 0xff00) == 0x6000 && (regs.irc & 0x00ff) != 0 && (regs.irc & 0x00ff) != 0xff)
return; /* BRA.B */
playfield_end = visible_right_border;
}
#endif
- /* Now, compute some offsets. */
-
- res_shift = lores_shift - bplres;
- ddf_left -= DISPLAY_LEFT_SHIFT;
- pixels_offset = MAX_PIXELS_PER_LINE - (ddf_left << bplres);
- ddf_left <<= bplres;
-
- unpainted = visible_left_border < playfield_start ? 0 : visible_left_border - playfield_start;
- src_pixel = MAX_PIXELS_PER_LINE + res_shift_from_window (playfield_start - native_ddf_left + unpainted);
if (sprite_aga_first_x < sprite_aga_last_x) {
uae_u8 *p = spritepixels + sprite_aga_first_x;
sprite_aga_last_x = 0;
sprite_aga_first_x = MAX_PIXELS_PER_LINE;
}
+
+ /* Now, compute some offsets. */
+ res_shift = lores_shift - bplres;
+ ddf_left -= DISPLAY_LEFT_SHIFT;
+ pixels_offset = MAX_PIXELS_PER_LINE - (ddf_left << bplres);
+ ddf_left <<= bplres;
+
+ unpainted = visible_left_border < playfield_start ? 0 : visible_left_border - playfield_start;
+ src_pixel = MAX_PIXELS_PER_LINE + res_shift_from_window (playfield_start - native_ddf_left + unpainted);
+
seen_sprites = 0;
if (dip_for_drawing->nr_sprites == 0)
return;
}
}
-void drawing_adjust_mousepos(int *xp, int *yp)
+void drawing_adjust_mousepos (int *xp, int *yp)
{
}
-static uae_u8 merge_2pixel8(uae_u8 p1, uae_u8 p2)
+static uae_u8 merge_2pixel8 (uae_u8 p1, uae_u8 p2)
{
return p1;
}
-static uae_u16 merge_2pixel16(uae_u16 p1, uae_u16 p2)
+static uae_u16 merge_2pixel16 (uae_u16 p1, uae_u16 p2)
{
uae_u16 v = ((((p1 >> xredcolor_s) & xredcolor_m) + ((p2 >> xredcolor_s) & xredcolor_m)) / 2) << xredcolor_s;
v |= ((((p1 >> xbluecolor_s) & xbluecolor_m) + ((p2 >> xbluecolor_s) & xbluecolor_m)) / 2) << xbluecolor_s;
v |= ((((p1 >> xgreencolor_s) & xgreencolor_m) + ((p2 >> xgreencolor_s) & xgreencolor_m)) / 2) << xgreencolor_s;
return v;
}
-static uae_u32 merge_2pixel32(uae_u32 p1, uae_u32 p2)
+static uae_u32 merge_2pixel32 (uae_u32 p1, uae_u32 p2)
{
uae_u32 v = ((((p1 >> 16) & 0xff) + ((p2 >> 16) & 0xff)) / 2) << 16;
v |= ((((p1 >> 8) & 0xff) + ((p2 >> 8) & 0xff)) / 2) << 8;
static FILE *headerfile;
static FILE *stblfile;
-static int using_prefetch, using_indirect;
+static int using_prefetch, using_indirect, using_mmu;
static int using_exception_3;
static int using_ce;
static int cpu_level;
} else if (using_indirect) {
insn_n_cycles += 8;
printf ("\t%s %s = get_ilongi (%d);\n", type, name, r);
+ } else if (using_mmu) {
+ insn_n_cycles += 8;
+ printf ("\t%s %s = get_ilong_mmu (regs, %d);\n", type, name, r);
} else {
insn_n_cycles += 8;
printf ("\t%s %s = get_ilong (regs, %d);\n", type, name, r);
} else if (using_indirect) {
sprintf (buffer, "get_iwordi(%d)", r);
insn_n_cycles += 4;
+ } else if (using_mmu) {
+ sprintf (buffer, "get_iword_mmu (regs, %d)", r);
+ insn_n_cycles += 4;
} else {
sprintf (buffer, "get_iword (regs, %d)", r);
insn_n_cycles += 4;
} else if (using_indirect) {
sprintf (buffer, "get_ibytei (%d)", r);
insn_n_cycles += 4;
+ } else if (using_mmu) {
+ sprintf (buffer, "get_ibyte_mmu (%d)", r);
+ insn_n_cycles += 4;
} else {
sprintf (buffer, "get_ibyte (regs, %d)", r);
insn_n_cycles += 4;
start_brace ();
/* This would ordinarily be done in gen_nextiword, which we bypass. */
insn_n_cycles += 4;
- printf ("\t%sa = get_disp_ea_020 (regs, m68k_areg (regs, %s), next_iword (regs));\n", name, reg);
+ if (using_mmu)
+ printf ("\t%sa = get_disp_ea_020 (regs, m68k_areg (regs, %s), next_iword_mmu (regs));\n", name, reg);
+ else
+ printf ("\t%sa = get_disp_ea_020 (regs, m68k_areg (regs, %s), next_iword (regs));\n", name, reg);
} else {
printf ("\t%sa = get_disp_ea_000 (regs, m68k_areg (regs, %s), %s);\n", name, reg, gen_nextiword (flags & GF_NOREFILL));
}
/* This would ordinarily be done in gen_nextiword, which we bypass. */
insn_n_cycles += 4;
printf ("\ttmppc = m68k_getpc (regs);\n");
- printf ("\t%sa = get_disp_ea_020 (regs, tmppc, next_iword (regs));\n", name);
+ if (using_mmu)
+ printf ("\t%sa = get_disp_ea_020 (regs, tmppc, next_iword_mmu (regs));\n", name);
+ else
+ printf ("\t%sa = get_disp_ea_020 (regs, tmppc, next_iword (regs));\n", name);
} else {
printf ("\ttmppc = m68k_getpc (regs) + %d;\n", m68k_pc_offset);
printf ("\t%sa = get_disp_ea_000 (regs, tmppc, %s);\n", name, gen_nextiword (flags & GF_NOREFILL));
case sz_long: printf ("\tuae_s32 %s = get_word_ce (%sa) << 16; %s |= get_word_ce (%sa + 2);\n", name, name, name, name); break;
default: abort ();
}
+ } else if (using_mmu) {
+ switch (size) {
+ case sz_byte: insn_n_cycles += 4; printf ("\tuae_s8 %s = uae_mmu_get_byte (%sa);\n", name, name); break;
+ case sz_word: insn_n_cycles += 4; printf ("\tuae_s16 %s = uae_mmu_get_word (%sa);\n", name, name); break;
+ case sz_long: insn_n_cycles += 8; printf ("\tuae_s32 %s = uae_mmu_get_long (%sa);\n", name, name); break;
+ default: abort ();
+ }
} else {
switch (size) {
case sz_byte: insn_n_cycles += 4; printf ("\tuae_s8 %s = get_byte (%sa);\n", name, name); break;
default:
abort ();
}
+ } else if (using_mmu) {
+ switch (size) {
+ case sz_byte:
+ insn_n_cycles += 4;
+ printf ("\uae_mmu_put_byte (%sa,%s);\n", to, from);
+ break;
+ case sz_word:
+ insn_n_cycles += 4;
+ if (cpu_level < 2 && (mode == PC16 || mode == PC8r))
+ abort ();
+ printf ("\uae_mmu_put_word (%sa,%s);\n", to, from);
+ break;
+ case sz_long:
+ insn_n_cycles += 8;
+ if (cpu_level < 2 && (mode == PC16 || mode == PC8r))
+ abort ();
+ printf ("\uae_mmu_put_long (%sa,%s);\n", to, from);
+ break;
+ default:
+ abort ();
+ }
} else {
switch (size) {
case sz_byte:
char getcode[100];
int size = table68k[opcode].size == sz_long ? 4 : 2;
- if (table68k[opcode].size == sz_long) {
- strcpy (getcode, "get_long (srca)");
+ if (using_mmu) {
+ if (table68k[opcode].size == sz_long) {
+ strcpy (getcode, "uae_mmu_get_long (srca)");
+ } else {
+ strcpy (getcode, "(uae_s32)(uae_s16)uae_mmu_get_word (srca)");
+ }
} else {
- strcpy (getcode, "(uae_s32)(uae_s16)get_word (srca)");
+ if (table68k[opcode].size == sz_long) {
+ strcpy (getcode, "get_long (srca)");
+ } else {
+ strcpy (getcode, "(uae_s32)(uae_s16)get_word (srca)");
+ }
}
-
printf ("\tuae_u16 mask = %s;\n", gen_nextiword (0));
printf ("\tunsigned int dmask = mask & 0xff, amask = (mask >> 8) & 0xff;\n");
genamode (table68k[opcode].dmode, "dstreg", table68k[opcode].size, "src", 2, 1, 0);
{
char putcode[100];
int size = table68k[opcode].size == sz_long ? 4 : 2;
- if (table68k[opcode].size == sz_long) {
- strcpy (putcode, "put_long (srca");
+
+ if (using_mmu) {
+ if (table68k[opcode].size == sz_long) {
+ strcpy (putcode, "uae_mmu_put_long (srca");
+ } else {
+ strcpy (putcode, "uae_mmu_put_word (srca");
+ }
} else {
- strcpy (putcode, "put_word (srca");
+ if (table68k[opcode].size == sz_long) {
+ strcpy (putcode, "put_long (srca");
+ } else {
+ strcpy (putcode, "put_word (srca");
+ }
}
printf ("\tuae_u16 mask = %s;\n", gen_nextiword (0));
freopen (fname, "wb", stdout);
generate_includes (stdout);
}
+ using_mmu = 0;
cpu_level = 5 - i;
if (i == 11 || i == 12) {
cpu_level = 0;
#define false 0
#define likely(x) x
#define unlikely(x) x
+static ALWAYS_INLINE bool test_ram_boundary (uaecptr addr, int size, bool super, bool write) { return false; }
+static ALWAYS_INLINE void flush_internals (void) { }
typedef char flagtype;
static ALWAYS_INLINE uae_u8 *mmu_get_real_address(uaecptr addr, struct mmu_atc_line *cl)
{
- return do_get_real_address(cl->phys + addr);
+ return get_real_address(cl->phys + addr);
+}
+static ALWAYS_INLINE uae_u8 *phys_get_real_address(uaecptr addr)
+{
+ return get_real_address(addr);
}
static ALWAYS_INLINE uae_u32 mmu_get_long(uaecptr addr, int data, int size)
mmu_put_byte_slow(addr, val, super, data, size, cl);
}
+
+static ALWAYS_INLINE void phys_put_long(uaecptr addr, uae_u32 l)
+{
+ put_long (addr, l);
+}
+static ALWAYS_INLINE void phys_put_word(uaecptr addr, uae_u32 w)
+{
+ put_word (addr, w);
+}
+static ALWAYS_INLINE void phys_put_byte(uaecptr addr, uae_u32 b)
+{
+ put_byte (addr, b);
+}
+static ALWAYS_INLINE uae_u32 phys_get_long(uaecptr addr)
+{
+ return get_long (addr);
+}
+static ALWAYS_INLINE uae_u32 phys_get_word(uaecptr addr)
+{
+ return get_word (addr);
+}
+static ALWAYS_INLINE uae_u32 phys_get_byte(uaecptr addr)
+{
+ return get_byte (addr);
+}
+
+static ALWAYS_INLINE void HWput_l(uaecptr addr, uae_u32 l)
+{
+ put_long (addr, l);
+}
+static ALWAYS_INLINE void HWput_w(uaecptr addr, uae_u32 w)
+{
+ put_word (addr, w);
+}
+static ALWAYS_INLINE void HWput_b(uaecptr addr, uae_u32 b)
+{
+ put_byte (addr, b);
+}
+static ALWAYS_INLINE uae_u32 HWget_l(uaecptr addr)
+{
+ return get_long (addr);
+}
+static ALWAYS_INLINE uae_u32 HWget_w(uaecptr addr)
+{
+ return get_word (addr);
+}
+static ALWAYS_INLINE uae_u32 HWget_b(uaecptr addr)
+{
+ return get_byte (addr);
+}
+
+
+static ALWAYS_INLINE uae_u32 uae_mmu_get_long(uaecptr addr)
+{
+ if (unlikely(is_unaligned(addr, 4)))
+ return mmu_get_long_unaligned(addr, 1);
+ return mmu_get_long(addr, 1, sz_long);
+}
+static ALWAYS_INLINE uae_u16 uae_mmu_get_word(uaecptr addr)
+{
+ if (unlikely(is_unaligned(addr, 2)))
+ return mmu_get_word_unaligned(addr, 1);
+ return mmu_get_word(addr, 1, sz_word);
+}
+static ALWAYS_INLINE uae_u8 uae_mmu_get_byte(uaecptr addr)
+{
+ return mmu_get_byte(addr, 1, sz_byte);
+}
+static ALWAYS_INLINE void uae_mmu_put_long(uaecptr addr, uae_u32 val)
+{
+ if (unlikely(is_unaligned(addr, 4)))
+ mmu_put_long_unaligned(addr, val, 1);
+ else
+ mmu_put_long(addr, val, 1, sz_long);
+}
+static ALWAYS_INLINE void uae_mmu_put_word(uaecptr addr, uae_u16 val)
+{
+ if (unlikely(is_unaligned(addr, 2)))
+ mmu_put_word_unaligned(addr, val, 1);
+ else
+ mmu_put_word(addr, val, 1, sz_word);
+}
+static ALWAYS_INLINE void uae_mmu_put_byte(uaecptr addr, uae_u8 val)
+{
+ mmu_put_byte(addr, val, 1, sz_byte);
+}
+
+
+
+
#else
# define get_long(a) phys_get_long(a)
#define UAEMAJOR 1
#define UAEMINOR 5
-#define UAESUBREV 1
+#define UAESUBREV 2
typedef enum { KBD_LANG_US, KBD_LANG_DK, KBD_LANG_DE, KBD_LANG_SE, KBD_LANG_FR, KBD_LANG_IT, KBD_LANG_ES } KbdLang;
static void write_config (struct zfile *f, int idnum, int devnum, char *name, struct uae_input_device *id, struct uae_input_device2 *id2, struct inputdevice_functions *idf)
{
- char tmp1[100], *s;
+ char tmp1[MAX_DPATH], *s;
int i;
if (!isdevice (id)) {
int match = -1;
for (j = 0; j < MAX_INPUT_DEVICES; j++) {
if (aname2 && uid[j].configname) {
- char bname[MAX_JPORTNAME];
- char bname2[MAX_JPORTNAME];
+ char bname[MAX_DPATH];
+ char bname2[MAX_DPATH];
char *p1 ,*p2;
strcpy (bname, uid[j].configname);
strcpy (bname2, aname2);
ahisndbuffer = malloc (ahisndbufsize + 32);
if (!ahisndbuffer)
return 0;
- hr = DirectSoundCreate (&sound_devices[currprefs.win32_soundcard].guid, &lpDS2, NULL);
+ if (sound_devices[currprefs.win32_soundcard].type != SOUND_DEVICE_DS)
+ hr = DirectSoundCreate (NULL, &lpDS2, NULL);
+ else
+ hr = DirectSoundCreate (&sound_devices[currprefs.win32_soundcard].guid, &lpDS2, NULL);
if (FAILED (hr)) {
write_log ("AHI: DirectSoundCreate() failure: %s\n", DXError (hr));
return 0;
//\r
\r
VS_VERSION_INFO VERSIONINFO\r
- FILEVERSION 1,5,1,0\r
- PRODUCTVERSION 1,5,1,0\r
+ FILEVERSION 1,5,2,0\r
+ PRODUCTVERSION 1,5,2,0\r
FILEFLAGSMASK 0x3fL\r
#ifdef _DEBUG\r
FILEFLAGS 0x1L\r
BLOCK "040904b0"\r
BEGIN\r
VALUE "FileDescription", "WinUAE"\r
- VALUE "FileVersion", "1.5.1"\r
+ VALUE "FileVersion", "1.5.2"\r
VALUE "InternalName", "WinUAE"\r
VALUE "LegalCopyright", "© 1996-2008 under the GNU Public License (GPL)"\r
VALUE "OriginalFilename", "WinUAE.exe"\r
VALUE "ProductName", "WinUAE"\r
- VALUE "ProductVersion", "1.5.1"\r
+ VALUE "ProductVersion", "1.5.2"\r
END\r
END\r
BLOCK "VarFileInfo"\r
RTEXT "Memory: [] Graphics card memory. Required for RTG (Picasso96) emulation.",IDC_GFXCARDTEXT,25,98,53,10,SS_NOTIFY | SS_CENTERIMAGE
CONTROL "Slider1",IDC_P96MEM,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,88,94,60,20
EDITTEXT IDC_P96RAM,152,97,34,12,ES_CENTER | ES_READONLY
- GROUPBOX "Advanced Memory Settings",-1,13,171,275,65
- RTEXT "Motherboard RAM (Low area):",-1,39,190,129,10,SS_CENTERIMAGE
- CONTROL "",IDC_MBMEM1,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,180,186,59,20
- EDITTEXT IDC_MBRAM1,243,189,34,12,ES_CENTER | ES_READONLY
- RTEXT "Motherboard RAM (High area):",-1,39,215,129,10,SS_CENTERIMAGE
- CONTROL "",IDC_MBMEM2,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,180,211,59,20
- EDITTEXT IDC_MBRAM2,243,214,34,12,ES_CENTER | ES_READONLY
- GROUPBOX "RTG Graphics Card Settings",-1,14,81,275,87
- CONTROL "Scale instead of switching resolution",IDC_RTG_SCALE,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,134,162,10
+ GROUPBOX "Advanced Memory Settings",-1,13,179,275,57
+ RTEXT "Motherboard RAM (Low area):",-1,39,194,129,10,SS_CENTERIMAGE
+ CONTROL "",IDC_MBMEM1,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,180,190,59,20
+ EDITTEXT IDC_MBRAM1,243,193,34,12,ES_CENTER | ES_READONLY
+ RTEXT "Motherboard RAM (High area):",-1,39,217,129,10,SS_CENTERIMAGE
+ CONTROL "",IDC_MBMEM2,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,180,213,59,20
+ EDITTEXT IDC_MBRAM2,243,216,34,12,ES_CENTER | ES_READONLY
+ GROUPBOX "RTG Graphics Card Settings",-1,14,81,275,95
+ CONTROL "Scale if smaller than display size setting",IDC_RTG_SCALE,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,128,162,10
CONTROL "Match host and RTG color depth if possible",IDC_RTG_MATCH_DEPTH,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,119,163,10
- COMBOBOX IDC_RTG_8BIT,211,101,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
- COMBOBOX IDC_RTG_16BIT,211,117,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
- COMBOBOX IDC_RTG_24BIT,211,133,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
- COMBOBOX IDC_RTG_32BIT,211,149,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,116,163,10
+ COMBOBOX IDC_RTG_8BIT,211,107,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+ COMBOBOX IDC_RTG_16BIT,211,123,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+ COMBOBOX IDC_RTG_24BIT,211,139,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+ COMBOBOX IDC_RTG_32BIT,211,155,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+ CONTROL "Always scale in windowed mode",IDC_RTG_SCALE_ALLOW,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,140,162,10
+ COMBOBOX IDC_RTG_SCALE_ASPECTRATIO,131,155,57,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+ RTEXT "Scale aspect ratio",-1,24,156,99,10,SS_CENTERIMAGE
END
IDD_CPU DIALOGEX 0, 0, 300, 226
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
GROUPBOX "Filter Settings",-1,0,0,294,186
- CONTROL "Enable",IDC_FILTERENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,9,17,46,10
- COMBOBOX IDC_FILTERMODE,62,15,61,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
- COMBOBOX IDC_FILTERFILTER,128,15,81,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
- PUSHBUTTON "Reset to defaults",IDC_FILTERDEFAULT,213,15,73,14
+ CONTROL "Enable",IDC_FILTERENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,9,16,40,11
+ COMBOBOX IDC_FILTERMODE,53,15,83,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+ COMBOBOX IDC_FILTERFILTER,142,15,74,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+ PUSHBUTTON "Reset to defaults",IDC_FILTERDEFAULT,221,15,67,14
RTEXT "Horiz. size:",-1,7,44,54,10,SS_CENTERIMAGE
CONTROL "Slider1",IDC_FILTERHZ,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,99,37,152,19
EDITTEXT IDC_FILTERHZV,253,39,34,12,ES_CENTER | ES_READONLY
RTEXT "Vert. position:",-1,5,103,55,10,SS_CENTERIMAGE
CONTROL "Slider1",IDC_FILTERVO,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,99,97,151,19
EDITTEXT IDC_FILTERVOV,253,99,34,12,ES_CENTER | ES_READONLY
- RTEXT "Extra settings:",-1,27,133,57,10,SS_CENTERIMAGE
+ RTEXT "Extra settings:",-1,27,137,57,10,SS_CENTERIMAGE
CONTROL "Slider1",IDC_FILTERXL,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,99,157,151,19
EDITTEXT IDC_FILTERXLV,253,159,34,12,ES_CENTER | ES_READONLY
- COMBOBOX IDC_FILTERSLR,253,130,33,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+ COMBOBOX IDC_FILTERSLR,253,134,33,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Presets",-1,0,187,296,36
COMBOBOX IDC_FILTERPRESETS,8,201,119,150,CBS_DROPDOWN | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Load",IDC_FILTERPRESETLOAD,132,200,47,14
PUSHBUTTON "Delete",IDC_FILTERPRESETDELETE,236,200,47,14
COMBOBOX IDC_FILTERHZMULT,67,43,27,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_FILTERVZMULT,67,63,27,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
- CONTROL "Autoscale",IDC_FILTERAUTORES,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,9,168,63,10
- COMBOBOX IDC_FILTERXTRA,105,130,138,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
- CONTROL "Keep aspect ratio",IDC_FILTERASPECT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,9,153,87,10
+ CONTROL "Autoscale",IDC_FILTERAUTORES,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,9,168,83,10
+ COMBOBOX IDC_FILTERXTRA,105,134,138,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+ COMBOBOX IDC_FILTERASPECT,21,118,73,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+ CONTROL "Keep aspect ratio",IDC_FILTERKEEPASPECT,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,9,153,85,10
END
IDD_HARDDRIVE DIALOGEX 0, 0, 380, 76
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,5,0,0
- PRODUCTVERSION 1,5,0,0
+ FILEVERSION 1,5,1,0
+ PRODUCTVERSION 1,5,1,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
BLOCK "040904b0"
BEGIN
VALUE "FileDescription", "WinUAE"
- VALUE "FileVersion", "1.5.0"
+ VALUE "FileVersion", "1.5.1"
VALUE "InternalName", "WinUAE"
VALUE "LegalCopyright", "© 1996-2008 under the GNU Public License (GPL)"
VALUE "OriginalFilename", "WinUAE.exe"
VALUE "ProductName", "WinUAE"
- VALUE "ProductVersion", "1.5.0"
+ VALUE "ProductVersion", "1.5.1"
END
END
BLOCK "VarFileInfo"
END
END
-
/////////////////////////////////////////////////////////////////////////////
//
// String Table
IDS_DEFAULT_NEWWINUAE "WinUAE default (new)"
IDS_SOUND_CLONED51 "Cloned Stereo (5.1)"
IDS_SOUND_51 "5.1 Channels"
+ IDS_AUTOMATIC "Automatic"
END
STRINGTABLE
IDS_SOUND_MONO "Mono"
IDS_SOUND_MIXED "Mixed"
IDS_SOUND_STEREO "Stereo"
- IDS_SOUND_INTERPOL_DISABLED "Disabled"
+ IDS_DISABLED "Disabled"
IDS_SOUND_FILTER_OFF "Always off"
IDS_SOUND_FILTER_EMULATED "Emulated (A500)"
END
IDS_NUMSG_EXPROMNEED "One of the following expansion boot ROMs is required:\n\n%s\n\nCheck the System ROM path in the Paths panel and click Rescan ROMs."
IDS_HARDDRIVESAFETYWARNING2
"Warning: The drive safety check has been disabled, and non-empty and non-RDB partitioned hard disk(s) were detected."
+ IDS_SB_FAVORITENAME "Enter name..."
+ IDS_SB_CUSTOMEVENT "Enter custom event string.."
END
STRINGTABLE
#include <ks.h>
#include <ksmedia.h>
+#include <al.h>
+#include <alc.h>
+
#include <math.h>
#define ADJUST_SIZE 30
int sound_debug = 0;
int sound_mode_skip = 0;
+static int devicetype;
static int obtainedfreq;
static int have_sound;
static int paused;
static LPDIRECTSOUND8 lpDS;
static LPDIRECTSOUNDBUFFER8 lpDSBsecondary;
-
static DWORD writepos;
+
+#define AL_BUFFERS 2
+static ALCdevice *al_dev;
+static ALCcontext *al_ctx;
+static ALuint al_Buffers[AL_BUFFERS];
+static ALuint al_Source;
+static int al_toggle;
+static DWORD al_format;
+static uae_u8 *al_bigbuffer;
+static int al_bufsize, al_offset;
+
+
int setup_sound (void)
{
sound_available = 1;
}
}
-static void cleardsbuffer (void)
+static void clearbuffer_ds (void)
{
void *buffer;
DWORD size;
memset (buffer, 0, size);
IDirectSoundBuffer_Unlock (lpDSBsecondary, buffer, size, NULL, 0);
}
+static void clearbuffer_al (void)
+{
+ int i;
+ for (i = 0; i < AL_BUFFERS; i++) {
+ alSourceUnqueueBuffers (al_Source, 1, &al_Buffers[i]);
+ }
+ alGetError ();
+}
+static void clearbuffer (void)
+{
+ if (devicetype == SOUND_DEVICE_AL)
+ clearbuffer_al ();
+ else if (devicetype == SOUND_DEVICE_DS)
+ clearbuffer_ds ();
+}
static void pause_audio_ds (void)
{
hr = IDirectSoundBuffer_SetCurrentPosition (lpDSBsecondary, 0);
if (FAILED (hr))
write_log ("SOUND: DirectSoundBuffer_SetCurretPosition failed, %s\n", DXError (hr));
- cleardsbuffer ();
+ clearbuffer ();
}
-
static void resume_audio_ds (void)
{
paused = 0;
- cleardsbuffer ();
+ clearbuffer ();
+ waiting_for_buffer = 1;
+}
+static void pause_audio_al (void)
+{
+ waiting_for_buffer = 0;
+ alSourcePause (al_Source);
+ clearbuffer ();
+}
+static void resume_audio_al (void)
+{
waiting_for_buffer = 1;
+ al_offset = 0;
}
-static int restore (DWORD hr)
+static int restore_ds (DWORD hr)
{
if (hr != DSERR_BUFFERLOST)
return 0;
static void close_audio_ds (void)
{
- waiting_for_buffer = 0;
if (lpDSBsecondary)
IDirectSound_Release (lpDSBsecondary);
lpDSBsecondary = 0;
extern void setvolume_ahi(LONG);
void set_volume (int volume, int mute)
{
- HRESULT hr;
- LONG vol = DSBVOLUME_MIN;
-
- if (volume < 100 && !mute)
- vol = (LONG)((DSBVOLUME_MIN / 2) + (-DSBVOLUME_MIN / 2) * log (1 + (2.718281828 - 1) * (1 - volume / 100.0)));
- hr = IDirectSoundBuffer_SetVolume (lpDSBsecondary, vol);
- if (FAILED (hr))
- write_log ("SOUND: SetVolume(%d) failed: %s\n", vol, DXError (hr));
- setvolume_ahi (vol);
+ if (devicetype == SOUND_DEVICE_AL) {
+ float vol = 0.0;
+ if (volume < 100 && !mute)
+ vol = (100 - volume) / 100.0;
+ alSourcef (al_Source, AL_GAIN, vol);
+ } else if (devicetype == SOUND_DEVICE_DS) {
+ HRESULT hr;
+ LONG vol = DSBVOLUME_MIN;
+ if (volume < 100 && !mute)
+ vol = (LONG)((DSBVOLUME_MIN / 2) + (-DSBVOLUME_MIN / 2) * log (1 + (2.718281828 - 1) * (1 - volume / 100.0)));
+ hr = IDirectSoundBuffer_SetVolume (lpDSBsecondary, vol);
+ if (FAILED (hr))
+ write_log ("SOUND: SetVolume(%d) failed: %s\n", vol, DXError (hr));
+ setvolume_ahi (vol);
+ }
}
static void recalc_offsets (void)
return speakerconfig;
}
+static void close_audio_al (void)
+{
+ int i;
+
+ alDeleteSources (1, &al_Source);
+ al_Source = 0;
+ alDeleteBuffers (AL_BUFFERS, al_Buffers);
+ alcMakeContextCurrent (NULL);
+ if (al_ctx)
+ alcDestroyContext (al_ctx);
+ al_ctx = NULL;
+ if (al_dev)
+ alcCloseDevice (al_dev);
+ al_dev = NULL;
+ for (i = 0; i < AL_BUFFERS; i++) {
+ al_Buffers[i] = 0;
+ }
+ xfree (al_bigbuffer);
+ al_bigbuffer = NULL;
+}
+
+static int open_audio_al (int size)
+{
+ int freq = currprefs.sound_freq;
+ int ch = get_audio_nativechannels();
+
+ devicetype = SOUND_DEVICE_AL;
+ size *= ch * 2;
+ sndbufsize = size / 8;
+ if (sndbufsize > SND_MAX_BUFFER)
+ sndbufsize = SND_MAX_BUFFER;
+ al_bufsize = size;
+ al_bigbuffer = xcalloc (al_bufsize, 1);
+ al_dev = alcOpenDevice (sound_devices[currprefs.win32_soundcard].name);
+ if (!al_dev)
+ goto error;
+ al_ctx = alcCreateContext (al_dev, NULL);
+ if (!al_ctx)
+ goto error;
+ alcMakeContextCurrent (al_ctx);
+ alGenBuffers (AL_BUFFERS, al_Buffers);
+ alGenSources (1, &al_Source);
+ al_toggle = 0;
+ al_format = 0;
+ switch (ch)
+ {
+ case 1:
+ al_format = AL_FORMAT_MONO16;
+ break;
+ case 2:
+ al_format = AL_FORMAT_STEREO16;
+ break;
+ case 4:
+ al_format = alGetEnumValue ("AL_FORMAT_QUAD16");
+ break;
+ case 6:
+ al_format = alGetEnumValue ("AL_FORMAT_51CHN16");
+ break;
+ }
+ if (al_format == 0)
+ goto error;
+
+ write_log ("SOUND: %08X,CH=%d,FREQ=%d '%s' buffer %d (%d)\n",
+ al_format, ch, freq, sound_devices[currprefs.win32_soundcard].name,
+ sndbufsize, al_bufsize);
+ return 1;
+
+error:
+ close_audio_al ();
+ return 0;
+}
+
static int open_audio_ds (int size)
{
HRESULT hr;
int round, i;
DWORD speakerconfig;
- enumerate_sound_devices ();
+ devicetype = SOUND_DEVICE_DS;
size *= ch * 2;
snd_configsize = size;
sndbufsize = size / 32;
if (max_sndbufsize * 2 > dsoundbuf)
max_sndbufsize = dsoundbuf / 2;
- recalc_offsets();
+ recalc_offsets ();
hr = DirectSoundCreate8 (&sound_devices[currprefs.win32_soundcard].guid, &lpDS, NULL);
if (FAILED (hr)) {
}
IDirectSound_Release (pdsb);
- set_volume (currprefs.sound_volume, mute);
- cleardsbuffer ();
- init_sound_table16 ();
- if (get_audio_amigachannels() == 4)
- sample_handler = sample16ss_handler;
- else
- sample_handler = get_audio_ismono () ? sample16_handler : sample16s_handler;
-
- obtainedfreq = currprefs.sound_freq;
-
return 1;
error:
if (size < 512)
size = 512;
- ret = open_audio_ds (size);
+ enumerate_sound_devices ();
+ if (sound_devices[currprefs.win32_soundcard].type == SOUND_DEVICE_AL)
+ ret = open_audio_al (size);
+ else if (sound_devices[currprefs.win32_soundcard].type == SOUND_DEVICE_DS)
+ ret = open_audio_ds (size);
if (!ret)
return 0;
+ set_volume (currprefs.sound_volume, mute);
+ clearbuffer ();
+ init_sound_table16 ();
+ if (get_audio_amigachannels() == 4)
+ sample_handler = sample16ss_handler;
+ else
+ sample_handler = get_audio_ismono () ? sample16_handler : sample16s_handler;
+
+ obtainedfreq = currprefs.sound_freq;
+
have_sound = 1;
sound_available = 1;
update_sound (fake_vblank_hz);
if (! have_sound)
return;
pause_sound ();
- close_audio_ds ();
+ if (devicetype == SOUND_DEVICE_AL)
+ close_audio_al ();
+ else if (devicetype == SOUND_DEVICE_DS)
+ close_audio_ds ();
have_sound = 0;
}
paused = 1;
if (!have_sound)
return;
- pause_audio_ds ();
- cleardsbuffer ();
+ if (devicetype == SOUND_DEVICE_AL)
+ pause_audio_al ();
+ else if (devicetype == SOUND_DEVICE_DS)
+ pause_audio_ds ();
+ clearbuffer ();
}
void resume_sound (void)
return;
if (!have_sound)
return;
- cleardsbuffer ();
- resume_audio_ds ();
+ clearbuffer ();
+ if (devicetype == SOUND_DEVICE_AL)
+ resume_audio_al ();
+ else if (devicetype == SOUND_DEVICE_DS)
+ resume_audio_ds ();
}
void reset_sound (void)
{
if (!have_sound)
return;
- cleardsbuffer ();
+ clearbuffer ();
}
#ifdef JIT
DWORD playpos, safed;
HRESULT hr;
+ if (devicetype != SOUND_DEVICE_DS)
+ return;
if (waiting_for_buffer != -1)
return;
hr = IDirectSoundBuffer_GetCurrentPosition (lpDSBsecondary, &playpos, &safed);
cf (writepos);
}
+static int alcheck (int v)
+{
+ int err = alGetError ();
+ if (err != AL_NO_ERROR) {
+ int v1, v2, v3;
+ alGetSourcei (al_Source, AL_BUFFERS_PROCESSED, &v1);
+ alGetSourcei (al_Source, AL_BUFFERS_QUEUED, &v2);
+ alGetSourcei (al_Source, AL_SOURCE_STATE, &v3);
+ write_log ("OpenAL %d: error %d. PROC=%d QUEUE=%d STATE=%d\n", v, err, v1, v2, v3);
+ return 1;
+ }
+ return 0;
+}
+
+static void finish_sound_buffer_al (void)
+{
+ static int tfprev;
+ static int statuscnt;
+ int v, v2;
+ double m, skipmode;
+
+ if (!waiting_for_buffer)
+ return;
+ if (savestate_state)
+ return;
+
+ if (statuscnt > 0) {
+ statuscnt--;
+ if (statuscnt == 0)
+ gui_data.sndbuf_status = 0;
+ }
+ if (gui_data.sndbuf_status == 3)
+ gui_data.sndbuf_status = 0;
+ alGetError ();
+
+ memcpy (al_bigbuffer + al_offset, sndbuffer, sndbufsize);
+ al_offset += sndbufsize;
+ if (al_offset >= al_bufsize) {
+ alGetSourcei (al_Source, AL_BUFFERS_PROCESSED, &v);
+ while (v == 0 && waiting_for_buffer < 0) {
+ sleep_millis (1);
+ alGetSourcei (al_Source, AL_SOURCE_STATE, &v);
+ if (v != AL_PLAYING)
+ break;
+ alGetSourcei (al_Source, AL_BUFFERS_PROCESSED, &v);
+ }
+
+ alSourceUnqueueBuffers (al_Source, 1, &al_Buffers[al_toggle]);
+ alGetError ();
+ alBufferData (al_Buffers[al_toggle], al_format, al_bigbuffer, al_bufsize, currprefs.sound_freq);
+ alcheck(4);
+ alSourceQueueBuffers (al_Source, 1, &al_Buffers[al_toggle]);
+ alcheck(2);
+ al_toggle++;
+ if (al_toggle >= AL_BUFFERS)
+ al_toggle = 0;
+
+ alGetSourcei (al_Source, AL_BUFFERS_QUEUED, &v2);
+ alGetSourcei (al_Source, AL_SOURCE_STATE, &v);
+ alcheck(3);
+ if (v != AL_PLAYING && v2 >= AL_BUFFERS) {
+ if (waiting_for_buffer > 0) {
+ write_log ("AL SOUND PLAY!\n");
+ alSourcePlay (al_Source);
+ waiting_for_buffer = -1;
+ tfprev = timeframes + 10;
+ tfprev = (tfprev / 10) * 10;
+ } else {
+ gui_data.sndbuf_status = 2;
+ statuscnt = SND_STATUSCNT;
+ write_log ("AL underflow\n");
+ clearbuffer ();
+ waiting_for_buffer = 1;
+ }
+ }
+ al_offset = 0;
+ }
+ alcheck(1);
+
+ alGetSourcei (al_Source, AL_SOURCE_STATE, &v);
+ if (v == AL_PLAYING) {
+ alGetSourcei (al_Source, AL_BYTE_OFFSET, &v);
+ v -= al_offset;
+ gui_data.sndbuf = 100 * v / sndbufsize;
+ m = gui_data.sndbuf / 100.0;
+
+ if (isvsync ()) {
+
+ skipmode = pow (m < 0 ? -m : m, EXP) / 8;
+ if (m < 0)
+ skipmode = -skipmode;
+ if (skipmode < -ADJUST_VSSIZE)
+ skipmode = -ADJUST_VSSIZE;
+ if (skipmode > ADJUST_VSSIZE)
+ skipmode = ADJUST_VSSIZE;
+
+ } else {
+
+ skipmode = pow (m < 0 ? -m : m, EXP) / 2;
+ if (m < 0)
+ skipmode = -skipmode;
+ if (skipmode < -ADJUST_SIZE)
+ skipmode = -ADJUST_SIZE;
+ if (skipmode > ADJUST_SIZE)
+ skipmode = ADJUST_SIZE;
+
+ }
+ if (tfprev != timeframes) {
+ if ((0 || sound_debug) && !(tfprev % 10))
+ write_log ("s=%+02.1f\n", skipmode);
+ tfprev = timeframes;
+ if (!avioutput_audio)
+ sound_setadjust (skipmode);
+ }
+ }
+
+ alcheck (0);
+}
+
static void finish_sound_buffer_ds (void)
{
static int tfprev;
hr = IDirectSoundBuffer_Play (lpDSBsecondary, 0, 0, DSBPLAY_LOOPING);
if (FAILED (hr)) {
write_log ("SOUND: Play failed: %s\n", DXError (hr));
- restore (DSERR_BUFFERLOST);
+ restore_ds (DSERR_BUFFERLOST);
waiting_for_buffer = 0;
return;
}
hr = IDirectSoundBuffer_SetCurrentPosition (lpDSBsecondary, 0);
if (FAILED (hr)) {
write_log ("SOUND: 1st SetCurrentPosition failed: %s\n", DXError (hr));
- restore (DSERR_BUFFERLOST);
+ restore_ds (DSERR_BUFFERLOST);
waiting_for_buffer = 0;
return;
}
hr = IDirectSoundBuffer_GetStatus (lpDSBsecondary, &status);
if (FAILED (hr)) {
write_log ("SOUND: GetStatus() failed: %s\n", DXError (hr));
- restore (DSERR_BUFFERLOST);
+ restore_ds (DSERR_BUFFERLOST);
return;
}
if (status & DSBSTATUS_BUFFERLOST) {
write_log ("SOUND: buffer lost\n");
- restore (DSERR_BUFFERLOST);
+ restore_ds (DSERR_BUFFERLOST);
return;
}
if ((status & (DSBSTATUS_PLAYING | DSBSTATUS_LOOPING)) != (DSBSTATUS_PLAYING | DSBSTATUS_LOOPING)) {
write_log ("SOUND: status = %08X\n", status);
- restore (DSERR_BUFFERLOST);
+ restore_ds (DSERR_BUFFERLOST);
return;
}
for (;;) {
hr = IDirectSoundBuffer_GetCurrentPosition (lpDSBsecondary, &playpos, &safepos);
if (FAILED (hr)) {
- restore (hr);
+ restore_ds (hr);
write_log ("SOUND: GetCurrentPosition failed: %s\n", DXError (hr));
return;
}
counter--;
if (counter < 0) {
write_log ("SOUND: sound system got stuck!?\n");
- restore (DSERR_BUFFERLOST);
+ restore_ds (DSERR_BUFFERLOST);
return;
}
continue;
}
hr = IDirectSoundBuffer_Lock (lpDSBsecondary, writepos, sndbufsize, &b1, &s1, &b2, &s2, 0);
- if (restore (hr))
+ if (restore_ds (hr))
return;
if (FAILED (hr)) {
write_log ("SOUND: lock failed: %s (%d %d)\n", DXError (hr), writepos / samplesize, sndbufsize / samplesize);
#endif
if (!have_sound)
return;
- finish_sound_buffer_ds ();
+
+ if (devicetype == SOUND_DEVICE_AL)
+ finish_sound_buffer_al ();
+ else if (devicetype == SOUND_DEVICE_DS)
+ finish_sound_buffer_ds ();
}
static BOOL CALLBACK DSEnumProc (LPGUID lpGUID, LPCTSTR lpszDesc, LPCTSTR lpszDrvName, LPVOID lpContext)
if (lpGUID != NULL)
memcpy (&sd[i].guid, lpGUID, sizeof (GUID));
sd[i].name = my_strdup (lpszDesc);
+ sd[i].type = SOUND_DEVICE_DS;
return TRUE;
}
int enumerate_sound_devices (void)
{
if (!num_sound_devices) {
+ HMODULE l = NULL;
DirectSoundEnumerate ((LPDSENUMCALLBACK)DSEnumProc, sound_devices);
DirectSoundCaptureEnumerate ((LPDSENUMCALLBACK)DSEnumProc, record_devices);
+ l = LoadLibrary ("openal32.dll");
+ if (l != NULL) {
+ FreeLibrary (l);
+ if (alcIsExtensionPresent (NULL, "ALC_ENUMERATION_EXT")) {
+ const ALchar* pDeviceNames = alcGetString (NULL, ALC_DEVICE_SPECIFIER);
+ const ALchar* ppDefaultDevice = alcGetString (NULL, ALC_DEFAULT_DEVICE_SPECIFIER);
+ while (pDeviceNames && *pDeviceNames) {
+ struct sound_device *sd;
+ ALCdevice *pDevice;
+ int i;
+ for (i = 0; i < MAX_SOUND_DEVICES; i++) {
+ sd = &sound_devices[i];
+ if (sd->name == NULL)
+ break;
+ }
+ if (i >= MAX_SOUND_DEVICES)
+ break;
+ pDevice = alcOpenDevice (pDeviceNames);
+ if (pDevice) {
+ ALCcontext *context = alcCreateContext (pDevice, NULL);
+ if (context) {
+ ALint iMajorVersion = 0, iMinorVersion = 0;
+ alcMakeContextCurrent (context);
+ alcGetIntegerv (pDevice, ALC_MAJOR_VERSION, sizeof (ALint), &iMajorVersion);
+ alcGetIntegerv (pDevice, ALC_MINOR_VERSION, sizeof (ALint), &iMinorVersion);
+ if (iMajorVersion > 1 || (iMajorVersion == 1 && iMinorVersion > 0)) {
+ sd->type = SOUND_DEVICE_AL;
+ sd->name = my_strdup (pDeviceNames);
+ }
+ alcMakeContextCurrent (NULL);
+ alcDestroyContext (context);
+ }
+ alcCloseDevice (pDevice);
+ }
+ pDeviceNames += strlen (pDeviceNames) + 1;
+ }
+ }
+ }
for (num_sound_devices = 0; num_sound_devices < MAX_SOUND_DEVICES; num_sound_devices++) {
if (sound_devices[num_sound_devices].name == NULL)
break;
return ok == 2;
}
-static void mcierr(char *str, DWORD err)
+static void mcierr (char *str, DWORD err)
{
char es[1000];
if (err == MMSYSERR_NOERROR)
cfgfile_target_dwrite (f, "ctrl_f11_is_quit=%s\n", p->win32_ctrl_F11_is_quit ? "true" : "false");
cfgfile_target_dwrite (f, "midiout_device=%d\n", p->win32_midioutdev );
cfgfile_target_dwrite (f, "midiin_device=%d\n", p->win32_midiindev );
- cfgfile_target_dwrite (f, "rtg_match_depth=%s\n", p->win32_rtgmatchdepth ? "true" : "false" );
- cfgfile_target_dwrite (f, "rtg_scale_small=%s\n", p->win32_rtgscaleifsmall ? "true" : "false" );
- cfgfile_target_dwrite (f, "rtg_scale_allow=%s\n", p->win32_rtgallowscaling ? "true" : "false" );
+ cfgfile_target_dwrite (f, "rtg_match_depth=%s\n", p->win32_rtgmatchdepth ? "true" : "false");
+ cfgfile_target_dwrite (f, "rtg_scale_small=%s\n", p->win32_rtgscaleifsmall ? "true" : "false");
+ cfgfile_target_dwrite (f, "rtg_scale_allow=%s\n", p->win32_rtgallowscaling ? "true" : "false");
cfgfile_target_dwrite (f, "rtg_scale_aspect_ratio=%d:%d\n",
p->win32_rtgscaleaspectratio >= 0 ? (p->win32_rtgscaleaspectratio >> 8) : -1,
p->win32_rtgscaleaspectratio >= 0 ? (p->win32_rtgscaleaspectratio & 0xff) : -1);
- cfgfile_target_dwrite (f, "borderless=%s\n", p->win32_borderless ? "true" : "false" );
+ cfgfile_target_dwrite (f, "borderless=%s\n", p->win32_borderless ? "true" : "false");
cfgfile_target_dwrite (f, "uaescsimode=%s\n", scsimode[p->win32_uaescsimode]);
- cfgfile_target_dwrite (f, "soundcard=%d\n", p->win32_soundcard );
+ cfgfile_target_dwrite (f, "soundcard=%d\n", p->win32_soundcard);
cfgfile_target_dwrite (f, "cpu_idle=%d\n", p->cpu_idle);
cfgfile_target_dwrite (f, "notaskbarbutton=%s\n", p->win32_notaskbarbutton ? "true" : "false");
cfgfile_target_dwrite (f, "always_on_top=%s\n", p->win32_alwaysontop ? "true" : "false");
if (WIN32_RegisterClasses () && WIN32_InitLibraries () && DirectDraw_Start (NULL)) {
DEVMODE devmode;
- DWORD i = 0;
+ DWORD i;
DirectDraw_Release ();
write_log ("Enumerating display devices.. \n");
write_log ("Sorting devices and modes..\n");
sortdisplays ();
write_log ("Display buffer mode = %d\n", ddforceram);
+ write_log ("Enumerating sound devices:\n");
+ for (i = 0; i < enumerate_sound_devices (); i++) {
+ write_log ("%d:%s: %s\n", i, sound_devices[i].type == SOUND_DEVICE_DS ? "DS" : "AL", sound_devices[i].name);
+ }
write_log ("done\n");
-
memset (&devmode, 0, sizeof(devmode));
devmode.dmSize = sizeof (DEVMODE);
if (EnumDisplaySettings (NULL, ENUM_CURRENT_SETTINGS, &devmode)) {
#define GETBDM(x) (((x) - ((x / 10000) * 10000)) / 100)
#define GETBDD(x) ((x) % 100)
-#define WINUAEBETA 0
-#define WINUAEPUBLICBETA 0
-#define WINUAEDATE MAKEBD(2008, 8, 12)
+#define WINUAEBETA 1
+#define WINUAEPUBLICBETA 1
+#define WINUAEDATE MAKEBD(2008, 8, 17)
#define WINUAEEXTRA ""
#define WINUAEREV ""
extern LONG WINAPI WIN32_ExceptionFilter (struct _EXCEPTION_POINTERS *pExceptionPointers, DWORD ec);
-#define MAX_SOUND_DEVICES 10
+#define MAX_SOUND_DEVICES 20
+#define SOUND_DEVICE_DS 1
+#define SOUND_DEVICE_AL 2
struct sound_device
{
GUID guid;
char *name;
+ int type;
};
extern struct sound_device sound_devices[MAX_SOUND_DEVICES];
extern struct sound_device record_devices[MAX_SOUND_DEVICES];
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 - snd_width - 2;
+ lpParts[0] = rc.right - (drive_width * 4) - power_width - idle_width - fps_width - cd_width - hd_width - snd_width - 16;
lpParts[1] = lpParts[0] + snd_width;
lpParts[2] = lpParts[1] + idle_width;
lpParts[3] = lpParts[2] + fps_width;
window_led_drives_end = lpParts[10];
/* Create the parts */
- SendMessage (hStatusWnd, SB_SETPARTS, (WPARAM) num_parts, (LPARAM) lpParts);
+ SendMessage (hStatusWnd, SB_SETPARTS, (WPARAM)num_parts, (LPARAM)lpParts);
LocalUnlock (hloc);
LocalFree (hloc);
}
sprintf (txt, "%d", workprefs.sound_freq);
SendDlgItemMessage (hDlg, IDC_SOUNDFREQ, WM_SETTEXT, 0, (LPARAM)txt);
- switch (workprefs.produce_sound) {
+ switch (workprefs.produce_sound)
+ {
case 0: which_button = IDC_SOUND0; break;
case 1: which_button = IDC_SOUND1; break;
case 2: which_button = IDC_SOUND2; break;
switch (msg) {
case WM_INITDIALOG:
+ {
+ int gotnonds = 0;
sound_loaddrivesamples ();
SendDlgItemMessage (hDlg, IDC_SOUNDBUFFERRAM, TBM_SETRANGE, TRUE, MAKELONG (MIN_SOUND_MEM, MAX_SOUND_MEM));
SendDlgItemMessage (hDlg, IDC_SOUNDBUFFERRAM, TBM_SETPAGESIZE, 0, 1);
SendDlgItemMessage (hDlg, IDC_SOUNDCARDLIST, CB_RESETCONTENT, 0, 0L);
numdevs = enumerate_sound_devices ();
- for (card = 0; card < numdevs; card++)
- SendDlgItemMessage (hDlg, IDC_SOUNDCARDLIST, CB_ADDSTRING, 0, (LPARAM)sound_devices[card].name);
+ for (card = 0; card < numdevs; card++) {
+ if (sound_devices[card].type != SOUND_DEVICE_DS)
+ gotnonds = 1;
+ }
+ for (card = 0; card < numdevs; card++) {
+ char tmp[MAX_DPATH];
+ if (gotnonds)
+ sprintf (tmp, "%s: %s", sound_devices[card].type == SOUND_DEVICE_DS ? "DS" : "AL", sound_devices[card].name);
+ else
+ strcpy (tmp, sound_devices[card].name);
+ SendDlgItemMessage (hDlg, IDC_SOUNDCARDLIST, CB_ADDSTRING, 0, (LPARAM)tmp);
+ }
if (numdevs == 0)
workprefs.produce_sound = 0; /* No sound card in system, enable_for_sounddlg will accomodate this */
pages[SOUND_ID] = hDlg;
currentpage = SOUND_ID;
-
+ }
case WM_USER:
recursive++;
values_to_sounddlg (hDlg);
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="opengl32.lib glu32.lib ws2_32.lib ddraw.lib dxguid.lib winmm.lib comctl32.lib version.lib vfw32.lib msacm32.lib dsound.lib dinput8.lib d3d9.lib d3dx9.lib winio.lib setupapi.lib wininet.lib dxerr9.lib shlwapi.lib zlibstat.lib libpng.lib lglcd.lib wpcap.lib packet.lib"
+ AdditionalDependencies="opengl32.lib glu32.lib ws2_32.lib ddraw.lib dxguid.lib winmm.lib comctl32.lib version.lib vfw32.lib msacm32.lib dsound.lib dinput8.lib d3d9.lib d3dx9.lib winio.lib setupapi.lib wininet.lib dxerr9.lib shlwapi.lib zlibstat.lib libpng.lib lglcd.lib wpcap.lib packet.lib openal32.lib"
OutputFile="d:\amiga\winuae.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories=""
GenerateManifest="true"
AdditionalManifestDependencies=""
- DelayLoadDLLs="wpcap.dll;packet.dll;d3dx9_39.dll"
+ DelayLoadDLLs="wpcap.dll;packet.dll;d3dx9_39.dll;openal32.dll"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\Release/winuae.pdb"
SubSystem="2"
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="opengl32.lib glu32.lib ws2_32.lib ddraw.lib dxguid.lib winmm.lib comctl32.lib version.lib vfw32.lib msacm32.lib dsound.lib dinput8.lib d3d9.lib d3dx9.lib winio.lib setupapi.lib wininet.lib dxerr9.lib shlwapi.lib zlibstat.lib libpng.lib lglcd.lib wpcap.lib packet.lib"
+ AdditionalDependencies="opengl32.lib glu32.lib ws2_32.lib ddraw.lib dxguid.lib winmm.lib comctl32.lib version.lib vfw32.lib msacm32.lib dsound.lib dinput8.lib d3d9.lib d3dx9.lib winio.lib setupapi.lib wininet.lib dxerr9.lib shlwapi.lib zlibstat.lib libpng.lib lglcd.lib wpcap.lib packet.lib openal32.lib"
OutputFile="d:\amiga\winuae.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories=""
GenerateManifest="true"
AdditionalManifestDependencies=""
- DelayLoadDLLs="wpcap.dll;packet.dll;d3dx9_39.dll"
+ DelayLoadDLLs="wpcap.dll;packet.dll;d3dx9_39.dll;openal32.dll"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\FullRelease/winuae.pdb"
SubSystem="2"
RelativePath="..\..\cpuemu_12.c"
>
</File>
+ <File
+ RelativePath="..\..\cpummu.c"
+ >
+ </File>
<File
RelativePath="..\..\cpustbl.c"
>
-Final
+Beta 1: (crashing bug = this will be quick beta series, really!)
+
+- 4th floppy drive track display number was clipped in windowed mode
+- non-vsync RTG mode run in "warp"-mode if native mode was set to
+ fullscreen+vsync
+- USB "non-friendly" name buffer overflow, caused random crashes
+ and weird behavior.. (1.5.1)
+- OpenAL sound support (experimental, OpenAL may be better API for
+ new AHI driver than DSound) Note that OpenAL uses internally
+ DirectSound if sound card does not have native OpenAL support.
+ "Generic Hardware" = DSound wrapper, "Generic Software" = WaveOut
+ wrapper (really bad), something else = native support. OpenAL sound
+ devices only available if OpenAL is installed. DO NOT ASK something
+ like "What is OpenAL". Learn to use search engines first or ignore
+ this feature.
+- sprite garbage was possible if sprite(s) active during resolution
+ change from higher to lower resolution (AGA only) (1.5.0)
+
+Final 1.5.1
- compiled with August 2008 DXSDK, shader files modified (old ones are
not compatible anymore) D3D filter now requires August 2008 or newer