all repos — mgba @ 346e436b52422a189b12d65c2036a738a3a86f53

mGBA Game Boy Advance Emulator

GBA Video: Clean up video enum values
Jeffrey Pfau jeffrey@endrift.com
Thu, 25 Jun 2015 22:59:16 -0700
commit

346e436b52422a189b12d65c2036a738a3a86f53

parent

a85ae6563c1008685ccd91fcedc1bb2846139ad6

M src/gba/video.hsrc/gba/video.h

@@ -26,19 +26,17 @@ #define GBA_G8(X) (((X) >> 2) & 0xF8)

#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,
M src/platform/qt/DisplayQt.cppsrc/platform/qt/DisplayQt.cpp

@@ -7,6 +7,10 @@ #include "DisplayQt.h"

#include <QPainter> +extern "C" { +#include "gba/video.h" +} + using namespace QGBA; DisplayQt::DisplayQt(QWidget* parent)

@@ -69,9 +73,9 @@ QPoint origin = QPoint((s.width() - ds.width()) / 2, (s.height() - ds.height()) / 2);

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); }
M src/platform/qt/VideoView.cppsrc/platform/qt/VideoView.cpp

@@ -131,8 +131,8 @@ .vcodec = QString(),

.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 @@ .vcodec = "PNG",

.acodec = "FLAC", .vbr = 0, .abr = 0, - .width = 240, - .height = 160, + .width = VIDEO_HORIZONTAL_PIXELS, + .height = VIDEO_VERTICAL_PIXELS, }); setPreset((Preset) {

@@ -179,8 +179,8 @@ .vcodec = "PNG",

.acodec = "FLAC", .vbr = 0, .abr = 0, - .width = 240, - .height = 160, + .width = VIDEO_HORIZONTAL_PIXELS, + .height = VIDEO_VERTICAL_PIXELS, }); showAdvanced(false);
M src/platform/sdl/sw-sdl.csrc/platform/sdl/sw-sdl.c

@@ -111,10 +111,10 @@ #else

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: