sync with svn

This commit is contained in:
dborth 2009-11-17 06:33:14 +00:00
parent 336d2c0758
commit 357f2c7bb6
9 changed files with 72 additions and 29 deletions

View File

@ -584,9 +584,13 @@ switch (inst.code.op) {
SETFLAGBIT(CF,(inst_op1_d & (1 << (inst_op2_d & 31)))); SETFLAGBIT(CF,(inst_op1_d & (1 << (inst_op2_d & 31))));
inst_op1_d&=~(1 << (inst_op2_d & 31)); inst_op1_d&=~(1 << (inst_op2_d & 31));
break; break;
case O_BSWAP: case O_BSWAPw:
if (CPU_ArchitectureType<CPU_ARCHTYPE_486OLDSLOW) goto illegalopcode; if (CPU_ArchitectureType<CPU_ARCHTYPE_486OLDSLOW) goto illegalopcode;
BSWAP(inst_op1_d); BSWAPW(inst_op1_w);
break;
case O_BSWAPd:
if (CPU_ArchitectureType<CPU_ARCHTYPE_486OLDSLOW) goto illegalopcode;
BSWAPD(inst_op1_d);
break; break;
case O_CMPXCHG: case O_CMPXCHG:
if (CPU_ArchitectureType<CPU_ARCHTYPE_486NEWSLOW) goto illegalopcode; if (CPU_ArchitectureType<CPU_ARCHTYPE_486NEWSLOW) goto illegalopcode;

View File

@ -321,10 +321,10 @@ static OpCode OpCodeTable[1024]={
{0 ,0 ,0 ,0 },{0 ,0 ,0 ,0 }, {0 ,0 ,0 ,0 },{0 ,0 ,0 ,0 },
{0 ,0 ,0 ,0 },{0 ,0 ,0 ,0 }, {0 ,0 ,0 ,0 },{0 ,0 ,0 ,0 },
/* 0x1c8 - 0x1cf */ /* 0x1c8 - 0x1cf */
{L_REGd ,O_BSWAP ,S_REGd ,REGI_AX},{L_REGd ,O_BSWAP ,S_REGd ,REGI_CX}, {L_REGw ,O_BSWAPw ,S_REGw ,REGI_AX},{L_REGw ,O_BSWAPw ,S_REGw ,REGI_CX},
{L_REGd ,O_BSWAP ,S_REGd ,REGI_DX},{L_REGd ,O_BSWAP ,S_REGd ,REGI_BX}, {L_REGw ,O_BSWAPw ,S_REGw ,REGI_DX},{L_REGw ,O_BSWA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I}, {L_REGd ,O_BSWAPd ,S_REGd ,REGI_SI},{L_REGd ,O_BSWAPd ,S_REGd ,REGI_DI},
/* 0x3d0 - 0x3d7 */ /* 0x3d0 - 0x3d7 */
{0 ,0 ,0 ,0 },{0 ,0 ,0 ,0 }, {0 ,0 ,0 ,0 },{0 ,0 ,0 ,0 },

View File

@ -94,7 +94,8 @@ enum {
O_BTd,O_BTSd,O_BTRd,O_BTCd, O_BTd,O_BTSd,O_BTRd,O_BTCd,
O_BSFw,O_BSRw,O_BSFd,O_BSRd, O_BSFw,O_BSRw,O_BSFd,O_BSRd,
O_BSWAP,O_CMPXCHG, O_BSWAPw, O_BSWAPd,
O_CMPXCHG,
O_FPU O_FPU

View File

@ -588,28 +588,28 @@
else {GetEAa;*rmrw=LoadMw(eaa);SaveMw(eaa,LoadMw(eaa)+oldrmrw);} else {GetEAa;*rmrw=LoadMw(eaa);SaveMw(eaa,LoadMw(eaa)+oldrmrw);}
break; break;
} }
CASE_0F_B(0xc8) /* BSWAP EAX */ CASE_0F_W(0xc8) /* BSWAP AX */
if (CPU_ArchitectureType<CPU_ARCHTYPE_486OLDSLOW) goto illegal_opcode; if (CPU_ArchitectureType<CPU_ARCHTYPE_486OLDSLOW) goto illegal_opcode;
BSWAP(reg_eax);break; BSWAPW(reg_ax);break;
CASE_0F_B(0xc9) /* BSWAP ECX */ CASE_0F_W(0xc9) /* BSWAP CX */
if (CPU_ArchitectureType<CPU_ARCHTYPE_486OLDSLOW) goto illegal_opcode; if (CPU_ArchitectureType<CPU_ARCHTYPE_486OLDSLOW) goto illegal_opcode;
BSWAP(reg_ecx);break; BSWAPW(reg_cx);break;
CASE_0F_B(0xca) /* BSWAP EDX */ CASE_0F_W(0xca) /* BSWAP DX */
if (CPU_ArchitectureType<CPU_ARCHTYPE_486OLDSLOW) goto illegal_opcode; if (CPU_ArchitectureType<CPU_ARCHTYPE_486OLDSLOW) goto illegal_opcode;
BSWAP(reg_edx);break; BSWAPW(reg_dx);break;
CASE_0F_B(0xcb) /* BSWAP EBX */ CASE_0F_W(0xcb) /* BSWAP BX */
if (CPU_ArchitectureType<CPU_ARCHTYPE_486OLDSLOW) goto illegal_opcode; if (CPU_ArchitectureType<CPU_ARCHTYPE_486OLDSLOW) goto illegal_opcode;
BSWAP(reg_ebx);break; BSWAPW(reg_bx);break;
CASE_0F_B(0xcc) /* BSWAP ESP */ CASE_0F_W(0xcc) /* BSWAP SP */
if (CPU_ArchitectureType<CPU_ARCHTYPE_486OLDSLOW) goto illegal_opcode; if (CPU_ArchitectureType<CPU_ARCHTYPE_486OLDSLOW) goto illegal_opcode;
BSWAP(reg_esp);break; BSWAPW(reg_sp);break;
CASE_0F_B(0xcd) /* BSWAP EBP */ CASE_0F_W(0xcd) /* BSWAP BP */
if (CPU_ArchitectureType<CPU_ARCHTYPE_486OLDSLOW) goto illegal_opcode; if (CPU_ArchitectureType<CPU_ARCHTYPE_486OLDSLOW) goto illegal_opcode;
BSWAP(reg_ebp);break; BSWAPW(reg_bp);break;
CASE_0F_B(0xce) /* BSWAP ESI */ CASE_0F_W(0xce) /* BSWAP SI */
if (CPU_ArchitectureType<CPU_ARCHTYPE_486OLDSLOW) goto illegal_opcode; if (CPU_ArchitectureType<CPU_ARCHTYPE_486OLDSLOW) goto illegal_opcode;
BSWAP(reg_esi);break; BSWAPW(reg_si);break;
CASE_0F_B(0xcf) /* BSWAP EDI */ CASE_0F_W(0xcf) /* BSWAP DI */
if (CPU_ArchitectureType<CPU_ARCHTYPE_486OLDSLOW) goto illegal_opcode; if (CPU_ArchitectureType<CPU_ARCHTYPE_486OLDSLOW) goto illegal_opcode;
BSWAP(reg_edi);break; BSWAPW(reg_di);break;

View File

@ -439,3 +439,27 @@
else {GetEAa;*rmrd=LoadMd(eaa);SaveMd(eaa,LoadMd(eaa)+oldrmrd);} else {GetEAa;*rmrd=LoadMd(eaa);SaveMd(eaa,LoadMd(eaa)+oldrmrd);}
break; break;
} }
CASE_0F_D(0xc8) /* BSWAP EAX */
if (CPU_ArchitectureType<CPU_ARCHTYPE_486OLDSLOW) goto illegal_opcode;
BSWAPD(reg_eax);break;
CASE_0F_D(0xc9) /* BSWAP ECX */
if (CPU_ArchitectureType<CPU_ARCHTYPE_486OLDSLOW) goto illegal_opcode;
BSWAPD(reg_ecx);break;
CASE_0F_D(0xca) /* BSWAP EDX */
if (CPU_ArchitectureType<CPU_ARCHTYPE_486OLDSLOW) goto illegal_opcode;
BSWAPD(reg_edx);break;
CASE_0F_D(0xcb) /* BSWAP EBX */
if (CPU_ArchitectureType<CPU_ARCHTYPE_486OLDSLOW) goto illegal_opcode;
BSWAPD(reg_ebx);break;
CASE_0F_D(0xcc) /* BSWAP ESP */
if (CPU_ArchitectureType<CPU_ARCHTYPE_486OLDSLOW) goto illegal_opcode;
BSWAPD(reg_esp);break;
CASE_0F_D(0xcd) /* BSWAP EBP */
if (CPU_ArchitectureType<CPU_ARCHTYPE_486OLDSLOW) goto illegal_opcode;
BSWAPD(reg_ebp);break;
CASE_0F_D(0xce) /* BSWAP ESI */
if (CPU_ArchitectureType<CPU_ARCHTYPE_486OLDSLOW) goto illegal_opcode;
BSWAPD(reg_esi);break;
CASE_0F_D(0xcf) /* BSWAP EDI */
if (CPU_ArchitectureType<CPU_ARCHTYPE_486OLDSLOW) goto illegal_opcode;
BSWAPD(reg_edi);break;

