Skip to content

Commit

Permalink
Controller stick fix
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamLCobb committed Jul 5, 2016
1 parent 099b6b2 commit 353ca75
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
Binary file modified Dolphin/libcommon.a
Binary file not shown.
7 changes: 4 additions & 3 deletions GC4iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -645,8 +645,9 @@
CAB660471D09B9D600037854 /* Project object */ = {
isa = PBXProject;
attributes = {
CLASSPREFIX = GC4iOS;
LastUpgradeCheck = 0730;
ORGANIZATIONNAME = WilliamCobb;
ORGANIZATIONNAME = GC4iOS;
TargetAttributes = {
CAB6604E1D09B9D600037854 = {
CreatedOnToolsVersion = 7.3;
Expand Down Expand Up @@ -917,7 +918,7 @@
"$(PROJECT_DIR)",
"$(PROJECT_DIR)/Dolphin",
);
PRODUCT_BUNDLE_IDENTIFIER = WilliamCobb.GC4iOS;
PRODUCT_BUNDLE_IDENTIFIER = com.WilliamCobb.GC4iOS;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
Expand All @@ -943,7 +944,7 @@
"$(PROJECT_DIR)/Dolphin",
);
ONLY_ACTIVE_ARCH = YES;
PRODUCT_BUNDLE_IDENTIFIER = WilliamCobb.GC4iOS;
PRODUCT_BUNDLE_IDENTIFIER = com.WilliamCobb.GC4iOS;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
Expand Down
4 changes: 3 additions & 1 deletion GC4iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
Expand All @@ -21,7 +23,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}${BUNDLE_ID_SUFFIX}</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)${BUNDLE_ID_SUFFIX}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand Down
11 changes: 6 additions & 5 deletions GC4iOS/UI/EmulatorViewController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,18 @@ - (void)viewWillLayoutSubviews

//printf("%f %f\n", joyData[0].x, joyData[1].x);

pad->stickX = (int)joyData[0].x;
pad->stickY = (int)joyData[0].y;
pad->stickX = (uint8_t)joyData[0].x;
pad->stickY = (uint8_t)joyData[0].y;

pad->substickX = (int)joyData[1].x;
pad->substickY = (int)joyData[1].y;
pad->substickX = (uint8_t)joyData[1].x;
pad->substickY = (uint8_t)joyData[1].y;
}

// Create a new class to handle the controller later
- (void)joystick:(NSInteger)joyid movedToPosition:(CGPoint)joyPosition
{
joyData[joyid] = joyPosition;
joyData[joyid].x = joyPosition.x * 126 + 127;
joyData[joyid].y = joyPosition.y * 126 + 127;
}

- (void)buttonStateChanged:(u16)bState
Expand Down

0 comments on commit 353ca75

Please sign in to comment.