mirror of
https://github.com/TomHarte/CLK.git
synced 2024-08-23 02:29:01 +00:00
54 lines
1.2 KiB
C++
54 lines
1.2 KiB
C++
//
|
|
// Konami.hpp
|
|
// Clock Signal
|
|
//
|
|
// Created by Thomas Harte on 04/01/2018.
|
|
// Copyright © 2018 Thomas Harte. All rights reserved.
|
|
//
|
|
|
|
#ifndef Konami_hpp
|
|
#define Konami_hpp
|
|
|
|
#include "../ROMSlotHandler.hpp"
|
|
|
|
namespace MSX {
|
|
namespace Cartridge {
|
|
|
|
class KonamiROMSlotHandler: public ROMSlotHandler {
|
|
public:
|
|
KonamiROMSlotHandler(MSX::MemoryMap &map, int slot) :
|
|
map_(map), slot_(slot) {}
|
|
|
|
void write(uint16_t address, uint8_t value) override {
|
|
switch(address >> 13) {
|
|
default:
|
|
confidence_counter_.add_miss();
|
|
break;
|
|
case 3:
|
|
if(address == 0x6000) confidence_counter_.add_hit(); else confidence_counter_.add_equivocal();
|
|
map_.map(slot_, value * 0x2000, 0x6000, 0x2000);
|
|
break;
|
|
case 4:
|
|
if(address == 0x8000) confidence_counter_.add_hit(); else confidence_counter_.add_equivocal();
|
|
map_.map(slot_, value * 0x2000, 0x8000, 0x2000);
|
|
break;
|
|
case 5:
|
|
if(address == 0xa000) confidence_counter_.add_hit(); else confidence_counter_.add_equivocal();
|
|
map_.map(slot_, value * 0x2000, 0xa000, 0x2000);
|
|
break;
|
|
}
|
|
}
|
|
|
|
virtual void print_type() override {
|
|
printf("K");
|
|
}
|
|
private:
|
|
MSX::MemoryMap &map_;
|
|
int slot_;
|
|
};
|
|
|
|
}
|
|
}
|
|
|
|
#endif /* Konami_hpp */
|