luascript "Console Mode [lua]" \
 "comm:Coin button is used for pause. In training mode, pause the game and then press start to select character."
run:
   -- Start-up --
   if (peek(0xFF4BDD)==0x00) then
      poke(0x6B6F0,"PRESS START")
      poke(0xB0D,0x01) -- Restore initial value --
      poke(0xB1D,0x00)
      poke(0xB17,0xAA)
      poke(0xB35,0xAC)
      lpoke(0xAF4,0x1B40CBAE)
      poke(0xFF2000,0x00)
      p1char1=0x00
      p1char2=0x02
      p2char1=0x02
      p2char2=0x07
      if (peek(0x804020)<0xFF) and (peek(0xFF0060)>0x00) then -- Start button start --
         poke(0xFF0040,0x02)
         poke(0x618001,0xFF) -- Stop the opening music --
         poke(0x618003,0x00)
         poke(0x61801F,0x00)
      end
      if (peek(0x804020)==0xFF) and (peek(0xFF0040)==0x02) then -- Start button start cont. --
         poke(0xFF0040,0x01)
         poke(0x618001,0x00) -- sound effect --
         poke(0x618003,0x70)
         poke(0x61801F,0x00)
         poke(0xFF4BDD,0x09) -- Max Credit --
      end
   end
   -- Title screen --
   if (dpeek(0xFF4B84)==0xFFF0) then
      if (peek(0xFF4BDD)>0x00) and (peek(0xFF4880)==0x00) and (peek(0xFFEADE)==0x01) then
         lpoke(0xAF4,0x00000000) -- Disable original start button --
         region=peek(0xFF4BF7)
         if (peek(0xFF2000)~=0x03) then
            poke(0xFF2000,0x00) -- Set Arcade Mode as default --
            if (peek(0xFF2020)==0x00) and (peek(0x804020)==0xFF) then
               poke(0xFF2020,0x01)
            end
            if (peek(0xFF2020)==0x01) and ((peek(0x804020)==0xFE) or (peek(0x804020)==0xFD)) then -- Leaving title screen --
               poke(0xFF2020,0x02)
               poke(0x618001,0x00) -- sound effect --
               poke(0x618003,0x73)
               poke(0x61801F,0x00)
            end
            if (peek(0xFF2020)==0x02) and (peek(0x804020)==0xFF) then
               poke(0xFF2020,0x03)
            end
         end
      end
      -- Menu Screen --
      if (peek(0xFF4880)==0x00) and (peek(0xFF2020)==0x03) then
         if (peek(0x804020)==0xFF) then -- Restore original start button --
            lpoke(0xAF4,0x1B40CBAE)
         end
         -- Text display in menu --
         dpoke(0xFF4990,0x0F78) -- Shift logo and text --
         poke(0xFFEADE,0x00)
         lpoke(0x908D1C,0x00410000+peek(0xFF2030)) -- Arcade Mode --
         lpoke(0x908D9C,0x00520000+peek(0xFF2030))
         lpoke(0x908E1C,0x00430000+peek(0xFF2030))
         lpoke(0x908E9C,0x00410000+peek(0xFF2030))
         lpoke(0x908F1C,0x00440000+peek(0xFF2030))
         lpoke(0x908F9C,0x00450000+peek(0xFF2030))
         lpoke(0x90909C,0x004D0000+peek(0xFF2030))
         lpoke(0x90911C,0x004F0000+peek(0xFF2030))
         lpoke(0x90919C,0x00440000+peek(0xFF2030))
         lpoke(0x90921C,0x00450000+peek(0xFF2030))
         lpoke(0x908D20,0x00560000+peek(0xFF2031)) -- Versus Mode --
         lpoke(0x908DA0,0x00450000+peek(0xFF2031))
         lpoke(0x908E20,0x00520000+peek(0xFF2031))
         lpoke(0x908EA0,0x00530000+peek(0xFF2031))
         lpoke(0x908F20,0x00550000+peek(0xFF2031))
         lpoke(0x908FA0,0x00530000+peek(0xFF2031))
         lpoke(0x9090A0,0x004D0000+peek(0xFF2031))
         lpoke(0x909120,0x004F0000+peek(0xFF2031))
         lpoke(0x9091A0,0x00440000+peek(0xFF2031))
         lpoke(0x909220,0x00450000+peek(0xFF2031))
         lpoke(0x908CA4,0x00540000+peek(0xFF2032)) -- Training Mode --
         lpoke(0x908D24,0x00520000+peek(0xFF2032))
         lpoke(0x908DA4,0x00410000+peek(0xFF2032))
         lpoke(0x908E24,0x00490000+peek(0xFF2032))
         lpoke(0x908EA4,0x004E0000+peek(0xFF2032))
         lpoke(0x908F24,0x00490000+peek(0xFF2032))
         lpoke(0x908FA4,0x004E0000+peek(0xFF2032))
         lpoke(0x909024,0x00470000+peek(0xFF2032))
         lpoke(0x909124,0x004D0000+peek(0xFF2032))
         lpoke(0x9091A4,0x004F0000+peek(0xFF2032))
         lpoke(0x909224,0x00440000+peek(0xFF2032))
         lpoke(0x9092A4,0x00450000+peek(0xFF2032))
         lpoke(0x908D28,0x004F0000+peek(0xFF2033)) -- Option Mode --
         lpoke(0x908DA8,0x00500000+peek(0xFF2033))
         lpoke(0x908E28,0x00540000+peek(0xFF2033))
         lpoke(0x908EA8,0x00490000+peek(0xFF2033))
         lpoke(0x908F28,0x004F0000+peek(0xFF2033))
         lpoke(0x908FA8,0x004E0000+peek(0xFF2033))
         lpoke(0x9090A8,0x004D0000+peek(0xFF2033))
         lpoke(0x909128,0x004F0000+peek(0xFF2033))
         lpoke(0x9091A8,0x00440000+peek(0xFF2033))
         lpoke(0x909228,0x00450000+peek(0xFF2033))
         if (peek(0xFF2000)==0x00) then -- Arcade Mode Pointer --
            poke(0xFF2030,0x15)
            poke(0xFF2031,0x14)
            poke(0xFF2032,0x14)
            poke(0xFF2033,0x14)
         elseif (peek(0xFF2000)==0x01) then -- Versus Mode Pointer --
            poke(0xFF2030,0x14)
            poke(0xFF2031,0x15)
            poke(0xFF2032,0x14)
            poke(0xFF2033,0x14)
         elseif (peek(0xFF2000)==0x02) then -- Training Mode Pointer --
            poke(0xFF2030,0x14)
            poke(0xFF2031,0x14)
            poke(0xFF2032,0x15)
            poke(0xFF2033,0x14)
         elseif (peek(0xFF2000)==0x03) then -- Option Mode Pointer --
            poke(0xFF2030,0x14)
            poke(0xFF2031,0x14)
            poke(0xFF2032,0x14)
            poke(0xFF2033,0x15)
         end
         -- Control in the Menu screen --
         if ((peek(0xFF4BAB)==0x00) and (peek(0xFF4BAD)==0x00)) and (peek(0xFF2001)==0xFF) then
            poke(0xFF2001,0x00)
            poke(0xFF2021,0x00) -- Act as music 'stopper' --
         end
         if (peek(0xFF4BAB)==0x04) or (peek(0xFF4BAD)==0x04) then
            if peek(0xFF2021)==0x00 then -- Sound effect --
               poke(0x618001,0x00)
               poke(0x618003,0x71)
               poke(0x61801F,0x00)
               poke(0xFF2021,0xFF)
            end
            if (dpeek(0xFF2000)==0x0000) then
               dpoke(0xFF2000,0x01FF)
            elseif (dpeek(0xFF2000)==0x0100) then
               dpoke(0xFF2000,0x02FF)
            elseif (dpeek(0xFF2000)==0x0200) then
               dpoke(0xFF2000,0x03FF)
            elseif (dpeek(0xFF2000)==0x0300) then
               dpoke(0xFF2000,0x00FF)
            end
         end
         if (peek(0xFF4BAB)==0x08) or (peek(0xFF4BAD)==0x08) then
            if peek(0xFF2021)==0x00 then -- Sound effect --
               poke(0x618001,0x00)
               poke(0x618003,0x71)
               poke(0x61801F,0x00)
               poke(0xFF2021,0xFF)
            end
            if (dpeek(0xFF2000)==0x0000) then
               dpoke(0xFF2000,0x03FF)
            elseif (dpeek(0xFF2000)==0x0300) then
               dpoke(0xFF2000,0x02FF)
            elseif (dpeek(0xFF2000)==0x0200) then
               dpoke(0xFF2000,0x01FF)
            elseif (dpeek(0xFF2000)==0x0100) then
               dpoke(0xFF2000,0x00FF)
            end
         end
         -- Start game --
         if (peek(0x804020)==0xFE) or (peek(0x804020)==0xFD) then -- Start game --
            poke(0x618001,0x00) -- sound effect --
            poke(0x618003,0x73)
            poke(0x61801F,0x00)
            poke(0xFF2020,0x04)
         end
      end
   end
   if (peek(0xFF2020)==0x04) and ((peek(0x618003)==0x73) or (peek(0x618003)==0x00)) then -- Keep sound effect --
      poke(0xFF4C02,0x00)
      poke(0xFF4C12,0x00)
      poke(0xFF4C22,0x00)
      poke(0xFF4C32,0x00)
   end
   if (peek(0xFF2020)==0x04) and (peek(0x618003)==0x01) then -- Finished all menu work --
      poke(0xFF2020,0x00)
   end
   -- Infinity Credits Script --
   if (peek(0xFF4BDD)>0x00) then
      poke(0xFF4BDD,0x09)
   end
   -- Versus Mode Script --
   if (peek(0xFF2000)==0x01) then
      poke(0xFF48A3,0x03) -- Prevent Continue Text --
      if (peek(0xFF4885)==0x04) then
         if (peek(0xFF4003)==0x00) or (peek(0xFF4403)==0x00) then -- Activites 1P & 2P --
           poke(0xFF4881,0x03)
           poke(0xFF4912,0x03)
           poke(0xFF4003,0x01)
           poke(0xFF4403,0x01)
         end
         if (peek(0xFF4905)==0x02) and (dpeek(0xFF4910)>=0x05FF) then -- Reload previous characters --
            if peek(0xFF4051)<=0x12 then
              poke(0xFF4051,p1char1)
              poke(0xFF4900,p1char2)
            elseif peek(0xFF4051)==0x14 then
              poke (0xFF4051,0x04)
              poke (0xFF4900,0x06)
            elseif peek(0xFF4051)==0x16 then
              poke (0xFF4051,0x0E)
              poke (0xFF4900,0x08)
            elseif peek(0xFF4)==0x18 then
              poke (0xFF4051,0x02)
              poke (0xFF4900,0x06)
            end
            if peek(0xFF4451)<=0x12 then
              poke(0xFF4451,p2char1)
              poke(0xFF4902,p2char2)
            elseif peek(0xFF4451)==0x14 then
              poke (0xFF4451,0x04)
              poke (0xFF4902,0x06)
            elseif peek(0xFF4451)==0x16 then
              poke (0xFF4451,0x0E)
              poke (0xFF4902,0x08)
            elseif peek(0xFF4)==0x18 then
              poke (0xFF4451,0x02)
              poke (0xFF4902,0x06)
            end
         end
      end
      if (peek(0xFF4885)==0x0C) and (peek(0xFF4887)==0x04) and (peek(0xFF48D9)>0x00) and (peek(0xFF48D9)<=0x04) then -- Return --
         p1char1=peek(0xFF4051) -- Memorize characters --
         p1char2=peek(0xFF4900)
         p2char1=peek(0xFF4451)
         p2char2=peek(0xFF4902)
         poke(0xFF4885,0x00)
      end
   end
   -- Training Mode Script --
   if (peek(0xFF2000)==0x02) then
      if (peek(0xFF4885)==0x04) then -- Activites 1P & 2P --
         if (peek(0xFF4003)==0x00) or (peek(0xFF4403)==0x00) then
            poke(0xFF4881,0x03)
            poke(0xFF4912,0x03)
            poke(0xFF4003,0x01)
            poke(0xFF4403,0x01)
            poke(0xFF48A3,0x03) -- Prevent Continue Text --
         end
         if (peek(0xFF4905)==0x02) and (dpeek(0xFF4910)>=0x05FF) then -- Reload previous characters --
            if peek(0xFF4051)<=0x12 then
              poke(0xFF4051,p1char1)
              poke(0xFF4900,p1char2)
            elseif peek(0xFF4051)==0x14 then
              poke (0xFF4051,0x04)
              poke (0xFF4900,0x06)
            elseif peek(0xFF4051)==0x16 then
              poke (0xFF4051,0x0E)
              poke (0xFF4900,0x08)
            elseif peek(0xFF4)==0x18 then
              poke (0xFF4051,0x02)
              poke (0xFF4900,0x06)
            end
            if peek(0xFF4451)<=0x12 then
              poke(0xFF4451,p2char1)
              poke(0xFF4902,p2char2)
            elseif peek(0xFF4451)==0x14 then
              poke (0xFF4451,0x04)
              poke (0xFF4902,0x06)
            elseif peek(0xFF4451)==0x16 then
              poke (0xFF4451,0x0E)
              poke (0xFF4902,0x08)
            elseif peek(0xFF4)==0x18 then
              poke (0xFF4451,0x02)
              poke (0xFF4902,0x06)
            end
         end
         if (dpeek(0xFF4BAA)>0x0000) then -- P1 Buttons 'stopper' --
            poke(0xFF2003,0xFF)
         end
         if (dpeek(0xFF4BAA)==0x0000) then -- P1 Buttons 'resumer' --
            poke(0xFF2003,0x00)
         end
         if (dpeek(0xFF4BAC)>0x0000) then -- P2 Buttons 'stopper' --
            poke(0xFF2004,0xFF)
         end
         if (dpeek(0xFF4BAC)==0x0000) then -- P2 Buttons 'resumer' --
            poke(0xFF2004,0x00)
         end
         if ((peek(0xFF4003)==0x01) and (peek(0xFF4403)==0x01)) and (peek(0xFF4912)==0x02) and (peek(0xff2003)==0x00) then -- Switching control --
            poke(0xB0D,0x00)
            poke(0xB1D,0x01)
            poke(0xB17,0xAC)
            poke(0xB35,0xAA)
            poke(0xFF2005,01)
         end
         if ((peek(0xFF4003)==0x01) and (peek(0xFF4403)==0x01)) and (peek(0xFF4912)==0x01) and (peek(0xff2004)==0x00) then -- Switching control --
            poke(0xB0D,0x00)
            poke(0xB1D,0x01)
            poke(0xB17,0xAC)
            poke(0xB35,0xAA)
            poke(0xFF2005,02)
         end
         if (peek(0xFF4907)==0x02) and ((peek(0xFF4919)==0x00) and (peek(0xFF491B)==0x00)) then -- Restore to original --
            poke(0xB0D,0x01)
            poke(0xB1D,0x00)
            poke(0xB17,0xAA)
            poke(0xB35,0xAC)
         end
         if (peek(0xFF4907)==0x04) and (peek(0xFF2005)==0x01) and (peek(0xFF4919)==0x01) and (peek(0xff2003)==0x00) then -- Switching control --
            poke(0xB0D,0x00)
            poke(0xB1D,0x01)
            poke(0xB17,0xAC)
            poke(0xB35,0xAA)
         end
         if (peek(0xFF4907)==0x04) and (peek(0xFF2005)==0x02) and (peek(0xFF491B)==0x01) and (peek(0xff2004)==0x00) then -- Switching control --
            poke(0xB0D,0x00)
            poke(0xB1D,0x01)
            poke(0xB17,0xAC)
            poke(0xB35,0xAA)
         end
         if (peek(0xFF4919)==0x01) and (peek(0xFF491B)==0x01) then -- Restore to original, P1 or P2 stage --
            if (peek(0xFF2005)==0x01) then
               poke(0xFF4881,0x03)
               poke(0xFF4003,0x01)
               poke(0xFF4403,0x00)
            end
            if (peek(0xFF2005)==0x02) then
               poke(0xFF4881,0x03)
               poke(0xFF4003,0x00)
               poke(0xFF4403,0x01)
            end
            poke(0xB0D,0x01) -- Restore to original --
            poke(0xB1D,0x00)
            poke(0xB17,0xAA)
            poke(0xB35,0xAC)
         end
         if (peek(0xFF4905)==0x0A) then
            poke(0xFF4189,peek(0xFF4918)) -- Correct the Auto-block selection --
            poke(0xFF4589,peek(0xFF491A))
            p1char1=peek(0xFF4051) -- Memorize characters --
            p1char2=peek(0xFF4900)
            p2char1=peek(0xFF4451)
            p2char2=peek(0xFF4902)
         end
      end
      if (peek(0xFF4885)==0x08) then
         poke(0xFF48A3,0x03)
         if (peek(0xFF0040)==0x00) and ((peek(0xFF4BAE)==0x01) or (peek(0xFF4BAE)==0x02)) then -- Return to Character Select --
            poke(0xFF0040,0x01)
            poke(0xFF4885,0x00)
         end
         poke(0xFF4809,0x28) -- Battle Parameters --
         poke(0xFF4191,0x8F)
         poke(0xFF4198,0x02)
         poke(0xFF4195,0x8E)
         poke(0xFF4591,0x8F)
         poke(0xFF4598,0x02)
         poke(0xFF4595,0x8E)
      end
   end
   -- Option Mode Script --
   if (peek(0xFF2000)==0x03) and (peek(0xFF4880)==0x01) then -- Entering --
      poke(0xFF4BAF,0x02) -- Enter --
      poke(0xFF4BF7,0x02) -- English menu --
      poke(0xFF2006,0x01)
   end
   if (peek(0xFF4880)==0x00) and (peek(0xFF2006)==0x01) then -- Restart --
      poke(0xFF2000,0x03)
      poke(0xFF4BF7,region)
      poke(0xFF2020,0x03) -- Menu screen --
      poke(0xFF4BDD,0x09) -- Increase credit --
      poke(0xFF0E1D,0x00) -- Shorten text screen --
      poke(0xFF0F1D,0x00)
      poke(0xFF101D,0x00)
      poke(0xFF111D,0x00)
      poke(0xFF121D,0x00)
      poke(0xFF4BD2,0xFF) -- Hide text --
   end
   if (dpeek(0xFF4B84)==0xFFF0) and (peek(0xFF2006)==0x01) then -- Restore --
      poke(0xFF4BD2,0x90)
      poke(0xFF2006,0x00)
   end
   -- Pause Function Script --
   if (peek(0xFF4885)==0x08) and (peek(0xFF4807)==0xFF) then
      if (peek(0xFF4BAE)==0x00) then
         poke(0xFF2002,0x00)
      end
      if (peek(0xFF0040)==0x01) and ((peek(0xFF4BAE)==0x10) or (peek(0xFF4BAE)==0x20)) and (peek(0xFF2002)==0x00) then
         poke(0xFF0040,0x00)
         poke(0xFF2002,0xFF)
      end
      if (peek(0xFF0040)==0x00) and ((peek(0xFF4BAE)==0x10) or (peek(0xFF4BAE)==0x20)) and (peek(0xFF2002)==0x00) then
         poke(0xFF0040,0x01)
         poke(0xFF2002,0xFF)
      end
   end
