Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/devices/cpu/drcfe.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@ class drc_frontend_base
void release_descriptions();

// configuration parameters
u32 const m_window_start; // code window start offset = startpc - window_start
u32 const m_window_end; // code window end offset = startpc + window_end
u32 const m_max_sequence; // maximum instructions to include in a sequence
offs_t const m_window_start; // code window start offset = startpc - window_start
offs_t const m_window_end; // code window end offset = startpc + window_end
offs_t const m_max_sequence; // maximum instructions to include in a sequence

// CPU parameters
offs_t const m_pageshift; // shift to convert address to a page index
Expand Down
8 changes: 4 additions & 4 deletions src/devices/cpu/jaguar/jaguar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ inline u32 jaguar_cpu_device::READLONG(offs_t a)
// - pdrive $580e
if (!DWORD_ALIGNED(a))
{
if (a == std::clamp(a, (u32)0xf00000, (u32)0xf00fff) || a == std::clamp(a, (u32)0xf10000, (u32)0xf10fff))
if (a == std::clamp<offs_t>(a, 0xf00000, 0xf00fff) || a == std::clamp<offs_t>(a, 0xf10000, 0xf10fff))
{
//printf("%d: %08x R\n", m_isdsp, a);
u32 res = m_program.read_word(a) << 0;
Expand All @@ -98,7 +98,7 @@ inline u32 jaguar_cpu_device::READLONG(offs_t a)
return res;
}

//if (a == std::clamp(a, (u32)0xf03000, (u32)0xf03fff) || a == std::clamp(a, (u32)0xf1b000, (u32)0xf1cfff))
//if (a == std::clamp<offs_t>(a, 0xf03000, 0xf03fff) || a == std::clamp<offs_t>(a, 0xf1b000, 0xf1cfff))
// a &= ~3;
}

Expand All @@ -121,15 +121,15 @@ inline void jaguar_cpu_device::WRITELONG(offs_t a, u32 v)
// TODO: verify what happens on other accesses (just rolls over?)
if (!DWORD_ALIGNED(a))
{
if(a == std::clamp(a, (u32)0xf00000, (u32)0xf00fff) || a == std::clamp(a, (u32)0xf10000, (u32)0xf10fff))
if(a == std::clamp<offs_t>(a, 0xf00000, 0xf00fff) || a == std::clamp<offs_t>(a, 0xf10000, 0xf10fff))
{
//printf("%d: %08x %08x W\n", m_isdsp, a, v);
m_program.write_word(a, v & 0xffff);
m_program.write_word(a + 2, v >> 16);
return;
}

//if (a == std::clamp(a, (u32)0xf03000, (u32)0xf03fff) || a == std::clamp(a, (u32)0xf1b000, (u32)0xf1cfff))
//if (a == std::clamp<offs_t>(a, 0xf03000, 0xf03fff) || a == std::clamp<offs_t>(a, 0xf1b000, 0xf1cfff))
// a &= ~3;
}

Expand Down
8 changes: 4 additions & 4 deletions src/devices/cpu/m88000/m88000.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ enum dmt_mask : u32
constexpr static u32 DMT_EN() { return (DMT_EN3 | DMT_EN2 | DMT_EN1 | DMT_EN0); }

// return data memory transaction byte enables given data width and address
template <typename T> static u32 DMT_EN(u32 const address)
template <typename T> static u32 DMT_EN(offs_t const address)
{
return (((DMT_EN() << (4 - sizeof(T))) & DMT_EN()) >> (address & 3));
}
Expand Down Expand Up @@ -1537,7 +1537,7 @@ void mc88100_device::fetch(u32 &address, u32 &inst)
inst = m_code_space.read_dword(address & IP_A);
}

template <typename T, bool Usr> void mc88100_device::ld(u32 address, unsigned const reg)
template <typename T, bool Usr> void mc88100_device::ld(offs_t address, unsigned const reg)
{
// alignment check
if (address & (sizeof(T) - 1))
Expand Down Expand Up @@ -1658,7 +1658,7 @@ template <typename T, bool Usr> void mc88100_device::ld(u32 address, unsigned co
}
}

