From 0df180c0d010b4571ad024134dfbee23f9646728 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Tue, 12 Feb 2019 09:20:37 -0800 Subject: [PATCH 01/30] GB Serialize: Fix loading states with negative pixel x (fixes #1293) --- CHANGES | 1 + src/gb/serialize.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index e6c00e8fc..e8a00269a 100644 --- a/CHANGES +++ b/CHANGES @@ -9,6 +9,7 @@ Bugfixes: - Qt: Fix tile and sprite views not always displaying at first - GBA Memory: Fix a few AGBPrint crashes - GBA Memory: Fix OOB ROM reads showing up as AGBPrint memory + - GB Serialize: Fix loading states with negative pixel x (fixes mgba.io/i/1293) Misc: - GBA Savedata: EEPROM performance fixes - GBA Savedata: Automatically map 1Mbit Flash files as 1Mbit Flash diff --git a/src/gb/serialize.c b/src/gb/serialize.c index 4eef6ae67..6c3db6308 100644 --- a/src/gb/serialize.c +++ b/src/gb/serialize.c @@ -113,7 +113,7 @@ bool GBDeserialize(struct GB* gb, const struct GBSerializedState* state) { error = true; } LOAD_16LE(check16, 0, &state->video.x); - if (check16 < 0 || check16 > GB_VIDEO_HORIZONTAL_PIXELS) { + if (check16 < -7 || check16 > GB_VIDEO_HORIZONTAL_PIXELS) { mLOG(GB_STATE, WARN, "Savestate is corrupted: video x is out of range"); error = true; } From 0980b67736c6f3235710840c9a9e7030b4fcc75d Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Thu, 14 Feb 2019 20:14:22 -0800 Subject: [PATCH 02/30] Wii: Remove duplicate bindings --- src/platform/wii/main.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/platform/wii/main.c b/src/platform/wii/main.c index 8c37c1f4c..4328bd104 100644 --- a/src/platform/wii/main.c +++ b/src/platform/wii/main.c @@ -548,9 +548,7 @@ int main(int argc, char* argv[]) { _mapKey(&runner.params.keyMap, WIIMOTE_INPUT, WPAD_BUTTON_DOWN, GUI_INPUT_RIGHT); _mapKey(&runner.params.keyMap, CLASSIC_INPUT, WPAD_CLASSIC_BUTTON_A, GUI_INPUT_SELECT); - _mapKey(&runner.params.keyMap, CLASSIC_INPUT, WPAD_CLASSIC_BUTTON_Y, GUI_INPUT_SELECT); _mapKey(&runner.params.keyMap, CLASSIC_INPUT, WPAD_CLASSIC_BUTTON_B, GUI_INPUT_BACK); - _mapKey(&runner.params.keyMap, CLASSIC_INPUT, WPAD_CLASSIC_BUTTON_X, GUI_INPUT_BACK); _mapKey(&runner.params.keyMap, CLASSIC_INPUT, WPAD_CLASSIC_BUTTON_HOME, GUI_INPUT_CANCEL); _mapKey(&runner.params.keyMap, CLASSIC_INPUT, WPAD_CLASSIC_BUTTON_UP, GUI_INPUT_UP); _mapKey(&runner.params.keyMap, CLASSIC_INPUT, WPAD_CLASSIC_BUTTON_DOWN, GUI_INPUT_DOWN); From a0d0de137c16f025fdbb6c8952df9dd0cb3298c1 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Thu, 14 Feb 2019 20:14:57 -0800 Subject: [PATCH 03/30] Wii: Saturate joystick values --- src/platform/wii/main.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/platform/wii/main.c b/src/platform/wii/main.c index 4328bd104..dbdb467a9 100644 --- a/src/platform/wii/main.c +++ b/src/platform/wii/main.c @@ -1072,8 +1072,15 @@ static s8 WPAD_StickX(u8 chan, u8 right) { return 0; } int centered = (int) js->pos.x - (int) js->center.x; - int range = js->max.x - js->min.x; - return (centered * 0xFF) / range; + int range = (int) js->max.x - (int) js->min.x; + int value = (centered * 0xFF) / range; + if (value > 0x7F) { + return 0x7F; + } + if (value < -0x80) { + return -0x80; + } + return value; } static s8 WPAD_StickY(u8 chan, u8 right) { @@ -1103,8 +1110,15 @@ static s8 WPAD_StickY(u8 chan, u8 right) { return 0; } int centered = (int) js->pos.y - (int) js->center.y; - int range = js->max.y - js->min.y; - return (centered * 0xFF) / range; + int range = (int) js->max.y - (int) js->min.y; + int value = (centered * 0xFF) / range; + if (value > 0x7F) { + return 0x7F; + } + if (value < -0x80) { + return -0x80; + } + return value; } void _retraceCallback(u32 count) { From 86b6f2e9cd967be4d684ecac80ce26cdaddcfaf1 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Thu, 14 Feb 2019 21:43:16 -0800 Subject: [PATCH 04/30] GBA Peripherals: Improve BattleChip Gate support --- include/mgba/gba/interface.h | 3 +- src/gba/extra/battlechip.c | 112 +++++++++++++++++++++++------------ 2 files changed, 77 insertions(+), 38 deletions(-) diff --git a/include/mgba/gba/interface.h b/include/mgba/gba/interface.h index 440a6e567..0c61363e3 100644 --- a/include/mgba/gba/interface.h +++ b/include/mgba/gba/interface.h @@ -64,7 +64,8 @@ struct GBASIOBattlechipGate { struct GBASIODriver d; struct mTimingEvent event; uint16_t chipId; - int32_t index; + uint16_t data[2]; + int state; }; void GBASIOBattlechipGateCreate(struct GBASIOBattlechipGate*); diff --git a/src/gba/extra/battlechip.c b/src/gba/extra/battlechip.c index 2899347fd..40b80e3ec 100644 --- a/src/gba/extra/battlechip.c +++ b/src/gba/extra/battlechip.c @@ -13,10 +13,15 @@ mLOG_DECLARE_CATEGORY(GBA_BATTLECHIP); mLOG_DEFINE_CATEGORY(GBA_BATTLECHIP, "GBA BattleChip Gate", "gba.battlechip"); enum { - BATTLECHIP_INDEX_HANDSHAKE_0 = 0, - BATTLECHIP_INDEX_HANDSHAKE_1 = 1, - BATTLECHIP_INDEX_ID = 2, - BATTLECHIP_INDEX_END = 6 + BATTLECHIP_STATE_COMMAND = 0, + BATTLECHIP_STATE_UNK_0 = 1, + BATTLECHIP_STATE_UNK_1 = 2, + BATTLECHIP_STATE_DATA_0 = 3, + BATTLECHIP_STATE_DATA_1 = 4, + BATTLECHIP_STATE_ID = 5, + BATTLECHIP_STATE_UNK_2 = 6, + BATTLECHIP_STATE_UNK_3 = 7, + BATTLECHIP_STATE_END = 8 }; enum { @@ -51,7 +56,9 @@ bool GBASIOBattlechipGateInit(struct GBASIODriver* driver) { bool GBASIOBattlechipGateLoad(struct GBASIODriver* driver) { struct GBASIOBattlechipGate* gate = (struct GBASIOBattlechipGate*) driver; - gate->index = BATTLECHIP_INDEX_END; + gate->state = BATTLECHIP_STATE_COMMAND; + gate->data[0] = 0x00FE; + gate->data[1] = 0xFFFE; return true; } @@ -91,49 +98,80 @@ void _battlechipTransferEvent(struct mTiming* timing, void* user, uint32_t cycle gate->d.p->multiplayerControl.busy = 0; gate->d.p->multiplayerControl.id = 0; - mLOG(GBA_BATTLECHIP, DEBUG, "> %04x", cmd); + mLOG(GBA_BATTLECHIP, DEBUG, "> %04X", cmd); - switch (cmd) { - case 0x4000: - gate->index = 0; - // Fall through - case 0: - switch (gate->index) { - case BATTLECHIP_INDEX_HANDSHAKE_0: - reply = 0x00FE; + switch (gate->state) { + case BATTLECHIP_STATE_COMMAND: + mLOG(GBA_BATTLECHIP, DEBUG, "C %04X", cmd); + switch (cmd) { + case 0x0000: + case 0x8FFF: + case 0xA380: + case 0xA390: + case 0xA3A0: + case 0xA3B0: + case 0xA3C0: + case 0xA3D0: + gate->state = -1; + // Fall through + case 0x5379: + case 0x537A: + case 0x537B: + case 0x537C: + case 0x537D: + case 0x537E: + case 0xD979: + case 0xD97A: + case 0xD97B: + case 0xD97C: + case 0xD97D: + case 0xD97E: + reply = BATTLECHIP_OK; break; - case BATTLECHIP_INDEX_HANDSHAKE_1: - reply = 0xFFFE; - break; - case BATTLECHIP_INDEX_ID: - reply = gate->chipId; + case 0x5745: + case 0x5746: + case 0x5747: + case 0x5748: + case 0x5749: + case 0x574A: + case 0xFC00: + // Resync + gate->state = BATTLECHIP_STATE_UNK_0; break; default: - if (gate->index >= BATTLECHIP_INDEX_END) { - reply = BATTLECHIP_OK; - } else if (gate->index < 0) { - reply = BATTLECHIP_CONTINUE; - } else { - reply = 0; - } + mLOG(GBA_BATTLECHIP, STUB, "? %04X", cmd); break; } - ++gate->index; break; - case 0x8FFF: - gate->index = -2; - // Fall through - default: - case 0xA3D0: + case BATTLECHIP_STATE_UNK_0: + case BATTLECHIP_STATE_UNK_1: + reply = 0xFFFF; + break; + case BATTLECHIP_STATE_DATA_0: + reply = gate->data[0]; + gate->data[0] += 3; + gate->data[0] &= 0xF0FF; + break; + case BATTLECHIP_STATE_DATA_1: + reply = gate->data[1]; + gate->data[1] -= 3; + gate->data[1] |= 0xFE00; + break; + case BATTLECHIP_STATE_ID: + reply = gate->chipId; + break; + case BATTLECHIP_STATE_UNK_2: + case BATTLECHIP_STATE_UNK_3: + reply = 0; + break; + case BATTLECHIP_STATE_END: reply = BATTLECHIP_OK; - break; - case 0x4234: - case 0x574A: - reply = BATTLECHIP_CONTINUE; + gate->state = -1; break; } + ++gate->state; - mLOG(GBA_BATTLECHIP, DEBUG, "< %04x", reply); + mLOG(GBA_BATTLECHIP, DEBUG, "< %04X", reply); gate->d.p->p->memory.io[REG_SIOMULTI1 >> 1] = reply; From 7899e02db00c15e6f33c958d7c07f64f1047af96 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Fri, 15 Feb 2019 00:57:24 -0800 Subject: [PATCH 05/30] Qt: Flesh out BattleChip Gate UI --- CHANGES | 1 + res/chip-names-4.txt | 307 +++++++++++++++++++++++++++++ src/platform/qt/BattleChipView.cpp | 33 +++- src/platform/qt/BattleChipView.h | 3 + src/platform/qt/BattleChipView.ui | 23 ++- src/platform/qt/resources.qrc | 1 + 6 files changed, 358 insertions(+), 10 deletions(-) create mode 100644 res/chip-names-4.txt diff --git a/CHANGES b/CHANGES index e8a00269a..ed5cb8375 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,7 @@ 0.8.0: (Future) Features: - Improved logging configuration + - One-Player BattleChip Gate support Bugfixes: - GBA: All IRQs have 7 cycle delay (fixes mgba.io/i/539, mgba.io/i/1208) - GBA: Reset now reloads multiboot ROMs diff --git a/res/chip-names-4.txt b/res/chip-names-4.txt new file mode 100644 index 000000000..fdfd868ae --- /dev/null +++ b/res/chip-names-4.txt @@ -0,0 +1,307 @@ +Cannon +Hi Cannon +Mega Cannon +Air Shot +Blizzard +Heat Breath +Silence +Tornado +Wide Shot 1 +Wide Shot 2 +Wide Shot 3 +Flame Line 1 +Flame Line 2 +Flame Line 3 +Vulcan 1 +Vulcan 2 +Vulcan 3 +Spreader +Heat Shot +Heat V +Heat Side +Bubbler +Bubble V +Bubble Side +Element Flare +Element Ice +Static +Life Sync +Mini Boomer +Energy Bomb +Mega Energy Bomb +Gun del Sol 1 +Gun del Sol 2 +Gun del Sol 3 +Mag Bolt 1 +Mag Bolt 2 +Mag Bolt 3 +Binder 1 +Binder 2 +Binder 3 +Bug Bomb +Elec Shock +Wood Powder +Cannonball +Geyser +Geyser +Sand Ring +Sword +Wide Sword +Long Sword +Wide Blade +Long Blade +Wind Racket +Custom Sword +Variable Sword +Slasher +Thunderball 1 +Thunderball 2 +Thunderball 3 +Counter 1 +Counter 2 +Counter 3 +Air Hockey 1 +Air Hockey 2 +Air Hockey 3 +Circle Gun 1 +Circle Gun 2 +Circle Gun 3 +Twin Fang 1 +Twin Fang 2 +Twin Fang 3 +White Web 1 +White Web 2 +White Web 3 +Boomerang 1 +Boomerang 2 +Boomerang 3 +Side Bamboo 1 +Side Bamboo 2 +Side Bamboo 3 +Lance +Hole +Boy's Bomb 1 +Boy's Bomb 2 +Boy's Bomb 3 +Guard 1 +Guard 2 +Guard 3 +Magnum +Grab Gel +Snake +Time Bomb +Mine +Rock Cube +Fanfare +Discord +Timpani +VDoll +Big Hammer 1 +Big Hammer 2 +Big Hammer 3 +Grab Revenge +Grab Banish +Geddon 1 +Geddon 2 +Geddon 3 +Element Leaf +Color Point +Element Sand +Moko Rush 1 +Moko Rush 2 +Moko Rush 3 +North Wind +Anti Fire +Anti Water +Anti Electric +Anti Wood +Anti Navi +Anti Damage +Anti Sword +Anti Recover +Copy Damage +Attack +10 +Navi +20 +Roll Arrow 1 +Roll Arrow 2 +Roll Arrow 3 +Guts Punch 1 +Guts Punch 2 +Guts Punch 3 +Propeller Bomb 1 +Propeller Bomb 2 +Propeller Bomb 3 +Search Bomb 1 +Search Bomb 2 +Search Bomb 3 +Meteors 1 +Meteors 2 +Meteors 3 +Lightning 1 +Lightning 2 +Lightning 3 +Hawk Cut 1 +Hawk Cut 2 +Hawk Cut 3 +Number Ball 1 +Number Ball 2 +Number Ball 3 +Metal Gear 1 +Metal Gear 2 +Metal Gear 3 +Panel Shoot 1 +Panel Shoot 2 +Panel Shoot 3 +Aqua Upper 1 +Aqua Upper 2 +Aqua Upper 3 +Green Wood 1 +Green Wood 2 +Green Wood 3 +Muramasa +Guardian +Anubis +Double Point +Full Custom +Shooting Star +Bug Chain +Jealousy +Element Dark +Black Wing +God Hammer +Dark Line +Neo Variable +Z Saber +Gun del Sol EX +Super Vulcan +Roll +Roll SP +Roll DS +GutsMan +GutsMan SP +GutsMan DS +WindMan +WindMan SP +WindMan DS +SearchMan +SearchMan SP +SearchMan DS +FireMan +FireMan SP +FireMan DS +ThunderMan +ThunderMan SP +ThunderMan DS +ProtoMan +ProtoMan SP +ProtoMan DS +NumberMan +NumberMan SP +NumberMan DS +MetalMan +MetalMan SP +MetalMan DS +JunkMan +JunkMan SP +JunkMan DS +AquaMan +AquaMan SP +AquaMan DS +WoodMan +WoodMan SP +WoodMan DS +TopMan +TopMan SP +TopMan DS +ShadeMan +ShadeMan SP +ShadeMan DS +BurnerMan +BurnerMan SP +BurnerMan DS +ColdMan +ColdMan SP +ColdMan DS +SparkMan +SparkMan SP +SparkMan DS +LaserMan +LaserMan SP +LaserMan DS +KendoMan +KendoMan SP +KendoMan DS +VideoMan +VideoMan SP +VideoMan DS +Marking +Cannon Mode +Cannonball Mode +Sword Mode +Fire Plus +Thunder Plus +Aqua Power +Wood Power +Black Weapon +Final Gun + + + + + +Bass +Delta Ray +Bug Curse +Red Sun +Bass Another +Holy Dream +Blue Moon +Bug Charge + + +Wind +Fan +Crack Out +Double Crack +Triple Crack +Recovery 10 +Recovery 30 +Recovery 50 +Recovery 80 +Recovery 120 +Recovery 150 +Recovery 200 +Recovery 300 +Repair +Panel Grab +Area Grab +Slow Gauge +Fast Gauge +Panel Return +Blinder +Pop Up +Invisible +Barrier +Barrier 100 +Barrier 200 +Holy Panel + +Life Aura +Attack +30 +Bug Fix +Sanctuary +Signal Red +Black Barrier +MegaMan Navi +Roll Navi +GutsMan Navi +WindMan Navi +SearchMan Navi +FireMan Navi +ThunderMan Navi +ProtoMan Navi +NumberMan Navi +MetalMan Navi +JunkMan Navi +AquaMan Navi +WoodMan Navi \ No newline at end of file diff --git a/src/platform/qt/BattleChipView.cpp b/src/platform/qt/BattleChipView.cpp index af9a0a9eb..4f6b6a4b3 100644 --- a/src/platform/qt/BattleChipView.cpp +++ b/src/platform/qt/BattleChipView.cpp @@ -7,6 +7,9 @@ #include "CoreController.h" +#include +#include + using namespace QGBA; BattleChipView::BattleChipView(std::shared_ptr controller, QWidget* parent) @@ -16,21 +19,47 @@ BattleChipView::BattleChipView(std::shared_ptr controller, QWidg m_ui.setupUi(this); connect(m_ui.chipId, static_cast(&QSpinBox::valueChanged), m_ui.inserted, [this]() { - m_ui.inserted->setChecked(Qt::Checked); - insertChip(true); + m_ui.inserted->setChecked(Qt::Unchecked); }); + connect(m_ui.chipId, static_cast(&QSpinBox::valueChanged), m_ui.chipName, &QComboBox::setCurrentIndex); + connect(m_ui.chipName, static_cast(&QComboBox::currentIndexChanged), m_ui.chipId, &QSpinBox::setValue); + connect(m_ui.inserted, &QAbstractButton::toggled, this, &BattleChipView::insertChip); connect(controller.get(), &CoreController::stopping, this, &QWidget::close); + + setFlavor(4); } BattleChipView::~BattleChipView() { m_controller->detachBattleChipGate(); } +void BattleChipView::setFlavor(int flavor) { + loadChipNames(flavor); +} + void BattleChipView::insertChip(bool inserted) { if (inserted) { m_controller->setBattleChipId(m_ui.chipId->value()); } else { m_controller->setBattleChipId(0); } +} + +void BattleChipView::loadChipNames(int flavor) { + QStringList chipNames; + chipNames.append(tr("(None)")); + + QFile file(QString(":/res/chip-names-%1.txt").arg(flavor)); + file.open(QIODevice::ReadOnly | QIODevice::Text); + while (true) { + QByteArray line = file.readLine(); + if (line.isEmpty()) { + break; + } + chipNames.append(QString::fromUtf8(line).trimmed()); + } + + m_ui.chipName->clear(); + m_ui.chipName->addItems(chipNames); } \ No newline at end of file diff --git a/src/platform/qt/BattleChipView.h b/src/platform/qt/BattleChipView.h index 564f1f8b0..14b61a043 100644 --- a/src/platform/qt/BattleChipView.h +++ b/src/platform/qt/BattleChipView.h @@ -25,9 +25,12 @@ public: ~BattleChipView(); public slots: + void setFlavor(int); void insertChip(bool); private: + void loadChipNames(int); + Ui::BattleChipView m_ui; std::shared_ptr m_controller; diff --git a/src/platform/qt/BattleChipView.ui b/src/platform/qt/BattleChipView.ui index 5143c9d41..092663ae7 100644 --- a/src/platform/qt/BattleChipView.ui +++ b/src/platform/qt/BattleChipView.ui @@ -6,38 +6,45 @@ 0 0 - 217 - 100 + 426 + 152 BattleChip Gate - + Inserted - + Chip ID - - - - 1 + + + + Chip Name + + + + 65535 + + + diff --git a/src/platform/qt/resources.qrc b/src/platform/qt/resources.qrc index 7d61b6dd1..80be2c8be 100644 --- a/src/platform/qt/resources.qrc +++ b/src/platform/qt/resources.qrc @@ -4,5 +4,6 @@ ../../../res/keymap.qpic ../../../res/patrons.txt ../../../res/no-cam.png + ../../../res/chip-names-4.txt From c82f9f0efcd8c8e1f000902773504cfa667c3ab7 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Fri, 15 Feb 2019 01:14:03 -0800 Subject: [PATCH 06/30] Res: Add names for RME4.5 Navis --- res/chip-names-4.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/res/chip-names-4.txt b/res/chip-names-4.txt index fdfd868ae..3ffc433c8 100644 --- a/res/chip-names-4.txt +++ b/res/chip-names-4.txt @@ -304,4 +304,12 @@ NumberMan Navi MetalMan Navi JunkMan Navi AquaMan Navi -WoodMan Navi \ No newline at end of file +WoodMan Navi +StarMan Navi +IceMan Navi +ShadowMan Navi +ElecMan Navi +KnightMan Navi +PlantMan Navi +NapalmMan Navi +Bass Navi \ No newline at end of file From 85a85672e434fc4df288828d26fe5a1beb9c7ed2 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Fri, 15 Feb 2019 21:41:04 -0800 Subject: [PATCH 07/30] GBA Peripherals: Start implementing Progress Gate --- include/mgba/gba/interface.h | 7 + res/chip-names-5.txt | 379 +++++++++++++++++++++++++++++ src/gba/extra/battlechip.c | 37 ++- src/platform/qt/BattleChipView.cpp | 19 ++ src/platform/qt/BattleChipView.ui | 60 ++++- src/platform/qt/CoreController.cpp | 8 + src/platform/qt/CoreController.h | 1 + src/platform/qt/Window.cpp | 7 +- src/platform/qt/resources.qrc | 1 + 9 files changed, 501 insertions(+), 18 deletions(-) create mode 100644 res/chip-names-5.txt diff --git a/include/mgba/gba/interface.h b/include/mgba/gba/interface.h index 0c61363e3..14eabc750 100644 --- a/include/mgba/gba/interface.h +++ b/include/mgba/gba/interface.h @@ -60,12 +60,19 @@ struct GBASIODriver { void GBASIOJOYCreate(struct GBASIODriver* sio); int GBASIOJOYSendCommand(struct GBASIODriver* sio, enum GBASIOJOYCommand command, uint8_t* data); +enum GBASIOBattleChipGateFlavor { + GBA_FLAVOR_BATTLECHIP_GATE = 4, + GBA_FLAVOR_PROGRESS_GATE = 5, + GBA_FLAVOR_BEAST_LINK_GATE = 6, +}; + struct GBASIOBattlechipGate { struct GBASIODriver d; struct mTimingEvent event; uint16_t chipId; uint16_t data[2]; int state; + int flavor; }; void GBASIOBattlechipGateCreate(struct GBASIOBattlechipGate*); diff --git a/res/chip-names-5.txt b/res/chip-names-5.txt new file mode 100644 index 000000000..487d219da --- /dev/null +++ b/res/chip-names-5.txt @@ -0,0 +1,379 @@ +Cannon +Hi Cannon +Mega Cannon +Air Shot +Air Hockey + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Fanfare + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ProtoMan Navi +NumberMan Navi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/gba/extra/battlechip.c b/src/gba/extra/battlechip.c index 40b80e3ec..259f958a5 100644 --- a/src/gba/extra/battlechip.c +++ b/src/gba/extra/battlechip.c @@ -26,6 +26,8 @@ enum { enum { BATTLECHIP_OK = 0xFFC6, + PROGRESS_GATE_OK = 0xFFC7, + BEAST_LINK_GATE_OK = 0xFFC8, BATTLECHIP_CONTINUE = 0xFFFF, }; @@ -46,11 +48,13 @@ void GBASIOBattlechipGateCreate(struct GBASIOBattlechipGate* gate) { gate->event.context = gate; gate->event.callback = _battlechipTransferEvent; gate->event.priority = 0x80; + + gate->chipId = 0; + gate->flavor = GBA_FLAVOR_BATTLECHIP_GATE; } bool GBASIOBattlechipGateInit(struct GBASIODriver* driver) { struct GBASIOBattlechipGate* gate = (struct GBASIOBattlechipGate*) driver; - gate->chipId = 0; return true; } @@ -100,6 +104,20 @@ void _battlechipTransferEvent(struct mTiming* timing, void* user, uint32_t cycle mLOG(GBA_BATTLECHIP, DEBUG, "> %04X", cmd); + uint16_t ok; + switch (gate->flavor) { + case GBA_FLAVOR_BATTLECHIP_GATE: + default: + ok = BATTLECHIP_OK; + break; + case GBA_FLAVOR_PROGRESS_GATE: + ok = PROGRESS_GATE_OK; + break; + case GBA_FLAVOR_BEAST_LINK_GATE: + ok = BEAST_LINK_GATE_OK; + break; + } + switch (gate->state) { case BATTLECHIP_STATE_COMMAND: mLOG(GBA_BATTLECHIP, DEBUG, "C %04X", cmd); @@ -112,6 +130,7 @@ void _battlechipTransferEvent(struct mTiming* timing, void* user, uint32_t cycle case 0xA3B0: case 0xA3C0: case 0xA3D0: + case 0xA6C0: gate->state = -1; // Fall through case 0x5379: @@ -120,14 +139,22 @@ void _battlechipTransferEvent(struct mTiming* timing, void* user, uint32_t cycle case 0x537C: case 0x537D: case 0x537E: + case 0xC4D8: case 0xD979: case 0xD97A: case 0xD97B: case 0xD97C: case 0xD97D: case 0xD97E: - reply = BATTLECHIP_OK; + reply = ok; break; + case 0x424A: + case 0x424B: + case 0x424C: + case 0x424D: + case 0x424E: + case 0x424F: + case 0x4250: case 0x5745: case 0x5746: case 0x5747: @@ -150,12 +177,12 @@ void _battlechipTransferEvent(struct mTiming* timing, void* user, uint32_t cycle case BATTLECHIP_STATE_DATA_0: reply = gate->data[0]; gate->data[0] += 3; - gate->data[0] &= 0xF0FF; + gate->data[0] &= 0x00FF; break; case BATTLECHIP_STATE_DATA_1: reply = gate->data[1]; gate->data[1] -= 3; - gate->data[1] |= 0xFE00; + gate->data[1] |= 0xFC00; break; case BATTLECHIP_STATE_ID: reply = gate->chipId; @@ -165,7 +192,7 @@ void _battlechipTransferEvent(struct mTiming* timing, void* user, uint32_t cycle reply = 0; break; case BATTLECHIP_STATE_END: - reply = BATTLECHIP_OK; + reply = ok; gate->state = -1; break; } diff --git a/src/platform/qt/BattleChipView.cpp b/src/platform/qt/BattleChipView.cpp index 4f6b6a4b3..d101c18f4 100644 --- a/src/platform/qt/BattleChipView.cpp +++ b/src/platform/qt/BattleChipView.cpp @@ -27,6 +27,24 @@ BattleChipView::BattleChipView(std::shared_ptr controller, QWidg connect(m_ui.inserted, &QAbstractButton::toggled, this, &BattleChipView::insertChip); connect(controller.get(), &CoreController::stopping, this, &QWidget::close); + connect(m_ui.gateBattleChip, &QAbstractButton::toggled, this, [this](bool on) { + if (on) { + setFlavor(4); + } + }); + connect(m_ui.gateProgress, &QAbstractButton::toggled, this, [this](bool on) { + if (on) { + setFlavor(5); + } + }); + connect(m_ui.gateBeastLink, &QAbstractButton::toggled, this, [this](bool on) { + if (on) { + setFlavor(6); + } + }); + + + m_controller->attachBattleChipGate(); setFlavor(4); } @@ -35,6 +53,7 @@ BattleChipView::~BattleChipView() { } void BattleChipView::setFlavor(int flavor) { + m_controller->setBattleChipFlavor(flavor); loadChipNames(flavor); } diff --git a/src/platform/qt/BattleChipView.ui b/src/platform/qt/BattleChipView.ui index 092663ae7..63290a93c 100644 --- a/src/platform/qt/BattleChipView.ui +++ b/src/platform/qt/BattleChipView.ui @@ -7,46 +7,92 @@ 0 0 426 - 152 + 278 BattleChip Gate - + Inserted - + Chip ID - + - Chip Name + Chip name - + 65535 - + + + + + Gate type + + + + + + + Progress &Gate + + + gate + + + + + + + Ba&ttleChip Gate + + + true + + + gate + + + + + + + false + + + Beast &Link Gate + + + gate + + + + + + diff --git a/src/platform/qt/CoreController.cpp b/src/platform/qt/CoreController.cpp index c5e8850ec..ef641b3a1 100644 --- a/src/platform/qt/CoreController.cpp +++ b/src/platform/qt/CoreController.cpp @@ -750,6 +750,14 @@ void CoreController::setBattleChipId(uint16_t id) { Interrupter interrupter(this); m_battlechip.chipId = id; } + +void CoreController::setBattleChipFlavor(int flavor) { + if (platform() != PLATFORM_GBA) { + return; + } + Interrupter interrupter(this); + m_battlechip.flavor = flavor; +} #endif void CoreController::setAVStream(mAVStream* stream) { diff --git a/src/platform/qt/CoreController.h b/src/platform/qt/CoreController.h index b7a740626..dbcec9cf3 100644 --- a/src/platform/qt/CoreController.h +++ b/src/platform/qt/CoreController.h @@ -143,6 +143,7 @@ public slots: void attachBattleChipGate(); void detachBattleChipGate(); void setBattleChipId(uint16_t id); + void setBattleChipFlavor(int flavor); #endif void setAVStream(mAVStream*); diff --git a/src/platform/qt/Window.cpp b/src/platform/qt/Window.cpp index a49f3075f..ce3b586b5 100644 --- a/src/platform/qt/Window.cpp +++ b/src/platform/qt/Window.cpp @@ -1365,12 +1365,7 @@ void Window::setupMenu(QMenuBar* menubar) { #ifdef M_CORE_GBA QAction* bcGate = new QAction(tr("BattleChip Gate..."), emulationMenu); - connect(bcGate, &QAction::triggered, [this]() { - BattleChipView* view = new BattleChipView(m_controller); - openView(view); - m_controller->attachBattleChipGate(); - - }); + connect(bcGate, &QAction::triggered, openControllerTView()); addControlledAction(emulationMenu, bcGate, "bcGate"); m_gbaActions.append(bcGate); m_gameActions.append(bcGate); diff --git a/src/platform/qt/resources.qrc b/src/platform/qt/resources.qrc index 80be2c8be..475ab337c 100644 --- a/src/platform/qt/resources.qrc +++ b/src/platform/qt/resources.qrc @@ -5,5 +5,6 @@ ../../../res/patrons.txt ../../../res/no-cam.png ../../../res/chip-names-4.txt + ../../../res/chip-names-5.txt From bf996df244cc4fe322c16ffbe550d4b2f600dc37 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sat, 16 Feb 2019 14:02:44 -0800 Subject: [PATCH 08/30] GBA Peripherals: Start filling in Progress Gate chip names (unchecked) --- res/chip-names-4.txt | 6 +- res/chip-names-5.txt | 348 +++++++++++++++++++++---------------------- 2 files changed, 177 insertions(+), 177 deletions(-) diff --git a/res/chip-names-4.txt b/res/chip-names-4.txt index 3ffc433c8..ebd856004 100644 --- a/res/chip-names-4.txt +++ b/res/chip-names-4.txt @@ -54,9 +54,9 @@ Wind Racket Custom Sword Variable Sword Slasher -Thunderball 1 -Thunderball 2 -Thunderball 3 +Thunder Ball 1 +Thunder Ball 2 +Thunder Ball 3 Counter 1 Counter 2 Counter 3 diff --git a/res/chip-names-5.txt b/res/chip-names-5.txt index 487d219da..84bffa887 100644 --- a/res/chip-names-5.txt +++ b/res/chip-names-5.txt @@ -3,181 +3,181 @@ Hi Cannon Mega Cannon Air Shot Air Hockey - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Boomer +Silence +Tornado +Wide Shot 1 +Wide Shot 2 +Wide Shot 3 +Mark Cannon 1 +Mark Cannon 2 +Mark Cannon 3 +Vulcan 1 +Vulcan 2 +Vulcan 3 +Spreader +Thunder Ball +Ice Seed +Pulsar 1 +Pulsar 2 +Pulsar 3 +Space Shake 1 +Space Shake 2 +Space Shake 3 +Static +Life Sync +Mini Boomer +Energy Bomb +Mega Energy Bomb +Gun del Sol 1 +Gun del Sol 2 +Gun del Sol 3 +Quake 1 +Quake 2 +Quake 3 +Crack Bomb +Paralyze Bomb +Reset Bomb +Bug Bomb +Grass Seed +Lava Seed +Cannon Ball +Geyser +Black Bomb +Sea Seed +Sword +Wide Sword +Long Sword +Wide Blade +Long Blade +Wind Racket +Custom Sword +Variable Sword +Slasher +Moon Blade 1 +Moon Blade 2 +Moon Blade 3 +Katana 1 +Katana 2 +Katana 3 +Tank Cannon 1 +Tank Cannon 2 +Tank Cannon 3 +Red Fruit 1 +Red Fruit 2 +Red Fruit 3 +Skully 1 +Skully 2 +Skully 3 +Drill Arm 1 +Drill Arm 2 +Drill Arm 3 +Time Bomb 1 +Time Bomb 2 +Time Bomb3 +Voltz 1 +Voltz 2 +Voltz 3 +Lance +Yo-Yo +Wind +Fan +Boy's Bomb 1 +Boy's Bomb 2 +Boy's Bomb 3 +Guard 1 +Guard 2 +Guard 3 +Crack Out +Double Crack +Triple Crack +Magnum +Grab Gel +Snake +Circle Gun +Mine +Rock Cube Fanfare - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Discord +Timpani +VDoll +Asteroid 1 +Asteroid 2 +Asteroid 3 +Recovery 10 +Recovery 30 +Recovery 50 +Recovery 80 +Recovery 120 +Recovery 150 +Recovery 200 +Recovery 300 +Buster Up +Panel Grab +Area Grab +Grab Revenge +Grab Banish +Slow Gauge +Fast Gauge +Panel Return +Geddon 1 +Geddon 2 +Geddon 3 +Rainy Day +Color Point +Element Rage +Blinder +Air Spin 1 +Air Spin 2 +Air Spin 3 +Invisible +Bubble Wrap +Barrier +Barrier 100 +Barrier 200 +North Wind +Holy Panel +Anti Fire +Anti Water +Anti Electric +Anti Wood +Anti Navi +Anti Damage +Anti Sword +Anti Recovery +Copy Damage +Attck +10 +Navi +20 +Fire Hit 1 +Fire Hit 2 +Fire Hit 3 +Hot Body 1 +Hot Body 2 +Hot Body 3 +Aqua Whirl 1 +Aqua Whirl 2 +Aqua Whirl 3 +Side Bubble 1 +Side Bubble 2 +Side Bubble 3 +Elec Reel 1 +Elec Reel 2 +Elec Reel 3 +Custom Volt 1 +Custom Volt 2 +Custom Volt 3 +Curse Shield 1 +Curse Shield 2 +Curse Shield 3 +Wave Pit +Red Wave +Mud Wave +Cactus Ball 1 +Cactus Ball 2 +Cactus Ball 3 +Woody Nose 1 +Woody Nose 2 +Woody Nose 3 From fb473e5eb43fad9e4fa57345f64923c51b26071b Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sat, 16 Feb 2019 14:05:09 -0800 Subject: [PATCH 09/30] GBA Peripherals: Partial Beast Link Gate support --- include/mgba/gba/interface.h | 1 + res/chip-names-6.txt | 399 +++++++++++++++++++++++++++++ src/gba/core.c | 1 + src/gba/extra/battlechip.c | 41 ++- src/platform/qt/BattleChipView.cpp | 15 +- src/platform/qt/BattleChipView.ui | 3 - src/platform/qt/resources.qrc | 1 + 7 files changed, 455 insertions(+), 6 deletions(-) create mode 100644 res/chip-names-6.txt diff --git a/include/mgba/gba/interface.h b/include/mgba/gba/interface.h index 14eabc750..e620c108e 100644 --- a/include/mgba/gba/interface.h +++ b/include/mgba/gba/interface.h @@ -64,6 +64,7 @@ enum GBASIOBattleChipGateFlavor { GBA_FLAVOR_BATTLECHIP_GATE = 4, GBA_FLAVOR_PROGRESS_GATE = 5, GBA_FLAVOR_BEAST_LINK_GATE = 6, + GBA_FLAVOR_BEAST_LINK_GATE_US = 7, }; struct GBASIOBattlechipGate { diff --git a/res/chip-names-6.txt b/res/chip-names-6.txt new file mode 100644 index 000000000..2d8e0bacf --- /dev/null +++ b/res/chip-names-6.txt @@ -0,0 +1,399 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/gba/core.c b/src/gba/core.c index 193d6970a..7d00f963c 100644 --- a/src/gba/core.c +++ b/src/gba/core.c @@ -535,6 +535,7 @@ static void _GBACoreSetPeripheral(struct mCore* core, int type, void* periph) { break; case mPERIPH_GBA_BATTLECHIP_GATE: GBASIOSetDriver(&gba->sio, periph, SIO_MULTI); + GBASIOSetDriver(&gba->sio, periph, SIO_NORMAL_32); break; default: return; diff --git a/src/gba/extra/battlechip.c b/src/gba/extra/battlechip.c index 259f958a5..75eb11bea 100644 --- a/src/gba/extra/battlechip.c +++ b/src/gba/extra/battlechip.c @@ -27,7 +27,8 @@ enum { enum { BATTLECHIP_OK = 0xFFC6, PROGRESS_GATE_OK = 0xFFC7, - BEAST_LINK_GATE_OK = 0xFFC8, + BEAST_LINK_GATE_OK = 0xFFC4, + BEAST_LINK_GATE_US_OK = 0xFF00, BATTLECHIP_CONTINUE = 0xFFFF, }; @@ -87,13 +88,29 @@ uint16_t GBASIOBattlechipGateWriteRegister(struct GBASIODriver* driver, uint32_t } void _battlechipTransfer(struct GBASIOBattlechipGate* gate) { - int32_t cycles = GBASIOCyclesPerTransfer[gate->d.p->multiplayerControl.baud][1]; + int32_t cycles; + if (gate->d.p->mode == SIO_NORMAL_32) { + cycles = GBA_ARM7TDMI_FREQUENCY / 0x40000; + } else { + cycles = GBASIOCyclesPerTransfer[gate->d.p->multiplayerControl.baud][1]; + } + mTimingDeschedule(&gate->d.p->p->timing, &gate->event); mTimingSchedule(&gate->d.p->p->timing, &gate->event, cycles); } void _battlechipTransferEvent(struct mTiming* timing, void* user, uint32_t cyclesLate) { struct GBASIOBattlechipGate* gate = user; + if (gate->d.p->mode == SIO_NORMAL_32) { + gate->d.p->p->memory.io[REG_SIODATA32_LO >> 1] = 0; + gate->d.p->p->memory.io[REG_SIODATA32_HI >> 1] = 0; + gate->d.p->normalControl.start = 0; + if (gate->d.p->normalControl.irq) { + GBARaiseIRQ(gate->d.p->p, IRQ_SIO); + } + return; + } + uint16_t cmd = gate->d.p->p->memory.io[REG_SIOMLT_SEND >> 1]; uint16_t reply = 0xFFFF; gate->d.p->p->memory.io[REG_SIOMULTI0 >> 1] = cmd; @@ -116,6 +133,9 @@ void _battlechipTransferEvent(struct mTiming* timing, void* user, uint32_t cycle case GBA_FLAVOR_BEAST_LINK_GATE: ok = BEAST_LINK_GATE_OK; break; + case GBA_FLAVOR_BEAST_LINK_GATE_US: + ok = BEAST_LINK_GATE_US_OK; + break; } switch (gate->state) { @@ -139,7 +159,18 @@ void _battlechipTransferEvent(struct mTiming* timing, void* user, uint32_t cycle case 0x537C: case 0x537D: case 0x537E: + case 0xB7D3: + case 0xB7D4: + case 0xB7D5: + case 0xB7D6: + case 0xB7D7: + case 0xB7D8: case 0xC4D8: + case 0xC4D9: + case 0xC4DA: + case 0xC4DB: + case 0xC4DC: + case 0xC4DD: case 0xD979: case 0xD97A: case 0xD97B: @@ -148,6 +179,12 @@ void _battlechipTransferEvent(struct mTiming* timing, void* user, uint32_t cycle case 0xD97E: reply = ok; break; + case 0x3545: + case 0x3546: + case 0x3547: + case 0x3548: + case 0x3549: + case 0x354A: case 0x424A: case 0x424B: case 0x424C: diff --git a/src/platform/qt/BattleChipView.cpp b/src/platform/qt/BattleChipView.cpp index d101c18f4..4f5206415 100644 --- a/src/platform/qt/BattleChipView.cpp +++ b/src/platform/qt/BattleChipView.cpp @@ -39,7 +39,16 @@ BattleChipView::BattleChipView(std::shared_ptr controller, QWidg }); connect(m_ui.gateBeastLink, &QAbstractButton::toggled, this, [this](bool on) { if (on) { - setFlavor(6); + char title[9]; + CoreController::Interrupter interrupter(m_controller); + mCore* core = m_controller->thread()->core; + title[8] = '\0'; + core->getGameCode(core, title); + if (title[7] == 'E' || title[7] == 'P') { + setFlavor(7); + } else { + setFlavor(6); + } } }); @@ -69,6 +78,10 @@ void BattleChipView::loadChipNames(int flavor) { QStringList chipNames; chipNames.append(tr("(None)")); + if (flavor == 7) { + flavor = 6; + } + QFile file(QString(":/res/chip-names-%1.txt").arg(flavor)); file.open(QIODevice::ReadOnly | QIODevice::Text); while (true) { diff --git a/src/platform/qt/BattleChipView.ui b/src/platform/qt/BattleChipView.ui index 63290a93c..ba95e455a 100644 --- a/src/platform/qt/BattleChipView.ui +++ b/src/platform/qt/BattleChipView.ui @@ -77,9 +77,6 @@ - - false - Beast &Link Gate diff --git a/src/platform/qt/resources.qrc b/src/platform/qt/resources.qrc index 475ab337c..ea08c5e39 100644 --- a/src/platform/qt/resources.qrc +++ b/src/platform/qt/resources.qrc @@ -6,5 +6,6 @@ ../../../res/no-cam.png ../../../res/chip-names-4.txt ../../../res/chip-names-5.txt + ../../../res/chip-names-6.txt From 8e75d420f436ba5d46a34a0d08b88dd160e9553e Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sat, 16 Feb 2019 15:59:03 -0800 Subject: [PATCH 10/30] GBA Peripherals: Fill in Progress Gate chip names --- res/chip-names-5.txt | 302 ++++++++++++++++++++----------------------- 1 file changed, 137 insertions(+), 165 deletions(-) diff --git a/res/chip-names-5.txt b/res/chip-names-5.txt index 84bffa887..1501aacf9 100644 --- a/res/chip-names-5.txt +++ b/res/chip-names-5.txt @@ -184,6 +184,132 @@ Woody Nose 3 +Dark Circle +Dark Sword +Dark Invis +Dark Plus +Dark Lance +Dark Wide +Dark Thunder +Dark Recovery +Dark Meteor +Dark Drill +Dark Tornado +Dark Sonic + + +Life Aura +Muramasa +Guardian +Anubis +Attack +30 +Bug Fix +Double Point +Sanctuary +Full Custom +Meteors +Number Ball +Jealousy +Poltergeist +Black Wing +Otenko +Justice One +Neo Variable +Z Saber +Gun del Sol EX +Super Vulcan +Roll +Roll SP +Roll DS +GyroMan +GyroMan SP +GyroMan DS +NapalmMan +NapalmMan SP +NapalmMan DS +SearchMan +SearchMan SP +SearchMan DS +MagnetMan +MagnetMan SP +MagnetMan DS +Meddy +Meddy SP +Meddy DS +ProtoMan +ProtoMan SP +ProtoMan DS +NumberMan +NumberMan SP +NumberMan DS +Colonel +Colonel SP +Colonel DS +ShadowMan +ShadowMan SP +ShadowMan DS +TomahawkMan +TomahawkMan SP +TomahawkMan DS +KnightMan +KnightMan SP +KnightMan DS +ToadMan +ToadMan SP +ToadMan DS +ShadeMan +ShadeMan SP +ShadeMan DS +BlizzardMan +BlizzardMan SP +BlizzardMan DS +CloudMan +CloudMan SP +CloudMan DS +CosmoMan +CosmoMan SP +CosmoMan DS +LarkMan +LarkMan SP +LarkMan DS +GridMan +GridMan SP +GridMan DS +Django +Django SP +Django DS +Cannon Mode +Cannon Ball +Sword Mode +Yo-Yo Mode +Drill Mode +L Curse Shield +L Step Sword +L Counter +Elememt Power +Final Gun + + + + + + + + + + +Bass +Delta Ray +Bug Curse +Meteor Knuckle +Omega Racket +Bass Another +Holy Dream +Big Hook +Cross Divide +Bug Charge +Phoenix +Death Phoenix @@ -201,137 +327,11 @@ Woody Nose 3 +MegaMan Navi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +SearchMan Navi ProtoMan Navi @@ -340,40 +340,12 @@ NumberMan Navi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +ShadowMan Navi +NapalmMan Navi +KnightMan Navi +ToadMan Navi +MagnetMan Navi +GyroMan Navi +Colonel Navi +Meddy Navi +TomahawkMan Navi \ No newline at end of file From a64236ce21800d5960f852176cfaa9f80c9b0dbd Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sat, 16 Feb 2019 16:16:02 -0800 Subject: [PATCH 11/30] Qt: Auto-select correct Gate type --- src/platform/qt/BattleChipView.cpp | 37 +++++++++++++++++++----------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/src/platform/qt/BattleChipView.cpp b/src/platform/qt/BattleChipView.cpp index 4f5206415..d0522b157 100644 --- a/src/platform/qt/BattleChipView.cpp +++ b/src/platform/qt/BattleChipView.cpp @@ -18,6 +18,14 @@ BattleChipView::BattleChipView(std::shared_ptr controller, QWidg { m_ui.setupUi(this); + char title[9]; + CoreController::Interrupter interrupter(m_controller); + mCore* core = m_controller->thread()->core; + title[8] = '\0'; + core->getGameCode(core, title); + QString qtitle(title); + + connect(m_ui.chipId, static_cast(&QSpinBox::valueChanged), m_ui.inserted, [this]() { m_ui.inserted->setChecked(Qt::Unchecked); }); @@ -29,32 +37,33 @@ BattleChipView::BattleChipView(std::shared_ptr controller, QWidg connect(m_ui.gateBattleChip, &QAbstractButton::toggled, this, [this](bool on) { if (on) { - setFlavor(4); + setFlavor(GBA_FLAVOR_BATTLECHIP_GATE); } }); connect(m_ui.gateProgress, &QAbstractButton::toggled, this, [this](bool on) { if (on) { - setFlavor(5); + setFlavor(GBA_FLAVOR_PROGRESS_GATE); } }); - connect(m_ui.gateBeastLink, &QAbstractButton::toggled, this, [this](bool on) { + connect(m_ui.gateBeastLink, &QAbstractButton::toggled, this, [this, qtitle](bool on) { if (on) { - char title[9]; - CoreController::Interrupter interrupter(m_controller); - mCore* core = m_controller->thread()->core; - title[8] = '\0'; - core->getGameCode(core, title); - if (title[7] == 'E' || title[7] == 'P') { - setFlavor(7); + if (qtitle.endsWith('E') || qtitle.endsWith('P')) { + setFlavor(GBA_FLAVOR_BEAST_LINK_GATE_US); } else { - setFlavor(6); + setFlavor(GBA_FLAVOR_BEAST_LINK_GATE); } } }); - m_controller->attachBattleChipGate(); setFlavor(4); + if (qtitle.startsWith("AGB-B4B") || qtitle.startsWith("AGB-B4W") || qtitle.startsWith("AGB-BR4")) { + m_ui.gateBattleChip->setChecked(Qt::Checked); + } else if (qtitle.startsWith("AGB-BRB") || qtitle.startsWith("AGB-BRK")) { + m_ui.gateProgress->setChecked(Qt::Checked); + } else if (qtitle.startsWith("AGB-BR5") || qtitle.startsWith("AGB-BR6")) { + m_ui.gateBeastLink->setChecked(Qt::Checked); + } } BattleChipView::~BattleChipView() { @@ -78,8 +87,8 @@ void BattleChipView::loadChipNames(int flavor) { QStringList chipNames; chipNames.append(tr("(None)")); - if (flavor == 7) { - flavor = 6; + if (flavor == GBA_FLAVOR_BEAST_LINK_GATE_US) { + flavor = GBA_FLAVOR_BEAST_LINK_GATE; } QFile file(QString(":/res/chip-names-%1.txt").arg(flavor)); From 063375806f7365b7efcc9cc8f9bc50704a73d65a Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sat, 16 Feb 2019 16:25:29 -0800 Subject: [PATCH 12/30] Qt: Prune empty chip names from list --- src/platform/qt/BattleChipView.cpp | 12 ++++++++++-- src/platform/qt/BattleChipView.h | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/platform/qt/BattleChipView.cpp b/src/platform/qt/BattleChipView.cpp index d0522b157..e755e416d 100644 --- a/src/platform/qt/BattleChipView.cpp +++ b/src/platform/qt/BattleChipView.cpp @@ -29,8 +29,9 @@ BattleChipView::BattleChipView(std::shared_ptr controller, QWidg connect(m_ui.chipId, static_cast(&QSpinBox::valueChanged), m_ui.inserted, [this]() { m_ui.inserted->setChecked(Qt::Unchecked); }); - connect(m_ui.chipId, static_cast(&QSpinBox::valueChanged), m_ui.chipName, &QComboBox::setCurrentIndex); - connect(m_ui.chipName, static_cast(&QComboBox::currentIndexChanged), m_ui.chipId, &QSpinBox::setValue); + connect(m_ui.chipName, static_cast(&QComboBox::currentIndexChanged), m_ui.chipId, [this](int id) { + m_ui.chipId->setValue(m_chipIndexToId[id]); + }); connect(m_ui.inserted, &QAbstractButton::toggled, this, &BattleChipView::insertChip); connect(controller.get(), &CoreController::stopping, this, &QWidget::close); @@ -87,17 +88,24 @@ void BattleChipView::loadChipNames(int flavor) { QStringList chipNames; chipNames.append(tr("(None)")); + m_chipIndexToId.clear(); if (flavor == GBA_FLAVOR_BEAST_LINK_GATE_US) { flavor = GBA_FLAVOR_BEAST_LINK_GATE; } QFile file(QString(":/res/chip-names-%1.txt").arg(flavor)); file.open(QIODevice::ReadOnly | QIODevice::Text); + int id = 0; while (true) { QByteArray line = file.readLine(); if (line.isEmpty()) { break; } + ++id; + if (line.trimmed().isEmpty()) { + continue; + } + m_chipIndexToId[chipNames.length()] = id; chipNames.append(QString::fromUtf8(line).trimmed()); } diff --git a/src/platform/qt/BattleChipView.h b/src/platform/qt/BattleChipView.h index 14b61a043..7dbdc9561 100644 --- a/src/platform/qt/BattleChipView.h +++ b/src/platform/qt/BattleChipView.h @@ -33,6 +33,7 @@ private: Ui::BattleChipView m_ui; + QMap m_chipIndexToId; std::shared_ptr m_controller; }; From 5a08abacf126476d81215c87ab499d6d25cc6c8e Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sat, 16 Feb 2019 16:54:41 -0800 Subject: [PATCH 13/30] Qt: Fix audio context holding onto closed game controller --- CHANGES | 1 + src/platform/qt/Window.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGES b/CHANGES index ed5cb8375..274b3ee52 100644 --- a/CHANGES +++ b/CHANGES @@ -11,6 +11,7 @@ Bugfixes: - GBA Memory: Fix a few AGBPrint crashes - GBA Memory: Fix OOB ROM reads showing up as AGBPrint memory - GB Serialize: Fix loading states with negative pixel x (fixes mgba.io/i/1293) + - Qt: Fix audio context holding onto closed game controller Misc: - GBA Savedata: EEPROM performance fixes - GBA Savedata: Automatically map 1Mbit Flash files as 1Mbit Flash diff --git a/src/platform/qt/Window.cpp b/src/platform/qt/Window.cpp index ce3b586b5..26c588d88 100644 --- a/src/platform/qt/Window.cpp +++ b/src/platform/qt/Window.cpp @@ -797,6 +797,11 @@ void Window::gameStopped() { m_fpsTimer.stop(); m_focusCheck.stop(); + if (m_audioProcessor) { + m_audioProcessor->stop(); + m_audioProcessor.reset(); + } + emit paused(false); } From 1c4b89d0f4219c1940c983b0f58ab7dbb45361ba Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sat, 16 Feb 2019 17:13:40 -0800 Subject: [PATCH 14/30] Switch: Fix gyroscope orientation (fixes #1300) --- CHANGES | 1 + src/platform/switch/main.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 274b3ee52..bac57d7c4 100644 --- a/CHANGES +++ b/CHANGES @@ -12,6 +12,7 @@ Bugfixes: - GBA Memory: Fix OOB ROM reads showing up as AGBPrint memory - GB Serialize: Fix loading states with negative pixel x (fixes mgba.io/i/1293) - Qt: Fix audio context holding onto closed game controller + - Switch: Fix gyroscope orientation (fixes mgba.io/i/1300) Misc: - GBA Savedata: EEPROM performance fixes - GBA Savedata: Automatically map 1Mbit Flash files as 1Mbit Flash diff --git a/src/platform/switch/main.c b/src/platform/switch/main.c index e344ff44d..cde839743 100644 --- a/src/platform/switch/main.c +++ b/src/platform/switch/main.c @@ -463,7 +463,7 @@ int32_t _readGyroZ(struct mRotationSource* source) { UNUSED(source); SixAxisSensorValues sixaxis; hidSixAxisSensorValuesRead(&sixaxis, CONTROLLER_P1_AUTO, 1); - return sixaxis.gyroscope.z * 1.1e9f; + return sixaxis.gyroscope.z * -1.1e9f; } static int _batteryState(void) { From 83dfd9229bba84b34e5f28a544c39821ff20856e Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sun, 17 Feb 2019 02:24:49 -0800 Subject: [PATCH 15/30] GBA Peripherals: Fix Beast Link Gate slotting --- src/gba/extra/battlechip.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gba/extra/battlechip.c b/src/gba/extra/battlechip.c index 75eb11bea..4ba5043d9 100644 --- a/src/gba/extra/battlechip.c +++ b/src/gba/extra/battlechip.c @@ -177,6 +177,7 @@ void _battlechipTransferEvent(struct mTiming* timing, void* user, uint32_t cycle case 0xD97C: case 0xD97D: case 0xD97E: + case 0xE49A: reply = ok; break; case 0x3545: @@ -198,12 +199,12 @@ void _battlechipTransferEvent(struct mTiming* timing, void* user, uint32_t cycle case 0x5748: case 0x5749: case 0x574A: - case 0xFC00: // Resync gate->state = BATTLECHIP_STATE_UNK_0; break; default: mLOG(GBA_BATTLECHIP, STUB, "? %04X", cmd); + gate->state = -1; break; } break; From f7a994a44a91afac1fdc86753bf9dd6ef7d58c7d Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sun, 17 Feb 2019 10:57:50 -0800 Subject: [PATCH 16/30] Qt: Fill in Beast Link Gate chip names from EXE6 translation patch names --- res/chip-names-6.txt | 899 ++++++++++++++++++++++++------------------- 1 file changed, 500 insertions(+), 399 deletions(-) diff --git a/res/chip-names-6.txt b/res/chip-names-6.txt index 2d8e0bacf..879ff0e70 100644 --- a/res/chip-names-6.txt +++ b/res/chip-names-6.txt @@ -1,399 +1,500 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Cannon +HiCannon +MegaCannon +AirShot +Vulcan1 +Vulcan2 +Vulcan3 +SuperVulcan +Spreader1 +Spreader2 +Spreader3 +TankCannon1 +TankCannon2 +TankCannon3 +GunDelSol1 +GunDelSol2 +GunDelSol3 +GunDelSolEX +Yo-Yo +FireBurner1 +FireBurner2 +FireBurner3 +WideShot +TrainArrow1 +TrainArrow2 +TrainArrow3 +BubbleStar1 +BubbleStar2 +BubbleStar3 +Thunder +DollThunder1 +DollThunder2 +DollThunder3 +ElecPulse1 +ElecPulse2 +ElecPulse3 +RiskyHoney1 +RiskyHoney2 +RiskyHoney3 +RollingLog1 +RollingLog2 +RollingLog3 +MachineGun1 +MachineGun2 +MachineGun3 +HeatDragon +ElecDragon +AquaDragon +WoodDragon +AirHockey +DrillArm +Tornado +Static +MiniBomb +EnergyBomb +MegaEnergyBomb +FlashBomb1 +FlashBomb2 +FlashBomb3 +BlackBomb +AquaNeedle1 +AquaNeedle2 +AquaNeedle3 +CornShot1 +CornShot2 +CornShot3 +BugBomb +GrassSeed +IceSeed +PoisonSeed +Sword +WideSword +LongSword +WideBlade +LongBlade +FireSword +AquaSword +ElecSword +BambooSword +WindRacket +StepSword +VariableSword +NeoVariSword +MoonBlade +Muramasa +MachineSword +ElementSword +AssassinSword +CrackShot +DoubleShot +TripleShot +WaveArm1 +WaveArm2 +WaveArm3 +AuraHead1 +AuraHead2 +AuraHead3 +LittleBoiler1 +LittleBoiler2 +LittleBoiler3 +SandWorm1 +SandWorm2 +SandWorm3 +AirRaid1 +AirRaid2 +AirRaid3 +FireHit1 +FireHit2 +FireHit3 +BurnSquare1 +BurnSquare2 +BurnSquare3 +Sensor1 +Sensor2 +Sensor3 +Boomer +HiBoomer +MegaBoomer +Lance +GolemHit1 +GolemHit2 +GolemHit3 +IronShell1 +IronShell2 +IronShell3 +AirSpin1 +AirSpin2 +AirSpin3 +Wind +Fan +Reflector1 +Reflector2 +Reflector3 +Snake +SummonBlack1 +SummonBlack2 +SummonBlack3 +NumberBall +Meteors +JusticeOne +Magnum +CircleGun +RockCube +TimeBomb1 +Mine +Fanfare +Discord +Timpani +Silence +Vdoll +Guardian +Anubis +Otenko +Recover10 +Recover30 +Recover50 +Recover80 +Recover120 +Recover150 +Recover200 +Recover300 +PanelGrab +AreaGrab +GrabBanish +GrabRevenge +PanelReturn +Geddon +HolyPanel +Sanctuary +ComingRoad +GoingRoad +SlowGauge +FastGauge +FullCustom +BusterUp +BugFix +Invisible +Barrier +Barrier100 +Barrier200 +BubbleWrap +LifeAura +MagnetCoil +WhiteCapsule +Uninstall +AntiNavi +AntiDamage +AntiSword +AntiRecover +CopyDamage +LifeSync +Attack+10 +Navi+20 +ColorPoint +Attack+30 +DoublePoint +ElementTrap +ColonelArmy +BlizzardBall +TimeBomb2 +TimeBomb3 +BigBomb +DarkTornado +DarkCircle +DarkMeteors +DarkLance +DarkWide + + + + + + + + + + + + + +Roll +Roll2 +Roll3 +ProtoMan +ProtoManEX +ProtoManSP +HeatMan +HeatManEX +HeatManSP +ElecMan +ElecManEX +ElecManSP +SlashMan +SlashManEX +SlashManSP +EraseMan +EraseManEX +EraseManSP +ChargeMan +ChargeManEX +ChargeManSP +SpoutMan +SpoutManEX +SpoutManSP +TomahawkMan +TomahawkManEX +TomahawkManSP +TenguMan +TenguManEX +TenguManSP +GroundMan +GroundManEX +GroundManSP +DustMan +DustManEX +DustManSP +BlastMan +BlastManEX +BlastManSP +DiveMan +DiveManEX +DiveManSP +CircusMan +CircusManEX +CircusManSP +JudgeMan +JudgeManEX +JudgeManSP +ElementMan +ElementManEX +ElementManSP +Colonel +ColonelEX +ColonelSP +Count +CountEX +CountSP +Django +Django2 +Django3 +PunchArm +NeedleArm +PuzzleArm +BoomerArm +SynchroTrigger +DarkSword +DarkThunder +DarkRecover +DarkInvisible +DarkPlus + + + + + + + + + + +Bass +BigHook +DeltaRay +ColonelForce +BugRiseSword +BassAnomaly +MeteorKnuckle +CrossDivide +HubBatch +BugDeathThunder +DoubleBeast +Gregar +Falzar + + + + + + + +MegaManV1 +MegaManV2 +MegaManV3 +MegaManV4 +MegaManV5 +MegaManV6 +MegaManV7 +MegaManV8 +MegaManV9 +MegaManV10 +MegaManV11 +MegaManV12 +MegaManV13 +MegaManV14 +MegaManSP +HeatManV1 +HeatManV2 +HeatManV3 +HeatManV4 +HeatManV5 +HeatManV6 +HeatManV7 +HeatManV8 +HeatManV9 +HeatManV10 +HeatManV11 +HeatManV12 +HeatManV13 +HeatManV14 +HeatManSP +ElecManV1 +ElecManV2 +ElecManV3 +ElecManV4 +ElecManV5 +ElecManV6 +ElecManV7 +ElecManV8 +ElecManV9 +ElecManV10 +ElecManV11 +ElecManV12 +ElecManV13 +ElecManV14 +ElecManSP +SlashManV1 +SlashManV2 +SlashManV3 +SlashManV4 +SlashManV5 +SlashManV6 +SlashManV7 +SlashManV8 +SlashManV9 +SlashManV10 +SlashManV11 +SlashManV12 +SlashManV13 +SlashManV14 +SlashManSP +EraseManV1 +EraseManV2 +EraseManV3 +EraseManV4 +EraseManV5 +EraseManV6 +EraseManV7 +EraseManV8 +EraseManV9 +EraseManV10 +EraseManV11 +EraseManV12 +EraseManV13 +EraseManV14 +EraseManSP +ChargeManV1 +ChargeManV2 +ChargeManV3 +ChargeManV4 +ChargeManV5 +ChargeManV6 +ChargeManV7 +ChargeManV8 +ChargeManV9 +ChargeManV10 +ChargeManV11 +ChargeManV12 +ChargeManV13 +ChargeManV14 +ChargeManSP +SpoutManV1 +SpoutManV2 +SpoutManV3 +SpoutManV4 +SpoutManV5 +SpoutManV6 +SpoutManV7 +SpoutManV8 +SpoutManV9 +SpoutManV10 +SpoutManV11 +SpoutManV12 +SpoutManV13 +SpoutManV14 +SpoutManSP +TomahawkManV1 +TomahawkManV2 +TomahawkManV3 +TomahawkManV4 +TomahawkManV5 +TomahawkManV6 +TomahawkManV7 +TomahawkManV8 +TomahawkManV9 +TomahawkManV10 +TomahawkManV11 +TomahawkManV12 +TomahawkManV13 +TomahawkManV14 +TomahawkManSP +TenguManV1 +TenguManV2 +TenguManV3 +TenguManV4 +TenguManV5 +TenguManV6 +TenguManV7 +TenguManV8 +TenguManV9 +TenguManV10 +TenguManV11 +TenguManV12 +TenguManV13 +TenguManV14 +TenguManSP +GroundManV1 +GroundManV2 +GroundManV3 +GroundManV4 +GroundManV5 +GroundManV6 +GroundManV7 +GroundManV8 +GroundManV9 +GroundManV10 +GroundManV11 +GroundManV12 +GroundManV13 +GroundManV14 +GroundManSP +DustManV1 +DustManV2 +DustManV3 +DustManV4 +DustManV5 +DustManV6 +DustManV7 +DustManV8 +DustManV9 +DustManV10 +DustManV11 +DustManV12 +DustManV13 +DustManV14 +DustManSP +ProtoManV1 +ProtoManV2 +ProtoManV3 +ProtoManV4 +ProtoManV5 +ProtoManV6 +ProtoManV7 +ProtoManV8 +ProtoManV9 +ProtoManV10 +ProtoManV11 +ProtoManV12 +ProtoManV13 +ProtoManV14 +ProtoManSP \ No newline at end of file From f475a5d8c70aecb6eae27370dd7e1fb95d1c890b Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sun, 17 Feb 2019 11:01:08 -0800 Subject: [PATCH 17/30] Qt: Update BN4/5 chip names in accordance with EXE6 translation patch names --- res/chip-names-4.txt | 508 +++++++++++++++++++++--------------------- res/chip-names-5.txt | 510 +++++++++++++++++++++---------------------- 2 files changed, 509 insertions(+), 509 deletions(-) diff --git a/res/chip-names-4.txt b/res/chip-names-4.txt index ebd856004..a7f147f54 100644 --- a/res/chip-names-4.txt +++ b/res/chip-names-4.txt @@ -1,315 +1,315 @@ Cannon -Hi Cannon -Mega Cannon -Air Shot +HiCannon +MegaCannon +AirShot Blizzard -Heat Breath +HeatBreath Silence Tornado -Wide Shot 1 -Wide Shot 2 -Wide Shot 3 -Flame Line 1 -Flame Line 2 -Flame Line 3 -Vulcan 1 -Vulcan 2 -Vulcan 3 +WideShot1 +WideShot2 +WideShot3 +FlameLine1 +FlameLine2 +FlameLine3 +Vulcan1 +Vulcan2 +Vulcan3 Spreader -Heat Shot -Heat V -Heat Side +HeatShot +HeatV +HeatSide Bubbler -Bubble V -Bubble Side -Element Flare -Element Ice +BubbleV +BubbleSide +ElementFlare +ElementIce Static -Life Sync -Mini Boomer -Energy Bomb -Mega Energy Bomb -Gun del Sol 1 -Gun del Sol 2 -Gun del Sol 3 -Mag Bolt 1 -Mag Bolt 2 -Mag Bolt 3 -Binder 1 -Binder 2 -Binder 3 -Bug Bomb -Elec Shock -Wood Powder +LifeSync +MiniBoomer +EnergyBomb +MegaEnergyBomb +GunDelSol1 +GunDelSol2 +GunDelSol3 +MagBolt1 +MagBolt2 +MagBolt3 +Binder1 +Binder2 +Binder3 +BugBomb +ElecShock +WoodPowder Cannonball Geyser Geyser -Sand Ring +SandRing Sword -Wide Sword -Long Sword -Wide Blade -Long Blade -Wind Racket -Custom Sword -Variable Sword +WideSword +LongSword +WideBlade +LongBlade +WindRacket +CustomSword +VariableSword Slasher -Thunder Ball 1 -Thunder Ball 2 -Thunder Ball 3 -Counter 1 -Counter 2 -Counter 3 -Air Hockey 1 -Air Hockey 2 -Air Hockey 3 -Circle Gun 1 -Circle Gun 2 -Circle Gun 3 -Twin Fang 1 -Twin Fang 2 -Twin Fang 3 -White Web 1 -White Web 2 -White Web 3 -Boomerang 1 -Boomerang 2 -Boomerang 3 -Side Bamboo 1 -Side Bamboo 2 -Side Bamboo 3 +ThunderBall1 +ThunderBall2 +ThunderBall3 +Counter1 +Counter2 +Counter3 +AirHockey1 +AirHockey2 +AirHockey3 +CircleGun1 +CircleGun2 +CircleGun3 +TwinFang1 +TwinFang2 +TwinFang3 +WhiteWeb1 +WhiteWeb2 +WhiteWeb3 +Boomerang1 +Boomerang2 +Boomerang3 +SideBamboo1 +SideBamboo2 +SideBamboo3 Lance Hole -Boy's Bomb 1 -Boy's Bomb 2 -Boy's Bomb 3 -Guard 1 -Guard 2 -Guard 3 +Boy'sBomb1 +Boy'sBomb2 +Boy'sBomb3 +Guard1 +Guard2 +Guard3 Magnum -Grab Gel +GrabGel Snake -Time Bomb +TimeBomb Mine -Rock Cube +RockCube Fanfare Discord Timpani -VDoll -Big Hammer 1 -Big Hammer 2 -Big Hammer 3 -Grab Revenge -Grab Banish -Geddon 1 -Geddon 2 -Geddon 3 -Element Leaf -Color Point -Element Sand -Moko Rush 1 -Moko Rush 2 -Moko Rush 3 -North Wind -Anti Fire -Anti Water -Anti Electric -Anti Wood -Anti Navi -Anti Damage -Anti Sword -Anti Recover -Copy Damage -Attack +10 -Navi +20 -Roll Arrow 1 -Roll Arrow 2 -Roll Arrow 3 -Guts Punch 1 -Guts Punch 2 -Guts Punch 3 -Propeller Bomb 1 -Propeller Bomb 2 -Propeller Bomb 3 -Search Bomb 1 -Search Bomb 2 -Search Bomb 3 -Meteors 1 -Meteors 2 -Meteors 3 -Lightning 1 -Lightning 2 -Lightning 3 -Hawk Cut 1 -Hawk Cut 2 -Hawk Cut 3 -Number Ball 1 -Number Ball 2 -Number Ball 3 -Metal Gear 1 -Metal Gear 2 -Metal Gear 3 -Panel Shoot 1 -Panel Shoot 2 -Panel Shoot 3 -Aqua Upper 1 -Aqua Upper 2 -Aqua Upper 3 -Green Wood 1 -Green Wood 2 -Green Wood 3 +Vdoll +BigHammer1 +BigHammer2 +BigHammer3 +GrabRevenge +GrabBanish +Geddon1 +Geddon2 +Geddon3 +ElementLeaf +ColorPoint +ElementSand +MokoRush1 +MokoRush2 +MokoRush3 +NorthWind +AntiFire +AntiWater +AntiElectric +AntiWood +AntiNavi +AntiDamage +AntiSword +AntiRecover +CopyDamage +Attack+10 +Navi+20 +RollArrow1 +RollArrow2 +RollArrow3 +GutsPunch1 +GutsPunch2 +GutsPunch3 +PropellerBomb1 +PropellerBomb2 +PropellerBomb3 +SearchBomb1 +SearchBomb2 +SearchBomb3 +Meteors1 +Meteors2 +Meteors3 +Lightning1 +Lightning2 +Lightning3 +HawkCut1 +HawkCut2 +HawkCut3 +NumberBall1 +NumberBall2 +NumberBall3 +MetalGear1 +MetalGear2 +MetalGear3 +PanelShoot1 +PanelShoot2 +PanelShoot3 +AquaUpper1 +AquaUpper2 +AquaUpper3 +GreenWood1 +GreenWood2 +GreenWood3 Muramasa Guardian Anubis -Double Point -Full Custom -Shooting Star -Bug Chain +DoublePoint +FullCustom +ShootingStar +BugChain Jealousy -Element Dark -Black Wing -God Hammer -Dark Line -Neo Variable -Z Saber -Gun del Sol EX -Super Vulcan +ElementDark +BlackWing +GodHammer +DarkLine +NeoVariable +ZSaber +GunDelSolEX +SuperVulcan Roll -Roll SP -Roll DS +RollSP +RollDS GutsMan -GutsMan SP -GutsMan DS +GutsManSP +GutsManDS WindMan -WindMan SP -WindMan DS +WindManSP +WindManDS SearchMan -SearchMan SP -SearchMan DS +SearchManSP +SearchManDS FireMan -FireMan SP -FireMan DS +FireManSP +FireManDS ThunderMan -ThunderMan SP -ThunderMan DS +ThunderManSP +ThunderManDS ProtoMan -ProtoMan SP -ProtoMan DS +ProtoManSP +ProtoManDS NumberMan -NumberMan SP -NumberMan DS +NumberManSP +NumberManDS MetalMan -MetalMan SP -MetalMan DS +MetalManSP +MetalManDS JunkMan -JunkMan SP -JunkMan DS +JunkManSP +JunkManDS AquaMan -AquaMan SP -AquaMan DS +AquaManSP +AquaManDS WoodMan -WoodMan SP -WoodMan DS +WoodManSP +WoodManDS TopMan -TopMan SP -TopMan DS +TopManSP +TopManDS ShadeMan -ShadeMan SP -ShadeMan DS +ShadeManSP +ShadeManDS BurnerMan -BurnerMan SP -BurnerMan DS +BurnerManSP +BurnerManDS ColdMan -ColdMan SP -ColdMan DS +ColdManSP +ColdManDS SparkMan -SparkMan SP -SparkMan DS +SparkManSP +SparkManDS LaserMan -LaserMan SP -LaserMan DS +LaserManSP +LaserManDS KendoMan -KendoMan SP -KendoMan DS +KendoManSP +KendoManDS VideoMan -VideoMan SP -VideoMan DS +VideoManSP +VideoManDS Marking -Cannon Mode -Cannonball Mode -Sword Mode -Fire Plus -Thunder Plus -Aqua Power -Wood Power -Black Weapon -Final Gun +CannonMode +CannonballMode +SwordMode +FirePlus +ThunderPlus +AquaPower +WoodPower +BlackWeapon +FinalGun Bass -Delta Ray -Bug Curse -Red Sun -Bass Another -Holy Dream -Blue Moon -Bug Charge +DeltaRay +BugCurse +RedSun +BassAnother +HolyDream +BlueMoon +BugCharge Wind Fan -Crack Out -Double Crack -Triple Crack -Recovery 10 -Recovery 30 -Recovery 50 -Recovery 80 -Recovery 120 -Recovery 150 -Recovery 200 -Recovery 300 +CrackOut +DoubleCrack +TripleCrack +Recover10 +Recover30 +Recover50 +Recover80 +Recover120 +Recover150 +Recover200 +Recover300 Repair -Panel Grab -Area Grab -Slow Gauge -Fast Gauge -Panel Return +PanelGrab +AreaGrab +SlowGauge +FastGauge +PanelReturn Blinder -Pop Up +PopUp Invisible Barrier -Barrier 100 -Barrier 200 -Holy Panel +Barrier100 +Barrier200 +HolyPanel -Life Aura -Attack +30 -Bug Fix +LifeAura +Attack+30 +BugFix Sanctuary -Signal Red -Black Barrier -MegaMan Navi -Roll Navi -GutsMan Navi -WindMan Navi -SearchMan Navi -FireMan Navi -ThunderMan Navi -ProtoMan Navi -NumberMan Navi -MetalMan Navi -JunkMan Navi -AquaMan Navi -WoodMan Navi -StarMan Navi -IceMan Navi -ShadowMan Navi -ElecMan Navi -KnightMan Navi -PlantMan Navi -NapalmMan Navi -Bass Navi \ No newline at end of file +SignalRed +BlackBarrier +MegaManNavi +RollNavi +GutsManNavi +WindManNavi +SearchManNavi +FireManNavi +ThunderManNavi +ProtoManNavi +NumberManNavi +MetalManNavi +JunkManNavi +AquaManNavi +WoodManNavi +StarManNavi +IceManNavi +ShadowManNavi +ElecManNavi +KnightManNavi +PlantManNavi +NapalmManNavi +BassNavi \ No newline at end of file diff --git a/res/chip-names-5.txt b/res/chip-names-5.txt index 1501aacf9..9dfdb16e0 100644 --- a/res/chip-names-5.txt +++ b/res/chip-names-5.txt @@ -1,293 +1,293 @@ Cannon -Hi Cannon -Mega Cannon -Air Shot -Air Hockey +HiCannon +MegaCannon +AirShot +AirHockey Boomer Silence Tornado -Wide Shot 1 -Wide Shot 2 -Wide Shot 3 -Mark Cannon 1 -Mark Cannon 2 -Mark Cannon 3 -Vulcan 1 -Vulcan 2 -Vulcan 3 +WideShot1 +WideShot2 +WideShot3 +MarkCannon1 +MarkCannon2 +MarkCannon3 +Vulcan1 +Vulcan2 +Vulcan3 Spreader -Thunder Ball -Ice Seed -Pulsar 1 -Pulsar 2 -Pulsar 3 -Space Shake 1 -Space Shake 2 -Space Shake 3 +ThunderBall +IceSeed +Pulsar1 +Pulsar2 +Pulsar3 +SpaceShake1 +SpaceShake2 +SpaceShake3 Static -Life Sync -Mini Boomer -Energy Bomb -Mega Energy Bomb -Gun del Sol 1 -Gun del Sol 2 -Gun del Sol 3 -Quake 1 -Quake 2 -Quake 3 -Crack Bomb -Paralyze Bomb -Reset Bomb -Bug Bomb -Grass Seed -Lava Seed -Cannon Ball +LifeSync +MiniBoomer +EnergyBomb +MegaEnergyBomb +GunDelSol1 +GunDelSol2 +GunDelSol3 +Quake1 +Quake2 +Quake3 +CrackBomb +ParalyzeBomb +ResetBomb +BugBomb +GrassSeed +LavaSeed +CannonBall Geyser -Black Bomb -Sea Seed +BlackBomb +SeaSeed Sword -Wide Sword -Long Sword -Wide Blade -Long Blade -Wind Racket -Custom Sword -Variable Sword +WideSword +LongSword +WideBlade +LongBlade +WindRacket +CustomSword +VariableSword Slasher -Moon Blade 1 -Moon Blade 2 -Moon Blade 3 -Katana 1 -Katana 2 -Katana 3 -Tank Cannon 1 -Tank Cannon 2 -Tank Cannon 3 -Red Fruit 1 -Red Fruit 2 -Red Fruit 3 -Skully 1 -Skully 2 -Skully 3 -Drill Arm 1 -Drill Arm 2 -Drill Arm 3 -Time Bomb 1 -Time Bomb 2 -Time Bomb3 -Voltz 1 -Voltz 2 -Voltz 3 +MoonBlade1 +MoonBlade2 +MoonBlade3 +Katana1 +Katana2 +Katana3 +TankCannon1 +TankCannon2 +TankCannon3 +RedFruit1 +RedFruit2 +RedFruit3 +Skully1 +Skully2 +Skully3 +DrillArm1 +DrillArm2 +DrillArm3 +TimeBomb1 +TimeBomb2 +TimeBomb3 +Voltz1 +Voltz2 +Voltz3 Lance Yo-Yo Wind Fan -Boy's Bomb 1 -Boy's Bomb 2 -Boy's Bomb 3 -Guard 1 -Guard 2 -Guard 3 -Crack Out -Double Crack -Triple Crack +Boy'sBomb1 +Boy'sBomb2 +Boy'sBomb3 +Guard1 +Guard2 +Guard3 +CrackOut +DoubleCrack +TripleCrack Magnum -Grab Gel +GrabGel Snake -Circle Gun +CircleGun Mine -Rock Cube +RockCube Fanfare Discord Timpani -VDoll -Asteroid 1 -Asteroid 2 -Asteroid 3 -Recovery 10 -Recovery 30 -Recovery 50 -Recovery 80 -Recovery 120 -Recovery 150 -Recovery 200 -Recovery 300 -Buster Up -Panel Grab -Area Grab -Grab Revenge -Grab Banish -Slow Gauge -Fast Gauge -Panel Return -Geddon 1 -Geddon 2 -Geddon 3 -Rainy Day -Color Point -Element Rage +Vdoll +Asteroid1 +Asteroid2 +Asteroid3 +Recover10 +Recover30 +Recover50 +Recover80 +Recover120 +Recover150 +Recover200 +Recover300 +BusterUp +PanelGrab +AreaGrab +GrabRevenge +GrabBanish +SlowGauge +FastGauge +PanelReturn +Geddon1 +Geddon2 +Geddon3 +RainyDay +ColorPoint +ElementRage Blinder -Air Spin 1 -Air Spin 2 -Air Spin 3 +AirSpin1 +AirSpin2 +AirSpin3 Invisible -Bubble Wrap +BubbleWrap Barrier -Barrier 100 -Barrier 200 -North Wind -Holy Panel -Anti Fire -Anti Water -Anti Electric -Anti Wood -Anti Navi -Anti Damage -Anti Sword -Anti Recovery -Copy Damage -Attck +10 -Navi +20 -Fire Hit 1 -Fire Hit 2 -Fire Hit 3 -Hot Body 1 -Hot Body 2 -Hot Body 3 -Aqua Whirl 1 -Aqua Whirl 2 -Aqua Whirl 3 -Side Bubble 1 -Side Bubble 2 -Side Bubble 3 -Elec Reel 1 -Elec Reel 2 -Elec Reel 3 -Custom Volt 1 -Custom Volt 2 -Custom Volt 3 -Curse Shield 1 -Curse Shield 2 -Curse Shield 3 -Wave Pit -Red Wave -Mud Wave -Cactus Ball 1 -Cactus Ball 2 -Cactus Ball 3 -Woody Nose 1 -Woody Nose 2 -Woody Nose 3 +Barrier100 +Barrier200 +NorthWind +HolyPanel +AntiFire +AntiWater +AntiElectric +AntiWood +AntiNavi +AntiDamage +AntiSword +AntiRecovery +CopyDamage +Attck+10 +Navi+20 +FireHit1 +FireHit2 +FireHit3 +HotBody1 +HotBody2 +HotBody3 +AquaWhirl1 +AquaWhirl2 +AquaWhirl3 +SideBubble1 +SideBubble2 +SideBubble3 +ElecReel1 +ElecReel2 +ElecReel3 +CustomVolt1 +CustomVolt2 +CustomVolt3 +CurseShield1 +CurseShield2 +CurseShield3 +WavePit +RedWave +MudWave +CactusBall1 +CactusBall2 +CactusBall3 +WoodyNose1 +WoodyNose2 +WoodyNose3 -Dark Circle -Dark Sword -Dark Invis -Dark Plus -Dark Lance -Dark Wide -Dark Thunder -Dark Recovery -Dark Meteor -Dark Drill -Dark Tornado -Dark Sonic +DarkCircle +DarkSword +DarkInvis +DarkPlus +DarkLance +DarkWide +DarkThunder +DarkRecovery +DarkMeteor +DarkDrill +DarkTornado +DarkSonic -Life Aura +LifeAura Muramasa Guardian Anubis -Attack +30 -Bug Fix -Double Point +Attack+30 +BugFix +DoublePoint Sanctuary -Full Custom +FullCustom Meteors -Number Ball +NumberBall Jealousy Poltergeist -Black Wing +BlackWing Otenko -Justice One -Neo Variable -Z Saber -Gun del Sol EX -Super Vulcan +JusticeOne +NeoVariable +ZSaber +GunDelSolEX +SuperVulcan Roll -Roll SP -Roll DS +RollSP +RollDS GyroMan -GyroMan SP -GyroMan DS +GyroManSP +GyroManDS NapalmMan -NapalmMan SP -NapalmMan DS +NapalmManSP +NapalmManDS SearchMan -SearchMan SP -SearchMan DS +SearchManSP +SearchManDS MagnetMan -MagnetMan SP -MagnetMan DS +MagnetManSP +MagnetManDS Meddy -Meddy SP -Meddy DS +MeddySP +MeddyDS ProtoMan -ProtoMan SP -ProtoMan DS +ProtoManSP +ProtoManDS NumberMan -NumberMan SP -NumberMan DS +NumberManSP +NumberManDS Colonel -Colonel SP -Colonel DS +ColonelSP +ColonelDS ShadowMan -ShadowMan SP -ShadowMan DS +ShadowManSP +ShadowManDS TomahawkMan -TomahawkMan SP -TomahawkMan DS +TomahawkManSP +TomahawkManDS KnightMan -KnightMan SP -KnightMan DS +KnightManSP +KnightManDS ToadMan -ToadMan SP -ToadMan DS +ToadManSP +ToadManDS ShadeMan -ShadeMan SP -ShadeMan DS +ShadeManSP +ShadeManDS BlizzardMan -BlizzardMan SP -BlizzardMan DS +BlizzardManSP +BlizzardManDS CloudMan -CloudMan SP -CloudMan DS +CloudManSP +CloudManDS CosmoMan -CosmoMan SP -CosmoMan DS +CosmoManSP +CosmoManDS LarkMan -LarkMan SP -LarkMan DS +LarkManSP +LarkManDS GridMan -GridMan SP -GridMan DS +GridManSP +GridManDS Django -Django SP -Django DS -Cannon Mode -Cannon Ball -Sword Mode -Yo-Yo Mode -Drill Mode -L Curse Shield -L Step Sword -L Counter -Elememt Power -Final Gun +DjangoSP +DjangoDS +CannonMode +CannonBall +SwordMode +Yo-YoMode +DrillMode +LCurseShield +LStepSword +LCounter +ElememtPower +FinalGun @@ -299,17 +299,17 @@ Final Gun Bass -Delta Ray -Bug Curse -Meteor Knuckle -Omega Racket -Bass Another -Holy Dream -Big Hook -Cross Divide -Bug Charge +DeltaRay +BugCurse +MeteorKnuckle +OmegaRacket +BassAnother +HolyDream +BigHook +CrossDivide +BugCharge Phoenix -Death Phoenix +DeathPhoenix @@ -327,25 +327,25 @@ Death Phoenix -MegaMan Navi +MegaManNavi -SearchMan Navi +SearchManNavi -ProtoMan Navi -NumberMan Navi +ProtoManNavi +NumberManNavi -ShadowMan Navi -NapalmMan Navi -KnightMan Navi -ToadMan Navi -MagnetMan Navi -GyroMan Navi -Colonel Navi -Meddy Navi -TomahawkMan Navi \ No newline at end of file +ShadowManNavi +NapalmManNavi +KnightManNavi +ToadManNavi +MagnetManNavi +GyroManNavi +ColonelNavi +MeddyNavi +TomahawkManNavi \ No newline at end of file From e664d04e6a8fe78e3ac3584569eaf98a6c04fb5d Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sun, 17 Feb 2019 11:15:54 -0800 Subject: [PATCH 18/30] CHANGES: Update for Progress/Beast Link gates --- CHANGES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index bac57d7c4..b907e1ebf 100644 --- a/CHANGES +++ b/CHANGES @@ -1,7 +1,7 @@ 0.8.0: (Future) Features: - Improved logging configuration - - One-Player BattleChip Gate support + - One-Player BattleChip/Progress/Beast Link Gate support Bugfixes: - GBA: All IRQs have 7 cycle delay (fixes mgba.io/i/539, mgba.io/i/1208) - GBA: Reset now reloads multiboot ROMs From 7189d7f13a158563246d8277afc64e7c73db6d7d Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sun, 17 Feb 2019 11:39:54 -0800 Subject: [PATCH 19/30] Res: Fix some chip names --- res/chip-names-4.txt | 4 ++-- res/chip-names-5.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/res/chip-names-4.txt b/res/chip-names-4.txt index a7f147f54..c3fc3ea2c 100644 --- a/res/chip-names-4.txt +++ b/res/chip-names-4.txt @@ -87,7 +87,7 @@ Guard1 Guard2 Guard3 Magnum -GrabGel +MetaGel Snake TimeBomb Mine @@ -253,7 +253,7 @@ Bass DeltaRay BugCurse RedSun -BassAnother +BassAnomaly HolyDream BlueMoon BugCharge diff --git a/res/chip-names-5.txt b/res/chip-names-5.txt index 9dfdb16e0..ea970ac94 100644 --- a/res/chip-names-5.txt +++ b/res/chip-names-5.txt @@ -92,7 +92,7 @@ CrackOut DoubleCrack TripleCrack Magnum -GrabGel +MetaGel Snake CircleGun Mine @@ -303,7 +303,7 @@ DeltaRay BugCurse MeteorKnuckle OmegaRacket -BassAnother +BassAnomaly HolyDream BigHook CrossDivide From a0a14f80b76bd86c35f11b171ab89fe5fc503f5d Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sun, 17 Feb 2019 11:40:10 -0800 Subject: [PATCH 20/30] Qt: Add MMZ3 to gate detection --- src/platform/qt/BattleChipView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/qt/BattleChipView.cpp b/src/platform/qt/BattleChipView.cpp index e755e416d..fa12cbbf2 100644 --- a/src/platform/qt/BattleChipView.cpp +++ b/src/platform/qt/BattleChipView.cpp @@ -58,7 +58,7 @@ BattleChipView::BattleChipView(std::shared_ptr controller, QWidg m_controller->attachBattleChipGate(); setFlavor(4); - if (qtitle.startsWith("AGB-B4B") || qtitle.startsWith("AGB-B4W") || qtitle.startsWith("AGB-BR4")) { + if (qtitle.startsWith("AGB-B4B") || qtitle.startsWith("AGB-B4W") || qtitle.startsWith("AGB-BR4") || qtitle.startsWith("AGB-BZ3")) { m_ui.gateBattleChip->setChecked(Qt::Checked); } else if (qtitle.startsWith("AGB-BRB") || qtitle.startsWith("AGB-BRK")) { m_ui.gateProgress->setChecked(Qt::Checked); From 53f98db24635b672300148bfc643b624e6998522 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sun, 17 Feb 2019 13:00:46 -0800 Subject: [PATCH 21/30] Res: Minor BattleChip text fixes --- res/chip-names-4.txt | 6 +++--- res/chip-names-5.txt | 10 +++++----- res/chip-names-6.txt | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/res/chip-names-4.txt b/res/chip-names-4.txt index c3fc3ea2c..93685c9b9 100644 --- a/res/chip-names-4.txt +++ b/res/chip-names-4.txt @@ -26,7 +26,7 @@ ElementFlare ElementIce Static LifeSync -MiniBoomer +MiniBomb EnergyBomb MegaEnergyBomb GunDelSol1 @@ -41,8 +41,8 @@ Binder3 BugBomb ElecShock WoodPowder -Cannonball -Geyser +CannonBall +BlackBomb Geyser SandRing Sword diff --git a/res/chip-names-5.txt b/res/chip-names-5.txt index ea970ac94..cf6880ebb 100644 --- a/res/chip-names-5.txt +++ b/res/chip-names-5.txt @@ -26,7 +26,7 @@ SpaceShake2 SpaceShake3 Static LifeSync -MiniBoomer +MiniBomb EnergyBomb MegaEnergyBomb GunDelSol1 @@ -146,7 +146,7 @@ AntiDamage AntiSword AntiRecovery CopyDamage -Attck+10 +Attack+10 Navi+20 FireHit1 FireHit2 @@ -234,8 +234,8 @@ MagnetMan MagnetManSP MagnetManDS Meddy -MeddySP MeddyDS +MeddySP ProtoMan ProtoManSP ProtoManDS @@ -286,7 +286,7 @@ DrillMode LCurseShield LStepSword LCounter -ElememtPower +ElementPower FinalGun @@ -302,7 +302,7 @@ Bass DeltaRay BugCurse MeteorKnuckle -OmegaRacket +OmegaRocket BassAnomaly HolyDream BigHook diff --git a/res/chip-names-6.txt b/res/chip-names-6.txt index 879ff0e70..be1e9a087 100644 --- a/res/chip-names-6.txt +++ b/res/chip-names-6.txt @@ -80,7 +80,7 @@ BambooSword WindRacket StepSword VariableSword -NeoVariSword +NeoVariable MoonBlade Muramasa MachineSword From 9e1d96ad3b60c316bb385af535708ee1c70411bf Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sun, 17 Feb 2019 14:16:35 -0800 Subject: [PATCH 22/30] GBA Peripherals: Fix Progress Gate --- src/gba/extra/battlechip.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gba/extra/battlechip.c b/src/gba/extra/battlechip.c index 4ba5043d9..cddb77d20 100644 --- a/src/gba/extra/battlechip.c +++ b/src/gba/extra/battlechip.c @@ -159,12 +159,18 @@ void _battlechipTransferEvent(struct mTiming* timing, void* user, uint32_t cycle case 0x537C: case 0x537D: case 0x537E: + case 0x6E8F: case 0xB7D3: case 0xB7D4: case 0xB7D5: case 0xB7D6: case 0xB7D7: case 0xB7D8: + case 0xC4D3: + case 0xC4D4: + case 0xC4D5: + case 0xC4D6: + case 0xC4D7: case 0xC4D8: case 0xC4D9: case 0xC4DA: From eab26d832fdd4b85ed9ab058577a438b2feffc5e Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sun, 17 Feb 2019 14:20:47 -0800 Subject: [PATCH 23/30] Res: Minor BattleChip text fixes --- res/chip-names-4.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/chip-names-4.txt b/res/chip-names-4.txt index 93685c9b9..ea6d26dbc 100644 --- a/res/chip-names-4.txt +++ b/res/chip-names-4.txt @@ -42,8 +42,8 @@ BugBomb ElecShock WoodPowder CannonBall -BlackBomb Geyser +BlackBomb SandRing Sword WideSword From b60bb3b89c4421a68506d94b34bbaa7f751787f8 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sun, 17 Feb 2019 14:32:03 -0800 Subject: [PATCH 24/30] Res: Remove Progress chips that do not exist --- res/chip-names-5.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/res/chip-names-5.txt b/res/chip-names-5.txt index cf6880ebb..677e99d96 100644 --- a/res/chip-names-5.txt +++ b/res/chip-names-5.txt @@ -308,8 +308,8 @@ HolyDream BigHook CrossDivide BugCharge -Phoenix -DeathPhoenix + + From 28ff4f375a5632e6e722a0056a0b800c8515716c Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sun, 17 Feb 2019 15:25:05 -0800 Subject: [PATCH 25/30] GBA Peripherals: Fix Navi Change --- src/gba/extra/battlechip.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gba/extra/battlechip.c b/src/gba/extra/battlechip.c index cddb77d20..729635e42 100644 --- a/src/gba/extra/battlechip.c +++ b/src/gba/extra/battlechip.c @@ -160,6 +160,13 @@ void _battlechipTransferEvent(struct mTiming* timing, void* user, uint32_t cycle case 0x537D: case 0x537E: case 0x6E8F: + case 0x87D0: + case 0x87D1: + case 0x87D2: + case 0x87D3: + case 0x87D4: + case 0x87D5: + case 0x87DB: case 0xB7D3: case 0xB7D4: case 0xB7D5: @@ -184,6 +191,8 @@ void _battlechipTransferEvent(struct mTiming* timing, void* user, uint32_t cycle case 0xD97D: case 0xD97E: case 0xE49A: + case 0xE49B: + case 0xE49C: reply = ok; break; case 0x3545: From b7965523fd9c8c66d785617a2bbf4317616ada6e Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sun, 17 Feb 2019 15:37:48 -0800 Subject: [PATCH 26/30] GBA Peripherals: More BattleChip and Progress IDs --- src/gba/extra/battlechip.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/gba/extra/battlechip.c b/src/gba/extra/battlechip.c index 729635e42..9d8f878fc 100644 --- a/src/gba/extra/battlechip.c +++ b/src/gba/extra/battlechip.c @@ -144,22 +144,27 @@ void _battlechipTransferEvent(struct mTiming* timing, void* user, uint32_t cycle switch (cmd) { case 0x0000: case 0x8FFF: + // EXE 5, 6 case 0xA380: case 0xA390: case 0xA3A0: case 0xA3B0: case 0xA3C0: case 0xA3D0: + // EXE 4 case 0xA6C0: gate->state = -1; // Fall through + // case 0x5379: case 0x537A: case 0x537B: case 0x537C: case 0x537D: case 0x537E: + // case 0x6E8F: + // case 0x87D0: case 0x87D1: case 0x87D2: @@ -173,6 +178,7 @@ void _battlechipTransferEvent(struct mTiming* timing, void* user, uint32_t cycle case 0xB7D6: case 0xB7D7: case 0xB7D8: + // case 0xC4D3: case 0xC4D4: case 0xC4D5: @@ -184,23 +190,33 @@ void _battlechipTransferEvent(struct mTiming* timing, void* user, uint32_t cycle case 0xC4DB: case 0xC4DC: case 0xC4DD: + // EXE 4 case 0xD979: case 0xD97A: case 0xD97B: case 0xD97C: case 0xD97D: case 0xD97E: + case 0xD97F: + case 0xD980: + case 0xD981: + case 0xD982: + case 0xD983: + case 0xD984: + // EXE 5 case 0xE49A: case 0xE49B: case 0xE49C: reply = ok; break; + // case 0x3545: case 0x3546: case 0x3547: case 0x3548: case 0x3549: case 0x354A: + // case 0x424A: case 0x424B: case 0x424C: @@ -208,6 +224,7 @@ void _battlechipTransferEvent(struct mTiming* timing, void* user, uint32_t cycle case 0x424E: case 0x424F: case 0x4250: + // case 0x5745: case 0x5746: case 0x5747: From 01a96c6313216f9111cc8670f45c30d588c8f97d Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sun, 17 Feb 2019 22:13:40 -0800 Subject: [PATCH 27/30] GBA SIO: Prevent writing read-only multiplayer bits --- CHANGES | 1 + src/gba/sio.c | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index b907e1ebf..0495acfbe 100644 --- a/CHANGES +++ b/CHANGES @@ -13,6 +13,7 @@ Bugfixes: - GB Serialize: Fix loading states with negative pixel x (fixes mgba.io/i/1293) - Qt: Fix audio context holding onto closed game controller - Switch: Fix gyroscope orientation (fixes mgba.io/i/1300) + - GBA SIO: Prevent writing read-only multiplayer bits Misc: - GBA Savedata: EEPROM performance fixes - GBA Savedata: Automatically map 1Mbit Flash files as 1Mbit Flash diff --git a/src/gba/sio.c b/src/gba/sio.c index d620be5a7..800af8aea 100644 --- a/src/gba/sio.c +++ b/src/gba/sio.c @@ -164,6 +164,7 @@ void GBASIOWriteSIOCNT(struct GBASIO* sio, uint16_t value) { } break; case SIO_MULTI: + value &= 0xFF83; value |= 0xC; break; default: From 76fa9afc9c958381bcd8df143ce55b3339e8032a Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Mon, 18 Feb 2019 13:32:13 -0800 Subject: [PATCH 28/30] Qt: Fix color picking in sprite view (fixes #1307) --- CHANGES | 1 + src/platform/qt/AssetTile.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 0495acfbe..dfbc73d9b 100644 --- a/CHANGES +++ b/CHANGES @@ -14,6 +14,7 @@ Bugfixes: - Qt: Fix audio context holding onto closed game controller - Switch: Fix gyroscope orientation (fixes mgba.io/i/1300) - GBA SIO: Prevent writing read-only multiplayer bits + - Qt: Fix color picking in sprite view (fixes mgba.io/i/1307) Misc: - GBA Savedata: EEPROM performance fixes - GBA Savedata: Automatically map 1Mbit Flash files as 1Mbit Flash diff --git a/src/platform/qt/AssetTile.cpp b/src/platform/qt/AssetTile.cpp index 9bdb57150..ad16d47a3 100644 --- a/src/platform/qt/AssetTile.cpp +++ b/src/platform/qt/AssetTile.cpp @@ -137,7 +137,7 @@ void AssetTile::selectColor(int index) { mTileCache* tileCache = m_tileCaches[m_index >= m_boundary]; unsigned bpp = 8 << tileCache->bpp; int paletteId = m_paletteId; - data = mTileCacheGetTile(tileCache, m_index, m_paletteId); + data = mTileCacheGetTile(tileCache, m_index >= m_boundary ? m_index - m_boundary : m_index, m_paletteId); color_t color = data[index]; m_ui.color->setColor(0, color); m_ui.color->update(); From 80c46c5fd863be3c81c777d987560ad59f3248cc Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Mon, 18 Feb 2019 20:51:29 -0800 Subject: [PATCH 29/30] GBA Peripherals: Fix CrossBeast in EXE6 --- src/gba/extra/battlechip.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gba/extra/battlechip.c b/src/gba/extra/battlechip.c index 9d8f878fc..6d464f7b0 100644 --- a/src/gba/extra/battlechip.c +++ b/src/gba/extra/battlechip.c @@ -162,6 +162,8 @@ void _battlechipTransferEvent(struct mTiming* timing, void* user, uint32_t cycle case 0x537C: case 0x537D: case 0x537E: + // EXE 6 + case 0x65AF: // case 0x6E8F: // From f00b7fcf55167fdf243da731b4fe30ab0b56ffc8 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Mon, 18 Feb 2019 21:52:40 -0800 Subject: [PATCH 30/30] GBA Periperals: Improve chip gate resync, remove switch table --- src/gba/extra/battlechip.c | 124 +++++++------------------------------ 1 file changed, 21 insertions(+), 103 deletions(-) diff --git a/src/gba/extra/battlechip.c b/src/gba/extra/battlechip.c index 6d464f7b0..94d591efa 100644 --- a/src/gba/extra/battlechip.c +++ b/src/gba/extra/battlechip.c @@ -13,6 +13,7 @@ mLOG_DECLARE_CATEGORY(GBA_BATTLECHIP); mLOG_DEFINE_CATEGORY(GBA_BATTLECHIP, "GBA BattleChip Gate", "gba.battlechip"); enum { + BATTLECHIP_STATE_SYNC = -1, BATTLECHIP_STATE_COMMAND = 0, BATTLECHIP_STATE_UNK_0 = 1, BATTLECHIP_STATE_UNK_1 = 2, @@ -32,7 +33,6 @@ enum { BATTLECHIP_CONTINUE = 0xFFFF, }; -static bool GBASIOBattlechipGateInit(struct GBASIODriver* driver); static bool GBASIOBattlechipGateLoad(struct GBASIODriver* driver); static uint16_t GBASIOBattlechipGateWriteRegister(struct GBASIODriver* driver, uint32_t address, uint16_t value); @@ -40,7 +40,7 @@ static void _battlechipTransfer(struct GBASIOBattlechipGate* gate); static void _battlechipTransferEvent(struct mTiming* timing, void* user, uint32_t cyclesLate); void GBASIOBattlechipGateCreate(struct GBASIOBattlechipGate* gate) { - gate->d.init = GBASIOBattlechipGateInit; + gate->d.init = NULL; gate->d.deinit = NULL; gate->d.load = GBASIOBattlechipGateLoad; gate->d.unload = NULL; @@ -54,14 +54,9 @@ void GBASIOBattlechipGateCreate(struct GBASIOBattlechipGate* gate) { gate->flavor = GBA_FLAVOR_BATTLECHIP_GATE; } -bool GBASIOBattlechipGateInit(struct GBASIODriver* driver) { - struct GBASIOBattlechipGate* gate = (struct GBASIOBattlechipGate*) driver; - return true; -} - bool GBASIOBattlechipGateLoad(struct GBASIODriver* driver) { struct GBASIOBattlechipGate* gate = (struct GBASIOBattlechipGate*) driver; - gate->state = BATTLECHIP_STATE_COMMAND; + gate->state = BATTLECHIP_STATE_SYNC; gate->data[0] = 0x00FE; gate->data[1] = 0xFFFE; return true; @@ -119,7 +114,7 @@ void _battlechipTransferEvent(struct mTiming* timing, void* user, uint32_t cycle gate->d.p->multiplayerControl.busy = 0; gate->d.p->multiplayerControl.id = 0; - mLOG(GBA_BATTLECHIP, DEBUG, "> %04X", cmd); + mLOG(GBA_BATTLECHIP, DEBUG, "Game: %04X (%i)", cmd, gate->state); uint16_t ok; switch (gate->flavor) { @@ -138,12 +133,9 @@ void _battlechipTransferEvent(struct mTiming* timing, void* user, uint32_t cycle break; } - switch (gate->state) { - case BATTLECHIP_STATE_COMMAND: - mLOG(GBA_BATTLECHIP, DEBUG, "C %04X", cmd); + if (gate->state != BATTLECHIP_STATE_COMMAND) { + // Resync if needed switch (cmd) { - case 0x0000: - case 0x8FFF: // EXE 5, 6 case 0xA380: case 0xA390: @@ -153,94 +145,20 @@ void _battlechipTransferEvent(struct mTiming* timing, void* user, uint32_t cycle case 0xA3D0: // EXE 4 case 0xA6C0: - gate->state = -1; - // Fall through - // - case 0x5379: - case 0x537A: - case 0x537B: - case 0x537C: - case 0x537D: - case 0x537E: - // EXE 6 - case 0x65AF: - // - case 0x6E8F: - // - case 0x87D0: - case 0x87D1: - case 0x87D2: - case 0x87D3: - case 0x87D4: - case 0x87D5: - case 0x87DB: - case 0xB7D3: - case 0xB7D4: - case 0xB7D5: - case 0xB7D6: - case 0xB7D7: - case 0xB7D8: - // - case 0xC4D3: - case 0xC4D4: - case 0xC4D5: - case 0xC4D6: - case 0xC4D7: - case 0xC4D8: - case 0xC4D9: - case 0xC4DA: - case 0xC4DB: - case 0xC4DC: - case 0xC4DD: - // EXE 4 - case 0xD979: - case 0xD97A: - case 0xD97B: - case 0xD97C: - case 0xD97D: - case 0xD97E: - case 0xD97F: - case 0xD980: - case 0xD981: - case 0xD982: - case 0xD983: - case 0xD984: - // EXE 5 - case 0xE49A: - case 0xE49B: - case 0xE49C: - reply = ok; - break; - // - case 0x3545: - case 0x3546: - case 0x3547: - case 0x3548: - case 0x3549: - case 0x354A: - // - case 0x424A: - case 0x424B: - case 0x424C: - case 0x424D: - case 0x424E: - case 0x424F: - case 0x4250: - // - case 0x5745: - case 0x5746: - case 0x5747: - case 0x5748: - case 0x5749: - case 0x574A: - // Resync - gate->state = BATTLECHIP_STATE_UNK_0; - break; - default: - mLOG(GBA_BATTLECHIP, STUB, "? %04X", cmd); - gate->state = -1; + mLOG(GBA_BATTLECHIP, DEBUG, "Resync detected"); + gate->state = BATTLECHIP_STATE_SYNC; break; } + } + + switch (gate->state) { + case BATTLECHIP_STATE_SYNC: + if (cmd != 0x8FFF) { + --gate->state; + } + // Fall through + case BATTLECHIP_STATE_COMMAND: + reply = ok; break; case BATTLECHIP_STATE_UNK_0: case BATTLECHIP_STATE_UNK_1: @@ -265,12 +183,12 @@ void _battlechipTransferEvent(struct mTiming* timing, void* user, uint32_t cycle break; case BATTLECHIP_STATE_END: reply = ok; - gate->state = -1; + gate->state = BATTLECHIP_STATE_SYNC; break; } - ++gate->state; - mLOG(GBA_BATTLECHIP, DEBUG, "< %04X", reply); + mLOG(GBA_BATTLECHIP, DEBUG, "Gate: %04X (%i)", reply, gate->state); + ++gate->state; gate->d.p->p->memory.io[REG_SIOMULTI1 >> 1] = reply;