Skip to content
This repository has been archived by the owner on Feb 10, 2024. It is now read-only.

[SDL2][WIP] MorphOS Support #133

Open
wants to merge 216 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
216 commits
Select commit Hold shift + click to select a range
28dad45
Create makefile.mos
BeWorld2018 Feb 29, 2020
cfa24c7
Update SDL_cpuinfo.c
BeWorld2018 Feb 29, 2020
d855d09
FileSystem for MorphOS
BeWorld2018 Feb 29, 2020
87ae333
MORPHOS : Joystick with sensors support
BeWorld2018 Feb 29, 2020
e0f5e81
MORPHOS : syspower
BeWorld2018 Feb 29, 2020
3db8d8f
MORPHOS : thread
BeWorld2018 Feb 29, 2020
11206e2
MORPHOS : timer
BeWorld2018 Feb 29, 2020
3eb00b1
MORPHOS : add NewRawDoFmt function
BeWorld2018 Feb 29, 2020
5e15462
MORPHOS : add MorphOS Platform
BeWorld2018 Feb 29, 2020
ff8f346
MORPHOS : upload video function
BeWorld2018 Feb 29, 2020
f8f7bb0
MORPHOS : modify for detection G5
BeWorld2018 Feb 29, 2020
1bc5d60
MORPHOS : add AMIGA_bootstrap
BeWorld2018 Feb 29, 2020
18d167d
MORPHOS : support for sdl_config_morphos.h
BeWorld2018 Feb 29, 2020
1a01ee0
MORPHOS : add thread for MORPHOS
BeWorld2018 Feb 29, 2020
b47699f
MORPHOS : fix
BeWorld2018 Feb 29, 2020
d3929d4
MORPHOS : ForeachNode and ForeachNodeSafe
BeWorld2018 Feb 29, 2020
c7b01d5
MORPHOS : mistake .h file
BeWorld2018 Feb 29, 2020
1478953
MORPHOS : ForeachNode and ForeachNodeSafe
BeWorld2018 Feb 29, 2020
1591ba8
MORPHOS : fix
BeWorld2018 Feb 29, 2020
e1b3166
MORPHOS : add SDL_SYSWM_AMIGA
BeWorld2018 Feb 29, 2020
ef65c01
MorphOS : fix
BeWorld2018 Feb 29, 2020
7846f76
MORPHOS : mistake fix
BeWorld2018 Feb 29, 2020
a1a0be0
MORPHOS : fix
BeWorld2018 Feb 29, 2020
8762766
MORPHOS : fix path error
BeWorld2018 Feb 29, 2020
abd73a8
MORPHOS : GCC 9 and add AROS_ALMOST_COMPATIBLE
BeWorld2018 Feb 29, 2020
903ee4f
MORPHOS : delete os4 reference
BeWorld2018 Feb 29, 2020
09a5bf3
MORPHOS : fix.. i'm tired
BeWorld2018 Feb 29, 2020
863ff38
MORPHOS : add audio disk
BeWorld2018 Feb 29, 2020
35d865d
MORPHOS : add debug function D()
BeWorld2018 Mar 1, 2020
6d62e7c
MORPHOS : add -D__SDL_DEBUG
BeWorld2018 Mar 1, 2020
ec4522c
MORPHOS : fix sizeof
BeWorld2018 Mar 1, 2020
d2c806e
MORPHOS : clean
BeWorld2018 Mar 1, 2020
afd31b9
Update SDL_config_morphos.h
BeWorld2018 Mar 1, 2020
b2869ff
MOS : add SDL_AMIGAINPUT_JoystickDriver definition
BeWorld2018 Mar 1, 2020
8adb471
MORPHOS : fix
BeWorld2018 Mar 1, 2020
7ac9639
MOS : fix clean
BeWorld2018 Mar 1, 2020
8203643
MOS : add noixemul CFLAGS
BeWorld2018 Mar 1, 2020
bce720a
MORPHOS : update rwops
BeWorld2018 Mar 1, 2020
f8aebff
add makefile for MorphOS
BeWorld2018 Mar 1, 2020
ef384ea
Create TODO.MORPHOS
BeWorld2018 Mar 1, 2020
4ffc2f8
Update TODO.MORPHOS
BeWorld2018 Mar 1, 2020
e63100a
morphos : delete gcc5 for SDL_blit_N
BeWorld2018 Mar 1, 2020
5a68ddd
Update TODO.MORPHOS
BeWorld2018 Mar 1, 2020
b1ef9be
MOS: first update on joystick
BeWorld2018 Mar 2, 2020
57cc74c
Update TODO.MORPHOS
BeWorld2018 Mar 3, 2020
909a537
MOS : fix keyboard
BeWorld2018 Mar 3, 2020
e4a1c51
Update TODO.MORPHOS
BeWorld2018 Mar 3, 2020
758908d
MOS: comment unnecessary code
BeWorld2018 Mar 3, 2020
10723ae
MOS : add cilb, fb, ppcinline, proto files for SDK
BeWorld2018 Mar 5, 2020
57436af
MOS: upload to make SDL2.library
BeWorld2018 Mar 5, 2020
f7e6b9d
Update TODO.MORPHOS
BeWorld2018 Mar 5, 2020
a235e87
MOS : reoragnize SDL_config_morphos.h
BeWorld2018 Mar 5, 2020
cfb5708
MOS : update SDL_rwops.h
BeWorld2018 Mar 5, 2020
c1522b9
MOS : update for morphos_exit
BeWorld2018 Mar 5, 2020
4631f7c
MOS : update
BeWorld2018 Mar 5, 2020
c18f4a0
MOS : add AHIAUD_bootstrap
BeWorld2018 Mar 5, 2020
74570bc
MOS : add AHI support
BeWorld2018 Mar 5, 2020
12d0816
MorphOS : add of all Itix SDL2 files
BeWorld2018 Mar 5, 2020
266db0f
MOS : code cleanup
BeWorld2018 Mar 5, 2020
06a8d41
MOS : add SDL_SystemRAM
BeWorld2018 Mar 5, 2020
282f38a
MorphOS : update
BeWorld2018 Mar 5, 2020
1db87c9
MorphOS / AmigaOS : add filesystem
BeWorld2018 Mar 5, 2020
e4f0389
MorphOS : add SDL_GetPowerInfo_MorphOS
BeWorld2018 Mar 5, 2020
fa1cefe
MorphOS : add systimer.c
BeWorld2018 Mar 5, 2020
6b036c3
MorphOS : change directory to amiga
BeWorld2018 Mar 5, 2020
5e2055e
Update
BeWorld2018 Mar 5, 2020
c7e3a1b
Update SDL_amigakeyboard.c
BeWorld2018 Mar 5, 2020
c373203
Update sdl-stubs.c
BeWorld2018 Mar 5, 2020
ca5d527
Update TODO.MORPHOS
BeWorld2018 Mar 5, 2020
ad395cd
Update Makefile.mos
BeWorld2018 Mar 6, 2020
b127bbd
MOS: fix AHIAUD_OpenDevice
BeWorld2018 Mar 6, 2020
86b1462
Update Makefile.mos
BeWorld2018 Mar 7, 2020
5284d5c
Update morphos config
BeWorld2018 Mar 9, 2020
b10512e
Update begin_code.h
BeWorld2018 Mar 9, 2020
7f7da34
bak to GCC 4
BeWorld2018 Mar 9, 2020
fa03c40
MOS : update SDK files
BeWorld2018 Mar 9, 2020
08d8718
Update AHI files
BeWorld2018 Mar 9, 2020
d24ea53
Update SDL_stubs.h
BeWorld2018 Mar 9, 2020
87d2b55
Update SDL_functions.h
BeWorld2018 Mar 9, 2020
8d40eb4
bak to GCC4
BeWorld2018 Mar 9, 2020
54b9138
Update SDL_video.c
BeWorld2018 Mar 9, 2020
1f2722e
Update SDL_amigamodes
BeWorld2018 Mar 9, 2020
0971563
Update SDL_amigamouse.c
BeWorld2018 Mar 9, 2020
4f0dd01
Update SDL_amigavideo.c
BeWorld2018 Mar 9, 2020
0ea521e
Update SDL_amigawindow.c
BeWorld2018 Mar 9, 2020
230d7f8
add SDL_MORPHOS_JoystickDriver
BeWorld2018 Mar 9, 2020
3007746
Update SDL_sysjoystick
BeWorld2018 Mar 9, 2020
869454e
Update SDL_amigawindow.h
BeWorld2018 Mar 9, 2020
1d9ea1c
Update SDL_sysjoystick.c
BeWorld2018 Mar 9, 2020
74663b9
removed SDL_DYNAMIC_API from SDL_config_morphos.h
BSzili Mar 9, 2020
f64c0bb
adjusted AMIGA_TranslateUnicode for MorphOS
BSzili Mar 9, 2020
2a3ed11
removed the unused SDL_functions.h
BSzili Mar 9, 2020
f0de5a0
fixed the MorphOS SDK headers
BSzili Mar 9, 2020
fd94ce9
updated the MOS Makefiles to support GCC9 and build the headers by de…
BSzili Mar 9, 2020
c5e78b5
Cleanup
BeWorld2018 Mar 11, 2020
62fa7b6
Fix change toggle between window to fullscreen
BeWorld2018 Mar 12, 2020
fa8998c
Add Joystick support with lowlevel
BeWorld2018 Mar 12, 2020
54e3822
Fix compile
BeWorld2018 Mar 12, 2020
e898bd1
Fix inline file
BeWorld2018 Mar 12, 2020
bb9044b
Update SDL_sysjoystick.c
BeWorld2018 Mar 13, 2020
a0c529f
Somes fixes
BeWorld2018 Mar 14, 2020
6cb959d
Disable Resize Gadget on Window
BeWorld2018 Mar 14, 2020
bfbbc67
Fix Keyboard
BeWorld2018 Mar 14, 2020
cf14b10
Fix compiling
BeWorld2018 Mar 14, 2020
9acc6e5
Update TODO.MORPHOS
BeWorld2018 Mar 15, 2020
49ebc7f
Fix setWindowGrab (by BSzili)
BeWorld2018 Mar 15, 2020
5eba856
Update TODO.MORPHOS
BeWorld2018 Mar 15, 2020
bd523f4
Fix resizable window (by BSzili)
BeWorld2018 Mar 15, 2020
dcca47b
Update TODO.MORPHOS
BeWorld2018 Mar 15, 2020
9d32291
re-activate Resizable window
BeWorld2018 Mar 15, 2020
c7162d2
Update SDL_amigawindow.c
BeWorld2018 Mar 15, 2020
692939e
work in progress TinyGL support
BSzili Mar 18, 2020
b0afa2c
implemented SetWindowGammaRamp for MorphOS
BSzili Mar 18, 2020
c8d68c4
Update SDL_startup.c
BeWorld2018 Mar 18, 2020
acf1d94
Disable glMultiTexCoord3dvARB
BeWorld2018 Mar 18, 2020
d5342ed
fix __tglContext
BeWorld2018 Mar 18, 2020
b9355b2
enabled the OpenGL renderer on MorphOS
BSzili Mar 18, 2020
aabfc6a
Update makefil.mos for test
BeWorld2018 Mar 18, 2020
189735d
Update Makefile.mos
BeWorld2018 Mar 18, 2020
20bbded
improved the debug log in SDL_amigaopengl
BSzili Mar 18, 2020
b4593bd
don't bail out when an OpenGL renderer function is missing on MorphOS
BSzili Mar 18, 2020
ef9ca8b
fix
BeWorld2018 Mar 18, 2020
23c4890
Update SDL_GL functions
BeWorld2018 Mar 18, 2020
77d5ae9
Add SDL_GL functions
BeWorld2018 Mar 18, 2020
02cddf9
Update SDL_GL functions
BeWorld2018 Mar 18, 2020
1e6efa3
Update sdl-startup.c
BeWorld2018 Mar 19, 2020
169a437
Test __tglContext
BeWorld2018 Mar 19, 2020
e926039
Disabled support SDL_VIDEO_RENDER_OGL
BeWorld2018 Mar 19, 2020
b481a83
Last news at 19032020
BeWorld2018 Mar 19, 2020
20a1334
fix the GL context after window / full screen switches on MorphOS
BSzili Mar 19, 2020
72586dc
add headers of tinygl for MorphOS
BeWorld2018 Mar 19, 2020
fc05b47
add include SDL_opengl_glext.h
BeWorld2018 Mar 19, 2020
60abb21
GLuint64EXT and GLuint64 redeclared on MorphOS
BeWorld2018 Mar 19, 2020
e9eb94b
Update Haptic to library
BeWorld2018 Mar 19, 2020
bce9e61
Fix building OpenGL
BeWorld2018 Mar 20, 2020
a1df1c4
big SDL_amigagl_wrapper cleanup
BSzili Mar 20, 2020
f86f7c5
duplicate SDL_GL_GetProcAddress in the link library
BSzili Mar 20, 2020
d3beef4
allow AMIGA_GL_MakeCurrent to set the current context to NULL
BSzili Mar 20, 2020
88848cc
forgot to close the context in AMIGA_GL_DeleteContext
BSzili Mar 21, 2020
4886f7f
fixed a mistake and added the shader functions to SDL_amigagl_wrapper
BSzili Mar 21, 2020
fc40831
enabled analog and rumble for lowlevel.library
BSzili Mar 22, 2020
2176d1b
Fix (by BSzilli)
BeWorld2018 Mar 22, 2020
e6751d1
removed the lowlevel d-pad axis hack, the analog stick is now indepen…
BSzili Mar 24, 2020
05cecb9
replaced ranlib with the s ar option
BSzili Mar 24, 2020
762aa40
implemented SDL_setenv for MorphOS
BSzili Mar 24, 2020
e43ae6b
make the tests build for MorphOS
BSzili Mar 24, 2020
726b07d
enabled the OpenGL test on MorphOS
BSzili Mar 25, 2020
82fd1be
stop the log spam by AMIGA_GL_GetDrawableSize
BSzili Mar 25, 2020
b324bd0
AMIGA_GL_DeleteContext can be called after AMIGA_GL_UnloadLibrary
BSzili Mar 26, 2020
75a8f9e
better debug log in SDL_SYS_JoystickUpdate
BSzili Mar 26, 2020
79bf417
rumble duration is now handled by SDL
BSzili Mar 26, 2020
f84bb98
removed sdl2-tc-userdata-replacement.diff.txt
BSzili Mar 26, 2020
bade6cd
replaced AMIGA with __MORPHOS__
BSzili Mar 26, 2020
65a3f67
license update in a couple files
BSzili Mar 26, 2020
b5c72c2
changed AMIGA to __MORPHOS__ in SDL_rwops.h
BSzili Mar 26, 2020
b30d5a5
fixed the MorphOS RWOPS to pass every test
BSzili Mar 26, 2020
8683e45
switched to the internal iconv implementation for MorphOS
BSzili Mar 26, 2020
b7d6b4f
return MBs in SDL_GetSystemRAM on MorphOS
BSzili Mar 30, 2020
bc391c0
Update version for first public beta release
BeWorld2018 Apr 1, 2020
a9faadf
fixed amiga_file_size
BSzili Apr 5, 2020
5cce6ae
Fix GL_SwapWindow when window is hide
BeWorld2018 Apr 10, 2020
5e7b7a4
Fix bug when come back from iconify
BeWorld2018 Apr 10, 2020
6c48e97
Update SDL_amigaversion.h
BeWorld2018 Apr 10, 2020
23a9207
Update SDL_amigaopengl.c
BeWorld2018 Apr 10, 2020
d53454e
removed the args from SDL_SYS_CreateThread on MorphOS
BSzili Apr 11, 2020
9ba914a
Update library to 2.0.12
BeWorld2018 Apr 11, 2020
aa13dd6
Delete TODO.MORPHOS
BeWorld2018 Apr 12, 2020
3a2427d
Fix Window resize
BeWorld2018 Apr 15, 2020
24745b8
Fix ShowMessageBox
BeWorld2018 Apr 17, 2020
50476a0
Add SetWindowResizable
BeWorld2018 Apr 20, 2020
44c7e85
Implement SetWindowOpacity
BeWorld2018 Apr 20, 2020
e581376
Fix compilation and put logs
BeWorld2018 Apr 21, 2020
988c4a3
Fix warnings and add GCC9 support
BeWorld2018 Apr 23, 2020
aa161cb
Fix crash
BeWorld2018 Apr 28, 2020
7436177
Fix init system cursor
BeWorld2018 Apr 30, 2020
0375350
Add AMIGA_GetDoubleClickTimeInMillis
BeWorld2018 May 1, 2020
5107c0b
Fix warning compilation
BeWorld2018 May 1, 2020
ccf6a2c
First Version of Sensors Support
BeWorld2018 May 3, 2020
764d402
Fix DeadZone detection
BeWorld2018 May 3, 2020
c86fd8a
Update version
BeWorld2018 May 4, 2020
ccfe8dd
Fix clapping
BeWorld2018 May 6, 2020
3ff81ff
Add SDL_HINT_GAMECONTROLLERCONFIG_FILE
BeWorld2018 May 6, 2020
67e09a3
Add name to joystick
BeWorld2018 May 6, 2020
81c6514
Update AMIGA_UpdateWindowFramebuffer
BeWorld2018 May 14, 2020
2f854f4
Add 4 axes for 3DStick
BeWorld2018 May 15, 2020
273f9bd
Fix invert Right and Middle mouse buttons
BeWorld2018 May 16, 2020
0410c9c
further simplified AMIGA_DispatchMouseButtons
BSzili May 18, 2020
e83b714
Add Rumble (experimental) and Battery Sensor
BeWorld2018 May 20, 2020
01ad86e
Update SDL_sysjoystick.c
BeWorld2018 May 20, 2020
8e15f91
Update sdl2_protos.h
BeWorld2018 Jun 21, 2020
80ed4c7
add SDL_HAPTIC_DISABLED
BeWorld2018 Jun 23, 2020
82d2c7e
Fix SDL_INIT_EVERYTHING
BeWorld2018 Jun 23, 2020
5273a95
Update to GCC9
BeWorld2018 Aug 11, 2020
4359bc0
Fix RaiseWindow
BeWorld2018 Oct 2, 2020
cb69494
Add Drag n Drop support
BeWorld2018 Oct 2, 2020
f7b7a40
Update Copyright to 2020
BeWorld2018 Oct 2, 2020
5666a90
Fix
BeWorld2018 Oct 14, 2020
c80522d
Fix ppcinline file
BeWorld2018 Oct 17, 2020
92732d8
added the missing argument for SDL_AddVideoDisplay on MorphOS
BSzili Oct 17, 2020
9fb8037
Fix and update
BeWorld2018 Oct 17, 2020
da3fa8a
Fix Thread with relative paths
BeWorld2018 Nov 10, 2020
56fb979
Merge remote-tracking branch 'upstream/master' into mos-sdl2
BeWorld2018 Nov 15, 2020
e48c6d0
MorphOS : Update library
BeWorld2018 Nov 15, 2020
eee96d2
MorphOS : fix GL and add define MORPHOS/AMIGAOS GlBlendModeHack
BeWorld2018 Nov 15, 2020
8b712f6
Disable SDL_VIDEO_RENDER_OGL
BeWorld2018 Nov 15, 2020
5c3fb55
Merge branch 'master' into mos-sdl2
BeWorld2018 Dec 25, 2020
edca8c0
Add dummy SetSensorsEnabled function
BeWorld2018 Dec 25, 2020
44df421
MorphOS : update library
BeWorld2018 Dec 25, 2020
710b4da
MORPHOS: add SDL_OpenURL support and fix somes bugs
BeWorld2018 Jan 7, 2021
0243a05
MorphOS: add new functions GL
BeWorld2018 Jan 8, 2021
1074d7e
MorphOS: little fixes
BeWorld2018 Feb 9, 2021
bf2c692
MorphOS: add menu to window
BeWorld2018 Feb 16, 2021
1d977a8
MorphOS : fix
BeWorld2018 Feb 16, 2021
314b26a
MorphOS : add errors catch on OpenScreenTags
BeWorld2018 Feb 16, 2021
59a37e8
MorphOS: fix
BeWorld2018 Feb 16, 2021
a8ef720
MORPHOS: force to show cursor
BeWorld2018 Feb 24, 2021
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
115 changes: 115 additions & 0 deletions Makefile.mos
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# Makefile to build the SDL 2 library
#
# Enable debug with -D__SDL_DEBUG

CDEFS = -DAROS_ALMOST_COMPATIBLE -DBUILD_SDL2_LIBRARY -D__SDL_DEBUG
CC = ppc-morphos-gcc-10 -noixemul
AMIGADATE = $(shell date +"%-d.%-m.%Y")
INCLUDE = -I./include -D__AMIGADATE__=\"$(AMIGADATE)\"
CFLAGS = -mcpu=750 -mtune=7450 -O2 $(INCLUDE) -mresident32 -Wall -Wno-pointer-sign -fno-strict-aliasing $(CDEFS)
AR = ppc-morphos-ar

ECHE = echo -e
BOLD = \033[1m
NRML = \033[22m

COMPILING = @$(ECHE) "compiling $(BOLD)$@$(NRML)..."
LINKING = @$(ECHE) "linking $(BOLD)$@$(NRML)..."
STRIPPING = @$(ECHE) "stripping $(BOLD)$@$(NRML)..."
ARCHIVING = @$(ECHE) "archiving $(BOLD)$@$(NRML)..."
HEADERING = @$(ECHE) "creating headers files $(BOLD)$@$(NRML)..."

TARGET = libSDL2.a
LIBRARY = sdl2.library

SOURCES = \
src/*.c \
src/atomic/*.c \
src/audio/*.c \
src/audio/ahi/*.c \
src/audio/disk/*.c \
src/audio/dummy/*.c \
src/cpuinfo/*.c \
src/events/*.c \
src/file/*.c \
src/filesystem/amiga/*.c \
src/haptic/*.c \
src/haptic/dummy/*.c \
src/joystick/*.c \
src/joystick/amiga/*.c \
src/joystick/morphos/*.c \
src/loadso/dlopen/*.c \
src/power/*.c \
src/power/morphos/*.c \
src/render/*.c \
src/render/software/*.c \
src/render/opengl/*.c \
src/sensor/*.c \
src/sensor/dummy/*.c \
src/stdlib/*.c \
src/thread/*.c \
src/thread/morphos/*.c \
src/timer/*.c \
src/timer/amiga/*.c \
src/video/*.c \
src/video/amiga/*.c \
src/video/yuv2rgb/*.c \
src/misc/*.c \
src/misc/morphos/*.c \
src/locale/*.c \
src/locale/morphos/*.c \

CORESOURCES = src/core/morphos/*.c
COREOBJECTS = $(shell echo $(CORESOURCES) | sed -e 's,\.c,\.o,g')

OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g')

all: $(LIBRARY) lib

sdk: $(LIBRARY)
mkdir -p /usr/local/bin
mkdir -p /usr/local/include/SDL2
mkdir -p /usr/local/lib
mkdir -p /usr/local/lib/libb32
cp include/*.h /usr/local/include/SDL2
cp src/core/morphos/devenv/lib/libSDL2.a /usr/local/lib/libSDL2.a
cp src/core/morphos/devenv/lib/libb32/libSDL2.a /usr/local/lib/libb32/libSDL2.a

headers:
$(HEADERING)
@cvinclude.pl --fd=src/core/morphos/sdk/fd/sdl2_lib.fd --clib=src/core/morphos/sdk/clib/sdl2_protos.h --proto=src/core/morphos/sdk/proto/sdl2.h
@cvinclude.pl --fd=src/core/morphos/sdk/fd/sdl2_lib.fd --clib=src/core/morphos/sdk/clib/sdl2_protos.h --inline=src/core/morphos/sdk/ppcinline/sdl2.h

lib:
@cd src/core/morphos/devenv; if ! $(MAKE) $(MAKECMDGOALS); then exit 1; fi;

install: $(LIBRARY) lib
cp $(LIBRARY) Libs:
-flushlib $(LIBRARY)

src/video/SDL_blit_N.o: src/video/SDL_blit_N.c
$(CC) $(CFLAGS) -fvec -maltivec -faltivec -mabi=altivec -o $@ -c src/video/SDL_blit_N.c

src/core/morphos/SDL_cpu.o: src/core/morphos/SDL_cpu.c
$(CC) $(CFLAGS) -fvec -maltivec -faltivec -mabi=altivec -o $@ -c $^

src/core/morphos/SDL_library.o: src/core/morphos/SDL_library.c src/core/morphos/SDL_library.h src/core/morphos/SDL_stubs.h
$(COMPILING)
@$(CC) -mcpu=750 $(INCLUDE) -Wall -fno-strict-aliasing -DAROS_ALMOST_COMPATIBLE -o $@ -c $*.c

$(TARGET): $(OBJECTS)
$(ARCHIVING)
@$(AR) crvs $@ $^

$(LIBRARY): $(TARGET) $(COREOBJECTS)
$(LINKING)
@$(CC) -nostartfiles -mresident32 -Wl,-Map=sdl2.map $(COREOBJECTS) -o $@.db -L. -lSDL2 -lm
$(STRIPPING)
@ppc-morphos-strip -o $@ --remove-section=.comment $@.db

clean:
rm -f $(LIBRARY) $(TARGET) $(OBJECTS) $(COREOBJECTS) *.db *.s
@cd src/core/morphos/devenv; if ! $(MAKE) $(MAKECMDGOALS); then exit 1; fi;

dump:
ppc-morphos-objdump --disassemble-all --reloc $(LIBRARY).db >$(LIBRARY).s
5 changes: 5 additions & 0 deletions include/SDL_atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,13 @@ extern DECLSPEC void SDLCALL SDL_MemoryBarrierReleaseFunction(void);
extern DECLSPEC void SDLCALL SDL_MemoryBarrierAcquireFunction(void);

#if defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__))
#if defined(__MORPHOS__)
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("sync" : : : "memory")
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("sync" : : : "memory")
#else
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("lwsync" : : : "memory")
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("lwsync" : : : "memory")
#endif
#elif defined(__GNUC__) && defined(__aarch64__)
#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory")
#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory")
Expand Down
2 changes: 2 additions & 0 deletions include/SDL_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
#include "SDL_config_psp.h"
#elif defined(__OS2__)
#include "SDL_config_os2.h"
#elif defined(__MORPHOS__)
#include "SDL_config_morphos.h"
#else
/* This is a minimal configuration just to get SDL running on new platforms. */
#include "SDL_config_minimal.h"
Expand Down
196 changes: 196 additions & 0 deletions include/SDL_config_morphos.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/

#ifndef _SDL_config_morphos_h
#define _SDL_config_morphos_h

#include "SDL_platform.h"

/**
* \file SDL_config_morphos.h
*
* This is the MorphOS configuration used to build SDL.
*/

#define HAVE_STDARG_H 1
#define HAVE_STDDEF_H 1
#define HAVE_STDINT_H 1
#if !defined(BUILD_SDL2_LIBRARY)
#define HAVE_SIGNAL_H 1
#endif

#ifdef __GNUC__
#define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1
#endif

#define SIZEOF_VOIDP sizeof(IPTR)

/* Useful headers */
#define HAVE_ALLOCA_H 1
#define HAVE_SYS_TYPES_H 1
#define STDC_HEADERS 1
#define HAVE_STRING_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_CTYPE_H 1
#define HAVE_MATH_H 1

/* C library functions */
#define HAVE_MALLOC 1
#define HAVE_CALLOC 1
#define HAVE_REALLOC 1
#define HAVE_FREE 1
#define HAVE_ALLOCA 1
#define HAVE_QSORT 1
#define HAVE_ABS 1
#define HAVE_BCOPY 1
#define HAVE_MEMSET 1
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_MEMCMP 1
#define HAVE_STRLEN 1
#define HAVE_STRLCPY 1
#define HAVE_STRLCAT 1
#define HAVE_STRDUP 1
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE_STRTOL 1
#define HAVE_STRTOUL 1
#define HAVE_STRTOLL 1
#define HAVE_STRTOULL 1
#define HAVE_STRTOD 1
#define HAVE_ATOI 1
#define HAVE_ATOF 1
#define HAVE_STRCMP 1
#define HAVE_STRNCMP 1
#define HAVE_STRCASECMP 1
#define HAVE_STRNCASECMP 1
#define HAVE_VSSCANF 1
#define HAVE_VSNPRINTF 1
#define HAVE_CEIL 1
#define HAVE_COPYSIGN 1
#define HAVE_COS 1
#define HAVE_COSF 1
#define HAVE_FABS 1
#define HAVE_FLOOR 1
#define HAVE_LOG 1
#define HAVE_POW 1
#define HAVE_SCALBN 1
#define HAVE_SIN 1
#define HAVE_SINF 1
#define HAVE_SQRT 1
#define HAVE_SETJMP 1
#define HAVE_NANOSLEEP 1
#define HAVE_SYSCONF 1
#define HAVE_ATAN 1
#define HAVE_ATAN2 1
#define HAVE_ACOS 1
#define HAVE_ASIN 1
#define HAVE_TAN 1
#define HAVE_TANF 1

#define HAVE_WCHAR_H 1
//#define HAVE_ICONV_H 1
//#define HAVE_ICONV 1
#define HAVE_STDIO_H 1
#define HAVE_LIMITS_H 1
#define HAVE_ATANF 1
#define HAVE_ATAN2F 1
#define HAVE_ACOSF 1
#define HAVE_ASINF 1
#define HAVE_CEILF 1
#define HAVE_COPYSIGNF 1
#define HAVE_FABSF 1
#define HAVE_FLOORF 1
#define HAVE_FMOD 1
#define HAVE_FMODF 1
#define HAVE_LOGF 1
#define HAVE_LOG10 1
#define HAVE_LOG10F 1
#define HAVE_POWF 1
#define HAVE_SCALBNF 1
#define HAVE_EXP 1
#define HAVE_EXPF 1

#define HAVE_ALTIVEC_H 1
#define SDL_ENABLE_ALTIVEC_H 1

/* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_AHI 1
#define SDL_AUDIO_DRIVER_DISK 1
#define SDL_AUDIO_DRIVER_DUMMY 1

/* Enable haptic drivers */
#define SDL_HAPTIC_DUMMY 1

/* Enable SENSOR */
#define SDL_SENSOR_DUMMY 1

/* Enable AMIGA (lowlevel.library) JOYSTICK/GAMEPAD */
//#define SDL_JOYSTICK_AMIGA 1
/* Enable MORPHOS SENSORS JOYSTICK/GAMEPAD */
#define SDL_JOYSTICK_MORPHOS 1

/* Enable various shared object loading systems */
#define SDL_LOADSO_DLOPEN 1

/* Enable thread support */
#define SDL_THREAD_MORPHOS 1

/* Enable timer support */
#define SDL_TIMERS_AMIGA 1

/* Enable video driver */
#define SDL_VIDEO_DRIVER_AMIGA 1

/* Enable filesystem driver */
#define SDL_FILESYSTEM_AMIGA 1

/* Enable system power support */
#define SDL_POWER_MORPHOS 1

/* Enable assembly routines */
#define SDL_ALTIVEC_BLITTERS 1

/* Maybe later */
#ifndef SDL_VIDEO_RENDER_OGL
//#define SDL_VIDEO_RENDER_OGL 1
#endif

/* Enable OpenGL support */
#ifndef SDL_VIDEO_OPENGL
#define SDL_VIDEO_OPENGL 1
#endif

#if defined(__MORPHOS__)
#if defined(__SDL_DEBUG)
#include <exec/types.h>
extern struct ExecBase *SysBase;
#define D(fmt, ...) ({((STRPTR (*)(void *, CONST_STRPTR , APTR (*)(APTR, UBYTE), STRPTR , ...))*(void**)((long)(SysBase) - 922))((void*)(SysBase), fmt, (APTR)1, NULL, ##__VA_ARGS__);})
#else
#define D(fmt, ...)
#endif
#else
#define D(fmt, ...)
#endif

#endif /* _SDL_config_morphos_h */
6 changes: 6 additions & 0 deletions include/SDL_opengl.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@

#include "SDL_opengl_glext.h"

#elif defined(__MORPHOS__)

#include <tgl/gl.h>
#include <tgl/glu.h>
#include "SDL_opengl_glext.h"

#else

#ifndef __IPHONEOS__ /* No OpenGL on iOS. */
Expand Down
4 changes: 4 additions & 0 deletions include/SDL_opengl_glext.h
Original file line number Diff line number Diff line change
Expand Up @@ -1409,7 +1409,9 @@ typedef unsigned __int64 uint64_t;
#include <inttypes.h>
#endif
#endif
#ifndef __MORPHOS__
typedef uint64_t GLuint64;
#endif
typedef int64_t GLint64;
#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001
#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002
Expand Down Expand Up @@ -2597,7 +2599,9 @@ GLAPI void APIENTRY glBindVertexBuffers (GLuint first, GLsizei count, const GLui

#ifndef GL_ARB_bindless_texture
#define GL_ARB_bindless_texture 1
#ifndef __MORPHOS__
typedef uint64_t GLuint64EXT;
#endif
#define GL_UNSIGNED_INT64_ARB 0x140F
typedef GLuint64 (APIENTRYP PFNGLGETTEXTUREHANDLEARBPROC) (GLuint texture);
typedef GLuint64 (APIENTRYP PFNGLGETTEXTURESAMPLERHANDLEARBPROC) (GLuint texture, GLuint sampler);
Expand Down
Loading