* Custom chip emulation
*
* (c) 1995 Bernd Schmidt, Alessandro Bissacco
- * (c) 2002 - 2003 Toni Wilen
+ * (c) 2002 - 2005 Toni Wilen
*/
//#define BLITTER_DEBUG
static const char *flushmode[] = { "soft", "hard", 0 };
static const char *kbleds[] = { "none", "POWER", "DF0", "DF1", "DF2", "DF3", "HD", "CD", 0 };
static const char *soundfiltermode[] = { "off", "emulated", "on", 0 };
+static const char *loresmode[] = { "normal", "filtered", 0 };
#ifdef GFXFILTER
static const char *filtermode1[] = { "no_16", "bilinear_16", "no_32", "bilinear_32", 0 };
static const char *filtermode2[] = { "0x", "1x", "2x", "3x", "4x", 0 };
cfgfile_write (f, "gfx_refreshrate=%d\n", p->gfx_refreshrate);
cfgfile_write (f, "gfx_vsync=%s\n", p->gfx_vsync ? "true" : "false");
cfgfile_write (f, "gfx_lores=%s\n", p->gfx_lores ? "true" : "false");
- cfgfile_write (f, "gfx_lores_mode=%s\n", p->gfx_lores_mode ? 1 : 0);
+ cfgfile_write (f, "gfx_lores_mode=%s\n", loresmode[p->gfx_lores_mode]);
cfgfile_write (f, "gfx_linemode=%s\n", linemode1[p->gfx_linedbl]);
cfgfile_write (f, "gfx_correct_aspect=%s\n", p->gfx_correct_aspect ? "true" : "false");
cfgfile_write (f, "gfx_fullscreen_amiga=%s\n", p->gfx_afullscreen ? "true" : "false");
cfgfile_write (f, "gfx_filter_vert_zoom=%d\n", p->gfx_filter_vert_zoom);
cfgfile_write (f, "gfx_filter_horiz_zoom=%d\n", p->gfx_filter_horiz_zoom);
+ cfgfile_write (f, "gfx_filter_vert_zoom_mult=%d\n", p->gfx_filter_vert_zoom_mult);
+ cfgfile_write (f, "gfx_filter_horiz_zoom_mult=%d\n", p->gfx_filter_horiz_zoom_mult);
cfgfile_write (f, "gfx_filter_vert_offset=%d\n", p->gfx_filter_vert_offset);
cfgfile_write (f, "gfx_filter_horiz_offset=%d\n", p->gfx_filter_horiz_offset);
cfgfile_write (f, "gfx_filter_scanlines=%d\n", p->gfx_filter_scanlines);
#ifdef GFXFILTER
|| cfgfile_intval (option, value, "gfx_filter_vert_zoom", &p->gfx_filter_vert_zoom, 1)
|| cfgfile_intval (option, value, "gfx_filter_horiz_zoom", &p->gfx_filter_horiz_zoom, 1)
+ || cfgfile_intval (option, value, "gfx_filter_vert_zoom_mult", &p->gfx_filter_vert_zoom_mult, 1)
+ || cfgfile_intval (option, value, "gfx_filter_horiz_zoom_mult", &p->gfx_filter_horiz_zoom_mult, 1)
|| cfgfile_intval (option, value, "gfx_filter_vert_offset", &p->gfx_filter_vert_offset, 1)
|| cfgfile_intval (option, value, "gfx_filter_horiz_offset", &p->gfx_filter_horiz_offset, 1)
|| cfgfile_intval (option, value, "gfx_filter_scanlines", &p->gfx_filter_scanlines, 1)
|| cfgfile_yesno (option, value, "filesys_no_fsdb", &p->filesys_no_uaefsdb)
|| cfgfile_yesno (option, value, "gfx_vsync", &p->gfx_vsync)
|| cfgfile_yesno (option, value, "gfx_lores", &p->gfx_lores)
- || cfgfile_yesno (option, value, "gfx_lores_mode", &p->gfx_lores_mode)
|| cfgfile_yesno (option, value, "gfx_correct_aspect", &p->gfx_correct_aspect)
|| cfgfile_yesno (option, value, "gfx_fullscreen_amiga", &p->gfx_afullscreen)
|| cfgfile_yesno (option, value, "gfx_fullscreen_picasso", &p->gfx_pfullscreen)
|| cfgfile_strval (option, value, "use_gui", &p->start_gui, guimode1, 1)
|| cfgfile_strval (option, value, "use_gui", &p->start_gui, guimode2, 1)
|| cfgfile_strval (option, value, "use_gui", &p->start_gui, guimode3, 0)
+ || cfgfile_strval (option, value, "gfx_lores_mode", &p->gfx_lores_mode, loresmode, 0)
|| cfgfile_strval (option, value, "gfx_linemode", &p->gfx_linedbl, linemode1, 1)
|| cfgfile_strval (option, value, "gfx_linemode", &p->gfx_linedbl, linemode2, 0)
|| cfgfile_strval (option, value, "gfx_center_horizontal", &p->gfx_xcenter, centermode1, 1)
p->filesys_custom_uaefsdb = 1;
p->gfx_filter = 0;
+ p->gfx_filter_horiz_zoom_mult = 1000;
+ p->gfx_filter_vert_zoom_mult = 1000;
p->gfx_filter_filtermode = 1;
p->gfx_filter_scanlineratio = (1 << 4) | 1;
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 = 8 * 2;
CIA_calctimers ();
break;
case 13:
#define MAKE_FPSR(r) do { fmov_rr(FP_RESULT,r); } while (0)
-#define delay //nop() ;nop() /* Who tried this with the JIT ? */
-#define delay2 //nop() ;nop() /* the delays will have to emit( ;-) */
-
-uae_s32 temp_fp[3]; /* To convert between FP/integer */
+uae_s32 temp_fp[] = {0,0,0}; /* To convert between FP and <ea> */
/* 128 words, indexed through the low byte of the 68k fpu control word */
static uae_u16 x86_fpucw[]={
/* return register number, or -1 for failure */
STATIC_INLINE int get_fp_value (uae_u32 opcode, uae_u16 extra)
{
- uaecptr tmppc;
- uae_u16 tmp;
- int size;
- int mode;
- int reg;
- double* src;
- uae_u32 ad = 0;
static int sz1[8] = { 4, 4, 12, 12, 2, 8, 1, 0 };
static int sz2[8] = { 4, 4, 12, 12, 2, 8, 2, 0 };
+ int reg = opcode & 7;
+ int mode = (opcode >> 3) & 7;
+ int size = (extra >> 10) & 7;
- if ((extra & 0x4000) == 0) {
- return (extra >> 10) & 7;
- }
+ if (!(extra & 0x4000)) /* R/M=0, from FPx to FPy */
+ return size; /* size is the source register FPx */
+ if (size == 3) /* packed decimal is not supported on 68040 */
+ return -1;
+ if (size == 7) /* this size is not defined */
+ return -1;
- mode = (opcode >> 3) & 7;
- reg = opcode & 7;
- size = (extra >> 10) & 7;
switch (mode) {
- case 0:
+ case 0: /* Dn */
switch (size) {
- case 6:
- sign_extend_8_rr(S1,reg);
- mov_l_mr((uae_u32)temp_fp,S1);
- delay2;
+ case 0: /* Long */
+ mov_l_mr((uae_u32)temp_fp,reg);
fmovi_rm(FS1,(uae_u32)temp_fp);
return FS1;
- case 4:
+ case 1: /* Single */
+ mov_l_mr((uae_u32)temp_fp,reg);
+ fmovs_rm(FS1,(uae_u32)temp_fp);
+ return FS1;
+ case 4: /* Word */
sign_extend_16_rr(S1,reg);
mov_l_mr((uae_u32)temp_fp,S1);
- delay2;
fmovi_rm(FS1,(uae_u32)temp_fp);
return FS1;
- case 0:
- mov_l_mr((uae_u32)temp_fp,reg);
- delay2;
+ case 6: /* Byte */
+ sign_extend_8_rr(S1,reg);
+ mov_l_mr((uae_u32)temp_fp,S1);
fmovi_rm(FS1,(uae_u32)temp_fp);
return FS1;
- case 1:
- mov_l_mr((uae_u32)temp_fp,reg);
- delay2;
- fmovs_rm(FS1,(uae_u32)temp_fp);
- return FS1;
default:
return -1;
}
- return -1; /* Should be unreachable */
- case 1:
- return -1; /* Genuine invalid instruction */
- default:
- break;
- }
- /* OK, we *will* have to load something from an address. Let's make
- sure we know how to handle that, or quit early --- i.e. *before*
- we do any postincrement/predecrement that we may regret */
-
- switch (size) {
- case 3:
- return -1;
- case 0:
- case 1:
- case 2:
- case 4:
- case 5:
- case 6:
- break;
- default:
+ case 1: /* An, invalid mode */
return -1;
- }
-
- switch (mode) {
- case 2:
- ad=S1; /* We will change it, anyway ;-) */
- mov_l_rr(ad,reg+8);
+ case 2: /* (An) */
+ mov_l_rr(S1,reg+8);
break;
- case 3:
- ad=S1;
- mov_l_rr(ad,reg+8);
+ case 3: /* (An)+ */
+ mov_l_rr(S1,reg+8);
lea_l_brr(reg+8,reg+8,(reg == 7?sz2[size]:sz1[size]));
break;
- case 4:
- ad=S1;
-
+ case 4: /* -(An) */
lea_l_brr(reg+8,reg+8,-(reg == 7?sz2[size]:sz1[size]));
- mov_l_rr(ad,reg+8);
+ mov_l_rr(S1,reg+8);
break;
- case 5:
- {
- uae_u32 off=(uae_s32)(uae_s16)comp_get_iword((m68k_pc_offset+=2)-2);
- ad=S1;
- mov_l_rr(ad,reg+8);
- lea_l_brr(ad,ad,off);
- break;
- }
- case 6:
- {
+ case 5: /* (d16,An) */
+ {
+ uae_u32 off=(uae_s32)(uae_s16)comp_get_iword((m68k_pc_offset+=2)-2);
+ mov_l_rr(S1,reg+8);
+ lea_l_brr(S1,S1,off);
+ break;
+ }
+ case 6: /* (d8,An,Xn) or (bd,An,Xn) or ([bd,An,Xn],od) or ([bd,An],Xn,od) */
+ {
uae_u32 dp=comp_get_iword((m68k_pc_offset+=2)-2);
- ad=S1;
- calc_disp_ea_020(reg+8,dp,ad,S2);
+ calc_disp_ea_020(reg+8,dp,S1,S2);
break;
- }
+ }
case 7:
switch (reg) {
- case 0:
- {
+ case 0: /* (xxx).W */
+ {
uae_u32 off=(uae_s32)(uae_s16)comp_get_iword((m68k_pc_offset+=2)-2);
- ad=S1;
- mov_l_ri(ad,off);
+ mov_l_ri(S1,off);
break;
- }
- case 1:
- {
+ }
+ case 1: /* (xxx).L */
+ {
uae_u32 off=comp_get_ilong((m68k_pc_offset+=4)-4);
- ad=S1;
- mov_l_ri(ad,off);
+ mov_l_ri(S1,off);
break;
- }
- case 2:
- {
+ }
+ case 2: /* (d16,PC) */
+ {
uae_u32 address=start_pc+((char *)comp_pc_p-(char *)start_pc_p)+
- m68k_pc_offset;
+ m68k_pc_offset;
uae_s32 PC16off =(uae_s32)(uae_s16)comp_get_iword((m68k_pc_offset+=2)-2);
- ad=S1;
- mov_l_ri(ad,address+PC16off);
- break;
- }
- case 3:
- return -1;
- tmppc = m68k_getpc ();
- tmp = next_iword ();
- ad = get_disp_ea_020 (tmppc, tmp);
- break;
- case 4:
- {
- uae_u32 address=start_pc+((char *)comp_pc_p-(char *)start_pc_p)+
- m68k_pc_offset;
- ad=S1;
- if (size == 6)
- address++;
- mov_l_ri(ad,address);
- m68k_pc_offset+=sz2[size];
+ mov_l_ri(S1,address+PC16off);
break;
- }
- default:
+ }
+ 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 */
+ m68k_pc_offset+=sz2[size];
+ switch (size) {
+ case 0:
+ {
+ uae_s32 li = comp_get_ilong(m68k_pc_offset-4);
+ float si = (float) li;
+
+ if (li == (int) si) {
+ //write_log ("converted immediate LONG constant to SINGLE\n");
+ fmovs_ri(FS1,*(uae_u32 *)&si);
+ return FS1;
+ }
+ //write_log ("immediate LONG constant\n");
+ fmovl_ri(FS1,li);
+ return FS1;
+ }
+ case 1:
+ //write_log ("immediate SINGLE constant\n");
+ fmovs_ri(FS1,comp_get_ilong(m68k_pc_offset-4));
+ return FS1;
+ case 2:
+ //write_log ("immediate LONG DOUBLE constant\n");
+ fmov_ext_ri(FS1,comp_get_ilong(m68k_pc_offset-4),
+ comp_get_ilong(m68k_pc_offset-8),
+ (comp_get_ilong(m68k_pc_offset-12)>>16)&0xffff);
+ return FS1;
+ case 4:
+ {
+ float si = (float)(uae_s16)comp_get_iword(m68k_pc_offset-2);
+
+ //write_log ("converted immediate WORD constant to SINGLE\n");
+ fmovs_ri(FS1,*(uae_u32 *)&si);
+ return FS1;
+ }
+ case 5:
+ {
+ 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) {
+ //write_log ("SPEED GAIN: converted a DOUBLE constant to SINGLE\n");
+ fmovs_ri(FS1,*(uae_u32 *)&si);
+ return FS1;
+ }
+ //write_log ("immediate DOUBLE constant\n");
+ fmov_ri(FS1,longarray[0],longarray[1]);
+ return FS1;
+ }
+ case 6:
+ {
+ float si = (float)(uae_s8)comp_get_ibyte(m68k_pc_offset-2);
+
+ //write_log ("immediate BYTE constant converted to SINGLE\n");
+ fmovs_ri(FS1,*(uae_u32 *)&si);
+ return FS1;
+ }
+ default: /* never reached */
+ return -1;
+ }
+ default: /* never reached */
return -1;
}
}
switch (size) {
- case 0:
- readlong(ad,S2,S3);
+ case 0: /* Long */
+ readlong(S1,S2,S3);
mov_l_mr((uae_u32)temp_fp,S2);
- delay2;
fmovi_rm(FS1,(uae_u32)temp_fp);
- break;
- case 1:
- readlong(ad,S2,S3);
+ return FS1;
+ case 1: /* Single */
+ readlong(S1,S2,S3);
mov_l_mr((uae_u32)temp_fp,S2);
- delay2;
fmovs_rm(FS1,(uae_u32)temp_fp);
- break;
- case 2:
- readword(ad,S2,S3);
+ return FS1;
+ case 2: /* Long Double */
+ readword(S1,S2,S3);
mov_w_mr(((uae_u32)temp_fp)+8,S2);
- add_l_ri(ad,4);
- readlong(ad,S2,S3);
+ add_l_ri(S1,4);
+ readlong(S1,S2,S3);
mov_l_mr((uae_u32)(temp_fp)+4,S2);
- add_l_ri(ad,4);
- readlong(ad,S2,S3);
+ add_l_ri(S1,4);
+ readlong(S1,S2,S3);
mov_l_mr((uae_u32)(temp_fp),S2);
- delay2;
fmov_ext_rm(FS1,(uae_u32)(temp_fp));
- break;
- case 3:
- return -1; /* Some silly "packed" stuff */
- case 4:
- readword(ad,S2,S3);
+ return FS1;
+ case 4: /* Word */
+ readword(S1,S2,S3);
sign_extend_16_rr(S2,S2);
mov_l_mr((uae_u32)temp_fp,S2);
- delay2;
fmovi_rm(FS1,(uae_u32)temp_fp);
- break;
- case 5:
- readlong(ad,S2,S3);
+ return FS1;
+ case 5: /* Double */
+ readlong(S1,S2,S3);
mov_l_mr(((uae_u32)temp_fp)+4,S2);
- add_l_ri(ad,4);
- readlong(ad,S2,S3);
+ add_l_ri(S1,4);
+ readlong(S1,S2,S3);
mov_l_mr((uae_u32)(temp_fp),S2);
- delay2;
fmov_rm(FS1,(uae_u32)(temp_fp));
- break;
- case 6:
- readbyte(ad,S2,S3);
+ return FS1;
+ case 6: /* Byte */
+ readbyte(S1,S2,S3);
sign_extend_8_rr(S2,S2);
mov_l_mr((uae_u32)temp_fp,S2);
- delay2;
fmovi_rm(FS1,(uae_u32)temp_fp);
- break;
+ return FS1;
default:
return -1;
}
- return FS1;
+ return -1;
}
/* return of -1 means failure, >=0 means OK */
STATIC_INLINE int put_fp_value (int val, uae_u32 opcode, uae_u16 extra)
{
- uae_u16 tmp;
- uaecptr tmppc;
- int size;
- int mode;
- int reg;
- uae_u32 ad;
static int sz1[8] = { 4, 4, 12, 12, 2, 8, 1, 0 };
static int sz2[8] = { 4, 4, 12, 12, 2, 8, 2, 0 };
+ int reg = opcode & 7;
+ int mode = (opcode >> 3) & 7;
+ int size = (extra >> 10) & 7;
- if ((extra & 0x4000) == 0) {
- fmov_rr((extra>>10)&7,val);
+ if (!(extra & 0x4000)) { /* R/M=0, from FPx to FPy */
+ fmov_rr(size,val);
return 0;
}
+ if (size == 3) /* packed decimal is not supported on 68040 */
+ return -1;
+ if (size == 7) /* this size is not defined */
+ return -1;
- mode = (opcode >> 3) & 7;
- reg = opcode & 7;
- size = (extra >> 10) & 7;
- ad = -1;
switch (mode) {
- case 0:
+ case 0: /* Dn */
switch (size) {
- case 6: /* FMOVE.B FPx, reg */
+ case 0: /* FMOVE.L FPx, Dn */
#if USE_X86_FPUCW
if (!(regs.fpcr & 0xf0)) { /* if extended round to nearest */
mov_l_ri(S1,0x10); /* use extended round to zero mode */
fldcw_m_indexed(S1,(uae_u32)x86_fpucw);
fmovi_mr((uae_u32)temp_fp,val);
- mov_b_rm(reg,(uae_u32)temp_fp);
+ mov_l_rm(reg,(uae_u32)temp_fp);
mov_l_rm(S1,(uae_u32)®s.fpcr);
and_l_ri(S1,0xf0); /* restore control word */
fldcw_m_indexed(S1,(uae_u32)x86_fpucw);
}
#endif
fmovi_mr((uae_u32)temp_fp,val);
- mov_b_rm(reg,(uae_u32)temp_fp);
+ mov_l_rm(reg,(uae_u32)temp_fp);
+ return 0;
+ case 1: /* FMOVE.S FPx, Dn */
+ fmovs_mr((uae_u32)temp_fp,val);
+ mov_l_rm(reg,(uae_u32)temp_fp);
return 0;
- case 4: /* FMOVE.W FPx, reg */
+ case 4: /* FMOVE.W FPx, Dn */
#if USE_X86_FPUCW
if (!(regs.fpcr & 0xf0)) { /* if extended round to nearest */
mov_l_ri(S1,0x10); /* use extended round to zero mode */
fmovi_mr((uae_u32)temp_fp,val);
mov_w_rm(reg,(uae_u32)temp_fp);
return 0;
- case 0: /* FMOVE.L FPx, reg */
+ case 6: /* FMOVE.B FPx, Dn */
#if USE_X86_FPUCW
if (!(regs.fpcr & 0xf0)) { /* if extended round to nearest */
mov_l_ri(S1,0x10); /* use extended round to zero mode */
fldcw_m_indexed(S1,(uae_u32)x86_fpucw);
fmovi_mr((uae_u32)temp_fp,val);
- mov_l_rm(reg,(uae_u32)temp_fp);
+ mov_b_rm(reg,(uae_u32)temp_fp);
mov_l_rm(S1,(uae_u32)®s.fpcr);
and_l_ri(S1,0xf0); /* restore control word */
fldcw_m_indexed(S1,(uae_u32)x86_fpucw);
}
#endif
fmovi_mr((uae_u32)temp_fp,val);
- mov_l_rm(reg,(uae_u32)temp_fp);
- return 0;
- case 1:
- fmovs_mr((uae_u32)temp_fp,val);
- mov_l_rm(reg,(uae_u32)temp_fp);
+ mov_b_rm(reg,(uae_u32)temp_fp);
return 0;
default:
return -1;
}
- case 1:
- return -1; /* genuine invalid instruction */
- default: break;
- }
-
- /* Let's make sure we get out *before* doing something silly if
- we can't handle the size */
- switch (size) {
- case 0:
- case 4:
- case 5:
- case 6:
- case 2:
- case 1:
- break;
- case 3:
- default:
+ case 1: /* An, invalid mode */
return -1;
- }
-
- switch (mode) {
- case 2:
- ad=S1;
- mov_l_rr(ad,reg+8);
+ case 2: /* (An) */
+ mov_l_rr(S1,reg+8);
break;
- case 3:
- ad=S1;
- mov_l_rr(ad,reg+8);
+ case 3: /* (An)+ */
+ mov_l_rr(S1,reg+8);
lea_l_brr(reg+8,reg+8,(reg == 7?sz2[size]:sz1[size]));
break;
- case 4:
- ad=S1;
+ case 4: /* -(An) */
lea_l_brr(reg+8,reg+8,-(reg == 7?sz2[size]:sz1[size]));
- mov_l_rr(ad,reg+8);
+ mov_l_rr(S1,reg+8);
break;
- case 5:
- {
- uae_u32 off=(uae_s32)(uae_s16)comp_get_iword((m68k_pc_offset+=2)-2);
- ad=S1;
- mov_l_rr(ad,reg+8);
- add_l_ri(ad,off);
- break;
- }
- case 6:
- {
+ case 5: /* (d16,An) */
+ {
+ uae_u32 off=(uae_s32)(uae_s16)comp_get_iword((m68k_pc_offset+=2)-2);
+ mov_l_rr(S1,reg+8);
+ add_l_ri(S1,off);
+ break;
+ }
+ case 6: /* (d8,An,Xn) or (bd,An,Xn) or ([bd,An,Xn],od) or ([bd,An],Xn,od) */
+ {
uae_u32 dp=comp_get_iword((m68k_pc_offset+=2)-2);
- ad=S1;
- calc_disp_ea_020(reg+8,dp,ad,S2);
+ calc_disp_ea_020(reg+8,dp,S1,S2);
break;
- }
+ }
case 7:
switch (reg) {
- case 0:
- {
+ case 0: /* (xxx).W */
+ {
uae_u32 off=(uae_s32)(uae_s16)comp_get_iword((m68k_pc_offset+=2)-2);
- ad=S1;
- mov_l_ri(ad,off);
+ mov_l_ri(S1,off);
break;
- }
- case 1:
- {
+ }
+ case 1: /* (xxx).L */
+ {
uae_u32 off=comp_get_ilong((m68k_pc_offset+=4)-4);
- ad=S1;
- mov_l_ri(ad,off);
- break;
- }
- case 2:
- {
- uae_u32 address=start_pc+((char *)comp_pc_p-(char *)start_pc_p)+
- m68k_pc_offset;
- uae_s32 PC16off =(uae_s32)(uae_s16)comp_get_iword((m68k_pc_offset+=2)-2);
- ad=S1;
- mov_l_ri(ad,address+PC16off);
- break;
- }
- case 3:
- return -1;
- tmppc = m68k_getpc ();
- tmp = next_iword ();
- ad = get_disp_ea_020 (tmppc, tmp);
- break;
- case 4:
- {
- uae_u32 address=start_pc+((char *)comp_pc_p-(char *)start_pc_p)+
- m68k_pc_offset;
- ad=S1;
- mov_l_ri(ad,address);
- m68k_pc_offset+=sz2[size];
+ mov_l_ri(S1,off);
break;
- }
- default:
+ }
+ default: /* All other modes are not allowed for FPx to <ea> */
+ write_log ("JIT FMOVE FPx,<EA> Mode is not allowed %04x %04x\n",opcode,extra);
return -1;
}
}
switch (size) {
- case 0:
+ case 0: /* Long */
fmovi_mr((uae_u32)temp_fp,val);
- delay;
mov_l_rm(S2,(uae_u32)temp_fp);
- writelong_clobber(ad,S2,S3);
- break;
- case 1:
+ writelong_clobber(S1,S2,S3);
+ return 0;
+ case 1: /* Single */
fmovs_mr((uae_u32)temp_fp,val);
- delay;
mov_l_rm(S2,(uae_u32)temp_fp);
- writelong_clobber(ad,S2,S3);
- break;
- case 2:
+ writelong_clobber(S1,S2,S3);
+ return 0;
+ case 2:/* Long Double */
fmov_ext_mr((uae_u32)temp_fp,val);
- delay;
mov_w_rm(S2,(uae_u32)temp_fp+8);
- writeword_clobber(ad,S2,S3);
- add_l_ri(ad,4);
+ writeword_clobber(S1,S2,S3);
+ add_l_ri(S1,4);
mov_l_rm(S2,(uae_u32)temp_fp+4);
- writelong_clobber(ad,S2,S3);
- add_l_ri(ad,4);
+ writelong_clobber(S1,S2,S3);
+ add_l_ri(S1,4);
mov_l_rm(S2,(uae_u32)temp_fp);
- writelong_clobber(ad,S2,S3);
- break;
- case 3: return -1; /* Packed */
-
- case 4:
+ writelong_clobber(S1,S2,S3);
+ return 0;
+ case 4: /* Word */
fmovi_mr((uae_u32)temp_fp,val);
- delay;
mov_l_rm(S2,(uae_u32)temp_fp);
- writeword_clobber(ad,S2,S3);
- break;
- case 5:
+ writeword_clobber(S1,S2,S3);
+ return 0;
+ case 5: /* Double */
fmov_mr((uae_u32)temp_fp,val);
- delay;
mov_l_rm(S2,(uae_u32)temp_fp+4);
- writelong_clobber(ad,S2,S3);
- add_l_ri(ad,4);
+ writelong_clobber(S1,S2,S3);
+ add_l_ri(S1,4);
mov_l_rm(S2,(uae_u32)temp_fp);
- writelong_clobber(ad,S2,S3);
- break;
- case 6:
+ writelong_clobber(S1,S2,S3);
+ return 0;
+ case 6: /* Byte */
fmovi_mr((uae_u32)temp_fp,val);
- delay;
mov_l_rm(S2,(uae_u32)temp_fp);
- writebyte(ad,S2,S3);
- break;
+ writebyte(S1,S2,S3);
+ return 0;
default:
return -1;
}
- return 0;
+ return -1;
}
/* return -1 for failure, or register number for success */
-STATIC_INLINE int get_fp_ad (uae_u32 opcode, uae_u32 * ad)
+STATIC_INLINE int get_fp_ad (uae_u32 opcode)
{
- uae_u16 tmp;
- uaecptr tmppc;
- int mode;
- int reg;
uae_s32 off;
+ int mode = (opcode >> 3) & 7;
+ int reg = opcode & 7;
- mode = (opcode >> 3) & 7;
- reg = opcode & 7;
switch (mode) {
case 0:
case 1:
case 4:
mov_l_rr(S1,8+reg);
return S1;
- *ad = m68k_areg (regs, reg);
- break;
case 5:
off=(uae_s32)(uae_s16)comp_get_iword((m68k_pc_offset+=2)-2);
-
mov_l_rr(S1,8+reg);
add_l_ri(S1,off);
return S1;
case 6:
return -1;
- break;
case 7:
switch (reg) {
case 0:
off=comp_get_ilong((m68k_pc_offset+=4)-4);
mov_l_ri(S1,off);
return S1;
- case 2:
- return -1;
- *ad = m68k_getpc ();
- *ad += (uae_s32) (uae_s16) next_iword ();
- break;
- case 3:
- return -1;
- tmppc = m68k_getpc ();
- tmp = next_iword ();
- *ad = get_disp_ea_020 (tmppc, tmp);
- break;
default:
return -1;
}
{
FAIL(1);
return;
-
- if (!currprefs.compfpu) {
- FAIL(1);
- return;
- }
}
void comp_fscc_opp (uae_u32 opcode, uae_u16 extra)
case 15: mov_l_rr(S4,S1); break;
}
- if ((opcode & 0x38) == 0) {
+ if (!(opcode & 0x38))
mov_b_rr(reg,S4);
- } else {
+ else {
abort();
- if (get_fp_ad (opcode, &ad) == 0) {
+ if (!get_fp_ad (opcode)) {
m68k_setpc (m68k_getpc () - 4);
op_illg (opcode);
- } else
+ }
+ else
put_byte (ad, cc ? 0xff : 0x00);
}
}
void comp_ftrapcc_opp (uae_u32 opcode, uaecptr oldpc)
{
- int cc;
-
FAIL(1);
return;
}
void comp_fbcc_opp (uae_u32 opcode)
{
uae_u32 start_68k_offset=m68k_pc_offset;
- uae_u32 off;
- uae_u32 v1;
- uae_u32 v2;
- uae_u32 nh;
+ uae_u32 off, v1, v2;
int cc;
if (!currprefs.compfpu) {
FAIL(1);
return;
}
- if ((opcode&0x40)==0) {
+ if (!(opcode&0x40)) {
off=(uae_s32)(uae_s16)comp_get_iword((m68k_pc_offset+=2)-2);
}
else {
printf ("fsave_opp at %08lx\n", m68k_getpc ());
fflush (stdout);
#endif
- if (get_fp_ad (opcode, &ad) == 0) {
+ if (!get_fp_ad (opcode)) {
m68k_setpc (m68k_getpc () - 2);
op_illg (opcode);
return;
printf ("frestore_opp at %08lx\n", m68k_getpc ());
fflush (stdout);
#endif
- if (get_fp_ad (opcode, &ad) == 0) {
+ if (!get_fp_ad (opcode)) {
m68k_setpc (m68k_getpc () - 2);
op_illg (opcode);
return;
/* @@@ This may be wrong. */
ad -= 4;
d = get_long (ad);
- if ((d & 0xff000000) != 0) { /* Not a NULL frame? */
- if ((d & 0x00ff0000) == 0) { /* IDLE */
+ if (d & 0xff000000) { /* Not a NULL frame? */
+ if (!(d & 0x00ff0000)) { /* IDLE */
} else if ((d & 0x00ff0000) == 0x00300000) { /* UNIMP */
ad -= 44;
} else if ((d & 0x00ff0000) == 0x00600000) { /* BUSY */
} else {
d = get_long (ad);
ad += 4;
- if ((d & 0xff000000) != 0) { /* Not a NULL frame? */
- if ((d & 0x00ff0000) == 0) { /* IDLE */
+ if (d & 0xff000000) { /* Not a NULL frame? */
+ if (!(d & 0x00ff0000)) { /* IDLE */
} else if ((d & 0x00ff0000) == 0x00300000) { /* UNIMP */
ad += 44;
} else if ((d & 0x00ff0000) == 0x00600000) { /* BUSY */
if (incr < 0) {
ad -= 4;
d = get_long (ad);
- if ((d & 0xff000000) != 0) {
+ if (d & 0xff000000) {
if ((d & 0x00ff0000) == 0x00180000)
ad -= 6 * 4;
else if ((d & 0x00ff0000) == 0x00380000)
} else {
d = get_long (ad);
ad += 4;
- if ((d & 0xff000000) != 0) {
+ if (d & 0xff000000) {
if ((d & 0x00ff0000) == 0x00180000)
ad += 6 * 4;
else if ((d & 0x00ff0000) == 0x00380000)
m68k_areg (regs, opcode & 7) = ad;
}
-extern uae_u32 *xhex_pi, *xhex_exp_1, *xhex_l2_e, *xhex_ln_2, *xhex_ln_10;
-extern uae_u32 *xhex_l10_2, *xhex_l10_e, *xhex_1e16, *xhex_1e32, *xhex_1e64;
-extern uae_u32 *xhex_1e128, *xhex_1e256, *xhex_1e512, *xhex_1e1024;
-extern uae_u32 *xhex_1e2048, *xhex_1e4096;
+extern uae_u32 xhex_pi, xhex_exp_1, xhex_l2_e, xhex_ln_2, xhex_ln_10;
+extern uae_u32 xhex_l10_2, xhex_l10_e, xhex_1e16, xhex_1e32, xhex_1e64;
+extern uae_u32 xhex_1e128, xhex_1e256, xhex_1e512, xhex_1e1024;
+extern uae_u32 xhex_1e2048, xhex_1e4096;
extern double fp_1e8;
extern float fp_1e1, fp_1e2, fp_1e4;
FAIL(1);
return;
}
- switch ((extra >> 13) & 0x7) {
+ switch ((extra >> 13) & 7) {
case 3: /* 2nd most common */
- if (put_fp_value ((extra >> 7)&7 , opcode, extra) < 0) {
+ if (put_fp_value ((extra >> 7) & 7, opcode, extra) < 0) {
FAIL(1);
return;
}
case 6:
case 7:
{
- uae_u32 ad, list = 0;
+ uae_u32 list = 0;
int incr = 0;
if (extra & 0x2000) {
int ad;
default:
FAIL(1); return;
}
- ad=get_fp_ad (opcode, &ad);
+ ad=get_fp_ad (opcode);
if (ad<0) {
FAIL(1);
#if 0
abort();
}
while (list) {
- uae_u32 wrd1, wrd2, wrd3;
if (incr < 0) { /* Predecrement */
fmov_ext_mr((uae_u32)temp_fp,fpp_movem_index2[list]);
- delay;
sub_l_ri(ad,4);
mov_l_rm(S2,(uae_u32)temp_fp);
writelong_clobber(ad,S2,S3);
writeword_clobber(ad,S2,S3);
} else { /* postinc */
fmov_ext_mr((uae_u32)temp_fp,fpp_movem_index2[list]);
- delay;
mov_w_rm(S2,(uae_u32)temp_fp+8);
writeword_clobber(ad,S2,S3);
add_l_ri(ad,4);
default:
FAIL(1); return;
}
- ad=get_fp_ad (opcode, &ad);
+ ad=get_fp_ad (opcode);
if (ad<0) {
FAIL(1);
#if 0
}
while (list) {
- uae_u32 wrd1, wrd2, wrd3;
if (incr < 0) {
sub_l_ri(ad,4);
readlong(ad,S2,S3);
sub_l_ri(ad,4);
readword(ad,S2,S3);
mov_w_mr(((uae_u32)temp_fp)+8,S2);
- delay2;
fmov_ext_rm(fpp_movem_index2[list],(uae_u32)(temp_fp));
} else {
readword(ad,S2,S3);
readlong(ad,S2,S3);
mov_l_mr((uae_u32)(temp_fp),S2);
add_l_ri(ad,4);
- delay2;
fmov_ext_rm(fpp_movem_index1[list],(uae_u32)(temp_fp));
}
list = fpp_movem_next[list];
fmov_log10_2(dreg);
break;
case 0x0c:
- fmov_ext_rm(dreg,&xhex_exp_1);
+ fmov_ext_rm(dreg,(uae_u32)&xhex_exp_1);
break;
case 0x0d:
fmov_log2_e(dreg);
break;
case 0x0e:
- fmov_ext_rm(dreg,&xhex_l10_e);
+ fmov_ext_rm(dreg,(uae_u32)&xhex_l10_e);
break;
case 0x0f:
fmov_0(dreg);
fmov_loge_2(dreg);
break;
case 0x31:
- fmov_ext_rm(dreg,&xhex_ln_10);
+ fmov_ext_rm(dreg,(uae_u32)&xhex_ln_10);
break;
case 0x32:
fmov_1(dreg);
break;
case 0x33:
- fmovs_rm(dreg,&fp_1e1);
+ fmovs_rm(dreg,(uae_u32)&fp_1e1);
break;
case 0x34:
- fmovs_rm(dreg,&fp_1e2);
+ fmovs_rm(dreg,(uae_u32)&fp_1e2);
break;
case 0x35:
- fmovs_rm(dreg,&fp_1e4);
+ fmovs_rm(dreg,(uae_u32)&fp_1e4);
break;
case 0x36:
- fmov_rm(dreg,&fp_1e8);
+ fmov_rm(dreg,(uae_u32)&fp_1e8);
break;
case 0x37:
- fmov_ext_rm(dreg,&xhex_1e16);
+ fmov_ext_rm(dreg,(uae_u32)&xhex_1e16);
break;
case 0x38:
- fmov_ext_rm(dreg,&xhex_1e32);
+ fmov_ext_rm(dreg,(uae_u32)&xhex_1e32);
break;
case 0x39:
- fmov_ext_rm(dreg,&xhex_1e64);
+ fmov_ext_rm(dreg,(uae_u32)&xhex_1e64);
break;
case 0x3a:
- fmov_ext_rm(dreg,&xhex_1e128);
+ fmov_ext_rm(dreg,(uae_u32)&xhex_1e128);
break;
case 0x3b:
- fmov_ext_rm(dreg,&xhex_1e256);
+ fmov_ext_rm(dreg,(uae_u32)&xhex_1e256);
break;
case 0x3c:
- fmov_ext_rm(dreg,&xhex_1e512);
+ fmov_ext_rm(dreg,(uae_u32)&xhex_1e512);
break;
case 0x3d:
- fmov_ext_rm(dreg,&xhex_1e1024);
+ fmov_ext_rm(dreg,(uae_u32)&xhex_1e1024);
break;
case 0x3e:
- fmov_ext_rm(dreg,&xhex_1e2048);
+ fmov_ext_rm(dreg,(uae_u32)&xhex_1e2048);
break;
case 0x3f:
- fmov_ext_rm(dreg,&xhex_1e4096);
+ fmov_ext_rm(dreg,(uae_u32)&xhex_1e4096);
break;
default:
FAIL(1);
/* If we have control over the CW, we can do this */
dont_care_fflags();
if ((sreg=get_fp_value(opcode,extra)) < 0) {FAIL(1);return;}
- if ((regs.fpcr & 0x30) == 0x10) /* maybe unsafe, because this test is done */
+ if ((regs.fpcr & 0xf0) == 0x10) /* maybe unsafe, because this test is done */
frndint_rr(dreg,sreg); /* during the JIT compilation and not at runtime */
else {
- mov_l_ri(S1,(regs.fpcr & 0xC0) | 0x10); /* use round to zero */
+ mov_l_ri(S1,0x10); /* extended round to zero */
fldcw_m_indexed(S1,(uae_u32)x86_fpucw);
frndint_rr(dreg,sreg);
mov_l_rm(S1,(uae_u32)®s.fpcr);
int size=4;
int dir=-1;
int len=0;
- int j;
if( n_except != STATUS_ACCESS_VIOLATION || !canbang)
return EXCEPTION_CONTINUE_SEARCH;
#if 0
if (i)
{
+ int j;
+
for (j=0;j<10;j++) {
write_log("JIT: instruction byte %2d is 0x%02x\n",j,i[j]);
}
}
LENDFUNC(NONE,WRITE,2,raw_fmovs_mr,(MEMW m, FR 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;
LOWFUNC(NONE,WRITE,2,raw_fmov_ext_mr_drop,(MEMW m, FR r))
{
- int rs;
-
make_tos(r);
emit_byte(0xdb); /* store and pop it */
emit_byte(0x3d);
}
LENDFUNC(NONE,NONE,2,raw_frem1_rr,(FRW d, FR s))
-
LOWFUNC(NONE,NONE,1,raw_ftst_r,(FR r))
{
make_tos(r);
emit_byte(0xd9);
emit_byte(0xc9+p); /* swap top two around */
if (have_cmov) {
- // gb-- fucomi is for P6 cores only, not K6-2 then...
- emit_byte(0xdb);
- emit_byte(0xe9+p); /* fucomi them */
+ // gb-- fucomi is for P6 cores only, not K6-2 then...
+ emit_byte(0xdb);
+ emit_byte(0xe9+p); /* fucomi them */
}
else {
- emit_byte(0xdd);
- emit_byte(0xe1+p); /* fucom them */
- emit_byte(0x9b);
- emit_byte(0xdf);
- emit_byte(0xe0); /* fstsw ax */
- raw_sahf(0); /* sahf */
+ emit_byte(0xdd);
+ emit_byte(0xe1+p); /* fucom them */
+ emit_byte(0x9b);
+ emit_byte(0xdf);
+ emit_byte(0xe0); /* fstsw ax */
+ raw_sahf(0); /* sahf */
}
emit_byte(0xdd);
emit_byte(0xd9+p); /* store value back, and get rid of 0 */
static __inline__ void make_exclusive(int r, int size, int spec)
{
- int clobber;
reg_status oldstate;
int rr=live.state[r].realreg;
int nr;
static __inline__ void remove_offset(int r, int spec)
{
- reg_status oldstate;
int rr;
if (isconst(r))
}
MENDFUNC(2,fmovs_mr,(MEMW m, FR 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);
********************************************************************/
uae_u32 scratch[VREGS];
-fptype fscratch[VFREGS];
+fptype fscratch[VFREGS];
void init_comp(void)
{
/* Only do this if you really mean it! The next call should be to init!*/
void flush(int save_regs)
{
- int fi,i;
+ int i;
log_flush();
flush_flags(); /* low level */
static void flush_keepflags(void)
{
- int fi,i;
+ int i;
for (i=0;i<VFREGS;i++) {
if (live.fate[i].needflush==NF_SCRATCH ||
void compemu_reset(void)
{
- int i;
-
set_cache_state(0);
}
static void flush_icache_hard(int n)
{
- uae_u32 i;
blockinfo* bi;
hard_flush_count++;
void flush_icache(int n)
{
- uae_u32 i;
blockinfo* bi;
blockinfo* bi2;
#define SPRITE_DEBUG 0
#define SPRITE_DEBUG_MINY 0x6a
#define SPRITE_DEBUG_MAXY 0x70
-//#define SPRITE_MASK 128
-#define SPRITE_MASK (1|2|4|8|16|32|64|128)
#define SPR0_HPOS 0x15
#define MAX_SPRITES 8
#define SPRITE_COLLISIONS
int window_xp = coord_hw_to_window_x (hw_xp) + (DIW_DDF_OFFSET << lores_shift);
int j, bestp;
-#if (SPRITE_MASK) != 255
- if (!((SPRITE_MASK) & (1 << i)))
+ if (!((debug_sprite_mask) & (1 << i)))
continue;
-#endif
+
if (! spr[i].armed || sprxp < 0 || hw_xp <= last_sprite_point || hw_xp > point)
continue;
if ( !(bplcon3 & 2) && /* sprites outside playfields enabled? */
cycle_line[5] = CYCLE_REFRESH;
cycle_line[7] = CYCLE_REFRESH;
}
-#else
+#endif
+#if 0
{
int i;
for (i = 12; i < 0x16; i += 2)
cycle_line[i] = CYCLE_NOCPU;
- cycle_line[4] = CYCLE_REFRESH;
- cycle_line[6] = CYCLE_REFRESH;
- cycle_line[8] = CYCLE_REFRESH;
- cycle_line[10] = CYCLE_REFRESH;
+ //cycle_line[4] = CYCLE_REFRESH;
+ //cycle_line[6] = CYCLE_REFRESH;
+ //cycle_line[8] = CYCLE_REFRESH;
+ //cycle_line[10] = CYCLE_REFRESH;
}
#endif
}
int debugging;
int exception_debugging;
int debug_copper;
+int debug_sprite_mask = 0xff;
static uaecptr debug_copper_pc;
extern int audio_channel_mask;
case 's':
if (*inptr == 'c') {
screenshot (1, 1);
+ } else if (*inptr == 'm') {
+ next_char(&inptr);
+ if (more_params(&inptr))
+ debug_sprite_mask = readint(&inptr);
+ console_out("sprite mask: %02.2X\n", debug_sprite_mask);
} else {
searchmem (&inptr);
}
{
x += visible_left_border;
x <<= (1 - lores_shift);
- return x + 2*DISPLAY_LEFT_SHIFT - 2*DIW_DDF_OFFSET;
+ return x + 2 * DISPLAY_LEFT_SHIFT - 2 * DIW_DDF_OFFSET;
}
int coord_native_to_amiga_y (int y)
visible_left_border = (max_diwstop - min_diwstart - w) / 2 + min_diwstart;
else
visible_left_border = max_diwstop - w - (max_diwstop - min_diwstart - w) / 2;
- visible_left_border &= ~1;
+ visible_left_border &= ~((1 << lores_shift) - 1);
/* Would the old value be good enough? If so, leave it as it is if we want to
* be clever. */
{
uaecptr tmppc;
uae_u16 tmp;
- int size;
- int mode;
- int reg;
+ int size, mode, reg;
uae_u32 ad = 0;
static int sz1[8] = { 4, 4, 12, 12, 2, 8, 1, 0 };
static int sz2[8] = { 4, 4, 12, 12, 2, 8, 2, 0 };
- if ((extra & 0x4000) == 0) {
+ if (!(extra & 0x4000)) {
*src = regs.fp[(extra >> 10) & 7];
return 1;
}
- mode = (opcode >> 3) & 7;
reg = opcode & 7;
+ mode = (opcode >> 3) & 7;
size = (extra >> 10) & 7;
switch (mode) {
case 0:
break;
case 3:
tmppc = m68k_getpc ();
+ write_log ("####### tpmpc %08lx\n", tmppc);
tmp = next_iword ();
ad = get_disp_ea_020 (tmppc, tmp);
break;
{
uae_u16 tmp;
uaecptr tmppc;
- int size;
- int mode;
- int reg;
+ int size, mode, reg;
uae_u32 ad;
static int sz1[8] = { 4, 4, 12, 12, 2, 8, 1, 0 };
static int sz2[8] = { 4, 4, 12, 12, 2, 8, 2, 0 };
if (!isinrom ())
write_log ("PUTFP: %f %04.4X %04.4X\n", value, opcode, extra);
#endif
- if ((extra & 0x4000) == 0) {
+ if (!(extra & 0x4000)) {
regs.fp[(extra >> 10) & 7] = value;
return 1;
}
- mode = (opcode >> 3) & 7;
reg = opcode & 7;
+ mode = (opcode >> 3) & 7;
size = (extra >> 10) & 7;
ad = -1;
-
switch (mode) {
case 0:
switch (size) {
fptype tmp_fp;
__asm {
-#if USE_LONG_DOUBLE
- fld tbyte ptr src
+ fld LDPTR src
frndint
- fstp tbyte ptr tmp_fp
-#else
- fld qword ptr src
- frndint
- fstp qword ptr tmp_fp
-#endif
+ fstp LDPTR tmp_fp
}
regs.fp[reg] = tmp_fp;
}
comprintf("\tcomp_pc_p=(void*)get_const(PC_P);\n");
break;
case i_Bcc:
- comprintf("\tuae_u32 v,v1,v2;\n");
+ comprintf("\tuae_u32 v1,v2;\n");
genamode (curi->smode, "srcreg", curi->size, "src", 1, 0);
/* That source is an immediate, so we can clobber it with abandon */
switch(curi->size) {
comprintf("\tsub_w_ri(src,1);\n");
comprintf("\t end_needflags();\n");
start_brace();
- comprintf("\tuae_u32 v2,v;\n"
+ comprintf("\tuae_u32 v2;\n"
"\tuae_u32 v1=get_const(PC_P);\n");
comprintf("\tv2=get_const(offs);\n"
"\tregister_branch(v1,v2,3);\n");
"#define PART_6 1\n"
"#define PART_7 1\n"
"#define PART_8 1\n"
- "#endif\n\n");
+ "#endif\n\n"
+ "extern void setzflg_l();\n"
+ "extern void comp_fpp_opp();\n"
+ "extern void comp_fscc_opp();\n"
+ "extern void comp_fbcc_opp();\n\n");
rp = 0;
for (j = 1; j <= 8; ++j)
double val;
uae_u8 status;
uae_u8 realreg;
- uae_u8 realind;
+ uae_u8 realind;
uae_u8 needflush;
} freg_status;
extern int touchcnt;
+#define IMMS uae_s32
#define IMM uae_u32
#define R1 uae_u32
#define R2 uae_u32
#define FRW uae_u32
#define MIDFUNC(nargs,func,args) void func args
-#define MENDFUNC(nargs,func,args)
+#define MENDFUNC(nargs,func,args)
#define COMPCALL(func) func
#define LOWFUNC(flags,mem,nargs,func,args) static __inline__ void func args
-#define LENDFUNC(flags,mem,nargs,func,args)
+#define LENDFUNC(flags,mem,nargs,func,args)
#if USE_OPTIMIZER
#define REGALLOC_O 2
DECLARE(fmov_1(FW r));
DECLARE(fmov_0(FW r));
DECLARE(fmov_rm(FW r, MEMR m));
+DECLARE(fmov_mr(MEMW m, FR r));
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(fmov_mr(MEMW m, FR 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));
cpuop_func* handler_to_use;
/* The direct handler does not check for the correct address */
- cpuop_func* handler;
+ cpuop_func* handler;
cpuop_func* direct_handler;
cpuop_func* direct_pen;
uae_u8* nexthandler;
uae_u8* pc_p;
-
- uae_u32 c1;
+
+ uae_u32 c1;
uae_u32 c2;
uae_u32 len;
struct blockinfo_t* next_same_cl;
- struct blockinfo_t** prev_same_cl_p;
+ struct blockinfo_t** prev_same_cl_p;
struct blockinfo_t* next;
- struct blockinfo_t** prev_p;
+ struct blockinfo_t** prev_p;
- uae_u32 min_pcp;
- uae_u8 optlevel;
- uae_u8 needed_flags;
- uae_u8 status;
+ uae_u32 min_pcp;
+ uae_u8 optlevel;
+ uae_u8 needed_flags;
+ uae_u8 status;
uae_u8 havestate;
-
+
dependency dep[2]; /* Holds things we depend on */
dependency* deplist; /* List of things that depend on this */
smallstate env;
extern int debugging;
extern int exception_debugging;
extern int debug_copper;
+extern int debug_sprite_mask;
extern void debug(void);
extern void activate_debugger(void);
#if USE_LONG_DOUBLE
typedef long double fptype;
+#define LDPTR tbyte ptr
#else
typedef double fptype;
+#define LDPTR qword ptr
#endif
#endif
int gfx_filter_scanlineratio;
int gfx_filter_scanlinelevel;
int gfx_filter_horiz_zoom, gfx_filter_vert_zoom;
+ int gfx_filter_horiz_zoom_mult, gfx_filter_vert_zoom_mult;
int gfx_filter_horiz_offset, gfx_filter_vert_offset;
int gfx_filter_filtermode;
int color_mode;
MakeSR ();
save_u32 (!regs.s ? regs.regs[15] : regs.usp); /* USP */
save_u32 (regs.s ? regs.regs[15] : regs.isp); /* ISP */
- save_u16 (regs.sr); /* SR/CCR */
- save_u32 (regs.stopped ? CPUMODE_HALT : 0); /* flags */
+ save_u16 (regs.sr); /* SR/CCR */
+ save_u32 (regs.stopped ? CPUMODE_HALT : 0); /* flags */
if(model >= 68010) {
save_u32 (regs.dfc); /* DFC */
save_u32 (regs.sfc); /* SFC */
{
int xm, ym;
int fx, fy;
- float x, y, sx, sy;
+ float x, y, sx, sy, tx, ty;
+ double mx, my;
xm = currprefs.gfx_lores ? 2 : 1;
ym = currprefs.gfx_linedbl ? 1 : 2;
+#if 0
if (window_w >= 1024)
xm *= 2;
else if (window_w < 500)
ym *= 2;
else if (window_h < 350)
ym /= 2;
+#endif
fx = (tin_w * xm - window_w) / 2;
fy = (tin_h * ym - window_h) / 2;
- x = (float)(window_w * currprefs.gfx_filter_horiz_offset / 100.0);
- y = (float)(window_h * currprefs.gfx_filter_vert_offset / 100.0);
- sx = x + (float)(twidth * window_w / tin_w) * ((currprefs.gfx_filter_horiz_zoom + 100) / 100.0);
- sy = y + (float)(theight * window_h / tin_h) * ((currprefs.gfx_filter_vert_zoom + 100) / 100.0);
+
+ mx = (currprefs.gfx_filter_horiz_zoom_mult * (currprefs.gfx_filter_horiz_zoom + 100)) / (100.0 * 1000.0);
+ my = (currprefs.gfx_filter_vert_zoom_mult * (currprefs.gfx_filter_vert_zoom + 100)) / (100.0 * 1000.0);
+
+ tx = x = (float)((window_w * currprefs.gfx_filter_horiz_offset / 100.0) * mx);
+ ty = y = (float)((window_h * currprefs.gfx_filter_vert_offset / 100.0) * my);
+ sx = x + (float)((twidth * window_w / tin_w) * mx);
+ sy = y + (float)((theight * window_h / tin_h) * my);
+
x -= fx; y -= fy;
sx += 2 * fx; sy += 2 * fy;
*xp = x; *yp = y;
{ DIK_HOME, INPUTEVENT_KEY_70 },
{ DIK_END, INPUTEVENT_KEY_71 },
{ DIK_SYSRQ, INPUTEVENT_KEY_6E },
- { DIK_F12, INPUTEVENT_KEY_6F },
+// { DIK_F12, INPUTEVENT_KEY_6F },
{ DIK_INSERT, INPUTEVENT_KEY_47 },
{ DIK_PRIOR, INPUTEVENT_KEY_48 },
{ DIK_NEXT, INPUTEVENT_KEY_49 },
STATIC_INLINE long double to_exten(uae_u32 wrd1, uae_u32 wrd2, uae_u32 wrd3)
{
uae_u32 longarray[] = {wrd3,wrd2,((wrd1>>16)&0xffff)}; // little endian
- register long double *longdoublewords = longarray;
+ register long double *longdoublewords = (long double *)longarray;
return(*longdoublewords);
}
STATIC_INLINE void from_exten(long double src, uae_u32 * wrd1, uae_u32 * wrd2, uae_u32 * wrd3)
{
- register uae_u32 *longarray = &src;
- register uae_u16 *finalword = &src + 8;
+ register uae_u32 *longarray = (uae_u32 *)&src;
+ register uae_u16 *finalword = (uae_u16 *)(&src + 8);
*wrd1 = ((uae_u32)*finalword)<<16;
*wrd2 = longarray[1];
static void OGL_dorender (int newtex)
{
- float x1, y1, x2, y2;
+ float x1, y1, x2, y2, tx, ty;
uae_u8 *data = gfxvidinfo.bufmem;
int fx, fy, xm, ym;
glMatrixMode (GL_MODELVIEW);
glLoadIdentity ();
- x1 = (float)(w_width * currprefs.gfx_filter_horiz_offset / 100.0);
- y1 = (float)(w_height * currprefs.gfx_filter_vert_offset / 100.0);
- x2 = x1 + (float)((required_texture_size * w_width / t_width) * (currprefs.gfx_filter_horiz_zoom + 100) / 100.0);
- y2 = y1 + (float)((required_texture_size * w_height / t_height) * (currprefs.gfx_filter_vert_zoom + 100)/ 100.0);
+ tx = x1 = (float)(w_width * currprefs.gfx_filter_horiz_offset / 100.0);
+ ty = y1 = (float)(w_height * currprefs.gfx_filter_vert_offset / 100.0);
+ x2 = x1 + (float)((required_texture_size * w_width / t_width) * ((currprefs.gfx_filter_horiz_zoom_mult * (currprefs.gfx_filter_horiz_zoom + 100)) / (100.0 * 1000.0)));
+ y2 = y1 + (float)((required_texture_size * w_height / t_height) * ((currprefs.gfx_filter_vert_zoom_mult * (currprefs.gfx_filter_vert_zoom + 100)) / (100.0 * 1000.0)));
+ x1 += (x2 - tx) / 2;
+ y1 += (y2 - ty) / 2;
x1 -= fx; y1 -= fy;
x2 += 2 * fx; y2 += 2 * fy;
#define IDC_OPENGLSLR 1625
#define IDC_FILTERSLR 1625
#define IDC_OPENGLSLV 1626
+#define IDC_FILTERHZMULT 1626
#define IDC_OPENGLBITS 1627
#define IDC_OPENGLMODE 1627
#define IDC_FILTERMODE 1627
#define IDC_FILTERPRESETDELETE 1634
#define IDC_HARDDRIVE 1635
#define IDC_INACTIVE_PRI 1635
+#define IDC_FILTERSLR3 1635
+#define IDC_FILTERVZMULT 1635
#define IDC_SOUNDPRIMARY 1636
#define IDC_MINIMIZED_PRI 1636
#define IDC_VOLUME_BOOTPRI_TEXT 1637
COMBOBOX IDC_FILTERMODE,67,15,56,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_FILTERFILTER,128,15,65,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Reset to defaults",IDC_FILTERDEFAULT,197,15,73,14
- RTEXT "Horizontal size:",-1,21,44,61,10,SS_CENTERIMAGE
- CONTROL "Slider1",IDC_FILTERHZ,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,89,37,158,19
- EDITTEXT IDC_FILTERHZV,248,40,34,12,ES_CENTER | ES_READONLY
- RTEXT "Vertical size:",-1,22,64,61,10,SS_CENTERIMAGE
- CONTROL "Slider1",IDC_FILTERVZ,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,89,57,157,19
- EDITTEXT IDC_FILTERVZV,248,59,34,12,ES_CENTER | ES_READONLY
- RTEXT "Horizontal position:",-1,22,84,61,10,SS_CENTERIMAGE
- CONTROL "Slider1",IDC_FILTERHO,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,89,77,157,19
- EDITTEXT IDC_FILTERHOV,248,79,34,12,ES_CENTER | ES_READONLY
- RTEXT "Vertical position:",-1,22,103,61,10,SS_CENTERIMAGE
- CONTROL "Slider1",IDC_FILTERVO,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,89,97,157,19
- EDITTEXT IDC_FILTERVOV,248,101,34,12,ES_CENTER | ES_READONLY
+ RTEXT "Horizontal size:",-1,9,44,59,10,SS_CENTERIMAGE
+ CONTROL "Slider1",IDC_FILTERHZ,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,108,37,142,19
+ EDITTEXT IDC_FILTERHZV,253,40,34,12,ES_CENTER | ES_READONLY
+ RTEXT "Vertical size:",-1,10,64,59,10,SS_CENTERIMAGE
+ CONTROL "Slider1",IDC_FILTERVZ,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,108,57,142,19
+ EDITTEXT IDC_FILTERVZV,253,59,34,12,ES_CENTER | ES_READONLY
+ RTEXT "Horizontal position:",-1,10,84,59,10,SS_CENTERIMAGE
+ CONTROL "Slider1",IDC_FILTERHO,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,108,77,141,19
+ EDITTEXT IDC_FILTERHOV,253,79,34,12,ES_CENTER | ES_READONLY
+ RTEXT "Vertical position:",-1,10,103,59,10,SS_CENTERIMAGE
+ CONTROL "Slider1",IDC_FILTERVO,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,108,99,141,19
+ EDITTEXT IDC_FILTERVOV,253,101,34,12,ES_CENTER | ES_READONLY
RTEXT "Scanlines:",-1,27,133,57,10,SS_CENTERIMAGE
- CONTROL "Slider1",IDC_FILTERSL,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,89,126,157,19
- EDITTEXT IDC_FILTERSLV,248,128,34,12,ES_CENTER | ES_READONLY
+ CONTROL "Slider1",IDC_FILTERSL,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,94,126,157,19
+ EDITTEXT IDC_FILTERSLV,253,128,34,12,ES_CENTER | ES_READONLY
COMBOBOX IDC_FILTERSLR,56,146,27,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
- CONTROL "Slider1",IDC_FILTERSL2,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,89,146,157,19
- EDITTEXT IDC_FILTERSL2V,248,151,34,12,ES_CENTER | ES_READONLY
+ CONTROL "Slider1",IDC_FILTERSL2,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,94,146,157,19
+ EDITTEXT IDC_FILTERSL2V,253,151,34,12,ES_CENTER | ES_READONLY
GROUPBOX "Presets",-1,0,176,296,36
COMBOBOX IDC_FILTERPRESETS,8,190,119,150,CBS_DROPDOWN | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Load",IDC_FILTERPRESETLOAD,132,189,47,14
PUSHBUTTON "Save",IDC_FILTERPRESETSAVE,184,189,47,14
PUSHBUTTON "Delete",IDC_FILTERPRESETDELETE,236,189,47,14
+ COMBOBOX IDC_FILTERHZMULT,77,43,27,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
+ COMBOBOX IDC_FILTERVZMULT,77,63,27,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP
END
IDD_HARDDRIVE DIALOGEX 0, 0, 300, 66
#if !defined(WIN64)
/* believe or not but this is MS supported way of detecting DX8+ */
HMODULE h = LoadLibrary("D3D8.DLL");
- char szWrongDXVersion[ MAX_DPATH ];
+ char szWrongDXVersion[MAX_DPATH];
if (h) {
FreeLibrary (h);
return 1;
}
- WIN32GUI_LoadUIString( IDS_WRONGDXVERSION, szWrongDXVersion, MAX_DPATH );
- pre_gui_message( szWrongDXVersion );
+ WIN32GUI_LoadUIString(IDS_WRONGDXVERSION, szWrongDXVersion, MAX_DPATH);
+ pre_gui_message(szWrongDXVersion);
return 0;
#else
return 1;
int isadmin = 0;
// Open a handle to the access token for the calling process.
- if (!OpenProcessToken( GetCurrentProcess(), TOKEN_QUERY, &hToken )) {
- write_log ( "OpenProcessToken Error %u\n", GetLastError() );
+ if (!OpenProcessToken( GetCurrentProcess(), TOKEN_QUERY, &hToken)) {
+ write_log ("OpenProcessToken Error %u\n", GetLastError());
return FALSE;
}
// Call GetTokenInformation to get the buffer size.
if(!GetTokenInformation(hToken, TokenGroups, NULL, dwSize, &dwSize)) {
dwResult = GetLastError();
- if( dwResult != ERROR_INSUFFICIENT_BUFFER ) {
- write_log( "GetTokenInformation Error %u\n", dwResult );
+ if(dwResult != ERROR_INSUFFICIENT_BUFFER) {
+ write_log("GetTokenInformation Error %u\n", dwResult);
return FALSE;
}
}
// Allocate the buffer.
- pGroupInfo = (PTOKEN_GROUPS) GlobalAlloc( GPTR, dwSize );
+ pGroupInfo = (PTOKEN_GROUPS)GlobalAlloc(GPTR, dwSize);
// Call GetTokenInformation again to get the group information.
- if(! GetTokenInformation(hToken, TokenGroups, pGroupInfo, dwSize, &dwSize ) ) {
- write_log ( "GetTokenInformation Error %u\n", GetLastError() );
+ if(!GetTokenInformation(hToken, TokenGroups, pGroupInfo, dwSize, &dwSize)) {
+ write_log ("GetTokenInformation Error %u\n", GetLastError());
return FALSE;
}
// Create a SID for the BUILTIN\Administrators group.
- if(! AllocateAndInitializeSid( &SIDAuth, 2,
+ if(!AllocateAndInitializeSid(&SIDAuth, 2,
SECURITY_BUILTIN_DOMAIN_RID,
DOMAIN_ALIAS_RID_ADMINS,
0, 0, 0, 0, 0, 0,
- &pSID) ) {
+ &pSID)) {
write_log( "AllocateAndInitializeSid Error %u\n", GetLastError() );
return FALSE;
}
// Loop through the group SIDs looking for the administrator SID.
- for(i=0; i<pGroupInfo->GroupCount; i++) {
- if ( EqualSid(pSID, pGroupInfo->Groups[i].Sid) )
+ for(i = 0; i < pGroupInfo->GroupCount; i++) {
+ if (EqualSid(pSID, pGroupInfo->Groups[i].Sid))
isadmin = 1;
}
if (pSID)
FreeSid(pSID);
- if ( pGroupInfo )
- GlobalFree( pGroupInfo );
+ if (pGroupInfo)
+ GlobalFree(pGroupInfo);
return isadmin;
}
}
p = getenv("AMIGAFOREVERDATA");
- if (p && 0) {
+ if (p) {
strcpy (tmp, p);
fixtrailing(tmp);
strcpy (start_path_af, p);
extern int mouseactive, focus;
extern int ignore_messages_all;
#define WINUAEBETA 1
-#define WINUAEBETASTR " Beta 2"
+#define WINUAEBETASTR " Beta 3"
extern char start_path_exe[MAX_DPATH];
extern char start_path_data[MAX_DPATH];
sptr = gfxvidinfo.bufmem;
endsptr = gfxvidinfo.realbufmem + (amiga_height - 1) * 3 * gfxvidinfo.rowbytes;
- v = currprefs.gfx_filter_horiz_offset;
+ v = currprefs.gfx_filter_horiz_offset / 10;
v += (dst_width / scale - amiga_width) / 8;
sptr += -v * (amiga_depth / 8) * 4;
aw -= -v * 4;
- v = currprefs.gfx_filter_vert_offset;
+ v = currprefs.gfx_filter_vert_offset / 10;
v += (dst_height / scale - amiga_height) / 8;
sptr += -v * gfxvidinfo.rowbytes * 4;
ah -= -v * 4;
if (aw < 16)
return;
- if (currprefs.gfx_filter_horiz_zoom || currprefs.gfx_filter_vert_zoom) {
- sr.left = currprefs.gfx_filter_horiz_zoom * 2;
- sr.top = currprefs.gfx_filter_vert_zoom * 2;
- sr.right = dst_width - currprefs.gfx_filter_horiz_zoom * 2;
- sr.bottom = dst_height - currprefs.gfx_filter_vert_zoom * 2;
+ if (currprefs.gfx_filter_horiz_zoom || currprefs.gfx_filter_vert_zoom ||
+ currprefs.gfx_filter_horiz_zoom_mult != 1000 ||
+ currprefs.gfx_filter_vert_zoom_mult != 1000) {
+ int wz = dst_width * currprefs.gfx_filter_horiz_zoom_mult / 1000;
+ int hz = dst_height * currprefs.gfx_filter_vert_zoom_mult / 1000;
+ wz += currprefs.gfx_filter_horiz_zoom / 4;
+ hz += currprefs.gfx_filter_vert_zoom / 4;
+ sr.left = (dst_width - wz) / 2;
+ sr.top = (dst_height - hz) / 2;
+ sr.right = sr.left + wz;
+ sr.bottom = sr.top + hz;
dr.left = dr.top = 0;
dr.right = dst_width;
dr.bottom = dst_height;
dr.left = -sr.left;
sr.left = 0;
}
- if (sr.right > dst_width) {
+ if (sr.right - sr.left > dst_width) {
dr.right = dst_width - (sr.right - dst_width);
- sr.right = dst_width;
+ sr.right = sr.left + dst_width;
}
if (sr.top >= sr.bottom) {
sr.top = dst_height / 2 - 1;
dr.top = -sr.top;
sr.top = 0;
}
- if (sr.bottom > dst_height) {
+ if (sr.bottom - sr.top > dst_height) {
dr.bottom = dst_height - (sr.bottom - dst_height);
- sr.bottom = dst_height;
+ sr.bottom = sr.top + dst_height;
}
if (tempsurf && sr.left != 0 || sr.top != 0 || sr.right != dst_width || sr.bottom != dst_height ||
if (amiga_depth == dst_depth) {
int y;
for (y = 0; y < dst_height; y++) {
- if (sptr < endsptr)
+ if (sptr < endsptr && sptr >= gfxvidinfo.bufmem)
memcpy (dptr, sptr, dst_width * dst_depth / 8);
else
memset (dptr, 0, dst_width * dst_depth / 8);
},
{
1, "Fullscreen",
+// DM_OVERLAY | DM_W_FULLSCREEN | DM_DX_DIRECT | DM_DDRAW,
DM_DX_FULLSCREEN | DM_DX_DIRECT | DM_DDRAW,
DM_DX_FULLSCREEN | DM_DX_DIRECT | DM_DDRAW | DM_PICASSO96
},
write_log( "set_ddraw: Couldn't GetDisplayMode()\n" );
goto oops;
}
-#if 0
- } else if (wfullscreen) {
- if (!do_changedisplaysettings (width, height, bits, currentmode->frequency))
- goto oops2;
-#endif
}
if (dd) {
BOOL CALLBACK displaysCallback (GUID *guid, LPSTR desc, LPSTR name, LPVOID ctx, HMONITOR hm)
{
struct MultiDisplay *md = Displays;
+ MONITORINFOEX lpmi;
while (md->name) {
if (md - Displays >= MAX_DISPLAYS)
md++;
}
md->name = my_strdup (desc);
- if (guid == 0)
+ if (guid == 0) {
+ POINT pt = { 0, 0 };
md->primary = 1;
- else
+ lpmi.cbSize = sizeof (lpmi);
+ GetMonitorInfo(MonitorFromPoint(pt, MONITOR_DEFAULTTOPRIMARY), (LPMONITORINFO)&lpmi);
+ md->rect = lpmi.rcMonitor;
+ } else {
memcpy (&md->guid, guid, sizeof (GUID));
+ }
write_log ("'%s' '%s' %s\n", desc, name, outGUID(guid));
return 1;
}
static int create_windows (void)
{
- int fs = currentmode->flags & (DM_W_FULLSCREEN | DM_DX_FULLSCREEN | DM_D3D_FULLSCREEN);
+ int dxfs = currentmode->flags & (DM_DX_FULLSCREEN | DM_D3D_FULLSCREEN);
+ int fsw = currentmode->flags & (DM_W_FULLSCREEN);
DWORD exstyle = currprefs.win32_notaskbarbutton ? 0 : WS_EX_APPWINDOW;
DWORD flags = 0;
HWND hhWnd = currprefs.win32_notaskbarbutton ? hHiddenWnd : NULL;
if (borderless)
cymenu = cyborder = cxborder = 0;
- if (!fs) {
+ if (!dxfs) {
RECT rc;
LONG stored_x = 1, stored_y = cymenu + cyborder;
DWORD regkeytype;
int oldx, oldy;
int first = 2;
- RegQueryValueEx( hWinUAEKey, "xPos", 0, ®keytype, (LPBYTE)&stored_x, ®keysize );
- RegQueryValueEx( hWinUAEKey, "yPos", 0, ®keytype, (LPBYTE)&stored_y, ®keysize );
+ RegQueryValueEx(hWinUAEKey, "xPos", 0, ®keytype, (LPBYTE)&stored_x, ®keysize);
+ RegQueryValueEx(hWinUAEKey, "yPos", 0, ®keytype, (LPBYTE)&stored_y, ®keysize);
while (first) {
first--;
}
break;
}
-#if 0
- if (currprefs.gfx_display > 0) {
+
+ if (fsw) {
rc = Displays[currprefs.gfx_display].rect;
flags |= WS_EX_TOPMOST;
style = WS_POPUP;
+ currentmode->current_width = rc.right - rc.left;
+ currentmode->current_height = rc.bottom - rc.top;
}
-#endif
+
flags |= (currprefs.win32_alwaysontop ? WS_EX_TOPMOST : 0);
if (!borderless) {
write_log ("main window creation failed\n");
return 0;
}
- createstatuswindow ();
+ if (!(currentmode->flags & DM_W_FULLSCREEN))
+ createstatuswindow ();
} else {
x = rc.left;
y = rc.top;
}
- hAmigaWnd = CreateWindowEx (fs ? WS_EX_ACCEPTFILES | WS_EX_TOPMOST : WS_EX_ACCEPTFILES | exstyle | (currprefs.win32_alwaysontop ? WS_EX_TOPMOST : 0),
+ hAmigaWnd = CreateWindowEx (dxfs ? WS_EX_ACCEPTFILES | WS_EX_TOPMOST : WS_EX_ACCEPTFILES | exstyle | (currprefs.win32_alwaysontop ? WS_EX_TOPMOST : 0),
"AmigaPowah", "WinUAE",
WS_CLIPCHILDREN | WS_CLIPSIBLINGS | (hMainWnd ? WS_VISIBLE | WS_CHILD : WS_VISIBLE | WS_POPUP),
x, y,
}
/* if drive is -1, show the full GUI, otherwise file-requester for DF[drive] */
-void gui_display( int shortcut )
+void gui_display(int shortcut)
{
+ static int here;
int flipflop = 0;
HRESULT hr;
+ if (here)
+ return;
+ here++;
screenshot_prepare();
#ifdef D3D
D3D_guimode (TRUE);
DX_SetPalette (0, 256);
#endif
screenshot_free();
+ here--;
}
static void prefs_to_gui (struct uae_prefs *p)
char txt[100];
int cw;
- CheckDlgButton (hDlg, IDC_SOCKETS, workprefs.socket_emu);
- CheckDlgButton (hDlg, IDC_ILLEGAL, workprefs.illegal_mem);
- CheckDlgButton (hDlg, IDC_SHOWGUI, workprefs.start_gui);
- CheckDlgButton (hDlg, IDC_JULIAN, workprefs.win32_middle_mouse);
- CheckDlgButton (hDlg, IDC_CREATELOGFILE, workprefs.win32_logfile);
- CheckDlgButton (hDlg, IDC_INACTIVE_PAUSE, workprefs.win32_inactive_pause);
- CheckDlgButton (hDlg, IDC_INACTIVE_NOSOUND, workprefs.win32_inactive_nosound || workprefs.win32_inactive_pause);
- CheckDlgButton (hDlg, IDC_MINIMIZED_PAUSE, workprefs.win32_iconified_pause);
- CheckDlgButton (hDlg, IDC_MINIMIZED_NOSOUND, workprefs.win32_iconified_nosound || workprefs.win32_iconified_pause);
- CheckDlgButton (hDlg, IDC_CTRLF11, workprefs.win32_ctrl_F11_is_quit);
- CheckDlgButton (hDlg, IDC_NOOVERLAY, workprefs.win32_no_overlay);
- CheckDlgButton (hDlg, IDC_SHOWLEDS, workprefs.leds_on_screen);
- CheckDlgButton (hDlg, IDC_SCSIDEVICE, workprefs.scsi);
- CheckDlgButton (hDlg, IDC_NOTASKBARBUTTON, workprefs.win32_notaskbarbutton);
- CheckDlgButton (hDlg, IDC_ALWAYSONTOP, workprefs.win32_alwaysontop);
- CheckDlgButton (hDlg, IDC_CLOCKSYNC, workprefs.tod_hack);
- cw = catweasel_detect();
- EnableWindow (GetDlgItem (hDlg, IDC_CATWEASEL), cw);
- if (!cw && workprefs.catweasel < 100)
- workprefs.catweasel = 0;
- CheckDlgButton (hDlg, IDC_CATWEASEL, workprefs.catweasel);
- CheckDlgButton (hDlg, IDC_STATE_CAPTURE, workprefs.statecapture);
-
- misc_kbled (hDlg, IDC_KBLED1, workprefs.keyboard_leds[0]);
- misc_kbled (hDlg, IDC_KBLED2, workprefs.keyboard_leds[1]);
- misc_kbled (hDlg, IDC_KBLED3, workprefs.keyboard_leds[2]);
-
- misc_addpri (hDlg, IDC_ACTIVE_PRIORITY, workprefs.win32_active_priority);
- misc_addpri (hDlg, IDC_INACTIVE_PRIORITY, workprefs.win32_inactive_priority);
- misc_addpri (hDlg, IDC_MINIMIZED_PRIORITY, workprefs.win32_iconified_priority);
-
- SendDlgItemMessage (hDlg, IDC_STATE_RATE, CB_RESETCONTENT, 0, 0);
- SendDlgItemMessage (hDlg, IDC_STATE_RATE, CB_ADDSTRING, 0, (LPARAM)"1");
- SendDlgItemMessage (hDlg, IDC_STATE_RATE, CB_ADDSTRING, 0, (LPARAM)"5");
- SendDlgItemMessage (hDlg, IDC_STATE_RATE, CB_ADDSTRING, 0, (LPARAM)"10");
- SendDlgItemMessage (hDlg, IDC_STATE_RATE, CB_ADDSTRING, 0, (LPARAM)"20");
- SendDlgItemMessage (hDlg, IDC_STATE_RATE, CB_ADDSTRING, 0, (LPARAM)"30");
- sprintf (txt, "%d", workprefs.statecapturerate / 50);
- SendDlgItemMessage( hDlg, IDC_STATE_RATE, WM_SETTEXT, 0, (LPARAM)txt);
-
- SendDlgItemMessage (hDlg, IDC_STATE_BUFFERSIZE, CB_RESETCONTENT, 0, 0);
- SendDlgItemMessage (hDlg, IDC_STATE_BUFFERSIZE, CB_ADDSTRING, 0, (LPARAM)"5");
- SendDlgItemMessage (hDlg, IDC_STATE_BUFFERSIZE, CB_ADDSTRING, 0, (LPARAM)"10");
- SendDlgItemMessage (hDlg, IDC_STATE_BUFFERSIZE, CB_ADDSTRING, 0, (LPARAM)"20");
- SendDlgItemMessage (hDlg, IDC_STATE_BUFFERSIZE, CB_ADDSTRING, 0, (LPARAM)"50");
- SendDlgItemMessage (hDlg, IDC_STATE_BUFFERSIZE, CB_ADDSTRING, 0, (LPARAM)"100");
- sprintf (txt, "%d", workprefs.statecapturebuffersize / (1024 * 1024));
- SendDlgItemMessage( hDlg, IDC_STATE_BUFFERSIZE, WM_SETTEXT, 0, (LPARAM)txt);
-
- misc_scsi(hDlg);
+ if (currentpage == MISC1_ID) {
+
+ CheckDlgButton (hDlg, IDC_SOCKETS, workprefs.socket_emu);
+ CheckDlgButton (hDlg, IDC_ILLEGAL, workprefs.illegal_mem);
+ CheckDlgButton (hDlg, IDC_SHOWGUI, workprefs.start_gui);
+ CheckDlgButton (hDlg, IDC_JULIAN, workprefs.win32_middle_mouse);
+ CheckDlgButton (hDlg, IDC_CREATELOGFILE, workprefs.win32_logfile);
+ CheckDlgButton (hDlg, IDC_INACTIVE_PAUSE, workprefs.win32_inactive_pause);
+ CheckDlgButton (hDlg, IDC_INACTIVE_NOSOUND, workprefs.win32_inactive_nosound || workprefs.win32_inactive_pause);
+ CheckDlgButton (hDlg, IDC_MINIMIZED_PAUSE, workprefs.win32_iconified_pause);
+ CheckDlgButton (hDlg, IDC_MINIMIZED_NOSOUND, workprefs.win32_iconified_nosound || workprefs.win32_iconified_pause);
+ CheckDlgButton (hDlg, IDC_CTRLF11, workprefs.win32_ctrl_F11_is_quit);
+ CheckDlgButton (hDlg, IDC_NOOVERLAY, workprefs.win32_no_overlay);
+ CheckDlgButton (hDlg, IDC_SHOWLEDS, workprefs.leds_on_screen);
+ CheckDlgButton (hDlg, IDC_SCSIDEVICE, workprefs.scsi);
+ CheckDlgButton (hDlg, IDC_NOTASKBARBUTTON, workprefs.win32_notaskbarbutton);
+ CheckDlgButton (hDlg, IDC_ALWAYSONTOP, workprefs.win32_alwaysontop);
+ CheckDlgButton (hDlg, IDC_CLOCKSYNC, workprefs.tod_hack);
+ cw = catweasel_detect();
+ EnableWindow (GetDlgItem (hDlg, IDC_CATWEASEL), cw);
+ if (!cw && workprefs.catweasel < 100)
+ workprefs.catweasel = 0;
+ CheckDlgButton (hDlg, IDC_CATWEASEL, workprefs.catweasel);
+ CheckDlgButton (hDlg, IDC_STATE_CAPTURE, workprefs.statecapture);
+
+ misc_kbled (hDlg, IDC_KBLED1, workprefs.keyboard_leds[0]);
+ misc_kbled (hDlg, IDC_KBLED2, workprefs.keyboard_leds[1]);
+ misc_kbled (hDlg, IDC_KBLED3, workprefs.keyboard_leds[2]);
+
+ SendDlgItemMessage (hDlg, IDC_STATE_RATE, CB_RESETCONTENT, 0, 0);
+ SendDlgItemMessage (hDlg, IDC_STATE_RATE, CB_ADDSTRING, 0, (LPARAM)"1");
+ SendDlgItemMessage (hDlg, IDC_STATE_RATE, CB_ADDSTRING, 0, (LPARAM)"5");
+ SendDlgItemMessage (hDlg, IDC_STATE_RATE, CB_ADDSTRING, 0, (LPARAM)"10");
+ SendDlgItemMessage (hDlg, IDC_STATE_RATE, CB_ADDSTRING, 0, (LPARAM)"20");
+ SendDlgItemMessage (hDlg, IDC_STATE_RATE, CB_ADDSTRING, 0, (LPARAM)"30");
+ sprintf (txt, "%d", workprefs.statecapturerate / 50);
+ SendDlgItemMessage( hDlg, IDC_STATE_RATE, WM_SETTEXT, 0, (LPARAM)txt);
+
+ SendDlgItemMessage (hDlg, IDC_STATE_BUFFERSIZE, CB_RESETCONTENT, 0, 0);
+ SendDlgItemMessage (hDlg, IDC_STATE_BUFFERSIZE, CB_ADDSTRING, 0, (LPARAM)"5");
+ SendDlgItemMessage (hDlg, IDC_STATE_BUFFERSIZE, CB_ADDSTRING, 0, (LPARAM)"10");
+ SendDlgItemMessage (hDlg, IDC_STATE_BUFFERSIZE, CB_ADDSTRING, 0, (LPARAM)"20");
+ SendDlgItemMessage (hDlg, IDC_STATE_BUFFERSIZE, CB_ADDSTRING, 0, (LPARAM)"50");
+ SendDlgItemMessage (hDlg, IDC_STATE_BUFFERSIZE, CB_ADDSTRING, 0, (LPARAM)"100");
+ sprintf (txt, "%d", workprefs.statecapturebuffersize / (1024 * 1024));
+ SendDlgItemMessage( hDlg, IDC_STATE_BUFFERSIZE, WM_SETTEXT, 0, (LPARAM)txt);
+
+ misc_scsi(hDlg);
+
+ } else if (currentpage == MISC2_ID) {
+
+ misc_addpri (hDlg, IDC_ACTIVE_PRIORITY, workprefs.win32_active_priority);
+ misc_addpri (hDlg, IDC_INACTIVE_PRIORITY, workprefs.win32_inactive_priority);
+ misc_addpri (hDlg, IDC_MINIMIZED_PRIORITY, workprefs.win32_iconified_priority);
+
+ }
}
static INT_PTR MiscDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
char txt[100];
int v;
+ static int recursive;
+
+ if (recursive)
+ return FALSE;
+ recursive++;
switch (msg)
{
case WM_USER:
values_to_miscdlg (hDlg);
enable_for_miscdlg (hDlg);
+ recursive--;
return TRUE;
case WM_COMMAND:
workprefs.win32_kbledmode = IsDlgButtonChecked (hDlg, IDC_KBLED_USB) ? 1 : 0;
break;
}
+ recursive--;
return TRUE;
}
+ recursive--;
return FALSE;
}
static INT_PTR CALLBACK MiscDlgProc1 (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
+ currentpage = MISC1_ID;
if (msg == WM_INITDIALOG) {
pages[MISC1_ID] = hDlg;
- currentpage = MISC1_ID;
values_to_miscdlg (hDlg);
enable_for_miscdlg (hDlg);
return TRUE;
static INT_PTR CALLBACK MiscDlgProc2 (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
+ currentpage = MISC2_ID;
if (msg == WM_INITDIALOG) {
pages[MISC2_ID] = hDlg;
- currentpage = MISC2_ID;
values_to_miscdlg (hDlg);
enable_for_miscdlg (hDlg);
return TRUE;
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_FILTERHO), v);
EnableWindow (GetDlgItem (hDlg, IDC_FILTERVO), v);
EnableWindow (GetDlgItem (hDlg, IDC_FILTERSLR), vv2);
strcat (s, " (32bit)");
}
+static char *filtermultnames[] = { "1", "2", "4", "6", "8", NULL };
+static int filtermults[] = { 1000, 500, 250, 167, 125 };
static void values_to_hw3ddlg (HWND hDlg)
{
char txt[100], tmp[100];
struct uae_filter *uf;
HKEY fkey;
- SendDlgItemMessage( hDlg, IDC_FILTERHZ, TBM_SETRANGE, TRUE, MAKELONG (-99, +99) );
- SendDlgItemMessage( hDlg, IDC_FILTERHZ, TBM_SETPAGESIZE, 0, 1 );
- SendDlgItemMessage( hDlg, IDC_FILTERVZ, TBM_SETRANGE, TRUE, MAKELONG (-99, +99) );
- SendDlgItemMessage( hDlg, IDC_FILTERVZ, TBM_SETPAGESIZE, 0, 1 );
- SendDlgItemMessage( hDlg, IDC_FILTERHO, TBM_SETRANGE, TRUE, MAKELONG (-99, +99) );
- SendDlgItemMessage( hDlg, IDC_FILTERHO, TBM_SETPAGESIZE, 0, 1 );
- SendDlgItemMessage( hDlg, IDC_FILTERVO, TBM_SETRANGE, TRUE, MAKELONG (-50, +50) );
- SendDlgItemMessage( hDlg, IDC_FILTERVO, TBM_SETPAGESIZE, 0, 1 );
- SendDlgItemMessage( hDlg, IDC_FILTERSL, TBM_SETRANGE, TRUE, MAKELONG ( 0, +100) );
- SendDlgItemMessage( hDlg, IDC_FILTERSL, TBM_SETPAGESIZE, 0, 10 );
- SendDlgItemMessage( hDlg, IDC_FILTERSL2, TBM_SETRANGE, TRUE, MAKELONG ( 0, +100) );
- SendDlgItemMessage( hDlg, IDC_FILTERSL2, TBM_SETPAGESIZE, 0, 10 );
+ SendDlgItemMessage(hDlg, IDC_FILTERHZ, TBM_SETRANGE, TRUE, MAKELONG (-999, +999));
+ SendDlgItemMessage(hDlg, IDC_FILTERHZ, TBM_SETPAGESIZE, 0, 10);
+ SendDlgItemMessage(hDlg, IDC_FILTERVZ, TBM_SETRANGE, TRUE, MAKELONG (-999, +999));
+ SendDlgItemMessage(hDlg, IDC_FILTERVZ, TBM_SETPAGESIZE, 0, 10);
+ SendDlgItemMessage(hDlg, IDC_FILTERHO, TBM_SETRANGE, TRUE, MAKELONG (-999, +999));
+ SendDlgItemMessage(hDlg, IDC_FILTERHO, TBM_SETPAGESIZE, 0, 10);
+ SendDlgItemMessage(hDlg, IDC_FILTERVO, TBM_SETRANGE, TRUE, MAKELONG (-999, +999));
+ SendDlgItemMessage(hDlg, IDC_FILTERVO, TBM_SETPAGESIZE, 0, 10);
+ SendDlgItemMessage(hDlg, IDC_FILTERSL, TBM_SETRANGE, TRUE, MAKELONG ( 0, +1000));
+ SendDlgItemMessage(hDlg, IDC_FILTERSL, TBM_SETPAGESIZE, 0, 10);
+ SendDlgItemMessage(hDlg, IDC_FILTERSL2, TBM_SETRANGE, TRUE, MAKELONG ( 0, +1000));
+ SendDlgItemMessage(hDlg, IDC_FILTERSL2, TBM_SETPAGESIZE, 0, 10);
SendDlgItemMessage (hDlg, IDC_FILTERMODE, CB_RESETCONTENT, 0, 0L);
uf = &uaefilters[0];
}
i++;
}
- SendDlgItemMessage( hDlg, IDC_FILTERMODE, CB_SETCURSEL, fltnum, 0 );
+ SendDlgItemMessage (hDlg, IDC_FILTERMODE, CB_SETCURSEL, fltnum, 0);
SendDlgItemMessage (hDlg, IDC_FILTERFILTER, CB_RESETCONTENT, 0, 0L);
if (uf->x[0]) {
workprefs.gfx_filter_filtermode = 0;
SendDlgItemMessage (hDlg, IDC_FILTERFILTER, CB_SETCURSEL, workprefs.gfx_filter_filtermode, 0);
+ SendDlgItemMessage (hDlg, IDC_FILTERHZMULT, CB_RESETCONTENT, 0, 0L);
+ SendDlgItemMessage (hDlg, IDC_FILTERVZMULT, CB_RESETCONTENT, 0, 0L);
+ for (i = 0; filtermultnames[i]; i++) {
+ SendDlgItemMessage (hDlg, IDC_FILTERHZMULT, CB_ADDSTRING, 0, (LPARAM)filtermultnames[i]);
+ SendDlgItemMessage (hDlg, IDC_FILTERVZMULT, CB_ADDSTRING, 0, (LPARAM)filtermultnames[i]);
+ }
+ SendDlgItemMessage (hDlg, IDC_FILTERHZMULT, CB_SETCURSEL, 0, 0);
+ SendDlgItemMessage (hDlg, IDC_FILTERVZMULT, CB_SETCURSEL, 0, 0);
+ for (i = 0; filtermultnames[i]; i++) {
+ if (filtermults[i] == workprefs.gfx_filter_horiz_zoom_mult)
+ SendDlgItemMessage (hDlg, IDC_FILTERHZMULT, CB_SETCURSEL, i, 0);
+ if (filtermults[i] == workprefs.gfx_filter_vert_zoom_mult)
+ SendDlgItemMessage (hDlg, IDC_FILTERVZMULT, CB_SETCURSEL, i, 0);
+ }
+
SendDlgItemMessage (hDlg, IDC_FILTERSLR, CB_RESETCONTENT, 0, 0L);
i = j = 0;
while (scanlineratios[i * 2]) {
ok = 1;
if (wParam == IDC_FILTERPRESETSAVE) {
- sprintf (tmp2, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",
+ sprintf (tmp2, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",
p->gfx_filter, p->gfx_filter_filtermode,
p->gfx_filter_vert_zoom, p->gfx_filter_horiz_zoom,
+ p->gfx_filter_vert_zoom_mult, p->gfx_filter_horiz_zoom_mult,
p->gfx_filter_vert_offset, p->gfx_filter_horiz_offset,
p->gfx_filter_scanlines, p->gfx_filter_scanlinelevel, p->gfx_filter_scanlineratio,
p->gfx_lores, p->gfx_linedbl, p->gfx_correct_aspect,
s = t; t = strchr (s, ','); if (!t) goto end; *t++ = 0;
p->gfx_filter_horiz_zoom = atol (s);
s = t; t = strchr (s, ','); if (!t) goto end; *t++ = 0;
+ p->gfx_filter_vert_zoom_mult = atol (s);
+ s = t; t = strchr (s, ','); if (!t) goto end; *t++ = 0;
+ p->gfx_filter_horiz_zoom_mult = atol (s);
+ s = t; t = strchr (s, ','); if (!t) goto end; *t++ = 0;
p->gfx_filter_vert_offset = atol (s);
s = t; t = strchr (s, ','); if (!t) goto end; *t++ = 0;
p->gfx_filter_horiz_offset = atol (s);
updatedisplayarea ();
}
+static int getfiltermult(HWND hDlg, DWORD dlg)
+{
+ int v = SendDlgItemMessage (hDlg, dlg, CB_GETCURSEL, 0, 0L);
+ if (v == CB_ERR)
+ return 1000;
+ return filtermults[v];
+}
+
static INT_PTR CALLBACK hw3dDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
static int recursive;
case IDC_FILTERFILTER:
filter_handle (hDlg);
break;
+ case IDC_FILTERHZMULT:
+ case IDC_FILTERVZMULT:
+ currprefs.gfx_filter_horiz_zoom_mult = workprefs.gfx_filter_horiz_zoom_mult = getfiltermult(hDlg, IDC_FILTERHZMULT);
+ currprefs.gfx_filter_vert_zoom_mult = workprefs.gfx_filter_vert_zoom_mult = getfiltermult(hDlg, IDC_FILTERVZMULT);
+ updatedisplayarea ();
+ WIN32GFX_WindowMove ();
+ break;
}
}
break;
recursive--;
break;
case WM_HSCROLL:
- currprefs.gfx_filter_horiz_zoom = workprefs.gfx_filter_horiz_zoom = (int)SendMessage( GetDlgItem( hDlg, IDC_FILTERHZ ), TBM_GETPOS, 0, 0 );
- currprefs.gfx_filter_vert_zoom = workprefs.gfx_filter_vert_zoom = (int)SendMessage( GetDlgItem( hDlg, IDC_FILTERVZ ), TBM_GETPOS, 0, 0 );
- currprefs.gfx_filter_horiz_offset = workprefs.gfx_filter_horiz_offset = (int)SendMessage( GetDlgItem( hDlg, IDC_FILTERHO ), TBM_GETPOS, 0, 0 );
- currprefs.gfx_filter_vert_offset = workprefs.gfx_filter_vert_offset = (int)SendMessage( GetDlgItem( hDlg, IDC_FILTERVO ), TBM_GETPOS, 0, 0 );
- currprefs.gfx_filter_scanlines = workprefs.gfx_filter_scanlines = (int)SendMessage( GetDlgItem( hDlg, IDC_FILTERSL ), TBM_GETPOS, 0, 0 );
- currprefs.gfx_filter_scanlinelevel = workprefs.gfx_filter_scanlinelevel = (int)SendMessage( GetDlgItem( hDlg, IDC_FILTERSL2 ), TBM_GETPOS, 0, 0 );
+ currprefs.gfx_filter_horiz_zoom = workprefs.gfx_filter_horiz_zoom = (int)SendMessage(GetDlgItem(hDlg, IDC_FILTERHZ), TBM_GETPOS, 0, 0 );
+ currprefs.gfx_filter_vert_zoom = workprefs.gfx_filter_vert_zoom = (int)SendMessage(GetDlgItem(hDlg, IDC_FILTERVZ), TBM_GETPOS, 0, 0 );
+ currprefs.gfx_filter_horiz_offset = workprefs.gfx_filter_horiz_offset = (int)SendMessage(GetDlgItem(hDlg, IDC_FILTERHO), TBM_GETPOS, 0, 0);
+ currprefs.gfx_filter_vert_offset = workprefs.gfx_filter_vert_offset = (int)SendMessage(GetDlgItem(hDlg, IDC_FILTERVO), TBM_GETPOS, 0, 0);
+ currprefs.gfx_filter_scanlines = workprefs.gfx_filter_scanlines = (int)SendMessage(GetDlgItem(hDlg, IDC_FILTERSL), TBM_GETPOS, 0, 0);
+ currprefs.gfx_filter_scanlinelevel = workprefs.gfx_filter_scanlinelevel = (int)SendMessage(GetDlgItem(hDlg, IDC_FILTERSL2), TBM_GETPOS, 0, 0);
SetDlgItemInt (hDlg, IDC_FILTERHZV, workprefs.gfx_filter_horiz_zoom, TRUE);
SetDlgItemInt (hDlg, IDC_FILTERVZV, workprefs.gfx_filter_vert_zoom, TRUE);
SetDlgItemInt (hDlg, IDC_FILTERHOV, workprefs.gfx_filter_horiz_offset, TRUE);
-#include "globals.h"
-#include "extern.h"
+#include "../rippers/globals.h"
+#include "../rippers/extern.h"
/*