libretro / mame2003-plus-libretro

Updated 2018 version of MAME (0.78) for libretro. with added game support plus many fixes and improvements
Other
190 stars 109 forks source link

Tatsumi WIP #1527

Closed arcadez2003 closed 1 year ago

arcadez2003 commented 1 year ago

I'll put this here for safe keeping.... WIP.zip

As things stand

Big Fight - Big Trouble In The Atlantic Ocean = playable Cycle Warriors = playable Round Up 5 - Super Delta Force = crashes on boot might be xbox lack of mem or something else

MistyDreams commented 1 year ago

can check if its crashing on the pc if you like. I dont want to intrude on your wip unless you want an extra set of eyes on it

MistyDreams commented 1 year ago

The problem is your getting a divide by zero for input related code.

big fights is playable need to make roms for cycle warriors round up 5 is the divide by input zero issue

if you temp change

PORT_ANALOG( 0xff, 0x7f, IPT_AD_STICK_X | IPF_PLAYER1, 0, 0xff, 25, 15) to 
PORT_ANALOG( 0xff, 0x7f, IPT_AD_STICK_X | IPF_PLAYER1, 1, 0xff, 25, 15) 

it should get passed that issue till the analog is looked at. not sure what version your back porting from though

arcadez2003 commented 1 year ago

Aye been trying all day with Round Up 5 checking the machine / video and mem maps i was looking at some P2 inputs that i'd worked around for now, so you say it's the analog inputs i did rush those i should have maybe took more care with it.

Thanks for the headsup

TBH both Round Up 5 and Cycle Warriors are not really fully working to to emulation issues, they function right enough and are playable for the most part hence i wanted to include em to make the code go further i originally just had a single game Big Fight in the driver.

Big Fight was the main target here that one is a decent game and apart from a few GFX niggles it's working fine, i just need to test some sound fixes i've added from later MAME before everything is ready to be included here.

Basically im having one last go at getting games to work that beat me earlier in my dev dabbling, i'd failed a good few times with this one previously, and in the end the key to getting the game past a black screen on boot so i could test the GFX was to hack the CPU loading for both Big Fight and the DRIVER_INIT for the GFX cluts etc etc.

A totall guess a hunch more or less i would never have thought to check that 7 years back anyway all is well that ends well tecmosys.c is gonna be next on the list hopefully i can pull it off :)

arcadez2003 commented 1 year ago

MAME 89 for tatsumi then backported these changes which added the BG's for Big Fight and Cycle Warriors.... https://github.com/arcadez2003/mame/commit/59c960b061ac51de73736a2209d225f1275c04c9#

The games are not perfect GFX wise especially Cycle Warriors but the one i wanted is fine for the most part there are some fixes in later MAME but the code does not look easy to backport so i just added the sound fixes for now.

What speeds are you getting.?? unfortunately im only at 20fps for Big Fight dropping to 10fps on occassion no surprising as Tatsumi HW is really comples and the game is throwing 4 tile layers around i've dropped the CPU interleave down to 100 which improves things slightly.

Im not too fussed about Round Up 5 but it does boot now allbeit it then stalls with the following message....

Hardware BAD 35 PCM Busy Is 1 From Init

arcadez2003 commented 1 year ago

These are the inputs as per MAME89

INPUT_PORTS_START( roundup5 ) PORT_START PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("Accelerator") PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("Brake") PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("Shift") PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_NAME("Turbo") PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )

PORT_START
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME( DEF_STR( Service_Mode )) PORT_CODE(KEYCODE_F2)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME(DEF_STR(Free_Play)) PORT_TOGGLE
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("Extra 2") PORT_TOGGLE
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME("Extra 3") PORT_TOGGLE
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_NAME("Extra 4") PORT_TOGGLE

PORT_START
PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_X ) PORT_MINMAX(0,0xff) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1)

PORT_START
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
PORT_DIPSETTING(    0x01, DEF_STR( On ) )
PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
PORT_DIPSETTING(    0x02, DEF_STR( On ) )
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
PORT_DIPSETTING(    0x04, DEF_STR( On ) )
PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
PORT_DIPSETTING(    0x08, DEF_STR( On ) )
PORT_DIPNAME( 0x10, 0x00, DEF_STR( Demo_Sounds ) )
PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
PORT_DIPSETTING(    0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x20, 0x00, DEF_STR( Language ) )
PORT_DIPSETTING(    0x20, DEF_STR( Japanese ) )
PORT_DIPSETTING(    0x00, DEF_STR( English ) )
PORT_DIPNAME( 0x40, 0x00, "Stage 5 Continue" )
PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
PORT_DIPSETTING(    0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x80, 0x00, "Output Mode" )
PORT_DIPSETTING(    0x00, "A" )
PORT_DIPSETTING(    0x80, "B" )

PORT_START
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
PORT_DIPSETTING(    0x01, DEF_STR( On ) )
PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
PORT_DIPSETTING(    0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
PORT_DIPSETTING(    0x04, DEF_STR( On ) )
PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
PORT_DIPSETTING(    0x08, DEF_STR( On ) )
PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
PORT_DIPSETTING(    0x10, DEF_STR( On ) )
PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
PORT_DIPSETTING(    0x20, DEF_STR( On ) )
PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
PORT_DIPSETTING(    0x40, DEF_STR( On ) )
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Test ) )
PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
PORT_DIPSETTING(    0x00, DEF_STR( On ) )

