Skip to content

Commit

Permalink
Merge pull request #421 from AliceLR/sdl3-prep-4
Browse files Browse the repository at this point in the history
Various SDL renderer-based renderer updates.
  • Loading branch information
AliceLR authored Jan 24, 2024
2 parents b150826 + 51d2e92 commit 658c8d4
Show file tree
Hide file tree
Showing 14 changed files with 1,226 additions and 914 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
run: sudo apt update && sudo apt install -y --no-install-recommends $MZXDEPS_DEBIAN_SDL2
- uses: actions/checkout@v3
- name: Configure
run: ./config.sh --platform unix --enable-release
run: ./config.sh --platform unix --enable-release --enable-sdlaccel
- name: Build
run: $MZX_MAKE
- name: Run tests
Expand All @@ -48,7 +48,7 @@ jobs:
run: sudo apt update && sudo apt install -y --no-install-recommends $MZXDEPS_DEBIAN_SDL2
- uses: actions/checkout@v3
- name: Configure
run: ./config.sh --platform unix-devel --enable-release
run: ./config.sh --platform unix-devel --enable-release --enable-sdlaccel
- name: Build
run: $MZX_MAKE
- name: Run tests
Expand Down
20 changes: 19 additions & 1 deletion config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ usage() {
echo "Graphics options:"
echo " --enable-gles Enable hacks for OpenGL ES platforms."
echo " --disable-software Disable software renderer."
echo " --disable-softscale Disable SDL 2 accelerated software renderer."
echo " --disable-softscale Disable SDL accelerated software renderer."
echo " --enable-sdlaccel Enable SDL accelerated hardware renderer."
echo " --disable-gl Disable all GL renderers."
echo " --disable-gl-fixed Disable GL renderers for fixed-function h/w."
echo " --disable-gl-prog Disable GL renderers for programmable h/w."
Expand Down Expand Up @@ -172,6 +173,7 @@ UTILS="true"
X11="true"
SOFTWARE="true"
SOFTSCALE="true"
SDLACCEL="false"
GL_FIXED="true"
GL_PROGRAM="true"
OVERLAY="true"
Expand Down Expand Up @@ -351,6 +353,9 @@ while [ "$1" != "" ]; do
[ "$1" = "--disable-softscale" ] && SOFTSCALE="false"
[ "$1" = "--enable-softscale" ] && SOFTSCALE="true"

[ "$1" = "--disable-sdlaccel" ] && SDLACCEL="false"
[ "$1" = "--enable-sdlaccel" ] && SDLACCEL="true"

[ "$1" = "--disable-gl" ] && GL="false"
[ "$1" = "--enable-gl" ] && GL="true"

Expand Down Expand Up @@ -797,6 +802,7 @@ if [ "$SDL" = "false" ]; then
echo "Force-disabling SDL dependent components:"
echo " -> SOFTSCALE, OVERLAY"
SOFTSCALE="false"
SDLACCEL="false"
OVERLAY="false"
else
#
Expand Down Expand Up @@ -1108,6 +1114,7 @@ fi
if [ "$SDL" = "1" ] && [ "$SOFTSCALE" = "true" ]; then
echo "Force-disabling softscale renderer (requires SDL 2)."
SOFTSCALE="false"
SDLACCEL="false"
fi

#
Expand Down Expand Up @@ -1522,6 +1529,17 @@ else
echo "Softscale renderer disabled."
fi

#
# SDL accelerated hardware renderer (SDL 2+)
#
if [ "$SDLACCEL" = "true" ]; then
echo "SDL accelerated hardware renderer enabled."
echo "#define CONFIG_RENDER_SDLACCEL" >> src/config.h
echo "BUILD_RENDER_SDLACCEL=1" >> platform.inc
else
echo "SDL accelerated hardware renderer disabled."
fi

#
# Fixed-function H/W OpenGL renderers
#
Expand Down
8 changes: 8 additions & 0 deletions docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ DEVELOPERS
--disable-sdl (disables SDL).
For compatibility, "--disable-libsdl2" is still recognized.
+ Added SDL 2 and SDL 1.2 support to the 3DS port. (asie)
+ Updated the "sdlaccel" renderer, which can now be enabled with
--enable-sdlaccel in config.sh. This renderer uses the SDL
renderer API for hardware rendering and has an experimental
threaded charset texture update routine. SMZX isn't currently
implemented and it's slow, so it's disabled by default.
+ Moved SDL renderer window creation to render_sdl.c so both of
the SDL renderer-based renderers can benefit from it.
+ Removed floating point division usage in render_gl2.c.
+ -Og is now the default debug optimization level (was -O0).
+ Added --enable-lto to enable link-time optimizations.
+ The sanitizer config.sh options can now be used with release
Expand Down
7 changes: 6 additions & 1 deletion src/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,17 @@ core_cobjs += ${core_obj}/render_soft.o
render_layer_software = 1
endif

# Accelerated SDL2 software renderer
# Accelerated SDL software renderer
ifeq (${BUILD_RENDER_SOFTSCALE},1)
core_cobjs += ${core_obj}/render_softscale.o
render_layer_software = 1
endif

# Accelerated SDL fixed function hardware renderer
ifeq (${BUILD_RENDER_SDLACCEL},1)
core_cobjs += ${core_obj}/render_sdlaccel.o
endif

# GL shared
ifneq ($(or ${BUILD_RENDER_GL_FIXED},${BUILD_RENDER_GL_PROGRAM}),)
core_cobjs += ${core_obj}/render_gl.o
Expand Down
3 changes: 3 additions & 0 deletions src/graphics.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ static const struct renderer_data renderers[] =
#if defined(CONFIG_RENDER_SOFTSCALE)
{ "softscale", render_softscale_register },
#endif
#if defined(CONFIG_RENDER_SDLACCEL)
{ "sdlaccel", render_sdlaccel_register },
#endif
#if defined(CONFIG_RENDER_GL_FIXED)
{ "opengl1", render_gl1_register },
{ "opengl2", render_gl2_register },
Expand Down
Loading

0 comments on commit 658c8d4

Please sign in to comment.