Skip to content

Commit

Permalink
Merge branch 'master' of github.com:nba-emu/NanoBoyAdvance
Browse files Browse the repository at this point in the history
  • Loading branch information
fleroviux committed Nov 2, 2023
2 parents d691624 + ca4d62a commit 0e0a1e2
Show file tree
Hide file tree
Showing 7 changed files with 164 additions and 3 deletions.
2 changes: 2 additions & 0 deletions external/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
set(toml11_BUILD_TEST OFF CACHE BOOL "Build toml tests" FORCE)

set(CMAKE_SKIP_INSTALL_RULES YES)

add_subdirectory(fmtlib)
add_subdirectory(toml11)

Expand Down
12 changes: 11 additions & 1 deletion src/platform/qt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ set(RESOURCES
set(CMAKE_AUTOMOC ON)

option(USE_QT6 "Use Qt 6" OFF)
option(PORTABLE_MODE "Portable Mode" ON)

if (USE_QT6)
find_package(Qt6 COMPONENTS Core Gui Widgets OpenGL OpenGLWidgets REQUIRED)
Expand All @@ -46,6 +47,10 @@ else()
set(QT_DEPS Qt5::Core Qt5::Gui Qt5::Widgets Qt5::OpenGL)
endif()

if (PORTABLE_MODE)
add_compile_definitions(PORTABLE_MODE)
endif()

# Append application resources (icon and manifest) on Win32.
if(WIN32)
list(APPEND RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/app.rc)
Expand All @@ -54,7 +59,7 @@ if(WIN32)
set(CMAKE_RC_COMPILER_INIT windres)
enable_language(RC)
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -i <SOURCE> -o <OBJECT>")
endif()
endif()
endif()

if (APPLE)
Expand Down Expand Up @@ -118,3 +123,8 @@ if(WIN32 AND PLATFORM_QT_STATIC)
set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
target_link_libraries(NanoBoyAdvance-Qt -static z zstd gcc stdc++ winpthread winmm version Imm32 Setupapi)
endif()

install(TARGETS NanoBoyAdvance-Qt DESTINATION bin)
install(FILES rc/io.github.nba_emuNanoBoyAdvance.png DESTINATION share/icons/hicolor/128x128/apps)
install(FILES rc/io.github.nba_emuNanoBoyAdvance.desktop DESTINATION share/applications)
install(FILES rc/io.github.nba_emuNanoBoyAdvance.metainfo.xml DESTINATION share/metainfo)
12 changes: 12 additions & 0 deletions src/platform/qt/rc/io.github.nba_emuNanoBoyAdvance.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Created with jdDesktopEntryEdit 1.0
[Desktop Entry]
Type=Application
Name=NanoBoyAdvance
Comment=A cycle-accurate Nintendo Game Boy Advance emulator
Icon=io.github.nba_emuNanoBoyAdvance
TryExec=NanoBoyAdvance
Exec=NanoBoyAdvance %f
MimeType=application/x-gameboy-advance-rom;pplication/x-agb-rom;application/x-gba-rom;
Categories=Game;Emulator;
Keywords=Emulator;Nintendo;GameBoy;Game Boy Advance;GBA;GB;
SingleMainWindow=true
118 changes: 118 additions & 0 deletions src/platform/qt/rc/io.github.nba_emuNanoBoyAdvance.metainfo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
<?xml version='1.0' encoding='utf-8'?>
<component type="desktop">
<!--Created with jdAppStreamEdit 6.0-->
<id>io.github.nba_emuNanoBoyAdvance</id>
<name>NanoBoyAdvance</name>
<summary>A cycle-accurate Nintendo Game Boy Advance emulator</summary>
<developer_name>fleroviux</developer_name>
<launchable type="desktop-id">io.github.nba_emuNanoBoyAdvance.desktop</launchable>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0</project_license>
<description>
<p>NanoBoyAdvance is a cycle-accurate Game Boy Advance emulator.
It aims to be as accurate as possible, while also offering enhancements such as improved audio quality.</p>
<p>Features</p>
<ul>
<li>Very high compatibility and accuracy</li>
<li>HQ audio mixer (for games which use Nintendo's MusicPlayer2000 sound engine)</li>
<li>Post-processing options (color correction, xBRZ upscaling and LCD ghosting simulation)</li>
<li>Save State support (10x save slots available)</li>
<li>Game controller support (buttons and axises can be remapped)</li>
<li>Loading ROMs from archives (Zip, 7z, Tar and limited RAR1 support)</li>
<li>RTC emulation</li>
<li>Solar Sensor emulation (for example: for Boktai - The Sun is in Your Hand)</li>
</ul>
<p>Accuracy</p>
<p>A lot of research and attention to detail has been put into developing this core and making it accurate.</p>
<ul>
<li>Cycle-accurate emulation of most components, including: CPU, DMA, timers, PPU and Game Pak prefetch</li>
<li>Passes all AGS aging cartridge tests (NBA was the first public emulator to achieve this)</li>
<li>Passes most tests in the mGBA test suite</li>
<li>Passes ARMWrestler, gba-suite and FuzzARM CPU tests</li>
</ul>
</description>
<screenshots>
<screenshot type="default">
<image type="source">https://github.com/nba-emu/NanoBoyAdvance/raw/v1.7/docs/screenshot.png</image>
</screenshot>
</screenshots>
<releases>
<release version="1.7" date="2023-03-26" type="stable">
<url>https://github.com/nba-emu/NanoBoyAdvance/releases/tag/v1.7</url>
<description>
<ul>
<li>UI: implement a 'Use integer scaling' option</li>
<li>UI: allow limiting the screen scale</li>
<li>UI: allow accessing the menu during fullscreen gameplay</li>
<li>UI: allow setting a custom save folder</li>
<li>Core: implement save compatibility with mGBA 0.10.0+</li>
<li>Core: implement basic support for the mGBA logging interface</li>
<li>PPU: rewrite the PPU to be mostly cycle-accurate</li>
<li>PPU: implement the GREENSWAP register</li>
<li>PPU: use the 6-th green channel bit during blending</li>
<li>PPU: round the blending result to the nearest integer</li>
<li>ARM: fix a minor timing oversight in ARM mode</li>
<li>ARM: SWP and SWPB should lock the bus (no DMA interleave is possible)</li>
<li>ARM: do not force-align mis-aligned PC in ARM mode</li>
<li>Bus: allow the CPU to execute idle cycles in parallel to DMA</li>
<li>Bus: more accurately emulate disabling the prefetch buffer</li>
<li>Bus: force the first CPU access after a DMA to be non-sequential</li>
<li>Bus: implement penalty for ROM code access during the last ROM prefetch cycle</li>
<li>IRQ: delay IO writes by one cycle</li>
<li>IRQ: delay update of the IE&amp;IF condition for unhalting the CPU</li>
<li>SIO: implement basic serial transfer timing</li>
<li>APU: emulate the master enable bit</li>
<li>APU: cancel a potentially pending event whan starting a channel</li>
<li>Scheduler: allow for (de)serialization of events for save states</li>
</ul>
</description>
</release>
<release version="1.6" date="2022-08-13" type="stable">
<url>https://github.com/nba-emu/NanoBoyAdvance/releases/tag/v1.6</url>
</release>
<release version="1.5" date="2022-05-29" type="stable">
<url>https://github.com/nba-emu/NanoBoyAdvance/releases/tag/v1.5</url>
</release>
<release version="1.4" date="2021-12-20" type="stable">
<url>https://github.com/nba-emu/NanoBoyAdvance/releases/tag/v1.4</url>
</release>
<release version="1.3" date="2021-02-01" type="stable">
<url>https://github.com/nba-emu/NanoBoyAdvance/releases/tag/1.3</url>
</release>
<release version="1.2" date="2020-07-30" type="stable">
<url>https://github.com/nba-emu/NanoBoyAdvance/releases/tag/v1.2</url>
</release>
<release version="1.1" date="2020-05-10" type="stable">
<url>https://github.com/nba-emu/NanoBoyAdvance/releases/tag/v1.1</url>
</release>
<release version="1.0" date="2020-05-10" type="stable">
<url>https://github.com/nba-emu/NanoBoyAdvance/releases/tag/v1.0</url>
</release>
</releases>
<url type="homepage">https://github.com/nba-emu/NanoBoyAdvance</url>
<url type="bugtracker">https://github.com/nba-emu/NanoBoyAdvance</url>
<categories>
<category>Game</category>
<category>Emulator</category>
</categories>
<recommends>
<control>pointing</control>
<control>keyboard</control>
<control>gamepad</control>
</recommends>
<content_rating type="oars-1.1"/>
<provides>
<binary>NanoBoyAdvance</binary>
<mediatype>application/x-gameboy-advance-rom</mediatype>
<mediatype>pplication/x-agb-rom</mediatype>
<mediatype>application/x-gba-rom</mediatype>
</provides>
<keywords>
<keyword>Emulator</keyword>
<keyword>Nintendo</keyword>
<keyword>GameBoy</keyword>
<keyword>Game Boy Advance</keyword>
<keyword>GBA</keyword>
<keyword>GB</keyword>
</keywords>
</component>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 20 additions & 2 deletions src/platform/qt/src/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
#include <filesystem>
#include <platform/config.hpp>
#include <Qt>
#include <QStandardPaths>
#include <QDebug>
#include <SDL.h>
#include <vector>

#ifdef MACOS_BUILD_APP_BUNDLE
Expand All @@ -21,7 +24,7 @@

namespace fs = std::filesystem;

struct QtConfig final : nba::PlatformConfig {
struct QtConfig final : nba::PlatformConfig {
QtConfig() {
config_path = GetConfigPath();
}
Expand Down Expand Up @@ -82,6 +85,15 @@ struct QtConfig final : nba::PlatformConfig {
}

void Save() {
auto config_dir = fs::path(config_path).parent_path();
if (!fs::exists(config_dir)) {
try {
fs::create_directories(config_dir);
} catch (const std::exception& ex) {
qDebug() << "HHH";
}
}

nba::PlatformConfig::Save(config_path);
}

Expand Down Expand Up @@ -126,7 +138,13 @@ struct QtConfig final : nba::PlatformConfig {
}
#endif

return "config.toml";
#ifdef PORTABLE_MODE
return "config.toml";
#else
auto config_directory = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation).toStdString();
const std::filesystem::path config_path = config_directory;
return (config_path / "NanoBoyAdvance" / "config.toml").string();
#endif
}

std::string config_path;
Expand Down
1 change: 1 addition & 0 deletions src/platform/qt/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ int main(int argc, char** argv) {

QCoreApplication::setOrganizationName("fleroviux");
QCoreApplication::setApplicationName("NanoBoyAdvance");
QGuiApplication::setDesktopFileName("io.github.nba_emuNanoBoyAdvance");

auto window = create_window(app, argc, argv);

Expand Down

0 comments on commit 0e0a1e2

Please sign in to comment.