diff --git a/desmume/src/GPU.cpp b/desmume/src/GPU.cpp
index 5fef5a066..4d544edc7 100644
--- a/desmume/src/GPU.cpp
+++ b/desmume/src/GPU.cpp
@@ -3855,7 +3855,7 @@ bool GPUEngineBase::_ComputeSpriteVars(GPUEngineCompositorInfo &compInfo, const
if (y >= sprSize.height)
return false;
- if ((sprX == GPU_FRAMEBUFFER_NATIVE_WIDTH) || (sprX+sprSize.width <= 0)) /* sprite pixels outside of line */
+ if ((sprX == GPU_FRAMEBUFFER_NATIVE_WIDTH) || ((sprX+sprSize.width) <= 0)) /* sprite pixels outside of line */
return false; /* not to be drawn */
// sprite portion out of the screen (LEFT)
@@ -3866,7 +3866,7 @@ bool GPUEngineBase::_ComputeSpriteVars(GPUEngineCompositorInfo &compInfo, const
sprX = 0;
}
// sprite portion out of the screen (RIGHT)
- if (sprX+sprSize.width >= GPU_FRAMEBUFFER_NATIVE_WIDTH)
+ if ((sprX+sprSize.width) >= GPU_FRAMEBUFFER_NATIVE_WIDTH)
lg = GPU_FRAMEBUFFER_NATIVE_WIDTH - sprX;
// switch TOP<-->BOTTOM
@@ -7610,6 +7610,9 @@ void GPUSubsystem::Reset()
this->_displayInfo.renderedHeight[NDSDisplayID_Touch] = GPU_FRAMEBUFFER_NATIVE_HEIGHT;
this->_displayInfo.renderedBuffer[NDSDisplayID_Touch] = this->_displayInfo.nativeBuffer[NDSDisplayID_Touch];
+ this->_displayInfo.engineID[NDSDisplayID_Main] = GPUEngineID_Main;
+ this->_displayInfo.engineID[NDSDisplayID_Touch] = GPUEngineID_Sub;
+
this->_display[NDSDisplayID_Main]->SetEngineByID(GPUEngineID_Main);
this->_display[NDSDisplayID_Touch]->SetEngineByID(GPUEngineID_Sub);
@@ -8246,10 +8249,13 @@ void GPUSubsystem::RenderLine(const size_t l)
this->_displayInfo.renderedWidth[NDSDisplayID_Touch] = this->_display[NDSDisplayID_Touch]->GetEngine()->renderedWidth;
this->_displayInfo.renderedHeight[NDSDisplayID_Touch] = this->_display[NDSDisplayID_Touch]->GetEngine()->renderedHeight;
- this->_displayInfo.isDisplayEnabled[NDSDisplayID_Main] = CommonSettings.showGpu.screens[this->_display[NDSDisplayID_Main]->GetEngineID()];
- this->_displayInfo.isDisplayEnabled[NDSDisplayID_Touch] = CommonSettings.showGpu.screens[this->_display[NDSDisplayID_Touch]->GetEngineID()];
+ this->_displayInfo.engineID[NDSDisplayID_Main] = this->_display[NDSDisplayID_Main]->GetEngineID();
+ this->_displayInfo.engineID[NDSDisplayID_Touch] = this->_display[NDSDisplayID_Touch]->GetEngineID();
- this->_displayInfo.needConvertColorFormat[NDSDisplayID_Main] = (OUTPUTFORMAT == NDSColorFormat_BGR666_Rev);
+ this->_displayInfo.isDisplayEnabled[NDSDisplayID_Main] = CommonSettings.showGpu.screens[this->_displayInfo.engineID[NDSDisplayID_Main]];
+ this->_displayInfo.isDisplayEnabled[NDSDisplayID_Touch] = CommonSettings.showGpu.screens[this->_displayInfo.engineID[NDSDisplayID_Touch]];
+
+ this->_displayInfo.needConvertColorFormat[NDSDisplayID_Main] = (OUTPUTFORMAT == NDSColorFormat_BGR666_Rev);
this->_displayInfo.needConvertColorFormat[NDSDisplayID_Touch] = (OUTPUTFORMAT == NDSColorFormat_BGR666_Rev);
this->_engineMain->UpdateMasterBrightnessDisplayInfo(this->_displayInfo);
diff --git a/desmume/src/GPU.h b/desmume/src/GPU.h
index 0c55373b1..1aa0a13de 100644
--- a/desmume/src/GPU.h
+++ b/desmume/src/GPU.h
@@ -1103,6 +1103,8 @@ typedef struct
size_t renderedHeight[2]; // The display rendered at this height, measured in pixels.
void *renderedBuffer[2]; // The display rendered to this buffer.
+ GPUEngineID engineID[2]; // ID of the engine sourcing the display.
+
bool didPerformCustomRender[2]; // Reports that the display actually rendered at a custom size for this frame.
// true - The display performed a custom-sized render.
// false - The display performed a native-sized render.
diff --git a/desmume/src/frontend/cocoa/ClientDisplayView.cpp b/desmume/src/frontend/cocoa/ClientDisplayView.cpp
index 0afe2dd56..1a3095421 100644
--- a/desmume/src/frontend/cocoa/ClientDisplayView.cpp
+++ b/desmume/src/frontend/cocoa/ClientDisplayView.cpp
@@ -72,6 +72,13 @@ void ClientDisplayView::__InstanceInit(const ClientDisplayViewProperties &props)
_pixelScaler = VideoFilterTypeID_None;
_outputFilter = OutputFilterTypeID_Bilinear;
+ _displaySourceSelect[NDSDisplayID_Main] = ClientDisplaySource_DeterminedByNDS;
+ _displaySourceSelect[NDSDisplayID_Touch] = ClientDisplaySource_DeterminedByNDS;
+ _isSelectedDisplayEnabled[NDSDisplayID_Main] = true;
+ _isSelectedDisplayEnabled[NDSDisplayID_Touch] = true;
+ _selectedSourceForDisplay[NDSDisplayID_Main] = NDSDisplayID_Main;
+ _selectedSourceForDisplay[NDSDisplayID_Touch] = NDSDisplayID_Touch;
+
_useVerticalSync = false;
_scaleFactor = 1.0;
@@ -317,6 +324,26 @@ double ClientDisplayView::GetGapDistance() const
return this->_renderProperty.gapDistance;
}
+ClientDisplaySource ClientDisplayView::GetDisplayVideoSource(const NDSDisplayID displayID) const
+{
+ return this->_displaySourceSelect[displayID];
+}
+
+void ClientDisplayView::SetDisplayVideoSource(const NDSDisplayID displayID, ClientDisplaySource displaySrc)
+{
+ this->_displaySourceSelect[displayID] = displaySrc;
+}
+
+NDSDisplayID ClientDisplayView::GetSelectedDisplaySourceForDisplay(const NDSDisplayID displayID) const
+{
+ return this->_selectedSourceForDisplay[displayID];
+}
+
+bool ClientDisplayView::IsSelectedDisplayEnabled(const NDSDisplayID displayID) const
+{
+ return this->_isSelectedDisplayEnabled[displayID];
+}
+
// NDS screen filters
bool ClientDisplayView::GetSourceDeposterize()
{
@@ -561,30 +588,125 @@ void ClientDisplayView::LoadDisplays()
{
this->_emuDisplayInfo = this->_fetchObject->GetFetchDisplayInfoForBufferIndex(this->_fetchObject->GetLastFetchIndex());
- const bool loadMainScreen = this->_emuDisplayInfo.isDisplayEnabled[NDSDisplayID_Main] && ((this->_renderProperty.mode == ClientDisplayMode_Main) || (this->_renderProperty.mode == ClientDisplayMode_Dual));
- const bool loadTouchScreen = this->_emuDisplayInfo.isDisplayEnabled[NDSDisplayID_Touch] && ((this->_renderProperty.mode == ClientDisplayMode_Touch) || (this->_renderProperty.mode == ClientDisplayMode_Dual));
+ this->_selectedSourceForDisplay[NDSDisplayID_Main] = NDSDisplayID_Main;
+ this->_selectedSourceForDisplay[NDSDisplayID_Touch] = NDSDisplayID_Touch;
+ this->_isSelectedDisplayEnabled[NDSDisplayID_Main] = false;
+ this->_isSelectedDisplayEnabled[NDSDisplayID_Touch] = false;
+
+ // Select the display source
+ const ClientDisplaySource mainDisplaySrc = this->_displaySourceSelect[NDSDisplayID_Main];
+ const ClientDisplaySource touchDisplaySrc = this->_displaySourceSelect[NDSDisplayID_Touch];
+
+ switch (mainDisplaySrc)
+ {
+ case ClientDisplaySource_DeterminedByNDS:
+ this->_selectedSourceForDisplay[NDSDisplayID_Main] = NDSDisplayID_Main;
+ this->_isSelectedDisplayEnabled[NDSDisplayID_Main] = this->_emuDisplayInfo.isDisplayEnabled[NDSDisplayID_Main];
+ break;
+
+ case ClientDisplaySource_EngineMain:
+ {
+ if ( (this->_emuDisplayInfo.engineID[NDSDisplayID_Main] == GPUEngineID_Main) && (mainDisplaySrc == ClientDisplaySource_EngineMain) )
+ {
+ this->_selectedSourceForDisplay[NDSDisplayID_Main] = NDSDisplayID_Main;
+ this->_isSelectedDisplayEnabled[NDSDisplayID_Main] = this->_emuDisplayInfo.isDisplayEnabled[NDSDisplayID_Main];
+ }
+ else
+ {
+ this->_selectedSourceForDisplay[NDSDisplayID_Main] = NDSDisplayID_Touch;
+ this->_isSelectedDisplayEnabled[NDSDisplayID_Main] = this->_emuDisplayInfo.isDisplayEnabled[NDSDisplayID_Touch];
+ }
+ break;
+ }
+
+ case ClientDisplaySource_EngineSub:
+ {
+ if ( (this->_emuDisplayInfo.engineID[NDSDisplayID_Main] == GPUEngineID_Sub) && (mainDisplaySrc == ClientDisplaySource_EngineSub) )
+ {
+ this->_selectedSourceForDisplay[NDSDisplayID_Main] = NDSDisplayID_Main;
+ this->_isSelectedDisplayEnabled[NDSDisplayID_Main] = this->_emuDisplayInfo.isDisplayEnabled[NDSDisplayID_Main];
+ }
+ else
+ {
+ this->_selectedSourceForDisplay[NDSDisplayID_Main] = NDSDisplayID_Touch;
+ this->_isSelectedDisplayEnabled[NDSDisplayID_Main] = this->_emuDisplayInfo.isDisplayEnabled[NDSDisplayID_Touch];
+ }
+ break;
+ }
+
+ case ClientDisplaySource_None:
+ default:
+ this->_isSelectedDisplayEnabled[NDSDisplayID_Main] = false;
+ break;
+ }
+
+ switch (touchDisplaySrc)
+ {
+ case ClientDisplaySource_DeterminedByNDS:
+ this->_selectedSourceForDisplay[NDSDisplayID_Touch] = NDSDisplayID_Touch;
+ this->_isSelectedDisplayEnabled[NDSDisplayID_Touch] = this->_emuDisplayInfo.isDisplayEnabled[NDSDisplayID_Touch];
+ break;
+
+ case ClientDisplaySource_EngineMain:
+ {
+ if ( (this->_emuDisplayInfo.engineID[NDSDisplayID_Touch] == GPUEngineID_Main) && (touchDisplaySrc == ClientDisplaySource_EngineMain) )
+ {
+ this->_selectedSourceForDisplay[NDSDisplayID_Touch] = NDSDisplayID_Touch;
+ this->_isSelectedDisplayEnabled[NDSDisplayID_Touch] = this->_emuDisplayInfo.isDisplayEnabled[NDSDisplayID_Touch];
+ }
+ else
+ {
+ this->_selectedSourceForDisplay[NDSDisplayID_Touch] = NDSDisplayID_Main;
+ this->_isSelectedDisplayEnabled[NDSDisplayID_Touch] = this->_emuDisplayInfo.isDisplayEnabled[NDSDisplayID_Main];
+ }
+ break;
+ }
+
+ case ClientDisplaySource_EngineSub:
+ {
+ if ( (this->_emuDisplayInfo.engineID[NDSDisplayID_Touch] == GPUEngineID_Sub) && (touchDisplaySrc == ClientDisplaySource_EngineSub) )
+ {
+ this->_selectedSourceForDisplay[NDSDisplayID_Touch] = NDSDisplayID_Touch;
+ this->_isSelectedDisplayEnabled[NDSDisplayID_Touch] = this->_emuDisplayInfo.isDisplayEnabled[NDSDisplayID_Touch];
+ }
+ else
+ {
+ this->_selectedSourceForDisplay[NDSDisplayID_Touch] = NDSDisplayID_Main;
+ this->_isSelectedDisplayEnabled[NDSDisplayID_Touch] = this->_emuDisplayInfo.isDisplayEnabled[NDSDisplayID_Main];
+ }
+ break;
+ }
+
+ case ClientDisplaySource_None:
+ default:
+ this->_isSelectedDisplayEnabled[NDSDisplayID_Touch] = false;
+ break;
+ }
+
+ const bool loadMainScreen = this->_isSelectedDisplayEnabled[NDSDisplayID_Main] && ((this->_renderProperty.mode == ClientDisplayMode_Main) || (this->_renderProperty.mode == ClientDisplayMode_Dual));
+ const bool loadTouchScreen = this->_isSelectedDisplayEnabled[NDSDisplayID_Touch] && ((this->_renderProperty.mode == ClientDisplayMode_Touch) || (this->_renderProperty.mode == ClientDisplayMode_Dual)) && (this->_selectedSourceForDisplay[NDSDisplayID_Main] != this->_selectedSourceForDisplay[NDSDisplayID_Touch]);
if (loadMainScreen)
{
- if (!this->_emuDisplayInfo.didPerformCustomRender[NDSDisplayID_Main])
+ if (!this->_emuDisplayInfo.didPerformCustomRender[this->_selectedSourceForDisplay[NDSDisplayID_Main]])
{
- this->_LoadNativeDisplayByID(NDSDisplayID_Main);
+ this->_LoadNativeDisplayByID(this->_selectedSourceForDisplay[NDSDisplayID_Main]);
}
else
{
- this->_LoadCustomDisplayByID(NDSDisplayID_Main);
+ this->_LoadCustomDisplayByID(this->_selectedSourceForDisplay[NDSDisplayID_Main]);
}
}
if (loadTouchScreen)
{
- if (!this->_emuDisplayInfo.didPerformCustomRender[NDSDisplayID_Touch])
+ if (!this->_emuDisplayInfo.didPerformCustomRender[this->_selectedSourceForDisplay[NDSDisplayID_Touch]])
{
- this->_LoadNativeDisplayByID(NDSDisplayID_Touch);
+ this->_LoadNativeDisplayByID(this->_selectedSourceForDisplay[NDSDisplayID_Touch]);
}
else
{
- this->_LoadCustomDisplayByID(NDSDisplayID_Touch);
+ this->_LoadCustomDisplayByID(this->_selectedSourceForDisplay[NDSDisplayID_Touch]);
}
}
}
diff --git a/desmume/src/frontend/cocoa/ClientDisplayView.h b/desmume/src/frontend/cocoa/ClientDisplayView.h
index b5ee62e2b..5ef045e8f 100644
--- a/desmume/src/frontend/cocoa/ClientDisplayView.h
+++ b/desmume/src/frontend/cocoa/ClientDisplayView.h
@@ -57,6 +57,14 @@ enum ClientDisplayOrder
ClientDisplayOrder_TouchFirst
};
+enum ClientDisplaySource
+{
+ ClientDisplaySource_None = 0,
+ ClientDisplaySource_DeterminedByNDS = 1,
+ ClientDisplaySource_EngineMain = 2,
+ ClientDisplaySource_EngineSub = 3
+};
+
enum OutputFilterTypeID
{
OutputFilterTypeID_NearestNeighbor = 0,
@@ -139,6 +147,10 @@ protected:
VideoFilterTypeID _pixelScaler;
OutputFilterTypeID _outputFilter;
+ ClientDisplaySource _displaySourceSelect[2];
+ bool _isSelectedDisplayEnabled[2];
+ NDSDisplayID _selectedSourceForDisplay[2];
+
bool _useVerticalSync;
double _scaleFactor;
@@ -206,6 +218,11 @@ public:
double GetGapScale() const;
double GetGapDistance() const;
+ ClientDisplaySource GetDisplayVideoSource(const NDSDisplayID displayID) const;
+ virtual void SetDisplayVideoSource(const NDSDisplayID displayID, ClientDisplaySource displaySrc);
+ NDSDisplayID GetSelectedDisplaySourceForDisplay(const NDSDisplayID displayID) const;
+ bool IsSelectedDisplayEnabled(const NDSDisplayID displayID) const;
+
// NDS screen filters
bool GetSourceDeposterize();
virtual void SetSourceDeposterize(const bool useDeposterize);
diff --git a/desmume/src/frontend/cocoa/DefaultUserPrefs.plist b/desmume/src/frontend/cocoa/DefaultUserPrefs.plist
index 5294cfda3..28d97eb41 100644
--- a/desmume/src/frontend/cocoa/DefaultUserPrefs.plist
+++ b/desmume/src/frontend/cocoa/DefaultUserPrefs.plist
@@ -32,6 +32,10 @@
1
DisplayView_Rotation
0
+ DisplayView_DisplayMainVideoSource
+ 1
+ DisplayView_DisplayTouchVideoSource
+ 1
DisplayView_EnableHUD
DisplayView_ShowStatusBar
diff --git a/desmume/src/frontend/cocoa/OGLDisplayOutput.cpp b/desmume/src/frontend/cocoa/OGLDisplayOutput.cpp
index 99b97b2a2..e2f14dfa0 100644
--- a/desmume/src/frontend/cocoa/OGLDisplayOutput.cpp
+++ b/desmume/src/frontend/cocoa/OGLDisplayOutput.cpp
@@ -6926,20 +6926,21 @@ void OGLDisplayLayer::ProcessOGL()
const OGLClientFetchObject &fetchObj = (const OGLClientFetchObject &)this->_output->GetFetchObject();
const NDSDisplayInfo &emuDisplayInfo = this->_output->GetEmuDisplayInfo();
const ClientDisplayMode mode = this->_output->GetViewProperties().mode;
+ const NDSDisplayID selectedDisplaySource[2] = { this->_output->GetSelectedDisplaySourceForDisplay(NDSDisplayID_Main), this->_output->GetSelectedDisplaySourceForDisplay(NDSDisplayID_Touch) };
- const bool didRenderNative[2] = { !emuDisplayInfo.didPerformCustomRender[NDSDisplayID_Main], !emuDisplayInfo.didPerformCustomRender[NDSDisplayID_Touch] };
- GLuint texVideoSourceID[2] = { (didRenderNative[NDSDisplayID_Main]) ? fetchObj.GetTexNative(NDSDisplayID_Main, emuDisplayInfo.bufferIndex) : fetchObj.GetTexCustom(NDSDisplayID_Main, emuDisplayInfo.bufferIndex),
- (didRenderNative[NDSDisplayID_Touch]) ? fetchObj.GetTexNative(NDSDisplayID_Touch, emuDisplayInfo.bufferIndex) : fetchObj.GetTexCustom(NDSDisplayID_Touch, emuDisplayInfo.bufferIndex) };
- GLsizei width[2] = { emuDisplayInfo.renderedWidth[NDSDisplayID_Main], emuDisplayInfo.renderedWidth[NDSDisplayID_Touch] };
- GLsizei height[2] = { emuDisplayInfo.renderedHeight[NDSDisplayID_Main], emuDisplayInfo.renderedHeight[NDSDisplayID_Touch] };
+ const bool didRenderNative[2] = { !emuDisplayInfo.didPerformCustomRender[selectedDisplaySource[NDSDisplayID_Main]], !emuDisplayInfo.didPerformCustomRender[selectedDisplaySource[NDSDisplayID_Touch]] };
+ GLuint texVideoSourceID[2] = { (didRenderNative[NDSDisplayID_Main]) ? fetchObj.GetTexNative(selectedDisplaySource[NDSDisplayID_Main], emuDisplayInfo.bufferIndex) : fetchObj.GetTexCustom(selectedDisplaySource[NDSDisplayID_Main], emuDisplayInfo.bufferIndex),
+ (didRenderNative[NDSDisplayID_Touch]) ? fetchObj.GetTexNative(selectedDisplaySource[NDSDisplayID_Touch], emuDisplayInfo.bufferIndex) : fetchObj.GetTexCustom(selectedDisplaySource[NDSDisplayID_Touch], emuDisplayInfo.bufferIndex) };
+ GLsizei width[2] = { emuDisplayInfo.renderedWidth[selectedDisplaySource[NDSDisplayID_Main]], emuDisplayInfo.renderedWidth[selectedDisplaySource[NDSDisplayID_Touch]] };
+ GLsizei height[2] = { emuDisplayInfo.renderedHeight[selectedDisplaySource[NDSDisplayID_Main]], emuDisplayInfo.renderedHeight[selectedDisplaySource[NDSDisplayID_Touch]] };
if (emuDisplayInfo.pixelBytes != 0)
{
// Run the video source filters and the pixel scalers
const bool willFilterOnGPU = this->_output->WillFilterOnGPU();
const bool useDeposterize = this->_output->GetSourceDeposterize();
- const bool needProcessDisplay[2] = { (didRenderNative[NDSDisplayID_Main] || !emuDisplayInfo.isCustomSizeRequested) && emuDisplayInfo.isDisplayEnabled[NDSDisplayID_Main] && (mode == ClientDisplayMode_Main || mode == ClientDisplayMode_Dual),
- (didRenderNative[NDSDisplayID_Touch] || !emuDisplayInfo.isCustomSizeRequested) && emuDisplayInfo.isDisplayEnabled[NDSDisplayID_Touch] && (mode == ClientDisplayMode_Touch || mode == ClientDisplayMode_Dual) };
+ const bool needProcessDisplay[2] = { (didRenderNative[NDSDisplayID_Main] || !emuDisplayInfo.isCustomSizeRequested) && this->_output->IsSelectedDisplayEnabled(NDSDisplayID_Main) && (mode == ClientDisplayMode_Main || mode == ClientDisplayMode_Dual),
+ (didRenderNative[NDSDisplayID_Touch] || !emuDisplayInfo.isCustomSizeRequested) && this->_output->IsSelectedDisplayEnabled(NDSDisplayID_Touch) && (mode == ClientDisplayMode_Touch || mode == ClientDisplayMode_Dual) && (selectedDisplaySource[NDSDisplayID_Main] != selectedDisplaySource[NDSDisplayID_Touch]) };
const bool needsLock = (willFilterOnGPU || useDeposterize) && (needProcessDisplay[NDSDisplayID_Main] || needProcessDisplay[NDSDisplayID_Touch]);
if (needsLock)
@@ -6964,15 +6965,25 @@ void OGLDisplayLayer::ProcessOGL()
}
// Set the final output texture IDs
- this->_texVideoOutputID[NDSDisplayID_Main] = texVideoSourceID[NDSDisplayID_Main];
- this->_texVideoOutputID[NDSDisplayID_Touch] = texVideoSourceID[NDSDisplayID_Touch];
+ this->_texVideoOutputID[NDSDisplayID_Main] = texVideoSourceID[NDSDisplayID_Main];
+
+ if (selectedDisplaySource[NDSDisplayID_Touch] != selectedDisplaySource[NDSDisplayID_Main])
+ {
+ this->_texVideoOutputID[NDSDisplayID_Touch] = texVideoSourceID[NDSDisplayID_Touch];
+ }
+ else
+ {
+ this->_texVideoOutputID[NDSDisplayID_Touch] = texVideoSourceID[NDSDisplayID_Main];
+ width[NDSDisplayID_Touch] = width[NDSDisplayID_Main];
+ height[NDSDisplayID_Touch] = height[NDSDisplayID_Main];
+ }
// Update the texture coordinates
glBindBufferARB(GL_ARRAY_BUFFER_ARB, this->_vboTexCoordID);
glBufferDataARB(GL_ARRAY_BUFFER_ARB, (4 * 8) * sizeof(GLfloat), NULL, GL_STREAM_DRAW_ARB);
float *texCoordPtr = (float *)glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB);
- this->_output->SetScreenTextureCoordinates((float)width[NDSDisplayID_Main], (float)height[NDSDisplayID_Main],
+ this->_output->SetScreenTextureCoordinates((float)width[NDSDisplayID_Main], (float)height[NDSDisplayID_Main],
(float)width[NDSDisplayID_Touch], (float)height[NDSDisplayID_Touch],
texCoordPtr);
@@ -7028,7 +7039,7 @@ void OGLDisplayLayer::RenderOGL()
{
case ClientDisplayMode_Main:
{
- if (emuDisplayInfo.isDisplayEnabled[NDSDisplayID_Main])
+ if (this->_output->IsSelectedDisplayEnabled(NDSDisplayID_Main))
{
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, this->_texVideoOutputID[NDSDisplayID_Main]);
glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, this->_displayTexFilter[NDSDisplayID_Main]);
@@ -7040,7 +7051,7 @@ void OGLDisplayLayer::RenderOGL()
case ClientDisplayMode_Touch:
{
- if (emuDisplayInfo.isDisplayEnabled[NDSDisplayID_Touch])
+ if (this->_output->IsSelectedDisplayEnabled(NDSDisplayID_Touch))
{
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, this->_texVideoOutputID[NDSDisplayID_Touch]);
glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, this->_displayTexFilter[NDSDisplayID_Touch]);
@@ -7061,7 +7072,7 @@ void OGLDisplayLayer::RenderOGL()
case ClientDisplayLayout_Hybrid_16_9:
case ClientDisplayLayout_Hybrid_16_10:
{
- if (emuDisplayInfo.isDisplayEnabled[majorDisplayID])
+ if (this->_output->IsSelectedDisplayEnabled(majorDisplayID))
{
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, this->_texVideoOutputID[majorDisplayID]);
glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, this->_displayTexFilter[majorDisplayID]);
@@ -7075,7 +7086,7 @@ void OGLDisplayLayer::RenderOGL()
break;
}
- if (emuDisplayInfo.isDisplayEnabled[NDSDisplayID_Main])
+ if (this->_output->IsSelectedDisplayEnabled(NDSDisplayID_Main))
{
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, this->_texVideoOutputID[NDSDisplayID_Main]);
glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, this->_displayTexFilter[NDSDisplayID_Main]);
@@ -7083,7 +7094,7 @@ void OGLDisplayLayer::RenderOGL()
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
}
- if (emuDisplayInfo.isDisplayEnabled[NDSDisplayID_Touch])
+ if (this->_output->IsSelectedDisplayEnabled(NDSDisplayID_Touch))
{
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, this->_texVideoOutputID[NDSDisplayID_Touch]);
glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, this->_displayTexFilter[NDSDisplayID_Touch]);
diff --git a/desmume/src/frontend/cocoa/cocoa_output.h b/desmume/src/frontend/cocoa/cocoa_output.h
index db7f25327..b528b6536 100644
--- a/desmume/src/frontend/cocoa/cocoa_output.h
+++ b/desmume/src/frontend/cocoa/cocoa_output.h
@@ -138,6 +138,7 @@ struct NDSFrameInfo;
OSSpinLock spinlockOutputFilter;
OSSpinLock spinlockSourceDeposterize;
OSSpinLock spinlockPixelScaler;
+ OSSpinLock spinlockDisplayVideoSource;
}
@property (readonly, nonatomic) BOOL canFilterOnGPU;
@@ -149,6 +150,8 @@ struct NDSFrameInfo;
@property (assign) BOOL isHUDLagFrameCountVisible;
@property (assign) BOOL isHUDCPULoadAverageVisible;
@property (assign) BOOL isHUDRealTimeClockVisible;
+@property (assign) NSInteger displayMainVideoSource;
+@property (assign) NSInteger displayTouchVideoSource;
@property (assign) BOOL useVerticalSync;
@property (assign) BOOL videoFiltersPreferGPU;
@property (assign) BOOL sourceDeposterize;
diff --git a/desmume/src/frontend/cocoa/cocoa_output.mm b/desmume/src/frontend/cocoa/cocoa_output.mm
index b7a01fcc6..2d0e57c46 100644
--- a/desmume/src/frontend/cocoa/cocoa_output.mm
+++ b/desmume/src/frontend/cocoa/cocoa_output.mm
@@ -750,6 +750,8 @@
@dynamic sourceDeposterize;
@dynamic outputFilter;
@dynamic pixelScaler;
+@dynamic displayMainVideoSource;
+@dynamic displayTouchVideoSource;
- (id)init
{
@@ -765,6 +767,7 @@
spinlockOutputFilter = OS_SPINLOCK_INIT;
spinlockSourceDeposterize = OS_SPINLOCK_INIT;
spinlockPixelScaler = OS_SPINLOCK_INIT;
+ spinlockDisplayVideoSource = OS_SPINLOCK_INIT;
return self;
}
@@ -896,6 +899,38 @@
return theState;
}
+- (void) setDisplayMainVideoSource:(NSInteger)displaySourceID
+{
+ OSSpinLockLock(&spinlockDisplayVideoSource);
+ _cdv->SetDisplayVideoSource(NDSDisplayID_Main, (ClientDisplaySource)displaySourceID);
+ OSSpinLockUnlock(&spinlockDisplayVideoSource);
+}
+
+- (NSInteger) displayMainVideoSource
+{
+ OSSpinLockLock(&spinlockDisplayVideoSource);
+ const NSInteger displayVideoSource = _cdv->GetDisplayVideoSource(NDSDisplayID_Main);
+ OSSpinLockUnlock(&spinlockDisplayVideoSource);
+
+ return displayVideoSource;
+}
+
+- (void) setDisplayTouchVideoSource:(NSInteger)displaySourceID
+{
+ OSSpinLockLock(&spinlockDisplayVideoSource);
+ _cdv->SetDisplayVideoSource(NDSDisplayID_Touch, (ClientDisplaySource)displaySourceID);
+ OSSpinLockUnlock(&spinlockDisplayVideoSource);
+}
+
+- (NSInteger) displayTouchVideoSource
+{
+ OSSpinLockLock(&spinlockDisplayVideoSource);
+ const NSInteger displayVideoSource = _cdv->GetDisplayVideoSource(NDSDisplayID_Touch);
+ OSSpinLockUnlock(&spinlockDisplayVideoSource);
+
+ return displayVideoSource;
+}
+
- (void) setUseVerticalSync:(BOOL)theState
{
OSSpinLockLock(&spinlockUseVerticalSync);
diff --git a/desmume/src/frontend/cocoa/translations/English.lproj/MainMenu.strings b/desmume/src/frontend/cocoa/translations/English.lproj/MainMenu.strings
index 557611ef5..5e51d7cd8 100644
Binary files a/desmume/src/frontend/cocoa/translations/English.lproj/MainMenu.strings and b/desmume/src/frontend/cocoa/translations/English.lproj/MainMenu.strings differ
diff --git a/desmume/src/frontend/cocoa/translations/English.lproj/MainMenu.xib b/desmume/src/frontend/cocoa/translations/English.lproj/MainMenu.xib
index 472a0f99f..42d9e90f5 100644
--- a/desmume/src/frontend/cocoa/translations/English.lproj/MainMenu.xib
+++ b/desmume/src/frontend/cocoa/translations/English.lproj/MainMenu.xib
@@ -1128,6 +1128,104 @@
+
- {{13, 10}, {463, 400}}
+ {{13, 10}, {463, 396}}
- {{1, 1}, {429, 100}}
+ {{1, 1}, {429, 97}}
- {{6, 231}, {431, 116}}
+ {{6, 232}, {431, 113}}
@@ -4491,619 +4589,10 @@ L3d3dy5hZHZhbnNjZW5lLmNvbS9vZmZsaW5lL2RhdGFzL0FEVkFOc0NFbmVfUlRvb2xEUy56aXA274