libdragon
Loading...
Searching...
No Matches
Files
Transfer Pak interface

Transfer Pak interface. More...

Files

file  tpak.c
 Transfer Pak interface.
 
file  tpak.h
 Transfer Pak interface.
 

Detailed Description

Transfer Pak interface.

The Transfer Pak interface allows access to Game Boy and Game Boy Color cartridges connected through the accessory port of each controller.

Before accessing a Transfer Pak, first call tpak_init to boot up the accessory and ensure that it is in working order. For advanced use-cases, tpak_set_power and tpak_set_access can also be called directly if you need to put the Transfer Pak into a certain mode. You can verify that the Transfer Pak is in the correct mode by inspecting the tpak_get_status flags.

Whenever the Transfer Pak is not in use, it is recommended to power it off by calling `tpak_set_power(controller, false)`.

You can read the connected Game Boy cartridge's ROM header by calling tpak_get_cartridge_header and validating the result with tpak_check_header. If the ROM header checksum does not match, it is likely that the cartridge connection is poor.

You can use tpak_read and tpak_write to access the Game Boy cartridge. Note that these functions do not account for cartridge bank switching. For more information about Game Boy cartridge bank switching, refer to the GBDev Pan Docs at https://gbdev.io/pandocs/