mGBA Wii port does not load 32 MB ROMs in RetroArch

I don’t know if the issue has been made known or reported, but the Libretro Port of mGBA on the Wii, on RetroArch, fails to load 32 MB ROMs, however, the standalone version of mGBA on the Wii does. I also know the RA core of this runs somewhat faster than the standalone version. I wanted this to be the definitive version, so i wanted to bring this to your attention and try to figure out why one loads them and the other doesn’t; aren’t the from the same source code? Then surely, couldn’t this 32 MB ROM issue be fixed?

mgba standalone has to fit mgba and the game in ram. With retroarch you need to fit mgba, retroarch and the game.

Vba next and mednafen gba have the same problem. The vba next core from retroarch 1.0.0.2 can load 32 mb files…

Post removed by user

RA can run 32 MB roms on mGBA, but it needs to use mem2 manager on memory mapping of mGBA memory.c file, I just dont know how to link that 2 things. mGBA needs to use mem2 memory (50 MB of free RAM) so it can fit, I have been looking on both RA and MGBA and they can work together.

Could that solution also enable FBA to load larger Neo Geo ROMS?

Post removed by user

Ok let me explain this again. There are is no disctinction from cores and retroarch in consoles. PERIOD. EVERY SINGLE DOL is a full copy of RetroArch + Core. The cores are statically linked to RetroArch. If it worked in 1.0.0.2 then I guess RA was just smaller

[QUOTE=nintendonerd1889;27794]So in other words, it’ll forever be a gimped port, stunted and never to be improved or even load larger GBA games? Well that’s disheartening -_-. Why even bother having it ported over then if it’s going to limit what should be the main feature of this emulator, and that is, high compatibility and speed? No offense, but I don’t think it was even worth having it ported to work with RA. The standalone emulator is great, barring a couple of problematic games, but I hate to be this brutally honest, because to me, knowing this limitation, an RA core never should have been made for mGBA.

Well, there ya have it, two versions of mGBA on the Wii, one that loads 32 MB ROMs perfectly, another that never will, but runs faster somewhat. Gotcha.

Yup, the Wii simply can’t run mGBA on top of RA without sacrifices, meaning it never will run on RA properly.[/QUOTE]

We didn’t “port” mgba to the wii. Endrift himself made a libretro port, there was demand so I built it. PERIOD, it’s not gimped, it’s not an stunt. It also was ZERO effort. I’m sick of your negativism to be honest, don’t PM me again.

Is that a generic memory mapper?

[QUOTE=Radius;27798] Is that a generic memory mapper?[/QUOTE]

In standalone mgba wii port you get a file called wii-memory.c, last time I get a full reject from emu to Homebrew channel, but in a self compile of mgba project, I added mem2.h, mem2.c and ppc_asm.h shared in libretro too, they’re in retroarch/wii/ you get there mem2_manager.c and mem2_manager.h. Back to mgba, I did this.


#include "wii-mem2.h"

void* anonymousMemoryMap(size_t size) {
	return mem2_malloc(size);
}

void mappedMemoryFree(void* memory, size_t size) {
	UNUSED(size);
	mem2_free(memory);
}

But in retroarch is like this on /libretro-mgba/src/platform/libretro/memory.c


void* anonymousMemoryMap(size_t size) {
#ifdef _WIN32
	return VirtualAlloc(NULL, size, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
#elif defined(__CELLOS_LV2__)  || defined(GEKKO)
   return (void*)malloc(size);
#elif defined(GEKKO) //here something like that goes here
   return mem2_malloc(size); //here too
#else
	return mmap(0, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
#endif
}

void mappedMemoryFree(void* memory, size_t size) {
	UNUSED(size);
#ifdef _WIN32
	// size is not useful here because we're freeing the memory, not decommitting it
	VirtualFree(memory, 0, MEM_RELEASE);
#elif defined(__CELLOS_LV2__) || defined(GEKKO)
   free(memory);
#elif defined(GEKKO) //here something like that goes here
   return mem2_free(memory); //here too
#else
	munmap(memory, size);
#endif
}

Almost there … and on /libretro-mgba/src/platform/libretro/libretro.c


bool retro_load_game(const struct retro_game_info* game) {
	struct VFile* rom;
	if (game->data) {
#if !defined(GEKKO) //here something like that goes here
		data = malloc(game->size);
#else
data = mem2_malloc(game->size);
#endif
		memcpy(data, game->data, game->size);
		rom = VFileFromMemory(data, game->size);
	} else {

Something like that, I can’t do it because recent commits have issues and error on libretro port, at leas to me.

[QUOTE=Radius;27798]Ok let me explain this again. There are is no disctinction from cores and retroarch in consoles. PERIOD. EVERY SINGLE DOL is a full copy of RetroArch + Core. The cores are statically linked to RetroArch. If it worked in 1.0.0.2 then I guess RA was just smaller[/QUOTE]

I didnt mention there was a distinction, I just said gba cores for Wii are not loading 32 mb roms in 1.2.2. I found a solution for loading 32 mb roms on the mgba core but it’s unstable and buggy, for now loads fine 16 and 32 mb roms but 8 mb and below tend to crash. It’s ok for me because I wanted to play Mother 3 with RA. For the rest of roms there’s the core I build days ago.