xboxscene.org forums

Pages: 1 [2] 3

Author Topic: Questions & Discussion Of Mame Compile Notes & Tutorials  (Read 639 times)

ressurectionx

  • Archived User
  • Hero Member
  • *
  • Posts: 2778
Questions & Discussion Of Mame Compile Notes & Tutorials
« Reply #15 on: March 31, 2008, 10:24:00 PM »

Man.... I think I really hosed something up messing with that code.  I still can't get any graphics to show up.  

I replaced the edited file with the original from the backup source, rebuilt and dumped a new version of MAME and it's still a black screen.  

Logged

ressurectionx

  • Archived User
  • Hero Member
  • *
  • Posts: 2778
Questions & Discussion Of Mame Compile Notes & Tutorials
« Reply #16 on: March 31, 2008, 11:28:00 PM »

Fixed it... had to clean and rebuild the entire solution.  Whoops..... unsure.gif

Think I won't be messing around with those again for a while unless somebody knows exactly how to make this fix.
Logged

ressurectionx

  • Archived User
  • Hero Member
  • *
  • Posts: 2778
Questions & Discussion Of Mame Compile Notes & Tutorials
« Reply #17 on: April 01, 2008, 12:31:00 PM »

The game didn't actually crap out.  None of them showed anything on the screen, but there were noises, like you could hear when I inserted a coin.  Whatever I removed, it was critical to the Direct Draw.   Not sure what it was....

Maybe I'll see what happens if I just comment out the code you tried.

Any idea how to make two player alternating games startup automatically in cocktail mode?




Some good news on my front.... I fixed some games, one of them was in particular a real bitch.  I'll post the fixes in the other thread when I get a chance, but the games are:

Analog tweak, fixes (These games play 1000 times better when set at the right levels:
720
Arcade Classics - You're not going to believe the difference in code here. This one didn't work right at all before I got to it.  I can't believe I ever figured this one out.
Ataxx
Bad Lands
Championship Sprint
Inferno
Super Sprint

Still working on "Hydra" but I don't really have a clue what to do with that one.

And I also changed a bunch of games to jump with the A button and attack with the X.  That's going to be my standard for all games.  There was also another game that was 3 players and the 2nd and 3rd coin insert buttons were mixed up so I fixed that too.  Can't remember which one that was now though.

Other fixes were making the names look nice in the GUI on a source level and deleting clone code.

Have only gone up through about half the letter B in the driver.c files.   This is going to take forever.

Later,
~Rx
Logged

ekszbox

  • Archived User
  • Full Member
  • *
  • Posts: 100
Questions & Discussion Of Mame Compile Notes & Tutorials
« Reply #18 on: April 02, 2008, 12:08:00 PM »

Actually cleaner would be if you tackle the root i.e. trace these variables: flip_screen_x flip_screen_y in the src file i mentioned, and see where they lead.
Logged

ressurectionx

  • Archived User
  • Hero Member
  • *
  • Posts: 2778
Questions & Discussion Of Mame Compile Notes & Tutorials
« Reply #19 on: April 02, 2008, 11:13:00 PM »

Thanks for the tips in the other thread ekszbox.  I really like the one about the folders, because when I was testing my build and I had Arcades and MAMEdox on there, it was really hosing everything up.  Eventually I was running my build with the MAMEdox 1.1. GUI instead of Arcades.  I don't have any clue how that happened, but it was pissing me off and I'm sure it had something to do with the save data.  This should avoid any problems in the future and also allow somebody to have this emu and Arcades/CoinOPS on their box at the same time without conflicts when the build is complete.

Two things....

1)  Sorry.  I think I confused you with all my talking about the cocktail.  I don't want any games to be flipped, ever.  This build is not in mind for anybody who is going to use a cocktail table.  Since we're using a TV screen/upright arcade there should be no screen flipping period.  

What I wanted to happen by default though is that all games start in Cocktail mode instead of Upright under the UI options for Cabinet.  After screen flipping is completely disabled, with most of the 2 player alternating games the control would still go from the first player controler to the second player controller when you died, but the screen would stay right side up.  

