Difference between revisions of "Main.dol"

From Custom Mario Kart
Jump to navigation Jump to search
m (Add section file ranges)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{DISPLAYTITLE:main.dol}}
 
'''main.dol''' is the name given to the main executable of [[Wii]] and [[GameCube]] games. It is not a named file on the game disk, but rather the name given to the section of the disk containing the main executable. It uses the [[DOL (File Format)|DOL format]]. [[Mario Kart Wii]]'s main.dol contains quite a lot of generic library code, but most of the game specific logic is in [[StaticR.rel]].
 
'''main.dol''' is the name given to the main executable of [[Wii]] and [[GameCube]] games. It is not a named file on the game disk, but rather the name given to the section of the disk containing the main executable. It uses the [[DOL (File Format)|DOL format]]. [[Mario Kart Wii]]'s main.dol contains quite a lot of generic library code, but most of the game specific logic is in [[StaticR.rel]].
  
== Example PAL ==
+
== Mario Kart Wii (PAL) ==
 +
{| class="wikitable"
 +
|+ main.dol sections
 +
|-
 +
! Name<ref>[https://www.nxp.com/docs/en/user-guide/CWPABTR.pdf], CodeWarrior Development Studio for Power Architecture Processors Build Tools Reference Manual, table 14-1</ref>
 +
! file Start
 +
! file End
 +
! VMA Start
 +
! VMA End
 +
! Size
 +
! Type (text/data)
 +
|-
 +
| <code>.init</code>
 +
| 0x100
 +
| 0x2560
 +
| 0x80004000
 +
| 0x80006460
 +
| 0x2460
 +
| text
 +
|-
 +
| <code>extab</code>
 +
| 0x240080
 +
| 0x240640
 +
| 0x80006460
 +
| 0x80006a20
 +
| 0x5c0
 +
| data
 +
|-
 +
| <code>extabindex</code>
 +
| 0x240640
 +
| 0x240ee0
 +
| 0x80006a20
 +
| 0x800072c0
 +
| 0x8a0
 +
| data
 +
|-
 +
| <code>.text</code>
 +
| 0x2560
 +
| 0x240080
 +
| 0x800072c0
 +
| 0x80244de0
 +
| 0x23db20
 +
| text
 +
|-
 +
| <code>.ctors</code>
 +
| 0x240ee0
 +
| 0x240fa0
 +
| 0x80244de0
 +
| 0x80244ea0
 +
| 0xc0
 +
| data
 +
|-
 +
| <code>.dtors</code>
 +
| 0x240fa0
 +
| 0x240fc0
 +
| 0x80244ea0
 +
| 0x80244ec0
 +
| 0x20
 +
| data
 +
|-
 +
| <code>.rodata</code>
 +
| 0x240fc0
 +
| 0x254680
 +
| 0x80244ec0
 +
| 0x80258580
 +
| 0x136c0
 +
| data
 +
|-
 +
| <code>.data</code>
 +
| 0x254680
 +
| 0x2a0140
 +
| 0x80258580
 +
| 0x802a4040
 +
| 0x4bac0
 +
| data
 +
|-
 +
| <code>.bss</code>
 +
| N/A
 +
| N/A
 +
| 0x802a4080
 +
| 0x80384c00
 +
| 0xe0b80 (defined 0xe50fc in the header)<ref name="sda">[[DOL_(File_Format)#Small_data_sections]] DOL SDA implementation</ref>
 +
| data
 +
|-
 +
| <code>.sdata<ref name="sda" /></code>
 +
| 0x2a0140
 +
| 0x2a1500
 +
| 0x80384c00
 +
| 0x80385fc0
 +
| 0x13c0
 +
| data
 +
|-
 +
| <code>.sbss<ref name="sda" /></code>
 +
| N/A
 +
| N/A
 +
| 0x80385fc0
 +
| 0x80386fa0
 +
| 0xfe0
 +
| data
 +
|-
 +
| <code>.sdata2<ref name="sda" /></code>
 +
| 0x2a1500
 +
| 0x2a36a0
 +
| 0x80386fa0
 +
| 0x80389140
 +
| 0x21a0
 +
| data
 +
|-
 +
| <code>.sbss2<ref name="sda" /></code>
 +
| N/A
 +
| N/A
 +
| 0x80389140
 +
| 0x8038917c
 +
| 0x3c
 +
| data
 +
|}
  
Memory map of Mario Kart Wii (PAL):
+
== See also ==
<pre>
+
<references />
Memory map of DOL file:
 
 
 
      unused :  off(beg) ..  off(end) :      size : section
 
-----------------------------------------------------------------------
 
              :        0 ..      100 :      100 : DOL header
 
              :      100 ..      2560 :      2460 : text section T0
 
              :      2560 ..    240080 :    23db20 : text section T1
 
              :    240080 ..    240640 :      5c0 : data section D0
 
              :    240640 ..    240ee0 :      8a0 : data section D1
 
              :    240ee0 ..    240fa0 :        c0 : data section D2
 
              :    240fa0 ..    240fc0 :        20 : data section D3
 
              :    240fc0 ..    254680 :    136c0 : data section D4
 
              :    254680 ..    2a0140 :    4bac0 : data section D5
 
              :    2a0140 ..    2a1500 :      13c0 : data section D6
 
              :    2a1500 ..    2a36a0 :      21a0 : data section D7
 
              :    2a36a0 ..    2a36a0 :        0 : --- end of file ---
 
 
 
Memory map of DOL image:
 
 
 
      unused :  off(beg) ..  off(end) :      size : section
 
-------------------------------------------------------------------
 
.!          :  80004000 ..  80006460 :      2460 : text section T0
 
!.          :  800060a4 ..  800060a4 :        0 : entry point
 
              :  80006460 ..  80006a20 :      5c0 : data section D0
 
              :  80006a20 ..  800072c0 :      8a0 : data section D1
 
              :  800072c0 ..  80244de0 :    23db20 : text section T1
 
              :  80244de0 ..  80244ea0 :        c0 : data section D2
 
              :  80244ea0 ..  80244ec0 :        20 : data section D3
 
              :  80244ec0 ..  80258580 :    136c0 : data section D4
 
              :  80258580 ..  802a4040 :    4bac0 : data section D5
 
.!        40 :  802a4080 ..  8038917c :    e50fc : bss section
 
!.          :  80384c00 ..  80385fc0 :      13c0 : data section D6
 
              :  80386fa0 ..  80389140 :      21a0 : data section D7
 
</pre>
 
 
 
Same ''main.dol'' after patching it for [[Wiimms Mario Kart Fun 2020-02]]:
 
<pre>
 
Memory map of DOL file:
 
 
 
      unused :  off(beg) ..  off(end) :      size : section
 
-----------------------------------------------------------------------
 
              :        0 ..      100 :      100 : DOL header
 
              :      100 ..      2560 :      2460 : text section T0
 
              :      2560 ..    240080 :    23db20 : text section T1
 
              :    240080 ..    240640 :      5c0 : data section D0
 
              :    240640 ..    240ee0 :      8a0 : data section D1
 
              :    240ee0 ..    240fa0 :        c0 : data section D2
 
              :    240fa0 ..    240fc0 :        20 : data section D3
 
              :    240fc0 ..    254680 :    136c0 : data section D4
 
              :    254680 ..    2a0140 :    4bac0 : data section D5
 
              :    2a0140 ..    2a1500 :      13c0 : data section D6
 
              :    2a1500 ..    2a36a0 :      21a0 : data section D7
 
              :    2a36a0 ..    2a4150 :      ab0 : text section T2
 
              :    2a4150 ..    2a4a38 :      8e8 : text section T3
 
              :    2a4a38 ..    2a4a38 :        0 : --- end of file ---
 
 
 
Memory map of DOL image:
 
 
 
      unused :  off(beg) ..  off(end) :      size : section
 
-------------------------------------------------------------------
 
              :  80001800 ..  800022b0 :      ab0 : text section T2
 
        1d50 :  80004000 ..  80006460 :      2460 : text section T0
 
              :  80006460 ..  80006a20 :      5c0 : data section D0
 
              :  80006a20 ..  800072c0 :      8a0 : data section D1
 
              :  800072c0 ..  80244de0 :    23db20 : text section T1
 
              :  80244de0 ..  80244ea0 :        c0 : data section D2
 
              :  80244ea0 ..  80244ec0 :        20 : data section D3
 
              :  80244ec0 ..  80258580 :    136c0 : data section D4
 
              :  80258580 ..  802a4040 :    4bac0 : data section D5
 
.!        40 :  802a4080 ..  8038917c :    e50fc : bss section
 
!.          :  802c0000 ..  802c0000 :        0 : entry point
 
              :  802c0000 ..  802c08e8 :      8e8 : text section T3
 
              :  80384c00 ..  80385fc0 :      13c0 : data section D6
 
              :  80386fa0 ..  80389140 :      21a0 : data section D7
 
</pre>
 
  
 
[[category:Filesystem]]
 
[[category:Filesystem]]

Latest revision as of 09:21, 17 September 2022

main.dol is the name given to the main executable of Wii and GameCube games. It is not a named file on the game disk, but rather the name given to the section of the disk containing the main executable. It uses the DOL format. Mario Kart Wii's main.dol contains quite a lot of generic library code, but most of the game specific logic is in StaticR.rel.

Mario Kart Wii (PAL)

main.dol sections
Name[1] file Start file End VMA Start VMA End Size Type (text/data)
.init 0x100 0x2560 0x80004000 0x80006460 0x2460 text
extab 0x240080 0x240640 0x80006460 0x80006a20 0x5c0 data
extabindex 0x240640 0x240ee0 0x80006a20 0x800072c0 0x8a0 data
.text 0x2560 0x240080 0x800072c0 0x80244de0 0x23db20 text
.ctors 0x240ee0 0x240fa0 0x80244de0 0x80244ea0 0xc0 data
.dtors 0x240fa0 0x240fc0 0x80244ea0 0x80244ec0 0x20 data
.rodata 0x240fc0 0x254680 0x80244ec0 0x80258580 0x136c0 data
.data 0x254680 0x2a0140 0x80258580 0x802a4040 0x4bac0 data
.bss N/A N/A 0x802a4080 0x80384c00 0xe0b80 (defined 0xe50fc in the header)[2] data
.sdata[2] 0x2a0140 0x2a1500 0x80384c00 0x80385fc0 0x13c0 data
.sbss[2] N/A N/A 0x80385fc0 0x80386fa0 0xfe0 data
.sdata2[2] 0x2a1500 0x2a36a0 0x80386fa0 0x80389140 0x21a0 data
.sbss2[2] N/A N/A 0x80389140 0x8038917c 0x3c data

See also

  1. [1], CodeWarrior Development Studio for Power Architecture Processors Build Tools Reference Manual, table 14-1
  2. 2.0 2.1 2.2 2.3 2.4 DOL_(File_Format)#Small_data_sections DOL SDA implementation