mirror of
https://github.com/zoriya/ComSquare.git
synced 2026-06-07 03:34:55 +00:00
Cleaning up
This commit is contained in:
@@ -26,7 +26,7 @@ void parseArguments(int argc, char **argv, SNES &snes)
|
|||||||
{0, 0, 0, 0 }
|
{0, 0, 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
char c = getopt_long(argc, argv, "c:pu-debug", long_options, &option_index);
|
char c = getopt_long(argc, argv, "c", long_options, &option_index);
|
||||||
if (c == -1)
|
if (c == -1)
|
||||||
break;
|
break;
|
||||||
switch (c) {
|
switch (c) {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <cmath>
|
||||||
#include "MemoryViewer.hpp"
|
#include "MemoryViewer.hpp"
|
||||||
#include "../SNES.hpp"
|
#include "../SNES.hpp"
|
||||||
#include "../Utility/Utility.hpp"
|
#include "../Utility/Utility.hpp"
|
||||||
@@ -44,8 +45,8 @@ QVariant MemoryViewerModel::headerData(int section, Qt::Orientation orientation,
|
|||||||
snprintf(buf, 2, "%1X", section);
|
snprintf(buf, 2, "%1X", section);
|
||||||
return QString(buf);
|
return QString(buf);
|
||||||
} else {
|
} else {
|
||||||
char buf[5];
|
char buf[6];
|
||||||
snprintf(buf, 5, "%03Xx", section);
|
snprintf(buf, 6, "%0*Xx", this->_headerIndentSize, section);
|
||||||
return QString(buf);
|
return QString(buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -53,6 +54,7 @@ QVariant MemoryViewerModel::headerData(int section, Qt::Orientation orientation,
|
|||||||
void MemoryViewerModel::setMemory(std::shared_ptr<Ram> memory)
|
void MemoryViewerModel::setMemory(std::shared_ptr<Ram> memory)
|
||||||
{
|
{
|
||||||
this->_memory = std::move(memory);
|
this->_memory = std::move(memory);
|
||||||
|
this->_headerIndentSize = this->_memory->getSize() >= 0x10000 ? 4 : 3;
|
||||||
emit this->layoutChanged();
|
emit this->layoutChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ Q_OBJECT
|
|||||||
private:
|
private:
|
||||||
//! @brief The ram to watch.
|
//! @brief The ram to watch.
|
||||||
std::shared_ptr<Ram> _memory;
|
std::shared_ptr<Ram> _memory;
|
||||||
|
//! @brief The number of char inside the left header number.
|
||||||
|
int _headerIndentSize = 3;
|
||||||
public:
|
public:
|
||||||
//! @brief Change the ram currently watched.
|
//! @brief Change the ram currently watched.
|
||||||
void setMemory(std::shared_ptr<Ram> memory);
|
void setMemory(std::shared_ptr<Ram> memory);
|
||||||
|
|||||||
Reference in New Issue
Block a user