There are a number of things that could complicate this but to keep it simple I will assume:
- There are no intellectual property issues (i.e. Peter is not profiting from James' IP). Remember, there is no IP in ideas. However, there is CopyRight in computer code (among other things); if Peter is using James' code then James is entitled to a) make Peter stop or b) take a share of the profits (or both).
- Peter and James did not formally form a partnership or company.
- There is no written agreement between Peter and James.
So, this just hinges on what Peter and James agreed when:
- They began working on the project,
- James stopped working on the project.
In the initial situation what they agreed may or may not have amounted to a contract; the main reason why it wouldn't is whether they intended to be legally bound. Making an agreement to "have bit of fun and see what happens" does not create a contract; agreeing to pursue the project as a real business venture probably does and probably creates a common-law partnership as well.
Notwithstanding, if you had asked Peter and James what their intensions regarding any future profits when they started and were working on the project, what would they have said? Probably, they would have said that they intended to split the profits equally. Let's take this as the most likely hypothesis.
How does this agreement change when James leaves the project? Again, a court will ask the same question: if you had asked Peter and James what their intensions regarding were regarding any future profits when James had just left, what would they have said? This depends on how close the project was to commercialisation.
If a lot of work was still required before commercialisation then, probably, James would have said that he has no further interest in the project and good luck to Peter. In this case James is not entitled to anything.
If commercialisation was just around the corner then, probably James would have said that Peter should be paid for bring the commercialisation about and the profits should be spilt after Peter takes his pay.
A court would try to give force to what was agreed at the time; not with the benefit of hindsight.