In memory of Ben “bushing” Byer, who passed away on Monday, February 8th, 2016.

Difference between revisions of "Libmii"

From WiiBrew
Jump to navigation Jump to search
Line 14: Line 14:
 
Libmii is based on the structure of this page: [[Mii Data#Mii format]] with a few additions.
 
Libmii is based on the structure of this page: [[Mii Data#Mii format]] with a few additions.
  
Mii data is stored in a "block of data" big enough to hold 100 miis.  If you have 100 miis, all blocks will be full of valid data. Miis are stored in the order in which they were created. If you have less than 100 miis, then you will have x blocks of valid data, followed by 100-x blocks of 0s. Because of this, the mii buffer is always the same size, it just may have 0 value miis at the end. Likewise, if you had 100 miis and then erased the 54th mii you made... there would be a "hole" in the data at the 54th slot full of 0s. Because of this, the mii buffer is always saying 100miis, but there could be slots that have 0s indicating that no mii exists there. The below code checks each block, and only grabs the non zero blocks, sends them up to the loadMii function above for processing, and stores the result in the array "miis". Therefore the array miis will only have valid mii data in it and will contain the actuall number of miis on the wii enabling us to use this in our program to manipulate the valid miis.
+
Some notes:
 +
* Mii data is stored in a "block of data" big enough to hold 100 miis.  If you have 100 miis, all blocks will be full of valid data.
 +
* Miis are stored in the order in which they were created. If you have less than 100 miis, then you will have x blocks of valid data, followed by 100-x blocks of 0s.
 +
** Because of this, the mii buffer is always the same size, it just may have 0 value miis at the end.
 +
** Likewise, if you had 100 miis and then erased the 54th mii you made... there would be a "hole" in the data at the 54th slot full of 0s.
 +
** Because of this, the mii buffer is always saying 100miis, but there could be slots that have 0s indicating that no mii exists there.
 +
* The code checks each block, and only grabs the non zero blocks, sends them up to the loadMii function for processing, and stores the result in the array "miis".
 +
*Therefore the array miis will only have valid mii data in it and will contain the actual number of miis on the wii enabling us to use this in our program to manipulate the valid miis.
  
 
== What does work ==
 
== What does work ==

Revision as of 23:22, 4 April 2010

Libmii
General
Author(s)mdbrim
TypeLibrary
Version1.0
Links
Download
Website
Source

Libmii is a library for use with Nintendo Wii homebrew. It allows programmers to access the Mii data on the Wii and use it homebrew applications. Libmii retrieves the raw data associated with each mii on your wii. To use this data to draw your miis, please see INSERT NAME HERE (still trying to figure out what to call this page... will be up soon).

Mii structure

Libmii is based on the structure of this page: Mii Data#Mii format with a few additions.

Some notes:

  • Mii data is stored in a "block of data" big enough to hold 100 miis. If you have 100 miis, all blocks will be full of valid data.
  • Miis are stored in the order in which they were created. If you have less than 100 miis, then you will have x blocks of valid data, followed by 100-x blocks of 0s.
    • Because of this, the mii buffer is always the same size, it just may have 0 value miis at the end.
    • Likewise, if you had 100 miis and then erased the 54th mii you made... there would be a "hole" in the data at the 54th slot full of 0s.
    • Because of this, the mii buffer is always saying 100miis, but there could be slots that have 0s indicating that no mii exists there.
  • The code checks each block, and only grabs the non zero blocks, sends them up to the loadMii function for processing, and stores the result in the array "miis".
  • Therefore the array miis will only have valid mii data in it and will contain the actual number of miis on the wii enabling us to use this in our program to manipulate the valid miis.

What does work

Everything!

What doesn't work

Requirements

  • libisfs (a copy is included within the libmii zip file)

Installation

  1. Download the zip file.
  2. Put the libmii.a and libisfs.a files in the libogc/lib/wii folder in devKitPro.
  3. Put the isfs folder and mii.h file in the libogc/include folder in devKitPro.
  4. Be sure to add "#include <mii.h>" in your source
  5. Edit your MakeFile LIBS: line to include "-lmii" and "-lisfs"

Credits

Special thanks to Matthew Bauer for starting this project... without his framework and initial versions of Libmii, this working product would not have been possible (or at least have taken me a LOT longer to do!)

Example

Coming soon (files being uploaded and wiki is being edited now!)