@JEB - this instruction does more than two "gets" together, it also resets the inputs
| 4132 | |
| 4133 | // @JEB - this instruction does more than two "gets" together, it also resets the inputs |
| 4134 | bool cHardwareCPU::Inst_TaskGet2(cAvidaContext& ctx) |
| 4135 | { |
| 4136 | // Randomize the inputs so they can't save numbers |
| 4137 | m_organism->GetOrgInterface().ResetInputs(ctx); // Now re-randomize the inputs this organism sees |
| 4138 | m_organism->ClearInput(); // Also clear their input buffers, or they can still claim |
| 4139 | // rewards for numbers no longer in their environment! |
| 4140 | |
| 4141 | const int reg_used_1 = FindModifiedRegister(REG_BX); |
| 4142 | const int reg_used_2 = FindNextRegister(reg_used_1); |
| 4143 | |
| 4144 | const int value1 = m_organism->GetNextInput(); |
| 4145 | GetRegister(reg_used_1) = value1; |
| 4146 | m_organism->DoInput(value1); |
| 4147 | |
| 4148 | const int value2 = m_organism->GetNextInput(); |
| 4149 | GetRegister(reg_used_2) = value2; |
| 4150 | m_organism->DoInput(value2); |
| 4151 | |
| 4152 | return true; |
| 4153 | } |
| 4154 | |
| 4155 | bool cHardwareCPU::Inst_TaskStackGet(cAvidaContext&) |
| 4156 | { |
nothing calls this directly
no test coverage detected