1 /* Rotary Fighter
2 
3 driver by Barry Rodewald
4  based on Initial work by David Haywood
5 
6  todo:
7 
8  sound
9  verify game speed if possible (related to # of interrupts)
10 
11 */
12 
13 #include "driver.h"
14 #include "8080bw.h"
15 #include "vidhrdw/generic.h"
16 #include "cpu/i8085/i8085.h"
17 
18 
PALETTE_INIT(rotaryf)19 static PALETTE_INIT( rotaryf )
20 {
21 	palette_set_color(0,0x00,0x00,0x00); /* black */
22 	palette_set_color(1,0xff,0xff,0xff); /* white */
23 }
24 
INTERRUPT_GEN(rotaryf_interrupt)25 INTERRUPT_GEN( rotaryf_interrupt )
26 {
27 	if(cpu_getvblank())
28 		cpu_set_irq_line(0,I8085_RST55_LINE,HOLD_LINE);
29 	else
30 		cpu_set_irq_line(0,I8085_RST75_LINE,HOLD_LINE);
31 
32 }
33 
MEMORY_READ_START(rotaryf_readmem)34 static MEMORY_READ_START( rotaryf_readmem )
35 	{ 0x0000, 0x03ff, MRA_ROM },
36 	{ 0x4000, 0x57ff, MRA_ROM },
37 //	{ 0x6ffb, 0x6ffb, random_r }, ??
38 //	{ 0x6ffd, 0x6ffd, random_r }, ??
39 //	{ 0x6fff, 0x6fff, random_r }, ??
40 	{ 0x7000, 0x73ff, MRA_RAM },
41 	{ 0x8000, 0x9fff, MRA_RAM },
42 	{ 0xa000, 0xa1ff, MRA_RAM },
43 MEMORY_END
44 
45 static MEMORY_WRITE_START( rotaryf_writemem )
46 	{ 0x0000, 0x03ff, MWA_ROM },
47 	{ 0x4000, 0x57ff, MWA_ROM },
48 	{ 0x7000, 0x73ff, MWA_RAM }, // clears to 1ff ?
49 	{ 0x8000, 0x9fff, c8080bw_videoram_w, &videoram, &videoram_size },
50 	{ 0xa000, 0xa1ff, MWA_RAM },
51 MEMORY_END
52 
53 static PORT_READ_START( rotaryf_readport )
54 //	{ 0x00, 0x00, input_port_0_r },
55 	{ 0x21, 0x21, input_port_1_r },
56 	{ 0x29, 0x29, input_port_2_r },
57 	{ 0x26, 0x26, input_port_3_r },
58 //	{ 0x28, 0x28, c8080bw_shift_data_r },
59 PORT_END
60 
61 static PORT_WRITE_START( rotaryf_writeport )
62 //	{ 0x21, 0x21, c8080bw_shift_amount_w },
63 //	{ 0x28, 0x28, c8080bw_shift_data_w },
64 PORT_END
65 
66 INPUT_PORTS_START( rotaryf )
67 	PORT_START      /* IN0 */
68 	PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN )
69 	PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
70 	PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
71 	PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
72 	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
73 	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
74 	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
75 	PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
76 
77 	PORT_START      /* IN1 */
78 	PORT_BIT_IMPULSE( 0x20, IP_ACTIVE_HIGH, IPT_COIN1, 1 )
79 
80 	PORT_START
81 	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
82 	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
83 	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_2WAY )
84 	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_2WAY )
85 	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_2WAY | IPF_PLAYER2 )
86 	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_2WAY | IPF_PLAYER2 )
87 	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
88 	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
89 
90 	PORT_START      /* DSW0 */
91 	PORT_DIPNAME( 0x81, 0x00, DEF_STR( Lives ) )
92 	PORT_DIPSETTING(    0x81, "3" )
93 	PORT_DIPSETTING(    0x01, "4" )
94 	PORT_DIPSETTING(    0x80, "5" )
95 	PORT_DIPSETTING(    0x00, "6" )
96 	PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
97 	PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
98 	PORT_DIPSETTING( 0x02, DEF_STR( On ) )
99 	PORT_DIPNAME( 0x04, 0x00, DEF_STR( Bonus_Life ) )
100 	PORT_DIPSETTING( 0x04, "1000" )
101 	PORT_DIPSETTING( 0x00, "1500" )
102 	PORT_DIPNAME( 0x08, 0x00, DEF_STR( Coinage ) )
103 	PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
104 	PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
105 	PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
106 	PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
107 	PORT_DIPSETTING( 0x10, DEF_STR( On ) )
108 	PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
109 	PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
110 	PORT_DIPSETTING( 0x20, DEF_STR( On ) )
111 	PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
112 	PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
113 	PORT_DIPSETTING( 0x40, DEF_STR( On ) )
114 //	PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER2 )
115 //	PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_2WAY | IPF_PLAYER2 )
116 //	PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_2WAY | IPF_PLAYER2 )
117 
118 	PORT_START		/* Dummy port for cocktail mode */
119 	PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
120 	PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
121 	PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
122 INPUT_PORTS_END
123 
124 
125 static MACHINE_DRIVER_START( rotaryf )
126 
127 	/* basic machine hardware */
128 	MDRV_CPU_ADD_TAG("main",8085A,2000000) /* 8080? */ /* 2 MHz? */
129 	MDRV_CPU_MEMORY(rotaryf_readmem,rotaryf_writemem)
130 	MDRV_CPU_PORTS(rotaryf_readport,rotaryf_writeport)
131 	MDRV_CPU_VBLANK_INT(rotaryf_interrupt,5)
132 	MDRV_FRAMES_PER_SECOND(60)
133 	MDRV_VBLANK_DURATION(DEFAULT_REAL_60HZ_VBLANK_DURATION)
134 
135 	/* video hardware */
136 	MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
137 	MDRV_SCREEN_SIZE(32*8, 32*8)
138 	MDRV_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
139 	MDRV_PALETTE_LENGTH(2)
140 	MDRV_PALETTE_INIT(rotaryf)
141 	MDRV_VIDEO_START(generic_bitmapped)
142 	MDRV_VIDEO_UPDATE(8080bw)
143 
144 	/* sound hardware */
145 	MDRV_SOUND_ADD(SAMPLES, invaders_samples_interface)
146 	MDRV_SOUND_ADD(SN76477, invaders_sn76477_interface)
147 
148 MACHINE_DRIVER_END
149 
150 ROM_START( rotaryf )
151 	ROM_REGION( 0x10000, REGION_CPU1, 0 )     /* 64k for code */
152 	ROM_LOAD( "krf-1.bin",            0x0000, 0x0400, CRC(f7b2d3e6) SHA1(be7afc1a14be60cb895fc4180167353c7156fc4c) )
153 	ROM_RELOAD (                      0x4000, 0x0400             )
154 	ROM_LOAD( "krf-2.bin",			  0x4400, 0x0400, CRC(be9f047a) SHA1(e5dd2b5b4fda7f178e7f1137592ba49fbc9cc82e) )
155 	ROM_LOAD( "krf-3.bin",            0x4800, 0x0400, CRC(c7629eb6) SHA1(03aae964783ce4b1de77737e83fd2094483fbda4) )
156 	ROM_LOAD( "krf-4.bin",            0x4c00, 0x0400, CRC(b4703093) SHA1(9239d6da818049bc98a631c3bf5b962b5df5b2ea) )
157 	ROM_LOAD( "krf-5.bin",            0x5000, 0x0400, CRC(ae233f07) SHA1(a7bbd2ee4477ee041d170e2fc4e94c99c3b564fc) )
158 	ROM_LOAD( "krf-6.bin",            0x5400, 0x0400, CRC(e28b3713) SHA1(428f73891125f80c722357f1029b18fa9416bcfd) )
159 ROM_END
160 
161 GAMEX(19??, rotaryf, 0,        rotaryf, rotaryf, 8080bw,	ROT270,   "<unknown>", "Rotary Fighter", GAME_NO_SOUND )
162