Page 2 of 2 FirstFirst 12
Results 26 to 48 of 48

Thread: Patching Wales

  1. #26

    Join Date
    09-03-12
    Location
    London
    Posts
    931
    OK, we're now in the summer of 2007 and two relegated sides have taken the top two European places, the Welsh Cup winners have the second UEFA Cup slot and the League winners are now in the Intertoto Cup. It seems that every time somebody wins the double, it makes the issue a little worse.

  2. #27

    Join Date
    21-02-19
    Posts
    48
    Quote Originally Posted by faz44 View Post

    I don't know where to look in the code for Wales' CL qualifiers etc.

    Does anyone know where this code is for any leagues?? Finding this could open a lot of possibilities for patching the game. It would be interesting to know what was originally changed by Tapani when he turned the Welsh league into Conference North and managed to move the selection for European competitions to keep selecting Welsh teams and not placings within the league.

  3. #28

    Join Date
    04-05-20
    Posts
    89
    https://champman0102.co.uk/showthread.php?t=14783

    Try searching this file for some of these 9CF values:
    [9CF94C] - Welsh Premier Division
    [9CF950] - Welsh League Cup
    [9CF954] - Welsh Cup
    [9CF958] - Welsh Premier Cup
    [9CF95C] - The Inter-American Cup
    [9CF960] - Welsh Lower Division

    You could do likewise in Olly, but the annotated exe file has labels to make it easier to read.

  4. The Following User Says Thank You to John Locke For This Useful Post:


  5. #29

    Join Date
    26-08-20
    Posts
    1
    Is there an update for the domestic Welsh teams (Cymru Premier) and players?

  6. #30

    Join Date
    21-02-19
    Posts
    48
    Quote Originally Posted by John Locke View Post
    https://champman0102.co.uk/showthread.php?t=14783

    Try searching this file for some of these 9CF values:
    [9CF94C] - Welsh Premier Division
    [9CF950] - Welsh League Cup
    [9CF954] - Welsh Cup
    [9CF958] - Welsh Premier Cup
    [9CF95C] - The Inter-American Cup
    [9CF960] - Welsh Lower Division

    You could do likewise in Olly, but the annotated exe file has labels to make it easier to read.
    Have looked through the annotated exe file and found all those offsets, just don't see them listed anywhere that obviously points to CL/EL/ELQ connection.

  7. #31

    Join Date
    09-03-12
    Location
    London
    Posts
    931
    Mine seems to be some conflict between the relegation code, the European code and the savegame which is generating the incorrect qualifiers. Basically, it's unplayable ATM because your success is punished.

  8. #32

    Join Date
    04-05-20
    Posts
    89
    Try looking for +1DB, I think that where club data stores which European (or continental) competition the club are in (if any).

    +1DF is what their 'seeding' is (between 1 and 4, I think).

    I suspect there will be no nation specific code for Euro qualification. I expect there will be one piece of code that deals with all leagues in Europe.

  9. #33

    Join Date
    09-03-12
    Location
    London
    Posts
    931
    Quote Originally Posted by John Locke View Post
    Try looking for +1DB, I think that where club data stores which European (or continental) competition the club are in (if any).

    +1DF is what their 'seeding' is (between 1 and 4, I think).

    I suspect there will be no nation specific code for Euro qualification. I expect there will be one piece of code that deals with all leagues in Europe.
    So there will be a sub which each country passes their rankings into? Most likely the issue is with the code before it hits the sub?

  10. #34

    Join Date
    04-05-20
    Posts
    89
    I don't know how the game sets which European comp a club is eligible for entry into - it will probably relate to the UEFA coefficients, and I don't even know how they work(ed) ILR never mind how it would work in game.

  11. #35

    Join Date
    09-03-12
    Location
    London
    Posts
    931
    Quote Originally Posted by John Locke View Post
    I don't know how the game sets which European comp a club is eligible for entry into - it will probably relate to the UEFA coefficients, and I don't even know how they work(ed) ILR never mind how it would work in game.
    I can read code - Java, Visual Basic, Delphi - but I can't make head nor tails of whatever comes out of Olly. Works at a level far lower than what I understand.

  12. #36

    Join Date
    21-02-19
    Posts
    48
    As I have replaced Scottish League Two with an 18 team Welsh League, I decided to try and copy the original coding blocks for Welsh Premier and replace the SL2 coding with this to see if it might then sort the issue of European qualifiers out of the Welsh League rather than random selections. The only issue I have run into is I moved the 2nd line of code; PUSH cm0102.00960CE9 this says SE handler installation. Despite putting in the exact code that originally existed here it still becomes corrupted; anybody have any idea how to sort this? (All other replaced code seems - at this point anyway - to be working fine).

  13. #37

    Join Date
    04-05-20
    Posts
    89
    Quote Originally Posted by faz44 View Post
    I can read code - Java, Visual Basic, Delphi - but I can't make head nor tails of whatever comes out of Olly. Works at a level far lower than what I understand.
    I know that feeling. I can read code that relates to accessing data (with the help of this post: https://champman0102.co.uk/showthrea...954#post186954) but beyond that it's not easy (and I did a module on Assembly language at Uni in the late 90's).

    I've been thinking of starting a thread on Assembly, if that will help others then I should do that (I was initially just thinking of it as an alternative to: What does that instruction mean again? *Googles It* (for the nth time...))

  14. The Following User Says Thank You to John Locke For This Useful Post:


  15. #38

    Join Date
    21-02-19
    Posts
    48
    Have managed to remove a lot of the errors on second go of replacing the Scottish League Two code with Welsh Premier original code, albeit still one line of code that is corrupted and overwrites itself - I get left with a line displayed as DB 74 - CHAR 't' - anyone got a solution to this error at all?

  16. #39

    Join Date
    04-05-20
    Posts
    89
    Quote Originally Posted by footballer View Post
    Have managed to remove a lot of the errors on second go of replacing the Scottish League Two code with Welsh Premier original code, albeit still one line of code that is corrupted and overwrites itself - I get left with a line displayed as DB 74 - CHAR 't' - anyone got a solution to this error at all?
    Can you post a screenshot from Olly?

  17. #40

    Join Date
    21-02-19
    Posts
    48
    This is the block of code where the issue occurred. I've stuck the two problem lines in bold font....

    007F4E18 90 NOP
    007F4E19 $ 81EC 00020000 SUB ESP,200
    007F4E1F . 53 PUSH EBX
    007F4E20 . 55 PUSH EBP
    007F4E21 . 56 PUSH ESI
    007F4E22 . 8BF1 MOV ESI,ECX
    007F4E24 . 68 26040000 PUSH 426
    007F4E29 . 32DB XOR BL,BL
    007F4E2B . 66:C747 3E 120>MOV WORD PTR DS:[EDI+3E],12
    007F4E31 . E8 10001500 CALL cm0102.00944E46
    007F4E36 . 33ED XOR EBP,EBP
    007F4E38 . 83C4 04 ADD ESP,4
    007F4E3B . 3BC5 CMP EAX,EBP
    007F4E3D . 8987 B1000000 MOV DWORD PTR DS:[EDI+B1],EAX
    007F4E43 . 75 68 JNZ SHORT cm0102.007F4EAD
    007F4E45 . 8D4424 0C LEA EAX,DWORD PTR SS:[ESP+C]
    007F4E49 . 8D8C24 0C01000>LEA ECX,DWORD PTR SS:[ESP+10C]
    007F4E50 . 50 PUSH EAX
    007F4E51 . 51 PUSH ECX
    007F4E52 . 55 PUSH EBP
    007F4E53 . 55 PUSH EBP
    007F4E54 . 68 E4AFA700 PUSH cm0102.00A7AFE4 ; ASCII "E:\dev\CM3\cm3 00-01\cm3\code\comp\leagues\sco_third.cpp"
    007F4E59 . E8 A1FE1400 CALL cm0102.00944CFF
    007F4E5E . 83C4 14 ADD ESP,14
    007F4E61 . 8D5424 0C LEA EDX,DWORD PTR SS:[ESP+C]
    007F4E65 . 8D8424 0C01000>LEA EAX,DWORD PTR SS:[ESP+10C]
    007F4E6C . 68 94010000 PUSH 194
    007F4E71 . 52 PUSH EDX
    007F4E72 . 50 PUSH EAX
    007F4E73 . E8 B8821100 CALL cm0102.0090D130
    007F4E78 . 50 PUSH EAX
    007F4E79 . 68 E8709800 PUSH cm0102.009870E8 ; ASCII "v%s %s.%s %d"
    007F4E7E . 68 D024AE00 PUSH cm0102.00AE24D0
    007F4E83 . E8 17FE1400 CALL cm0102.00944C9F
    007F4E88 . 55 PUSH EBP
    007F4E89 . 68 D024AE00 PUSH cm0102.00AE24D0
    007F4E8E . 68 E0709800 PUSH cm0102.009870E0 ; ASCII "Error"
    007F4E93 . E8 F833DFFF CALL cm0102.005E8290
    007F4E98 . 83C4 24 ADD ESP,24
    007F4E9B . 892D 347AB600 MOV DWORD PTR DS:[B67A34],EBP
    007F4EA1 . 33C0 XOR EAX,EAX
    007F4EA3 . 5E POP ESI
    007F4EA4 . 5D POP EBP
    007F4EA5 . 5B POP EBX
    007F4EA6 . 81C4 00020000 ADD ESP,200
    007F4EAC . C3 RETN
    007F4EAD > A1 5C23AE00 MOV EAX,DWORD PTR DS:[AE235C]
    007F4EB2 . 56 PUSH ESI
    007F4EB3 . 8B35 B423AE00 MOV ESI,DWORD PTR DS:[AE23B4]
    007F4EB9 . 85C0 TEST EAX,EAX
    007F4EBB . 7E 3E JLE SHORT cm0102.007F4EFB
    007F4EBD > 8B47 57 MOV EAX,DWORD PTR DS:[EDI+57]
    007F4EC0 . 85C0 TEST EAX,EAX
    007F4EC2 . 74 26 JE SHORT cm0102.007F4EEA
    007F4EC4 . 8B08 MOV ECX,DWORD PTR DS:[EAX]
    007F4EC6 . A1 E8F59C00 MOV EAX,DWORD PTR DS:[9CF5E8]
    007F4ECB . 3BC8 CMP ECX,EAX
    007F4ECD . 75 1B JNZ SHORT cm0102.007F4EEA
    007F4ECF . 6A 00 PUSH 0 ; /Arg4 = 00000000
    007F4ED1 . 8AC3 MOV AL,BL ; |
    007F4ED3 . 6A 00 PUSH 0 ; |Arg3 = 00000000
    007F4ED5 . 57 PUSH EDI ; |Arg2
    007F4ED6 . 50 PUSH EAX ; |Arg1
    007F4ED7 . 8BCE MOV ECX,ESI ; |
    007F4ED9 . FEC3 INC BL ; |
    007F4EDB . E8 5025E9FF CALL cm0102.00687430 ; \cm0102.00687430
    007F4EE0 . 66:0FBED3 MOVSX DX,BL
    007F4EE4 . 66:3B56 3E CMP DX,WORD PTR DS:[ESI+3E]
    007F4EE8 . 74 1B JE SHORT cm0102.007F4F05
    007F4EEA > 8B0D 5C23AE00 MOV ECX,DWORD PTR DS:[AE235C]
    007F4EF0 . 45 INC EBP
    007F4EF1 . 81C7 45020000 ADD EDI,245
    007F4EF7 . 3BE8 CMP EBP,EAX
    007F4EF9 .^7C C2 JL SHORT cm0102.007F4EBD
    007F4EFB > 66:0FBECB MOVSX CX,BL
    007F4EFF . 66:3B46 3E CMP AX,WORD PTR DS:[ESI+3E]
    007F4F03 . 5F POP EDI
    007F4F04 74 DB 74 ; CHAR 't'
    007F4F05 . 0C 5E OR AL,5E

    007F4F07 . 5D POP EBP
    007F4F08 . 33C0 XOR EAX,EAX
    007F4F0A . 5B POP EBX
    007F4F0B . 81C4 00020000 ADD ESP,200
    007F4F11 . C3 RETN
    007F4F12 > 68 10270000 PUSH 2710 ; /Arg1 = 00002710
    007F4F17 . 8BCE MOV ECX,ESI ; |
    007F4F19 . E8 52E0E8FF CALL cm0102.00682F70 ; \cm0102.00682F70
    007F4F1E . 8946 28 MOV DWORD PTR DS:[ESI+28],EAX
    007F4F21 . B8 01000000 MOV EAX,1
    007F4F26 . 8886 E1000000 MOV BYTE PTR DS:[ESI+E1],AL
    007F4F2C . 5E POP ESI
    007F4F2D . 5D POP EBP
    007F4F2E . 5B POP EBX
    007F4F2F . 81C4 00020000 ADD ESP,200
    007F4F35 . C3 RETN
    007F4F36 90 NOP

  18. #41

    Join Date
    04-05-20
    Posts
    89
    OK, I don't really understand what it is you're doing but... in the original exe: 007F4F03 is jumping (conditionally) back to 007F4EC4 as part of a loop through all clubs in the game.

    In your code, it looks like the jump should be to: 007F4EBD - so the code would be: 007F4F03 ^7C B8 JL SHORT cm0102.007F4EBD

  19. #42

    Join Date
    21-02-19
    Posts
    48
    So what I've done is taken the original Welsh Premier coding and put that in, in place of the Scottish League Two code (or at least changed the code where there is a difference). Yes, I originally had a JE SHORT cm0102.007F4EBD (as you've said it should be), but when I try to start a game it crashes and when I go back into Olly the two lines of code I had put in bold are what is there instead of the JE SHORT.

  20. #43

    Join Date
    04-05-20
    Posts
    89
    Can you try checking that location in a hex editor to see if the bytes are actually changing? I'm sceptical - but can't offer an alternative explanation.

    BTW, does: 007F4EC6 . A1 E8F59C00 MOV EAX,DWORD PTR DS:[9CF5E8] - need to be changed to refer to something different (currently Scottish Third Division)?

  21. #44

    Join Date
    21-02-19
    Posts
    48
    Can try to have a look at that - to be honest I'm completely shooting in the dark with this, but thought it was worth a try to see if the changes would bring about a resolution to having league teams qualify for European competition from the Welsh league.

    Quote Originally Posted by John Locke View Post
    BTW, does: 007F4EC6 . A1 E8F59C00 MOV EAX,DWORD PTR DS:[9CF5E8] - need to be changed to refer to something different (currently Scottish Third Division)?
    No, that seems to need to be in there as it is referring to the league being used (this is now the Welsh Premier with all Welsh teams in here rather than it being the Scottish Third Division)

  22. #45

    Join Date
    21-02-19
    Posts
    48
    Well I've managed to sort the error that was happening, turns out at offset 007F4EE8 I had the wrong instruction which I've now sorted. But still game crashes.

    Downloaded a hex editor but that makes no sense to me, when it comes to coding my approach is that of a monkey in a room with a type-writer, press enough buttons and the works of Shakespeare will eventually be written!

    Happy to send on my data folder if someone fancies having a look at the coding in-depth - I've convinced myself that if we got this to work it would solve the european qualification issue (i've got all other parts working for the Welsh competitions -other than relegation).

    On this, I've noticed that in all playable countries that have 2 or more divisions, there is a block of code in the top division with a lot of references to the other leagues in that country - is this what effectively creates the link between the leagues?

  23. #46

    Join Date
    04-05-20
    Posts
    89
    You don't need the hex editor; I just wanted to confirm whether the bytes being displayed by Olly were correct.

    League's are linked by specifying which league clubs are promoted and relegated to, like this:

    007EEEC2 |> 8B0D DCF59C00 MOV ECX,DWORD PTR DS:[9CF5DC]
    007EEEC8 |. 50 PUSH EAX
    007EEEC9 |. 894E 1C MOV DWORD PTR DS:[ESI+1C],ECX
    007EEECC |. 8B0D E4F59C00 MOV ECX,DWORD PTR DS:[9CF5E4]
    007EEED2 |. 894E 20 MOV DWORD PTR DS:[ESI+20],ECX

    +1C = promotion, + 20 = relegation

    Check the 9CF thread for a list of 9CF values.

  24. #47

    Join Date
    21-02-19
    Posts
    48
    Thanks John - yeah, I reckon all is fine in Olly with that block of code now, I'm now completely stumped as to what is causing the crash when trying to start a new game. To check this through Olly do I open Olly while starting a new game and then when the game crashes it will have stopped on/highlighted the broken line of code in Olly (I've seen reference on the site to running the game through Olly to check broken lines of code but never done so myself).

    With regard to the links for relegation and promotion, yep, totally aware of those. The other "link" I'm referring to is only seen in blocks of code for top flight divisions in each country (where there are 2 or more divisions). For Scottish Premier League for instance, this block of code starts at 007F2A70 with a reference to Scottish League Two only a few lines beneath at 007F2A91 and also at 007F2AC1. Then you need to scroll further down in this block to a section where there is reference to every Scottish division (playable) in the game....

    007F2C8B . C3 RETN
    007F2C8C > 8B0D FCADAD00 MOV ECX,DWORD PTR DS:[ADADFC]
    007F2C92 . 8B15 E4F59C00 MOV EDX,DWORD PTR DS:[9CF5E4]
    007F2C98 . 57 PUSH EDI
    007F2C99 . 6A 03 PUSH 3
    007F2C9B . 8B0C91 MOV ECX,DWORD PTR DS:[ECX+EDX*4]
    007F2C9E . 6A FD PUSH -3
    007F2CA0 . 6A 02 PUSH 2
    007F2CA2 . E8 D97CE9FF CALL cm0102.0068A980
    007F2CA7 . A1 FCADAD00 MOV EAX,DWORD PTR DS:[ADADFC]
    007F2CAC . 8B0D E8F59C00 MOV ECX,DWORD PTR DS:[9CF5E8]
    007F2CB2 . 57 PUSH EDI
    007F2CB3 . 6A FD PUSH -3
    007F2CB5 . 8B0C88 MOV ECX,DWORD PTR DS:[EAX+ECX*4]
    007F2CB8 . 57 PUSH EDI
    007F2CB9 . 6A 02 PUSH 2
    007F2CBB . E8 C07CE9FF CALL cm0102.0068A980
    007F2CC0 . 8B15 FCADAD00 MOV EDX,DWORD PTR DS:[ADADFC]
    007F2CC6 . A1 E0F59C00 MOV EAX,DWORD PTR DS:[9CF5E0]
    007F2CCB . 8B0C82 MOV ECX,DWORD PTR DS:[EDX+EAX*4]
    007F2CCE . 8B11 MOV EDX,DWORD PTR DS:[ECX]
    007F2CD0 . FF52 08 CALL DWORD PTR DS:[EDX+8]
    007F2CD3 . A1 FCADAD00 MOV EAX,DWORD PTR DS:[ADADFC]
    007F2CD8 . 8B0D E4F59C00 MOV ECX,DWORD PTR DS:[9CF5E4]
    007F2CDE . 8B0C88 MOV ECX,DWORD PTR DS:[EAX+ECX*4]
    007F2CE1 . 8B11 MOV EDX,DWORD PTR DS:[ECX]
    007F2CE3 . FF52 08 CALL DWORD PTR DS:[EDX+8]
    007F2CE6 . A1 FCADAD00 MOV EAX,DWORD PTR DS:[ADADFC]
    007F2CEB . 8B0D E8F59C00 MOV ECX,DWORD PTR DS:[9CF5E8]
    007F2CF1 . 8B0C88 MOV ECX,DWORD PTR DS:[EAX+ECX*4]
    007F2CF4 . 8B11 MOV EDX,DWORD PTR DS:[ECX]
    007F2CF6 . FF52 08 CALL DWORD PTR DS:[EDX+8]
    007F2CF9 . 8B06 MOV EAX,DWORD PTR DS:[ESI]
    007F2CFB . 8BCE MOV ECX,ESI
    007F2CFD . FF50 5C CALL DWORD PTR DS:[EAX+5C]
    007F2D00 . 8BCE MOV ECX,ESI
    007F2D02 . E8 797DE9FF CALL cm0102.0068AA80
    007F2D07 . 8B4E 04 MOV ECX,DWORD PTR DS:[ESI+4]
    007F2D0A . 51 PUSH ECX ; /Arg1
    007F2D0B . 8B0D 4043B700 MOV ECX,DWORD PTR DS:[B74340] ; |
    007F2D11 . E8 CAA1FAFF CALL cm0102.0079CEE0 ; \cm0102.0079CEE0
    007F2D16 . 5F POP EDI
    007F2D17 . 5E POP ESI
    007F2D18 . 5B POP EBX
    007F2D19 . 81C4 00020000 ADD ESP,200
    007F2D1F . C3 RETN


    Any idea what all that is trying to do? I have tried to replace the Scottish League Two reference with another but game crashed.
    The above block of code can be found in all premier divisions, but does not exist in lower divisions.

  25. #48

    Join Date
    04-05-20
    Posts
    89
    No idea. However, just above it is the line:
    007F2C35 . 68 70AFA700 PUSH cm0102.00A7AF70 ; ASCII "E:\dev\CM3\cm3 00-01\cm3\code\comp\leagues\sco_prm.cpp"

    I think that all such lines indicate the code relates to error checking, and is there to inform the devs of the error code (like the 5809 (?) error code when you rename a hard-coded club).

    I can't figure out how this is working, it looks like some sort of dynamic function call (where the function call varies by competition).

    007F2CC0 . 8B15 FCADAD00 MOV EDX,DWORD PTR DS:[ADADFC]
    007F2CC6 . A1 E0F59C00 MOV EAX,DWORD PTR DS:[9CF5E0=[SCOTTISH_FIRST_DIVISION]]
    007F2CCB . 8B0C82 MOV ECX,DWORD PTR DS:[EDX+EAX*4]
    007F2CCE . 8B11 MOV EDX,DWORD PTR DS:[ECX]
    007F2CD0 . FF52 08 CALL DWORD PTR DS:[EDX+8]



    These lines seem to be accessing League.NumberOfRounds & League.NumberOfTeams
    007F2D2D . 66:837F 3C 03 CMP WORD PTR DS:[EDI+3C],3
    007F2D32 . 75 36 JNZ SHORT cm0102.007F2D6A
    007F2D34 . 66:8B77 3E MOV SI,WORD PTR DS:[EDI+3E]

Page 2 of 2 FirstFirst 12

Posting Permissions

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