Skip to content

Commit

Permalink
add iOS project for iPhone/iPad/iPod touch
Browse files Browse the repository at this point in the history
  • Loading branch information
hissorii committed Dec 2, 2013
1 parent cd05de0 commit 0ae02af
Show file tree
Hide file tree
Showing 16 changed files with 1,133 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ px68k-android/obj
px68k-android/.classpath
px68k-android/.project
px68k-android/.settings

px68k-ios/px68k-ios.xcodeproj/project.xcworkspace
px68k-ios/px68k-ios.xcodeproj/xcuserdata
2 changes: 1 addition & 1 deletion fmgen/headers.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#define STRICT
#define WIN32_LEAN_AND_MEAN

#include <windows.h>
#include "windows.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
Expand Down
888 changes: 888 additions & 0 deletions px68k-ios/px68k-ios.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"images" : [
{
"orientation" : "portrait",
"idiom" : "iphone",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"subtype" : "retina4",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "1x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "1x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
2 changes: 2 additions & 0 deletions px68k-ios/px68k-ios/en.lproj/InfoPlist.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* Localized versions of Info.plist keys */

42 changes: 42 additions & 0 deletions px68k-ios/px68k-ios/px68k-ios-Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>home.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
16 changes: 16 additions & 0 deletions px68k-ios/px68k-ios/px68k-ios-Prefix.pch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// Prefix header
//
// The contents of this file are implicitly included at the beginning of every source file.
//

#import <Availability.h>

#ifndef __IPHONE_3_0
#warning "This project uses features only available in iOS SDK 3.0 and later."
#endif

#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#endif
2 changes: 2 additions & 0 deletions px68k-ios/px68k-iosTests/en.lproj/InfoPlist.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* Localized versions of Info.plist keys */

22 changes: 22 additions & 0 deletions px68k-ios/px68k-iosTests/px68k-iosTests-Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>home.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
34 changes: 34 additions & 0 deletions px68k-ios/px68k-iosTests/px68k_iosTests.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//
// px68k_iosTests.m
// px68k-iosTests
//
// Created by hissorii on 2013/11/28.
// Copyright (c) 2013年 hissorii. All rights reserved.
//

#import <XCTest/XCTest.h>

@interface px68k_iosTests : XCTestCase

@end

@implementation px68k_iosTests

- (void)setUp
{
[super setUp];
// Put setup code here. This method is called before the invocation of each test method in the class.
}

- (void)tearDown
{
// Put teardown code here. This method is called after the invocation of each test method in the class.
[super tearDown];
}

- (void)testExample
{
XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__);
}

@end
4 changes: 4 additions & 0 deletions x11/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
#include <stdio.h>
#include <string.h>

#ifdef __APPLE__
#include "TargetConditionals.h"
#endif

#define TRUE 1
#define FALSE 0
#define SUCCESS 0
Expand Down
6 changes: 6 additions & 0 deletions x11/prop.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ set_modulepath(char *path, size_t len)
sprintf(winx68k_ini, "/sdcard/px68k/config");
return 0;
#endif
#if defined(TARGET_OS_IPHONE) && !defined(TARGET_IPHONE_SIMULATOR)
puts("Iphone...");
sprintf(path, "/var/mobile/px68k");
sprintf(winx68k_ini, "/var/mobile/px68k/config");
return 0;
#endif

homepath = getenv("HOME");
if (homepath == 0)
Expand Down
9 changes: 7 additions & 2 deletions x11/winx68k.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ extern "C" {
#include "winx68k.h"
#include "windraw.h"
#include "winui.h"
#include "m68000.h" // xxx これはいずれいらなくなるはず
#include "../x68k/m68000.h" // xxx これはいずれいらなくなるはず
#include "../m68000/m68000.h"
#include "../x68k/memory.h"
#include "mfp.h"
Expand Down Expand Up @@ -55,7 +55,7 @@ extern "C" {
#include "d68k.h"
#endif

#include "../icons/keropi_mono.xbm"
//#include "../icons/keropi_mono.xbm"

#define APPNAME "Keropi"

Expand Down Expand Up @@ -180,6 +180,7 @@ WinX68k_LoadROMs(void)
for (fp = 0, i = 0; fp == 0 && i < NELEMENTS(BIOSFILE); ++i) {
fp = File_OpenCurDir((char *)BIOSFILE[i]);
}

if (fp == 0) {
Error("BIOS ROM イメージが見つかりません.");
return FALSE;
Expand Down Expand Up @@ -586,6 +587,7 @@ int main(int argc, char *argv[])

dosio_init();
file_setcd(winx68k_dir);
puts(winx68k_dir);

LoadConfig();

Expand Down Expand Up @@ -739,6 +741,9 @@ int main(int argc, char *argv[])
break;
}

#ifdef TARGET_OS_IPHONE
strcpy(Config.FDDImage[0], "FDD1.XDF");
#endif
FDD_SetFD(0, Config.FDDImage[0], 0);
FDD_SetFD(1, Config.FDDImage[1], 0);

Expand Down
2 changes: 2 additions & 0 deletions x11/winx68k.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#include "common.h"

#define vline HOGEvline // workaround for redefinition of 'vline'

#define SCREEN_WIDTH 768
#define SCREEN_HEIGHT 512

Expand Down
2 changes: 1 addition & 1 deletion x68k/midi.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "prop.h"
#include "winx68k.h"
#include "fileio.h"
#include <mmsystem.h>
#include "mmsystem.h"
#include "memory.h"
#include "irqh.h"
#include "midi.h"
Expand Down

0 comments on commit 0ae02af

Please sign in to comment.