mame/src/emu/dirom.h
Vas Crabb 8179a84458 Introduce u8/u16/u32/u64/s8/s16/s32/s64
* New abbreviated types are in osd and util namespaces, and also in global namespace for things that #include "emu.h"
* Get rid of import of cstdint types to global namespace (C99 does this anyway)
* Remove the cstdint types from everything in emu
* Get rid of U64/S64 macros
* Fix a bug in dps16 caused by incorrect use of macro
* Fix debugcon not checking for "do " prefix case-insensitively
* Fix a lot of messed up tabulation
* More constexpr
* Fix up many __names
2016-11-19 05:38:48 +11:00

56 lines
1.6 KiB
C++

// license:BSD-3-Clause
// copyright-holders:Olivier Galibert
/***************************************************************************
dirom.h
Interface to a rom, either through a memory map or a region
***************************************************************************/
#pragma once
#ifndef __EMU_H__
#error Dont include this file directly; include emu.h instead.
#endif
#ifndef MAME_EMU_DIROM_H
#define MAME_EMU_DIROM_H
class device_rom_interface : public device_memory_interface
{
public:
device_rom_interface(const machine_config &mconfig, device_t &device, u8 addrwidth, endianness_t endian = ENDIANNESS_LITTLE, u8 datawidth = 8);
virtual ~device_rom_interface();
inline u8 read_byte(offs_t byteaddress) { return m_rom_direct->read_byte(byteaddress); }
inline u16 read_word(offs_t byteaddress) { return m_rom_direct->read_word(byteaddress); }
inline u32 read_dword(offs_t byteaddress) { return m_rom_direct->read_dword(byteaddress); }
inline u64 read_qword(offs_t byteaddress) { return m_rom_direct->read_qword(byteaddress); }
void set_rom(const void *base, u32 size);
void set_rom_bank(int bank);
protected:
virtual void rom_bank_updated() = 0;
private:
const address_space_config m_rom_config;
direct_read_data *m_rom_direct;
memory_bank *m_bank;
int m_cur_bank, m_bank_count;
virtual const address_space_config *memory_space_config(address_spacenum spacenum) const override;
virtual void interface_pre_start() override;
DECLARE_READ8_MEMBER(z8_r);
DECLARE_READ16_MEMBER(z16_r);
DECLARE_READ32_MEMBER(z32_r);
DECLARE_READ64_MEMBER(z64_r);
void reset_bank();
};
#endif // MAME_EMU_DIROM_H