Previous 199869 Revisions Next

r36733 Saturday 28th March, 2015 at 07:21:59 UTC by Osso
route16.c: added save state support (nw)
[src/mame/drivers]route16.c
[src/mame/includes]route16.h
[src/mame/video]route16.c

trunk/src/mame/drivers/route16.c
r245244r245245
66
77 Notes: Route 16 and Stratovox use identical hardware with the following
88        exceptions: Stratovox has a DAC for voice.
9        Route 16 has the added ability to turn off each bitplane indiviaually.
9        Route 16 has the added ability to turn off each bitplane individually.
1010        This looks like an afterthought, as one of the same bits that control
1111        the palette selection is doubly utilized as the bitmap enable bit.
1212
r245244r245245
8686
8787
8888
89READ8_MEMBER(route16_state::sharedram_r)
90{
91   return m_sharedram[offset];
92}
93
94
95WRITE8_MEMBER(route16_state::sharedram_w)
96{
97   m_sharedram[offset] = data;
98}
99
100
10189WRITE8_MEMBER(route16_state::route16_sharedram_w)
10290{
10391   m_sharedram[offset] = data;
r245244r245245
214202static ADDRESS_MAP_START( route16_cpu1_map, AS_PROGRAM, 8, route16_state )
215203   AM_RANGE(0x0000, 0x3fff) AM_ROM
216204   /*AM_RANGE(0x3000, 0x3001) AM_NOP   protection device */
217   AM_RANGE(0x4000, 0x43ff) AM_READWRITE(sharedram_r, route16_sharedram_w) AM_SHARE("sharedram")
218   AM_RANGE(0x4800, 0x4800) AM_READ_PORT("DSW") AM_WRITE(route16_out0_w)
219   AM_RANGE(0x5000, 0x5000) AM_READ_PORT("P1") AM_WRITE(route16_out1_w)
205   AM_RANGE(0x4000, 0x43ff) AM_RAM_WRITE(route16_sharedram_w) AM_SHARE("sharedram")
206   AM_RANGE(0x4800, 0x4800) AM_READ_PORT("DSW") AM_WRITE(out0_w)
207   AM_RANGE(0x5000, 0x5000) AM_READ_PORT("P1") AM_WRITE(out1_w)
220208   AM_RANGE(0x5800, 0x5800) AM_READ_PORT("P2")
221209   AM_RANGE(0x8000, 0xbfff) AM_RAM AM_SHARE("videoram1")
222210ADDRESS_MAP_END
r245244r245245
224212
225213static ADDRESS_MAP_START( routex_cpu1_map, AS_PROGRAM, 8, route16_state )
226214   AM_RANGE(0x0000, 0x3fff) AM_ROM
227   AM_RANGE(0x4000, 0x43ff) AM_READWRITE(sharedram_r, route16_sharedram_w) AM_SHARE("sharedram")
228   AM_RANGE(0x4800, 0x4800) AM_READ_PORT("DSW") AM_WRITE(route16_out0_w)
229   AM_RANGE(0x5000, 0x5000) AM_READ_PORT("P1") AM_WRITE(route16_out1_w)
215   AM_RANGE(0x4000, 0x43ff) AM_RAM_WRITE(route16_sharedram_w) AM_SHARE("sharedram")
216   AM_RANGE(0x4800, 0x4800) AM_READ_PORT("DSW") AM_WRITE(out0_w)
217   AM_RANGE(0x5000, 0x5000) AM_READ_PORT("P1") AM_WRITE(out1_w)
230218   AM_RANGE(0x5800, 0x5800) AM_READ_PORT("P2")
231219   AM_RANGE(0x6400, 0x6400) AM_READ(routex_prot_read)
232220   AM_RANGE(0x8000, 0xbfff) AM_RAM AM_SHARE("videoram1")
r245244r245245
235223
236224static ADDRESS_MAP_START( stratvox_cpu1_map, AS_PROGRAM, 8, route16_state )
237225   AM_RANGE(0x0000, 0x3fff) AM_ROM
238   AM_RANGE(0x4000, 0x43ff) AM_READWRITE(sharedram_r, sharedram_w) AM_SHARE("sharedram")
239   AM_RANGE(0x4800, 0x4800) AM_READ_PORT("DSW") AM_WRITE(route16_out0_w)
240   AM_RANGE(0x5000, 0x5000) AM_READ_PORT("P1") AM_WRITE(route16_out1_w)
226   AM_RANGE(0x4000, 0x43ff) AM_RAM AM_SHARE("sharedram")
227   AM_RANGE(0x4800, 0x4800) AM_READ_PORT("DSW") AM_WRITE(out0_w)
228   AM_RANGE(0x5000, 0x5000) AM_READ_PORT("P1") AM_WRITE(out1_w)
241229   AM_RANGE(0x5800, 0x5800) AM_READ_PORT("P2")
242230   AM_RANGE(0x8000, 0xbfff) AM_RAM AM_SHARE("videoram1")
243231ADDRESS_MAP_END
r245244r245245
245233
246234static ADDRESS_MAP_START( speakres_cpu1_map, AS_PROGRAM, 8, route16_state )
247235   AM_RANGE(0x0000, 0x3fff) AM_ROM
248   AM_RANGE(0x4000, 0x43ff) AM_READWRITE(sharedram_r, sharedram_w) AM_SHARE("sharedram")
249   AM_RANGE(0x4800, 0x4800) AM_READ_PORT("DSW") AM_WRITE(route16_out0_w)
250   AM_RANGE(0x5000, 0x5000) AM_READ_PORT("P1") AM_WRITE(route16_out1_w)
236   AM_RANGE(0x4000, 0x43ff) AM_RAM AM_SHARE("sharedram")
237   AM_RANGE(0x4800, 0x4800) AM_READ_PORT("DSW") AM_WRITE(out0_w)
238   AM_RANGE(0x5000, 0x5000) AM_READ_PORT("P1") AM_WRITE(out1_w)
251239   AM_RANGE(0x5800, 0x5800) AM_READ_PORT("P2") AM_WRITE(speakres_out2_w)
252240   AM_RANGE(0x6000, 0x6000) AM_READ(speakres_in3_r)
253241   AM_RANGE(0x8000, 0xbfff) AM_RAM AM_SHARE("videoram1")
r245244r245245
256244
257245static ADDRESS_MAP_START( ttmahjng_cpu1_map, AS_PROGRAM, 8, route16_state )
258246   AM_RANGE(0x0000, 0x3fff) AM_ROM
259   AM_RANGE(0x4000, 0x43ff) AM_READWRITE(sharedram_r, sharedram_w) AM_SHARE("sharedram")
260   AM_RANGE(0x4800, 0x4800) AM_READ_PORT("DSW") AM_WRITE(route16_out0_w)
261   AM_RANGE(0x5000, 0x5000) AM_READ_PORT("IN0") AM_WRITE(route16_out1_w)
247   AM_RANGE(0x4000, 0x43ff) AM_RAM AM_SHARE("sharedram")
248   AM_RANGE(0x4800, 0x4800) AM_READ_PORT("DSW") AM_WRITE(out0_w)
249   AM_RANGE(0x5000, 0x5000) AM_READ_PORT("IN0") AM_WRITE(out1_w)
262250   AM_RANGE(0x5800, 0x5800) AM_READWRITE(ttmahjng_input_port_matrix_r, ttmahjng_input_port_matrix_w)
263251   AM_RANGE(0x6800, 0x6800) AM_DEVWRITE("ay8910", ay8910_device, data_w)
264252   AM_RANGE(0x6900, 0x6900) AM_DEVWRITE("ay8910", ay8910_device, address_w)
r245244r245245
268256
269257static ADDRESS_MAP_START( route16_cpu2_map, AS_PROGRAM, 8, route16_state )
270258   AM_RANGE(0x0000, 0x1fff) AM_ROM
271   AM_RANGE(0x4000, 0x43ff) AM_READWRITE(sharedram_r, route16_sharedram_w)
259   AM_RANGE(0x4000, 0x43ff) AM_RAM_WRITE(route16_sharedram_w) AM_SHARE("sharedram")
272260   AM_RANGE(0x8000, 0xbfff) AM_RAM AM_SHARE("videoram2")
273261ADDRESS_MAP_END
274262
r245244r245245
276264static ADDRESS_MAP_START( stratvox_cpu2_map, AS_PROGRAM, 8, route16_state )
277265   AM_RANGE(0x0000, 0x1fff) AM_ROM
278266   AM_RANGE(0x2800, 0x2800) AM_DEVWRITE("dac", dac_device, write_unsigned8)
279   AM_RANGE(0x4000, 0x43ff) AM_READWRITE(sharedram_r, sharedram_w)
267   AM_RANGE(0x4000, 0x43ff) AM_RAM AM_SHARE("sharedram")
280268   AM_RANGE(0x8000, 0xbfff) AM_RAM AM_SHARE("videoram2")
281269ADDRESS_MAP_END
282270
r245244r245245
552540   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
553541INPUT_PORTS_END
554542
543MACHINE_START_MEMBER(route16_state, speakres)
544{
545   save_item(NAME(m_speakres_vrx));
546}
555547
548MACHINE_START_MEMBER(route16_state, ttmahjng)
549{
550   save_item(NAME(m_ttmahjng_port_select));
551}
552
553
556554static MACHINE_CONFIG_START( route16, route16_state )
557555
558556   /* basic machine hardware */
r245244r245245
596594   MCFG_CPU_MODIFY("cpu2")
597595   MCFG_CPU_PROGRAM_MAP(stratvox_cpu2_map)
598596
597
599598   /* video hardware */
600599   MCFG_SCREEN_MODIFY("screen")
601600   MCFG_SCREEN_UPDATE_DRIVER(route16_state, screen_update_stratvox)
r245244r245245
630629   /* basic machine hardware */
631630   MCFG_CPU_MODIFY("cpu1")
632631   MCFG_CPU_PROGRAM_MAP(speakres_cpu1_map)
632
633   MCFG_MACHINE_START_OVERRIDE(route16_state, speakres)
633634MACHINE_CONFIG_END
634635
635636
r245244r245245
646647   MCFG_CPU_PROGRAM_MAP(ttmahjng_cpu1_map)
647648   MCFG_CPU_IO_MAP(0)
648649
650   MCFG_MACHINE_START_OVERRIDE(route16_state, ttmahjng)
651
649652   /* video hardware */
650653   MCFG_SCREEN_MODIFY("screen")
651654   MCFG_SCREEN_UPDATE_DRIVER(route16_state, screen_update_ttmahjng)
r245244r245245
969972 *
970973 *************************************/
971974
972GAME( 1981, route16,  0,        route16,  route16, route16_state,  route16,  ROT270, "Tehkan / Sun Electronics (Centuri license)", "Route 16 (set 1)", 0 )
973GAME( 1981, route16a, route16,  route16,  route16, route16_state,  route16a, ROT270, "Tehkan / Sun Electronics (Centuri license)", "Route 16 (set 2)", 0 )
974GAME( 1981, route16b, route16,  route16,  route16, driver_device,  0,        ROT270, "bootleg", "Route 16 (bootleg)", 0 )
975GAME( 1981, routex,   route16,  routex,   route16, driver_device,  0,        ROT270, "bootleg", "Route X (bootleg)", 0 )
976GAME( 1980, speakres, 0,        speakres, speakres, driver_device, 0,        ROT270, "Sun Electronics", "Speak & Rescue", 0 )
977GAME( 1980, speakresb,speakres, speakres, speakres, driver_device, 0,        ROT270, "bootleg", "Speak & Rescue (bootleg)", 0 )
978GAME( 1980, stratvox, speakres, stratvox, stratvox, driver_device, 0,        ROT270, "Sun Electronics (Taito license)", "Stratovox", 0 )
979GAME( 1980, stratvoxb,speakres, stratvox, stratvox, driver_device, 0,        ROT270, "bootleg", "Stratovox (bootleg)", 0 )
980GAME( 1980, spacecho, speakres, spacecho, spacecho, driver_device, 0,        ROT270, "bootleg", "Space Echo (set 1)", 0 )
981GAME( 1980, spacecho2,speakres, spacecho, spacecho, driver_device, 0,        ROT270, "bootleg", "Space Echo (set 2)", 0 )
982GAME( 1981, ttmahjng, 0,        ttmahjng, ttmahjng, driver_device, 0,        ROT0,   "Taito", "T.T Mahjong", 0 )
975GAME( 1981, route16,  0,        route16,  route16, route16_state,  route16,  ROT270, "Tehkan / Sun Electronics (Centuri license)", "Route 16 (set 1)", GAME_SUPPORTS_SAVE )
976GAME( 1981, route16a, route16,  route16,  route16, route16_state,  route16a, ROT270, "Tehkan / Sun Electronics (Centuri license)", "Route 16 (set 2)", GAME_SUPPORTS_SAVE )
977GAME( 1981, route16b, route16,  route16,  route16, driver_device,  0,        ROT270, "bootleg", "Route 16 (bootleg)", GAME_SUPPORTS_SAVE )
978GAME( 1981, routex,   route16,  routex,   route16, driver_device,  0,        ROT270, "bootleg", "Route X (bootleg)", GAME_SUPPORTS_SAVE )
979GAME( 1980, speakres, 0,        speakres, speakres, driver_device, 0,        ROT270, "Sun Electronics", "Speak & Rescue", GAME_SUPPORTS_SAVE )
980GAME( 1980, speakresb,speakres, speakres, speakres, driver_device, 0,        ROT270, "bootleg", "Speak & Rescue (bootleg)", GAME_SUPPORTS_SAVE )
981GAME( 1980, stratvox, speakres, stratvox, stratvox, driver_device, 0,        ROT270, "Sun Electronics (Taito license)", "Stratovox", GAME_SUPPORTS_SAVE )
982GAME( 1980, stratvoxb,speakres, stratvox, stratvox, driver_device, 0,        ROT270, "bootleg", "Stratovox (bootleg)", GAME_SUPPORTS_SAVE )
983GAME( 1980, spacecho, speakres, spacecho, spacecho, driver_device, 0,        ROT270, "bootleg", "Space Echo (set 1)", GAME_SUPPORTS_SAVE )
984GAME( 1980, spacecho2,speakres, spacecho, spacecho, driver_device, 0,        ROT270, "bootleg", "Space Echo (set 2)", GAME_SUPPORTS_SAVE )
985GAME( 1981, ttmahjng, 0,        ttmahjng, ttmahjng, driver_device, 0,        ROT0,   "Taito", "T.T Mahjong", GAME_SUPPORTS_SAVE )
trunk/src/mame/includes/route16.h
r245244r245245
1111      m_videoram2(*this, "videoram2"){ }
1212
1313   optional_device<sn76477_device> m_sn;
14
1415   required_shared_ptr<UINT8> m_sharedram;
16   required_shared_ptr<UINT8> m_videoram1;
17   required_shared_ptr<UINT8> m_videoram2;
18
1519   UINT8 m_ttmahjng_port_select;
1620   int m_speakres_vrx;
17   required_shared_ptr<UINT8> m_videoram1;
18   required_shared_ptr<UINT8> m_videoram2;
1921   UINT8 m_flipscreen;
2022   UINT8 m_palette_1;
2123   UINT8 m_palette_2;
22   DECLARE_READ8_MEMBER(sharedram_r);
23   DECLARE_WRITE8_MEMBER(sharedram_w);
24
25   DECLARE_WRITE8_MEMBER(out0_w);
26   DECLARE_WRITE8_MEMBER(out1_w);
2427   DECLARE_WRITE8_MEMBER(route16_sharedram_w);
28   DECLARE_READ8_MEMBER(routex_prot_read);
2529   DECLARE_WRITE8_MEMBER(ttmahjng_input_port_matrix_w);
2630   DECLARE_READ8_MEMBER(ttmahjng_input_port_matrix_r);
2731   DECLARE_READ8_MEMBER(speakres_in3_r);
2832   DECLARE_WRITE8_MEMBER(speakres_out2_w);
29   DECLARE_READ8_MEMBER(routex_prot_read);
30   DECLARE_WRITE8_MEMBER(route16_out0_w);
31   DECLARE_WRITE8_MEMBER(route16_out1_w);
3233   DECLARE_WRITE8_MEMBER(stratvox_sn76477_w);
34
3335   DECLARE_DRIVER_INIT(route16);
3436   DECLARE_DRIVER_INIT(route16a);
37   DECLARE_MACHINE_START(speakres);
38   DECLARE_MACHINE_START(ttmahjng);
39   virtual void video_start();
40
3541   UINT32 screen_update_route16(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
3642   UINT32 screen_update_stratvox(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
3743   UINT32 screen_update_ttmahjng(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
trunk/src/mame/video/route16.c
r245244r245245
11/***************************************************************************
22
3  video.c
3  route16.c
44
55  Functions to emulate the video hardware of the machine.
66
r245244r245245
99#include "emu.h"
1010#include "includes/route16.h"
1111
12void route16_state::video_start()
13{
14   save_item(NAME(m_flipscreen));
15   save_item(NAME(m_palette_1));
16   save_item(NAME(m_palette_2));
17}
1218
1319/*************************************
1420 *
r245244r245245
1622 *
1723 *************************************/
1824
19WRITE8_MEMBER(route16_state::route16_out0_w)
25WRITE8_MEMBER(route16_state::out0_w)
2026{
2127   m_palette_1 = data & 0x1f;
2228
r245244r245245
2430}
2531
2632
27WRITE8_MEMBER(route16_state::route16_out1_w)
33WRITE8_MEMBER(route16_state::out1_w)
2834{
2935   m_palette_2 = data & 0x1f;
3036


Previous 199869 Revisions Next


© 1997-2024 The MAME Team