src/emu/video/dm9368.c
| r0 | r11087 | |
| 1 | /********************************************************************** |
| 2 | |
| 3 | Fairchild DM9368 7-Segment Decoder/Driver/Latch emulation |
| 4 | |
| 5 | Copyright MESS Team. |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | |
| 8 | **********************************************************************/ |
| 9 | |
| 10 | #include "emu.h" |
| 11 | #include "dm9368.h" |
| 12 | #include "machine/devhelpr.h" |
| 13 | |
| 14 | |
| 15 | |
| 16 | //************************************************************************** |
| 17 | // MACROS / CONSTANTS |
| 18 | //************************************************************************** |
| 19 | |
| 20 | #define LOG 1 |
| 21 | |
| 22 | |
| 23 | static const UINT8 OUTPUT[16] = |
| 24 | { |
| 25 | 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x67, 0x77, 0x7c, 0x39, 0x5e, 0x79, 0x71 |
| 26 | }; |
| 27 | |
| 28 | |
| 29 | |
| 30 | //************************************************************************** |
| 31 | // GLOBAL VARIABLES |
| 32 | //************************************************************************** |
| 33 | |
| 34 | // devices |
| 35 | const device_type DM9368 = dm9368_device_config::static_alloc_device_config; |
| 36 | |
| 37 | |
| 38 | |
| 39 | //************************************************************************** |
| 40 | // DEVICE CONFIGURATION |
| 41 | //************************************************************************** |
| 42 | |
| 43 | GENERIC_DEVICE_CONFIG_SETUP(dm9368, "DM9368") |
| 44 | |
| 45 | |
| 46 | //------------------------------------------------- |
| 47 | // device_config_complete - perform any |
| 48 | // operations now that the configuration is |
| 49 | // complete |
| 50 | //------------------------------------------------- |
| 51 | |
| 52 | void dm9368_device_config::device_config_complete() |
| 53 | { |
| 54 | // inherit a copy of the static data |
| 55 | const dm9368_interface *intf = reinterpret_cast<const dm9368_interface *>(static_config()); |
| 56 | if (intf != NULL) |
| 57 | *static_cast<dm9368_interface *>(this) = *intf; |
| 58 | |
| 59 | // or initialize to defaults if none provided |
| 60 | else |
| 61 | { |
| 62 | memset(&m_in_rbi_func, 0, sizeof(m_in_rbi_func)); |
| 63 | memset(&m_out_rbo_func, 0, sizeof(m_out_rbo_func)); |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | |
| 68 | |
| 69 | //************************************************************************** |
| 70 | // INLINE HELPERS |
| 71 | //************************************************************************** |
| 72 | |
| 73 | //------------------------------------------------- |
| 74 | // get_rbi - |
| 75 | //------------------------------------------------- |
| 76 | |
| 77 | inline int dm9368_device::get_rbi() |
| 78 | { |
| 79 | if (m_in_rbi_func.target != NULL) |
| 80 | { |
| 81 | m_rbi = devcb_call_read_line(&m_in_rbi_func); |
| 82 | } |
| 83 | |
| 84 | return m_rbi; |
| 85 | } |
| 86 | |
| 87 | |
| 88 | //------------------------------------------------- |
| 89 | // set_rbo - |
| 90 | //------------------------------------------------- |
| 91 | |
| 92 | inline void dm9368_device::set_rbo(int state) |
| 93 | { |
| 94 | m_rbo = state; |
| 95 | |
| 96 | devcb_call_write_line(&m_out_rbo_func, m_rbo); |
| 97 | } |
| 98 | |
| 99 | |
| 100 | |
| 101 | //************************************************************************** |
| 102 | // LIVE DEVICE |
| 103 | //************************************************************************** |
| 104 | |
| 105 | //------------------------------------------------- |
| 106 | // dm9368_device - constructor |
| 107 | //------------------------------------------------- |
| 108 | |
| 109 | dm9368_device::dm9368_device(running_machine &_machine, const dm9368_device_config &config) |
| 110 | : device_t(_machine, config), |
| 111 | m_rbi(1), |
| 112 | m_rbo(1), |
| 113 | m_config(config) |
| 114 | { |
| 115 | } |
| 116 | |
| 117 | |
| 118 | //------------------------------------------------- |
| 119 | // device_start - device-specific startup |
| 120 | //------------------------------------------------- |
| 121 | |
| 122 | void dm9368_device::device_start() |
| 123 | { |
| 124 | // resolve callbacks |
| 125 | devcb_resolve_read_line(&m_in_rbi_func, &m_config.m_in_rbi_func, this); |
| 126 | devcb_resolve_write_line(&m_out_rbo_func, &m_config.m_out_rbo_func, this); |
| 127 | |
| 128 | // register for state saving |
| 129 | save_item(NAME(m_rbi)); |
| 130 | } |
| 131 | |
| 132 | |
| 133 | //------------------------------------------------- |
| 134 | // a_w - |
| 135 | //------------------------------------------------- |
| 136 | |
| 137 | void dm9368_device::a_w(UINT8 data) |
| 138 | { |
| 139 | int a = data & 0x0f; |
| 140 | |
| 141 | if (!get_rbi() && !a) |
| 142 | { |
| 143 | if (LOG) logerror("DM9368 '%s' Blanked Rippling Zero\n", tag()); |
| 144 | |
| 145 | // blank rippling 0 |
| 146 | output_set_digit_value(m_config.m_digit, 0); |
| 147 | |
| 148 | set_rbo(0); |
| 149 | } |
| 150 | else |
| 151 | { |
| 152 | if (LOG) logerror("DM9368 '%s' Output Data: %u = %02x\n", tag(), a, OUTPUT[a]); |
| 153 | |
| 154 | output_set_digit_value(m_config.m_digit, OUTPUT[a]); |
| 155 | |
| 156 | set_rbo(1); |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | |
| 161 | //------------------------------------------------- |
| 162 | // rbi_w - ripple blanking input |
| 163 | //------------------------------------------------- |
| 164 | |
| 165 | WRITE_LINE_MEMBER( dm9368_device::rbi_w ) |
| 166 | { |
| 167 | if (LOG) logerror("DM9368 '%s' Ripple Blanking Input: %u\n", tag(), state); |
| 168 | |
| 169 | m_rbi = state; |
| 170 | } |
| 171 | |
| 172 | |
| 173 | //------------------------------------------------- |
| 174 | // rbo_r - ripple blanking output |
| 175 | //------------------------------------------------- |
| 176 | |
| 177 | READ_LINE_MEMBER( dm9368_device::rbo_r ) |
| 178 | { |
| 179 | return m_rbo; |
| 180 | } |
src/emu/video/dm9368.h
| r0 | r11087 | |
| 1 | /********************************************************************** |
| 2 | |
| 3 | Fairchild DM9368 7-Segment Decoder/Driver/Latch emulation |
| 4 | |
| 5 | Copyright MESS Team. |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | |
| 8 | ********************************************************************** |
| 9 | _____ _____ |
| 10 | A1 1 |* \_/ | 16 Vcc |
| 11 | A2 2 | | 15 F |
| 12 | _LE 3 | | 14 G |
| 13 | _RBO 4 | DM9368 | 13 A |
| 14 | _RBI 5 | | 12 B |
| 15 | A3 6 | | 11 C |
| 16 | A0 7 | | 10 D |
| 17 | GND 8 |_____________| 9 E |
| 18 | |
| 19 | **********************************************************************/ |
| 20 | |
| 21 | #pragma once |
| 22 | |
| 23 | #ifndef __DM9368__ |
| 24 | #define __DM9368__ |
| 25 | |
| 26 | #include "emu.h" |
| 27 | |
| 28 | |
| 29 | |
| 30 | //************************************************************************** |
| 31 | // INTERFACE CONFIGURATION MACROS |
| 32 | //************************************************************************** |
| 33 | |
| 34 | #define MCFG_DM9368_ADD(_tag, _config) \ |
| 35 | MCFG_DEVICE_ADD(_tag, DM9368, 0) \ |
| 36 | MCFG_DEVICE_CONFIG(_config) |
| 37 | |
| 38 | |
| 39 | #define DM9368_INTERFACE(name) \ |
| 40 | const dm9368_interface (name) = |
| 41 | |
| 42 | |
| 43 | |
| 44 | //************************************************************************** |
| 45 | // TYPE DEFINITIONS |
| 46 | //************************************************************************** |
| 47 | |
| 48 | |
| 49 | // ======================> dm9368_interface |
| 50 | |
| 51 | struct dm9368_interface |
| 52 | { |
| 53 | int m_digit; |
| 54 | |
| 55 | devcb_read_line m_in_rbi_func; |
| 56 | devcb_write_line m_out_rbo_func; |
| 57 | }; |
| 58 | |
| 59 | |
| 60 | |
| 61 | // ======================> dm9368_device_config |
| 62 | |
| 63 | class dm9368_device_config : public device_config, |
| 64 | public dm9368_interface |
| 65 | { |
| 66 | friend class dm9368_device; |
| 67 | |
| 68 | // construction/destruction |
| 69 | dm9368_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock); |
| 70 | |
| 71 | public: |
| 72 | // allocators |
| 73 | static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock); |
| 74 | virtual device_t *alloc_device(running_machine &machine) const; |
| 75 | |
| 76 | protected: |
| 77 | // device_config overrides |
| 78 | virtual void device_config_complete(); |
| 79 | }; |
| 80 | |
| 81 | |
| 82 | |
| 83 | // ======================> dm9368_device |
| 84 | |
| 85 | class dm9368_device : public device_t |
| 86 | { |
| 87 | friend class dm9368_device_config; |
| 88 | |
| 89 | // construction/destruction |
| 90 | dm9368_device(running_machine &_machine, const dm9368_device_config &_config); |
| 91 | |
| 92 | public: |
| 93 | void a_w(UINT8 data); |
| 94 | DECLARE_WRITE_LINE_MEMBER( rbi_w ); |
| 95 | DECLARE_READ_LINE_MEMBER( rbo_r ); |
| 96 | |
| 97 | protected: |
| 98 | // device-level overrides |
| 99 | virtual void device_start(); |
| 100 | |
| 101 | private: |
| 102 | inline int get_rbi(); |
| 103 | inline void set_rbo(int state); |
| 104 | |
| 105 | devcb_resolved_read_line m_in_rbi_func; |
| 106 | devcb_resolved_write_line m_out_rbo_func; |
| 107 | |
| 108 | int m_rbi; |
| 109 | int m_rbo; |
| 110 | |
| 111 | const dm9368_device_config &m_config; |
| 112 | }; |
| 113 | |
| 114 | |
| 115 | // device type definition |
| 116 | extern const device_type DM9368; |
| 117 | |
| 118 | |
| 119 | |
| 120 | #endif |
src/mess/video/dm9368.c
| r11086 | r11087 | |
| 1 | | /********************************************************************** |
| 2 | | |
| 3 | | Fairchild DM9368 7-Segment Decoder/Driver/Latch emulation |
| 4 | | |
| 5 | | Copyright MESS Team. |
| 6 | | Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | | |
| 8 | | **********************************************************************/ |
| 9 | | |
| 10 | | #include "emu.h" |
| 11 | | #include "dm9368.h" |
| 12 | | |
| 13 | | /*************************************************************************** |
| 14 | | PARAMETERS |
| 15 | | ***************************************************************************/ |
| 16 | | |
| 17 | | #define LOG 0 |
| 18 | | |
| 19 | | static const UINT8 OUTPUT[16] = |
| 20 | | { |
| 21 | | 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x67, 0x77, 0x7c, 0x39, 0x5e, 0x79, 0x71 |
| 22 | | }; |
| 23 | | |
| 24 | | /*************************************************************************** |
| 25 | | TYPE DEFINITIONS |
| 26 | | ***************************************************************************/ |
| 27 | | |
| 28 | | typedef struct _dm9368_t dm9368_t; |
| 29 | | struct _dm9368_t |
| 30 | | { |
| 31 | | int digit; |
| 32 | | UINT8 latch; |
| 33 | | |
| 34 | | int rbi; |
| 35 | | |
| 36 | | device_t *rbo_device; |
| 37 | | }; |
| 38 | | |
| 39 | | /*************************************************************************** |
| 40 | | INLINE FUNCTIONS |
| 41 | | ***************************************************************************/ |
| 42 | | |
| 43 | | INLINE dm9368_t *get_safe_token(device_t *device) |
| 44 | | { |
| 45 | | assert(device != NULL); |
| 46 | | assert(device->type() == DM9368); |
| 47 | | |
| 48 | | return (dm9368_t *)downcast<legacy_device_base *>(device)->token(); |
| 49 | | } |
| 50 | | |
| 51 | | INLINE dm9368_config *get_safe_config(device_t *device) |
| 52 | | { |
| 53 | | assert(device != NULL); |
| 54 | | assert(device->type() == DM9368); |
| 55 | | |
| 56 | | return (dm9368_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config(); |
| 57 | | } |
| 58 | | |
| 59 | | /*************************************************************************** |
| 60 | | IMPLEMENTATION |
| 61 | | ***************************************************************************/ |
| 62 | | |
| 63 | | /*------------------------------------------------- |
| 64 | | dm9368_w - latch input |
| 65 | | -------------------------------------------------*/ |
| 66 | | |
| 67 | | WRITE8_DEVICE_HANDLER( dm9368_w ) |
| 68 | | { |
| 69 | | dm9368_t *dm9368 = get_safe_token(device); |
| 70 | | |
| 71 | | int a = data & 0x0f; |
| 72 | | |
| 73 | | if (!dm9368->rbi && !a) |
| 74 | | { |
| 75 | | if (LOG) logerror("DM9368 '%s' Blanked Rippling Zero\n", device->tag()); |
| 76 | | |
| 77 | | /* blank rippling 0 */ |
| 78 | | output_set_digit_value(dm9368->digit, 0); |
| 79 | | |
| 80 | | if (dm9368->rbo_device) |
| 81 | | { |
| 82 | | dm9368_rbi_w(dm9368->rbo_device, 0); |
| 83 | | } |
| 84 | | } |
| 85 | | else |
| 86 | | { |
| 87 | | if (LOG) logerror("DM9368 '%s' Output Data: %u = %02x\n", device->tag(), a, OUTPUT[a]); |
| 88 | | |
| 89 | | output_set_digit_value(dm9368->digit, OUTPUT[a]); |
| 90 | | |
| 91 | | if (dm9368->rbo_device) |
| 92 | | { |
| 93 | | dm9368_rbi_w(dm9368->rbo_device, 1); |
| 94 | | } |
| 95 | | } |
| 96 | | } |
| 97 | | |
| 98 | | /*------------------------------------------------- |
| 99 | | dm9368_rbi_w - ripple blanking input |
| 100 | | -------------------------------------------------*/ |
| 101 | | |
| 102 | | WRITE_LINE_DEVICE_HANDLER( dm9368_rbi_w ) |
| 103 | | { |
| 104 | | dm9368_t *dm9368 = get_safe_token(device); |
| 105 | | |
| 106 | | dm9368->rbi = state; |
| 107 | | |
| 108 | | if (LOG) logerror("DM9368 '%s' Ripple Blanking Input: %u\n", device->tag(), state); |
| 109 | | } |
| 110 | | |
| 111 | | /*------------------------------------------------- |
| 112 | | DEVICE_START( dm9368 ) |
| 113 | | -------------------------------------------------*/ |
| 114 | | |
| 115 | | static DEVICE_START( dm9368 ) |
| 116 | | { |
| 117 | | dm9368_t *dm9368 = get_safe_token(device); |
| 118 | | const dm9368_config *config = get_safe_config(device); |
| 119 | | |
| 120 | | dm9368->digit = config->digit; |
| 121 | | |
| 122 | | /* get the screen device */ |
| 123 | | if (config->rbo_tag) |
| 124 | | { |
| 125 | | dm9368->rbo_device = device->machine().device(config->rbo_tag); |
| 126 | | } |
| 127 | | |
| 128 | | /* register for state saving */ |
| 129 | | device->save_item(NAME(dm9368->latch)); |
| 130 | | device->save_item(NAME(dm9368->rbi)); |
| 131 | | } |
| 132 | | |
| 133 | | /*------------------------------------------------- |
| 134 | | DEVICE_GET_INFO( dm9368 ) |
| 135 | | -------------------------------------------------*/ |
| 136 | | |
| 137 | | DEVICE_GET_INFO( dm9368 ) |
| 138 | | { |
| 139 | | switch (state) |
| 140 | | { |
| 141 | | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 142 | | case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(dm9368_t); break; |
| 143 | | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = sizeof(dm9368_config); break; |
| 144 | | |
| 145 | | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 146 | | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(dm9368); break; |
| 147 | | case DEVINFO_FCT_STOP: /* Nothing */ break; |
| 148 | | case DEVINFO_FCT_RESET: /* Nothing */ break; |
| 149 | | |
| 150 | | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 151 | | case DEVINFO_STR_NAME: strcpy(info->s, "Fairchild DM9368"); break; |
| 152 | | case DEVINFO_STR_FAMILY: strcpy(info->s, "Fairchild DM9368"); break; |
| 153 | | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; |
| 154 | | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; |
| 155 | | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MESS Team"); break; |
| 156 | | } |
| 157 | | } |
| 158 | | |
| 159 | | DEFINE_LEGACY_DEVICE(DM9368, dm9368); |
src/mess/video/dm9368.h
| r11086 | r11087 | |
| 1 | | /********************************************************************** |
| 2 | | |
| 3 | | Fairchild DM9368 7-Segment Decoder/Driver/Latch emulation |
| 4 | | |
| 5 | | Copyright MESS Team. |
| 6 | | Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | | |
| 8 | | ********************************************************************** |
| 9 | | _____ _____ |
| 10 | | A1 1 |* \_/ | 16 Vcc |
| 11 | | A2 2 | | 15 F |
| 12 | | _LE 3 | | 14 G |
| 13 | | _RBO 4 | DM9368 | 13 A |
| 14 | | _RBI 5 | | 12 B |
| 15 | | A3 6 | | 11 C |
| 16 | | A0 7 | | 10 D |
| 17 | | GND 8 |_____________| 9 E |
| 18 | | |
| 19 | | **********************************************************************/ |
| 20 | | |
| 21 | | #ifndef __DM9368__ |
| 22 | | #define __DM9368__ |
| 23 | | |
| 24 | | #include "emu.h" |
| 25 | | #include "devcb.h" |
| 26 | | |
| 27 | | /*************************************************************************** |
| 28 | | MACROS / CONSTANTS |
| 29 | | ***************************************************************************/ |
| 30 | | |
| 31 | | DECLARE_LEGACY_DEVICE(DM9368, dm9368); |
| 32 | | |
| 33 | | #define MCFG_DM9368_ADD(_tag, _digit, _rbo_tag) \ |
| 34 | | MCFG_DEVICE_ADD((_tag), DM9368, 0) \ |
| 35 | | MCFG_DEVICE_CONFIG_DATA32(dm9368_config, digit, _digit) \ |
| 36 | | MCFG_DEVICE_CONFIG_DATAPTR(dm9368_config, rbo_tag, _rbo_tag) \ |
| 37 | | |
| 38 | | /*************************************************************************** |
| 39 | | TYPE DEFINITIONS |
| 40 | | ***************************************************************************/ |
| 41 | | |
| 42 | | typedef struct _dm9368_config dm9368_config; |
| 43 | | struct _dm9368_config |
| 44 | | { |
| 45 | | const char *rbo_tag; /* device to connect RBO pin to */ |
| 46 | | |
| 47 | | int digit; /* output digit */ |
| 48 | | }; |
| 49 | | |
| 50 | | /*************************************************************************** |
| 51 | | PROTOTYPES |
| 52 | | ***************************************************************************/ |
| 53 | | /* latch input */ |
| 54 | | WRITE8_DEVICE_HANDLER( dm9368_w ); |
| 55 | | |
| 56 | | /* ripple blanking input */ |
| 57 | | WRITE_LINE_DEVICE_HANDLER( dm9368_rbi_w ); |
| 58 | | |
| 59 | | #endif |
src/mess/drivers/elf.c
| r11086 | r11087 | |
| 44 | 44 | |
| 45 | 45 | WRITE8_MEMBER( elf2_state::data_w ) |
| 46 | 46 | { |
| 47 | | dm9368_w(m_led_l, 0, data & 0x0f); |
| 48 | | dm9368_w(m_led_h, 0, data >> 4); |
| 47 | m_led_l->a_w(data & 0x0f); |
| 48 | m_led_h->a_w(data >> 4); |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | WRITE8_MEMBER( elf2_state::memory_w ) |
| r11086 | r11087 | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | /* write data to 7 segment displays */ |
| 67 | | dm9368_w(m_led_l, 0, data & 0x0f); |
| 68 | | dm9368_w(m_led_h, 0, data >> 4); |
| 67 | m_led_l->a_w(data & 0x0f); |
| 68 | m_led_h->a_w(data >> 4); |
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | 71 | |
| r11086 | r11087 | |
| 205 | 205 | if (LOAD) |
| 206 | 206 | { |
| 207 | 207 | /* write data to 7 segment displays */ |
| 208 | | dm9368_w(m_led_l, 0, m_data & 0x0f); |
| 209 | | dm9368_w(m_led_h, 0, m_data >> 4); |
| 208 | m_led_l->a_w(m_data & 0x0f); |
| 209 | m_led_h->a_w(m_data >> 4); |
| 210 | 210 | } |
| 211 | 211 | } |
| 212 | 212 | } |
| r11086 | r11087 | |
| 248 | 248 | address_space *program = m_maincpu->memory().space(AS_PROGRAM); |
| 249 | 249 | |
| 250 | 250 | /* initialize LED displays */ |
| 251 | | dm9368_rbi_w(m_led_l, 1); |
| 252 | | dm9368_rbi_w(m_led_h, 1); |
| 251 | m_led_l->rbi_w(1); |
| 252 | m_led_h->rbi_w(1); |
| 253 | 253 | |
| 254 | 254 | /* setup memory banking */ |
| 255 | 255 | program->install_read_bank(0x0000, 0x00ff, "bank1"); |
| r11086 | r11087 | |
| 271 | 271 | NULL |
| 272 | 272 | }; |
| 273 | 273 | |
| 274 | static DM9368_INTERFACE( led_h_intf ) |
| 275 | { |
| 276 | 0, |
| 277 | DEVCB_NULL, |
| 278 | DEVCB_NULL |
| 279 | }; |
| 280 | |
| 281 | static DM9368_INTERFACE( led_l_intf ) |
| 282 | { |
| 283 | 1, |
| 284 | DEVCB_NULL, |
| 285 | DEVCB_NULL |
| 286 | }; |
| 287 | |
| 274 | 288 | static QUICKLOAD_LOAD( elf ) |
| 275 | 289 | { |
| 276 | 290 | elf2_state *state = image.device().machine().driver_data<elf2_state>(); |
| r11086 | r11087 | |
| 305 | 319 | MCFG_PALETTE_INIT(black_and_white) |
| 306 | 320 | |
| 307 | 321 | MCFG_MM74C923_ADD(MM74C923_TAG, keyboard_intf) |
| 308 | | MCFG_DM9368_ADD(DM9368_H_TAG, 0, NULL) |
| 309 | | MCFG_DM9368_ADD(DM9368_L_TAG, 1, NULL) |
| 322 | MCFG_DM9368_ADD(DM9368_H_TAG, led_h_intf) |
| 323 | MCFG_DM9368_ADD(DM9368_L_TAG, led_l_intf) |
| 310 | 324 | MCFG_CDP1861_ADD(CDP1861_TAG, XTAL_3_579545MHz/2, elf2_cdp1861_intf) |
| 311 | 325 | |
| 312 | 326 | /* devices */ |
src/mess/drivers/cosmicos.c
| r11086 | r11087 | |
| 4 | 4 | |
| 5 | 5 | http://retro.hansotten.nl/index.php?page=1802-cosmicos |
| 6 | 6 | |
| 7 | | |
| 7 | |
| 8 | 8 | HEX-monitor |
| 9 | 9 | |
| 10 | 10 | 0 - start user program |
| r11086 | r11087 | |
| 504 | 504 | address_space *program = m_maincpu->memory().space(AS_PROGRAM); |
| 505 | 505 | |
| 506 | 506 | /* initialize LED display */ |
| 507 | | dm9368_rbi_w(m_led, 1); |
| 507 | m_led->rbi_w(1); |
| 508 | 508 | |
| 509 | 509 | /* setup memory banking */ |
| 510 | 510 | switch (ram_get_size(m_ram)) |
| r11086 | r11087 | |
| 566 | 566 | NULL |
| 567 | 567 | }; |
| 568 | 568 | |
| 569 | static DM9368_INTERFACE( led_intf ) |
| 570 | { |
| 571 | 0, |
| 572 | DEVCB_NULL, |
| 573 | DEVCB_NULL |
| 574 | }; |
| 575 | |
| 569 | 576 | static MACHINE_CONFIG_START( cosmicos, cosmicos_state ) |
| 570 | 577 | /* basic machine hardware */ |
| 571 | 578 | MCFG_CPU_ADD(CDP1802_TAG, COSMAC, XTAL_1_75MHz) |
| r11086 | r11087 | |
| 575 | 582 | |
| 576 | 583 | /* video hardware */ |
| 577 | 584 | MCFG_DEFAULT_LAYOUT( layout_cosmicos ) |
| 578 | | MCFG_DM9368_ADD(DM9368_TAG, 0, NULL) |
| 585 | MCFG_DM9368_ADD(DM9368_TAG, led_intf) |
| 579 | 586 | MCFG_TIMER_ADD_PERIODIC("digit", digit_tick, attotime::from_hz(100)) |
| 580 | 587 | MCFG_TIMER_ADD_PERIODIC("interrupt", int_tick, attotime::from_hz(1000)) |
| 581 | 588 | |