From 7cf54f48113b77a4d7b21d5858ec98862195b2a6 Mon Sep 17 00:00:00 2001 From: spicyjpeg <88942473+spicyjpeg@users.noreply.github.com> Date: Sun, 12 Sep 2021 19:39:12 +0200 Subject: Migrated examples to CMake --- examples/graphics/balls/CMakeLists.txt | 22 +++++++++ examples/graphics/balls/makefile | 65 ------------------------- examples/graphics/billboard/CMakeLists.txt | 28 +++++++++++ examples/graphics/billboard/makefile | 65 ------------------------- examples/graphics/billboard/tim.s | 7 --- examples/graphics/billboard/tim.s.template | 6 +++ examples/graphics/fpscam/CMakeLists.txt | 22 +++++++++ examples/graphics/fpscam/makefile | 65 ------------------------- examples/graphics/gte/CMakeLists.txt | 22 +++++++++ examples/graphics/gte/makefile | 65 ------------------------- examples/graphics/hdtv/CMakeLists.txt | 22 +++++++++ examples/graphics/hdtv/makefile | 65 ------------------------- examples/graphics/render2tex/CMakeLists.txt | 28 +++++++++++ examples/graphics/render2tex/makefile | 65 ------------------------- examples/graphics/render2tex/texture.s | 9 ---- examples/graphics/render2tex/texture.s.template | 8 +++ examples/graphics/rgb24/CMakeLists.txt | 28 +++++++++++ examples/graphics/rgb24/makefile | 65 ------------------------- examples/graphics/rgb24/tim.s | 7 --- examples/graphics/rgb24/tim.s.template | 6 +++ 20 files changed, 192 insertions(+), 478 deletions(-) create mode 100644 examples/graphics/balls/CMakeLists.txt delete mode 100644 examples/graphics/balls/makefile create mode 100644 examples/graphics/billboard/CMakeLists.txt delete mode 100644 examples/graphics/billboard/makefile delete mode 100644 examples/graphics/billboard/tim.s create mode 100644 examples/graphics/billboard/tim.s.template create mode 100644 examples/graphics/fpscam/CMakeLists.txt delete mode 100644 examples/graphics/fpscam/makefile create mode 100644 examples/graphics/gte/CMakeLists.txt delete mode 100644 examples/graphics/gte/makefile create mode 100644 examples/graphics/hdtv/CMakeLists.txt delete mode 100644 examples/graphics/hdtv/makefile create mode 100644 examples/graphics/render2tex/CMakeLists.txt delete mode 100644 examples/graphics/render2tex/makefile delete mode 100644 examples/graphics/render2tex/texture.s create mode 100644 examples/graphics/render2tex/texture.s.template create mode 100644 examples/graphics/rgb24/CMakeLists.txt delete mode 100644 examples/graphics/rgb24/makefile delete mode 100644 examples/graphics/rgb24/tim.s create mode 100644 examples/graphics/rgb24/tim.s.template (limited to 'examples/graphics') diff --git a/examples/graphics/balls/CMakeLists.txt b/examples/graphics/balls/CMakeLists.txt new file mode 100644 index 0000000..b063425 --- /dev/null +++ b/examples/graphics/balls/CMakeLists.txt @@ -0,0 +1,22 @@ +# PSn00bSDK example CMake script +# (C) 2021 spicyjpeg - MPL licensed + +cmake_minimum_required(VERSION 3.21) + +if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND DEFINED ENV{PSN00BSDK_LIBS}) + set(CMAKE_TOOLCHAIN_FILE $ENV{PSN00BSDK_LIBS}/cmake/sdk.cmake) +endif() + +project( + balls + LANGUAGES C + VERSION 1.0.0 + DESCRIPTION "PSn00bSDK sprites example" + HOMEPAGE_URL "http://lameguy64.net/?page=psn00bsdk" +) + +file(GLOB _sources *.c) +psn00bsdk_add_executable(balls STATIC ${_sources}) +#psn00bsdk_add_cd_image(balls_iso balls iso.xml DEPENDS balls) + +install(FILES ${PROJECT_BINARY_DIR}/balls.exe DESTINATION .) diff --git a/examples/graphics/balls/makefile b/examples/graphics/balls/makefile deleted file mode 100644 index 44d3d71..0000000 --- a/examples/graphics/balls/makefile +++ /dev/null @@ -1,65 +0,0 @@ -# PSn00bSDK makefile template -# Part of the PSn00bSDK Project -# 2019 - 2021 Lameguy64 / Meido-Tek Productions - -## Settings - -PSN00BSDK_LIBS ?= ../../../libpsn00b - -# Edit this to point to psn00bsdk-setup.mk, or copy that over to your project's -# root folder (it only depends on environment variables). -include ../../../psn00bsdk-setup.mk - -# Project target name -TARGET = balls - -## Files - -# Searches for C, C++ and S (assembler) files in local directory -CFILES = $(notdir $(wildcard *.c)) -CPPFILES= $(notdir $(wildcard *.cpp)) -AFILES = $(notdir $(wildcard *.s)) - -# Create names for object files -OFILES = $(addprefix build/,$(CFILES:.c=.o)) \ - $(addprefix build/,$(CPPFILES:.cpp=.o)) \ - $(addprefix build/,$(AFILES:.s=.o)) - -# Project specific includes and libraries -# (use -I for include dirs, -L for library dirs, -l for static libraries) -INCLUDE += -LIBDIRS += -LIBS += - -## Build rules - -#all: iso -all: build/$(TARGET) - -iso: build/$(TARGET) resources - $(MKPSXISO) -y -q iso.xml - -resources: - # Add commands to build/convert your assets here - #$(LZPACK) data.xml - -build/$(TARGET): $(OFILES) - @mkdir -p $(dir $@) - $(LD) $(LDFLAGS_EXE) $(LIBDIRS) $^ $(LIBS) -o $@ - $(NM) -f posix -l -n $@ >$@.map - $(ELF2X) -q $@ $@.exe - -build/%.o: %.c - @mkdir -p $(dir $@) - $(CC) $(CFLAGS_EXE) $(INCLUDE) -c $< -o $@ - -build/%.o: %.cpp - @mkdir -p $(dir $@) - $(CXX) $(CPPFLAGS_EXE) $(INCLUDE) -c $< -o $@ - -build/%.o: %.s - @mkdir -p $(dir $@) - $(CC) $(AFLAGS_EXE) $(INCLUDE) -c $< -o $@ - -clean: - rm -rf build diff --git a/examples/graphics/billboard/CMakeLists.txt b/examples/graphics/billboard/CMakeLists.txt new file mode 100644 index 0000000..bf73297 --- /dev/null +++ b/examples/graphics/billboard/CMakeLists.txt @@ -0,0 +1,28 @@ +# PSn00bSDK example CMake script +# (C) 2021 spicyjpeg - MPL licensed + +cmake_minimum_required(VERSION 3.21) + +if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND DEFINED ENV{PSN00BSDK_LIBS}) + set(CMAKE_TOOLCHAIN_FILE $ENV{PSN00BSDK_LIBS}/cmake/sdk.cmake) +endif() + +project( + billboard + LANGUAGES C ASM + VERSION 1.0.0 + DESCRIPTION "PSn00bSDK billboard sprite example" + HOMEPAGE_URL "http://lameguy64.net/?page=psn00bsdk" +) + +configure_file(tim.s.template tim.s) + +file(GLOB _sources *.c) +psn00bsdk_add_executable( + billboard STATIC + ${_sources} + ${PROJECT_BINARY_DIR}/tim.s +) +#psn00bsdk_add_cd_image(billboard_iso billboard iso.xml DEPENDS billboard) + +install(FILES ${PROJECT_BINARY_DIR}/billboard.exe DESTINATION .) diff --git a/examples/graphics/billboard/makefile b/examples/graphics/billboard/makefile deleted file mode 100644 index 462e73c..0000000 --- a/examples/graphics/billboard/makefile +++ /dev/null @@ -1,65 +0,0 @@ -# PSn00bSDK makefile template -# Part of the PSn00bSDK Project -# 2019 - 2021 Lameguy64 / Meido-Tek Productions - -## Settings - -PSN00BSDK_LIBS ?= ../../../libpsn00b - -# Edit this to point to psn00bsdk-setup.mk, or copy that over to your project's -# root folder (it only depends on environment variables). -include ../../../psn00bsdk-setup.mk - -# Project target name -TARGET = billboard - -## Files - -# Searches for C, C++ and S (assembler) files in local directory -CFILES = $(notdir $(wildcard *.c)) -CPPFILES= $(notdir $(wildcard *.cpp)) -AFILES = $(notdir $(wildcard *.s)) - -# Create names for object files -OFILES = $(addprefix build/,$(CFILES:.c=.o)) \ - $(addprefix build/,$(CPPFILES:.cpp=.o)) \ - $(addprefix build/,$(AFILES:.s=.o)) - -# Project specific includes and libraries -# (use -I for include dirs, -L for library dirs, -l for static libraries) -INCLUDE += -LIBDIRS += -LIBS += - -## Build rules - -#all: iso -all: build/$(TARGET) - -iso: build/$(TARGET) resources - $(MKPSXISO) -y -q iso.xml - -resources: - # Add commands to build/convert your assets here - #$(LZPACK) data.xml - -build/$(TARGET): $(OFILES) - @mkdir -p $(dir $@) - $(LD) $(LDFLAGS_EXE) $(LIBDIRS) $^ $(LIBS) -o $@ - $(NM) -f posix -l -n $@ >$@.map - $(ELF2X) -q $@ $@.exe - -build/%.o: %.c - @mkdir -p $(dir $@) - $(CC) $(CFLAGS_EXE) $(INCLUDE) -c $< -o $@ - -build/%.o: %.cpp - @mkdir -p $(dir $@) - $(CXX) $(CPPFLAGS_EXE) $(INCLUDE) -c $< -o $@ - -build/%.o: %.s - @mkdir -p $(dir $@) - $(CC) $(AFLAGS_EXE) $(INCLUDE) -c $< -o $@ - -clean: - rm -rf build diff --git a/examples/graphics/billboard/tim.s b/examples/graphics/billboard/tim.s deleted file mode 100644 index 1fa8d69..0000000 --- a/examples/graphics/billboard/tim.s +++ /dev/null @@ -1,7 +0,0 @@ -.section .data - -.global tim_image -.type tim_image, @object -tim_image: - .incbin "texture64.tim" - \ No newline at end of file diff --git a/examples/graphics/billboard/tim.s.template b/examples/graphics/billboard/tim.s.template new file mode 100644 index 0000000..fbe7522 --- /dev/null +++ b/examples/graphics/billboard/tim.s.template @@ -0,0 +1,6 @@ +.section .data + +.global tim_image +.type tim_image, @object +tim_image: + .incbin "${PROJECT_SOURCE_DIR}/texture64.tim" diff --git a/examples/graphics/fpscam/CMakeLists.txt b/examples/graphics/fpscam/CMakeLists.txt new file mode 100644 index 0000000..8fa66f2 --- /dev/null +++ b/examples/graphics/fpscam/CMakeLists.txt @@ -0,0 +1,22 @@ +# PSn00bSDK example CMake script +# (C) 2021 spicyjpeg - MPL licensed + +cmake_minimum_required(VERSION 3.21) + +if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND DEFINED ENV{PSN00BSDK_LIBS}) + set(CMAKE_TOOLCHAIN_FILE $ENV{PSN00BSDK_LIBS}/cmake/sdk.cmake) +endif() + +project( + hello + LANGUAGES C + VERSION 1.0.0 + DESCRIPTION "PSn00bSDK 3D camera controls example" + HOMEPAGE_URL "http://lameguy64.net/?page=psn00bsdk" +) + +file(GLOB _sources *.c) +psn00bsdk_add_executable(fpscam STATIC ${_sources}) +#psn00bsdk_add_cd_image(fpscam_iso fpscam iso.xml DEPENDS fpscam) + +install(FILES ${PROJECT_BINARY_DIR}/fpscam.exe DESTINATION .) diff --git a/examples/graphics/fpscam/makefile b/examples/graphics/fpscam/makefile deleted file mode 100644 index 2ddb7fd..0000000 --- a/examples/graphics/fpscam/makefile +++ /dev/null @@ -1,65 +0,0 @@ -# PSn00bSDK makefile template -# Part of the PSn00bSDK Project -# 2019 - 2021 Lameguy64 / Meido-Tek Productions - -## Settings - -PSN00BSDK_LIBS ?= ../../../libpsn00b - -# Edit this to point to psn00bsdk-setup.mk, or copy that over to your project's -# root folder (it only depends on environment variables). -include ../../../psn00bsdk-setup.mk - -# Project target name -TARGET = fpscam - -## Files - -# Searches for C, C++ and S (assembler) files in local directory -CFILES = $(notdir $(wildcard *.c)) -CPPFILES= $(notdir $(wildcard *.cpp)) -AFILES = $(notdir $(wildcard *.s)) - -# Create names for object files -OFILES = $(addprefix build/,$(CFILES:.c=.o)) \ - $(addprefix build/,$(CPPFILES:.cpp=.o)) \ - $(addprefix build/,$(AFILES:.s=.o)) - -# Project specific includes and libraries -# (use -I for include dirs, -L for library dirs, -l for static libraries) -INCLUDE += -LIBDIRS += -LIBS += - -## Build rules - -#all: iso -all: build/$(TARGET) - -iso: build/$(TARGET) resources - $(MKPSXISO) -y -q iso.xml - -resources: - # Add commands to build/convert your assets here - #$(LZPACK) data.xml - -build/$(TARGET): $(OFILES) - @mkdir -p $(dir $@) - $(LD) $(LDFLAGS_EXE) $(LIBDIRS) $^ $(LIBS) -o $@ - $(NM) -f posix -l -n $@ >$@.map - $(ELF2X) -q $@ $@.exe - -build/%.o: %.c - @mkdir -p $(dir $@) - $(CC) $(CFLAGS_EXE) $(INCLUDE) -c $< -o $@ - -build/%.o: %.cpp - @mkdir -p $(dir $@) - $(CXX) $(CPPFLAGS_EXE) $(INCLUDE) -c $< -o $@ - -build/%.o: %.s - @mkdir -p $(dir $@) - $(CC) $(AFLAGS_EXE) $(INCLUDE) -c $< -o $@ - -clean: - rm -rf build diff --git a/examples/graphics/gte/CMakeLists.txt b/examples/graphics/gte/CMakeLists.txt new file mode 100644 index 0000000..3cdf2ff --- /dev/null +++ b/examples/graphics/gte/CMakeLists.txt @@ -0,0 +1,22 @@ +# PSn00bSDK example CMake script +# (C) 2021 spicyjpeg - MPL licensed + +cmake_minimum_required(VERSION 3.21) + +if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND DEFINED ENV{PSN00BSDK_LIBS}) + set(CMAKE_TOOLCHAIN_FILE $ENV{PSN00BSDK_LIBS}/cmake/sdk.cmake) +endif() + +project( + hello + LANGUAGES C + VERSION 1.0.0 + DESCRIPTION "PSn00bSDK GTE 3D cube example" + HOMEPAGE_URL "http://lameguy64.net/?page=psn00bsdk" +) + +file(GLOB _sources *.c) +psn00bsdk_add_executable(gte STATIC ${_sources}) +#psn00bsdk_add_cd_image(gte_iso gte iso.xml DEPENDS gte) + +install(FILES ${PROJECT_BINARY_DIR}/gte.exe DESTINATION .) diff --git a/examples/graphics/gte/makefile b/examples/graphics/gte/makefile deleted file mode 100644 index f44e72b..0000000 --- a/examples/graphics/gte/makefile +++ /dev/null @@ -1,65 +0,0 @@ -# PSn00bSDK makefile template -# Part of the PSn00bSDK Project -# 2019 - 2021 Lameguy64 / Meido-Tek Productions - -## Settings - -PSN00BSDK_LIBS ?= ../../../libpsn00b - -# Edit this to point to psn00bsdk-setup.mk, or copy that over to your project's -# root folder (it only depends on environment variables). -include ../../../psn00bsdk-setup.mk - -# Project target name -TARGET = gte - -## Files - -# Searches for C, C++ and S (assembler) files in local directory -CFILES = $(notdir $(wildcard *.c)) -CPPFILES= $(notdir $(wildcard *.cpp)) -AFILES = $(notdir $(wildcard *.s)) - -# Create names for object files -OFILES = $(addprefix build/,$(CFILES:.c=.o)) \ - $(addprefix build/,$(CPPFILES:.cpp=.o)) \ - $(addprefix build/,$(AFILES:.s=.o)) - -# Project specific includes and libraries -# (use -I for include dirs, -L for library dirs, -l for static libraries) -INCLUDE += -LIBDIRS += -LIBS += - -## Build rules - -#all: iso -all: build/$(TARGET) - -iso: build/$(TARGET) resources - $(MKPSXISO) -y -q iso.xml - -resources: - # Add commands to build/convert your assets here - #$(LZPACK) data.xml - -build/$(TARGET): $(OFILES) - @mkdir -p $(dir $@) - $(LD) $(LDFLAGS_EXE) $(LIBDIRS) $^ $(LIBS) -o $@ - $(NM) -f posix -l -n $@ >$@.map - $(ELF2X) -q $@ $@.exe - -build/%.o: %.c - @mkdir -p $(dir $@) - $(CC) $(CFLAGS_EXE) $(INCLUDE) -c $< -o $@ - -build/%.o: %.cpp - @mkdir -p $(dir $@) - $(CXX) $(CPPFLAGS_EXE) $(INCLUDE) -c $< -o $@ - -build/%.o: %.s - @mkdir -p $(dir $@) - $(CC) $(AFLAGS_EXE) $(INCLUDE) -c $< -o $@ - -clean: - rm -rf build diff --git a/examples/graphics/hdtv/CMakeLists.txt b/examples/graphics/hdtv/CMakeLists.txt new file mode 100644 index 0000000..98a0b3f --- /dev/null +++ b/examples/graphics/hdtv/CMakeLists.txt @@ -0,0 +1,22 @@ +# PSn00bSDK example CMake script +# (C) 2021 spicyjpeg - MPL licensed + +cmake_minimum_required(VERSION 3.21) + +if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND DEFINED ENV{PSN00BSDK_LIBS}) + set(CMAKE_TOOLCHAIN_FILE $ENV{PSN00BSDK_LIBS}/cmake/sdk.cmake) +endif() + +project( + hdtv + LANGUAGES C + VERSION 1.0.0 + DESCRIPTION "PSn00bSDK HDTV widescreen example" + HOMEPAGE_URL "http://lameguy64.net/?page=psn00bsdk" +) + +file(GLOB _sources *.c) +psn00bsdk_add_executable(hdtv STATIC ${_sources}) +#psn00bsdk_add_cd_image(hdtv_iso hdtv iso.xml DEPENDS hdtv) + +install(FILES ${PROJECT_BINARY_DIR}/hdtv.exe DESTINATION .) diff --git a/examples/graphics/hdtv/makefile b/examples/graphics/hdtv/makefile deleted file mode 100644 index 6659c98..0000000 --- a/examples/graphics/hdtv/makefile +++ /dev/null @@ -1,65 +0,0 @@ -# PSn00bSDK makefile template -# Part of the PSn00bSDK Project -# 2019 - 2021 Lameguy64 / Meido-Tek Productions - -## Settings - -PSN00BSDK_LIBS ?= ../../../libpsn00b - -# Edit this to point to psn00bsdk-setup.mk, or copy that over to your project's -# root folder (it only depends on environment variables). -include ../../../psn00bsdk-setup.mk - -# Project target name -TARGET = hdtv - -## Files - -# Searches for C, C++ and S (assembler) files in local directory -CFILES = $(notdir $(wildcard *.c)) -CPPFILES= $(notdir $(wildcard *.cpp)) -AFILES = $(notdir $(wildcard *.s)) - -# Create names for object files -OFILES = $(addprefix build/,$(CFILES:.c=.o)) \ - $(addprefix build/,$(CPPFILES:.cpp=.o)) \ - $(addprefix build/,$(AFILES:.s=.o)) - -# Project specific includes and libraries -# (use -I for include dirs, -L for library dirs, -l for static libraries) -INCLUDE += -LIBDIRS += -LIBS += - -## Build rules - -#all: iso -all: build/$(TARGET) - -iso: build/$(TARGET) resources - $(MKPSXISO) -y -q iso.xml - -resources: - # Add commands to build/convert your assets here - #$(LZPACK) data.xml - -build/$(TARGET): $(OFILES) - @mkdir -p $(dir $@) - $(LD) $(LDFLAGS_EXE) $(LIBDIRS) $^ $(LIBS) -o $@ - $(NM) -f posix -l -n $@ >$@.map - $(ELF2X) -q $@ $@.exe - -build/%.o: %.c - @mkdir -p $(dir $@) - $(CC) $(CFLAGS_EXE) $(INCLUDE) -c $< -o $@ - -build/%.o: %.cpp - @mkdir -p $(dir $@) - $(CXX) $(CPPFLAGS_EXE) $(INCLUDE) -c $< -o $@ - -build/%.o: %.s - @mkdir -p $(dir $@) - $(CC) $(AFLAGS_EXE) $(INCLUDE) -c $< -o $@ - -clean: - rm -rf build diff --git a/examples/graphics/render2tex/CMakeLists.txt b/examples/graphics/render2tex/CMakeLists.txt new file mode 100644 index 0000000..42a063b --- /dev/null +++ b/examples/graphics/render2tex/CMakeLists.txt @@ -0,0 +1,28 @@ +# PSn00bSDK example CMake script +# (C) 2021 spicyjpeg - MPL licensed + +cmake_minimum_required(VERSION 3.21) + +if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND DEFINED ENV{PSN00BSDK_LIBS}) + set(CMAKE_TOOLCHAIN_FILE $ENV{PSN00BSDK_LIBS}/cmake/sdk.cmake) +endif() + +project( + render2tex + LANGUAGES C ASM + VERSION 1.0.0 + DESCRIPTION "PSn00bSDK render-to-texture example" + HOMEPAGE_URL "http://lameguy64.net/?page=psn00bsdk" +) + +configure_file(texture.s.template texture.s) + +file(GLOB _sources *.c) +psn00bsdk_add_executable( + render2tex STATIC + ${_sources} + ${PROJECT_BINARY_DIR}/texture.s +) +#psn00bsdk_add_cd_image(render2tex_iso render2tex iso.xml DEPENDS render2tex) + +install(FILES ${PROJECT_BINARY_DIR}/render2tex.exe DESTINATION .) diff --git a/examples/graphics/render2tex/makefile b/examples/graphics/render2tex/makefile deleted file mode 100644 index bb0ef3c..0000000 --- a/examples/graphics/render2tex/makefile +++ /dev/null @@ -1,65 +0,0 @@ -# PSn00bSDK makefile template -# Part of the PSn00bSDK Project -# 2019 - 2021 Lameguy64 / Meido-Tek Productions - -## Settings - -PSN00BSDK_LIBS ?= ../../../libpsn00b - -# Edit this to point to psn00bsdk-setup.mk, or copy that over to your project's -# root folder (it only depends on environment variables). -include ../../../psn00bsdk-setup.mk - -# Project target name -TARGET = render2tex - -## Files - -# Searches for C, C++ and S (assembler) files in local directory -CFILES = $(notdir $(wildcard *.c)) -CPPFILES= $(notdir $(wildcard *.cpp)) -AFILES = $(notdir $(wildcard *.s)) - -# Create names for object files -OFILES = $(addprefix build/,$(CFILES:.c=.o)) \ - $(addprefix build/,$(CPPFILES:.cpp=.o)) \ - $(addprefix build/,$(AFILES:.s=.o)) - -# Project specific includes and libraries -# (use -I for include dirs, -L for library dirs, -l for static libraries) -INCLUDE += -LIBDIRS += -LIBS += - -## Build rules - -#all: iso -all: build/$(TARGET) - -iso: build/$(TARGET) resources - $(MKPSXISO) -y -q iso.xml - -resources: - # Add commands to build/convert your assets here - #$(LZPACK) data.xml - -build/$(TARGET): $(OFILES) - @mkdir -p $(dir $@) - $(LD) $(LDFLAGS_EXE) $(LIBDIRS) $^ $(LIBS) -o $@ - $(NM) -f posix -l -n $@ >$@.map - $(ELF2X) -q $@ $@.exe - -build/%.o: %.c - @mkdir -p $(dir $@) - $(CC) $(CFLAGS_EXE) $(INCLUDE) -c $< -o $@ - -build/%.o: %.cpp - @mkdir -p $(dir $@) - $(CXX) $(CPPFLAGS_EXE) $(INCLUDE) -c $< -o $@ - -build/%.o: %.s - @mkdir -p $(dir $@) - $(CC) $(AFLAGS_EXE) $(INCLUDE) -c $< -o $@ - -clean: - rm -rf build diff --git a/examples/graphics/render2tex/texture.s b/examples/graphics/render2tex/texture.s deleted file mode 100644 index e786dce..0000000 --- a/examples/graphics/render2tex/texture.s +++ /dev/null @@ -1,9 +0,0 @@ -# Assembler file for including the texture file in a more elegant manner - -.section .data - -.global tim_blendpattern -.type tim_blendpattern, @object -tim_blendpattern: - .incbin "blendpattern-16c.tim" - \ No newline at end of file diff --git a/examples/graphics/render2tex/texture.s.template b/examples/graphics/render2tex/texture.s.template new file mode 100644 index 0000000..8b09ad8 --- /dev/null +++ b/examples/graphics/render2tex/texture.s.template @@ -0,0 +1,8 @@ +# Assembler file for including the texture file in a more elegant manner + +.section .data + +.global tim_blendpattern +.type tim_blendpattern, @object +tim_blendpattern: + .incbin "${PROJECT_SOURCE_DIR}/blendpattern-16c.tim" diff --git a/examples/graphics/rgb24/CMakeLists.txt b/examples/graphics/rgb24/CMakeLists.txt new file mode 100644 index 0000000..c66ae69 --- /dev/null +++ b/examples/graphics/rgb24/CMakeLists.txt @@ -0,0 +1,28 @@ +# PSn00bSDK example CMake script +# (C) 2021 spicyjpeg - MPL licensed + +cmake_minimum_required(VERSION 3.21) + +if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND DEFINED ENV{PSN00BSDK_LIBS}) + set(CMAKE_TOOLCHAIN_FILE $ENV{PSN00BSDK_LIBS}/cmake/sdk.cmake) +endif() + +project( + rgb24 + LANGUAGES C ASM + VERSION 1.0.0 + DESCRIPTION "PSn00bSDK 24-bit RGB display example" + HOMEPAGE_URL "http://lameguy64.net/?page=psn00bsdk" +) + +configure_file(tim.s.template tim.s) + +file(GLOB _sources *.c) +psn00bsdk_add_executable( + rgb24 STATIC + ${_sources} + ${PROJECT_BINARY_DIR}/tim.s +) +#psn00bsdk_add_cd_image(rgb24_iso rgb24 iso.xml DEPENDS rgb24) + +install(FILES ${PROJECT_BINARY_DIR}/rgb24.exe DESTINATION .) diff --git a/examples/graphics/rgb24/makefile b/examples/graphics/rgb24/makefile deleted file mode 100644 index 9fa35ec..0000000 --- a/examples/graphics/rgb24/makefile +++ /dev/null @@ -1,65 +0,0 @@ -# PSn00bSDK makefile template -# Part of the PSn00bSDK Project -# 2019 - 2021 Lameguy64 / Meido-Tek Productions - -## Settings - -PSN00BSDK_LIBS ?= ../../../libpsn00b - -# Edit this to point to psn00bsdk-setup.mk, or copy that over to your project's -# root folder (it only depends on environment variables). -include ../../../psn00bsdk-setup.mk - -# Project target name -TARGET = rgb24 - -## Files - -# Searches for C, C++ and S (assembler) files in local directory -CFILES = $(notdir $(wildcard *.c)) -CPPFILES= $(notdir $(wildcard *.cpp)) -AFILES = $(notdir $(wildcard *.s)) - -# Create names for object files -OFILES = $(addprefix build/,$(CFILES:.c=.o)) \ - $(addprefix build/,$(CPPFILES:.cpp=.o)) \ - $(addprefix build/,$(AFILES:.s=.o)) - -# Project specific includes and libraries -# (use -I for include dirs, -L for library dirs, -l for static libraries) -INCLUDE += -LIBDIRS += -LIBS += - -## Build rules - -#all: iso -all: build/$(TARGET) - -iso: build/$(TARGET) resources - $(MKPSXISO) -y -q iso.xml - -resources: - # Add commands to build/convert your assets here - #$(LZPACK) data.xml - -build/$(TARGET): $(OFILES) - @mkdir -p $(dir $@) - $(LD) $(LDFLAGS_EXE) $(LIBDIRS) $^ $(LIBS) -o $@ - $(NM) -f posix -l -n $@ >$@.map - $(ELF2X) -q $@ $@.exe - -build/%.o: %.c - @mkdir -p $(dir $@) - $(CC) $(CFLAGS_EXE) $(INCLUDE) -c $< -o $@ - -build/%.o: %.cpp - @mkdir -p $(dir $@) - $(CXX) $(CPPFLAGS_EXE) $(INCLUDE) -c $< -o $@ - -build/%.o: %.s - @mkdir -p $(dir $@) - $(CC) $(AFLAGS_EXE) $(INCLUDE) -c $< -o $@ - -clean: - rm -rf build diff --git a/examples/graphics/rgb24/tim.s b/examples/graphics/rgb24/tim.s deleted file mode 100644 index a4432d9..0000000 --- a/examples/graphics/rgb24/tim.s +++ /dev/null @@ -1,7 +0,0 @@ -.section .data - -.global tim_image -.type tim_image, @object -tim_image: - .incbin "bunpattern.tim" - \ No newline at end of file diff --git a/examples/graphics/rgb24/tim.s.template b/examples/graphics/rgb24/tim.s.template new file mode 100644 index 0000000..9fb1fb6 --- /dev/null +++ b/examples/graphics/rgb24/tim.s.template @@ -0,0 +1,6 @@ +.section .data + +.global tim_image +.type tim_image, @object +tim_image: + .incbin "${PROJECT_SOURCE_DIR}/bunpattern.tim" -- cgit v1.2.3