1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-25 16:31:42 +00:00
CLK/Machines/MSX/Cartridges/ASCII8kb.hpp
Thomas Harte ed564cb810 Implements the main four cartridge banking schemes.
Slightly proof of concept for now.
2018-01-04 22:18:18 -05:00

49 lines
906 B
C++

//
// ASCII8kb.hpp
// Clock Signal
//
// Created by Thomas Harte on 04/01/2018.
// Copyright © 2018 Thomas Harte. All rights reserved.
//
#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) {}
void write(uint16_t address, uint8_t value) {
switch(address >> 11) {
default: break;
case 0xc:
map_.map(slot_, value * 8192, 0x4000, 0x2000);
break;
case 0xd:
map_.map(slot_, value * 8192, 0x6000, 0x2000);
break;
case 0xe:
map_.map(slot_, value * 8192, 0x8000, 0x2000);
break;
case 0xf:
map_.map(slot_, value * 8192, 0xa000, 0x2000);
break;
}
}
private:
MSX::MemoryMap &map_;
int slot_;
};
}
}
#endif /* ASCII8kb_hpp */