off:
   poke(0x6B6F0,"INSERT COIN")
   poke(0xB0D,0x01)
   poke(0xB1D,0x00)
   poke(0xB17,0xAA)
   poke(0xB35,0xAC)
   lpoke(0xAF4,0x1B40CBAE)

script "Console Mode" \
 "comm:Coin button is used for pause. In training mode, pause the game and then press start to select character."
run:
   #Start-up#
   if (peek($FF4BDD)==$00)
      poke $6B6F0 "PRESS START"
      poke $B0D $01 #Restore initial value#
      poke $B1D $00
      poke $B17 $AA
      poke $B35 $AC
      lpoke $AF4 $1B40CBAE
      poke $FF2000 $00
      if (peek($804020)<$FF)and(peek($FF0060)>$00) #Start button start#
         poke $FF0040 $02
         poke $618001 $FF #Stop the opening music#
         poke $618003 $00
         poke $61801F $00
      endif
      if (peek($804020)==$FF)and(peek($FF0040)==$02) #Start button start cont.#
         poke $FF0040 $01
         poke $618001 $00 #sound effect#
         poke $618003 $70
         poke $61801F $00
         poke $FF4BDD $09 #Max Credit#
      endif
   endif
   #Title screen#
   if (dpeek($FF4B84)==$FFF0)
      if (peek($FF4BDD)>$00)and(peek($FF4880)==$00)and(peek($FFEADE)==$01)
         lpoke $AF4 $00000000 #Disable original start button#
         region=peek($FF4BF7)
         if (peek($FF2000)!=$03)
            poke $FF2000 $00 #Set Arcade Mode as default#
            if (peek($FF2020)==$00)and(peek($804020)==$FF)
               poke $FF2020 $01
            endif
            if (peek($FF2020)==$01)and((peek($804020)==$FE)or(peek($804020)==$FD)) #Leaving title screen#
               poke $FF2020 $02
               poke $618001 $00 #sound effect#
               poke $618003 $73
               poke $61801F $00
            endif
            if (peek($FF2020)==$02)and(peek($804020)==$FF)
               poke $FF2020 $03
            endif
         endif
      endif
      #Menu Screen#
      if (peek($FF4880)==$00)and(peek($FF2020)==$03)
         if (peek($804020)==$FF) #Restore original start button#
            lpoke $AF4 $1B40CBAE
         endif
         #Text display in menu#
         dpoke $FF4990 $0F78 #Shift logo and text#
         poke $FFEADE $00
         lpoke $908D1C $00410000+peek($FF2030) #Arcade Mode#
         lpoke $908D9C $00520000+peek($FF2030)
         lpoke $908E1C $00430000+peek($FF2030)
         lpoke $908E9C $00410000+peek($FF2030)
         lpoke $908F1C $00440000+peek($FF2030)
         lpoke $908F9C $00450000+peek($FF2030)
         lpoke $90909C $004D0000+peek($FF2030)
         lpoke $90911C $004F0000+peek($FF2030)
         lpoke $90919C $00440000+peek($FF2030)
         lpoke $90921C $00450000+peek($FF2030)
         lpoke $908D20 $00560000+peek($FF2031) #Versus Mode#
         lpoke $908DA0 $00450000+peek($FF2031)
         lpoke $908E20 $00520000+peek($FF2031)
         lpoke $908EA0 $00530000+peek($FF2031)
         lpoke $908F20 $00550000+peek($FF2031)
         lpoke $908FA0 $00530000+peek($FF2031)
         lpoke $9090A0 $004D0000+peek($FF2031)
         lpoke $909120 $004F0000+peek($FF2031)
         lpoke $9091A0 $00440000+peek($FF2031)
         lpoke $909220 $00450000+peek($FF2031)
         lpoke $908CA4 $00540000+peek($FF2032) #Training Mode#
         lpoke $908D24 $00520000+peek($FF2032)
         lpoke $908DA4 $00410000+peek($FF2032)
         lpoke $908E24 $00490000+peek($FF2032)
         lpoke $908EA4 $004E0000+peek($FF2032)
         lpoke $908F24 $00490000+peek($FF2032)
         lpoke $908FA4 $004E0000+peek($FF2032)
         lpoke $909024 $00470000+peek($FF2032)
         lpoke $909124 $004D0000+peek($FF2032)
         lpoke $9091A4 $004F0000+peek($FF2032)
         lpoke $909224 $00440000+peek($FF2032)
         lpoke $9092A4 $00450000+peek($FF2032)
         lpoke $908D28 $004F0000+peek($FF2033) #Option Mode#
         lpoke $908DA8 $00500000+peek($FF2033)
         lpoke $908E28 $00540000+peek($FF2033)
         lpoke $908EA8 $00490000+peek($FF2033)
         lpoke $908F28 $004F0000+peek($FF2033)
         lpoke $908FA8 $004E0000+peek($FF2033)
         lpoke $9090A8 $004D0000+peek($FF2033)
         lpoke $909128 $004F0000+peek($FF2033)
         lpoke $9091A8 $00440000+peek($FF2033)
         lpoke $909228 $00450000+peek($FF2033)
         if (peek($FF2000)==$00) #Arcade Mode Pointer#
            poke $FF2030 $15
            poke $FF2031 $14
            poke $FF2032 $14
            poke $FF2033 $14
         elsif (peek($FF2000)==$01) #Versus Mode Pointer#
            poke $FF2030 $14
            poke $FF2031 $15
            poke $FF2032 $14
            poke $FF2033 $14
         elsif (peek($FF2000)==$02) #Training Mode Pointer#
            poke $FF2030 $14
            poke $FF2031 $14
            poke $FF2032 $15
            poke $FF2033 $14
         elsif (peek($FF2000)==$03) #Option Mode Pointer#
            poke $FF2030 $14
            poke $FF2031 $14
            poke $FF2032 $14
            poke $FF2033 $15
         endif
         #Control in the Menu screen#
         if ((peek($FF4BAB)==$00)and(peek($FF4BAD)==$00))and(peek($FF2001)==$FF)
            poke $FF2001 $00
            poke $FF2021 $00 #Act as music 'stopper'#
         endif
         if (peek($FF4BAB)==$04)or(peek($FF4BAD)==$04)
            if peek($FF2021)==$00 #Sound effect#
               poke $618001 $00
               poke $618003 $71
               poke $61801F $00
               poke $FF2021 $FF
            endif
            if (dpeek($FF2000)==$0000)
               dpoke $FF2000 $01FF
            elsif (dpeek($FF2000)==$0100)
               dpoke $FF2000 $02FF
            elsif (dpeek($FF2000)==$0200)
               dpoke $FF2000 $03FF
            elsif (dpeek($FF2000)==$0300)
               dpoke $FF2000 $00FF
            endif
         endif
         if (peek($FF4BAB)==$08)or(peek($FF4BAD)==$08)
            if peek($FF2021)==$00 #Sound effect#
               poke $618001 $00
               poke $618003 $71
               poke $61801F $00
               poke $FF2021 $FF
            endif
            if (dpeek($FF2000)==$0000)
               dpoke $FF2000 $03FF
            elsif (dpeek($FF2000)==$0300)
               dpoke $FF2000 $02FF
            elsif (dpeek($FF2000)==$0200)
               dpoke $FF2000 $01FF
            elsif (dpeek($FF2000)==$0100)
               dpoke $FF2000 $00FF
            endif
         endif
         #Start game#
         if (peek($804020)==$FE)or(peek($804020)==$FD) #Start game#
            poke $618001 $00 #sound effect#
            poke $618003 $73
            poke $61801F $00
            poke $FF2020 $04
         endif
      endif
   endif
   if (peek($FF2020)==$04)and((peek($618003)==$73)or(peek($618003)==$00)) #Keep sound effect#
      poke $FF4C02 $00
      poke $FF4C12 $00
      poke $FF4C22 $00
      poke $FF4C32 $00
   endif
   if (peek($FF2020)==$04)and(peek($618003)==$01) #Finished all menu work#
      poke $FF2020 $00
   endif
   #Infinity Credits Script#
   if (peek($FF4BDD)>$00)
      poke $FF4BDD $09
   endif
   #Versus Mode Script#
   if (peek($FF2000)==$01)
      poke $FF48A3 $03 #Prevent Continue Text#
      if (peek($FF4885)==$04)and((peek($FF4003)==$00)or(peek($FF4403)==$00)) #Player Select Screen#
         poke $FF4881 $03
         poke $FF4912 $03
         poke $FF4003 $01
         poke $FF4403 $01
      endif
      if (peek($FF4885)==$0C)and(peek($FF4887)==$04)and(peek($FF48D9)>$00)and(peek($FF48D9)<=$04) #Return#
         poke $FF4885 $00
      endif
   endif
   #Training Mode Script#
   if (peek($FF2000)==$02)
      if (peek($FF4885)==$04) #Player Select Screen#
         if (peek($FF4003)==$00)or(peek($FF4403)==$00)
            poke $FF4881 $03
            poke $FF4912 $03
            poke $FF4003 $01
            poke $FF4403 $01
            poke $FF48A3 $03 #Prevent Continue Text#
         endif
         if (dpeek($FF4BAA)>$0000) #P1 Buttons 'stopper'#
            poke $FF2003 $FF
         endif
         if (dpeek($FF4BAA)==$0000) #P1 Buttons 'resumer'#
            poke $FF2003 $00
         endif
         if (dpeek($FF4BAC)>$0000) #P2 Buttons 'stopper'#
            poke $FF2004 $FF
         endif
         if (dpeek($FF4BAC)==$0000) #P2 Buttons 'resumer'#
            poke $FF2004 $00
         endif
         if ((peek($FF4003)==$01)and(peek($FF4403)==$01))and(peek($FF4912)==$02)and(peek($ff2003)==$00) #Switching control#
            poke $B0D $00
            poke $B1D $01
            poke $B17 $AC
            poke $B35 $AA
            poke $FF2005 01
         endif
         if ((peek($FF4003)==$01)and(peek($FF4403)==$01))and(peek($FF4912)==$01)and(peek($ff2004)==$00) #Switching control#
            poke $B0D $00
            poke $B1D $01
            poke $B17 $AC
            poke $B35 $AA
            poke $FF2005 02
         endif
         if (peek($FF4907)==$02)and((peek($FF4919)==$00)and(peek($FF491B)==$00)) #Restore to original#
            poke $B0D $01
            poke $B1D $00
            poke $B17 $AA
            poke $B35 $AC
         endif
         if (peek($FF4907)==$04)and(peek($FF2005)==$01)and(peek($FF4919)==$01)and(peek($ff2003)==$00) #Switching control#
            poke $B0D $00
            poke $B1D $01
            poke $B17 $AC
            poke $B35 $AA
         endif
         if (peek($FF4907)==$04)and(peek($FF2005)==$02)and(peek($FF491B)==$01)and(peek($ff2004)==$00) #Switching control#
            poke $B0D $00
            poke $B1D $01
            poke $B17 $AC
            poke $B35 $AA
         endif
         if (peek($FF4919)==$01)and(peek($FF491B)==$01) #Restore to original, P1 or P2 stage#
            if (peek($FF2005)==$01)
               poke $FF4881 $03
               poke $FF4003 $01
               poke $FF4403 $00
            endif
            if (peek($FF2005)==$02)
               poke $FF4881 $03
               poke $FF4003 $00
               poke $FF4403 $01
            endif
            poke $B0D $01 #Restore to original#
            poke $B1D $00
            poke $B17 $AA
            poke $B35 $AC
         endif
         if (peek($FF4905)==$0A) #Correct the Auto-block selection#
            poke $FF4189 peek($FF4918)
            poke $FF4589 peek($FF491A)
         endif
      endif
      if (peek($FF4885)==$08)
         poke $FF48A3 $03
         if (peek($FF0040)==$00)and((peek($FF4BAE)==$01)or(peek($FF4BAE)==$02)) #Return to Character Select#
            poke $FF0040 $01
            poke $FF4885 $00
         endif
         poke $FF4809 $28 #Battle Parameters#
         poke $FF4191 $8F
         poke $FF4198 $02
         poke $FF4195 $8E
         poke $FF4591 $8F
         poke $FF4598 $02
         poke $FF4595 $8E
      endif
   endif
   #Option Mode Script#
   if (peek($FF2000)==$03)and(peek($FF4880)==$01) #Entering#
      poke $FF4BAF $02 #Enter#
      poke $FF4BF7 $02 #English menu#
      poke $FF2006 $01
   endif
   if (peek($FF4880)==$00)and(peek($FF2006)==$01) #Restart#
      poke $FF2000 $03
      poke $FF4BF7 region
      poke $FF2020 $03 #Menu screen#
      poke $FF4BDD $09 #Increase credit#
      poke $FF0E1D $00 #Shorten text screen#
      poke $FF0F1D $00
      poke $FF101D $00
      poke $FF111D $00
      poke $FF121D $00
      poke $FF4BD2 $FF #Hide text#
   endif
   if (dpeek($FF4B84)==$FFF0)and(peek($FF2006)==$01) #Restore#
      poke $FF4BD2 $90
      poke $FF2006 $00
   endif
   #Pause Function Script#
   if (peek($FF4885)==$08)and(peek($FF4807)==$FF)
      if (peek($FF4BAE)==$00)
         poke $FF2002 $00
      endif
      if (peek($FF0040)==$01)and((peek($FF4BAE)==$10)or(peek($FF4BAE)==$20))and(peek($FF2002)==$00)
         poke $FF0040 $00
         poke $FF2002 $FF
      endif
      if (peek($FF0040)==$00)and((peek($FF4BAE)==$10)or(peek($FF4BAE)==$20))and(peek($FF2002)==$00)
         poke $FF0040 $01
         poke $FF2002 $FF
      endif
   endif
