[25pacman, 20pacgal and its clones] Two problems found

This forum is for posting M.A.M.E. Work In Progress "Arcade"cheats that are not quite ready for the prime time. If the cheats are buggy or the cheat descriptions are non-standard then please post them here. Help maybe given but there are no guarantees and they will only be added to the cheat file when the cheat file maintainer is happy with them.
Post Reply
pacman_fan
Posts: 15
Joined: Tue Jan 04, 2011 3:22 pm

[25pacman, 20pacgal and its clones] Two problems found

Post by pacman_fan »

As you can tell by my username, i am a pacman enthusiast! Getting into the cheat files for pacman games, I found two problems:

1. "Select Starting Level"
2. "Finish this Level Now!"

Problem 1. I dont know why this cheat doesnt work right, since it should be the same as the mspacman config, which does work fine. But in 20pacgal, its clones, and 25pacman - when starting a mspacman game at a higher level there is a problem.

The maze drawn is board 0, reguardless of what was selected. But the ghosts speed, blue times, and actions are correct for that chosen level, the fruit also follows a path of that chocen level - its just the board doesnt match...until you die, then it changes and the dots are messed up. Once that bad board is cleared, all seems to run good.

I don't know how to go about fixing it.

Problem 2. In 20pacgals and its clones, the F4 value used to max out the board dots eaten value is only good for board 0. Which is the first two mazes. Once then maze changes to any of the other 3 boards, that value doesnt cut it anymore.

In use with 25pacman, pacman itself also has a different value for its maze and dot count.

So I came up with this routine that seems to work fine:

Code: Select all

  <cheat desc="Finish this Level Now">
    <script state="on">
      <action condition="maincpu.pb@0430A==E6" >maincpu.pb@44E0E=F4</action> <!-- Pac-Man Board -->
      <action condition="maincpu.pb@0430A==F4" >maincpu.pb@44E0E=E0</action> <!-- Ms. Pac Board 0 -->
      <action condition="maincpu.pb@0430A==EB" >maincpu.pb@44E0E=F4</action> <!-- Ms. Pac Board 1 -->
      <action condition="maincpu.pb@0430A==E9" >maincpu.pb@44E0E=F2</action> <!-- Ms. Pac Board 2 -->
      <action condition="maincpu.pb@0430A==DF" >maincpu.pb@44E0E=EE</action> <!-- Ms. Pac Board 3 -->
    </script>
  </cheat>
pacman_fan
Posts: 15
Joined: Tue Jan 04, 2011 3:22 pm

Re: [25pacman, 20pacgal and its clones] Two problems found

Post by pacman_fan »

Does anyone have any information about how to go and fix the 'starting level' problem I described above???
User avatar
Pugsy
Posts: 3638
Joined: Fri Aug 17, 2001 12:59 am
Location: North Wales, UK.
Has thanked: 1 time
Been thanked: 12 times
Contact:

Re: [25pacman, 20pacgal and its clones] Two problems found

Post by Pugsy »

Thanks for the fix and the report.

I've added the fixed Finish this Level Now! cheat for all Ms Pacman variants.

As for the level select cheats I've removed them completely from the next 0.142 release for all variants. I tried changing the cheat to a ROM cheat (25pacman) and it looked good for a short time - the maze was blue when Orange was selected but then the game just waited and waited, turned the cheat OFF and the maze reverted to the original L1 colour and the game started. I've flagged it in cheat.txt for future investigation, but it's not that important for the time being as the Finish this Level Now! cheat can quickly get you to any level.

I appreciate it's not a real solution and definitely not what you were after but I'm afraid as it's not a relatively quick fix it will have to wait.
Pugsy

Servicing your cheating needs since 1985 8)

Grab the latest cheat collection:
MAME 0.259 XML cheat collection (6 OCTOBER 2023) from http://www.mamecheat.co.uk or direct from:-
https://mega.nz/file/q4dHGZ6K#i-EUiqIjH ... KMz7hnbTfw (ZIP Archive 3.76MB)
pacman_fan
Posts: 15
Joined: Tue Jan 04, 2011 3:22 pm

