Search found 75 matches

by starman2049
Fri May 26, 2006 2:18 pm
Forum: PSP Development
Topic: Part of screen black
Replies: 2
Views: 1200

I was plagued by something like this for months, although my black section of screen was more like 10%, not the 25% you are describing, and there are a number of possible reasons for this. My black screen came and went as I added code to an expanding project. For me I discovered (rather randomly) th...
by starman2049
Thu May 25, 2006 11:35 am
Forum: PSP Development
Topic: ERROR DOWNLOADING TOOLCHAIN. NEED HELP!
Replies: 3
Views: 1586

I got this same error and later realized that in between the time that I originally setup my linux box and now, that my ISP changed DNS servers and so I had to update DNS servers in the etc/resolv.conf file NB: I am on Linux not cygwin so I don't know if there is a similiar thing on cygwin or not......
by starman2049
Thu May 18, 2006 2:05 pm
Forum: PSP Development
Topic: Inline VFPU help
Replies: 16
Views: 6754

Here's a much faster atan2 routine. This isn't in VFPU format (yet), but I thought I would post for now and update later. This is about 10 times faster than the default atan2 routine. PLEAE NOTE: this is a low order approximation and should only be used when you need precision to a few digits. I use...
by starman2049
Wed May 17, 2006 5:01 am
Forum: PSP Development
Topic: Homebrew for PSP Publishers
Replies: 12
Views: 6639

Looks like there's a variety of ways to do this. My main concern was that there might not be *any* way to do this short of getting my game compiling and running under a licensed development environment, and it sounds like there are a couple of ways to do this. I am going to try just sending a mem ca...
by starman2049
Tue May 16, 2006 12:29 pm
Forum: PSP Development
Topic: Homebrew for PSP Publishers
Replies: 12
Views: 6639

thank you!!
by starman2049
Tue May 16, 2006 9:25 am
Forum: PSP Development
Topic: Homebrew for PSP Publishers
Replies: 12
Views: 6639

Homebrew for PSP Publishers

This is kind of off-topic, and I hope I don't get booted for asking this, but I was showing my game on PSP Homebrew at E3 and several publishers were interested in getting a copy of my game on PSP for internal evaluation. Question is how to do this? I assume that if you are a licensed publisher you ...
by starman2049
Thu May 04, 2006 10:39 am
Forum: PSP Development
Topic: Inline VFPU help
Replies: 16
Views: 6754

Here is a matrix copy routine. This is about 6 times faster than in software: // NOTE: m0, m1 must be 16 byte aligned!! // NOTE: this is row-major matrix format void myCopyMatrix(FMATRIX m1, FMATRIX m0) { __asm__ volatile ( "lv.q R000, 0x0&#4...
by starman2049
Thu May 04, 2006 9:53 am
Forum: PSP Development
Topic: freeze psp with asm inline function
Replies: 7
Views: 2824

