QT_DEFINES = -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
#QT_INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I./src/gui -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I./obj
QT_INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I./src -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I/usr/X11R6/include -I./obj
-QT_CXXFLAGS = -MMD -pipe -O2 -march=pentium-m -pipe -D_REENTRANT -Wall -W $(QT_DEFINES) -D$(SYSTYPE)
+QT_CXXFLAGS = -MMD -pipe -O2 -march=pentium-m -pipe -D_REENTRANT -Wall -W $(QT_DEFINES) -D$(SYSTYPE) -g
obj/moc_%.cpp: src/gui/%.h
@echo -e "\033[01;33m***\033[00;32m Creating $@...\033[00m"
#include "glwidget.h"
#include "settings.h"
+#include "tom.h"
+#include "video.h"
GLWidget::GLWidget(QWidget * parent/*= 0*/): QGLWidget(parent), texture(0),
textureWidth(0), textureHeight(0), buffer(0), rasterWidth(320), rasterHeight(240)
{
+// tomDeviceWidth = rasterWidth;
+ tomDeviceWidth = 1024; // It has to be the texture width...
+
+ // Set up the backbuffer
+ // To be safe, this should be 1280 * 625 * 2...
+ backbuffer = (uint32_t *)malloc(1280 * 625 * sizeof(uint32_t));
+// memset(backbuffer, 0x44, rasterWidth *
+ memset(backbuffer, 0xFF, 1024 *
+ (vjs.hardwareTypeNTSC ? rasterHeight : VIRTUAL_SCREEN_HEIGHT_PAL)
+ * sizeof(uint32_t));
}
GLWidget::~GLWidget()
{
+ delete[] backbuffer;
}
void GLWidget::initializeGL()
}
#else
JaguarExecuteNew();
- memcpy(videoWidget->buffer, backbuffer, videoWidget->rasterHeight * videoWidget->rasterWidth);
+// memcpy(videoWidget->buffer, backbuffer, videoWidget->rasterHeight * videoWidget->rasterWidth);
+ memcpy(videoWidget->buffer, backbuffer, videoWidget->rasterHeight * videoWidget->textureWidth);
// memcpy(surface->pixels, backbuffer, TOMGetVideoModeWidth() * TOMGetVideoModeHeight() * 4);
#endif
for(uint32_t y=0; y<videoWidget->rasterHeight; y++)
videoWidget->buffer[(y * videoWidget->textureWidth) + x] = 0x00000000;
#else
- for(uint32_t i=0; i<TOMGetVideoModeWidth() * 256; i++)
+// for(uint32_t i=0; i<TOMGetVideoModeWidth() * 256; i++)
+ for(uint32_t i=0; i<videoWidget->textureWidth * 256; i++)
{
uint32_t pixel = backbuffer[i];
- uint8_t b = (pixel >> 16) & 0xFF, g = (pixel >> 8) & 0xFF, r = pixel & 0xFF;
+// uint8_t b = (pixel >> 16) & 0xFF, g = (pixel >> 8) & 0xFF, r = pixel & 0xFF;
+ uint8_t r = (pixel >> 24) & 0xFF, g = (pixel >> 16) & 0xFF, b = (pixel >> 8) & 0xFF;
pixel = ((r + g + b) / 3) & 0x00FF;
- backbuffer[i] = 0xFF000000 | (pixel << 16) | (pixel << 8);
+// backbuffer[i] = 0xFF000000 | (pixel << 16) | (pixel << 8);
+ backbuffer[i] = 0x000000FF | (pixel << 16) | (pixel << 8);
}
- memcpy(videoWidget->buffer, backbuffer, videoWidget->rasterHeight * videoWidget->rasterWidth);
+// memcpy(videoWidget->buffer, backbuffer, videoWidget->rasterHeight * videoWidget->rasterWidth);
+ memcpy(videoWidget->buffer, backbuffer, videoWidget->rasterHeight * videoWidget->textureWidth);
#endif
videoWidget->updateGL();
}
-
}
void MainWin::SetZoom100(void)
//int16 * TOMBackbuffer;
uint32 * TOMBackbuffer;
+uint32 tomDeviceWidth;
+
static const char * videoMode_to_str[8] =
{ "16 BPP CRY", "24 BPP RGB", "16 BPP DIRECT", "16 BPP RGB",
"Mixed mode", "24 BPP RGB", "16 BPP DIRECT", "16 BPP RGB" };
*currentLineBuffer++ = pixel;
}
- TOMBackbuffer += GetSDLScreenWidthInPixels();
+#warning "!!! Need to move this to an interface file !!! FIX !!!"
+// TOMBackbuffer += GetSDLScreenWidthInPixels();
+ TOMBackbuffer += tomDeviceWidth;
}
}
{
tomWidth = width, tomHeight = height;
- if (vjs.renderType == RT_NORMAL)
- ResizeScreen(tomWidth, tomHeight);
+#warning "!!! TOM: ResizeScreen commented out !!!"
+// No need to resize anything, since we're prepared for this...
+// if (vjs.renderType == RT_NORMAL)
+// ResizeScreen(tomWidth, tomHeight);
}
}
}
extern uint32 tomTimerDivider;
extern int32 tomTimerCounter;
+extern uint32 tomDeviceWidth;
+
#endif // __TOM_H__
//
void ResizeScreen(uint32 width, uint32 height)
{
+// For now, we don't do anything here...
+#if 0
SDL_FreeSurface(surface);
surface = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, 32, RMASK, GMASK, BMASK, AMASK);
sprintf(window_title, "Virtual Jaguar (%i x %i)", (int)width, (int)height);
SDL_WM_SetCaption((vjs.useOpenGL ? "Virtual Jaguar (OpenGL)" : window_title), "Virtual Jaguar");
+#endif
}
//