Added command strobe callback interface for LDV1000, and hooked it up to esh.cpp driver. [Angelo Salese]

(out of whatsnew: also fixed irq 0 hookup, using device_timer to ack an irq for MAME is never a good idea)
This commit is contained in:
angelosa 2016-06-15 19:38:04 +02:00
parent 1dd74e3eb7
commit b49b23b7df
4 changed files with 28 additions and 19 deletions

View File

@ -63,8 +63,8 @@ const device_type PIONEER_LDV1000 = &device_creator<pioneer_ldv1000_device>;
static ADDRESS_MAP_START( ldv1000_map, AS_PROGRAM, 8, pioneer_ldv1000_device ) static ADDRESS_MAP_START( ldv1000_map, AS_PROGRAM, 8, pioneer_ldv1000_device )
AM_RANGE(0x0000, 0x1fff) AM_MIRROR(0x6000) AM_ROM AM_RANGE(0x0000, 0x1fff) AM_MIRROR(0x6000) AM_ROM
AM_RANGE(0x8000, 0x87ff) AM_MIRROR(0x3800) AM_RAM AM_RANGE(0x8000, 0x87ff) AM_MIRROR(0x3800) AM_RAM
AM_RANGE(0xc000, 0xc003) AM_MIRROR(0x9ff0) AM_DEVREADWRITE("ldvppi0", i8255_device, read, write) AM_RANGE(0xc000, 0xc003) AM_MIRROR(0x1ff0) AM_DEVREADWRITE("ldvppi0", i8255_device, read, write)
AM_RANGE(0xc004, 0xc007) AM_MIRROR(0x9ff0) AM_DEVREADWRITE("ldvppi1", i8255_device, read, write) AM_RANGE(0xc004, 0xc007) AM_MIRROR(0x1ff0) AM_DEVREADWRITE("ldvppi1", i8255_device, read, write)
ADDRESS_MAP_END ADDRESS_MAP_END
@ -126,6 +126,7 @@ pioneer_ldv1000_device::pioneer_ldv1000_device(const machine_config &mconfig, co
m_z80_cpu(*this, "ldv1000"), m_z80_cpu(*this, "ldv1000"),
m_z80_ctc(*this, "ldvctc"), m_z80_ctc(*this, "ldvctc"),
m_multitimer(nullptr), m_multitimer(nullptr),
m_command_strobe_cb(*this),
m_command(0), m_command(0),
m_status(0), m_status(0),
m_vsync(false), m_vsync(false),
@ -175,6 +176,8 @@ void pioneer_ldv1000_device::device_start()
// allocate timers // allocate timers
m_multitimer = timer_alloc(TID_MULTIJUMP); m_multitimer = timer_alloc(TID_MULTIJUMP);
m_command_strobe_cb.resolve_safe();
} }
@ -648,6 +651,9 @@ WRITE8_MEMBER( pioneer_ldv1000_device::ppi1_portc_w )
printf("\n"); printf("\n");
} }
// bit 4 sends a command strobe signal to Host CPU
m_command_strobe_cb(bool(data & 0x10));
// video squelch is controlled by bit 3 // video squelch is controlled by bit 3
set_video_squelch((data & 0x08) == 0); set_video_squelch((data & 0x08) == 0);

View File

