26.05.2010

parent 362b9d4a
...@@ -554,13 +554,16 @@ static void led_vsync (void) ...@@ -554,13 +554,16 @@ static void led_vsync (void)
v = 255; v = 255;
else if (led_cycles_off && !led_cycles_on) else if (led_cycles_off && !led_cycles_on)
v = 0; v = 0;
else else if (led_cycles_off)
v = led_cycles_on * 255 / led_cycles_off; v = led_cycles_on * 255 / led_cycles_off;
if (v < 0) else
v = 0; v = 255;
if (v > 255)
v = 255; if (v < 0)
gui_data.powerled_brightness = v; v = 0;
if (v > 255)
v = 255;
gui_data.powerled_brightness = v;
led_cycles_on = 0; led_cycles_on = 0;
led_cycles_off = 0; led_cycles_off = 0;
if (led_old_brightness != gui_data.powerled_brightness) { if (led_old_brightness != gui_data.powerled_brightness) {
...@@ -606,12 +609,13 @@ static void bfe001_change (void) ...@@ -606,12 +609,13 @@ static void bfe001_change (void)
//activate_debugger (); //activate_debugger ();
map_overlay (0); map_overlay (0);
} }
}
#ifdef CD32 #ifdef CD32
} else if (currprefs.cs_cd32cd && (v & 1) != oldcd32mute) { if (currprefs.cs_cd32cd && (v & 1) != oldcd32mute) {
oldcd32mute = v & 1; oldcd32mute = v & 1;
akiko_mute (oldcd32mute ? 0 : 1); akiko_mute (oldcd32mute ? 0 : 1);
#endif
} }
#endif
} }
static uae_u8 ReadCIAA (unsigned int addr) static uae_u8 ReadCIAA (unsigned int addr)
...@@ -1207,6 +1211,10 @@ void CIA_reset (void) ...@@ -1207,6 +1211,10 @@ void CIA_reset (void)
#endif #endif
if (savestate_state) { if (savestate_state) {
bfe001_change (); bfe001_change ();
if (!currprefs.cs_ciaoverlay) {
map_overlay (1);
oldovl = false;
}
/* select drives */ /* select drives */
DISK_select (ciabprb); DISK_select (ciabprb);
} }
......
...@@ -134,8 +134,7 @@ STATIC_INLINE int comp_fp_get (uae_u32 opcode, uae_u16 extra, int treg) ...@@ -134,8 +134,7 @@ STATIC_INLINE int comp_fp_get (uae_u32 opcode, uae_u16 extra, int treg)
} }
case 2: /* (d16,PC) */ case 2: /* (d16,PC) */
{ {
uae_u32 address=start_pc+((uae_char*)comp_pc_p-(uae_char*)start_pc_p)+ uae_u32 address=start_pc+((uae_char*)comp_pc_p-(uae_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); uae_s32 PC16off =(uae_s32)(uae_s16)comp_get_iword((m68k_pc_offset+=2)-2);
mov_l_ri(S1,address+PC16off); mov_l_ri(S1,address+PC16off);
break; break;
...@@ -179,8 +178,7 @@ STATIC_INLINE int comp_fp_get (uae_u32 opcode, uae_u16 extra, int treg) ...@@ -179,8 +178,7 @@ STATIC_INLINE int comp_fp_get (uae_u32 opcode, uae_u16 extra, int treg)
} }
case 5: case 5:
{ {
uae_u32 longarray[] = {comp_get_ilong(m68k_pc_offset-4), uae_u32 longarray[] = {comp_get_ilong(m68k_pc_offset-4), comp_get_ilong(m68k_pc_offset-8)};
comp_get_ilong(m68k_pc_offset-8)};
float si = (float)*(double *)longarray; float si = (float)*(double *)longarray;
if (*(double *)longarray == (double)si) { if (*(double *)longarray == (double)si) {
...@@ -209,49 +207,49 @@ STATIC_INLINE int comp_fp_get (uae_u32 opcode, uae_u16 extra, int treg) ...@@ -209,49 +207,49 @@ STATIC_INLINE int comp_fp_get (uae_u32 opcode, uae_u16 extra, int treg)
} }
switch (size) { switch (size) {
case 0: /* Long */ case 0: /* Long */
readlong(S1,S2,S3); readlong(S1,S2,S3);
mov_l_mr((uae_u32)temp_fp,S2); mov_l_mr((uae_u32)temp_fp,S2);
fmovi_rm(treg,(uae_u32)temp_fp); fmovi_rm(treg,(uae_u32)temp_fp);
return 2; return 2;
case 1: /* Single */ case 1: /* Single */
readlong(S1,S2,S3); readlong(S1,S2,S3);
mov_l_mr((uae_u32)temp_fp,S2); mov_l_mr((uae_u32)temp_fp,S2);
fmovs_rm(treg,(uae_u32)temp_fp); fmovs_rm(treg,(uae_u32)temp_fp);
return 1; return 1;
case 2: /* Long Double */ case 2: /* Long Double */
readword(S1,S2,S3); readword(S1,S2,S3);
mov_w_mr(((uae_u32)temp_fp)+8,S2); mov_w_mr(((uae_u32)temp_fp)+8,S2);
add_l_ri(S1,4); add_l_ri(S1,4);
readlong(S1,S2,S3); readlong(S1,S2,S3);
mov_l_mr((uae_u32)(temp_fp)+4,S2); mov_l_mr((uae_u32)(temp_fp)+4,S2);
add_l_ri(S1,4); add_l_ri(S1,4);
readlong(S1,S2,S3); readlong(S1,S2,S3);
mov_l_mr((uae_u32)(temp_fp),S2); mov_l_mr((uae_u32)(temp_fp),S2);
fmov_ext_rm(treg,(uae_u32)(temp_fp)); fmov_ext_rm(treg,(uae_u32)(temp_fp));
return 0; return 0;
case 4: /* Word */ case 4: /* Word */
readword(S1,S2,S3); readword(S1,S2,S3);
sign_extend_16_rr(S2,S2); sign_extend_16_rr(S2,S2);
mov_l_mr((uae_u32)temp_fp,S2); mov_l_mr((uae_u32)temp_fp,S2);
fmovi_rm(treg,(uae_u32)temp_fp); fmovi_rm(treg,(uae_u32)temp_fp);
return 1; return 1;
case 5: /* Double */ case 5: /* Double */
readlong(S1,S2,S3); readlong(S1,S2,S3);
mov_l_mr(((uae_u32)temp_fp)+4,S2); mov_l_mr(((uae_u32)temp_fp)+4,S2);
add_l_ri(S1,4); add_l_ri(S1,4);
readlong(S1,S2,S3); readlong(S1,S2,S3);
mov_l_mr((uae_u32)(temp_fp),S2); mov_l_mr((uae_u32)(temp_fp),S2);
fmov_rm(treg,(uae_u32)(temp_fp)); fmov_rm(treg,(uae_u32)(temp_fp));
return 2; return 2;
case 6: /* Byte */ case 6: /* Byte */
readbyte(S1,S2,S3); readbyte(S1,S2,S3);
sign_extend_8_rr(S2,S2); sign_extend_8_rr(S2,S2);
mov_l_mr((uae_u32)temp_fp,S2); mov_l_mr((uae_u32)temp_fp,S2);
fmovi_rm(treg,(uae_u32)temp_fp); fmovi_rm(treg,(uae_u32)temp_fp);
return 1; return 1;
default: default:
return -1; return -1;
} }
return -1; return -1;
} }
...@@ -265,152 +263,153 @@ STATIC_INLINE int comp_fp_put (uae_u32 opcode, uae_u16 extra) ...@@ -265,152 +263,153 @@ STATIC_INLINE int comp_fp_put (uae_u32 opcode, uae_u16 extra)
int size = (extra >> 10) & 7; int size = (extra >> 10) & 7;
if (size == 3 || size == 7) /* 3 = packed decimal, 7 is not defined */ if (size == 3 || size == 7) /* 3 = packed decimal, 7 is not defined */
return -1; return -1;
switch (mode) { switch (mode) {
case 0: /* Dn */ case 0: /* Dn */
switch (size) { switch (size) {
case 0: /* FMOVE.L FPx, Dn */ case 0: /* FMOVE.L FPx, Dn */
#if USE_X86_FPUCW && 0 #if USE_X86_FPUCW && 0
if (!(regs.fpcr & 0xf0)) { /* if extended round to nearest */ if (!(regs.fpcr & 0xf0)) { /* if extended round to nearest */
mov_l_ri(S1,0x10); /* use extended round to zero mode */ mov_l_ri(S1,0x10); /* use extended round to zero mode */
fldcw_m_indexed(S1,(uae_u32)x86_fpucw); fldcw_m_indexed(S1,(uae_u32)x86_fpucw);
fmovi_mrb((uae_u32)temp_fp,sreg, clamp_bounds.l); fmovi_mrb((uae_u32)temp_fp,sreg, clamp_bounds.l);
mov_l_rm(reg,(uae_u32)temp_fp); mov_l_rm(reg,(uae_u32)temp_fp);
mov_l_rm(S1,(uae_u32)&regs.fpcr); mov_l_rm(S1,(uae_u32)&regs.fpcr);
and_l_ri(S1,0xf0); /* restore control word */ and_l_ri(S1,0xf0); /* restore control word */
fldcw_m_indexed(S1,(uae_u32)x86_fpucw); fldcw_m_indexed(S1,(uae_u32)x86_fpucw);
return 0; return 0;
} }
#endif #endif
fmovi_mrb((uae_u32)temp_fp,sreg, clamp_bounds.l); fmovi_mrb((uae_u32)temp_fp,sreg, clamp_bounds.l);
mov_l_rm(reg,(uae_u32)temp_fp); mov_l_rm(reg,(uae_u32)temp_fp);
return 0; return 0;
case 1: /* FMOVE.S FPx, Dn */ case 1: /* FMOVE.S FPx, Dn */
fmovs_mr((uae_u32)temp_fp,sreg); fmovs_mr((uae_u32)temp_fp,sreg);
mov_l_rm(reg,(uae_u32)temp_fp); mov_l_rm(reg,(uae_u32)temp_fp);
return 0; return 0;
case 4: /* FMOVE.W FPx, Dn */ case 4: /* FMOVE.W FPx, Dn */
#if USE_X86_FPUCW && 0 #if USE_X86_FPUCW && 0
if (!(regs.fpcr & 0xf0)) { /* if extended round to nearest */ if (!(regs.fpcr & 0xf0)) { /* if extended round to nearest */
mov_l_ri(S1,0x10); /* use extended round to zero mode */ mov_l_ri(S1,0x10); /* use extended round to zero mode */
fldcw_m_indexed(S1,(uae_u32)x86_fpucw); fldcw_m_indexed(S1,(uae_u32)x86_fpucw);
fmovi_mrb((uae_u32)temp_fp,sreg, clamp_bounds.w); fmovi_mrb((uae_u32)temp_fp,sreg, clamp_bounds.w);
mov_w_rm(reg,(uae_u32)temp_fp); mov_w_rm(reg,(uae_u32)temp_fp);
mov_l_rm(S1,(uae_u32)&regs.fpcr); mov_l_rm(S1,(uae_u32)&regs.fpcr);
and_l_ri(S1,0xf0); /* restore control word */ and_l_ri(S1,0xf0); /* restore control word */
fldcw_m_indexed(S1,(uae_u32)x86_fpucw); fldcw_m_indexed(S1,(uae_u32)x86_fpucw);
return 0; return 0;
} }
#endif #endif
fmovi_mrb((uae_u32)temp_fp,sreg, clamp_bounds.w); fmovi_mrb((uae_u32)temp_fp,sreg, clamp_bounds.w);
mov_w_rm(reg,(uae_u32)temp_fp); mov_w_rm(reg,(uae_u32)temp_fp);
return 0; return 0;
case 6: /* FMOVE.B FPx, Dn */ case 6: /* FMOVE.B FPx, Dn */
#if USE_X86_FPUCW && 0 #if USE_X86_FPUCW && 0
if (!(regs.fpcr & 0xf0)) { /* if extended round to nearest */ if (!(regs.fpcr & 0xf0)) { /* if extended round to nearest */
mov_l_ri(S1,0x10); /* use extended round to zero mode */ mov_l_ri(S1,0x10); /* use extended round to zero mode */
fldcw_m_indexed(S1,(uae_u32)x86_fpucw); fldcw_m_indexed(S1,(uae_u32)x86_fpucw);
fmovi_mrb((uae_u32)temp_fp,sreg, clamp_bounds.b); fmovi_mrb((uae_u32)temp_fp,sreg, clamp_bounds.b);
mov_b_rm(reg,(uae_u32)temp_fp); mov_b_rm(reg,(uae_u32)temp_fp);
mov_l_rm(S1,(uae_u32)&regs.fpcr); mov_l_rm(S1,(uae_u32)&regs.fpcr);
and_l_ri(S1,0xf0); /* restore control word */ and_l_ri(S1,0xf0); /* restore control word */
fldcw_m_indexed(S1,(uae_u32)x86_fpucw); fldcw_m_indexed(S1,(uae_u32)x86_fpucw);
return 0; return 0;
} }
#endif #endif
fmovi_mrb((uae_u32)temp_fp,sreg, clamp_bounds.b); fmovi_mrb((uae_u32)temp_fp,sreg, clamp_bounds.b);
mov_b_rm(reg,(uae_u32)temp_fp); mov_b_rm(reg,(uae_u32)temp_fp);
return 0; return 0;
default: default:
return -1; return -1;
} }
case 1: /* An, invalid mode */ case 1: /* An, invalid mode */
return -1; return -1;
case 2: /* (An) */ case 2: /* (An) */
mov_l_rr(S1,reg+8); mov_l_rr(S1,reg+8);
break; break;
case 3: /* (An)+ */ case 3: /* (An)+ */
mov_l_rr(S1,reg+8); mov_l_rr(S1,reg+8);
lea_l_brr(reg+8,reg+8,(reg == 7?sz2[size]:sz1[size])); lea_l_brr(reg+8,reg+8,(reg == 7?sz2[size]:sz1[size]));
break; break;
case 4: /* -(An) */ case 4: /* -(An) */
lea_l_brr(reg+8,reg+8,-(reg == 7?sz2[size]:sz1[size])); lea_l_brr(reg+8,reg+8,-(reg == 7?sz2[size]:sz1[size]));
mov_l_rr(S1,reg+8); mov_l_rr(S1,reg+8);
break; break;
case 5: /* (d16,An) */ case 5: /* (d16,An) */
{ {
uae_u32 off=(uae_s32)(uae_s16)comp_get_iword((m68k_pc_offset+=2)-2); uae_u32 off=(uae_s32)(uae_s16)comp_get_iword((m68k_pc_offset+=2)-2);
mov_l_rr(S1,reg+8); mov_l_rr(S1,reg+8);
add_l_ri(S1,off); add_l_ri(S1,off);
break; break;
} }
case 6: /* (d8,An,Xn) or (bd,An,Xn) or ([bd,An,Xn],od) or ([bd,An],Xn,od) */ 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); uae_u32 dp=comp_get_iword((m68k_pc_offset+=2)-2);
calc_disp_ea_020(reg+8,dp,S1,S2); calc_disp_ea_020(reg+8,dp,S1,S2);
break; break;
} }
case 7: case 7:
switch (reg) { switch (reg) {
case 0: /* (xxx).W */ case 0: /* (xxx).W */
{ {
uae_u32 off=(uae_s32)(uae_s16)comp_get_iword((m68k_pc_offset+=2)-2); uae_u32 off=(uae_s32)(uae_s16)comp_get_iword((m68k_pc_offset+=2)-2);
mov_l_ri(S1,off); mov_l_ri(S1,off);
break; break;
} }
case 1: /* (xxx).L */ case 1: /* (xxx).L */
{ {
uae_u32 off=comp_get_ilong((m68k_pc_offset+=4)-4); uae_u32 off=comp_get_ilong((m68k_pc_offset+=4)-4);
mov_l_ri(S1,off); mov_l_ri(S1,off);
break; break;
} }
default: /* All other modes are not allowed for FPx to <EA> */ 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); write_log ("JIT FMOVE FPx,<EA> Mode is not allowed %04x %04x\n",opcode,extra);
return -1; return -1;
} }
} }
switch (size) { switch (size) {
case 0: /* Long */ case 0: /* Long */
fmovi_mrb((uae_u32)temp_fp,sreg, clamp_bounds.l); fmovi_mrb((uae_u32)temp_fp,sreg, clamp_bounds.l);
mov_l_rm(S2,(uae_u32)temp_fp); mov_l_rm(S2,(uae_u32)temp_fp);
writelong_clobber(S1,S2,S3); writelong_clobber(S1,S2,S3);
return 0; return 0;
case 1: /* Single */ case 1: /* Single */
fmovs_mr((uae_u32)temp_fp,sreg); fmovs_mr((uae_u32)temp_fp,sreg);
mov_l_rm(S2,(uae_u32)temp_fp); mov_l_rm(S2,(uae_u32)temp_fp);
writelong_clobber(S1,S2,S3); writelong_clobber(S1,S2,S3);
return 0; return 0;
case 2:/* Long Double */ case 2:/* Long Double */
fmov_ext_mr((uae_u32)temp_fp,sreg); fmov_ext_mr((uae_u32)temp_fp,sreg);
mov_w_rm(S2,(uae_u32)temp_fp+8); mov_w_rm(S2,(uae_u32)temp_fp+8);
writeword_clobber(S1,S2,S3); writeword_clobber(S1,S2,S3);
add_l_ri(S1,4); add_l_ri(S1,4);
mov_l_rm(S2,(uae_u32)temp_fp+4); mov_l_rm(S2,(uae_u32)temp_fp+4);
writelong_clobber(S1,S2,S3); writelong_clobber(S1,S2,S3);
add_l_ri(S1,4); add_l_ri(S1,4);
mov_l_rm(S2,(uae_u32)temp_fp); mov_l_rm(S2,(uae_u32)temp_fp);
writelong_clobber(S1,S2,S3); writelong_clobber(S1,S2,S3);
return 0; return 0;
case 4: /* Word */ case 4: /* Word */
fmovi_mrb((uae_u32)temp_fp,sreg, clamp_bounds.w); fmovi_mrb((uae_u32)temp_fp,sreg, clamp_bounds.w);
mov_l_rm(S2,(uae_u32)temp_fp); mov_l_rm(S2,(uae_u32)temp_fp);
writeword_clobber(S1,S2,S3); writeword_clobber(S1,S2,S3);
return 0; return 0;
case 5: /* Double */ case 5: /* Double */
fmov_mr((uae_u32)temp_fp,sreg); fmov_mr((uae_u32)temp_fp,sreg);
mov_l_rm(S2,(uae_u32)temp_fp+4); mov_l_rm(S2,(uae_u32)temp_fp+4);
writelong_clobber(S1,S2,S3); writelong_clobber(S1,S2,S3);
add_l_ri(S1,4); add_l_ri(S1,4);
mov_l_rm(S2,(uae_u32)temp_fp); mov_l_rm(S2,(uae_u32)temp_fp);
writelong_clobber(S1,S2,S3); writelong_clobber(S1,S2,S3);
return 0; return 0;
case 6: /* Byte */ case 6: /* Byte */
fmovi_mrb((uae_u32)temp_fp,sreg, clamp_bounds.b); fmovi_mrb((uae_u32)temp_fp,sreg, clamp_bounds.b);
mov_l_rm(S2,(uae_u32)temp_fp); mov_l_rm(S2,(uae_u32)temp_fp);
writebyte(S1,S2,S3); writebyte(S1,S2,S3);
return 0; return 0;
default: default:
return -1; return -1;
} }
return -1; return -1;
} }
...@@ -423,29 +422,29 @@ STATIC_INLINE int comp_fp_adr (uae_u32 opcode) ...@@ -423,29 +422,29 @@ STATIC_INLINE int comp_fp_adr (uae_u32 opcode)
int reg = opcode & 7; int reg = opcode & 7;
switch (mode) { switch (mode) {
case 2: case 2:
case 3: case 3:
case 4: case 4:
mov_l_rr(S1,8+reg); mov_l_rr(S1,8+reg);
return S1; return S1;
case 5: case 5:
off=(uae_s32)(uae_s16)comp_get_iword((m68k_pc_offset+=2)-2); off=(uae_s32)(uae_s16)comp_get_iword((m68k_pc_offset+=2)-2);
mov_l_rr(S1,8+reg); mov_l_rr(S1,8+reg);
add_l_ri(S1,off); add_l_ri(S1,off);
return S1; return S1;
case 7: case 7:
switch (reg) { switch (reg) {
case 0: case 0:
off=(uae_s32)(uae_s16)comp_get_iword((m68k_pc_offset+=2)-2); off=(uae_s32)(uae_s16)comp_get_iword((m68k_pc_offset+=2)-2);
mov_l_ri(S1,off); mov_l_ri(S1,off);
return S1; return S1;
case 1: case 1:
off=comp_get_ilong((m68k_pc_offset+=4)-4); off=comp_get_ilong((m68k_pc_offset+=4)-4);
mov_l_ri(S1,off); mov_l_ri(S1,off);
return S1; return S1;
} }
default: default:
return -1; return -1;
} }
} }
...@@ -462,55 +461,89 @@ void comp_fscc_opp (uae_u32 opcode, uae_u16 extra) ...@@ -462,55 +461,89 @@ void comp_fscc_opp (uae_u32 opcode, uae_u16 extra)
int reg; int reg;
if (!currprefs.compfpu) { if (!currprefs.compfpu) {
FAIL(1); FAIL(1);
return; return;
} }
#if DEBUG_FPP #if DEBUG_FPP
write_log ("JIT: fscc_opp at %08lx\n", M68K_GETPC); write_log ("JIT: fscc_opp at %08lx\n", M68K_GETPC);
#endif #endif
if (extra&0x20) { /* only cc from 00 to 1f are defined */ if (extra & 0x20) { /* only cc from 00 to 1f are defined */
FAIL(1); FAIL(1);
return; return;
} }
if ((opcode & 0x38) != 0) { /* We can only do to integer register */ if ((opcode & 0x38) != 0) { /* We can only do to integer register */
FAIL(1); FAIL(1);
return; return;
} }
fflags_into_flags(S2); fflags_into_flags(S2);
reg=(opcode&7); reg = (opcode & 7);
mov_l_ri(S1,255); mov_l_ri(S1,255);
mov_l_ri(S4,0); mov_l_ri(S4,0);
switch(extra&0x0f) { /* according to fpp.c, the 0x10 bit is ignored */
case 0: break; /* set never */ switch (extra & 0x0f) { /* according to fpp.c, the 0x10 bit is ignored */
case 1: mov_l_rr(S2,S4); case 0: break; /* set never */
cmov_l_rr(S4,S1,4); case 1:
cmov_l_rr(S4,S2,10); break; mov_l_rr(S2,S4);
case 2: cmov_l_rr(S4,S1,7); break; cmov_l_rr(S4,S1,4);
case 3: cmov_l_rr(S4,S1,3); break; cmov_l_rr(S4,S2,10);
case 4: mov_l_rr(S2,S4); break;
cmov_l_rr(S4,S1,2); case 2:
cmov_l_rr(S4,S2,10); break; cmov_l_rr(S4,S1,7);
case 5: mov_l_rr(S2,S4); break;
cmov_l_rr(S4,S1,6); case 3:
cmov_l_rr(S4,S2,10); break; cmov_l_rr(S4,S1,3);
case 6: cmov_l_rr(S4,S1,5); break; break;
case 7: cmov_l_rr(S4,S1,11); break; case 4:
case 8: cmov_l_rr(S4,S1,10); break; mov_l_rr(S2,S4);
case 9: cmov_l_rr(S4,S1,4); break; cmov_l_rr(S4,S1,2);
case 10: cmov_l_rr(S4,S1,10); cmov_l_rr(S4,S1,7); break; cmov_l_rr(S4,S2,10);
case 11: cmov_l_rr(S4,S1,4); cmov_l_rr(S4,S1,3); break; break;
case 12: cmov_l_rr(S4,S1,2); break; case 5:
case 13: cmov_l_rr(S4,S1,6); break; mov_l_rr(S2,S4);
case 14: cmov_l_rr(S4,S1,5); cmov_l_rr(S4,S1,10); break; cmov_l_rr(S4,S1,6);
case 15: mov_l_rr(S4,S1); break; cmov_l_rr(S4,S2,10);
} break;
case 6:
cmov_l_rr(S4,S1,5);
break;
case 7:
cmov_l_rr(S4,S1,11);
break;
case 8:
cmov_l_rr(S4,S1,10);
break;
case 9:
cmov_l_rr(S4,S1,4);
break;
case 10:
cmov_l_rr(S4,S1,10);
cmov_l_rr(S4,S1,7);
break;
case 11:
cmov_l_rr(S4,S1,4);
cmov_l_rr(S4,S1,3);
break;
case 12:
cmov_l_rr(S4,S1,2);
break;
case 13:
cmov_l_rr(S4,S1,6);
break;
case 14:
cmov_l_rr(S4,S1,5);
cmov_l_rr(S4,S1,10);
break;
case 15:
mov_l_rr(S4,S1);
break;
}
if (!(opcode & 0x38)) if (!(opcode & 0x38))
mov_b_rr(reg,S4); mov_b_rr(reg,S4);
#if 0 #if 0
else { else {
abort(); abort();
...@@ -539,22 +572,20 @@ void comp_fbcc_opp (uae_u32 opcode) ...@@ -539,22 +572,20 @@ void comp_fbcc_opp (uae_u32 opcode)
int cc; int cc;
if (!currprefs.compfpu) { if (!currprefs.compfpu) {
FAIL(1); FAIL(1);
return; return;
} }
if (opcode&0x20) { /* only cc from 00 to 1f are defined */ if (opcode & 0x20) { /* only cc from 00 to 1f are defined */
FAIL(1); FAIL(1);
return; return;
}
if (!(opcode&0x40)) {
off=(uae_s32)(uae_s16)comp_get_iword((m68k_pc_offset+=2)-2);
} }
else { if (!(opcode & 0x40)) {
off=comp_get_ilong((m68k_pc_offset+=4)-4); off = (uae_s32)(uae_s16)comp_get_iword((m68k_pc_offset+=2)-2);
} else {
off = comp_get_ilong((m68k_pc_offset+=4)-4);
} }
mov_l_ri(S1,(uae_u32) mov_l_ri(S1,(uae_u32)(comp_pc_p+off-(m68k_pc_offset-start_68k_offset)));
(comp_pc_p+off-(m68k_pc_offset-start_68k_offset)));
mov_l_ri(PC_P,(uae_u32)comp_pc_p); mov_l_ri(PC_P,(uae_u32)comp_pc_p);
/* Now they are both constant. Might as well fold in m68k_pc_offset */ /* Now they are both constant. Might as well fold in m68k_pc_offset */
...@@ -565,18 +596,19 @@ void comp_fbcc_opp (uae_u32 opcode) ...@@ -565,18 +596,19 @@ void comp_fbcc_opp (uae_u32 opcode)
/* according to fpp.c, the 0x10 bit is ignored /* according to fpp.c, the 0x10 bit is ignored
(it handles exception handling, which we don't (it handles exception handling, which we don't
do, anyway ;-) */ do, anyway ;-) */
cc=opcode&0x0f; cc = opcode & 0x0f;
v1=get_const(PC_P); v1 = get_const(PC_P);
v2=get_const(S1); v2 = get_const(S1);
fflags_into_flags(S2); fflags_into_flags(S2);
// mov_l_mi((uae_u32)&foink3,cc); // mov_l_mi((uae_u32)&foink3,cc);
switch(cc) { switch(cc) {
case 0: break; /* jump never */ case 0: break; /* jump never */
case 1: case 1:
mov_l_rr(S2,PC_P); mov_l_rr(S2,PC_P);
cmov_l_rr(PC_P,S1,4); cmov_l_rr(PC_P,S1,4);
cmov_l_rr(PC_P,S2,10); break; cmov_l_rr(PC_P,S2,10);
break;
case 2: register_branch(v1,v2,7); break; case 2: register_branch(v1,v2,7); break;
case 3: register_branch(v1,v2,3); break; case 3: register_branch(v1,v2,3); break;
case 4: case 4:
...@@ -704,91 +736,91 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) ...@@ -704,91 +736,91 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra)
int opmode = extra & 0x7f; int opmode = extra & 0x7f;
if (!currprefs.compfpu) { if (!currprefs.compfpu) {
FAIL(1); FAIL(1);
return; return;
} }
switch (source) { switch (source) {
case 3: /* FMOVE FPx, <EA> */ case 3: /* FMOVE FPx, <EA> */
if (comp_fp_put(opcode,extra) < 0) if (comp_fp_put(opcode,extra) < 0)
FAIL(1); FAIL(1);
return; return;
case 4: /* FMOVE.L <EA>, ControlReg */ case 4: /* FMOVE.L <EA>, ControlReg */
if (!(opcode & 0x30)) { /* Dn or An */ if (!(opcode & 0x30)) { /* Dn or An */
if (extra & 0x1000) { /* FPCR */ if (extra & 0x1000) { /* FPCR */
mov_l_mr((uae_u32)&regs.fpcr,opcode & 15); mov_l_mr((uae_u32)&regs.fpcr,opcode & 15);
#if USE_X86_FPUCW #if USE_X86_FPUCW
mov_l_rr(S1,opcode & 15); mov_l_rr(S1,opcode & 15);
and_l_ri(S1,0xf0); and_l_ri(S1,0xf0);
fldcw_m_indexed(S1,(uae_u32)x86_fpucw); fldcw_m_indexed(S1,(uae_u32)x86_fpucw);
#endif #endif
return; return;
} }
if (extra & 0x0800) { /* FPSR */ if (extra & 0x0800) { /* FPSR */
FAIL(1); FAIL(1);
return; return;
// set_fpsr(m68k_dreg (regs, opcode & 15)); // set_fpsr(m68k_dreg (regs, opcode & 15));
} }
if (extra & 0x0400) { /* FPIAR */ if (extra & 0x0400) { /* FPIAR */
mov_l_mr((uae_u32)&regs.fpiar,opcode & 15); return; mov_l_mr((uae_u32)&regs.fpiar,opcode & 15); return;
} }
} } else if ((opcode & 0x3f) == 0x3c) {
else if ((opcode & 0x3f) == 0x3c) { if (extra & 0x1000) { /* FPCR */
if (extra & 0x1000) { /* FPCR */ uae_u32 val=comp_get_ilong((m68k_pc_offset+=4)-4);
uae_u32 val=comp_get_ilong((m68k_pc_offset+=4)-4); mov_l_mi((uae_u32)&regs.fpcr,val);
mov_l_mi((uae_u32)&regs.fpcr,val);
#if USE_X86_FPUCW #if USE_X86_FPUCW
mov_l_ri(S1,val&0xf0); mov_l_ri(S1,val&0xf0);
fldcw_m_indexed(S1,(uae_u32)x86_fpucw); fldcw_m_indexed(S1,(uae_u32)x86_fpucw);
#endif #endif
return; return;
} }
if (extra & 0x0800) { /* FPSR */ if (extra & 0x0800) { /* FPSR */
FAIL(1); FAIL(1);
return; return;
} }
if (extra & 0x0400) { /* FPIAR */ if (extra & 0x0400) { /* FPIAR */
uae_u32 val=comp_get_ilong((m68k_pc_offset+=4)-4); uae_u32 val=comp_get_ilong((m68k_pc_offset+=4)-4);
mov_l_mi((uae_u32)&regs.fpiar,val); mov_l_mi((uae_u32)&regs.fpiar,val);
return; return;
} }
}
FAIL(1);
return;
case 5: /* FMOVE.L ControlReg, <EA> */
if (!(opcode & 0x30)) { /* Dn or An */
if (extra & 0x1000) { /* FPCR */
mov_l_rm(opcode & 15,(uae_u32)&regs.fpcr); return;
}
if (extra & 0x0800) { /* FPSR */
FAIL(1);
return;
} }
if (extra & 0x0400) { /* FPIAR */ FAIL(1);
mov_l_rm(opcode & 15,(uae_u32)&regs.fpiar); return; return;
case 5: /* FMOVE.L ControlReg, <EA> */
if (!(opcode & 0x30)) { /* Dn or An */
if (extra & 0x1000) { /* FPCR */
mov_l_rm(opcode & 15,(uae_u32)&regs.fpcr); return;
}
if (extra & 0x0800) { /* FPSR */
FAIL(1);
return;
}
if (extra & 0x0400) { /* FPIAR */
mov_l_rm(opcode & 15,(uae_u32)&regs.fpiar); return;
}
} }
} FAIL(1);
FAIL(1); return;
return; case 6:
case 6: case 7:
case 7: {
{
uae_u32 list = 0; uae_u32 list = 0;
int incr = 0; int incr = 0;
if (extra & 0x2000) { if (extra & 0x2000) {
uae_u32 ad; uae_u32 ad;
/* FMOVEM FPP->memory */ /* FMOVEM FPP->memory */
switch ((extra >> 11) & 3) { /* Get out early if failure */ switch ((extra >> 11) & 3) { /* Get out early if failure */
case 0: case 0:
case 2: case 2:
break; break;
case 1: case 1:
case 3: case 3:
default: default:
FAIL(1); return; FAIL(1);
return;
} }
ad=comp_fp_adr (opcode); ad = comp_fp_adr (opcode);
if (ad<0) { if (ad < 0) {
m68k_setpc (m68k_getpc () - 4); m68k_setpc (m68k_getpc () - 4);
op_illg (opcode); op_illg (opcode);
return; return;
...@@ -806,37 +838,36 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) ...@@ -806,37 +838,36 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra)
case 3: /* dynamic postinc */ case 3: /* dynamic postinc */
abort(); abort();
} }
if (incr < 0) { /* Predecrement */ if (incr < 0) { /* Predecrement */
for (reg = 7; reg >= 0; reg--) { for (reg = 7; reg >= 0; reg--) {
if (list & 0x80) { if (list & 0x80) {
fmov_ext_mr((uintptr)temp_fp,reg); fmov_ext_mr((uintptr)temp_fp,reg);
sub_l_ri(ad,4); sub_l_ri(ad,4);
mov_l_rm(S2,(uintptr)temp_fp); mov_l_rm(S2,(uintptr)temp_fp);
writelong_clobber(ad,S2,S3); writelong_clobber(ad,S2,S3);
sub_l_ri(ad,4); sub_l_ri(ad,4);
mov_l_rm(S2,(uintptr)temp_fp+4); mov_l_rm(S2,(uintptr)temp_fp+4);
writelong_clobber(ad,S2,S3); writelong_clobber(ad,S2,S3);
sub_l_ri(ad,4); sub_l_ri(ad,4);
mov_w_rm(S2,(uintptr)temp_fp+8); mov_w_rm(S2,(uintptr)temp_fp+8);
writeword_clobber(ad,S2,S3); writeword_clobber(ad,S2,S3);
} }
list <<= 1; list <<= 1;
} }
} } else { /* Postincrement */
else { /* Postincrement */
for (reg = 0; reg <= 7; reg++) { for (reg = 0; reg <= 7; reg++) {
if (list & 0x80) { if (list & 0x80) {
fmov_ext_mr((uintptr)temp_fp,reg); fmov_ext_mr((uintptr)temp_fp,reg);
mov_w_rm(S2,(uintptr)temp_fp+8); mov_w_rm(S2,(uintptr)temp_fp+8);
writeword_clobber(ad,S2,S3); writeword_clobber(ad,S2,S3);
add_l_ri(ad,4); add_l_ri(ad,4);
mov_l_rm(S2,(uintptr)temp_fp+4); mov_l_rm(S2,(uintptr)temp_fp+4);
writelong_clobber(ad,S2,S3); writelong_clobber(ad,S2,S3);
add_l_ri(ad,4); add_l_ri(ad,4);
mov_l_rm(S2,(uintptr)temp_fp); mov_l_rm(S2,(uintptr)temp_fp);
writelong_clobber(ad,S2,S3); writelong_clobber(ad,S2,S3);
add_l_ri(ad,4); add_l_ri(ad,4);
} }
list <<= 1; list <<= 1;
} }
} }
...@@ -849,16 +880,17 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) ...@@ -849,16 +880,17 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra)
uae_u32 ad; uae_u32 ad;
switch ((extra >> 11) & 3) { /* Get out early if failure */ switch ((extra >> 11) & 3) { /* Get out early if failure */
case 0: case 0:
case 2: case 2:
break; break;
case 1: case 1:
case 3: case 3:
default: default:
FAIL(1); return; FAIL(1);
return;
} }
ad=comp_fp_adr (opcode); ad=comp_fp_adr (opcode);
if (ad<0) { if (ad < 0) {
m68k_setpc (m68k_getpc () - 4); m68k_setpc (m68k_getpc () - 4);
op_illg (opcode); op_illg (opcode);
return; return;
...@@ -874,28 +906,26 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) ...@@ -874,28 +906,26 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra)
break; break;
case 1: /* dynamic pred */ case 1: /* dynamic pred */
case 3: /* dynamic postinc */ case 3: /* dynamic postinc */
abort(); abort();
} }
if (incr < 0) { if (incr < 0) { // not reached
// not reached
for (reg = 7; reg >= 0; reg--) { for (reg = 7; reg >= 0; reg--) {
if (list & 0x80) { if (list & 0x80) {
sub_l_ri(ad,4); sub_l_ri(ad,4);
readlong(ad,S2,S3); readlong(ad,S2,S3);
mov_l_mr((uintptr)(temp_fp),S2); mov_l_mr((uintptr)(temp_fp),S2);
sub_l_ri(ad,4); sub_l_ri(ad,4);
readlong(ad,S2,S3); readlong(ad,S2,S3);
mov_l_mr((uintptr)(temp_fp)+4,S2); mov_l_mr((uintptr)(temp_fp)+4,S2);
sub_l_ri(ad,4); sub_l_ri(ad,4);
readword(ad,S2,S3); readword(ad,S2,S3);
mov_w_mr(((uintptr)temp_fp)+8,S2); mov_w_mr(((uintptr)temp_fp)+8,S2);
fmov_ext_rm(reg,(uintptr)(temp_fp)); fmov_ext_rm(reg,(uintptr)(temp_fp));
} }
list <<= 1; list <<= 1;
} }
} } else {
else {
for (reg = 0; reg <= 7; reg++) { for (reg = 0; reg <= 7; reg++) {
if (list & 0x80) { if (list & 0x80) {
readword(ad,S2,S3); readword(ad,S2,S3);
...@@ -994,63 +1024,63 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) ...@@ -994,63 +1024,63 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra)
FAIL(1); FAIL(1);
return; return;
#endif #endif
case 2: /* from <EA> to FPx */ case 2: /* from <EA> to FPx */
dont_care_fflags(); dont_care_fflags();
if ((extra & 0xfc00) == 0x5c00) { /* FMOVECR */ if ((extra & 0xfc00) == 0x5c00) { /* FMOVECR */
//write_log ("JIT FMOVECR %x\n", opmode); //write_log ("JIT FMOVECR %x\n", opmode);
switch (opmode) { switch (opmode) {
case 0x00: case 0x00:
fmov_pi(dreg); fmov_pi(dreg);
break; break;
case 0x0b: case 0x0b:
fmov_ext_rm(dreg,(uae_u32)&xhex_l10_2); fmov_ext_rm(dreg,(uae_u32)&xhex_l10_2);
break; break;
case 0x0c: case 0x0c:
fmov_ext_rm(dreg,(uae_u32)&xhex_exp_1); fmov_ext_rm(dreg,(uae_u32)&xhex_exp_1);
break; break;
case 0x0d: case 0x0d:
fmov_log2_e(dreg); fmov_log2_e(dreg);
break; break;
case 0x0e: case 0x0e:
fmov_ext_rm(dreg,(uae_u32)&xhex_l10_e); fmov_ext_rm(dreg,(uae_u32)&xhex_l10_e);
break; break;
case 0x0f: case 0x0f:
fmov_0(dreg); fmov_0(dreg);
break; break;
case 0x30: case 0x30:
fmov_loge_2(dreg); fmov_loge_2(dreg);
break; break;
case 0x31: case 0x31:
fmov_ext_rm(dreg,(uae_u32)&xhex_ln_10); fmov_ext_rm(dreg,(uae_u32)&xhex_ln_10);
break; break;
case 0x32: case 0x32:
fmov_1(dreg); fmov_1(dreg);
break; break;
case 0x33: case 0x33:
fmovs_rm(dreg,(uae_u32)&fp_1e1); fmovs_rm(dreg,(uae_u32)&fp_1e1);
break; break;
case 0x34: case 0x34:
fmovs_rm(dreg,(uae_u32)&fp_1e2); fmovs_rm(dreg,(uae_u32)&fp_1e2);
break; break;
case 0x35: case 0x35:
fmovs_rm(dreg,(uae_u32)&fp_1e4); fmovs_rm(dreg,(uae_u32)&fp_1e4);
break; break;
case 0x36: case 0x36:
fmov_rm(dreg,(uae_u32)&fp_1e8); fmov_rm(dreg,(uae_u32)&fp_1e8);
break; break;
case 0x37: case 0x37:
fmov_ext_rm(dreg,(uae_u32)&xhex_1e16); fmov_ext_rm(dreg,(uae_u32)&xhex_1e16);
break; break;
case 0x38: case 0x38:
fmov_ext_rm(dreg,(uae_u32)&xhex_1e32); fmov_ext_rm(dreg,(uae_u32)&xhex_1e32);
break; break;
case 0x39: case 0x39:
fmov_ext_rm(dreg,(uae_u32)&xhex_1e64); fmov_ext_rm(dreg,(uae_u32)&xhex_1e64);
break; break;
case 0x3a: case 0x3a:
fmov_ext_rm(dreg,(uae_u32)&xhex_1e128); fmov_ext_rm(dreg,(uae_u32)&xhex_1e128);
break; break;
case 0x3b: case 0x3b:
fmov_ext_rm(dreg,(uae_u32)&xhex_1e256); fmov_ext_rm(dreg,(uae_u32)&xhex_1e256);
break; break;
case 0x3c: case 0x3c:
...@@ -1064,116 +1094,116 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) ...@@ -1064,116 +1094,116 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra)
break; break;
case 0x3f: case 0x3f:
fmov_ext_rm(dreg,(uae_u32)&xhex_1e4096); fmov_ext_rm(dreg,(uae_u32)&xhex_1e4096);
break; break;
default: default:
FAIL(1); FAIL(1);
return; return;
}
fmov_rr(FP_RESULT,dreg);
return;
}
if (opmode & 0x20) /* two operands, so we need a scratch reg */
sreg = FS1;
else /* one operand only, thus we can load the argument into dreg */
sreg = dreg;
if ((prec = comp_fp_get(opcode,extra,sreg)) < 0) {
FAIL(1);
return;
} }
if (!opmode) { /* FMOVE <EA>,FPx */
fmov_rr(FP_RESULT,dreg); fmov_rr(FP_RESULT,dreg);
return; return;
} }
/* no break here for <EA> to dreg */ if (opmode & 0x20) /* two operands, so we need a scratch reg */
case 0: /* directly from sreg to dreg */ sreg = FS1;
if (!source) { /* no <EA> */ else /* one operand only, thus we can load the argument into dreg */
dont_care_fflags(); sreg = dreg;
sreg = (extra >> 10) & 7; if ((prec = comp_fp_get(opcode,extra,sreg)) < 0) {
} FAIL(1);
return;
}
if (!opmode) { /* FMOVE <EA>,FPx */
fmov_rr(FP_RESULT,dreg);
return;
}
/* no break here for <EA> to dreg */
case 0: /* directly from sreg to dreg */
if (!source) { /* no <EA> */
dont_care_fflags();
sreg = (extra >> 10) & 7;
}
switch (opmode) { switch (opmode) {
case 0x00: /* FMOVE */ case 0x00: /* FMOVE */
fmov_rr(dreg,sreg); fmov_rr(dreg,sreg);
break; break;
case 0x01: /* FINT */ case 0x01: /* FINT */
frndint_rr(dreg,sreg); frndint_rr(dreg,sreg);
break; break;
case 0x02: /* FSINH */ case 0x02: /* FSINH */
fsinh_rr(dreg,sreg); fsinh_rr(dreg,sreg);
break; break;
case 0x03: /* FINTRZ */ case 0x03: /* FINTRZ */
#if USE_X86_FPUCW /* if we have control over the CW, we can do this */ #if USE_X86_FPUCW /* if we have control over the CW, we can do this */
if (0 && (regs.fpcr & 0xf0) == 0x10) /* maybe unsafe, because this test is done */ if (0 && (regs.fpcr & 0xf0) == 0x10) /* maybe unsafe, because this test is done */
frndint_rr(dreg,sreg); /* during the JIT compilation and not at runtime */ frndint_rr(dreg,sreg); /* during the JIT compilation and not at runtime */
else { else {
mov_l_ri(S1,0x10); /* extended round to zero */ mov_l_ri(S1,0x10); /* extended round to zero */
fldcw_m_indexed(S1,(uae_u32)x86_fpucw); fldcw_m_indexed(S1,(uae_u32)x86_fpucw);
frndint_rr(dreg,sreg); frndint_rr(dreg,sreg);
mov_l_rm(S1,(uae_u32)&regs.fpcr); mov_l_rm(S1,(uae_u32)&regs.fpcr);
and_l_ri(S1,0xf0); /* restore control word */ and_l_ri(S1,0xf0); /* restore control word */
fldcw_m_indexed(S1,(uae_u32)x86_fpucw); fldcw_m_indexed(S1,(uae_u32)x86_fpucw);
} }
break; break;
#endif #endif
FAIL(1); FAIL(1);
return; return;
case 0x04: /* FSQRT */ case 0x04: /* FSQRT */
fsqrt_rr(dreg,sreg); fsqrt_rr(dreg,sreg);
break; break;
case 0x06: /* FLOGNP1 */ case 0x06: /* FLOGNP1 */
flogNP1_rr(dreg,sreg); flogNP1_rr(dreg,sreg);
break; break;
case 0x08: /* FETOXM1 */ case 0x08: /* FETOXM1 */
fetoxM1_rr(dreg,sreg); fetoxM1_rr(dreg,sreg);
break; break;
case 0x09: /* FTANH */ case 0x09: /* FTANH */
ftanh_rr(dreg,sreg); ftanh_rr(dreg,sreg);
break; break;
case 0x0a: /* FATAN */ case 0x0a: /* FATAN */
fatan_rr(dreg,sreg); fatan_rr(dreg,sreg);
break; break;
case 0x0c: /* FASIN */ case 0x0c: /* FASIN */
fasin_rr(dreg,sreg); fasin_rr(dreg,sreg);
break; break;
case 0x0d: /* FATANH */ case 0x0d: /* FATANH */
fatanh_rr(dreg,sreg); fatanh_rr(dreg,sreg);
break; break;
case 0x0e: /* FSIN */ case 0x0e: /* FSIN */
fsin_rr(dreg,sreg); fsin_rr(dreg,sreg);
break; break;
case 0x0f: /* FTAN */ case 0x0f: /* FTAN */
ftan_rr(dreg,sreg); ftan_rr(dreg,sreg);
break; break;
case 0x10: /* FETOX */ case 0x10: /* FETOX */
fetox_rr(dreg,sreg); fetox_rr(dreg,sreg);
break; break;
case 0x11: /* FTWOTOX */ case 0x11: /* FTWOTOX */
ftwotox_rr(dreg,sreg); ftwotox_rr(dreg,sreg);
break; break;
case 0x12: /* FTENTOX */ case 0x12: /* FTENTOX */
ftentox_rr(dreg,sreg); ftentox_rr(dreg,sreg);
break; break;
case 0x14: /* FLOGN */ case 0x14: /* FLOGN */
flogN_rr(dreg,sreg); flogN_rr(dreg,sreg);
break; break;
case 0x15: /* FLOG10 */ case 0x15: /* FLOG10 */
flog10_rr(dreg,sreg); flog10_rr(dreg,sreg);
break; break;
case 0x16: /* FLOG2 */ case 0x16: /* FLOG2 */
flog2_rr(dreg,sreg); flog2_rr(dreg,sreg);
break; break;
case 0x18: /* FABS */ case 0x18: /* FABS */
fabs_rr(dreg,sreg); fabs_rr(dreg,sreg);
break; break;
case 0x19: /* FCOSH */ case 0x19: /* FCOSH */
fcosh_rr(dreg,sreg); fcosh_rr(dreg,sreg);
break; break;
case 0x1a: /* FNEG */ case 0x1a: /* FNEG */
fneg_rr(dreg,sreg); fneg_rr(dreg,sreg);
break; break;
case 0x1c: /* FACOS */ case 0x1c: /* FACOS */
#if USE_X86_FPUCW #if USE_X86_FPUCW
if ((regs.fpcr & 0x30) != 0x10) { /* use round to zero */ if ((regs.fpcr & 0x30) != 0x10) { /* use round to zero */
mov_l_ri(S1,(regs.fpcr & 0xC0) | 0x10); mov_l_ri(S1,(regs.fpcr & 0xC0) | 0x10);
fldcw_m_indexed(S1,(uae_u32)x86_fpucw); fldcw_m_indexed(S1,(uae_u32)x86_fpucw);
facos_rr(dreg,sreg); facos_rr(dreg,sreg);
mov_l_rm(S1,(uae_u32)&regs.fpcr); mov_l_rm(S1,(uae_u32)&regs.fpcr);
...@@ -1205,9 +1235,9 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) ...@@ -1205,9 +1235,9 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra)
case 0x23: /* FMUL */ case 0x23: /* FMUL */
fmul_rr(dreg,sreg); fmul_rr(dreg,sreg);
break; break;
case 0x24: /* FSGLDIV is not exactly the same as FSDIV, */ case 0x24: /* FSGLDIV is not exactly the same as FSDIV, */
/* because both operands should be SINGLE precision, too */ /* because both operands should be SINGLE precision, too */
case 0x60: /* FSDIV */ case 0x60: /* FSDIV */
fdiv_rr(dreg,sreg); fdiv_rr(dreg,sreg);
if (!currprefs.fpu_strict) /* faster, but less strict rounding */ if (!currprefs.fpu_strict) /* faster, but less strict rounding */
break; break;
...@@ -1217,15 +1247,15 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) ...@@ -1217,15 +1247,15 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra)
#endif #endif
fcuts_r(dreg); fcuts_r(dreg);
break; break;
case 0x25: /* FREM */ case 0x25: /* FREM */
frem1_rr(dreg,sreg); frem1_rr(dreg,sreg);
break; break;
case 0x26: /* FSCALE */ case 0x26: /* FSCALE */
fscale_rr(dreg,sreg); fscale_rr(dreg,sreg);
break; break;
case 0x27: /* FSGLMUL is not exactly the same as FSMUL, */ case 0x27: /* FSGLMUL is not exactly the same as FSMUL, */
/* because both operands should be SINGLE precision, too */ /* because both operands should be SINGLE precision, too */
case 0x63: /* FSMUL */ case 0x63: /* FSMUL */
fmul_rr(dreg,sreg); fmul_rr(dreg,sreg);
if (!currprefs.fpu_strict) /* faster, but less strict rounding */ if (!currprefs.fpu_strict) /* faster, but less strict rounding */
break; break;
...@@ -1235,48 +1265,48 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) ...@@ -1235,48 +1265,48 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra)
#endif #endif
fcuts_r(dreg); fcuts_r(dreg);
break; break;
case 0x28: /* FSUB */ case 0x28: /* FSUB */
fsub_rr(dreg,sreg); fsub_rr(dreg,sreg);
break; break;
case 0x30: /* FSINCOS */ case 0x30: /* FSINCOS */
case 0x31: case 0x31:
case 0x32: case 0x32:
case 0x33: case 0x33:
case 0x34: case 0x34:
case 0x35: case 0x35:
case 0x36: case 0x36:
case 0x37: case 0x37:
if (dreg == (extra & 7)) if (dreg == (extra & 7))
fsin_rr(dreg, sreg); fsin_rr(dreg, sreg);
else else
fsincos_rr(dreg, extra & 7, sreg); fsincos_rr(dreg, extra & 7, sreg);
break; break;
case 0x38: /* FCMP */ case 0x38: /* FCMP */
fmov_rr(FP_RESULT,dreg); fmov_rr(FP_RESULT,dreg);
fsub_rr(FP_RESULT,sreg); fsub_rr(FP_RESULT,sreg);
return; return;
case 0x3a: /* FTST */ case 0x3a: /* FTST */
fmov_rr(FP_RESULT,sreg); fmov_rr(FP_RESULT,sreg);
return; return;
case 0x40: /* FSMOVE */ case 0x40: /* FSMOVE */
if (prec == 1 || !currprefs.fpu_strict) { if (prec == 1 || !currprefs.fpu_strict) {
if (sreg != dreg) /* no <EA> */ if (sreg != dreg) /* no <EA> */
fmov_rr(dreg,sreg); fmov_rr(dreg,sreg);
} else { } else {
fmovs_mr((uae_u32)temp_fp,sreg); fmovs_mr((uae_u32)temp_fp,sreg);
fmovs_rm(dreg,(uae_u32)temp_fp); fmovs_rm(dreg,(uae_u32)temp_fp);
} }
break; break;
case 0x44: /* FDMOVE */ case 0x44: /* FDMOVE */
if (prec || !currprefs.fpu_strict) { if (prec || !currprefs.fpu_strict) {
if (sreg != dreg) /* no <EA> */ if (sreg != dreg) /* no <EA> */
fmov_rr(dreg,sreg); fmov_rr(dreg,sreg);
} else { } else {
fmov_mr((uae_u32)temp_fp,sreg); fmov_mr((uae_u32)temp_fp,sreg);
fmov_rm(dreg,(uae_u32)temp_fp); fmov_rm(dreg,(uae_u32)temp_fp);
} }
break; break;
case 0x41: /* FSSQRT */ case 0x41: /* FSSQRT */
fsqrt_rr(dreg,sreg); fsqrt_rr(dreg,sreg);
if (!currprefs.fpu_strict) /* faster, but less strict rounding */ if (!currprefs.fpu_strict) /* faster, but less strict rounding */
break; break;
...@@ -1286,7 +1316,7 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) ...@@ -1286,7 +1316,7 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra)
#endif #endif
fcuts_r(dreg); fcuts_r(dreg);
break; break;
case 0x45: /* FDSQRT */ case 0x45: /* FDSQRT */
if (!currprefs.fpu_strict) { /* faster, but less strict rounding */ if (!currprefs.fpu_strict) { /* faster, but less strict rounding */
fsqrt_rr(dreg,sreg); fsqrt_rr(dreg,sreg);
break; break;
...@@ -1294,14 +1324,14 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) ...@@ -1294,14 +1324,14 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra)
#if USE_X86_FPUCW #if USE_X86_FPUCW
if (regs.fpcr & 0xC0) { /* if we don't have EXTENDED precision */ if (regs.fpcr & 0xC0) { /* if we don't have EXTENDED precision */
if ((regs.fpcr & 0xC0) == 0x80) /* if we have DOUBLE */ if ((regs.fpcr & 0xC0) == 0x80) /* if we have DOUBLE */
fsqrt_rr(dreg,sreg); fsqrt_rr(dreg,sreg);
else { /* if we have SINGLE presision, force DOUBLE */ else { /* if we have SINGLE presision, force DOUBLE */
mov_l_ri(S1,(regs.fpcr & 0x30) | 0x80); mov_l_ri(S1,(regs.fpcr & 0x30) | 0x80);
fldcw_m_indexed(S1,(uae_u32)x86_fpucw); fldcw_m_indexed(S1,(uae_u32)x86_fpucw);
fsqrt_rr(dreg,sreg); fsqrt_rr(dreg,sreg);
mov_l_rm(S1,(uae_u32)&regs.fpcr); mov_l_rm(S1,(uae_u32)&regs.fpcr);
and_l_ri(S1,0xf0); /* restore control word */ and_l_ri(S1,0xf0); /* restore control word */
fldcw_m_indexed(S1,(uae_u32)x86_fpucw); fldcw_m_indexed(S1,(uae_u32)x86_fpucw);
} }
break; break;
} }
...@@ -1309,27 +1339,27 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) ...@@ -1309,27 +1339,27 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra)
fsqrt_rr(dreg,sreg); fsqrt_rr(dreg,sreg);
fcut_r(dreg); fcut_r(dreg);
break; break;
case 0x58: /* FSABS */ case 0x58: /* FSABS */
fabs_rr(dreg,sreg); fabs_rr(dreg,sreg);
if (prec != 1 && currprefs.fpu_strict) if (prec != 1 && currprefs.fpu_strict)
fcuts_r(dreg); fcuts_r(dreg);
break; break;
case 0x5a: /* FSNEG */ case 0x5a: /* FSNEG */
fneg_rr(dreg,sreg); fneg_rr(dreg,sreg);
if (prec != 1 && currprefs.fpu_strict) if (prec != 1 && currprefs.fpu_strict)
fcuts_r(dreg); fcuts_r(dreg);
break; break;
case 0x5c: /* FDABS */ case 0x5c: /* FDABS */
fabs_rr(dreg,sreg); fabs_rr(dreg,sreg);
if (!prec && currprefs.fpu_strict) if (!prec && currprefs.fpu_strict)
fcut_r(dreg); fcut_r(dreg);
break; break;
case 0x5e: /* FDNEG */ case 0x5e: /* FDNEG */
fneg_rr(dreg,sreg); fneg_rr(dreg,sreg);
if (!prec && currprefs.fpu_strict) if (!prec && currprefs.fpu_strict)
fcut_r(dreg); fcut_r(dreg);
break; break;
case 0x62: /* FSADD */ case 0x62: /* FSADD */
fadd_rr(dreg,sreg); fadd_rr(dreg,sreg);
if (!currprefs.fpu_strict) /* faster, but less strict rounding */ if (!currprefs.fpu_strict) /* faster, but less strict rounding */
break; break;
...@@ -1339,7 +1369,7 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) ...@@ -1339,7 +1369,7 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra)
#endif #endif
fcuts_r(dreg); fcuts_r(dreg);
break; break;
case 0x64: /* FDDIV */ case 0x64: /* FDDIV */
if (!currprefs.fpu_strict) { /* faster, but less strict rounding */ if (!currprefs.fpu_strict) { /* faster, but less strict rounding */
fdiv_rr(dreg,sreg); fdiv_rr(dreg,sreg);
break; break;
...@@ -1347,14 +1377,14 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) ...@@ -1347,14 +1377,14 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra)
#if USE_X86_FPUCW #if USE_X86_FPUCW
if (regs.fpcr & 0xC0) { /* if we don't have EXTENDED precision */ if (regs.fpcr & 0xC0) { /* if we don't have EXTENDED precision */
if ((regs.fpcr & 0xC0) == 0x80) /* if we have DOUBLE */ if ((regs.fpcr & 0xC0) == 0x80) /* if we have DOUBLE */
fdiv_rr(dreg,sreg); fdiv_rr(dreg,sreg);
else { /* if we have SINGLE presision, force DOUBLE */ else { /* if we have SINGLE presision, force DOUBLE */
mov_l_ri(S1,(regs.fpcr & 0x30) | 0x80); mov_l_ri(S1,(regs.fpcr & 0x30) | 0x80);
fldcw_m_indexed(S1,(uae_u32)x86_fpucw); fldcw_m_indexed(S1,(uae_u32)x86_fpucw);
fdiv_rr(dreg,sreg); fdiv_rr(dreg,sreg);
mov_l_rm(S1,(uae_u32)&regs.fpcr); mov_l_rm(S1,(uae_u32)&regs.fpcr);
and_l_ri(S1,0xf0); /* restore control word */ and_l_ri(S1,0xf0); /* restore control word */
fldcw_m_indexed(S1,(uae_u32)x86_fpucw); fldcw_m_indexed(S1,(uae_u32)x86_fpucw);
} }
break; break;
} }
...@@ -1362,7 +1392,7 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) ...@@ -1362,7 +1392,7 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra)
fdiv_rr(dreg,sreg); fdiv_rr(dreg,sreg);
fcut_r(dreg); fcut_r(dreg);
break; break;
case 0x66: /* FDADD */ case 0x66: /* FDADD */
if (!currprefs.fpu_strict) { /* faster, but less strict rounding */ if (!currprefs.fpu_strict) { /* faster, but less strict rounding */
fadd_rr(dreg,sreg); fadd_rr(dreg,sreg);
break; break;
...@@ -1370,14 +1400,14 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) ...@@ -1370,14 +1400,14 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra)
#if USE_X86_FPUCW #if USE_X86_FPUCW
if (regs.fpcr & 0xC0) { /* if we don't have EXTENDED precision */ if (regs.fpcr & 0xC0) { /* if we don't have EXTENDED precision */
if ((regs.fpcr & 0xC0) == 0x80) /* if we have DOUBLE */ if ((regs.fpcr & 0xC0) == 0x80) /* if we have DOUBLE */
fadd_rr(dreg,sreg); fadd_rr(dreg,sreg);
else { /* if we have SINGLE presision, force DOUBLE */ else { /* if we have SINGLE presision, force DOUBLE */
mov_l_ri(S1,(regs.fpcr & 0x30) | 0x80); mov_l_ri(S1,(regs.fpcr & 0x30) | 0x80);
fldcw_m_indexed(S1,(uae_u32)x86_fpucw); fldcw_m_indexed(S1,(uae_u32)x86_fpucw);
fadd_rr(dreg,sreg); fadd_rr(dreg,sreg);
mov_l_rm(S1,(uae_u32)&regs.fpcr); mov_l_rm(S1,(uae_u32)&regs.fpcr);
and_l_ri(S1,0xf0); /* restore control word */ and_l_ri(S1,0xf0); /* restore control word */
fldcw_m_indexed(S1,(uae_u32)x86_fpucw); fldcw_m_indexed(S1,(uae_u32)x86_fpucw);
} }
break; break;
} }
...@@ -1385,7 +1415,7 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) ...@@ -1385,7 +1415,7 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra)
fadd_rr(dreg,sreg); fadd_rr(dreg,sreg);
fcut_r(dreg); fcut_r(dreg);
break; break;
case 0x67: /* FDMUL */ case 0x67: /* FDMUL */
if (!currprefs.fpu_strict) { /* faster, but less strict rounding */ if (!currprefs.fpu_strict) { /* faster, but less strict rounding */
fmul_rr(dreg,sreg); fmul_rr(dreg,sreg);
break; break;
...@@ -1393,14 +1423,14 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) ...@@ -1393,14 +1423,14 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra)
#if USE_X86_FPUCW #if USE_X86_FPUCW
if (regs.fpcr & 0xC0) { /* if we don't have EXTENDED precision */ if (regs.fpcr & 0xC0) { /* if we don't have EXTENDED precision */
if ((regs.fpcr & 0xC0) == 0x80) /* if we have DOUBLE */ if ((regs.fpcr & 0xC0) == 0x80) /* if we have DOUBLE */
fmul_rr(dreg,sreg); fmul_rr(dreg,sreg);
else { /* if we have SINGLE presision, force DOUBLE */ else { /* if we have SINGLE presision, force DOUBLE */
mov_l_ri(S1,(regs.fpcr & 0x30) | 0x80); mov_l_ri(S1,(regs.fpcr & 0x30) | 0x80);
fldcw_m_indexed(S1,(uae_u32)x86_fpucw); fldcw_m_indexed(S1,(uae_u32)x86_fpucw);
fmul_rr(dreg,sreg); fmul_rr(dreg,sreg);
mov_l_rm(S1,(uae_u32)&regs.fpcr); mov_l_rm(S1,(uae_u32)&regs.fpcr);
and_l_ri(S1,0xf0); /* restore control word */ and_l_ri(S1,0xf0); /* restore control word */
fldcw_m_indexed(S1,(uae_u32)x86_fpucw); fldcw_m_indexed(S1,(uae_u32)x86_fpucw);
} }
break; break;
} }
...@@ -1408,7 +1438,7 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) ...@@ -1408,7 +1438,7 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra)
fmul_rr(dreg,sreg); fmul_rr(dreg,sreg);
fcut_r(dreg); fcut_r(dreg);
break; break;
case 0x68: /* FSSUB */ case 0x68: /* FSSUB */
fsub_rr(dreg,sreg); fsub_rr(dreg,sreg);
if (!currprefs.fpu_strict) /* faster, but less strict rounding */ if (!currprefs.fpu_strict) /* faster, but less strict rounding */
break; break;
...@@ -1418,7 +1448,7 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) ...@@ -1418,7 +1448,7 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra)
#endif #endif
fcuts_r(dreg); fcuts_r(dreg);
break; break;
case 0x6c: /* FDSUB */ case 0x6c: /* FDSUB */
if (!currprefs.fpu_strict) { /* faster, but less strict rounding */ if (!currprefs.fpu_strict) { /* faster, but less strict rounding */
fsub_rr(dreg,sreg); fsub_rr(dreg,sreg);
break; break;
...@@ -1426,14 +1456,14 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) ...@@ -1426,14 +1456,14 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra)
#if USE_X86_FPUCW #if USE_X86_FPUCW
if (regs.fpcr & 0xC0) { /* if we don't have EXTENDED precision */ if (regs.fpcr & 0xC0) { /* if we don't have EXTENDED precision */
if ((regs.fpcr & 0xC0) == 0x80) /* if we have DOUBLE */ if ((regs.fpcr & 0xC0) == 0x80) /* if we have DOUBLE */
fsub_rr(dreg,sreg); fsub_rr(dreg,sreg);
else { /* if we have SINGLE presision, force DOUBLE */ else { /* if we have SINGLE presision, force DOUBLE */
mov_l_ri(S1,(regs.fpcr & 0x30) | 0x80); mov_l_ri(S1,(regs.fpcr & 0x30) | 0x80);
fldcw_m_indexed(S1,(uae_u32)x86_fpucw); fldcw_m_indexed(S1,(uae_u32)x86_fpucw);
fsub_rr(dreg,sreg); fsub_rr(dreg,sreg);
mov_l_rm(S1,(uae_u32)&regs.fpcr); mov_l_rm(S1,(uae_u32)&regs.fpcr);
and_l_ri(S1,0xf0); /* restore control word */ and_l_ri(S1,0xf0); /* restore control word */
fldcw_m_indexed(S1,(uae_u32)x86_fpucw); fldcw_m_indexed(S1,(uae_u32)x86_fpucw);
} }
break; break;
} }
...@@ -1441,16 +1471,16 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) ...@@ -1441,16 +1471,16 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra)
fsub_rr(dreg,sreg); fsub_rr(dreg,sreg);
fcut_r(dreg); fcut_r(dreg);
break; break;
default: default:
FAIL(1); FAIL(1);
return; return;
} }
fmov_rr(FP_RESULT,dreg); fmov_rr(FP_RESULT,dreg);
return; return;
default: default:
write_log ("Unsupported JIT-FPU instruction: 0x%04x %04x\n",opcode,extra); write_log ("Unsupported JIT-FPU instruction: 0x%04x %04x\n",opcode,extra);
FAIL(1); FAIL(1);
return; return;
} }
} }
#endif #endif
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -4770,24 +4770,22 @@ STATIC_INLINE void do_sprites_1 (int num, int cycle, int hpos) ...@@ -4770,24 +4770,22 @@ STATIC_INLINE void do_sprites_1 (int num, int cycle, int hpos)
sprite_fetch2 (s, hpos, cycle, 0); sprite_fetch2 (s, hpos, cycle, 0);
break; break;
} }
} else { //write_log ("%d:%d: %04X=%04X\n", vpos, hpos, 0x140 + cycle * 2 + num * 8, data);
data = cycle == 0 ? sprpos[num] : sprctl[num]; if (cycle == 0) {
} SPRxPOS_1 (data, num, hpos);
#if SPRITE_DEBUG > 1 s->dmacycle = 1;
if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) { } else {
write_log ("%d:%d:dma:P=%06X ", vpos, hpos, s->pt); SPRxCTL_1 (data, num, hpos);
} s->dmastate = 0;
#endif sprstartstop (s);
//write_log ("%d:%d: %04X=%04X\n", vpos, hpos, 0x140 + cycle * 2 + num * 8, data); }
if (cycle == 0) {
SPRxPOS_1 (data, num, hpos);
s->dmacycle = 1;
} else {
SPRxCTL_1 (data, num, hpos);
s->dmastate = 0;
sprstartstop (s);
} }
} #if SPRITE_DEBUG > 1
if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) {
write_log (L"%d:%d:dma:P=%06X ", vpos, hpos, s->pt);
}
#endif
}
if (s->dmastate && !posctl && dma) { if (s->dmastate && !posctl && dma) {
uae_u16 data; uae_u16 data;
...@@ -4919,7 +4917,6 @@ static void init_hardware_frame (void) ...@@ -4919,7 +4917,6 @@ static void init_hardware_frame (void)
ddflastword_total = 0; ddflastword_total = 0;
plflastline_total = 0; plflastline_total = 0;
plffirstline_total = maxvpos; plffirstline_total = maxvpos;
plffirstline_total = maxvpos;
autoscale_bordercolors = 0; autoscale_bordercolors = 0;
for (i = 0; i < MAX_SPRITES; i++) for (i = 0; i < MAX_SPRITES; i++)
spr[i].ptxhpos = MAXHPOS; spr[i].ptxhpos = MAXHPOS;
...@@ -6359,6 +6356,8 @@ void custom_prepare_savestate (void) ...@@ -6359,6 +6356,8 @@ void custom_prepare_savestate (void)
} }
#define RB restore_u8 () #define RB restore_u8 ()
#define SRB (uae_s8)restore_u8 ()
#define RBB restore_u8 () != 0
#define RW restore_u16 () #define RW restore_u16 ()
#define RL restore_u32 () #define RL restore_u32 ()
...@@ -6760,6 +6759,105 @@ uae_u8 *save_custom_sprite(int num, int *len, uae_u8 *dstptr) ...@@ -6760,6 +6759,105 @@ uae_u8 *save_custom_sprite(int num, int *len, uae_u8 *dstptr)
return dstbak; return dstbak;
} }
uae_u8 *restore_custom_extra (uae_u8 *src)
{
restore_u32 ();
currprefs.cs_compatible = changed_prefs.cs_compatible = 0;
currprefs.genlock = changed_prefs.genlock = RBB;
currprefs.cs_rtc = changed_prefs.cs_rtc = RB;
currprefs.cs_rtc_adjust = changed_prefs.cs_rtc_adjust = RL;
currprefs.cs_a1000ram = changed_prefs.cs_a1000ram = RBB;
currprefs.cs_slowmemisfast = changed_prefs.cs_slowmemisfast = RBB;
currprefs.cs_a2091 = changed_prefs.cs_a2091 = RBB;
currprefs.cs_a4091 = changed_prefs.cs_a4091 = RBB;
currprefs.cs_cdtvscsi = changed_prefs.cs_cdtvscsi = RBB;
currprefs.cs_pcmcia = changed_prefs.cs_pcmcia = RBB;
currprefs.cs_ciaatod = changed_prefs.cs_ciaatod = RB;
currprefs.cs_ciaoverlay = changed_prefs.cs_ciaoverlay = RBB;
currprefs.cs_agnusbltbusybug = changed_prefs.cs_agnusbltbusybug = RBB;
currprefs.cs_denisenoehb = changed_prefs.cs_denisenoehb = RBB;
currprefs.cs_agnusrev = changed_prefs.cs_agnusrev = SRB;
currprefs.cs_deniserev = changed_prefs.cs_deniserev = SRB;
currprefs.cs_fatgaryrev = changed_prefs.cs_fatgaryrev = SRB;
currprefs.cs_ramseyrev = changed_prefs.cs_ramseyrev = SRB;
currprefs.cs_cd32c2p = changed_prefs.cs_cd32c2p = RBB;
currprefs.cs_cd32cd = changed_prefs.cs_cd32cd = RBB;
currprefs.cs_cd32nvram = changed_prefs.cs_cd32nvram = RBB;
currprefs.cs_cdtvcd = changed_prefs.cs_cdtvcd = RBB;
currprefs.cs_cdtvram = changed_prefs.cs_cdtvram = RBB;
currprefs.cs_cdtvcard = changed_prefs.cs_cdtvcard = RB;
currprefs.cs_df0idhw = changed_prefs.cs_df0idhw = RBB;
currprefs.cs_dipagnus = changed_prefs.cs_dipagnus = RBB;
currprefs.cs_ide = changed_prefs.cs_ide = RB;
currprefs.cs_mbdmac = changed_prefs.cs_mbdmac = RB;
currprefs.cs_ksmirror_a8 = changed_prefs.cs_ksmirror_a8 = RBB;
currprefs.cs_ksmirror_e0 = changed_prefs.cs_ksmirror_e0 = RBB;
currprefs.cs_resetwarning = changed_prefs.cs_resetwarning = RBB;
return src;
}
uae_u8 *save_custom_extra (int *len, uae_u8 *dstptr)
{
uae_u8 *dstbak, *dst;
if (dstptr)
dstbak = dst = dstptr;
else
dstbak = dst = xmalloc (uae_u8, 1000);
SL (0);
SB (currprefs.genlock ? 1 : 0);
SB (currprefs.cs_rtc);
SL (currprefs.cs_rtc_adjust);
SB (currprefs.cs_a1000ram ? 1 : 0);
SB (currprefs.cs_slowmemisfast ? 1 : 0);
SB (currprefs.cs_a2091 ? 1 : 0);
SB (currprefs.cs_a4091 ? 1 : 0);
SB (currprefs.cs_cdtvscsi ? 1 : 0);
SB (currprefs.cs_pcmcia ? 1 : 0);
SB (currprefs.cs_ciaatod);
SB (currprefs.cs_ciaoverlay ? 1 : 0);
SB (currprefs.cs_agnusbltbusybug ? 1 : 0);
SB (currprefs.cs_denisenoehb ? 1 : 0);
SB (currprefs.cs_agnusrev);
SB (currprefs.cs_deniserev);
SB (currprefs.cs_fatgaryrev);
SB (currprefs.cs_ramseyrev);
SB (currprefs.cs_cd32c2p);
SB (currprefs.cs_cd32cd);
SB (currprefs.cs_cd32nvram);
SB (currprefs.cs_cdtvcd ? 1 : 0);
SB (currprefs.cs_cdtvram ? 1 : 0);
SB (currprefs.cs_cdtvcard);
SB (currprefs.cs_df0idhw ? 1 : 0);
SB (currprefs.cs_dipagnus ? 1 : 0);
SB (currprefs.cs_ide);
SB (currprefs.cs_mbdmac);
SB (currprefs.cs_ksmirror_a8 ? 1 : 0);
SB (currprefs.cs_ksmirror_e0 ? 1 : 0);
SB (currprefs.cs_resetwarning ? 1 : 0);
*len = dst - dstbak;
return dstbak;
}
#endif /* SAVESTATE */ #endif /* SAVESTATE */
void check_prefs_changed_custom (void) void check_prefs_changed_custom (void)
......
...@@ -1091,48 +1091,48 @@ static int NOINLINE linetoscr_16_shrink2f_sh (int spix, int dpix, int stoppos, i ...@@ -1091,48 +1091,48 @@ static int NOINLINE linetoscr_16_shrink2f_sh (int spix, int dpix, int stoppos, i
static void pfield_do_linetoscr (int start, int stop) static void pfield_do_linetoscr (int start, int stop)
{ {
xlinecheck(start, stop); xlinecheck(start, stop);
if (issprites && (currprefs.chipset_mask & CSMASK_AGA)) { if (issprites && (currprefs.chipset_mask & CSMASK_AGA)) {
if (res_shift == 0) { if (res_shift == 0) {
switch (gfxvidinfo.pixbytes) { switch (gfxvidinfo.pixbytes) {
case 2: src_pixel = linetoscr_16_aga_spr (src_pixel, start, stop); break; case 2: src_pixel = linetoscr_16_aga_spr (src_pixel, start, stop); break;
case 4: src_pixel = linetoscr_32_aga_spr (src_pixel, start, stop); break; case 4: src_pixel = linetoscr_32_aga_spr (src_pixel, start, stop); break;
} }
} else if (res_shift == 2) { } else if (res_shift == 2) {
switch (gfxvidinfo.pixbytes) { switch (gfxvidinfo.pixbytes) {
case 2: src_pixel = linetoscr_16_stretch2_aga_spr (src_pixel, start, stop); break; case 2: src_pixel = linetoscr_16_stretch2_aga_spr (src_pixel, start, stop); break;
case 4: src_pixel = linetoscr_32_stretch2_aga_spr (src_pixel, start, stop); break; case 4: src_pixel = linetoscr_32_stretch2_aga_spr (src_pixel, start, stop); break;
} }
} else if (res_shift == 1) { } else if (res_shift == 1) {
switch (gfxvidinfo.pixbytes) { switch (gfxvidinfo.pixbytes) {
case 2: src_pixel = linetoscr_16_stretch1_aga_spr (src_pixel, start, stop); break; case 2: src_pixel = linetoscr_16_stretch1_aga_spr (src_pixel, start, stop); break;
case 4: src_pixel = linetoscr_32_stretch1_aga_spr (src_pixel, start, stop); break; case 4: src_pixel = linetoscr_32_stretch1_aga_spr (src_pixel, start, stop); break;
} }
} else if (res_shift == -1) { } else if (res_shift == -1) {
if (currprefs.gfx_lores_mode) { if (currprefs.gfx_lores_mode) {
switch (gfxvidinfo.pixbytes) { switch (gfxvidinfo.pixbytes) {
case 2: src_pixel = linetoscr_16_shrink1f_aga_spr (src_pixel, start, stop); break; case 2: src_pixel = linetoscr_16_shrink1f_aga_spr (src_pixel, start, stop); break;
case 4: src_pixel = linetoscr_32_shrink1f_aga_spr (src_pixel, start, stop); break; case 4: src_pixel = linetoscr_32_shrink1f_aga_spr (src_pixel, start, stop); break;
} }
} else { } else {
switch (gfxvidinfo.pixbytes) { switch (gfxvidinfo.pixbytes) {
case 2: src_pixel = linetoscr_16_shrink1_aga_spr (src_pixel, start, stop); break; case 2: src_pixel = linetoscr_16_shrink1_aga_spr (src_pixel, start, stop); break;
case 4: src_pixel = linetoscr_32_shrink1_aga_spr (src_pixel, start, stop); break; case 4: src_pixel = linetoscr_32_shrink1_aga_spr (src_pixel, start, stop); break;
} }
} }
} else if (res_shift == -2) { } else if (res_shift == -2) {
if (currprefs.gfx_lores_mode) { if (currprefs.gfx_lores_mode) {
switch (gfxvidinfo.pixbytes) { switch (gfxvidinfo.pixbytes) {
case 2: src_pixel = linetoscr_16_shrink2f_aga_spr (src_pixel, start, stop); break; case 2: src_pixel = linetoscr_16_shrink2f_aga_spr (src_pixel, start, stop); break;
case 4: src_pixel = linetoscr_32_shrink2f_aga_spr (src_pixel, start, stop); break; case 4: src_pixel = linetoscr_32_shrink2f_aga_spr (src_pixel, start, stop); break;
} }
} else { } else {
switch (gfxvidinfo.pixbytes) { switch (gfxvidinfo.pixbytes) {
case 2: src_pixel = linetoscr_16_shrink2_aga_spr (src_pixel, start, stop); break; case 2: src_pixel = linetoscr_16_shrink2_aga_spr (src_pixel, start, stop); break;
case 4: src_pixel = linetoscr_32_shrink2_aga_spr (src_pixel, start, stop); break; case 4: src_pixel = linetoscr_32_shrink2_aga_spr (src_pixel, start, stop); break;
} }
} }
} }
} else } else
#ifdef AGA #ifdef AGA
if (currprefs.chipset_mask & CSMASK_AGA) { if (currprefs.chipset_mask & CSMASK_AGA) {
if (res_shift == 0) { if (res_shift == 0) {
...@@ -1430,13 +1430,13 @@ static void gen_pfield_tables (void) ...@@ -1430,13 +1430,13 @@ static void gen_pfield_tables (void)
sprite_offs[i] = (i & 15) ? 0 : 2; sprite_offs[i] = (i & 15) ? 0 : 2;
clxtab[i] = ((((i & 3) && (i & 12)) << 9) clxtab[i] = ((((i & 3) && (i & 12)) << 9)
| (((i & 3) && (i & 48)) << 10) | (((i & 3) && (i & 48)) << 10)
| (((i & 3) && (i & 192)) << 11) | (((i & 3) && (i & 192)) << 11)
| (((i & 12) && (i & 48)) << 12) | (((i & 12) && (i & 48)) << 12)
| (((i & 12) && (i & 192)) << 13) | (((i & 12) && (i & 192)) << 13)
| (((i & 48) && (i & 192)) << 14)); | (((i & 48) && (i & 192)) << 14));
} }
memset (all_ones, 0xff, MAX_PIXELS_PER_LINE); memset (all_ones, 0xff, MAX_PIXELS_PER_LINE);
...@@ -1774,7 +1774,7 @@ STATIC_INLINE void do_flush_screen (int start, int stop) ...@@ -1774,7 +1774,7 @@ STATIC_INLINE void do_flush_screen (int start, int stop)
unlockscr (); unlockscr ();
if (start <= stop) if (start <= stop)
flush_screen (start, stop); flush_screen (start, stop);
else if (currprefs.gfx_afullscreen && currprefs.gfx_avsync) else if (currprefs.gfx_afullscreen == 1 && currprefs.gfx_avsync)
flush_screen (0, 0); /* vsync mode */ flush_screen (0, 0); /* vsync mode */
} }
...@@ -2868,6 +2868,12 @@ void vsync_handle_redraw (int long_frame, int lof_changed) ...@@ -2868,6 +2868,12 @@ void vsync_handle_redraw (int long_frame, int lof_changed)
#endif #endif
if (quit_program < 0) { if (quit_program < 0) {
if (!savestate_state) {
if (currprefs.quitstatefile[0]) {
savestate_initsave (currprefs.quitstatefile, 1, 1);
save_state (currprefs.quitstatefile, "");
}
}
quit_program = -quit_program; quit_program = -quit_program;
set_inhibit_frame (IHF_QUIT_PROGRAM); set_inhibit_frame (IHF_QUIT_PROGRAM);
set_special (SPCFLAG_BRK); set_special (SPCFLAG_BRK);
...@@ -2904,7 +2910,7 @@ void vsync_handle_redraw (int long_frame, int lof_changed) ...@@ -2904,7 +2910,7 @@ void vsync_handle_redraw (int long_frame, int lof_changed)
else if (currprefs.cpu_cycle_exact) else if (currprefs.cpu_cycle_exact)
init_hardware_for_drawing_frame (); init_hardware_for_drawing_frame ();
} else { } else {
if (currprefs.gfx_afullscreen && currprefs.gfx_avsync) if (currprefs.gfx_afullscreen == GFX_FULLSCREEN && currprefs.gfx_avsync)
flush_screen (0, 0); /* vsync mode */ flush_screen (0, 0); /* vsync mode */
} }
gui_flicker_led (-1, 0, 0); gui_flicker_led (-1, 0, 0);
......
...@@ -128,14 +128,15 @@ static void ersatz_init (void) ...@@ -128,14 +128,15 @@ static void ersatz_init (void)
uaecptr request; uaecptr request;
uaecptr a; uaecptr a;
already_failed = 0; already_failed = 0;
write_log ("initializing kickstart replacement\n"); write_log ("initializing kickstart replacement\n");
if (disk_empty (0)) { if (disk_empty (0)) {
already_failed = 1; already_failed = 1;
gui_message ("You need to have a diskfile in DF0 to use the Kickstart replacement!\n"); gui_message ("You need to have a diskfile in DF0 to use the Kickstart replacement!\n");
uae_restart (-1, NULL); //uae_restart (-1, NULL);
uae_quit ();
return; return;
} }
regs.s = 0; regs.s = 0;
/* Set some interrupt vectors */ /* Set some interrupt vectors */
......
...@@ -308,14 +308,14 @@ int get_filesys_unitconfig (struct uae_prefs *p, int index, struct mountedinfo * ...@@ -308,14 +308,14 @@ int get_filesys_unitconfig (struct uae_prefs *p, int index, struct mountedinfo *
return FILESYS_HARDFILE; return FILESYS_HARDFILE;
} }
static void stripsemicolon (char *s) static void stripsemicolon (TCHAR *s)
{ {
if (!s) if (!s)
return; return;
while (_tcslen(s) > 0 && s[_tcslen(s) - 1] == ':') while (_tcslen(s) > 0 && s[_tcslen(s) - 1] == ':')
s[_tcslen(s) - 1] = 0; s[_tcslen(s) - 1] = 0;
} }
static void stripspace (char *s) static void stripspace (TCHAR *s)
{ {
int i; int i;
if (!s) if (!s)
...@@ -325,7 +325,7 @@ static void stripspace (char *s) ...@@ -325,7 +325,7 @@ static void stripspace (char *s)
s[i] = '_'; s[i] = '_';
} }
} }
static void striplength (char *s, int len) static void striplength (TCHAR *s, int len)
{ {
if (!s) if (!s)
return; return;
...@@ -333,7 +333,7 @@ static void striplength (char *s, int len) ...@@ -333,7 +333,7 @@ static void striplength (char *s, int len)
return; return;
s[len] = 0; s[len] = 0;
} }
static void fixcharset (char *s) static void fixcharset (TCHAR *s)
{ {
char tmp[MAX_DPATH]; char tmp[MAX_DPATH];
if (!s) if (!s)
...@@ -343,7 +343,7 @@ static void fixcharset (char *s) ...@@ -343,7 +343,7 @@ static void fixcharset (char *s)
au_fs_copy (s, strlen (tmp) + 1, tmp); au_fs_copy (s, strlen (tmp) + 1, tmp);
} }
char *validatevolumename (char *s) TCHAR *validatevolumename (TCHAR *s)
{ {
stripsemicolon (s); stripsemicolon (s);
stripspace (s); stripspace (s);
...@@ -351,7 +351,7 @@ char *validatevolumename (char *s) ...@@ -351,7 +351,7 @@ char *validatevolumename (char *s)
striplength (s, 30); striplength (s, 30);
return s; return s;
} }
char *validatedevicename (char *s) TCHAR *validatedevicename (TCHAR *s)
{ {
stripsemicolon (s); stripsemicolon (s);
stripspace (s); stripspace (s);
...@@ -360,7 +360,7 @@ char *validatedevicename (char *s) ...@@ -360,7 +360,7 @@ char *validatedevicename (char *s)
return s; return s;
} }
char *filesys_createvolname (const char *volname, const char *rootdir, const char *def) TCHAR *filesys_createvolname (const TCHAR *volname, const TCHAR *rootdir, const TCHAR *def)
{ {
TCHAR *nvol = NULL; TCHAR *nvol = NULL;
int i, archivehd; int i, archivehd;
...@@ -412,7 +412,7 @@ char *filesys_createvolname (const char *volname, const char *rootdir, const cha ...@@ -412,7 +412,7 @@ char *filesys_createvolname (const char *volname, const char *rootdir, const cha
return nvol; return nvol;
} }
static int set_filesys_volume (const char *rootdir, int *flags, int *readonly, int *emptydrive, struct zvolume **zvp) static int set_filesys_volume (const TCHAR *rootdir, int *flags, bool *readonly, bool *emptydrive, struct zvolume **zvp)
{ {
*emptydrive = 0; *emptydrive = 0;
//FIXME: we dont support.. yet.. -mustafa //FIXME: we dont support.. yet.. -mustafa
...@@ -564,7 +564,7 @@ int set_filesys_unit (int nr, ...@@ -564,7 +564,7 @@ int set_filesys_unit (int nr,
return ret; return ret;
} }
int add_filesys_unit (char *devname, char *volname, const char *rootdir, bool readonly, int add_filesys_unit (TCHAR *devname, TCHAR *volname, const TCHAR *rootdir, bool readonly,
int secspertrack, int surfaces, int reserved, int secspertrack, int surfaces, int reserved,
int blocksize, int bootpri, bool donotmount, bool autoboot, int blocksize, int bootpri, bool donotmount, bool autoboot,
TCHAR *filesysdir, int hdc, int flags) TCHAR *filesysdir, int hdc, int flags)
...@@ -670,7 +670,7 @@ static void initialize_mountinfo (void) ...@@ -670,7 +670,7 @@ static void initialize_mountinfo (void)
//filesys_addexternals (); //filesys_addexternals ();
} }
int sprintf_filesys_unit (char *buffer, int num) int sprintf_filesys_unit (TCHAR *buffer, int num)
{ {
UnitInfo *uip = mountinfo.ui; UnitInfo *uip = mountinfo.ui;
...@@ -923,7 +923,7 @@ typedef uaecptr dpacket; ...@@ -923,7 +923,7 @@ typedef uaecptr dpacket;
static int flush_cache (Unit *unit, int num); static int flush_cache (Unit *unit, int num);
static char *char1 (uaecptr addr) static TCHAR *char1 (uaecptr addr)
{ {
static uae_char buf[1024]; static uae_char buf[1024];
static TCHAR bufx[1024]; static TCHAR bufx[1024];
...@@ -949,7 +949,7 @@ static TCHAR *bstr1 (uaecptr addr) ...@@ -949,7 +949,7 @@ static TCHAR *bstr1 (uaecptr addr)
return au_fs_copy (bufx, sizeof (bufx) / sizeof (TCHAR), buf); return au_fs_copy (bufx, sizeof (bufx) / sizeof (TCHAR), buf);
} }
static char *bstr (Unit *unit, uaecptr addr) static TCHAR *bstr (Unit *unit, uaecptr addr)
{ {
int i; int i;
int n = get_byte (addr); int n = get_byte (addr);
...@@ -963,7 +963,7 @@ static char *bstr (Unit *unit, uaecptr addr) ...@@ -963,7 +963,7 @@ static char *bstr (Unit *unit, uaecptr addr)
return unit->tmpbuf3; return unit->tmpbuf3;
} }
static char *bstr_cut (Unit *unit, uaecptr addr) static TCHAR *bstr_cut (Unit *unit, uaecptr addr)
{ {
TCHAR *p = unit->tmpbuf3; TCHAR *p = unit->tmpbuf3;
int i, colon_seen = 0, off; int i, colon_seen = 0, off;
...@@ -1158,7 +1158,7 @@ void filesys_vsync (void) ...@@ -1158,7 +1158,7 @@ void filesys_vsync (void)
} }
} }
} }
static void filesys_delayed_change (Unit *u, int frames, const TCHAR *rootdir, const TCHAR *volume, int readonly, int flags) static void filesys_delayed_change (Unit *u, int frames, const TCHAR *rootdir, const TCHAR *volume, bool readonly, int flags)
{ {
u->reinsertdelay = 50; u->reinsertdelay = 50;
u->newflags = flags; u->newflags = flags;
...@@ -1665,7 +1665,10 @@ static TCHAR *get_nname (Unit *unit, a_inode *base, TCHAR *rel, ...@@ -1665,7 +1665,10 @@ static TCHAR *get_nname (Unit *unit, a_inode *base, TCHAR *rel,
TCHAR *p = 0; TCHAR *p = 0;
*modified_rel = 0; *modified_rel = 0;
if (unit->volflags & MYVOLUMEINFO_ARCHIVE) { if (unit->volflags & MYVOLUMEINFO_ARCHIVE) {
//if (zfile_exists_archive(base->nname, rel))
// return build_nname(base->nname, rel);
return 0; return 0;
} }
...@@ -1732,7 +1735,7 @@ oh_dear: ...@@ -1732,7 +1735,7 @@ oh_dear:
static int fill_file_attrs (Unit *u, a_inode *base, a_inode *c) static int fill_file_attrs (Unit *u, a_inode *base, a_inode *c)
{ {
if (0 /*u->volflags & MYVOLUMEINFO_ARCHIVE*/) { /* if (u->volflags & MYVOLUMEINFO_ARCHIVE) {
int isdir, flags; int isdir, flags;
TCHAR *comment; TCHAR *comment;
zfile_fill_file_attrs_archive (c->nname, &isdir, &flags, &comment); zfile_fill_file_attrs_archive (c->nname, &isdir, &flags, &comment);
...@@ -1742,9 +1745,9 @@ static int fill_file_attrs (Unit *u, a_inode *base, a_inode *c) ...@@ -1742,9 +1745,9 @@ static int fill_file_attrs (Unit *u, a_inode *base, a_inode *c)
c->amigaos_mode = flags; c->amigaos_mode = flags;
c->comment = comment; c->comment = comment;
return 1; return 1;
} else { } else {*/
return fsdb_fill_file_attrs (base, c); return fsdb_fill_file_attrs (base, c);
} //}
return 0; return 0;
} }
...@@ -2483,12 +2486,12 @@ static void ...@@ -2483,12 +2486,12 @@ static void
write_log ("Notify:\n"); write_log ("Notify:\n");
write_log ("nr_Name '%s'\n", char1 (get_long (nr + 0))); write_log ("nr_Name '%s'\n", char1 (get_long (nr + 0)));
write_log ("nr_FullName '%s'\n", name); write_log ("nr_FullName '%s'\n", name);
write_log ("nr_UserData %08.8X\n", get_long (nr + 8)); write_log ("nr_UserData %08X\n", get_long (nr + 8));
write_log ("nr_Flags %08.8X\n", flags); write_log ("nr_Flags %08X\n", flags);
if (flags & NRF_SEND_MESSAGE) { if (flags & NRF_SEND_MESSAGE) {
write_log ("Message NotifyRequest, port = %08.8X\n", get_long (nr + 16)); write_log ("Message NotifyRequest, port = %08X\n", get_long (nr + 16));
} else if (flags & NRF_SEND_SIGNAL) { } else if (flags & NRF_SEND_SIGNAL) {
write_log ("Signal NotifyRequest, Task = %08.8X signal = %d\n", get_long (nr + 16), get_long (nr + 20)); write_log ("Signal NotifyRequest, Task = %08X signal = %d\n", get_long (nr + 16), get_long (nr + 20));
} else { } else {
write_log ("corrupt NotifyRequest\n"); write_log ("corrupt NotifyRequest\n");
} }
...@@ -3320,7 +3323,7 @@ static uae_u32 REGPARAM2 exall_helper (TrapContext *context) ...@@ -3320,7 +3323,7 @@ static uae_u32 REGPARAM2 exall_helper (TrapContext *context)
for (u = units; u; u = u->next) { for (u = units; u; u = u->next) {
for (i = 0; i < EXALLKEYS; i++) { for (i = 0; i < EXALLKEYS; i++) {
if (u->exalls[i].id == id && u->exalls[i].control == control) { if (u->exalls[i].id == id && u->exalls[i].control == control) {
action_examine_all (u, get_real_address (packet)); action_examine_all (u, packet);
} }
} }
} }
...@@ -3745,9 +3748,8 @@ static void ...@@ -3745,9 +3748,8 @@ static void
/* HACK HACK HACK HACK /* HACK HACK HACK HACK
* Try to detect a LoadSeg() */ * Try to detect a LoadSeg() */
if (k->file_pos == 0 && size >= 4) { if (k->file_pos == 0 && size >= 4) {
unsigned char buf[4]; unsigned TCHAR buf[4];
off_t currpos = fs_lseek (unit, k->fd, 0, SEEK_CUR); off_t currpos = fs_lseek (unit, k->fd, 0, SEEK_CUR);
//my_read (k->fd, buf, 4);
fread (buf, 1, 4, k->fd); fread (buf, 1, 4, k->fd);
fs_lseek (unit, k->fd, currpos, SEEK_SET); fs_lseek (unit, k->fd, currpos, SEEK_SET);
if (buf[0] == 0 && buf[1] == 0 && buf[2] == 3 && buf[3] == 0xF3) if (buf[0] == 0 && buf[1] == 0 && buf[2] == 3 && buf[3] == 0xF3)
...@@ -5330,10 +5332,10 @@ static uae_u32 REGPARAM2 filesys_init_storeinfo (TrapContext *context) ...@@ -5330,10 +5332,10 @@ static uae_u32 REGPARAM2 filesys_init_storeinfo (TrapContext *context)
int ret = -1; int ret = -1;
switch (m68k_dreg (regs, 1)) switch (m68k_dreg (regs, 1))
{ {
/* case 1: case 1:
mountertask = m68k_areg (regs, 1); mountertask = m68k_areg (regs, 1);
picasso96_alloc (context); //picasso96_alloc (context);
break;*/ break;
case 2: case 2:
ret = automountunit; ret = automountunit;
automountunit = -1; automountunit = -1;
...@@ -5507,7 +5509,7 @@ static int rdb_mount (UnitInfo *uip, int unit_no, unsigned int partnum, uaecptr ...@@ -5507,7 +5509,7 @@ static int rdb_mount (UnitInfo *uip, int unit_no, unsigned int partnum, uaecptr
bufrdb[0xde] = 0; bufrdb[0xde] = 0;
bufrdb[0xdf] = 0; bufrdb[0xdf] = 0;
if (rdb_checksum ("RDSK", bufrdb, rdblock)) { if (rdb_checksum ("RDSK", bufrdb, rdblock)) {
write_log ("Windows trashed RDB detected, fixing..\n"); write_log ("Windows 95/98/ME trashed RDB detected, fixing..\n");
hdf_write (hfd, bufrdb, rdblock * hfd->blocksize, hfd->blocksize); hdf_write (hfd, bufrdb, rdblock * hfd->blocksize, hfd->blocksize);
break; break;
} }
......
...@@ -1921,7 +1921,7 @@ static void initide (void) ...@@ -1921,7 +1921,7 @@ static void initide (void)
void gayle_reset (int hardreset) void gayle_reset (int hardreset)
{ {
static char bankname[100]; static TCHAR bankname[100];
initide (); initide ();
if (hardreset) { if (hardreset) {
...@@ -2018,7 +2018,7 @@ uae_u8 *restore_ide (uae_u8 *src) ...@@ -2018,7 +2018,7 @@ uae_u8 *restore_ide (uae_u8 *src)
{ {
int num, readonly, blocksize; int num, readonly, blocksize;
uae_u64 size; uae_u64 size;
char *path; TCHAR *path;
struct ide_hdf *ide; struct ide_hdf *ide;
alloc_ide_mem (idedrive, 4); alloc_ide_mem (idedrive, 4);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -100,6 +100,10 @@ enum { CP_GENERIC = 1, CP_CDTV, CP_CD32, CP_A500, CP_A500P, CP_A600, CP_A1000, ...@@ -100,6 +100,10 @@ enum { CP_GENERIC = 1, CP_CDTV, CP_CD32, CP_A500, CP_A500P, CP_A600, CP_A1000,
#define IDE_A600A1200 1 #define IDE_A600A1200 1
#define IDE_A4000 2 #define IDE_A4000 2
#define GFX_WINDOW 0
#define GFX_FULLSCREEN 1
#define GFX_FULLWINDOW 2
struct uae_prefs { struct uae_prefs {
struct strlist *all_lines; struct strlist *all_lines;
...@@ -291,6 +295,7 @@ struct uae_prefs { ...@@ -291,6 +295,7 @@ struct uae_prefs {
TCHAR amaxromfile[MAX_DPATH]; TCHAR amaxromfile[MAX_DPATH];
TCHAR a2065name[MAX_DPATH]; TCHAR a2065name[MAX_DPATH];
TCHAR cdimagefile[MAX_DPATH]; TCHAR cdimagefile[MAX_DPATH];
TCHAR quitstatefile[MAX_DPATH];
#ifndef WIN32 #ifndef WIN32
char scsi_device[256]; char scsi_device[256];
#endif #endif
...@@ -422,7 +427,6 @@ struct uae_prefs { ...@@ -422,7 +427,6 @@ struct uae_prefs {
/* input */ /* input */
TCHAR inputname[256];
struct jport jports[MAX_JPORTS]; struct jport jports[MAX_JPORTS];
int input_selected_setting; int input_selected_setting;
int input_joymouse_multiplier; int input_joymouse_multiplier;
......
...@@ -4,7 +4,7 @@ running configure, to aid debugging if configure makes a mistake. ...@@ -4,7 +4,7 @@ running configure, to aid debugging if configure makes a mistake.
It was created by configure, which was It was created by configure, which was
generated by GNU Autoconf 2.65. Invocation command line was generated by GNU Autoconf 2.65. Invocation command line was
$ ./configure --disable-option-checking --prefix=/usr/local --with-sdl --with-sdl-gl --with-sdl-gfx --with-sdl-sound --with-caps --with-gayle --enable-drvsnd --enable-amax --enable-cd32 --enable-scsi-device --cache-file=/dev/null --srcdir=. $ ./configure --disable-option-checking --prefix=/usr/local --with-sdl --with-sdl-gl --with-sdl-gfx --with-sdl-sound --with-caps --with-gayle --enable-drvsnd --enable-amax --enable-cd32 --enable-scsi-device --disable-jit --cache-file=/dev/null --srcdir=.
## --------- ## ## --------- ##
## Platform. ## ## Platform. ##
...@@ -445,7 +445,7 @@ configure:4344: $? = 0 ...@@ -445,7 +445,7 @@ configure:4344: $? = 0
configure:4344: result: yes configure:4344: result: yes
configure:4350: checking for _doprnt configure:4350: checking for _doprnt
configure:4350: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5 configure:4350: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5
/tmp/ccBiDfLi.o: In function `main': /tmp/cc4EAiYz.o: In function `main':
/home/gnostic/puaex/src/tools/conftest.c:67: undefined reference to `_doprnt' /home/gnostic/puaex/src/tools/conftest.c:67: undefined reference to `_doprnt'
collect2: ld returned 1 exit status collect2: ld returned 1 exit status
configure:4350: $? = 1 configure:4350: $? = 1
...@@ -533,7 +533,7 @@ configure:4364: $? = 0 ...@@ -533,7 +533,7 @@ configure:4364: $? = 0
configure:4364: result: yes configure:4364: result: yes
configure:4364: checking for strcmpi configure:4364: checking for strcmpi
configure:4364: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5 configure:4364: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5
/tmp/ccpI9QLu.o: In function `main': /tmp/ccFh4SgP.o: In function `main':
/home/gnostic/puaex/src/tools/conftest.c:69: undefined reference to `strcmpi' /home/gnostic/puaex/src/tools/conftest.c:69: undefined reference to `strcmpi'
collect2: ld returned 1 exit status collect2: ld returned 1 exit status
configure:4364: $? = 1 configure:4364: $? = 1
...@@ -613,7 +613,7 @@ configure: failed program was: ...@@ -613,7 +613,7 @@ configure: failed program was:
configure:4364: result: no configure:4364: result: no
configure:4364: checking for stricmp configure:4364: checking for stricmp
configure:4364: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5 configure:4364: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5
/tmp/cc94CjOB.o: In function `main': /tmp/ccn7jZ5T.o: In function `main':
/home/gnostic/puaex/src/tools/conftest.c:69: undefined reference to `stricmp' /home/gnostic/puaex/src/tools/conftest.c:69: undefined reference to `stricmp'
collect2: ld returned 1 exit status collect2: ld returned 1 exit status
configure:4364: $? = 1 configure:4364: $? = 1
......
...@@ -438,7 +438,7 @@ $config_links ...@@ -438,7 +438,7 @@ $config_links
Report bugs to the package provider." Report bugs to the package provider."
ac_cs_config="'--disable-option-checking' '--prefix=/usr/local' '--with-sdl' '--with-sdl-gl' '--with-sdl-gfx' '--with-sdl-sound' '--with-caps' '--with-gayle' '--enable-drvsnd' '--enable-amax' '--enable-cd32' '--enable-scsi-device' '--cache-file=/dev/null' '--srcdir=.'" ac_cs_config="'--disable-option-checking' '--prefix=/usr/local' '--with-sdl' '--with-sdl-gl' '--with-sdl-gfx' '--with-sdl-sound' '--with-caps' '--with-gayle' '--enable-drvsnd' '--enable-amax' '--enable-cd32' '--enable-scsi-device' '--disable-jit' '--cache-file=/dev/null' '--srcdir=.'"
ac_cs_version="\ ac_cs_version="\
config.status config.status
configured by ./configure, generated by GNU Autoconf 2.65, configured by ./configure, generated by GNU Autoconf 2.65,
...@@ -522,7 +522,7 @@ if $ac_cs_silent; then ...@@ -522,7 +522,7 @@ if $ac_cs_silent; then
fi fi
if $ac_cs_recheck; then if $ac_cs_recheck; then
set X '/bin/bash' './configure' '--disable-option-checking' '--prefix=/usr/local' '--with-sdl' '--with-sdl-gl' '--with-sdl-gfx' '--with-sdl-sound' '--with-caps' '--with-gayle' '--enable-drvsnd' '--enable-amax' '--enable-cd32' '--enable-scsi-device' '--cache-file=/dev/null' '--srcdir=.' $ac_configure_extra_args --no-create --no-recursion set X '/bin/bash' './configure' '--disable-option-checking' '--prefix=/usr/local' '--with-sdl' '--with-sdl-gl' '--with-sdl-gfx' '--with-sdl-sound' '--with-caps' '--with-gayle' '--enable-drvsnd' '--enable-amax' '--enable-cd32' '--enable-scsi-device' '--disable-jit' '--cache-file=/dev/null' '--srcdir=.' $ac_configure_extra_args --no-create --no-recursion
shift shift
$as_echo "running CONFIG_SHELL=/bin/bash $*" >&6 $as_echo "running CONFIG_SHELL=/bin/bash $*" >&6
CONFIG_SHELL='/bin/bash' CONFIG_SHELL='/bin/bash'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment