kopia lustrzana https://github.com/Jean-MarcHarvengt/MCUME
O2EM now full screen
rodzic
8eec4cf375
commit
2b0e3107c3
Plik binarny nie jest wyświetlany.
|
@ -995,16 +995,22 @@ void PICO_DSP::writeLinePal(int width, int height, int y, uint8_t *buf, dsp_pixe
|
||||||
}
|
}
|
||||||
|
|
||||||
void PICO_DSP::writeScreenPal(int width, int height, int stride, uint8_t *buf, dsp_pixel *palette16) {
|
void PICO_DSP::writeScreenPal(int width, int height, int stride, uint8_t *buf, dsp_pixel *palette16) {
|
||||||
uint8_t *buffer=buf;
|
|
||||||
uint8_t *src;
|
uint8_t *src;
|
||||||
int i,j,y=0;
|
int i,j,y=0;
|
||||||
|
int sy = 0;
|
||||||
|
int systep=(1<<8);
|
||||||
|
int h = height;
|
||||||
|
if (height <= ( (2*fb_height)/3)) {
|
||||||
|
systep=(systep*height)/fb_height;
|
||||||
|
h = fb_height;
|
||||||
|
}
|
||||||
if (gfxmode == MODE_TFT_320x240) {
|
if (gfxmode == MODE_TFT_320x240) {
|
||||||
if (width*2 <= fb_width) {
|
if (width*2 <= fb_width) {
|
||||||
for (j=0; j<height; j++)
|
for (j=0; j<h; j++)
|
||||||
{
|
{
|
||||||
uint16_t * block=blocks[y>>6];
|
uint16_t * block=blocks[y>>6];
|
||||||
uint16_t * dst=&block[(y&0x3F)*fb_stride];
|
uint16_t * dst=&block[(y&0x3F)*fb_stride];
|
||||||
src=buffer;
|
src=&buf[(sy>>8)*stride];
|
||||||
for (i=0; i<width; i++)
|
for (i=0; i<width; i++)
|
||||||
{
|
{
|
||||||
uint16_t val = palette16[*src++];
|
uint16_t val = palette16[*src++];
|
||||||
|
@ -1012,54 +1018,31 @@ void PICO_DSP::writeScreenPal(int width, int height, int stride, uint8_t *buf, d
|
||||||
*dst++ = val;
|
*dst++ = val;
|
||||||
}
|
}
|
||||||
y++;
|
y++;
|
||||||
if (height*2 <= fb_height) {
|
sy+=systep;
|
||||||
block=blocks[y>>6];
|
|
||||||
dst=&block[(y&0x3F)*fb_stride];
|
|
||||||
src=buffer;
|
|
||||||
for (i=0; i<width; i++)
|
|
||||||
{
|
|
||||||
uint16_t val = palette16[*src++];
|
|
||||||
*dst++ = val;
|
|
||||||
*dst++ = val;
|
|
||||||
}
|
|
||||||
y++;
|
|
||||||
}
|
|
||||||
buffer += stride;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (width <= fb_width) {
|
else if (width <= fb_width) {
|
||||||
for (j=0; j<height; j++)
|
for (j=0; j<h; j++)
|
||||||
{
|
{
|
||||||
uint16_t * block=blocks[y>>6];
|
uint16_t * block=blocks[y>>6];
|
||||||
uint16_t * dst=&block[(y&0x3F)*fb_stride+(fb_width-width)/2];
|
uint16_t * dst=&block[(y&0x3F)*fb_stride+(fb_width-width)/2];
|
||||||
src=buffer;
|
src=&buf[(sy>>8)*stride];
|
||||||
for (i=0; i<width; i++)
|
for (i=0; i<width; i++)
|
||||||
{
|
{
|
||||||
uint16_t val = palette16[*src++];
|
uint16_t val = palette16[*src++];
|
||||||
*dst++ = val;
|
*dst++ = val;
|
||||||
}
|
}
|
||||||
y++;
|
y++;
|
||||||
if (height*2 <= fb_height) {
|
sy+=systep;
|
||||||
block=blocks[y>>6];
|
|
||||||
dst=&block[(y&0x3F)*fb_stride+(fb_width-width)/2];
|
|
||||||
src=buffer;
|
|
||||||
for (i=0; i<width; i++)
|
|
||||||
{
|
|
||||||
uint16_t val = palette16[*src++];
|
|
||||||
*dst++ = val;
|
|
||||||
}
|
|
||||||
y++;
|
|
||||||
}
|
|
||||||
buffer += stride;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else { // VGA
|
else { // VGA
|
||||||
if (width*2 <= fb_width) {
|
if (width*2 <= fb_width) {
|
||||||
for (j=0; j<height; j++)
|
for (j=0; j<h; j++)
|
||||||
{
|
{
|
||||||
vga_pixel * dst=&framebuffer[y*fb_stride];
|
vga_pixel * dst=&framebuffer[y*fb_stride];
|
||||||
src=buffer;
|
src=&buf[(sy>>8)*stride];
|
||||||
for (i=0; i<width; i++)
|
for (i=0; i<width; i++)
|
||||||
{
|
{
|
||||||
uint16_t pix = palette16[*src++];
|
uint16_t pix = palette16[*src++];
|
||||||
|
@ -1067,44 +1050,23 @@ void PICO_DSP::writeScreenPal(int width, int height, int stride, uint8_t *buf, d
|
||||||
*dst++ = VGA_RGB(R16(pix),G16(pix),B16(pix));
|
*dst++ = VGA_RGB(R16(pix),G16(pix),B16(pix));
|
||||||
}
|
}
|
||||||
y++;
|
y++;
|
||||||
if (height*2 <= fb_height) {
|
sy+=systep;
|
||||||
vga_pixel * dst=&framebuffer[y*fb_stride];
|
|
||||||
src=buffer;
|
|
||||||
for (i=0; i<width; i++)
|
|
||||||
{
|
|
||||||
uint16_t pix = palette16[*src++];
|
|
||||||
*dst++ = VGA_RGB(R16(pix),G16(pix),B16(pix));
|
|
||||||
*dst++ = VGA_RGB(R16(pix),G16(pix),B16(pix));
|
|
||||||
}
|
|
||||||
y++;
|
|
||||||
}
|
|
||||||
buffer += stride;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (width <= fb_width) {
|
else if (width <= fb_width) {
|
||||||
for (j=0; j<height; j++)
|
for (j=0; j<h; j++)
|
||||||
{
|
{
|
||||||
vga_pixel * dst=&framebuffer[y*fb_stride +(fb_width-width)/2];
|
vga_pixel * dst=&framebuffer[y*fb_stride+(fb_width-width)/2];
|
||||||
src=buffer;
|
src=&buf[(sy>>8)*stride];
|
||||||
for (i=0; i<width; i++)
|
for (i=0; i<width; i++)
|
||||||
{
|
{
|
||||||
uint16_t pix = palette16[*src++];
|
uint16_t pix = palette16[*src++];
|
||||||
*dst++ = VGA_RGB(R16(pix),G16(pix),B16(pix));
|
*dst++ = VGA_RGB(R16(pix),G16(pix),B16(pix));
|
||||||
}
|
}
|
||||||
y++;
|
y++;
|
||||||
if (height*2 <= fb_height) {
|
sy+=systep;
|
||||||
vga_pixel * dst=&framebuffer[y*fb_stride +(fb_width-width)/2];
|
|
||||||
src=buffer;
|
|
||||||
for (i=0; i<width; i++)
|
|
||||||
{
|
|
||||||
uint16_t pix = palette16[*src++];
|
|
||||||
*dst++ = VGA_RGB(R16(pix),G16(pix),B16(pix));
|
|
||||||
}
|
|
||||||
y++;
|
|
||||||
}
|
|
||||||
buffer += stride;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue