Masterjun

b_april-script.lua

Mar 31st, 2017
283
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local useaddr = 0x0060
  2.  
  3. local t = {}
  4. local function createdata()
  5.   local data = "18 FB D8"
  6.   data = data:gsub(" ","")
  7.  
  8.   local wdata = "9C 00 42 A9 00 48 AB A9 3E 8D 1C 02 A9 96 8D 1D 02 A9 9B 8D A5 02 A9 64 8D A9 02 A9 D2 8D AD 02 A9 80 8D D9 02 8D DD 02 A9 66 8D 15 03 A9 56 8D 11 03 A9 9D 8D 79 02 A9 95 8D 7D 02 AD 12 42 30 FB AD 12 42 10 FB 20 49 84 C2 30 A5 F0 A2 00 00 DF 42 10 00 B0 08 1A 85 F0 FC 4C 10 80 04 E8 E8 80 EE E2 30 A5 24 8D 12 21 A5 25 8D 12 21 A5 1C 8D 0E 21 A5 1D 8D 0E 21 A5 1E 8D 0F 21 A5 1F 8D 0F 21 80 B8 30 00 80 00 F0 00 50 01 00 02 56 10 5F 10 87 10 6A 10 FC 10 A9 0E 00 8D 40 21 E6 24 60 A9 20 00 8D 40 21 C6 1C C6 1C 60 E2 30 A9 80 8D 42 21 E6 F4 A5 F4 C9 06 D0 0C 64 F4 E6 F5 A9 0F 38 E5 F5 8D 00 21 C2 30 E6 F2 A5 F2 18 65 1E 85 1E A0 01 00 A2 12 00 5A 7A F0 06 BF D4 10 00 80 04 BF E8 10 00 8F AF 10 00 8F BC 10 00 E2 30 AD 00 00 5A 7A F0 04 1A 1A 80 02 3A 3A 8D 00 00 C2 30 CA CA 10 D2 88 F0 CC E2 30 A9 14 8D 43 21 20 49 84 C2 30 60 1C 02 DD 02 79 02 11 03 DC 02 AD 03 AC 03 A9 02 10 03 14 03 D9 02 15 03 7D 02 55 02 AC 02 A4 02 D8 02 04 03 AD 02 A8 02 9C AE 0D E2 30 A5 F6 D0 19 64 F0 64 F1 64 F2 64 F3 A9 0C 8D 42 21 A9 27 8D 00 01 A9 A1 8D 00 42 E6 F6 20 22 93 64 10 A5 10 F0 FC 20 3B 11 80 D5 E2 30 A9 18 8D 00 01 A9 08 8D C6 13 20 72 80 C2 30 E6 F0 A5 F0 C9 A0 00 90 32 C9 18 01 90 30 C9 40 01 90 28 C9 80 01 90 29 C9 A0 01 90 1E C9 A7 01 90 22 C9 C3 01 90 20 C9 20 02 90 0F C9 28 02 90 19 C9 46 02 90 17 C9 47 02 90 B4 E2 30 60 4C 8D 11 4C EF 11 4C 37 12 4C 6E 12 4C A2 12 4C CC 12 4A B0 E8 0A 38 E9 A0 00 4A AA 18 69 20 50 8D 16 21 E2 30 A9 39 EB BF B3 11 00 A0 80 8C 15 21 C2 30 8D 18 21 80 C5 1F 01 53 56 1D 1F 53 47 48 52 1F 56 40 52 1F 40 4B 4B 1F 52 42 51 48 4F 53 44 43 1F 4E 4D 1F 1F 1F 1F 1F 53 47 40 53 1F 4B 40 52 53 1F 45 51 40 4C 44 1F 4E 45 1F 48 4D 4F 54 53 1A 4A B0 86 0A 38 E9 40 01 4A AA 18 69 A0 50 8D 16 21 E2 30 A9 39 EB BF 16 12 00 A0 80 8C 15 21 C2 30 8D 18 21 E2 30 60 1F 0F 51 40 48 52 44 1F 53 47 44 1F 12 0D 04 12 1F 44 57 4F 40 4D 52 48 4E 4D 1F 4F 4E 51 53 1A 01 38 E9 A0 01 0A C9 06 00 F0 2A 90 01 3A 18 69 EA 50 8D 16 21 48 E2 30 A0 80 8C 15 21 A9 28 8D 19 21 C2 30 68 18 69 20 00 8D 16 21 E2 30 A9 28 8D 19 21 C2 30 E2 30 60 4A B0 FA 0A 38 E9 A7 01 4A AA 18 69 49 51 8D 16 21 E2 30 A9 39 EB BF 94 12 00 A0 80 8C 15 21 C2 30 8D 18 21 80 D7 48 4D 1F 67 64 1B 6A 68 1D 1F 47 54 47 1E 4A B0 C6 0A 38 E9 20 02 4A AA 18 69 CE 51 8D 16 21 E2 30 A9 39 EB BF C8 12 00 A0 80 8C 15 21 C2 30 8D 18 21 80 A3 4E 4E 4F 52 38 E9 28 02 AA 18 69 20 53 8D 16 21 E2 30 A9 39 EB BF EE 12 00 A0 80 8C 15 21 C2 30 8D 18 21 E2 30 60 1F 1F 56 44 1F 45 4E 51 46 4E 53 1F 53 47 44 1F 40 42 53 54 40 4B 1F 42 51 44 43 48 53 52 34"
  9.   wdata = wdata:gsub(" ","")
  10.   if #wdata%4 ~= 0 then wdata=wdata.."00" end
  11.  
  12.   local addr = 0x0FBE
  13.   data=data.."C220"
  14.   for i=1,#wdata,4 do
  15.     data=data.."A9"..wdata:sub(i,i+3).."8D"..string.format("%02X%02X",(addr+i//2)&0xFF,((addr+i//2)>>8)&0xFF)
  16.     --if i>1 and (((i-1)/4)*6)%102==0 then data=data.."4C8421" end
  17.   end
  18.   data=data.."E2205C"..string.format("%02X%02X",addr&0xFF,(addr>>8)&0xFF)
  19.  
  20.   --print(data)
  21.  
  22.   t = {}
  23.   for i=1,#data,2 do
  24.     table.insert(t,tonumber(data:sub(i,i+1),16))
  25.   end
  26. end
  27.  
  28. function on_input()
  29.   if movie.currentframe()==2510 then createdata() end
  30. end
  31.  
  32. local function write4()
  33.   memory.writebyte("WRAM",useaddr,t[1] or 0)
  34.   memory.writebyte("WRAM",useaddr+1,t[2] or 0)
  35.   memory.writebyte("WRAM",useaddr+2,t[3] or 0)
  36.   memory.writebyte("WRAM",useaddr+3,t[4] or 0)
  37. end
  38.  
  39.  
  40. memory.registerexec("BUS",0x4219,function()
  41.   write4()
  42.   memory.setregister("pc",useaddr)
  43. end)
  44.  
  45. for i=0,3 do
  46.   memory.registerexec("WRAM",useaddr+i,function()
  47.     table.remove(t,1)
  48.     write4()
  49.     memory.setregister("pc",useaddr)
  50.   end)
  51. end
RAW Paste Data