mirror of https://github.com/mgba-emu/mgba.git
GBA Video: Clean up video enum values
This commit is contained in:
parent
a85ae6563c
commit
346e436b52
|
@ -26,19 +26,17 @@
|
|||
#define GBA_B8(X) (((X) >> 7) & 0xF8)
|
||||
|
||||
enum {
|
||||
VIDEO_CYCLES_PER_PIXEL = 4,
|
||||
|
||||
VIDEO_HORIZONTAL_PIXELS = 240,
|
||||
VIDEO_HBLANK_PIXELS = 68,
|
||||
VIDEO_HDRAW_LENGTH = 1006,
|
||||
VIDEO_HBLANK_LENGTH = 226,
|
||||
VIDEO_HORIZONTAL_LENGTH = 1232,
|
||||
VIDEO_HORIZONTAL_LENGTH = VIDEO_HDRAW_LENGTH + VIDEO_HBLANK_LENGTH,
|
||||
|
||||
VIDEO_VERTICAL_PIXELS = 160,
|
||||
VIDEO_VBLANK_PIXELS = 68,
|
||||
VIDEO_VERTICAL_TOTAL_PIXELS = 228,
|
||||
VIDEO_VERTICAL_TOTAL_PIXELS = VIDEO_VERTICAL_PIXELS + VIDEO_VBLANK_PIXELS,
|
||||
|
||||
VIDEO_TOTAL_LENGTH = 280896,
|
||||
VIDEO_TOTAL_LENGTH = VIDEO_HORIZONTAL_LENGTH * VIDEO_VERTICAL_TOTAL_PIXELS,
|
||||
|
||||
REG_DISPSTAT_MASK = 0xFF38,
|
||||
|
||||
|
|
|
@ -7,6 +7,10 @@
|
|||
|
||||
#include <QPainter>
|
||||
|
||||
extern "C" {
|
||||
#include "gba/video.h"
|
||||
}
|
||||
|
||||
using namespace QGBA;
|
||||
|
||||
DisplayQt::DisplayQt(QWidget* parent)
|
||||
|
@ -69,9 +73,9 @@ void DisplayQt::paintEvent(QPaintEvent*) {
|
|||
QRect full(origin, ds);
|
||||
|
||||
#ifdef COLOR_5_6_5
|
||||
painter.drawImage(full, m_backing, QRect(0, 0, 240, 160));
|
||||
painter.drawImage(full, m_backing, QRect(0, 0, VIDEO_HORIZONTAL_PIXELS, VIDEO_VERTICAL_PIXELS));
|
||||
#else
|
||||
painter.drawImage(full, m_backing.rgbSwapped(), QRect(0, 0, 240, 160));
|
||||
painter.drawImage(full, m_backing.rgbSwapped(), QRect(0, 0, VIDEO_HORIZONTAL_PIXELS, VIDEO_VERTICAL_PIXELS));
|
||||
#endif
|
||||
m_messagePainter.paint(&painter);
|
||||
}
|
||||
|
|
|
@ -131,8 +131,8 @@ VideoView::VideoView(QWidget* parent)
|
|||
.acodec = QString(),
|
||||
.vbr = 0,
|
||||
.abr = 0,
|
||||
.width = 240,
|
||||
.height = 160
|
||||
.width = VIDEO_HORIZONTAL_PIXELS,
|
||||
.height = VIDEO_VERTICAL_PIXELS
|
||||
});
|
||||
|
||||
addPreset(m_ui.presetHQ, (Preset) {
|
||||
|
@ -169,8 +169,8 @@ VideoView::VideoView(QWidget* parent)
|
|||
.acodec = "FLAC",
|
||||
.vbr = 0,
|
||||
.abr = 0,
|
||||
.width = 240,
|
||||
.height = 160,
|
||||
.width = VIDEO_HORIZONTAL_PIXELS,
|
||||
.height = VIDEO_VERTICAL_PIXELS,
|
||||
});
|
||||
|
||||
setPreset((Preset) {
|
||||
|
@ -179,8 +179,8 @@ VideoView::VideoView(QWidget* parent)
|
|||
.acodec = "FLAC",
|
||||
.vbr = 0,
|
||||
.abr = 0,
|
||||
.width = 240,
|
||||
.height = 160,
|
||||
.width = VIDEO_HORIZONTAL_PIXELS,
|
||||
.height = VIDEO_VERTICAL_PIXELS,
|
||||
});
|
||||
|
||||
showAdvanced(false);
|
||||
|
|
|
@ -111,10 +111,10 @@ void GBASDLSWRunloop(struct GBAThread* context, struct SDLSoftwareRenderer* rend
|
|||
switch (renderer->ratio) {
|
||||
#if defined(__ARM_NEON) && COLOR_16_BIT
|
||||
case 2:
|
||||
_neon2x(surface->pixels, renderer->d.outputBuffer, 240, 160);
|
||||
_neon2x(surface->pixels, renderer->d.outputBuffer, VIDEO_HORIZONTAL_PIXELS, VIDEO_VERTICAL_PIXELS);
|
||||
break;
|
||||
case 4:
|
||||
_neon4x(surface->pixels, renderer->d.outputBuffer, 240, 160);
|
||||
_neon4x(surface->pixels, renderer->d.outputBuffer, VIDEO_HORIZONTAL_PIXELS, VIDEO_VERTICAL_PIXELS);
|
||||
break;
|
||||
#endif
|
||||
case 1:
|
||||
|
|
Loading…
Reference in New Issue