2 // hwregsbrowser.h: Hardware registers blitter browser
6 // JPM = Jean-Paul Mari <djipi.mari@gmail.com>
9 // --- ---------- -----------------------------------------------------------
10 // JPM 08/20/2019 Created this file
16 #include "hwregsbrowser.h"
21 struct BlitterInfoTable
31 BlitterInfoTable TabBlitterInfoTable
[] = {
32 { 0xF02200, sizeof(long), "A1 base address", "32-bit register containing a pointer to the base of the window pointer to by A1.\nThis address must be phrase aligned." },
33 { 0xF02204, sizeof(long), "Flags Register", "A set of flags controlling various aspects of the A1 window and how addresses are updated." },
34 { 0xF02208, sizeof(long), "A1 Clipping Window Size", "This register contains the size in pixels, and may be used for clipping writes, so that if the pointer leaves the window bounds no write is performed." },
35 { 0xF0220C, sizeof(long), "A1 Window Pixel Pointer", "This register contains the X (low word) and Y (high word) pointers onto the window, and are the location where the next pixel will be written.\nThey are sixteen - bit signed values." },
36 { 0xF02210, sizeof(long), "A1 Step Value", "The step register contains two signed sixteen bit values, which are the X step (low word) and Y step (high word)." },
37 { 0xF02214, sizeof(long), "A1 Step Fraction Value", "The step fraction register may be added to the fractional parts of the A1 pointer in the same manner as the step value." },
38 { 0xF02218, sizeof(long), "A1 Window Pixel Pointer Fraction", "" },
39 { 0xF0221C, sizeof(long), "A1 Pixel Pointer Increment", "" },
40 { 0xF02220, sizeof(long), "A1 Pixel Pointer Increment Fraction", "This is the fractional parts of the increment described above." },
41 { 0xF02224, sizeof(long), "A2 Base Register", "32-bit register containing a pointer to the base of the window pointer to by A2.\nThis address must be phrase aligned." },
42 { 0xF02228, sizeof(long), "A2 Flags Register", "A set of flags controlling various aspects of the A2 window and how addresses are updated." },
43 { 0xF0222C, sizeof(long), "A2 Window Mask", "" },
44 { 0xF02230, sizeof(long), "A2 Window Pointer", "" },
45 { 0xF02234, sizeof(long), "A2 Step Value", "" },
46 { 0xF02238, sizeof(long), "Status Register", "" },
47 { 0xF0223C, sizeof(long), "Counters Register", "" },
48 { 0xF02240, sizeof(long long), "Source Data Register", "" },
49 { 0xF02248, sizeof(long long), "Destination Data Register", "" },
50 { 0xF02250, sizeof(long long), "Destination Z Register", "" },
51 { 0xF02258, sizeof(long long), "Source Z Register 1", "The source Z register 1 is also used to hold the four integer parts of computed Z." },
52 { 0xF02260, sizeof(long long), "Source Z Register 2", "The source Z register 2 is also used to hold the four fraction parts of computed Z." },
53 { 0xF02268, sizeof(long long), "Pattern Data Register", "The pattern data register also serves to hold the computed intensity integer parts and their associated colours." },
54 { 0xF02270, sizeof(long), "Intensity Increment", "This thirty-two bit register holds the integer and fractional parts of the intensity increment used for Gouraud shading." },
55 { 0xF02274, sizeof(long), "Z Increment", "This thirty-two bit register holds the integer and fractional parts of the Z increment used for computed Z polygon drawing." },
56 { 0xF02278, sizeof(long), "Collision control", "" },
57 { 0xF0227C, sizeof(long), "Intensity 0", "" },
58 { 0xF02280, sizeof(long), "Intensity 1", "" },
59 { 0xF02284, sizeof(long), "Intensity 2", "" },
60 { 0xF02288, sizeof(long), "Intensity 3", "" },
61 { 0xF0228C, sizeof(long), "Z 0", "These registers are analogous to the intensity registers, and are for Z buffer operation." },
62 { 0xF02290, sizeof(long), "Z 1", "These registers are analogous to the intensity registers, and are for Z buffer operation." },
63 { 0xF02294, sizeof(long), "Z 2", "These registers are analogous to the intensity registers, and are for Z buffer operation." },
64 { 0xF02298, sizeof(long), "Z 3", "These registers are analogous to the intensity registers, and are for Z buffer operation." },
69 HWRegsBlitterBrowserWindow::HWRegsBlitterBrowserWindow(QWidget
* parent
/*= 0*/) : QWidget(parent
, Qt::Dialog
),
70 layout(new QVBoxLayout
),
71 TableView(new QTableView
),
72 model(new QStandardItemModel
)
77 QFont
fixedFont("Lucida Console", 8, QFont::Normal
);
78 fixedFont
.setStyleHint(QFont::TypeWriter
);
80 // Set the new layout with proper identation and readibility
81 model
->setColumnCount(4);
82 model
->setHeaderData(0, Qt::Horizontal
, QObject::tr("Name"));
83 model
->setHeaderData(1, Qt::Horizontal
, QObject::tr("Address"));
84 model
->setHeaderData(2, Qt::Horizontal
, QObject::tr("# bits"));
85 model
->setHeaderData(3, Qt::Horizontal
, QObject::tr("Value"));
86 //model->setHeaderData(4, Qt::Horizontal, QObject::tr("Reference"));
88 TableView
->setModel(model
);
89 TableView
->setEditTriggers(QAbstractItemView::NoEditTriggers
);
90 TableView
->setShowGrid(0);
91 TableView
->setFont(fixedFont
);
92 TableView
->verticalHeader()->setDefaultSectionSize(TableView
->verticalHeader()->minimumSectionSize());
93 TableView
->verticalHeader()->setDefaultAlignment(Qt::AlignRight
);
95 // Set basic infos in the layout
96 for (i
= 0; i
< (sizeof(TabBlitterInfoTable
) / sizeof(struct BlitterInfoTable
)); i
++)
99 model
->setItem(i
, 0, new QStandardItem(QString("%1").arg(TabBlitterInfoTable
[i
].Name
)));
100 model
->setItem(i
, 1, new QStandardItem(QString("0x%1").arg(TabBlitterInfoTable
[i
].Address
, 4, 16, QChar('0'))));
101 model
->setItem(i
, 2, new QStandardItem(QString("%1").arg(TabBlitterInfoTable
[i
].NbBits
* 8)));
102 //model->setItem(i, 4, new QStandardItem(QString("%1").arg(TabBlitterInfoTable[i].Type)));
106 layout
->addWidget(TableView
);
112 HWRegsBlitterBrowserWindow::~HWRegsBlitterBrowserWindow(void)
119 void HWRegsBlitterBrowserWindow::Reset(void)
125 void HWRegsBlitterBrowserWindow::RefreshContents(void)
132 for (i
= 0; i
< (sizeof(TabBlitterInfoTable
) / sizeof(struct BlitterInfoTable
)); i
++)
134 // Emulator handles the blitter in a separate array
135 sprintf(string
, "0x%08x", BlitterReadLong(TabBlitterInfoTable
[i
].Address
));
136 model
->setItem(i
, 3, new QStandardItem(QString("%1").arg(string
)));