Page 1 of 1

Cheat_file option problem on 0.106u3

Posted: Fri Jun 02, 2006 4:52 pm
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.

Posted: Sat Jun 03, 2006 8:39 pm
by ianpatt
Confirmed, fix coming in a few minutes.

Posted: Sat Jun 03, 2006 8:56 pm
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;

Posted: Mon Jun 05, 2006 5:02 pm
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.