Wednesday, February 12, 2025

Notes from Setting Up PS2 HDD FHDM on Fat PlayStation 2 for FMCB

 Ugh, well, there were a million wrong turns here.  Trying to recall and document what I finally actually did to the best of my ability.

Years ago I set up a FreeMCBoot Memory card for a slim.  It works fine and still works.  Forget how I did that.  I think with the DVD lid hack maybe?  Cause I didn't buy a preconfigured Memory card. 

I also set up a cheap ass Goodwill router and one of my ancient USB harddrives attached to it for a SMB solution.  Worked fine on regular games.  Stuttered and was generally horrible on Guitar Hero.  

So, decided to use the PS2 Fat with a Network Adapter and the old harddrive solution.  I used an OEM network adapter and a classic old 200GB IDE harddrive, (i.e.) not a fancy new SATA one.

This requires the use of a IDE to USB adapter.  I am old, so I already had a BIG UGLY EXTERNAL USB case to put the drive in.  (Also, side note, it was a Firewire era case, and someday if I care I'll go ahead and find a proper cable and see if maybe I can hook it up as the message boards seem to indicate OPL can use Firewire connected drives now...)

Once I finally got it going, it was great.  Here was my journey as best I can remember.

PREFACE: The Way to use Github is to go to the releases, and then download the main file/zip.  Sometimes you simply need to download the source as a zip and the file you need is actually there, not in a full release...  I highly recommend only getting these tools from the author's sites on their githubs...

First,  PFS-BatchKit-Manager ended up being the main tool I used.  (https://github.com/GDX-X/PFS-BatchKit-Manager)

For a command line, it's an amazing program.  It _was_ a bit confusing, TBH as a few functions are really buried away.  And a few things just aren't obvious or well connected in just how FreeMCBoot and OPL work and interact.  AND, while the devs are all great and have capable work, the PS2 coding community has never all really wrapped it into a beautiful bow.  You are really hacking together a lot of pieces which works to varying degrees and with various version to version compatibility issues.  (AS ALWAYS, ALL RESPECT TO ALL DEVS AS WITHOUT YOU, I'M LOOKING AT AN UNHACKED PS2.  THIS IS NOT CRITICISM AS I KNOW EVERYONE IS JUST A PERSON HACKING FOR FREE FOR THE LOVE OF DOING IT.)

So, PFS-BatchKit-Manager is what gets you set up with a working harddrive (HDD).  The how-to instructions in the readme are straight up awesome and work great.

Please note: While the "How To Install" instructions give you all the files you need to write to your USB drive, you don't actually need to do everything it says if you want to use a different guide after you use it to do a basic format of the drive.  i.e.  If you stop here...

  1. In PFS BatchKit Manager Go to > HDD Management
  2.  Choose option 8 Hack your HDD To PS2 Format (This is only intended to be used as an entry point for the PS2.)

Then, you could follow _any_ guide that tells you how to install an HDD from a Memory Card/USB _also_.   Not saying there's anything wrong with the guide.  But, like all things hacking PS2...  You have a million paths to get there.

The next thing to know is that while FreeHDBoot and FreeMCBoot are the exact same interface... the difference is that FreeHDBoot on an internal HDD suffers because it leverages a custom Playstation 2 partitioning format.  You will find a whole bunch of great guides explaining this.  And some ones as wordy as mine going through a million steps and discussions.

So, while your next steps, using PFS-BatchKit-Manager's supplied files and scripts after step 2, or using whatever the current method of formatting/reformatting the HDD and installing FHDB and OPL are...  Remember that your next steps, whether you let PFS's scripts do it or not, are always going to be...

I don't want to tell you what is best above.  PFS does it.  and... After I screwed up things unrelated to it, I did it myself with the raw tools too. 

One thing is for certain though.  BEFORE YOU DO ANYTHING ELSE... 

  1. Fix the OPL to point to __common.
  2. And then go in and add OPL to FMCB's list of applications.


First the __common.  This note in PFR-BatchKit-Manager's help file about the config file is cryptic and important... 

How to install PS2 Games

NOTE: Before installing your games, it is strongly recommended to define your OPL resource partition or create the +OPL partition. I recommend using the __common partition by default.

 What this means is this...  Remember I said the file structure and partitioning of the HDD is weird.  You can't normally mount the drive in windows, and you can't just drag and drop PS2 DVD iso game files to it.

YOU WILL NEED TO EITHER USE A PROGRAM LIKE PFR-BatchKit-Manager, OR, figure out how to get networking going (I never could for many reasons) OR get very very used to transferring things to and from the USB thumb drive and even maybe editing files in the Configurator.

Because of this... Even if your Install of OPL creates a +OPL partition... don't use it.  Use the __Common...  as PFR's author recommends.

Lots of places dance around how to do this, but I'm going to make it very clear.

  • The file is called conf_hdd.cfg.
  • The exact text inside needs to be:  hdd_partition=__common
    • You can edit this inside of the PS2. OR You can edit this on your PC and put it on the USB drive.  Use a basic text editor.  I always prefer Notepad++.
  •  This file needs to go in this folder: hdd0:__common/OPL/conf_hdd.cfg
  • You have to use the wlaunchELF or ulaunchELF interface to do this. One important note here is that "Browser" is how the PS2 looks at memory cards.  "FileBrowser" is what you need here, and is inside the Launcher app.  It may have various names depending on how you installed it.  (See the "MENU" section 2 paragraphs down for more of that.)  Your x and o keys will swap depending on which interface and how you got in there.  It's all frustrating and confusing in these interfaces.  LOOK FOR THE KEY ON THE BOTTOM LEFT FOR WHAT IS "OK".  Once you get there, R1 opens a copy/paste/rename menu.  You need to "mark" the file before this.  When you want to edit on the PS2, pressing OK to select the file opens a text editor with a million hidden little menus and such.  You don't need to "mark" the file before editing.  GOOD LUCK.  lol.  I prefer editing on the PC first.

What this does is point your OPL to use the files on __common INSTEAD of +OPL.  You don't need _another_ partition on the drive, and they're getting away from the separate OPL folder.  Just don't do it.  You already have space reserved in the partition that holds __common.

Second is adding OPL to the MENU of applications.  This is one of the craziest and most confusing steps of PS2 hacking. 

People will try to convince you to use the "Browser" with HSSOSD.  It is slow and the icons are ugly and tiny, IMHO.  Don't fall into the trap.  Yes, you can set it up.  Yes, you can make it pretty.  But I prefer OPL.
 

YOU want to use OPL.  But, OPL doesn't always show up by default in FHDB after you install it.  Neither does any other app...  YOU NEED TO ADD IT TO THE APPLICATION MENU.

You do this by 

  • going to the Free HDBoot Configurator and 
  • going to Configure OSDSYS Options
  • Navigate to Configure Item 1.
  • Scroll left/right in this field to an Item # you want to overwrite or modify or create in a blank.
  • This is super confusing because not _all_ items are displayed, and some that are there are _not_ displayed.  I think this is because it only shows 1. All mandatory items like Browser all the time and they can't be changed and 2. Hides items where it can't find the item it's supposed to show.
  • I also found the interface lets you copy and move items (L2/R2 - read the bottom of the screen).  This can be helpful.  I put OPL to the top above xLAUNCHELF, and named it "PLAY GAMES (OPL)".  So it isn't so damn cryptic for non-geeks, and it is also visible by default on boot.
    • To do this, copy whatever Item 1 is, and paste it in a blank spot.  Then you can Modify Item 1 the way you want.
  • The thing you'll notice here is that you can map to ANY .elf file AND that it can be in ANY location.  It doesn't care, and I don't have any advice OTHER than to get OPL onto the HDD.
  •  In fact, as I was trying to get networking to work, at one point, I had like 5 versions of OPL saved out...
  • Some installers put 2 versions of LaunchELF in the menu for you... One for normal and one for HDD... There's no magic here...  If you open up their configs, you will see they have fallbacks set up... what does that mean?  It means you can cascade where/how it looks for files.  This is in case you have a need to have things to Memory Card if present, USB if present, and HDD as a fall back.  This is much like the boot sequence on a PC where you normally go to HDD, but if you plug something in, you want it to use what you plugged in.  YOU DON'T NEED 3 THINGS if you're just pointing to something on the HDD and don't need a fall back.
  • Once you're done... SAVE YOUR CONFIG TO THE HDD with  "Save CNF to hdd0"  IF YOU DON'T DO THIS YOU LOSE ALL YOUR WORK.

NOW, you should be able to reboot and open OPL and see that you have no games when you open it.

HERE'S WHERE I CRIED BECAUSE I COULDN'T GET THE "Make your PC read/write to your PS2 HDD" NETWORK GUIDES TO EVER WORK. I got close a million times.  There are a million things described.  But for me.  For either HDL or for NBD servers, I had varying degrees of failure and success just getting the server to start.  (This is with OPL version 1.1.0 being current release and 1.2 being in various beta states in Feb 2025.)  YOU SHOULD BE ABLE TO USE ONE OF THE METHODS.  I NEVER WAS ABLE.  BUT, HERE'S A ROCK SOLID WAY TO MANUALLY, PHYSICALLY, ADD FILES, CONFIGS, ART, AND OPL THEMES.

(I will not be documenting all the ways I failed because so many message board posts include people saying "well it worked for me" with people having the same problem.  But no solutions.  I only know 1 thing...  unless you have a reason to... DO NOT CHANGE THE DEFAULT SERVER SETTINGS for IP and such.  I got smart and thought I could set those to my regular network, but what that does is just get everything confused.  I only had success having them pointing away from my current router.) 

(Also, SMB refers to the PS2 reading files stored on an external SMB drive on your network.  SMB file saving is a COMPLETELY DIFFERENT THING than having your HDD in your PS2 be read by your PC.)

Now that you're ready to just give up on Network manually add files...

Here's how I MANUALLY added PS2 ISO's.

  • PREFACE - .iso's HAVE to be set up for the HDD in their own special partitions.  LET AN APP DO THIS FOR YOU.
  • First, download the PS2 games you want.  (And of course legally own a physical copy of.)
    • I do not cover Playstation 1 games and POPSTARTER here.  They use a different process, and I already have a hacked playstation.
    • Remember kids, as of this writing, googling "ROMS Megathread" and using the github site that comes up is the best way to find games.  (that of course you legally own a physical copy of).
  • Next, open the compressed file.
  • If it's an .iso, you're good.  Just drag to the DVD folder.
  • If it's a bin/cue file, you'll want to get an app like an old 5.x version of WinISO.  Use the convert function.  Find the bin file.  Save it as the exact same name with the .iso extension.  Now it's an ISO (even though it was really a CD in real life, it now is a DVD for the purposes of OPL's naming convention.)
  • I never tried any formats other than iso. 
  • Put all the .iso's in the PC's "DVD" folder where you are staging all your roms.
  • I messed around a bunch with OPL Manager (https://oplmanager.com/).  It is a very cool piece of software.  Most importantly, it has a great database connection for downloading the artwork.  And sometimes for downloading CFG files.  
    • It also really really wants you to rename your files.  And that interface is odd and painful at times.  And, I think, mostly unnecessary.  And it forces the names to be the 32 characters that OPL shows visually... but doesn't tell you how many characters over the limit you are.
  •  WHAT I USED was PFS-BatchKit-Manager again.
  • So, REMOVE your HDD from your PS2, cause you cried and the ethernet server method never worked for you.
  • Connect it back to your PC.
  • Use PFS-BatchKit-Manager's PS2 upload functionality.  Let it do everything it suggests.  Go eat lunch.  Come back after a while.
  • Then, try to use PFS-BatchKit-Manager's functionality to upload Art and Config files.  It's buried under "OPL management" as the CFG files and the ART files are used by OPL.  In that menu, you have to use " [1] Transfer OPL Resources".  It uses the folders alongside your DVD folder.
  • Once they're all uploaded, safely remove your USB from the PC, remove the drive from the USB, reinstall in your PS2, and .... configure some more OPL stuff below!
  • A NOTE:  ALL of the various utilities create the same kind of CFG and ART files. And, you do NOT need a special partition or any special tools to update or change these.  The naming convention is the code name SUSS_123_56 of the game.  You can obtain and load these in any way you want.  At one point, I filled in some missing ones using a transfer from the USB drive to the right folder.  And your use of +OPL and __common as the folder locations can be switched and moved around.  You can use the FileBrowser interface in xLauncherElf to do all this.

CONFIGURING OPL to actually show and play the games.

 This is actually much more confusing than it needs to be.  IDK why.  But it is.

First, you have to know that OPL turns off all the stuff you want by default.  So, I am getting bored of typing, but know these truths.

  • You can get themes here at ps2-home...  https://www.ps2-home.com/forum/search.php?keywords=&terms=all&author=&attr_id=13&sc=1&sf=all&sr=topics&sk=i&sd=a&st=0&ch=-1&t=0&submit=Search 
    • You transfer themes just like you transfer CFG and ART files.  Either use PFS-Batchkit or transfer using a USB thumb drive.
  • You have to turn ON hdd access in the interface by setting the hdd to "AUTO".  If you don't want other menu items you're not using, turn those off.
  • You also have to turn ON the usage of artwork.
  • Unless you're using blue tooth to connect to a PS3/4 controller, it seem to be best just to turn off PADEMU as that seems to be the #1 issue when you read about "why my game freezes" questions.
  • Every time you set something, you need to make sure to click "OK" and then to save your settings.
  • I do all my game renaming right in OPL.  I tried to figure out just how to rename things in OPL Manager and PFR-Batchkit on the PC, and it was just too painful when I couldn't get the network interfaces to work.  OPL's rename interface is weird cause you can't move the cursor left/right, but other than that works fine.  But also, the naming of the files themselves is not the naming in the config file which is not the naming the OPL shows in the main menu interface.  (The name in the config is for OPL's info page...)
  • OPL on most games lets you reset back to OPL by pressing select, start, R1, R2, L1, and L2 all at the same time.
  • USE THE COMPATIBILITY SETTINGS THAT PEOPLE SUGGEST ON THE WEB when you have weird stuff happen.  Most likely, the reason your game isn't working is because one of those boxes needs to be checked, or, as said above, PADEMU or VMC causes problems.  (I just use a regular memory card...)

I'm sure there's steps I've forgotten, but this was how I did it.  My apologies on this guide being sucky and horrible.  I just needed to brain dump on what I did and what tools I used to set up my PS2 HDD.

Sunday, August 11, 2024

How to set up a self booting dedicated Moonlight (Sunshine client of Nvidia's GameStream) on a Raspberry Pi 3B+

8/11/2024:  This guide shows you how to set up a Raspberry Pi 3B+ (and older?) to stream your desktop PC from anywhere on your home network to any TV in your house using Gamestream/Sunshine via Moonlight.

I use this so I can run full speed games and full sound applications and full video streaming from my main PC to my various TV's around the house and (shhhhh) to a monitor on KVM on my work from home desk setup.  Basically, these little ancient Pi 3B+'s are more than powerful enough to run full speed 1080p Moonlight.  Especially with wired ethernet.

---------------------------

Disclaimer: I am not an expert.  I'm bad at Linux.  I figured this out reading lots and lots of README's and proper wiki and FAQ's and TONS and TONS of message board posts.  The three main links you need:

https://www.raspberrypi.com/software/ - Bullseye 32 Bit Lite
https://www.raspberrypi.com/documentation/computers/configuration.html - How to use Raspi-Config
https://github.com/moonlight-stream/moonlight-embedded/wiki/Packages - Commandlines to install Moonlight.
https://github.com/moonlight-stream/moonlight-embedded/wiki/Usage - Commands for using moonlight.
https://www.makeuseof.com/what-is-systemd-launch-programs-raspberry-pi/ - Basics on how to set a SYSTEMD service to autoboot.

---------------------------
If you want to speed run this guide and are fluent in Linux/Raspian, try the following shorthand steps.  (HOWEVER, I have no idea what updates will be made by the Moonlight Embedded devs and Raspian devs, so please read the verbose version after this and use the hyperlinks in it if you want to be sure it's all still valid.)

  1. Install Bullseye 32 bit lite with Raspberry Pi Imager on a 4GB or higher USB device.  Make sure to set localization and, if using wifi, your wifi credentials with OS Customization.
  2. Plug in Keyboard, Mouse, and xBox controller to USB ports on Pi.
  3. Run first boot, and at the command line
  4. curl -1sLf 'https://dl.cloudsmith.io/public/moonlight-game-streaming/moonlight-embedded/setup.deb.sh' | distro=raspbian sudo -E bash
  5. sudo apt install moonlight-embedded
  6. sudo apt update
  7. sudo apt upgrade
  8. sudo nano /boot/config.txt and change "dtoverlay" to be dtoverlay=vc4-fkms-v3d
  9. sudo raspi-config and turn on 
    1. autologin, 
    2. Network at boot, and 
    3. set the GPU Memory to 256.
    4. If it doesn't reboot for you, do another sudo reboot
  10. Pair Moonlight with: moonlight pair.  (You'll need to get the Pair code from your PC running Sunshine.)
  11. Test moonlight with: moonlight stream -1080 -app "Desktop"
  12. Exit moonlight with: Shift-Ctrl-Option-Q
  13. Establish SYSTEMD service file:
    sudo nano /lib/systemd/system/moonlight.service
  14. Text of moonlight.service should read:

  15. [Unit]
    Description=StartMoonlight
    After=network.target

    [Service]
    ExecStart=moonlight stream -1080 -app "Desktop"
    #Restart=always
    User=pi

    [Install]
    WantedBy=multi-user.target

    (Note, the Restart=always is just needed if you want to auto-restart due to some kind of failure.  The # in front means it is disabled/commented out.)

  16. Test with: sudo systemctl start moonlight.service
  17. Quit Moonlight with Shift-Ctrl-Alt-Q.
  18. Now, we need to enable the service to run on every reboot with: 
    sudo systemctl enable moonlight.service
  19. And now, do a sudo reboot
  20. Enjoy your autobooting moonlight Raspberry Pi3+!

---------------
Below is my patented horribly wordy, document for myself by typing outloud and probably never going back and editing guide to setting up Moonlight on an ancient, dusty Raspberry Pi 3B+!  Worked for me as of 8/11/24.

Background: Ok, so, I had this set up and working great... and then my card died magically one day... AND I realized I had forgot to back it up and make a standard image for myself.  It's not too hard to set up, except the Autoboot isn't obvious and various Reddit threads via Google searching give too many options.  This will be the 3rd or 4th time I've done it without documenting the steps because of setting up various versions on different dedicated and PINN implementations.   And, there are lots of help files I used along the way, so since I have to look it all up again, I figured I should document this time!

You can set this up as one of your PINN OS's if you want, or just as a straight full OS.  The whole build fits on a 4GB SD card or USB drive (I'm gonna see if it fits on a 1GB drive someday, since I have a bunch of 1 GB USB thumbdrives laying around).  And also, since it's essentially a dumb client to your PC with no involvement on your end other than turning it on, and doesn't do any read/write cycles really... you can run it with the Pi as a physically switched on/off device.

Yes... Essentially, what I do is just turn on my Pi, set my TV to the Pi's in port... and the mouse, keyboard, and xBox controller just "work" like I'm on my actual PC.  With wired ethernet, it's almost just like you're at your regular gaming PC.   (Even on wireless, the streaming speed and lag is remarkably good.)

Quite honestly, I'm blown away at how good this works.

What does this build get you?

  1. Install of Bullseye lite (Legacy 32 Bit version) of Raspbian OS for Raspberry Pi 3B+ (YMMV on other Pi's) using Raspberry Pi Imager (https://www.raspberrypi.com/software/).
  2. Install of Moonlight Embedded.  (https://github.com/moonlight-stream/moonlight-embedded)
    1. Must use the "Embedded" version on this age/vintage of Raspberry Pi.
  3. Command lines to configure Moonlight.
  4. Command lines to set up Moonlight to autoboot.
  5. I don't offer advice on how to set up Sunshine (Main site: https://app.lizardbyte.dev/Sunshine/ Download link as of today: https://app.lizardbyte.dev/Sunshine/?lng=en-US#Download  Github as of today: https://github.com/LizardByte/Sunshine) or Gamestream, but I must say that setting up Sunshine on my Windows PC's was one of the easiest, "set and forget" and "completely negligible impact on performance" things I've set up.  The only thing weird about it is it goes through a web browser for the interface.  Don't let that throw you.  It works fine, but if you're a person like me who keeps 8 billion tabs in 3 million windows open in my browser, it can become odd to wait for your browser to open up.



Alright...  Here's the verbose steps...
  1. Grab an SD card or USB card...  I will assume you have some familiarity with Raspberry Pi Imager and that you have a 4GB or bigger SD card or USB card.  
    1. I highly recommend testing said card with h2testw or similar.  The official site for h2testw is https://www.heise.de/.  As of this writing, the h2testw download page is https://www.heise.de/download/product/h2testw-50539.  Please note that h2testw is wonderful for testing and seeing real world speed with the simple idea of writing over your whole card and then reading it back for errors.  HOWEVER, I have found that it _won't_ detect when super cheap chinese knockoff cards have issues with holding the 10k and 100k and more files you might like to have on an emulation system.  This is because it only stores 10-100 or so files on a typical USB drive or card.
    2. If you plan to boot from USB, 2 lessons learned... 
      1. There's thorough but somewhat confusing documentation here:  https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#usb-boot-modes
      2. This Instructable cuts directly to what you actually need to do:  https://www.instructables.com/Booting-Raspberry-Pi-3-B-With-a-USB-Drive/
      3. Often, you need to use a powered USB hub to put enough power to some USB drives.  I've needed a powered USB hub to be consistent with a 128GB drive that had a huge old LED on it, and also a 256GB SSD in a USB enclosure.  Other USB zip drives work fine.  YMMV.

  2. In Raspberry Pi Imager, choose your Pi 3 from the list, and then choose the older Bullseye Lite 32bit.  Other lite versions can work, but the good ol 32bit is all we want and need here.

  3. Then, pick your storage, and when it asks you to do the customizations, I highly recommend doing that.  Yes, you can use Raspi-Config to do it yourself or to change anything.  But it's tedious setting your localizations that way, so please do that here.   (One thing to consider... If you plan on using only wired... consider NOT putting in your wireless even though you can.  No point in confusing the damn thing.)

    (Choose "Edit Settings" and then "Yes". )
    (If you want SSH enabled by default, make sure to do that under services)



  4. Ok, now you should have a bootable plain jane install...  One that you can either plug an mouse and keyboard in directly to in order to configure.  Or one that you can SSH / Terminal into use the settings you put in on the OS customization step.  Run the machine for the first time.

  5. Optional: If you're using SSH, figure out your IP address or use raspberry.local and get a terminal.  Example, since I'm using my MacBook to write and take screenshots, I went to my wireless router's device list, and found the raspberrypi and the IP, and then at the command line of terminal, you just type "ssh 192.168.1.xxx", accept the fingerprint, mess up the password, get the password right finally, and you're in!  Please note the note below... don't use the default password!


  6. Now, we install Moonlight.  Unless you're really into code and compiling, just do the "package" version of the instructions: https://github.com/moonlight-stream/moonlight-embedded/wiki/Packages

    NOTE: please use what they say on the proper github... but, for documentation sake, you can see them in the screenshot here...  First step is the curl instruction that does all the prelim setup.

    Then the next step... actually install moonlight-embedded... make sure you answer "y" for yes, and then be patient for a while...

    Now, twiddle your thumbs even more as you get everything updated...  Again, another "y" for you here...

  7. Ok, so you've rebooted, and now it wants you to login.  Yuck.  We want this thing to autoboot.  So, 
    1. log in (or SSH in), and then type "sudo raspi-config".
    2. Select "System Options".
    3. Choose "Boot / Auto Login".
    4. Choose "Console Autologin".
  8. Next, we are going to tell it to wait for the network connection on boot.  This is important, I think, because with an autoboot of moonlight, you want the network connection going before it actually tries to launch and connect.
    1. Select "System Options" again.
    2. Choose "Network at Boot".  And tell it YES, you want to wait.
  9. Next Raspi-Config option... we need to dedicate lots more GPU Memory, so,
    1. Select "Performance Options" this time.
    2. Go to "GPU Memory".
    3. Type in 256.
  10. Good optional Raspi-Config option... if you'd like... Go to the optional and "Expand Filesystem".  That's a standard RetroPi thing, and not necessarily necessary on this build.  But, you might as well...
  11. Other Raspi-Config options are really cool.  And if you didn't localize your keyboard and such with the Pi Imager, do that now to prevent headaches.  But, I won't be covering them here as we don't need to deal with them.  One thing that is kinda cool is that Moonlight does work and look great on a CRT if you want to use the composite output.  It's not perfect, but it's a pretty quick and dirty way to output a modern Windows PC to a classic CRT Retro Television.  Just make sure to tweak your Moonlight settings.

  12. Go ahead and exit RASPI-CONFIG and reboot.

  13. Now, you'll need to fix your graphics.  
    1. There is a separate section on here about needing to update via rpi-update first.  I didn't have this issue.  I did it once on one Pi and I didn't like what it did, but I forget why.  The trick to the fix if you don't run it and break your system....is that every PC/OS flavor and text editor can read and edit the config.txt file on your card if you didn't do the rpi-update and need to.  (OR, you can start all over again and just repeat these steps in this guide again...)
    2. So, either way, you need to change the graphics driver in config.txt.  If you've never used nano before, here's what you do.
    3. Enter "sudo nano /boot/config.txt"
    4. Use your arrow keys to navigate to the right section, and add an "f" to the dtoverlay string.  (This is the part you'd revert back to by removing the "f" if you, for some reason, needed to do the rpi-update step.)

    5. Then press "Control x" to exit.  Press "y" to save.  And press "ENTER" to confirm the file name.
    6. And, give it the old "sudo reboot".

  14. Now we configure MOONLIGHT EMBEDDED!
    1. Use the commands here to get yourself going: https://github.com/moonlight-stream/moonlight-embedded/wiki/Usage
    2. If you've used the graphical interface of Moonlight before, these commands roughly correlate to the UI you're used to.
    3. First we start by Pairing to the target PC.  
      1. REMINDER: This guide is intended to set you up with a single, auto-booting install to one PC.  Turn on Pi, Pi Boots, you see your remote computer.  ... You may not want that... If so, you can stop here and just always do command lines from now on.
      2. Type "Moonlight Pair", and if you're only running one Sunshine computer on your network, it should find it on the network, and give you a PIN to enter on that Sunshine computer.  Enter it, and Moonlight is happy at the command line.
        (If you forgot, the default password for sunshine is sunshine...)

  15. So now, you can try your first shot at streaming. 
    1. Default is the Steam application.  But, that's not what I like, I like the default Desktop, as you can then just use all of windows and then just launch Steam from the desktop like normal.
    2. Type in the following command line: moonlight stream -1080 -app "Desktop".
      1. Note, on the graphical interface, I often like to double the bitrate that's suggested.  You can do that here with "-bitrate <bitrate> Specify the bitrate in Kbps".  But... I forget here what that standard is because it wants it in Kbps and not Mbps and I'm just too lazy writing this right now to play with that.  It's not really important what I do as you can always play with the command lines until you get it right for yourself and your situation.
    3. And, if you did everything right, you should be off to the races and live and streaming your Sunshine hosted system as if you were right there at the PC (or whatever you put in for the -app parameter.
    4. Remember, Shift-Ctrl-Option-Q is how you quit out of Moonlight to get back to the command line.   If you're using a remote terminal, you don't need to worry as "sudo reboot" also lets you reboot.  Hey, for fun, you can Moonlight to your computer running the remote terminal and run terminal virtually which is super cool of course!

  16. Now, it's the part that I always need to look up and mess up...  Autobooting.  The reason I always mess this up is that there are MULTIPLE methods of automating start-up tasks.  (Example: Great encyclopedic articles like this (read, but don't try to use because it's not a code/example type article): https://www.dexterindustries.com/howto/run-a-program-on-your-raspberry-pi-at-startup/)  A few are deprecated but people love them anyway.  And a few are XWindows specific and don't apply here (I'm looking at you, autostart).  
    1. My best success is SYSTEMD.  #4 on the cool article I've crossed out above.  SYSTEMD, from what I've read, is the current modern and standard default way to launch things.   The problem is it's amazingly powerful and configurable to the point of not being easy obvious.  And, it also suffers from having a folder location change for the settings from version to version.  Joy.
    2. So, here's the straightforward steps I took to make it work.  (Many thanks to this page for having a very simple/clear "hello world" example that I modified just slightly.  https://www.makeuseof.com/what-is-systemd-launch-programs-raspberry-pi/)
    3. First, we create a service for moonlight launching: 
      sudo nano /lib/systemd/system/moonlight.service

    4. Then, we enter the following as the contents
      [Unit]
      Description=StartMoonlight
      After=network.target

      [Service]
      ExecStart=moonlight stream -1080 -app "Desktop"
      #Restart=always
      User=pi

      [Install]
      WantedBy=multi-user.target

      (Note, the Restart=always is just needed if you want to auto-restart due to some kind of failure.  The # in front means it is disabled/commented out.)

    5. Now, Control X, Yes, and Enter to save.
    6. Test it at the command line if you like with: 
      sudo systemctl start moonlight.service

    7. Remember, you can quit Moonlight with Shift-Ctrl-Alt-Q.
    8. Now, we need to enable the service to run on every reboot with: 
      sudo systemctl enable moonlight.service

    9. And now, do a sudo reboot.  And with any luck, you're done!
Hopefully, this all worked!  I'm NOT A LINUX EXPERT AND LEARNED ALL THIS BY THE HELP FILES OF THE REFERENCED AUTHORS AND A THOUSAND MESSAGE BOARDS.   THANK YOU.   If anything here is wrong, or needs edited, please let me know.  Thanks!

Monday, October 10, 2022

Triple boot iMac with Snow Leopard, El Capitan, and Batocera... Notes, Tips, Tricks, and Hints

Well, well, well.   I think I got it?  Use my notes at your own risk.  BACK UP BEFORE PARITIONING AND ERASE HD DATA!

Here's the basics for creating a triple boot Batocera on Intel Mac...  probably most iMacs, Macs, MacMini's, MacBooks, etc.

1. Find a wired keyboard.  If a windows one, remember "Windows" = "Apple/Command".
2. Create/validate 4 partitions... 
- A Rosetta capable MacOSX like Snow Leopard. 
- The lastest MacOS that runs on your hardware (it was El Capitan for me).
- A MSDOS-Fat32 partition of about 5-10 GB that is named "BATOCERA"
- A ExFAT partition named "Userdata".

3. Download Batocera for Intel Macs here https://batocera.org/download.
- Expand and open the .img.
- Copy everything from that image to your BATOCERA parition.
- (BalenEtcher is not required.)

4. Install rEFInd (you might need to use your Recovery Partition or a USB boot disc to get to Terminal to install if SIP is enabled.)  https://www.rodsbooks.com/refind/

5. Verify in Files that it found the Userdata partition, and then use the EmulationStation Developer menu item to run "Format" on the "Internal" drive to EXT4 format.  Reboot.

6. Add roms and have fun!

That's it.  The wordy section with tips and pitfalls follows.  Thanks


----------------wordy section------------------


I saved an iMac with 3GB of memory and a 320 GB drive and a dual core Intel processor from the dump.  A friend got it for $10 and couldn't figure out how to fix and flip.  I got into it, made a boot USB for the OS's I wanted, and got it all repaired and fixed.  (The max Rosetta/MacOS9 compatible OS is Snow Leopard, so that's one 120 GB partition, The max OS for this OS is El Capitan, so that's next at another 120 GB, then I have a 10 GB FAT partition for Batocera, and then finally 70 left for the Userdata partition.

I didn't find a lot of information on how to set up Batocera on a dual boot Mac from google, and so I thought I'd document what worked.  (Note: Some message boards forward you to this page... https://wiki.batocera.org/dual_boot_ubuntu_batocera.linux  But, that doesn't have ANY information for MacOS and is written like this dual boot stuff is all horribly impossible and ill advised.  But, with what I did below, well...  it ended up working just fine.)

As with a lot of these dumps, this is not going to be highly formatted or pretty.  I just wanted to get it all down before I went on to the next thing.

1. Windows keyboards on Mac...  The windows key is the command/"four circles weird icon"/Apple key.  Also, a wireless Logitech doesn't always work for the Command-R (to start in recovery mode) or the very important Alt (to start in boot picker) methods of holding those as the computer restarts.  So, having a wired keyboard during this is important.  (Once you are booted to the mode you want, everything is fine...)

2. Getting the partitions right.  Ugh.  (You'll probably want to put windows on your machine.  I just didn't do that.   But shouldn't have any issue. But, it's a really old mac and I have lots of windows machines.)  So, I was focused on having a solid Rosetta machine again to run old stuff.  I always regretted updating past that.  Regardless, you can do as many partitions as you want.  Except for that the partition manager is really weird and wonky on the Mac DiskUtility.  

What I finally figured out through all of this was that the way to "fix" issues where the partitions won't get set, is to just take the last MacOSJournaled partition and have it reoccupy all the remaining open space by deleting all the partitions that aren't just working right.  

Once you've done that... it's actually simple.  

2. a. Just select the last MacOSJournaled partition that is too big and has free-space, and hit "+" and then "+" again.  Then resize those as you want.  And on the 2 new partitions... I HAD to partition them as MacOSJournaled FIRST.  Every time I tried to go straight to the formats I wanted... then it failed.

2. b. But if you get the partitions right with MacOSJournaled _THEN_ it's time to change them and rename them.  So, call the first tiny one BATOCERA and formatted it as FAT.  (I made it 10GB to prevent against future expansions).  

2. c. And then I called the bigger one "Userdata" and formatted it as EXFAT (for now... we'll fix that to EXT4 cause FuturePinball - https://wiki.batocera.org/systems:fpinball says it prefers that, even though I assume this computer is too slow for that.)

So, now, you should have all your "legit" partitions for MacOS versions and Windows and Linux versions... and then for me... 

To summarize step 2... I made my last 2 partitions... "BATOCERA" (MS-DOS FAT) and "Userdata" (ExFAT)...  Which is how ye old USB partitions look when you make a USB drive.

(NOTE: This method _really_ scared me and confused me.  I thought I could just install this on BATOCERA as a BIG ASS FAT32 DRIVE cause that's what mounted on the USB stick I'd made at first... But one big FAT32 drive had no space when I did ROM transfer... but that's because of how "Userdata" works... it's a separate partition with lots of space that is leveraged by the BATOCERA Linux boot.

I found one thread that clued me into this all here: https://wiki.batocera.org/batocera.linux_architecture  And it very clearly explains that you need 2 partitions!  I should have had that _duh_ moment, but I didn't because I'd read that horrible link I crossed through up at the start.  I thought somehow that "Userdata" was materialized by magic by the first launch.  I thought it would maybe create a rogue Userdata that took over my good partitions.  I was scared.

I spend at lot of time switching between "External" and "Internal" and the various drives that EmulationStation offered.... But, what _I_ wanted was MacOS installed on my harddrive.  No USB or external or network stuff.  Just _there_ whenever I wanted to boot in.  So, 2 partitions is the trick.  (Spoiler, first boot with "Userdata" as a partition existing... IT FOUND IT AUTOMATICALLY when "internal", the default, is set in Emulation Station.))

Where was I.  Ok, so, I have my partitions.

3. Next step, go to https://batocera.org/download and get the MacOS Intel version.

3. a. (NOTE: Do they want you to use BalenEtcher to install and all that in the documentation???  yeah, they do.  But do you need to???  Not really.   Not really at all.  Why???  BECAUSE... Emulation Station has a very scary formatting utility built in.  Ack!  So, you don't actually need to do anything but dump the Image's BATOCERA data into the BATOCERA partition.  That's it.)

3. b.  Just open the .img, and you'll get _only_ BATOCERA... Just copy all the files (batocera-boot.conf, and the folders boot, EFI, and tools) over to your partition... also named BATOCERA.

3. c. But but but... they said to use BalenEtcher.  I know.  But, you don't need to.

4. At this point, you will probably have gotten here because you're struggle and have had to hold "ALT" about a million times to play with things.  Here's part of what makes all this weird... most of the guides and message board posts whine about not being able to have a graceful autoboot menu by default.  That's because they haven't messed with rEFInd.  (https://wiki.batocera.org/dual_boot_ubuntu_batocera.linux, the x'd out link above, does mention rEFInd, but it's under an "iOS" section and makes it sound like you'd better hope and pray it finds your partition.  Poppycock.  Not sure who wrote that, but it clued me into reading about the utility, and it's great.)

4. a. rEFInd... Set up the boot menu with an amazing boot utility that replaces the "hold ALT during reboot" with a cool booting utility by Roderick W. Smith.  https://www.rodsbooks.com/refind/  Go ahead and get that.  The documentation is wonderfully verbose and accurate.  I had to use the SIP workaround in bash at the terminal after booting from an install USB because my recovery partition wouldn't boot (likely because this dang computer had a hell of a hard life and had something go corrupt on the original owner in the boot sequence - They messed up something somehow... anyway...).  If you can be methodical and follow directions, it is doable.  I highly recommend it so you can have your Mac boot the way you want.

5. So, now it's time to boot up BATOCERA with rEFInd.  Once you're in, it's too loud (hope you're keyboard has volume controls on it), and then it's too loud again.  You'll wake up the wife.  

5. a.  It will take a long time your first time, as I assume it's going ahead and creating the default files and folders on Userdata.  (You will be destroying them in a second.)

5. b. Once you have the interface, hit the F1 key and go to the file browser.  Make sure that when you go to Roms or Bios or Userdata, that the free size on all of them is what you made that partition.  (In my case, it was the 70 GiB partition.)

5. c. For sure for sure make sure that's right.  Cause, the next step is for you to delete it and put EXT4 on it!  So, the way you do this is to quit Files, and then hit space bar, and then go into the Menu.  As documented by the amazing link here: https://wiki.batocera.org/batocera.linux_architecture , you can then follow it's advice to go to Menu -> System Settings -> Frontend Developer -> Format. 

5. d. Ugh... Formatting is scary.  Scary scary.  But, remember... You made your partitions.  You defaulted to "Internal" as the location.  And, most importantly, you did step 5. b. and verified that the "Internal" partition it found was indeed Userdata because the size of the drive matched the size of your partition.

5. e. You are making regular backups of your main system, right?  And you did before you started partitioning everything, right?  Right?

5. f. So, go ahead and format it to EXT4.  And ta-da, it happens so fast, you barely realize it.

5. g. This is where I point out that it seems like _ANY_ EXT4 capable partitioning software will work.  But, most guides need all sorts of Ubuntu USB or MacFUSE installs or what have you...  And this built in functionality works great after you get over being scared.

6. So, that's pretty much it.  Reboot into batocera, and see that, now, tada, you now have an EXT4 userdata drive.  The MacOS won't love it (unless maybe if you use MacFUSE), but who cares.  Moving ROMS is super simple using the myriad of guides for either using \\BATOCERA or using FTP or using SMB or what have you.  The only downside of course is that you'll need an extra computer or laptop to interface...  This is where an Ubuntu boot USB or MacFUSE might help... and also... I haven't tried mapping the other drives as I'm not a linux-y kind of guy.  If that is you, it might work.

6. a. Note: YOU GOTTA TELL EMULATIONSTATION TO HOOK UP TO YOUR WIFI NETWORK MANUALLY THROUGH THE MENU all the time.... Ugh...


Anyway, I hope that long ass wordy guide helped someone struggling/scared with making a dual boot Mac that runs Batocera.


Good Luck!

Saturday, August 6, 2022

Notes on Rebuilding Title.db on my 3DS after 3hs hshop loss of battery and out of space on SD Card using save3ds and rebuild-title-database

Huge thank yous to all the 3DS homebrew developers including ihaveamac, wwylele, Ryuzaki_MrL, all the MacOS rust and brew and python devs, and to ZeroSkill for publishing their code and doing all the real work.  Hopefully this guide can help someone use their amazing tools to recover their 3DS titles after an SD card corruption.

So, I found out there is the amazing hshop homebrew https://hshop.erista.me/3hs for 3DS installation of games on a luma / godmode9 hacked 3DS via https://3ds.hacks.guide

I went nuts on it like a kid in a candy shop, and twice, corrupted my 3DS's title.db!

The symptoms of a corrupted title.db is that everything but DSiware titles and native 3DS utilities disappear from your 3DS!  Ack!  Panic!  All my icons are gone!  SD card is fine...  hmmm...  everything still in all the folders.  Did Nintendo find out I've been naughty and zap me?  I was in a panic.

But, I hopped on the 3hs discord support forum, and ZeroSkill quickly pointed me in the right direction.

Documenting this here for future folks as the reality of a title.db recovery is that it's pretty convoluted and extensive.  So I'm putting the notes I remember here.  This won't be definitive as a guide.  I'm writing it wordy and horrible as my brain remembers.  So, my apologies for lack of editing and clarity.

But hopefully it helps someone in need get there faster and with less pain.

Before you begin...

So, there are two main utilities you will need.  

https://github.com/ihaveamac/rebuild-title-database

https://github.com/wwylele/save3ds

These utilities 100% worked for me, but they are _not_ set up as easy to use applications yet.  You will need Linux or MacOSX to use Save3ds.  Yes.  I put that in the worst font possible.  I tried to find some geocities flash code even, but alas...  Don't get halfway through this on a windows machine, only to realize you're screwed halfway through.  You need to be comfortable with command lines, or willing to learn.  And you might need to find a way to run Linux if you don't have a Mac available.

Again, Save3ds requires Linux or MacOSX.  And it requires use of command lines.  If you don't have those available... well...

As for me, I started on Windows just doing the first part of rebuild-title-database, only to get to save3ds, and be lucky that I am in a house with Windows, Mac, and Linux machines.

So, not only will you need those 2, but you'll need to be able to compile and run them... which takes a ton of stuff too, like Python and compiling things like rust on Mac's Terminal.  I'm in that zone of knowing enough to figure it out, but being scared and confused the whole way.

BUT I DID IT!  lol

So, first... I was on Windows 7 and I got rebuild-title-database to work finally.  Then, I switched to my MacBook to finish with Save3ds.  (If you are using Linux, hopefully you are smarter than me and will laugh mockingly at my commandline skills.)

Steps (27)!

1. Before you start, you have to follow this guide:  https://ihaveamac.github.io/dump.html Turns out for me, the way to get it to work was to launch my 2DSXL without the SD card in it, and then after hitting save on the default luma screen, it opens straight into GodMode9 / GM9.  This was important because when your title.db on your SD card dies, you don't have the icon anymore to open God Mode, and the methods on the dump page weren't working for me.

NOTE: It was easiest for me in the command line, to mount the SD card on my pc and then drag the boot9.bin and moveable.sed files to the same folder where I unzipped rebuild-title-database.  You can leave them on the SD card in the out folder and reference them there.  But, it's a lot of typing.

2. Then, you go back, and you realize, for me at least, that Python wasn't installed.  So, I had to install Python.  

Quick note, if you're on Windows 7 like I am on my game/mame/virtual pin pc... you need to scroll down through lots of versions of Python before you find one that is compatible with Windows 7.  Took me a bit to figure that out.

Another quick note, when you install python, you have to check "add Python to your path".  If you don't, then the command line doesn't work.  I had to uninstall and reinstall to recheck the box.

3. Once python is installed, you go to your terminal, and you change the location you're at to the location you unzipped your download of rebuild-title-database.  For me, I had unzipped to me F: drive.  Turns out, in the examples, they use "F:" to be the location of SD card...  That confused me.  Ope!

<py3-cmd> rebuild-title-database.py -b boot9.bin -m movable.sed -s F: -o out

This is what is on the readme page.  So, mine actually ended up looking like this...

python rebuild-title-database.py -b boot9.bin -m movable.sed -s M: -o out

This is because 1. I moved boot9.bin and movable.sed to the folder that contains rebuild-title-database.py.  And, because I changed from c:\whatever\ to the folder I actually unzipped, which was f:.   So, on the terminal, it looked like 

F:\> python rebuild-title-database.py -b boot9.bin -m movable.sed -s M: -0 out

I'm pretty sure, if M: is your SD card, and you didn't move boot9.bin, you could have put M:\gm9\out\boot9.bin in that line...

F:\> python rebuild-title-database.py -b M:\gm9\out\boot9.bin -m M:\gm9\out\movable.sed -s M: -0 out

NOTE: At some point, I believe I also needed to get seeddb.bin and put it in the same folder as the rest of rebuild-title-database.  You can find that here:  https://github.com/ihaveamac/3DS-rom-tools/wiki/SeedDB-list

4. Ok, so, when you run rebuild-title-database after a corruption like mine, what happens, is it starts parsing out the files in your ID0/ID1 folder structure...

5. And it saves those file ID's out to the "out" folder... Which, in my example, was F:\out\.  Because we only defined the word "out" in that statement.  (I assume, again, you could change the word "out" in the statement, to _any_ windows path.

6. BUT, when I'd run this, it would Fail.  Over and over.  I couldn't figure out why.  But, finally, I figured it out.  The failure occurs at the file when hshop died.  The first time, hshop failed because the battery died mid download.  The second time, hshop failed because I ran out of space on the SD card.  The trick is to read the first 8 and the last 8 digits of the file ID near the end of the error code, and then go find those folders, and delete the final folder from the SD card.

The ID will look like 0004000e001d1300 in the error message.

The path on your SD card will look like this...  

\Nintendo 3DS\dbxxxxxxID0xxxxxxxxx14\f6axxxxxxxxID1xxxxxxxx44d\title\0004000e\001d1300\

You will want to delete this Folder: \001d1300\

7. Once you delete the offending folder, you will lose the partially downloaded/corrupt game.  But, it will free everything else back up for when you rerun rebuild-title-database again.

8. When you are successfully, you will now have a folder called "out" with a ton of files that look like "0004000e001d1300".  This is all the installed titles on your 3DS's SD card, minus the one you just deleted.

IMPORTANT:  Copy this "out" folder to your SD Card!  Because you need the folder on your Mac or Unix system for the next step...  I renamed the folder to "titleexport" for myself to keep track of it because "out" is used a lot by other apps on the 3DS card.  

9. So, NOW, with your titles exported by rebuild-title-database, you'll need to use https://github.com/wwylele/save3ds to rebuild and reseed the title.db.  (I also did this to import.db also, see later.)

10. So, Save3Ds isn't hard to use, but it's a pain to install if you're not a programmer.  I did _not_ write down everything I went through when I installed this, but needless to say, you have to go through a bunch of help files to get everything set up.

11. Installing Rust is required.  Good luck.  I forget everything I did to get it going, but somehow I did.  https://www.rust-lang.org/tools/install looks right, but I think I actually had to use this...  https://ports.macports.org/port/cargo/  with the help file from here... https://doc.rust-lang.org/cargo/getting-started/installation.html

12. Then, the command for mac is to "brew" a "cask".  It seems that "cask" is used differently now, and "brew" is something you have to install yourself..

brew cask install osxfuse && brew install pkg-config

13. So, you can get Brew through here...  https://brew.sh/

14. But, then, it didn't run, and so I think I had to change where "cask" was, and possibly had to do the 2 installs separately.  Again, I was in pure "get this done" mode, and wasn't thinking about documenting.  My browser history has this link, so I assume I was able to get brew working with one of the commands here...  OR, I found the install location and ran it from that.  https://apple.stackexchange.com/questions/148901/why-does-my-brew-installation-not-work

15. Anyway, somehow, I got it installed!  Yay!

16. And then, I tried to run the line...  And oh my, if you're not used to command lines for apps that do a million things, hold on to your seat!  https://github.com/wwylele/save3ds has really good documentation, but it's still super confusing on a Mac to make work because of MacOSX's quirks and because, as a super useful tool, save3ds has a ton of options for a multitude of uses beyond just this task.

17.  First tip, my SD card was called by my Mac - NO NAME.  That space in "NO NAME" really messed me up.  So, I had to title my SD Card.  I used the wonderful fix of ... "NONAME".

18. Next, much like needing to be in the proper folder where the .py file is when running the python script, you need to spend time figuring out where to point things and locate things on the Mac.  One trick... If you find a folder you like, and you don't know the path, you can drag the folder into terminal, and it writes the path for you.  That REALLY helps when you are a newb.

19. Cut to the chase, here's the lines that worked for me on the terminal...  And, I'll explain what they are in subsequent steps...

/Users/mbpuser/save3ds-master/target/debug/save3ds_fuse --db sdtitle /Users/mbpuser/save3ds-master/target/titleexport --sd /Volumes/NONAME --movable /Volumes/NONAME/gm9/out/movable.sed --boot9 /Volumes/NONAME/gm9/out/boot9.bin --import


Users/mbpuser/save3ds-master/target/debug/save3ds_fuse --db sdimport /Users/mbpuser/save3ds-master/target/titleexport --sd /Volumes/NONAME --movable /Volumes/NONAME/gm9/out/movable.sed --boot9 /Volumes/NONAME/gm9/out/boot9.bin --import


/Users/mbpuser/save3ds-master/target/titleexport  

(All Titles exported by the python script into the "out" folder by rebuild-title-database on the Windows machine need to go here.  Other names would _certainly_ work, including "out".)


20.  So, the first thing is that save3ds worked best for me with everything simply held in the default locations of the save3ds install.  Part of my struggle was the "NO NAME" vs. "NONAME" problem.  So, I probably could have left files on the SD card but as I was fixing errors, placing the files in the same folder as the install got me past those issues.

Here's what each part of my command line statements means...
/Users/mbpuser/save3ds-master/target/debug/save3ds_fuse    <-This is where my install of save3ds was located.
--db sdtitle  <- This tells save3ds that it is a database action and that it's rebuilding sdtitle ON YOUR SD CARD
/Users/mbpuser/save3ds-master/target/titleexport    <- This is the folder where all of the rebuild-title-database files in the "out" folder were stored by me.  You should set it to the folder where your output is.  I assume it could be on the SD card in a folder named "out" for most people.
--sd /Volumes/NONAME   <- This is the path to the root of my SD card.  
--movable /Volumes/NONAME/gm9/out/movable.sed   <- This is the path on my SD card to the movable.sed file that GodMode9 exported back in step 1.
--boot9 /Volumes/NONAME/gm9/out/boot9.bin  <- This is the path on my SD card to the boot9.bin file that GodMode9 exported back in step 1.
--import   <- This tells save3ds that you are wanting to import the file to the proper place on your SD card.

On the second statement, the only thing different is "sdimport" instead of "sdtitle".  These are how the save3ds readme defines these:
  • sdtitle refers to the file SDMC:/Nintendo 3DS/<ID0>/<ID1>/dbs/title.db
  • sdimport refers to the file SDMC:/Nintendo 3DS/<ID0>/<ID1>/dbs/import.db
I honestly don't know if I needed to do import.db.  But, since it was in the same folder as title.db, I did it anyway.

21.   So, if you run the utility, and everything goes right, all that work just results in a title.db and import.db of almost the same size with a new date and time stamp.

22.  Excitedly, you run, put your SD card into the slot, and...  NOTHING.  Nothing happens like a fix.  You boot the 3DS, and it looks like it all failed and nothing new has happened.

23.  Cry, a little, panic.  Restart a couple times, put the card in and out.  IDK  what I did, but both times, after a few cycles of this, all the sudden... poof!  Hundreds of new install gift boxes appear.  Yay!

24.  *sigh*  So, you do lose all your nice folders and structure for everything.  But, at least all your apps are back.  

Note: You also lose all your badge placements in apps.  (Folder badges seem to stay in place.)  But, this definitely messes up using GYTB because it can't find anything and errors out.

25.  But first, unwrapping all those is a pain in the ass.  Fortunately, you can use chthulu to unwrap them all.  https://gbatemp.net/threads/release-cthulhu-app-for-managing-play-time-step-history-and-cached-icon-data.439485/  It's available in Universal Updater.

26. Since your badges get messed up, you have to rebuild them.  So, you can redo your badges by going into data management, deleting the badge arcade's extra data, and then restoring it in the badge arcade as guided by the app.  https://www.reddit.com/r/3DS/comments/3te5at/nintendo_badge_arcade_error/ is one example of a thread on this.

27.  So, that's pretty much it.  Again, my thanks to the entire community of folks who make these tools. I'm always in awe of the generosity of those who make their code opensource and release for people like me to use.  Thank you thank you thank you.

Tuesday, December 22, 2020

PinGun Parts list and prices

Current Total Costs and Estimates -

Since Starting Project in Late September or early October 2020
- $400 

Additional Cost, if I had to obtain them again at going prices of parts I have laying around - probably $500 more...  - But those are all things collected and paid for over the last 30 years.  Literally all kinds of spares and tear downs and mistake buys plus my normal console systems I was already playing.

Remaining estimate left to spend?  $100 for cabinet and tmolding and art, $50-80 for proper spinner, $20 for caps, $60-$120 for NES Everdrive.  Glass for cabinet, maybe $50?  So, probably about $300 left to spend.  (Slight chance I can't repair TV properly, and will need to actually buy one.  Probably $80 on marketplace.)

Stuff I plan to sell that's extras - Probably can make $200 on PSOne and Guns.  Probably can make $100 on the 2nd PS2 if I sell it hacked.  Probably can make $150 selling my NES Zapper cartridges.  Probably can make $80 selling my Dreamcast physical games.

Final Estimate Cost - $170

    $700 out of pocket - $530 recouped selling redundant games/systems = $170.
            (I will update this post as I go with actuals...)

Build Plans

Cabinet plans

  • Goal: I love the Granny and the Gators black on Green style.
  • Nothing yet.  Have priced out neon green/galaxian tmolding though, and asked around about cabs.  Have no wood or hardware for it yet.  Or paint or art.  But, have one friend who volunteered to route for the t-molding, and a cousin of my wife's who volunteered to help me fab it.  Might put a green LCD strip I have somewhere tastefully in it.  Maybe a cutout of the art so that it glows behind it?

Monitor plans

  • Goal: 
    • CRT up Top - Gun capable and most emulators, and also for backglass on Virtual pins.
    • LCD on bottom, mounted vertical, for Virtual Pin and certain emulators.
  • Got a free Samsung 39" LCD off of FB Marketplace.  Has some sort of issue where the screen goes bad and the whole thing freezes.  Wiggle the whole thing a bit, and boom, it's back to perfect.  Seems to have an HDMI auto power on function.  Hoping I can decase and find just a loose edge connector or something.
  • Random Sony Trinitrons and CRT's...  Right now, sitting on an obscene number of "so close" machines.  I really would love a 24" curved CRT with component, composite, and Svideo... But, alas, the Insignia I got like that has _wicked_ extra overscan, AND, most importantly, always turns on to the TV channel.  A Phillips 27" I got is _perfect_... except it won't power on when power connected if left on.  And, 27" is just too big really.  The Trinitrons, though flat, have the wonderful "power on when plugged in if left powered on" feature, but the 3 I got must have caps going bad and one has a bad yoke position or magnetized degauss coil or something.  So far, they all look like crap.  2 are 27", but, I have hope for the 24" I got, that I can cap kit it fairly inexpensively and get it up and beautiful again.  So far, I only spent $20 on the 24" CRT, and that's cause the old lady who had it was a trip!
  • Manual Phillips switch - $5 off fb Marketplace - This badboy is mechanical and has 4 ports, all with SVideo and Composite, plus 3 of the 4 also have Component and Ethernet.  And they're set up in such a way so that, as long as you double up the Audio inputs, that you could do basically 4 Svideo/Composites and 3 components, all hooked up at the same time.  
    • An additional thought I've had is to chain a second physical switch in the reverse way going out of this one so that I can route a more traditionally mounted TV that people can sit in front of that I mount separately.  Not sure of that plan yet.

Control Panel Plans

  •  Goals.
    • Primary
      • Tron stick
      • Spinner
      • Trackball
      • Ikari rotary with 8way
    • Maybe
      • Robotron capability?
      • 4 way capability?
      • Racing pedals (and time crisis style pedal)
      • Plunger
      • Nudge
  • Inches to work with - Basic pinball width is 23" basically.  So, probably 21"
  • Stock on hand from previous projects that I never finished - got nearly all of this 15-18 years ago off ebay when the kids were less than 3 and I had no idea how much time I'd spend being a dad vs. setting up machines.
    • 1 Saitek flightstick, USB.  Very "tron" like joystick with a bunch of buttons.  Hoping to be able to use this as a Tron stick as is with no driver issues.  Just plug in and go.  Will need to hack around on it in order to make it fit where i want to.  The base is HUGE.  Or, I'm going to make it mountable/removable.  Or, I'll just steal the top and put on my own joystick?  I dunno yet.
    • 1 3" HAPP Trackball, really nice condition with mounting plate.  1 2 1/4" HAPP Trackball that needs new rollers to be 100%.  I'm probably going to go with the 3" because then I can basically make it like a golden Tee, and it still should work ok for Centipede. However, Centipede is my main trackball game, so I might just stick with the 2 1/4 for those reasons as well as space?
    • Horrible Arkanoid spinners - I bought like 10 "bad" ones in an auction years ago, assuming I'd be able to make at least one good one out of the bunch.  Have not been able to make that happen.  IDK what I'm going to do.  I REALLY want a spinner that lets me play Tempest great and can do pretty good on everything else.  I thought an Arkanoid spinner would do the trick, but even the best one I could cobble together from the parts has so much play in  it so that the inertia always causes a few extra clicks the wrong way.  And the higher resolution screws it all up.  Still not sure what I'm going to do here as Tempest spinners don't have the resolution needed.  Just want it to feel and play Tempest right, is that so wrong?
    • 1 HAPP Optical Rotary joystick for Ikari.  Has a black top, round, like a regular competition.  Needs a new microswitch.  
    • 2 HAPP competition 8 ways and a bunch of microswitch buttons. Honestly, I hate the clicky click.  However, they are paired, they work great, and I'm not really using them.
    • 1 sanwa style 4 way with a pink ball top.  I have this wired into an old USB flightstick I wired in the hatswitch to it.  It has this HUGE base and was great back in the day for me playing Amidar and pacman properly.  
    • 1 extra leaf switch ball top.  Two I think?  I think they were OEM Robotron pulls.  Probably need new grommets.  They feel sooo nice.  8 way.
    • I have a mini-pac from Ultimarc as well as a cheap chinese Playstation style USB encoder.  (It's possible I can use the PS style USB encoder to also make the 8 way joystick and flight stick and buttons dual compatible with the PS2?  I'm already working on the guncon2 drivers.
  • Guns
    • ACT LABS PC USB Light gun - SVideo Version.  "bug" style.  Owned it for 15+ years and never have had a setup going for it.  Have finally tested it with my new build and an ancient TView Micro VGA to SVideo conversion box that works great.  I've owned that for 20+ years.
    • Mad Catz Guncon2/GC1/Justifier compatible guns - I've bought 3 off of eBay this year.  One for $14.69 and 2 for $25.90.  All listed as untested or partially tested, all work well.  One kind of has a bad bottom button.  HOPING I can get Wingun or Topgun or one of the other rogue drivers to work with these.  I already tested, and these work just fine while plugged into both the PS1 and PS2's simultaneously (one PS1 connector and one USB connector on each.)  And, I plan to get them wired simultaneously for the TV Micro Video also.  Possibly with a USB hub switch on a physical 2 way switch.  Part of my plan is to _hopefully_ be able to have portions of my CP which map to both PS2 and to the PC.
    • Also considering a flightstick hack for Operation Wolf and Crossbow style mounted guns that used 5V's  maybe? Someday?

PC Plans

  • PC Case with Powersupply, AM3+ motherboard, 16 gigs of ram - $50 off facebook marketplace.
  • EVGA GeForce GTX750 ti - $40 off facebook marketplace (overclocked at +225 and +500 memory and +12 mV)
  • AMD Phenom II 460 - 4 core (overclocked to 3.8GHz)  (Accidentally bought this for $36 a year ago and couldn't use it on my other motherboard.  This motherboard could take it though.)
  • TView Micro VGA to SVideo converter. (Have had forever)
  • Mostly plan to use Future Pinball and Visual Pinball.  Plus supplemented with console pinball games through emulators.  Will probably end up buying FX3 and possibly Pinball Arcade titles off Steam if they do sales on cool looking titles and if I can get the backglass to work on FX3.  might also try to use a spare Kinect again for BAM, or get a cheapo webcam.

Console plans

  • 1 Playstation 1 (PS1) with a PSIO pre installed - $154 off eBay.  (Will offset price by Selling off my PSOne with Screen and carrying case and miscellanous PS1 guns including Pointblank 1, 2, 3 and the Time Crisis games including 2 GunCons.)
  • 1 Playstation 2 (PS2) - $40 plus extras on fb marketplace (actually got a second for $50 too - Lot of games and memory cards with both.)
    • with FreeMCBoot on IDE Network Adapter and IDE harddrive (from friend, and from my old backup drives)
    • On Second one, had also set it up with a $5 fb marketplace router and another old USB backup drive I had laying around.  Not sure which one I will use, but will probably sell off the other or donate to a friend.
  • 2 Energizer Multi system cables with full component, composite, and SVideo for PS, PS2, Wii, and xBox360 -  $9.97 and $5.19 on eBay.
    • One for SVideo out on PS1, One for Component out on PS2. Assuming I should be able to use as piggy backs for the composite hookup for the guns.
  • 1 Wii - Hacked with standard tools.  Will need to add an external harddrive.  Have had these for years, got them all cheap (Under $50) at various times.
  • 1 NES with Zapper (Owned since college, will sell off all of my Gun Game cartridges, all US gun games, including Chiller and Baby Boomer to eventually offset cost of buying an Everdrive so I don't have to change cartridges.  I will come out ahead and make $ here, so I might get an authentic Everdrive.)
  • 1 Dreamcast with 1 GDEMU and 1 VGA Adapter that has an SVideo out too.  Have had dreamcast and adapter for years.  Guns seem to be acting up and need cap kits probably.  GDEMU was $35 off of Ali Express.  Did the 12V removal mod, and had the MicroSD card (I think I used a 64GB) laying around.

Thursday, December 17, 2020

The next big thing - My Virtual Pin/Gun Game

 



And so it begins (or well, it did back in late September/Early October 2020).  I'm still working on my Scramble, getting the monitor right, finishing off the multigame switch.  But, a huge case of Covid blues hit me this summer, and I lost a lot of ground.

Enter the next fighter for my attention...  A combo virtual pinball and light gun game, roughly configured like Granny and the Gators or Baby Pacman or even in a way the Pinball 2000 games.  I say this explicitly because I need a CRT for the guns.

While most Virtual Pins seem to be using backglasses today, I am space confined.  And, I have always had a CRT for gun games mounted up to my 6'2" frame at a height like a real arcade game because standing is really the only way to play gun games, IMHO.  Same with Pinball.  So, after looking at the local retro gamer's group where one guy converted an unrecoverable Baby Pacman cabinet to a dual virtual pacman virtual pinball setup, and another guy built himself a multi-console gun cabinet... I looked over at my PS1, my Dreamcast, my NES, and my sad sad SVideo model Act Labs USB PC Gun that I bought and never hooked up properly... and I thought... TODAY IS THE DAY.  Then I went nuts, and started measuring and sketching and scheming.  That was a few months ago, and I decided I needed to document it as I'm getting closer to scrounging up all the pieces, before I make the cabinet.

Maybe I'll call it FUZzy and the Flippers, or Captain Goatee and His Gunners.  IDK yet.  I ended up calling the mini pacman build (that I failed to document here) "FUZ's Fourway".

I want to also populate it with my oddball controls, with a Control Panel layout just like Baby Pacman.  I have a 3 inch HAPP trackball, an arkanoid spinner, a trigger finger USB flight stick, and a HAPP optical Rotary Joystick that are all sitting around and wishing they could be on a system.  Since I'm space constrained, I'm planning to shove them all on the CP of this thing.

Of note... one dimension is wrong up there.  The width of a standard lockbar in pinball is approx 22.25", not 13+13=26, as I have diagrammed.  I'm not quite sure what I'm going to do.  I am so used to that exact width, but I also want to cram in everything.  So, we shall see.  I'm considering making the CP modular, so that I can swap in what I want.  Especially since I'd also like to be able to sometime attach a console steering wheel and play racing games too.

Next thread will be my list of purchases and costs, and I'm a Cheap Daddy and one of my goals is to see just how cheap I can make this for, and still have it be exactly what I want/need/expected.  And then, I'll fill in the gaps of tracking down each component.

Notes from Setting Up PS2 HDD FHDM on Fat PlayStation 2 for FMCB

 Ugh, well, there were a million wrong turns here.  Trying to recall and document what I finally actually did to the best of my ability. Yea...