Files
VCCPlusOSS/platforms/windows/libcommon/vcc/bus/rom_cartridge.h
T

68 lines
2.1 KiB
C++

////////////////////////////////////////////////////////////////////////////////
// Copyright 2015 by Joseph Forgione
// This file is part of VCC (Virtual Color Computer).
//
// VCC (Virtual Color Computer) is free software: you can redistribute itand/or
// modify it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or (at your
// option) any later version.
//
// VCC (Virtual Color Computer) is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
// Public License for more details.
//
// You should have received a copy of the GNU General Public License along with
// VCC (Virtual Color Computer). If not, see <http://www.gnu.org/licenses/>.
////////////////////////////////////////////////////////////////////////////////
#pragma once
#include <vcc/bus/basic_cartridge.h>
#include <vcc/bus/cartridge_callbacks.h> //depreciated
#include <vcc/bus/plugin_callbacks.h>
#include <vector>
#include <memory>
namespace VCC::Core
{
class rom_cartridge : public basic_cartridge
{
public:
using callbacks_type = ::VCC::Core::cartridge_callbacks;
using buffer_type = std::vector<uint8_t>;
using size_type = std::size_t;
public:
using basic_cartridge::basic_cartridge;
rom_cartridge(
const cpak_callbacks& callbacks,
name_type name,
catalog_id_type catalog_id,
buffer_type buffer,
bool enable_bank_switching,
slot_id_type slotId
);
name_type name() const override;
catalog_id_type catalog_id() const override;
description_type description() const override;
void reset() override;
void write_port(unsigned char port_id, unsigned char value) override;
unsigned char read_memory_byte(unsigned short memory_address) override;
protected:
void initialize_bus() override;
private:
const cpak_callbacks& callbacks_;
const name_type name_;
const catalog_id_type catalog_id_;
const buffer_type buffer_;
const bool enable_bank_switching_;
size_type bank_offset_;
const std::string filename_;
slot_id_type slotId_;
};
}