Skip to content
Snippets Groups Projects
Commit 9c39208d authored by Geo Ster's avatar Geo Ster
Browse files

Initial commit

* This is the beginning of a surely arduous journey of semi-correctly emulating
the PS2 the flagship console from Sony in 2001. The console was chosen
for it's impressive performance at the time, relatively simple MIPS architecture
compared to the PowerPC (Gamecube) and x86 (Xbox) competitors at the time, and because
I own one since I wouldn't want to be caught doing piracy on an open source
competition...

The PS2 also has a myriad of resources available including comprehensive CPU documentation
for it's MIPS ISA which will be used in the development of this emulator. Any sources that I use, will be referenced
in the coresponding commits for the judges to look at. For development hardware documentation and info from real emulators will be used
(I'll try to avoid using code from other projects as much as possible though).
I've also done a PS1 emulator in the past so the minor similarities in architecture
will help speed this process up a little.

For now this is just a window with glfw and a ready opengl context.
I hope it will be able to boot the PS2 soon enough though...
parents
No related branches found
No related tags found
No related merge requests found
build/
.vscode/
*.iso
\ No newline at end of file
cmake_minimum_required(VERSION 3.10)
# Set the project name
set(PROJECT_NAME gcnemu)
set(CMAKE_CXX_STANDARD 20)
set(CXX_MODULES_FLAGS -std=c++20 -fmodules-ts)
project(${PROJECT_NAME})
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
# Build modules for all our needed STL headers, so we can use the nice module syntax everywhere uwu
set(STL_HEADERS iostream)
add_custom_target(
stl_modules
COMMAND g++-11 -std=c++20 -fmodules-ts -x c++-system-header ${STL_HEADERS}
VERBATIM
)
# Create executable target
add_executable(${PROJECT_NAME} src/main.cpp)
add_dependencies(${PROJECT_NAME} stl_modules)
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_compile_options(${PROJECT_NAME} PRIVATE ${CXX_MODULES_FLAGS})
# Use the Widgets module from Qt 5.
target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS})
[requires]
glad/0.1.34
glfw/3.3.4
[options]
glad:gl_profile=core
glad:gl_version=4.6
[generators]
cmake
\ No newline at end of file
#include <glad/glad.h>
#include <GLFW/glfw3.h>
import <iostream>;
constexpr unsigned int SCR_WIDTH = 800;
constexpr unsigned int SCR_HEIGHT = 600;
int main()
{
glfwInit();
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 6);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
GLFWwindow* window = glfwCreateWindow(SCR_WIDTH, SCR_HEIGHT, "Gamecube Emulator", NULL, NULL);
if (window == NULL)
{
std::cout << "Failed to create GLFW window" << std::endl;
glfwTerminate();
return -1;
}
glfwMakeContextCurrent(window);
glfwSetFramebufferSizeCallback(window, [](GLFWwindow* window, int width, int height)
{
glViewport(0, 0, width, height);
});
if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress))
{
std::cout << "Failed to initialize GLAD" << std::endl;
return -1;
}
while (!glfwWindowShouldClose(window))
{
if(glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS)
glfwSetWindowShouldClose(window, true);
glClearColor(0.2f, 0.3f, 0.3f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
glfwSwapBuffers(window);
glfwPollEvents();
}
glfwTerminate();
return 0;
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment