Linux build fixes.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1248 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
magumagu9 2008-11-22 20:11:26 +00:00
parent 159e3f5b49
commit eab369321c
3 changed files with 24 additions and 7 deletions

View File

@ -171,8 +171,13 @@ void UpdateInterrupts();
//inline void WriteLow (u32& _reg, u16 lowbits) {_reg = (_reg & 0xFFFF0000) | lowbits;} //inline void WriteLow (u32& _reg, u16 lowbits) {_reg = (_reg & 0xFFFF0000) | lowbits;}
//inline void WriteHigh(u32& _reg, u16 highbits) {_reg = (_reg & 0x0000FFFF) | ((u32)highbits << 16);} //inline void WriteHigh(u32& _reg, u16 highbits) {_reg = (_reg & 0x0000FFFF) | ((u32)highbits << 16);}
#ifdef _WIN32
inline void WriteLow (volatile u32& _reg, u16 lowbits) {InterlockedExchange((LONG*)&_reg,(_reg & 0xFFFF0000) | lowbits);} inline void WriteLow (volatile u32& _reg, u16 lowbits) {InterlockedExchange((LONG*)&_reg,(_reg & 0xFFFF0000) | lowbits);}
inline void WriteHigh(volatile u32& _reg, u16 highbits) {InterlockedExchange((LONG*)&_reg,(_reg & 0x0000FFFF) | ((u32)highbits << 16));} inline void WriteHigh(volatile u32& _reg, u16 highbits) {InterlockedExchange((LONG*)&_reg,(_reg & 0x0000FFFF) | ((u32)highbits << 16));}
#else
inline void WriteLow (volatile u32& _reg, u16 lowbits) {Common::InterlockedExchange((int*)&_reg,(_reg & 0xFFFF0000) | lowbits);}
inline void WriteHigh(volatile u32& _reg, u16 highbits) {Common::InterlockedExchange((int*)&_reg,(_reg & 0x0000FFFF) | ((u32)highbits << 16));}
#endif
inline u16 ReadLow (u32 _reg) {return (u16)(_reg & 0xFFFF);} inline u16 ReadLow (u32 _reg) {return (u16)(_reg & 0xFFFF);}
inline u16 ReadHigh (u32 _reg) {return (u16)(_reg >> 16);} inline u16 ReadHigh (u32 _reg) {return (u16)(_reg >> 16);}
@ -711,7 +716,11 @@ void UpdateFifoRegister()
else else
dist = (wp - fifo.CPBase) + (fifo.CPEnd - rp); dist = (wp - fifo.CPBase) + (fifo.CPEnd - rp);
//fifo.CPReadWriteDistance = dist; //fifo.CPReadWriteDistance = dist;
#ifdef _WIN32
InterlockedExchange((LONG*)&fifo.CPReadWriteDistance, dist); InterlockedExchange((LONG*)&fifo.CPReadWriteDistance, dist);
#else
Common::InterlockedExchange((int*)&fifo.CPReadWriteDistance, dist);
#endif
if (!Core::g_CoreStartupParameter.bUseDualCore) if (!Core::g_CoreStartupParameter.bUseDualCore)
CatchUpGPU(); CatchUpGPU();
} }

View File

@ -116,7 +116,11 @@ void Fifo_EnterLoop(const SVideoInitialize &video_initialize)
// check if we are able to run this buffer // check if we are able to run this buffer
if ((_fifo.bFF_GPReadEnable) && _fifo.CPReadWriteDistance && !(_fifo.bFF_BPEnable && _fifo.bFF_Breakpoint)) if ((_fifo.bFF_GPReadEnable) && _fifo.CPReadWriteDistance && !(_fifo.bFF_BPEnable && _fifo.bFF_Breakpoint))
{ {
#ifdef _WIN32
InterlockedExchange((LONG*)&_fifo.CPReadIdle, 0); InterlockedExchange((LONG*)&_fifo.CPReadIdle, 0);
#else
Common::InterlockedExchange((int*)&_fifo.CPReadIdle, 0);
#endif
#if defined(THREAD_VIDEO_WAKEUP_ONIDLE) && defined(_WIN32) #if defined(THREAD_VIDEO_WAKEUP_ONIDLE) && defined(_WIN32)
while(_fifo.CPReadWriteDistance > 0) while(_fifo.CPReadWriteDistance > 0)
#else #else
@ -169,7 +173,11 @@ void Fifo_EnterLoop(const SVideoInitialize &video_initialize)
#endif #endif
} }
//video_initialize.pLog("IDLE",FALSE); //video_initialize.pLog("IDLE",FALSE);
#ifdef _WIN32
InterlockedExchange((LONG*)&_fifo.CPReadIdle, 1); InterlockedExchange((LONG*)&_fifo.CPReadIdle, 1);
#else
Common::InterlockedExchange((int*)&_fifo.CPReadIdle, 1);
#endif
} }
} }
#if defined(THREAD_VIDEO_WAKEUP_ONIDLE) && defined(_WIN32) #if defined(THREAD_VIDEO_WAKEUP_ONIDLE) && defined(_WIN32)

