From: Toni Wilen Date: Wed, 25 Apr 2007 15:15:56 +0000 (+0300) Subject: imported winuaesrc1420b9.zip X-Git-Tag: 2100~226 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=3d4b671a10d65a1665b8a4a36686e8d5d3e6b328;p=francis%2Fwinuae.git imported winuaesrc1420b9.zip --- diff --git a/akiko.c b/akiko.c index 99fb989a..da6bc9e8 100755 --- a/akiko.c +++ b/akiko.c @@ -713,7 +713,8 @@ static int cdrom_command_multi (void) int cdrom_data_offset_end = msf2lsn (endpos); cdrom_data_offset = msf2lsn (seekpos); #if AKIKO_DEBUG_IO_CMD - write_log ("READ DATA FROM %06.6X (%d) TO %06.6X (%d) SPEED=%dx\n", seekpos, cdrom_data_offset, endpos, cdrom_data_offset_end, cdrom_speed); + write_log ("READ DATA FROM %06.6X (%d) TO %06.6X (%d) SPEED=%dx\n", + seekpos, cdrom_data_offset, endpos, cdrom_data_offset_end, cdrom_speed); #endif cdrom_result_buffer[1] |= 0x02; } else if (cdrom_command_buffer[10] & 4) { /* play audio */ diff --git a/cfgfile.c b/cfgfile.c index 076235dc..98f79511 100755 --- a/cfgfile.c +++ b/cfgfile.c @@ -468,6 +468,13 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) cfgfile_write (f, "gfx_filter_scanlines=%d\n", p->gfx_filter_scanlines); cfgfile_write (f, "gfx_filter_scanlinelevel=%d\n", p->gfx_filter_scanlinelevel); cfgfile_write (f, "gfx_filter_scanlineratio=%d\n", p->gfx_filter_scanlineratio); + cfgfile_write (f, "gfx_filter_luminance=%d\n", p->gfx_filter_luminance); + cfgfile_write (f, "gfx_filter_contrast=%d\n", p->gfx_filter_contrast); + cfgfile_write (f, "gfx_filter_saturation=%d\n", p->gfx_filter_saturation); + cfgfile_write (f, "gfx_filter_gamma=%d\n", p->gfx_filter_gamma); + cfgfile_write (f, "gfx_filter_blur=%d\n", p->gfx_filter_blur); + cfgfile_write (f, "gfx_filter_noise=%d\n", p->gfx_filter_noise); + cfgfile_write (f, "gfx_luminance=%d\n", p->gfx_luminance); cfgfile_write (f, "gfx_contrast=%d\n", p->gfx_contrast); cfgfile_write (f, "gfx_gamma=%d\n", p->gfx_gamma); @@ -764,6 +771,12 @@ static int cfgfile_parse_host (struct uae_prefs *p, char *option, char *value) || cfgfile_intval (option, value, "gfx_filter_scanlines", &p->gfx_filter_scanlines, 1) || cfgfile_intval (option, value, "gfx_filter_scanlinelevel", &p->gfx_filter_scanlinelevel, 1) || cfgfile_intval (option, value, "gfx_filter_scanlineratio", &p->gfx_filter_scanlineratio, 1) + || cfgfile_intval (option, value, "gfx_filter_luminance", &p->gfx_filter_luminance, 1) + || cfgfile_intval (option, value, "gfx_filter_contrast", &p->gfx_filter_contrast, 1) + || cfgfile_intval (option, value, "gfx_filter_saturation", &p->gfx_filter_saturation, 1) + || cfgfile_intval (option, value, "gfx_filter_gamma", &p->gfx_filter_gamma, 1) + || cfgfile_intval (option, value, "gfx_filter_blur", &p->gfx_filter_blur, 1) + || cfgfile_intval (option, value, "gfx_filter_noise", &p->gfx_filter_noise, 1) || cfgfile_intval (option, value, "gfx_luminance", &p->gfx_luminance, 1) || cfgfile_intval (option, value, "gfx_contrast", &p->gfx_contrast, 1) || cfgfile_intval (option, value, "gfx_gamma", &p->gfx_gamma, 1) @@ -1172,6 +1185,8 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, char *option, char *valu return 1; if (cfgfile_intval (option, value, "cachesize", &p->cachesize, 1) + || cfgfile_intval (option, value, "cpu060_revision", &p->cpu060_revision, 1) + || cfgfile_intval (option, value, "fpu_revision", &p->fpu_revision, 1) || cfgfile_intval (option, value, "cdtvramcard", &p->cs_cdtvcard, 1) || cfgfile_intval (option, value, "fatgary", &p->cs_fatgaryrev, 1) || cfgfile_intval (option, value, "ramsey", &p->cs_ramseyrev, 1) @@ -2720,6 +2735,8 @@ void default_prefs (struct uae_prefs *p, int type) p->fpu_model = 0; p->cpu_model = 68000; + p->cpu060_revision = 1; + p->fpu_revision = -1; p->m68k_speed = 0; p->cpu_compatible = 1; p->address_space_24 = 1; @@ -2791,6 +2808,8 @@ static void buildin_default_prefs (struct uae_prefs *p) p->fpu_model = 0; p->cpu_model = 68000; + p->cpu060_revision = 1; + p->fpu_revision = -1; p->m68k_speed = 0; p->cpu_compatible = 1; p->address_space_24 = 1; diff --git a/expansion.c b/expansion.c index e3db1390..a7a30415 100755 --- a/expansion.c +++ b/expansion.c @@ -1055,6 +1055,23 @@ static void allocate_expamem (void) #endif /* SAVESTATE */ } +int need_uae_boot_rom(void) +{ + if (nr_units() > 0) + return 1; + if (currprefs.socket_emu) + return 1; + if (currprefs.uaeserial) + return 1; + if (currprefs.scsi) + return 1; + if (currprefs.win32_outsidemouse) + return 1; + if (currprefs.gfxmem_size) + return 1; + return 0; +} + void expamem_reset (void) { int do_mount = 1; @@ -1079,11 +1096,8 @@ void expamem_reset (void) write_log ("Kickstart version is below 1.3! Disabling autoconfig devices.\n"); do_mount = 0; } -#ifdef FILESYS - /* No need for filesystem stuff if there aren't any mounted. */ - if (nr_units() == 0) + if (need_uae_boot_rom() == 0) do_mount = 0; -#endif if (fastmemory != NULL) { card_init[cardno] = expamem_init_fastcard; card_map[cardno++] = expamem_map_fastcard; diff --git a/fpp.c b/fpp.c index aaadd638..78c26007 100755 --- a/fpp.c +++ b/fpp.c @@ -182,6 +182,8 @@ typedef uae_s32 tointtype; static int get_fpu_version(void) { int v = 0; + if (currprefs.fpu_revision >= 0) + return currprefs.fpu_revision; switch (currprefs.fpu_model) { case 68881: @@ -218,7 +220,7 @@ STATIC_INLINE tointtype toint(fptype src, fptype minval, fptype maxval) case 0: /* to nearest */ return (tointtype)floor (src + 0.5); case 1: /* to zero */ - return (tointtype) src; + return (tointtype)src; case 2: /* down */ return (tointtype)floor (src); case 3: /* up */ @@ -773,9 +775,9 @@ void fdbcc_opp (uae_u32 opcode, struct regstruct *regs, uae_u16 extra) } else if (!cc) { int reg = opcode & 0x7; - m68k_dreg (regs, reg) = ((m68k_dreg (regs, reg) & ~0xffff) - | ((m68k_dreg (regs, reg) - 1) & 0xffff)); - if ((m68k_dreg (regs, reg) & 0xffff) == 0xffff) + m68k_dreg (regs, reg) = ((m68k_dreg (regs, reg) & 0xffff0000) + | (((m68k_dreg (regs, reg) & 0xffff) - 1) & 0xffff)); + if ((m68k_dreg (regs, reg) & 0xffff) != 0xffff) m68k_setpc (regs, pc + disp); } } @@ -1026,7 +1028,7 @@ void fpp_opp (uae_u32 opcode, struct regstruct *regs, uae_u16 extra) if ((opcode & 0x38) == 0) { if (extra & 0x2000) { if (extra & 0x1000) - m68k_dreg (regs, opcode & 7) = regs->fpcr; + m68k_dreg (regs, opcode & 7) = regs->fpcr & 0xffff; if (extra & 0x0800) m68k_dreg (regs, opcode & 7) = get_fpsr (); if (extra & 0x0400) @@ -1044,7 +1046,7 @@ void fpp_opp (uae_u32 opcode, struct regstruct *regs, uae_u16 extra) } else if ((opcode & 0x38) == 0x08) { if (extra & 0x2000) { if (extra & 0x1000) - m68k_areg (regs, opcode & 7) = regs->fpcr; + m68k_areg (regs, opcode & 7) = regs->fpcr & 0xffff; if (extra & 0x0800) m68k_areg (regs, opcode & 7) = get_fpsr (); if (extra & 0x0400) @@ -1090,7 +1092,7 @@ void fpp_opp (uae_u32 opcode, struct regstruct *regs, uae_u16 extra) } ad -= incr; if (extra & 0x1000) { - put_long (ad, regs->fpcr); + put_long (ad, regs->fpcr & 0xffff); ad += 4; } if (extra & 0x0800) { @@ -1109,13 +1111,23 @@ void fpp_opp (uae_u32 opcode, struct regstruct *regs, uae_u16 extra) } else { /* FMOVEM memory->FPP */ uae_u32 ad; + int incr = 0; if (get_fp_ad (opcode, &ad) == 0) { m68k_setpc (regs, m68k_getpc (regs) - 4); op_illg (opcode, regs); return; } - ad = (opcode & 0x38) == 0x20 ? ad - 12 : ad; + //ad = (opcode & 0x38) == 0x20 ? ad - 12 : ad; + if((opcode & 0x38) == 0x20) { + if (extra & 0x1000) + incr += 4; + if (extra & 0x0800) + incr += 4; + if (extra & 0x0400) + incr += 4; + ad = ad - incr; + } if (extra & 0x1000) { regs->fpcr = get_long (ad); native_set_fpucw(regs->fpcr); diff --git a/gayle.c b/gayle.c index 196db431..3f9ff644 100755 --- a/gayle.c +++ b/gayle.c @@ -135,6 +135,7 @@ struct ide_hdf uae_u8 status; int irq_delay; int num; + int bootpri; // for fake RDB }; static struct ide_hdf idedrive[4]; @@ -1512,6 +1513,7 @@ int gayle_add_ide_unit(int ch, char *path, int blocksize, int readonly, ide = &idedrive[ch]; ide->hfd.readonly = readonly; ide->hfd.blocksize = blocksize; + ide->bootpri = bootpri; ide->size = 0; if (!hdf_open(&ide->hfd, path)) return -1; @@ -1530,7 +1532,7 @@ int gayle_add_ide_unit(int ch, char *path, int blocksize, int readonly, hdf_read(&ide->hfd, buf, 0, 512); if (buf[0] != 0 && memcmp(buf, "RDSK", 4)) { ide->hfd.nrcyls = (ide->hfd.size / blocksize) / (sectors * surfaces); - create_virtual_rdb(&ide->hfd, rl (buf), bootpri, filesys); + create_virtual_rdb(&ide->hfd, rl (buf), ide->bootpri, filesys); while (ide->hfd.nrcyls * surfaces * sectors > ide->cyls_def * ide->secspertrack_def * ide->heads_def) { ide->cyls_def++; } @@ -1634,6 +1636,11 @@ uae_u8 *save_ide (int num, int *len) save_u8(ide_feat2); save_u8(ide_error); save_u8(ide_devcon); + save_u64(ide->hfd.virtual_size); + save_u32(ide->hfd.secspertrack); + save_u32(ide->hfd.heads); + save_u32(ide->hfd.reservedblocks); + save_u32(ide->bootpri); *len = dst - dstbak; return dstbak; } @@ -1668,7 +1675,16 @@ uae_u8 *restore_ide (uae_u8 *src) ide_feat2 = restore_u8(); ide_error = restore_u8(); ide_devcon = restore_u8(); - gayle_add_ide_unit (num, path, blocksize, readonly, 0, 0, 0, 0, 0, 0); + ide->hfd.virtual_size = restore_u64(); + ide->hfd.secspertrack = restore_u32(); + ide->hfd.heads = restore_u32(); + ide->hfd.reservedblocks = restore_u32(); + ide->bootpri = restore_u32(); + if (ide->hfd.virtual_size) + gayle_add_ide_unit (num, path, blocksize, readonly, ide->hfd.device_name, + ide->hfd.secspertrack, ide->hfd.heads, ide->hfd.reservedblocks, ide->bootpri, NULL); + else + gayle_add_ide_unit (num, path, blocksize, readonly, 0, 0, 0, 0, 0, 0); xfree(path); return src; } diff --git a/gencomp.c b/gencomp.c index 6939b2f6..ccc19db0 100755 --- a/gencomp.c +++ b/gencomp.c @@ -2844,6 +2844,8 @@ gen_opcode (unsigned long int opcode) break; case i_MMUOP: + case i_MMUOP30A: + case i_MMUOP30B: isjump; failure; break; diff --git a/gencpu.c b/gencpu.c index db1128cb..7b188d4d 100755 --- a/gencpu.c +++ b/gencpu.c @@ -790,9 +790,9 @@ static void genmovemle (uae_u16 opcode) char putcode[100]; int size = table68k[opcode].size == sz_long ? 4 : 2; if (table68k[opcode].size == sz_long) { - strcpy (putcode, "put_long(srca,"); + strcpy (putcode, "put_long(srca"); } else { - strcpy (putcode, "put_word(srca,"); + strcpy (putcode, "put_word(srca"); } printf ("\tuae_u16 mask = %s;\n", gen_nextiword (0)); @@ -803,16 +803,21 @@ static void genmovemle (uae_u16 opcode) start_brace (); if (table68k[opcode].dmode == Apdi) { printf ("\tuae_u16 amask = mask & 0xff, dmask = (mask >> 8) & 0xff;\n"); - printf ("\twhile (amask) { srca -= %d; %s m68k_areg(regs, movem_index2[amask])); amask = movem_next[amask]; }\n", - size, putcode); - printf ("\twhile (dmask) { srca -= %d; %s m68k_dreg(regs, movem_index2[dmask])); dmask = movem_next[dmask]; }\n", - size, putcode); + printf ("\tint type = get_cpu_model() >= 68020;\n"); + printf ("\twhile (amask) {\n"); + printf ("\t\tsrca -= %d;\n", size); + printf ("\t\tif (type) m68k_areg(regs, dstreg) = srca;\n"); + printf ("\t\t%s, m68k_areg(regs, movem_index2[amask]));\n", putcode); + printf ("\t\tamask = movem_next[amask];\n"); + printf ("\t}\n"); + printf ("\twhile (dmask) { srca -= %d; %s, m68k_dreg(regs, movem_index2[dmask])); dmask = movem_next[dmask]; }\n", + size, putcode); printf ("\tm68k_areg(regs, dstreg) = srca;\n"); } else { printf ("\tuae_u16 dmask = mask & 0xff, amask = (mask >> 8) & 0xff;\n"); - printf ("\twhile (dmask) { %s m68k_dreg(regs, movem_index1[dmask])); srca += %d; dmask = movem_next[dmask]; }\n", + printf ("\twhile (dmask) { %s, m68k_dreg(regs, movem_index1[dmask])); srca += %d; dmask = movem_next[dmask]; }\n", putcode, size); - printf ("\twhile (amask) { %s m68k_areg(regs, movem_index1[amask])); srca += %d; amask = movem_next[amask]; }\n", + printf ("\twhile (amask) { %s, m68k_areg(regs, movem_index1[amask])); srca += %d; amask = movem_next[amask]; }\n", putcode, size); } } diff --git a/gfxutil.c b/gfxutil.c index 0363a433..6842bfe0 100755 --- a/gfxutil.c +++ b/gfxutil.c @@ -180,10 +180,18 @@ static uae_u32 get_cr(int r, int g, int b) return limit256rb(0.5f*r - 0.418688f*g - 0.081312f*b); } -extern uae_s32 tyhrgb[262144]; -extern uae_s32 tylrgb[262144]; -extern uae_s32 tcbrgb[262144]; -extern uae_s32 tcrrgb[262144]; +extern uae_s32 tyhrgb[65536]; +extern uae_s32 tylrgb[65536]; +extern uae_s32 tcbrgb[65536]; +extern uae_s32 tcrrgb[65536]; +extern uae_u32 redc[3 * 256], grec[3 * 256], bluc[3 * 256]; + +static uae_u32 lowbits(int v, int shift, int lsize) +{ + v >>= shift; + v &= (1 << lsize) - 1; + return v; +} void alloc_colors64k (int rw, int gw, int bw, int rs, int gs, int bs, int aw, int as, int alpha, int byte_swap) { @@ -196,27 +204,23 @@ void alloc_colors64k (int rw, int gw, int bw, int rs, int gs, int bs, int aw, in int r = ((i >> 8) << 4) | (i >> 8); int g = (((i >> 4) & 0xf) << 4) | ((i >> 4) & 0x0f); int b = ((i & 0xf) << 4) | (i & 0x0f); - if (usedfilter && usedfilter->yuv && !(currprefs.chipset_mask & CSMASK_AGA)) { - xcolors[i] = (get_yh(r, g, b) << 24) | (get_yl(r, g, b) << 16) | (get_cb(r, g, b) << 8) | (get_cr(r, g, b) << 0); - } else { - r = gamma[r + j]; - g = gamma[g + j]; - b = gamma[b + j]; - xcolors[i] = doMask(r, rw, rs) | doMask(g, gw, gs) | doMask(b, bw, bs) | doAlpha (alpha, aw, as); - if (byte_swap) { - if (bpp <= 16) - xcolors[i] = bswap_16 (xcolors[i]); - else - xcolors[i] = bswap_32 (xcolors[i]); - } - if (bpp <= 16) { - /* Fill upper 16 bits of each colour value - * with a copy of the colour. */ - xcolors[i] |= xcolors[i] * 0x00010001; - } + r = gamma[r + j]; + g = gamma[g + j]; + b = gamma[b + j]; + xcolors[i] = doMask(r, rw, rs) | doMask(g, gw, gs) | doMask(b, bw, bs) | doAlpha (alpha, aw, as); + if (byte_swap) { + if (bpp <= 16) + xcolors[i] = bswap_16 (xcolors[i]); + else + xcolors[i] = bswap_32 (xcolors[i]); + } + if (bpp <= 16) { + /* Fill upper 16 bits of each colour value + * with a copy of the colour. */ + xcolors[i] |= xcolors[i] * 0x00010001; } } -#ifdef AGA +#if defined(AGA) || defined(GFXFILTER) /* create AGA color tables */ for(i = 0; i < 256; i++) { j = i + 256; @@ -242,16 +246,63 @@ void alloc_colors64k (int rw, int gw, int bw, int rs, int gs, int bs, int aw, in xbluecolors [i] = xbluecolors [i] * 0x00010001; } } - /* create AGA RGB 6:6:6 YUV-filter tables */ - if (usedfilter && usedfilter->yuv && (currprefs.chipset_mask & CSMASK_AGA)) { - for (i = 0; i < 262144; i++) { + /* copy original color table */ + for (i = 0; i < 256; i++) { + redc[0 * 256 + i] = xredcolors[0]; + grec[0 * 256 + i] = xgreencolors[0]; + bluc[0 * 256 + i] = xbluecolors[0]; + redc[1 * 256 + i] = xredcolors[i]; + grec[1 * 256 + i] = xgreencolors[i]; + bluc[1 * 256 + i] = xbluecolors[i]; + redc[2 * 256 + i] = xredcolors[255]; + grec[2 * 256 + i] = xgreencolors[255]; + bluc[2 * 256 + i] = xbluecolors[255]; + } + if (usedfilter && usedfilter->yuv) { + /* create internal 5:6:5 color tables */ + for (i = 0; i < 256; i++) { + j = i + 256; + xredcolors[i] = doColor (gamma[j], 5, 11); + xgreencolors[i] = doColor (gamma[j], 6, 5); + xbluecolors[i] = doColor (gamma[j], 5, 0); + if (bpp <= 16) { + /* Fill upper 16 bits of each colour value with + * a copy of the colour. */ + xredcolors [i] = xredcolors [i] * 0x00010001; + xgreencolors[i] = xgreencolors[i] * 0x00010001; + xbluecolors [i] = xbluecolors [i] * 0x00010001; + } + } + for (i = 0; i < 4096; i++) { + int r = ((i >> 8) << 4) | (i >> 8); + int g = (((i >> 4) & 0xf) << 4) | ((i >> 4) & 0x0f); + int b = ((i & 0xf) << 4) | (i & 0x0f); + r = gamma[r + 256]; + g = gamma[g + 256]; + b = gamma[b + 256]; + xcolors[i] = doMask(r, 5, 11) | doMask(g, 6, 5) | doMask(b, 5, 0); + if (byte_swap) { + if (bpp <= 16) + xcolors[i] = bswap_16 (xcolors[i]); + else + xcolors[i] = bswap_32 (xcolors[i]); + } + if (bpp <= 16) { + /* Fill upper 16 bits of each colour value + * with a copy of the colour. */ + xcolors[i] |= xcolors[i] * 0x00010001; + } + } + + /* create RGB 5:6:5 -> YUV tables */ + for (i = 0; i < 65536; i++) { uae_u32 r, g, b; - r = ((i >> 12) & 0x3f) << 2; - r = doColor(gamma[r + 256], rw, 0); - g = ((i >> 6) & 0x3f) << 2; - g = doColor(gamma[g + 256], gw, 0); - b = ((i >> 0) & 0x3f) << 2; - b = doColor(gamma[b + 256], bw, 0); + r = (((i >> 11) & 31) << 3) | lowbits (i, 11, 3); + r = gamma[r + 256]; + g = (((i >> 5) & 63) << 2) | lowbits (i, 5, 2); + g = gamma[g + 256]; + b = (((i >> 0) & 31) << 3) | lowbits (i, 0, 3); + b = gamma[b + 256]; tyhrgb[i] = get_yh (r, g, b) * 256 * 256; tylrgb[i] = get_yl (r, g, b) * 256 * 256; tcbrgb[i] = ((uae_s8)get_cb (r, g, b)) * 256; diff --git a/include/autoconf.h b/include/autoconf.h index 2adb1c1c..47854cf0 100755 --- a/include/autoconf.h +++ b/include/autoconf.h @@ -38,6 +38,7 @@ extern uaecptr filesys_initcode; extern int is_hardfile (int unit_no); extern int nr_units (void); +extern int need_uae_boot_rom (void); struct mountedinfo { diff --git a/include/gfxfilter.h b/include/gfxfilter.h index 4b4e70da..8b0faaa3 100755 --- a/include/gfxfilter.h +++ b/include/gfxfilter.h @@ -12,9 +12,7 @@ extern void S2X_free (void); extern void PAL_init (void); extern void PAL_1x1_32(uae_u32 *src, int pitchs, uae_u32 *trg, int pitcht, int width, int height); -extern void PAL_1x1_AGA_32(uae_u32 *src, int pitchs, uae_u32 *trg, int pitcht, int width, int height); -extern void PAL_1x1_16(uae_u32 *src, int pitchs, uae_u16 *trg, int pitcht, int width, int height); -extern void PAL_1x1_AGA_16(uae_u32 *src, int pitchs, uae_u16 *trg, int pitcht, int width, int height); +extern void PAL_1x1_16(uae_u16 *src, int pitchs, uae_u16 *trg, int pitcht, int width, int height); typedef unsigned char uint8; typedef unsigned short uint16; diff --git a/include/newcpu.h b/include/newcpu.h index 5f15207a..6c5c558f 100755 --- a/include/newcpu.h +++ b/include/newcpu.h @@ -300,6 +300,7 @@ extern uae_u32 REGPARAM3 get_disp_ea_000 (struct regstruct *regs, uae_u32 base, extern void m68k_disasm_ea (void *f, uaecptr addr, uaecptr *nextpc, int cnt, uae_u32 *seaddr, uae_u32 *deaddr); extern void m68k_disasm (void *f, uaecptr addr, uaecptr *nextpc, int cnt); extern void m68k_disasm_2 (char *buf, int bufsize, uaecptr addr, uaecptr *nextpc, int cnt, uae_u32 *seaddr, uae_u32 *deaddr, int safemode); +extern int get_cpu_model(void); extern void REGPARAM3 MakeSR (struct regstruct *regs) REGPARAM; extern void REGPARAM3 MakeFromSR (struct regstruct *regs) REGPARAM; diff --git a/include/options.h b/include/options.h index a7ad981a..af6a8047 100755 --- a/include/options.h +++ b/include/options.h @@ -230,7 +230,9 @@ struct uae_prefs { int m68k_speed; int cpu_level; int cpu_model; + int cpu060_revision; int fpu_model; + int fpu_revision; int cpu_compatible; int address_space_24; int picasso96_nocustom; diff --git a/memory.c b/memory.c index 858ba7df..b123400a 100755 --- a/memory.c +++ b/memory.c @@ -2343,7 +2343,7 @@ void memory_reset (void) map_banks (&cardmem_bank, cardmem_start >> 16, allocated_cardmem >> 16, 0); #ifdef AUTOCONFIG - if (nr_units()) { + if (need_uae_boot_rom()) { uae_boot_rom = 1; map_banks (&rtarea_bank, RTAREA_BASE >> 16, 1, 0); } diff --git a/newcpu.c b/newcpu.c index 6f27d8be..ac820724 100755 --- a/newcpu.c +++ b/newcpu.c @@ -77,8 +77,8 @@ cpuop_func *cpufunctbl[65536]; extern uae_u32 get_fpsr(void); #define COUNT_INSTRS 0 -#define MC68060_PCR 0x04300100 -#define MC68EC060_PCR 0x04310100 +#define MC68060_PCR 0x04300000 +#define MC68EC060_PCR 0x04310000 #if COUNT_INSTRS static unsigned long int instrcount[65536]; @@ -699,6 +699,11 @@ static int verify_ea (int reg, amodes mode, wordsizes size, uae_u32 *val) } #endif +int get_cpu_model(void) +{ + return currprefs.cpu_model; +} + uae_u32 REGPARAM2 get_disp_ea_020 (struct regstruct *regs, uae_u32 base, uae_u32 dp) { int reg = (dp >> 12) & 15; @@ -1589,6 +1594,7 @@ void m68k_reset (void) regs.pcr = 0; if (currprefs.cpu_model == 68060) { regs.pcr = currprefs.fpu_model ? MC68060_PCR : MC68EC060_PCR; + regs.pcr |= (currprefs.cpu060_revision & 0xff) << 8; regs.pcr |= 2; } fill_prefetch_slow (®s); diff --git a/od-win32/build68k_msvc/build68k_msvc.vcproj b/od-win32/build68k_msvc/build68k_msvc.vcproj index 8dfd658c..ed747f26 100755 --- a/od-win32/build68k_msvc/build68k_msvc.vcproj +++ b/od-win32/build68k_msvc/build68k_msvc.vcproj @@ -1,9 +1,10 @@ - - - - - - - - - - - - - - - - - @@ -142,6 +142,8 @@ SubSystem="1" OptimizeReferences="2" EnableCOMDATFolding="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="1" /> - - > 0))) * sat; } +#endif -STATIC_INLINE uae_u32 STRIPRGB(uae_u32 v) -{ - return ((v & 0x0000fc) >> 2) | ((v & 0x00fc00) >> 4) | ((v & 0xfc0000) >> 6); -} STATIC_INLINE int zyhRGB(uae_u32 v) { - return tyhrgb[STRIPRGB(v)]; + return tyhrgb[v]; } STATIC_INLINE int zylRGB(uae_u32 v) { - return tylrgb[STRIPRGB(v)]; + return tylrgb[v]; } STATIC_INLINE int zcbRGB(uae_u32 v) { - return tcbrgb[STRIPRGB(v)]; + return tcbrgb[v]; } STATIC_INLINE int zcrRGB(uae_u32 v) { - return tcrrgb[STRIPRGB(v)]; + return tcrrgb[v]; } +#if 0 void PAL_1x1_32(uae_u32 *src, int pitchs, uae_u32 *trg, int pitcht, int width, int height) { const uae_u32 *tmpsrc; @@ -193,9 +181,9 @@ void PAL_1x1_32(uae_u32 *src, int pitchs, uae_u32 *trg, int pitcht, int width, i trg += pitcht; } } +#endif - -void PAL_1x1_AGA_32(uae_u32 *src, int pitchs, uae_u32 *trg, int pitcht, int width, int height) +void PAL_1x1_32(uae_u32 *src, int pitchs, uae_u32 *trg, int pitcht, int width, int height) { const uae_u32 *tmpsrc; uae_u32 *tmptrg; @@ -294,3 +282,103 @@ void PAL_1x1_AGA_32(uae_u32 *src, int pitchs, uae_u32 *trg, int pitcht, int widt trg += pitcht; } } + +void PAL_1x1_16(uae_u16 *src, int pitchs, uae_u16 *trg, int pitcht, int width, int height) +{ + const uae_u16 *tmpsrc; + uae_u16 *tmptrg; + uae_s32 *lineptr0; + uae_s32 *lineptr1; + uae_s32 *line; + uae_s32 *linepre; + unsigned int x, y, wstart, wfast, wend, wint; + int l, u, v; + int red, grn, blu; + int xt = 0; + int yt = 0; + int xs = 0; + int ys = 0; + + pitchs /= sizeof (*trg); + pitcht /= sizeof (*trg); + + src = src + pitchs * ys + xs - 2; + trg = trg + pitcht * yt + xt; + if (width < 8) { + wstart = width; + wfast = 0; + wend = 0; + } else { + /* alignment: 8 pixels*/ + wstart = (unsigned int)(8 - ((unsigned long)trg & 7)); + wfast = (width - wstart) >> 3; /* fast loop for 8 pixel segments*/ + wend = (width - wstart) & 0x07; /* do not forget the rest*/ + } + wint = width + 5; + lineptr0 = line_yuv_0; + lineptr1 = line_yuv_1; + + tmpsrc = src - pitchs; + line = lineptr0; + for (x = 0; x < wint; x++) { + uae_u32 cl0, cl1, cl2, cl3; + + cl0 = tmpsrc[0]; + cl1 = tmpsrc[xx1]; + cl2 = tmpsrc[xx2]; + cl3 = tmpsrc[xx3]; + line[0] = 0; + line[1] = zcbRGB(cl0) + zcbRGB(cl1) + zcbRGB(cl2) + zcbRGB(cl3); + line[2] = zcrRGB(cl0) + zcrRGB(cl1) + zcrRGB(cl2) + zcrRGB(cl3); + tmpsrc++; + line += 3; + } + + for (y = 0; y < height; y++) { + int scn = (y & 1) ? scanlinelevel : 128; + randomshift = rand() & 15; + randomoffset = rand() & 2047; + + tmpsrc = src; + tmptrg = trg; + + line = lineptr0; + lineptr0 = lineptr1; + lineptr1 = line; + + tmpsrc = src; + line = lineptr0; + for (x = 0; x < wint; x++) { + int r = (randomtable[randomoffset++] >> randomshift) & pal_noise_mask; + uae_u32 cl0, cl1, cl2, cl3; + cl0 = tmpsrc[0]; + cl1 = tmpsrc[xx1]; + cl2 = tmpsrc[xx2]; + cl3 = tmpsrc[xx3]; + line[0] = (zylRGB(cl1) + zyhRGB(cl2) * (scn - r) / 128 + zylRGB(cl3)) / 256; /* 1/4 + 1/2 + 1/4 */ + line[1] = zcbRGB(cl0) + zcbRGB(cl1) + zcbRGB(cl2) + zcbRGB(cl3); + line[2] = zcrRGB(cl0) + zcrRGB(cl1) + zcrRGB(cl2) + zcrRGB(cl3); + tmpsrc++; + line += 3; + } + + line = lineptr0; + linepre = lineptr1; + for (x = 0; x < (wfast << 3) + wend + wstart; x++) { + + l = line[0]; + u = (line[1] + linepre[1]) / 8; + v = (line[2] + linepre[2]) / 8; + line += 3; + linepre += 3; + + red = (v + l) / 256; + blu = (u + l) / 256; + grn = (l * 256 - 50 * u - 130 * v) / (256 * 256); + *tmptrg++ = predc[red] | pgrec[grn] | pbluc[blu]; + } + + src += pitchs; + trg += pitcht; + } +} diff --git a/od-win32/srcrelease.bat b/od-win32/srcrelease.bat index f0598a46..60b24032 100755 --- a/od-win32/srcrelease.bat +++ b/od-win32/srcrelease.bat @@ -17,8 +17,8 @@ del compemu.c del comptbl.h del compstbl.c del cpuemu_0.c -del cpuemu_5.c -del cpuemu_6.c +del cpuemu_11.c +del cpuemu_12.c del linetoscr.c cd od-win32 diff --git a/od-win32/win32.h b/od-win32/win32.h index dc4a6251..99ab4919 100755 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -15,9 +15,9 @@ #define GETBDM(x) (((x) - ((x / 10000) * 10000)) / 100) #define GETBDD(x) ((x) % 100) -#define WINUAEBETA 8 +#define WINUAEBETA 9 #define WINUAEPUBLICBETA 1 -#define WINUAEDATE MAKEBD(2007, 4, 20) +#define WINUAEDATE MAKEBD(2007, 4, 25) //#define WINUAEEXTRA "" #define IHF_WINDOWHIDDEN 6 diff --git a/od-win32/win32_scale2x.c b/od-win32/win32_scale2x.c index 875c7009..277cb525 100755 --- a/od-win32/win32_scale2x.c +++ b/od-win32/win32_scale2x.c @@ -32,7 +32,7 @@ struct uae_filter uaefilters[] = { UAE_FILTER_2XSAI, 0, "2xSaI", "2xsai", 0, 0, UAE_FILTER_MODE_16_16, 0, 0 }, - { UAE_FILTER_PAL, 1, "PAL", "pal", 0, UAE_FILTER_MODE_32_32, 0, 0, 0 }, + { UAE_FILTER_PAL, 1, "PAL", "pal", 0, UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_32_32, 0, 0, 0 }, { 0 } @@ -112,9 +112,14 @@ void S2X_render (void) LPDIRECTDRAWSURFACE7 dds; DDSURFACEDESC2 desc; - sptr = gfxvidinfo.bufmem - - ((dst_width - amiga_width) / 2) * (amiga_depth / 8) - - ((dst_height - amiga_height) / 2) * gfxvidinfo.rowbytes; + sptr = gfxvidinfo.bufmem; + v = (dst_width - amiga_width) / 2; + aw += v; + sptr -= v * (amiga_depth / 8); + v = (dst_height - amiga_height) / 2; + ah += v; + sptr -= v * gfxvidinfo.rowbytes; + endsptr = gfxvidinfo.realbufmem + (amiga_height - 1) * 3 * gfxvidinfo.rowbytes; v = currprefs.gfx_filter ? currprefs.gfx_filter_horiz_offset : 0; @@ -264,13 +269,13 @@ void S2X_render (void) ok = 1; } - } else if (usedfilter->type == UAE_FILTER_PAL) { /* 32/1X */ + } else if (usedfilter->type == UAE_FILTER_PAL) { /* 16/32/1X */ if (amiga_depth == 32 && dst_depth == 32) { - if (currprefs.chipset_mask & CSMASK_AGA) - PAL_1x1_AGA_32((uae_u32*)sptr, gfxvidinfo.rowbytes, (uae_u32*)dptr, pitch, aw, ah); - else - PAL_1x1_32((uae_u32*)sptr, gfxvidinfo.rowbytes, (uae_u32*)dptr, pitch, aw, ah); + PAL_1x1_32((uae_u32*)sptr, gfxvidinfo.rowbytes, (uae_u32*)dptr, pitch, aw, ah); + ok = 1; + } else if (amiga_depth == 16 && dst_depth == 16) { + PAL_1x1_16((uae_u16*)sptr, gfxvidinfo.rowbytes, (uae_u16*)dptr, pitch, aw, ah); ok = 1; } diff --git a/od-win32/win32gfx.c b/od-win32/win32gfx.c index 6e7f3799..6b522570 100755 --- a/od-win32/win32gfx.c +++ b/od-win32/win32gfx.c @@ -1087,9 +1087,19 @@ int check_prefs_changed_gfx (void) c |= currprefs.gfx_filter_filtermode != changed_prefs.gfx_filter_filtermode ? (2|8) : 0; c |= currprefs.gfx_filter_horiz_zoom_mult != changed_prefs.gfx_filter_horiz_zoom_mult ? (1|8) : 0; c |= currprefs.gfx_filter_vert_zoom_mult != changed_prefs.gfx_filter_vert_zoom_mult ? (1|8) : 0; - - c |= currprefs.gfx_lores != changed_prefs.gfx_lores ? 1 : 0; - c |= currprefs.gfx_linedbl != changed_prefs.gfx_linedbl ? 1 : 0; + c |= currprefs.gfx_filter_noise != changed_prefs.gfx_filter_noise ? (1|8) : 0; + c |= currprefs.gfx_filter_blur != changed_prefs.gfx_filter_blur ? (1|8) : 0; + c |= currprefs.gfx_filter_scanlines != changed_prefs.gfx_filter_scanlines ? (1|8) : 0; + c |= currprefs.gfx_filter_scanlinelevel != changed_prefs.gfx_filter_scanlinelevel ? (1|8) : 0; + c |= currprefs.gfx_filter_scanlineratio != changed_prefs.gfx_filter_scanlineratio ? (1|8) : 0; + c |= currprefs.gfx_filter_luminance != changed_prefs.gfx_filter_luminance ? (1|8) : 0; + c |= currprefs.gfx_filter_contrast != changed_prefs.gfx_filter_contrast ? (1|8) : 0; + c |= currprefs.gfx_filter_saturation != changed_prefs.gfx_filter_saturation ? (1|8) : 0; + c |= currprefs.gfx_filter_gamma != changed_prefs.gfx_filter_gamma ? (1|8) : 0; + //c |= currprefs.gfx_filter_ != changed_prefs.gfx_filter_ ? (1|8) : 0; + + c |= currprefs.gfx_lores != changed_prefs.gfx_lores ? 2 : 0; + c |= currprefs.gfx_linedbl != changed_prefs.gfx_linedbl ? 2 : 0; c |= currprefs.gfx_lores_mode != changed_prefs.gfx_lores_mode ? 1 : 0; c |= currprefs.gfx_display != changed_prefs.gfx_display ? (2|4|8) : 0; c |= currprefs.win32_alwaysontop != changed_prefs.win32_alwaysontop ? 1 : 0; @@ -1121,6 +1131,16 @@ int check_prefs_changed_gfx (void) currprefs.gfx_filter_filtermode = changed_prefs.gfx_filter_filtermode; currprefs.gfx_filter_horiz_zoom_mult = changed_prefs.gfx_filter_horiz_zoom_mult; currprefs.gfx_filter_vert_zoom_mult = changed_prefs.gfx_filter_vert_zoom_mult; + currprefs.gfx_filter_noise = changed_prefs.gfx_filter_noise; + currprefs.gfx_filter_blur = changed_prefs.gfx_filter_blur; + currprefs.gfx_filter_scanlines = changed_prefs.gfx_filter_scanlines; + currprefs.gfx_filter_scanlinelevel = changed_prefs.gfx_filter_scanlinelevel; + currprefs.gfx_filter_scanlineratio = changed_prefs.gfx_filter_scanlineratio; + currprefs.gfx_filter_luminance = changed_prefs.gfx_filter_luminance; + currprefs.gfx_filter_contrast = changed_prefs.gfx_filter_contrast; + currprefs.gfx_filter_saturation = changed_prefs.gfx_filter_saturation; + currprefs.gfx_filter_gamma = changed_prefs.gfx_filter_gamma; + //currprefs.gfx_filter_ = changed_prefs.gfx_filter_; currprefs.gfx_lores_mode = changed_prefs.gfx_lores_mode; currprefs.gfx_lores = changed_prefs.gfx_lores; diff --git a/od-win32/winuae_msvc/winuae_msvc.vcproj b/od-win32/winuae_msvc/winuae_msvc.vcproj index c3205ecf..780fa2bc 100755 --- a/od-win32/winuae_msvc/winuae_msvc.vcproj +++ b/od-win32/winuae_msvc/winuae_msvc.vcproj @@ -1,10 +1,11 @@ @@ -95,6 +98,8 @@ SubSystem="2" StackReserveSize="2621440" StackCommitSize="2621440" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" /> - @@ -198,6 +200,8 @@ SubSystem="2" StackReserveSize="2621440" StackCommitSize="2621440" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="17" /> - @@ -263,7 +264,7 @@ OmitFramePointers="true" WholeProgramOptimization="false" AdditionalIncludeDirectories="..\..\include,..\..,..\,..\resources,..\osdep,..\sounddep" - PreprocessorDefinitions="WINVER=0x0500,WIN32,NDEBUG,_WINDOWS,_WIN32_IE=0x0500,UNIX" + PreprocessorDefinitions="WINVER=0x0500;NDEBUG;_WIN32_IE=0x0500" StringPooling="true" ExceptionHandling="0" BasicRuntimeChecks="0" @@ -281,7 +282,7 @@ ProgramDataBaseFileName=".\Release/" WarningLevel="3" SuppressStartupBanner="true" - CompileAs="0" + CompileAs="1" DisableSpecificWarnings="4996" ForcedIncludeFiles="" /> @@ -315,6 +316,8 @@ EnableCOMDATFolding="2" OptimizeForWindows98="0" LinkTimeCodeGeneration="0" + RandomizedBaseAddress="2" + DataExecutionPrevention="2" TargetMachine="1" /> - @@ -433,6 +433,8 @@ EnableCOMDATFolding="2" OptimizeForWindows98="0" LinkTimeCodeGeneration="0" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="17" /> - @@ -494,6 +493,8 @@ /> - @@ -603,6 +601,8 @@ OptimizeReferences="2" EnableCOMDATFolding="2" OptimizeForWindows98="0" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="17" /> - @@ -665,6 +662,8 @@ /> - @@ -779,6 +775,8 @@ EnableCOMDATFolding="2" OptimizeForWindows98="0" LinkTimeCodeGeneration="0" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="17" /> - @@ -884,6 +879,8 @@ SubSystem="2" StackReserveSize="2621440" StackCommitSize="2621440" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" /> - @@ -986,6 +980,8 @@ SubSystem="2" StackReserveSize="2621440" StackCommitSize="2621440" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="17" /> - @@ -1022,6 +1015,7 @@ UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="false" CharacterSet="2" + WholeProgramOptimization="1" > @@ -1104,6 +1098,8 @@ EnableCOMDATFolding="2" OptimizeForWindows98="0" LinkTimeCodeGeneration="1" + RandomizedBaseAddress="2" + DataExecutionPrevention="2" TargetMachine="1" /> - @@ -1222,6 +1215,8 @@ EnableCOMDATFolding="2" OptimizeForWindows98="0" LinkTimeCodeGeneration="0" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="17" /> - diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index 90f8fd32..56c12149 100755 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -1,4 +1,21 @@ +Beta 9: + +- new PAL filter configuration file support (forgot it in b8) +- PAL filter now works both in 16 and 32-bit modes. Internal color + space is now only R5G6B5, even in 32-bit AGA. Makes things simpler + (minus image quality loss) Fix later, not sure.. +- map "UAE Boot ROM" automatically if any "external" expansion is + enabled (uaescsi, uaeserial, bsdsocket etc..) Previously it was + only mapped if filesystem (directory or hdf) was configured. +- IDE non-RDB HDF statefile support added +- filter default centering fixed (I think..) +- minor FPU updates to very rarely used instructions (from aranym) +- "cpu060_revision" config entry added ("read-only", not created when + saving config), sets 68060 revision field in PCR register (current + default is 1) + + Beta 8: - very long CDTV CD reads don't freeze anymore (overflow in CD diff --git a/od-win32/writelog.c b/od-win32/writelog.c index 7544057d..4d9e5a8c 100755 --- a/od-win32/writelog.c +++ b/od-win32/writelog.c @@ -1,4 +1,3 @@ - #include "sysconfig.h" #include "sysdeps.h"