- METHODS AND ARGUMENTS
- GIT REPOSITORY
- SEE ALSO
- COPYRIGHT AND LICENSE
Device::GBA - Perl Interface to the Gameboy Advance
use Device::GBA; my $gba = Device::GBA->new(buspirate => '/dev/ttyUSB0') or die "No such device!\n"; $gba->upload('helloworld.gba');
The Nintendo Gameboy Advance can either boot from cartridge or over link cable. The latter is caled multiboot mode and is basically SPI and a homebrew encoding scheme. Unfortunately, the Bus Pirate doesn't have a 100k SPI mode, so we are using 125000 instead. If you encounter problems with booting, use the next lower speed (30000) as bitrate. This utility allows uploading multiboot GBA images via Device::Chip::Adapters. Don't forget to pass
-specs=gba_mb.specs to devkitARM GCC if you want to link a multiboot image. The package's
share/ subdirectory contains an example Makefile for cross-compilation. The wiring is as follows:
GBA Bus Pirate SO --> MISO SI <-- MOSI CLK <-- CLK GND --- GND
(Note to myself:) The cable I made looks like this:
___________________ .--------GND (white)----/ .-------._ | | .-----SD (black)------------|SD (B) |_ | | | .--SO (yellow)---, -|SC (R) |_--+-. _|__|__|_ \ -|GND (W)|_--' | / 6 4 2 \ \____-|SO (Y) |_ | \_5_ 3 _1_/ ___-|SI (O) |_ | | \_/ '-- VDD (n/a) / '-------' | | '----- SI (orange) ---/ | '-------- SC (red) --------------------------'
Note: This is still work in progress!
Opens specified device and returns the corresponding object reference. Returns undef if an attempt to open the device has failed. Accepts following parameters:
An instance of Device::Chip::Adapter capable of SPI communication.
if true, methods on this instance will narrate what they're doing. Default is
Reads in $firmware_file and uploads it to the Gameboy Advance.
$miso = $gba->spi_readwrite($mosi)
reads and writes 32 bit from the SPI bus.
$c = Device::GBA::crc($w, [$c = 0x0000c387])
Calculates CRC for word
$caccording to the algrithm used by the GBA multiboot protocol.
gba -- The command line utility
Based on The uploader written by Ken Kaarvik.
Copyright (C) 2018 Ahmad Fatoum
This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License v2.0 or later.