Dolphin Gecko Failed To Download Codes

  

Launch Dolphin with Virtual Console or WiiWare games on your list 2. Right click one of those games and go to Properties 3. Click the Gecko Codes tab 4. Click 'Download Codes (WiiRD Database) What is the expected output? What do you see instead? I expect Dolphin to retrieve codes from the database. Instead, it returns a 'Failed to download.

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4 commits
Select commit Hold shift + click to select a range
Filter file types
Failed to load files and symbols.
@@ -31,8 +31,10 @@ set(SRCS
Translation.cpp
WiiUpdate.cpp
WiiUpdate.h
Config/CheatWarningWidget.cpp
Config/ControllersWindow.cpp
Config/FilesystemWidget.cpp
Config/GeckoCodeWidget.cpp
Config/Graphics/AdvancedWidget.cpp
Config/Graphics/EnhancementsWidget.cpp
Config/Graphics/GeneralWidget.cpp
Dolphin add gecko code
Source/Core/DolphinQt2/Config/CheatWarningWidget.cpp
@@ -0,0 +1,86 @@
// Copyright 2017 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.

#include'DolphinQt2/Config/CheatWarningWidget.h'

#include<QHBoxLayout>
#include<QLabel>
#include<QPixmap>
#include<QPushButton>
#include<QStyle>

#include<iostream>

#include'Core/ConfigManager.h'
#include'Core/Core.h'
#include'DolphinQt2/Settings.h'

CheatWarningWidget::CheatWarningWidget(const std::string& game_id) : m_game_id(game_id)
{
CreateWidgets();
ConnectWidgets();

connect(&Settings::Instance(), &Settings::EnableCheatsChanged,
[this] { Update(Core::IsRunning()); });
connect(&Settings::Instance(), &Settings::EmulationStateChanged, [this](Core::State state) {
std::cout << (state Core::State::Running) << std::endl;
Update(state Core::State::Running);
});

Update(Core::IsRunning());
}

voidCheatWarningWidget::CreateWidgets()
{
auto* icon = new QLabel;

constauto size = 1.5 * QFontMetrics(font()).height();

QPixmap warning_icon = style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(size, size);

icon->setPixmap(warning_icon);

m_text = newQLabel();
m_config_button = newQPushButton(tr('Configure Dolphin'));

m_config_button->setHidden(true);

auto* layout = new QHBoxLayout;

Sep 4, 2017

This should have layout->setContentsMargins(0, 0, 0, 0); since it'll be embedded inside other layouts.

Sep 4, 2017


layout->addWidget(icon);
layout->addWidget(m_text, 1);
layout->addWidget(m_config_button);

layout->setContentsMargins(0, 0, 0, 0);

setLayout(layout);
}

voidCheatWarningWidget::Update(bool running)
{
bool hide_widget = true;
bool hide_config_button = true;

if (running && SConfig::GetInstance().GetGameID() m_game_id)
{
hide_widget = false;
m_text->setText(tr('Changing cheats will only take effect when the game is restarted.'));
}

if (!Settings::Instance().GetCheatsEnabled())
{
hide_widget = false;
hide_config_button = false;
m_text->setText(tr('Dolphin's cheat system is currently disabled.'));
}

setHidden(hide_widget);
m_config_button->setHidden(hide_config_button);
}

voidCheatWarningWidget::ConnectWidgets()
{
connect(m_config_button, &QPushButton::pressed, this,
&CheatWarningWidget::OpenCheatEnableSettings);
}
Source/Core/DolphinQt2/Config/CheatWarningWidget.h
@@ -0,0 +1,32 @@
// Copyright 2017 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.

#pragma once

#include<QWidget>

Aug 30, 2017

Aug 30, 2017


#include<string>

classQLabel;
classQPushButton;

classCheatWarningWidget : publicQWidget
{
Q_OBJECT
public:
explicitCheatWarningWidget(const std::string& game_id);

signals:
voidOpenCheatEnableSettings();

private:
voidCreateWidgets();
voidConnectWidgets();

voidUpdate(bool running);

QLabel* m_text;
QPushButton* m_config_button;
const std::string m_game_id;
};
@@ -0,0 +1,207 @@
// Copyright 2017 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.

#include'DolphinQt2/Config/GeckoCodeWidget.h'

#include<QFontDatabase>
#include<QFormLayout>
#include<QLabel>
#include<QListWidget>
#include<QMessageBox>
#include<QPushButton>
#include<QTextEdit>
#include<QVBoxLayout>

#include'Common/FileUtil.h'
#include'Common/IniFile.h'
#include'Core/ConfigManager.h'
#include'Core/GeckoCodeConfig.h'
#include'DolphinQt2/Config/CheatWarningWidget.h'
#include'DolphinQt2/GameList/GameFile.h'

GeckoCodeWidget::GeckoCodeWidget(const GameFile& game)
: m_game(game), m_game_id(game.GetGameID().toStdString()), m_game_revision(game.GetRevision())
{
CreateWidgets();
ConnectWidgets();

IniFile game_ini_local;

// We don't use LoadLocalGameIni() here because user cheat codes that are installed via the UI
// will always be stored in GS/${GAMEID}.ini
game_ini_local.Load(File::GetUserPath(D_GAMESETTINGS_IDX) + m_game_id + '.ini');

IniFile game_ini_default = SConfig::GetInstance().LoadDefaultGameIni(m_game_id, m_game_revision);
m_gecko_codes = Gecko::LoadCodes(game_ini_default, game_ini_local);

UpdateList();
}

voidGeckoCodeWidget::CreateWidgets()
{
m_warning = newCheatWarningWidget(m_game_id);
m_code_list = new QListWidget;
m_name_label = new QLabel;
m_creator_label = new QLabel;

QFont monospace(QFontDatabase::systemFont(QFontDatabase::FixedFont).family());

constauto line_height = QFontMetrics(font()).lineSpacing();

m_code_description = new QTextEdit;
m_code_description->setFont(monospace);
m_code_description->setReadOnly(true);
m_code_description->setFixedHeight(line_height * 5);

m_code_view = new QTextEdit;
m_code_view->setFont(monospace);
m_code_view->setReadOnly(true);
m_code_view->setFixedHeight(line_height * 10);

m_download_codes = newQPushButton(tr('Download Codes (WiiRD Database)'));
m_download_codes->setEnabled(!m_game_id.empty());
m_download_codes->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);

auto* layout = new QVBoxLayout;

layout->addWidget(m_warning);
layout->addWidget(m_code_list);

auto* info_layout = new QFormLayout;

info_layout->addRow(tr('Name:'), m_name_label);
info_layout->addRow(tr('Creator:'), m_creator_label);

Sep 5, 2017

Sep 5, 2017

Do we really need it though? I don't care that much, but I think it's prettier the way it is now.

Sep 5, 2017

I think so, otherwise it's just a big box that says 'N/A' most of the time. Labelling it lets users know what it is and what 'N/A' refers to.

Sep 5, 2017

Sep 5, 2017

info_layout->addRow(tr('Description:'), static_cast<QWidget*>(nullptr));

info_layout->setFormAlignment(Qt::AlignLeft | Qt::AlignTop);

for (QLabel* label : {m_name_label, m_creator_label})
{
label->setTextInteractionFlags(Qt::TextSelectableByMouse);
label->setCursor(Qt::IBeamCursor);
}

layout->addLayout(info_layout);
layout->addWidget(m_code_description);
layout->addWidget(m_code_view);
layout->addWidget(m_download_codes, 0, Qt::AlignRight);

setLayout(layout);
}

voidGeckoCodeWidget::ConnectWidgets()
{
connect(m_code_list, &QListWidget::itemSelectionChanged, this,
&GeckoCodeWidget::OnSelectionChanged);
connect(m_code_list, &QListWidget::itemChanged, this, &GeckoCodeWidget::OnItemChanged);

connect(m_download_codes, &QPushButton::pressed, this, &GeckoCodeWidget::DownloadCodes);

connect(m_warning, &CheatWarningWidget::OpenCheatEnableSettings, this,
&GeckoCodeWidget::OpenGeneralSettings);
}

voidGeckoCodeWidget::OnSelectionChanged()
{
auto items = m_code_list->selectedItems();

if (items.empty())
return;

auto selected = items[0];

constauto& code = m_gecko_codes[m_code_list->row(selected)];

m_name_label->setText(QString::fromStdString(code.name));
m_creator_label->setText(QString::fromStdString(code.creator));

m_code_description->clear();

if (code.notes.empty())
m_code_description->append(tr('N/A'));

for (constauto& line : code.notes)
m_code_description->append(QString::fromStdString(line));

m_code_view->clear();

for (constauto& c : code.codes)
m_code_view->append(QStringLiteral('%1 %2')
.arg(c.address, 8, 16, QLatin1Char('0'))
.arg(c.data, 8, 16, QLatin1Char('0')));
}

voidGeckoCodeWidget::OnItemChanged(QListWidgetItem* item)
{
m_gecko_codes[m_code_list->row(item)].enabled = (item->checkState() Qt::Checked);

SaveCodes();
}

voidGeckoCodeWidget::SaveCodes()
{
IniFile game_ini_local;
game_ini_local.Load(File::GetUserPath(D_GAMESETTINGS_IDX) + m_game_id + '.ini');
Gecko::SaveCodes(game_ini_local, m_gecko_codes);

game_ini_local.Save(File::GetUserPath(D_GAMESETTINGS_IDX) + m_game_id + '.ini');
}

voidGeckoCodeWidget::UpdateList()
{
m_code_list->clear();

for (size_t i = 0; i < m_gecko_codes.size(); i++)
{
constauto& code = m_gecko_codes[i];

auto* item = newQListWidgetItem(QString::fromStdString(code.name)
.replace(QStringLiteral('&lt;'), QStringLiteral('<'))
.replace(QStringLiteral('&gt;'), QStringLiteral('>')));

item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable);
item->setCheckState(code.enabled ? Qt::Checked : Qt::Unchecked);

m_code_list->addItem(item);
}
}

voidGeckoCodeWidget::DownloadCodes()
{
bool success;

std::vector<Gecko::GeckoCode> codes = Gecko::DownloadCodes(m_game_id, &success);

if (!success)
{
QMessageBox::critical(this, tr('Error'), tr('Failed to download codes.'));
return;
}

if (codes.empty())
{
QMessageBox::critical(this, tr('Error'), tr('File contained no codes.'));
return;
}

size_t added_count = 0;

for (constauto& code : codes)
{
auto it = std::find(m_gecko_codes.begin(), m_gecko_codes.end(), code);

if (it m_gecko_codes.end())
{
m_gecko_codes.push_back(code);
added_count++;
}
}

UpdateList();

Sep 4, 2017

Sep 4, 2017

SaveCodes();

QMessageBox::information(this, tr('Download complete'),
tr('Downloaded %1 codes. (added %2)')
.arg(QString::number(codes.size()), QString::number(added_count)));
}
@@ -0,0 +1,54 @@
// Copyright 2017 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.

#pragma once

#include<QWidget>

#include<string>
#include<vector>

#include'Common/CommonTypes.h'
#include'Core/GeckoCode.h'

classCheatWarningWidget;
classGameFile;
classQLabel;
classQListWidget;
classQListWidgetItem;
classQTextEdit;
classQPushButton;

classGeckoCodeWidget : publicQWidget
{
Q_OBJECT
public:
explicitGeckoCodeWidget(const GameFile& game);

signals:
voidOpenGeneralSettings();

private:
voidOnSelectionChanged();
voidOnItemChanged(QListWidgetItem* item);

voidCreateWidgets();
voidConnectWidgets();
voidUpdateList();
voidDownloadCodes();
voidSaveCodes();

const GameFile& m_game;
std::string m_game_id;
u8 m_game_revision;

CheatWarningWidget* m_warning;
QListWidget* m_code_list;
QLabel* m_name_label;
QLabel* m_creator_label;
QTextEdit* m_code_description;
QTextEdit* m_code_view;
QPushButton* m_download_codes;
std::vector<Gecko::GeckoCode> m_gecko_codes;
};
ProTip! Use n and p to navigate between commits in a pull request.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.

The very first thing you have to do to use cheats on your Wii is to properly prep the system to run custom software. First, Install Wii homebrew if you haven’t already. Install the homebrew application GeckoOS, which can launch a game with cheat codes enabled. (This function used to be performed with the Occarina application, but its functionality has been folded into GeckoOS.)

of 07

Prepare Your Wii to Run Cheats

Choose a method for creating the GCT cheat files that GeckoOS needs. There are three choices:

  1. Accio Hacks is a Wii homebrew application that allows you to download and manage cheats directly from your Wii. It has some limitations (it is still in beta) and sometimes fails to connect to the Gecko cheats database, but when it works it is the simplest approach.
  2. Online GCT Creator can be accessed from the Gecko Codes website. It is more flexible than Accio Hacks but requires you to manually copy your cheat file to your SD card.
  3. Gecko Cheat Code Manager is a PC application that lets you work with text files downloaded from the Gecko Codes website. It is the most flexible and powerful of the Wii cheat code managers but it is also the least convenient to use.
of 07

Locate Your Cheat File

You can locate cheats for your game either at the Gecko Codes website.

When looking for cheats you will often find multiple listings for the same game. This is because games released for different regions can have different cheats. Lists of game cheats will always include a game id, the fourth letter of which indicates the region code. “E” is for the U.S., “J” is for Japan, “P” is for Europe. “A” indicates a code will work for all regions, however, GeckoOS will not recognize game ids with the “A” code in them; you need to rename the file with the appropriate region letter. In some cases cheats will work for other regions; when stuck in Metroid: Other M you can only find a Japanese cheat file, but when it's changed the “J” to “E” it worked.

Gecko
  • To get cheats from the Gecko Codes website, navigate to your game title by choosing the first letter of the game and then selecting it from the list. Either click GCT to open the Online GCT Creator or click txt to download a text file that can be used offline.
  • To get cheats using Accio Hacks you’ll need your Wii to be connected to the internet. At the main menu, highlight “Accio Hacks/Manage Codes” and press the A button. Navigate to the first letter of your game. You’ll see a “Channel Select” menu, where you can choose the format of the game you want (choices include Wii, WiiWare, VC Arcade, Wii Channels, GameCube, etc.). Highlight the channel you want and press A. Now choose the first letter of the game you are looking for and press A. Highlight “Accio Hacks” and press A. After the file is downloaded you will be returned to the game list. Press the B button to back out. You will now see your game’s cheat file listed. Highlight it and press A.
of 07

Create a GCT File: Select, Edit and Save Your Cheats

After finding the cheat file for your game, you need to select the particular cheats you want enabled (invincibility, increased speed, all weapons, etc.) and save them into a “GCT” file that can be read by Gecko OS. This can be done through Accio Cheats, the Online GCT Creator or the Gecko Cheat Code Manager. While the interfaces for each are different, the basics are the same.

You will have a list of cheats. Each cheat code is made up of sets of alphanumeric characters, for example, “205AF7C4 4182000C.” In some cases, some numbers will be strings of Xs which must be replaced with the appropriate alphanumeric string. Xs are used when there is more than one option; a comment in, above or below the cheat will tell you what values can replace the Xs.

Dolphin

The Online GCT Creator and the Gecko Cheat Code Manager both allow you to add more cheat codes.

  • Option 1: Create a GCT File Using Accio Hacks
  • Option 2: Create a GCT File Using Online GCT Creator
  • Option 3: Create a GCT File Using Gecko Cheat Code Manager

Dolphin Gecko Failed To Download Codes 2017

of 07

Option 1: Create a GCT File Using Accio Hacks

Pressing the + button will bring up an explanation of Accio Hacks’ controls at any time.

Once you highlight the cheat file for your game and press A, you will see a list of all the available cheats for that game. Highlight each one you want and press A to add it. If you need to edit a cheat code press 1. Pressing 2 will show you comments for that code (which are also displayed if you press 1.

Once you have selected the cheats you want, hit the B button. You will be given a choice of saving or not saving the file. Go ahead and save it.

Keep pressing the B button until you get to the main menu. Highlight “Exit to HBC.”

It is possible to use TXT files downloaded from the Gecko Codes Website with Accio Hacks (useful if it is failing to connect with the Gecko database, or if your Wii is not connected to the Internet). You simply need to put the file in the correct folder on your SD card. The formula is SD:codesXLGAMEID.txt, with X indicating the channel letter (which can be seen in the Accio main menu after each selection) and L indicating the first letter of the game title.

You cannot rename the GCT file in Accio Hacks. You cannot (at present) add codes in Accio Hacks.

of 07

Option 2: Create a GCT File Using Online GCT Creator

After you have found your game cheat file and clicked GCT you will see a text box with all the codes listed. Click add codes. This brings up the list of codes with checkboxes next to each one. Click the codes you want, editing them if necessary.

If you have found any codes elsewhere, you can click on add more codes and enter them into the text box, then click add codes.

Once you have selected your codes, click Download GCT. Save your GCT file to the “/codes/” folder on the SD card you use for Wii homebrew, creating the folder if it doesn’t already exist.

of 07

Option 3: Create a GCT File Using Gecko Cheat Code Manager

Start the Manager. Click on File to open the menu, then select Open TXT file. Open the text file you downloaded from the Gecko Codes website.

You will see a list of cheats in the left-hand column with a checkbox next to each cheat. Click the box for each cheat you want and edit any that need editing. Click Export to GCT (at the bottom). Save your GCT file to the “/codes/” folder on the SD card you use for Wii homebrew, creating the folder if it doesn’t already exist.

Gecko Codes For Dolphin

of 07

Load the Cheat and Run the Game

Dolphin Gecko Failed To Download Codes For Windows 10

Put the game disk in your Wii. Start Gecko OS. Choose Launch Game. At a certain point, GeckoOS will tell you it is looking for cheat codes for the disk’s game id. If it doesn’t find any, then you’ve done something wrong. In that case, check your SD’s /codes/ folder in WiiXplorer or with your PC and make sure you have a GCT file there with the appropriate game id (Gecko will briefly display the game’s id code before loading the game.

Dolphin Gecko Failed To Download Codes For Iphone

If GeckoOS does find the appropriate GCT file then it will load it automatically and you will be able to cheat to your heart’s content. If you want to stop cheating, exit the game, then either run it directly through the main Wii menu, turn off SD cheats in the GeckoOS config options, delete the cheat file from the SD:/codes/ folder, or simply re-edit the GCT file in the way you created it, but unselect all cheats and then overwrite the existing file.