|
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
View previous topic :: View next topic |
Author |
Message |
Fakeuser
Joined: 01 Sep 2007 Posts: 15
|
Posted: Sun Jun 20, 2010 12:27 am Post subject: How to use SyncDCache properyly? |
|
|
I'm probably having trouble with SyncDCache.It doesn't work.
It's a font program.
There is a 640x480 PSMCT4 image(mem_image) in the memory.
Font data was converted to PSMCT4 format on the fly,then was writed into this image,and was displayed.
Problem is:When display() runs,it always display things that should be displayed last time.
Eg:I first write "X" font data,display() runs,it display nothing.
then I write "Y" font data,display() runs,it display "X".
then I write "Z" font data,display() runs,it display "Y".
.....
can someone help me?
Code: |
static inline void putpixel(unsigned char *memimg,unsigned char* src, int offset)
{
// font width 20 height 23
int i,j,x,y;
x=offset%32;
y=offset/32;
x=x*(20/2);
y=(y*2)*(640/2);
for(j=0;j<18;j++){
for(i=0;i<9;i++){
memimg[y+j*(640/2)+x+i]=src[j*9+i];
}
}
SyncDCache(memimg+y, memimg+y+(640/2)*23);
}
static int display(unsigned char *pixel, int num)
{
unsigned char buf[512];
convToPSMCT4(pixel, buf);
putpixel(mem_image,buf,num);
gs_load(mem_image);
displayfont();
......
}
|
|
|
Back to top |
|
|
Mega Man
Joined: 18 Jun 2005 Posts: 274
|
Posted: Fri Jun 25, 2010 8:58 am Post subject: |
|
|
I assume that SyncDCache is working, but the problem is somewhere else. Maybe you are confusing the frame buffers or there is just a missing GS_TEXFLUSH or your data is not properly aligned. What graphic library are you using? |
|
Back to top |
|
|
Fakeuser
Joined: 01 Sep 2007 Posts: 15
|
Posted: Thu Jul 01, 2010 9:08 pm Post subject: |
|
|
Thanks your attention.
Forget it,I found it's old pcsx2's fault.:p |
|
Back to top |
|
|
|
|
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
|