More cleanup of my drivers (nw)

This commit is contained in:
Robbbert 2017-01-08 09:18:30 +11:00
parent 6cd2c54025
commit 142e2e64a5
5 changed files with 53 additions and 51 deletions

View File

@ -146,7 +146,7 @@ static ADDRESS_MAP_START(argo_mem, AS_PROGRAM, 8, argo_state)
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x0000, 0x07ff) AM_RAMBANK("boot")
AM_RANGE(0x0800, 0xf7af) AM_RAM
AM_RANGE(0xf7b0, 0xf7ff) AM_RAM AM_SHARE("p_videoram")
AM_RANGE(0xf7b0, 0xf7ff) AM_RAM AM_SHARE("videoram")
AM_RANGE(0xf800, 0xffff) AM_ROM AM_WRITE(argo_videoram_w)
ADDRESS_MAP_END

View File

@ -21,20 +21,16 @@ class mz80_state : public driver_device
{
public:
mz80_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_pit(*this, "pit8253"),
m_ppi(*this, "ppi8255"),
m_cassette(*this, "cassette"),
m_speaker(*this, "speaker"),
m_p_ram(*this, "p_ram"),
m_p_videoram(*this, "p_videoram"){ }
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
, m_pit(*this, "pit8253")
, m_ppi(*this, "ppi8255")
, m_cassette(*this, "cassette")
, m_speaker(*this, "speaker")
, m_p_ram(*this, "p_ram")
, m_p_videoram(*this, "videoram")
{ }
required_device<cpu_device> m_maincpu;
required_device<pit8253_device> m_pit;
required_device<i8255_device> m_ppi;
required_device<cassette_image_device> m_cassette;
required_device<speaker_sound_device> m_speaker;
DECLARE_READ8_MEMBER(mz80k_strobe_r);
DECLARE_WRITE8_MEMBER(mz80k_strobe_w);
DECLARE_READ8_MEMBER(mz80k_8255_portb_r);
@ -43,6 +39,18 @@ public:
DECLARE_WRITE8_MEMBER(mz80k_8255_portc_w);
DECLARE_WRITE_LINE_MEMBER(pit_out0_changed);
DECLARE_WRITE_LINE_MEMBER(pit_out2_changed);
DECLARE_DRIVER_INIT(mz80k);
uint32_t screen_update_mz80k(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_mz80kj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_mz80a(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(ne555_tempo_callback);
private:
required_device<cpu_device> m_maincpu;
required_device<pit8253_device> m_pit;
required_device<i8255_device> m_ppi;
required_device<cassette_image_device> m_cassette;
required_device<speaker_sound_device> m_speaker;
bool m_mz80k_vertical;
bool m_mz80k_tempo_strobe;
uint8_t m_speaker_level;
@ -52,13 +60,8 @@ public:
required_shared_ptr<uint8_t> m_p_ram;
const uint8_t *m_p_chargen;
required_shared_ptr<uint8_t> m_p_videoram;
DECLARE_DRIVER_INIT(mz80k);
virtual void machine_reset() override;
virtual void video_start() override;
uint32_t screen_update_mz80k(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_mz80kj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_mz80a(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(ne555_tempo_callback);
};

View File

@ -42,7 +42,7 @@ public:
m_pit(*this, "pit8253"),
m_cassette(*this, "cassette"),
m_ram(*this, RAM_TAG),
m_p_videoram(*this, "p_videoram"),
m_p_videoram(*this, "videoram"),
m_region_maincpu(*this, "maincpu"),
m_bank1(*this, "bank1"),
m_bank2(*this, "bank2"),
@ -84,6 +84,26 @@ public:
DECLARE_WRITE8_MEMBER(specialist_8255_porta_w);
DECLARE_WRITE8_MEMBER(specialist_8255_portb_w);
DECLARE_WRITE8_MEMBER(specialist_8255_portc_w);
DECLARE_DRIVER_INIT(erik);
DECLARE_DRIVER_INIT(special);
DECLARE_MACHINE_RESET(special);
DECLARE_VIDEO_START(special);
DECLARE_MACHINE_RESET(erik);
DECLARE_VIDEO_START(erik);
DECLARE_PALETTE_INIT(erik);
DECLARE_VIDEO_START(specialp);
DECLARE_MACHINE_START(specimx);
DECLARE_MACHINE_RESET(specimx);
DECLARE_VIDEO_START(specimx);
DECLARE_PALETTE_INIT(specimx);
uint32_t screen_update_special(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_erik(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_specialp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_specimx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_WRITE_LINE_MEMBER(fdc_drq);
DECLARE_FLOPPY_FORMATS( specimx_floppy_formats );
private:
void specimx_set_bank(offs_t i, uint8_t data);
void erik_set_bank();
std::unique_ptr<uint8_t[]> m_specimx_colorram;
@ -105,26 +125,6 @@ public:
optional_device<ram_device> m_ram;
optional_shared_ptr<uint8_t> m_p_videoram;
int m_drive;
DECLARE_DRIVER_INIT(erik);
DECLARE_DRIVER_INIT(special);
DECLARE_MACHINE_RESET(special);
DECLARE_VIDEO_START(special);
DECLARE_MACHINE_RESET(erik);
DECLARE_VIDEO_START(erik);
DECLARE_PALETTE_INIT(erik);
DECLARE_VIDEO_START(specialp);
DECLARE_MACHINE_START(specimx);
DECLARE_MACHINE_RESET(specimx);
DECLARE_VIDEO_START(specimx);
DECLARE_PALETTE_INIT(specimx);
uint32_t screen_update_special(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_erik(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_specialp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_specimx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_WRITE_LINE_MEMBER(fdc_drq);
DECLARE_FLOPPY_FORMATS( specimx_floppy_formats );
protected:
required_memory_region m_region_maincpu;
required_memory_bank m_bank1;
optional_memory_bank m_bank2;
@ -145,7 +145,6 @@ protected:
required_ioport m_io_line10;
required_ioport m_io_line11;
required_ioport m_io_line12;
required_device<palette_device> m_palette;
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
};

View File

@ -31,7 +31,7 @@ public:
m_cassette(*this, "cassette"),
m_ppi(*this, "ppi8255"),
m_dac(*this, "dac"),
m_p_videoram(*this, "p_videoram"),
m_p_videoram(*this, "videoram"),
m_region_maincpu(*this, "maincpu"),
m_region_proms(*this, "proms"),
m_bank1(*this, "bank1"),
@ -48,9 +48,6 @@ public:
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette") { }
required_device<cassette_image_device> m_cassette;
optional_device<i8255_device> m_ppi;
optional_device<dac_bit_interface> m_dac;
DECLARE_READ8_MEMBER(ut88_keyboard_r);
DECLARE_WRITE8_MEMBER(ut88_keyboard_w);
DECLARE_WRITE8_MEMBER(ut88_sound_w);
@ -60,9 +57,6 @@ public:
DECLARE_READ8_MEMBER(ut88_8255_portb_r);
DECLARE_READ8_MEMBER(ut88_8255_portc_r);
DECLARE_WRITE8_MEMBER(ut88_8255_porta_w);
optional_shared_ptr<uint8_t> m_p_videoram;
int m_keyboard_mask;
int m_lcd_digit[6];
DECLARE_DRIVER_INIT(ut88);
DECLARE_DRIVER_INIT(ut88mini);
DECLARE_MACHINE_RESET(ut88);
@ -71,7 +65,13 @@ public:
DECLARE_MACHINE_RESET(ut88mini);
uint32_t screen_update_ut88(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
protected:
private:
required_device<cassette_image_device> m_cassette;
optional_device<i8255_device> m_ppi;
optional_device<dac_bit_interface> m_dac;
optional_shared_ptr<uint8_t> m_p_videoram;
int m_keyboard_mask;
int m_lcd_digit[6];
required_memory_region m_region_maincpu;
optional_memory_region m_region_proms;
optional_memory_bank m_bank1;

View File

@ -20,8 +20,8 @@ void m20_8086_device::device_start()
m_8086->space(AS_PROGRAM).install_readwrite_bank(0x00000, machine().device<ram_device>("ram")->size() - 0x4001, "mainram");
membank("highram")->set_base(ram);
membank("mainram")->set_base(&ram[0x4000]);
membank("vram")->set_base(memshare(":p_videoram")->ptr());
membank("vram2")->set_base(memshare(":p_videoram")->ptr());
membank("vram")->set_base(memshare(":videoram")->ptr());
membank("vram2")->set_base(memshare(":videoram")->ptr());
}
void m20_8086_device::device_reset()