Cheat_file option problem on 0.106u3

If you are having problems finding or using cheats for an Emulator (particularly MAME/MESS) or have found a trick that you wish to share this is the place to do it. But please read the Cheat FAQ first.
Post Reply
ShimaPong
Posts: 1063
Joined: Wed May 21, 2003 4:19 pm
Location: Japan

Cheat_file option problem on 0.106u3

Post by ShimaPong »

On 0.106u3, you can't choose a file except "cheat.dat". Because "-cheat_file" option always picks up "cheat.dat" only and other filenames are ignored.

For example :
  1. Put cheat.dat, cheat2.dat and cheat3.dat in the same MAME directory.
  2. Start with "mame -cheat_file cheat2.dat;cheat3.dat".
  3. MAME never loads cheat2.dat and cheat3.dat but cheat.dat is loaded instead.
I have already posted the above problem to MAME Testers.
My cheat database is using other filename. So it's very serious issue for me.
User avatar
ianpatt
Posts: 336
Joined: Sat Sep 22, 2001 1:00 am
Location: San Francisco, CA

Post by ianpatt »

Confirmed, fix coming in a few minutes.
User avatar
ianpatt
Posts: 336
Joined: Sat Sep 22, 2001 1:00 am
Location: San Francisco, CA

Post by ianpatt »

Replace the beginning of LoadCheatDatabase (line 8672) with:

Code: Select all

static void LoadCheatDatabase(void)
{
	char	buf[4096];
	const char	* inTraverse;
	char	* outTraverse;
	char	* mainTraverse;
	int		first = 1;
	char	data;

	inTraverse = options_get_string("cheat_file", 0);
	if(!inTraverse)
		inTraverse = "cheat.dat";

	outTraverse = buf;
	mainTraverse = mainDatabaseName;

	buf[0] = 0;
ShimaPong
Posts: 1063
Joined: Wed May 21, 2003 4:19 pm
Location: Japan

Post by ShimaPong »

Thanks. I confirmed the modified cheat_file option on recompiled MAME 0.106u3.
Though we need to add #include "options.h" into cheat.c.
Post Reply