Skip to content

Commit 8a85a8f

Browse files
author
MooglyGuy
committed
Redoing offs_t to 64-bits expansion.
1 parent af9ef3f commit 8a85a8f

47 files changed

Lines changed: 421 additions & 547 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/devices/cpu/drcfe.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,9 @@ class drc_frontend_base
204204
void release_descriptions();
205205

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

211211
// CPU parameters
212212
offs_t const m_pageshift; // shift to convert address to a page index

src/devices/cpu/jaguar/jaguar.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ inline u32 jaguar_cpu_device::READLONG(offs_t a)
8888
// - pdrive $580e
8989
if (!DWORD_ALIGNED(a))
9090
{
91-
if (a == std::clamp(a, (u32)0xf00000, (u32)0xf00fff) || a == std::clamp(a, (u32)0xf10000, (u32)0xf10fff))
91+
if (a == std::clamp(a, 0xf00000ULL, 0xf00fffULL) || a == std::clamp(a, 0xf10000ULL, 0xf10fffULL))
9292
{
9393
//printf("%d: %08x R\n", m_isdsp, a);
9494
u32 res = m_program.read_word(a) << 0;
@@ -98,7 +98,7 @@ inline u32 jaguar_cpu_device::READLONG(offs_t a)
9898
return res;
9999
}
100100

101-
//if (a == std::clamp(a, (u32)0xf03000, (u32)0xf03fff) || a == std::clamp(a, (u32)0xf1b000, (u32)0xf1cfff))
101+
//if (a == std::clamp(a, 0xf03000ULL, 0xf03fffULL) || a == std::clamp(a, 0xf1b000ULL, 0xf1cfffULL))
102102
// a &= ~3;
103103
}
104104

@@ -121,15 +121,15 @@ inline void jaguar_cpu_device::WRITELONG(offs_t a, u32 v)
121121
// TODO: verify what happens on other accesses (just rolls over?)
122122
if (!DWORD_ALIGNED(a))
123123
{
124-
if(a == std::clamp(a, (u32)0xf00000, (u32)0xf00fff) || a == std::clamp(a, (u32)0xf10000, (u32)0xf10fff))
124+
if(a == std::clamp(a, 0xf00000ULL, 0xf00fffULL) || a == std::clamp(a, 0xf10000ULL, 0xf10fffULL))
125125
{
126126
//printf("%d: %08x %08x W\n", m_isdsp, a, v);
127127
m_program.write_word(a, v & 0xffff);
128128
m_program.write_word(a + 2, v >> 16);
129129
return;
130130
}
131131

132-
//if (a == std::clamp(a, (u32)0xf03000, (u32)0xf03fff) || a == std::clamp(a, (u32)0xf1b000, (u32)0xf1cfff))
132+
//if (a == std::clamp(a, 0xf03000ULL, 0xf03fffULL) || a == std::clamp(a, 0xf1b000ULL, 0xf1cfffULL))
133133
// a &= ~3;
134134
}
135135

src/devices/cpu/m88000/m88000.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ enum dmt_mask : u32
136136
constexpr static u32 DMT_EN() { return (DMT_EN3 | DMT_EN2 | DMT_EN1 | DMT_EN0); }
137137

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

1540-
template <typename T, bool Usr> void mc88100_device::ld(u32 address, unsigned const reg)
1540+
template <typename T, bool Usr> void mc88100_device::ld(offs_t address, unsigned const reg)
15411541
{
15421542
// alignment check
15431543
if (address & (sizeof(T) - 1))
@@ -1658,7 +1658,7 @@ template <typename T, bool Usr> void mc88100_device::ld(u32 address, unsigned co
16581658
}
16591659
}
16601660

1661-
template <typename T, bool Usr> void mc88100_device::st(u32 address, unsigned const reg)
1661+
template <typename T, bool Usr> void mc88100_device::st(offs_t address, unsigned const reg)
16621662
{
16631663
// alignment check
16641664
if (address & (sizeof(T) - 1))
@@ -1748,7 +1748,7 @@ template <typename T, bool Usr> void mc88100_device::st(u32 address, unsigned co
17481748
}
17491749
}
17501750

1751-
template <typename T, bool Usr> void mc88100_device::xmem(u32 address, unsigned const reg)
1751+
template <typename T, bool Usr> void mc88100_device::xmem(offs_t address, unsigned const reg)
17521752
{
17531753
// alignment check
17541754
if (address & (sizeof(T) - 1))

src/devices/cpu/m88000/m88000.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ class mc88100_device : public cpu_device
2020
// construction/destruction
2121
mc88100_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock);
2222

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

2626
protected:
2727
// device_t implementation
@@ -44,9 +44,9 @@ class mc88100_device : public cpu_device
4444

