Jump to content

Meta:ToDo: Difference between revisions

From Mii Technical Wiki
No edit summary
No edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
if mii internals was github wiki
if mii internals was github wiki (arian notes)


* Structures/Data Formats
* Structures/Data Formats
** Character Data
** Character Data
*** Wii/DS (RFLCharData, separate section for little endian)
*** Wii/DS ([[RFLCharData]], separate section for little endian)
 
*** [[Ver3StoreData|3DS/Wii U (Ver3StoreData/FFL/CFL/AFL)]]
*** 3DS/Wii U (Ver3StoreData/FFL/CFL/AFL)
*** [[Nn::mii::CharInfo|Switch (nn::mii::CharInfo)]]
 
*** Switch (nn::mii::CharInfo)
 
*** Switch (Internal DB, nn::mii::CoreData/StoreData)
*** Switch (Internal DB, nn::mii::CoreData/StoreData)
*** CFL/FFL WrappedStoreData (QR Encryption)
*** CFL/FFL WrappedStoreData (QR Encryption)
*** Switch amiibo (nn::mii::NfpStoreData, nn::mii::detail::NfpStoreDataExtention)
*** Switch amiibo (nn::mii::NfpStoreData, nn::mii::detail::NfpStoreDataExtention)
 
*** [[Mii Studio Local Storage|Studio API/Editor Web]]
*** Studio API/Editor Web
 
*** NintendoSDK Default Mii (nn::mii::detail::DefaultMiiTableElement)
*** NintendoSDK Default Mii (nn::mii::detail::DefaultMiiTableElement)
*** CharInfo for RFL, CFL, FFL
*** CharInfo for RFL, CFL, FFL
** CRC-16 Checksum
** CRC-16 Checksum
*** TODO: CRC-16/CCITT/XMODEM, use in char data formats, databases, example calc functions
*** TODO: CRC-16/CCITT/XMODEM, use in char data formats, databases, example calc functions
** Resource Archive
** Resource Archive
*** Wii: RFL_Res.dat (no struct)
*** Wii: RFL_Res.dat (no struct)
*** DS: NFL_Res.dat (similar to above but little-endian?)
*** DS: NFL_Res.dat (similar to above but little-endian?)
*** 3DS: CFL_Res.dat (no struct, similar but little-endian)
*** 3DS: CFL_Res.dat (no struct, similar but little-endian)
 
