From bde511dd8521559862357b5fe7b3d4c79d96b663 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sat, 17 Jun 2023 16:20:56 -0500 Subject: [PATCH] [teagba] Wrap BIOS functions in namespaced C++ functions --- deps/teagba/include/teagba/bios.hpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/deps/teagba/include/teagba/bios.hpp b/deps/teagba/include/teagba/bios.hpp index 4ab73561..a34f767a 100644 --- a/deps/teagba/include/teagba/bios.hpp +++ b/deps/teagba/include/teagba/bios.hpp @@ -20,3 +20,26 @@ void teagba_intrwait(unsigned discardExistingIntrs, unsigned intrSubs); void teagba_vblankintrwait(); } + +namespace teagba { + +// waits for any interrupt +inline auto halt() noexcept { + return teagba_halt(); +} + +inline auto stop() noexcept { + return teagba_stop(); +} + +// waits for interrupts specified in interSubs +inline auto intrwait(unsigned discardExistingIntrs, unsigned intrSubs) noexcept { + return teagba_intrwait(discardExistingIntrs, intrSubs); +} + +// waits for vblank interrupt +inline auto vblankintrwait() noexcept { + return teagba_vblankintrwait(); +} + +} \ No newline at end of file