o add custom chip for mmio

This commit is contained in:
David Voswinkel
2009-05-17 08:48:44 -07:00
parent c66828729f
commit 1075795ef4
12 changed files with 541 additions and 280 deletions

View File

@@ -9,3 +9,4 @@
#include "dsp4/dsp4.hpp"
#include "obc1/obc1.hpp"
#include "st010/st010.hpp"
#include "cmmio/cmmio.hpp"

View File

@@ -0,0 +1,35 @@
#include <../base.hpp>
#include <../cart/cart.hpp>
#include "cmmio.hpp"
void CMMIO::init() {
}
void CMMIO::enable() {
memory::mmio.map(0x3000, *this);
memory::mmio.map(0x3001, *this);
memory::mmio.map(0x3002, *this);
memory::mmio.map(0x3004, *this);
}
void CMMIO::power() {
reset();
}
void CMMIO::reset() {
}
uint8 CMMIO::mmio_read(unsigned addr) {
addr &= 0xffff;
printf("CMMIO::mmio_read 0x%x",addr);
return cpu.regs.mdr;
}
void CMMIO::mmio_write(unsigned addr, uint8 data) {
addr &= 0xffff;
printf("CMMIO::mmio_write 0x%x 0x%x",addr,data);
}
CMMIO::CMMIO() {
}

View File

@@ -0,0 +1,16 @@
class CMMIO : public MMIO {
public:
void init();
void enable();
void power();
void reset();
uint8 mmio_read (unsigned addr);
void mmio_write(unsigned addr, uint8 data);
CMMIO();
};
extern CMMIO cmmio;