[WIP] MysteriUs

Discussion in 'Wii U - Hacking & Backup Loaders' started by ryuutseku85, Mar 14, 2016.

  1. ryuutseku85
    OP

    ryuutseku85 Advanced Member

    Newcomer
    92
    150
    Dec 14, 2015
    France
    Hi everyone ,

    it's finally the release day!

    this is my first homebrew so please be indulgent .

    it's still need some minor adjustement but work complety fine .

    i use a tricky way to generate a random number.(i will explain later).

    i will give my code for the next update with lots of comment , that way beginner can easely understand it and i hope make there own to grow the community.

    i post the 550 and 532 in the zip , but i don't have a 532 system to verify if this work.

    Comments and Critics are welcome.

    Ryuutseku85



    original Post
     

    Attached Files:

    Last edited by ryuutseku85, Apr 11, 2016
  2. Phantom64
    This message by Phantom64 has been removed from public view by Minox, Mar 14, 2016, Reason: No need to be rude.
    Mar 14, 2016
  3. mellma

    mellma Member

    Newcomer
    48
    23
    Jun 4, 2010
    France
    Bordeaux
    Not useless. He learn how to develop on wii u and post this homebrew.

    Good job.
     
    Phantom90, Wolfy, Kafluke and 11 others like this.
  4. Shaker78

    Shaker78 GBAtemp Regular

    Member
    119
    107
    Jan 17, 2007
    Gambia, The
    Nice! Another TOTAL useless user/human.
     
  5. ryuutseku85
    OP

    ryuutseku85 Advanced Member

    Newcomer
    92
    150
    Dec 14, 2015
    France
    before talking , do you know me ? i don't think! so sh** *p !
    thank you , 1 person on 3 respond nicely ... what gbatemp have become ....
     
  6. pwsincd

    pwsincd Garage Flower

    Member
    GBAtemp Patron
    pwsincd is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    3,366
    1,740
    Dec 4, 2011
    Manchester UK
    @ryuutseku85 , good on ya , hope you get your issues sorted , i cant help but im impressed your trying good luck.
     
    ryuutseku85 likes this.
  7. mellma

    mellma Member

    Newcomer
    48
    23
    Jun 4, 2010
    France
    Bordeaux
    Yeah, it's really hopeful. You must beging somewhere.

    Keep on going.
     
    ryuutseku85 likes this.
  8. Leanny

    Leanny Advanced Member

    Newcomer
    86
    29
    Feb 14, 2009
    Gambia, The
    For writing you can use __os_snprintf(). Check osscreenexamples/ios for an example. For the answering you can do the following:
    0. you need one variable for the number and one for the current position.
    1. check for input (up, down, left, right, a)
    2a. if left, current position + 1, if right, current position -1.
    2b. if up, number = (number-(number/10^position)*(10^position)) + (((number/10^position)%10+1)%10)*10^position, assuming you start at position 0. This basicly just increases the number on a specific position to 1 and in case you leave the current position, it will be resettet to 0.
    2c. analog to above, just subtract for down.
    2d. for a apply it
    3. draw the current number with some arrows. You can do this with simple math for positions

    use this just as an idea on how to do it, there is still lots of stuff to do for it to work completly.
     
    ryuutseku85 likes this.
  9. ryuutseku85
    OP

    ryuutseku85 Advanced Member

    Newcomer
    92
    150
    Dec 14, 2015
    France
    hi ,
    can someone explain me how this fu*****g __os_printf work , please?

    i made my structure for the button and title
    Warning: Spoilers inside!

    then made my initialisation
    Warning: Spoilers inside!

    the i start the game
    Warning: Spoilers inside!
    and i got a blank screen i also try with the drawstring and _printstr
    (the only one who actually print something on the screen is _printstr , but i can do anything after that , i think the wiiu just freeze.)

    thanks for those who gonna help me.

    if you think this will help it's my c
     
    Last edited by ryuutseku85, Mar 30, 2016
  10. Blackspoon

    Blackspoon Member

    Newcomer
    29
    9
    Feb 19, 2016
    Gambia, The
    next to the blackfork
    Let me help you out.
    First you should have a look at this:
    www.learn-c.org

    It should help you to understand the basics of C.

    __os_snprintf doesnt print anything on the screen. It just format the char buffer like this:
    Code:
    char buffer[255];
    __os_snprintf(buffer,  255, "Simple String.");
    
    The string "Simple String" was put into the buffer variable.
    Now you can take the buffer and put it as a parameter in your _printstr function:

    Code:
    char buffer[255];
    __os_snprintf(buffer,  255, "Simple String.");
    
    _printstr(buffer);
      
    If you want to put an integer in a string you can use a placeholder and add an agrument:

    Code:
    int integer = 53421;
    char buffer[255];
    __os_snprintf(buffer,  255, "The integer has the value: %i", integer);
    
    _printstr(buffer);
      
    __os_snprintf is documented here: http://wiiubrew.org/wiki/Coreinit.rpl#Internal

    __os_snprintf is a wiiu equivalent to the function snprintf at other operating systems and its handling is the same.
    Look at this page http://www.cplusplus.com/reference/cstdio/snprintf/ for more formating options.



    I hope it would help you a littlebit.

    Blackspoon
     
    Last edited by Blackspoon, Mar 31, 2016
    ryuutseku85 likes this.
  11. ryuutseku85
    OP

    ryuutseku85 Advanced Member

    Newcomer
    92
    150
    Dec 14, 2015
    France
    Thanks a lot , i do C since january so i am still learning :)

    so i have to say it's comming (some tweak need to be done with the IF statement)

    MysteriU screen start.jpg
     
    Masterwin likes this.
  12. ryuutseku85
    OP

    ryuutseku85 Advanced Member

    Newcomer
    92
    150
    Dec 14, 2015
    France
    hi ,

    so here we go again ...

    first off :
    in the browser we have a rpl call randgen.rpl and it get NSSGetRandom function that need two arg (obviously min and max in my case).

    so this being said , let's go to the problem (again an other ?)
    so i have my code , nothing seem wrong to me , but i don't know why but my wiiu freeze at my screen start .

    here is my c code :
    Warning: Spoilers inside!

    so ? , what i don't do correctly ? maybe @brienj can help me with it cause i take exemple on his liteNESU menu.
     
    Masterwin likes this.
  13. Blackspoon

    Blackspoon Member

    Newcomer
    29
    9
    Feb 19, 2016
    Gambia, The
    next to the blackfork
    The randgen.rpl isnt a real lib provided by the os. I think this cause the freeze.

    And the default implemented rand function, provided by cstdlib, will freeze the wiiu if you executing it from the userspace. I dunno if it works correctly with kexploit and a clean startup environment.

    @Kakkoii has post a nice libary to get random numbers.
    https://gbatemp.net/threads/wiiu-homebrew-development.391050/page-11#post-6160401

    Alternative you can write a pseudo random function.
     
    Last edited by Blackspoon, Apr 5, 2016
  14. ajd4096

    ajd4096 GBAtemp Regular

    Member
    176
    187
    Feb 17, 2009
    Last edited by ajd4096, Apr 5, 2016
    Blackspoon likes this.
  15. MrRean

    MrRean WiiU Helper / Hacker

    Member
    422
    1,500
    Jan 21, 2013
    United States
    You can just call _Exit() as-is, because it's address is hardcoded into the coreinit.h file in libwiiu/src, so you don't have to void it to declare it.

    Same with OSFatal(). Also, why print()? You could try some of the OSScreen functions, or just use OSFatal()

    not bad for a first program though :}
     
    Last edited by MrRean, Apr 5, 2016
    ryuutseku85 likes this.
  16. vgmoose

    vgmoose GBAtemp Regular

    Member
    229
    627
    Jan 31, 2016
    United States
    A bit of self promotion, but I have a lot of examples you might want to see in Space Game.

    For pseudo-random numbers, I use this function, which you can invoke by passing the pointer to an integer (a seed) like this. To initialize the seed, you can base it off the time.

    Another great resource is Eliboa's Snake. Cool stuff so far :)
     
    Last edited by vgmoose, Apr 5, 2016
    ryuutseku85 likes this.
  17. ryuutseku85
    OP

    ryuutseku85 Advanced Member

    Newcomer
    92
    150
    Dec 14, 2015
    France
    Thanks Mr rean , but come tell me it again when I will release it lol .
    Vgmoose , each time I ask me something I take a look at two homebrew that ( I think ) are the most teachfull , they are lite NESU and ... Space game lol .

    For snake , I find it hard to understand with the use a structure and the name that don't evoke something like for example the s* for snack .

    Yours explain me how the vpad_data function work and how to use it .

    For the random generator I think I may have find a different way that I will explore .

    Thanks a lot for your support , until brienj or anyone else explain me the menu I will do it the old way lol .

    When I will finish this , I think I gonna make a big tuto for the noob's one , so I can help them the wway some of you help me :)
     
  18. brienj

    brienj Trying to avoid getting cancer

    Member
    1,232
    1,705
    Jan 3, 2016
    United States
    The menu I used, uses arrows for the selection part. By changing the menuLine value, it makes the arrows get drawn on a different line. You need to make sure that you are including a header that defines the DrawString function you are using. Without seeing all of your source code, it is hard to determine exactly where any problem may lie.

    Like I told you on the other forums, you could use the TinyMT library, it is what I started using in AstUroids not long after starting that project. It works perfectly on the Wii U, or if you want one simple function, use the random number generator that vgmoose uses in his Space Game.
     
    Last edited by brienj, Apr 5, 2016
    ryuutseku85 likes this.
  19. Cyan

    Cyan GBATemp's lurking knight

    Global Moderator
    18,553
    8,905
    Oct 27, 2002
    France
    Engine room, learning
    Special thanks : Cyan ?
    I didn't help you, did I ? probably in another thread
    Good luck learning, trying is the best way to progress.
     
    ryuutseku85 likes this.
  20. pwsincd

    pwsincd Garage Flower

    Member
    GBAtemp Patron
    pwsincd is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    3,366
    1,740
    Dec 4, 2011
    Manchester UK
    you know i thought the same about myself , but i guess he feels i/we helped somehow...
     
    ryuutseku85 likes this.
  21. ryuutseku85
    OP

    ryuutseku85 Advanced Member

    Newcomer
    92
    150
    Dec 14, 2015
    France
    Indeed, you both help me .
    Cyan by saying don't get discouraged by the mean people (via pm)
    Pswincd to give a peaceful place to learn , and encouragement.

    Thanks brienj for the answer
     
    Last edited by ryuutseku85, Apr 5, 2016
    vgmoose, rw-r-r_0644 and pwsincd like this.