Wii: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: Wii
| Old | New | Line | |
|---|---|---|---|
| 1 | + | *This is a work in progress porting. No download available yet.* | |
| 2 | + | ||
| 3 | + | ## Wii specs | |
| 4 | + | ||
| 5 | + | *(from Wikipedia)* | |
| 6 | + | ||
| 7 | + | **Processors** | |
| 8 | + | ||
| 9 | + | - **CPU**: PowerPC-based '[Broadway](http://en.wikipedia.org/wiki/Broadway_(microprocessor))' processor, made with a 90 nm SOI CMOS process, clocked at 729 MHz | |
| 10 | + | - **GPU**: ATI '[Hollywood](http://en.wikipedia.org/wiki/Hollywood_(graphics_chip))' GPU made with a 90 nm CMOS process, clocked at 243 MHz | |
| 11 | + | - **Boot CPU**: 'Starlet', part of the Hollywood package, an [ARM926EJ-S](http://en.wikipedia.org/wiki/ARM9) processor clocked at 243 MHz. It handles I/O and security; it is set to Big endian for compatibility with the Broadway core and it supports ARM and thumb instruction set. | |
| 12 | + | ||
| 13 | + | **Memory** | |
| 14 | + | ||
| 15 | + | - 88 MB of main memory (24 MB of 'internal' [1T-SRAM](http://en.wikipedia.org/wiki/1T-SRAM), integrated into graphics package; 64 MB of 'external' [GDDR3](http://en.wikipedia.org/wiki/GDDR3) SDRAM) | |
| 16 | + | - 3 MB of embedded memory for GPU texture and framebuffer. | |
| 17 | + | ||
| 18 | + | **Storage** | |
| 19 | + | ||
| 20 | + | - 512 MB built-in NAND flash memory | |
| 21 | + | - Expanded storage via SD and SDHC card memory (up to 32 GB) | |
| 22 | + | - Nintendo GameCube Memory Card (required for GameCube game saves) | |
| 23 | + | - Slot-loading disc drive compatible with 8 cm Nintendo GameCube Game Disc and 12 cm Wii Optical Disc | |
| 24 | + | - Mask ROM by Macronix | |
| 25 | + | ||
| 26 | + | **Video Resolution** | |
| 27 | + | ||
| 28 | + | - 480p (PAL/NTSC), 480i (PAL/NTSC) or 576i (PAL/SECAM), standard 4:3 and 16:9 anamorphic widescreen | |
| 29 | + | ||
| 30 | + | **Audio** | |
| 31 | + | ||
| 32 | + | - Main: Stereo – Dolby Pro Logic II-capable | |
| 33 | + | - Controller: Built-in speaker | |
| 34 | + | ||
| 35 | + | ## Status | |
| 36 | + | ||
| 37 | + | Compiler and RTL are working. libogc library needs some work here and there, but it seems working fine too. | |
| 38 | + | ||
| 39 | + | ## How to build the compiler from SVN | |
| 40 | + | ||
| 41 | + | ### Pre requisites | |
| 42 | + | ||
| 43 | + | #### fpc sources from SVN trunk | |
| 44 | + | ||
| 45 | + | Get fpc sources from SVN trunk repository: | |
| 46 | + | ||
| 47 | + | ` svn checkout `[`http://svn.freepascal.org/svn/fpc/trunk`](http://svn.freepascal.org/svn/fpc/trunk)` fpc` | |
| 48 | + | ||
| 49 | + | #### devkitPPC | |
| 50 | + | ||
| 51 | + | Download the [devkitPro updater](http://sourceforge.net/projects/devkitpro/), then execute it to install all devkitPPC related stuff. In case, there is a [wiki page](http://devkitpro.org/wiki/Getting_Started) that explains how to manually install things. | |
| 52 | + | ||
| 53 | + | #### fpc binaries | |
| 54 | + | ||
| 55 | + | Install the last stable release. | |
| 56 | + | ||
| 57 | + | ### Updating fpcmake | |
| 58 | + | ||
| 59 | + | The fpcmake shipped with the stable release needs to be updated in order to handle powerpc-wii target. Go to trunk/utils/fpcm folder and do | |
| 60 | + | ||
| 61 | + | ` make clean all` | |
| 62 | + | ||
| 63 | + | You will get a new fpcmake.exe, that should replace the one shipped with the fpc stable release, e.g. in c:/fpc/bin/i386-win32. | |
| 64 | + | ||
| 65 | + | ### Building the compiler | |
| 66 | + | ||
| 67 | + | Make a .bat file (e.g. build_compiler.bat) in a directory of your choice, replacing the paths accordingly to yours: | |
| 68 | + | ||
| 69 | + | `:: build_compiler.bat`\ | |
| 70 | + | `@ECHO off`\ | |
| 71 | + | ||
| 72 | + | `:: FPC installation directory`\ | |
| 73 | + | `SET FPC_INST_DIR=C:\fpc4wii`\ | |
| 74 | + | `:: FPC sources directory`\ | |
| 75 | + | `SET FPC_SRC_DIR=C:\fpc_sources_from_trunk`\ | |
| 76 | + | `:: Binutils directory`\ | |
| 77 | + | `SET BINUTILS_DIR=C:\devkitPro\devkitPPC\bin`\ | |
| 78 | + | `:: Binutils prefix`\ | |
| 79 | + | `SET TOOL_PREFIX=powerpc-eabi-`\ | |
| 80 | + | ||
| 81 | + | `SET PATH=%BINUTILS_DIR%;%PATH%`\ | |
| 82 | + | ||
| 83 | + | `CD /D %FPC_SRC_DIR%\compiler`\ | |
| 84 | + | ||
| 85 | + | `:: Recreate makefile...`\ | |
| 86 | + | `fpcmake -r -w -Tall`\ | |
| 87 | + | ||
| 88 | + | `:: Cleaning...`\ | |
| 89 | + | `make distclean`\ | |
| 90 | + | ||
| 91 | + | `:: Building the compiler...`\ | |
| 92 | + | `make PPC_TARGET=powerpc`\ | |
| 93 | + | ||
| 94 | + | `pause`\ | |
| 95 | + | ||
| 96 | + | `:: Making install directories and copying files...`\ | |
| 97 | + | `MKDIR %FPC_INST_DIR%\bin\powerpc-wii`\ | |
| 98 | + | `:: copying the compiler...`\ | |
| 99 | + | `COPY /Y %FPC_SRC_DIR%\compiler\ppcppc.exe %FPC_INST_DIR%\bin\powerpc-wii\ppcppc.exe`\ | |
| 100 | + | `:: copying fpc utils...`\ | |
| 101 | + | `XCOPY /Y %FPC_SRC_DIR%\compiler\utils*.exe %FPC_INST_DIR%\bin\powerpc-wii\`\ | |
| 102 | + | `:: copying binutils...`\ | |
| 103 | + | `XCOPY /Y %BINUTILS_DIR%*.* %FPC_INST_DIR%\bin\powerpc-wii\`\ | |
| 104 | + | `:: copying messages...`\ | |
| 105 | + | `MKDIR %FPC_INST_DIR%\msg`\ | |
| 106 | + | `XCOPY /Y %FPC_SRC_DIR%\compiler\msg*.* %FPC_INST_DIR%\msg\`\ | |
| 107 | + | ||
| 108 | + | `:: Done!`\ | |
| 109 | + | `pause`\ | |
| 110 | + | ||
| 111 | + | Now execute it to build and install the compiler. | |
| 112 | + | ||
| 113 | + | ### Building the runtime library | |
| 114 | + | ||
| 115 | + | Make another .bat file (e.g. build_rtl.bat) and put in a directory of your choice, replacing the paths accordingly to yours: | |
| 116 | + | ||
| 117 | + | `:: build_rtl.bat`\ | |
| 118 | + | `@ECHO off`\ | |
| 119 | + | ||
| 120 | + | `:: FPC installation directory`\ | |
| 121 | + | `SET FPC_INST_DIR=C:\fpc4wii`\ | |
| 122 | + | ||
| 123 | + | `:: FPC sources directory`\ | |
| 124 | + | `SET FPC_SRC_DIR=C:\fpc_sources_from_trunk`\ | |
| 125 | + | ||
| 126 | + | `:: Binutils directory`\ | |
| 127 | + | `SET BINUTILS_DIR=C:\devkitPro\devkitPPC\bin`\ | |
| 128 | + | ||
| 129 | + | `:: Binutils prefix`\ | |
| 130 | + | `SET TOOL_PREFIX=powerpc-eabi-`\ | |
| 131 | + | ||
| 132 | + | `SET PATH=%BINUTILS_DIR%;%PATH%`\ | |
| 133 | + | ||
| 134 | + | `CD %FPC_SRC_DIR%\rtl\wii`\ | |
| 135 | + | ||
| 136 | + | `fpcmake -r -w -Tall`\ | |
| 137 | + | ||
| 138 | + | `make clean`\ | |
| 139 | + | `make CPU_TARGET=powerpc OS_TARGET=wii PP="%FPC_INST_DIR%\bin\powerpc-wii\ppcppc.exe" OPT="-Twii -CX -XX -O2" BINUTILSPREFIX=%TOOL_PREFIX%`\ | |
| 140 | + | `MKDIR %FPC_INST_DIR%\units\powerpc-wii`\ | |
| 141 | + | `XCOPY /Y %FPC_SRC_DIR%\rtl\units\powerpc-wii*.* %FPC_INST_DIR%\units\powerpc-wii\`\ | |
| 142 | + | ||
| 143 | + | `:: Create Package.fpc...`\ | |
| 144 | + | `fpcmake -pv -Twii`\ | |
| 145 | + | `COPY /Y %FPC_SRC_DIR%\rtl\wii\Package.fpc %FPC_INST_DIR%\units\powerpc-wii\Package.fpc`\ | |
| 146 | + | ||
| 147 | + | `:: Done!`\ | |
| 148 | + | `pause`\ | |
| 149 | + | ||
| 150 | + | Execute it to build and install the RTL. | |
| 151 | + | ||
| 152 | + | ### Adding fpc.cfg file | |
| 153 | + | ||
| 154 | + | Go to the new binaries directory (e.g. C:\fpc4wii\bin\powerpc-wii), make a new fpc.cfg file and edit it: | |
| 155 | + | ||
| 156 | + | `-Twii `\ | |
| 157 | + | `-XPpowerpc-eabi- `\ | |
| 158 | + | `-FuC:\fpc4wii\units\powerpc-wii `\ | |
| 159 | + | `-FuC:\fpc4wii\units\powerpc-wii\libogcfpc `\ | |
| 160 | + | `-FuC:\fpc4wii\units\powerpc-wii\mad `\ | |
| 161 | + | `-FDC:\fpc4wii\bin\powerpc-wii`\ | |
| 162 | + | `-FlC:\devkitPro\libogc\lib\wii `\ | |
| 163 | + | `-FlC:\devkitPro\devkitPPC\lib\gcc\powerpc-eabi\4.5.1 `\ | |
| 164 | + | `-FlC:\devkitPro\devkitPPC\powerpc-eabi\lib ` | |
| 165 | + | ||
| 166 | + | ### Building libogcfpc | |
| 167 | + | ||
| 168 | + | Make a last .bat file (e.g. build_libs.bat) and put in a directory of your choice, replacing the paths accordingly to yours: | |
| 169 | + | ||
| 170 | + | `:: build_libs.bat`\ | |
| 171 | + | `@ECHO off`\ | |
| 172 | + | ||
| 173 | + | `:: FPC installation directory`\ | |
| 174 | + | `SET FPC_INST_DIR=C:\fpc4wii`\ | |
| 175 | + | `:: FPC sources directory`\ | |
| 176 | + | `SET FPC_SRC_DIR=C:\fpc_sources_from_trunk`\ | |
| 177 | + | `:: Binutils directory`\ | |
| 178 | + | `SET BINUTILS_DIR=C:\devkitPro\devkitPPC\bin`\ | |
| 179 | + | `:: Binutils prefix`\ | |
| 180 | + | `SET TOOL_PREFIX=powerpc-eabi-`\ | |
| 181 | + | ||
| 182 | + | `SET PATH=%PATH%;%FPC_INST_DIR%\bin\powerpc-wii`\ | |
| 183 | + | ||
| 184 | + | `:: libogcfpc requires "mad" package, so move to trunk/packages/mad and build it`\ | |
| 185 | + | `CD %FPC_SRC_DIR%\packages\mad`\ | |
| 186 | + | ||
| 187 | + | `:: Recreate makefile...`\ | |
| 188 | + | `fpcmake -r -w -Twii`\ | |
| 189 | + | ` `\ | |
| 190 | + | `:: Cleaning...`\ | |
| 191 | + | `make distclean all OS_TARGET=wii CPU_TARGET=powerpc BINUTILSPREFIX=powerpc-eabi- PP=ppcppc.exe `\ | |
| 192 | + | `MKDIR %FPC_INST_DIR%\units\powerpc-wii\mad`\ | |
| 193 | + | `XCOPY /Y %FPC_SRC_DIR%\packages\mad\units\powerpc-wii*.* %FPC_INST_DIR%\units\powerpc-wii\mad`\ | |
| 194 | + | ||
| 195 | + | `:: Create Package.fpc...`\ | |
| 196 | + | `fpcmake -pv -Twii`\ | |
| 197 | + | `COPY /Y %FPC_SRC_DIR%\packages\mad\Package.fpc %FPC_INST_DIR%\units\powerpc-wii\mad\Package.fpc`\ | |
| 198 | + | ||
| 199 | + | `pause`\ | |
| 200 | + | ||
| 201 | + | `:: now build libogcfpc...`\ | |
| 202 | + | `CD %FPC_SRC_DIR%\packages\libogcfpc`\ | |
| 203 | + | ||
| 204 | + | `:: Recreate makefile...`\ | |
| 205 | + | `fpcmake -r -w -Twii`\ | |
| 206 | + | ||
| 207 | + | `:: Cleaning...`\ | |
| 208 | + | `make distclean all OS_TARGET=wii CPU_TARGET=powerpc BINUTILSPREFIX=powerpc-eabi- PP=ppcppc.exe `\ | |
| 209 | + | `MKDIR %FPC_INST_DIR%\units\powerpc-wii\libogcfpc`\ | |
| 210 | + | `XCOPY /Y %FPC_SRC_DIR%\packages\libogcfpc\units\powerpc-wii*.* %FPC_INST_DIR%\units\powerpc-wii\libogcfpc`\ | |
| 211 | + | ||
| 212 | + | `:: Create Package.fpc...`\ | |
| 213 | + | `fpcmake -pv -Twii`\ | |
| 214 | + | `COPY /Y %FPC_SRC_DIR%\packages\libogcfpc\Package.fpc %FPC_INST_DIR%\units\powerpc-wii\libogcfpc\Package.fpc`\ | |
| 215 | + | ||
| 216 | + | `:: Done!`\ | |
| 217 | + | `pause` | |
| 218 | + | ||
| 219 | + | Execute it to build and install the required packages. | |
| 220 | + | ||
| 221 | + | ## Building and running the examples | |
| 222 | + | ||
| 223 | + | The examples can be built by calling | |
| 224 | + | ||
| 225 | + | ` SET PATH=%PATH%;%FPC_INST_DIR%\bin\powerpc-wii`\ | |
| 226 | + | ` make OS_TARGET=wii CPU_TARGET=powerpc BINUTILSPREFIX=powerpc-eabi- PP=ppcppc.exe ` | |
| 227 | + | ||
| 228 | + | where %FPC_INST_DIR% is the directory where the powerpc crosscompiler is installed. | |
| 229 | + | ||
| 230 | + | The examples are running fine on a real Wii with the [Homebrew Channel](http://wiibrew.org/wiki/Homebrew_Channel) installed. As alternative, you can use the [Dolphin emulator](http://dolphin-emu.org/). In this case, please read carefully the [notes](http://wiibrew.org/wiki/Dolphin#Compatibility) on <http://wiibrew.org> | |
| 231 | + | ||
| 232 | + | --- | |
| 233 | + | *From the Free Pascal wiki, page "Wii", as it stood on 2013-04-06 after a change by Jwdietrich, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* | |
| 234 | + | Category: Operating Systems and Platforms |
