Update Makefile. Add informations about compilation. Some more general informations.

This commit is contained in:
retro100 2021-02-09 13:25:05 +01:00
parent 3c10dfd73d
commit 2bdcf47ba0
6 changed files with 304 additions and 7 deletions

178
INSTALL_Wii.md Normal file
View File

@ -0,0 +1,178 @@
# Compile Dosbox for Wii
This document describes the following points:
- Setup Wii Development Environment
- Install dependencies for compilation
- Compilation and installation of SDL Wii
- Compilation of Dosbox
Some commands are debian/ubuntu specific (apt command). If you use another linux distribution this commands must be replaced with the correct ones.
## Setup Wii Development Environment
devkitPro is required for Dosbox Wii compilation.
General informations about devkitPro:
https://devkitpro.org/wiki/Getting_Started
Installing devkitPro pacman (which is the package manager used by devkitPro)
Debian Package can be found at https://github.com/devkitPro/pacman/releases
All shell commands with a # must be entered as root or with sudo. The $ promt is the normal user.
```
# apt update
# apt install gdebi-core
$ wget https://github.com/devkitPro/pacman/releases/download/v1.0.2/devkitpro-pacman.amd64.deb
# gdebi devkitpro-pacman.amd64.deb
```
For a short introduction see: https://devkitpro.org/wiki/devkitPro_pacman#Using_Pacman
To resync the databases
```
# dkp-pacman -Sy
```
Install the packages for Wii development with the package wii-dev.
The group package wii-dev installs all necessary basic packages for wii development.
```
# dkp-pacman -S wii-dev
```
This will install following packages: devkitppc-rules, libfat-ogc, libogc, ppc-pkg-config, wii-examples, wii-pkg-config, devkit-env, devkitPPC, devkitPPC-gdb, gamecube-tools, general-tools, wiiload
```
To use the toolchains right away, use
$ source /etc/profile.d/devkit-env.sh
```
After the installation you can check your installed packages inclusive version numbers like this:
```
# dkp-pacman -Q
devkit-env 1.0.1-2
devkitPPC r38-1
devkitPPC-gdb 9.2-1
devkitppc-rules 1.1.0-1
devkitpro-keyring 20180316-1
gamecube-tools 1.0.2-1
general-tools 1.2.0-2
libfat-ogc 1.1.5-2
libogc 2.1.0-1
ppc-pkg-config 0.28-5
wii-examples 20200609-1
wii-pkg-config 0.28-5
wiiload 0.5.1-2
```
Search a package (e.g. freetype)
```
# dkp-pacman -Ss freetype
dkp-libs/3ds-freetype 2.9-2 (3ds-portlibs)
TrueType font rendering library (mingw-w64)
dkp-libs/nds-freetype 2.9-1 (nds-portlibs)
FreeType is a freely available software library to render fonts.
dkp-libs/ppc-freetype 2.9.1-2 (ppc-portlibs)
FreeType is a freely available software library to render fonts.
dkp-libs/switch-freetype 2.10.1-1
FreeType is a freely available software library to render fonts.
```
## Install dependencies for compilation
For Dosbox compilation the libraries freetype, libvorbisidec, sdl wii and there dependencies must be installed. The SDL version from pacman **can't** be used.
With the package manager freetype and libvorbisidec must be installed. The installation of these libraries also installs there dependencies.
```
# dkp-pacman -S ppc-freetype
```
Does also install there dependencies: ppc-bzip2, ppc-zlib, ppc-libpng
```
# dkp-pacman -S ppc-libvorbisidec
```
Does also install there dependencies: ppc-libogg
Currently the SDL Wii port **can't** be installed per dkp-pacman! **Don't** install the package wii-sdl.
The reason is this. Dosbox Wii currently uses functions from the SDL library that are not officially provided with header files. These functions are WII_AudioStart(), WII_AudioStop(), WII_VideoStart() and WII_VideoStop() and used in src/platform/wii/wiihardware.cpp. The wii-sdl package doesn't provide export these functions. This results in undefined references at linking. To prevent this the library from github should be used. The current version from the master branch https://github.com/dborth/sdl-wii works fine. It also exports the functions WII_AudioStart(), WII_AudioStop(), WII_VideoStart() and WII_VideoStop() (A header file is not provided for these functions. This is no problem because src/platform/wii/wiihardware.cpp make its own prototyp declarations for these functions.)
## Compilation and installation of SDL Wii
Install git which is needed to check out the source code of SDL Wii.
```
# apt install git
```
Checkout SDL Wii.
```
~$ git clone https://github.com/dborth/sdl-wii.git
```
Setup devkitPro Development Environment for compiling a Wii project and compile SDL Wii.
```
$ source /etc/profile.d/devkit-env.sh
~$ cd sdl-wii/SDL
~/sdl-wii/SDL$ make
```
Install SDL Wii into the correct directories from devkitPro.
```
~/sdl-wii/SDL# make install
'lib/libSDL.a' -> '/opt/devkitpro/portlibs/wii/lib/libSDL.a'
'include/SDL.h' -> '/opt/devkitpro/portlibs/wii/include/SDL/SDL.h'
'include/SDL_active.h' -> '/opt/devkitpro/portlibs/wii/include/SDL/SDL_active.h'
...
...
...
'include/begin_code.h' -> '/opt/devkitpro/portlibs/wii/include/SDL/begin_code.h'
'include/close_code.h' -> '/opt/devkitpro/portlibs/wii/include/SDL/close_code.h'
```
Now all dependencies for compiling the dosbox are installed.
## Compilation of Dosbox
For compiling dosbox-wii with the current devkitPro version and the current lib versions use the fork version of dosbox-wii from retro100 or the version from dborth if the changes from retro100 are already applied at github repo dborth/dosbox-wii.
```
~$ git clone https://github.com/retro100/dosbox-wii.git
```
or use the dborth/dosbox-wii repo (if the changes from retro100 are already applied at github)
```
~$ git clone https://github.com/dborth/dosbox-wii.git
```
Setup devkitPro Development Environment for compiling a Wii project. (if not already done)
```
~$ source /etc/profile.d/devkit-env.sh
```
Go into the dosbox-wii folder and compile the Dosbox with the commando make
```
~/dosbox-wii$ make
```
If the compilation is successful the file `dosbox-wii.dol` is created.
Now `dosbox-wii.dol` can be executed on the Wii. The easiest way is to replace the `boot.dol` file of an existing dosbox-wii installation (sd:/apps/dosbox-wii) with this file. In this case the name `dosbox-wii.dol` must also be renamed to `boot.dol` accordingly.
If you want do compile Dosbox with older devkitPro and lib versions (like the dosbox-wii 1.7 version was compiled) then open the Makefile and change `LIBS_VER:=CUR` to `LIBS_VER:=OLD`. This would only work if you really have the old versions installed. If you change this use `make clean` after changing.

