mirror of
https://github.com/holub/mame
synced 2025-07-03 09:06:08 +03:00
*replaced lambda with bank
This commit is contained in:
parent
3ff831a71a
commit
5f97eb904a
@ -40,6 +40,7 @@ public:
|
||||
, m_maincpu(*this, "maincpu")
|
||||
, m_rom(*this, "maincpu")
|
||||
, m_ram(*this, "mainram")
|
||||
, m_bank1(*this, "bank1")
|
||||
, m_dart(*this, "dart")
|
||||
, m_ctc(*this, "ctc")
|
||||
, m_fdc(*this, "fdc")
|
||||
@ -67,11 +68,11 @@ private:
|
||||
|
||||
void io_map(address_map &map);
|
||||
void mem_map(address_map &map);
|
||||
bool m_rom_in_map;
|
||||
|
||||
required_device<z80_device> m_maincpu;
|
||||
required_region_ptr<u8> m_rom;
|
||||
required_shared_ptr<u8> m_ram;
|
||||
required_memory_bank m_bank1;
|
||||
required_device<z80dart_device> m_dart;
|
||||
required_device<z80ctc_device> m_ctc;
|
||||
required_device<wd1772_device> m_fdc;
|
||||
@ -92,7 +93,7 @@ d7 FDC master clock 0=8MHz 1=16MHz (for 20cm disks, not emulated)
|
||||
*/
|
||||
void ampro_state::port00_w(uint8_t data)
|
||||
{
|
||||
m_rom_in_map = BIT(~data, 6);
|
||||
m_bank1->set_entry(BIT(~data, 6));
|
||||
m_fdc->dden_w(BIT(data, 5));
|
||||
floppy_image_device *floppy = nullptr;
|
||||
if (BIT(data, 0)) floppy = m_floppy0->get_device();
|
||||
@ -137,7 +138,7 @@ void ampro_state::dart_w(offs_t offset, uint8_t data)
|
||||
void ampro_state::mem_map(address_map &map)
|
||||
{
|
||||
map(0x0000, 0xffff).ram().share("mainram");
|
||||
map(0x0000, 0x0fff).lr8(NAME([this] (offs_t offset) { if(m_rom_in_map) return m_rom[offset]; else return m_ram[offset]; }));
|
||||
map(0x0000, 0x0fff).bankr("bank1");
|
||||
}
|
||||
|
||||
void ampro_state::io_map(address_map &map)
|
||||
@ -190,12 +191,13 @@ INPUT_PORTS_END
|
||||
|
||||
void ampro_state::machine_start()
|
||||
{
|
||||
save_item(NAME(m_rom_in_map));
|
||||
m_bank1->configure_entry(0, m_ram);
|
||||
m_bank1->configure_entry(1, m_rom);
|
||||
}
|
||||
|
||||
void ampro_state::machine_reset()
|
||||
{
|
||||
m_rom_in_map = 1;
|
||||
m_bank1->set_entry(1);
|
||||
|
||||
port00_w(0);
|
||||
clear_strobe(0);
|
||||
|
@ -100,6 +100,7 @@ public:
|
||||
, m_maincpu(*this, "maincpu")
|
||||
, m_rom(*this, "maincpu")
|
||||
, m_ram(*this, "mainram")
|
||||
, m_bank1(*this, "bank1")
|
||||
, m_p_chargen(*this, "chargen")
|
||||
, m_beep(*this, "beeper")
|
||||
, m_fdc (*this, "fdc")
|
||||
@ -149,7 +150,6 @@ private:
|
||||
//bool m_intrq;
|
||||
bool m_hsync;
|
||||
bool m_vsync;
|
||||
bool m_rom_in_map;
|
||||
std::unique_ptr<u8[]> m_vram;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
memory_passthrough_handler *m_rom_shadow_tap;
|
||||
@ -157,6 +157,7 @@ private:
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_region_ptr<u8> m_rom;
|
||||
required_shared_ptr<u8> m_ram;
|
||||
required_memory_bank m_bank1;
|
||||
required_region_ptr<u8> m_p_chargen;
|
||||
required_device<beep_device> m_beep;
|
||||
required_device<upd765a_device> m_fdc;
|
||||
@ -190,7 +191,7 @@ void amust_state::device_timer(emu_timer &timer, device_timer_id id, int param,
|
||||
void amust_state::mem_map(address_map &map)
|
||||
{
|
||||
map(0x0000, 0xffff).ram().share("mainram");
|
||||
map(0xf800, 0xffff).lr8(NAME([this] (offs_t offset) { if(m_rom_in_map) return m_rom[offset]; else return m_ram[offset]; }));
|
||||
map(0xf800, 0xffff).bankr("bank1");
|
||||
}
|
||||
|
||||
void amust_state::io_map(address_map &map)
|
||||
@ -412,7 +413,7 @@ MC6845_UPDATE_ROW( amust_state::crtc_update_row )
|
||||
|
||||
void amust_state::machine_reset()
|
||||
{
|
||||
m_rom_in_map = true;
|
||||
m_bank1->set_entry(1);
|
||||
m_port04 = 0;
|
||||
m_port06 = 0;
|
||||
m_port08 = 0;
|
||||
@ -456,7 +457,8 @@ void amust_state::machine_start()
|
||||
//save_item(NAME(m_intrq));
|
||||
save_item(NAME(m_hsync));
|
||||
save_item(NAME(m_vsync));
|
||||
save_item(NAME(m_rom_in_map));
|
||||
m_bank1->configure_entry(0, m_ram+0xf800);
|
||||
m_bank1->configure_entry(1, m_rom);
|
||||
}
|
||||
|
||||
void amust_state::amust(machine_config &config)
|
||||
|
@ -44,6 +44,7 @@ public:
|
||||
, m_maincpu(*this, "maincpu")
|
||||
, m_rom(*this, "maincpu")
|
||||
, m_ram(*this, "mainram")
|
||||
, m_bank1(*this, "bank1")
|
||||
, m_fdc(*this, "fdc")
|
||||
, m_floppy0(*this, "fdc:0")
|
||||
{ }
|
||||
@ -62,10 +63,10 @@ private:
|
||||
void io_map(address_map &map);
|
||||
void mem_map(address_map &map);
|
||||
|
||||
bool m_rom_in_map;
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_region_ptr<u8> m_rom;
|
||||
required_shared_ptr<u8> m_ram;
|
||||
required_memory_bank m_bank1;
|
||||
required_device<fd1793_device> m_fdc;
|
||||
required_device<floppy_connector> m_floppy0;
|
||||
};
|
||||
@ -102,13 +103,13 @@ void dmax8000_state::port14_w(u8 data)
|
||||
|
||||
void dmax8000_state::port40_w(u8 data)
|
||||
{
|
||||
m_rom_in_map = BIT(~data, 0);
|
||||
m_bank1->set_entry(BIT(~data, 0));
|
||||
}
|
||||
|
||||
void dmax8000_state::mem_map(address_map &map)
|
||||
{
|
||||
map(0x0000, 0x0fff).ram().share("mainram").lr8(NAME([this] (offs_t offset) { if(m_rom_in_map) return m_rom[offset]; else return m_ram[offset]; }));
|
||||
map(0x1000, 0xffff).ram();
|
||||
map(0x0000, 0xffff).ram().share("mainram");
|
||||
map(0x0000, 0x0fff).bankr("bank1");
|
||||
}
|
||||
|
||||
void dmax8000_state::io_map(address_map &map)
|
||||
@ -135,13 +136,14 @@ INPUT_PORTS_END
|
||||
|
||||
void dmax8000_state::machine_reset()
|
||||
{
|
||||
m_rom_in_map = 1;
|
||||
m_bank1->set_entry(1);
|
||||
m_maincpu->set_input_line_vector(0, 0xee); // Z80 - fdc vector
|
||||
}
|
||||
|
||||
void dmax8000_state::machine_start()
|
||||
{
|
||||
save_item(NAME(m_rom_in_map));
|
||||
m_bank1->configure_entry(0, m_ram);
|
||||
m_bank1->configure_entry(1, m_rom);
|
||||
}
|
||||
|
||||
static void floppies(device_slot_interface &device)
|
||||
|
@ -42,6 +42,7 @@ public:
|
||||
, m_maincpu(*this, "maincpu")
|
||||
, m_rom(*this, "maincpu")
|
||||
, m_ram(*this, "mainram")
|
||||
, m_bank1(*this, "bank1")
|
||||
{ }
|
||||
|
||||
void dsb46(machine_config &config);
|
||||
@ -52,16 +53,16 @@ private:
|
||||
void port1a_w(u8 data);
|
||||
void io_map(address_map &map);
|
||||
void mem_map(address_map &map);
|
||||
bool m_rom_in_map;
|
||||
required_device<z80_device> m_maincpu;
|
||||
required_region_ptr<u8> m_rom;
|
||||
required_shared_ptr<u8> m_ram;
|
||||
required_memory_bank m_bank1;
|
||||
};
|
||||
|
||||
void dsb46_state::mem_map(address_map &map)
|
||||
{
|
||||
map(0x0000, 0x07ff).ram().share("mainram").lr8(NAME([this] (offs_t offset) { if(m_rom_in_map) return m_rom[offset]; else return m_ram[offset]; }));
|
||||
map(0x0800, 0xffff).ram();
|
||||
map(0x0000, 0xffff).ram().share("mainram");
|
||||
map(0x0000, 0x07ff).bankr("bank1");
|
||||
}
|
||||
|
||||
void dsb46_state::io_map(address_map &map)
|
||||
@ -83,17 +84,18 @@ INPUT_PORTS_END
|
||||
|
||||
void dsb46_state::machine_start()
|
||||
{
|
||||
save_item(NAME(m_rom_in_map));
|
||||
m_bank1->configure_entry(0, m_ram);
|
||||
m_bank1->configure_entry(1, m_rom);
|
||||
}
|
||||
|
||||
void dsb46_state::machine_reset()
|
||||
{
|
||||
m_rom_in_map = true;
|
||||
m_bank1->set_entry(1);
|
||||
}
|
||||
|
||||
void dsb46_state::port1a_w(u8 data)
|
||||
{
|
||||
m_rom_in_map = BIT(~data, 0);
|
||||
m_bank1->set_entry(BIT(~data, 0));
|
||||
}
|
||||
|
||||
static const z80_daisy_config daisy_chain[] =
|
||||
|
@ -26,6 +26,7 @@ public:
|
||||
, m_maincpu(*this, "maincpu")
|
||||
, m_rom(*this, "maincpu")
|
||||
, m_ram(*this, "mainram")
|
||||
, m_bank1(*this, "bank1")
|
||||
, m_p_videoram(*this, "videoram")
|
||||
, m_p_chargen(*this, "chargen")
|
||||
{ }
|
||||
@ -40,12 +41,12 @@ private:
|
||||
void mem_map(address_map &map);
|
||||
|
||||
u8 m_framecnt;
|
||||
bool m_rom_in_map;
|
||||
void machine_start() override;
|
||||
void machine_reset() override;
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_region_ptr<u8> m_rom;
|
||||
required_shared_ptr<u8> m_ram;
|
||||
required_memory_bank m_bank1;
|
||||
required_shared_ptr<u8> m_p_videoram;
|
||||
required_region_ptr<u8> m_p_chargen;
|
||||
};
|
||||
@ -54,13 +55,13 @@ private:
|
||||
void k8915_state::k8915_a8_w(u8 data)
|
||||
{
|
||||
// seems to switch ram and rom around.
|
||||
m_rom_in_map = (data == 0x87) ? 0 : 1;
|
||||
m_bank1->set_entry((data == 0x87) ? 0 : 1);
|
||||
}
|
||||
|
||||
void k8915_state::mem_map(address_map &map)
|
||||
{
|
||||
map.unmap_value_high();
|
||||
map(0x0000, 0x0fff).ram().share("mainram").lr8(NAME([this] (offs_t offset) { if(m_rom_in_map) return m_rom[offset]; else return m_ram[offset]; }));
|
||||
map(0x0000, 0x0fff).ram().share("mainram").bankr("bank1");
|
||||
map(0x1000, 0x17ff).ram().share("videoram");
|
||||
map(0x1800, 0xffff).ram();
|
||||
}
|
||||
@ -79,13 +80,14 @@ INPUT_PORTS_END
|
||||
|
||||
void k8915_state::machine_reset()
|
||||
{
|
||||
m_rom_in_map = 1;
|
||||
m_bank1->set_entry(1);
|
||||
}
|
||||
|
||||
void k8915_state::machine_start()
|
||||
{
|
||||
m_bank1->configure_entry(0, m_ram);
|
||||
m_bank1->configure_entry(1, m_rom);
|
||||
save_item(NAME(m_framecnt));
|
||||
save_item(NAME(m_rom_in_map));
|
||||
}
|
||||
|
||||
u32 k8915_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
|
@ -58,6 +58,7 @@ public:
|
||||
, m_maincpu(*this, "maincpu")
|
||||
, m_rom(*this, "maincpu")
|
||||
, m_ram(*this, "mainram")
|
||||
, m_bank1(*this, "bank1")
|
||||
, m_fdc (*this, "fdc")
|
||||
, m_floppy0(*this, "fdc:0")
|
||||
, m_floppy1(*this, "fdc:1")
|
||||
@ -78,12 +79,12 @@ private:
|
||||
void io_map(address_map &map);
|
||||
void mem_map(address_map &map);
|
||||
|
||||
bool m_rom_in_map;
|
||||
floppy_image_device *m_floppy;
|
||||
memory_passthrough_handler *m_rom_shadow_tap;
|
||||
required_device<z80_device> m_maincpu;
|
||||
required_region_ptr<u8> m_rom;
|
||||
required_shared_ptr<u8> m_ram;
|
||||
required_memory_bank m_bank1;
|
||||
required_device<fd1797_device> m_fdc;
|
||||
required_device<floppy_connector> m_floppy0;
|
||||
required_device<floppy_connector> m_floppy1;
|
||||
@ -93,7 +94,7 @@ private:
|
||||
void pulsar_state::mem_map(address_map &map)
|
||||
{
|
||||
map(0x0000, 0xffff).ram().share("mainram");
|
||||
map(0xf800, 0xffff).lr8(NAME([this] (offs_t offset) { if(m_rom_in_map) return m_rom[offset]; else return m_ram[offset+0xf800]; }));
|
||||
map(0xf800, 0xffff).bankr("bank1");
|
||||
}
|
||||
|
||||
void pulsar_state::io_map(address_map &map)
|
||||
@ -141,7 +142,7 @@ void pulsar_state::ppi_pb_w(u8 data)
|
||||
m_rtc->read_w(BIT(data, 4));
|
||||
m_rtc->write_w(BIT(data, 5));
|
||||
m_rtc->hold_w(BIT(data, 6));
|
||||
m_rom_in_map = BIT(data, 7);
|
||||
m_bank1->set_entry(BIT(data, 7));
|
||||
}
|
||||
|
||||
// d0..d3 Data lines to rtc
|
||||
@ -186,7 +187,7 @@ INPUT_PORTS_END
|
||||
void pulsar_state::machine_reset()
|
||||
{
|
||||
|
||||
m_rom_in_map = true;
|
||||
m_bank1->set_entry(1);
|
||||
m_rtc->cs_w(1); // always enabled
|
||||
|
||||
address_space &program = m_maincpu->space(AS_PROGRAM);
|
||||
@ -210,7 +211,8 @@ void pulsar_state::machine_reset()
|
||||
void pulsar_state::machine_start()
|
||||
{
|
||||
// register for savestates
|
||||
save_item(NAME(m_rom_in_map));
|
||||
m_bank1->configure_entry(0, m_ram+0xf800);
|
||||
m_bank1->configure_entry(1, m_rom);
|
||||
}
|
||||
|
||||
void pulsar_state::pulsar(machine_config &config)
|
||||
|
@ -72,8 +72,8 @@ ToDo:
|
||||
|
||||
void zorba_state::zorba_mem(address_map &map)
|
||||
{
|
||||
map(0x0000, 0x3fff).ram().share("mainram").bankr("bank1");
|
||||
map(0x4000, 0xffff).ram();
|
||||
map(0x0000, 0xffff).ram().share("mainram");
|
||||
map(0x0000, 0x3fff).bankr("bank1");
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user