tool to tools

Raphael Assenat 8 years ago
parent 6a2c109ee8
commit 4178ca2e52

@ -0,0 +1,64 @@
# Gamecube/N64 to USB adapter
## Introduction
This is the source code for a Gamecube/N64 controller to USB adapter firmware
meant to run on [ Multiuse PCB-X](
The project homepage is located at:
## License
The project is released under the General Public License version 3.
## Directories
* / : The firmware source code
* tool/ : This directory contains utilities to configure and update an adapter, manipulate mempak
image files, etc.
* scripts/ : Scripts and/or useful files
## Compiling the firmware
You will need a working avr-gcc toolchain with avr-libc and standard utilities such as make. Just
type 'make' and it should build just fine. Under Linux at least.
## Programming the firmware
The makefile has a convenient 'flash' target which sends a command to the firmware to enter
the bootloader and then executes dfu-programmer (it must of course be installed) with the
correct arguments.
Note that the tool must be compiled first and your permissions must also be set so that your
user may access the device. See 'Using the tools' below for more information.
## Compiling the tools
In the tool/ directory, just type make.
There are a few dependencies:
- libhidapi-dev
- libhidapi-hidraw0
- pkg-config
- gtk3 (for the gui only)
Provided you have all the dependencies installed, under Linux at least, it should
compile without errors. For other environments such has MinGW, there are provisions
in the makefile to auto-detect and tweak the build accordingly, but it if fails, be
prepared to hack the makefile.
## Using the tools
Under Linux, you should configure udev to give the proper permissions to your user,
otherwise communicating with the device won't be possible. The same requirement
also applies to dfu-programmer.
An easy way to do this is to copy the two files below to /etc/udev/rules.d, restart
udev and reconnect the devices.
For information on how to actually /use/ the tools, try --help. Ex:
$ ./gcn64ctl --help

@ -1 +0,0 @@
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="289b", ATTRS{idProduct}=="0017", MODE="0664", GROUP="plugdev"

@ -1,26 +0,0 @@
CFLAGS=-Wall -g
OBJS=main.o gcn64.o mempak.o gcn64lib.o hexdump.o gc2n64_adapter.o ihex.o delay.o hid.o sleep.o memmem.o
.PHONY : clean install
all: $(OBJS)
$(LD) $(OBJS) $(LDFLAGS) -o $(PROG)
%.o: %.c %.h
$(CC) $(CFLAGS) -c $<
rm -f *.o $(PROG)
@echo "Install not done yet. Sorry"

@ -1,4 +0,0 @@

@ -26,7 +26,7 @@ MEMPAKLIB_OBJS=mempak.o mempak_fs.o $(COMPAT_OBJS)
.PHONY : clean install
all: $(PROGS)
all: $(PROGS) gui.xml
gcn64ctl_gui: gcn64ctl_gui.o gcn64ctl_gui_mpkedit.o gcn64.o gcn64lib.o hexdump.o ihex.o mempak_gcn64usb.o $(MEMPAKLIB_OBJS)
$(LD) $^ $(LDFLAGS) $(GTK_LDFLAGS) -o $@
@ -37,6 +37,9 @@ gcn64ctl: main.o gcn64.o gcn64lib.o hexdump.o gc2n64_adapter.o ihex.o delay.o me
gcn64ctl_gui.o: gcn64ctl_gui.c gcn64ctl_gui.h
$(CC) $(CFLAGS) $(GTK_CFLAGS) -c $<
grep -v requires > gui.xml
gcn64ctl_gui_mpkedit.o: gcn64ctl_gui_mpkedit.c gcn64ctl_gui_mpkedit.h
$(CC) $(CFLAGS) $(GTK_CFLAGS) -c $<

@ -815,7 +815,7 @@ main( int argc,
app.builder = gtk_builder_new();
/* Load UI from file. If error occurs, report it and quit application.
* Replace "" with your saved project. */
if( ! gtk_builder_add_from_file( app.builder, "", &error ) )
if( ! gtk_builder_add_from_file( app.builder, "gui.xml", &error ) )
g_warning( "%s", error->message );
g_free( error );