dce: stub getVBlankStatus

This commit is contained in:
DH 2025-12-02 19:37:03 +03:00
parent fed5cfac53
commit 23fd83e3d5
2 changed files with 19 additions and 1 deletions

View file

@ -311,7 +311,7 @@ void Device::start() {
});
}
std::jthread vblankThread([](const std::stop_token &stopToken) {
std::jthread vblankThread([this](const std::stop_token &stopToken) {
orbis::g_context->deviceEventEmitter->emit(
orbis::kEvFiltDisplay,
[=](orbis::KNote *note) -> std::optional<orbis::intptr_t> {
@ -330,6 +330,8 @@ void Device::start() {
std::chrono::duration_cast<std::chrono::nanoseconds>(period);
std::this_thread::sleep_until(prevVBlank);
vblankCount++;
orbis::g_context->deviceEventEmitter->emit(
orbis::kEvFiltDisplay,
[=](orbis::KNote *note) -> std::optional<orbis::intptr_t> {

View file

@ -469,6 +469,22 @@ static orbis::ErrorCode dce_ioctl(orbis::File *file, std::uint64_t request,
return {};
});
} else if (args->id == 0xb) {
struct VblankStatus {
orbis::uint64_t count;
orbis::uint64_t processTime;
orbis::uint64_t tsc;
char flags;
};
VblankStatus vblankStatus{};
// TODO: lock bridge header
vblankStatus.count = gpuCtx.vblankCount;
vblankStatus.processTime = 0; // TODO
vblankStatus.tsc = 0; // TODO
vblankStatus.flags = 0; // TODO
std::memcpy(args->ptr, &vblankStatus, sizeof(VblankStatus));
} else { // used during open/close
ORBIS_LOG_NOTICE("dce: UNIMPLEMENTED FlipControl", args->id, args->arg2,
args->ptr, args->size);