template <typename T, bool Usr> void mc88100_device::st(u32 address, unsigned const reg)
template <typename T, bool Usr> void mc88100_device::st(offs_t address, unsigned const reg)
{
// alignment check
if (address & (sizeof(T) - 1))
Expand Down Expand Up @@ -1748,7 +1748,7 @@ template <typename T, bool Usr> void mc88100_device::st(u32 address, unsigned co
}
}

template <typename T, bool Usr> void mc88100_device::xmem(u32 address, unsigned const reg)
template <typename T, bool Usr> void mc88100_device::xmem(offs_t address, unsigned const reg)
{
// alignment check
if (address & (sizeof(T) - 1))
Expand Down
14 changes: 7 additions & 7 deletions src/devices/cpu/m88000/m88000.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class mc88100_device : public cpu_device
// construction/destruction
mc88100_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock);

void set_cmmu_code(std::function<mc88200_device &(u32 const address)> f) { m_cmmu_code = f; }
void set_cmmu_data(std::function<mc88200_device &(u32 const address)> f) { m_cmmu_data = f; }
void set_cmmu_code(std::function<mc88200_device &(offs_t const address)> f) { m_cmmu_code = f; }
void set_cmmu_data(std::function<mc88200_device &(offs_t const address)> f) { m_cmmu_data = f; }

protected:
// device_t implementation
Expand All @@ -44,9 +44,9 @@ class mc88100_device : public cpu_device

// memory helpers
void fetch(u32 &address, u32 &inst);
template <typename T, bool Usr = false> void ld(u32 address, unsigned const reg);
template <typename T, bool Usr = false> void st(u32 address, unsigned const reg);
template <typename T, bool Usr = false> void xmem(u32 address, unsigned const reg);
template <typename T, bool Usr = false> void ld(offs_t address, unsigned const reg);
template <typename T, bool Usr = false> void st(offs_t address, unsigned const reg);
template <typename T, bool Usr = false> void xmem(offs_t address, unsigned const reg);

// integer helpers
void set_cr(unsigned const cr, u32 const data);
Expand All @@ -67,8 +67,8 @@ class mc88100_device : public cpu_device
memory_access<32, 2, 0, ENDIANNESS_BIG>::specific m_code_space;
memory_access<32, 2, 0, ENDIANNESS_BIG>::specific m_data_space;

std::function<mc88200_device &(u32 const address)> m_cmmu_code;
std::function<mc88200_device &(u32 const address)> m_cmmu_data;
std::function<mc88200_device &(offs_t const address)> m_cmmu_code;
std::function<mc88200_device &(offs_t const address)> m_cmmu_data;

