Results 1 to 17 of 17

Thread: A quick post on Idle Sensitivity

  1. #1

    Join Date
    18-07-15
    Posts
    205
    vCash
    0

    A quick post on Idle Sensitivity

    I recently added Idle Sensitivity to CM 00/01 (for the CM 93 version of CM 00/01 we've made at: https://nic.hopto.org/open/cm0001/cm93.zip ) and while doing so I had to delve into exactly what Idle Sensitivity does in CM0102 and thought I should post something quick:

    Idle Sensitivity Patch (made originally by Tapani and in his patcher, and therefore Saturn's builds and also available in my patcher) does two things:

    1) It puts a little 1 millisecond sleep in the main UI loop (which occurs every 33 loops of the UI). Without this ChampMan runs in a tight little loop constantly, even when the UI is sitting idle with nothing happening and no user input. This makes the CPU raise to almost maximum (for one core) in usage and uses more power/battery life. By adding this tiny little "Sleep" it frees the computer and process up keeping the CPU at nearly 0% usage when not doing background processing.

    2) Puts a little delay (another Win32 "Sleep") when pressing the + and - buttons in the contract screen. So that when you're setting wages it puts a little 64 millisecond wait between flicking through the amount so it doesn't race through so quick you can't set it precisely.

    Now the interesting bits:
    What's the difference between "Desktop" idle sensitivity and "Laptop" Sensitivity? Well it changes from a 1 millisecond delay to a 20 millisecond delay in the UI loop. You can modify this delay, within a boundary with:
    Code:
    00566162: 01 14
    ^ That goes from 1 millisecond to 20 milliseconds (i.e. "Laptop" -> "Desktop" sensitivity (14 in hex is 20 in base10)). Change that 14 to a higher number (like 30 or 40) and you'll get a bigger delay. That delay affects the UI in general and can slow down other bits of the UI.

    Similarly:
    Code:
    00566171: 40 55
    Will increase the delay between cycles when setting wages (from 64ms to 85ms). So if you find it still moves too quickly for you right now try this.

    But the bit I noticed is that Tapani never added that functionality to the Transfer Screen - so when you're trying to set a transfer bid, pressing the + and - keys can make it hard to set the precise bidding price you want as it moves too quickly. But I've added that with this patch:
    Code:
    004EC743: 0F E9
    004EC744: BF 33
    004EC745: C8 9D
    004EC746: 0F 07
    004EC747: BF 00
    004EC748: D7 90
    0056647B: 00 E8
    0056647C: 00 F0
    0056647D: 00 FC
    0056647E: 00 FF
    0056647F: 00 FF
    00566480: 00 0F
    00566481: 00 BF
    00566482: 00 C8
    00566483: 00 0F
    00566484: 00 BF
    00566485: 00 D7
    00566486: 00 E9
    00566487: 00 BE
    00566488: 00 62
    00566489: 00 F8
    0056648A: 00 FF
    ^ So now the Transfer screen when bidding on a player will have the same delay on the + and - keys as when you are setting contract wages (and can similarly be delayed by changing the byte at 00566171)

    Hope that's useful/interesting to someone I will add the transfer screen patch to my Patcher as part of the Idle Sensitivity.

    -Nick

  2. The Following 10 Users Say Thank You to Nick+Co For This Useful Post:


  3. #2

    Join Date
    18-03-14
    Posts
    1,222
    vCash
    7700
    Great post Nick, thanks for explaining it so well (especially the difference between the Desktop and Laptop options).

    I love the addition of the transfer screen patch too!

  4. #3

    Join Date
    18-07-15
    Posts
    205
    vCash
    0
    @Saturn: My post above was inspired by my favourite post on here - which is your: https://champman0102.co.uk/showthread.php?t=7158
    The CM0001 93 version amongst many others wouldn't exist without that! So thanks to you!
    (Also realised you get the speed issue when you press + or - on the Transfer Status screen too when setting your own players values.....when I get the energy I'll fix it there too )

  5. The Following User Says Thank You to Nick+Co For This Useful Post:


  6. #4

    Join Date
    18-03-14
    Posts
    1,222
    vCash
    7700
    Thanks! Always nice to write about solving a bug after the hours of dead-ends elsewhere in the code!

    Also realised you get the speed issue when you press + or - on the Transfer Status screen too when setting your own players values.
    Another screen that has the ultra sensitive buttons is the Discipline Player screen. I think I'll almost miss the previous method of click, hold, try to drag across one pixel of the +/- button that I used on these screens once they're fixed.

    Btw, is the location you used for the transfer bid screen code safe to use? I'm only unsure because Tapani never used it, and I'm not sure what the 00 instruction does in Assembly. I changed it to the below for my next patch, though this assumes that a call to 00513341 (code that just displays the Additional Research game credits screen) has been NOPed at 004EDA90.
    Spoiler!

  7. #5

    Join Date
    18-07-15
    Posts
    205
    vCash
    0
    Just realised I never answered this

    is the location you used for the transfer bid screen code safe to use?
    I wondered this too - there's a small block of zeroes at the end that Tapani didn't touch - but could have done. Although its not code - I thought it could be used to for data (although that would have been weird for the compiler) But as far as I can tell - all safe! Tapani was pretty obsessed about doing things in the smallest space possible - means he created some genius code just to crowbar it in and save space for the future. So think he just left that space as-is - but pretty sure it's safe (i.e. never seen any of my patches that use it cause any corruption/crashes there).

  8. #6

    Join Date
    18-03-14
    Posts
    1,222
    vCash
    7700
    Quote Originally Posted by Nick+Co View Post
    I wondered this too - there's a small block of zeroes at the end that Tapani didn't touch - but could have done. Although its not code - I thought it could be used to for data (although that would have been weird for the compiler) But as far as I can tell - all safe! Tapani was pretty obsessed about doing things in the smallest space possible - means he created some genius code just to crowbar it in and save space for the future. So think he just left that space as-is - but pretty sure it's safe (i.e. never seen any of my patches that use it cause any corruption/crashes there).
    This is what worries me a bit. I know you've looked at Tapani's patches and seen the places he's added new code into and the lengths he's gone to to create space for that code. 00966121 - 00966FFF is a relatively huge amount of space for him to potentially put new code into, and there must have been a reason for him not to have done so.

  9. #7

    Join Date
    18-07-15
    Posts
    205
    vCash
    0
    I know what you're saying - I thought the same thing too - but I've checked it so many times - not found anything that references it. It's just all dead space - run a game for seasons or in matches and break out of it - that space never gets filled or used (it would have crashed by now with my patches if it did - and it doesn't). So I think it's all good - but if you find out different - let me know!
    EDIT:
    Oh and just to add to that - Tapani was obsessive about space - like when he used an already existing float for his currency inflation patch - just to not have to use another 8 bytes for another. There was no need for that - there's 8 byte chunks all over you can use (in my original patch I just use a 8 byte chunk between functions) - but he was a minimalist and did some awesome stuff to keep the space usage low. So I think it was just his style to not use space he hadn't made himself.

  10. #8

    Join Date
    04-03-12
    Posts
    165
    vCash
    500
    Quick question Nick, I did speak to Tapani many moons ago in regards to the options available when bidding or receiving bids for a player. The trouble is since the prices have been inflated the predetermined offers still only range from £0 through to a maximum of £20m so if for instance you wanna (more like have to) bid £60-70m+ it takes an absolute age to get there.

    Tapani agreed it needed changing but never got round to it I assume. Is there a way of upping these set figures of 10 to somewhere between £0-£100m? If so Iím happy to do it myself as long as yourself, saturn or some other hero of mine on here could potentially point me in the right direction please.

  11. #9

    Join Date
    18-07-15
    Posts
    205
    vCash
    0
    Have a look around 8e987d and 8f6b6e in Olly - not at my computer right now so can't check. But that looks like the list to me.

  12. #10

    Join Date
    04-03-12
    Posts
    165
    vCash
    500
    I had a brief look mate but it all went straight over my head, I kinda get the coding to a certain extent but am far from an expert like some of you boys.

  13. #11

    Join Date
    18-07-15
    Posts
    205
    vCash
    0
    Ahhh it's an easy one, you'll be fine:
    Code:
    CPU Disasm
    Address   Hex dump          Command                                                    Comments
    008F6B26  |.  894424 50     MOV DWORD PTR SS:[LOCAL.275],EAX
    008F6B2A  |.  897C24 58     MOV DWORD PTR SS:[LOCAL.273],EDI
    008F6B2E  |.  C74424 5C A08 MOV DWORD PTR SS:[LOCAL.272],186A0
    008F6B36  |.  C74424 60 90D MOV DWORD PTR SS:[LOCAL.271],3D090
    008F6B3E  |.  C74424 64 20A MOV DWORD PTR SS:[LOCAL.270],7A120
    008F6B46  |.  C74424 68 404 MOV DWORD PTR SS:[LOCAL.269],0F4240
    008F6B4E  |.  C74424 6C A02 MOV DWORD PTR SS:[LOCAL.268],2625A0
    008F6B56  |.  C74424 70 404 MOV DWORD PTR SS:[LOCAL.267],004C4B40
    008F6B5E  |.  C74424 74 809 MOV DWORD PTR SS:[LOCAL.266],OFFSET 00989680               ; ASCII ".Viv Anderson)> reported that <%s - Player name (eg. Paul Gascoigne)> turned up late for training today and showed a distinct lack of match fitness."
    008F6B66  |.  C74424 78 C0E MOV DWORD PTR SS:[LOCAL.265],0E4E1C0
    008F6B6E  |.  C74424 7C 002 MOV DWORD PTR SS:[LOCAL.264],1312D00
    Those are the hexadecimal numbers that go into that drop down box. 1312D00 = 20,000,000 for instance. Change that to 2FAF080 and it will be 50m instead.

    Now, if you want to turn pro, you start looking at:
    Code:
    008EC2B8  |> /8D9424 A80000 |/LEA EDX,[LOCAL.240]
    008EC2BF  |. |6A 0A         ||PUSH 0A                                                  ; /Arg3 = 0A
    008EC2C1  |. |52            ||PUSH EDX                                                 ; |Arg2 => OFFSET LOCAL.240
    008EC2C2  |. |56            ||PUSH ESI                                                 ; |Arg1
    008EC2C3  |. |8D4C24 20     ||LEA ECX,[LOCAL.277]                                      ; |
    008EC2C7  |. |E8 5434B5FF   ||CALL 0043F720                                            ; \cm0102.0043F720
    With a loop at:
    CPU Disasm
    Address   Hex dump          Command                                                    Comments
    008EC33E  |.  46            INC ESI
    008EC33F      66:83FE 05    CMP SI,A
    008EC343  |.^ 0F8C 6FFFFFFF JL 008EC2B8
    Which is where it loads up the list EDX holds the array of values. A (10 in decimal) is the number in the list and compared later for the loop. You get the idea What if you made EDX point to a different array of values, and changed A to equal the length of that array? i.e. you could have a list of 20 values with a wider range
    Last edited by Nick+Co; 02-11-19 at 09:31 AM.

  14. #12

    Join Date
    04-03-12
    Posts
    165
    vCash
    500
    Mate thatís way over my head, moving a few fixtures around and patching in stuff you heroes supply is pretty simple but this is outta my league unfortunately. The first part is real helpful though so Iíll give that a go just to get a start at £50m when putting a bid in. Appreciate the help Nick.
    Last edited by fairedinkum; 02-11-19 at 08:43 PM.

  15. #13

    Join Date
    18-07-15
    Posts
    205
    vCash
    0
    Ha ha - well, by jumping over and using all those MOV DWORD PTRs as extra storage space, you can have a lot more options and not use up any extra space in the exe.
    For instance:


    What do we reckon? Is that overkill? Or should I turn it into a patch?
    EDIT: Actually the last drop down will clip and show an error with all those options - so will clip off the 100M option and turn it into a patch
    Last edited by Nick+Co; 03-11-19 at 12:19 AM.

  16. The Following 4 Users Say Thank You to Nick+Co For This Useful Post:


  17. #14

    Join Date
    18-07-15
    Posts
    205
    vCash
    0
    Ok a patch for you folk to try:
    Code:
    004E981E: 89 EB
    004E981F: B4 6F
    004E9820: 24 00
    004E9821: A8 00
    004E9824: 00 A0
    004E9825: C7 86
    004E9826: 84 01
    004E9827: 24 00
    004E9828: AC 90
    004E9829: 00 D0
    004E982A: 00 03
    004E982C: A0 20
    004E982D: 86 A1
    004E982E: 01 07
    004E9830: C7 40
    004E9831: 84 42
    004E9832: 24 0F
    004E9833: B0 00
    004E9834: 00 A0
    004E9835: 00 25
    004E9836: 00 26
    004E9837: 90 00
    004E9838: D0 40
    004E9839: 03 4B
    004E983A: 00 4C
    004E983B: C7 00
    004E983C: 84 80
    004E983D: 24 96
    004E983E: B4 98
    004E9840: 00 C0
    004E9841: 00 E1
    004E9842: 20 E4
    004E9843: A1 00
    004E9844: 07 00
    004E9845: 00 2D
    004E9846: C7 31
    004E9847: 84 01
    004E9848: 24 80
    004E9849: B8 C3
    004E984A: 00 C9
    004E984B: 00 01
    004E984C: 00 80
    004E984D: 40 F0
    004E984E: 42 FA
    004E984F: 0F 02
    004E9850: 00 C0
    004E9851: C7 68
    004E9852: 84 78
    004E9853: 24 04
    004E9854: BC 00
    004E9855: 00 E1
    004E9856: 00 F5
    004E9857: 00 05
    004E9858: A0 00
    004E9859: 25 00
    004E985A: 26 00
    004E985C: C7 90
    004E985D: 84 90
    004E985E: 24 90
    004E985F: C0 90
    004E9860: 00 90
    004E9861: 00 90
    004E9862: 00 90
    004E9863: 40 90
    004E9864: 4B 90
    004E9865: 4C 90
    004E9866: 00 90
    004E9867: C7 90
    004E9868: 84 90
    004E9869: 24 90
    004E986A: C4 90
    004E986B: 00 90
    004E986C: 00 90
    004E986D: 00 90
    004E986E: 80 90
    004E986F: 96 90
    004E9870: 98 90
    004E9871: 00 90
    004E9872: C7 90
    004E9873: 84 90
    004E9874: 24 90
    004E9875: C8 90
    004E9876: 00 90
    004E9877: 00 90
    004E9878: 00 90
    004E9879: C0 90
    004E987A: E1 90
    004E987B: E4 90
    004E987C: 00 90
    004E987D: C7 90
    004E987E: 84 90
    004E987F: 24 90
    004E9880: CC 90
    004E9881: 00 90
    004E9882: 00 90
    004E9883: 00 90
    004E9884: 00 90
    004E9885: 2D 90
    004E9886: 31 90
    004E9887: 01 90
    004E9888: 89 90
    004E9889: B4 90
    004E988A: 24 90
    004E988B: 80 90
    004E988C: 00 90
    004E988D: 00 90
    004E988E: 00 90
    004EC2B8: 8D BA
    004EC2B9: 94 20
    004EC2BA: 24 98
    004EC2BB: A8 8E
    004EC2BD: 00 90
    004EC2BE: 00 90
    004EC2C0: 0A 0D
    004EC342: 0A 0D
    004F7570: 66 31
    004F7571: 3B F6
    004F7572: FB B9
    004F7573: 0F 20
    004F7574: 84 98
    004F7575: 91 8E
    004F7577: 00 90
    004F7578: 00 90
    004F7579: 33 90
    004F757A: F6 90
    004F757B: 8D 90
    004F757C: 4C 90
    004F757D: 24 90
    004F757E: 54 90
    004F7580: 0A 0D
    004F7603: 0A 0D
    004F7606: 71 68
    Should give bigger dropdowns and options for the offering of buying a player or setting transfer values.

  18. The Following 2 Users Say Thank You to Nick+Co For This Useful Post:


  19. #15

    Join Date
    04-03-12
    Posts
    165
    vCash
    500
    Nick this is absolutely unreal, I've just downloaded it and patched it in and it's so much better. Thank you so much for your work, it's highly appreciated.

  20. #16

    Join Date
    03-03-15
    Location
    Nova Friburgo, Brazil
    Posts
    1,428
    vCash
    500
    Will It work with other coins?

  21. #17

    Join Date
    18-07-15
    Posts
    205
    vCash
    0
    No reason why it wouldn't - let me know if it doesn't

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •