Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Sérgio Benjamim 2018-09-29 13:28:19 -03:00
commit 96f97cefb4
22 changed files with 181 additions and 72 deletions

View File

@ -6,8 +6,8 @@ services:
os: linux
env:
- DOCKER_TAG=ubuntu:xenial
- DOCKER_TAG=ubuntu:artful
- DOCKER_TAG=ubuntu:bionic
- DOCKER_TAG=ubuntu:cosmic
- DOCKER_TAG=3ds
- DOCKER_TAG=wii
- DOCKER_TAG=vita

View File

@ -101,11 +101,16 @@ Misc:
Changes from beta 1:
Features:
- Libretro: Add Game Boy cheat support
- Qt: Separate fast forward volume control (fixes mgba.io/i/846, mgba.io/i/1143)
Bugfixes:
- PSP2: Fix audio crackling after fast forward
- PSP2: Fix audio crackling when buffer is full
- 3DS: Fix unused screens not clearing (fixes mgba.io/i/1184)
- GBA Video: Fix caching with background toggling (fixes mgba.io/i/1118)
Misc:
- mGUI: Add SGB border configuration option
0.6 beta 1: (2018-09-24)
0.7 beta 1: (2018-09-24)
- Initial beta for 0.6
0.6.3: (2018-04-14)

View File

@ -1045,9 +1045,11 @@ set(CPACK_PACKAGE_CONTACT "Jeffrey Pfau <jeffrey@endrift.com>")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
set(CPACK_DEBIAN_PACKAGE_SECTION "games")
SET(CPACK_DEB_COMPONENT_INSTALL ON)
set(CPACK_DEB_COMPONENT_INSTALL ON)
set(CPACK_STRIP_FILES ON)
if(CMAKE_BUILD_TYPE STREQUAL "Release")
set(CPACK_STRIP_FILES ON)
endif()
if(DISTBUILD)
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
@ -1064,13 +1066,13 @@ if(DISTBUILD)
set(CPACK_COMPONENTS_GROUPING ALL_COMPONENTS_IN_ONE)
endif()
elseif(3DS)
set(CPACK_COMPONENTS_ALL ${BINARY_NAME} ${BINARY_NAME}-3ds ${BINARY_NAME}-perf)
set(CPACK_COMPONENTS_ALL ${BINARY_NAME} ${BINARY_NAME}-dbg ${BINARY_NAME}-3ds ${BINARY_NAME}-perf)
elseif(WII)
set(CPACK_COMPONENTS_ALL ${BINARY_NAME} ${BINARY_NAME}-wii)
set(CPACK_COMPONENTS_ALL ${BINARY_NAME} ${BINARY_NAME}-dbg ${BINARY_NAME}-wii)
elseif(PSP2)
set(CPACK_COMPONENTS_ALL ${BINARY_NAME} ${BINARY_NAME}-psp2)
set(CPACK_COMPONENTS_ALL ${BINARY_NAME} ${BINARY_NAME}-dbg ${BINARY_NAME}-psp2)
elseif(SWITCH)
set(CPACK_COMPONENTS_ALL ${BINARY_NAME} ${BINARY_NAME}-switch)
set(CPACK_COMPONENTS_ALL ${BINARY_NAME} ${BINARY_NAME}-dbg ${BINARY_NAME}-switch)
endif()
endif()
@ -1114,6 +1116,9 @@ if(DISTBUILD AND CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
if(BUILD_SHARED AND NOT IS_EMBEDDED)
cpack_add_component(lib${BINARY_NAME}-dbg GROUP debug)
endif()
if(IS_EMBEDDED)
cpack_add_component(${BINARY_NAME}-dbg GROUP debug)
endif()
if(BUILD_QT)
cpack_add_component(${BINARY_NAME}-qt-dbg GROUP debug)
endif()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -17,6 +17,7 @@
.Op Fl l Ar loglevel
.Op Fl p Ar patchfile
.Op Fl s Ar n
.Op Fl t Ar statefile
.Ar file
.Sh DESCRIPTION
.Nm
@ -71,13 +72,7 @@ is a bitmask defining which types of messages to log:
.It
32 \(en stub messages for unimplemented features
.It
256 \(en in\(hygame errors
.It
512 \(en software interrupts
.It
1024 \(en emulator status messages
.It
2048 \(en serial I/O messages
64 \(en in\(hygame errors
.El
The default is to log warnings, errors, fatal errors, and status messages.
.It Fl p Ar patchfile , Fl -patch Ar patchfile
@ -86,6 +81,9 @@ Specify a patch file in BPS, IPS, or UPS format.
Skip every
.Ar n
frames.
.It Fl t Ar statefile , Fl -savestate Ar statefile
Load initial game state from
.Ar statefile .
.El
.Sh CONTROLS
The default controls are as follows:

View File

@ -18,7 +18,7 @@
.Op Fl l Ar loglevel
.Op Fl p Ar patchfile
.Op Fl s Ar n
.Op Fl v Ar moviefile
.Op Fl t Ar statefile
.Ar file
.Sh DESCRIPTION
.Nm
@ -79,13 +79,7 @@ is a bitmask defining which types of messages to log:
.It
32 \(en stub messages for unimplemented features
.It
256 \(en in\(hygame errors
.It
512 \(en software interrupts
.It
1024 \(en emulator status messages
.It
2048 \(en serial I/O messages
64 \(en in\(hygame errors
.El
The default is to log warnings, errors, fatal errors, and status messages.
.It Fl p Ar patchfile , Fl -patch Ar patchfile
@ -94,9 +88,9 @@ Specify a patch file in BPS, IPS, or UPS format.
Skip every
.Ar n
frames.
.It Fl v Ar moviefile , Fl -movie Ar moviefile
Play back a movie of recording input from
.Ar moviefile .
.It Fl t Ar statefile , Fl -savestate Ar statefile
Load initial game state from
.Ar statefile .
.El
.Sh CONTROLS
The default controls are as follows:

View File

@ -108,6 +108,16 @@ void mGUIShowConfig(struct mGUIRunner* runner, struct GUIMenuItem* extra, size_t
.title = "Select SGB BIOS path",
.data = "sgb.bios",
};
*GUIMenuItemListAppend(&menu.items) = (struct GUIMenuItem) {
.title = "Enable SGB borders",
.data = "sgb.borders",
.submenu = 0,
.state = true,
.validStates = (const char*[]) {
"Off", "On"
},
.nStates = 2
};
#endif
size_t i;
const char* mapNames[GUI_MAX_INPUTS + 1];

View File

@ -554,6 +554,8 @@ static void GBAVideoSoftwareRendererDrawScanline(struct GBAVideoRenderer* render
return;
}
CLEAN_SCANLINE(softwareRenderer, y);
color_t* row = &softwareRenderer->outputBuffer[softwareRenderer->outputBufferStride * y];
if (GBARegisterDISPCNTIsForcedBlank(softwareRenderer->dispcnt)) {
int x;
@ -675,7 +677,6 @@ static void GBAVideoSoftwareRendererDrawScanline(struct GBAVideoRenderer* render
#else
memcpy(row, softwareRenderer->row, VIDEO_HORIZONTAL_PIXELS * sizeof(*row));
#endif
CLEAN_SCANLINE(softwareRenderer, y);
}
static void GBAVideoSoftwareRendererFinishFrame(struct GBAVideoRenderer* renderer) {
@ -722,9 +723,10 @@ static void GBAVideoSoftwareRendererPutPixels(struct GBAVideoRenderer* renderer,
}
static void _enableBg(struct GBAVideoSoftwareRenderer* renderer, int bg, bool active) {
int wasActive = renderer->bg[bg].enabled;
if (!active) {
renderer->bg[bg].enabled = 0;
} else if (!renderer->bg[bg].enabled && active) {
} else if (!wasActive && active) {
if (renderer->nextY == 0) {
renderer->bg[bg].enabled = 4;
} else {
@ -901,15 +903,19 @@ static void _drawScanline(struct GBAVideoSoftwareRenderer* renderer, int y) {
if (renderer->bg[0].enabled > 0 && renderer->bg[0].enabled < 4) {
++renderer->bg[0].enabled;
DIRTY_SCANLINE(renderer, y);
}
if (renderer->bg[1].enabled > 0 && renderer->bg[1].enabled < 4) {
++renderer->bg[1].enabled;
DIRTY_SCANLINE(renderer, y);
}
if (renderer->bg[2].enabled > 0 && renderer->bg[2].enabled < 4) {
++renderer->bg[2].enabled;
DIRTY_SCANLINE(renderer, y);
}
if (renderer->bg[3].enabled > 0 && renderer->bg[3].enabled < 4) {
++renderer->bg[3].enabled;
DIRTY_SCANLINE(renderer, y);
}
}

View File

@ -113,6 +113,8 @@ if(BUILD_PERF)
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cia.rsf.in ${CMAKE_CURRENT_BINARY_DIR}/cia.rsf)
install(TARGETS ${BINARY_NAME}.elf DESTINATION . COMPONENT ${BINARY_NAME}-dbg)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/${BINARY_NAME}.3dsx
${CMAKE_CURRENT_BINARY_DIR}/${BINARY_NAME}.smdh

View File

@ -194,7 +194,9 @@ static void _drawStart(void) {
C3D_FrameBegin(flags);
ctrStartFrame();
C3D_FrameDrawOn(bottomScreen[doubleBuffer]);
C3D_RenderTargetClear(bottomScreen[doubleBuffer], C3D_CLEAR_COLOR, 0, 0);
C3D_FrameDrawOn(topScreen[doubleBuffer]);
C3D_RenderTargetClear(topScreen[doubleBuffer], C3D_CLEAR_COLOR, 0, 0);
}

View File

@ -61,4 +61,5 @@ vita_create_vpk(${BINARY_NAME}.vpk MGBA00001 ${BINARY_NAME}.self
FILE ${CMAKE_CURRENT_SOURCE_DIR}/startup.png sce_sys/livearea/contents/startup.png
FILE ${CMAKE_CURRENT_BINARY_DIR}/template.xml sce_sys/livearea/contents/template.xml)
install(TARGETS ${BINARY_NAME}.elf DESTINATION . COMPONENT ${BINARY_NAME}-dbg)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${BINARY_NAME}.vpk DESTINATION . COMPONENT ${BINARY_NAME}-psp2)

View File

@ -245,6 +245,8 @@ void CoreController::loadConfig(ConfigController* config) {
m_autosave = config->getOption("autosave", false).toInt();
m_autoload = config->getOption("autoload", true).toInt();
m_autofireThreshold = config->getOption("autofireThreshold", m_autofireThreshold).toInt();
m_fastForwardVolume = config->getOption("fastForwardVolume", -1).toInt();
m_fastForwardMute = config->getOption("fastForwardMute", -1).toInt();
mCoreLoadForeignConfig(m_threadContext.core, config->config());
if (hasStarted()) {
updateFastForward();
@ -810,15 +812,29 @@ void CoreController::finishFrame() {
void CoreController::updateFastForward() {
if (m_fastForward || m_fastForwardForced) {
if (m_fastForwardVolume >= 0) {
m_threadContext.core->opts.volume = m_fastForwardVolume;
}
if (m_fastForwardMute >= 0) {
m_threadContext.core->opts.mute = m_fastForwardMute;
}
if (m_fastForwardRatio > 0) {
m_threadContext.impl->sync.fpsTarget = m_fpsTarget * m_fastForwardRatio;
} else {
setSync(false);
}
} else {
if (!mCoreConfigGetIntValue(&m_threadContext.core->config, "volume", &m_threadContext.core->opts.volume)) {
m_threadContext.core->opts.volume = 0x100;
}
int fakeBool = 0;
mCoreConfigGetIntValue(&m_threadContext.core->config, "mute", &fakeBool);
m_threadContext.core->opts.mute = fakeBool;
m_threadContext.impl->sync.fpsTarget = m_fpsTarget;
setSync(true);
}
// XXX: Have a way of just updating opts
m_threadContext.core->loadConfig(m_threadContext.core, &m_threadContext.core->config);
}
CoreController::Interrupter::Interrupter(CoreController* parent, bool fromThread)

View File

@ -204,6 +204,8 @@ private:
int m_fastForward = false;
int m_fastForwardForced = false;
int m_fastForwardVolume = -1;
int m_fastForwardMute = -1;
float m_fastForwardRatio = -1.f;
float m_fpsTarget;

View File

@ -43,6 +43,18 @@ SettingsView::SettingsView(ConfigController* controller, InputController* inputC
reloadConfig();
connect(m_ui.volume, static_cast<void (QSlider::*)(int)>(&QSlider::valueChanged), [this](int v) {
if (v < m_ui.volumeFf->value()) {
m_ui.volumeFf->setValue(v);
}
});
connect(m_ui.mute, &QAbstractButton::toggled, [this](bool e) {
if (e) {
m_ui.muteFf->setChecked(e);
}
});
if (m_ui.savegamePath->text().isEmpty()) {
m_ui.savegameSameDir->setChecked(true);
}
@ -339,6 +351,8 @@ void SettingsView::updateConfig() {
saveSetting("lockIntegerScaling", m_ui.lockIntegerScaling);
saveSetting("volume", m_ui.volume);
saveSetting("mute", m_ui.mute);
saveSetting("fastForwardVolume", m_ui.volumeFf);
saveSetting("fastForwardMute", m_ui.muteFf);
saveSetting("rewindEnable", m_ui.rewind);
saveSetting("rewindBufferCapacity", m_ui.rewindCapacity);
saveSetting("resampleVideo", m_ui.resampleVideo);
@ -460,8 +474,10 @@ void SettingsView::reloadConfig() {
loadSetting("autofireThreshold", m_ui.autofireThreshold);
loadSetting("lockAspectRatio", m_ui.lockAspectRatio);
loadSetting("lockIntegerScaling", m_ui.lockIntegerScaling);
loadSetting("volume", m_ui.volume);
loadSetting("mute", m_ui.mute);
loadSetting("volume", m_ui.volume, 0x100);
loadSetting("mute", m_ui.mute, false);
loadSetting("fastForwardVolume", m_ui.volumeFf, m_ui.volume->value());
loadSetting("fastForwardMute", m_ui.muteFf, m_ui.mute->isChecked());
loadSetting("rewindEnable", m_ui.rewind);
loadSetting("rewindBufferCapacity", m_ui.rewindCapacity);
loadSetting("resampleVideo", m_ui.resampleVideo);
@ -592,9 +608,9 @@ void SettingsView::loadSetting(const char* key, QLineEdit* field) {
field->setText(option);
}
void SettingsView::loadSetting(const char* key, QSlider* field) {
void SettingsView::loadSetting(const char* key, QSlider* field, int defaultVal) {
QString option = loadSetting(key);
field->setValue(option.toInt());
field->setValue(option.isNull() ? defaultVal : option.toInt());
}
void SettingsView::loadSetting(const char* key, QSpinBox* field) {

View File

@ -72,7 +72,7 @@ private:
void loadSetting(const char* key, QComboBox*);
void loadSetting(const char* key, QDoubleSpinBox*);
void loadSetting(const char* key, QLineEdit*);
void loadSetting(const char* key, QSlider*);
void loadSetting(const char* key, QSlider*, int defaultVal = 0);
void loadSetting(const char* key, QSpinBox*);
QString loadSetting(const char* key);
};

View File

@ -263,21 +263,61 @@
</item>
</layout>
</item>
<item row="4" column="0" colspan="2">
<item row="4" column="0">
<widget class="QLabel" name="label_34">
<property name="text">
<string>Fast forward volume:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_17">
<item>
<widget class="QSlider" name="volumeFf">
<property name="minimumSize">
<size>
<width>128</width>
<height>0</height>
</size>
</property>
<property name="maximum">
<number>256</number>
</property>
<property name="pageStep">
<number>16</number>
</property>
<property name="value">
<number>256</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="muteFf">
<property name="text">
<string>Mute</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="5" column="0" colspan="2">
<widget class="Line" name="line_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="5" column="0">
<item row="6" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Display driver:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<item row="6" column="1">
<widget class="QComboBox" name="displayDriver">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
@ -287,14 +327,14 @@
</property>
</widget>
</item>
<item row="6" column="0">
<item row="7" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Frameskip:</string>
</property>
</widget>
</item>
<item row="6" column="1">
<item row="7" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_16">
<item>
<widget class="QLabel" name="label_12">
@ -315,14 +355,14 @@
</item>
</layout>
</item>
<item row="7" column="0">
<item row="8" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>FPS target:</string>
</property>
</widget>
</item>
<item row="7" column="1">
<item row="8" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QDoubleSpinBox" name="fpsTarget">
@ -349,21 +389,21 @@
</item>
</layout>
</item>
<item row="8" column="0" colspan="2">
<item row="9" column="0" colspan="2">
<widget class="Line" name="line_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="9" column="0">
<item row="10" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Sync:</string>
</property>
</widget>
</item>
<item row="9" column="1">
<item row="10" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<widget class="QCheckBox" name="videoSync">
@ -381,7 +421,7 @@
</item>
</layout>
</item>
<item row="10" column="1">
<item row="11" column="1">
<widget class="QCheckBox" name="lockAspectRatio">
<property name="text">
<string>Lock aspect ratio</string>
@ -389,19 +429,19 @@
</widget>
</item>
<item row="12" column="1">
<widget class="QCheckBox" name="resampleVideo">
<property name="text">
<string>Bilinear filtering</string>
</property>
</widget>
</item>
<item row="11" column="1">
<widget class="QCheckBox" name="lockIntegerScaling">
<property name="text">
<string>Force integer scaling</string>
</property>
</widget>
</item>
<item row="13" column="1">
<widget class="QCheckBox" name="resampleVideo">
<property name="text">
<string>Bilinear filtering</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="interface_2">

View File

@ -1610,6 +1610,16 @@ void Window::setupMenu(QMenuBar* menubar) {
reloadConfig();
}, this);
ConfigOption* volumeFf = m_config->addOption("fastForwardVolume");
volumeFf->connect([this](const QVariant& value) {
reloadConfig();
}, this);
ConfigOption* muteFf = m_config->addOption("fastForwardMute");
muteFf->connect([this](const QVariant& value) {
reloadConfig();
}, this);
ConfigOption* rewindEnable = m_config->addOption("rewindEnable");
rewindEnable->connect([this](const QVariant& value) {
reloadConfig();

View File

@ -50,4 +50,5 @@ add_custom_target(${BINARY_NAME}.nro ALL
${ELF2NRO} ${BINARY_NAME}.elf ${BINARY_NAME}.nro --romfs=romfs.bin --nacp=control.nacp --icon="${CMAKE_CURRENT_SOURCE_DIR}/icon.jpg"
DEPENDS ${BINARY_NAME}.elf control.nacp ${CMAKE_CURRENT_SOURCE_DIR}/icon.jpg romfs.bin)
install(TARGETS ${BINARY_NAME}.elf DESTINATION . COMPONENT ${BINARY_NAME}-dbg)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${BINARY_NAME}.nro DESTINATION . COMPONENT ${BINARY_NAME}-switch)

View File

@ -40,5 +40,7 @@ add_custom_target(run ${WIILOAD} ${CMAKE_CURRENT_BINARY_DIR}/${BINARY_NAME}.dol
DEPENDS ${BINARY_NAME}.dol)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/meta.xml.in ${CMAKE_CURRENT_BINARY_DIR}/meta.xml)
install(TARGETS ${BINARY_NAME}.elf DESTINATION . COMPONENT ${BINARY_NAME}-dbg)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/icon.png ${CMAKE_CURRENT_BINARY_DIR}/meta.xml DESTINATION . COMPONENT ${BINARY_NAME}-wii)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${BINARY_NAME}.dol DESTINATION . RENAME boot.dol COMPONENT ${BINARY_NAME}-wii)

View File

@ -229,15 +229,6 @@ static void reconfigureScreen(struct mGUIRunner* runner) {
double ratio = GBAAudioCalculateRatio(1, audioSampleRate, 1);
blip_set_rates(runner->core->getAudioChannel(runner->core, 0), runner->core->frequency(runner->core), 48000 * ratio);
blip_set_rates(runner->core->getAudioChannel(runner->core, 1), runner->core->frequency(runner->core), 48000 * ratio);
runner->core->desiredVideoDimensions(runner->core, &corew, &coreh);
int hfactor = vmode->fbWidth / (corew * wAdjust);
int vfactor = vmode->efbHeight / (coreh * hAdjust);
if (hfactor > vfactor) {
scaleFactor = vfactor;
} else {
scaleFactor = hfactor;
}
}
}
}
@ -812,7 +803,7 @@ void _unpaused(struct mGUIRunner* runner) {
}
void _drawFrame(struct mGUIRunner* runner, bool faded) {
UNUSED(runner);
runner->core->desiredVideoDimensions(runner->core, &corew, &coreh);
uint32_t color = 0xFFFFFF3F;
if (!faded) {
color |= 0xC0;
@ -838,9 +829,9 @@ void _drawFrame(struct mGUIRunner* runner, bool faded) {
GX_InvalidateTexAll();
GX_LoadTexObj(&tex, GX_TEXMAP0);
GX_SetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_TEX_ST, GX_S16, 0);
s16 vertWidth = TEX_W;
s16 vertHeight = TEX_H;
GX_SetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_TEX_ST, GX_F32, 0);
s16 vertWidth = corew;
s16 vertHeight = coreh;
if (filterMode == FM_LINEAR_2x) {
Mtx44 proj;
@ -850,19 +841,19 @@ void _drawFrame(struct mGUIRunner* runner, bool faded) {
GX_Begin(GX_QUADS, GX_VTXFMT0, 4);
GX_Position2s16(0, TEX_H * 2);
GX_Color1u32(0xFFFFFFFF);
GX_TexCoord2s16(0, 1);
GX_TexCoord2f32(0, 1);
GX_Position2s16(TEX_W * 2, TEX_H * 2);
GX_Color1u32(0xFFFFFFFF);
GX_TexCoord2s16(1, 1);
GX_TexCoord2f32(1, 1);
GX_Position2s16(TEX_W * 2, 0);
GX_Color1u32(0xFFFFFFFF);
GX_TexCoord2s16(1, 0);
GX_TexCoord2f32(1, 0);
GX_Position2s16(0, 0);
GX_Color1u32(0xFFFFFFFF);
GX_TexCoord2s16(0, 0);
GX_TexCoord2f32(0, 0);
GX_End();
GX_SetTexCopySrc(0, 0, TEX_W * 2, TEX_H * 2);
@ -871,6 +862,14 @@ void _drawFrame(struct mGUIRunner* runner, bool faded) {
GX_LoadTexObj(&rescaleTex, GX_TEXMAP0);
}
int hfactor = vmode->fbWidth / (corew * wAdjust);
int vfactor = vmode->efbHeight / (coreh * hAdjust);
if (hfactor > vfactor) {
scaleFactor = vfactor;
} else {
scaleFactor = hfactor;
}
if (screenMode == SM_PA) {
vertWidth *= scaleFactor;
vertHeight *= scaleFactor;
@ -885,19 +884,19 @@ void _drawFrame(struct mGUIRunner* runner, bool faded) {
GX_Begin(GX_QUADS, GX_VTXFMT0, 4);
GX_Position2s16(0, vertHeight);
GX_Color1u32(color);
GX_TexCoord2s16(0, 1);
GX_TexCoord2f32(0, coreh / (float) TEX_H);
GX_Position2s16(vertWidth, vertHeight);
GX_Color1u32(color);
GX_TexCoord2s16(1, 1);
GX_TexCoord2f32(corew / (float) TEX_W, coreh / (float) TEX_H);
GX_Position2s16(vertWidth, 0);
GX_Color1u32(color);
GX_TexCoord2s16(1, 0);
GX_TexCoord2f32(corew / (float) TEX_W, 0);
GX_Position2s16(0, 0);
GX_Color1u32(color);
GX_TexCoord2s16(0, 0);
GX_TexCoord2f32(0, 0);
GX_End();
}