From 8a117a0670c7f4ecc6ec3cce53be6ce63d0417f8 Mon Sep 17 00:00:00 2001 From: Jaby Date: Sun, 2 Oct 2022 17:47:24 +0200 Subject: [PATCH] Create Macros for PAL/NTSC --- include/PSX/GPU/GPU.hpp | 8 ++++++++ lib/Makefile | 3 +++ src/Library/Library.code-workspace | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/include/PSX/GPU/GPU.hpp b/include/PSX/GPU/GPU.hpp index c94ef54b..7a6ce66e 100644 --- a/include/PSX/GPU/GPU.hpp +++ b/include/PSX/GPU/GPU.hpp @@ -2,6 +2,14 @@ #define __JABYENGINE_GPU_HPP__ #include "../System/IOPorts/GPU_IO.hpp" +#if !defined(JABYENGINE_NTSC) && !defined(JABYENGINE_PAL) + #error "JABYENGINE_NTSC or JABYENGINE_PAL must be defined" +#else + #if defined(JABYENGINE_NTSC) && defined(JABYENGINE_PAL) + #error "Please define only JABYENGINE_NTSC or JABYENGINE_PAL" + #endif +#endif + namespace GPU { namespace Display { static void enable() { diff --git a/lib/Makefile b/lib/Makefile index c4c98c50..6167d7ac 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -7,6 +7,7 @@ PLATFORM ?= PSX #Build profile, possible values: release, debug, profile, coverage BUILD_DIR ?= bin BUILD_PROFILE ?= debug +TV_FORMAT ?= PAL CONFIG_NAME ?= $(PLATFORM)-$(BUILD_PROFILE) OUTPUT_DIR = $(BUILD_DIR)/$(CONFIG_NAME) @@ -56,6 +57,8 @@ CCFLAGS += $(ARCHFLAGS) CCFLAGS += $(CCFLAGS_$(BUILD_PROFILE)) +CCFLAGS += -DJABYENGINE_$(TV_FORMAT) + #Linker flags LDFLAGS_release += -Os diff --git a/src/Library/Library.code-workspace b/src/Library/Library.code-workspace index 94b6f8e3..cbd8bedf 100644 --- a/src/Library/Library.code-workspace +++ b/src/Library/Library.code-workspace @@ -65,7 +65,7 @@ "C_Cpp.default.compilerArgs": [ ], "C_Cpp.default.defines": [ - "" + "JABYENGINE_PAL" ], "files.exclude": { "**/*.o": true,