ps3lines homebrew game

Investigation into how Linux on the PS3 might lead to homebrew development.

Moderators: cheriff, emoon

Post Reply
edepot
Posts: 111
Joined: Sat Apr 09, 2005 3:39 pm

ps3lines homebrew game

Post by edepot »

Well, I taken a dip and spent some time to crank out my first PS3 linux homebrew game. More like a demo.

Plug in your gamepad to your ps3 using usb cable, then run the program.
Use the left analog stick to move and use the right analog for color effects.

You should be able to control colorful lines. I think it should work on any
resolution even running under X. I have tried it under 1080p.

I hope it works on your ps3. Can people try it out and tell me if it works?
Give your PS3 version (20 or 60g) and the resolution of your monitor.
Thanks.
ralferoo
Posts: 122
Joined: Sat Mar 03, 2007 9:14 am
Contact:

Post by ralferoo »

You missed the link, although I found it at the bottom of http://www.edepot.com/playstation3.html

I tried it out in 576i and 480i and just got a short diagonal line the first couple of times. Eventually, the thing started moving after much stick waggling but it soon seemed to stop responding to the stick... It doesn't help that I'm not sure what it's supposed to do... :(
carlosn
Posts: 38
Joined: Thu Mar 10, 2005 2:14 am
Location: Orlando, Florida, US
Contact:

Post by carlosn »

When I first run your program, I only saw a diagonal line. After that the program did not respond. I was somewhat concern that it was malicious code. I started disecting the binary file just to make sure that the program did not do anything funny. It looked ok so I decided to run it again. The second time it produced some output on the screen, consecutive lines that are controled by the left stick. If you move the right stick, the lines change color. It reminded me of a screen saver, I've seen in the past.
The program run at 480p, 720p and 1080p just fine.
If you would have distributed the source code, you would have saved me some time of inspecting your binary file.
edepot
Posts: 111
Joined: Sat Apr 09, 2005 3:39 pm

ps3lines version .02

Post by edepot »

Ok, I enhanced it a bit. Now it checks the boundaries if it is not 1920x1080p (the default).
It shouldn't hang anymore. Also, now if you press the "select" button it clears the
screen (to black). If you press the playstation button on the gamepad, it should fill
the screen to the current draw color.

The draw color is controlled by the right analog stick.

Left: increase red
Up: increase green
Right: increase blue
Down: decrease all colors (towards black)

If you want it to reset to white, push left a while, then up a while then right a while (so all values of RGB=255). You should do it while moving the left analog stick so you see the change.

If you want to exit, press the "start" button.

When moving the left analog stick try moving in circles, that way you get good patterns.

Hope this runs fine on ALL resolutions now! I tried this under X and I think it should work
on non-X also on all resolutions! If it hangs again let me know, but I think it should be fine now.
edepot
Posts: 111
Joined: Sat Apr 09, 2005 3:39 pm

version 0.3

Post by edepot »

I wanted to see if it is possible to do the same thing as the PSP, so I updated
the ps3lines to include some sound. The joystick input is very bad. sometimes it
gets stuck in a pos. looks like the default joystick routines are not useable in a real game.
If someone figures this out, please tell me!

Maybe someone can create a homebrew executer (linux XMB?) like how you can execute eboots on PSP, but for PS3, so people can just add this program somewhere in their linux installation (maybe a program that will insert itself automatically in any linux distribution when run), and when you boot up ps3 it asks if you wish to run some prepackaged ps3 linux games or boot into linux. and people would simply pass around packages of ps3 linux games to place into a directory for easy installation. if that is not possible I don't think there are not enough ps3 users that can compile and run code just to try your program. (the market is too small !).

I think many people here are religious about giving away the source code. I don't seem
to understand why. most game and software companies don't go around giving away their source, and if they do it is only years and years after they are not the current technology. But since I did get some help, I'll help out with the following...
It is the sound routine used in ps3lines that you can download at http://www.edepot.com/game.html

The code is below... you just have to fix some typos (look in the includes for correct function names)...
http://www.linuxforums.org/forum/linux- ... d-pcm.html
ldesnogu
Posts: 94
Joined: Sat Apr 17, 2004 10:37 pm

