mirror of
https://github.com/Interlisp/maiko.git
synced 2026-04-12 22:57:01 +00:00
Compare commits
10 Commits
maiko-2405
...
wip-nhb-sd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd90bbf9b9 | ||
|
|
cec93e6ae5 | ||
|
|
72e26ca033 | ||
|
|
f6f833c612 | ||
|
|
3ef7d2d68e | ||
|
|
68c74e4e79 | ||
|
|
c765ca5cc8 | ||
|
|
3ac46abc5c | ||
|
|
613ffd8aca | ||
|
|
db5d5a31e7 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -10,6 +10,7 @@ cmake-build-*/**
|
||||
.idea/
|
||||
*.m68k-x/**
|
||||
*.m68k/**
|
||||
*.386-sdl/**
|
||||
*.386-x/**
|
||||
*.386/**
|
||||
*.ppc-x/**
|
||||
|
||||
@@ -46,7 +46,8 @@ SET(MAIKO_INIT_DEFINITIONS
|
||||
)
|
||||
|
||||
OPTION(MAIKO_DISPLAY_X11 "Use X11 for display." ON)
|
||||
OPTION(MAIKO_DISPLAY_SDL "Use SDL for display." OFF)
|
||||
SET(MAIKO_DISPLAY_SDL OFF CACHE STRING "Use SDL for display. Version: OFF, 2, 3")
|
||||
SET_PROPERTY(CACHE MAIKO_DISPLAY_SDL PROPERTY STRINGS OFF 2 3)
|
||||
|
||||
IF(MAIKO_DISPLAY_X11)
|
||||
FIND_PACKAGE(X11 REQUIRED)
|
||||
@@ -81,19 +82,34 @@ IF(MAIKO_DISPLAY_X11)
|
||||
MESSAGE("-- Configured for X11 display")
|
||||
ENDIF()
|
||||
|
||||
IF(MAIKO_DISPLAY_SDL)
|
||||
IF(MAIKO_DISPLAY_SDL STREQUAL "2")
|
||||
FIND_PACKAGE(SDL2 REQUIRED)
|
||||
SET(MAIKO_DISPLAY_SDL_DEFINITIONS
|
||||
"-DSDL"
|
||||
"-DSDL=2"
|
||||
)
|
||||
SET(MAIKO_DISPLAY_SDL_LIBRARIES ${SDL2_LIBRARIES})
|
||||
SET(MAIKO_DISPLAY_SDL_INCLUDE_DIRS "${SDL2_INCLUDE_DIRS}")
|
||||
SET(MAIKO_DISPLAY_SDL_LIBRARIES SDL2::SDL2)
|
||||
SET(MAIKO_DISPLAY_SDL_SRCS
|
||||
src/sdl.c
|
||||
)
|
||||
SET(MAIKO_DISPLAY_SDL_HDRS
|
||||
inc/sdldefs.h
|
||||
)
|
||||
MESSAGE("-- Configured for SDL display")
|
||||
MESSAGE("-- Configured for SDL2 display")
|
||||
ELSEIF(MAIKO_DISPLAY_SDL STREQUAL "3")
|
||||
FIND_PACKAGE(SDL3 REQUIRED)
|
||||
SET(MAIKO_DISPLAY_SDL_DEFINITIONS
|
||||
"-DSDL=3"
|
||||
)
|
||||
SET(MAIKO_DISPLAY_SDL_INCLUDE_DIRS "${SDL3_INCLUDE_DIRS}")
|
||||
SET(MAIKO_DISPLAY_SDL_LIBRARIES SDL3::SDL3)
|
||||
SET(MAIKO_DISPLAY_SDL_SRCS
|
||||
src/sdl.c
|
||||
)
|
||||
SET(MAIKO_DISPLAY_SDL_HDRS
|
||||
inc/sdldefs.h
|
||||
)
|
||||
MESSAGE("-- Configured for SDL3 display")
|
||||
ENDIF()
|
||||
|
||||
# according to: https://cmake.org/pipermail/cmake/2016-October/064342.html
|
||||
@@ -428,23 +444,23 @@ ADD_CUSTOM_TARGET(gen-vdate
|
||||
)
|
||||
|
||||
ADD_EXECUTABLE(lde src/ldeboot.c src/unixfork.c)
|
||||
TARGET_COMPILE_DEFINITIONS(lde PUBLIC ${MAIKO_DEFINITIONS})
|
||||
TARGET_INCLUDE_DIRECTORIES(lde PUBLIC inc)
|
||||
TARGET_COMPILE_DEFINITIONS(lde PRIVATE ${MAIKO_DEFINITIONS})
|
||||
TARGET_INCLUDE_DIRECTORIES(lde PRIVATE inc)
|
||||
IF(MAIKO_DISPLAY_X11)
|
||||
# Tell it that the X11 launcher is available.
|
||||
TARGET_COMPILE_DEFINITIONS(lde PUBLIC ${MAIKO_DISPLAY_X11_DEFINITIONS})
|
||||
TARGET_COMPILE_DEFINITIONS(lde PRIVATE ${MAIKO_DISPLAY_X11_DEFINITIONS})
|
||||
# This is needed so that it can call XOpenDisplay.
|
||||
TARGET_LINK_LIBRARIES(lde X11::X11)
|
||||
ENDIF()
|
||||
|
||||
IF(MAIKO_DISPLAY_SDL)
|
||||
# Tell it that the SDL launcher is available.
|
||||
TARGET_COMPILE_DEFINITIONS(lde PUBLIC ${MAIKO_DISPLAY_SDL_DEFINITIONS})
|
||||
TARGET_COMPILE_DEFINITIONS(lde PRIVATE ${MAIKO_DISPLAY_SDL_DEFINITIONS})
|
||||
ENDIF()
|
||||
|
||||
ADD_EXECUTABLE(ldeether src/ldeether.c src/dlpi.c)
|
||||
TARGET_COMPILE_DEFINITIONS(ldeether PUBLIC ${MAIKO_DEFINITIONS})
|
||||
TARGET_INCLUDE_DIRECTORIES(ldeether PUBLIC inc)
|
||||
TARGET_COMPILE_DEFINITIONS(ldeether PRIVATE ${MAIKO_DEFINITIONS})
|
||||
TARGET_INCLUDE_DIRECTORIES(ldeether PRIVATE inc)
|
||||
|
||||
IF(MAIKO_DISPLAY_X11)
|
||||
ADD_EXECUTABLE(ldex
|
||||
@@ -455,8 +471,8 @@ IF(MAIKO_DISPLAY_X11)
|
||||
${MAIKO_DISPLAY_X11_SRCS}
|
||||
${MAIKO_DISPLAY_X11_HDRS}
|
||||
)
|
||||
TARGET_COMPILE_DEFINITIONS(ldex PUBLIC ${MAIKO_DEFINITIONS} ${MAIKO_DISPLAY_X11_DEFINITIONS})
|
||||
TARGET_INCLUDE_DIRECTORIES(ldex PUBLIC inc)
|
||||
TARGET_COMPILE_DEFINITIONS(ldex PRIVATE ${MAIKO_DEFINITIONS} ${MAIKO_DISPLAY_X11_DEFINITIONS})
|
||||
TARGET_INCLUDE_DIRECTORIES(ldex PRIVATE inc)
|
||||
TARGET_LINK_LIBRARIES(ldex ${MAIKO_LIBRARIES} ${MAIKO_DISPLAY_X11_LIBRARIES})
|
||||
|
||||
ADD_EXECUTABLE(ldeinit
|
||||
@@ -467,8 +483,8 @@ IF(MAIKO_DISPLAY_X11)
|
||||
${MAIKO_DISPLAY_X11_SRCS}
|
||||
${MAIKO_DISPLAY_X11_HDRS}
|
||||
)
|
||||
TARGET_COMPILE_DEFINITIONS(ldeinit PUBLIC ${MAIKO_INIT_DEFINITIONS} ${MAIKO_DISPLAY_X11_DEFINITIONS})
|
||||
TARGET_INCLUDE_DIRECTORIES(ldeinit PUBLIC inc)
|
||||
TARGET_COMPILE_DEFINITIONS(ldeinit PRIVATE ${MAIKO_INIT_DEFINITIONS} ${MAIKO_DISPLAY_X11_DEFINITIONS})
|
||||
TARGET_INCLUDE_DIRECTORIES(ldeinit PRIVATE inc)
|
||||
TARGET_LINK_LIBRARIES(ldeinit ${MAIKO_LIBRARIES} ${MAIKO_DISPLAY_X11_LIBRARIES})
|
||||
ENDIF()
|
||||
|
||||
@@ -481,20 +497,32 @@ IF(MAIKO_DISPLAY_SDL)
|
||||
${MAIKO_DISPLAY_SDL_SRCS}
|
||||
${MAIKO_DISPLAY_SDL_HDRS}
|
||||
)
|
||||
TARGET_COMPILE_DEFINITIONS(ldesdl PUBLIC ${MAIKO_DEFINITIONS} ${MAIKO_DISPLAY_SDL_DEFINITIONS})
|
||||
TARGET_INCLUDE_DIRECTORIES(ldesdl PUBLIC inc)
|
||||
TARGET_INCLUDE_DIRECTORIES(ldesdl PRIVATE ${SDL2_INCLUDE_DIRS})
|
||||
TARGET_COMPILE_DEFINITIONS(ldesdl PRIVATE ${MAIKO_DEFINITIONS} ${MAIKO_DISPLAY_SDL_DEFINITIONS})
|
||||
TARGET_INCLUDE_DIRECTORIES(ldesdl PRIVATE inc)
|
||||
TARGET_INCLUDE_DIRECTORIES(ldesdl PRIVATE ${MAIKO_DISPLAY_SDL_INCLUDE_DIRS})
|
||||
|
||||
IF(APPLE)
|
||||
IF(MAIKO_DISPLAY_SDL STREQUAL "3")
|
||||
#
|
||||
# Until CMake properly supports .xcframeworks, https://gitlab.kitware.com/cmake/cmake/-/issues/25998
|
||||
# we need to manually set the RPATH to produce a working executable
|
||||
#
|
||||
MESSAGE("-- Applying fixup for macOS RPATH for SDL3.xcframework")
|
||||
SET_PROPERTY(TARGET ldesdl APPEND PROPERTY BUILD_RPATH "/Library/Frameworks/SDL3.xcframework/macos-arm64_x86_64")
|
||||
#
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
TARGET_LINK_LIBRARIES(ldesdl ${MAIKO_LIBRARIES} ${MAIKO_DISPLAY_SDL_LIBRARIES})
|
||||
ENDIF()
|
||||
|
||||
ADD_EXECUTABLE(mkvdate src/mkvdate.c)
|
||||
TARGET_COMPILE_DEFINITIONS(mkvdate PUBLIC ${MAIKO_DEFINITIONS})
|
||||
TARGET_INCLUDE_DIRECTORIES(mkvdate PUBLIC inc)
|
||||
TARGET_COMPILE_DEFINITIONS(mkvdate PRIVATE ${MAIKO_DEFINITIONS})
|
||||
TARGET_INCLUDE_DIRECTORIES(mkvdate PRIVATE inc)
|
||||
|
||||
ADD_EXECUTABLE(setsout src/setsout.c src/byteswap.c)
|
||||
TARGET_COMPILE_DEFINITIONS(setsout PUBLIC ${MAIKO_DEFINITIONS})
|
||||
TARGET_INCLUDE_DIRECTORIES(setsout PUBLIC inc)
|
||||
TARGET_COMPILE_DEFINITIONS(setsout PRIVATE ${MAIKO_DEFINITIONS})
|
||||
TARGET_INCLUDE_DIRECTORIES(setsout PRIVATE inc)
|
||||
|
||||
ADD_EXECUTABLE(tstsout src/tstsout.c src/byteswap.c)
|
||||
TARGET_COMPILE_DEFINITIONS(tstsout PUBLIC ${MAIKO_DEFINITIONS})
|
||||
TARGET_INCLUDE_DIRECTORIES(tstsout PUBLIC inc)
|
||||
TARGET_COMPILE_DEFINITIONS(tstsout PRIVATE ${MAIKO_DEFINITIONS})
|
||||
TARGET_INCLUDE_DIRECTORIES(tstsout PRIVATE inc)
|
||||
|
||||
@@ -5,11 +5,17 @@ CC = gcc -m64 $(GCC_CFLAGS) -I/usr/local/include
|
||||
|
||||
XFILES = $(OBJECTDIR)sdl.o
|
||||
|
||||
XFLAGS = -DSDL
|
||||
#
|
||||
# For SDL version 2
|
||||
# -DSDL=2 in XFLAGS and -lSDL2 in LDFLAGS
|
||||
# For SDL version 3
|
||||
# -DSDL=3 in XFLAGS and -lSDL3 in LDFLAGS
|
||||
#
|
||||
XFLAGS = -DSDL=2
|
||||
|
||||
# OPTFLAGS is normally -O2.
|
||||
OPTFLAGS = -O2 -g3
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=351
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE)
|
||||
|
||||
LDFLAGS = -lm -L/usr/local/lib -lSDL2
|
||||
#
|
||||
|
||||
@@ -18,7 +18,7 @@ XFLAGS = -DXWINDOW
|
||||
|
||||
# OPTFLAGS is normally -O2.
|
||||
OPTFLAGS = -O2 -g3
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=351
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE)
|
||||
|
||||
LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
|
||||
LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
|
||||
|
||||
@@ -19,7 +19,7 @@ XFLAGS = -I/opt/X11/include -DXWINDOW
|
||||
OPTFLAGS = -O2 -g
|
||||
DEBUGFLAGS = # -DDEBUG -DOPTRACE
|
||||
DFLAGS = $(DEBUGFLAGS) $(XFLAGS) \
|
||||
-DRELEASE=351 # -DSTACKCHECK -DFSBCHECK -DPCTRACE
|
||||
-DRELEASE=$(RELEASE) # -DSTACKCHECK -DFSBCHECK -DPCTRACE
|
||||
|
||||
LDFLAGS = -L/opt/X11/lib -lX11 -lm
|
||||
LDELDFLAGS = -L/opt/X11/lib -lX11 -lm
|
||||
|
||||
@@ -4,14 +4,21 @@ CC = clang -target aarch64-apple-darwin $(CLANG_CFLAGS)
|
||||
|
||||
XFILES = $(OBJECTDIR)sdl.o
|
||||
|
||||
SDLFLAGS = -DSDL -F /Library/Frameworks
|
||||
#
|
||||
# For SDL version 2
|
||||
# -DSDL=2 in SDLFLAGS and -framework SDL2 in LDFLAGS
|
||||
# For SDL version 3
|
||||
# -DSDL=3 in SDLFLAGS and -framework SDL3 in LDFLAGS
|
||||
#
|
||||
|
||||
SDLFLAGS = -DSDL=2 -F /Library/Frameworks
|
||||
|
||||
# OPTFLAGS is normally -O2.
|
||||
OPTFLAGS = -O2 -g
|
||||
DEBUGFLAGS = # -DDEBUG -DOPTRACE
|
||||
DFLAGS = $(DEBUGFLAGS) $(SDLFLAGS) -DRELEASE=351
|
||||
DFLAGS = $(DEBUGFLAGS) $(SDLFLAGS) -DRELEASE=$(RELEASE)
|
||||
|
||||
LDFLAGS = -F /Library/Frameworks -framework SDL2
|
||||
LDFLAGS = -rpath /Library/Frameworks -F /Library/Frameworks -framework SDL2
|
||||
LDELDFLAGS =
|
||||
|
||||
OBJECTDIR = ../$(RELEASENAME)/
|
||||
|
||||
@@ -18,7 +18,7 @@ XFLAGS = -I/opt/X11/include -DXWINDOW
|
||||
# OPTFLAGS is normally -O2.
|
||||
OPTFLAGS = -O2
|
||||
DEBUGFLAGS = # -DDEBUG -DOPTRACE
|
||||
DFLAGS = $(DEBUGFLAGS) $(XFLAGS) -DRELEASE=351
|
||||
DFLAGS = $(DEBUGFLAGS) $(XFLAGS) -DRELEASE=$(RELEASE)
|
||||
|
||||
LDFLAGS = -L/opt/X11/lib -lX11 -lm
|
||||
LDELDFLAGS = -L/opt/X11/lib -lX11 -lm
|
||||
|
||||
@@ -19,7 +19,7 @@ XFLAGS = -I/usr/X11/include -DXWINDOW
|
||||
OPTFLAGS = -O2 -g
|
||||
DEBUGFLAGS = # -DDEBUG -DOPTRACE
|
||||
DFLAGS = $(DEBUGFLAGS) $(XFLAGS) \
|
||||
-DRELEASE=351
|
||||
-DRELEASE=$(RELEASE)
|
||||
|
||||
LDFLAGS = -L/usr/X11/lib -lX11 -lm
|
||||
LDELDFLAGS = -L/usr/X11/lib -lX11 -lm
|
||||
|
||||
@@ -2,16 +2,22 @@
|
||||
|
||||
CC = clang -m64 -target x86_64-apple-darwin $(CLANG_CFLAGS)
|
||||
|
||||
#
|
||||
# For SDL version 2
|
||||
# -DSDL=2 in SDLFLAGS and -framework SDL2 in LDFLAGS
|
||||
# For SDL version 3
|
||||
# -DSDL=3 in SDLFLAGS and -framework SDL3 in LDFLAGS
|
||||
#
|
||||
XFILES = $(OBJECTDIR)sdl.o
|
||||
|
||||
SDLFLAGS = -DSDL -F /Library/Frameworks
|
||||
SDLFLAGS = -DSDL=2 -F /Library/Frameworks
|
||||
|
||||
# OPTFLAGS is normally -O2.
|
||||
OPTFLAGS = -O2 -g
|
||||
DEBUGFLAGS = # -DDEBUG -DOPTRACE
|
||||
DFLAGS = $(DEBUGFLAGS) $(SDLFLAGS) -DRELEASE=351
|
||||
DFLAGS = $(DEBUGFLAGS) $(SDLFLAGS) -DRELEASE=$(RELEASE)
|
||||
|
||||
LDFLAGS = -F /Library/Frameworks -framework SDL2
|
||||
LDFLAGS = -rpath /Library/Frameworks -F /Library/Frameworks -framework SDL2
|
||||
LDELDFLAGS =
|
||||
|
||||
OBJECTDIR = ../$(RELEASENAME)/
|
||||
|
||||
@@ -18,7 +18,7 @@ XFLAGS = -I/opt/X11/include -DXWINDOW
|
||||
# OPTFLAGS is normally -O2.
|
||||
OPTFLAGS = -O1 -g
|
||||
DEBUGFLAGS = # -DDEBUG -DOPTRACE
|
||||
DFLAGS = $(DEBUGFLAGS) $(XFLAGS) -DRELEASE=351
|
||||
DFLAGS = $(DEBUGFLAGS) $(XFLAGS) -DRELEASE=$(RELEASE)
|
||||
|
||||
LDFLAGS = -L/opt/X11/lib -lX11 -lm
|
||||
LDELDFLAGS = -L/opt/X11/lib -lX11 -lm
|
||||
|
||||
@@ -4,11 +4,17 @@ CC = emcc $(CLANG_CFLAGS)
|
||||
|
||||
XFILES = $(OBJECTDIR)sdl.o
|
||||
|
||||
XFLAGS = -DSDL -sUSE_SDL=2
|
||||
#
|
||||
# For SDL version 2
|
||||
# -DSDL=2 and -sUSE_SDL=2 in XFLAGS and -sUSE_SDL=2 in LDFLAGS
|
||||
# For SDL version 3
|
||||
# -DSDL=3 and -sUSE_SDL=3 in XFLAGS and -sUSE_SDL=3 in LDFLAGS
|
||||
#
|
||||
XFLAGS = -DSDL=2 -sUSE_SDL=2
|
||||
|
||||
# OPTFLAGS is normally -O2.
|
||||
OPTFLAGS = -O2
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=351 -DMAIKO_ENABLE_NETHUB
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE) -DMAIKO_ENABLE_NETHUB
|
||||
|
||||
MEDLEY?=../../medley
|
||||
SYSOUT?=$(MEDLEY)/loadups/full.sysout
|
||||
|
||||
@@ -4,11 +4,17 @@ CC = emcc $(CLANG_CFLAGS)
|
||||
|
||||
XFILES = $(OBJECTDIR)sdl.o
|
||||
|
||||
XFLAGS = -DSDL -sUSE_SDL=2
|
||||
#
|
||||
# For SDL version 2
|
||||
# -DSDL=2 and -sUSE_SDL=2 in XFLAGS and -sUSE_SDL=2 in LDFLAGS
|
||||
# For SDL version 3
|
||||
# -DSDL=3 and -sUSE_SDL=3 in XFLAGS and -sUSE_SDL=3 in LDFLAGS
|
||||
#
|
||||
XFLAGS = -DSDL=2 -sUSE_SDL=2
|
||||
|
||||
# OPTFLAGS is normally -O2.
|
||||
OPTFLAGS = -O2
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=351 -DMAIKO_ENABLE_NETHUB
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE) -DMAIKO_ENABLE_NETHUB
|
||||
|
||||
MEDLEY?=../../medley
|
||||
SYSOUT?=$(MEDLEY)/loadups/full.sysout
|
||||
|
||||
@@ -4,11 +4,17 @@ CC = clang -m32 $(CLANG_CFLAGS)
|
||||
|
||||
XFILES = $(OBJECTDIR)sdl.o
|
||||
|
||||
SDLFLAGS = -DSDL -I/usr/local/include
|
||||
#
|
||||
# For SDL version 2
|
||||
# -DSDL=2 in SDLFLAGS and -lSDL2 in LDFLAGS
|
||||
# For SDL version 3
|
||||
# -DSDL=3 in SDLFLAGS and -lSDL3 in LDFLAGS
|
||||
#
|
||||
SDLFLAGS = -DSDL=2 -I/usr/local/include
|
||||
|
||||
# OPTFLAGS is normally -O2.
|
||||
OPTFLAGS = -O2 -g
|
||||
DFLAGS = $(SDLFLAGS) -DRELEASE=351
|
||||
DFLAGS = $(SDLFLAGS) -DRELEASE=$(RELEASE)
|
||||
|
||||
LDFLAGS = -L/usr/local/lib -lSDL2 -lm
|
||||
LDELDFLAGS =
|
||||
|
||||
@@ -17,7 +17,7 @@ XFLAGS = -I/usr/local/include -DXWINDOW
|
||||
|
||||
# OPTFLAGS is normally -O2.
|
||||
OPTFLAGS = -O2 -g
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=351
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE)
|
||||
|
||||
LDFLAGS = -L/usr/local/lib -lX11 -lc -lm
|
||||
LDELDFLAGS = -L/usr/local/lib -lX11 -lc -lm
|
||||
|
||||
@@ -4,11 +4,17 @@ CC = clang -m64 $(CLANG_CFLAGS)
|
||||
|
||||
XFILES = $(OBJECTDIR)sdl.o
|
||||
|
||||
SDLFLAGS = -DSDL -I/usr/local/include
|
||||
#
|
||||
# For SDL version 2
|
||||
# -DSDL=2 in SDLFLAGS and -lSDL2 in LDFLAGS
|
||||
# For SDL version 3
|
||||
# -DSDL=3 in SDLFLAGS and -lSDL3 in LDFLAGS
|
||||
#
|
||||
SDLFLAGS = -DSDL=2 -I/usr/local/include
|
||||
|
||||
# OPTFLAGS is normally -O2.
|
||||
OPTFLAGS = -O2 -g
|
||||
DFLAGS = $(SDLFLAGS) -DRELEASE=351
|
||||
DFLAGS = $(SDLFLAGS) -DRELEASE=$(RELEASE)
|
||||
|
||||
LDFLAGS = -L/usr/local/lib -lSDL2 -lm
|
||||
LDELDFLAGS =
|
||||
|
||||
@@ -17,7 +17,7 @@ XFLAGS = -I/usr/local/include -DXWINDOW
|
||||
|
||||
# OPTFLAGS is normally -O2.
|
||||
OPTFLAGS = -O2 -g
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=351
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE)
|
||||
|
||||
LDFLAGS = -L/usr/local/lib -lX11 -lc -lm
|
||||
LDELDFLAGS = -L/usr/local/lib -lX11 -lc -lm
|
||||
|
||||
@@ -4,11 +4,17 @@ CC = clang -m64 $(CLANG_CFLAGS)
|
||||
|
||||
XFILES = $(OBJECTDIR)sdl.o
|
||||
|
||||
SDLFLAGS = -DSDL -I/usr/local/include
|
||||
#
|
||||
# For SDL version 2
|
||||
# -DSDL=2 in SDLFLAGS and -lSDL2 in LDFLAGS
|
||||
# For SDL version 3
|
||||
# -DSDL=3 in SDLFLAGS and -lSDL3 in LDFLAGS
|
||||
#
|
||||
SDLFLAGS = -DSDL=2 -I/usr/local/include
|
||||
|
||||
# OPTFLAGS is normally -O2.
|
||||
OPTFLAGS = -O2 -g
|
||||
DFLAGS = $(SDLFLAGS) -DRELEASE=351
|
||||
DFLAGS = $(SDLFLAGS) -DRELEASE=$(RELEASE)
|
||||
|
||||
LDFLAGS = -L/usr/local/lib -lSDL2 -lm
|
||||
LDELDFLAGS =
|
||||
|
||||
@@ -17,7 +17,7 @@ XFLAGS = -I/usr/local/include -DXWINDOW
|
||||
|
||||
# OPTFLAGS is normally -O2.
|
||||
OPTFLAGS = -O2 -g
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=351
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE)
|
||||
|
||||
LDFLAGS = -L/usr/local/lib -lX11 -lc -lm
|
||||
LDELDFLAGS = -L/usr/local/lib -lX11 -lc -lm
|
||||
|
||||
@@ -5,11 +5,17 @@ CC = gcc -m64 $(GCC_CFLAGS)
|
||||
|
||||
XFILES = $(OBJECTDIR)sdl.o
|
||||
|
||||
XFLAGS = -DSDL
|
||||
#
|
||||
# For SDL version 2
|
||||
# -DSDL=2 in XFLAGS and -lSDL2 in LDFLAGS
|
||||
# For SDL version 3
|
||||
# -DSDL=3 in XFLAGS and -lSDL3 in LDFLAGS
|
||||
#
|
||||
XFLAGS = -DSDL=2
|
||||
|
||||
# OPTFLAGS is normally -O2.
|
||||
OPTFLAGS = -O2 -g3
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=351
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE)
|
||||
|
||||
LDFLAGS = -lSDL2 -lnetwork
|
||||
LDELDFLAGS = -lnetwork -lbsd
|
||||
|
||||
@@ -18,7 +18,7 @@ XFLAGS = -I/opt/X11/include -DXWINDOW
|
||||
# OPTFLAGS is normally -O2, for INIT we want unoptimized in case we need to debug it
|
||||
OPTFLAGS = -O0 -g
|
||||
DEBUGFLAGS =
|
||||
DFLAGS = $(DEBUGFLAGS) $(XFLAGS) -DRELEASE=351 -DNOVERSION -DINIT
|
||||
DFLAGS = $(DEBUGFLAGS) $(XFLAGS) -DRELEASE=$(RELEASE) -DNOVERSION -DINIT
|
||||
|
||||
LDFLAGS = -L/usr/X11/lib -lX11 -lm
|
||||
LDELDFLAGS = -L/usr/X11/lib -lX11 -lm
|
||||
|
||||
@@ -18,7 +18,7 @@ XFLAGS = -I/opt/X11/include -DXWINDOW
|
||||
# OPTFLAGS is normally -O2.
|
||||
OPTFLAGS = -O0 -g3
|
||||
DEBUGFLAGS = # -DDEBUG -DOPTRACE
|
||||
DFLAGS = $(DEBUGFLAGS) $(XFLAGS) -DRELEASE=351 -DNOVERSION -DINIT
|
||||
DFLAGS = $(DEBUGFLAGS) $(XFLAGS) -DRELEASE=$(RELEASE) -DNOVERSION -DINIT
|
||||
|
||||
LDFLAGS = -L/opt/X11/lib -lX11 -lm
|
||||
LDELDFLAGS = -L/opt/X11/lib -lX11 -lm
|
||||
|
||||
@@ -18,7 +18,7 @@ XFLAGS = -I/opt/X11/include -DXWINDOW
|
||||
# OPTFLAGS is normally -O2.
|
||||
OPTFLAGS = -O0 -g
|
||||
DEBUGFLAGS = # -DDEBUG -DOPTRACE
|
||||
DFLAGS = $(DEBUGFLAGS) $(XFLAGS) -DRELEASE=351 -DNOVERSION -DINIT
|
||||
DFLAGS = $(DEBUGFLAGS) $(XFLAGS) -DRELEASE=$(RELEASE) -DNOVERSION -DINIT
|
||||
|
||||
LDFLAGS = -L/opt/X11/lib -lX11 -lm
|
||||
LDELDFLAGS = -L/opt/X11/lib -lX11 -lm
|
||||
|
||||
@@ -17,7 +17,7 @@ XFLAGS = -I/usr/local/include -DXWINDOW
|
||||
|
||||
# OPTFLAGS is normally -O0 for init
|
||||
OPTFLAGS = -O0 -g
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=351 -DNOVERSION -DINIT
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE) -DNOVERSION -DINIT
|
||||
|
||||
LDFLAGS = -L/usr/local/lib -lX11 -lc -lm
|
||||
LDELDFLAGS = -L/usr/local/lib -lX11 -lc -lm
|
||||
|
||||
@@ -17,7 +17,7 @@ XFLAGS = -I/usr/local/include -DXWINDOW
|
||||
|
||||
# OPTFLAGS is normally -O0 for init
|
||||
OPTFLAGS = -O0 -g
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=351 -DNOVERSION -DINIT
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE) -DNOVERSION -DINIT
|
||||
|
||||
LDFLAGS = -L/usr/local/lib -lX11 -lc -lm
|
||||
LDELDFLAGS = -L/usr/local/lib -lX11 -lc -lm
|
||||
|
||||
@@ -17,7 +17,7 @@ XFLAGS = -I/usr/local/include -DXWINDOW
|
||||
|
||||
# OPTFLAGS is normally -O0 for init
|
||||
OPTFLAGS = -O0 -g
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=351 -DNOVERSION -DINIT
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE) -DNOVERSION -DINIT
|
||||
|
||||
LDFLAGS = -L/usr/local/lib -lX11 -lc -lm
|
||||
LDELDFLAGS = -L/usr/local/lib -lX11 -lc -lm
|
||||
|
||||
@@ -19,7 +19,7 @@ XFLAGS = -DXWINDOW
|
||||
# OPTFLAGS is normally -O2, for INIT we want unoptimized in case we need to debug it
|
||||
OPTFLAGS = -O0 -g
|
||||
DEBUGFLAGS =
|
||||
DFLAGS = $(DEBUGFLAGS) $(XFLAGS) -DRELEASE=351 -DNOVERSION -DINIT
|
||||
DFLAGS = $(DEBUGFLAGS) $(XFLAGS) -DRELEASE=$(RELEASE) -DNOVERSION -DINIT
|
||||
|
||||
LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
|
||||
LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
|
||||
|
||||
@@ -19,7 +19,7 @@ XFLAGS = -DXWINDOW
|
||||
# OPTFLAGS is normally -O2, for INIT we want unoptimized in case we need to debug it
|
||||
OPTFLAGS = -O0 -g
|
||||
DEBUGFLAGS =
|
||||
DFLAGS = $(DEBUGFLAGS) $(XFLAGS) -DRELEASE=351 -DNOVERSION -DINIT
|
||||
DFLAGS = $(DEBUGFLAGS) $(XFLAGS) -DRELEASE=$(RELEASE) -DNOVERSION -DINIT
|
||||
|
||||
LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
|
||||
LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
|
||||
|
||||
@@ -17,7 +17,7 @@ XFLAGS = -I/usr/X11R6/include -DXWINDOW
|
||||
|
||||
# OPTFLAGS is normally -O2.
|
||||
OPTFLAGS = -O2 -g3
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=351 -DNOVERSION -DINIT
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE) -DNOVERSION -DINIT
|
||||
|
||||
LDFLAGS = -L/usr/X11R6/lib -lX11 -lc -lm
|
||||
LDELDFLAGS = -L/usr/X11R6/lib -lX11 -lc -lm
|
||||
|
||||
@@ -50,7 +50,7 @@ DFLAGS = -DINIT \
|
||||
$(XFLAGS) \
|
||||
$(DEBUGFLAGS) \
|
||||
$(MACHINEFLAGS) \
|
||||
-DNOVERSION -DRELEASE=351
|
||||
-DNOVERSION -DRELEASE=$(RELEASE)
|
||||
|
||||
|
||||
LDFLAGS = -lX11 -lc -lm -lsocket -lnsl
|
||||
|
||||
@@ -5,11 +5,17 @@ CC = gcc -m32 $(GCC_CFLAGS)
|
||||
|
||||
XFILES = $(OBJECTDIR)sdl.o
|
||||
|
||||
XFLAGS = -DSDL
|
||||
#
|
||||
# For SDL version 2
|
||||
# -DSDL=2 in XFLAGS and -lSDL2 in LDFLAGS
|
||||
# For SDL version 3
|
||||
# -DSDL=3 in XFLAGS and -lSDL3 in LDFLAGS
|
||||
#
|
||||
XFLAGS = -DSDL=2
|
||||
|
||||
# OPTFLAGS is normally -O2.
|
||||
OPTFLAGS = -O2 -g3
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=351
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE)
|
||||
|
||||
LDFLAGS = -lm -lSDL2
|
||||
LDELDFLAGS =
|
||||
|
||||
@@ -17,7 +17,7 @@ XFLAGS = -DXWINDOW
|
||||
|
||||
# OPTFLAGS is normally -O2.
|
||||
OPTFLAGS = -O2 -g3
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=351
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE)
|
||||
|
||||
LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
|
||||
LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
|
||||
|
||||
@@ -5,11 +5,17 @@ CC = gcc $(GCC_CFLAGS)
|
||||
|
||||
XFILES = $(OBJECTDIR)sdl.o
|
||||
|
||||
SDLFLAGS = -DSDL
|
||||
#
|
||||
# For SDL version 2
|
||||
# -DSDL=2 in SDLFLAGS and -lSDL2 in LDFLAGS
|
||||
# For SDL version 3
|
||||
# -DSDL=3 in SDLFLAGS and -lSDL3 in LDFLAGS
|
||||
#
|
||||
SDLFLAGS = -DSDL=2
|
||||
|
||||
# OPTFLAGS is normally -O2.
|
||||
OPTFLAGS = -O2 -g3
|
||||
DFLAGS = $(SDLFLAGS) -DRELEASE=351
|
||||
DFLAGS = $(SDLFLAGS) -DRELEASE=$(RELEASE)
|
||||
|
||||
LDFLAGS = -lSDL2 -lm
|
||||
LDELDFLAGS =
|
||||
|
||||
@@ -17,7 +17,7 @@ XFLAGS = -DXWINDOW
|
||||
|
||||
# OPTFLAGS is normally -O2.
|
||||
OPTFLAGS = -O2 -g3
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=351
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE)
|
||||
|
||||
LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
|
||||
LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
|
||||
|
||||
@@ -5,11 +5,17 @@ CC = gcc $(GCC_CFLAGS)
|
||||
|
||||
XFILES = $(OBJECTDIR)sdl.o
|
||||
|
||||
XFLAGS = -DSDL
|
||||
#
|
||||
# For SDL version 2
|
||||
# -DSDL=2 in XFLAGS and -lSDL2 in LDFLAGS
|
||||
# For SDL version 3
|
||||
# -DSDL=3 in XFLAGS and -lSDL3 in LDFLAGS
|
||||
#
|
||||
XFLAGS = -DSDL=2
|
||||
|
||||
# OPTFLAGS is normally -O2.
|
||||
OPTFLAGS = -O2 -g3
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=351
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE)
|
||||
|
||||
LDFLAGS = -lm -lSDL2
|
||||
LDELDFLAGS =
|
||||
|
||||
@@ -17,7 +17,7 @@ XFLAGS = -DXWINDOW
|
||||
|
||||
# OPTFLAGS is normally -O2.
|
||||
OPTFLAGS = -O2 -g3
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=351
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE)
|
||||
|
||||
LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
|
||||
LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
|
||||
|
||||
@@ -5,11 +5,17 @@ CC = gcc -m64 $(GCC_CFLAGS)
|
||||
|
||||
XFILES = $(OBJECTDIR)sdl.o
|
||||
|
||||
XFLAGS = -DSDL
|
||||
#
|
||||
# For SDL version 2
|
||||
# -DSDL=2 in XFLAGS and -lSDL2 in LDFLAGS
|
||||
# For SDL version 3
|
||||
# -DSDL=3 in XFLAGS and -lSDL3 in LDFLAGS
|
||||
#
|
||||
XFLAGS = -DSDL=2
|
||||
|
||||
# OPTFLAGS is normally -O2.
|
||||
OPTFLAGS = -O2 -g3
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=351
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE)
|
||||
|
||||
LDFLAGS = -lm -lSDL2
|
||||
LDELDFLAGS =
|
||||
|
||||
@@ -18,7 +18,7 @@ XFLAGS = -DXWINDOW
|
||||
|
||||
# OPTFLAGS is normally -O2.
|
||||
OPTFLAGS = -O2 -g3
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=351
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE)
|
||||
|
||||
LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
|
||||
LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm
|
||||
|
||||
@@ -17,7 +17,7 @@ XFLAGS = -I/usr/X11R6/include -DXWINDOW
|
||||
|
||||
# OPTFLAGS is normally -O2.
|
||||
OPTFLAGS = -O2 -g3
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=351
|
||||
DFLAGS = $(XFLAGS) -DRELEASE=$(RELEASE)
|
||||
|
||||
LDFLAGS = -L/usr/X11R6/lib -lX11 -lc -lm
|
||||
LDELDFLAGS = -L/usr/X11R6/lib -lX11 -lc -lm
|
||||
|
||||
@@ -36,7 +36,7 @@ DEBUGFLAGS = # -DSTACKCHECK -DFNSTKCHECK
|
||||
DFLAGS = $(XFLAGS) \
|
||||
$(DEBUGFLAGS) \
|
||||
-DOS5 \
|
||||
-DRELEASE=351
|
||||
-DRELEASE=$(RELEASE)
|
||||
|
||||
LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm -lsocket -lnsl
|
||||
LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm -lsocket -lnsl
|
||||
|
||||
@@ -45,7 +45,7 @@ MACHINEFLAGS = -DOS5 -DUSE_DLPI
|
||||
DFLAGS = $(XFLAGS) \
|
||||
$(DEBUGFLAGS) \
|
||||
$(MACHINEFLAGS) \
|
||||
-DRELEASE=351
|
||||
-DRELEASE=$(RELEASE)
|
||||
|
||||
LDFLAGS = -lX11 -lc -lm -lsocket -lnsl
|
||||
LDELDFLAGS = -lX11 -lc -lm -lsocket -lnsl
|
||||
|
||||
@@ -37,7 +37,7 @@ DFLAGS = $(XFLAGS) \
|
||||
$(DEBUGFLAGS) \
|
||||
-DOS5 \
|
||||
-DUSE_DLPI \
|
||||
-DRELEASE=351
|
||||
-DRELEASE=$(RELEASE)
|
||||
|
||||
LDFLAGS = -L/usr/X11/lib -lX11 -lc -lm -lsocket -lnsl
|
||||
LDELDFLAGS = -L/usr/X11/lib -lX11 -lc -lm -lsocket -lnsl
|
||||
|
||||
@@ -54,9 +54,10 @@ if test $# -gt 0
|
||||
shift
|
||||
fi
|
||||
|
||||
: ${RELEASE=351}
|
||||
architecture=`machinetype`
|
||||
osversion=`osversion`
|
||||
echo "making so far for ${osversion} on ${architecture}."
|
||||
echo "making release ${RELEASE} for ${osversion} on ${architecture}."
|
||||
case "$display" in
|
||||
init) display=single
|
||||
releasename=init-${osversion}.${architecture}
|
||||
@@ -71,7 +72,7 @@ case "$display" in
|
||||
x) releasename=${osversion}.${architecture}-${display}
|
||||
ldename=ldex
|
||||
;;
|
||||
sdl) releasename=${osversion}.${architecture}-${display}
|
||||
sdl*) releasename=${osversion}.${architecture}-${display}
|
||||
ldename=ldesdl
|
||||
;;
|
||||
wasm) osversion=emscripten
|
||||
@@ -106,12 +107,12 @@ if [ ! -d ../${releasename} ]; then
|
||||
mkdir ../${releasename}
|
||||
fi
|
||||
|
||||
echo start making lde for ${releasename}.
|
||||
echo start making lde for ${releasename}
|
||||
|
||||
# then finally do the make, including the right stuff
|
||||
# With makefile-tail merged, this should only take ONE make command....
|
||||
|
||||
make RELEASENAME=${releasename} LDENAME=${ldename} \
|
||||
make RELEASENAME=${releasename} RELEASE=${RELEASE} LDENAME=${ldename} \
|
||||
OSARCHNAME=${osversion}.${architecture} \
|
||||
-f makefile-header -f makefile-${releasename} \
|
||||
-f makefile-tail $*
|
||||
|
||||
@@ -137,7 +137,7 @@ void clear_display(void) {
|
||||
#else /* COLOR */
|
||||
|
||||
void clear_display(void) {
|
||||
short *word;
|
||||
DLword *word;
|
||||
int w, h;
|
||||
if (MonoOrColor == MONO_SCREEN) {
|
||||
#ifndef DISPLAYBUFFER
|
||||
@@ -150,7 +150,7 @@ void clear_display(void) {
|
||||
0);
|
||||
#endif /* DISPLAYBUFFER */
|
||||
} else { /* MonoOrColo is COLOR_SCREEN */
|
||||
word = (short *)ColorDisplayRegion68k;
|
||||
word = ColorDisplayRegion68k;
|
||||
for (h = displayheight; (h--);) {
|
||||
for (w = DisplayRasterWidth * 8; (w--);) { *word++ = 0; }
|
||||
} /* end for(h) */
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#ifdef BIGVM
|
||||
#define SWA_FNHEAD
|
||||
#else
|
||||
#include "byteswapdefs.h" // for swapx
|
||||
#define SWA_FNHEAD swapx
|
||||
#endif /* BIGVM */
|
||||
|
||||
|
||||
@@ -29,6 +29,10 @@
|
||||
#include "lspglob.h"
|
||||
#include "lsptypes.h" // for Listp
|
||||
#include "rplconsdefs.h" // for N_OP_rplcons
|
||||
#ifndef NEWCDRCODING
|
||||
#include "gcdata.h"
|
||||
#include "address.h"
|
||||
#endif
|
||||
|
||||
/***************************************************/
|
||||
|
||||
|
||||
125
src/sdl.c
125
src/sdl.c
@@ -1,7 +1,8 @@
|
||||
#include <SDL2/SDL.h>
|
||||
#include <SDL2/SDL_keycode.h>
|
||||
#include "version.h"
|
||||
#include <assert.h>
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include "sdldefs.h"
|
||||
#include "byteswapdefs.h"
|
||||
#include "lispemul.h"
|
||||
@@ -10,8 +11,20 @@
|
||||
#include "lspglob.h" // for IOPage
|
||||
#include "display.h" // for CURSORHEIGHT, DisplayRegion68k
|
||||
|
||||
#if SDL == 2
|
||||
#include <SDL2/SDL.h>
|
||||
#include <SDL2/SDL_keycode.h>
|
||||
#elif SDL == 3
|
||||
#include <SDL3/SDL.h>
|
||||
#include <SDL3/SDL_keycode.h>
|
||||
#else
|
||||
#error Unrecognized SDL version number, neither 2 nor 3
|
||||
#endif
|
||||
|
||||
/* if SDLRENDERING is defined, render to a texture rather than
|
||||
* using the window surface
|
||||
*
|
||||
* XXX: With SDL3, using the window surface results in a black screen
|
||||
*/
|
||||
|
||||
#define SDLRENDERING 1
|
||||
@@ -33,7 +46,7 @@ static Uint32 sdl_foreground;
|
||||
static Uint32 sdl_background;
|
||||
static int sdl_bytesperpixel;
|
||||
static SDL_PixelFormat *sdl_pixelformat;
|
||||
|
||||
static int sdl_window_focusp = 0;
|
||||
extern void kb_trans(u_short keycode, u_short upflg);
|
||||
extern int error(const char *s);
|
||||
|
||||
@@ -532,7 +545,11 @@ static void sdl_update_viewport(int width, int height) {
|
||||
r.w = w;
|
||||
r.h = h;
|
||||
#if defined(SDLRENDERING)
|
||||
#if SDL_MAJOR_VERSION == 2
|
||||
SDL_RenderSetViewport(sdl_renderer, &r);
|
||||
#else
|
||||
SDL_SetRenderViewport(sdl_renderer, &r);
|
||||
#endif
|
||||
#endif
|
||||
printf("new viewport: %d / %d\n", w, h);
|
||||
}
|
||||
@@ -553,7 +570,11 @@ void sdl_setMousePosition(int x, int y) {
|
||||
#if defined(SDLRENDERING)
|
||||
void sdl_update_display() {
|
||||
sdl_bitblt_to_texture(min_x, min_y, max_x - min_x, max_y - min_y);
|
||||
#if SDL_MAJOR_VERSION == 2
|
||||
SDL_RenderCopy(sdl_renderer, sdl_texture, NULL, NULL);
|
||||
#else
|
||||
SDL_RenderTexture(sdl_renderer, sdl_texture, NULL, NULL);
|
||||
#endif
|
||||
SDL_RenderPresent(sdl_renderer);
|
||||
}
|
||||
#else
|
||||
@@ -573,7 +594,11 @@ void sdl_update_display() {
|
||||
s.w = r.w * sdl_pixelscale;
|
||||
s.h = r.h * sdl_pixelscale;
|
||||
sdl_bitblt_to_buffer(r.x, r.y, r.w, r.h);
|
||||
#if SDL_MAJOR_VERSION == 2
|
||||
SDL_LowerBlitScaled(sdl_buffersurface, &r, sdl_windowsurface, &s);
|
||||
#else
|
||||
SDL_BlitSurfaceUncheckedScaled(sdl_buffersurface, &r, sdl_windowsurface, &s, SDL_SCALEMODE_NEAREST);
|
||||
#endif
|
||||
SDL_UpdateWindowSurfaceRects(sdl_window, &s, 1);
|
||||
}
|
||||
}
|
||||
@@ -583,10 +608,15 @@ void process_SDLevents() {
|
||||
SDL_Event event;
|
||||
while (SDL_PollEvent(&event)) {
|
||||
switch (event.type) {
|
||||
#if SDL_MAJOR_VERSION == 2
|
||||
case SDL_QUIT:
|
||||
#else
|
||||
case SDL_EVENT_QUIT:
|
||||
#endif
|
||||
printf("quitting\n");
|
||||
exit(0);
|
||||
break;
|
||||
#if SDL_MAJOR_VERSION == 2
|
||||
case SDL_WINDOWEVENT:
|
||||
switch (event.window.event) {
|
||||
case SDL_WINDOWEVENT_RESIZED:
|
||||
@@ -595,9 +625,37 @@ void process_SDLevents() {
|
||||
sdl_windowheight = event.window.data2;
|
||||
sdl_update_viewport(sdl_windowwidth, sdl_windowheight);
|
||||
break;
|
||||
case SDL_WINDOWEVENT_ENTER:
|
||||
break;
|
||||
case SDL_WINDOWEVENT_LEAVE:
|
||||
break;
|
||||
case SDL_WINDOWEVENT_SHOWN:
|
||||
break;
|
||||
case SDL_WINDOWEVENT_HIDDEN:
|
||||
break;
|
||||
case SDL_WINDOWEVENT_EXPOSED:
|
||||
break;
|
||||
case SDL_WINDOWEVENT_FOCUS_GAINED:
|
||||
sdl_window_focusp = 1;
|
||||
break;
|
||||
case SDL_WINDOWEVENT_FOCUS_LOST:
|
||||
sdl_window_focusp = 0;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
#else
|
||||
case SDL_EVENT_WINDOW_RESIZED:
|
||||
/* XXX: what about integer multiple of 32 requirements here? */
|
||||
sdl_windowwidth = event.window.data1;
|
||||
sdl_windowheight = event.window.data2;
|
||||
sdl_update_viewport(sdl_windowwidth, sdl_windowheight);
|
||||
break;
|
||||
#endif
|
||||
#if SDL_MAJOR_VERSION == 2
|
||||
case SDL_KEYDOWN:
|
||||
#else
|
||||
case SDL_EVENT_KEY_DOWN:
|
||||
#endif
|
||||
#if 0
|
||||
printf("dn ts: %x, type: %x, state: %x, repeat: %x, scancode: %x, sym: %x <%s>, mod: %x\n",
|
||||
event.key.timestamp, event.key.type, event.key.state, event.key.repeat,
|
||||
@@ -610,7 +668,11 @@ void process_SDLevents() {
|
||||
}
|
||||
handle_keydown(event.key.keysym.sym, event.key.keysym.mod);
|
||||
break;
|
||||
#if SDL_MAJOR_VERSION == 2
|
||||
case SDL_KEYUP:
|
||||
#else
|
||||
case SDL_EVENT_KEY_UP:
|
||||
#endif
|
||||
#if 0
|
||||
printf("up ts: %x, type: %x, state: %x, repeat: %x, scancode: %x, sym: %x <%s>, mod: %x\n",
|
||||
event.key.timestamp, event.key.type, event.key.state, event.key.repeat,
|
||||
@@ -619,19 +681,37 @@ void process_SDLevents() {
|
||||
#endif
|
||||
handle_keyup(event.key.keysym.sym, event.key.keysym.mod);
|
||||
break;
|
||||
#if SDL_MAJOR_VERSION == 2
|
||||
case SDL_MOUSEMOTION: {
|
||||
int x, y;
|
||||
#else
|
||||
case SDL_EVENT_MOUSE_MOTION: {
|
||||
int ix, iy;
|
||||
float x, y;
|
||||
#endif
|
||||
if (!sdl_window_focusp) break;
|
||||
SDL_GetMouseState(&x, &y);
|
||||
x /= sdl_pixelscale;
|
||||
y /= sdl_pixelscale;
|
||||
*CLastUserActionCell68k = MiscStats->secondstmp;
|
||||
#if SDL_MAJOR_VERSION == 2
|
||||
*EmCursorX68K = (*((DLword *)EmMouseX68K)) = (short)(x & 0xFFFF);
|
||||
*EmCursorY68K = (*((DLword *)EmMouseY68K)) = (short)(y & 0xFFFF);
|
||||
#else
|
||||
ix = x;
|
||||
iy = y;
|
||||
*EmCursorX68K = (*((DLword *)EmMouseX68K)) = (short)(ix & 0xFFFF);
|
||||
*EmCursorY68K = (*((DLword *)EmMouseY68K)) = (short)(iy & 0xFFFF);
|
||||
#endif
|
||||
DoRing();
|
||||
if ((KBDEventFlg += 1) > 0) Irq_Stk_End = Irq_Stk_Check = 0;
|
||||
break;
|
||||
}
|
||||
#if SDL_MAJOR_VERSION == 2
|
||||
case SDL_MOUSEBUTTONDOWN: {
|
||||
#else
|
||||
case SDL_EVENT_MOUSE_BUTTON_DOWN: {
|
||||
#endif
|
||||
switch (event.button.button) {
|
||||
case SDL_BUTTON_LEFT: PUTBASEBIT68K(EmRealUtilin68K, MOUSE_LEFT, FALSE); break;
|
||||
case SDL_BUTTON_MIDDLE: PUTBASEBIT68K(EmRealUtilin68K, MOUSE_MIDDLE, FALSE); break;
|
||||
@@ -641,7 +721,11 @@ void process_SDLevents() {
|
||||
if ((KBDEventFlg += 1) > 0) Irq_Stk_End = Irq_Stk_Check = 0;
|
||||
break;
|
||||
}
|
||||
#if SDL_MAJOR_VERSION == 2
|
||||
case SDL_MOUSEBUTTONUP: {
|
||||
#else
|
||||
case SDL_EVENT_MOUSE_BUTTON_UP: {
|
||||
#endif
|
||||
switch (event.button.button) {
|
||||
case SDL_BUTTON_LEFT: PUTBASEBIT68K(EmRealUtilin68K, MOUSE_LEFT, TRUE); break;
|
||||
case SDL_BUTTON_MIDDLE: PUTBASEBIT68K(EmRealUtilin68K, MOUSE_MIDDLE, TRUE); break;
|
||||
@@ -651,11 +735,17 @@ void process_SDLevents() {
|
||||
if ((KBDEventFlg += 1) > 0) Irq_Stk_End = Irq_Stk_Check = 0;
|
||||
break;
|
||||
}
|
||||
#if SDL_MAJOR_VERSION == 2
|
||||
case SDL_MOUSEWHEEL:
|
||||
#else
|
||||
case SDL_EVENT_MOUSE_WHEEL:
|
||||
#endif
|
||||
/*
|
||||
printf("mousewheel mouse %d x %d y %d direction %s\n", event.wheel.which, event.wheel.x,
|
||||
event.wheel.y,
|
||||
event.wheel.direction == SDL_MOUSEWHEEL_NORMAL ? "normal" : "flipped");
|
||||
*/
|
||||
/*
|
||||
|
||||
these are the 4 key bits for mouse wheel/trackpad scrolling - which unlike X11 are
|
||||
*not* presented as mouse button down/up events for each scroll action
|
||||
@@ -698,8 +788,12 @@ int init_SDL(char *windowtitle, int w, int h, int s) {
|
||||
return 1;
|
||||
}
|
||||
printf("initialised\n");
|
||||
#if SDL_MAJOR_VERSION == 2
|
||||
sdl_window = SDL_CreateWindow(windowtitle, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
|
||||
sdl_windowwidth, sdl_windowheight, 0);
|
||||
#else
|
||||
sdl_window = SDL_CreateWindow(windowtitle, sdl_windowwidth, sdl_windowheight, 0);
|
||||
#endif
|
||||
printf("Window created\n");
|
||||
if (sdl_window == NULL) {
|
||||
printf("Window could not be created. SDL_Error: %s\n", SDL_GetError());
|
||||
@@ -707,7 +801,11 @@ int init_SDL(char *windowtitle, int w, int h, int s) {
|
||||
}
|
||||
#if defined(SDLRENDERING)
|
||||
printf("Creating renderer...\n");
|
||||
#if SDL_MAJOR_VERSION == 2
|
||||
sdl_renderer = SDL_CreateRenderer(sdl_window, -1, SDL_RENDERER_ACCELERATED);
|
||||
#else
|
||||
sdl_renderer = SDL_CreateRenderer(sdl_window, NULL, SDL_RENDERER_ACCELERATED);
|
||||
#endif
|
||||
if (NULL == sdl_renderer) {
|
||||
printf("SDL Error: %s\n", SDL_GetError());
|
||||
return 3;
|
||||
@@ -716,16 +814,25 @@ int init_SDL(char *windowtitle, int w, int h, int s) {
|
||||
SDL_SetRenderDrawColor(sdl_renderer, 127, 127, 127, 255);
|
||||
SDL_RenderClear(sdl_renderer);
|
||||
SDL_RenderPresent(sdl_renderer);
|
||||
#if SDL_MAJOR_VERSION == 2
|
||||
SDL_RenderSetScale(sdl_renderer, 1.0, 1.0);
|
||||
printf("Creating texture...\n");
|
||||
sdl_pixelformat = SDL_AllocFormat(sdl_rendererinfo.texture_formats[0]);
|
||||
#else
|
||||
SDL_SetRenderScale(sdl_renderer, 1.0, 1.0);
|
||||
sdl_pixelformat = SDL_CreatePixelFormat(sdl_rendererinfo.texture_formats[0]);
|
||||
#endif
|
||||
printf("Creating texture...\n");
|
||||
sdl_texture = SDL_CreateTexture(sdl_renderer, sdl_pixelformat->format,
|
||||
SDL_TEXTUREACCESS_STREAMING, width, height);
|
||||
sdl_black = SDL_MapRGB(sdl_pixelformat, 0, 0, 0);
|
||||
sdl_white = SDL_MapRGB(sdl_pixelformat, 255, 255, 255);
|
||||
sdl_foreground = sdl_black;
|
||||
sdl_background = sdl_white;
|
||||
#if SDL_MAJOR_VERSION == 2
|
||||
sdl_bytesperpixel = sdl_pixelformat->BytesPerPixel;
|
||||
#else
|
||||
sdl_bytesperpixel = sdl_pixelformat->bytes_per_pixel;
|
||||
#endif
|
||||
#else
|
||||
printf("Creating window surface and buffer surface\n");
|
||||
sdl_windowsurface = SDL_GetWindowSurface(sdl_window);
|
||||
@@ -734,12 +841,22 @@ int init_SDL(char *windowtitle, int w, int h, int s) {
|
||||
sdl_white = SDL_MapRGB(sdl_pixelformat, 255, 255, 255);
|
||||
sdl_foreground = sdl_black;
|
||||
sdl_background = sdl_white;
|
||||
#if SDL_MAJOR_VERSION == 2
|
||||
sdl_bytesperpixel = sdl_pixelformat->BytesPerPixel;
|
||||
#else
|
||||
sdl_bytesperpixel = sdl_pixelformat->bytes_per_pixel;
|
||||
#endif
|
||||
buffer_size = width * height * sdl_bytesperpixel;
|
||||
buffer = malloc(buffer_size);
|
||||
#if SDL_MAJOR_VERSION == 2
|
||||
sdl_buffersurface = SDL_CreateRGBSurfaceWithFormatFrom(
|
||||
buffer, sdl_displaywidth, sdl_displayheight, sdl_bytesperpixel * 8,
|
||||
sdl_displaywidth * sdl_bytesperpixel, sdl_pixelformat->format);
|
||||
#else
|
||||
sdl_buffersurface = SDL_CreateSurfaceFrom(
|
||||
buffer, sdl_displaywidth, sdl_displayheight,
|
||||
sdl_displaywidth * sdl_bytesperpixel, sdl_pixelformat->format);
|
||||
#endif
|
||||
#endif
|
||||
printf("SDL initialised\n");
|
||||
return 0;
|
||||
|
||||
67
src/uraid.c
67
src/uraid.c
@@ -49,34 +49,33 @@
|
||||
#define vfork fork
|
||||
#endif
|
||||
|
||||
#include "lispemul.h"
|
||||
#include "lispmap.h"
|
||||
#include "adr68k.h"
|
||||
#include "lsptypes.h"
|
||||
#include "lspglob.h"
|
||||
#include "emlglob.h"
|
||||
#include "cell.h"
|
||||
#include "ifpage.h"
|
||||
#include "debug.h"
|
||||
#include "devconf.h"
|
||||
#include "stack.h"
|
||||
#include "version.h" // for BIGVM
|
||||
|
||||
#include "display.h"
|
||||
#include "bitblt.h"
|
||||
#include "adr68k.h" // for NativeAligned4FromStackOffset, LAddr...
|
||||
#include "cell.h" // for DefCell, GetDEFCELL68k, GetVALCELL68k
|
||||
#include "dbgtooldefs.h" // for bt1, bt, sf
|
||||
#include "devif.h" // for DspInterfaceRec, DevRec, DspInterface
|
||||
#include "display.h" // for DISPLAYBUFFER
|
||||
#include "gcarraydefs.h" // for get_package_atom
|
||||
#include "gcfinaldefs.h" // for printarrayblock
|
||||
#include "ifpage.h" // for IFPAGE
|
||||
#include "initdspdefs.h" // for clear_display, flush_display_buffer
|
||||
#include "initkbddefs.h" // for init_keyboard
|
||||
#include "kprintdefs.h" // for print
|
||||
#include "lispemul.h" // for T, DLword, LispPTR, POINTERMASK, NIL
|
||||
#include "lispmap.h" // for DISPLAY_HI, ATOM_HI, DEFS_HI, DISPLA...
|
||||
#include "llstkdefs.h" // for stack_check
|
||||
#include "lspglob.h" // for InterfacePage, Plistspace
|
||||
#include "lsptypes.h" // for GETWORD, GetDTD, GetTypeNumber, dtd
|
||||
#include "mkatomdefs.h" // for make_atom
|
||||
#include "returndefs.h" // for contextsw
|
||||
#include "stack.h" // for FX, ResetFXP
|
||||
#include "testtooldefs.h" // for all_stack_dump, doko, printPC, print...
|
||||
#include "timerdefs.h" // for int_block, int_init, int_unblock
|
||||
#include "uraiddefs.h" // for copy_region, device_after_raid, devi...
|
||||
#include "uraidextdefs.h" // for URMAXCOMM, URMAXFXNUM, URSCAN_ALINK
|
||||
#include "vmemsavedefs.h" // for vmem_save
|
||||
|
||||
#include "uraiddefs.h"
|
||||
#include "uraidextdefs.h"
|
||||
#include "dbgtooldefs.h"
|
||||
#include "gcarraydefs.h"
|
||||
#include "initdspdefs.h"
|
||||
#include "initkbddefs.h"
|
||||
#include "kprintdefs.h"
|
||||
#include "llstkdefs.h"
|
||||
#include "mkatomdefs.h"
|
||||
#include "returndefs.h"
|
||||
#include "testtooldefs.h"
|
||||
#include "timerdefs.h"
|
||||
#include "vmemsavedefs.h"
|
||||
#ifdef MAIKO_ENABLE_ETHERNET
|
||||
#include "etherdefs.h"
|
||||
#endif
|
||||
@@ -452,6 +451,22 @@ LispPTR uraid_commands(void) {
|
||||
}
|
||||
print(*((LispPTR *)GetVALCELL68k(index)));
|
||||
break;
|
||||
case 'B': { /* print array block */
|
||||
LispPTR objaddr;
|
||||
if (URaid_argnum == 1) {
|
||||
printf("PRINT-ARRAY-BLOCK: B HEX-LispAddress\n");
|
||||
return (T);
|
||||
}
|
||||
errno = 0;
|
||||
objaddr = (LispPTR)strtoul(URaid_arg1, &endpointer, 16);
|
||||
if (errno != 0 || *endpointer != '\0') {
|
||||
printf("Arg not HEX number\n");
|
||||
return (T);
|
||||
}
|
||||
printarrayblock(objaddr);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'd': /* DEFCELL */
|
||||
if (URaid_argnum != 2) {
|
||||
printf("GETD: d litatom\n");
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
static XColor cursor_fore_xcsd, cursor_back_xcsd, xced;
|
||||
extern Colormap Colors;
|
||||
extern char cursorColor[255];
|
||||
|
||||
extern DspInterface currentdsp;
|
||||
/* a simple linked list to remember X cursors */
|
||||
@@ -143,7 +144,7 @@ void init_Xcursor(DspInterface dsp)
|
||||
|
||||
XLOCK; /* Take no X signals during this activity (ISC 386) */
|
||||
|
||||
XAllocNamedColor(dsp->display_id, Colors, "black", &cursor_fore_xcsd, &xced);
|
||||
XAllocNamedColor(dsp->display_id, Colors, cursorColor, &cursor_fore_xcsd, &xced);
|
||||
XAllocNamedColor(dsp->display_id, Colors, "white", &cursor_back_xcsd, &xced);
|
||||
|
||||
XUNLOCK(dsp); /* OK to take signals again */
|
||||
|
||||
@@ -53,6 +53,7 @@ static XrmOptionDescRec opTable[] = {
|
||||
{"-fg", "*foreground", XrmoptionSepArg, (XPointer)NULL},
|
||||
{"-background", "*background", XrmoptionSepArg, (XPointer)NULL},
|
||||
{"-bg", "*background", XrmoptionSepArg, (XPointer)NULL},
|
||||
{"-cursorColor", "*cursorColor", XrmoptionSepArg, (XPointer)NULL},
|
||||
{"-title", "*title", XrmoptionSepArg, (XPointer)NULL},
|
||||
{"-t", "*title", XrmoptionSepArg, (XPointer)NULL},
|
||||
{"-icontitle", "*icontitle", XrmoptionSepArg, (XPointer)NULL},
|
||||
@@ -84,6 +85,8 @@ extern char Window_Title[255];
|
||||
char Window_Title[255];
|
||||
extern char Icon_Title[255];
|
||||
char Icon_Title[255];
|
||||
extern char cursorColor[255];
|
||||
char cursorColor[255] = {0};
|
||||
|
||||
extern char sysout_name_cl[];
|
||||
extern char sysout_name_xrm[];
|
||||
@@ -115,6 +118,7 @@ void print_Xusage(const char *prog)
|
||||
(void)fprintf(stderr, " [-sysout] [<sysout>] -path to the Medley image\n");
|
||||
(void)fprintf(stderr, " -h[elp] -prints this text\n");
|
||||
(void)fprintf(stderr, " -info -prints configuration info\n");
|
||||
(void)fprintf(stderr, " -cursorColor X11-color-spec -sets foreground cursor color\n");
|
||||
(void)fprintf(stderr, " -d[isplay] <host>:<display>.<screen>\n");
|
||||
(void)fprintf(stderr,
|
||||
" -g[eometry] <geom> -size & placement for the medley window on your X "
|
||||
@@ -269,6 +273,10 @@ void read_Xoption(int *argc, char *argv[])
|
||||
|
||||
(void)strcpy(tmp, ""); /* Clear the string */
|
||||
|
||||
if (XrmGetResource(rDB, "ldex.cursorColor", "Ldex.cursorColor", str_type, &value) == True) {
|
||||
(void)strncpy(cursorColor, value.addr, sizeof(cursorColor) - 1);
|
||||
}
|
||||
|
||||
if (XrmGetResource(rDB, "ldex.NoFork", "Ldex.NoFork", str_type, &value) == True) {
|
||||
please_fork = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user