#include "C_LinkCable.h" #include "../LinkCable.hpp" extern "C" { C_LinkCableHandle C_LinkCable_create(C_LinkCable_BaudRate baudRate, u32 timeout, u16 interval, u8 sendTimerId) { return new LinkCable(static_cast(baudRate), timeout, interval, sendTimerId); } void C_LinkCable_destroy(C_LinkCableHandle handle) { delete static_cast(handle); } bool C_LinkCable_isActive(C_LinkCableHandle handle) { return static_cast(handle)->isActive(); } void C_LinkCable_activate(C_LinkCableHandle handle) { static_cast(handle)->activate(); } void C_LinkCable_deactivate(C_LinkCableHandle handle) { static_cast(handle)->deactivate(); } bool C_LinkCable_isConnected(C_LinkCableHandle handle) { return static_cast(handle)->isConnected(); } u8 C_LinkCable_playerCount(C_LinkCableHandle handle) { return static_cast(handle)->playerCount(); } u8 C_LinkCable_currentPlayerId(C_LinkCableHandle handle) { return static_cast(handle)->currentPlayerId(); } void C_LinkCable_sync(C_LinkCableHandle handle) { static_cast(handle)->sync(); } bool C_LinkCable_waitFor(C_LinkCableHandle handle, u8 playerId) { return static_cast(handle)->waitFor(playerId); } bool C_LinkCable_waitForWithCancel(C_LinkCableHandle handle, u8 playerId, bool (*cancel)()) { return static_cast(handle)->waitFor(playerId, cancel); } bool C_LinkCable_canRead(C_LinkCableHandle handle, u8 playerId) { return static_cast(handle)->canRead(playerId); } u16 C_LinkCable_read(C_LinkCableHandle handle, u8 playerId) { return static_cast(handle)->read(playerId); } u16 C_LinkCable_peek(C_LinkCableHandle handle, u8 playerId) { return static_cast(handle)->peek(playerId); } void C_LinkCable_send(C_LinkCableHandle handle, u16 data) { static_cast(handle)->send(data); } void C_LinkCable_onVBlank(C_LinkCableHandle handle) { static_cast(handle)->_onVBlank(); } void C_LinkCable_onSerial(C_LinkCableHandle handle) { static_cast(handle)->_onSerial(); } void C_LinkCable_onTimer(C_LinkCableHandle handle) { static_cast(handle)->_onTimer(); } }