summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/crystal.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/crystal.cpp')
-rw-r--r--src/mame/drivers/crystal.cpp108
1 files changed, 3 insertions, 105 deletions
diff --git a/src/mame/drivers/crystal.cpp b/src/mame/drivers/crystal.cpp
index 56e858bd7f2..848a7ceb790 100644
--- a/src/mame/drivers/crystal.cpp
+++ b/src/mame/drivers/crystal.cpp
@@ -141,33 +141,21 @@ Notes:
#include "machine/nvram.h"
#include "machine/eepromser.h"
#include "machine/vrender0.h"
-#include "sound/vrender0.h"
-#include "video/vrender0.h"
-#include "emupal.h"
-#include "screen.h"
-#include "speaker.h"
#include <algorithm>
-#define IDLE_LOOP_SPEEDUP
-
class crystal_state : public driver_device
{
public:
crystal_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_workram(*this, "workram"),
- m_textureram(*this, "textureram"),
- m_frameram(*this, "frameram"),
m_reset_patch(*this, "reset_patch"),
m_flash(*this, "flash"),
m_mainbank(*this, "mainbank"),
m_maincpu(*this, "maincpu"),
m_vr0soc(*this, "vr0soc"),
- m_vr0vid(*this, "vr0vid"),
- m_vr0snd(*this, "vr0snd"),
m_ds1302(*this, "rtc"),
- m_screen(*this, "screen"),
m_eeprom(*this, "eeprom")
{ }
@@ -184,8 +172,6 @@ public:
private:
/* memory pointers */
required_shared_ptr<uint32_t> m_workram;
- required_shared_ptr<uint32_t> m_textureram;
- required_shared_ptr<uint32_t> m_frameram;
optional_shared_ptr<uint32_t> m_reset_patch;
optional_region_ptr<uint32_t> m_flash;
@@ -194,18 +180,9 @@ private:
/* devices */
required_device<se3208_device> m_maincpu;
required_device<vrender0soc_device> m_vr0soc;
- required_device<vr0video_device> m_vr0vid;
- required_device<vr0sound_device> m_vr0snd;
required_device<ds1302_device> m_ds1302;
- required_device<screen_device> m_screen;
optional_device<eeprom_serial_93cxx_device> m_eeprom;
-#ifdef IDLE_LOOP_SPEEDUP
- uint8_t m_FlipCntRead;
- DECLARE_WRITE_LINE_MEMBER(idle_skip_resume_w);
- DECLARE_WRITE_LINE_MEMBER(idle_skip_speedup_w);
-#endif
-
uint32_t m_Bank;
uint32_t m_maxbank;
uint32_t m_FlashCmd;
@@ -219,8 +196,6 @@ private:
virtual void machine_start() override;
virtual void machine_reset() override;
- uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- DECLARE_WRITE_LINE_MEMBER(screen_vblank);
void PatchReset();
void crystal_mem(address_map &map);
@@ -231,51 +206,11 @@ private:
uint32_t m_PIO;
};
-uint32_t crystal_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
-{
- if (m_vr0soc->crt_is_blanked()) // Blank Screen
- {
- bitmap.fill(0, cliprect);
- return 0;
- }
-
- m_vr0vid->screen_update(screen, bitmap, cliprect);
- return 0;
-}
-
-WRITE_LINE_MEMBER(crystal_state::screen_vblank)
-{
- // rising edge
- if (state)
- {
- if (m_vr0soc->crt_active_vblank_irq() == true)
- m_vr0soc->IntReq(24); //VRender0 VBlank
-
- m_vr0vid->execute_drawing();
- }
-}
-
IRQ_CALLBACK_MEMBER(crystal_state::icallback)
{
return m_vr0soc->irq_callback();
}
-
-#ifdef IDLE_LOOP_SPEEDUP
-WRITE_LINE_MEMBER(crystal_state::idle_skip_resume_w)
-{
- m_FlipCntRead = 0;
- m_maincpu->resume(SUSPEND_REASON_SPIN);
-}
-
-WRITE_LINE_MEMBER(crystal_state::idle_skip_speedup_w)
-{
- m_FlipCntRead++;
- if (m_FlipCntRead >= 16 && m_vr0soc->irq_pending() == false && state == ASSERT_LINE)
- m_maincpu->suspend(SUSPEND_REASON_SPIN, 1);
-}
-#endif
-
READ32_MEMBER(crystal_state::system_input_r)
{
return ( ioport("SYSTEM")->read() << 16) | (ioport("DSW")->read()) | 0xff00ff00;
@@ -368,10 +303,7 @@ void crystal_state::crystal_mem(address_map &map)
// mirror is accessed by donghaer on later levels
map(0x02000000, 0x027fffff).mirror(0x00800000).ram().share("workram");
- map(0x03000000, 0x0300ffff).m(m_vr0vid, FUNC(vr0video_device::regs_map));
- map(0x03800000, 0x03ffffff).ram().share("textureram");
- map(0x04000000, 0x047fffff).ram().share("frameram");
- map(0x04800000, 0x04800fff).rw(m_vr0snd, FUNC(vr0sound_device::vr0_snd_read), FUNC(vr0sound_device::vr0_snd_write));
+ map(0x03000000, 0x04ffffff).m(m_vr0soc, FUNC(vrender0soc_device::audiovideo_map));
map(0x05000000, 0x05ffffff).bankr("mainbank");
map(0x05000000, 0x05000003).rw(FUNC(crystal_state::FlashCmd_r), FUNC(crystal_state::FlashCmd_w));
@@ -433,9 +365,6 @@ loop:
void crystal_state::machine_start()
{
- m_vr0vid->set_areas(reinterpret_cast<uint8_t*>(m_textureram.target()), reinterpret_cast<uint16_t*>(m_frameram.target()));
- m_vr0snd->set_areas(m_textureram, m_frameram);
-
PatchReset();
if (m_mainbank)
@@ -452,10 +381,6 @@ void crystal_state::machine_start()
m_mainbank->configure_entry(i, dummy_region);
}
}
-
-#ifdef IDLE_LOOP_SPEEDUP
- save_item(NAME(m_FlipCntRead));
-#endif
}
void crystal_state::machine_reset()
@@ -464,10 +389,6 @@ void crystal_state::machine_reset()
m_mainbank->set_entry(m_Bank);
m_FlashCmd = 0xff;
-#ifdef IDLE_LOOP_SPEEDUP
- m_FlipCntRead = 0;
-#endif
-
PatchReset();
}
@@ -636,33 +557,10 @@ void crystal_state::crystal(machine_config &config)
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
- SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
- // evolution soccer defaults
- m_screen->set_raw((XTAL(14'318'180)*2)/4, 455, 0, 320, 262, 0, 240);
- m_screen->set_screen_update(FUNC(crystal_state::screen_update));
- m_screen->screen_vblank().set(FUNC(crystal_state::screen_vblank));
- m_screen->set_palette("palette");
-
- VRENDER0_SOC(config, m_vr0soc, 0);
+ VRENDER0_SOC(config, m_vr0soc, 14318180 * 3);
m_vr0soc->set_host_cpu_tag(m_maincpu);
- m_vr0soc->set_host_screen_tag(m_screen);
-
- VIDEO_VRENDER0(config, m_vr0vid, 14318180, m_maincpu);
- #ifdef IDLE_LOOP_SPEEDUP
- m_vr0soc->idleskip_cb().set(FUNC(crystal_state::idle_skip_resume_w));
- m_vr0vid->idleskip_cb().set(FUNC(crystal_state::idle_skip_speedup_w));
- #endif
-
- PALETTE(config, "palette", palette_device::RGB_565);
-
+
DS1302(config, m_ds1302, 32.768_kHz_XTAL);
-
- SPEAKER(config, "lspeaker").front_left();
- SPEAKER(config, "rspeaker").front_right();
-
- SOUND_VRENDER0(config, m_vr0snd, 0);
- m_vr0snd->add_route(0, "lspeaker", 1.0);
- m_vr0snd->add_route(1, "rspeaker", 1.0);
}