djanatyn / ssbm-nix

Nix expressions for Super Smash Bros. Melee players.
32 stars 18 forks source link

DRAFT: Flakes, some other stuff #1

Closed 6AA4FD closed 3 years ago

6AA4FD commented 3 years ago

This is more of a draft than a complete pull, but I figured I could use your feedback given the nature of these changes, some of which you may be into, some not so much. I have

Feel free to cherry-pick the stuff you like and drop the stuff you don't, I will probably look at uncle-punch in the next few days.

djanatyn commented 3 years ago

Wow, thank you so much, this made my morning! I'll take a look at these changes after breakfast :)

6AA4FD commented 3 years ago

Good to hear! Unfortunately, I made a few boo-boos, and I guess I actually broke the uncle-punch build that I assumed was just not working in the first place. Everything is working now except:

I will try to get unclepunch 2.0 going now.

6AA4FD commented 3 years ago

Looking at the unclepunch derivations, I think xdelta3 checksums the input and output, and yet both unclepunch 1.1 and 2.0 are spitting 'IntCPU: Unknown instruction 00000000 at PC = 00000008 last_PC = 81200cf0 LR = 00000000' errors at me. To do a little bit more testing, I did an extract and copy on my vanilla iso (0e63d4223b01d9aba596259dc155a174, standard anther's ladder), and ran with vanilla dolphin, same error. I'm inclined to think this is a bug with wiimm's iso tools, not something fixable inside the derivation. I haven't filed one yet, since I'm wondering if there is anything stupid I have missed, but it seems like filing an issue there is probably the solution (or switching to gcrebuilder).

EDIT: Upon upgrading the dolphin version and running 'wit copy' on the P-GALE directory, I get a black screen instead of unknown instruction errors, so I think this is progress?

I have also replaced the codes.json fix with a sed oneliner that can be backported to unclepunch 1.1.

djanatyn commented 3 years ago

Sorry for the delay reviewing - I had not used nix flakes before, so I had to read some documentation and get up to speed on how they worked. It's also been a busy week.

I'm able to build these expressions as of this morning! I'll try to test everything out today after work.

djanatyn commented 3 years ago

Thanks for your patience - I've got a better understanding of flakes now. I'm using these new expressions for netplay without issues!

I'm inclined to think this is a bug with wiimm's iso tools, not something fixable inside the derivation. I haven't filed one yet, since I'm wondering if there is anything stupid I have missed, but it seems like filing an issue there is probably the solution (or switching to gcrebuilder).

Yeah, I'm in agreement after some investigation on my end. I was unable to load a vanilla NTSC v1.02 ISO running wit extract and then wit copy without changes, so I was planning to open an issue to get clarification on usage.

Slippi-playback is working, but totally untested. I haven't used it since the early beta, and I have no clue how it's supposed to work.

I was able to test a recent replay successfully:

$ sudo nix --experimental-features 'nix-command flakes' run .#slippi-playback -- \
  -u ~/slippi-playback-config \
  -i /dev/stdin \
  -e ~/melee/melee/ssbm.iso \
  -o flake-dump \
  <<< '{"replay":"/home/djanatyn/good-slippis/Game_20210111T170802.slp"}'
$ ffprobe -hide_banner ~/slippi-playback-config/Dump/Frames/flake-dump.avi
Input #0, avi, from '/home/djanatyn/slippi-playback-config/Dump/Frames/flake-dump.avi':
  Metadata:
    encoder         : Lavf58.45.100
  Duration: 00:01:07.20, start: 0.000000, bitrate: 5611 kb/s
    Stream #0:0: Video: mpeg4 (Simple Profile) (XVID / 0x44495658), yuv420p, 1878x1056 [SAR 1:1 DAR 313:176], 5600 kb/s, 60 fps, 60 tbr, 60 tbn, 60 tbc

I'm not sure where that usage is documented, but it was in my command line history.

Added (untested) a kernel module for overclocking gcc adapters

I saw that https://github.com/NixOS/nixpkgs/pull/105899 was merged in, adding gcadapter-oc-kmod to the nixpkgs tree which I started using recently. It looks like the expressions are almost identical. Admittedly, I also have a very similar expression floating around 😅

I'd prefer to only maintain expressions within this repository that are not already in nixpkgs. I imagine some of the more experimental expressions developed and explored here could eventually be contributed upstream.

...I guess I actually broke the uncle-punch build that I assumed was just not working in the first place.

I've just been updating these expressions in my spare time, and there's no guarantees (yet) about any of them working. It's certainly not clear to me which expressions are working right now outside of this branch.

With that said, I'd like to merge these commits in, even if some parts are untested. If you'd rather want to continue working on this draft branch, that's certainly okay too - up to you.

After merging next steps could be to:

That would give users a quick way to identify what's available, what's working, and how to get things running.

6AA4FD commented 3 years ago

Okay, I just cleaned up a bit and squashed. This is a good place to merge. Add to the TODO list, add a test for that slippi. If you want to give me the .slp that you're testing with (I haven't actually gotten a chance to play online yet, I have no known good ones), and I can try to write a checksum based test for slippi-playback (in a different feature branch, this one is already really cluttered).