View File

@ -99,10 +99,10 @@ void ConfigDialog::CreateGUIControls()
m_RenderToMainWindow->SetValue(g_Config.renderToMainframe); m_RenderToMainWindow->SetValue(g_Config.renderToMainframe);
m_StretchToFit = new wxCheckBox(m_PageGeneral, ID_STRETCHTOFIT, wxT("Stretch to fit"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); m_StretchToFit = new wxCheckBox(m_PageGeneral, ID_STRETCHTOFIT, wxT("Stretch to fit"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_StretchToFit->SetToolTip m_StretchToFit->SetToolTip
("This will use the game's native resolution and stretch it to fill the" (wxT("This will use the game's native resolution and stretch it to fill the"
"\nwindow instead of changing the internal display resolution. It" "\nwindow instead of changing the internal display resolution. It"
"\nmay result in a slightly blurrier image, but it may also give a higher" "\nmay result in a slightly blurrier image, but it may also give a higher"
"\nFPS if you have a slow graphics card."); "\nFPS if you have a slow graphics card."));
m_StretchToFit->SetValue(g_Config.bStretchToFit); m_StretchToFit->SetValue(g_Config.bStretchToFit);
m_KeepAR = new wxCheckBox(m_PageGeneral, ID_KEEPAR, wxT("Keep 4:3 aspect ratio"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); m_KeepAR = new wxCheckBox(m_PageGeneral, ID_KEEPAR, wxT("Keep 4:3 aspect ratio"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_KeepAR->SetValue(g_Config.bKeepAR); m_KeepAR->SetValue(g_Config.bKeepAR);
@ -195,18 +195,18 @@ void ConfigDialog::CreateGUIControls()
sbHacks = new wxStaticBoxSizer(wxVERTICAL, m_PageAdvanced, wxT("Hacks")); sbHacks = new wxStaticBoxSizer(wxVERTICAL, m_PageAdvanced, wxT("Hacks"));
m_EFBToTextureDisable = new wxCheckBox(m_PageAdvanced, m_EFBToTextureDisable = new wxCheckBox(m_PageAdvanced,
ID_EFBTOTEXTUREDISABLE, wxT("Disable copy EFB to texture"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); ID_EFBTOTEXTUREDISABLE, wxT("Disable copy EFB to texture"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_EFBToTextureDisable->SetToolTip("Do not copy the Embedded Framebuffer (EFB)" m_EFBToTextureDisable->SetToolTip(wxT("Do not copy the Embedded Framebuffer (EFB)"
" to the\nTexture. This may result in a speed increase."); " to the\nTexture. This may result in a speed increase."));
m_EFBToTextureDisable->Enable(true); m_EFBToTextureDisable->Enable(true);
m_EFBToTextureDisable->SetValue(g_Config.bEBFToTextureDisable); m_EFBToTextureDisable->SetValue(g_Config.bEBFToTextureDisable);
m_EFBToTextureDisableHotKey = new wxCheckBox(m_PageAdvanced, m_EFBToTextureDisableHotKey = new wxCheckBox(m_PageAdvanced,
ID_EFBTOTEXTUREDISABLEHOTKEY, wxT("with hotkey E"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); ID_EFBTOTEXTUREDISABLEHOTKEY, wxT("with hotkey E"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_EFBToTextureDisableHotKey->SetToolTip("Use the E key to turn this option on and off"); m_EFBToTextureDisableHotKey->SetToolTip(wxT("Use the E key to turn this option on and off"));
m_EFBToTextureDisableHotKey->SetValue(g_Config.bEBFToTextureDisableHotKey); m_EFBToTextureDisableHotKey->SetValue(g_Config.bEBFToTextureDisableHotKey);
m_ProjectionHax1 = new wxCheckBox(m_PageAdvanced, ID_PROJECTIONHACK1, wxT("Projection before R945"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); m_ProjectionHax1 = new wxCheckBox(m_PageAdvanced, ID_PROJECTIONHACK1, wxT("Projection before R945"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
m_ProjectionHax1->SetToolTip("This may reveal otherwise invisible graphics" m_ProjectionHax1->SetToolTip(wxT("This may reveal otherwise invisible graphics"
" in\ngames like Mario Galaxy or Ikaruga."); " in\ngames like Mario Galaxy or Ikaruga."));
m_ProjectionHax1->Enable(true); m_ProjectionHax1->Enable(true);
m_ProjectionHax1->SetValue(g_Config.bProjectionHax1); m_ProjectionHax1->SetValue(g_Config.bProjectionHax1);