53 lines
2.2 KiB
C++
53 lines
2.2 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/>.
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//=============================================================//
|
|
// This defines the callbacks used by all cartridges (plugins) //
|
|
//=============================================================//
|
|
|
|
#pragma once
|
|
#include "../../../../../src/core/Interrupts.h"
|
|
#include <cstddef> // for std::size_t
|
|
|
|
//----------------------------------------------------------------
|
|
// ABI identity is based on SlotId; 0 = Boot Slot, 1-4 = MPI slots
|
|
//----------------------------------------------------------------
|
|
using slot_id_type = std::size_t;
|
|
|
|
extern "C"
|
|
{
|
|
using PakWriteMemoryByteHostCallback = void (*)
|
|
(slot_id_type SlotId, unsigned char value, unsigned short address);
|
|
using PakReadMemoryByteHostCallback = unsigned char (*)
|
|
(slot_id_type SlotId, unsigned short address);
|
|
using PakAssertCartridgeLineHostCallback = void (*)
|
|
(slot_id_type SlotId, bool lineState);
|
|
using PakAssertInteruptHostCallback = void (*)
|
|
(slot_id_type SlotId, Interrupt interrupt, InterruptSource interrupt_source);
|
|
|
|
// Plugin (cartridge) callbacks
|
|
struct cpak_callbacks
|
|
{
|
|
const PakAssertInteruptHostCallback assert_interrupt;
|
|
const PakAssertCartridgeLineHostCallback assert_cartridge_line;
|
|
const PakWriteMemoryByteHostCallback write_memory_byte;
|
|
const PakReadMemoryByteHostCallback read_memory_byte;
|
|
};
|
|
}
|
|
|