fix(input): #87 key_pressed/key_released edges never fired under the frame loop
Since #83 the loop commits the device layer once per frame (input_drive), but a game that ALSO called Input.poll by hand committed a second time in the same frame; input_device_commit copies in_held into in_prev at the top of every commit, so the second commit left in_prev == in_held and the edges (held && !prev) could never see a transition. Fix: an in_have_frame_driver flag. The loop's input_drive sets it; a manual Input.poll under the loop then becomes a no-op returning the frame's key instead of re-committing. An entry-driven harness has no loop, so the flag stays false and each Input.poll commits a frame as before (the #7/#50 record/replay + device tests are unchanged). Frame loop now calls input_drive. Example input_edge (press edge on the down frame, release edge on the up frame). Full suite 110/0, goldens byte-identical, fixpoint holds. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
bdf1a97550
commit
0497029dae
6 changed files with 64 additions and 12 deletions
|
|
@ -9471,8 +9471,8 @@ declare void @hs_free(i32)
|
|||
@.str9299 = private unnamed_addr constant [9 x i8] c" br i1 \00"
|
||||
@.str9300 = private unnamed_addr constant [28 x i8] c", label %body, label %done\0A\00"
|
||||
@.str9301 = private unnamed_addr constant [7 x i8] c"body:\0A\00"
|
||||
@.str9302 = private unnamed_addr constant [11 x i8] c"input_poll\00"
|
||||
@.str9303 = private unnamed_addr constant [26 x i8] c"call i32 @fn_input_poll()\00"
|
||||
@.str9302 = private unnamed_addr constant [12 x i8] c"input_drive\00"
|
||||
@.str9303 = private unnamed_addr constant [27 x i8] c"call i32 @fn_input_drive()\00"
|
||||
@.str9304 = private unnamed_addr constant [13 x i8] c" store i32 \00"
|
||||
@.str9305 = private unnamed_addr constant [14 x i8] c", ptr @L_key\0A\00"
|
||||
@.str9306 = private unnamed_addr constant [8 x i8] c"rt_poll\00"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue