1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-06 01:28:57 +00:00
CLK/Processors/Z80/Z80AllRAM.cpp

32 lines
643 B
C++

//
// Z80AllRAM.cpp
// Clock Signal
//
// Created by Thomas Harte on 16/05/2017.
// Copyright © 2017 Thomas Harte. All rights reserved.
//
#include "Z80AllRAM.hpp"
#include <algorithm>
using namespace CPU::Z80;
AllRAMProcessor::AllRAMProcessor() : ::CPU::AllRAMProcessor(65536) {}
int AllRAMProcessor::perform_machine_cycle(const MachineCycle *cycle) {
switch(cycle->operation) {
case BusOperation::ReadOpcode:
case BusOperation::Read:
*cycle->value = memory_[*cycle->address];
break;
case BusOperation::Write:
memory_[*cycle->address] = *cycle->value;
break;
default:
printf("???\n");
break;
}
return 0;
}