Skip to content

Commit 5e41da1

Browse files
committed
Minor
1 parent fef77c7 commit 5e41da1

2 files changed

Lines changed: 20 additions & 19 deletions

File tree

src/ClassSimZ80.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ inline bool ClassSimZ80::getNetValue()
310310
// - that, either by the number of connected gates, or by the number of connected pins
311311
// - any node for which state is true
312312
auto max_state = false;
313-
auto max_conn = 0;
313+
//auto max_conn = 0;
314314
for (net_t *p = m_group; p < (m_group + m_groupIndex); p++)
315315
{
316316
Net &net = m_netlist[*p];

src/ClassTrickbox.cpp

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -392,32 +392,33 @@ bool ClassTrickbox::saveBin(const QString fileName, quint16 address, uint size)
392392

393393
struct zx : public QWidget
394394
{
395-
zx(uint8_t *a) : ram(a)
395+
zx(uint8_t* a) : ram(a)
396396
{
397-
resize(512,384);
398-
QTimer *t = new QTimer(this);
399-
connect(t, &QTimer::timeout, this, [=](){update();});
397+
resize(512, 384);
398+
QTimer* t = new QTimer(this);
399+
connect(t, &QTimer::timeout, this, [=]() { update(); });
400400
t->start(640);
401401
};
402-
const QColor ink[8] {Qt::black, Qt::blue, Qt::red, Qt::magenta, Qt::green, Qt::cyan, Qt::yellow, Qt::white};
403-
uint8_t *ram;
404-
int f;
405-
void paintEvent(QPaintEvent *) override
402+
const QColor ink[8]{ Qt::black, Qt::blue, Qt::red, Qt::magenta, Qt::green, Qt::cyan, Qt::yellow, Qt::white };
403+
uint8_t* ram;
404+
bool blink;
405+
void paintEvent(QPaintEvent*) override
406406
{
407-
QPainter painter(this); f=!f;
408-
for (uint i=0; i<6144; i++)
407+
QPainter painter(this);
408+
blink = !blink;
409+
for (uint i = 0; i < 6144; i++)
409410
{
410-
uint y=((i>>8)&7)|((i>>2)&0x38)|((i>>5)&0xC0);
411-
uint x=(i&31)<<3;
412-
uint8_t b=ram[16384|i];
413-
uint8_t c=ram[22528|((y&0xF8)<<2)|(x>>3)];
414-
for (uint j=0; j<8; j++)
411+
uint y = ((i >> 8) & 7) | ((i >> 2) & 0x38) | ((i >> 5) & 0xC0);
412+
uint x = (i & 31) << 3;
413+
uint8_t b = ram[16384 | i];
414+
uint8_t c = ram[22528 | ((y & 0xF8) << 2) | (x >> 3)];
415+
for (uint j = 0; j < 8; j++)
415416
{
416-
bool pix=((b>>(~j&7))&1) ^ ((c>>7)&f);
417-
QColor col = pix ? ink[c&7] : ink[(c>>3)&7];
417+
bool pix = ((b >> (~j & 7)) & 1) ^ ((c >> 7) & !!blink);
418+
QColor col = pix ? ink[c & 7] : ink[(c >> 3) & 7];
418419
painter.setPen(col);
419420
painter.setBrush(col);
420-
painter.drawRect((x+j)*2, y*2, 2, 2);
421+
painter.drawRect((x + j) * 2, y * 2, 2, 2);
421422
}
422423
}
423424
}

0 commit comments

Comments
 (0)