summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/x68k/x68k_neptunex.h
blob: aa26ddf4bd46c51d50d08a73e3e39b151e3d22bd (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
// license:BSD-3-Clause
// copyright-holders:Barry Rodewald
/*
 * x68k_neptunex.h
 *
 * Neptune-X NE2000-based ethernet board for the X68000
 *
 * Map:
 * 0xECE000-0xECE3FF: "Y0"
 * 0xECE400-0xECE7FF: "Y1"
 */

#ifndef MAME_BUS_X68K_X68K_NEPTUNEX_H
#define MAME_BUS_X68K_X68K_NEPTUNEX_H

#pragma once

#include "x68kexp.h"
#include "machine/dp8390.h"

#define NEPTUNE_IRQ_VECTOR 0xf9

class x68k_neptune_device : public device_t,
							public device_x68k_expansion_card_interface
{
public:
	// construction/destruction
	x68k_neptune_device(const machine_config &mconfig, const char *tag, device_t *owner, const XTAL &clock);

	uint16_t x68k_neptune_port_r(offs_t offset, uint16_t mem_mask = ~0);
	void x68k_neptune_port_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);

protected:
	// device-level overrides
	virtual void device_add_mconfig(machine_config &config) override;
	virtual void device_start() override;
	virtual void device_reset() override;

	// device_x68k_expansion_card_interface overrides
	virtual uint8_t iack2() override;

private:
	uint8_t x68k_neptune_mem_read(offs_t offset);
	void x68k_neptune_mem_write(offs_t offset, uint8_t data);
	void x68k_neptune_irq_w(int state);

	x68k_expansion_slot_device *m_slot;

	required_device<dp8390d_device> m_dp8390;
	uint8_t m_board_ram[16*1024];
	uint8_t m_prom[16];
};

// device type definition
DECLARE_DEVICE_TYPE(X68K_NEPTUNEX, x68k_neptune_device)

#endif // MAME_BUS_X68K_X68K_NEPTUNEX_H