luascript "Console Mode [lua]" \
 "comm:Coin button is used for pause. In training mode, start button can restore HP, pause the game and then press start to select character."
run:
-- Start-up --
if (peek(0xFF82D9)==0x00) then
    poke(0x11BE7,"            ") -- Remove INSERT COIN text --
    poke(0x20ED,0x7A) -- Restore initial value --
    poke(0x20F3,0x7E)
    lpoke(0x1504,0x2B400072)
    lpoke(0x1510,0x1B400072)
    poke(0x97B2,0x67) -- Restore original HP function --
    poke(0xFF1000,0x00)
    p1char=0x00
    p2char=0x04
    if (peek(0xFF8003)==0x00) and ((peek(0xFF8072)==0x10) or (peek(0xFF8072)==0x20)) then -- Start button start --
      poke(0xFF82D9,0x09) -- Max credit --
      poke(0x800181,0x20) -- Sound effect --
    end
end
-- Title Screen --
if (dpeek(0xFFD1D2)==0x93F2) and (peek(0xFF82D9)>0x00) and (peek(0xFF82E0)==0x00) then
    if (peek(0xFF1010)==0x00) and (peek(0x800018)==0xFF) then
       lpoke(0x1504,0x00000000) -- Disable original start button --
       lpoke(0x1510,0x00000000)
       poke(0x800181,0x16)
    end
    if (peek(0xFF1504)==0x00) and ((peek(0x800018)==0xEF) or (peek(0x800018)==0xDF)) and (peek(0xFF8072)==0x00) then -- Leaving title screen --
       poke(0x800181,0x20) -- Set sound effect --
       poke(0xFF1010,0x01)
     end
    if (peek(0xFF1010)==0x01) and (peek(0x800018)==0xFF) then
      lpoke(0x1504,0x2B400072) -- Restore original start button --
      lpoke(0x1510,0x1B400072)
      poke(0xFF1010,0x02)
    end
end
-- Menu in the Title screen --
if (dpeek(0xFFD1D2)==0x93F2) and (peek(0xFF1010)==0x02) then
    if (peek(0x800018)==0xEF) or (peek(0x800018)==0xDF) then -- Game start --
       poke(0x800181,0x20) -- Set sound effect --
       poke(0xFF1010,0x00)
    end
    -- Mode Select --
    if ((peek(0xFF807B)==0x00) and (peek(0xFF807F)==0x00)) and (peek(0xFF1001)==0xFF) then
      poke(0xFF1001,0x00)
      poke(0x800181,0xFF) -- Pre-allow sound effect --
    end
    if (peek(0xFF807B)==0x04) or (peek(0xFF807F)==0x04) then
       poke(0x800181,0x21) -- Set sound effect --
       if (dpeek(0xFF1000)==0x0000) then
         dpoke(0xFF1000,0x01FF)
       elseif (dpeek(0xFF1000)==0x0100) then
         dpoke(0xFF1000,0x02FF)
       elseif (dpeek(0xFF1000)==0x0200) then
         dpoke(0xFF1000,0x00FF)
       end
    end
    if (peek(0xFF807B)==0x08) or (peek(0xFF807F)==0x08) then
       poke(0x800181,0x21) -- Set sound effect --
       if (dpeek(0xFF1000)==0x0000) then
         dpoke(0xFF1000,0x02FF)
       elseif (dpeek(0xFF1000)==0x0200) then
         dpoke(0xFF1000,0x01FF)
       elseif (dpeek(0xFF1000)==0x0100) then
         dpoke(0xFF1000,0x00FF)
       end
    end
    -- Game Level Select --
    if ((peek(0xFF807B)==0x01) or (peek(0xFF807F)==0x01)) and (peek(0xFF1001)==0x00) then -- Lv. increase --
       if (peek(0xFF82C3)<=0x06) then -- Lv.0 to Lv.7, increase --
         poke(0xFF82C3,peek(0xFF82C3)+1)
         poke(0xFF1001,0xFF)
       elseif (peek(0xFF82C3)==0x07) then -- Lv.7 to Lv.0 --
         poke(0xFF82C3,0x00)
         poke(0xFF1001,0xFF)
       end
    end
    if ((peek(0xFF807B)==0x02) or (peek(0xFF807F)==0x02)) and (peek(0xFF1001)==0x00) then -- Lv. decrease --
       if (peek(0xFF82C3)>=0x01) then -- Lv.7 to Lv.0, dcrease --
         poke(0xFF82C3,peek(0xFF82C3)-1)
         poke(0xFF1001,0xFF)
       elseif (peek(0xFF82C3)==0x00) then -- Lv.0 to Lv.7 --
         poke(0xFF82C3,0x07)
         poke(0xFF1001,0xFF)
       end
    end
    -- All Menu Text --
    if (peek(0xFF8035)~=0x38) then
      poke(0xFF8035,0x38) -- Switch the y-location of the original text --
      poke(0xFFD036,0x00) -- Disable companyy text --
      poke(0x90C9C1,"G")
      poke(0x90CA41,"A")
      poke(0x90CAC1,"M")
      poke(0x90CB41,"E")
      poke(0x90CBC1," ")
      poke(0x90CC41,"S")
      poke(0x90CCC1,"T")
      poke(0x90CD41,"A")
      poke(0x90CDC1,"R")
      poke(0x90CE41,"T")
      poke(0x90CEC1," ")
      poke(0x90CF41," ")
      poke(0x90C9C5,"V")
      poke(0x90CA45,".")
      poke(0x90CAC5,"S")
      poke(0x90CB45,".")
      poke(0x90CBC5," ")
      poke(0x90CC45,"B")
      poke(0x90CCC5,"A")
      poke(0x90CD45,"T")
      poke(0x90CDC5,"T")
      poke(0x90CE45,"L")
      poke(0x90CEC5,"E")
      poke(0x90CF45," ")
      poke(0x90C949,"T")
      poke(0x90C9C9,"R")
      poke(0x90CA49,"A")
      poke(0x90CAC9,"I")
      poke(0x90CB49,"N")
      poke(0x90CBC9,"I")
      poke(0x90CC49,"N")
      poke(0x90CCC9,"G")
      poke(0x90CD49," ")
      poke(0x90CDC9,"M")
      poke(0x90CE49,"0")
      poke(0x90CEC9,"D")
      poke(0x90CF49,"E")
      poke(0x90C955,"D")
      poke(0x90C9D5,"I")
      poke(0x90CA55,"F")
      poke(0x90CAD5,"F")
      poke(0x90CB55,"I")
      poke(0x90CBD5,"C")
      poke(0x90CC55,"U")
      poke(0x90CCD5,"L")
      poke(0x90CD55,"T")
      poke(0x90CDD5,"Y")
      poke(0x90CE55,":")
      poke(0x910004,0x0C) -- Airplane sprite --
      poke(0x910005,0x3A)
      poke(0x910007,0x0D)
    end
      if (peek(0xFF1000)==0x00) then -- Arcade Mode pointer --
        poke(0x910001,0xC0)
        poke(0x910003,0xB4)
      elseif (peek(0xFF1000)==0x01) then -- Versus Mode pointer --
        poke(0x910001,0xC0)
        poke(0x910003,0xBC)
      elseif (peek(0xFF1000)==0x02) then -- Training Mode pointer --
        poke(0x910001,0xB8)
        poke(0x910003,0xC4)
      end
      poke(0x90CF55, peek(0xFF82C3)) -- Get Game Level no. --
end
-- Restore text shift in Test Menu --
if peek(0xFF8072)==0x40 then
    poke(0xFF1010,0xFF)
    poke(0xFF8036,0x00)
end
-- Infinity credit Script --
if (peek(0xFF82D9)>0x00) then
    poke(0xFF82D9,0x09)
