So now that I've got Pang Pom's Working I've turned my attention to the "mystery" game I mentioned. well that game is Poitto.
This is a weird one because Poitto was only released on the later MTR5260, BUT it's the only game on that hardware that uses the correct video chip and clock speeds that match the VG420/VG460 releases, so it's theoretically possible that it could work.
I'm sure this is going to be "dolphin speak" to a lot of you but I figured I'd nerd out a bit about how I'm tackling this problem. It wont hurt my feelings if you don't care about any of this but hey maybe some of you will find this interesting
I've been banging my head against the wall on this one because from all outward appearances this should be really straight forward to make work. the only real difference in the mame driver is the is in the 0x80000# address range, which is for inputs, dips, and coins. Literally everything else lines up exactly, this is the only area where the MTR PCB differs from the VG420 PCB. Most of the time conversions like that would just boot but the controls would be messed up and you'd have to do a little patching to fix it.... but poitto wont even BOOT.
What happens in in a normal boot process with these Metro Games
1. the monitor gets a sync signal with a black screen
2. a full screen of video garbage appears
3. the screen goes black momentarily
4. RAM CHECK appears on screen
5. the game enters attract mode
Poitto gets to step 3, but never reaches step 4, this is enough to confirm that my address remapping works (so it's not a similar problem to Pang Pom's which wouldn't even reach step 1). Even remapping the dips and controls to patch them into the right spots there was no change.
So what I started doing is running remapped code in MAME, essentially intentionally breaking the normal poitto game, and what I found is that MAME stops booting the game in the same spot on the boot process when I remap the "coins" input.
I don't actually think any of the dips or input mappings matter, but one other little tiny thing mixed in here is the "sound status" bit, some kind of IRQ...
Now my initial assumption was that sound status was was mapped essentially the same in both games.
The difference being that VG240 Reads AND writes to the address, while MTR only writes (no read at all), and that shouldn't be a problem.
this is last fortress:
Code:
map(0xc00001, 0xc00001).rw(FUNC(metro_upd7810_state::soundstatus_r), FUNC(metro_upd7810_state::soundstatus_w)); // From / To Sound CPU
this is poitto
Code:
map(0x800001, 0x800001).w(FUNC(metro_upd7810_state::soundstatus_w)); // To Sound CPU
Now I'm doing the high level address remapping to change the 0x80000# to a 0xC0000#, so these should be the same right? WRONG!
lets look at the coins mapping...
in last fortress:
Code:
map(0xc00004, 0xc00005).portr("IN0");
in poitto:
Code:
map(0x800000, 0x800001).portr("IN0");
you might think, ok they're at different addresses, so just patch it. poitto does the annoying thing where they're using the same address for two different things reading to 0x800001 for coins but writing to 0x800001 for sound status... but thats where I was wrong.
If we look at the input definition for each game
on last fortress:
Code:
static INPUT_PORTS_START( lastfort )
PORT_START("IN0") /*$c00004*/
COINS
...
on poitto:
Code:
static INPUT_PORTS_START( poitto )
PORT_START("IN0") //$800000
COINS_SOUND
...
do you see it? last for is importing "COINS", but poitto is importing "COINS_SOUND"... WTF is coins_sound?
COINS:
Code:
#define COINS \
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_SERVICE1 ) \
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_TILT ) \
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) \
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2) \
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_START1 ) \
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 ) \
PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNKNOWN ) \
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN )
COINS_SOUND:
Code:
#define COINS_SOUND \
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_SERVICE1 ) \
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_TILT ) \
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) \
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2) \
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_START1 ) \
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START2 ) \
PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNKNOWN ) \
PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(metro_upd7810_state::custom_soundstatus_r)) /* From Sound CPU */
those mother f-ers burred the sound-status read inside the same call as the coin and start switches
I'm convinced this is the problem that's keeping the game from booting. I don't know how to patch it out yet, there are 12 different read calls to this address and I'll have to analyze the code for each one of them to determine what it's doing with the data after the read and then handle it appropriately.
Even after I get past this there is some annoying patching required to get controls working since they're not just different addresses but also arranged differently.