off:
   poke $6B6F0 "INSERT COIN"
   poke $B0D $01
   poke $B1D $00
   poke $B17 $AA
   poke $B35 $AC
   lpoke $AF4 $1B40CBAE

script "Enable Bosses" \
"comm:Highlight Colossus, Psylocke or Silver Samurai and hold the down button, then press any buttons to select the bosses"
run:
if (peek($FF4885)==$04)
  #For Bosses P1#
  if (peek($FF4912)==$01)or(peek($FF4912)==$03)
   if (peek($FF4900)<=$04) #Buttons 'stopper'#
    poke $FF2010 $FF
   endif
   if (peek($FF4900)>=$05)and(peek($FF4BAB)==$00) #Buttons 'resumer'#
    poke $FF2010 $00
   endif
   if (peek($FF4900)==$07)and(peek($FF2010)==$00)and(peek($FF4BAB)==$04)
    p1char=peek($FF4900)
    poke $FF4900 $0C
   endif
   if (peek($FF4900)==$06)and(peek($FF4BAB)==$04)and(peek($FF2010)==$00)
    p1char=peek($FF4900)
    poke $FF4900 $0A
   endif
   if (peek($FF4900)==$08)and(peek($FF4BAB)==$04)and(peek($FF2010)==$00)
    p1char=peek($FF4900)
    poke $FF4900 $0B
   endif
   if (peek($FF4900)>=$0A)and(peek($FF4BAB)==$00)
    poke $FF4900 p1char
   endif
  endif
  #For Bosses P2#
  if (peek($FF4912)==$02)or(peek($FF4912)==$03)
   if (peek($FF4902)<=$04) #Buttons 'stopper'#
    poke $FF2011 $FF
   endif
   if (peek($FF4902)>=$05)and(peek($FF4BAD)==$00) #Buttons 'resumer'#
    poke $FF2011 $00
   endif
   if (peek($FF4902)==$07)and(peek($FF2011)==$00)and(peek($FF4BAD)==$04)
    p2char=peek($FF4902)
    poke $FF4902 $0C
   endif
   if (peek($FF4902)==$06)and(peek($FF4BAD)==$04)and(peek($FF2011)==$00)
    p2char=peek($FF4902)
    poke $FF4902 $0A
   endif
   if (peek($FF4902)==$08)and(peek($FF4BAD)==$04)and(peek($FF2011)==$00)
    p2char=peek($FF4902)
    poke $FF4902 $0B
   endif
   if (peek($FF4902)>=$0A)and(peek($FF4BAD)==$00)
    poke $FF4902 p2char
   endif
  endif
