REQUEST: Port Half-Life SDK Extension DLLs CLEANLY to Windows CE

Discussion in 'Sega Dreamcast Development and Research' started by TerdFerguson, Dec 3, 2016.

  1. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
  2. megavolt85

    megavolt85 Peppy Member

    Joined:
    Jan 8, 2015
    Messages:
    311
    Likes Received:
    454
    test
     

    Attached Files:

    TerdFerguson likes this.
  3. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    hl.dll only two errors left
    hl_new4.png

    Client.dll util.cpp works, the _M_PI_ external object error from before was because I didn't have pm_shared.c, pm_debug.c, and pm_math.c. The syntax error is a compiler issue, it doesn't like that function for some reason. I say we comment it out and add a TODO in the file or SDK README, because I ran into that error before with this, it's an issue with combining C and C++ and the compiler doesn't like that function
    client_new4.png
     
  4. megavolt85

    megavolt85 Peppy Member

    Joined:
    Jan 8, 2015
    Messages:
    311
    Likes Received:
    454
    use c function in c++ it's simple
    example:
    extern "C" int your_func(void param);

    test
     

    Attached Files:

    TerdFerguson likes this.
  5. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    It takes care of the errors in hl.dll
    hl_linker.png
    _PM_Move/_PM_Init/_PM_FindTextureType are because hl.dll also needs pm_math.c/pm_shared.c/pm_debug.c. So I added them
    hl_linker1.png
    When I comment VectorScale() out, it compiles, but pm_shared gives a couple more unresolved externals
    hl_linker2.png
    If you have the Windows CE Dreamcast SDK I can send you the source trees if that's easier
     
  6. megavolt85

    megavolt85 Peppy Member

    Joined:
    Jan 8, 2015
    Messages:
    311
    Likes Received:
    454
    i'm linux user :)
    my compiler GCC ;)
     
    TerdFerguson likes this.
  7. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    Should the last errors in client.dll be finished before worrying about the linker errors? Not including pm_math/VectorScale()
     
  8. megavolt85

    megavolt85 Peppy Member

    Joined:
    Jan 8, 2015
    Messages:
    311
    Likes Received:
    454
    send me source code
     
    TerdFerguson likes this.
  9. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    client.dll --> hldc_dlls\new\cl_dll\
    hl.dll --> hldc_dlls\new\dlls
    http://hldc.dreampipe.net/sdk/hldc_dlls-dev-0.8.zip

    I'm going to separate the old and new source branches in the hldc-sdk after this is finished, but for doing this I just kept everything in one folder
    pm_etc.c is in \new\pm_shared folder
     
    Last edited: Dec 16, 2016
  10. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    Another noteworthy thing is the CEAPISpy would compile except for 7 undeclared identifiers that according to MSDN are supposed to be defined in commdlg.h and winuser.h and were included in the standard WCE library since WCE 1.0. But they're left out in both headers in the WCE Dreamcast SDK
    hax.png
    So then it'd just be a matter of modifying it to call the Initialize() function in client.dll unless I don't understand DLL injection and it's not that simple
     
  11. Trident6

    Trident6 Spirited Member

    Joined:
    Oct 17, 2015
    Messages:
    119
    Likes Received:
    55
    Why don't we make this a GitHub project? It will be a lot easier than going back and forth like this.
     
    TerdFerguson likes this.
  12. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    I'll start putting it up there now. Might take me a few minutes to get the new folder structures and make sure the project files still work
     
  13. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    GitHub is all done
    https://github.com/FaucetDC/hldc-sdk

    I thought the DLL Injector needed a cool name, En4CEr (Enforcer) suits it well
    @Trident6 @megavolt85 (and anyone else) you guys just have to send me your usernames and I'll add you to the contributors

    OldSourceCode\dlls\hl\hl.dll gave me new weird compiler errors it didn't give me before after I made the folder structures for everything. I'll take a look at that tomorrow, it's 3am now
    Edit: Fixed, updated with working oldsourcecode\dlls

    Edit 2: 12/19: I thought this is useful info regarding using the HL2 beta to help re-implement things that might be missing later down the line
    http://half-life.wikia.com/wiki/Half-Life_2_Beta

    Edit 3:
    Added 4 missing files to the sourcecode\cl_dll\client\client.dsw
    sourcecode\cl_dll\hl\hl_baseentity.cpp
    sourcecode\cl_dll\hl\hl_events.cpp
    sourcecode\cl_dll\hl\hl_objects.cpp
    sourcecode\cl_dll\hl\hl_weapons.cpp
    All compiled fine without modification, but you have to copy the "sourcecode\common" folder to the directory underneath WCE Dreamcast SDK include directory (C:\WCEDreamcast\common)
    Pushed to git
     
    Last edited: Dec 19, 2016
  14. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    Didn't want to triple post, but there's a slight problem

    Tried commenting out some stuff just to get the newer branch of client.dll compiled, and got over 6000 linker errors for the VGUI stuff, the problem is VGUI.lib is closed source and can't be ported to WCE. It MIGHT be in the HL2 2003 leak, I only looked briefly for it

    Excerpt about VGUI in an Xash3D article
    http://pandoralive.info/?p=5043

    This might not even be an issue, there's 0 references to VGUI in the HLDC binary disassemble (going to look at the ASM in greater detail soon to trace into the references of client.dll). So it's very likely the code for the VGUI wasn't used at all in the Dreamcast port, so again this probably isn't an issue

    One good thing about this though, is the reverse engineer of Counter-Strike 1.6 client.dll doesn't use VGUI either
    I'll remove everything pertaining to VGUI tomorrow

    Though if removing the VGUI stuff breaks the code and actually can't be compiled, then the Counter-Strike 1.6 client library can be used in combination with the 'OldSourceCode' that is already ported as the base for the Dreamcast SDK. Which would be a non-issue as long as there's no Xash3D specific stuff. Source SDK base i'm pretty sure is CS:S anyhow
     
  15. truemaster1

    truemaster1 Enthusiastic Member

    Joined:
    Nov 10, 2015
    Messages:
    512
    Likes Received:
    226
    looking forward for a new compiled gdi or cdi of this new source code
     
  16. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    Updated En4CEr in the SDK to mostly compile. All the sources will compile, but there's only 2 linker errors. One redefinition, which I want to leave it unmodified so I'll leave it alone and let someone who knows what they're doing fix it, and one unresolved external symbol
    link.png
    Once it compiles though, it has to be slimmed down to run silently (No GUI, performs needed task in the background and closes), and adapt it to inject client.dll
    https://github.com/FaucetDC/hldc-sdk
     
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page