Unfortunately, this fix won't work on all games though.  I've tried Cocktail mode on Black Tiger and the screen didn't flip and the controller didn't switch.  It will work on a lot of the older games like Pacman and Galaga however.  It might be possible to get it to work on Black Tiger if I put the code IPF_COCKTAIL in the input code.  I don't know, I just thought of it now.

This will not negatively impact games which do not require cocktail to flip control to the second input, such as TMNT, The Simpsons, Street Fighter II, etc.  They will work the same in cocktail or upright mode (at least the ones that I've tested so far.

So to wrap up, what I'm looking to do:
a) Permanantly disable screen flipping.
B) Autostart all games in Cocktail mode instead of Upright.



2)  So far I've eliminated 2MB of code from the drivers section and I've gotten through the letter C.  This may not do much to make performance better in games, but do you think there's a chance that with all the free memory that there might be more games to make playable that were running out of memory before?  Some games that are 80MB are out of the question already, but there might be quite a few who were just on the verge of running but just ran shy of available memory.

I have already noticed a small decrease in time between builds as well.



~Rx
Logged

ressurectionx

  • Archived User
  • Hero Member
  • *
  • Posts: 2778
Questions & Discussion Of Mame Compile Notes & Tutorials
« Reply #20 on: April 03, 2008, 07:32:00 AM »

I made a mistake.  Cocktail mode does work for Black Tiger.  And the IPF_COCKTAIL was already included in the imports.  I forgot you have to restart the rom.  I'm assuming that's why it works now with no effort on my part.

Once we figure out how to disable flipping and autostart games in cocktail mode, we will be able to use two controllers for all the 2 player alternating games.
Logged

ressurectionx

  • Archived User
  • Hero Member
  • *
  • Posts: 2778
Questions & Discussion Of Mame Compile Notes & Tutorials
« Reply #21 on: April 07, 2008, 08:11:00 AM »

Hey ekszbox,

It took me about 3 or 4 hours of playing around with it, and I managed to disable screenflipping.  Thanks for the tips.... that sure wasn't easy, but I figured out a bit about C++ structure, so future tinkering will be that much easier.

Awesome....  now the 2 player alternating games work perfect once you manually switch them to cocktail mode.  

Did you have any ideas about making cocktail mode default?  



BTW... I have gotten through the letter L in re-coding.  I've changed my mind about a few things though, so I will have to do some backtracking, particularly through the letters A to C.  I think I'm going to leave the US rom, and also the parent rom if it isn't the US rom.  This will give the end result a little leeway if people would rather play the parent than the US rom.  (Plus editing out the parent is a real pain anyways.)

So far my build is 4MB smaller than it was with no impact on the good roms.

Talk to you later,
~Rx

EDIT:  Too early to celebrate.  This change has left some roms with a black screen... Only Blades of Steel so far, but I'm willing to bet that more are effected if I tried them out.   Hmmmm... Wonder what caused that.
Logged

ressurectionx

  • Archived User
  • Hero Member
  • *
  • Posts: 2778
Questions & Discussion Of Mame Compile Notes & Tutorials
« Reply #22 on: April 07, 2008, 10:47:00 PM »

Alright... I got the blank screen thing fixed now.... no worries.

It's the weirdest thing. Here I was celebrating that the flip screen thing works, but it doesn't really.  Here's where we're at:

Black Tiger plays 2 player alternating perfect.  (No screen flip)

2/3/4 player simultaneous games seem to work fine with cocktail mode on, but more testing will need to be done.

Berzerk and Pyros still flip the screen upside down as if I haven't changed any code.

1942 is the wierdest.  Screen itself doesn't flip over, just the action.  You still take off from the aircraft carrier and the carrier goes from the top of the screen to the bottom, but your plane is at the top of the screen and the enemies come from the bottom of the screen (as if the action did flip over for cocktail mode).  Kinda weird watching your plane fly backwards and shoot towards the bottom of the screen.