endif
#Boss Battle & Ending Fix in Arcade Mode#
if peek($FF2000)==$00
    if (peek($FF4003)==$01)and(peek($FF4403)==$00)
      if (peek($FF4900)==$0B) #Fix for P1 Magneto Play#
       poke $FF4923 $18
      endif
      if (peek($FF4900)!=$0B) #Normal case for P1 Play#
       poke $FF4923 $16
      endif
      if (peek($FF4900)==$0B)and(peek($FF4451)==$18) #Fix for P1 Akuman Stage Select & Magneto Ending#
       poke $FF488F $0B
       if (peek($FF4885)==$1C)and(peek($FF4887)==$02)and(peek($FF2464)==$0F)
       poke $FF4887 $0A
       endif
      endif
      if (peek($FF4900)==$0A)and(peek($FF4451)==$16) #Fix for P1 Juggernaut Ending#
       if (peek($FF4885)==$1C)and(peek($FF4887)==$02)and(peek($FF2464)==$0F)
       poke $FF4887 $0A
       endif
      endif
    endif
    if (peek($FF4003)==$00)and(peek($FF4403)==$01)
      if (peek($FF4902)==$0B) #Fix for P2 Magneto Play#
       poke $FF4923 $18
      endif
      if (peek($FF4902)!=$0B) #Normal case for P2 Play#
       poke $FF4923 $16
      endif
      if (peek($FF4902)==$0B)and(peek($FF4051)==$18) #Fix for P2 Akuman Stage Select & Magneto Ending#
       poke $FF488F $0B
       if (peek($FF4885)==$1C)and(peek($FF4887)==$02)and(peek($FF2464)==$0F)
       poke $FF4887 $0A
       endif
      endif
      if (peek($FF4902)==$0A)and(peek($FF4051)==$16) #Fix for P2 Juggernaut Ending#
       if (peek($FF4885)==$1C)and(peek($FF4887)==$02)and(peek($FF2464)==$0F)
       poke $FF4887 $0A
       endif
      endif
    endif
