2018-01-05 03:18:18 +00:00
|
|
|
//
|
|
|
|
// ASCII8kb.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 04/01/2018.
|
2018-05-13 19:19:52 +00:00
|
|
|
// Copyright 2018 Thomas Harte. All rights reserved.
|
2018-01-05 03:18:18 +00:00
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef ASCII8kb_hpp
|
|
|
|
#define ASCII8kb_hpp
|
|
|
|
|
|
|
|
#include "../ROMSlotHandler.hpp"
|
|
|
|
|
|
|
|
namespace MSX {
|
|
|
|
namespace Cartridge {
|
|
|
|
|
|
|
|
class ASCII8kbROMSlotHandler: public ROMSlotHandler {
|
|
|
|
public:
|
|
|
|
ASCII8kbROMSlotHandler(MSX::MemoryMap &map, int slot) :
|
|
|
|
map_(map), slot_(slot) {}
|
|
|
|
|
2018-02-10 22:11:16 +00:00
|
|
|
void write(uint16_t address, uint8_t value, bool pc_is_outside_bios) override {
|
2018-02-09 14:10:56 +00:00
|
|
|
// printf("A8 %04x ", address);
|
2018-01-05 03:18:18 +00:00
|
|
|
switch(address >> 11) {
|
2018-01-23 02:50:56 +00:00
|
|
|
default:
|
2018-02-12 01:51:39 +00:00
|
|
|
if(pc_is_outside_bios) confidence_counter_.add_miss();
|
2018-01-23 02:50:56 +00:00
|
|
|
break;
|
2018-01-05 03:18:18 +00:00
|
|
|
case 0xc:
|
2018-02-12 01:32:45 +00:00
|
|
|
if(pc_is_outside_bios) {
|
|
|
|
if(address == 0x6000 || address == 0x60ff) confidence_counter_.add_hit(); else confidence_counter_.add_equivocal();
|
|
|
|
}
|
2018-01-23 03:13:16 +00:00
|
|
|
map_.map(slot_, value * 0x2000, 0x4000, 0x2000);
|
2018-01-05 03:18:18 +00:00
|
|
|
break;
|
|
|
|
case 0xd:
|
2018-02-12 01:32:45 +00:00
|
|
|
if(pc_is_outside_bios) {
|
|
|
|
if(address == 0x6800 || address == 0x68ff) confidence_counter_.add_hit(); else confidence_counter_.add_equivocal();
|
|
|
|
}
|
2018-01-23 03:13:16 +00:00
|
|
|
map_.map(slot_, value * 0x2000, 0x6000, 0x2000);
|
2018-01-05 03:18:18 +00:00
|
|
|
break;
|
|
|
|
case 0xe:
|
2018-02-12 01:32:45 +00:00
|
|
|
if(pc_is_outside_bios) {
|
|
|
|
if(address == 0x7000 || address == 0x70ff) confidence_counter_.add_hit(); else confidence_counter_.add_equivocal();
|
|
|
|
}
|
2018-01-23 03:13:16 +00:00
|
|
|
map_.map(slot_, value * 0x2000, 0x8000, 0x2000);
|
2018-01-05 03:18:18 +00:00
|
|
|
break;
|
|
|
|
case 0xf:
|
2018-02-12 01:32:45 +00:00
|
|
|
if(pc_is_outside_bios) {
|
|
|
|
if(address == 0x7800 || address == 0x78ff) confidence_counter_.add_hit(); else confidence_counter_.add_equivocal();
|
|
|
|
}
|
2018-01-23 03:13:16 +00:00
|
|
|
map_.map(slot_, value * 0x2000, 0xa000, 0x2000);
|
2018-01-05 03:18:18 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-01 12:53:52 +00:00
|
|
|
virtual void print_type() override {
|
|
|
|
printf("A8");
|
|
|
|
}
|
|
|
|
|
2018-01-05 03:18:18 +00:00
|
|
|
private:
|
|
|
|
MSX::MemoryMap &map_;
|
|
|
|
int slot_;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* ASCII8kb_hpp */
|