Previous 199869 Revisions Next

r33735 Sunday 7th December, 2014 at 21:35:56 UTC by Olivier Galibert
duhhhhhhhhhhhhhhhhhhhhhh (nw)
[src/emu/machine]lpc-pit.c* lpc-pit.h*

trunk/src/emu/machine/lpc-pit.c
r0r242247
1#include "lpc-pit.h"
2
3const device_type LPC_PIT = &device_creator<lpc_pit_device>;
4
5DEVICE_ADDRESS_MAP_START(map, 32, lpc_pit_device)
6   AM_RANGE(0x40, 0x43) AM_READWRITE8(status_r, access_w,  0x00ffffff)
7   AM_RANGE(0x40, 0x43) AM_WRITE8    (          control_w, 0xff000000)
8   AM_RANGE(0x50, 0x53) AM_READWRITE8(status_r, access_w,  0x00ffffff)
9   AM_RANGE(0x50, 0x53) AM_WRITE8    (          control_w, 0xff000000)
10ADDRESS_MAP_END
11
12lpc_pit_device::lpc_pit_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
13   : lpc_device(mconfig, LPC_PIT, "LPC PIT", tag, owner, clock, "lpc_pit", __FILE__)
14{
15}
16
17void lpc_pit_device::map_device(UINT64 memory_window_start, UINT64 memory_window_end, UINT64 memory_offset, address_space *memory_space,
18                           UINT64 io_window_start, UINT64 io_window_end, UINT64 io_offset, address_space *io_space)
19{
20   io_space->install_device(io_offset, io_window_end, *this, &lpc_pit_device::map);
21}
22
23void lpc_pit_device::device_start()
24{
25}
26
27void lpc_pit_device::device_reset()
28{
29}
30
31READ8_MEMBER( lpc_pit_device::status_r)
32{
33   logerror("%s: status_r %d\n", tag(), offset);
34   return 0xff;
35}
36
37WRITE8_MEMBER(lpc_pit_device::access_w)
38{
39   logerror("%s: access_w %d, %02x\n", tag(), offset, data);
40}
41
42WRITE8_MEMBER(lpc_pit_device::control_w)
43{
44   logerror("%s: control_w %02x\n", tag(), data);
45}
trunk/src/emu/machine/lpc-pit.h
r0r242247
1#ifndef LPC_PIT_H
2#define LPC_PIT_H
3
4#include "lpc.h"
5
6#define MCFG_LPC_PIT_ADD(_tag) \
7   MCFG_DEVICE_ADD(_tag, LPC_PIT, 0)
8
9class lpc_pit_device : public lpc_device {
10public:
11   lpc_pit_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
12
13   virtual void map_device(UINT64 memory_window_start, UINT64 memory_window_end, UINT64 memory_offset, address_space *memory_space,
14                     UINT64 io_window_start, UINT64 io_window_end, UINT64 io_offset, address_space *io_space);
15
16   DECLARE_READ8_MEMBER( status_r);
17   DECLARE_WRITE8_MEMBER(access_w);
18   DECLARE_WRITE8_MEMBER(control_w);
19
20protected:
21   void device_start();
22   void device_reset();
23
24private:
25   DECLARE_ADDRESS_MAP(map, 32);
26};
27
28extern const device_type LPC_PIT;
29
30#endif


Previous 199869 Revisions Next


© 1997-2024 The MAME Team