GBA Video: Clean up video enum values

This commit is contained in:
Jeffrey Pfau 2015-06-25 22:59:16 -07:00
parent a85ae6563c
commit 346e436b52
4 changed files with 17 additions and 15 deletions

View File

@ -26,19 +26,17 @@
#define GBA_B8(X) (((X) >> 7) & 0xF8) #define GBA_B8(X) (((X) >> 7) & 0xF8)
enum { enum {
VIDEO_CYCLES_PER_PIXEL = 4,
VIDEO_HORIZONTAL_PIXELS = 240, VIDEO_HORIZONTAL_PIXELS = 240,
VIDEO_HBLANK_PIXELS = 68, VIDEO_HBLANK_PIXELS = 68,
VIDEO_HDRAW_LENGTH = 1006, VIDEO_HDRAW_LENGTH = 1006,
VIDEO_HBLANK_LENGTH = 226, VIDEO_HBLANK_LENGTH = 226,
VIDEO_HORIZONTAL_LENGTH = 1232, VIDEO_HORIZONTAL_LENGTH = VIDEO_HDRAW_LENGTH + VIDEO_HBLANK_LENGTH,
VIDEO_VERTICAL_PIXELS = 160, VIDEO_VERTICAL_PIXELS = 160,
VIDEO_VBLANK_PIXELS = 68, 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, REG_DISPSTAT_MASK = 0xFF38,

View File

@ -7,6 +7,10 @@
#include <QPainter> #include <QPainter>
extern "C" {
#include "gba/video.h"
}
using namespace QGBA; using namespace QGBA;
DisplayQt::DisplayQt(QWidget* parent) DisplayQt::DisplayQt(QWidget* parent)
@ -69,9 +73,9 @@ void DisplayQt::paintEvent(QPaintEvent*) {
QRect full(origin, ds); QRect full(origin, ds);
#ifdef COLOR_5_6_5 #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 #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 #endif
m_messagePainter.paint(&painter); m_messagePainter.paint(&painter);
} }

View File

@ -131,8 +131,8 @@ VideoView::VideoView(QWidget* parent)
.acodec = QString(), .acodec = QString(),
.vbr = 0, .vbr = 0,
.abr = 0, .abr = 0,
.width = 240, .width = VIDEO_HORIZONTAL_PIXELS,
.height = 160 .height = VIDEO_VERTICAL_PIXELS
}); });
addPreset(m_ui.presetHQ, (Preset) { addPreset(m_ui.presetHQ, (Preset) {
@ -169,8 +169,8 @@ VideoView::VideoView(QWidget* parent)
.acodec = "FLAC", .acodec = "FLAC",
.vbr = 0, .vbr = 0,
.abr = 0, .abr = 0,
.width = 240, .width = VIDEO_HORIZONTAL_PIXELS,
.height = 160, .height = VIDEO_VERTICAL_PIXELS,
}); });
setPreset((Preset) { setPreset((Preset) {
@ -179,8 +179,8 @@ VideoView::VideoView(QWidget* parent)
.acodec = "FLAC", .acodec = "FLAC",
.vbr = 0, .vbr = 0,
.abr = 0, .abr = 0,
.width = 240, .width = VIDEO_HORIZONTAL_PIXELS,
.height = 160, .height = VIDEO_VERTICAL_PIXELS,
}); });
showAdvanced(false); showAdvanced(false);

View File

@ -111,10 +111,10 @@ void GBASDLSWRunloop(struct GBAThread* context, struct SDLSoftwareRenderer* rend
switch (renderer->ratio) { switch (renderer->ratio) {
#if defined(__ARM_NEON) && COLOR_16_BIT #if defined(__ARM_NEON) && COLOR_16_BIT
case 2: case 2:
_neon2x(surface->pixels, renderer->d.outputBuffer, 240, 160); _neon2x(surface->pixels, renderer->d.outputBuffer, VIDEO_HORIZONTAL_PIXELS, VIDEO_VERTICAL_PIXELS);
break; break;
case 4: case 4:
_neon4x(surface->pixels, renderer->d.outputBuffer, 240, 160); _neon4x(surface->pixels, renderer->d.outputBuffer, VIDEO_HORIZONTAL_PIXELS, VIDEO_VERTICAL_PIXELS);
break; break;
#endif #endif
case 1: case 1: