[hangly]+ Starting Level Cheat Revised to reflect Open maze vs. Maze Levels - UPDATED!

This forum is for posting M.A.M.E. arcade cheats. Requests will be fulfilled here....but please keep the requests to the requests forum.
Post Reply
pac_man_fan2
Posts: 62
Joined: Fri Dec 06, 2019 1:49 pm

[hangly]+ Starting Level Cheat Revised to reflect Open maze vs. Maze Levels - UPDATED!

Post by pac_man_fan2 »

With the hangly man game and clones, the standard Start Level didn't accommodate correct maze/open maze variable. I found it at 4EFF (00 cherry, 01 odd levels w/maze, 02 even levels open maze).

Works for HANGLY, HANGLY2, HANGLY3 and POPEYEMAN.

Here is a patch to fix that, although I'd like a better suggestion on how to calculate an ever or odd Hex variable in the cheat engine, so we don't have to manually slap in each level like I did in the short term.

Code: Select all

  <cheat desc="Select Starting Level - [F1] Progresses Correctly"> <comment>Can Leave Cheat ON or OFF, Game level progresses normally either way. F1 (Rack Test) progresses game normally too. </comment>
    <parameter>
      <item value="0x00">Cherry</item>
      <item value="0x01">Strawberry</item>
      <item value="0x02">1st Orange</item>
      <item value="0x03">2nd Orange</item>
      <item value="0x04">1st Apple</item>
      <item value="0x05">2nd Apple</item>
      <item value="0x06">1st Pineapple</item>
      <item value="0x07">2nd Pineapple</item>
      <item value="0x08">1st Galaxian</item>
      <item value="0x09">2nd Galaxian</item>
      <item value="0x0A">1st Bell</item>
      <item value="0x0B">2nd Bell</item>
      <item value="0x0C">1st Key</item>
      <item value="0x0D">2nd Key</item>
      <item value="0x0E">3rd Key</item>
      <item value="0x0F">4th Key</item>
      <item value="0x10">5th Key</item>
      <item value="0x11">6th Key</item>
      <item value="0x12">7th Key</item>
      <item value="0x13">8th Key</item>
      <item value="0x14">9th Key</item>
      <item value="0xFE">Level 254: Level 254</item>
      <item value="0xFF">Level 255: Split Screen (Unfinishable)</item>
    </parameter>
    <script state="run">
<!-- MAZE Level -->
      <action condition="(maincpu.pb@4E13==00)"> maincpu.pb@4E13=param</action>

<!-- NORMAL Ghost Difficulty -->
      <action condition="(maincpu.pb@4E13==param) AND (maincpu.pb@4E73==68)"> maincpu.pb@4E0A=0x68 + param</action>
      <action condition="(maincpu.pb@4E13==param) AND (maincpu.pb@4E73==68) AND (maincpu.pb@4E0A LT 0x68)"> maincpu.pb@4E0A=7C</action>
      <action condition="(maincpu.pb@4E13==param) AND (maincpu.pb@4E73==68) AND (maincpu.pb@4E0A GT 0x7C)"> maincpu.pb@4E0A=7C</action>
<!-- HARD Ghost Difficulty -->
      <action condition="(maincpu.pb@4E13==param) AND (maincpu.pb@4E73==7D)"> maincpu.pb@4E0A=0x7D + param</action>
      <action condition="(maincpu.pb@4E13==param) AND (maincpu.pb@4E73==7D) AND (maincpu.pb@4E0A LT 0x7D)"> maincpu.pb@4E0A=8C</action>
      <action condition="(maincpu.pb@4E13==param) AND (maincpu.pb@4E73==7D) AND (maincpu.pb@4E0A GT 0x8C)"> maincpu.pb@4E0A=8C</action>

<!-- Remove "PLAYER ONE" text at start, otherwise letters overwrite 2 dots above ghost box and Maze is unfinishable, if starting on Ooen Maze  -->
      <action> maincpu.rb@3741=8C</action>
      <action> maincpu.rq@3742=45</action>

<!-- Hangly: Maze toggles from Maze (Odd levels) to Open Maze (Even levels), execpt for level 00 -->
<!-- Glitches in Hangly and Hangly2 don't run the disappearing maze on Odd levels properly, after a death and/or after player 2 -->

