Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow "synchronous" loading of cartridge files #41

Merged
merged 5 commits into from
Mar 14, 2024

Conversation

cute-the-niini
Copy link
Member

In general, cartridge files live only in the kernel side, and cartridge processes must use an asynchronous RPC call to read them. This generally works for games made exclusively for Kate, however existing engines have varied needs of reading data "synchronously" (at least from the perspective of the game's code), so we need to support that as well.

This patch adds a way of pre-loading certain assets at the time the cartridge sandbox is being built, such that all reads of these assets from the cartridge's process appear to be synchronous (since they're moved to the cartridge's process at the time the sandbox is built). This in turn lets us support games written in RPG Maker MV and Godot 3 and 4 with no changes required on the game's code. The environment just fulfils all of the game's code expectations instead.

Note that Godot 4 games are not yet enabled in Kate due to the security vulnerability described in https://github.com/orgs/qteatime/discussions/1 --- cartridge processes need to be fully isolated before Godot 4 games can be enabled, as their processing requirements make it possible for cartridges to exploit Spectre vulnerabilities to read privileged information from the Kate kernel process, at least in theory.

@cute-the-niini cute-the-niini added c:kernel Changes to the Kate emulator kernel (requires strict audits!) c:tooling Changes to Kate's developer tooling/SDKs (relaxed audits) labels Mar 13, 2024
]
: []),
{ type: "capture-canvas", selector: "#canvas" },
{ type: "preserve-webgl-render" },
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Godot needs a bridge to disable serviceWorker as well, since otherwise the runtime code will trap by trying to read navigator.serviceWorker inside of a browser sandboxed process.

@cute-the-niini cute-the-niini merged commit d3e2e49 into main Mar 14, 2024
1 check passed
@cute-the-niini cute-the-niini deleted the patch/sync-network branch March 14, 2024 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c:kernel Changes to the Kate emulator kernel (requires strict audits!) c:tooling Changes to Kate's developer tooling/SDKs (relaxed audits)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant