Skip to content

IPad Version#233

Open
mattuna15 wants to merge 57 commits into
commanderx16:masterfrom
mattuna15:iPad
Open

IPad Version#233
mattuna15 wants to merge 57 commits into
commanderx16:masterfrom
mattuna15:iPad

Conversation

@mattuna15

@mattuna15 mattuna15 commented Jan 5, 2020

Copy link
Copy Markdown

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

@mist64 mist64 left a comment

Copy link
Copy Markdown
Collaborator

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?

Comment thread .gitmodules Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread debugger.c Outdated
#include <stdio.h>
#include <inttypes.h>

#if __APPLE__

Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread keyboard.c Outdated
Comment thread xcode/X16/iOS/SettingsViewController.m Outdated
Comment thread xcode/X16/iOS/SettingsViewController.m Outdated

-(IBAction)toggleKeyboard:(id)sender {

SDL_StartTextInput();

Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread xcode/X16/iOS/SettingsViewController.m Outdated

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

Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread xcode/X16/iOS/ios_functions.c Outdated
@@ -0,0 +1,51 @@
//

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

Comment thread xcode/X16/iOS/GameControlViewController.xib Outdated
@mist64

mist64 commented Jan 16, 2020

Copy link
Copy Markdown
Collaborator

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

@mattuna15

Copy link
Copy Markdown
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

mist64 commented Jan 16, 2020

Copy link
Copy Markdown
Collaborator

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

@mattuna15

Copy link
Copy Markdown
Author

Great no problems.

@mattuna15

Copy link
Copy Markdown
Author

@mist64 good to go. 👍

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Indenting is incorrect.

Comment thread loadsave.c
*data++ = 0;

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

Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread video.c
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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