You have to make sure that your matrices have 16 byte alignment. Meaning that the starting address of the [0][0] element is a multiple of 16 bytes for each matrix. I define a float matrix as: typedef float FMATRIX[4][4] __attribute__((aligned(1...
by starman2049
Thu May 04, 2006 9:44 am
Forum: PSP Development
Topic: Inline VFPU help
Replies: 16
Views: 6754

Here is a Matrix Multiply routine. This is about 10 times faster than in software: // NOTE: m0, m1, m2 must be 16 byte aligned!! // NOTE: this is row-major matrix format void myMulMatrix(FMATRIX m2, FMATRIX m0, FMATRIX m1) { __asm__ volatile ( "l...
by starman2049
Thu May 04, 2006 9:03 am
Forum: PSP Development
Topic: Inline VFPU help
Replies: 16
Views: 6754

Here is an applyMatrix routine. This is about 4 times faster than in software. // NOTE: v0, m0, v1 must be 16 byte aligned!! // NOTE: this is row-major matrix format void myApplyMatrix(FVECTOR v0, FMATRIX m0, FVECTOR v1) { __asm__ volatile ( "lv....
by starman2049
Thu May 04, 2006 8:15 am
Forum: PSP Development
Topic: freeze psp with asm inline function
Replies: 7
Views: 2824

lv.q and sv.q require data to be quadword aligned. meaning the starting address of the argumants needs to be multiples of 16 bytes.
by starman2049
Sat Apr 29, 2006 3:29 am
Forum: PSP Development
Topic: Inline VFPU help
Replies: 16
Views: 6754

float myacosf(float val) { float ret; __asm__ volatile ( "mtv %1, S000\n" "vasin.s S001, S000\n" "vone.s S002\n" "vsub.s S000, S002, S001\n" "vcst.s S002, VFPU_PI_2\n" "vmul.s S001, S000, S002\n" "mfv ...
by starman2049
Fri Apr 28, 2006 11:58 am
Forum: PSP Development
Topic: Inline VFPU help
Replies: 16
Views: 6754

These are probably done in newlib or elsewhere already, but if you have the latest toolchain you should be able to implement your own math functions that are MUCH faster. Note you have to add "|" PSP_THREAD_ATTR_VFPU into your PSP_MAIN_THREAD_ATTR() def in main.c. float mysqrtf(flo...
by starman2049
Thu Apr 27, 2006 7:12 pm
Forum: PSP Development
Topic: Inline VFPU help
Replies: 16
Views: 6754

Well I still can't get into svn, but I was able to get my sqrt(), sin(), cos(), etc over to VFPU and got a very nice speed-up so thank you to everyone who helped with this!!
by starman2049
Thu Apr 27, 2006 8:22 am
Forum: PSP Development
Topic: Inline VFPU help
Replies: 16
Views: 6754

Can't get anywhere with this. I'm on september '05 toolchain and sdk so the VFPU stuff is not builtin so I had to stick with codegen.h approach. Unfortunatly there is no mtv/mvf and I spent some time trying to add those opcodes to little avail. Then I decided to update my toolchain and grabbed the l...
by starman2049
Sun Apr 23, 2006 3:50 pm
Forum: PSP Development
Topic: Inline VFPU help
Replies: 16
Views: 6754

Inline VFPU help

I am trying to replace the sqrt() function using the codegen.h approach and have written the following but it has a bug. I am a new at inline assembler and can't get the following to work (it just returns the value I pass it) float mysqrt(float val) { register float a=val; r...
by starman2049
Sun Apr 23, 2006 1:42 pm
Forum: PSP Development
Topic: HUD/Font Aspect Ratio theory
Replies: 2
Views: 1237

OK, thanks for the input. This is what I figured, but I wanted to make sure there wasn't something obvious that I was missing before I recode my whole shell/hud.

I see what you mean about coding to width/height relative values, that's a good tip...

Thanks!
by starman2049
Sun Apr 23, 2006 8:01 am
Forum: PSP Development
Topic: HUD/Font Aspect Ratio theory
Replies: 2
Views: 1237

HUD/Font Aspect Ratio theory

I've got a cross-platform game that was built for 4:3 aspect ratio and am trying to figure out how to best adjust the HUD/Font/Shell/Menuing system to adapt to the 16:9 on PSP. As a quick hack I just played around with scale the best I could so that fonts and other hud elements were scaled to close ...
by starman2049
Sun Apr 23, 2006 7:51 am
Forum: PSP Development
Topic: Adding sound to C project? Should I use SDL?
Replies: 2
Views: 1656

Unless I missed something there is no turn-key solution on PSP - except using opensource stuff like SDL, etc. I *think* Lua project supports audio playback too. I thought that since the PSP is such a powerful multimedia device that it would have built-in support for playing .WAV, MP3/4, etc with one...
by starman2049
Sun Apr 23, 2006 7:43 am
Forum: PSP Development
Topic: Blending revisited.
Replies: 1
Views: 1349

Here's what I do, don't know if this will help you or not: On init: sceGuBlendFunc(GU_ADD, GU_SRC_ALPHA, GU_ONE_MINUS_SRC_ALPHA, 0, 0); sceGuEnable(GU_BLEND); When I set the texture, I set my modulation accordingly: if (pMaterial->has_alpha) sceGuTexFu...
by starman2049
Mon Apr 17, 2006 4:06 am
Forum: PSP Development
Topic: Minimum Vertex size
Replies: 11
Views: 5619

I haven't tried indexed vertex arrays. I didn't consider that, I remember reading somewhere on the forums (I think it was CHP) that this was slower. Anyway I found a HUGE boost. I switched from 32bit draw/render/zbuffer to 16 bit and now I have a ton more memory so I can preload all my textures into...
by starman2049
Sun Apr 16, 2006 4:41 am
Forum: PSP Development
Topic: what is the correct way using a pregenerated command list
Replies: 3
Views: 2838

You can optimize your vertex format. Right now you are using floats for everything (UV, COLOR, XYZ). An easy fix would be to convert your UV from float to 16bit. You can convert the others too, but thats going to require some special transforms. Drawing 480 cubes on top of each other is a lot of ove...
by starman2049
Sat Apr 15, 2006 1:33 pm
Forum: PSP Development
Topic: Help with srcfix and dstfix parameters in Blending function.
Replies: 2
Views: 1805

Don't know if this is what you are looking for but:

Code: Select all

sceGuTexFunc(GU_TFX_MODULATE,GU_TCC_RGBA);
Is something I use.

Keep in mind that Texture Modulation and Blending via vertex colors/lighting are two different but related operations.
by starman2049
Sat Apr 15, 2006 1:29 pm
Forum: PSP Development
Topic: what is the correct way using a pregenerated command list
Replies: 3
Views: 2838

There are no silver bullets on PSP, just a whole lot of little things that all add up to a bigger performance improvement. Off the top of my head it looks like you are doing 120 texture sets per frame, and to boot they are from system ram, not vram, and they are not swizzled. I try to keep the numbe...
by starman2049
Sat Apr 15, 2006 9:29 am
Forum: PSP Development
Topic: Minimum Vertex size
Replies: 11
Views: 5619

This is around 15k triangles and 20+ textures, plus a skin animated character that is around 2000 triangles. I export my geometry from 3DStudioMax as pre-formated vertex arrays so all I do is point to the list in memory and call drawArray(). I am using triangles, not triangle strips and I am startin...
by starman2049
Sat Apr 15, 2006 2:17 am
Forum: PSP Development
Topic: Misc Crashes
Replies: 29
Views: 14787

I've been fighting this every day for two months. Every time I make a code change I have to add/subtract unused lines of sprintf's (outside my main loop) so that it does not crash and/or does not have graphic corruption. I'm pretty sertain it has to do with alignment, because 90% of the time it just...
by starman2049
Fri Apr 14, 2006 10:17 am
Forum: PSP Development
Topic: Minimum Vertex size
Replies: 11
Views: 5619

Yes, that is set in my loop. The problem is not that it draws it with the wrong color, but rather it just draws "all messed up" if I only send UV(16b), XYZ(16b). I am ok becasue I just send along color and it is just a little slower. This may seem like a tiny detail, but I am fighting to g...
by starman2049
Thu Apr 13, 2006 7:18 am
Forum: PSP Development
Topic: Disable texturing...
Replies: 4
Views: 2447

PSP graphics rendering is state based, so you can in one frame sceGuEnable(GU_TEXTURE_2D) and render a bunch of textured triangles, then sceGuDisable(GU_TEXTURE_2D) and render a bunch of un-textured triangles and back and forth.

I use this method and it works for sure.
by starman2049
Tue Apr 11, 2006 9:09 am
Forum: PSP Development
Topic: Minimum Vertex size
Replies: 11
Views: 5619

Minimum Vertex size

Has anyone noticed that there appears to be a minimum vertex size? GU_TEXTURE_16BIT|GU_VERTEX_16BIT|GU_TRANSFORM_3D Does not seem to work for me, but: GU_TEXTURE_16BIT|GU_COLOR_5551|GU_VERTEX_16BIT|GU_TRANSFORM_3D does work. I have made sure my padding is correct for both cases. Has anyone else seen...
by starman2049
Tue Apr 11, 2006 6:11 am
Forum: PS2 Development
Topic: Minimum Vertex Size
Replies: 1
Views: 1491

Minimum Vertex Size

Has anyone noticed that there appears to be a minimum vertex size? GU_TEXTURE_16BIT|GU_VERTEX_16BIT|GU_TRANSFORM_3D Does not seem to work for me, but: GU_TEXTURE_16BIT|GU_COLOR_5551|GU_VERTEX_16BIT|GU_TRANSFORM_3D does work. I have made sure my padding is correct for both cases. Has anyone else seen...