cmmio.cpp 592 B

1234567891011121314151617181920212223242526272829303132333435
  1. #include <../base.hpp>
  2. #include <../cart/cart.hpp>
  3. #include "cmmio.hpp"
  4. void CMMIO::init() {
  5. }
  6. void CMMIO::enable() {
  7. memory::mmio.map(0x3000, *this);
  8. memory::mmio.map(0x3001, *this);
  9. memory::mmio.map(0x3002, *this);
  10. memory::mmio.map(0x3004, *this);
  11. }
  12. void CMMIO::power() {
  13. reset();
  14. }
  15. void CMMIO::reset() {
  16. }
  17. uint8 CMMIO::mmio_read(unsigned addr) {
  18. addr &= 0xffff;
  19. printf("CMMIO::mmio_read 0x%x",addr);
  20. return cpu.regs.mdr;
  21. }
  22. void CMMIO::mmio_write(unsigned addr, uint8 data) {
  23. addr &= 0xffff;
  24. printf("CMMIO::mmio_write 0x%x 0x%x",addr,data);
  25. }
  26. CMMIO::CMMIO() {
  27. }