Search found 63 matches

by memon
Thu Apr 10, 2008 8:11 pm
Forum: PSP Development
Topic: Tower Defence Target Tracker
Replies: 5
Views: 2223

Bu out of range I mean that the you are indexing outside the gunner array. A common way to do that is off by one, say, you have 3 gunners and pass i=3 to the function. Or calling function with uninitialized variable, etc. Make sure i >= 0 && i < maxgunners.
by memon
Thu Apr 10, 2008 6:50 am
Forum: PSP Development
Topic: Tower Defence Target Tracker
Replies: 5
Views: 2223

I'm pretty sure the variable 'i' is out of range. You write to the gunner array the first time just after the 'bench 6'. Often reading out of bounds will just read off garbage, but writing there is nastier. Random nit-pickings ;) - It is a good habit to initialize your variables - You can remove a c...
by memon
Wed Sep 05, 2007 10:15 pm
Forum: PSP Development
Topic: SparkFun PSP Touchscreen and Data Entry
Replies: 14
Views: 7075

IIRC PSP operates on 3.3v, so unless you want to use external power supply, the LM8500 is out of the question. LM8300 is 3.5v model, might work fine with 3.3v too. Some other controllers operating at 3.3v: Texas Instrument's TSC2005 is another one too: http://focus.ti.com/lit/ds/sbas379a/sbas379a.pd...
by memon
Tue Sep 04, 2007 10:16 pm
Forum: PSP Development
Topic: SparkFun PSP Touchscreen and Data Entry
Replies: 14
Views: 7075

Start with this and you should get your Google keywords right:

http://www.national.com/mpf/LM/LM8500.html

"Four Wire Resistive Touchscreen Controller" gets you pretty far :) I'm sure there are some example hobbyist projects around too.
by memon
Fri Apr 13, 2007 6:55 pm
Forum: PSP Development
Topic: Simple C++ Animation Class Not Working!
Replies: 9
Views: 4325

Hint:

Code: Select all

...
int frame;
int length;
...
float n = frame/length;
...
:)
by memon
Wed Jan 31, 2007 10:39 pm
Forum: PSP Development
Topic: PSP Oscilloscope
Replies: 9
Views: 4970

There are some projects around the web which purpose is to turn a pc sound card into a oscilloscope. Google: pc sound card oscilloscope You will need some special electronics to convert the signal to nice range for the sound card (or psp) to record. You will run into a problem trying to measure DC v...
by memon
Thu Sep 21, 2006 10:08 pm
Forum: PSP Development
Topic: Hi i get a bus error
Replies: 5
Views: 1803

My best guess is that you use iNumberOfGroups the wrong way. Say you have iNumberOfGroups = 1, and allocate 1 object, then tmpObj->ObjMeshPart[iNumberOfGroups] will access out of bounds. Off by one... If you want to access the last object and iNumberOfGroups is the number of objects, then it is tmpO...
by memon
Tue Sep 19, 2006 10:18 pm
Forum: PSP Development
Topic: How to correctly aply UV coords for texture?
Replies: 2
Views: 1392

This is kinda common problem. The problem is that different APIs define the texture in different ways. Some assume that the 0,0 texture coordinates are top-left, some bottom-left. First make sure your texture loading stuff loads the texture the right way, and then adjust the texture coordinates to m...
by memon
Thu Sep 14, 2006 12:14 am
Forum: PSP Development
Topic: Hardware per pixel lighting (2D)
Replies: 8
Views: 3825

If your lights are in general smooth shapes, then you could easily render to 120x68 texture and then render that on top of your current framebuffer. I have no experience how the destination alpha is handled when rendering, but if additive works there, then you should be able to handle the lighting u...
by memon
Fri Sep 01, 2006 10:20 pm
Forum: PSP Development
Topic: alter array size in struct?
Replies: 2
Views: 1269

yes... if you use C++ it is really easy: #include <vector> struct Vertex &#123; float x, y, z; &#125; ... struct Mesh &#123; std&#58;&#58;vector<Vertex> verts; &#125;; ... Mesh* m = new Mesh; int n = ReadNumVertices&#40;&#41;; m->verts.resize&#40;n&#41;; for&a...
by memon
Wed Aug 16, 2006 8:19 am
Forum: PSP Development
Topic: Blending...
Replies: 3
Views: 1960

You use alpha. In the first case you should use: GU_SRC_ALPHA, GU_ONE_MINUS_SRC_ALPHA and source alpha value of 128. In the second case use GU_SRC_ALPHA, GU_ONE and source alpha of 64. If you are using texture as source color you may want to modulate the color coming from texture with a white color ...
by memon
Sat Jul 15, 2006 11:15 pm
Forum: PSP Development
Topic: ID3 Parser Help [resolved]
Replies: 3
Views: 2253

If you try to output the strings using printf style function they need to be null terminated. So after reading a string. Try something like this: sceIoRead&#40;id3fd,TmpID3.ID3Title,30&#41;; TmpID3.ID3Title&#91;30&#93; = '\0; Your current implementation should only fail when reading ...
by memon
Wed Jul 05, 2006 3:37 am
Forum: PSP Development
Topic: PSPGL and DepthTesting problem.
Replies: 14
Views: 4810

Do you set glDepthMask? Try setting it to GL_TRUE.
by memon
Tue Jun 20, 2006 6:25 am
Forum: PSP Development
Topic: Crashs after 3 restarts
Replies: 27
Views: 9531

I have never used LUA :) and the indices are correct, i like it that way (i know it is not the correct way to do but i just like it better this way) I call those "it's nice to keep that armed shotgun around" coding habits ;) Do you check the return value of malloc and stop if it returns N...
by memon
Sun Jun 18, 2006 11:35 pm
Forum: PSP Development
Topic: Extracting amplitude/tempo from mp3/sceAudio stream
Replies: 15
Views: 6259

groepaz, this is getting a bit off topic, but here's the flower thing in a nut shell: The main stem: 1) pick 2 random numbers, the first is the lenght if a curve and the second is the curvature 2) linearly interpolate along that arc 3) if certain amount of distance has been passed, roll a dice again...
by memon
Sun Jun 18, 2006 9:57 pm
Forum: PSP Development
Topic: Extracting amplitude/tempo from mp3/sceAudio stream
Replies: 15
Views: 6259

This is how it works :) #define FILTER_SAMPLING_RATE 44100 #define FILTER_GAIN 1.0 #define FILTER_Q 0.5 typedef struct &#123; float b0, b1, b2, a0, a1, a2; float x1, x2, y1, y2; float cutoff; &#125; SAudioFilter; void InitFilter&#40; SAudioFilter* filt, float cutoff &#41; &#123; ...
by memon
Sat Jun 17, 2006 11:36 pm
Forum: PSP Development
Topic: Crashs after 3 restarts
Replies: 27
Views: 9531

Is the 1-based index to the arrays intentional? That is usually the first weapon which people coming from Lua world use to shoot their feet ;) For example if the Message is defined like this: Image* Message&#91;8&#93;; You access the array from 0 to 7. Using index 8 may work, but it will wri...
by memon
Sat Jun 17, 2006 10:50 pm
Forum: PSP Development
Topic: Extracting amplitude/tempo from mp3/sceAudio stream
Replies: 15
Views: 6259

You're right, the average of the sample values does not really mean anything (well... it is lowpass filter of some sort). As suggested earlier oneway to do beat detection is to use fourier transform, but there is easier way too :) Usually it is enough to just use set of band pass filters. That is wh...
by memon
Thu Jun 08, 2006 11:43 pm
Forum: PSP Development
Topic: scaling meshes - keeping aspect ratio
Replies: 6
Views: 3328

When you say center, you mean that you use the center of the same bounding box as you calculate in the provided code? If not, then your scale should be like this: vec3 ext; ext.x = max&#40;abs&#40;meshMin.x&#41;, meshMax.x&#41;; ext.y = max&#40;abs&#40;meshMin.y&#41;, mes...
by memon
Wed Jun 07, 2006 10:29 pm
Forum: PSP Development
Topic: scaling meshes - keeping aspect ratio
Replies: 6
Views: 3328

