Previous 15994 Revisions Next

r9211 Wednesday 22nd September, 2010 at 07:12:15 UTC by Curt Coder
[ABC99] Converted to modern device.
[src/mess/machine]abc99.c abc99.h

src/mess/machine/abc99.c
r9210r9211
11#include "emu.h"
22#include "abc99.h"
33#include "cpu/mcs48/mcs48.h"
4#include "machine/devhelpr.h"
45
5/*-------------------------------------------------
6    ADDRESS_MAP( abc99_map )
7-------------------------------------------------*/
86
7
8//**************************************************************************
9//   MACROS / CONSTANTS
10//**************************************************************************
11
12#define I8035_TAG   "i8035"
13
14
15
16//**************************************************************************
17//  DEVICE DEFINITIONS
18//**************************************************************************
19
20const device_type ABC99 = abc99_device_config::static_alloc_device_config;
21
22
23
24//**************************************************************************
25//  DEVICE CONFIGURATION
26//**************************************************************************
27
28GENERIC_DEVICE_CONFIG_SETUP(abc99, "Luxor ABC 99")
29
30
31//-------------------------------------------------
32//  device_config_complete - perform any
33//  operations now that the configuration is
34//  complete
35//-------------------------------------------------
36
37void abc99_device_config::device_config_complete()
38{
39}
40
41
42//-------------------------------------------------
43//  ROM( abc99 )
44//-------------------------------------------------
45
46ROM_START( abc99 )
47   ROM_REGION( 0x1800, I8035_TAG, 0 )
48   ROM_LOAD( "10681909.bin", 0x0000, 0x1000, CRC(ffe32a71) SHA1(fa2ce8e0216a433f9bbad0bdd6e3dc0b540f03b7) )
49   ROM_LOAD( "10726864.bin", 0x1000, 0x0800, CRC(e33683ae) SHA1(0c1d9e320f82df05f4804992ef6f6f6cd20623f3) )
50ROM_END
51
52
53//-------------------------------------------------
54//  rom_region - device-specific ROM region
55//-------------------------------------------------
56
57const rom_entry *abc99_device_config::rom_region() const
58{
59   return ROM_NAME( abc99 );
60}
61
62
63//-------------------------------------------------
64//  ADDRESS_MAP( abc99_map )
65//-------------------------------------------------
66
967static ADDRESS_MAP_START( abc99_map, ADDRESS_SPACE_PROGRAM, 8 )
10   AM_RANGE(0x000, 0xfff) AM_ROM
68   AM_RANGE(0x0000, 0x17ff) AM_ROM
1169ADDRESS_MAP_END
1270
13/*-------------------------------------------------
14    ADDRESS_MAP( abc99_io_map )
15-------------------------------------------------*/
1671
72//-------------------------------------------------
73//  ADDRESS_MAP( abc99_io_map )
74//-------------------------------------------------
75
1776static ADDRESS_MAP_START( abc99_io_map, ADDRESS_SPACE_IO, 8 )
1877ADDRESS_MAP_END
1978
20/*-------------------------------------------------
21    MACHINE_DRIVER( abc99 )
22-------------------------------------------------*/
2379
80//-------------------------------------------------
81//  MACHINE_DRIVER( abc99 )
82//-------------------------------------------------
83
2484static MACHINE_CONFIG_FRAGMENT( abc99 )
25   MDRV_CPU_ADD("i8035", I8035, XTAL_4_608MHz)
85   MDRV_CPU_ADD(I8035_TAG, I8035, 4608000) // ?
2686   MDRV_CPU_PROGRAM_MAP(abc99_map)
2787   MDRV_CPU_IO_MAP(abc99_io_map)
2888MACHINE_CONFIG_END
2989
30/*-------------------------------------------------
31    ROM( abc99 )
32-------------------------------------------------*/
3390
34ROM_START( abc99 )
35   ROM_REGION( 0x1800, "i8035", 0 )
36   ROM_LOAD( "10681909.bin", 0x0000, 0x1000, CRC(ffe32a71) SHA1(fa2ce8e0216a433f9bbad0bdd6e3dc0b540f03b7) )
37   ROM_LOAD( "10726864.bin", 0x1000, 0x0800, CRC(e33683ae) SHA1(0c1d9e320f82df05f4804992ef6f6f6cd20623f3) )
38ROM_END
91//-------------------------------------------------
92//  machine_config_additions - device-specific
93//   machine configurations
94//-------------------------------------------------
3995
40/*-------------------------------------------------
41    DEVICE_START( abc99 )
42-------------------------------------------------*/
96machine_config_constructor abc99_device_config::machine_config_additions() const
97{
98   return MACHINE_CONFIG_NAME( abc99 );
99}
43100
44static DEVICE_START( abc99 )
101
102
103//**************************************************************************
104//  LIVE DEVICE
105//**************************************************************************
106
107//-------------------------------------------------
108//  abc99_device - constructor
109//-------------------------------------------------
110
111abc99_device::abc99_device(running_machine &_machine, const abc99_device_config &config)
112    : device_t(_machine, config),
113      m_config(config)
45114{
115
46116}
47117
48/*-------------------------------------------------
49    DEVICE_GET_INFO( abc99 )
50-------------------------------------------------*/
51118
52DEVICE_GET_INFO( abc99 )
119//-------------------------------------------------
120//  device_start - device-specific startup
121//-------------------------------------------------
122
123void abc99_device::device_start()
53124{
54   switch (state)
55   {
56      /* --- the following bits of info are returned as 64-bit signed integers --- */
57      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = 0;                        break;
58         
59      /* --- the following bits of info are returned as pointers --- */
60      case DEVINFO_PTR_ROM_REGION:               info->romregion = rom_abc99;            break;
61      case DEVINFO_PTR_MACHINE_CONFIG:            info->machine_config = MACHINE_CONFIG_NAME(abc99); break;
62         
63      /* --- the following bits of info are returned as pointers to functions --- */
64      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(abc99);      break;
65      case DEVINFO_FCT_STOP:                     /* Nothing */                        break;
66      case DEVINFO_FCT_RESET:                     /* Nothing */                        break;
125}
67126
68      /* --- the following bits of info are returned as NULL-terminated strings --- */
69      case DEVINFO_STR_NAME:                     strcpy(info->s, "Luxor ABC-99");         break;
70      case DEVINFO_STR_FAMILY:                  strcpy(info->s, "Luxor ABC");            break;
71      case DEVINFO_STR_VERSION:                  strcpy(info->s, "1.0");                  break;
72      case DEVINFO_STR_SOURCE_FILE:               strcpy(info->s, __FILE__);               break;
73      case DEVINFO_STR_CREDITS:                  strcpy(info->s, "Copyright the MESS Team");   break;
74   }
127
128//-------------------------------------------------
129//  device_reset - device-specific reset
130//-------------------------------------------------
131
132void abc99_device::device_reset()
133{
75134}
76
77DEFINE_LEGACY_DEVICE(ABC99, abc99);
src/mess/machine/abc99.h
r9210r9211
1#pragma once
2
13#ifndef __ABC99__
24#define __ABC99__
35
r9210r9211
35#include "emu.h"
46
5/***************************************************************************
6    MACROS / CONSTANTS
7***************************************************************************/
87
8
9//**************************************************************************
10//   MACROS / CONSTANTS
11//**************************************************************************
12
913#define ABC99_TAG   "abc99"
1014
11DECLARE_LEGACY_DEVICE(ABC99, abc99);
1215
13#define MDRV_ABC99_ADD \
14   MDRV_DEVICE_ADD(ABC99_TAG, ABC99, 0)
1516
17//**************************************************************************
18//  INTERFACE CONFIGURATION MACROS
19//**************************************************************************
20
21#define MDRV_ABC99_ADD(_tag) \
22    MDRV_DEVICE_ADD(_tag, ABC99, 0)
23
24
25
26//**************************************************************************
27//   TYPE DEFINITIONS
28//**************************************************************************
29
30// ======================> abc99_interface
31
32struct abc99_interface
33{
34};
35
36
37// ======================> abc99_device_config
38
39class abc99_device_config :   public device_config,
40                                public abc99_interface
41{
42    friend class abc99_device;
43
44    // construction/destruction
45    abc99_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
46
47public:
48    // allocators
49    static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
50    virtual device_t *alloc_device(running_machine &machine) const;
51   
52   // optional information overrides
53   virtual const rom_entry *rom_region() const;
54   virtual machine_config_constructor machine_config_additions() const;
55
56protected:
57    // device_config overrides
58    virtual void device_config_complete();
59};
60
61
62// ======================> abc99_device
63
64class abc99_device :  public device_t
65{
66    friend class abc99_device_config;
67
68    // construction/destruction
69    abc99_device(running_machine &_machine, const abc99_device_config &_config);
70
71public:
72
73protected:
74    // device-level overrides
75    virtual void device_start();
76    virtual void device_reset();
77
78private:
79    const abc99_device_config &m_config;
80};
81
82
83// device type definition
84extern const device_type ABC99;
85
86
87
1688#endif

Previous 15994 Revisions Next


© 1998-2018 The MESS Team