27 lines
430 B
C
27 lines
430 B
C
|
#ifndef ADDRESSBUS_H
|
||
|
#define ADDRESSBUS_H
|
||
|
|
||
|
class AddressBus {
|
||
|
private:
|
||
|
unsigned char memory[0x10000];
|
||
|
|
||
|
public:
|
||
|
|
||
|
AddressBus() {
|
||
|
for (int i = 0; i < 0x10000; ++i) {
|
||
|
memory[i] = 0;
|
||
|
}
|
||
|
}
|
||
|
~AddressBus() {}
|
||
|
|
||
|
unsigned char read(unsigned short addr) {
|
||
|
return memory[addr];
|
||
|
}
|
||
|
|
||
|
void write(unsigned short addr, unsigned char data) {
|
||
|
memory[addr] = data;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
#endif
|