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>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
#include <pthread.h>
|
||||||
|
|
||||||
|
|
||||||
#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
|
#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
|
||||||
#include "macosx_10_4_compat.h"
|
#include "macosx_10_4_compat.h"
|
||||||
|
@ -51,6 +53,7 @@
|
||||||
|
|
||||||
NSLock *execution_lock;
|
NSLock *execution_lock;
|
||||||
NSLock *sound_lock;
|
NSLock *sound_lock;
|
||||||
|
pthread_mutex_t *mutexCoreExecute;
|
||||||
|
|
||||||
ScreenState * volatile current_screen;
|
ScreenState * volatile current_screen;
|
||||||
NSLock *video_update_lock;
|
NSLock *video_update_lock;
|
||||||
|
@ -155,3 +158,5 @@
|
||||||
- (NSBitmapImageRep *) bitmapImageRep;
|
- (NSBitmapImageRep *) bitmapImageRep;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
bool OSXOpenGLRendererInit();
|
||||||
|
|
|
@ -50,11 +50,18 @@ volatile bool execute = true;
|
||||||
GPU3DInterface *core3DList[] = {
|
GPU3DInterface *core3DList[] = {
|
||||||
&gpu3DNull,
|
&gpu3DNull,
|
||||||
&gpu3DRasterize,
|
&gpu3DRasterize,
|
||||||
|
#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4
|
||||||
|
&gpu3Dgl,
|
||||||
|
#endif
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
struct NDS_fw_config_data macDS_firmware;
|
struct NDS_fw_config_data macDS_firmware;
|
||||||
|
|
||||||
|
bool OSXOpenGLRendererInit()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@implementation NintendoDS
|
@implementation NintendoDS
|
||||||
- (id)init
|
- (id)init
|
||||||
|
@ -74,6 +81,10 @@ struct NDS_fw_config_data macDS_firmware;
|
||||||
execution_lock = [[NSLock alloc] init];
|
execution_lock = [[NSLock alloc] init];
|
||||||
sound_lock = [[NSLock alloc] init];
|
sound_lock = [[NSLock alloc] init];
|
||||||
current_screen = nil;
|
current_screen = nil;
|
||||||
|
|
||||||
|
mutexCoreExecute = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t));
|
||||||
|
pthread_mutex_init(mutexCoreExecute, NULL);
|
||||||
|
mutexAudioEmulateCore = mutexCoreExecute;
|
||||||
|
|
||||||
#ifdef GDB_STUB
|
#ifdef GDB_STUB
|
||||||
arm9_gdb_port = 0;
|
arm9_gdb_port = 0;
|
||||||
|
@ -120,6 +131,10 @@ struct NDS_fw_config_data macDS_firmware;
|
||||||
//this is for compatibility for tiger and earlier
|
//this is for compatibility for tiger and earlier
|
||||||
timer_based = ([NSObject instancesRespondToSelector:@selector(performSelector:onThread:withObject:waitUntilDone:)]==NO)?true:false;
|
timer_based = ([NSObject instancesRespondToSelector:@selector(performSelector:onThread:withObject:waitUntilDone:)]==NO)?true:false;
|
||||||
|
|
||||||
|
#ifdef HAVE_JIT
|
||||||
|
CommonSettings.use_jit = true;
|
||||||
|
#endif
|
||||||
|
|
||||||
//Firmware setup
|
//Firmware setup
|
||||||
#ifdef GDB_STUB
|
#ifdef GDB_STUB
|
||||||
NDS_Init(arm9_memio, &arm9_ctrl_iface,
|
NDS_Init(arm9_memio, &arm9_ctrl_iface,
|
||||||
|
@ -223,7 +238,13 @@ struct NDS_fw_config_data macDS_firmware;
|
||||||
{
|
{
|
||||||
[context makeCurrentContext];
|
[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);
|
NDS_3D_SetDriver(CORE3DLIST_SWRASTERIZE);
|
||||||
|
#else
|
||||||
|
NDS_3D_SetDriver(CORE3DLIST_SWRASTERIZE);
|
||||||
|
#endif
|
||||||
if(!gpu3D->NDS_3D_Init())
|
if(!gpu3D->NDS_3D_Init())
|
||||||
[CocoaDSUtil quickDialogUsingTitle:NSLocalizedString(@"Error", nil) message:NSLocalizedString(@"Unable to initialize OpenGL components", nil)];
|
[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];
|
[loadedRomURL release];
|
||||||
[sound_lock release];
|
[sound_lock release];
|
||||||
[execution_lock release];
|
[execution_lock release];
|
||||||
|
|
||||||
|
pthread_mutex_destroy(mutexCoreExecute);
|
||||||
|
free(mutexCoreExecute);
|
||||||
|
|
||||||
NDS_DeInit();
|
NDS_DeInit();
|
||||||
|
|
||||||
|
@ -676,7 +700,9 @@ struct NDS_fw_config_data macDS_firmware;
|
||||||
while(!paused){}
|
while(!paused){}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pthread_mutex_lock(mutexCoreExecute);
|
||||||
NDS_Reset();
|
NDS_Reset();
|
||||||
|
pthread_mutex_unlock(mutexCoreExecute);
|
||||||
|
|
||||||
//[execution_lock unlock];
|
//[execution_lock unlock];
|
||||||
run = old_run;
|
run = old_run;
|
||||||
|
@ -1092,12 +1118,12 @@ struct NDS_fw_config_data macDS_firmware;
|
||||||
{
|
{
|
||||||
[execution_lock lock];
|
[execution_lock lock];
|
||||||
|
|
||||||
|
pthread_mutex_lock(mutexCoreExecute);
|
||||||
NDS_exec<false>();
|
NDS_exec<false>();
|
||||||
|
pthread_mutex_unlock(mutexCoreExecute);
|
||||||
|
|
||||||
[sound_lock lock];
|
[sound_lock lock];
|
||||||
|
|
||||||
SPU_Emulate_user();
|
SPU_Emulate_user();
|
||||||
|
|
||||||
[sound_lock unlock];
|
[sound_lock unlock];
|
||||||
|
|
||||||
[execution_lock unlock];
|
[execution_lock unlock];
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
</object>
|
</object>
|
||||||
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
|
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
|
||||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
<integer value="390"/>
|
||||||
<integer value="29"/>
|
<integer value="29"/>
|
||||||
</object>
|
</object>
|
||||||
<object class="NSArray" key="IBDocument.PluginDependencies">
|
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||||
|
@ -1914,7 +1915,7 @@
|
||||||
<string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
|
<string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
|
||||||
<string key="NSWindowContentMinSize">{256, 408}</string>
|
<string key="NSWindowContentMinSize">{256, 408}</string>
|
||||||
<object class="NSView" key="NSWindowView" id="687316055">
|
<object class="NSView" key="NSWindowView" id="687316055">
|
||||||
<nil key="NSNextResponder"/>
|
<reference key="NSNextResponder"/>
|
||||||
<int key="NSvFlags">256</int>
|
<int key="NSvFlags">256</int>
|
||||||
<object class="NSMutableArray" key="NSSubviews">
|
<object class="NSMutableArray" key="NSSubviews">
|
||||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
|
@ -1971,7 +1972,7 @@
|
||||||
<int key="NSCellFlags2">33554432</int>
|
<int key="NSCellFlags2">33554432</int>
|
||||||
<object class="NSCustomResource" key="NSContents">
|
<object class="NSCustomResource" key="NSContents">
|
||||||
<string key="NSClassName">NSImage</string>
|
<string key="NSClassName">NSImage</string>
|
||||||
<string key="NSResourceName">Icon_VolumeFull</string>
|
<string key="NSResourceName">Icon_VolumeFull_16x16</string>
|
||||||
</object>
|
</object>
|
||||||
<int key="NSAlign">0</int>
|
<int key="NSAlign">0</int>
|
||||||
<int key="NSScale">2</int>
|
<int key="NSScale">2</int>
|
||||||
|
@ -2010,6 +2011,7 @@
|
||||||
</object>
|
</object>
|
||||||
</object>
|
</object>
|
||||||
<string key="NSFrameSize">{256, 408}</string>
|
<string key="NSFrameSize">{256, 408}</string>
|
||||||
|
<reference key="NSSuperview"/>
|
||||||
</object>
|
</object>
|
||||||
<string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string>
|
<string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string>
|
||||||
<string key="NSMinSize">{256, 430}</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>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>
|
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||||
<boolean value="YES"/>
|
<boolean value="YES"/>
|
||||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
<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>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>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||||
<string>{{355, 448}, {256, 408}}</string>
|
<string>{{1040, 685}, {256, 408}}</string>
|
||||||
<integer value="1"/>
|
<integer value="1"/>
|
||||||
<string>{{33, 99}, {480, 360}}</string>
|
<string>{{33, 99}, {480, 360}}</string>
|
||||||
<boolean value="YES"/>
|
<boolean value="YES"/>
|
||||||
|
@ -7434,13 +7436,13 @@
|
||||||
<integer value="3100" key="NS.object.0"/>
|
<integer value="3100" key="NS.object.0"/>
|
||||||
</object>
|
</object>
|
||||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
<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>
|
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||||
<object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
|
<object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
|
||||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
<object class="NSArray" key="dict.sortedKeys">
|
<object class="NSArray" key="dict.sortedKeys">
|
||||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
<string>Icon_VolumeFull</string>
|
<string>Icon_VolumeFull_16x16</string>
|
||||||
<string>NSApplicationIcon</string>
|
<string>NSApplicationIcon</string>
|
||||||
<string>NSMenuCheckmark</string>
|
<string>NSMenuCheckmark</string>
|
||||||
<string>NSMenuMixedState</string>
|
<string>NSMenuMixedState</string>
|
||||||
|
@ -7448,7 +7450,7 @@
|
||||||
</object>
|
</object>
|
||||||
<object class="NSMutableArray" key="dict.values">
|
<object class="NSMutableArray" key="dict.values">
|
||||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||||
<string>{128, 128}</string>
|
<string>{20, 20}</string>
|
||||||
<string>{512, 512}</string>
|
<string>{512, 512}</string>
|
||||||
<string>{9, 8}</string>
|
<string>{9, 8}</string>
|
||||||
<string>{7, 2}</string>
|
<string>{7, 2}</string>
|
||||||
|
|
Loading…
Reference in New Issue