Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/rendering' into MBC-3
Browse files Browse the repository at this point in the history
  • Loading branch information
NehaGujar1 committed Aug 5, 2023
2 parents 99cc8e3 + 563c78d commit 6a33b9e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ jobs:

- name: install_dependencies
run: |
sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu `lsb_release -sc` main universe restricted multiverse"
sudo apt-get update -y -qq
sudo apt-get install libsdl2-dev
if [ "$RUNNER_OS" == "Linux" ]; then
sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu `lsb_release -sc` main universe restricted multiverse"
sudo apt-get update -y -qq
sudo apt-get install libsdl2-dev
fi
- name: build
run: |
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# Dependencies
## SDL
### MacOS
`brew install sdl2`
### Linux
`sudo apt install libsdl2-dev`

### Windows
Download the development pack `SDL2-devel-2.0.5-VC.zip` from [here](https://github.com/libsdl-org/SDL/releases/tag/release-2.26.2)

Or use winget or choco

# Build
## Release
```
Expand Down
8 changes: 7 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ set(SOURCES
gameBoy.cpp
mmap.cpp
graphics.cpp

# -------
# Header Files
cpu.h
Expand All @@ -17,8 +16,15 @@ set(SOURCES

target_sources(${PROJECT_NAME} PRIVATE ${SOURCES})

find_package(SDL2 REQUIRED)
include_directories(${SDL2_INCLUDE_DIRS})

if (MSVC)
set_target_properties(
${PROJECT_NAME} PROPERTIES
VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/")
endif ()

target_link_libraries(${PROJECT_NAME} ${SDL2_LIBRARIES})

set(SDL2_INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}/include")
2 changes: 1 addition & 1 deletion src/gameBoy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ GBE::GBE()
printf("boot rom file not opened");

// Open the Game ROM
if ((gameROM = fopen("../tests/instr_timing.gb", "rb")) == NULL)
if ((gameROM = fopen("../tests/Tetris.gb", "rb")) == NULL)
printf("game rom file not opened");

// Set the Boot ROM
Expand Down

0 comments on commit 6a33b9e

Please sign in to comment.