Update build system

This commit is contained in:
2016-12-23 17:29:19 -06:00
parent 5d3c02e077
commit 1053351da6
25 changed files with 203 additions and 92 deletions

View File

@ -11,13 +11,13 @@ if(WOMBAT_BUILD_TYPE STREQUAL "Native")
include_directories(${OPENGL_INCLUDE_DIR})
set(LIBS ${LIBS} ${OPENGL_LIBRARY})
find_package(SDL_IMAGE REQUIRED)
include_directories(${SDL_IMAGE_INCLUDE_DIR})
set(LIBS ${LIBS} ${SDL_IMAGE_LIBRARY})
#find_package(SDL_IMAGE REQUIRED)
#include_directories(${SDL_IMAGE_INCLUDE_DIR})
#set(LIBS ${LIBS} ${SDL_IMAGE_LIBRARY})
find_package(SDL_ttf REQUIRED)
include_directories(${SDL_TTF_INCLUDE_DIR})
set(LIBS ${LIBS} ${SDL_TTF_LIBRARY})
#find_package(SDL_ttf REQUIRED)
#include_directories(${SDL_TTF_INCLUDE_DIR})
#set(LIBS ${LIBS} ${SDL_TTF_LIBRARY})
elseif(WOMBAT_BUILD_TYPE STREQUAL "GBA")
endif()

View File

@ -1,6 +1,6 @@
/*
* Copyright 2016 gtalent2@gmail.com
*
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.

View File

@ -1,6 +1,6 @@
/*
* Copyright 2016 gtalent2@gmail.com
*
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.

View File

@ -1,6 +1,6 @@
/*
* Copyright 2016 gtalent2@gmail.com
*
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.

View File

@ -1,6 +1,6 @@
/*
* Copyright 2016 gtalent2@gmail.com
*
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.

View File

@ -1,6 +1,6 @@
/*
* Copyright 2016 gtalent2@gmail.com
*
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.

View File

@ -1,6 +1,6 @@
/*
* Copyright 2016 gtalent2@gmail.com
*
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.

View File

@ -1,6 +1,6 @@
/*
* Copyright 2016 gtalent2@gmail.com
*
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.

View File

@ -1,16 +1,18 @@
cmake_minimum_required(VERSION 2.8.8)
if(WOMBAT_BUILD_TYPE STREQUAL "GBA")
enable_language(C ASM)
set(
CPP
gba/core.cpp
gba/gfx.cpp
)
include_directories("gba")
elseif(WOMBAT_BUILD_TYPE STREQUAL "Native")
endif()
add_library(NostalgiaCore OBJECT ${CPP})
add_library(NostalgiaCore
${CPP}
core.cpp
)
install(
FILES

View File

@ -1,18 +1,19 @@
/*
* Copyright 2016 gtalent2@gmail.com
*
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include "../types.hpp"
#include "registers.hpp"
#include "gfx.hpp"
#include "types.hpp"
namespace nostalgia {
namespace core {
int init() {
return 0;
Error init() {
auto err = initGfx();
return err;
}
}

17
src/core/core.hpp Normal file
View File

@ -0,0 +1,17 @@
/*
* Copyright 2016 gtalent2@gmail.com
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include "gfx.hpp"
namespace nostalgia {
namespace core {
Error init();
}
}

View File

@ -1,8 +1,27 @@
/*
* Copyright 2016 gtalent2@gmail.com
*
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include "registers.hpp"
#include "../types.hpp"
namespace nostalgia {
namespace core {
Error initGfx() {
/* Sprite Mode ----\ */
/* ---\| */
/* Background 2 -\|| */
/* Objects -----\||| */
/* |||| */
REG_DISPCNT = 0x1400;
return 0;
}
}
}

View File

@ -1,6 +1,6 @@
/*
* Copyright 2016 gtalent2@gmail.com
*
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.

17
src/core/gfx.hpp Normal file
View File

@ -0,0 +1,17 @@
/*
* Copyright 2016 gtalent2@gmail.com
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include "types.hpp"
namespace nostalgia {
namespace core {
Error initGfx();
}
}

View File

@ -1,6 +1,6 @@
/*
* Copyright 2016 gtalent2@gmail.com
*
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
@ -8,8 +8,6 @@
#ifndef NOSTALGIA_CORE_TYPES_HPP
#define NOSTALGIA_CORE_TYPES_HPP
#include <cstdint>
namespace nostalgia {
namespace core {
@ -23,6 +21,8 @@ typedef unsigned uint_t;
typedef long long int64_t;
typedef unsigned long long uint64_t;
typedef uint32_t Error;
#ifdef _LP64
typedef uint64_t size_t;
#elif _LP32

View File

@ -7,13 +7,16 @@ set(WOMBAT_BUILD_TYPE "Native" CACHE STRING "The type of build to produce(Native
add_executable(
nostalgia
main.cpp
${OBJS}
)
#target_link_libraries(wombat ${LIBS})
set_target_properties(nostalgia
PROPERTIES
LINK_FLAGS ${LINKER_FLAGS}
COMPILER_FLAGS "-mthumb -mthumb-interwork"
)
objcopy_file(nostalgia)
if(COMMAND objcopy_file)
set_target_properties(nostalgia
PROPERTIES
LINK_FLAGS ${LINKER_FLAGS}
COMPILER_FLAGS "-mthumb -mthumb-interwork"
)
objcopy_file(nostalgia)
endif()
target_link_libraries(nostalgia NostalgiaCore)

View File

@ -1,11 +1,21 @@
/*
* Copyright 2016 gtalent2@gmail.com
*
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include "core/core.hpp"
using namespace nostalgia;
int main() {
core::init();
((unsigned short*)0x06000000)[120+80*240] = 0x001F;
((unsigned short*)0x06000000)[136+80*240] = 0x03E0;
((unsigned short*)0x06000000)[120+96*240] = 0x7C00;
return 0;
}