@Test(expected = IllegalArgumentException.class) public void shouldNotAccept8BitRegistersToSetA16BitRegisterValue() { GBZ80 z80 = new GBZ80(); z80.set16BitRegisterValue(ANY_8BIT_REGISTER, ANY_16BIT_VALUE); }
public void set16BitRegisterValue(Register register, int value) { validate16BitRegister(register); byte firstRegisterValue = (byte) (value >> 8 & 0xFF); byte secondRegisterValue = (byte) (value & 0xFF); registers[register.getRegisterIndex()] = firstRegisterValue; registers[register.getRegisterIndex() + 1] = secondRegisterValue; }
GBZ80 { public void set16BitRegisterValue(Register register, int value) { validate16BitRegister(register); byte firstRegisterValue = (byte) (value >> 8 & 0xFF); byte secondRegisterValue = (byte) (value & 0xFF); registers[register.getRegisterIndex()] = firstRegisterValue; registers[register.getRegisterIndex() + 1] = secondRegisterValue; } }
GBZ80 { public void set16BitRegisterValue(Register register, int value) { validate16BitRegister(register); byte firstRegisterValue = (byte) (value >> 8 & 0xFF); byte secondRegisterValue = (byte) (value & 0xFF); registers[register.getRegisterIndex()] = firstRegisterValue; registers[register.getRegisterIndex() + 1] = secondRegisterValue; } GBZ80(); }
GBZ80 { public void set16BitRegisterValue(Register register, int value) { validate16BitRegister(register); byte firstRegisterValue = (byte) (value >> 8 & 0xFF); byte secondRegisterValue = (byte) (value & 0xFF); registers[register.getRegisterIndex()] = firstRegisterValue; registers[register.getRegisterIndex() + 1] = secondRegisterValue; } GBZ80(); void reset(); byte get8BitRegisterValue(Register register); void set8BitRegisterValue(Register register, byte value); int get16BitRegisterValue(Register register); void set16BitRegisterValue(Register register, int value); int getProgramCounter(); void incrementProgramCounter(); void incrementProgramCounterTwice(); void setProgramCounter(int programCounter); void adjustProgramCounter(); int getStackPointer(); void setStackPointer(int stackPointer); void decrementStackPointer(); void incrementStackPointer(); void setLastInstructionExecutionTime(int lastInstructionExecutionTime); int getLastInstructionExecutionTime(); void resetFlagF(); void disableFlagZ(); void disableFlagN(); void disableFlagCY(); void disableFlagH(); void enableFlagZ(); void enableFlagN(); void enableFlagCY(); void enableFlagH(); boolean isFlagZEnabled(); boolean isFlagNEnabled(); boolean isFlagCYEnabled(); boolean isFlagHEnabled(); void enableInterruptMasterFlag(); void disableInterruptMasterFlag(); boolean isInterruptMasterFlageEnabled(); void enableHalt(); }
GBZ80 { public void set16BitRegisterValue(Register register, int value) { validate16BitRegister(register); byte firstRegisterValue = (byte) (value >> 8 & 0xFF); byte secondRegisterValue = (byte) (value & 0xFF); registers[register.getRegisterIndex()] = firstRegisterValue; registers[register.getRegisterIndex() + 1] = secondRegisterValue; } GBZ80(); void reset(); byte get8BitRegisterValue(Register register); void set8BitRegisterValue(Register register, byte value); int get16BitRegisterValue(Register register); void set16BitRegisterValue(Register register, int value); int getProgramCounter(); void incrementProgramCounter(); void incrementProgramCounterTwice(); void setProgramCounter(int programCounter); void adjustProgramCounter(); int getStackPointer(); void setStackPointer(int stackPointer); void decrementStackPointer(); void incrementStackPointer(); void setLastInstructionExecutionTime(int lastInstructionExecutionTime); int getLastInstructionExecutionTime(); void resetFlagF(); void disableFlagZ(); void disableFlagN(); void disableFlagCY(); void disableFlagH(); void enableFlagZ(); void enableFlagN(); void enableFlagCY(); void enableFlagH(); boolean isFlagZEnabled(); boolean isFlagNEnabled(); boolean isFlagCYEnabled(); boolean isFlagHEnabled(); void enableInterruptMasterFlag(); void disableInterruptMasterFlag(); boolean isInterruptMasterFlageEnabled(); void enableHalt();  }