<mamecheat version="1">

  <cheat desc="Infinite Time">
    <script state="run">
      <action>maincpu.pb@003E=F0</action>
    </script>
  </cheat>

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

  <cheat desc="Invincibility">
    <script state="run">
      <action>maincpu.pb@003C=01</action>
      <action>maincpu.pb@1107=ED</action> <!-- Flickering OFF -->
    </script>
  </cheat>

  <cheat desc="Rapid Fire">
    <script state="run">
      <action>maincpu.pb@0014=00|(maincpu.pb@0014 BAND ~10)</action>
    </script>
  </cheat>

  <cheat desc="Always have Key">
    <script state="run">
      <action>maincpu.pb@0C1D=01</action>
    </script>
  </cheat>

  <cheat desc="Always have Sword">
    <script state="run">
      <action>maincpu.pb@0C16=30</action>
    </script>
  </cheat>

  <cheat desc="Always have Hyper Sword">
    <script state="run">
      <action>maincpu.pb@0C15=80</action>
    </script>
  </cheat>

  <cheat desc="Always have Boots">
    <script state="run">
      <action>maincpu.pb@0C18=30</action>
    </script>
  </cheat>

  <cheat desc="Always have Hyper Boots">
    <script state="run">
      <action>maincpu.pb@0C17=80</action>
    </script>
  </cheat>

  <cheat desc="Always have Invicible Potion">
    <script state="run">
      <action>maincpu.pb@0C1A=30</action>
    </script>
  </cheat>

  <cheat desc="Always have Clock">
    <script state="run">
      <action>maincpu.pb@0C1B=30</action>
    </script>
  </cheat>

  <cheat desc="Select Magic Power">
    <parameter>
      <item value="0x01">Level 1</item>
      <item value="0x02">Level 2</item>
      <item value="0x03">Level 3</item>
      <item value="0x04">Level 4</item>
      <item value="0x05">Level 5</item>
      <item value="0x06">Level 6</item>
    </parameter>
    <script state="run">
      <action>maincpu.pb@0C54=param</action>
    </script>
  </cheat>

  <cheat desc="Get Key Now!">
    <script state="on">
      <action>maincpu.pb@0C1D=01</action>
    </script>
  </cheat>

  <cheat desc="Get Sword Now!">
    <script state="on">
      <action>maincpu.pb@0C16=30</action>
    </script>
  </cheat>

  <cheat desc="Get Hyper Sword Now!">
    <script state="on">
      <action>maincpu.pb@0C15=80</action>
    </script>
  </cheat>

  <cheat desc="Get Boots Now!">
    <script state="on">
      <action>maincpu.pb@0C18=30</action>
    </script>
  </cheat>

  <cheat desc="Get Hyper Boots Now!">
    <script state="on">
      <action>maincpu.pb@0C17=80</action>
    </script>
  </cheat>

  <cheat desc="Get Invicible Potion Now!">
    <script state="on">
      <action>maincpu.pb@0C1A=30</action>
    </script>
  </cheat>

  <cheat desc="Get Clock Now!">
    <script state="on">
      <action>maincpu.pb@0C1B=30</action>
    </script>
  </cheat>

  <cheat desc="Get CAPTAIN SILVER Now!">
    <script state="on">
      <action>maincpu.pb@0C1F=01</action>
      <action>maincpu.pb@0C20=3F</action>
      <action>maincpu.pb@0C21=3F</action>
    </script>
  </cheat>

  <cheat desc="Get letter - C  Now!">
    <script state="on">
      <action>maincpu.pb@0C1F=01|(maincpu.pb@0C1F BAND ~01)</action>
    </script>
  </cheat>

  <cheat desc="Get letter - A (first) Now!">
    <script state="on">
      <action>maincpu.pb@0C20=20|(maincpu.pb@0C20 BAND ~20)</action>
    </script>
  </cheat>

  <cheat desc="Get letter - P Now!">
    <script state="on">
      <action>maincpu.pb@0C20=10|(maincpu.pb@0C20 BAND ~10)</action>
    </script>
  </cheat>

  <cheat desc="Get letter - T Now!">
    <script state="on">
      <action>maincpu.pb@0C20=08|(maincpu.pb@0C20 BAND ~08)</action>
    </script>
  </cheat>

  <cheat desc="Get letter - A (second) Now!">
    <script state="on">
      <action>maincpu.pb@0C20=04|(maincpu.pb@0C20 BAND ~04)</action>
    </script>
  </cheat>

  <cheat desc="Get letter - I (first) Now!">
    <script state="on">
      <action>maincpu.pb@0C20=02|(maincpu.pb@0C20 BAND ~02)</action>
    </script>
  </cheat>

  <cheat desc="Get letter - N Now!">
    <script state="on">
      <action>maincpu.pb@0C20=01|(maincpu.pb@0C20 BAND ~01)</action>
    </script>
  </cheat>

  <cheat desc="Get letter - S Now!">
    <script state="on">
      <action>maincpu.pb@0C21=20|(maincpu.pb@0C21 BAND ~20)</action>
    </script>
  </cheat>

  <cheat desc="Get letter - I (second) Now!">
    <script state="on">
      <action>maincpu.pb@0C21=10|(maincpu.pb@0C21 BAND ~10)</action>
    </script>
  </cheat>

  <cheat desc="Get letter - L Now!">
    <script state="on">
      <action>maincpu.pb@0C21=08|(maincpu.pb@0C21 BAND ~08)</action>
    </script>
  </cheat>

  <cheat desc="Get letter - V Now!">
    <script state="on">
      <action>maincpu.pb@0C21=04|(maincpu.pb@0C21 BAND ~04)</action>
    </script>
  </cheat>

  <cheat desc="Get letter - E Now!">
    <script state="on">
      <action>maincpu.pb@0C21=02|(maincpu.pb@0C21 BAND ~02)</action>
    </script>
  </cheat>

  <cheat desc="Get letter - R Now!">
    <script state="on">
      <action>maincpu.pb@0C21=01|(maincpu.pb@0C21 BAND ~01)</action>
    </script>
  </cheat>

  <cheat desc=" "/>
  <cheat desc="Sound Test is enabled after you've 1st inserted a credit"/>
  <cheat desc="Up / Down = Select a code,   B1 = Play,  B2 = Stop"/>
  <cheat desc=" "/>


  <cheat desc="Sound Test" tempvariables="12"> <!-- It's a legal zero address! -->
    <script state="on">
      <action>temp0 =maincpu.md@E16D</action>
      <action>temp1 =maincpu.md@E170</action>
      <action>temp2 =maincpu.md@E174</action>
      <action>temp3 =maincpu.md@E178</action>
      <action>temp4 =maincpu.md@E17C</action>
      <action>temp5 =maincpu.md@E180</action>
      <action>temp6 =maincpu.md@E184</action>
      <action>temp7 =maincpu.md@E188</action>
      <action>temp8 =maincpu.md@E18C</action>
      <action>temp9 =maincpu.md@E190</action>
      <action>temp10=maincpu.md@E194</action>
      <action>temp11=maincpu.md@E197</action>
    </script>
    <script state="run">
      <output format="Sound Code : %02X">
        <argument>maincpu.pb@(0000)</argument>
      </output>
      <action>maincpu.md@E16D=F6180100|(maincpu.md@E16D BAND ~FFFFFF00)</action> <!-- ldb $1801 -->
      <action>maincpu.md@E170=D1012723</action> <!-- cmpb $01 / beq $E197 -->
      <action>maincpu.md@E174=C1FE270E</action> <!-- cmpb #$FE / beq $E186 -->
      <action>maincpu.md@E178=C1FD270E</action> <!-- cmpb #$FD / beq $E18A -->
      <action>maincpu.md@E17C=C1DF270E</action> <!-- cmpb #$DF / beq $E18E -->
      <action>maincpu.md@E180=C1EF270E</action> <!-- cmpb #$EF / beq $E192 -->
      <action>maincpu.md@E184=20110C00</action> <!-- bra $E197 / inc $00 -->
      <action>maincpu.md@E188=200D0A00</action> <!-- bra $E197 / dec $00 -->
      <action>maincpu.md@E18C=20098627</action> <!-- bra $E197 / lda #$27 -->
      <action>maincpu.md@E190=20029600</action> <!-- bra $E194 / lda $00 -->
      <action>maincpu.md@E194=B7180C00|(maincpu.md@E194 BAND ~FFFFFF00)</action> <!-- sta $180C -->
      <action>maincpu.md@E197=D70120D2</action> <!-- stb $01 / bra $1801 -->
    </script>
    <script state="off">
      <action>maincpu.md@E16D=temp0 </action>
      <action>maincpu.md@E170=temp1 </action>
      <action>maincpu.md@E174=temp2 </action>
      <action>maincpu.md@E178=temp3 </action>
      <action>maincpu.md@E17C=temp4 </action>
      <action>maincpu.md@E180=temp5 </action>
      <action>maincpu.md@E184=temp6 </action>
      <action>maincpu.md@E188=temp7 </action>
      <action>maincpu.md@E18C=temp8 </action>
      <action>maincpu.md@E190=temp9 </action>
      <action>maincpu.md@E194=temp10</action>
      <action>maincpu.md@E197=temp11</action>
    </script>
  </cheat>

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