@ -26,6 +26,10 @@
#define MCFG_LASERDISC_LDV1000_ADD(_tag) \ #define MCFG_LASERDISC_LDV1000_ADD(_tag) \
MCFG_DEVICE_ADD(_tag, PIONEER_LDV1000, 0) MCFG_DEVICE_ADD(_tag, PIONEER_LDV1000, 0)
#define MCFG_LASERDISC_LDV1000_COMMAND_STROBE_CB(_cb) \
downcast<pioneer_ldv1000_device *>(device)->set_command_strobe_callback(DEVCB_##_cb);
//************************************************************************** //**************************************************************************
// GLOBAL VARIABLES // GLOBAL VARIABLES
@ -49,6 +53,8 @@ public:
// construction/destruction // construction/destruction
pioneer_ldv1000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); pioneer_ldv1000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
template<class _cmd_strobe_cb> void set_command_strobe_callback(_cmd_strobe_cb latch) { m_command_strobe_cb.set_callback(latch); }
// input and output // input and output
void data_w(UINT8 data); void data_w(UINT8 data);
void enter_w(UINT8 data); void enter_w(UINT8 data);
@ -102,6 +108,7 @@ protected:
required_device<z80_device> m_z80_cpu; /* CPU index of the Z80 */ required_device<z80_device> m_z80_cpu; /* CPU index of the Z80 */
required_device<z80ctc_device> m_z80_ctc; /* CTC device */ required_device<z80ctc_device> m_z80_ctc; /* CTC device */
emu_timer * m_multitimer; /* multi-jump timer device */ emu_timer * m_multitimer; /* multi-jump timer device */
devcb_write_line m_command_strobe_cb;
/* communication status */ /* communication status */
UINT8 m_command; /* command byte to the player */ UINT8 m_command; /* command byte to the player */
@ -122,6 +129,7 @@ protected:
UINT8 m_vbi[7*3]; /* VBI data */ UINT8 m_vbi[7*3]; /* VBI data */
bool m_vbiready; /* VBI ready flag */ bool m_vbiready; /* VBI ready flag */
UINT8 m_vbiindex; /* index within the VBI data */ UINT8 m_vbiindex; /* index within the VBI data */
}; };

View File

@ -812,8 +812,6 @@ void rom_load_manager::fill_rom_data(const rom_entry *romp)
if (numbytes == 0) if (numbytes == 0)
fatalerror("Error in RomModule definition: FILL has an invalid length\n"); fatalerror("Error in RomModule definition: FILL has an invalid length\n");
printf("base %08x %02x\n",numbytes,skip);
/* fill the data (filling value is stored in place of the hashdata) */ /* fill the data (filling value is stored in place of the hashdata) */
if(skip != 0) if(skip != 0)
{ {

View File

@ -14,11 +14,9 @@ Notes:
Eshb has some junk in the IO TEST screen. Maybe a bad dump? Eshb has some junk in the IO TEST screen. Maybe a bad dump?
Todo: Todo:
- LD TROUBLE message pops up after each cycle in attract. NMI-related - LD TROUBLE appears at POST. Sync/timing issue?
- Wrong overlay colors; - Wrong overlay colors;
- Convert to tilemaps (see next ToDo for feasibility). - Convert to tilemaps (see next ToDo for feasibility).
- Apparently some tiles blink (in at least two different ways).
- 0xfe and 0xff are pretty obviously not NMI enables. They're likely LED's. Do the NMI right (somehow).
- Rumor has it there's an analog beep hanging off 0xf5? Implement it and finish off 0xf5 bits. - Rumor has it there's an analog beep hanging off 0xf5? Implement it and finish off 0xf5 bits.
- NVRAM range 0xe000-0xe800 might be too large. It doesn't seem to write past 0xe600... - NVRAM range 0xe000-0xe800 might be too large. It doesn't seem to write past 0xe600...
- Maybe some of the IPT_UNKNOWNs do something? - Maybe some of the IPT_UNKNOWNs do something?
@ -65,13 +63,13 @@ public:
DECLARE_PALETTE_INIT(esh); DECLARE_PALETTE_INIT(esh);
UINT32 screen_update_esh(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); UINT32 screen_update_esh(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(vblank_callback_esh); INTERRUPT_GEN_MEMBER(vblank_callback_esh);
INTERRUPT_GEN_MEMBER(ld_unk_callback); DECLARE_WRITE_LINE_MEMBER(ld_command_strobe_cb);
required_device<cpu_device> m_maincpu; required_device<cpu_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode; required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette; required_device<palette_device> m_palette;
protected: protected:
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; //virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
}; };
@ -104,7 +102,7 @@ UINT32 esh_state::screen_update_esh(screen_device &screen, bitmap_rgb32 &bitmap,
//int blinkChar = (m_tile_control_ram[current_screen_character] & 0x80) >> 7; //int blinkChar = (m_tile_control_ram[current_screen_character] & 0x80) >> 7;
// TODO: blink timing // TODO: blink timing
if(blinkLine == true && m_screen->frame_number() & 0x10) if(blinkLine == true && m_screen->frame_number() & 8)
gfx = m_gfxdecode->gfx(1); gfx = m_gfxdecode->gfx(1);
else else
gfx = m_gfxdecode->gfx(0); gfx = m_gfxdecode->gfx(0);
@ -317,6 +315,7 @@ static GFXDECODE_START( esh )
GFXDECODE_ENTRY("gfx2", 0, esh_gfx_layout, 0x0, 0x20) GFXDECODE_ENTRY("gfx2", 0, esh_gfx_layout, 0x0, 0x20)
GFXDECODE_END GFXDECODE_END
#if 0
void esh_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) void esh_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{ {
switch (id) switch (id)
@ -328,19 +327,20 @@ void esh_state::device_timer(emu_timer &timer, device_timer_id id, int param, vo
assert_always(FALSE, "Unknown id in esh_state::device_timer"); assert_always(FALSE, "Unknown id in esh_state::device_timer");
} }
} }
#endif
INTERRUPT_GEN_MEMBER(esh_state::vblank_callback_esh) INTERRUPT_GEN_MEMBER(esh_state::vblank_callback_esh)
{ {
// IRQ // IRQ
device.execute().set_input_line(0, ASSERT_LINE); device.execute().set_input_line(0, HOLD_LINE);
timer_set(attotime::from_usec(50), TIMER_IRQ_STOP); //timer_set(attotime::from_usec(50), TIMER_IRQ_STOP);
} }
// TODO: 0xfe NMI enabled after writing to LD command port, NMI reads LD port. LDV needs command strobe callback? // TODO: 0xfe NMI enabled after writing to LD command port, NMI reads LD port.
INTERRUPT_GEN_MEMBER(esh_state::ld_unk_callback) WRITE_LINE_MEMBER(esh_state::ld_command_strobe_cb)
{ {
if(m_nmi_enable) if(m_nmi_enable)
m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); m_maincpu->set_input_line(INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE);
} }
void esh_state::machine_start() void esh_state::machine_start()
@ -350,19 +350,16 @@ void esh_state::machine_start()
/* DRIVER */ /* DRIVER */
static MACHINE_CONFIG_START( esh, esh_state ) static MACHINE_CONFIG_START( esh, esh_state )
/* main cpu */ /* main cpu */
MCFG_CPU_ADD("maincpu", Z80, PCB_CLOCK/6) /* The denominator is a Daphne guess based on PacMan's hardware */ MCFG_CPU_ADD("maincpu", Z80, PCB_CLOCK/6) /* The denominator is a Daphne guess based on PacMan's hardware */
MCFG_CPU_PROGRAM_MAP(z80_0_mem) MCFG_CPU_PROGRAM_MAP(z80_0_mem)
MCFG_CPU_IO_MAP(z80_0_io) MCFG_CPU_IO_MAP(z80_0_io)
MCFG_CPU_VBLANK_INT_DRIVER("screen", esh_state, vblank_callback_esh) MCFG_CPU_VBLANK_INT_DRIVER("screen", esh_state, vblank_callback_esh)
MCFG_CPU_PERIODIC_INT_DRIVER(esh_state, ld_unk_callback, 90)
MCFG_NVRAM_ADD_0FILL("nvram") MCFG_NVRAM_ADD_0FILL("nvram")
MCFG_LASERDISC_LDV1000_ADD("laserdisc") MCFG_LASERDISC_LDV1000_ADD("laserdisc")
MCFG_LASERDISC_LDV1000_COMMAND_STROBE_CB(WRITELINE(esh_state, ld_command_strobe_cb))
MCFG_LASERDISC_OVERLAY_DRIVER(256, 256, esh_state, screen_update_esh) MCFG_LASERDISC_OVERLAY_DRIVER(256, 256, esh_state, screen_update_esh)
MCFG_LASERDISC_OVERLAY_PALETTE("palette") MCFG_LASERDISC_OVERLAY_PALETTE("palette")