endif
#Skip Boss intro for human player#
if (peek($FF488F)==$0B)and(peek($FF4003)==$01)and(peek($FF4403)==$01)
    if (peek($FF4011)==$B0)and(peek($FF4005)!=$02)
    poke $FF4001 $00
    lpoke $FF400A $000E0100
    endif
    if (dpeek($FF4010)==$0115)
    poke $FF4001 $01
    endif
    if (peek($FF4411)==$B0)and(peek($FF4405)!=$02)
    poke $FF4401 $00
    lpoke $FF440A $000E0200
    endif
    if (dpeek($FF4410)==$0115)
    poke $FF4401 $01
    endif
endif
#Enable Bosses stage in versus mode#
if (peek($FF2000)==$01)
    if (peek($FF4885)==$04)and(peek($FF4919)==$01)and(peek($FF491B)==$01)
      if rnd()<=127
       poke $FF4003 $01
       poke $FF4403 $00
      else
       poke $FF4003 $00
       poke $FF4403 $01
      endif
    endif
      if (peek($FF4905)==$0A) #Correct the Auto-block selection#
        poke $FF4189 peek($FF4918)
        poke $FF4589 peek($FF491A)
      endif
endif

script "Infinite Time"
run:
    poke $FF4808 $99
script "Finish this Round Now!" \
 "comm:Disable Infinite Time before activating this cheat"