So, I think I just got lucky and the first game I chose worked perfect with the settings I have now.  I've messed around with it here and there and haven't managed to do anything else but make games get black screens.  

Would you like a copy of what I have now to see for yourself where it is?  Nothing too exciting at this point, but there is about a 4MB reduction in code so far (My builds take about 5 minutes now from when it starts generating code, down from about 7 or 8 minutes).

Let me know,
~Rx
Logged

ressurectionx

  • Archived User
  • Hero Member
  • *
  • Posts: 2778
Questions & Discussion Of Mame Compile Notes & Tutorials
« Reply #23 on: April 08, 2008, 11:40:00 AM »

QUOTE

file: vidhrdw\generic.c
functions: void flip_screen_x_set(int on), void flip_screen_y_set(int on)

I commented out these, which caused flipping to no longer work on cps1 games, if set in ingame options menu:

if (flip_screen_x != on)
{
set_vh_global_attribute(&flip_screen_x,on);
updateflip();
}

if (flip_screen_y != on)
{
set_vh_global_attribute(&flip_screen_y,on);
updateflip();
}


So... I'm going to try to figure out what I did to screw up the screen stretching on games like Contra, but I was wondering if you have any ideas how to disable flipping on games such as Berzerk and Pyros.  Looks like just editing out that code above fixed a bunch of them, but there is something missing still.

Later,
~Rx
Logged

ekszbox

  • Archived User
  • Full Member
  • *
  • Posts: 100
Questions & Discussion Of Mame Compile Notes & Tutorials
« Reply #24 on: April 09, 2008, 03:47:00 PM »


[driver.h]:

#define   ROT0   0
#define   ROT90   (ORIENTATION_SWAP_XY|ORIENTATION_FLIP_X)   /* rotate clockwise 90 degrees */
#define   ROT180   (ORIENTATION_FLIP_X|ORIENTATION_FLIP_Y)      /* rotate 180 degrees */
#define   ROT270   (ORIENTATION_SWAP_XY|ORIENTATION_FLIP_Y)   /* rotate counter-clockwise 90 degrees */


[1942.c]

GAME( 1984, 1942,  0,    1942, 1942, 0, ROT270, "Capcom", "1942 (set 1)" )


Maybe an easy fix, would be to change the defines in driver.h: i.e. #define ROT270 0
Don't know if that will mess anything up, but try it out.
The flipping in mameox is seperate to the flipping that's done in mame it seems.

Logged

ressurectionx

  • Archived User
  • Hero Member
  • *
  • Posts: 2778
Questions & Discussion Of Mame Compile Notes & Tutorials
« Reply #25 on: April 09, 2008, 09:21:00 PM »

Hey ekszbox,

