Closed twarmboe closed 7 years ago
Now down to ¥12/172/10 by:
Using a separate MC to send the value 1 and do nothing else so that we can combine the two instructions
+ mov 0 p1
+ sub 1
into a single instruction
+ sub p1
This required adding an OR gate so that the value 1 doesn't slip through to our output (1 will be clamped to 0).
So we use 1 more power on the first cycle but use 1 less power per successful trigger pull.
solution is now ¥10/177/10
Made further power improvements by:
Switching around the loop so that reload is only checked after checking if a trigger has been pulled (valid trigger inputs are far more common than reload inputs, and they never occur on the same tick). The exception to this is on the first tick we will only check the reload since a trigger action on the first tick will never result in a shot.
Breaking up the gen instruction such that we can share the slp 1 instruction with the not firing and not reloading path.
A reload instruction now sleeps with a slp 2 instruction instead of two slp 1 instructions which will save 1 power per reload.