From: Toni Wilen Date: Sun, 12 Feb 2006 13:10:14 +0000 (+0200) Subject: imported winuaesrc1200.zip X-Git-Tag: 2100~289 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=033facf15dc0775c89d7d954bcdacfae38b31a4c;p=francis%2Fwinuae.git imported winuaesrc1200.zip --- diff --git a/cfgfile.c b/cfgfile.c index a6a4c798..8b869b92 100755 --- a/cfgfile.c +++ b/cfgfile.c @@ -306,6 +306,7 @@ static void save_options (struct zfile *f, struct uae_prefs *p, int type) cfgfile_write (f, "comp_flushmode=%s\n", flushmode[p->comp_hardflush]); cfgfile_write (f, "compforcesettings=%s\n", p->compforcesettings ? "true" : "false"); cfgfile_write (f, "compfpu=%s\n", p->compfpu ? "true" : "false"); + cfgfile_write (f, "fpu_strict=%s\n", p->fpu_strict ? "true" : "false"); cfgfile_write (f, "comp_midopt=%s\n", p->comp_midopt ? "true" : "false"); cfgfile_write (f, "comp_lowopt=%s\n", p->comp_lowopt ? "true" : "false"); cfgfile_write (f, "avoid_cmov=%s\n", p->avoid_cmov ? "true" : "false" ); @@ -977,6 +978,7 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, char *option, char *valu || cfgfile_yesno (option, value, "comp_oldsegv", &p->comp_oldsegv) || cfgfile_yesno (option, value, "compforcesettings", &p->compforcesettings) || cfgfile_yesno (option, value, "compfpu", &p->compfpu) + || cfgfile_yesno (option, value, "fpu_strict", &p->fpu_strict) || cfgfile_yesno (option, value, "comp_midopt", &p->comp_midopt) || cfgfile_yesno (option, value, "comp_lowopt", &p->comp_lowopt) || cfgfile_yesno (option, value, "scsi", &p->scsi)) @@ -2337,6 +2339,7 @@ void default_prefs (struct uae_prefs *p, int type) p->comp_constjump = 1; p->comp_oldsegv = 0; p->compfpu = 1; + p->fpu_strict = 0; p->compforcesettings = 0; p->cachesize = 0; p->avoid_cmov = 0; diff --git a/cia.c b/cia.c index 3d1b5871..c206cf1e 100755 --- a/cia.c +++ b/cia.c @@ -774,14 +774,12 @@ static void WriteCIAA (uae_u16 addr,uae_u8 val) CIA_update (); ciaasdr = val; if (ciaacra & 0x40) { - if (!kback && (ciaacra & 0x41) == 0x41) - ciaasdr_cnt = 8 * 2; kback = 1; } else { ciaasdr_cnt = 0; - if ((ciaacra & 0x41) == 0x41) - ciaasdr_cnt = 8 * 2; } + if ((ciaacra & 0x41) == 0x41 && ciaasdr_cnt == 0) + ciaasdr_cnt = 8 * 2; CIA_calctimers (); break; case 13: @@ -915,10 +913,10 @@ static void WriteCIAB (uae_u16 addr,uae_u8 val) case 12: CIA_update (); ciabsdr = val; - if ((ciabcra & 0x41) == 0x41) - ciabsdr_cnt = 8 * 2; if ((ciabcra & 0x40) == 0) ciabsdr_cnt = 0; + if ((ciabcra & 0x41) == 0x41 && ciabsdr_cnt == 0) + ciabsdr_cnt = 8 * 2; CIA_calctimers (); break; case 13: diff --git a/compemu_fpp.c b/compemu_fpp.c index 61fc6c24..195905e8 100755 --- a/compemu_fpp.c +++ b/compemu_fpp.c @@ -1175,12 +1175,13 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) /* because both operands should be SINGLE precision, too */ case 0x60: /* FSDIV */ fdiv_rr(dreg,sreg); + if (!currprefs.fpu_strict) /* faster, but less strict rounding */ + break; #if USE_X86_FPUCW if ((regs.fpcr & 0xC0) == 0x40) /* if SINGLE precision */ break; #endif - fmovs_mr((uae_u32)temp_fp,dreg); - fmovs_rm(dreg,(uae_u32)temp_fp); + fcuts_r(dreg); break; case 0x25: /* FREM */ frem1_rr(dreg,sreg); @@ -1192,12 +1193,13 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) /* because both operands should be SINGLE precision, too */ case 0x63: /* FSMUL */ fmul_rr(dreg,sreg); + if (!currprefs.fpu_strict) /* faster, but less strict rounding */ + break; #if USE_X86_FPUCW if ((regs.fpcr & 0xC0) == 0x40) /* if SINGLE precision */ break; #endif - fmovs_mr((uae_u32)temp_fp,dreg); - fmovs_rm(dreg,(uae_u32)temp_fp); + fcuts_r(dreg); break; case 0x28: /* FSUB */ fsub_rr(dreg,sreg); @@ -1223,7 +1225,7 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) fmov_rr(FP_RESULT,sreg); return; case 0x40: /* FSMOVE */ - if (prec == 1) { + if (prec == 1 || !currprefs.fpu_strict) { if (sreg != dreg) /* no */ fmov_rr(dreg,sreg); } else { @@ -1233,15 +1235,16 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) break; case 0x41: /* FSSQRT */ fsqrt_rr(dreg,sreg); + if (!currprefs.fpu_strict) /* faster, but less strict rounding */ + break; #if USE_X86_FPUCW if ((regs.fpcr & 0xC0) == 0x40) /* if SINGLE precision */ break; #endif - fmovs_mr((uae_u32)temp_fp,dreg); - fmovs_rm(dreg,(uae_u32)temp_fp); + fcuts_r(dreg); break; case 0x44: /* FDMOVE */ - if (prec) { + if (prec || !currprefs.fpu_strict) { if (sreg != dreg) /* no */ fmov_rr(dreg,sreg); } else { @@ -1250,6 +1253,10 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) } break; case 0x45: /* FDSQRT */ + if (!currprefs.fpu_strict) { /* faster, but less strict rounding */ + fsqrt_rr(dreg,sreg); + break; + } #if USE_X86_FPUCW if (regs.fpcr & 0xC0) { /* if we don't have EXTENDED precision */ if ((regs.fpcr & 0xC0) == 0x80) /* if we have DOUBLE */ @@ -1266,47 +1273,43 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) } #endif /* in case of EXTENDED precision, just reduce the result to DOUBLE */ fsqrt_rr(dreg,sreg); - fmov_mr((uae_u32)temp_fp,dreg); - fmov_rm(dreg,(uae_u32)temp_fp); + fcut_r(dreg); break; case 0x58: /* FSABS */ fabs_rr(dreg,sreg); - if (prec != 1) { - fmovs_mr((uae_u32)temp_fp,dreg); - fmovs_rm(dreg,(uae_u32)temp_fp); - } + if (prec != 1 && currprefs.fpu_strict) + fcuts_r(dreg); break; case 0x5a: /* FSNEG */ fneg_rr(dreg,sreg); - if (prec != 1) { - fmovs_mr((uae_u32)temp_fp,dreg); - fmovs_rm(dreg,(uae_u32)temp_fp); - } + if (prec != 1 && currprefs.fpu_strict) + fcuts_r(dreg); break; case 0x5c: /* FDABS */ fabs_rr(dreg,sreg); - if (!prec) { - fmov_mr((uae_u32)temp_fp,dreg); - fmov_rm(dreg,(uae_u32)temp_fp); - } + if (!prec && currprefs.fpu_strict) + fcut_r(dreg); break; case 0x5e: /* FDNEG */ fneg_rr(dreg,sreg); - if (!prec) { - fmov_mr((uae_u32)temp_fp,dreg); - fmov_rm(dreg,(uae_u32)temp_fp); - } + if (!prec && currprefs.fpu_strict) + fcut_r(dreg); break; case 0x62: /* FSADD */ fadd_rr(dreg,sreg); + if (!currprefs.fpu_strict) /* faster, but less strict rounding */ + break; #if USE_X86_FPUCW if ((regs.fpcr & 0xC0) == 0x40) /* if SINGLE precision */ break; #endif - fmovs_mr((uae_u32)temp_fp,dreg); - fmovs_rm(dreg,(uae_u32)temp_fp); + fcuts_r(dreg); break; case 0x64: /* FDDIV */ + if (!currprefs.fpu_strict) { /* faster, but less strict rounding */ + fdiv_rr(dreg,sreg); + break; + } #if USE_X86_FPUCW if (regs.fpcr & 0xC0) { /* if we don't have EXTENDED precision */ if ((regs.fpcr & 0xC0) == 0x80) /* if we have DOUBLE */ @@ -1323,10 +1326,13 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) } #endif /* in case of EXTENDED precision, just reduce the result to DOUBLE */ fdiv_rr(dreg,sreg); - fmov_mr((uae_u32)temp_fp,dreg); - fmov_rm(dreg,(uae_u32)temp_fp); + fcut_r(dreg); break; case 0x66: /* FDADD */ + if (!currprefs.fpu_strict) { /* faster, but less strict rounding */ + fadd_rr(dreg,sreg); + break; + } #if USE_X86_FPUCW if (regs.fpcr & 0xC0) { /* if we don't have EXTENDED precision */ if ((regs.fpcr & 0xC0) == 0x80) /* if we have DOUBLE */ @@ -1343,10 +1349,13 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) } #endif /* in case of EXTENDED precision, just reduce the result to DOUBLE */ fadd_rr(dreg,sreg); - fmov_mr((uae_u32)temp_fp,dreg); - fmov_rm(dreg,(uae_u32)temp_fp); + fcut_r(dreg); break; case 0x67: /* FDMUL */ + if (!currprefs.fpu_strict) { /* faster, but less strict rounding */ + fmul_rr(dreg,sreg); + break; + } #if USE_X86_FPUCW if (regs.fpcr & 0xC0) { /* if we don't have EXTENDED precision */ if ((regs.fpcr & 0xC0) == 0x80) /* if we have DOUBLE */ @@ -1363,19 +1372,23 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) } #endif /* in case of EXTENDED precision, just reduce the result to DOUBLE */ fmul_rr(dreg,sreg); - fmov_mr((uae_u32)temp_fp,dreg); - fmov_rm(dreg,(uae_u32)temp_fp); + fcut_r(dreg); break; case 0x68: /* FSSUB */ fsub_rr(dreg,sreg); + if (!currprefs.fpu_strict) /* faster, but less strict rounding */ + break; #if USE_X86_FPUCW if ((regs.fpcr & 0xC0) == 0x40) /* if SINGLE precision */ break; #endif - fmovs_mr((uae_u32)temp_fp,dreg); - fmovs_rm(dreg,(uae_u32)temp_fp); + fcuts_r(dreg); break; case 0x6c: /* FDSUB */ + if (!currprefs.fpu_strict) { /* faster, but less strict rounding */ + fsub_rr(dreg,sreg); + break; + } #if USE_X86_FPUCW if (regs.fpcr & 0xC0) { /* if we don't have EXTENDED precision */ if ((regs.fpcr & 0xC0) == 0x80) /* if we have DOUBLE */ @@ -1392,8 +1405,7 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) } #endif /* in case of EXTENDED precision, just reduce the result to DOUBLE */ fsub_rr(dreg,sreg); - fmov_mr((uae_u32)temp_fp,dreg); - fmov_rm(dreg,(uae_u32)temp_fp); + fcut_r(dreg); break; default: FAIL(1); diff --git a/compemu_raw_x86.c b/compemu_raw_x86.c index 45adcf95..68c46ab0 100755 --- a/compemu_raw_x86.c +++ b/compemu_raw_x86.c @@ -2727,6 +2727,42 @@ LOWFUNC(NONE,WRITE,2,raw_fmovs_mr,(MEMW m, FR r)) } LENDFUNC(NONE,WRITE,2,raw_fmovs_mr,(MEMW m, FR r)) +LOWFUNC(NONE,NONE,1,raw_fcuts_r,(FRW r)) +{ + make_tos(r); /* TOS = r */ + emit_byte(0x83); + emit_byte(0xc4); + emit_byte(0xfc); /* add -4 to esp */ + emit_byte(0xd9); + emit_byte(0x1c); + emit_byte(0x24); /* fstp store r as SINGLE to [esp] and pop */ + emit_byte(0xd9); + emit_byte(0x04); + emit_byte(0x24); /* fld load r as SINGLE from [esp] */ + emit_byte(0x83); + emit_byte(0xc4); + emit_byte(0x04); /* add +4 to esp */ +} +LENDFUNC(NONE,NONE,1,raw_fcuts_r,(FRW r)) + +LOWFUNC(NONE,NONE,1,raw_fcut_r,(FRW r)) +{ + make_tos(r); /* TOS = r */ + emit_byte(0x83); + emit_byte(0xc4); + emit_byte(0xf8); /* add -8 to esp */ + emit_byte(0xdd); + emit_byte(0x1c); + emit_byte(0x24); /* fstp store r as DOUBLE to [esp] and pop */ + emit_byte(0xdd); + emit_byte(0x04); + emit_byte(0x24); /* fld load r as DOUBLE from [esp] */ + 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); diff --git a/compemu_support.c b/compemu_support.c index cb9918f9..e6b0225f 100755 --- a/compemu_support.c +++ b/compemu_support.c @@ -3936,6 +3936,22 @@ MIDFUNC(2,fmovs_mr,(MEMW m, FR r)) } MENDFUNC(2,fmovs_mr,(MEMW m, FR r)) +MIDFUNC(1,fcuts_r,(FRW r)) +{ + r=f_rmw(r); + raw_fcuts_r(r); + f_unlock(r); +} +MENDFUNC(1,fcuts_r,(FRW r)) + +MIDFUNC(1,fcut_r,(FRW r)) +{ + r=f_rmw(r); + raw_fcut_r(r); + f_unlock(r); +} +MENDFUNC(1,fcut_r,(FRW r)) + MIDFUNC(2,fmovl_ri,(FW r, IMMS i)) { r=f_writereg(r); diff --git a/custom.c b/custom.c index 2772edfe..cab5a5d3 100755 --- a/custom.c +++ b/custom.c @@ -2749,7 +2749,7 @@ static void BPLxPTL (int hpos, uae_u16 v, int num) decide_fetch (hpos); /* fix for "bitplane dma fetch at the same time while updating BPLxPTL" */ /* fixes "3v Demo" by Cave and "New Year Demo" by Phoenix */ - if (is_bitplane_dma(hpos - 1) == num + 1) + if (is_bitplane_dma(hpos - 1) == num + 1 && num > 0) delta = 2 << fetchmode; bplpt[num] = (bplpt[num] & ~0xffff) | ((v + delta) & 0xfffe); //write_log("%d:%d:BPL%dPTL %08.8X\n", hpos, vpos, num, v); diff --git a/enforcer.c b/enforcer.c index 918b311b..3e06068e 100755 --- a/enforcer.c +++ b/enforcer.c @@ -39,7 +39,8 @@ extern uae_u32 natmem_offset; int flashscreen = 0; -static int enforcer_installed = 0,enforcermode = 0; +static int enforcer_installed = 0; +int enforcermode = 0; static int enforcer_hit = 0; /* set to 1 if displaying the hit */ #define ENFORCER_BUF_SIZE 4096 @@ -376,7 +377,7 @@ static void enforcer_display_hit(const char *addressmode, uae_u32 pc, uaecptr ad uae_u32 REGPARAM2 chipmem_lget2 (uaecptr addr) { - uae_u32 *m; + uae_u32 *m; addr -= chipmem_start & chipmem_mask; addr &= chipmem_mask; @@ -385,7 +386,7 @@ uae_u32 REGPARAM2 chipmem_lget2 (uaecptr addr) if (ISILLEGAL(addr)) { enforcer_display_hit("LONG READ from",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); - if (enforcermode==1) + if (enforcermode & 1) { set_special (SPCFLAG_TRAP); } @@ -404,7 +405,7 @@ uae_u32 REGPARAM2 chipmem_wget2(uaecptr addr) if (ISILLEGAL(addr)) { enforcer_display_hit("WORD READ from",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); - if (enforcermode==1) + if (enforcermode & 1) { set_special (SPCFLAG_TRAP); } @@ -420,7 +421,7 @@ uae_u32 REGPARAM2 chipmem_bget2 (uaecptr addr) if (ISILLEGAL(addr)) { enforcer_display_hit("BYTE READ from",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); - if (enforcermode==1) + if (enforcermode & 1) { set_special (SPCFLAG_TRAP); } @@ -440,7 +441,7 @@ void REGPARAM2 chipmem_lput2 (uaecptr addr, uae_u32 l) if (ISILLEGAL(addr)) { enforcer_display_hit("LONG WRITE to",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); - if (enforcermode==1) + if (enforcermode & 1) { if ( addr!=0x100 ) set_special (SPCFLAG_TRAP); } @@ -459,7 +460,7 @@ void REGPARAM2 chipmem_wput2 (uaecptr addr, uae_u32 w) if (ISILLEGAL(addr)) { enforcer_display_hit("WORD WRITE to",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); - if (enforcermode==1) + if (enforcermode & 1) { set_special (SPCFLAG_TRAP); } @@ -475,7 +476,7 @@ void REGPARAM2 chipmem_bput2 (uaecptr addr, uae_u32 b) if (ISILLEGAL(addr)) { enforcer_display_hit("BYTE WRITE to",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); - if (enforcermode==1) + if (enforcermode & 1) { set_special (SPCFLAG_TRAP); } @@ -501,7 +502,7 @@ uae_u32 REGPARAM2 dummy_lget2 (uaecptr addr) { special_mem_r; enforcer_display_hit("LONG READ from",(uae_u32)(regs.pc_p - NMEM_OFFSET), addr); - if (enforcermode==1) + if (enforcermode & 1) { set_special (SPCFLAG_TRAP); return 0; @@ -530,7 +531,7 @@ uae_u32 REGPARAM2 dummy_wget2 (uaecptr addr) } #endif enforcer_display_hit("WORD READ from",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); - if (enforcermode==1) + if (enforcermode & 1) { set_special (SPCFLAG_TRAP); return 0; @@ -542,7 +543,7 @@ uae_u32 REGPARAM2 dummy_bget2 (uaecptr addr) { special_mem_r; enforcer_display_hit("BYTE READ from",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); - if (enforcermode==1) + if (enforcermode & 1) { set_special (SPCFLAG_TRAP); return 0; @@ -554,7 +555,7 @@ void REGPARAM2 dummy_lput2 (uaecptr addr, uae_u32 l) { special_mem_w; enforcer_display_hit("LONG WRITE to",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); - if (enforcermode==1) + if (enforcermode & 1) { set_special (SPCFLAG_TRAP); return; @@ -565,7 +566,7 @@ void REGPARAM2 dummy_wput2 (uaecptr addr, uae_u32 w) { special_mem_w; enforcer_display_hit("WORD WRITE to",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); - if (enforcermode==1) + if (enforcermode & 1) { set_special (SPCFLAG_TRAP); return; @@ -576,7 +577,7 @@ void REGPARAM2 dummy_bput2 (uaecptr addr, uae_u32 b) { special_mem_w; enforcer_display_hit("BYTE WRITE to",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); - if (enforcermode==1) + if (enforcermode & 1) { set_special (SPCFLAG_TRAP); return; diff --git a/include/compemu.h b/include/compemu.h index 0157dc68..6f2348c0 100755 --- a/include/compemu.h +++ b/include/compemu.h @@ -412,6 +412,8 @@ DECLARE(fmovi_rm(FW r, MEMR m)); DECLARE(fmovi_mr(MEMW m, FR r)); 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)); diff --git a/include/enforcer.h b/include/enforcer.h index 60bd5117..04723a7c 100755 --- a/include/enforcer.h +++ b/include/enforcer.h @@ -4,4 +4,6 @@ int enforcer_enable(int); int enforcer_disable(void); +extern int enforcermode; + #endif \ No newline at end of file diff --git a/include/options.h b/include/options.h index e09870ca..8c26d3b1 100755 --- a/include/options.h +++ b/include/options.h @@ -99,6 +99,7 @@ struct uae_prefs { int compfpu; int comp_midopt; int comp_lowopt; + int fpu_strict; int comp_hardflush; int comp_constjump; diff --git a/inputdevice.c b/inputdevice.c index 3635f462..48a886bb 100755 --- a/inputdevice.c +++ b/inputdevice.c @@ -44,6 +44,7 @@ #include "arcadia.h" int inputdevice_logging = 0; +static int potgo_logging = 0; #define DIR_LEFT 1 #define DIR_RIGHT 2 @@ -893,7 +894,8 @@ void POTGO (uae_u16 v) { int i; - //write_log ("W:%d: %04.4X %p\n", vpos, v, m68k_getpc()); + if (potgo_logging) + write_log ("W:%d: %04.4X %p\n", vpos, v, m68k_getpc()); #ifdef DONGLE_DEBUG if (notinrom ()) write_log ("POTGO %04.4X %s\n", v, debuginfo(0)); @@ -929,7 +931,8 @@ uae_u16 POTGOR (void) if (notinrom ()) write_log ("POTGOR %04.4X %s\n", v, debuginfo(0)); #endif - //write_log("R:%d:%04.4X %d %p\n", vpos, v, cd32_shifter[1], m68k_getpc()); + if (potgo_logging) + write_log("R:%d:%04.4X %d %p\n", vpos, v, cd32_shifter[1], m68k_getpc()); return v; } diff --git a/memory.c b/memory.c index 40e89c0f..5abf21ce 100755 --- a/memory.c +++ b/memory.c @@ -308,6 +308,7 @@ uae_u8 *load_keyfile (struct uae_prefs *p, char *path, int *size) } } } + keysize = 0; if (f) { write_log("ROM.key loaded '%s'\n", tmp); zfile_fseek (f, 0, SEEK_END); diff --git a/od-win32/direct3d.c b/od-win32/direct3d.c index 4e00e196..344e3a59 100755 --- a/od-win32/direct3d.c +++ b/od-win32/direct3d.c @@ -422,10 +422,44 @@ static void BlitRect(LPDIRECT3DDEVICE9 dev, LPDIRECT3DTEXTURE9 src, write_log ("IDirect3DDevice9_DrawPrimitiveUP failed: %s\n", D3D_ErrorString (hr)); } +/* + window_ = display window size + tin_ = internal window size + twidth/theight = texture size +*/ +#if 0 static void calc (float *xp, float *yp, float *sxp, float *syp) { float x, y, sx, sy, tx, ty; - double mx, my, fx, fy; + double mx, my, fx, fy, mmx, mmy; + + mmx = 1; + mmy = 1;//2.0 * window_h / tin_h; + + fx = tin_w / 2; + fy = tin_h / 2; + + fx = (twidth * window_w / tin_w) / 2; + fy = (theight * window_h / tin_h) / 2; + + tx = ((currprefs.gfx_filter_horiz_zoom_mult + currprefs.gfx_filter_horiz_zoom / 4) / 1000.0); + ty = ((currprefs.gfx_filter_vert_zoom_mult + currprefs.gfx_filter_vert_zoom / 4) / 1000.0); + + *sxp = (fx + fx / tx) * mmx; + *syp = (fy + fy / ty) * mmy; + *xp = (fx - fx / tx) * mmx; + *yp = (fy - fy / ty) * mmy; + + mx = (currprefs.gfx_filter_horiz_offset / 1000.0) * fx; + my = (currprefs.gfx_filter_vert_offset / 1000.0) * fy; + + *xp += mx; + *sxp += mx; + *yp += my; + *syp += my; + + return; + fx = (twidth * window_w / tin_w) / 2; fy = (theight * window_h / tin_h) / 2; @@ -454,6 +488,36 @@ static void calc (float *xp, float *yp, float *sxp, float *syp) *xp = x; *yp = y; *sxp = sx; *syp = sy; } +#endif +#if 1 +static void calc (float *xp, float *yp, float *sxp, float *syp) +{ + int xm, ym; + int fx, fy; + float x, y, sx, sy; + + xm = currprefs.gfx_lores ? 2 : 1; + ym = currprefs.gfx_linedbl ? 1 : 2; + if (window_w >= 1024) + xm *= 2; + else if (window_w < 500) + xm /= 2; + if (window_h >= 960) + ym *= 2; + else if (window_h < 350) + ym /= 2; + fx = (tin_w * xm - window_w) / 2; + fy = (tin_h * ym - window_h) / 2; + x = (float)(window_w * currprefs.gfx_filter_horiz_offset / 1000.0); + y = (float)(window_h * currprefs.gfx_filter_vert_offset / 1000.0); + sx = x + (float)(twidth * window_w / tin_w) * ((currprefs.gfx_filter_horiz_zoom + 1000) / 1000.0); + sy = y + (float)(theight * window_h / tin_h) * ((currprefs.gfx_filter_vert_zoom + 1000) / 1000.0); + x -= fx; y -= fy; + sx += 2 * fx; sy += 2 * fy; + *xp = x; *yp = y; + *sxp = sx; *syp = sy; +} +#endif void D3D_unlocktexture (void) { diff --git a/od-win32/fsdb_win32.c b/od-win32/fsdb_win32.c index f6021eca..7c7fb0fd 100755 --- a/od-win32/fsdb_win32.c +++ b/od-win32/fsdb_win32.c @@ -451,7 +451,10 @@ int my_mkdir (const char *name) static int recycle (const char *name) { if (currprefs.win32_norecyclebin) { - return DeleteFile(name) ? 0 : -1; + DWORD dirattr = GetFileAttributes (name); + if (dirattr != INVALID_FILE_ATTRIBUTES && (dirattr & FILE_ATTRIBUTE_DIRECTORY)) + return RemoveDirectory (name) ? 0 : -1; + return DeleteFile(name) ? 0 : -1; } else { SHFILEOPSTRUCT fos; /* name must be terminated by \0\0 */ diff --git a/od-win32/keyboard_win32.c b/od-win32/keyboard_win32.c index d6030058..61a290c5 100755 --- a/od-win32/keyboard_win32.c +++ b/od-win32/keyboard_win32.c @@ -162,7 +162,7 @@ static struct uae_input_device_kbr_default keytrans[] = { { DIK_HOME, INPUTEVENT_KEY_70 }, { DIK_END, INPUTEVENT_KEY_71 }, - { DIK_SYSRQ, INPUTEVENT_KEY_6E }, +// { DIK_SYSRQ, INPUTEVENT_KEY_6E }, // { DIK_F12, INPUTEVENT_KEY_6F }, { DIK_INSERT, INPUTEVENT_KEY_47 }, { DIK_PRIOR, INPUTEVENT_KEY_48 }, diff --git a/od-win32/opengl.c b/od-win32/opengl.c index 21f528e3..03a6ba68 100755 --- a/od-win32/opengl.c +++ b/od-win32/opengl.c @@ -460,8 +460,12 @@ void OGL_resize (int width, int height) static void OGL_dorender (int newtex) { uae_u8 *data = gfxvidinfo.bufmem; - float x1, y1, x2, y2, tx, ty; + float x1, y1, x2, y2; + double fx, fy, xm, ym; + +#if 0 double mx, my, fx, fy, fx2, fy2, xm, ym; + float tx, ty; xm = currprefs.gfx_lores ? 2 : 1; ym = currprefs.gfx_linedbl ? 2 : 1; @@ -484,6 +488,30 @@ static void OGL_dorender (int newtex) x2 += tx + mx; y2 += ty + my; +#else + + xm = currprefs.gfx_lores ? 2 : 1; + ym = currprefs.gfx_linedbl ? 1 : 2; + if (w_width >= 1024) + xm *= 2; + else if (w_width < 500) + xm /= 2; + if (w_height >= 960) + ym *= 2; + else if (w_height < 350) + ym /= 2; + fx = (t_width * xm - w_width) / 2; + fy = (t_height * ym - w_height) / 2; + + x1 = (float)(w_width * currprefs.gfx_filter_horiz_offset / 1000.0); + y1 = (float)(w_height * currprefs.gfx_filter_vert_offset / 1000.0); + x2 = x1 + (float)((required_texture_size * w_width / t_width) * (currprefs.gfx_filter_horiz_zoom + 1000) / 1000.0); + y2 = y1 + (float)((required_texture_size * w_height / t_height) * (currprefs.gfx_filter_vert_zoom + 1000)/ 1000.0); + x1 -= fx; y1 -= fy; + x2 += 2 * fx; y2 += 2 * fy; + +#endif + #ifdef FSAA glEnable (GL_MULTISAMPLE_ARB); #endif diff --git a/od-win32/resources/winuae.rc b/od-win32/resources/winuae.rc index 15800e26..3a6e1da3 100755 --- a/od-win32/resources/winuae.rc +++ b/od-win32/resources/winuae.rc @@ -920,7 +920,7 @@ BEGIN IDS_DISK "Disk swapper" IDS_DISPLAY "Display" IDS_HARDDISK "Hard drives" - IDS_FLOPPY "Disk drives" + IDS_FLOPPY "Floppy drives" IDS_ABOUT "About" IDS_LOADSAVE "Configurations" IDS_AVIOUTPUT "Output" diff --git a/od-win32/serial_win32.c b/od-win32/serial_win32.c index 94868205..07bbfd86 100755 --- a/od-win32/serial_win32.c +++ b/od-win32/serial_win32.c @@ -233,6 +233,15 @@ void SERDAT (uae_u16 w) } #endif + if (serper == 372) { + extern int enforcermode; + if (enforcermode & 2) { + write_log ("%c", dochar (w)); + if (w == 266) + write_log("\n"); + } + } + data_in_serdat = 1; if (!data_in_sershift) checksend (1); diff --git a/od-win32/win32.c b/od-win32/win32.c index 8f4890c6..6d33221b 100755 --- a/od-win32/win32.c +++ b/od-win32/win32.c @@ -1488,11 +1488,27 @@ void toggle_mousegrab (void) { } -void logging_init( void ) +void logging_open(int bootlog, int append) +{ + char debugfilename[MAX_DPATH]; + + debugfilename[0] = 0; +#ifndef SINGLEFILE + if (currprefs.win32_logfile) + sprintf (debugfilename, "%swinuaelog.txt", start_path_data); + if (bootlog) + sprintf (debugfilename, "%swinuaebootlog.txt", start_path_data); + if (debugfilename[0]) { + if (!debugfile) + debugfile = fopen (debugfilename, append ? "a" : "wt"); + } +#endif +} + +void logging_init(void) { static int started; static int first; - char debugfilename[MAX_DPATH]; if (first > 1) { write_log ("** RESTART **\n"); @@ -1503,17 +1519,7 @@ void logging_init( void ) fclose (debugfile); debugfile = 0; } -#ifndef SINGLEFILE - if (currprefs.win32_logfile) { - sprintf (debugfilename, "%swinuaelog.txt", start_path_data); - if (!debugfile) - debugfile = fopen (debugfilename, "wt"); - } else if (!first) { - sprintf (debugfilename, "%swinuaebootlog.txt", start_path_data); - if (!debugfile) - debugfile = fopen (debugfilename, "wt"); - } -#endif + logging_open(first ? 0 : 1, 0); first++; write_log ("%s (%s %d.%d %s%s%s)", VersionStr, os_winnt ? "NT" : "W9X/ME", osVersion.dwMajorVersion, osVersion.dwMinorVersion, osVersion.szCSDVersion, diff --git a/od-win32/win32.h b/od-win32/win32.h index 5bd2e591..44de4e9c 100755 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -21,8 +21,8 @@ extern int manual_painting_needed; extern int manual_palette_refresh_needed; extern int mouseactive, focus; extern int ignore_messages_all; -#define WINUAEBETA 1 -#define WINUAEBETASTR " Beta 6" +#define WINUAEBETA 0 +#define WINUAEBETASTR " " extern char start_path_exe[MAX_DPATH]; extern char start_path_data[MAX_DPATH]; @@ -110,4 +110,7 @@ struct winuae_lang extern struct winuae_lang langs[]; extern HMODULE language_load(WORD language); +extern void logging_open(int,int); +extern void logging_cleanup(void); + #endif \ No newline at end of file diff --git a/od-win32/win32gfx.c b/od-win32/win32gfx.c index 473ac666..9594237b 100755 --- a/od-win32/win32gfx.c +++ b/od-win32/win32gfx.c @@ -1096,6 +1096,18 @@ int check_prefs_changed_gfx (void) return 1; } + if (currprefs.win32_norecyclebin != changed_prefs.win32_norecyclebin) { + currprefs.win32_norecyclebin = changed_prefs.win32_norecyclebin; + } + + if (currprefs.win32_logfile != changed_prefs.win32_logfile) { + currprefs.win32_logfile = changed_prefs.win32_logfile; + if (currprefs.win32_logfile) + logging_open(0, 1); + else + logging_cleanup(); + } + if (currprefs.leds_on_screen != changed_prefs.leds_on_screen || currprefs.keyboard_leds[0] != changed_prefs.keyboard_leds[0] || currprefs.keyboard_leds[1] != changed_prefs.keyboard_leds[1] || diff --git a/od-win32/win32gui.c b/od-win32/win32gui.c index fa675a99..e771e779 100755 --- a/od-win32/win32gui.c +++ b/od-win32/win32gui.c @@ -4322,8 +4322,6 @@ static void enable_for_miscdlg (HWND hDlg) EnableWindow (GetDlgItem (hDlg, IDC_CTRLF11), TRUE); EnableWindow (GetDlgItem (hDlg, IDC_SOCKETS), FALSE); EnableWindow (GetDlgItem (hDlg, IDC_SHOWGUI), FALSE); - EnableWindow (GetDlgItem (hDlg, IDC_CREATELOGFILE), FALSE); - EnableWindow (GetDlgItem (hDlg, IDC_ILLEGAL), FALSE); EnableWindow (GetDlgItem (hDlg, IDC_NOSPEED), TRUE); EnableWindow (GetDlgItem (hDlg, IDC_NOSPEEDPAUSE), TRUE); EnableWindow (GetDlgItem (hDlg, IDC_NOSOUND), TRUE); @@ -4345,10 +4343,6 @@ static void enable_for_miscdlg (HWND hDlg) EnableWindow (GetDlgItem(hDlg, IDC_SCSIDEVICE), FALSE); EnableWindow (GetDlgItem(hDlg, IDC_SCSIMODE), TRUE); #endif - if (workprefs.win32_logfile) - EnableWindow (GetDlgItem (hDlg, IDC_ILLEGAL), TRUE); - else - EnableWindow (GetDlgItem (hDlg, IDC_ILLEGAL), FALSE); EnableWindow (GetDlgItem (hDlg, IDC_DOSAVESTATE), FALSE); EnableWindow (GetDlgItem (hDlg, IDC_STATE_RATE), workprefs.statecapture ? TRUE : FALSE); EnableWindow (GetDlgItem (hDlg, IDC_STATE_BUFFERSIZE), workprefs.statecapture ? TRUE : FALSE); @@ -4594,7 +4588,7 @@ static INT_PTR MiscDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) misc_getpri (hDlg, IDC_MINIMIZED_PRIORITY, &workprefs.win32_iconified_priority); } - switch( wParam ) + switch(wParam) { case IDC_DOSAVESTATE: if (DiskSelection(hDlg, wParam, 9, &workprefs, 0)) @@ -4628,7 +4622,7 @@ static INT_PTR MiscDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) break; case IDC_CREATELOGFILE: workprefs.win32_logfile = IsDlgButtonChecked (hDlg, IDC_CREATELOGFILE); - enable_for_miscdlg( hDlg ); + enable_for_miscdlg(hDlg); break; case IDC_INACTIVE_NOSOUND: if (!IsDlgButtonChecked (hDlg, IDC_INACTIVE_NOSOUND)) @@ -7589,8 +7583,8 @@ static void enable_for_hw3ddlg (HWND hDlg) CheckDlgButton( hDlg, IDC_FILTERENABLE, v ); EnableWindow (GetDlgItem (hDlg, IDC_FILTERHZ), v); EnableWindow (GetDlgItem (hDlg, IDC_FILTERVZ), v); - EnableWindow (GetDlgItem (hDlg, IDC_FILTERHZMULT), v); - EnableWindow (GetDlgItem (hDlg, IDC_FILTERVZMULT), v); + EnableWindow (GetDlgItem (hDlg, IDC_FILTERHZMULT), vv && !vv2); + EnableWindow (GetDlgItem (hDlg, IDC_FILTERVZMULT), vv && !vv2); EnableWindow (GetDlgItem (hDlg, IDC_FILTERHO), v); EnableWindow (GetDlgItem (hDlg, IDC_FILTERVO), v); EnableWindow (GetDlgItem (hDlg, IDC_FILTERSLR), vv2);