end
-- Versus Mode Script --
if (peek(0xFF1000)==0x01) then
    if (dpeek(0xFFD1D2)==0x93F2) and (peek(0xFF82D9)>0x00) then -- Auto activate P1 & P2 --
       poke(0xFF82E0,0x03)
       poke(0xFF894C,0x01)
       lpoke(0xFF893E,0x02010400)
    end
    if (peek(0xFF8009)==0x04) then -- Memorizes characters --
      p1char=peek(0xFF864F)
      p2char=peek(0xFF894F)
    end
    if (peek(0xFF864E)==0x02) or (peek(0xFF894E)==0x02) then -- Prevent continue text --
       poke(0xFF863E,0xFF)
       poke(0xFF893E,0xFF)
    end
    if (peek(0xFF800D)==0x0C) and ((peek(0xFF864E)==0x02) or (peek(0xFF894E)==0x02)) then
       poke(0xFF8005,0x00) -- Return to character screen --
       poke(0xFF8009,0x00)
       poke(0xFF800D,0x00)
       poke(0xFF82E0,0x03) -- Reactivate P1 & P2 --
       poke(0xFF864C,0x01)
       poke(0xFF894C,0x01)
       poke(0xFF864D,0x00) -- Deselect characters --
       poke(0xFF894D,0x00)
       dpoke(0xFF89EC,0x0000) -- Prevent bonus stage --
       lpoke(0xFF89DD,0x00000000) -- Prevent character turn grey after lose --
       lpoke(0xFF89E1,0x00000000)
       lpoke(0xFF89E5,0x00000000)
       poke(0xFF89DD,0x00) -- Repeated due to bug --
       poke(0xFF89E8,0x00) -- Repeated due to bug --
       poke(0xFF1005,0x01)
    end
    if (peek(0xFF1005)==01) and (dpeek(0xFFDDA2)==0x203B) then -- Re-load last round characters --
      poke(0xFF864F,p1char)
      poke(0xFF894F,p2char)
      poke(0xFF1005,0x00)
    end
    if math.random()*255<=127 then -- Stage 50/50 chance from 1P or 2P --
       poke(0xFF89D1,peek(0xFF864F)) -- Flight start at P1 --
       poke(0xFFDD5F,peek(0xFF894F)) -- P2 character's stage --
    else
       poke(0xFF89D1,peek(0xFF894F)) -- Flight start at P2 --
       poke(0xFFDD5F,peek(0xFF864F)) -- P1 character's stage --
    end
    poke(0xFF89D0,0x00) -- Prevent CPU stage --
