How can I exit properly in an emunand?

Discussion in 'Wii - Emulation and Homebrew' started by JoostinOnline, Jan 22, 2012.

  1. JoostinOnline
    OP

    JoostinOnline Certified Crash Test Dummy

    Member
    10,970
    3,755
    Apr 2, 2011
    United States
    The Twilight Zone
    Nevermind, new method of detecting emunand found.

    If anybody is interested you can use the following code:
    Code:
    #include 
    
    Code:
    bool CheckIfNeek()
    {
    ISFS_Initialize();
    u32 num = 0;
    bool ret = !(ISFS_ReadDir("/Sneek", NULL, &num));
    ISFS_Deinitialize ();
    return ret;
    }
    }
    Code:
    bool NeekEnabled =CheckIfNeek();
    
    NeekEnabled will will be true if you are in an emunand. You can change the variable name to whatever you want, or use it in a conditional.
     
  2. hellboy2010

    hellboy2010 GBAtemp Regular

    Member
    220
    17
    Nov 22, 2010
    United States
    OK runing Settings Editor GUI on neek2o v70 via postloader 3.56.1
    save changes and exit> restart wii > trow me back to my real nand
    save changes and exit> load postloader>trow me back to postloader enand

    runing Settings Editor GUI on uneek+di r192 via postloader .3.56.1
    save changes and exit>(do not showing other options) trow me back to enand.
    exit without saving>(do not showing other options) trow me back to enand.
     
    1 person likes this.
  3. JoostinOnline
    OP

    JoostinOnline Certified Crash Test Dummy

    Member
    10,970
    3,755
    Apr 2, 2011
    United States
    The Twilight Zone
    Wait, you mean it works now?
     
  4. hellboy2010

    hellboy2010 GBAtemp Regular

    Member
    220
    17
    Nov 22, 2010
    United States
    is working for me

    but on uneek+di r187 freeze on exit
     
    1 person likes this.
  5. JoostinOnline
    OP

    JoostinOnline Certified Crash Test Dummy

    Member
    10,970
    3,755
    Apr 2, 2011
    United States
    The Twilight Zone
    Thanks. I wish I knew why it didn't work before.

    If nobody can come up with a reason/solution, I'll just leave it the way it is so people with old versions of NEEK can continue to use SE GUI.
     
  6. stfour

    stfour GBAtemp Advanced Maniac

    Member
    1,592
    274
    May 24, 2011
    Italy
    Joostin, if I remember well it was always working for me...
     
  7. JoostinOnline
    OP

    JoostinOnline Certified Crash Test Dummy

    Member
    10,970
    3,755
    Apr 2, 2011
    United States
    The Twilight Zone
    I don't remember if that was the case, I'll have to search through my old PM's.
     
  8. giantpune

    giantpune GBAtemp Addict

    Member
    2,860
    122
    Apr 10, 2009
    United States
    ISFS_ReadDir( "/sneek" ) or some other path that would appear on a sneek nand but not a normal wii.
     
    1 person likes this.
  9. JoostinOnline
    OP

    JoostinOnline Certified Crash Test Dummy

    Member
    10,970
    3,755
    Apr 2, 2011
    United States
    The Twilight Zone
    Thanks, I hadn't thought about that. :D
     
  10. stfour

    stfour GBAtemp Advanced Maniac

    Member
    1,592
    274
    May 24, 2011
    Italy
    You have not payed attention to neek2o thread :P (and I haven't read all your first post :blink: )

     
  11. JoostinOnline
    OP

    JoostinOnline Certified Crash Test Dummy

    Member
    10,970
    3,755
    Apr 2, 2011
    United States
    The Twilight Zone
    Lol, I never saw that. I thought the discussion about it ended. Here is what I was planning on using:
    Code:
    s32 CheckIfNeek() // New method for determining if this is a real or emu nand.  Works with new versions of NEEK
    {
    // Thanks goes to the almighty giantpune for this
    ISFS_Initialize();
    u32 num = 0;
    s32 ret = ISFS_ReadDir("/Sneek", NULL, &num);
    ISFS_Deinitialize ();
    return ret;
    } // CheckIfNeek
    
    Then doing this before exiting:
    Code:
    if (!CheckIfNeek()) EmuExitPrompt(); // Special exit if Wii is in *NEEK
    
    Any suggestions?
     
  12. stfour

    stfour GBAtemp Advanced Maniac

    Member
    1,592
    274
    May 24, 2011
    Italy
    Seems perfect.... I will update mine with yours :D
     
    1 person likes this.
  13. JoostinOnline
    OP

    JoostinOnline Certified Crash Test Dummy

    Member
    10,970
    3,755
    Apr 2, 2011
    United States
    The Twilight Zone
    I put the code in my first post in case anybody else wants to use it.