Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPad Version #233

Open
wants to merge 57 commits into
base: master
Choose a base branch
from
Open

IPad Version #233

wants to merge 57 commits into from

Conversation

mattuna15
Copy link

@mattuna15 mattuna15 commented Jan 5, 2020

Add Frameworks.zip dependency for iPad app (expand zip file in Xcode directory).
Add Xcode project and objective-c code
Supports dragging and dropping BIN and PRG files
Provides onscreen keys, onscreen joystick and support for external gamecontrollers.
Supports Sound
Drag and drop of PRG/BIN files from itunes.

TODO: Drag & drop of BAS files

Screenshot 2020-01-11 at 11 33 24

Copy link
Collaborator

@mist64 mist64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, mostly nitpicking. If you want, you can ignore pretty much everything, and I can massage the code later.

Thoughts?

.gitmodules Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
debugger.c Outdated
@@ -12,7 +12,22 @@
#include <stdlib.h>
#include <stdio.h>
#include <inttypes.h>

#if __APPLE__
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is repeated a lot. Can we have something like this:

#if __APPLE__ && (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE)
#include "ios.h"
#endif

and do the magic there?

Even if different .c files want different iOS headers to be included, we could just include all of them in "ios.h"; no harm in that.

Also, why special case Mac? What's "TargetConditionals.h"?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mac uses the standard code, TargetConditionals.h allows you to target specific apple platforms.

keyboard.c Outdated Show resolved Hide resolved
xcode/X16/iOS/SettingsViewController.m Outdated Show resolved Hide resolved

-(IBAction)toggleKeyboard:(id)sender {

SDL_StartTextInput();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also do this in main(). Remove there? Remove here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have to have a way of restarting input. If you completely dismiss the keyboard then SDL stops accepting input.


-(IBAction)closeWindow:(id)sender
{
[self.view removeFromSuperview];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dismissViewControllerAnimated:completion:?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to look at how SDL manages windows and views. This is the quickest way at the moment. I'll maybe add this as a todo.

@@ -0,0 +1,51 @@
//
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yay, msgSend magic! :)

But I don't see why this can't be ios_functions.m and use ObjC? The interface to the main code can still be the same, using a C interface.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the moment the observer of notifications sent between .c and SDL needs to be created through msgsend. I removed the notification msgsend though.

@@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

XIBs are impossible to review. :( I'm trusting you this is complex enough that you don't want to build any of this in code... :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hoping that these are going to be temporary.

@mist64
Copy link
Collaborator

mist64 commented Jan 16, 2020

@mattuna15 Tell me when it's a good time to look over the change again.

@mattuna15
Copy link
Author

@mist64 will do. I'm working with Jimmy Dansbo to get a socket interface up and running. So I will try and include that. Thanks for the note.

@mist64
Copy link
Collaborator

mist64 commented Jan 16, 2020

P.S.: I'd rather merge the current state than wait for all features. :)

@mattuna15
Copy link
Author

Great no problems.

@mattuna15
Copy link
Author

@mist64 good to go. 👍

@mattuna15 mattuna15 requested a review from mist64 January 19, 2020 20:33
if (log_keyboard) {
printf("DOWN 0x%02X\n", scancode);
fflush(stdout);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indenting is incorrect.

@@ -51,7 +57,17 @@ create_directory_listing(uint8_t *data)
*data++ = 'C';
*data++ = 0;

if (!(dirp = opendir("."))) {
#if __APPLE__ && (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You do this concatening a few times in this file.
Maybe extract it to some static helper function?
You can move the ifdef to it too.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 thanks I'll take a look.

@@ -933,6 +932,14 @@ video_update()
mouse_x = event.motion.x;
mouse_y = event.motion.y;
}
#if __APPLE__ && (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE)
if (event.type == SDL_DROPFILE) { // In case if dropped file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this drop event also be enabled on other systems?
I mean, it would also be nice to have this on my PC.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - sure I'll remove the conditional.

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mist64
Having support for a build system such as cmake or meson would obviate the need for inclusion of these project files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants