/[pcsx2_0.9.7]/trunk/pcsx2/R5900OpcodeImpl.cpp
ViewVC logotype

Diff of /trunk/pcsx2/R5900OpcodeImpl.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 31 by william, Tue Sep 7 03:24:11 2010 UTC revision 62 by william, Tue Sep 7 11:08:22 2010 UTC
# Line 24  Line 24 
24  #include "R5900Exceptions.h"  #include "R5900Exceptions.h"
25    
26    
27  static __forceinline s64 _add64_Overflow( s64 x, s64 y )  static __fi s64 _add64_Overflow( s64 x, s64 y )
28  {  {
29          const s64 result = x + y;          const s64 result = x + y;
30    
# Line 43  static __forceinline s64 _add64_Overflow Line 43  static __forceinline s64 _add64_Overflow
43          return result;          return result;
44  }  }
45    
46  static __forceinline s64 _add32_Overflow( s32 x, s32 y )  static __fi s64 _add32_Overflow( s32 x, s32 y )
47  {  {
48          GPR_reg64 result;  result.SD[0] = (s64)x + y;          GPR_reg64 result;  result.SD[0] = (s64)x + y;
49    
# Line 199  static int __Deci2Call(int call, u32 *ad Line 199  static int __Deci2Call(int call, u32 *ad
199                                          pdeciaddr += (d2ptr[4]+0xc) % 16;                                          pdeciaddr += (d2ptr[4]+0xc) % 16;
200    
201                                  const int copylen = std::min<uint>(255, d2ptr[1]-0xc);                                  const int copylen = std::min<uint>(255, d2ptr[1]-0xc);
202                                  memcpy(deci2buffer, pdeciaddr, copylen );                                  memcpy_fast(deci2buffer, pdeciaddr, copylen );
203                                  deci2buffer[copylen] = '\0';                                  deci2buffer[copylen] = '\0';
204    
205                                  if( EmuConfig.Log.Deci2 )                                  eeConLog( ShiftJIS_ConvertString(deci2buffer) );
                                         Console.Write( ConColor_EE, L"%s", ShiftJIS_ConvertString(deci2buffer).c_str() );  
206                          }                          }
207                          ((u32*)PSM(deci2addr))[3] = 0;                          ((u32*)PSM(deci2addr))[3] = 0;
208                          return 1;                          return 1;
# Line 221  static int __Deci2Call(int call, u32 *ad Line 220  static int __Deci2Call(int call, u32 *ad
220                          return 1;                          return 1;
221    
222                  case 0x10://kputs                  case 0x10://kputs
223                          if( addr != NULL && EmuConfig.Log.Deci2 )                          if( addr != NULL )
224                                  Console.Write( ConColor_EE, L"%s", ShiftJIS_ConvertString((char*)PSM(*addr)).c_str() );                          {
225                                    eeDeci2Log( ShiftJIS_ConvertString((char*)PSM(*addr)) );
226                            }
227                          return 1;                          return 1;
228          }          }
229    
# Line 626  static __aligned16 GPR_reg m_dummy_gpr_z Line 627  static __aligned16 GPR_reg m_dummy_gpr_z
627  // Returns the x86 address of the requested GPR, which is safe for writing. (includes  // Returns the x86 address of the requested GPR, which is safe for writing. (includes
628  // special handling for returning a dummy var for GPR0(zero), so that it's value is  // special handling for returning a dummy var for GPR0(zero), so that it's value is
629  // always preserved)  // always preserved)
630  static u64* gpr_GetWritePtr( uint gpr )  static GPR_reg* gpr_GetWritePtr( uint gpr )
631  {  {
632          return (u64*)(( gpr == 0 ) ? &m_dummy_gpr_zero : &cpuRegs.GPR.r[gpr]);          return (( gpr == 0 ) ? &m_dummy_gpr_zero : &cpuRegs.GPR.r[gpr]);
633  }  }
634    
635  void LD()  void LD()
# Line 638  void LD() Line 639  void LD()
639          if( addr & 7 )          if( addr & 7 )
640                  throw R5900Exception::AddressError( addr, false );                  throw R5900Exception::AddressError( addr, false );
641    
642          memRead64(addr, gpr_GetWritePtr(_Rt_));          memRead64(addr, (u64*)gpr_GetWritePtr(_Rt_));
643  }  }
644    
645  static const u64 LDL_MASK[8] =  static const u64 LDL_MASK[8] =
# Line 686  void LQ() Line 687  void LQ()
687          // an address error due to unaligned access isn't possible like it is on other loads/stores.          // an address error due to unaligned access isn't possible like it is on other loads/stores.
688    
689          u32 addr = cpuRegs.GPR.r[_Rs_].UL[0] + _Imm_;          u32 addr = cpuRegs.GPR.r[_Rs_].UL[0] + _Imm_;
690          memRead128(addr & ~0xf, gpr_GetWritePtr(_Rt_));          memRead128(addr & ~0xf, (u128*)gpr_GetWritePtr(_Rt_));
691  }  }
692    
693  void SB()  void SB()
# Line 815  void SQ() Line 816  void SQ()
816          // an address error due to unaligned access isn't possible like it is on other loads/stores.          // an address error due to unaligned access isn't possible like it is on other loads/stores.
817    
818          u32 addr = cpuRegs.GPR.r[_Rs_].UL[0] + _Imm_;          u32 addr = cpuRegs.GPR.r[_Rs_].UL[0] + _Imm_;
819          memWrite128(addr & ~0xf, &cpuRegs.GPR.r[_Rt_].UD[0]);          memWrite128(addr & ~0xf, cpuRegs.GPR.r[_Rt_].UQ);
820  }  }
821    
822  /*********************************************************  /*********************************************************
# Line 859  void SYSCALL() Line 860  void SYSCALL()
860          if (call == 0x7c)          if (call == 0x7c)
861          {          {
862                  if(cpuRegs.GPR.n.a0.UL[0] == 0x10)                  if(cpuRegs.GPR.n.a0.UL[0] == 0x10)
863                          Console.Write( ConColor_EE, L"%s", ShiftJIS_ConvertString((char*)PSM(memRead32(cpuRegs.GPR.n.a1.UL[0]))).c_str() );                  {
864                            eeConLog( ShiftJIS_ConvertString((char*)PSM(memRead32(cpuRegs.GPR.n.a1.UL[0]))) );
865                    }
866                  else                  else
867                          __Deci2Call( cpuRegs.GPR.n.a0.UL[0], (u32*)PSM(cpuRegs.GPR.n.a1.UL[0]) );                          __Deci2Call( cpuRegs.GPR.n.a0.UL[0], (u32*)PSM(cpuRegs.GPR.n.a1.UL[0]) );
868          }          }
869    
870          // The only thing this code is used for is the one log message, so don't execute it if we aren't logging bios messages.          // The only thing this code is used for is the one log message, so don't execute it if we aren't logging bios messages.
871  #ifdef PCSX2_DEVBUILD          if (SysTraceActive(EE.Bios) && (call == 0x77))
         if (macTrace.EE.Bios() && (call == 0x77))  
872          {          {
873                  t_sif_dma_transfer *dmat;                  t_sif_dma_transfer *dmat;
874                  //struct t_sif_cmd_header       *hdr;                  //struct t_sif_cmd_header       *hdr;
# Line 888  void SYSCALL() Line 890  void SYSCALL()
890                                  dmat->dest, dmat->src);                                  dmat->dest, dmat->src);
891                  }                  }
892          }          }
 #endif  
893    
894          cpuRegs.pc -= 4;          cpuRegs.pc -= 4;
895          cpuException(0x20, cpuRegs.branch);          cpuException(0x20, cpuRegs.branch);

Legend:
Removed from v.31  
changed lines
  Added in v.62

  ViewVC Help
Powered by ViewVC 1.1.22