Release Starcraft

Discussion in 'Software Releases' started by notaz, Mar 4, 2014.

  1. ekianjo

    ekianjo Hardcore Member

    Joined:
    May 7, 2012
    Messages:
    8,261
    Location:
    神戸市、日本 (Japan)
    The work from asm code to C code is probably the biggest hurdle (but notaz may comment) and from what I discussed with notaz the more DLLs you have, the more work it represents so some games may require much more work than StarCraft, and bear in mind that notaz has been working on this for several months already.  
     
  2. Askarus

    Askarus Hardcore Member

    Joined:
    Sep 28, 2011
    Messages:
    4,214
    Location:
    Germany
    Yeah, I know.

    But What I don't understand by now it:

    Notaz has written a custom conversion tool (asm to C).

    Let's assume he continues to improve that tool will it be an universal tool then which will speed up other ports as well, or does ever game need a custom conversion tool.
     
  3. FaeMinx

    FaeMinx Rainbow Liberation Instigation

    Joined:
    Dec 11, 2010
    Messages:
    3,093
    Location:
    outside looking in side looking out
    Do I have to have the patch installed?


    I have StarCraft Broodwar installed at version 1.15.2 on my work computer and it doesn't require the cd to run.


    I only ask as this is an old computer and will take 3.5 hours to copy the game folder onto my sd card... also, I'm having trouble finding a place to download the patch.


    Edit: Answered my own question. Apparently the patch is not required if you have version 1.15.2


    Pocketable StarCraft... Hell yeah! :D


    Now we just need a solution for right click.
     
    Last edited by a moderator: Mar 5, 2014
  4. ekianjo

    ekianjo Hardcore Member

    Joined:
    May 7, 2012
    Messages:
    8,261
    Location:
    神戸市、日本 (Japan)
    Notaz alone can answer that, but it seems it required lots of debugging, so it would not be very safe to assume it can become "universal" anytimes soon :p  
     
  5. Klumpen

    Klumpen Run away! Run away!

    Joined:
    Jan 5, 2012
    Messages:
    6,406
    Location:
    Uncanny Valley
    It sounds like notaz did a lot by hand, so I doubt his tools will be a big advantage for other games, but maybe they can be developed further by someone?
     
  6. _wb_

    _wb_ Microbe Staff Member

    Joined:
    Apr 5, 2012
    Messages:
    5,387
    Location:
    Brussels, Belgium
    This is amazing stuff.

    The approach is very interesting, both from the technical point of view and from the legal point of view.

    Technically:

    I wonder if a similar approach would work to do static recompilation of game console ROMs, to get just a bit of extra speed compared to dynamic recompilation. So instead of using an emulator, you would essentially specialize (emulator+rom) into one native executable, where as much of the recompilation as possible is done statically (I guess you cannot get rid of it in general because there could be self-modifying code etc.). If you can get near-native execution in the performance-critical loop bodies, this could theoretically enable "emu-compi-lation" of more game consoles (as long as their hardware is not more powerful than the Pandora's), albeit with potentially a lot of manual game-specific effort if the approach cannot easily be fully automated.

    Legally:

    What is the legal status of this approach? If the process can be automated then I see no problem (you don't need to distribute any proprietary stuff, only the recompiler tool), but if you have distribute an executable that was somehow derived from a proprietary executable, I'm not sure if that is legally OK. Game companies probably don't mind as long as you don't distribute the game data with it, but still, there is theoretically a problem.
     
  7. ElPoco

    ElPoco Very Active Member

    Joined:
    Feb 16, 2012
    Messages:
    634
    Location:
    Paris, France
    Automatic static recompilation is simple on the paper, but extremely complex in practice. From what I've seen, automatic tools will only get you that far and then you need to solve problems by hand. And it's very hard to know where the problems are, and even when you do know, it's hard to fix them as well.

    Legally, many license agreements expressively forbid the user from decompiling the software, so it's complicated here as well.
     
  8. gunrock

    gunrock Member

    Joined:
    Jan 20, 2011
    Messages:
    485
    This is amazing. Hats off to you, Notaz (yet again!).

    Quick question regarding this: Are PC savegames compatible? (I would like to continue a campaign from back in 1998/9!)
     
  9. FaeMinx

    FaeMinx Rainbow Liberation Instigation

    Joined:
    Dec 11, 2010
    Messages:
    3,093
    Location:
    outside looking in side looking out
    When I copied the game folder over it had my saves with it, and my profile.


    Sent from my GT-N5100 using Tapatalk 4
     
  10. Wally

    Wally I am a banana! Staff Member

    Joined:
    Jan 31, 2006
    Messages:
    2,897
    Location:
    Melbourne, Australia
    Just confirmed the web download version is compatible (I bought it specially as i've never played starcraft properly!), just need to add the 1.16.1 patch and you're all set
     
  11. espiritu_protector

    espiritu_protector Still Fresh

    Joined:
    Nov 29, 2013
    Messages:
    1
    Yay!

    I bought Startcraft a few years ago but only played a few missions.

    Now I can retry it on my pandora.

    Many thanks, notaz.
     
  12. Farox

    Farox Certified Guru

    Joined:
    Jan 8, 2009
    Messages:
    1,979
    Location:
    Italy
    Impressive work Notaz (as usual ;) ).

    I would suggest to look at a partially done port of Syndacate Wars done in a similar way...i allready checked the sources but inside there is a block of x86 asm code not converted..so impossible (for me...) to port it.
     
  13. PokeParadox

    PokeParadox Founder of Pirate Games - Penjin Coder Staff Member

    Joined:
    Dec 8, 2005
    Messages:
    6,510
    Location:
    UK
    Hmmm link to where to buy?
     
  14. ptitSeb

    ptitSeb Serial Porter

    Joined:
    Aug 15, 2012
    Messages:
    8,180
    Location:
    France, near Lyon
    Yep, this one should be a good "next" candidate because most of the "Hardware" communication level functions are already extracted.
     
  15. commander-beef

    commander-beef Very Active Member

    Joined:
    May 1, 2012
    Messages:
    964
    Location:
    Polandowo
    ptitSeb

    be carefull:

     
  16. ptitSeb

    ptitSeb Serial Porter

    Joined:
    Aug 15, 2012
    Messages:
    8,180
    Location:
    France, near Lyon
    Yes. I will (and it's easy for me, I don't plan to do anything for now ;) ). The warning seems fair. Anyway, I my (biased) point of view, I think it's better to distribute converted binary to another architecture than processed sources code. As a unfair reused possibility, binary are useless, processed source code can be used.

    But lets agree it's a bit a gray area with not much jurisdiction yet...
     
  17. notaz

    notaz Certified Guru

    Joined:
    Aug 23, 2005
    Messages:
    4,910
    Location:
    Lithuania
    It plays quite ok with that 3x3 command bar on the bottom right, so you can do without rightclick when you get used to it really. Although rightclick could be done somehow, maybe shoulder button like you say. Left shoulder is set up as shift, which allows to select individual units to a group in SC, but that doesn't work on pandora because shift is set up as window move modifier, and wine doesn't see shift press because of that. So it indeed could be reused as rightclick modifier instead.
    It only implements the very minimum of what SC needs, so it would almost certainly fail on anything else. Only part of x86 instructions are handled (not all are fully implemented), there is no support for float/mmx/sse (SC almost doesn't use float), it only understands compiler-generated functions (code compiled from hand-coded asm will fail).
    The tools are on my github already, however they are extremely user-unfriendly and an awful hackjob really.The "source" is huge-ass C file, it takes around a minute to compile. Small sample function:

    int sub_401310(int a1, int a2)
    {
    u32 eax = (u32)a1;
    u32 ecx;
    u32 edx;
    u32 esi;
    u32 edi;

    if (eax != 0)
    goto loc_40131D;
    eax = (u32)a2; // arg_0
    eax += 4;

    loc_40131D:
    esi = *(u32 *)(eax);
    if (esi == 0)
    goto loc_401351;
    edx = *(u32 *)(eax+4);
    if ((s32)edx > 0)
    goto loc_40132F;
    edx = ~edx;
    goto loc_40133A;

    loc_40132F:
    edi = *(u32 *)(esi+4);
    ecx = eax;
    ecx -= edi;
    edx += ecx;

    loc_40133A:
    *(u32 *)(edx) = esi;
    ecx = *(u32 *)(eax);
    edx = *(u32 *)(eax+4);
    *(u32 *)(ecx+4) = edx;
    *(u32 *)(eax) = 0;
    *(u32 *)(eax+4) = 0;

    loc_401351:
    return eax;
    }
    As you can see it doesn't look much different from x86 disassembly, the only difference is that you can compile it for other 32bit archs (there is no way it would work on 64bit..)

    I might theoretically be possible, but it would take infinite time to write universal tool that could handle larger part of games/programs, it's easier just to say it's impossible. And in some cases it's indeed impossible, like for self-modifying code and dynarecs (even SC has a dynarec which had to be worked around..).
    It could be done, but again, not in all cases for the same reasons as mentioned above. If you want to target many games it requires too much effort and is certainly not worth it.
    Yes this is a problem.. The tools currently can't do it on their own, it would take a lot of effort to get them to such state. I'm even relying on external program (IDA) for initial disassembly, replacement for that would have to be written. However there are projects like bwapi and vgce, as well as M-HT recompiles mentioned in my first post, they were not attacked by the game companies but they're certainly in the same gray area..
    They are, but as latest patch of the game is required (it's from 2009), the states will probably be no longer compatible because of the patch alone.
     
    Last edited by a moderator: Mar 5, 2014
  18. Wally

    Wally I am a banana! Staff Member

    Joined:
    Jan 31, 2006
    Messages:
    2,897
    Location:
    Melbourne, Australia
    Blizzards battle.net store! $14.99
     
  19. pmprog

    pmprog Advanced Member

    Joined:
    Apr 25, 2011
    Messages:
    3,660
    Wow, expensive. Can get it for a few quid on Amazon (UK)http://www.amazon.co.uk/Starcraft-Broodwar-Expansion-Pack-DVD/dp/B00005JHDQ/ref=sr_1_3?ie=UTF8&qid=1394028005&sr=8-3&keywords=starcraft
     
  20. TrashyMG

    TrashyMG Sarcasm Dispenser Staff Member

    Joined:
    Jan 18, 2010
    Messages:
    10,268
    £7.49 = $12.52 USD so it's a few dollars cheaper.
     
    Last edited by a moderator: Mar 5, 2014

Share This Page

Loading...