summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/subhuntr.cpp
blob: 91f0453d0c4203633368e98c572e283a051bbd78 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
// license:BSD-3-Clause
// copyright-holders:David Haywood
/*

QTY     Type    clock   position    function
2x  2636            Programmable Video Interface
1x  2650    OSC/2 = 1.7897725 MHz       8-bit Microprocessor - main
1x  oscillator  3.579545 MHz

ROMs
QTY     Type    position    status
4x  2708    6F,6H,6L,6N     dumped
1x  N82S115     2B  dumped

RAMs
QTY     Type    position
2x  2101

*/

#include "emu.h"
#include "cpu/s2650/s2650.h"
#include "machine/s2636.h"
#include "emupal.h"
#include "screen.h"
#include "speaker.h"


class subhuntr_state : public driver_device
{
public:
	subhuntr_state(const machine_config &mconfig, device_type type, const char *tag)
		: driver_device(mconfig, type, tag)
		, m_maincpu(*this, "maincpu")
	{
	}

	void subhuntr(machine_config &config);

private:
	INTERRUPT_GEN_MEMBER(subhuntr_interrupt);

	virtual void machine_start() override;
	virtual void machine_reset() override;
	virtual void video_start() override;
	DECLARE_PALETTE_INIT(subhuntr);
	uint32_t screen_update_subhuntr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);

	void subhuntr_data_map(address_map &map);
	void subhuntr_io_map(address_map &map);
	void subhuntr_map(address_map &map);

	required_device<cpu_device> m_maincpu;
};


/***************************************************************************

  Video

***************************************************************************/

PALETTE_INIT_MEMBER(subhuntr_state, subhuntr)
{
}

uint32_t subhuntr_state::screen_update_subhuntr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	return 0;
}

void subhuntr_state::video_start()
{
}


/***************************************************************************

  Memory Maps, I/O

***************************************************************************/

void subhuntr_state::subhuntr_map(address_map &map)
{
	map(0x0000, 0x0fff).rom();
	map(0x1c00, 0x1fff).ram();
}

void subhuntr_state::subhuntr_io_map(address_map &map)
{
}

void subhuntr_state::subhuntr_data_map(address_map &map)
{
//  AM_RANGE(S2650_CTRL_PORT, S2650_CTRL_PORT) AM_READWRITE( ,  )
//  AM_RANGE(S2650_DATA_PORT, S2650_DATA_PORT) AM_READWRITE( ,  )
}

/***************************************************************************

  Inputs

***************************************************************************/

static INPUT_PORTS_START( subhuntr )
INPUT_PORTS_END


/***************************************************************************

  Machine Config/Interface

***************************************************************************/

void subhuntr_state::machine_start()
{
}

void subhuntr_state::machine_reset()
{
}

INTERRUPT_GEN_MEMBER(subhuntr_state::subhuntr_interrupt)
{
	device.execute().set_input_line_and_vector(0, HOLD_LINE, 0x03);
}

static const gfx_layout tiles8x8_layout =
{
	8,8,
	RGN_FRAC(1,1),
	1,
	{ 0 },
	{ 0, 1, 2, 3, 4, 5, 6, 7 },
	{ 0*8,1*8,2*8,3*8,4*8,5*8,6*8,7*8 },
	8*8
};

static GFXDECODE_START( gfx_subhuntr )
	GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout, 0, 1 )
GFXDECODE_END


MACHINE_CONFIG_START(subhuntr_state::subhuntr)

	/* basic machine hardware */
	MCFG_DEVICE_ADD("maincpu", S2650, 14318180/4/2)
	MCFG_DEVICE_PROGRAM_MAP(subhuntr_map)
	MCFG_DEVICE_IO_MAP(subhuntr_io_map)
	MCFG_DEVICE_DATA_MAP(subhuntr_data_map)
	MCFG_DEVICE_VBLANK_INT_DRIVER("screen", subhuntr_state, subhuntr_interrupt)
	MCFG_S2650_SENSE_INPUT(READLINE("screen", screen_device, vblank))

	s2636_device &s2636(S2636(config, "s2636", 0));
	s2636.set_offsets(3, -21);
	s2636.add_route(ALL_OUTPUTS, "mono", 0.10);

	/* video hardware */
	MCFG_SCREEN_ADD("screen", RASTER)
	MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE)
	MCFG_SCREEN_REFRESH_RATE(50)
	MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
	MCFG_SCREEN_SIZE(256, 256)
	MCFG_SCREEN_VISIBLE_AREA(1*8, 29*8-1, 2*8, 32*8-1)
	MCFG_SCREEN_UPDATE_DRIVER(subhuntr_state, screen_update_subhuntr)
	MCFG_SCREEN_PALETTE("palette")

	MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_subhuntr)

	MCFG_PALETTE_ADD("palette", 26)
	MCFG_PALETTE_INIT_OWNER(subhuntr_state, subhuntr)

	/* sound hardware */
	SPEAKER(config, "mono").front_center();

	/* discrete sound */
MACHINE_CONFIG_END



/******************************************************************************/

ROM_START( subhuntr )
	ROM_REGION( 0x1000, "maincpu", 0 )
	ROM_LOAD( "mr21.6f",  0x0000, 0x0400, CRC(27847939) SHA1(e6b41b511fefac1e1e207eff2dac8c2963d47c5c) )
	ROM_LOAD( "mr22.6g",  0x0400, 0x0400, CRC(e9af1ee8) SHA1(451e88407a120444377a58b06b65152c57503533) )
	ROM_LOAD( "mr25.6l",  0x0800, 0x0400, CRC(8271c975) SHA1(c7192658b50d781ab1b94c2e8cb75c5be3539820) )
	ROM_LOAD( "mr24.6n",  0x0c00, 0x0400, CRC(385c4944) SHA1(84050b0356c9a3a36528dba768f2684e28c6c7c4) )

	ROM_REGION( 0x0200, "gfx1", 0 )
	ROM_LOAD( "82s115.2b",   0x0000, 0x0200, CRC(6946c9de) SHA1(956b4bebe6960a73609deb75e1493c4127fd7f77) ) // ASCII, not much else
ROM_END

GAME(1979, subhuntr,  0,        subhuntr, subhuntr, subhuntr_state, empty_init, ROT0, "Model Racing", "Sub Hunter (Model Racing)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND )