2012-02-01 22:02:26 +00:00
|
|
|
---------------------------------------------------------------------------
|
|
|
|
-- Swap 1P and 2P buttons at Selected frames
|
2012-02-18 16:43:40 +00:00
|
|
|
-- by AnS, 2012
|
2012-02-01 22:02:26 +00:00
|
|
|
---------------------------------------------------------------------------
|
|
|
|
-- Showcases following functions:
|
|
|
|
-- * taseditor.getselection()
|
|
|
|
-- * taseditor.clearinputchanges()
|
|
|
|
-- * taseditor.getinput()
|
|
|
|
-- * taseditor.submitinputchange()
|
|
|
|
-- * taseditor.applyinputchanges()
|
|
|
|
---------------------------------------------------------------------------
|
|
|
|
-- Usage:
|
|
|
|
-- Use the script when you want to exchange recorded input between joypads.
|
|
|
|
-- Run the script, unpause emulation (or simply Frame Advance once).
|
|
|
|
-- Now you can select several frames of input data and then
|
|
|
|
-- press "Run function" button to swap inputs of 1P and 2P.
|
2012-02-06 16:57:46 +00:00
|
|
|
-- You can easily modify the script to swap any other joypads.
|
2012-02-01 22:02:26 +00:00
|
|
|
---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
function swap()
|
|
|
|
selection_table = taseditor.getselection();
|
|
|
|
if (selection_table ~= nil) then
|
|
|
|
taseditor.clearinputchanges();
|
|
|
|
for i = 1, #selection_table do
|
|
|
|
selected_frame = selection_table[i];
|
|
|
|
joypad1data = taseditor.getinput(selected_frame, 1);
|
|
|
|
joypad2data = taseditor.getinput(selected_frame, 2);
|
|
|
|
taseditor.submitinputchange(selected_frame, 1, joypad2data);
|
|
|
|
taseditor.submitinputchange(selected_frame, 2, joypad1data);
|
|
|
|
end
|
|
|
|
taseditor.applyinputchanges("Swap 1P/2P");
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
taseditor.registermanual(swap);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|