Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local BIZ = false -- set to false for Snes9x
- local confirm_button = 4 -- see below (X=3,A=4)
- local button = {'R','L','X','A','right','left','down','up','start','select','Y','B'}
- if BIZ then
- button = {'P1 R','P1 L','P1 X','P1 A','P1 Right','P1 Left','P1 Down','P1 Up','P1 Start','P1 Select','P1 Y','P1 B'}
- end
- function ReadByte(i)
- if BIZ then return mainmemory.read_u8(i)
- else return memory.readbyte(0x7e0000 + i) end
- end
- function Pause()
- if BIZ then return client.pause()
- else return emu.pause() end
- end
- local autoText = {[button[confirm_button]]=true}
- local gametime = ReadByte(0x0400)
- local tapheld = false
- local tapframe = 0
- local tapcount = 0
- while true do
- emu.frameadvance()
- userin = joypad.get()
- if tapcount % 2 == 1 then
- if tapframe < 30 then
- tapframe = tapframe + 1
- else
- tapframe = 0
- tapcount = tapcount + 1
- end
- end
- if userin[button[confirm_button]] then
- if tapheld == false then
- if tapcount % 2 == 1 then
- print(tapframe)
- tapframe = 0
- end
- tapcount = tapcount + 1
- tapheld = true
- end
- else tapheld = false end
- if gametime == ReadByte(0x0400) and userin[button[10]] then
- Pause()
- end
- gametime = ReadByte(0x0400)
- if ReadByte(0x0129) == 7 and userin[button[10]] then
- joypad.set(autoText)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement