Skip to content

Commit

Permalink
Merge pull request #63 from emulated-gamer-bois/dev
Browse files Browse the repository at this point in the history
Game Boy emulator v1.0
  • Loading branch information
molleer committed May 13, 2021
2 parents b3a70bd + ec2a025 commit 4006b86
Show file tree
Hide file tree
Showing 388 changed files with 98,091 additions and 406,132 deletions.
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,22 @@ build/

# Clion
.idea/
.run/project.run.xml

# Cmake
cmake-build-debug/

*.ini

cmake-build-debug-visual-studio/
CMakeFiles/
Makefile
*.cmake
CMakeCache.txt
*.a
cmake-build-debug-coverage/

roms/o
roms/rgbds*
roms/dmg_boot.bin
/roms/games/
7 changes: 7 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[submodule "gtest"]
path = tests/gtest
url = https://git@github.com/google/googletest.git

[submodule "openal-soft"]
path = external_src/openal-soft
url = https://github.com/kcat/openal-soft.git
10 changes: 10 additions & 0 deletions .run/project.run.xml.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="project" type="CMakeRunConfiguration" factoryName="Application" WORKING_DIR="file://$PROJECT_DIR$/bin" REDIRECT_INPUT="false" ELEVATE="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="simple-gl-project" TARGET_NAME="project" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="simple-gl-project" RUN_TARGET_NAME="project">
<envs>
<env name="PATH" value="@DLL_DIRECTORIES@;%PATH%" />
</envs>
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>
</configuration>
</component>
28 changes: 28 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
dist: trusty
language: cpp

notifications:
email: false
slack: emulated-gamer-bois:92M1WTR813EoUsescZzmjurB

addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-5.0
packages:
- g++-6
- clang-5.0
- python3-pip

install:
- pip3 install --user cpp-coveralls

script:
- CXX=/usr/bin/g++-6 CC=/usr/bin/gcc-6 cmake -DCOVERAGE=1 -DTRAVIS=1 .
- cmake --configure .
- cmake --build .
- ./tests/tests

after_success:
- coveralls --root . -E ".*CMakeFiles.*"
56 changes: 38 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,37 +1,57 @@
cmake_minimum_required ( VERSION 3.0.2 )

project ( simple-gl-project )
project ( lame-boy )
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

set ( CMAKE_CXX_STANDARD 17)
set ( CMAKE_CXX_STANDARD_REQUIRED ON)
set ( CMAKE_EXPORT_COMPILE_COMMANDS ON )
set ( CMAKE_BUILD_TYPE DEBUG )

#Makes the emulator go swoosh
if(MSVC)
set ( CMAKE_CXX_FLAGS_DEBUG "/O2" )
set ( CMAKE_CXX_FLAGS_RELEASE "/O2" )
else()
set ( CMAKE_CXX_FLAGS_DEBUG "-O3" )
set ( CMAKE_CXX_FLAGS_RELEASE "-O3" )
endif()

