| 1 | // File: cpupane.hcxx . . $ `<file>/cpupane.h`/ |
| 2 | /* |
| 3 | Pep8-1 is a virtual machine for writing machine language and assembly |
| 4 | language programs. |
| 5 | |
| 6 | Copyright (C) 2009 J. Stanley Warford, Pepperdine University |
| 7 | |
| 8 | This program is free software: you can redistribute it and/or modify |
| 9 | it under the terms of the GNU General Public License as published by |
| 10 | the Free Software Foundation, either version 3 of the License, or |
| 11 | (at your option) any later version. |
| 12 | |
| 13 | This program is distributed in the hope that it will be useful, |
| 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | GNU General Public License for more details. |
| 17 | |
| 18 | You should have received a copy of the GNU General Public License |
| 19 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 20 | */ |
| 21 | |
| 22 | #ifndef CPUPANE_H |
| 23 | #define CPUPANE_Hcxx . . $ `cpupane.h:23:9`! |
| 24 | |
| 25 | #include <QWidget> |
| 26 | #include "enu.h"cxx . . $ `<file>/enu.h`/ |
| 27 | |
| 28 | namespace Uicxx . . $ Ui/ { |
| 29 | class CpuPanecxx . . $ Ui/CpuPane#; |
| 30 | } |
| 31 | |
| 32 | class CpuPanecxx . . $ CpuPane# : public QWidgetcxx . . $ QWidget# { |
| 33 | Q_OBJECTcxx . . $ CpuPane#tr(75d9f1c324b4579d). |
| 34 | Q_DISABLE_COPYcxx . . $ CpuPane#CpuPane(ce48f2e6390f692).(CpuPane) |
| 35 | public: |
| 36 | explicit CpuPanecxx . . $ CpuPane#CpuPane(108f35f7aa7f3cf9).(QWidgetcxx . . $ QWidget# *parent = 0); |
| 37 | virtual ~cxx . . $ CpuPane#`~CpuPane`(ced63f7c635d850d).CpuPanecxx . . $ CpuPane#(); |
| 38 | |
| 39 | void updateCpucxx . . $ CpuPane#updateCpu(49f6e7a06ebc5aa8).(); |
| 40 | // Post: Updates CPU pane labels |
| 41 | |
| 42 | void clearCpucxx . . $ CpuPane#clearCpu(49f6e7a06ebc5aa8).(); |
| 43 | // Post: The CPU pane labels are blanked and the CPU registers are cleared |
| 44 | |
| 45 | void runClickedcxx . . $ CpuPane#runClicked(49f6e7a06ebc5aa8).(); |
| 46 | // Post: All of the debug checkboxes are unclicked |
| 47 | |
| 48 | void setDebugStatecxx . . $ CpuPane#setDebugState(b45ddcbc8423892c).(bool b); |
| 49 | // Post: if b is true, checkboxes are set to disabled, and vice versa |
| 50 | |
| 51 | void traceTrapscxx . . $ CpuPane#traceTraps(b45ddcbc8423892c).(bool b); |
| 52 | // Post: Trace traps checkbox is checked if b, unchecked else |
| 53 | |
| 54 | void setButtonsEnabledcxx . . $ CpuPane#setButtonsEnabled(b45ddcbc8423892c).(bool b); |
| 55 | // Post: if b is true, buttons are enabled, and vice versa |
| 56 | |
| 57 | void runWithBatchcxx . . $ CpuPane#runWithBatch(49f6e7a06ebc5aa8).(); |
| 58 | // Runs the simulator through with batch input |
| 59 | |
| 60 | void runWithTerminalcxx . . $ CpuPane#runWithTerminal(49f6e7a06ebc5aa8).(); |
| 61 | // Runs the simulator through with terminal i/o |
| 62 | |
| 63 | void resumeWithBatchcxx . . $ CpuPane#resumeWithBatch(49f6e7a06ebc5aa8).(); |
| 64 | // Resumes the simulator with batch input |
| 65 | |
| 66 | void resumeWithTerminalcxx . . $ CpuPane#resumeWithTerminal(49f6e7a06ebc5aa8).(); |
| 67 | // Resumes the simulator with terminal input |
| 68 | |
| 69 | void singleStepWithBatchcxx . . $ CpuPane#singleStepWithBatch(49f6e7a06ebc5aa8).(); |
| 70 | // Single steps the simulator with batch input |
| 71 | |
| 72 | void singleStepWithTerminalcxx . . $ CpuPane#singleStepWithTerminal(49f6e7a06ebc5aa8).(); |
| 73 | // Single steps the simulator with terminal input |
| 74 | |
| 75 | void trapLookaheadcxx . . $ CpuPane#trapLookahead(49f6e7a06ebc5aa8).(); |
| 76 | // Looks ahead to the next instruction to determine if we are trapping |
| 77 | |
| 78 | void interruptExecutioncxx . . $ CpuPane#interruptExecution(49f6e7a06ebc5aa8).(); |
| 79 | // Post: interruptExecutionFlag is set to true |
| 80 | |
| 81 | void highlightOnFocuscxx . . $ CpuPane#highlightOnFocus(49f6e7a06ebc5aa8).(); |
| 82 | // Post: Highlights the label based on the label window color saved in the UI file |
| 83 | |
| 84 | Enucxx . . $ Enu/::EWaitingcxx . . $ Enu/EWaiting# waitingStatecxx . . $ CpuPane#waitingState(1652806ed471b963).(); |
| 85 | // Post: Returns the waiting state of the simulation (for terminal io) |
| 86 | |
| 87 | bool singleStepHasFocuscxx . . $ CpuPane#singleStepHasFocus(c9857a73d68e59ba).(); |
| 88 | // Post: returns if the single step is enabled |
| 89 | |
| 90 | bool hasFocuscxx . . $ CpuPane#hasFocus(c9857a73d68e59ba).(); |
| 91 | // Post: Returns if the single step button has focus |
| 92 | |
| 93 | bool isSimulatingcxx . . $ CpuPane#isSimulating(c9857a73d68e59ba).(); |
| 94 | // Returns if the CPU is currently simulating - this can happen when the enter key is |
| 95 | // held down to single step quickly, causing multiple enter events to fire per single step |
| 96 | // This is used to avoid that. |
| 97 | |
| 98 | void giveSingleStepFocuscxx . . $ CpuPane#giveSingleStepFocus(49f6e7a06ebc5aa8).(); |
| 99 | // Gives the single step button focus - this is used when we press 'enter' in other panes |
| 100 | // and we want to give the cpu pane focus for ease of navigation |
| 101 | |
| 102 | private: |
| 103 | Uicxx . . $ Ui/::CpuPanecxx . . $ Ui/CpuPane# *uicxx . . $ CpuPane#ui.; |
| 104 | |
| 105 | bool interruptExecutionFlagcxx . . $ CpuPane#interruptExecutionFlag.; // Used to interrupt execution by the user |
| 106 | |
| 107 | Enucxx . . $ Enu/::EWaitingcxx . . $ Enu/EWaiting# waitingcxx . . $ CpuPane#waiting.; // Used to store terminal IO waiting for input state |
| 108 | |
| 109 | void mousePressEventcxx . . $ CpuPane#mousePressEvent(702858a82d06265c).(QMouseEventcxx . . $ QMouseEvent# *); |
| 110 | |
| 111 | bool isCurrentlySimulatingcxx . . $ CpuPane#isCurrentlySimulating.; |
| 112 | |
| 113 | private slotscxx . . $ `<external>/1208926524888476972/qobjectdefs.h:88:14`!: |
| 114 | void singleStepButtoncxx . . $ CpuPane#singleStepButton(49f6e7a06ebc5aa8).(); |
| 115 | |
| 116 | signalscxx . . $ `<external>/1208926524888476972/qobjectdefs.h:89:14`!: |
| 117 | void resumeButtonClickedcxx . . $ CpuPane#resumeButtonClicked(49f6e7a06ebc5aa8).(); |
| 118 | void singleStepButtonClickedcxx . . $ CpuPane#singleStepButtonClicked(49f6e7a06ebc5aa8).(); |
| 119 | void updateSimulationViewcxx . . $ CpuPane#updateSimulationView(49f6e7a06ebc5aa8).(); |
| 120 | void executionCompletecxx . . $ CpuPane#executionComplete(49f6e7a06ebc5aa8).(); |
| 121 | void appendOutputcxx . . $ CpuPane#appendOutput(7df51288a9ebd664).(QStringcxx . . $ QString#); |
| 122 | void vonNeumannSteppedcxx . . $ CpuPane#vonNeumannStepped(49f6e7a06ebc5aa8).(); |
| 123 | void waitingForInputcxx . . $ CpuPane#waitingForInput(49f6e7a06ebc5aa8).(); |
| 124 | }; |
| 125 | |
| 126 | #endif // CPUPANE_H |