From 946f05bd3e5bd115ed8d39813d54df6324e60b07 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Mon, 7 May 2018 16:20:59 +0200 Subject: [PATCH] base timed inputs on start of trial time --- main.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.lua b/main.lua index f742719..91334c7 100644 --- a/main.lua +++ b/main.lua @@ -856,6 +856,7 @@ local function do_reset() jp = nil screen_scroll_delta = 0 + trial_frames = 0 emu.frameadvance() -- prevents emulator from quirking up. load_next_trial() @@ -942,7 +943,7 @@ local function doit(dummy) if cfg.time_inputs then for i=2,5 do - local v = band(total_frames, lshift(1, i)) == 0 and -256 or 256 + local v = band(trial_frames, lshift(1, i)) == 0 and -256 or 256 insert(extra_input, v) end end @@ -1001,6 +1002,7 @@ local function doit(dummy) nn.reshape(X, 1, gcfg.input_size) nn.reshape(tile_input, 1, gcfg.tile_count) + trial_frames = trial_frames + cfg.frameskip if cfg.enable_network and get_state() == 'playing' or ingame_paused then total_frames = total_frames + cfg.frameskip