154 |
static uint8 deskcache[0x38400]; |
static uint8 deskcache[0x38400]; |
155 |
|
|
156 |
/* Retrieve desktop data from the cache */ |
/* Retrieve desktop data from the cache */ |
157 |
uint8 *cache_get_desktop(uint32 offset, uint32 length) |
uint8 *cache_get_desktop(uint32 offset, int cx, int cy) |
158 |
{ |
{ |
159 |
|
int length = cx * cy; |
160 |
|
|
161 |
if ((offset + length) <= sizeof(deskcache)) |
if ((offset + length) <= sizeof(deskcache)) |
162 |
{ |
{ |
163 |
return &deskcache[offset]; |
return &deskcache[offset]; |
168 |
} |
} |
169 |
|
|
170 |
/* Store desktop data in the cache */ |
/* Store desktop data in the cache */ |
171 |
void cache_put_desktop(uint32 offset, uint32 length, uint8 *data) |
void cache_put_desktop(uint32 offset, int cx, int cy, int scanline, uint8 *data) |
172 |
{ |
{ |
173 |
|
int length = cx * cy; |
174 |
|
|
175 |
if ((offset + length) <= sizeof(deskcache)) |
if ((offset + length) <= sizeof(deskcache)) |
176 |
{ |
{ |
177 |
memcpy(&deskcache[offset], data, length); |
while (cy--) |
178 |
|
{ |
179 |
|
memcpy(&deskcache[offset], data, cx); |
180 |
|
data += scanline; |
181 |
|
offset += cx; |
182 |
|
} |
183 |
} |
} |
184 |
else |
else |
185 |
{ |
{ |