VitorVilela7 / wide-snes

Super Mario World (SNES) Widescreen Project
1.6k stars 56 forks source link

How to build the ROM from source? #34

Open m00qek opened 3 years ago

m00qek commented 3 years ago

Hello, I'm trying to build the ROM from source. I do own the game and I have the one backup ROM file, but I don't know what are Mario.bin and Luigi.bin. What are those files? Can I derive those from my ROM file?

Thank you!

m00qek commented 3 years ago

Looking into the code and doing some research I understood some things (please correct me if I'm wrong):

I'm also guessing that every screen ratio must be built in a different manner, but I'm not sure how

TheLX5 commented 3 years ago

Most likely graphics weren't provided to avoid copyright concerns and lower the chances of this repo (and to an extent Vitor himself) to be targeted with a C&D.

m00qek commented 3 years ago

I'm also guessing that every screen ratio must be built in a different manner, but I'm not sure how

I was wrong, the final modified ROM is the same for all resolutions. The code has a bunch of defines that are injected by the emulator though the .bso config files.

m00qek commented 3 years ago

I created, on my fork, a Makefile with some QoL improvements. To build from source:

make prepare # downloads *.bin files
cp /path/to/your/backup/smw/rom ./build/resources/smw.sfc
make assemble # creates a hacked ROM
make release  # creates a patch file

I also added a file watcher:

make watch # assembles the hacked ROM every time one of the source files changes

I'm going to write some docs and open a PR

m00qek commented 3 years ago

I took a slightly different approach, would love to hear if it is a good one:

To make things easier I created a Github Action. Every time someone opens a PR it will generate the patch file and make it available for download. The problem with this is that the Action will need access to a legit personal game backup without letting anyone else access it.

I achieved this by creating a custom Dropbox App. This app requires authentication to download files, so I generated a token, added it as a Github Secret and used to configure a action that runs on every PR.

You can see a live example at https://github.com/m00qek/wide-snes/pull/2/checks . If you click on Artifacts, on the top right corner, you'll be able to download the patch (.bps file) but will have no access to the game backup.