mirror of
https://github.com/libretro/RetroArch
synced 2025-02-21 09:39:56 +00:00
(Apple) Build fixes
This commit is contained in:
parent
3670ef2ac5
commit
0782cb5168
@ -41,10 +41,13 @@ void apple_rarch_exited(void)
|
|||||||
|
|
||||||
- (void)sendEvent:(NSEvent *)event
|
- (void)sendEvent:(NSEvent *)event
|
||||||
{
|
{
|
||||||
|
NSEventType event_type;
|
||||||
|
apple_input_data_t *apple = NULL;
|
||||||
|
driver_t *driver = driver_get_ptr();
|
||||||
[super sendEvent:event];
|
[super sendEvent:event];
|
||||||
|
|
||||||
apple_input_data_t *apple = (apple_input_data_t*)driver.input_data;
|
apple = (apple_input_data_t*)driver->input_data;
|
||||||
NSEventType event_type = event.type;
|
event_type = event.type;
|
||||||
|
|
||||||
if (!apple)
|
if (!apple)
|
||||||
return;
|
return;
|
||||||
@ -190,9 +193,9 @@ static char** waiting_argv;
|
|||||||
|
|
||||||
static void poll_iteration(void)
|
static void poll_iteration(void)
|
||||||
{
|
{
|
||||||
NSEvent *event;
|
NSEvent *event = NULL;
|
||||||
|
driver_t *driver = driver_get_ptr();
|
||||||
apple_input_data_t *apple = (apple_input_data_t*)driver.input_data;
|
apple_input_data_t *apple = (apple_input_data_t*)driver->input_data;
|
||||||
|
|
||||||
if (!apple)
|
if (!apple)
|
||||||
return;
|
return;
|
||||||
|
@ -150,7 +150,8 @@ NSWindowDelegate>
|
|||||||
int i;
|
int i;
|
||||||
NSMutableArray* thisGroup = nil;
|
NSMutableArray* thisGroup = nil;
|
||||||
NSMutableArray* thisSubGroup = nil;
|
NSMutableArray* thisSubGroup = nil;
|
||||||
const rarch_setting_t *setting_data = (const rarch_setting_t *)driver.menu->list_settings;
|
driver_t *driver = driver_get_ptr();
|
||||||
|
const rarch_setting_t *setting_data = (const rarch_setting_t *)driver->menu->list_settings;
|
||||||
|
|
||||||
self.settings = [NSMutableArray array];
|
self.settings = [NSMutableArray array];
|
||||||
|
|
||||||
@ -253,6 +254,8 @@ NSWindowDelegate>
|
|||||||
|
|
||||||
- (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item
|
- (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item
|
||||||
{
|
{
|
||||||
|
driver_t *driver = driver_get_ptr();
|
||||||
|
|
||||||
if (!tableColumn)
|
if (!tableColumn)
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
@ -268,7 +271,7 @@ NSWindowDelegate>
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
char buffer[PATH_MAX_LENGTH];
|
char buffer[PATH_MAX_LENGTH];
|
||||||
rarch_setting_t *setting_data = (rarch_setting_t*)driver.menu->list_settings;
|
rarch_setting_t *setting_data = (rarch_setting_t*)driver->menu->list_settings;
|
||||||
rarch_setting_t *setting = (rarch_setting_t*)&setting_data[[item intValue]];
|
rarch_setting_t *setting = (rarch_setting_t*)&setting_data[[item intValue]];
|
||||||
|
|
||||||
if ([[tableColumn identifier] isEqualToString:BOXSTRING("left")])
|
if ([[tableColumn identifier] isEqualToString:BOXSTRING("left")])
|
||||||
@ -292,6 +295,7 @@ NSWindowDelegate>
|
|||||||
- (NSCell*)outlineView:(NSOutlineView *)outlineView dataCellForTableColumn:(NSTableColumn *)tableColumn item:(id)item
|
- (NSCell*)outlineView:(NSOutlineView *)outlineView dataCellForTableColumn:(NSTableColumn *)tableColumn item:(id)item
|
||||||
{
|
{
|
||||||
const rarch_setting_t *setting_data, *setting;
|
const rarch_setting_t *setting_data, *setting;
|
||||||
|
driver_t *driver = driver_get_ptr();
|
||||||
|
|
||||||
if (!tableColumn)
|
if (!tableColumn)
|
||||||
return nil;
|
return nil;
|
||||||
@ -302,7 +306,7 @@ NSWindowDelegate>
|
|||||||
if ([[tableColumn identifier] isEqualToString:BOXSTRING("left")])
|
if ([[tableColumn identifier] isEqualToString:BOXSTRING("left")])
|
||||||
return [tableColumn dataCell];
|
return [tableColumn dataCell];
|
||||||
|
|
||||||
setting_data = (const rarch_setting_t *)driver.menu->list_settings;
|
setting_data = (const rarch_setting_t *)driver->menu->list_settings;
|
||||||
setting = (const rarch_setting_t *)&setting_data[[item intValue]];
|
setting = (const rarch_setting_t *)&setting_data[[item intValue]];
|
||||||
|
|
||||||
switch (setting->type)
|
switch (setting->type)
|
||||||
@ -321,6 +325,8 @@ NSWindowDelegate>
|
|||||||
- (IBAction)outlineViewClicked:(id)sender
|
- (IBAction)outlineViewClicked:(id)sender
|
||||||
{
|
{
|
||||||
id item;
|
id item;
|
||||||
|
driver_t *driver = driver_get_ptr();
|
||||||
|
|
||||||
if ([self.outline clickedColumn] != 1)
|
if ([self.outline clickedColumn] != 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -330,7 +336,7 @@ NSWindowDelegate>
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
{
|
{
|
||||||
rarch_setting_t *setting_data = (rarch_setting_t*)driver.menu->list_settings;
|
rarch_setting_t *setting_data = (rarch_setting_t*)driver->menu->list_settings;
|
||||||
rarch_setting_t *setting = (rarch_setting_t*)&setting_data[[item intValue]];
|
rarch_setting_t *setting = (rarch_setting_t*)&setting_data[[item intValue]];
|
||||||
|
|
||||||
switch (setting->type)
|
switch (setting->type)
|
||||||
@ -352,8 +358,9 @@ NSWindowDelegate>
|
|||||||
|
|
||||||
- (void)controlTextDidEndEditing:(NSNotification*)notification
|
- (void)controlTextDidEndEditing:(NSNotification*)notification
|
||||||
{
|
{
|
||||||
NSText* editor;
|
|
||||||
id item;
|
id item;
|
||||||
|
NSText* editor = NULL;
|
||||||
|
driver_t *driver = driver_get_ptr();
|
||||||
|
|
||||||
if ([notification object] != self.outline)
|
if ([notification object] != self.outline)
|
||||||
return;
|
return;
|
||||||
@ -365,7 +372,7 @@ NSWindowDelegate>
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
{
|
{
|
||||||
rarch_setting_t *setting_data = (rarch_setting_t *)driver.menu->list_settings;
|
rarch_setting_t *setting_data = (rarch_setting_t *)driver->menu->list_settings;
|
||||||
rarch_setting_t *setting = (rarch_setting_t*)&setting_data[[item intValue]];
|
rarch_setting_t *setting = (rarch_setting_t*)&setting_data[[item intValue]];
|
||||||
NSString *editor_string = (NSString*)editor.string;
|
NSString *editor_string = (NSString*)editor.string;
|
||||||
|
|
||||||
|
@ -40,7 +40,8 @@ static BOOL apple_gamecontroller_available(void)
|
|||||||
static void apple_gamecontroller_poll(GCController *controller)
|
static void apple_gamecontroller_poll(GCController *controller)
|
||||||
{
|
{
|
||||||
uint32_t slot, pause;
|
uint32_t slot, pause;
|
||||||
apple_input_data_t *apple = (apple_input_data_t*)driver.input_data;
|
driver_t *driver = driver_get_ptr();
|
||||||
|
apple_input_data_t *apple = (apple_input_data_t*)driver->input_data;
|
||||||
if (!apple || !controller || controller.playerIndex == MAX_USERS)
|
if (!apple || !controller || controller.playerIndex == MAX_USERS)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -100,7 +101,8 @@ void apple_gamecontroller_poll_all(void)
|
|||||||
|
|
||||||
static void apple_gamecontroller_register(GCGamepad *gamepad)
|
static void apple_gamecontroller_register(GCGamepad *gamepad)
|
||||||
{
|
{
|
||||||
apple_input_data_t *apple = (apple_input_data_t*)driver.input_data;
|
driver_t *driver = driver_get_ptr();
|
||||||
|
apple_input_data_t *apple = (apple_input_data_t*)driver->input_data;
|
||||||
gamepad.valueChangedHandler = ^(GCGamepad *updateGamepad, GCControllerElement *element) {
|
gamepad.valueChangedHandler = ^(GCGamepad *updateGamepad, GCControllerElement *element) {
|
||||||
apple_gamecontroller_poll(updateGamepad.controller);
|
apple_gamecontroller_poll(updateGamepad.controller);
|
||||||
};
|
};
|
||||||
|
@ -92,7 +92,8 @@ extern CGFloat apple_gfx_ctx_get_native_scale(void);
|
|||||||
static void handle_touch_event(NSArray* touches)
|
static void handle_touch_event(NSArray* touches)
|
||||||
{
|
{
|
||||||
NSUInteger i;
|
NSUInteger i;
|
||||||
apple_input_data_t *apple = (apple_input_data_t*)driver.input_data;
|
driver_t *driver = driver_get_ptr();
|
||||||
|
apple_input_data_t *apple = (apple_input_data_t*)driver->input_data;
|
||||||
CGFloat scale = apple_gfx_ctx_get_native_scale();
|
CGFloat scale = apple_gfx_ctx_get_native_scale();
|
||||||
|
|
||||||
if (!apple)
|
if (!apple)
|
||||||
@ -253,6 +254,8 @@ void notify_content_loaded(void)
|
|||||||
|
|
||||||
- (void)applicationDidFinishLaunching:(UIApplication *)application
|
- (void)applicationDidFinishLaunching:(UIApplication *)application
|
||||||
{
|
{
|
||||||
|
driver_t *driver = NULL;
|
||||||
|
|
||||||
apple_platform = self;
|
apple_platform = self;
|
||||||
[self setDelegate:self];
|
[self setDelegate:self];
|
||||||
|
|
||||||
@ -268,8 +271,11 @@ void notify_content_loaded(void)
|
|||||||
if (rarch_main(0, NULL))
|
if (rarch_main(0, NULL))
|
||||||
apple_rarch_exited();
|
apple_rarch_exited();
|
||||||
|
|
||||||
if ( driver.menu_ctx && driver.menu_ctx == &menu_ctx_ios && driver.menu && driver.menu->userdata ) {
|
driver = driver_get_ptr();
|
||||||
ios_handle_t *ih = (ios_handle_t*)driver.menu->userdata;
|
|
||||||
|
if ( driver->menu_ctx && driver->menu_ctx == &menu_ctx_ios && driver->menu && driver->menu->userdata )
|
||||||
|
{
|
||||||
|
ios_handle_t *ih = (ios_handle_t*)driver->menu->userdata;
|
||||||
ih->switch_to_ios = switch_to_ios;
|
ih->switch_to_ios = switch_to_ios;
|
||||||
ih->notify_content_loaded = notify_content_loaded;
|
ih->notify_content_loaded = notify_content_loaded;
|
||||||
}
|
}
|
||||||
|
@ -127,14 +127,16 @@ const struct apple_key_name_map_entry apple_key_name_map[] =
|
|||||||
|
|
||||||
void apple_input_enable_small_keyboard(bool on)
|
void apple_input_enable_small_keyboard(bool on)
|
||||||
{
|
{
|
||||||
apple_input_data_t *apple = (apple_input_data_t*)driver.input_data;
|
driver_t *driver = driver_get_ptr();
|
||||||
|
apple_input_data_t *apple = (apple_input_data_t*)driver->input_data;
|
||||||
if (apple)
|
if (apple)
|
||||||
apple->small_keyboard_enabled = on;
|
apple->small_keyboard_enabled = on;
|
||||||
}
|
}
|
||||||
|
|
||||||
void apple_input_enable_icade(bool on)
|
void apple_input_enable_icade(bool on)
|
||||||
{
|
{
|
||||||
apple_input_data_t *apple = (apple_input_data_t*)driver.input_data;
|
driver_t *driver = driver_get_ptr();
|
||||||
|
apple_input_data_t *apple = (apple_input_data_t*)driver->input_data;
|
||||||
|
|
||||||
if (!apple)
|
if (!apple)
|
||||||
return;
|
return;
|
||||||
@ -145,7 +147,8 @@ void apple_input_enable_icade(bool on)
|
|||||||
|
|
||||||
void apple_input_reset_icade_buttons(void)
|
void apple_input_reset_icade_buttons(void)
|
||||||
{
|
{
|
||||||
apple_input_data_t *apple = (apple_input_data_t*)driver.input_data;
|
driver_t *driver = driver_get_ptr();
|
||||||
|
apple_input_data_t *apple = (apple_input_data_t*)driver->input_data;
|
||||||
|
|
||||||
if (apple)
|
if (apple)
|
||||||
apple->icade_buttons = 0;
|
apple->icade_buttons = 0;
|
||||||
@ -154,7 +157,8 @@ void apple_input_reset_icade_buttons(void)
|
|||||||
int32_t apple_input_find_any_key(void)
|
int32_t apple_input_find_any_key(void)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
apple_input_data_t *apple = (apple_input_data_t*)driver.input_data;
|
driver_t *driver =driver_get_ptr();
|
||||||
|
apple_input_data_t *apple = (apple_input_data_t*)driver->input_data;
|
||||||
|
|
||||||
if (!apple)
|
if (!apple)
|
||||||
return 0;
|
return 0;
|
||||||
@ -172,7 +176,8 @@ int32_t apple_input_find_any_key(void)
|
|||||||
int32_t apple_input_find_any_button(uint32_t port)
|
int32_t apple_input_find_any_button(uint32_t port)
|
||||||
{
|
{
|
||||||
unsigned i, buttons = 0;
|
unsigned i, buttons = 0;
|
||||||
apple_input_data_t *apple = (apple_input_data_t*)driver.input_data;
|
driver_t *driver = driver_get_ptr();
|
||||||
|
apple_input_data_t *apple = (apple_input_data_t*)driver->input_data;
|
||||||
|
|
||||||
if (!apple)
|
if (!apple)
|
||||||
return -1;
|
return -1;
|
||||||
@ -195,7 +200,8 @@ int32_t apple_input_find_any_button(uint32_t port)
|
|||||||
int32_t apple_input_find_any_axis(uint32_t port)
|
int32_t apple_input_find_any_axis(uint32_t port)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
apple_input_data_t *apple = (apple_input_data_t*)driver.input_data;
|
driver_t *driver = driver_get_ptr();
|
||||||
|
apple_input_data_t *apple = (apple_input_data_t*)driver->input_data;
|
||||||
|
|
||||||
if (apple && apple->joypad)
|
if (apple && apple->joypad)
|
||||||
apple->joypad->poll();
|
apple->joypad->poll();
|
||||||
|
@ -49,7 +49,8 @@ static void hid_pad_connection_send_control(void *data, uint8_t* data_buf, size_
|
|||||||
static void hid_device_input_callback(void* context, IOReturn result,
|
static void hid_device_input_callback(void* context, IOReturn result,
|
||||||
void* sender, IOHIDValueRef value)
|
void* sender, IOHIDValueRef value)
|
||||||
{
|
{
|
||||||
apple_input_data_t *apple = (apple_input_data_t*)driver.input_data;
|
driver_t *driver = driver_get_ptr();
|
||||||
|
apple_input_data_t *apple = (apple_input_data_t*)driver->input_data;
|
||||||
struct pad_connection* connection = (struct pad_connection*)context;
|
struct pad_connection* connection = (struct pad_connection*)context;
|
||||||
IOHIDElementRef element = IOHIDValueGetElement(value);
|
IOHIDElementRef element = IOHIDValueGetElement(value);
|
||||||
uint32_t type = IOHIDElementGetType(element);
|
uint32_t type = IOHIDElementGetType(element);
|
||||||
@ -119,7 +120,8 @@ static void hid_device_input_callback(void* context, IOReturn result,
|
|||||||
|
|
||||||
static void remove_device(void* context, IOReturn result, void* sender)
|
static void remove_device(void* context, IOReturn result, void* sender)
|
||||||
{
|
{
|
||||||
apple_input_data_t *apple = (apple_input_data_t*)driver.input_data;
|
driver_t *driver = driver_get_ptr();
|
||||||
|
apple_input_data_t *apple = (apple_input_data_t*)driver->input_data;
|
||||||
struct pad_connection* connection = (struct pad_connection*)context;
|
struct pad_connection* connection = (struct pad_connection*)context;
|
||||||
|
|
||||||
if (connection && connection->slot < MAX_USERS)
|
if (connection && connection->slot < MAX_USERS)
|
||||||
@ -290,7 +292,8 @@ static void apple_joypad_destroy(void)
|
|||||||
|
|
||||||
static bool apple_joypad_button(unsigned port, uint16_t joykey)
|
static bool apple_joypad_button(unsigned port, uint16_t joykey)
|
||||||
{
|
{
|
||||||
apple_input_data_t *apple = (apple_input_data_t*)driver.input_data;
|
driver_t *driver = driver_get_ptr();
|
||||||
|
apple_input_data_t *apple = (apple_input_data_t*)driver->input_data;
|
||||||
uint64_t buttons = pad_connection_get_buttons(&slots[port], port);
|
uint64_t buttons = pad_connection_get_buttons(&slots[port], port);
|
||||||
|
|
||||||
if (!apple || joykey == NO_BTN)
|
if (!apple || joykey == NO_BTN)
|
||||||
@ -314,7 +317,8 @@ static uint64_t apple_joypad_get_buttons(unsigned port)
|
|||||||
|
|
||||||
static int16_t apple_joypad_axis(unsigned port, uint32_t joyaxis)
|
static int16_t apple_joypad_axis(unsigned port, uint32_t joyaxis)
|
||||||
{
|
{
|
||||||
apple_input_data_t *apple = (apple_input_data_t*)driver.input_data;
|
driver_t *driver = driver_get_ptr();
|
||||||
|
apple_input_data_t *apple = (apple_input_data_t*)driver->input_data;
|
||||||
int16_t val = 0;
|
int16_t val = 0;
|
||||||
|
|
||||||
if (!apple || joyaxis == AXIS_NONE)
|
if (!apple || joyaxis == AXIS_NONE)
|
||||||
|
@ -48,7 +48,8 @@ static void apple_joypad_destroy(void)
|
|||||||
|
|
||||||
static bool apple_joypad_button(unsigned port, uint16_t joykey)
|
static bool apple_joypad_button(unsigned port, uint16_t joykey)
|
||||||
{
|
{
|
||||||
apple_input_data_t *apple = (apple_input_data_t*)driver.input_data;
|
driver_t *driver = driver_get_ptr();
|
||||||
|
apple_input_data_t *apple = (apple_input_data_t*)driver->input_data;
|
||||||
uint64_t buttons = pad_connection_get_buttons(&slots[port], port);
|
uint64_t buttons = pad_connection_get_buttons(&slots[port], port);
|
||||||
if (!apple || joykey == NO_BTN)
|
if (!apple || joykey == NO_BTN)
|
||||||
return false;
|
return false;
|
||||||
@ -70,7 +71,8 @@ static uint64_t apple_joypad_get_buttons(unsigned port)
|
|||||||
|
|
||||||
static int16_t apple_joypad_axis(unsigned port, uint32_t joyaxis)
|
static int16_t apple_joypad_axis(unsigned port, uint32_t joyaxis)
|
||||||
{
|
{
|
||||||
apple_input_data_t *apple = (apple_input_data_t*)driver.input_data;
|
driver_t *driver = driver_get_ptr();
|
||||||
|
apple_input_data_t *apple = (apple_input_data_t*)driver->input_data;
|
||||||
int16_t val = 0;
|
int16_t val = 0;
|
||||||
|
|
||||||
if (!apple || joyaxis == AXIS_NONE)
|
if (!apple || joyaxis == AXIS_NONE)
|
||||||
|
@ -67,7 +67,8 @@ static bool handle_small_keyboard(unsigned* code, bool down)
|
|||||||
{ KEY_X, KP_2 }, { KEY_C, KP_3 },
|
{ KEY_X, KP_2 }, { KEY_C, KP_3 },
|
||||||
{ 0 }
|
{ 0 }
|
||||||
};
|
};
|
||||||
apple_input_data_t *apple = (apple_input_data_t*)driver.input_data;
|
driver_t *driver = driver_get_ptr();
|
||||||
|
apple_input_data_t *apple = (apple_input_data_t*)driver->input_data;
|
||||||
unsigned translated_code = 0;
|
unsigned translated_code = 0;
|
||||||
|
|
||||||
if (!map_initialized)
|
if (!map_initialized)
|
||||||
@ -118,7 +119,8 @@ static void handle_icade_event(unsigned keycode)
|
|||||||
{ false, 5 }, { true , 11 }, { false, 0 }, { false, 1 }, // 8
|
{ false, 5 }, { true , 11 }, { false, 0 }, { false, 1 }, // 8
|
||||||
{ false, 4 }, { true , 1 }, { false, -1 }, { false, -1 } // C
|
{ false, 4 }, { true , 1 }, { false, -1 }, { false, -1 } // C
|
||||||
};
|
};
|
||||||
apple_input_data_t *apple = (apple_input_data_t*)driver.input_data;
|
driver_t *driver = driver_get_ptr();
|
||||||
|
apple_input_data_t *apple = (apple_input_data_t*)driver->input_data;
|
||||||
|
|
||||||
if (apple->icade_enabled && (keycode < 0x20)
|
if (apple->icade_enabled && (keycode < 0x20)
|
||||||
&& (icade_map[keycode].button >= 0))
|
&& (icade_map[keycode].button >= 0))
|
||||||
@ -135,7 +137,8 @@ static void handle_icade_event(unsigned keycode)
|
|||||||
void apple_input_keyboard_event(bool down,
|
void apple_input_keyboard_event(bool down,
|
||||||
unsigned code, uint32_t character, uint32_t mod, unsigned device)
|
unsigned code, uint32_t character, uint32_t mod, unsigned device)
|
||||||
{
|
{
|
||||||
apple_input_data_t *apple = (apple_input_data_t*)driver.input_data;
|
driver_t *driver = driver_get_ptr();
|
||||||
|
apple_input_data_t *apple = (apple_input_data_t*)driver->input_data;
|
||||||
|
|
||||||
if (!apple)
|
if (!apple)
|
||||||
return;
|
return;
|
||||||
|
@ -355,7 +355,6 @@ static void rgui_render(void)
|
|||||||
const char *core_version = NULL;
|
const char *core_version = NULL;
|
||||||
menu_handle_t *menu = menu_driver_resolve();
|
menu_handle_t *menu = menu_driver_resolve();
|
||||||
runloop_t *runloop = rarch_main_get_ptr();
|
runloop_t *runloop = rarch_main_get_ptr();
|
||||||
driver_t *driver = driver_get_ptr();
|
|
||||||
|
|
||||||
if (!menu)
|
if (!menu)
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user