diff --git a/desmume/src/cocoa/DefaultUserPrefs.plist b/desmume/src/cocoa/DefaultUserPrefs.plist
index 5a3c4c0ce..6b32facf2 100644
Binary files a/desmume/src/cocoa/DefaultUserPrefs.plist and b/desmume/src/cocoa/DefaultUserPrefs.plist differ
diff --git a/desmume/src/cocoa/cocoa_globals.h b/desmume/src/cocoa/cocoa_globals.h
index f789bfd86..ed71c96c3 100644
--- a/desmume/src/cocoa/cocoa_globals.h
+++ b/desmume/src/cocoa/cocoa_globals.h
@@ -346,6 +346,8 @@ enum
MESSAGE_REDRAW_VIEW,
MESSAGE_SET_GPU_STATE_FLAGS,
MESSAGE_CHANGE_DISPLAY_TYPE,
+ MESSAGE_CHANGE_DISPLAY_ORIENTATION,
+ MESSAGE_CHANGE_DISPLAY_ORDER,
MESSAGE_CHANGE_BILINEAR_OUTPUT,
MESSAGE_CHANGE_VERTICAL_SYNC,
MESSAGE_CHANGE_VIDEO_FILTER,
@@ -381,6 +383,18 @@ enum
DS_DISPLAY_TYPE_COMBO
};
+enum
+{
+ DS_DISPLAY_ORIENTATION_VERTICAL = 0,
+ DS_DISPLAY_ORIENTATION_HORIZONTAL
+};
+
+enum
+{
+ DS_DISPLAY_ORDER_MAIN_FIRST = 0,
+ DS_DISPLAY_ORDER_TOUCH_FIRST
+};
+
/*
DS GPU TYPES
*/
diff --git a/desmume/src/cocoa/cocoa_output.h b/desmume/src/cocoa/cocoa_output.h
index 052b027c1..98b3299b5 100644
--- a/desmume/src/cocoa/cocoa_output.h
+++ b/desmume/src/cocoa/cocoa_output.h
@@ -104,6 +104,8 @@
- (void) doResizeView:(NSRect)rect;
- (void) doRedraw;
- (void) doDisplayTypeChanged:(NSInteger)displayTypeID;
+- (void) doDisplayOrientationChanged:(NSInteger)displayOrientationID;
+- (void) doDisplayOrderChanged:(NSInteger)displayOrderID;
- (void) doBilinearOutputChanged:(BOOL)useBilinear;
- (void) doVerticalSyncChanged:(BOOL)useVerticalSync;
- (void) doVideoFilterChanged:(NSInteger)videoFilterTypeID;
@@ -164,6 +166,8 @@
- (void) handleRedrawView;
- (void) handleChangeGpuStateFlags:(NSData *)flagsData;
- (void) handleChangeDisplayType:(NSData *)displayTypeIdData;
+- (void) handleChangeDisplayOrientation:(NSData *)displayOrientationIdData;
+- (void) handleChangeDisplayOrder:(NSData *)displayOrderIdData;
- (void) handleChangeBilinearOutput:(NSData *)bilinearStateData;
- (void) handleChangeVerticalSync:(NSData *)verticalSyncStateData;
- (void) handleChangeVideoFilter:(NSData *)videoFilterTypeIdData;
diff --git a/desmume/src/cocoa/cocoa_output.mm b/desmume/src/cocoa/cocoa_output.mm
index 1dd477052..5ff0d3ff9 100644
--- a/desmume/src/cocoa/cocoa_output.mm
+++ b/desmume/src/cocoa/cocoa_output.mm
@@ -1053,6 +1053,14 @@ GPU3DInterface *core3DList[] = {
[self handleChangeDisplayType:[messageComponents objectAtIndex:0]];
break;
+ case MESSAGE_CHANGE_DISPLAY_ORIENTATION:
+ [self handleChangeDisplayOrientation:[messageComponents objectAtIndex:0]];
+ break;
+
+ case MESSAGE_CHANGE_DISPLAY_ORDER:
+ [self handleChangeDisplayOrder:[messageComponents objectAtIndex:0]];
+ break;
+
case MESSAGE_CHANGE_BILINEAR_OUTPUT:
[self handleChangeBilinearOutput:[messageComponents objectAtIndex:0]];
break;
@@ -1181,6 +1189,28 @@ GPU3DInterface *core3DList[] = {
[delegate doDisplayTypeChanged:*theType];
}
+- (void) handleChangeDisplayOrientation:(NSData *)displayOrientationIdData
+{
+ if (delegate == nil || ![delegate respondsToSelector:@selector(doDisplayOrientationChanged:)])
+ {
+ return;
+ }
+
+ const NSInteger *theOrientation = (NSInteger *)[displayOrientationIdData bytes];
+ [delegate doDisplayOrientationChanged:*theOrientation];
+}
+
+- (void) handleChangeDisplayOrder:(NSData *)displayOrderIdData
+{
+ if (delegate == nil || ![delegate respondsToSelector:@selector(doDisplayOrderChanged:)])
+ {
+ return;
+ }
+
+ const NSInteger *theOrder = (NSInteger *)[displayOrderIdData bytes];
+ [delegate doDisplayOrderChanged:*theOrder];
+}
+
- (void) handleChangeBilinearOutput:(NSData *)bilinearStateData
{
if (delegate == nil || ![delegate respondsToSelector:@selector(doBilinearOutputChanged:)])
diff --git a/desmume/src/cocoa/translations/English.lproj/MainMenu.strings b/desmume/src/cocoa/translations/English.lproj/MainMenu.strings
index f66e4b31c..6fe6537a9 100644
Binary files a/desmume/src/cocoa/translations/English.lproj/MainMenu.strings and b/desmume/src/cocoa/translations/English.lproj/MainMenu.strings differ
diff --git a/desmume/src/cocoa/translations/English.lproj/MainMenu.xib b/desmume/src/cocoa/translations/English.lproj/MainMenu.xib
index 6f77ed66c..b96457829 100644
--- a/desmume/src/cocoa/translations/English.lproj/MainMenu.xib
+++ b/desmume/src/cocoa/translations/English.lproj/MainMenu.xib
@@ -12,9 +12,9 @@
+
+
{{0, 0}, {1920, 1178}}
{256, 476}
@@ -7022,7 +7085,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA
InputPrefsView
-
+
0
YES
YES
YES
-
+
{489, 425}
+
NSView
@@ -19254,6 +19807,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA
changeLogPath
versionString
dateString
+ DisplayViewCombo_Order
@@ -19530,6 +20084,11 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA
YES
+
+ YES
+ DisplayViewCombo_Orientation
+ DisplayViewCombo_Order
+
YES
@@ -28302,6 +28861,70 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA
6167
+
+
+ changeDisplayOrientation:
+
+
+
+ 6175
+
+
+
+ changeDisplayOrientation:
+
+
+
+ 6176
+
+
+
+ changeDisplayOrder:
+
+
+
+ 6178
+
+
+
+ changeDisplayOrder:
+
+
+
+ 6179
+
+
+
+ selectedTag: values.DisplayViewCombo_Orientation
+
+
+
+
+
+ selectedTag: values.DisplayViewCombo_Orientation
+ selectedTag
+ values.DisplayViewCombo_Orientation
+ 2
+
+
+ 6226
+
+
+
+ selectedTag: values.DisplayViewCombo_Order
+
+
+
+
+
+ selectedTag: values.DisplayViewCombo_Order
+ selectedTag
+ values.DisplayViewCombo_Order
+ 2
+
+
+ 6230
+
@@ -28562,6 +29185,8 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA
+
+
@@ -30614,6 +31239,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA
YES
+
@@ -38689,6 +39315,144 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA
+
+ 6168
+
+
+ YES
+
+
+
+
+
+ 6169
+
+
+ YES
+
+
+
+
+
+
+ 6170
+
+
+
+
+ 6171
+
+
+ YES
+
+
+
+
+
+ 6172
+
+
+ YES
+
+
+
+
+
+
+ 6173
+
+
+
+
+ 6174
+
+
+
+
+ 6177
+
+
+
+
+ 6180
+
+
+ YES
+
+
+
+
+
+
+ 6182
+
+
+ YES
+
+
+
+
+
+ 6183
+
+
+ YES
+
+
+
+
+
+ 6184
+
+
+ YES
+
+
+
+
+
+
+
+ 6185
+
+
+
+
+ 6186
+
+
+
+
+ 6187
+
+
+
+
+ 6188
+
+
+ YES
+
+
+
+
+
+
+
+ 6189
+
+
+
+
+ 6190
+
+
+
+
+ 6191
+
+
+
@@ -40584,6 +41348,37 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA
6161.IBAttributePlaceholdersKey
6161.IBPluginDependency
6162.IBPluginDependency
+ 6168.IBPluginDependency
+ 6169.IBEditorWindowLastContentRect
+ 6169.IBPluginDependency
+ 6170.IBPluginDependency
+ 6171.IBPluginDependency
+ 6172.IBEditorWindowLastContentRect
+ 6172.IBPluginDependency
+ 6173.IBPluginDependency
+ 6174.IBPluginDependency
+ 6177.IBPluginDependency
+ 6180.IBEditorWindowLastContentRect
+ 6180.IBPluginDependency
+ 6180.IBViewBoundsToFrameTransform
+ 6182.IBPluginDependency
+ 6182.IBViewBoundsToFrameTransform
+ 6183.IBPluginDependency
+ 6183.IBViewBoundsToFrameTransform
+ 6184.IBPluginDependency
+ 6184.IBViewBoundsToFrameTransform
+ 6185.IBAttributePlaceholdersKey
+ 6185.IBPluginDependency
+ 6186.IBAttributePlaceholdersKey
+ 6186.IBPluginDependency
+ 6187.IBPluginDependency
+ 6188.IBPluginDependency
+ 6188.IBViewBoundsToFrameTransform
+ 6189.IBPluginDependency
+ 6190.IBAttributePlaceholdersKey
+ 6190.IBPluginDependency
+ 6191.IBAttributePlaceholdersKey
+ 6191.IBPluginDependency
627.IBEditorWindowLastContentRect
627.IBPluginDependency
627.IBWindowTemplateEditedContentRect
@@ -41357,7 +42152,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA
com.apple.InterfaceBuilder.CocoaPlugin
com.apple.InterfaceBuilder.CocoaPlugin
com.apple.InterfaceBuilder.CocoaPlugin
- {{712, 677}, {489, 425}}
+ {{858, 521}, {489, 425}}
com.apple.InterfaceBuilder.CocoaPlugin
com.apple.InterfaceBuilder.CocoaPlugin
@@ -42070,7 +42865,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA
P4AAAL+AAABBiAAAwswAAA
- {{475, 1136}, {512, 20}}
+ {{757, 1136}, {512, 20}}
com.apple.InterfaceBuilder.CocoaPlugin
{74, 862}
@@ -42085,7 +42880,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA
P4AAAL+AAABBiAAAw6WAAA
com.apple.InterfaceBuilder.CocoaPlugin
- {{749, 883}, {315, 253}}
+ {{1031, 843}, {315, 293}}
com.apple.InterfaceBuilder.CocoaPlugin
{{475, 832}, {234, 43}}
com.apple.InterfaceBuilder.CocoaPlugin
@@ -43731,7 +44526,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA
com.apple.InterfaceBuilder.CocoaPlugin
com.apple.InterfaceBuilder.CocoaPlugin
- AUDAAABDUwAAA
+ AUDAAABDbwAAA
com.apple.InterfaceBuilder.CocoaPlugin
@@ -44520,6 +45315,75 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA
com.apple.InterfaceBuilder.CocoaPlugin
com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+ {{1322, 1033}, {123, 43}}
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+ {{1346, 1013}, {178, 43}}
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+ {{1069, 398}, {431, 174}}
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ AUDAAABC8gAAA
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ AUFwAABCUAAAA
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ AUNQAABCxAAAA
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ P4AAAL+AAABDdgAAwzcAAA
+
+
+ ToolTip
+
+ ToolTip
+
+ If the display orientation is vertical, the main screen will be arranged above the touch screen by default. If the display layout is horizontal, the main screen will be arranged left of the touch screen by default.
+
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ ToolTip
+
+ ToolTip
+
+ If the display orientation is vertical, the touch screen will be arranged above the main screen by default. If the display layout is horizontal, the touch screen will be arranged left of the main screen by default.
+
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ P4AAAL+AAABCWAAAwy4AAA
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ ToolTip
+
+ ToolTip
+
+ Arranges the DS screens where one screen is to the left of the other screen by default.
+
+
+ com.apple.InterfaceBuilder.CocoaPlugin
+
+ ToolTip
+
+ ToolTip
+
+ Arranges the DS screens where one screen is above the other screen by default.
+
+
+ com.apple.InterfaceBuilder.CocoaPlugin
{{609, 360}, {400, 100}}
com.apple.InterfaceBuilder.CocoaPlugin
{{609, 360}, {400, 100}}
@@ -44899,7 +45763,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA
- 6167
+ 6230
@@ -45418,6 +46282,8 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA
changeCoreEmuFlags:
changeCoreSpeed:
changeDisplayMode:
+ changeDisplayOrder:
+ changeDisplayOrientation:
changeFirmwareSettings:
changeRomSaveType:
changeRotation:
@@ -45520,6 +46386,8 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA
id
id
id
+ id
+ id
@@ -45539,6 +46407,8 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA
changeCoreEmuFlags:
changeCoreSpeed:
changeDisplayMode:
+ changeDisplayOrder:
+ changeDisplayOrientation:
changeFirmwareSettings:
changeRomSaveType:
changeRotation:
@@ -45637,6 +46507,14 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA
changeDisplayMode:
id
+
+ changeDisplayOrder:
+ id
+
+
+ changeDisplayOrientation:
+ id
+
changeFirmwareSettings:
id
diff --git a/desmume/src/cocoa/userinterface/displayView.h b/desmume/src/cocoa/userinterface/displayView.h
index 608a1cb63..cfaed29f8 100644
--- a/desmume/src/cocoa/userinterface/displayView.h
+++ b/desmume/src/cocoa/userinterface/displayView.h
@@ -38,6 +38,8 @@
- (void) doResizeView:(NSRect)rect;
- (void) doRedraw;
- (void) doDisplayTypeChanged:(NSInteger)displayTypeID;
+- (void) doDisplayOrientationChanged:(NSInteger)displayOrientationID;
+- (void) doDisplayOrderChanged:(NSInteger)displayOrderID;
- (void) doBilinearOutputChanged:(BOOL)useBilinear;
- (void) doVerticalSyncChanged:(BOOL)useVerticalSync;
- (void) doVideoFilterChanged:(NSInteger)videoFilterTypeID;
@@ -58,38 +60,31 @@
NSSize normalSize;
NSMutableDictionary *bindings;
- OSSpinLock spinlockGpuStateFlags;
- OSSpinLock spinlockDisplayType;
OSSpinLock spinlockNormalSize;
+ OSSpinLock spinlockGpuStateFlags;
OSSpinLock spinlockScale;
OSSpinLock spinlockRotation;
OSSpinLock spinlockUseBilinearOutput;
OSSpinLock spinlockUseVerticalSync;
+ OSSpinLock spinlockDisplayType;
+ OSSpinLock spinlockDisplayOrientation;
+ OSSpinLock spinlockDisplayOrder;
}
@property (retain) NSView *view;
@property (retain) NSPort *sendPortInput;
@property (retain) CocoaDSController *cdsController;
@property (readonly) NSSize normalSize;
+@property (assign) UInt32 gpuStateFlags;
@property (assign) double scale;
@property (assign) double rotation;
@property (assign) BOOL useBilinearOutput;
@property (assign) BOOL useVerticalSync;
@property (assign) NSInteger displayType;
+@property (assign) NSInteger displayOrientation;
+@property (assign) NSInteger displayOrder;
@property (readonly) NSMutableDictionary *bindings;
-- (void) setGpuStateFlags:(UInt32)flags;
-- (UInt32) gpuStateFlags;
-- (void) setScale:(double)s;
-- (double) scale;
-- (void) setRotation:(double)angleDegrees;
-- (double) rotation;
-- (void) setUseBilinearOutput:(BOOL)theState;
-- (BOOL) useBilinearOutput;
-- (void) setUseVerticalSync:(BOOL)theState;
-- (BOOL) useVerticalSync;
-- (void) setDisplayType:(NSInteger)theType;
-- (NSInteger) displayType;
- (void) setVideoFilterType:(NSInteger)theType;
- (void) setRender3DRenderingEngine:(NSInteger)methodID;
- (void) setRender3DHighPrecisionColorInterpolation:(BOOL)state;
@@ -125,12 +120,16 @@
@interface OpenGLDisplayView : NSOpenGLView
{
DisplayViewDelegate *dispViewDelegate;
- NSSize lastFrameSize;
GLint glTexRenderStyle;
GLenum glTexPixelFormat;
GLvoid *glTexBack;
NSSize glTexBackSize;
+
GLuint swRasterizerDrawTexture[2];
+ GLfloat swRasterizerMainTexCoord[4][2];
+ GLfloat swRasterizerMainVertex[4][2];
+ GLfloat swRasterizerTouchTexCoord[4][2];
+ GLfloat swRasterizerTouchVertex[4][2];
}
- (void) drawVideoFrame;
@@ -138,6 +137,7 @@
mainBytes:(const GLvoid *)mainBytes
touchBytes:(const GLvoid *)touchBytes;
- (void) renderSWRasterizer;
+- (void) setupSWRasterizerVertices;
@end
diff --git a/desmume/src/cocoa/userinterface/displayView.mm b/desmume/src/cocoa/userinterface/displayView.mm
index a9177a74a..1715d0a11 100644
--- a/desmume/src/cocoa/userinterface/displayView.mm
+++ b/desmume/src/cocoa/userinterface/displayView.mm
@@ -40,11 +40,14 @@ NSOpenGLContext *OSXDefaultOpenGLContext = nil;
@synthesize isHudEnabled;
@synthesize isHudEditingModeEnabled;
@dynamic normalSize;
+@dynamic gpuStateFlags;
@dynamic scale;
@dynamic rotation;
@dynamic useBilinearOutput;
@dynamic useVerticalSync;
@dynamic displayType;
+@dynamic displayOrientation;
+@dynamic displayOrder;
@synthesize bindings;
- (id)init
@@ -64,13 +67,15 @@ NSOpenGLContext *OSXDefaultOpenGLContext = nil;
}
view = nil;
- spinlockGpuStateFlags = OS_SPINLOCK_INIT;
- spinlockDisplayType = OS_SPINLOCK_INIT;
spinlockNormalSize = OS_SPINLOCK_INIT;
+ spinlockGpuStateFlags = OS_SPINLOCK_INIT;
spinlockScale = OS_SPINLOCK_INIT;
spinlockRotation = OS_SPINLOCK_INIT;
spinlockUseBilinearOutput = OS_SPINLOCK_INIT;
spinlockUseVerticalSync = OS_SPINLOCK_INIT;
+ spinlockDisplayType = OS_SPINLOCK_INIT;
+ spinlockDisplayOrientation = OS_SPINLOCK_INIT;
+ spinlockDisplayOrder = OS_SPINLOCK_INIT;
normalSize = NSMakeSize(GPU_DISPLAY_WIDTH, GPU_DISPLAY_HEIGHT * 2.0);
sendPortDisplay = nil;
@@ -218,7 +223,7 @@ NSOpenGLContext *OSXDefaultOpenGLContext = nil;
- (void) setDisplayType:(NSInteger)theType
{
- NSSize theSize = NSMakeSize(GPU_DISPLAY_WIDTH, GPU_DISPLAY_HEIGHT);
+ NSSize newDisplaySize = NSMakeSize(GPU_DISPLAY_WIDTH, GPU_DISPLAY_HEIGHT);
NSString *modeString = @"Unknown";
switch (theType)
@@ -232,8 +237,17 @@ NSOpenGLContext *OSXDefaultOpenGLContext = nil;
break;
case DS_DISPLAY_TYPE_COMBO:
- theSize = NSMakeSize(GPU_DISPLAY_WIDTH, GPU_DISPLAY_HEIGHT * 2);
modeString = NSSTRING_DISPLAYMODE_COMBO;
+
+ if ([self displayOrientation] == DS_DISPLAY_ORIENTATION_VERTICAL)
+ {
+ newDisplaySize.height *= 2;
+ }
+ else
+ {
+ newDisplaySize.width *= 2;
+ }
+
break;
default:
@@ -246,7 +260,7 @@ NSOpenGLContext *OSXDefaultOpenGLContext = nil;
OSSpinLockUnlock(&spinlockDisplayType);
OSSpinLockLock(&spinlockNormalSize);
- normalSize = theSize;
+ normalSize = newDisplaySize;
OSSpinLockUnlock(&spinlockNormalSize);
[CocoaDSUtil messageSendOneWayWithInteger:self.sendPortDisplay msgID:MESSAGE_CHANGE_DISPLAY_TYPE integerValue:theType];
@@ -261,6 +275,60 @@ NSOpenGLContext *OSXDefaultOpenGLContext = nil;
return theType;
}
+- (void) setDisplayOrientation:(NSInteger)theOrientation
+{
+ OSSpinLockLock(&spinlockDisplayOrientation);
+ [bindings setValue:[NSNumber numberWithInteger:theOrientation] forKey:@"displayOrientation"];
+ OSSpinLockUnlock(&spinlockDisplayOrientation);
+
+ if ([self displayType] == DS_DISPLAY_TYPE_COMBO)
+ {
+ NSSize newDisplaySize = NSMakeSize(GPU_DISPLAY_WIDTH, GPU_DISPLAY_HEIGHT);
+
+ if (theOrientation == DS_DISPLAY_ORIENTATION_VERTICAL)
+ {
+ newDisplaySize.height *= 2;
+ }
+ else
+ {
+ newDisplaySize.width *= 2;
+ }
+
+ OSSpinLockLock(&spinlockNormalSize);
+ normalSize = newDisplaySize;
+ OSSpinLockUnlock(&spinlockNormalSize);
+ }
+
+ [CocoaDSUtil messageSendOneWayWithInteger:self.sendPortDisplay msgID:MESSAGE_CHANGE_DISPLAY_ORIENTATION integerValue:theOrientation];
+}
+
+- (NSInteger) displayOrientation
+{
+ OSSpinLockLock(&spinlockDisplayOrientation);
+ NSInteger theOrientation = [[bindings valueForKey:@"displayOrientation"] integerValue];
+ OSSpinLockUnlock(&spinlockDisplayOrientation);
+
+ return theOrientation;
+}
+
+- (void) setDisplayOrder:(NSInteger)theOrder
+{
+ OSSpinLockLock(&spinlockDisplayOrder);
+ [bindings setValue:[NSNumber numberWithInteger:theOrder] forKey:@"displayOrder"];
+ OSSpinLockUnlock(&spinlockDisplayOrder);
+
+ [CocoaDSUtil messageSendOneWayWithInteger:self.sendPortDisplay msgID:MESSAGE_CHANGE_DISPLAY_ORDER integerValue:theOrder];
+}
+
+- (NSInteger) displayOrder
+{
+ OSSpinLockLock(&spinlockDisplayOrder);
+ NSInteger theOrder = [[bindings valueForKey:@"displayOrder"] integerValue];
+ OSSpinLockUnlock(&spinlockDisplayOrder);
+
+ return theOrder;
+}
+
- (void) setVideoFilterType:(NSInteger)theType
{
[bindings setValue:[NSNumber numberWithInteger:theType] forKey:@"videoFilterType"];
@@ -348,6 +416,21 @@ NSOpenGLContext *OSXDefaultOpenGLContext = nil;
NSPoint touchLoc = GetNormalPointFromTransformedPoint(clickLoc, self.normalSize, [[self view] bounds].size, [self scale], viewAngle);
// Normalize the y-coordinate to the DS.
+ if ([self displayType] == DS_DISPLAY_TYPE_COMBO)
+ {
+ NSInteger theOrientation = [self displayOrientation];
+ NSInteger theOrder = [self displayOrder];
+
+ if (theOrientation == DS_DISPLAY_ORIENTATION_VERTICAL && theOrder == DS_DISPLAY_ORDER_TOUCH_FIRST)
+ {
+ touchLoc.y -= GPU_DISPLAY_HEIGHT;
+ }
+ else if (theOrientation == DS_DISPLAY_ORIENTATION_HORIZONTAL && theOrder == DS_DISPLAY_ORDER_MAIN_FIRST)
+ {
+ touchLoc.x -= GPU_DISPLAY_WIDTH;
+ }
+ }
+
touchLoc.y = GPU_DISPLAY_HEIGHT - touchLoc.y;
// Constrain the touch point to the DS dimensions.
@@ -527,6 +610,26 @@ NSOpenGLContext *OSXDefaultOpenGLContext = nil;
[view doDisplayTypeChanged:displayTypeID];
}
+- (void) doDisplayOrientationChanged:(NSInteger)displayOrientationID
+{
+ if (view == nil || ![view respondsToSelector:@selector(doDisplayOrientationChanged:)])
+ {
+ return;
+ }
+
+ [view doDisplayOrientationChanged:displayOrientationID];
+}
+
+- (void) doDisplayOrderChanged:(NSInteger)displayOrderID
+{
+ if (view == nil || ![view respondsToSelector:@selector(doDisplayOrderChanged:)])
+ {
+ return;
+ }
+
+ [view doDisplayOrderChanged:displayOrderID];
+}
+
- (void) doBilinearOutputChanged:(BOOL)useBilinear
{
if (view == nil || ![view respondsToSelector:@selector(doBilinearOutputChanged:)])
@@ -790,12 +893,11 @@ NSOpenGLContext *OSXDefaultOpenGLContext = nil;
}
dispViewDelegate = nil;
- lastFrameSize = NSMakeSize(GPU_DISPLAY_WIDTH, GPU_DISPLAY_HEIGHT * 2.0);
glTexPixelFormat = GL_UNSIGNED_SHORT_1_5_5_5_REV;
glTexRenderStyle = GL_LINEAR;
- UInt32 w = GetNearestPositivePOT((UInt32)lastFrameSize.width);
- UInt32 h = GetNearestPositivePOT((UInt32)lastFrameSize.height);
+ UInt32 w = GetNearestPositivePOT((UInt32)GPU_DISPLAY_WIDTH);
+ UInt32 h = GetNearestPositivePOT((UInt32)(GPU_DISPLAY_HEIGHT * 2.0));
glTexBack = (GLvoid *)calloc(w * h, sizeof(UInt16));
glTexBackSize = NSMakeSize(w, h);
@@ -888,6 +990,24 @@ NSOpenGLContext *OSXDefaultOpenGLContext = nil;
}
}
+ swRasterizerMainTexCoord[0][0] = 0.0f;
+ swRasterizerMainTexCoord[0][1] = 0.0f;
+ swRasterizerMainTexCoord[1][0] = (GLfloat)(textureSize.width / w);
+ swRasterizerMainTexCoord[1][1] = 0.0f;
+ swRasterizerMainTexCoord[2][0] = (GLfloat)(textureSize.width / w);
+ swRasterizerMainTexCoord[2][1] = (GLfloat)(textureSize.height / h);
+ swRasterizerMainTexCoord[3][0] = 0.0f;
+ swRasterizerMainTexCoord[3][1] = (GLfloat)(textureSize.height / h);
+
+ swRasterizerTouchTexCoord[0][0] = 0.0f;
+ swRasterizerTouchTexCoord[0][1] = 0.0f;
+ swRasterizerTouchTexCoord[1][0] = (GLfloat)(textureSize.width / w);
+ swRasterizerTouchTexCoord[1][1] = 0.0f;
+ swRasterizerTouchTexCoord[2][0] = (GLfloat)(textureSize.width / w);
+ swRasterizerTouchTexCoord[2][1] = (GLfloat)(textureSize.height / h);
+ swRasterizerTouchTexCoord[3][0] = 0.0f;
+ swRasterizerTouchTexCoord[3][1] = (GLfloat)(textureSize.height / h);
+
// Main screen
glBindTexture(GL_TEXTURE_2D, swRasterizerDrawTexture[0]);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, (GLsizei)w, (GLsizei)h, 0, GL_RGBA, glTexPixelFormat, glTexBack);
@@ -906,81 +1026,157 @@ NSOpenGLContext *OSXDefaultOpenGLContext = nil;
- (void) renderSWRasterizer
{
NSInteger displayType = [dispViewDelegate displayType];
- GLfloat w = (GLfloat)dispViewDelegate.normalSize.width;
- GLfloat h = (GLfloat)dispViewDelegate.normalSize.height;
glClear(GL_COLOR_BUFFER_BIT);
- if (displayType == DS_DISPLAY_TYPE_COMBO)
+ // Render the main screen
+ if (displayType == DS_DISPLAY_TYPE_MAIN || displayType == DS_DISPLAY_TYPE_COMBO)
{
- GLfloat texRatioMainW = (GLfloat)lastFrameSize.width / (GLfloat)GetNearestPositivePOT((uint32_t)lastFrameSize.width);
- GLfloat texRatioMainH = (GLfloat)lastFrameSize.height / (GLfloat)GetNearestPositivePOT((uint32_t)lastFrameSize.height);
- GLfloat texRatioTouchW = (GLfloat)lastFrameSize.width / (GLfloat)GetNearestPositivePOT((uint32_t)lastFrameSize.width);
- GLfloat texRatioTouchH = (GLfloat)lastFrameSize.height / (GLfloat)GetNearestPositivePOT((uint32_t)lastFrameSize.height);
-
- // Main screen
glBindTexture(GL_TEXTURE_2D, swRasterizerDrawTexture[0]);
glBegin(GL_QUADS);
-
- glTexCoord2f(0.0f, 0.0f);
- glVertex3f(-(w/2.0f), (h/2.0f), 0.0f);
-
- glTexCoord2f(texRatioMainW, 0.0f);
- glVertex3f((w/2.0f), (h/2.0f), 0.0f);
-
- glTexCoord2f(texRatioMainW, texRatioMainH);
- glVertex3f((w/2.0f), 0.0f, 0.0f);
-
- glTexCoord2f(0.0f, texRatioMainH);
- glVertex3f(-(w/2.0f), 0.0f, 0.0f);
-
- glEnd();
- // Touch screen
+ for (unsigned int i = 0; i < 4; i++)
+ {
+ glTexCoord2f(swRasterizerMainTexCoord[i][0], swRasterizerMainTexCoord[i][1]);
+ glVertex2f(swRasterizerMainVertex[i][0], swRasterizerMainVertex[i][1]);
+ }
+
+ glEnd();
+ }
+
+ // Render the touch screen
+ if (displayType == DS_DISPLAY_TYPE_TOUCH || displayType == DS_DISPLAY_TYPE_COMBO)
+ {
glBindTexture(GL_TEXTURE_2D, swRasterizerDrawTexture[1]);
glBegin(GL_QUADS);
-
- glTexCoord2f(0.0f, 0.0f);
- glVertex3f(-(w/2.0f), 0.0f, 0.0f);
-
- glTexCoord2f(texRatioTouchW, 0.0f);
- glVertex3f((w/2.0f), 0.0f, 0.0f);
-
- glTexCoord2f(texRatioTouchW, texRatioTouchH);
- glVertex3f((w/2.0f), -(h/2.0f), 0.0f);
-
- glTexCoord2f(0.0f, texRatioTouchH);
- glVertex3f(-(w/2.0f), -(h/2.0f), 0.0f);
-
+
+ for (unsigned int i = 0; i < 4; i++)
+ {
+ glTexCoord2f(swRasterizerTouchTexCoord[i][0], swRasterizerTouchTexCoord[i][1]);
+ glVertex2f(swRasterizerTouchVertex[i][0], swRasterizerTouchVertex[i][1]);
+ }
+
glEnd();
}
+}
+
+- (void) setupSWRasterizerVertices
+{
+ NSInteger displayType = [dispViewDelegate displayType];
+ GLfloat w = (GLfloat)dispViewDelegate.normalSize.width * [dispViewDelegate scale];
+ GLfloat h = (GLfloat)dispViewDelegate.normalSize.height * [dispViewDelegate scale];
+
+ if (displayType == DS_DISPLAY_TYPE_COMBO)
+ {
+ NSInteger displayOrientation = [dispViewDelegate displayOrientation];
+ NSInteger displayOrder = [dispViewDelegate displayOrder];
+
+ if (displayOrientation == DS_DISPLAY_ORIENTATION_VERTICAL)
+ {
+ if (displayOrder == DS_DISPLAY_ORDER_MAIN_FIRST)
+ {
+ swRasterizerMainVertex[0][0] = -w/2.0f;
+ swRasterizerMainVertex[0][1] = h/2.0f;
+ swRasterizerMainVertex[1][0] = w/2.0f;
+ swRasterizerMainVertex[1][1] = h/2.0f;
+ swRasterizerMainVertex[2][0] = w/2.0f;
+ swRasterizerMainVertex[2][1] = 0.0f;
+ swRasterizerMainVertex[3][0] = -w/2.0f;
+ swRasterizerMainVertex[3][1] = 0.0f;
+
+ swRasterizerTouchVertex[0][0] = -w/2.0f;
+ swRasterizerTouchVertex[0][1] = 0.0f;
+ swRasterizerTouchVertex[1][0] = w/2.0f;
+ swRasterizerTouchVertex[1][1] = 0.0f;
+ swRasterizerTouchVertex[2][0] = w/2.0f;
+ swRasterizerTouchVertex[2][1] = -h/2.0f;
+ swRasterizerTouchVertex[3][0] = -w/2.0f;
+ swRasterizerTouchVertex[3][1] = -h/2.0f;
+ }
+ else // displayOrder == DS_DISPLAY_ORDER_TOUCH_FIRST
+ {
+ swRasterizerTouchVertex[0][0] = -w/2.0f;
+ swRasterizerTouchVertex[0][1] = h/2.0f;
+ swRasterizerTouchVertex[1][0] = w/2.0f;
+ swRasterizerTouchVertex[1][1] = h/2.0f;
+ swRasterizerTouchVertex[2][0] = w/2.0f;
+ swRasterizerTouchVertex[2][1] = 0.0f;
+ swRasterizerTouchVertex[3][0] = -w/2.0f;
+ swRasterizerTouchVertex[3][1] = 0.0f;
+
+ swRasterizerMainVertex[0][0] = -w/2.0f;
+ swRasterizerMainVertex[0][1] = 0.0f;
+ swRasterizerMainVertex[1][0] = w/2.0f;
+ swRasterizerMainVertex[1][1] = 0.0f;
+ swRasterizerMainVertex[2][0] = w/2.0f;
+ swRasterizerMainVertex[2][1] = -h/2.0f;
+ swRasterizerMainVertex[3][0] = -w/2.0f;
+ swRasterizerMainVertex[3][1] = -h/2.0f;
+ }
+ }
+ else // displayOrientation == DS_DISPLAY_ORIENTATION_HORIZONTAL
+ {
+ if (displayOrder == DS_DISPLAY_ORDER_MAIN_FIRST)
+ {
+ swRasterizerMainVertex[0][0] = -w/2.0f;
+ swRasterizerMainVertex[0][1] = h/2.0f;
+ swRasterizerMainVertex[1][0] = 0.0f;
+ swRasterizerMainVertex[1][1] = h/2.0f;
+ swRasterizerMainVertex[2][0] = 0.0f;
+ swRasterizerMainVertex[2][1] = -h/2.0f;
+ swRasterizerMainVertex[3][0] = -w/2.0f;
+ swRasterizerMainVertex[3][1] = -h/2.0f;
+
+ swRasterizerTouchVertex[0][0] = 0.0f;
+ swRasterizerTouchVertex[0][1] = h/2.0f;
+ swRasterizerTouchVertex[1][0] = w/2.0f;
+ swRasterizerTouchVertex[1][1] = h/2.0f;
+ swRasterizerTouchVertex[2][0] = w/2.0f;
+ swRasterizerTouchVertex[2][1] = -h/2.0f;
+ swRasterizerTouchVertex[3][0] = 0.0f;
+ swRasterizerTouchVertex[3][1] = -h/2.0f;
+ }
+ else // displayOrder == DS_DISPLAY_ORDER_TOUCH_FIRST
+ {
+ swRasterizerTouchVertex[0][0] = -w/2.0f;
+ swRasterizerTouchVertex[0][1] = h/2.0f;
+ swRasterizerTouchVertex[1][0] = 0.0f;
+ swRasterizerTouchVertex[1][1] = h/2.0f;
+ swRasterizerTouchVertex[2][0] = 0.0f;
+ swRasterizerTouchVertex[2][1] = -h/2.0f;
+ swRasterizerTouchVertex[3][0] = -w/2.0f;
+ swRasterizerTouchVertex[3][1] = -h/2.0f;
+
+ swRasterizerMainVertex[0][0] = 0.0f;
+ swRasterizerMainVertex[0][1] = h/2.0f;
+ swRasterizerMainVertex[1][0] = w/2.0f;
+ swRasterizerMainVertex[1][1] = h/2.0f;
+ swRasterizerMainVertex[2][0] = w/2.0f;
+ swRasterizerMainVertex[2][1] = -h/2.0f;
+ swRasterizerMainVertex[3][0] = 0.0f;
+ swRasterizerMainVertex[3][1] = -h/2.0f;
+ }
+ }
+ }
else
{
- GLfloat texRatioW = (GLfloat)lastFrameSize.width / (GLfloat)GetNearestPositivePOT((uint32_t)lastFrameSize.width);
- GLfloat texRatioH = (GLfloat)lastFrameSize.height / (GLfloat)GetNearestPositivePOT((uint32_t)lastFrameSize.height);
- GLuint drawTexture = swRasterizerDrawTexture[0];
+ swRasterizerMainVertex[0][0] = -w/2.0f;
+ swRasterizerMainVertex[0][1] = h/2.0f;
+ swRasterizerMainVertex[1][0] = w/2.0f;
+ swRasterizerMainVertex[1][1] = h/2.0f;
+ swRasterizerMainVertex[2][0] = w/2.0f;
+ swRasterizerMainVertex[2][1] = -h/2.0f;
+ swRasterizerMainVertex[3][0] = -w/2.0f;
+ swRasterizerMainVertex[3][1] = -h/2.0f;
- if (displayType == DS_DISPLAY_TYPE_TOUCH)
- {
- drawTexture = swRasterizerDrawTexture[1];
- }
-
- glBindTexture(GL_TEXTURE_2D, drawTexture);
- glBegin(GL_QUADS);
-
- glTexCoord2f(0.0f, 0.0f);
- glVertex3f(-(w/2.0f), (h/2.0f), 0.0f);
-
- glTexCoord2f(texRatioW, 0.0f);
- glVertex3f((w/2.0f), (h/2.0f), 0.0f);
-
- glTexCoord2f(texRatioW, texRatioH);
- glVertex3f((w/2.0f), -(h/2.0f), 0.0f);
-
- glTexCoord2f(0.0f, texRatioH);
- glVertex3f(-(w/2.0f), -(h/2.0f), 0.0f);
-
- glEnd();
+ swRasterizerTouchVertex[0][0] = -w/2.0f;
+ swRasterizerTouchVertex[0][1] = h/2.0f;
+ swRasterizerTouchVertex[1][0] = w/2.0f;
+ swRasterizerTouchVertex[1][1] = h/2.0f;
+ swRasterizerTouchVertex[2][0] = w/2.0f;
+ swRasterizerTouchVertex[2][1] = -h/2.0f;
+ swRasterizerTouchVertex[3][0] = -w/2.0f;
+ swRasterizerTouchVertex[3][1] = -h/2.0f;
}
}
@@ -1104,8 +1300,6 @@ NSOpenGLContext *OSXDefaultOpenGLContext = nil;
- (void)doProcessVideoFrame:(const void *)videoFrameData frameSize:(NSSize)frameSize
{
- lastFrameSize = frameSize;
-
CGLLockContext((CGLContextObj)[[self openGLContext] CGLContextObj]);
[[self openGLContext] makeCurrentContext];
@@ -1163,6 +1357,8 @@ NSOpenGLContext *OSXDefaultOpenGLContext = nil;
[[self openGLContext] update];
CGLUnlockContext((CGLContextObj)[[self openGLContext] CGLContextObj]);
+
+ [self setupSWRasterizerVertices];
}
- (void)doRedraw
@@ -1176,7 +1372,12 @@ NSOpenGLContext *OSXDefaultOpenGLContext = nil;
CGLUnlockContext((CGLContextObj)[[self openGLContext] CGLContextObj]);
}
-- (void) doBilinearOutputChanged:(BOOL)useBilinear
+- (void)doDisplayTypeChanged:(NSInteger)displayTypeID
+{
+ [self setupSWRasterizerVertices];
+}
+
+- (void)doBilinearOutputChanged:(BOOL)useBilinear
{
glTexRenderStyle = GL_NEAREST;
if (useBilinear)
@@ -1185,7 +1386,22 @@ NSOpenGLContext *OSXDefaultOpenGLContext = nil;
}
}
-- (void) doVerticalSyncChanged:(BOOL)useVerticalSync
+- (void) doDisplayOrientationChanged:(NSInteger)displayOrientationID
+{
+ [self setupSWRasterizerVertices];
+}
+
+- (void) doDisplayOrderChanged:(NSInteger)displayOrderID
+{
+ [self setupSWRasterizerVertices];
+
+ if ([dispViewDelegate displayType] == DS_DISPLAY_TYPE_COMBO)
+ {
+ [self doRedraw];
+ }
+}
+
+- (void)doVerticalSyncChanged:(BOOL)useVerticalSync
{
GLint swapInt = 0;
@@ -1213,11 +1429,8 @@ void SetupOpenGLView(GLsizei width, GLsizei height, GLfloat scalar, GLfloat angl
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
- glOrtho(0.0, width, 0.0, height, -1.0, 1.0);
-
- glTranslatef(width / 2.0f, height / 2.0f, 0.0f);
+ glOrtho(-width/2.0, width/2.0, -height/2.0, height/2.0, -1.0, 1.0);
glRotatef((GLfloat)CLOCKWISE_DEGREES(angleDegrees), 0.0f, 0.0f, 1.0f);
- glScalef(scalar, scalar, 0.0f);
}
bool OSXOpenGLRendererInit()
diff --git a/desmume/src/cocoa/userinterface/emuWindowDelegate.h b/desmume/src/cocoa/userinterface/emuWindowDelegate.h
index 29a5df3b9..e6feddbc0 100644
--- a/desmume/src/cocoa/userinterface/emuWindowDelegate.h
+++ b/desmume/src/cocoa/userinterface/emuWindowDelegate.h
@@ -189,6 +189,8 @@
- (IBAction) changeBilinearOutput:(id)sender;
- (IBAction) changeVerticalSync:(id)sender;
- (IBAction) changeDisplayMode:(id)sender;
+- (IBAction) changeDisplayOrientation:(id)sender;
+- (IBAction) changeDisplayOrder:(id)sender;
- (IBAction) changeVideoFilter:(id)sender;
- (IBAction) change3DRenderMethod:(id)sender;
- (IBAction) change3DRenderHighPrecisionColorInterpolation:(id)sender;
diff --git a/desmume/src/cocoa/userinterface/emuWindowDelegate.mm b/desmume/src/cocoa/userinterface/emuWindowDelegate.mm
index e1900404c..dbf217693 100644
--- a/desmume/src/cocoa/userinterface/emuWindowDelegate.mm
+++ b/desmume/src/cocoa/userinterface/emuWindowDelegate.mm
@@ -869,6 +869,21 @@
[self resizeWithTransform:[dispViewDelegate normalSize] scalar:[dispViewDelegate scale] rotation:[dispViewDelegate rotation]];
}
+- (IBAction) changeDisplayOrientation:(id)sender
+{
+ [dispViewDelegate setDisplayOrientation:[CocoaDSUtil getIBActionSenderTag:sender]];
+
+ if ([dispViewDelegate displayType] == DS_DISPLAY_TYPE_COMBO)
+ {
+ [self resizeWithTransform:[dispViewDelegate normalSize] scalar:[dispViewDelegate scale] rotation:[dispViewDelegate rotation]];
+ }
+}
+
+- (IBAction) changeDisplayOrder:(id)sender
+{
+ [dispViewDelegate setDisplayOrder:[CocoaDSUtil getIBActionSenderTag:sender]];
+}
+
- (IBAction) changeVideoFilter:(id)sender
{
[dispViewDelegate setVideoFilterType:[CocoaDSUtil getIBActionSenderTag:sender]];
@@ -1709,6 +1724,34 @@
}
}
}
+ else if (theAction == @selector(changeDisplayOrientation:))
+ {
+ if ([(id)theItem isMemberOfClass:[NSMenuItem class]])
+ {
+ if ([dispViewDelegate displayOrientation] == [theItem tag])
+ {
+ [(NSMenuItem*)theItem setState:NSOnState];
+ }
+ else
+ {
+ [(NSMenuItem*)theItem setState:NSOffState];
+ }
+ }
+ }
+ else if (theAction == @selector(changeDisplayOrder:))
+ {
+ if ([(id)theItem isMemberOfClass:[NSMenuItem class]])
+ {
+ if ([dispViewDelegate displayOrder] == [theItem tag])
+ {
+ [(NSMenuItem*)theItem setState:NSOnState];
+ }
+ else
+ {
+ [(NSMenuItem*)theItem setState:NSOffState];
+ }
+ }
+ }
else if (theAction == @selector(openEmuSaveState:) ||
theAction == @selector(saveEmuSaveState:) ||
theAction == @selector(saveEmuSaveStateAs:))
@@ -1985,10 +2028,12 @@
// Set the display window per user preferences.
[self setShowStatusBar:[[NSUserDefaults standardUserDefaults] boolForKey:@"DisplayView_ShowStatusBar"]];
- // Set the display mode, sizing, and rotation.
+ // Set the display settings per user preferences.
double displayScalar = (double)([[NSUserDefaults standardUserDefaults] floatForKey:@"DisplayView_Size"] / 100.0);
double displayRotation = (double)[[NSUserDefaults standardUserDefaults] floatForKey:@"DisplayView_Rotation"];
[dispViewDelegate setDisplayType:[[NSUserDefaults standardUserDefaults] integerForKey:@"DisplayView_Mode"]];
+ [dispViewDelegate setDisplayOrientation:[[NSUserDefaults standardUserDefaults] integerForKey:@"DisplayViewCombo_Orientation"]];
+ [dispViewDelegate setDisplayOrder:[[NSUserDefaults standardUserDefaults] integerForKey:@"DisplayViewCombo_Order"]];
[self setContentScalar:displayScalar];
[self setContentRotation:displayRotation];