diff options
| author | 2013-08-29 23:35:09 -0400 | |
|---|---|---|
| committer | 2013-08-29 23:35:09 -0400 | |
| commit | 27474060e1287a67c45cd790d29b9095b35b2bdf (patch) | |
| tree | fcbc56f1182617c01597f13e1a18dbec147d4216 /src/akiru | |
| parent | Initial commit (diff) | |
| download | yuzu-27474060e1287a67c45cd790d29b9095b35b2bdf.tar.gz yuzu-27474060e1287a67c45cd790d29b9095b35b2bdf.tar.xz yuzu-27474060e1287a67c45cd790d29b9095b35b2bdf.zip | |
adding initial project layout
Diffstat (limited to 'src/akiru')
| -rw-r--r-- | src/akiru/CMakeLists.txt | 12 | ||||
| -rw-r--r-- | src/akiru/akiru.rc | bin | 0 -> 3284 bytes | |||
| -rw-r--r-- | src/akiru/akiru.vcxproj | 208 | ||||
| -rw-r--r-- | src/akiru/akiru.vcxproj.filters | 34 | ||||
| -rw-r--r-- | src/akiru/resource.h | bin | 0 -> 898 bytes | |||
| -rw-r--r-- | src/akiru/src/akiru.cpp | 124 | ||||
| -rw-r--r-- | src/akiru/src/akiru.h | 35 | ||||
| -rw-r--r-- | src/akiru/src/emuwindow/emuwindow_glfw.cpp | 100 | ||||
| -rw-r--r-- | src/akiru/src/emuwindow/emuwindow_glfw.h | 56 | ||||
| -rw-r--r-- | src/akiru/src/version.h | 6 |
10 files changed, 575 insertions, 0 deletions
diff --git a/src/akiru/CMakeLists.txt b/src/akiru/CMakeLists.txt new file mode 100644 index 000000000..9517b11a4 --- /dev/null +++ b/src/akiru/CMakeLists.txt | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | set(SRCS src/akiru.cpp | ||
| 2 | src/emuwindow/emuwindow_glfw.cpp) | ||
| 3 | |||
| 4 | # NOTE: This is a workaround for CMake bug 0006976 (missing X11_xf86vmode_LIB variable) | ||
| 5 | if (NOT X11_xf86vmode_LIB) | ||
| 6 | set(X11_xv86vmode_LIB Xxf86vm) | ||
| 7 | endif() | ||
| 8 | |||
| 9 | add_executable(akiru ${SRCS}) | ||
| 10 | target_link_libraries(akiru core common ${OPENGL_LIBRARIES} ${GLFW_LIBRARIES} GLEW rt ${X11_Xrandr_LIB} ${X11_xv86vmode_LIB}) | ||
| 11 | |||
| 12 | #install(TARGETS akiru RUNTIME DESTINATION ${bindir}) | ||
diff --git a/src/akiru/akiru.rc b/src/akiru/akiru.rc new file mode 100644 index 000000000..db4fc80b9 --- /dev/null +++ b/src/akiru/akiru.rc | |||
| Binary files differ | |||
diff --git a/src/akiru/akiru.vcxproj b/src/akiru/akiru.vcxproj new file mode 100644 index 000000000..f5ab86719 --- /dev/null +++ b/src/akiru/akiru.vcxproj | |||
| @@ -0,0 +1,208 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| 3 | <ItemGroup Label="ProjectConfigurations"> | ||
| 4 | <ProjectConfiguration Include="Debug|Win32"> | ||
| 5 | <Configuration>Debug</Configuration> | ||
| 6 | <Platform>Win32</Platform> | ||
| 7 | </ProjectConfiguration> | ||
| 8 | <ProjectConfiguration Include="Debug|x64"> | ||
| 9 | <Configuration>Debug</Configuration> | ||
| 10 | <Platform>x64</Platform> | ||
| 11 | </ProjectConfiguration> | ||
| 12 | <ProjectConfiguration Include="Release|Win32"> | ||
| 13 | <Configuration>Release</Configuration> | ||
| 14 | <Platform>Win32</Platform> | ||
| 15 | </ProjectConfiguration> | ||
| 16 | <ProjectConfiguration Include="Release|x64"> | ||
| 17 | <Configuration>Release</Configuration> | ||
| 18 | <Platform>x64</Platform> | ||
| 19 | </ProjectConfiguration> | ||
| 20 | </ItemGroup> | ||
| 21 | <PropertyGroup Label="Globals"> | ||
| 22 | <ProjectGuid>{CE7D2C07-21CE-4590-81AB-2ADA88A2B85F}</ProjectGuid> | ||
| 23 | <Keyword>Win32Proj</Keyword> | ||
| 24 | <RootNamespace>emu_win32</RootNamespace> | ||
| 25 | <ProjectName>akiru</ProjectName> | ||
| 26 | </PropertyGroup> | ||
| 27 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | ||
| 28 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> | ||
| 29 | <ConfigurationType>Application</ConfigurationType> | ||
| 30 | <UseDebugLibraries>true</UseDebugLibraries> | ||
| 31 | </PropertyGroup> | ||
| 32 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> | ||
| 33 | <ConfigurationType>Application</ConfigurationType> | ||
| 34 | <UseDebugLibraries>true</UseDebugLibraries> | ||
| 35 | </PropertyGroup> | ||
| 36 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> | ||
| 37 | <ConfigurationType>Application</ConfigurationType> | ||
| 38 | <UseDebugLibraries>false</UseDebugLibraries> | ||
| 39 | </PropertyGroup> | ||
| 40 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> | ||
| 41 | <ConfigurationType>Application</ConfigurationType> | ||
| 42 | <UseDebugLibraries>false</UseDebugLibraries> | ||
| 43 | </PropertyGroup> | ||
| 44 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | ||
| 45 | <ImportGroup Label="ExtensionSettings"> | ||
| 46 | </ImportGroup> | ||
| 47 | <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
| 48 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
| 49 | <Import Project="..\..\vsprops\Base.props" /> | ||
| 50 | <Import Project="..\..\vsprops\CodeGen_Debug.props" /> | ||
| 51 | <Import Project="..\..\vsprops\App.props" /> | ||
| 52 | <Import Project="..\..\vsprops\Optimization_Debug.props" /> | ||
| 53 | <Import Project="..\..\vsprops\Externals.props" /> | ||
| 54 | </ImportGroup> | ||
| 55 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> | ||
| 56 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
| 57 | <Import Project="..\..\vsprops\Base.props" /> | ||
| 58 | <Import Project="..\..\vsprops\CodeGen_Debug.props" /> | ||
| 59 | <Import Project="..\..\vsprops\App.props" /> | ||
| 60 | <Import Project="..\..\vsprops\Optimization_Debug.props" /> | ||
| 61 | <Import Project="..\..\vsprops\Externals.props" /> | ||
| 62 | </ImportGroup> | ||
| 63 | <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||
| 64 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
| 65 | <Import Project="..\..\vsprops\Base.props" /> | ||
| 66 | <Import Project="..\..\vsprops\CodeGen_Release.props" /> | ||
| 67 | <Import Project="..\..\vsprops\App.props" /> | ||
| 68 | <Import Project="..\..\vsprops\Optimization_Release.props" /> | ||
| 69 | <Import Project="..\..\vsprops\Externals.props" /> | ||
| 70 | </ImportGroup> | ||
| 71 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> | ||
| 72 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
| 73 | <Import Project="..\..\vsprops\Base.props" /> | ||
| 74 | <Import Project="..\..\vsprops\CodeGen_Release.props" /> | ||
| 75 | <Import Project="..\..\vsprops\App.props" /> | ||
| 76 | <Import Project="..\..\vsprops\Optimization_Release.props" /> | ||
| 77 | <Import Project="..\..\vsprops\Externals.props" /> | ||
| 78 | </ImportGroup> | ||
| 79 | <PropertyGroup Label="UserMacros" /> | ||
| 80 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> | ||
| 81 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> | ||
| 82 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||
| 83 | <CustomBuildBeforeTargets> | ||
| 84 | </CustomBuildBeforeTargets> | ||
| 85 | </PropertyGroup> | ||
| 86 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||
| 87 | <CustomBuildBeforeTargets /> | ||
| 88 | </PropertyGroup> | ||
| 89 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
| 90 | <ClCompile> | ||
| 91 | <PrecompiledHeader> | ||
| 92 | </PrecompiledHeader> | ||
| 93 | </ClCompile> | ||
| 94 | <Link /> | ||
| 95 | <CustomBuildStep> | ||
| 96 | <Outputs> | ||
| 97 | </Outputs> | ||
| 98 | <Command> | ||
| 99 | </Command> | ||
| 100 | </CustomBuildStep> | ||
| 101 | <PreBuildEvent /> | ||
| 102 | <Link /> | ||
| 103 | <Link> | ||
| 104 | <IgnoreSpecificDefaultLibraries>msvcrtd.lib;msvcrt.lib</IgnoreSpecificDefaultLibraries> | ||
| 105 | </Link> | ||
| 106 | </ItemDefinitionGroup> | ||
| 107 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | ||
| 108 | <ClCompile> | ||
| 109 | <PrecompiledHeader> | ||
| 110 | </PrecompiledHeader> | ||
| 111 | </ClCompile> | ||
| 112 | <Link /> | ||
| 113 | <CustomBuildStep> | ||
| 114 | <Outputs> | ||
| 115 | </Outputs> | ||
| 116 | <Command> | ||
| 117 | </Command> | ||
| 118 | </CustomBuildStep> | ||
| 119 | <PreBuildEvent /> | ||
| 120 | <Link> | ||
| 121 | <IgnoreSpecificDefaultLibraries>msvcrtd.lib;msvcrt.lib</IgnoreSpecificDefaultLibraries> | ||
| 122 | </Link> | ||
| 123 | </ItemDefinitionGroup> | ||
| 124 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||
| 125 | <ClCompile> | ||
| 126 | <PrecompiledHeader> | ||
| 127 | </PrecompiledHeader> | ||
| 128 | </ClCompile> | ||
| 129 | <Link> | ||
| 130 | <SpecifySectionAttributes> | ||
| 131 | </SpecifySectionAttributes> | ||
| 132 | <IgnoreSpecificDefaultLibraries>libcmt.lib</IgnoreSpecificDefaultLibraries> | ||
| 133 | </Link> | ||
| 134 | <CustomBuildStep> | ||
| 135 | <Command> | ||
| 136 | </Command> | ||
| 137 | </CustomBuildStep> | ||
| 138 | <CustomBuildStep> | ||
| 139 | <Message> | ||
| 140 | </Message> | ||
| 141 | </CustomBuildStep> | ||
| 142 | <CustomBuildStep> | ||
| 143 | <Outputs> | ||
| 144 | </Outputs> | ||
| 145 | </CustomBuildStep> | ||
| 146 | <PreBuildEvent /> | ||
| 147 | </ItemDefinitionGroup> | ||
| 148 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||
| 149 | <ClCompile> | ||
| 150 | <PrecompiledHeader> | ||
| 151 | </PrecompiledHeader> | ||
| 152 | </ClCompile> | ||
| 153 | <Link> | ||
| 154 | <SpecifySectionAttributes> | ||
| 155 | </SpecifySectionAttributes> | ||
| 156 | <IgnoreAllDefaultLibraries> | ||
| 157 | </IgnoreAllDefaultLibraries> | ||
| 158 | <IgnoreSpecificDefaultLibraries>libcmt.lib</IgnoreSpecificDefaultLibraries> | ||
| 159 | </Link> | ||
| 160 | <CustomBuildStep> | ||
| 161 | <Command> | ||
| 162 | </Command> | ||
| 163 | </CustomBuildStep> | ||
| 164 | <CustomBuildStep> | ||
| 165 | <Message> | ||
| 166 | </Message> | ||
| 167 | </CustomBuildStep> | ||
| 168 | <CustomBuildStep> | ||
| 169 | <Outputs> | ||
| 170 | </Outputs> | ||
| 171 | </CustomBuildStep> | ||
| 172 | <PreBuildEvent /> | ||
| 173 | </ItemDefinitionGroup> | ||
| 174 | <ItemGroup> | ||
| 175 | <ProjectReference Include="..\common\common.vcxproj"> | ||
| 176 | <Project>{dfe335fc-755d-4baa-8452-94434f8a1edb}</Project> | ||
| 177 | <Private>true</Private> | ||
| 178 | <ReferenceOutputAssembly>true</ReferenceOutputAssembly> | ||
| 179 | <CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies> | ||
| 180 | <LinkLibraryDependencies>true</LinkLibraryDependencies> | ||
| 181 | <UseLibraryDependencyInputs>false</UseLibraryDependencyInputs> | ||
| 182 | </ProjectReference> | ||
| 183 | <ProjectReference Include="..\core\core.vcxproj"> | ||
| 184 | <Project>{8aea7f29-3466-4786-a10d-6a4bd0610977}</Project> | ||
| 185 | <Private>true</Private> | ||
| 186 | <ReferenceOutputAssembly>true</ReferenceOutputAssembly> | ||
| 187 | <CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies> | ||
| 188 | <LinkLibraryDependencies>true</LinkLibraryDependencies> | ||
| 189 | <UseLibraryDependencyInputs>false</UseLibraryDependencyInputs> | ||
| 190 | </ProjectReference> | ||
| 191 | </ItemGroup> | ||
| 192 | <ItemGroup> | ||
| 193 | <ClCompile Include="src\emuwindow\emuwindow_glfw.cpp" /> | ||
| 194 | <ClCompile Include="src\akiru.cpp" /> | ||
| 195 | </ItemGroup> | ||
| 196 | <ItemGroup> | ||
| 197 | <ClInclude Include="resource.h" /> | ||
| 198 | <ClInclude Include="src\emuwindow\emuwindow_glfw.h" /> | ||
| 199 | <ClInclude Include="src\akiru.h" /> | ||
| 200 | <ClInclude Include="src\version.h" /> | ||
| 201 | </ItemGroup> | ||
| 202 | <ItemGroup> | ||
| 203 | <ResourceCompile Include="akiru.rc" /> | ||
| 204 | </ItemGroup> | ||
| 205 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | ||
| 206 | <ImportGroup Label="ExtensionTargets"> | ||
| 207 | </ImportGroup> | ||
| 208 | </Project> \ No newline at end of file | ||
diff --git a/src/akiru/akiru.vcxproj.filters b/src/akiru/akiru.vcxproj.filters new file mode 100644 index 000000000..2fc1128af --- /dev/null +++ b/src/akiru/akiru.vcxproj.filters | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| 3 | <ItemGroup> | ||
| 4 | <ClCompile Include="src\akiru.cpp" /> | ||
| 5 | <ClCompile Include="src\emuwindow\emuwindow_glfw.cpp"> | ||
| 6 | <Filter>emuwindow</Filter> | ||
| 7 | </ClCompile> | ||
| 8 | <ClCompile Include="src\emuwindow\emuwindow_sdl.cpp"> | ||
| 9 | <Filter>emuwindow</Filter> | ||
| 10 | </ClCompile> | ||
| 11 | </ItemGroup> | ||
| 12 | <ItemGroup> | ||
| 13 | <ClInclude Include="resource.h" /> | ||
| 14 | <ClInclude Include="src\version.h" /> | ||
| 15 | <ClInclude Include="src\emuwindow\emuwindow_glfw.h"> | ||
| 16 | <Filter>emuwindow</Filter> | ||
| 17 | </ClInclude> | ||
| 18 | <ClInclude Include="src\akiru.h" /> | ||
| 19 | <ClInclude Include="src\emuwindow\emuwindow_sdl.h"> | ||
| 20 | <Filter>emuwindow</Filter> | ||
| 21 | </ClInclude> | ||
| 22 | </ItemGroup> | ||
| 23 | <ItemGroup> | ||
| 24 | <ResourceCompile Include="akiru.rc" /> | ||
| 25 | </ItemGroup> | ||
| 26 | <ItemGroup> | ||
| 27 | <None Include="res\icon3_48x48.ico" /> | ||
| 28 | </ItemGroup> | ||
| 29 | <ItemGroup> | ||
| 30 | <Filter Include="emuwindow"> | ||
| 31 | <UniqueIdentifier>{e3161526-9f53-4670-8dae-2be81ff01bc2}</UniqueIdentifier> | ||
| 32 | </Filter> | ||
| 33 | </ItemGroup> | ||
| 34 | </Project> \ No newline at end of file | ||
diff --git a/src/akiru/resource.h b/src/akiru/resource.h new file mode 100644 index 000000000..0d42c8a8a --- /dev/null +++ b/src/akiru/resource.h | |||
| Binary files differ | |||
diff --git a/src/akiru/src/akiru.cpp b/src/akiru/src/akiru.cpp new file mode 100644 index 000000000..0d15c5b20 --- /dev/null +++ b/src/akiru/src/akiru.cpp | |||
| @@ -0,0 +1,124 @@ | |||
| 1 | /*! | ||
| 2 | * Copyright (C) 2013 Akiru Emulator | ||
| 3 | * | ||
| 4 | * @file akiry.cpp | ||
| 5 | * @author ShizZy <shizzy247@gmail.com> | ||
| 6 | * @date 2012-02-11 | ||
| 7 | * @brief Main entry point | ||
| 8 | * | ||
| 9 | * @section LICENSE | ||
| 10 | * This program is free software; you can redistribute it and/or | ||
| 11 | * modify it under the terms of the GNU General Public License as | ||
| 12 | * published by the Free Software Foundation; either version 2 of | ||
| 13 | * the License, or (at your option) any later version. | ||
| 14 | * | ||
| 15 | * This program is distributed in the hope that it will be useful, but | ||
| 16 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 18 | * General Public License for more details at | ||
| 19 | * http://www.gnu.org/copyleft/gpl.html | ||
| 20 | * | ||
| 21 | * Official project repository can be found at: | ||
| 22 | * http://code.google.com/p/gekko-gc-emu/ | ||
| 23 | */ | ||
| 24 | |||
| 25 | #include "common.h" | ||
| 26 | #include "platform.h" | ||
| 27 | |||
| 28 | #if EMU_PLATFORM == PLATFORM_LINUX | ||
| 29 | #include <unistd.h> | ||
| 30 | #endif | ||
| 31 | |||
| 32 | #include "config.h" | ||
| 33 | #include "xml.h" | ||
| 34 | #include "x86_utils.h" | ||
| 35 | |||
| 36 | //#include "core.h" | ||
| 37 | //#include "dvd/loader.h" | ||
| 38 | //#include "powerpc/cpu_core.h" | ||
| 39 | //#include "hw/hw.h" | ||
| 40 | //#include "video_core.h" | ||
| 41 | |||
| 42 | #include "emuwindow/emuwindow_glfw.h" | ||
| 43 | |||
| 44 | #include "akiru.h" | ||
| 45 | |||
| 46 | //////////////////////////////////////////////////////////////////////////////////////////////////// | ||
| 47 | // This is needed to fix SDL in certain build environments | ||
| 48 | #ifdef main | ||
| 49 | #undef main | ||
| 50 | #endif | ||
| 51 | |||
| 52 | //#define PLAY_FIFO_RECORDING | ||
| 53 | |||
| 54 | /// Application entry point | ||
| 55 | int __cdecl main(int argc, char **argv) { | ||
| 56 | u32 tight_loop; | ||
| 57 | |||
| 58 | LOG_NOTICE(TMASTER, APP_NAME " starting...\n"); | ||
| 59 | |||
| 60 | char program_dir[MAX_PATH]; | ||
| 61 | _getcwd(program_dir, MAX_PATH-1); | ||
| 62 | size_t cwd_len = strlen(program_dir); | ||
| 63 | program_dir[cwd_len] = '/'; | ||
| 64 | program_dir[cwd_len+1] = '\0'; | ||
| 65 | |||
| 66 | common::ConfigManager config_manager; | ||
| 67 | config_manager.set_program_dir(program_dir, MAX_PATH); | ||
| 68 | config_manager.ReloadConfig(NULL); | ||
| 69 | core::SetConfigManager(&config_manager); | ||
| 70 | |||
| 71 | EmuWindow_GLFW* emu_window = new EmuWindow_GLFW; | ||
| 72 | |||
| 73 | if (E_OK != core::Init(emu_window)) { | ||
| 74 | LOG_ERROR(TMASTER, "core initialization failed, exiting..."); | ||
| 75 | core::Kill(); | ||
| 76 | exit(1); | ||
| 77 | } | ||
| 78 | |||
| 79 | #ifndef PLAY_FIFO_RECORDING | ||
| 80 | // Load a game or die... | ||
| 81 | if (E_OK == dvd::LoadBootableFile(common::g_config->default_boot_file())) { | ||
| 82 | if (common::g_config->enable_auto_boot()) { | ||
| 83 | core::Start(); | ||
| 84 | } else { | ||
| 85 | LOG_ERROR(TMASTER, "Autoboot required in no-GUI mode... Exiting!\n"); | ||
| 86 | } | ||
| 87 | } else { | ||
| 88 | LOG_ERROR(TMASTER, "Failed to load a bootable file... Exiting!\n"); | ||
| 89 | exit(E_ERR); | ||
| 90 | } | ||
| 91 | // run the game | ||
| 92 | while(core::SYS_DIE != core::g_state) { | ||
| 93 | if (core::SYS_RUNNING == core::g_state) { | ||
| 94 | if(!(cpu->is_on)) { | ||
| 95 | cpu->Start(); // Initialize and start CPU. | ||
| 96 | } else { | ||
| 97 | for(tight_loop = 0; tight_loop < 10000; ++tight_loop) { | ||
| 98 | cpu->execStep(); | ||
| 99 | } | ||
| 100 | } | ||
| 101 | } else if (core::SYS_HALTED == core::g_state) { | ||
| 102 | core::Stop(); | ||
| 103 | } | ||
| 104 | } | ||
| 105 | core::Kill(); | ||
| 106 | #else | ||
| 107 | // load fifo log and replay it | ||
| 108 | |||
| 109 | // TODO: Restructure initialization process - Fix Flipper_Open being called from dvd loaders (wtf?) | ||
| 110 | Flipper_Open(); | ||
| 111 | video_core::Start(emu_window); | ||
| 112 | core::SetState(core::SYS_RUNNING); | ||
| 113 | |||
| 114 | fifo_player::FPFile file; | ||
| 115 | fifo_player::Load("/home/tony/20_frames.gff", file); | ||
| 116 | fifo_player::PlayFile(file); | ||
| 117 | |||
| 118 | // TODO: Wait for video core to finish - PlayFile should handle this | ||
| 119 | while (1); | ||
| 120 | #endif | ||
| 121 | delete emu_window; | ||
| 122 | |||
| 123 | return E_OK; | ||
| 124 | } | ||
diff --git a/src/akiru/src/akiru.h b/src/akiru/src/akiru.h new file mode 100644 index 000000000..a3b210922 --- /dev/null +++ b/src/akiru/src/akiru.h | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | /*! | ||
| 2 | * Copyright (C) 2005-2012 Gekko Emulator | ||
| 3 | * | ||
| 4 | * \file pcafe.h | ||
| 5 | * \author ShizZy <shizzy247@gmail.com> | ||
| 6 | * \date 2012-02-11 | ||
| 7 | * \brief Main entry point | ||
| 8 | * | ||
| 9 | * \section LICENSE | ||
| 10 | * This program is free software; you can redistribute it and/or | ||
| 11 | * modify it under the terms of the GNU General Public License as | ||
| 12 | * published by the Free Software Foundation; either version 2 of | ||
| 13 | * the License, or (at your option) any later version. | ||
| 14 | * | ||
| 15 | * This program is distributed in the hope that it will be useful, but | ||
| 16 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 18 | * General Public License for more details at | ||
| 19 | * http://www.gnu.org/copyleft/gpl.html | ||
| 20 | * | ||
| 21 | * Official project repository can be found at: | ||
| 22 | * http://code.google.com/p/gekko-gc-emu/ | ||
| 23 | */ | ||
| 24 | |||
| 25 | #ifndef PCAFE_PCAFE_H_ | ||
| 26 | #define PCAFE_PCAFE_H_ | ||
| 27 | |||
| 28 | #include "version.h" | ||
| 29 | |||
| 30 | #define APP_NAME "gekko" | ||
| 31 | #define APP_VERSION "0.31-" VERSION | ||
| 32 | #define APP_TITLE APP_NAME " " APP_VERSION | ||
| 33 | #define COPYRIGHT "Copyright (C) 2005-2012 Gekko Team" | ||
| 34 | |||
| 35 | #endif // PCAFE_PCAFE_H_ \ No newline at end of file | ||
diff --git a/src/akiru/src/emuwindow/emuwindow_glfw.cpp b/src/akiru/src/emuwindow/emuwindow_glfw.cpp new file mode 100644 index 000000000..884c10ad0 --- /dev/null +++ b/src/akiru/src/emuwindow/emuwindow_glfw.cpp | |||
| @@ -0,0 +1,100 @@ | |||
| 1 | /** | ||
| 2 | * Copyright (C) 2005-2012 Gekko Emulator | ||
| 3 | * | ||
| 4 | * @file emuwindow_glfw.h | ||
| 5 | * @author ShizZy <shizzy247@gmail.com> | ||
| 6 | * @date 2012-04-20 | ||
| 7 | * @brief Implementation implementation of EmuWindow class for GLFW | ||
| 8 | * | ||
| 9 | * @section LICENSE | ||
| 10 | * This program is free software; you can redistribute it and/or | ||
| 11 | * modify it under the terms of the GNU General Public License as | ||
| 12 | * published by the Free Software Foundation; either version 2 of | ||
| 13 | * the License, or (at your option) any later version. | ||
| 14 | * | ||
| 15 | * This program is distributed in the hope that it will be useful, but | ||
| 16 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 18 | * General Public License for more details at | ||
| 19 | * http://www.gnu.org/copyleft/gpl.html | ||
| 20 | * | ||
| 21 | * Official project repository can be found at: | ||
| 22 | * http://code.google.com/p/gekko-gc-emu/ | ||
| 23 | */ | ||
| 24 | |||
| 25 | #include "common.h" | ||
| 26 | #include "video_core.h" | ||
| 27 | #include "emuwindow_glfw.h" | ||
| 28 | #include "gc_controller.h" | ||
| 29 | #include "keyboard_input/keyboard_input.h" | ||
| 30 | |||
| 31 | static void OnKeyEvent(GLFWwindow win, int key, int action) { | ||
| 32 | EmuWindow_GLFW* emuwin = (EmuWindow_GLFW*)glfwGetWindowUserPointer(win); | ||
| 33 | input_common::GCController::GCButtonState state; | ||
| 34 | |||
| 35 | if (action == GLFW_PRESS) { | ||
| 36 | state = input_common::GCController::PRESSED; | ||
| 37 | } else { | ||
| 38 | state = input_common::GCController::RELEASED; | ||
| 39 | } | ||
| 40 | for (int channel = 0; channel < 4 && emuwin->controller_interface(); ++channel) { | ||
| 41 | emuwin->controller_interface()->SetControllerStatus(channel, key, state); | ||
| 42 | } | ||
| 43 | } | ||
| 44 | |||
| 45 | static void OnWindowSizeEvent(GLFWwindow win, int width, int height) { | ||
| 46 | EmuWindow_GLFW* emuwin = (EmuWindow_GLFW*)glfwGetWindowUserPointer(win); | ||
| 47 | emuwin->set_client_area_width(width); | ||
| 48 | emuwin->set_client_area_height(height); | ||
| 49 | } | ||
| 50 | |||
| 51 | /// EmuWindow_GLFW constructor | ||
| 52 | EmuWindow_GLFW::EmuWindow_GLFW() { | ||
| 53 | // Initialize the window | ||
| 54 | if(glfwInit() != GL_TRUE) { | ||
| 55 | LOG_ERROR(TVIDEO, "Failed to initialize GLFW! Exiting..."); | ||
| 56 | exit(E_ERR); | ||
| 57 | } | ||
| 58 | glfwWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3); | ||
| 59 | glfwWindowHint(GLFW_OPENGL_VERSION_MINOR, 1); | ||
| 60 | render_window_ = glfwCreateWindow(640, 480, GLFW_WINDOWED, "gekko", 0); | ||
| 61 | |||
| 62 | // Setup callbacks | ||
| 63 | glfwSetWindowUserPointer(render_window_, this); | ||
| 64 | glfwSetKeyCallback(render_window_, OnKeyEvent); | ||
| 65 | glfwSetWindowSizeCallback(render_window_, OnWindowSizeEvent); | ||
| 66 | |||
| 67 | DoneCurrent(); | ||
| 68 | } | ||
| 69 | |||
| 70 | /// EmuWindow_GLFW destructor | ||
| 71 | EmuWindow_GLFW::~EmuWindow_GLFW() { | ||
| 72 | glfwTerminate(); | ||
| 73 | } | ||
| 74 | |||
| 75 | /// Swap buffers to display the next frame | ||
| 76 | void EmuWindow_GLFW::SwapBuffers() { | ||
| 77 | glfwSwapBuffers(render_window_); | ||
| 78 | } | ||
| 79 | |||
| 80 | /// Polls window events | ||
| 81 | void EmuWindow_GLFW::PollEvents() { | ||
| 82 | // TODO(ShizZy): Does this belong here? This is a reasonable place to update the window title | ||
| 83 | // from the main thread, but this should probably be in an event handler... | ||
| 84 | static char title[128]; | ||
| 85 | sprintf(title, "%s (FPS: %02.02f)", window_title_.c_str(), | ||
| 86 | video_core::g_renderer->current_fps()); | ||
| 87 | glfwSetWindowTitle(render_window_, title); | ||
| 88 | |||
| 89 | glfwPollEvents(); | ||
| 90 | } | ||
| 91 | |||
| 92 | /// Makes the GLFW OpenGL context current for the caller thread | ||
| 93 | void EmuWindow_GLFW::MakeCurrent() { | ||
| 94 | glfwMakeContextCurrent(render_window_); | ||
| 95 | } | ||
| 96 | |||
| 97 | /// Releases (dunno if this is the "right" word) the GLFW context from the caller thread | ||
| 98 | void EmuWindow_GLFW::DoneCurrent() { | ||
| 99 | glfwMakeContextCurrent(NULL); | ||
| 100 | } | ||
diff --git a/src/akiru/src/emuwindow/emuwindow_glfw.h b/src/akiru/src/emuwindow/emuwindow_glfw.h new file mode 100644 index 000000000..1256cabe4 --- /dev/null +++ b/src/akiru/src/emuwindow/emuwindow_glfw.h | |||
| @@ -0,0 +1,56 @@ | |||
| 1 | /** | ||
| 2 | * Copyright (C) 2005-2012 Gekko Emulator | ||
| 3 | * | ||
| 4 | * @file emuwindow_glfw.h | ||
| 5 | * @author ShizZy <shizzy247@gmail.com> | ||
| 6 | * @date 2012-04-20 | ||
| 7 | * @brief Implementation implementation of EmuWindow class for GLFW | ||
| 8 | * | ||
| 9 | * @section LICENSE | ||
| 10 | * This program is free software; you can redistribute it and/or | ||
| 11 | * modify it under the terms of the GNU General Public License as | ||
| 12 | * published by the Free Software Foundation; either version 2 of | ||
| 13 | * the License, or (at your option) any later version. | ||
| 14 | * | ||
| 15 | * This program is distributed in the hope that it will be useful, but | ||
| 16 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 18 | * General Public License for more details at | ||
| 19 | * http://www.gnu.org/copyleft/gpl.html | ||
| 20 | * | ||
| 21 | * Official project repository can be found at: | ||
| 22 | * http://code.google.com/p/gekko-gc-emu/ | ||
| 23 | */ | ||
| 24 | |||
| 25 | #ifndef VIDEO_CORE_EMUWINDOW_GLFW_ | ||
| 26 | #define VIDEO_CORE_EMUWINDOW_GLFW_ | ||
| 27 | |||
| 28 | #include <GL/glew.h> | ||
| 29 | #include <GL/glfw3.h> | ||
| 30 | |||
| 31 | #include "video/emuwindow.h" | ||
| 32 | |||
| 33 | class EmuWindow_GLFW : public EmuWindow { | ||
| 34 | public: | ||
| 35 | EmuWindow_GLFW(); | ||
| 36 | ~EmuWindow_GLFW(); | ||
| 37 | |||
| 38 | /// Swap buffers to display the next frame | ||
| 39 | void SwapBuffers(); | ||
| 40 | |||
| 41 | /// Polls window events | ||
| 42 | void PollEvents(); | ||
| 43 | |||
| 44 | /// Makes the graphics context current for the caller thread | ||
| 45 | void MakeCurrent(); | ||
| 46 | |||
| 47 | /// Releases (dunno if this is the "right" word) the GLFW context from the caller thread | ||
| 48 | void DoneCurrent(); | ||
| 49 | |||
| 50 | GLFWwindow render_window_; ///< Internal GLFW render window | ||
| 51 | |||
| 52 | private: | ||
| 53 | |||
| 54 | }; | ||
| 55 | |||
| 56 | #endif // VIDEO_CORE_EMUWINDOW_GLFW_ | ||
diff --git a/src/akiru/src/version.h b/src/akiru/src/version.h new file mode 100644 index 000000000..07b88c641 --- /dev/null +++ b/src/akiru/src/version.h | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | // GENERATED - Do not edit! | ||
| 2 | #ifndef VERSION_H_ | ||
| 3 | #define VERSION_H_ | ||
| 4 | #define __BUILD__ "122" | ||
| 5 | #define VERSION __BUILD__ | ||
| 6 | #endif // VERSION_H_ | ||