This commit adds support for future when coding autosplitters for emulators, allowing to code similarly compared to native pc games.
The internal update() function, which is usually necessary in emulators to ensure correct updating of the main ram_base address, gets called automatically in this case, so this also removes the need to manually call said function on every iteration of the main loop.
The downside is using a internal mutability for the main state and ram_base variable, however they are not publicly accessible so this should not raise many concerns.
async fn main() {
loop {
let emulator = ps1::Emulator::wait_attach().await;
emulator.until_closes(async {
loop {
// TODO: Do something on every tick.
next_tick().await;
}
}).await;
}
}
This commit adds support for
future
when coding autosplitters for emulators, allowing to code similarly compared to native pc games. The internalupdate()
function, which is usually necessary in emulators to ensure correct updating of the mainram_base
address, gets called automatically in this case, so this also removes the need to manually call said function on every iteration of the main loop.The downside is using a internal mutability for the main
state
andram_base
variable, however they are not publicly accessible so this should not raise many concerns.