Re: version 0.3

Post by ldesnogu »

edepot wrote:I think many people here are religious about giving away the source code. I don't seem
to understand why. most game and software companies don't go around giving away their source, and if they do it is only years and years after they are not the current technology. But since I did get some help, I'll help out with the following...
This is not a religious thing, it's just so handy to have source code from others to get things up to speed for the community.
You admit you took code from someone else. Aren't you happy it was available?

Unless you are doing paid work under NDA, I can't see any reason to hide code, unless you are ashamed of it :)

And no I don't want to start a war, just wanted to point out some incoherency in your post ;) After all everyone is free to do it his own way.
edepot
Posts: 111
Joined: Sat Apr 09, 2005 3:39 pm

ps3

Post by edepot »

Yeah, I can understand where you are coming from. On the one hand you want the community to flourish by giving out free code. On the other hand there are people who wish to keep their code private. I think there are tradeoffs from each. I think there are many reasons why people wish to keep their code private. The main one being they don't want others to steal their work. The main reason why java and .net are not successful (besides being too slow) is because they are easily decompileable (unless they use native interfaces and have C code underneath). The other main reason is that with private code you can have a way to make profit from your work (which is kinda important given that the current world revolves around profit for basic needs). As for free code, I don't mind it at all. I think it helps a lot, but I think attaching GPL to it would prevent people from using it, because it restricts what they can do with their own code if some GNU code were included).
edepot
Posts: 111
Joined: Sat Apr 09, 2005 3:39 pm

code

Post by edepot »

I need to do a followup because PS3 doesn't allow typing more than 512 characters in an entrybox. But you brought up an important point. I think the reason why makers of expensive games (like MGS4 or Halo3) would never release their code is because they want to keep profitting from their work. If GPL one day comes up with a model that allows people to use GPL code but not restrict their ability to make a profit (by allowing personal code to exist without releasing to public) then they will be more successful. Why do you think YDL releases their code a month later? Because they want to make a profit in the first month via ydl.net account. It's the only way they can make a profit, but many people still wait for the free download. I think Microsoft is probably half happy that GPL existed, because they know there won't be powerful companies using GPL software (they can't make enough money to compete with them). One last point, many scene demo coders don't release their source to protect their tricks.
ralferoo
Posts: 122
Joined: Sat Mar 03, 2007 9:14 am
Contact:

Licenses and the GPL

Post by ralferoo »

edepot wrote:The main reason why java and .net are not successful (besides being too slow) is because they are easily decompileable
By most metrics, Java and .net are successful, depending of course on the application domain. For instance in a web domain, the choice is basically Java/.net/ruby/perl. You'd be hard pressed to find anyone that thinks C is a sensible choice. In the FPS game arena, it's basically C/C++ or nothing. And that's purely because speed is the most important metric.

People in the commercial world on the whole rely on licenses and IP law to protect their software rather than obfuscation, especially for business to business software. If someone wants to figure out how something works, code obfuscation or even using a compiled language really isn't a barrier. In fact, you'll discover if you try disassembling C code you'll seem learn the idioms the compiler uses frequently to compile the various building blocks, like how it prefers to write loop structures, how it encodes conditionals, etc.
If GPL one day comes up with a model that allows people to use GPL code but not restrict their ability to make a profit (by allowing personal code to exist without releasing to public) then they will be more successful.
There already is - the LGPL. And for those who aren't particularly keen on GPL (like myself), there are many, many others. Good licenses include Apache, BSD, creative commons, etc...
It's the only way they can make a profit, but many people still wait for the free download.
You'll discover that there are basically two types of software users - those who will always take the free version, even if it means waiting, and those that will always buy the commercial version for support, regardless of whether the free version is available or not. This in fact is pretty much the basis of the business model offered by Linux vendors.
One last point, many scene demo coders don't release their source to protect their tricks.
Maybe. However, most good demo coders worth their salt would figure out for themselves how to achieve a result. As merely a mediocre demo coder, I remember disassembling a large number of Red Sector's demos back around 1990 when they were about the best available because I wanted to figure out how they worked. Some of my friends just went away and had independent ideas and came up with even better things because their view of "state of the art" hadn't been moulded by preconceptions of others.

