Wii: what changed
Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | 1 | *This is a work in progress porting. No download available yet.* | |
| 2 | 2 | ||
| 3 | 3 | ## Wii specs | |
| 4 | 4 | ||
| 5 | 5 | *(from Wikipedia)* | |
| 6 | 6 | ||
| 7 | 7 | **Processors** | |
| 8 | 8 | ||
| 9 | 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 | 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 | 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 | 12 | ||
| 13 | 13 | **Memory** | |
| 14 | 14 | ||
| 15 | 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 | 16 | - 3 MB of embedded memory for GPU texture and framebuffer. | |
| 17 | 17 | ||
| 18 | 18 | **Storage** | |
| 19 | 19 | ||
| 20 | 20 | - 512 MB built-in NAND flash memory | |
| 21 | 21 | - Expanded storage via SD and SDHC card memory (up to 32 GB) | |
| 22 | 22 | - Nintendo GameCube Memory Card (required for GameCube game saves) | |
| 23 | 23 | - Slot-loading disc drive compatible with 8 cm Nintendo GameCube Game Disc and 12 cm Wii Optical Disc | |
| 24 | 24 | - Mask ROM by Macronix | |
| 25 | 25 | ||
| 26 | 26 | **Video Resolution** | |
| 27 | 27 | ||
| 28 | 28 | - 480p (PAL/NTSC), 480i (PAL/NTSC) or 576i (PAL/SECAM), standard 4:3 and 16:9 anamorphic widescreen | |
| 29 | 29 | ||
| 30 | 30 | **Audio** | |
| 31 | 31 | ||
| 32 | 32 | - Main: Stereo – Dolby Pro Logic II-capable | |
| 33 | 33 | - Controller: Built-in speaker | |
| 34 | 34 | ||
| 35 | 35 | ## Status | |
| 36 | 36 | ||
| 37 | 37 | Compiler and RTL are working. libogc library needs some work here and there, but it seems working fine too. | |
| 38 | 38 | ||
| 39 | 39 | ## How to build the compiler from SVN | |
| 40 | 40 | ||
| 41 | 41 | ### Pre requisites | |
| 42 | 42 | ||
| 43 | 43 | #### fpc sources from SVN trunk | |
| 44 | 44 | ||
| 45 | 45 | Get fpc sources from SVN trunk repository: | |
| 46 | 46 | ||
| 47 | - | ||
| 47 | + | ```text | |
| 48 | + | svn checkout http://svn.freepascal.org/svn/fpc/trunk fpc | |
| 49 | + | ``` | |
| 48 | 50 | ||
| 49 | 51 | #### devkitPPC | |
| 50 | 52 | ||
| 51 | 53 | 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 | 54 | ||
| 53 | 55 | #### fpc binaries | |
| 54 | 56 | ||
| 55 | 57 | Install the last stable release. | |
| 56 | 58 | ||
| 57 | 59 | ### Updating fpcmake | |
| 58 | 60 | ||
| 59 | 61 | 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 | 62 | ||
| 61 | - | ||
| 63 | + | ```text | |
| 64 | + | make clean all | |
| 65 | + | ``` | |
| 62 | 66 | ||
| 63 | 67 | 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 | 68 | ||
| 65 | 69 | ### Building the compiler | |
| 66 | 70 | ||
| 67 | 71 | Make a .bat file (e.g. build_compiler.bat) in a directory of your choice, replacing the paths accordingly to yours: | |
| 68 | 72 | ||
| 69 | - | ||
| 70 | - | ||
| 73 | + | ```text | |
| 74 | + | :: build_compiler.bat | |
| 75 | + | @ECHO off | |
| 71 | 76 | ||
| 72 | - | ||
| 73 | - | ||
| 74 | - | ||
| 75 | - | ||
| 76 | - | ||
| 77 | - | ||
| 78 | - | ||
| 79 | - | ||
| 77 | + | :: FPC installation directory | |
| 78 | + | SET FPC_INST_DIR=C:\fpc4wii | |
| 79 | + | :: FPC sources directory | |
| 80 | + | SET FPC_SRC_DIR=C:\fpc_sources_from_trunk | |
| 81 | + | :: Binutils directory | |
| 82 | + | SET BINUTILS_DIR=C:\devkitPro\devkitPPC\bin | |
| 83 | + | :: Binutils prefix | |
| 84 | + | SET TOOL_PREFIX=powerpc-eabi- | |
| 80 | 85 | ||
| 81 | - | ||
| 86 | + | SET PATH=%BINUTILS_DIR%;%PATH% | |
| 82 | 87 | ||
| 83 | - | ||
| 88 | + | CD /D %FPC_SRC_DIR%\compiler | |
| 84 | 89 | ||
| 85 | - | ||
| 86 | - | ||
| 90 | + | :: Recreate makefile... | |
| 91 | + | fpcmake -r -w -Tall | |
| 87 | 92 | ||
| 88 | - | ||
| 89 | - | ||
| 93 | + | :: Cleaning... | |
| 94 | + | make distclean | |
| 90 | 95 | ||
| 91 | - | ||
| 92 | - | ||
| 96 | + | :: Building the compiler... | |
| 97 | + | make PPC_TARGET=powerpc | |
| 93 | 98 | ||
| 94 | - | ||
| 99 | + | pause | |
| 95 | 100 | ||
| 96 | - | ||
| 97 | - | ||
| 98 | - | ||
| 99 | - | ||
| 100 | - | ||
| 101 | - | ||
| 102 | - | ||
| 103 | - | ||
| 104 | - | ||
| 105 | - | ||
| 106 | - | ||
| 101 | + | :: Making install directories and copying files... | |
| 102 | + | MKDIR %FPC_INST_DIR%\bin\powerpc-wii | |
| 103 | + | :: copying the compiler... | |
| 104 | + | COPY /Y %FPC_SRC_DIR%\compiler\ppcppc.exe %FPC_INST_DIR%\bin\powerpc-wii\ppcppc.exe | |
| 105 | + | :: copying fpc utils... | |
| 106 | + | XCOPY /Y %FPC_SRC_DIR%\compiler\utils*.exe %FPC_INST_DIR%\bin\powerpc-wii\ | |
| 107 | + | :: copying binutils... | |
| 108 | + | XCOPY /Y %BINUTILS_DIR%*.* %FPC_INST_DIR%\bin\powerpc-wii\ | |
| 109 | + | :: copying messages... | |
| 110 | + | MKDIR %FPC_INST_DIR%\msg | |
| 111 | + | XCOPY /Y %FPC_SRC_DIR%\compiler\msg*.* %FPC_INST_DIR%\msg\ | |
| 107 | 112 | ||
| 108 | - | ||
| 109 | - | ||
| 113 | + | :: Done! | |
| 114 | + | pause | |
| 115 | + | ``` | |
| 110 | 116 | ||
| 111 | 117 | Now execute it to build and install the compiler. | |
| 112 | 118 | ||
| 113 | 119 | ### Building the runtime library | |
| 114 | 120 | ||
| 115 | 121 | Make another .bat file (e.g. build_rtl.bat) and put in a directory of your choice, replacing the paths accordingly to yours: | |
| 116 | 122 | ||
| 117 | - | ||
| 118 | - | ||
| 123 | + | ```text | |
| 124 | + | :: build_rtl.bat | |
| 125 | + | @ECHO off | |
| 119 | 126 | ||
| 120 | - | ||
| 121 | - | ||
| 127 | + | :: FPC installation directory | |
| 128 | + | SET FPC_INST_DIR=C:\fpc4wii | |
| 122 | 129 | ||
| 123 | - | ||
| 124 | - | ||
| 130 | + | :: FPC sources directory | |
| 131 | + | SET FPC_SRC_DIR=C:\fpc_sources_from_trunk | |
| 125 | 132 | ||
| 126 | - | ||
| 127 | - | ||
| 133 | + | :: Binutils directory | |
| 134 | + | SET BINUTILS_DIR=C:\devkitPro\devkitPPC\bin | |
| 128 | 135 | ||
| 129 | - | ||
| 130 | - | ||
| 136 | + | :: Binutils prefix | |
| 137 | + | SET TOOL_PREFIX=powerpc-eabi- | |
| 131 | 138 | ||
| 132 | - | ||
| 139 | + | SET PATH=%BINUTILS_DIR%;%PATH% | |
| 133 | 140 | ||
| 134 | - | ||
| 141 | + | CD %FPC_SRC_DIR%\rtl\wii | |
| 135 | 142 | ||
| 136 | - | ||
| 143 | + | fpcmake -r -w -Tall | |
| 137 | 144 | ||
| 138 | - | ||
| 139 | - | ||
| 140 | - | ||
| 141 | - | ||
| 145 | + | make clean | |
| 146 | + | make CPU_TARGET=powerpc OS_TARGET=wii PP="%FPC_INST_DIR%\bin\powerpc-wii\ppcppc.exe" OPT="-Twii -CX -XX -O2" BINUTILSPREFIX=%TOOL_PREFIX% | |
| 147 | + | MKDIR %FPC_INST_DIR%\units\powerpc-wii | |
| 148 | + | XCOPY /Y %FPC_SRC_DIR%\rtl\units\powerpc-wii*.* %FPC_INST_DIR%\units\powerpc-wii\ | |
| 142 | 149 | ||
| 143 | - | ||
| 144 | - | ||
| 145 | - | ||
| 150 | + | :: Create Package.fpc... | |
| 151 | + | fpcmake -pv -Twii | |
| 152 | + | COPY /Y %FPC_SRC_DIR%\rtl\wii\Package.fpc %FPC_INST_DIR%\units\powerpc-wii\Package.fpc | |
| 146 | 153 | ||
| 147 | - | ||
| 148 | - | ||
| 154 | + | :: Done! | |
| 155 | + | pause | |
| 156 | + | ``` | |
| 149 | 157 | ||
| 150 | 158 | Execute it to build and install the RTL. | |
| 151 | 159 | ||
| 152 | 160 | ### Adding fpc.cfg file | |
| 153 | 161 | ||
| 154 | 162 | Go to the new binaries directory (e.g. C:\fpc4wii\bin\powerpc-wii), make a new fpc.cfg file and edit it: | |
| 155 | 163 | ||
| 156 | - | ||
| 157 | - | ||
| 158 | - | ||
| 159 | - | ||
| 160 | - | ||
| 161 | - | ||
| 162 | - | ||
| 163 | - | ||
| 164 | - | ||
| 164 | + | ```text | |
| 165 | + | -Twii | |
| 166 | + | -XPpowerpc-eabi- | |
| 167 | + | -FuC:\fpc4wii\units\powerpc-wii | |
| 168 | + | -FuC:\fpc4wii\units\powerpc-wii\libogcfpc | |
| 169 | + | -FuC:\fpc4wii\units\powerpc-wii\mad | |
| 170 | + | -FDC:\fpc4wii\bin\powerpc-wii | |
| 171 | + | -FlC:\devkitPro\libogc\lib\wii | |
| 172 | + | -FlC:\devkitPro\devkitPPC\lib\gcc\powerpc-eabi\4.5.1 | |
| 173 | + | -FlC:\devkitPro\devkitPPC\powerpc-eabi\lib | |
| 174 | + | ``` | |
| 165 | 175 | ||
| 166 | 176 | ### Building libogcfpc | |
| 167 | 177 | ||
| 168 | 178 | 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 | 179 | ||
| 170 | - | ||
| 171 | - | ||
| 180 | + | ```text | |
| 181 | + | :: build_libs.bat | |
| 182 | + | @ECHO off | |
| 172 | 183 | ||
| 173 | - | ||
| 174 | - | ||
| 175 | - | ||
| 176 | - | ||
| 177 | - | ||
| 178 | - | ||
| 179 | - | ||
| 180 | - | ||
| 184 | + | :: FPC installation directory | |
| 185 | + | SET FPC_INST_DIR=C:\fpc4wii | |
| 186 | + | :: FPC sources directory | |
| 187 | + | SET FPC_SRC_DIR=C:\fpc_sources_from_trunk | |
| 188 | + | :: Binutils directory | |
| 189 | + | SET BINUTILS_DIR=C:\devkitPro\devkitPPC\bin | |
| 190 | + | :: Binutils prefix | |
| 191 | + | SET TOOL_PREFIX=powerpc-eabi- | |
| 181 | 192 | ||
| 182 | - | ||
| 193 | + | SET PATH=%PATH%;%FPC_INST_DIR%\bin\powerpc-wii | |
| 183 | 194 | ||
| 184 | - | ||
| 185 | - | ||
| 195 | + | :: libogcfpc requires "mad" package, so move to trunk/packages/mad and build it | |
| 196 | + | CD %FPC_SRC_DIR%\packages\mad | |
| 186 | 197 | ||
| 187 | - | ||
| 188 | - | ||
| 189 | - | ||
| 190 | - | ||
| 191 | - | ||
| 192 | - | ||
| 193 | - | ||
| 198 | + | :: Recreate makefile... | |
| 199 | + | fpcmake -r -w -Twii | |
| 200 | + | ||
| 201 | + | :: Cleaning... | |
| 202 | + | make distclean all OS_TARGET=wii CPU_TARGET=powerpc BINUTILSPREFIX=powerpc-eabi- PP=ppcppc.exe | |
| 203 | + | MKDIR %FPC_INST_DIR%\units\powerpc-wii\mad | |
| 204 | + | XCOPY /Y %FPC_SRC_DIR%\packages\mad\units\powerpc-wii*.* %FPC_INST_DIR%\units\powerpc-wii\mad | |
| 194 | 205 | ||
| 195 | - | ||
| 196 | - | ||
| 197 | - | ||
| 206 | + | :: Create Package.fpc... | |
| 207 | + | fpcmake -pv -Twii | |
| 208 | + | COPY /Y %FPC_SRC_DIR%\packages\mad\Package.fpc %FPC_INST_DIR%\units\powerpc-wii\mad\Package.fpc | |
| 198 | 209 | ||
| 199 | - | ||
| 210 | + | pause | |
| 200 | 211 | ||
| 201 | - | ||
| 202 | - | ||
| 212 | + | :: now build libogcfpc... | |
| 213 | + | CD %FPC_SRC_DIR%\packages\libogcfpc | |
| 203 | 214 | ||
| 204 | - | ||
| 205 | - | ||
| 215 | + | :: Recreate makefile... | |
| 216 | + | fpcmake -r -w -Twii | |
| 206 | 217 | ||
| 207 | - | ||
| 208 | - | ||
| 209 | - | ||
| 210 | - | ||
| 218 | + | :: Cleaning... | |
| 219 | + | make distclean all OS_TARGET=wii CPU_TARGET=powerpc BINUTILSPREFIX=powerpc-eabi- PP=ppcppc.exe | |
| 220 | + | MKDIR %FPC_INST_DIR%\units\powerpc-wii\libogcfpc | |
| 221 | + | XCOPY /Y %FPC_SRC_DIR%\packages\libogcfpc\units\powerpc-wii*.* %FPC_INST_DIR%\units\powerpc-wii\libogcfpc | |
| 211 | 222 | ||
| 212 | - | ||
| 213 | - | ||
| 214 | - | ||
| 223 | + | :: Create Package.fpc... | |
| 224 | + | fpcmake -pv -Twii | |
| 225 | + | COPY /Y %FPC_SRC_DIR%\packages\libogcfpc\Package.fpc %FPC_INST_DIR%\units\powerpc-wii\libogcfpc\Package.fpc | |
| 215 | 226 | ||
| 216 | - | ||
| 217 | - | ||
| 227 | + | :: Done! | |
| 228 | + | pause | |
| 229 | + | ``` | |
| 218 | 230 | ||
| 219 | 231 | Execute it to build and install the required packages. | |
| 220 | 232 | ||
| 221 | 233 | ## Building and running the examples | |
| 222 | 234 | ||
| 223 | 235 | The examples can be built by calling | |
| 224 | 236 | ||
| 225 | - | ||
| 226 | - | ||
| 237 | + | ```text | |
| 238 | + | SET PATH=%PATH%;%FPC_INST_DIR%\bin\powerpc-wii | |
| 239 | + | make OS_TARGET=wii CPU_TARGET=powerpc BINUTILSPREFIX=powerpc-eabi- PP=ppcppc.exe | |
| 240 | + | ``` | |
| 227 | 241 | ||
| 228 | 242 | where %FPC_INST_DIR% is the directory where the powerpc crosscompiler is installed. | |
| 229 | 243 | ||
| 230 | 244 | 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 | 245 | ||
| 232 | 246 | --- | |
| 233 | 247 | *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 | 248 | Category: Operating Systems and Platforms |
