Starting from version 1.1.4, the project name has been changed to Cosmic

This commit is contained in:
Gabriel Correia 2023-11-18 16:04:30 -03:00
parent 7e9694a119
commit 321646b024
162 changed files with 499 additions and 437 deletions

3
.idea/.gitignore generated vendored
View File

@ -1,3 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml

1
.idea/.name generated
View File

@ -1 +0,0 @@
zenith-emu

1
.idea/gradle.xml generated
View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings"> <component name="GradleSettings">
<option name="linkedExternalProjectsSettings"> <option name="linkedExternalProjectsSettings">
<GradleProjectSettings> <GradleProjectSettings>

View File

@ -1,18 +1,7 @@
<component name="InspectionProjectProfileManager"> <component name="InspectionProjectProfileManager">
<profile version="1.0"> <profile version="1.0">
<option name="myName" value="Project Default" /> <option name="myName" value="Project Default" />
<inspection_tool class="AmbiguousExpressionInWhenBranchMigration" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="ClangTidy" enabled="true" level="INFORMATION" enabled_by_default="true" />
<inspection_tool class="ConstantFunctionResult" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="IncompleteDestructuring" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="JniParameters" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="LeakingThis" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="NotImplementedFunctions" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="OCUnusedGlobalDeclaration" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="OCUnusedGlobalDeclaration" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="OCUnusedIncludeDirective" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="RedundantNotNullExtensionReceiverOfInline" enabled="true" level="INFORMATION" enabled_by_default="true" />
<inspection_tool class="UnusedParameter" enabled="false" level="WARNING" enabled_by_default="false" /> <inspection_tool class="UnusedParameter" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="UnusedSymbol" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="UnusedValue" enabled="false" level="WARNING" enabled_by_default="false" />
</profile> </profile>
</component> </component>

3
.idea/kotlinc.xml generated
View File

@ -1,8 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="Kotlin2JvmCompilerArguments">
<option name="jvmTarget" value="17" />
</component>
<component name="KotlinJpsPluginSettings"> <component name="KotlinJpsPluginSettings">
<option name="version" value="1.8.20" /> <option name="version" value="1.8.20" />
</component> </component>

8
.idea/misc.xml generated
View File

@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" /> <component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
@ -6,11 +7,4 @@
<component name="ProjectType"> <component name="ProjectType">
<option name="id" value="Android" /> <option name="id" value="Android" />
</component> </component>
<component name="VisualizationToolProject">
<option name="state">
<ProjectState>
<option name="scale" value="0.2013358778625954" />
</ProjectState>
</option>
</component>
</project> </project>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RenderSettings">
<option name="showDecorations" value="true" />
</component>
</project>

19
.idea/vcs.xml generated
View File

@ -1,23 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="GitSharedSettings">
<option name="FORCE_PUSH_PROHIBITED_PATTERNS">
<list>
<option value="main" />
</list>
</option>
</component>
<component name="VcsDirectoryMappings"> <component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" /> <mapping directory="" vcs="Git" />
<mapping directory="$PROJECT_DIR$/app/src/main/cpp/addons/Vulkan-Hpp" vcs="Git" />
<mapping directory="$PROJECT_DIR$/app/src/main/cpp/addons/Vulkan-Hpp/Vulkan-Headers" vcs="Git" />
<mapping directory="$PROJECT_DIR$/app/src/main/cpp/addons/Vulkan-Hpp/glfw" vcs="Git" />
<mapping directory="$PROJECT_DIR$/app/src/main/cpp/addons/Vulkan-Hpp/glm" vcs="Git" />
<mapping directory="$PROJECT_DIR$/app/src/main/cpp/addons/Vulkan-Hpp/glslang" vcs="Git" />
<mapping directory="$PROJECT_DIR$/app/src/main/cpp/addons/Vulkan-Hpp/tinyxml2" vcs="Git" />
<mapping directory="$PROJECT_DIR$/app/src/main/cpp/addons/fmt" vcs="Git" />
<mapping directory="$PROJECT_DIR$/app/src/main/cpp/addons/perfetto" vcs="Git" />
<mapping directory="$PROJECT_DIR$/app/src/main/cpp/addons/range-v3" vcs="Git" />
<mapping directory="$PROJECT_DIR$/app/src/main/cpp/addons/range-v3/doc/gh-pages" vcs="Git" />
</component> </component>
</project> </project>

View File

