diff --git a/kodiak.tal b/kodiak.tal index 8af6f67..23c8782 100644 --- a/kodiak.tal +++ b/kodiak.tal @@ -231,13 +231,21 @@ .Mouse/state DEI ( state^ ) .prev/mouse-state LDZ #ff EOR AND ( down^ ) #01 AND ?&ok JMP2r &ok + ( TODO: when already holding, different behavior ) + .dragging LDZ ?release maybe-select-stock ?&found maybe-select-waste ?&found maybe-select-tableau ?&found - ( not found ) - .dragging #05 initialize + ( not found ) .dragging #05 initialize &found JMP2r +@release ( -> ) + .held LDZ2 SWP ( last^ first^ ) + &loop DUP LDZk #80 EOR SWP STZ ( last^ first ; first<-c^0x80 ) + INC LTHk #00 EQU ?&loop ( last^ first+1^ ) + POP2 .dragging #05 initialize ( ) + #0000 .held STZ2 JMP2r ( ) + @find-top ( lim^ start^ -> zp^ ) &loop LDZk ?&ok !&done &ok INC GTHk ?&loop &done NIP #01 SUB JMP2r