Re: [25pacman, 20pacgal and its clones] Two problems found

Post by pacman_fan »

Thank you for looking at thes two problems and adding the 'finish level now' fix to the database!

As for the start level problem...I've ask Don Hodges to take a look at the problem.
It is his opinion that the issue is with the mame cheat engine, here is his reply and information to me about it:

------------------------------
Believe it or not, the problem appears to be with the MAME cheat engine itself.

Looking at the cheat XML for 20pacgal, we see the line

<action condition="(param==02) AND (maincpu.pb@44E13==00)">maincpu.pb@44E13=02</action>

From what I can tell, this line says that when the cheat code is set for peach (level 2), whenever the code reads a zero (00) from address 44E13, instead the value returned will bet set to 2 (or is it supposed to write a 2 into that memory location AND return a 2 for the read?).

First, we turn on the cheat for the peach level.

Then, using the debugger, you can set a watchpoint :

wp 44e13,1,r

Whenever it stops, its because this address (the level) was read from.

On each stop when a read is encountered, the register A should be loaded with 2 instead of 0.

This seems to occur OK for the first read. (PC=9593)

However, starting with the 2nd read and the next 8 reads, the cheat engine seems to break down and the value remains at 0, when it should have been set to 2. This explains why the first maze is drawn wrong etc.

I hope this helps. We may want to submit a bug report to mametesters.org. Or to whomever is in charge of the cheat engine.

Yours,
Don Hodges
User avatar
Pugsy
Posts: 3638
Joined: Fri Aug 17, 2001 12:59 am
Location: North Wales, UK.
Has thanked: 1 time
Been thanked: 12 times
Contact:

Re: [25pacman, 20pacgal and its clones] Two problems found

Post by Pugsy »

I know why it happens and it's NOT a bug with the cheat engine. The cheat engine is frame based...ie the cheats only get poked in this game every 1/60 second.

The wp/bp commands in the debugger and the cheat engine are fundamentally different. When you do a wp 44e13,1,r it will stop as soon as 44e13 is read. However the cheat engine will only read/write every frame NOT every instruction so if the a value is written and read within a single frame it will NOT have a chance to overwrite the value before it gets read.

Please do NOT report it as a bug on mametesters
Pugsy

Servicing your cheating needs since 1985 8)

Grab the latest cheat collection:
MAME 0.259 XML cheat collection (6 OCTOBER 2023) from http://www.mamecheat.co.uk or direct from:-
https://mega.nz/file/q4dHGZ6K#i-EUiqIjH ... KMz7hnbTfw (ZIP Archive 3.76MB)
User avatar
Pugsy
Posts: 3638
Joined: Fri Aug 17, 2001 12:59 am
Location: North Wales, UK.
Has thanked: 1 time
Been thanked: 12 times
Contact:

Re: [25pacman, 20pacgal and its clones] Two problems found

Post by Pugsy »

Try this for 20pacgal.

I think it works more or less. Let me know if there are any problems

Code: Select all

  <cheat desc="Select Starting Level"> <comment>For the best effect deactivate this cheat after you've started the Level</comment>
    <parameter>
      <item value="0x01">Strawberry</item>
      <item value="0x02">Orange</item>
      <item value="0x03">Pretzel</item>
      <item value="0x04">Apple</item>
      <item value="0x05">Pear</item>
      <item value="0x06">Banana</item>
      <item value="0x07">Multifruit 1a</item>
      <item value="0x08">Multifruit 1b</item>
      <item value="0x09">Multifruit 2</item>
    </parameter>
    <script state="run">
      <action condition="maincpu.mq@10923==00">maincpu.mq@10923=061FC34E1332023E</action>
      <action condition="maincpu.md@1061C==3A4E1332">maincpu.md@1061C=3A0923C3</action>
      <action condition="maincpu.pb@44E13==00">maincpu.mb@10924=param, maincpu.pb@44E13=param</action>
      <action condition="maincpu.pb@44E0A==68">maincpu.pb@44E0A=param + 0x68</action>
    </script>
    <script state="off">
      <action condition="maincpu.mq@10923==061FC34E1332023E">maincpu.mq@10923=00</action>
      <action condition="maincpu.md@1061C==3A0923C3">maincpu.md@1061C=3A4E1332</action>
    </script>    
  </cheat>
