1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-23 03:32:32 +00:00
CLK/Machines/Atari/2600/Cartridges/Unpaged.hpp

27 lines
582 B
C++
Raw Normal View History

//
// CartridgeUnpaged.h
// Clock Signal
//
// Created by Thomas Harte on 17/03/2017.
// Copyright 2017 Thomas Harte. All rights reserved.
//
#pragma once
#include "Cartridge.hpp"
2023-05-10 21:02:18 +00:00
namespace Atari2600::Cartridge {
class Unpaged: public BusExtender {
public:
Unpaged(uint8_t *rom_base, std::size_t rom_size) : BusExtender(rom_base, rom_size) {}
void perform_bus_operation(CPU::MOS6502::BusOperation operation, uint16_t address, uint8_t *value) {
if(isReadOperation(operation) && (address & 0x1000)) {
2017-08-16 18:02:46 +00:00
*value = rom_base_[address & (rom_size_ - 1)];
}
}
};
}