end
-- Training Mode Script --
if (peek(0xFF1000)==0x02) then
    if (dpeek(0xFFD1D2)==0x93F2) and (peek(0xFF82D9)>0x00) then -- Auto activate P1 & P2 --
       poke(0xFF82E0,0x03)
       poke(0xFF894C,0x01)
       lpoke(0xFF893E,0x02010400)
    end
    if (peek(0xFF864D)==0x01) and (peek(0xFF894D)==0x00) then -- P1 as main player --
      poke(0x20ED,0x7E) -- Switch control --
      poke(0x20F3,0x7A)
      poke(0xFF1003,0x01)
    end
    if (peek(0xFF894D)==0x01) and (peek(0xFF864D)==0x00) then -- P2 as main player --
      poke(0x20ED,0x7E) -- Switch control --
      poke(0x20F3,0x7A)
      poke(0xFF1003,0x02)
    end
    if (peek(0xFF864D)==0x01) and (peek(0xFF894D)==0x01) then
      poke(0x20ED,0x7A) -- Restore control --
      poke(0x20F3,0x7E)
      poke(0xFF89D0,0x00) -- Fix for stage select --
    end
    if (peek(0xFF1003)==0x01) or (peek(0xFF1003)==0x00) then -- P2 character's stage --
      poke(0xFFDD5F,peek(0xFF894F))
    end
    if (peek(0xFF1003)==0x02) then -- P1 character's stage --
      poke(0xFFDD5F,peek(0xFF864F))
    end
    if (peek(0xFF8009)==0x04) then -- Memorizes characters --
      p1char=peek(0xFF864F)
      p2char=peek(0xFF894F)
    end
    if (peek(0xFF8009)==0x08) then
       lpoke(0xFF83E8,0x00FF00FF) -- Increase HP at start --
       lpoke(0xFF86E8,0x00FF00FF)
       poke(0x97B2,0x66) -- Disable original HP function --
    end
    if (peek(0xFF8009)==0x0A) then
       poke(0xFF8ABF,0x28) -- infinite time --
    -- P1 HP recovery --
       if (peek(0xFF83E9)>=0x6F) then -- HP bar display --
          poke(0xFF857B,peek(0xFF83E9)-0x6F)
       end
       if (peek(0xFF83E9)<0x6F)  then -- When HP bar rearch 0 --
          dpoke(0xFF857A,0x0000)
          poke(0xFF1020,0x01)
          if (peek(0xFF83E9)<0x4F) then -- Prevent killed by combos --
             poke(0xFF83E9,0x6F)
          end
       end
       if (peek(0x800018)==0xDF) then -- Start button retore HP --
          poke(0xFF1020,0x01)
       end
       if (peek(0xFF83E9)<0xFF) and (peek(0xFF1020)==0x01) and (peek(0xFF83C1)==0x00) then -- Restore HP --
          poke(0xFF83E9,peek(0xFF83E9)+0x1)
          poke(0xFF83EB,peek(0xFF83EB)+0x1)
       end
       if (peek(0xFF83E9)==0xFF) then
          poke(0xFF1020,0x00)
       end
    -- P2 HP recovery --
       if (peek(0xFF86E9)>=0x6F) then -- HP bar display --
          poke(0xFF887B,peek(0xFF86E9)-0x6F)
       end
       if (peek(0xFF86E9)<0x6F)  then -- When HP bar rearch 0 --
          dpoke(0xFF887A,0x0000)
          poke(0xFF1021,0x01)
          if (peek(0xFF86E9)<0x4F) then -- Prevent killed by combos --
             poke(0xFF86E9,0x6F)
          end
       end
       if (peek(0x800018)==0xEF) then -- Start button retore HP --
          poke(0xFF1021,0x01)
       end
       if (peek(0xFF86E9)<0xFF) and (peek(0xFF1021)==0x01) and (peek(0xFF86C1)==0x00) then -- Restore HP --
          poke(0xFF86E9,peek(0xFF86E9)+0x1)
          poke(0xFF86EB,peek(0xFF86EB)+0x1)
       end
       if (peek(0xFF86E9)==0xFF) then
          poke(0xFF1021,0x00)
       end
       if (peek(0xFF8000)==0xF0) and ((peek(0xFF8072)==0x10) or (peek(0xFF8072)==0x20)) then -- Return to Character Screen Step 1 --
         poke(0xFF864D,0x00)
         poke(0xFF894D,0x00)
         poke(0xFF8005,0x0C)
         poke(0xFF8009,0x02)
         poke(0xFF800B,0x01)
         poke(0xFF1004,0x01)
         poke(0xFF1005,0x01)
         poke(0x97B2,0x67) -- Restore original HP function --
       end
       if (peek(0xFF1004)==0x01) then -- Return to Character Screen Step 2 --
         poke(0xFF8000,0x00)
         poke(0xFF1004,0x00)
       end
    end
    if (peek(0xFF1005)==01) and (dpeek(0xFFDDA2)==0x203B) then -- Re-load last round characters --
      poke(0xFF864F,p1char)
      poke(0xFF894F,p2char)
      poke(0xFF1005,0x00)
    end
end
-- Pause Function Script --
    if (peek(0xFF8009)==0x0A) then
       if (peek(0xFF8072)==0x00) then
       poke(0xFF1002,0x00)
       end
       if (peek(0xFF8000)==0x00) and ((peek(0xFF8072)==0x01) or (peek(0xFF8072)==0x02)) and (peek(0xFF1002)==0x00) then
       poke(0xFF8000,0xF0)
       poke(0xFF1002,0xFF)
       end
       if (peek(0xFF8000)==0xF0) and ((peek(0xFF8072)==0x01) or (peek(0xFF8076)==0x02)) and (peek(0xFF1002)==0x00) then
       poke(0xFF8000,0x00)
       poke(0xFF1002,0xFF)
       poke(0x800181,0x56) -- Sound effect --
       end
    end
off:
    poke(0x11BE7,"INSERT COIN.")
    poke(0x20ED,0x7A)
    poke(0x20F3,0x7E)
    lpoke(0x1504,0x2B400072)
    lpoke(0x1510,0x1B400072)
    poke(0x97B2,0x67) -- Restore original HP function --

script "Infinite Time"
run:
    if (peek($FF8AC2)==$00)and(peek($FF8ABE)>$01)
      dpoke $FF8ABE $9928
      dpoke $FFDDA2 $203C
    endif
script "Finish this Round Now!"
on:
    dpoke $FF8ABE $0101
script "Disable projectile impact slowdown"
run:
    if (peek($FF83E8)!=$FF)and(peek($FF86E8)!=$FF)
      poke $FF82E2 $00
    endif
script "Select Starting Stage" \
 "0x0000/Stage 1"\
 "0x0100/Stage 2"\
 "0x0200/Stage 3"\
 "0x0300/Bonus stage: car"\
 "0x0301/Stage 4"\
 "0x0401/Stage 5"\
 "0x0501/Stage 6"\
 "0x0601/Bonus stage: barrels"\
 "0x0602/Stage 7"\
 "0x0702/Stage 8"\
 "0x0802/Stage 9 (Boxer)"\
 "0x0902/Bonus stage: drums"\
 "0x0903/Stage 10 (Claw)"\
 "0x0A03/Stage 11 (Sagat)"\
 "0x0B03/Stage 12 (Dictator)"
run:
    if (dpeek($FF89ED)==$0000)or(dpeek($FF89ED)==param)
      poke $FF89C1 param/$100
    endif
    if dpeek($FF89ED)==$0000
      dpoke $FF89ED param
    endif
script "No Wait Mode"
run:
    poke $FF82DD $01
script "Select Background" \
 "0x00/Ryu"\
 "0x01/E.Honda"\
 "0x02/Blanka"\
 "0x03/Guile"\
 "0x04/Ken"\
 "0x05/Chun Li"\
 "0x06/Zangief"\
 "0x07/Dhalsim"\
 "0x08/Dictator"\
 "0x09/Sagat"\
 "0x0A/Boxer"\
 "0x0B/Claw"
run:
    dpoke $FFDD5E param
script "Select Ending" \
 "0/No Losses"\
 "1/No Continues"\
 "2/Normal"
run:
    if param<2
      poke $FF831D $00
      poke $FF8A0D param
    endif
    if param==$2
      poke $FF831D $01
    endif
script "Walk Through Stage Boundaries"
run:
    dpoke $003234 $601E
    dpoke $003266 $601E
    dpoke $09C80A $6014
    dpoke $09C84C $6014
    dpoke $09C7C8 $4E71
off:
    dpoke $003234 $6D1E
    dpoke $003266 $6E1E
    dpoke $09C80A $6414
    dpoke $09C84C $6514
    dpoke $09C7C8 $64F8
script " "
script "P1 Infinite Energy"
run:
    if (dpeek($FF83E8)<$60)and((peek($FF83C1)&$10)==$00)and(peek($FF89D4)==$0)
      dpoke $FF83E8 $90
      dpoke $FF857A $90
    endif
script "P1 Always have No Energy"
run:
    poke $FF83E9 $00
    poke $FF857B $00
script "P1 Drain All Energy Now!"
on:
    poke $FF83E9 $00
    poke $FF857B $00
script "P1 Finish round to win match"
run:
    poke $FF864E $02
script "P1 Rounds won always set = 0"
run:
    poke $FF864E $00
script "P1 Rounds won set = 0 Now!"
on:
    poke $FF864E $00
script "P1 All normal moves cancellable"
run:
    poke $FF8553 $01
script "P1 All Hits Keep You Close"
run:
    poke $FF870A $00
script "P1 Invincibility"
run:
    poke $FF857D $01
script "P1 Allow special moves during jump"
run:
    poke $FF853F $00
script "P1 No limit next shot"
run:
    poke $FF8592 $00
    poke $FF8593 $00
script "P1 Easy button tap moves"
run:
    temp0=peek($FF83BE+$291)
    if peek($FF83BE)==$0
      temp0=$FF
    endif
    if (temp0==$1)and(peek(FF83BE+$9A)<$2)
      poke ($FF83BE+$9A) $2
    endif
    if (temp0==$1)and(peek(FF83BE+$9C)<$2)
      poke ($FF83BE+$9C) $2
    endif
    if (temp0==$1)and(peek(FF83BE+$9E)<$2)
      poke ($FF83BE+$9E) $2
    endif
    if ((temp0==$2)or(temp0==$5))and(peek(FF83BE+$9A)<$3)
      poke ($FF83BE+$9A) $3
    endif
    if ((temp0==$2)or(temp0==$5))and(peek(FF83BE+$9C)<$3)
      poke ($FF83BE+$9C) $3
    endif
    if ((temp0==$2)or(temp0==$5))and(peek(FF83BE+$9E)<$3)
      poke ($FF83BE+$9E) $3
    endif
script "P1 Shot motion cancel"
run:
    poke $FF83DC $01
script "P1 Shot motion cancel (Guile)"
run:
    poke $FF83DC $00
script "P1 Easy charge moves"
run:
    temp0=peek($FF83BE+$291)
    if peek($FF83BE)==$0
      temp0=$FF
    endif
    if temp0==$1
      poke ($FF83BE+$81) $01
      poke ($FF83BE+$AB) $01
    endif
    if temp0==$2
      poke ($FF83BE+$81) $01
      poke ($FF83BE+$B4) $01
    endif
    if temp0==$3
      poke ($FF83BE+$81) $01
      poke ($FF83BE+$87) $01
    endif
    if temp0==$5
      poke ($FF83BE+$81) $01
    endif
    if temp0==$8
      poke ($FF83BE+$81) $01
      poke ($FF83BE+$89) $01
      poke ($FF83BE+$92) $01
    endif
    if temp0==$A
      poke ($FF83BE+$81) $01
      poke ($FF83BE+$89) $01
      dpoke ($FF83BE+$B2) $0101
    endif
    if temp0==$B
      poke ($FF83BE+$81) $01
      poke ($FF83BE+$89) $01
    endif
script "P1 Easy QCF + QCB moves"
run:
    temp0=peek($FF83BE+$291)
    if peek($FF83BE)==$0
      temp0=$FF
    endif
    if (temp0==$0)or(temp0==$4)
      poke ($FF83BE+$90) $04
      poke ($FF83BE+$98) $04
    endif
    if temp0==$7
      lpoke ($FF83BE+$90) $02080004
    endif
    if temp0==$9
      lpoke ($FF83BE+$90) $02080004
      lpoke ($FF83BE+$A0) $02080004
    endif
script "P1 Easy F,D,DF moves"
run:
    temp0=peek($FF83BE+$291)
    if peek($FF83BE)==$0
      temp0=$FF
    endif
    if (temp0==$0)or(temp0==$4)
      poke ($FF83BE+$A0) $04
    endif
    if temp0==$9
      lpoke ($FF83BE+$98) $02080004
    endif
script "P1 Easy 360, half-circle + tiger-knee moves"
run:
    temp0=peek($FF83BE+$291)
    if peek($FF83BE)==$0
      temp0=$FF
    endif
    if temp0==$7
      lpoke ($FF83BE+$98) $02080008
    endif
    if (temp0==$6)and(peek(FF83BE+$12)!=$0)
      lpoke ($FF83BE+$80) $06060800
    endif
    if (temp0==$6)and(peek(FF83BE+$12)==$0)
      lpoke ($FF83BE+$80) $06070800
    endif
    if (temp0==$9)and(peek(FF83BE+$AB)<$4)
      lpoke ($FF83BE+$A8) $02080004
    endif
script "P1 Select Character" \
 "comm:Free player selection. Use on the level VS screen." \
 "0x00/Ryu"\
 "0x01/E. Honda"\
 "0x02/Blanka"\
 "0x03/Guile"\
 "0x04/Ken"\
 "0x05/Chun Li"\
 "0x06/Zangief"\
 "0x07/Dhalsim"\
 "0x08/M. Bison"\
 "0x09/Sagat"\
 "0x0A/Balrog"\
 "0x0B/Vega"
run:
    poke $FF864F param
script "P1 Alternate Outfit"
run:
    poke $FF8672 $01
off:
    poke $FF8672 $00
