Page 1 of 1

Incomplete working Pre-Enable in the latest MAME

Posted: Sat Apr 22, 2006 5:35 pm
by ShimaPong
In vulcan / gradius2, RAM/ROM check is done even if you set "Skip RAM/ROM Check" together with Pre-Enable. Off course, the game fails to boot due to the ROM error and CPU resets the game. Check the disassemble when the debugger wakes up at the beginning, you will confirm that Pre-Enable doesn't work in this time. But it passes "2nd" test and succeeds in booting because Pre-Enable works at last.

This problem doesn't happen in 0.101.

Posted: Sun Apr 23, 2006 2:14 am
by ShimaPong
I have confirmed that the above problem has happened on 0.104u3 or later. Do you remember broken cheat system temporalily in this version ? I said about other potential problems at that time. Yes, it exactlly exists.

Anyway, I have added the comment "It's better to use together with Pre-Enable" to many "Skip RAM/ROM Check" codes. But the latest comment is "Don't use together with Pre-Enable". In athena, CPU never resets the game if the ROM error so that you need to reset the game by yourself (press F3).

Posted: Tue Apr 25, 2006 2:42 am
by ianpatt
I could see something like this being caused when Aaron moved the cheat application timer. It doesn't look like it currently is called at the beginning of the first frame, and the CPU may pass the code you're patching before the game reaches the end of the frame and the cheat is applied.

Try changing:

Code: Select all

timer_adjust(periodic_timer, TIME_IN_HZ(Machine->refresh_rate), 0, TIME_IN_HZ(Machine->refresh_rate));
at line 1794 of cheat.c to

Code: Select all

timer_adjust(periodic_timer, 0, 0, TIME_IN_HZ(Machine->refresh_rate));
That should make it fire at the beginning of the first frame like it did before.

Posted: Fri Apr 28, 2006 3:25 pm
by ShimaPong
Thanks.
I confirmed that this problem went away with your modification.

Posted: Fri Apr 28, 2006 7:21 pm
by ianpatt
Cool, I'll add the change. Sorry I didn't think about that when I fixed the first issue.