2017-03-17 20:28:07 -04:00
|
|
|
//
|
|
|
|
// CartridgeUnpaged.h
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 17/03/2017.
|
2018-05-13 15:19:52 -04:00
|
|
|
// Copyright 2017 Thomas Harte. All rights reserved.
|
2017-03-17 20:28:07 -04:00
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef Atari2600_CartridgeUnpaged_hpp
|
|
|
|
#define Atari2600_CartridgeUnpaged_hpp
|
|
|
|
|
|
|
|
#include "Cartridge.hpp"
|
|
|
|
|
|
|
|
namespace Atari2600 {
|
2017-08-16 11:56:52 -04:00
|
|
|
namespace Cartridge {
|
2017-03-17 20:28:07 -04:00
|
|
|
|
2017-08-16 12:39:15 -04:00
|
|
|
class Unpaged: public BusExtender {
|
2017-03-18 14:01:04 -04:00
|
|
|
public:
|
2017-11-11 15:28:40 -05:00
|
|
|
Unpaged(uint8_t *rom_base, std::size_t rom_size) : BusExtender(rom_base, rom_size) {}
|
2017-03-18 14:01:04 -04:00
|
|
|
|
2017-05-14 22:08:15 -04:00
|
|
|
void perform_bus_operation(CPU::MOS6502::BusOperation operation, uint16_t address, uint8_t *value) {
|
2017-03-18 14:01:04 -04:00
|
|
|
if(isReadOperation(operation) && (address & 0x1000)) {
|
2017-08-16 14:02:46 -04:00
|
|
|
*value = rom_base_[address & (rom_size_ - 1)];
|
2017-03-18 14:01:04 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2017-08-16 11:56:52 -04:00
|
|
|
}
|
2017-03-17 20:28:07 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* Atari2600_CartridgeUnpaged_hpp */
|