src/mess/machine/samcoupe.c
| r4870 | r4871 | |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | |
| 151 | | static READ8_HANDLER( samcoupe_rtc_r ) |
| 151 | static READ8_DEVICE_HANDLER( samcoupe_rtc_r ) |
| 152 | 152 | { |
| 153 | | const device_config *rtc = devtag_get_device(space->machine, "sambus_clock"); |
| 154 | | return msm6242_r(rtc, offset >> 12); |
| 153 | return msm6242_r(device, offset >> 12); |
| 155 | 154 | } |
| 156 | 155 | |
| 157 | 156 | |
| 158 | | static WRITE8_HANDLER( samcoupe_rtc_w ) |
| 157 | static WRITE8_DEVICE_HANDLER( samcoupe_rtc_w ) |
| 159 | 158 | { |
| 160 | | const device_config *rtc = devtag_get_device(space->machine, "sambus_clock"); |
| 161 | | msm6242_w(rtc, offset >> 12, data); |
| 159 | msm6242_w(device, offset >> 12, data); |
| 162 | 160 | } |
| 163 | 161 | |
| 164 | 162 | |
| r4870 | r4871 | |
| 177 | 175 | if (input_port_read(machine, "config") & 0x01) |
| 178 | 176 | { |
| 179 | 177 | /* install RTC */ |
| 180 | | memory_install_readwrite8_handler(spaceio, 0xef, 0xef, 0xffff, 0xff00, samcoupe_rtc_r, samcoupe_rtc_w); |
| 178 | const device_config *rtc = devtag_get_device(machine, "rtc"); |
| 179 | memory_install_readwrite8_device_handler(spaceio, rtc, 0xef, 0xef, 0xffff, 0xff00, samcoupe_rtc_r, samcoupe_rtc_w); |
| 181 | 180 | } |
| 182 | 181 | else |
| 183 | 182 | { |
src/mess/drivers/samcoupe.c
| r4870 | r4871 | |
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | |
| 292 | | static READ8_HANDLER( samcoupe_lpt1_busy_r ) |
| 292 | static READ8_DEVICE_HANDLER( samcoupe_lpt1_busy_r ) |
| 293 | 293 | { |
| 294 | | const device_config *printer = devtag_get_device(space->machine, "lpt1"); |
| 295 | | return centronics_busy_r(printer); |
| 294 | return centronics_busy_r(device); |
| 296 | 295 | } |
| 297 | 296 | |
| 298 | 297 | |
| 299 | | static WRITE8_HANDLER( samcoupe_lpt1_strobe_w ) |
| 298 | static WRITE8_DEVICE_HANDLER( samcoupe_lpt1_strobe_w ) |
| 300 | 299 | { |
| 301 | | const device_config *printer = devtag_get_device(space->machine, "lpt1"); |
| 302 | | centronics_strobe_w(printer, data); |
| 300 | centronics_strobe_w(device, data); |
| 303 | 301 | } |
| 304 | 302 | |
| 305 | 303 | |
| 306 | | static READ8_HANDLER( samcoupe_lpt2_busy_r ) |
| 304 | static READ8_DEVICE_HANDLER( samcoupe_lpt2_busy_r ) |
| 307 | 305 | { |
| 308 | | const device_config *printer = devtag_get_device(space->machine, "lpt2"); |
| 309 | | return centronics_busy_r(printer); |
| 306 | return centronics_busy_r(device); |
| 310 | 307 | } |
| 311 | 308 | |
| 312 | 309 | |
| 313 | | static WRITE8_HANDLER( samcoupe_lpt2_strobe_w ) |
| 310 | static WRITE8_DEVICE_HANDLER( samcoupe_lpt2_strobe_w ) |
| 314 | 311 | { |
| 315 | | const device_config *printer = devtag_get_device(space->machine, "lpt2"); |
| 316 | | centronics_strobe_w(printer, data); |
| 312 | centronics_strobe_w(device, data); |
| 317 | 313 | } |
| 318 | 314 | |
| 319 | 315 | |
| r4870 | r4871 | |
| 333 | 329 | |
| 334 | 330 | |
| 335 | 331 | static ADDRESS_MAP_START( samcoupe_io, ADDRESS_SPACE_IO, 8 ) |
| 336 | | AM_RANGE(0x80, 0x81) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_WRITE(samcoupe_ext_mem_w) |
| 337 | | AM_RANGE(0xe0, 0xe7) AM_MIRROR(0xff10) AM_MASK(0xffff) AM_READWRITE(samcoupe_disk_r, samcoupe_disk_w) |
| 338 | | AM_RANGE(0xe8, 0xe8) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_DEVWRITE("lpt1", centronics_data_w) |
| 339 | | AM_RANGE(0xe9, 0xe9) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_READWRITE(samcoupe_lpt1_busy_r, samcoupe_lpt1_strobe_w) |
| 340 | | AM_RANGE(0xea, 0xea) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_DEVWRITE("lpt2", centronics_data_w) |
| 341 | | AM_RANGE(0xeb, 0xeb) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_READWRITE(samcoupe_lpt2_busy_r, samcoupe_lpt2_strobe_w) |
| 342 | | AM_RANGE(0xf8, 0xf8) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_READWRITE(samcoupe_pen_r, samcoupe_clut_w) |
| 343 | | AM_RANGE(0xf9, 0xf9) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_READWRITE(samcoupe_status_r, samcoupe_line_int_w) |
| 344 | | AM_RANGE(0xfa, 0xfa) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_READWRITE(samcoupe_lmpr_r, samcoupe_lmpr_w) |
| 345 | | AM_RANGE(0xfb, 0xfb) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_READWRITE(samcoupe_hmpr_r, samcoupe_hmpr_w) |
| 346 | | AM_RANGE(0xfc, 0xfc) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_READWRITE(samcoupe_vmpr_r, samcoupe_vmpr_w) |
| 347 | | AM_RANGE(0xfd, 0xfd) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_READWRITE(samcoupe_midi_r, samcoupe_midi_w) |
| 348 | | AM_RANGE(0xfe, 0xfe) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_READWRITE(samcoupe_keyboard_r, samcoupe_border_w) |
| 349 | | AM_RANGE(0xff, 0xff) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_READ(samcoupe_attributes_r) |
| 350 | | AM_RANGE(0xff, 0xff) AM_MIRROR(0xfe00) AM_MASK(0xffff) AM_DEVWRITE("saa1099", saa1099_data_w) |
| 351 | | AM_RANGE(0x1ff, 0x1ff) AM_MIRROR(0xfe00) AM_MASK(0xffff) AM_DEVWRITE("saa1099", saa1099_control_w) |
| 332 | AM_RANGE(0x0080, 0x0081) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_WRITE(samcoupe_ext_mem_w) |
| 333 | AM_RANGE(0x00e0, 0x00e7) AM_MIRROR(0xff10) AM_MASK(0xffff) AM_READWRITE(samcoupe_disk_r, samcoupe_disk_w) |
| 334 | AM_RANGE(0x00e8, 0x00e8) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_DEVWRITE("lpt1", centronics_data_w) |
| 335 | AM_RANGE(0x00e9, 0x00e9) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_DEVREADWRITE("lpt1", samcoupe_lpt1_busy_r, samcoupe_lpt1_strobe_w) |
| 336 | AM_RANGE(0x00ea, 0x00ea) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_DEVWRITE("lpt2", centronics_data_w) |
| 337 | AM_RANGE(0x00eb, 0x00eb) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_DEVREADWRITE("lpt2", samcoupe_lpt2_busy_r, samcoupe_lpt2_strobe_w) |
| 338 | AM_RANGE(0x00f8, 0x00f8) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_READWRITE(samcoupe_pen_r, samcoupe_clut_w) |
| 339 | AM_RANGE(0x00f9, 0x00f9) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_READWRITE(samcoupe_status_r, samcoupe_line_int_w) |
| 340 | AM_RANGE(0x00fa, 0x00fa) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_READWRITE(samcoupe_lmpr_r, samcoupe_lmpr_w) |
| 341 | AM_RANGE(0x00fb, 0x00fb) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_READWRITE(samcoupe_hmpr_r, samcoupe_hmpr_w) |
| 342 | AM_RANGE(0x00fc, 0x00fc) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_READWRITE(samcoupe_vmpr_r, samcoupe_vmpr_w) |
| 343 | AM_RANGE(0x00fd, 0x00fd) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_READWRITE(samcoupe_midi_r, samcoupe_midi_w) |
| 344 | AM_RANGE(0x00fe, 0x00fe) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_READWRITE(samcoupe_keyboard_r, samcoupe_border_w) |
| 345 | AM_RANGE(0x00ff, 0x00ff) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_READ(samcoupe_attributes_r) |
| 346 | AM_RANGE(0x00ff, 0x00ff) AM_MIRROR(0xfe00) AM_MASK(0xffff) AM_DEVWRITE("saa1099", saa1099_data_w) |
| 347 | AM_RANGE(0x01ff, 0x01ff) AM_MIRROR(0xfe00) AM_MASK(0xffff) AM_DEVWRITE("saa1099", saa1099_control_w) |
| 352 | 348 | ADDRESS_MAP_END |
| 353 | 349 | |
| 354 | 350 | |