cfgfile_write_bool (f, _T("sound_auto"), p->sound_auto);
cfgfile_write_bool (f, _T("sound_stereo_swap_paula"), p->sound_stereo_swap_paula);
cfgfile_write_bool (f, _T("sound_stereo_swap_ahi"), p->sound_stereo_swap_ahi);
+ cfgfile_dwrite (f, _T("sampler_frequency"), _T("%d"), p->sampler_freq);
+ cfgfile_dwrite (f, _T("sampler_buffer"), _T("%d"), p->sampler_buffer);
+ cfgfile_dwrite_bool (f, _T("sampler_stereo"), p->sampler_stereo);
cfgfile_write_str (f, _T("comp_trustbyte"), compmode[p->comptrustbyte]);
cfgfile_write_str (f, _T("comp_trustword"), compmode[p->comptrustword]);
cfgfile_write (f, _T("gfxcard_size"), _T("%d"), p->rtgmem_size / 0x100000);
cfgfile_write_str (f, _T("gfxcard_type"), rtgtype[p->rtgmem_type]);
cfgfile_write_bool (f, _T("gfxcard_hardware_vblank"), p->rtg_hardwareinterrupt);
+ cfgfile_write_bool (f, _T("gfxcard_hardware_sprite"), p->rtg_hardwaresprite);
cfgfile_write (f, _T("chipmem_size"), _T("%d"), p->chipmem_size == 0x20000 ? -1 : (p->chipmem_size == 0x40000 ? 0 : p->chipmem_size / 0x80000));
cfgfile_dwrite (f, _T("megachipmem_size"), _T("%d"), p->z3chipmem_size / 0x100000);
} else {
cfgfile_write_str (f, _T("cpu_speed"), p->m68k_speed < 0 ? _T("max") : _T("real"));
}
- cfgfile_write (f, _T("cpu_throttle"), _T("%d"), p->m68k_speed_throttle);
+ cfgfile_write (f, _T("cpu_throttle"), _T("%.1f"), p->m68k_speed_throttle);
/* do not reorder start */
write_compatibility_cpu(f, p);
write_filesys_config (p, f);
if (p->filesys_no_uaefsdb)
cfgfile_write_bool (f, _T("filesys_no_fsdb"), p->filesys_no_uaefsdb);
+ cfgfile_dwrite (f, _T("filesys_max_size"), _T("%d"), p->filesys_limit);
#endif
write_inputdevice_config (p, f);
}
|| cfgfile_intval (option, value, _T("sound_volume_cd"), &p->sound_volume_cd, 1)
|| cfgfile_intval (option, value, _T("sound_stereo_separation"), &p->sound_stereo_separation, 1)
|| cfgfile_intval (option, value, _T("sound_stereo_mixing_delay"), &p->sound_mixed_stereo_delay, 1)
+ || cfgfile_intval (option, value, _T("sampler_frequency"), &p->sampler_freq, 1)
+ || cfgfile_intval (option, value, _T("sampler_buffer"), &p->sampler_buffer, 1)
|| cfgfile_intval (option, value, _T("gfx_framerate"), &p->gfx_framerate, 1)
|| cfgfile_intval (option, value, _T("gfx_width_windowed"), &p->gfx_size_win.width, 1)
|| cfgfile_intval (option, value, _T("gfx_contrast"), &p->gfx_contrast, 1)
|| cfgfile_intval (option, value, _T("gfx_gamma"), &p->gfx_gamma, 1)
|| cfgfile_string (option, value, _T("gfx_filter_mask"), p->gfx_filtermask, sizeof p->gfx_filtermask / sizeof (TCHAR))
+ || cfgfile_intval (option, value, _T("filesys_max_size"), &p->filesys_limit, 1)
#endif
|| cfgfile_intval (option, value, _T("floppy0sound"), &p->floppyslots[0].dfxclick, 1)
return 1;
if (cfgfile_yesno (option, value, _T("use_debugger"), &p->start_debugger)
+ || cfgfile_yesno (option, value, _T("sampler_stereo"), &p->sampler_stereo)
|| cfgfile_yesno (option, value, _T("sound_auto"), &p->sound_auto)
|| cfgfile_yesno (option, value, _T("sound_stereo_swap_paula"), &p->sound_stereo_swap_paula)
|| cfgfile_yesno (option, value, _T("sound_stereo_swap_ahi"), &p->sound_stereo_swap_ahi)
while (s) {
if (!_tcschr (s, ':'))
break;
- p->osd_pos.x = _tstof (s) * 10.0;
+ p->osd_pos.x = (int)(_tstof (s) * 10.0);
s = _tcschr (s, ':');
if (!s)
break;
if (s[-1] == '%')
p->osd_pos.x += 30000;
s++;
- p->osd_pos.y = _tstof (s) * 10.0;
+ p->osd_pos.y = (int)(_tstof (s) * 10.0);
s += _tcslen (s);
if (s[-1] == '%')
p->osd_pos.y += 30000;
|| cfgfile_yesno (option, value, _T("agnus_bltbusybug"), &p->cs_agnusbltbusybug)
|| cfgfile_yesno (option, value, _T("fastmem_autoconfig"), &p->fastmem_autoconfig)
|| cfgfile_yesno (option, value, _T("gfxcard_hardware_vblank"), &p->rtg_hardwareinterrupt)
+ || cfgfile_yesno (option, value, _T("gfxcard_hardware_sprite"), &p->rtg_hardwaresprite)
|| cfgfile_yesno (option, value, _T("kickshifter"), &p->kickshifter)
|| cfgfile_yesno (option, value, _T("ntsc"), &p->ntscmode)
|| cfgfile_yesno (option, value, _T("comp_lowopt"), &p->comp_lowopt)
|| cfgfile_yesno (option, value, _T("rtg_nocustom"), &p->picasso96_nocustom)
|| cfgfile_yesno (option, value, _T("floppy_write_protected"), &p->floppy_read_only)
+ || cfgfile_yesno (option, value, _T("floppy_auto_extended_adf"), &p->floppy_auto_ext2)
|| cfgfile_yesno (option, value, _T("uaeserial"), &p->uaeserial))
return 1;
p->m68k_speed *= CYCLE_UNIT;
return 1;
}
- if (cfgfile_intval (option, value, _T("cpu_throttle"), &p->m68k_speed_throttle, 1)) {
+ if (cfgfile_doubleval (option, value, _T("cpu_throttle"), &p->m68k_speed_throttle)) {
return 1;
}
if (cfgfile_intval (option, value, _T("finegrain_cpu_speed"), &p->m68k_speed, 1)) {
p->sound_filter = FILTER_SOUND_EMUL;
p->sound_filter_type = 0;
p->sound_auto = 1;
+ p->sampler_stereo = false;
+ p->sampler_buffer = 0;
+ p->sampler_freq = 0;
p->comptrustbyte = 0;
p->comptrustword = 0;
p->chipset_mask = CSMASK_ECS_AGNUS;
p->genlock = 0;
p->ntscmode = 0;
+ p->filesys_limit = 0;
p->fastmem_size = 0x00000000;
p->fastmem2_size = 0x00000000;
/* 0: cycle-exact
* 1: more compatible
* 2: no more compatible, no 100% sound
-* 3: no more compatible, immediate blits, no 100% sound
+* 3: no more compatible, waiting blits, no 100% sound
*/
static void set_68000_compa (struct uae_prefs *p, int compa)
p->cpu_compatible = 0;
break;
case 3:
- p->immediate_blits = 1;
p->produce_sound = 2;
p->cpu_compatible = 0;
break;
else
roms[0] = 59;
roms[1] = -1;
- p->immediate_blits = 1;
p->bogomem_size = 0;
p->chipmem_size = 0x200000;
p->cpu_model = 68030;
roms[2] = 13;
roms[3] = 12;
roms[4] = -1;
- p->immediate_blits = 1;
+
p->bogomem_size = 0;
p->chipmem_size = 0x200000;
p->mbresmem_low_size = 8 * 1024 * 1024;
roms[1] = 31;
roms[2] = 13;
roms[3] = -1;
- p->immediate_blits = 1;
+
p->bogomem_size = 0;
p->chipmem_size = 0x200000;
p->mbresmem_low_size = 8 * 1024 * 1024;
v = bip_super (p, config, compa, romcheck);
break;
}
- if (p->cpu_model >= 68020 || !p->cpu_cycle_exact)
+ if ((p->cpu_model >= 68020 || !p->cpu_cycle_exact) && !p->immediate_blits)
p->waiting_blits = 1;
return v;
}
static uae_s16 bpl1mod, bpl2mod;
static uaecptr prevbpl[2][MAXVPOS][8];
static uaecptr bplpt[8], bplptx[8];
+static bool brdblank_prevframe[MAXVPOS];
/*static int blitcount[256]; blitter debug */
return bplehb;
}
+static bool isbrdblank (uae_u16 bplcon0, uae_u16 bplcon3)
+{
+#ifdef ECS_DENISE
+ return (currprefs.chipset_mask & CSMASK_ECS_DENISE) && (bplcon0 & 1) && (bplcon3 & 0x20);
+#else
+ return false;
+#endif
+}
+
// OCS/ECS, lores, 7 planes = 4 "real" planes + BPL5DAT and BPL6DAT as static 5th and 6th plane
STATIC_INLINE int isocs7planes (void)
{
if (value & 0x800)
thisline_decision.ham_seen = 1;
thisline_decision.ehb_seen = isehb (value, bplcon2);
+ thisline_decision.brdblank_seen = isbrdblank (value, bplcon3);
} else if (regno == 0x104) { // BPLCON2
- thisline_decision.ehb_seen = isehb (value, bplcon2);
+ thisline_decision.ehb_seen = isehb (bplcon0, value);
+ } else if (regno == 0x106) { // BPLCON3
+ thisline_decision.brdblank_seen = isbrdblank (bplcon0, value);
}
record_color_change (hpos, regno + 0x1000, value);
}
changed = 1;
}
+ /* if last frame's brdblank was different = mark line changed */
+ if (brdblank_prevframe[vpos] != thisline_decision.brdblank_seen) {
+ changed = 1;
+ brdblank_prevframe[vpos] = thisline_decision.brdblank_seen;
+ }
+
if (changed) {
thisline_changed = 1;
*dp = thisline_decision;
thisline_decision.plflinelen = -1;
thisline_decision.ham_seen = !! (bplcon0 & 0x800);
thisline_decision.ehb_seen = !! isehb (bplcon0, bplcon2);
+ thisline_decision.brdblank_seen = !! isbrdblank (bplcon0, bplcon3);
thisline_decision.ham_at_start = !! (bplcon0 & 0x800);
/* decided_res shouldn't be touched before it's initialized by decide_line(). */
if (currprefs.turbo_emulation)
vsynctimebase = vsynctimebase_orig = 1;
else
- vsynctimebase = vsynctimebase_orig = syncbase / fake_vblank_hz;
+ vsynctimebase = vsynctimebase_orig = (int)(syncbase / fake_vblank_hz);
#if 0
if (!picasso_on) {
updatedisplayarea ();
if (isvsync_chipset ()) {
if (cr->index == CHIPSET_REFRESH_PAL || cr->index == CHIPSET_REFRESH_NTSC) {
if ((fabs (vblank_hz - 50) < 1 || fabs (vblank_hz - 60) < 1 || fabs (vblank_hz - 100) < 1 || fabs (vblank_hz - 120) < 1) && currprefs.gfx_apmode[0].gfx_vsync == 2 && currprefs.gfx_apmode[0].gfx_fullscreen > 0) {
- vsync_switchmode (vblank_hz);
+ vsync_switchmode ((int)vblank_hz);
}
}
if (isvsync_chipset () < 0) {
if (!picasso_on)
return;
vpos_count = 0;
- p96refresh_active = maxvpos_stored * vblank_hz_stored / hz;
+ p96refresh_active = (int)(maxvpos_stored * vblank_hz_stored / hz);
if (!currprefs.cs_ciaatod)
changed_prefs.cs_ciaatod = currprefs.cs_ciaatod = currprefs.ntscmode ? 2 : 1;
if (p96refresh_active > 0) {
return;
if (vpos < 20)
return;
+ if (isbrdblank (bplcon0, bplcon3))
+ return;
// autoscale if copper changes COLOR00 on top or bottom of screen
if (vpos >= minfirstline) {
int vpos2 = autoscale_bordercolors ? minfirstline : vpos;
if (val > vsynctimebase * 2 / 3)
val = vsynctimebase * 2 / 3;
- max = (vsynctimebase - val) * (1000 + currprefs.m68k_speed_throttle) / 1000;
+ max = (int)((vsynctimebase - val) * (1000.0 + currprefs.m68k_speed_throttle) / 1000.0);
if (max < 1)
max = 1;
if ((int)curr_time - (int)vsyncwaittime > 0 && (int)curr_time - (int)vsyncwaittime < vstb / 2)
adjust += curr_time - vsyncwaittime;
adjust += clockadjust;
- max = vstb * (1000 + currprefs.m68k_speed_throttle) / 1000 - adjust;
+ max = (int)(vstb * (1000.0 + currprefs.m68k_speed_throttle) / 1000.0 - adjust);
vsyncwaittime = curr_time + vstb - adjust;
vsyncmintime = curr_time;
return 1;
}
+static void drive_write_data (drive * drv);
+
static bool convert_adf_to_ext2 (drive *drv)
{
TCHAR name[MAX_DPATH];
_tcscpy (name, currprefs.floppyslots[drv - floppy].df);
if (!name[0])
return false;
- _tcscat (name, _T(".extended.adf"));
- if (!disk_creatediskfile (name, 1, hd ? DRV_35_HD : DRV_35_DD, NULL, false, false, currprefs.floppyslots[drv - floppy].df))
+ TCHAR *p = _tcsrchr (name, '.');
+ if (!p)
+ p = name + _tcslen (name);
+ _tcscpy (p, _T(".extended.adf"));
+ if (!disk_creatediskfile (name, 1, hd ? DRV_35_HD : DRV_35_DD, NULL, false, false, drv->diskfile))
return false;
f = zfile_fopen (name, _T("rb"), 0);
if (!f)
return false;
+ _tcscpy (currprefs.floppyslots[drv - floppy].df, name);
+ _tcscpy (changed_prefs.floppyslots[drv - floppy].df, name);
zfile_fclose (drv->diskfile);
drv->diskfile = f;
- read_header_ext2 (drv->diskfile, drv->trackdata, &drv->num_tracks, &drv->ddhd);
drv->filetype = ADF_EXT2;
+ read_header_ext2 (drv->diskfile, drv->trackdata, &drv->num_tracks, &drv->ddhd);
+
+ drive_write_data (drv);
+#ifdef RETROPLATFORM
+ rp_disk_image_change (drv - &floppy[0], name, false);
+#endif
drive_fill_bigbuf (drv, 1);
return true;
case ADF_NORMAL:
if (drive_write_adf_amigados (drv)) {
if (currprefs.floppy_auto_ext2) {
- if (convert_adf_to_ext2 (drv)) {
- drive_write_data (drv);
- return;
- }
+ convert_adf_to_ext2 (drv);
} else {
static int warned;
if (!warned)
/* type: 0=regular, 1=ext2adf */
/* adftype: 0=DD,1=HD,2=DD PC,3=HD PC,4=525SD */
-bool disk_creatediskfile (const TCHAR *name, int type, drive_type adftype, const TCHAR *disk_name, bool ffs, bool bootable, const TCHAR *copyfrom)
+bool disk_creatediskfile (const TCHAR *name, int type, drive_type adftype, const TCHAR *disk_name, bool ffs, bool bootable, struct zfile *copyfrom)
{
int size = 32768;
- struct zfile *f, *sf;
+ struct zfile *f;
int i, l, file_size, tracks, track_len, sectors;
uae_u8 *chunk = NULL;
int ddhd = 1;
bool ok = false;
+ uae_u64 pos;
if (type == 1)
tracks = 2 * 83;
}
if (copyfrom) {
- sf = zfile_fopen (copyfrom, _T("rb"), 0);
- if (!sf)
- return false;
+ pos = zfile_ftell (copyfrom);
+ zfile_fseek (copyfrom, 0, SEEK_SET);
}
f = zfile_fopen (name, _T("wb"), 0);
for (i = 0; i < tracks; i++) {
uae_u8 tmp[3 * 4];
memcpy (tmp, rawtrack, sizeof rawtrack);
- if (dodos || sf)
+ if (dodos || copyfrom)
memcpy (tmp, dostrack, sizeof dostrack);
zfile_fwrite (tmp, sizeof tmp, 1, f);
}
for (i = 0; i < tracks; i++) {
memset (chunk, 0, size);
- if (sf) {
- zfile_fread (chunk, 11 * ddhd, 512, sf);
+ if (copyfrom) {
+ zfile_fread (chunk, 11 * ddhd, 512, copyfrom);
} else {
if (dodos) {
if (i == 0)
}
xfree (chunk);
zfile_fclose (f);
- zfile_fclose (sf);
+ if (copyfrom)
+ zfile_fseek (copyfrom, pos, SEEK_SET);
if (f)
DISK_history_add (name, -1, HISTORY_FLOPPY, TRUE);
return ok;
int interlace_seen = 0;
#define AUTO_LORES_FRAMES 10
static int can_use_lores = 0, frame_res, frame_res_lace, last_max_ypos;
-static uae_u16 bplcon0_store, bplcon3_store;
/* Lookup tables for dual playfields. The dblpf_*1 versions are for the case
that playfield 1 has the priority, dbplpf_*2 are used if playfield 2 has
static int plf1pri, plf2pri, bplxor;
static uae_u32 plf_sprite_mask;
static int sbasecol[2] = { 16, 16 };
-static bool brdsprt, brdblank, brdblank_changed;
+static bool brdsprt, brdblank;
static int hposblank;
bool picasso_requested_on;
return xcolors[0x00f];
else if (brdblank)
return xcolors[0x880];
+ //return colors_for_drawing.acolors[0];
return xcolors[0xf0f];
#endif
return (blank || brdblank || hposblank) ? 0 : colors_for_drawing.acolors[0];
flush_screen (vb, 0, 0); /* vsync mode */
}
+STATIC_INLINE void getbrdblank (void)
+{
+#ifdef ECS_DENISE
+ brdblank = dp_for_drawing->brdblank_seen;
+#else
+ brdblank = false;
+#endif
+}
+
/* We only save hardware registers during the hardware frame. Now, when
* drawing the frame, we expand the data into a slightly more useful
* form. */
issprites = dip_for_drawing->nr_sprites;
#ifdef ECS_DENISE
ecsshres = bplres == RES_SUPERHIRES && (currprefs.chipset_mask & CSMASK_ECS_DENISE) && !(currprefs.chipset_mask & CSMASK_AGA);
+ getbrdblank ();
#endif
plf1pri = dp_for_drawing->bplcon2 & 7;
return 0;
}
-static void isbrdblank (void)
-{
-#ifdef ECS_DENISE
- bool brdblank_2 = (currprefs.chipset_mask & CSMASK_ECS_DENISE) && (bplcon0_store & 1) && (bplcon3_store & 0x20);
- if (brdblank_2 != brdblank)
- brdblank_changed = true;
- brdblank = brdblank_2;
-#endif
-}
-
static void pfield_expand_dp_bplconx (int regno, int v)
{
if (regno == 0xffff) {
dp_for_drawing->bplres = GET_RES_DENISE (v);
dp_for_drawing->nr_planes = GET_PLANES (v);
dp_for_drawing->ham_seen = isham (v);
- bplcon0_store = v;
- isbrdblank ();
break;
case 0x104:
dp_for_drawing->bplcon2 = v;
#ifdef ECS_DENISE
case 0x106:
dp_for_drawing->bplcon3 = v;
- bplcon3_store = v;
- isbrdblank ();
break;
#endif
#ifdef AGA
if (xlinebuffer == 0)
xlinebuffer = row_map[gfx_ypos], dh = dh_buf;
xlinebuffer -= linetoscr_x_adjust_bytes;
+ getbrdblank ();
if (border == 0) {
if (!didflush)
do_flush_screen (vb, first_drawn_line, last_drawn_line);
-
-
-#ifdef ECS_DENISE
- if (brdblank_changed) {
- last_max_ypos = max_ypos_thisframe;
- for (i = 0; i < sizeof linestate / sizeof *linestate; i++)
- linestate[i] = LINE_UNDECIDED;
- notice_screen_contents_lost ();
- brdblank_changed = false;
- }
-#endif
}
void hardware_line_completed (int lineno)
flush_screen (gfxvidinfo.inbuffer, 0, 0); /* vsync mode */
}
- /* check borderblank here because bplcon0 or especially bplcon3 may only be written once outside of displayable area */
- bplcon0_store = bplcon0p;
- bplcon3_store = bplcon3p;
- isbrdblank ();
-
gui_flicker_led (-1, 0, 0);
#ifdef AVIOUTPUT
if (!picasso_on)
int ret, err = ERROR_NO_FREE_STORE;
int blocksize, nr;
uae_u32 dostype;
+ bool fs = false;
- blocksize = 1204;
+ blocksize = 512;
/* not FFS because it is not understood by WB1.x C:Info */
dostype = DISK_TYPE_DOS;
nr = unit->unit;
if (unit->volflags & MYVOLUMEINFO_ARCHIVE) {
ret = zfile_fs_usage_archive (unit->ui.rootdir, 0, &fsu);
+ fs = true;
} else if (unit->volflags & MYVOLUMEINFO_CDFS) {
struct isofs_info ii;
ret = isofs_mediainfo (unit->ui.cdfs_superblock, &ii) ? 0 : 1;
ret = get_fs_usage (unit->ui.rootdir, 0, &fsu);
if (ret)
err = dos_errno ();
+ fs = true;
}
if (ret != 0) {
PUT_PCK_RES1 (packet, DOS_FALSE);
put_long (info + 24, -1); /* ID_NO_DISK_PRESENT */
put_long (info + 28, 0);
} else {
- put_long (info + 12, fsu.fsu_blocks ); /* numblocks */
+ if (fs && currprefs.filesys_limit) {
+ if (fsu.fsu_blocks > (uae_u64)currprefs.filesys_limit * 1024 / blocksize) {
+ uae_u32 oldblocks = fsu.fsu_blocks;
+ fsu.fsu_blocks = (uae_u32)((uae_u64)currprefs.filesys_limit * 1024 / blocksize);
+ fsu.fsu_bavail = (uae_u32)((uae_u64)fsu.fsu_bavail * fsu.fsu_blocks / oldblocks);
+ }
+ }
+ put_long (info + 12, fsu.fsu_blocks); /* numblocks */
put_long (info + 16, fsu.fsu_blocks - fsu.fsu_bavail); /* inuse */
put_long (info + 24, dostype); /* disk type */
put_long (info + 28, unit->volume >> 2); /* volume node */
put_long (parmpacket + 80, DISK_TYPE_DOS); /* DOS\0 */
if (type == FILESYS_VIRTUAL) {
put_long (parmpacket + 4, fsdevname);
- put_long (parmpacket + 20, 1024 >> 2); /* longwords per block */
+ put_long (parmpacket + 20, 512 >> 2); /* longwords per block */
put_long (parmpacket + 28, 15); /* heads */
put_long (parmpacket + 32, 1); /* sectors per block */
put_long (parmpacket + 36, 127); /* sectors per track */
extern void DISK_reset (void);
extern int disk_getwriteprotect (struct uae_prefs *p, const TCHAR *name);
extern int disk_setwriteprotect (struct uae_prefs *p, int num, const TCHAR *name, bool writeprotected);
-extern bool disk_creatediskfile (const TCHAR *name, int type, drive_type adftype, const TCHAR *disk_name, bool ffs, bool bootable, const TCHAR *copyfrom);
+extern bool disk_creatediskfile (const TCHAR *name, int type, drive_type adftype, const TCHAR *disk_name, bool ffs, bool bootable, struct zfile *copyfrom);
extern void dumpdisk (void);
extern int DISK_history_add (const TCHAR *name, int idx, int type, int donotcheck);
extern TCHAR *DISK_history_get (int idx, int type);
uae_u8 nr_planes;
uae_u8 bplres;
bool ehb_seen;
+ bool brdblank_seen;
bool ham_seen;
bool ham_at_start;
};
bool sound_stereo_swap_ahi;
bool sound_auto;
+ int sampler_freq;
+ int sampler_buffer;
+ bool sampler_stereo;
+
int comptrustbyte;
int comptrustword;
int comptrustlong;
uae_u32 maprom;
int turbo_emulation;
bool headless;
+ int filesys_limit;
int cs_compatible;
int cs_ciaatod;
struct multipath path_cd;
int m68k_speed;
- int m68k_speed_throttle;
+ double m68k_speed_throttle;
int cpu_model;
int mmu_model;
int cpu060_revision;
uae_u32 mbresmem_high_size;
uae_u32 rtgmem_size;
bool rtg_hardwareinterrupt;
+ bool rtg_hardwaresprite;
int rtgmem_type;
uae_u32 custom_memory_addrs[MAX_CUSTOM_MEMORY_ADDRS];
uae_u32 custom_memory_sizes[MAX_CUSTOM_MEMORY_ADDRS];
bool win32_powersavedisabled;
bool win32_minimize_inactive;
int win32_statusbar;
+ bool win32_start_minimized;
+ bool win32_start_uncaptured;
int win32_active_capture_priority;
bool win32_active_nocapture_pause;
cycles_mult = 0;
if (currprefs.m68k_speed >= 0 && !currprefs.cpu_cycle_exact) {
if (currprefs.m68k_speed_throttle < 0) {
- cycles_mult = CYCLES_DIV * 1000 / (1000 + currprefs.m68k_speed_throttle);
+ cycles_mult = (unsigned long)(CYCLES_DIV * 1000 / (1000 + currprefs.m68k_speed_throttle));
} else if (currprefs.m68k_speed_throttle > 0) {
- cycles_mult = CYCLES_DIV * 1000 / (1000 + currprefs.m68k_speed_throttle);
+ cycles_mult = (unsigned long)(CYCLES_DIV * 1000 / (1000 + currprefs.m68k_speed_throttle));
}
}
if (currprefs.m68k_speed == 0 && currprefs.cpu_model >= 68020) {
sleep_millis (1);
continue;
} else if (hr == S_PRESENT_OCCLUDED) {
- ;
+ ; //write_log (_T("S_PRESENT_OCCLUDED\n"));
} else if (hr == S_PRESENT_MODE_CHANGED) {
// In most cases mode actually didn't change but
// D3D is just being stupid and not accepting
// all modes that DirectDraw does accept,
// for example interlaced or EDS_RAWMODE modes!
//devicelost = 1;
- ;
+ ; //write_log (_T("S_PRESENT_MODE_CHANGED\n"));
} else if (FAILED (hr)) {
write_log (_T("%s: Present() %s\n"), D3DHEAD, D3D_ErrorString (hr));
if (hr == D3DERR_DEVICELOST || hr == S_PRESENT_MODE_CHANGED) {
write_log (_T("P96: Blitter disabled in devs:monitors/uaegfx!\n"));
flags |= BIF_BLITTER | BIF_NOMEMORYMODEMIX;
flags &= ~BIF_HARDWARESPRITE;
- if (currprefs.gfx_api && D3D_goodenough () > 0 && USE_HARDWARESPRITE) {
+ if (currprefs.gfx_api && D3D_goodenough () > 0 && USE_HARDWARESPRITE && currprefs.rtg_hardwaresprite) {
hwsprite = 1;
flags |= BIF_HARDWARESPRITE;
write_log (_T("P96: Hardware sprite support enabled\n"));
#define IDC_CONTRIBUTORS 1124
#define IDC_BLACKER_THAN_BLACK 1170
#define IDC_BLITIMM 1174
-#define IDC_BLITIMM2 1175
#define IDC_BLITWAIT 1175
#define IDC_LORES 1176
#define IDC_RATE2BOX 1177
#define IDC_WIDTHTEXT 1512
#define IDC_WINDOWEDTEXT 1512
#define IDC_PORT2_TEST 1512
+#define IDC_MAPDRIVES_LIMIT 1512
#define IDC_HEIGHTTEXT 1513
#define IDC_PORT3_TEST 1513
#define IDC_SETTINGSTEXT 1514
#define IDC_RTG_BUFFERCNT 1795
#define IDC_RTG_VBINTERRUPT 1796
#define IDC_INPUTMAPLIST 1797
+#define IDC_RTG_HWSPRITE 1797
#define IDC_PORT1_REMAP 1798
#define IDC_PORT0_REMAP 1799
#define IDC_PORT2_REMAP 1800
#define IDC_RTG_DISPLAYSELECT 1809
#define IDC_MISCLIST 1810
#define IDC_STATENAME 1811
+#define IDC_SAMPLER_STEREO 1812
#define ID__FLOPPYDRIVES 40004
#define ID_FLOPPYDRIVES_DF0 40005
#define ID_ST_CONFIGURATION 40010
EXSTYLE WS_EX_CONTEXTHELP\r
FONT 8, "MS Sans Serif", 0, 0, 0x1\r
BEGIN\r
- CONTROL "List1",IDC_VOLUMELIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,5,0,290,130\r
- PUSHBUTTON "Add &Directory or Archive...",IDC_NEW_FS,10,135,103,15\r
- PUSHBUTTON "Add &Hardfile...",IDC_NEW_HF,130,135,74,15\r
- PUSHBUTTON "Add Ha&rd Drive...",IDC_NEW_HD,220,135,75,15\r
- PUSHBUTTON "Remove",IDC_REMOVE,235,155,60,15\r
- PUSHBUTTON "&Properties",IDC_EDIT,235,172,60,15\r
- CONTROL "Add PC drives at startup",IDC_MAPDRIVES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,154,100,10\r
- CONTROL "Disable UAEFSDB-support",IDC_NOUAEFSDB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,110,154,119,10\r
- CONTROL "Don't use Windows Recycle Bin",IDC_NORECYCLEBIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,110,166,121,10\r
- CONTROL "Include network drives..",IDC_MAPDRIVES_NET,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,178,101,10\r
- CONTROL "CDFS automount CD/DVD drives",IDC_MAPDRIVES_CD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,190,160,10\r
- CONTROL "Automount removable drives",IDC_MAPDRIVES_AUTO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,110,178,115,10\r
+ CONTROL "List1",IDC_VOLUMELIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,5,0,290,116\r
+ PUSHBUTTON "Add &Directory or Archive...",IDC_NEW_FS,10,121,103,15\r
+ PUSHBUTTON "Add &Hardfile...",IDC_NEW_HF,130,121,74,15\r
+ PUSHBUTTON "Add Ha&rd Drive...",IDC_NEW_HD,220,121,75,15\r
+ PUSHBUTTON "Remove",IDC_REMOVE,235,141,60,15\r
+ PUSHBUTTON "&Properties",IDC_EDIT,235,158,60,15\r
+ CONTROL "Add PC drives at startup",IDC_MAPDRIVES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,140,100,10\r
+ CONTROL "Disable UAEFSDB-support",IDC_NOUAEFSDB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,110,140,119,10\r
+ CONTROL "Don't use Windows Recycle Bin",IDC_NORECYCLEBIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,110,152,121,10\r
+ CONTROL "Include network drives..",IDC_MAPDRIVES_NET,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,164,101,10\r
+ CONTROL "CDFS automount CD/DVD drives",IDC_MAPDRIVES_CD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,176,136,10\r
+ CONTROL "Automount removable drives [] Windows side insert or removal will immediately mount/remove it on Amiga side.",IDC_MAPDRIVES_AUTO,\r
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,110,164,115,10\r
CONTROL "Include removable drives..",IDC_MAPDRIVES_REMOVABLE,\r
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,166,100,10\r
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,152,100,10\r
COMBOBOX IDC_CD_TEXT,5,224,289,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP\r
PUSHBUTTON "Eject",IDC_CD_EJECT,265,204,30,15\r
PUSHBUTTON "Select image file",IDC_CD_SELECT,90,204,98,15\r
COMBOBOX IDC_CD_TYPE,194,205,63,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
LTEXT "CD drive/image",IDC_STATIC,5,206,70,10,SS_CENTERIMAGE\r
+ CONTROL "Limit size of directory drives to 1G [] Workaround for example old installers that calculate free space incorrectly if drive is large.",IDC_MAPDRIVES_LIMIT,\r
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,188,136,10\r
END\r
\r
IDD_SOUND DIALOGEX 0, 0, 300, 237\r
PUSHBUTTON "Save As...",IDC_SAVE,175,225,44,15\r
END\r
\r
-IDD_IOPORTS DIALOGEX 0, 0, 300, 228\r
+IDD_IOPORTS DIALOGEX 0, 0, 305, 245\r
STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD\r
FONT 8, "MS Sans Serif", 0, 0, 0x1\r
BEGIN\r
- GROUPBOX "Parallel Port",IDC_STATIC,5,2,291,105\r
+ GROUPBOX "Parallel Port",IDC_STATIC,5,2,291,120\r
RTEXT "Printer:",IDC_STATIC,12,15,25,15,SS_CENTERIMAGE\r
COMBOBOX IDC_PRINTERLIST,49,15,232,134,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
PUSHBUTTON "Flush print job",IDC_FLUSHPRINTER,114,51,58,12\r
EDITTEXT IDC_PRINTERAUTOFLUSH,255,50,25,12,ES_NUMBER\r
RTEXT "Type:",IDC_STATIC,15,33,21,15,SS_CENTERIMAGE\r
EDITTEXT IDC_PS_PARAMS,114,67,167,12,ES_AUTOHSCROLL\r
- GROUPBOX "Serial Port",IDC_STATIC,4,110,292,48\r
- COMBOBOX IDC_SERIAL,49,122,232,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
- CONTROL "Shared",IDC_SER_SHARED,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,15,141,48,12\r
- CONTROL "RTS/CTS",IDC_SER_CTSRTS,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,75,141,55,12\r
- RTEXT "Out:",IDC_MIDI,10,172,19,15,SS_CENTERIMAGE\r
- COMBOBOX IDC_MIDIOUTLIST,36,173,108,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
- RTEXT "In:",IDC_MIDI2,150,171,22,15,SS_CENTERIMAGE\r
- COMBOBOX IDC_MIDIINLIST,181,173,108,134,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
+ GROUPBOX "Serial Port",IDC_STATIC,4,124,292,48\r
+ COMBOBOX IDC_SERIAL,49,136,232,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
+ CONTROL "Shared",IDC_SER_SHARED,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,15,155,48,12\r
+ CONTROL "RTS/CTS",IDC_SER_CTSRTS,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,75,155,55,12\r
+ RTEXT "Out:",IDC_MIDI,10,186,19,15,SS_CENTERIMAGE\r
+ COMBOBOX IDC_MIDIOUTLIST,36,187,108,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
+ RTEXT "In:",IDC_MIDI2,150,185,22,15,SS_CENTERIMAGE\r
+ COMBOBOX IDC_MIDIINLIST,181,187,108,134,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
CONTROL "Direct []Use when emulating serial-link games on two PCs running WinUAE",IDC_SER_DIRECT,\r
- "Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,135,141,65,12\r
- CONTROL "uaeserial.device",IDC_UAESERIAL,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,200,141,78,12\r
+ "Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,135,155,65,12\r
+ CONTROL "uaeserial.device",IDC_UAESERIAL,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,200,155,78,12\r
COMBOBOX IDC_PRINTERTYPELIST,49,33,232,134,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
RTEXT "Ghostscript extra parameters:",IDC_STATIC,10,66,102,15,SS_CENTERIMAGE\r
- GROUPBOX "MIDI",IDC_STATIC,5,161,291,34,BS_LEFT\r
- GROUPBOX "Protection Dongle",IDC_STATIC,5,197,292,30,BS_LEFT\r
- COMBOBOX IDC_DONGLELIST,50,208,232,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
- RTEXT "Sampler:",IDC_STATIC,12,84,31,15,SS_CENTERIMAGE\r
- COMBOBOX IDC_SAMPLERLIST,49,85,232,134,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
+ GROUPBOX "MIDI",IDC_STATIC,5,175,291,34,BS_LEFT\r
+ GROUPBOX "Protection Dongle",IDC_STATIC,5,212,292,31,BS_LEFT\r
+ COMBOBOX IDC_DONGLELIST,50,223,232,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
+ RTEXT "Sampler:",IDC_STATIC,12,85,31,15,SS_CENTERIMAGE\r
+ COMBOBOX IDC_SAMPLERLIST,49,86,232,134,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
+ CONTROL "Stereo sampler",IDC_SAMPLER_STEREO,"Button",BS_AUTOCHECKBOX | BS_VCENTER | WS_TABSTOP,205,104,75,12\r
END\r
\r
IDD_GAMEPORTS DIALOGEX 0, 0, 300, 246\r
GROUPBOX "Options",IDC_STATIC,168,11,114,111\r
CONTROL "Immediate Blitter [] Faster but less compatible blitter emulation.",IDC_BLITIMM,\r
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,179,27,96,10\r
- CONTROL "Cycle-exact [] The most compatible A500 emulation mode. Very fast PC recommended.",IDC_CYCLEEXACT,\r
- "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,179,53,100,10\r
GROUPBOX "Collision Level",IDC_STATIC,14,128,267,48\r
CONTROL "None [] Collision hardware emulation disabled.",IDC_COLLISION0,\r
"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,37,144,59,10\r
CONTROL "Sprites only [] Emulate only sprite vs. sprite collisions.",IDC_COLLISION1,\r
- "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,37,160,62,10\r
+ "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,37,159,62,10\r
CONTROL "Sprites and Sprites vs. Playfield [] Recommended collision emulation level.",IDC_COLLISION2,\r
"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,100,144,161,10\r
CONTROL "Full [] 100% collision hardware emulation. Only very few games need this option. Slowest.",IDC_COLLISION3,\r
- "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,100,160,119,10\r
+ "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,100,159,119,10\r
CONTROL "Genlock connected [] Allow boot sequence to detect genlock. Genlock is not emulated.",IDC_GENLOCK,\r
- "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,179,66,100,10\r
- COMBOBOX IDC_CS_EXT,100,80,49,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
- RTEXT "Chipset Extra",IDC_STATIC,25,79,52,15,SS_CENTERIMAGE\r
- COMBOBOX IDC_MONITOREMU,178,102,98,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
- RTEXT "External display hardware:",IDC_STATIC,174,82,100,15,SS_CENTERIMAGE\r
- CONTROL "Wait for Blitter [] Pauses the CPU if blitter is active and CPU attempted to modify blitter registers.",IDC_BLITWAIT,\r
+ "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,179,53,100,10\r
+ COMBOBOX IDC_CS_EXT,100,101,49,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
+ RTEXT "Chipset Extra",IDC_STATIC,25,100,52,15,SS_CENTERIMAGE\r
+ COMBOBOX IDC_MONITOREMU,178,87,98,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
+ RTEXT "External display hardware:",IDC_STATIC,174,67,100,15,SS_CENTERIMAGE\r
+ CONTROL "Wait for Blitter [] Compatibility hack for programs that don't wait for the blitter correctly, causing graphics corruption if CPU is too fast.",IDC_BLITWAIT,\r
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,179,40,96,10\r
+ CONTROL "Cycle-exact [] The most compatible A500/A1200 emulation mode. Very fast PC recommended.",IDC_CYCLEEXACT,\r
+ "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,35,80,100,10\r
END\r
\r
IDD_CHIPSET2 DIALOGEX 0, 65490, 300, 247\r
CTEXT "Color modes:",IDC_STATIC,215,9,62,10,SS_CENTERIMAGE\r
COMBOBOX IDC_RTG_DISPLAYSELECT,11,106,279,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
CONTROL "Hardware vertical blank interrupt",IDC_RTG_VBINTERRUPT,\r
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,89,162,10\r
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,89,142,10\r
+ CONTROL "Hardware sprite emulation",IDC_RTG_HWSPRITE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,185,89,102,10\r
END\r
\r
IDD_INPUTMAP DIALOGEX 0, 0, 300, 240\r
\r
IDD_IOPORTS, DIALOG\r
BEGIN\r
+ RIGHTMARGIN, 300\r
+ BOTTOMMARGIN, 240\r
END\r
\r
IDD_GAMEPORTS, DIALOG\r
\r
IDD_CHIPSET, DIALOG\r
BEGIN\r
- BOTTOMMARGIN, 165\r
END\r
\r
IDD_CHIPSET2, DIALOG\r
have_sound = 0;
}
-int init_sound (void)
-{
- gui_data.sndbuf_status = 3;
- gui_data.sndbuf = 0;
- if (!sound_available)
- return 0;
- if (currprefs.produce_sound <= 1)
- return 0;
- if (have_sound)
- return 1;
- if (!open_sound ())
- return 0;
- sdp->paused = 1;
- driveclick_reset ();
- reset_sound ();
- resume_sound ();
- return 1;
-}
-
void pause_sound (void)
{
if (sdp->paused)
clearbuffer (sdp);
}
+int init_sound (void)
+{
+ bool started = false;
+ gui_data.sndbuf_status = 3;
+ gui_data.sndbuf = 0;
+ if (!sound_available)
+ return 0;
+ if (currprefs.produce_sound <= 1)
+ return 0;
+ if (have_sound)
+ return 1;
+ if (!open_sound ())
+ return 0;
+ sdp->paused = 1;
+ driveclick_reset ();
+ reset_sound ();
+ resume_sound ();
+ if (!started &&
+ (currprefs.win32_start_minimized && currprefs.win32_iconified_nosound ||
+ currprefs.win32_start_uncaptured && currprefs.win32_inactive_nosound))
+ pause_sound ();
+ started = true;
+ return 1;
+}
+
static void disable_sound (void)
{
close_sound ();
static int recapture;
static int focus;
int mouseactive;
+int minimized;
static int mm_timerres;
static int timermode, timeon;
#endif
}
+void setminimized (void)
+{
+ minimized = 1;
+ set_inhibit_frame (IHF_WINDOWHIDDEN);
+}
+void unsetminimized (void)
+{
+ minimized = 0;
+ clear_inhibit_frame (IHF_WINDOWHIDDEN);
+}
+
static int showcursor;
extern TCHAR config_filename[256];
pri = &priorities[currprefs.win32_active_capture_priority];
setpriority (pri);
- if (!avioutput_video) {
- clear_inhibit_frame (IHF_WINDOWHIDDEN);
- }
if (sound_closed) {
if (sound_closed < 0) {
resumesoundpaused ();
setsoundpaused ();
sound_closed = -1;
}
- if (!avioutput_video) {
- set_inhibit_frame (IHF_WINDOWHIDDEN);
- }
} else if (mouseactive) {
if (currprefs.win32_active_nocapture_pause) {
setpaused (2);
HDC hDC;
int mx, my;
int istablet = (GetMessageExtraInfo () & 0xFFFFFF00) == 0xFF515700;
- static int mm, minimized, recursive, ignoremousemove;
+ static int mm, recursive, ignoremousemove;
static bool ignorelbutton;
#if MSGDEBUG > 1
case WM_SETFOCUS:
winuae_active (hWnd, minimized);
- minimized = 0;
+ unsetminimized ();
dx_check ();
break;
case WM_ACTIVATE:
//write_log (_T("active %d\n"), LOWORD(wParam));
if (LOWORD (wParam) == WA_INACTIVE) {
- minimized = HIWORD (wParam) ? 1 : 0;
+ if (HIWORD (wParam))
+ setminimized ();
+ else
+ unsetminimized ();
winuae_inactive (hWnd, minimized);
}
dx_check ();
if (depth) {
p->color_mode = p->color_mode == 5 ? 2 : 5;
}
+ if (p->rtg_hardwaresprite && !p->gfx_api)
+ p->rtg_hardwaresprite = false;
}
void target_default_options (struct uae_prefs *p, int type)
p->win32_soundcard = 0;
p->win32_samplersoundcard = -1;
p->win32_minimize_inactive = 0;
+ p->win32_start_minimized = false;
+ p->win32_start_uncaptured = false;
p->win32_active_capture_priority = 1;
//p->win32_active_nocapture_priority = 1;
p->win32_inactive_priority = 2;
p->win32_rtgallowscaling = 0;
p->win32_rtgscaleaspectratio = -1;
p->win32_rtgvblankrate = 0;
+ p->rtg_hardwaresprite = true;
p->win32_commandpathstart[0] = 0;
p->win32_commandpathend[0] = 0;
p->win32_statusbar = 1;
cfgfile_target_dwrite_bool (f, _T("iconified_nosound"), p->win32_iconified_nosound);
cfgfile_target_dwrite_bool (f, _T("iconified_pause"), p->win32_iconified_pause);
cfgfile_target_dwrite_bool (f, _T("inactive_iconify"), p->win32_minimize_inactive);
+ cfgfile_target_dwrite_bool (f, _T("start_iconified"), p->win32_start_minimized);
+ cfgfile_target_dwrite_bool (f, _T("start_not_captured"), p->win32_start_uncaptured);
cfgfile_target_dwrite_bool (f, _T("ctrl_f11_is_quit"), p->win32_ctrl_F11_is_quit);
if (cfgfile_yesno (option, value, _T("inactive_iconify"), &p->win32_minimize_inactive))
return 1;
+ if (cfgfile_yesno (option, value, _T("start_iconified"), &p->win32_start_minimized))
+ return 1;
+
+ if (cfgfile_yesno (option, value, _T("start_not_captured"), &p->win32_start_uncaptured))
+ return 1;
+
if (cfgfile_string (option, value, _T("serial_port"), &p->sername[0], 256)) {
sernametodev (p->sername);
if (p->sername[0])
#define LANG_DLL 1
//#define WINUAEBETA _T("")
-#define WINUAEBETA _T("11")
-#define WINUAEDATE MAKEBD(2012, 8, 10)
+#define WINUAEBETA _T("12")
+#define WINUAEDATE MAKEBD(2012, 8, 14)
#define WINUAEEXTRA _T("")
//#define WINUAEEXTRA _T("AmiKit Preview")
#define WINUAEREV _T("")
extern int manual_painting_needed;
extern int manual_palette_refresh_needed;
extern int mouseactive;
+extern int minimized;
extern int ignore_messages_all;
extern void *globalipc, *serialipc;
extern void resumepaused (int priority);
extern void setpaused (int priority);
+extern void unsetminimized (void);
+extern void setminimized (void);
void finishjob (void);
void init_colors (void);
bool v = false;
render_ok = false;
- if (picasso_on || dx_islost ())
+ if (minimized || picasso_on || dx_islost ())
return render_ok;
flushymin = 0;
flushymax = currentmode->amiga_height;
static int open_windows (int full)
{
+ static bool started = false;
int ret, i;
changevblankthreadmode (VBLANKTH_IDLE);
return ret;
}
- setpriority (&priorities[currprefs.win32_active_capture_priority]);
- if (!rp_isactive () && full)
+ bool startactive = started || (!started && !currprefs.win32_start_uncaptured && !currprefs.win32_start_minimized);
+ bool startpaused = !started && ((currprefs.win32_start_minimized && currprefs.win32_iconified_pause) || (currprefs.win32_start_uncaptured && currprefs.win32_inactive_pause));
+ bool startminimized = !started && currprefs.win32_start_minimized;
+
+ if (!rp_isactive () && full && startactive)
setmouseactive (-1);
- for (i = 0; i < NUM_LEDS; i++)
- gui_led (i, 0);
- gui_fps (0, 0, 0);
- inputdevice_acquire (TRUE);
+ if (startactive) {
+ setpriority (&priorities[currprefs.win32_active_capture_priority]);
+ for (i = 0; i < NUM_LEDS; i++)
+ gui_led (i, 0);
+ gui_fps (0, 0, 0);
+ inputdevice_acquire (TRUE);
+ } else if (startminimized) {
+ setpriority (&priorities[currprefs.win32_iconified_priority]);
+ setminimized ();
+ } else {
+ setpriority (&priorities[currprefs.win32_inactive_priority]);
+ }
+ if (startpaused)
+ setpaused (1);
+
+ started = true;
return ret;
}
return 1;
}
- if (currprefs.win32_norecyclebin != changed_prefs.win32_norecyclebin) {
- currprefs.win32_norecyclebin = changed_prefs.win32_norecyclebin;
- }
+ currprefs.win32_norecyclebin = changed_prefs.win32_norecyclebin;
+ currprefs.filesys_limit = changed_prefs.filesys_limit;
if (currprefs.win32_logfile != changed_prefs.win32_logfile) {
currprefs.win32_logfile = changed_prefs.win32_logfile;
return 1;
}
- if (currprefs.win32_samplersoundcard != changed_prefs.win32_samplersoundcard) {
+ if (currprefs.win32_samplersoundcard != changed_prefs.win32_samplersoundcard ||
+ currprefs.sampler_stereo != changed_prefs.sampler_stereo) {
currprefs.win32_samplersoundcard = changed_prefs.win32_samplersoundcard;
+ currprefs.sampler_stereo = changed_prefs.sampler_stereo;
sampler_free ();
}
static int create_windows_2 (void)
{
- static int firstwindow = 1;
+ static bool firstwindow = true;
int dxfs = currentmode->flags & (DM_DX_FULLSCREEN);
int d3dfs = currentmode->flags & (DM_D3D_FULLSCREEN);
int fsw = currentmode->flags & (DM_W_FULLSCREEN);
createblankwindows ();
if (hMainWnd != hAmigaWnd) {
if (!currprefs.headless && !rp_isactive ())
- ShowWindow (hMainWnd, firstwindow ? SW_SHOWDEFAULT : SW_SHOWNORMAL);
+ ShowWindow (hMainWnd, firstwindow ? (currprefs.win32_start_minimized ? SW_SHOWMINIMIZED : SW_SHOWDEFAULT) : SW_SHOWNORMAL);
UpdateWindow (hMainWnd);
}
if (!currprefs.headless && !rp_isactive ())
- ShowWindow (hAmigaWnd, firstwindow ? SW_SHOWDEFAULT : SW_SHOWNORMAL);
+ ShowWindow (hAmigaWnd, SW_SHOWNORMAL);
UpdateWindow (hAmigaWnd);
- firstwindow = 0;
+ firstwindow = false;
return 1;
}
static struct miscentry misclist[] = {
{ 0, 1, _T("Untrap = middle button"), &workprefs.win32_middle_mouse },
- { 0, 1, _T("Minimize when focus is lost"), &workprefs.win32_minimize_inactive },
{ 0, 0, _T("Show GUI on startup"), &workprefs.start_gui },
{ 0, 1, _T("Use CTRL-F11 to quit"), &workprefs.win32_ctrl_F11_is_quit },
{ 0, 1, _T("Don't show taskbar button"), &workprefs.win32_notaskbarbutton },
{ 0, 0, _T("Create winuaelog.txt log"), &workprefs.win32_logfile },
{ 0, 0, _T("Log illegal memory accesses"), &workprefs.illegal_mem },
{ 0, 0, _T("Blank unused displays"), &workprefs.win32_blankmonitors },
+ { 0, 0, _T("Start mouse uncaptured"), &workprefs.win32_start_uncaptured },
+ { 0, 0, _T("Start minimized"), &workprefs.win32_start_minimized },
+ { 0, 1, _T("Minimize when focus is lost"), &workprefs.win32_minimize_inactive },
+
{ 0, NULL }
};
ew (hDlg, IDC_RTG_VBLANKRATE, rtg2);
ew (hDlg, IDC_RTG_BUFFERCNT, rtg2);
ew (hDlg, IDC_RTG_DISPLAYSELECT, rtg2);
+ ew (hDlg, IDC_RTG_VBINTERRUPT, rtg2);
+ if (!workprefs.gfx_api) {
+ workprefs.rtg_hardwaresprite = false;
+ CheckDlgButton (hDlg, IDC_RTG_HWSPRITE, FALSE);
+ }
+ ew (hDlg, IDC_RTG_HWSPRITE, rtg2 && workprefs.gfx_api);
}
extern uae_u32 natmem_size;
static void setmax32bitram (HWND hDlg)
{
TCHAR tmp[100];
- uae_u32 size;
+ uae_u32 size, rtgz3size;
+ rtgz3size = workprefs.rtgmem_type ? workprefs.rtgmem_size : 0;
size = workprefs.z3fastmem_size + workprefs.z3fastmem2_size +
- workprefs.z3chipmem_size + workprefs.rtgmem_size;
+ workprefs.z3chipmem_size + rtgz3size;
if (workprefs.z3chipmem_size && workprefs.z3fastmem_size)
size += 16 * 1024 * 1024;
- if ((workprefs.z3fastmem_size || workprefs.z3chipmem_size) && workprefs.rtgmem_size)
+ if ((workprefs.z3fastmem_size || workprefs.z3chipmem_size) && rtgz3size)
size += 16 * 1024 * 1024;
_stprintf (tmp, L"Total configured 32-bit RAM: %dM, reserved: %dM",
CheckDlgButton (hDlg, IDC_RTG_SCALE_ALLOW, workprefs.win32_rtgallowscaling);
CheckDlgButton (hDlg, IDC_RTG_MATCH_DEPTH, workprefs.win32_rtgmatchdepth);
CheckDlgButton (hDlg, IDC_RTG_VBINTERRUPT, workprefs.rtg_hardwareinterrupt);
+ CheckDlgButton (hDlg, IDC_RTG_HWSPRITE, workprefs.rtg_hardwaresprite);
SendDlgItemMessage (hDlg, IDC_RTG_SCALE_ASPECTRATIO, CB_SETCURSEL,
(workprefs.win32_rtgscaleaspectratio == 0) ? 0 :
case IDC_RTG_VBINTERRUPT:
workprefs.rtg_hardwareinterrupt = ischecked (hDlg, IDC_RTG_VBINTERRUPT);
break;
+ case IDC_RTG_HWSPRITE:
+ workprefs.rtg_hardwaresprite = ischecked (hDlg, IDC_RTG_HWSPRITE);
+ break;
case IDC_SOCKETS:
workprefs.socket_emu = ischecked (hDlg, IDC_SOCKETS);
break;
TCHAR buffer[8] = _T("");
int cpu;
- SendDlgItemMessage (hDlg, IDC_SPEED, TBM_SETPOS, TRUE, workprefs.m68k_speed_throttle / 100);
- _stprintf (buffer, _T("%+d%%"), workprefs.m68k_speed_throttle / 10);
+ SendDlgItemMessage (hDlg, IDC_SPEED, TBM_SETPOS, TRUE, (int)(workprefs.m68k_speed_throttle / 100));
+ _stprintf (buffer, _T("%+d%%"), (int)(workprefs.m68k_speed_throttle / 10));
SetDlgItemText (hDlg, IDC_CPUTEXT, buffer);
CheckDlgButton (hDlg, IDC_COMPATIBLE, workprefs.cpu_compatible);
CheckDlgButton (hDlg, IDC_COMPATIBLE24, workprefs.address_space_24);
workprefs.win32_automount_cddrives = ischecked (hDlg, IDC_MAPDRIVES_CD);
break;
+ case IDC_MAPDRIVES_LIMIT:
+ workprefs.filesys_limit = ischecked (hDlg, IDC_MAPDRIVES_LIMIT) ? 950 * 1024 : 0;
+ break;
+
case IDC_MAPDRIVES_NET:
workprefs.win32_automount_netdrives = ischecked (hDlg, IDC_MAPDRIVES_NET);
break;
CheckDlgButton (hDlg, IDC_MAPDRIVES_REMOVABLE, workprefs.win32_automount_removabledrives);
CheckDlgButton (hDlg, IDC_NOUAEFSDB, workprefs.filesys_no_uaefsdb);
CheckDlgButton (hDlg, IDC_NORECYCLEBIN, workprefs.win32_norecyclebin);
+ CheckDlgButton (hDlg, IDC_MAPDRIVES_LIMIT, workprefs.filesys_limit != 0);
addfloppyhistory_2 (hDlg, 0, IDC_CD_TEXT, HISTORY_CD);
addcdtype (hDlg, IDC_CD_TYPE);
InitializeListView (hDlg);
}
ew (hDlg, IDC_PRINTERLIST, isprinter);
ew (hDlg, IDC_SAMPLERLIST, issampler);
+ ew (hDlg, IDC_SAMPLER_STEREO, issampler && workprefs.win32_samplersoundcard >= 0);
ew (hDlg, IDC_PRINTERAUTOFLUSH, isprinter);
ew (hDlg, IDC_PRINTERTYPELIST, isprinter);
ew (hDlg, IDC_FLUSHPRINTER, isprinteropen () && isprinter ? TRUE : FALSE);
if (item > 0)
workprefs.prtname[0] = 0;
}
+ workprefs.sampler_stereo = false;
+ if (ischecked (hDlg, IDC_SAMPLER_STEREO))
+ workprefs.sampler_stereo = true;
item = SendDlgItemMessage (hDlg, IDC_PRINTERLIST, CB_GETCURSEL, 0, 0L);
if(item != CB_ERR) {
int idx;
SendDlgItemMessage (hDlg, IDC_SAMPLERLIST, CB_SETCURSEL, workprefs.win32_samplersoundcard + 1, 0);
+ CheckDlgButton (hDlg, IDC_SAMPLER_STEREO, workprefs.sampler_stereo);
result = 0;
if(workprefs.prtname[0]) {
if (isprinter ()) {
closeprinter ();
}
- } else if (wParam == IDC_UAESERIAL || wParam == IDC_SER_SHARED || wParam == IDC_SER_DIRECT || wParam == IDC_SER_CTSRTS || wParam == IDC_PRINTERAUTOFLUSH) {
+ } else if (wParam == IDC_UAESERIAL || wParam == IDC_SER_SHARED || wParam == IDC_SER_DIRECT || wParam == IDC_SER_CTSRTS || wParam == IDC_PRINTERAUTOFLUSH || wParam == IDC_SAMPLER_STEREO) {
values_from_portsdlg (hDlg);
} else {
if (HIWORD (wParam) == CBN_SELCHANGE) {
static struct filterxtra filter_3d_extra[] =
{
_T("Point/Bilinear"), &workprefs.gfx_filter_bilinear, &currprefs.gfx_filter_bilinear, 0, 1, 1,
- _T("Scanline transparency"), &workprefs.gfx_filter_scanlines, &currprefs.gfx_filter_scanlines, 0, 100, 10,
+ _T("Scanline opacity"), &workprefs.gfx_filter_scanlines, &currprefs.gfx_filter_scanlines, 0, 100, 10,
_T("Scanline level"), &workprefs.gfx_filter_scanlinelevel, &currprefs.gfx_filter_scanlinelevel, 0, 100, 10,
NULL
};
- restore only single input target to default.
+- Moved cycle-exact option to Chipset group in GUI. Other options are minor options/hacks, CE is not.
+- Do not enable wait for blit if immediate blitter is enabled in quickstart mode.
+- Added RTG hardware sprite (mouse cursor) enable/disable option. Enabled by default if D3D mode. Was always enabled
+ previously if D3D mode.
+- GUI Memory panel 32-bit RAM size information text incorrectly included Z2 mode RTG memory.
+- Added directory harddrive limit option to Harddrives panel. When enabled, all directory harddrives size is faked
+ to ~950M with free space relative to original size (for example 500G HD with 100G free = 950M HD with 950*100/500=190M free)
+ This hack is workaround for installers that think drive is full or have negative free space if drive is larger than 2G (32-bit overflow).
+ Can be changed on the fly. Edit configuration file manually if you want custom limit size. Also virtual fake block size changed
+ from 1024 to 512. More compatible with KS1.x dos commands that seem to use hardcoded 512 block sizes when calculating disk size.
+- cpu_throttle configuration entry also accepts decimal values.
+- Added Start minimized and Start mouse uncaptured Misc panel options.
+- In minimized mode D3D/DirectDraw display updates are also now completely stopped.
+- ECS Denise/AGA border blanking handling rewritten again. (Brian the Lion borders are black again)
+- Ignore color 0 (background) writes if borderblank is currently enabled when deciding autoscale start vertical
+ coordinate. (Brian the Lion)
+- Parallel port audio sampler emulation partially rewritten, it actually sounds correct now, mono/stereo option added.
+ AudioMaster IV confirmed working. Very pointless feature.
+
Beta 11:
- END special qualifier didn't work when combined with other qualifiers, some END + shortcuts leaked key presses to emulated
#include "win32.h"
#define SAMPLESIZE 4
-#define RECORDBUFFER 10000
-#define SAMPLEBUFFER 2000
static LPDIRECTSOUNDCAPTURE lpDS2r = NULL;
static LPDIRECTSOUNDCAPTUREBUFFER lpDSBprimary2r = NULL;
static LPDIRECTSOUNDCAPTUREBUFFER lpDSB2r = NULL;
static int inited;
static uae_u8 *samplebuffer;
-static int samplerate = 44100;
+static int sampleframes;
+static int recordbufferframes;
static float clockspersample;
static int vsynccnt;
static int safepos;
HRESULT hr;
DSCBUFFERDESC sound_buffer_rec;
WAVEFORMATEX wavfmt;
+ TCHAR *name;
+ int samplerate = 44100;
+
+ if (currprefs.sampler_freq)
+ samplerate = currprefs.sampler_freq;
+
+ name = record_devices[currprefs.win32_samplersoundcard]->name;
wavfmt.wFormatTag = WAVE_FORMAT_PCM;
wavfmt.nChannels = 2;
wavfmt.nAvgBytesPerSec = wavfmt.nBlockAlign * wavfmt.nSamplesPerSec;
wavfmt.cbSize = 0;
+ clockspersample = sampler_evtime / samplerate;
+ sampleframes = (samplerate + 49) / 50;
+ recordbufferframes = 16384;
+ if (currprefs.sampler_buffer)
+ recordbufferframes = currprefs.sampler_buffer;
+
hr = DirectSoundCaptureCreate (&record_devices[currprefs.win32_samplersoundcard]->guid, &lpDS2r, NULL);
if (FAILED (hr)) {
- write_log (_T("SAMPLER: DirectSoundCaptureCreate() failure: %s\n"), DXError (hr));
+ write_log (_T("SAMPLER: DirectSoundCaptureCreate('%s') failure: %s\n"), name, DXError (hr));
return 0;
}
memset (&sound_buffer_rec, 0, sizeof (DSCBUFFERDESC));
sound_buffer_rec.dwSize = sizeof (DSCBUFFERDESC);
- sound_buffer_rec.dwBufferBytes = RECORDBUFFER * SAMPLESIZE;
+ sound_buffer_rec.dwBufferBytes = recordbufferframes * SAMPLESIZE;
sound_buffer_rec.lpwfxFormat = &wavfmt;
sound_buffer_rec.dwFlags = 0 ;
hr = lpDS2r->CreateCaptureBuffer (&sound_buffer_rec, &lpDSB2r, NULL);
if (FAILED (hr)) {
- write_log (_T("SAMPLER: CreateCaptureSoundBuffer() failure: %s\n"), DXError(hr));
+ write_log (_T("SAMPLER: CreateCaptureSoundBuffer('%s') failure: %s\n"), name, DXError(hr));
return 0;
}
hr = lpDSB2r->Start (DSCBSTART_LOOPING);
if (FAILED (hr)) {
- write_log (_T("SAMPLER: DirectSoundCaptureBuffer_Start failed: %s\n"), DXError (hr));
+ write_log (_T("SAMPLER: DirectSoundCaptureBuffer_Start('%s') failed: %s\n"), name, DXError (hr));
return 0;
}
- samplebuffer = xcalloc (uae_u8, SAMPLEBUFFER * SAMPLESIZE);
- write_log (_T("SAMPLER: Parallel port sampler initialized\n"));
+ samplebuffer = xcalloc (uae_u8, sampleframes * SAMPLESIZE);
+ write_log (_T("SAMPLER: Parallel port sampler initialized, CPS=%f, '%s'\n"), clockspersample, name);
return 1;
}
uae_u8 sampler_getsample (int channel)
{
- HRESULT hr;
- static DWORD cap_pos;
+#if 0
+ int cur_pos;
+ static int cap_pos;
static float diffsample;
- DWORD t, cur_pos;
+#endif
+ static double doffset_offset;
+ HRESULT hr;
+ DWORD pos;
+ DWORD t;
void *p1, *p2;
DWORD len1, len2;
evt cycles;
+ int sample, samplecnt;
+ double doffset;
int offset;
- int sample, samplecnt, diff;
-// if (channel)
-// return 0;
- channel = 0;
+ if (!currprefs.sampler_stereo)
+ channel = 0;
if (!inited) {
if (!capture_init ()) {
inited = 1;
oldcycles = get_cycles ();
oldoffset = -1;
+ doffset_offset = 0;
+#if 0
diffsample = 0;
- safepos = -RECORDBUFFER / 10 * SAMPLESIZE;
- hr = lpDSB2r->GetCurrentPosition (&t, &cap_pos);
+ safepos = -recordbufferframes / 10 * SAMPLESIZE;
+ hr = lpDSB2r->GetCurrentPosition (&t, &pos);
+ cap_pos = pos;
cap_pos += safepos;
- if (cap_pos >= 10 * RECORDBUFFER * SAMPLESIZE)
- cap_pos += RECORDBUFFER * SAMPLESIZE;
- if (cap_pos >= RECORDBUFFER * SAMPLESIZE)
- cap_pos -= RECORDBUFFER * SAMPLESIZE;
+ if (cap_pos < 0)
+ cap_pos += recordbufferframes * SAMPLESIZE;
+ if (cap_pos >= recordbufferframes * SAMPLESIZE)
+ cap_pos -= recordbufferframes * SAMPLESIZE;
if (FAILED (hr)) {
sampler_free ();
return 0;
}
- clockspersample = sampler_evtime / samplerate;
+#endif
}
if (clockspersample < 1)
return 0;
vsynccnt = 0;
sample = 0;
samplecnt = 0;
- cycles = get_cycles () - oldcycles;
- float cps = clockspersample + diffsample;
- offset = (cycles + cps - 1) / cps;
- if (oldoffset < 0 || offset >= SAMPLEBUFFER || offset < 0) {
- if (oldoffset >= 0 && offset >= SAMPLEBUFFER) {
- while (oldoffset < SAMPLEBUFFER) {
+ cycles = (int)get_cycles () - (int)oldcycles;
+ doffset = doffset_offset + cycles / clockspersample;
+ offset = (int)doffset;
+ if (oldoffset < 0 || offset >= sampleframes || offset < 0) {
+ if (offset >= sampleframes) {
+ doffset -= offset;
+ doffset_offset = doffset;
+ }
+ if (oldoffset >= 0 && offset >= sampleframes) {
+ while (oldoffset < sampleframes) {
sample += sbuf[oldoffset * SAMPLESIZE / 2 + channel];
oldoffset++;
samplecnt++;
}
}
- hr = lpDSB2r->Lock (cap_pos, SAMPLEBUFFER * SAMPLESIZE, &p1, &len1, &p2, &len2, 0);
- if (FAILED (hr))
+ hr = lpDSB2r->GetCurrentPosition (&t, &pos);
+ hr = lpDSB2r->Lock (t, sampleframes * SAMPLESIZE, &p1, &len1, &p2, &len2, 0);
+ if (FAILED (hr)) {
+ write_log (_T("SAMPLER: Lock() failed %x\n"), hr);
return 0;
+ }
memcpy (samplebuffer, p1, len1);
if (p2)
memcpy (samplebuffer + len1, p2, len2);
lpDSB2r->Unlock (p1, len1, p2, len2);
- cap_pos += SAMPLEBUFFER * SAMPLESIZE;
- hr = lpDSB2r->GetCurrentPosition (&t, &cur_pos);
+#if 0
+ cap_pos = t;
+ cap_pos += sampleframes * SAMPLESIZE;
+ if (cap_pos < 0)
+ cap_pos += RECORDBUFFER * SAMPLESIZE;
+ if (cap_pos >= RECORDBUFFER * SAMPLESIZE)
+ cap_pos -= RECORDBUFFER * SAMPLESIZE;
+
+ hr = lpDSB2r->GetCurrentPosition (&t, &pos);
+ cur_pos = pos;
if (FAILED (hr))
return 0;
+
cur_pos += safepos;
- if (cur_pos >= 10 * RECORDBUFFER * SAMPLESIZE)
+ if (cur_pos < 0)
cur_pos += RECORDBUFFER * SAMPLESIZE;
if (cur_pos >= RECORDBUFFER * SAMPLESIZE)
cur_pos -= RECORDBUFFER * SAMPLESIZE;
+
+ int diff;
if (cur_pos >= cap_pos)
diff = cur_pos - cap_pos;
else
diff /= SAMPLESIZE;
int diff2 = 100 * diff / (RECORDBUFFER / 2);
-#if 0
diffsample = -pow (diff2 < 0 ? -diff2 : diff2, 3.1);
if (diff2 < 0)
diffsample = -diffsample;
-#endif
-// write_log (_T("%d:%.1f\n"), diff, diffsample);
+ write_log (_T("%d\n"), diff);
- cap_pos += SAMPLEBUFFER * SAMPLESIZE;
- if (cap_pos < 0)
- cap_pos += RECORDBUFFER * SAMPLESIZE;
- if (cap_pos >= RECORDBUFFER * SAMPLESIZE)
- cap_pos -= RECORDBUFFER * SAMPLESIZE;
+ write_log (_T("CAP=%05d CUR=%05d (%-05d) OFF=%05d %f\n"),
+ cap_pos / SAMPLESIZE, cur_pos / SAMPLESIZE, (cap_pos - cur_pos) / SAMPLESIZE, offset, doffset_offset);
+#endif
if (offset < 0)
offset = 0;
- if (offset >= SAMPLEBUFFER)
- offset -= SAMPLEBUFFER;
+ if (offset >= sampleframes)
+ offset -= sampleframes;
+
oldoffset = 0;
oldcycles = get_cycles ();
}
+
while (oldoffset <= offset) {
sample += sbuf[oldoffset * SAMPLESIZE / 2 + channel];
samplecnt++;
oldoffset++;
}
oldoffset = offset;
+
if (samplecnt > 0)
sample /= samplecnt;
- return (sample / 256) - 128;
+#if 1
+ /* yes, not 256, without this max recording volume would still be too quiet on my sound cards */
+ sample /= 128;
+ if (sample < -128)
+ sample = 0;
+ else if (sample > 127)
+ sample = 127;
+ return (uae_u8)(sample - 128);
+#else
+ return (Uae_u8)((sample / 256) - 128);
+#endif
}
int sampler_init (void)
{
if (!inited)
return;
+
vsynccnt++;
if (vsynccnt > 1) {
oldcycles = get_cycles ();