Some code cleanup
This commit is contained in:
parent
5ef0bad6c8
commit
d72242d081
|
@ -13,3 +13,4 @@ local.properties
|
||||||
/captures
|
/captures
|
||||||
.externalNativeBuild
|
.externalNativeBuild
|
||||||
.cxx
|
.cxx
|
||||||
|
build
|
||||||
|
|
|
@ -9,11 +9,11 @@ import emu.project64.jni.SettingsID;
|
||||||
import emu.project64.util.Strings;
|
import emu.project64.util.Strings;
|
||||||
import emu.project64.util.Utility;
|
import emu.project64.util.Utility;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.design.widget.TabLayout;
|
import com.google.android.material.tabs.TabLayout;
|
||||||
import android.support.v4.view.ViewPager;
|
import androidx.viewpager.widget.ViewPager;
|
||||||
import android.support.v7.app.ActionBar;
|
import androidx.appcompat.app.ActionBar;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import android.support.v7.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
import android.text.Html;
|
import android.text.Html;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
@ -21,7 +21,7 @@ import android.webkit.WebView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
public class AboutActivity extends AppCompatActivity
|
public class AboutActivity extends AppCompatActivity
|
||||||
{
|
{
|
||||||
public final static int MODE_ABOUT = 0;
|
public final static int MODE_ABOUT = 0;
|
||||||
public final static int MODE_LICENCE = 1;
|
public final static int MODE_LICENCE = 1;
|
||||||
|
@ -32,20 +32,21 @@ public class AboutActivity extends AppCompatActivity
|
||||||
public void onCreate( Bundle savedInstanceState )
|
public void onCreate( Bundle savedInstanceState )
|
||||||
{
|
{
|
||||||
super.onCreate( savedInstanceState );
|
super.onCreate( savedInstanceState );
|
||||||
setContentView( R.layout.about_activity );
|
setContentView( R.layout.about_activity );
|
||||||
|
|
||||||
// Add the tool bar to the activity (which supports the fancy menu/arrow animation)
|
m_title_clicks = 0;
|
||||||
|
|
||||||
Toolbar toolbar = (Toolbar) findViewById( R.id.toolbar );
|
Toolbar toolbar = (Toolbar) findViewById( R.id.toolbar );
|
||||||
toolbar.setTitle( getString(R.string.app_name) + " " + NativeExports.appVersion() );
|
toolbar.setTitle( getString(R.string.app_name) + " " + NativeExports.appVersion() );
|
||||||
setSupportActionBar( toolbar );
|
setSupportActionBar( toolbar );
|
||||||
ActionBar actionbar = getSupportActionBar();
|
ActionBar actionbar = getSupportActionBar();
|
||||||
|
|
||||||
if (AndroidDevice.IS_ICE_CREAM_SANDWICH)
|
if (AndroidDevice.IS_ICE_CREAM_SANDWICH)
|
||||||
{
|
{
|
||||||
actionbar.setHomeButtonEnabled(true);
|
actionbar.setHomeButtonEnabled(true);
|
||||||
actionbar.setDisplayHomeAsUpEnabled(true);
|
actionbar.setDisplayHomeAsUpEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
View aboutMain = findViewById(R.id.about_main);
|
View aboutMain = findViewById(R.id.about_main);
|
||||||
WebView webView = (WebView)findViewById(R.id.webview);
|
WebView webView = (WebView)findViewById(R.id.webview);
|
||||||
|
|
||||||
|
@ -54,13 +55,13 @@ public class AboutActivity extends AppCompatActivity
|
||||||
ViewPager viewPager = (ViewPager) findViewById(R.id.pager);
|
ViewPager viewPager = (ViewPager) findViewById(R.id.pager);
|
||||||
viewPager.setOffscreenPageLimit(MODE_TOTAL-1);
|
viewPager.setOffscreenPageLimit(MODE_TOTAL-1);
|
||||||
viewPager.setAdapter(new AboutPagerAdapter(lists, titles));
|
viewPager.setAdapter(new AboutPagerAdapter(lists, titles));
|
||||||
|
|
||||||
TabLayout tabLayout = (TabLayout) findViewById(R.id.sliding_tabs);
|
TabLayout tabLayout = (TabLayout) findViewById(R.id.sliding_tabs);
|
||||||
tabLayout.setupWithViewPager(viewPager);
|
tabLayout.setupWithViewPager(viewPager);
|
||||||
|
|
||||||
TextView link = (TextView)findViewById(R.id.main_link);
|
TextView link = (TextView)findViewById(R.id.main_link);
|
||||||
link.setText(Html.fromHtml(getString(R.string.about_link)));
|
link.setText(Html.fromHtml(getString(R.string.about_link)));
|
||||||
|
|
||||||
TextView app_name_full = (TextView)findViewById(R.id.app_name_full);
|
TextView app_name_full = (TextView)findViewById(R.id.app_name_full);
|
||||||
app_name_full.setText(Strings.GetString(LanguageStringID.ANDROID_ABOUT_APP_NAME));
|
app_name_full.setText(Strings.GetString(LanguageStringID.ANDROID_ABOUT_APP_NAME));
|
||||||
|
|
||||||
|
@ -72,11 +73,11 @@ public class AboutActivity extends AppCompatActivity
|
||||||
|
|
||||||
webView.loadData(Utility.readAsset("licence.htm", ""), "text/html", "UTF8");
|
webView.loadData(Utility.readAsset("licence.htm", ""), "text/html", "UTF8");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item)
|
public boolean onOptionsItemSelected(MenuItem item)
|
||||||
{
|
{
|
||||||
switch (item.getItemId())
|
switch (item.getItemId())
|
||||||
{
|
{
|
||||||
case android.R.id.home:
|
case android.R.id.home:
|
||||||
finish();
|
finish();
|
||||||
|
@ -84,14 +85,14 @@ public class AboutActivity extends AppCompatActivity
|
||||||
}
|
}
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onAppNameClick(View v)
|
public void onAppNameClick(View v)
|
||||||
{
|
{
|
||||||
m_title_clicks += 1;
|
m_title_clicks += 1;
|
||||||
if (m_title_clicks == 6)
|
if (m_title_clicks == 6)
|
||||||
{
|
{
|
||||||
NativeExports.SettingsSaveBool(SettingsID.UserInterface_BasicMode.getValue(), false);
|
NativeExports.SettingsSaveBool(SettingsID.UserInterface_BasicMode.getValue(), false);
|
||||||
Toast.makeText(this, "Advanced Mode Enabled", Toast.LENGTH_SHORT).show();
|
Toast.makeText(this, "Advanced Mode Enabled", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package emu.project64;
|
package emu.project64;
|
||||||
|
|
||||||
import android.database.DataSetObserver;
|
import android.database.DataSetObserver;
|
||||||
import android.support.v4.view.PagerAdapter;
|
import androidx.viewpager.widget.PagerAdapter;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ import emu.project64.util.Strings;
|
||||||
import emu.project64.util.Utility;
|
import emu.project64.util.Utility;
|
||||||
import android.annotation.TargetApi;
|
import android.annotation.TargetApi;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.DialogInterface.OnCancelListener;
|
import android.content.DialogInterface.OnCancelListener;
|
||||||
|
@ -51,14 +51,6 @@ import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.support.v4.content.res.ResourcesCompat;
|
|
||||||
import android.support.v4.view.GravityCompat;
|
|
||||||
import android.support.v4.widget.DrawerLayout;
|
|
||||||
import android.support.v7.app.ActionBarDrawerToggle;
|
|
||||||
import android.support.v7.app.AppCompatActivity;
|
|
||||||
import android.support.v7.widget.GridLayoutManager;
|
|
||||||
import android.support.v7.widget.RecyclerView;
|
|
||||||
import android.support.v7.widget.Toolbar;
|
|
||||||
import android.text.SpannableStringBuilder;
|
import android.text.SpannableStringBuilder;
|
||||||
import android.text.method.LinkMovementMethod;
|
import android.text.method.LinkMovementMethod;
|
||||||
import android.text.style.ClickableSpan;
|
import android.text.style.ClickableSpan;
|
||||||
|
@ -75,6 +67,16 @@ import android.widget.ListAdapter;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.TextView.BufferType;
|
import android.widget.TextView.BufferType;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.ActionBar;
|
||||||
|
import androidx.appcompat.app.ActionBarDrawerToggle;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
import androidx.core.content.res.ResourcesCompat;
|
||||||
|
import androidx.core.view.GravityCompat;
|
||||||
|
import androidx.drawerlayout.widget.DrawerLayout;
|
||||||
|
import androidx.recyclerview.widget.GridLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
public class GalleryActivity extends AppCompatActivity implements IabBroadcastListener
|
public class GalleryActivity extends AppCompatActivity implements IabBroadcastListener
|
||||||
{
|
{
|
||||||
//Progress dialog for ROM scan
|
//Progress dialog for ROM scan
|
||||||
|
@ -231,14 +233,14 @@ public class GalleryActivity extends AppCompatActivity implements IabBroadcastLi
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
UpdateLanguage();
|
UpdateLanguage();
|
||||||
|
|
||||||
int RunCount = NativeExports.UISettingsLoadDword(UISettingID.AppInfo_RunCount.getValue()) + 1;
|
int RunCount = NativeExports.UISettingsLoadDword(UISettingID.AppInfo_RunCount.getValue()) + 1;
|
||||||
if (RunCount < 1) { RunCount = 1; }
|
if (RunCount < 1) { RunCount = 1; }
|
||||||
NativeExports.UISettingsSaveDword(UISettingID.AppInfo_RunCount.getValue(), RunCount);
|
NativeExports.UISettingsSaveDword(UISettingID.AppInfo_RunCount.getValue(), RunCount);
|
||||||
Log.d("GalleryActivity", "ShowSupportWindow RunCount = " + RunCount);
|
Log.d("GalleryActivity", "ShowSupportWindow RunCount = " + RunCount);
|
||||||
if (RunCount == 5 || RunCount == 10)
|
if (RunCount == 5 || RunCount == 10)
|
||||||
{
|
{
|
||||||
ShowReviewOptions();
|
ShowReviewOptions();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -388,10 +390,10 @@ public class GalleryActivity extends AppCompatActivity implements IabBroadcastLi
|
||||||
{
|
{
|
||||||
switch( item.getItemId() )
|
switch( item.getItemId() )
|
||||||
{
|
{
|
||||||
case R.id.menuItem_gameDir:
|
case R.id.menuItem_GameDir:
|
||||||
Intent intent = new Intent(this, ScanRomsActivity.class);
|
Intent ScanRomsIntent = new Intent(this, ScanRomsActivity.class);
|
||||||
startActivityForResult( intent, GAME_DIR_REQUEST_CODE );
|
startActivityForResult( ScanRomsIntent, GAME_DIR_REQUEST_CODE );
|
||||||
return true;
|
return true;
|
||||||
case R.id.menuItem_settings:
|
case R.id.menuItem_settings:
|
||||||
Intent SettingsIntent = new Intent(this, SettingsActivity.class);
|
Intent SettingsIntent = new Intent(this, SettingsActivity.class);
|
||||||
startActivity( SettingsIntent );
|
startActivity( SettingsIntent );
|
||||||
|
@ -405,10 +407,10 @@ public class GalleryActivity extends AppCompatActivity implements IabBroadcastLi
|
||||||
startActivity(IssueIntent);
|
startActivity(IssueIntent);
|
||||||
return true;
|
return true;
|
||||||
case R.id.menuItem_review:
|
case R.id.menuItem_review:
|
||||||
ShowReviewOptions();
|
ShowReviewOptions();
|
||||||
return true;
|
return true;
|
||||||
case R.id.menuItem_support:
|
case R.id.menuItem_support:
|
||||||
ShowPaymentOptions();
|
ShowPaymentOptions();
|
||||||
return true;
|
return true;
|
||||||
case R.id.menuItem_about:
|
case R.id.menuItem_about:
|
||||||
Intent AboutIntent = new Intent(this, AboutActivity.class);
|
Intent AboutIntent = new Intent(this, AboutActivity.class);
|
||||||
|
@ -605,7 +607,6 @@ public class GalleryActivity extends AppCompatActivity implements IabBroadcastLi
|
||||||
{
|
{
|
||||||
NativeExports.LoadGame(item.romFile.getAbsolutePath());
|
NativeExports.LoadGame(item.romFile.getAbsolutePath());
|
||||||
StartGameMenu(true);
|
StartGameMenu(true);
|
||||||
Log.d("GalleryActivity", "onGalleryItemLongClick 4");
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -817,7 +818,7 @@ public class GalleryActivity extends AppCompatActivity implements IabBroadcastLi
|
||||||
})
|
})
|
||||||
.setCancelable(false).show();
|
.setCancelable(false).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ShowPaymentOptions()
|
public void ShowPaymentOptions()
|
||||||
{
|
{
|
||||||
ArrayList<String> skuList = new ArrayList<String>();
|
ArrayList<String> skuList = new ArrayList<String>();
|
||||||
|
|
|
@ -7,7 +7,6 @@ import java.util.List;
|
||||||
import emu.project64.R;
|
import emu.project64.R;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.support.v7.widget.RecyclerView;
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
|
@ -18,6 +17,8 @@ import android.view.ViewGroup;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
public class GalleryItem
|
public class GalleryItem
|
||||||
{
|
{
|
||||||
public final String goodName;
|
public final String goodName;
|
||||||
|
|
|
@ -118,7 +118,7 @@ public class SplashActivity extends AppCompatActivity implements ExtractAssetsLi
|
||||||
}
|
}
|
||||||
mInit = true;
|
mInit = true;
|
||||||
String ConfigFile = AndroidDevice.PACKAGE_DIRECTORY + "/Config/Project64.cfg";
|
String ConfigFile = AndroidDevice.PACKAGE_DIRECTORY + "/Config/Project64.cfg";
|
||||||
if(( new File( ConfigFile ) ).exists())
|
if((new File(ConfigFile)).exists())
|
||||||
{
|
{
|
||||||
InitProject64();
|
InitProject64();
|
||||||
}
|
}
|
||||||
|
@ -284,7 +284,7 @@ public class SplashActivity extends AppCompatActivity implements ExtractAssetsLi
|
||||||
@Override
|
@Override
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
Log.e( "Splash", "extractAssetsTaskLauncher - start");
|
Log.i( "Splash", "extractAssetsTaskLauncher - start");
|
||||||
TOTAL_ASSETS = 0;
|
TOTAL_ASSETS = 0;
|
||||||
CountTotalAssetFiles(SOURCE_DIR);
|
CountTotalAssetFiles(SOURCE_DIR);
|
||||||
mAssetsExtracted = 0;
|
mAssetsExtracted = 0;
|
||||||
|
@ -312,12 +312,8 @@ public class SplashActivity extends AppCompatActivity implements ExtractAssetsLi
|
||||||
}
|
}
|
||||||
mTextView.setText( R.string.assetExtractor_finished );
|
mTextView.setText( R.string.assetExtractor_finished );
|
||||||
NativeExports.UISettingsSaveDword(UISettingID.Asserts_Version.getValue(), ASSET_VERSION);
|
NativeExports.UISettingsSaveDword(UISettingID.Asserts_Version.getValue(), ASSET_VERSION);
|
||||||
|
|
||||||
// Launch gallery activity
|
|
||||||
Intent intent = new Intent( this, GalleryActivity.class );
|
Intent intent = new Intent( this, GalleryActivity.class );
|
||||||
this.startActivity( intent );
|
this.startActivity( intent );
|
||||||
|
|
||||||
// We never want to come back to this activity, so finish it
|
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -2,13 +2,14 @@ package emu.project64.game;
|
||||||
|
|
||||||
import emu.project64.jni.NativeExports;
|
import emu.project64.jni.NativeExports;
|
||||||
import emu.project64.jni.SystemEvent;
|
import emu.project64.jni.SystemEvent;
|
||||||
import android.app.Activity;
|
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
public class GameActivity extends Activity
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
public class GameActivity extends AppCompatActivity
|
||||||
{
|
{
|
||||||
private GameLifecycleHandler mLifecycleHandler;
|
private GameLifecycleHandler mLifecycleHandler;
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package emu.project64.jni;
|
package emu.project64.jni;
|
||||||
|
|
||||||
public enum LanguageStringID
|
public enum LanguageStringID
|
||||||
{
|
{
|
||||||
EMPTY_STRING(0),
|
EMPTY_STRING(0),
|
||||||
|
|
||||||
/*********************************************************************************
|
/*********************************************************************************
|
||||||
|
@ -379,7 +379,7 @@ public enum LanguageStringID
|
||||||
STR_FR_DLS(701),
|
STR_FR_DLS(701),
|
||||||
STR_FR_PERCENT(702),
|
STR_FR_PERCENT(702),
|
||||||
STR_FR_DLS_VIS(703),
|
STR_FR_DLS_VIS(703),
|
||||||
STR_FR_NONE(704),
|
STR_FR_NONE(704),
|
||||||
|
|
||||||
// Increase speed
|
// Increase speed
|
||||||
STR_INSREASE_SPEED(710),
|
STR_INSREASE_SPEED(710),
|
||||||
|
@ -531,7 +531,7 @@ public enum LanguageStringID
|
||||||
MSG_DEL_TITLE(2042),
|
MSG_DEL_TITLE(2042),
|
||||||
MSG_CHEAT_NAME_IN_USE(2043),
|
MSG_CHEAT_NAME_IN_USE(2043),
|
||||||
MSG_MAX_CHEATS(2044),
|
MSG_MAX_CHEATS(2044),
|
||||||
MSG_PLUGIN_INIT(2045),
|
MSG_PLUGIN_INIT(2045),
|
||||||
MSG_NO_SHORTCUT_SEL(2046),
|
MSG_NO_SHORTCUT_SEL(2046),
|
||||||
MSG_NO_MENUITEM_SEL(2047),
|
MSG_NO_MENUITEM_SEL(2047),
|
||||||
MSG_MENUITEM_ASSIGNED(2048),
|
MSG_MENUITEM_ASSIGNED(2048),
|
||||||
|
@ -569,10 +569,10 @@ public enum LanguageStringID
|
||||||
ANDROID_ABOUT_REVISION(3018),
|
ANDROID_ABOUT_REVISION(3018),
|
||||||
ANDROID_ABOUT_TEXT(3019),
|
ANDROID_ABOUT_TEXT(3019),
|
||||||
ANDROID_ABOUT_PJ64_AUTHORS(3020),
|
ANDROID_ABOUT_PJ64_AUTHORS(3020),
|
||||||
ANDROID_DISCORD(3021),
|
ANDROID_DISCORD(3021),
|
||||||
ANDROID_SUPPORT_PJ64(3022),
|
ANDROID_SUPPORT_PJ64(3022),
|
||||||
ANDROID_REVIEW_PJ64(3023),
|
ANDROID_REVIEW_PJ64(3023),
|
||||||
|
|
||||||
//In game menu
|
//In game menu
|
||||||
ANDROID_MENU_SETTINGS(3100),
|
ANDROID_MENU_SETTINGS(3100),
|
||||||
ANDROID_MENU_SAVESTATE(3101),
|
ANDROID_MENU_SAVESTATE(3101),
|
||||||
|
@ -592,26 +592,26 @@ public enum LanguageStringID
|
||||||
//Video plugin
|
//Video plugin
|
||||||
ANDROID_VIDEO_NATIVE_RES(3200),
|
ANDROID_VIDEO_NATIVE_RES(3200),
|
||||||
;
|
;
|
||||||
|
|
||||||
private int value;
|
private int value;
|
||||||
|
|
||||||
public int getValue()
|
public int getValue()
|
||||||
{
|
{
|
||||||
return this.value;
|
return this.value;
|
||||||
}
|
}
|
||||||
private static final class StaticFields
|
private static final class StaticFields
|
||||||
{
|
{
|
||||||
public static int Counter = 0;
|
public static int Counter = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private LanguageStringID()
|
private LanguageStringID()
|
||||||
{
|
{
|
||||||
this.value = StaticFields.Counter;
|
this.value = StaticFields.Counter;
|
||||||
StaticFields.Counter += 1;
|
StaticFields.Counter += 1;
|
||||||
}
|
}
|
||||||
private LanguageStringID(int value)
|
private LanguageStringID(int value)
|
||||||
{
|
{
|
||||||
this.value = value;
|
this.value = value;
|
||||||
StaticFields.Counter = this.value + 1;
|
StaticFields.Counter = this.value + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,17 +1,10 @@
|
||||||
package emu.project64.jni;
|
package emu.project64.jni;
|
||||||
|
|
||||||
/**
|
|
||||||
* Calls made between the native input-android library and Java. Any function names changed here
|
|
||||||
* should also be changed in the corresponding C code, and vice versa.
|
|
||||||
*
|
|
||||||
* @see /Source/Android/PluginInput/Main.cpp
|
|
||||||
* @see CoreInterface
|
|
||||||
*/
|
|
||||||
public class NativeVideo
|
public class NativeVideo
|
||||||
{
|
{
|
||||||
static
|
static
|
||||||
{
|
{
|
||||||
System.loadLibrary( "Project64-gfx" );
|
System.loadLibrary( "Project64-video" );
|
||||||
}
|
}
|
||||||
|
|
||||||
public static native void UpdateScreenRes(int ScreenWidth, int ScreenHeight);
|
public static native void UpdateScreenRes(int ScreenWidth, int ScreenHeight);
|
||||||
|
|
|
@ -20,11 +20,11 @@ public enum SettingsID
|
||||||
SupportFile_VideoRDBDefault,
|
SupportFile_VideoRDBDefault,
|
||||||
SupportFile_AudioRDB,
|
SupportFile_AudioRDB,
|
||||||
SupportFile_AudioRDBDefault,
|
SupportFile_AudioRDBDefault,
|
||||||
SupportFile_Cheats,
|
SupportFile_Cheats,
|
||||||
SupportFile_CheatsDefault,
|
SupportFile_CheatsDefault,
|
||||||
SupportFile_Enhancements,
|
SupportFile_Enhancements,
|
||||||
SupportFile_EnhancementsDefault,
|
SupportFile_EnhancementsDefault,
|
||||||
SupportFile_Notes,
|
SupportFile_Notes,
|
||||||
SupportFile_NotesDefault,
|
SupportFile_NotesDefault,
|
||||||
SupportFile_ExtInfo,
|
SupportFile_ExtInfo,
|
||||||
SupportFile_ExtInfoDefault,
|
SupportFile_ExtInfoDefault,
|
||||||
|
@ -47,19 +47,19 @@ public enum SettingsID
|
||||||
Setting_LanguageDirDefault,
|
Setting_LanguageDirDefault,
|
||||||
Setting_CurrentLanguage,
|
Setting_CurrentLanguage,
|
||||||
Setting_EnableDisk,
|
Setting_EnableDisk,
|
||||||
Setting_SyncViaAudioEnabled,
|
Setting_SyncViaAudioEnabled,
|
||||||
Setting_Enhancement,
|
Setting_Enhancement,
|
||||||
|
|
||||||
//Default Settings
|
//Default Settings
|
||||||
Default_RDRamSize,
|
Default_RDRamSize,
|
||||||
Default_UseHleGfx,
|
Default_UseHleGfx,
|
||||||
Default_UseTlb,
|
Default_UseTlb,
|
||||||
Default_ViRefreshRate,
|
Default_ViRefreshRate,
|
||||||
Default_AiCountPerBytes,
|
Default_AiCountPerBytes,
|
||||||
Default_CounterFactor,
|
Default_CounterFactor,
|
||||||
Default_32Bit,
|
Default_32Bit,
|
||||||
Default_SyncViaAudio,
|
Default_SyncViaAudio,
|
||||||
Default_FixedAudio,
|
Default_FixedAudio,
|
||||||
Default_UnalignedDMA,
|
Default_UnalignedDMA,
|
||||||
|
|
||||||
//RDB Settings
|
//RDB Settings
|
||||||
|
@ -321,15 +321,15 @@ public enum SettingsID
|
||||||
Cheat_Active,
|
Cheat_Active,
|
||||||
Cheat_Extension,
|
Cheat_Extension,
|
||||||
|
|
||||||
//Enhancement
|
//Enhancement
|
||||||
Enhancement_Name,
|
Enhancement_Name,
|
||||||
Enhancement_Active,
|
Enhancement_Active,
|
||||||
Enhancement_OnByDefault,
|
Enhancement_OnByDefault,
|
||||||
Enhancement_Overclock,
|
Enhancement_Overclock,
|
||||||
Enhancement_OverclockValue,
|
Enhancement_OverclockValue,
|
||||||
Enhancement_Gameshark,
|
Enhancement_Gameshark,
|
||||||
Enhancement_GamesharkCode,
|
Enhancement_GamesharkCode,
|
||||||
Enhancement_Notes,
|
Enhancement_Notes,
|
||||||
|
|
||||||
FirstUISettings, LastUISettings(FirstUISettings.getValue() + 65535),
|
FirstUISettings, LastUISettings(FirstUISettings.getValue() + 65535),
|
||||||
FirstRSPDefaultSet, LastRSPDefaultSet(FirstRSPDefaultSet.getValue() + 65535),
|
FirstRSPDefaultSet, LastRSPDefaultSet(FirstRSPDefaultSet.getValue() + 65535),
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package emu.project64.settings;
|
package emu.project64.settings;
|
||||||
|
|
||||||
import emu.project64.R;
|
import emu.project64.R;
|
||||||
import android.support.v7.preference.Preference;
|
import androidx.preference.Preference;
|
||||||
|
|
||||||
public class AdvancedFragment extends BaseSettingsFragment
|
public class AdvancedFragment extends BaseSettingsFragment
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,16 +7,16 @@ import emu.project64.profile.ControllerProfileActivity;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v4.app.DialogFragment;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import android.support.v4.app.Fragment;
|
import androidx.fragment.app.DialogFragment;
|
||||||
import android.support.v7.app.AlertDialog;
|
import androidx.fragment.app.Fragment;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import android.support.v7.preference.Preference;
|
import androidx.preference.Preference;
|
||||||
import android.support.v7.preference.PreferenceFragmentCompat;
|
import androidx.preference.PreferenceFragmentCompat;
|
||||||
|
|
||||||
public abstract class BaseSettingsFragment extends PreferenceFragmentCompat
|
public abstract class BaseSettingsFragment extends PreferenceFragmentCompat
|
||||||
{
|
{
|
||||||
private static final String DIALOG_FRAGMENT_TAG = "android.support.v7.preference.PreferenceFragment.DIALOG";
|
private static final String DIALOG_FRAGMENT_TAG = "androidx.preference.PreferenceFragment.DIALOG";
|
||||||
|
|
||||||
protected abstract int getXml();
|
protected abstract int getXml();
|
||||||
protected abstract int getTitleId();
|
protected abstract int getTitleId();
|
||||||
|
|
|
@ -7,9 +7,9 @@ import emu.project64.jni.SettingsID;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.support.v7.app.ActionBar;
|
import androidx.appcompat.app.ActionBar;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import android.support.v7.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
|
||||||
public class GameSettingsActivity extends AppCompatActivity implements SharedPreferences.OnSharedPreferenceChangeListener
|
public class GameSettingsActivity extends AppCompatActivity implements SharedPreferences.OnSharedPreferenceChangeListener
|
||||||
|
|
|
@ -3,7 +3,7 @@ package emu.project64.settings;
|
||||||
import emu.project64.R;
|
import emu.project64.R;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.TypedArray;
|
import android.content.res.TypedArray;
|
||||||
import android.support.v7.preference.DialogPreference;
|
import androidx.preference.DialogPreference;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.widget.SeekBar;
|
import android.widget.SeekBar;
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,10 @@ package emu.project64.settings;
|
||||||
|
|
||||||
import emu.project64.R;
|
import emu.project64.R;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v7.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import android.support.v7.preference.DialogPreference;
|
import androidx.preference.DialogPreference;
|
||||||
import android.support.v7.preference.Preference;
|
import androidx.preference.Preference;
|
||||||
import android.support.v7.preference.PreferenceDialogFragmentCompat;
|
import androidx.preference.PreferenceDialogFragmentCompat;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.SeekBar;
|
import android.widget.SeekBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
|
@ -3,7 +3,7 @@ package emu.project64.settings;
|
||||||
import emu.project64.R;
|
import emu.project64.R;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.TypedArray;
|
import android.content.res.TypedArray;
|
||||||
import android.support.v7.preference.ListPreference;
|
import androidx.preference.ListPreference;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
|
|
||||||
public class TwoLinesListPreference extends ListPreference
|
public class TwoLinesListPreference extends ListPreference
|
||||||
|
|
|
@ -7,9 +7,6 @@ import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import emu.project64.Project64Application;
|
import emu.project64.Project64Application;
|
||||||
|
|
||||||
/**
|
|
||||||
* Utility class which collects a bunch of commonly used methods into one class.
|
|
||||||
*/
|
|
||||||
public final class Utility
|
public final class Utility
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
*.c
|
|
||||||
*.cpp
|
|
||||||
*.h
|
|
||||||
*.vcproj
|
|
||||||
*.vcxproj
|
|
||||||
*.vcxproj.filters
|
|
||||||
*.dsp
|
|
||||||
*.plg
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
cmake_minimum_required(VERSION 2.8)
|
||||||
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
|
set(CMAKE_C_STANDARD 99)
|
||||||
|
|
||||||
|
project("png")
|
||||||
|
|
||||||
|
add_library(png STATIC
|
||||||
|
png.c
|
||||||
|
pngerror.c
|
||||||
|
pngget.c
|
||||||
|
pngmem.c
|
||||||
|
pngpread.c
|
||||||
|
pngread.c
|
||||||
|
pngrio.c
|
||||||
|
pngrtran.c
|
||||||
|
pngrutil.c
|
||||||
|
pngset.c
|
||||||
|
pngtest.c
|
||||||
|
pngtrans.c
|
||||||
|
pngwio.c
|
||||||
|
pngwrite.c
|
||||||
|
pngwtran.c
|
||||||
|
pngwutil.c)
|
||||||
|
|
||||||
|
add_definitions(-DANDROID)
|
||||||
|
|
||||||
|
target_link_libraries(png)
|
|
@ -0,0 +1,12 @@
|
||||||
|
cmake_minimum_required(VERSION 2.8)
|
||||||
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
|
set(CMAKE_C_STANDARD 99)
|
||||||
|
|
||||||
|
project("Project64-input-android")
|
||||||
|
|
||||||
|
add_library(Project64-input-android SHARED
|
||||||
|
Main.cpp)
|
||||||
|
|
||||||
|
add_definitions(-DANDROID)
|
||||||
|
|
||||||
|
target_link_libraries(Project64-input-android)
|
|
@ -0,0 +1,23 @@
|
||||||
|
cmake_minimum_required(VERSION 2.8)
|
||||||
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
|
set(CMAKE_C_STANDARD 99)
|
||||||
|
|
||||||
|
project("Project64-rsp-hle")
|
||||||
|
|
||||||
|
add_library(Project64-rsp-hle SHARED
|
||||||
|
alist.cpp
|
||||||
|
alist_audio.cpp
|
||||||
|
alist_naudio.cpp
|
||||||
|
alist_nead.cpp
|
||||||
|
audio.cpp
|
||||||
|
cicx105.cpp
|
||||||
|
hle.cpp
|
||||||
|
jpeg.cpp
|
||||||
|
main.cpp
|
||||||
|
mem.cpp
|
||||||
|
mp3.cpp
|
||||||
|
musyx.cpp)
|
||||||
|
|
||||||
|
add_definitions(-DANDROID)
|
||||||
|
|
||||||
|
target_link_libraries(Project64-rsp-hle)
|
|
@ -0,0 +1,19 @@
|
||||||
|
cmake_minimum_required(VERSION 2.8)
|
||||||
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
|
set(CMAKE_C_STANDARD 99)
|
||||||
|
|
||||||
|
project("Project64-audio-android")
|
||||||
|
include_directories(..)
|
||||||
|
|
||||||
|
add_library(Project64-audio-android SHARED
|
||||||
|
Driver/OpenSLES.cpp
|
||||||
|
Driver/SoundBase.cpp
|
||||||
|
AudioMain.cpp
|
||||||
|
AudioSettings.cpp
|
||||||
|
trace.cpp)
|
||||||
|
|
||||||
|
add_definitions(-DANDROID)
|
||||||
|
|
||||||
|
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../Common ${CMAKE_CURRENT_BINARY_DIR}/Common)
|
||||||
|
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../Settings ${CMAKE_CURRENT_BINARY_DIR}/Settings)
|
||||||
|
target_link_libraries(Project64-audio-android Common settings log OpenSLES)
|
|
@ -0,0 +1,76 @@
|
||||||
|
cmake_minimum_required(VERSION 2.8)
|
||||||
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
|
set(CMAKE_C_STANDARD 99)
|
||||||
|
|
||||||
|
project("Project64-video")
|
||||||
|
include_directories(..)
|
||||||
|
include_directories(../3rdParty)
|
||||||
|
include_directories(./Renderer/inc)
|
||||||
|
|
||||||
|
add_library(Project64-video SHARED
|
||||||
|
3dmath.cpp
|
||||||
|
Android.cpp
|
||||||
|
Combine.cpp
|
||||||
|
Config.cpp
|
||||||
|
CRC.cpp
|
||||||
|
Debugger.cpp
|
||||||
|
DepthBufferRender.cpp
|
||||||
|
F3DTEXA.cpp
|
||||||
|
FBtoScreen.cpp
|
||||||
|
Main.cpp
|
||||||
|
rdp.cpp
|
||||||
|
ScreenResolution.cpp
|
||||||
|
Settings.cpp
|
||||||
|
TexBuffer.cpp
|
||||||
|
TexCache.cpp
|
||||||
|
trace.cpp
|
||||||
|
turbo3D.cpp
|
||||||
|
ucode.cpp
|
||||||
|
ucode00.cpp
|
||||||
|
ucode01.cpp
|
||||||
|
ucode02.cpp
|
||||||
|
ucode03.cpp
|
||||||
|
ucode04.cpp
|
||||||
|
ucode05.cpp
|
||||||
|
ucode06.cpp
|
||||||
|
ucode07.cpp
|
||||||
|
ucode08.cpp
|
||||||
|
ucode09.cpp
|
||||||
|
ucode09rdp.cpp
|
||||||
|
ucodeFB.cpp
|
||||||
|
Util.cpp
|
||||||
|
Ext_TxFilter.cpp
|
||||||
|
Renderer/OGLEScombiner.cpp
|
||||||
|
Renderer/OGLESgeometry.cpp
|
||||||
|
Renderer/OGLESglitchmain.cpp
|
||||||
|
Renderer/OGLEStextures.cpp
|
||||||
|
Renderer/OGLESwrappers.cpp
|
||||||
|
Renderer/Renderer.cpp
|
||||||
|
TextureEnhancer/TxFilterExport.cpp
|
||||||
|
TextureEnhancer/TxFilter.cpp
|
||||||
|
TextureEnhancer/TxCache.cpp
|
||||||
|
TextureEnhancer/TxTexCache.cpp
|
||||||
|
TextureEnhancer/TxHiResCache.cpp
|
||||||
|
TextureEnhancer/TxQuantize.cpp
|
||||||
|
TextureEnhancer/TxUtil.cpp
|
||||||
|
TextureEnhancer/TextureFilters.cpp
|
||||||
|
TextureEnhancer/TextureFilters_2xsai.cpp
|
||||||
|
TextureEnhancer/TextureFilters_hq2x.cpp
|
||||||
|
TextureEnhancer/TextureFilters_hq4x.cpp
|
||||||
|
TextureEnhancer/TxImage.cpp
|
||||||
|
TextureEnhancer/TxReSample.cpp
|
||||||
|
TextureEnhancer/TxDbg.cpp
|
||||||
|
TextureEnhancer/tc-1.1+/fxt1.c
|
||||||
|
TextureEnhancer/tc-1.1+/dxtn.c
|
||||||
|
TextureEnhancer/tc-1.1+/wrapper.c
|
||||||
|
TextureEnhancer/tc-1.1+/texstore.c)
|
||||||
|
|
||||||
|
add_definitions(-DANDROID)
|
||||||
|
add_definitions(-DNOSSE)
|
||||||
|
add_definitions(-DUSE_GLES)
|
||||||
|
|
||||||
|
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty/png ${CMAKE_CURRENT_BINARY_DIR}/3rdParty/png)
|
||||||
|
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty/zlib ${CMAKE_CURRENT_BINARY_DIR}/3rdParty/zlib)
|
||||||
|
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../Common ${CMAKE_CURRENT_BINARY_DIR}/Common)
|
||||||
|
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../Settings ${CMAKE_CURRENT_BINARY_DIR}/Settings)
|
||||||
|
target_link_libraries(Project64-video png zlib Common settings GLESv2 log)
|
|
@ -0,0 +1,12 @@
|
||||||
|
cmake_minimum_required(VERSION 2.8)
|
||||||
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
|
set(CMAKE_C_STANDARD 99)
|
||||||
|
|
||||||
|
project("settings")
|
||||||
|
|
||||||
|
add_library(settings STATIC
|
||||||
|
Settings.cpp)
|
||||||
|
|
||||||
|
add_definitions(-DANDROID)
|
||||||
|
|
||||||
|
target_link_libraries(settings)
|
Loading…
Reference in New Issue