**** all three above contain [https://github.com/SMGCommunity/Petari/blob/6c4e3156be67abc08827655a788afee013ca4ed4/libs/RVLFaceLib/include/RFLi_NANDLoader.h#L13 RFLiArchive(CFLiArchive)] structure
**** all three above contain RFLiArchive(CFLiArchive) structure
*** Wii U/Miitomo: [[FFLRes*.dat|FFLRes(High/Middle).dat]], AFLResHigh(_2_3).dat
 
**** [https://github.com/aboood40091/ffl/blob/73fe9fc70c0f96ebea373122e50f6d3acc443180/include/nn/ffl/FFLiResourceHeader.h#L30 FFLiResourceHeader] but miitomo has a [https://github.com/ariankordi/ffl/blob/97eecdf3688f92c4c95cecf5d6ab3e84c0ee42c0/include/nn/ffl/detail/FFLiResourceTexture.h#L59 different texture header]
*** Wii U/Miitomo: FFLRes(High/Middle).dat, AFLResHigh(_2_3).dat
*** [[Shape*.dat|Switch: Shape(Mid/High).dat]] (nn::mii::detail::ResourceShapeHeader), [[NXTexture*.dat|Texture Resource]] (nn::mii::detail::ResourceTextureHeader, fname varies)
 
**** FFLiResourceHeader but miitomo has a different texture header
 
*** Switch: Shape(Mid/High).dat (nn::mii::detail::ResourceShapeHeader), Texture Resource (nn::mii::detail::ResourceTextureHeader, fname varies)
 
*** '''Each page''': Specify vertex (/shape/mesh), texture formats
*** '''Each page''': Specify vertex (/shape/mesh), texture formats
*** Outline for each page
*** Outline for each page
**** Summary of the format
**** Summary of the format
**** Description of structure
**** Description of structure
**** Where is it used
**** Where is it used
**** What makes it unique
**** What makes it unique
** Database
** Database
 
*** Wii, RFL_DB.dat, [https://github.com/SMGCommunity/Petari/blob/f2841a104b74bafa67e10dac857ca96dd5f779b5/libs/RVLFaceLib/include/RFLi_Database.h#L12 RFLiDatabase] / official, (hidden?????)
*** Wii, RFL_DB.dat, RFLiDatabase / official, (hidden?????)
*** Wii, RNCD/[https://github.com/SMGCommunity/Petari/blob/6c4e3156be67abc08827655a788afee013ca4ed4/libs/RVLFaceLib/include/RFLi_Controller.h#L15 RFLiCtrlBuf] and where it is in eeprom
 
*** Wii, RNCD/RFLiCtrlBuf and where it is in eeprom
 
*** 3DS, CFL_DB.dat, CFLiCharDatabase (DWARF) / official, (hidden? same as above?)
*** 3DS, CFL_DB.dat, CFLiCharDatabase (DWARF) / official, (hidden? same as above?)
 
*** Wii U, FFL_ODB.dat, FFL_HDB.dat, [https://github.com/aboood40091/ffl/blob/73fe9fc70c0f96ebea373122e50f6d3acc443180/include/nn/ffl/FFLiDatabaseFileOfficial.h#L42 FFLiDatabaseFileOfficial], [https://github.com/aboood40091/ffl/blob/73fe9fc70c0f96ebea373122e50f6d3acc443180/include/nn/ffl/FFLiDatabaseFileHidden.h#L64 FFLiDatabaseFileHidden]
*** Wii U, FFL_ODB.dat, FFL_HDB.dat, FFLiDatabaseFileOfficial, FFLiDatabaseFileHidden
 
**** (NOT FCL_DB.dat for clothing or stadio.sav for studio save)
**** (NOT FCL_DB.dat for clothing or stadio.sav for studio save)
 
*** Switch, nn::mii::detail::DatabaseFile ([https://github.com/Genwald/MiiPort/blob/4ee38bbb8aa68a2365e9c48d59d7709f760f9b5d/include/mii_ext.h#L153 NFDB]), nn::mii::detail::ImportFile ([https://github.com/Genwald/MiiPort/blob/4ee38bbb8aa68a2365e9c48d59d7709f760f9b5d/include/mii_ext.h#L161 NFIF]) - as for filename, mii_DatabaseFileManager.cpp has "mii:/MiiDatabase.dat", but NFIF is maybe for dev units only? (see settings) <nowiki>https://youtu.\be/f7cl7u0V15M?t=431</nowiki>
*** Switch, nn::mii::detail::DatabaseFile (NFDB), nn::mii::detail::ImportFile (NFIF) - as for filename, mii_DatabaseFileManager.cpp has "mii:/MiiDatabase.dat", but NFIF is maybe for dev units only? (see settings)
 
**** no hidden database here (but theres mii_PrivateDatabase.cpp). NFIF is signed with a hmac key, its not in windows version
**** no hidden database here (but theres mii_PrivateDatabase.cpp). NFIF is signed with a hmac key, its not in windows version
*** (what do we say for: mii studio web, miitomo??, )
*** (what do we say for: mii studio web, miitomo??, )
* Mii Character Data
* Mii Character Data
** CharInfo
** CharInfo
** Core/Char Data
** Core/Char Data
*** remember core isnt pointless, nn::mii::CoreData for miitomo and NFIF, then CFL/FFL/RFL core data (called CharDataHidden in rfl) is FOR HIDDEN DB
*** remember core isnt pointless, nn::mii::CoreData for miitomo and NFIF, then CFL/FFL/RFL core data (called CharDataHidden in rfl) is FOR HIDDEN DB
** StoreData
** StoreData
 
** [[CreateID/Mii ID|Create ID/Mii ID]]
** Create ID/Mii ID
 
*** Wii/DS
*** Wii/DS
*** 3DS/Wii U
*** 3DS/Wii U
*** Switch
*** Switch
** Special Properties
** Special Properties
*** MiiVersion, BirthPlatform: detail 3ds qr code anomaly, wiiu mpf face anomaly, how birth platform is set, ffl ds platform bug, future values from ctr sdk
*** MiiVersion, BirthPlatform: detail 3ds qr code anomaly, wiiu mpf face anomaly, how birth platform is set, ffl ds platform bug, future values from ctr sdk
*** NgWord, FontRegion: effects on each platform; see getadditionalinfo funcs, nnmii name funcs and character set tables
*** NgWord, FontRegion: effects on each platform; see getadditionalinfo funcs, nnmii name funcs and character set tables
*** LocalOnly, RegionMove, Favorite: why is favorite a thing again? (get from RFL alpha spec)
*** LocalOnly, RegionMove, Favorite: why is favorite a thing again? (get from RFL alpha spec)
*** AuthorId: also "UserID" in func names, it's from transferable id on 3ds/wiiu
*** AuthorId: also "UserID" in func names, it's from transferable id on 3ds/wiiu
*** BirthMonth, BirthDay: detail verification of this
*** BirthMonth, BirthDay: detail verification of this
** Special Miis/"Gold Pants"
** Special Miis/"Gold Pants"
*** TODO: what they are, create id flag, restrict localOnly, create id platform
*** TODO: what they are, create id flag, restrict localOnly, create id platform
** Data Verification
** Data Verification
** Random Data
** Random Data
 
* [[Color Tables]]
* Color Tables
 
** Wii/DS (RFL Colors/Ver3 Indices)
** Wii/DS (RFL Colors/Ver3 Indices)
** 3DS/Wii U (Ver3 Colors)
** 3DS/Wii U (Ver3 Colors)
 
** Switch ([[Common Color Table|Common Colors]])
** Switch (Common Colors)
 
** Gamma Mode (sRGB or Linear)
** Gamma Mode (sRGB or Linear)
* Rendering
* Rendering
** Shape Parts
** Shape Parts
** Textures
** Textures
 
*** [[Color Modulation|Texture Modulate/Color Mix]]
*** Texture Modulate/Color Mix
*** [[Faceline]] Texture
 
*** [[Mask]] Texture
*** Faceline Texture
 
*** Mask Texture
 
*** Shape Textures
*** Shape Textures
** Shape Transform/Positioning (also mention model scale, PartsTransform)
** Shape Transform/Positioning (also mention model scale, PartsTransform)
** Facial Expressions
** Facial Expressions
** Shaders
** Shaders
*** Wii/DS/3DS Do Not Use Shaders
*** Wii/DS/3DS Do Not Use Shaders
 
**** Wii TEV
*** Wii TEV
**** (TODO: find tev settings for icon, "drawLikeNigaoeChannel", see env.dat in dvdroot for RVLFaceLib samples)
 
*** (TODO: find tev settings for icon, "drawLikeNigaoeChannel", see env.dat in dvdroot for RVLFaceLib samples)
 
*** SampleShader.bcsdr (3DS) todo only in Tomodachi Life
*** SampleShader.bcsdr (3DS) todo only in Tomodachi Life
*** FFLDefaultShader.gsh (Wii U)
*** FFLDefaultShader.gsh (Wii U)
*** LUT.vsh/fsh (Miitomo)
*** LUT.vsh/fsh (Miitomo)
*** SampleShader.bnsh (Switch)
*** SampleShader.bnsh (Switch)
*** '''Outline'''
*** '''Outline'''
****  Description, lighting effect, previews?
****  Description, lighting effect, previews?
**** Uniforms/attributes and descriptions
**** Uniforms/attributes and descriptions
** Hair Variants/Using Headwear
** Hair Variants/Using Headwear
** Body Scaling
** Body Scaling
* Database
* Database
** Official/Table/Front Database
** Official/Table/Front Database
** Hidden/Back Database (TODO: CFLiRecentDBFile as well?)
** Hidden/Back Database (TODO: CFLiRecentDBFile as well?)
** Default Database, Random Database (not real dbs)
** Default Database, Random Database (not real dbs)
 
** '''TODO: where does wii remote database (search RFLiCtrlBuf in decomp) fit into this?'''
** TODO: where does wii remote database (search RFLiCtrlBuf in decomp) fit into this?
 
* Face Library
* Face Library
 
** Wii: [[Revolution Face Library|RFL/RVLFaceLib]]
** Wii: RFL/RVLFaceLib
** 3DS: [[Centrair Face Library|CFL (CTR/Centrair Face Library)]]
 
** Wii U: [[Cafe Face Library|FFL (Cafe Face Library)]] / [[Arch Face Library|Miitomo AFL (Arch Face Library)]]
** 3DS: CFL (CTR/Centrair Face Library)
** Switch: [[Nn::mii|nn::mii (NX/NintendoSDK Face Library)]]
 
** Unity: [[Un.mii|un.mii(?????)]]
** Wii U: FFL (Cafe Face Library) / Miitomo AFL (Arch Face Library)
 
** Switch: nn::mii (NX/NintendoSDK Face Library)
 
** Unity: un.mii(?????)
 
** '''Concepts'''
** '''Concepts'''
*** CharInfo + Character Data
*** CharInfo + Character Data
*** CharModel -> Scale, Coordinate
*** CharModel -> Scale, Coordinate
*** Icon (RFL, CFL, FFL, nn::mii), FFLIconWithBody/nn::mii::IconBody, nn::mii::VariableIconBody
*** Icon (RFL, CFL, FFL, nn::mii), FFLIconWithBody/nn::mii::IconBody, nn::mii::VariableIconBody
*** WiFiInformation (RFL) / NetPacket (CFL, FFL)
*** WiFiInformation (RFL) / NetPacket (CFL, FFL)
*** Expression Flag
*** Expression Flag
*** FFLShaderCallback, FFLExpand
*** FFLShaderCallback, FFLExpand
*** Special Mii Key (FFL, AFL, nn::mii)?????
*** Special Mii Key (FFL, AFL, nn::mii)?????
* Reverse Engineering Resources
* Reverse Engineering Resources
** TODO: this is where to link binaries with FFL symbols (MiiPlugin.rpl), libcocos2dcpp.s o, where to get nn::mii internals that's not from the NintendoSDK lol, maybe 3ds horizon os leak
** TODO: this is where to link binaries with FFL symbols (MiiPlugin.rpl), libcocos2dcpp.s o, where to get nn::mii internals that's not from the NintendoSDK lol, maybe 3ds horizon os leak
* TODO categorize these
* TODO categorize these
** Wii U Mii Maker/Mii Studio Internals: ffl_application, FFLUtility, debugutility, Viewer, miiviewer, MiiCapture (HUGE TODO)
** Wii U Mii Maker/Mii Studio Internals: ffl_application, FFLUtility, debugutility, Viewer, miiviewer, MiiCapture (HUGE TODO)
 
** TODO: CFLUtility? havent gotten it to work on my 3ds, probably built from mii maker code as well
** TODO: CFLUtility? havent gotten it to work on my 3ds, probably mii maker as well
** Title: [[Miitomo]]
 
*** TODO: AFL/nn::mii and shaders, mii_data structure, headwear type enum, powervr pod format, api xor obfuscation, mii json structure + qr codes, limited info we know about nuance voice,
*** Title: Miitomo
** Title: Tomodachi Life/Tomodachi Collection: New Life (TODO)
 
** TODO: AFL/nn::mii and shaders, mii_data structure, headwear type enum, powervr pod format, api xor obfuscation, mii json structure + qr codes, limited info we know about nuance voice,
 
*** Title: Tomodachi Life/Tomodachi Collection: New Life (TODO)
 
** (Face Library?) Mii Icon Servers? - NNAS, Nintendo Account 1.0.0, NA 2.0.0/studio
** (Face Library?) Mii Icon Servers? - NNAS, Nintendo Account 1.0.0, NA 2.0.0/studio
*** NNAS renderer - input (only crc and smth else validated), xml output, png and tga, wii u local renders
*** NNAS renderer - input (only crc and smth else validated), xml output, png and tga, wii u local renders
**** theory of how this works. FFL has SwapEndian methods probably for x86. is this cafe sdk (32-bit g3d) on windows?
**** theory of how this works. FFL has SwapEndian methods probably for x86. is this cafe sdk (32-bit g3d) on windows?
*** Nintendo Account 1.0.0 - same as above but params from npf
*** Nintendo Account 1.0.0 - same as above but params from npf
 
*** Nintendo Account 2.0.0, [[Mii Studio (nintendo.com)|studio.mii.nintendo com]] web API
*** Nintendo Account 2.0.0, studio.mii.nintendo com web API
 
**** na 2.0.0 has miitomo shader+culling, used to show miitomo clothing, mii studio nnid bear suit (find my screenshot)
**** na 2.0.0 has miitomo shader+culling, used to show miitomo clothing, mii studio nnid bear suit (find my screenshot)
**** mii studio api: data format + obfs, params... probs more
**** mii studio api: data format + obfs, params... probs more
* How do I...
* How do I...
** Decode and encode Mii data?
** Decode and encode Mii data?
** Verify Mii data?
** Verify Mii data?
** Render Mii data to an icon?
** Render Mii data to an icon?
* Questions/Troubleshooting(?)  
* Questions/Troubleshooting(?)  
** What kind of Mii data do I have?
** What kind of Mii data do I have?
** Why isn't my Mii data valid on a console?
** Why isn't my Mii data valid on a console?
* Recommendations from Arian
* Recommendations from Arian
** Use Accurate Structures
** Use Accurate Structures
** Cite Sources
** Cite Sources
** Don't Guess, Use Decomps
** Don't Guess, Use Decomps
** Converting Resource Shapes/Textures
** Converting Resource Shapes/Textures
** Do NOT Invent Custom Formats for Miis
** Do NOT Invent Custom Formats for Miis
*** just append at the end of an existing format
*** just append at the end of an existing format
*** ffsd is most universal, nn mii coredata can be used if a compact format is needed + use magic signature to be detectable
*** ffsd is most universal, nn mii coredata can be used if a compact format is needed + use magic signature to be detectable
** Good References
** Good References
*** TODO: stuff like decomps, MiiPort
*** TODO: stuff like decomps, MiiPort
** Suboptimal References
** Suboptimal References
*** TODO: mii-js, mii2studio.py, kaitais?
*** TODO: mii-js, mii2studio.py, kaitais?


Line 273: Line 140:


* MediaWiki?
* MediaWiki?
** i quite like this so far -j0
** i quite like this so far -j0
* GitHub WIki?
* GitHub WIki?
* DokuWiki?
* DokuWiki?

Latest revision as of 11:11, 24 September 2025

if mii internals was github wiki (arian notes)

  • Structures/Data Formats
    • Character Data
    • CRC-16 Checksum
      • TODO: CRC-16/CCITT/XMODEM, use in char data formats, databases, example calc functions
    • Resource Archive
    • Database
      • Wii, RFL_DB.dat, RFLiDatabase / official, (hidden?????)
      • Wii, RNCD/RFLiCtrlBuf and where it is in eeprom
      • 3DS, CFL_DB.dat, CFLiCharDatabase (DWARF) / official, (hidden? same as above?)
      • Wii U, FFL_ODB.dat, FFL_HDB.dat, FFLiDatabaseFileOfficial, FFLiDatabaseFileHidden
        • (NOT FCL_DB.dat for clothing or stadio.sav for studio save)
      • Switch, nn::mii::detail::DatabaseFile (NFDB), nn::mii::detail::ImportFile (NFIF) - as for filename, mii_DatabaseFileManager.cpp has "mii:/MiiDatabase.dat", but NFIF is maybe for dev units only? (see settings) https://youtu.\be/f7cl7u0V15M?t=431
        • no hidden database here (but theres mii_PrivateDatabase.cpp). NFIF is signed with a hmac key, its not in windows version
      • (what do we say for: mii studio web, miitomo??, )
  • Mii Character Data
    • CharInfo
    • Core/Char Data
      • remember core isnt pointless, nn::mii::CoreData for miitomo and NFIF, then CFL/FFL/RFL core data (called CharDataHidden in rfl) is FOR HIDDEN DB
    • StoreData
    • Create ID/Mii ID
      • Wii/DS
      • 3DS/Wii U
      • Switch
    • Special Properties
      • MiiVersion, BirthPlatform: detail 3ds qr code anomaly, wiiu mpf face anomaly, how birth platform is set, ffl ds platform bug, future values from ctr sdk
      • NgWord, FontRegion: effects on each platform; see getadditionalinfo funcs, nnmii name funcs and character set tables
      • LocalOnly, RegionMove, Favorite: why is favorite a thing again? (get from RFL alpha spec)
      • AuthorId: also "UserID" in func names, it's from transferable id on 3ds/wiiu
      • BirthMonth, BirthDay: detail verification of this
    • Special Miis/"Gold Pants"
      • TODO: what they are, create id flag, restrict localOnly, create id platform
    • Data Verification
    • Random Data
  • Color Tables
    • Wii/DS (RFL Colors/Ver3 Indices)
    • 3DS/Wii U (Ver3 Colors)
    • Switch (Common Colors)
    • Gamma Mode (sRGB or Linear)
  • Rendering
    • Shape Parts
    • Textures
    • Shape Transform/Positioning (also mention model scale, PartsTransform)
    • Facial Expressions
    • Shaders
      • Wii/DS/3DS Do Not Use Shaders
        • Wii TEV
        • (TODO: find tev settings for icon, "drawLikeNigaoeChannel", see env.dat in dvdroot for RVLFaceLib samples)
      • SampleShader.bcsdr (3DS) todo only in Tomodachi Life
      • FFLDefaultShader.gsh (Wii U)
      • LUT.vsh/fsh (Miitomo)
      • SampleShader.bnsh (Switch)
      • Outline
        • Description, lighting effect, previews?
        • Uniforms/attributes and descriptions
    • Hair Variants/Using Headwear
    • Body Scaling
  • Database
    • Official/Table/Front Database
    • Hidden/Back Database (TODO: CFLiRecentDBFile as well?)
    • Default Database, Random Database (not real dbs)
    • TODO: where does wii remote database (search RFLiCtrlBuf in decomp) fit into this?
  • Face Library
  • Reverse Engineering Resources
    • TODO: this is where to link binaries with FFL symbols (MiiPlugin.rpl), libcocos2dcpp.s o, where to get nn::mii internals that's not from the NintendoSDK lol, maybe 3ds horizon os leak
  • TODO categorize these
    • Wii U Mii Maker/Mii Studio Internals: ffl_application, FFLUtility, debugutility, Viewer, miiviewer, MiiCapture (HUGE TODO)
    • TODO: CFLUtility? havent gotten it to work on my 3ds, probably built from mii maker code as well
    • Title: Miitomo
      • TODO: AFL/nn::mii and shaders, mii_data structure, headwear type enum, powervr pod format, api xor obfuscation, mii json structure + qr codes, limited info we know about nuance voice,
    • Title: Tomodachi Life/Tomodachi Collection: New Life (TODO)
    • (Face Library?) Mii Icon Servers? - NNAS, Nintendo Account 1.0.0, NA 2.0.0/studio
      • NNAS renderer - input (only crc and smth else validated), xml output, png and tga, wii u local renders
        • theory of how this works. FFL has SwapEndian methods probably for x86. is this cafe sdk (32-bit g3d) on windows?
      • Nintendo Account 1.0.0 - same as above but params from npf
      • Nintendo Account 2.0.0, studio.mii.nintendo com web API
        • na 2.0.0 has miitomo shader+culling, used to show miitomo clothing, mii studio nnid bear suit (find my screenshot)
        • mii studio api: data format + obfs, params... probs more
  • How do I...
    • Decode and encode Mii data?
    • Verify Mii data?
    • Render Mii data to an icon?
  • Questions/Troubleshooting(?)
    • What kind of Mii data do I have?
    • Why isn't my Mii data valid on a console?
  • Recommendations from Arian
    • Use Accurate Structures
    • Cite Sources
    • Don't Guess, Use Decomps
    • Converting Resource Shapes/Textures
    • Do NOT Invent Custom Formats for Miis
      • just append at the end of an existing format
      • ffsd is most universal, nn mii coredata can be used if a compact format is needed + use magic signature to be detectable
    • Good References
      • TODO: stuff like decomps, MiiPort
    • Suboptimal References
      • TODO: mii-js, mii2studio.py, kaitais?

where should the wiki be

  • MediaWiki?
    • i quite like this so far -j0
  • GitHub WIki?
  • DokuWiki?