summaryrefslogtreecommitdiffstats
path: root/src/mame/drivers/atari_4x4.cpp
blob: 381ca981f92663be4214f8126fab5bd66548122d (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
// license:BSD-3-Clause
// copyright-holders:Robbbert
/****************************************************************************************

PINBALL
Atari 4X4

Unlike all the other Atari pinballs, this one seems to use a 6502.
There's no manuals or full schematics.

The game has 8 captive balls in 2 banks of 4, and they can be released by hitting a
 target (one per ball). Therefore, most of the time you're playing multiball.

Status:
- Skeleton

ToDo:
- Everything
- The audio prom is the same one used in Atari System 2, so the sound card should be the
  same.


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

#include "emu.h"
#include "machine/genpin.h"
#include "cpu/m6502/m6502.h"
//#include "machine/timer.h"
//#include "sound/dac.h"
//#include "speaker.h"
//#include "atari_s2.lh"

namespace {

class atari_4x4_state : public genpin_class
{
public:
	atari_4x4_state(const machine_config &mconfig, device_type type, const char *tag)
		: genpin_class(mconfig, type, tag)
		, m_maincpu(*this, "maincpu")
		, m_digits(*this, "digit%d", 0U)
		, m_io_outputs(*this, "out%d", 0U)
	{ }

	void fourx4(machine_config &config);

private:
	virtual void machine_reset() override;
	virtual void machine_start() override;
	void mem_map(address_map &map);
	required_device<m6502_device> m_maincpu;
	output_finder<68> m_digits;  // don't know how many
	output_finder<80> m_io_outputs;   // ?? solenoids + ?? lamps
};

void atari_4x4_state::mem_map(address_map &map)
{
	map.unmap_value_high();
	map(0x0000, 0x07ff).ram();
	map(0x1000, 0x17ff).ram();
	map(0x2000, 0x27ff).ram();
	map(0x3000, 0x37ff).ram();
	map(0x8000, 0xffff).rom().region("maincpu", 0);
}

static INPUT_PORTS_START( atari_4x4 )
INPUT_PORTS_END

void atari_4x4_state::machine_start()
{
	genpin_class::machine_start();

	m_digits.resolve();
	m_io_outputs.resolve();

	//save_item(NAME(m_segment));
}

void atari_4x4_state::machine_reset()
{
	genpin_class::machine_reset();
	for (u8 i = 0; i < m_io_outputs.size(); i++)
		m_io_outputs[i] = 0;
}


void atari_4x4_state::fourx4(machine_config &config)
{
	/* basic machine hardware */
	M6502(config, m_maincpu, 1'000'000);  // guess
	m_maincpu->set_addrmap(AS_PROGRAM, &atari_4x4_state::mem_map);

	/* Video */
	//config.set_default_layout(layout_fourx4);

	/* Sound */
	genpin_audio(config);
	//SPEAKER(config, "speaker").front_center();
	//DAC_4BIT_BINARY_WEIGHTED(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.15); // r23-r26 (68k,33k,18k,8.2k)
	//DAC_3BIT_BINARY_WEIGHTED(config, m_dac1, 0).add_route(ALL_OUTPUTS, "speaker", 0.15); // r18-r20 (100k,47k,100k)
	//TIMER(config, "timer_s").configure_periodic(FUNC(atari_s2_state::timer_s), attotime::from_hz(150000));
}

/*-------------------------------------------------------------------
/ 4x4 (10/1982)
/-------------------------------------------------------------------*/
ROM_START(fourx4)
	ROM_REGION(0x8000, "maincpu", 0)
	ROM_LOAD("8000ce65.bin", 0x0000, 0x2000, CRC(27341155) SHA1(c0da1fbf64f93ab163b2ea6bfbfc7b778cea819f))
	ROM_LOAD("a0004c37.bin", 0x2000, 0x2000, CRC(6f93102f) SHA1(d6520987ed5805b0e6b5da5653fc7cb063e86dda))
	ROM_LOAD("c000a70c.bin", 0x4000, 0x2000, CRC(c31ca8d3) SHA1(53f20eff0084771dc61d19db7ddae52e4423e75e))
	ROM_RELOAD(0x6000, 0x2000)

	ROM_REGION(0x0200, "proms", 0)
	ROM_LOAD("20967-01.j3", 0x0000, 0x0200, CRC(da1f77b4) SHA1(b21fdc1c6f196c320ec5404013d672c35f95890b))
ROM_END

} // Anonymous namespace

GAME( 1982, fourx4, 0, fourx4, atari_4x4, atari_4x4_state, empty_init, ROT0, "Atari", "4x4", MACHINE_IS_SKELETON_MECHANICAL | MACHINE_SUPPORTS_SAVE )