add fast unsafe sendinput for roms

This commit is contained in:
Redo 2022-11-19 16:04:58 -06:00
parent 7cb6e531c5
commit 3baf0071cb
2 changed files with 8 additions and 10 deletions

View File

@ -157,5 +157,5 @@ function lualogic_rom_updatedata_final(%brick) {
// send output // send output
//talk("rom" SPC %brick SPC %data_str); //talk("rom" SPC %brick SPC %data_str);
lualogic_sendinput(%brick, 1, %data_str); lualogic_sendinput_raw(%brick, 1, %data_str);
} }

View File

@ -131,16 +131,14 @@ function lualogic_savedata(){
lualogic_send("SAVE"); lualogic_send("SAVE");
} }
function lualogic_sendinput(%gate, %argc, %arg0, %arg1, %arg2, %arg3, %arg4, %arg5, %arg6, %arg7, %arg8, %arg9, %arg10, %arg11, %arg12, %arg13, %arg14, %arg15) function lualogic_sendinput(%gate, %argc, %arg0, %arg1, %arg2, %arg3, %arg4, %arg5, %arg6, %arg7, %arg8, %arg9, %arg10, %arg11, %arg12, %arg13, %arg14, %arg15) {
{
%args = lualogic_expandescape(%arg0); %args = lualogic_expandescape(%arg0);
for(%i = 1; %i < %argc; %i++) for(%i = 1; %i < %argc; %i++) { %args = %args @ ";" @ lualogic_expandescape(%arg[%i]); }
%args = %args @ ";" @ lualogic_expandescape(%arg[%i]); lualogic_sendinput_raw(%gate, %argc, %args);
}
if(%argc > 0) function lualogic_sendinput_raw(%gate, %argc, %args) {
lualogic_send("IN;" @ %gate.getID() @ ";" @ %argc @ ";" @ %args); if(%argc > 0) { lualogic_send("IN;" @ %gate.getID() @ ";" @ %argc @ ";" @ %args); }
else else { lualogic_send("IN;" @ %gate.getID() @ ";0"); }
lualogic_send("IN;" @ %gate.getID() @ ";" @ %argc);
} }
function lualogic_ss(%obj, %state) function lualogic_ss(%obj, %state)