Thread Closed 
 
Thread Rating:
  • 13 Votes - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Online Support (PRO Online)
11-22-2013, 05:46 PM (This post was last modified: 11-25-2013 03:24 AM by Kyhel.)
Post: #151
RE: Online Support (PRO Online)
Hi guys, well if what you say Ritori is true, maybe it's time i share here what i've found searching the web and github Big Grin
I hope i won't be forgetting anything since i've modified multiple times the source code to get something to work.

Before going any further, it's important to notice it's not an easy guide to follow, there might be some mistakes. The point is more to show you we didn't give up on this, and that the tools to play MHFU and MH3rd HD locally with your friends or family are here.

Important : With all this modifications, i've been able to play, with a local server running on my mac :
- PSP with PPSSPP on my mac
- PPSSPP on my mac with PPSSPP on my pc(Windows 7 Pro) (yeah now it works)
Not tested yet (will be soon) :
- PPSSPP windows with PPSSPP windows
- PSP with PPSSPP windows
To be tested :
- PPSSPP Linux with PSP
- PPSSPP Linux with Mac OSX or Windows

EDIT : I'm not sure i mentioned it, but i did only try this with MHFU, and now i've just tried it with MH3rd HD (you can find a thread on this in the forum), and it seems to work well too Smile

After all modifications, this is totally functionnal for what i've tested : Gathering hall, doing quest (at least the basic gathering quest, i've not tried to slain any monster, but it shoudl't be any different) without any lag (however the psp (if you use one) needs to get into the gathering hall first, otherwise it crashes, and sometimes it crashes even if nobody was in the gathering hall before, but whatever, i can't fix the psp stuff, even if i knew how to do it).

Although igorcalabria says what he's done works on linux, i couldn't test if my minor changes still work, but there is no reason it wouldn't.

I won't detail the way to build things, there are many tutorials on this forum for that, i'll detail the changes i've made to the code.
(See http://forums.ppsspp.org/showthread.php?tid=5231 for windows, for mac (and linux i guess) just use cmake and make commands)


0) NOT TESTED : For those who really want the latest PPSSPP build, take the source code of the latest that builds on http://buildbot.orphis.net/ppsspp/, then apply the changes from the step 1 to the last one) download into this build


1) First thing to do : get the adhoc-support branch from igorcalabria's repo : https://github.com/igorcalabria/ppsspp/t...oc-support

2) Then if you're on windows : look at the changes made on the adhoc-spport-windows branch of his repository and apply them to what you've just downloaded from the adhoc-support branch.

3) Credits goes to LunaMoo from this issue : https://github.com/hrydgard/ppsspp/issues/4490 , on windows, you may have to change 1 or 2 includes : #include <thread> into #include <thread.h> and #include <mutex> into #include <base/mutex.h> or even better #include "native/base/mutex.h" (which already chanegd if you've taken the adhoc-supoprt branch)

4) Then if you're on OSX and have skipped step 0) (which i did if i remember well) you may need to add this in the includes of Common/FileUtil.cpp
Code:
#if !defined(IOS)
#include <mach-o/dyld.h>
#endif // !defined(IOS)
#endif // __APPLE__

5) If you want to play with 2 emulators together you'll have to change the mac adress which is for the moment hardcoded in 2 places :
- in Core/HLE/proAdhoc.cpp
Code:
void getLocalMac(SceNetEtherAddr * addr){
  uint8_t mac[] = {1, 2, 3, 4, 5, 6};
  memcpy(addr,mac,ETHER_ADDR_LEN);
}
- in Core/HLE/sceNet.cpp
Code:
u32 sceWlanGetEtherAddr(u32 addrAddr) {
    // TODO: Read from config
    static const u8 fakeEtherAddr[6] = { 1, 2, 3, 4, 5, 6 };
    DEBUG_LOG(SCENET, "sceWlanGetEtherAddr(%08x)", addrAddr);
    for (int i = 0; i < 6; i++)
        Memory::Write_U8(fakeEtherAddr[i], addrAddr + i);

    return 0;
}

You have to put the same on both places for one build, but if you plane to use 2 emulators, change it on the second one, to another value (01:02:03:04:05:06 is default use 01:02:03:04:05:05 instead for example).