script " "
script "P2 Infinite Energy"
run:
    if (dpeek($FF86E8)<$60)and((peek($FF86C1)&$10)==$00)and(peek($FF89D4)==$0)
      dpoke $FF86E8 $90
      dpoke $FF887A $90
    endif
script "P2 Dizzy Status" \
 "0x00/Never get dizzied"\
 "0x40/Always get dizzied"
run:
    dpoke $FF871A param
    dpoke $FF871C param
script "P2 Always have No Energy"
run:
    poke $FF86E9 $00
    poke $FF887B $00
script "P2 Drain All Energy Now!"
on:
    poke $FF86E9 $00
    poke $FF887B $00
script "P2 Finish round to win match"
run:
    poke $FF894E $02
script "P2 Rounds won always set = 0"
run:
    poke $FF894E $00
script "P2 Rounds won set = 0 Now!"
on:
    poke $FF894E $00
script "P2 All normal moves cancellable"
run:
    poke $FF8853 $01
script "P2 All Hits Keep you Close"
run:
    poke $FF840A $00
script "P2 Invincibility"
run:
    poke $FF887D $01
script "P2 Allow special moves during jump"
run:
    poke $FF883F $00
script "P2 No limit next shot"
run:
    poke $FF8892 $00
    poke $FF8893 $00
script "P2 Easy button tap moves"
run:
    temp0=peek($FF86BE+$291)
    if peek($FF86BE)==$0
      temp0=$FF
    endif
    if (temp0==$1)and(peek(FF86BE+$9A)<$2)
      poke ($FF86BE+$9A) $2
    endif
    if (temp0==$1)and(peek(FF86BE+$9C)<$2)
      poke ($FF86BE+$9C) $2
    endif
    if (temp0==$1)and(peek(FF86BE+$9E)<$2)
      poke ($FF86BE+$9E) $2
    endif
    if ((temp0==$2)or(temp0==$5))and(peek(FF86BE+$9A)<$3)
      poke ($FF86BE+$9A) $3
    endif
    if ((temp0==$2)or(temp0==$5))and(peek(FF86BE+$9C)<$3)
      poke ($FF86BE+$9C) $3
    endif
    if ((temp0==$2)or(temp0==$5))and(peek(FF86BE+$9E)<$3)
      poke ($FF86BE+$9E) $3
    endif
script "P2 Shot motion cancel"
run:
    poke $FF86DC $01
script "P2 Shot motion cancel (Guile)"
run:
    poke $FF86DC $00
script "P2 Easy charge moves"
run:
    temp0=peek($FF86BE+$291)
    if peek($FF86BE)==$0
      temp0=$FF
    endif
    if temp0==$1
      poke ($FF86BE+$81) $01
      poke ($FF86BE+$AB) $01
    endif
    if temp0==$2
      poke ($FF86BE+$81) $01
      poke ($FF86BE+$B4) $01
    endif
    if temp0==$3
      poke ($FF86BE+$81) $01
      poke ($FF86BE+$87) $01
    endif
    if temp0==$5
      poke ($FF86BE+$81) $01
    endif
    if temp0==$8
      poke ($FF86BE+$81) $01
      poke ($FF86BE+$89) $01
      poke ($FF86BE+$92) $01
    endif
    if temp0==$A
      poke ($FF86BE+$81) $01
      poke ($FF86BE+$89) $01
      dpoke ($FF86BE+$B2) $0101
    endif
    if temp0==$B
      poke ($FF86BE+$81) $01
      poke ($FF86BE+$89) $01
    endif
script "P2 Easy QCF + QCB moves"
run:
    temp0=peek($FF86BE+$291)
    if peek($FF86BE)==$0
      temp0=$FF
    endif
    if (temp0==$0)or(temp0==$4)
      poke ($FF86BE+$90) $04
      poke ($FF86BE+$98) $04
    endif
    if temp0==$7
      lpoke ($FF86BE+$90) $02080004
    endif
    if temp0==$9
      lpoke ($FF86BE+$90) $02080004
      lpoke ($FF86BE+$A0) $02080004
    endif
