86 , biosRam(config, getName() +
" BIOS RAM",
"Chakkari Copy BIOS RAM", 0x4000)
87 , workRam(config, getName() +
" work RAM",
"Chakkari Copy work RAM", 0x0800)
88 , rom(getName() +
" ROM",
"rom", config)
89 , pauseButtonPressedSetting(getCommandController(),
90 getName() +
" PAUSE button pressed",
91 "controls the PAUSE button state", false,
Setting::Save::NO)
92 , copyButtonPressedSetting(getCommandController(),
93 getName() +
" COPY button pressed",
94 "controls the COPY button state", false,
Setting::Save::NO)
95 , modeSetting(getCommandController(), getName() +
" mode",
96 "Sets mode of the cartridge: in COPY mode you can hardcopy MSX1 screens, "
97 "in RAM mode you just have a 16kB RAM expansion",
ChakkariCopy::COPY,
101 reset(getCurrentTime());
102 modeSetting.attach(*
this);
115void ChakkariCopy::writeIO(
word ,
byte value, EmuTime::param )
117 byte diff = reg ^ value;
121 getCliComm().printInfo(getName(),
" COPY LED ",
122 (((value & 1) == 0x01) ?
"OFF" :
"ON"));
125 getCliComm().printInfo(getName(),
" PAUSE LED ",
126 (((value & 2) == 0x02) ?
"OFF" :
"ON"));
129 if (modeSetting.getEnum() == COPY) {
131 invalidateDeviceRWCache(0x0000, 0x4000);
159const byte* ChakkariCopy::getReadCacheLine(
word address)
const
161 if (modeSetting.getEnum() == COPY) {
163 if (address < 0x4000) {
164 return &biosRam[address];
167 if ((0x4000 <= address) && (address < 0x6000)) {
168 return &rom[address & 0x1FFF];
171 if ((0x6000 <= address) && (address < 0x8000)) {
172 return &workRam[address & 0x07FF];
176 if ((0x4000 <= address) && (address < 0x8000)) {
177 return &biosRam[address & 0x3FFF];
180 return unmappedRead.data();
188byte* ChakkariCopy::getWriteCacheLine(
word address)
190 if (modeSetting.getEnum() == COPY) {
192 if ((address < 0x4000) && ((reg & 0x04) == 0)) {
193 return &biosRam[address & 0x3FFF];
197 if ((0x6000 <= address) && (address < 0x8000)) {
198 return &workRam[address & 0x07FF];
202 if ((0x4000 <= address) && (address < 0x8000)) {
203 return &biosRam[address & 0x3FFF];
206 return unmappedWrite.data();