prerelease: A Load of Balls - Simple arcade game

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Energy
Posts: 133
Joined: Sat Mar 26, 2005 4:13 pm
Location: uk/beds/flitwick
Contact:

prerelease: A Load of Balls - Simple arcade game

Post by Energy »

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.
gambiting
Posts: 154
Joined: Thu Aug 17, 2006 5:39 pm

Post by gambiting »

Hehe,it's nice.And it's addictive!
User avatar
Wally
Posts: 663
Joined: Mon Sep 26, 2005 11:25 am

Post by Wally »

Not bad,

Shame Oxyd isnt on the PSP yet...

:(
Energy
Posts: 133
Joined: Sat Mar 26, 2005 4:13 pm
Location: uk/beds/flitwick
Contact:

Post by Energy »

Wally4000 wrote:Not bad,

Shame Oxyd isnt on the PSP yet...

:(
Oxyd?
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

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.
Energy
Posts: 133
Joined: Sat Mar 26, 2005 4:13 pm
Location: uk/beds/flitwick
Contact:

Post by Energy »

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...
User avatar
Wally
Posts: 663
Joined: Mon Sep 26, 2005 11:25 am

Post by Wally »

Yeah, sorry to go off topic..

It just reminded me of it :(
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

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.
Energy
Posts: 133
Joined: Sat Mar 26, 2005 4:13 pm
Location: uk/beds/flitwick
Contact:

Post by Energy »

So anyone got any idea about the weird numbers that appear?
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

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).
Energy
Posts: 133
Joined: Sat Mar 26, 2005 4:13 pm
Location: uk/beds/flitwick
Contact:

Post by Energy »

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.
Energy
Posts: 133
Joined: Sat Mar 26, 2005 4:13 pm
Location: uk/beds/flitwick
Contact:

Post by Energy »

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
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

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: Select all

	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.
User avatar
Wally
Posts: 663
Joined: Mon Sep 26, 2005 11:25 am

Post by Wally »

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
Energy
Posts: 133
Joined: Sat Mar 26, 2005 4:13 pm
Location: uk/beds/flitwick
Contact:

Post by Energy »

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: Select all

	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 :)
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

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).
Energy
Posts: 133
Joined: Sat Mar 26, 2005 4:13 pm
Location: uk/beds/flitwick
Contact:

Post by Energy »

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.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

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.
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

Nice game, a lot like Missile Command, but still very original :)
Art.
Post Reply