mirror of
https://github.com/BillyOutlast/aps3e.git
synced 2026-02-04 03:01:22 +01:00
1.21
This commit is contained in:
@@ -46,7 +46,7 @@
|
||||
android:screenOrientation="sensorLandscape"
|
||||
android:launchMode="singleTask"
|
||||
android:configChanges="layoutDirection|locale|orientation|uiMode|screenLayout|screenSize|smallestScreenSize|keyboard|keyboardHidden|navigation"
|
||||
android:exported="false"
|
||||
android:exported="true"
|
||||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
|
||||
android:process=":emu"
|
||||
>
|
||||
|
||||
@@ -1505,20 +1505,6 @@ static jboolean j_install_pkg(JNIEnv* env,jobject self,jint pkg_fd){
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
//public native String[] get_support_llvm_cpu_list();
|
||||
|
||||
static jobjectArray j_get_support_llvm_cpu_list(JNIEnv* env,jobject self){
|
||||
std::set<std::string> cpu_list=get_processor_name_set();
|
||||
int count=cpu_list.size();
|
||||
jobjectArray ret=env->NewObjectArray(count,env->FindClass("java/lang/String"),nullptr);
|
||||
int n=0;
|
||||
for(const std::string& cpu_name:cpu_list){
|
||||
env->SetObjectArrayElement(ret,n++,env->NewStringUTF(cpu_name.c_str()));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static jobject j_meta_info_from_dir(JNIEnv* env,jobject self,jstring jdir_path){
|
||||
|
||||
auto fetch_psf_path=[](const std::string& dir_path){
|
||||
@@ -1633,6 +1619,8 @@ int register_Emulator(JNIEnv* env){
|
||||
static const JNINativeMethod methods[] = {
|
||||
|
||||
{"get_support_llvm_cpu_list", "()[Ljava/lang/String;",(void *)j_get_support_llvm_cpu_list},
|
||||
{"get_vulkan_physical_dev_list", "()[Ljava/lang/String;",(void *)j_get_vulkan_physical_dev_list},
|
||||
|
||||
//{"support_custom_driver","()Z",(void *)support_custom_driver},
|
||||
|
||||
{ "generate_config_xml", "()Ljava/lang/String;", (void *) generate_config_xml },
|
||||
@@ -1676,7 +1664,9 @@ int register_Emulator_cfg(JNIEnv* env){
|
||||
|
||||
{ "native_open_config_file", "(Ljava/lang/String;)J", (void *) open_config_file },
|
||||
{ "native_load_config_entry", "(JLjava/lang/String;)Ljava/lang/String;", (void *) load_config_entry },
|
||||
{ "native_load_config_entry_ty_arr", "(JLjava/lang/String;)[Ljava/lang/String;", (void *) load_config_entry_ty_arr },
|
||||
{ "native_save_config_entry", "(JLjava/lang/String;Ljava/lang/String;)V", (void *) save_config_entry },
|
||||
{ "native_save_config_entry_ty_arr", "(JLjava/lang/String;[Ljava/lang/String;)V", (void *) save_config_entry_ty_arr },
|
||||
{ "native_close_config_file", "(JLjava/lang/String;)V", (void *) close_config_file },
|
||||
};
|
||||
jclass clazz = env->FindClass("aenu/aps3e/Emulator$Config");
|
||||
|
||||
@@ -40,7 +40,7 @@ static jstring load_config_entry(JNIEnv* env,jobject self,YAML::Node* config_nod
|
||||
return env->NewStringUTF(node.as<std::string>().c_str());
|
||||
}
|
||||
break;
|
||||
#if 0
|
||||
|
||||
case 2:{
|
||||
|
||||
pos=child.find('|');
|
||||
@@ -55,10 +55,43 @@ static jstring load_config_entry(JNIEnv* env,jobject self,YAML::Node* config_nod
|
||||
return env->NewStringUTF(node.as<std::string>().c_str());
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
aps3e_log.error("load_config_entry fail %s",tag_str.c_str());
|
||||
LOGE("load_config_entry fail %s",tag_str.c_str());
|
||||
aps3e_log.error("load_config_entry fail %s,level too deep",tag_str.c_str());
|
||||
LOGE("load_config_entry fail %s,level too deep",tag_str.c_str());
|
||||
break;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
static jobjectArray load_config_entry_ty_arr(JNIEnv* env,jobject self,YAML::Node* config_node,jstring tag){
|
||||
jboolean is_copy=false;
|
||||
const char* tag_cstr=env->GetStringUTFChars(tag,&is_copy);
|
||||
std::string tag_str(tag_cstr);
|
||||
env->ReleaseStringUTFChars(tag,tag_cstr);
|
||||
size_t pos=tag_str.find('|');
|
||||
std::string parent=tag_str.substr(0,pos);
|
||||
std::string child=tag_str.substr(pos+1);
|
||||
|
||||
switch(std::count(child.begin(),child.end(),'|')){
|
||||
case 0: {
|
||||
YAML::Node node=(*config_node)[parent][child];
|
||||
if(node.IsDefined()) {
|
||||
std::vector<std::string> v=node.as<std::vector<std::string>>();
|
||||
jobjectArray arr=env->NewObjectArray(v.size(),env->FindClass("java/lang/String"),NULL);
|
||||
for(size_t i=0;i<v.size();i++){
|
||||
env->SetObjectArrayElement(arr,i,env->NewStringUTF(v[i].c_str()));
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
aps3e_log.error("load_config_entry fail %s,level too deep",tag_str.c_str());
|
||||
LOGE("load_config_entry fail %s,level too deep",tag_str.c_str());
|
||||
break;
|
||||
}
|
||||
return NULL;
|
||||
@@ -87,7 +120,7 @@ static void save_config_entry(JNIEnv* env,jobject self,YAML::Node* config_node,j
|
||||
(*config_node)[parent][child][child2]=std::string(val_cstr);
|
||||
}
|
||||
break;
|
||||
#if 0
|
||||
|
||||
case 2:{
|
||||
|
||||
pos=child.find('|');
|
||||
@@ -99,16 +132,41 @@ static void save_config_entry(JNIEnv* env,jobject self,YAML::Node* config_node,j
|
||||
(*config_node)[parent][child][child2][child3]=std::string(val_cstr);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
aps3e_log.error("save_config_entry fail %s",tag_str.c_str());
|
||||
LOGE("save_config_entry fail %s",tag_str.c_str());
|
||||
aps3e_log.error("save_config_entry fail %s,level too deep",tag_str.c_str());
|
||||
LOGE("save_config_entry fail %s,level too deep",tag_str.c_str());
|
||||
break;
|
||||
}
|
||||
|
||||
env->ReleaseStringUTFChars(val,val_cstr);
|
||||
}
|
||||
|
||||
|
||||
static void save_config_entry_ty_arr(JNIEnv* env,jobject self,YAML::Node* config_node,jstring tag,jobjectArray val) {
|
||||
|
||||
jboolean is_copy = false;
|
||||
const char *tag_cstr = env->GetStringUTFChars(tag, &is_copy);
|
||||
std::string tag_str(tag_cstr);
|
||||
env->ReleaseStringUTFChars(tag, tag_cstr);
|
||||
size_t pos = tag_str.find('|');
|
||||
std::string parent = tag_str.substr(0, pos);
|
||||
std::string child = tag_str.substr(pos + 1);
|
||||
|
||||
switch (std::count(child.begin(), child.end(), '|')) {
|
||||
case 0: {
|
||||
std::vector<std::string> v;
|
||||
for (int i = 0; i < env->GetArrayLength(val); i++) {
|
||||
jstring jstr = (jstring) env->GetObjectArrayElement(val, i);
|
||||
const char *str = env->GetStringUTFChars(jstr, &is_copy);
|
||||
v.push_back(std::string(str));
|
||||
env->ReleaseStringUTFChars(jstr, str);
|
||||
}
|
||||
(*config_node)[parent][child] = v;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
static void close_config_file(JNIEnv* env,jobject self,YAML::Node* config_node,jstring config_path){
|
||||
YAML::Emitter out;
|
||||
out << *config_node;
|
||||
@@ -121,7 +179,7 @@ static void close_config_file(JNIEnv* env,jobject self,YAML::Node* config_node,j
|
||||
delete config_node;
|
||||
}
|
||||
|
||||
auto gen_key=[](const std::string& name)->std::string{
|
||||
static auto gen_key=[](const std::string& name)->std::string{
|
||||
std::string k=name;
|
||||
if(size_t p=k.find("(");p!=std::string::npos){
|
||||
k=k.substr(0,p);
|
||||
@@ -160,6 +218,34 @@ auto gen_key=[](const std::string& name)->std::string{
|
||||
return k;
|
||||
};
|
||||
|
||||
static const std::string gen_skips[]={
|
||||
"Core|SPU LLVM Lower Bound",
|
||||
"Core|SPU LLVM Upper Bound",
|
||||
"Audio|Audio Device",
|
||||
"Audio|Microphone Devices",
|
||||
"Input/Output|Camera ID",
|
||||
"Input/Output|Emulated Midi devices",
|
||||
"System|System Name",
|
||||
"System|PSID high",
|
||||
"System|PSID low",
|
||||
"System|HDD Model Name",
|
||||
"System|HDD Serial Number",
|
||||
"Miscellaneous|GDB Server",
|
||||
"Miscellaneous|Window Title Format",
|
||||
|
||||
"Video|Performance Overlay|Font",
|
||||
"Video|Performance Overlay|Body Color (hex)",
|
||||
"Video|Performance Overlay|Body Background (hex)",
|
||||
"Video|Performance Overlay|Title Color (hex)",
|
||||
"Video|Performance Overlay|Title Background (hex)",
|
||||
};
|
||||
|
||||
static bool gen_is_parent(const std::string& parent_name){
|
||||
if(parent_name=="Core"||parent_name=="Video"||parent_name=="Audio"||parent_name=="Input/Output"
|
||||
||parent_name=="System"||parent_name=="Savestate"||parent_name=="Miscellaneous")
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
static jstring generate_config_xml(JNIEnv* env,jobject self){
|
||||
|
||||
auto gen_one_preference=[&](const std::string parent_name,cfg::_base* node)->std::string{
|
||||
@@ -212,17 +298,22 @@ static jstring generate_config_xml(JNIEnv* env,jobject self){
|
||||
|
||||
for(auto n:g_cfg.get_nodes()){
|
||||
const std::string& name=n->get_name();
|
||||
if(name=="Core"||name=="Video"||name=="Audio"||name=="Input/Output"||name=="System"
|
||||
||name=="Net"||name=="Savestate"||name=="Miscellaneous"){
|
||||
if(gen_is_parent(name)){
|
||||
out<<" <PreferenceScreen app:title=\"@string/emulator_settings_"<<gen_key(name)<<"\" \n";
|
||||
out<<"app:key=\""<<name<<"\" >\n";
|
||||
|
||||
for(auto n2:reinterpret_cast<cfg::node*>(n)->get_nodes()){
|
||||
|
||||
if(std::find(std::begin(gen_skips),std::end(gen_skips),name+"|"+n2->get_name())!=std::end(gen_skips))
|
||||
continue;
|
||||
|
||||
//Video下的3个子项
|
||||
if(n2->get_type()==cfg::type::node){
|
||||
out<<"<PreferenceScreen app:title=\"@string/emulator_settings_"<<gen_key(name)<<"_"<<gen_key(n2->get_name())<<"\" \n";
|
||||
out<<"app:key=\""<<name+"|"+n2->get_name()<<"\" >\n";
|
||||
for(auto n3:reinterpret_cast<cfg::node*>(n2)->get_nodes()) {
|
||||
if(std::find(std::begin(gen_skips),std::end(gen_skips),name+"|"+n2->get_name()+"|"+n3->get_name())!=std::end(gen_skips))
|
||||
continue;
|
||||
out << "\n" << gen_one_preference(name+"|"+n2->get_name(), n3) << "\n";
|
||||
}
|
||||
out<<"</PreferenceScreen>\n";
|
||||
@@ -268,8 +359,7 @@ static jstring generate_strings_xml(JNIEnv* env,jobject self){
|
||||
|
||||
for(auto n:g_cfg.get_nodes()){
|
||||
const std::string& name=n->get_name();
|
||||
if(name=="Core"||name=="Video"||name=="Audio"||name=="Input/Output"||name=="System"
|
||||
||name=="Net"||name=="Savestate"||name=="Miscellaneous"){
|
||||
if(gen_is_parent(name)){
|
||||
|
||||
out<<"<string name=\"emulator_settings_"<<gen_key(name)<<"\">"<<name<<"</string>\n";
|
||||
|
||||
@@ -293,8 +383,7 @@ static jstring generate_strings_xml(JNIEnv* env,jobject self){
|
||||
//array
|
||||
for(auto n:g_cfg.get_nodes()){
|
||||
const std::string& name=n->get_name();
|
||||
if(name=="Core"||name=="Video"||name=="Audio"||name=="Input/Output"||name=="System"
|
||||
||name=="Net"||name=="Savestate"||name=="Miscellaneous"){
|
||||
if(gen_is_parent(name)){
|
||||
|
||||
for(auto n2:reinterpret_cast<cfg::node*>(n)->get_nodes()){
|
||||
|
||||
@@ -349,14 +438,18 @@ static jstring generate_java_string_arr(JNIEnv* env,jobject self){
|
||||
out<<prefix<<"\n";
|
||||
for(auto n:g_cfg.get_nodes()){
|
||||
const std::string& name=n->get_name();
|
||||
if(name=="Core"||name=="Video"||name=="Audio"||name=="Input/Output"||name=="System"
|
||||
||name=="Net"||name=="Savestate"||name=="Miscellaneous"){
|
||||
if(gen_is_parent(name)){
|
||||
|
||||
for(auto n2:reinterpret_cast<cfg::node*>(n)->get_nodes()){
|
||||
|
||||
if(std::find(std::begin(gen_skips),std::end(gen_skips),name+"|"+n2->get_name())!=std::end(gen_skips))
|
||||
continue;
|
||||
|
||||
//Video下的3个子项
|
||||
if(n2->get_type()==cfg::type::node){
|
||||
for(auto n3:reinterpret_cast<cfg::node*>(n2)->get_nodes()) {
|
||||
if(std::find(std::begin(gen_skips),std::end(gen_skips),name+"|"+n2->get_name()+"|"+n3->get_name())!=std::end(gen_skips))
|
||||
continue;
|
||||
out << gen_one_key_string(name+"|"+n2->get_name(), n3,test_ty);
|
||||
}
|
||||
}
|
||||
@@ -376,13 +469,15 @@ static jstring generate_java_string_arr(JNIEnv* env,jobject self){
|
||||
out<<"final String[] NODE_KEYS={\n";
|
||||
for(auto n:g_cfg.get_nodes()){
|
||||
const std::string& name=n->get_name();
|
||||
if(name=="Core"||name=="Video"||name=="Audio"||name=="Input/Output"||name=="System"
|
||||
||name=="Net"||name=="Savestate"||name=="Miscellaneous"){
|
||||
if(gen_is_parent(name)){
|
||||
|
||||
out<<"\""<<name<<"\",\n";
|
||||
|
||||
for(auto n2:reinterpret_cast<cfg::node*>(n)->get_nodes()){
|
||||
|
||||
//if(std::find(std::begin(gen_skips),std::end(gen_skips),name+"|"+n2->get_name())!=std::end(gen_skips))
|
||||
// continue;
|
||||
|
||||
//Video下的3个子项
|
||||
if(n2->get_type()==cfg::type::node){
|
||||
out<<"\""<<name+"|"+n2->get_name()<<"\",\n";
|
||||
@@ -406,3 +501,64 @@ static jstring generate_java_string_arr(JNIEnv* env,jobject self){
|
||||
|
||||
return env->NewStringUTF(out.str().c_str());
|
||||
}
|
||||
|
||||
//public native String[] get_support_llvm_cpu_list();
|
||||
|
||||
static jobjectArray j_get_support_llvm_cpu_list(JNIEnv* env,jobject self){
|
||||
std::set<std::string> cpu_list=get_processor_name_set();
|
||||
int count=cpu_list.size();
|
||||
jobjectArray ret=env->NewObjectArray(count,env->FindClass("java/lang/String"),nullptr);
|
||||
int n=0;
|
||||
for(const std::string& cpu_name:cpu_list){
|
||||
env->SetObjectArrayElement(ret,n++,env->NewStringUTF(cpu_name.c_str()));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static jobjectArray j_get_vulkan_physical_dev_list(JNIEnv* env,jobject self){
|
||||
|
||||
std::vector<VkPhysicalDeviceProperties> physical_device_prop_list;
|
||||
{
|
||||
VkApplicationInfo appinfo = {};
|
||||
appinfo.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO;
|
||||
appinfo.pNext = nullptr;
|
||||
appinfo.pApplicationName = "aps3e-cfg-test";
|
||||
appinfo.applicationVersion = VK_MAKE_VERSION(1, 0, 0);
|
||||
appinfo.pEngineName = "nul";
|
||||
appinfo.engineVersion = VK_MAKE_VERSION(1, 0, 0);
|
||||
appinfo.apiVersion = VK_API_VERSION_1_0;
|
||||
|
||||
VkInstanceCreateInfo inst_create_info = {};
|
||||
inst_create_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
|
||||
inst_create_info.pApplicationInfo = &appinfo;
|
||||
|
||||
VkInstance inst;
|
||||
if (vkCreateInstance(&inst_create_info, nullptr, &inst)!= VK_SUCCESS) {
|
||||
__android_log_print(ANDROID_LOG_FATAL, LOG_TAG,"%s : %d",__func__,__LINE__);
|
||||
aps3e_log.fatal("%s : %d",__func__,__LINE__);
|
||||
}
|
||||
|
||||
// 获取物理设备数量
|
||||
uint32_t physicalDeviceCount = 0;
|
||||
vkEnumeratePhysicalDevices(inst, &physicalDeviceCount, nullptr);
|
||||
|
||||
std::vector<VkPhysicalDevice> physicalDevices(physicalDeviceCount);
|
||||
vkEnumeratePhysicalDevices(inst, &physicalDeviceCount, physicalDevices.data());
|
||||
|
||||
for (const auto& physicalDevice : physicalDevices) {
|
||||
VkPhysicalDeviceProperties physicalDeviceProperties;
|
||||
vkGetPhysicalDeviceProperties(physicalDevice, &physicalDeviceProperties);
|
||||
physical_device_prop_list.push_back(physicalDeviceProperties);
|
||||
}
|
||||
|
||||
vkDestroyInstance(inst, nullptr);
|
||||
}
|
||||
int count=physical_device_prop_list.size();
|
||||
jobjectArray ret=env->NewObjectArray(count,env->FindClass("java/lang/String"),nullptr);
|
||||
|
||||
int n=0;
|
||||
for(const VkPhysicalDeviceProperties& prop:physical_device_prop_list){
|
||||
env->SetObjectArrayElement(ret,n++,env->NewStringUTF(prop.deviceName));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -63,11 +63,12 @@ std::string cpu_get_simple_info(const std::vector<core_info_t>& core_info_list){
|
||||
core_counts[core]++;
|
||||
}
|
||||
std::stringstream ss;
|
||||
for (auto it=core_counts.rbegin(); it!=core_counts.rend();it++) {
|
||||
ss<<cpu_get_processor_name(it->first)<<"*"<<it->second<<"+";
|
||||
for (auto it=core_counts.rbegin(),skip=--core_counts.rend(); it!=core_counts.rend();it++) {
|
||||
ss<<cpu_get_processor_name(it->first)<<"*"<<it->second;
|
||||
if(it!=skip) ss<<"+";
|
||||
}
|
||||
std::string r = ss.str();
|
||||
return r.substr(0,r.size()-1);
|
||||
ss<<"("<<cpu_get_processor_isa(core_info_list[0])<<")";
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
|
||||
@@ -85,69 +86,96 @@ std::set<std::string> get_processor_name_set(){
|
||||
return processor_name_set;
|
||||
}
|
||||
|
||||
struct prossessor_info_t{
|
||||
int implementer;
|
||||
int part;
|
||||
std::string name;
|
||||
std::string isa;//忽略启用的扩展
|
||||
};
|
||||
|
||||
std::string cpu_get_processor_name(const core_info_t& core_info){
|
||||
static const std::map<std::tuple<int,int>,std::string> processor_map{
|
||||
const std::vector<prossessor_info_t>& _get_processor_info_list(){
|
||||
static const std::vector<prossessor_info_t> processor_map{
|
||||
|
||||
//ARM
|
||||
{{ 0x41, 0xd04}, "cortex-a35" },
|
||||
{{ 0x41, 0xd03}, "cortex-a53" },
|
||||
{{ 0x41, 0xd07}, "cortex-a57" },
|
||||
{{ 0x41, 0xd08}, "cortex-a72" },
|
||||
{{ 0x41, 0xd09}, "cortex-a73" },
|
||||
{ 0x41, 0xd04, "cortex-a35", "armv8-a" },
|
||||
{ 0x41, 0xd03, "cortex-a53", "armv8-a" },
|
||||
{ 0x41, 0xd07, "cortex-a57", "armv8-a" },
|
||||
{ 0x41, 0xd08, "cortex-a72", "armv8-a" },
|
||||
{ 0x41, 0xd09, "cortex-a73", "armv8-a" },
|
||||
|
||||
{{ 0x41, 0xd05}, "cortex-a55" },
|
||||
{{ 0x41, 0xd0a}, "cortex-a75" },
|
||||
{{ 0x41, 0xd0b}, "cortex-a76" },
|
||||
{{ 0x41, 0xd0d}, "cortex-a77" },
|
||||
{{ 0x41, 0xd41}, "cortex-a78" },
|
||||
{{ 0x41, 0xd44}, "cortex-x1" },
|
||||
{ 0x41, 0xd05, "cortex-a55", "armv8.2-a" },
|
||||
{ 0x41, 0xd0a, "cortex-a75", "armv8.2-a" },
|
||||
{ 0x41, 0xd0b, "cortex-a76", "armv8.2-a" },
|
||||
{ 0x41, 0xd0d, "cortex-a77", "armv8.2-a" },
|
||||
{ 0x41, 0xd41, "cortex-a78", "armv8.2-a" },
|
||||
{ 0x41, 0xd44, "cortex-x1", "armv8.2-a" },
|
||||
|
||||
{{ 0x41, 0xd46}, "cortex-a510" },
|
||||
{{ 0x41, 0xd47}, "cortex-a710" },
|
||||
{{ 0x41, 0xd48}, "cortex-x2" },
|
||||
{{ 0x41, 0xd4d}, "cortex-a715" },
|
||||
{{ 0x41, 0xd4e}, "cortex-x3" },
|
||||
{ 0x41, 0xd46, "cortex-a510", "armv9-a" },
|
||||
{ 0x41, 0xd47, "cortex-a710", "armv9-a" },
|
||||
{ 0x41, 0xd48, "cortex-x2", "armv9-a" },
|
||||
{ 0x41, 0xd4d, "cortex-a715", "armv9-a" },
|
||||
{ 0x41, 0xd4e, "cortex-x3", "armv9-a" },
|
||||
|
||||
{{ 0x41, 0xd80}, "cortex-a520" },
|
||||
{{ 0x41, 0xd81}, "cortex-a720" },
|
||||
{{ 0x41, 0xd87}, "cortex-a725" },
|
||||
{{ 0x41, 0xd82}, "cortex-x4" },
|
||||
{{ 0x41, 0xd85}, "cortex-x925" },
|
||||
{ 0x41, 0xd80, "cortex-a520", "armv9.2-a" },
|
||||
{ 0x41, 0xd81, "cortex-a720", "armv9.2-a" },
|
||||
{ 0x41, 0xd87, "cortex-a725", "armv9.2-a" },
|
||||
{ 0x41, 0xd82, "cortex-x4", "armv9.2-a" },
|
||||
{ 0x41, 0xd85, "cortex-x925", "armv9.2-a" },
|
||||
|
||||
{{ 0x41, 0xd88}, "cortex-a520ae" },
|
||||
{{ 0x41, 0xd06}, "cortex-a65" },
|
||||
{{ 0x41, 0xd43}, "cortex-a65ae" },
|
||||
{{ 0x41, 0xd0e}, "cortex-a76ae" },
|
||||
{{ 0x41, 0xd0d}, "cortex-a77" },
|
||||
{{ 0x41, 0xd42}, "cortex-a78ae" },
|
||||
{{ 0x41, 0xd4b}, "cortex-a78c" },
|
||||
{ 0x41, 0xd88, "cortex-a520ae", "armv9.2-a" },
|
||||
//{ 0x41, 0xd06, "cortex-a65" },
|
||||
//{ 0x41, 0xd43, "cortex-a65ae" },
|
||||
{ 0x41, 0xd0e, "cortex-a76ae", "armv8.2-a" },
|
||||
{ 0x41, 0xd0d, "cortex-a77", "armv8.2-a" },
|
||||
{ 0x41, 0xd42, "cortex-a78ae", "armv8.2-a" },
|
||||
{ 0x41, 0xd4b, "cortex-a78c", "armv8.2-a" },
|
||||
|
||||
//高通
|
||||
{{ 0x51, 0x801}, "cortex-a73" },// Kryo 2xx Silver
|
||||
{{ 0x51, 0x802}, "cortex-a75" },// Kryo 3xx Gold
|
||||
{{ 0x51, 0x803}, "cortex-a75" },// Kryo 3xx Silver
|
||||
{{ 0x51, 0x804}, "cortex-a76" },// Kryo 4xx Gold
|
||||
{{ 0x51, 0x805}, "cortex-a76" },// Kryo 4xx/5xx Silver
|
||||
{ 0x51, 0x801, "cortex-a73", "armv8-a" },// Kryo 2xx Silver
|
||||
{ 0x51, 0x802, "cortex-a75", "armv8.2-a" },// Kryo 3xx Gold
|
||||
{ 0x51, 0x803, "cortex-a75", "armv8.2-a" },// Kryo 3xx Silver
|
||||
{ 0x51, 0x804, "cortex-a76", "armv8.2-a" },// Kryo 4xx Gold
|
||||
{ 0x51, 0x805, "cortex-a76", "armv8.2-a" },// Kryo 4xx/5xx Silver
|
||||
//{{ 0x51, 0xc00}, "falkor" },
|
||||
//{{ 0x51, 0xc01}, "saphira" },
|
||||
{{ 0x51, 0x001}, "oryon-1" },
|
||||
{ 0x51, 0x001, "oryon-1", "armv9.2-a" },
|
||||
|
||||
//海思
|
||||
//{{ 0x48, 0xd01}, "tsv110" },
|
||||
|
||||
//三星
|
||||
{{ 0x53, 0x002}, "exynos-m3" },
|
||||
{{ 0x53, 0x003}, "exynos-m4" },
|
||||
};
|
||||
{ 0x53, 0x002, "exynos-m3", "armv8-a" },
|
||||
{ 0x53, 0x003, "exynos-m4", "armv8.2-a" },
|
||||
};
|
||||
return processor_map;
|
||||
};
|
||||
|
||||
std::string cpu_get_processor_name(const core_info_t& core_info){
|
||||
|
||||
|
||||
int implementer=core_info.implementer;
|
||||
int variant=core_info.variant;
|
||||
int part=core_info.part;
|
||||
|
||||
if (auto core = processor_map.find(std::make_tuple(implementer, part)); core != processor_map.end()) {
|
||||
return core->second;
|
||||
for(const prossessor_info_t& processor_info:_get_processor_info_list()){
|
||||
if(processor_info.implementer==implementer&&processor_info.part==part){
|
||||
return processor_info.name;
|
||||
}
|
||||
}
|
||||
|
||||
return "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
std::string cpu_get_processor_isa(const core_info_t& core_info){
|
||||
|
||||
int implementer=core_info.implementer;
|
||||
int variant=core_info.variant;
|
||||
int part=core_info.part;
|
||||
for(const prossessor_info_t& processor_info:_get_processor_info_list()){
|
||||
if(processor_info.implementer==implementer&&processor_info.part==part){
|
||||
return processor_info.isa;
|
||||
}
|
||||
}
|
||||
|
||||
return "Unknown";
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ std::vector<core_info_t> cpu_get_core_info();
|
||||
std::string cpu_get_simple_info(const std::vector<core_info_t>& core_info_list);
|
||||
std::set<core_info_t> get_processor_info_set();
|
||||
std::set<std::string> get_processor_name_set();
|
||||
std::string cpu_get_processor_name(const core_info_t& core_info);
|
||||
std::string cpu_get_processor_name(const core_info_t& core_info);
|
||||
std::string cpu_get_processor_isa(const core_info_t& core_info);
|
||||
|
||||
#endif //APS3E_CPUINFO_H
|
||||
|
||||
@@ -486,7 +486,7 @@ std::string get_gpu_info(){
|
||||
return "获取gpu信息失败";
|
||||
}
|
||||
|
||||
clean.funcs.push_back([&](){
|
||||
clean.funcs.push_back([=](){
|
||||
vk_destroy_instance(*inst);
|
||||
});
|
||||
|
||||
@@ -517,31 +517,31 @@ std::string get_gpu_info(){
|
||||
#if 0
|
||||
VkQueueFamilyProperties queue_family_props=vk_get_queue_family_properties(*pdev,0);
|
||||
if(auto dev=vk_create_device(*pdev,0,queue_family_props);dev){
|
||||
clean.funcs.push_back([&](){
|
||||
clean.funcs.push_back([=](){
|
||||
vk_destroy_device(*dev);
|
||||
});
|
||||
std::vector<VkDescriptorSetLayoutBinding> binds;
|
||||
binds.push_back(
|
||||
VkDescriptorSetLayoutBinding{0,VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,1,VK_SHADER_STAGE_COMPUTE_BIT,nullptr});
|
||||
auto descriptor_set_layout=vk_create_descriptor_set_layout(*dev,binds);
|
||||
clean.funcs.push_back([&](){
|
||||
clean.funcs.push_back([=](){
|
||||
vk_destroy_descriptor_set_layout(*dev,*descriptor_set_layout);
|
||||
});
|
||||
auto pipeline_layout=vk_create_pipeline_layout(*dev,*descriptor_set_layout);
|
||||
clean.funcs.push_back([&](){
|
||||
clean.funcs.push_back([=](){
|
||||
vk_destroy_pipeline_layout(*dev,*pipeline_layout);
|
||||
});
|
||||
std::optional<std::vector<uint32_t>> spv=vk_compile_glsl_to_spv(*dev,test_compute_pipeline_source(),vk_get_physical_device_limits(*pdev));
|
||||
auto module=vk_create_shader_module(*dev,*spv);
|
||||
|
||||
clean.funcs.push_back([&](){
|
||||
clean.funcs.push_back([=](){
|
||||
vk_destroy_shader_module(*dev,*module);
|
||||
});
|
||||
|
||||
auto pipeline=vk_create_compute_pipeline(*dev,*pipeline_layout,*module);
|
||||
if(pipeline){
|
||||
gpu_name+=":ok";
|
||||
clean.funcs.push_back([&](){
|
||||
clean.funcs.push_back([=](){
|
||||
vk_destroy_pipeline(*dev,*pipeline);
|
||||
});
|
||||
return "GPU [" + gpu_name +"(VK: "+gpu_vk_ver+ ")]:\n" + gpu_ext;
|
||||
@@ -549,7 +549,7 @@ std::string get_gpu_info(){
|
||||
|
||||
}
|
||||
#endif
|
||||
return "GPU [" + gpu_name +"(VK: "+gpu_vk_ver+ ")]:\n" + gpu_ext;
|
||||
return "GPU [" + gpu_name +"(Vulkan: "+gpu_vk_ver+ ")]:\n" + gpu_ext;
|
||||
|
||||
}
|
||||
return "获取gpu信息失败";
|
||||
|
||||
@@ -174,6 +174,68 @@ struct convert_16_block_32_swizzled
|
||||
}
|
||||
};
|
||||
#endif
|
||||
struct copy_u32_ror8_block {
|
||||
static void
|
||||
copy_mipmap_level(std::span<u32> dst, std::span<const u32> src, u16 width_in_block,
|
||||
u16 row_count, u16 depth, u8 border, u32 dst_pitch_in_block,
|
||||
u32 src_pitch_in_block) {
|
||||
const u32 width_in_words = width_in_block;
|
||||
const u32 src_pitch_in_words = src_pitch_in_block;
|
||||
const u32 dst_pitch_in_words = dst_pitch_in_block;
|
||||
|
||||
const u32 h_porch = border;
|
||||
const u32 v_porch = src_pitch_in_words * border;
|
||||
u32 src_offset = h_porch, dst_offset = 0;
|
||||
|
||||
for (int layer = 0; layer < depth; ++layer) {
|
||||
// Front
|
||||
src_offset += v_porch;
|
||||
|
||||
for (int row = 0; row < row_count; ++row) {
|
||||
for (u32 x = 0; x < width_in_words; ++x) {
|
||||
const u32 src_v = src[src_offset + x];
|
||||
dst[dst_offset + x] =( src_v>>8)|(src_v<<24);
|
||||
}
|
||||
|
||||
src_offset += src_pitch_in_words;
|
||||
dst_offset += dst_pitch_in_words;
|
||||
}
|
||||
|
||||
// Back
|
||||
src_offset += v_porch;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
struct copy_u32_ror8_block_swizzled {
|
||||
static void
|
||||
copy_mipmap_level(std::span<u32> dst, std::span<const u32> src, u16 width_in_block,
|
||||
u16 row_count, u16 depth, u8 border, u32 dst_pitch_in_block,
|
||||
u32 src_pitch_in_block) {
|
||||
u32 padded_width, padded_height;
|
||||
if (border)
|
||||
{
|
||||
padded_width = rsx::next_pow2(width_in_block + border + border);
|
||||
padded_height = rsx::next_pow2(row_count + border + border);
|
||||
}
|
||||
else
|
||||
{
|
||||
padded_width = width_in_block;
|
||||
padded_height = row_count;
|
||||
}
|
||||
|
||||
const u32 size_in_block = padded_width * padded_height * depth * 2;
|
||||
rsx::simple_array<u32> tmp(size_in_block * 1);
|
||||
|
||||
//if (words_per_block == 1) [[likely]]
|
||||
{
|
||||
rsx::convert_linear_swizzle_3d<u32>(src.data(), tmp.data(), padded_width, padded_height, depth);
|
||||
}
|
||||
|
||||
std::span<const u32> src_span = tmp;
|
||||
copy_u32_ror8_block::copy_mipmap_level(dst, src_span, width_in_block, row_count, depth, border, dst_pitch_in_block, padded_width);
|
||||
}
|
||||
};
|
||||
|
||||
struct copy_unmodified_block
|
||||
{
|
||||
@@ -429,8 +491,8 @@ struct copy_decoded_rb_rg_block
|
||||
green = (data >> 24) & 0xFF;
|
||||
}
|
||||
|
||||
dst[dst_offset + (col * 2)] = blue | (green << 8) | (red0 << 16) | (0xFF << 24);
|
||||
dst[dst_offset + (col * 2 + 1)] = blue | (green << 8) | (red1 << 16) | (0xFF << 24);
|
||||
dst[dst_offset + (col * 2)] = (red0 << 0)|(green << 8)|(blue<< 16) | (0xFF << 24);
|
||||
dst[dst_offset + (col * 2 + 1)] = (red1 << 0)|(green << 8)|(blue<< 16) | (0xFF << 24);
|
||||
}
|
||||
|
||||
src_offset += src_pitch_in_block;
|
||||
@@ -977,6 +1039,16 @@ namespace rsx
|
||||
|
||||
case CELL_GCM_TEXTURE_A8R8G8B8:
|
||||
case CELL_GCM_TEXTURE_D8R8G8B8:
|
||||
{
|
||||
if (is_swizzled)
|
||||
copy_u32_ror8_block_swizzled::copy_mipmap_level(dst_buffer.as_span<u32>(), src_layout.data.as_span<const u32>()
|
||||
, w, h, depth, src_layout.border, get_row_pitch_in_block<u32>(w, caps.alignment), src_layout.pitch_in_block);
|
||||
|
||||
else
|
||||
copy_u32_ror8_block::copy_mipmap_level(dst_buffer.as_span<u32>(), src_layout.data.as_span<const u32>()
|
||||
, w, h, depth, src_layout.border, get_row_pitch_in_block<u32>(w, caps.alignment), src_layout.pitch_in_block);
|
||||
break;
|
||||
}
|
||||
case CELL_GCM_TEXTURE_DEPTH24_D8:
|
||||
case CELL_GCM_TEXTURE_DEPTH24_D8_FLOAT: // Untested
|
||||
{
|
||||
|
||||
@@ -214,7 +214,7 @@ namespace vk
|
||||
case CELL_GCM_TEXTURE_A4R4G4B4: return VK_FORMAT_B8G8R8A8_UNORM;
|
||||
#endif
|
||||
case CELL_GCM_TEXTURE_B8: return VK_FORMAT_R8_UNORM;
|
||||
case CELL_GCM_TEXTURE_A8R8G8B8: return VK_FORMAT_B8G8R8A8_UNORM;
|
||||
case CELL_GCM_TEXTURE_A8R8G8B8: return VK_FORMAT_R8G8B8A8_UNORM;
|
||||
case CELL_GCM_TEXTURE_COMPRESSED_DXT1: return supports_dxt ? VK_FORMAT_BC1_RGBA_UNORM_BLOCK : VK_FORMAT_R8G8B8A8_UNORM;
|
||||
case CELL_GCM_TEXTURE_COMPRESSED_DXT23: return supports_dxt ? VK_FORMAT_BC2_UNORM_BLOCK : VK_FORMAT_R8G8B8A8_UNORM;
|
||||
case CELL_GCM_TEXTURE_COMPRESSED_DXT45: return supports_dxt ? VK_FORMAT_BC3_UNORM_BLOCK : VK_FORMAT_R8G8B8A8_UNORM;
|
||||
@@ -229,11 +229,11 @@ namespace vk
|
||||
case CELL_GCM_TEXTURE_W16_Z16_Y16_X16_FLOAT: return VK_FORMAT_R16G16B16A16_SFLOAT;
|
||||
case CELL_GCM_TEXTURE_W32_Z32_Y32_X32_FLOAT: return VK_FORMAT_R32G32B32A32_SFLOAT;
|
||||
case CELL_GCM_TEXTURE_X32_FLOAT: return VK_FORMAT_R32_SFLOAT;
|
||||
case CELL_GCM_TEXTURE_D8R8G8B8: return VK_FORMAT_B8G8R8A8_UNORM;
|
||||
case CELL_GCM_TEXTURE_D8R8G8B8: return VK_FORMAT_R8G8B8A8_UNORM;
|
||||
case CELL_GCM_TEXTURE_COMPRESSED_HILO8: return VK_FORMAT_R8G8_UNORM;
|
||||
case CELL_GCM_TEXTURE_COMPRESSED_HILO_S8: return VK_FORMAT_R8G8_SNORM;
|
||||
case CELL_GCM_TEXTURE_COMPRESSED_B8R8_G8R8: return VK_FORMAT_B8G8R8A8_UNORM;
|
||||
case CELL_GCM_TEXTURE_COMPRESSED_R8B8_R8G8: return VK_FORMAT_B8G8R8A8_UNORM;
|
||||
case CELL_GCM_TEXTURE_COMPRESSED_B8R8_G8R8: return VK_FORMAT_R8G8B8A8_UNORM;
|
||||
case CELL_GCM_TEXTURE_COMPRESSED_R8B8_R8G8: return VK_FORMAT_R8G8B8A8_UNORM;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -282,7 +282,7 @@ namespace vk
|
||||
case VK_FORMAT_R8G8B8A8_UNORM:
|
||||
case VK_FORMAT_R8G8B8A8_SRGB:
|
||||
case VK_FORMAT_B8G8R8A8_UNORM:
|
||||
case VK_FORMAT_B8G8R8A8_SRGB:
|
||||
//case VK_FORMAT_B8G8R8A8_SRGB:
|
||||
case VK_FORMAT_BC1_RGBA_UNORM_BLOCK:
|
||||
case VK_FORMAT_BC2_UNORM_BLOCK:
|
||||
case VK_FORMAT_BC3_UNORM_BLOCK:
|
||||
@@ -324,7 +324,7 @@ namespace vk
|
||||
case VK_FORMAT_R8G8B8A8_UNORM:
|
||||
case VK_FORMAT_R8G8B8A8_SRGB:
|
||||
case VK_FORMAT_B8G8R8A8_UNORM:
|
||||
case VK_FORMAT_B8G8R8A8_SRGB:
|
||||
//case VK_FORMAT_B8G8R8A8_SRGB:
|
||||
return{ 4, 1 }; //UNSIGNED_INT_8_8_8_8
|
||||
//16-bit
|
||||
case VK_FORMAT_R16_UINT:
|
||||
@@ -378,7 +378,7 @@ namespace vk
|
||||
return{ false, 1 };
|
||||
case VK_FORMAT_B8G8R8A8_UNORM:
|
||||
case VK_FORMAT_R8G8B8A8_UNORM:
|
||||
case VK_FORMAT_B8G8R8A8_SRGB:
|
||||
//case VK_FORMAT_B8G8R8A8_SRGB:
|
||||
case VK_FORMAT_R8G8B8A8_SRGB:
|
||||
return{ true, 4 };
|
||||
//16-bit
|
||||
|
||||
@@ -55,23 +55,23 @@ namespace vk
|
||||
case rsx::surface_color_format::x1r5g5b5_z1r5g5b5:
|
||||
return std::make_pair(VK_FORMAT_B8G8R8A8_UNORM, z_rgb);
|
||||
#endif
|
||||
case rsx::surface_color_format::a8r8g8b8:
|
||||
return std::make_pair(VK_FORMAT_B8G8R8A8_UNORM, vk::default_component_map);
|
||||
case rsx::surface_color_format::a8r8g8b8:
|
||||
return std::make_pair(VK_FORMAT_R8G8B8A8_UNORM, vk::default_component_map);
|
||||
|
||||
case rsx::surface_color_format::a8b8g8r8:
|
||||
return std::make_pair(VK_FORMAT_R8G8B8A8_UNORM, vk::default_component_map);
|
||||
case rsx::surface_color_format::a8b8g8r8:
|
||||
return std::make_pair(VK_FORMAT_B8G8R8A8_UNORM, vk::default_component_map);
|
||||
|
||||
case rsx::surface_color_format::x8b8g8r8_o8b8g8r8:
|
||||
return std::make_pair(VK_FORMAT_R8G8B8A8_UNORM, o_rgb);
|
||||
case rsx::surface_color_format::x8b8g8r8_o8b8g8r8:
|
||||
return std::make_pair(VK_FORMAT_B8G8R8A8_UNORM, o_rgb);
|
||||
|
||||
case rsx::surface_color_format::x8b8g8r8_z8b8g8r8:
|
||||
return std::make_pair(VK_FORMAT_R8G8B8A8_UNORM, z_rgb);
|
||||
case rsx::surface_color_format::x8b8g8r8_z8b8g8r8:
|
||||
return std::make_pair(VK_FORMAT_B8G8R8A8_UNORM, z_rgb);
|
||||
|
||||
case rsx::surface_color_format::x8r8g8b8_z8r8g8b8:
|
||||
return std::make_pair(VK_FORMAT_B8G8R8A8_UNORM, z_rgb);
|
||||
case rsx::surface_color_format::x8r8g8b8_z8r8g8b8:
|
||||
return std::make_pair(VK_FORMAT_R8G8B8A8_UNORM, z_rgb);
|
||||
|
||||
case rsx::surface_color_format::x8r8g8b8_o8r8g8b8:
|
||||
return std::make_pair(VK_FORMAT_B8G8R8A8_UNORM, o_rgb);
|
||||
case rsx::surface_color_format::x8r8g8b8_o8r8g8b8:
|
||||
return std::make_pair(VK_FORMAT_R8G8B8A8_UNORM, o_rgb);
|
||||
|
||||
case rsx::surface_color_format::w16z16y16x16:
|
||||
return std::make_pair(VK_FORMAT_R16G16B16A16_SFLOAT, vk::default_component_map);
|
||||
|
||||
@@ -24,9 +24,11 @@ namespace
|
||||
rsx_log.error("Unhandled video output format 0x%x", static_cast<s32>(format));
|
||||
[[fallthrough]];
|
||||
case CELL_VIDEO_OUT_BUFFER_COLOR_FORMAT_X8R8G8B8:
|
||||
return VK_FORMAT_B8G8R8A8_UNORM;
|
||||
//return VK_FORMAT_B8G8R8A8_UNORM;
|
||||
return VK_FORMAT_R8G8B8A8_UNORM;
|
||||
case CELL_VIDEO_OUT_BUFFER_COLOR_FORMAT_X8B8G8R8:
|
||||
return VK_FORMAT_R8G8B8A8_UNORM;
|
||||
//return VK_FORMAT_R8G8B8A8_UNORM;
|
||||
return VK_FORMAT_B8G8R8A8_UNORM;
|
||||
case CELL_VIDEO_OUT_BUFFER_COLOR_FORMAT_R16G16B16X16_FLOAT:
|
||||
return VK_FORMAT_R16G16B16A16_SFLOAT;
|
||||
}
|
||||
@@ -127,7 +129,9 @@ void VKGSRender::present(vk::frame_context_t *ctx)
|
||||
case VK_SUCCESS:
|
||||
break;
|
||||
case VK_SUBOPTIMAL_KHR:
|
||||
//FIXME
|
||||
//should_reinitialize_swapchain = true;
|
||||
//rsx_log.warning("#### Swapchain is out of date. Please resize the window.");
|
||||
break;
|
||||
case VK_ERROR_OUT_OF_DATE_KHR:
|
||||
swapchain_unavailable = true;
|
||||
|
||||
@@ -1268,7 +1268,7 @@ namespace vk
|
||||
return (vk_format == VK_FORMAT_R32_SFLOAT);
|
||||
case CELL_GCM_TEXTURE_A8R8G8B8:
|
||||
case CELL_GCM_TEXTURE_D8R8G8B8:
|
||||
return (vk_format == VK_FORMAT_B8G8R8A8_UNORM || vk_format == VK_FORMAT_D24_UNORM_S8_UINT || vk_format == VK_FORMAT_D32_SFLOAT_S8_UINT);
|
||||
return (vk_format == VK_FORMAT_R8G8B8A8_UNORM || vk_format == VK_FORMAT_D24_UNORM_S8_UINT || vk_format == VK_FORMAT_D32_SFLOAT_S8_UINT);
|
||||
case CELL_GCM_TEXTURE_B8:
|
||||
return (vk_format == VK_FORMAT_R8_UNORM);
|
||||
case CELL_GCM_TEXTURE_G8B8:
|
||||
@@ -1491,7 +1491,7 @@ namespace vk
|
||||
linear_format_supported = m_formats_support.bgra8_linear;
|
||||
break;
|
||||
case VK_FORMAT_R8G8B8A8_UNORM:
|
||||
linear_format_supported = m_formats_support.argb8_linear;
|
||||
linear_format_supported = m_formats_support.rgba8_linear;
|
||||
break;
|
||||
default:
|
||||
rsx_log.error("Unsupported VkFormat 0x%x", static_cast<u32>(format));
|
||||
|
||||
@@ -1173,7 +1173,7 @@ namespace vk
|
||||
}
|
||||
|
||||
// Check if linear RGBA8 images can be used for present
|
||||
result.argb8_linear = test_format_features(VK_FORMAT_R8G8B8A8_UNORM, VK_FORMAT_FEATURE_BLIT_SRC_BIT, VK_TRUE);
|
||||
result.rgba8_linear = test_format_features(VK_FORMAT_R8G8B8A8_UNORM, VK_FORMAT_FEATURE_BLIT_SRC_BIT, VK_TRUE);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace vk
|
||||
bool d24_unorm_s8 : 1;
|
||||
bool d32_sfloat_s8 : 1;
|
||||
bool bgra8_linear : 1;
|
||||
bool argb8_linear : 1;
|
||||
bool rgba8_linear : 1;
|
||||
};
|
||||
|
||||
struct gpu_shader_types_support
|
||||
|
||||
@@ -224,7 +224,7 @@ namespace vk
|
||||
}
|
||||
else if (msgFlags & VK_DEBUG_REPORT_WARNING_BIT_EXT)
|
||||
{
|
||||
rsx_log.warning("WARNING: [%s] Code %d : %s", pLayerPrefix, msgCode, pMsg);
|
||||
rsx_log.error("WARNING: [%s] Code %d : %s", pLayerPrefix, msgCode, pMsg);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -43,12 +43,12 @@ namespace vk
|
||||
display_handle_t window_handle{};
|
||||
u32 m_width = 0;
|
||||
u32 m_height = 0;
|
||||
VkFormat m_surface_format = VK_FORMAT_B8G8R8A8_UNORM;
|
||||
VkFormat m_surface_format = VK_FORMAT_R8G8B8A8_UNORM;
|
||||
|
||||
virtual void init_swapchain_images(render_device& dev, u32 count) = 0;
|
||||
|
||||
public:
|
||||
swapchain_base(physical_device& gpu, u32 present_queue, u32 graphics_queue, u32 transfer_queue, VkFormat format = VK_FORMAT_B8G8R8A8_UNORM);
|
||||
swapchain_base(physical_device& gpu, u32 present_queue, u32 graphics_queue, u32 transfer_queue, VkFormat format = VK_FORMAT_R8G8B8A8_UNORM);
|
||||
|
||||
virtual ~swapchain_base() = default;
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace vk
|
||||
std::vector<T> swapchain_images;
|
||||
|
||||
public:
|
||||
abstract_swapchain_impl(physical_device& gpu, u32 present_queue, u32 graphics_queue, u32 transfer_queue, VkFormat format = VK_FORMAT_B8G8R8A8_UNORM)
|
||||
abstract_swapchain_impl(physical_device& gpu, u32 present_queue, u32 graphics_queue, u32 transfer_queue, VkFormat format = VK_FORMAT_R8G8B8A8_UNORM)
|
||||
: swapchain_base(gpu, present_queue, graphics_queue, transfer_queue, format)
|
||||
{}
|
||||
|
||||
|
||||
@@ -39,7 +39,11 @@ public class Emulator
|
||||
}
|
||||
private native long native_open_config_file(String config_path) ;
|
||||
private native String native_load_config_entry(long n_handle,String tag);
|
||||
|
||||
private native String[] native_load_config_entry_ty_arr(long n_handle,String tag);
|
||||
private native void native_save_config_entry(long n_handle,String tag,String val);
|
||||
|
||||
private native void native_save_config_entry_ty_arr(long n_handle,String tag,String[] val);
|
||||
private native void native_close_config_file(long n_handle,String config_path);
|
||||
public static Config open_config_file(String config_path) throws ConfigFileException
|
||||
{
|
||||
@@ -50,10 +54,21 @@ public class Emulator
|
||||
{
|
||||
return native_load_config_entry(n_handle,tag);
|
||||
}
|
||||
|
||||
|
||||
public String[] load_config_entry_ty_arr(String tag)
|
||||
{
|
||||
return native_load_config_entry_ty_arr(n_handle,tag);
|
||||
}
|
||||
public void save_config_entry(String tag,String val)
|
||||
{
|
||||
native_save_config_entry(n_handle,tag,val);
|
||||
}
|
||||
|
||||
public void save_config_entry_ty_arr(String tag,String[] val)
|
||||
{
|
||||
native_save_config_entry_ty_arr(n_handle,tag,val);
|
||||
}
|
||||
public void close_config_file()
|
||||
{
|
||||
native_close_config_file(n_handle,config_path);
|
||||
@@ -405,6 +420,8 @@ public class Emulator
|
||||
|
||||
public native String[] get_support_llvm_cpu_list();
|
||||
|
||||
public native String[] get_vulkan_physical_dev_list();
|
||||
|
||||
//public native boolean support_custom_driver();
|
||||
public native String generate_config_xml();
|
||||
public native String generate_strings_xml();
|
||||
|
||||
@@ -40,6 +40,11 @@ public class EmulatorActivity extends Activity implements View.OnGenericMotionLi
|
||||
|
||||
load_key_map();
|
||||
Emulator.MetaInfo meta_info = (Emulator.MetaInfo) getIntent().getSerializableExtra("meta_info");
|
||||
/*if(meta_info==null){
|
||||
meta_info=Emulator.get.meta_info_from_dir("/storage/emulated/0/Android/data/aenu.aps3e/files/aps3e/config/dev_hdd0/game/NPJB00521");
|
||||
Emulator.get.setup_game_info(meta_info);
|
||||
return;
|
||||
}*/
|
||||
if(meta_info.eboot_path!=null&&meta_info.iso_uri==null)
|
||||
Emulator.get.setup_game_info(meta_info);
|
||||
else if(meta_info.eboot_path==null&&meta_info.iso_uri!=null){
|
||||
|
||||
@@ -2,13 +2,28 @@ package aenu.aps3e;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Typeface;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import android.text.SpannableString;
|
||||
import android.text.Spanned;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.text.style.StrikethroughSpan;
|
||||
import android.text.style.StyleSpan;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.ListView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.activity.OnBackPressedCallback;
|
||||
@@ -32,10 +47,16 @@ import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipInputStream;
|
||||
|
||||
import aenu.preference.ColorPickerDialog;
|
||||
|
||||
public class EmulatorSettings extends AppCompatActivity {
|
||||
|
||||
static final int REQUEST_CODE_SELECT_CUSTOM_DRIVER=6001;
|
||||
@@ -180,6 +201,8 @@ public class EmulatorSettings extends AppCompatActivity {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
final String[] BOOL_KEYS={
|
||||
"Core|PPU Debug",
|
||||
"Core|PPU Calling History",
|
||||
@@ -266,7 +289,6 @@ public class EmulatorSettings extends AppCompatActivity {
|
||||
"Input/Output|Lock overlay input to player one",
|
||||
"Input/Output|Load SDL GameController Mappings",
|
||||
"Input/Output|IO Debug overlay",
|
||||
"Net|UPNP Enabled",
|
||||
"Savestate|Start Paused",
|
||||
"Savestate|Suspend Emulation Savestate Mode",
|
||||
"Savestate|Compatible Savestate Mode",
|
||||
@@ -313,8 +335,6 @@ public class EmulatorSettings extends AppCompatActivity {
|
||||
"Core|SPU GETLLAR Busy Waiting Percentage",
|
||||
"Core|MFC Commands Shuffling Limit",
|
||||
"Core|MFC Commands Timeout",
|
||||
"Core|SPU LLVM Lower Bound",
|
||||
"Core|SPU LLVM Upper Bound",
|
||||
"Core|TSX Transaction First Limit",
|
||||
"Core|TSX Transaction Second Limit",
|
||||
"Core|SPU Wake-Up Delay",
|
||||
@@ -336,8 +356,6 @@ public class EmulatorSettings extends AppCompatActivity {
|
||||
"Video|Shader Loading Dialog|Blur effect strength",
|
||||
"Audio|Audio Formats",
|
||||
"Input/Output|Pad handler sleep (microseconds)",
|
||||
"System|PSID high",
|
||||
"System|PSID low",
|
||||
};
|
||||
final String[] STRING_ARR_KEYS={
|
||||
"Core|PPU Decoder",
|
||||
@@ -385,8 +403,6 @@ public class EmulatorSettings extends AppCompatActivity {
|
||||
"System|Language",
|
||||
"System|Keyboard Type",
|
||||
"System|Enter button assignment",
|
||||
"Net|Internet enabled",
|
||||
"Net|PSN status",
|
||||
"Miscellaneous|Font File Selection",
|
||||
};
|
||||
final String[] NODE_KEYS={
|
||||
@@ -398,7 +414,6 @@ public class EmulatorSettings extends AppCompatActivity {
|
||||
"Audio",
|
||||
"Input/Output",
|
||||
"System",
|
||||
"Net",
|
||||
"Savestate",
|
||||
"Miscellaneous",
|
||||
};
|
||||
@@ -432,6 +447,22 @@ public class EmulatorSettings extends AppCompatActivity {
|
||||
pref.setPreferenceDataStore(data_store);
|
||||
}
|
||||
|
||||
final Preference.OnPreferenceChangeListener list_pref_change_listener=new Preference.OnPreferenceChangeListener() {
|
||||
@Override
|
||||
public boolean onPreferenceChange(@NonNull Preference preference, Object newValue) {
|
||||
ListPreference pref=(ListPreference) preference;
|
||||
CharSequence value=(CharSequence) newValue;
|
||||
CharSequence[] values=pref.getEntryValues();
|
||||
CharSequence[] entries=pref.getEntries();
|
||||
for (int i=0;i<values.length;i++){
|
||||
if (values[i].equals(value)){
|
||||
pref.setSummary(entries[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
for (String key:STRING_ARR_KEYS){
|
||||
ListPreference pref=findPreference(key);
|
||||
String val_str=config.load_config_entry(key);
|
||||
@@ -439,7 +470,7 @@ public class EmulatorSettings extends AppCompatActivity {
|
||||
pref.setValue(val_str);
|
||||
pref.setSummary(pref.getEntry());
|
||||
}
|
||||
//pref.setOnPreferenceChangeListener(this);
|
||||
pref.setOnPreferenceChangeListener(list_pref_change_listener);
|
||||
pref.setPreferenceDataStore(data_store);
|
||||
}
|
||||
|
||||
@@ -448,10 +479,15 @@ public class EmulatorSettings extends AppCompatActivity {
|
||||
pref.setOnPreferenceClickListener(this);
|
||||
}
|
||||
|
||||
findPreference("Core|Libraries Control").setOnPreferenceClickListener(this);
|
||||
|
||||
String val;
|
||||
findPreference("Core|Use LLVM CPU").setOnPreferenceClickListener(this);
|
||||
if((val=config.load_config_entry("Core|Use LLVM CPU"))!=null) findPreference("Core|Use LLVM CPU").setSummary(val);
|
||||
|
||||
findPreference("Video|Vulkan|Adapter").setOnPreferenceClickListener(this);
|
||||
if((val=config.load_config_entry("Video|Vulkan|Adapter"))!=null) findPreference("Video|Vulkan|Adapter").setSummary(val);
|
||||
|
||||
findPreference("Video|Vulkan|Custom Driver Library Path").setOnPreferenceClickListener(this);
|
||||
findPreference("Miscellaneous|Custom Font File Path").setOnPreferenceClickListener(this);
|
||||
|
||||
@@ -492,6 +528,20 @@ public class EmulatorSettings extends AppCompatActivity {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDisplayPreferenceDialog( @NonNull Preference pref) {
|
||||
if (pref instanceof ColorPickerDialog) {
|
||||
final DialogFragment f = ColorPickerDialog.ColorPickerPreferenceFragmentCompat.newInstance(pref.getKey());
|
||||
f.setTargetFragment(this, 0);
|
||||
f.show(getParentFragmentManager(), "DIALOG_FRAGMENT_TAG");
|
||||
return;
|
||||
}
|
||||
super.onDisplayPreferenceDialog(pref);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void setup_costom_driver_library_path(String new_path) {
|
||||
final String key="Video|Vulkan|Custom Driver Library Path";
|
||||
if(new_path==null){
|
||||
@@ -562,6 +612,11 @@ public class EmulatorSettings extends AppCompatActivity {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(preference.getKey().equals("Video|Vulkan|Adapter")){
|
||||
show_select_vulkan_phy_dev_list();
|
||||
return false;
|
||||
}
|
||||
|
||||
if(preference.getKey().equals("Video|Vulkan|Custom Driver Library Path")){
|
||||
show_select_custom_driver_list();
|
||||
return false;
|
||||
@@ -571,6 +626,10 @@ public class EmulatorSettings extends AppCompatActivity {
|
||||
show_select_font_file_list();
|
||||
return false;
|
||||
}
|
||||
if (preference.getKey().equals("Core|Libraries Control")){
|
||||
show_library_control_view();
|
||||
return false;
|
||||
}
|
||||
if(preference instanceof PreferenceScreen){
|
||||
setPreferenceScreen(root_pref.findPreference(preference.getKey()));
|
||||
return false;
|
||||
@@ -599,6 +658,20 @@ public class EmulatorSettings extends AppCompatActivity {
|
||||
});
|
||||
}
|
||||
|
||||
void show_select_vulkan_phy_dev_list(){
|
||||
String[] items=Emulator.get.get_vulkan_physical_dev_list();
|
||||
create_list_dialog(getString(R.string.emulator_settings_video_vulkan_adapter)
|
||||
, items, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
dialog.dismiss();
|
||||
config.save_config_entry("Video|Vulkan|Adapter",items[which]);
|
||||
findPreference("Video|Vulkan|Adapter").setSummary(items[which]);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
void show_select_custom_driver_list(){
|
||||
File[] files=Application.get_custom_driver_dir().listFiles();
|
||||
if(files==null||files.length==0){
|
||||
@@ -662,6 +735,28 @@ public class EmulatorSettings extends AppCompatActivity {
|
||||
});
|
||||
}
|
||||
|
||||
void show_library_control_view(){
|
||||
LibraryControlAdapter adapter=new LibraryControlAdapter(getContext());
|
||||
adapter.set_modify_libs(config.load_config_entry_ty_arr("Core|Libraries Control"));
|
||||
ListView view = new ListView(getContext());
|
||||
view.setAdapter(adapter);
|
||||
view.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
LibraryControlAdapter adapter= (LibraryControlAdapter) parent.getAdapter();
|
||||
int new_lib_type=adapter.get_lib_type(position)^1;
|
||||
adapter.set_lib_trpe(position,new_lib_type);
|
||||
config.save_config_entry_ty_arr("Core|Libraries Control",adapter.get_modify_libs());
|
||||
}
|
||||
});
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
|
||||
builder.setTitle(R.string.emulator_settings_core_libraries_control)
|
||||
.setView(view)
|
||||
.setNegativeButton(android.R.string.cancel, null);
|
||||
builder.create().show();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
SettingsFragment fragment;
|
||||
@@ -775,4 +870,256 @@ public class EmulatorSettings extends AppCompatActivity {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static class LibraryControlAdapter extends BaseAdapter{
|
||||
|
||||
static final int LIB_TYPE_LLE=0;
|
||||
static final int LIB_TYPE_HLE=1;
|
||||
|
||||
static final Map<String, Integer> libs=new HashMap<>();
|
||||
|
||||
static {
|
||||
libs.put("/dev_flash/sys/internal/libfs_utility_init.sprx", 1);
|
||||
libs.put("libaacenc.sprx", 0);
|
||||
libs.put("libaacenc_spurs.sprx", 0);
|
||||
libs.put("libac3dec.sprx", 0);
|
||||
libs.put("libac3dec2.sprx", 0);
|
||||
libs.put("libadec.sprx", 1);
|
||||
libs.put("libadec2.sprx", 0);
|
||||
libs.put("libadec_internal.sprx", 0);
|
||||
libs.put("libad_async.sprx", 0);
|
||||
libs.put("libad_billboard_util.sprx", 0);
|
||||
libs.put("libad_core.sprx", 0);
|
||||
libs.put("libapostsrc_mini.sprx", 0);
|
||||
libs.put("libasfparser2_astd.sprx", 0);
|
||||
libs.put("libat3dec.sprx", 0);
|
||||
libs.put("libat3multidec.sprx", 0);
|
||||
libs.put("libatrac3multi.sprx", 0);
|
||||
libs.put("libatrac3plus.sprx", 0);
|
||||
libs.put("libatxdec.sprx", 1);
|
||||
libs.put("libatxdec2.sprx", 0);
|
||||
libs.put("libaudio.sprx", 1);
|
||||
libs.put("libavcdec.sprx", 0);
|
||||
libs.put("libavcenc.sprx", 0);
|
||||
libs.put("libavcenc_small.sprx", 0);
|
||||
libs.put("libavchatjpgdec.sprx", 0);
|
||||
libs.put("libbeisobmf.sprx", 0);
|
||||
libs.put("libbemp2sys.sprx", 0);
|
||||
libs.put("libcamera.sprx", 1);
|
||||
libs.put("libcelp8dec.sprx", 0);
|
||||
libs.put("libcelp8enc.sprx", 0);
|
||||
libs.put("libcelpdec.sprx", 0);
|
||||
libs.put("libcelpenc.sprx", 0);
|
||||
libs.put("libddpdec.sprx", 0);
|
||||
libs.put("libdivxdec.sprx", 0);
|
||||
libs.put("libdmux.sprx", 0);
|
||||
libs.put("libdmuxpamf.sprx", 0);
|
||||
libs.put("libdtslbrdec.sprx", 0);
|
||||
libs.put("libfiber.sprx", 0);
|
||||
libs.put("libfont.sprx", 0);
|
||||
libs.put("libfontFT.sprx", 0);
|
||||
libs.put("libfreetype.sprx", 0);
|
||||
libs.put("libfreetypeTT.sprx", 0);
|
||||
libs.put("libfs.sprx", 0);
|
||||
libs.put("libfs_155.sprx", 0);
|
||||
libs.put("libgcm_sys.sprx", 0);
|
||||
libs.put("libgem.sprx", 1);
|
||||
libs.put("libgifdec.sprx", 0);
|
||||
libs.put("libhttp.sprx", 0);
|
||||
libs.put("libio.sprx", 1);
|
||||
libs.put("libjpgdec.sprx", 0);
|
||||
libs.put("libjpgenc.sprx", 0);
|
||||
libs.put("libkey2char.sprx", 0);
|
||||
libs.put("libl10n.sprx", 0);
|
||||
libs.put("liblv2.sprx", 0);
|
||||
libs.put("liblv2coredump.sprx", 0);
|
||||
libs.put("liblv2dbg_for_cex.sprx", 0);
|
||||
libs.put("libm2bcdec.sprx", 0);
|
||||
libs.put("libm4aacdec.sprx", 0);
|
||||
libs.put("libm4aacdec2ch.sprx", 0);
|
||||
libs.put("libm4hdenc.sprx", 0);
|
||||
libs.put("libm4venc.sprx", 0);
|
||||
libs.put("libmedi.sprx", 1);
|
||||
libs.put("libmic.sprx", 1);
|
||||
libs.put("libmp3dec.sprx", 0);
|
||||
libs.put("libmp4.sprx", 0);
|
||||
libs.put("libmpl1dec.sprx", 0);
|
||||
libs.put("libmvcdec.sprx", 0);
|
||||
libs.put("libnet.sprx", 0);
|
||||
libs.put("libnetctl.sprx", 1);
|
||||
libs.put("libpamf.sprx", 1);
|
||||
libs.put("libpngdec.sprx", 0);
|
||||
libs.put("libpngenc.sprx", 0);
|
||||
libs.put("libresc.sprx", 0);
|
||||
libs.put("librtc.sprx", 1);
|
||||
libs.put("librudp.sprx", 0);
|
||||
libs.put("libsail.sprx", 0);
|
||||
libs.put("libsail_avi.sprx", 0);
|
||||
libs.put("libsail_rec.sprx", 0);
|
||||
libs.put("libsjvtd.sprx", 0);
|
||||
libs.put("libsmvd2.sprx", 0);
|
||||
libs.put("libsmvd4.sprx", 0);
|
||||
libs.put("libspurs_jq.sprx", 0);
|
||||
libs.put("libsre.sprx", 0);
|
||||
libs.put("libssl.sprx", 0);
|
||||
libs.put("libsvc1d.sprx", 0);
|
||||
libs.put("libsync2.sprx", 0);
|
||||
libs.put("libsysmodule.sprx", 0);
|
||||
libs.put("libsysutil.sprx", 1);
|
||||
libs.put("libsysutil_ap.sprx", 1);
|
||||
libs.put("libsysutil_authdialog.sprx", 1);
|
||||
libs.put("libsysutil_avc2.sprx", 1);
|
||||
libs.put("libsysutil_avconf_ext.sprx", 1);
|
||||
libs.put("libsysutil_avc_ext.sprx", 1);
|
||||
libs.put("libsysutil_bgdl.sprx", 1);
|
||||
libs.put("libsysutil_cross_controller.sprx", 1);
|
||||
libs.put("libsysutil_dec_psnvideo.sprx", 1);
|
||||
libs.put("libsysutil_dtcp_ip.sprx", 1);
|
||||
libs.put("libsysutil_game.sprx", 1);
|
||||
libs.put("libsysutil_game_exec.sprx", 1);
|
||||
libs.put("libsysutil_imejp.sprx", 1);
|
||||
libs.put("libsysutil_misc.sprx", 1);
|
||||
libs.put("libsysutil_music.sprx", 1);
|
||||
libs.put("libsysutil_music_decode.sprx", 1);
|
||||
libs.put("libsysutil_music_export.sprx", 1);
|
||||
libs.put("libsysutil_np.sprx", 1);
|
||||
libs.put("libsysutil_np2.sprx", 1);
|
||||
libs.put("libsysutil_np_clans.sprx", 1);
|
||||
libs.put("libsysutil_np_commerce2.sprx", 1);
|
||||
libs.put("libsysutil_np_eula.sprx", 1);
|
||||
libs.put("libsysutil_np_installer.sprx", 1);
|
||||
libs.put("libsysutil_np_sns.sprx", 1);
|
||||
libs.put("libsysutil_np_trophy.sprx", 1);
|
||||
libs.put("libsysutil_np_tus.sprx", 1);
|
||||
libs.put("libsysutil_np_util.sprx", 1);
|
||||
libs.put("libsysutil_oskdialog_ext.sprx", 1);
|
||||
libs.put("libsysutil_pesm.sprx", 1);
|
||||
libs.put("libsysutil_photo_decode.sprx", 1);
|
||||
libs.put("libsysutil_photo_export.sprx", 1);
|
||||
libs.put("libsysutil_photo_export2.sprx", 1);
|
||||
libs.put("libsysutil_photo_import.sprx", 1);
|
||||
libs.put("libsysutil_photo_network_sharing.sprx", 1);
|
||||
libs.put("libsysutil_print.sprx", 1);
|
||||
libs.put("libsysutil_rec.sprx", 1);
|
||||
libs.put("libsysutil_remoteplay.sprx", 1);
|
||||
libs.put("libsysutil_rtcalarm.sprx", 1);
|
||||
libs.put("libsysutil_savedata.sprx", 1);
|
||||
libs.put("libsysutil_savedata_psp.sprx", 1);
|
||||
libs.put("libsysutil_screenshot.sprx", 1);
|
||||
libs.put("libsysutil_search.sprx", 1);
|
||||
libs.put("libsysutil_storagedata.sprx", 1);
|
||||
libs.put("libsysutil_subdisplay.sprx", 1);
|
||||
libs.put("libsysutil_syschat.sprx", 1);
|
||||
libs.put("libsysutil_sysconf_ext.sprx", 1);
|
||||
libs.put("libsysutil_userinfo.sprx", 1);
|
||||
libs.put("libsysutil_video_export.sprx", 1);
|
||||
libs.put("libsysutil_video_player.sprx", 1);
|
||||
libs.put("libsysutil_video_upload.sprx", 1);
|
||||
libs.put("libusbd.sprx", 0);
|
||||
libs.put("libusbpspcm.sprx", 0);
|
||||
libs.put("libvdec.sprx", 1);
|
||||
libs.put("libvoice.sprx", 1);
|
||||
libs.put("libvpost.sprx", 0);
|
||||
libs.put("libvpost2.sprx", 0);
|
||||
libs.put("libwmadec.sprx", 0);
|
||||
}
|
||||
|
||||
final String[] libs_name=libs.keySet().toArray(new String[0]);
|
||||
|
||||
final Map<String, Integer> modify=new HashMap<>();
|
||||
|
||||
Context context;
|
||||
LibraryControlAdapter(Context ctx){
|
||||
this.context=ctx;
|
||||
}
|
||||
|
||||
int get_lib_type(int pos){
|
||||
if(modify.containsKey(libs_name[pos]))
|
||||
return modify.get(libs_name[pos]);
|
||||
return libs.get(libs_name[pos]);
|
||||
}
|
||||
|
||||
void set_lib_trpe(int pos,int type){
|
||||
int default_type=libs.get(libs_name[pos]);
|
||||
if(type==default_type){
|
||||
if(modify.containsKey(libs_name[pos]))
|
||||
modify.remove(libs_name[pos]);
|
||||
}
|
||||
else{
|
||||
modify.put(libs_name[pos], type);
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
void set_modify_libs(String[] modify_libs){
|
||||
modify.clear();
|
||||
if(modify_libs==null||modify_libs.length==0) return;
|
||||
for(String s:modify_libs){
|
||||
String[] split=s.split(":");
|
||||
String lib_name=split[0];
|
||||
int type=split[1].equals("lle")?LIB_TYPE_LLE:LIB_TYPE_HLE;
|
||||
if(!libs.containsKey(lib_name))
|
||||
continue;
|
||||
if(libs.get(lib_name)==type)
|
||||
continue;
|
||||
modify.put(lib_name, type);
|
||||
}
|
||||
}
|
||||
String[] get_modify_libs(){
|
||||
List<String> l=new ArrayList<>();
|
||||
for(Map.Entry<String, Integer> e:modify.entrySet()){
|
||||
String lib_name=e.getKey();
|
||||
String lib_ty=e.getValue()==LIB_TYPE_LLE?"lle":"hle";
|
||||
l.add(lib_name+":"+lib_ty);
|
||||
}
|
||||
return l.toArray(new String[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return libs_name.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int position) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
LayoutInflater get_inflater(){
|
||||
return (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
}
|
||||
|
||||
void setup_type_view(TextView v,int type){
|
||||
CharSequence text=type==LIB_TYPE_LLE?"lle":"hle";
|
||||
SpannableString span=new SpannableString(text);
|
||||
|
||||
if(type==LIB_TYPE_LLE){
|
||||
span.setSpan(new ForegroundColorSpan(Color.YELLOW),0,text.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
}
|
||||
else{//HLE
|
||||
span.setSpan(new ForegroundColorSpan(Color.BLUE),0,text.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
}
|
||||
v.setText(span);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
if(convertView==null){
|
||||
convertView=get_inflater().inflate(R.layout.library_entry,null);
|
||||
}
|
||||
TextView name_v=(TextView) convertView.findViewById(R.id.lib_name);
|
||||
String name=libs_name[position];
|
||||
name_v.setText(name);
|
||||
int ty=modify.containsKey(name)?modify.get(name):libs.get(name);
|
||||
TextView type_v=(TextView) convertView.findViewById(R.id.lib_type);
|
||||
setup_type_view(type_v,ty);
|
||||
|
||||
return convertView;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,6 +116,9 @@ public class UpdateLogActivity extends Activity{
|
||||
+ " *修复了自定义驱动不生效的问题\n"
|
||||
+ " *设置清理与调整\n"
|
||||
+ " *修正了删除游戏数据不生效的问题,添加删除着色器缓存选项\n"
|
||||
+ "1.21(2025-06-11)\n"
|
||||
+ " *更改纹理格式为RGBA\n"
|
||||
+ " *设置完善\n"
|
||||
+ " \n";
|
||||
|
||||
@Override
|
||||
|
||||
92
app/src/main/java/aenu/preference/ColorPickerDialog.java
Normal file
92
app/src/main/java/aenu/preference/ColorPickerDialog.java
Normal file
@@ -0,0 +1,92 @@
|
||||
package aenu.preference;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.preference.DialogPreference;
|
||||
import androidx.preference.ListPreferenceDialogFragmentCompat;
|
||||
import androidx.preference.PreferenceDialogFragmentCompat;
|
||||
|
||||
import aenu.aps3e.R;
|
||||
|
||||
public class ColorPickerDialog extends DialogPreference {
|
||||
|
||||
public interface OnColorChangedListener{
|
||||
public void onColorChanged(int color);
|
||||
}
|
||||
|
||||
public static class ColorPickerView extends android.view.View{
|
||||
|
||||
public ColorPickerView(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public ColorPickerView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
public ColorPickerView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
Bitmap generate_color_picker_bitmap(){
|
||||
int[] colors=new int[256*256];
|
||||
int i=0;
|
||||
for(int r=1;r<=5;r++){
|
||||
for(int g=1;g<=5;g++){
|
||||
for(int b=1;b<=5;b++){
|
||||
for(int a=0;a<=1;a++){
|
||||
colors[i++]= Color.argb(a*255,r*51,g*51,b*51);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Bitmap bmp=Bitmap.createBitmap(colors,0,256,256,256, Bitmap.Config.ARGB_8888);
|
||||
return bmp;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDraw(Canvas canvas) {
|
||||
canvas.drawColor(Color.WHITE);
|
||||
canvas.drawBitmap(generate_color_picker_bitmap(),0,0,null);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static class ColorPickerPreferenceFragmentCompat extends PreferenceDialogFragmentCompat {
|
||||
|
||||
@NonNull
|
||||
public static ColorPickerPreferenceFragmentCompat newInstance(String key) {
|
||||
final ColorPickerPreferenceFragmentCompat fragment =
|
||||
new ColorPickerPreferenceFragmentCompat();
|
||||
final Bundle b = new Bundle(1);
|
||||
b.putString(ARG_KEY, key);
|
||||
fragment.setArguments(b);
|
||||
return fragment;
|
||||
}
|
||||
@Override
|
||||
public void onDialogClosed(boolean positiveResult) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
static final String NS="http://schemas.android.com/apk/aenu.pref";
|
||||
|
||||
public ColorPickerDialog(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
}
|
||||
public ColorPickerDialog(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
setDialogLayoutResource(R.layout.preference_color_picker);
|
||||
}
|
||||
public ColorPickerDialog(@NonNull Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
setDialogLayoutResource(R.layout.preference_color_picker);
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 420 KiB After Width: | Height: | Size: 420 KiB |
31
app/src/main/res/layout/library_entry.xml
Normal file
31
app/src/main/res/layout/library_entry.xml
Normal file
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="?android:attr/listPreferredItemHeight"
|
||||
android:paddingRight="1dp"
|
||||
android:paddingLeft="1dp"
|
||||
android:paddingTop="1dp"
|
||||
android:paddingBottom="1dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:id="@+id/lib_type"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:id="@+id/lib_name"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
18
app/src/main/res/layout/preference_color_picker.xml
Normal file
18
app/src/main/res/layout/preference_color_picker.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
<view class="aenu.preference.ColorPickerDialog$ColorPickerView"
|
||||
android:id="@+id/v_pick_color"
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="160dp" />
|
||||
<TextView
|
||||
android:id="@+id/tv_test"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="TEST" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -244,20 +244,6 @@
|
||||
app:key="Core|HLE lwmutex" />
|
||||
|
||||
|
||||
<SeekBarPreference app:title="@string/emulator_settings_core_spu_llvm_lower_bound"
|
||||
app:min="0"
|
||||
android:max="0x7fffffff"
|
||||
app:showSeekBarValue="true"
|
||||
app:key="Core|SPU LLVM Lower Bound" />
|
||||
|
||||
|
||||
<SeekBarPreference app:title="@string/emulator_settings_core_spu_llvm_upper_bound"
|
||||
app:min="0"
|
||||
android:max="0x7fffffff"
|
||||
app:showSeekBarValue="true"
|
||||
app:key="Core|SPU LLVM Upper Bound" />
|
||||
|
||||
|
||||
<SeekBarPreference app:title="@string/emulator_settings_core_tsx_transaction_first_limit"
|
||||
app:min="0"
|
||||
android:max="0x7fffffff"
|
||||
@@ -723,10 +709,6 @@
|
||||
app:key="Video|Performance Overlay|Position" />
|
||||
|
||||
|
||||
<PreferenceScreen app:title="@string/emulator_settings_video_performance_overlay_font"
|
||||
app:key="Video|Performance Overlay|Font" />
|
||||
|
||||
|
||||
<SeekBarPreference app:title="@string/emulator_settings_video_performance_overlay_horizontal_margin"
|
||||
app:min="0"
|
||||
android:max="1280"
|
||||
@@ -756,21 +738,6 @@
|
||||
app:key="Video|Performance Overlay|Opacity (%)" />
|
||||
|
||||
|
||||
<PreferenceScreen app:title="@string/emulator_settings_video_performance_overlay_body_color"
|
||||
app:key="Video|Performance Overlay|Body Color (hex)" />
|
||||
|
||||
|
||||
<PreferenceScreen app:title="@string/emulator_settings_video_performance_overlay_body_background"
|
||||
app:key="Video|Performance Overlay|Body Background (hex)" />
|
||||
|
||||
|
||||
<PreferenceScreen app:title="@string/emulator_settings_video_performance_overlay_title_color"
|
||||
app:key="Video|Performance Overlay|Title Color (hex)" />
|
||||
|
||||
|
||||
<PreferenceScreen app:title="@string/emulator_settings_video_performance_overlay_title_background"
|
||||
app:key="Video|Performance Overlay|Title Background (hex)" />
|
||||
|
||||
</PreferenceScreen>
|
||||
<PreferenceScreen app:title="@string/emulator_settings_video_shader_loading_dialog"
|
||||
app:key="Video|Shader Loading Dialog" >
|
||||
@@ -842,10 +809,6 @@
|
||||
app:key="Audio|Audio Channel Layout" />
|
||||
|
||||
|
||||
<PreferenceScreen app:title="@string/emulator_settings_audio_audio_device"
|
||||
app:key="Audio|Audio Device" />
|
||||
|
||||
|
||||
<SeekBarPreference app:title="@string/emulator_settings_audio_master_volume"
|
||||
app:min="0"
|
||||
android:max="200"
|
||||
@@ -885,10 +848,6 @@
|
||||
app:key="Audio|Microphone Type" />
|
||||
|
||||
|
||||
<PreferenceScreen app:title="@string/emulator_settings_audio_microphone_devices"
|
||||
app:key="Audio|Microphone Devices" />
|
||||
|
||||
|
||||
<ListPreference app:title="@string/emulator_settings_audio_music_handler"
|
||||
app:entries="@array/audio_music_handler_entries"
|
||||
app:entryValues="@array/audio_music_handler_values"
|
||||
@@ -928,10 +887,6 @@
|
||||
app:key="Input/Output|Camera flip" />
|
||||
|
||||
|
||||
<PreferenceScreen app:title="@string/emulator_settings_input_output_camera_id"
|
||||
app:key="Input/Output|Camera ID" />
|
||||
|
||||
|
||||
<ListPreference app:title="@string/emulator_settings_input_output_move"
|
||||
app:entries="@array/input_output_move_entries"
|
||||
app:entryValues="@array/input_output_move_values"
|
||||
@@ -985,10 +940,6 @@
|
||||
app:key="Input/Output|Lock overlay input to player one" />
|
||||
|
||||
|
||||
<PreferenceScreen app:title="@string/emulator_settings_input_output_emulated_midi_devices"
|
||||
app:key="Input/Output|Emulated Midi devices" />
|
||||
|
||||
|
||||
<CheckBoxPreference app:title="@string/emulator_settings_input_output_load_sdl_gamecontroller_mappings"
|
||||
app:key="Input/Output|Load SDL GameController Mappings" />
|
||||
|
||||
@@ -1023,71 +974,6 @@
|
||||
app:entryValues="@array/system_enter_button_assignment_values"
|
||||
app:key="System|Enter button assignment" />
|
||||
|
||||
|
||||
<PreferenceScreen app:title="@string/emulator_settings_system_system_name"
|
||||
app:key="System|System Name" />
|
||||
|
||||
|
||||
<SeekBarPreference app:title="@string/emulator_settings_system_psid_high"
|
||||
app:min="0"
|
||||
android:max="0x7fffffff"
|
||||
app:showSeekBarValue="true"
|
||||
app:key="System|PSID high" />
|
||||
|
||||
|
||||
<SeekBarPreference app:title="@string/emulator_settings_system_psid_low"
|
||||
app:min="0"
|
||||
android:max="0x7fffffff"
|
||||
app:showSeekBarValue="true"
|
||||
app:key="System|PSID low" />
|
||||
|
||||
|
||||
<PreferenceScreen app:title="@string/emulator_settings_system_hdd_model_name"
|
||||
app:key="System|HDD Model Name" />
|
||||
|
||||
|
||||
<PreferenceScreen app:title="@string/emulator_settings_system_hdd_serial_number"
|
||||
app:key="System|HDD Serial Number" />
|
||||
|
||||
</PreferenceScreen>
|
||||
<PreferenceScreen app:title="@string/emulator_settings_net"
|
||||
app:key="Net" >
|
||||
|
||||
<ListPreference app:title="@string/emulator_settings_net_internet_enabled"
|
||||
app:entries="@array/net_internet_enabled_entries"
|
||||
app:entryValues="@array/net_internet_enabled_values"
|
||||
app:key="Net|Internet enabled" />
|
||||
|
||||
|
||||
<PreferenceScreen app:title="@string/emulator_settings_net_ip_address"
|
||||
app:key="Net|IP address" />
|
||||
|
||||
|
||||
<PreferenceScreen app:title="@string/emulator_settings_net_bind_address"
|
||||
app:key="Net|Bind address" />
|
||||
|
||||
|
||||
<PreferenceScreen app:title="@string/emulator_settings_net_dns_address"
|
||||
app:key="Net|DNS address" />
|
||||
|
||||
|
||||
<PreferenceScreen app:title="@string/emulator_settings_net_ip_swap_list"
|
||||
app:key="Net|IP swap list" />
|
||||
|
||||
|
||||
<CheckBoxPreference app:title="@string/emulator_settings_net_upnp_enabled"
|
||||
app:key="Net|UPNP Enabled" />
|
||||
|
||||
|
||||
<ListPreference app:title="@string/emulator_settings_net_psn_status"
|
||||
app:entries="@array/net_psn_status_entries"
|
||||
app:entryValues="@array/net_psn_status_values"
|
||||
app:key="Net|PSN status" />
|
||||
|
||||
|
||||
<PreferenceScreen app:title="@string/emulator_settings_net_psn_country"
|
||||
app:key="Net|PSN Country" />
|
||||
|
||||
</PreferenceScreen>
|
||||
<PreferenceScreen app:title="@string/emulator_settings_savestate"
|
||||
app:key="Savestate" >
|
||||
@@ -1163,18 +1049,10 @@
|
||||
app:key="Miscellaneous|Use native user interface" />
|
||||
|
||||
|
||||
<PreferenceScreen app:title="@string/emulator_settings_miscellaneous_gdb_server"
|
||||
app:key="Miscellaneous|GDB Server" />
|
||||
|
||||
|
||||
<CheckBoxPreference app:title="@string/emulator_settings_miscellaneous_silence_all_logs"
|
||||
app:key="Miscellaneous|Silence All Logs" />
|
||||
|
||||
|
||||
<PreferenceScreen app:title="@string/emulator_settings_miscellaneous_window_title_format"
|
||||
app:key="Miscellaneous|Window Title Format" />
|
||||
|
||||
|
||||
<CheckBoxPreference app:title="@string/emulator_settings_miscellaneous_pause_emulation_during_home_menu"
|
||||
app:key="Miscellaneous|Pause Emulation During Home Menu" />
|
||||
|
||||
@@ -1189,4 +1067,4 @@
|
||||
app:key="Miscellaneous|Custom Font File Path" />
|
||||
|
||||
</PreferenceScreen>
|
||||
</PreferenceScreen>
|
||||
</PreferenceScreen>
|
||||
|
||||
Reference in New Issue
Block a user