LIBRETRO_COMMON := $(CORE_DIR)/libretro/libretro-common
INCFLAGS        := -I$(CORE_DIR) -I$(LIBRETRO_COMMON)/include
VBA_DEFINES     := -D__LIBRETRO__ -DFINAL_VERSION -DC_CORE -DNO_DEBUGGER
VBA_DEFINES		+= -DNO_PNG

ifeq ($(TILED_RENDERING), 1)
VBA_DEFINES += -DTILED_RENDERING
endif

ifeq ($(FRONTEND_SUPPORTS_RGB565),1)
VBA_DEFINES += -DFRONTEND_SUPPORTS_RGB565
endif

ifeq ($(NO_LINK),1)
VBA_DEFINES += -DNO_LINK
endif

SOURCES_CXX :=
SOURCES_CXX += \
	$(CORE_DIR)/libretro/libretro.cpp \
	$(CORE_DIR)/libretro/UtilRetro.cpp \
	$(CORE_DIR)/libretro/SoundRetro.cpp

SOURCES_CXX += \
	$(CORE_DIR)/apu/Gb_Oscs.cpp \
	$(CORE_DIR)/apu/Gb_Apu_State.cpp \
	$(CORE_DIR)/apu/Blip_Buffer.cpp \
	$(CORE_DIR)/apu/Multi_Buffer.cpp \
	$(CORE_DIR)/apu/Effects_Buffer.cpp \
	$(CORE_DIR)/apu/Gb_Apu.cpp

SOURCES_CXX += \
	$(CORE_DIR)/gba/GBA-thumb.cpp \
	$(CORE_DIR)/gba/Sound.cpp \
	$(CORE_DIR)/gba/Mode1.cpp \
	$(CORE_DIR)/gba/CheatSearch.cpp \
	$(CORE_DIR)/gba/Globals.cpp \
	$(CORE_DIR)/gba/agbprint.cpp \
	$(CORE_DIR)/gba/Mode4.cpp \
	$(CORE_DIR)/gba/Mode3.cpp \
	$(CORE_DIR)/gba/Mode5.cpp \
	$(CORE_DIR)/gba/Mode2.cpp \
	$(CORE_DIR)/gba/ereader.cpp \
	$(CORE_DIR)/gba/GBA-arm.cpp \
	$(CORE_DIR)/gba/bios.cpp \
	$(CORE_DIR)/gba/Mode0.cpp \
	$(CORE_DIR)/gba/Flash.cpp \
	$(CORE_DIR)/gba/GBAGfx.cpp \
	$(CORE_DIR)/gba/Cheats.cpp \
	$(CORE_DIR)/gba/GBA.cpp \
	$(CORE_DIR)/gba/EEprom.cpp \
	$(CORE_DIR)/gba/RTC.cpp \
	$(CORE_DIR)/gba/Sram.cpp

SOURCES_CXX += \
	$(CORE_DIR)/gb/gbCartData.cpp \
	$(CORE_DIR)/gb/gbCheats.cpp \
	$(CORE_DIR)/gb/GB.cpp \
	$(CORE_DIR)/gb/gbGfx.cpp \
	$(CORE_DIR)/gb/gbGlobals.cpp \
	$(CORE_DIR)/gb/gbMemory.cpp \
	$(CORE_DIR)/gb/gbSGB.cpp \
	$(CORE_DIR)/gb/gbSound.cpp

# Filters
SOURCES_CXX += \
	$(CORE_DIR)/filters/interframe.cpp \
	$(CORE_DIR)/gba/gbafilter.cpp