4545
// memory helpers
4646
void fetch(u32 &address, u32 &inst);
47-
template <typename T, bool Usr = false> void ld(u32 address, unsigned const reg);
48-
template <typename T, bool Usr = false> void st(u32 address, unsigned const reg);
49-
template <typename T, bool Usr = false> void xmem(u32 address, unsigned const reg);
47+
template <typename T, bool Usr = false> void ld(offs_t address, unsigned const reg);
48+
template <typename T, bool Usr = false> void st(offs_t address, unsigned const reg);
49+
template <typename T, bool Usr = false> void xmem(offs_t address, unsigned const reg);
5050

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

70-
std::function<mc88200_device &(u32 const address)> m_cmmu_code;
71-
std::function<mc88200_device &(u32 const address)> m_cmmu_data;
70+
std::function<mc88200_device &(offs_t const address)> m_cmmu_code;
71+
std::function<mc88200_device &(offs_t const address)> m_cmmu_data;
7272

7373
// register storage
7474
u32 m_xip; // execute instruction pointer

src/devices/cpu/ns32000/common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class ns32000_mmu_interface : public ns32000_slave_interface
8787
{
8888
public:
8989
enum translate_result : unsigned { COMPLETE, CANCEL, ABORT };
90-
virtual translate_result translate(address_space &space, unsigned st, u32 &address, bool user, bool write, bool flag = false, bool suppress = false) = 0;
90+
virtual translate_result translate(address_space &space, unsigned st, offs_t &address, bool user, bool write, bool flag = false, bool suppress = false) = 0;
9191

9292
protected:
9393
ns32000_mmu_interface(machine_config const &mconfig, device_t &device)

src/devices/cpu/ns32000/ns32000.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,9 @@ template <int HighBits, int Width> void ns32000_device<HighBits, Width>::state_s
263263
*
264264
* Underlying handlers further subdivide accesses by device bus width.
265265
*/
266-
template <int HighBits, int Width> template<typename T> T ns32000_device<HighBits, Width>::mem_read(unsigned st, u32 address, bool user, bool pfs)
266+
template <int HighBits, int Width> template<typename T> T ns32000_device<HighBits, Width>::mem_read(unsigned st, offs_t address, bool user, bool pfs)
267267
{
268-
u32 physical = address;
268+
offs_t physical = address;
269269
ns32000_mmu_interface::translate_result tr = m_mmu ?
270270
m_mmu->translate(m_bus[st].space(), st, physical, (m_psr & PSR_U) || user, false, pfs) : ns32000_mmu_interface::COMPLETE;
271271

@@ -348,9 +348,9 @@ template <int HighBits, int Width> template<typename T> T ns32000_device<HighBit
348348
return 0;
349349
}
350350

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

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

3950-
ns32000_mmu_interface::translate_result ns32532_device::translate(address_space &space, unsigned st, u32 &address, bool user, bool write, bool rdwrval, bool suppress)
3950+
ns32000_mmu_interface::translate_result ns32532_device::translate(address_space &space, unsigned st, offs_t &address, bool user, bool write, bool rdwrval, bool suppress)
39513951
{
39523952
enum mcr_mask : u32
39533953
{
@@ -4188,7 +4188,7 @@ u16 ns32532_device::slave(u8 opbyte, u16 opword, addr_mode op1, addr_mode op2)
41884188
case 0: // rdval
41894189
case 1: // wrval
41904190
{
4191-
u32 address = ea(op1);
4191+
offs_t address = ea(op1);
41924192

41934193
switch (translate(space(AS_PROGRAM), ns32000::ST_ODT, address, true, BIT(opword, 2), true, true))
41944194
{

src/devices/cpu/ns32000/ns32000.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ class ns32000_device : public cpu_device
117117
};
118118

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

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

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

232232
protected:
233233
// device_t implementation

src/devices/cpu/rii/riidasm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
using osd::u32;
1616
using util::BIT;
17-
using offs_t = u32;
17+
using offs_t = u64;
1818

1919
// TODO: add register sets for other models
2020
const char *const epg3231_disassembler::s_regs[0x60] =

src/devices/cpu/romp/rsc.h

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -37,29 +37,29 @@ class rsc_bus_interface
3737
RSC_PUT = 7,
3838
};
3939

40-
virtual bool mem_load(u32 address, u8 &data, rsc_mode const mode = RSC_N, bool sp = false) = 0;
41-
virtual bool mem_load(u32 address, u16 &data, rsc_mode const mode = RSC_N, bool sp = false) = 0;
42-
virtual bool mem_load(u32 address, u32 &data, rsc_mode const mode = RSC_N, bool sp = false) = 0;
40+
virtual bool mem_load(offs_t address, u8 &data, rsc_mode const mode = RSC_N, bool sp = false) = 0;
41+
virtual bool mem_load(offs_t address, u16 &data, rsc_mode const mode = RSC_N, bool sp = false) = 0;
42+
virtual bool mem_load(offs_t address, u32 &data, rsc_mode const mode = RSC_N, bool sp = false) = 0;
4343

44-
virtual bool mem_store(u32 address, u8 data, rsc_mode const mode = RSC_N, bool sp = false) = 0;
45-
virtual bool mem_store(u32 address, u16 data, rsc_mode const mode = RSC_N, bool sp = false) = 0;
46-
virtual bool mem_store(u32 address, u32 data, rsc_mode const mode = RSC_N, bool sp = false) = 0;
44+
virtual bool mem_store(offs_t address, u8 data, rsc_mode const mode = RSC_N, bool sp = false) = 0;
45+
virtual bool mem_store(offs_t address, u16 data, rsc_mode const mode = RSC_N, bool sp = false) = 0;
46+
virtual bool mem_store(offs_t address, u32 data, rsc_mode const mode = RSC_N, bool sp = false) = 0;
4747

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

52-
virtual bool pio_load(u32 address, u8 &data, rsc_mode const mode = RSC_N) = 0;
53-
virtual bool pio_load(u32 address, u16 &data, rsc_mode const mode = RSC_N) = 0;
54-
virtual bool pio_load(u32 address, u32 &data, rsc_mode const mode = RSC_N) = 0;
52+
virtual bool pio_load(offs_t address, u8 &data, rsc_mode const mode = RSC_N) = 0;
53+
virtual bool pio_load(offs_t address, u16 &data, rsc_mode const mode = RSC_N) = 0;
54+
virtual bool pio_load(offs_t address, u32 &data, rsc_mode const mode = RSC_N) = 0;
5555

56-
virtual bool pio_store(u32 address, u8 data, rsc_mode const mode = RSC_N) = 0;
57-
virtual bool pio_store(u32 address, u16 data, rsc_mode const mode = RSC_N) = 0;
58-
virtual bool pio_store(u32 address, u32 data, rsc_mode const mode = RSC_N) = 0;
56+
virtual bool pio_store(offs_t address, u8 data, rsc_mode const mode = RSC_N) = 0;
57+
virtual bool pio_store(offs_t address, u16 data, rsc_mode const mode = RSC_N) = 0;
58+
virtual bool pio_store(offs_t address, u32 data, rsc_mode const mode = RSC_N) = 0;
5959

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

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

8181
// cpu interface
82-
virtual bool fetch(u32 address, u16 &data, rsc_mode const mode = RSC_N) = 0;
83-
virtual bool translate(u32 &address) const = 0;
82+
virtual bool fetch(offs_t address, u16 &data, rsc_mode const mode = RSC_N) = 0;
83+
virtual bool translate(offs_t &address) const = 0;
8484

8585
// rsc_bus_interface overrides
86-
virtual bool mem_load(u32 address, u8 &data, rsc_mode const mode = RSC_N, bool sp = true) override = 0;
87-
virtual bool mem_load(u32 address, u16 &data, rsc_mode const mode = RSC_N, bool sp = true) override = 0;
88-
virtual bool mem_load(u32 address, u32 &data, rsc_mode const mode = RSC_N, bool sp = true) override = 0;
86+
virtual bool mem_load(offs_t address, u8 &data, rsc_mode const mode = RSC_N, bool sp = true) override = 0;
87+
virtual bool mem_load(offs_t address, u16 &data, rsc_mode const mode = RSC_N, bool sp = true) override = 0;
88+
virtual bool mem_load(offs_t address, u32 &data, rsc_mode const mode = RSC_N, bool sp = true) override = 0;
8989

90-
virtual bool mem_store(u32 address, u8 data, rsc_mode const mode = RSC_N, bool sp = true) override = 0;
91-
virtual bool mem_store(u32 address, u16 data, rsc_mode const mode = RSC_N, bool sp = true) override = 0;
92-
virtual bool mem_store(u32 address, u32 data, rsc_mode const mode = RSC_N, bool sp = true) override = 0;
90+
virtual bool mem_store(offs_t address, u8 data, rsc_mode const mode = RSC_N, bool sp = true) override = 0;
91+
virtual bool mem_store(offs_t address, u16 data, rsc_mode const mode = RSC_N, bool sp = true) override = 0;
92+
virtual bool mem_store(offs_t address, u32 data, rsc_mode const mode = RSC_N, bool sp = true) override = 0;
9393
};
9494

9595
#endif // MAME_CPU_ROMP_RSC_H

src/devices/cpu/sharc/sharc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ void adsp21062_device::build_opcode_table()
481481

482482
/*****************************************************************************/
483483

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

517-
void adsp21062_device::external_dma_write(uint32_t address, uint64_t data)
517+
void adsp21062_device::external_dma_write(offs_t address, uint64_t data)
518518
{
519519
/*
520520
All addresses in the 17-bit index registers are offset by 0x0002 0000, the

0 commit comments

Comments
 (0)