forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

prerelease: A Load of Balls - Simple arcade game

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Energy



Joined: 26 Mar 2005
Posts: 133
Location: uk/beds/flitwick

PostPosted: Fri Jun 08, 2007 3:11 am    Post subject: prerelease: A Load of Balls - Simple arcade game Reply with quote

Hey all,
Download kxploited files - Now bug free!

Ok so now I got my devkit kinda working again, I thought I'd compile my 'lost' demo. This was a little game I made when quite tipsy on new years eve and then lost the code (it's been found again, hence the release). It's graphically simple and won't change your life, but it's a bit of fun and might give you a few mins of fun.

Before I get to work again on my bigger projects I thought I'd get this out and about. The version here is fully playable, however options have been disabled and I've got a weird bug, which I'm told by a lecturer that it's a compiler error.

Basically as you play the game in rounds the score is recorded, this is stored in a varible currentScore, at the end of each round finalScore gets currentScore added to it, and currentScore is put in an array then the currentScore varible gets set to 0 ready for the next round. At the end of 3 rounds the final score and each rounds score is pulled from the array. However the array values are mucked up.
Example:
Round 1 - Score stored: 1702194793 (Real value 17)
Round 2 - Score stored: 3026478 (Real Value 14)
Round 3 - Score stored: 30 (Real Value 30)

total: 61

The total is correct as shown, however if I don't put the values in the array the finalScore value becomes the sum of the corrupted values (I literally mean if I comment out the results[round] = currentScore; then the problem swaps). Oh well, so yeah.

I don't want to publicly release the source code yet because it's not that great, but if someone particularly wants to look at the issue then give me a shout.

Also this isn't a release so no uploading this to any other sites or posting about it on news sites. This is for ps2dev.org users only!!! thanks

Download kxploited files


Last edited by Energy on Sat Jun 09, 2007 11:33 am; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
gambiting



Joined: 17 Aug 2006
Posts: 154

PostPosted: Fri Jun 08, 2007 3:27 am    Post subject: Reply with quote

Hehe,it's nice.And it's addictive!
Back to top
View user's profile Send private message
Wally



Joined: 26 Sep 2005
Posts: 672

PostPosted: Fri Jun 08, 2007 9:30 am    Post subject: Reply with quote

Not bad,

Shame Oxyd isnt on the PSP yet...

