From 147db107322c203bd9fda8bf3a6afe063dc09e00 Mon Sep 17 00:00:00 2001 From: Thomas Jentzsch Date: Sat, 11 Dec 2021 23:31:10 +0100 Subject: [PATCH] Revert "k" This reverts commit 82c79fea4b9044aca61ae8b399c2cecf9b9c567a. --- docs/index.html | 19 +--------- src/emucore/CartBUS.cxx | 12 +++--- src/emucore/CartCDF.cxx | 16 ++++---- src/emucore/CartDPCPlus.cxx | 6 +-- src/emucore/Thumbulator.cxx | 73 +++++++++++++++++-------------------- src/emucore/Thumbulator.hxx | 13 ------- src/gui/FileListWidget.cxx | 35 +++++++----------- src/gui/FileListWidget.hxx | 10 +---- src/gui/LauncherDialog.cxx | 40 ++++++++++++-------- src/gui/LauncherDialog.hxx | 5 +++ 10 files changed, 96 insertions(+), 133 deletions(-) diff --git a/docs/index.html b/docs/index.html index c9d7a2553..a13b137d8 100644 --- a/docs/index.html +++ b/docs/index.html @@ -2267,23 +2267,8 @@ Go to parent directory (also in other file dialogs) - Backspace, Alt + Up arrow - Backspace, Alt + Up arrow - - - Go to home directory - Alt + Home - Alt + Home - - - Go to previous directory in history - Alt + Left arrow - Alt + Left arrow - - - Go to next directory in history - Alt + Right arrow - Alt + Right arrow + Backspace + Backspace Remove from 'Recently Played' or 'Most Popular' folder diff --git a/src/emucore/CartBUS.cxx b/src/emucore/CartBUS.cxx index 69eae0b0d..d181c7742 100644 --- a/src/emucore/CartBUS.cxx +++ b/src/emucore/CartBUS.cxx @@ -67,9 +67,9 @@ CartridgeBUS::CartridgeBUS(const ByteBuffer& image, size_t size, reinterpret_cast(myImage.get()), reinterpret_cast(myRAM.data()), static_cast(32_KB), - Thumbulator::rom_base + 0x0800, - Thumbulator::rom_base + 0x0808, - Thumbulator::ram_base + 0x1FDC, + 0x00000800, + 0x00000808, + 0x40001FDC, devSettings ? settings.getBool("dev.thumb.trapfatal") : false, devSettings ? static_cast( settings.getFloat("dev.thumb.cyclefactor")) : 1.0, @@ -256,8 +256,8 @@ uInt8 CartridgeBUS::peek(uInt16 address) // get sample value from ROM or RAM if (sampleaddress < 0x8000) peekvalue = myImage[sampleaddress]; - else if (sampleaddress >= Thumbulator::ram_base && sampleaddress < Thumbulator::ram_base + 0x2000) // check for RAM - peekvalue = myRAM[sampleaddress - Thumbulator::ram_base]; + else if (sampleaddress >= 0x40000000 && sampleaddress < 0x40002000) // check for RAM + peekvalue = myRAM[sampleaddress - 0x40000000]; else peekvalue = 0; @@ -707,7 +707,7 @@ uInt32 CartridgeBUS::getWaveform(uInt8 index) const (myRAM[WAVEFORM + index*4 + 2] << 16) + (myRAM[WAVEFORM + index*4 + 3] << 24); // high byte - result -= Thumbulator::ram_base + 0x0800; + result -= 0x40000800; if (result >= 4096) result = 0; diff --git a/src/emucore/CartCDF.cxx b/src/emucore/CartCDF.cxx index 6d9d4b1b1..547e83a50 100644 --- a/src/emucore/CartCDF.cxx +++ b/src/emucore/CartCDF.cxx @@ -90,13 +90,13 @@ CartridgeCDF::CartridgeCDF(const ByteBuffer& image, size_t size, // C addresses uInt32 cBase, cStart, cStack; if (isCDFJplus()) { - cBase = Thumbulator::rom_base + getUInt32(myImage.get(), 0x17F8) & 0x0FFFFFFE; // C Base Address + cBase = getUInt32(myImage.get(), 0x17F8) & 0xFFFFFFFE; // C Base Address cStart = cBase; // C Start Address - cStack = Thumbulator::ram_base + (getUInt32(myImage.get(), 0x17F4) & 0x0FFFFFFF); // C Stack + cStack = getUInt32(myImage.get(), 0x17F4); // C Stack } else { - cBase = Thumbulator::rom_base + 0x800; // C Base Address - cStart = Thumbulator::rom_base + 0x808; // C Start Address (skip ARM header) - cStack = Thumbulator::ram_base + 0x1FDC; // C Stack + cBase = 0x800; // C Base Address + cStart = 0x808; // C Start Address (skip ARM header) + cStack = 0x40001FDC; // C Stack } // Create Thumbulator ARM emulator @@ -296,8 +296,8 @@ uInt8 CartridgeCDF::peek(uInt16 address) // get sample value from ROM or RAM if (sampleaddress < 0x00080000) peekvalue = myImage[sampleaddress]; - else if (sampleaddress >= Thumbulator::ram_base && sampleaddress < Thumbulator::ram_base + 0x8000) // check for RAM - peekvalue = myRAM[sampleaddress - Thumbulator::ram_base]; + else if (sampleaddress >= 0x40000000 && sampleaddress < 0x40008000) // check for RAM + peekvalue = myRAM[sampleaddress - 0x40000000]; else peekvalue = 0; @@ -677,7 +677,7 @@ uInt32 CartridgeCDF::getWaveform(uInt8 index) const (myRAM[address + 2] << 16) + (myRAM[address + 3] << 24); // high byte - result -= (Thumbulator::ram_base + uInt32(2_KB)); + result -= (0x40000000 + uInt32(2_KB)); if (!isCDFJplus()) { if (result >= 4096) { diff --git a/src/emucore/CartDPCPlus.cxx b/src/emucore/CartDPCPlus.cxx index 97586aa65..8d9b99b72 100644 --- a/src/emucore/CartDPCPlus.cxx +++ b/src/emucore/CartDPCPlus.cxx @@ -53,9 +53,9 @@ CartridgeDPCPlus::CartridgeDPCPlus(const ByteBuffer& image, size_t size, (reinterpret_cast(myImage.get()), reinterpret_cast(myDPCRAM.data()), static_cast(32_KB), - Thumbulator::rom_base + 0x0C00, - Thumbulator::rom_base + 0x0C08, - Thumbulator::ram_base + 0x1FDC, + 0x00000C00, + 0x00000C08, + 0x40001FDC, devSettings ? settings.getBool("dev.thumb.trapfatal") : false, devSettings ? static_cast( settings.getFloat("dev.thumb.cyclefactor")) : 1.0, diff --git a/src/emucore/Thumbulator.cxx b/src/emucore/Thumbulator.cxx index 96ac7dd5e..d32881fa7 100644 --- a/src/emucore/Thumbulator.cxx +++ b/src/emucore/Thumbulator.cxx @@ -123,8 +123,6 @@ using Common::Base; #define INC_ARM_CYCLES(m) #endif -//#define UNSAFE_OPTIMIZATIONS - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Thumbulator::Thumbulator(const uInt16* rom_ptr, uInt16* ram_ptr, uInt32 rom_size, const uInt32 c_base, const uInt32 c_start, const uInt32 c_stack, @@ -327,7 +325,7 @@ uInt32 Thumbulator::fetch16(uInt32 addr) switch(addr & 0xF0000000) { - case rom_base: //ROM + case 0x00000000: //ROM addr &= ROMADDMASK; if(addr < 0x50) fatalError("fetch16", addr, "abort"); @@ -336,7 +334,7 @@ uInt32 Thumbulator::fetch16(uInt32 addr) DO_DBUG(statusMsg << "fetch16(" << Base::HEX8 << addr << ")=" << Base::HEX4 << data << endl); return data; - case ram_base: //RAM + case 0x40000000: //RAM addr &= RAMADDMASK; addr >>= 1; data = CONV_RAMROM(ram[addr]); @@ -355,7 +353,7 @@ uInt32 Thumbulator::fetch16(uInt32 addr) void Thumbulator::write16(uInt32 addr, uInt32 data) { #ifndef UNSAFE_OPTIMIZATIONS - if((addr > Thumbulator::ram_base + 0x7fff) && (addr < Thumbulator::ram_base + 0x10000000)) + if((addr > 0x40007fff) && (addr < 0x50000000)) fatalError("write16", addr, "abort - out of range"); if (isProtected(addr)) fatalError("write16", addr, "to driver area"); @@ -371,7 +369,7 @@ void Thumbulator::write16(uInt32 addr, uInt32 data) switch(addr & 0xF0000000) { - case ram_base: //RAM + case 0x40000000: //RAM addr &= RAMADDMASK; addr >>= 1; ram[addr] = CONV_DATA(data); @@ -533,7 +531,7 @@ void Thumbulator::write32(uInt32 addr, uInt32 data) return; #ifndef UNSAFE_OPTIMIZATIONS - case ram_base: //RAM + case 0x40000000: //RAM #else default: #endif @@ -550,8 +548,8 @@ void Thumbulator::write32(uInt32 addr, uInt32 data) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool Thumbulator::isProtected(uInt32 addr) { - if (addr < ram_base) return false; - addr -= ram_base; + if (addr < 0x40000000) return false; + addr -= 0x40000000; switch (configuration) { case ConfigureFor::DPCplus: @@ -580,9 +578,9 @@ uInt32 Thumbulator::read16(uInt32 addr) { uInt32 data; #ifndef UNSAFE_OPTIMIZATIONS - if((addr > Thumbulator::ram_base + 0x7fff) && (addr < Thumbulator::ram_base + 0x10000000)) + if((addr > 0x40007fff) && (addr < 0x50000000)) fatalError("read16", addr, "abort - out of range"); - else if((addr > Thumbulator::rom_base + 0x0007ffff) && (addr < Thumbulator::rom_base + 0x10000000)) + else if((addr > 0x0007ffff) && (addr < 0x10000000)) fatalError("read16", addr, "abort - out of range"); if(addr & 1) fatalError("read16", addr, "abort - misaligned"); @@ -593,16 +591,14 @@ uInt32 Thumbulator::read16(uInt32 addr) switch(addr & 0xF0000000) { - //case 0x00000000: //ROM - case rom_base: //ROM + case 0x00000000: //ROM addr &= ROMADDMASK; addr >>= 1; data = CONV_RAMROM(rom[addr]); DO_DBUG(statusMsg << "read16(" << Base::HEX8 << addr << ")=" << Base::HEX4 << data << endl); return data; - //case 0x40000000: //RAM - case ram_base: //RAM + case 0x40000000: //RAM addr &= RAMADDMASK; addr >>= 1; data = CONV_RAMROM(ram[addr]); @@ -637,10 +633,8 @@ uInt32 Thumbulator::read32(uInt32 addr) uInt32 data; switch(addr & 0xF0000000) { - case rom_base: //ROM - //case 0x00000000: //ROM - case ram_base: //RAM - //case 0x40000000: //RAM + case 0x00000000: //ROM + case 0x40000000: //RAM data = read16(addr+0); data |= (uInt32(read16(addr+2))) << 16; DO_DBUG(statusMsg << "read32(" << Base::HEX8 << addr << ")=" << Base::HEX8 << data << endl); @@ -1067,9 +1061,8 @@ int Thumbulator::execute() Op decodedOp; #ifndef UNSAFE_OPTIMIZATIONS - if ((instructionPtr & 0xF0000000) == rom_base - && instructionPtr >= rom_base && instructionPtr < rom_base + romSize) - decodedOp = decodedRom[(instructionPtr - rom_base) >> 1]; + if ((instructionPtr & 0xF0000000) == 0 && instructionPtr < romSize) + decodedOp = decodedRom[instructionPtr >> 1]; else decodedOp = decodeInstructionWord(inst); #else @@ -1572,10 +1565,10 @@ int Thumbulator::execute() // address to test for is + 4 due to pipelining - #define BUS_SetNote (rom_base + 0x06da + 4) - #define BUS_ResetWave (rom_base + 0x06de + 4) - #define BUS_GetWavePtr (rom_base + 0x06e2 + 4) - #define BUS_SetWaveSize (rom_base + 0x06e6 + 4) + #define BUS_SetNote (0x000006da + 4) + #define BUS_ResetWave (0x000006de + 4) + #define BUS_GetWavePtr (0x000006e2 + 4) + #define BUS_SetWaveSize (0x000006e6 + 4) if (pc == BUS_SetNote) { @@ -1597,7 +1590,7 @@ int Thumbulator::execute() myCartridge->thumbCallback(3, read_register(2), read_register(3)); handled = true; } - else if (pc == Thumbulator::rom_base + 0x083a) + else if (pc == 0x0000083a) { // exiting Custom ARM code, returning to BUS Driver control } @@ -1633,10 +1626,10 @@ int Thumbulator::execute() // address to test for is + 4 due to pipelining - #define CDF_SetNote (rom_base + 0x06e2 + 4) - #define CDF_ResetWave (rom_base + 0x06e6 + 4) - #define CDF_GetWavePtr (rom_base + 0x06ea + 4) - #define CDF_SetWaveSize (rom_base + 0x06ee + 4) + #define CDF_SetNote (0x000006e2 + 4) + #define CDF_ResetWave (0x000006e6 + 4) + #define CDF_GetWavePtr (0x000006ea + 4) + #define CDF_SetWaveSize (0x000006ee + 4) if (pc == CDF_SetNote) { @@ -1658,7 +1651,7 @@ int Thumbulator::execute() myCartridge->thumbCallback(3, read_register(2), read_register(3)); handled = true; } - else if (pc == Thumbulator::rom_base + 0x083a) + else if (pc == 0x0000083a) { // exiting Custom ARM code, returning to CDF Driver control } @@ -1696,10 +1689,10 @@ int Thumbulator::execute() // address to test for is + 4 due to pipelining - #define CDF1_SetNote (rom_base + 0x0752 + 4) - #define CDF1_ResetWave (rom_base + 0x0756 + 4) - #define CDF1_GetWavePtr (rom_base + 0x075a + 4) - #define CDF1_SetWaveSize (rom_base + 0x075e + 4) + #define CDF1_SetNote (0x00000752 + 4) + #define CDF1_ResetWave (0x00000756 + 4) + #define CDF1_GetWavePtr (0x0000075a + 4) + #define CDF1_SetWaveSize (0x0000075e + 4) if (pc == CDF1_SetNote) { @@ -1737,7 +1730,7 @@ int Thumbulator::execute() INC_ARM_CYCLES(2 + _flashCycles + 2); // ARM code ReturnC handled = true; } - else if (pc == Thumbulator::rom_base + 0x083a) + else if (pc == 0x0000083a) { // exiting Custom ARM code, returning to CDFJ Driver control } @@ -2905,9 +2898,9 @@ int Thumbulator::reset() cpsr = 0; handler_mode = false; - systick_ctrl = rom_base + 0x0004; // TODO: not 100% sure about rom_base here - systick_reload = rom_base; - systick_count = rom_base; + systick_ctrl = 0x00000004; + systick_reload = 0x00000000; + systick_count = 0x00000000; systick_calibrate = 0x00ABCDEF; // fxq: don't care about below so much (maybe to guess timing???) diff --git a/src/emucore/Thumbulator.hxx b/src/emucore/Thumbulator.hxx index 09336ec1c..cf60670a0 100644 --- a/src/emucore/Thumbulator.hxx +++ b/src/emucore/Thumbulator.hxx @@ -34,10 +34,6 @@ class Cartridge; #define UNSAFE_OPTIMIZATIONS #endif -// Note: This is still experimental, no guarantees! -// TODO: make selectable from command line -#define STM32F4 // compile for UnoCart/PlusCart using STM32F407xxx CPU - #define ROMADDMASK 0x7FFFF #define RAMADDMASK 0x7FFF @@ -99,15 +95,6 @@ class Thumbulator uInt32 mamDataHits{0}, mamDataMisses{0}; #endif }; -#ifndef STM32F4 - // Harmony/Encore base adresses - static constexpr uInt32 ram_base = 0x40000000; - static constexpr uInt32 rom_base = 0x00000000; -#else - // UnoCart/PlusCart base adresses (TODO!) - static constexpr uInt32 ram_base = 0x10000000; - static constexpr uInt32 rom_base = 0x20000000; -#endif Thumbulator(const uInt16* rom_ptr, uInt16* ram_ptr, uInt32 rom_size, const uInt32 c_base, const uInt32 c_start, const uInt32 c_stack, diff --git a/src/gui/FileListWidget.cxx b/src/gui/FileListWidget.cxx index efe911870..954276580 100644 --- a/src/gui/FileListWidget.cxx +++ b/src/gui/FileListWidget.cxx @@ -58,9 +58,14 @@ void FileListWidget::setDirectory(const FilesystemNode& node, _history.clear(); while(tmp.hasParent()) { - _history.push_back(HistoryType(tmp, fixPath(name))); + if(name.back() == FilesystemNode::PATH_SEPARATOR) + name.pop_back(); + _history.push_back(HistoryType(tmp, name)); name = tmp.getName(); + if(name.back() == FilesystemNode::PATH_SEPARATOR) + name.pop_back(); + tmp = tmp.getParent(); } // History is in reverse order; we need to fix that @@ -186,19 +191,14 @@ void FileListWidget::selectParent() string name = _node.getName(); FilesystemNode parent(_node.getParent()); + if(name.back() == FilesystemNode::PATH_SEPARATOR) + name.pop_back(); _currentHistory->selected = selected().getName(); addHistory(parent); - setLocation(parent, fixPath(name)); + setLocation(parent, name); } } -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void FileListWidget::selectHomeDir() -{ - while(hasPrevHistory()) - selectPrevHistory(); -} - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void FileListWidget::selectPrevHistory() { @@ -233,17 +233,6 @@ bool FileListWidget::hasNextHistory() return _currentHistory != std::prev(_history.end(), 1); } -string& FileListWidget::fixPath(string& path) -{ - if(path.back() == FilesystemNode::PATH_SEPARATOR) - { - path.pop_back(); - if(path.length() == 2 && path.back() == ':') - path.pop_back(); - } - return path; -} - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void FileListWidget::addHistory(const FilesystemNode& node) { @@ -252,9 +241,11 @@ void FileListWidget::addHistory(const FilesystemNode& node) _history.pop_back(); string select = selected().getName(); - _currentHistory->selected = fixPath(select); + if(select.back() == FilesystemNode::PATH_SEPARATOR) + select.pop_back(); + _currentHistory->selected = select; - _history.push_back(HistoryType(node, "..")); + _history.push_back(HistoryType(node, select)); _currentHistory = std::prev(_history.end(), 1); //_historyIndex++; } diff --git a/src/gui/FileListWidget.hxx b/src/gui/FileListWidget.hxx index f5047253a..2c27507c7 100644 --- a/src/gui/FileListWidget.hxx +++ b/src/gui/FileListWidget.hxx @@ -45,10 +45,7 @@ class FileListWidget : public StringListWidget public: enum { ItemChanged = 'FLic', // Entry in the list is changed (single-click, etc) - ItemActivated = 'FLac', // Entry in the list is activated (double-click, etc) - kHomeDirCmd = 'homc', // go to Home directory - kPrevDirCmd = 'prvc', // go back in history to previous directory - kNextDirCmd = 'nxtc' // go back in history to next directory + ItemActivated = 'FLac' // Entry in the list is activated (double-click, etc) }; using IconTypeFilter = std::function; @@ -86,11 +83,9 @@ class FileListWidget : public StringListWidget virtual void selectDirectory(); /** Select parent directory (if applicable) */ void selectParent(); - /** Select to home directory */ - void selectHomeDir(); /** Select previous directory in history (if applicable) */ void selectPrevHistory(); - /** Select next directory in history (if applicable) */ + /** Select next directory in history */ void selectNextHistory(); /** Check if the there is a previous directory in history */ bool hasPrevHistory(); @@ -152,7 +147,6 @@ class FileListWidget : public StringListWidget virtual const Icon* getIcon(int i) const; int iconWidth() const; virtual bool fullPathToolTip() const { return false; } - string& fixPath(string& path); void addHistory(const FilesystemNode& node); protected: diff --git a/src/gui/LauncherDialog.cxx b/src/gui/LauncherDialog.cxx index ed8da8231..3425a548e 100644 --- a/src/gui/LauncherDialog.cxx +++ b/src/gui/LauncherDialog.cxx @@ -228,25 +228,25 @@ void LauncherDialog::addPathWidgets(int& ypos, WidgetArray& wid) const GUI::Icon& upIcon = smallIcon ? GUI::icon_up_small : GUI::icon_up_large; myHomeButton = new ButtonWidget(this, _font, xpos, ypos, - iconWidth + iconGap - 1, lineHeight + 2, homeIcon, FileListWidget::kHomeDirCmd); + iconWidth + iconGap - 1, lineHeight + 2, homeIcon, kHomeDirCmd); myHomeButton->setToolTip("Go back to Stella's ROM directory."); wid.push_back(myHomeButton); xpos = myHomeButton->getRight() + BTN_GAP; myPrevButton = new ButtonWidget(this, _font, xpos, ypos, - iconWidth + iconGap - 1, lineHeight + 2, prevIcon, FileListWidget::kPrevDirCmd); + iconWidth + iconGap - 1, lineHeight + 2, prevIcon, kPrevDirCmd); myPrevButton->setToolTip("Go back in directory history."); wid.push_back(myPrevButton); xpos = myPrevButton->getRight() + BTN_GAP; myNextButton = new ButtonWidget(this, _font, xpos, ypos, - iconWidth + iconGap - 1, lineHeight + 2, nextIcon, FileListWidget::kNextDirCmd); + iconWidth + iconGap - 1, lineHeight + 2, nextIcon, kNextDirCmd); myNextButton->setToolTip("Go forward in directory history."); wid.push_back(myNextButton); xpos = myNextButton->getRight() + BTN_GAP; myUpButton = new ButtonWidget(this, _font, xpos, ypos, - iconWidth + iconGap - 1, lineHeight + 2, upIcon, ListWidget::kParentDirCmd); + iconWidth + iconGap - 1, lineHeight + 2, upIcon, kParentDirCmd); myUpButton->setToolTip("Go Up"); wid.push_back(myUpButton); xpos = myUpButton->getRight() + BTN_GAP; @@ -358,7 +358,7 @@ void LauncherDialog::addButtonWidgets(int& ypos, WidgetArray& wid) xpos += (buttonWidth + 0) / 4 + BUTTON_GAP; myGoUpButton = new ButtonWidget(this, _font, xpos, ypos, (buttonWidth + 1) / 4, buttonHeight, - "Go Up", ListWidget::kParentDirCmd); + "Go Up", kParentDirCmd); wid.push_back(myGoUpButton); xpos += (buttonWidth + 1) / 4 + BUTTON_GAP; @@ -382,7 +382,7 @@ void LauncherDialog::addButtonWidgets(int& ypos, WidgetArray& wid) xpos += (buttonWidth + 1) / 4 + BUTTON_GAP; myGoUpButton = new ButtonWidget(this, _font, xpos, ypos, (buttonWidth + 2) / 4, buttonHeight, - "Go Up", ListWidget::kParentDirCmd); + "Go Up", kParentDirCmd); wid.push_back(myGoUpButton); xpos += (buttonWidth + 2) / 4 + BUTTON_GAP; @@ -774,7 +774,7 @@ void LauncherDialog::handleContextMenu() else if(cmd == "subdirs") sendCommand(kSubDirsCmd, 0, 0); else if(cmd == "homedir") - sendCommand(FileListWidget::kHomeDirCmd, 0, 0); + sendCommand(kHomeDirCmd, 0, 0); else if(cmd == "highscores") openHighScores(); else if(cmd == "reload") @@ -818,19 +818,19 @@ void LauncherDialog::handleKeyDown(StellaKey key, StellaMod mod, bool repeated) switch(key) { case KBDK_HOME: - sendCommand(FileListWidget::kHomeDirCmd, 0, 0); + sendCommand(kHomeDirCmd, 0, 0); break; case KBDK_LEFT: - sendCommand(FileListWidget::kPrevDirCmd, 0, 0); + sendCommand(kPrevDirCmd, 0, 0); break; case KBDK_RIGHT: - sendCommand(FileListWidget::kNextDirCmd, 0, 0); + sendCommand(kNextDirCmd, 0, 0); break; case KBDK_UP: - sendCommand(ListWidget::kParentDirCmd, 0, 0); + sendCommand(kParentDirCmd, 0, 0); break; case KBDK_DOWN: @@ -1007,22 +1007,23 @@ void LauncherDialog::handleCommand(CommandSender* sender, int cmd, toggleSubDirs(); break; - case FileListWidget::kHomeDirCmd: - myList->selectHomeDir(); + case kHomeDirCmd: + gotoHomeDir(); break; - case FileListWidget::kPrevDirCmd: + case kPrevDirCmd: myList->selectPrevHistory(); break; - case FileListWidget::kNextDirCmd: + case kNextDirCmd: myList->selectNextHistory(); break; - case ListWidget::kParentDirCmd: + case kParentDirCmd: myList->selectParent(); break; + case kLoadROMCmd: if(myList->isDirectory(myList->selected())) { @@ -1313,6 +1314,13 @@ void LauncherDialog::openWhatsNew() myDialog->open(); } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void LauncherDialog::gotoHomeDir() +{ + while(myList->hasPrevHistory()) + myList->selectPrevHistory(); +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void LauncherDialog::toggleShowAll(bool toggle) { diff --git a/src/gui/LauncherDialog.hxx b/src/gui/LauncherDialog.hxx index 2ae0521fe..2a28dc9cc 100644 --- a/src/gui/LauncherDialog.hxx +++ b/src/gui/LauncherDialog.hxx @@ -174,6 +174,7 @@ class LauncherDialog : public Dialog, CommandSender void showOnlyROMs(bool state); void toggleShowAll(bool toggle = true); void toggleSubDirs(bool toggle = true); + void gotoHomeDir(); void handleContextMenu(); void handleQuit(); void toggleExtensions(); @@ -233,8 +234,12 @@ class LauncherDialog : public Dialog, CommandSender enum { kAllfilesCmd = 'lalf', // show all files (or ROMs only) kSubDirsCmd = 'lred', + kParentDirCmd = 'PARD', kOptionsCmd = 'OPTI', kQuitCmd = 'QUIT', + kHomeDirCmd = 'homc', // go to Home directory + kPrevDirCmd = 'prvc', // go back in history to previous directory + kNextDirCmd = 'nxtc', // go back in history to next directory kReloadCmd = 'relc', kRmAllFav = 'rmaf', kRmAllPop = 'rmap',