Cocoa Port:
- Add support for the new dynamic recompiler CPU emulation engine to the legacy port - Legacy project build targets are now separated into distinct Intel and PowerPC builds - Fix sound playback issue in the legacy port - Add OpenGL 3D renderer support to the legacy port (but we're still use the software rasterizer, which is much faster and more accurate)
This commit is contained in:
parent
a5a03613f1
commit
4e7b94f75e
File diff suppressed because it is too large
Load Diff
|
@ -18,6 +18,8 @@
|
|||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#include <pthread.h>
|
||||
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
|
||||
#include "macosx_10_4_compat.h"
|
||||
|
@ -51,6 +53,7 @@
|
|||
|
||||
NSLock *execution_lock;
|
||||
NSLock *sound_lock;
|
||||
pthread_mutex_t *mutexCoreExecute;
|
||||
|
||||
ScreenState * volatile current_screen;
|
||||
NSLock *video_update_lock;
|
||||
|
@ -155,3 +158,5 @@
|
|||
- (NSBitmapImageRep *) bitmapImageRep;
|
||||
|
||||
@end
|
||||
|
||||
bool OSXOpenGLRendererInit();
|
||||
|
|
|
@ -50,11 +50,18 @@ volatile bool execute = true;
|
|||
GPU3DInterface *core3DList[] = {
|
||||
&gpu3DNull,
|
||||
&gpu3DRasterize,
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4
|
||||
&gpu3Dgl,
|
||||
#endif
|
||||
NULL
|
||||
};
|
||||
|
||||
struct NDS_fw_config_data macDS_firmware;
|
||||
|
||||
bool OSXOpenGLRendererInit()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@implementation NintendoDS
|
||||
- (id)init
|
||||
|
@ -74,6 +81,10 @@ struct NDS_fw_config_data macDS_firmware;
|
|||
execution_lock = [[NSLock alloc] init];
|
||||
sound_lock = [[NSLock alloc] init];
|
||||
current_screen = nil;
|
||||
|
||||
mutexCoreExecute = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t));
|
||||
pthread_mutex_init(mutexCoreExecute, NULL);
|
||||
mutexAudioEmulateCore = mutexCoreExecute;
|
||||
|
||||
#ifdef GDB_STUB
|
||||
arm9_gdb_port = 0;
|
||||
|
@ -120,6 +131,10 @@ struct NDS_fw_config_data macDS_firmware;
|
|||
//this is for compatibility for tiger and earlier
|
||||
timer_based = ([NSObject instancesRespondToSelector:@selector(performSelector:onThread:withObject:waitUntilDone:)]==NO)?true:false;
|
||||
|
||||
#ifdef HAVE_JIT
|
||||
CommonSettings.use_jit = true;
|
||||
#endif
|
||||
|
||||
//Firmware setup
|
||||
#ifdef GDB_STUB
|
||||
NDS_Init(arm9_memio, &arm9_ctrl_iface,
|
||||
|
@ -223,7 +238,13 @@ struct NDS_fw_config_data macDS_firmware;
|
|||
{
|
||||
[context makeCurrentContext];
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4
|
||||
oglrender_init = &OSXOpenGLRendererInit;
|
||||
//NDS_3D_SetDriver(CORE3DLIST_OPENGL);
|
||||
NDS_3D_SetDriver(CORE3DLIST_SWRASTERIZE);
|
||||
#else
|
||||
NDS_3D_SetDriver(CORE3DLIST_SWRASTERIZE);
|
||||
#endif
|
||||
if(!gpu3D->NDS_3D_Init())
|
||||
[CocoaDSUtil quickDialogUsingTitle:NSLocalizedString(@"Error", nil) message:NSLocalizedString(@"Unable to initialize OpenGL components", nil)];
|
||||
}
|
||||
|
@ -304,6 +325,9 @@ struct NDS_fw_config_data macDS_firmware;
|
|||
[loadedRomURL release];
|
||||
[sound_lock release];
|
||||
[execution_lock release];
|
||||
|
||||
pthread_mutex_destroy(mutexCoreExecute);
|
||||
free(mutexCoreExecute);
|
||||
|
||||
NDS_DeInit();
|
||||
|
||||
|
@ -676,7 +700,9 @@ struct NDS_fw_config_data macDS_firmware;
|
|||
while(!paused){}
|
||||
}
|
||||
|
||||
pthread_mutex_lock(mutexCoreExecute);
|
||||
NDS_Reset();
|
||||
pthread_mutex_unlock(mutexCoreExecute);
|
||||
|
||||
//[execution_lock unlock];
|
||||
run = old_run;
|
||||
|
@ -1092,12 +1118,12 @@ struct NDS_fw_config_data macDS_firmware;
|
|||
{
|
||||
[execution_lock lock];
|
||||
|
||||
pthread_mutex_lock(mutexCoreExecute);
|
||||
NDS_exec<false>();
|
||||
pthread_mutex_unlock(mutexCoreExecute);
|
||||
|
||||
[sound_lock lock];
|
||||
|
||||
SPU_Emulate_user();
|
||||
|
||||
[sound_lock unlock];
|
||||
|
||||
[execution_lock unlock];
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<integer value="390"/>
|
||||
<integer value="29"/>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||
|
@ -1914,7 +1915,7 @@
|
|||
<string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
|
||||
<string key="NSWindowContentMinSize">{256, 408}</string>
|
||||
<object class="NSView" key="NSWindowView" id="687316055">
|
||||
<nil key="NSNextResponder"/>
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">256</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
|
@ -1971,7 +1972,7 @@
|
|||
<int key="NSCellFlags2">33554432</int>
|
||||
<object class="NSCustomResource" key="NSContents">
|
||||
<string key="NSClassName">NSImage</string>
|
||||
<string key="NSResourceName">Icon_VolumeFull</string>
|
||||
<string key="NSResourceName">Icon_VolumeFull_16x16</string>
|
||||
</object>
|
||||
<int key="NSAlign">0</int>
|
||||
<int key="NSScale">2</int>
|
||||
|
@ -2010,6 +2011,7 @@
|
|||
</object>
|
||||
</object>
|
||||
<string key="NSFrameSize">{256, 408}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string>
|
||||
<string key="NSMinSize">{256, 430}</string>
|
||||
|
@ -5965,7 +5967,7 @@
|
|||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>{{928, 836}, {512, 20}}</string>
|
||||
<string>{{1026, 1136}, {512, 20}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="YES"/>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
|
@ -5995,9 +5997,9 @@
|
|||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>{{355, 448}, {256, 408}}</string>
|
||||
<string>{{1040, 685}, {256, 408}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>{{355, 448}, {256, 408}}</string>
|
||||
<string>{{1040, 685}, {256, 408}}</string>
|
||||
<integer value="1"/>
|
||||
<string>{{33, 99}, {480, 360}}</string>
|
||||
<boolean value="YES"/>
|
||||
|
@ -7434,13 +7436,13 @@
|
|||
<integer value="3100" key="NS.object.0"/>
|
||||
</object>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<string key="IBDocument.LastKnownRelativeProjectPath">../../DeSmuME.xcodeproj</string>
|
||||
<string key="IBDocument.LastKnownRelativeProjectPath">../../DeSmuME (Legacy).xcodeproj</string>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
<object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>Icon_VolumeFull</string>
|
||||
<string>Icon_VolumeFull_16x16</string>
|
||||
<string>NSApplicationIcon</string>
|
||||
<string>NSMenuCheckmark</string>
|
||||
<string>NSMenuMixedState</string>
|
||||
|
@ -7448,7 +7450,7 @@
|
|||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>{128, 128}</string>
|
||||
<string>{20, 20}</string>
|
||||
<string>{512, 512}</string>
|
||||
<string>{9, 8}</string>
|
||||
<string>{7, 2}</string>
|
||||
|
|
Loading…
Reference in New Issue