:(
Back to top
View user's profile Send private message AIM Address
Energy



Joined: 26 Mar 2005
Posts: 133
Location: uk/beds/flitwick

PostPosted: Fri Jun 08, 2007 9:32 am    Post subject: Reply with quote

Wally4000 wrote:
Not bad,

Shame Oxyd isnt on the PSP yet...

:(

Oxyd?
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Fri Jun 08, 2007 9:43 am    Post subject: Reply with quote

Energy wrote:
Wally4000 wrote:
Not bad,

Shame Oxyd isnt on the PSP yet...

:(

Oxyd?


He means Enigma. I looked at that... I think the dependencies will make it a pain to port. SDL is okay, but Xerces looks like a pain to port to the PSP.
Back to top
View user's profile Send private message AIM Address
Energy



Joined: 26 Mar 2005
Posts: 133
Location: uk/beds/flitwick

PostPosted: Fri Jun 08, 2007 9:54 am    Post subject: Reply with quote

J.F. wrote:
Energy wrote:
Wally4000 wrote:
Not bad,

Shame Oxyd isnt on the PSP yet...

:(

Oxyd?


He means Enigma. I looked at that... I think the dependencies will make it a pain to port. SDL is okay, but Xerces looks like a pain to port to the PSP.


Never really ported anything, if it was simple I'd give it a go. Tho slightly mithed as to why the 2nd reply on this thread seems like a request lol. Did checkout enigma just to have a look tho...
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Wally



Joined: 26 Sep 2005
Posts: 672

PostPosted: Fri Jun 08, 2007 10:54 am    Post subject: Reply with quote

Yeah, sorry to go off topic..

It just reminded me of it :(
Back to top
View user's profile Send private message AIM Address
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Sat Jun 09, 2007 5:16 am    Post subject: Reply with quote

It's a game with balls, too. :) I really loved Oxyd, and play Enigma on my computer these days. I'll maybe make an attempt to port it when I get some time to look into Xerces-c++. Enigma on the PSP would be awesome.
Back to top
View user's profile Send private message AIM Address
Energy



Joined: 26 Mar 2005
Posts: 133
Location: uk/beds/flitwick

PostPosted: Sat Jun 09, 2007 7:36 am    Post subject: Reply with quote

So anyone got any idea about the weird numbers that appear?
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Sat Jun 09, 2007 8:28 am    Post subject: Reply with quote

Energy wrote:
So anyone got any idea about the weird numbers that appear?


Hard to tell without the source. Could be an aliasing issue (trying to add two ints via pointers cast to the wrong type, etc).
Back to top
View user's profile Send private message AIM Address
Energy



Joined: 26 Mar 2005
Posts: 133
Location: uk/beds/flitwick

PostPosted: Sat Jun 09, 2007 8:36 am    Post subject: Reply with quote

J.F. wrote:
Energy wrote:
So anyone got any idea about the weird numbers that appear?


Hard to tell without the source. Could be an aliasing issue (trying to add two ints via pointers cast to the wrong type, etc).


I'm gonna release the code shortly, as warned it's not great. Just doing some final clean ups.
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Energy



Joined: 26 Mar 2005
Posts: 133
Location: uk/beds/flitwick

PostPosted: Sat Jun 09, 2007 8:58 am    Post subject: Reply with quote

Sorry for the double post:
Here is the source code. Feel a bit naked showing this, it's all pretty simple, but the coding is a bit sloppy. As said the game was done in a night (although the rest of the files were pre-exsisting). I've cut a bit of crap out the source, including the features that were incomplete, however this builds to the binarys that are availble.

Maybe someone can work out what went wrong:
Download ALoB PreRelease Source
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Sat Jun 09, 2007 11:15 am    Post subject: Reply with quote

Energy wrote:
Sorry for the double post:
Here is the source code. Feel a bit naked showing this, it's all pretty simple, but the coding is a bit sloppy. As said the game was done in a night (although the rest of the files were pre-exsisting). I've cut a bit of crap out the source, including the features that were incomplete, however this builds to the binarys that are availble.

Maybe someone can work out what went wrong:
Download ALoB PreRelease Source


Well, that was simple...

Code:
   char ost[20];
   int currentScore = 0;


ost is too small. You're overwriting currentScore when you set ost with sprintf() in several places. This kind of buffer overflow is common if you aren't careful.
Back to top
View user's profile Send private message AIM Address
Wally



Joined: 26 Sep 2005
Posts: 672

PostPosted: Sat Jun 09, 2007 11:17 am    Post subject: Reply with quote

J.F. wrote:
It's a game with balls, too. :) I really loved Oxyd, and play Enigma on my computer these days. I'll maybe make an attempt to port it when I get some time to look into Xerces-c++. Enigma on the PSP would be awesome.


:) Basilisk 2 can play Oxyd :P So can dosbox i suppose
Back to top
View user's profile Send private message AIM Address
Energy



Joined: 26 Mar 2005
Posts: 133
Location: uk/beds/flitwick

PostPosted: Sat Jun 09, 2007 11:18 am    Post subject: Reply with quote

J.F. wrote:
Energy wrote:
Sorry for the double post:
Here is the source code. Feel a bit naked showing this, it's all pretty simple, but the coding is a bit sloppy. As said the game was done in a night (although the rest of the files were pre-exsisting). I've cut a bit of crap out the source, including the features that were incomplete, however this builds to the binarys that are availble.

Maybe someone can work out what went wrong:
Download ALoB PreRelease Source


Well, that was simple...

Code:
   char ost[20];
   int currentScore = 0;


ost is too small. You're overwriting currentScore when you set ost with sprintf() in several places. This kind of buffer overflow is common if you aren't careful.


ah ha!
thank you- as said, it was new years eve. I was tipsy lol.
making the change now :)
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Sat Jun 09, 2007 11:19 am    Post subject: Reply with quote

Wally4000 wrote:
J.F. wrote:
It's a game with balls, too. :) I really loved Oxyd, and play Enigma on my computer these days. I'll maybe make an attempt to port it when I get some time to look into Xerces-c++. Enigma on the PSP would be awesome.


:) Basilisk 2 can play Oxyd :P So can dosbox i suppose


Yes, and I like the Mac version of oxyd, but Enigma would be better - it would be native, and can be extended (more levels, custom levels, yada yada).
Back to top
View user's profile Send private message AIM Address
Energy



Joined: 26 Mar 2005
Posts: 133
Location: uk/beds/flitwick

PostPosted: Sat Jun 09, 2007 11:31 am    Post subject: Reply with quote

I've updated (hopefully) both the source and the binary with the update, and also a thanks to you J.F. now included in the readme. :)

I think tommorrow I'll put the options back in and put it out officially to people, then I'll get back to my more interesting projects. Tho this has taught me to look a bit more carefully at what I've done >_<

Thanks J.F.
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Sat Jun 09, 2007 11:38 am    Post subject: Reply with quote

Energy wrote:
I've updated (hopefully) both the source and the binary with the update, and also a thanks to you J.F. now included in the readme. :)

I think tommorrow I'll put the options back in and put it out officially to people, then I'll get back to my more interesting projects. Tho this has taught me to look a bit more carefully at what I've done >_<

Thanks J.F.


You're welcome. Works fine now for me. Nice little game! Interesting idea... took me a few tries to get the hang of it, but I got a 98 so far. :)


Oh, another thing about converting Enigma - it calls lua from within the program to build the levels. I don't know if PSP programs can call PSP lua that way.
Back to top
View user's profile Send private message AIM Address
Art



Joined: 09 Nov 2005
Posts: 647

PostPosted: Sun Jun 10, 2007 9:35 pm    Post subject: Reply with quote

Nice game, a lot like Missile Command, but still very original :)
Art.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group