18extern QWORD GsPrimWorkArea[];
20int GsLoadImage(
const void *source_addr,
GS_IMAGE *dest)
23 const unsigned char *pTexSrc;
24 unsigned int current, max, remainder, img_qwc;
49 p=UNCACHED_SEG(GsPrimWorkArea);
56 GsDmaSend(GsPrimWorkArea, 5);
60 max = img_qwc / 16384;
61 remainder = img_qwc % 16384;
63 pTexSrc = (
const unsigned char *)source_addr;
64 for(i=0;(
unsigned int)i<max;i++)
69 gs_setGIF_TAG(((
GS_GIF_TAG *)&p[0]), current,1,0,0,GS_GIF_IMAGE,0,0x00);
71 GsDmaSend(GsPrimWorkArea, 1);
75 GsDmaSend(pTexSrc, current);
78 pTexSrc += current*16;
87 gs_setGIF_TAG(((
GS_GIF_TAG *)&p[0]), current,1,0,0,GS_GIF_IMAGE,0,0x00);
89 GsDmaSend(GsPrimWorkArea, 1);
93 GsDmaSend(pTexSrc, current);
101static unsigned int vr_addr=0;
102static unsigned int vr_tex_start=0;
103static unsigned int vr_2ndtolast_alloc=0;
105int GsVramAllocFrameBuffer(s16 w, s16 h, s16 psm)
107 int size, remainder, ret, byte_pp;
137 size = ((w*h)*byte_pp)/4;
144 remainder = (vr_addr % (2048));
147 vr_addr += ((2048)-remainder);
149 ret = vr_addr/(2048);
151 vr_tex_start = vr_addr;
156int GsVramAllocTextureBuffer(s16 w, s16 h, s16 psm)
158 int size, remainder, ret, byte_pp;
185 size = ((w*h)*byte_pp)/4;
192 remainder = (vr_addr % (64));
195 vr_2ndtolast_alloc = vr_addr;
198 vr_addr += ((64)-remainder);
208 vr_addr = vr_tex_start;
212int VramFreeLastTextureBuffer()
214 if(vr_2ndtolast_alloc)
216 vr_addr = vr_2ndtolast_alloc;
217 vr_2ndtolast_alloc =0;
222void GsVramFreeAll(
void)
void GsVramFreeAllTextureBuffer(void)