on:
    poke $FF4808 $00
script "Invincibility [Master Code]"
on:
    temp0=lpeek($014F4A)
    temp1=dpeek($014F4E)
    temp2=lpeek($014F50)
    temp3=lpeek($014F54)
    temp4=dpeek($014F58)
    temp5=lpeek($014F5A)
    temp6=dpeek($014F5E)
    temp7=lpeek($014F60)
    temp8=dpeek($014F64)
    temp9=lpeek($014F66)
    temp10=lpeek($014F6A)
    temp11=dpeek($014F6E)
    temp12=lpeek($014F70)
    temp13=dpeek($014F74)
    temp14=dpeek($014F76)
    temp15=lpeek($00C02A)
    temp16=dpeek($00C02E)
    temp17=lpeek($1B2DC4)
    temp18=lpeek($1B2DC8)
    temp19=dpeek($1B2DCC)
    temp20=lpeek($1B2DCE)
    temp21=dpeek($1B2DD2)
    temp22=lpeek($1B2DD4)
    temp23=dpeek($1B2DD8)
    temp24=lpeek($1B2DDA)
    temp25=dpeek($1B2DDE)
    temp26=dpeek($1B2DE0)
run:
    lpoke $014F4A $4A2DC055
    dpoke $014F4E $6610
    lpoke $014F50 $610000EC
    lpoke $014F54 $4A6DC086
    dpoke $014F58 $6706
    lpoke $014F5A $4DEDC000
    dpoke $014F5E $6142
    lpoke $014F60 $4A2DC455
    dpoke $014F64 $6610
    lpoke $014F66 $6100004C
    lpoke $014F6A $4A6DC486
    dpoke $014F6E $6706
    lpoke $014F70 $4DEDC400
    dpoke $014F74 $612C
    dpoke $014F76 $4E75
    lpoke $00C02A $4EF9001B
    dpoke $00C02E $2DC4
    lpoke $1B2DC4 $BDCC6C12
    lpoke $1B2DC8 $4A2DC455
    dpoke $1B2DCC $6612
    lpoke $1B2DCE $223C02FF
    dpoke $1B2DD2 $01FF
    lpoke $1B2DD4 $4EF90000
    dpoke $1B2DD8 $C030
    lpoke $1B2DDA $4A2DC055
    dpoke $1B2DDE $67EE
    dpoke $1B2DE0 $4E75
