From 7340b1d6e3c9de607608a786b839001500a3348b Mon Sep 17 00:00:00 2001 From: i404788 <50617709+i404788@users.noreply.github.com> Date: Tue, 19 Nov 2019 21:37:47 +0000 Subject: Fix hanging UI when `null` addr --- src/libui_sdl/LAN_PCap.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/libui_sdl') diff --git a/src/libui_sdl/LAN_PCap.cpp b/src/libui_sdl/LAN_PCap.cpp index c228f5e..55b0891 100644 --- a/src/libui_sdl/LAN_PCap.cpp +++ b/src/libui_sdl/LAN_PCap.cpp @@ -257,12 +257,11 @@ bool Init(bool open_adapter) struct ifaddrs* curaddr = addrs; while (curaddr) { - if (strcmp(curaddr->ifa_name, adata->DeviceName)) + if (strcmp(curaddr->ifa_name, adata->DeviceName) || !curaddr->ifa_addr) { curaddr = curaddr->ifa_next; continue; } - if (!curaddr->ifa_addr) continue; u16 af = curaddr->ifa_addr->sa_family; if (af == AF_INET) -- cgit v1.2.3 From 7e07250652260657b0a78d66c556d6edc1175b27 Mon Sep 17 00:00:00 2001 From: i404788 <50617709+i404788@users.noreply.github.com> Date: Tue, 19 Nov 2019 22:19:30 +0000 Subject: Maybe better to log --- src/libui_sdl/LAN_PCap.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/libui_sdl') diff --git a/src/libui_sdl/LAN_PCap.cpp b/src/libui_sdl/LAN_PCap.cpp index 55b0891..0682e61 100644 --- a/src/libui_sdl/LAN_PCap.cpp +++ b/src/libui_sdl/LAN_PCap.cpp @@ -257,12 +257,18 @@ bool Init(bool open_adapter) struct ifaddrs* curaddr = addrs; while (curaddr) { - if (strcmp(curaddr->ifa_name, adata->DeviceName) || !curaddr->ifa_addr) + if (strcmp(curaddr->ifa_name, adata->DeviceName) { curaddr = curaddr->ifa_next; continue; } + if (!curaddr->ifa_addr){ + printf("Device does not have an address :/"); + curaddr = curaddr->ifa_next; + continue; + } + u16 af = curaddr->ifa_addr->sa_family; if (af == AF_INET) { -- cgit v1.2.3 From cdd60bb29822736bc7e0a0a3469e1aed33052e00 Mon Sep 17 00:00:00 2001 From: i404788 <50617709+i404788@users.noreply.github.com> Date: Tue, 19 Nov 2019 22:20:39 +0000 Subject: fix build --- src/libui_sdl/LAN_PCap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libui_sdl') diff --git a/src/libui_sdl/LAN_PCap.cpp b/src/libui_sdl/LAN_PCap.cpp index 0682e61..e407866 100644 --- a/src/libui_sdl/LAN_PCap.cpp +++ b/src/libui_sdl/LAN_PCap.cpp @@ -257,7 +257,7 @@ bool Init(bool open_adapter) struct ifaddrs* curaddr = addrs; while (curaddr) { - if (strcmp(curaddr->ifa_name, adata->DeviceName) + if (strcmp(curaddr->ifa_name, adata->DeviceName)) { curaddr = curaddr->ifa_next; continue; -- cgit v1.2.3 From c2a55bc2174daea687f865089af4e7a3fdc192f3 Mon Sep 17 00:00:00 2001 From: i404788 <50617709+i404788@users.noreply.github.com> Date: Tue, 19 Nov 2019 22:22:47 +0000 Subject: clean log --- src/libui_sdl/LAN_PCap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libui_sdl') diff --git a/src/libui_sdl/LAN_PCap.cpp b/src/libui_sdl/LAN_PCap.cpp index e407866..dd5a700 100644 --- a/src/libui_sdl/LAN_PCap.cpp +++ b/src/libui_sdl/LAN_PCap.cpp @@ -264,7 +264,7 @@ bool Init(bool open_adapter) } if (!curaddr->ifa_addr){ - printf("Device does not have an address :/"); + printf("Device does not have an address :/\n"); curaddr = curaddr->ifa_next; continue; } -- cgit v1.2.3 From 477be1d1551fdd4925c95404b5af025ed9f30081 Mon Sep 17 00:00:00 2001 From: i404788 <50617709+i404788@users.noreply.github.com> Date: Tue, 19 Nov 2019 22:34:02 +0000 Subject: add device name --- src/libui_sdl/LAN_PCap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libui_sdl') diff --git a/src/libui_sdl/LAN_PCap.cpp b/src/libui_sdl/LAN_PCap.cpp index dd5a700..75a2e3c 100644 --- a/src/libui_sdl/LAN_PCap.cpp +++ b/src/libui_sdl/LAN_PCap.cpp @@ -264,7 +264,7 @@ bool Init(bool open_adapter) } if (!curaddr->ifa_addr){ - printf("Device does not have an address :/\n"); + printf("Device (%s) does not have an address :/\n", curaddr->ifa_name); curaddr = curaddr->ifa_next; continue; } -- cgit v1.2.3 From 7730e6c1e2086db4c73ecebaa140ca45c1383a9f Mon Sep 17 00:00:00 2001 From: i404788 <50617709+i404788@users.noreply.github.com> Date: Wed, 20 Nov 2019 23:24:16 +0000 Subject: Coding style + weird spacing --- src/libui_sdl/LAN_PCap.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/libui_sdl') diff --git a/src/libui_sdl/LAN_PCap.cpp b/src/libui_sdl/LAN_PCap.cpp index 75a2e3c..312af0e 100644 --- a/src/libui_sdl/LAN_PCap.cpp +++ b/src/libui_sdl/LAN_PCap.cpp @@ -263,10 +263,11 @@ bool Init(bool open_adapter) continue; } - if (!curaddr->ifa_addr){ + if (!curaddr->ifa_addr) + { printf("Device (%s) does not have an address :/\n", curaddr->ifa_name); curaddr = curaddr->ifa_next; - continue; + continue; } u16 af = curaddr->ifa_addr->sa_family; -- cgit v1.2.3 From 7af658f0897c6d6ad1f67b9d7a9bc60955c029a0 Mon Sep 17 00:00:00 2001 From: Nadia Holmquist Pedersen Date: Wed, 4 Dec 2019 22:46:33 +0100 Subject: Add a UNIX_PORTABLE build option, turning it off makes a build of melonDS suitable for systemwide installation. --- melonDS.desktop | 11 ++++++++ src/NDSCart.cpp | 2 +- src/Platform.h | 8 +++++- src/libui_sdl/CMakeLists.txt | 8 ++++++ src/libui_sdl/Platform.cpp | 64 ++++++++++++++++++++++++++++++++++++++++++++ src/libui_sdl/main.cpp | 32 +++++++++++++++++----- 6 files changed, 117 insertions(+), 8 deletions(-) create mode 100644 melonDS.desktop (limited to 'src/libui_sdl') diff --git a/melonDS.desktop b/melonDS.desktop new file mode 100644 index 0000000..3dd921c --- /dev/null +++ b/melonDS.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=melonDS +GenericName=Nintendo DS Emulator +Comment=A fast and accurate Nintendo DS emulator. +Exec=melonDS +Type=Application +Categories=Game;Emulator; +Terminal=false +Icon=melon_256x256 +MimeType=application/x-nintendo-ds-rom; +Keywords=emulator;Nintendo;DS;NDS;Nintendo DS; diff --git a/src/NDSCart.cpp b/src/NDSCart.cpp index 0ecd304..5654a7d 100644 --- a/src/NDSCart.cpp +++ b/src/NDSCart.cpp @@ -815,7 +815,7 @@ bool ReadROMParams(u32 gamecode, u32* params) // [gamecode] [ROM size] [save type] [reserved] // list must be sorted by gamecode - FILE* f = Platform::OpenLocalFile("romlist.bin", "rb"); + FILE* f = Platform::OpenDataFile("romlist.bin"); if (!f) return false; fseek(f, 0, SEEK_END); diff --git a/src/Platform.h b/src/Platform.h index ca6971e..dfe83d0 100644 --- a/src/Platform.h +++ b/src/Platform.h @@ -32,15 +32,21 @@ void StopEmu(); // can be optionally restricted to only opening a file that already exists. // * OpenLocalFile(): // opens files local to the emulator (melonDS.ini, BIOS, firmware, ...) -// checks, by order of priority: +// For Windows builds, or portable UNIX builds it checks, by order of priority: // * current working directory // * emulator directory (essentially where the melonDS executable is) if supported // * any platform-specific application data directories // in create mode, if the file doesn't exist, it will be created in the emulator // directory if supported, or in the current directory otherwise +// For regular UNIX builds, the user's configuration directory is always used. +// * OpenDataFile(): +// Opens a file that was installed alongside melonDS on UNIX systems in /usr/share, etc. +// Looks in the user's data directory first, then the system's. +// If on Windows or a portable UNIX build, this simply calls OpenLocalFile(). FILE* OpenFile(const char* path, const char* mode, bool mustexist=false); FILE* OpenLocalFile(const char* path, const char* mode); +FILE* OpenDataFile(const char* path); inline bool FileExists(const char* name) { diff --git a/src/libui_sdl/CMakeLists.txt b/src/libui_sdl/CMakeLists.txt index 64206bf..afd38e4 100644 --- a/src/libui_sdl/CMakeLists.txt +++ b/src/libui_sdl/CMakeLists.txt @@ -31,6 +31,11 @@ target_link_libraries(melonDS core ${SDL2_LIBRARIES} libui) if (UNIX) + option(UNIX_PORTABLE "Make a portable build that looks for its configuration in the current directory" ON) + if (UNIX_PORTABLE) + add_definitions(-DUNIX_PORTABLE) + endif() + find_package(PkgConfig REQUIRED) pkg_check_modules(GTK3 REQUIRED gtk+-3.0) pkg_check_modules(SDL2 REQUIRED sdl2) @@ -61,4 +66,7 @@ elseif (WIN32) target_link_libraries(melonDS comctl32 d2d1 dwrite uxtheme ws2_32 iphlpapi) endif () +install(FILES ../../melonDS.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications) +install(FILES ../../icon/melon_256x256.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pixmaps) +install(FILES ../../romlist.bin DESTINATION ${CMAKE_INSTALL_PREFIX}/share/melonds) install(TARGETS melonDS RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) diff --git a/src/libui_sdl/Platform.cpp b/src/libui_sdl/Platform.cpp index 94b3791..5cbf344 100644 --- a/src/libui_sdl/Platform.cpp +++ b/src/libui_sdl/Platform.cpp @@ -135,6 +135,63 @@ FILE* OpenFile(const char* path, const char* mode, bool mustexist) return ret; } +#if !defined(UNIX_PORTABLE) && !defined(__WIN32__) + +FILE* OpenLocalFile(const char* path, const char* mode) +{ + std::string fullpath; + if (path[0] == '/') + { + // If it's an absolute path, just open that. + fullpath = std::string(path); + } + else + { + // Check user configuration directory + std::string confpath = std::string(g_get_user_config_dir()) + "/melonds/"; + g_mkdir_with_parents(confpath.c_str(), 0755); + fullpath = confpath + path; + } + + return OpenFile(fullpath.c_str(), mode, mode[0] != 'w'); +} + +FILE* OpenDataFile(const char* path) +{ + const char* melondir = "melonds"; + const char* const* sys_dirs = g_get_system_data_dirs(); + const char* user_dir = g_get_user_data_dir(); + + // First check the user's data directory + char* fullpath = g_build_path("/", user_dir, melondir, path, NULL); + if (access(fullpath, R_OK) == 0) + { + FILE* f = fopen(fullpath, "r"); + g_free(fullpath); + return f; + } + free(fullpath); + + // Then check the system data directories + for (size_t i = 0; sys_dirs[i] != NULL; i++) + { + const char* dir = sys_dirs[i]; + char* fullpath = g_build_path("/", dir, melondir, path, NULL); + + if (access(fullpath, R_OK) == 0) + { + FILE* f = fopen(fullpath, "r"); + g_free(fullpath); + return f; + } + free(fullpath); + } + + return NULL; +} + +#else + FILE* OpenLocalFile(const char* path, const char* mode) { bool relpath = false; @@ -257,6 +314,13 @@ FILE* OpenLocalFile(const char* path, const char* mode) return NULL; } +FILE* OpenDataFile(const char* path) +{ + return OpenLocalFile(path, "r"); +} + +#endif + void* Thread_Create(void (*func)()) { diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp index d6aa460..40b7079 100644 --- a/src/libui_sdl/main.cpp +++ b/src/libui_sdl/main.cpp @@ -21,6 +21,10 @@ #include #include +#ifndef __WIN32__ +#include +#endif + #include #include "libui/ui.h" @@ -2589,6 +2593,7 @@ int main(int argc, char** argv) printf("melonDS " MELONDS_VERSION "\n"); printf(MELONDS_URL "\n"); +#if defined(__WIN32__) || defined(UNIX_PORTABLE) if (argc > 0 && strlen(argv[0]) > 0) { int len = strlen(argv[0]); @@ -2615,6 +2620,13 @@ int main(int argc, char** argv) EmuDirectory = new char[2]; strcpy(EmuDirectory, "."); } +#else + const char* confdir = g_get_user_config_dir(); + const char* confname = "/melonds"; + EmuDirectory = new char[strlen(confdir) + strlen(confname) + 1]; + strcat(EmuDirectory, confdir); + strcat(EmuDirectory, confname); +#endif // http://stackoverflow.com/questions/14543333/joystick-wont-work-using-sdl SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1"); @@ -2650,15 +2662,23 @@ int main(int argc, char** argv) !Platform::LocalFileExists("bios9.bin") || !Platform::LocalFileExists("firmware.bin")) { - uiMsgBoxError( - NULL, - "BIOS/Firmware not found", +#if defined(__WIN32__) || defined(UNIX_PORTABLE) + const char* locationName = "the directory you run melonDS from"; +#else + char* locationName = EmuDirectory; +#endif + char msgboxtext[512]; + sprintf(msgboxtext, "One or more of the following required files don't exist or couldn't be accessed:\n\n" "bios7.bin -- ARM7 BIOS\n" "bios9.bin -- ARM9 BIOS\n" "firmware.bin -- firmware image\n\n" - "Dump the files from your DS and place them in the directory you run melonDS from.\n" - "Make sure that the files can be accessed."); + "Dump the files from your DS and place them in %s.\n" + "Make sure that the files can be accessed.", + locationName + ); + + uiMsgBoxError(NULL, "BIOS/Firmware not found", msgboxtext); uiUninit(); SDL_Quit(); @@ -2704,7 +2724,7 @@ int main(int argc, char** argv) } } { - FILE* f = Platform::OpenLocalFile("romlist.bin", "rb"); + FILE* f = Platform::OpenDataFile("romlist.bin"); if (f) { u32 data; -- cgit v1.2.3 From 959c37ead74968ef3bf8b66f852307f6e9fb10e3 Mon Sep 17 00:00:00 2001 From: Nadia Holmquist Pedersen Date: Wed, 4 Dec 2019 22:54:30 +0100 Subject: Open with rb instead of r in OpenDataFile to avoid potential problems with Windows. --- src/libui_sdl/Platform.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libui_sdl') diff --git a/src/libui_sdl/Platform.cpp b/src/libui_sdl/Platform.cpp index 5cbf344..8942927 100644 --- a/src/libui_sdl/Platform.cpp +++ b/src/libui_sdl/Platform.cpp @@ -316,7 +316,7 @@ FILE* OpenLocalFile(const char* path, const char* mode) FILE* OpenDataFile(const char* path) { - return OpenLocalFile(path, "r"); + return OpenLocalFile(path, "rb"); } #endif -- cgit v1.2.3 From 4f87707cda26f9c6a7a70ad46232eefebc5a4d82 Mon Sep 17 00:00:00 2001 From: Nadia Holmquist Pedersen Date: Thu, 5 Dec 2019 00:11:52 +0100 Subject: If all else fails, look for data files (romlist.bin) in the current working direcoty. --- src/libui_sdl/Platform.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/libui_sdl') diff --git a/src/libui_sdl/Platform.cpp b/src/libui_sdl/Platform.cpp index 8942927..8b83a01 100644 --- a/src/libui_sdl/Platform.cpp +++ b/src/libui_sdl/Platform.cpp @@ -186,6 +186,9 @@ FILE* OpenDataFile(const char* path) } free(fullpath); } + + FILE* f = fopen(path, "rb"); + if (f) return f; return NULL; } -- cgit v1.2.3 From 03f33fa5c3a47f17c3783ce045fc2f761ed11290 Mon Sep 17 00:00:00 2001 From: Nadia Holmquist Pedersen Date: Thu, 5 Dec 2019 00:12:40 +0100 Subject: Make UNIX builds non-portable by default. --- src/libui_sdl/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libui_sdl') diff --git a/src/libui_sdl/CMakeLists.txt b/src/libui_sdl/CMakeLists.txt index afd38e4..ae270e4 100644 --- a/src/libui_sdl/CMakeLists.txt +++ b/src/libui_sdl/CMakeLists.txt @@ -31,7 +31,7 @@ target_link_libraries(melonDS core ${SDL2_LIBRARIES} libui) if (UNIX) - option(UNIX_PORTABLE "Make a portable build that looks for its configuration in the current directory" ON) + option(UNIX_PORTABLE "Make a portable build that looks for its configuration in the current directory" OFF) if (UNIX_PORTABLE) add_definitions(-DUNIX_PORTABLE) endif() -- cgit v1.2.3 From 23bca8c17a3a630721e61079daf729ee1e5ed65f Mon Sep 17 00:00:00 2001 From: Nadia Holmquist Pedersen Date: Thu, 5 Dec 2019 00:40:59 +0100 Subject: Tell the user where to place romlist.bin if it can't be found for UNIX non-portable builds. --- src/libui_sdl/main.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src/libui_sdl') diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp index 40b7079..c7a4401 100644 --- a/src/libui_sdl/main.cpp +++ b/src/libui_sdl/main.cpp @@ -2724,6 +2724,17 @@ int main(int argc, char** argv) } } { + const char* romlist_missing = "Save memory type detection will not work correctly.\n\n" + "You should use the latest version of romlist.bin (provided in melonDS release packages)."; +#if !defined(UNIX_PORTABLE) && !defined(__WIN32__) + std::string missingstr = std::string(romlist_missing) + + "\n\nThe ROM list should be placed in " + g_get_user_data_dir() + "/melonds/, otherwise " + "melonDS will search for it in the current working directory."; + const char* romlist_missing_text = missingstr.c_str(); +#else + const char* romlist_missing_text = romlist_missing; +#endif + FILE* f = Platform::OpenDataFile("romlist.bin"); if (f) { @@ -2733,18 +2744,12 @@ int main(int argc, char** argv) if ((data >> 24) == 0) // old CRC-based list { - uiMsgBoxError(NULL, - "Your version of romlist.bin is outdated.", - "Save memory type detection will not work correctly.\n\n" - "You should use the latest version of romlist.bin (provided in melonDS release packages)."); + uiMsgBoxError(NULL, "Your version of romlist.bin is outdated.", romlist_missing_text); } } else { - uiMsgBoxError(NULL, - "romlist.bin not found.", - "Save memory type detection will not work correctly.\n\n" - "You should use the latest version of romlist.bin (provided in melonDS release packages)."); + uiMsgBoxError(NULL, "romlist.bin not found.", romlist_missing_text); } } -- cgit v1.2.3 From 1da9b3806c67282f7fc2c48b5b0b4614e553c34d Mon Sep 17 00:00:00 2001 From: Raphaël Zumer Date: Sun, 8 Dec 2019 15:31:18 -0500 Subject: Hook up the GBA slot to the UI A GBA cartridge may be loaded in the same way as a DS cartridge. If the extension of the selected file is "gba", it will be treated as a GBA file. The system boot logic is still centered around the DS cartridge, so loading a GBA file will not start or reset it. --- src/libui_sdl/main.cpp | 145 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 96 insertions(+), 49 deletions(-) (limited to 'src/libui_sdl') diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp index d6aa460..68bc6b8 100644 --- a/src/libui_sdl/main.cpp +++ b/src/libui_sdl/main.cpp @@ -105,9 +105,9 @@ int EmuRunning; volatile int EmuStatus; bool RunningSomething; -char ROMPath[1024]; -char SRAMPath[1024]; -char PrevSRAMPath[1024]; // for savestate 'undo load' +char ROMPath[2][1024]; +char SRAMPath[2][1024]; +char PrevSRAMPath[2][1024]; // for savestate 'undo load' bool SavestateLoaded; @@ -184,7 +184,7 @@ void SetupScreenRects(int width, int height); void TogglePause(void* blarg); void Reset(void* blarg); -void SetupSRAMPath(); +void SetupSRAMPath(int slot); void SaveState(int slot); void LoadState(int slot); @@ -1648,12 +1648,18 @@ void Reset(void* blarg) SavestateLoaded = false; uiMenuItemDisable(MenuItem_UndoStateLoad); - if (ROMPath[0] == '\0') + if (ROMPath[0][0] == '\0') NDS::LoadBIOS(); else { - SetupSRAMPath(); - NDS::LoadROM(ROMPath, SRAMPath, Config::DirectBoot); + SetupSRAMPath(0); + NDS::LoadROM(ROMPath[0], SRAMPath[0], Config::DirectBoot); + } + + if (ROMPath[1][0] != '\0') + { + SetupSRAMPath(1); + NDS::LoadGBAROM(ROMPath[1], SRAMPath[1]); } Run(); @@ -1688,41 +1694,53 @@ void Stop(bool internal) OSD::AddMessage(0xFFC040, "Shutdown"); } -void SetupSRAMPath() +void SetupSRAMPath(int slot) { - strncpy(SRAMPath, ROMPath, 1023); - SRAMPath[1023] = '\0'; - strncpy(SRAMPath + strlen(ROMPath) - 3, "sav", 3); + strncpy(SRAMPath[slot], ROMPath[slot], 1023); + SRAMPath[slot][1023] = '\0'; + strncpy(SRAMPath[slot] + strlen(ROMPath[slot]) - 3, "sav", 3); } -void TryLoadROM(char* file, int prevstatus) +void TryLoadROM(char* file, int slot, int prevstatus) { char oldpath[1024]; char oldsram[1024]; - strncpy(oldpath, ROMPath, 1024); - strncpy(oldsram, SRAMPath, 1024); + strncpy(oldpath, ROMPath[slot], 1024); + strncpy(oldsram, SRAMPath[slot], 1024); - strncpy(ROMPath, file, 1023); - ROMPath[1023] = '\0'; + strncpy(ROMPath[slot], file, 1023); + ROMPath[slot][1023] = '\0'; - SetupSRAMPath(); + SetupSRAMPath(0); + SetupSRAMPath(1); - if (NDS::LoadROM(ROMPath, SRAMPath, Config::DirectBoot)) + if (slot == 0 && NDS::LoadROM(ROMPath[slot], SRAMPath[slot], Config::DirectBoot)) { SavestateLoaded = false; uiMenuItemDisable(MenuItem_UndoStateLoad); - strncpy(PrevSRAMPath, SRAMPath, 1024); // safety + // Reload the inserted GBA cartridge (if any) + if (ROMPath[1][0] != '\0') NDS::LoadGBAROM(ROMPath[1], SRAMPath[1]); + + strncpy(PrevSRAMPath[slot], SRAMPath[slot], 1024); // safety Run(); } + else if (slot == 1 && NDS::LoadGBAROM(ROMPath[slot], SRAMPath[slot])) + { + SavestateLoaded = false; + uiMenuItemDisable(MenuItem_UndoStateLoad); + + strncpy(PrevSRAMPath[slot], SRAMPath[slot], 1024); // safety + if (RunningSomething) Run(); // do not start just from a GBA cart + } else { uiMsgBoxError(MainWindow, "Failed to load the ROM", "Make sure the file can be accessed and isn't opened in another application."); - strncpy(ROMPath, oldpath, 1024); - strncpy(SRAMPath, oldsram, 1024); + strncpy(ROMPath[slot], oldpath, 1024); + strncpy(SRAMPath[slot], oldsram, 1024); EmuRunning = prevstatus; } } @@ -1735,22 +1753,22 @@ void GetSavestateName(int slot, char* filename, int len) { int pos; - if (ROMPath[0] == '\0') // running firmware, no ROM + if (ROMPath[0][0] == '\0') // running firmware, no ROM { strcpy(filename, "firmware"); pos = 8; } else { - int l = strlen(ROMPath); + int l = strlen(ROMPath[0]); pos = l; - while (ROMPath[pos] != '.' && pos > 0) pos--; + while (ROMPath[0][pos] != '.' && pos > 0) pos--; if (pos == 0) pos = l; // avoid buffer overflow. shoddy if (pos > len-5) pos = len-5; - strncpy(&filename[0], ROMPath, pos); + strncpy(&filename[0], ROMPath[0], pos); } strcpy(&filename[pos], ".ml"); filename[pos+3] = '0'+slot; @@ -1818,16 +1836,16 @@ void LoadState(int slot) if (!failed) { - if (Config::SavestateRelocSRAM && ROMPath[0]!='\0') + if (Config::SavestateRelocSRAM && ROMPath[0][0]!='\0') { - strncpy(PrevSRAMPath, SRAMPath, 1024); + strncpy(PrevSRAMPath[0], SRAMPath[0], 1024); - strncpy(SRAMPath, filename, 1019); - int len = strlen(SRAMPath); - strcpy(&SRAMPath[len], ".sav"); - SRAMPath[len+4] = '\0'; + strncpy(SRAMPath[0], filename, 1019); + int len = strlen(SRAMPath[0]); + strcpy(&SRAMPath[0][len], ".sav"); + SRAMPath[0][len+4] = '\0'; - NDS::RelocateSave(SRAMPath, false); + NDS::RelocateSave(SRAMPath[0], false); } char msg[64]; @@ -1883,14 +1901,14 @@ void SaveState(int slot) if (slot > 0) uiMenuItemEnable(MenuItem_LoadStateSlot[slot-1]); - if (Config::SavestateRelocSRAM && ROMPath[0]!='\0') + if (Config::SavestateRelocSRAM && ROMPath[0][0]!='\0') { - strncpy(SRAMPath, filename, 1019); - int len = strlen(SRAMPath); - strcpy(&SRAMPath[len], ".sav"); - SRAMPath[len+4] = '\0'; + strncpy(SRAMPath[0], filename, 1019); + int len = strlen(SRAMPath[0]); + strcpy(&SRAMPath[0][len], ".sav"); + SRAMPath[0][len+4] = '\0'; - NDS::RelocateSave(SRAMPath, true); + NDS::RelocateSave(SRAMPath[0], true); } } @@ -1917,10 +1935,10 @@ void UndoStateLoad() NDS::DoSavestate(backup); delete backup; - if (ROMPath[0]!='\0') + if (ROMPath[0][0]!='\0') { - strncpy(SRAMPath, PrevSRAMPath, 1024); - NDS::RelocateSave(SRAMPath, false); + strncpy(SRAMPath[0], PrevSRAMPath[0], 1024); + NDS::RelocateSave(SRAMPath[0], false); } OSD::AddMessage(0, "State load undone"); @@ -1964,7 +1982,11 @@ void OnDropFile(uiWindow* window, char* file, void* blarg) while (EmuStatus != 2); } - TryLoadROM(file, prevstatus); + TryLoadROM(file, 0, prevstatus); + } + else if (!strcasecmp(ext, "gba")) + { + TryLoadROM(file, 1, prevstatus); } } @@ -1995,7 +2017,7 @@ void OnOpenFile(uiMenuItem* item, uiWindow* window, void* blarg) EmuRunning = 2; while (EmuStatus != 2); - char* file = uiOpenFile(window, "DS ROM (*.nds)|*.nds;*.srl|Any file|*.*", Config::LastROMFolder); + char* file = uiOpenFile(window, "DS ROM (*.nds)|*.nds;*.srl|GBA ROM (*.gba)|*.gba|Any file|*.*", Config::LastROMFolder); if (!file) { EmuRunning = prevstatus; @@ -2006,8 +2028,17 @@ void OnOpenFile(uiMenuItem* item, uiWindow* window, void* blarg) while (file[pos] != '/' && file[pos] != '\\' && pos > 0) pos--; strncpy(Config::LastROMFolder, file, pos); Config::LastROMFolder[pos] = '\0'; + char* ext = &file[strlen(file)-3]; + + if (!strcasecmp(ext, "gba")) + { + TryLoadROM(file, 1, prevstatus); + } + else + { + TryLoadROM(file, 0, prevstatus); + } - TryLoadROM(file, prevstatus); uiFreeText(file); } @@ -2032,7 +2063,7 @@ void OnRun(uiMenuItem* item, uiWindow* window, void* blarg) { if (!RunningSomething) { - ROMPath[0] = '\0'; + ROMPath[0][0] = '\0'; NDS::LoadBIOS(); } @@ -2852,14 +2883,30 @@ int main(int argc, char** argv) if (!strcasecmp(ext, "nds") || !strcasecmp(ext, "srl")) { - strncpy(ROMPath, file, 1023); - ROMPath[1023] = '\0'; + strncpy(ROMPath[0], file, 1023); + ROMPath[0][1023] = '\0'; - SetupSRAMPath(); + SetupSRAMPath(0); - if (NDS::LoadROM(ROMPath, SRAMPath, Config::DirectBoot)) + if (NDS::LoadROM(ROMPath[0], SRAMPath[0], Config::DirectBoot)) Run(); } + + if (argc > 2) + { + file = argv[2]; + ext = &file[strlen(file)-3]; + + if (!strcasecmp(ext, "gba")) + { + strncpy(ROMPath[1], file, 1023); + ROMPath[1][1023] = '\0'; + + SetupSRAMPath(1); + + NDS::LoadGBAROM(ROMPath[1], SRAMPath[1]); + } + } } uiMain(); -- cgit v1.2.3 From 91bf62a1d45fd8e81c6c77cb7072898f184c3a1c Mon Sep 17 00:00:00 2001 From: Raphaël Zumer Date: Sun, 8 Dec 2019 15:55:06 -0500 Subject: Keep GBA carts loaded when booting to firmware --- src/libui_sdl/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/libui_sdl') diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp index 68bc6b8..1e6069e 100644 --- a/src/libui_sdl/main.cpp +++ b/src/libui_sdl/main.cpp @@ -2065,6 +2065,12 @@ void OnRun(uiMenuItem* item, uiWindow* window, void* blarg) { ROMPath[0][0] = '\0'; NDS::LoadBIOS(); + + if (ROMPath[1][0] != '\0') + { + SetupSRAMPath(1); + NDS::LoadGBAROM(ROMPath[1], SRAMPath[1]); + } } Run(); -- cgit v1.2.3 From 4e8b0c8ce451bc11de8b11b4da14a24242c8c34e Mon Sep 17 00:00:00 2001 From: Raphaël Zumer Date: Mon, 9 Dec 2019 06:09:30 -0500 Subject: Eject GBA cartridges on stop from the UI --- src/GBACart.cpp | 31 +++++++++++++++++++++++++++---- src/libui_sdl/main.cpp | 3 +++ 2 files changed, 30 insertions(+), 4 deletions(-) (limited to 'src/libui_sdl') diff --git a/src/GBACart.cpp b/src/GBACart.cpp index 937958c..a0483b1 100644 --- a/src/GBACart.cpp +++ b/src/GBACart.cpp @@ -145,9 +145,9 @@ void LoadSave(const char* path) } else if (SRAMType == S_FLASH1M) { - // Macronix 128K chip - SRAMFlash.device = 0x09; - SRAMFlash.manufacturer = 0xC2; + // Sanyo 128K chip + SRAMFlash.device = 0x13; + SRAMFlash.manufacturer = 0x62; } } @@ -175,7 +175,30 @@ void RelocateSave(const char* path, bool write) u8 Read_Flash(u32 addr) { - // TODO: pokemen + if (SRAMFlash.cmd == 0) // no cmd + { + return *(u8*)&SRAM[addr + 0x10000 * SRAMFlash.bank]; + } + + // TODO properly keep track of command sequences, + // and deny unauthorized writes + switch (SRAMFlash.cmd) + { + case 0x90: // chip ID + if (addr == 0x0A000000) return SRAMFlash.manufacturer; + if (addr == 0x0A000001) return SRAMFlash.device; + break; + case 0xF0: // terminate command (TODO: break if non-Macronix chip and not at the end of an ID call?) + SRAMFlash.state = 0; + SRAMFlash.cmd = 0; + break; + case 0xB0: // bank switching (128K only) + break; // we don't track the request for now + default: + printf("GBACart_SRAM::Read_Flash: unknown command 0x%02X @ 0x%08X\n", SRAMFlash.cmd, addr); + break; + } + return 0xFF; } diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp index 1e6069e..31b0488 100644 --- a/src/libui_sdl/main.cpp +++ b/src/libui_sdl/main.cpp @@ -1674,6 +1674,9 @@ void Stop(bool internal) while (EmuStatus != 2); RunningSomething = false; + // eject any inserted GBA cartridge + ROMPath[1][0] = '\0'; + uiWindowSetTitle(MainWindow, "melonDS " MELONDS_VERSION); for (int i = 0; i < 9; i++) uiMenuItemDisable(MenuItem_SaveStateSlot[i]); -- cgit v1.2.3 From ca9f183d24c028cbbbecbe07aefb37bdcd04a581 Mon Sep 17 00:00:00 2001 From: Raphaël Zumer Date: Tue, 10 Dec 2019 17:54:34 -0500 Subject: Hook up solar sensor control to the UI It uses hardcoded keypad left and right arrows. --- src/GBACart.cpp | 8 +++++--- src/GBACart.h | 2 +- src/libui_sdl/main.cpp | 15 +++++++++++++++ 3 files changed, 21 insertions(+), 4 deletions(-) (limited to 'src/libui_sdl') diff --git a/src/GBACart.cpp b/src/GBACart.cpp index 5b81900..a7ddf9b 100644 --- a/src/GBACart.cpp +++ b/src/GBACart.cpp @@ -462,6 +462,7 @@ const char SOLAR_SENSOR_GAMECODES[10][5] = bool CartInserted; +bool HasSolarSensor; u8* CartROM; u32 CartROMSize; u32 CartCRC; @@ -488,6 +489,7 @@ void DeInit() void Reset() { CartInserted = false; + HasSolarSensor = false; if (CartROM) delete[] CartROM; CartROM = NULL; CartROMSize = 0; @@ -529,10 +531,10 @@ bool LoadROM(const char* path, const char* sram) for (int i = 0; i < sizeof(SOLAR_SENSOR_GAMECODES)/sizeof(SOLAR_SENSOR_GAMECODES[0]); i++) { - if (strcmp(gamecode, SOLAR_SENSOR_GAMECODES[i]) == 0) CartGPIO.has_solar_sensor = true; + if (strcmp(gamecode, SOLAR_SENSOR_GAMECODES[i]) == 0) HasSolarSensor = true; } - if (CartGPIO.has_solar_sensor) + if (HasSolarSensor) { printf("GBA solar sensor support detected!\n"); } @@ -570,7 +572,7 @@ void WriteGPIO(u32 addr, u16 val) case 0xC4: CartGPIO.data &= ~CartGPIO.direction; CartGPIO.data |= val & CartGPIO.direction; - if (CartGPIO.has_solar_sensor) GBACart_SolarSensor::Process(&CartGPIO); + if (HasSolarSensor) GBACart_SolarSensor::Process(&CartGPIO); break; case 0xC6: CartGPIO.direction = val; diff --git a/src/GBACart.h b/src/GBACart.h index 32a2171..032c4fc 100644 --- a/src/GBACart.h +++ b/src/GBACart.h @@ -45,13 +45,13 @@ namespace GBACart struct GPIO { - bool has_solar_sensor; u16 data; u16 direction; u16 control; }; extern bool CartInserted; +extern bool HasSolarSensor; extern u8* CartROM; extern u32 CartROMSize; diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp index 31b0488..1b7cfe6 100644 --- a/src/libui_sdl/main.cpp +++ b/src/libui_sdl/main.cpp @@ -38,6 +38,7 @@ #include "DlgWifiSettings.h" #include "../NDS.h" +#include "../GBACart.h" #include "../GPU.h" #include "../SPU.h" #include "../Wifi.h" @@ -1291,6 +1292,20 @@ int OnAreaKeyEvent(uiAreaHandler* handler, uiArea* area, uiAreaKeyEvent* evt) { if (evt->Modifiers == 0x0) UndoStateLoad(); } + else if (evt->Scancode == 0x4B) // Keypad left + { + if (GBACart::CartInserted && GBACart::HasSolarSensor) + { + if (GBACart_SolarSensor::LightLevel > 0) GBACart_SolarSensor::LightLevel--; + } + } + else if (evt->Scancode == 0x4D) // Keypad right + { + if (GBACart::CartInserted && GBACart::HasSolarSensor) + { + if (GBACart_SolarSensor::LightLevel < 10) GBACart_SolarSensor::LightLevel++; + } + } for (int i = 0; i < 12; i++) if (EventMatchesKey(evt, Config::KeyMapping[i], false)) -- cgit v1.2.3 From f257b007a250e33ecc7a86c7447ccf049964dd8d Mon Sep 17 00:00:00 2001 From: Raphaël Zumer Date: Tue, 10 Dec 2019 18:44:53 -0500 Subject: Properly pass through GBA GPIO writes --- src/GBACart.cpp | 2 ++ src/NDS.cpp | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/libui_sdl/main.cpp | 2 ++ 3 files changed, 92 insertions(+) (limited to 'src/libui_sdl') diff --git a/src/GBACart.cpp b/src/GBACart.cpp index a7ddf9b..7e5e3b5 100644 --- a/src/GBACart.cpp +++ b/src/GBACart.cpp @@ -630,8 +630,10 @@ void Process(GBACart::GPIO* gpio) if (gpio->data & 4) return; // Boktai chip select if (gpio->data & 2) // Reset { + u8 prev = LightSample; LightCounter = 0; LightSample = LIGHT_VALUE; + printf("Solar sensor reset (sample: 0x%02X -> 0x%02X)\n", prev, LightSample); } if (gpio->data & 1 && LightEdge) LightCounter++; diff --git a/src/NDS.cpp b/src/NDS.cpp index a906fbb..47f96c9 100644 --- a/src/NDS.cpp +++ b/src/NDS.cpp @@ -1803,6 +1803,19 @@ void ARM9Write8(u32 addr, u8 val) // checkme return; + case 0x08000000: + case 0x09000000: + if (ExMemCnt[0] & (1<<7)) return; // deselected CPU, skip the write + if (GBACart::CartInserted) + { + if ((addr & 0x00FFFFFF) >= 0xC4 && (addr & 0x00FFFFFF) <= 0xC9) + { + GBACart::WriteGPIO(addr & (GBACart::CartROMSize-1), val); + return; + } + } + break; + case 0x0A000000: if (ExMemCnt[0] & (1<<7)) return; // deselected CPU, skip the write if (GBACart::CartInserted) @@ -1854,6 +1867,21 @@ void ARM9Write16(u32 addr, u16 val) *(u16*)&GPU::OAM[addr & 0x7FF] = val; return; + case 0x08000000: + case 0x09000000: + if (ExMemCnt[0] & (1<<7)) return; // deselected CPU, skip the write + if (GBACart::CartInserted) + { + // Note: the lower bound is adjusted such that a write starting + // there will hit the first byte of the GPIO region. + if ((addr & 0x00FFFFFF) >= 0xC3 && (addr & 0x00FFFFFF) <= 0xC9) + { + GBACart::WriteGPIO(addr & (GBACart::CartROMSize-1), val); + return; + } + } + break; + case 0x0A000000: if (ExMemCnt[0] & (1<<7)) return; // deselected CPU, skip the write if (GBACart::CartInserted) @@ -1905,6 +1933,22 @@ void ARM9Write32(u32 addr, u32 val) *(u32*)&GPU::OAM[addr & 0x7FF] = val; return; + case 0x08000000: + case 0x09000000: + if (ExMemCnt[0] & (1<<7)) return; // deselected CPU, skip the write + if (GBACart::CartInserted) + { + // Note: the lower bound is adjusted such that a write starting + // there will hit the first byte of the GPIO region. + if ((addr & 0x00FFFFFF) >= 0xC1 && (addr & 0x00FFFFFF) <= 0xC9) + { + GBACart::WriteGPIO(addr & (GBACart::CartROMSize-1), val & 0xFF); + GBACart::WriteGPIO((addr + 2) & (GBACart::CartROMSize-1), (val >> 16) & 0xFF); + return; + } + } + break; + case 0x0A000000: if (ExMemCnt[0] & (1<<7)) return; // deselected CPU, skip the write if (GBACart::CartInserted) @@ -2177,6 +2221,19 @@ void ARM7Write8(u32 addr, u8 val) GPU::WriteVRAM_ARM7(addr, val); return; + case 0x08000000: + case 0x09000000: + if (!(ExMemCnt[0] & (1<<7))) return; // deselected CPU, skip the write + if (GBACart::CartInserted) + { + if ((addr & 0x00FFFFFF) >= 0xC4 && (addr & 0x00FFFFFF) <= 0xC9) + { + GBACart::WriteGPIO(addr & (GBACart::CartROMSize-1), val); + return; + } + } + break; + case 0x0A000000: if (!(ExMemCnt[0] & (1<<7))) return; // deselected CPU, skip the write if (GBACart::CartInserted) @@ -2231,6 +2288,21 @@ void ARM7Write16(u32 addr, u16 val) GPU::WriteVRAM_ARM7(addr, val); return; + case 0x08000000: + case 0x09000000: + if (!(ExMemCnt[0] & (1<<7))) return; // deselected CPU, skip the write + if (GBACart::CartInserted) + { + // Note: the lower bound is adjusted such that a write starting + // there will hit the first byte of the GPIO region. + if ((addr & 0x00FFFFFF) >= 0xC3 && (addr & 0x00FFFFFF) <= 0xC9) + { + GBACart::WriteGPIO(addr & (GBACart::CartROMSize-1), val); + return; + } + } + break; + case 0x0A000000: if (!(ExMemCnt[0] & (1<<7))) return; // deselected CPU, skip the write if (GBACart::CartInserted) @@ -2286,6 +2358,22 @@ void ARM7Write32(u32 addr, u32 val) GPU::WriteVRAM_ARM7(addr, val); return; + case 0x08000000: + case 0x09000000: + if (!(ExMemCnt[0] & (1<<7))) return; // deselected CPU, skip the write + if (GBACart::CartInserted) + { + // Note: the lower bound is adjusted such that a write starting + // there will hit the first byte of the GPIO region. + if ((addr & 0x00FFFFFF) >= 0xC1 && (addr & 0x00FFFFFF) <= 0xC9) + { + GBACart::WriteGPIO(addr & (GBACart::CartROMSize-1), val & 0xFF); + GBACart::WriteGPIO((addr + 2) & (GBACart::CartROMSize-1), (val >> 16) & 0xFF); + return; + } + } + break; + case 0x0A000000: if (!(ExMemCnt[0] & (1<<7))) return; // deselected CPU, skip the write if (GBACart::CartInserted) diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp index 1b7cfe6..d2a38f2 100644 --- a/src/libui_sdl/main.cpp +++ b/src/libui_sdl/main.cpp @@ -1297,6 +1297,7 @@ int OnAreaKeyEvent(uiAreaHandler* handler, uiArea* area, uiAreaKeyEvent* evt) if (GBACart::CartInserted && GBACart::HasSolarSensor) { if (GBACart_SolarSensor::LightLevel > 0) GBACart_SolarSensor::LightLevel--; + printf("Solar sensor level set to %d\n", GBACart_SolarSensor::LightLevel); } } else if (evt->Scancode == 0x4D) // Keypad right @@ -1304,6 +1305,7 @@ int OnAreaKeyEvent(uiAreaHandler* handler, uiArea* area, uiAreaKeyEvent* evt) if (GBACart::CartInserted && GBACart::HasSolarSensor) { if (GBACart_SolarSensor::LightLevel < 10) GBACart_SolarSensor::LightLevel++; + printf("Solar sensor level set to %d\n", GBACart_SolarSensor::LightLevel); } } -- cgit v1.2.3 From f8e43ac486aa7bbc9ebfdbd23b959f0fa163c51d Mon Sep 17 00:00:00 2001 From: Raphaël Zumer Date: Tue, 10 Dec 2019 19:24:28 -0500 Subject: Display solar sensor level changes on OSD --- src/libui_sdl/main.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/libui_sdl') diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp index d2a38f2..a96b77a 100644 --- a/src/libui_sdl/main.cpp +++ b/src/libui_sdl/main.cpp @@ -1297,7 +1297,9 @@ int OnAreaKeyEvent(uiAreaHandler* handler, uiArea* area, uiAreaKeyEvent* evt) if (GBACart::CartInserted && GBACart::HasSolarSensor) { if (GBACart_SolarSensor::LightLevel > 0) GBACart_SolarSensor::LightLevel--; - printf("Solar sensor level set to %d\n", GBACart_SolarSensor::LightLevel); + char msg[64]; + sprintf(msg, "Solar sensor level set to %d", GBACart_SolarSensor::LightLevel); + OSD::AddMessage(0, msg); } } else if (evt->Scancode == 0x4D) // Keypad right @@ -1305,7 +1307,9 @@ int OnAreaKeyEvent(uiAreaHandler* handler, uiArea* area, uiAreaKeyEvent* evt) if (GBACart::CartInserted && GBACart::HasSolarSensor) { if (GBACart_SolarSensor::LightLevel < 10) GBACart_SolarSensor::LightLevel++; - printf("Solar sensor level set to %d\n", GBACart_SolarSensor::LightLevel); + char msg[64]; + sprintf(msg, "Solar sensor level set to %d", GBACart_SolarSensor::LightLevel); + OSD::AddMessage(0, msg); } } -- cgit v1.2.3 From 295404a5a696c158df2ddf9b9548c0a4b8c368c6 Mon Sep 17 00:00:00 2001 From: i404788 <50617709+i404788@users.noreply.github.com> Date: Thu, 12 Dec 2019 09:03:01 +0000 Subject: Fix weird spacing --- src/libui_sdl/LAN_PCap.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/libui_sdl') diff --git a/src/libui_sdl/LAN_PCap.cpp b/src/libui_sdl/LAN_PCap.cpp index 312af0e..44af0a3 100644 --- a/src/libui_sdl/LAN_PCap.cpp +++ b/src/libui_sdl/LAN_PCap.cpp @@ -263,12 +263,12 @@ bool Init(bool open_adapter) continue; } - if (!curaddr->ifa_addr) - { - printf("Device (%s) does not have an address :/\n", curaddr->ifa_name); - curaddr = curaddr->ifa_next; - continue; - } + if (!curaddr->ifa_addr) + { + printf("Device (%s) does not have an address :/\n", curaddr->ifa_name); + curaddr = curaddr->ifa_next; + continue; + } u16 af = curaddr->ifa_addr->sa_family; if (af == AF_INET) -- cgit v1.2.3 From 43535c873ac1b4ce80212b052b0455a1eaaa0208 Mon Sep 17 00:00:00 2001 From: Nadia Holmquist Pedersen Date: Thu, 19 Dec 2019 02:48:11 +0100 Subject: Remove redundant desktop file and change desktop/icon file name to net.kuribo64.melonDS, also change melonds to melonDS. --- flatpak/net.kuribo64.melonDS.yml | 29 +++++++++++++++++++++++++++++ flatpak/net.kuribo64.melonds.desktop | 8 -------- flatpak/net.kuribo64.melonds.yml | 31 ------------------------------- melonDS.desktop | 11 ----------- net.kuribo64.melonDS.desktop | 11 +++++++++++ src/libui_sdl/CMakeLists.txt | 4 ++-- 6 files changed, 42 insertions(+), 52 deletions(-) create mode 100644 flatpak/net.kuribo64.melonDS.yml delete mode 100644 flatpak/net.kuribo64.melonds.desktop delete mode 100644 flatpak/net.kuribo64.melonds.yml delete mode 100644 melonDS.desktop create mode 100644 net.kuribo64.melonDS.desktop (limited to 'src/libui_sdl') diff --git a/flatpak/net.kuribo64.melonDS.yml b/flatpak/net.kuribo64.melonDS.yml new file mode 100644 index 0000000..e336990 --- /dev/null +++ b/flatpak/net.kuribo64.melonDS.yml @@ -0,0 +1,29 @@ +--- +app-id: net.kuribo64.melonDS +runtime: org.freedesktop.Platform +runtime-version: '18.08' +sdk: org.freedesktop.Sdk +command: melonDS +finish-args: + - "--share=ipc" + - "--socket=x11" + - "--socket=pulseaudio" + - "--share=network" + - "--device=all" + - "--filesystem=home" +modules: + - name: libpcap + sources: + - type: archive + url: http://www.tcpdump.org/release/libpcap-1.9.0.tar.gz + sha256: 2edb88808e5913fdaa8e9c1fcaf272e19b2485338742b5074b9fe44d68f37019 + + - name: melonds + buildsystem: cmake-ninja + sources: + - type: git + url: https://github.com/Arisotura/melonDS.git + branch: master + post-install: + - "desktop-file-install --dir=/app/share/applications net.kuribo64.melonDS.desktop" + - "install -D icon/melon_256x256.png /app/share/icons/hicolor/256x256/apps/net.kuribo64.melonDS.png" diff --git a/flatpak/net.kuribo64.melonds.desktop b/flatpak/net.kuribo64.melonds.desktop deleted file mode 100644 index e91f10d..0000000 --- a/flatpak/net.kuribo64.melonds.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Name=melonDS -Comment=Nintendo DS emulator -Exec=melonDS -Type=Application -Categories=Game; -Terminal=false -Icon=net.kuribo64.melonds diff --git a/flatpak/net.kuribo64.melonds.yml b/flatpak/net.kuribo64.melonds.yml deleted file mode 100644 index dcc97b5..0000000 --- a/flatpak/net.kuribo64.melonds.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- -app-id: net.kuribo64.melonds -runtime: org.freedesktop.Platform -runtime-version: '18.08' -sdk: org.freedesktop.Sdk -command: melonDS -finish-args: - - "--share=ipc" - - "--socket=x11" - - "--socket=pulseaudio" - - "--share=network" - - "--device=all" - - "--filesystem=home" -modules: - - name: libpcap - sources: - - type: archive - url: http://www.tcpdump.org/release/libpcap-1.9.0.tar.gz - sha256: 2edb88808e5913fdaa8e9c1fcaf272e19b2485338742b5074b9fe44d68f37019 - - - name: melonds - buildsystem: cmake-ninja - sources: - - type: git - url: https://github.com/StapleButter/melonDS.git - commit: d4d4965b2fffc69958685a25a9d9fc0c78b54567 - - type: file - path: net.kuribo64.melonds.desktop - post-install: - - "desktop-file-install --dir=/app/share/applications net.kuribo64.melonds.desktop" - - "install -D icon/melon_256x256.png /app/share/icons/hicolor/256x256/apps/net.kuribo64.melonds.png" diff --git a/melonDS.desktop b/melonDS.desktop deleted file mode 100644 index 3dd921c..0000000 --- a/melonDS.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Name=melonDS -GenericName=Nintendo DS Emulator -Comment=A fast and accurate Nintendo DS emulator. -Exec=melonDS -Type=Application -Categories=Game;Emulator; -Terminal=false -Icon=melon_256x256 -MimeType=application/x-nintendo-ds-rom; -Keywords=emulator;Nintendo;DS;NDS;Nintendo DS; diff --git a/net.kuribo64.melonDS.desktop b/net.kuribo64.melonDS.desktop new file mode 100644 index 0000000..c0dafe2 --- /dev/null +++ b/net.kuribo64.melonDS.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=melonDS +GenericName=Nintendo DS Emulator +Comment=A fast and accurate Nintendo DS emulator. +Exec=melonDS +Type=Application +Categories=Game;Emulator; +Terminal=false +Icon=net.kuribo64.melonDS +MimeType=application/x-nintendo-ds-rom; +Keywords=emulator;Nintendo;DS;NDS;Nintendo DS; diff --git a/src/libui_sdl/CMakeLists.txt b/src/libui_sdl/CMakeLists.txt index ae270e4..8c3d042 100644 --- a/src/libui_sdl/CMakeLists.txt +++ b/src/libui_sdl/CMakeLists.txt @@ -66,7 +66,7 @@ elseif (WIN32) target_link_libraries(melonDS comctl32 d2d1 dwrite uxtheme ws2_32 iphlpapi) endif () -install(FILES ../../melonDS.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications) -install(FILES ../../icon/melon_256x256.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pixmaps) +install(FILES ../../net.kuribo64.melonDS.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications) +install(FILES ../../icon/melon_256x256.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pixmaps RENAME net.kuribo64.melonDS.png) install(FILES ../../romlist.bin DESTINATION ${CMAKE_INSTALL_PREFIX}/share/melonds) install(TARGETS melonDS RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) -- cgit v1.2.3 From c5623c4dcd122278e45a363b655be67d845ecf63 Mon Sep 17 00:00:00 2001 From: Nadia Holmquist Pedersen Date: Thu, 19 Dec 2019 02:52:34 +0100 Subject: Change the config/data dirs from "melonds" to "melonDS" for consistency. --- src/libui_sdl/CMakeLists.txt | 2 +- src/libui_sdl/Platform.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/libui_sdl') diff --git a/src/libui_sdl/CMakeLists.txt b/src/libui_sdl/CMakeLists.txt index 8c3d042..2d384e4 100644 --- a/src/libui_sdl/CMakeLists.txt +++ b/src/libui_sdl/CMakeLists.txt @@ -68,5 +68,5 @@ endif () install(FILES ../../net.kuribo64.melonDS.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications) install(FILES ../../icon/melon_256x256.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pixmaps RENAME net.kuribo64.melonDS.png) -install(FILES ../../romlist.bin DESTINATION ${CMAKE_INSTALL_PREFIX}/share/melonds) +install(FILES ../../romlist.bin DESTINATION ${CMAKE_INSTALL_PREFIX}/share/melonDS) install(TARGETS melonDS RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) diff --git a/src/libui_sdl/Platform.cpp b/src/libui_sdl/Platform.cpp index 8b83a01..cc1b734 100644 --- a/src/libui_sdl/Platform.cpp +++ b/src/libui_sdl/Platform.cpp @@ -148,7 +148,7 @@ FILE* OpenLocalFile(const char* path, const char* mode) else { // Check user configuration directory - std::string confpath = std::string(g_get_user_config_dir()) + "/melonds/"; + std::string confpath = std::string(g_get_user_config_dir()) + "/melonDS/"; g_mkdir_with_parents(confpath.c_str(), 0755); fullpath = confpath + path; } @@ -158,7 +158,7 @@ FILE* OpenLocalFile(const char* path, const char* mode) FILE* OpenDataFile(const char* path) { - const char* melondir = "melonds"; + const char* melondir = "melonDS"; const char* const* sys_dirs = g_get_system_data_dirs(); const char* user_dir = g_get_user_data_dir(); @@ -238,7 +238,7 @@ FILE* OpenLocalFile(const char* path, const char* mode) emudirpath[pathlen] = '\0'; } - // Locations are application directory, and AppData/melonDS on Windows or XDG_CONFIG_HOME/melonds on Linux + // Locations are application directory, and AppData/melonDS on Windows or XDG_CONFIG_HOME/melonDS on Linux FILE* f; @@ -300,7 +300,7 @@ FILE* OpenLocalFile(const char* path, const char* mode) { // Now check XDG_CONFIG_HOME // TODO: check for memory leak there - std::string fullpath = std::string(g_get_user_config_dir()) + "/melonds/" + path; + std::string fullpath = std::string(g_get_user_config_dir()) + "/melonDS/" + path; f = OpenFile(fullpath.c_str(), mode, true); if (f) { delete[] emudirpath; return f; } } -- cgit v1.2.3 From be19e0e8d49485d91c4106bad79daa766f7cb131 Mon Sep 17 00:00:00 2001 From: Raphaël Zumer Date: Wed, 11 Dec 2019 19:21:59 -0500 Subject: Make solar sensor hotkeys configurable --- src/libui_sdl/DlgInputConfig.cpp | 6 ++++-- src/libui_sdl/PlatformConfig.cpp | 32 ++++++++++++++++++-------------- src/libui_sdl/PlatformConfig.h | 2 ++ src/libui_sdl/main.cpp | 38 ++++++++++++++++++-------------------- 4 files changed, 42 insertions(+), 36 deletions(-) (limited to 'src/libui_sdl') diff --git a/src/libui_sdl/DlgInputConfig.cpp b/src/libui_sdl/DlgInputConfig.cpp index a80e2ec..21394b1 100644 --- a/src/libui_sdl/DlgInputConfig.cpp +++ b/src/libui_sdl/DlgInputConfig.cpp @@ -71,7 +71,9 @@ char hotkeylabels[HK_MAX][32] = "Pause/resume:", "Reset:", "Fast forward:", - "Fast forward (toggle):" + "Fast forward (toggle):", + "Decrease sunlight (Boktai):", + "Increase sunlight (Boktai):" }; int openedmask; @@ -514,7 +516,7 @@ void Open(int type) memcpy(dlg->keymap, Config::HKKeyMapping, sizeof(int)*HK_MAX); memcpy(dlg->joymap, Config::HKJoyMapping, sizeof(int)*HK_MAX); - dlg->win = uiNewWindow("Hotkey config - melonDS", 600, 100, 0, 0, 0); + dlg->win = uiNewWindow("Hotkey config - melonDS", 700, 100, 0, 0, 0); } uiControl(dlg->win)->UserData = dlg; diff --git a/src/libui_sdl/PlatformConfig.cpp b/src/libui_sdl/PlatformConfig.cpp index c8ec19f..a2eaab9 100644 --- a/src/libui_sdl/PlatformConfig.cpp +++ b/src/libui_sdl/PlatformConfig.cpp @@ -93,25 +93,29 @@ ConfigEntry PlatformConfigFile[] = {"Joy_X", 0, &JoyMapping[10], -1, NULL, 0}, {"Joy_Y", 0, &JoyMapping[11], -1, NULL, 0}, - {"HKKey_Lid", 0, &HKKeyMapping[HK_Lid], 0x0D, NULL, 0}, - {"HKKey_Mic", 0, &HKKeyMapping[HK_Mic], 0x35, NULL, 0}, - {"HKKey_Pause", 0, &HKKeyMapping[HK_Pause], -1, NULL, 0}, - {"HKKey_Reset", 0, &HKKeyMapping[HK_Reset], -1, NULL, 0}, - {"HKKey_FastForward", 0, &HKKeyMapping[HK_FastForward], 0x0F, NULL, 0}, - {"HKKey_FastForwardToggle", 0, &HKKeyMapping[HK_FastForwardToggle], -1, NULL, 0}, - - {"HKJoy_Lid", 0, &HKJoyMapping[HK_Lid], -1, NULL, 0}, - {"HKJoy_Mic", 0, &HKJoyMapping[HK_Mic], -1, NULL, 0}, - {"HKJoy_Pause", 0, &HKJoyMapping[HK_Pause], -1, NULL, 0}, - {"HKJoy_Reset", 0, &HKJoyMapping[HK_Reset], -1, NULL, 0}, - {"HKJoy_FastForward", 0, &HKJoyMapping[HK_FastForward], -1, NULL, 0}, - {"HKJoy_FastForwardToggle", 0, &HKJoyMapping[HK_FastForwardToggle], -1, NULL, 0}, + {"HKKey_Lid", 0, &HKKeyMapping[HK_Lid], 0x0D, NULL, 0}, + {"HKKey_Mic", 0, &HKKeyMapping[HK_Mic], 0x35, NULL, 0}, + {"HKKey_Pause", 0, &HKKeyMapping[HK_Pause], -1, NULL, 0}, + {"HKKey_Reset", 0, &HKKeyMapping[HK_Reset], -1, NULL, 0}, + {"HKKey_FastForward", 0, &HKKeyMapping[HK_FastForward], 0x0F, NULL, 0}, + {"HKKey_FastForwardToggle", 0, &HKKeyMapping[HK_FastForwardToggle], -1, NULL, 0}, + {"HKKey_SolarSensorDecrease", 0, &HKKeyMapping[HK_SolarSensorDecrease], 0x4B, NULL, 0}, + {"HKKey_SolarSensorIncrease", 0, &HKKeyMapping[HK_SolarSensorIncrease], 0x4D, NULL, 0}, + + {"HKJoy_Lid", 0, &HKJoyMapping[HK_Lid], -1, NULL, 0}, + {"HKJoy_Mic", 0, &HKJoyMapping[HK_Mic], -1, NULL, 0}, + {"HKJoy_Pause", 0, &HKJoyMapping[HK_Pause], -1, NULL, 0}, + {"HKJoy_Reset", 0, &HKJoyMapping[HK_Reset], -1, NULL, 0}, + {"HKJoy_FastForward", 0, &HKJoyMapping[HK_FastForward], -1, NULL, 0}, + {"HKJoy_FastForwardToggle", 0, &HKJoyMapping[HK_FastForwardToggle], -1, NULL, 0}, + {"HKJoy_SolarSensorDecrease", 0, &HKJoyMapping[HK_SolarSensorDecrease], -1, NULL, 0}, + {"HKJoy_SolarSensorIncrease", 0, &HKJoyMapping[HK_SolarSensorIncrease], -1, NULL, 0}, {"JoystickID", 0, &JoystickID, 0, NULL, 0}, {"WindowWidth", 0, &WindowWidth, 256, NULL, 0}, {"WindowHeight", 0, &WindowHeight, 384, NULL, 0}, - {"WindowMax", 0, &WindowMaximized, 0, NULL, 0}, + {"WindowMax", 0, &WindowMaximized, 0, NULL, 0}, {"ScreenRotation", 0, &ScreenRotation, 0, NULL, 0}, {"ScreenGap", 0, &ScreenGap, 0, NULL, 0}, diff --git a/src/libui_sdl/PlatformConfig.h b/src/libui_sdl/PlatformConfig.h index 842e72a..682b9bc 100644 --- a/src/libui_sdl/PlatformConfig.h +++ b/src/libui_sdl/PlatformConfig.h @@ -29,6 +29,8 @@ enum HK_Reset, HK_FastForward, HK_FastForwardToggle, + HK_SolarSensorDecrease, + HK_SolarSensorIncrease, HK_MAX }; diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp index a96b77a..38804f6 100644 --- a/src/libui_sdl/main.cpp +++ b/src/libui_sdl/main.cpp @@ -949,6 +949,24 @@ int EmuThreadFunc(void* burp) if (HotkeyPressed(HK_Pause)) uiQueueMain(TogglePause, NULL); if (HotkeyPressed(HK_Reset)) uiQueueMain(Reset, NULL); + if (GBACart::CartInserted && GBACart::HasSolarSensor) + { + if (HotkeyPressed(HK_SolarSensorDecrease)) + { + if (GBACart_SolarSensor::LightLevel > 0) GBACart_SolarSensor::LightLevel--; + char msg[64]; + sprintf(msg, "Solar sensor level set to %d", GBACart_SolarSensor::LightLevel); + OSD::AddMessage(0, msg); + } + if (HotkeyPressed(HK_SolarSensorIncrease)) + { + if (GBACart_SolarSensor::LightLevel < 10) GBACart_SolarSensor::LightLevel++; + char msg[64]; + sprintf(msg, "Solar sensor level set to %d", GBACart_SolarSensor::LightLevel); + OSD::AddMessage(0, msg); + } + } + if (EmuRunning == 1) { EmuStatus = 1; @@ -1292,26 +1310,6 @@ int OnAreaKeyEvent(uiAreaHandler* handler, uiArea* area, uiAreaKeyEvent* evt) { if (evt->Modifiers == 0x0) UndoStateLoad(); } - else if (evt->Scancode == 0x4B) // Keypad left - { - if (GBACart::CartInserted && GBACart::HasSolarSensor) - { - if (GBACart_SolarSensor::LightLevel > 0) GBACart_SolarSensor::LightLevel--; - char msg[64]; - sprintf(msg, "Solar sensor level set to %d", GBACart_SolarSensor::LightLevel); - OSD::AddMessage(0, msg); - } - } - else if (evt->Scancode == 0x4D) // Keypad right - { - if (GBACart::CartInserted && GBACart::HasSolarSensor) - { - if (GBACart_SolarSensor::LightLevel < 10) GBACart_SolarSensor::LightLevel++; - char msg[64]; - sprintf(msg, "Solar sensor level set to %d", GBACart_SolarSensor::LightLevel); - OSD::AddMessage(0, msg); - } - } for (int i = 0; i < 12; i++) if (EventMatchesKey(evt, Config::KeyMapping[i], false)) -- cgit v1.2.3 From 22d11209b0466e3c852da543ddfc512b66735bc2 Mon Sep 17 00:00:00 2001 From: Raphaël Zumer Date: Sun, 22 Dec 2019 15:49:23 -0500 Subject: Split GBA Reset and Eject logic into two sets This allows solving some crashes and provides more flexibility in how GBA cartridges change state between soft and hard resets. Since save states including GBA data do not carry over the original save file path, and the GBA cartridge is being reset along with the other parts of the system, this is needed to avoid losing the GBA state on reset following a state load, while preserving the behavior where cartridges are ejected when calling Stop(). --- src/GBACart.cpp | 35 ++++++++++++++++++++++++++++++----- src/GBACart.h | 2 ++ src/libui_sdl/main.cpp | 22 ++++++++++++++++++++-- 3 files changed, 52 insertions(+), 7 deletions(-) (limited to 'src/libui_sdl') diff --git a/src/GBACart.cpp b/src/GBACart.cpp index 7753482..4d44d3a 100644 --- a/src/GBACart.cpp +++ b/src/GBACart.cpp @@ -76,10 +76,14 @@ void DeInit() } void Reset() +{ + // do nothing, we don't want to clear GBA SRAM on reset +} + +void Eject() { if (SRAMFile) fclose(SRAMFile); if (SRAM) delete[] SRAM; - SRAM = NULL; SRAMFile = NULL; SRAMLength = 0; @@ -524,15 +528,30 @@ void DeInit() void Reset() { + // Do not reset cartridge ROM. + // Prefer keeping the inserted cartridge on reset. + // This allows resetting a DS game without losing GBA state, + // and resetting to firmware without the slot being emptied. + // The Stop function will clear the cartridge state via Eject(). + + GBACart_SRAM::Reset(); + GBACart_SolarSensor::Reset(); +} + +void Eject() +{ + if (CartROM) delete[] CartROM; + CartInserted = false; HasSolarSensor = false; - if (CartROM) delete[] CartROM; CartROM = NULL; CartROMSize = 0; + CartCRC = NULL; + CartID = NULL; CartGPIO = {}; - GBACart_SRAM::Reset(); - GBACart_SolarSensor::Reset(); + GBACart_SRAM::Eject(); + Reset(); } void DoSavestate(Savestate* file) @@ -545,10 +564,16 @@ void DoSavestate(Savestate* file) // since unlike with DS, it's not loaded in advance file->Var32(&CartROMSize); - if (!CartROMSize) return; // no GBA cartridge state? nothing to do here. + if (!CartROMSize) // no GBA cartridge state? nothing to do here + { + // do eject the cartridge if something is inserted + Eject(); + return; + } u32 oldCRC = CartCRC; file->Var32(&CartCRC); + if (CartCRC != oldCRC) { // delete and reallocate ROM so that it is zero-padded to its full length diff --git a/src/GBACart.h b/src/GBACart.h index fd26326..96a05b8 100644 --- a/src/GBACart.h +++ b/src/GBACart.h @@ -57,10 +57,12 @@ extern bool CartInserted; extern bool HasSolarSensor; extern u8* CartROM; extern u32 CartROMSize; +extern u32 CartCRC; bool Init(); void DeInit(); void Reset(); +void Eject(); void DoSavestate(Savestate* file); bool LoadROM(const char* path, const char* sram); diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp index 38804f6..af69f8e 100644 --- a/src/libui_sdl/main.cpp +++ b/src/libui_sdl/main.cpp @@ -1694,6 +1694,7 @@ void Stop(bool internal) RunningSomething = false; // eject any inserted GBA cartridge + GBACart::Eject(); ROMPath[1][0] = '\0'; uiWindowSetTitle(MainWindow, "melonDS " MELONDS_VERSION); @@ -1834,6 +1835,8 @@ void LoadState(int slot) return; } + u32 oldGBACartCRC = GBACart::CartCRC; + // backup Savestate* backup = new Savestate("timewarp.mln", true); NDS::DoSavestate(backup); @@ -1870,9 +1873,24 @@ void LoadState(int slot) NDS::RelocateSave(SRAMPath[0], false); } + bool loadedPartialGBAROM = false; + + // in case we have a GBA cart inserted, and the GBA ROM changes + // due to having loaded a save state, we do not want to reload + // the previous cartridge on reset, or commit writes to any + // loaded save file. therefore, their paths are "nulled". + if (GBACart::CartInserted && GBACart::CartCRC != oldGBACartCRC) + { + ROMPath[1][0] = '\0'; + SRAMPath[1][0] = '\0'; + loadedPartialGBAROM = true; + } + char msg[64]; - if (slot > 0) sprintf(msg, "State loaded from slot %d", slot); - else sprintf(msg, "State loaded from file"); + if (slot > 0) sprintf(msg, "State loaded from slot %d%s", + slot, loadedPartialGBAROM ? " (GBA ROM header only)" : ""); + else sprintf(msg, "State loaded from file%s", + loadedPartialGBAROM ? " (GBA ROM header only)" : ""); OSD::AddMessage(0, msg); SavestateLoaded = true; -- cgit v1.2.3 From da0afbde8823f37af92a0f1cd0ad2ad7a5fa7d89 Mon Sep 17 00:00:00 2001 From: Markus ⛅ <3259076+KAMiKAZOW@users.noreply.github.com> Date: Thu, 30 Jan 2020 17:25:08 +0100 Subject: Use different icon location "pixmaps" is the deprecated, legacy-only location. "hicolor" is the current, proper location that supports multiple resolutions which we now use --- src/libui_sdl/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/libui_sdl') diff --git a/src/libui_sdl/CMakeLists.txt b/src/libui_sdl/CMakeLists.txt index 2d384e4..8c8467b 100644 --- a/src/libui_sdl/CMakeLists.txt +++ b/src/libui_sdl/CMakeLists.txt @@ -67,6 +67,11 @@ elseif (WIN32) endif () install(FILES ../../net.kuribo64.melonDS.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications) -install(FILES ../../icon/melon_256x256.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pixmaps RENAME net.kuribo64.melonDS.png) +install(FILES ../../icon/melon_16x16.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/16x16/apps RENAME net.kuribo64.melonDS.png) +install(FILES ../../icon/melon_32x32.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/32x32/apps RENAME net.kuribo64.melonDS.png) +install(FILES ../../icon/melon_48x48.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/48x48/apps RENAME net.kuribo64.melonDS.png) +install(FILES ../../icon/melon_64x64.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/64x64/apps RENAME net.kuribo64.melonDS.png) +install(FILES ../../icon/melon_128x128.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/128x128/apps RENAME net.kuribo64.melonDS.png) +install(FILES ../../icon/melon_256x256.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/256x256/apps RENAME net.kuribo64.melonDS.png) install(FILES ../../romlist.bin DESTINATION ${CMAKE_INSTALL_PREFIX}/share/melonDS) install(TARGETS melonDS RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) -- cgit v1.2.3 From 83f8e11bc13f6dcacf72d9be49054da5b0a83566 Mon Sep 17 00:00:00 2001 From: Arisotura Date: Fri, 14 Feb 2020 20:18:08 +0100 Subject: update copyright years --- melon.rc | 2 +- src/AREngine.cpp | 2 +- src/AREngine.h | 2 +- src/ARM.cpp | 2 +- src/ARM.h | 2 +- src/ARMInterpreter.cpp | 2 +- src/ARMInterpreter.h | 2 +- src/ARMInterpreter_ALU.cpp | 2 +- src/ARMInterpreter_ALU.h | 2 +- src/ARMInterpreter_Branch.cpp | 2 +- src/ARMInterpreter_Branch.h | 2 +- src/ARMInterpreter_LoadStore.cpp | 2 +- src/ARMInterpreter_LoadStore.h | 2 +- src/ARM_InstrTable.h | 2 +- src/CP15.cpp | 2 +- src/CRC32.cpp | 2 +- src/CRC32.h | 2 +- src/Config.cpp | 2 +- src/Config.h | 2 +- src/DMA.cpp | 2 +- src/DMA.h | 2 +- src/FIFO.h | 2 +- src/GPU.cpp | 2 +- src/GPU.h | 2 +- src/GPU2D.cpp | 2 +- src/GPU2D.h | 2 +- src/GPU3D.cpp | 2 +- src/GPU3D.h | 2 +- src/GPU3D_OpenGL.cpp | 2 +- src/GPU3D_OpenGL_shaders.h | 2 +- src/GPU3D_Soft.cpp | 2 +- src/NDS.cpp | 2 +- src/NDS.h | 2 +- src/NDSCart.h | 2 +- src/OpenGLSupport.cpp | 2 +- src/OpenGLSupport.h | 2 +- src/Platform.h | 2 +- src/RTC.cpp | 2 +- src/RTC.h | 2 +- src/SPI.cpp | 2 +- src/SPI.h | 2 +- src/SPU.cpp | 2 +- src/SPU.h | 2 +- src/Savestate.cpp | 2 +- src/Savestate.h | 2 +- src/Wifi.cpp | 2 +- src/Wifi.h | 2 +- src/WifiAP.cpp | 2 +- src/WifiAP.h | 2 +- src/libui_sdl/DlgAudioSettings.cpp | 2 +- src/libui_sdl/DlgAudioSettings.h | 2 +- src/libui_sdl/DlgEmuSettings.cpp | 2 +- src/libui_sdl/DlgEmuSettings.h | 2 +- src/libui_sdl/DlgInputConfig.cpp | 2 +- src/libui_sdl/DlgInputConfig.h | 2 +- src/libui_sdl/DlgVideoSettings.cpp | 2 +- src/libui_sdl/DlgVideoSettings.h | 2 +- src/libui_sdl/DlgWifiSettings.cpp | 2 +- src/libui_sdl/DlgWifiSettings.h | 2 +- src/libui_sdl/LAN_PCap.cpp | 22 +++++++++++----------- src/libui_sdl/LAN_PCap.h | 2 +- src/libui_sdl/LAN_Socket.cpp | 2 +- src/libui_sdl/LAN_Socket.h | 2 +- src/libui_sdl/MelonCap.cpp | 2 +- src/libui_sdl/MelonCap.h | 2 +- src/libui_sdl/OSD.cpp | 2 +- src/libui_sdl/OSD.h | 2 +- src/libui_sdl/Platform.cpp | 4 ++-- src/libui_sdl/PlatformConfig.cpp | 2 +- src/libui_sdl/PlatformConfig.h | 2 +- src/libui_sdl/font.h | 2 +- src/libui_sdl/main.cpp | 4 ++-- src/libui_sdl/main_shaders.h | 2 +- src/types.h | 2 +- src/version.h | 2 +- 75 files changed, 87 insertions(+), 87 deletions(-) (limited to 'src/libui_sdl') diff --git a/melon.rc b/melon.rc index e2d8dc2..c6ee672 100644 --- a/melon.rc +++ b/melon.rc @@ -18,7 +18,7 @@ FILETYPE VFT_APP VALUE "FileVersion", "0.8.3" VALUE "FileDescription", "DS emulator, sorta. also 1st quality melon." VALUE "InternalName", "SDnolem" - VALUE "LegalCopyright", "2016-2019 Arisotura & co." + VALUE "LegalCopyright", "2016-2020 Arisotura & co." VALUE "LegalTrademarks", "" VALUE "OriginalFilename", "zafkflzdasd.exe" VALUE "ProductName", "melonDS" diff --git a/src/AREngine.cpp b/src/AREngine.cpp index 3049ecb..4568473 100644 --- a/src/AREngine.cpp +++ b/src/AREngine.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/AREngine.h b/src/AREngine.h index afaf598..a78405f 100644 --- a/src/AREngine.h +++ b/src/AREngine.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/ARM.cpp b/src/ARM.cpp index f50af25..43838ca 100644 --- a/src/ARM.cpp +++ b/src/ARM.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/ARM.h b/src/ARM.h index dcff477..b9f5d89 100644 --- a/src/ARM.h +++ b/src/ARM.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/ARMInterpreter.cpp b/src/ARMInterpreter.cpp index d3f66d8..347fa1e 100644 --- a/src/ARMInterpreter.cpp +++ b/src/ARMInterpreter.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/ARMInterpreter.h b/src/ARMInterpreter.h index 1802bcc..7244238 100644 --- a/src/ARMInterpreter.h +++ b/src/ARMInterpreter.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/ARMInterpreter_ALU.cpp b/src/ARMInterpreter_ALU.cpp index d60d8f8..545667a 100644 --- a/src/ARMInterpreter_ALU.cpp +++ b/src/ARMInterpreter_ALU.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/ARMInterpreter_ALU.h b/src/ARMInterpreter_ALU.h index 0f7fe9b..7f889de 100644 --- a/src/ARMInterpreter_ALU.h +++ b/src/ARMInterpreter_ALU.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/ARMInterpreter_Branch.cpp b/src/ARMInterpreter_Branch.cpp index 6d1cf17..91cf5bb 100644 --- a/src/ARMInterpreter_Branch.cpp +++ b/src/ARMInterpreter_Branch.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/ARMInterpreter_Branch.h b/src/ARMInterpreter_Branch.h index 43347e3..757092f 100644 --- a/src/ARMInterpreter_Branch.h +++ b/src/ARMInterpreter_Branch.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/ARMInterpreter_LoadStore.cpp b/src/ARMInterpreter_LoadStore.cpp index 1d1fc6d..5b05385 100644 --- a/src/ARMInterpreter_LoadStore.cpp +++ b/src/ARMInterpreter_LoadStore.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/ARMInterpreter_LoadStore.h b/src/ARMInterpreter_LoadStore.h index ab69b15..09768a6 100644 --- a/src/ARMInterpreter_LoadStore.h +++ b/src/ARMInterpreter_LoadStore.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/ARM_InstrTable.h b/src/ARM_InstrTable.h index 2e4a707..86d7d5a 100644 --- a/src/ARM_InstrTable.h +++ b/src/ARM_InstrTable.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/CP15.cpp b/src/CP15.cpp index cf0ece9..c1f46bc 100644 --- a/src/CP15.cpp +++ b/src/CP15.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/CRC32.cpp b/src/CRC32.cpp index 5cb47e2..97af721 100644 --- a/src/CRC32.cpp +++ b/src/CRC32.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/CRC32.h b/src/CRC32.h index 449457a..a74fa8d 100644 --- a/src/CRC32.h +++ b/src/CRC32.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/Config.cpp b/src/Config.cpp index 58aef58..f558ef6 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/Config.h b/src/Config.h index 363df70..84fd57b 100644 --- a/src/Config.h +++ b/src/Config.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/DMA.cpp b/src/DMA.cpp index 51ce825..ae3fdd7 100644 --- a/src/DMA.cpp +++ b/src/DMA.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/DMA.h b/src/DMA.h index 3146ef1..2e7678c 100644 --- a/src/DMA.h +++ b/src/DMA.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/FIFO.h b/src/FIFO.h index a9e9ed8..e2ea644 100644 --- a/src/FIFO.h +++ b/src/FIFO.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/GPU.cpp b/src/GPU.cpp index 1ac9f50..633cbd7 100644 --- a/src/GPU.cpp +++ b/src/GPU.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/GPU.h b/src/GPU.h index 7e7a9d1..661a7d9 100644 --- a/src/GPU.h +++ b/src/GPU.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/GPU2D.cpp b/src/GPU2D.cpp index 30a6d45..1c6cf0c 100644 --- a/src/GPU2D.cpp +++ b/src/GPU2D.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/GPU2D.h b/src/GPU2D.h index 6675ce7..c4bd2f9 100644 --- a/src/GPU2D.h +++ b/src/GPU2D.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/GPU3D.cpp b/src/GPU3D.cpp index 1c3fbee..52bc10f 100644 --- a/src/GPU3D.cpp +++ b/src/GPU3D.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/GPU3D.h b/src/GPU3D.h index fd52488..1fd3383 100644 --- a/src/GPU3D.h +++ b/src/GPU3D.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/GPU3D_OpenGL.cpp b/src/GPU3D_OpenGL.cpp index 6abb1ab..b1bcaa1 100644 --- a/src/GPU3D_OpenGL.cpp +++ b/src/GPU3D_OpenGL.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/GPU3D_OpenGL_shaders.h b/src/GPU3D_OpenGL_shaders.h index 2545ee0..5722ca5 100644 --- a/src/GPU3D_OpenGL_shaders.h +++ b/src/GPU3D_OpenGL_shaders.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/GPU3D_Soft.cpp b/src/GPU3D_Soft.cpp index 193d198..8397898 100644 --- a/src/GPU3D_Soft.cpp +++ b/src/GPU3D_Soft.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/NDS.cpp b/src/NDS.cpp index 0198ea3..713e8ac 100644 --- a/src/NDS.cpp +++ b/src/NDS.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/NDS.h b/src/NDS.h index 16c42ef..4e41520 100644 --- a/src/NDS.h +++ b/src/NDS.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/NDSCart.h b/src/NDSCart.h index 0dc4220..4167aa6 100644 --- a/src/NDSCart.h +++ b/src/NDSCart.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/OpenGLSupport.cpp b/src/OpenGLSupport.cpp index 59424b4..f91af9b 100644 --- a/src/OpenGLSupport.cpp +++ b/src/OpenGLSupport.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/OpenGLSupport.h b/src/OpenGLSupport.h index a08bcdf..5f92580 100644 --- a/src/OpenGLSupport.h +++ b/src/OpenGLSupport.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/Platform.h b/src/Platform.h index dfe83d0..b6effdc 100644 --- a/src/Platform.h +++ b/src/Platform.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/RTC.cpp b/src/RTC.cpp index 83e5bdb..0d80b2c 100644 --- a/src/RTC.cpp +++ b/src/RTC.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/RTC.h b/src/RTC.h index 7f904a6..05cd80f 100644 --- a/src/RTC.h +++ b/src/RTC.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/SPI.cpp b/src/SPI.cpp index 759bbd9..1a5873e 100644 --- a/src/SPI.cpp +++ b/src/SPI.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/SPI.h b/src/SPI.h index 9b987ca..086de1a 100644 --- a/src/SPI.h +++ b/src/SPI.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/SPU.cpp b/src/SPU.cpp index 9d5f04f..710533e 100644 --- a/src/SPU.cpp +++ b/src/SPU.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/SPU.h b/src/SPU.h index 53a8e0a..74a4471 100644 --- a/src/SPU.h +++ b/src/SPU.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/Savestate.cpp b/src/Savestate.cpp index fff2ec7..cb3d6a5 100644 --- a/src/Savestate.cpp +++ b/src/Savestate.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/Savestate.h b/src/Savestate.h index ef86f3c..60d00e7 100644 --- a/src/Savestate.h +++ b/src/Savestate.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/Wifi.cpp b/src/Wifi.cpp index dbe836f..ab82724 100644 --- a/src/Wifi.cpp +++ b/src/Wifi.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/Wifi.h b/src/Wifi.h index c97264b..dd3eeb3 100644 --- a/src/Wifi.h +++ b/src/Wifi.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/WifiAP.cpp b/src/WifiAP.cpp index 4d4ee19..3a5de37 100644 --- a/src/WifiAP.cpp +++ b/src/WifiAP.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/WifiAP.h b/src/WifiAP.h index e62c0fb..97946a5 100644 --- a/src/WifiAP.h +++ b/src/WifiAP.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/libui_sdl/DlgAudioSettings.cpp b/src/libui_sdl/DlgAudioSettings.cpp index d649321..43836ae 100644 --- a/src/libui_sdl/DlgAudioSettings.cpp +++ b/src/libui_sdl/DlgAudioSettings.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/libui_sdl/DlgAudioSettings.h b/src/libui_sdl/DlgAudioSettings.h index f058c25..7a5afcc 100644 --- a/src/libui_sdl/DlgAudioSettings.h +++ b/src/libui_sdl/DlgAudioSettings.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/libui_sdl/DlgEmuSettings.cpp b/src/libui_sdl/DlgEmuSettings.cpp index 768560d..c50f216 100644 --- a/src/libui_sdl/DlgEmuSettings.cpp +++ b/src/libui_sdl/DlgEmuSettings.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/libui_sdl/DlgEmuSettings.h b/src/libui_sdl/DlgEmuSettings.h index baff7ce..d937448 100644 --- a/src/libui_sdl/DlgEmuSettings.h +++ b/src/libui_sdl/DlgEmuSettings.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/libui_sdl/DlgInputConfig.cpp b/src/libui_sdl/DlgInputConfig.cpp index 21394b1..f4245b4 100644 --- a/src/libui_sdl/DlgInputConfig.cpp +++ b/src/libui_sdl/DlgInputConfig.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/libui_sdl/DlgInputConfig.h b/src/libui_sdl/DlgInputConfig.h index 94c7325..89ac034 100644 --- a/src/libui_sdl/DlgInputConfig.h +++ b/src/libui_sdl/DlgInputConfig.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/libui_sdl/DlgVideoSettings.cpp b/src/libui_sdl/DlgVideoSettings.cpp index ff88ba8..1062be1 100644 --- a/src/libui_sdl/DlgVideoSettings.cpp +++ b/src/libui_sdl/DlgVideoSettings.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/libui_sdl/DlgVideoSettings.h b/src/libui_sdl/DlgVideoSettings.h index 25a938f..17072e0 100644 --- a/src/libui_sdl/DlgVideoSettings.h +++ b/src/libui_sdl/DlgVideoSettings.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/libui_sdl/DlgWifiSettings.cpp b/src/libui_sdl/DlgWifiSettings.cpp index 09080a0..d1ce8bd 100644 --- a/src/libui_sdl/DlgWifiSettings.cpp +++ b/src/libui_sdl/DlgWifiSettings.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/libui_sdl/DlgWifiSettings.h b/src/libui_sdl/DlgWifiSettings.h index 466ce10..a12cbfd 100644 --- a/src/libui_sdl/DlgWifiSettings.h +++ b/src/libui_sdl/DlgWifiSettings.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/libui_sdl/LAN_PCap.cpp b/src/libui_sdl/LAN_PCap.cpp index 44af0a3..ce278bc 100644 --- a/src/libui_sdl/LAN_PCap.cpp +++ b/src/libui_sdl/LAN_PCap.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. @@ -133,7 +133,7 @@ bool Init(bool open_adapter) return false; } } - + PCapAdapter = NULL; PacketLen = 0; RXNum = 0; @@ -172,7 +172,7 @@ bool Init(bool open_adapter) #else strncpy(adata->DeviceName, dev->name, 127); adata->DeviceName[127] = '\0'; - + strncpy(adata->FriendlyName, adata->DeviceName, 127); adata->FriendlyName[127] = '\0'; #endif // __WIN32__ @@ -250,7 +250,7 @@ bool Init(bool open_adapter) printf("getifaddrs() shat itself :(\n"); return false; } - + for (int i = 0; i < NumAdapters; i++) { adata = &Adapters[i]; @@ -262,14 +262,14 @@ bool Init(bool open_adapter) curaddr = curaddr->ifa_next; continue; } - + if (!curaddr->ifa_addr) { - printf("Device (%s) does not have an address :/\n", curaddr->ifa_name); + printf("Device (%s) does not have an address :/\n", curaddr->ifa_name); curaddr = curaddr->ifa_next; continue; } - + u16 af = curaddr->ifa_addr->sa_family; if (af == AF_INET) { @@ -279,23 +279,23 @@ bool Init(bool open_adapter) else if (af == AF_PACKET) { struct sockaddr_ll* sa = (sockaddr_ll*)curaddr->ifa_addr; - if (sa->sll_halen != 6) + if (sa->sll_halen != 6) printf("weird MAC length %d for %s\n", sa->sll_halen, curaddr->ifa_name); else memcpy(adata->MAC, sa->sll_addr, 6); } - + curaddr = curaddr->ifa_next; } } - + freeifaddrs(addrs); #endif // __WIN32__ if (!open_adapter) return true; if (PCapAdapter) pcap_close(PCapAdapter); - + // open pcap device PCapAdapterData = &Adapters[0]; for (int i = 0; i < NumAdapters; i++) diff --git a/src/libui_sdl/LAN_PCap.h b/src/libui_sdl/LAN_PCap.h index 6ca43e8..250b8e9 100644 --- a/src/libui_sdl/LAN_PCap.h +++ b/src/libui_sdl/LAN_PCap.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/libui_sdl/LAN_Socket.cpp b/src/libui_sdl/LAN_Socket.cpp index a9f2cd7..c6fbd4b 100644 --- a/src/libui_sdl/LAN_Socket.cpp +++ b/src/libui_sdl/LAN_Socket.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/libui_sdl/LAN_Socket.h b/src/libui_sdl/LAN_Socket.h index a0abe45..8453a5f 100644 --- a/src/libui_sdl/LAN_Socket.h +++ b/src/libui_sdl/LAN_Socket.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/libui_sdl/MelonCap.cpp b/src/libui_sdl/MelonCap.cpp index fde440a..6e45bf5 100644 --- a/src/libui_sdl/MelonCap.cpp +++ b/src/libui_sdl/MelonCap.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/libui_sdl/MelonCap.h b/src/libui_sdl/MelonCap.h index 1185dea..33a391b 100644 --- a/src/libui_sdl/MelonCap.h +++ b/src/libui_sdl/MelonCap.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/libui_sdl/OSD.cpp b/src/libui_sdl/OSD.cpp index bd44e99..a01e39b 100644 --- a/src/libui_sdl/OSD.cpp +++ b/src/libui_sdl/OSD.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/libui_sdl/OSD.h b/src/libui_sdl/OSD.h index afe403f..12294ea 100644 --- a/src/libui_sdl/OSD.h +++ b/src/libui_sdl/OSD.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/libui_sdl/Platform.cpp b/src/libui_sdl/Platform.cpp index cc1b734..54fa568 100644 --- a/src/libui_sdl/Platform.cpp +++ b/src/libui_sdl/Platform.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. @@ -189,7 +189,7 @@ FILE* OpenDataFile(const char* path) FILE* f = fopen(path, "rb"); if (f) return f; - + return NULL; } diff --git a/src/libui_sdl/PlatformConfig.cpp b/src/libui_sdl/PlatformConfig.cpp index a2eaab9..f78b195 100644 --- a/src/libui_sdl/PlatformConfig.cpp +++ b/src/libui_sdl/PlatformConfig.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/libui_sdl/PlatformConfig.h b/src/libui_sdl/PlatformConfig.h index 682b9bc..9e02862 100644 --- a/src/libui_sdl/PlatformConfig.h +++ b/src/libui_sdl/PlatformConfig.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/libui_sdl/font.h b/src/libui_sdl/font.h index 8647b7a..f2e4f87 100644 --- a/src/libui_sdl/font.h +++ b/src/libui_sdl/font.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp index 130c8f9..9d52985 100644 --- a/src/libui_sdl/main.cpp +++ b/src/libui_sdl/main.cpp @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. @@ -2760,7 +2760,7 @@ int main(int argc, char** argv) char* locationName = EmuDirectory; #endif char msgboxtext[512]; - sprintf(msgboxtext, + sprintf(msgboxtext, "One or more of the following required files don't exist or couldn't be accessed:\n\n" "bios7.bin -- ARM7 BIOS\n" "bios9.bin -- ARM9 BIOS\n" diff --git a/src/libui_sdl/main_shaders.h b/src/libui_sdl/main_shaders.h index 6504520..22d4dd9 100644 --- a/src/libui_sdl/main_shaders.h +++ b/src/libui_sdl/main_shaders.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/types.h b/src/types.h index 9b1edc9..234d4c0 100644 --- a/src/types.h +++ b/src/types.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. diff --git a/src/version.h b/src/version.h index 2e18ba9..6250601 100644 --- a/src/version.h +++ b/src/version.h @@ -1,5 +1,5 @@ /* - Copyright 2016-2019 Arisotura + Copyright 2016-2020 Arisotura This file is part of melonDS. -- cgit v1.2.3 From ab911571e03e81a641f33856ccd02c85af80b10b Mon Sep 17 00:00:00 2001 From: niemand-deu <42780488+niemand-deu@users.noreply.github.com> Date: Wed, 26 Feb 2020 03:56:03 +0100 Subject: Update main.cpp --- src/libui_sdl/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libui_sdl') diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp index 9d52985..8e8bf9e 100644 --- a/src/libui_sdl/main.cpp +++ b/src/libui_sdl/main.cpp @@ -2714,7 +2714,7 @@ int main(int argc, char** argv) } #else const char* confdir = g_get_user_config_dir(); - const char* confname = "/melonds"; + const char* confname = "/melonDS"; EmuDirectory = new char[strlen(confdir) + strlen(confname) + 1]; strcat(EmuDirectory, confdir); strcat(EmuDirectory, confname); -- cgit v1.2.3 From 4c560f3324e68e4aab20f6855ddc1a3f569ca0c7 Mon Sep 17 00:00:00 2001 From: Arisotura Date: Sat, 11 Apr 2020 23:56:36 +0200 Subject: GPU3D: swap vin and vout during clipping, giving results that are closer to hardware. fixes #598 and also fixes #379 --- src/GPU3D.cpp | 2 +- src/libui_sdl/MelonCap.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/libui_sdl') diff --git a/src/GPU3D.cpp b/src/GPU3D.cpp index 52bc10f..1b316d5 100644 --- a/src/GPU3D.cpp +++ b/src/GPU3D.cpp @@ -888,7 +888,7 @@ void StallPolygonPipeline(s32 delay, s32 nonstalldelay) template -void ClipSegment(Vertex* outbuf, Vertex* vout, Vertex* vin) +void ClipSegment(Vertex* outbuf, Vertex* vin, Vertex* vout) { s64 factor_num = vin->Position[3] - (plane*vin->Position[comp]); s32 factor_den = factor_num - (vout->Position[3] - (plane*vout->Position[comp])); diff --git a/src/libui_sdl/MelonCap.cpp b/src/libui_sdl/MelonCap.cpp index 6e45bf5..2658b66 100644 --- a/src/libui_sdl/MelonCap.cpp +++ b/src/libui_sdl/MelonCap.cpp @@ -336,8 +336,8 @@ void Update() colA &= mask; colB &= mask; - if (colA == colB) WinBitmapData[(y*768) + x + 512] = 0xFF00FF00; - else WinBitmapData[(y*768) + x + 512] = 0xFFFF0000; + if (colA == colB) WinBitmapData[(y*768) + x + 512] = 0xFF000000;//0xFF00FF00; + else WinBitmapData[(y*768) + x + 512] = 0xFFFFFFFF;//0xFFFF0000; } } -- cgit v1.2.3 From a6150a9a9eaab7431b62a527f538c570ab8a6990 Mon Sep 17 00:00:00 2001 From: Nadia Holmquist Pedersen Date: Sun, 12 Apr 2020 16:59:06 +0200 Subject: Use pkg-config to find SDL2 on Windows --- src/libui_sdl/CMakeLists.txt | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'src/libui_sdl') diff --git a/src/libui_sdl/CMakeLists.txt b/src/libui_sdl/CMakeLists.txt index 8c8467b..bcecc81 100644 --- a/src/libui_sdl/CMakeLists.txt +++ b/src/libui_sdl/CMakeLists.txt @@ -22,13 +22,12 @@ option(BUILD_SHARED_LIBS "Whether to build libui as a shared library or a static set(BUILD_SHARED_LIBS OFF) add_subdirectory(libui) -find_package(SDL2 REQUIRED) -include_directories(${SDL2_INCLUDE_DIR}) -#string(STRIP ${SDL2_LIBRARIES} SDL2_LIBRARIES) +find_package(PkgConfig REQUIRED) +pkg_check_modules(SDL2 REQUIRED sdl2) add_executable(melonDS ${SOURCES_LIBUI}) -target_link_libraries(melonDS - core ${SDL2_LIBRARIES} libui) +target_include_directories(melonDS PRIVATE ${SDL2_INCLUDE_DIRS}) +target_link_libraries(melonDS core libui ${SDL2_LIBRARIES}) if (UNIX) option(UNIX_PORTABLE "Make a portable build that looks for its configuration in the current directory" OFF) @@ -38,12 +37,9 @@ if (UNIX) find_package(PkgConfig REQUIRED) pkg_check_modules(GTK3 REQUIRED gtk+-3.0) - pkg_check_modules(SDL2 REQUIRED sdl2) - target_include_directories(melonDS - PRIVATE ${GTK3_INCLUDE_DIRS} ${SDL2_INCLUDE_DIRS} - ) - target_link_libraries(melonDS ${GTK3_LIBRARIES} ${SDL2_LIBRARIES}) + target_include_directories(melonDS PRIVATE ${GTK3_INCLUDE_DIRS}) + target_link_libraries(melonDS ${GTK3_LIBRARIES}) ADD_DEFINITIONS(${GTK3_CFLAGS_OTHER}) -- cgit v1.2.3 From 4b57416552ec2fa95216e2b044559f215723bf70 Mon Sep 17 00:00:00 2001 From: Nadia Holmquist Pedersen Date: Sun, 12 Apr 2020 17:15:39 +0200 Subject: Windows: explicitly link gdi32 --- src/libui_sdl/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libui_sdl') diff --git a/src/libui_sdl/CMakeLists.txt b/src/libui_sdl/CMakeLists.txt index bcecc81..a3a7f8a 100644 --- a/src/libui_sdl/CMakeLists.txt +++ b/src/libui_sdl/CMakeLists.txt @@ -59,7 +59,7 @@ if (UNIX) elseif (WIN32) target_sources(melonDS PUBLIC "${CMAKE_SOURCE_DIR}/melon.rc") target_include_directories(melonDS PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..") - target_link_libraries(melonDS comctl32 d2d1 dwrite uxtheme ws2_32 iphlpapi) + target_link_libraries(melonDS comctl32 d2d1 dwrite uxtheme ws2_32 iphlpapi gdi32) endif () install(FILES ../../net.kuribo64.melonDS.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications) -- cgit v1.2.3