Difference between revisions of "System Font"

From 3dbrew
Jump to navigation Jump to search
 
(4 intermediate revisions by 2 users not shown)
Line 16: Line 16:
 
| 0x80
 
| 0x80
 
| Font data size
 
| Font data size
| The actual font data. There's also unknown data following the original decompressed font data.
+
| The actual font data.
 +
|-
 +
| 0x80 + Font data size
 +
| 0x332000 - 0x80 - Font data size
 +
| This is leftover data from decompression operation. During the font loading process, compressed data is loaded to <code>sharedmem + 0x332000 - compressed_size_aligned_to_4</code>, and then is decompressed to <code>sharedmem + 0x80</code>. Compressed data at the end that doesn't get overwritten by decompressed data remains in the shared memory
 
|}
 
|}
  
Line 28: Line 32:
 
| 0x0
 
| 0x0
 
| 0x4
 
| 0x4
| Normally value 0x2?
+
| Status.
 +
1: loading system font
 +
 
 +
2: system font loaded
 +
 
 +
3: failed to load system font
 
|-
 
|-
 
| 0x4
 
| 0x4
 
| 0x4
 
| 0x4
| Normally value 0x1?
+
| Region. Indicates which [[Title_list#0004009B_-_Shared_Data_Archives|system font archive]] is loaded
 +
1: region JPN/EUR/USA (archive 0004009B00014002)
 +
 
 +
2: region CHN (archive 0004009B00014102)
 +
 
 +
3: region KOR (archive 0004009B00014202)
 +
 
 +
4: region TWN (archive 0004009B00014302)
 
|-
 
|-
 
| 0x8
 
| 0x8
Line 39: Line 55:
 
|-
 
|-
 
| 0xC
 
| 0xC
| 0x34
+
| 0x74
 
| Normally all-zero?
 
| Normally all-zero?
 
|}
 
|}
 +
 +
==Unicode Private Use characters==
 +
 +
Some of these characters are used for tutorial message boxes and notifications; they can also be generally used in [[Mii]] names, [[SMDH|application titles]], etc.
 +
 +
Most of these originated in the "icons" tab of the DS's standard software keyboard, and were extensively used in its firmware UI.
 +
 +
{|border="1" cellpadding="2" cellspacing="0" style="border-collapse:collapse;"
 +
|-
 +
| colspan="17" style="background:#F8F8F8;text-align:center" | ''Private Use Area''
 +
|----- style="background:#ccf"
 +
!width="4%"|U+!!width="6%"|0!!width="6%"|1!!width="6%"|2!!width="6%"|3!!width="6%"|4!!width="6%"|5!!width="6%"|6!!width="6%"|7!!width="6%"|8!!width="6%"|9!!width="6%"|A!!width="6%"|B!!width="6%"|C!!width="6%"|D!!width="6%"|E!!width="6%"|F
 +
|----- align="center"
 +
!E00x
 +
|A button||B button||X button||Y button||L button||R button||D-pad (unmarked)||DS alarm clock||Boxed emoticon :)||Boxed emoticon >(||Boxed emoticon :O||Boxed emoticon -_-||Sun||Cloud||Umbrella||Snowman
 +
|----- align="center"
 +
!E01x
 +
|Negative boxed exclamation mark||Negative boxed question mark||Envelope||Cell phone||Thickly-boxed + (touch calibration mark)||Spades||Diamonds||Hearts||Flowers||Right arrow||Left arrow||Up arrow||Down arrow||Circled dot (like "your position" in smartphone maps)||Camera||Crossed-out square
 +
|----- align="center"
 +
!E02x
 +
|Spinner up-left||Spinner up||Spinner up-right||Spinner right||Spinner down-right||Spinner down||Spinner down-left||Spinner left||Large cross||Boxed A (Pictochat room)||Boxed B (Pictochat room)||Boxed C (Pictochat room)||Boxed D (Pictochat room)||Negative boxed A (Automatic DS boot)||Negative boxed M (Manual DS boot)||Crossed-out square
 +
|----- align="center"
 +
!E03x
 +
|"P" (Pictochat logo)||"I" (Pictochat logo)||"C" (Pictochat logo)||"T" (Pictochat logo)||"H" (Pictochat logo)||"A" (Pictochat logo)||Crossed-out square||Crossed-out square||Crossed-out square||Crossed-out square||Crossed-out square||Crossed-out square||Crossed-out square||Crossed-out square||Boxed negative X (small letter)||Boxed negative X (big bold letter)
 +
|----- align="center"
 +
!E04x
 +
|Power button (Wiimote)||D-pad (Wiimote)||A button (Wiimote)||B button (Wiimote)||Home button (Wiimote)||Start button (Wiimote)||Select button (Wiimote)||1 button (Wiimote)||2 button (Wiimote)||Analog stick (Nunchuck)||C button (Nunchuck)||Z button (Nunchuck)||a button (Classic)||b button (Classic)||x button (Classic)||y button (Classic)
 +
|----- align="center"
 +
!E05x
 +
|Left analog stick (Classic)||Right analog stick (Classic)||L button (Classic)||R button (Classic)||ZL button (Classic)||ZR button (Classic)||Return (keyboard symbol)||Space (keyboard symbol)||Wii pointer||Wii pointer "1"||Wii pointer "2"||Wii pointer "3"||Wii pointer "4"||Wii pointer dragging||Wii pointer dragging "1"||Wii pointer dragging "2"
 +
|----- align="center"
 +
!E06x
 +
|Wii pointer dragging "3"||Wii pointer dragging "4"||Wii pointer panning||Wii pointer panning "1!||Wii pointer panning "2"||Wii pointer panning "3"||Wii pointer panning "4"||Wii logo||Superscripr "er"||Superscript "re"||Superscript "e"||Negative boxed question mark||nothing||nothing||nothing||nothing
 +
|----- align="center"
 +
!E07x
 +
|Boxed X||Boxed negative X (Close button)||Back||Home||Steps||Play coin||Video camera||Analog stick (3DS)||Power button (O3DS)||D-pad up||D-pad down||D-pad left||D-pad right||D-pad vertical||D-pad horizontal||nothing
 +
|}
 +
 +
Table courtesy [https://en.wikibooks.org/wiki/Unicode/Character_reference/E000-EFFF Wikibooks]

Latest revision as of 21:34, 11 March 2018

During system boot, the system-font is loaded by NS to LINEAR-memory(in the original 0x14000000 vmem region) which always gets allocated at SYSTEM_memregion+0. Due to it being located there, all of this is GPU accessible. The BCFNT is loaded from the font title for the system region into that memory. During loading, the font-data is modified: the magic-num at fontdata+0 is changed from "CFNT" to "CFNU", and all file offsets are converted to addresses in this allocated linearmem. Processes can get the sharedmem_handle+vaddr for mapping the sharedmem for this via APT:GetSharedFont.

With font-data title-version v0 for USA/EUR/JPN, the size of this entire sharedmem is 0x332000-bytes.

Shared mem structure:

Offset Size Description
0x0 0x80 Header
0x80 Font data size The actual font data.
0x80 + Font data size 0x332000 - 0x80 - Font data size This is leftover data from decompression operation. During the font loading process, compressed data is loaded to sharedmem + 0x332000 - compressed_size_aligned_to_4, and then is decompressed to sharedmem + 0x80. Compressed data at the end that doesn't get overwritten by decompressed data remains in the shared memory

Header structure:

Offset Size Description
0x0 0x4 Status.

1: loading system font

2: system font loaded

3: failed to load system font

0x4 0x4 Region. Indicates which system font archive is loaded

1: region JPN/EUR/USA (archive 0004009B00014002)

2: region CHN (archive 0004009B00014102)

3: region KOR (archive 0004009B00014202)

4: region TWN (archive 0004009B00014302)

0x8 0x4 Decompressed font data size.
0xC 0x74 Normally all-zero?

Unicode Private Use characters[edit]

Some of these characters are used for tutorial message boxes and notifications; they can also be generally used in Mii names, application titles, etc.

Most of these originated in the "icons" tab of the DS's standard software keyboard, and were extensively used in its firmware UI.

Private Use Area
U+ 0 1 2 3 4 5 6 7 8 9 A B C D E F
E00x A button B button X button Y button L button R button D-pad (unmarked) DS alarm clock Boxed emoticon :) Boxed emoticon >( Boxed emoticon :O Boxed emoticon -_- Sun Cloud Umbrella Snowman
E01x Negative boxed exclamation mark Negative boxed question mark Envelope Cell phone Thickly-boxed + (touch calibration mark) Spades Diamonds Hearts Flowers Right arrow Left arrow Up arrow Down arrow Circled dot (like "your position" in smartphone maps) Camera Crossed-out square
E02x Spinner up-left Spinner up Spinner up-right Spinner right Spinner down-right Spinner down Spinner down-left Spinner left Large cross Boxed A (Pictochat room) Boxed B (Pictochat room) Boxed C (Pictochat room) Boxed D (Pictochat room) Negative boxed A (Automatic DS boot) Negative boxed M (Manual DS boot) Crossed-out square
E03x "P" (Pictochat logo) "I" (Pictochat logo) "C" (Pictochat logo) "T" (Pictochat logo) "H" (Pictochat logo) "A" (Pictochat logo) Crossed-out square Crossed-out square Crossed-out square Crossed-out square Crossed-out square Crossed-out square Crossed-out square Crossed-out square Boxed negative X (small letter) Boxed negative X (big bold letter)
E04x Power button (Wiimote) D-pad (Wiimote) A button (Wiimote) B button (Wiimote) Home button (Wiimote) Start button (Wiimote) Select button (Wiimote) 1 button (Wiimote) 2 button (Wiimote) Analog stick (Nunchuck) C button (Nunchuck) Z button (Nunchuck) a button (Classic) b button (Classic) x button (Classic) y button (Classic)
E05x Left analog stick (Classic) Right analog stick (Classic) L button (Classic) R button (Classic) ZL button (Classic) ZR button (Classic) Return (keyboard symbol) Space (keyboard symbol) Wii pointer Wii pointer "1" Wii pointer "2" Wii pointer "3" Wii pointer "4" Wii pointer dragging Wii pointer dragging "1" Wii pointer dragging "2"
E06x Wii pointer dragging "3" Wii pointer dragging "4" Wii pointer panning Wii pointer panning "1! Wii pointer panning "2" Wii pointer panning "3" Wii pointer panning "4" Wii logo Superscripr "er" Superscript "re" Superscript "e" Negative boxed question mark nothing nothing nothing nothing
E07x Boxed X Boxed negative X (Close button) Back Home Steps Play coin Video camera Analog stick (3DS) Power button (O3DS) D-pad up D-pad down D-pad left D-pad right D-pad vertical D-pad horizontal nothing

Table courtesy Wikibooks