Half-Life for Dreamcast has some functional multiplayer components

Discussion in 'Sega Dreamcast Development and Research' started by TerdFerguson, Jul 13, 2015.

  1. Kallus

    Kallus Seriously Serious Member

    Joined:
    Dec 22, 2015
    Messages:
    103
    Likes Received:
    58
    Yeah, I really wish it had multiplayer.
    The only glimpse we got at it was in the trailer for it..
     
  2. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    755
    Likes Received:
    468
    Yes I've heard that too. What I'm thinking is the second disc would've been a WinCE kernel with all of the html components for networking. With menus to connect to the internet and a server browser

    Else the engine would be completely the same. Even if it was supposed to be two disc, the second disc would not have been an entirely different fork of the engine. It'd be the same thing as disc one, but pretty much everything I've been trying to figure out would be on disc two and enabled
     
    Anthony817 likes this.
  3. FuzzyFish

    FuzzyFish Rising Member

    Joined:
    May 14, 2014
    Messages:
    59
    Likes Received:
    58
    My situation with 4x4Evo is entirely different, I can directly alter the game executable. With Half-Life we don't have this option, this failing is more due to lack of time.

    What I wanted to do was attempt to use the source code from DC-Tool to write a LAN adapter (Yes, the lame duck HIT-300) driver that used the same function names as the dial-up modem. It's possible if there were other WinCE online games out there it "might" work. Failing that I would have just altered 4x4Evo accordingly.
     
    wombat, TerdFerguson and Anthony817 like this.
  4. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    755
    Likes Received:
    468
    Okay so good news and bad news

    Good news is i've figured out how to run command line options without needing the DC-Tool(CE). I found this article here
    http://geekswithblogs.net/BruceEitm...application-with-command-line-parameters.aspx

    Which has sample code for an EXE that runs another EXE with command line parameters. I copypasted into VC++6.0 and compiled it for the Dreamcast. Much to my surprise it worked fine
    Here is the source
    Code:
    #include <Windows.h>
    int WINAPI WinMain(     HINSTANCE hInstance,
                                                                                    HINSTANCE hPrevInstance,
                                                                                    LPTSTR    lpCmdLine,
                                                                                    int       nCmdShow)
    {
    PROCESS_INFORMATION pi;
                    if (CreateProcess( TEXT("HALFLIFE_DC.EXE"), TEXT("-game cstrike -dll dlls\hl.dll +map test -exec test.cfg -nosound -nojoy"), NULL, NULL, FALSE, 0,NULL, NULL, NULL, &pi))
                    {
                                    CloseHandle(pi.hProcess);
                                    CloseHandle(pi.hThread);
                    }
                
                    SignalStarted( _wtol(lpCmdLine) );
    }
    Perhaps someone would want to add code for dialing the modem on top of that ;)

    Here is the log of that applications loading and tossing control over to halflife_dc.exe
    [​IMG]

    The bad news is it does not appear to do anything. Maybe the parameters I tried are invalid, or this method all together does not work. I wouldn't rule out the parameter theory until I've actually tested it via DC-Tool(CE)'s command line. Next i'm going to try all of the parameters listed as strings in the EXE at once. Since I only have 3 or less CDs left. But notice how it says "module unload: SHELL.EXE" right before the new parameter application loads

    Another interesting this is, the WinDBG debugger still works after control is passed to half-life. Right before an engine crash/error, WinDBG stops the process and gives you the option to handle to the exception, or let it go unhandled. If unhandled then it crashes like when the WinDBG is not in use. But you can show the memory in many different formats, byte, hex, text, etc. And pretty much "debug" lol so that is nice we can delve further into certain errors and possibly make fixes where possible

    If I can figure out how to use the rest of the tools using the serial port on a retail unit I can test a real lot. There is settings for a transport layer DLL in WinDBG. I mentioned the 'vChannel Transport' before, perhaps I can set it to that dll (vchanc.dll i think) I'm pretty sure WinDBG has a command shell also, but I have not found it yet or have not found it doesn't have one. But as of now there's plenty for me to test

    -----------

    I played a few serious matches on a Team Fortress Classic server, without bots last night and it was pretty fantastic. It was the first time I've played a real match of that. I'm hoping somehow myself or someone else figures this out

    Edit: Attached HL_PARMS.EXE
     

    Attached Files:

    Last edited: Apr 17, 2016
    wombat and Anthony817 like this.
  5. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    755
    Likes Received:
    468
    Update, I tried compiling that EXE to use every parameter listed as strings in halflife_dc.exe. The game's exe loads, but crashes right before it starts. This is a good sign, but I don't have enough CDs to now sit here and test each parameter on its own to figure out which one it is. So that will have to be for another day
     
    Anthony817 likes this.
  6. Anthony817

    Anthony817 Familiar Face

    Joined:
    May 12, 2010
    Messages:
    1,124
    Likes Received:
    596
    Wow man! That is some good news for sure! Looks like things might start looking up for us!
     
  7. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    755
    Likes Received:
    468
    Updates: (it's cool there's still updates/progress lol)

    I was looking around the internet for a way to remotely access a Windows CE command line using the serial port. I found this program called zterm
    http://www.coolstf.com/zterm/zterm.html
    http://www.coolstf.com/ztermce/index.html
    http://www.coolstf.com/okdownload.html

    Unpacking the .cab file for the CE version installer was a real pain. I eventually tracked down Windows CE CAB Manager, and it can extract them fine. I'll attach a zip of the version i downloaded, because it's almost extinct on the internet

    Anyway, I installed the x86 client on obviously my PC, then put the contents of the cab installer on-disc and set it to autoload. But nothing happens using the CE client, I might need to use the HTML kernel (HTML and non-HTML are two different sets of kernel modules so it's like a different kernel all together, some things don't work while others will)

    But what is significant is I kept zterm open while loading another disc with the serial debugger module, and there was indeed output
    [​IMG]
    Paint on Windows XP isn't too great

    I actually don't think zterm does what I want it to do anyway. It says it's a terminal emulator for UNIX machines, maybe someone can clarify. But this shows that a 3rd party application can communicate with the serial port, not just a Microsoft developed tool. I can't type anything, which i'm pretty sure is because that's the initial output from the WinDBG debugger. This probably also means that the client side applications for the registry editor, heap walker, etc are also coded to use the SCSI debug module

    But the one that I'm trying to use, DC-Tool, the command shell for the console's CE kernel does not have a client side application. Meaning it's possible that the SCSI debug module is what makes all of the registry editor, process viewer etc programs communicate with the PC

    So this post may be long, but when the serial debugger module is compiled into the image using the config tool, you cannot use the kernel if WinDBG is closed. The whole thing halts unless WinDBG is connected. This is the reason why I cannot input anything to zterm. But zterm does in fact connect to the Dreamcast's serial port when it is opened to wait for WinDBGs connection. Which is pictured above

    So the whole point of that is
    It probably wouldn't be too hard to code a module that can connect to another 3rd party application like zterm, and access the kernels command line like DC-Tool does. All somebody would have to do is inspect DC-Tool's binary and see what it's communicating with client side and how. Then code a client side module that does the same thing, but using the serial port connected to a 3rd party COM terminal like zterm. All of the client side function calls for using the serial port should already be in serial.dll, the Dreamcast's serial driver for CE

    I am talking about a skilled programmer of course. But I know that would be simple for one to do because I already know how to code it, and if I could code I would

    Half-Life aside, Windows CE on the Dreamcast is mostly untouched as far as homebrew goes. Having a homebrew module that can give remote access to the Dreamcast's WinCE command line, and perhaps even access to the registry editor, CESpy++ and many others would allow someone to literally install the Dreamcast CE development software and just hop to developing with a whole bunch of tools besides an IDE and a kernel debugger

    I've actually contemplated trying to cross compile OpenMW and Xash3D using the Windows CE SH4 compilers and CMake, then learning to code by getting it to run on the Dreamcast

    Yes that was long lol

    @SiZiOUS Where the hell are you, I want to know what you think of all of this
     
    Anthony817 likes this.
  8. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    755
    Likes Received:
    468
    Windows HyperTerminal actually works too, I'm going to do more research in using this for Windows CE over a COM port. I think every version of windows has this
    [​IMG]
    DC-Tool could just be a new hyperterminal GUI to use a Katana with over SCSI
     
    Anthony817 likes this.
  9. Anthony817

    Anthony817 Familiar Face

    Joined:
    May 12, 2010
    Messages:
    1,124
    Likes Received:
    596
  10. Kallus

    Kallus Seriously Serious Member

    Joined:
    Dec 22, 2015
    Messages:
    103
    Likes Received:
    58
  11. Kallus

    Kallus Seriously Serious Member

    Joined:
    Dec 22, 2015
    Messages:
    103
    Likes Received:
    58
    Wait, Magazines are usually given early versions so they can write articles on it..
    There was an article about Half-Life Multiplayer on Dreamcast in Dreamcast Magazine.
    This raises some concerns for me.
     
    TerdFerguson likes this.
  12. Anthony817

    Anthony817 Familiar Face

    Joined:
    May 12, 2010
    Messages:
    1,124
    Likes Received:
    596
    Actually there were quite a few magazines that got to have hands on time with the game. I have compiled all reviews, and previews and anything else paper media related of this game into a nice organized PDF for your viewing pleasure.

    https://mega.nz/#!6IUXnbrT!ffpquch6uoLpaqPb66fMfHTf7mhYlTvOI5KQwPTjbes

    It took me quite a very long time to archive all of that information, and I had to scour the internet and request the assistance of a lot of helpful people like Caleb from over at Dreamcast Junkyard to provide high quality photos of the magazine so as to not damage them, but the magazine in question has since been fully scanned, I just haven't updated this pack in about 4 years or so.

    Anyways, you will be able to look at articles in Portuguese, Spanish, French and English I believe in there. I was quite thorough in my inclusion of other languages as well.
     
    americandad and sa1 like this.
  13. Trident6

    Trident6 Spirited Member

    Joined:
    Oct 17, 2015
    Messages:
    119
    Likes Received:
    55
    All the terminal emulators do essentially the same thing, usually provide a RS-232 output from a remote device to a host. "Serial" as a protocol just means that all the bytes arrive one after the other instead of in parallel. Saying it is for Unix/whatever doesn't really mean anything.

    Since you are getting text in the clear at the start of the session, it means that your connection settings are correct. It is strange that you end up with garbled text after the initial boot message. This usually indicates that baud rate or stop bit settings are incorrect, however it is rare for a device to change its baud rate on the fly. Also there are some relevant ASCII characters in the stream as well.

    My guess is that it switched from raw ASCII to UTF8 or something after the boot message, I would check your character encoding on the and see if there is support for wide characters instead of plain ASCII.

    Maybe relevant:
    http://www.venea.net/web/terminal_ce - looks like it has UTF8 support
    http://ce4all.blogspot.com/2007/06/command-line-console-over-serial.html
     
    TerdFerguson likes this.
  14. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    755
    Likes Received:
    468
    Did some more stuff on this today, @Trident6 I'm pretty sure I've confirmed my EXE does in fact load the parameters

    A few posts back I mentioned passport.exe and ras.exe. Passport.exe appends network settings in the flashrom to the windows ce registry, ras.exe dials the modem if you give the name of the isp setting in registry as a parameter (in my case its ISP0)

    I added those two to the parameter launcher program, and made shell.exe load again because it unloads right before hl_parms.exe starts up
    Here is the new source
    Code:
    #include <Windows.h>
    int WINAPI WinMain(     HINSTANCE hInstance,
                                                                                    HINSTANCE hPrevInstance,
                                                                                    LPTSTR    lpCmdLine,
                                                                                    int       nCmdShow)
    {
    PROCESS_INFORMATION pi;
                    if (CreateProcess( TEXT("SHELL.EXE"), TEXT(""), NULL, NULL, FALSE, 0,NULL, NULL, NULL, &pi))
                    {
                                    CloseHandle(pi.hProcess);
                                    CloseHandle(pi.hThread);
                    }
               
                    SignalStarted( _wtol(lpCmdLine) );
    
                    if (CreateProcess( TEXT("PASSPORT.EXE"), TEXT(""), NULL, NULL, FALSE, 0,NULL, NULL, NULL, &pi))
                    {
                                    CloseHandle(pi.hProcess);
                                    CloseHandle(pi.hThread);
                    }
               
                    SignalStarted( _wtol(lpCmdLine) );
    
                    if (CreateProcess( TEXT("RAS.EXE"), TEXT("ISP0"), NULL, NULL, FALSE, 0,NULL, NULL, NULL, &pi))
                    {
                                    CloseHandle(pi.hProcess);
                                    CloseHandle(pi.hThread);
                    }
               
                    SignalStarted( _wtol(lpCmdLine) );
    
                    if (CreateProcess( TEXT("SHELL.EXE"), TEXT(""), NULL, NULL, FALSE, 0,NULL, NULL, NULL, &pi))
                    {
                                    CloseHandle(pi.hProcess);
                                    CloseHandle(pi.hThread);
                    }
               
                    SignalStarted( _wtol(lpCmdLine) );
    
                    if (CreateProcess( TEXT("HALFLIFE_DC.EXE"), TEXT("+_setgamedir cstrike -dev -game cstrike -dll dlls\hl.dll -toconsole +client.dll dlls/hl.dll"), NULL, NULL, FALSE, 0,NULL, NULL, NULL, &pi))
                    {
                                    CloseHandle(pi.hProcess);
                                    CloseHandle(pi.hThread);
                    }
               
                    SignalStarted( _wtol(lpCmdLine) );
    }
    
    And it does properly pass the command line parameters to shell.exe
    [​IMG]
    [​IMG]

    But Half-Life crashes again. I used my last CD-R to test this, but I have 100 more coming in the mail :cool:
    It does say it dials successfully, but Half-Life crashes before I can actually see the DreamPi start dialing. I tried a second time after the log above, and passport.exe did not crash but it could not finish reading/outputing the flashrom's network info

    But what is great is I might now have the modem dialer/parameter program I needed in one exe. I'm looking forward to testing this again without any parameters on Half-Life to see what happens with ras.exe

    Notice how it says "OpenPort" twice after Half-Life loads, this is a great sign but it could be output from ras.exe or passport.exe
    One other thing is all 3 applications seem to run simultaneously until Half-Life crashes
     
    sa1 and Anthony817 like this.
  15. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    755
    Likes Received:
    468
    Yep the DreamPi starts dialing just before Half-Life crashes, and every time Half-Life loads it says "OpenPort" twice right after like above
    I may have to go to the store or something to get some CD-Rs I don't think I can wait to test more of this
     
    sa1 and Anthony817 like this.
  16. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    755
    Likes Received:
    468
    Ah man

    I found one more blank CD, the DreamPi dials and stays connected while Half-Life loads and until I shut off the Dreamcast
    That's so fucking amazing

    I'm going to now do a bunch of testing to see if Half-Life can see a server running on my PC
    YEEEEEEEEEEEEEEEEEEEEEEEEEEE
     
    sa1 and Anthony817 like this.
  17. Anthony817

    Anthony817 Familiar Face

    Joined:
    May 12, 2010
    Messages:
    1,124
    Likes Received:
    596
    Dude! You just left us hanging like that!? :p Well did it work or what!?
     
  18. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    755
    Likes Received:
    468
    Well as expected, Half-Life was not able to communicate with the internet connection. But I think this is because the local server needs to be setup a certain way. I was able to send pings to the Dreamcast, but nothing showed on wireshark when I tried sending heartbeats

    Anyway here is the console log from the working/non-crashing image
    [​IMG]
    [​IMG]
    [​IMG]

    It says "App Exited" but it stays connected to the internet until I turn off the console

    There's still a crapton for me to try now. I can try all of the parameters when those CDs arrive, loading the wininet kernel module which requires the html kernel and I'm not sure if half-life works with that

    Here is also the complete documentation for the RAS dialer, there's a lot to mess with there too
    I need to test the .ras files using the mraentry exe/command mentioned in the manual settings above, because as I showed a few posts back htmlsamp.exe doesn't have it's own built in dialer. You have to connect similarly to how I just did

    I also am pretty sure there's a way to setup a CESH server, or a manual transport layer server to use all of the registry editor etc programs

    @Anthony817 If it was working I'd let everyone know for sure lol
     
    sa1, Anthony817 and wombat like this.
  19. Trident6

    Trident6 Spirited Member

    Joined:
    Oct 17, 2015
    Messages:
    119
    Likes Received:
    55
    Something is erroring out and trying to dump hex over the console, based on the output you can tell you have multiple processes that think they have exclusive access to the device and are doing concurrent writes. Judging by the log and the contents of the dump it appears to be the passport module, but its difficult to tell for sure.
     
  20. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    755
    Likes Received:
    468
    Yeah that's passport.exe. It reads the network flash rom settings and outputs it to the debugger. I don't really need to have that running I don't think
     

Share This Page