View File

@ -9,6 +9,23 @@ endif
include $(DEVKITPPC)/wii_rules
#---------------------------------------------------------------------------------
# LIBS_VER can be CUR or OLD
#---------------------------------------------------------------------------------
LIBS_VER=CUR
INCLUDES_EXTRA_CUR := -I$(PORTLIBS_PATH)/wii/include/SDL
CFLAGS_EXTRA_CUR := `freetype-config --cflags` -DDEFINE_GLOBALS -DNEW_DEVOPTAB_API
LIBS_CUR := -lSDL -lfat -lwiiuse -lbte -lasnd -logc -lwiikeyboard \
-lvorbisidec -logg -laesnd \
`freetype-config --libs`
INCLUDES_EXTRA_OLD := -I$(LIBOGC_INC)/SDL -I$(PORTLIBS)/include/freetype2
CFLAGS_EXTRA_OLD :=
LIBS_OLD := -lSDL -lfat -lwiiuse -lbte -lasnd -logc -lwiikeyboard \
-lpng -lvorbisidec -lfreetype -lz
#---------------------------------------------------------------------------------
# TARGET is the name of the output
# BUILD is the directory where object files & intermediate files will be placed
@ -30,16 +47,15 @@ INCLUDES := include src/platform/wii
#---------------------------------------------------------------------------------
CFLAGS = -g -O3 -Wall $(MACHDEP) $(INCLUDE) \
-Wno-strict-aliasing -DWORDS_BIGENDIAN
-Wno-strict-aliasing -DWORDS_BIGENDIAN \
$(CFLAGS_EXTRA_$(LIBS_VER))
CXXFLAGS = $(CFLAGS)
LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map
#---------------------------------------------------------------------------------
# any extra libraries we wish to link with
#---------------------------------------------------------------------------------
LIBS := -lSDL -lfat -lwiiuse -lbte -lasnd -logc -lwiikeyboard \
-lpng -lvorbisidec -lfreetype -lz \
-lm -logg -lbz2 -laesnd
LIBS := $(LIBS_$(LIBS_VER))
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
@ -93,7 +109,8 @@ export OFILES := $(addsuffix .o,$(BINFILES)) \
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
-I$(CURDIR)/$(BUILD) \
-I$(LIBOGC_INC) -I$(LIBOGC_INC)/SDL -I$(PORTLIBS)/include/freetype2
-I$(LIBOGC_INC) \
$(INCLUDES_EXTRA_$(LIBS_VER))
#---------------------------------------------------------------------------------
# build a list of library paths

28
README
View File

@ -1,7 +1,7 @@
==============================================================================
- DOSBox Wii -
Version 1.7
Current Version based on r4301 and jmarsh patches for dynrec
http://code.google.com/p/dosbox-wii
(Under GPL License)
@ -17,12 +17,36 @@ A port of DOSBox to the Wii using SDL Wii.
* Most DOS games are playable
* Home menu, with on-screen keyboard
-=[ Performance on Wii and vWii ]=-
* Wii with core=dynamic (Dynamic Recompiler) and cycles=max.
Wii get 2.9 fps by PCPBench.
A Dosbox on Wii represents something like between a
486 DX/33 System (>= 2.5 fps) and
486 DX2/66 System (>= 4.0 fps) by PCPBench.
* WiiU with core=dynamic (Dynamic Recompiler) and
cycles=max and full CPU Speed with WiiVC and cafe2wii.
WiiU/vWii get 5.7 fps by PCPBench.
A Dosbox on WiiU represents something like between a
486 DX2/66 System (>= 4.0 fps) and
486 DX4/100 System (>= 7.5 fps) by PCPBench.
* For more informations see docs/Benchmark_Wii_WiiU.txt.
-=[ Compilation and Installation for Wii ]=-
* For more informations about compilation and installation for Wii
see INSTALL_Wii.md.
-=[ Update History ]=-
[current master - 2021]
* Updated to latest libogc and devkitPPC
BUG: Virtual Keyboard doesn't work with current/updated libs/devkitPPC.
* Convert CRLF line terminators to unix line terminators (like at original SVN repo)
* Sync to DOSBox SVN r4301
* Sync to DOSBox SVN r4301 (which is > 0.74-3 (r4250))
For more informations about sync r4301 see docs/PORTING_Wii.txt.
* Add PowerPC Dynamic Recompiler patch from jmarsh (ppc_dynrec.diff and drive_fat_BE.diff)
see: https://www.vogons.org/viewtopic.php?t=65057

View File

@ -0,0 +1,41 @@
PCPBench 1.03c on Wii
---------o---------------------------------------o-------------------o
version: | Dosbox WII r4301 with dynrec | Dosbox WII 1.7 |
| master branch | |
---------o---------o---------o---------o---------o---------o---------o
core: | dynamic | dynamic | normal | normal | normal | normal |
cylces: | max | max | max | max | max | max |
extender:| Dos/32A | DOS4GW | Dos/32A | DOS4GW | Dos/32A | DOS4GW |
result 1:| 3.0 fps | 2.8 fps | 0.7 fps | 0.3 fps | 0.3 fps | 0.2 fps |
result 2:| 3.1 fps | 2.9 fps | 0.8 fps | 0.5 fps | 0.2 fps | 0.3 fps |
result 3:| 3.1 fps | 2.8 fps | 0.6 fps | 0.5 fps | 0.3 fps | 0.2 fps |
PCPBench 1.03c on WiiU/vWii
---------o-------------------------------------------------o-------------------o
version: | Dosbox WII r4301 with dynrec | Retroarch Dosbox |
| master branch | on WiiU |
| | original| |
| Overclocked vWii | vWii | | |
| 1.24 GHz instead of 729 MHz | 729 MHz | SVN | non-SVN |
| per WiiVC (cafe2wii) | no over.| Version | Version |
---------o---------o---------o---------o---------o---------o---------o---------o
core: | dynamic | dynamic | normal | normal | dynamic | normal | normal |
cylces: | max | max | max | max | max | max | max |
extender:| Dos/32A | DOS4GW | Dos/32A | DOS4GW | Dos/32A | Dos/32A | DOS/32A |
result 1:| 5.7 fps | 5.6 fps | 2.1 fps | 2.0 fps | 3.2 fps | 2.3 fps | 0.2 fps |
result 2:| 5.7 fps | 5.6 fps | 2.1 fps | 2.0 fps | 3.1 fps | | |
result 3:| 5.8 fps | 5.6 fps | 2.1 fps | 2.0 fps | 3.1 fps | | |
PC classes from PCPBench 1.03c:
class 1: 486 DX/33 System minimum 2.5 fps
class 2: 486 DX2/66 System minimum 4.0 fps
class 3: 486 DX4/100 System minimum 7.5 fps
class 4: Pentium 90 System minimum 10.0 fps
class 5: Pentium 133 System minimum 16.0 fps

33
docs/PORTING_Wii.txt Normal file
View File

@ -0,0 +1,33 @@
Most files are equal to the original dosbox svn repository (r4301).
Some files are modified (or doesn't exist at the original repo).
Modified files compared against the original
svn repository (revision 4301) are:
include/paging.h
include/render.h
include/setup.h
src/cpu/core_full/ea_lookup.h
src/cpu/core_full/string.h
src/cpu/core_normal/string.h
src/cpu/cpu.cpp
src/dos/dos_programs.cpp
src/dos/drive_cache.cpp
src/dosbox.cpp
src/gui/render_scalers.cpp
src/gui/render_scalers.h
src/gui/sdl_gui.cpp
src/gui/sdlmain.cpp
src/ints/bios.cpp
src/misc/cross.cpp
src/shell/shell.cpp
The directory and all files from src/platform/wii
are not included (doesn't exist) at the original
dosbox svn repository.
src/platform/wii/config.h is adapted for updated revision.
The necessary updates for src/platform/wii/config.h
are from src/platform/visualc/config.h.

View File

@ -149,7 +149,11 @@ static void * PressKeys (void *arg)
static bool gecko = false;
static mutex_t gecko_mutex = 0;
#ifdef NEW_DEVOPTAB_API
static ssize_t __out_write(struct _reent *r, void* fd, const char *ptr, size_t len)
#else
static ssize_t __out_write(struct _reent *r, int fd, const char *ptr, size_t len)
#endif
{
u32 level;