mirror of
https://github.com/opentx/opentx.git
synced 2025-07-17 05:15:18 +03:00
simu CPU optimizations
This commit is contained in:
parent
42f82cbbed
commit
8a545ee60b
1 changed files with 19 additions and 3 deletions
|
@ -412,7 +412,11 @@ long Open9xSim::onTimeout(FXObject*, FXSelector, void*)
|
||||||
}
|
}
|
||||||
|
|
||||||
per10ms();
|
per10ms();
|
||||||
|
static int timeToRefresh;
|
||||||
|
if (++timeToRefresh >= 5) {
|
||||||
|
timeToRefresh = 0;
|
||||||
refreshDisplay();
|
refreshDisplay();
|
||||||
|
}
|
||||||
getApp()->addTimeout(this, 2, 10);
|
getApp()->addTimeout(this, 2, 10);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -425,11 +429,15 @@ long Open9xSim::onTimeout(FXObject*, FXSelector, void*)
|
||||||
|
|
||||||
void Open9xSim::setPixel(int x, int y, FXColor color)
|
void Open9xSim::setPixel(int x, int y, FXColor color)
|
||||||
{
|
{
|
||||||
|
#if LCD_ZOOM > 1
|
||||||
for (int i=0; i<LCD_ZOOM; ++i) {
|
for (int i=0; i<LCD_ZOOM; ++i) {
|
||||||
for (int j=0; j<LCD_ZOOM; ++j) {
|
for (int j=0; j<LCD_ZOOM; ++j) {
|
||||||
bmp->setPixel(LCD_ZOOM*x+i, LCD_ZOOM*y+j, color);
|
bmp->setPixel(LCD_ZOOM*x+i, LCD_ZOOM*y+j, color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
bmp->setPixel(x, y, color);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void Open9xSim::refreshDisplay()
|
void Open9xSim::refreshDisplay()
|
||||||
|
@ -445,9 +453,17 @@ void Open9xSim::refreshDisplay()
|
||||||
#if defined(PCBHORUS)
|
#if defined(PCBHORUS)
|
||||||
display_t z = simuLcdBuf[y * LCD_W + x];
|
display_t z = simuLcdBuf[y * LCD_W + x];
|
||||||
if (1) {
|
if (1) {
|
||||||
|
if (z == 0) {
|
||||||
|
setPixel(x, y, FXRGB(0,0,0));
|
||||||
|
}
|
||||||
|
else if (z == 0xFFFF) {
|
||||||
|
setPixel(x, y, FXRGB(255,255,255));
|
||||||
|
}
|
||||||
|
else {
|
||||||
FXColor color = FXRGB(255*((z&0xF800)>>11)/0x1f, 255*((z&0x07E0)>>5)/0x3F, 255*(z&0x001F)/0x01F);
|
FXColor color = FXRGB(255*((z&0xF800)>>11)/0x1f, 255*((z&0x07E0)>>5)/0x3F, 255*(z&0x001F)/0x01F);
|
||||||
setPixel(x, y, color);
|
setPixel(x, y, color);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#elif defined(PCBFLAMENCO)
|
#elif defined(PCBFLAMENCO)
|
||||||
display_t z = simuLcdBuf[y * LCD_W + x];
|
display_t z = simuLcdBuf[y * LCD_W + x];
|
||||||
if (1) {
|
if (1) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue