cfgfile_dwrite_str (f, _T("gfx_filter_keep_aspect"), aspects[p->gfx_filter_keep_aspect]);
cfgfile_dwrite_str (f, _T("gfx_filter_autoscale"), autoscale[p->gfx_filter_autoscale]);
cfgfile_dwrite (f, _T("gfx_filter_aspect_ratio"), _T("%d:%d"),
- p->gfx_filter_aspect >= 0 ? (p->gfx_filter_aspect >> 8) : -1,
- p->gfx_filter_aspect >= 0 ? (p->gfx_filter_aspect & 0xff) : -1);
+ p->gfx_filter_aspect >= 0 ? (p->gfx_filter_aspect / ASPECTMULT) : -1,
+ p->gfx_filter_aspect >= 0 ? (p->gfx_filter_aspect & (ASPECTMULT - 1)) : -1);
cfgfile_dwrite (f, _T("gfx_luminance"), _T("%d"), p->gfx_luminance);
cfgfile_dwrite (f, _T("gfx_contrast"), _T("%d"), p->gfx_contrast);
cfgfile_dwrite (f, _T("gfx_gamma"), _T("%d"), p->gfx_gamma);
cfgfile_dwrite_bool (f, _T("denise_noehb"), p->cs_denisenoehb);
cfgfile_dwrite_bool (f, _T("agnus_bltbusybug"), p->cs_agnusbltbusybug);
cfgfile_dwrite_bool (f, _T("ics_agnus"), p->cs_dipagnus);
+ cfgfile_dwrite (f, _T("chipset_hacks"), _T("0x%x"), p->cs_hacks);
cfgfile_dwrite_bool (f, _T("fastmem_autoconfig"), p->fastmem_autoconfig);
cfgfile_write (f, _T("fastmem_size"), _T("%d"), p->fastmem_size / 0x100000);
else if (v1 == 0 || v2 == 0)
p->gfx_filter_aspect = 0;
else
- p->gfx_filter_aspect = (v1 << 8) | v2;
+ p->gfx_filter_aspect = v1 * ASPECTMULT + v2;
}
return 1;
}
return 1;
if (cfgfile_intval (option, value, _T("cachesize"), &p->cachesize, 1)
+ || cfgfile_intval (option, value, _T("chipset_hacks"), &p->cs_hacks, 1)
|| cfgfile_intval (option, value, _T("serial_stopbits"), &p->serial_stopbits, 1)
|| cfgfile_intval (option, value, _T("cpu060_revision"), &p->cpu060_revision, 1)
|| cfgfile_intval (option, value, _T("fpu_revision"), &p->fpu_revision, 1)
write_log (_T("buggy copper cycle conflict with blitter ch %c %08x <- %08x PC=%08x\n"), 'A' + (chnum - 1), *ptr, srcptr, m68k_getpc ());
warned--;
}
-// if (currprefs.cpu_model == 68000)
-// *ptr = srcptr;
+ if ((currprefs.cs_hacks & 1) && currprefs.cpu_model == 68000)
+ *ptr = srcptr;
}
alloc_cycle (hpos, CYCLE_BLITTER);
}
}
}
+// emulate weird shifting glitch on right border if
+// bitplane is lores max overscan and bitplane delay >= 8
+// not fully understood yet.
+static void do_right_ddf_hack (int nr, int hpos)
+{
+ int shift;
+
+ if (GET_RES_AGNUS (bplcon0) != RES_LORES)
+ return;
+ if (hpos < 0xd8)
+ return;
+ shift = (nr & 1) ? toscr_delay2 : toscr_delay1;
+ if (shift < 8)
+ return;
+ fetched[nr] >>= 7;
+}
+
+
STATIC_INLINE void fetch (int nr, int fm, int hpos)
{
if (nr < bplcon0_planes_limit) {
mod = bpl1mod;
bplpt[nr] += mod;
bplptx[nr] += mod;
+
+ if ((currprefs.cs_hacks & 2) || 0)
+ do_right_ddf_hack (nr, hpos);
}
} else {
// use whatever left in BPLxDAT if no DMA
int i;
uae_u32 mask = 0xFFFF >> (16 - nbits);
+#if 0
+ int pos = thisline_decision.plfleft + out_offs * 16;
+ int checkpos = 220;
+
+ if (pos < checkpos && pos + nbits >= checkpos) {
+ }
+#endif
+
for (i = 0; i < toscr_nr_planes2; i += 2) {
outword[i] <<= nbits;
outword[i] |= (todisplay[i][0] >> (16 - nbits + delay1)) & mask;
uae_u8 *xlinebuffer;
static int *amiga2aspect_line_map, *native2amiga_line_map;
-static uae_u8 *row_map[MAX_VIDHEIGHT + 1];
+static uae_u8 *row_map[MAX_UAE_HEIGHT + 1];
static uae_u8 row_tmp[MAX_PIXELS_PER_LINE * 32 / 8];
static int max_drawn_amiga_line;
All of these are forced into the visible window (VISIBLE_LEFT_BORDER .. VISIBLE_RIGHT_BORDER).
PLAYFIELD_START and PLAYFIELD_END are in window coordinates. */
static int playfield_start, playfield_end;
-static int real_playfield_start, real_playfield_end;
static int linetoscr_diw_start, linetoscr_diw_end;
static int native_ddf_left, native_ddf_right;
+#if 0
static bool can_have_bordersprite;
+#endif
static int pixels_offset;
static int src_pixel, ham_src_pixel;
playfield_start = linetoscr_diw_start;
playfield_end = linetoscr_diw_end;
-#if 0
+
if (playfield_start < native_ddf_left)
playfield_start = native_ddf_left;
if (playfield_end > native_ddf_right)
playfield_end = native_ddf_right;
-#endif
- unpainted = visible_left_border < playfield_start ? 0 : visible_left_border - playfield_start;
- ham_src_pixel = MAX_PIXELS_PER_LINE + res_shift_from_window (playfield_start - native_ddf_left);
- unpainted = res_shift_from_window (unpainted);
if (playfield_start < visible_left_border)
playfield_start = visible_left_border;
if (playfield_end > visible_right_border)
playfield_end = visible_right_border;
+#if 0
real_playfield_end = playfield_end;
real_playfield_start = playfield_start;
+#endif
// Sprite hpos don't include DIW_DDF_OFFSET and can appear 1 lores pixel
// before first bitplane pixel appears.
- // This means "bordersprite" conditions is possible under OCS/ECS too. Argh!
+ // This means "bordersprite" condition is possible under OCS/ECS too. Argh!
if (dip_for_drawing->nr_sprites) {
/* bordersprite off or not supported: sprites are visible until diw_end */
- if (playfield_end < linetoscr_diw_end)
+ if (playfield_end < linetoscr_diw_end && hblank_right_stop > playfield_end) {
playfield_end = linetoscr_diw_end;
+ }
int end = coord_hw_to_window_x (dp_for_drawing->plfleft * 2);
if (end < playfield_start && end > linetoscr_diw_start) {
playfield_start = end;
- can_have_bordersprite = true;
+ ;//can_have_bordersprite = true;
} else {
- can_have_bordersprite = false;
- }
+ ;//can_have_bordersprite = false;
+ }
} else {
- can_have_bordersprite = dp_for_drawing->bordersprite_seen;
+ ;//can_have_bordersprite = dp_for_drawing->bordersprite_seen;
}
#ifdef AGA
}
#endif
+ unpainted = visible_left_border < playfield_start ? 0 : visible_left_border - playfield_start;
+ ham_src_pixel = MAX_PIXELS_PER_LINE + res_shift_from_window (playfield_start - native_ddf_left);
+ unpainted = res_shift_from_window (unpainted);
+
if (sprite_first_x < sprite_last_x) {
if (sprite_first_x < 0)
sprite_first_x = 0;
if (dip_for_drawing->nr_sprites == 0)
return;
- /* Must clear parts of apixels. */
+ /* We need to clear parts of apixels. */
if (linetoscr_diw_start < native_ddf_left) {
int size = res_shift_from_window (native_ddf_left - linetoscr_diw_start);
linetoscr_diw_start = native_ddf_left;
}
}
+// erase sprite graphics in pixdata if they were outside of ddf
+static void pfield_erase_hborder_sprites (void)
+{
+ if (sprite_first_x < native_ddf_left) {
+ int size = res_shift_from_window (native_ddf_left - sprite_first_x);
+ memset (pixdata.apixels + MAX_PIXELS_PER_LINE - size, 0, size);
+ }
+ if (sprite_last_x > native_ddf_right) {
+ int pos = res_shift_from_window (native_ddf_right - native_ddf_left);
+ int size = res_shift_from_window (sprite_last_x - native_ddf_right);
+ memset (pixdata.apixels + MAX_PIXELS_PER_LINE + pos, 0, size);
+ }
+}
+
+// erase whole viewable area if upper or lower border
+static void pfield_erase_vborder_sprites (void)
+{
+ uae_u8 c = colors_for_drawing.borderblank ? 0 : colors_for_drawing.acolors[0];
+ int size = res_shift_from_window (linetoscr_diw_end - linetoscr_diw_start);
+ memset (pixdata.apixels + MAX_PIXELS_PER_LINE - size, c, size);
+}
+
+
STATIC_INLINE 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;
}
}
+#if 0
/* clear possible bitplane data outside DIW area */
static void clear_bitplane_border (void)
{
memset (pixdata.apixels + pixels_offset + (real_playfield_end >> shift), v, len);
}
}
+#endif
/* emulate OCS/ECS only undocumented "SWIV" hardware feature */
static void weird_bitplane_fix (void)
{
static uae_u8 *oldbufmem;
static int oldheight, oldpitch;
-
int i, j;
- if (gfxvidinfo.drawbuffer.height_allocated > MAX_VIDHEIGHT) {
+
+ if (gfxvidinfo.drawbuffer.height_allocated > MAX_UAE_HEIGHT) {
write_log (_T("Resolution too high, aborting\n"));
abort ();
}
oldheight == gfxvidinfo.drawbuffer.height_allocated &&
oldpitch == gfxvidinfo.drawbuffer.rowbytes)
return;
+ j = oldheight == 0 ? MAX_UAE_HEIGHT : oldheight;
+ for (i = gfxvidinfo.drawbuffer.height_allocated; i < MAX_UAE_HEIGHT + 1 && i < j + 1; i++)
+ row_map[i] = row_tmp;
+ for (i = 0, j = 0; i < gfxvidinfo.drawbuffer.height_allocated; i++, j += gfxvidinfo.drawbuffer.rowbytes)
+ row_map[i] = gfxvidinfo.drawbuffer.bufmem + j;
oldbufmem = gfxvidinfo.drawbuffer.bufmem;
oldheight = gfxvidinfo.drawbuffer.height_allocated;
oldpitch = gfxvidinfo.drawbuffer.rowbytes;
- j = 0;
- for (i = gfxvidinfo.drawbuffer.height_allocated; i < MAX_VIDHEIGHT + 1; i++)
- row_map[i] = row_tmp;
- for (i = 0; i < gfxvidinfo.drawbuffer.height_allocated; i++, j += gfxvidinfo.drawbuffer.rowbytes)
- row_map[i] = gfxvidinfo.drawbuffer.bufmem + j;
}
void init_aspect_maps (void)
regno -= 0x1000;
switch (regno)
{
- case 0x100:
+ case 0x100: // BPLCON1
dp_for_drawing->bplcon0 = v;
dp_for_drawing->bplres = GET_RES_DENISE (v);
dp_for_drawing->nr_planes = GET_PLANES (v);
dp_for_drawing->ham_seen = isham (v);
break;
- case 0x104:
+ case 0x104: // BPLCON2
dp_for_drawing->bplcon2 = v;
break;
#ifdef ECS_DENISE
- case 0x106:
+ case 0x106: // BPLCON3
dp_for_drawing->bplcon3 = v;
break;
#endif
#ifdef AGA
- case 0x10c:
+ case 0x10c: // BPLCON4
dp_for_drawing->bplcon4 = v;
break;
#endif
if (dip_for_drawing->nr_sprites) {
int i;
- if (can_have_bordersprite)
- clear_bitplane_border ();
for (i = 0; i < dip_for_drawing->nr_sprites; i++) {
#ifdef AGA
do_flush_line (vb, follow_ypos);
}
+ if (dip_for_drawing->nr_sprites)
+ pfield_erase_hborder_sprites ();
+
} else if (border > 0) {
// border > 0: top or bottom border
bool dosprites = false;
dosprites = true;
pfield_expand_dp_bplcon ();
pfield_init_linetoscr ();
- memset (pixdata.apixels + MAX_PIXELS_PER_LINE, colors_for_drawing.borderblank ? 0 : colors_for_drawing.acolors[0], MAX_PIXELS_PER_LINE);
+ pfield_erase_vborder_sprites ();
}
#endif
hposblank = 0;
pfield_draw_line (vbout, line, where2, amiga2aspect_line_map[i1 + 1]);
}
+
#if 0
/* clear possible old garbage at the bottom if emulated area become smaller */
for (i = last_max_ypos; i < vb->outheight; i++) {
int data_size;
int data_multi;
int direction; // 0 = read, 1 = write
+ bool intdrq;
int lba48;
uae_u8 multiple_mode;
int irq_delay;
static void ide_interrupt (struct ide_hdf *ide)
{
+ ide->regs.ide_status |= IDE_STATUS_BSY;
+ ide->regs.ide_status &= ~IDE_STATUS_DRQ;
ide->irq_delay = 2;
}
static void ide_fast_interrupt (struct ide_hdf *ide)
{
+ ide->regs.ide_status |= IDE_STATUS_BSY;
+ ide->regs.ide_status &= ~IDE_STATUS_DRQ;
ide->irq_delay = 1;
}
static void ide_interrupt_do (struct ide_hdf *ide)
{
- ide->regs.ide_status &= ~IDE_STATUS_BSY;
- if (ide->direction)
+ uae_u8 os = ide->regs.ide_status;
+ ide->regs.ide_status &= ~IDE_STATUS_DRQ;
+ if (ide->intdrq)
ide->regs.ide_status |= IDE_STATUS_DRQ;
+ ide->regs.ide_status &= ~IDE_STATUS_BSY;
+ if (IDE_LOG > 1)
+ write_log (_T("IDE INT %02X -> %02X\n"), os, ide->regs.ide_status);
+ ide->intdrq = false;
ide->irq_delay = 0;
if (ide->regs.ide_devcon & 2)
return;
{
memset (ide->secbuf, 0, ide->blocksize);
ide->data_offset = 0;
- ide->regs.ide_status |= IDE_STATUS_DRQ;
ide->data_size = ide->blocksize;
ide->data_multi = 1;
+ ide->intdrq = true;
ide_interrupt (ide);
}
}
}
-static void process_rw_command (struct ide_hdf *ide)
+static void setdrq (struct ide_hdf *ide)
+{
+ ide->regs.ide_status |= IDE_STATUS_DRQ;
+ ide->regs.ide_status &= ~IDE_STATUS_BSY;
+}
+static void setbsy (struct ide_hdf *ide)
{
ide->regs.ide_status |= IDE_STATUS_BSY;
ide->regs.ide_status &= ~IDE_STATUS_DRQ;
+}
+
+static void process_rw_command (struct ide_hdf *ide)
+{
+ setbsy (ide);
write_comm_pipe_u32 (&requests, ide->num, 1);
}
static void process_packet_command (struct ide_hdf *ide)
{
- ide->regs.ide_status |= IDE_STATUS_BSY;
- ide->regs.ide_status &= ~IDE_STATUS_DRQ;
+ setbsy (ide);
write_comm_pipe_u32 (&requests, ide->num | 0x80, 1);
}
if (!size) {
ide->packet_state = 0;
ide->packet_transfer_size = 0;
- return true;
+ return false;
}
if (ide->packet_state == 2) {
if (size > ide->packet_data_size)
} else {
ide->packet_transfer_size = 12;
}
- ide->regs.ide_status = IDE_STATUS_DRQ;
if (IDE_LOG > 1)
write_log (_T("ATAPI data transfer %d/%d bytes\n"), ide->packet_transfer_size, ide->data_size);
- return false;
+ return true;
}
static void atapi_packet (struct ide_hdf *ide)
ide->data_offset = 0;
ide->regs.ide_nsector = ATAPI_CD;
ide->regs.ide_error = 0;
- atapi_set_size (ide);
+ if (atapi_set_size (ide))
+ setdrq (ide);
}
static void do_packet_command (struct ide_hdf *ide)
ide->data_size = ide->scsi->data_len;
}
ide->packet_state = 2; // data phase
- atapi_set_size (ide);
+ if (atapi_set_size (ide))
+ ide->intdrq = true;
}
static void do_process_packet_command (struct ide_hdf *ide)
ide->packet_data_offset += ide->packet_transfer_size;
if (!ide->direction) {
// data still remaining, next transfer
- atapi_set_size (ide);
+ if (atapi_set_size (ide))
+ ide->intdrq = true;
} else {
if (atapi_set_size (ide)) {
+ ide->intdrq = true;
+ } else {
memcpy (&ide->scsi->buffer, ide->secbuf, ide->data_size);
ide->scsi->data_len = ide->data_size;
scsi_emulate_cmd (ide->scsi);
}
}
}
- ide->irq_delay = 1;
+ ide_fast_interrupt (ide);
}
static void do_process_rw_command (struct ide_hdf *ide)
if (IDE_LOG > 1)
write_log (_T("IDE%d read, read %d bytes\n"), ide->num, nsec * ide->blocksize);
}
- ide->regs.ide_status |= IDE_STATUS_DRQ;
+ ide->intdrq = true;
last = dec_nsec (ide, nsec) == 0;
put_lbachs (ide, lba, cyl, head, sec, last ? nsec - 1 : nsec);
- if (last) {
- if (ide->direction) {
- if (IDE_LOG > 1)
- write_log (_T("IDE%d write finished\n"), ide->num);
- ide->regs.ide_status &= ~IDE_STATUS_DRQ;
- }
+ if (last && ide->direction) {
+ ide->intdrq = false;
+ if (IDE_LOG > 1)
+ write_log (_T("IDE%d write finished\n"), ide->num);
}
- ide->irq_delay = 1;
+ ide_fast_interrupt (ide);
}
static void ide_read_sectors (struct ide_hdf *ide, int flags)
ide->data_offset = 0;
ide->data_size = nsec * ide->blocksize;
ide->direction = 0;
-
+ // read start: preload sector(s), then trigger interrupt.
process_rw_command (ide);
}
ide->data_offset = 0;
ide->data_size = nsec * ide->blocksize;
ide->direction = 1;
-
- ide->regs.ide_status |= IDE_STATUS_BSY;
- ide->regs.ide_status &= ~IDE_STATUS_DRQ;
-
- ide_fast_interrupt (ide);
+ // write start: set DRQ and clear BSY. No interrupt.
+ ide->regs.ide_status |= IDE_STATUS_DRQ;
+ ide->regs.ide_status &= ~IDE_STATUS_BSY;
}
static void ide_do_command (struct ide_hdf *ide, uae_u8 cmd)
write_log (_T("IDE%d DATA read\n"), ide->num);
if (ide->data_size == 0) {
if (IDE_LOG > 0)
- write_log (_T("IDE%d DATA read without DRQ!? PC=%08X\n"), ide->num, m68k_getpc ());
+ write_log (_T("IDE%d DATA but no data left!? %02X PC=%08X\n"), ide->num, ide->regs.ide_status, m68k_getpc ());
if (!isdrive (ide))
return 0xffff;
return 0;
}
}
if (ide->data_size == 0) {
+ if (!(ide->regs.ide_status & IDE_STATUS_DRQ)) {
+ write_log (_T("IDE%d read finished but DRQ was not active?\n"), ide->num);
+ }
ide->regs.ide_status &= ~IDE_STATUS_DRQ;
if (IDE_LOG > 1)
write_log (_T("IDE%d read finished\n"), ide->num);
write_log (_T("IDE%d DATA write %04x %d/%d\n"), ide->num, v, ide->data_offset, ide->data_size);
if (ide->data_size == 0) {
if (IDE_LOG > 0)
- write_log (_T("IDE%d DATA write without DRQ!? PC=%08X\n"), ide->num, m68k_getpc ());
+ write_log (_T("IDE%d DATA write without request!? %02X PC=%08X\n"), ide->num, ide->regs.ide_status, m68k_getpc ());
return;
}
ide->secbuf[ide->packet_data_offset + ide->data_offset + 1] = v & 0xff;
static void out_linetoscr_do_dstpix (DEPTH_T bpp, HMODE_T hmode, int aga, CMODE_T cmode, int spr)
{
if (aga && cmode == CMODE_HAM) {
- outln ( " dpix_val = CONVERT_RGB (ham_linebuf[spix]);");
- if (spr)
- outln ( " sprpix_val = dpix_val;");
+ outln ( " spix_val = ham_linebuf[spix];");
+ outln ( " dpix_val = CONVERT_RGB (spix_val);");
} else if (cmode == CMODE_HAM) {
- outln ( " dpix_val = xcolors[ham_linebuf[spix]];");
+ outln ( " spix_val = ham_linebuf[spix];");
+ outln ( " dpix_val = xcolors[spix_val];");
if (spr)
- outln ( " sprpix_val = dpix_val;");
+ outln ( " sprpix_val = pixdata.apixels[spix];");
} else if (aga && cmode == CMODE_DUALPF) {
outln ( " {");
outln ( " uae_u8 val = lookup[spix_val];");
/* 440 rather than 880, since sprites are always lores. */
#ifdef UAE_MINI
#define MAX_PIXELS_PER_LINE 880
-#define MAX_VIDHEIGHT 800
#else
#define MAX_PIXELS_PER_LINE 1760
-#define MAX_VIDHEIGHT 2048
#endif
/* No divisors for MAX_PIXELS_PER_LINE; we support AGA and SHRES sprites */
bool forcedwriteprotect;
};
+#define ASPECTMULT 1024
#define WH_NATIVE 1
struct wh {
int x, y;
bool cs_denisenoehb;
bool cs_dipagnus;
bool cs_agnusbltbusybug;
+ int cs_hacks;
TCHAR romfile[MAX_DPATH];
TCHAR romident[256];
wh->width = 160;
if (wh->height < 128)
wh->height = 128;
- if (wh->width > 3072)
- wh->width = 3072;
- if (wh->height > 2048)
- wh->height = 2048;
+ if (wh->width > MAX_UAE_WIDTH)
+ wh->width = MAX_UAE_WIDTH;
+ if (wh->height > MAX_UAE_HEIGHT)
+ wh->height = MAX_UAE_HEIGHT;
}
void fixup_prefs_dimensions (struct uae_prefs *prefs)
#define WINDOWS
#define ZLIB_WINAPI
+#define MAX_UAE_WIDTH 8192
+#define MAX_UAE_HEIGHT 8192
+
#ifndef UAE_MINI
#define DEBUGGER
cfgfile_target_dwrite_bool (f, _T("rtg_scale_center"), p->win32_rtgscalemode == 2);
cfgfile_target_dwrite_bool (f, _T("rtg_scale_allow"), p->win32_rtgallowscaling);
cfgfile_target_dwrite (f, _T("rtg_scale_aspect_ratio"), _T("%d:%d"),
- p->win32_rtgscaleaspectratio >= 0 ? (p->win32_rtgscaleaspectratio >> 8) : -1,
- p->win32_rtgscaleaspectratio >= 0 ? (p->win32_rtgscaleaspectratio & 0xff) : -1);
+ p->win32_rtgscaleaspectratio >= 0 ? (p->win32_rtgscaleaspectratio / ASPECTMULT) : -1,
+ p->win32_rtgscaleaspectratio >= 0 ? (p->win32_rtgscaleaspectratio & (ASPECTMULT - 1)) : -1);
if (p->win32_rtgvblankrate <= 0)
cfgfile_target_dwrite_str (f, _T("rtg_vblank"), p->win32_rtgvblankrate == -1 ? _T("real") : (p->win32_rtgvblankrate == -2 ? _T("disabled") : _T("chipset")));
else
else if (v1 == 0 || v2 == 0)
p->win32_rtgscaleaspectratio = 0;
else
- p->win32_rtgscaleaspectratio = (v1 << 8) | v2;
+ p->win32_rtgscaleaspectratio = v1 * ASPECTMULT + v2;
}
return 1;
}
#define LANG_DLL 1
#if WINUAEPUBLICBETA
-#define WINUAEBETA _T("16")
+#define WINUAEBETA _T("17")
#else
#define WINUAEBETA _T("")
#endif
-#define WINUAEDATE MAKEBD(2013, 4, 13)
+#define WINUAEDATE MAKEBD(2013, 4, 19)
#define WINUAEEXTRA _T("")
//#define WINUAEEXTRA _T("AmiKit Preview")
#define WINUAEREV _T("")
srcratio = 4.0f / 3.0f;
if (currprefs.gfx_filter_aspect > 0) {
- dstratio = (currprefs.gfx_filter_aspect >> 8) * 1.0f / (currprefs.gfx_filter_aspect & 0xff);
+ dstratio = (currprefs.gfx_filter_aspect / ASPECTMULT) * 1.0f / (currprefs.gfx_filter_aspect & (ASPECTMULT - 1));
} else if (currprefs.gfx_filter_aspect < 0) {
if (isfullscreen () && deskw > 0 && deskh > 0)
dstratio = 1.0f * deskw / deskh;
HWND hStatusWnd = NULL;
-static uae_u8 scrlinebuf[4096 * 4]; /* this is too large, but let's rather play on the safe side here */
+static uae_u8 scrlinebuf[MAX_UAE_WIDTH * 4]; /* this is too large, but let's rather play on the safe side here */
static struct MultiDisplay *getdisplay2 (struct uae_prefs *p, int index)
{
SetRect (&sr, 0, 0, picasso96_state.Width, picasso96_state.Height);
if (currprefs.win32_rtgscaleaspectratio < 0) {
// automatic
- srcratio = picasso96_state.Width * 256 / picasso96_state.Height;
- dstratio = srcwidth * 256 / srcheight;
+ srcratio = picasso96_state.Width * ASPECTMULT / picasso96_state.Height;
+ dstratio = srcwidth * ASPECTMULT / srcheight;
} else if (currprefs.win32_rtgscaleaspectratio == 0) {
// none
srcratio = dstratio = 0;
} else {
// manual
- srcratio = (currprefs.win32_rtgscaleaspectratio >> 8) * 256 / (currprefs.win32_rtgscaleaspectratio & 0xff);
- dstratio = srcwidth * 256 / srcheight;
+ srcratio = currprefs.win32_rtgscaleaspectratio;
+ dstratio = srcwidth * ASPECTMULT / srcheight;
}
if (srcratio == dstratio) {
SetRect (&dr, 0, 0, srcwidth, srcheight);
} else {
if (currprefs.win32_rtgscaleaspectratio < 0) {
// automatic
- srcratio = srcwidth * 256 / srcheight;
- dstratio = currentmode->native_width * 256 / currentmode->native_height;
+ srcratio = srcwidth * ASPECTMULT / srcheight;
+ dstratio = currentmode->native_width * ASPECTMULT / currentmode->native_height;
} else if (currprefs.win32_rtgscaleaspectratio == 0) {
// none
srcratio = dstratio = 0;
} else {
// manual
- dstratio = (currprefs.win32_rtgscaleaspectratio >> 8) * 256 / (currprefs.win32_rtgscaleaspectratio & 0xff);
- srcratio = srcwidth * 256 / srcheight;
+ dstratio = currprefs.win32_rtgscaleaspectratio;
+ srcratio = srcwidth * ASPECTMULT / srcheight;
}
if (srcratio == dstratio) {
static int gui_size_changed;
static int filterstackpos = 0;
+static const int defaultaspectratios[] = {
+ 4, 3, 16, 10, 15, 9, 27, 16, 128, 75, 16, 9, 256, 135, 21, 9, 16, 3,
+ -1
+};
+static int getaspectratioindex (int ar)
+{
+ for (int i = 0; defaultaspectratios[i] >= 0; i += 2) {
+ if (ar == defaultaspectratios[i + 0] * 1024 + defaultaspectratios[i + 1])
+ return i / 2;
+ }
+ return 0;
+}
+static int getaspectratio (int index)
+{
+ for (int i = 0; defaultaspectratios[i] >= 0; i += 2) {
+ if (i == index * 2) {
+ return defaultaspectratios[i + 0] * 1024 + defaultaspectratios[i + 1];
+ }
+ }
+ return 0;
+}
+static void addaspectratios (HWND hDlg, int id)
+{
+ for (int i = 0; defaultaspectratios[i] >= 0; i += 2) {
+ TCHAR tmp[100];
+ _stprintf (tmp, _T("%d:%d (%.2f)"), defaultaspectratios[i + 0], defaultaspectratios[i + 1], (double)defaultaspectratios[i + 0] / defaultaspectratios[i + 1]);
+ SendDlgItemMessage (hDlg, id, CB_ADDSTRING, 0, (LPARAM)tmp);
+ }
+}
+
#define Error(x) MessageBox (NULL, (x), _T("WinUAE Error"), MB_OK)
wstring WIN32GUI_LoadUIString (DWORD id)
SendDlgItemMessage(hDlg, IDC_RESOLUTIONDEPTH, CB_RESETCONTENT, 0, 0);
cnt = 0;
gui_display_depths[0] = gui_display_depths[1] = gui_display_depths[2] = -1;
- for (i = 0; md->DisplayModes[i].depth >= 0; i++) {
- if (md->DisplayModes[i].depth > 1 && md->DisplayModes[i].residx == md->DisplayModes[index].residx) {
- TCHAR tmp[64];
- _stprintf (tmp, _T("%d"), md->DisplayModes[i].depth * 8);
- SendDlgItemMessage(hDlg, IDC_RESOLUTIONDEPTH, CB_ADDSTRING, 0, (LPARAM)tmp);
- if (md->DisplayModes[i].depth == d)
- SendDlgItemMessage (hDlg, IDC_RESOLUTIONDEPTH, CB_SETCURSEL, cnt, 0);
- gui_display_depths[cnt] = md->DisplayModes[i].depth;
- cnt++;
+ if (index >= 0) {
+ for (i = 0; md->DisplayModes[i].depth >= 0; i++) {
+ if (md->DisplayModes[i].depth > 1 && md->DisplayModes[i].residx == md->DisplayModes[index].residx) {
+ TCHAR tmp[64];
+ _stprintf (tmp, _T("%d"), md->DisplayModes[i].depth * 8);
+ SendDlgItemMessage(hDlg, IDC_RESOLUTIONDEPTH, CB_ADDSTRING, 0, (LPARAM)tmp);
+ if (md->DisplayModes[i].depth == d)
+ SendDlgItemMessage (hDlg, IDC_RESOLUTIONDEPTH, CB_SETCURSEL, cnt, 0);
+ gui_display_depths[cnt] = md->DisplayModes[i].depth;
+ cnt++;
+ }
}
}
init_frequency_combo (hDlg, index);
struct MultiDisplay *md = getdisplay (&workprefs);
LRESULT posn1 = SendDlgItemMessage (hDlg, IDC_RESOLUTION, CB_GETCURSEL, 0, 0);
LRESULT posn2 = SendDlgItemMessage (hDlg, IDC_RESOLUTIONDEPTH, CB_GETCURSEL, 0, 0);
- if (posn1 != CB_ERR && posn2 != CB_ERR) {
+ if (posn1 != CB_ERR) {
+ if (posn2 == CB_ERR)
+ posn2 = 0;
workprefs.gfx_size_fs.special = 0;
for (dmode = 0; md->DisplayModes[dmode].depth >= 0; dmode++) {
if (md->DisplayModes[dmode].residx == posn1)
SendDlgItemMessage (hDlg, IDC_RTG_SCALE_ASPECTRATIO, CB_SETCURSEL,
(workprefs.win32_rtgscaleaspectratio == 0) ? 0 :
- (workprefs.win32_rtgscaleaspectratio == 4 * 256 + 3) ? 2 :
- (workprefs.win32_rtgscaleaspectratio == 5 * 256 + 4) ? 3 :
- (workprefs.win32_rtgscaleaspectratio == 15 * 256 + 9) ? 4 :
- (workprefs.win32_rtgscaleaspectratio == 16 * 256 + 9) ? 5 :
- (workprefs.win32_rtgscaleaspectratio == 16 * 256 + 10) ? 6 : 1, 0);
+ (workprefs.win32_rtgscaleaspectratio == 1) ? 1 :
+ getaspectratioindex (workprefs.win32_rtgscaleaspectratio) + 2, 0);
mem_size = 0;
switch (workprefs.mbresmem_low_size) {
SendDlgItemMessage (hDlg, IDC_RTG_SCALE_ASPECTRATIO, CB_ADDSTRING, 0, (LPARAM)tmp);
WIN32GUI_LoadUIString (IDS_AUTOMATIC, tmp, sizeof tmp / sizeof (TCHAR));
SendDlgItemMessage (hDlg, IDC_RTG_SCALE_ASPECTRATIO, CB_ADDSTRING, 0, (LPARAM)tmp);
- SendDlgItemMessage (hDlg, IDC_RTG_SCALE_ASPECTRATIO, CB_ADDSTRING, 0, (LPARAM)_T("4:3"));
- SendDlgItemMessage (hDlg, IDC_RTG_SCALE_ASPECTRATIO, CB_ADDSTRING, 0, (LPARAM)_T("5:4"));
- SendDlgItemMessage (hDlg, IDC_RTG_SCALE_ASPECTRATIO, CB_ADDSTRING, 0, (LPARAM)_T("15:9"));
- SendDlgItemMessage (hDlg, IDC_RTG_SCALE_ASPECTRATIO, CB_ADDSTRING, 0, (LPARAM)_T("16:9"));
- SendDlgItemMessage (hDlg, IDC_RTG_SCALE_ASPECTRATIO, CB_ADDSTRING, 0, (LPARAM)_T("16:10"));
+ addaspectratios (hDlg, IDC_RTG_SCALE_ASPECTRATIO);
SendDlgItemMessage (hDlg, IDC_RTG_VBLANKRATE, CB_RESETCONTENT, 0, 0);
SendDlgItemMessage (hDlg, IDC_RTG_VBLANKRATE, CB_ADDSTRING, 0, (LPARAM)_T("Chipset"));
SendDlgItemMessage (hDlg, IDC_RTG_VBLANKRATE, CB_ADDSTRING, 0, (LPARAM)_T("Default"));
if (v != CB_ERR) {
if (v == 0)
workprefs.win32_rtgscaleaspectratio = 0;
- if (v == 1)
+ else if (v == 1)
workprefs.win32_rtgscaleaspectratio = -1;
- if (v == 2)
- workprefs.win32_rtgscaleaspectratio = 4 * 256 + 3;
- if (v == 3)
- workprefs.win32_rtgscaleaspectratio = 5 * 256 + 4;
- if (v == 4)
- workprefs.win32_rtgscaleaspectratio = 15 * 256 + 9;
- if (v == 5)
- workprefs.win32_rtgscaleaspectratio = 16 * 256 + 9;
- if (v == 6)
- workprefs.win32_rtgscaleaspectratio = 16 * 256 + 10;
+ else if (v >= 2)
+ workprefs.win32_rtgscaleaspectratio = getaspectratio (v - 2);
}
break;
case IDC_RTG_Z2Z3:
SendDlgItemMessage (hDlg, IDC_FILTERASPECT, CB_SETCURSEL,
(workprefs.gfx_filter_aspect == 0) ? 0 :
(workprefs.gfx_filter_aspect < 0) ? 1 :
- (workprefs.gfx_filter_aspect == 4 * 256 + 3) ? 2 :
- (workprefs.gfx_filter_aspect == 5 * 256 + 4) ? 3 :
- (workprefs.gfx_filter_aspect == 15 * 256 + 9) ? 4 :
- (workprefs.gfx_filter_aspect == 16 * 256 + 9) ? 5 :
- (workprefs.gfx_filter_aspect == 16 * 256 + 10) ? 6 : 0, 0);
+ getaspectratioindex (workprefs.gfx_filter_aspect) + 2, 0);
CheckDlgButton (hDlg, IDC_FILTERKEEPASPECT, workprefs.gfx_filter_keep_aspect);
CheckDlgButton (hDlg, IDC_FILTERKEEPAUTOSCALEASPECT, workprefs.gfx_filter_keep_autoscale_aspect != 0);
SendDlgItemMessage (hDlg, IDC_FILTERASPECT, CB_ADDSTRING, 0, (LPARAM)tmp);
WIN32GUI_LoadUIString (IDS_AUTOMATIC, tmp, sizeof tmp / sizeof (TCHAR));
SendDlgItemMessage (hDlg, IDC_FILTERASPECT, CB_ADDSTRING, 0, (LPARAM)tmp);
- SendDlgItemMessage (hDlg, IDC_FILTERASPECT, CB_ADDSTRING, 0, (LPARAM)_T("4:3"));
- SendDlgItemMessage (hDlg, IDC_FILTERASPECT, CB_ADDSTRING, 0, (LPARAM)_T("5:4"));
- SendDlgItemMessage (hDlg, IDC_FILTERASPECT, CB_ADDSTRING, 0, (LPARAM)_T("15:9"));
- SendDlgItemMessage (hDlg, IDC_FILTERASPECT, CB_ADDSTRING, 0, (LPARAM)_T("16:9"));
- SendDlgItemMessage (hDlg, IDC_FILTERASPECT, CB_ADDSTRING, 0, (LPARAM)_T("16:10"));
+ addaspectratios (hDlg, IDC_FILTERASPECT);
SendDlgItemMessage (hDlg, IDC_FILTERASPECT2, CB_RESETCONTENT, 0, 0);
WIN32GUI_LoadUIString (IDS_DISABLED, tmp, sizeof tmp / sizeof (TCHAR));
if (v != CB_ERR) {
if (v == 0)
v2 = 0;
- if (v == 1)
+ else if (v == 1)
v2 = -1;
- if (v == 2)
- v2 = 4 * 256 + 3;
- if (v == 3)
- v2 = 5 * 256 + 4;
- if (v == 4)
- v2 = 15 * 256 + 9;
- if (v == 5)
- v2 = 16 * 256 + 9;
- if (v == 6)
- v2 = 16 * 256 + 10;
+ else if (v >= 2)
+ v2 = getaspectratio (v - 2);
}
currprefs.gfx_filter_aspect = workprefs.gfx_filter_aspect = v2;
updatedisplayarea ();
- restore only single input target to default.
+Beta 17:
+
+- One more IDE emulation fix, bogus extra write interrupt removed (I think this was accidentally introduced in some recent
+ update). For some reason all tested drivers seemed to ignore it but it also could have caused data corruption in worst case.
+- Added support for very large resolutions (NV Surround/AMD Eyefinity), max is now 8192x8192 (from 3072x2048)
+ (I now have 3xVG248QE in portrait surround, 2d lightboost mode, GTX680 SLI. Debezeling still to do..)
+- Display panel GUI didn't accept new selected resolution if previously loaded config had non-existing resolution.
+- B16 didn't fix all glitches, yet another fix attempt. (Mindriot/Andromeda and more)
+- Fixed sprite priorities in HAM mode (Thanks to Paradroid for this and right edge overscan test case)
+- Added some uncommon aspect ratios to GUI aspect ratio select menus.
+- Added new config entry "chipset_hacks" that is used to enable emulation of not fully known chipset features or bugs.
+ Bit 0 = emulate COPJMP/Blitter cycle conflict (Blitter DMA channel gets loaded with Copper address)
+ Bit 1 = emulate strange right edge overscan display shift if lores bitplane and scroll value is greater than 7.
+ DO NOT enable in your default configuration, these are not fully emulated and can and will break other programs!
+
Beta 16:
This beta should fix all strange display glitches introduced in previous 2.6 betas.