off:
    lpoke $014F4A temp0
    dpoke $014F4E temp1
    lpoke $014F50 temp2
    lpoke $014F54 temp3
    dpoke $014F58 temp4
    lpoke $014F5A temp5
    dpoke $014F5E temp6
    lpoke $014F60 temp7
    dpoke $014F64 temp8
    lpoke $014F66 temp9
    lpoke $014F6A temp10
    dpoke $014F6E temp11
    lpoke $014F70 temp12
    dpoke $014F74 temp13
    dpoke $014F76 temp14
    lpoke $00C02A temp15
    dpoke $00C02E temp16
    lpoke $1B2DC4 temp17
    lpoke $1B2DC8 temp18
    dpoke $1B2DCC temp19
    lpoke $1B2DCE temp20
    dpoke $1B2DD2 temp21
    lpoke $1B2DD4 temp22
    dpoke $1B2DD8 temp23
    lpoke $1B2DDA temp24
    dpoke $1B2DDE temp25
    dpoke $1B2DE0 temp26
script "Hit Anywhere (Both Players)"
on:
    temp0=dpeek($01510E)
run:
    dpoke $01510E $6002
off:
    dpoke $01510E temp0
script "Challenge Gouki Surely" \
 "comm:Just Before Juggernaut"
on:
    temp0=peek($FF4921)
