View Single Post
Old 12-17-2017, 03:54 AM   #31
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,663
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by GeoffR View Post
The new patch works differently, you only need to change the last replace_int line.

(The value used by the timer is actually in milliseconds, but numbers larger than 255 are encoded in a complicated way, so with the old patch it was necessary to specify a different 4-byte sequence for 3000, 5000, etc. The new patch takes a smaller number in seconds, which can be entered as a plain integer, and multiplies it by 1024 to get an approximation of the timer value in milliseconds. The first replace_bytes line is just to set up this code to do the multiplication.)

(Edit: And if you are wondering why multiply by 1024 instead of 1000? 4 bytes is not enough space to load a multiplicand and load a multiplier and perform a normal multiplication. But there is a trick for multiplying by powers of 2 using a logical-shift-left instruction that doesn't require loading the multiplier. 1024 = 2 to the 10th power.)
Thank you for the explanation, I was curious too.
Terisa de morgan is offline   Reply With Quote