graph.c help

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
Hedonis
Posts: 6
Joined: Wed May 25, 2005 4:38 am

graph.c help

Post by Hedonis »

Heya's, ive dont alot of reading/trial and error but im still stumped on how to use graph from the ps2sdk to use a chain and write an image to the screen. I get absolutely nothing on screen or junk if I play around with the BITBLTBUF settings..

shouldnt a call to graph_vram_write be enough to achieve this?

address = 0
width = 128
height = 128
psm = GS_PSM_CT24
data = Tex->mem (loaded correctly in to memory)
data_size = 128x128x24 bits = 49152 bytes (which is 3072 Qwords)

if someone can point me in the right direction it would be very appreciated!
Hed
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

Writing data directly to the framebuffer can be tricky due to the weird ways the GS uses vram.

You might get better results by writing the data offscreen and use a textured sprite primitive to draw it onscreen.

Still, graph_vram_write() should be enough. I'd suggest you make sure the framebuffer and texture are the same bit depth (CT24 in this case) and make sure Tex->mem is correctly aligned in main memory (use memalign instead of malloc).
Post Reply