remove extraneous classes
[slipway.git] / src / edu / berkeley / slipway / FakeBoard.java
1 package edu.berkeley.slipway;
2
3 import java.io.*;
4 import java.util.*;
5 import com.ftdi.usb.*;
6 import com.atmel.fpslic.*;
7 import edu.berkeley.abits.*;
8 import org.ibex.util.*;
9
10 // FEATURE: more state checking (ie must have reset high before uart-mode, etc)
11
12 /**
13  * Slipway board (Fpslic via FTDI USB-UART, running <tt>SlipwaySlave.c</tt>)
14  */
15 public class FakeBoard extends FpslicDevice implements Board {
16
17     private byte[][][] cache;
18     public FakeBoard(int width, int height) {
19         super(width, height);
20         cache = new byte[256][][];
21         for(int i=0; i < cache.length; i++) {
22             cache[i] = new byte[256][];
23             for(int j=0; j < cache.length; j++) {
24                 cache[i][j] = new byte[256];
25             }
26         }
27     }
28
29     public void flush() { }
30     public void mode4(int z, int y, int x, int d) {
31         cache[z][y][x] = (byte)d;
32     }
33     public byte mode4(int z, int y, int x) {
34         return cache[z][y][x];
35     }
36
37     public void reset() throws IOException { }
38
39     public OutputStream getConfigStream() throws IOException {
40         return new OutputStream() {
41             public void flush() { }
42             public void write(int b) { }
43             public void write(byte[] b, int x, int y) { }
44         };
45     }
46
47     public InputStream  getInputStream() {
48         return new InputStream() {
49             public int available() { return 0; }
50             public int read() { return -1; }
51             public int read(byte[] b, int x, int y) { return -1; }
52         };
53     }
54
55     public OutputStream getOutputStream() {
56         return new OutputStream() {
57             public void flush() { }
58             public void write(int b) { }
59             public void write(byte[] b, int x, int y) { }
60         };
61     }
62
63     public void selfTest(SelfTestResultListener resultListener) throws Exception { }
64
65     public Device getDevice() { return this; }
66
67     public void boot(Reader r) throws Exception { }
68 }
69