// register storage
u32 m_xip; // execute instruction pointer
Expand Down
2 changes: 1 addition & 1 deletion src/devices/cpu/ns32000/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class ns32000_mmu_interface : public ns32000_slave_interface
{
public:
enum translate_result : unsigned { COMPLETE, CANCEL, ABORT };
virtual translate_result translate(address_space &space, unsigned st, u32 &address, bool user, bool write, bool flag = false, bool suppress = false) = 0;
virtual translate_result translate(address_space &space, unsigned st, offs_t &address, bool user, bool write, bool flag = false, bool suppress = false) = 0;

protected:
ns32000_mmu_interface(machine_config const &mconfig, device_t &device)
Expand Down
12 changes: 6 additions & 6 deletions src/devices/cpu/ns32000/ns32000.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,9 @@ template <int HighBits, int Width> void ns32000_device<HighBits, Width>::state_s
*
* Underlying handlers further subdivide accesses by device bus width.
*/
template <int HighBits, int Width> template<typename T> T ns32000_device<HighBits, Width>::mem_read(unsigned st, u32 address, bool user, bool pfs)
template <int HighBits, int Width> template<typename T> T ns32000_device<HighBits, Width>::mem_read(unsigned st, offs_t address, bool user, bool pfs)
{
u32 physical = address;
offs_t physical = address;
ns32000_mmu_interface::translate_result tr = m_mmu ?
m_mmu->translate(m_bus[st].space(), st, physical, (m_psr & PSR_U) || user, false, pfs) : ns32000_mmu_interface::COMPLETE;

Expand Down Expand Up @@ -348,9 +348,9 @@ template <int HighBits, int Width> template<typename T> T ns32000_device<HighBit
return 0;
}

template <int HighBits, int Width> template<typename T> void ns32000_device<HighBits, Width>::mem_write(unsigned st, u32 address, u64 data, bool user)
template <int HighBits, int Width> template<typename T> void ns32000_device<HighBits, Width>::mem_write(unsigned st, offs_t address, u64 data, bool user)
{
u32 physical = address;
offs_t physical = address;
ns32000_mmu_interface::translate_result tr = m_mmu ?
m_mmu->translate(m_bus[st].space(), st, physical, (m_psr & PSR_U) || user, true) : ns32000_mmu_interface::COMPLETE;

Expand Down Expand Up @@ -3947,7 +3947,7 @@ static constexpr u32 MSR(unsigned st, bool user, bool write, unsigned tex)
return u32(((st << 4) & MSR_STT) | (user ? MSR_UST : 0) | (write ? MSR_DDT : 0) | (tex & MSR_TEX));
}

ns32000_mmu_interface::translate_result ns32532_device::translate(address_space &space, unsigned st, u32 &address, bool user, bool write, bool rdwrval, bool suppress)
ns32000_mmu_interface::translate_result ns32532_device::translate(address_space &space, unsigned st, offs_t &address, bool user, bool write, bool rdwrval, bool suppress)
{
enum mcr_mask : u32
{
Expand Down Expand Up @@ -4188,7 +4188,7 @@ u16 ns32532_device::slave(u8 opbyte, u16 opword, addr_mode op1, addr_mode op2)
case 0: // rdval
case 1: // wrval
{
u32 address = ea(op1);
offs_t address = ea(op1);

switch (translate(space(AS_PROGRAM), ns32000::ST_ODT, address, true, BIT(opword, 2), true, true))
{
Expand Down
6 changes: 3 additions & 3 deletions src/devices/cpu/ns32000/ns32000.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ class ns32000_device : public cpu_device
};

// memory accessors
template <typename T> T mem_read(unsigned st, u32 address, bool user = false, bool pfs = false);
template <typename T> void mem_write(unsigned st, u32 address, u64 data, bool user = false);
template <typename T> T mem_read(unsigned st, offs_t address, bool user = false, bool pfs = false);
template <typename T> void mem_write(unsigned st, offs_t address, u64 data, bool user = false);

// instruction fetch/decode helpers
template <typename T> T fetch(unsigned &bytes);
Expand Down Expand Up @@ -227,7 +227,7 @@ class ns32532_device

// ns32000_mmu_interface implementation
virtual void state_add(device_state_interface &parent, int &index) override;
virtual translate_result translate(address_space &space, unsigned st, u32 &address, bool user, bool write, bool rdwrval = false, bool suppress = false) override;
virtual translate_result translate(address_space &space, unsigned st, offs_t &address, bool user, bool write, bool rdwrval = false, bool suppress = false) override;

protected:
// device_t implementation
Expand Down
2 changes: 1 addition & 1 deletion src/devices/cpu/rii/riidasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

using osd::u32;
using util::BIT;
using offs_t = u32;
using offs_t = u64;

// TODO: add register sets for other models
const char *const epg3231_disassembler::s_regs[0x60] =
Expand Down
52 changes: 26 additions & 26 deletions src/devices/cpu/romp/rsc.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,29 +37,29 @@ class rsc_bus_interface
RSC_PUT = 7,
};

virtual bool mem_load(u32 address, u8 &data, rsc_mode const mode = RSC_N, bool sp = false) = 0;
virtual bool mem_load(u32 address, u16 &data, rsc_mode const mode = RSC_N, bool sp = false) = 0;
virtual bool mem_load(u32 address, u32 &data, rsc_mode const mode = RSC_N, bool sp = false) = 0;
virtual bool mem_load(offs_t address, u8 &data, rsc_mode const mode = RSC_N, bool sp = false) = 0;
virtual bool mem_load(offs_t address, u16 &data, rsc_mode const mode = RSC_N, bool sp = false) = 0;
virtual bool mem_load(offs_t address, u32 &data, rsc_mode const mode = RSC_N, bool sp = false) = 0;

virtual bool mem_store(u32 address, u8 data, rsc_mode const mode = RSC_N, bool sp = false) = 0;
virtual bool mem_store(u32 address, u16 data, rsc_mode const mode = RSC_N, bool sp = false) = 0;
virtual bool mem_store(u32 address, u32 data, rsc_mode const mode = RSC_N, bool sp = false) = 0;
virtual bool mem_store(offs_t address, u8 data, rsc_mode const mode = RSC_N, bool sp = false) = 0;
virtual bool mem_store(offs_t address, u16 data, rsc_mode const mode = RSC_N, bool sp = false) = 0;
virtual bool mem_store(offs_t address, u32 data, rsc_mode const mode = RSC_N, bool sp = false) = 0;

virtual bool mem_modify(u32 address, std::function<u8(u8)> f, rsc_mode const mode = RSC_N) = 0;
virtual bool mem_modify(u32 address, std::function<u16(u16)> f, rsc_mode const mode = RSC_N) = 0;
virtual bool mem_modify(u32 address, std::function<u32(u32)> f, rsc_mode const mode = RSC_N) = 0;
virtual bool mem_modify(offs_t address, std::function<u8(u8)> f, rsc_mode const mode = RSC_N) = 0;
virtual bool mem_modify(offs_t address, std::function<u16(u16)> f, rsc_mode const mode = RSC_N) = 0;
virtual bool mem_modify(offs_t address, std::function<u32(u32)> f, rsc_mode const mode = RSC_N) = 0;

virtual bool pio_load(u32 address, u8 &data, rsc_mode const mode = RSC_N) = 0;
virtual bool pio_load(u32 address, u16 &data, rsc_mode const mode = RSC_N) = 0;
virtual bool pio_load(u32 address, u32 &data, rsc_mode const mode = RSC_N) = 0;
virtual bool pio_load(offs_t address, u8 &data, rsc_mode const mode = RSC_N) = 0;
virtual bool pio_load(offs_t address, u16 &data, rsc_mode const mode = RSC_N) = 0;
virtual bool pio_load(offs_t address, u32 &data, rsc_mode const mode = RSC_N) = 0;

virtual bool pio_store(u32 address, u8 data, rsc_mode const mode = RSC_N) = 0;
virtual bool pio_store(u32 address, u16 data, rsc_mode const mode = RSC_N) = 0;
virtual bool pio_store(u32 address, u32 data, rsc_mode const mode = RSC_N) = 0;
virtual bool pio_store(offs_t address, u8 data, rsc_mode const mode = RSC_N) = 0;
virtual bool pio_store(offs_t address, u16 data, rsc_mode const mode = RSC_N) = 0;
virtual bool pio_store(offs_t address, u32 data, rsc_mode const mode = RSC_N) = 0;

virtual bool pio_modify(u32 address, std::function<u8(u8)> f, rsc_mode const mode = RSC_N) = 0;
virtual bool pio_modify(u32 address, std::function<u16(u16)> f, rsc_mode const mode = RSC_N) = 0;
virtual bool pio_modify(u32 address, std::function<u32(u32)> f, rsc_mode const mode = RSC_N) = 0;
virtual bool pio_modify(offs_t address, std::function<u8(u8)> f, rsc_mode const mode = RSC_N) = 0;
virtual bool pio_modify(offs_t address, std::function<u16(u16)> f, rsc_mode const mode = RSC_N) = 0;
virtual bool pio_modify(offs_t address, std::function<u32(u32)> f, rsc_mode const mode = RSC_N) = 0;

protected:
rsc_bus_interface(machine_config const &mconfig, device_t &device, char const *type)
Expand All @@ -79,17 +79,17 @@ class rsc_cpu_interface
virtual ~rsc_cpu_interface() = default;

// cpu interface
virtual bool fetch(u32 address, u16 &data, rsc_mode const mode = RSC_N) = 0;
virtual bool translate(u32 &address) const = 0;
virtual bool fetch(offs_t address, u16 &data, rsc_mode const mode = RSC_N) = 0;
virtual bool translate(offs_t &address) const = 0;

// rsc_bus_interface overrides
virtual bool mem_load(u32 address, u8 &data, rsc_mode const mode = RSC_N, bool sp = true) override = 0;
virtual bool mem_load(u32 address, u16 &data, rsc_mode const mode = RSC_N, bool sp = true) override = 0;
virtual bool mem_load(u32 address, u32 &data, rsc_mode const mode = RSC_N, bool sp = true) override = 0;
virtual bool mem_load(offs_t address, u8 &data, rsc_mode const mode = RSC_N, bool sp = true) override = 0;
virtual bool mem_load(offs_t address, u16 &data, rsc_mode const mode = RSC_N, bool sp = true) override = 0;
virtual bool mem_load(offs_t address, u32 &data, rsc_mode const mode = RSC_N, bool sp = true) override = 0;

virtual bool mem_store(u32 address, u8 data, rsc_mode const mode = RSC_N, bool sp = true) override = 0;
virtual bool mem_store(u32 address, u16 data, rsc_mode const mode = RSC_N, bool sp = true) override = 0;
virtual bool mem_store(u32 address, u32 data, rsc_mode const mode = RSC_N, bool sp = true) override = 0;
virtual bool mem_store(offs_t address, u8 data, rsc_mode const mode = RSC_N, bool sp = true) override = 0;
virtual bool mem_store(offs_t address, u16 data, rsc_mode const mode = RSC_N, bool sp = true) override = 0;
virtual bool mem_store(offs_t address, u32 data, rsc_mode const mode = RSC_N, bool sp = true) override = 0;
};

#endif // MAME_CPU_ROMP_RSC_H
4 changes: 2 additions & 2 deletions src/devices/cpu/sharc/sharc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ void adsp21062_device::build_opcode_table()

/*****************************************************************************/

void adsp21062_device::external_iop_write(uint32_t address, uint32_t data)
void adsp21062_device::external_iop_write(offs_t address, uint32_t data)
{
// host packing mode used to determine width of external host bus width (16/32)
// if writing to external port DMA buffer, just write the data directly;
Expand Down Expand Up @@ -514,7 +514,7 @@ void adsp21062_device::external_iop_write(uint32_t address, uint32_t data)
}
}

void adsp21062_device::external_dma_write(uint32_t address, uint64_t data)
void adsp21062_device::external_dma_write(offs_t address, uint64_t data)
{
/*
All addresses in the 17-bit index registers are offset by 0x0002 0000, the
Expand Down
4 changes: 2 additions & 2 deletions src/devices/cpu/sharc/sharc.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class adsp21062_device : public cpu_device
void set_boot_mode(const sharc_boot_mode boot_mode) { m_boot_mode = boot_mode; }
void enable_recompiler();

void external_iop_write(uint32_t address, uint32_t data);
void external_dma_write(uint32_t address, uint64_t data);
void external_iop_write(offs_t address, uint32_t data);
void external_dma_write(offs_t address, uint64_t data);

void set_flag_input(int flag_num, int state);
void write_stall(int state);
Expand Down
2 changes: 1 addition & 1 deletion src/devices/cpu/sparc/sparc_intf.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class sparc_mmu_interface
{
public:
virtual ~sparc_mmu_interface() { }
virtual uint32_t fetch_insn(const bool supervisor, const uint32_t offset) = 0;
virtual uint32_t fetch_insn(const bool supervisor, const offs_t offset) = 0;
virtual void set_host(sparc_mmu_host_interface *host) = 0;
};

Expand Down
Loading
Loading