EDIT: Changed "maincpu.pb@44E0A=param + 0x7D" to "maincpu.pb@44E0A=param + 0x68"
Pugsy

Servicing your cheating needs since 1985 8)

Grab the latest cheat collection:
MAME 0.259 XML cheat collection (6 OCTOBER 2023) from http://www.mamecheat.co.uk or direct from:-
https://mega.nz/file/q4dHGZ6K#i-EUiqIjH ... KMz7hnbTfw (ZIP Archive 3.76MB)
pacman_fan
Posts: 15
Joined: Tue Jan 04, 2011 3:22 pm

Re: [25pacman, 20pacgal and its clones] Two problems found

Post by pacman_fan »

Wow - very nice! I've spent the past 1/2 hour testing out the new cheat code.

I have no idea what the new code is doning...but IMO, it's about 95% working.

The code works perfectly for:
- 20pacgal and all its clones
(including the hidden pacman game in these sets)
- 25pacman
- and accomodates the Normal and Hard difficulty settings

The only gitch I found is the 'Blue time" for the ghosts when an energizer is eaten.
For example;
With the NORMAL difficulty, during regular play, the ghosts should stay blue for a short time before they
start flashing 5 times when playing the Orange or Preztel boards.

When using the new cheat code, the ghosts start flashing 5 times immediately, there is no 'blue time'
and the following boards seem to also revert to 5 flashes, no blue time.
User avatar
Pugsy
Posts: 3638
Joined: Fri Aug 17, 2001 12:59 am
Location: North Wales, UK.
Has thanked: 1 time
Been thanked: 12 times
Contact:

Re: [25pacman, 20pacgal and its clones] Two problems found

Post by Pugsy »

I've slightly changed the above so that the last RAM part pokes "param + 0x68" instead of "param + 0x7D". I did a quick check and it seems to fix the blue changeback time.
Pugsy

Servicing your cheating needs since 1985 8)

Grab the latest cheat collection:
MAME 0.259 XML cheat collection (6 OCTOBER 2023) from http://www.mamecheat.co.uk or direct from:-
https://mega.nz/file/q4dHGZ6K#i-EUiqIjH ... KMz7hnbTfw (ZIP Archive 3.76MB)
pacman_fan
Posts: 15
Joined: Tue Jan 04, 2011 3:22 pm

Re: [25pacman, 20pacgal and its clones] Two problems found

Post by pacman_fan »

I just did a quick check myself,

it seems to have no different effect with the 'NORMAL' difficulty settings.

At the 'HARD' difficulty, the ghosts will have some blue time, then the 5 flashes...all the time.
But some boards do in deed only have 5 flashes (1st apple), or 3 flashes in the higher levels.

So something still isnt right with it.
User avatar
Pugsy
Posts: 3638
Joined: Fri Aug 17, 2001 12:59 am
Location: North Wales, UK.
Has thanked: 1 time
Been thanked: 12 times
Contact:

Re: [25pacman, 20pacgal and its clones] Two problems found

Post by Pugsy »

Odd seems ok to me.

Using 20pacgal as an example and using the debugger command:-
wp 44dbd,2,w,pc==710&&maincpu.pb@44dbd!=1

with the skip level cheat I get blue values (in level order) of
2d0
258
1e0
168
0f0
258
0f0

If I start the game with the select level cheat I get the same values
Pugsy

Servicing your cheating needs since 1985 8)

Grab the latest cheat collection:
MAME 0.259 XML cheat collection (6 OCTOBER 2023) from http://www.mamecheat.co.uk or direct from:-
https://mega.nz/file/q4dHGZ6K#i-EUiqIjH ... KMz7hnbTfw (ZIP Archive 3.76MB)
pacman_fan
Posts: 15
Joined: Tue Jan 04, 2011 3:22 pm