So... what you want to do is to use the 16bit coords, right? There are several ways you could do it, but I thinkg the easiest is not to use the same pivot as in the original mesh. If you want to get the most precision out of the 16bits, you have to translate the mesh too. Something like this should ...
by memon
Wed May 24, 2006 6:20 pm
Forum: PSP Development
Topic: Problem porting a game from PC to PSP
Replies: 17
Views: 7096

I think I'll try to keep them enabled then. Any pointers to articles of good floating point practices? The new features in psplink sound promising too regarding my debugging needs... I think it's going to be interesting weekend then :)
by memon
Tue May 23, 2006 9:57 pm
Forum: PSP Development
Topic: Problem porting a game from PC to PSP
Replies: 17
Views: 7096

Thanks for the replies. After a bit a twiddling yesterday I got another crash. This time it was floating point exception. I think it is time to install that psplink :)

I think I will still try to check that stack usage too. The code crashed if I had any assignment inside the if.
by memon
Tue May 23, 2006 6:08 am
Forum: PSP Development
Topic: Problem porting a game from PC to PSP
Replies: 17
Views: 7096

ector, Where do I define the stack size? I tried to look around but could not really found anything. My entrypoint of the code is pretty much based on the cube sample. I dont create any extra threads in my program. The another thing is how do I keep track of my stack? Is there some variable or funct...
by memon
Mon May 22, 2006 10:06 pm
Forum: PSP Development
Topic: reading a file with highscores?
Replies: 4
Views: 1761

Ghoti, I wonder what piece of code should do :) I see a bit of Lua-ism there. I think the easiest way to read/write simple records to a file is to use the fprintf/fscanf combo. Say, you want to write the name of the player and a score it could be pretty much like this: #include <stdio.h> #include <s...
by memon
Mon May 22, 2006 7:31 pm
Forum: PSP Development
Topic: Problem porting a game from PC to PSP
Replies: 17
Views: 7096

The code is indeed C++ (I think that const reference would have been a good clue ;)). The Vec3 is a class and that code works well under VC7 and GCC. The same vector class is used in code which I can verify working. I suspected bad pointers at first too. I have douple checked a lot of code to make s...
by memon
Mon May 22, 2006 7:03 am
Forum: PSP Development
Topic: Problem porting a game from PC to PSP
Replies: 17
Views: 7096

Yep, it returns correct results on my pc version and comparison operators have higher precedense (executed first) than logic ops. http://www.cppreference.com/operator_precedence.html The place where the C operator precedense usually gets hairy when you need to mask and shift, since shift has higher ...
by memon
Sun May 21, 2006 11:26 pm
Forum: PSP Development
Topic: Problem porting a game from PC to PSP
Replies: 17
Views: 7096

Problem porting a game from PC to PSP

Hi, I've been trying to port one of my games to PSP lately, but I ran into a weird crash which does not really make any sense at all. int FindClosestEdge&#40;const Vec3& pos, float maxDist, Vec3& outPos&#41; &#123; int bestIdx = UNDEF_IDX; float bestDistSqr = FLT_MAX; float maxDi...
by memon
Wed Apr 12, 2006 6:30 pm
Forum: PSP Development
Topic: Disable texturing...
Replies: 4
Views: 2406

sceGuDisable(GU_TEXTURE_2D) disables sceGuEnable(GU_TEXTURE_2D) enables.
by memon
Tue Apr 11, 2006 6:04 pm
Forum: PSP Development
Topic: Minimum Vertex size
Replies: 11
Views: 5557

I ran into the same problem too. I had to specify the color or otherwise there was nothing drawn at all. Maybe the GU_TRANSFORM_3D requires a normal or color set to work correctly? I think I did not try position only data. My SDK is quite old too, maybe something has changed.
by memon
Wed Apr 05, 2006 5:15 am
Forum: PSP Development
Topic: strange 3d issue (please help)
Replies: 5
Views: 2208

Drawing black triangles on black background? Maybe you just have the lighting turned on, and you specify no normals or no lights, and suddenly they start to affect when rendering in 3D? IIRC the 2D mode does support lighting, where the 3D definitely does. What is the size of your triangles and how y...