script "Infinite Time"
on:
    temp0=peek($101a3d)
run:
    if ((frame%300==$0))and((peek($101a3d)!=temp0))
      poke $101a3d $59
    endif
script "Invincibility"
on:
-- This is actually the only rom cheat, and so it has its address translated to -4 compared to neogeo
-- All the other cheats are in ram and are exactly the same as their neogeo versions
    temp0=peek($00AD2e)
run:
    poke $00AD2e $60
off:
    poke $00AD2e temp0
script "Select Starting Mission" \
 "comm:Only works in 1UP game." \
 "0x0000/Mission 1-1"\
 "0x0003/Mission 1-2"\
 "0x0004/Mission 1-3"\
 "0x0100/Mission 2-1"\
 "0x0101/Mission 2-2"\
 "0x0103/Mission 2-3"\
 "0x0104/Mission 2-4"\
 "0x0200/Mission 3-1"\
 "0x0202/Mission 3-2"\
 "0x0203/Mission 3-3"\
 "0x0204/Mission 3-4"\
 "0x0300/Mission 4-1"\
 "0x0301/Mission 4-2"\
 "0x0302/Mission 4-3"\
 "0x0304/Mission 4-4"\
 "0x0400/Mission 5-1"\
 "0x0401/Mission 5-2"\
 "0x0402/Mission 5-3"\
 "0x0404/Final Boss"
run:
    if ((dpeek($101a22)==$0000))and((peek($1032c8)==$00))
      dpoke $101a22 param
    endif
script "Finish Current Section Now!" \
 "comm:Proceeds to next Section. Only works in 1UP game."
on:
    temp0=dpeek($101a22)
    if (temp0==$0000)
      temp1=$03
    elsif (temp0==$0003)
      temp1=$04
    elsif (temp0==$0004)
      temp1=$05
    elsif (temp0==$0100)
      temp1=$01
    elsif (temp0==$0101)
      temp1=$03
    elsif (temp0==$0103)
      temp1=$04
    elsif (temp0==$0104)
      temp1=$05
    elsif (temp0==$0200)
      temp1=$02
    elsif (temp0==$0202)
      temp1=$03
    elsif (temp0==$0203)
      temp1=$04
    elsif (temp0==$0204)
      temp1=$05
    elsif (temp0==$0300)
      temp1=$01
    elsif (temp0==$0301)
      temp1=$02
    elsif (temp0==$0302)
      temp1=$04
    elsif (temp0==$0304)
      temp1=$05
    elsif (temp0==$0400)
      temp1=$01
    elsif (temp0==$0401)
      temp1=$02
    elsif (temp0==$0402)
      temp1=$04
    elsif (temp0==$0404)
      temp1=$04
    endif
	poke $101a05 temp1
    if ((peek($101a23)!=$05))and((peek($1032c8)==$00))
      poke $103330 $01
      poke $1032c8 $20
    endif
script "Finish Bonus Stage Successfully Now!" \
 "comm:Works in both 1UP and 2UP game."
on:
    if ((peek($101a23)==$05))and((peek($1032c8)!=$01))
      poke $101a0b $FF
    endif
script "Infinite Ninja Magic"
run:
    poke $101a1a $01
script "Select Ninja Magic" \
 "0x00/Type 1"\
 "0x01/Type 2"\
 "0x02/Type 3"
run:
    poke $101a1b param
script "Always have Power Up Gun" \
 "comm:When you disable this cheat you will lose the Power Up Gun - you need do disable this cheat or you won't be able to kill the Stage 3 Boss"
run:
    poke $101a40 $01
off:
    poke $101a40 $00
script "Get Power Up Gun Now!"
on:
    poke $101a40 $01
script "Kill Boss with 1 Hit Now!" \
 "comm:This cheat is partial - it only works for some bosses"
on:
    poke $100b33 $00
script "Always get Special Bonus" \
 "comm:20,000 Pts"
run:
    poke $103330 $00
script " "
script "P1 Infinite Lives"
run:
    poke $1019f2 $06
script "P2 Infinite Lives"
run:
    poke $1019f1 $06
