diff --git a/src/cpu/core_dyn_x86/decoder.h b/src/cpu/core_dyn_x86/decoder.h index bc93054..6905e3d 100644 --- a/src/cpu/core_dyn_x86/decoder.h +++ b/src/cpu/core_dyn_x86/decoder.h @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: decoder.h,v 1.58 2009/10/08 20:01:31 c2woody Exp $ */ +/* $Id: decoder.h,v 1.59 2009/10/18 17:52:09 c2woody Exp $ */ #define X86_DYNFPU_DH_ENABLED #define X86_INLINED_MEMACCESS @@ -2665,7 +2665,8 @@ restart_prefix: dyn_push(src); break; default: - IllegalOption("opcode 0xff"); + LOG(LOG_CPU,LOG_ERROR)("CPU:GRP5:Illegal opcode 0xff"); + goto illegalopcode; }} break; default: diff --git a/src/cpu/core_dynrec/decoder.h b/src/cpu/core_dynrec/decoder.h index e2bec16..315e113 100644 --- a/src/cpu/core_dynrec/decoder.h +++ b/src/cpu/core_dynrec/decoder.h @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: decoder.h,v 1.7 2009/10/08 20:01:31 c2woody Exp $ */ +/* $Id: decoder.h,v 1.8 2009/10/18 17:52:10 c2woody Exp $ */ #include "decoder_basic.h" @@ -566,7 +566,16 @@ restart_prefix: if (dyn_grp4_eb()) goto finish_block; break; case 0xff: - if (dyn_grp4_ev()) goto core_close_block; + switch (dyn_grp4_ev()) { + case 0: + break; + case 1: + goto core_close_block; + case 2: + goto illegalopcode; + default: + break; + } break; default: diff --git a/src/cpu/core_dynrec/decoder_opcodes.h b/src/cpu/core_dynrec/decoder_opcodes.h index 45ce963..2b741f4 100644 --- a/src/cpu/core_dynrec/decoder_opcodes.h +++ b/src/cpu/core_dynrec/decoder_opcodes.h @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: decoder_opcodes.h,v 1.9 2009/06/25 19:31:43 c2woody Exp $ */ +/* $Id: decoder_opcodes.h,v 1.10 2009/10/18 17:52:10 c2woody Exp $ */ /* @@ -818,7 +818,7 @@ static bool dyn_grp4_eb(void) { return false; } -static bool dyn_grp4_ev(void) { +static Bitu dyn_grp4_ev(void) { dyn_get_modrm(); if (decode.modrm.mod<3) { dyn_fill_ea(FC_ADDR); @@ -848,10 +848,10 @@ static bool dyn_grp4_ev(void) { gen_restore_addr_reg(); gen_mov_word_from_reg(FC_ADDR,decode.big_op?(void*)(®_eip):(void*)(®_ip),decode.big_op); - return true; + return 1; case 0x4: // JMP Ev gen_mov_word_from_reg(FC_OP1,decode.big_op?(void*)(®_eip):(void*)(®_ip),decode.big_op); - return true; + return 1; case 0x3: // CALL Ep case 0x5: // JMP Ep if (!decode.big_op) gen_extend_word(false,FC_OP1); @@ -865,15 +865,16 @@ static bool dyn_grp4_ev(void) { gen_restore_reg(FC_OP1,FC_ADDR); gen_call_function_IRRR(decode.modrm.reg == 3 ? (void*)(&CPU_CALL) : (void*)(&CPU_JMP), decode.big_op,FC_OP2,FC_ADDR,FC_RETOP); - return true; + return 1; case 0x6: // PUSH Ev if (decode.big_op) gen_call_function_raw((void*)&dynrec_push_dword); else gen_call_function_raw((void*)&dynrec_push_word); break; default: - IllegalOptionDynrec("dyn_grp4_ev"); +// IllegalOptionDynrec("dyn_grp4_ev"); + return 2; } - return false; + return 0; } diff --git a/src/cpu/core_normal/prefix_66.h b/src/cpu/core_normal/prefix_66.h index 01d5156..bfccf6b 100644 --- a/src/cpu/core_normal/prefix_66.h +++ b/src/cpu/core_normal/prefix_66.h @@ -709,8 +709,8 @@ else {GetEAa;Push_32(LoadMd(eaa));} break; default: - E_Exit("CPU:66:GRP5:Illegal call %2X",which); - break; + LOG(LOG_CPU,LOG_ERROR)("CPU:66:GRP5:Illegal call %2X",which); + goto illegal_opcode; } break; } diff --git a/src/cpu/core_normal/prefix_none.h b/src/cpu/core_normal/prefix_none.h index 1a7a419..e693c58 100644 --- a/src/cpu/core_normal/prefix_none.h +++ b/src/cpu/core_normal/prefix_none.h @@ -1165,8 +1165,8 @@ else {GetEAa;Push_16(LoadMw(eaa));} break; default: - E_Exit("CPU:GRP5:Illegal Call %2X",which); - break; + LOG(LOG_CPU,LOG_ERROR)("CPU:GRP5:Illegal Call %2X",which); + goto illegal_opcode; } break; } diff --git a/src/gui/midi_coreaudio.h b/src/gui/midi_coreaudio.h index 98f8185..f8da25d 100644 --- a/src/gui/midi_coreaudio.h +++ b/src/gui/midi_coreaudio.h @@ -16,7 +16,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* $Id: midi_coreaudio.h,v 1.12 2009/10/18 18:06:28 qbix79 Exp $ */ + #include +#include // A macro to simplify error handling a bit. #define RequireNoErr(error) \ diff --git a/src/hardware/sblaster.cpp b/src/hardware/sblaster.cpp index d5e3275..60e19ff 100644 --- a/src/hardware/sblaster.cpp +++ b/src/hardware/sblaster.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: sblaster.cpp,v 1.77 2009/07/11 10:39:38 harekiet Exp $ */ +/* $Id: sblaster.cpp,v 1.78 2009/10/25 16:22:22 c2woody Exp $ */ #include #include @@ -250,7 +250,7 @@ static INLINE void SB_RaiseIRQ(SB_IRQS type) { switch (type) { case SB_IRQ_8: if (sb.irq.pending_8bit) { - E_Exit("SB: 8bit irq pending"); +// LOG_MSG("SB: 8bit irq pending"); return; } sb.irq.pending_8bit=true; @@ -258,7 +258,7 @@ static INLINE void SB_RaiseIRQ(SB_IRQS type) { break; case SB_IRQ_16: if (sb.irq.pending_16bit) { - E_Exit("SB: 16bit irq pending"); +// LOG_MSG("SB: 16bit irq pending"); return; } sb.irq.pending_16bit=true; diff --git a/src/ints/int10_char.cpp b/src/ints/int10_char.cpp index 379aa2e..cc68bef 100644 --- a/src/ints/int10_char.cpp +++ b/src/ints/int10_char.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: int10_char.cpp,v 1.59 2009/07/11 10:25:25 c2woody Exp $ */ +/* $Id: int10_char.cpp,v 1.60 2009/10/15 20:36:56 c2woody Exp $ */ /* Character displaying moving functions */ @@ -26,18 +26,18 @@ #include "inout.h" #include "int10.h" -static void CGA2_CopyRow(Bit8u cleft,Bit8u cright,Bit8u rold,Bit8u rnew,PhysPt base) { - Bit8u cheight = real_readb(BIOSMEM_SEG,BIOSMEM_CHAR_HEIGHT); - PhysPt dest=base+((CurMode->twidth*rnew)*(cheight/2)+cleft); - PhysPt src=base+((CurMode->twidth*rold)*(cheight/2)+cleft); - Bitu copy=(cright-cleft); - Bitu nextline=CurMode->twidth; - for (Bitu i=0;itwidth*rnew)*(cheight/2)+cleft); + PhysPt src=base+((CurMode->twidth*rold)*(cheight/2)+cleft); + Bitu copy=(cright-cleft); + Bitu nextline=CurMode->twidth; + for (Bitu i=0;itwidth*rnew)*(cheight/4)+cleft)*4; PhysPt src=base+((CurMode->twidth*rold)*(cheight/4)+cleft)*4; Bitu copy=(cright-cleft)*4;Bitu nextline=CurMode->twidth*4; - for (Bitu i=0;itwidth*row)*(cheight/2)+cleft); - Bitu copy=(cright-cleft); - Bitu nextline=CurMode->twidth; - attr=(attr & 0x3) | ((attr & 0x3) << 2) | ((attr & 0x3) << 4) | ((attr & 0x3) << 6); - for (Bitu i=0;itwidth*row)*(cheight/2)+cleft); + Bitu copy=(cright-cleft); + Bitu nextline=CurMode->twidth; + attr=(attr & 0x3) | ((attr & 0x3) << 2) | ((attr & 0x3) << 4) | ((attr & 0x3) << 6); + for (Bitu i=0;itwidth*row)*(cheight/2)+cleft)*2; @@ -411,10 +410,10 @@ void ReadCharAttr(Bit16u col,Bit16u row,Bit8u page,Bit16u * result) { Bit8u bitline=mem_readb(fontdata++); Bit8u res=0; Bit8u vidline=0; - Bit16u tx=x; + Bit16u tx=(Bit16u)x; while (bitsel) { //Construct bitline in memory - INT10_GetPixel(tx,y,page,&res); + INT10_GetPixel(tx,(Bit16u)y,page,&res); if(res) vidline|=bitsel; tx++; bitsel>>=1; @@ -517,10 +516,10 @@ void WriteChar(Bit16u col,Bit16u row,Bit8u page,Bit8u chr,Bit8u attr,bool useatt Bit8u bitsel=128; Bit8u bitline = mem_readb(Real2Phys( fontdata )); fontdata = RealMake( RealSeg( fontdata ), RealOff( fontdata ) + 1); - Bit16u tx=x; + Bit16u tx=(Bit16u)x; while (bitsel) { - if (bitline&bitsel) INT10_PutPixel(tx,y,page,attr); - else INT10_PutPixel(tx,y,page,attr & xor_mask); + if (bitline&bitsel) INT10_PutPixel(tx,(Bit16u)y,page,attr); + else INT10_PutPixel(tx,(Bit16u)y,page,attr & xor_mask); tx++; bitsel>>=1; } @@ -594,7 +593,7 @@ static void INT10_TeletypeOutputAttr(Bit8u chr,Bit8u attr,bool useattr,Bit8u pag if(cur_row==nrows) { //Fill with black on non-text modes and with 0x7 on textmode Bit8u fill = (CurMode->type == M_TEXT)?0x7:0; - INT10_ScrollWindow(0,0,(Bit8u)(nrows-1),ncols-1,-1,fill,page); + INT10_ScrollWindow(0,0,(Bit8u)(nrows-1),(Bit8u)(ncols-1),-1,fill,page); cur_row--; } // Set the cursor for the page diff --git a/src/ints/int10_modes.cpp b/src/ints/int10_modes.cpp index d969b7c..3260a60 100644 --- a/src/ints/int10_modes.cpp +++ b/src/ints/int10_modes.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: int10_modes.cpp,v 1.90 2009/09/06 19:25:34 c2woody Exp $ */ +/* $Id: int10_modes.cpp,v 1.91 2009/10/19 16:00:22 h-a-l-9000 Exp $ */ #include @@ -607,8 +607,9 @@ bool INT10_SetVideoMode_OTHER(Bit16u mode,bool clearmem) { RealOff(vparams) + i + crtc_block_index*16) << 8)); if (machine==MCH_CGA) { // mode register - IO_WriteB(crtc_base + 4, real_readb(RealSeg(vparams), - RealOff(vparams) + 4*16 + 24 + mode)); + Bit8u mode_control = real_readb(RealSeg(vparams), RealOff(vparams) + 80 + mode); + IO_WriteB(crtc_base + 4, mode_control); + real_writeb(BIOSMEM_SEG,BIOSMEM_CURRENT_MSR, mode_control); } if (machine==MCH_TANDY) {