emukidid / swiss-gc

Swiss - The swiss army knife of GameCube homebrew
GNU General Public License v2.0
1.23k stars 93 forks source link

[Issue]: Network gets initialized at start, even when set not to. #865

Closed skawo closed 2 months ago

skawo commented 2 months ago

Describe the bug

Swiss tries to initialize the network on startup every time if there's a BBA-like attachment present - even if specifically set not to in the settings.

This happens because of line 231 in main.c which overwrites the "Initialize network on startup" setting if a BBA is present. This happens right before checking that very setting, making it useless.

I have acquired an ETH2GC recently, and I do keep it slotted into my GameCube at all times, since it's a pain to take in and out while the Gameboy Player is also present. I don't keep it plugged into the internet all the time, though, as there's no real reason to, and I don't have an ethernet cable close to where I usually keep my GameCube anyway. This means that every time I launch Swiss, I have to wait for the network initialization to time out.

Steps to reproduce

  1. Attach a broadband adapter (or, in my case, ETH2GC) to the GameCube
  2. Launch Swiss. The network will initialize.
  3. Go into settings and change the "Init network on startup" option to "No". Save the settings.
  4. Restart the GameCube and launch Swiss.
  5. Network will initialize anyway. The "Init network on startup" option will automatically be changed to "Yes" as well.

Expected behavior

The init network on startup option should be properly respected even if a BBA is present. The presence of BBA should not adjust the setting on its own.

Relevant log output

No response

Add screenshots

No response

Extrems commented 2 months ago

This is intentional and is necessary for the ENC28J60 to be detected across multiple boots.

skawo commented 2 months ago

Well, just remove the setting then, since it is literally useless?

Extrems commented 2 months ago

It's not useless because the original Broadband Adapter takes much, much longer to initialize.

skawo commented 2 months ago

The same code is used to detect the original Broadband Adapter and will also overwrite that setting, though?

Extrems commented 2 months ago

The original Broadband Adapter is excluded from this test and does not override it.

I think your real issue is there's no link check.

skawo commented 2 months ago

Oh, I see, I didn't notice the location switch, sorry.

That, or just allowing the device to not be detected via another setting. I'd rather have to switch a setting and reboot the console when I need the network than waiting for it when I don't.