mirror of
https://github.com/holub/mame
synced 2025-10-06 17:08:28 +03:00
tms32025: Use the standard memory interfaces [O. Galibert]
This commit is contained in:
parent
3bee09d534
commit
ab27807d72
File diff suppressed because it is too large
Load Diff
@ -82,7 +82,7 @@ class tms32025_device : public cpu_device
|
|||||||
public:
|
public:
|
||||||
// construction/destruction
|
// construction/destruction
|
||||||
tms32025_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
tms32025_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||||
tms32025_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
|
tms32025_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source, address_map_constructor map);
|
||||||
|
|
||||||
// static configuration helpers
|
// static configuration helpers
|
||||||
template<class _Object> static devcb_base & set_bio_in_cb(device_t &device, _Object object) { return downcast<tms32025_device &>(device).m_bio_in.set_callback(object); }
|
template<class _Object> static devcb_base & set_bio_in_cb(device_t &device, _Object object) { return downcast<tms32025_device &>(device).m_bio_in.set_callback(object); }
|
||||||
@ -92,6 +92,19 @@ public:
|
|||||||
template<class _Object> static devcb_base & set_dr_in_cb(device_t &device, _Object object) { return downcast<tms32025_device &>(device).m_dr_in.set_callback(object); }
|
template<class _Object> static devcb_base & set_dr_in_cb(device_t &device, _Object object) { return downcast<tms32025_device &>(device).m_dr_in.set_callback(object); }
|
||||||
template<class _Object> static devcb_base & set_dx_out_cb(device_t &device, _Object object) { return downcast<tms32025_device &>(device).m_dx_out.set_callback(object); }
|
template<class _Object> static devcb_base & set_dx_out_cb(device_t &device, _Object object) { return downcast<tms32025_device &>(device).m_dx_out.set_callback(object); }
|
||||||
|
|
||||||
|
DECLARE_READ16_MEMBER( drr_r);
|
||||||
|
DECLARE_WRITE16_MEMBER(drr_w);
|
||||||
|
DECLARE_READ16_MEMBER( dxr_r);
|
||||||
|
DECLARE_WRITE16_MEMBER(dxr_w);
|
||||||
|
DECLARE_READ16_MEMBER( tim_r);
|
||||||
|
DECLARE_WRITE16_MEMBER(tim_w);
|
||||||
|
DECLARE_READ16_MEMBER( prd_r);
|
||||||
|
DECLARE_WRITE16_MEMBER(prd_w);
|
||||||
|
DECLARE_READ16_MEMBER( imr_r);
|
||||||
|
DECLARE_WRITE16_MEMBER(imr_w);
|
||||||
|
DECLARE_READ16_MEMBER( greg_r);
|
||||||
|
DECLARE_WRITE16_MEMBER(greg_w);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// device-level overrides
|
// device-level overrides
|
||||||
virtual void device_start() override;
|
virtual void device_start() override;
|
||||||
@ -106,13 +119,8 @@ protected:
|
|||||||
|
|
||||||
// device_memory_interface overrides
|
// device_memory_interface overrides
|
||||||
virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return (spacenum == AS_PROGRAM) ? &m_program_config : ( (spacenum == AS_IO) ? &m_io_config : ( (spacenum == AS_DATA) ? &m_data_config : nullptr ) ); }
|
virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override { return (spacenum == AS_PROGRAM) ? &m_program_config : ( (spacenum == AS_IO) ? &m_io_config : ( (spacenum == AS_DATA) ? &m_data_config : nullptr ) ); }
|
||||||
virtual bool memory_read(address_spacenum spacenum, offs_t offset, int size, uint64_t &value) override;
|
|
||||||
virtual bool memory_write(address_spacenum spacenum, offs_t offset, int size, uint64_t value) override;
|
|
||||||
virtual bool memory_readop(offs_t offset, int size, uint64_t &value) override;
|
|
||||||
|
|
||||||
// device_state_interface overrides
|
// device_state_interface overrides
|
||||||
virtual void state_import(const device_state_entry &entry) override;
|
|
||||||
virtual void state_export(const device_state_entry &entry) override;
|
|
||||||
virtual void state_string_export(const device_state_entry &entry, std::string &str) const override;
|
virtual void state_string_export(const device_state_entry &entry, std::string &str) const override;
|
||||||
|
|
||||||
// device_disasm_interface overrides
|
// device_disasm_interface overrides
|
||||||
@ -120,11 +128,22 @@ protected:
|
|||||||
virtual uint32_t disasm_max_opcode_bytes() const override { return 4; }
|
virtual uint32_t disasm_max_opcode_bytes() const override { return 4; }
|
||||||
virtual offs_t disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override;
|
virtual offs_t disasm_disassemble(std::ostream &stream, offs_t pc, const uint8_t *oprom, const uint8_t *opram, uint32_t options) override;
|
||||||
|
|
||||||
private:
|
void common_reset();
|
||||||
|
|
||||||
address_space_config m_program_config;
|
address_space_config m_program_config;
|
||||||
address_space_config m_data_config;
|
address_space_config m_data_config;
|
||||||
address_space_config m_io_config;
|
address_space_config m_io_config;
|
||||||
|
|
||||||
|
required_shared_ptr<uint16_t> m_b0;
|
||||||
|
required_shared_ptr<uint16_t> m_b1;
|
||||||
|
required_shared_ptr<uint16_t> m_b2;
|
||||||
|
optional_shared_ptr<uint16_t> m_b3;
|
||||||
|
|
||||||
|
address_space *m_program;
|
||||||
|
direct_read_data *m_direct;
|
||||||
|
address_space *m_data;
|
||||||
|
address_space *m_io;
|
||||||
|
|
||||||
typedef void ( tms32025_device::*opcode_func ) ();
|
typedef void ( tms32025_device::*opcode_func ) ();
|
||||||
struct tms32025_opcode
|
struct tms32025_opcode
|
||||||
{
|
{
|
||||||
@ -156,9 +175,8 @@ private:
|
|||||||
uint16_t m_AR[8];
|
uint16_t m_AR[8];
|
||||||
uint16_t m_STACK[8];
|
uint16_t m_STACK[8];
|
||||||
PAIR m_ALU;
|
PAIR m_ALU;
|
||||||
protected:
|
uint16_t m_drr, m_dxr, m_tim, m_prd, m_imr, m_greg;
|
||||||
uint16_t m_intRAM[0x800];
|
|
||||||
private:
|
|
||||||
uint8_t m_timerover;
|
uint8_t m_timerover;
|
||||||
|
|
||||||
/********************** Status data ****************************/
|
/********************** Status data ****************************/
|
||||||
@ -176,18 +194,6 @@ private:
|
|||||||
int m_mHackIgnoreARP; /* special handling for lst, lst1 instructions */
|
int m_mHackIgnoreARP; /* special handling for lst, lst1 instructions */
|
||||||
int m_waiting_for_serial_frame;
|
int m_waiting_for_serial_frame;
|
||||||
|
|
||||||
address_space *m_program;
|
|
||||||
direct_read_data *m_direct;
|
|
||||||
address_space *m_data;
|
|
||||||
address_space *m_io;
|
|
||||||
|
|
||||||
uint16_t *m_pgmmap[0x200];
|
|
||||||
protected:
|
|
||||||
uint16_t *m_datamap[0x200];
|
|
||||||
|
|
||||||
private:
|
|
||||||
uint32_t m_debugger_temp;
|
|
||||||
|
|
||||||
inline void CLR0(uint16_t flag);
|
inline void CLR0(uint16_t flag);
|
||||||
inline void SET0(uint16_t flag);
|
inline void SET0(uint16_t flag);
|
||||||
inline void CLR1(uint16_t flag);
|
inline void CLR1(uint16_t flag);
|
||||||
@ -250,9 +256,9 @@ private:
|
|||||||
void call();
|
void call();
|
||||||
void cmpl();
|
void cmpl();
|
||||||
void cmpr();
|
void cmpr();
|
||||||
void cnfd();
|
virtual void cnfd();
|
||||||
void cnfp();
|
virtual void cnfp();
|
||||||
void conf();
|
virtual void conf();
|
||||||
void dint();
|
void dint();
|
||||||
void dmov();
|
void dmov();
|
||||||
void eint();
|
void eint();
|
||||||
@ -380,6 +386,9 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void device_reset() override;
|
virtual void device_reset() override;
|
||||||
|
virtual void cnfd() override;
|
||||||
|
virtual void cnfp() override;
|
||||||
|
virtual void conf() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user