[[Glide64] Add ability to set screen resolution
This commit is contained in:
parent
bd7eaf3be4
commit
b1d8db2c96
|
@ -22,6 +22,7 @@ LOCAL_SRC_FILES := \
|
||||||
$(SRCDIR)/Glitch64/OGLEStextures.cpp \
|
$(SRCDIR)/Glitch64/OGLEStextures.cpp \
|
||||||
$(SRCDIR)/Glitch64/OGLESwrappers.cpp \
|
$(SRCDIR)/Glitch64/OGLESwrappers.cpp \
|
||||||
$(SRCDIR)/Glide64/3dmath.cpp \
|
$(SRCDIR)/Glide64/3dmath.cpp \
|
||||||
|
$(SRCDIR)/Glide64/Android.cpp \
|
||||||
$(SRCDIR)/Glide64/Combine.cpp \
|
$(SRCDIR)/Glide64/Combine.cpp \
|
||||||
$(SRCDIR)/Glide64/Config.cpp \
|
$(SRCDIR)/Glide64/Config.cpp \
|
||||||
$(SRCDIR)/Glide64/CRC.cpp \
|
$(SRCDIR)/Glide64/CRC.cpp \
|
||||||
|
|
|
@ -100,9 +100,11 @@
|
||||||
<string name="Advanced">Advanced</string>
|
<string name="Advanced">Advanced</string>
|
||||||
<string name="CpuUsage_title">CPU Usage</string>
|
<string name="CpuUsage_title">CPU Usage</string>
|
||||||
<string name="CpuUsage_summary">Show the cpu used by different components</string>
|
<string name="CpuUsage_summary">Show the cpu used by different components</string>
|
||||||
<string name="DisplaySpeed_title">Display Speed</string>
|
|
||||||
<string name="LimitFPS_summary">Limit the max speed executed</string>
|
<string name="LimitFPS_summary">Limit the max speed executed</string>
|
||||||
<string name="LimitFPS_title">Limit FPS</string>
|
<string name="LimitFPS_title">Limit FPS</string>
|
||||||
|
<string name="screenResolution_title">Rendered Resolution</string>
|
||||||
|
<string name="screenResolution_summary">should show value???</string>
|
||||||
|
<string name="DisplaySpeed_title">Display Speed</string>
|
||||||
<string name="DisplaySpeed_summary">Show the speed of the emulation</string>
|
<string name="DisplaySpeed_summary">Show the speed of the emulation</string>
|
||||||
<string name="DisplaySpeedDisplay">Display Speed Display</string>
|
<string name="DisplaySpeedDisplay">Display Speed Display</string>
|
||||||
<string name="DListPerSecond">Display lists per second</string>
|
<string name="DListPerSecond">Display lists per second</string>
|
||||||
|
|
|
@ -1,6 +1,12 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<emu.project64.settings.TwoLinesListPreference
|
||||||
|
android:defaultValue="0"
|
||||||
|
android:key="video_screenResolution"
|
||||||
|
android:title="@string/screenResolution_title"
|
||||||
|
android:summary="@string/screenResolution_summary"
|
||||||
|
android:dialogTitle="@string/screenResolution_title" />
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
android:key="Debugger_DisplaySpeed"
|
android:key="Debugger_DisplaySpeed"
|
||||||
android:summary="@string/DisplaySpeed_summary"
|
android:summary="@string/DisplaySpeed_summary"
|
||||||
|
|
|
@ -23,10 +23,15 @@ import emu.project64.util.Strings;
|
||||||
import emu.project64.util.FileUtil;
|
import emu.project64.util.FileUtil;
|
||||||
import emu.project64.util.Utility;
|
import emu.project64.util.Utility;
|
||||||
import tv.ouya.console.api.OuyaFacade;
|
import tv.ouya.console.api.OuyaFacade;
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.graphics.Point;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
|
import android.util.DisplayMetrics;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
|
||||||
|
@SuppressLint("NewApi")
|
||||||
public class AndroidDevice
|
public class AndroidDevice
|
||||||
{
|
{
|
||||||
/** True if device is running Gingerbread or later (9 - Android 2.3.x) */
|
/** True if device is running Gingerbread or later (9 - Android 2.3.x) */
|
||||||
|
@ -59,12 +64,38 @@ public class AndroidDevice
|
||||||
public static final boolean IS_ACTION_BAR_AVAILABLE = AndroidDevice.IS_HONEYCOMB && !AndroidDevice.IS_OUYA_HARDWARE;
|
public static final boolean IS_ACTION_BAR_AVAILABLE = AndroidDevice.IS_HONEYCOMB && !AndroidDevice.IS_OUYA_HARDWARE;
|
||||||
|
|
||||||
final static boolean isTv;
|
final static boolean isTv;
|
||||||
|
public final static int nativeWidth, nativeWidthOriginal;
|
||||||
|
public final static int nativeHeight, nativeHeightOriginal;
|
||||||
|
|
||||||
public static boolean MapVolumeKeys = false;
|
public static boolean MapVolumeKeys = false;
|
||||||
|
|
||||||
static
|
static
|
||||||
{
|
{
|
||||||
isTv = Project64Application.getAppContext().getPackageManager().hasSystemFeature("android.software.leanback");
|
isTv = Project64Application.getAppContext().getPackageManager().hasSystemFeature("android.software.leanback");
|
||||||
|
DisplayMetrics metrics = Project64Application.getAppContext().getResources().getDisplayMetrics();
|
||||||
|
int _nativeWidth = metrics.widthPixels < metrics.heightPixels ? metrics.heightPixels : metrics.widthPixels;
|
||||||
|
int _nativeHeight = metrics.widthPixels < metrics.heightPixels ? metrics.widthPixels: metrics.heightPixels;
|
||||||
|
|
||||||
|
if (IS_KITKAT)
|
||||||
|
{
|
||||||
|
Point size = new Point();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
((WindowManager) Project64Application.getAppContext().getSystemService(Project64Application.getAppContext().WINDOW_SERVICE)).getDefaultDisplay().getRealSize(size);
|
||||||
|
_nativeWidth = size.x < size.y ? size.y : size.x;
|
||||||
|
_nativeHeight = size.x < size.y ? size.x: size.y;
|
||||||
|
}
|
||||||
|
catch (NoSuchMethodError e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nativeWidth = _nativeWidth;
|
||||||
|
nativeHeight = _nativeHeight;
|
||||||
|
|
||||||
|
final float aspect = 0.75f;
|
||||||
|
final boolean isLetterboxed = ( (float) nativeHeight / (float) nativeWidth ) > aspect;
|
||||||
|
nativeWidthOriginal = isLetterboxed ? nativeWidth : Math.round( nativeHeight / aspect );
|
||||||
|
nativeHeightOriginal = isLetterboxed ? Math.round( nativeWidth * aspect ) : nativeHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isAndroidTv()
|
public static boolean isAndroidTv()
|
||||||
|
|
|
@ -21,6 +21,7 @@ import java.util.ArrayList;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import emu.project64.AndroidDevice;
|
import emu.project64.AndroidDevice;
|
||||||
|
import emu.project64.Project64Application;
|
||||||
import emu.project64.R;
|
import emu.project64.R;
|
||||||
import emu.project64.hack.MogaHack;
|
import emu.project64.hack.MogaHack;
|
||||||
import emu.project64.input.AbstractController;
|
import emu.project64.input.AbstractController;
|
||||||
|
@ -34,10 +35,12 @@ import emu.project64.input.provider.KeyProvider;
|
||||||
import emu.project64.input.provider.KeyProvider.ImeFormula;
|
import emu.project64.input.provider.KeyProvider.ImeFormula;
|
||||||
import emu.project64.input.provider.MogaProvider;
|
import emu.project64.input.provider.MogaProvider;
|
||||||
import emu.project64.jni.NativeExports;
|
import emu.project64.jni.NativeExports;
|
||||||
|
import emu.project64.jni.NativeVideo;
|
||||||
import emu.project64.jni.NativeXperiaTouchpad;
|
import emu.project64.jni.NativeXperiaTouchpad;
|
||||||
import emu.project64.jni.SettingsID;
|
import emu.project64.jni.SettingsID;
|
||||||
import emu.project64.jni.SystemEvent;
|
import emu.project64.jni.SystemEvent;
|
||||||
import emu.project64.jni.UISettingID;
|
import emu.project64.jni.UISettingID;
|
||||||
|
import emu.project64.jni.VideoSettingID;
|
||||||
import emu.project64.persistent.ConfigFile;
|
import emu.project64.persistent.ConfigFile;
|
||||||
import emu.project64.persistent.ConfigFile.ConfigSection;
|
import emu.project64.persistent.ConfigFile.ConfigSection;
|
||||||
import emu.project64.profile.Profile;
|
import emu.project64.profile.Profile;
|
||||||
|
@ -52,11 +55,15 @@ import android.graphics.drawable.ColorDrawable;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Vibrator;
|
import android.os.Vibrator;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.view.Display;
|
||||||
|
import android.view.Gravity;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.SurfaceHolder;
|
import android.view.SurfaceHolder;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.Window;
|
import android.view.Window;
|
||||||
|
import android.view.WindowManager;
|
||||||
import android.view.WindowManager.LayoutParams;
|
import android.view.WindowManager.LayoutParams;
|
||||||
|
import android.widget.FrameLayout;
|
||||||
|
|
||||||
public class GameLifecycleHandler implements View.OnKeyListener, SurfaceHolder.Callback, GameSurface.SurfaceInfo
|
public class GameLifecycleHandler implements View.OnKeyListener, SurfaceHolder.Callback, GameSurface.SurfaceInfo
|
||||||
{
|
{
|
||||||
|
@ -107,7 +114,6 @@ public class GameLifecycleHandler implements View.OnKeyListener, SurfaceHolder.C
|
||||||
// mMogaController.init();
|
// mMogaController.init();
|
||||||
MogaHack.init(mMogaController, mActivity);
|
MogaHack.init(mMogaController, mActivity);
|
||||||
|
|
||||||
|
|
||||||
// For Honeycomb, let the action bar overlay the rendered view (rather
|
// For Honeycomb, let the action bar overlay the rendered view (rather
|
||||||
// than squeezing it)
|
// than squeezing it)
|
||||||
// For earlier APIs, remove the title bar to yield more space
|
// For earlier APIs, remove the title bar to yield more space
|
||||||
|
@ -143,6 +149,21 @@ public class GameLifecycleHandler implements View.OnKeyListener, SurfaceHolder.C
|
||||||
mSurface = (GameSurface) mActivity.findViewById(R.id.gameSurface);
|
mSurface = (GameSurface) mActivity.findViewById(R.id.gameSurface);
|
||||||
mOverlay = (GameOverlay) mActivity.findViewById(R.id.gameOverlay);
|
mOverlay = (GameOverlay) mActivity.findViewById(R.id.gameOverlay);
|
||||||
|
|
||||||
|
float widthRatio = (float)AndroidDevice.nativeWidth/(float)AndroidDevice.nativeWidthOriginal;
|
||||||
|
float heightRatio = (float)AndroidDevice.nativeHeight/(float)AndroidDevice.nativeHeightOriginal;
|
||||||
|
int ScreenRes = NativeExports.SettingsLoadDword(SettingsID.FirstGfxSettings.getValue() + VideoSettingID.Set_Resolution.getValue());
|
||||||
|
|
||||||
|
int videoRenderWidth = Math.round(NativeVideo.GetScreenResWidth(ScreenRes) * (ScreenRes == 0 ? 1 : widthRatio));
|
||||||
|
int videoRenderHeight = Math.round(NativeVideo.GetScreenResHeight(ScreenRes) * (ScreenRes == 0 ? 1 : heightRatio));
|
||||||
|
|
||||||
|
// Update screen res
|
||||||
|
mSurface.getHolder().setFixedSize(videoRenderWidth, videoRenderHeight);
|
||||||
|
final FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) mSurface.getLayoutParams();
|
||||||
|
params.width = AndroidDevice.nativeWidth;
|
||||||
|
params.height = AndroidDevice.nativeHeight;
|
||||||
|
params.gravity = Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL;
|
||||||
|
mSurface.setLayoutParams(params);
|
||||||
|
|
||||||
// Listen to game surface events (created, changed, destroyed)
|
// Listen to game surface events (created, changed, destroyed)
|
||||||
mSurface.getHolder().addCallback(this);
|
mSurface.getHolder().addCallback(this);
|
||||||
mSurface.createGLContext((ActivityManager) mActivity.getSystemService(Context.ACTIVITY_SERVICE));
|
mSurface.createGLContext((ActivityManager) mActivity.getSystemService(Context.ACTIVITY_SERVICE));
|
||||||
|
@ -162,7 +183,8 @@ public class GameLifecycleHandler implements View.OnKeyListener, SurfaceHolder.C
|
||||||
View inputSource = mIsXperiaPlay ? new NativeXperiaTouchpad(mActivity) : mOverlay;
|
View inputSource = mIsXperiaPlay ? new NativeXperiaTouchpad(mActivity) : mOverlay;
|
||||||
initControllers(inputSource);
|
initControllers(inputSource);
|
||||||
|
|
||||||
// Override the peripheral controllers' key provider, to add some extra functionality
|
// Override the peripheral controllers' key provider, to add some extra
|
||||||
|
// functionality
|
||||||
inputSource.setOnKeyListener(this);
|
inputSource.setOnKeyListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -340,7 +362,9 @@ public class GameLifecycleHandler implements View.OnKeyListener, SurfaceHolder.C
|
||||||
private void CreateTouchScreenControls()
|
private void CreateTouchScreenControls()
|
||||||
{
|
{
|
||||||
boolean isTouchscreenAnimated = false; // mGlobalPrefs.isTouchscreenAnimated
|
boolean isTouchscreenAnimated = false; // mGlobalPrefs.isTouchscreenAnimated
|
||||||
boolean isTouchscreenHidden = false; //!isTouchscreenEnabled || globalPrefs.touchscreenTransparency == 0;
|
boolean isTouchscreenHidden = false; // !isTouchscreenEnabled ||
|
||||||
|
// globalPrefs.touchscreenTransparency
|
||||||
|
// == 0;
|
||||||
String profilesDir = AndroidDevice.PACKAGE_DIRECTORY + "/profiles";
|
String profilesDir = AndroidDevice.PACKAGE_DIRECTORY + "/profiles";
|
||||||
String touchscreenProfiles_cfg = profilesDir + "/touchscreen.cfg";
|
String touchscreenProfiles_cfg = profilesDir + "/touchscreen.cfg";
|
||||||
ConfigFile touchscreenConfigFile = new ConfigFile(touchscreenProfiles_cfg);
|
ConfigFile touchscreenConfigFile = new ConfigFile(touchscreenProfiles_cfg);
|
||||||
|
@ -355,7 +379,8 @@ public class GameLifecycleHandler implements View.OnKeyListener, SurfaceHolder.C
|
||||||
String touchscreenSkinsDir = AndroidDevice.PACKAGE_DIRECTORY + "/skins/touchscreen";
|
String touchscreenSkinsDir = AndroidDevice.PACKAGE_DIRECTORY + "/skins/touchscreen";
|
||||||
String touchscreenSkin = touchscreenSkinsDir + "/Outline";
|
String touchscreenSkin = touchscreenSkinsDir + "/Outline";
|
||||||
|
|
||||||
// The touch map and overlay are needed to display frame rate and/or controls
|
// The touch map and overlay are needed to display frame rate and/or
|
||||||
|
// controls
|
||||||
mTouchscreenMap = new VisibleTouchMap(mActivity.getResources());
|
mTouchscreenMap = new VisibleTouchMap(mActivity.getResources());
|
||||||
mTouchscreenMap.load(touchscreenSkin, touchscreenProfile, isTouchscreenAnimated, mtouchscreenScale, touchscreenTransparency);
|
mTouchscreenMap.load(touchscreenSkin, touchscreenProfile, isTouchscreenAnimated, mtouchscreenScale, touchscreenTransparency);
|
||||||
mOverlay.initialize(mTouchscreenMap, !isTouchscreenHidden, isTouchscreenAnimated);
|
mOverlay.initialize(mTouchscreenMap, !isTouchscreenHidden, isTouchscreenAnimated);
|
||||||
|
@ -384,14 +409,14 @@ public class GameLifecycleHandler implements View.OnKeyListener, SurfaceHolder.C
|
||||||
Set<Integer> autoHoldableButtons = null;
|
Set<Integer> autoHoldableButtons = null;
|
||||||
|
|
||||||
// Create the touchscreen controller
|
// Create the touchscreen controller
|
||||||
TouchController touchscreenController = new TouchController( mTouchscreenMap,
|
TouchController touchscreenController = new TouchController(mTouchscreenMap, inputSource, mOverlay, vibrator,
|
||||||
inputSource, mOverlay, vibrator, touchscreenAutoHold,
|
touchscreenAutoHold, isTouchscreenFeedbackEnabled, autoHoldableButtons);
|
||||||
isTouchscreenFeedbackEnabled, autoHoldableButtons );
|
|
||||||
mControllers.add(touchscreenController);
|
mControllers.add(touchscreenController);
|
||||||
|
|
||||||
// Create the input providers shared among all peripheral controllers
|
// Create the input providers shared among all peripheral controllers
|
||||||
String profile_name = NativeExports.UISettingsLoadString(UISettingID.Controller_CurrentProfile.getValue());
|
String profile_name = NativeExports.UISettingsLoadString(UISettingID.Controller_CurrentProfile.getValue());
|
||||||
ConfigFile ControllerConfigFile = new ConfigFile(NativeExports.UISettingsLoadString(UISettingID.Controller_ConfigFile.getValue()));
|
ConfigFile ControllerConfigFile = new ConfigFile(
|
||||||
|
NativeExports.UISettingsLoadString(UISettingID.Controller_ConfigFile.getValue()));
|
||||||
ConfigSection section = ControllerConfigFile.get(profile_name);
|
ConfigSection section = ControllerConfigFile.get(profile_name);
|
||||||
if (section != null)
|
if (section != null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -589,6 +589,9 @@ public enum LanguageStringID
|
||||||
ANDROID_MENU_DEBUGGINGOPTIONS(3111),
|
ANDROID_MENU_DEBUGGINGOPTIONS(3111),
|
||||||
ANDROID_MENU_RESETFUNCTIONTIMES(3112),
|
ANDROID_MENU_RESETFUNCTIONTIMES(3112),
|
||||||
ANDROID_MENU_DUMPFUNCTIONTIMES(3113),
|
ANDROID_MENU_DUMPFUNCTIONTIMES(3113),
|
||||||
|
|
||||||
|
//Video plugin
|
||||||
|
ANDROID_VIDEO_NATIVE_RES(3200),
|
||||||
;
|
;
|
||||||
|
|
||||||
private int value;
|
private int value;
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
/****************************************************************************
|
||||||
|
* *
|
||||||
|
* Project 64 - A Nintendo 64 emulator. *
|
||||||
|
* http://www.pj64-emu.com/ *
|
||||||
|
* Copyright (C) 2012 Project64. All rights reserved. *
|
||||||
|
* *
|
||||||
|
* License: *
|
||||||
|
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
|
||||||
|
* *
|
||||||
|
****************************************************************************/
|
||||||
|
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
|
||||||
|
{
|
||||||
|
static
|
||||||
|
{
|
||||||
|
System.loadLibrary( "Project64-gfx-glide64" );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static native int getResolutionCount();
|
||||||
|
public static native String getResolutionName(int Index);
|
||||||
|
public static native int GetScreenResWidth(int Index);
|
||||||
|
public static native int GetScreenResHeight(int Index);
|
||||||
|
}
|
|
@ -0,0 +1,63 @@
|
||||||
|
/****************************************************************************
|
||||||
|
* *
|
||||||
|
* Project 64 - A Nintendo 64 emulator. *
|
||||||
|
* http://www.pj64-emu.com/ *
|
||||||
|
* Copyright (C) 2012 Project64. All rights reserved. *
|
||||||
|
* *
|
||||||
|
* License: *
|
||||||
|
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
|
||||||
|
* *
|
||||||
|
****************************************************************************/
|
||||||
|
package emu.project64.jni;
|
||||||
|
|
||||||
|
public enum VideoSettingID
|
||||||
|
{
|
||||||
|
// General Settings
|
||||||
|
Set_vsync, Set_Rotate, Set_texenh_options, Set_wrpVRAM,
|
||||||
|
Set_wrpFBO, Set_wrpAnisotropic, Set_autodetect_ucode, Set_ucode, Set_wireframe,
|
||||||
|
Set_wfmode, Set_unk_as_red, Set_unk_clear, Set_ghq_fltr,
|
||||||
|
Set_ghq_cmpr, Set_ghq_enht, Set_ghq_hirs, Set_ghq_enht_cmpr, Set_ghq_enht_tile,
|
||||||
|
Set_ghq_enht_f16bpp, Set_ghq_enht_gz, Set_ghq_enht_nobg, Set_ghq_hirs_cmpr,
|
||||||
|
Set_ghq_hirs_tile, Set_ghq_hirs_f16bpp, Set_ghq_hirs_gz, Set_ghq_hirs_altcrc,
|
||||||
|
Set_ghq_cache_save, Set_ghq_cache_size, Set_ghq_hirs_let_texartists_fly,
|
||||||
|
Set_ghq_hirs_dump, Set_Resolution,
|
||||||
|
|
||||||
|
// Default Game Settings
|
||||||
|
Set_optimize_texrect_default, Set_filtering_default, Set_lodmode_default,
|
||||||
|
Set_fog_default, Set_buff_clear_default, Set_swapmode_default,
|
||||||
|
Set_aspect_default, Set_fb_smart_default, Set_fb_hires_default,
|
||||||
|
Set_fb_read_always_default, Set_read_back_to_screen_default, Set_detect_cpu_write_default,
|
||||||
|
Set_fb_get_info_default, Set_fb_render_default,
|
||||||
|
|
||||||
|
//Game Settings
|
||||||
|
Set_alt_tex_size, Set_use_sts1_only, Set_force_calc_sphere, Set_correct_viewport,
|
||||||
|
Set_increase_texrect_edge, Set_decrease_fillrect_edge, Set_texture_correction,
|
||||||
|
Set_pal230, Set_stipple_mode, Set_stipple_pattern, Set_force_microcheck, Set_force_quad3d,
|
||||||
|
Set_clip_zmin, Set_clip_zmax, Set_fast_crc, Set_adjust_aspect, Set_zmode_compare_less,
|
||||||
|
Set_old_style_adither, Set_n64_z_scale, Set_optimize_texrect, Set_ignore_aux_copy,
|
||||||
|
Set_hires_buf_clear, Set_fb_read_alpha, Set_useless_is_useless, Set_fb_crc_mode,
|
||||||
|
Set_filtering, Set_fog, Set_buff_clear, Set_swapmode, Set_aspect, Set_lodmode,
|
||||||
|
Set_fb_smart, Set_fb_hires, Set_fb_read_always, Set_read_back_to_screen,
|
||||||
|
Set_detect_cpu_write, Set_fb_get_info, Set_fb_render,
|
||||||
|
|
||||||
|
//RDB Setting
|
||||||
|
Set_ucodeLookup,
|
||||||
|
;
|
||||||
|
|
||||||
|
private int value;
|
||||||
|
|
||||||
|
public int getValue()
|
||||||
|
{
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
private static final class StaticFields
|
||||||
|
{
|
||||||
|
public static int Counter = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
private VideoSettingID()
|
||||||
|
{
|
||||||
|
this.value = StaticFields.Counter;
|
||||||
|
StaticFields.Counter += 1;
|
||||||
|
}
|
||||||
|
}
|
|
@ -31,27 +31,5 @@ public class GamepadScreenFragment extends BaseSettingsFragment
|
||||||
public void onCreatePreferences(Bundle bundle, String s)
|
public void onCreatePreferences(Bundle bundle, String s)
|
||||||
{
|
{
|
||||||
super.onCreatePreferences(bundle, s);
|
super.onCreatePreferences(bundle, s);
|
||||||
|
|
||||||
/*String profilesDir = AndroidDevice.PACKAGE_DIRECTORY + "/profiles";
|
|
||||||
String touchscreenProfiles_cfg = profilesDir + "/touchscreen.cfg";
|
|
||||||
ConfigFile touchscreenProfiles = new ConfigFile( touchscreenProfiles_cfg );
|
|
||||||
Set<String> layoutsKeySet = touchscreenProfiles.keySet();
|
|
||||||
String[] layouts = layoutsKeySet.toArray(new String[layoutsKeySet.size()]);
|
|
||||||
|
|
||||||
CharSequence[] entries = new CharSequence[layouts.length];
|
|
||||||
String[] entryValues = new String[layouts.length];
|
|
||||||
String[] entrySubtitles = new String[layouts.length];
|
|
||||||
|
|
||||||
for( int i = 0; i < layouts.length; i++ )
|
|
||||||
{
|
|
||||||
entries[i] = layouts[i];
|
|
||||||
entryValues[i] = layouts[i];
|
|
||||||
entrySubtitles[i] = touchscreenProfiles.get(layouts[i]).get("comment");
|
|
||||||
}
|
|
||||||
|
|
||||||
final TwoLinesListPreference listPreference = (TwoLinesListPreference) findPreference("touchscreenLayout");
|
|
||||||
listPreference.setEntries(entries);
|
|
||||||
listPreference.setEntryValues(entryValues);
|
|
||||||
listPreference.setEntriesSubtitles(entrySubtitles);*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ import emu.project64.jni.NativeExports;
|
||||||
import emu.project64.jni.SettingsID;
|
import emu.project64.jni.SettingsID;
|
||||||
import emu.project64.jni.SystemEvent;
|
import emu.project64.jni.SystemEvent;
|
||||||
import emu.project64.jni.UISettingID;
|
import emu.project64.jni.UISettingID;
|
||||||
|
import emu.project64.jni.VideoSettingID;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
|
@ -92,6 +93,7 @@ public class SettingsActivity extends AppCompatActivity implements SharedPrefere
|
||||||
.putString("Debugger_TraceExceptionHandler",String.valueOf(NativeExports.SettingsLoadDword(SettingsID.Debugger_TraceExceptionHandler.getValue())))
|
.putString("Debugger_TraceExceptionHandler",String.valueOf(NativeExports.SettingsLoadDword(SettingsID.Debugger_TraceExceptionHandler.getValue())))
|
||||||
.putString("Debugger_TraceAudioInitShutdown",String.valueOf(NativeExports.SettingsLoadDword(SettingsID.FirstAudioSettings.getValue() + AudioSettingID.Logging_LogAudioInitShutdown.getValue())))
|
.putString("Debugger_TraceAudioInitShutdown",String.valueOf(NativeExports.SettingsLoadDword(SettingsID.FirstAudioSettings.getValue() + AudioSettingID.Logging_LogAudioInitShutdown.getValue())))
|
||||||
.putString("Debugger_TraceAudioAudioInterface",String.valueOf(NativeExports.SettingsLoadDword(SettingsID.FirstAudioSettings.getValue() + AudioSettingID.Logging_LogAudioInterface.getValue())))
|
.putString("Debugger_TraceAudioAudioInterface",String.valueOf(NativeExports.SettingsLoadDword(SettingsID.FirstAudioSettings.getValue() + AudioSettingID.Logging_LogAudioInterface.getValue())))
|
||||||
|
.putString("video_screenResolution",String.valueOf(NativeExports.SettingsLoadDword(SettingsID.FirstGfxSettings.getValue() + VideoSettingID.Set_Resolution.getValue())))
|
||||||
.putInt("MaxRomsRemembered",NativeExports.UISettingsLoadDword(UISettingID.File_RecentGameFileCount.getValue()))
|
.putInt("MaxRomsRemembered",NativeExports.UISettingsLoadDword(UISettingID.File_RecentGameFileCount.getValue()))
|
||||||
.apply();
|
.apply();
|
||||||
|
|
||||||
|
@ -175,6 +177,7 @@ public class SettingsActivity extends AppCompatActivity implements SharedPrefere
|
||||||
else if (key.equals("Debugger_TraceExceptionHandler")) { NativeExports.SettingsSaveDword(SettingsID.Debugger_TraceExceptionHandler.getValue(), Integer.valueOf(sharedPreferences.getString(key, "1"))); }
|
else if (key.equals("Debugger_TraceExceptionHandler")) { NativeExports.SettingsSaveDword(SettingsID.Debugger_TraceExceptionHandler.getValue(), Integer.valueOf(sharedPreferences.getString(key, "1"))); }
|
||||||
else if (key.equals("Debugger_TraceAudioInitShutdown")) { NativeExports.SettingsSaveDword(SettingsID.FirstAudioSettings.getValue() + AudioSettingID.Logging_LogAudioInitShutdown.getValue(), Integer.valueOf(sharedPreferences.getString(key, "1"))); }
|
else if (key.equals("Debugger_TraceAudioInitShutdown")) { NativeExports.SettingsSaveDword(SettingsID.FirstAudioSettings.getValue() + AudioSettingID.Logging_LogAudioInitShutdown.getValue(), Integer.valueOf(sharedPreferences.getString(key, "1"))); }
|
||||||
else if (key.equals("Debugger_TraceAudioAudioInterface")) { NativeExports.SettingsSaveDword(SettingsID.FirstAudioSettings.getValue() + AudioSettingID.Logging_LogAudioInterface.getValue(), Integer.valueOf(sharedPreferences.getString(key, "1"))); }
|
else if (key.equals("Debugger_TraceAudioAudioInterface")) { NativeExports.SettingsSaveDword(SettingsID.FirstAudioSettings.getValue() + AudioSettingID.Logging_LogAudioInterface.getValue(), Integer.valueOf(sharedPreferences.getString(key, "1"))); }
|
||||||
|
else if (key.equals("video_screenResolution")) { NativeExports.SettingsSaveDword(SettingsID.FirstGfxSettings.getValue() + VideoSettingID.Set_Resolution.getValue(), Integer.valueOf(sharedPreferences.getString(key, "1"))); }
|
||||||
else if (key.equals("MaxRomsRemembered")) { NativeExports.UISettingsSaveDword(UISettingID.File_RecentGameFileCount.getValue(), sharedPreferences.getInt(key, 10)); }
|
else if (key.equals("MaxRomsRemembered")) { NativeExports.UISettingsSaveDword(UISettingID.File_RecentGameFileCount.getValue(), sharedPreferences.getInt(key, 10)); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,18 +32,15 @@ public class TwoLinesListPreferenceDialogFragmentCompat extends PreferenceDialog
|
||||||
return (TwoLinesListPreference)this.getPreference();
|
return (TwoLinesListPreference)this.getPreference();
|
||||||
}
|
}
|
||||||
|
|
||||||
class YourAdapter extends ArrayAdapter<String>
|
class TwoLinesListPreferenceAdapter extends ArrayAdapter<String>
|
||||||
{
|
{
|
||||||
public YourAdapter(Context context, String[] values)
|
public TwoLinesListPreferenceAdapter(Context context, String[] values)
|
||||||
{
|
{
|
||||||
super(context, R.layout.two_lines_list_preference_row, values);
|
super(context, R.layout.two_lines_list_preference_row, values);
|
||||||
}
|
}
|
||||||
|
|
||||||
class ViewHolder
|
class ViewHolder
|
||||||
{
|
{
|
||||||
TextView title;
|
|
||||||
TextView subTitle;
|
|
||||||
RadioButton radioBtn;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ViewHolder holder;
|
ViewHolder holder;
|
||||||
|
@ -52,33 +49,32 @@ public class TwoLinesListPreferenceDialogFragmentCompat extends PreferenceDialog
|
||||||
@Override
|
@Override
|
||||||
public View getView(int position, View convertView, ViewGroup parent)
|
public View getView(int position, View convertView, ViewGroup parent)
|
||||||
{
|
{
|
||||||
final LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
final TwoLinesListPreference preference = getTwoLinesListPreference();
|
||||||
if (convertView == null)
|
|
||||||
{
|
|
||||||
convertView = inflater.inflate(R.layout.two_lines_list_preference_row, null);
|
|
||||||
holder = new ViewHolder();
|
|
||||||
holder.title = (TextView) convertView.findViewById(R.id.two_lines_list_view_row_text);
|
|
||||||
holder.subTitle = (TextView) convertView.findViewById(R.id.two_lines_list_view_row_subtext);
|
|
||||||
holder.radioBtn = (RadioButton) convertView.findViewById(R.id.two_lines_list_view_row_radiobtn);
|
|
||||||
convertView.setTag(holder);
|
|
||||||
|
|
||||||
holder.title.setOnClickListener(listener);
|
final LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||||
holder.subTitle.setOnClickListener(listener);
|
convertView = inflater.inflate(R.layout.two_lines_list_preference_row, null);
|
||||||
holder.radioBtn.setOnClickListener(listener);
|
|
||||||
|
TextView title = (TextView) convertView.findViewById(R.id.two_lines_list_view_row_text);
|
||||||
|
title.setOnClickListener(listener);
|
||||||
|
title.setText(preference.getEntries()[position]);
|
||||||
|
title.setTag(position);
|
||||||
|
|
||||||
|
TextView subTitle = (TextView) convertView.findViewById(R.id.two_lines_list_view_row_subtext);
|
||||||
|
if (preference.getEntriesSubtitles()[position].length() == 0)
|
||||||
|
{
|
||||||
|
subTitle.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
holder = (ViewHolder) convertView.getTag();
|
subTitle.setOnClickListener(listener);
|
||||||
|
subTitle.setText(preference.getEntriesSubtitles()[position]);
|
||||||
|
subTitle.setTag(position);
|
||||||
}
|
}
|
||||||
final TwoLinesListPreference preference = getTwoLinesListPreference();
|
|
||||||
|
|
||||||
holder.title.setText(preference.getEntries()[position]);
|
RadioButton radioBtn = (RadioButton) convertView.findViewById(R.id.two_lines_list_view_row_radiobtn);
|
||||||
holder.title.setTag(position);
|
radioBtn.setOnClickListener(listener);
|
||||||
holder.subTitle.setText(preference.getEntriesSubtitles()[position]);
|
radioBtn.setChecked(preference.getValueIndex() == position);
|
||||||
holder.subTitle.setTag(position);
|
radioBtn.setTag(position);
|
||||||
|
|
||||||
holder.radioBtn.setChecked(preference.getValueIndex() == position);
|
|
||||||
holder.radioBtn.setTag(position);
|
|
||||||
|
|
||||||
return convertView;
|
return convertView;
|
||||||
}
|
}
|
||||||
|
@ -96,7 +92,7 @@ public class TwoLinesListPreferenceDialogFragmentCompat extends PreferenceDialog
|
||||||
values[i] = entries[i].toString();
|
values[i] = entries[i].toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
ListAdapter adapter = new YourAdapter(builder.getContext(), values);
|
ListAdapter adapter = new TwoLinesListPreferenceAdapter(builder.getContext(), values);
|
||||||
builder.setAdapter(adapter, new DialogInterface.OnClickListener()
|
builder.setAdapter(adapter, new DialogInterface.OnClickListener()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
|
@ -126,7 +122,7 @@ public class TwoLinesListPreferenceDialogFragmentCompat extends PreferenceDialog
|
||||||
{
|
{
|
||||||
final TwoLinesListPreference preference = getTwoLinesListPreference();
|
final TwoLinesListPreference preference = getTwoLinesListPreference();
|
||||||
int EntryIndex = (Integer) v.getTag();
|
int EntryIndex = (Integer) v.getTag();
|
||||||
preference.setValue(preference.getEntries()[EntryIndex].toString());
|
preference.setValue(preference.getEntryValues()[EntryIndex].toString());
|
||||||
TwoLinesListPreferenceDialogFragmentCompat.this.getDialog().dismiss();
|
TwoLinesListPreferenceDialogFragmentCompat.this.getDialog().dismiss();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,18 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
package emu.project64.settings;
|
package emu.project64.settings;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.graphics.Point;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.util.DisplayMetrics;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
import emu.project64.AndroidDevice;
|
||||||
import emu.project64.R;
|
import emu.project64.R;
|
||||||
|
import emu.project64.jni.LanguageStringID;
|
||||||
|
import emu.project64.jni.NativeVideo;
|
||||||
|
import emu.project64.util.Strings;
|
||||||
|
|
||||||
public class VideoFragment extends BaseSettingsFragment
|
public class VideoFragment extends BaseSettingsFragment
|
||||||
{
|
{
|
||||||
|
@ -25,4 +36,32 @@ public class VideoFragment extends BaseSettingsFragment
|
||||||
{
|
{
|
||||||
return R.string.video_screen_title;
|
return R.string.video_screen_title;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreatePreferences(Bundle bundle, String s)
|
||||||
|
{
|
||||||
|
super.onCreatePreferences(bundle, s);
|
||||||
|
|
||||||
|
int ResCount = NativeVideo.getResolutionCount();
|
||||||
|
CharSequence[] ResEntries = new CharSequence[ResCount];
|
||||||
|
String[] ResEntryValues = new String[ResCount];
|
||||||
|
String[] ResEntrySubtitles = new String[ResCount];
|
||||||
|
|
||||||
|
for( int i = 0; i < ResCount; i++ )
|
||||||
|
{
|
||||||
|
ResEntries[i] = NativeVideo.getResolutionName(i);
|
||||||
|
ResEntryValues[i] = Integer.toString(i);
|
||||||
|
ResEntrySubtitles[i] = "";
|
||||||
|
if (ResEntries[i].equals("#3200#"))
|
||||||
|
{
|
||||||
|
ResEntries[i] = Strings.GetString(LanguageStringID.ANDROID_VIDEO_NATIVE_RES);
|
||||||
|
ResEntrySubtitles[i] = AndroidDevice.nativeWidth+"x"+AndroidDevice.nativeHeight;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
final TwoLinesListPreference listPreference = (TwoLinesListPreference) findPreference("video_screenResolution");
|
||||||
|
listPreference.setEntries(ResEntries);
|
||||||
|
listPreference.setEntryValues(ResEntryValues);
|
||||||
|
listPreference.setEntriesSubtitles(ResEntrySubtitles);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
/****************************************************************************
|
||||||
|
* *
|
||||||
|
* Project 64 - A Nintendo 64 emulator. *
|
||||||
|
* http://www.pj64-emu.com/ *
|
||||||
|
* Copyright (C) 2012 Project64. All rights reserved. *
|
||||||
|
* *
|
||||||
|
* License: *
|
||||||
|
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
|
||||||
|
* *
|
||||||
|
****************************************************************************/
|
||||||
|
#ifdef ANDROID
|
||||||
|
#include <jni.h>
|
||||||
|
#include "ScreenResolution.h"
|
||||||
|
|
||||||
|
#define EXPORT extern "C" __attribute__((visibility("default")))
|
||||||
|
#define CALL
|
||||||
|
|
||||||
|
EXPORT jint CALL Java_emu_project64_jni_NativeVideo_getResolutionCount(JNIEnv* env, jclass cls)
|
||||||
|
{
|
||||||
|
return GetScreenResolutionCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
EXPORT jstring CALL Java_emu_project64_jni_NativeVideo_getResolutionName(JNIEnv* env, jclass cls, int index)
|
||||||
|
{
|
||||||
|
return env->NewStringUTF(GetScreenResolutionName(index));
|
||||||
|
}
|
||||||
|
|
||||||
|
EXPORT jint CALL Java_emu_project64_jni_NativeVideo_GetScreenResWidth(JNIEnv* env, jclass cls, int index)
|
||||||
|
{
|
||||||
|
return GetScreenResWidth(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
EXPORT jint CALL Java_emu_project64_jni_NativeVideo_GetScreenResHeight(JNIEnv* env, jclass cls, int index)
|
||||||
|
{
|
||||||
|
return GetScreenResHeight(index);
|
||||||
|
}
|
||||||
|
#endif
|
|
@ -96,6 +96,7 @@
|
||||||
<ClInclude Include="Version.h" />
|
<ClInclude Include="Version.h" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ClCompile Include="Android.cpp" />
|
||||||
<ClCompile Include="CRC.cpp" />
|
<ClCompile Include="CRC.cpp" />
|
||||||
<ClCompile Include="ScreenResolution.cpp" />
|
<ClCompile Include="ScreenResolution.cpp" />
|
||||||
<ClCompile Include="Settings.cpp" />
|
<ClCompile Include="Settings.cpp" />
|
||||||
|
|
|
@ -155,6 +155,7 @@
|
||||||
<ClCompile Include="trace.cpp" />
|
<ClCompile Include="trace.cpp" />
|
||||||
<ClCompile Include="Settings.cpp" />
|
<ClCompile Include="Settings.cpp" />
|
||||||
<ClCompile Include="ScreenResolution.cpp" />
|
<ClCompile Include="ScreenResolution.cpp" />
|
||||||
|
<ClCompile Include="Android.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Text Include="gpl.txt">
|
<Text Include="gpl.txt">
|
||||||
|
|
|
@ -67,6 +67,10 @@
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
|
#ifdef ANDROID
|
||||||
|
uint32_t g_NativeWidth, g_NativeHeight;
|
||||||
|
#endif
|
||||||
|
|
||||||
GFX_INFO gfx;
|
GFX_INFO gfx;
|
||||||
|
|
||||||
int to_fullscreen = FALSE;
|
int to_fullscreen = FALSE;
|
||||||
|
@ -79,6 +83,8 @@ int evoodoo = 0;
|
||||||
int ev_fullscreen = 0;
|
int ev_fullscreen = 0;
|
||||||
|
|
||||||
extern int viewport_offset;
|
extern int viewport_offset;
|
||||||
|
extern int g_width, g_height;
|
||||||
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
HINSTANCE hinstDLL = NULL;
|
HINSTANCE hinstDLL = NULL;
|
||||||
|
@ -410,7 +416,6 @@ void SetWindowDisplaySize(HWND hWnd)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
RECT clientRect = { 0 }, toolbarRect = { 0 }, statusbarRect = { 0 }, windowedRect = { 0 };
|
RECT clientRect = { 0 }, toolbarRect = { 0 }, statusbarRect = { 0 }, windowedRect = { 0 };
|
||||||
ZeroMemory(&g_windowedRect, sizeof(RECT));
|
|
||||||
HWND hToolBar = FindWindowEx(hWnd, NULL, REBARCLASSNAME, NULL);
|
HWND hToolBar = FindWindowEx(hWnd, NULL, REBARCLASSNAME, NULL);
|
||||||
HWND hStatusBar = FindWindowEx(hWnd, NULL, STATUSCLASSNAME, NULL);
|
HWND hStatusBar = FindWindowEx(hWnd, NULL, STATUSCLASSNAME, NULL);
|
||||||
if (hStatusBar == NULL)
|
if (hStatusBar == NULL)
|
||||||
|
@ -503,18 +508,18 @@ int InitGfx()
|
||||||
voodoo.has_2mb_tex_boundary = (SST_type < GR_SSTTYPE_Banshee) && !evoodoo;
|
voodoo.has_2mb_tex_boundary = (SST_type < GR_SSTTYPE_Banshee) && !evoodoo;
|
||||||
// use UMA if available
|
// use UMA if available
|
||||||
voodoo.tex_UMA = FALSE;
|
voodoo.tex_UMA = FALSE;
|
||||||
//*
|
if (strstr(extensions, " TEXUMA "))
|
||||||
if (strstr(extensions, " TEXUMA ")) {
|
{
|
||||||
// we get better texture cache hits with UMA on
|
// we get better texture cache hits with UMA on
|
||||||
grEnable(GR_TEXTURE_UMA_EXT);
|
grEnable(GR_TEXTURE_UMA_EXT);
|
||||||
voodoo.tex_UMA = TRUE;
|
voodoo.tex_UMA = TRUE;
|
||||||
WriteTrace(TraceGlide64, TraceDebug, "Using TEXUMA extension");
|
WriteTrace(TraceGlide64, TraceDebug, "Using TEXUMA extension");
|
||||||
}
|
}
|
||||||
//*/
|
|
||||||
|
|
||||||
#ifndef ANDROID
|
|
||||||
g_settings->UpdateScreenSize(ev_fullscreen);
|
g_settings->UpdateScreenSize(ev_fullscreen);
|
||||||
|
#ifndef ANDROID
|
||||||
SetWindowDisplaySize(gfx.hWnd);
|
SetWindowDisplaySize(gfx.hWnd);
|
||||||
|
#endif
|
||||||
gfx_context = grSstWinOpen(GR_COLORFORMAT_RGBA, GR_ORIGIN_UPPER_LEFT, 2, 1);
|
gfx_context = grSstWinOpen(GR_COLORFORMAT_RGBA, GR_ORIGIN_UPPER_LEFT, 2, 1);
|
||||||
if (!gfx_context)
|
if (!gfx_context)
|
||||||
{
|
{
|
||||||
|
@ -526,11 +531,6 @@ int InitGfx()
|
||||||
grGlideShutdown();
|
grGlideShutdown();
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
gfx_context = grSstWinOpen(GR_COLORFORMAT_RGBA, GR_ORIGIN_UPPER_LEFT, 2, 1);
|
|
||||||
g_settings->scr_res_x = g_settings->res_x = g_width;
|
|
||||||
g_settings->scr_res_y = g_settings->res_y = g_height;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
GfxInitDone = TRUE;
|
GfxInitDone = TRUE;
|
||||||
to_fullscreen = FALSE;
|
to_fullscreen = FALSE;
|
||||||
|
@ -1614,16 +1614,12 @@ Purpose: this function is called when the surface is has changed.
|
||||||
input: none
|
input: none
|
||||||
output: none
|
output: none
|
||||||
*******************************************************************/
|
*******************************************************************/
|
||||||
void init_combiner();
|
|
||||||
|
|
||||||
void CALL SurfaceChanged(int width, int height)
|
void CALL SurfaceChanged(int width, int height)
|
||||||
{
|
{
|
||||||
g_width = width;
|
g_NativeWidth = width;
|
||||||
g_height = height;
|
g_NativeHeight = height;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef ANDROID
|
|
||||||
void Android_JNI_SwapWindow()
|
void Android_JNI_SwapWindow()
|
||||||
{
|
{
|
||||||
gfx.SwapBuffers();
|
gfx.SwapBuffers();
|
||||||
|
|
|
@ -12,6 +12,10 @@
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
#include "trace.h"
|
#include "trace.h"
|
||||||
|
|
||||||
|
#ifdef ANDROID
|
||||||
|
extern uint32_t g_NativeWidth, g_NativeHeight;
|
||||||
|
#endif
|
||||||
|
|
||||||
struct ResolutionInfo
|
struct ResolutionInfo
|
||||||
{
|
{
|
||||||
ResolutionInfo(const char * name = NULL, uint32_t width = 0, uint32_t height = 0, uint32_t frequency = 0, bool default_res = false) :
|
ResolutionInfo(const char * name = NULL, uint32_t width = 0, uint32_t height = 0, uint32_t frequency = 0, bool default_res = false) :
|
||||||
|
@ -114,6 +118,12 @@ uint32_t GetScreenResWidth(uint32_t index)
|
||||||
{
|
{
|
||||||
if (index < GetScreenResolutionCount())
|
if (index < GetScreenResolutionCount())
|
||||||
{
|
{
|
||||||
|
#ifdef ANDROID
|
||||||
|
if (g_resolutions[index].width() == 0)
|
||||||
|
{
|
||||||
|
return g_NativeWidth;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
return g_resolutions[index].width();
|
return g_resolutions[index].width();
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -123,6 +133,12 @@ uint32_t GetScreenResHeight(uint32_t index)
|
||||||
{
|
{
|
||||||
if (index < GetScreenResolutionCount())
|
if (index < GetScreenResolutionCount())
|
||||||
{
|
{
|
||||||
|
#ifdef ANDROID
|
||||||
|
if (g_resolutions[index].height() == 0)
|
||||||
|
{
|
||||||
|
return g_NativeHeight;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
return g_resolutions[index].height();
|
return g_resolutions[index].height();
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -7,16 +7,20 @@
|
||||||
int GetCurrentResIndex(void);
|
int GetCurrentResIndex(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef ANDROID
|
||||||
|
extern uint32_t g_NativeWidth, g_NativeHeight;
|
||||||
|
#endif
|
||||||
|
|
||||||
short Set_basic_mode = 0, Set_texture_dir = 0, Set_log_dir = 0, Set_log_flush = 0;
|
short Set_basic_mode = 0, Set_texture_dir = 0, Set_log_dir = 0, Set_log_flush = 0;
|
||||||
extern int g_width, g_height;
|
extern int g_width, g_height;
|
||||||
|
|
||||||
CSettings::CSettings() :
|
CSettings::CSettings() :
|
||||||
m_dirty(false),
|
m_dirty(false),
|
||||||
m_res_x(640),
|
m_res_x(GetScreenResWidth(GetDefaultScreenRes())),
|
||||||
m_scr_res_x(640),
|
m_scr_res_x(GetScreenResWidth(GetDefaultScreenRes())),
|
||||||
m_res_y(480),
|
m_res_y(GetScreenResHeight(GetDefaultScreenRes())),
|
||||||
m_scr_res_y(480),
|
m_scr_res_y(GetScreenResHeight(GetDefaultScreenRes())),
|
||||||
m_ScreenRes(7),
|
m_ScreenRes(GetDefaultScreenRes()),
|
||||||
advanced_options(0),
|
advanced_options(0),
|
||||||
texenh_options(0),
|
texenh_options(0),
|
||||||
vsync(0),
|
vsync(0),
|
||||||
|
@ -29,6 +33,7 @@ buff_clear(0),
|
||||||
m_lodmode(LOD_Off),
|
m_lodmode(LOD_Off),
|
||||||
m_aspectmode(Aspect_4x3),
|
m_aspectmode(Aspect_4x3),
|
||||||
m_frame_buffer(0),
|
m_frame_buffer(0),
|
||||||
|
m_fb_crc_mode(fbcrcFast),
|
||||||
//Texture filtering options
|
//Texture filtering options
|
||||||
texture_dir(""),
|
texture_dir(""),
|
||||||
m_ghq_fltr(TextureFilter_None),
|
m_ghq_fltr(TextureFilter_None),
|
||||||
|
@ -99,6 +104,10 @@ m_FlushLogs(false)
|
||||||
ReadSettings();
|
ReadSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CSettings::~CSettings()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void CSettings::RegisterSettings(void)
|
void CSettings::RegisterSettings(void)
|
||||||
{
|
{
|
||||||
SetModuleName("default");
|
SetModuleName("default");
|
||||||
|
@ -108,7 +117,7 @@ void CSettings::RegisterSettings(void)
|
||||||
Set_log_dir = FindSystemSettingId("Dir:Log");
|
Set_log_dir = FindSystemSettingId("Dir:Log");
|
||||||
|
|
||||||
SetModuleName("Glide64");
|
SetModuleName("Glide64");
|
||||||
general_setting(Set_Resolution, "resolution", 7);
|
general_setting(Set_Resolution, "resolution", GetDefaultScreenRes());
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
general_setting(Set_FullScreenRes, "FullScreenRes", GetCurrentResIndex());
|
general_setting(Set_FullScreenRes, "FullScreenRes", GetCurrentResIndex());
|
||||||
#endif
|
#endif
|
||||||
|
@ -203,6 +212,9 @@ void CSettings::RegisterSettings(void)
|
||||||
game_setting_default(Set_detect_cpu_write, "detect_cpu_write", Set_detect_cpu_write_default);
|
game_setting_default(Set_detect_cpu_write, "detect_cpu_write", Set_detect_cpu_write_default);
|
||||||
game_setting_default(Set_fb_get_info, "fb_get_info", Set_fb_get_info_default);
|
game_setting_default(Set_fb_get_info, "fb_get_info", Set_fb_get_info_default);
|
||||||
game_setting_default(Set_fb_render, "fb_render", Set_fb_render_default);
|
game_setting_default(Set_fb_render, "fb_render", Set_fb_render_default);
|
||||||
|
|
||||||
|
SettingsRegisterChange(false, Set_Resolution, this, stSettingsChanged);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSettings::SetScreenRes(uint32_t value)
|
void CSettings::SetScreenRes(uint32_t value)
|
||||||
|
@ -234,6 +246,11 @@ void CSettings::UpdateScreenSize(bool fullscreen)
|
||||||
}
|
}
|
||||||
m_scr_res_x = m_res_x = g_width;
|
m_scr_res_x = m_res_x = g_width;
|
||||||
m_scr_res_y = m_res_y = g_height;
|
m_scr_res_y = m_res_y = g_height;
|
||||||
|
#else
|
||||||
|
g_width = GetScreenResWidth(m_ScreenRes);
|
||||||
|
g_height = GetScreenResHeight(m_ScreenRes);
|
||||||
|
m_scr_res_x = m_res_x = g_width;
|
||||||
|
m_scr_res_y = m_res_y = g_height;
|
||||||
#endif
|
#endif
|
||||||
UpdateAspectRatio();
|
UpdateAspectRatio();
|
||||||
}
|
}
|
||||||
|
@ -363,11 +380,8 @@ void CSettings::UpdateAspectRatio(void)
|
||||||
|
|
||||||
void CSettings::ReadSettings()
|
void CSettings::ReadSettings()
|
||||||
{
|
{
|
||||||
#ifdef ANDROID
|
|
||||||
this->scr_res_x = this->res_x = g_width;
|
|
||||||
this->scr_res_y = this->res_y = g_height;
|
|
||||||
#else
|
|
||||||
SetScreenRes(GetSetting(Set_Resolution));
|
SetScreenRes(GetSetting(Set_Resolution));
|
||||||
|
#ifndef ANDROID
|
||||||
this->wrpResolution = GetSetting(Set_FullScreenRes);
|
this->wrpResolution = GetSetting(Set_FullScreenRes);
|
||||||
#endif
|
#endif
|
||||||
this->vsync = GetSetting(Set_vsync);
|
this->vsync = GetSetting(Set_vsync);
|
||||||
|
@ -582,10 +596,8 @@ void CSettings::ReadGameSettings(const char * name)
|
||||||
|
|
||||||
g_settings->fog = GetSetting(g_romopen ? Set_fog : Set_fog_default);
|
g_settings->fog = GetSetting(g_romopen ? Set_fog : Set_fog_default);
|
||||||
g_settings->buff_clear = GetSetting(g_romopen ? Set_buff_clear : Set_buff_clear_default);
|
g_settings->buff_clear = GetSetting(g_romopen ? Set_buff_clear : Set_buff_clear_default);
|
||||||
#ifdef _WIN32
|
m_ScreenRes = GetSetting(Set_Resolution);
|
||||||
g_settings->m_ScreenRes = GetSetting(Set_Resolution);
|
if (m_ScreenRes >= GetScreenResolutionCount()) { m_ScreenRes = GetDefaultScreenRes(); }
|
||||||
if (g_settings->m_ScreenRes < 0 || g_settings->m_ScreenRes >= 0x18) g_settings->m_ScreenRes = 12;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//frame buffer
|
//frame buffer
|
||||||
short fb_Settings[] =
|
short fb_Settings[] =
|
||||||
|
@ -649,8 +661,8 @@ void CSettings::ReadGameSettings(const char * name)
|
||||||
|
|
||||||
void CSettings::WriteSettings(void)
|
void CSettings::WriteSettings(void)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
|
||||||
SetSetting(Set_Resolution, g_settings->m_ScreenRes);
|
SetSetting(Set_Resolution, g_settings->m_ScreenRes);
|
||||||
|
#ifdef _WIN32
|
||||||
SetSetting(Set_FullScreenRes, g_settings->wrpResolution);
|
SetSetting(Set_FullScreenRes, g_settings->wrpResolution);
|
||||||
#endif
|
#endif
|
||||||
SetSetting(Set_vsync, g_settings->vsync);
|
SetSetting(Set_vsync, g_settings->vsync);
|
||||||
|
@ -717,3 +729,8 @@ void CSettings::WriteSettings(void)
|
||||||
|
|
||||||
FlushSettings();
|
FlushSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSettings::SettingsChanged(void)
|
||||||
|
{
|
||||||
|
m_ScreenRes = GetSetting(Set_Resolution);
|
||||||
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ class CSettings
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CSettings();
|
CSettings();
|
||||||
|
~CSettings();
|
||||||
|
|
||||||
//Frame buffer emulation options
|
//Frame buffer emulation options
|
||||||
enum fb_bits_t
|
enum fb_bits_t
|
||||||
|
@ -272,10 +273,15 @@ public:
|
||||||
void UpdateAspectRatio(void);
|
void UpdateAspectRatio(void);
|
||||||
void UpdateScreenSize(bool fullscreen);
|
void UpdateScreenSize(bool fullscreen);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void ReadSettings();
|
void ReadSettings();
|
||||||
void RegisterSettings(void);
|
void RegisterSettings(void);
|
||||||
|
void SettingsChanged(void);
|
||||||
|
|
||||||
|
static void stSettingsChanged(void * _this)
|
||||||
|
{
|
||||||
|
((CSettings *)_this)->SettingsChanged();
|
||||||
|
}
|
||||||
|
|
||||||
bool m_dirty;
|
bool m_dirty;
|
||||||
bool m_FlushLogs;
|
bool m_FlushLogs;
|
||||||
|
|
|
@ -589,6 +589,9 @@ enum LanguageStringID
|
||||||
ANDROID_MENU_DEBUGGINGOPTIONS = 3111,
|
ANDROID_MENU_DEBUGGINGOPTIONS = 3111,
|
||||||
ANDROID_MENU_RESETFUNCTIONTIMES = 3112,
|
ANDROID_MENU_RESETFUNCTIONTIMES = 3112,
|
||||||
ANDROID_MENU_DUMPFUNCTIONTIMES = 3113,
|
ANDROID_MENU_DUMPFUNCTIONTIMES = 3113,
|
||||||
|
|
||||||
|
//Video plugin
|
||||||
|
ANDROID_VIDEO_NATIVE_RES = 3200,
|
||||||
};
|
};
|
||||||
|
|
||||||
#include "Multilanguage/LanguageClass.h"
|
#include "Multilanguage/LanguageClass.h"
|
||||||
|
|
|
@ -557,6 +557,9 @@ void CLanguage::LoadDefaultStrings(void)
|
||||||
DEF_STR(ANDROID_MENU_DEBUGGINGOPTIONS, "Debugging Options");
|
DEF_STR(ANDROID_MENU_DEBUGGINGOPTIONS, "Debugging Options");
|
||||||
DEF_STR(ANDROID_MENU_RESETFUNCTIONTIMES, "Reset Function Times");
|
DEF_STR(ANDROID_MENU_RESETFUNCTIONTIMES, "Reset Function Times");
|
||||||
DEF_STR(ANDROID_MENU_DUMPFUNCTIONTIMES, "Dump Function Times");
|
DEF_STR(ANDROID_MENU_DUMPFUNCTIONTIMES, "Dump Function Times");
|
||||||
|
|
||||||
|
//Video plugin
|
||||||
|
DEF_STR(ANDROID_VIDEO_NATIVE_RES, "Native");
|
||||||
}
|
}
|
||||||
|
|
||||||
CLanguage::CLanguage() :
|
CLanguage::CLanguage() :
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
Android Release 9:
|
||||||
|
- Add ability to change screen res
|
Loading…
Reference in New Issue