Difference between revisions of "HomeMenu"

From WiiBrew
Jump to navigation Jump to search
Line 151: Line 151:
 
Also, I haven't looked into this much yet either, but wiimote settings (resolution, mode) are set when the menu is shown.  If there is no way for me to programmatically find what the previous values are I won't be able to restore them when the menu is closed.  My advice:  use the callbacks to save/restore wiimote settings before and after showing the menu.
 
Also, I haven't looked into this much yet either, but wiimote settings (resolution, mode) are set when the menu is shown.  If there is no way for me to programmatically find what the previous values are I won't be able to restore them when the menu is closed.  My advice:  use the callbacks to save/restore wiimote settings before and after showing the menu.
  
==Changelog==
+
==Release log==
 
'''30 March 2009'''
 
'''30 March 2009'''
 
* Sourcecode released (Google Code SVN).
 
* Sourcecode released (Google Code SVN).

Revision as of 21:02, 4 April 2009

Template:Infobox homebrewapp

HomeMenu is a library written in C which provides a Big-N style Home Menu. It aims to be graphics-library-independent so it can be used regardless of your application's underlying graphics code/library. It also allows you to associate your own functions to events such as when the menu opens, closes, redraws.

It's coming along well but isn't completed yet. An up-to-date "To Do" list can be found on the SVN.

News

4 April 2009 -- I'm looking for testers. I've gotten reports of odd behavior on PAL systems, so first and foremost I'm looking for PAL testers. I also need widescreen testers (both PAL and NTSC). If you're interested please leave your contact info on the discussion page. I'll also put together a version of the menu that will allow you to take screenshots.

Thanks,

MetaFight 19:01, 4 April 2009 (UTC)


3 April 2009 -- A few small changes. Now the lib actually works with GRRLIB apps. I've updated the usage instructions (below). I'll update the SVN and the .zip asap. Next up: Learn how to use compressed textures.

MetaFight 03:49, 4 April 2009 (UTC)


1 April 2009 -- I put up a quick and dirty conversion to C up on the SVN. Preliminary testing showed no bugs. I would appreciate it if somebody could point out any big NO-NOs in the code since it was converted with very little knowledge of C.

Oh, and no, this is not an April Fool's joke :)

MetaFight 06:40, 1 April 2009 (UTC)


30 March 2009 -- I'll be busy for the next few weeks so I won't be able to work on HomeMenu much. Since a few people have contacted me about getting the source I thought I'd release it early. The source is still for the incomplete preview, but a full v1 release shouldn't be too far away.

Enjoy!

MetaFight 23:15, 30 March 2009 (UTC)

Installation and usage

Installation

  1. Copy all the .c and .h files into your project (make sure the .c are accessible as sources and .h accessible as includes).
  2. Add #include "HomeMenu.h" where appropriate.
  3. Add -lasnd -lwiiuse to your MakeFile's LIBS := line.

Usage

  1. Call HomeMenu_Init() to set things up. Its parameters are:
    • int screenWidth -- horizontal resolution of screen.
    • int screenHeight -- vertical resolution of screen.
    • void* framebuffer0 -- pointer to the first framebuffer.
    • void* framebuffer1 -- pointer to the second framebuffer (Currently assumes double-buffering).
    • u8 framebufferIndex -- index to last buffer drawn to [0, 1].
  2. Specify graphics library with HomeMenu_SetGFX(). Accepted values are:
    • HM_GFX_GRRLIB
    • HM_GFX_LIBWIISPRITE
    • HM_GFX_FAILSAFE (which currently draws nothing).
  3. Specify sound library with HomeMenu_SetSND(). Accepted values are:
    • HM_SND_ASND
    • HM_SND_SDL (not yet implemented)
    • HM_SND_NOSOUND.
  4. When you want to display the menu (when the user presses HOME), simply call HomeMenu_Show(). In order for HomeMenu to be able to take a screenshot (used as the menu background) HomeMenu_Show() must be called before flushing the framebuffer.

Tip: If you have a callback set up for when the user holds down on the wiimote's powerbutton, add HomeMenu_Hide() to this callback to tell HomeMenu to relinquish its control of the main thread.

Tip: If your application relies on a timer, consider using the HomeMenu_SetAfterHideMenu(yourCallback) callback setter. This will allow you to update your timer (if necessary) before resuming your application.

Libwiisprite users

Currently, the pointers to the framebuffers and the framebuffer index are stored in the GameWindow object as private members. Shiny Red Tank got around this problem by adding accessors to the GameWindow class. Hopefully, if there is enough demand, the accessors will be included in the next version of LWS (go ask!). Here are my modifications:

GRRLIB 4.0.0 users

I think the same problem (as mentioned above) applies to you guys. Here are the accessors I used during my testing.

Feedback

Please direct all questions and feedback to the discussion page.

Statistics

I'd like to have a general idea of how many apps use this library (once released, or even off the svn). If you use it, could you please add [[Category:Homebrew using HomeMenu]] to your application's wiki page? Thanks.

Potential Issues

Right now, the only sound lib HomeMenu plays with is ASND. I haven't gotten around to pausing all active channels automatically when the menu opens, but that will be there for the first release. My adive: use the callbacks to pause your own channels for the time being.

Also, I haven't looked into this much yet either, but wiimote settings (resolution, mode) are set when the menu is shown. If there is no way for me to programmatically find what the previous values are I won't be able to restore them when the menu is closed. My advice: use the callbacks to save/restore wiimote settings before and after showing the menu.

Release log

30 March 2009

  • Sourcecode released (Google Code SVN).
  • Updated preview (Now with rumble and some sound).

22 March 2009, preview

  • Not yet complete, but you can get the idea.

Thanks