~ubuntu-branches/debian/sid/mame/sid

« back to all changes in this revision

Viewing changes to mess/src/mess/drivers/mccpm.c

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach, Jordi Mallach, Emmanuel Kasper
  • Date: 2011-12-19 22:56:27 UTC
  • mfrom: (0.1.2)
  • Revision ID: package-import@ubuntu.com-20111219225627-ub5oga1oys4ogqzm
Tags: 0.144-1
[ Jordi Mallach ]
* Fix syntax errors in DEP5 copyright file (lintian).
* Use a versioned copyright Format specification field.
* Update Vcs-* URLs.
* Move transitional packages to the new metapackages section, and make
  them priority extra.
* Remove references to GNU/Linux and MESS sources from copyright.
* Add build variables for s390x.
* Use .xz tarballs as it cuts 4MB for the upstream sources.
* Add nplayers.ini as a patch. Update copyright file to add CC-BY-SA-3.0.

[ Emmanuel Kasper ]
* New upstream release. Closes: #651538.
* Add Free Desktop compliant png icons of various sizes taken from
  the hydroxygen iconset
* Mess is now built from a new source package, to avoid possible source
  incompatibilities between mame and the mess overlay.
* Mame-tools are not built from the mame source package anymore, but
  from the mess source package

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
 
3
 
        mc-CP/M-Computer
4
 
 
5
 
        31/08/2010 Skeleton driver.
6
 
        18/11/2010 Connected to a terminal
7
 
 
8
 
****************************************************************************/
9
 
#define ADDRESS_MAP_MODERN
10
 
 
11
 
#include "emu.h"
12
 
#include "cpu/z80/z80.h"
13
 
#include "machine/terminal.h"
14
 
 
15
 
#define MACHINE_RESET_MEMBER(name) void name::machine_reset()
16
 
 
17
 
class mccpm_state : public driver_device
18
 
{
19
 
public:
20
 
        mccpm_state(const machine_config &mconfig, device_type type, const char *tag)
21
 
                : driver_device(mconfig, type, tag),
22
 
        m_maincpu(*this, "maincpu"),
23
 
        m_terminal(*this, TERMINAL_TAG)
24
 
        { }
25
 
 
26
 
        required_device<cpu_device> m_maincpu;
27
 
        required_device<device_t> m_terminal;
28
 
        DECLARE_READ8_MEMBER( mccpm_f0_r );
29
 
        DECLARE_WRITE8_MEMBER( kbd_put );
30
 
        UINT8 *m_ram;
31
 
        UINT8 m_term_data;
32
 
        virtual void machine_reset();
33
 
};
34
 
 
35
 
 
36
 
 
37
 
READ8_MEMBER( mccpm_state::mccpm_f0_r )
38
 
{
39
 
        UINT8 ret = m_term_data;
40
 
        m_term_data = 0;
41
 
        return ret;
42
 
}
43
 
 
44
 
static ADDRESS_MAP_START(mccpm_mem, AS_PROGRAM, 8, mccpm_state)
45
 
        ADDRESS_MAP_UNMAP_HIGH
46
 
        AM_RANGE(0x0000, 0xffff) AM_RAM AM_BASE(m_ram)
47
 
ADDRESS_MAP_END
48
 
 
49
 
static ADDRESS_MAP_START( mccpm_io, AS_IO, 8, mccpm_state)
50
 
        ADDRESS_MAP_UNMAP_HIGH
51
 
        ADDRESS_MAP_GLOBAL_MASK(0xff)
52
 
        AM_RANGE(0xf0, 0xf0) AM_READ(mccpm_f0_r) AM_DEVWRITE_LEGACY(TERMINAL_TAG, terminal_write)
53
 
ADDRESS_MAP_END
54
 
 
55
 
/* Input ports */
56
 
static INPUT_PORTS_START( mccpm )
57
 
INPUT_PORTS_END
58
 
 
59
 
 
60
 
MACHINE_RESET_MEMBER(mccpm_state)
61
 
{
62
 
        UINT8* bios = machine().region("maincpu")->base();
63
 
        memcpy(m_ram, bios, 0x1000);
64
 
}
65
 
 
66
 
WRITE8_MEMBER( mccpm_state::kbd_put )
67
 
{
68
 
        m_term_data = data;
69
 
}
70
 
 
71
 
static GENERIC_TERMINAL_INTERFACE( terminal_intf )
72
 
{
73
 
        DEVCB_DRIVER_MEMBER(mccpm_state, kbd_put)
74
 
};
75
 
 
76
 
static MACHINE_CONFIG_START( mccpm, mccpm_state )
77
 
        /* basic machine hardware */
78
 
        MCFG_CPU_ADD("maincpu",Z80, XTAL_4MHz)
79
 
        MCFG_CPU_PROGRAM_MAP(mccpm_mem)
80
 
        MCFG_CPU_IO_MAP(mccpm_io)
81
 
 
82
 
        /* video hardware */
83
 
        MCFG_FRAGMENT_ADD( generic_terminal )
84
 
        MCFG_GENERIC_TERMINAL_ADD(TERMINAL_TAG, terminal_intf)
85
 
MACHINE_CONFIG_END
86
 
 
87
 
/* ROM definition */
88
 
ROM_START( mccpm )
89
 
        ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
90
 
        ROM_LOAD( "mon36.j15", 0x0000, 0x1000, CRC(9c441537) SHA1(f95bad52d9392b8fc9d9b8779b7b861672a0022b))
91
 
ROM_END
92
 
 
93
 
/* Driver */
94
 
 
95
 
/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT    COMPANY   FULLNAME       FLAGS */
96
 
COMP( 1981, mccpm,  0,       0,      mccpm,     mccpm,   0, "GRAF Elektronik Systeme GmbH", "mc-CP/M-Computer", GAME_NOT_WORKING | GAME_NO_SOUND)
97