diff options
author | 2016-06-14 19:50:02 +0200 | |
---|---|---|
committer | 2016-06-14 19:50:43 +0200 | |
commit | 3c030752cf3feebf7c50e15bb47bf16aa9ac1960 (patch) | |
tree | 9191d67dbc462d5c7c547365ef18c9af30e9bc30 | |
parent | 4ceb1a97f3eda4413b0f94d2956e21818af65c78 (diff) |
Added bare-bones Sony LDP-1000 device (nw)
-rw-r--r-- | scripts/src/machine.lua | 12 | ||||
-rw-r--r-- | scripts/target/mame/arcade.lua | 1 | ||||
-rw-r--r-- | src/devices/machine/ldp1000.cpp | 120 | ||||
-rw-r--r-- | src/devices/machine/ldp1000.h | 67 | ||||
-rw-r--r-- | src/mame/drivers/deco_ld.cpp | 60 |
5 files changed, 222 insertions, 38 deletions
diff --git a/scripts/src/machine.lua b/scripts/src/machine.lua index 37bdb8fe933..7ddf031d76d 100644 --- a/scripts/src/machine.lua +++ b/scripts/src/machine.lua @@ -1178,6 +1178,18 @@ end --------------------------------------------------- -- +--@src/devices/machine/ldp1000.h,MACHINES["LDP1000"] = true +--------------------------------------------------- + +if (MACHINES["LDP1000"]~=null) then + files { + MAME_DIR .. "src/devices/machine/ldp1000.cpp", + MAME_DIR .. "src/devices/machine/ldp1000.h", + } +end + +--------------------------------------------------- +-- --@src/devices/machine/ldvp931.h,MACHINES["LDVP931"] = true --------------------------------------------------- diff --git a/scripts/target/mame/arcade.lua b/scripts/target/mame/arcade.lua index 13f35db892e..1bd63589f68 100644 --- a/scripts/target/mame/arcade.lua +++ b/scripts/target/mame/arcade.lua @@ -429,6 +429,7 @@ MACHINES["LC89510"] = true MACHINES["LDPR8210"] = true MACHINES["LDSTUB"] = true MACHINES["LDV1000"] = true +MACHINES["LDP1000"] = true MACHINES["LDVP931"] = true --MACHINES["LH5810"] = true MACHINES["LINFLASH"] = true diff --git a/src/devices/machine/ldp1000.cpp b/src/devices/machine/ldp1000.cpp new file mode 100644 index 00000000000..922f3c2b63e --- /dev/null +++ b/src/devices/machine/ldp1000.cpp @@ -0,0 +1,120 @@ +// license:BSD-3-Clause +// copyright-holders:Angelo Salese +/*************************************************************************** + + Sony LDP-1000 laserdisc emulation. + + TODO: + - Dump BIOSes (seven of them according to docs) + - Hookup with Sony SMC-70 / SMC-777 + +***************************************************************************/ + +#include "emu.h" +#include "machine/ldp1000.h" + + +ROM_START( ldp1000 ) + ROM_REGION( 0x2000, "ldp1000", 0 ) + ROM_LOAD( "ldp1000_bios.bin", 0x0000, 0x2000, NO_DUMP ) +ROM_END + +//************************************************************************** +// GLOBAL VARIABLES +//************************************************************************** + +// device type definition +const device_type SONY_LDP1000 = &device_creator<sony_ldp1000_device>; + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// ldp1000_device - constructor +//------------------------------------------------- + +sony_ldp1000_device::sony_ldp1000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : laserdisc_device(mconfig, SONY_LDP1000, "Sony LDP-1000", tag, owner, clock, "ldp1000", __FILE__) +{ +} + + +//------------------------------------------------- +// device_validity_check - perform validity checks +// on this device +//------------------------------------------------- + +void sony_ldp1000_device::device_validity_check(validity_checker &valid) const +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void sony_ldp1000_device::device_start() +{ + laserdisc_device::device_start(); +} + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void sony_ldp1000_device::device_reset() +{ + laserdisc_device::device_reset(); + +} + +//------------------------------------------------- +// device_rom_region - return a pointer to our +// ROM region definitions +//------------------------------------------------- + +const rom_entry *sony_ldp1000_device::device_rom_region() const +{ + return ROM_NAME(ldp1000); +} + + +//------------------------------------------------- +// player_vsync - VSYNC callback, called at the +// start of the blanking period +//------------------------------------------------- + +void sony_ldp1000_device::player_vsync(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) +{ + //printf("%d vsync\n",fieldnum); +} + + +//------------------------------------------------- +// player_update - update callback, called on +// the first visible line of the frame +//------------------------------------------------- + +INT32 sony_ldp1000_device::player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) +{ + //printf("%d update\n",fieldnum); + + return fieldnum; +} + + +//************************************************************************** +// READ/WRITE HANDLERS +//************************************************************************** + +READ8_MEMBER( sony_ldp1000_device::read ) +{ + return 0; +} + +WRITE8_MEMBER( sony_ldp1000_device::write ) +{ +} diff --git a/src/devices/machine/ldp1000.h b/src/devices/machine/ldp1000.h new file mode 100644 index 00000000000..ee7acc789bf --- /dev/null +++ b/src/devices/machine/ldp1000.h @@ -0,0 +1,67 @@ +// license:BSD-3-Clause +// copyright-holders:Angelo Salese +/*************************************************************************** + + Sony LDP-1000 laserdisc emulation. + +***************************************************************************/ + +#pragma once + +#ifndef __LDP1000DEV_H__ +#define __LDP1000DEV_H__ + +#include "laserdsc.h" + + +//************************************************************************** +// INTERFACE CONFIGURATION MACROS +//************************************************************************** + +#define MCFG_LASERDISC_LDP1000_ADD(_tag) \ + MCFG_DEVICE_ADD(_tag, SONY_LDP1000, 0) + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// device type definition +extern const device_type SONY_LDP1000; + +// ======================> sony_ldp1000_device + +class sony_ldp1000_device : public laserdisc_device +{ +public: + // construction/destruction + sony_ldp1000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // I/O operations + DECLARE_WRITE8_MEMBER( write ); + DECLARE_READ8_MEMBER( read ); + +protected: + // device-level overrides + virtual void device_validity_check(validity_checker &valid) const override; + virtual void device_start() override; + virtual void device_reset() override; + virtual const rom_entry *device_rom_region() const override; + + virtual void player_vsync(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) override; + virtual INT32 player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) override; + virtual void player_overlay(bitmap_yuy16 &bitmap) override { } + +}; + + + + + + +//************************************************************************** +// GLOBAL VARIABLES +//************************************************************************** + + + +#endif diff --git a/src/mame/drivers/deco_ld.cpp b/src/mame/drivers/deco_ld.cpp index 5c2c1a5a282..fe7706ec6af 100644 --- a/src/mame/drivers/deco_ld.cpp +++ b/src/mame/drivers/deco_ld.cpp @@ -111,8 +111,9 @@ Sound processor - 6502 #include "emu.h" #include "cpu/m6502/m6502.h" #include "sound/ay8910.h" -#include "machine/ldv1000.h" +#include "machine/ldp1000.h" #include "machine/gen_latch.h" +#include "machine/6850acia.h" class deco_ld_state : public driver_device @@ -123,6 +124,7 @@ public: m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), m_laserdisc(*this, "laserdisc"), + //m_acia(*this, "acia"), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), m_palette(*this, "palette"), @@ -137,7 +139,8 @@ public: required_device<cpu_device> m_maincpu; optional_device<cpu_device> m_audiocpu; - required_device<pioneer_ldv1000_device> m_laserdisc; + required_device<sony_ldp1000_device> m_laserdisc; + //required_device<acia6850_device> m_acia; required_device<gfxdecode_device> m_gfxdecode; required_device<screen_device> m_screen; required_device<palette_device> m_palette; @@ -150,20 +153,17 @@ public: UINT8 m_laserdisc_data; int m_nmimask; - DECLARE_READ8_MEMBER(laserdisc_r); - DECLARE_WRITE8_MEMBER(laserdisc_w); DECLARE_READ8_MEMBER(sound_status_r); DECLARE_WRITE8_MEMBER(decold_sound_cmd_w); - DECLARE_WRITE8_MEMBER(decold_palette_w); DECLARE_CUSTOM_INPUT_MEMBER(begas_vblank_r); DECLARE_INPUT_CHANGED_MEMBER(coin_inserted); virtual void machine_start() override; - UINT32 screen_update_rblaster(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + UINT32 screen_update_rblaster(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(sound_interrupt); - void draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT8 *spriteram, UINT16 tile_bank ); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 *spriteram, UINT16 tile_bank ); }; -void deco_ld_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT8 *spriteram, UINT16 tile_bank ) +void deco_ld_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 *spriteram, UINT16 tile_bank ) { gfx_element *gfx = m_gfxdecode->gfx(1); int i,spr_offs,x,y,col,fx,fy; @@ -208,7 +208,7 @@ void deco_ld_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect } } -UINT32 deco_ld_state::screen_update_rblaster(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +UINT32 deco_ld_state::screen_update_rblaster(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { gfx_element *gfx = m_gfxdecode->gfx(0); int y,x; @@ -246,33 +246,12 @@ UINT32 deco_ld_state::screen_update_rblaster(screen_device &screen, bitmap_rgb32 } - -READ8_MEMBER(deco_ld_state::laserdisc_r) -{ - UINT8 result = m_laserdisc->status_r(); -// osd_printf_debug("laserdisc_r = %02X\n", result); - return result; -} - - -WRITE8_MEMBER(deco_ld_state::laserdisc_w) -{ - m_laserdisc_data = data; -} - - WRITE8_MEMBER(deco_ld_state::decold_sound_cmd_w) { m_soundlatch->write(space, 0, data); m_audiocpu->set_input_line(0, HOLD_LINE); } -/* same as Burger Time HW */ -WRITE8_MEMBER(deco_ld_state::decold_palette_w) -{ - m_palette->write(space, offset, UINT8(~data)); -} - /* unknown, but certainly related to audiocpu somehow */ READ8_MEMBER(deco_ld_state::sound_status_r) { @@ -287,9 +266,10 @@ static ADDRESS_MAP_START( rblaster_map, AS_PROGRAM, 8, deco_ld_state ) AM_RANGE(0x1003, 0x1003) AM_READ_PORT("IN1") AM_RANGE(0x1004, 0x1004) AM_DEVREAD("soundlatch2", generic_latch_8_device, read) AM_WRITE(decold_sound_cmd_w) AM_RANGE(0x1005, 0x1005) AM_READ(sound_status_r) - AM_RANGE(0x1006, 0x1006) AM_NOP // 6850 status - AM_RANGE(0x1007, 0x1007) AM_READWRITE(laserdisc_r,laserdisc_w) // 6850 data - AM_RANGE(0x1800, 0x1fff) AM_RAM_WRITE(decold_palette_w) AM_SHARE("palette") + //AM_RANGE(0x1006, 0x1006) AM_READ(acia_status_hack_r) + //AM_RANGE(0x1006, 0x1006) AM_DEVREADWRITE("acia", acia6850_device, status_r, control_w) + //AM_RANGE(0x1007, 0x1007) AM_DEVREADWRITE("acia", acia6850_device, data_r, data_w) + AM_RANGE(0x1800, 0x1fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") AM_RANGE(0x2000, 0x27ff) AM_RAM AM_RANGE(0x2800, 0x2bff) AM_RAM AM_SHARE("vram0") AM_RANGE(0x2c00, 0x2fff) AM_RAM AM_SHARE("attr0") @@ -480,17 +460,21 @@ static MACHINE_CONFIG_START( rblaster, deco_ld_state ) // MCFG_QUANTUM_TIME(attotime::from_hz(6000)) - MCFG_LASERDISC_LDV1000_ADD("laserdisc") //Sony LDP-1000A, is it truly compatible with the Pioneer? + MCFG_LASERDISC_LDP1000_ADD("laserdisc") MCFG_LASERDISC_OVERLAY_DRIVER(256, 256, deco_ld_state, screen_update_rblaster) - MCFG_LASERDISC_OVERLAY_CLIP(0, 256-1, 8, 240-1) + //MCFG_LASERDISC_OVERLAY_CLIP(0, 256-1, 8, 240-1) MCFG_LASERDISC_OVERLAY_PALETTE("palette") /* video hardware */ MCFG_LASERDISC_SCREEN_ADD_NTSC("screen", "laserdisc") MCFG_GFXDECODE_ADD("gfxdecode", "palette", rblaster) - MCFG_PALETTE_ADD("palette", 512) - MCFG_PALETTE_FORMAT(BBGGGRRR) + MCFG_PALETTE_ADD("palette", 0x800) + MCFG_PALETTE_FORMAT(BBGGGRRR_inverted) + //MCFG_DEVICE_ADD("acia", ACIA6850, 0) + //MCFG_ACIA6850_TXD_HANDLER(DEVWRITELINE("laserdisc", sony_ldp1000_device, write)) + //MCFG_ACIA6850_RXD_HANDLER(DEVREADLINE("laserdisc", sony_ldp1000_device, read)) + /* sound hardware */ /* TODO: mixing */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") @@ -608,7 +592,7 @@ ROM_START( rblaster ) ROM_LOAD( "08.bin", 0xa000, 0x2000, CRC(4608b516) SHA1(44af4be84a0b807ea0813ce86376a4b6fd927e5a) ) DISK_REGION( "laserdisc" ) - DISK_IMAGE_READONLY( "rblaster", 0, NO_DUMP ) + DISK_IMAGE_READONLY( "rblaster", 0, SHA1(1563ea907d461592e17646848fdf2dce904bba32) ) ROM_END ROM_START( cobra ) |