now with display!
This commit is contained in:
parent
3c883a2152
commit
a8aa834c16
|
@ -299,7 +299,6 @@ void EmuThread::run()
|
||||||
|
|
||||||
SDL_Delay(100);
|
SDL_Delay(100);
|
||||||
}
|
}
|
||||||
printf("ran iteration: status=%d run=%d\n", EmuStatus, EmuRunning);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EmuStatus = 0;
|
EmuStatus = 0;
|
||||||
|
@ -325,6 +324,7 @@ void EmuThread::run()
|
||||||
void EmuThread::emuRun()
|
void EmuThread::emuRun()
|
||||||
{
|
{
|
||||||
EmuRunning = 1;
|
EmuRunning = 1;
|
||||||
|
RunningSomething = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmuThread::emuPause(bool refresh)
|
void EmuThread::emuPause(bool refresh)
|
||||||
|
@ -348,10 +348,14 @@ void EmuThread::emuStop()
|
||||||
|
|
||||||
MainWindowPanel::MainWindowPanel(QWidget* parent) : QWidget(parent)
|
MainWindowPanel::MainWindowPanel(QWidget* parent) : QWidget(parent)
|
||||||
{
|
{
|
||||||
|
screen[0] = new QImage(256, 192, QImage::Format_RGB32);
|
||||||
|
screen[1] = new QImage(256, 192, QImage::Format_RGB32);
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindowPanel::~MainWindowPanel()
|
MainWindowPanel::~MainWindowPanel()
|
||||||
{
|
{
|
||||||
|
delete screen[0];
|
||||||
|
delete screen[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindowPanel::paintEvent(QPaintEvent* event)
|
void MainWindowPanel::paintEvent(QPaintEvent* event)
|
||||||
|
@ -361,7 +365,19 @@ void MainWindowPanel::paintEvent(QPaintEvent* event)
|
||||||
// fill background
|
// fill background
|
||||||
painter.fillRect(event->rect(), QColor::fromRgb(0, 0, 0));
|
painter.fillRect(event->rect(), QColor::fromRgb(0, 0, 0));
|
||||||
|
|
||||||
painter.fillRect(0, 0, 256, 192, QColor::fromRgb(0, 255, 255));
|
int frontbuf = GPU::FrontBuffer;
|
||||||
|
if (!GPU::Framebuffer[frontbuf][0] || !GPU::Framebuffer[frontbuf][1]) return;
|
||||||
|
|
||||||
|
memcpy(screen[0]->scanLine(0), GPU::Framebuffer[frontbuf][0], 256*192*4);
|
||||||
|
memcpy(screen[1]->scanLine(0), GPU::Framebuffer[frontbuf][1], 256*192*4);
|
||||||
|
|
||||||
|
QRect src = QRect(0, 0, 256, 192);
|
||||||
|
|
||||||
|
QRect dstTop = QRect(0, 0, 256, 192); // TODO
|
||||||
|
QRect dstBot = QRect(0, 192, 256, 192); // TODO
|
||||||
|
|
||||||
|
painter.drawImage(dstTop, *screen[0]);
|
||||||
|
painter.drawImage(dstBot, *screen[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
|
#include <QImage>
|
||||||
|
|
||||||
|
|
||||||
class EmuThread : public QThread
|
class EmuThread : public QThread
|
||||||
|
@ -55,6 +56,9 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void paintEvent(QPaintEvent* event) override;
|
void paintEvent(QPaintEvent* event) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
QImage* screen[2];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue