From: Toni Wilen Date: Tue, 8 Apr 2014 18:00:07 +0000 (+0300) Subject: 2710b14 X-Git-Tag: 2800~5 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=fa8c1275c87d293408632ede5803c4ec491f7104;p=francis%2Fwinuae.git 2710b14 --- diff --git a/ar.cpp b/ar.cpp index 6fa127ed..53fbf162 100644 --- a/ar.cpp +++ b/ar.cpp @@ -1451,8 +1451,7 @@ static void action_replay_setbanks (void) switch (armodel) { case 2: case 3: - if (currprefs.cpu_cycle_exact) - chipmem_bank.wput = chipmem_wput_actionreplay23; + chipmem_bank.wput = chipmem_wput_actionreplay23; chipmem_bank.lput = chipmem_lput_actionreplay23; break; case 1: diff --git a/arcadia.cpp b/arcadia.cpp index 70b91441..5d4f0225 100644 --- a/arcadia.cpp +++ b/arcadia.cpp @@ -44,6 +44,10 @@ * - ar_dlta * - ar_pm * +* mame 0.153 +* +* - ar_argh + */ static void multigame (int); @@ -54,33 +58,33 @@ struct arcadiarom *arcadia_bios, *arcadia_game; static struct arcadiarom roms[] = { // oneplay 2.11 - { 49, _T("ar_bios.zip"), _T("scpa_01_v2.11"), _T("scpa_01"),ARCADIA_BIOS, 3, 6, 1, 0, 2, 3, 4, 5, 7, { _T("_v2.11.u12"), _T("_v2.11.u16") } }, + { 49, _T("ar_bios.zip"), _T("scpa_01_v2.11"), _T("scpa_01"),ARCADIA_BIOS, 3, 6, 1, 0, 2, 3, 4, 5, 7, _T("_v2.11."), { _T("u12"), _T("u16") } }, // tenplay 2.11 { 50, _T("ar_bios.zip"), _T("gcp"), _T("gcp-"), ARCADIA_BIOS, 7, 7, 6, 5, 4, 3, 2, 1, 0 }, // oneplay 2.20 - { 75, _T("ar_bios.zip"), _T("scpa_01_v2.20"), _T("scpa_01"),ARCADIA_BIOS, 3, 6, 1, 0, 2, 3, 4, 5, 7, { _T("_v2.20.u12"), _T("_v2.20.u16") } }, + { 75, _T("ar_bios.zip"), _T("scpa_01_v2.20"), _T("scpa_01"),ARCADIA_BIOS, 3, 6, 1, 0, 2, 3, 4, 5, 7, _T("_v2.20."), { _T("u12"), _T("u16") } }, // oneplay 3.00 - { 51, _T("ar_bios.zip"), _T("scpa_01_v3.00"), _T("scpa_01"),ARCADIA_BIOS, 3, 6, 1, 0, 2, 3, 4, 5, 7, { _T("_v3.0.u12"), _T("_v3.0.u16") } }, + { 51, _T("ar_bios.zip"), _T("scpa_01_v3.00"), _T("scpa_01"),ARCADIA_BIOS, 3, 6, 1, 0, 2, 3, 4, 5, 7, _T("_v3.0."), { _T("u12"), _T("u16") } }, // tenplay 3.11 - { 76, _T("ar_bios.zip"), _T("gcp_v11"), _T("gcp_v311_"), ARCADIA_BIOS, 7, 7, 6, 5, 4, 3, 2, 1, 0, { _T(".u16"), _T(".u11"), _T(".u17"), _T(".u12") } }, + { 76, _T("ar_bios.zip"), _T("gcp_v11"), _T("gcp_v311_"), ARCADIA_BIOS, 7, 7, 6, 5, 4, 3, 2, 1, 0, NULL, { _T(".u16"), _T(".u11"), _T(".u17"), _T(".u12") } }, // tenplay 4.00 - { 77, _T("ar_bios.zip"), _T("gcp_v400"), _T("gcp_v400_"), ARCADIA_BIOS, 7, 7, 6, 5, 4, 3, 2, 1, 0, { _T(".u16"), _T(".u11"), _T(".u17"), _T(".u12") } }, + { 77, _T("ar_bios.zip"), _T("gcp_v400"), _T("gcp_v400_"), ARCADIA_BIOS, 7, 7, 6, 5, 4, 3, 2, 1, 0, NULL, { _T(".u16"), _T(".u11"), _T(".u17"), _T(".u12") } }, { 33, _T("ar_airh.zip"), _T("airh"), _T("airh_"), ARCADIA_GAME, 5|16, 5, 0, 2, 4, 7, 6, 1, 3 }, - { 81, _T("ar_airh2.zip"), _T("airh2"), _T("arcadia4"), ARCADIA_GAME, 0, 5, 0, 2, 4, 7, 6, 1, 3, { _T(".u10"), _T(".u6") } }, + { 81, _T("ar_airh2.zip"), _T("airh2"), _T("arcadia4"), ARCADIA_GAME, 0, 5, 0, 2, 4, 7, 6, 1, 3, NULL, { _T(".u10"), _T(".u6") } }, { 34, _T("ar_bowl.zip"), _T("bowl"), _T("bowl_"), ARCADIA_GAME, 5|16, 7, 6, 0, 1, 2, 3, 4, 5 }, { 35, _T("ar_dart.zip"), _T("dart"), _T("dart_"), ARCADIA_GAME, 5|16, 4, 0, 7, 6, 3, 1, 2, 5 }, - { 82, _T("ar_dart2.zip"), _T("dart2"), _T("arcadia3"), ARCADIA_GAME, 0, 4, 0, 7, 6, 3, 1, 2, 5, { _T(".u10"), _T(".u6"), _T(".u11"), _T(".u7"), _T(".u12"), _T(".u8"), _T(".u13"), _T(".u9"), _T(".u19"), _T(".u15"), _T(".u20"), _T(".u16") } }, - { 36, _T("ar_fast.zip"), _T("fast-v28"), _T("fast-v28_"), ARCADIA_GAME, 7, 7, 6, 5, 4, 3, 2, 1, 0, { _T(".u11"), _T(".u15"), _T(".u10"), _T(".u14"), _T(".u9"), _T(".u13"), _T(".u20"), _T(".u24"), _T(".u19"), _T(".u23"), _T(".u18"), _T(".u22"), _T(".u17"), _T(".u21"), _T(".u28"), _T(".u32") } }, - { 83, _T("ar_fasta.zip"), _T("fast-v27"), _T("fast-v27_"), ARCADIA_GAME, 7, 7, 6, 5, 4, 3, 2, 1, 0, { _T(".u11"), _T(".u15"), _T(".u10"), _T(".u14"), _T(".u9"), _T(".u13"), _T(".u20"), _T(".u24"), _T(".u19"), _T(".u23"), _T(".u18"), _T(".u22"), _T(".u17"), _T(".u21"), _T(".u28"), _T(".u32") } }, - { 37, _T("ar_ldrba.zip"), _T("ldra"), _T("leader_board_0"), ARCADIA_GAME, 7, 7, 6, 5, 4, 3, 2, 1, 0, { _T("_v2.4.u11"), _T("_v2.4.u15"), _T("_v2.4.u10"), _T("_v2.4.u14"), _T("_v2.4.u9"), _T("_v2.4.u13"), _T("_v2.4.u20"), _T("_v2.4.u24"), _T("_v2.4.u19"), _T("_v2.4.u23"), _T("_v2.4.u18"), _T("_v2.4.u22"), _T("_v2.4.u17"), _T("_v2.4.u21"), _T("_v2.4.u28"), _T("_v2.4.u32") } }, - { 38, _T("ar_ldrbb.zip"),_T("ldrbb"), _T("ldrb_"), ARCADIA_GAME, 5, 7, 6, 5, 4, 3, 2, 1, 0, { _T(".u11"), _T("_gcp_22.u15"), _T(".u10"), _T(".u14"), _T(".u9"), _T(".u13"), _T(".u20"), _T(".u24"), _T(".u19"), _T(".u23"), _T(".u18"), _T(".u22"), _T(".u17"), _T(".u21"), _T(".u28"), _T(".u32") } }, - { 86, _T("ar_ldrb.zip"),_T("ldrb"), _T("leader_board_0"), ARCADIA_GAME, 7, 2, 3, 4, 1, 0, 7, 5, 6, { _T("_v2.5.u11"), _T("_v2.5.u15"), _T("_v2.5.u10"), _T("_v2.5.u14"), _T("_v2.5.u9"), _T("_v2.5.u13"), _T("_v2.5.u20"), _T("_v2.5.u24"), _T("_v2.5.u19"), _T("_v2.5.u23"), _T("_v2.5.u18"), _T("_v2.5.u22"), _T("_v2.5.u17"), _T("_v2.5.u21"), _T("_v2.5.u28"), _T("_v2.5.u32") } }, + { 82, _T("ar_dart2.zip"), _T("dart2"), _T("arcadia3"), ARCADIA_GAME, 0, 4, 0, 7, 6, 3, 1, 2, 5, NULL, { _T(".u10"), _T(".u6"), _T(".u11"), _T(".u7"), _T(".u12"), _T(".u8"), _T(".u13"), _T(".u9"), _T(".u19"), _T(".u15"), _T(".u20"), _T(".u16") } }, + { 36, _T("ar_fast.zip"), _T("fast-v28"), _T("fast-v28_"), ARCADIA_GAME, 7, 7, 6, 5, 4, 3, 2, 1, 0, NULL, { _T(".u11"), _T(".u15"), _T(".u10"), _T(".u14"), _T(".u9"), _T(".u13"), _T(".u20"), _T(".u24"), _T(".u19"), _T(".u23"), _T(".u18"), _T(".u22"), _T(".u17"), _T(".u21"), _T(".u28"), _T(".u32") } }, + { 83, _T("ar_fasta.zip"), _T("fast-v27"), _T("fast-v27_"), ARCADIA_GAME, 7, 7, 6, 5, 4, 3, 2, 1, 0, NULL, { _T(".u11"), _T(".u15"), _T(".u10"), _T(".u14"), _T(".u9"), _T(".u13"), _T(".u20"), _T(".u24"), _T(".u19"), _T(".u23"), _T(".u18"), _T(".u22"), _T(".u17"), _T(".u21"), _T(".u28"), _T(".u32") } }, + { 37, _T("ar_ldrba.zip"), _T("ldra"), _T("leader_board_0"), ARCADIA_GAME, 7, 7, 6, 5, 4, 3, 2, 1, 0, _T("_v2.4."), { _T("u11"), _T("u15"), _T("u10"), _T("u14"), _T("u9"), _T("u13"), _T("u20"), _T("u24"), _T("u19"), _T("u23"), _T("u18"), _T("u22"), _T("u17"), _T("u21"), _T("u28"), _T("u32") } }, + { 38, _T("ar_ldrbb.zip"),_T("ldrbb"), _T("ldrb_"), ARCADIA_GAME, 5, 7, 6, 5, 4, 3, 2, 1, 0, NULL, { _T(".u11"), _T("_gcp_22.u15"), _T(".u10"), _T(".u14"), _T(".u9"), _T(".u13"), _T(".u20"), _T(".u24"), _T(".u19"), _T(".u23"), _T(".u18"), _T(".u22"), _T(".u17"), _T(".u21"), _T(".u28"), _T(".u32") } }, + { 86, _T("ar_ldrb.zip"),_T("ldrb"), _T("leader_board_0"), ARCADIA_GAME, 7, 2, 3, 4, 1, 0, 7, 5, 6, _T("_v2.5."), { _T("u11"), _T("u15"), _T("u10"), _T("u14"), _T("u9"), _T("u13"), _T("u20"), _T("u24"), _T("u19"), _T("u23"), _T("u18"), _T("u22"), _T("u17"), _T("u21"), _T("u28"), _T("u32") } }, { 39, _T("ar_ninj.zip"), _T("ninj"), _T("ninj_"), ARCADIA_GAME, 5|16, 1, 6, 5, 7, 4, 2, 0, 3 }, - { 84, _T("ar_ninj2.zip"), _T("ninj2"), _T("arcadia5"), ARCADIA_GAME, 0, 1, 6, 5, 7, 4, 2, 0, 3, { _T(".u10"), _T(".u6"), _T(".u11"), _T(".u7"), _T(".u12"), _T(".u8"), _T(".u13"), _T(".u9"), _T(".u19"), _T(".u15"), _T(".u20"), _T(".u16") } }, + { 84, _T("ar_ninj2.zip"), _T("ninj2"), _T("arcadia5"), ARCADIA_GAME, 0, 1, 6, 5, 7, 4, 2, 0, 3, NULL, { _T(".u10"), _T(".u6"), _T(".u11"), _T(".u7"), _T(".u12"), _T(".u8"), _T(".u13"), _T(".u9"), _T(".u19"), _T(".u15"), _T(".u20"), _T(".u16") } }, { 40, _T("ar_rdwr.zip"), _T("rdwr"), _T("rdwr_"), ARCADIA_GAME, 5|16, 3, 1, 6, 4, 0, 5, 2, 7 }, { 41, _T("ar_sdwr.zip"), _T("sdwr"), _T("sdwr_"), ARCADIA_GAME, 5|16, 6, 3, 4, 5, 2, 1, 0, 7 }, - { 85, _T("ar_sdwr2.zip"), _T("sdwr2"), _T("arcadia1"), ARCADIA_GAME, 0, 6, 3, 4, 5, 2, 1, 0, 7, { _T(".u10"), _T(".u6"), _T(".u11"), _T(".u7"), _T(".u12"), _T(".u8"), _T(".u13"), _T(".u9"), _T(".u19"), _T(".u15"), _T(".u20"), _T(".u16") } }, + { 85, _T("ar_sdwr2.zip"), _T("sdwr2"), _T("arcadia1"), ARCADIA_GAME, 0, 6, 3, 4, 5, 2, 1, 0, 7, NULL, { _T(".u10"), _T(".u6"), _T(".u11"), _T(".u7"), _T(".u12"), _T(".u8"), _T(".u13"), _T(".u9"), _T(".u19"), _T(".u15"), _T(".u20"), _T(".u16") } }, { 42, _T("ar_spot.zip"), _T("spotv2"), _T("spotv2."), ARCADIA_GAME, 5, 7, 6, 5, 4, 3, 2, 1, 0 }, { 43, _T("ar_sprg.zip"), _T("sprg"), _T("sprg_"), ARCADIA_GAME, 5|16, 4, 7, 3, 0, 6, 5, 2, 1 }, { 44, _T("ar_xeon.zip"), _T("xeon"), _T("xeon_"), ARCADIA_GAME, 5|16, 3, 1, 2, 4, 0, 5, 6, 7 }, @@ -88,6 +92,7 @@ static struct arcadiarom roms[] = { { 78, _T("ar_blast.zip"), _T("blsb-v2-1"),_T("blsb-v2-1_"), ARCADIA_GAME, 7|16, 4, 1, 7, 6, 2, 0, 3, 5 }, { 79, _T("ar_dlta.zip"), _T("dlta_v3"), _T("dlta_v3_"), ARCADIA_GAME, 7|16, 4, 1, 7, 6, 2, 0, 3, 5 }, { 80, _T("ar_pm.zip"), _T("pm"), _T("pm-"), ARCADIA_GAME, 2|4|16, 7, 6, 5, 4, 3, 2, 1, 0 }, + { 88, _T("ar_argh.zip"), _T("argh"), _T("argh-"), ARCADIA_GAME, 7, 5, 0, 2, 4, 7, 6, 1, 3, _T("-11-28-87"), { _T(".u12"), _T(".u16"), _T(".u11"), _T(".u15"), _T(".u10"), _T(".u14"), _T(".u9"), _T(".u13"), _T(".u20"), _T(".u24"), _T(".u19"), _T(".u23"), _T(".u18"), _T(".u22"), _T(".u17"), _T(".u21"), _T(".u28"), _T(".u32"), _T(".u27"), _T(".u31"), _T(".u26"), _T(".u30"), _T(".u25"), _T(".u29") } }, { -1 } }; @@ -109,7 +114,7 @@ static int boot_read; static int nvwrite; -static int load_rom8 (const TCHAR *xpath, uae_u8 *mem, int extra, const TCHAR **ext) +static int load_rom8 (const TCHAR *xpath, uae_u8 *mem, int extra, const TCHAR *ext, const TCHAR **exts) { struct zfile *zf; TCHAR path[MAX_DPATH]; @@ -120,10 +125,12 @@ static int load_rom8 (const TCHAR *xpath, uae_u8 *mem, int extra, const TCHAR ** extra &= 3; memset (tmp, 0xff, 131072); _stprintf (path, _T("%s%s%s"), xpath, extra == 3 ? _T("-hi") : (extra == 2 ? _T("hi") : (extra == 1 ? _T("h") : _T(""))), bin); - if (ext) { - if (ext[0] == NULL) + if (ext) + _tcscat(path, ext); + if (exts) { + if (exts[0] == NULL) goto end; - _tcscat (path, ext[0]); + _tcscat (path, exts[0]); } //write_log (_T("%s\n"), path); zf = zfile_fopen (path, _T("rb"), ZFD_NORMAL); @@ -134,7 +141,9 @@ static int load_rom8 (const TCHAR *xpath, uae_u8 *mem, int extra, const TCHAR ** zfile_fclose (zf); _stprintf (path, _T("%s%s%s"), xpath, extra == 3 ? _T("-lo") : (extra == 2 ? _T("lo") : (extra == 1 ? _T("l") : _T(""))), bin); if (ext) - _tcscat (path, ext[1]); + _tcscat(path, ext); + if (exts) + _tcscat (path, exts[1]); //write_log (_T("%s\n"), path); zf = zfile_fopen (path, _T("rb"), ZFD_NORMAL); if (!zf) @@ -189,10 +198,13 @@ static int load_roms (struct arcadiarom *rom) int i, offset; TCHAR *xpath; - if (rom->type == ARCADIA_BIOS) + offset = 0; + if (rom->type == ARCADIA_BIOS) { xpath = currprefs.romextfile; - else + offset = bios_offset; + } else { xpath = currprefs.cartfile; + } _tcscpy (path3, xpath); p = path3 + _tcslen (path3) - 1; @@ -210,16 +222,13 @@ static int load_roms (struct arcadiarom *rom) _tcscat (path3, FSDB_DIR_SEPARATOR_S); _tcscat (path3, rom->romid2); - offset = 0; - if (rom->type == ARCADIA_BIOS) - offset = bios_offset; i = 0; for (;;) { if (rom->extra & 4) _stprintf (path, _T("%s%d"), xpath, i + 1); else _tcscpy (path, xpath); - if (!load_rom8 (path, arbmemory + 2 * 65536 * i + offset, rom->extra, rom->exts && rom->exts[0] ? &rom->exts[i * 2] : NULL)) { + if (!load_rom8 (path, arbmemory + 2 * 65536 * i + offset, rom->extra, rom->ext, rom->exts && rom->exts[0] ? &rom->exts[i * 2] : NULL)) { if (i == 0) write_log (_T("Arcadia: %s rom load failed ('%s')\n"), rom->type == ARCADIA_BIOS ? _T("bios") : _T("game"), path); break; @@ -261,6 +270,9 @@ static void decrypt_roms (struct arcadiarom *rom) if (rom->extra == 2) arbmemory[i - 1] = bswap (arbmemory[i - 1],7,6,5,4,3,2,1,0); } + if (rom->romid == 88) { + memcpy(arbmemory + bios_offset, arbmemory, 524288); + } } static uae_u32 REGPARAM2 arbb_lget (uaecptr addr) @@ -460,7 +472,7 @@ int arcadia_map_banks (void) { if (!arcadia_bios) return 0; - arbmemory = xmalloc (uae_u8, allocated_arbmemory); + arbmemory = xmalloc (uae_u8, allocated_arbmemory + allocated_arbbmemory); arbbmemory = arbmemory + bios_offset; memset (arbmemory, 0, allocated_arbmemory); if (!load_roms (arcadia_bios)) { diff --git a/cfgfile.cpp b/cfgfile.cpp index 5cbfc579..debae792 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -178,6 +178,7 @@ static const TCHAR *maxvert[] = { _T("nointerlace"), _T("interlace"), 0 }; static const TCHAR *abspointers[] = { _T("none"), _T("mousehack"), _T("tablet"), 0 }; static const TCHAR *magiccursors[] = { _T("both"), _T("native"), _T("host"), 0 }; static const TCHAR *autoscale[] = { _T("none"), _T("auto"), _T("standard"), _T("max"), _T("scale"), _T("resize"), _T("center"), _T("manual"), _T("integer"), _T("integer_auto"), 0 }; +static const TCHAR *autoscale_rtg[] = { _T("resize"), _T("scale"), _T("center"), _T("integer"), 0 }; static const TCHAR *joyportmodes[] = { _T(""), _T("mouse"), _T("mousenowheel"), _T("djoy"), _T("gamepad"), _T("ajoy"), _T("cdtvjoy"), _T("cd32joy"), _T("lightpen"), 0 }; static const TCHAR *joyaf[] = { _T("none"), _T("normal"), _T("toggle"), 0 }; static const TCHAR *epsonprinter[] = { _T("none"), _T("ascii"), _T("epson_matrix_9pin"), _T("epson_matrix_24pin"), _T("epson_matrix_48pin"), 0 }; @@ -1216,7 +1217,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) if (gf->gfx_filtermask[i][0]) cfgfile_write_str (f, _T("gfx_filtermask_pre"), ext, gf->gfx_filtermask[i]); } - for (int i = 0; i gfx_filtershader[i + MAX_FILTERSHADERS][0]) cfgfile_write_ext (f, _T("gfx_filter_post"), ext, _T("D3D:%s"), gf->gfx_filtershader[i + MAX_FILTERSHADERS]); if (gf->gfx_filtermask[i + MAX_FILTERSHADERS][0]) @@ -1264,7 +1265,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) cfgfile_dwrite_bool (f, _T("gfx_filter_bilinear"), ext, gf->gfx_filter_bilinear != 0); cfgfile_dwrite_ext (f, _T("gfx_filter_keep_autoscale_aspect"), ext, _T("%d"), gf->gfx_filter_keep_autoscale_aspect); cfgfile_dwrite_str (f, _T("gfx_filter_keep_aspect"), ext, aspects[gf->gfx_filter_keep_aspect]); - cfgfile_dwrite_str (f, _T("gfx_filter_autoscale"), ext, autoscale[gf->gfx_filter_autoscale]); + cfgfile_dwrite_str(f, _T("gfx_filter_autoscale"), ext, ext == NULL ? autoscale[gf->gfx_filter_autoscale] : autoscale_rtg[gf->gfx_filter_autoscale]); cfgfile_dwrite_ext (f, _T("gfx_filter_aspect_ratio"), ext, _T("%d:%d"), gf->gfx_filter_aspect >= 0 ? (gf->gfx_filter_aspect / ASPECTMULT) : -1, gf->gfx_filter_aspect >= 0 ? (gf->gfx_filter_aspect & (ASPECTMULT - 1)) : -1); @@ -2094,7 +2095,7 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) for (int j = 0; j < 2; j++) { struct gfx_filterdata *gf = &p->gf[j]; const TCHAR *ext = j == 0 ? NULL : _T("_rtg"); - if (cfgfile_strval (option, value, _T("gfx_filter_autoscale"), ext, &gf->gfx_filter_autoscale, autoscale, 0) + if (cfgfile_strval (option, value, _T("gfx_filter_autoscale"), ext, &gf->gfx_filter_autoscale, j == 0 ? autoscale : autoscale_rtg, 0) || cfgfile_strval (option, value, _T("gfx_filter_keep_aspect"), ext, &gf->gfx_filter_keep_aspect, aspects, 0)) return 1; if (cfgfile_floatval (option, value, _T("gfx_filter_vert_zoomf"), ext, &gf->gfx_filter_vert_zoom) @@ -2341,7 +2342,7 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) *s++ = 0; if (!_tcscmp (value, _T("D3D"))) { p->gfx_api = 1; - if (_tcscmp (option, _T("gfx_filter_pre")) == 0) { + if (_tcscmp (option, _T("gfx_filter_pre")) == 0 || _tcscmp (option, _T("gfx_filter_pre_rtg")) == 0) { for (int i = 0; i < MAX_FILTERSHADERS; i++) { if (gf->gfx_filtershader[i][0] == 0) { _tcscpy (gf->gfx_filtershader[i], s); @@ -4914,7 +4915,7 @@ uae_u32 cfgfile_modify (uae_u32 index, TCHAR *parms, uae_u32 size, TCHAR *out, u } } set_config_changed (); - set_special (SPCFLAG_BRK); + set_special(SPCFLAG_MODE_CHANGE); i++; } } @@ -5295,7 +5296,7 @@ void default_prefs (struct uae_prefs *p, int type) p->cpu_frequency = 0; p->mmu_model = 0; p->cpu060_revision = 6; - p->fpu_revision = -1; + p->fpu_revision = 0; p->fpu_no_unimplemented = false; p->int_no_unimplemented = false; p->m68k_speed = 0; @@ -5616,8 +5617,10 @@ static int bip_a4000 (struct uae_prefs *p, int config, int compa, int romcheck) p->mbresmem_low_size = 8 * 1024 * 1024; p->cpu_model = 68030; p->fpu_model = 68882; - if (config > 0) - p->cpu_model = p->fpu_model = 68040; + if (config > 0) { + p->cpu_model = 68040; + p->fpu_model = 68040; + } p->chipset_mask = CSMASK_AGA | CSMASK_ECS_AGNUS | CSMASK_ECS_DENISE; p->cpu_compatible = p->address_space_24 = 0; p->m68k_speed = -1; @@ -5648,8 +5651,10 @@ static int bip_a4000t (struct uae_prefs *p, int config, int compa, int romcheck) p->mbresmem_low_size = 8 * 1024 * 1024; p->cpu_model = 68030; p->fpu_model = 68882; - if (config > 0) - p->cpu_model = p->fpu_model = 68040; + if (config > 0) { + p->cpu_model = 68040; + p->fpu_model = 68040; + } p->chipset_mask = CSMASK_AGA | CSMASK_ECS_AGNUS | CSMASK_ECS_DENISE; p->cpu_compatible = p->address_space_24 = 0; p->m68k_speed = -1; diff --git a/cpummu30.cpp b/cpummu30.cpp index b84affc1..b7b69079 100644 --- a/cpummu30.cpp +++ b/cpummu30.cpp @@ -2170,6 +2170,13 @@ void m68k_do_rte_mmu030 (uaecptr a7) uae_u16 frame = format >> 12; uae_u16 ssw = get_word_mmu030 (a7 + 10); + // Fetch last word, real CPU does it to allow OS bus handler to map + // the page if frame crosses pages and following page is not resident. + if (frame == 0xb) + get_word_mmu030(a7 + 92 - 2); + else + get_word_mmu030(a7 + 32 - 2); + // Internal register, our opcode storage area mmu030_opcode = get_long_mmu030 (a7 + 0x14); // Misc state data diff --git a/custom.cpp b/custom.cpp index 37089b32..4c577e35 100644 --- a/custom.cpp +++ b/custom.cpp @@ -527,8 +527,7 @@ STATIC_INLINE uae_u8 *pfield_xlateptr (uaecptr plpt, int bytecount) } return chipmem_xlate_indirect (plpt); } - -STATIC_INLINE void docols (struct color_entry *colentry) +static void docols (struct color_entry *colentry) { int i; @@ -1248,7 +1247,7 @@ static void fetch_warn (int nr, int hpos) #endif } -STATIC_INLINE void fetch (int nr, int fm, int hpos) +static void fetch (int nr, int fm, int hpos) { if (nr < bplcon0_planes_limit) { uaecptr p; @@ -1669,7 +1668,7 @@ static void update_denise_shifter_planes (int hpos) } } -STATIC_INLINE void update_denise (int hpos) +static void update_denise (int hpos) { int res = GET_RES_DENISE (bplcon0d); if (res != toscr_res) @@ -1699,7 +1698,7 @@ STATIC_INLINE void fetch_start (int hpos) /* Called when all planes have been fetched, i.e. when a new block of data is available to be displayed. The data in fetched[] is moved into todisplay[]. */ -STATIC_INLINE void beginning_of_plane_block (int hpos, int fm) +static void beginning_of_plane_block (int hpos, int fm) { int i; @@ -2297,7 +2296,7 @@ STATIC_INLINE int get_ddfstop_to_test (int hpos) return ddfstop_to_test; } -STATIC_INLINE void update_fetch (int until, int fm) +static void update_fetch (int until, int fm) { int pos; int dma = dmaen (DMA_BITPLANE); @@ -2419,7 +2418,7 @@ static void update_fetch_0 (int hpos) { update_fetch (hpos, 0); } static void update_fetch_1 (int hpos) { update_fetch (hpos, 1); } static void update_fetch_2 (int hpos) { update_fetch (hpos, 2); } -STATIC_INLINE void decide_fetch (int hpos) +static void decide_fetch (int hpos) { if (hpos > last_fetch_hpos) { if (fetch_state != fetch_not_started) { @@ -2577,7 +2576,7 @@ STATIC_INLINE bool cant_this_last_line (void) } /* This function is responsible for turning on datafetch if necessary. */ -STATIC_INLINE void decide_line (int hpos) +static void decide_line (int hpos) { /* Take care of the vertical DIW. */ if (vpos == plffirstline) { @@ -2958,7 +2957,7 @@ static void do_sprite_collisions (void) #endif } -STATIC_INLINE void record_sprite_1 (int sprxp, uae_u16 *buf, uae_u32 datab, int num, int dbl, +static void record_sprite_1 (int sprxp, uae_u16 *buf, uae_u32 datab, int num, int dbl, unsigned int mask, int do_collisions, uae_u32 collision_mask) { int j = 0; @@ -3239,7 +3238,7 @@ static void decide_sprites (int hpos) #endif } -STATIC_INLINE int sprites_differ (struct draw_info *dip, struct draw_info *dip_old) +static int sprites_differ (struct draw_info *dip, struct draw_info *dip_old) { struct sprite_entry *this_first = curr_sprite_entries + dip->first_sprite_entry; struct sprite_entry *this_last = curr_sprite_entries + dip->last_sprite_entry; @@ -3269,7 +3268,7 @@ STATIC_INLINE int sprites_differ (struct draw_info *dip, struct draw_info *dip_o return 0; } -STATIC_INLINE int color_changes_differ (struct draw_info *dip, struct draw_info *dip_old) +static int color_changes_differ (struct draw_info *dip, struct draw_info *dip_old) { if (dip->nr_color_changes != dip_old->nr_color_changes) return 1; @@ -4846,7 +4845,7 @@ static void BPLCON0 (int hpos, uae_u16 v) BPLCON0_Denise (hpos, v, true); } -STATIC_INLINE void BPLCON1 (int hpos, uae_u16 v) +static void BPLCON1 (int hpos, uae_u16 v) { if (!(currprefs.chipset_mask & CSMASK_AGA)) v &= 0xff; @@ -4859,7 +4858,7 @@ STATIC_INLINE void BPLCON1 (int hpos, uae_u16 v) bplcon1 = v; } -STATIC_INLINE void BPLCON2 (int hpos, uae_u16 v) +static void BPLCON2(int hpos, uae_u16 v) { if (!(currprefs.chipset_mask & CSMASK_AGA)) v &= 0x7f; @@ -4871,7 +4870,7 @@ STATIC_INLINE void BPLCON2 (int hpos, uae_u16 v) } #ifdef ECS_DENISE -STATIC_INLINE void BPLCON3 (int hpos, uae_u16 v) +static void BPLCON3(int hpos, uae_u16 v) { if (!(currprefs.chipset_mask & CSMASK_ECS_DENISE)) return; @@ -4892,7 +4891,7 @@ STATIC_INLINE void BPLCON3 (int hpos, uae_u16 v) } #endif #ifdef AGA -STATIC_INLINE void BPLCON4 (int hpos, uae_u16 v) +static void BPLCON4(int hpos, uae_u16 v) { if (!(currprefs.chipset_mask & CSMASK_AGA)) return; @@ -5256,7 +5255,7 @@ STATIC_INLINE void sprstartstop (struct sprite *s) s->dmastate = 0; } -STATIC_INLINE void SPRxCTLPOS (int num) +static void SPRxCTLPOS(int num) { int sprxp; struct sprite *s = &spr[num]; @@ -5290,7 +5289,7 @@ STATIC_INLINE void SPRxCTLPOS (int num) sprstartstop (s); } -STATIC_INLINE void SPRxCTL_1 (uae_u16 v, int num, int hpos) +static void SPRxCTL_1(uae_u16 v, int num, int hpos) { struct sprite *s = &spr[num]; sprctl[num] = v; @@ -5304,7 +5303,7 @@ STATIC_INLINE void SPRxCTL_1 (uae_u16 v, int num, int hpos) #endif } -STATIC_INLINE void SPRxPOS_1 (uae_u16 v, int num, int hpos) +static void SPRxPOS_1(uae_u16 v, int num, int hpos) { struct sprite *s = &spr[num]; sprpos[num] = v; @@ -5316,7 +5315,7 @@ STATIC_INLINE void SPRxPOS_1 (uae_u16 v, int num, int hpos) } #endif } -STATIC_INLINE void SPRxDATA_1 (uae_u16 v, int num, int hpos) +static void SPRxDATA_1(uae_u16 v, int num, int hpos) { sprdata[num][0] = v; #ifdef AGA @@ -5332,7 +5331,7 @@ STATIC_INLINE void SPRxDATA_1 (uae_u16 v, int num, int hpos) } #endif } -STATIC_INLINE void SPRxDATB_1 (uae_u16 v, int num, int hpos) +static void SPRxDATB_1(uae_u16 v, int num, int hpos) { sprdatb[num][0] = v; #ifdef AGA @@ -6133,7 +6132,7 @@ static void cursorsprite (void) } } -STATIC_INLINE uae_u16 sprite_fetch (struct sprite *s, int dma, int hpos, int cycle, int mode) +static uae_u16 sprite_fetch(struct sprite *s, int dma, int hpos, int cycle, int mode) { uae_u16 data = last_custom_value1; if (dma) { @@ -6149,14 +6148,14 @@ STATIC_INLINE uae_u16 sprite_fetch (struct sprite *s, int dma, int hpos, int cyc s->pt += 2; return data; } -STATIC_INLINE uae_u16 sprite_fetch2 (struct sprite *s, int hpos, int cycle, int mode) +static uae_u16 sprite_fetch2(struct sprite *s, int hpos, int cycle, int mode) { uae_u16 data = chipmem_wget_indirect (s->pt); s->pt += 2; return data; } -STATIC_INLINE void do_sprites_1 (int num, int cycle, int hpos) +static void do_sprites_1(int num, int cycle, int hpos) { struct sprite *s = &spr[num]; int dma, posctl = 0; @@ -8125,7 +8124,7 @@ static uae_u32 REGPARAM2 custom_lgeti (uaecptr addr) return custom_lget (addr); } -STATIC_INLINE uae_u32 REGPARAM2 custom_wget_1 (int hpos, uaecptr addr, int noput, bool isbyte) +static uae_u32 REGPARAM2 custom_wget_1(int hpos, uaecptr addr, int noput, bool isbyte) { uae_u16 v; int missing; @@ -8225,7 +8224,7 @@ writeonly: return v; } -STATIC_INLINE uae_u32 custom_wget2 (uaecptr addr, bool byte) +static uae_u32 custom_wget2(uaecptr addr, bool byte) { uae_u32 v; int hpos = current_hpos (); @@ -9218,7 +9217,7 @@ STATIC_INLINE void decide_fetch_ce (int hpos) // blitter idle cycles do count!) extern int cpu_tracer; -STATIC_INLINE int dma_cycle (void) +static int dma_cycle (void) { int hpos, hpos_old; diff --git a/drawing.cpp b/drawing.cpp index 572997a3..43c3633f 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -2135,7 +2135,7 @@ STATIC_INLINE void do_flush_line (struct vidbuffer *vb, int lineno) * systems. */ -STATIC_INLINE void do_flush_screen (struct vidbuffer *vb, int start, int stop) +static void do_flush_screen (struct vidbuffer *vb, int start, int stop) { /* TODO: this flush operation is executed outside locked state! Should be corrected. @@ -2649,12 +2649,13 @@ static void center_image (void) } static int frame_res_cnt; +static int autoswitch_old_resolution; static void init_drawing_frame (void) { int i, maxline; static int frame_res_old; - if (currprefs.gfx_autoresolution && lines_count > 0) { + if (lines_count > 0) { int frame_res_detected; int frame_res_lace_detected = frame_res_lace; @@ -2670,81 +2671,113 @@ static void init_drawing_frame (void) } } - if (currprefs.gfx_autoresolution == 1) - frame_res_detected = largest_res; - else if (largest_count * 100 / lines_count >= currprefs.gfx_autoresolution) - frame_res_detected = largest_count_res; - else - frame_res_detected = largest_count_res - 1; - if (frame_res_detected < 0) - frame_res_detected = 0; -#if 0 - static int delay; - delay--; - if (delay < 0) { - delay = 50; - write_log (_T("%d %d, %d %d %d, %d %d, %d %d\n"), currprefs.gfx_autoresolution, lines_count, resolution_count[0], resolution_count[1], resolution_count[2], - largest_count, largest_count_res, frame_res_detected, frame_res_lace_detected); + if (programmedmode && gfxvidinfo.gfx_resolution_reserved >= RES_HIRES && gfxvidinfo.gfx_vresolution_reserved >= VRES_DOUBLE) { + if (largest_res == RES_SUPERHIRES && (gfxvidinfo.gfx_resolution_reserved < RES_SUPERHIRES || gfxvidinfo.gfx_vresolution_reserved < 1)) { + // enable full doubling/superhires support if programmed mode. It may be "half-width" only and may fit in normal display window. + gfxvidinfo.gfx_resolution_reserved = RES_SUPERHIRES; + gfxvidinfo.gfx_vresolution_reserved = VRES_DOUBLE; + graphics_reset(); + } + int newres = largest_res; + if (htotal < 200) + newres = largest_res + 1; + if (newres < RES_HIRES) + newres = RES_HIRES; + if (newres > RES_MAX) + newres = RES_MAX; + if (changed_prefs.gfx_resolution != newres) { + autoswitch_old_resolution = RES_HIRES; + changed_prefs.gfx_resolution = newres; + write_log(_T("NEWRES = %d\n"), newres); + } + } else if (autoswitch_old_resolution == 1) { + changed_prefs.gfx_resolution = RES_HIRES; + autoswitch_old_resolution = 0; } -#endif - if (frame_res_detected >= 0 && frame_res_lace_detected >= 0) { - if (frame_res_cnt > 0 && frame_res_old == frame_res_detected * 2 + frame_res_lace_detected) { - frame_res_cnt--; - if (frame_res_cnt == 0) { - int m = frame_res_detected * 2 + frame_res_lace_detected; - struct wh *dst = currprefs.gfx_apmode[0].gfx_fullscreen ? &changed_prefs.gfx_size_fs : &changed_prefs.gfx_size_win; - while (m < 3 * 2) { - struct wh *src = currprefs.gfx_apmode[0].gfx_fullscreen ? &currprefs.gfx_size_fs_xtra[m] : &currprefs.gfx_size_win_xtra[m]; - if ((src->width > 0 && src->height > 0) || (currprefs.gfx_api || currprefs.gf[0].gfx_filter > 0)) { - int nr = m >> 1; - int nl = (m & 1) == 0 ? 0 : 1; - int nr_o = nr; - int nl_o = nl; - - if (currprefs.gfx_autoresolution_minh < 0) { - if (nr < nl) - nr = nl; - } else if (nr < currprefs.gfx_autoresolution_minh) { - nr = currprefs.gfx_autoresolution_minh; - } - if (currprefs.gfx_autoresolution_minv < 0) { - if (nl < nr) - nl = nr; - } else if (nl < currprefs.gfx_autoresolution_minv) { - nl = currprefs.gfx_autoresolution_minv; - } - if (nr > gfxvidinfo.gfx_resolution_reserved) - nr = gfxvidinfo.gfx_resolution_reserved; - if (nl > gfxvidinfo.gfx_vresolution_reserved) - nl = gfxvidinfo.gfx_vresolution_reserved; - - if (changed_prefs.gfx_resolution != nr || changed_prefs.gfx_vresolution != nl) { - changed_prefs.gfx_resolution = nr; - changed_prefs.gfx_vresolution = nl; - write_log (_T("RES -> %d (%d) LINE -> %d (%d) (%d - %d, %d - %d)\n"), nr, nr_o, nl, nl_o, - currprefs.gfx_autoresolution_minh, currprefs.gfx_autoresolution_minv, - gfxvidinfo.gfx_resolution_reserved, gfxvidinfo.gfx_vresolution_reserved); - set_config_changed (); - //activate_debugger (); - } - if (src->width > 0 && src->height > 0) { - if (memcmp (dst, src, sizeof *dst)) { - *dst = *src; + if (currprefs.gfx_autoresolution) { + + if (currprefs.gfx_autoresolution == 1 || currprefs.gfx_autoresolution >= 100) + frame_res_detected = largest_res; + else if (largest_count * 100 / lines_count >= currprefs.gfx_autoresolution) + frame_res_detected = largest_count_res; + else + frame_res_detected = largest_count_res - 1; + if (frame_res_detected < 0) + frame_res_detected = 0; + #if 0 + static int delay; + delay--; + if (delay < 0) { + delay = 50; + write_log (_T("%d %d, %d %d %d, %d %d, %d %d\n"), currprefs.gfx_autoresolution, lines_count, resolution_count[0], resolution_count[1], resolution_count[2], + largest_count, largest_count_res, frame_res_detected, frame_res_lace_detected); + } + #endif + if (frame_res_detected >= 0 && frame_res_lace_detected >= 0) { + if (frame_res_cnt > 0 && frame_res_old == frame_res_detected * 2 + frame_res_lace_detected) { + frame_res_cnt--; + if (frame_res_cnt == 0) { + int m = frame_res_detected * 2 + frame_res_lace_detected; + struct wh *dst = currprefs.gfx_apmode[0].gfx_fullscreen ? &changed_prefs.gfx_size_fs : &changed_prefs.gfx_size_win; + while (m < 3 * 2) { + struct wh *src = currprefs.gfx_apmode[0].gfx_fullscreen ? &currprefs.gfx_size_fs_xtra[m] : &currprefs.gfx_size_win_xtra[m]; + if ((src->width > 0 && src->height > 0) || (currprefs.gfx_api || currprefs.gf[0].gfx_filter > 0)) { + int nr = m >> 1; + int nl = (m & 1) == 0 ? 0 : 1; + int nr_o = nr; + int nl_o = nl; + + if (currprefs.gfx_autoresolution >= 100 && nl == 0 && nr > 0) { + nl = 1; + } + + if (currprefs.gfx_autoresolution_minh < 0) { + if (nr < nl) + nr = nl; + } else if (nr < currprefs.gfx_autoresolution_minh) { + nr = currprefs.gfx_autoresolution_minh; + } + if (currprefs.gfx_autoresolution_minv < 0) { + if (nl < nr) + nl = nr; + } else if (nl < currprefs.gfx_autoresolution_minv) { + nl = currprefs.gfx_autoresolution_minv; + } + + if (nr > gfxvidinfo.gfx_resolution_reserved) + nr = gfxvidinfo.gfx_resolution_reserved; + if (nl > gfxvidinfo.gfx_vresolution_reserved) + nl = gfxvidinfo.gfx_vresolution_reserved; + + if (changed_prefs.gfx_resolution != nr || changed_prefs.gfx_vresolution != nl) { + changed_prefs.gfx_resolution = nr; + changed_prefs.gfx_vresolution = nl; + + write_log (_T("RES -> %d (%d) LINE -> %d (%d) (%d - %d, %d - %d)\n"), nr, nr_o, nl, nl_o, + currprefs.gfx_autoresolution_minh, currprefs.gfx_autoresolution_minv, + gfxvidinfo.gfx_resolution_reserved, gfxvidinfo.gfx_vresolution_reserved); set_config_changed (); + //activate_debugger (); + } + if (src->width > 0 && src->height > 0) { + if (memcmp (dst, src, sizeof *dst)) { + *dst = *src; + set_config_changed (); + } } + break; } - break; + m++; } - m++; + frame_res_cnt = currprefs.gfx_autoresolution_delay; } + } else { + frame_res_old = frame_res_detected * 2 + frame_res_lace_detected; frame_res_cnt = currprefs.gfx_autoresolution_delay; + if (frame_res_cnt <= 0) + frame_res_cnt = 1; } - } else { - frame_res_old = frame_res_detected * 2 + frame_res_lace_detected; - frame_res_cnt = currprefs.gfx_autoresolution_delay; - if (frame_res_cnt <= 0) - frame_res_cnt = 1; } } } @@ -3189,7 +3222,7 @@ void vsync_handle_redraw (int long_field, int lof_changed, uae_u16 bplcon0p, uae #endif quit_program = -quit_program; set_inhibit_frame (IHF_QUIT_PROGRAM); - set_special (SPCFLAG_BRK); + set_special(SPCFLAG_BRK | SPCFLAG_MODE_CHANGE); return; } diff --git a/fpp.cpp b/fpp.cpp index 5bacdce6..c0798629 100644 --- a/fpp.cpp +++ b/fpp.cpp @@ -142,8 +142,8 @@ static void fpnan (fpdata *fpd) { fpd->fp = *fp_nan; #ifdef USE_SOFT_LONG_DOUBLE - fpd->fpe = ((uae_u64)dhex_nan[0] << 32) | dhex_nan[1]; - fpd->fpm = dhex_nan[2]; + fpd->fpe = ((uae_u64)xhex_nan[0] << 32) | xhex_nan[1]; + fpd->fpm = xhex_nan[2]; #endif } @@ -766,18 +766,25 @@ STATIC_INLINE void set_fpsr (uae_u32 x) fpset (®s.fp_result, 1); } -uae_u32 get_ftag (fpdata *fp) +uae_u32 get_ftag (uae_u32 w1, uae_u32 w2, uae_u32 w3) { - uae_u32 sr; - regs.fp_result = *fp; - sr = get_fpsr (); - if (sr & 0x01000000) - return 3; - if (sr & 0x02000000) - return 2; - if (sr & 0x04000000) - return 1; - return 0; + int exp = (w1 >> 16) & 0x7fff; + + if (exp == 0) { + if (!w2 && !w3) + return 1; // ZERO + return 4; // DENORMAL or UNNORMAL + } else if (exp == 0x7fff) { + int s = w2 >> 30; + int z = (w2 & 0x3fffffff) == 0 && w3 == 0; + if ((s == 0 && !z) || (s == 2 && !z)) + return 2; // INF + return 3; // NAN + } else { + if (!(w2 & 0x80000000)) + return 4; // UNNORMAL + return 0; // NORMAL + } } /* single : S 8*E 23*F */ @@ -1603,9 +1610,9 @@ void fpuop_save (uae_u32 opcode) #if EXCEPTION_FPP #if USE_LONG_DOUBLE - write_log(_T("68060 FSAVE EXCP %Le\n"), regs.exp_src1); + write_log(_T("68060 FSAVE EXCP %Le\n"), regs.exp_src1.fp); #else - write_log(_T("68060 FSAVE EXCP %e\n"), regs.exp_src1); + write_log(_T("68060 FSAVE EXCP %e\n"), regs.exp_src1.fp); #endif #endif @@ -1646,8 +1653,8 @@ void fpuop_save (uae_u32 opcode) from_exten(®s.exp_src1, &src1[0], &src1[1], &src1[2]); from_exten(®s.exp_src2, &src2[0], &src2[1], &src2[2]); - stag = get_ftag(®s.exp_src1); - dtag = get_ftag(®s.exp_src2); + stag = get_ftag(src1[0], src1[1], src1[2]); + dtag = get_ftag(src2[0], src2[1], src2[2]); if ((extra & 0x7f) == 4) // FSQRT 4->5 extra |= 1; @@ -1657,9 +1664,9 @@ void fpuop_save (uae_u32 opcode) write_log(_T(" PACKED %08x-%08x-%08x"), regs.exp_pack[0], regs.exp_pack[1], regs.exp_pack[2]); } else { #if USE_LONG_DOUBLE - write_log(_T(" SRC=%Le (%d), DST=%Le (%d)"), regs.exp_src1, stag, regs.exp_src2, dtag); + write_log(_T(" SRC=%Le (%08x-%08x-%08x %d), DST=%Le (%08x-%08x-%08x %d)"), regs.exp_src1.fp, src1[0], src1[1], src1[2], stag, regs.exp_src2.fp, src2[0], src2[1], src2[2], dtag); #else - write_log(_T(" SRC=%e (%d), DST=%e (%d)"), regs.exp_src1, stag, regs.exp_src2, dtag); + write_log(_T(" SRC=%e (%08x-%08x-%08x %d), DST=%e (%08x-%08x-%08x %d)"), regs.exp_src1.fp, src1[0], src1[1], src1[2], stag, regs.exp_src2.fp, src2[0], src2[1], src2[2], dtag); #endif } write_log(_T("\n")); @@ -2532,15 +2539,16 @@ void fpu_reset (void) uae_u8 *restore_fpu (uae_u8 *src) { + uae_u32 w1, w2, w3; int i; uae_u32 flags; changed_prefs.fpu_model = currprefs.fpu_model = restore_u32 (); flags = restore_u32 (); for (i = 0; i < 8; i++) { - uae_u32 w1 = restore_u32 (); - uae_u32 w2 = restore_u32 (); - uae_u32 w3 = restore_u16 (); + w1 = restore_u32 (); + w2 = restore_u32 (); + w3 = restore_u16 (); to_exten (®s.fp[i], w1, w2, w3); } regs.fpcr = restore_u32 (); @@ -2551,15 +2559,34 @@ uae_u8 *restore_fpu (uae_u8 *src) restore_u32 (); restore_u32 (); } + if (flags & 0x40000000) { + w1 = restore_u32(); + w2 = restore_u32(); + w3 = restore_u16(); + to_exten(®s.exp_src1, w1, w2, w3); + w1 = restore_u32(); + w2 = restore_u32(); + w3 = restore_u16(); + to_exten(®s.exp_src2, w1, w2, w3); + regs.exp_pack[0] = restore_u32(); + regs.exp_pack[1] = restore_u32(); + regs.exp_pack[2] = restore_u32(); + regs.exp_opcode = restore_u16(); + regs.exp_extra = restore_u16(); + regs.exp_type = restore_u16(); + } regs.fpu_state = (flags & 1) ? 0 : 1; regs.fpu_exp_state = (flags & 2) ? 1 : 0; - write_log (_T("FPU: %d\n"), currprefs.fpu_model); + if (flags & 4) + regs.fpu_exp_state = 2; + write_log(_T("FPU: %d\n"), currprefs.fpu_model); return src; } uae_u8 *save_fpu (int *len, uae_u8 *dstptr) { - uae_u8 *dstbak,*dst; + uae_u32 w1, w2, w3; + uae_u8 *dstbak, *dst; int i; *len = 0; @@ -2570,9 +2597,8 @@ uae_u8 *save_fpu (int *len, uae_u8 *dstptr) else dstbak = dst = xmalloc (uae_u8, 4+4+8*10+4+4+4+4+4); save_u32 (currprefs.fpu_model); - save_u32 (0x80000000 | (regs.fpu_state == 0 ? 1 : 0) | (regs.fpu_exp_state ? 2 : 0)); + save_u32 (0x80000000 | 0x40000000 | (regs.fpu_state == 0 ? 1 : 0) | (regs.fpu_exp_state ? 2 : 0) | (regs.fpu_exp_state > 1 ? 4 : 0)); for (i = 0; i < 8; i++) { - uae_u32 w1, w2, w3; from_exten (®s.fp[i], &w1, &w2, &w3); save_u32 (w1); save_u32 (w2); @@ -2581,8 +2607,25 @@ uae_u8 *save_fpu (int *len, uae_u8 *dstptr) save_u32 (regs.fpcr); save_u32 (regs.fpsr); save_u32 (regs.fpiar); + save_u32 (-1); save_u32 (0); + + from_exten(®s.exp_src1, &w1, &w2, &w3); + save_u32(w1); + save_u32(w2); + save_u16(w3); + from_exten(®s.exp_src2, &w1, &w2, &w3); + save_u32(w1); + save_u32(w2); + save_u16(w3); + save_u32(regs.exp_pack[0]); + save_u32(regs.exp_pack[1]); + save_u32(regs.exp_pack[2]); + save_u16(regs.exp_opcode); + save_u16(regs.exp_extra); + save_u16(regs.exp_type); + *len = dst - dstbak; return dstbak; } diff --git a/include/arcadia.h b/include/arcadia.h index a246ff1c..4761620a 100644 --- a/include/arcadia.h +++ b/include/arcadia.h @@ -15,7 +15,8 @@ struct arcadiarom { const TCHAR *name, *romid1, *romid2; int type, extra; int b7, b6, b5, b4, b3, b2, b1, b0; - const TCHAR *exts[16 + 1]; + const TCHAR *ext; + const TCHAR *exts[24 + 1]; }; extern struct arcadiarom *arcadia_bios, *arcadia_game; diff --git a/include/newcpu.h b/include/newcpu.h index e56d86ed..2b4bd805 100644 --- a/include/newcpu.h +++ b/include/newcpu.h @@ -247,6 +247,7 @@ STATIC_INLINE uae_u32 munge24 (uae_u32 x) extern int mmu_enabled, mmu_triggered; extern int cpu_cycles; extern int cpucycleunit; +extern bool m68k_pc_indirect; STATIC_INLINE void set_special (uae_u32 x) { regs.spcflags |= x; @@ -298,18 +299,20 @@ STATIC_INLINE void m68k_incpci (int o) STATIC_INLINE void m68k_incpc_normal (int o) { - if ((currprefs.mmu_model || currprefs.cpu_compatible) && !currprefs.cachesize) - m68k_incpci (o); + if (m68k_pc_indirect) + m68k_incpci(o); else m68k_incpc (o); } STATIC_INLINE void m68k_setpc_normal (uaecptr pc) { - if ((currprefs.mmu_model || currprefs.cpu_compatible) && !currprefs.cachesize) + if (m68k_pc_indirect) { + regs.pc_p = regs.pc_oldp = 0; m68k_setpci(pc); - else - m68k_setpc (pc); + } else { + m68k_setpc(pc); + } } STATIC_INLINE void m68k_do_rts (void) @@ -477,6 +480,8 @@ extern uae_u32 fpp_get_fpsr (void); extern void fpu_reset (void); extern void fpux_save (int*); extern void fpux_restore (int*); +extern bool fpu_get_constant(fpdata *fp, int cr); +extern int fpp_cond(int condition); extern void exception3 (uae_u32 opcode, uaecptr addr); extern void exception3i (uae_u32 opcode, uaecptr addr); diff --git a/include/options.h b/include/options.h index 711075b3..28e7d3f7 100644 --- a/include/options.h +++ b/include/options.h @@ -550,7 +550,6 @@ struct uae_prefs { bool win32_iconified_nosound; bool win32_rtgmatchdepth; - int win32_rtgscalemode; bool win32_rtgallowscaling; int win32_rtgscaleaspectratio; int win32_rtgvblankrate; diff --git a/include/readcpu.h b/include/readcpu.h index a9d106d4..02043fad 100644 --- a/include/readcpu.h +++ b/include/readcpu.h @@ -96,6 +96,7 @@ extern struct instr { unsigned int cc:4; unsigned int plev:2; unsigned int size:2; + unsigned int unsized:1; unsigned int smode:5; unsigned int stype:3; unsigned int dmode:5; diff --git a/include/xwin.h b/include/xwin.h index 4bea28a8..cd3c5e94 100644 --- a/include/xwin.h +++ b/include/xwin.h @@ -19,7 +19,8 @@ extern uae_u32 p96_rgbx16[65536]; extern int graphics_setup (void); extern int graphics_init (bool); -extern void graphics_leave (void); +extern void graphics_leave(void); +extern void graphics_reset(void); extern bool handle_events (void); extern int handle_msgpump (void); extern void setup_brkhandler (void); diff --git a/jit/compemu.h b/jit/compemu.h index 7b7677f5..bedd3778 100644 --- a/jit/compemu.h +++ b/jit/compemu.h @@ -446,10 +446,6 @@ DECLARE(fmovs_rm(FW r, MEMR m)); DECLARE(fmovs_mr(MEMW m, FR r)); DECLARE(fcuts_r(FRW r)); DECLARE(fcut_r(FRW r)); -DECLARE(fmovl_ri(FW r, IMMS i)); -DECLARE(fmovs_ri(FW r, IMM i)); -DECLARE(fmov_ri(FW r, IMM i1, IMM i2)); -DECLARE(fmov_ext_ri(FW r, IMM i1, IMM i2, IMM i3)); DECLARE(fmov_ext_mr(MEMW m, FR r)); DECLARE(fmov_ext_rm(FW r, MEMR m)); DECLARE(fmov_rr(FW d, FR s)); diff --git a/jit/compemu_fpp.cpp b/jit/compemu_fpp.cpp index 80399c7e..eb5752d4 100644 --- a/jit/compemu_fpp.cpp +++ b/jit/compemu_fpp.cpp @@ -141,83 +141,75 @@ STATIC_INLINE int comp_fp_get (uae_u32 opcode, uae_u16 extra, int treg) case 3: /* (d8,PC,Xn) or (bd,PC,Xn) or ([bd,PC,Xn],od) or ([bd,PC],Xn,od) */ return -1; /* rarely used, fallback to non-JIT */ case 4: /* # < data >; Constants should be converted just once by the JIT */ -#if 1 - { - uae_u32 address=start_pc+((char *)comp_pc_p-(char *)start_pc_p)+ - m68k_pc_offset; - uae_u32 ad=S1; - if (size == 6) - address++; - mov_l_ri(ad,address); - m68k_pc_offset+=sz2[size]; - break; - } -#else - /* disable until rare bug is found */ m68k_pc_offset += sz2[size]; switch (size) { case 0: { - uae_s32 li = comp_get_ilong (m68k_pc_offset - 4); - float si = (float) li; + uae_s32 li = comp_get_ilong(m68k_pc_offset - 4); + float si = (float)li; - if (li == (int) si) { - //write_log (_T("converted immediate LONG constant to SINGLE\n")); - fmovs_ri (treg, *(uae_u32 *) &si); + if (li == (int)si) { + //write_log ("converted immediate LONG constant to SINGLE\n"); + mov_l_mi((uae_u32)temp_fp, *(uae_u32 *)&si); + fmovs_rm(treg, (uae_u32)temp_fp); return 1; } - //write_log (_T("immediate LONG constant\n")); - fmovl_ri (treg, li); + //write_log ("immediate LONG constant\n"); + mov_l_mi((uae_u32)temp_fp, *(uae_u32 *)&li); + fmovi_rm(treg, (uae_u32)temp_fp); return 2; } case 1: //write_log (_T("immediate SINGLE constant\n")); - fmovs_ri (treg, comp_get_ilong (m68k_pc_offset - 4)); + mov_l_mi((uae_u32)temp_fp, comp_get_ilong(m68k_pc_offset - 4)); + fmovs_rm(treg, (uae_u32)temp_fp); return 1; case 2: //write_log (_T("immediate LONG DOUBLE constant\n")); - fmov_ext_ri (treg, comp_get_ilong (m68k_pc_offset - 4), - comp_get_ilong (m68k_pc_offset - 8), - (comp_get_ilong (m68k_pc_offset - 12) >> 16) & 0xffff); + mov_l_mi((uae_u32)temp_fp, comp_get_ilong(m68k_pc_offset - 4)); + mov_l_mi(((uae_u32)temp_fp) + 4, comp_get_ilong(m68k_pc_offset - 8)); + mov_l_mi(((uae_u32)temp_fp) + 8, (uae_u32)comp_get_iword(m68k_pc_offset - 12)); + fmov_ext_rm(treg, (uae_u32)temp_fp); return 0; case 4: { - extern uae_u8 *natmem_offset; - - uae_s16 w = (uae_s16) comp_get_iword (m68k_pc_offset - 2); - float si = (float)w; + float si = (float)(uae_s16)comp_get_iword(m68k_pc_offset-2); - write_log(_T("converted immediate WORD constant %d to SINGLE %f, %08x %d (%08X)\n"), w, si, m68k_getpc(), m68k_pc_offset, comp_pc_p + m68k_pc_offset - NATMEM_OFFSET); - fmovs_ri (treg, *(uae_u32 *) &si); + //write_log (_T("converted immediate WORD constant %f to SINGLE\n"), si); + mov_l_mi((uae_u32)temp_fp,*(uae_u32 *)&si); + fmovs_rm(treg,(uae_u32)temp_fp); return 1; } case 5: { - uae_u32 longarray[] = { comp_get_ilong (m68k_pc_offset - 4), - comp_get_ilong (m68k_pc_offset - 8) }; - float si = (float) *(double *) longarray; + uae_u32 longarray[] = { comp_get_ilong(m68k_pc_offset - 4), + comp_get_ilong(m68k_pc_offset - 8) }; + float si = (float)*(double *)longarray; - if (*(double *) longarray == (double) si) { + if (*(double *)longarray == (double)si) { //write_log (_T("SPEED GAIN: converted a DOUBLE constant to SINGLE\n")); - fmovs_ri (treg, *(uae_u32 *) &si); + mov_l_mi((uae_u32)temp_fp, *(uae_u32 *)&si); + fmovs_rm(treg, (uae_u32)temp_fp); return 1; } //write_log (_T("immediate DOUBLE constant\n")); - fmov_ri (treg, longarray[0], longarray[1]); + mov_l_mi((uae_u32)temp_fp, longarray[0]); + mov_l_mi(((uae_u32)temp_fp) + 4, longarray[1]); + fmov_rm(treg, (uae_u32)temp_fp); return 2; } case 6: { - float si = (float) (uae_s8) comp_get_ibyte (m68k_pc_offset - 2); + float si = (float)(uae_s8)comp_get_ibyte(m68k_pc_offset - 2); - //write_log (_T("immediate BYTE constant converted to SINGLE\n")); - fmovs_ri (treg, *(uae_u32 *) &si); + //write_log (_T("converted immediate BYTE constant to SINGLE\n")); + mov_l_mi((uae_u32)temp_fp, *(uae_u32 *)&si); + fmovs_rm(treg, (uae_u32)temp_fp); return 1; } default: /* never reached */ return -1; } -#endif default: /* never reached */ return -1; } @@ -239,10 +231,10 @@ STATIC_INLINE int comp_fp_get (uae_u32 opcode, uae_u16 extra, int treg) mov_w_mr (((uae_u32) temp_fp) + 8, S2); add_l_ri (S1, 4); readlong (S1, S2, S3); - mov_l_mr ((uae_u32) (temp_fp) +4, S2); + mov_l_mr (((uae_u32) temp_fp) + 4, S2); add_l_ri (S1, 4); readlong (S1, S2, S3); - mov_l_mr ((uae_u32) (temp_fp), S2); + mov_l_mr (((uae_u32) temp_fp), S2); fmov_ext_rm (treg, (uae_u32) (temp_fp)); return 0; case 4: /* Word */ @@ -256,8 +248,8 @@ STATIC_INLINE int comp_fp_get (uae_u32 opcode, uae_u16 extra, int treg) mov_l_mr (((uae_u32) temp_fp) + 4, S2); add_l_ri (S1, 4); readlong (S1, S2, S3); - mov_l_mr ((uae_u32) (temp_fp), S2); - fmov_rm (treg, (uae_u32) (temp_fp)); + mov_l_mr (((uae_u32) temp_fp), S2); + fmov_rm (treg, (uae_u32) temp_fp); return 2; case 6: /* Byte */ readbyte (S1, S2, S3); @@ -835,8 +827,7 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) } list <<= 1; } - } - else { /* Postincrement */ + } else { /* Postincrement */ for (reg = 0; reg <= 7; reg++) { if (list & 0x80) { fmov_ext_mr ((uintptr) temp_fp, reg); @@ -857,8 +848,7 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) mov_l_rr ((opcode & 7) + 8, ad); if ((opcode & 0x38) == 0x20) mov_l_rr ((opcode & 7) + 8, ad); - } - else { + } else { /* FMOVEM memory->FPP */ int ad; @@ -908,8 +898,7 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) } list <<= 1; } - } - else { + } else { for (reg = 0; reg <= 7; reg++) { if (list & 0x80) { readword (ad, S2, S3); diff --git a/jit/compemu_raw_x86.cpp b/jit/compemu_raw_x86.cpp index 7fa75d37..7e4d6f8a 100644 --- a/jit/compemu_raw_x86.cpp +++ b/jit/compemu_raw_x86.cpp @@ -2831,6 +2831,7 @@ LENDFUNC(NONE,WRITE,2,raw_fmovs_mr,(MEMW m, FR r)) emit_byte(0xd9); emit_byte(0x04); emit_byte(0x24); /* fld load r as SINGLE from [esp] */ + emit_byte(0x9b); /* let the CPU wait on FPU exceptions */ emit_byte(0x83); emit_byte(0xc4); emit_byte(0x04); /* add +4 to esp */ @@ -2849,74 +2850,13 @@ LENDFUNC(NONE,NONE,1,raw_fcuts_r,(FRW r)) emit_byte(0xdd); emit_byte(0x04); emit_byte(0x24); /* fld load r as DOUBLE from [esp] */ + emit_byte(0x9b); /* let the CPU wait on FPU exceptions */ emit_byte(0x83); emit_byte(0xc4); emit_byte(0x08); /* add +8 to esp */ } LENDFUNC(NONE,NONE,1,raw_fcut_r,(FRW r)) - LOWFUNC(NONE,READ,2,raw_fmovl_ri,(FW r, IMMS i)) -{ - emit_byte(0x68); - emit_long(i); /* push immediate32 onto [esp] */ - emit_byte(0xdb); - emit_byte(0x04); - emit_byte(0x24); /* fild load m32int from [esp] */ - emit_byte(0x83); - emit_byte(0xc4); - emit_byte(0x04); /* add +4 to esp */ - tos_make(r); -} -LENDFUNC(NONE,READ,2,raw_fmovl_ri,(FW r, IMMS i)) - - LOWFUNC(NONE,READ,2,raw_fmovs_ri,(FW r, IMM i)) -{ - emit_byte(0x68); - emit_long(i); /* push immediate32 onto [esp] */ - emit_byte(0xd9); - emit_byte(0x04); - emit_byte(0x24); /* fld load m32real from [esp] */ - emit_byte(0x83); - emit_byte(0xc4); - emit_byte(0x04); /* add +4 to esp */ - tos_make(r); -} -LENDFUNC(NONE,READ,2,raw_fmovs_ri,(FW r, IMM i)) - - LOWFUNC(NONE,READ,3,raw_fmov_ri,(FW r, IMM i1, IMM i2)) -{ - emit_byte(0x68); - emit_long(i2); /* push immediate32 onto [esp] */ - emit_byte(0x68); - emit_long(i1); /* push immediate32 onto [esp] */ - emit_byte(0xdd); - emit_byte(0x04); - emit_byte(0x24); /* fld load m64real from [esp] */ - emit_byte(0x83); - emit_byte(0xc4); - emit_byte(0x08); /* add +8 to esp */ - tos_make(r); -} -LENDFUNC(NONE,READ,3,raw_fmov_ri,(FW r, IMM i1, IMM i2)) - - LOWFUNC(NONE,READ,4,raw_fmov_ext_ri,(FW r, IMM i1, IMM i2, IMM i3)) -{ - emit_byte(0x68); - emit_long(i3); /* push immediate32 onto [esp] */ - emit_byte(0x68); - emit_long(i2); /* push immediate32 onto [esp] */ - emit_byte(0x68); - emit_long(i1); /* push immediate32 onto [esp] */ - emit_byte(0xdb); - emit_byte(0x2c); - emit_byte(0x24); /* fld load m80real from [esp] */ - emit_byte(0x83); - emit_byte(0xc4); - emit_byte(0x0c); /* add +12 to esp */ - tos_make(r); -} -LENDFUNC(NONE,READ,4,raw_fmov_ext_ri,(FW r, IMM i1, IMM i2, IMMi3)) - LOWFUNC(NONE,WRITE,2,raw_fmov_ext_mr,(MEMW m, FR r)) { int rs; @@ -3671,13 +3611,13 @@ LENDFUNC(NONE,NONE,2,raw_fatanh_rr,(FW d, FR s)) emit_byte(0xdb); emit_byte(0x2c); emit_byte(0x24); /* fld load temp-reg from [esp] */ - emit_byte(0x83); - emit_byte(0xc4); - emit_byte(0x0c); /* add +12 to esp */ emit_byte(0xd9); emit_byte(0xca); /* fxch swap temp-reg with e^-x in tr */ emit_byte(0xde); emit_byte(0xe9); /* fsubp (e^x)-(e^-x) */ + emit_byte(0x83); + emit_byte(0xc4); + emit_byte(0x0c); /* delayed add +12 to esp */ } else { emit_byte(0xde); @@ -3766,11 +3706,11 @@ LENDFUNC(NONE,NONE,2,raw_fsinh_rr,(FW d, FR s)) emit_byte(0xdb); emit_byte(0x2c); emit_byte(0x24); /* fld load temp-reg from [esp] */ - emit_byte(0x83); - emit_byte(0xc4); - emit_byte(0x0c); /* add +12 to esp */ emit_byte(0xd9); emit_byte(0xca); /* fxch swap temp-reg with e^-x in tr */ + emit_byte(0x83); + emit_byte(0xc4); + emit_byte(0x0c); /* delayed add +12 to esp */ } emit_byte(0xde); emit_byte(0xc1); /* faddp (e^x)+(e^-x) */ @@ -3863,13 +3803,13 @@ LENDFUNC(NONE,NONE,2,raw_fcosh_rr,(FW d, FR s)) emit_byte(0xdb); emit_byte(0x2c); emit_byte(0x24); /* fld load temp-reg from [esp] */ - emit_byte(0x83); - emit_byte(0xc4); - emit_byte(0x0c); /* add +12 to esp */ emit_byte(0xd9); emit_byte(0xca); /* fxch swap temp-reg with e^-x in tr */ emit_byte(0xde); emit_byte(0xf9); /* fdivp ((e^x)-(e^-x))/((e^x)+(e^-x)) */ + emit_byte(0x83); + emit_byte(0xc4); + emit_byte(0x0c); /* delayed add +12 to esp */ } else { emit_byte(0xde); diff --git a/jit/compemu_support.cpp b/jit/compemu_support.cpp index 2ea9740d..be5781f7 100644 --- a/jit/compemu_support.cpp +++ b/jit/compemu_support.cpp @@ -3998,38 +3998,6 @@ MENDFUNC(1,fcuts_r,(FRW r)) } MENDFUNC(1,fcut_r,(FRW r)) - MIDFUNC(2,fmovl_ri,(FW r, IMMS i)) -{ - r=f_writereg(r); - raw_fmovl_ri(r,i); - f_unlock(r); -} -MENDFUNC(2,fmovl_ri,(FW r, IMMS i)) - - MIDFUNC(2,fmovs_ri,(FW r, IMM i)) -{ - r=f_writereg(r); - raw_fmovs_ri(r,i); - f_unlock(r); -} -MENDFUNC(2,fmovs_ri,(FW r, IMM i)) - - MIDFUNC(3,fmov_ri,(FW r, IMM i1, IMM i2)) -{ - r=f_writereg(r); - raw_fmov_ri(r,i1,i2); - f_unlock(r); -} -MENDFUNC(3,fmov_ri,(FW r, IMM i1, IMM i2)) - - MIDFUNC(4,fmov_ext_ri,(FW r, IMM i1, IMM i2, IMM i3)) -{ - r=f_writereg(r); - raw_fmov_ext_ri(r,i1,i2,i3); - f_unlock(r); -} -MENDFUNC(4,fmov_ext_ri,(FW r, IMM i1, IMM i2, IMM i3)) - MIDFUNC(2,fmov_ext_mr,(MEMW m, FR r)) { r=f_readreg(r); diff --git a/newcpu.cpp b/newcpu.cpp index 3363c7b0..b3c76d8b 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -60,6 +60,7 @@ static int last_instructionaccess_for_exception_3; int mmu_enabled, mmu_triggered; int cpu_cycles; static int baseclock; +bool m68k_pc_indirect; int cpucycleunit; int cpu_tracer; @@ -1199,6 +1200,9 @@ static void build_cpufunctbl (void) #ifdef JIT build_comp (); #endif + m68k_pc_indirect = (currprefs.mmu_model || currprefs.cpu_compatible) && !currprefs.cachesize; + if (tbl == op_smalltbl_0_ff || tbl == op_smalltbl_1_ff || tbl == op_smalltbl_2_ff || tbl == op_smalltbl_3_ff || tbl == op_smalltbl_4_ff || tbl == op_smalltbl_5_ff) + m68k_pc_indirect = false; set_cpu_caches (true); } @@ -1282,9 +1286,11 @@ void check_prefs_changed_cpu (void) || currprefs.cpu_compatible != changed_prefs.cpu_compatible || currprefs.cpu_cycle_exact != changed_prefs.cpu_cycle_exact) { + uaecptr pc = m68k_getpc(); prefs_changed_cpu (); build_cpufunctbl (); - fill_prefetch (); + m68k_setpc_normal(pc); + fill_prefetch(); changed = true; } if (changed @@ -1302,7 +1308,7 @@ void check_prefs_changed_cpu (void) currprefs.cpu_idle = changed_prefs.cpu_idle; } if (changed) { - set_special (SPCFLAG_BRK); + set_special (SPCFLAG_MODE_CHANGE); reset_frame_rate_hack (); } @@ -2592,7 +2598,7 @@ void REGPARAM2 ExceptionL (int nr, uaecptr address) ExceptionX (nr, address); } -STATIC_INLINE void do_interrupt (int nr) +static void do_interrupt (int nr) { if (debug_dma) record_dma_event (DMA_EVENT_CPUIRQ, current_hpos (), vpos); @@ -3088,9 +3094,13 @@ void doint (void) #define IDLETIME (currprefs.cpu_idle * sleep_resolution / 1000) -STATIC_INLINE int do_specialties (int cycles) +static int do_specialties (int cycles) { - regs.instruction_pc = m68k_getpc (); + if (regs.spcflags & SPCFLAG_MODE_CHANGE) + return 1; + + regs.instruction_pc = m68k_getpc(); + #ifdef ACTION_REPLAY #ifdef ACTION_REPLAY_HRTMON if ((regs.spcflags & SPCFLAG_ACTION_REPLAY) && hrtmon_flag != ACTION_REPLAY_INACTIVE) { @@ -3196,7 +3206,7 @@ STATIC_INLINE int do_specialties (int cycles) } } - if ((regs.spcflags & (SPCFLAG_BRK | SPCFLAG_MODE_CHANGE))) { + if (regs.spcflags & (SPCFLAG_BRK | SPCFLAG_MODE_CHANGE)) { unset_special (SPCFLAG_BRK | SPCFLAG_MODE_CHANGE); // SPCFLAG_BRK breaks STOP condition, need to prefetch m68k_resumestopped (); @@ -3251,8 +3261,9 @@ STATIC_INLINE int do_specialties (int cycles) set_special (SPCFLAG_INT); } - if ((regs.spcflags & (SPCFLAG_BRK | SPCFLAG_MODE_CHANGE))) + if (regs.spcflags & SPCFLAG_BRK) return 1; + return 0; } @@ -4471,7 +4482,38 @@ static const TCHAR *fpuopcodes[] = NULL }; -static void addmovemreg (TCHAR *out, int *prevreg, int *lastreg, int *first, int reg) +static const TCHAR *movemregs[] = +{ + _T("D0"), + _T("D1"), + _T("D2"), + _T("D3"), + _T("D4"), + _T("D5"), + _T("D6"), + _T("D7"), + _T("A0"), + _T("A1"), + _T("A2"), + _T("A3"), + _T("A4"), + _T("A5"), + _T("A6"), + _T("A7"), + _T("FP0"), + _T("FP1"), + _T("FP2"), + _T("FP3"), + _T("FP4"), + _T("FP5"), + _T("FP6"), + _T("FP7"), + _T("FPCR"), + _T("FPSR"), + _T("FPIAR") +}; + +static void addmovemreg (TCHAR *out, int *prevreg, int *lastreg, int *first, int reg, int fpmode) { TCHAR *p = out + _tcslen (out); if (*prevreg < 0) { @@ -4479,13 +4521,13 @@ static void addmovemreg (TCHAR *out, int *prevreg, int *lastreg, int *first, int *lastreg = reg; return; } - if ((*prevreg) + 1 != reg || (reg & 8) != ((*prevreg & 8))) { - _stprintf (p, _T("%s%c%d"), (*first) ? _T("") : _T("/"), (*lastreg) < 8 ? 'D' : 'A', (*lastreg) & 7); + if (reg < 0 || fpmode == 2 || (*prevreg) + 1 != reg || (reg & 8) != ((*prevreg & 8))) { + _stprintf (p, _T("%s%s"), (*first) ? _T("") : _T("/"), movemregs[*lastreg]); p = p + _tcslen (p); if ((*lastreg) + 2 == reg) { - _stprintf (p, _T("/%c%d"), (*prevreg) < 8 ? 'D' : 'A', (*prevreg) & 7); + _stprintf (p, _T("/%s"), movemregs[*prevreg]); } else if ((*lastreg) != (*prevreg)) { - _stprintf (p, _T("-%c%d"), (*prevreg) < 8 ? 'D' : 'A', (*prevreg) & 7); + _stprintf (p, _T("-%s"), movemregs[*prevreg]); } *lastreg = reg; *first = 0; @@ -4493,18 +4535,20 @@ static void addmovemreg (TCHAR *out, int *prevreg, int *lastreg, int *first, int *prevreg = reg; } -static void movemout (TCHAR *out, uae_u16 mask, int mode) +static void movemout (TCHAR *out, uae_u16 mask, int mode, int fpmode) { unsigned int dmask, amask; int prevreg = -1, lastreg = -1, first = 1; - if (mode == Apdi) { - int i; - uae_u8 dmask2 = (mask >> 8) & 0xff; - uae_u8 amask2 = mask & 0xff; + if (mode == Apdi && !fpmode) { + uae_u8 dmask2; + uae_u8 amask2; + + amask2 = mask & 0xff; + dmask2 = (mask >> 8) & 0xff; dmask = 0; amask = 0; - for (i = 0; i < 8; i++) { + for (int i = 0; i < 8; i++) { if (dmask2 & (1 << i)) dmask |= 1 << (7 - i); if (amask2 & (1 << i)) @@ -4513,10 +4557,22 @@ static void movemout (TCHAR *out, uae_u16 mask, int mode) } else { dmask = mask & 0xff; amask = (mask >> 8) & 0xff; + if (fpmode == 1 && mode != Apdi) { + uae_u8 dmask2 = dmask; + dmask = 0; + for (int i = 0; i < 8; i++) { + if (dmask2 & (1 << i)) + dmask |= 1 << (7 - i); + } + } + } + if (fpmode) { + while (dmask) { addmovemreg(out, &prevreg, &lastreg, &first, movem_index1[dmask] + (fpmode == 2 ? 24 : 16), fpmode); dmask = movem_next[dmask]; } + } else { + while (dmask) { addmovemreg (out, &prevreg, &lastreg, &first, movem_index1[dmask], fpmode); dmask = movem_next[dmask]; } + while (amask) { addmovemreg (out, &prevreg, &lastreg, &first, movem_index1[amask] + 8, fpmode); amask = movem_next[amask]; } } - while (dmask) { addmovemreg (out, &prevreg, &lastreg, &first, movem_index1[dmask]); dmask = movem_next[dmask]; } - while (amask) { addmovemreg (out, &prevreg, &lastreg, &first, movem_index1[amask] + 8); amask = movem_next[amask]; } - addmovemreg (out, &prevreg, &lastreg, &first, -1); + addmovemreg(out, &prevreg, &lastreg, &first, -1, fpmode); } static const TCHAR *fpsizes[] = { @@ -4527,7 +4583,7 @@ static const TCHAR *fpsizes[] = { _T("W"), _T("D"), _T("B"), - _T("?") + _T("P") }; static const int fpsizeconv[] = { sz_long, @@ -4537,26 +4593,15 @@ static const int fpsizeconv[] = { sz_word, sz_double, sz_byte, - 0 + sz_packed }; static void disasm_size (TCHAR *instrname, struct instr *dp) { -#if 0 - int i, size; - uae_u16 mnemo = dp->mnemo; - - size = dp->size; - for (i = 0; i < 65536; i++) { - struct instr *in = &table68k[i]; - if (in->mnemo == mnemo && in != dp) { - if (size != in->size) - break; - } + if (dp->unsized) { + _tcscat(instrname, _T(" ")); + return; } - if (i == 65536) - size = -1; -#endif switch (dp->size) { case sz_byte: @@ -4657,16 +4702,16 @@ void m68k_disasm_2 (TCHAR *buf, int bufsize, uaecptr pc, uaecptr *nextpc, int cn pc += 2; pc = ShowEA (0, pc, opcode, dp->dreg, dp->dmode, dp->size, instrname, deaddr, safemode); _tcscat (instrname, _T(",")); - movemout (instrname, mask, dp->dmode); + movemout (instrname, mask, dp->dmode, 0); } else if (lookup->mnemo == i_MVMLE) { uae_u16 mask = extra; pc += 2; - movemout(instrname, mask, dp->dmode); + movemout(instrname, mask, dp->dmode, 0); _tcscat(instrname, _T(",")); pc = ShowEA(0, pc, opcode, dp->dreg, dp->dmode, dp->size, instrname, deaddr, safemode); } else if (lookup->mnemo == i_DIVL || lookup->mnemo == i_MULL) { TCHAR *p; - pc = ShowEA(0, pc, opcode, dp->dreg, dp->dmode, dp->size, instrname, &deaddr2, safemode); + pc = ShowEA(0, pc, opcode, dp->dreg, dp->dmode, dp->size, instrname, &seaddr2, safemode); extra = get_word_debug(pc); pc += 2; p = instrname + _tcslen(instrname); @@ -4674,40 +4719,144 @@ void m68k_disasm_2 (TCHAR *buf, int bufsize, uaecptr pc, uaecptr *nextpc, int cn _stprintf(p, _T(",D%d:D%d"), extra & 7, (extra >> 12) & 7); else _stprintf(p, _T(",D%d"), (extra >> 12) & 7); + } else if (lookup->mnemo == i_MOVES) { + TCHAR *p; + pc += 2; + if (extra & 0x1000) { + pc = ShowEA(0, pc, opcode, dp->dreg, dp->dmode, dp->size, instrname, &seaddr2, safemode); + p = instrname + _tcslen(instrname); + _stprintf(p, _T(",%c%d"), (extra & 0x8000) ? 'A' : 'D', (extra >> 12) & 7); + } else { + p = instrname + _tcslen(instrname); + _stprintf(p, _T("%c%d,"), (extra & 0x8000) ? 'A' : 'D', (extra >> 12) & 7); + pc = ShowEA(0, pc, opcode, dp->dreg, dp->dmode, dp->size, instrname, &seaddr2, safemode); + } + } else if (lookup->mnemo == i_BFEXTS || lookup->mnemo == i_BFEXTU || + lookup->mnemo == i_BFCHG || lookup->mnemo == i_BFCLR || + lookup->mnemo == i_BFFFO || lookup->mnemo == i_BFINS || + lookup->mnemo == i_BFSET || lookup->mnemo == i_BFTST) { + TCHAR *p; + int reg = -1; + + pc += 2; + p = instrname + _tcslen(instrname); + if (lookup->mnemo == i_BFEXTS || lookup->mnemo == i_BFEXTU || lookup->mnemo == i_BFFFO || lookup->mnemo == i_BFINS) + reg = (extra >> 12) & 7; + if (lookup->mnemo == i_BFINS) + _stprintf(p, _T("D%d,"), reg); + pc = ShowEA(0, pc, opcode, dp->dreg, dp->dmode, dp->size, instrname, &seaddr2, safemode); + _tcscat(instrname, _T(" {")); + p = instrname + _tcslen(instrname); + if (extra & 0x0800) + _stprintf(p, _T("D%d"), (extra >> 6) & 7); + else + _stprintf(p, _T("%d"), (extra >> 6) & 31); + _tcscat(instrname, _T(":")); + p = instrname + _tcslen(instrname); + if (extra & 0x0020) + _stprintf(p, _T("D%d"), extra & 7); + else + _stprintf(p, _T("%d"), extra & 31); + _tcscat(instrname, _T("}")); + p = instrname + _tcslen(instrname); + if (lookup->mnemo == i_BFFFO || lookup->mnemo == i_BFEXTS || lookup->mnemo == i_BFEXTU) + _stprintf(p, _T(",D%d"), reg); } else if (lookup->mnemo == i_FPP) { TCHAR *p; int ins = extra & 0x3f; int size = (extra >> 10) & 7; pc += 2; - if (fpuopcodes[ins]) - _tcscpy(instrname, fpuopcodes[ins]); - else - _tcscpy(instrname, _T("F?")); - - if ((extra & 0xe000) == 0x6000) { // FMOVE to memory - _tcscat(instrname, _T(".")); - _tcscat(instrname, fpsizes[size]); - _tcscat(instrname, _T(" ")); - p = instrname + _tcslen(instrname); - _stprintf(p, _T("FP%d,"), (extra >> 10) & 7); - pc = ShowEA(0, pc, opcode, dp->dreg, dp->dmode, fpsizeconv[size], instrname, &deaddr2, safemode); - } else if (extra & 0x4000) { - _tcscat(instrname, _T(".")); - _tcscat(instrname, fpsizes[size]); - _tcscat(instrname, _T(" ")); - pc = ShowEA(0, pc, opcode, dp->dreg, dp->dmode, fpsizeconv[size], instrname, &seaddr2, safemode); - p = instrname + _tcslen(instrname); - _stprintf(p, _T(",FP%d"), (extra >> 7) & 7); - } else if (ins == 0 || (extra & 0x20)) { + if ((extra & 0xfc00) == 0x5c00) { // FMOVECR (=i_FPP with source specifier = 7) + fpdata fp; + if (fpu_get_constant(&fp, extra)) +#if USE_LONG_DOUBLE + _stprintf(instrname, _T("FMOVECR.X #%Le,FP%d"), fp.fp, (extra >> 7) & 7); +#else + _stprintf(instrname, _T("FMOVECR.X #%e,FP%d"), fp.fp, (extra >> 7) & 7); +#endif + else + _stprintf(instrname, _T("FMOVECR.X #?,FP%d"), (extra >> 7) & 7); + } else if ((extra & 0x8000) == 0x8000) { // FMOVEM + int dr = (extra >> 13) & 1; + int mode; + int dreg = (extra >> 4) & 7; + int regmask, fpmode; + + if (extra & 0x4000) { + mode = (extra >> 11) & 3; + regmask = extra & 0xff; // FMOVEM FPx + fpmode = 1; + _tcscpy(instrname, _T("FMOVEM.X ")); + } else { + mode = 0; + regmask = (extra >> 10) & 7; // FMOVEM control + fpmode = 2; + _tcscpy(instrname, _T("FMOVEM.L ")); + if (regmask == 1 || regmask == 2 || regmask == 4) + _tcscpy(instrname, _T("FMOVE.L ")); + } p = instrname + _tcslen(instrname); - _stprintf(p, _T(".X FP%d,FP%d"), (extra >> 10) & 7, (extra >> 7) & 7); + if (dr) { + if (mode & 1) + _stprintf(instrname, _T("D%d"), dreg); + else + movemout(instrname, regmask, dp->dmode, fpmode); + _tcscat(instrname, _T(",")); + pc = ShowEA(0, pc, opcode, dp->dreg, dp->dmode, dp->size, instrname, deaddr, safemode); + } else { + pc = ShowEA(0, pc, opcode, dp->dreg, dp->dmode, dp->size, instrname, deaddr, safemode); + _tcscat(instrname, _T(",")); + p = instrname + _tcslen(instrname); + if (mode & 1) + _stprintf(p, _T("D%d"), dreg); + else + movemout(p, regmask, dp->dmode, fpmode); + } } else { - p = instrname + _tcslen(instrname); - _stprintf(p, _T(".X FP%d"), (extra >> 10) & 7); + if (fpuopcodes[ins]) + _tcscpy(instrname, fpuopcodes[ins]); + else + _tcscpy(instrname, _T("F?")); + + if ((extra & 0xe000) == 0x6000) { // FMOVE to memory + int kfactor = extra & 0x7f; + _tcscpy(instrname, _T("FMOVE.")); + _tcscat(instrname, fpsizes[size]); + _tcscat(instrname, _T(" ")); + p = instrname + _tcslen(instrname); + _stprintf(p, _T("FP%d,"), (extra >> 10) & 7); + pc = ShowEA(0, pc, opcode, dp->dreg, dp->dmode, fpsizeconv[size], instrname, &deaddr2, safemode); + p = instrname + _tcslen(instrname); + if (size == 7) { + _stprintf(p, _T(" {D%d}"), (kfactor >> 4)); + } else if (kfactor) { + if (kfactor & 0x40) + kfactor |= ~0x3f; + _stprintf(p, _T(" {%d}"), kfactor); + } + } else { + if (extra & 0x4000) { // source is EA + _tcscat(instrname, _T(".")); + _tcscat(instrname, fpsizes[size]); + _tcscat(instrname, _T(" ")); + pc = ShowEA(0, pc, opcode, dp->dreg, dp->dmode, fpsizeconv[size], instrname, &seaddr2, safemode); + } else { // source is FPx + p = instrname + _tcslen(instrname); + _stprintf(p, _T(".X FP%d"), (extra >> 10) & 7); + } + p = instrname + _tcslen(instrname); + if ((extra & 0x4000) || (((extra >> 7) & 7) != ((extra >> 10) & 7))) + _stprintf(p, _T(",FP%d"), (extra >> 7) & 7); + if (ins >= 0x30 && ins < 0x38) { // FSINCOS + p = instrname + _tcslen(instrname); + _stprintf(p, _T(",FP%d"), extra & 7); + } + } } - } - else { + } else if ((opcode & 0xf000) == 0xa000) { + _tcscpy(instrname, _T("A-LINE")); + } else { if (dp->suse) { pc = ShowEA (0, pc, opcode, dp->sreg, dp->smode, dp->size, instrname, &seaddr2, safemode); } @@ -4718,7 +4867,7 @@ void m68k_disasm_2 (TCHAR *buf, int bufsize, uaecptr pc, uaecptr *nextpc, int cn } } - for (i = 0; i < (pc - oldpc) / 2; i++) { + for (i = 0; i < (pc - oldpc) / 2 && i < 5; i++) { buf = buf_out (buf, &bufsize, _T("%04x "), get_word_debug (oldpc + i * 2)); } while (i++ < 5) @@ -4734,10 +4883,19 @@ void m68k_disasm_2 (TCHAR *buf, int bufsize, uaecptr pc, uaecptr *nextpc, int cn uaecptr addr2 = deaddr2 ? deaddr2 : seaddr2; if (deaddr) *deaddr = pc; - if (cctrue (dp->cc)) - buf = buf_out (buf, &bufsize, _T(" == $%08x (T)"), addr2); - else - buf = buf_out (buf, &bufsize, _T(" == $%08x (F)"), addr2); + if ((opcode & 0xf000) == 0xf000) { + if (fpp_cond(dp->cc)) { + buf = buf_out(buf, &bufsize, _T(" == $%08x (T)"), addr2); + } else { + buf = buf_out(buf, &bufsize, _T(" == $%08x (F)"), addr2); + } + } else { + if (cctrue (dp->cc)) { + buf = buf_out (buf, &bufsize, _T(" == $%08x (T)"), addr2); + } else { + buf = buf_out (buf, &bufsize, _T(" == $%08x (F)"), addr2); + } + } } else if ((opcode & 0xff00) == 0x6100) { /* BSR */ if (deaddr) *deaddr = pc; @@ -5937,7 +6095,7 @@ STATIC_INLINE void update_cache030 (struct cache030 *c, uae_u32 val, uae_u32 tag c->data[lws] = val; } -STATIC_INLINE void fill_icache030 (uae_u32 addr) +static void fill_icache030 (uae_u32 addr) { int lws; uae_u32 tag; diff --git a/od-win32/dinput.cpp b/od-win32/dinput.cpp index f513b2a0..3cf881e7 100644 --- a/od-win32/dinput.cpp +++ b/od-win32/dinput.cpp @@ -778,13 +778,6 @@ int close_tablet (void *ctx) if (ctx != NULL) pWTClose ((HCTX)ctx); ctx = NULL; - if (wintab) - FreeModule(wintab); - wintab = NULL; - pWTOpenW = NULL; - pWTClose = NULL; - pWTInfoW = NULL; - pWTPacket = NULL; if (!tablet) return 0; return 1; diff --git a/od-win32/md-fpp.h b/od-win32/md-fpp.h index 42c1b9a8..abbb944a 100644 --- a/od-win32/md-fpp.h +++ b/od-win32/md-fpp.h @@ -21,12 +21,20 @@ #define FPCR_PRECISION_EXTENDED 0x00000000 #if USE_LONG_DOUBLE -STATIC_INLINE void to_exten(fpdata *fp, uae_u32 wrd1, uae_u32 wrd2, uae_u32 wrd3) +STATIC_INLINE void to_exten(fpdata *dst, uae_u32 wrd1, uae_u32 wrd2, uae_u32 wrd3) { - uae_u32 longarray[] = { wrd3, wrd2, ((wrd1 >> 16) & 0xffff) }; // little endian - long double *longdoublewords = (long double*)longarray; - - fp->fp = *longdoublewords; + // force correct long double alignment + union + { + long double lf; + uae_u32 longarray[3]; + } uld; + // little endian order + uld.longarray[0] = wrd3; + uld.longarray[1] = wrd2; + uld.longarray[2] = wrd1 >> 16; + long double *longdoublewords = (long double *)uld.longarray; + dst->fp = *longdoublewords; } #define HAVE_to_exten @@ -186,7 +194,7 @@ STATIC_INLINE void to_exten(fpdata *fpd, uae_u32 wrd1, uae_u32 wrd2, uae_u32 wrd fpd->fpx = true; #endif if ((wrd1 & 0x7fff0000) == 0 && wrd2 == 0 && wrd3 == 0) { - fpd->fp = 0.0; + fpd->fp = (wrd1 & 0x80000000) ? -0.0 : +0.0; return; } frac = ((double)wrd2 + ((double)wrd3 / twoto32)) / 2147483648.0; diff --git a/od-win32/picasso96_win.cpp b/od-win32/picasso96_win.cpp index 29ef629d..0595c32f 100644 --- a/od-win32/picasso96_win.cpp +++ b/od-win32/picasso96_win.cpp @@ -677,7 +677,7 @@ static void mouseupdate (void) if (!currprefs.gfx_api) return; - if (currprefs.win32_rtgscalemode == RTG_MODE_CENTER) { + if (currprefs.gf[1].gfx_filter_autoscale == RTG_MODE_CENTER) { D3D_setcursor (x, y, WIN32GFX_GetWidth (), WIN32GFX_GetHeight(), cursorvisible, scalepicasso == 2); } else { D3D_setcursor (x, y, picasso96_state.Width, picasso96_state.Height, cursorvisible, false); diff --git a/od-win32/rp.cpp b/od-win32/rp.cpp index 53e3acd4..45adeab6 100644 --- a/od-win32/rp.cpp +++ b/od-win32/rp.cpp @@ -819,9 +819,9 @@ static void set_screenmode (struct RPScreenMode *sm, struct uae_prefs *p) int m = 1; if (fs == 2) { - p->win32_rtgscalemode = 1; + p->gf[1].gfx_filter_autoscale = 1; } else { - p->win32_rtgscalemode = 0; + p->gf[1].gfx_filter_autoscale = 0; if (smm == RP_SCREENMODE_SCALE_2X) { m = 2; } else if (smm == RP_SCREENMODE_SCALE_3X) { diff --git a/od-win32/srcrelease.cmd b/od-win32/srcrelease.cmd index fd74fa5e..ef145aac 100644 --- a/od-win32/srcrelease.cmd +++ b/od-win32/srcrelease.cmd @@ -76,6 +76,8 @@ cd .. cd genlinetoscr_msvc rm -f genlinetoscr.exe +rm -f *.cpp +rm -f *.h rm -rf debug rm -rf release rm -rf fullrelease @@ -84,6 +86,8 @@ cd .. cd build68k_msvc rm -f build68k.exe +rm -f *.cpp +rm -f *.h rm -rf debug rm -rf release rm -rf fullrelease @@ -92,6 +96,8 @@ cd .. cd genblitter_msvc rm -f genblitter.exe +rm -f *.cpp +rm -f *.h rm -rf debug rm -rf release rm -rf fullrelease @@ -100,6 +106,8 @@ cd .. cd gencomp_msvc rm -f gencomp.exe +rm -f *.cpp +rm -f *.h rm -rf debug rm -rf release rm -rf fullrelease @@ -108,6 +116,8 @@ cd .. cd gencpu_msvc rm -f gencpu.exe +rm -f *.cpp +rm -f *.h rm -rf debug rm -rf release rm -rf fullrelease diff --git a/od-win32/win32.cpp b/od-win32/win32.cpp index d228a086..425b49f8 100644 --- a/od-win32/win32.cpp +++ b/od-win32/win32.cpp @@ -1611,7 +1611,7 @@ static int canstretch (void) return 0; return 1; } else { - if (currprefs.win32_rtgallowscaling || currprefs.win32_rtgscalemode) + if (currprefs.win32_rtgallowscaling || currprefs.gf[1].gfx_filter_autoscale) return 1; } return 0; @@ -3094,7 +3094,7 @@ void target_default_options (struct uae_prefs *p, int type) p->win32_powersavedisabled = true; p->sana2 = 0; p->win32_rtgmatchdepth = 1; - p->win32_rtgscalemode = 1; + p->gf[APMODE_RTG].gfx_filter_autoscale = RTG_MODE_SCALE; p->win32_rtgallowscaling = 0; p->win32_rtgscaleaspectratio = -1; p->win32_rtgvblankrate = 0; @@ -3191,8 +3191,8 @@ void target_save_options (struct zfile *f, struct uae_prefs *p) cfgfile_target_dwrite_bool (f, _T("midirouter"), p->win32_midirouter); cfgfile_target_dwrite_bool (f, _T("rtg_match_depth"), p->win32_rtgmatchdepth); - cfgfile_target_dwrite_bool (f, _T("rtg_scale_small"), p->win32_rtgscalemode == 1); - cfgfile_target_dwrite_bool (f, _T("rtg_scale_center"), p->win32_rtgscalemode == 2); + cfgfile_target_dwrite_bool(f, _T("rtg_scale_small"), p->gf[1].gfx_filter_autoscale == 1); + cfgfile_target_dwrite_bool(f, _T("rtg_scale_center"), p->gf[1].gfx_filter_autoscale == 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 / ASPECTMULT) : -1, @@ -3321,12 +3321,12 @@ int target_parse_option (struct uae_prefs *p, const TCHAR *option, const TCHAR * if (cfgfile_yesno (option, value, _T("rtg_match_depth"), &p->win32_rtgmatchdepth)) return 1; if (cfgfile_yesno (option, value, _T("rtg_scale_small"), &tbool)) { - p->win32_rtgscalemode = tbool ? RTG_MODE_SCALE : 0; + p->gf[1].gfx_filter_autoscale = tbool ? RTG_MODE_SCALE : 0; return 1; } if (cfgfile_yesno (option, value, _T("rtg_scale_center"), &tbool)) { if (tbool) - p->win32_rtgscalemode = RTG_MODE_CENTER; + p->gf[1].gfx_filter_autoscale = RTG_MODE_CENTER; return 1; } if (cfgfile_yesno (option, value, _T("rtg_scale_allow"), &p->win32_rtgallowscaling)) diff --git a/od-win32/win32.h b/od-win32/win32.h index 26c87ae5..bc10228b 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -19,11 +19,11 @@ #define LANG_DLL 1 #if WINUAEPUBLICBETA -#define WINUAEBETA _T("13") +#define WINUAEBETA _T("14") #else #define WINUAEBETA _T("") #endif -#define WINUAEDATE MAKEBD(2014, 3, 26) +#define WINUAEDATE MAKEBD(2014, 4, 8) #define WINUAEEXTRA _T("") //#define WINUAEEXTRA _T("AmiKit Preview") //#define WINUAEEXTRA _T("Amiga Forever Edition") diff --git a/od-win32/win32gfx.cpp b/od-win32/win32gfx.cpp index 80aecdd1..e5bcf5be 100644 --- a/od-win32/win32gfx.cpp +++ b/od-win32/win32gfx.cpp @@ -1254,8 +1254,9 @@ void getrtgfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_hei int mul = divx > divy ? divy : divx; int xx = srcwidth * mul; int yy = srcheight * mul; - SetRect (sr, 0, 0, currentmode->native_width / mul, currentmode->native_height / mul); - SetRect (dr, 0, 0, currentmode->native_width, currentmode->native_height); + SetRect (dr, 0, 0, currentmode->native_width / mul, currentmode->native_height / mul); + //picasso_offset_x = -(picasso96_state.Width - xx) / 2; + //picasso_offset_y = -(currentmode->native_height - srcheight) / 2; } else if (scalepicasso == RTG_MODE_CENTER) { int xx = (currentmode->native_width - srcwidth) / 2; int yy = (currentmode->native_height - srcheight) / 2; @@ -1533,29 +1534,29 @@ static void update_gfxparams (void) scalepicasso = 0; if (screen_is_picasso) { if (isfullscreen () < 0) { - if ((currprefs.win32_rtgscalemode == RTG_MODE_CENTER || currprefs.win32_rtgscalemode == RTG_MODE_SCALE || currprefs.win32_rtgallowscaling) && (picasso96_state.Width != currentmode->native_width || picasso96_state.Height != currentmode->native_height)) + if ((currprefs.gf[1].gfx_filter_autoscale == RTG_MODE_CENTER || currprefs.gf[1].gfx_filter_autoscale == RTG_MODE_SCALE || currprefs.win32_rtgallowscaling) && (picasso96_state.Width != currentmode->native_width || picasso96_state.Height != currentmode->native_height)) scalepicasso = 1; - if (currprefs.win32_rtgscalemode == RTG_MODE_CENTER) - scalepicasso = currprefs.win32_rtgscalemode; + if (currprefs.gf[1].gfx_filter_autoscale == RTG_MODE_CENTER) + scalepicasso = currprefs.gf[1].gfx_filter_autoscale; if (!scalepicasso && currprefs.win32_rtgscaleaspectratio) scalepicasso = -1; } else if (isfullscreen () > 0) { if (!currprefs.win32_rtgmatchdepth) { // can't scale to different color depth if (currentmode->native_width > picasso96_state.Width && currentmode->native_height > picasso96_state.Height) { - if (currprefs.win32_rtgscalemode) + if (currprefs.gf[1].gfx_filter_autoscale) scalepicasso = 1; } - if (currprefs.win32_rtgscalemode == RTG_MODE_CENTER) - scalepicasso = currprefs.win32_rtgscalemode; + if (currprefs.gf[1].gfx_filter_autoscale == RTG_MODE_CENTER) + scalepicasso = currprefs.gf[1].gfx_filter_autoscale; if (!scalepicasso && currprefs.win32_rtgscaleaspectratio) scalepicasso = -1; } } else if (isfullscreen () == 0) { - if (currprefs.win32_rtgscalemode == RTG_MODE_INTEGER_SCALE) { + if (currprefs.gf[1].gfx_filter_autoscale == RTG_MODE_INTEGER_SCALE) { scalepicasso = RTG_MODE_INTEGER_SCALE; currentmode->current_width = currprefs.gfx_size.width; currentmode->current_height = currprefs.gfx_size.height; - } else if (currprefs.win32_rtgscalemode == RTG_MODE_CENTER) { + } else if (currprefs.gf[1].gfx_filter_autoscale == RTG_MODE_CENTER) { if (currprefs.gfx_size.width < picasso96_state.Width || currprefs.gfx_size.height < picasso96_state.Height) { if (!currprefs.win32_rtgallowscaling) { ; @@ -1569,7 +1570,7 @@ static void update_gfxparams (void) currentmode->current_width = currprefs.gfx_size.width; currentmode->current_height = currprefs.gfx_size.height; } - } else if (currprefs.win32_rtgscalemode == RTG_MODE_SCALE) { + } else if (currprefs.gf[1].gfx_filter_autoscale == RTG_MODE_SCALE) { if (currprefs.gfx_size.width > picasso96_state.Width || currprefs.gfx_size.height > picasso96_state.Height) scalepicasso = 1; if ((currprefs.gfx_size.width != picasso96_state.Width || currprefs.gfx_size.height != picasso96_state.Height) && currprefs.win32_rtgallowscaling) { @@ -1707,6 +1708,11 @@ static int getstatuswindowheight (void) return wi.rcWindow.bottom - wi.rcWindow.top; } +void graphics_reset(void) +{ + display_change_requested = 2; +} + void WIN32GFX_DisplayChangeRequested (int mode) { display_change_requested = mode; @@ -1800,7 +1806,7 @@ int check_prefs_changed_gfx (void) c |= currprefs.win32_borderless != changed_prefs.win32_borderless ? 32 : 0; c |= currprefs.win32_blankmonitors != changed_prefs.win32_blankmonitors ? 32 : 0; c |= currprefs.win32_rtgmatchdepth != changed_prefs.win32_rtgmatchdepth ? 2 : 0; - c |= currprefs.win32_rtgscalemode != changed_prefs.win32_rtgscalemode ? (2 | 8 | 64) : 0; +// c |= currprefs.win32_rtgscalemode != changed_prefs.win32_rtgscalemode ? (2 | 8 | 64) : 0; c |= currprefs.win32_rtgallowscaling != changed_prefs.win32_rtgallowscaling ? (2 | 8 | 64) : 0; c |= currprefs.win32_rtgscaleaspectratio != changed_prefs.win32_rtgscaleaspectratio ? (8 | 64) : 0; c |= currprefs.win32_rtgvblankrate != changed_prefs.win32_rtgvblankrate ? 8 : 0; @@ -1900,7 +1906,7 @@ int check_prefs_changed_gfx (void) currprefs.win32_blankmonitors = changed_prefs.win32_blankmonitors; currprefs.win32_statusbar = changed_prefs.win32_statusbar; currprefs.win32_rtgmatchdepth = changed_prefs.win32_rtgmatchdepth; - currprefs.win32_rtgscalemode = changed_prefs.win32_rtgscalemode; +// currprefs.win32_rtgscalemode = changed_prefs.win32_rtgscalemode; currprefs.win32_rtgallowscaling = changed_prefs.win32_rtgallowscaling; currprefs.win32_rtgscaleaspectratio = changed_prefs.win32_rtgscaleaspectratio; currprefs.win32_rtgvblankrate = changed_prefs.win32_rtgvblankrate; @@ -2391,7 +2397,7 @@ static int modeswitchneeded (struct winuae_currentmode *wc) if (picasso96_state.BytesPerPixel > 1 && picasso96_state.BytesPerPixel * 8 != wc->current_depth && currprefs.win32_rtgmatchdepth) return -1; if (picasso96_state.Width < wc->current_width && picasso96_state.Height < wc->current_height) { - if ((currprefs.win32_rtgscalemode == 1 || (currprefs.win32_rtgscalemode == 2 && currprefs.win32_rtgallowscaling)) && !currprefs.win32_rtgmatchdepth) + if ((currprefs.gf[1].gfx_filter_autoscale == 1 || (currprefs.gf[1].gfx_filter_autoscale == 2 && currprefs.win32_rtgallowscaling)) && !currprefs.win32_rtgmatchdepth) return 0; } if (picasso96_state.Width != wc->current_width || @@ -2421,7 +2427,7 @@ static int modeswitchneeded (struct winuae_currentmode *wc) DirectDraw_Fill (NULL, 0); DirectDraw_BlitToPrimary (NULL); if (screen_is_picasso) { - if (currprefs.win32_rtgscalemode && ((wc->native_width > picasso96_state.Width && wc->native_height >= picasso96_state.Height) || (wc->native_height > picasso96_state.Height && wc->native_width >= picasso96_state.Width))) + if (currprefs.gf[1].gfx_filter_autoscale && ((wc->native_width > picasso96_state.Width && wc->native_height >= picasso96_state.Height) || (wc->native_height > picasso96_state.Height && wc->native_width >= picasso96_state.Width))) return -1; if (currprefs.win32_rtgallowscaling && (picasso96_state.Width != wc->native_width || picasso96_state.Height != wc->native_height)) return -1; diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index fac1b7e0..dbda4f79 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -6437,8 +6437,10 @@ static void values_to_displaydlg (HWND hDlg) SendDlgItemMessage (hDlg, IDC_AUTORESOLUTIONSELECT, CB_SETCURSEL, 2, 0); else if (workprefs.gfx_autoresolution <= 33) SendDlgItemMessage (hDlg, IDC_AUTORESOLUTIONSELECT, CB_SETCURSEL, 3, 0); + else if (workprefs.gfx_autoresolution <= 99) + SendDlgItemMessage(hDlg, IDC_AUTORESOLUTIONSELECT, CB_SETCURSEL, 4, 0); else - SendDlgItemMessage (hDlg, IDC_AUTORESOLUTIONSELECT, CB_SETCURSEL, 4, 0); + SendDlgItemMessage(hDlg, IDC_AUTORESOLUTIONSELECT, CB_SETCURSEL, 5, 0); CheckDlgButton (hDlg, IDC_BLACKER_THAN_BLACK, workprefs.gfx_blackerthanblack); CheckDlgButton (hDlg, IDC_LORES_SMOOTHED, workprefs.gfx_lores_mode); @@ -6689,6 +6691,8 @@ static void values_from_displaydlg (HWND hDlg, UINT msg, WPARAM wParam, LPARAM l workprefs.gfx_autoresolution = 33; else if (posn1 == 4) workprefs.gfx_autoresolution = 66; + else + workprefs.gfx_autoresolution = 100; } int dmode = -1; @@ -7489,8 +7493,8 @@ static void values_to_memorydlg (HWND hDlg) } - CheckDlgButton (hDlg, IDC_RTG_SCALE, workprefs.win32_rtgscalemode == RTG_MODE_SCALE); - CheckDlgButton (hDlg, IDC_RTG_CENTER, workprefs.win32_rtgscalemode == RTG_MODE_CENTER); + CheckDlgButton(hDlg, IDC_RTG_SCALE, workprefs.gf[1].gfx_filter_autoscale == RTG_MODE_SCALE); + CheckDlgButton(hDlg, IDC_RTG_CENTER, workprefs.gf[1].gfx_filter_autoscale == RTG_MODE_CENTER); CheckDlgButton (hDlg, IDC_RTG_SCALE_ALLOW, workprefs.win32_rtgallowscaling); CheckDlgButton (hDlg, IDC_RTG_MATCH_DEPTH, workprefs.win32_rtgmatchdepth); CheckDlgButton (hDlg, IDC_RTG_VBINTERRUPT, workprefs.rtg_hardwareinterrupt); @@ -7787,11 +7791,11 @@ static INT_PTR CALLBACK ExpansionDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LP workprefs.win32_rtgmatchdepth = ischecked (hDlg, IDC_RTG_MATCH_DEPTH); break; case IDC_RTG_SCALE: - workprefs.win32_rtgscalemode = ischecked (hDlg, IDC_RTG_SCALE) ? RTG_MODE_SCALE : 0; + workprefs.gf[1].gfx_filter_autoscale = ischecked(hDlg, IDC_RTG_SCALE) ? RTG_MODE_SCALE : 0; setchecked (hDlg, IDC_RTG_CENTER, false); break; case IDC_RTG_CENTER: - workprefs.win32_rtgscalemode = ischecked (hDlg, IDC_RTG_CENTER) ? RTG_MODE_CENTER : 0; + workprefs.gf[1].gfx_filter_autoscale = ischecked(hDlg, IDC_RTG_CENTER) ? RTG_MODE_CENTER : 0; setchecked (hDlg, IDC_RTG_SCALE, false); break; case IDC_RTG_SCALE_ALLOW: @@ -14338,24 +14342,35 @@ static void values_to_hw3ddlg (HWND hDlg) SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_RESETCONTENT, 0, 0L); WIN32GUI_LoadUIString (IDS_AUTOSCALE_DISABLED, txt, sizeof (txt) / sizeof (TCHAR)); SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_ADDSTRING, 0, (LPARAM)txt); - WIN32GUI_LoadUIString (IDS_AUTOSCALE_DEFAULT, txt, sizeof (txt) / sizeof (TCHAR)); - SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_ADDSTRING, 0, (LPARAM)txt); - WIN32GUI_LoadUIString (IDS_AUTOSCALE_TV, txt, sizeof (txt) / sizeof (TCHAR)); - SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_ADDSTRING, 0, (LPARAM)txt); - WIN32GUI_LoadUIString (IDS_AUTOSCALE_MAX, txt, sizeof (txt) / sizeof (TCHAR)); - SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_ADDSTRING, 0, (LPARAM)txt); - WIN32GUI_LoadUIString (IDS_AUTOSCALE_SCALING, txt, sizeof (txt) / sizeof (TCHAR)); - SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_ADDSTRING, 0, (LPARAM)txt); - WIN32GUI_LoadUIString (IDS_AUTOSCALE_RESIZE, txt, sizeof (txt) / sizeof (TCHAR)); - SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_ADDSTRING, 0, (LPARAM)txt); - WIN32GUI_LoadUIString (IDS_AUTOSCALE_CENTER, txt, sizeof (txt) / sizeof (TCHAR)); - SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_ADDSTRING, 0, (LPARAM)txt); - WIN32GUI_LoadUIString (IDS_AUTOSCALE_MANUAL, txt, sizeof (txt) / sizeof (TCHAR)); - SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_ADDSTRING, 0, (LPARAM)txt); - WIN32GUI_LoadUIString (IDS_AUTOSCALE_INTEGER, txt, sizeof (txt) / sizeof (TCHAR)); - SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_ADDSTRING, 0, (LPARAM)txt); - WIN32GUI_LoadUIString (IDS_AUTOSCALE_INTEGER_AUTOSCALE, txt, sizeof (txt) / sizeof (TCHAR)); - SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_ADDSTRING, 0, (LPARAM)txt); + if (!filter_nativertg) { + WIN32GUI_LoadUIString (IDS_AUTOSCALE_DEFAULT, txt, sizeof (txt) / sizeof (TCHAR)); + SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_ADDSTRING, 0, (LPARAM)txt); + WIN32GUI_LoadUIString (IDS_AUTOSCALE_TV, txt, sizeof (txt) / sizeof (TCHAR)); + SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_ADDSTRING, 0, (LPARAM)txt); + WIN32GUI_LoadUIString (IDS_AUTOSCALE_MAX, txt, sizeof (txt) / sizeof (TCHAR)); + SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_ADDSTRING, 0, (LPARAM)txt); + WIN32GUI_LoadUIString (IDS_AUTOSCALE_SCALING, txt, sizeof (txt) / sizeof (TCHAR)); + SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_ADDSTRING, 0, (LPARAM)txt); + WIN32GUI_LoadUIString (IDS_AUTOSCALE_RESIZE, txt, sizeof (txt) / sizeof (TCHAR)); + SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_ADDSTRING, 0, (LPARAM)txt); + WIN32GUI_LoadUIString (IDS_AUTOSCALE_CENTER, txt, sizeof (txt) / sizeof (TCHAR)); + SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_ADDSTRING, 0, (LPARAM)txt); + WIN32GUI_LoadUIString (IDS_AUTOSCALE_MANUAL, txt, sizeof (txt) / sizeof (TCHAR)); + SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_ADDSTRING, 0, (LPARAM)txt); + WIN32GUI_LoadUIString (IDS_AUTOSCALE_INTEGER, txt, sizeof (txt) / sizeof (TCHAR)); + SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_ADDSTRING, 0, (LPARAM)txt); + WIN32GUI_LoadUIString (IDS_AUTOSCALE_INTEGER_AUTOSCALE, txt, sizeof (txt) / sizeof (TCHAR)); + SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_ADDSTRING, 0, (LPARAM)txt); + } else { + WIN32GUI_LoadUIString(IDS_AUTOSCALE_DEFAULT, txt, sizeof (txt) / sizeof (TCHAR)); + SendDlgItemMessage(hDlg, IDC_FILTERAUTOSCALE, CB_ADDSTRING, 0, (LPARAM)txt); + WIN32GUI_LoadUIString(IDS_AUTOSCALE_CENTER, txt, sizeof (txt) / sizeof (TCHAR)); + SendDlgItemMessage(hDlg, IDC_FILTERAUTOSCALE, CB_ADDSTRING, 0, (LPARAM)txt); +#if 0 + WIN32GUI_LoadUIString(IDS_AUTOSCALE_INTEGER, txt, sizeof (txt) / sizeof (TCHAR)); + SendDlgItemMessage(hDlg, IDC_FILTERAUTOSCALE, CB_ADDSTRING, 0, (LPARAM)txt); +#endif + } SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_SETCURSEL, workprefs.gf[filter_nativertg].gfx_filter_autoscale, 0); SendDlgItemMessage (hDlg, IDC_FILTERSTACK, CB_RESETCONTENT, 0, 0); diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index 4857c846..77221670 100644 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -11,6 +11,50 @@ - restore only single input target to default. +Beta 14: + +- FSINCOS second register supported in disassembler. +- FMOVEM and FMOVECR disassembler support. Disassembler should now support all FPU instructions. +- Added missing special case 68020+ instruction disassembler support: bit fields, MOVES. +- Disassembler output improved, most unsized instructions don't have .L size extension anymore. +- Action Replay 2/3 was incompatible with b8 cpu emulation changes. +- CPU mode (JIT/more compatible/cycle-exact) on the fly switching was unstable since b8. +- Mirror Expansion panel RTG scale options in Filter panel. (More options will be added in future) +- Removed some forced inlining that only increased size of executable and wasted CPU cache space. +- Added support for early 68040 revision that has slightly different FPU stack frames and version + id. (Config file fpu_revision=0x40). Not much use in Amiga emulation but first 68040 based Next + systems came with first revision 68040's and NextStep 2.0 unimplemented emulation code only + supported first revision unimplemented stack frame type. +- FMOVEM predec/postinc mode bit emulation fixed again, now it really works correctly. +- Implemented (partial) 68040 FPU BUSY stack frame. +- Pre filters in RTG mode loaded incorrectly from config file. +- Implemented FPU exception state statefile support. +- b13 JIT FPU bug workaround replaced with fixed optimization (Peter Keunecke) +- Attempt to automatically select correct resolution (hires/shres) when programmed mode is active. + Always active if resolution setting is hires or larger and doubling is enabled. No more programmed + modes that are 2x wide or half width without manually changing resolution setting, note that currently + "wrong" mode is visible at least 1 frame before mode changes. +- Arcadia game Aaargh supported. + +Beta 13: + +- Canceling video or audio codec selection dialog will disable audio or video recording. + This has been broken for long time, it was impossible to record video only or audio only + (except in wav mode). +- 64-bit build now also supports wintab tablet API. +- Fixed some slirp Windows specific 64-bit compilation issues. +- Fixed JIT + more compatible enabled emulated Amiga crash. (b9) +- If "always on top" option is enabled, GUI is also opened with "always on top" flag. +- gfx_linemode=none (no doubling) was loaded as doubled mode. +- Check and limit 2x software filter height value if size is larger than allocated buffer size, + preventing display buffer overflow crash. +- Debugger now disassembles most FPU instructions correctly but some of them may look strange.. +- Disassembler MULL and DIVL fully decoded. +- Support "INPUTDIMS" D3D shader variable. Used by some shaders. +- JIT FPU rare bug workaround, FPU constant optimization introduced in 1200b3 disabled. + (Code looks correct, it works correctly except in some very rare situations, real cause may be + some unknown JIT side-effect) + Beta 12: - Config file writing created corrupted (and harmless) config file lines, most common being diff --git a/readcpu.cpp b/readcpu.cpp index 6e7e8aed..00fd89fc 100644 --- a/readcpu.cpp +++ b/readcpu.cpp @@ -252,7 +252,9 @@ out1: int pos = 0; int mnp = 0; int bitno = 0; + int unsized = 1; TCHAR mnemonic[10]; + int mnemo; wordsizes sz = sz_long; int srcgather = 0, dstgather = 0; @@ -301,6 +303,7 @@ out1: while (opcstr[pos] && !_istspace(opcstr[pos])) { if (opcstr[pos] == '.') { pos++; + unsized = 0; switch (opcstr[pos]) { case 'B': sz = sz_byte; break; @@ -711,14 +714,21 @@ endofline: table68k[opc].mnemo = lookuptab[find].mnemo; } table68k[opc].cc = bitval[bitc]; - if (table68k[opc].mnemo == i_BTST - || table68k[opc].mnemo == i_BSET - || table68k[opc].mnemo == i_BCLR - || table68k[opc].mnemo == i_BCHG) + mnemo = table68k[opc].mnemo; + if (mnemo == i_BTST + || mnemo == i_BSET + || mnemo == i_BCLR + || mnemo == i_BCHG) { sz = destmode == Dreg ? sz_long : sz_byte; + unsized = 0; } + if (mnemo == i_JSR || mnemo == i_JMP) { + unsized = 1; + } + table68k[opc].size = sz; + table68k[opc].unsized = unsized; table68k[opc].sduse = id.sduse; table68k[opc].sreg = srcreg; table68k[opc].dreg = destreg; diff --git a/rommgr.cpp b/rommgr.cpp index 2554834b..fd09c08a 100644 --- a/rommgr.cpp +++ b/rommgr.cpp @@ -92,7 +92,7 @@ struct romdata *getromdatabypath (const TCHAR *path) return NULL; } -#define NEXT_ROM_ID 88 +#define NEXT_ROM_ID 89 static struct romheader romheaders[] = { { _T("Freezer Cartridges"), 1 }, @@ -320,6 +320,7 @@ static struct romdata roms[] = { { _T("Arcadia Ninja Mission"), 0, 0, 0, 0, _T("ARCADIA\0"), 0, 84, 0, 0, ROMTYPE_ARCADIAGAME, 0, 2 }, { _T("Arcadia Sidewinder"), 0, 0, 0, 0, _T("ARCADIA\0"), 0, 85, 0, 0, ROMTYPE_ARCADIAGAME, 0, 2 }, { _T("Arcadia Leader Board Golf v2.5"), 0, 0, 0, 0, _T("ARCADIA\0"), 0, 86, 0, 0, ROMTYPE_ARCADIAGAME, 0, 2 }, + { _T("Arcadia Aaargh"), 0, 0, 0, 0, _T("ARCADIA\0"), 0, 88, 0, 0, ROMTYPE_ARCADIAGAME, 0, 2 }, { NULL } diff --git a/tabletlibrary.cpp b/tabletlibrary.cpp index 58052c77..241e50da 100644 --- a/tabletlibrary.cpp +++ b/tabletlibrary.cpp @@ -111,6 +111,12 @@ static uae_u32 REGPARAM2 lib_expungefunc (TrapContext *context) { return 0; } + +#define TAG_DONE (0L) /* terminates array of TagItems. ti_Data unused */ +#define TAG_IGNORE (1L) /* ignore this item, not end of array */ +#define TAG_MORE (2L) /* ti_Data is pointer to another array of TagItems */ +#define TAG_SKIP (3L) /* skip this and the next ti_Data items */ + static uae_u32 REGPARAM2 lib_allocfunc (TrapContext *context) { uae_u32 tags = m68k_areg (regs, 0); @@ -120,6 +126,24 @@ static uae_u32 REGPARAM2 lib_allocfunc (TrapContext *context) mem = CallLib (context, get_long (4), -0xC6); /* AllocMem */ if (!mem) return 0; + for (;;) { + uae_u32 t = get_long(tags); + if (t == TAG_DONE) + break; + if (t == TAG_SKIP) { + tags += 8 + get_long(tags + 4) * 8; + } else if (t == TAG_MORE) { + tags = get_long(tags + 4); + } else if (t == TAG_IGNORE) { + tags += 8; + } else { + t -= 0x8003a000; + // clear "unknown" tags + if (t != 6 && t != 8) + put_long(tags, TAG_IGNORE); + tags += 8; + } + } put_long (mem + 20, tablettags); filltags (mem); return mem;