| 1 | #cxx . . $ `<file>/src/VDPDataStore.cpp`/include "VDPDataStore.h"cxx . . $ `<file>/src/VDPDataStore.h`/ |
| 2 | #include "CommClient.h"cxx . . $ `<file>/src/CommClient.h`/ |
| 3 | |
| 4 | // static vector to feed PaletteDialog and be used when VDP colors aren't selected |
| 5 | static const uint8_tcxx . . $ uint8_t# defaultPalettecxx . . $ defaultPalette.[32] = { |
| 6 | // RB G |
| 7 | 0x00, 0, |
| 8 | 0x00, 0, |
| 9 | 0x11, 6, |
| 10 | 0x33, 7, |
| 11 | 0x17, 1, |
| 12 | 0x27, 3, |
| 13 | 0x51, 1, |
| 14 | 0x27, 6, |
| 15 | 0x71, 1, |
| 16 | 0x73, 3, |
| 17 | 0x61, 6, |
| 18 | 0x64, 6, |
| 19 | 0x11, 4, |
| 20 | 0x65, 2, |
| 21 | 0x55, 5, |
| 22 | 0x77, 7, |
| 23 | }; |
| 24 | |
| 25 | class VDPDataStoreVersionCheckcxx . . $ VDPDataStoreVersionCheck# : public SimpleCommandcxx . . $ SimpleCommand# |
| 26 | { |
| 27 | public: |
| 28 | VDPDataStoreVersionCheckcxx . . $ VDPDataStoreVersionCheck#VDPDataStoreVersionCheck(2b91b03568197b67).(VDPDataStorecxx . . $ VDPDataStore#& dataStore_) |
| 29 | : SimpleCommandcxx . . $ SimpleCommand#("debug desc {physical VRAM}"cxx . . $ QString#QString(85c52e162fed56f9).) |
| 30 | , dataStorecxx . . $ VDPDataStoreVersionCheck#dataStore.(dataStore_) |
| 31 | { |
| 32 | } |
| 33 | |
| 34 | void replyOkcxx . . $ VDPDataStoreVersionCheck#replyOk(3520e46b33348bf6).(const QStringcxx . . $ QString#& /*message*/) override |
| 35 | { |
| 36 | dataStorecxx . . $ VDPDataStoreVersionCheck#dataStore..debuggableNameVRAMcxx . . $ VDPDataStore#debuggableNameVRAM. =cxx . . $ std/optional#`operator=`(4ce4dd0ee161fed). "physical VRAM"; |
| 37 | dataStorecxx . . $ VDPDataStoreVersionCheck#dataStore..refreshcxx . . $ VDPDataStore#refresh(49f6e7a06ebc5aa8).(); |
| 38 | delete this; |
| 39 | } |
| 40 | void replyNokcxx . . $ VDPDataStoreVersionCheck#replyNok(3520e46b33348bf6).(const QStringcxx . . $ QString#& /*message*/) override |
| 41 | { |
| 42 | dataStorecxx . . $ VDPDataStoreVersionCheck#dataStore..debuggableNameVRAMcxx . . $ VDPDataStore#debuggableNameVRAM. =cxx . . $ std/optional#`operator=`(4ce4dd0ee161fed). "VRAM"; |
| 43 | dataStorecxx . . $ VDPDataStoreVersionCheck#dataStore..refreshcxx . . $ VDPDataStore#refresh(49f6e7a06ebc5aa8).(); |
| 44 | delete this; |
| 45 | } |
| 46 | |
| 47 | private: |
| 48 | VDPDataStorecxx . . $ VDPDataStore#& dataStorecxx . . $ VDPDataStoreVersionCheck#dataStore.; |
| 49 | }; |
| 50 | |
| 51 | class VDPDataStoreVRAMSizeCheckcxx . . $ VDPDataStoreVRAMSizeCheck# : public SimpleCommandcxx . . $ SimpleCommand# |
| 52 | { |
| 53 | public: |
| 54 | VDPDataStoreVRAMSizeCheckcxx . . $ VDPDataStoreVRAMSizeCheck#VDPDataStoreVRAMSizeCheck(2b91b03568197b67).(VDPDataStorecxx . . $ VDPDataStore#& dataStore_) |
| 55 | : SimpleCommandcxx . . $ SimpleCommand#("debug size {" +cxx . . $ operator+(c75c3ae4eb9af1a8). QStringcxx . . $ QString#::fromStdStringcxx . . $ QString#fromStdString(24a2e9bdf24626eb).(*cxx . . $ std/optional#`operator*`(47e1a15210ec6306).dataStore_.debuggableNameVRAMcxx . . $ VDPDataStore#debuggableNameVRAM.) +cxx . . $ operator+(3d22f08efddf8107). "}") |
| 56 | , dataStorecxx . . $ VDPDataStoreVRAMSizeCheck#dataStore.(dataStore_) |
| 57 | { |
| 58 | } |
| 59 | |
| 60 | void replyOkcxx . . $ VDPDataStoreVRAMSizeCheck#replyOk(3520e46b33348bf6).(const QStringcxx . . $ QString#& message) override |
| 61 | { |
| 62 | //printf("dataStore.vramSize %i\n",dataStore.vramSize); |
| 63 | dataStorecxx . . $ VDPDataStoreVRAMSizeCheck#dataStore..vramSizecxx . . $ VDPDataStore#vramSize. = message.toIntcxx . . $ QString#toInt(d7972accae11ee1f).(); |
| 64 | //printf("dataStore.vramSize %i\n",dataStore.vramSize); |
| 65 | dataStorecxx . . $ VDPDataStoreVRAMSizeCheck#dataStore..refresh2cxx . . $ VDPDataStore#refresh2(49f6e7a06ebc5aa8).(); |
| 66 | delete this; |
| 67 | } |
| 68 | void replyNokcxx . . $ VDPDataStoreVRAMSizeCheck#replyNok(3520e46b33348bf6).(const QStringcxx . . $ QString#& /*message*/) override |
| 69 | { |
| 70 | delete this; |
| 71 | } |
| 72 | |
| 73 | private: |
| 74 | VDPDataStorecxx . . $ VDPDataStore#& dataStorecxx . . $ VDPDataStoreVRAMSizeCheck#dataStore.; |
| 75 | }; |
| 76 | |
| 77 | class VDPDataStoreDebuggableCheckscxx . . $ VDPDataStoreDebuggableChecks# : public SimpleCommandcxx . . $ SimpleCommand# |
| 78 | { |
| 79 | public: |
| 80 | VDPDataStoreDebuggableCheckscxx . . $ VDPDataStoreDebuggableChecks#VDPDataStoreDebuggableChecks(2b91b03568197b67).(VDPDataStorecxx . . $ VDPDataStore#& dataStore_) |
| 81 | : SimpleCommandcxx . . $ SimpleCommand#("debug_check_debuggables {{VDP register latch status} {VDP palette latch status} "cxx . . $ QString#QString(85c52e162fed56f9). |
| 82 | "{VDP data latch value} {VRAM access status}}") |
| 83 | , dataStorecxx . . $ VDPDataStoreDebuggableChecks#dataStore.(dataStore_) |
| 84 | { |
| 85 | } |
| 86 | |
| 87 | void replyOkcxx . . $ VDPDataStoreDebuggableChecks#replyOk(3520e46b33348bf6).(const QStringcxx . . $ QString#& message) override |
| 88 | { |
| 89 | assertcxx . . $ `<external>/4398592474888995393/assert.h:102:11`!(message.size() == 7); |
| 90 | QStringListcxx . . $ QStringList# s = message.splitcxx . . $ QString#split(92030b8bf74e4227).(' 'cxx . . $ QChar#QChar(f349c77f591a7878).); |
| 91 | dataStorecxx . . $ VDPDataStoreDebuggableChecks#dataStore..registerLatchAvailablecxx . . $ VDPDataStore#registerLatchAvailable. = s[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).0] ==cxx . . $ `operator==`(794214156d3885c0). '1'cxx . . $ QChar#QChar(f349c77f591a7878).; |
| 92 | dataStorecxx . . $ VDPDataStoreDebuggableChecks#dataStore..paletteLatchAvailablecxx . . $ VDPDataStore#paletteLatchAvailable. = s[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).1] ==cxx . . $ `operator==`(794214156d3885c0). '1'cxx . . $ QChar#QChar(f349c77f591a7878).; |
| 93 | dataStorecxx . . $ VDPDataStoreDebuggableChecks#dataStore..dataLatchAvailablecxx . . $ VDPDataStore#dataLatchAvailable. = s[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).2] ==cxx . . $ `operator==`(794214156d3885c0). '1'cxx . . $ QChar#QChar(f349c77f591a7878).; |
| 94 | dataStorecxx . . $ VDPDataStoreDebuggableChecks#dataStore..vramAccessStatusAvailablecxx . . $ VDPDataStore#vramAccessStatusAvailable. = s[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).3] ==cxx . . $ `operator==`(794214156d3885c0). '1'cxx . . $ QChar#QChar(f349c77f591a7878).; |
| 95 | dataStorecxx . . $ VDPDataStoreDebuggableChecks#dataStore..refresh3cxx . . $ VDPDataStore#refresh3(49f6e7a06ebc5aa8).(); |
| 96 | delete this; |
| 97 | } |
| 98 | void replyNokcxx . . $ VDPDataStoreDebuggableChecks#replyNok(3520e46b33348bf6).(const QStringcxx . . $ QString#& /*message*/) override |
| 99 | { |
| 100 | dataStorecxx . . $ VDPDataStoreDebuggableChecks#dataStore..refresh3cxx . . $ VDPDataStore#refresh3(49f6e7a06ebc5aa8).(); |
| 101 | delete this; |
| 102 | } |
| 103 | |
| 104 | private: |
| 105 | VDPDataStorecxx . . $ VDPDataStore#& dataStorecxx . . $ VDPDataStoreDebuggableChecks#dataStore.; |
| 106 | }; |
| 107 | |
| 108 | static constexpr unsigned MAX_VRAM_SIZEcxx . . $ MAX_VRAM_SIZE. = 0x30000; |
| 109 | static constexpr unsigned MAX_TOTAL_SIZEcxx . . $ MAX_TOTAL_SIZE. = MAX_VRAM_SIZEcxx . . $ MAX_VRAM_SIZE. + 32 + 16 + 64 + 2 + 3 + 1; |
| 110 | |
| 111 | VDPDataStorecxx . . $ VDPDataStore#::VDPDataStorecxx . . $ VDPDataStore#VDPDataStore(49f6e7a06ebc5aa8).() |
| 112 | : vramcxx . . $ VDPDataStore#vram.(MAX_TOTAL_SIZEcxx . . $ MAX_TOTAL_SIZE.) |
| 113 | { |
| 114 | CommClientcxx . . $ CommClient#::instancecxx . . $ CommClient#instance(8cca9d0b1334f685).().sendCommandcxx . . $ CommClient#sendCommand(6fe5d9dff2ed3a64).(new VDPDataStoreVersionCheckcxx . . $ VDPDataStoreVersionCheck#VDPDataStoreVersionCheck(2b91b03568197b67).(*this)); |
| 115 | } |
| 116 | |
| 117 | VDPDataStorecxx . . $ VDPDataStore#& VDPDataStorecxx . . $ VDPDataStore#::instancecxx . . $ VDPDataStore#instance(6179f7cf4255f5b).() |
| 118 | { |
| 119 | static VDPDataStorecxx . . $ VDPDataStore# oneInstancecxx . . $ VDPDataStore#VDPDataStore(49f6e7a06ebc5aa8).; |
| 120 | return oneInstance; |
| 121 | } |
| 122 | |
| 123 | void VDPDataStorecxx . . $ VDPDataStore#::refreshcxx . . $ VDPDataStore#refresh(49f6e7a06ebc5aa8).() |
| 124 | { |
| 125 | if (!debuggableNameVRAMcxx . . $ VDPDataStore#debuggableNameVRAM.) { |
| 126 | // This can happen when the data store was used before |
| 127 | // connecting to openMSX |
| 128 | CommClientcxx . . $ CommClient#::instancecxx . . $ CommClient#instance(8cca9d0b1334f685).().sendCommandcxx . . $ CommClient#sendCommand(6fe5d9dff2ed3a64).(new |
| 129 | VDPDataStoreVersionCheckcxx . . $ VDPDataStoreVersionCheck#VDPDataStoreVersionCheck(2b91b03568197b67).(*this)); |
| 130 | } else { |
| 131 | refresh1cxx . . $ VDPDataStore#refresh1(49f6e7a06ebc5aa8).(); |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | void VDPDataStorecxx . . $ VDPDataStore#::refresh1cxx . . $ VDPDataStore#refresh1(49f6e7a06ebc5aa8).() |
| 136 | { |
| 137 | CommClientcxx . . $ CommClient#::instancecxx . . $ CommClient#instance(8cca9d0b1334f685).().sendCommandcxx . . $ CommClient#sendCommand(6fe5d9dff2ed3a64).(new VDPDataStoreVRAMSizeCheckcxx . . $ VDPDataStoreVRAMSizeCheck#VDPDataStoreVRAMSizeCheck(2b91b03568197b67).(*this)); |
| 138 | } |
| 139 | |
| 140 | void VDPDataStorecxx . . $ VDPDataStore#::refresh2cxx . . $ VDPDataStore#refresh2(49f6e7a06ebc5aa8).() |
| 141 | { |
| 142 | CommClientcxx . . $ CommClient#::instancecxx . . $ CommClient#instance(8cca9d0b1334f685).().sendCommandcxx . . $ CommClient#sendCommand(6fe5d9dff2ed3a64).(new VDPDataStoreDebuggableCheckscxx . . $ VDPDataStoreDebuggableChecks#VDPDataStoreDebuggableChecks(2b91b03568197b67).(*this)); |
| 143 | } |
| 144 | |
| 145 | void VDPDataStorecxx . . $ VDPDataStore#::refresh3cxx . . $ VDPDataStore#refresh3(49f6e7a06ebc5aa8).() |
| 146 | { |
| 147 | QStringcxx . . $ QString# req = QStringcxx . . $ QString#( |
| 148 | "debug_bin2hex " |
| 149 | "[debug read_block {" +cxx . . $ operator+(c75c3ae4eb9af1a8). QStringcxx . . $ QString#::fromStdStringcxx . . $ QString#fromStdString(24a2e9bdf24626eb).(*cxx . . $ std/optional#`operator*`(47e1a15210ec6306).debuggableNameVRAMcxx . . $ VDPDataStore#debuggableNameVRAM.) +cxx . . $ operator+(3d22f08efddf8107). "} 0 " +cxx . . $ operator+(fab9b4f80031f353). QStringcxx . . $ QString#::numbercxx . . $ QString#number(f54db86e0e113c71).(vramSizecxx . . $ VDPDataStore#vramSize.) +cxx . . $ operator+(3d22f08efddf8107). "]" |
| 150 | "[debug read_block {VDP palette} 0 32]" |
| 151 | "[debug read_block {VDP status regs} 0 16]" |
| 152 | "[debug read_block {VDP regs} 0 64]" |
| 153 | "[debug read_block {VRAM pointer} 0 2]%1%2%3%4") |
| 154 | .argcxx . . $ QString#arg(bc823072288cbbb5).(registerLatchAvailablecxx . . $ QString#QString(85c52e162fed56f9). ? "[debug read_block {VDP register latch status} 0 1]" : "") |
| 155 | .argcxx . . $ QString#arg(bc823072288cbbb5).(paletteLatchAvailablecxx . . $ QString#QString(85c52e162fed56f9). ? "[debug read_block {VDP palette latch status} 0 1]" : "") |
| 156 | .argcxx . . $ QString#arg(bc823072288cbbb5).(dataLatchAvailablecxx . . $ QString#QString(85c52e162fed56f9). ? "[debug read_block {VDP data latch value} 0 1]" : "") |
| 157 | .argcxx . . $ QString#arg(bc823072288cbbb5).(vramAccessStatusAvailablecxx . . $ QString#QString(85c52e162fed56f9). ? "[debug read_block {VRAM access status} 0 1]" : ""); |
| 158 | |
| 159 | int total = MAX_TOTAL_SIZEcxx . . $ MAX_TOTAL_SIZE. - MAX_VRAM_SIZEcxx . . $ MAX_VRAM_SIZE. + vramSizecxx . . $ VDPDataStore#vramSize. - !registerLatchAvailablecxx . . $ VDPDataStore#registerLatchAvailable. |
| 160 | - !paletteLatchAvailablecxx . . $ VDPDataStore#paletteLatchAvailable. - !dataLatchAvailablecxx . . $ VDPDataStore#dataLatchAvailable. - !vramAccessStatusAvailablecxx . . $ VDPDataStore#vramAccessStatusAvailable.; |
| 161 | new SimpleHexRequestcxx . . $ SimpleHexRequest#SimpleHexRequest(4f6612937cba2cbb).(req, total, &vramcxx . . $ VDPDataStore#vram.[cxx . . $ std/vector#`operator[]`(81207c53da4b73ce).0], *this); |
| 162 | } |
| 163 | |
| 164 | void VDPDataStorecxx . . $ VDPDataStore#::DataHexRequestReceivedcxx . . $ VDPDataStore#DataHexRequestReceived(49f6e7a06ebc5aa8).() |
| 165 | { |
| 166 | emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! dataRefreshedcxx . . $ VDPDataStore#dataRefreshed(49f6e7a06ebc5aa8).(); |
| 167 | } |
| 168 | |
| 169 | const uint8_tcxx . . $ uint8_t#* VDPDataStorecxx . . $ VDPDataStore#::getVramPointercxx . . $ VDPDataStore#getVramPointer(7eb257f306f79f97).() const |
| 170 | { |
| 171 | return &vramcxx . . $ VDPDataStore#vram.[cxx . . $ std/vector#`operator[]`(c8255e0fa326ac32).0]; |
| 172 | } |
| 173 | const uint8_tcxx . . $ uint8_t#* VDPDataStorecxx . . $ VDPDataStore#::getDefaultPalettePointercxx . . $ VDPDataStore#getDefaultPalettePointer(7eb257f306f79f97).() const |
| 174 | { |
| 175 | return defaultPalettecxx . . $ defaultPalette.; |
| 176 | } |
| 177 | const uint8_tcxx . . $ uint8_t#* VDPDataStorecxx . . $ VDPDataStore#::getPalettePointercxx . . $ VDPDataStore#getPalettePointer(7eb257f306f79f97).() const |
| 178 | { |
| 179 | return &vramcxx . . $ VDPDataStore#vram.[cxx . . $ std/vector#`operator[]`(c8255e0fa326ac32).vramSizecxx . . $ VDPDataStore#vramSize.]; |
| 180 | } |
| 181 | const uint8_tcxx . . $ uint8_t#* VDPDataStorecxx . . $ VDPDataStore#::getStatusRegsPointercxx . . $ VDPDataStore#getStatusRegsPointer(7eb257f306f79f97).() const |
| 182 | { |
| 183 | return &vramcxx . . $ VDPDataStore#vram.[cxx . . $ std/vector#`operator[]`(c8255e0fa326ac32).vramSizecxx . . $ VDPDataStore#vramSize. + 32]; |
| 184 | } |
| 185 | const uint8_tcxx . . $ uint8_t#* VDPDataStorecxx . . $ VDPDataStore#::getRegsPointercxx . . $ VDPDataStore#getRegsPointer(7eb257f306f79f97).() const |
| 186 | { |
| 187 | return &vramcxx . . $ VDPDataStore#vram.[cxx . . $ std/vector#`operator[]`(c8255e0fa326ac32).vramSizecxx . . $ VDPDataStore#vramSize. + 32 + 16]; |
| 188 | } |
| 189 | const uint8_tcxx . . $ uint8_t#* VDPDataStorecxx . . $ VDPDataStore#::getVdpVramPointercxx . . $ VDPDataStore#getVdpVramPointer(7eb257f306f79f97).() const |
| 190 | { |
| 191 | return &vramcxx . . $ VDPDataStore#vram.[cxx . . $ std/vector#`operator[]`(c8255e0fa326ac32).vramSizecxx . . $ VDPDataStore#vramSize. + 32 + 16 + 64]; |
| 192 | } |
| 193 | |
| 194 | size_t VDPDataStorecxx . . $ VDPDataStore#::getVRAMSizecxx . . $ VDPDataStore#getVRAMSize(fe4d2d262d4164a8).() const |
| 195 | { |
| 196 | return vramSizecxx . . $ VDPDataStore#vramSize.; |
| 197 | } |