summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/vic20
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/vic20')
-rw-r--r--src/devices/bus/vic20/exp.cpp7
-rw-r--r--src/devices/bus/vic20/exp.h9
-rw-r--r--src/devices/bus/vic20/fe3.cpp4
-rw-r--r--src/devices/bus/vic20/fe3.h2
-rw-r--r--src/devices/bus/vic20/megacart.cpp3
-rw-r--r--src/devices/bus/vic20/megacart.h5
-rw-r--r--src/devices/bus/vic20/vic1110.cpp4
-rw-r--r--src/devices/bus/vic20/vic1110.h2
-rw-r--r--src/devices/bus/vic20/vic1111.cpp4
-rw-r--r--src/devices/bus/vic20/vic1111.h2
-rw-r--r--src/devices/bus/vic20/vic1210.cpp4
-rw-r--r--src/devices/bus/vic20/vic1210.h2
-rw-r--r--src/devices/bus/vic20/videopak.cpp7
-rw-r--r--src/devices/bus/vic20/videopak.h4
14 files changed, 21 insertions, 38 deletions
diff --git a/src/devices/bus/vic20/exp.cpp b/src/devices/bus/vic20/exp.cpp
index 7751ff4bc81..c7f0120b25f 100644
--- a/src/devices/bus/vic20/exp.cpp
+++ b/src/devices/bus/vic20/exp.cpp
@@ -28,12 +28,7 @@ DEFINE_DEVICE_TYPE(VIC20_EXPANSION_SLOT, vic20_expansion_slot_device, "vic20_exp
//-------------------------------------------------
device_vic20_expansion_card_interface::device_vic20_expansion_card_interface(const machine_config &mconfig, device_t &device)
- : device_interface(device, "vic20exp"),
- m_blk1(*this, "blk1"),
- m_blk2(*this, "blk2"),
- m_blk3(*this, "blk3"),
- m_blk5(*this, "blk5"),
- m_nvram(*this, "nvram")
+ : device_interface(device, "vic20exp")
{
m_slot = dynamic_cast<vic20_expansion_slot_device *>(device.owner());
}
diff --git a/src/devices/bus/vic20/exp.h b/src/devices/bus/vic20/exp.h
index b643c9089b2..96583a29577 100644
--- a/src/devices/bus/vic20/exp.h
+++ b/src/devices/bus/vic20/exp.h
@@ -134,11 +134,10 @@ public:
protected:
device_vic20_expansion_card_interface(const machine_config &mconfig, device_t &device);
- optional_shared_ptr<uint8_t> m_blk1;
- optional_shared_ptr<uint8_t> m_blk2;
- optional_shared_ptr<uint8_t> m_blk3;
- optional_shared_ptr<uint8_t> m_blk5;
- optional_shared_ptr<uint8_t> m_nvram;
+ std::unique_ptr<uint8_t[]> m_blk1;
+ std::unique_ptr<uint8_t[]> m_blk2;
+ std::unique_ptr<uint8_t[]> m_blk3;
+ std::unique_ptr<uint8_t[]> m_blk5;
vic20_expansion_slot_device *m_slot;
};
diff --git a/src/devices/bus/vic20/fe3.cpp b/src/devices/bus/vic20/fe3.cpp
index f008bec3cb8..230dc076bb4 100644
--- a/src/devices/bus/vic20/fe3.cpp
+++ b/src/devices/bus/vic20/fe3.cpp
@@ -105,7 +105,7 @@ vic20_final_expansion_3_device::vic20_final_expansion_3_device(const machine_con
device_t(mconfig, VIC20_FE3, tag, owner, clock),
device_vic20_expansion_card_interface(mconfig, *this),
m_flash_rom(*this, AM29F040_TAG),
- m_ram(*this, "sram"), m_reg1(0), m_reg2(0), m_lockbit(0)
+ m_ram(*this, "sram", 0x80000, ENDIANNESS_LITTLE), m_reg1(0), m_reg2(0), m_lockbit(0)
{
}
@@ -116,8 +116,6 @@ vic20_final_expansion_3_device::vic20_final_expansion_3_device(const machine_con
void vic20_final_expansion_3_device::device_start()
{
- m_ram.allocate(0x80000);
-
// state saving
save_item(NAME(m_reg1));
save_item(NAME(m_reg2));
diff --git a/src/devices/bus/vic20/fe3.h b/src/devices/bus/vic20/fe3.h
index 018ef2617b6..c82fff2f7ee 100644
--- a/src/devices/bus/vic20/fe3.h
+++ b/src/devices/bus/vic20/fe3.h
@@ -77,7 +77,7 @@ private:
void write_register(offs_t offset, uint8_t data);
required_device<amd_29f040_device> m_flash_rom;
- optional_shared_ptr<uint8_t> m_ram;
+ memory_share_creator<uint8_t> m_ram;
uint8_t m_reg1;
uint8_t m_reg2;
diff --git a/src/devices/bus/vic20/megacart.cpp b/src/devices/bus/vic20/megacart.cpp
index 8094adfba2b..21171bf4343 100644
--- a/src/devices/bus/vic20/megacart.cpp
+++ b/src/devices/bus/vic20/megacart.cpp
@@ -39,6 +39,7 @@ vic20_megacart_device::vic20_megacart_device(const machine_config &mconfig, cons
: device_t(mconfig, VIC20_MEGACART, tag, owner, clock)
, device_vic20_expansion_card_interface(mconfig, *this)
, device_nvram_interface(mconfig, *this)
+ , m_nvram(*this, "nvram", 0x2000, ENDIANNESS_LITTLE)
, m_nvram_en(0)
{
}
@@ -50,8 +51,6 @@ vic20_megacart_device::vic20_megacart_device(const machine_config &mconfig, cons
void vic20_megacart_device::device_start()
{
- m_nvram.allocate(0x2000);
-
// state saving
save_item(NAME(m_nvram_en));
}
diff --git a/src/devices/bus/vic20/megacart.h b/src/devices/bus/vic20/megacart.h
index 52f5182fc3c..08e3ef0a59b 100644
--- a/src/devices/bus/vic20/megacart.h
+++ b/src/devices/bus/vic20/megacart.h
@@ -39,14 +39,15 @@ protected:
// device_nvram_interface overrides
virtual void nvram_default() override { }
- virtual void nvram_read(emu_file &file) override { file.read(m_nvram, m_nvram.bytes()); }
- virtual void nvram_write(emu_file &file) override { file.write(m_nvram, m_nvram.bytes()); }
+ virtual void nvram_read(emu_file &file) override { file.read(m_nvram, 0x2000); }
+ virtual void nvram_write(emu_file &file) override { file.write(m_nvram, 0x2000); }
// device_vic20_expansion_card_interface overrides
virtual uint8_t vic20_cd_r(offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override;
virtual void vic20_cd_w(offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override;
private:
+ memory_share_creator<uint8_t> m_nvram;
int m_nvram_en;
};
diff --git a/src/devices/bus/vic20/vic1110.cpp b/src/devices/bus/vic20/vic1110.cpp
index 9b2d0c192d9..f9ee69fd8b1 100644
--- a/src/devices/bus/vic20/vic1110.cpp
+++ b/src/devices/bus/vic20/vic1110.cpp
@@ -69,7 +69,7 @@ ioport_constructor vic1110_device::device_input_ports() const
vic1110_device::vic1110_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, VIC1110, tag, owner, clock)
, device_vic20_expansion_card_interface(mconfig, *this)
- , m_ram(*this, "ram")
+ , m_ram(*this, "ram", 0x2000, ENDIANNESS_LITTLE)
, m_sw(*this, "SW")
{
}
@@ -81,8 +81,6 @@ vic1110_device::vic1110_device(const machine_config &mconfig, const char *tag, d
void vic1110_device::device_start()
{
- // allocate memory
- m_ram.allocate(0x2000);
}
diff --git a/src/devices/bus/vic20/vic1110.h b/src/devices/bus/vic20/vic1110.h
index 9ec1ea2791a..831bc478bf4 100644
--- a/src/devices/bus/vic20/vic1110.h
+++ b/src/devices/bus/vic20/vic1110.h
@@ -40,7 +40,7 @@ protected:
virtual void vic20_cd_w(offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override;
private:
- optional_shared_ptr<uint8_t> m_ram;
+ memory_share_creator<uint8_t> m_ram;
required_ioport m_sw;
};
diff --git a/src/devices/bus/vic20/vic1111.cpp b/src/devices/bus/vic20/vic1111.cpp
index 1f8fa215078..4bb3a492ef2 100644
--- a/src/devices/bus/vic20/vic1111.cpp
+++ b/src/devices/bus/vic20/vic1111.cpp
@@ -30,7 +30,7 @@ DEFINE_DEVICE_TYPE(VIC1111, vic1111_device, "vic1111", "VIC-1111 16K RAM Expansi
vic1111_device::vic1111_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, VIC1111, tag, owner, clock)
, device_vic20_expansion_card_interface(mconfig, *this)
- , m_ram(*this, "ram")
+ , m_ram(*this, "ram", 0x4000, ENDIANNESS_LITTLE)
{
}
@@ -41,8 +41,6 @@ vic1111_device::vic1111_device(const machine_config &mconfig, const char *tag, d
void vic1111_device::device_start()
{
- // allocate memory
- m_ram.allocate(0x4000);
}
diff --git a/src/devices/bus/vic20/vic1111.h b/src/devices/bus/vic20/vic1111.h
index eb42db2f149..7d391875732 100644
--- a/src/devices/bus/vic20/vic1111.h
+++ b/src/devices/bus/vic20/vic1111.h
@@ -37,7 +37,7 @@ protected:
virtual void vic20_cd_w(offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override;
private:
- optional_shared_ptr<uint8_t> m_ram;
+ memory_share_creator<uint8_t> m_ram;
};
diff --git a/src/devices/bus/vic20/vic1210.cpp b/src/devices/bus/vic20/vic1210.cpp
index 6fa2a917254..88c94e8fbbd 100644
--- a/src/devices/bus/vic20/vic1210.cpp
+++ b/src/devices/bus/vic20/vic1210.cpp
@@ -31,7 +31,7 @@ DEFINE_DEVICE_TYPE(VIC1210, vic1210_device, "vic1210", "VIC-1210 3K RAM Expansio
vic1210_device::vic1210_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, VIC1210, tag, owner, clock)
, device_vic20_expansion_card_interface(mconfig, *this)
- , m_ram(*this, "ram")
+ , m_ram(*this, "ram", 0xc00, ENDIANNESS_LITTLE)
{
}
@@ -42,8 +42,6 @@ vic1210_device::vic1210_device(const machine_config &mconfig, const char *tag, d
void vic1210_device::device_start()
{
- // allocate memory
- m_ram.allocate(0xc00);
}
diff --git a/src/devices/bus/vic20/vic1210.h b/src/devices/bus/vic20/vic1210.h
index f890d5ad61e..9f20f9164ad 100644
--- a/src/devices/bus/vic20/vic1210.h
+++ b/src/devices/bus/vic20/vic1210.h
@@ -38,7 +38,7 @@ protected:
virtual void vic20_cd_w(offs_t offset, uint8_t data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) override;
private:
- optional_shared_ptr<uint8_t> m_ram;
+ memory_share_creator<uint8_t> m_ram;
};
diff --git a/src/devices/bus/vic20/videopak.cpp b/src/devices/bus/vic20/videopak.cpp
index 1f2b3c35431..542c2fb8320 100644
--- a/src/devices/bus/vic20/videopak.cpp
+++ b/src/devices/bus/vic20/videopak.cpp
@@ -131,8 +131,8 @@ vic20_video_pak_device::vic20_video_pak_device(const machine_config &mconfig, co
m_crtc(*this, MC6845_TAG),
m_palette(*this, "palette"),
m_char_rom(*this, MC6845_TAG),
- m_videoram(*this, "videoram"),
- m_ram(*this, "ram")
+ m_videoram(*this, "videoram", VIDEORAM_SIZE, ENDIANNESS_LITTLE),
+ m_ram(*this, "ram", RAM_SIZE, ENDIANNESS_LITTLE)
{
}
@@ -143,9 +143,6 @@ vic20_video_pak_device::vic20_video_pak_device(const machine_config &mconfig, co
void vic20_video_pak_device::device_start()
{
- // allocate memory
- m_videoram.allocate(VIDEORAM_SIZE);
- m_ram.allocate(RAM_SIZE);
}
diff --git a/src/devices/bus/vic20/videopak.h b/src/devices/bus/vic20/videopak.h
index 9e3176e5365..d87b04d35c1 100644
--- a/src/devices/bus/vic20/videopak.h
+++ b/src/devices/bus/vic20/videopak.h
@@ -51,8 +51,8 @@ private:
required_device<mc6845_device> m_crtc;
required_device<palette_device> m_palette;
required_memory_region m_char_rom;
- optional_shared_ptr<uint8_t> m_videoram;
- optional_shared_ptr<uint8_t> m_ram;
+ memory_share_creator<uint8_t> m_videoram;
+ memory_share_creator<uint8_t> m_ram;
bool m_case;
bool m_bank_size;