} else {
for (i = 0; i < 4; i++) {
+ int j = i;
if (currprefs.catweasel > 0)
- i = currprefs.catweasel;
+ j = currprefs.catweasel + i;
if (currprefs.catweasel < 0)
- i = -currprefs.catweasel + 1;
- _stprintf (name, _T("\\\\.\\CAT%d_F0"), i);
+ j = -currprefs.catweasel + 1 + i;
+ _stprintf (name, _T("\\\\.\\CAT%d_F0"), j);
handle = CreateFile (name, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_WRITE|FILE_SHARE_READ, 0,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
- if (handle != INVALID_HANDLE_VALUE || currprefs.catweasel > 0)
+ if (handle != INVALID_HANDLE_VALUE || currprefs.catweasel)
break;
}
if (handle == INVALID_HANDLE_VALUE)
#define UNEXPANDED _T("$(FILE_PATH)")
+static TCHAR *cfgfile_option_find_it(const TCHAR *s, const TCHAR *option, bool checkequals)
+{
+ TCHAR buf[MAX_DPATH];
+ if (!s)
+ return NULL;
+ _tcscpy(buf, s);
+ _tcscat(buf, _T(","));
+ TCHAR *p = buf;
+ for (;;) {
+ TCHAR *tmpp = _tcschr(p, ',');
+ TCHAR *tmpp2 = NULL;
+ if (tmpp == NULL)
+ return NULL;
+ *tmpp++ = 0;
+ if (checkequals) {
+ tmpp2 = _tcschr(p, '=');
+ if (!tmpp2)
+ return NULL;
+ *tmpp2++ = 0;
+ }
+ if (!strcasecmp(p, option)) {
+ if (checkequals)
+ return tmpp2;
+ return p;
+ }
+ p = tmpp;
+ }
+}
+
+static bool cfgfile_option_find(const TCHAR *s, const TCHAR *option)
+{
+ return cfgfile_option_find_it(s, option, false) != NULL;
+}
+
+static TCHAR *cfgfile_option_get(const TCHAR *s, const TCHAR *option)
+{
+ return cfgfile_option_find_it(s, option, true);
+}
static void trimwsa (char *s)
{
extras = _T("SASI");
} else if (ci->unit_feature_level == HD_LEVEL_SASI_ENHANCED) {
extras = _T("SASIE");
- } else if (ci->unit_feature_level == HD_LEVEL_OMTI) {
+ } else if (ci->unit_feature_level == HD_LEVEL_SASI_CHS) {
extras = _T("SASI_CHS");
}
} else if (ct >= HD_CONTROLLER_TYPE_IDE_FIRST && ct <= HD_CONTROLLER_TYPE_IDE_LAST) {
}
}
+static int cfgfile_read_rom_settings(const struct expansionboardsettings *ebs, const TCHAR *buf)
+{
+ int settings = 0;
+ int bitcnt = 0;
+ for (int i = 0; ebs[i].name; i++) {
+ const struct expansionboardsettings *eb = &ebs[i];
+ bitcnt += eb->bitshift;
+ if (eb->multiselect) {
+ int itemcnt = -1;
+ int itemfound = 0;
+ const TCHAR *p = eb->configname;
+ while (p[0]) {
+ if (itemcnt >= 0) {
+ if (cfgfile_option_find(buf, p)) {
+ itemfound = itemcnt;
+ }
+ }
+ itemcnt++;
+ p += _tcslen(p) + 1;
+ }
+ int cnt = 1;
+ int bits = 1;
+ for (int i = 7; i >= 0; i--) {
+ if (itemcnt & (1 << i)) {
+ cnt = 1 << i;
+ bits = i;
+ break;
+ }
+ }
+ int multimask = cnt - 1;
+ if (eb->invert)
+ itemfound ^= 0x7fffffff;
+ itemfound &= multimask;
+ settings |= itemfound << bitcnt;
+ bitcnt += bits;
+ } else {
+ int mask = 1 << bitcnt;
+ if (cfgfile_option_find(buf, eb->configname)) {
+ settings |= mask;
+ }
+ if (eb->invert)
+ settings ^= mask;
+ bitcnt++;
+ }
+ }
+ return settings;
+}
+
+static void cfgfile_write_rom_settings(const struct expansionboardsettings *ebs, TCHAR *buf, int settings)
+{
+ int bitcnt = 0;
+ for (int j = 0; ebs[j].name; j++) {
+ const struct expansionboardsettings *eb = &ebs[j];
+ bitcnt += eb->bitshift;
+ if (eb->multiselect) {
+ int itemcnt = -1;
+ const TCHAR *p = eb->configname;
+ while (p[0]) {
+ itemcnt++;
+ p += _tcslen(p) + 1;
+ }
+ int cnt = 1;
+ int bits = 1;
+ for (int i = 7; i >= 0; i--) {
+ if (itemcnt & (1 << i)) {
+ cnt = 1 << i;
+ bits = i;
+ break;
+ }
+ }
+ int multimask = cnt - 1;
+ int multivalue = settings;
+ if (eb->invert)
+ multivalue ^= 0x7fffffff;
+ multivalue = (multivalue >> bitcnt) & multimask;
+ p = eb->configname;
+ while (multivalue >= 0) {
+ multivalue--;
+ p += _tcslen(p) + 1;
+ }
+ if (buf[0])
+ _tcscat(buf, _T(","));
+ _tcscat(buf, p);
+ bitcnt += bits;
+ } else {
+ int value = settings;
+ if (eb->invert)
+ value ^= 0x7fffffff;
+ if (value & (1 << bitcnt)) {
+ if (buf[0])
+ _tcscat(buf, _T(","));
+ _tcscat(buf, eb->configname);
+ }
+ bitcnt++;
+ }
+ }
+}
+
static void cfgfile_write_board_rom(struct zfile *f, struct multipath *mp, struct boardromconfig *br)
{
TCHAR buf[256];
_tcscat(buf2, tmp);
}
if (br->roms[i].device_settings && ert->settings) {
- for (int j = 0; ert->settings[j].name; j++) {
- if (br->roms[i].device_settings & (1 << j)) {
- if (buf2[0])
- _tcscat(buf2, _T(","));
- _tcscat(buf2, ert->settings[j].configname);
- }
- }
+ cfgfile_write_rom_settings(ert->settings, buf2, br->roms[i].device_settings);
}
if (buf2[0])
cfgfile_dwrite_str (f, buf, buf2);
cfgfile_dwrite_str(f, _T("cpuboard_type"), cbst->configname);
if (cbs && p->cpuboard_settings) {
tmp[0] = 0;
- for (int i = 0; cbs[i].name; i++) {
- if (p->cpuboard_settings & (1 << i)) {
- if (tmp[0])
- _tcscat(tmp, _T(","));
- _tcscat(tmp, cbs[i].configname);
- }
- }
+ cfgfile_write_rom_settings(cbs, tmp, p->cpuboard_settings);
cfgfile_dwrite_str(f, _T("cpuboard_settings"), tmp);
}
} else {
return 1;
}
-static TCHAR *cfgfile_option_find_it(TCHAR *s, const TCHAR *option, bool checkequals)
-{
- TCHAR buf[MAX_DPATH];
- if (!s)
- return NULL;
- _tcscpy(buf, s);
- _tcscat(buf, _T(","));
- TCHAR *p = buf;
- for (;;) {
- TCHAR *tmpp = _tcschr (p, ',');
- TCHAR *tmpp2 = NULL;
- if (tmpp == NULL)
- return NULL;
- *tmpp++ = 0;
- if (checkequals) {
- tmpp2 = _tcschr(p, '=');
- if (!tmpp2)
- return NULL;
- *tmpp2++ = 0;
- }
- if (!strcasecmp(p, option)) {
- if (checkequals)
- return tmpp2;
- return p;
- }
- p = tmpp;
- }
-}
-
-static bool cfgfile_option_find(TCHAR *s, const TCHAR *option)
-{
- return cfgfile_option_find_it(s, option, false) != NULL;
-}
-
-static TCHAR *cfgfile_option_get(TCHAR *s, const TCHAR *option)
-{
- return cfgfile_option_find_it(s, option, true);
-}
-
static int cfgfile_option_select(TCHAR *s, const TCHAR *option, const TCHAR *select)
{
TCHAR buf[MAX_DPATH];
cunit++;
if (ctrl >= HD_CONTROLLER_TYPE_IDE_FIRST && ctrl <= HD_CONTROLLER_TYPE_IDE_LAST && cunit == 4)
return NULL;
- if (ctrl >= HD_CONTROLLER_TYPE_SCSI_FIRST && ctrl <= HD_CONTROLLER_TYPE_SCSI_LAST && cunit == 7)
+ if (ctrl >= HD_CONTROLLER_TYPE_SCSI_FIRST && ctrl <= HD_CONTROLLER_TYPE_SCSI_LAST && cunit >= 7)
return NULL;
}
}
if(_tcslen (hdc) >= 4 && !_tcsncmp (hdc, _T("ide"), 3)) {
hdcv = HD_CONTROLLER_TYPE_IDE_AUTO;
hdunit = hdc[3] - '0';
- if (hdunit < 0 || hdunit > 3)
+ if (hdunit < 0 || hdunit >= 4)
hdunit = 0;
} else if(_tcslen (hdc) >= 5 && !_tcsncmp (hdc, _T("scsi"), 4)) {
hdcv = HD_CONTROLLER_TYPE_SCSI_AUTO;
hdunit = hdc[4] - '0';
- if (hdunit < 0 || hdunit > 7)
+ if (hdunit < 0 || hdunit >= 8 + 2)
hdunit = 0;
}
if (hdcv > HD_CONTROLLER_TYPE_UAE) {
}
} else if (_tcslen (hdc) >= 6 && !_tcsncmp (hdc, _T("scsram"), 6)) {
hdcv = HD_CONTROLLER_TYPE_PCMCIA_SRAM;
+ hdunit = 0;
} else if (_tcslen (hdc) >= 5 && !_tcsncmp (hdc, _T("scide"), 6)) {
hdcv = HD_CONTROLLER_TYPE_PCMCIA_IDE;
+ hdunit = 0;
}
if (idx >= MAX_DUPLICATE_EXPANSION_BOARDS)
idx = MAX_DUPLICATE_EXPANSION_BOARDS - 1;
else if (cfgfile_option_find(tmpp2, _T("SASI")))
uci.unit_feature_level = HD_LEVEL_SASI;
else if (cfgfile_option_find(tmpp2, _T("SASI_CHS")))
- uci.unit_feature_level = HD_LEVEL_OMTI;
+ uci.unit_feature_level = HD_LEVEL_SASI_CHS;
else if (cfgfile_option_find(tmpp2, _T("ATA2+S")))
uci.unit_feature_level = HD_LEVEL_ATA_2S;
else if (cfgfile_option_find(tmpp2, _T("ATA2+")))
brc->roms[idx].autoboot_disabled = true;
}
if (ert->settings) {
- for (int k = 0; ert->settings[k].name; k++) {
- if (cfgfile_option_find(buf2, ert->settings[k].configname)) {
- brc->roms[idx].device_settings |= 1 << k;
- }
- }
+ brc->roms[idx].device_settings = cfgfile_read_rom_settings(ert->settings, buf2);
}
if (ert->id_jumper) {
TCHAR *p = cfgfile_option_get(buf2, _T("id"));
const struct expansionboardsettings *cbs = cbst->settings;
for(i = 0; cbs[i].name; i++) {
if (cfgfile_option_find(tmpbuf, cbs[i].configname)) {
- p->cpuboard_settings |= 1 << i;
+ p->cpuboard_settings |= 1 << (i + cbs[i].bitshift);
break;
}
}
toscr_delay[1] = (delay2 & delaymask) << toscr_res;
toscr_delay[1] |= shdelay2 >> (RES_MAX - toscr_res);
- // AGA subpixel scrolling in lores/hires modes
- toscr_delay_sh[0] = (shdelay1 & 3) >> toscr_res;
- toscr_delay_sh[1] = (shdelay2 & 3) >> toscr_res;
-
#if SPEEDUP
/* SPEEDUP code still needs this hack */
int delayoffset = fetchmode_size - (((bpl_hstart - (HARD_DDF_START_REAL + DDF_OFFSET)) & fetchstart_mask) << 1);
count = 0;
for (i = 0; i < MAX_SPRITES; i++) {
- int sprxp = (fmode & 0x8000) ? (spr[i].xpos & ~sscanmask) : spr[i].xpos;
+ int xpos = spr[i].xpos;
+ int sprxp = (fmode & 0x8000) ? (xpos & ~sscanmask) : xpos;
int hw_xp = sprxp >> sprite_buffer_res;
int pointx = usepointx && (sprctl[i] & sprite_sprctlmask) ? 0 : 1;
- if (spr[i].xpos < 0)
+ if (xpos < 0)
continue;
if (!((debug_sprite_mask & magic_sprite_mask) & (1 << i)))
if (! spr[i].armed)
continue;
-// if (sprxp > ((maxhpos * 2) << sprite_buffer_res))
-// write_log(_T("*"));
-
if (hw_xp > last_sprite_point && hw_xp <= point + pointx) {
add_sprite (&count, i, sprxp, posns, nrs);
}
if (hw_xp > last_sprite_point && hw_xp <= point + pointx) {
add_sprite (&count, MAX_SPRITES + i, sprxp, posns, nrs);
}
+ } else if (!(fmode & 0x80) && xpos >= 2 && xpos <= 9) {
+ // right border wrap around
+ sprxp += (maxhpos * 2) << sprite_buffer_res;
+ hw_xp = sprxp >> sprite_buffer_res;
+ if (hw_xp > last_sprite_point && hw_xp <= point + pointx) {
+ add_sprite(&count, MAX_SPRITES + i, sprxp, posns, nrs);
+ }
+ // (not really mutually exclusive of SSCAN2-bit but not worth the trouble)
}
}
BPLCON0_Denise (hpos, v, true);
}
+static void hack_bplcon2(void)
+{
+ // AGA subpixel scrolling in lores/hires modes
+ int shdelay1 = (bplcon1 >> 8) & 3;
+ int shdelay2 = (bplcon1 >> 12) & 3;
+ toscr_delay_sh[0] = (shdelay1 & 3) >> toscr_res;
+ toscr_delay_sh[1] = (shdelay2 & 3) >> toscr_res;
+ bplcon2 &= ~0xc000;
+ bplcon2 |= toscr_delay_sh[0] << 14;
+}
+
static void BPLCON1 (int hpos, uae_u16 v)
{
if (!(currprefs.chipset_mask & CSMASK_AGA))
decide_fetch_safe (hpos);
bplcon1_written = true;
bplcon1 = v;
+
+ if (currprefs.chipset_mask & CSMASK_AGA) {
+ int o0 = toscr_delay_sh[0];
+ int o1 = toscr_delay_sh[1];
+ hack_bplcon2();
+ if (toscr_delay_sh[0] != o0 || toscr_delay_sh[1] != o1) {
+ // HACK: Use BPLCON2 unused bits to store sh shift
+ record_register_change(hpos, 0x104, bplcon2);
+ }
+ }
}
static void BPLCON2(int hpos, uae_u16 v)
{
if (!(currprefs.chipset_mask & CSMASK_AGA))
v &= 0x7f;
- if (bplcon2 == v)
+ if ((bplcon2 & 0x3fff) == (v & 0x3fff))
return;
decide_line (hpos);
bplcon2 = v;
- record_register_change (hpos, 0x104, v);
+ if (currprefs.chipset_mask & CSMASK_AGA)
+ hack_bplcon2();
+ record_register_change (hpos, 0x104, bplcon2);
}
#ifdef ECS_DENISE
sprstartstop (s);
sprxp = (sprpos[num] & 0xFF) * 2 + (sprctl[num] & 1);
- if (!(fmode & 0x80) && sprxp >= 2 && sprxp <= 9) {
- // right border wrap around
- sprxp += maxhpos * 2;
- }
sprxp <<= sprite_buffer_res;
/* Quite a bit salad in this register... */
if (0) {
#include "driveclick.h"
#include "pci.h"
#include "pci_hw.h"
+#include "x86.h"
#ifdef RETROPLATFORM
#include "rp.h"
#endif
#ifdef WITH_PCI
pci_reset();
#endif
+#ifdef WITH_X86
+ x86_bridge_reset();
+#endif
#ifdef JIT
compemu_reset ();
#endif
#ifdef WITH_PCI
pci_hsync();
#endif
+#ifdef WITH_X86
+ x86_bridge_hsync();
+#endif
#ifdef WITH_TOCCATA
sndboard_hsync();
#endif
#ifdef WITH_PCI
pci_rethink();
#endif
+#ifdef WITH_X86
+ x86_bridge_rethink();
+#endif
#ifdef WITH_TOCCATA
sndboard_rethink();
#endif
#ifdef WITH_PCI
pci_free();
#endif
+#ifdef WITH_X86
+ x86_bridge_free();
+#endif
#ifdef FILESYS
filesys_cleanup ();
#endif
#include "specialmonitors.h"
extern int sprite_buffer_res;
-int lores_factor, lores_shift;
+static int lores_factor;
+int lores_shift;
+
+static void pfield_set_linetoscr(void);
int debug_bpl_mask = 0xff, debug_bpl_mask_one;
+static void lores_set(int lores)
+{
+ int old = lores;
+ lores_shift = lores;
+ if (lores_shift != old)
+ pfield_set_linetoscr();
+}
+
static void lores_reset (void)
{
lores_factor = currprefs.gfx_resolution ? 2 : 1;
- lores_shift = currprefs.gfx_resolution;
+ lores_set(currprefs.gfx_resolution);
if (doublescan > 0) {
if (lores_shift < 2)
lores_shift++;
lores_factor = 2;
+ lores_set(lores_shift);
}
sprite_buffer_res = currprefs.gfx_resolution;
if (doublescan > 0 && sprite_buffer_res < RES_SUPERHIRES)
uae_u8 stdata;
uae_u16 data;
};
-static struct spritepixelsbuf spritepixels[MAX_PIXELS_PER_LINE];
+static struct spritepixelsbuf spritepixels_buffer[MAX_PIXELS_PER_LINE];
+static struct spritepixelsbuf *spritepixels;
static int sprite_first_x, sprite_last_x;
#ifdef AGA
static int bplehb, bplham, bpldualpf, bpldualpfpri, bpldualpf2of, bplplanecnt, ecsshres;
static bool issprites;
static int bplres;
-static int plf1pri, plf2pri, bplxor;
+static int plf1pri, plf2pri, bplxor, bpldelay_sh;
+static bool enabled_sh;
static uae_u32 plf_sprite_mask;
static int sbasecol[2] = { 16, 16 };
static int hposblank;
return (blank || hposblank || colors_for_drawing.borderblank) ? 0 : colors_for_drawing.acolors[0];
}
+
+static void set_res_shift(int shift)
+{
+ int old = res_shift;
+ res_shift = shift;
+ if (res_shift != old)
+ pfield_set_linetoscr();
+}
+
/* Initialize the variables necessary for drawing a line.
* This involves setting up start/stop positions and display window
* borders. */
if (linetoscr_diw_end < linetoscr_diw_start)
linetoscr_diw_end = linetoscr_diw_start;
- res_shift = lores_shift - bplres;
+ set_res_shift(lores_shift - bplres);
playfield_start = linetoscr_diw_start;
playfield_end = linetoscr_diw_end;
return xcolors[scol];
}
-static int NOINLINE linetoscr_16_sh (int spix, int dpix, int stoppos, int spr)
+static int NOINLINE linetoscr_16_sh_func(int spix, int dpix, int stoppos, int spr)
{
uae_u16 *buf = (uae_u16 *) xlinebuffer;
}
return spix;
}
-static int NOINLINE linetoscr_32_sh (int spix, int dpix, int stoppos, int spr)
+static int linetoscr_16_sh_spr(int spix, int dpix, int stoppos)
+{
+ return linetoscr_16_sh_func(spix, dpix, stoppos, true);
+}
+static int linetoscr_16_sh(int spix, int dpix, int stoppos)
+{
+ return linetoscr_16_sh_func(spix, dpix, stoppos, false);
+}
+static int NOINLINE linetoscr_32_sh_func(int spix, int dpix, int stoppos, int spr)
{
uae_u32 *buf = (uae_u32 *) xlinebuffer;
}
return spix;
}
-static int NOINLINE linetoscr_32_shrink1_sh (int spix, int dpix, int stoppos, int spr)
+static int linetoscr_32_sh_spr(int spix, int dpix, int stoppos)
+{
+ return linetoscr_32_sh_func(spix, dpix, stoppos, true);
+}
+static int linetoscr_32_sh(int spix, int dpix, int stoppos)
+{
+ return linetoscr_32_sh_func(spix, dpix, stoppos, false);
+}
+static int NOINLINE linetoscr_32_shrink1_sh_func(int spix, int dpix, int stoppos, int spr)
{
uae_u32 *buf = (uae_u32 *) xlinebuffer;
}
return spix;
}
-static int NOINLINE linetoscr_32_shrink1f_sh (int spix, int dpix, int stoppos, int spr)
+static int linetoscr_32_shrink1_sh_spr(int spix, int dpix, int stoppos)
+{
+ return linetoscr_32_shrink1_sh_func(spix, dpix, stoppos, true);
+}
+static int linetoscr_32_shrink1_sh(int spix, int dpix, int stoppos)
+{
+ return linetoscr_32_shrink1_sh_func(spix, dpix, stoppos, false);
+}
+static int NOINLINE linetoscr_32_shrink1f_sh_func(int spix, int dpix, int stoppos, int spr)
{
uae_u32 *buf = (uae_u32 *) xlinebuffer;
}
return spix;
}
-static int NOINLINE linetoscr_16_shrink1_sh (int spix, int dpix, int stoppos, int spr)
+static int linetoscr_32_shrink1f_sh_spr(int spix, int dpix, int stoppos)
+{
+ return linetoscr_32_shrink1f_sh_func(spix, dpix, stoppos, true);
+}
+static int linetoscr_32_shrink1f_sh(int spix, int dpix, int stoppos)
+{
+ return linetoscr_32_shrink1f_sh_func(spix, dpix, stoppos, false);
+}
+static int NOINLINE linetoscr_16_shrink1_sh_func(int spix, int dpix, int stoppos, int spr)
{
uae_u16 *buf = (uae_u16 *) xlinebuffer;
}
return spix;
}
-static int NOINLINE linetoscr_16_shrink1f_sh (int spix, int dpix, int stoppos, int spr)
+static int linetoscr_16_shrink1_sh_spr(int spix, int dpix, int stoppos)
+{
+ return linetoscr_16_shrink1_sh_func(spix, dpix, stoppos, true);
+}
+static int linetoscr_16_shrink1_sh(int spix, int dpix, int stoppos)
+{
+ return linetoscr_16_shrink1_sh_func(spix, dpix, stoppos, false);
+}
+static int NOINLINE linetoscr_16_shrink1f_sh_func(int spix, int dpix, int stoppos, int spr)
{
uae_u16 *buf = (uae_u16 *) xlinebuffer;
}
return spix;
}
-
-static int NOINLINE linetoscr_32_shrink2_sh (int spix, int dpix, int stoppos, int spr)
+static int linetoscr_16_shrink1f_sh_spr(int spix, int dpix, int stoppos)
+{
+ return linetoscr_16_shrink1f_sh_func(spix, dpix, stoppos, true);
+}
+static int linetoscr_16_shrink1f_sh(int spix, int dpix, int stoppos)
+{
+ return linetoscr_16_shrink1f_sh_func(spix, dpix, stoppos, false);
+}
+static int NOINLINE linetoscr_32_shrink2_sh_func(int spix, int dpix, int stoppos, int spr)
{
uae_u32 *buf = (uae_u32 *) xlinebuffer;
}
return spix;
}
-static int NOINLINE linetoscr_32_shrink2f_sh (int spix, int dpix, int stoppos, int spr)
+static int linetoscr_32_shrink2_sh_spr(int spix, int dpix, int stoppos)
+{
+ return linetoscr_32_shrink2_sh_func(spix, dpix, stoppos, true);
+}
+static int linetoscr_32_shrink2_sh(int spix, int dpix, int stoppos)
+{
+ return linetoscr_32_shrink2_sh_func(spix, dpix, stoppos, false);
+}
+static int NOINLINE linetoscr_32_shrink2f_sh_func(int spix, int dpix, int stoppos, int spr)
{
uae_u32 *buf = (uae_u32 *) xlinebuffer;
}
return spix;
}
-static int NOINLINE linetoscr_16_shrink2_sh (int spix, int dpix, int stoppos, int spr)
+static int linetoscr_32_shrink2f_sh_spr(int spix, int dpix, int stoppos)
+{
+ return linetoscr_32_shrink2f_sh_func(spix, dpix, stoppos, true);
+}
+static int linetoscr_32_shrink2f_sh(int spix, int dpix, int stoppos)
+{
+ return linetoscr_32_shrink2f_sh_func(spix, dpix, stoppos, false);
+}
+static int NOINLINE linetoscr_16_shrink2_sh_func(int spix, int dpix, int stoppos, int spr)
{
uae_u16 *buf = (uae_u16 *) xlinebuffer;
}
return spix;
}
-static int NOINLINE linetoscr_16_shrink2f_sh (int spix, int dpix, int stoppos, int spr)
+static int linetoscr_16_shrink2_sh_spr(int spix, int dpix, int stoppos)
+{
+ return linetoscr_16_shrink2_sh_func(spix, dpix, stoppos, true);
+}
+static int linetoscr_16_shrink2_sh(int spix, int dpix, int stoppos)
+{
+ return linetoscr_16_shrink2_sh_func(spix, dpix, stoppos, false);
+}
+static int NOINLINE linetoscr_16_shrink2f_sh_func (int spix, int dpix, int stoppos, int spr)
{
uae_u16 *buf = (uae_u16 *) xlinebuffer;
}
return spix;
}
+static int linetoscr_16_shrink2f_sh_spr(int spix, int dpix, int stoppos)
+{
+ return linetoscr_16_shrink2f_sh_func(spix, dpix, stoppos, true);
+}
+static int linetoscr_16_shrink2f_sh(int spix, int dpix, int stoppos)
+{
+ return linetoscr_16_shrink2f_sh_func(spix, dpix, stoppos, false);
+}
#endif
-static void pfield_do_linetoscr (int start, int stop, bool blank)
+typedef int(*call_linetoscr)(int spix, int dpix, int dpix_end);
+
+static call_linetoscr pfield_do_linetoscr_normal;
+static call_linetoscr pfield_do_linetoscr_sprite;
+static call_linetoscr pfield_do_linetoscr_spriteonly;
+
+static void pfield_do_linetoscr(int start, int stop, bool blank)
+{
+ src_pixel = pfield_do_linetoscr_normal(src_pixel, start, stop);
+}
+static void pfield_do_linetoscr_spr(int start, int stop, bool blank)
+{
+ src_pixel = pfield_do_linetoscr_sprite(src_pixel, start, stop);
+}
+static int pfield_do_nothing(int a, int b, int c)
+{
+ return a;
+}
+
+/* AGA subpixel delay hack */
+static call_linetoscr pfield_do_linetoscr_shdelay_normal;
+static call_linetoscr pfield_do_linetoscr_shdelay_sprite;
+
+STATIC_INLINE int get_shdelay_add(void)
+{
+ if (bplres == RES_SUPERHIRES)
+ return 0;
+ int add = bpldelay_sh;
+ add >>= RES_MAX - currprefs.gfx_resolution;
+ return add;
+}
+static int pfield_do_linetoscr_normal_shdelay(int spix, int dpix, int dpix_end)
+{
+ int add = get_shdelay_add();
+ int add2 = add * gfxvidinfo.drawbuffer.pixbytes;
+ xlinebuffer += add2;
+ int out = pfield_do_linetoscr_shdelay_normal(spix, dpix, dpix_end);
+ xlinebuffer -= add2;
+ return out;
+}
+static int pfield_do_linetoscr_sprite_shdelay(int spix, int dpix, int dpix_end)
+{
+ int add = get_shdelay_add();
+ int add2 = add * gfxvidinfo.drawbuffer.pixbytes;
+ spritepixels -= add;
+ xlinebuffer += add2;
+ int out = pfield_do_linetoscr_shdelay_sprite(spix, dpix, dpix_end);
+ xlinebuffer -= add2;
+ spritepixels += add;
+ return out;
+}
+
+static void pfield_set_linetoscr (void)
{
xlinecheck(start, stop);
+ enabled_sh = false;
+ spritepixels = spritepixels_buffer;
+ pfield_do_linetoscr_spriteonly = pfield_do_nothing;
#ifdef AGA
- if (issprites && (currprefs.chipset_mask & CSMASK_AGA)) {
- if (need_genlock_data) {
- if (res_shift == 0) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_aga_spr_genlock(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_aga_spr_genlock(LTPARMS); break;
- }
- } else if (res_shift == 2) {
+ if (currprefs.chipset_mask & CSMASK_AGA) {
+ if (res_shift == 0) {
+ switch (gfxvidinfo.drawbuffer.pixbytes) {
+ case 2:
+ pfield_do_linetoscr_normal = need_genlock_data ? linetoscr_16_aga_genlock : linetoscr_16_aga;
+ pfield_do_linetoscr_sprite = need_genlock_data ? linetoscr_16_aga_spr_genlock : linetoscr_16_aga_spr;
+ pfield_do_linetoscr_spriteonly = linetoscr_16_aga_spronly;
+ break;
+ case 4:
+ pfield_do_linetoscr_normal = need_genlock_data ? linetoscr_32_aga_genlock : linetoscr_32_aga;
+ pfield_do_linetoscr_sprite = need_genlock_data ? linetoscr_32_aga_spr_genlock : linetoscr_32_aga_spr;
+ pfield_do_linetoscr_spriteonly = linetoscr_32_aga_spronly;
+ break;
+ }
+ } else if (res_shift == 2) {
+ switch (gfxvidinfo.drawbuffer.pixbytes) {
+ case 2:
+ pfield_do_linetoscr_normal = need_genlock_data ? linetoscr_16_stretch2_aga_genlock : linetoscr_16_stretch2_aga;
+ pfield_do_linetoscr_sprite = need_genlock_data ? linetoscr_16_stretch2_aga_spr_genlock : linetoscr_16_stretch2_aga_spr_genlock;
+ pfield_do_linetoscr_spriteonly = linetoscr_16_stretch2_aga_spronly;
+ break;
+ case 4:
+ pfield_do_linetoscr_normal = need_genlock_data ? linetoscr_32_stretch2_aga_genlock : linetoscr_32_stretch2_aga;
+ pfield_do_linetoscr_sprite = need_genlock_data ? linetoscr_32_stretch2_aga_spr_genlock : linetoscr_32_stretch2_aga_spr;
+ pfield_do_linetoscr_spriteonly = linetoscr_32_stretch2_aga_spronly;
+ break;
+ }
+ } else if (res_shift == 1) {
+ switch (gfxvidinfo.drawbuffer.pixbytes) {
+ case 2:
+ pfield_do_linetoscr_normal = need_genlock_data ? linetoscr_16_stretch1_aga_genlock : linetoscr_16_stretch1_aga;
+ pfield_do_linetoscr_sprite = need_genlock_data ? linetoscr_16_stretch1_aga_spr_genlock : linetoscr_16_stretch1_aga_spr;
+ pfield_do_linetoscr_spriteonly = linetoscr_16_stretch1_aga_spronly;
+ break;
+ case 4:
+ pfield_do_linetoscr_normal = need_genlock_data ? linetoscr_32_stretch1_aga_genlock : linetoscr_32_stretch1_aga;
+ pfield_do_linetoscr_sprite = need_genlock_data ? linetoscr_32_stretch1_aga_spr_genlock : linetoscr_32_stretch1_aga_spr;
+ pfield_do_linetoscr_spriteonly = linetoscr_32_stretch1_aga_spronly;
+ break;
+ }
+ } else if (res_shift == -1) {
+ if (currprefs.gfx_lores_mode) {
switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_stretch2_aga_spr_genlock(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_stretch2_aga_spr_genlock(LTPARMS); break;
+ case 2:
+ pfield_do_linetoscr_normal = need_genlock_data ? linetoscr_16_shrink1f_aga_genlock : linetoscr_16_shrink1f_aga;
+ pfield_do_linetoscr_sprite = need_genlock_data ? linetoscr_16_shrink1f_aga_spr_genlock : linetoscr_16_shrink1f_aga_spr;
+ pfield_do_linetoscr_spriteonly = linetoscr_16_shrink1f_aga_spronly;
+ break;
+ case 4:
+ pfield_do_linetoscr_normal = need_genlock_data ? linetoscr_32_shrink1f_aga_genlock : linetoscr_32_shrink1f_aga;
+ pfield_do_linetoscr_sprite = need_genlock_data ? linetoscr_32_shrink1f_aga_spr_genlock : linetoscr_32_shrink1f_aga_spr;
+ pfield_do_linetoscr_spriteonly = linetoscr_32_shrink1f_aga_spronly;
+ break;
}
- } else if (res_shift == 1) {
+ } else {
switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_stretch1_aga_spr_genlock(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_stretch1_aga_spr_genlock(LTPARMS); break;
- }
- } else if (res_shift == -1) {
- if (currprefs.gfx_lores_mode) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_shrink1f_aga_spr_genlock(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_shrink1f_aga_spr_genlock(LTPARMS); break;
- }
- } else {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_shrink1_aga_spr_genlock(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_shrink1_aga_spr_genlock(LTPARMS); break;
- }
- }
- } else if (res_shift == -2) {
- if (currprefs.gfx_lores_mode) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_shrink2f_aga_spr_genlock(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_shrink2f_aga_spr_genlock(LTPARMS); break;
- }
- } else {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_shrink2_aga_spr_genlock(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_shrink2_aga_spr_genlock(LTPARMS); break;
- }
+ case 2:
+ pfield_do_linetoscr_normal = need_genlock_data ? linetoscr_16_shrink1_aga_genlock : linetoscr_16_shrink1_aga;
+ pfield_do_linetoscr_sprite = need_genlock_data ? linetoscr_16_shrink1_aga_spr_genlock : linetoscr_16_shrink1_aga_spr;
+ pfield_do_linetoscr_spriteonly = linetoscr_16_shrink1_aga_spronly;
+ break;
+ case 4:
+ pfield_do_linetoscr_normal = need_genlock_data ? linetoscr_32_shrink1_aga_genlock : linetoscr_32_shrink1_aga;
+ pfield_do_linetoscr_sprite = need_genlock_data ? linetoscr_32_shrink1_aga_spr_genlock : linetoscr_32_shrink1_aga_spr;
+ pfield_do_linetoscr_spriteonly = linetoscr_32_shrink1_aga_spronly;
+ break;
}
}
- } else {
- if (res_shift == 0) {
+ } else if (res_shift == -2) {
+ if (currprefs.gfx_lores_mode) {
switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_aga_spr(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_aga_spr(LTPARMS); break;
+ case 2:
+ pfield_do_linetoscr_normal = need_genlock_data ? linetoscr_16_shrink2f_aga_genlock : linetoscr_16_shrink2f_aga;
+ pfield_do_linetoscr_sprite = need_genlock_data ? linetoscr_16_shrink2f_aga_spr_genlock : linetoscr_16_shrink2f_aga_spr;
+ pfield_do_linetoscr_spriteonly = linetoscr_16_shrink2f_aga_spronly;
+ break;
+ case 4:
+ pfield_do_linetoscr_normal = need_genlock_data ? linetoscr_32_shrink2f_aga_genlock : linetoscr_32_shrink2f_aga;
+ pfield_do_linetoscr_sprite = need_genlock_data ? linetoscr_32_shrink2f_aga_spr_genlock : linetoscr_32_shrink2f_aga_spr;
+ pfield_do_linetoscr_spriteonly = linetoscr_32_shrink2f_aga_spronly;
+ break;
}
- } else if (res_shift == 2) {
+ } else {
switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_stretch2_aga_spr(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_stretch2_aga_spr(LTPARMS); break;
+ case 2:
+ pfield_do_linetoscr_normal = need_genlock_data ? linetoscr_16_shrink2_aga_genlock : linetoscr_16_shrink2_aga;
+ pfield_do_linetoscr_sprite = need_genlock_data ? linetoscr_16_shrink2_aga_spr_genlock : linetoscr_16_shrink2_aga_spr;
+ pfield_do_linetoscr_spriteonly = linetoscr_16_shrink2_aga_spronly;
+ break;
+ case 4:
+ pfield_do_linetoscr_normal = need_genlock_data ? linetoscr_32_shrink2_aga_genlock : linetoscr_32_shrink2_aga;
+ pfield_do_linetoscr_sprite = need_genlock_data ? linetoscr_32_shrink2_aga_spr_genlock : linetoscr_32_shrink2_aga_spr;
+ pfield_do_linetoscr_spriteonly = linetoscr_32_shrink2_aga_spronly;
+ break;
}
- } else if (res_shift == 1) {
+ }
+ }
+ if (get_shdelay_add()) {
+ pfield_do_linetoscr_shdelay_normal = pfield_do_linetoscr_normal;
+ pfield_do_linetoscr_shdelay_sprite = pfield_do_linetoscr_sprite;
+ pfield_do_linetoscr_normal = pfield_do_linetoscr_normal_shdelay;
+ pfield_do_linetoscr_sprite = pfield_do_linetoscr_sprite_shdelay;
+ enabled_sh = true;
+ }
+ }
+#endif
+#ifdef ECS_DENISE
+ if (!(currprefs.chipset_mask & CSMASK_AGA) && ecsshres) {
+ // TODO: genlock support
+ if (res_shift == 0) {
+ switch (gfxvidinfo.drawbuffer.pixbytes) {
+ case 2:
+ pfield_do_linetoscr_normal = linetoscr_16_sh;
+ pfield_do_linetoscr_sprite = linetoscr_16_sh_spr;
+ break;
+ case 4:
+ pfield_do_linetoscr_normal = linetoscr_32_sh;
+ pfield_do_linetoscr_sprite = linetoscr_32_sh_spr;
+ break;
+ }
+ } else if (res_shift == -1) {
+ if (currprefs.gfx_lores_mode) {
switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_stretch1_aga_spr(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_stretch1_aga_spr(LTPARMS); break;
- }
- } else if (res_shift == -1) {
- if (currprefs.gfx_lores_mode) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_shrink1f_aga_spr(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_shrink1f_aga_spr(LTPARMS); break;
- }
- } else {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_shrink1_aga_spr(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_shrink1_aga_spr(LTPARMS); break;
- }
+ case 2:
+ pfield_do_linetoscr_normal = linetoscr_16_shrink1f_sh;
+ pfield_do_linetoscr_sprite = linetoscr_16_shrink1f_sh_spr;
+ break;
+ case 4:
+ pfield_do_linetoscr_normal = linetoscr_32_shrink1f_sh;
+ pfield_do_linetoscr_sprite = linetoscr_32_shrink1f_sh_spr;
+ break;
}
- } else if (res_shift == -2) {
- if (currprefs.gfx_lores_mode) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_shrink2f_aga_spr(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_shrink2f_aga_spr(LTPARMS); break;
- }
- } else {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_shrink2_aga_spr(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_shrink2_aga_spr(LTPARMS); break;
- }
+ } else {
+ switch (gfxvidinfo.drawbuffer.pixbytes) {
+ case 2:
+ pfield_do_linetoscr_normal = linetoscr_16_shrink1_sh;
+ pfield_do_linetoscr_sprite = linetoscr_16_shrink1_sh_spr;
+ break;
+ case 4:
+ pfield_do_linetoscr_normal = linetoscr_32_shrink1_sh;
+ pfield_do_linetoscr_sprite = linetoscr_32_shrink1_sh_spr;
+ break;
}
}
- }
- } else {
- if (currprefs.chipset_mask & CSMASK_AGA) {
- if (need_genlock_data) {
- if (res_shift == 0) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_aga_genlock(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_aga_genlock(LTPARMS); break;
- }
- } else if (res_shift == 2) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_stretch2_aga_genlock(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_stretch2_aga_genlock(LTPARMS); break;
- }
- } else if (res_shift == 1) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_stretch1_aga_genlock(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_stretch1_aga_genlock(LTPARMS); break;
- }
- } else if (res_shift == -1) {
- if (currprefs.gfx_lores_mode) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_shrink1f_aga_genlock(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_shrink1f_aga_genlock(LTPARMS); break;
- }
- } else {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_shrink1_aga_genlock(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_shrink1_aga_genlock(LTPARMS); break;
- }
- }
- } else if (res_shift == -2) {
- if (currprefs.gfx_lores_mode) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_shrink2f_aga_genlock(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_shrink2f_aga_genlock(LTPARMS); break;
- }
- } else {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_shrink2_aga_genlock(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_shrink2_aga_genlock(LTPARMS); break;
- }
- }
+ } else if (res_shift == -2) {
+ if (currprefs.gfx_lores_mode) {
+ switch (gfxvidinfo.drawbuffer.pixbytes) {
+ case 2:
+ pfield_do_linetoscr_normal = linetoscr_16_shrink2f_sh;
+ pfield_do_linetoscr_sprite = linetoscr_16_shrink2f_sh_spr;
+ break;
+ case 4:
+ pfield_do_linetoscr_normal = linetoscr_32_shrink2f_sh;
+ pfield_do_linetoscr_sprite = linetoscr_32_shrink2f_sh_spr;
+ break;
}
} else {
- if (res_shift == 0) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_aga(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_aga(LTPARMS); break;
- }
- } else if (res_shift == 2) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_stretch2_aga(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_stretch2_aga(LTPARMS); break;
- }
- } else if (res_shift == 1) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_stretch1_aga(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_stretch1_aga(LTPARMS); break;
- }
- } else if (res_shift == -1) {
- if (currprefs.gfx_lores_mode) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_shrink1f_aga(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_shrink1f_aga(LTPARMS); break;
- }
- } else {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_shrink1_aga(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_shrink1_aga(LTPARMS); break;
- }
- }
- } else if (res_shift == -2) {
- if (currprefs.gfx_lores_mode) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_shrink2f_aga(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_shrink2f_aga(LTPARMS); break;
- }
- } else {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_shrink2_aga(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_shrink2_aga(LTPARMS); break;
- }
- }
+ switch (gfxvidinfo.drawbuffer.pixbytes) {
+ case 2:
+ pfield_do_linetoscr_normal = linetoscr_16_shrink2_sh;
+ pfield_do_linetoscr_sprite = linetoscr_16_shrink2_sh_spr;
+ break;
+ case 4:
+ pfield_do_linetoscr_normal = linetoscr_32_shrink2_sh;
+ pfield_do_linetoscr_sprite = linetoscr_32_shrink2_sh_spr;
+ break;
}
}
- } else
+ }
+ }
#endif
-#ifdef ECS_DENISE
- if (ecsshres) {
- if (res_shift == 0) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_sh(LTPARMS, issprites); break;
- case 4: src_pixel = linetoscr_32_sh(LTPARMS, issprites); break;
- }
- } else if (res_shift == -1) {
- if (currprefs.gfx_lores_mode) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_shrink1f_sh(LTPARMS, issprites); break;
- case 4: src_pixel = linetoscr_32_shrink1f_sh(LTPARMS, issprites); break;
- }
- } else {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_shrink1_sh(LTPARMS, issprites); break;
- case 4: src_pixel = linetoscr_32_shrink1_sh(LTPARMS, issprites); break;
- }
- }
- } else if (res_shift == -2) {
- if (currprefs.gfx_lores_mode) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_shrink2f_sh(LTPARMS, issprites); break;
- case 4: src_pixel = linetoscr_32_shrink2f_sh(LTPARMS, issprites); break;
- }
- } else {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_shrink2_sh(LTPARMS, issprites); break;
- case 4: src_pixel = linetoscr_32_shrink2_sh(LTPARMS, issprites); break;
- }
- }
+ if (!(currprefs.chipset_mask & CSMASK_AGA) && !ecsshres) {
+ if (res_shift == 0) {
+ switch (gfxvidinfo.drawbuffer.pixbytes) {
+ case 2:
+ pfield_do_linetoscr_normal = need_genlock_data ? linetoscr_16_genlock : linetoscr_16;
+ pfield_do_linetoscr_sprite = need_genlock_data ? linetoscr_16_spr_genlock : linetoscr_16_spr;
+ break;
+ case 4:
+ pfield_do_linetoscr_normal = need_genlock_data ? linetoscr_32_genlock : linetoscr_32;
+ pfield_do_linetoscr_sprite = need_genlock_data ? linetoscr_32_spr_genlock : linetoscr_32_spr;
+ break;
+ }
+ } else if (res_shift == 2) {
+ switch (gfxvidinfo.drawbuffer.pixbytes) {
+ case 2:
+ pfield_do_linetoscr_normal = need_genlock_data ? linetoscr_16_stretch2_genlock : linetoscr_16_stretch2;
+ pfield_do_linetoscr_sprite = need_genlock_data ? linetoscr_16_stretch2_spr_genlock : linetoscr_16_stretch2_spr;
+ break;
+ case 4:
+ pfield_do_linetoscr_normal = need_genlock_data ? linetoscr_32_stretch2_genlock : linetoscr_32_stretch2;
+ pfield_do_linetoscr_sprite = need_genlock_data ? linetoscr_32_stretch2_spr_genlock : linetoscr_32_stretch2_spr;
+ break;
+ }
+ } else if (res_shift == 1) {
+ switch (gfxvidinfo.drawbuffer.pixbytes) {
+ case 2:
+ pfield_do_linetoscr_normal = need_genlock_data ? linetoscr_16_stretch1_genlock : linetoscr_16_stretch1;
+ pfield_do_linetoscr_sprite = need_genlock_data ? linetoscr_16_stretch1_spr_genlock : linetoscr_16_stretch1_spr;
+ break;
+ case 4:
+ pfield_do_linetoscr_normal = need_genlock_data ? linetoscr_32_stretch1_genlock : linetoscr_32_stretch1;
+ pfield_do_linetoscr_sprite = need_genlock_data ? linetoscr_32_stretch1_spr_genlock : linetoscr_32_stretch1_spr;
+ break;
+ }
+ } else if (res_shift == -1) {
+ if (currprefs.gfx_lores_mode) {
+ switch (gfxvidinfo.drawbuffer.pixbytes) {
+ case 2:
+ pfield_do_linetoscr_normal = need_genlock_data ? linetoscr_16_shrink1f_genlock : linetoscr_16_shrink1f;
+ pfield_do_linetoscr_sprite = need_genlock_data ? linetoscr_16_shrink1f_spr_genlock : linetoscr_16_shrink1f_spr;
+ break;
+ case 4:
+ pfield_do_linetoscr_normal = need_genlock_data ? linetoscr_32_shrink1f_genlock : linetoscr_32_shrink1f;
+ pfield_do_linetoscr_sprite = need_genlock_data ? linetoscr_32_shrink1f_spr_genlock : linetoscr_32_shrink1f_spr;
+ break;
}
} else {
-#endif
- if (issprites) {
- if (need_genlock_data) {
- if (res_shift == 0) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_spr_genlock(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_spr_genlock(LTPARMS); break;
- }
- } else if (res_shift == 2) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_stretch2_spr_genlock(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_stretch2_spr_genlock(LTPARMS); break;
- }
- } else if (res_shift == 1) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_stretch1_spr_genlock(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_stretch1_spr_genlock(LTPARMS); break;
- }
- } else if (res_shift == -1) {
- if (currprefs.gfx_lores_mode) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_shrink1f_spr_genlock(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_shrink1f_spr_genlock(LTPARMS); break;
- }
- } else {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_shrink1_spr_genlock(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_shrink1_spr_genlock(LTPARMS); break;
- }
- }
- }
- } else {
- if (res_shift == 0) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_spr(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_spr(LTPARMS); break;
- }
- } else if (res_shift == 2) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_stretch2_spr(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_stretch2_spr(LTPARMS); break;
- }
- } else if (res_shift == 1) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_stretch1_spr(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_stretch1_spr(LTPARMS); break;
- }
- } else if (res_shift == -1) {
- if (currprefs.gfx_lores_mode) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_shrink1f_spr(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_shrink1f_spr(LTPARMS); break;
- }
- } else {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_shrink1_spr(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_shrink1_spr(LTPARMS); break;
- }
- }
- }
- }
- } else {
- if (need_genlock_data) {
- if (res_shift == 0) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_genlock(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_genlock(LTPARMS); break;
- }
- } else if (res_shift == 2) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_stretch2_genlock(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_stretch2_genlock(LTPARMS); break;
- }
- } else if (res_shift == 1) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_stretch1_genlock(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_stretch1_genlock(LTPARMS); break;
- }
- } else if (res_shift == -1) {
- if (currprefs.gfx_lores_mode) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_shrink1f_genlock(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_shrink1f_genlock(LTPARMS); break;
- }
- } else {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_shrink1_genlock(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_shrink1_genlock(LTPARMS); break;
- }
- }
- }
- } else {
- if (res_shift == 0) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16(LTPARMS); break;
- case 4: src_pixel = linetoscr_32(LTPARMS); break;
- }
- } else if (res_shift == 2) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_stretch2(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_stretch2(LTPARMS); break;
- }
- } else if (res_shift == 1) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_stretch1(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_stretch1(LTPARMS); break;
- }
- } else if (res_shift == -1) {
- if (currprefs.gfx_lores_mode) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_shrink1f(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_shrink1f(LTPARMS); break;
- }
- } else {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_shrink1(LTPARMS); break;
- case 4: src_pixel = linetoscr_32_shrink1(LTPARMS); break;
- }
- }
- }
- }
+ switch (gfxvidinfo.drawbuffer.pixbytes) {
+ case 2:
+ pfield_do_linetoscr_normal = need_genlock_data ? linetoscr_16_shrink1_genlock : linetoscr_16_shrink1;
+ pfield_do_linetoscr_sprite = need_genlock_data ? linetoscr_16_shrink1_spr_genlock : linetoscr_16_shrink1_spr;
+ break;
+ case 4:
+ pfield_do_linetoscr_normal = need_genlock_data ? linetoscr_32_shrink1_genlock : linetoscr_32_shrink1;
+ pfield_do_linetoscr_sprite = need_genlock_data ? linetoscr_32_shrink1_spr_genlock : linetoscr_32_shrink1_spr;
+ break;
}
}
}
+ }
}
// left or right AGA border sprite
pfield_do_fill_line (start, stop, blank);
return;
}
-
- if (res_shift == 0) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_aga_spronly (LTPARMS); break;
- case 4: src_pixel = linetoscr_32_aga_spronly (LTPARMS); break;
- }
- } else if (res_shift == 2) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_stretch2_aga_spronly (LTPARMS); break;
- case 4: src_pixel = linetoscr_32_stretch2_aga_spronly (LTPARMS); break;
- }
- } else if (res_shift == 1) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_stretch1_aga_spronly (LTPARMS); break;
- case 4: src_pixel = linetoscr_32_stretch1_aga_spronly (LTPARMS); break;
- }
- } else if (res_shift == -1) {
- if (currprefs.gfx_lores_mode) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_shrink1f_aga_spronly (LTPARMS); break;
- case 4: src_pixel = linetoscr_32_shrink1f_aga_spronly (LTPARMS); break;
- }
- } else {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_shrink1_aga_spronly (LTPARMS); break;
- case 4: src_pixel = linetoscr_32_shrink1_aga_spronly (LTPARMS); break;
- }
- }
- } else if (res_shift == -2) {
- if (currprefs.gfx_lores_mode) {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_shrink2f_aga_spronly (LTPARMS); break;
- case 4: src_pixel = linetoscr_32_shrink2f_aga_spronly (LTPARMS); break;
- }
- } else {
- switch (gfxvidinfo.drawbuffer.pixbytes) {
- case 2: src_pixel = linetoscr_16_shrink2_aga_spronly (LTPARMS); break;
- case 4: src_pixel = linetoscr_32_shrink2_aga_spronly (LTPARMS); break;
- }
- }
- }
+ src_pixel = pfield_do_linetoscr_spriteonly(src_pixel, start, stop);
}
static void dummy_worker (int start, int stop, bool blank)
* form. */
static void pfield_expand_dp_bplcon (void)
{
+ bool pfield_mode_changed = false;
+
bplres = dp_for_drawing->bplres;
bplplanecnt = dp_for_drawing->nr_planes;
bplham = dp_for_drawing->ham_seen;
bplehb = 0;
issprites = dip_for_drawing->nr_sprites > 0;
#ifdef ECS_DENISE
+ int oecsshres = ecsshres;
ecsshres = bplres == RES_SUPERHIRES && (currprefs.chipset_mask & CSMASK_ECS_DENISE) && !(currprefs.chipset_mask & CSMASK_AGA);
+ pfield_mode_changed = oecsshres != ecsshres;
#endif
plf1pri = dp_for_drawing->bplcon2 & 7;
sbasecol[0] = ((dp_for_drawing->bplcon4 >> 4) & 15) << 4;
sbasecol[1] = ((dp_for_drawing->bplcon4 >> 0) & 15) << 4;
bplxor = dp_for_drawing->bplcon4 >> 8;
+ int obpldelay_sh = bpldelay_sh;
+ bpldelay_sh = dp_for_drawing->bplcon2 >> 14;
+ if ((bpldelay_sh && !obpldelay_sh) || (!bpldelay_sh && obpldelay_sh))
+ pfield_mode_changed = true;
#endif
ecs_genlock_features_active = (currprefs.chipset_mask & CSMASK_ECS_DENISE) && ((dp_for_drawing->bplcon2 & 0x0c00) || colors_for_drawing.borderntrans) ? 1 : 0;
if (ecs_genlock_features_active) {
ecs_genlock_features_colorkey = true;
}
}
+ if (pfield_mode_changed)
+ pfield_set_linetoscr();
}
static bool isham (uae_u16 bplcon0)
#endif
}
pfield_expand_dp_bplcon ();
- res_shift = lores_shift - bplres;
+ set_res_shift(lores_shift - bplres);
}
static int drawing_color_matches;
#ifdef AGA
if (dip_for_drawing->nr_sprites && colors_for_drawing.bordersprite && !colors_for_drawing.borderblank && dp_for_drawing->bordersprite_seen)
- do_color_changes (pfield_do_linetoscr_bordersprite_aga, pfield_do_linetoscr, lineno);
+ do_color_changes (pfield_do_linetoscr_bordersprite_aga, pfield_do_linetoscr_spr, lineno);
else
#endif
- do_color_changes (pfield_do_fill_line, pfield_do_linetoscr, lineno);
+ do_color_changes (pfield_do_fill_line, dip_for_drawing->nr_sprites ? pfield_do_linetoscr_spr : pfield_do_linetoscr, lineno);
if (dh == dh_emerg)
memcpy (row_map[gfx_ypos], xlinebuffer + linetoscr_x_adjust_pixbytes, gfxvidinfo.drawbuffer.pixbytes * gfxvidinfo.drawbuffer.inwidth);
if (can_use_lores > AUTO_LORES_FRAMES && 0) {
lores_factor = 1;
- lores_shift = 0;
+ lores_set(0);
} else {
can_use_lores++;
- lores_reset ();
+ lores_reset();
}
init_hardware_for_drawing_frame ();
compute_framesync();
}
specialmonitoron = true;
+ pfield_set_linetoscr();
do_flush_screen (vb, 0, vb->outheight);
didflush = true;
} else {
+ pfield_set_linetoscr();
need_genlock_data = false;
if (specialmonitoron || gfxvidinfo.drawbuffer.tempbufferinuse) {
gfxvidinfo.drawbuffer.tempbufferinuse = false;
}
if (currprefs.genlock_image && !currprefs.monitoremu && gfxvidinfo.tempbuffer.bufmem_allocated && currprefs.genlock) {
+ pfield_set_linetoscr();
setspecialmonitorpos(&gfxvidinfo.tempbuffer);
if (init_genlock_data != specialmonitor_need_genlock()) {
need_genlock_data = init_genlock_data = specialmonitor_need_genlock();
memset (&spixstate, 0, sizeof spixstate);
init_drawing_frame ();
+ pfield_set_linetoscr();
notice_screen_contents_lost ();
frame_res_cnt = currprefs.gfx_autoresolution_delay;
}
return;
}
- // real Amiga softlinks would accept invalid paths too,
- // we won't.
+ // real Amiga softlinks would accept invalid paths too, we won't.
PUT_PCK_RES1 (packet, DOS_FALSE);
PUT_PCK_RES2 (packet, ERROR_OBJECT_NOT_AROUND);
}
if (!a->softlink)
err = ERROR_OBJECT_WRONG_TYPE;
if (err != 0) {
+ xfree(extrapath);
PUT_PCK_RES1 (packet, DOS_FALSE);
PUT_PCK_RES2 (packet, err);
return;
_tcscpy (tmp, a->nname);
write_log (_T("Resolving softlink '%s'\n"), tmp);
if (!my_resolvesoftlink (tmp, sizeof tmp / sizeof (TCHAR))) {
+ xfree(extrapath);
PUT_PCK_RES1 (packet, DOS_FALSE);
// not sure what to return
PUT_PCK_RES2 (packet, ERROR_OBJECT_NOT_AROUND);
}
}
if (!matched_aino) {
+ xfree(extrapath);
write_log (_T("Path not found in any mounted drive\n"));
PUT_PCK_RES1 (packet, DOS_FALSE);
PUT_PCK_RES2 (packet, ERROR_OBJECT_NOT_AROUND);
sync_m68k_pc ();
printf ("\tException (src + 32);\n");
did_prefetch = 1;
- branch_inst = 2;
clear_m68k_offset();
break;
case i_MVR2USP:
static uae_u64 get_scsi_6_offset(struct hardfiledata *hfd, struct hd_hardfiledata *hdhfd, uae_u8 *cmdbuf)
{
- bool omti = hfd->ci.unit_feature_level == HD_LEVEL_OMTI;
+ bool omti = hfd->ci.unit_feature_level == HD_LEVEL_SASI_CHS;
uae_u64 offset;
if (omti) {
int cyl, cylsec, head, tracksec;
uae_u8 cmd = cmdbuf[0];
bool sasi = hfd->ci.unit_feature_level >= HD_LEVEL_SASI && hfd->ci.unit_feature_level <= HD_LEVEL_SASI_ENHANCED;
bool sasie = hfd->ci.unit_feature_level == HD_LEVEL_SASI_ENHANCED;
- bool omti = hfd->ci.unit_feature_level == HD_LEVEL_OMTI;
+ bool omti = hfd->ci.unit_feature_level == HD_LEVEL_SASI_CHS;
if (log_scsiemu) {
write_log (_T("SCSIEMU HD %d: %02X.%02X.%02X.%02X.%02X.%02X.%02X.%02X.%02X.%02X.%02X.%02X CMDLEN=%d DATA=%p\n"), hfd->unitnum,
goto scsi_done;
case 0x0c: /* INITIALIZE DRIVE CHARACTERISTICS */
scsi_len = 8;
+ write_log(_T("INITIALIZE DRIVE CHARACTERISTICS: "));
+ write_log(_T("Heads: %d Cyls: %d Secs: %d\n"),
+ (scsi_data[1] >> 4) | ((scsi_data[0] & 0xc0) << 4),
+ ((scsi_data[1] & 15) << 8) | (scsi_data[2]),
+ scsi_data[5]);
+ for (int i = 0; i < 8; i++) {
+ write_log(_T("%02X "), scsi_data[i]);
+ }
+ write_log(_T("\n"));
goto scsi_done;
case 0x12: /* INQUIRY */
{
uae_u8 c8727_pcss;
uae_u8 c8727_ctl;
+ uae_u8 c8727_wrcbp;
+ uae_u16 c8727_st506_cb;
};
struct gvp_dmac
{
smp_comm_pipe requests;
volatile int scsi_thread_running;
- // unit 7 = XT
- struct scsi_data *scsis[8];
+ // unit 8,9 = ST-506 (A2090)
+ // unit 8 = XT (A2091)
+ struct scsi_data *scsis[8 + 2];
bool cdtv;
#define min_diwlastword (0)
#define max_diwlastword (PIXEL_XPOS(0x1d4 >> 1))
-extern int lores_factor, lores_shift, interlace_seen;
+extern int lores_shift, interlace_seen;
extern bool aga_mode, direct_rgb;
extern int visible_left_border, visible_right_border;
#define HD_LEVEL_SCSI_2 1
#define HD_LEVEL_SASI 2
#define HD_LEVEL_SASI_ENHANCED 2
-#define HD_LEVEL_OMTI 3
+#define HD_LEVEL_SASI_CHS 3
#define HD_LEVEL_ATA_1 0
#define HD_LEVEL_ATA_2 1
error_log(_T("CD32 MPEG module overlay support require at least null filter enabled."));
prefs->gf[i].gfx_filter = 1;
}
+ if (prefs->gf[i].gfx_filter == 0 && (prefs->genlock && prefs->genlock_image)) {
+ error_log(_T("Genlock emulation require at least null filter enabled."));
+ prefs->gf[i].gfx_filter = 1;
+ }
}
}
}
write_log(_T("Opcode %04x has no size PC=%08x!\n"), w, pc);
}
#endif
+ // illegal instructions, TRAP, TRAPV, A-line, F-line don't stop prefetches
int branch = cpudatatbl[w].branch;
if (regs.pipeline_pos > 0 && branch) {
// Short branches (Bcc.s) still do one more prefetch.
#define IDC_ROMFILE2 1394
#define IDC_SCSIROMSELECTCAT 1394
#define IDC_ROMCHOOSER2 1395
+#define IDC_EXPANSIONBOARDITEMSELECTOR 1395
#define IDC_FLASHCHOOSER 1396
+#define IDC_EXPANSIONBOARDSELECTOR 1396
#define IDC_FLASHFILE 1397
+#define IDC_ACCELERATORBOARDITEMSELECTOR 1397
#define IDC_CARTFILE 1398
+#define IDC_ACCELERATORBOARDSELECTOR 1398
#define IDC_CARTCHOOSER 1399
#define IDC_SAVE 1400
#define IDC_CPUBOARDROMSUBSELECT 1400
#define IDC_AVIOUTPUT_VIDEO 1613
#define IDC_INPUTAUTOFIRE 1613
#define IDC_PORT_MOUSETRICK 1613
+#define IDC_EXPANSIONBOARDCHECKBOX 1613
#define IDC_AVIOUTPUT_AUDIO 1614
#define IDC_INPUTCOPYFROM 1614
#define IDC_SANA2 1614
#define IDC_NE2000 1616
#define IDC_AVIOUTPUT_BORDER_TRIM 1617
#define IDC_FILTERVZ 1617
+#define IDC_ACCELERATORBOARDCHECKBOX 1617
#define IDC_AVIOUTPUT_AUDIO_STATIC 1618
#define IDC_FILTERHO 1618
#define IDC_AVIOUTPUT_VIDEO_STATIC 1619
#define IDC_CPUBOARDMEM 1843
#define IDC_Z3MAPPING 1844
#define IDC_CPUBOARD_SUBTYPE 1845
-#define IDC_EXPANSION_SETTING1 1846
-#define IDC_EXPANSION_SETTING2 1847
-#define IDC_EXPANSION_SETTING3 1848
-#define IDC_CPUBOARD_SETTING1 1849
-#define IDC_CPUBOARD_SETTING2 1850
-#define IDC_CPUBOARD_SETTING3 1851
#define ID__FLOPPYDRIVES 40004
#define ID_FLOPPYDRIVES_DF0 40005
#define ID_ST_CONFIGURATION 40010
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
+ <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
EDITTEXT IDC_RESERVED,347,111,40,15,ES_NUMBER
RTEXT "Block size:",IDC_BLOCKSIZE_TEXT,299,132,45,10
EDITTEXT IDC_BLOCKSIZE,347,130,40,15,ES_NUMBER
- PUSHBUTTON "Enable RDB mode",IDC_HDF_RDB,214,109,75,14
+ PUSHBUTTON "RDB mode",IDC_HDF_RDB,135,109,75,14
LTEXT "HD Controller:",IDC_STATIC,10,113,54,10,SS_CENTERIMAGE
- COMBOBOX IDC_HDF_CONTROLLER,6,131,138,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
- COMBOBOX IDC_HDF_CONTROLLER_UNIT,149,131,25,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
- COMBOBOX IDC_HDF_CONTROLLER_TYPE,180,131,29,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
- COMBOBOX IDC_HDF_FEATURE_LEVEL,214,131,75,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+ COMBOBOX IDC_HDF_CONTROLLER,6,131,152,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+ COMBOBOX IDC_HDF_CONTROLLER_UNIT,163,131,63,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+ COMBOBOX IDC_HDF_CONTROLLER_TYPE,231,131,58,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+ COMBOBOX IDC_HDF_FEATURE_LEVEL,214,109,75,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
EDITTEXT IDC_HDFINFO,5,150,385,12,ES_CENTER | ES_READONLY
EDITTEXT IDC_HDFINFO2,5,166,385,12,ES_CENTER | ES_READONLY
GROUPBOX "New hard disk image file",IDC_STATIC,2,190,392,62
EDITTEXT IDC_CPUBOARDRAM,343,146,40,12,ES_CENTER | ES_READONLY
COMBOBOX IDC_CPUBOARD_TYPE,13,117,117,75,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_CPUBOARD_SUBTYPE,13,136,117,75,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- CONTROL "-",IDC_CPUBOARD_SETTING1,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,14,172,97,10
- CONTROL "-",IDC_CPUBOARD_SETTING2,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,121,172,100,10
GROUPBOX "Expansion Board Settings",IDC_STATIC,1,6,394,88
COMBOBOX IDC_SCSIROMSELECTNUM,175,42,22,75,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_SCSIROMSELECT,12,42,157,75,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_SCSIROMID,356,24,29,75,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_SCSIROMFILE,202,42,171,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "...",IDC_SCSIROMCHOOSER,376,42,10,15
- COMBOBOX IDC_SCSIROMSUBSELECT,12,60,157,75,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
+ COMBOBOX IDC_SCSIROMSUBSELECT,12,59,157,75,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
LTEXT "Accelerator board ROM file:",IDC_STATIC,203,104,170,15,SS_CENTERIMAGE
- COMBOBOX IDC_CPUBOARDROMFILE,200,119,171,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
- PUSHBUTTON "...",IDC_CPUBOARDROMCHOOSER,374,119,10,15
- CONTROL "-",IDC_EXPANSION_SETTING1,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,14,79,92,10
- CONTROL "-",IDC_EXPANSION_SETTING3,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,233,79,77,10
+ COMBOBOX IDC_CPUBOARDROMFILE,202,119,169,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
+ PUSHBUTTON "...",IDC_CPUBOARDROMCHOOSER,376,119,10,15
GROUPBOX "Accelerator Board Settings",IDC_STATIC,1,96,394,97
GROUPBOX "Miscellaneous Expansions",IDC_STATIC,1,199,172,113
CONTROL "Catweasel Z2 emulation [] Catweasel MK2 Zorro II card emulation. Physical Windows compatible Catweasel card and drivers required.",IDC_CATWEASEL,
CONTROL "Include host SCSI devices",IDC_CS_SCSIMODE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,202,296,147,11
CONTROL "Realtek 8029 PCI [] Realtek 8029 PCI NIC emulation",IDC_NE2000,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,202,257,187,11
- CONTROL "-",IDC_CPUBOARD_SETTING3,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,233,172,100,10
- CONTROL "-",IDC_EXPANSION_SETTING2,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,121,79,101,10
CONTROL "Enabled",IDC_SCSIROMSELECTED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,202,43,99,12
COMBOBOX IDC_SCSIROMSELECTCAT,12,23,157,75,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
CONTROL "ES1370 PCI sound card",IDC_CS_ES1370,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,283,151,11
CONTROL "FM801 PCI sound card",IDC_CS_FM801,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,296,151,11
+ COMBOBOX IDC_EXPANSIONBOARDITEMSELECTOR,12,76,157,75,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
+ CONTROL "",IDC_EXPANSIONBOARDCHECKBOX,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,202,76,99,12
+ COMBOBOX IDC_EXPANSIONBOARDSELECTOR,202,76,171,75,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
+ COMBOBOX IDC_ACCELERATORBOARDITEMSELECTOR,12,168,157,75,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
+ CONTROL "",IDC_ACCELERATORBOARDCHECKBOX,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,202,169,99,12
+ COMBOBOX IDC_ACCELERATORBOARDSELECTOR,202,169,171,75,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
END
#define LANG_DLL_FULL_VERSION_MATCH 1
#if WINUAEPUBLICBETA
-#define WINUAEBETA _T("3")
+#define WINUAEBETA _T("4")
#else
#define WINUAEBETA _T("")
#endif
-#define WINUAEDATE MAKEBD(2015, 7, 13)
+#define WINUAEDATE MAKEBD(2015, 7, 22)
//#define WINUAEEXTRA _T("AmiKit Preview")
//#define WINUAEEXTRA _T("Amiga Forever Edition")
#include "sampler.h"
#include "gfxboard.h"
#include "cpuboard.h"
+#include "x86.h"
#ifdef RETROPLATFORM
#include "rp.h"
#endif
{
struct winuae_currentmode wc;
struct apmode *newmode, *oldmode;
+ struct gfx_filterdata *newf, *oldf;
int mode;
if (screen_is_picasso == on)
newmode = &currprefs.gfx_apmode[on ? 1 : 0];
oldmode = &currprefs.gfx_apmode[on ? 0 : 1];
+ newf = &currprefs.gf[on ? 1 : 0];
+ oldf = &currprefs.gf[on ? 0 : 1];
+
updatemodes ();
update_gfxparams ();
clearscreen ();
+
+ // if filter changes, need to reset
+ mode = 0;
+ if (newf->gfx_filter != oldf->gfx_filter)
+ mode = -1;
+ for (int i = 0; i <= 2 * MAX_FILTERSHADERS; i++) {
+ if (_tcscmp(newf->gfx_filtershader[i], oldf->gfx_filtershader[i]))
+ mode = -1;
+ if (_tcscmp(newf->gfx_filtermask[i], oldf->gfx_filtermask[i]))
+ mode = -1;
+ }
+ // if screen parameter changes, need to reopen window
if (newmode->gfx_fullscreen != oldmode->gfx_fullscreen ||
(newmode->gfx_fullscreen && (
newmode->gfx_backbuffers != oldmode->gfx_backbuffers ||
newmode->gfx_vflip != oldmode->gfx_vflip ||
newmode->gfx_vsync != oldmode->gfx_vsync))) {
mode = 1;
- } else {
- mode = modeswitchneeded (&wc);
+ }
+ if (mode <= 0) {
+ int m = modeswitchneeded (&wc);
+ if (m > 0)
+ mode = m;
+ if (m < 0 && !mode)
+ mode = m;
if (!mode)
goto end;
}
fps_width = (int)(64 * scaleX);
idle_width = (int)(64 * scaleX);
if (is_ppc_cpu(&currprefs))
- idle_width = 136;
+ idle_width += (int)(68 * scaleX);
+ if (is_x86_cpu(&currprefs))
+ idle_width += (int)(68 * scaleX);
snd_width = (int)(72 * scaleX);
joy_width = (int)(24 * scaleX);
GetClientRect (hMainWnd, &rc);
#include "driveclick.h"
#include "scsi.h"
#include "cpuboard.h"
+#include "x86.h"
#include "sana2.h"
#ifdef PROWIZARD
#include "moduleripper.h"
else if (mi.size >= 1024 * 1024 * 1024)
_stprintf (size_str, _T("%.1fG"), ((double)(uae_u32)(mi.size / (1024 * 1024))) / 1024.0);
else if (mi.size < 10 * 1024 * 1024)
- _stprintf (size_str, _T("%dK"), mi.size / 1024);
+ _stprintf (size_str, _T("%lldK"), mi.size / 1024);
else
_stprintf (size_str, _T("%.1fM"), ((double)(uae_u32)(mi.size / (1024))) / 1024.0);
_T("A4000T:%s"),
_T("CDTV:%s"),
};
- if (ci->controller_unit == 7 && ert && !_tcscmp(ert->name, _T("a2091")))
+ if (ci->controller_unit == 8 && ert && !_tcscmp(ert->name, _T("a2091")))
_tcscpy(sid, _T("XT"));
+ else if (ci->controller_unit == 8 && ert && !_tcscmp(ert->name, _T("a2090a")))
+ _tcscpy(sid, _T("ST-506"));
else
_stprintf(sid, _T("%d"), ci->controller_unit);
_stprintf (blocksize_str, _T("%d"), ci->blocksize);
return FALSE;
}
-static const int cpuboard_settings_id[] = { IDC_CPUBOARD_SETTING1, IDC_CPUBOARD_SETTING2, IDC_CPUBOARD_SETTING3, -1 };
-
static void enable_for_memorydlg (HWND hDlg)
{
int fast = true;
SetDlgItemText (hDlg, IDC_CPUBOARDRAM, memsize_names[msi_cpuboard[mem_size]]);
SendDlgItemMessage (hDlg, IDC_CPUBOARD_TYPE, CB_SETCURSEL, workprefs.cpuboard_type, 0);
SendDlgItemMessage (hDlg, IDC_CPUBOARD_SUBTYPE, CB_SETCURSEL, workprefs.cpuboard_subtype, 0);
- for (int i = 0; cpuboard_settings_id[i] >= 0; i++) {
- setchecked(hDlg, cpuboard_settings_id[i], (workprefs.cpuboard_settings & (1 << i)) != 0);
- }
+
+// for (int i = 0; cpuboard_settings_id[i] >= 0; i++) {
+// setchecked(hDlg, cpuboard_settings_id[i], (workprefs.cpuboard_settings & (1 << i)) != 0);
+// }
}
static int manybits (int v, int mask)
}
}
+struct expansionrom_gui
+{
+ const struct expansionboardsettings *expansionrom_gui_ebs;
+ int expansionrom_gui_item;
+ DWORD expansionrom_gui_itemselector;
+ DWORD expansionrom_gui_selector;
+ DWORD expansionrom_gui_checkbox;
+ int expansionrom_gui_settingsbits;
+ int expansionrom_gui_settingsshift;
+ int expansionrom_gui_settings;
+};
+static struct expansionrom_gui expansion_gui_item;
+static struct expansionrom_gui accelerator_gui_item;
+
+static void reset_expansionrom_gui(HWND hDlg, struct expansionrom_gui *eg, DWORD itemselector, DWORD selector, DWORD checkbox)
+{
+ eg->expansionrom_gui_settings = NULL;
+ eg->expansionrom_gui_item = 0;
+ eg->expansionrom_gui_ebs = NULL;
+ hide(hDlg, itemselector, 1);
+ hide(hDlg, selector, 1);
+ hide(hDlg, checkbox, 1);
+}
+
+static void create_expansionrom_gui(HWND hDlg, struct expansionrom_gui *eg, const struct expansionboardsettings *ebs, int settings, DWORD itemselector, DWORD selector, DWORD checkbox)
+{
+ bool reset = false;
+ static int recursive;
+ const struct expansionboardsettings *eb;
+ if (eg->expansionrom_gui_ebs != ebs) {
+ eg->expansionrom_gui_item = 0;
+ reset = true;
+ }
+ eg->expansionrom_gui_ebs = ebs;
+ eg->expansionrom_gui_itemselector = itemselector;
+ eg->expansionrom_gui_selector = selector;
+ eg->expansionrom_gui_checkbox = checkbox;
+ eg->expansionrom_gui_settings = settings;
+
+ if (!ebs) {
+ reset_expansionrom_gui(hDlg, eg, itemselector, selector, checkbox);
+ return;
+ }
+ if (recursive > 0)
+ return;
+ recursive++;
+
+ int item = eg->expansionrom_gui_item;
+ hide(hDlg, itemselector, 0);
+ int bitcnt = 0;
+ for (int i = 0; i < item; i++) {
+ const struct expansionboardsettings *eb = &ebs[i];
+ if (eb->multiselect) {
+ const TCHAR *p = eb->configname;
+ int itemcnt = -1;
+ while (p[0]) {
+ itemcnt++;
+ p += _tcslen(p) + 1;
+ }
+ int bits = 1;
+ for (int i = 7; i >= 0; i--) {
+ if (itemcnt & (1 << i)) {
+ bits = i;
+ break;
+ }
+ }
+ bitcnt += bits;
+ } else {
+ bitcnt++;
+ }
+ bitcnt += eb->bitshift;
+ }
+ if (reset) {
+ SendDlgItemMessage(hDlg, itemselector, CB_RESETCONTENT, 0, 0);
+ for (int i = 0; ebs[i].name; i++) {
+ const struct expansionboardsettings *eb = &ebs[i];
+ SendDlgItemMessage(hDlg, itemselector, CB_ADDSTRING, 0, (LPARAM)eb->name);
+ }
+ SendDlgItemMessage(hDlg, itemselector, CB_SETCURSEL, item, 0);
+ }
+ eb = &ebs[item];
+ bitcnt += eb->bitshift;
+ if (eb->multiselect) {
+ SendDlgItemMessage(hDlg, selector, CB_RESETCONTENT, 0, 0);
+ int itemcnt = -1;
+ const TCHAR *p = eb->name;
+ while (p[0]) {
+ if (itemcnt >= 0) {
+ SendDlgItemMessage(hDlg, selector, CB_ADDSTRING, 0, (LPARAM)p);
+ }
+ itemcnt++;
+ p += _tcslen(p) + 1;
+ }
+ int bits = 1;
+ for (int i = 7; i >= 0; i--) {
+ if (itemcnt & (1 << i)) {
+ bits = i;
+ break;
+ }
+ }
+ int value = settings;
+ if (eb->invert)
+ value ^= 0x7fffffff;
+ value >>= bitcnt;
+ value &= (1 << bits) - 1;
+ SendDlgItemMessage(hDlg, selector, CB_SETCURSEL, value, 0);
+ hide(hDlg, selector, 0);
+ hide(hDlg, checkbox, 1);
+ eg->expansionrom_gui_settingsbits = bits;
+ } else {
+ hide(hDlg, selector, 1);
+ hide(hDlg, checkbox, 0);
+ setchecked(hDlg, checkbox, ((settings >> bitcnt) ^ (eb->invert ? 1 : 0)) & 1);
+ eg->expansionrom_gui_settingsbits = 1;
+ }
+ eg->expansionrom_gui_settingsshift = bitcnt;
+ recursive--;
+}
+
+static void get_expansionrom_gui(HWND hDlg, struct expansionrom_gui *eg)
+{
+ if (!eg->expansionrom_gui_ebs)
+ return;
+
+ int val;
+ int settings = eg->expansionrom_gui_settings;
+
+ val = SendDlgItemMessage(hDlg, eg->expansionrom_gui_itemselector, CB_GETCURSEL, 0, 0);
+ if (val != CB_ERR && val != eg->expansionrom_gui_item) {
+ eg->expansionrom_gui_item = val;
+ create_expansionrom_gui(hDlg, eg, eg->expansionrom_gui_ebs, eg->expansionrom_gui_settings, eg->expansionrom_gui_itemselector, eg->expansionrom_gui_selector, eg->expansionrom_gui_checkbox);
+ return;
+ }
+ const struct expansionboardsettings *eb = &eg->expansionrom_gui_ebs[eg->expansionrom_gui_item];
+ if (eb->multiselect) {
+ val = SendDlgItemMessage(hDlg, eg->expansionrom_gui_selector, CB_GETCURSEL, 0, 0);
+ if (val != CB_ERR) {
+ int mask = (1 << eg->expansionrom_gui_settingsbits) - 1;
+ settings &= ~(mask << eg->expansionrom_gui_settingsshift);
+ settings |= val << eg->expansionrom_gui_settingsshift;
+ if (eb->invert)
+ settings ^= mask << eg->expansionrom_gui_settingsshift;
+ }
+ } else {
+ settings &= ~(1 << eg->expansionrom_gui_settingsshift);
+ if (ischecked(hDlg, eg->expansionrom_gui_checkbox)) {
+ settings |= 1 << eg->expansionrom_gui_settingsshift;
+ }
+ if (eb->invert)
+ settings ^= 1 << eg->expansionrom_gui_settingsshift;
+ }
+ eg->expansionrom_gui_settings = settings;
+}
+
static struct netdriverdata *ndd[MAX_TOTAL_NET_DEVICES + 1];
_stprintf(mac, _T("xx:xx:xx:%02X:%02X:%02X"),
ndd[i]->mac[3], ndd[i]->mac[4], ndd[i]->mac[5]);
} else {
- _stprintf (mac, _T("2X:%02X:%02X:%02X:%02X:%02X"),
+ _stprintf (mac, _T("%02X:%02X:%02X:%02X:%02X:%02X"),
ndd[i]->mac[0], ndd[i]->mac[1], ndd[i]->mac[2], ndd[i]->mac[3], ndd[i]->mac[4], ndd[i]->mac[5]);
}
_stprintf (tmp, _T("%s %s"), mac, ndd[i]->desc);
SendDlgItemMessage (hDlg, IDC_NETDEVICE, CB_SETCURSEL, 0, 0);
}
-static const int scsiromselectedmask[] = { EXPANSIONTYPE_SCSI, EXPANSIONTYPE_IDE, EXPANSIONTYPE_SASI, EXPANSIONTYPE_CUSTOM, EXPANSIONTYPE_PCI_BRIDGE };
+static const int scsiromselectedmask[] = { EXPANSIONTYPE_SCSI, EXPANSIONTYPE_IDE, EXPANSIONTYPE_SASI, EXPANSIONTYPE_CUSTOM, EXPANSIONTYPE_PCI_BRIDGE, EXPANSIONTYPE_X86_BRIDGE };
static void init_expansion2(HWND hDlg)
{
static int first = -1;
}
-static const int expansion_settings_id[] = { IDC_EXPANSION_SETTING1, IDC_EXPANSION_SETTING2, IDC_EXPANSION_SETTING3, 1 };
-
static void values_to_expansion2dlg_sub(HWND hDlg)
{
SendDlgItemMessage(hDlg, IDC_CPUBOARDROMSUBSELECT, CB_RESETCONTENT, 0, 0);
if (v != CB_ERR)
brc->roms[index].device_id = v;
+
const struct expansionboardsettings *cbs = ert->settings;
if (cbs) {
+ brc->roms[index].device_settings = expansion_gui_item.expansionrom_gui_settings;
+ }
+#if 0
for (int i = 0; cbs[i].name; i++) {
int id = expansion_settings_id[i];
if (id < 0)
brc->roms[index].device_settings |= 1 << i;
}
}
-
+#endif
v = SendDlgItemMessage(hDlg, IDC_SCSIROMSUBSELECT, CB_GETCURSEL, 0, 0L);
if (v != CB_ERR)
brc->roms[index].subtype = v;
values_to_expansion2dlg_sub(hDlg);
}
-
+ workprefs.cpuboard_settings = accelerator_gui_item.expansionrom_gui_settings;
getromfile(hDlg, IDC_CPUBOARDROMFILE, tmp, sizeof(brc->roms[index].romfile) / sizeof(TCHAR));
if (tmp[0]) {
brc = get_device_rom_new(&workprefs, ROMTYPE_CPUBOARD, 0, &index);
getromfile(hDlg, IDC_CPUBOARDROMFILE, brc->roms[index].romfile, sizeof(brc->roms[index].romfile) / sizeof(TCHAR));
- }
- else {
+ } else {
clear_device_rom(&workprefs, ROMTYPE_CPUBOARD, 0);
}
}
if (brc) {
if (brc->roms[index].romfile[0])
ew(hDlg, IDC_SCSIROMFILEAUTOBOOT, ert->autoboot_jumper);
- }
- else {
+ } else {
if (brc)
brc->roms[index].autoboot_disabled = false;
ew(hDlg, IDC_SCSIROMFILEAUTOBOOT, FALSE);
ew(hDlg, IDC_SCSIROMID, ert->id_jumper);
const struct expansionboardsettings *cbs = ert->settings;
+
+ create_expansionrom_gui(hDlg, &expansion_gui_item, cbs, brc ? brc->roms[index].device_settings : 0, IDC_EXPANSIONBOARDITEMSELECTOR, IDC_EXPANSIONBOARDSELECTOR, IDC_EXPANSIONBOARDCHECKBOX);
+
+#if 0
for (int i = 0; expansion_settings_id[i] >= 0; i++) {
hide(hDlg, expansion_settings_id[i], !(cbs && cbs[i].name));
}
hide(hDlg, id, true);
i++;
}
+#endif
}
+
static void enable_for_expansion2dlg (HWND hDlg)
{
int z3 = true;
ew(hDlg, IDC_CPUBOARDMEM, workprefs.cpuboard_type > 0);
ew(hDlg, IDC_CPUBOARDRAM, workprefs.cpuboard_type > 0);
ew(hDlg, IDC_CPUBOARD_SUBTYPE, workprefs.cpuboard_type);
+
+#if 0
const struct expansionboardsettings *cbs = cpuboards[workprefs.cpuboard_type].subtypes[workprefs.cpuboard_subtype].settings;
int i = 0;
if (cbs) {
hide(hDlg, cpuboard_settings_id[i], 1);
i++;
}
+#endif
}
static void values_to_expansion2dlg (HWND hDlg)
const struct cpuboardsubtype *cst = &cpuboards[workprefs.cpuboard_type].subtypes[workprefs.cpuboard_subtype];
brc = get_device_rom(&workprefs, ROMTYPE_CPUBOARD, 0, &index);
addromfiles(fkey, hDlg, IDC_CPUBOARDROMFILE, brc ? brc->roms[index].romfile : NULL,
- cst->romtype, cst->romtype_extra);
+ cst->romtype, cst->romtype_extra);
} else {
SendDlgItemMessage(hDlg, IDC_CPUBOARDROMFILE, CB_RESETCONTENT, 0, 0);
}
for (int i = 0; cpuboards[workprefs.cpuboard_type].subtypes[i].name; i++) {
SendDlgItemMessage(hDlg, IDC_CPUBOARD_SUBTYPE, CB_ADDSTRING, 0, (LPARAM) cpuboards[workprefs.cpuboard_type].subtypes[i].name);
}
+
+
const struct expansionboardsettings *cbs = cpuboards[workprefs.cpuboard_type].subtypes[workprefs.cpuboard_subtype].settings;
+ create_expansionrom_gui(hDlg, &accelerator_gui_item, cbs, workprefs.cpuboard_settings, IDC_ACCELERATORBOARDITEMSELECTOR, IDC_ACCELERATORBOARDSELECTOR, IDC_ACCELERATORBOARDCHECKBOX);
+
+#if 0
int i = 0;
if (cbs) {
for (i = 0; cbs[i].name; i++) {
SetWindowText(GetDlgItem(hDlg, id), _T("-"));
i++;
}
+#endif
}
static void expansion2filebuttons(HWND hDlg, WPARAM wParam, TCHAR *path)
SendDlgItemMessage(hDlg, IDC_SCSIROMSELECTCAT, CB_ADDSTRING, 0, (LPARAM)_T("IDE Controllers"));
SendDlgItemMessage(hDlg, IDC_SCSIROMSELECTCAT, CB_ADDSTRING, 0, (LPARAM)_T("SASI Controllers"));
SendDlgItemMessage(hDlg, IDC_SCSIROMSELECTCAT, CB_ADDSTRING, 0, (LPARAM)_T("Custom Controllers"));
- SendDlgItemMessage(hDlg, IDC_SCSIROMSELECTCAT, CB_ADDSTRING, 0, (LPARAM)_T("PCI Bridges"));
+ SendDlgItemMessage(hDlg, IDC_SCSIROMSELECTCAT, CB_ADDSTRING, 0, (LPARAM)_T("PCI Bridgeboards"));
+ SendDlgItemMessage(hDlg, IDC_SCSIROMSELECTCAT, CB_ADDSTRING, 0, (LPARAM)_T("x86 Bridgeboards"));
+ reset_expansionrom_gui(hDlg, &expansion_gui_item, IDC_EXPANSIONBOARDITEMSELECTOR, IDC_EXPANSIONBOARDSELECTOR, IDC_EXPANSIONBOARDCHECKBOX);
+ reset_expansionrom_gui(hDlg, &accelerator_gui_item, IDC_ACCELERATORBOARDITEMSELECTOR, IDC_ACCELERATORBOARDSELECTOR, IDC_ACCELERATORBOARDCHECKBOX);
hide(hDlg, IDC_SCSIROMSELECTED, 1);
expansion_net(hDlg);
init_expansion2(hDlg);
recursive++;
switch (LOWORD(wParam))
{
- case IDC_EXPANSION_SETTING1:
- case IDC_EXPANSION_SETTING2:
- case IDC_EXPANSION_SETTING3:
+ case IDC_EXPANSIONBOARDCHECKBOX:
+ get_expansionrom_gui(hDlg, &expansion_gui_item);
+ values_from_expansion2dlg(hDlg);
+ break;
+ case IDC_ACCELERATORBOARDCHECKBOX:
+ get_expansionrom_gui(hDlg, &accelerator_gui_item);
values_from_expansion2dlg(hDlg);
break;
case IDC_SCSIROMFILEAUTOBOOT:
if (HIWORD(wParam) == CBN_SELENDOK || HIWORD(wParam) == CBN_KILLFOCUS || HIWORD(wParam) == CBN_EDITCHANGE) {
switch (LOWORD(wParam))
{
+ case IDC_EXPANSIONBOARDITEMSELECTOR:
+ case IDC_EXPANSIONBOARDSELECTOR:
+ get_expansionrom_gui(hDlg, &expansion_gui_item);
+ values_from_expansion2dlg(hDlg);
+ break;
+ case IDC_ACCELERATORBOARDITEMSELECTOR:
+ case IDC_ACCELERATORBOARDSELECTOR:
+ get_expansionrom_gui(hDlg, &accelerator_gui_item);
+ values_from_expansion2dlg(hDlg);
+ break;
case IDC_SCSIROMFILE:
case IDC_SCSIROMID:
case IDC_CPUBOARDROMFILE:
break;
}
}
+#if 0
for (int i = 0; cpuboard_settings_id[i] >= 0; i++) {
workprefs.cpuboard_settings &= ~(1 << i);
if (ischecked(hDlg, cpuboard_settings_id[i]))
workprefs.cpuboard_settings |= 1 << i;
}
+#endif
recursive--;
}
break;
static INT_PTR CALLBACK KickstartDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
static int recursive;
- int val;
TCHAR tmp[MAX_DPATH];
switch (msg)
static void setdefaultguisize (void)
{
- gui_width = GUI_INTERNAL_WIDTH * 100 / 100;
- gui_height = GUI_INTERNAL_HEIGHT * 100 / 100;
+ double dpix = 1.0, dpiy = 1.0;
+
+ if (isfullscreen() <= 0)
+ scaleresource_getdpimult(&dpix, &dpiy);
+
+ gui_width = (int)(GUI_INTERNAL_WIDTH * dpix);
+ gui_height = (int)(GUI_INTERNAL_HEIGHT * dpiy);
+
+ int w = GetSystemMetrics(SM_CXVIRTUALSCREEN);
+ int h = GetSystemMetrics(SM_CYVIRTUALSCREEN);
+
+ if ((dpix > 1 || dpiy > 1) && (gui_width > w || gui_height > h)) {
+ gui_width = w;
+ gui_height = h;
+ }
}
static void getstoredguisize(void)
scaleresource_setdefaults ();
v = SendDlgItemMessage (hDlg, IDC_GUI_SIZE, CB_GETCURSEL, 0, 0L);
if (v != CB_ERR) {
+ double dpix = 1.0, dpiy = 1.0;
if (v == 0) {
v = GUI_SCALE_DEFAULT;
} else {
v--;
v = 140 - v * 10;
}
- double m = scaleresource_getdpimult ();
- gui_width = (int)(GUI_INTERNAL_WIDTH * m * v / 100);
- gui_height = (int)(GUI_INTERNAL_HEIGHT * m * v / 100);
+ if (isfullscreen() <= 0)
+ scaleresource_getdpimult(&dpix, &dpiy);
+ gui_width = (int)(GUI_INTERNAL_WIDTH * dpix * v / 100);
+ gui_height = (int)(GUI_INTERNAL_HEIGHT * dpiy * v / 100);
if (gui_width < MIN_GUI_INTERNAL_WIDTH || gui_height < MIN_GUI_INTERNAL_HEIGHT) {
gui_width = MIN_GUI_INTERNAL_WIDTH;
gui_height = MIN_GUI_INTERNAL_HEIGHT;
bool ide = current_hfdlg.ci.controller_type >= HD_CONTROLLER_TYPE_IDE_FIRST && current_hfdlg.ci.controller_type <= HD_CONTROLLER_TYPE_IDE_LAST;
bool scsi = current_hfdlg.ci.controller_type >= HD_CONTROLLER_TYPE_SCSI_FIRST && current_hfdlg.ci.controller_type <= HD_CONTROLLER_TYPE_SCSI_LAST;
+ if (current_hfdlg.ci.controller_unit >= 8)
+ current_hfdlg.ci.unit_feature_level = HD_LEVEL_SASI_CHS;
+
if (!disables)
current_hfdlg.ci.bootpri = 0;
if (!physgeo)
SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER_UNIT, CB_ADDSTRING, 0, (LPARAM)_T("0"));
SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER_UNIT, CB_ADDSTRING, 0, (LPARAM)_T("1"));
if (!ert || !(ert->deviceflags & (EXPANSIONTYPE_SASI | EXPANSIONTYPE_CUSTOM)) ) {
- SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER_UNIT, CB_ADDSTRING, 0, (LPARAM)_T("2"));
- SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER_UNIT, CB_ADDSTRING, 0, (LPARAM)_T("3"));
- SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER_UNIT, CB_ADDSTRING, 0, (LPARAM)_T("4"));
- SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER_UNIT, CB_ADDSTRING, 0, (LPARAM)_T("5"));
- SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER_UNIT, CB_ADDSTRING, 0, (LPARAM)_T("6"));
+ SendDlgItemMessage(hDlg, IDC_HDF_CONTROLLER_UNIT, CB_ADDSTRING, 0, (LPARAM)_T("2"));
+ SendDlgItemMessage(hDlg, IDC_HDF_CONTROLLER_UNIT, CB_ADDSTRING, 0, (LPARAM)_T("3"));
+ SendDlgItemMessage(hDlg, IDC_HDF_CONTROLLER_UNIT, CB_ADDSTRING, 0, (LPARAM)_T("4"));
+ SendDlgItemMessage(hDlg, IDC_HDF_CONTROLLER_UNIT, CB_ADDSTRING, 0, (LPARAM)_T("5"));
+ SendDlgItemMessage(hDlg, IDC_HDF_CONTROLLER_UNIT, CB_ADDSTRING, 0, (LPARAM)_T("6"));
+ SendDlgItemMessage(hDlg, IDC_HDF_CONTROLLER_UNIT, CB_ADDSTRING, 0, (LPARAM)_T("7"));
if (devtype == UAEDEV_HDF && ert && !_tcscmp(ert->name, _T("a2091")))
SendDlgItemMessage(hDlg, IDC_HDF_CONTROLLER_UNIT, CB_ADDSTRING, 0, (LPARAM)_T("XT"));
+ if (devtype == UAEDEV_HDF && ert && !_tcscmp(ert->name, _T("a2090a"))) {
+ SendDlgItemMessage(hDlg, IDC_HDF_CONTROLLER_UNIT, CB_ADDSTRING, 0, (LPARAM)_T("ST-506 #1"));
+ SendDlgItemMessage(hDlg, IDC_HDF_CONTROLLER_UNIT, CB_ADDSTRING, 0, (LPARAM)_T("ST-506 #2"));
+ }
}
ew(hDlg, IDC_HDF_CONTROLLER_UNIT, TRUE);
} else {
id[0], id[1], id[2], id[3], id[4], id[5], id[6], id[7],
id[8], id[9], id[10], id[11], id[12], id[13], id[14], id[15]);
if (!blocks) {
- _stprintf (tmp, _T("%dMB"), bsize / (1024 * 1024));
+ _stprintf (tmp, _T("%uMB"), (unsigned int)(bsize / (1024 * 1024)));
} else if (blocks && !cyls) {
_stprintf (tmp, _T("%u blocks, %.1fMB"),
blocks,
if (workprefs.floppy_speed > 0 && workprefs.floppy_speed < 10)
workprefs.floppy_speed = 100;
currentpage = FLOPPY_ID;
- SendDlgItemMessage (hDlg, IDC_FLOPPYSPD, TBM_SETRANGE, TRUE, MAKELONG (0, 4));
- SendDlgItemMessage (hDlg, IDC_FLOPPYSPD, TBM_SETPAGESIZE, 0, 1);
- SendDlgItemMessage (hDlg, IDC_FLOPPYTYPE, CB_RESETCONTENT, 0, 0L);
- SendDlgItemMessage (hDlg, IDC_FLOPPYTYPE, CB_ADDSTRING, 0, (LPARAM)ft35dd);
- SendDlgItemMessage (hDlg, IDC_FLOPPYTYPE, CB_ADDSTRING, 0, (LPARAM)ft35hd);
- SendDlgItemMessage (hDlg, IDC_FLOPPYTYPE, CB_ADDSTRING, 0, (LPARAM)ft35ddpc);
- SendDlgItemMessage (hDlg, IDC_FLOPPYTYPE, CB_ADDSTRING, 0, (LPARAM)ft35hdpc);
- SendDlgItemMessage (hDlg, IDC_FLOPPYTYPE, CB_ADDSTRING, 0, (LPARAM)ft525sd);
+ SendDlgItemMessage(hDlg, IDC_FLOPPYSPD, TBM_SETRANGE, TRUE, MAKELONG (0, 4));
+ SendDlgItemMessage(hDlg, IDC_FLOPPYSPD, TBM_SETPAGESIZE, 0, 1);
+ SendDlgItemMessage(hDlg, IDC_FLOPPYTYPE, CB_RESETCONTENT, 0, 0L);
+ SendDlgItemMessage(hDlg, IDC_FLOPPYTYPE, CB_ADDSTRING, 0, (LPARAM)ft35dd);
+ SendDlgItemMessage(hDlg, IDC_FLOPPYTYPE, CB_ADDSTRING, 0, (LPARAM)ft35hd);
+ SendDlgItemMessage(hDlg, IDC_FLOPPYTYPE, CB_ADDSTRING, 0, (LPARAM)ft35ddpc);
+ SendDlgItemMessage(hDlg, IDC_FLOPPYTYPE, CB_ADDSTRING, 0, (LPARAM)ft35hdpc);
+ SendDlgItemMessage(hDlg, IDC_FLOPPYTYPE, CB_ADDSTRING, 0, (LPARAM)ft525sd);
SendDlgItemMessage (hDlg, IDC_FLOPPYTYPE, CB_SETCURSEL, 0, 0);
for (i = 0; i < 4; i++) {
int f_type = floppybuttons[i][3];
SendDlgItemMessage (hDlg, f_type, CB_ADDSTRING, 0, (LPARAM)ft35hd);
SendDlgItemMessage (hDlg, f_type, CB_ADDSTRING, 0, (LPARAM)ft525sd);
SendDlgItemMessage (hDlg, f_type, CB_ADDSTRING, 0, (LPARAM)ft35ddescom);
+ if (i >= 2)
+ SendDlgItemMessage(hDlg, f_type, CB_ADDSTRING, 0, (LPARAM)_T("PC Bridge"));
}
setmultiautocomplete (hDlg, df0texts);
}
on = 0;
else
on = 1;
+ bool m68klabelchange = false;
+ TCHAR *m68label = _T("CPU");
+ ptr[0] = 0;
+ p = ptr;
if (is_ppc_cpu(&currprefs)) {
_tcscpy(ptr, _T("PPC: "));
if (ppc_state == PPC_STATE_ACTIVE)
_tcscat(ptr, _T("SLEEP"));
else
_tcscat(ptr, _T("STOP"));
+ _tcscat(ptr, _T(" "));
+ p = ptr + _tcslen(ptr);
+ m68label = _T("68k");
+ m68klabelchange = true;
+ }
+ int state = is_x86_cpu(&currprefs);
+ if (state > 0) {
+ _tcscpy(ptr, _T("x86: "));
+ if (state == X86_STATE_ACTIVE)
+ _tcscat(ptr, _T("RUN"));
+ else
+ _tcscat(ptr, _T("STOP"));
+ _tcscat(ptr, _T(" "));
p = ptr + _tcslen(ptr);
- if (gui_data.cpu_halted < 0)
- _tcscpy(p, _T(" 68K: STOP"));
+ m68label = _T("68k");
+ m68klabelchange = true;
+ }
+ if (gui_data.cpu_halted < 0) {
+ if (!m68klabelchange)
+ _tcscpy(p, _T("STOP"));
else
- _stprintf(p, _T(" 68K: %.0f%%"), (double)((gui_data.idle) / 10.0));
+ _tcscat(p, _T(" 68k: STOP"));
} else {
- if (gui_data.cpu_halted < 0) {
- _tcscpy(ptr, _T("STOP"));
- } else {
- _stprintf(ptr, _T("CPU: %.0f%%"), (double)((gui_data.idle) / 10.0));
- }
+ _stprintf(p, _T("%s: %.0f%%"), m68label, (double)((gui_data.idle) / 10.0));
}
} else if (led == LED_SND && gui_data.drive_disabled[3]) {
pos = 0;
extern int scaleresource_choosefont (HWND hDlg, int fonttype);
extern void scaleresource_setdefaults (void);
extern void scaleresource_setfont (HWND hDlg);
-extern double scaleresource_getdpimult (void);
+extern void scaleresource_getdpimult (double*, double*);
#endif
}
#endif
-double scaleresource_getdpimult (void)
+
+typedef enum MONITOR_DPI_TYPE {
+ MDT_EFFECTIVE_DPI = 0,
+ MDT_ANGULAR_DPI = 1,
+ MDT_RAW_DPI = 2,
+ MDT_DEFAULT = MDT_EFFECTIVE_DPI
+} MONITOR_DPI_TYPE;
+typedef HRESULT(CALLBACK* GETDPIFORMONITOR)(HMONITOR, MONITOR_DPI_TYPE, UINT*, UINT*);
+
+void scaleresource_getdpimult (double *dpixp, double *dpiyp)
{
- return (double)baseheight / GUI_INTERNAL_HEIGHT;
+ GETDPIFORMONITOR pGetDpiForMonitor;
+ POINT pt = { 32000, 32000 };
+ HMONITOR mon = MonitorFromPoint(pt, MONITOR_DEFAULTTOPRIMARY);
+
+ *dpixp = 1.0;
+ *dpiyp = 1.0;
+ pGetDpiForMonitor = (GETDPIFORMONITOR)GetProcAddress(GetModuleHandle(_T("Shcore.dll")), "GetDpiForMonitor");
+ if (pGetDpiForMonitor) {
+ UINT dpix, dpiy;
+ if (SUCCEEDED(pGetDpiForMonitor(mon, MDT_EFFECTIVE_DPI, &dpix, &dpiy))) {
+ if (dpix > 96)
+ *dpixp = (double)dpix / 96.0;
+ if (dpiy > 96)
+ *dpiyp = (double)dpiy / 96.0;
+ }
+ }
}
void scaleresource_setmult (HWND hDlg, int w, int h, int fullscreen)
<ClCompile Include="..\..\dlopen.cpp" />
<ClCompile Include="..\..\ethernet.cpp" />
<ClCompile Include="..\..\events.cpp" />
+ <ClCompile Include="..\..\fake86_cpu.cpp" />
<ClCompile Include="..\..\flashrom.cpp" />
<ClCompile Include="..\..\gfxboard.cpp" />
<ClCompile Include="..\..\hrtmon.rom.cpp" />
<ClCompile Include="..\..\tabletlibrary.cpp" />
<ClCompile Include="..\..\test_card.cpp" />
<ClCompile Include="..\..\uaenative.cpp" />
+ <ClCompile Include="..\..\x86.cpp" />
<ClCompile Include="..\ahidsound_dsonly.cpp" />
<ClCompile Include="..\ahidsound_new.cpp" />
<ClCompile Include="..\avioutput.cpp" />
<ClCompile Include="..\..\mame\a2410.cpp">
<Filter>mame</Filter>
</ClCompile>
+ <ClCompile Include="..\..\x86.cpp">
+ <Filter>common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\fake86_cpu.cpp">
+ <Filter>common</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="..\resources\35floppy.ico">
+Beta 4:
+
+- RTG<>chipset mode switching didn't check if modes have different filter type (forgot to add
+ when RTG filter support was implemented)
+- 68020/030 prefetch pipeline b3 missing addressing mode implemented. Other adjustments: single
+ word unconditional branch-like instruction (for example RTS) stop prefetches immediately but
+ conditional single opcode always prefetch one extra word before stopping. Bcc.S (when not
+ branching) and DBcc probably aren't exactly right yet.
+- A2090 ST-506 support implemented.
+- Note about existing configurations that use A590 XT support: drive type (SCSI ID/XT) must be reset.
+- GUI default windowed mode window size (when it runs for the first time and size information is not
+ yet stored in registry/ini) is now adjusted for high DPI screen. (Windows 8.1+ only). Previously
+ default size was far too small on high DPI displays.
+- Added "I am Windows 10 compatible" manifest entry, winuaebootlog.txt now shows correct Windows 10
+ version information.
+- Cleaned up pfield_do_linetoscr() mess.
+- Added support for AGA subpixel bitplane delays (lores pixel can horizontally scroll 4 shres or 2
+ hires pixels or hires pixel 2 shres pixels). Limit: only works if both odd and even planes have
+ same subpixel scroll value (which probably is true practically in all situations)
+- b1 sprite right border corner case broke SSCAN2 sprite horizontal duplication.
+- x86 bridgeboard emulation! A1060 Sidecar, A2088 and A2088T currently implemented.
+
+x86 bridgeboard information:
+- Currently uses fake86 CPU core + PC support chip emulation. Selected because it was very easy
+ to integrate. Possible future A2286+ emulation needs different CPU core.
+- All jumpers emulated. (Required redesign of expansion GUI extra config)
+- Amiga floppy drive DF2: and DF3: can be re-configured as bridgeboard PC drives A: and B:.
+- Only 360k and 720k standard dos disk images supported.
+- A2088T 360k/720k compatible drive supported. Floppy switch not implemented.
+- A1060 and A2088 apparently only have 360k drive and BIOS support.
+- BIOS ROM required. Searching for "A2088 BIOS" or similar should work... No BIOS ROMs
+ added to rom scanner.
+- Not much real testing done. Boots from dos boot floppy, drive formatting and reading/writing works.
+- x86 CPU speed is currently very randomly chosen speed.
+
Beta 3:
- CD and sound card audio are now always resampled with Anti interpolator before it gets mixed