Network code

Technical discussion for those interested in Supermodel development and Model 3 reverse engineering. Prospective contributors welcome.
Forum rules
Keep it classy!

  • No ROM requests or links.
  • Do not ask to be a play tester.
  • Do not ask about release dates.
  • No drama!

Re: Network code

Postby Ian » Wed Jan 03, 2018 9:30 am

I'll see if i can find it ..
The crash is related to delete [] or delete or maybe free()
Maybe reading past array boundary somewhere
Ian
 
Posts: 1402
Joined: Tue Feb 23, 2016 9:23 am

Re: Network code

Postby Ian » Wed Jan 03, 2018 10:49 am

I need some more time to try and get that code to build
Currently including windows.h is breaking other parts of the compile :(
Ian
 
Posts: 1402
Joined: Tue Feb 23, 2016 9:23 am

Re: Network code

Postby Spindizzi » Thu Jan 04, 2018 3:03 am

Hum, I don't have this
It may be the cause of the building error :
Using your udp code now, there is no need to add #include "Winsock2.h" in these files : CPUDebug.h, Debugger.h, DirectInputSystem.h, WinOutputs.h, if you have patched these ones, just revert and remove this line also in Supermodel.h
Do you want me to send you the directly modified files ?
Spindizzi
 
Posts: 119
Joined: Thu Nov 17, 2016 8:55 am
Location: France

Re: Network code

Postby Ian » Thu Jan 04, 2018 6:56 am

Hi Spindizzi,
yeah upload the files it might be easier :) I will add your netboard.cpp to the source as well. Even if its not linked into the main project for now. At least it won't get lost that way :p
Ian
 
Posts: 1402
Joined: Tue Feb 23, 2016 9:23 am

Re: Network code

Postby Ian » Thu Jan 04, 2018 12:06 pm

Okay,
I got as far as debugging the crash on exit.

Image

Your crash is here.

You've commented out this code

Code: Select all
   // only for swap test
   /*bank = new UINT8[0x10000];
   if(NULL == bank)
   {
      printf("error mem bank\n");
      return ErrorLog("Insufficient memory for net board");
   }
   memset(bank, 0, 0x10000);*/


And the constructor never sets bank to NULL, so it's just some random address. So deleting a random address causes an error :)
Ian
 
Posts: 1402
Joined: Tue Feb 23, 2016 9:23 am

Re: Network code

Postby Spindizzi » Fri Jan 05, 2018 1:10 am

Erf, my bad
Call me the man who comments/uncomments too quickly :mrgreen:
Thx Ian ;)
Spindizzi
 
Posts: 119
Joined: Thu Nov 17, 2016 8:55 am
Location: France

Re: Network code

Postby Ian » Fri Jan 05, 2018 2:32 am

I should probably point out that when you call new you must call delete. And when you call new[] you must use delete[]. Mixing the two results in undefined behaviour.
Ian
 
Posts: 1402
Joined: Tue Feb 23, 2016 9:23 am

Re: Network code

Postby Ian » Sat Jan 06, 2018 5:04 pm

Few screenshots of spindizzis network code working !

https://imgur.com/a/edVsc

Actually works really well, at least for dirt devils. Not tried any other games yet
Ian
 
Posts: 1402
Joined: Tue Feb 23, 2016 9:23 am

Re: Network code

Postby Boomslangnz » Sat Jan 06, 2018 6:01 pm

im dead keen to try this out....i just really dont know how to get it working :(
Boomslangnz
 
Posts: 131
Joined: Mon Jul 23, 2012 10:35 pm

Re: Network code

Postby Ian » Sat Jan 06, 2018 6:16 pm

I need to push the rest of the code to make this work. Will try and get around to doing it tomorrow
Ian
 
Posts: 1402
Joined: Tue Feb 23, 2016 9:23 am

PreviousNext

Return to The Dark Room

Who is online

Users browsing this forum: No registered users and 3 guests