Re: [25pacman, 20pacgal and its clones] Two problems found

Post by pacman_fan »

Oh - got it! my bad, it does seem to work.
The addition I just added, to get this 100% is to add an additional line for the 7D value (HARD setting):
(which you can get to using the F2 key)

<script state="run">
<action condition="maincpu.mq@10923==00">maincpu.mq@10923=061FC34E1332023E</action>
<action condition="maincpu.md@1061C==3A4E1332">maincpu.md@1061C=3A0923C3</action>
<action condition="maincpu.pb@44E13==00">maincpu.mb@10924=param, maincpu.pb@44E13=param</action>
<action condition="maincpu.pb@44E0A==68">maincpu.pb@44E0A=param + 0x68</action> <!-- NORMAL Difficulty -->
<action condition="maincpu.pb@44E0A==7D">maincpu.pb@44E0A=param + 0x7D</action> <!-- HARD Difficulty -->
</script>

And It looks Perfect to me!
Thanks a million for looking into the code.
User avatar
Pugsy
Posts: 3638
Joined: Fri Aug 17, 2001 12:59 am
Location: North Wales, UK.
Has thanked: 1 time
Been thanked: 12 times
Contact:

Re: [25pacman, 20pacgal and its clones] Two problems found

Post by Pugsy »

Ok, thanks

It's nice to put it to bed, I've duplicated the cheat for the other mspacman sets (they use different RAM + ROM addresses and need slightly different techniques and some have maze colour issues, mspacmat was a bitch).
Pugsy

Servicing your cheating needs since 1985 8)

Grab the latest cheat collection:
MAME 0.259 XML cheat collection (6 OCTOBER 2023) from http://www.mamecheat.co.uk or direct from:-
https://mega.nz/file/q4dHGZ6K#i-EUiqIjH ... KMz7hnbTfw (ZIP Archive 3.76MB)
pacman_fan
Posts: 15
Joined: Tue Jan 04, 2011 3:22 pm

Re: [25pacman, 20pacgal and its clones] Two problems found

Post by pacman_fan »

This is the code I've personally been using for the other mspacman and sets:
There is an extra check in there for any levels starting too high that can mess up the kill screen boards.

<cheat desc="Select Starting Level">
<comment>For the best effect deactivate this cheat after you've started the Level</comment>
<parameter>
<item value="0x01">Strawberry</item>
<item value="0x02">Orange</item>
<item value="0x03">Pretzel</item>
<item value="0x04">Apple</item>
<item value="0x05">Pear</item>
<item value="0x06">Banana</item>
<item value="0x07">Multifruit 1a</item>
<item value="0x08">Multifruit 1b</item>
<item value="0x09">Multifruit 2</item>
<item value="0x83">Level-132 (Kill Screen Start)</item>
<item value="0x88">Level-136 (Upside Down Maze)</item>
<item value="0xFF">Split-Screen (Unplayable)</item>
</parameter>
<script state="run">
<action condition="maincpu.pb@4E13==00" >maincpu.pb@4E13=param</action>

// Easy Difficulty
<action condition="(maincpu.pb@4E0A==68)" >maincpu.pb@4E0A=param + 0x68</action>
<action condition="(maincpu.pb@4E73==68) AND (maincpu.pb@4E0A >7C)" >maincpu.pb@4E0A=0x7C</action>
<action condition="(maincpu.pb@4E73==68) AND (param >14)" >maincpu.pb@4E0A=0x7C</action>

// Hard Difficulty
<action condition="(maincpu.pb@4E0A==7D)" >maincpu.pb@4E0A=param + 0x7D</action>
<action condition="(maincpu.pb@4E73==7D) AND (maincpu.pb@4E0A >8C)" >maincpu.pb@4E0A=0x8C</action>
<action condition="(maincpu.pb@4E73==7D) AND (param >0F)" >maincpu.pb@4E0A=0x8C</action>
</script>
</cheat>
Post Reply