Skip to content

.ugo menu format

James edited this page Jun 8, 2024 · 12 revisions

Overview

The .ugo format is used for certain menus (which we call "ugomenus"), and comes in a number of different styles. It's mostly used for Flipnote grids, list-style menus, and the inbox menu.

There are a number of benefits to using ugomenus over HTML pages, most notably the much lower filesize, however they also greatly reduce HTTP requests.

The documentation on this page is extended from PBSDS' research on the hatena-server wiki.

Structure

Ugomenus always contain a plaintext menu data section, sometimes with an additional section for embedded files if required. Embeds are either Flipnote .tmb files if the menu is a Flipnote grid, or .ntft icons if it is a list-style menu. ntft ugomenu icons are always 32 x 32.

Header

The ugomenu header follows the same structure as the other formats:

Type Details
char[4] File magic UGAR
uint32 Section count (always 2)
uint32 Palette data length
uint32 Image data length

Section #1 - Menu data

Menu data is all plaintext. It contains a number of different entries (of differing types), all separated by newline characters (\n or 0x0A).

Each entry contains a number of different values, the first of which is always a number telling us what type of entry it is. All of these values are separated by tab characters (\t or 0x09).

Value Entry type
0 Menu type indicator
1 Top screen contents
2 Dropdown item
3 Corner button
4 Menu item

Type 0 - Menu type indicator

This type typically only has one value, which gives the type of menu layout to use:

Value Menu Type
0 List-style, with large text. Used for index.ugo.
1 List-style, small text.
2 Grid, can be used for Flipnote grids or inbox menu.
3 Same as 1.
4 Same as 0, but different icon set.

However, there can sometimes be an extra value after this that changes behaviour slightly:

Layout value Extra value Usage
2 2 Adds a "Post" button to the bottom-right corner which can be used to add a comment to the currently selected Flipnote

Type 1 - Top screen contents

The first value in this entry is either 0 or 1.

If it's 0, the next values are used for top screen text. All text is UTF-16 LE, encoded unto base64. In order, they are:

Meta tag equivalent Placement
uppertitle large and centred with underline
uppersubleft medium and left aligned underneath the title
uppersubright medium and right aligned underneath the title
uppersubtop small and towards the top of the screen in a box
uppersubbottom small and centred towards the bottom of the screen

But if the first value is 1, then the following value is a plaintext URL to an .nbf background image or a Flipnote .ppm, basically the equivalent to the upperlink meta tag.

Type 2 - Dropdown item

These are the dropdown items that usually appear on comment pages, they can be used elsewhere though.

Value # Value Type Usage
1 URL The user will be navigated to this URL when they select this item
2 string (UTF-16LE in base64) The label for this item
3 number Whether it the selected item or not. 0 is False and 1 is True

Type 3 - Corner button

These are the buttons that appear in the bottom-right of the touch screen. An ugomenu can have up to two of these.

Value # Value Type Usage
1 URL The user will be navigated to this URL when they tap this button
2 string (UTF-16LE in base64) The label for this button

Type 4 - Menu item

This is either a labelled button in the middle of the screen, or a Flipnote thumbnail on grid-type ugomenus

Value # Value Type Usage
1 URL The user will be navigated to this URL when they tap this item
2 number Icon index, documented below
3 string (UTF-16LE in base64) The label for this item
4 number Counter ("stars" for grid-style menus, or just a number on others) leave this empty for no counter
5 number Shows a lock on the corder of the item, use 1 for lock, and leave empty for no block
6 number Unknown - only seen as 0 so far

Type 5 - Unknown

We're not entirely sure what this is meant to do yet. On certain pages, this will turn the menu background solid blue. This has never been seen in use in the Flipnote Hatena captures that we have.

Value # Value Type Usage
1 ? Unknown - but leaving this value blank makes the page send another GET request for something when it loads the menu

Section #2 - Embed data

All the embedded icons or TMB files are stored here, appended onto eachother.

If the menu type isn't 2, then all the files are NTFT each 2048 bytes long. These pack out into 32x32 icons.

If the menu type is 2, then all the files are TMB files, each 1696 bytes in length.

Icons

Icon values 0 - 99 are used for embedded content, and refer to the index of a particular item in the embed section.

Icon values above 99 are hardcoded internal icons, and are listed as follows:

index.ugo

Value Icon
100 Group of people
101 TV
102 Globe
103 Search
104 Frog

menu type 1 and 0, when not index.ugo

Value Icon
100 unused
101 TV
102 - 103 unused
104 Frog
105 - 112 unused
113 6 frogs
114 Person
115 Right arrow
116 Left arrow
117 Question mark

menu type 4

Value Icon
100 unused
101 TV
102 - 103 unused
104 Frog
105 Send
106 Frog with heart speech bubble
107 Add stars
108 Frog with frog speech bubble
109 Frog with tv speech bubble
110 Diary/book
111 Profile
112 4 frogs
113 6 frogs

menu type 2

If url not given (using .tmb embed instead):

Value Icon
0 letter with default icon
1 read flipnote thumb with text
2 letter with default icon
3 flipnote thumb with star count
4 read flipnote thumb with text

If url given:

Value Icon
0 letter with frog stamp
1 read letter without frog stamp
2 letter with frog stamp
3 letter without frog stamp

Notes

Hardcoded

"NEW" mail button

The flashing "NEW" mail icon on index.ugo is toggled by one of these two header values from /auth:

header value
X-DSi-Unread-Notices 1
X-DSi-New-Notices 1