INPUT_PORTS_END

MistyDreams commented 1 year ago

is the analog port in the right place in the memory map?

arcadez2003 commented 1 year ago

is the analog port in the right place in the memory map?

I think so as the mem maps were already split so all i had to do was just mod em slightly

MistyDreams commented 1 year ago

well the crash happens here in the core.

https://github.com/libretro/mame2003-plus-libretro/blob/a3c987880c4342a0ca3b9a03340ed97defa4d387/src/inptport.c#L1332

arcadez2003 commented 1 year ago

I think i know what the problem is i forgot to reverse the values silly me it should be

PORT_ANALOG( 0xff, 0x7f, IPT_AD_STICK_X | IPF_PLAYER1, 25, 15, 0, 0xff)

MistyDreams commented 1 year ago

define PORT_ANALOG(mask,default,type,sensitivity,delta,min,max) \

gotcha had to look at it there at least thats one mystery solved!

arcadez2003 commented 1 year ago

Still getting that message at the exact point the game should start up i'll come back to this later

MistyDreams commented 1 year ago

hold on a sec ill try a quick debug

arcadez2003 commented 1 year ago

When it boots if you then ingame reset you'll get further address errors which might be of some hlep i wanna get on and test the sound with the further fixes i backported to see if it's better for Big Fight as it was for voices clipping out too early in Cycle Warriors but it might help Big Fight in that dept also hence i need to test.

MistyDreams commented 1 year ago

there is no music and the volume is a tad low for the car noises the test failure seems to be internal there is no memory leaks or anything.

The game does drive no issues unless you do reset. I had issues with resetting the fd1089 in our core driver init is only called once before machine init so youd be best changing that auto malloc in there to malloc as it will be freed on game reset.

arcadez2003 commented 1 year ago

Well it boots for me now i had the OKIM6295 set up for just Big Fight adding another one with the original clock speed from MAME89 hooked up for Cycle Warriors and Round Up 5 seems to sort the problems

MistyDreams commented 1 year ago

all that changed is the input fix you done and i changed the comments for this core which is pain but i was told its c89 we work with. So should save you the hassle of doing it. If you need any more input let me know happy to test.

wip.zip

arcadez2003 commented 1 year ago

Well what can say bigman it didn't boot then i made the clock change and thought i'd try it and now it boots i can always revert the OKIM clock and see if it stalls again then we'll know either way :)

static struct OKIM6295interface okim6295_interface = { 1, { 16000000/4/132 }, / Frequency / // ? { REGION_SOUND1 }, { 75 } };

static struct OKIM6295interface cyclwarr_okim6295_interface = { 1, { 16000000/8/132 }, / Frequency / // ? { REGION_SOUND1 }, { 75 } };

static struct OKIM6295interface bigfight_okim6295_interface = { 1, { 16000000/8/2/132 }, / Frequency / // ? { REGION_SOUND1 }, { 75 } };

MistyDreams commented 1 year ago

its does boot here to be fair just complains if you reset.

arcadez2003 commented 1 year ago

Actually should be for Round Up 5

static struct OKIM6295interface okim6295_interface = { 1, { 16000000/4/2/132 }, / Frequency / // ? { REGION_SOUND1 }, { 75 } };

arcadez2003 commented 1 year ago

its does boot here to be fair just complains if you reset.

Right im gonna change the clock back to see if it stalls again my end although it might just have been i didn't remove my old cfg saves after the analog change and it's now overwritten with the new handling hence it boots

arcadez2003 commented 1 year ago

Aye it boots either way it must have been connected to my cfg saves as to why it didn't boot after i made the changes to the analog inputs but hey ho at least it's working now, maybe i should add Apache 3 although the GFX will be more messed up in that one.

However there is a fix which might improve things circa MAME129

MistyDreams commented 1 year ago

Thats was a little demon input alright! Nice to see it panned out was a fair bit of work you done there!

arcadez2003 commented 1 year ago

Thats was a little demon input alright! Nice to see it panned out was a fair bit of work you done there!

No pain no gain :) more to come gonna fill out the dips for Round Up 5 then look at adding Apache 3 and backporting some more video fixes for it from MAME129 i guess Tecmosys.c will need to wait for now

arcadez2003 commented 1 year ago

Hardware BAD 35 PCM Busy Is 1 From Init

Actually this was caused by me forgetting to update the mem map as round up 5 doesn't like the newer sound hack anyway no harm done in the end :)

MistyDreams commented 1 year ago

sounds like your making progress. Im having a lazy weekend could do with a week off work and am just back.

arcadez2003 commented 1 year ago

@MistyDreams @mahoneyt944 Can one of ya's add the Tatsumi games.?? as im busy trying to convert tecmosys.c for use in this core, if ya's are too busy then no worries i'll get around to add these at some point soonish. WIP.zip

MistyDreams commented 1 year ago

ill fix it for you just need to fix the comments