<!-- ODD Levels: Maze, DISAPPEARS when energizer is eaten -->
<!-- EVEN Levels: Maze, OPEN -->
      <action>temp1=(maincpu.pb@4E13 div 2)</action>
      <action>temp2=((maincpu.pb@4E13 +1) div 2)</action>
      <action condition="(maincpu.pb@4E09==0x00) AND (temp1 != temp2)"> maincpu.pb@4EFF=01</action>  <!-- Odd Level  / 1st Player -->
      <action condition="(maincpu.pb@4E09==0x00) AND (temp1 == temp2)"> maincpu.pb@4EFF=02</action>  <!-- Even Level / 1st Player -->
      <action condition="(maincpu.pb@4E09==0x01) AND (temp1 != temp2)"> maincpu.pb@4EFE=01</action>  <!-- Odd Level  / 2nd Player -->
      <action condition="(maincpu.pb@4E09==0x01) AND (temp1 == temp2)"> maincpu.pb@4EFE=02</action>  <!-- Even Level / 2nd Player -->
<!-- 00 Level: Maze, Does NOT Disappear when energizer is eaten -->
      <action condition="(maincpu.pb@4E13==0x00)"> maincpu.pb@4EFF=00</action>  <!-- 00 Level / 1st Player -->
      <action condition="(maincpu.pb@4E13==0x00)"> maincpu.pb@4EFE=00</action>  <!-- 00 Level / 2nd Player -->
    </script>
    <script state="off">
      <!-- Dont reset anything, Keeps current level info and lets the game increment normally -->
    </script>
  </cheat>
Last edited by pac_man_fan2 on Sat Jan 25, 2020 1:14 am, edited 3 times in total.
pac_man_fan2
Posts: 62
Joined: Fri Dec 06, 2019 1:49 pm

Re: [hangly]+ Starting Level Cheat Revised to reflect Open maze vs. Maze Levels - UPDATED!

Post by pac_man_fan2 »

I am happy to have figured out a simple routine to check for an ODD or EVEN level number, saving tons of code, and expanding the levels to operate correctly all through 255! A nice feature of this cheat, is using F1 to end the level will change the open/maze conditions properly. I added the Cherry level to start also, to take full advantage of that if someone wanted to.
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: [hangly]+ Starting Level Cheat Revised to reflect Open maze vs. Maze Levels - UPDATED!

Post by Pugsy »

pac_man_fan2 wrote: Fri Jan 24, 2020 5:13 pm I'd like a better suggestion on how to calculate an ever or odd Hex variable in the cheat engine, so we don't have to manually slap in each level like I did in the short term.
You would use the modulo function instead of divide to return the remainder. There's also some scope to simply some of the expressions by using word writes, i don't know why your where using a maincpu.rq/rb either. Something simular to this should work, not tested it though.

Code: Select all

    <script state="run">
      <action condition="(maincpu.pb@4E13==00)">maincpu.pb@4E13=param</action>
      <action condition="(maincpu.pb@4E13==param) AND (maincpu.pb@4E73==68)">maincpu.pb@4E0A=0x68 + param</action>
      <action condition="(maincpu.pb@4E13==param) AND (maincpu.pb@4E73==68) AND (maincpu.pb@4E0A LT 0x68)">maincpu.pb@4E0A=7C</action>
      <action condition="(maincpu.pb@4E13==param) AND (maincpu.pb@4E73==68) AND (maincpu.pb@4E0A GT 0x7C)">maincpu.pb@4E0A=7C</action>
      <action condition="(maincpu.pb@4E13==param) AND (maincpu.pb@4E73==7D)">maincpu.pb@4E0A=0x7D + param</action>
      <action condition="(maincpu.pb@4E13==param) AND (maincpu.pb@4E73==7D) AND (maincpu.pb@4E0A LT 0x7D)">maincpu.pb@4E0A=8C</action>
      <action condition="(maincpu.pb@4E13==param) AND (maincpu.pb@4E73==7D) AND (maincpu.pb@4E0A GT 0x8C)">maincpu.pb@4E0A=8C</action>
      <action>maincpu.mw@3741=458C</action>
      <action condition="(maincpu.pb@4E09 LE 0x01) AND (maincpu.pb@4E13 mod 2)==01">maincpu.pw@4EFE=0101</action>
      <action condition="(maincpu.pb@4E09 LE 0x01) AND (maincpu.pb@4E13 mod 2)==00">maincpu.pw@4EFE=0202</action> 
      <action condition="(maincpu.pb@4E13==0x00)">maincpu.pw@4EFE=0000</action>
    </script>
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)
Post Reply