run:
    poke $FF4921 $18
off:
    poke $FF4921 temp0
script "Select Background" \
 "0x00/Wolverine"\
 "0x01/Psylocke"\
 "0x02/Colossus"\
 "0x03/Cyclops/Gouki"\
 "0x04/Storm"\
 "0x05/Iceman"\
 "0x06/Spiral"\
 "0x07/Silver Samurai"\
 "0x08/Omega Red"\
 "0x09/Sentinel"\
 "0x0A/Juggernaut"\
 "0x0B/Magneto"
run:
    poke $FF488F param
script " "
script "P1 Infinite Energy"
run:
    poke $FF4191 $8F
script "P1 Drain All Energy Now!"
on:
    poke $FF4191 $00
script "P1 Invincibility" \
 "comm:Works after you've enabled 'Invincibility [Master Code]'"
on:
    temp0=peek($FF4055)
run:
    poke $FF4055 $FF
off:
    poke $FF4055 temp0
script "P1 Never Faint"
run:
    poke $FF40FD $00
script "P1 Action Speed Up"
run:
    poke $FF403F $01
script "P1 Always have Max Power"
run:
    poke $FF4198 $02
    poke $FF4195 $8E
script "P1 Always have Min Power"
run:
    poke $FF4198 $00
    poke $FF4195 $00
script "P1 Get Max Power Now!"
on:
    poke $FF4198 $02
    poke $FF4195 $8E
script "P1 Get Min Power Now!"
on:
    poke $FF4198 $00
    poke $FF4195 $00
script "P1 Select Character" \
 "0x00/Wolverine"\
 "0x02/Psylocke"\
 "0x04/Colossus"\
 "0x06/Cyclops"\
 "0x08/Storm"\
 "0x0A/Iceman"\
 "0x0C/Spiral"\
 "0x0E/Silver Samurai"\
 "0x10/Omega Red"\
 "0x12/Sentinel"\
 "0x14/#Juggernaut"\
 "0x16/#Magneto"\
 "0x18/#Gouki"
run:
    poke $FF4051 param
script " "
script "P2 Infinite Energy"
run:
    poke $FF4591 $8F
script "P2 Drain All Energy Now!"
on:
    poke $FF4591 $00
script "P2 Invincibility" \
 "comm:Works after you've enabled 'Invincibility [Master Code]'"
on:
    temp0=peek($FF4455)
run:
    poke $FF4455 $FF
off:
    poke $FF4455 temp0
script "P2 Never Faint"
run:
    poke $FF44FD $00
script "P2 Action Speed Up"
run:
    poke $FF443F $01
script "P2 Always have Max Power"
run:
    poke $FF4598 $02
    poke $FF4595 $8E
script "P2 Always have Min Power"
run:
    poke $FF4598 $00
    poke $FF4595 $00
script "P2 Get Max Power Now!"
on:
    poke $FF4598 $02
    poke $FF4595 $8E
script "P2 Get Min Power Now!"
on:
    poke $FF4598 $00
    poke $FF4595 $00
script "P2 Select Character" \
 "0x00/Wolverine"\
 "0x02/Psylocke"\
 "0x04/Colossus"\
 "0x06/Cyclops"\
 "0x08/Storm"\
 "0x0A/Iceman"\
 "0x0C/Spiral"\
 "0x0E/Silver Samurai"\
 "0x10/Omega Red"\
 "0x12/Sentinel"\
 "0x14/#Juggernaut"\
 "0x16/#Magneto"\
 "0x18/#Gouki"
run:
    poke $FF4451 param
script " "
script "No Background Music"
run:
    cpu audio
    dpoke $F018 $0000
    cpu main
script "Hide Background"
on:
    temp0=dpeek($FF4BCC)
    temp1=dpeek($FF4BCE)
    temp2=dpeek($FFEADC)
    temp3=dpeek($FFEADE)
run:
    if (peek($FF4800)==$04)
      dpoke $FF4BCC $0
      dpoke $FF4BCE $0
      dpoke $FFEADC $0
      dpoke $FFEADE $0
      lpoke $FFD20E $0
    endif
off:
    dpoke $FF4BCC temp0
    dpoke $FF4BCE temp1
    dpoke $FFEADC temp2
    dpoke $FFEADE temp3
script "White background"
run:
    poke $FFEE75 $1
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/Euro"\
 "0x06/ASIA"\
 "0x08/Hispanic"\
 "0x0A/Brazil"
run:
    poke $FF4BF7 param
script "Display Hidden Debug EDIT MENU" \
 "comm:Activate on the TEST MENU (F2)."
run:
    poke $FFEAEB $E5