mirror of
https://github.com/shadergz/cosmic-station.git
synced 2024-11-27 00:00:21 +00:00
Project
: Changes the name of all exception types
This commit is contained in:
parent
5a654ebbf4
commit
516430540f
@ -12,7 +12,7 @@ Java_emu_cosmic_helpers_BiosHelper_00024Companion_addBios(JNIEnv* env, jobject t
|
||||
|
||||
auto biosHld{AFileDescriptor_getFd(env, descriptor)};
|
||||
auto biosMgr{cosmic::app->getBiosMgr()};
|
||||
cosmic::i32 find[2]{biosHld, 0};
|
||||
std::array<cosmic::i32, 2> find{biosHld, 0};
|
||||
|
||||
auto object{info.createInstance()};
|
||||
if (biosMgr->isAlreadyAdded(find)) {
|
||||
@ -28,7 +28,7 @@ extern "C"
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_emu_cosmic_helpers_BiosHelper_00024Companion_setBios(JNIEnv* env, jobject thiz, jint pos) {
|
||||
auto group{cosmic::app->getBiosMgr()};
|
||||
cosmic::i32 by[2]{0, pos};
|
||||
std::array<cosmic::i32, 2> by{0, pos};
|
||||
|
||||
return group->choice(by, true);
|
||||
}
|
||||
@ -36,13 +36,14 @@ extern "C"
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_emu_cosmic_helpers_BiosHelper_00024Companion_removeBios(JNIEnv* env, jobject thiz, jintArray posFd) {
|
||||
if (env->GetArrayLength(posFd) != 2) {
|
||||
throw cosmic::AppFail("Not supported element array of size {} passed",
|
||||
throw cosmic::AppErr("Not supported element array of size {} passed",
|
||||
env->GetArrayLength(posFd));
|
||||
}
|
||||
auto group{cosmic::app->getBiosMgr()};
|
||||
jint* mangled{env->GetIntArrayElements(posFd, nullptr)};
|
||||
std::array<cosmic::i32, 2> mangle{mangled[0], mangled[1]};
|
||||
|
||||
bool hasRemoved{group->rmFromStorage(mangled)};
|
||||
bool hasRemoved{group->rmFromStorage(mangle)};
|
||||
|
||||
env->ReleaseIntArrayElements(posFd, mangled, 0);
|
||||
return hasRemoved;
|
||||
|
@ -23,7 +23,7 @@ namespace cosmic {
|
||||
};
|
||||
auto failed = ranges::find_if(feats, [](auto test) { return !test; });
|
||||
if (failed != feats.end()) {
|
||||
throw AppFail("Some of the required ARM ISA sets aren't available on your host processor");
|
||||
throw AppErr("Some of the required ARM ISA sets aren't available on your host processor");
|
||||
}
|
||||
|
||||
user->success("Device {} accepted as the host device, Android API {}", getDeviceName(), apiLevel);
|
||||
|
@ -1,5 +1,10 @@
|
||||
#pragma once
|
||||
class [[maybe_unused]] Asm;
|
||||
class [[maybe_unused]] HeyGithubThisIsACPPFILE {
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
#define PROLOGUE_ASM(alloc)\
|
||||
__asm volatile("stp x29, x30, [sp, #-" #alloc "]!\n")
|
||||
|
@ -29,12 +29,12 @@ namespace cosmic {
|
||||
CosmicException("(" tag ") " + fmt::format(format, std::forward<Args>(args)...)) {}\
|
||||
}
|
||||
|
||||
DECLARE_EXCEPTION_TYPE(Cop0Fail, "Cop0");
|
||||
DECLARE_EXCEPTION_TYPE(TimerFail, "EE::Timer");
|
||||
DECLARE_EXCEPTION_TYPE(MioFail, "MIO");
|
||||
DECLARE_EXCEPTION_TYPE(IoFail, "IO");
|
||||
DECLARE_EXCEPTION_TYPE(FsFail, "FS");
|
||||
DECLARE_EXCEPTION_TYPE(GpuFail, "GPU");
|
||||
DECLARE_EXCEPTION_TYPE(AppFail, "Cosmic");
|
||||
DECLARE_EXCEPTION_TYPE(Cop0Err, "Cop0");
|
||||
DECLARE_EXCEPTION_TYPE(TimerErr, "EE::Timer");
|
||||
DECLARE_EXCEPTION_TYPE(MioErr, "MIO");
|
||||
DECLARE_EXCEPTION_TYPE(IoErr, "IO");
|
||||
DECLARE_EXCEPTION_TYPE(FsErr, "FS");
|
||||
DECLARE_EXCEPTION_TYPE(GpuErr, "GPU");
|
||||
DECLARE_EXCEPTION_TYPE(AppErr, "Cosmic");
|
||||
#undef DECLARE_EXCEPTION_TYPE
|
||||
}
|
||||
|
@ -75,11 +75,11 @@ namespace cosmic {
|
||||
|
||||
void read(std::span<u8> here) {
|
||||
if (hld == invFile)
|
||||
throw IoFail("Can't read from this fd (broken), error: {}", strerror(errno));
|
||||
throw IoErr("Can't read from this fd (broken), error: {}", strerror(errno));
|
||||
|
||||
auto attempt{::read(hld, here.data(), here.size())};
|
||||
if (attempt != here.size())
|
||||
throw IoFail("Read operation failed with fd {} due to an error", hld);
|
||||
throw IoErr("Read operation failed with fd {} due to an error", hld);
|
||||
}
|
||||
void readFrom(std::span<u8> here, u64 from) {
|
||||
lseek64(hld, BitCast<off64_t>(from), SEEK_SET);
|
||||
|
@ -21,7 +21,7 @@ namespace cosmic::console {
|
||||
|
||||
}
|
||||
if (owner != std::this_thread::get_id())
|
||||
throw AppFail("This resource should have the lock held until the object is released");
|
||||
throw AppErr("This resource should have the lock held until the object is released");
|
||||
Ref<vm::EmuVm> vmRef{};
|
||||
if (vmRefs) {
|
||||
vmRef = *vm;
|
||||
@ -32,7 +32,7 @@ namespace cosmic::console {
|
||||
void BackDoor::leaveVm(Ref<vm::EmuVm> lvm) {
|
||||
if (echo.try_lock()) {
|
||||
if (owner != std::this_thread::get_id())
|
||||
throw AppFail("The program flow is broken, review the usage of BackDoor in the code");
|
||||
throw AppErr("The program flow is broken, review the usage of BackDoor in the code");
|
||||
}
|
||||
vmRefs--;
|
||||
if (!vm || vmRefs <= 0) {
|
||||
|
@ -17,7 +17,7 @@ namespace cosmic::cpu {
|
||||
break;
|
||||
}
|
||||
if (!features[feat].isArchOptional && !have) {
|
||||
throw AppFail("Your CPU SoC doesn't support the required family of instructions {}", features[feat].family);
|
||||
throw AppErr("Your CPU SoC doesn't support the required family of instructions {}", features[feat].family);
|
||||
}
|
||||
mrsA64.set(feat, have);
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ namespace cosmic::creeper::ee {
|
||||
isCached = true;
|
||||
}
|
||||
if (!isCached || !chosen || !chosen->isLoaded) {
|
||||
throw AppFail("No translated block was created or found; there is a bug in the code");
|
||||
throw AppErr("No translated block was created or found; there is a bug in the code");
|
||||
}
|
||||
runFasterBlock(PCs[0], PCs[1]);
|
||||
executionPipe[0] = cpu->runCycles;
|
||||
|
@ -97,7 +97,7 @@ namespace cosmic::creeper::ee {
|
||||
#endif
|
||||
decode.ops = Operands(opcode, operands);
|
||||
decode.execute = [](InvokeOpInfo& err) {
|
||||
throw AppFail("Invalid or unrecognized opcode {:#x}, parameters: {}", err.ops.inst,
|
||||
throw AppErr("Invalid or unrecognized opcode {:#x}, parameters: {}", err.ops.inst,
|
||||
fmt::join(err.ops.gprs, "; "));
|
||||
};
|
||||
|
||||
@ -123,11 +123,12 @@ namespace cosmic::creeper::ee {
|
||||
|
||||
}
|
||||
u32 MipsIvInterpreter::fetchPcInst(u32 pc) {
|
||||
if (pc & 4095)
|
||||
if (pc & 4095) {
|
||||
if (cpu->GPRs[26].words[0] == 0)
|
||||
if (cpu->GPRs[25].words[0] == 0)
|
||||
if (cpu->GPRs[30].dw[0] + cpu->GPRs[31].dw[0] == 0)
|
||||
;
|
||||
if (cpu->GPRs[30].dw[0] + cpu->GPRs[31].dw[0] == 0) {
|
||||
}
|
||||
}
|
||||
const u32 opcode{cpu->fetchByAddress(pc)};
|
||||
return opcode;
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ namespace cosmic::engine::copctrl {
|
||||
fix = 2;
|
||||
|
||||
if (!fix) {
|
||||
throw Cop0Fail("Address {} isn't cached or doesn't have a valid tag referencing it", address);
|
||||
throw Cop0Err("Address {} isn't cached or doesn't have a valid tag referencing it", address);
|
||||
}
|
||||
const CopCacheLine::CacheWay cont{cache->ec[fix - 1]};
|
||||
return cont.vec[address & 3];
|
||||
@ -49,7 +49,7 @@ namespace cosmic::engine::copctrl {
|
||||
pear = getCache(address, true, mode);
|
||||
assignFlushedCache(*pear, logical);
|
||||
if (pear->tags[0] != logical && pear->tags[1] != logical) {
|
||||
throw Cop0Fail("No portion of the cache line {} was properly selected! Tags: {}", logical,
|
||||
throw Cop0Err("No portion of the cache line {} was properly selected! Tags: {}", logical,
|
||||
fmt::join(pear->tags, ","));
|
||||
}
|
||||
auto cacheData{core.mipsRead<os::vec>(address)};
|
||||
@ -110,13 +110,13 @@ namespace cosmic::engine::copctrl {
|
||||
eec.tags[assign] &= 0xffffffff | tag;
|
||||
switch (mode) {
|
||||
case Instruction:
|
||||
if (eec.tags[assign] & validBit)
|
||||
;
|
||||
if (eec.tags[assign] & validBit) {
|
||||
}
|
||||
eec.tags[assign] |= validBit;
|
||||
break;
|
||||
case Data:
|
||||
if (eec.tags[assign] & dirtyBit)
|
||||
;
|
||||
if (eec.tags[assign] & dirtyBit) {
|
||||
}
|
||||
eec.tags[assign] |= dirtyBit;
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ namespace cosmic::engine::copctrl {
|
||||
}
|
||||
|
||||
if (virtWorld == realWorld) {
|
||||
throw Cop0Fail("It is not possible to map physical addresses to virtual ones if they are the same");
|
||||
throw Cop0Err("It is not possible to map physical addresses to virtual ones if they are the same");
|
||||
}
|
||||
}
|
||||
void CtrlCop::loadFromGprToTlb(mio::TlbPageEntry& entry) {
|
||||
@ -126,8 +126,8 @@ namespace cosmic::engine::copctrl {
|
||||
case 15: solved = pRid; break;
|
||||
case 30: solved = errorPC; break;
|
||||
default:
|
||||
if (reg >= GPRs.size())
|
||||
;
|
||||
if (reg >= GPRs.size()) {
|
||||
}
|
||||
solved = GPRs[reg];
|
||||
}
|
||||
return solved;
|
||||
|
@ -31,7 +31,7 @@ namespace cosmic::engine {
|
||||
vst1_u64_x4(gprs + regRange + 6, zero);
|
||||
}
|
||||
runCycles = cycles[0] = 0;
|
||||
user->info("(EE): Emotion Engine is finally reset to default, " \
|
||||
user->info("(EE): Emotion Engine is finally reset to default, "\
|
||||
"GPR {}: {}", gprsId[15], fmt::join(GPRs[15].dw, ", "));
|
||||
}
|
||||
void EeMipsCore::pulse(u32 cycles) {
|
||||
|
@ -5,8 +5,8 @@ namespace cosmic::engine {
|
||||
EeIntC::EeIntC(std::shared_ptr<EeMipsCore>& mips, std::shared_ptr<vm::Scheduler>& sq) :
|
||||
ee(mips),
|
||||
sched(sq) {
|
||||
intcStat = 0;
|
||||
intcMask = 0;
|
||||
intcStat = {};
|
||||
intcMask = {};
|
||||
check0Id = sched->createSchedTick(true, [this](u64 unused0, bool unused1) {
|
||||
int0Check();
|
||||
});
|
||||
|
@ -25,14 +25,14 @@ namespace cosmic::fs {
|
||||
romHeader = std::make_unique<os::MappedMemory<u8>>(hdrSize);
|
||||
|
||||
biosf = bios.fd;
|
||||
biosf.read(std::span<u8>{romHeader->operator*(), hdrSize});
|
||||
biosf.read(std::span<u8>{*(*romHeader), hdrSize});
|
||||
if (!isABios())
|
||||
return false;
|
||||
|
||||
std::array<u8, 16> romGroup;
|
||||
|
||||
if (!loadVersionInfo(getModule("ROMVER"), romGroup)) {
|
||||
throw FsFail("Cannot load the ROM version information, group : {}", fmt::join(romGroup, ", "));
|
||||
throw FsErr("Cannot load the ROM version information, group : {}", fmt::join(romGroup, ", "));
|
||||
}
|
||||
bios.dataCRC = cpu::check32(romGroup);
|
||||
|
||||
@ -81,7 +81,7 @@ namespace cosmic::fs {
|
||||
}
|
||||
|
||||
if (info.size() * sizeof(u16) < version->value) {
|
||||
throw FsFail("The buffer is too small to store the version information, size : {}, requested : {}", info.size(), version->value);
|
||||
throw FsErr("The buffer is too small to store the version information, size : {}, requested : {}", info.size(), version->value);
|
||||
}
|
||||
biosf.readFrom(info, verOffset);
|
||||
return true;
|
||||
@ -109,6 +109,4 @@ namespace cosmic::fs {
|
||||
bios.dspName = java::JniString(biosName);
|
||||
bios.details = java::JniString(biosDetails);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ namespace cosmic::gpu {
|
||||
|
||||
globalSurface = cosmicEnv->NewGlobalRef(surface);
|
||||
if (!globalSurface) {
|
||||
throw GpuFail("A Surface is required for us to control and inherit to the screen");
|
||||
throw GpuErr("A Surface is required for us to control and inherit to the screen");
|
||||
}
|
||||
window = ANativeWindow_fromSurface(*cosmicEnv, globalSurface);
|
||||
ANativeWindow_acquire(window);
|
||||
|
@ -30,7 +30,7 @@ namespace cosmic::gpu {
|
||||
u8 vulkan{graphicsApi == HardwareVulkan && functions == 0x1};
|
||||
|
||||
if ((openGl + vulkan) == 0) {
|
||||
throw GpuFail("There is an error while attempting to load all {} layer functions", apiNames(graphicsApi));
|
||||
throw GpuErr("There is an error while attempting to load all {} layer functions", apiNames(graphicsApi));
|
||||
}
|
||||
prepareGraphicsApi(*this);
|
||||
displayApiVersion(*this);
|
||||
|
@ -11,7 +11,7 @@ namespace cosmic::gpu {
|
||||
switch (api) {
|
||||
case HardwareVulkan:
|
||||
if (!loadVulkanDriver()) {
|
||||
throw GpuFail("No instance of the Vulkan driver was found");
|
||||
throw GpuErr("No instance of the Vulkan driver was found");
|
||||
}
|
||||
break;
|
||||
case SoftwareSlow:
|
||||
@ -31,7 +31,7 @@ namespace cosmic::gpu {
|
||||
if (!driver)
|
||||
driver = dlopen("libvulkan.so", RTLD_LAZY);
|
||||
if (!driver)
|
||||
throw GpuFail("No valid Vulkan driver was found on the host device");
|
||||
throw GpuErr("No valid Vulkan driver was found on the host device");
|
||||
}
|
||||
vulkanInstanceAddr = BitCast<PFN_vkGetInstanceProcAddr>(dlsym(driver, "vkGetInstanceProcAddr"));
|
||||
return driver && vulkanInstanceAddr;
|
||||
|
@ -14,7 +14,7 @@ namespace cosmic::gpu::vulcano {
|
||||
// Enumerating Vulkan devices present on the device
|
||||
auto devices{vki.enumeratePhysicalDevices()};
|
||||
if (devices.empty()) {
|
||||
throw GpuFail("No Vulkan device found on your device");
|
||||
throw GpuErr("No Vulkan device found on your device");
|
||||
}
|
||||
// Selecting and reading properties from the device
|
||||
for (const auto& dev : devices) {
|
||||
@ -33,7 +33,7 @@ namespace cosmic::gpu::vulcano {
|
||||
break;
|
||||
}
|
||||
if (physical.desiredQueueId == invQueueId) {
|
||||
throw GpuFail("Unable to find a valid queue family on the device");
|
||||
throw GpuErr("Unable to find a valid queue family on the device");
|
||||
}
|
||||
u32 queueCount{1};
|
||||
u32 enableLayerCount{};
|
||||
@ -58,7 +58,7 @@ namespace cosmic::gpu::vulcano {
|
||||
physical.gpuUser = vk::raii::Device(*physical.physicalDev, physical.info);
|
||||
|
||||
if (!physical.gpuUser) {
|
||||
throw GpuFail("Anomaly detected, Vulkan device not created");
|
||||
throw GpuErr("Anomaly detected, Vulkan device not created");
|
||||
}
|
||||
return physical;
|
||||
}
|
||||
@ -92,7 +92,7 @@ namespace cosmic::gpu::vulcano {
|
||||
requiredExtensions.pop_back();
|
||||
haveValidationLayer = false;
|
||||
} else {
|
||||
throw GpuFail("Couldn't find a Vulkan extension with name {}", required);
|
||||
throw GpuErr("Couldn't find a Vulkan extension with name {}", required);
|
||||
}
|
||||
#else
|
||||
throw GpuFail("Couldn't find a Vulkan extension with name {}", required);
|
||||
|
@ -22,7 +22,7 @@ namespace cosmic::hle {
|
||||
void fillInstance(jobject kotlin) override;
|
||||
void chkAndLoad(i32 descriptor);
|
||||
|
||||
bool isSame(i32 is[2], bool usePos = false) const {
|
||||
bool isSame(std::array<i32, 2>& is, bool usePos = false) const {
|
||||
bool equal;
|
||||
if (usePos) {
|
||||
equal = position == is[1];
|
||||
|
@ -16,13 +16,13 @@ namespace cosmic::hle {
|
||||
info.fd = DescriptorRaii(open(biosPath.c_str(), O_RDONLY), true);
|
||||
slotBios = std::make_unique<BiosInfo>(std::move(info));
|
||||
if (!slotBios) {
|
||||
throw AppFail("Wait, there is no BIOS available in the slot");
|
||||
throw AppErr("Wait, there is no BIOS available in the slot");
|
||||
}
|
||||
loader.triggerBios(*slotBios);
|
||||
loader.placeBios(loadHere);
|
||||
}
|
||||
|
||||
bool HleBiosGroup::isAlreadyAdded(i32 is[2], bool usePos) {
|
||||
bool HleBiosGroup::isAlreadyAdded(std::array<i32, 2>& is, bool usePos) {
|
||||
bool alreadyAdded{};
|
||||
if (slotBios && slotBios->isSame(is, usePos))
|
||||
return true;
|
||||
@ -34,9 +34,9 @@ namespace cosmic::hle {
|
||||
}
|
||||
return alreadyAdded;
|
||||
}
|
||||
bool HleBiosGroup::rmFromStorage(i32 rmBy[2], bool usePos) {
|
||||
bool HleBiosGroup::rmFromStorage(std::array<i32, 2>& rmBy, bool usePos) {
|
||||
bool hasRemoved{};
|
||||
biosList.remove_if([rmBy, usePos, &hasRemoved](const auto& bios) {
|
||||
biosList.remove_if([&rmBy, usePos, &hasRemoved](const auto& bios) {
|
||||
hasRemoved = bios.isSame(rmBy, usePos);
|
||||
return hasRemoved;
|
||||
});
|
||||
@ -48,7 +48,7 @@ namespace cosmic::hle {
|
||||
biosList.clear();
|
||||
}
|
||||
|
||||
i32 HleBiosGroup::choice(i32 chBy[2], bool usePos) {
|
||||
i32 HleBiosGroup::choice(std::array<i32, 2>& chBy, bool usePos) {
|
||||
i32 previous{};
|
||||
if (slotBios) {
|
||||
previous = slotBios->position;
|
||||
@ -57,7 +57,7 @@ namespace cosmic::hle {
|
||||
}
|
||||
|
||||
// All non-selected kernels will have their `selected` flag cleared
|
||||
auto picked{ranges::find_if(biosList, [chBy, usePos](auto& bios) {
|
||||
auto picked{ranges::find_if(biosList, [&chBy, usePos](auto& bios) {
|
||||
auto is{bios.isSame(chBy, usePos)};
|
||||
bios.selected = is;
|
||||
return is;
|
||||
@ -70,13 +70,13 @@ namespace cosmic::hle {
|
||||
return previous;
|
||||
}
|
||||
|
||||
bool HleBiosGroup::loadBiosBy(jobject model, i32 ldBy[2], bool usePos) {
|
||||
bool HleBiosGroup::loadBiosBy(jobject model, std::array<i32, 2>& ldBy, bool usePos) {
|
||||
bool loaded{};
|
||||
if (slotBios && slotBios->isSame(ldBy, usePos)) {
|
||||
slotBios->fillInstance(model);
|
||||
return true;
|
||||
}
|
||||
auto biosSelected{ranges::find_if(biosList, [ldBy, usePos](const auto& bios) {
|
||||
auto biosSelected{ranges::find_if(biosList, [&ldBy, usePos](const auto& bios) {
|
||||
return bios.isSame(ldBy, usePos);
|
||||
})};
|
||||
|
||||
|
@ -10,12 +10,12 @@ namespace cosmic::hle {
|
||||
HleBiosGroup();
|
||||
|
||||
bool storeAndFill(jobject model, BiosInfo&& bios);
|
||||
bool isAlreadyAdded(i32 is[2], bool usePos = false);
|
||||
bool rmFromStorage(i32 rmBy[2], bool usePos = true);
|
||||
bool isAlreadyAdded(std::array<i32, 2>& is, bool usePos = false);
|
||||
bool rmFromStorage(std::array<i32, 2>& rmBy, bool usePos = true);
|
||||
void discardAll();
|
||||
i32 choice(i32 chBy[2], bool usePos = false);
|
||||
i32 choice(std::array<i32, 2>& chBy, bool usePos = false);
|
||||
|
||||
bool loadBiosBy(jobject model, i32 ldBy[2], bool usePos = false);
|
||||
bool loadBiosBy(jobject model, std::array<i32, 2>& ldBy, bool usePos = false);
|
||||
void readBios(std::span<u8> loadHere);
|
||||
|
||||
std::unique_ptr<BiosInfo> slotBios;
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <common/global.h>
|
||||
namespace cosmic::hle {
|
||||
// https://github.com/PCSX2/pcsx2/blob/8c94efd61a437263dc23853c7658053be3c8ba7d/pcsx2/R5900OpcodeImpl.cpp#L99C1-L99C7
|
||||
static const std::array<const char*, 256> mipsCustomCallsIds{
|
||||
static const std::array<const char*, 256> mipsCustomCallsNames{
|
||||
"RFU000_FullReset", "ResetEE", "SetGsCrt", "RFU003", "Exit", "RFU005", "LoadExecPS2",
|
||||
"ExecPS2", "RFU008", "RFU009", "AddSbusIntcHandler", "RemoveSbusIntcHandler",
|
||||
"Interrupt2Iop", "SetVTLBRefillHandler", "SetVCommonHandler", "SetVInterruptHandler",
|
||||
@ -56,7 +56,7 @@ namespace cosmic::hle {
|
||||
void SyscallDealer::doSyscall(SyscallOrigin origin, i16 sys) {
|
||||
fmt::memory_buffer sysDev{};
|
||||
fmt::format_to(back_inserter(sysDev), "Syscall with the name {} ",
|
||||
mipsCustomCallsIds.at(static_cast<u64>(sys)));
|
||||
mipsCustomCallsNames.at(static_cast<u64>(sys)));
|
||||
|
||||
if (origin == SysEmotionEngine) {
|
||||
fmt::format_to(back_inserter(sysDev), "E.E. over {} ",
|
||||
|
@ -44,7 +44,7 @@ namespace cosmic::iop {
|
||||
void IopCop::mtc(u8 copId, u32 regVal) {
|
||||
std::bitset<8*8> leaf{status.to64()};
|
||||
if (copId != 12) {
|
||||
throw AppFail("Unknown register with index {} being used", copId);
|
||||
throw AppErr("Unknown register with index {} being used", copId);
|
||||
}
|
||||
leaf[0] = regVal & 1;
|
||||
leaf[1] = regVal & (1 << 1);
|
||||
|
@ -35,7 +35,7 @@ namespace cosmic::iop {
|
||||
i64 calcPc{static_cast<i64>(ioPc) + pcAddr};
|
||||
waitPc = static_cast<u32>(calcPc);
|
||||
if (waitPc & 0x3) {
|
||||
throw AppFail("Next IOP PC {:x}: lowest 3 bits couldn't be set", waitPc);
|
||||
throw AppErr("Next IOP PC {:x}: lowest 3 bits couldn't be set", waitPc);
|
||||
}
|
||||
onBranch = true;
|
||||
branchDelay = 1;
|
||||
|
@ -106,9 +106,9 @@ namespace cosmic::mio {
|
||||
cid = (address >> 12) - 0x8; break;
|
||||
}
|
||||
if ((address >> 16 & 0x1000) != 0x1000) {
|
||||
throw MioFail("(DMA): Reading from an invalid address, unreachable address {}", address);
|
||||
throw MioErr("(DMA): Reading from an invalid address, unreachable address {}", address);
|
||||
} else if (cid == invCid) {
|
||||
throw MioFail("No channel selected, very serious error...");
|
||||
throw MioErr("No channel selected, very serious error...");
|
||||
}
|
||||
// For specific channels like: SifX, IpuX, SprX
|
||||
if ((address >> 4 & 0x400) == 0x400)
|
||||
|
@ -11,7 +11,7 @@ namespace cosmic::mio {
|
||||
}
|
||||
chan->adr += 16;
|
||||
if (!chan->qwc) {
|
||||
throw MioFail("We don't need to continue anymore, caused by the channel: {}", channelsName.at(chan->index));
|
||||
throw MioErr("We don't need to continue anymore, caused by the channel: {}", channelsName.at(chan->index));
|
||||
}
|
||||
switch (chan->qwc) {
|
||||
case 0x1:
|
||||
|
@ -29,7 +29,7 @@ namespace cosmic::mio {
|
||||
for (auto segmentPage{kUnmapStart}; segmentPage != kUnmapEnd; segmentPage += 4096) {
|
||||
auto kVTable{segmentPage / 4096};
|
||||
if (kVTable >= 1024 * 1024) {
|
||||
throw MioFail("Kernel TLB table {} is outside the specified range", kVTable);
|
||||
throw MioErr("Kernel TLB table {} is outside the specified range", kVTable);
|
||||
}
|
||||
|
||||
kernelVtlb[kVTable] = choiceMemSrc(segmentPage & (0x20000000 - 1));
|
||||
@ -60,7 +60,7 @@ namespace cosmic::mio {
|
||||
|
||||
void TlbCache::tlbChangeModified(u32 page, bool value) {
|
||||
if (page >= 1024 * 1024)
|
||||
throw MioFail("Page {} is outside the range, TLB is missing for this page", page);
|
||||
throw MioErr("Page {} is outside the range, TLB is missing for this page", page);
|
||||
tlbInfo[page].isModified = value;
|
||||
}
|
||||
bool TlbCache::isCached(u32 address) {
|
||||
|
@ -20,7 +20,7 @@ namespace cosmic::mio {
|
||||
if (entry.valid[0]) {
|
||||
odd = {};
|
||||
} else if (!entry.valid[1]) {
|
||||
throw MioFail("Virtual page {} does not have any valid information; this is a logical error", virtNumber);
|
||||
throw MioErr("Virtual page {} does not have any valid information; this is a logical error", virtNumber);
|
||||
}
|
||||
mapFromAddr = virtPhyInfo[odd][0];
|
||||
mapFromPage = virtPhyInfo[odd][1];
|
||||
|
@ -7,8 +7,8 @@ namespace cosmic::spu {
|
||||
|
||||
}
|
||||
void Spu2::writeDmaData(u32 data) {
|
||||
if (!status.dmaReady)
|
||||
;
|
||||
if (!status.dmaReady) {
|
||||
}
|
||||
spuWrite(data & 0xffff);
|
||||
|
||||
status.dmaBusy = true;
|
||||
|
@ -25,7 +25,7 @@ namespace cosmic::vu {
|
||||
case 0x17:
|
||||
v0->spP.uns = value; break;
|
||||
default:
|
||||
throw AppFail("Invalid VU special register index {} used with CTC2 instruction, value: {}", special, value);
|
||||
throw AppErr("Invalid VU special register index {} used with CTC2 instruction, value: {}", special, value);
|
||||
}
|
||||
}
|
||||
void MacroModeCop2::clearInterlock() {
|
||||
|
Loading…
Reference in New Issue
Block a user