add_definitions( -DGLM_ENABLE_EXPERIMENTAL )
if( CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17" )
endif()

# All libraries made is static
if (MSVC)
string(REPLACE "/MD" /MT CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
string(REPLACE "/MDd" /MTd CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
endif ()

# For windows we use our bundled binaries.
if(WIN32)
list(APPEND CMAKE_PREFIX_PATH "${CMAKE_SOURCE_DIR}/external/embree2")
list(APPEND CMAKE_PREFIX_PATH "${CMAKE_SOURCE_DIR}/external/sdl2")
list(APPEND CMAKE_PREFIX_PATH "${CMAKE_SOURCE_DIR}/external/glew")
list(APPEND CMAKE_PREFIX_PATH "${CMAKE_SOURCE_DIR}/external/glm")
endif(WIN32)

macro(config_build_output)
if(MSVC)
set(DLL_DIRECTORIES "${CMAKE_SOURCE_DIR}/external/bin")
set(MSVC_RUNTIME_DIR "${CMAKE_SOURCE_DIR}/bin")
set_target_properties( ${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${MSVC_RUNTIME_DIR}" )
set_target_properties( ${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG "${MSVC_RUNTIME_DIR}" )
set_target_properties( ${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE "${MSVC_RUNTIME_DIR}" )
set_target_properties( ${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${MSVC_RUNTIME_DIR}" )
set_target_properties( ${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL "${MSVC_RUNTIME_DIR}" )
set_target_properties( ${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${RUNTIME_DIR}" )
set_target_properties( ${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG "${RUNTIME_DIR}" )
set_target_properties( ${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE "${RUNTIME_DIR}" )
set_target_properties( ${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${RUNTIME_DIR}" )
set_target_properties( ${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL "${RUNTIME_DIR}" )
set(vs_user_file "${PROJECT_BINARY_DIR}/${PROJECT_NAME}.vcxproj.user")
string(REGEX REPLACE "v([0-9][0-9])([0-9])" "\\1.\\2" "VS_TOOLSET_VERSION" "${CMAKE_VS_PLATFORM_TOOLSET}")
configure_file("${CMAKE_SOURCE_DIR}/VSUserTemplate.user" "${vs_user_file}" @ONLY)
endif(MSVC)
endmacro(config_build_output)

if(WIN32 AND ("${CMAKE_GENERATOR}" MATCHES "NMake.*"))
set(DLL_DIRECTORIES "${CMAKE_SOURCE_DIR}/external/bin")
set(RUNTIME_DIR "${CMAKE_SOURCE_DIR}/bin")
configure_file("${CMAKE_SOURCE_DIR}/.run/project.run.xml.in" "${CMAKE_SOURCE_DIR}/.run/project.run.xml" @ONLY)
endif()


add_definitions(-DGLM_ENABLE_EXPERIMENTAL)
set ( CMAKE_EXPORT_COMPILE_COMMANDS ON )
set ( CMAKE_BUILD_TYPE DEBUG )
add_definitions ( -std=c++11 )

add_subdirectory ( labhelper )
add_subdirectory ( project )
add_subdirectory ( src )
add_subdirectory ( tests )
60 changes: 55 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,57 @@
# Description
This is the repository for the tutorials of the course TDA362/DIT223 Computer Graphics given at Chalmers University of
Technology 2019. It contains resources and skeleton code which is to be filled in by students in six different lab assignments and one larger project.
[![Build Status](https://www.travis-ci.com/emulated-gamer-bois/gameboy-emulator.svg?branch=dev)](https://www.travis-ci.com/emulated-gamer-bois/gameboy-emulator)

The accompanying web page to this repository is located at [http://www.cse.chalmers.se/edu/course/TDA361/tutorials/index.html](http://www.cse.chalmers.se/edu/course/TDA361/tutorials/index.html).
# Game Boy Emulator

Instructions on how to use this repository specifically can be found at [http://www.cse.chalmers.se/edu/course/TDA361/tutorials/start.html](http://www.cse.chalmers.se/edu/course/TDA361/tutorials/start.html).
This emulator was built as a Bachelor's project at Chalmers University of Technology by the students listed as contributors below. The emulator aims to emulate the original Game Boy released in 1989.

## Contributors

- David Möller [@molleer](https://github.com/molleer)
- Isak Lindgren [@isaaklindgren](https://github.com/isaaklindgren)
- Algot Axelzon [@AlgotAxelzon](https://github.com/isaaklindgren)
- Arvid Rydberg [@Riddarvid](https://github.com/Riddarvid)
- Andreas Palmqvist [@tehAndrew](https://github.com/tehAndrew)
- Carl Lindh [@Kviick](https://github.com/Kviick)

### Supervisor

- Roc R. Currius [@roc-r-currius](https://github.com/roc-r-currius)

## Setup

Install the required dependencies `sdl`, `sdl2`, `glew` and `openal`.

Ex:
```
sudo pacman -S sdl sdl2 glew openal
```
or
```
sudo apt-get install libsdl2-dev libglew-dev libopenal-dev
```

Windows users only need to install the following dependencies:
- Most recent [OpenAL 1.1 (Windows Installer)](https://openal.org/downloads/)

### Cloning the project

```
git clone git@github.com:emulated-gamer-bois/gameboy-emulator.git
cd gameboy-emulator
git submodule update --init --recursive
```
### Building and run the project: Command line

```
mkdir cmake-build-debug
cd cmake-build-debug
cmake ..
cmake --build .
src/project
```

### Build and run the project: CLion

- Open the project in CLion
- Select `Edit Configurations...`, set `Working Directory` to `$FileDir$` and press `OK`
- Rebuild and run the project
56 changes: 0 additions & 56 deletions README_LINUX.md

This file was deleted.

23 changes: 0 additions & 23 deletions VSUserTemplate.user

This file was deleted.

Binary file added external/bin/OpenAL32.lib
Binary file not shown.
Binary file removed external/bin/embree.dll
Binary file not shown.
Binary file removed external/bin/tbb.dll
Binary file not shown.
Binary file removed external/bin/tbbmalloc.dll
Binary file not shown.
28 changes: 0 additions & 28 deletions external/embree2/embree-config-version.cmake

This file was deleted.

59 changes: 0 additions & 59 deletions external/embree2/embree-config.cmake

This file was deleted.

0 comments on commit 4006b86

Please sign in to comment.