diff options
author | Vas Crabb <vas@vastheman.com> | 2015-12-10 16:23:34 +1100 |
---|---|---|
committer | Vas Crabb <vas@vastheman.com> | 2015-12-11 23:34:37 +1100 |
commit | ac245e3ff741bdb91bfc8c826c723f19a182d88b (patch) | |
tree | 038483e365a907b57304986583044fc88e3c9d33 /src/mame/drivers | |
parent | 18966159a0ad63083bcdb28869bdbf10d140e6d5 (diff) |
Re-write S2636 from scratch as needed for subhuntr:
* Needs raw screen parameters and calls from scanline timer to work properly
* Collision and completion bits generated correctly including duplicates
* Supports background and score display
* Generates audio tone from line frequency
* Probably hurts performance when rendering per frame
Diffstat (limited to 'src/mame/drivers')
-rw-r--r-- | src/mame/drivers/cvs.cpp | 15 | ||||
-rw-r--r-- | src/mame/drivers/galaxia.cpp | 12 | ||||
-rw-r--r-- | src/mame/drivers/laserbat.cpp | 18 | ||||
-rw-r--r-- | src/mame/drivers/malzak.cpp | 12 | ||||
-rw-r--r-- | src/mame/drivers/quasar.cpp | 3 | ||||
-rw-r--r-- | src/mame/drivers/seabattl.cpp | 5 | ||||
-rw-r--r-- | src/mame/drivers/zac2650.cpp | 1 |
7 files changed, 23 insertions, 43 deletions
diff --git a/src/mame/drivers/cvs.cpp b/src/mame/drivers/cvs.cpp index 4c013254dfa..f3ec7e6ed80 100644 --- a/src/mame/drivers/cvs.cpp +++ b/src/mame/drivers/cvs.cpp @@ -155,7 +155,7 @@ READ8_MEMBER(cvs_state::cvs_s2636_0_or_character_ram_r) if (m_s2650_flag) return m_character_ram[(0 * 0x800) | 0x400 | m_character_ram_page_start | offset]; else - return m_s2636_0->work_ram_r(space, offset); + return m_s2636_0->read(space, offset); } WRITE8_MEMBER(cvs_state::cvs_s2636_0_or_character_ram_w) @@ -167,7 +167,7 @@ WRITE8_MEMBER(cvs_state::cvs_s2636_0_or_character_ram_w) m_gfxdecode->gfx(1)->mark_dirty((offset / 8) % 256); } else - m_s2636_0->work_ram_w(space, offset, data); + m_s2636_0->write(space, offset, data); } @@ -176,7 +176,7 @@ READ8_MEMBER(cvs_state::cvs_s2636_1_or_character_ram_r) if (m_s2650_flag) return m_character_ram[(1 * 0x800) | 0x400 | m_character_ram_page_start | offset]; else - return m_s2636_1->work_ram_r(space, offset); + return m_s2636_1->read(space, offset); } WRITE8_MEMBER(cvs_state::cvs_s2636_1_or_character_ram_w) @@ -188,7 +188,7 @@ WRITE8_MEMBER(cvs_state::cvs_s2636_1_or_character_ram_w) m_gfxdecode->gfx(1)->mark_dirty((offset / 8) % 256); } else - m_s2636_1->work_ram_w(space, offset, data); + m_s2636_1->write(space, offset, data); } @@ -197,7 +197,7 @@ READ8_MEMBER(cvs_state::cvs_s2636_2_or_character_ram_r) if (m_s2650_flag) return m_character_ram[(2 * 0x800) | 0x400 | m_character_ram_page_start | offset]; else - return m_s2636_2->work_ram_r(space, offset); + return m_s2636_2->read(space, offset); } WRITE8_MEMBER(cvs_state::cvs_s2636_2_or_character_ram_w) @@ -209,7 +209,7 @@ WRITE8_MEMBER(cvs_state::cvs_s2636_2_or_character_ram_w) m_gfxdecode->gfx(1)->mark_dirty((offset / 8) % 256); } else - m_s2636_2->work_ram_w(space, offset, data); + m_s2636_2->write(space, offset, data); } @@ -1011,15 +1011,12 @@ static MACHINE_CONFIG_START( cvs, cvs_state ) MCFG_SCREEN_PALETTE("palette") MCFG_DEVICE_ADD("s2636_0", S2636, 0) - MCFG_S2636_WORKRAM_SIZE(0x100) MCFG_S2636_OFFSETS(CVS_S2636_Y_OFFSET, CVS_S2636_X_OFFSET) MCFG_DEVICE_ADD("s2636_1", S2636, 0) - MCFG_S2636_WORKRAM_SIZE(0x100) MCFG_S2636_OFFSETS(CVS_S2636_Y_OFFSET, CVS_S2636_X_OFFSET) MCFG_DEVICE_ADD("s2636_2", S2636, 0) - MCFG_S2636_WORKRAM_SIZE(0x100) MCFG_S2636_OFFSETS(CVS_S2636_Y_OFFSET, CVS_S2636_X_OFFSET) /* audio hardware */ diff --git a/src/mame/drivers/galaxia.cpp b/src/mame/drivers/galaxia.cpp index 1e52fa6f881..23723f1ffce 100644 --- a/src/mame/drivers/galaxia.cpp +++ b/src/mame/drivers/galaxia.cpp @@ -130,9 +130,9 @@ READ8_MEMBER(galaxia_state::galaxia_collision_clear) static ADDRESS_MAP_START( galaxia_mem_map, AS_PROGRAM, 8, galaxia_state ) AM_RANGE(0x0000, 0x13ff) AM_ROM AM_RANGE(0x1400, 0x14ff) AM_MIRROR(0x6000) AM_RAM AM_SHARE("bullet_ram") - AM_RANGE(0x1500, 0x15ff) AM_MIRROR(0x6000) AM_DEVREADWRITE("s2636_0", s2636_device, work_ram_r, work_ram_w) - AM_RANGE(0x1600, 0x16ff) AM_MIRROR(0x6000) AM_DEVREADWRITE("s2636_1", s2636_device, work_ram_r, work_ram_w) - AM_RANGE(0x1700, 0x17ff) AM_MIRROR(0x6000) AM_DEVREADWRITE("s2636_2", s2636_device, work_ram_r, work_ram_w) + AM_RANGE(0x1500, 0x15ff) AM_MIRROR(0x6000) AM_DEVREADWRITE("s2636_0", s2636_device, read, write) + AM_RANGE(0x1600, 0x16ff) AM_MIRROR(0x6000) AM_DEVREADWRITE("s2636_1", s2636_device, read, write) + AM_RANGE(0x1700, 0x17ff) AM_MIRROR(0x6000) AM_DEVREADWRITE("s2636_2", s2636_device, read, write) AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x6000) AM_READ(cvs_video_or_color_ram_r) AM_WRITE(galaxia_video_w) AM_SHARE("video_ram") AM_RANGE(0x1c00, 0x1fff) AM_MIRROR(0x6000) AM_RAM AM_RANGE(0x2000, 0x33ff) AM_ROM @@ -142,7 +142,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( astrowar_mem_map, AS_PROGRAM, 8, galaxia_state ) AM_RANGE(0x0000, 0x13ff) AM_ROM AM_RANGE(0x1400, 0x14ff) AM_MIRROR(0x6000) AM_RAM - AM_RANGE(0x1500, 0x15ff) AM_MIRROR(0x6000) AM_DEVREADWRITE("s2636_0", s2636_device, work_ram_r, work_ram_w) + AM_RANGE(0x1500, 0x15ff) AM_MIRROR(0x6000) AM_DEVREADWRITE("s2636_0", s2636_device, read, write) AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x6000) AM_READ(cvs_video_or_color_ram_r) AM_WRITE(galaxia_video_w) AM_SHARE("video_ram") AM_RANGE(0x1c00, 0x1cff) AM_MIRROR(0x6000) AM_RAM AM_SHARE("bullet_ram") AM_RANGE(0x2000, 0x33ff) AM_ROM @@ -307,17 +307,14 @@ static MACHINE_CONFIG_START( galaxia, galaxia_state ) MCFG_VIDEO_START_OVERRIDE(galaxia_state,galaxia) MCFG_DEVICE_ADD("s2636_0", S2636, 0) - MCFG_S2636_WORKRAM_SIZE(0x100) MCFG_S2636_OFFSETS(3, -26) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MCFG_DEVICE_ADD("s2636_1", S2636, 0) - MCFG_S2636_WORKRAM_SIZE(0x100) MCFG_S2636_OFFSETS(3, -26) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MCFG_DEVICE_ADD("s2636_2", S2636, 0) - MCFG_S2636_WORKRAM_SIZE(0x100) MCFG_S2636_OFFSETS(3, -26) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) @@ -352,7 +349,6 @@ static MACHINE_CONFIG_START( astrowar, galaxia_state ) MCFG_VIDEO_START_OVERRIDE(galaxia_state,astrowar) MCFG_DEVICE_ADD("s2636_0", S2636, 0) - MCFG_S2636_WORKRAM_SIZE(0x100) MCFG_S2636_OFFSETS(3, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) diff --git a/src/mame/drivers/laserbat.cpp b/src/mame/drivers/laserbat.cpp index 12d7da251bc..bf52a8c25dd 100644 --- a/src/mame/drivers/laserbat.cpp +++ b/src/mame/drivers/laserbat.cpp @@ -165,9 +165,9 @@ static ADDRESS_MAP_START( laserbat_map, AS_PROGRAM, 8, laserbat_state ) AM_RANGE(0x7800, 0x7bff) AM_ROM AM_RANGE(0x1400, 0x14ff) AM_MIRROR(0x6000) AM_WRITENOP // always 0 (bullet ram in Quasar) - AM_RANGE(0x1500, 0x15ff) AM_MIRROR(0x6000) AM_DEVREADWRITE("s2636_1", s2636_device, work_ram_r, work_ram_w) - AM_RANGE(0x1600, 0x16ff) AM_MIRROR(0x6000) AM_DEVREADWRITE("s2636_2", s2636_device, work_ram_r, work_ram_w) - AM_RANGE(0x1700, 0x17ff) AM_MIRROR(0x6000) AM_DEVREADWRITE("s2636_3", s2636_device, work_ram_r, work_ram_w) + AM_RANGE(0x1500, 0x15ff) AM_MIRROR(0x6000) AM_DEVREADWRITE("s2636_1", s2636_device, read, write) + AM_RANGE(0x1600, 0x16ff) AM_MIRROR(0x6000) AM_DEVREADWRITE("s2636_2", s2636_device, read, write) + AM_RANGE(0x1700, 0x17ff) AM_MIRROR(0x6000) AM_DEVREADWRITE("s2636_3", s2636_device, read, write) AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x6000) AM_WRITE(laserbat_videoram_w) AM_RANGE(0x1c00, 0x1fff) AM_MIRROR(0x6000) AM_RAM ADDRESS_MAP_END @@ -496,9 +496,9 @@ UINT32 laserbat_state::screen_update_laserbat(screen_device &screen, bitmap_ind1 m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); /* update the S2636 chips */ - bitmap_ind16 &s2636_1_bitmap = m_s2636_1->update(cliprect); - bitmap_ind16 &s2636_2_bitmap = m_s2636_2->update(cliprect); - bitmap_ind16 &s2636_3_bitmap = m_s2636_3->update(cliprect); + bitmap_ind16 const &s2636_1_bitmap = m_s2636_1->update(cliprect); + bitmap_ind16 const &s2636_2_bitmap = m_s2636_2->update(cliprect); + bitmap_ind16 const &s2636_3_bitmap = m_s2636_3->update(cliprect); /* copy the S2636 images into the main bitmap */ for (y = cliprect.min_y; y <= cliprect.max_y; y++) @@ -670,15 +670,12 @@ static MACHINE_CONFIG_START( laserbat, laserbat_state ) MCFG_PALETTE_ADD("palette", 1024) MCFG_DEVICE_ADD("s2636_1", S2636, 0) - MCFG_S2636_WORKRAM_SIZE(0x100) MCFG_S2636_OFFSETS(0, -19) MCFG_DEVICE_ADD("s2636_2", S2636, 0) - MCFG_S2636_WORKRAM_SIZE(0x100) MCFG_S2636_OFFSETS(0, -19) MCFG_DEVICE_ADD("s2636_3", S2636, 0) - MCFG_S2636_WORKRAM_SIZE(0x100) MCFG_S2636_OFFSETS(0, -19) /* sound hardware */ @@ -738,15 +735,12 @@ static MACHINE_CONFIG_START( catnmous, laserbat_state ) MCFG_PALETTE_ADD("palette", 1024) MCFG_DEVICE_ADD("s2636_1", S2636, 0) - MCFG_S2636_WORKRAM_SIZE(0x100) MCFG_S2636_OFFSETS(0, -19) MCFG_DEVICE_ADD("s2636_2", S2636, 0) - MCFG_S2636_WORKRAM_SIZE(0x100) MCFG_S2636_OFFSETS(0, -19) MCFG_DEVICE_ADD("s2636_3", S2636, 0) - MCFG_S2636_WORKRAM_SIZE(0x100) MCFG_S2636_OFFSETS(0, -19) /* sound hardware */ diff --git a/src/mame/drivers/malzak.cpp b/src/mame/drivers/malzak.cpp index ae3997d1f4f..eb65b80951f 100644 --- a/src/mame/drivers/malzak.cpp +++ b/src/mame/drivers/malzak.cpp @@ -74,7 +74,7 @@ READ8_MEMBER(malzak_state::fake_VRLE_r) { - return (m_s2636_0->work_ram_r(space, 0xcb) & 0x3f) + (m_screen->vblank() * 0x40); + return (m_s2636_0->read(space, 0xcb) & 0x3f) + (m_screen->vblank() * 0x40); } READ8_MEMBER(malzak_state::s2636_portA_r) @@ -106,8 +106,8 @@ static ADDRESS_MAP_START( malzak_map, AS_PROGRAM, 8, malzak_state ) AM_RANGE(0x1200, 0x12ff) AM_MIRROR(0x6000) AM_RAM AM_RANGE(0x1300, 0x13ff) AM_MIRROR(0x6000) AM_RAM AM_RANGE(0x14cb, 0x14cb) AM_MIRROR(0x6000) AM_READ(fake_VRLE_r) - AM_RANGE(0x1400, 0x14ff) AM_MIRROR(0x6000) AM_DEVREADWRITE("s2636_0", s2636_device, work_ram_r, work_ram_w) - AM_RANGE(0x1500, 0x15ff) AM_MIRROR(0x6000) AM_DEVREADWRITE("s2636_1", s2636_device, work_ram_r, work_ram_w) + AM_RANGE(0x1400, 0x14ff) AM_MIRROR(0x6000) AM_DEVREADWRITE("s2636_0", s2636_device, read, write) + AM_RANGE(0x1500, 0x15ff) AM_MIRROR(0x6000) AM_DEVREADWRITE("s2636_1", s2636_device, read, write) AM_RANGE(0x1600, 0x16ff) AM_MIRROR(0x6000) AM_RAM_WRITE(malzak_playfield_w) AM_RANGE(0x1700, 0x17ff) AM_MIRROR(0x6000) AM_RAM AM_RANGE(0x1800, 0x1fff) AM_MIRROR(0x6000) AM_RAM AM_SHARE("videoram") @@ -127,8 +127,8 @@ static ADDRESS_MAP_START( malzak2_map, AS_PROGRAM, 8, malzak_state ) AM_RANGE(0x1300, 0x13ff) AM_MIRROR(0x6000) AM_RAM AM_RANGE(0x14cb, 0x14cb) AM_MIRROR(0x6000) AM_READ(fake_VRLE_r) AM_RANGE(0x14cc, 0x14cc) AM_MIRROR(0x6000) AM_READ(s2636_portA_r) - AM_RANGE(0x1400, 0x14ff) AM_MIRROR(0x6000) AM_DEVREADWRITE("s2636_0", s2636_device, work_ram_r, work_ram_w) - AM_RANGE(0x1500, 0x15ff) AM_MIRROR(0x6000) AM_DEVREADWRITE("s2636_1", s2636_device, work_ram_r, work_ram_w) + AM_RANGE(0x1400, 0x14ff) AM_MIRROR(0x6000) AM_DEVREADWRITE("s2636_0", s2636_device, read, write) + AM_RANGE(0x1500, 0x15ff) AM_MIRROR(0x6000) AM_DEVREADWRITE("s2636_1", s2636_device, read, write) AM_RANGE(0x1600, 0x16ff) AM_MIRROR(0x6000) AM_RAM_WRITE(malzak_playfield_w) AM_RANGE(0x1700, 0x17ff) AM_MIRROR(0x6000) AM_RAM AM_SHARE("nvram") AM_RANGE(0x1800, 0x1fff) AM_MIRROR(0x6000) AM_RAM AM_SHARE("videoram") @@ -317,12 +317,10 @@ static MACHINE_CONFIG_START( malzak, malzak_state ) MCFG_PALETTE_INIT_OWNER(malzak_state, malzak) MCFG_DEVICE_ADD("s2636_0", S2636, 0) - MCFG_S2636_WORKRAM_SIZE(0x100) MCFG_S2636_OFFSETS(0, -16) // -8, -16 MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MCFG_DEVICE_ADD("s2636_1", S2636, 0) - MCFG_S2636_WORKRAM_SIZE(0x100) MCFG_S2636_OFFSETS(0, -16) // -9, -16 MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) diff --git a/src/mame/drivers/quasar.cpp b/src/mame/drivers/quasar.cpp index 75819f076a3..544c6c12ce3 100644 --- a/src/mame/drivers/quasar.cpp +++ b/src/mame/drivers/quasar.cpp @@ -327,15 +327,12 @@ static MACHINE_CONFIG_START( quasar, quasar_state ) MCFG_PALETTE_INIT_OWNER(quasar_state,quasar) MCFG_DEVICE_ADD("s2636_0", S2636, 0) - MCFG_S2636_WORKRAM_SIZE(0x100) MCFG_S2636_OFFSETS(CVS_S2636_Y_OFFSET, CVS_S2636_X_OFFSET) MCFG_DEVICE_ADD("s2636_1", S2636, 0) - MCFG_S2636_WORKRAM_SIZE(0x100) MCFG_S2636_OFFSETS(CVS_S2636_Y_OFFSET, CVS_S2636_X_OFFSET) MCFG_DEVICE_ADD("s2636_2", S2636, 0) - MCFG_S2636_WORKRAM_SIZE(0x100) MCFG_S2636_OFFSETS(CVS_S2636_Y_OFFSET, CVS_S2636_X_OFFSET) MCFG_VIDEO_START_OVERRIDE(quasar_state,quasar) diff --git a/src/mame/drivers/seabattl.cpp b/src/mame/drivers/seabattl.cpp index 1ad8b99ccc7..332a6966f91 100644 --- a/src/mame/drivers/seabattl.cpp +++ b/src/mame/drivers/seabattl.cpp @@ -190,7 +190,7 @@ UINT32 seabattl_state::screen_update_seabattl(screen_device &screen, bitmap_ind1 } } - bitmap_ind16 &s2636_0_bitmap = m_s2636->update(cliprect); + bitmap_ind16 const &s2636_0_bitmap = m_s2636->update(cliprect); // collisions for (y = cliprect.min_y; y <= cliprect.max_y; y++) @@ -261,7 +261,7 @@ static ADDRESS_MAP_START( seabattl_map, AS_PROGRAM, 8, seabattl_state ) AM_RANGE(0x1e06, 0x1e06) AM_MIRROR(0x20f0) AM_READ_PORT("DIPS1") AM_WRITE(sound_w) AM_RANGE(0x1e07, 0x1e07) AM_MIRROR(0x20f0) AM_READ_PORT("DIPS0") AM_WRITE(sound2_w) AM_RANGE(0x1fcc, 0x1fcc) AM_MIRROR(0x2000) AM_READ_PORT("IN1") - AM_RANGE(0x1f00, 0x1fff) AM_MIRROR(0x2000) AM_DEVREADWRITE("s2636", s2636_device, work_ram_r, work_ram_w) + AM_RANGE(0x1f00, 0x1fff) AM_MIRROR(0x2000) AM_DEVREADWRITE("s2636", s2636_device, read, write) ADDRESS_MAP_END static ADDRESS_MAP_START( seabattl_io_map, AS_IO, 8, seabattl_state ) @@ -483,7 +483,6 @@ static MACHINE_CONFIG_START( seabattl, seabattl_state ) MCFG_CPU_VBLANK_INT_DRIVER("screen", seabattl_state, seabattl_interrupt) MCFG_DEVICE_ADD("s2636", S2636, 0) - MCFG_S2636_WORKRAM_SIZE(0x100) MCFG_S2636_OFFSETS(3, -21) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) diff --git a/src/mame/drivers/zac2650.cpp b/src/mame/drivers/zac2650.cpp index 33aaf20123c..0672bf1218a 100644 --- a/src/mame/drivers/zac2650.cpp +++ b/src/mame/drivers/zac2650.cpp @@ -261,7 +261,6 @@ static MACHINE_CONFIG_START( tinvader, zac2650_state ) MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_DEVICE_ADD("s2636", S2636, 0) - MCFG_S2636_WORKRAM_SIZE(0x100) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MACHINE_CONFIG_END |