script "P2 Easy F,D,DF moves"
run:
    temp0=peek($FF86BE+$291)
    if peek($FF86BE)==$0
      temp0=$FF
    endif
    if (temp0==$0)or(temp0==$4)
      poke ($FF86BE+$A0) $04
    endif
    if temp0==$9
      lpoke ($FF86BE+$98) $02080004
    endif
script "P2 Easy 360, half-circle + tiger-knee moves"
run:
    temp0=peek($FF86BE+$291)
    if peek($FF86BE)==$0
      temp0=$FF
    endif
    if temp0==$7
      lpoke ($FF86BE+$98) $02080008
    endif
    if (temp0==$6)and(peek(FF86BE+$12)!=$0)
      lpoke ($FF86BE+$80) $06060800
    endif
    if (temp0==$6)and(peek(FF86BE+$12)==$0)
      lpoke ($FF86BE+$80) $06070800
    endif
    if (temp0==$9)and(peek(FF86BE+$AB)<$4)
      lpoke ($FF86BE+$A8) $02080004
    endif
script "P2 Select Character" \
 "comm:Free player selection. Use on the level VS screen." \
 "0x00/Ryu"\
 "0x01/E. Honda"\
 "0x02/Blanka"\
 "0x03/Guile"\
 "0x04/Ken"\
 "0x05/Chun Li"\
 "0x06/Zangief"\
 "0x07/Dhalsim"\
 "0x08/M. Bison"\
 "0x09/Sagat"\
 "0x0A/Balrog"\
 "0x0B/Vega"
run:
    poke $FF894F param
script "P2 Alternate Outfit"
run:
    poke $FF8972 $01
off:
    poke $FF8972 $00
script " "
script "No Background Music"
on:
        cpu audio
temp0=lpeek($00AA)
        cpu audio
temp1=lpeek($025A)
    cpu main
run:
    cpu audio
    if peek($D048)>00
      lpoke $00AA $00006AC3
    cpu audio
    endif
    if peek($D048)==$00
      lpoke $00AA temp0
      lpoke $025A $00030FC3
    endif
    cpu main
off:
    cpu audio
    lpoke $00AA temp0
    lpoke $025A temp1
    cpu main
script "Hide Background" \
 "comm:Activate before match start; set to Claw or Dictator stage for no BG sprites"
on:
    temp0=peek($FF8049)&0F
    temp1=peek($FF804F)&0F
    temp2=dpeek($007A7E)
    temp3=lpeek($007A80)
    temp4=lpeek($007A84)
    temp5=dpeek($007ADE)
    temp6=dpeek($005510)
    temp7=dpeek($007146)
    temp8=dpeek($007268)
run:
    poke $FF8049 peek($FF8049)|temp0
    poke $FF804F peek($FF804F)|temp1
    dpoke $007ADE temp5
    dpoke $005510 temp6
    dpoke $007146 temp7
    dpoke $007268 temp8
    dpoke $007A7E $4E71
    lpoke $007A80 $4E714E71
    lpoke $007A84 $4E714E71
    if ((dpeek($FF8008)>$6)and(peek($FF83E8)==$0)and(peek($FF86E8)==$0)and(peek($FF89D4)==$0))
      dpoke $007ADE $6010
      dpoke $005510 $4E75
    endif
    if ((dpeek($FF8008)==$A)and(dpeek($FF8AC2)==$0)and(peek($FF89D4)==$0))
      poke $FF8049 peek($FF8049)&F0
      poke $FF804F peek($FF804F)&F0
      dpoke $007146 $4E71
      dpoke $007268 $4E71
    endif
off:
    poke $FF8049 peek($FF8049)|temp0
    poke $FF804F peek($FF804F)|temp1
    dpoke $007A7E temp2
    lpoke $007A80 temp3
    lpoke $007A84 temp4
    dpoke $007ADE temp5
    dpoke $005510 temp6
    dpoke $007146 temp7
    dpoke $007268 temp8
script "Select Region" \
 "comm:This cheat sets the machine region - the effectiveness may vary! You have to enable this ASAP - ON or before the ROM check screen! Or enable + RESET" \
 "0x00/Japan"\
 "0x02/USA"\
 "0x04/World"
on:
    temp0=peek($000191)
run:
    poke $000191 param
off:
    poke $000191 temp0
