Start and Shutdown of scheduler in simulator

This commit is contained in:
Lukas Höppner
2026-08-09 17:18:49 +02:00
parent 7ea52cb96a
commit 123a6e71b4
5 changed files with 309 additions and 30 deletions
+18 -6
View File
@@ -61,6 +61,12 @@ typedef bool (*nova64_sd_read_sector_cb_t)(uint32_t sector_idx,
typedef void (*nova64_cartridge_status_cb_t)(uint32_t slot_idx,
bool is_inserted);
/**
* @brief Callback for core log output.
* @param message Null-terminated UTF-8 log string.
*/
typedef void (*nova64_log_cb_t)(const char *message);
/* ========================================================================== */
/* I/O Interface Configuration Struct */
/* ========================================================================== */
@@ -74,6 +80,7 @@ typedef struct {
nova64_audio_output_cb_t audio_output;
nova64_sd_read_sector_cb_t sd_read_sector;
nova64_cartridge_status_cb_t cartridge_status;
nova64_log_cb_t log_message;
} nova64_io_interface_t;
/* ========================================================================== */
@@ -81,21 +88,26 @@ typedef struct {
/* ========================================================================== */
/**
* @brief Initializes the core engine and registers host I/O interface
* callbacks.
* @brief Initializes the core engine, registers host I/O interface callbacks,
* and starts the built-in launcher from internal storage in the WASM runtime.
* @param io_interface Pointer to filled struct containing I/O function
* pointers.
* @return True if initialized successfully, false if already initialized or
* invalid.
*/
NOVA64_API bool nova64_init_io(const nova64_io_interface_t *io_interface);
NOVA64_API bool nova64_init(const nova64_io_interface_t *io_interface);
/**
* @brief Executes one engine processing tick.
* @param delta_ms Elapsed time in milliseconds since the last tick.
* @brief Starts the main engine runtime and launches the FreeRTOS scheduler.
* @return 0 on success, negative error code on failure.
*/
NOVA64_API int32_t nova64_process_tick(uint32_t delta_ms);
NOVA64_API int32_t nova64_main();
/**
* @brief Requests shutdown of the FreeRTOS scheduler.
* @return True if the shutdown request was issued, false otherwise.
*/
NOVA64_API bool nova64_shutdown(void);
/**
* @brief Retrieves the engine version integer.