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 

DMAC stub

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



Joined: 31 Aug 2004
Posts: 244
Location: Somewhere over the rainbow

PostPosted: Sun Oct 23, 2005 1:58 am    Post subject: DMAC stub Reply with quote

Can somebody tell me what's wrong with this stub ?

Quote:
STUB_START "sceDmac",0x40010000,0x00010005
STUB_FUNC 0x617f3fe6,sceDmacMemcpy
STUB_END


is the linkage module flag 0x40010000 wrong ?

Calling sceDmacMemcpy, causes a bus error in my app... :(
_________________
- TiTAN Art Division -
http://www.titandemo.org
Back to top
View user's profile Send private message Visit poster's website
groepaz



Joined: 01 Sep 2005
Posts: 305

PostPosted: Sun Oct 23, 2005 3:01 am    Post subject: Reply with quote

try using aligned addresses for source/dest. (i'd start with page aligned, then reduce alignment until it crashes again so you can find out whats the minimum required)
_________________
http://www.hitmen-console.org
http://hitmen.c02.at/files/yapspd/
Back to top
View user's profile Send private message Visit poster's website
Arjan



Joined: 24 Apr 2005
Posts: 12
Location: Netherlands

PostPosted: Sun Oct 23, 2005 6:00 am    Post subject: Reply with quote

I used this stub:

STUB_START "sceDmac",0x40010000,0x00020005
STUB_FUNC 0x617f3fe6,sceDmacMemcpy
STUB_FUNC 0xd97f94d8,sceDmacTryMemcpy
STUB_END

int sceDmacMemcpy(void *dest, const void *source, unsigned int size);
int sceDmacTryMemcpy(void *dest, const void *source, unsigned int size);

I used sceDmacMemcpy only once in an experiment to see if it would speed up transferring data from ram to vram (or vram to vram, don't have the sourcecode of those tests anymore). Transferring an array of 512 bytes worked fine for me, an array of 272*228*2 (124032) bytes worked too.

If the source data was placed in ram, I've either been lucky with the memory alignment, or it could be alignment didn't matter.
If I did place te source data placed in vram after all, the start address would've been 0x44100000.
Destination address in all cases was at pixel 0 of a display line in vram (with 15bit color mode).

I was probably just lucky my parameters met the alignment requirements, but at least you should be able to create something that works now. After that you can try breaking it to find out how many bytes alignment is needed (my guess would be 2 or 4 bytes).
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
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