From e1a8006af704ab8220a27b821fefb01403501a08 Mon Sep 17 00:00:00 2001 From: Simon Gellis Date: Sat, 18 Jan 2025 13:57:19 -0500 Subject: [PATCH] Statically compile that callback too --- build.rs | 1 + src/emulator/shrooms_vb_core.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/build.rs b/build.rs index 44fd098..aeb1a79 100644 --- a/build.rs +++ b/build.rs @@ -24,6 +24,7 @@ fn main() -> Result<(), Box> { .define("VB_SIGNED_PROPAGATE", None) .define("VB_DIV_GENERIC", None) .define("VB_DIRECT_EXECUTE", "on_execute") + .define("VB_DIRECT_FRAME", "on_frame") .define("VB_DIRECT_READ", "on_read") .define("VB_DIRECT_WRITE", "on_write") .file(Path::new("shrooms-vb-core/core/vb.c")) diff --git a/src/emulator/shrooms_vb_core.rs b/src/emulator/shrooms_vb_core.rs index b27b9d8..53c99de 100644 --- a/src/emulator/shrooms_vb_core.rs +++ b/src/emulator/shrooms_vb_core.rs @@ -170,6 +170,7 @@ extern "C" { fn vb_write(sim: *mut VB, address: u32, _type: VBDataType, value: i32) -> i32; } +#[no_mangle] extern "C" fn on_frame(sim: *mut VB) -> c_int { // SAFETY: the *mut VB owns its userdata. // There is no way for the userdata to be null or otherwise invalid.