As an example, my plasma demo wasn't original by any means, it was simply a rehashing of an old formula, in fact I discovered how that effect was created exactly by decompiling an old demo way back before I really had any concept of sine waves and interference patterns (I'm guessing I must have been about 12 at the time!)

Really, it comes down to a personal preference and there's no reason to be coerced into releasing your source if you don't want to. Personally, I know that nothing I'm writing now is saleable, so I'm happy to give it away in the hopes that others find it useful.

Oh, one last thing. Releasing software under a license doesn't restrict you from also releasing it under another, either at the same time or in the future. For instance, if you release something under GPL where it must have source available, there's nothing to stop you also selling it as binary-only or even selling full rights to the source to someone else for them to sell as binary-only. The only thing that's an issue is if someone else contributes code to your project, then you either need to get them to assign copyright to you or agree a license with you such that you have full rights to use their source in any way you see fit (essentially the same, except that they also retain full rights to their work). This is essentially the meaning of "All rights reserved" that is frequently attached to software. Also, you cannot later downgrade the rights you've assigned to someone with a licence unless there are explicit clauses in the contract that limit rights to a certain timeframe or other conditions.

Another last thing is that many people consider the GPL to be anti-commercial rather than free, as it's basically parasitic infecting everything that touches it. LGPL is a step in the right direction, but many companies (including the one I work for) would never touch GPL source with a bargepole. Apache or BSD-style licences hold the view that if you're giving something away then why do you care if someone else makes some money on it. GPL more holds the view that if you're not making money on something then no-one else should either.
mbf
Posts: 55
Joined: Fri Aug 18, 2006 7:43 pm

Re: Licenses and the GPL

Post by mbf »

Just to add a bit on what ralferoo just said, the copyright and license under which a software is released are different things. Releasing the code doesn't necessarily voids your rights on it, unless you explicitely do so in the acompanying license.

Now as far as Open Source vs. Closed Source goes, I'm all for open source in a comunity oriented context (like PS3 Linux). Building on what the others did before you makes things evolve a lot faster. And that doesn't stop some people from coming up with new ideas either. It also helps prevent all this stupid bickering about who wrote what first and who "stole" code from whom as we've seen far too often with the PSP. I'm very happy with someone reusing my code to make something better (as long as credit is given where credit is due), or just have a look at it and tell me how to fix the tidbits that are not working that well ;)
ralferoo wrote:Really, it comes down to a personal preference and there's no reason to be coerced into releasing your source if you don't want to. Personally, I know that nothing I'm writing now is saleable, so I'm happy to give it away in the hopes that others find it useful.
Nothing to add to that ;)
edepot
Posts: 111
Joined: Sat Apr 09, 2005 3:39 pm

ps3

Post by edepot »

I think you hit upon an important point and maybe a wakeup call. Coding homebrew has few revenue opportunities. Until there is some sort of support officially or unofficially, people coding on it can't expect to be making money or living off of work doing it. And I think the same applies to open source coding (unless you happen to work for a company that pays you to code open source stuff). Most likely the main benefit is learning and maybe some fame (directly recognized or not). Is there a path to profit doing coding for the SPE and SPU? I think not unless you beat the odds and end up working on an actual PS3 game in a game company, or the even less likely... working on the 20K+ cell blades used in mainframes. Which is kind of sad. Maybe Sony should open up the XMB and allow people to download and install stuff from other people's websites (like how windows allows it), that should really make the PS3 take off as a platform. They can even keep the GPU restricted and let people create number crunching apps that don't need lots of fast GPU graphics (you can create lots of apps with simple software drawn windowing graphics). I don't think it would hurt their profit in the games nor the bluray stuff. But other than that sharing is fine, and I think the more people release helpful source code the better, but keep the restrictions on what people can do with it at a minimum. I liked the first helloworld for PSP... no restrictions and see how that took off.
Post Reply