mrehkopf / sd2snes

SD card based multi-purpose cartridge for the SNES
http://sd2snes.de
GNU General Public License v2.0
590 stars 115 forks source link

Favorite games list #134

Closed freelancer42 closed 4 years ago

freelancer42 commented 4 years ago

Adds a Favorite games list with room for up to 10 games, implemented in a similar way to the Recent games list. Adds a context menu in the file browser (accessed with the Y button), where the currently selected game can be added to favorites. Favorites list is accessed with the SELECT button or via the main menu. Adds new menu option type FUNC_CLOSE, which acts like FUNC but also closes the current menu after RTL. Extends the menu_select routine to support multiple buttons to select an item, to support context menu inside list menu.

freelancer42 commented 4 years ago

I got my SD2SNES Pro last week and noticed there wasn't any support for adding games to a favorites list, so I figured I'd add that. Working fine on my Mk3, not tested on any other hardware. I'm pretty sure I haven't used any already occupied memory locations, but might be worth taking an extra look at that.

freelancer42 commented 4 years ago

IMG_20200222_150040 IMG_20200222_150029 IMG_20200222_150006 IMG_20200222_145942

magu commented 4 years ago

This looks amazing! Do you have any precompiled binaries to share? I have given up on getting the toolchain up and running on my Mac.

freelancer42 commented 4 years ago

This is the version I'm using on my hardware right now. It has the "magic" firmware version set, so it'll always try to update the firmware on boot. The version reported in the menu is "1.99". Needless to say, use at your own risk!

I haven't tried running any special chip games, but given that everything compiled and I'm basing it on the latest code version here on GitHub, I'm assuming it should work.

SD2SNES Mk3 ldx-favorites branch binaries 2020-02-22 1545Z.zip

And yeah, it took me a few days to setup the build environment haha. I'm currently running it on Ubuntu 18.04 on a laptop I wasn't using and doing most of the work "remotely".

ramapcsx2 commented 4 years ago

Is there a chance to publicly share the installation? Not getting the toolchains to work is probably the top development blocker.

freelancer42 commented 4 years ago

Writing this from memory, but it's only been a few days so most of it should be accurate. Here's how I set up my environment:

  1. Install Ubuntu 18.04
  2. Install various prerequisites using apt install. Don't remember exactly which ones, but I think at least: make libc6-dev gcc g++ libboost-dev
  3. Install the arm toolchain stuff (no need to build the Cortex M3 toolchain linked to in the readme): apt install gcc-arm-none-eabi binutils-arm-none-eabi openocd (not sure if you need openocd)
  4. Download snescom 1.7.4.1 (NOT the latest version!) from http://bisqwit.iki.fi/source/snescom.html, untar it to some temp directory, make, make install
  5. Download ISE Design Suite 14.7 Full Installer for Linux from here (might have to register to access it): https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/vivado-design-tools/archive-ise.html
  6. Untar the installer and run the setup script (requires a GUI)
  7. Run the license tool and select the option to get a free ISE WebPack license (I recall having problems with this and having to manually go to the web site and get a license, then install it using the tool): /opt/Xilinx/14.7/ISE_DS/common/bin/lin64/xlcm
  8. Download Intel Quartus Prime Lite 18.1 for Linux from here (might have to register to access it): https://fpgasoftware.intel.com/18.1/?edition=lite&platform=linux
  9. Untar the installer and run the setup script (requires a GUI)
  10. Check out the latest version of the sd2snes code from GitHub
  11. Modify sd2snes/verilog/settings.mk to fit your environment (comment out the Windows stuff, uncomment the Linux stuff, maybe change the paths to match your Xilinx and Intel tools installations)
  12. At this point you should be able to cd to sd2snes/verilog/sd2snes_mini and make that FPGA core (this is what you need Xilinx and Quartus Prime for)
  13. cd to sd2snes/src/utils and make
  14. At this point you should be able to cd to sd2snes/src and make the firmware: "make CONFIG=config-mk2" for Mk2, "make CONFIG=config-mk3" for Mk3
  15. Modify sd2snes/snes/Makefile and comment out cheat.o65 on the first line (not sure why it's in the makefile, the file doesn't exist)
  16. At this point you should be able to cd to sd2snes/snes and make the menu
  17. If everything builds, have a cake. You've earned it.

Feel free to ask me questions about it while it's still fairly fresh in my memory!

edit Also, the firmware version in firmware.img/firmware.im3 is determined by the setting at the top of config-mk2/config-mk3. If you want to make the bootloader always update the firmware on boot even if it's the same as the installed version (essential for development), set "CONFIG_FWVER = 0x44534E53" in config-mk2 and "CONFIG_FWVER = 0x33534E53" in config-mk3.

ramapcsx2 commented 4 years ago

Wow, thanks for the writeup!

This should be stickied or something (@mrehkopf ?)

magu commented 4 years ago

I just realized that this pull request actually implements my feature request (#31) from seven and a half years ago ... 😂

freelancer42 commented 4 years ago

Better late than never!

mrehkopf commented 4 years ago

Sorry 🙈 Pretty awesome stuff @freelancer42, thanks a lot! I think I was going to merge @borti4938's src/README.GCC-ARM-NONE_EABI-49 that mentions using a pre-packaged ARM toolchains instead of building it yourself which has always been a bit of a hassle. @ramapcsx2 How would one sticky something on GitHub? :)

magu commented 4 years ago

You could link to that particular post from the build instructions, I suppose. 🤷‍♂️

Awesome instructions for getting a working toolchain ...

ramapcsx2 commented 4 years ago

Yeah, or alternatively, use the Wiki :)

magu commented 4 years ago

Wiki?!! What is this witchcraft you speak of? 😱

(Yea ... didn't think of that ... 🤦‍♂️)

freelancer42 commented 4 years ago

Putting toolchain instructions in the wiki sounds like a good idea to me