src/mess/machine/upd7002.c
| r3822 | r3823 | |
| 12 | 12 | #include "upd7002.h" |
| 13 | 13 | |
| 14 | 14 | |
| 15 | | // local copy of the uPD7002 external procedure calls |
| 16 | | static struct uPD7002_interface |
| 17 | | uPD7002_calls={ |
| 18 | | 0, |
| 19 | | 0, |
| 20 | | }; |
| 21 | | |
| 22 | | |
| 23 | | void uPD7002_config(const struct uPD7002_interface *intf) |
| 15 | typedef struct _uPD7002_t uPD7002_t; |
| 16 | struct _uPD7002_t |
| 24 | 17 | { |
| 25 | | uPD7002_calls.get_analogue_func=*intf->get_analogue_func; |
| 26 | | uPD7002_calls.EOC_func=*intf->EOC_func; |
| 27 | | } |
| 18 | /* Pointer to our interface */ |
| 19 | const uPD7002_interface *intf; |
| 28 | 20 | |
| 21 | /* Status Register |
| 22 | D0 and D1 define the currently selected input channel |
| 23 | D2 flag output |
| 24 | D3 0 = 8 bit mode 1 = 12 bit mode |
| 25 | D4 2nd MSB of conversion |
| 26 | D5 MSB of conversion |
| 27 | D6 0 = busy, 1 = not busy (~busy) |
| 28 | D7 0 = conversion completed, 1 = conversion not completed (~EOC) |
| 29 | */ |
| 30 | int status; |
| 31 | |
| 32 | /* High data byte |
| 33 | This byte contains the 8 most significant bits of the analogue to digital conversion. */ |
| 34 | int data1; |
| 35 | |
| 36 | /* Low data byte |
| 37 | In 12 bit mode: Bits 7 to 4 define the four low order bits of the conversion. |
| 38 | In 8 bit mode. All bits 7 to 4 are inaccurate. |
| 39 | Bits 3 to 0 are always set to low. */ |
| 40 | int data0; |
| 41 | |
| 42 | |
| 43 | /* temporary store of the next A to D conversion */ |
| 44 | int digitalvalue; |
| 29 | 45 | |
| 30 | | /* Status Register |
| 31 | | D0 and D1 define the currently selected input channel |
| 32 | | D2 flag output |
| 33 | | D3 0 = 8 bit mode 1 = 12 bit mode |
| 34 | | D4 2nd MSB of conversion |
| 35 | | D5 MSB of conversion |
| 36 | | D6 0 = busy, 1 = not busy (~busy) |
| 37 | | D7 0 = conversion completed, 1 = conversion not completed (~EOC) |
| 38 | | */ |
| 39 | | static int uPD7002_status=0; |
| 46 | /* this counter is used to check a full end of conversion has been reached |
| 47 | if the uPD7002 is half way through one conversion and a new conversion is requested |
| 48 | the counter at the end of the first conversion will not match and not be processed |
| 49 | only then at the end of the second conversion will the conversion complete function run */ |
| 50 | int conversion_counter; |
| 51 | }; |
| 40 | 52 | |
| 41 | | /* High data byte |
| 42 | | This byte contains the 8 most significant bits of the analogue to digital conversion. */ |
| 43 | | static int uPD7002_data1=0; |
| 44 | 53 | |
| 45 | | /* Low data byte |
| 46 | | In 12 bit mode: Bits 7 to 4 define the four low order bits of the conversion. |
| 47 | | In 8 bit mode. All bits 7 to 4 are inaccurate. |
| 48 | | Bits 3 to 0 are always set to low. */ |
| 49 | | static int uPD7002_data0=0; |
| 54 | /***************************************************************************** |
| 55 | Implementation |
| 56 | *****************************************************************************/ |
| 50 | 57 | |
| 58 | INLINE uPD7002_t *get_safe_token(const device_config *device) |
| 59 | { |
| 60 | assert(device != NULL); |
| 61 | assert(device->token != NULL); |
| 51 | 62 | |
| 52 | | /* temporary store of the next A to D conversion */ |
| 53 | | static int uPD7002_digitalvalue=0; |
| 63 | return (uPD7002_t *)device->token; |
| 64 | } |
| 54 | 65 | |
| 55 | | |
| 56 | | READ8_HANDLER ( uPD7002_EOC_r ) |
| 66 | READ8_DEVICE_HANDLER ( uPD7002_EOC_r ) |
| 57 | 67 | { |
| 58 | | return (uPD7002_status>>7)&0x01; |
| 68 | uPD7002_t *uPD7002 = get_safe_token(device); |
| 69 | return (uPD7002->status>>7)&0x01; |
| 59 | 70 | } |
| 60 | 71 | |
| 61 | 72 | |
| 62 | | |
| 63 | | |
| 64 | | /* this counter is used to check a full end of conversion has been reached |
| 65 | | if the uPD7002 is half way through one conversion and a new conversion is requested |
| 66 | | the counter at the end of the first conversion will not match and not be processed |
| 67 | | only then at the end of the second conversion will the conversion complete function run */ |
| 68 | | static int conversion_counter=0; |
| 69 | | |
| 70 | 73 | static TIMER_CALLBACK(uPD7002_conversioncomplete) |
| 71 | 74 | { |
| 75 | const device_config *device = ptr; |
| 76 | uPD7002_t *uPD7002 = get_safe_token(device); |
| 77 | |
| 72 | 78 | int counter_value = param; |
| 73 | | if (counter_value==conversion_counter) |
| 79 | if (counter_value==uPD7002->conversion_counter) |
| 74 | 80 | { |
| 75 | 81 | // this really always does a 12 bit conversion |
| 76 | | uPD7002_data1=uPD7002_digitalvalue>>8; |
| 77 | | uPD7002_data0=uPD7002_digitalvalue&0xf0; |
| 82 | uPD7002->data1 = uPD7002->digitalvalue>>8; |
| 83 | uPD7002->data0 = uPD7002->digitalvalue&0xf0; |
| 78 | 84 | |
| 79 | 85 | // set the status register with top 2 MSB, not busy and conversion complete |
| 80 | | uPD7002_status=(uPD7002_status&0x0f)|((uPD7002_data1&0xc0)>>2)|0x40; |
| 86 | uPD7002->status = (uPD7002->status & 0x0f)|((uPD7002->data1 & 0xc0)>>2)|0x40; |
| 81 | 87 | |
| 82 | 88 | // call the EOC function with EOC from status |
| 83 | 89 | // uPD7002_EOC_r(0) this has just been set to 0 |
| 84 | | if (uPD7002_calls.EOC_func) (uPD7002_calls.EOC_func)(0); |
| 85 | | conversion_counter=0; |
| 90 | if (uPD7002->intf->EOC_func) (uPD7002->intf->EOC_func)(device,0); |
| 91 | uPD7002->conversion_counter=0; |
| 86 | 92 | } |
| 87 | 93 | } |
| 88 | 94 | |
| 89 | 95 | |
| 96 | READ8_DEVICE_HANDLER ( uPD7002_r ) |
| 97 | { |
| 98 | uPD7002_t *uPD7002 = get_safe_token(device); |
| 90 | 99 | |
| 91 | | |
| 92 | | READ8_HANDLER ( uPD7002_r ) |
| 93 | | { |
| 94 | 100 | switch(offset&0x03) |
| 95 | 101 | { |
| 96 | 102 | case 0: |
| 97 | | return uPD7002_status; |
| 103 | return uPD7002->status; |
| 98 | 104 | break; |
| 99 | 105 | |
| 100 | 106 | case 1: |
| 101 | | return uPD7002_data1; |
| 107 | return uPD7002->data1; |
| 102 | 108 | break; |
| 103 | 109 | |
| 104 | 110 | case 2: case 3: |
| 105 | | return uPD7002_data0; |
| 111 | return uPD7002->data0; |
| 106 | 112 | break; |
| 107 | 113 | } |
| 108 | 114 | return 0; |
| r3822 | r3823 | |
| 110 | 116 | |
| 111 | 117 | |
| 112 | 118 | |
| 113 | | WRITE8_HANDLER ( uPD7002_w ) |
| 119 | WRITE8_DEVICE_HANDLER ( uPD7002_w ) |
| 114 | 120 | { |
| 115 | | |
| 121 | uPD7002_t *uPD7002 = get_safe_token(device); |
| 116 | 122 | /* logerror("write to uPD7002 $%02X = $%02X\n",offset,data); */ |
| 117 | 123 | |
| 118 | 124 | switch(offset&0x03) |
| r3822 | r3823 | |
| 132 | 138 | */ |
| 133 | 139 | |
| 134 | 140 | /* set D6=0 busy ,D7=1 conversion not complete */ |
| 135 | | uPD7002_status=(data & 0x0f) | 0x80; |
| 141 | uPD7002->status=(data & 0x0f) | 0x80; |
| 136 | 142 | |
| 137 | 143 | // call the EOC function with EOC from status |
| 138 | 144 | // uPD7002_EOC_r(0) this has just been set to 1 |
| 139 | | if (uPD7002_calls.EOC_func) (uPD7002_calls.EOC_func)(1); |
| 145 | if (uPD7002->intf->EOC_func) uPD7002->intf->EOC_func(device, 1); |
| 140 | 146 | |
| 141 | 147 | /* the uPD7002 works by sampling the analogue value at the start of the conversion |
| 142 | 148 | so it is read hear and stored until the end of the A to D conversion */ |
| 143 | 149 | |
| 144 | 150 | // this function should return a 16 bit value. |
| 145 | | uPD7002_digitalvalue=(uPD7002_calls.get_analogue_func)(uPD7002_status&0x03); |
| 151 | uPD7002->digitalvalue = uPD7002->intf->get_analogue_func(device, uPD7002->status & 0x03); |
| 146 | 152 | |
| 147 | | conversion_counter+=1; |
| 153 | uPD7002->conversion_counter++; |
| 148 | 154 | |
| 149 | 155 | // call a timer to start the conversion |
| 150 | | if (uPD7002_status&0x08) |
| 156 | if (uPD7002->status & 0x08) |
| 151 | 157 | { |
| 152 | 158 | // 12 bit conversion takes 10ms |
| 153 | | timer_set(space->machine, ATTOTIME_IN_MSEC(10), NULL, conversion_counter, uPD7002_conversioncomplete); |
| 159 | timer_set(device->machine, ATTOTIME_IN_MSEC(10), (void *)device, uPD7002->conversion_counter, uPD7002_conversioncomplete); |
| 154 | 160 | } else { |
| 155 | 161 | // 8 bit conversion takes 4ms |
| 156 | | timer_set(space->machine, ATTOTIME_IN_MSEC(4), NULL, conversion_counter, uPD7002_conversioncomplete); |
| 162 | timer_set(device->machine, ATTOTIME_IN_MSEC(4), (void *)device, uPD7002->conversion_counter, uPD7002_conversioncomplete); |
| 157 | 163 | } |
| 158 | 164 | break; |
| 159 | 165 | |
| r3822 | r3823 | |
| 170 | 176 | } |
| 171 | 177 | } |
| 172 | 178 | |
| 179 | /* Device Interface */ |
| 173 | 180 | |
| 181 | static DEVICE_START( uPD7002 ) |
| 182 | { |
| 183 | uPD7002_t *uPD7002 = get_safe_token(device); |
| 184 | // validate arguments |
| 174 | 185 | |
| 186 | assert(device != NULL); |
| 187 | assert(device->tag != NULL); |
| 188 | assert(strlen(device->tag) < 20); |
| 189 | assert(device->static_config != NULL); |
| 175 | 190 | |
| 191 | uPD7002->intf = device->static_config; |
| 192 | uPD7002->status = 0; |
| 193 | uPD7002->data1 = 0; |
| 194 | uPD7002->data0 = 0; |
| 195 | uPD7002->digitalvalue = 0; |
| 196 | uPD7002->conversion_counter = 0; |
| 197 | |
| 198 | // register for state saving |
| 199 | state_save_register_item(device->machine, "uPD7002", device->tag, 0, uPD7002->status); |
| 200 | state_save_register_item(device->machine, "uPD7002", device->tag, 0, uPD7002->data1); |
| 201 | state_save_register_item(device->machine, "uPD7002", device->tag, 0, uPD7002->data0); |
| 202 | state_save_register_item(device->machine, "uPD7002", device->tag, 0, uPD7002->digitalvalue); |
| 203 | state_save_register_item(device->machine, "uPD7002", device->tag, 0, uPD7002->conversion_counter); |
| 204 | return DEVICE_START_OK; |
| 205 | } |
| 176 | 206 | |
| 207 | static DEVICE_RESET( uPD7002 ) |
| 208 | { |
| 209 | uPD7002_t *uPD7002 = get_safe_token(device); |
| 210 | uPD7002->status = 0; |
| 211 | uPD7002->data1 = 0; |
| 212 | uPD7002->data0 = 0; |
| 213 | uPD7002->digitalvalue = 0; |
| 214 | uPD7002->conversion_counter = 0; |
| 215 | } |
| 216 | |
| 217 | static DEVICE_SET_INFO( uPD7002 ) |
| 218 | { |
| 219 | switch (state) |
| 220 | { |
| 221 | /* no parameters to set */ |
| 222 | } |
| 223 | } |
| 224 | |
| 225 | DEVICE_GET_INFO( uPD7002 ) |
| 226 | { |
| 227 | switch (state) |
| 228 | { |
| 229 | /* --- the following bits of info are returned as 64-bit signed integers --- */ |
| 230 | case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(uPD7002_t); break; |
| 231 | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = 0; break; |
| 232 | case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_PERIPHERAL; break; |
| 233 | |
| 234 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 235 | case DEVINFO_FCT_SET_INFO: info->set_info = DEVICE_SET_INFO_NAME(uPD7002); break; |
| 236 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(uPD7002); break; |
| 237 | case DEVINFO_FCT_STOP: /* Nothing */ break; |
| 238 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(uPD7002); break; |
| 239 | |
| 240 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 241 | case DEVINFO_STR_NAME: info->s = "uPD7002"; break; |
| 242 | case DEVINFO_STR_FAMILY: info->s = "uPD7002"; break; |
| 243 | case DEVINFO_STR_VERSION: info->s = "1.0"; break; |
| 244 | case DEVINFO_STR_SOURCE_FILE: info->s = __FILE__; break; |
| 245 | case DEVINFO_STR_CREDITS: info->s = "Copyright MESS Team"; break; |
| 246 | } |
| 247 | } |
src/mess/machine/upd7002.h
| r3822 | r3823 | |
| 11 | 11 | #ifndef UPD7002_H_ |
| 12 | 12 | #define UPD7002_H_ |
| 13 | 13 | |
| 14 | /*************************************************************************** |
| 15 | MACROS |
| 16 | ***************************************************************************/ |
| 14 | 17 | |
| 15 | | struct uPD7002_interface |
| 18 | #define UPD7002 DEVICE_GET_INFO_NAME(uPD7002) |
| 19 | |
| 20 | /*************************************************************************** |
| 21 | TYPE DEFINITIONS |
| 22 | ***************************************************************************/ |
| 23 | |
| 24 | typedef int (*uPD7002_get_analogue_func)(const device_config *device, int channel_number); |
| 25 | #define UPD7002_GET_ANALOGUE(name) int name(const device_config *device, int channel_number ) |
| 26 | |
| 27 | typedef void (*uPD7002_eoc_func)(const device_config *device, int data); |
| 28 | #define UPD7002_EOC(name) void name(const device_config *device, int data ) |
| 29 | |
| 30 | |
| 31 | typedef struct _uPD7002_interface uPD7002_interface; |
| 32 | struct _uPD7002_interface |
| 16 | 33 | { |
| 17 | | int (*get_analogue_func)(int channel_number); |
| 18 | | void (*EOC_func)(int data); |
| 34 | uPD7002_get_analogue_func get_analogue_func; |
| 35 | uPD7002_eoc_func EOC_func; |
| 19 | 36 | }; |
| 20 | 37 | |
| 38 | /*************************************************************************** |
| 39 | FUNCTION PROTOTYPES |
| 40 | ***************************************************************************/ |
| 21 | 41 | |
| 22 | | /*----------- defined in machine/upd7002.c -----------*/ |
| 42 | /* device interface */ |
| 43 | DEVICE_GET_INFO( uPD7002 ); |
| 23 | 44 | |
| 24 | | void uPD7002_config(const struct uPD7002_interface *intf); |
| 45 | /* Standard handlers */ |
| 25 | 46 | |
| 26 | | READ8_HANDLER ( uPD7002_EOC_r ); |
| 47 | READ8_DEVICE_HANDLER ( uPD7002_EOC_r ); |
| 48 | READ8_DEVICE_HANDLER ( uPD7002_r ); |
| 49 | WRITE8_DEVICE_HANDLER ( uPD7002_w ); |
| 27 | 50 | |
| 28 | | READ8_HANDLER ( uPD7002_r ); |
| 29 | | WRITE8_HANDLER ( uPD7002_w ); |
| 30 | 51 | |
| 52 | /*************************************************************************** |
| 53 | DEVICE CONFIGURATION MACROS |
| 54 | ***************************************************************************/ |
| 31 | 55 | |
| 56 | #define MDRV_UPD7002_ADD(_tag, _intrf) \ |
| 57 | MDRV_DEVICE_ADD(_tag, UPD7002) \ |
| 58 | MDRV_DEVICE_CONFIG(_intrf) |
| 59 | |
| 60 | |
| 32 | 61 | #endif /* UPD7002_H_ */ |
src/mess/machine/bbc.c
| r3822 | r3823 | |
| 594 | 594 | if ((myo>=0x00) && (myo<=0x07)) return BBC_6845_r(space, myo-0x00); /* Video Controller */ |
| 595 | 595 | if ((myo>=0x08) && (myo<=0x0f)) return BBC_6850_r(space, myo-0x08); /* Serial Controller */ |
| 596 | 596 | if ((myo>=0x10) && (myo<=0x17)) return 0xfe; /* Serial System Chip */ |
| 597 | | if ((myo>=0x18) && (myo<=0x1f)) return uPD7002_r(space, myo-0x18); /* A to D converter */ |
| 597 | if ((myo>=0x18) && (myo<=0x1f)) return uPD7002_r((device_config*)device_list_find_by_tag( space->machine->config->devicelist, UPD7002, "upd7002" ), myo-0x18); /* A to D converter */ |
| 598 | 598 | if ((myo>=0x20) && (myo<=0x23)) return 0xfe; /* VideoULA */ |
| 599 | 599 | if ((myo>=0x24) && (myo<=0x27)) return bbcm_wd1770l_read(space, myo-0x24); /* 1770 */ |
| 600 | 600 | if ((myo>=0x28) && (myo<=0x2f)) return bbcm_wd1770_read(space, myo-0x28); /* disc control latch */ |
| r3822 | r3823 | |
| 622 | 622 | if ((myo>=0x00) && (myo<=0x07)) BBC_6845_w(space, myo-0x00,data); /* Video Controller */ |
| 623 | 623 | if ((myo>=0x08) && (myo<=0x0f)) BBC_6850_w(space, myo-0x08,data); /* Serial Controller */ |
| 624 | 624 | if ((myo>=0x10) && (myo<=0x17)) BBC_SerialULA_w(space, myo-0x10,data); /* Serial System Chip */ |
| 625 | | if ((myo>=0x18) && (myo<=0x1f)) uPD7002_w(space, myo-0x18,data); /* A to D converter */ |
| 625 | if ((myo>=0x18) && (myo<=0x1f)) uPD7002_w((device_config*)device_list_find_by_tag( space->machine->config->devicelist, UPD7002, "upd7002" ),myo-0x18,data); /* A to D converter */ |
| 626 | 626 | if ((myo>=0x20) && (myo<=0x23)) videoULA_w(space, myo-0x20,data); /* VideoULA */ |
| 627 | 627 | if ((myo>=0x24) && (myo<=0x27)) bbcm_wd1770l_write(space, myo-0x24,data); /* 1770 */ |
| 628 | 628 | if ((myo>=0x28) && (myo<=0x2f)) bbcm_wd1770_write(space, myo-0x28,data); /* disc control latch */ |
| r3822 | r3823 | |
| 1159 | 1159 | /* joystick EOC */ |
| 1160 | 1160 | static READ8_HANDLER( bbcb_via_system_read_cb1 ) |
| 1161 | 1161 | { |
| 1162 | | return uPD7002_EOC_r(space, 0); |
| 1162 | return uPD7002_EOC_r((device_config*)device_list_find_by_tag( space->machine->config->devicelist, UPD7002, "upd7002" ),0); |
| 1163 | 1163 | } |
| 1164 | 1164 | |
| 1165 | 1165 | |
| r3822 | r3823 | |
| 1312 | 1312 | BBC Joystick Support |
| 1313 | 1313 | **************************************/ |
| 1314 | 1314 | |
| 1315 | | static int BBC_get_analogue_input(int channel_number) |
| 1315 | UPD7002_GET_ANALOGUE(BBC_get_analogue_input) |
| 1316 | 1316 | { |
| 1317 | 1317 | switch(channel_number) |
| 1318 | 1318 | { |
| 1319 | 1319 | case 0: |
| 1320 | | return ((0xff-input_port_read(Machine, "JOY0"))<<8); |
| 1320 | return ((0xff-input_port_read(device->machine, "JOY0"))<<8); |
| 1321 | 1321 | break; |
| 1322 | 1322 | case 1: |
| 1323 | | return ((0xff-input_port_read(Machine, "JOY1"))<<8); |
| 1323 | return ((0xff-input_port_read(device->machine, "JOY1"))<<8); |
| 1324 | 1324 | break; |
| 1325 | 1325 | case 2: |
| 1326 | | return ((0xff-input_port_read(Machine, "JOY2"))<<8); |
| 1326 | return ((0xff-input_port_read(device->machine, "JOY2"))<<8); |
| 1327 | 1327 | break; |
| 1328 | 1328 | case 3: |
| 1329 | | return ((0xff-input_port_read(Machine, "JOY3"))<<8); |
| 1329 | return ((0xff-input_port_read(device->machine, "JOY3"))<<8); |
| 1330 | 1330 | break; |
| 1331 | 1331 | } |
| 1332 | 1332 | |
| 1333 | 1333 | return 0; |
| 1334 | 1334 | } |
| 1335 | 1335 | |
| 1336 | | static void BBC_uPD7002_EOC(int data) |
| 1336 | UPD7002_EOC(BBC_uPD7002_EOC) |
| 1337 | 1337 | { |
| 1338 | 1338 | via_0_cb1_w(cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0,data); |
| 1339 | 1339 | } |
| 1340 | 1340 | |
| 1341 | | static const struct uPD7002_interface BBC_uPD7002 = |
| 1341 | const uPD7002_interface BBC_uPD7002 = |
| 1342 | 1342 | { |
| 1343 | 1343 | BBC_get_analogue_input, |
| 1344 | 1344 | BBC_uPD7002_EOC |
| 1345 | 1345 | }; |
| 1346 | 1346 | |
| 1347 | 1347 | |
| 1348 | | |
| 1349 | | |
| 1350 | 1348 | /*************************************** |
| 1351 | 1349 | BBC 6850 Serial Controller |
| 1352 | 1350 | ****************************************/ |
| r3822 | r3823 | |
| 2205 | 2203 | |
| 2206 | 2204 | bbcb_IC32_initialise(); |
| 2207 | 2205 | |
| 2208 | | uPD7002_config(&BBC_uPD7002); |
| 2209 | 2206 | MC6850_config(&BBC_MC6850_calls); |
| 2210 | 2207 | |
| 2211 | 2208 | opusbank=0; |
| r3822 | r3823 | |
| 2249 | 2246 | |
| 2250 | 2247 | bbcb_IC32_initialise(); |
| 2251 | 2248 | |
| 2252 | | uPD7002_config(&BBC_uPD7002); |
| 2253 | 2249 | MC6850_config(&BBC_MC6850_calls); |
| 2254 | 2250 | |
| 2255 | 2251 | previous_wd177x_int_state=1; |
| r3822 | r3823 | |
| 2290 | 2286 | |
| 2291 | 2287 | bbcb_IC32_initialise(); |
| 2292 | 2288 | |
| 2293 | | uPD7002_config(&BBC_uPD7002); |
| 2294 | 2289 | MC6850_config(&BBC_MC6850_calls); |
| 2295 | 2290 | |
| 2296 | 2291 | previous_wd177x_int_state=1; |
src/mess/drivers/bbc.c
| r3822 | r3823 | |
| 147 | 147 | AM_RANGE(0xfe60, 0xfe7f) AM_READWRITE(via_1_r , via_1_w ) /* fe60-fe7f 6522 VIA USER VIA */ |
| 148 | 148 | AM_RANGE(0xfe80, 0xfe9f) AM_READWRITE(bbc_disc_r , bbc_disc_w ) /* fe80-fe9f 8271 FDC Floppy disc controller */ |
| 149 | 149 | AM_RANGE(0xfea0, 0xfebf) AM_READ (return8_FE ) /* fea0-febf 68B54 ADLC ECONET controller */ |
| 150 | | AM_RANGE(0xfec0, 0xfedf) AM_READWRITE(uPD7002_r , uPD7002_w ) /* fec0-fedf uPD7002 Analogue to digital converter */ |
| 150 | AM_RANGE(0xfec0, 0xfedf) AM_DEVREADWRITE(UPD7002, "upd7002",uPD7002_r,uPD7002_w ) /* fec0-fedf uPD7002 Analogue to digital converter */ |
| 151 | 151 | AM_RANGE(0xfee0, 0xfeff) AM_READ (return8_FE ) /* fee0-feff Tube ULA Tube system interface */ |
| 152 | 152 | |
| 153 | 153 | AM_RANGE(0xff00, 0xffff) AM_ROM AM_REGION("user1", 0x43f00) /* ff00-ffff OS Rom (continued) */ |
| r3822 | r3823 | |
| 181 | 181 | AM_RANGE(0xfe60, 0xfe7f) AM_READWRITE(via_1_r , via_1_w ) /* fe60-fe7f 6522 VIA USER VIA */ |
| 182 | 182 | AM_RANGE(0xfe80, 0xfe9f) AM_READWRITE(bbc_wd1770_read , bbc_wd1770_write ) /* fe80-fe9f 1770 FDC Floppy disc controller */ |
| 183 | 183 | AM_RANGE(0xfea0, 0xfebf) AM_READ (return8_FE ) /* fea0-febf 68B54 ADLC ECONET controller */ |
| 184 | | AM_RANGE(0xfec0, 0xfedf) AM_READWRITE(uPD7002_r , uPD7002_w ) /* fec0-fedf uPD7002 Analogue to digital converter */ |
| 184 | AM_RANGE(0xfec0, 0xfedf) AM_DEVREADWRITE(UPD7002, "upd7002", uPD7002_r, uPD7002_w) /* fec0-fedf uPD7002 Analogue to digital converter */ |
| 185 | 185 | AM_RANGE(0xfee0, 0xfeff) AM_READ (return8_FE ) /* fee0-feff Tube ULA Tube system interface */ |
| 186 | 186 | |
| 187 | 187 | AM_RANGE(0xff00, 0xffff) AM_ROM AM_REGION("user1", 0x43f00) /* ff00-ffff OS Rom (continued) */ |
| r3822 | r3823 | |
| 217 | 217 | AM_RANGE(0xfe60, 0xfe7f) AM_READWRITE(via_1_r , via_1_w ) /* fe60-fe7f 6522 VIA USER VIA */ |
| 218 | 218 | AM_RANGE(0xfe80, 0xfe9f) AM_READWRITE(bbc_wd1770_read , bbc_wd1770_write ) /* fe80-fe9f 1770 FDC Floppy disc controller */ |
| 219 | 219 | AM_RANGE(0xfea0, 0xfebf) AM_READ (return8_FE ) /* fea0-febf 68B54 ADLC ECONET controller */ |
| 220 | | AM_RANGE(0xfec0, 0xfedf) AM_READWRITE(uPD7002_r , uPD7002_w ) /* fec0-fedf uPD7002 Analogue to digital converter */ |
| 220 | AM_RANGE(0xfec0, 0xfedf) AM_DEVREADWRITE(UPD7002, "upd7002",uPD7002_r, uPD7002_w ) /* fec0-fedf uPD7002 Analogue to digital converter */ |
| 221 | 221 | AM_RANGE(0xfee0, 0xfeff) AM_READ (return8_FE ) /* fee0-feff Tube ULA Tube system interface */ |
| 222 | 222 | |
| 223 | 223 | AM_RANGE(0xff00, 0xffff) AM_ROM AM_REGION("user1", 0x43f00) /* ff00-ffff OS Rom (continued) */ |
| r3822 | r3823 | |
| 271 | 271 | AM_RANGE(0xfe00, 0xfe07) AM_READWRITE(BBC_6845_r , BBC_6845_w ) fe00-fe07 6845 CRTC Video controller |
| 272 | 272 | AM_RANGE(0xfe08, 0xfe0f) AM_READWRITE(BBC_6850_r , BBC_6850_w ) fe08-fe0f 6850 ACIA Serial Controller |
| 273 | 273 | AM_RANGE(0xfe10, 0xfe17) AM_NOP fe10-fe17 Serial ULA Serial system chip |
| 274 | | AM_RANGE(0xfe18, 0xfe1f) AM_READWRITE(uPD7002_r , uPD7002_w ) fec0-fedf uPD7002 Analogue to digital converter |
| 274 | AM_RANGE(0xfe18, 0xfe1f) M_DEVREADWRITE(UPD7002, "uPD7002",uPD7002_r, uPD7002_w ) fec0-fedf uPD7002 Analogue to digital converter |
| 275 | 275 | AM_RANGE(0xfe20, 0xfe23) AM_READWRITE(return8_FE , videoULA_w ) fe20-fe23 Video ULA Video system chip |
| 276 | 276 | AM_RANGE(0xfe24, 0xfe27) AM_READWRITE(bbcm_wd1770l_read , bbcm_wd1770l_write) fe24-fe27 1770 Latch 1770 Control Latch |
| 277 | 277 | AM_RANGE(0xfe28, 0xfe2f) AM_READWRITE(bbcm_wd1770_read , bbcm_wd1770_write ) fe28-fe2f 1770 FDC Floppy disc controller |
| r3822 | r3823 | |
| 749 | 749 | // MDRV_SOUND_ADD("tms5220", TMS5220, tms5220_interface) |
| 750 | 750 | |
| 751 | 751 | MDRV_CASSETTE_ADD( "cassette", bbc_cassette_config ) |
| 752 | |
| 753 | /* devices */ |
| 754 | MDRV_UPD7002_ADD("upd7002",BBC_uPD7002) |
| 752 | 755 | MACHINE_DRIVER_END |
| 753 | 756 | |
| 754 | 757 | |
| r3822 | r3823 | |
| 818 | 821 | MDRV_DEVICE_ADD("printer", PRINTER) |
| 819 | 822 | |
| 820 | 823 | MDRV_CASSETTE_ADD( "cassette", bbc_cassette_config ) |
| 824 | |
| 825 | /* devices */ |
| 826 | MDRV_UPD7002_ADD("upd7002",BBC_uPD7002) |
| 821 | 827 | MACHINE_DRIVER_END |
| 822 | 828 | |
| 823 | 829 | static void bbc_cartslot_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info) |