I fixed the screen problem on Contra by starting from scratch in the MAMEox/MAMEox launcher code.  I had notes on what I changed that I wanted to keep, so it was no big deal.   I also figured out on accident how to stretch games like Contra to fullscreen (Not sure if I like that though, but it's easy enough to remove if I want to).  

Some more weird news...

I played Bagman after doing the fix above that worked for Black Tiger and 1942 and it keeps the screen from flipping in cocktail on player 2's turn.  The only problem is that they're both upside down.  GRRRRRRRRRR

This is really starting to get on my nerves.  Obviously that's not the place to fix it that I'm looking for.  There has to be a place (I'm assuming in the MAME project) that controls this globally.  I'll give your fix a try when I get some more time and see what happens.



I'm also working on manipulating the GUI now.  Haven't made much progress on that front yet.  All I can do at this point is change the text on the titlebar. (For some reason the GUI that I had from Arcades over  BPs source had the "sort by" categories named incorrectly, so I renamed them (eg. Sort by year actually sorted by category.  For some reason, it only allows me 5 different sort modes.  They are sort by Name, Category, Year, Number of Players, and a 5th sort mode which I can't figure out for the life of me what it is.  (I'm assuming it's either sort by Rom Status or Parent Rom.  I'd like to remove this 5th category and replace it with the ability to sort by Manufacturer.  Those would be the 5 I'd use because I really can't see the use in the other sort categories.  Plus I'm cleaning up the Manufacturer names in the source so sort by Manufacturer will actually be pretty useful.  Ex, changed Data East USA and Data East Corporation all to just Data East.... Changed all Atari's to just Atari, etc.

BP also had something in Arcades that I liked on his GUI.  When you were sorting by category, it actually listed the category in the titlebar.  The way it works now, the only time you can see what category you're sorting by is if you're in simple list view (the one with the screenshots).  I'm sure I have to use one variable or another that points to the category in the catver.ini file and display it in the titlebar, but anything I've tried so far has either led to compile errors or didn't change the titlebar at all.

Oh... and even though my .xbe is down 5MB to just over 35MB now, it doesn't really even free up memory for games like the Xmen vs capcom game.  There has been a slight change, but nothing drastic, and surely nothing that would get a game like this to work without VMM.  Like BP said, figuring out how to manipulate the VMM to autostart on certain games at certain settings will be much more effective.  I'm sure it's an easy fix, but I'm going to have to re-compile a billion times doing trial and error unless I can get BP to give me his source so I can compare the differences.

Take it easy,
~Rx
Logged

ressurectionx

  • Archived User
  • Hero Member
  • *
  • Posts: 2778
Questions & Discussion Of Mame Compile Notes & Tutorials
« Reply #26 on: April 09, 2008, 11:45:00 PM »

QUOTE
 181      PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )      PORT_DIPLOCATION("SWA:5")
  182      PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  183      PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )


to this:

QUOTE
 181      PORT_DIPNAME( 0x08, 0x08, DEF_STR( Cabinet ) )      PORT_DIPLOCATION("SWA:5")
  182      PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  183      PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )


I figured that out because of the notes in the wiki on Dipswitch settings

QUOTE
PORT_DIPNAME is used to declare the name of the setting (what it does), which port bits it uses and what the default setting is. It follows the format

PORT_DIPNAME( dip_value, default_position, name )





The only drawback to this is that not every single 2player alternating game has a dipswitch for cabinet.  I've only noticed that for about 2 games so far and they're so old and lame that nobody would play them anyways probably, so it shouldn't be a big deal.  Besides, even if we could globally force it, the fix may not work on those games anyhow because of the lack of dipswitches for cabinet.
Logged

ekszbox

  • Archived User
  • Full Member
  • *
  • Posts: 100
Questions & Discussion Of Mame Compile Notes & Tutorials
« Reply #27 on: February 03, 2020, 09:45:00 AM »

In that case you could try flipping the flipped screen in the mameox directx rendering src, so it's upright, i.e.

CODE

if (Machine->orientation != ROT0)
{
  if (Machine->orientation == ROT90){
  // Rotate 90 degrees anticlockwise
  }
  else if (Machine->orientation == ROT180){
  // Rotate 180 degrees
  }
  else if (Machine->orientation == ROT270){
  // Rotate 90 degrees clockwise
  }
}


If you look at the rendering code you will see the parts that deal with flipping, just recycle them into your own re-flipping function.






Logged

ressurectionx

  • Archived User
  • Hero Member
  • *
  • Posts: 2778
Questions & Discussion Of Mame Compile Notes & Tutorials
« Reply #28 on: April 10, 2008, 09:31:00 PM »

If you're saying to do that to fix Bagman's problem, wouldn't it flip Bagman the right way but put all the games already working properly upside down?

Not sure what you mean here ekszbox.
Logged

ressurectionx

  • Archived User
  • Hero Member
  • *
  • Posts: 2778
Questions & Discussion Of Mame Compile Notes & Tutorials
« Reply #29 on: April 11, 2008, 07:24:00 PM »

Oh okay... gotcha.

I'll give it a shot on Sunday and let you know how it goes.  If I get this all working, let me know if you want the source and I'll host it up on rapidshare or something.  I plan on finishing the code purge, namechanges, manufacturer/year cleanup, and setting 2player alternating games to cocktail on default by Wednesday hopefully.  

Thanks again,
~Rx
Logged
Pages: 1 [2] 3