Releases: afska/gba-link-connection
Releases · afska/gba-link-connection
v8.0.3
v8.0.2
v8.0.1
v8.0.0
You might want to check out the new FAQ section.
- 💥 Breaking changes:
- ⚙️ All
enumare nowenum class, so constructs likeLinkCable::BAUD_RATE_1orto_string(baudRate)should be migrated toLinkCable::BaudRate::BAUD_RATE_1andto_string((int)baudRate) - 👾 In
LinkCable,send(...)now returns a boolean that can befalseif the data is invalid or the send queue is full (LinkWireless's behavior) - 🔧👾 In
LinkRawCable, the default baud rate was changed toLinkRawCable::BaudRate::BAUD_RATE_3 - 📻 The
LinkWirelesstransport-level protocol has been redone from scratch, so it cannot communicate with v7 and below. The new protocol is way more efficient (more details below) - 📻 In
LinkWireless, theLINK_WIRELESS_ENDsentinel value has been removed, and nowgetServers(...),getServersAsyncEnd(...)andreceive(...)have an out parameter with the array size - 📻 The file
lib/LinkWireless.cpphas been moved tolib/iwram_code/LinkWireless.cpp - 📻 In
LinkWireless, theLINK_WIRELESS_USE_SEND_RECEIVE_LATCHandLINK_WIRELESS_TWO_PLAYERS_ONLYoptions have been removed, since some of the optimizations they added were applied to the main library - 📻 In
LinkWireless,LINK_WIRELESS_MAX_SERVER_TRANSFER_LENGTH's default value was changed from20to11 - 🔧📻
LinkRawWireless::RemoteCommandhas been removed and unified withLinkRawWireless::CommandResultwithdataanddataSizeas fields - 🔧📻
LinkRawWireless::deactivate()doesn't reset the adapter anymore. Instead, callingbye()is required. This is to allow 'moving' between different libraries while maintaining the connection active (for example,LinkWirelessMultiboot->LinkUniversal) - 🔧📻
LinkRawWireless::acceptConnections(...)was renamed toLinkRawWireless::pollConnections(...) - 🔧📻 In
LinkRawWireless, command calls now receive pointers instead ofstd::array - 🔧📻 In
LinkRawWireless, some internal methods are now private - 🌎 In
LinkUniversal, when using the non-default constructor, sending theforwardingboolean in theWirelessOptionsis now required - 🌎 In
LinkUniversal, therandomSeedconstructor parameter was moved toLink::randomSeedto reuse it in the other libraries - 🌎 In
LinkUniversal, the fieldslinkCableandlinkWirelessare now private. UsegetLinkCable()andgetLinkWireless()if you need to do platform-exclusive stuff like updating broadcast data, closing a server, or getting signal levels
- ⚙️ All
- 📺 Added LinkIR:
- Infrared Adapter (AGB-006)
- 💳 Added LinkCard:
- e-Reader integration
- 👾 LinkCable:
- 💥
send(...)now returns a boolean that can befalseif the data is invalid or the send queue is full (LinkWireless's behavior) playerCount()doesn't flicker between 0 and 1 anymore when disconnected. Now, the minimum is always1(LinkWireless's behavior)- Messages from interrupt queues are only moved to main queues if they are not full
- The library has been refactored to use
LinkRawCableinternally, to avoid having duplicated code - Added
canSend()method to know if asend(...)call would fail due to the send queue being full - Added
didQueueOverflow(...)method to know whether the queue hit its full capacity at some point - Added
resetTimeout()method to allow changing the timeout in real time - Added
resetTimer()method to allow changing the interval in real time - C bindings now support
getConfig()andsetConfig(...)methods
- 💥
- 💻 LinkCableMultiboot:
- Added
LinkCableMultiboot::Async, which makes sending completely interrupt-based and lets games play animations and/or music during the transfer. Based on gba_mem_viewer's implementation - Reduced random wait to make detection faster
- The sync version has now more error checks and validations
- The
LinkUniversal_realexample can now send multiboot ROMs asynchronously, while playing audio/video
- Added
- 🔧👾 LinkRawCable:
- 💥 The default baud rate was changed to
LinkRawCable::BaudRate::BAUD_RATE_3
- 💥 The default baud rate was changed to
- 📻 LinkWireless:
- 💥 The
LinkWirelesstransport-level protocol has been redone from scratch, so it cannot communicate with v7 and below. The new protocol is way more efficient. Some advantages of this new version are:- Reduced overhead / more bandwidth: only a 32-bit header is added containing all the ACKs, the rest of the bandwidth is available for user messages. The only exception is when
forwardingis enabled, which adds a 16-bit header every 5 messages, but it's still much better than what v7 was doing - Reduced CPU usage: since more data is sent in less packets, the number of serial IRQs to attend is reduced. For more details, check the profiler example
- Reduced RAM usage: entries use half the space in message queues
- Messages from other players are now forwarded immediately instead of waiting for the next
receive(...)call - The value
0xFFFFcan now be sent - Unlimited packet IDs: the previous version supported up to 4194304 packets, which is a lot, but you could easily hit that limit after a 10-hour session
- Reduced overhead / more bandwidth: only a 32-bit header is added containing all the ACKs, the rest of the bandwidth is available for user messages. The only exception is when
- 💥 The
LINK_WIRELESS_ENDsentinel value has been removed, and nowgetServers(...),getServersAsyncEnd(...)andreceive(...)have an out parameter with the array size - 💥 The file
lib/LinkWireless.cpphas been moved tolib/iwram_code/LinkWireless.cpp - 💥 The
LINK_WIRELESS_USE_SEND_RECEIVE_LATCHandLINK_WIRELESS_TWO_PLAYERS_ONLYoptions have been removed, since some of the optimizations they added were applied to the main library - 💥
LINK_WIRELESS_MAX_SERVER_TRANSFER_LENGTH's default value was changed from20to11 - The library has been refactored to use
LinkRawWirelessinternally, to avoid having duplicated code - When there's packet loss due to queues being full, the newest message is prioritized (
LinkCable's behavior) - Messages from interrupt queues are only moved to main queues if they are not full
- Added
restoreExistingConnection()method to allow starting the library with the adapter already connected (replacesactivate()). This is useful after multiboot, to reuse the existing connection - Added
getSignalLevel(...)method to allow retrieving the signal level of other peers - Added
closeServer()method to allow closing a room while keeping the session active, to prevent new users from joining - Added
canSend()method to know if asend(...)call would fail due to the send queue being full - Added
didQueueOverflow(...)method to know whether the queue hit its full capacity at some point - Added
resetTimeout()method to allow changing the timeout in real time - Added
resetTimer()method to allow changing the interval in real time - Added knobs for
LINK_WIRELESS_PUT_ISR_IN_IWRAM(likeLINK_WIRELESS_PUT_ISR_IN_IWRAM_SERIAL_LEVEL) to control the desired optimization level - The
LINK_WIRELESS_ENABLE_NESTED_IRQoption doesn't require enablingLINK_WIRELESS_PUT_ISR_IN_IWRAManymore - When hosting a room, the library now uses the
SignalLevelcommand (0x11) instead ofPollConnections(0x1a) to update the player count. This is slightly faster and makesgetSignalLevel(...)calls free on the server side - Removed the 15-scanline wait from
serve(...)since we don't need to call0x1aanymore - Improved timeout handling, so if the adapter keeps old data in its buffer after a disconnection, old confirmation numbers still trigger timeouts
- Fixed a bug when using
LINK_WIRELESS_ENABLE_NESTED_IRQwhere other IRQs could interrupt the adapter's acknowledgement - C bindings now support
getConfig()andsetConfig(...)methods - The recommended default interval was changed to
75 - The
LinkWireless_demoexample can now restore a session after multiboot and set up high timeouts with the RIGHT key - The
LinkWireless_demoexample now sends x10 instead of x2 when holding the LEFT key - The
LinkWireless_demoexample now includes a help section with all the button combinations - The
LinkWireless_demoexample now shows the signal levels when serving - The
LinkWireless_demoexample can now change the interval dynamically with the L/R keys - The profiler example can now close the server with START+UP
- The profiler example now measures performance in total cycles consumed by ISRs per frame
- The profiler example is now included in the multiboot pack
- The profiler example has been divided in two:
LinkWireless_prof_code_iwramandLinkWireless_prof_code_rom - The
LinkWireless_demo_2playerexample doesn't exist anymore, since the option has been removed
- 💥 The
- 📡 LinkWirelessMultiboot:
- Added
LinkWirelessMultiboot::Async, which makes sending completely interrupt-based and lets games play animations and/or music during the transfer - Added a
readyflag to the progress callback to allow starting the transfer before the player count is reached - Added an optional
keepConnectionAliveparameter tosendRom(...)so users can reuse the existing connection - Added
reset()method to turn off the adapter - Before starting, an
EndHost(0x1b) command is now issued to the adapter to prevent unwanted connections during the transfer - Added retries to final transfer to improve reliability in noisy environments
- The
LinkWirelessMultiboot_demoexample can now start the transfer before the player count is reached with the SELECT key - The
LinkUniversal_realexample can now send multiboot ROMs asynchronously, while playing audio/video
- Added
- 🔧📻 LinkRawWireless:
- 💥
RemoteCommandhas been removed and unified withCommandResultwithdataanddataSizeas fields - 💥
deactivate()doesn't reset the adapter anymore. Instead, calling...
- 💥
v7.0.3
v7.0.2
- 📻 LinkWireless:
- Fixed user name length validation in
serve(...) - Ensuring a clean
RCNTstate on activation to prevent incompatibilities withLinkGPIOor other libraries
- Fixed user name length validation in
- 📡 LinkWirelessMultiboot:
- Fixed compile script in example to properly show logs
- 🔧📻 LinkRawWireless:
- Fixed user name length validation in
broadcast(...)
- Fixed user name length validation in
- 🔧🏛 LinkWirelessOpenSDK:
- Fixed uninitialized and unaligned reads bug
- 🌎 LinkUniversal:
- Fixed random seed initialization
v7.0.1
v7.0.0
- 💥 Breaking changes:
- ⚙️ Since libtonc is no longer a dependency, lib/_link_common.hpp needs to be included
- 👾📻 In
LinkCableandLinkWireless, theremoteTimeoutparameter has been removed. Now, there's a singletimeout, measured in frames. This change simplifies things by making timeouts independent of theintervalvalue - 📻 In
LinkWireless, theasyncACKTimerIdparameter has been removed. With the latest changes, it's no longer needed and actually burns more cycles - 🔗
LINK_SPI_8BIT_MODEwas moved to a runtime argument to allow using two different data sizes in the same project. Now, to use 8-bit SPI, passLinkSPI::PacketSize::SIZE_8BITas last constructor argument
- 🟪 Added LinkCube:
- JOYBUS mode
- 📱 Added LinkMobile:
- Mobile Adapter GB (thanks @REONTeam)
- 👾 LinkCable:
- 💥 The
remoteTimeoutconstructor parameter has been removed. The functionality remains the same, but now both IRQ-timeouts and message timeouts use thetimeoutparameter, measured in frames - Send buffer is cleared after every SERIAL interrupt, preventing duplicate packets
- Timeout checking was moved to the VBlank handler to avoid extra checks for every timer tick
- 💥 The
- 💻 LinkCableMultiboot:
- Made some changes to improve stability/reliability of transfers
- Added an SPI mode, to transfer ROMs using a GBC Link Cable
- Added a compile-time constant to change the logo's palette data
- The example can now send multiple ROMs and launch them. It's now bundled with every other gba-link-connection example
- 📻 LinkWireless:
- 💥 The
remoteTimeoutconstructor parameter has been removed. The functionality remains the same, but now both IRQ-timeouts and message timeouts use thetimeoutparameter, measured in frames - 💥 The
asyncACKTimerIdparameter has been removed. With the latest changes, it's no longer needed and actually burns more cycles - Communications with the adapter now use timeouts 10 times smaller, so when disconnected, the synchronous methods are faster
- Added optional
turnOffparameter todeactivate() - If initialization fails, the timers and SPI serial mode are now stopped
- When already serving, calling
serve(...)to update broadcast data will no longer cause disconnections if the adapter is busy. In such case, the method will returnfalseandgetLastError()will beBUSY_TRY_AGAIN - Added compile-time constant to enable nested interrupts so time-critical VBlank handlers (e.g. an audio player) can run on time
- Added compile-time constant to optimize the library for two-player games and allow sending small unchecked packets as fast as possible
- Fixed bad memory access when a hacked client spoofs its player ID
- The example now shows the compile-time settings
- The example can now test quick send/receive (2-player only)
- The profiler example can now change the broadcast data with the UP key
- 💥 The
- 📡 LinkWirelessMultiboot:
- Improved disconnection and acknowledgment handling
- Added cancel option to example
- The example can now send multiple ROMs and launch them. It's now bundled with every other gba-link-connection example
- 🔧📻 LinkRawWireless:
- Added wait to prevent timing issues with clock inversion. This improves wireless multiboot!
- 🌎 LinkUniversal:
- Improved performance when the Wireless Adapter is not connected and the protocol is
AUTODETECT - Now, the Wireless Adapter is put in low consumption mode only on
deactivate()and not after every switch - Added a constructor parameter to initialize the random seed
- Added sanity checks to ensure that setting
LINK_UNIVERSAL_MAX_PLAYERSto less than 4 won't produce undefined behavior - Added a more real stress test using butano, with an audio player, a video, text and sprites
- Improved performance when the Wireless Adapter is not connected and the protocol is
- 🔗 LinkSPI:
- 💥 Moved data size from a compile-time constant (
LINK_SPI_8BIT_MODE) to a constructor parameter (dataSize) - Added 8-bit toggle to the example
- 💥 Moved data size from a compile-time constant (
- 🖱️ LinkPS2Mouse:
- Added cancel option to example
- ⌨️ LinkPS2Keyboard:
- Implemented parity check
- Added Scan Code key and event enums
- Switched to C-style function pointers to avoid extra dependencies
- Added clear option to example
- ⚙️ General:
- 💥 The libraries no longer depend on libtonc. All the required code was included here inside a namespace
- Minimized global namespace pollution. All internal API constants are private now
- Added C bindings for -almost- all libraries
- Added
Link::perFrame(...)helper to easily calculate timer intervals - Added Doxygen-style docs for IDE quick info to all libraries
- Compile-time knobs can be defined from outside without touching any library code
- Every method that doesn't have a side effect was marked with
[[nodiscard]] - Improved overall documentation, adding notes about memory usage and other considerations
- Multiboot ROMs are now included as part of the release
- Updated examples to libugba v0.3.0
- Refactored example code
- All examples have now been tested and compiled using gcc 14