6) Credits goes to me Big Grin
In Core/Dialog/PSPNetconfDialog.cpp change this :
Code:
return sceNetAdhocctlCreate(request.NetconfData->groupName)
into this :
Code:
if(sceNetAdhocctlCreate(request.NetconfData->groupName) == 0)
{
status = SCE_UTILITY_STATUS_FINISHED;
return 0;
}
return -1;
in the int PSPNetconfDialog::Update(int animSpeed) method.
It prevents the emulator from freezing when you try to save after going online (which is great, since there is no point in doing quests if you can't save afterwards Confused)

NEW STEP FOR WINDOWS ONLY

7) Open the Core/HLE/sceNetAdhoc.cpp file.
Go to the sceNetAdhocPtpConnect Function and change : (Use ctrl+f)
Code:
int errorcode = errno;
with
Code:
int errorcode = WSAGetLastError();

Code:
errorcode == EISCONN
with
Code:
errorcode == WSAEISCONN

Code:
errorcode == EINPROGRESS
with
Code:
errorcode == WSAEWOULDBLOCK

Go to the sceNetAdhocPtpSend AND sceNetAdhocPtpRecv functions and change on both :
Code:
int error = errno;
with
Code:
int error = WSAGetLastError();

and

Code:
error == EAGAIN
with
Code:
error == WSAEWOULDBLOCK

Now if i didn't forget anything and didn't make any typo you should have the same code as i have, and the same builds too (keep in mind i have applied different changes to windows (most of them actually) and osx versions, i might have forgot some things, so don't hesitate to give feedback).

Let's talk about the server. Since i'm in a engineering school i can't configure the router, that we all (students) share, so uPnP is forbidden, and i don't even know how to put my computer in the DMZ, which is not a good idea anyway, but if you're interested, feel free to look at the proOnline Client tutorials around the web for the psp.

Let's go set the server :

Step 1 can be skipped if you go to see my post here : http://forums.ppsspp.org/showthread.php?...1#pid59021

1) Download the code from http://code.google.com/p/aemu/, and use make command on linux/osx inside the ppsspp_addhocctl_server folder to build the server, then launch it, there is nothing to do here (at least with the way my network is configured). Though, you can look at the code in the other folders, it's the code of the psp plugin, which is what igorcalabria is porting into PPSSPP.

2) Replace the coldbird.uk.to adress in the server.txt file from your psp proOnline plugin with the local ip adress of the computer on wich you are running the server you just built.

3) Do the same for every other computer you plan to play with (set the proAdhocServer address (or create the line under the [SystemParam] section) in the memstick/PSP/SYSTEM/ppsspp.ini file, the memstick folder should be at the same place you built PPSSPP, but you'll need to launch it once for it to be created).

4) OPTIONNAL : If you want to play with an emulator on the same computer where the server is runnin, i can't garantee the wait to configure your adresses since i used a particular network configuration, but try using the same as the others emulators, it should work since it did for me Smile

Now you should be able to play in the conditions i've described above.

Of course credits goes to igorcalabria, ColdBird, LunaMoo, Ritori (which highlighted me when i was lost trying to build on windows, which i never did before, i'm a mac user), hrydgard, and all the PPSSP contributors for this awesome emulator. I hope i'm not forgetting anybody, my head is just so full of questions right now.

This is it for the tutorial folks.

I know igorcalabria and ColdBird have stuff to do, that's why i post this here (and i'll certainly update this on igorcalabria's repo when i find out how to do it, and what real version of the code to put), hoping guys like you and me find a way to improve this AWESOME stuff !

Hope you'll enjoy what you can get from this, sorry for my english, i'm not a native speaker, and keep hope, we'll in a near future be able to play with the world on proOnline.

Here a some links you may be interested in reading, looking at etc. Most of them are in this post, but here they are.

https://github.com/igorcalabria/ppsspp
https://github.com/hrydgard/ppsspp
https://github.com/hrydgard/ppsspp/issues/4490
http://forums.ppsspp.org/showthread.php?tid=5231
http://code.google.com/p/aemu/
http://pro.coldbird.uk.to/status/
http://www.gamergen.com/tutoriels/utilis...ne-52370-2

Edit : Since I'm both working on a mac and windows version, some changes from the adhoc-support-windows onto your adhoc-support (linux/osx) version (i'm thinking about changin in to unint_32 etc.) maybe have to be reversed if you're using osx/linux, i don't have the patience to test everything here, but i think i've listed all the modifications that need to be made, just revert back if some changes make it worst ^^ And feel free to say if you have changes to add Smile

