Closed terminator2k2 closed 12 months ago
So in order to provide support for Metal Slug 5 Plus I have been informed that there needs to be a custom bankswitch mapper at 0x2FFFFX, here is the relevant Mame code
case NEOGEO_MSLUG5P: space.install_read_handler(0x2ffff0, 0x2fffff, read16m_delegate(m_slots[m_curr_slot], FUNC(neogeo_cart_slot_device::protection_r))); space.install_write_handler(0x2ffff0, 0x2fffff, write16sm_delegate(this, FUNC(neogeo_base_state::write_bankprot_ms5p))); break;
Special function:
void neogeo_base_state::write_bankprot_ms5p(offs_t offset, uint16_t data) { logerror("ms5plus bankswitch - offset: %06x PC %06x: set banking %04x\n", offset, m_maincpu->pc(), data);
if ((offset == 0) && (data == 0xa0)) { m_bank_base = 0xa0; m_bank_cartridge->set_base((uint8_t )m_slots[m_curr_slot]->get_rom_base() + m_bank_base); } else if (offset == 2) { m_bank_base = m_slots[m_curr_slot]->get_bank_base(data); m_bank_cartridge->set_base((uint8_t )m_slots[m_curr_slot]->get_rom_base() + m_bank_base); } }
Discussion on the forum here: https://misterfpga.org/viewtopic.php?t=5202
Image of relevant section for Mappers in Mame
according to this discussion: https://www.neo-geo.com/forums/index.php?threads/metal-slug-5-and-5.234216/
5+ is simply bootleg without any difference from original 5. I don't see much point to add a weird mapper (NeoGeo has enough space to fit the ROM without mapper) for variant working identically to original.
5 plus is a hack of 5 with a few differences more or less the same additions as 4 plus. Making up the rom it doesnt work properly on mister and niether does the metal slug 5 bootleg rom (mslug5b) which gadgetuk was using to do his conversion.
i've tried to implement the mapper.. Something weird happens. it still crashes.
In FBNeo they use different bank switcher: https://github.com/finalburnneo/FBNeo/blob/e42009e3303bfdbefddf5ea2334d38d69b619a9c/src/burn/drv/neogeo/d_neogeo.cpp#L9913
but from my observation of P2ROM of this game, at least reading of last bytes is wrong in both emulators. MAME returns A0 for last 16 bytes of P2 ROM address space. FBNeo doesn't map full address space leaving last 8KB from first bank regardless the current bank. In ROM as i see each bank has identifier so it most likely full 1MB should be mapped.
Whatever.. i'm losing patience on this weird hack which basically gives nothing.. May be my rom set is wrong..
There is a pack in HTGDB on internet archive where you can get ms5plus rom
https://gitlab.com/jgemu/geolith/-/blob/master/src/geo_m68k.c?ref_type=heads Use my emulator as a reference. I've got a much simpler implementation of all the strange and exotic mappers.
For ms5plus
I recall there were some troubles with converting it to .neo. I think the problem may be in how the conversion is done, and I am not sure the publicly available tools can convert this one properly. Try ms5plus from the "LunaGarlic" set and you may have better luck.
I tried the .neo from the LunaGarlic set and it does not work correctly either, graphical glitches and missing background layers, then the game crashes.
From what I understand these plus hacks only add minor things to the game like switching to different transformed states in 5, or summoning a thunder cloud to attack enemies in 4. No actual new content.
@protogem2 yes, it will fail in the MiSTer implementation until the special bankswitching routine is implemented:
// Metal Slug 5 Plus (bootleg)
/* Shift the data left 16 when 16-bit writes to 0x2ffff4 occur to get the new
switchable bank address offset. Simple. Everything else about the board is
the typical behaviour.
*/
To add more chaos: i've used .neo rom which it seems not touched and it's probably uses 0x2ffff4 address (it has some obfuscation code). Then i found in my archives decrypted set of roms where ms5plus set is patched and uses 0x2ffff0 address for bank switch.
lol.. the patched one works with standard bank switching, no special code required at all :)
any more info on this working rom set?
i've added support for non-patched version.
need to update Main, Core and romsets.xml (if you use this format)
just wandering if the game mapper/rom bank switching could be added for metal slug 5 plus rom to the core?