Using ShinyQuagsire's Splatoon 2 Post Printer

Discussion in 'General Tutorials' started by dj505, Aug 5, 2017.

  1. dj505
    OP

    dj505 Inexperienced Romhacker

    Member
    523
    119
    Oct 4, 2014
    Canada
    Most likely at the arcade
    Posted this guide originally in the Nintendo Switch specific forums, and gonna post it here too since there's no Switch-specific tutorials section.

    Disclaimer: This is not an easy guide to use! It's not as simple as placing some files in certain spots and running "make"; there are certain things you need to install, environment variables you need to set, etc. A *lot* of troubleshooting will most likely be necessary.I'm happy to help if you need some assistance, however.

    Seeing as nobody else has made a guide like this, and I've figured out how to get it running, I figured I'd make a guide to help out. This guide is not for beginners; you'll need at least a bit of knowledge on how to add programs to your path, use the command line, etc. This is also assuming you're using Windows.

    For those who don't know, this is the post printer:
    It uses a Teensy 2.0++ (and possibly other microcontrollers with USB HID compatible AVRs, such as the ATMega32u4) to mimic a Hori Pokken pad for the WiiU, which now works on the Switch due to update 3.0.0 allowing more controllers to be used.

    You'll need:

    Hardware:
    - A Teensy 2.0++ (the one with the AT90USB1286)
    - A USB C male to USB female adapter like this one
    - A Nintendo Switch
    - Splatoon 2

    Software:
    - Teensy Loader (Windows binary)
    - LUFA
    - Atmel AVR 8-bit and 32-bit GNU Toolchain (You'll need to create an account on the site to download)
    - The Splatoon 2 post printer, of course (Hit "Clone or download" and download a .zip)
    - If you have an ATMega32u4 board, use this repo instead for the post printer
    - Python 2.7 (Not Python 3)
    - GIMP 2
    - MinGW (the .exe installer)

    Section 1: Preparation

    First, you'll need to get all the software installed and everything.
    1. Download the Teensy Loader
    2. Download and install Python 2.7.
    3. Download and install Atmel's AVR 8-bit Toolchain (extract this to a folder like C:\development\AVR-Toolchain or something)
    4. Download and install GIMP. (Seeing a pattern here?)
    5. Download and install MinGW. If it wants to install any addons for the program itself, say yes.
    6. Create a folder somewhere on your PC (I made mine in C:\development\SwitchFightstick)
    7. Open up the .zip file for the post printer (whould be called Switch-Fightstick-master.zip) and open the folder inside that so you can see all the files. Extract all those into the folder you made in the last step. Delete the "image.c" file since you'll be making a new one later.
    8. Open up your system PATH by hitting the windows key and searching for "Edit the system environment variables", clicking "Environment variables...", and double clicking "Path" in the bottom system variables section.
    9. Open up Windows Explorer and find the folder where you installed the AVR toolchain in step 3. Once there, find the "bin" folder and go into that. Then copy your current path by clicking the top bar, selecting it all, and hitting ctrl+C.
    10. Go back to the Path window you opened in step 7 and hit "New". Paste the directory to the toolchain's bin folder there. While you're there, also add the directory "C:\Python27" (without quotes) to make sure Python will work properly. Apply and exit.
    11. Browse to the folder where you extracted the atual post printer, and open up the LUFA zip file. Find the folder inside the zip file titled "LUFA" and copy the folder itself to the same directory as the post printer
    12. If you're using an ATMega32u4 board, open the makefile in a text editor (preferably Notepad++) and replace the "MCU = at90usb1286" with "MCU = atmega32u4"
    Section 2: Preparing the image for printing
    1. Open up GIMP and hit ctrl+N to make a new canvas. Make it 320px wide and 120px tall.
    2. Paste your image onto this new canvas and resize it to fit however you want.
    3. On the top toolbar, select "Image" then hit "Mode" and select "Indexed". When the window pops up, hit "Use black and white (1 bit) pallet", and make sure dithering is set to normal. Your image should now be in just black and white, no grey or anything in between.
    4. Hit File > Export As... and export the image as "raw image data (.data)" and save it inside the post printer's folder alongside all the other files. Name it whatever you want, as long as it ends in ".data".
    5. Open up a command window and browse to the post printer's folder. Next you'll want to run the command "python bin2c.py [name of your image] > image.c". If successful, nothing will happen in the command line itself, but you should have a new file called "image.c"
    6. Run the command "make all". If you did everything correctly, it should now compile!
    Section 3: Actually running it from the Teensy

    I don't actually have my Teensy yet (ordered it last night), but I do have some experience using similar boards in the past. The following may not be 100% accurate, but it should be close enough that you can get it to work if I mistype something.
    1. Plug in your Teensy 2.0++ and open the Teensy Loader.
    2. Extract the .exe file to the post printer's directory. Don't run it.
    3. Open a command window and navigate to the post printer's directory.
    4. Run the command "teensy_loader_cli -mmcu=at90usb1286 -w Joystick.hex". If nothing happens, try pressing the button on the Teensy.
    5. If you're using an ATMega32u4 board, replace the "at90usb1286" portion of the above command with "atmega32u4"
    6. Make sure your Switch is charged fully; this will take a while. Like, an hour or more. It's not very fast, but still faster than doing it by hand.
    7. Open Splatoon 2 and go over to the post box. Select the smallest pencil with L. Hold up and right until the cursor is at the very top right corner, then press left and down once each. The cursor won't look like it moved. This is because the cursor actually goes one pixel out outside the boundaries, and pusing left and down brings to exactly the corner. You can tell by pressing left or down again; it should move instead of staying still. Just put it back to the corner again.
    8. Now you should be able to unplug your Teensy, plug your USB C to USB adapter into the Switch (in handheld mode), plug in the Teensy, and go! The reason you need to do it in handheld mode is because there are sync issues when just using the dock's USB ports in docked mode.
    If I made a mistake in any portion of this guide, please correct me! The above should get it working properly, but if it doesn't I need to know what I wrote wrong and what to correct. Again, I don't actually have my Teensy board itself so I can't fully test it, but I was able to successfully do sections 1 and 2.

    Anyone who has a Teensy 2.0++ and is willing to test this, please do and let me know if it works!
    ATMega32u4 compatibility was achieved already by _______ .
     
    Last edited by dj505, Aug 8, 2017
    Arck likes this.


  2. Arck

    Arck GBAtemp Advanced Fan

    Member
    765
    353
    Mar 13, 2016
    Nice guide !

    I have a question: Where do you plug the Teensy to the Switch or whatever hardware ?
    I don't exactly see how this part work.
     
  3. dj505
    OP

    dj505 Inexperienced Romhacker

    Member
    523
    119
    Oct 4, 2014
    Canada
    Most likely at the arcade
    That's what the USB C to A converter is for. You use it to plug the Teensy into the Switch while in handheld mode. The dock has USB ports, but it causes some conflicts and doesn't work properly.
     
  4. Arck

    Arck GBAtemp Advanced Fan

    Member
    765
    353
    Mar 13, 2016
    Ok, also I saw we need a "Pokken Tournament Pro Pad"
    It's not 100% necessary ?
     
  5. dj505
    OP

    dj505 Inexperienced Romhacker

    Member
    523
    119
    Oct 4, 2014
    Canada
    Most likely at the arcade
    It's not necessary whatsoever. The Teensy acts like a Pokken pad, kind of like emulating it. The pad itself is unneccesary.
     
  6. Tomtortoise

    Tomtortoise Member

    Newcomer
    12
    0
    Aug 7, 2017
    United States
    So I am stuck on running the python and make all scripts.

    I ran the python one and got the error " 'Python stuff I typed' is not recognized as an internal or external command, operable program or batch file." although image.c was still updated.

    I got the same 'make/make all' is not recognized as an internal or external command, operable program or batch file. but no .hex file was created. I was thinking the problem is with the paths I created but I double checked them and they are both there are directing to the correct spot.

    One more question, in Section 3 step 2, which .exe are you referring to? The teensy loader or one that will be created from the running 'make'?
     
  7. dj505
    OP

    dj505 Inexperienced Romhacker

    Member
    523
    119
    Oct 4, 2014
    Canada
    Most likely at the arcade
    Sounds like an issue with the path. For Python, it may have added itself automatically, but you should probably check and make sure "C:\Python27" is in the PATH. Same for the other programs.

    The .exe I was referring to should be the .exe for the Teensy Loader. No .exe will be created from running Make; only the .hex file and a few others.
     
  8. Tomtortoise

    Tomtortoise Member

    Newcomer
    12
    0
    Aug 7, 2017
    United States
    So these are the two directories I have added. This is on the Edit Environmental Variables window after double clicking Path in the system variables box.

    EDIT: I redid everything on a different computer and got the Python part to work, the make still does the same thing
     

    Attached Files:

    Last edited by Tomtortoise, Aug 8, 2017
  9. dj505
    OP

    dj505 Inexperienced Romhacker

    Member
    523
    119
    Oct 4, 2014
    Canada
    Most likely at the arcade
    Looks correct to me. Are those set under User variables or System variables?
     
  10. Tomtortoise

    Tomtortoise Member

    Newcomer
    12
    0
    Aug 7, 2017
    United States
    At first I had it under System Variables but I have added both paths to User Variables in addition. The only thing I am supposed to type is "make" or "make all"?
     
  11. dj505
    OP

    dj505 Inexperienced Romhacker

    Member
    523
    119
    Oct 4, 2014
    Canada
    Most likely at the arcade
    "make all" once everything is ready. Make sure to redo the Python part when making the image.c file when it's all working.
     
  12. Tomtortoise

    Tomtortoise Member

    Newcomer
    12
    0
    Aug 7, 2017
    United States
    Ok, at this point I don't even know what my best bet is, Il just try a whole bunch of stuff and hope I get it working at some point lol. Just a screenshot of what command line gives me
     

    Attached Files:

  13. dj505
    OP

    dj505 Inexperienced Romhacker

    Member
    523
    119
    Oct 4, 2014
    Canada
    Most likely at the arcade
    At this point I'd recommend closing the command prompt and everything and doing a reboot lol. Might fix it.
     
  14. Tomtortoise

    Tomtortoise Member

    Newcomer
    12
    0
    Aug 7, 2017
    United States
    I restarted and I got the "make all" command working but now it is making a .map file instead of a .hex file.

    Renaming the .map file to a .hex does not do anything either. As expected, when trying to run tinyloader, it gives the error "Error reading intel hex file"

    And I thought I almost had it, RIP
     
  15. dj505
    OP

    dj505 Inexperienced Romhacker

    Member
    523
    119
    Oct 4, 2014
    Canada
    Most likely at the arcade
    It should generate a .hex file along with those... Can you take a screenshot of the output folder?
     
  16. Tomtortoise

    Tomtortoise Member

    Newcomer
    12
    0
    Aug 7, 2017
    United States
    These are all of the files
     

    Attached Files:

  17. dj505
    OP

    dj505 Inexperienced Romhacker

    Member
    523
    119
    Oct 4, 2014
    Canada
    Most likely at the arcade
    Ok. The .map file it generates isn't a hex file... If you want, you can send me your image.c and I could built the .hex file for you as a temporary solution
     
  18. Tomtortoise

    Tomtortoise Member

    Newcomer
    12
    0
    Aug 7, 2017
    United States
    I have only been testing with an image of some random lines so the ironic.data is fine as you probably have that already. I don't know if it makes a difference but I am using an atmega32u4 chip.
     
  19. dj505
    OP

    dj505 Inexperienced Romhacker

    Member
    523
    119
    Oct 4, 2014
    Canada
    Most likely at the arcade
    I'll try compiling for ATMega32u4 and send you the hex file, I don't see why it wouldn't work. One sec

    — Posts automatically merged - Please don't double post! —

    Alright, try this hex file:
    http://www.mediafire.com/file/hp5hw2we2rwd2tg/Joystick.hex
     
  20. Tomtortoise

    Tomtortoise Member

    Newcomer
    12
    0
    Aug 7, 2017
    United States
    Finally got the .hex to upload to an atmega32u4. problem is the chip needs to be reset over serial before it can be programmed so using the command. It is also a clone Arduino Pro Micro that I am using so there is no built in reset/program button.

    "avrdude -p atmega32u4 -c avr109 -P COMx -U flash:w:<filename>.hex -v" will upload the code, but you have to short the reset and ground pins just before hitting enter. Now although the code did get uploaded and was verified, nothing happened when plugged in via a USB Micro-USBA-USBC-Switch. I don't know if it is a software thing or a hardware thing but the switch should be able to recognize the board. I will probably keep working on getting this working in the next few days as getting a $5 ebay arduino clone working would be fantastic.