aboutsummaryrefslogtreecommitdiff
path: root/examples/graphics
diff options
context:
space:
mode:
authorJohn "Lameguy" Wilbert Villamor <lameguy64@gmail.com>2022-03-25 09:22:20 +0800
committerGitHub <noreply@github.com>2022-03-25 09:22:20 +0800
commit975e614b3c840e2f717adac1d1cb9cee4e5e561b (patch)
tree6584ce5b0dbe27a466c95c81fac61b0d90f627bd /examples/graphics
parent05d44488bd5587786f4bd0286fc0f555c79aa46a (diff)
parent45168ae43e29aa5930ee5a206475ae836078915f (diff)
downloadpsn00bsdk-975e614b3c840e2f717adac1d1cb9cee4e5e561b.tar.gz
Merge pull request #46 from spicyjpeg/psxmdec
Critical ldscript fixes, initial MDEC support and CI updates
Diffstat (limited to 'examples/graphics')
-rw-r--r--examples/graphics/billboard/CMakeLists.txt10
-rw-r--r--examples/graphics/billboard/tim.s.template6
-rw-r--r--examples/graphics/render2tex/CMakeLists.txt10
-rw-r--r--examples/graphics/render2tex/texture.s.template8
-rw-r--r--examples/graphics/rgb24/CMakeLists.txt10
-rw-r--r--examples/graphics/rgb24/bunpattern.pngbin0 -> 59932 bytes
-rw-r--r--examples/graphics/rgb24/tim.s.template6
-rw-r--r--examples/graphics/tilesasm/CMakeLists.txt10
-rw-r--r--examples/graphics/tilesasm/data.s.template34
9 files changed, 12 insertions, 82 deletions
diff --git a/examples/graphics/billboard/CMakeLists.txt b/examples/graphics/billboard/CMakeLists.txt
index 1b417d2..4fc668d 100644
--- a/examples/graphics/billboard/CMakeLists.txt
+++ b/examples/graphics/billboard/CMakeLists.txt
@@ -11,14 +11,10 @@ project(
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_executable(billboard STATIC ${_sources})
#psn00bsdk_add_cd_image(billboard_iso billboard iso.xml DEPENDS billboard)
+psn00bsdk_target_incbin(billboard PRIVATE tim_image texture64.tim)
+
install(FILES ${PROJECT_BINARY_DIR}/billboard.exe TYPE BIN)
diff --git a/examples/graphics/billboard/tim.s.template b/examples/graphics/billboard/tim.s.template
deleted file mode 100644
index fbe7522..0000000
--- a/examples/graphics/billboard/tim.s.template
+++ /dev/null
@@ -1,6 +0,0 @@
-.section .data
-
-.global tim_image
-.type tim_image, @object
-tim_image:
- .incbin "${PROJECT_SOURCE_DIR}/texture64.tim"
diff --git a/examples/graphics/render2tex/CMakeLists.txt b/examples/graphics/render2tex/CMakeLists.txt
index 70e489e..a97cf02 100644
--- a/examples/graphics/render2tex/CMakeLists.txt
+++ b/examples/graphics/render2tex/CMakeLists.txt
@@ -11,14 +11,10 @@ project(
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_executable(render2tex STATIC ${_sources})
#psn00bsdk_add_cd_image(render2tex_iso render2tex iso.xml DEPENDS render2tex)
+psn00bsdk_target_incbin(render2tex PRIVATE tim_blendpattern blendpattern-16c.tim)
+
install(FILES ${PROJECT_BINARY_DIR}/render2tex.exe TYPE BIN)
diff --git a/examples/graphics/render2tex/texture.s.template b/examples/graphics/render2tex/texture.s.template
deleted file mode 100644
index 8b09ad8..0000000
--- a/examples/graphics/render2tex/texture.s.template
+++ /dev/null
@@ -1,8 +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 "${PROJECT_SOURCE_DIR}/blendpattern-16c.tim"
diff --git a/examples/graphics/rgb24/CMakeLists.txt b/examples/graphics/rgb24/CMakeLists.txt
index 449981a..9565b8b 100644
--- a/examples/graphics/rgb24/CMakeLists.txt
+++ b/examples/graphics/rgb24/CMakeLists.txt
@@ -11,14 +11,10 @@ project(
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_executable(rgb24 STATIC ${_sources})
#psn00bsdk_add_cd_image(rgb24_iso rgb24 iso.xml DEPENDS rgb24)
+psn00bsdk_target_incbin(rgb24 PRIVATE tim_image bunpattern.tim)
+
install(FILES ${PROJECT_BINARY_DIR}/rgb24.exe TYPE BIN)
diff --git a/examples/graphics/rgb24/bunpattern.png b/examples/graphics/rgb24/bunpattern.png
new file mode 100644
index 0000000..61524f8
--- /dev/null
+++ b/examples/graphics/rgb24/bunpattern.png
Binary files differ
diff --git a/examples/graphics/rgb24/tim.s.template b/examples/graphics/rgb24/tim.s.template
deleted file mode 100644
index 9fb1fb6..0000000
--- a/examples/graphics/rgb24/tim.s.template
+++ /dev/null
@@ -1,6 +0,0 @@
-.section .data
-
-.global tim_image
-.type tim_image, @object
-tim_image:
- .incbin "${PROJECT_SOURCE_DIR}/bunpattern.tim"
diff --git a/examples/graphics/tilesasm/CMakeLists.txt b/examples/graphics/tilesasm/CMakeLists.txt
index 3384875..5b8de96 100644
--- a/examples/graphics/tilesasm/CMakeLists.txt
+++ b/examples/graphics/tilesasm/CMakeLists.txt
@@ -11,14 +11,10 @@ project(
HOMEPAGE_URL "http://lameguy64.net/?page=psn00bsdk"
)
-configure_file(data.s.template data.s)
-
file(GLOB _sources *.s *.c)
-psn00bsdk_add_executable(
- tilesasm STATIC
- ${_sources}
- ${PROJECT_BINARY_DIR}/data.s
-)
+psn00bsdk_add_executable(tilesasm STATIC ${_sources})
#psn00bsdk_add_cd_image(tilesasm_iso tilesasm iso.xml DEPENDS tilesasm)
+psn00bsdk_target_incbin(tilesasm PRIVATE tim_tileset tiles_256.tim)
+
install(FILES ${PROJECT_BINARY_DIR}/tilesasm.exe TYPE BIN)
diff --git a/examples/graphics/tilesasm/data.s.template b/examples/graphics/tilesasm/data.s.template
deleted file mode 100644
index 1c4b01e..0000000
--- a/examples/graphics/tilesasm/data.s.template
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# LibPSn00b Example Programs
-#
-# Drawing Tile-maps with Assembler Routines
-# 2022 Meido-Tek Productions / PSn00bSDK Project
-#
-# Example by John "Lameguy" Wilbert Villamor (Lameguy64)
-#
-# This assembler file is used to include the file tiles.tim as an array named
-# 'tim_tileset' for use in this example program. Note how the variable name
-# itself is leading with an underscore (_) in this file. This is because
-# GNU C requires leading underscores for global variables, perhaps to prevent
-# function names and variable names from mixing up during the linking stage.
-
-# Tell assembler that the contents that follow must be in the .data section
-.section .data
-
-# This directive define the 'tim_tileset' label as a global symbol so that
-# main.c and other program modules can see this symbol during linking
-.global tim_tileset
-
-# This directive is not really required, but its best to define symbols
-# not pointing to program code as an object to help identify it as a
-# variable in debuggers
-.type tim_tileset, @object
-
-# The following line defines the variable 'tim_tileset' itself filled with the
-# contents of the file 'tiles.tim' by using the .incbin directive
-#
-# Remember the variable type of a symbol is always governed by how it is
-# declared in the C code
-#
-tim_tileset:
- .incbin "${PROJECT_SOURCE_DIR}/tiles_256.tim"