mirror of
https://github.com/Tinob/Ishiiruka.git
synced 2024-06-16 03:17:27 -04:00
merge latest master changes
This commit is contained in:
parent
317d9a7b5a
commit
4916a9b8bb
|
@ -320,7 +320,7 @@ if(APPLE)
|
|||
find_library(COREAUDIO_LIBRARY CoreAudio)
|
||||
find_library(COREFUND_LIBRARY CoreFoundation)
|
||||
find_library(CORESERV_LIBRARY CoreServices)
|
||||
find_library(FOUNDATION_LIBRARY foundation)
|
||||
find_library(FOUNDATION_LIBRARY Foundation)
|
||||
find_library(IOB_LIBRARY IOBluetooth)
|
||||
find_library(IOK_LIBRARY IOKit)
|
||||
find_library(QUICKTIME_LIBRARY QuickTime)
|
||||
|
|
|
@ -13,9 +13,6 @@ EmulationIssues =
|
|||
|
||||
[OnFrame]
|
||||
# Add memory patches to be applied every frame here.
|
||||
$Bypass FIFO reset
|
||||
0x8028EE80:dword:0x48000638
|
||||
|
||||
[ActionReplay]
|
||||
# Add action replay cheats here.
|
||||
|
||||
|
|
5
Data/Sys/GameSettings/GWLE6L.ini
Normal file
5
Data/Sys/GameSettings/GWLE6L.ini
Normal file
|
@ -0,0 +1,5 @@
|
|||
# GWLE6L - Project Zoo
|
||||
|
||||
[OnFrame]
|
||||
$Bypass FIFO reset
|
||||
0x8028EF00:dword:0x48000638
|
5
Data/Sys/GameSettings/GWLX6L.ini
Normal file
5
Data/Sys/GameSettings/GWLX6L.ini
Normal file
|
@ -0,0 +1,5 @@
|
|||
# GWLX6L - Project Zoo
|
||||
|
||||
[OnFrame]
|
||||
$Bypass FIFO reset
|
||||
0x8028EE80:dword:0x48000638
|
|
@ -17,3 +17,6 @@ EmulationIssues =
|
|||
[ActionReplay]
|
||||
# Add action replay cheats here.
|
||||
|
||||
[Core]
|
||||
CPUThread = False
|
||||
|
||||
|
|
|
@ -9,6 +9,10 @@ android {
|
|||
// This is important as it will run lint but not abort on error
|
||||
// Lint has some overly obnoxious "errors" that should really be warnings
|
||||
abortOnError false
|
||||
|
||||
//Uncomment disable lines for test builds...
|
||||
//disable 'MissingTranslation'
|
||||
//disable 'ExtraTranslation'
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
|
|
|
@ -394,6 +394,18 @@ public final class EmulationActivity extends AppCompatActivity
|
|||
return;
|
||||
}
|
||||
|
||||
case R.id.menu_emulation_configure_controls:
|
||||
EmulationFragment emulationFragment = (EmulationFragment) getFragmentManager().findFragmentById(R.id.frame_emulation_fragment);
|
||||
if (emulationFragment.isConfiguringControls())
|
||||
{
|
||||
emulationFragment.stopConfiguringControls();
|
||||
}
|
||||
else
|
||||
{
|
||||
emulationFragment.startConfiguringControls();
|
||||
}
|
||||
break;
|
||||
|
||||
case R.id.menu_refresh_wiimotes:
|
||||
NativeLibrary.RefreshWiimotes();
|
||||
return;
|
||||
|
|
|
@ -10,6 +10,7 @@ import android.view.SurfaceHolder;
|
|||
import android.view.SurfaceView;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
|
||||
import org.dolphinemu.dolphinemu.BuildConfig;
|
||||
import org.dolphinemu.dolphinemu.NativeLibrary;
|
||||
|
@ -86,7 +87,6 @@ public final class EmulationFragment extends Fragment implements SurfaceHolder.C
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
if (savedInstanceState == null)
|
||||
{
|
||||
mEmulationThread = new Thread(mEmulationRunner);
|
||||
|
@ -101,6 +101,20 @@ public final class EmulationFragment extends Fragment implements SurfaceHolder.C
|
|||
return contents;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(View view, Bundle savedInstanceState)
|
||||
{
|
||||
Button doneButton = (Button) view.findViewById(R.id.done_control_config);
|
||||
doneButton.setOnClickListener(new View.OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
stopConfiguringControls();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart()
|
||||
{
|
||||
|
@ -224,4 +238,21 @@ public final class EmulationFragment extends Fragment implements SurfaceHolder.C
|
|||
NativeLibrary.Run();
|
||||
}
|
||||
};
|
||||
|
||||
public void startConfiguringControls()
|
||||
{
|
||||
getView().findViewById(R.id.done_control_config).setVisibility(View.VISIBLE);
|
||||
mInputOverlay.setIsInEditMode(true);
|
||||
}
|
||||
|
||||
public void stopConfiguringControls()
|
||||
{
|
||||
getView().findViewById(R.id.done_control_config).setVisibility(View.GONE);
|
||||
mInputOverlay.setIsInEditMode(false);
|
||||
}
|
||||
|
||||
public boolean isConfiguringControls()
|
||||
{
|
||||
return mInputOverlay.isInEditMode();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,6 +39,10 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener
|
|||
private final Set<InputOverlayDrawableButton> overlayButtons = new HashSet<>();
|
||||
private final Set<InputOverlayDrawableJoystick> overlayJoysticks = new HashSet<>();
|
||||
|
||||
private boolean mIsInEditMode = false;
|
||||
private InputOverlayDrawableButton mButtonBeingConfigured;
|
||||
private InputOverlayDrawableJoystick mJoystickBeingConfigured;
|
||||
|
||||
/**
|
||||
* Resizes a {@link Bitmap} by a given scale factor
|
||||
*
|
||||
|
@ -111,25 +115,34 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener
|
|||
@Override
|
||||
public boolean onTouch(View v, MotionEvent event)
|
||||
{
|
||||
if (isInEditMode())
|
||||
{
|
||||
return onTouchWhileEditing(v, event);
|
||||
}
|
||||
|
||||
int pointerIndex = event.getActionIndex();
|
||||
|
||||
for (InputOverlayDrawableButton button : overlayButtons)
|
||||
{
|
||||
// Determine the button state to apply based on the MotionEvent action flag.
|
||||
switch(event.getAction() & MotionEvent.ACTION_MASK)
|
||||
switch (event.getAction() & MotionEvent.ACTION_MASK)
|
||||
{
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
case MotionEvent.ACTION_POINTER_DOWN:
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
// If a pointer enters the bounds of a button, press that button.
|
||||
if (button.getBounds().contains((int)event.getX(pointerIndex), (int)event.getY(pointerIndex)))
|
||||
{
|
||||
NativeLibrary.onGamePadEvent(NativeLibrary.TouchScreenDevice, button.getId(), ButtonState.PRESSED);
|
||||
}
|
||||
break;
|
||||
case MotionEvent.ACTION_UP:
|
||||
case MotionEvent.ACTION_POINTER_UP:
|
||||
// If a pointer ends, release the button it was pressing.
|
||||
if (button.getBounds().contains((int)event.getX(pointerIndex), (int)event.getY(pointerIndex)))
|
||||
NativeLibrary.onGamePadEvent(NativeLibrary.TouchScreenDevice, button.getId(), ButtonState.RELEASED);
|
||||
{
|
||||
NativeLibrary.onGamePadEvent(NativeLibrary.TouchScreenDevice, button.getId(), ButtonState.RELEASED);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -142,12 +155,103 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener
|
|||
float[] axises = joystick.getAxisValues();
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
NativeLibrary.onGamePadMoveEvent(NativeLibrary.TouchScreenDevice, axisIDs[i], axises[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean onTouchWhileEditing(View v, MotionEvent event)
|
||||
{
|
||||
int pointerIndex = event.getActionIndex();
|
||||
int fingerPositionX = (int)event.getX(pointerIndex);
|
||||
int fingerPositionY = (int)event.getY(pointerIndex);
|
||||
|
||||
//Maybe combine Button and Joystick as subclasses of the same parent?
|
||||
//Or maybe create an interface like IMoveableHUDControl?
|
||||
|
||||
for (InputOverlayDrawableButton button : overlayButtons)
|
||||
{
|
||||
// Determine the button state to apply based on the MotionEvent action flag.
|
||||
switch (event.getAction() & MotionEvent.ACTION_MASK)
|
||||
{
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
case MotionEvent.ACTION_POINTER_DOWN:
|
||||
// If no button is being moved now, remember the currently touched button to move.
|
||||
if (mButtonBeingConfigured == null && button.getBounds().contains(fingerPositionX, fingerPositionY))
|
||||
{
|
||||
mButtonBeingConfigured = button;
|
||||
mButtonBeingConfigured.onConfigureTouch(v, event);
|
||||
}
|
||||
break;
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
if (mButtonBeingConfigured != null)
|
||||
{
|
||||
mButtonBeingConfigured.onConfigureTouch(v, event);
|
||||
invalidate();
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
case MotionEvent.ACTION_UP:
|
||||
case MotionEvent.ACTION_POINTER_UP:
|
||||
if (mButtonBeingConfigured == button)
|
||||
{
|
||||
//Persist button position by saving new place.
|
||||
saveControlPosition(mButtonBeingConfigured.getSharedPrefsId(), mButtonBeingConfigured.getBounds().left, mButtonBeingConfigured.getBounds().top);
|
||||
mButtonBeingConfigured = null;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (InputOverlayDrawableJoystick joystick : overlayJoysticks)
|
||||
{
|
||||
switch (event.getAction())
|
||||
{
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
case MotionEvent.ACTION_POINTER_DOWN:
|
||||
if (mJoystickBeingConfigured == null && joystick.getBounds().contains(fingerPositionX, fingerPositionY))
|
||||
{
|
||||
mJoystickBeingConfigured = joystick;
|
||||
mJoystickBeingConfigured.onConfigureTouch(v, event);
|
||||
}
|
||||
break;
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
if (mJoystickBeingConfigured != null)
|
||||
{
|
||||
mJoystickBeingConfigured.onConfigureTouch(v, event);
|
||||
invalidate();
|
||||
}
|
||||
break;
|
||||
case MotionEvent.ACTION_UP:
|
||||
case MotionEvent.ACTION_POINTER_UP:
|
||||
if (mJoystickBeingConfigured != null)
|
||||
{
|
||||
saveControlPosition(mJoystickBeingConfigured.getSharedPrefsId(), mJoystickBeingConfigured.getBounds().left, mJoystickBeingConfigured.getBounds().right);
|
||||
mJoystickBeingConfigured = null;
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void saveControlPosition(String sharedPrefsId, int x, int y)
|
||||
{
|
||||
final SharedPreferences sPrefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
SharedPreferences.Editor sPrefsEditor = sPrefs.edit();
|
||||
sPrefsEditor.putFloat(sharedPrefsId+"-X", x);
|
||||
sPrefsEditor.putFloat(sharedPrefsId+"-Y", y);
|
||||
sPrefsEditor.apply();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes an InputOverlayDrawableButton, given by resId, with all of the
|
||||
* parameters set for it to be properly shown on the InputOverlay.
|
||||
|
@ -212,11 +316,10 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener
|
|||
|
||||
// Initialize the InputOverlayDrawableButton.
|
||||
final Bitmap bitmap = resizeBitmap(context, BitmapFactory.decodeResource(res, resId), scale);
|
||||
final InputOverlayDrawableButton overlayDrawable = new InputOverlayDrawableButton(res, bitmap, buttonId);
|
||||
|
||||
// String ID of the Drawable. This is what is passed into SharedPreferences
|
||||
// to check whether or not a value has been set.
|
||||
// to check whether or not a value has been set. Send to button so it can be referenced.
|
||||
final String drawableId = res.getResourceEntryName(resId);
|
||||
final InputOverlayDrawableButton overlayDrawable = new InputOverlayDrawableButton(res, bitmap, buttonId, drawableId);
|
||||
|
||||
// The X and Y coordinates of the InputOverlayDrawableButton on the InputOverlay.
|
||||
// These were set in the input overlay configuration menu.
|
||||
|
@ -233,6 +336,9 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener
|
|||
// This will dictate where on the screen (and the what the size) the InputOverlayDrawableButton will be.
|
||||
overlayDrawable.setBounds(drawableX, drawableY, drawableX+intrinWidth, drawableY+intrinHeight);
|
||||
|
||||
// Need to set the image's position
|
||||
overlayDrawable.setPosition(drawableX, drawableY);
|
||||
|
||||
return overlayDrawable;
|
||||
}
|
||||
|
||||
|
@ -276,14 +382,27 @@ public final class InputOverlay extends SurfaceView implements OnTouchListener
|
|||
Rect outerRect = new Rect(drawableX, drawableY, drawableX + outerSize, drawableY + outerSize);
|
||||
Rect innerRect = new Rect(0, 0, outerSize / 4, outerSize / 4);
|
||||
|
||||
// Send the drawableId to the joystick so it can be referenced when saving control position.
|
||||
final InputOverlayDrawableJoystick overlayDrawable
|
||||
= new InputOverlayDrawableJoystick(res,
|
||||
bitmapOuter, bitmapInner,
|
||||
outerRect, innerRect,
|
||||
joystick);
|
||||
joystick, drawableId);
|
||||
|
||||
// Need to set the image's position
|
||||
overlayDrawable.setPosition(drawableX, drawableY);
|
||||
|
||||
return overlayDrawable;
|
||||
}
|
||||
|
||||
public void setIsInEditMode(boolean isInEditMode)
|
||||
{
|
||||
mIsInEditMode = isInEditMode;
|
||||
}
|
||||
|
||||
public boolean isInEditMode()
|
||||
{
|
||||
return mIsInEditMode;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,7 +8,10 @@ package org.dolphinemu.dolphinemu.overlay;
|
|||
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
|
||||
/**
|
||||
* Custom {@link BitmapDrawable} that is capable
|
||||
|
@ -17,7 +20,10 @@ import android.graphics.drawable.BitmapDrawable;
|
|||
public final class InputOverlayDrawableButton extends BitmapDrawable
|
||||
{
|
||||
// The ID identifying what type of button this Drawable represents.
|
||||
private int buttonType;
|
||||
private int mButtonType;
|
||||
private int mPreviousTouchX, mPreviousTouchY;
|
||||
private int mControlPositionX, mControlPositionY;
|
||||
private String mSharedPrefsId;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
@ -25,12 +31,13 @@ public final class InputOverlayDrawableButton extends BitmapDrawable
|
|||
* @param res {@link Resources} instance.
|
||||
* @param bitmap {@link Bitmap} to use with this Drawable.
|
||||
* @param buttonType Identifier for this type of button.
|
||||
* @param sharedPrefsId Identifier for getting X and Y control positions from Shared Preferences.
|
||||
*/
|
||||
public InputOverlayDrawableButton(Resources res, Bitmap bitmap, int buttonType)
|
||||
public InputOverlayDrawableButton(Resources res, Bitmap bitmap, int buttonType, String sharedPrefsId)
|
||||
{
|
||||
super(res, bitmap);
|
||||
|
||||
this.buttonType = buttonType;
|
||||
mButtonType = buttonType;
|
||||
mSharedPrefsId = sharedPrefsId;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -40,6 +47,40 @@ public final class InputOverlayDrawableButton extends BitmapDrawable
|
|||
*/
|
||||
public int getId()
|
||||
{
|
||||
return buttonType;
|
||||
return mButtonType;
|
||||
}
|
||||
|
||||
public boolean onConfigureTouch(View v, MotionEvent event)
|
||||
{
|
||||
int pointerIndex = event.getActionIndex();
|
||||
int fingerPositionX = (int)event.getX(pointerIndex);
|
||||
int fingerPositionY = (int)event.getY(pointerIndex);
|
||||
switch (event.getAction())
|
||||
{
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
mPreviousTouchX = fingerPositionX;
|
||||
mPreviousTouchY = fingerPositionY;
|
||||
break;
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
mControlPositionX += fingerPositionX - mPreviousTouchX;
|
||||
mControlPositionY += fingerPositionY - mPreviousTouchY;
|
||||
setBounds(new Rect(mControlPositionX, mControlPositionY, getBitmap().getWidth() + mControlPositionX, getBitmap().getHeight() + mControlPositionY));
|
||||
mPreviousTouchX = fingerPositionX;
|
||||
mPreviousTouchY = fingerPositionY;
|
||||
break;
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public String getSharedPrefsId()
|
||||
{
|
||||
return mSharedPrefsId;
|
||||
}
|
||||
|
||||
public void setPosition(int x, int y)
|
||||
{
|
||||
mControlPositionX = x;
|
||||
mControlPositionY = y;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ import android.graphics.Canvas;
|
|||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
|
||||
/**
|
||||
* Custom {@link BitmapDrawable} that is capable
|
||||
|
@ -23,6 +24,9 @@ public final class InputOverlayDrawableJoystick extends BitmapDrawable
|
|||
private final float[] axises = {0f, 0f};
|
||||
private final BitmapDrawable ringInner;
|
||||
private int trackId = -1;
|
||||
private String mSharedPrefsId;
|
||||
private int mControlPositionX, mControlPositionY;
|
||||
private int mPreviousTouchX, mPreviousTouchY;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
@ -33,11 +37,12 @@ public final class InputOverlayDrawableJoystick extends BitmapDrawable
|
|||
* @param rectOuter {@link Rect} which represents the outer joystick bounds.
|
||||
* @param rectInner {@link Rect} which represents the inner joystick bounds.
|
||||
* @param joystick Identifier for which joystick this is.
|
||||
* @param sharedPrefsId Identifier for getting X and Y control positions from Shared Preferences.
|
||||
*/
|
||||
public InputOverlayDrawableJoystick(Resources res,
|
||||
Bitmap bitmapOuter, Bitmap bitmapInner,
|
||||
Rect rectOuter, Rect rectInner,
|
||||
int joystick)
|
||||
int joystick, String sharedPrefsId)
|
||||
{
|
||||
super(res, bitmapOuter);
|
||||
this.setBounds(rectOuter);
|
||||
|
@ -49,13 +54,13 @@ public final class InputOverlayDrawableJoystick extends BitmapDrawable
|
|||
this.axisIDs[1] = joystick + 2;
|
||||
this.axisIDs[2] = joystick + 3;
|
||||
this.axisIDs[3] = joystick + 4;
|
||||
mSharedPrefsId = sharedPrefsId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Canvas canvas)
|
||||
{
|
||||
super.draw(canvas);
|
||||
|
||||
ringInner.draw(canvas);
|
||||
}
|
||||
|
||||
|
@ -106,6 +111,33 @@ public final class InputOverlayDrawableJoystick extends BitmapDrawable
|
|||
}
|
||||
}
|
||||
|
||||
public boolean onConfigureTouch(View v, MotionEvent event)
|
||||
{
|
||||
int pointerIndex = event.getActionIndex();
|
||||
int fingerPositionX = (int)event.getX(pointerIndex);
|
||||
int fingerPositionY = (int)event.getY(pointerIndex);
|
||||
switch (event.getAction())
|
||||
{
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
mPreviousTouchX = fingerPositionX;
|
||||
mPreviousTouchY = fingerPositionY;
|
||||
break;
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
int deltaX = fingerPositionX - mPreviousTouchX;
|
||||
int deltaY = fingerPositionY - mPreviousTouchY;
|
||||
mControlPositionX += deltaX;
|
||||
mControlPositionY += deltaY;
|
||||
setBounds(new Rect(mControlPositionX, mControlPositionY, getBitmap().getWidth() + mControlPositionX, getBitmap().getHeight() + mControlPositionY));
|
||||
SetInnerBounds();
|
||||
mPreviousTouchX = fingerPositionX;
|
||||
mPreviousTouchY = fingerPositionY;
|
||||
break;
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public float[] getAxisValues()
|
||||
{
|
||||
float[] joyaxises = {0f, 0f, 0f, 0f};
|
||||
|
@ -133,5 +165,17 @@ public final class InputOverlayDrawableJoystick extends BitmapDrawable
|
|||
int height = this.ringInner.getBounds().height() / 2;
|
||||
this.ringInner.setBounds(X - width, Y - height,
|
||||
X + width, Y + height);
|
||||
ringInner.invalidateSelf();
|
||||
}
|
||||
|
||||
public String getSharedPrefsId()
|
||||
{
|
||||
return mSharedPrefsId;
|
||||
}
|
||||
|
||||
public void setPosition(int x, int y)
|
||||
{
|
||||
mControlPositionX = x;
|
||||
mControlPositionY = y;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,4 +20,16 @@
|
|||
android:layout_width="match_parent"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/done_control_config"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:padding="@dimen/spacing_small"
|
||||
android:background="@color/dolphin_blue"
|
||||
android:textColor="@color/lb_tv_white"
|
||||
android:text="@string/emulation_done"
|
||||
android:visibility="gone"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
|
|
@ -31,6 +31,12 @@
|
|||
android:showAsAction="never"
|
||||
android:title="@string/emulation_toggle_input"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_emulation_configure_controls"
|
||||
android:showAsAction="never"
|
||||
android:title="@string/emulation_configure_controls">
|
||||
</item>
|
||||
|
||||
<!-- Save State Slots -->
|
||||
<item
|
||||
android:id="@+id/menu_emulation_save_root"
|
||||
|
|
|
@ -359,6 +359,8 @@
|
|||
<string name="emulation_quicksave">Quick Save</string>
|
||||
<string name="emulation_quickload">Quick Load</string>
|
||||
<string name="emulation_refresh_wiimotes">Refresh Wiimotes</string>
|
||||
<string name="emulation_configure_controls">Configure Controls</string>
|
||||
<string name="emulation_done">Done</string>
|
||||
|
||||
<!-- GC Adapter Menu-->
|
||||
<string name="gc_adapter_rumble">Enable Vibration</string>
|
||||
|
|
|
@ -321,8 +321,7 @@ bool CEXIETHERNET::SendFrame(const u8* frame, u32 size)
|
|||
}
|
||||
|
||||
// Copy to write buffer.
|
||||
mWriteBuffer.resize(size);
|
||||
memcpy(mWriteBuffer.data(), frame, size);
|
||||
mWriteBuffer.assign(frame, frame + size);
|
||||
mWritePending = true;
|
||||
|
||||
// Queue async write.
|
||||
|
|
|
@ -421,18 +421,10 @@ u32 CEXIIPL::GetGCTime()
|
|||
// let's keep time moving forward, regardless of what it starts at
|
||||
ltime += CoreTiming::GetTicks() / SystemTimers::GetTicksPerSecond();
|
||||
}
|
||||
else if (SConfig::GetInstance().bEnableCustomRTC)
|
||||
{
|
||||
_assert_(!Core::g_want_determinism);
|
||||
ltime = SConfig::GetInstance().m_customRTCValue;
|
||||
|
||||
// let's keep time moving forward, regardless of what it starts at
|
||||
ltime += Common::Timer::GetLocalTimeSinceJan1970() - SystemTimers::GetLocalTimeOnBoot();
|
||||
}
|
||||
else
|
||||
{
|
||||
_assert_(!Core::g_want_determinism);
|
||||
ltime = Common::Timer::GetLocalTimeSinceJan1970();
|
||||
ltime = Common::Timer::GetLocalTimeSinceJan1970() - SystemTimers::GetLocalTimeRTCOffset();
|
||||
}
|
||||
|
||||
return ((u32)ltime - cJanuary2000);
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
#include "Core/CoreTiming.h"
|
||||
#include "Core/HW/MMIO.h"
|
||||
#include "Core/HW/ProcessorInterface.h"
|
||||
#include "Core/IPC_HLE/WII_IPC_HLE.h"
|
||||
#include "Core/IPC_HLE/WII_IPC_HLE_Device_stm.h"
|
||||
#include "Core/PowerPC/PowerPC.h"
|
||||
|
||||
namespace ProcessorInterface
|
||||
|
@ -31,6 +33,9 @@ static u32 m_Unknown;
|
|||
static int toggleResetButton;
|
||||
static void ToggleResetButtonCallback(u64 userdata, s64 cyclesLate);
|
||||
|
||||
static int iosNotifyResetButton;
|
||||
static void IOSNotifyResetButtonCallback(u64 userdata, s64 cyclesLate);
|
||||
|
||||
// Let the PPC know that an external exception is set/cleared
|
||||
void UpdateException();
|
||||
|
||||
|
@ -67,6 +72,8 @@ void Init()
|
|||
m_InterruptCause = INT_CAUSE_RST_BUTTON | INT_CAUSE_VI;
|
||||
|
||||
toggleResetButton = CoreTiming::RegisterEvent("ToggleResetButton", ToggleResetButtonCallback);
|
||||
iosNotifyResetButton =
|
||||
CoreTiming::RegisterEvent("IOSNotifyResetButton", IOSNotifyResetButtonCallback);
|
||||
}
|
||||
|
||||
void RegisterMMIO(MMIO::Mapping* mmio, u32 base)
|
||||
|
@ -195,9 +202,21 @@ static void ToggleResetButtonCallback(u64 userdata, s64 cyclesLate)
|
|||
SetResetButton(!!userdata);
|
||||
}
|
||||
|
||||
static void IOSNotifyResetButtonCallback(u64 userdata, s64 cyclesLate)
|
||||
{
|
||||
if (SConfig::GetInstance().bWii)
|
||||
{
|
||||
std::shared_ptr<IWII_IPC_HLE_Device> stm =
|
||||
WII_IPC_HLE_Interface::GetDeviceByName("/dev/stm/eventhook");
|
||||
if (stm)
|
||||
std::static_pointer_cast<CWII_IPC_HLE_Device_stm_eventhook>(stm)->ResetButton();
|
||||
}
|
||||
}
|
||||
|
||||
void ResetButton_Tap()
|
||||
{
|
||||
CoreTiming::ScheduleEvent_AnyThread(0, toggleResetButton, true);
|
||||
CoreTiming::ScheduleEvent_AnyThread(0, iosNotifyResetButton, 0);
|
||||
CoreTiming::ScheduleEvent_AnyThread(243000000, toggleResetButton, false);
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ int CSIDevice_Keyboard::RunBuffer(u8* _pBuffer, int _iLength)
|
|||
return _iLength;
|
||||
}
|
||||
|
||||
KeyboardStatus CSIDevice_Keyboard::GetKeyboardStatus()
|
||||
KeyboardStatus CSIDevice_Keyboard::GetKeyboardStatus() const
|
||||
{
|
||||
KeyboardStatus KeyStatus = {};
|
||||
Keyboard::GetStatus(ISIDevice::m_iDeviceNumber, &KeyStatus);
|
||||
|
@ -102,7 +102,7 @@ void CSIDevice_Keyboard::DoState(PointerWrap& p)
|
|||
p.Do(m_Counter);
|
||||
}
|
||||
|
||||
void CSIDevice_Keyboard::MapKeys(KeyboardStatus& KeyStatus, u8* key)
|
||||
void CSIDevice_Keyboard::MapKeys(const KeyboardStatus& KeyStatus, u8* key)
|
||||
{
|
||||
u8 keys_held = 0;
|
||||
const u8 MAX_KEYS_HELD = 3;
|
||||
|
|
|
@ -55,8 +55,8 @@ public:
|
|||
// Return true on new data
|
||||
bool GetData(u32& _Hi, u32& _Low) override;
|
||||
|
||||
KeyboardStatus GetKeyboardStatus();
|
||||
void MapKeys(KeyboardStatus& KeyStatus, u8* key);
|
||||
KeyboardStatus GetKeyboardStatus() const;
|
||||
void MapKeys(const KeyboardStatus& KeyStatus, u8* key);
|
||||
|
||||
// Send a command directly
|
||||
void SendCommand(u32 _Cmd, u8 _Poll) override;
|
||||
|
|
|
@ -84,7 +84,7 @@ static int s_audio_dma_period;
|
|||
static int s_ipc_hle_period;
|
||||
|
||||
// Custom RTC
|
||||
static u64 s_localtime_on_boot;
|
||||
static s64 s_localtime_rtc_offset = 0;
|
||||
|
||||
u32 GetTicksPerSecond()
|
||||
{
|
||||
|
@ -160,9 +160,9 @@ u64 GetFakeTimeBase()
|
|||
((CoreTiming::GetTicks() - CoreTiming::GetFakeTBStartTicks()) / TIMER_RATIO);
|
||||
}
|
||||
|
||||
u64 GetLocalTimeOnBoot()
|
||||
s64 GetLocalTimeRTCOffset()
|
||||
{
|
||||
return s_localtime_on_boot;
|
||||
return s_localtime_rtc_offset;
|
||||
}
|
||||
|
||||
static void PatchEngineCallback(u64 userdata, s64 cyclesLate)
|
||||
|
@ -228,7 +228,11 @@ void Init()
|
|||
|
||||
Common::Timer::IncreaseResolution();
|
||||
// store and convert localtime at boot to timebase ticks
|
||||
s_localtime_on_boot = Common::Timer::GetLocalTimeSinceJan1970();
|
||||
if (SConfig::GetInstance().bEnableCustomRTC)
|
||||
{
|
||||
s_localtime_rtc_offset =
|
||||
Common::Timer::GetLocalTimeSinceJan1970() - SConfig::GetInstance().m_customRTCValue;
|
||||
}
|
||||
CoreTiming::SetFakeTBStartValue((u64)(s_cpu_core_clock / TIMER_RATIO) *
|
||||
(u64)CEXIIPL::GetGCTime());
|
||||
CoreTiming::SetFakeTBStartTicks(CoreTiming::GetTicks());
|
||||
|
@ -258,7 +262,7 @@ void Init()
|
|||
void Shutdown()
|
||||
{
|
||||
Common::Timer::RestoreResolution();
|
||||
s_localtime_on_boot = 0;
|
||||
s_localtime_rtc_offset = 0;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -45,5 +45,5 @@ u32 GetFakeDecrementer();
|
|||
void TimeBaseSet();
|
||||
u64 GetFakeTimeBase();
|
||||
// Custom RTC
|
||||
u64 GetLocalTimeOnBoot();
|
||||
s64 GetLocalTimeRTCOffset();
|
||||
}
|
||||
|
|
|
@ -71,9 +71,7 @@ void Pause()
|
|||
// An L2CAP packet is passed from the Core to the Wiimote on the HID CONTROL channel.
|
||||
void ControlChannel(int number, u16 channel_id, const void* data, u32 size)
|
||||
{
|
||||
if (WIIMOTE_SRC_REAL & g_wiimote_sources[number])
|
||||
WiimoteReal::ControlChannel(number, channel_id, data, size);
|
||||
else if (WIIMOTE_SRC_HYBRID & g_wiimote_sources[number])
|
||||
if (WIIMOTE_SRC_HYBRID & g_wiimote_sources[number])
|
||||
static_cast<WiimoteEmu::Wiimote*>(s_config.GetController(number))
|
||||
->ControlChannel(channel_id, data, size);
|
||||
}
|
||||
|
|
|
@ -771,6 +771,8 @@ void Wiimote::ControlChannel(const u16 _channelID, const void* _pData, u32 _Size
|
|||
// Wiimote disconnected
|
||||
// reset eeprom/register/reporting mode
|
||||
Reset();
|
||||
if (WIIMOTE_SRC_REAL & g_wiimote_sources[m_index])
|
||||
WiimoteReal::ControlChannel(m_index, _channelID, _pData, _Size);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -121,12 +121,10 @@ void Wiimote::ClearReadQueue()
|
|||
void Wiimote::ControlChannel(const u16 channel, const void* const data, const u32 size)
|
||||
{
|
||||
// Check for custom communication
|
||||
if (99 == channel)
|
||||
if (channel == 99)
|
||||
{
|
||||
if (m_really_disconnect)
|
||||
DisconnectInternal();
|
||||
else
|
||||
EmuStop();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -81,8 +81,8 @@ protected:
|
|||
Report m_last_input_report;
|
||||
u16 m_channel;
|
||||
u8 m_last_connect_request_counter;
|
||||
// If true, the Wiimote will be really disconnected when it is disconnected by Dolphin,
|
||||
// instead of just pausing data reporting.
|
||||
// If true, the Wiimote will be really disconnected when it is disconnected by Dolphin.
|
||||
// In any other case, data reporting is not paused to allow reconnecting on any button press.
|
||||
// This is not enabled on all platforms as connecting a Wiimote can be a pain on some platforms.
|
||||
bool m_really_disconnect = false;
|
||||
|
||||
|
|
|
@ -25,6 +25,12 @@ enum
|
|||
IOCTL_STM_READDDRREG2 = 0x4002,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
STM_EVENT_RESET = 0x00020000,
|
||||
STM_EVENT_POWER = 0x00000800
|
||||
};
|
||||
|
||||
// The /dev/stm/immediate
|
||||
class CWII_IPC_HLE_Device_stm_immediate : public IWII_IPC_HLE_Device
|
||||
{
|
||||
|
@ -141,42 +147,38 @@ public:
|
|||
IPCCommandResult IOCtl(u32 _CommandAddress) override
|
||||
{
|
||||
u32 Parameter = Memory::Read_U32(_CommandAddress + 0x0C);
|
||||
u32 BufferIn = Memory::Read_U32(_CommandAddress + 0x10);
|
||||
u32 BufferInSize = Memory::Read_U32(_CommandAddress + 0x14);
|
||||
u32 BufferOut = Memory::Read_U32(_CommandAddress + 0x18);
|
||||
u32 BufferOutSize = Memory::Read_U32(_CommandAddress + 0x1C);
|
||||
|
||||
// Prepare the out buffer(s) with zeros as a safety precaution
|
||||
// to avoid returning bad values
|
||||
Memory::Memset(BufferOut, 0, BufferOutSize);
|
||||
u32 ReturnValue = 0;
|
||||
|
||||
// write return value
|
||||
switch (Parameter)
|
||||
if (Parameter != IOCTL_STM_EVENTHOOK)
|
||||
{
|
||||
case IOCTL_STM_EVENTHOOK:
|
||||
{
|
||||
m_EventHookAddress = _CommandAddress;
|
||||
|
||||
INFO_LOG(WII_IPC_STM, "%s registers event hook:", GetDeviceName().c_str());
|
||||
DEBUG_LOG(WII_IPC_STM, "%x - IOCTL_STM_EVENTHOOK", Parameter);
|
||||
DEBUG_LOG(WII_IPC_STM, "BufferIn: 0x%08x", BufferIn);
|
||||
DEBUG_LOG(WII_IPC_STM, "BufferInSize: 0x%08x", BufferInSize);
|
||||
DEBUG_LOG(WII_IPC_STM, "BufferOut: 0x%08x", BufferOut);
|
||||
DEBUG_LOG(WII_IPC_STM, "BufferOutSize: 0x%08x", BufferOutSize);
|
||||
|
||||
DumpCommands(BufferIn, BufferInSize / 4, LogTypes::WII_IPC_STM);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
_dbg_assert_msg_(WII_IPC_STM, 0, "unknown %s ioctl %x", GetDeviceName().c_str(), Parameter);
|
||||
break;
|
||||
ERROR_LOG(WII_IPC_STM, "Bad IOCtl in CWII_IPC_HLE_Device_stm_eventhook");
|
||||
Memory::Write_U32(FS_EINVAL, _CommandAddress + 4);
|
||||
return GetDefaultReply();
|
||||
}
|
||||
|
||||
// Write return value to the IPC call, 0 means success
|
||||
Memory::Write_U32(ReturnValue, _CommandAddress + 0x4);
|
||||
return GetDefaultReply();
|
||||
// IOCTL_STM_EVENTHOOK waits until the reset button or power button
|
||||
// is pressed.
|
||||
m_EventHookAddress = _CommandAddress;
|
||||
return GetNoReply();
|
||||
}
|
||||
|
||||
void ResetButton()
|
||||
{
|
||||
if (!m_Active || m_EventHookAddress == 0)
|
||||
{
|
||||
// If the device isn't open, ignore the button press.
|
||||
return;
|
||||
}
|
||||
|
||||
// The reset button returns STM_EVENT_RESET.
|
||||
u32 BufferOut = Memory::Read_U32(m_EventHookAddress + 0x18);
|
||||
Memory::Write_U32(STM_EVENT_RESET, BufferOut);
|
||||
|
||||
// Fill in command buffer.
|
||||
Memory::Write_U32(FS_SUCCESS, m_EventHookAddress + 4);
|
||||
Memory::Write_U32(IPC_REP_ASYNC, m_EventHookAddress);
|
||||
Memory::Write_U32(IPC_CMD_IOCTL, m_EventHookAddress + 8);
|
||||
|
||||
// Generate a reply to the IPC command.
|
||||
WII_IPC_HLE_Interface::EnqueueReply_Immediate(m_EventHookAddress);
|
||||
}
|
||||
|
||||
// STATE_TO_SAVE
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <cctype>
|
||||
#include <iterator>
|
||||
#include <mbedtls/config.h>
|
||||
#include <mbedtls/md.h>
|
||||
#include <mutex>
|
||||
|
@ -1047,63 +1048,65 @@ void LoadInput(const std::string& filename)
|
|||
else if (s_currentByte > 0 && s_totalBytes > 0)
|
||||
{
|
||||
// verify identical from movie start to the save's current frame
|
||||
u32 len = (u32)s_currentByte;
|
||||
u8* movInput = new u8[len];
|
||||
t_record.ReadArray(movInput, (size_t)len);
|
||||
for (u32 i = 0; i < len; ++i)
|
||||
std::vector<u8> movInput(s_currentByte);
|
||||
t_record.ReadArray(movInput.data(), movInput.size());
|
||||
|
||||
const auto result = std::mismatch(movInput.begin(), movInput.end(), tmpInput);
|
||||
|
||||
if (result.first != movInput.end())
|
||||
{
|
||||
if (movInput[i] != tmpInput[i])
|
||||
const ptrdiff_t mismatch_index = std::distance(movInput.begin(), result.first);
|
||||
|
||||
// this is a "you did something wrong" alert for the user's benefit.
|
||||
// we'll try to say what's going on in excruciating detail, otherwise the user might not
|
||||
// believe us.
|
||||
if (IsUsingWiimote(0))
|
||||
{
|
||||
// this is a "you did something wrong" alert for the user's benefit.
|
||||
// we'll try to say what's going on in excruciating detail, otherwise the user might not
|
||||
// believe us.
|
||||
if (IsUsingWiimote(0))
|
||||
{
|
||||
// TODO: more detail
|
||||
PanicAlertT("Warning: You loaded a save whose movie mismatches on byte %d (0x%X). You "
|
||||
"should load another save before continuing, or load this state with "
|
||||
"read-only mode off. Otherwise you'll probably get a desync.",
|
||||
i + 256, i + 256);
|
||||
memcpy(tmpInput, movInput, s_currentByte);
|
||||
}
|
||||
else
|
||||
{
|
||||
int frame = i / 8;
|
||||
ControllerState curPadState;
|
||||
memcpy(&curPadState, &(tmpInput[frame * 8]), 8);
|
||||
ControllerState movPadState;
|
||||
memcpy(&movPadState, &(movInput[frame * 8]), 8);
|
||||
PanicAlertT(
|
||||
"Warning: You loaded a save whose movie mismatches on frame %d. You should load "
|
||||
"another save before continuing, or load this state with read-only mode off. "
|
||||
"Otherwise you'll probably get a desync.\n\n"
|
||||
"More information: The current movie is %d frames long and the savestate's movie "
|
||||
"is %d frames long.\n\n"
|
||||
"On frame %d, the current movie presses:\n"
|
||||
"Start=%d, A=%d, B=%d, X=%d, Y=%d, Z=%d, DUp=%d, DDown=%d, DLeft=%d, DRight=%d, "
|
||||
"L=%d, R=%d, LT=%d, RT=%d, AnalogX=%d, AnalogY=%d, CX=%d, CY=%d"
|
||||
"\n\n"
|
||||
"On frame %d, the savestate's movie presses:\n"
|
||||
"Start=%d, A=%d, B=%d, X=%d, Y=%d, Z=%d, DUp=%d, DDown=%d, DLeft=%d, DRight=%d, "
|
||||
"L=%d, R=%d, LT=%d, RT=%d, AnalogX=%d, AnalogY=%d, CX=%d, CY=%d",
|
||||
(int)frame, (int)g_totalFrames, (int)tmpHeader.frameCount, (int)frame,
|
||||
(int)curPadState.Start, (int)curPadState.A, (int)curPadState.B, (int)curPadState.X,
|
||||
(int)curPadState.Y, (int)curPadState.Z, (int)curPadState.DPadUp,
|
||||
(int)curPadState.DPadDown, (int)curPadState.DPadLeft, (int)curPadState.DPadRight,
|
||||
(int)curPadState.L, (int)curPadState.R, (int)curPadState.TriggerL,
|
||||
(int)curPadState.TriggerR, (int)curPadState.AnalogStickX,
|
||||
(int)curPadState.AnalogStickY, (int)curPadState.CStickX, (int)curPadState.CStickY,
|
||||
(int)frame, (int)movPadState.Start, (int)movPadState.A, (int)movPadState.B,
|
||||
(int)movPadState.X, (int)movPadState.Y, (int)movPadState.Z, (int)movPadState.DPadUp,
|
||||
(int)movPadState.DPadDown, (int)movPadState.DPadLeft, (int)movPadState.DPadRight,
|
||||
(int)movPadState.L, (int)movPadState.R, (int)movPadState.TriggerL,
|
||||
(int)movPadState.TriggerR, (int)movPadState.AnalogStickX,
|
||||
(int)movPadState.AnalogStickY, (int)movPadState.CStickX, (int)movPadState.CStickY);
|
||||
}
|
||||
break;
|
||||
const size_t byte_offset = static_cast<size_t>(mismatch_index) + sizeof(DTMHeader);
|
||||
|
||||
// TODO: more detail
|
||||
PanicAlertT("Warning: You loaded a save whose movie mismatches on byte %zu (0x%zX). "
|
||||
"You should load another save before continuing, or load this state with "
|
||||
"read-only mode off. Otherwise you'll probably get a desync.",
|
||||
byte_offset, byte_offset);
|
||||
|
||||
std::copy(movInput.begin(), movInput.end(), tmpInput);
|
||||
}
|
||||
else
|
||||
{
|
||||
const ptrdiff_t frame = mismatch_index / 8;
|
||||
ControllerState curPadState;
|
||||
memcpy(&curPadState, &tmpInput[frame * 8], 8);
|
||||
ControllerState movPadState;
|
||||
memcpy(&movPadState, &movInput[frame * 8], 8);
|
||||
PanicAlertT(
|
||||
"Warning: You loaded a save whose movie mismatches on frame %td. You should load "
|
||||
"another save before continuing, or load this state with read-only mode off. "
|
||||
"Otherwise you'll probably get a desync.\n\n"
|
||||
"More information: The current movie is %d frames long and the savestate's movie "
|
||||
"is %d frames long.\n\n"
|
||||
"On frame %td, the current movie presses:\n"
|
||||
"Start=%d, A=%d, B=%d, X=%d, Y=%d, Z=%d, DUp=%d, DDown=%d, DLeft=%d, DRight=%d, "
|
||||
"L=%d, R=%d, LT=%d, RT=%d, AnalogX=%d, AnalogY=%d, CX=%d, CY=%d"
|
||||
"\n\n"
|
||||
"On frame %td, the savestate's movie presses:\n"
|
||||
"Start=%d, A=%d, B=%d, X=%d, Y=%d, Z=%d, DUp=%d, DDown=%d, DLeft=%d, DRight=%d, "
|
||||
"L=%d, R=%d, LT=%d, RT=%d, AnalogX=%d, AnalogY=%d, CX=%d, CY=%d",
|
||||
frame, (int)g_totalFrames, (int)tmpHeader.frameCount, frame, (int)curPadState.Start,
|
||||
(int)curPadState.A, (int)curPadState.B, (int)curPadState.X, (int)curPadState.Y,
|
||||
(int)curPadState.Z, (int)curPadState.DPadUp, (int)curPadState.DPadDown,
|
||||
(int)curPadState.DPadLeft, (int)curPadState.DPadRight, (int)curPadState.L,
|
||||
(int)curPadState.R, (int)curPadState.TriggerL, (int)curPadState.TriggerR,
|
||||
(int)curPadState.AnalogStickX, (int)curPadState.AnalogStickY,
|
||||
(int)curPadState.CStickX, (int)curPadState.CStickY, frame, (int)movPadState.Start,
|
||||
(int)movPadState.A, (int)movPadState.B, (int)movPadState.X, (int)movPadState.Y,
|
||||
(int)movPadState.Z, (int)movPadState.DPadUp, (int)movPadState.DPadDown,
|
||||
(int)movPadState.DPadLeft, (int)movPadState.DPadRight, (int)movPadState.L,
|
||||
(int)movPadState.R, (int)movPadState.TriggerL, (int)movPadState.TriggerR,
|
||||
(int)movPadState.AnalogStickX, (int)movPadState.AnalogStickY,
|
||||
(int)movPadState.CStickX, (int)movPadState.CStickY);
|
||||
}
|
||||
}
|
||||
delete[] movInput;
|
||||
}
|
||||
}
|
||||
t_record.Close();
|
||||
|
|
|
@ -820,18 +820,6 @@ bool NetPlayClient::StartGame(const std::string& path)
|
|||
for (unsigned int i = 0; i < 4; ++i)
|
||||
WiimoteReal::ChangeWiimoteSource(i,
|
||||
m_wiimote_map[i] > 0 ? WIIMOTE_SRC_EMU : WIIMOTE_SRC_NONE);
|
||||
|
||||
// Needed to prevent locking up at boot if (when) the wiimotes connect out of order.
|
||||
NetWiimote nw;
|
||||
nw.resize(4, 0);
|
||||
|
||||
for (unsigned int w = 0; w < 4; ++w)
|
||||
{
|
||||
if (m_wiimote_map[w] != -1)
|
||||
// probably overkill, but whatever
|
||||
for (unsigned int i = 0; i < 7; ++i)
|
||||
m_wiimote_buffer[w].Push(nw);
|
||||
}
|
||||
}
|
||||
|
||||
UpdateDevices();
|
||||
|
|
|
@ -937,6 +937,7 @@ std::vector<std::pair<std::string, std::string>> NetPlayServer::GetInterfaceList
|
|||
|
||||
struct UPNPUrls NetPlayServer::m_upnp_urls;
|
||||
struct IGDdatas NetPlayServer::m_upnp_data;
|
||||
std::string NetPlayServer::m_upnp_ourip;
|
||||
u16 NetPlayServer::m_upnp_mapped = 0;
|
||||
bool NetPlayServer::m_upnp_inited = false;
|
||||
bool NetPlayServer::m_upnp_error = false;
|
||||
|
@ -953,23 +954,17 @@ void NetPlayServer::TryPortmapping(u16 port)
|
|||
// UPnP thread: try to map a port
|
||||
void NetPlayServer::mapPortThread(const u16 port)
|
||||
{
|
||||
ENetAddress adr = { ENET_HOST_ANY, port };
|
||||
char cIP[20];
|
||||
|
||||
enet_address_get_host(&adr, cIP, 20);
|
||||
std::string ourIP(cIP);
|
||||
|
||||
if (!m_upnp_inited)
|
||||
if (!initUPnP())
|
||||
goto fail;
|
||||
|
||||
if (!UPnPMapPort(ourIP, port))
|
||||
if (!UPnPMapPort(m_upnp_ourip, port))
|
||||
goto fail;
|
||||
|
||||
NOTICE_LOG(NETPLAY, "Successfully mapped port %d to %s.", port, ourIP.c_str());
|
||||
NOTICE_LOG(NETPLAY, "Successfully mapped port %d to %s.", port, m_upnp_ourip.c_str());
|
||||
return;
|
||||
fail:
|
||||
WARN_LOG(NETPLAY, "Failed to map port %d to %s.", port, ourIP.c_str());
|
||||
WARN_LOG(NETPLAY, "Failed to map port %d to %s.", port, m_upnp_ourip.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -986,6 +981,7 @@ bool NetPlayServer::initUPnP()
|
|||
{
|
||||
std::vector<UPNPDev*> igds;
|
||||
int descXMLsize = 0, upnperror = 0;
|
||||
char cIP[20];
|
||||
|
||||
// Don't init if already inited
|
||||
if (m_upnp_inited)
|
||||
|
@ -1027,15 +1023,19 @@ bool NetPlayServer::initUPnP()
|
|||
std::unique_ptr<char, decltype(&std::free)> descXML(nullptr, std::free);
|
||||
int statusCode = 200;
|
||||
#if MINIUPNPC_API_VERSION >= 16
|
||||
descXML.reset(static_cast<char*>(miniwget(dev->descURL, &descXMLsize, 0, &statusCode)));
|
||||
descXML.reset(static_cast<char*>(
|
||||
miniwget_getaddr(dev->descURL, &descXMLsize, cIP, sizeof(cIP), 0, &statusCode)));
|
||||
#else
|
||||
descXML.reset(static_cast<char*>(miniwget(dev->descURL, &descXMLsize, 0)));
|
||||
descXML.reset(
|
||||
static_cast<char*>(miniwget_getaddr(dev->descURL, &descXMLsize, cIP, sizeof(cIP), 0)));
|
||||
#endif
|
||||
if (descXML && statusCode == 200)
|
||||
{
|
||||
parserootdesc(descXML.get(), descXMLsize, &m_upnp_data);
|
||||
GetUPNPUrls(&m_upnp_urls, &m_upnp_data, dev->descURL, 0);
|
||||
|
||||
m_upnp_ourip = cIP;
|
||||
|
||||
NOTICE_LOG(NETPLAY, "Got info from IGD at %s.", dev->descURL);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -134,6 +134,7 @@ private:
|
|||
|
||||
static struct UPNPUrls m_upnp_urls;
|
||||
static struct IGDdatas m_upnp_data;
|
||||
static std::string m_upnp_ourip;
|
||||
static u16 m_upnp_mapped;
|
||||
static bool m_upnp_inited;
|
||||
static bool m_upnp_error;
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include <wx/timectrl.h>
|
||||
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/Core.h"
|
||||
#include "DolphinWX/Config/AdvancedConfigPane.h"
|
||||
|
||||
AdvancedConfigPane::AdvancedConfigPane(wxWindow* parent, wxWindowID id) : wxPanel(parent, id)
|
||||
|
@ -186,8 +187,17 @@ void AdvancedConfigPane::LoadCustomRTC()
|
|||
else
|
||||
m_custom_rtc_date_picker->SetRange(wxDateTime(1, wxDateTime::Jan, 2000),
|
||||
wxDateTime(31, wxDateTime::Dec, 2099));
|
||||
m_custom_rtc_date_picker->Enable(custom_rtc_enabled);
|
||||
m_custom_rtc_time_picker->Enable(custom_rtc_enabled);
|
||||
if (Core::IsRunning())
|
||||
{
|
||||
m_custom_rtc_checkbox->Enable(false);
|
||||
m_custom_rtc_date_picker->Enable(false);
|
||||
m_custom_rtc_time_picker->Enable(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_custom_rtc_date_picker->Enable(custom_rtc_enabled);
|
||||
m_custom_rtc_time_picker->Enable(custom_rtc_enabled);
|
||||
}
|
||||
}
|
||||
|
||||
void AdvancedConfigPane::UpdateCustomRTC(time_t date, time_t time)
|
||||
|
|
|
@ -20,30 +20,30 @@
|
|||
#include <wx/utils.h>
|
||||
#include <wx/window.h>
|
||||
|
||||
#include "Common/CPUDetect.h"
|
||||
#include "Common/CommonPaths.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/CPUDetect.h"
|
||||
#include "Common/FileUtil.h"
|
||||
#include "Common/IniFile.h"
|
||||
#include "Common/Thread.h"
|
||||
#include "Common/Logging/LogManager.h"
|
||||
#include "Common/Thread.h"
|
||||
|
||||
#include "Core/Analytics.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/HW/Wiimote.h"
|
||||
#include "Core/Host.h"
|
||||
#include "Core/Movie.h"
|
||||
#include "Core/HW/Wiimote.h"
|
||||
|
||||
#include "DolphinWX/Debugger/CodeWindow.h"
|
||||
#include "DolphinWX/Debugger/JitWindow.h"
|
||||
#include "DolphinWX/Frame.h"
|
||||
#include "DolphinWX/Globals.h"
|
||||
#include "DolphinWX/Main.h"
|
||||
#include "DolphinWX/NetPlay/NetWindow.h"
|
||||
#include "DolphinWX/SoftwareVideoConfigDialog.h"
|
||||
#include "DolphinWX/VideoConfigDiag.h"
|
||||
#include "DolphinWX/WxUtils.h"
|
||||
#include "DolphinWX/Debugger/CodeWindow.h"
|
||||
#include "DolphinWX/Debugger/JitWindow.h"
|
||||
#include "DolphinWX/NetPlay/NetWindow.h"
|
||||
|
||||
#include "UICommon/UICommon.h"
|
||||
|
||||
|
@ -94,316 +94,284 @@ class wxFrame;
|
|||
IMPLEMENT_APP(DolphinApp)
|
||||
|
||||
bool wxMsgAlert(const char*, const char*, bool, int);
|
||||
std::string wxStringTranslator(const char *);
|
||||
std::string wxStringTranslator(const char*);
|
||||
|
||||
CFrame* main_frame = nullptr;
|
||||
|
||||
bool DolphinApp::Initialize(int& c, wxChar **v)
|
||||
bool DolphinApp::Initialize(int& c, wxChar** v)
|
||||
{
|
||||
#if defined HAVE_X11 && HAVE_X11
|
||||
XInitThreads();
|
||||
XInitThreads();
|
||||
#endif
|
||||
return wxApp::Initialize(c, v);
|
||||
return wxApp::Initialize(c, v);
|
||||
}
|
||||
|
||||
// The 'main program' equivalent that creates the main window and return the main frame
|
||||
|
||||
bool DolphinApp::OnInit()
|
||||
{
|
||||
if (!wxApp::OnInit())
|
||||
return false;
|
||||
if (!wxApp::OnInit())
|
||||
return false;
|
||||
wxLog::SetLogLevel(0);
|
||||
Bind(wxEVT_QUERY_END_SESSION, &DolphinApp::OnEndSession, this);
|
||||
Bind(wxEVT_END_SESSION, &DolphinApp::OnEndSession, this);
|
||||
Bind(wxEVT_IDLE, &DolphinApp::OnIdle, this);
|
||||
Bind(wxEVT_QUERY_END_SESSION, &DolphinApp::OnEndSession, this);
|
||||
Bind(wxEVT_END_SESSION, &DolphinApp::OnEndSession, this);
|
||||
Bind(wxEVT_IDLE, &DolphinApp::OnIdle, this);
|
||||
|
||||
// Register message box and translation handlers
|
||||
RegisterMsgAlertHandler(&wxMsgAlert);
|
||||
RegisterStringTranslator(&wxStringTranslator);
|
||||
// Register message box and translation handlers
|
||||
RegisterMsgAlertHandler(&wxMsgAlert);
|
||||
RegisterStringTranslator(&wxStringTranslator);
|
||||
|
||||
#if wxUSE_ON_FATAL_EXCEPTION
|
||||
wxHandleFatalExceptions(true);
|
||||
wxHandleFatalExceptions(true);
|
||||
#endif
|
||||
|
||||
UICommon::SetUserDirectory(m_user_path.ToStdString());
|
||||
UICommon::CreateDirectories();
|
||||
InitLanguageSupport(); // The language setting is loaded from the user directory
|
||||
UICommon::Init();
|
||||
UICommon::SetUserDirectory(m_user_path.ToStdString());
|
||||
UICommon::CreateDirectories();
|
||||
InitLanguageSupport(); // The language setting is loaded from the user directory
|
||||
UICommon::Init();
|
||||
|
||||
if (m_select_video_backend && !m_video_backend_name.empty())
|
||||
SConfig::GetInstance().m_strVideoBackend = WxStrToStr(m_video_backend_name);
|
||||
if (m_select_video_backend && !m_video_backend_name.empty())
|
||||
SConfig::GetInstance().m_strVideoBackend = WxStrToStr(m_video_backend_name);
|
||||
|
||||
if (m_select_audio_emulation)
|
||||
SConfig::GetInstance().bDSPHLE = (m_audio_emulation_name.Upper() == "HLE");
|
||||
if (m_select_audio_emulation)
|
||||
SConfig::GetInstance().bDSPHLE = (m_audio_emulation_name.Upper() == "HLE");
|
||||
|
||||
VideoBackendBase::ActivateBackend(SConfig::GetInstance().m_strVideoBackend);
|
||||
VideoBackendBase::ActivateBackend(SConfig::GetInstance().m_strVideoBackend);
|
||||
|
||||
DolphinAnalytics::Instance()->ReportDolphinStart("wx");
|
||||
DolphinAnalytics::Instance()->ReportDolphinStart("wx");
|
||||
|
||||
// Enable the PNG image handler for screenshots
|
||||
wxImage::AddHandler(new wxPNGHandler);
|
||||
// Enable the PNG image handler for screenshots
|
||||
wxImage::AddHandler(new wxPNGHandler);
|
||||
|
||||
int x = SConfig::GetInstance().iPosX;
|
||||
int y = SConfig::GetInstance().iPosY;
|
||||
int w = SConfig::GetInstance().iWidth;
|
||||
int h = SConfig::GetInstance().iHeight;
|
||||
int x = SConfig::GetInstance().iPosX;
|
||||
int y = SConfig::GetInstance().iPosY;
|
||||
int w = SConfig::GetInstance().iWidth;
|
||||
int h = SConfig::GetInstance().iHeight;
|
||||
|
||||
// The following is not needed with X11, where window managers
|
||||
// do not allow windows to be created off the desktop.
|
||||
// The following is not needed with X11, where window managers
|
||||
// do not allow windows to be created off the desktop.
|
||||
#ifdef _WIN32
|
||||
// Out of desktop check
|
||||
int leftPos = GetSystemMetrics(SM_XVIRTUALSCREEN);
|
||||
int topPos = GetSystemMetrics(SM_YVIRTUALSCREEN);
|
||||
int width = GetSystemMetrics(SM_CXVIRTUALSCREEN);
|
||||
int height = GetSystemMetrics(SM_CYVIRTUALSCREEN);
|
||||
if ((leftPos + width) < (x + w) || leftPos > x || (topPos + height) < (y + h) || topPos > y)
|
||||
x = y = wxDefaultCoord;
|
||||
// Out of desktop check
|
||||
int leftPos = GetSystemMetrics(SM_XVIRTUALSCREEN);
|
||||
int topPos = GetSystemMetrics(SM_YVIRTUALSCREEN);
|
||||
int width = GetSystemMetrics(SM_CXVIRTUALSCREEN);
|
||||
int height = GetSystemMetrics(SM_CYVIRTUALSCREEN);
|
||||
if ((leftPos + width) < (x + w) || leftPos > x || (topPos + height) < (y + h) || topPos > y)
|
||||
x = y = wxDefaultCoord;
|
||||
#elif defined __APPLE__
|
||||
if (y < 1)
|
||||
y = wxDefaultCoord;
|
||||
if (y < 1)
|
||||
y = wxDefaultCoord;
|
||||
#endif
|
||||
|
||||
main_frame = new CFrame(nullptr, wxID_ANY,
|
||||
StrToWxStr(scm_rev_str),
|
||||
wxPoint(x, y), wxSize(w, h),
|
||||
m_use_debugger, m_batch_mode, m_use_logger);
|
||||
main_frame = new CFrame(nullptr, wxID_ANY, StrToWxStr(scm_rev_str), wxPoint(x, y), wxSize(w, h),
|
||||
m_use_debugger, m_batch_mode, m_use_logger);
|
||||
|
||||
SetTopWindow(main_frame);
|
||||
main_frame->SetMinSize(wxSize(400, 300));
|
||||
SetTopWindow(main_frame);
|
||||
main_frame->SetMinSize(wxSize(400, 300));
|
||||
|
||||
AfterInit();
|
||||
AfterInit();
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
void DolphinApp::OnInitCmdLine(wxCmdLineParser& parser)
|
||||
{
|
||||
static const wxCmdLineEntryDesc desc[] =
|
||||
{
|
||||
{
|
||||
wxCMD_LINE_SWITCH, "h", "help",
|
||||
"Show this help message",
|
||||
wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP
|
||||
},
|
||||
{
|
||||
wxCMD_LINE_SWITCH, "d", "debugger",
|
||||
"Opens the debugger",
|
||||
wxCMD_LINE_VAL_NONE, wxCMD_LINE_PARAM_OPTIONAL
|
||||
},
|
||||
{
|
||||
wxCMD_LINE_SWITCH, "l", "logger",
|
||||
"Opens the logger",
|
||||
wxCMD_LINE_VAL_NONE, wxCMD_LINE_PARAM_OPTIONAL
|
||||
},
|
||||
{
|
||||
wxCMD_LINE_OPTION, "e", "exec",
|
||||
"Loads the specified file (ELF, DOL, GCM, ISO, WBFS, CISO, GCZ, WAD)",
|
||||
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
|
||||
},
|
||||
{
|
||||
wxCMD_LINE_SWITCH, "b", "batch",
|
||||
"Exit Dolphin with emulator",
|
||||
wxCMD_LINE_VAL_NONE, wxCMD_LINE_PARAM_OPTIONAL
|
||||
},
|
||||
{
|
||||
wxCMD_LINE_OPTION, "c", "confirm",
|
||||
"Set Confirm on Stop",
|
||||
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
|
||||
},
|
||||
{
|
||||
wxCMD_LINE_OPTION, "v", "video_backend",
|
||||
"Specify a video backend",
|
||||
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
|
||||
},
|
||||
{
|
||||
wxCMD_LINE_OPTION, "a", "audio_emulation",
|
||||
"Low level (LLE) or high level (HLE) audio",
|
||||
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
|
||||
},
|
||||
{
|
||||
wxCMD_LINE_OPTION, "m", "movie",
|
||||
"Play a movie file",
|
||||
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
|
||||
},
|
||||
{
|
||||
wxCMD_LINE_OPTION, "u", "user",
|
||||
"User folder path",
|
||||
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL
|
||||
},
|
||||
{
|
||||
wxCMD_LINE_NONE, nullptr, nullptr, nullptr, wxCMD_LINE_VAL_NONE, 0
|
||||
}
|
||||
};
|
||||
static const wxCmdLineEntryDesc desc[] = {
|
||||
{wxCMD_LINE_SWITCH, "h", "help", "Show this help message", wxCMD_LINE_VAL_NONE,
|
||||
wxCMD_LINE_OPTION_HELP},
|
||||
{wxCMD_LINE_SWITCH, "d", "debugger", "Opens the debugger", wxCMD_LINE_VAL_NONE,
|
||||
wxCMD_LINE_PARAM_OPTIONAL},
|
||||
{wxCMD_LINE_SWITCH, "l", "logger", "Opens the logger", wxCMD_LINE_VAL_NONE,
|
||||
wxCMD_LINE_PARAM_OPTIONAL},
|
||||
{wxCMD_LINE_OPTION, "e", "exec",
|
||||
"Loads the specified file (ELF, DOL, GCM, ISO, WBFS, CISO, GCZ, WAD)", wxCMD_LINE_VAL_STRING,
|
||||
wxCMD_LINE_PARAM_OPTIONAL},
|
||||
{wxCMD_LINE_SWITCH, "b", "batch", "Exit Dolphin with emulator", wxCMD_LINE_VAL_NONE,
|
||||
wxCMD_LINE_PARAM_OPTIONAL},
|
||||
{wxCMD_LINE_OPTION, "c", "confirm", "Set Confirm on Stop", wxCMD_LINE_VAL_STRING,
|
||||
wxCMD_LINE_PARAM_OPTIONAL},
|
||||
{wxCMD_LINE_OPTION, "v", "video_backend", "Specify a video backend", wxCMD_LINE_VAL_STRING,
|
||||
wxCMD_LINE_PARAM_OPTIONAL},
|
||||
{wxCMD_LINE_OPTION, "a", "audio_emulation", "Low level (LLE) or high level (HLE) audio",
|
||||
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL},
|
||||
{wxCMD_LINE_OPTION, "m", "movie", "Play a movie file", wxCMD_LINE_VAL_STRING,
|
||||
wxCMD_LINE_PARAM_OPTIONAL},
|
||||
{wxCMD_LINE_OPTION, "u", "user", "User folder path", wxCMD_LINE_VAL_STRING,
|
||||
wxCMD_LINE_PARAM_OPTIONAL},
|
||||
{wxCMD_LINE_NONE, nullptr, nullptr, nullptr, wxCMD_LINE_VAL_NONE, 0}};
|
||||
|
||||
parser.SetDesc(desc);
|
||||
parser.SetDesc(desc);
|
||||
}
|
||||
|
||||
bool DolphinApp::OnCmdLineParsed(wxCmdLineParser& parser)
|
||||
{
|
||||
if (argc == 2 && File::Exists(argv[1].ToUTF8().data()))
|
||||
{
|
||||
m_load_file = true;
|
||||
m_file_to_load = argv[1];
|
||||
}
|
||||
else if (parser.Parse() != 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (argc == 2 && File::Exists(argv[1].ToUTF8().data()))
|
||||
{
|
||||
m_load_file = true;
|
||||
m_file_to_load = argv[1];
|
||||
}
|
||||
else if (parser.Parse() != 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_load_file)
|
||||
m_load_file = parser.Found("exec", &m_file_to_load);
|
||||
if (!m_load_file)
|
||||
m_load_file = parser.Found("exec", &m_file_to_load);
|
||||
|
||||
m_use_debugger = parser.Found("debugger");
|
||||
m_use_logger = parser.Found("logger");
|
||||
m_batch_mode = parser.Found("batch");
|
||||
m_confirm_stop = parser.Found("confirm", &m_confirm_setting);
|
||||
m_select_video_backend = parser.Found("video_backend", &m_video_backend_name);
|
||||
m_select_audio_emulation = parser.Found("audio_emulation", &m_audio_emulation_name);
|
||||
m_play_movie = parser.Found("movie", &m_movie_file);
|
||||
parser.Found("user", &m_user_path);
|
||||
m_use_debugger = parser.Found("debugger");
|
||||
m_use_logger = parser.Found("logger");
|
||||
m_batch_mode = parser.Found("batch");
|
||||
m_confirm_stop = parser.Found("confirm", &m_confirm_setting);
|
||||
m_select_video_backend = parser.Found("video_backend", &m_video_backend_name);
|
||||
m_select_audio_emulation = parser.Found("audio_emulation", &m_audio_emulation_name);
|
||||
m_play_movie = parser.Found("movie", &m_movie_file);
|
||||
parser.Found("user", &m_user_path);
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
void DolphinApp::MacOpenFile(const wxString& fileName)
|
||||
{
|
||||
m_file_to_load = fileName;
|
||||
m_load_file = true;
|
||||
main_frame->BootGame(WxStrToStr(m_file_to_load));
|
||||
m_file_to_load = fileName;
|
||||
m_load_file = true;
|
||||
main_frame->BootGame(WxStrToStr(m_file_to_load));
|
||||
}
|
||||
#endif
|
||||
|
||||
void DolphinApp::AfterInit()
|
||||
{
|
||||
if (!m_batch_mode)
|
||||
main_frame->UpdateGameList();
|
||||
if (!m_batch_mode)
|
||||
main_frame->UpdateGameList();
|
||||
|
||||
if (!SConfig::GetInstance().m_analytics_permission_asked)
|
||||
{
|
||||
int answer = wxMessageBox(
|
||||
_("If authorized, Dolphin can collect data on its performance, "
|
||||
"feature usage, and configuration, as well as data on your system's "
|
||||
"hardware and operating system.\n\n"
|
||||
"No private data is ever collected. This data helps us understand "
|
||||
"how people and emulated games use Dolphin and prioritize our "
|
||||
"efforts. It also helps us identify rare configurations that are "
|
||||
"causing bugs, performance and stability issues.\n"
|
||||
"This authorization can be revoked at any time through Dolphin's "
|
||||
"settings.\n\n"
|
||||
"Do you authorize Dolphin to report this information to Dolphin's "
|
||||
"developers?"),
|
||||
_("Usage statistics reporting"),
|
||||
wxYES_NO, main_frame);
|
||||
if (!SConfig::GetInstance().m_analytics_permission_asked)
|
||||
{
|
||||
int answer =
|
||||
wxMessageBox(_("If authorized, Dolphin can collect data on its performance, "
|
||||
"feature usage, and configuration, as well as data on your system's "
|
||||
"hardware and operating system.\n\n"
|
||||
"No private data is ever collected. This data helps us understand "
|
||||
"how people and emulated games use Dolphin and prioritize our "
|
||||
"efforts. It also helps us identify rare configurations that are "
|
||||
"causing bugs, performance and stability issues.\n"
|
||||
"This authorization can be revoked at any time through Dolphin's "
|
||||
"settings.\n\n"
|
||||
"Do you authorize Dolphin to report this information to Dolphin's "
|
||||
"developers?"),
|
||||
_("Usage statistics reporting"), wxYES_NO, main_frame);
|
||||
|
||||
SConfig::GetInstance().m_analytics_permission_asked = true;
|
||||
SConfig::GetInstance().m_analytics_enabled = (answer == wxYES);
|
||||
SConfig::GetInstance().SaveSettings();
|
||||
SConfig::GetInstance().m_analytics_permission_asked = true;
|
||||
SConfig::GetInstance().m_analytics_enabled = (answer == wxYES);
|
||||
SConfig::GetInstance().SaveSettings();
|
||||
|
||||
DolphinAnalytics::Instance()->ReloadConfig();
|
||||
}
|
||||
DolphinAnalytics::Instance()->ReloadConfig();
|
||||
}
|
||||
|
||||
if (m_confirm_stop)
|
||||
{
|
||||
if (m_confirm_setting.Upper() == "TRUE")
|
||||
SConfig::GetInstance().bConfirmStop = true;
|
||||
else if (m_confirm_setting.Upper() == "FALSE")
|
||||
SConfig::GetInstance().bConfirmStop = false;
|
||||
}
|
||||
if (m_confirm_stop)
|
||||
{
|
||||
if (m_confirm_setting.Upper() == "TRUE")
|
||||
SConfig::GetInstance().bConfirmStop = true;
|
||||
else if (m_confirm_setting.Upper() == "FALSE")
|
||||
SConfig::GetInstance().bConfirmStop = false;
|
||||
}
|
||||
|
||||
if (m_play_movie && !m_movie_file.empty())
|
||||
{
|
||||
if (Movie::PlayInput(WxStrToStr(m_movie_file)))
|
||||
{
|
||||
if (m_load_file && !m_file_to_load.empty())
|
||||
{
|
||||
main_frame->BootGame(WxStrToStr(m_file_to_load));
|
||||
}
|
||||
else
|
||||
{
|
||||
main_frame->BootGame("");
|
||||
}
|
||||
}
|
||||
}
|
||||
// First check if we have an exec command line.
|
||||
else if (m_load_file && !m_file_to_load.empty())
|
||||
{
|
||||
main_frame->BootGame(WxStrToStr(m_file_to_load));
|
||||
}
|
||||
// If we have selected Automatic Start, start the default ISO,
|
||||
// or if no default ISO exists, start the last loaded ISO
|
||||
else if (main_frame->g_pCodeWindow)
|
||||
{
|
||||
if (main_frame->g_pCodeWindow->AutomaticStart())
|
||||
{
|
||||
main_frame->BootGame("");
|
||||
}
|
||||
}
|
||||
if (m_play_movie && !m_movie_file.empty())
|
||||
{
|
||||
if (Movie::PlayInput(WxStrToStr(m_movie_file)))
|
||||
{
|
||||
if (m_load_file && !m_file_to_load.empty())
|
||||
{
|
||||
main_frame->BootGame(WxStrToStr(m_file_to_load));
|
||||
}
|
||||
else
|
||||
{
|
||||
main_frame->BootGame("");
|
||||
}
|
||||
}
|
||||
}
|
||||
// First check if we have an exec command line.
|
||||
else if (m_load_file && !m_file_to_load.empty())
|
||||
{
|
||||
main_frame->BootGame(WxStrToStr(m_file_to_load));
|
||||
}
|
||||
// If we have selected Automatic Start, start the default ISO,
|
||||
// or if no default ISO exists, start the last loaded ISO
|
||||
else if (main_frame->g_pCodeWindow)
|
||||
{
|
||||
if (main_frame->g_pCodeWindow->AutomaticStart())
|
||||
{
|
||||
main_frame->BootGame("");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DolphinApp::InitLanguageSupport()
|
||||
{
|
||||
unsigned int language = 0;
|
||||
unsigned int language = 0;
|
||||
|
||||
IniFile ini;
|
||||
ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX));
|
||||
ini.GetOrCreateSection("Interface")->Get("Language", &language, wxLANGUAGE_DEFAULT);
|
||||
IniFile ini;
|
||||
ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX));
|
||||
ini.GetOrCreateSection("Interface")->Get("Language", &language, wxLANGUAGE_DEFAULT);
|
||||
|
||||
// Load language if possible, fall back to system default otherwise
|
||||
if (wxLocale::IsAvailable(language))
|
||||
{
|
||||
m_locale.reset(new wxLocale(language));
|
||||
// Load language if possible, fall back to system default otherwise
|
||||
if (wxLocale::IsAvailable(language))
|
||||
{
|
||||
m_locale.reset(new wxLocale(language));
|
||||
|
||||
// Specify where dolphins *.gmo files are located on each operating system
|
||||
// Specify where dolphins *.gmo files are located on each operating system
|
||||
#ifdef _WIN32
|
||||
m_locale->AddCatalogLookupPathPrefix(StrToWxStr(File::GetExeDirectory() + DIR_SEP "Languages"));
|
||||
m_locale->AddCatalogLookupPathPrefix(StrToWxStr(File::GetExeDirectory() + DIR_SEP "Languages"));
|
||||
#elif defined(__LINUX__)
|
||||
m_locale->AddCatalogLookupPathPrefix(StrToWxStr(DATA_DIR "../locale"));
|
||||
m_locale->AddCatalogLookupPathPrefix(StrToWxStr(DATA_DIR "../locale"));
|
||||
#elif defined(__APPLE__)
|
||||
m_locale->AddCatalogLookupPathPrefix(StrToWxStr(File::GetBundleDirectory() + "Contents/Resources"));
|
||||
m_locale->AddCatalogLookupPathPrefix(
|
||||
StrToWxStr(File::GetBundleDirectory() + "Contents/Resources"));
|
||||
#endif
|
||||
|
||||
m_locale->AddCatalog("dolphin-emu");
|
||||
m_locale->AddCatalog("dolphin-emu");
|
||||
|
||||
if (!m_locale->IsOk())
|
||||
{
|
||||
wxMessageBox(_("Error loading selected language. Falling back to system default."), _("Error"));
|
||||
m_locale.reset(new wxLocale(wxLANGUAGE_DEFAULT));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
wxMessageBox(_("The selected language is not supported by your system. Falling back to system default."), _("Error"));
|
||||
m_locale.reset(new wxLocale(wxLANGUAGE_DEFAULT));
|
||||
}
|
||||
if (!m_locale->IsOk())
|
||||
{
|
||||
wxMessageBox(_("Error loading selected language. Falling back to system default."),
|
||||
_("Error"));
|
||||
m_locale.reset(new wxLocale(wxLANGUAGE_DEFAULT));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
wxMessageBox(
|
||||
_("The selected language is not supported by your system. Falling back to system default."),
|
||||
_("Error"));
|
||||
m_locale.reset(new wxLocale(wxLANGUAGE_DEFAULT));
|
||||
}
|
||||
}
|
||||
|
||||
void DolphinApp::OnEndSession(wxCloseEvent& event)
|
||||
{
|
||||
// Close if we've received wxEVT_END_SESSION (ignore wxEVT_QUERY_END_SESSION)
|
||||
if (!event.CanVeto())
|
||||
{
|
||||
main_frame->Close(true);
|
||||
}
|
||||
// Close if we've received wxEVT_END_SESSION (ignore wxEVT_QUERY_END_SESSION)
|
||||
if (!event.CanVeto())
|
||||
{
|
||||
main_frame->Close(true);
|
||||
}
|
||||
}
|
||||
|
||||
int DolphinApp::OnExit()
|
||||
{
|
||||
Core::Shutdown();
|
||||
UICommon::Shutdown();
|
||||
Core::Shutdown();
|
||||
UICommon::Shutdown();
|
||||
|
||||
return wxApp::OnExit();
|
||||
return wxApp::OnExit();
|
||||
}
|
||||
|
||||
void DolphinApp::OnFatalException()
|
||||
{
|
||||
WiimoteReal::Shutdown();
|
||||
WiimoteReal::Shutdown();
|
||||
}
|
||||
|
||||
void DolphinApp::OnIdle(wxIdleEvent& ev)
|
||||
{
|
||||
ev.Skip();
|
||||
Core::HostDispatchJobs();
|
||||
ev.Skip();
|
||||
Core::HostDispatchJobs();
|
||||
}
|
||||
|
||||
// ------------
|
||||
|
@ -412,197 +380,200 @@ void DolphinApp::OnIdle(wxIdleEvent& ev)
|
|||
bool wxMsgAlert(const char* caption, const char* text, bool yes_no, int /*Style*/)
|
||||
{
|
||||
#ifdef __WXGTK__
|
||||
if (wxIsMainThread())
|
||||
{
|
||||
if (wxIsMainThread())
|
||||
{
|
||||
#endif
|
||||
NetPlayDialog*& npd = NetPlayDialog::GetInstance();
|
||||
if (npd == nullptr)
|
||||
{
|
||||
return wxYES == wxMessageBox(StrToWxStr(text), StrToWxStr(caption),
|
||||
(yes_no) ? wxYES_NO : wxOK, wxWindow::FindFocus());
|
||||
}
|
||||
else
|
||||
{
|
||||
npd->AppendChat("/!\\ " + std::string{ text });
|
||||
return true;
|
||||
}
|
||||
NetPlayDialog*& npd = NetPlayDialog::GetInstance();
|
||||
if (npd != nullptr && npd->IsShown())
|
||||
{
|
||||
npd->AppendChat("/!\\ " + std::string{text});
|
||||
return true;
|
||||
}
|
||||
return wxYES == wxMessageBox(StrToWxStr(text), StrToWxStr(caption), (yes_no) ? wxYES_NO : wxOK,
|
||||
wxWindow::FindFocus());
|
||||
#ifdef __WXGTK__
|
||||
}
|
||||
else
|
||||
{
|
||||
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_PANIC);
|
||||
event.SetString(StrToWxStr(caption) + ":" + StrToWxStr(text));
|
||||
event.SetInt(yes_no);
|
||||
main_frame->GetEventHandler()->AddPendingEvent(event);
|
||||
main_frame->panic_event.Wait();
|
||||
return main_frame->bPanicResult;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_PANIC);
|
||||
event.SetString(StrToWxStr(caption) + ":" + StrToWxStr(text));
|
||||
event.SetInt(yes_no);
|
||||
main_frame->GetEventHandler()->AddPendingEvent(event);
|
||||
main_frame->panic_event.Wait();
|
||||
return main_frame->bPanicResult;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
std::string wxStringTranslator(const char *text)
|
||||
std::string wxStringTranslator(const char* text)
|
||||
{
|
||||
return WxStrToStr(wxGetTranslation(wxString::FromUTF8(text)));
|
||||
return WxStrToStr(wxGetTranslation(wxString::FromUTF8(text)));
|
||||
}
|
||||
|
||||
// Accessor for the main window class
|
||||
CFrame* DolphinApp::GetCFrame()
|
||||
{
|
||||
return main_frame;
|
||||
return main_frame;
|
||||
}
|
||||
|
||||
void Host_Message(int Id)
|
||||
{
|
||||
if (Id == WM_USER_JOB_DISPATCH)
|
||||
{
|
||||
// Trigger a wxEVT_IDLE
|
||||
wxWakeUpIdle();
|
||||
return;
|
||||
}
|
||||
wxCommandEvent event(wxEVT_HOST_COMMAND, Id);
|
||||
main_frame->GetEventHandler()->AddPendingEvent(event);
|
||||
if (Id == WM_USER_JOB_DISPATCH)
|
||||
{
|
||||
// Trigger a wxEVT_IDLE
|
||||
wxWakeUpIdle();
|
||||
return;
|
||||
}
|
||||
wxCommandEvent event(wxEVT_HOST_COMMAND, Id);
|
||||
main_frame->GetEventHandler()->AddPendingEvent(event);
|
||||
}
|
||||
|
||||
void* Host_GetRenderHandle()
|
||||
{
|
||||
return main_frame->GetRenderHandle();
|
||||
return main_frame->GetRenderHandle();
|
||||
}
|
||||
|
||||
// OK, this thread boundary is DANGEROUS on Linux
|
||||
// wxPostEvent / wxAddPendingEvent is the solution.
|
||||
void Host_NotifyMapLoaded()
|
||||
{
|
||||
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_NOTIFY_MAP_LOADED);
|
||||
main_frame->GetEventHandler()->AddPendingEvent(event);
|
||||
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_NOTIFY_MAP_LOADED);
|
||||
main_frame->GetEventHandler()->AddPendingEvent(event);
|
||||
|
||||
if (main_frame->g_pCodeWindow)
|
||||
{
|
||||
main_frame->g_pCodeWindow->GetEventHandler()->AddPendingEvent(event);
|
||||
}
|
||||
if (main_frame->g_pCodeWindow)
|
||||
{
|
||||
main_frame->g_pCodeWindow->GetEventHandler()->AddPendingEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
void Host_UpdateDisasmDialog()
|
||||
{
|
||||
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATE_DISASM_DIALOG);
|
||||
main_frame->GetEventHandler()->AddPendingEvent(event);
|
||||
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATE_DISASM_DIALOG);
|
||||
main_frame->GetEventHandler()->AddPendingEvent(event);
|
||||
|
||||
if (main_frame->g_pCodeWindow)
|
||||
{
|
||||
main_frame->g_pCodeWindow->GetEventHandler()->AddPendingEvent(event);
|
||||
}
|
||||
if (main_frame->g_pCodeWindow)
|
||||
{
|
||||
main_frame->g_pCodeWindow->GetEventHandler()->AddPendingEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
void Host_UpdateMainFrame()
|
||||
{
|
||||
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATE_GUI);
|
||||
main_frame->GetEventHandler()->AddPendingEvent(event);
|
||||
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATE_GUI);
|
||||
main_frame->GetEventHandler()->AddPendingEvent(event);
|
||||
|
||||
if (main_frame->g_pCodeWindow)
|
||||
{
|
||||
main_frame->g_pCodeWindow->GetEventHandler()->AddPendingEvent(event);
|
||||
}
|
||||
if (main_frame->g_pCodeWindow)
|
||||
{
|
||||
main_frame->g_pCodeWindow->GetEventHandler()->AddPendingEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
void Host_UpdateTitle(const std::string& title)
|
||||
{
|
||||
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATE_TITLE);
|
||||
event.SetString(StrToWxStr(title));
|
||||
main_frame->GetEventHandler()->AddPendingEvent(event);
|
||||
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATE_TITLE);
|
||||
event.SetString(StrToWxStr(title));
|
||||
main_frame->GetEventHandler()->AddPendingEvent(event);
|
||||
}
|
||||
|
||||
void Host_RequestRenderWindowSize(int width, int height)
|
||||
{
|
||||
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_WINDOW_SIZE_REQUEST);
|
||||
event.SetClientData(new std::pair<int, int>(width, height));
|
||||
main_frame->GetEventHandler()->AddPendingEvent(event);
|
||||
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_WINDOW_SIZE_REQUEST);
|
||||
event.SetClientData(new std::pair<int, int>(width, height));
|
||||
main_frame->GetEventHandler()->AddPendingEvent(event);
|
||||
}
|
||||
|
||||
void Host_RequestFullscreen(bool enable_fullscreen)
|
||||
{
|
||||
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_FULLSCREEN_REQUEST);
|
||||
event.SetInt(enable_fullscreen ? 1 : 0);
|
||||
main_frame->GetEventHandler()->AddPendingEvent(event);
|
||||
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_FULLSCREEN_REQUEST);
|
||||
event.SetInt(enable_fullscreen ? 1 : 0);
|
||||
main_frame->GetEventHandler()->AddPendingEvent(event);
|
||||
}
|
||||
|
||||
void Host_SetStartupDebuggingParameters()
|
||||
{
|
||||
SConfig& StartUp = SConfig::GetInstance();
|
||||
if (main_frame->g_pCodeWindow)
|
||||
{
|
||||
StartUp.bBootToPause = main_frame->g_pCodeWindow->BootToPause();
|
||||
StartUp.bAutomaticStart = main_frame->g_pCodeWindow->AutomaticStart();
|
||||
StartUp.bJITNoBlockCache = main_frame->g_pCodeWindow->JITNoBlockCache();
|
||||
StartUp.bJITNoBlockLinking = main_frame->g_pCodeWindow->JITNoBlockLinking();
|
||||
}
|
||||
else
|
||||
{
|
||||
StartUp.bBootToPause = false;
|
||||
}
|
||||
StartUp.bEnableDebugging = main_frame->g_pCodeWindow ? true : false; // RUNNING_DEBUG
|
||||
SConfig& StartUp = SConfig::GetInstance();
|
||||
if (main_frame->g_pCodeWindow)
|
||||
{
|
||||
StartUp.bBootToPause = main_frame->g_pCodeWindow->BootToPause();
|
||||
StartUp.bAutomaticStart = main_frame->g_pCodeWindow->AutomaticStart();
|
||||
StartUp.bJITNoBlockCache = main_frame->g_pCodeWindow->JITNoBlockCache();
|
||||
StartUp.bJITNoBlockLinking = main_frame->g_pCodeWindow->JITNoBlockLinking();
|
||||
}
|
||||
else
|
||||
{
|
||||
StartUp.bBootToPause = false;
|
||||
}
|
||||
StartUp.bEnableDebugging = main_frame->g_pCodeWindow ? true : false; // RUNNING_DEBUG
|
||||
}
|
||||
|
||||
void Host_SetWiiMoteConnectionState(int _State)
|
||||
{
|
||||
static int currentState = -1;
|
||||
if (_State == currentState)
|
||||
return;
|
||||
currentState = _State;
|
||||
static int currentState = -1;
|
||||
if (_State == currentState)
|
||||
return;
|
||||
currentState = _State;
|
||||
|
||||
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATE_STATUS_BAR);
|
||||
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATE_STATUS_BAR);
|
||||
|
||||
switch (_State)
|
||||
{
|
||||
case 0: event.SetString(_("Not connected")); break;
|
||||
case 1: event.SetString(_("Connecting...")); break;
|
||||
case 2: event.SetString(_("Wiimote Connected")); break;
|
||||
}
|
||||
// Update field 1 or 2
|
||||
event.SetInt(1);
|
||||
switch (_State)
|
||||
{
|
||||
case 0:
|
||||
event.SetString(_("Not connected"));
|
||||
break;
|
||||
case 1:
|
||||
event.SetString(_("Connecting..."));
|
||||
break;
|
||||
case 2:
|
||||
event.SetString(_("Wiimote Connected"));
|
||||
break;
|
||||
}
|
||||
// Update field 1 or 2
|
||||
event.SetInt(1);
|
||||
|
||||
NOTICE_LOG(WIIMOTE, "%s", static_cast<const char*>(event.GetString().c_str()));
|
||||
NOTICE_LOG(WIIMOTE, "%s", static_cast<const char*>(event.GetString().c_str()));
|
||||
|
||||
main_frame->GetEventHandler()->AddPendingEvent(event);
|
||||
main_frame->GetEventHandler()->AddPendingEvent(event);
|
||||
}
|
||||
|
||||
bool Host_UIHasFocus()
|
||||
{
|
||||
return main_frame->UIHasFocus();
|
||||
return main_frame->UIHasFocus();
|
||||
}
|
||||
|
||||
bool Host_RendererHasFocus()
|
||||
{
|
||||
return main_frame->RendererHasFocus();
|
||||
return main_frame->RendererHasFocus();
|
||||
}
|
||||
|
||||
bool Host_RendererIsFullscreen()
|
||||
{
|
||||
return main_frame->RendererIsFullscreen();
|
||||
return main_frame->RendererIsFullscreen();
|
||||
}
|
||||
|
||||
void Host_ConnectWiimote(int wm_idx, bool connect)
|
||||
{
|
||||
if (connect)
|
||||
{
|
||||
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_FORCE_CONNECT_WIIMOTE1 + wm_idx);
|
||||
main_frame->GetEventHandler()->AddPendingEvent(event);
|
||||
}
|
||||
else
|
||||
{
|
||||
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_FORCE_DISCONNECT_WIIMOTE1 + wm_idx);
|
||||
main_frame->GetEventHandler()->AddPendingEvent(event);
|
||||
}
|
||||
if (connect)
|
||||
{
|
||||
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_FORCE_CONNECT_WIIMOTE1 + wm_idx);
|
||||
main_frame->GetEventHandler()->AddPendingEvent(event);
|
||||
}
|
||||
else
|
||||
{
|
||||
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_FORCE_DISCONNECT_WIIMOTE1 + wm_idx);
|
||||
main_frame->GetEventHandler()->AddPendingEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
void Host_ShowVideoConfig(void* parent, const std::string& backend_name)
|
||||
{
|
||||
if (backend_name == "Software Renderer")
|
||||
{
|
||||
SoftwareVideoConfigDialog diag((wxWindow*)parent, backend_name);
|
||||
diag.ShowModal();
|
||||
}
|
||||
else
|
||||
{
|
||||
VideoConfigDiag diag((wxWindow*)parent, backend_name);
|
||||
diag.ShowModal();
|
||||
}
|
||||
if (backend_name == "Software Renderer")
|
||||
{
|
||||
SoftwareVideoConfigDialog diag((wxWindow*)parent, backend_name);
|
||||
diag.ShowModal();
|
||||
}
|
||||
else
|
||||
{
|
||||
VideoConfigDiag diag((wxWindow*)parent, backend_name);
|
||||
diag.ShowModal();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
MD5Dialog::MD5Dialog(wxWindow* parent, NetPlayServer* server, std::vector<const Player*> players,
|
||||
const std::string& game)
|
||||
: wxDialog(parent, wxID_ANY, _("MD5 Checksum")), m_parent(parent), m_netplay_server(server)
|
||||
: wxDialog(parent, wxID_ANY, _("MD5 Checksum")), m_netplay_server(server)
|
||||
{
|
||||
Bind(wxEVT_CLOSE_WINDOW, &MD5Dialog::OnClose, this);
|
||||
wxBoxSizer* const main_sizer = new wxBoxSizer(wxVERTICAL);
|
||||
|
|
|
@ -31,7 +31,6 @@ private:
|
|||
void OnClose(wxCloseEvent& event);
|
||||
void OnCloseBtnPressed(wxCommandEvent& event);
|
||||
|
||||
wxWindow* m_parent;
|
||||
wxStaticText* m_final_result_label;
|
||||
NetPlayServer* m_netplay_server;
|
||||
std::map<int, wxGauge*> m_progress_bars;
|
||||
|
|
|
@ -140,7 +140,7 @@ NetPlayDialog::NetPlayDialog(wxWindow* const parent, const CGameListCtrl* const
|
|||
m_MD5_choice = new wxChoice(panel, wxID_ANY, wxDefaultPosition, wxSize(150, -1));
|
||||
m_MD5_choice->Bind(wxEVT_CHOICE, &NetPlayDialog::OnMD5ComputeRequested, this);
|
||||
m_MD5_choice->Append(_("MD5 check..."));
|
||||
m_MD5_choice->Append(_("Curent game"));
|
||||
m_MD5_choice->Append(_("Current game"));
|
||||
m_MD5_choice->Append(_("Other game"));
|
||||
m_MD5_choice->Append(_("SD card"));
|
||||
m_MD5_choice->SetSelection(0);
|
||||
|
|
|
@ -92,7 +92,7 @@ private:
|
|||
void OnPlayerSelect(wxCommandEvent& event);
|
||||
void GetNetSettings(NetSettings& settings);
|
||||
std::string FindCurrentGame();
|
||||
std::string FindGame(const std::string& game);
|
||||
std::string FindGame(const std::string& game) override;
|
||||
|
||||
void OnCopyIP(wxCommandEvent&);
|
||||
void OnChoice(wxCommandEvent& event);
|
||||
|
|
Loading…
Reference in a new issue