void QFStageConfigWidgetThread::run() {
    stopped=false;
    while (!stopped) {
        nextInstruction();
        msleep(THREAD_TIMEOUT);
    }
}
Example #2
0
void controlUI()
{
  if (game.state == GAME)
  {
    if (intrp.running && testButton(PSP_CTRL_CROSS,1)) stopProgram();
  }

  if (game.state != GAME_FUNC_SETTING) return;
  // Function selector
  ui.func_selected += testButton(PSP_CTRL_RTRIGGER,1) -
                      testButton(PSP_CTRL_LTRIGGER,1);
  ui.func_selected += FUNC_NBR * ((ui.func_selected <  0) -
                                  (ui.func_selected >= FUNC_NBR));

  // Matrix selector
  ui.matrix_x += testButton(PSP_CTRL_RIGHT,1) - testButton(PSP_CTRL_LEFT,1);
  ui.matrix_y += testButton(PSP_CTRL_DOWN,1) - testButton(PSP_CTRL_UP,1);
  ui.matrix_x += MATRIX_W * ((ui.matrix_x <  0) - (ui.matrix_x >= MATRIX_W));
  ui.matrix_y += MATRIX_H * ((ui.matrix_y <  0) - (ui.matrix_y >= MATRIX_H));

  if (testButton(PSP_CTRL_CROSS,1))
  {
    game.func_matrix[ui.matrix_x][ui.matrix_y] = ui.func_selected + 1;
    nextInstruction();
  }
  else if (testButton(PSP_CTRL_CIRCLE,1))
    game.func_matrix[ui.matrix_x][ui.matrix_y] = 0;
  else if (testButton(PSP_CTRL_SELECT,1))
    clearFuncMatrix();
}
Example #3
0
void
Iterator::interpretInstruction()
{
    // Interpret the instruction.
    mOperations.interpretInstruction(*mInstruction, *mState);

    // Leave the instruction.
    mCallback->onInstructionExit(*mInstruction);

    if (mInstruction == --(*mBasicBlock)->end())
    {
        mCallback->onBasicBlockExit(**mBasicBlock);

        if (mBasicBlock == --(*mFunction)->end())
        {
            (*mFunction)->updateOutputState();
            mCallback->onFunctionExit(**mFunction);

            if (mFunction == --mModule.end())
            {
                mModule.updateGlobalState();
                mCallback->onModuleExit();
            }
        }
    }

    // Move to the next instruction.
    nextInstruction();
}
Example #4
0
void Z80::simulateFrame()
{
    while ( m_cyclesSinceLastFrame <= (1.0/50.0) / CLOCK_TIME )
    {
        nextInstruction();
    }
    m_cyclesSinceLastFrame = 0;
}
Example #5
0
// Initializes the data, gets the first instruction, and gets
// first token
void secondPass(FILE* infile, FILE* outfile, FILE* bfile){
    binfile = bfile;
    outputBuffer[16] = 0;
    initScanner(infile, outfile);
    spAddress = DEFAULT_START_ADDRESS;
    spNotDone = nextInstruction();
    spToken = nextToken();
    program();
}
Example #6
0
// The purported end of an instruction has been reached, so
// check for the newline, get the next instruction, get 
//  its first token, and increment the address counter.
void finishInstruction(){
    spToken = nextToken();
    accept(TC_NEWLINE, "Too many tokens in instruction.");
    spNotDone = nextInstruction();
    if (spNotDone){
        spAddress++;
        spToken = nextToken();
    }
}
GlyphViewerDialogExtension::GlyphViewerDialogExtension (QWidget* parent)
: GlyphViewerDialogExtensionBase (parent)
{
	connect( buttonFirstInstruction, SIGNAL( clicked() ), parent, SLOT( firstInstruction() ) );
	connect( buttonBackInstruction, SIGNAL( clicked() ), parent, SLOT( backInstruction() ) );
	connect( buttonPreviousInstruction, SIGNAL( clicked() ), parent, SLOT( previousInstruction() ) );
	connect( buttonNextInstruction, SIGNAL( clicked() ), parent, SLOT( nextInstruction() ) );
	connect( buttonForwardInstruction, SIGNAL( clicked() ), parent, SLOT( forwardInstruction() ) );
	connect( buttonLastInstruction, SIGNAL( clicked() ), parent, SLOT( lastInstruction() ) );
	connect( buttonStackViewer, SIGNAL( clicked() ), parent, SLOT( openStackViewer() ) );
	connect( buttonStorageViewer, SIGNAL( clicked() ), parent, SLOT( openStorageViewer() ) );
	connect( buttonCVTViewer, SIGNAL( clicked() ), parent, SLOT( openCVTViewer() ) );
	connect( buttonGraphicsStateViewer, SIGNAL( clicked() ), parent, SLOT( openGraphicsStateViewer() ) );
}
Example #8
0
Instruction* ReturnInstruction::execute(ExecutionThread *executor, bool *wait)
{
    Q_UNUSED(wait);
    Q_UNUSED(executor);

    setRunning(true);

    if (m_valid && statement) {
        ProgramVariables *vars = scheme()->variables();
        drzewo_skladn *t = statement->syntacticTree();
        if (t) {
            result = execute_statement(this, t, vars);
            scheme()->setFunctionReturnValue(result);
            qDebug() << "return value=" << result.toString();
        }
    }

    setRunning(false);

    return nextInstruction();
}
Example #9
0
void
Iterator::initialize()
{
    mInitialized = true;
    nextInstruction();
}
/*  
 * START THE VM 
 */
void startVM(Vm* vm)
{
    vm->PC = 0;

    while (charArrayToInt(0,2,vm->IR) != 99)
    {
        nextInstruction(vm);

        switch (charArrayToInt(0,2,vm->IR)) 
        {
            case 0:
                o0(vm);
                break;
            case 1: 
                o1(vm);
                break;
            case 2:
                o2(vm);
                break;
            case 3:
                o3(vm);
                break;
            case 4:
                o4(vm);
                break;
            case 5:
                o5(vm);
                break;
            case 6:
                o6(vm);
                break;
            case 7:
                o7(vm);
                break;
            case 8:
                o8(vm);
                break;
            case 9:
                o9(vm);
                break;
            case 10:
                o10(vm);
                break;
            case 11:
                o11(vm);
                break;
            case 12:
                o12(vm);
                break;
            case 13:
                o13(vm);
                break;
            case 14:
                o14(vm);
                break;
            case 15:
                o15(vm);
                break;
            case 16:
                o16(vm);
                break;
            case 17:
                o17(vm);
                break;
            case 18:
                o18(vm);
                break;
            case 19:
                o19(vm);
                break;
            case 20:
                o20(vm);
                break;
            case 21:
                o21(vm);
                break;
            case 22:
                o22(vm);
                break;
            case 23:
                o23(vm);
                break;
            case 24:
                o24(vm);
                break;
            case 25:
                o25(vm);
                break;
            case 26:
                o26(vm);
                break;
            case 27:
                o27(vm);
                break;
            case 28:
                o28(vm);
                break;
            case 29:
                o29(vm);
                break;
            case 30:
                o30(vm);
                break;
            case 31:
                o31(vm);
                break;
            case 32:
                o32(vm);
                break;
            case 33:
                o33(vm);
                break;
            case 34:
                o34(vm);
                break;
            case 35:
                o35(vm);
                break;
            case 99:
                o99(vm);
                break;
            default:
                // Code
                break;
        }
        displayVmFinal(vm);
    }
}