Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // gui_sdl.c
- // Set up lcdsurface
- SDL_PixelFormat* pxlformat;
- int w = 128;
- int h = 64;
- pxlformat=screen->format;
- lcdsurface = SDL_CreateRGBSurface(SDL_SRCALPHA|SDL_SRCCOLORKEY|SDL_SWSURFACE,
- w,
- h,
- pxlformat->BitsPerPixel,
- pxlformat->Rmask,
- pxlformat->Gmask,
- pxlformat->Bmask,
- pxlformat->Amask);
- // guilcd_sdl.c
- void PaintLCD()
- {
- printf_d("[SDLWabbitemu] [PaintLCD] Function called!\n");
- unsigned char *thescreen;
- LCD_t *lcd = lpCalc->cpu.pio.lcd;
- //wxSize rc = this->mainFrame->GetClientSize();
- int scale = lpCalc->scale;
- int draw_width = lcd->width * scale;
- int draw_height = 64 * scale;
- //wxPoint drawPoint((rc.GetWidth() - draw_width) / 2, 0);
- if (lpCalc->SkinEnabled) {
- //drawPoint.x = lpCalc->LCDRect.GetX();
- //drawPoint.y = lpCalc->LCDRect.GetY();
- }
- //wxMemoryDC wxMemDC;
- if (lcd->active == false) {
- unsigned char lcd_data[128*64];
- memset(lcd_data, 0, sizeof(lcd_data));
- unsigned char rgb_data[128*64*3];
- int i, j;
- for (i = j = 0; i < 128*64; i++, j+=3) {
- rgb_data[j] = redColors[lcd_data[i]];
- rgb_data[j+1] = greenColors[lcd_data[i]];
- rgb_data[j+2] = blueColors[lcd_data[i]];
- }
- /*wxImage screenImage(128, 64, rgb_data, true);
- wxBitmap bmpBuf(screenImage.Scale(128 * scale, 64 * scale).Size(rc, wxPoint(0,0)));
- wxMemDC.SelectObject(bmpBuf);
- //copy to the screen
- wxDCDest->Blit(drawPoint.x, drawPoint.y, draw_width, draw_height, &wxMemDC, 0, 0);
- wxMemDC.SelectObject(wxNullBitmap);*/
- lcdsurface->pixels = rgb_data;
- } else {
- thescreen = LCD_image( lpCalc->cpu.pio.lcd ) ;
- unsigned char rgb_data[128*64*3];
- int i, j;
- for (i = j = 0; i < 128*64; i++, j+=3) {
- rgb_data[j] = redColors[thescreen[i]];
- rgb_data[j+1] = greenColors[thescreen[i]];
- rgb_data[j+2] = blueColors[thescreen[i]];
- }
- /*wxImage screenImage(128, 64, rgb_data, true);
- wxBitmap bmpBuf(screenImage.Scale(128 * scale, 64 * scale).Size(rc, wxPoint(0,0)));
- wxMemDC.SelectObject(bmpBuf);
- //finally copy up the screen image
- wxDCDest->Blit(drawPoint.x, drawPoint.y, draw_width, draw_height, &wxMemDC, 0, 0);
- wxMemDC.SelectObject(wxNullBitmap);*/
- lcdsurface->pixels = rgb_data;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment