Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] AmigaOS 4.x support #50

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,15 @@ elseif(WIN32)
endif()
elseif(AMIGA OR AROS)
install(FILES ${PROJECT_SOURCE_DIR}/resources/packaging/amigaos/milkytracker.info DESTINATION .)

if(AMIGAOS4 OR MORPHOS)
if(AMIGAOS4)
#add_custom_command()
endif()

find_package(SDL 2.0 REQUIRED)
find_package(OpenGL REQUIRED)
endif()

# AROS will provide the SDL dependency via makefile.
else()
Expand Down
8 changes: 8 additions & 0 deletions JenkinsEnv.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
"BuildIfSuccessful": "",
"BuildParam": "-DM68K_CPU=68040 -DM68K_FPU=hard"
},
{
"DockerRoot": "amigadev",
"DockerImage": "crosstools",
"DockerTag": "ppc-amigaos",
"Dockerfile": "",
"BuildIfSuccessful": "",
"BuildParam": ""
},
{
"DockerRoot": "amigadev",
"DockerImage": "crosstools",
Expand Down
195 changes: 0 additions & 195 deletions cmake/FindSDL.cmake

This file was deleted.

36 changes: 24 additions & 12 deletions platforms/ppc-amigaos/prep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,32 @@ cp -fvr MiniGL/SDK/local/common/include/* ${SYSROOT}/include/
cp -fvr MiniGL/SDK/local/newlib/lib/* ${SYSROOT}/lib/
cd "${SUBMODULES}"

#SDL2.0
rm -rf SDL2
mkdir -p "${SUBMODULES}"/SDL2
cd "${SUBMODULES}"/SDL2
wget http://os4depot.net/share/library/misc/sdl2.lha -O sdl2.lha
lha -x sdl2.lha
mkdir -p ${SYSROOT}/usr/include
mkdir -p ${SYSROOT}/usr/lib
rm -rf ${SYSROOT}/include/SDL
cp -fvr SDL2/SDK/local/newlib/include/* ${SYSROOT}/include/
mv -fv ${SYSROOT}/include/SDL2 ${SYSROOT}/include/SDL
cp -fvr SDL2/SDK/local/newlib/lib/* ${SYSROOT}/lib/
mv -fv ${SYSROOT}/lib/libSDL2-2.0.so ${SYSROOT}/lib/libSDL.so
mv -fv ${SYSROOT}/lib/libSDL2.a ${SYSROOT}/lib/libSDL.a
cd "${SUBMODULES}"

# SDL1.2
if [ ! -d "${SUBMODULES}/SDL" ]; then
git clone https://github.com/AmigaPorts/SDL.git "${SUBMODULES}"/SDL
fi
cd "${SUBMODULES}"/SDL
git checkout SDL-1.2-AmigaOS3
git pull
rm -rf "${SUBMODULES}"/SDL/build
mkdir -p "${SUBMODULES}"/SDL/build
cd "${SUBMODULES}"/SDL/build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${SYSROOT} -DTOOLCHAIN_COMMON="${M68K_COMMON} -O3 -fno-exceptions -w -DBIG_ENDIAN -DAMIGA -fpermissive -std=c++14"
cmake --build . --config Release --target install -- -j$(getconf _NPROCESSORS_ONLN)
cd "${SUBMODULES}"
#if [ ! -d "${SUBMODULES}/SDL-2.0" ]; then
# git clone https://github.com/AmigaPorts/SDL-2.0.git "${SUBMODULES}"/SDL-2.0
#fi
#cd "${SUBMODULES}"/SDL-2.0
#cd "${SUBMODULES}"/SDL-2.0
#ln -sf /opt/ppc-amigaos/usr/include/GL ./include/GL
#ln -sf /opt/ppc-amigaos/usr/include/mgl ./include/mgl
#make -f Makefile.amigaos4 -j$(getconf _NPROCESSORS_ONLN)
#cd "${SUBMODULES}"

# Zziplib
#rm -rf "${SUBMODULES}"/zziplib/build
Expand Down
2 changes: 1 addition & 1 deletion src/milkyplay/AudioDriverBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
# include <windows.h>
#endif

#if defined(__AMIGA__)
#if defined(__amigaos3__)
extern "C" void usleep(unsigned long microseconds);
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/milkyplay/XModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include "XMFile.h"

#ifdef __AMIGA__
# include <clib/exec_protos.h>
# include <proto/exec.h>
#endif
#include "tmm.h"

Expand Down
2 changes: 1 addition & 1 deletion src/milkyplay/drivers/amiga/AudioDriver_Amiga.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "ProxyProcessor.h"

#include <exec/exec.h>
#include <clib/exec_protos.h>
#include <proto/exec.h>

#include <hardware/custom.h>
#include <hardware/dmabits.h>
Expand Down
5 changes: 2 additions & 3 deletions src/ppui/BasicTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@ typedef signed int pp_int32;
#endif

#if !defined(__PPUI_WINDOWS__)
#include <stdio.h>
#include <stdlib.h>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string.h>
#include <strings.h>
#include "VirtualKeys.h"
#include "PPSystemString_POSIX.h"
Expand Down
60 changes: 40 additions & 20 deletions src/ppui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,27 +142,47 @@ elseif(WIN32)
win32
)
elseif(AROS OR AMIGA)
enable_language(ASM_VASM)
if(AMIGAOS3)
enable_language(ASM_VASM)

target_sources(ppui
PRIVATE
# Sources
amiga/DisplayDevice_Amiga.cpp
amiga/DisplayDevice_Amiga.asm

# Headers
amiga/DisplayDevice_Amiga.h
)
else()
target_sources(ppui
PRIVATE
# Sources
sdl/DisplayDeviceFB_SDL.cpp
sdl/DisplayDevice_SDL.cpp

target_sources(ppui
PRIVATE
# Sources
amiga/DisplayDevice_Amiga.cpp
amiga/DisplayDevice_Amiga.asm
# Headers
sdl/DisplayDeviceFB_SDL.h
sdl/DisplayDevice_SDL.h
)

# Headers
amiga/DisplayDevice_Amiga.h
)
target_include_directories(ppui
PUBLIC
osinterface/amiga
osinterface/posix
amiga
)
target_include_directories(ppui
PRIVATE
${PROJECT_SOURCE_DIR}/include/amiga
)
target_include_directories(ppui
PUBLIC
sdl
${SDL_INCLUDE_DIRS}
${OPENGL_INCLUDE_DIR}
)
endif()
target_include_directories(ppui
PUBLIC
osinterface/amiga
osinterface/posix
amiga
)
target_include_directories(ppui
PRIVATE
${PROJECT_SOURCE_DIR}/include/amiga
)
else()
target_sources(ppui
PRIVATE
Expand All @@ -177,7 +197,7 @@ else()
target_include_directories(ppui
PUBLIC
sdl
${SDL2_INCLUDE_DIRS}
${SDL_INCLUDE_DIRS}
)
endif()

Expand Down
Loading