<mamecheat version="1">

  <cheat desc="Infinite Credits">
    <script state="run">
      <action>maincpu.pb@6001=90</action>
    </script>
  </cheat>

  <cheat desc="Infinite Lives">
    <script state="run">
      <action>maincpu.pb@6228=06</action>
    </script>
  </cheat>

  <cheat desc="Invincibility">
    <script state="on">
      <action>temp0 =maincpu.mw@1C57</action>
      <action>temp1 =maincpu.mb@2817</action>
      <action>temp2 =maincpu.mb@277F</action>
      <action>temp3 =maincpu.mb@2A1B</action>
    </script>
    <script state="run">
      <action>maincpu.mw@1C57=0118</action> <!-- Falling -->
      <action>maincpu.mb@2817=C9</action> <!-- Collisions -->
      <action>maincpu.mb@277F=C9</action> <!-- Floor of Elevators -->
      <action>maincpu.mb@2A1B=C9</action> <!-- Hitting your head -->
    </script>
    <script state="off">
      <action>maincpu.mw@1C57=temp0 </action>
      <action>maincpu.mb@2817=temp1 </action>
      <action>maincpu.mb@277F=temp2 </action>
      <action>maincpu.mb@2A1B=temp3 </action>
    </script>
  </cheat>

  <cheat desc="Infinite hammer upon pickup">
    <script state="run">
      <action condition="(frame % 60 == 0)">maincpu.pb@6394=0F</action>
    </script>
  </cheat>

  <cheat desc="Freeze Bonus Timer">
    <script state="on">
      <action>temp0 =maincpu.mb@06A9</action>
      <action>maincpu.mb@06A9=00</action>
      <action>maincpu.pb@6386=00</action>
    </script>
    <script state="run">
      <action condition="(maincpu.pb@62B1==01)">maincpu.pb@62B1=maincpu.pb@62B0 - 1</action>
    </script>
    <script state="off">
      <action>maincpu.mb@06A9=temp0 </action>
      <action>temp1 =(maincpu.pb@638C - (maincpu.pb@638C / 10) * 6)</action>
      <action condition="(maincpu.pb@6200!=00)">maincpu.pb@62B1=temp1 </action>
      <action condition="(maincpu.pb@6200!=00) AND (temp1==0)">maincpu.pb@6386=02</action>
    </script>
  </cheat>

  <cheat desc="No fireballs on ramps">
    <script state="run">
      <action>maincpu.pb@62B9=00</action>
    </script>
  </cheat>

  <cheat desc="No fireballs on factory">
    <script state="run">
      <action>maincpu.pb@6403=00</action>
    </script>
  </cheat>

  <cheat desc="No pies on factory">
    <script state="run">
      <action>maincpu.pb@65A0=00</action>
    </script>
  </cheat>

  <cheat desc="No fireballs on rivets">
    <script state="run">
      <action>maincpu.pb@6400=00</action>
    </script>
  </cheat>

  <cheat desc="No jacks on elevators">
    <script state="run">
      <action>maincpu.pb@6500=00</action>
    </script>
  </cheat>

  <cheat desc="No barrels on ramps">
    <script state="run">
      <action>maincpu.pb@6392=00</action>
    </script>
  </cheat>

  <cheat desc="Always climb">
    <script state="run">
      <action>maincpu.pb@6215=01</action>
    </script>
    <script state="off">
      <action>maincpu.pb@6215=00</action>
    </script>
  </cheat>

  <cheat desc="Hammer">
    <script state="run">
      <action>maincpu.pb@6217=01</action>
      <action>maincpu.pb@6691=01</action>
    </script>
  </cheat>

  <cheat desc="Finish this Level Now!">
    <script state="on">
      <action>maincpu.pb@6290=00, maincpu.pb@6205=30</action>
    </script>
  </cheat>

  <cheat desc="Select Starting Level">
    <parameter min="1" max="99" step="1"/>
    <script state="change">
      <action>maincpu.mb@095E = (param)</action>
      <action condition="(param == 1)">maincpu.mb@095F=65</action>
      <action condition="(param == 2)">maincpu.mb@095F=67</action>
      <action condition="(param == 3)">maincpu.mb@095F=6A</action>
      <action condition="(param == 4)">maincpu.mb@095F=6E</action>
      <action condition="(param GT 4)">maincpu.mb@095F=73</action>
    </script>
    <script state="off">
      <action>maincpu.mw@095E=0165</action>
    </script>
  </cheat>

  <cheat desc=" "/>

  <cheat desc="Fix Kill Screen Bug"> <comment>Fixes the bug which kills you on level 22 regardless, see here - http://donhodges.com/how_high_can_you_get.htm</comment>
    <script state="on">
      <action>temp0=maincpu.mq@0F7D, temp1=maincpu.mq@0F85, temp2=maincpu.mb@0F8D</action>
    </script>
    <script state="run">
      <action>maincpu.mq@0F7D=A747043E023804FE, maincpu.mq@0F85=C6808017A717A717, maincpu.mb@0F8D=28</action>
    </script>
    <script state="off">
      <action>maincpu.mq@0F7D=temp0, maincpu.mq@0F85=temp1, maincpu.mb@0F8D=temp2</action>
    </script>
  </cheat>

  <cheat desc="Sound Test">
    <parameter min="1" max="21" step="1"/>
    <script state="on">
      <action condition="maincpu.pb@6001==00">maincpu.pb@6001=01</action>
    </script>
    <script state="change">
      <action condition="(param GT 0) AND (param LT 7)">maincpu.pb@(607F+param)=01</action>
      <action condition="param==7">maincpu.pb@6088=01</action>
      <action condition="(param GE 8) AND (param LT 12)">maincpu.pb@6089=(param-7)</action>
      <action condition="(param GE 11)">maincpu.pb@6089=(param-6)</action>
    </script>
  </cheat>

</mamecheat>
<!-- Cheat file downloaded from http://www.mamecheat.co.uk, see cheat.txt for list of contributors. -->