View File

@ -956,5 +956,8 @@
save(op1,lf_resd); \ save(op1,lf_resd); \
lflags.type=t_DSHRd; lflags.type=t_DSHRd;
#define BSWAP(op1) \ #define BSWAPW(op1) \
op1 = 0;
#define BSWAPD(op1) \
op1 = (op1>>24)|((op1>>8)&0xFF00)|((op1<<8)&0xFF0000)|((op1<<24)&0xFF000000); op1 = (op1>>24)|((op1>>8)&0xFF00)|((op1<<8)&0xFF0000)|((op1<<24)&0xFF000000);

View File

@ -227,11 +227,19 @@ bool CDROM_Interface_Image::GetMediaTrayStatus(bool& mediaPresent, bool& mediaCh
bool CDROM_Interface_Image::PlayAudioSector(unsigned long start,unsigned long len) bool CDROM_Interface_Image::PlayAudioSector(unsigned long start,unsigned long len)
{ {
// We might want to do some more checks. E.g valid start and length
SDL_mutexP(player.mutex); SDL_mutexP(player.mutex);
player.cd = this; player.cd = this;
player.currFrame = start; player.currFrame = start;
player.targetFrame = start + len; player.targetFrame = start + len;
player.isPlaying = true; int track = GetTrack(start) - 1;
if(track >= 0 && tracks[track].attr == 0x40) {
LOG(LOG_MISC,LOG_WARN)("Game tries to play the data track. Not doing this");
player.isPlaying = false;
//Unclear wether return false should be here.
//specs say that this function returns at once and games should check the status wether the audio is actually playing
//Real drives either fail or succeed as well
} else player.isPlaying = true;
player.isPaused = false; player.isPaused = false;
SDL_mutexV(player.mutex); SDL_mutexV(player.mutex);
return true; return true;
@ -239,6 +247,7 @@ bool CDROM_Interface_Image::PlayAudioSector(unsigned long start,unsigned long le
bool CDROM_Interface_Image::PauseAudio(bool resume) bool CDROM_Interface_Image::PauseAudio(bool resume)
{ {
if (!player.isPlaying) return false;
player.isPaused = !resume; player.isPaused = !resume;
return true; return true;
} }

View File

@ -430,6 +430,7 @@ bool CDROM_Interface_Ioctl::PauseAudio(bool resume) {
return false; return false;
} }
if (use_dxplay) { if (use_dxplay) {
if (!player.isPlaying) return false;
player.isPaused = !resume; player.isPaused = !resume;
return true; return true;
} }

View File

@ -1065,6 +1065,7 @@ void CSerial::Init_Registers () {
Write_LCR (lcrresult); Write_LCR (lcrresult);
updateMSR(); updateMSR();
Read_MSR(); Read_MSR();
PIC_DeActivateIRQ(irq);
} }
CSerial::CSerial(Bitu id, CommandLine* cmd) { CSerial::CSerial(Bitu id, CommandLine* cmd) {