| 1 | // Copyright © 2004-2006 University of Helsinki, Department of Computer Science | |
| 2 | // Copyright © 2012 various contributors | |
| 3 | // This software is released under GNU Lesser General Public License 2.1. | |
| 4 | // The license text is at http://www.gnu.org/licenses/lgpl-2.1.html | |
| 5 | ||
| 6 | package fi.helsinki.cs.titokone.devices; | |
| 7 | ||
| 8 | import fi.helsinki.cs.titokone.*; | |
| 9 | ||
| 10 | /** | |
| 11 | * a "VIC" which baseaddress and mode changing support | |
| 12 | */ | |
| 13 | public abstract class VIC | |
| 14 | implements IODevice, InterruptGenerator { | |
| 15 | protected Interruptable pic; | |
| 16 | ||
| 17 | public int getPortCount() { | |
| 18 | 3 | return 5; |
| 19 | } | |
| 20 | ||
| 21 | @Override | |
| 22 | public int getPort(int n) { | |
| 23 | 6 | if (n < 0 || n > 4) { |
| 24 | 5 | throw new RuntimeException("should not be possible " + n); |
| 25 | } | |
| 26 | 3 | return 0; |
| 27 | } | |
| 28 | ||
| 29 | @Override | |
| 30 | public void setPort(int n, int value) { | |
| 31 | 1 | Display d = getDisplay(); |
| 32 | 1 | if (n == 0) { |
| 33 | 1 | d.setBaseAddress(value); |
| 34 | return; | |
| 35 | } | |
| 36 | 6 | if (n < 0 || n > 4) { |
| 37 | 5 | throw new RuntimeException("should not be possible " + n); |
| 38 | } | |
| 39 | } | |
| 40 | ||
| 41 | public void reset() { | |
| 42 | } | |
| 43 | ||
| 44 | public void update() { | |
| 45 | } | |
| 46 | ||
| 47 | public void link(Interruptable pic) { | |
| 48 | 1 | this.pic = pic; |
| 49 | } | |
| 50 | ||
| 51 | public abstract Display getDisplay(); | |
| 52 | ||
| 53 | } | |
Mutations | ||
| 18 |
replaced return of integer sized value with (x == 0 ? 1 : 0) : SURVIVED Substituted 5 with -1 : SURVIVED Substituted 5 with 6 : SURVIVED |
|
| 23 |
Substituted 4 with 5 : NO_COVERAGE changed conditional boundary : NO_COVERAGE Substituted 4 with 5 : NO_COVERAGE negated conditional : NO_COVERAGE changed conditional boundary : NO_COVERAGE negated conditional : NO_COVERAGE |
|
| 24 |
removed call to java/lang/StringBuilder::toString : NO_COVERAGE removed call to java/lang/StringBuilder::append : NO_COVERAGE removed call to java/lang/StringBuilder::<init> : NO_COVERAGE removed call to java/lang/RuntimeException::<init> : NO_COVERAGE removed call to java/lang/StringBuilder::append : NO_COVERAGE |
|
| 26 |
replaced return of integer sized value with (x == 0 ? 1 : 0) : NO_COVERAGE Substituted 0 with 1 : NO_COVERAGE Substituted 0 with 1 : NO_COVERAGE |
|
| 31 |
removed call to fi/helsinki/cs/titokone/devices/VIC::getDisplay : NO_COVERAGE |
|
| 32 |
negated conditional : NO_COVERAGE |
|
| 33 |
removed call to fi/helsinki/cs/titokone/Display::setBaseAddress : NO_COVERAGE |
|
| 36 |
negated conditional : NO_COVERAGE negated conditional : NO_COVERAGE changed conditional boundary : NO_COVERAGE changed conditional boundary : NO_COVERAGE Substituted 4 with 5 : NO_COVERAGE Substituted 4 with 5 : NO_COVERAGE |
|
| 37 |
removed call to java/lang/RuntimeException::<init> : NO_COVERAGE removed call to java/lang/StringBuilder::append : NO_COVERAGE removed call to java/lang/StringBuilder::<init> : NO_COVERAGE removed call to java/lang/StringBuilder::append : NO_COVERAGE removed call to java/lang/StringBuilder::toString : NO_COVERAGE |
|
| 48 |
Removed assignment to member variable pic : SURVIVED |