Search found 739 matches

by hlide
Mon Feb 22, 2010 6:02 am
Forum: PSP Development
Topic: fopen VS. sceIoOpen ?
Replies: 20
Views: 14999

Not yet, but it would be easy because of Rafael's fd management that keeps track of the filename that goes with each open file. You could add a field to __psp_descriptormap_type to store the offset, and then add two hook functions: one that loops through all open file FDs and gets the offset, then ...
by hlide
Sat Feb 20, 2010 4:04 am
Forum: PSP Development
Topic: fopen VS. sceIoOpen ?
Replies: 20
Views: 14999

sceIoOpen is buggy when it comes to relative paths. I don't recall the details, but the newlib wrappers just canonicalize everything before passing to sceIoOpen. Unless you're really performance sensitive, you should use the newlib wrappers when available. They're easier to use (since they're well-...
by hlide
Wed Feb 17, 2010 7:22 am
Forum: PSP Development
Topic: fopen VS. sceIoOpen ?
Replies: 20
Views: 14999

Always use sceIo* functions instead of f* functions. Why ? f* uses buffers. The issue is if you let PSP to go in standby whereas you have FILE* handles open, you'll get problem when you wake up your PSP.
by hlide
Sun Jan 03, 2010 8:07 am
Forum: PSP Development
Topic: Media Engine?
Replies: 165
Views: 140504

Going back to dcache_wbinv_all Wouldn't: void dcache_wbinv_all&#40;&#41; &#123; int i; for&#40;i = 0; i < 8192; i += 64&#41; &#123; __builtin_allegrex_cache&#40;0x14, i&#41;; __builtin_allegrex_cache&#40;0x14, i&#41;; &#125; &#125; Use a few less cycl...
by hlide
Thu Dec 24, 2009 10:36 pm
Forum: PSP Development
Topic: [QUESTION] How to flush instruction cache?
Replies: 4
Views: 8000

sheeh, another guy trying to port it... a port of a port of a port... dude, it's like redoing ps1p or psxp...
by hlide
Tue Dec 22, 2009 5:08 am
Forum: PSP Development
Topic: ctc0 and cfc0
Replies: 9
Views: 5032

m0skit0 wrote:I knew what the MIPS standard said about it, but not what PSP firmware used them for. Thanks for info.
yeah, i realised too late. But let's say it might be instructive for other people ;).
by hlide
Sun Dec 20, 2009 5:04 am
Forum: PSP Development
Topic: ctc0 and cfc0
Replies: 9
Views: 5032

but this is the first instruction executed by the psp (the first instruction of the preipl).. how is it possible to copy v0 to $4? what is it stored in v0? ok, you don't know how the hardware of a processor runs. When resetting, you call a interrupt handler. Under a very specific condition, when se...
by hlide
Sun Dec 20, 2009 4:49 am
Forum: PSP Development
Topic: ctc0 and cfc0
Replies: 9
Views: 5032

@m0skit0: $k0 and $k1 : kernel registers - those registers used to be reserved by the an OS as temporary save/restore registers in a interrupt/exception handler. PSP firmware uses them for another purpose : $k0, something like KTLS probably (not sure about it as i don't care about) and $k1 to contai...
by hlide
Thu Dec 17, 2009 7:52 pm
Forum: PSP Development
Topic: ctc0 and cfc0
Replies: 9
Views: 5032

when calling an interrupt/exception handler, psp uses to save $v0 and $v1 into COP0 $4 and $5(not sure for it) so the handler can use $v0 and $v1 for temporary need. At the end of the handler, it restores original values of $v0 and $v1 through those both COP0 registers. Normally MIPS uses $k0 and $k...
by hlide
Fri Dec 04, 2009 5:59 am
Forum: PSP Development
Topic: Decompile
Replies: 8
Views: 4082

Re: Decompile

dark_hex wrote:BUT THE ORIGINAL MAIN.C ARE VERY DIFERENT.
WHAT IS THE PROBLEM?
in mathematical term, compiling and decompiling are not bijective. So if you are expecting to get your original source, you're not qualified.
by hlide
Mon Nov 23, 2009 5:09 am
Forum: PSP Development
Topic: Error: unrecognized opcode `lv'
Replies: 15
Views: 6738

__asm__ volatile &#40; "lv.q C000, %0\n" "lv.q C100, %1\n" "vsub.t C000, C000, C100\n" "vdot.t S010, C000, C000\n" "vsqrt.s S010, S010\n" "sv.s S010, %2\n" &#58; "m"&#40;*v1&#41;,"m"&#40;*v2&#41;...
by hlide
Fri Nov 20, 2009 2:51 am
Forum: PSP Development
Topic: Error: unrecognized opcode `lv'
Replies: 15
Views: 6738

I mean you must post the exact code of your function using "lv.q" which are not working. I'm not sure you are using __asm constraints correctly.
by hlide
Wed Nov 18, 2009 9:18 pm
Forum: PSP Development
Topic: Error: unrecognized opcode `lv'
Replies: 15
Views: 6738

your case is weird. C++ or C isn't the issue.
I use Heimdal' pspsdk and never fail with lv.q.

I'm not sure you're using them in gcc correctly
by hlide
Wed Nov 18, 2009 6:11 am
Forum: PSP Development
Topic: Error: unrecognized opcode `lv'
Replies: 15
Views: 6738

use heimdal's pspsdk.
by hlide
Tue Nov 17, 2009 4:37 am
Forum: PSP Development
Topic: Error: unrecognized opcode `lv'
Replies: 15
Views: 6738

__asm__ volatile &#40; "lv.q C000, %1\n" "lv.q C100, %2\n" "vsub.t C000, C000, C100\n" "vdot.t S010, C000, C000\n" "vsqrt.s S010, S010\n" "sv.s S010, %0\n" &#58; "=r"&#40;result&#41;&#58;"m"&#40;...
by hlide
Mon Nov 16, 2009 3:41 am
Forum: PSP Development
Topic: Error: unrecognized opcode `lv'
Replies: 15
Views: 6738

if you don't care about compatibility with PSP1K (fat/phat/tank), you can use "ulv.q" to load your vectors and just compute with .t. Normally the fourth component of a vector is not changed by the computation so you can store it through "usv.q". But in your example, a "sv.s&...
by hlide
Sat Nov 14, 2009 9:21 pm
Forum: PSP Development
Topic: About releasing MoHH eloader source code
Replies: 58
Views: 39377

The problem is: If we release syscall estimation code with the eLoader, Sony will probably find another method to randomize syscalls. And if this happens, the work we have done will be nearly useless. I'm sure they aren't going to TOTALLY randomize syscalls (it's a BIG waste of memory), but a great...
by hlide
Tue Nov 03, 2009 5:36 am
Forum: PSP Development
Topic: Error using VFPU matrix 3?
Replies: 19
Views: 11500

Criptych wrote:Okay, I understand the concept but I'd never heard that term used before. Thanks. :)
This is a technical term. Just google it and you'll find a ton.
by hlide
Mon Nov 02, 2009 7:33 am
Forum: PSP Development
Topic: Error using VFPU matrix 3?
Replies: 19
Views: 11500

I'm not sure I understand what you mean by a "save-callee" register. Are you saying the values in other registers get clobbered anyway? Ok, a caller is the code which calls a function. Callee is the code of the called function. Locals in a function are allocated through save-callee regist...
by hlide
Sun Nov 01, 2009 8:24 pm
Forum: PSP Development
Topic: Error using VFPU matrix 3?
Replies: 19
Views: 11500

Okay, it accepts "$f2." But does that last part mean you can't use clobber constraints or that their values won't get clobbered? If the former, it sounds like crazyc's idea won't work. :( I tried to use this feature in my old yapse4psp (psx emulator) and found out it only works on save-ca...
by hlide
Wed Oct 21, 2009 7:09 am
Forum: PSP Development
Topic: Error using VFPU matrix 3?
Replies: 19
Views: 11500

@crazyc: Adding clobber constraints gave me several errors like "error: unknown register name '$fp2' in 'asm.'" But since I'm not using ulv.q anymore, I wouldn't worry about it. if I'm not wrong, it should be '$fpr2' or '$f2'. And it only works for save-callee registers, which are $f20-$f...
by hlide
Wed Oct 21, 2009 6:56 am
Forum: PSP Development
Topic: Error using VFPU matrix 3?
Replies: 19
Views: 11500

the issue is only with ulv.q, not with usv.q. You have choice between lv.q (16-byte alignment) or lv.s (if you use 2D for instance). Okay, I've changed my code to use only lv.q, and seems to be working. Normaly I added an option to psp-gcc to make stack alignment to what you want. It is the same op...
by hlide
Wed Oct 21, 2009 3:57 am
Forum: PSP Development
Topic: Error using VFPU matrix 3?
Replies: 19
Views: 11500

I'll give it a shot. Is this register corruption the only reason not to use ulv.q/usv.q? From what I read in the diggins they aren't significantly slower than the aligned version; how do they compare to lv.s/sv.s * 4? the issue is only with ulv.q, not with usv.q. You have choice between lv.q (16-by...
by hlide
Tue Oct 20, 2009 11:24 am
Forum: PSP Development
Topic: Error using VFPU matrix 3?
Replies: 19
Views: 11500

yeah, ulvq is corrupting fpu registers, i tested it on my old psp1k. As long as you need to be compatible, you have no choice but no using ulvq.

can you be more precise about which instructions are giving bad results ?
by hlide
Thu Oct 15, 2009 6:24 am
Forum: PSP Development
Topic: VFPU: problem with vtfm3.t
Replies: 4
Views: 3258

can you be more precise about what you get with vtfm3.t ?
by hlide
Thu Oct 15, 2009 6:06 am
Forum: PSP Development
Topic: VFPU: problem with vtfm3.t
Replies: 4
Views: 3258

on PSP1000, using ULV wiill scratch FPU register with the same index so if you are using VFPU register $C000 to load it from memory, you're modifying $fpr0 with the same value as $S000 as well. That's why you MUST never use ULV if you plan to keep compatibily with psp1000. The reason is ULV is mappe...
by hlide
Tue Aug 18, 2009 10:10 pm
Forum: PSP Development
Topic: [SOLVED]Bézier Patches on PSP
Replies: 10
Views: 6169

You sorta use sceGuPatchDivide to set the level of details as it is GE which will subdivide your nodes into a 2 x udiv x vdiv vertex list to draw. Is it your intention for getHeightAt not to be aware of the level of details? If you really want to have a more accurate height, you need to take into ac...
by hlide
Sun Aug 09, 2009 8:53 pm
Forum: PSP Development
Topic: undefined reference to `vtable'?
Replies: 3
Views: 2090

Shop shop = new Shop(); I'm sorry but : Shop *shop = new Shop; is perfectly valid and should not be the issue. And you're plainly wrong without "*". @OP: It seems Shop.o is missing in your OBJS flag (Makefile), so it cannot resolve the address of your VMT which is normally defined in Shop...
by hlide
Sat Aug 08, 2009 8:02 am
Forum: PSP Development
Topic: Kernel to user jump?
Replies: 10
Views: 3702

%&#58;include<stdio.h> int _&#40;int __,int ___,int ____,int _____&#41; <%for&#40;;____<___;_____=_____*__,____++&#41;; return _____;%>main&#40;&#41;<%printf &#40;"%d\n",_&#40;2,5,0,1&#41;&#41;;%> main&#40;&#41;<%printf&#40;"32\...
by hlide
Mon Aug 03, 2009 12:48 am
Forum: PSP Development
Topic: Reverse Engineering ToolKit
Replies: 5
Views: 2671

Arrrf arrf arrff i cannot stop laughing !!! and you call it a toolkit !?

sheeh... you could at least make a RAD using those tools !