Computer implements Runnable { public void reset() { pause(); synchronized (this) { Timber.d("resetting computer"); getCpu().reset(); } resume(); } Computer(); void configure(Resources resources, Configuration config); void setConfiguration(Configuration config); Configuration getConfiguration(); void saveState(Resources resources, Bundle outState); void restoreState(Resources resources, Bundle inState); int getClockFrequency(); void setClockFrequency(int clockFrequency); Cpu getCpu(); VideoController getVideoController(); KeyboardController getKeyboardController(); PeripheralPort getPeripheralPort(); FloppyController getFloppyController(); List<AudioOutput> getAudioOutputs(); void addAudioOutput(AudioOutput audioOutput); void setSystemUptime(long systemUptime); long getSystemUptime(); long getUptime(); long getUptimeTicks(); void addUptimeListener(UptimeListener uptimeListener); void addMemory(Memory memory); void addDevice(Device device); boolean isReadOnlyMemoryAddress(int address); Memory getMemory(int address); int getDevicesStartAddress(); void setDevicesStartAddress(int devicesStartAddress); void initDevices(); void reset(); int readMemory(boolean isByteMode, int address); boolean writeMemory(boolean isByteMode, int address, int value); synchronized void start(); void stop(); boolean isPaused(); void pause(); void resume(); void release(); float getEffectiveClockFrequency(); long cpuTimeToNanos(long cpuTime); long nanosToCpuTime(long nanosecs); @Override void run(); final static int BUS_ERROR; static final int BK0011_PAGED_MEMORY_0_ADDRESS; static final int BK0011_PAGED_MEMORY_1_ADDRESS; final static int IO_REGISTERS_MIN_ADDRESS; final static int IO_REGISTERS_MAX_ADDRESS; static final long NANOSECS_IN_USEC; static final long NANOSECS_IN_MSEC; final static int CLOCK_FREQUENCY_BK0010; final static int CLOCK_FREQUENCY_BK0011; }
@Test public void testReset() { Computer computer = new Computer(); computer.addDevice(new Sel1RegisterSystemBits(0100000)); computer.reset(); assertEquals(0100000, computer.getCpu().readRegister(false, Cpu.PC)); assertEquals(0340, computer.getCpu().getPswState()); }