mirror of
https://github.com/Rosalie241/RMG.git
synced 2026-07-11 17:44:02 +02:00
Compare commits
47 Commits
v0.7.7
...
small64-test
| Author | SHA1 | Date | |
|---|---|---|---|
| f6b41187cc | |||
| 5696153e34 | |||
| 0813a6e3ea | |||
| 606eb976cb | |||
| 443ff545ab | |||
| 3c615c8459 | |||
| 7973b5d151 | |||
| 8f0cd29366 | |||
| b39357efda | |||
| 3e0efac610 | |||
| 595427aa98 | |||
| 62c30a4b4d | |||
| 13f7ede034 | |||
| f89b73cec1 | |||
| 30d1f17329 | |||
| b8ad7d1dce | |||
| 6552aa23ec | |||
| 6d81b8cda3 | |||
| f5de7e8320 | |||
| 0d2b88037f | |||
| ac7b9bce27 | |||
| d87bcc3a21 | |||
| 7261903186 | |||
| 2e6263ea5c | |||
| fa9a288e0a | |||
| 7fced2d3eb | |||
| 9bc56e90ee | |||
| 64d4c41d1d | |||
| c2197b3053 | |||
| 3f7c1584a4 | |||
| 17dc26779e | |||
| edc8c0bb98 | |||
| 5bf5d0ed16 | |||
| 7114338cec | |||
| 64d0a90b82 | |||
| d6b0f024da | |||
| 3b2668977d | |||
| 5aa7ee0fe3 | |||
| f0119ec75d | |||
| 249654a879 | |||
| 950becc1b3 | |||
| b3424f3fc5 | |||
| e0e19824a5 | |||
| b3b8c2d8b1 | |||
| d9cd714c2c | |||
| fb85a42477 | |||
| 1458f3df0b |
@@ -53,11 +53,12 @@ mv "$bin_dir/usr/share" "$bin_dir/share"
|
||||
mv "$bin_dir/usr" "$bin_dir/shared"
|
||||
|
||||
$XVFB_RUN "$script_dir/lib4bin" --dst-dir "$bin_dir" \
|
||||
--hard-links --patch-rpath --strip \
|
||||
--with-hooks --strace-mode --with-sharun \
|
||||
--hard-links --strip --with-hooks \
|
||||
--strace-mode --with-sharun \
|
||||
"$bin_dir/shared/bin/RMG" \
|
||||
"$lib_dir"/libSDL* \
|
||||
"$lib_dir"/libspeexdsp* \
|
||||
"$lib_dir"/libhidapi-hidraw* \
|
||||
"$lib_dir"/libGL* \
|
||||
"$lib_dir"/libEGL* \
|
||||
"$lib_dir"/libvulkan* \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Maintainer: Rosalie Wanders <rosalie@mailbox.org>
|
||||
pkgname=rmg
|
||||
pkgver=0.7.7
|
||||
pkgver=0.7.8
|
||||
pkgrel=1
|
||||
pkgdesc="Rosalie's Mupen GUI"
|
||||
arch=('x86_64' 'aarch64')
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
Name: RMG
|
||||
Version: 0.7.7
|
||||
Version: 0.7.8
|
||||
Release: %autorelease
|
||||
Summary: Rosalie's Mupen GUI
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 129 KiB After Width: | Height: | Size: 135 KiB |
@@ -29,6 +29,26 @@
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
<releases>
|
||||
<release version="v0.7.8" date="2025-03-23" type="stable">
|
||||
<description>
|
||||
<p>Changes:</p>
|
||||
<ul>
|
||||
<li>Fix ROM browser loading screen showing '[0/0]'</li>
|
||||
<li>Fix configuration dialog of RMG-Input not closing when pressing escape</li>
|
||||
<li>Fix AppImage not including libhidapi-hidraw</li>
|
||||
<li>Fix AppImage not working on nvidia GPUs since v0.7.7 (thank you Samueru-sama)</li>
|
||||
<li>Fix casing in error message in RMG-Core</li>
|
||||
<li>Fix missing space for 'Start:' label in RMG-Input</li>
|
||||
<li>Fix inconsistent height for UI elements in RMG-Input</li>
|
||||
<li>Fix mupen64plus not being shutdown properly</li>
|
||||
<li>Fix high memory requirement introduced in v0.7.1</li>
|
||||
<li>Add bounds checking for some DMA operations</li>
|
||||
<li>Add new controller image to RMG-Input (thank you Jaffacakelover)</li>
|
||||
<li>Add support for using a local file path for the netplay server list URL</li>
|
||||
<li>Swap Z-Trigger and Start UI elements in RMG-Input</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release version="v0.7.7" date="2025-03-05" type="stable">
|
||||
<description>
|
||||
<p>Changes:</p>
|
||||
|
||||
@@ -131,6 +131,9 @@ EXPORT m64p_error CALL CoreShutdown(void)
|
||||
release_mem_base(g_mem_base);
|
||||
g_mem_base = NULL;
|
||||
|
||||
/* deallocate rom memory */
|
||||
release_mem_rom();
|
||||
|
||||
l_CoreInit = 0;
|
||||
return M64ERR_SUCCESS;
|
||||
}
|
||||
|
||||
+4
-2
@@ -26,6 +26,8 @@
|
||||
|
||||
#include "main/rom.h"
|
||||
|
||||
#include "device/r4300/r4300_core.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -129,10 +131,10 @@ void init_cart(struct cart* cart,
|
||||
|
||||
init_flashram(&cart->flashram,
|
||||
flashram_type,
|
||||
flashram_storage, iflashram_storage);
|
||||
flashram_storage, iflashram_storage, r4300->rdram);
|
||||
|
||||
init_sram(&cart->sram,
|
||||
sram_storage, isram_storage);
|
||||
sram_storage, isram_storage, r4300->rdram);
|
||||
|
||||
if (ROM_SETTINGS.savetype == SAVETYPE_SRAM)
|
||||
cart->use_flashram = -1;
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "device/memory/memory.h"
|
||||
#include "device/r4300/r4300_core.h"
|
||||
#include "device/rcp/pi/pi_controller.h"
|
||||
#include "device/rdram/rdram.h"
|
||||
|
||||
#define __STDC_FORMAT_MACROS
|
||||
#include <inttypes.h>
|
||||
@@ -101,7 +102,7 @@ unsigned int cart_rom_dma_write(void* opaque, uint8_t* dram, uint32_t dram_addr,
|
||||
|
||||
if (cart_addr + length < cart_rom->rom_size)
|
||||
{
|
||||
for(i = 0; i < length; ++i) {
|
||||
for(i = 0; i < length && (dram_addr+i) < cart_rom->r4300->rdram->dram_size; ++i) {
|
||||
dram[(dram_addr+i)^S8] = mem[(cart_addr+i)^S8];
|
||||
}
|
||||
}
|
||||
@@ -111,10 +112,10 @@ unsigned int cart_rom_dma_write(void* opaque, uint8_t* dram, uint32_t dram_addr,
|
||||
? 0
|
||||
: cart_rom->rom_size - cart_addr;
|
||||
|
||||
for (i = 0; i < diff; ++i) {
|
||||
for (i = 0; i < diff && (dram_addr+i) < cart_rom->r4300->rdram->dram_size; ++i) {
|
||||
dram[(dram_addr+i)^S8] = mem[(cart_addr+i)^S8];
|
||||
}
|
||||
for (; i < length; ++i) {
|
||||
for (; i < length && (dram_addr+i) < cart_rom->r4300->rdram->dram_size; ++i) {
|
||||
dram[(dram_addr+i)^S8] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "api/m64p_types.h"
|
||||
#include "backends/api/storage_backend.h"
|
||||
#include "device/memory/memory.h"
|
||||
#include "device/rdram/rdram.h"
|
||||
|
||||
#define __STDC_FORMAT_MACROS
|
||||
#include <inttypes.h>
|
||||
@@ -122,12 +123,13 @@ static void flashram_command(struct flashram* flashram, uint32_t command)
|
||||
|
||||
void init_flashram(struct flashram* flashram,
|
||||
uint32_t flashram_id,
|
||||
void* storage, const struct storage_backend_interface* istorage)
|
||||
void* storage, const struct storage_backend_interface* istorage, struct rdram* rdram)
|
||||
{
|
||||
flashram->silicon_id[0] = FLASHRAM_TYPE_ID;
|
||||
flashram->silicon_id[1] = flashram_id;
|
||||
flashram->storage = storage;
|
||||
flashram->istorage = istorage;
|
||||
flashram->rdram = rdram;
|
||||
}
|
||||
|
||||
void poweron_flashram(struct flashram* flashram)
|
||||
@@ -207,7 +209,7 @@ unsigned int flashram_dma_write(void* opaque, uint8_t* dram, uint32_t dram_addr,
|
||||
}
|
||||
|
||||
/* do actual DMA */
|
||||
for(i = 0; i < length; ++i) {
|
||||
for(i = 0; i < length && (dram_addr+i) < flashram->rdram->dram_size; ++i) {
|
||||
dram[(dram_addr+i)^S8] = mem[(cart_addr+i)^S8];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,12 +61,13 @@ struct flashram
|
||||
|
||||
void* storage;
|
||||
const struct storage_backend_interface* istorage;
|
||||
struct rdram* rdram;
|
||||
};
|
||||
|
||||
void init_flashram(struct flashram* flashram,
|
||||
uint32_t flashram_id,
|
||||
void* storage,
|
||||
const struct storage_backend_interface* istorage);
|
||||
const struct storage_backend_interface* istorage, struct rdram* rdram);
|
||||
|
||||
void poweron_flashram(struct flashram* flashram);
|
||||
|
||||
|
||||
@@ -55,8 +55,10 @@ void write_is_viewer(void* opaque, uint32_t address, uint32_t value, uint32_t ma
|
||||
{
|
||||
if (word > 0)
|
||||
{
|
||||
/* make sure we don't overflow the buffer */
|
||||
if (is_viewer->buffer_pos + word > IS_BUFFER_SIZE)
|
||||
/* make sure we don't overflow the integer or the buffer */
|
||||
if (is_viewer->buffer_pos > IS_BUFFER_SIZE
|
||||
|| word > IS_BUFFER_SIZE
|
||||
|| is_viewer->buffer_pos + word > IS_BUFFER_SIZE)
|
||||
{
|
||||
/* reset buffer */
|
||||
memset(is_viewer->output_buffer, 0, IS_BUFFER_SIZE);
|
||||
|
||||
+5
-3
@@ -27,6 +27,7 @@
|
||||
|
||||
#include "backends/api/storage_backend.h"
|
||||
#include "device/memory/memory.h"
|
||||
#include "device/rdram/rdram.h"
|
||||
|
||||
#define SRAM_ADDR_MASK UINT32_C(0x0000ffff)
|
||||
|
||||
@@ -36,10 +37,11 @@ void format_sram(uint8_t* mem)
|
||||
}
|
||||
|
||||
void init_sram(struct sram* sram,
|
||||
void* storage, const struct storage_backend_interface* istorage)
|
||||
void* storage, const struct storage_backend_interface* istorage, struct rdram* rdram)
|
||||
{
|
||||
sram->storage = storage;
|
||||
sram->istorage = istorage;
|
||||
sram->rdram = rdram;
|
||||
}
|
||||
|
||||
unsigned int sram_dma_read(void* opaque, const uint8_t* dram, uint32_t dram_addr, uint32_t cart_addr, uint32_t length)
|
||||
@@ -50,7 +52,7 @@ unsigned int sram_dma_read(void* opaque, const uint8_t* dram, uint32_t dram_addr
|
||||
|
||||
cart_addr &= SRAM_ADDR_MASK;
|
||||
|
||||
for (i = 0; i < length; ++i) {
|
||||
for (i = 0; i < length && (cart_addr+i) < SRAM_SIZE; ++i) {
|
||||
mem[(cart_addr+i)^S8] = dram[(dram_addr+i)^S8];
|
||||
}
|
||||
|
||||
@@ -67,7 +69,7 @@ unsigned int sram_dma_write(void* opaque, uint8_t* dram, uint32_t dram_addr, uin
|
||||
|
||||
cart_addr &= SRAM_ADDR_MASK;
|
||||
|
||||
for (i = 0; i < length; ++i) {
|
||||
for (i = 0; i < length && (dram_addr+i) < sram->rdram->dram_size; ++i) {
|
||||
dram[(dram_addr+i)^S8] = mem[(cart_addr+i)^S8];
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -32,12 +32,13 @@ struct sram
|
||||
{
|
||||
void* storage;
|
||||
const struct storage_backend_interface* istorage;
|
||||
struct rdram* rdram;
|
||||
};
|
||||
|
||||
void format_sram(uint8_t* sram);
|
||||
|
||||
void init_sram(struct sram* sram,
|
||||
void* storage, const struct storage_backend_interface* istorage);
|
||||
void* storage, const struct storage_backend_interface* istorage, struct rdram* rdram);
|
||||
|
||||
unsigned int sram_dma_read(void* opaque, const uint8_t* dram, uint32_t dram_addr, uint32_t cart_addr, uint32_t length);
|
||||
unsigned int sram_dma_write(void* opaque, uint8_t* dram, uint32_t dram_addr, uint32_t cart_addr, uint32_t length);
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ static void get_pi_dma_handler(struct cart* cart, struct dd_controller* dd, uint
|
||||
|
||||
if (address >= MM_CART_ROM) {
|
||||
if (address >= MM_CART_DOM3) {
|
||||
/* 0x1fd00000 - 0xffffffff : dom3 addr2, cart rom */
|
||||
/* 0x1fd00000 - 0x7fffffff : dom3 addr2, cart rom */
|
||||
RW(cart, cart_dom3);
|
||||
}
|
||||
else {
|
||||
|
||||
+38
-7
@@ -222,12 +222,11 @@ enum { MB_RDRAM_DRAM_ALIGNMENT_REQUIREMENT = 64 * 1024 };
|
||||
|
||||
enum {
|
||||
MB_RDRAM_DRAM = 0,
|
||||
MB_CART_ROM = MB_RDRAM_DRAM + RDRAM_MAX_SIZE,
|
||||
MB_RSP_MEM = MB_CART_ROM + CART_ROM_MAX_SIZE,
|
||||
MB_RSP_MEM = MB_RDRAM_DRAM + RDRAM_MAX_SIZE,
|
||||
MB_DD_ROM = MB_RSP_MEM + SP_MEM_SIZE,
|
||||
MB_PIF_MEM = MB_DD_ROM + DD_ROM_MAX_SIZE,
|
||||
MB_MAX_SIZE = MB_PIF_MEM + PIF_ROM_SIZE + PIF_RAM_SIZE,
|
||||
MB_MAX_SIZE_FULL = 0x120000000,
|
||||
MB_MAX_SIZE_FULL = 0x20000000
|
||||
};
|
||||
|
||||
/* Use LSB of mem_base pointer to encode mem_base mode
|
||||
@@ -237,6 +236,9 @@ enum {
|
||||
#define MEM_BASE_PTR(mem_base) ((void*)((uintptr_t)(mem_base) & ~0x1))
|
||||
#define SET_MEM_BASE_MODE(mem_base) (mem_base = (void*)((uintptr_t)(mem_base) | 0x1))
|
||||
|
||||
static void* mem_rom = NULL;
|
||||
static uint32_t mem_rom_size = 0;
|
||||
|
||||
void* init_mem_base(void)
|
||||
{
|
||||
void* mem_base;
|
||||
@@ -277,13 +279,42 @@ void release_mem_base(void* mem_base)
|
||||
free(MEM_BASE_PTR(mem_base));
|
||||
}
|
||||
|
||||
void* init_mem_rom(uint32_t size)
|
||||
{
|
||||
if (size > mem_rom_size) {
|
||||
mem_rom = realloc(mem_rom, size);
|
||||
if (mem_rom == NULL)
|
||||
mem_rom_size = 0;
|
||||
else
|
||||
mem_rom_size = size;
|
||||
}
|
||||
|
||||
return mem_rom;
|
||||
}
|
||||
|
||||
void release_mem_rom(void)
|
||||
{
|
||||
if (mem_rom != NULL) {
|
||||
free(mem_rom);
|
||||
mem_rom = NULL;
|
||||
}
|
||||
|
||||
mem_rom_size = 0;
|
||||
}
|
||||
|
||||
uint32_t* mem_base_u32(void* mem_base, uint32_t address)
|
||||
{
|
||||
uint32_t* mem;
|
||||
|
||||
if (MEM_BASE_MODE(mem_base) == 0) {
|
||||
/* In full mem base mode, use simple pointer arithmetic */
|
||||
mem = (uint32_t*)((uint8_t*)mem_base + address);
|
||||
/* In full mem base mode, use simple pointer arithmetic
|
||||
* except for the rom, which is dynamically allocated
|
||||
*/
|
||||
if (address >= MM_CART_ROM && (address & UINT32_C(0xfff00000)) != MM_PIF_MEM) {
|
||||
mem = (uint32_t*)((uint8_t*)mem_rom + (address - MM_CART_ROM));
|
||||
} else {
|
||||
mem = (uint32_t*)((uint8_t*)mem_base + address);
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* In compressed mem base mode, select appropriate mem_base offset */
|
||||
@@ -296,10 +327,10 @@ uint32_t* mem_base_u32(void* mem_base, uint32_t address)
|
||||
if ((address & UINT32_C(0xfff00000)) == MM_PIF_MEM) {
|
||||
mem = (uint32_t*)((uint8_t*)mem_base + (address - MM_PIF_MEM + MB_PIF_MEM));
|
||||
} else {
|
||||
mem = (uint32_t*)((uint8_t*)mem_base + (address - MM_CART_ROM + MB_CART_ROM));
|
||||
mem = (uint32_t*)((uint8_t*)mem_rom + (address - MM_CART_ROM));
|
||||
}
|
||||
}
|
||||
else if ((address & UINT32_C(0xfe000000)) == MM_DD_ROM) {
|
||||
else if ((address & UINT32_C(0xfe000000)) == MM_DD_ROM) {
|
||||
mem = (uint32_t*)((uint8_t*)mem_base + (address - MM_DD_ROM + MB_DD_ROM));
|
||||
}
|
||||
else if ((address & UINT32_C(0xffffe000)) == MM_RSP_MEM) {
|
||||
|
||||
@@ -91,6 +91,8 @@ void apply_mem_mapping(struct memory* mem, const struct mem_mapping* mapping);
|
||||
|
||||
void* init_mem_base(void);
|
||||
void release_mem_base(void* mem_base);
|
||||
void* init_mem_rom(uint32_t size);
|
||||
void release_mem_rom(void);
|
||||
uint32_t* mem_base_u32(void* mem_base, uint32_t address);
|
||||
|
||||
void read_with_bp_checks(void* opaque, uint32_t address, uint32_t* value);
|
||||
|
||||
+75
-41
@@ -50,6 +50,13 @@ static uint8_t l_plugin[4];
|
||||
static uint8_t l_buffer_target;
|
||||
static uint8_t l_player_lag[4];
|
||||
|
||||
//UDP packets
|
||||
static UDPpacket *l_request_input_packet;
|
||||
static UDPpacket *l_send_input_packet;
|
||||
static UDPpacket *l_process_packet;
|
||||
static UDPpacket *l_check_sync_packet;
|
||||
static const int32_t l_check_sync_packet_size = (CP0_REGS_COUNT * 4) + 5;
|
||||
|
||||
//UDP packet formats
|
||||
#define UDP_SEND_KEY_INFO 0
|
||||
#define UDP_RECEIVE_KEY_INFO 1
|
||||
@@ -115,6 +122,31 @@ m64p_error netplay_start(const char* host, int port)
|
||||
return M64ERR_SYSTEM_FAIL;
|
||||
}
|
||||
|
||||
l_request_input_packet = SDLNet_AllocPacket(12);
|
||||
l_send_input_packet = SDLNet_AllocPacket(11);
|
||||
l_process_packet = SDLNet_AllocPacket(512);
|
||||
l_check_sync_packet = SDLNet_AllocPacket(l_check_sync_packet_size);
|
||||
if (l_request_input_packet == NULL ||
|
||||
l_send_input_packet == NULL ||
|
||||
l_process_packet == NULL ||
|
||||
l_check_sync_packet == NULL)
|
||||
{
|
||||
DebugMessage(M64MSG_ERROR, "Netplay: could not allocate UDP packets");
|
||||
SDLNet_UDP_Close(l_udpSocket);
|
||||
l_udpSocket = NULL;
|
||||
SDLNet_TCP_Close(l_tcpSocket);
|
||||
l_tcpSocket = NULL;
|
||||
SDLNet_FreePacket(l_request_input_packet);
|
||||
l_request_input_packet = NULL;
|
||||
SDLNet_FreePacket(l_send_input_packet);
|
||||
l_send_input_packet = NULL;
|
||||
SDLNet_FreePacket(l_process_packet);
|
||||
l_process_packet = NULL;
|
||||
SDLNet_FreePacket(l_check_sync_packet);
|
||||
l_check_sync_packet = NULL;
|
||||
return M64ERR_NO_MEMORY;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 4; ++i)
|
||||
{
|
||||
l_netplay_control[i] = -1;
|
||||
@@ -165,6 +197,16 @@ m64p_error netplay_stop()
|
||||
l_tcpSocket = NULL;
|
||||
l_udpSocket = NULL;
|
||||
l_udpChannel = -1;
|
||||
|
||||
SDLNet_FreePacket(l_request_input_packet);
|
||||
SDLNet_FreePacket(l_send_input_packet);
|
||||
SDLNet_FreePacket(l_process_packet);
|
||||
SDLNet_FreePacket(l_check_sync_packet);
|
||||
l_request_input_packet = NULL;
|
||||
l_send_input_packet = NULL;
|
||||
l_process_packet = NULL;
|
||||
l_check_sync_packet = NULL;
|
||||
|
||||
l_netplay_is_init = 0;
|
||||
SDLNet_Quit();
|
||||
return M64ERR_SUCCESS;
|
||||
@@ -191,16 +233,14 @@ static uint8_t buffer_size(uint8_t control_id)
|
||||
|
||||
static void netplay_request_input(uint8_t control_id)
|
||||
{
|
||||
UDPpacket *packet = SDLNet_AllocPacket(12);
|
||||
packet->data[0] = UDP_REQUEST_KEY_INFO;
|
||||
packet->data[1] = control_id; //The player we need input for
|
||||
SDLNet_Write32(l_reg_id, &packet->data[2]); //our registration ID
|
||||
SDLNet_Write32(l_cin_compats[control_id].netplay_count, &packet->data[6]); //the current event count
|
||||
packet->data[10] = l_spectator; //whether we are a spectator
|
||||
packet->data[11] = buffer_size(control_id); //our local buffer size
|
||||
packet->len = 12;
|
||||
SDLNet_UDP_Send(l_udpSocket, l_udpChannel, packet);
|
||||
SDLNet_FreePacket(packet);
|
||||
l_request_input_packet->data[0] = UDP_REQUEST_KEY_INFO;
|
||||
l_request_input_packet->data[1] = control_id; //The player we need input for
|
||||
SDLNet_Write32(l_reg_id, &l_request_input_packet->data[2]); //our registration ID
|
||||
SDLNet_Write32(l_cin_compats[control_id].netplay_count, &l_request_input_packet->data[6]); //the current event count
|
||||
l_request_input_packet->data[10] = l_spectator; //whether we are a spectator
|
||||
l_request_input_packet->data[11] = buffer_size(control_id); //our local buffer size
|
||||
l_request_input_packet->len = 12;
|
||||
SDLNet_UDP_Send(l_udpSocket, l_udpChannel, l_request_input_packet);
|
||||
}
|
||||
|
||||
static int check_valid(uint8_t control_id, uint32_t count)
|
||||
@@ -240,21 +280,20 @@ static int netplay_require_response(void* opaque)
|
||||
static void netplay_process()
|
||||
{
|
||||
//In this function we process data we have received from the server
|
||||
UDPpacket *packet = SDLNet_AllocPacket(512);
|
||||
uint32_t curr, count, keys;
|
||||
uint8_t plugin, player, current_status;
|
||||
while (SDLNet_UDP_Recv(l_udpSocket, packet) == 1)
|
||||
while (SDLNet_UDP_Recv(l_udpSocket, l_process_packet) == 1)
|
||||
{
|
||||
switch (packet->data[0])
|
||||
switch (l_process_packet->data[0])
|
||||
{
|
||||
case UDP_RECEIVE_KEY_INFO:
|
||||
case UDP_RECEIVE_KEY_INFO_GRATUITOUS:
|
||||
player = packet->data[1];
|
||||
player = l_process_packet->data[1];
|
||||
//current_status is a status update from the server
|
||||
//it will let us know if another player has disconnected, or the games have desynced
|
||||
current_status = packet->data[2];
|
||||
if (packet->data[0] == UDP_RECEIVE_KEY_INFO)
|
||||
l_player_lag[player] = packet->data[3];
|
||||
current_status = l_process_packet->data[2];
|
||||
if (l_process_packet->data[0] == UDP_RECEIVE_KEY_INFO)
|
||||
l_player_lag[player] = l_process_packet->data[3];
|
||||
if (current_status != l_status)
|
||||
{
|
||||
if (((current_status & 0x1) ^ (l_status & 0x1)) != 0)
|
||||
@@ -269,9 +308,9 @@ static void netplay_process()
|
||||
curr = 5;
|
||||
//this loop processes input data from the server, inserting new events into the linked list for each player
|
||||
//it skips events that we have already recorded, or if we receive data for an event that has already happened
|
||||
for (uint8_t i = 0; i < packet->data[4]; ++i)
|
||||
for (uint8_t i = 0; i < l_process_packet->data[4]; ++i)
|
||||
{
|
||||
count = SDLNet_Read32(&packet->data[curr]);
|
||||
count = SDLNet_Read32(&l_process_packet->data[curr]);
|
||||
curr += 4;
|
||||
|
||||
if (((count - l_cin_compats[player].netplay_count) > (UINT32_MAX / 2)) || (check_valid(player, count))) //event doesn't need to be recorded
|
||||
@@ -280,9 +319,9 @@ static void netplay_process()
|
||||
continue;
|
||||
}
|
||||
|
||||
keys = SDLNet_Read32(&packet->data[curr]);
|
||||
keys = SDLNet_Read32(&l_process_packet->data[curr]);
|
||||
curr += 4;
|
||||
plugin = packet->data[curr];
|
||||
plugin = l_process_packet->data[curr];
|
||||
curr += 1;
|
||||
|
||||
//insert new event at beginning of linked list
|
||||
@@ -299,7 +338,6 @@ static void netplay_process()
|
||||
break;
|
||||
}
|
||||
}
|
||||
SDLNet_FreePacket(packet);
|
||||
}
|
||||
|
||||
static int netplay_ensure_valid(uint8_t control_id)
|
||||
@@ -383,15 +421,13 @@ static uint32_t netplay_get_input(uint8_t control_id)
|
||||
|
||||
static void netplay_send_input(uint8_t control_id, uint32_t keys)
|
||||
{
|
||||
UDPpacket *packet = SDLNet_AllocPacket(11);
|
||||
packet->data[0] = UDP_SEND_KEY_INFO;
|
||||
packet->data[1] = control_id; //player number
|
||||
SDLNet_Write32(l_cin_compats[control_id].netplay_count, &packet->data[2]); // current event count
|
||||
SDLNet_Write32(keys, &packet->data[6]); //key data
|
||||
packet->data[10] = l_plugin[control_id]; //current plugin
|
||||
packet->len = 11;
|
||||
SDLNet_UDP_Send(l_udpSocket, l_udpChannel, packet);
|
||||
SDLNet_FreePacket(packet);
|
||||
l_send_input_packet->data[0] = UDP_SEND_KEY_INFO;
|
||||
l_send_input_packet->data[1] = control_id; //player number
|
||||
SDLNet_Write32(l_cin_compats[control_id].netplay_count, &l_send_input_packet->data[2]); // current event count
|
||||
SDLNet_Write32(keys, &l_send_input_packet->data[6]); //key data
|
||||
l_send_input_packet->data[10] = l_plugin[control_id]; //current plugin
|
||||
l_send_input_packet->len = 11;
|
||||
SDLNet_UDP_Send(l_udpSocket, l_udpChannel, l_send_input_packet);
|
||||
}
|
||||
|
||||
uint8_t netplay_register_player(uint8_t player, uint8_t plugin, uint8_t rawdata, uint32_t reg_id)
|
||||
@@ -541,22 +577,20 @@ void netplay_check_sync(struct cp0* cp0)
|
||||
if (!netplay_is_init())
|
||||
return;
|
||||
|
||||
const uint32_t* cp0_regs = r4300_cp0_regs(cp0);
|
||||
|
||||
if (l_vi_counter % 600 == 0)
|
||||
{
|
||||
uint32_t packet_len = (CP0_REGS_COUNT * 4) + 5;
|
||||
UDPpacket *packet = SDLNet_AllocPacket(packet_len);
|
||||
packet->data[0] = UDP_SYNC_DATA;
|
||||
SDLNet_Write32(l_vi_counter, &packet->data[1]); //current VI count
|
||||
const uint32_t* cp0_regs = r4300_cp0_regs(cp0);
|
||||
|
||||
l_check_sync_packet->data[0] = UDP_SYNC_DATA;
|
||||
SDLNet_Write32(l_vi_counter, &l_check_sync_packet->data[1]); //current VI count
|
||||
for (int i = 0; i < CP0_REGS_COUNT; ++i)
|
||||
{
|
||||
SDLNet_Write32(cp0_regs[i], &packet->data[(i * 4) + 5]);
|
||||
SDLNet_Write32(cp0_regs[i], &l_check_sync_packet->data[(i * 4) + 5]);
|
||||
}
|
||||
packet->len = packet_len;
|
||||
SDLNet_UDP_Send(l_udpSocket, l_udpChannel, packet);
|
||||
SDLNet_FreePacket(packet);
|
||||
l_check_sync_packet->len = l_check_sync_packet_size;
|
||||
SDLNet_UDP_Send(l_udpSocket, l_udpChannel, l_check_sync_packet);
|
||||
}
|
||||
|
||||
++l_vi_counter;
|
||||
}
|
||||
|
||||
|
||||
+10
-1
@@ -76,12 +76,16 @@ static const uint8_t Z64_SIGNATURE[4] = { 0x80, 0x37, 0x12, 0x40 };
|
||||
static const uint8_t V64_SIGNATURE[4] = { 0x37, 0x80, 0x40, 0x12 };
|
||||
static const uint8_t N64_SIGNATURE[4] = { 0x40, 0x12, 0x37, 0x80 };
|
||||
|
||||
static const uint8_t ALT_Z64_SIGNATURE[4] = { 0x31, 0x37, 0x12, 0x40 };
|
||||
|
||||
/* Tests if a file is a valid N64 rom by checking the first 4 bytes and size */
|
||||
static int is_valid_rom(const unsigned char *buffer, unsigned int size)
|
||||
{
|
||||
printf("rom signature: 0x%02X, 0x%02X, 0x%02X, 0x%02X\n", buffer[0], buffer[1], buffer[2], buffer[3]);
|
||||
if ((memcmp(buffer, Z64_SIGNATURE, sizeof(Z64_SIGNATURE)) == 0)
|
||||
|| (memcmp(buffer, V64_SIGNATURE, sizeof(V64_SIGNATURE)) == 0 && size % 2 == 0)
|
||||
|| (memcmp(buffer, N64_SIGNATURE, sizeof(N64_SIGNATURE)) == 0 && size % 4 == 0))
|
||||
|| (memcmp(buffer, N64_SIGNATURE, sizeof(N64_SIGNATURE)) == 0 && size % 4 == 0)
|
||||
|| (memcmp(buffer, ALT_Z64_SIGNATURE, sizeof(ALT_Z64_SIGNATURE)) == 0))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
@@ -149,9 +153,14 @@ m64p_error open_rom(const unsigned char* romimage, unsigned int size)
|
||||
if (romimage == NULL || !is_valid_rom(romimage, size))
|
||||
{
|
||||
DebugMessage(M64MSG_ERROR, "open_rom(): not a valid ROM image");
|
||||
printf("fail\n");
|
||||
return M64ERR_INPUT_INVALID;
|
||||
}
|
||||
|
||||
/* ensure mem_base has enough memory allocated */
|
||||
if (init_mem_rom(size) == NULL)
|
||||
return M64ERR_NO_MEMORY;
|
||||
|
||||
/* Clear Byte-swapped flag, since ROM is now deleted. */
|
||||
g_RomWordsLittleEndian = 0;
|
||||
/* allocate new buffer for ROM and copy into this buffer */
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@
|
||||
[subrepo]
|
||||
remote = git@github.com:/gonetz/GLideN64.git
|
||||
branch = master
|
||||
commit = 42129aadb16e0fb0e9c265ee134dbc7f9c4022e6
|
||||
parent = 2c32dfd552dbfa5c2293b00fa22c4a08dd8c4eaf
|
||||
commit = 9f8fc1e4c59c4cdb37112ef0c100158b25c2c1cb
|
||||
parent = 3c615c84599a0ea8624c2deea4c8ba438ce988d6
|
||||
method = merge
|
||||
cmdver = 0.4.6
|
||||
|
||||
@@ -17,8 +17,9 @@ namespace graphics {
|
||||
struct CachedTexture;
|
||||
struct FrameBuffer;
|
||||
|
||||
#define VERTBUFF_SIZE 256U
|
||||
#define ELEMBUFF_SIZE 1024U
|
||||
constexpr u32 VERTBUFF_SIZE = 256U;
|
||||
constexpr u32 VERTBUFF_MASK = VERTBUFF_SIZE - 1;
|
||||
constexpr u32 ELEMBUFF_SIZE = 1024U;
|
||||
|
||||
constexpr f32 SCREEN_SIZE_DIM = 640.0f;
|
||||
constexpr u32 MIPMAP_TILE_WIDTH = 256u;
|
||||
@@ -136,7 +137,7 @@ public:
|
||||
|
||||
bool isRejected(u32 _v0, u32 _v1, u32 _v2) const;
|
||||
|
||||
SPVertex & getVertex(u32 _v) { return triangles.vertices[_v]; }
|
||||
SPVertex & getVertex(u32 _v) { return triangles.vertices[_v&VERTBUFF_MASK]; }
|
||||
|
||||
SPVertex * getVertexPtr(u32 _v) { return triangles.vertices.data() + _v; }
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <iomanip>
|
||||
#include <fstream>
|
||||
#include <ctime>
|
||||
#include <chrono>
|
||||
|
||||
#ifndef MUPENPLUSAPI // zilmar spec
|
||||
|
||||
|
||||
@@ -1566,6 +1566,11 @@ bool gSPCullVertices( u32 v0, u32 vn )
|
||||
// Aidyn Chronicles - The First Mage seems to pass parameters in reverse order.
|
||||
std::swap(v0, vn);
|
||||
}
|
||||
|
||||
if (vn >= VERTBUFF_SIZE)
|
||||
// Wrong input. DL is wrong, let's cull it.
|
||||
return true;
|
||||
|
||||
u32 clip = 0;
|
||||
GraphicsDrawer & drawer = dwnd().getDrawer();
|
||||
for (u32 i = v0; i <= vn; ++i) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
@@ -9,6 +9,8 @@
|
||||
*/
|
||||
#define CORE_INTERNAL
|
||||
#include "Archive.hpp"
|
||||
|
||||
#include "Directories.hpp"
|
||||
#include "Library.hpp"
|
||||
#include "String.hpp"
|
||||
#include "Error.hpp"
|
||||
@@ -27,7 +29,12 @@
|
||||
|
||||
// minizip includes
|
||||
#include <unzip.h>
|
||||
#ifndef ZNGLIB_H_
|
||||
/* sadly older minizip-ng versions didn't include zlib.h automatically,
|
||||
* so i.e voidpf would be undefined, in newer minizip-ng versions,
|
||||
* including zlib.h will cause an error */
|
||||
#include <zlib.h>
|
||||
#endif
|
||||
|
||||
//
|
||||
// Local Defines
|
||||
@@ -155,11 +162,11 @@ CORE_EXPORT bool CoreReadZipFile(std::filesystem::path file, std::filesystem::pa
|
||||
for (uint64_t i = 0; i < zipInfo.number_entry; i++)
|
||||
{
|
||||
unz_file_info fileInfo;
|
||||
char fileName[PATH_MAX];
|
||||
char fileName[CORE_DIR_MAX_LEN];
|
||||
|
||||
// if we can't retrieve file info,
|
||||
// skip the file
|
||||
if (unzGetCurrentFileInfo(zipFile, &fileInfo, fileName, PATH_MAX, nullptr, 0, nullptr, 0) != UNZ_OK)
|
||||
if (unzGetCurrentFileInfo(zipFile, &fileInfo, fileName, CORE_DIR_MAX_LEN, nullptr, 0, nullptr, 0) != UNZ_OK)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -319,7 +326,7 @@ CORE_EXPORT bool CoreRead7zipFile(std::filesystem::path file, std::filesystem::p
|
||||
for (uint32_t i = 0; i < db.NumFiles; i++)
|
||||
{
|
||||
size_t filename_size = 0;
|
||||
uint16_t fileName[PATH_MAX];
|
||||
uint16_t fileName[CORE_DIR_MAX_LEN];
|
||||
|
||||
// skip directories
|
||||
if (SzArEx_IsDir(&db, i))
|
||||
@@ -329,7 +336,7 @@ CORE_EXPORT bool CoreRead7zipFile(std::filesystem::path file, std::filesystem::p
|
||||
|
||||
// skip when filename size exceeds our buffer size
|
||||
filename_size = SzArEx_GetFileNameUtf16(&db, i, nullptr);
|
||||
if (filename_size > PATH_MAX)
|
||||
if (filename_size > CORE_DIR_MAX_LEN)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -342,7 +349,7 @@ CORE_EXPORT bool CoreRead7zipFile(std::filesystem::path file, std::filesystem::p
|
||||
// so we have to catch the exception and do nothing
|
||||
try
|
||||
{
|
||||
fileNamePath = (char16_t*)fileName;
|
||||
fileNamePath = reinterpret_cast<char16_t*>(fileName);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
@@ -474,10 +481,10 @@ CORE_EXPORT bool CoreUnzip(std::filesystem::path file, std::filesystem::path pat
|
||||
for (uint64_t i = 0; i < zipInfo.number_entry; i++)
|
||||
{
|
||||
unz_file_info fileInfo;
|
||||
char fileName[PATH_MAX];
|
||||
char fileName[CORE_DIR_MAX_LEN];
|
||||
|
||||
// ensure we can retrieve the current file info
|
||||
if (unzGetCurrentFileInfo(zipFile, &fileInfo, fileName, PATH_MAX, nullptr, 0, nullptr, 0) != UNZ_OK)
|
||||
if (unzGetCurrentFileInfo(zipFile, &fileInfo, fileName, CORE_DIR_MAX_LEN, nullptr, 0, nullptr, 0) != UNZ_OK)
|
||||
{
|
||||
unzClose(zipFile);
|
||||
error = "CoreUnzip: unzGetCurrentFileInfo Failed!";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
@@ -24,7 +24,6 @@
|
||||
// Local Defines
|
||||
//
|
||||
|
||||
#define MAX_FILENAME_LEN 4096
|
||||
#define ROMHEADER_NAME_LEN 256
|
||||
#define GOODNAME_LEN 256
|
||||
#define MD5_LEN 33
|
||||
@@ -79,7 +78,7 @@ static std::filesystem::path get_cache_file_name(void)
|
||||
|
||||
static std::vector<l_CacheEntry>::iterator get_cache_entry_iter(const std::filesystem::path& file, bool checkFileTime = true)
|
||||
{
|
||||
CoreFileTime fileTime = CoreGetFileTime(file);
|
||||
CoreFileTime fileTime = (checkFileTime ? CoreGetFileTime(file) : 0);
|
||||
|
||||
auto predicate = [file, fileTime, checkFileTime](const auto& entry)
|
||||
{
|
||||
@@ -87,7 +86,7 @@ static std::vector<l_CacheEntry>::iterator get_cache_entry_iter(const std::files
|
||||
(!checkFileTime || entry.fileTime == fileTime);
|
||||
};
|
||||
|
||||
return std::find_if(l_CacheEntries.begin(), l_CacheEntries.end(), predicate);
|
||||
return std::find_if(l_CacheEntries.begin(), l_CacheEntries.end(), predicate);
|
||||
}
|
||||
|
||||
static void add_cache_entry(const std::filesystem::path& file, CoreRomType type,
|
||||
@@ -152,7 +151,7 @@ CORE_EXPORT void CoreReadRomHeaderAndSettingsCache(void)
|
||||
{
|
||||
std::ifstream inputStream;
|
||||
char magicBuf[sizeof(CACHE_FILE_MAGIC)];
|
||||
wchar_t fileNameBuf[MAX_FILENAME_LEN];
|
||||
wchar_t fileNameBuf[CORE_DIR_MAX_LEN];
|
||||
char headerNameBuf[ROMHEADER_NAME_LEN];
|
||||
char gameIDBuf[GAMEID_LEN];
|
||||
char regionBuf[REGION_LEN];
|
||||
@@ -261,7 +260,7 @@ CORE_EXPORT void CoreReadRomHeaderAndSettingsCache(void)
|
||||
CORE_EXPORT bool CoreSaveRomHeaderAndSettingsCache(void)
|
||||
{
|
||||
std::ofstream outputStream;
|
||||
wchar_t fileNameBuf[MAX_FILENAME_LEN];
|
||||
wchar_t fileNameBuf[CORE_DIR_MAX_LEN];
|
||||
char headerNameBuf[ROMHEADER_NAME_LEN];
|
||||
char gameIDBuf[GAMEID_LEN];
|
||||
char regionBuf[REGION_LEN];
|
||||
@@ -306,7 +305,7 @@ CORE_EXPORT bool CoreSaveRomHeaderAndSettingsCache(void)
|
||||
memset(md5Buf, 0, sizeof(md5Buf));
|
||||
|
||||
// copy strings into buffers
|
||||
wcsncpy(fileNameBuf, cacheEntry.fileName.wstring().c_str(), MAX_FILENAME_LEN);
|
||||
wcsncpy(fileNameBuf, cacheEntry.fileName.wstring().c_str(), CORE_DIR_MAX_LEN);
|
||||
strncpy(headerNameBuf, cacheEntry.header.Name.c_str(), sizeof(headerNameBuf));
|
||||
strncpy(gameIDBuf, cacheEntry.header.GameID.c_str(), sizeof(gameIDBuf));
|
||||
strncpy(regionBuf, cacheEntry.header.Region.c_str(), sizeof(regionBuf));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
@@ -42,7 +42,7 @@ static std::vector<l_DebugCallbackMessage> l_PendingCallbacks;
|
||||
|
||||
void CoreDebugCallback(void* context, int level, const char* message)
|
||||
{
|
||||
std::string contextString((const char*)context);
|
||||
std::string contextString(static_cast<char*>(context));
|
||||
std::string messageString(message);
|
||||
|
||||
if (!l_SetupCallbacks)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
+13
-12
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
@@ -188,7 +188,7 @@ static std::string join_split_string(const std::vector<std::string>& splitStr, c
|
||||
continue;
|
||||
}
|
||||
|
||||
element = splitStr.at(i);
|
||||
element = splitStr[i];
|
||||
|
||||
joinedString += element;
|
||||
// when not at the last element,
|
||||
@@ -208,7 +208,7 @@ static bool parse_cheat(const std::vector<std::string>& lines, int startIndex, C
|
||||
std::string line;
|
||||
for (size_t i = startIndex; i < lines.size(); i++)
|
||||
{
|
||||
line = lines.at(i);
|
||||
line = lines[i];
|
||||
|
||||
// Parse metadata
|
||||
// $Cheat Name
|
||||
@@ -240,7 +240,7 @@ static bool parse_cheat(const std::vector<std::string>& lines, int startIndex, C
|
||||
break;
|
||||
}
|
||||
|
||||
std::vector<std::string> splitLine = split_string(line, ' ');
|
||||
const std::vector<std::string> splitLine = split_string(line, ' ');
|
||||
|
||||
// skip invalid lines
|
||||
if (splitLine.size() < 2)
|
||||
@@ -253,8 +253,8 @@ static bool parse_cheat(const std::vector<std::string>& lines, int startIndex, C
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string address = splitLine.at(0);
|
||||
std::string value = splitLine.at(1);
|
||||
std::string address = splitLine[0];
|
||||
std::string value = splitLine[1];
|
||||
|
||||
if (splitLine.size() == 2 && address.size() == 8 && (value.size() == 4 || value.size() == 9))
|
||||
{ // cheat code
|
||||
@@ -265,7 +265,7 @@ static bool parse_cheat(const std::vector<std::string>& lines, int startIndex, C
|
||||
// so strip the old value
|
||||
if (value.size() == 9)
|
||||
{
|
||||
if (value.at(4) == ':')
|
||||
if (value[4] == ':')
|
||||
{
|
||||
value.erase(4, 5);
|
||||
}
|
||||
@@ -347,7 +347,7 @@ static bool parse_cheat_file(const std::vector<std::string>& lines, CoreCheatFil
|
||||
|
||||
for (size_t index = 0; index < lines.size(); index++)
|
||||
{
|
||||
line = lines.at(index);
|
||||
line = lines[index];
|
||||
|
||||
if (!readHeader && line.starts_with("[") && line.ends_with("]"))
|
||||
{
|
||||
@@ -364,7 +364,7 @@ static bool parse_cheat_file(const std::vector<std::string>& lines, CoreCheatFil
|
||||
else
|
||||
{ // CRC1 & CRC2 & CountryCode
|
||||
// validate header
|
||||
if (line.size() != 22 || line.at(8) != '-' || line.at(17) != '-' || line.at(18) != 'C' || line.at(19) != ':')
|
||||
if (line.size() != 22 || line[8] != '-' || line[17] != '-' || line[18] != 'C' || line[19] != ':')
|
||||
{
|
||||
error = "parse_cheat_file Failed: ";
|
||||
error += "invalid header: \"";
|
||||
@@ -374,9 +374,10 @@ static bool parse_cheat_file(const std::vector<std::string>& lines, CoreCheatFil
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string crc1 = split_string(line, '-').at(0);
|
||||
std::string crc2 = split_string(line, '-').at(1);
|
||||
std::string countryCode = split_string(line, ':').at(1);
|
||||
const std::vector<std::string> splitCrcString = split_string(line, '-');
|
||||
const std::string crc1 = splitCrcString[0];
|
||||
const std::string crc2 = splitCrcString[1];
|
||||
const std::string countryCode = split_string(line, ':')[1];
|
||||
|
||||
cheatFile.CRC1 = std::strtoll(crc1.c_str(), nullptr, 16);
|
||||
cheatFile.CRC2 = std::strtoll(crc2.c_str(), nullptr, 16);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
@@ -138,7 +138,7 @@ CORE_EXPORT bool CoreInit(void)
|
||||
CoreStateCallback);
|
||||
if (m64p_ret != M64ERR_SUCCESS)
|
||||
{
|
||||
error = "CoreInit M64P::Core.Startup() Failed: ";
|
||||
error = "CoreInit m64p::Core.Startup() Failed: ";
|
||||
error += m64p::Core.ErrorMessage(m64p_ret);
|
||||
CoreSetError(error);
|
||||
return false;
|
||||
@@ -196,6 +196,8 @@ CORE_EXPORT void CoreShutdown(void)
|
||||
CoreDiscordRpcShutdown();
|
||||
#endif // DISCORD_RPC
|
||||
|
||||
m64p::Core.Shutdown();
|
||||
|
||||
m64p::Core.Unhook();
|
||||
m64p::Config.Unhook();
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
@@ -17,7 +17,7 @@
|
||||
#include "m64p/Api.hpp"
|
||||
|
||||
#include <filesystem>
|
||||
#include <iostream>
|
||||
#include <stdexcept>
|
||||
#include <optional>
|
||||
#include <cstdlib>
|
||||
#include <cstdio>
|
||||
@@ -58,15 +58,14 @@ static std::filesystem::path get_exe_directory(void)
|
||||
if (GetModuleFileNameW(nullptr, buffer, MAX_PATH) == 0)
|
||||
{
|
||||
MessageBoxA(nullptr, "get_exe_directory: GetModuleFileNameW() Failed!", "Error", MB_OK | MB_ICONERROR);
|
||||
std::terminate();
|
||||
throw std::runtime_error("get_exe_directory: GetModuleFileNameW() failed");
|
||||
}
|
||||
directory = std::filesystem::path(buffer).parent_path();
|
||||
#else // _WIN32
|
||||
directory = std::filesystem::canonical("/proc/self/exe", errorCode).parent_path();
|
||||
if (errorCode)
|
||||
{
|
||||
std::cerr << "get_exe_directory: std::filesystem::canonical(\"/proc/self/exe\") failed: " << errorCode.message() << std::endl;
|
||||
std::terminate();
|
||||
throw std::runtime_error("get_exe_directory: std::filesystem::canonical(\"/proc/self/exe\") failed: " + errorCode.message());
|
||||
}
|
||||
#endif // _WIN32
|
||||
return directory.make_preferred();
|
||||
@@ -112,8 +111,7 @@ static std::filesystem::path get_var_directory(std::string var, std::string appe
|
||||
env = std::getenv(fallbackVar.c_str());
|
||||
if (env == nullptr)
|
||||
{
|
||||
std::cerr << "get_var_directory: fallbackVar: $" << fallbackVar << " cannot be nullptr!" << std::endl;
|
||||
std::terminate();
|
||||
throw std::runtime_error("get_var_directory: fallbackVar: $" + fallbackVar + " cannot be non-existent");
|
||||
}
|
||||
directory = env;
|
||||
directory += fallbackAppend;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
@@ -17,6 +17,7 @@
|
||||
#else // Unix
|
||||
#define CORE_DIR_SEPERATOR_STR "/"
|
||||
#endif // _WIN32
|
||||
#define CORE_DIR_MAX_LEN 4096
|
||||
|
||||
// tries to create the needed directories,
|
||||
// returns false when failed
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
+34
-57
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
#include <filesystem>
|
||||
#include <algorithm>
|
||||
#include <stdexcept>
|
||||
#include <cstring>
|
||||
#include <array>
|
||||
|
||||
@@ -39,24 +40,23 @@ static char l_PluginContext[4][20];
|
||||
// Local Functions
|
||||
//
|
||||
|
||||
static m64p::PluginApi* get_plugin(CorePluginType type)
|
||||
static m64p::PluginApi& get_plugin(CorePluginType type)
|
||||
{
|
||||
if (type == CorePluginType::Invalid ||
|
||||
static_cast<int>(type) < 0 ||
|
||||
if (static_cast<int>(type) < 1 ||
|
||||
static_cast<int>(type) > 4)
|
||||
{
|
||||
return nullptr;
|
||||
throw std::runtime_error("get_plugin: called with invalid type");
|
||||
}
|
||||
|
||||
return &l_Plugins[static_cast<int>(type) - 1];
|
||||
return l_Plugins[static_cast<int>(type) - 1];
|
||||
}
|
||||
|
||||
static CorePluginType get_plugin_type(m64p::PluginApi* plugin)
|
||||
static CorePluginType get_plugin_type(m64p::PluginApi& plugin)
|
||||
{
|
||||
m64p_error ret;
|
||||
m64p_plugin_type m64p_type = M64PLUGIN_NULL;
|
||||
|
||||
ret = plugin->GetVersion(&m64p_type, nullptr, nullptr, nullptr, nullptr);
|
||||
ret = plugin.GetVersion(&m64p_type, nullptr, nullptr, nullptr, nullptr);
|
||||
if (ret != M64ERR_SUCCESS)
|
||||
{
|
||||
return CorePluginType::Invalid;
|
||||
@@ -71,12 +71,12 @@ static CorePluginType get_plugin_type(m64p::PluginApi* plugin)
|
||||
return static_cast<CorePluginType>(m64p_type);
|
||||
}
|
||||
|
||||
static std::string get_plugin_name(m64p::PluginApi* plugin, const std::string& filename)
|
||||
static std::string get_plugin_name(m64p::PluginApi& plugin, const std::string& filename)
|
||||
{
|
||||
m64p_error ret;
|
||||
const char* name = nullptr;
|
||||
|
||||
ret = plugin->GetVersion(nullptr, nullptr, nullptr, &name, nullptr);
|
||||
ret = plugin.GetVersion(nullptr, nullptr, nullptr, &name, nullptr);
|
||||
if (ret != M64ERR_SUCCESS ||
|
||||
name == nullptr)
|
||||
{
|
||||
@@ -190,7 +190,6 @@ static bool apply_plugin_settings(const std::array<std::string, 4>& pluginSettin
|
||||
{
|
||||
std::string error;
|
||||
std::string settingValue;
|
||||
m64p::PluginApi* plugin;
|
||||
CorePluginType pluginType;
|
||||
CoreLibraryHandle handle;
|
||||
m64p_error ret;
|
||||
@@ -209,12 +208,12 @@ static bool apply_plugin_settings(const std::array<std::string, 4>& pluginSettin
|
||||
|
||||
if (settingValue != l_PluginFiles[i])
|
||||
{
|
||||
plugin = &l_Plugins[i];
|
||||
m64p::PluginApi& plugin = l_Plugins[i];
|
||||
|
||||
// shutdown plugin when hooked
|
||||
if (plugin->IsHooked())
|
||||
if (plugin.IsHooked())
|
||||
{
|
||||
ret = plugin->Shutdown();
|
||||
ret = plugin.Shutdown();
|
||||
if (ret != M64ERR_SUCCESS)
|
||||
{
|
||||
error = "apply_plugin_settings (";
|
||||
@@ -226,7 +225,7 @@ static bool apply_plugin_settings(const std::array<std::string, 4>& pluginSettin
|
||||
}
|
||||
|
||||
// reset plugin
|
||||
plugin->Unhook();
|
||||
plugin.Unhook();
|
||||
}
|
||||
|
||||
// ensure library file exists
|
||||
@@ -250,14 +249,14 @@ static bool apply_plugin_settings(const std::array<std::string, 4>& pluginSettin
|
||||
}
|
||||
|
||||
// attempt to hook the library
|
||||
if (!plugin->Hook(handle))
|
||||
if (!plugin.Hook(handle))
|
||||
{
|
||||
error = "apply_plugin_settings (";
|
||||
error += get_plugin_type_name(pluginType);
|
||||
error += ")->Hook() Failed: ";
|
||||
error += plugin->GetLastError();
|
||||
error += plugin.GetLastError();
|
||||
CoreSetError(error);
|
||||
plugin->Unhook();
|
||||
plugin.Unhook();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -270,12 +269,12 @@ static bool apply_plugin_settings(const std::array<std::string, 4>& pluginSettin
|
||||
error += get_plugin_type_name(pluginType);
|
||||
error += "!";
|
||||
CoreSetError(error);
|
||||
plugin->Unhook();
|
||||
plugin.Unhook();
|
||||
return false;
|
||||
}
|
||||
|
||||
// attempt to start plugin
|
||||
ret = plugin->Startup(m64p::Core.GetHandle(), l_PluginContext[i], CoreDebugCallback);
|
||||
ret = plugin.Startup(m64p::Core.GetHandle(), l_PluginContext[i], CoreDebugCallback);
|
||||
if (ret != M64ERR_SUCCESS)
|
||||
{
|
||||
error = "apply_plugin_settings (";
|
||||
@@ -283,8 +282,8 @@ static bool apply_plugin_settings(const std::array<std::string, 4>& pluginSettin
|
||||
error += ")->Startup() Failed: ";
|
||||
error += m64p::Core.ErrorMessage(ret);
|
||||
CoreSetError(error);
|
||||
plugin->Shutdown();
|
||||
plugin->Unhook();
|
||||
plugin.Shutdown();
|
||||
plugin.Unhook();
|
||||
// force a re-load next time,
|
||||
// because this plugin isn't
|
||||
// the one we've stored in
|
||||
@@ -308,7 +307,7 @@ static bool open_plugin_config(CorePluginType type, void* parent, bool romConfig
|
||||
std::string error;
|
||||
m64p_error ret;
|
||||
bool resumeEmulation = false;
|
||||
m64p::PluginApi* plugin;
|
||||
m64p::PluginApi& plugin = get_plugin(type);
|
||||
std::string functionName;
|
||||
CoreRomHeader romHeader;
|
||||
CoreRomSettings romSettings;
|
||||
@@ -350,27 +349,17 @@ static bool open_plugin_config(CorePluginType type, void* parent, bool romConfig
|
||||
}
|
||||
}
|
||||
|
||||
plugin = get_plugin(type);
|
||||
if (plugin == nullptr)
|
||||
{
|
||||
error = "open_plugin_config Failed: ";
|
||||
error += get_plugin_type_name(type);
|
||||
error += " isn't a valid plugin type!";
|
||||
CoreSetError(error);
|
||||
return false;
|
||||
}
|
||||
|
||||
// check if the plugin has the ConfigWithRomConfig
|
||||
// or Config function, the ConfigWithRomConfig function
|
||||
// has priority
|
||||
if (plugin->ConfigWithRomConfig != nullptr)
|
||||
if (plugin.ConfigWithRomConfig != nullptr)
|
||||
{
|
||||
ret = plugin->ConfigWithRomConfig(parent, romConfig ? 1 : 0, &romHeader, &romSettings);
|
||||
ret = plugin.ConfigWithRomConfig(parent, romConfig ? 1 : 0, &romHeader, &romSettings);
|
||||
functionName = "Config2";
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = plugin->Config(parent);
|
||||
ret = plugin.Config(parent);
|
||||
functionName = "Config";
|
||||
}
|
||||
|
||||
@@ -419,8 +408,8 @@ CORE_EXPORT std::vector<CorePlugin> CoreGetAllPlugins(void)
|
||||
continue;
|
||||
}
|
||||
|
||||
plugin_name = get_plugin_name(&plugin, entry.path().filename().string());
|
||||
plugin_type = get_plugin_type(&plugin);
|
||||
plugin_name = get_plugin_name(plugin, entry.path().filename().string());
|
||||
plugin_type = get_plugin_type(plugin);
|
||||
|
||||
plugin.Unhook();
|
||||
CoreCloseLibrary(handle);
|
||||
@@ -499,20 +488,10 @@ CORE_EXPORT bool CoreArePluginsReady(void)
|
||||
CORE_EXPORT bool CorePluginsHasConfig(CorePluginType type)
|
||||
{
|
||||
std::string error;
|
||||
m64p::PluginApi* plugin;
|
||||
m64p::PluginApi& plugin = get_plugin(type);
|
||||
|
||||
plugin = get_plugin(type);
|
||||
if (plugin == nullptr)
|
||||
{
|
||||
error = "CorePluginsHasConfig Failed: ";
|
||||
error += get_plugin_type_name(type);
|
||||
error += " isn't a valid plugin type!";
|
||||
CoreSetError(error);
|
||||
return false;
|
||||
}
|
||||
|
||||
return plugin->Config != nullptr ||
|
||||
plugin->ConfigWithRomConfig != nullptr;
|
||||
return plugin.Config != nullptr ||
|
||||
plugin.ConfigWithRomConfig != nullptr;
|
||||
}
|
||||
|
||||
CORE_EXPORT bool CorePluginsOpenConfig(CorePluginType type, void* parent)
|
||||
@@ -522,11 +501,9 @@ CORE_EXPORT bool CorePluginsOpenConfig(CorePluginType type, void* parent)
|
||||
|
||||
CORE_EXPORT bool CorePluginsHasROMConfig(CorePluginType type)
|
||||
{
|
||||
m64p::PluginApi* plugin;
|
||||
m64p::PluginApi& plugin = get_plugin(type);
|
||||
|
||||
plugin = get_plugin(type);
|
||||
|
||||
return plugin->ConfigWithRomConfig != nullptr;
|
||||
return plugin.ConfigWithRomConfig != nullptr;
|
||||
}
|
||||
|
||||
CORE_EXPORT bool CorePluginsOpenROMConfig(CorePluginType type, void* parent, std::filesystem::path file)
|
||||
@@ -553,11 +530,11 @@ CORE_EXPORT bool CoreAttachPlugins(void)
|
||||
|
||||
for (int i = 0; i < static_cast<int>(CorePluginType::Count); i++)
|
||||
{
|
||||
ret = m64p::Core.AttachPlugin(plugin_types[i], get_plugin(static_cast<CorePluginType>(plugin_types[i]))->GetHandle());
|
||||
ret = m64p::Core.AttachPlugin(plugin_types[i], get_plugin(static_cast<CorePluginType>(plugin_types[i])).GetHandle());
|
||||
if (ret != M64ERR_SUCCESS)
|
||||
{
|
||||
error = "CoreAttachPlugins m64p::Core.AttachPlugin(";
|
||||
error += get_plugin_type_name((CorePluginType)plugin_types[i]);
|
||||
error += get_plugin_type_name(static_cast<CorePluginType>(plugin_types[i]));
|
||||
error += ") Failed: ";
|
||||
error += m64p::Core.ErrorMessage(ret);
|
||||
CoreSetError(error);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
@@ -12,6 +12,7 @@
|
||||
#else // Unix
|
||||
#include <arpa/inet.h>
|
||||
#endif // _WIN32
|
||||
#include <cstring>
|
||||
|
||||
#define CORE_INTERNAL
|
||||
#include "ConvertStringEncoding.hpp"
|
||||
@@ -168,13 +169,19 @@ CORE_EXPORT bool CoreGetCurrentRomHeader(CoreRomHeader& header)
|
||||
return false;
|
||||
}
|
||||
|
||||
printf("header name len: %i\n", strlen((char*)m64p_header.Name));
|
||||
|
||||
header.CRC1 = ntohl(m64p_header.CRC1);
|
||||
header.CRC2 = ntohl(m64p_header.CRC2);
|
||||
header.CountryCode = m64p_header.Country_code;
|
||||
header.Name = CoreConvertStringEncoding(std::string(reinterpret_cast<char*>(m64p_header.Name), 20), CoreStringEncoding::Shift_JIS);
|
||||
header.Name = CoreConvertStringEncoding(std::string(reinterpret_cast<char*>(m64p_header.Name),
|
||||
std::min(std::strlen(reinterpret_cast<char*>(m64p_header.Name)), static_cast<size_t>(20))),
|
||||
CoreStringEncoding::Shift_JIS);
|
||||
header.GameID = get_gameid_from_header(m64p_header);
|
||||
header.Region = get_region_from_countrycode(static_cast<char>(header.CountryCode));
|
||||
header.SystemType = get_systemtype_from_countrycode(header.CountryCode);
|
||||
|
||||
printf("header name len after: %i\n", header.Name.size());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
@@ -1560,7 +1560,7 @@ static bool int_list_to_string(const std::vector<int>& intList, std::string& str
|
||||
{
|
||||
for (size_t i = 0; i < intList.size(); i++)
|
||||
{
|
||||
int num = intList.at(i);
|
||||
int num = intList[i];
|
||||
string += std::to_string(num);
|
||||
|
||||
// don't add seperator at end
|
||||
@@ -1604,7 +1604,7 @@ static bool string_list_to_string(const std::vector<std::string>& stringList, st
|
||||
|
||||
for (size_t i = 0; i < stringList.size(); i++)
|
||||
{
|
||||
std::string str = stringList.at(i);
|
||||
std::string str = stringList[i];
|
||||
|
||||
// ensure the string doesn't contain
|
||||
// the separator character
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
@@ -22,6 +22,8 @@ class ConfigApi
|
||||
ConfigApi(void);
|
||||
~ConfigApi(void);
|
||||
|
||||
ConfigApi(const ConfigApi&) = delete;
|
||||
|
||||
bool Hook(m64p_dynlib_handle handle);
|
||||
bool Unhook(void);
|
||||
bool IsHooked(void);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
@@ -23,6 +23,8 @@ class CoreApi
|
||||
CoreApi();
|
||||
~CoreApi();
|
||||
|
||||
CoreApi(const CoreApi&) = delete;
|
||||
|
||||
bool Hook(m64p_dynlib_handle handle);
|
||||
bool Unhook(void);
|
||||
bool IsHooked(void);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
@@ -22,6 +22,8 @@ class PluginApi
|
||||
public:
|
||||
PluginApi(void);
|
||||
~PluginApi(void);
|
||||
|
||||
PluginApi(const PluginApi&) = delete;
|
||||
|
||||
bool Hook(m64p_dynlib_handle);
|
||||
bool Unhook(void);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
@@ -24,11 +24,21 @@ bool EventFilter::eventFilter(QObject *object, QEvent *event)
|
||||
switch (event->type())
|
||||
{
|
||||
case QEvent::Type::KeyPress:
|
||||
emit this->on_EventFilter_KeyPressed((QKeyEvent *)event);
|
||||
return true;
|
||||
{
|
||||
if (((QKeyEvent *)event)->key() != Qt::Key_Escape)
|
||||
{
|
||||
emit this->on_EventFilter_KeyPressed((QKeyEvent *)event);
|
||||
return true;
|
||||
}
|
||||
} break;
|
||||
case QEvent::Type::KeyRelease:
|
||||
emit this->on_EventFilter_KeyReleased((QKeyEvent *)event);
|
||||
return true;
|
||||
{
|
||||
if (((QKeyEvent *)event)->key() != Qt::Key_Escape)
|
||||
{
|
||||
emit this->on_EventFilter_KeyReleased((QKeyEvent *)event);
|
||||
return true;
|
||||
}
|
||||
} break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Rosalie's Mupen GUI - https://github.com/Rosalie241/RMG
|
||||
* Copyright (C) 2020 Rosalie Wanders <rosalie@mailbox.org>
|
||||
* Copyright (C) 2020-2025 Rosalie Wanders <rosalie@mailbox.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 3.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user