@ -6,16 +6,16 @@ plugins {
} }
android { android {
namespace = "emu.zenith" namespace = "emu.cosmic"
compileSdk = 34 compileSdk = 34
defaultConfig { defaultConfig {
applicationId = "emu.zenith" applicationId = "emu.cosmic"
minSdk = 31 minSdk = 31
targetSdk = 34 targetSdk = 34
versionCode = 113 versionCode = 114
versionName = "1.1.3" versionName = "1.1.4"
ndk { ndk {
abiFilters.clear() abiFilters.clear()
abiFilters.add("arm64-v8a") abiFilters.add("arm64-v8a")

View File

@ -1,3 +1,3 @@
# These classes and methods are called through JNI and should not be obfuscated in the release build # These classes and methods are called through JNI and should not be obfuscated in the release build
-keep class emu.zenith.** { *; } -keep class emu.cosmic.** { *; }

View File

@ -6,7 +6,7 @@
tools:ignore="ScopedStorage" /> tools:ignore="ScopedStorage" />
<application <application
android:name=".ZenithApplication" android:name=".CosmicApplication"
android:allowBackup="true" android:allowBackup="true"
android:fullBackupContent="@xml/backup_rules" android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
@ -14,7 +14,7 @@
android:label="@string/app_name" android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/Theme.App.Zenith" android:theme="@style/Theme.App.Cosmic"
android:dataExtractionRules="@xml/data_extraction_rules" android:dataExtractionRules="@xml/data_extraction_rules"
android:enableOnBackInvokedCallback="true" android:enableOnBackInvokedCallback="true"
tools:targetApi="tiramisu"> tools:targetApi="tiramisu">

View File

@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.22.1) cmake_minimum_required(VERSION 3.22.1)
project(ZenithEmu LANGUAGES CXX ASM VERSION 1.1.3) project(CosmicEmu LANGUAGES CXX ASM VERSION "114")
set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True) set(CMAKE_CXX_STANDARD_REQUIRED True)
@ -13,63 +13,61 @@ set(CMAKE_CXX_FLAGS_DEBUG "-glldb -fstack-protector-strong -O0")
set(CMAKE_MODULE_LINKER_FLAGS "-Wl,-z,noexecstack") set(CMAKE_MODULE_LINKER_FLAGS "-Wl,-z,noexecstack")
set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "-s -Wl,--gc-sections") set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "-s -Wl,--gc-sections")
# zenith: PS2 core emulator native library # cosmic: PS2 core emulator native library
add_library(zenith MODULE) add_library(cosmic MODULE)
set(ZENITH_DIR ${CMAKE_SOURCE_DIR}/cpp/zenith) set(COSMIC_DIR ${CMAKE_SOURCE_DIR}/cpp/cosmic)
set(ADDONS_DIR ${CMAKE_SOURCE_DIR}/cpp/addons) set(ADDONS_DIR ${CMAKE_SOURCE_DIR}/cpp/addons)
set(ZENITH_MISC_DIR ${CMAKE_SOURCE_DIR}/cpp) set(COSMIC_MISC_DIR ${CMAKE_SOURCE_DIR}/cpp)
target_sources(cosmic PRIVATE
target_sources(zenith PRIVATE ${COSMIC_DIR}/common/app.cpp
${ZENITH_DIR}/common/app.cpp ${COSMIC_DIR}/common/logger.cpp
${ZENITH_DIR}/common/logger.cpp ${COSMIC_DIR}/cpu/cyclic32.cpp
${ZENITH_DIR}/cpu/cyclic32.cpp ${COSMIC_DIR}/cpu/verify_features.cpp
${ZENITH_DIR}/cpu/verify_features.cpp ${COSMIC_DIR}/eeiv/ee_engine.cpp
${ZENITH_DIR}/eeiv/ee_engine.cpp ${COSMIC_DIR}/eeiv/ee_flow.cpp
${ZENITH_DIR}/eeiv/ee_flow.cpp ${COSMIC_DIR}/eeiv/ee_iov0.cpp
${ZENITH_DIR}/eeiv/ee_iov0.cpp ${COSMIC_DIR}/eeiv/c0/cop_cache.cpp
${ZENITH_DIR}/eeiv/c0/cop_cache.cpp ${COSMIC_DIR}/eeiv/c0/cop0.cpp
${ZENITH_DIR}/eeiv/c0/cop0.cpp ${COSMIC_DIR}/eeiv/c0/cop_misc.cpp
${ZENITH_DIR}/eeiv/c0/cop_misc.cpp ${COSMIC_DIR}/eeiv/c0/cop_dma.cpp
${ZENITH_DIR}/eeiv/c0/cop_dma.cpp ${COSMIC_DIR}/eeiv/fu/cop1_fu.cpp
${ZENITH_DIR}/eeiv/fu/cop1_fu.cpp ${COSMIC_DIR}/eeiv/timer/ee_timers.cpp
${ZENITH_DIR}/eeiv/timer/ee_timers.cpp ${COSMIC_DIR}/mio/mmu_tlb.cpp
${ZENITH_DIR}/mio/mmu_tlb.cpp ${COSMIC_DIR}/mio/tlb_mapper.cpp
${ZENITH_DIR}/mio/tlb_mapper.cpp ${COSMIC_DIR}/mio/dma_parallel.cpp
${ZENITH_DIR}/mio/dma_parallel.cpp ${COSMIC_DIR}/mio/blocks.cpp
${ZENITH_DIR}/mio/blocks.cpp ${COSMIC_DIR}/fuji/mipsiv_full_interpreter.cpp
${ZENITH_DIR}/fuji/mipsiv_full_interpreter.cpp ${COSMIC_DIR}/fuji/iop_interpreter.cpp
${ZENITH_DIR}/fuji/iop_interpreter.cpp ${COSMIC_DIR}/fuji/mipsiv_opcodes.cpp
${ZENITH_DIR}/fuji/mipsiv_opcodes.cpp ${COSMIC_DIR}/fuji/mipsiv_isa.cpp
${ZENITH_DIR}/fuji/mipsiv_isa.cpp ${COSMIC_DIR}/fuji/cop_isa.cpp
${ZENITH_DIR}/fuji/cop_isa.cpp ${COSMIC_DIR}/gs/synth_tables.cpp
${ZENITH_DIR}/gs/synth_tables.cpp ${COSMIC_DIR}/gs/synth_engine.cpp
${ZENITH_DIR}/gs/synth_engine.cpp ${COSMIC_DIR}/hle/bios_patch.cpp
${ZENITH_DIR}/hle/bios_patch.cpp ${COSMIC_DIR}/hle/group_mgr.cpp
${ZENITH_DIR}/hle/group_mgr.cpp ${COSMIC_DIR}/hle/bios_class.cpp
${ZENITH_DIR}/hle/bios_class.cpp ${COSMIC_DIR}/hle/syscall_gate.cpp
${ZENITH_DIR}/hle/syscall_gate.cpp ${COSMIC_DIR}/fs/bios_loader.cpp
${ZENITH_DIR}/fs/bios_loader.cpp ${COSMIC_DIR}/iop/iop_core.cpp
${ZENITH_DIR}/iop/iop_core.cpp ${COSMIC_DIR}/iop/iop_cop.cpp
${ZENITH_DIR}/iop/iop_cop.cpp ${COSMIC_DIR}/iop/iop_intc.cpp
${ZENITH_DIR}/iop/iop_intc.cpp ${COSMIC_DIR}/gpu/hw_render.cpp
${ZENITH_DIR}/gpu/hw_render.cpp ${COSMIC_DIR}/gpu/render_driver.cpp
${ZENITH_DIR}/gpu/render_driver.cpp ${COSMIC_DIR}/gpu/exhibition_engine.cpp
${ZENITH_DIR}/gpu/exhibition_engine.cpp ${COSMIC_DIR}/os/system_state.cpp
${ZENITH_DIR}/os/system_state.cpp ${COSMIC_DIR}/java/device_handler.cpp
${ZENITH_DIR}/java/device_handler.cpp ${COSMIC_DIR}/java/jclasses.cpp
${ZENITH_DIR}/java/jclasses.cpp ${COSMIC_DIR}/console/virt_devices.cpp
${ZENITH_DIR}/console/virt_devices.cpp ${COSMIC_DIR}/console/emu_vm.cpp
${ZENITH_DIR}/console/emu_vm.cpp ${COSMIC_DIR}/console/emu_thread.cpp
${ZENITH_DIR}/console/emu_thread.cpp ${COSMIC_DIR}/console/sched_logical.cpp
${ZENITH_DIR}/console/sched_logical.cpp ${COSMIC_DIR}/console/intc.cpp
${ZENITH_DIR}/console/intc.cpp ${COSMIC_DIR}/console/backdoor.cpp
${ZENITH_DIR}/console/backdoor.cpp ${COSMIC_MISC_DIR}/jvm_comm.cpp
${ZENITH_MISC_DIR}/jvm_comm.cpp ${COSMIC_MISC_DIR}/drivers_glvk_jni.cpp
${ZENITH_MISC_DIR}/drivers_glvk_jni.cpp ${COSMIC_MISC_DIR}/bios_jni.cpp
${ZENITH_MISC_DIR}/bios_jni.cpp
${ADDONS_DIR}/compile_this.cpp) ${ADDONS_DIR}/compile_this.cpp)
add_subdirectory("${ADDONS_DIR}/fmt" EXCLUDE_FROM_ALL) add_subdirectory("${ADDONS_DIR}/fmt" EXCLUDE_FROM_ALL)
add_subdirectory("${ADDONS_DIR}/range-v3") add_subdirectory("${ADDONS_DIR}/range-v3")
@ -85,8 +83,7 @@ include_directories(SYSTEM "${ADDONS_DIR}/Vulkan-Hpp/Vulkan-Headers/include")
# Define a static library for Perfetto # Define a static library for Perfetto
add_library(perfetto STATIC ${ADDONS_DIR}/perfetto/sdk/perfetto.cc) add_library(perfetto STATIC ${ADDONS_DIR}/perfetto/sdk/perfetto.cc)
target_include_directories(zenith PRIVATE ${ZENITH_MISC_DIR} ${ZENITH_DIR} target_include_directories(cosmic PRIVATE ${COSMIC_MISC_DIR} ${COSMIC_DIR} ${ADDONS_DIR}/perfetto/sdk)
${ADDONS_DIR}/perfetto/sdk)
target_link_libraries(zenith PRIVATE log android nativehelper nativewindow EGL fmt::fmt perfetto range-v3::range-v3) target_link_libraries(cosmic PRIVATE log android nativehelper nativewindow EGL fmt::fmt perfetto range-v3::range-v3)
target_compile_options(zenith PRIVATE -Wreorder -Wconversion -Wformat-security -Wshadow) target_compile_options(cosmic PRIVATE -Wreorder -Wconversion -Wformat-security -Wshadow)

View File

@ -1,19 +1,19 @@
#include <jni.h> #include <jni.h>
#include <android/file_descriptor_jni.h> #include <android/file_descriptor_jni.h>
#include <zenith/common/global.h> #include <cosmic/common/global.h>
#include <zenith/hle/group_mgr.h> #include <cosmic/hle/group_mgr.h>
extern "C" extern "C"
JNIEXPORT jobject JNICALL JNIEXPORT jobject JNICALL
Java_emu_zenith_helpers_BiosHelperModel_00024Companion_addBios(JNIEnv* env, jobject thiz, jobject descriptor, jint position) { Java_emu_cosmic_helpers_BiosHelperModel_00024Companion_addBios(JNIEnv* env, jobject thiz, jobject descriptor, jint position) {
zenith::hle::BiosInfo info{env}; cosmic::hle::BiosInfo info{env};
info.position = position; info.position = position;
auto biosHld{AFileDescriptor_getFd(env, descriptor)}; auto biosHld{AFileDescriptor_getFd(env, descriptor)};
auto biosMgr{zenith::zenithApp->getBiosMgr()}; auto biosMgr{cosmic::app->getBiosMgr()};
auto object{info.createInstance()}; auto object{info.createInstance()};
zenith::i32 find[2]{biosHld, 0}; cosmic::i32 find[2]{biosHld, 0};
if (biosMgr->isAlreadyAdded(find)) { if (biosMgr->isAlreadyAdded(find)) {
biosMgr->loadBiosBy(object, find, false); biosMgr->loadBiosBy(object, find, false);
@ -27,19 +27,19 @@ Java_emu_zenith_helpers_BiosHelperModel_00024Companion_addBios(JNIEnv* env, jobj
} }
extern "C" extern "C"
JNIEXPORT jint JNICALL JNIEXPORT jint JNICALL
Java_emu_zenith_helpers_BiosHelperModel_00024Companion_setBios(JNIEnv* env, jobject thiz, jint pos) { Java_emu_cosmic_helpers_BiosHelperModel_00024Companion_setBios(JNIEnv* env, jobject thiz, jint pos) {
auto group{zenith::zenithApp->getBiosMgr()}; auto group{cosmic::app->getBiosMgr()};
zenith::i32 by[2]{0, pos}; cosmic::i32 by[2]{0, pos};
return group->choice(by, true); return group->choice(by, true);
} }
extern "C" extern "C"
JNIEXPORT jboolean JNICALL JNIEXPORT jboolean JNICALL
Java_emu_zenith_helpers_BiosHelperModel_00024Companion_removeBios(JNIEnv* env, jobject thiz, jintArray posFd) { Java_emu_cosmic_helpers_BiosHelperModel_00024Companion_removeBios(JNIEnv* env, jobject thiz, jintArray posFd) {
if (env->GetArrayLength(posFd) != 2) { if (env->GetArrayLength(posFd) != 2) {
throw zenith::AppFail("Not supported element array of size {} passed", throw cosmic::AppFail("Not supported element array of size {} passed",
env->GetArrayLength(posFd)); env->GetArrayLength(posFd));
} }
auto group{zenith::zenithApp->getBiosMgr()}; auto group{cosmic::app->getBiosMgr()};
jint* mangled{env->GetIntArrayElements(posFd, nullptr)}; jint* mangled{env->GetIntArrayElements(posFd, nullptr)};
@ -50,14 +50,14 @@ Java_emu_zenith_helpers_BiosHelperModel_00024Companion_removeBios(JNIEnv* env, j
} }
extern "C" extern "C"
JNIEXPORT void JNICALL JNIEXPORT void JNICALL
Java_emu_zenith_helpers_BiosHelperModel_00024Companion_cleanAllBios(JNIEnv* env, jobject thiz) { Java_emu_cosmic_helpers_BiosHelperModel_00024Companion_cleanAllBios(JNIEnv* env, jobject thiz) {
auto bgp{zenith::zenithApp->getBiosMgr()}; auto bgp{cosmic::app->getBiosMgr()};
bgp->discardAll(); bgp->discardAll();
} }
extern "C" extern "C"
JNIEXPORT jint JNICALL JNIEXPORT jint JNICALL
Java_emu_zenith_helpers_BiosHelperModel_00024Companion_getBios(JNIEnv* env, jobject thiz, jint defaultPos) { Java_emu_cosmic_helpers_BiosHelperModel_00024Companion_getBios(JNIEnv* env, jobject thiz, jint defaultPos) {
auto biosGroup{zenith::zenithApp->getBiosMgr()}; auto biosGroup{cosmic::app->getBiosMgr()};
if (biosGroup->slotBios) if (biosGroup->slotBios)
return biosGroup->slotBios->position; return biosGroup->slotBios->position;
return defaultPos; return defaultPos;

View File

@ -2,7 +2,7 @@
#include <arm_neon.h> #include <arm_neon.h>
#include <unistd.h> #include <unistd.h>
namespace zenith { namespace cosmic {
using i8 = std::int8_t; using i8 = std::int8_t;
using u8 = std::uint8_t; using u8 = std::uint8_t;
using u16 = std::uint16_t; using u16 = std::uint16_t;

View File

@ -7,10 +7,10 @@
#include <common/global.h> #include <common/global.h>
#include <common/except.h> #include <common/except.h>
namespace zenith { namespace cosmic {
std::unique_ptr<java::JvmManager> device; std::unique_ptr<java::JvmManager> device;
std::shared_ptr<GlobalLogger> userLog; std::shared_ptr<GlobalLogger> userLog;
std::shared_ptr<CoreApplication> zenithApp; std::shared_ptr<CoreApplication> app;
CoreApplication::CoreApplication() CoreApplication::CoreApplication()
: simulated(std::make_shared<console::VirtDevices>()) { : simulated(std::make_shared<console::VirtDevices>()) {

View File

@ -8,7 +8,7 @@
#include <hle/group_mgr.h> #include <hle/group_mgr.h>
#include <gpu/exhibition_engine.h> #include <gpu/exhibition_engine.h>
namespace zenith { namespace cosmic {
class CoreApplication { class CoreApplication {
public: public:
CoreApplication(); CoreApplication();

View File

@ -3,7 +3,7 @@
#include <exception> #include <exception>
#include <string> #include <string>
#include <fmt/format.h> #include <fmt/format.h>
namespace zenith { namespace cosmic {
class FatalError : public std::runtime_error { class FatalError : public std::runtime_error {
protected: protected:
template <typename T, typename... Args> template <typename T, typename... Args>
@ -29,7 +29,7 @@ namespace zenith {
DeclareExceptionType(IOFail, "IO"); DeclareExceptionType(IOFail, "IO");
DeclareExceptionType(FSFail, "FS"); DeclareExceptionType(FSFail, "FS");
DeclareExceptionType(GPUFail, "GPU"); DeclareExceptionType(GPUFail, "GPU");
DeclareExceptionType(AppFail, "Zenith"); DeclareExceptionType(AppFail, "Cosmic");
#undef DeclareExceptionType #undef DeclareExceptionType

View File

@ -4,8 +4,8 @@
#include <common/app.h> #include <common/app.h>
#include <common/logger.h> #include <common/logger.h>
namespace zenith { namespace cosmic {
extern std::unique_ptr<java::JvmManager> device; extern std::unique_ptr<java::JvmManager> device;
extern std::shared_ptr<GlobalLogger> userLog; extern std::shared_ptr<GlobalLogger> userLog;
extern std::shared_ptr<CoreApplication> zenithApp; extern std::shared_ptr<CoreApplication> app;
} }

View File

@ -11,7 +11,7 @@ PERFETTO_DEFINE_CATEGORIES(
// static in the binary sections // static in the binary sections
PERFETTO_TRACK_EVENT_STATIC_STORAGE(); PERFETTO_TRACK_EVENT_STATIC_STORAGE();
namespace zenith { namespace cosmic {
thread_local fmt::memory_buffer out; thread_local fmt::memory_buffer out;
std::string GlobalLogger::prodPrefix(const LoggerLevel ml) { std::string GlobalLogger::prodPrefix(const LoggerLevel ml) {

View File

@ -4,7 +4,7 @@
#include <android/log.h> #include <android/log.h>
#include <common/types.h> #include <common/types.h>
namespace zenith { namespace cosmic {
enum LoggerLevel { enum LoggerLevel {
Info = ANDROID_LOG_INFO, Info = ANDROID_LOG_INFO,
Debug = ANDROID_LOG_DEBUG, Debug = ANDROID_LOG_DEBUG,
@ -52,6 +52,6 @@ namespace zenith {
// Don't allow these specific levels to be threaded or printed to the user // Don't allow these specific levels to be threaded or printed to the user
std::array<u8, 4> disableLevels{}; std::array<u8, 4> disableLevels{};
static constexpr auto tag{"Zenith"}; static constexpr auto tag{"Cosmic"};
}; };
} }

View File

@ -8,7 +8,7 @@
#include <common/except.h> #include <common/except.h>
#include <common/alias.h> #include <common/alias.h>
namespace zenith { namespace cosmic {
template <typename T> template <typename T>
class raw_reference { class raw_reference {
public: public:

View File

@ -1,10 +1,10 @@
#include <console/backdoor.h> #include <console/backdoor.h>
namespace zenith { namespace cosmic {
std::shared_ptr<console::RedPillow> redBox; std::shared_ptr<console::RedPillow> redBox;
} }
namespace zenith::console { namespace cosmic::console {
RedPillow::RedPillow(EmuVM& aliveVm) { RedPillow::RedPillow(EmuVM& aliveVm) {
vm = std::make_unique<raw_reference<EmuVM>>(std::ref(aliveVm)); vm = std::make_unique<raw_reference<EmuVM>>(std::ref(aliveVm));
mutual = std::unique_lock<std::mutex>(); mutual = std::unique_lock<std::mutex>();

View File

@ -4,7 +4,7 @@
#include <thread> #include <thread>
#include <mutex> #include <mutex>
namespace zenith::console { namespace cosmic::console {
class EmuVM; class EmuVM;
class RedPillow { class RedPillow {
@ -22,7 +22,7 @@ namespace zenith::console {
}; };
} }
namespace zenith { namespace cosmic {
extern std::shared_ptr<console::RedPillow> redBox; extern std::shared_ptr<console::RedPillow> redBox;
} }

View File

@ -5,7 +5,7 @@
#include <console/emu_thread.h> #include <console/emu_thread.h>
#include <console/emu_vm.h> #include <console/emu_vm.h>
namespace zenith::console { namespace cosmic::console {
static std::mutex mlMutex; static std::mutex mlMutex;
static std::condition_variable mlCond; static std::condition_variable mlCond;
std::atomic<bool> isRunning; std::atomic<bool> isRunning;

View File

@ -1,7 +1,7 @@
#pragma once #pragma once
#include <thread> #include <thread>
namespace zenith::console { namespace cosmic::console {
class EmuVM; class EmuVM;
class EmuThread { class EmuThread {

View File

@ -6,7 +6,7 @@
#include <eeiv/ee_info.h> #include <eeiv/ee_info.h>
#define TestBiosAccess 0 #define TestBiosAccess 0
namespace zenith::console { namespace cosmic::console {
EmuVM::EmuVM(JNIEnv* env, EmuVM::EmuVM(JNIEnv* env,
std::shared_ptr<VirtDevices>& devices, std::shared_ptr<VirtDevices>& devices,
std::shared_ptr<gpu::ExhibitionEngine>& dsp) std::shared_ptr<gpu::ExhibitionEngine>& dsp)
@ -68,7 +68,7 @@ namespace zenith::console {
ori = hle::SysIop; ori = hle::SysIop;
if (ori == hle::SysEmotionEngine) { if (ori == hle::SysEmotionEngine) {
i16 eeSystem{*mips->gprAt<i16*>(eeiv::$v1)}; i16 eeSystem{*mips->gprAt<i16>(eeiv::$v1)};
dealer.doSyscall(ori, eeSystem); dealer.doSyscall(ori, eeSystem);
mips->cop0.cause.exCode = 0; mips->cop0.cause.exCode = 0;
} else { } else {

View File

@ -10,7 +10,7 @@
#include <console/emu_thread.h> #include <console/emu_thread.h>
#include <console/sched_logical.h> #include <console/sched_logical.h>
#include <console/intc.h> #include <console/intc.h>
namespace zenith::console { namespace cosmic::console {
class EmuVM { class EmuVM {
public: public:
EmuVM(JNIEnv* env, EmuVM(JNIEnv* env,

View File

@ -1,6 +1,6 @@
#include <console/intc.h> #include <console/intc.h>
#include <console/emu_vm.h> #include <console/emu_vm.h>
namespace zenith::console { namespace cosmic::console {
INTCInfra::INTCInfra(EmuVM& vm) INTCInfra::INTCInfra(EmuVM& vm)
: iopInt(vm.iop) { : iopInt(vm.iop) {
} }

View File

@ -1,7 +1,7 @@
#pragma once #pragma once
#include <iop/iop_intc.h> #include <iop/iop_intc.h>
namespace zenith::console { namespace cosmic::console {
enum INTControllers { enum INTControllers {
IopInt IopInt
}; };

View File

@ -1,5 +1,5 @@
#include <console/sched_logical.h> #include <console/sched_logical.h>
namespace zenith::console { namespace cosmic::console {
void Scheduler::runEvents() { void Scheduler::runEvents() {
if (eeCycles.cycles < nextEventCycle) if (eeCycles.cycles < nextEventCycle)
return; return;

View File

@ -2,7 +2,7 @@
#include <vector> #include <vector>
#include <common/types.h> #include <common/types.h>
namespace zenith::console { namespace cosmic::console {
using TimerInvokable = std::function<void(u8)>; using TimerInvokable = std::function<void(u8)>;
enum AffinityControl { enum AffinityControl {
EmotionEngine = 0x3, EmotionEngine = 0x3,

View File

@ -1,6 +1,6 @@
#include <console/virt_devices.h> #include <console/virt_devices.h>
namespace zenith::console { namespace cosmic::console {
VirtDevices::VirtDevices() { VirtDevices::VirtDevices() {
virtBlocks = std::make_shared<mio::GlobalMemory>(); virtBlocks = std::make_shared<mio::GlobalMemory>();
controller = std::make_shared<mio::DMAController>(); controller = std::make_shared<mio::DMAController>();

View File

@ -5,7 +5,7 @@
#include <eeiv/ee_engine.h> #include <eeiv/ee_engine.h>
#include <iop/iop_core.h> #include <iop/iop_core.h>
namespace zenith::console { namespace cosmic::console {
class VirtDevices { class VirtDevices {
public: public:
VirtDevices(); VirtDevices();

View File

@ -2,7 +2,7 @@
#include <cpu/cyclic32.h> #include <cpu/cyclic32.h>
namespace zenith::cpu { namespace cosmic::cpu {
u32 check32(std::span<u8> chkData) { u32 check32(std::span<u8> chkData) {
u32 crc{0xFFFFFFFF}; u32 crc{0xFFFFFFFF};
u64 last{chkData.size()}; u64 last{chkData.size()};

View File

@ -3,6 +3,6 @@
#include <span> #include <span>
#include <common/types.h> #include <common/types.h>
namespace zenith::cpu { namespace cosmic::cpu {
u32 check32(std::span<u8> chkData); u32 check32(std::span<u8> chkData);
} }

View File

@ -1,6 +1,6 @@
#include <cpu/verify_features.h> #include <cpu/verify_features.h>
namespace zenith::cpu { namespace cosmic::cpu {
const std::array<FeaturesImpl, ISA64::size> features{ const std::array<FeaturesImpl, ISA64::size> features{
{{true, "crc32cb,crc32ch,crc32cw,crc32cx"}} {{true, "crc32cb,crc32ch,crc32cw,crc32cx"}}
}; };

View File

@ -5,7 +5,7 @@
#include <array> #include <array>
#include <common/types.h> #include <common/types.h>
namespace zenith::cpu { namespace cosmic::cpu {
struct FeaturesImpl { struct FeaturesImpl {
bool isArchOptional; bool isArchOptional;
std::string family; std::string family;

View File

@ -1,7 +1,7 @@
#include <arm_neon.h> #include <arm_neon.h>
#include <eeiv/c0/cop0.h> #include <eeiv/c0/cop0.h>
namespace zenith::eeiv::c0 { namespace cosmic::eeiv::c0 {
CoProcessor0::CoProcessor0(std::shared_ptr<mio::DMAController>& ctrl) CoProcessor0::CoProcessor0(std::shared_ptr<mio::DMAController>& ctrl)
: dmac(ctrl) { : dmac(ctrl) {
// Signals to the BIOS that the EE is in its boot process, so it will start our registers // Signals to the BIOS that the EE is in its boot process, so it will start our registers

View File

@ -4,11 +4,11 @@
#include <mio/mmu_tlb.h> #include <mio/mmu_tlb.h>
#include <mio/dma_parallel.h> #include <mio/dma_parallel.h>
namespace zenith::eeiv { namespace cosmic::eeiv {
class EEMipsCore; class EEMipsCore;
} }
namespace zenith::eeiv::c0 { namespace cosmic::eeiv::c0 {
static constexpr u8 cop0RegsCount{32}; static constexpr u8 cop0RegsCount{32};
struct alignas(8) CopCacheLine { struct alignas(8) CopCacheLine {
std::array<u32, 2> tags; std::array<u32, 2> tags;

View File

@ -2,7 +2,7 @@
#include <eeiv/c0/cop0.h> #include <eeiv/c0/cop0.h>
#include <eeiv/ee_engine.h> #include <eeiv/ee_engine.h>
namespace zenith::eeiv::c0 { namespace cosmic::eeiv::c0 {
// TODO: Cache indexes use PFN (Physical Frame Number) addressing; we need to redo this entire method // TODO: Cache indexes use PFN (Physical Frame Number) addressing; we need to redo this entire method
void CoProcessor0::invIndexed(u32 address) { void CoProcessor0::invIndexed(u32 address) {
auto line{viewLine(address)}; auto line{viewLine(address)};

View File

@ -1,6 +1,6 @@
#include <eeiv/c0/cop0.h> #include <eeiv/c0/cop0.h>
namespace zenith::eeiv::c0 { namespace cosmic::eeiv::c0 {
bool CoProcessor0::getCondition() { bool CoProcessor0::getCondition() {
u32 stat{dmac->performRead(0x1000e010) & 0x3ff}; u32 stat{dmac->performRead(0x1000e010) & 0x3ff};
u32 pcr{dmac->performRead(0x1000e020) & 0x3ff}; u32 pcr{dmac->performRead(0x1000e020) & 0x3ff};

View File

@ -1,6 +1,6 @@
#include <eeiv/c0/cop0.h> #include <eeiv/c0/cop0.h>
#include <mio/mmu_tlb.h> #include <mio/mmu_tlb.h>
namespace zenith::eeiv::c0 { namespace cosmic::eeiv::c0 {
// Due to the peculiarities of the implementation, the calling function of setTLB // Due to the peculiarities of the implementation, the calling function of setTLB
// must map and unmap the TLB on its own // must map and unmap the TLB on its own
void CoProcessor0::setTLB(mio::TLBPageEntry& entry) { void CoProcessor0::setTLB(mio::TLBPageEntry& entry) {

View File

@ -2,7 +2,7 @@
#include <common/types.h> #include <common/types.h>
#include <eeiv/ee_info.h> #include <eeiv/ee_info.h>
namespace zenith::eeiv { namespace cosmic::eeiv {
struct EECoreAssembler { struct EECoreAssembler {
// https://usermanual.wiki/Pdf/EECoreInstructionSetManual.986088270/help // https://usermanual.wiki/Pdf/EECoreInstructionSetManual.986088270/help
constexpr static u32 lui(const MipsRegsHw dest, u32 imm) { constexpr static u32 lui(const MipsRegsHw dest, u32 imm) {

View File

@ -5,7 +5,7 @@
#include <fuji/mipsiv_interpreter.h> #include <fuji/mipsiv_interpreter.h>
#include <tokyo3/tokyo3_arm64_jitter.h> #include <tokyo3/tokyo3_arm64_jitter.h>
namespace zenith::eeiv { namespace cosmic::eeiv {
EEMipsCore::EEMipsCore(std::shared_ptr<mio::DMAController>& dma) EEMipsCore::EEMipsCore(std::shared_ptr<mio::DMAController>& dma)
: cop0(dma), : cop0(dma),
memory(dma->memoryChips), memory(dma->memoryChips),

View File

@ -12,7 +12,7 @@
#include <eeiv/c0/cop0.h> #include <eeiv/c0/cop0.h>
#include <eeiv/fu/cop1_fu.h> #include <eeiv/fu/cop1_fu.h>
#include <eeiv/timer/ee_timers.h> #include <eeiv/timer/ee_timers.h>
namespace zenith::eeiv { namespace cosmic::eeiv {
enum class EEExecutionMode : u8 { enum class EEExecutionMode : u8 {
// JIT compiler, the fastest option but with various interpretation issues // JIT compiler, the fastest option but with various interpretation issues
JitRe, JitRe,
@ -50,7 +50,7 @@ namespace zenith::eeiv {
} }
template <typename T> template <typename T>
inline auto gprAt(u32 index) { inline auto gprAt(u32 index) {
return reinterpret_cast<T>(GPRs[index].words[0]); return reinterpret_cast<T*>(&GPRs[index].words[0]);
} }
inline void chPC(u32 newPC) { inline void chPC(u32 newPC) {
lastPC = eePC; lastPC = eePC;

View File

@ -1,6 +1,6 @@
#include <eeiv/ee_engine.h> #include <eeiv/ee_engine.h>
namespace zenith::eeiv { namespace cosmic::eeiv {
#pragma clang diagnostic push #pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wsign-conversion" #pragma clang diagnostic ignored "-Wsign-conversion"
void EEMipsCore::branchByCondition(bool cond, i32 jumpRel) { void EEMipsCore::branchByCondition(bool cond, i32 jumpRel) {

View File

@ -1,7 +1,7 @@
#pragma once #pragma once
#include <common/types.h> #include <common/types.h>
namespace zenith::eeiv { namespace cosmic::eeiv {
class EEPC { class EEPC {
public: public:
EEPC() = default; EEPC() = default;

View File

@ -1,7 +1,7 @@
#pragma once #pragma once
#include <common/types.h> #include <common/types.h>
namespace zenith::eeiv { namespace cosmic::eeiv {
class EEMipsCore; class EEMipsCore;
class EEExecutor { class EEExecutor {

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
namespace zenith::eeiv { namespace cosmic::eeiv {
enum MipsRegsHw : u8 { enum MipsRegsHw : u8 {
$zero, // Hardwired 0 into the semiconductor $zero, // Hardwired 0 into the semiconductor
$at, $at,
@ -17,7 +17,7 @@ namespace zenith::eeiv {
}; };
} }
namespace zenith::fuji { namespace cosmic::fuji {
enum MipsIVOpcodes : u16 { enum MipsIVOpcodes : u16 {
SpecialOpcodes = 0x0, SpecialOpcodes = 0x0,
Cop0Mfc = 0x0, Cop0Mfc = 0x0,

View File

@ -1,5 +1,5 @@
#include <eeiv/ee_engine.h> #include <eeiv/ee_engine.h>
namespace zenith::eeiv { namespace cosmic::eeiv {
u32 EEMipsCore::writeArray(u32 address, std::span<u32> dataBlk) { u32 EEMipsCore::writeArray(u32 address, std::span<u32> dataBlk) {
u32 count{}; u32 count{};
for (const auto value : dataBlk) { for (const auto value : dataBlk) {

View File

@ -1,6 +1,6 @@
#include <eeiv/fu/cop1_fu.h> #include <eeiv/fu/cop1_fu.h>
namespace zenith::eeiv::fu { namespace cosmic::eeiv::fu {
CoProcessor1::CoProcessor1() { CoProcessor1::CoProcessor1() {
} }

View File

@ -1,7 +1,7 @@
#pragma once #pragma once
#include <common/types.h> #include <common/types.h>
namespace zenith::eeiv::fu { namespace cosmic::eeiv::fu {
class CoProcessor1 { class CoProcessor1 {
public: public:
CoProcessor1(); CoProcessor1();

View File

@ -2,7 +2,7 @@
#include <eeiv/timer/ee_timers.h> #include <eeiv/timer/ee_timers.h>
#include <console/sched_logical.h> #include <console/sched_logical.h>
namespace zenith::eeiv::timer { namespace cosmic::eeiv::timer {
EETimers::EETimers() {} EETimers::EETimers() {}
void EETimers::resetTimers() { void EETimers::resetTimers() {

View File

@ -1,10 +1,10 @@
#pragma once #pragma once
#include <common/types.h> #include <common/types.h>
namespace zenith::console { namespace cosmic::console {
class Scheduler; class Scheduler;
} }
namespace zenith::eeiv::timer { namespace cosmic::eeiv::timer {
struct EEHwTimer { struct EEHwTimer {
u32 clocks; u32 clocks;
bool isEnabled; bool isEnabled;

View File

@ -8,7 +8,7 @@
#include <common/logger.h> #include <common/logger.h>
#include <common/except.h> #include <common/except.h>
namespace zenith::fs { namespace cosmic::fs {
static const std::map<char, const std::string> countries{ static const std::map<char, const std::string> countries{
{'A', "USA"}, {'A', "USA"},
{'J', "Japan"}, {'J', "Japan"},

View File

@ -6,7 +6,7 @@
#include <hle/bios_class.h> #include <hle/bios_class.h>
#include <os/mapped.h> #include <os/mapped.h>
namespace zenith::fs { namespace cosmic::fs {
#pragma pack(push, 1) #pragma pack(push, 1)
struct RomEntry { struct RomEntry {
std::array<u8, 10> entity; std::array<u8, 10> entity;

View File

@ -2,7 +2,7 @@
// This file is protected by the MIT license (please refer to LICENSE.md before making any changes, copying, or redistributing this software) // This file is protected by the MIT license (please refer to LICENSE.md before making any changes, copying, or redistributing this software)
#include <fuji/mipsiv_interpreter.h> #include <fuji/mipsiv_interpreter.h>
#include <eeiv/ee_engine.h> #include <eeiv/ee_engine.h>
namespace zenith::fuji { namespace cosmic::fuji {
IvFujiSuperAsm(tlbr) { IvFujiSuperAsm(tlbr) {
auto entry{mainMips.fetchTLBFromCop(mainMips.cop0.GPRs.data())}; auto entry{mainMips.fetchTLBFromCop(mainMips.cop0.GPRs.data())};
mainMips.cop0.loadGPRTLB(std::ref(*entry)); mainMips.cop0.loadGPRTLB(std::ref(*entry));
@ -10,12 +10,12 @@ namespace zenith::fuji {
IvFujiSuperAsm(c0mfc) { IvFujiSuperAsm(c0mfc) {
u32 res{}; u32 res{};
res = mainMips.cop0.mfc0(mainMips.GPRs[ops.fir].bytes[0]); res = mainMips.cop0.mfc0(mainMips.GPRs[ops.fir].bytes[0]);
*(mainMips.gprAt<u32*>(ops.sec)) = res; *(mainMips.gprAt<u32>(ops.sec)) = res;
} }
IvFujiSuperAsm(c0mtc) { IvFujiSuperAsm(c0mtc) {
std::array<u32*, 2> c0mop{}; std::array<u32*, 2> c0mop{};
c0mop[0] = mainMips.gprAt<u32*>(ops.fir); c0mop[0] = mainMips.gprAt<u32>(ops.fir);
c0mop[1] = mainMips.gprAt<u32*>(ops.sec); c0mop[1] = mainMips.gprAt<u32>(ops.sec);
if (*c0mop[0] != 14 && *c0mop[0] != 30) if (*c0mop[0] != 14 && *c0mop[0] != 30)
; ;

View File

@ -3,7 +3,7 @@
#define IvFujiOp(op)\ #define IvFujiOp(op)\
void op(Operands ops) void op(Operands ops)
namespace zenith::fuji { namespace cosmic::fuji {
constexpr u8 first{0}; constexpr u8 first{0};
constexpr u8 second{1}; constexpr u8 second{1};
constexpr u8 third{2}; constexpr u8 third{2};

View File

@ -6,7 +6,7 @@
op(Operands(opcode, opeRegs));\ op(Operands(opcode, opeRegs));\
break break
namespace zenith::fuji { namespace cosmic::fuji {
IvFujiIopAsm(mfhi) { IvFujiIopAsm(mfhi) {
u32 target{ioMips.IOGPRs[ops.fir]}; u32 target{ioMips.IOGPRs[ops.fir]};
ioMips.IOGPRs[target] = ioMips.hi; ioMips.IOGPRs[target] = ioMips.hi;

View File

@ -4,7 +4,7 @@
#include <fuji/fuji_common.h> #include <fuji/fuji_common.h>
#define IvFujiIopAsm(op) IvFujiOp(IOPInterpreter::op) #define IvFujiIopAsm(op) IvFujiOp(IOPInterpreter::op)
namespace zenith::fuji { namespace cosmic::fuji {
enum IOPOpcodes { enum IOPOpcodes {
SpecialOp = 0x0, SpecialOp = 0x0,
CopMfc = 0x0, CopMfc = 0x0,

View File

@ -2,7 +2,7 @@
// This file is protected by the MIT license (please refer to LICENSE.md before making any changes, copying, or redistributing this software) // This file is protected by the MIT license (please refer to LICENSE.md before making any changes, copying, or redistributing this software)
#include <fuji/mipsiv_interpreter.h> #include <fuji/mipsiv_interpreter.h>
#include <eeiv/ee_engine.h> #include <eeiv/ee_engine.h>
namespace zenith::fuji { namespace cosmic::fuji {
static constexpr auto cleanPcBlock{(static_cast<u32>(-1) ^ (MipsIVInterpreter::superBlockCount * 4 - 1))}; static constexpr auto cleanPcBlock{(static_cast<u32>(-1) ^ (MipsIVInterpreter::superBlockCount * 4 - 1))};
void MipsIVInterpreter::performOp(InvokeOpInfo& func, bool deduceCycles) { void MipsIVInterpreter::performOp(InvokeOpInfo& func, bool deduceCycles) {
if (func.execute) { if (func.execute) {

View File

@ -9,7 +9,7 @@
#define IvFujiSuperAsm(op) IvFujiOp(MipsIVInterpreter::op) #define IvFujiSuperAsm(op) IvFujiOp(MipsIVInterpreter::op)
namespace zenith::fuji { namespace cosmic::fuji {
struct OutOfOrder { struct OutOfOrder {
enum EffectivePipeline { enum EffectivePipeline {
InvalidOne = 0, InvalidOne = 0,

View File

@ -3,7 +3,7 @@
#include <eeiv/ee_assembler.h> #include <eeiv/ee_assembler.h>
#include <console/backdoor.h> #include <console/backdoor.h>
#include <console/emu_vm.h> #include <console/emu_vm.h>
namespace zenith::fuji { namespace cosmic::fuji {
IvFujiSuperAsm(addi) { IvFujiSuperAsm(addi) {
mainMips.GPRs[ops.sec].words[0] = ops.operation.pa16[0] + mainMips.GPRs[ops.sec].words[0] = ops.operation.pa16[0] +
mainMips.GPRs[ops.thi].words[0]; mainMips.GPRs[ops.thi].words[0];
@ -22,7 +22,7 @@ namespace zenith::fuji {
// With the 18-bit signed instruction offset, the conditional branch range is ± 128 KBytes // With the 18-bit signed instruction offset, the conditional branch range is ± 128 KBytes
i32 jump{static_cast<i32>(ops.operation.pa16[0] << 2)}; i32 jump{static_cast<i32>(ops.operation.pa16[0] << 2)};
// GPR[31] ← PC + 8 // GPR[31] ← PC + 8
*(mainMips.gprAt<u32*>(eeiv::$ra)) = *mainMips.lastPC + 8; *mainMips.gprAt<u32>(eeiv::$ra) = *mainMips.lastPC + 8;
mainMips.branchByCondition(mainMips.GPRs[ops.thi].dw[0] < 0, jump); mainMips.branchByCondition(mainMips.GPRs[ops.thi].dw[0] < 0, jump);
} }
IvFujiSuperAsm(bgez) { IvFujiSuperAsm(bgez) {

View File

@ -7,7 +7,7 @@
};\ };\
break break
namespace zenith::fuji { namespace cosmic::fuji {
u32 MipsIVInterpreter::decMipsIvS(u32 opcode, InvokeOpInfo& decode) { u32 MipsIVInterpreter::decMipsIvS(u32 opcode, InvokeOpInfo& decode) {
switch (opcode & 0x3f) { switch (opcode & 0x3f) {
case EeSpecialSyscall: SWCached(syscall); case EeSpecialSyscall: SWCached(syscall);

View File

@ -1,7 +1,7 @@
#include <gpu/exhibition_engine.h> #include <gpu/exhibition_engine.h>
#include <common/except.h> #include <common/except.h>
namespace zenith::gpu { namespace cosmic::gpu {
ExhibitionEngine::ExhibitionEngine() { ExhibitionEngine::ExhibitionEngine() {
} }

View File

@ -4,7 +4,7 @@
#include <android/native_window_jni.h> #include <android/native_window_jni.h>
#include <gpu/violet/layer.h> #include <gpu/violet/layer.h>
namespace zenith::gpu { namespace cosmic::gpu {
class ExhibitionEngine { class ExhibitionEngine {
public: public:
ExhibitionEngine(); ExhibitionEngine();

View File

@ -1,7 +1,7 @@
#include <gpu/hw_render.h> #include <gpu/hw_render.h>
#include <common/global.h> #include <common/global.h>
namespace zenith::gpu { namespace cosmic::gpu {
RenderScene::RenderScene() { RenderScene::RenderScene() {
device->getStates()->customDriver.observer = [this]() { device->getStates()->customDriver.observer = [this]() {
pickUserRender(true); pickUserRender(true);

View File

@ -2,7 +2,7 @@
#include <common/types.h> #include <common/types.h>
#include <gpu/render_driver.h> #include <gpu/render_driver.h>
namespace zenith::gpu { namespace cosmic::gpu {
enum RenderApi : u8 { enum RenderApi : u8 {
HardwareVulkan, HardwareVulkan,
HardwareOpenGL HardwareOpenGL

View File

@ -4,7 +4,7 @@
#include <common/global.h> #include <common/global.h>
#include <common/except.h> #include <common/except.h>
#include <gpu/render_driver.h> #include <gpu/render_driver.h>
namespace zenith::gpu { namespace cosmic::gpu {
bool RenderDriver::loadVulkanDriver() { bool RenderDriver::loadVulkanDriver() {
auto serviceDriver{*(device->getStates()->customDriver)}; auto serviceDriver{*(device->getStates()->customDriver)};
auto appStorage{*(device->getStates()->appStorage)}; auto appStorage{*(device->getStates()->appStorage)};

View File

@ -2,7 +2,7 @@
#include <common/types.h> #include <common/types.h>
#include <gpu/violet/vk_render.h> #include <gpu/violet/vk_render.h>
namespace zenith::gpu { namespace cosmic::gpu {
using LinkableObject = void*; using LinkableObject = void*;
class RenderDriver { class RenderDriver {

View File

@ -3,7 +3,7 @@
#include <functional> #include <functional>
#include <jni.h> #include <jni.h>
namespace zenith::gpu::violet { namespace cosmic::gpu::violet {
class VioletPayload { class VioletPayload {
public: public:
std::function<void(jobject)> glvkSetSurface; std::function<void(jobject)> glvkSetSurface;

View File

@ -2,7 +2,7 @@
#include <EGL/egl.h> #include <EGL/egl.h>
namespace zenith::gpu::violet { namespace cosmic::gpu::violet {
struct Gl3Render { struct Gl3Render {
EGLSurface surface; EGLSurface surface;
}; };

View File

@ -5,7 +5,7 @@
#include <gpu/violet/function_payload.h> #include <gpu/violet/function_payload.h>
#include <gpu/violet/vk_render.h> #include <gpu/violet/vk_render.h>
#include <gpu/violet/gl3_render.h> #include <gpu/violet/gl3_render.h>
namespace zenith::gpu::violet { namespace cosmic::gpu::violet {
class VioletLayer : public VioletPayload { class VioletLayer : public VioletPayload {
public: public:
VioletLayer() = default; VioletLayer() = default;

View File

@ -3,7 +3,7 @@
#include <optional> #include <optional>
#include <vulkan/vulkan_raii.hpp> #include <vulkan/vulkan_raii.hpp>
namespace zenith::gpu::violet { namespace cosmic::gpu::violet {
struct VkRender { struct VkRender {
VkRender() {} VkRender() {}
std::optional<vk::raii::SurfaceKHR> surface; std::optional<vk::raii::SurfaceKHR> surface;

View File

@ -1,6 +1,6 @@
#include <gs/synth_engine.h> #include <gs/synth_engine.h>
namespace zenith::gs { namespace cosmic::gs {
void GSEngine::resetGraphics() { void GSEngine::resetGraphics() {
} }

View File

@ -1,6 +1,6 @@
#pragma once #pragma once
namespace zenith::gs { namespace cosmic::gs {
class [[maybe_unused]] GSEngine { class [[maybe_unused]] GSEngine {
public: public:
void resetGraphics(); void resetGraphics();

View File

@ -3,7 +3,7 @@
// All these tables and addresses were taken from the PCSX2 project in `GS/GSTables.cpp` on 10/16/2023, // All these tables and addresses were taken from the PCSX2 project in `GS/GSTables.cpp` on 10/16/2023,
// all rights reserved to the project and its maintainers // all rights reserved to the project and its maintainers
namespace zenith::gs { namespace cosmic::gs {
const u8 blockTable32[4][8]{ const u8 blockTable32[4][8]{
{0, 1, 4, 5, 16, 17, 20, 21}, {0, 1, 4, 5, 16, 17, 20, 21},
{2, 3, 6, 7, 18, 19, 22, 23}, {2, 3, 6, 7, 18, 19, 22, 23},

View File

@ -2,7 +2,7 @@
#include <common/types.h> #include <common/types.h>
namespace zenith::gs { namespace cosmic::gs {
// After some years of development, the Z mapping tables have been removed, // After some years of development, the Z mapping tables have been removed,
// with the commit message stating, "They aren't just an offset of the base value // with the commit message stating, "They aren't just an offset of the base value
// like the color formats, but instead an XOR of the associated color format" // like the color formats, but instead an XOR of the associated color format"

View File

@ -1,6 +1,6 @@
#include <hle/bios_class.h> #include <hle/bios_class.h>
namespace zenith::hle { namespace cosmic::hle {
jobject BiosInfo::createInstance() { jobject BiosInfo::createInstance() {
auto ioClass{findClass()}; auto ioClass{findClass()};

View File

@ -3,11 +3,11 @@
#include <common/types.h> #include <common/types.h>
#include <java/jclasses.h> #include <java/jclasses.h>
namespace zenith::hle { namespace cosmic::hle {
class BiosInfo : java::JavaClass { class BiosInfo : java::JavaClass {
public: public:
BiosInfo(JNIEnv* env) BiosInfo(JNIEnv* env)
: java::JavaClass(env, "emu/zenith/data/BiosInfo") {} : java::JavaClass(env, "emu/cosmic/data/BiosInfo") {}
i32 position; i32 position;
ZenFile fd; ZenFile fd;
u32 dataCRC; u32 dataCRC;

View File

@ -1,7 +1,7 @@
#include <hle/bios_patch.h> #include <hle/bios_patch.h>
#include <eeiv/ee_assembler.h> #include <eeiv/ee_assembler.h>
namespace zenith::hle { namespace cosmic::hle {
void BiosPatcher::emit(u32 address) { void BiosPatcher::emit(u32 address) {
mips->writeArray(address, intCodeASM); mips->writeArray(address, intCodeASM);
} }

View File

@ -7,7 +7,7 @@
#include <hle/group_mgr.h> #include <hle/group_mgr.h>
#include <eeiv/ee_engine.h> #include <eeiv/ee_engine.h>
namespace zenith::hle { namespace cosmic::hle {
class BiosPatcher { class BiosPatcher {
public: public:
BiosPatcher(JNIEnv* env, std::shared_ptr<eeiv::EEMipsCore>& core) BiosPatcher(JNIEnv* env, std::shared_ptr<eeiv::EEMipsCore>& core)

View File

@ -4,7 +4,7 @@
#include <common/global.h> #include <common/global.h>
#include <hle/group_mgr.h> #include <hle/group_mgr.h>
namespace zenith::hle { namespace cosmic::hle {
HLEBiosGroup::HLEBiosGroup(JNIEnv* env) : android(env) {} HLEBiosGroup::HLEBiosGroup(JNIEnv* env) : android(env) {}
void HLEBiosGroup::readBios(std::span<u8> loadHere) { void HLEBiosGroup::readBios(std::span<u8> loadHere) {
if (slotBios) if (slotBios)

View File

@ -5,7 +5,7 @@
#include <hle/bios_class.h> #include <hle/bios_class.h>
#include <fs/bios_loader.h> #include <fs/bios_loader.h>
namespace zenith::hle { namespace cosmic::hle {
class HLEBiosGroup { class HLEBiosGroup {
public: public:
HLEBiosGroup(JNIEnv* env); HLEBiosGroup(JNIEnv* env);

View File

@ -1,9 +1,9 @@
#include <hle/syscall_gate.h> #include <hle/syscall_gate.h>
#include <console/emu_vm.h> #include <console/emu_vm.h>
namespace zenith::hle { namespace cosmic::hle {
void SyscallDealer::hleResetEE(raw_reference<console::EmuVM> vm) { void SyscallDealer::hleResetEE(raw_reference<console::EmuVM> vm) {
i32 resetParam{*vm->mips->gprAt<i32*>(Param0)}; i32 resetParam{*vm->mips->gprAt<i32>(Param0)};
if (resetParam == 0) {} if (resetParam == 0) {}
else if (resetParam == 1) {} else if (resetParam == 1) {}
} }

View File

@ -3,7 +3,7 @@
#include <common/types.h> #include <common/types.h>
#include <console/backdoor.h> #include <console/backdoor.h>
#include <eeiv/ee_info.h> #include <eeiv/ee_info.h>
namespace zenith::hle { namespace cosmic::hle {
enum CallParams { enum CallParams {
Return = eeiv::$v0, Return = eeiv::$v0,
Param0 = eeiv::$a0, Param0 = eeiv::$a0,

View File

@ -1,7 +1,7 @@
#include <iop/iop_cop.h> #include <iop/iop_cop.h>
#include <bitset> #include <bitset>
namespace zenith::iop { namespace cosmic::iop {
void IopCop::rfe() { void IopCop::rfe() {
/* /*
status.kuc = status.kup; status.kuc = status.kup;

View File

@ -2,7 +2,7 @@
#include <common/types.h> #include <common/types.h>
#define CastU32(val) static_cast<u32>(val) #define CastU32(val) static_cast<u32>(val)
namespace zenith::iop { namespace cosmic::iop {
// https://psx-spx.consoledev.net/cpuspecifications/ // https://psx-spx.consoledev.net/cpuspecifications/
struct alignas(8) IopCopStatus { struct alignas(8) IopCopStatus {
// iec: Current Interrupt Enable // iec: Current Interrupt Enable

View File

@ -2,7 +2,7 @@
#include <iop/iop_core.h> #include <iop/iop_core.h>
#include <fuji/iop_interpreter.h> #include <fuji/iop_interpreter.h>
namespace zenith::iop { namespace cosmic::iop {
void IOMipsCore::intByINTC(bool isInt) { void IOMipsCore::intByINTC(bool isInt) {
if (isInt) if (isInt)
cop.cause.intPending |= 0x4; cop.cause.intPending |= 0x4;

View File

@ -4,7 +4,7 @@
#include <iop/iop_fuji.h> #include <iop/iop_fuji.h>
#include <iop/iop_cop.h> #include <iop/iop_cop.h>
namespace zenith::iop { namespace cosmic::iop {
struct IOPCache { struct IOPCache {
u32 data; u32 data;
u32 tag; u32 tag;

View File

@ -1,7 +1,7 @@
#pragma once #pragma once
#include <common/types.h> #include <common/types.h>
namespace zenith::iop { namespace cosmic::iop {
class IOMipsCore; class IOMipsCore;
class IOPExecVE { class IOPExecVE {

View File

@ -1,7 +1,7 @@
// SPDX-short-identifier: MIT, Version N/A // SPDX-short-identifier: MIT, Version N/A
// This file is protected by the MIT license (please refer to LICENSE.md before making any changes, copying, or redistributing this software) // This file is protected by the MIT license (please refer to LICENSE.md before making any changes, copying, or redistributing this software)
#include <iop/iop_intc.h> #include <iop/iop_intc.h>
namespace zenith::iop { namespace cosmic::iop {
void IopINTC::iopCheck() { void IopINTC::iopCheck() {
iop->intByINTC(ctrl && (stat & mask)); iop->intByINTC(ctrl && (stat & mask));
} }

View File

@ -2,7 +2,7 @@
#include <common/types.h> #include <common/types.h>
#include <iop/iop_core.h> #include <iop/iop_core.h>
namespace zenith::iop { namespace cosmic::iop {
class IopINTC { class IopINTC {
public: public:
IopINTC(std::shared_ptr<IOMipsCore>& mips) IopINTC(std::shared_ptr<IOMipsCore>& mips)

View File

@ -1,6 +1,6 @@
#include <java/device_handler.h> #include <java/device_handler.h>
namespace zenith::java { namespace cosmic::java {
JvmManager::JvmManager(JavaVM *jvm) JvmManager::JvmManager(JavaVM *jvm)
: androidRuntime(jvm) { : androidRuntime(jvm) {
void* env{}; void* env{};

View File

@ -2,8 +2,8 @@
#include <memory> #include <memory>
#include <zenith/os/system_state.h> #include <os/system_state.h>
namespace zenith::java { namespace cosmic::java {
class JvmManager { class JvmManager {
public: public:
JvmManager(JavaVM* jvm); JvmManager(JavaVM* jvm);

Some files were not shown because too many files have changed in this diff Show More