EDIT 2 (Saturday 23, Nov) : I found what caused the windows version not to connect properly, i've edited my post with recent changes. Check step 7.
Since it works now fully with MHFU (from what i've tested, i'll maybe try to come up with an unified version of all of this with improvements and stuff, and pull a request on igorcalabria's github repo, but like him, i'm a bit lazy, so at the moment i'll just play MHFU with my friends ^^ Enjoy

EDIT 3 [WINDOWS/MAC/LINUX LOCAL SERVER]: I've found how to make the local server run on window, check this post http://forums.ppsspp.org/showthread.php?...1#pid59021

EDIT 4 : Since i don't want to remove all stuff that has become only useful for a few people, i'm making a new post with condensed instructions, and builds when i'll find a way to upload them since they weight around 10Mo

Kyhel,
French Student
Thanks to all PPSSPP team for this amazing emulator !

Experimental PPSSPP Adhoc Support build here : http://forums.ppsspp.org/showthread.php?tid=3595&pid=59241#pid59241
Please read the whole post.
Find all posts by this user
11-22-2013, 06:24 PM
Post: #152
RE: Online Support (PRO Online)
There some progress Smile nice discover Kyhel!! hope mac user can look into this stuff ^-^
for me i'm windows user so i need to wait more progress to be made ^-^

I worse write english so take easy on me
(even my own language realy bad T_T)

Rig to test now :
Windows 8 64 bit (Laptop)
Intel® Core™ i3-3110M (2.4GHz, 3MB L3 Cache)
Nvidia GT720M 2GB
Find all posts by this user
11-22-2013, 06:27 PM (This post was last modified: 11-22-2013 06:28 PM by Kyhel.)
Post: #153
RE: Online Support (PRO Online)
Well as a windows user you can still get into the gathering hall and drink beers with your friends xD (Localy) And yeah i hope someone will be able to look at this, but mostly a windows programmer since with all the test i've made it's the Ptp protocol that doesn't work on windows, while everything works fine on mac Smile And since i dont understand a little thing how this network works, i can't help a lot Confused

Kyhel,
French Student
Thanks to all PPSSPP team for this amazing emulator !

Experimental PPSSPP Adhoc Support build here : http://forums.ppsspp.org/showthread.php?tid=3595&pid=59241#pid59241
Please read the whole post.
Find all posts by this user
11-22-2013, 06:31 PM
Post: #154
RE: Online Support (PRO Online)
YES YES YES! (After reading post) No no no...
Find all posts by this user
11-22-2013, 06:38 PM
Post: #155
RE: Online Support (PRO Online)
(11-22-2013 06:31 PM)Archimedes Wrote:  YES YES YES! (After reading post) No no no...

A bit more be patient lol xD at least i can drink beer with my brother on mhfu xD

I worse write english so take easy on me
(even my own language realy bad T_T)

Rig to test now :
Windows 8 64 bit (Laptop)
Intel® Core™ i3-3110M (2.4GHz, 3MB L3 Cache)
Nvidia GT720M 2GB
Find all posts by this user
11-22-2013, 06:42 PM
Post: #156
RE: Online Support (PRO Online)
I'm really sorry windows sux, but i had to put in a post, so at least mac and linux users can play localy, and it takes back in the scene this thread so maybe a network programmer will see it and give it an hand Smile

Kyhel,
French Student
Thanks to all PPSSPP team for this amazing emulator !

Experimental PPSSPP Adhoc Support build here : http://forums.ppsspp.org/showthread.php?tid=3595&pid=59241#pid59241
Please read the whole post.
Find all posts by this user
11-22-2013, 06:49 PM (This post was last modified: 11-22-2013 07:09 PM by Archimedes.)
Post: #157
RE: Online Support (PRO Online)
Don't get me wrong guys. I, and all the other people on this thread and even forum for that matter, really appreciate your work on this emulator. Yes it kinda sucks windows compatibility isn't finished yet, but what you said earlier means it's pretty close, and that's GREAT! I don't mind waiting a few more days after waiting for so long.

Thank you for all your efforts! And a huge thanks to everyone who worked on this thing for that matter!

P.S. I never thought I would see the day where the MAC user would have an advantage over the Windows user.
Find all posts by this user
11-22-2013, 07:08 PM
Post: #158
RE: Online Support (PRO Online)
I know you are all waiting for this, and I think me first, but i had to "mettre la main a la pâte" like we say in france, to try to make things better, and i'm trying all my best so that we'll all soon be able to slain the fatalis together with this awesome emulator (i really mean it, it's so fast, and playing with an xbox controller on MHFU makes you gain a second D-Pad, priceless, and the graphics.. and the speed hack, not to have to wait loadings and stuff Big Grin)

Kyhel,
French Student
Thanks to all PPSSPP team for this amazing emulator !

Experimental PPSSPP Adhoc Support build here : http://forums.ppsspp.org/showthread.php?tid=3595&pid=59241#pid59241
Please read the whole post.
Find all posts by this user
11-22-2013, 07:13 PM
Post: #159
RE: Online Support (PRO Online)
(11-22-2013 07:08 PM)Kyhel Wrote:  I know you are all waiting for this, and I think me first, but i had to "mettre la main a la pâte" like we say in france, to try to make things better, and i'm trying all my best so that we'll all soon be able to slain the fatalis together with this awesome emulator (i really mean it, it's so fast, and playing with an xbox controller on MHFU makes you gain a second D-Pad, priceless, and the graphics.. and the speed hack, not to have to wait loadings and stuff Big Grin)

Stop it! I'm drooling....
Find all posts by this user
11-23-2013, 02:58 PM
Post: #160
RE: Online Support (PRO Online)
Nice work Kyhel, I knew that French people are the best ! Wink
LOL, just kidding Smile

♦ Intel Core i7-6700HQ | 16 GB RAM | NVIDIA GeForce GTX 960M | Debian Testing
♦ Intel Core i7-2630QM | 4 GB RAM | NVIDIA GeForce GT 540M | Debian Testing
♦ PSP-3004 | 6.60 PRO-C2
Find all posts by this user
11-23-2013, 06:43 PM
Post: #161
RE: Online Support (PRO Online)
Aha yeah we are the best Tongue

I just found what caused the problem of the windows version not being able to connect \o/

I just finish gathering the information, and will post the added modifications to make in my previous post editing it.

IMPORTANT : I only tested that it works with my pc and my mac, locally, i'll test it with 2 pc when i can, but feel free to test it and tell me if it works Big Grin

Kyhel,
French Student
Thanks to all PPSSPP team for this amazing emulator !

Experimental PPSSPP Adhoc Support build here : http://forums.ppsspp.org/showthread.php?tid=3595&pid=59241#pid59241
Please read the whole post.
Find all posts by this user
11-23-2013, 06:58 PM (This post was last modified: 11-23-2013 06:59 PM by captainobvious.)
Post: #162
RE: Online Support (PRO Online)
That's amazing news. Kyhel, could it be possible for you to post your version of a working windows binary?

Personally I've compiled _a_ windows version, but have no idea of knowing whether it works or not since I can't for the life of me get aemu to compile since I don't have a linux / mac Confused
Find all posts by this user
11-23-2013, 07:01 PM
Post: #163
RE: Online Support (PRO Online)
(11-23-2013 06:43 PM)Kyhel Wrote:  Aha yeah we are the best Tongue

I just found what caused the problem of the windows version not being able to connect \o/

I just finish gathering the information, and will post the added modifications to make in my previous post editing it.

IMPORTANT : I only tested that it works with my pc and my mac, locally, i'll test it with 2 pc when i can, but feel free to test it and tell me if it works Big Grin

ohh thank you very much i will try it now Big Grin

I worse write english so take easy on me
(even my own language realy bad T_T)

Rig to test now :
Windows 8 64 bit (Laptop)
Intel® Core™ i3-3110M (2.4GHz, 3MB L3 Cache)
Nvidia GT720M 2GB
Find all posts by this user
11-23-2013, 07:12 PM
Post: #164
RE: Online Support (PRO Online)
Can some one post a link to a already built version of the emulator?
Find all posts by this user
11-23-2013, 07:17 PM
Post: #165
RE: Online Support (PRO Online)
@captainobvious : I'm sorry you can't yet play it on the proOnline prometheus server, i quote igorcalabria :

Oh, and you can't really play with players outside your network, because the upnp stuff is still missing. Maybe you could see which ports are being used by the game and forward them manually on your router.

Since i don't know how uPnP works, and since i can't modify my router to test changes, since it's not mine but our school's, i can't help you. We can hope igorcalabria implements it as soon as possible so we can all play this, but for the moment you can just play locally, i'm really sorry for that.

Kyhel,
French Student
Thanks to all PPSSPP team for this amazing emulator !

Experimental PPSSPP Adhoc Support build here : http://forums.ppsspp.org/showthread.php?tid=3595&pid=59241#pid59241
Please read the whole post.
Find all posts by this user
Thread Closed 


Forum Jump: