Previous 15994 Revisions Next

r5240 Wednesday 15th July, 2009 at 07:00:51 UTC by Curt Coder
Removed some cassette trampolines.
[src/mess/drivers]abc80.c abc80x.c c80.c comx35.c crvision.c kyocera.c lc80.c mc1000.c newbrain.c osi.c sg1000.c tmc1800.c tmc2000e.c tmc600.c vip.c
[src/mess/includes]abc80.h abc80x.h c80.h comx35.h crvision.h kyocera.h lc80.h mc1000.h newbrain.h osi.h sg1000.h tmc1800.h tmc2000e.h tmc600.h vip.h

src/mess/includes/vip.h
r5239r5240
11#ifndef __VIP__
22#define __VIP__
33
4#define SCREEN_TAG   "screen"
4#define SCREEN_TAG      "screen"
5#define CDP1802_TAG      "u1"
6#define CDP1861_TAG      "u2"
7#define CDP1862_TAG      "cdp1862"
8#define CDP1863_TAG      "cdp1863"
9#define CASSETTE_TAG   "cassette"
510
6#define CDP1802_TAG "u1"
7#define CDP1861_TAG "u2"
8#define CDP1862_TAG "cdp1862"
9#define CDP1863_TAG "cdp1863"
10
1111#define VP590_COLOR_RAM_SIZE   0x100
1212
1313#define VIP_BANK_RAM      0
r5239r5240
5151   const device_config *cdp1861;
5252   const device_config *cdp1862;
5353   const device_config *cdp1863;
54   const device_config *cassette;
5455};
5556
5657#endif
src/mess/includes/mc1000.h
r5239r5240
3232   const device_config *mc6845;
3333   const device_config *mc6847;
3434   const device_config *centronics;
35   const device_config *cassette;
3536};
3637
3738#endif
src/mess/includes/tmc600.h
r5239r5240
11#ifndef __TMC600__
22#define __TMC600__
33
4#define SCREEN_TAG   "screen"
4#define SCREEN_TAG      "screen"
5#define CDP1802_TAG      "cdp1802"
6#define CDP1869_TAG      "cdp1869"
7#define CASSETTE_TAG   "cassette"
8#define CENTRONICS_TAG   "centronics"
59
6#define CDP1802_TAG   "cdp1802"
7#define CDP1869_TAG   "cdp1869"
8
910#define TMC600_PAGE_RAM_SIZE   0x400
1011#define TMC600_PAGE_RAM_MASK   0x3ff
1112
r5239r5240
2223   UINT8 *color_ram;      /* color memory */
2324   UINT8 *char_rom;      /* character generator ROM */
2425
25   const device_config *cdp1869;
26
2726   /* keyboard state */
2827   int keylatch;         /* key latch */
28
29   /* devices */
30   const device_config *cdp1869;
31   const device_config *cassette;
2932};
3033
3134/* ---------- defined in video/tmc600.c ---------- */
src/mess/includes/abc80.h
r5239r5240
4444
4545#define ABC80_CHAR_CURSOR      0x80
4646
47#define SCREEN_TAG   "screen"
48#define Z80_TAG      "ab67"
49#define Z80PIO_TAG   "cd67"
47#define SCREEN_TAG      "screen"
48#define Z80_TAG         "ab67"
49#define Z80PIO_TAG      "cd67"
50#define CASSETTE_TAG   "cassette"
5051
5152typedef struct _abc80_state abc80_state;
5253struct _abc80_state
r5239r5240
6263   int char_bank;
6364   int char_row;
6465
65   /* devices */
66   const device_config *z80pio;
67
6866   /* memory regions */
6967   const UINT8 *char_rom;      /* character generator ROM */
7068   const UINT8 *hsync_prom;   /* horizontal sync PROM */
7169   const UINT8 *vsync_prom;   /* horizontal sync PROM */
7270   const UINT8 *line_prom;      /* line address PROM */
7371   const UINT8 *attr_prom;      /* character attribute PROM */
72
73   /* devices */
74   const device_config *z80pio;
75   const device_config *cassette;
7476};
7577
7678/*----------- defined in video/abc80.c -----------*/
src/mess/includes/sg1000.h
r5239r5240
55#define Z80_TAG         "z80"
66#define SN76489A_TAG   "sn76489a"
77#define NEC765_TAG      "nec765"
8#define CASSETTE_TAG   "cassette"
9#define CENTRONICS_TAG   "centronics"
810
911#define IS_CARTRIDGE_TV_DRAW(ptr) \
1012   (!strncmp("annakmn", (const char *)&ptr[0x13b3], 7))
r5239r5240
3032   /* floppy state */
3133   int fdc_irq;
3234   int fdc_index;
35
36   /* devices */
37   const device_config *cassette;
3338};
3439
3540#endif
src/mess/includes/osi.h
r5239r5240
11#ifndef __OSI__
22#define __OSI__
33
4#define SCREEN_TAG   "screen"
5#define M6502_TAG   "m6502"
4#define SCREEN_TAG      "screen"
5#define M6502_TAG      "m6502"
6#define CASSETTE_TAG   "cassette"
67
78#define X1         3932160
89#define UK101_X1   XTAL_8MHz
r5239r5240
2425
2526   /* floppy state */
2627   int fdc_index;
28
29   /* devices */
30   const device_config *cassette;
2731};
2832
2933/* ---------- defined in video/osi.c ---------- */
src/mess/includes/lc80.h
r5239r5240
1919   /* devices */
2020   const device_config *z80pio2;
2121   const device_config *speaker;
22   const device_config *cassette;
2223};
2324
2425#endif
src/mess/includes/abc80x.h
r5239r5240
2424#define ABC806_ATTR_RAM_SIZE   0x800
2525#define ABC806_VIDEO_RAM_SIZE   0x20000
2626
27#define SCREEN_TAG   "screen"
28#define Z80_TAG      "z80"
29#define E0516_TAG   "j13"
30#define MC6845_TAG   "b12"
31#define Z80CTC_TAG   "z80ctc"
32#define Z80SIO_TAG   "z80sio"
33#define Z80DART_TAG   "z80dart"
27#define SCREEN_TAG      "screen"
28#define Z80_TAG         "z80"
29#define E0516_TAG      "j13"
30#define MC6845_TAG      "b12"
31#define Z80CTC_TAG      "z80ctc"
32#define Z80SIO_TAG      "z80sio"
33#define Z80DART_TAG      "z80dart"
34#define CASSETTE_TAG   "cassette"
3435
3536#define ABC800_CHAR_WIDTH   6
3637#define ABC800_CCLK         ABC800_X01/ABC800_CHAR_WIDTH
r5239r5240
4748   /* video state */
4849   UINT8 *charram;            /* character RAM */
4950   UINT8 *videoram;         /* HR video RAM */
50
51   const UINT8 *char_rom;      /* character generator ROM */
52   const UINT8 *fgctl_prom;   /* foreground control PROM */
5153   UINT8 hrs;               /* HR picture start scanline */
5254   UINT8 fgctl;            /* HR foreground control */
5355
r5239r5240
6062   const device_config *z80sio;
6163   const device_config *abc77;
6264   const device_config *mc6845;
63
64   /* memory regions */
65   const UINT8 *char_rom;      /* character generator ROM */
66   const UINT8 *fgctl_prom;   /* foreground control PROM */
65   const device_config *cassette;
6766};
6867
6968typedef struct _abc802_state abc802_state;
r5239r5240
7776
7877   /* video state */
7978   UINT8 *charram;         /* character RAM */
79   const UINT8 *char_rom;   /* character generator ROM */
8080
8181   int flshclk_ctr;      /* flash clock counter */
8282   int flshclk;         /* flash clock */
r5239r5240
9191   const device_config *z80sio;
9292   const device_config *abc77;
9393   const device_config *mc6845;
94
95   /* memory regions */
96   const UINT8 *char_rom;   /* character generator ROM */
94   const device_config *cassette;
9795};
9896
9997typedef struct _abc806_state abc806_state;
r5239r5240
112110   UINT8 *charram;         /* character RAM */
113111   UINT8 *colorram;      /* attribute RAM */
114112   UINT8 *videoram;      /* HR video RAM */
113   const UINT8 *rad_prom;   /* line address PROM */
114   const UINT8 *hru2_prom;   /* HR palette PROM */
115   const UINT8 *char_rom;   /* character generator ROM */
115116
116117   int txoff;            /* text display enable */
117118   int _40;            /* 40/80 column mode */
r5239r5240
134135   const device_config *mc6845;
135136   const device_config *abc77;
136137   const device_config *e0516;
137
138   /* memory regions */
139   const UINT8 *rad_prom;   /* line address PROM */
140   const UINT8 *hru2_prom;   /* HR palette PROM */
141   const UINT8 *char_rom;   /* character generator ROM */
138   const device_config *cassette;
142139};
143140
144141/*----------- defined in video/abc800.c -----------*/
src/mess/includes/tmc2000e.h
r5239r5240
11#ifndef __TMC2000E__
22#define __TMC2000E__
33
4#define SCREEN_TAG   "screen"
4#define SCREEN_TAG      "screen"
5#define CDP1802_TAG      "cdp1802"
6#define CDP1864_TAG      "cdp1864"
7#define CASSETTE_TAG   "cassette"
58
6#define CDP1802_TAG "cdp1802"
7#define CDP1864_TAG "cdp1864"
8
99#define TMC2000E_COLORRAM_SIZE 0x100 // ???
1010
1111typedef struct _tmc2000e_state tmc2000e_state;
r5239r5240
2222
2323   /* devices */
2424   const device_config *cdp1864;
25   const device_config *cassette;
2526};
2627
2728#endif
src/mess/includes/c80.h
r5239r5240
2020
2121   /* devices */
2222   const device_config *z80pio;
23   const device_config *cassette;
2324};
2425
2526#endif
src/mess/includes/tmc1800.h
r5239r5240
11#ifndef __TMC1800__
22#define __TMC1800__
33
4#define SCREEN_TAG   "screen"
4#define SCREEN_TAG      "screen"
5#define CDP1802_TAG      "cdp1802"
6#define CDP1861_TAG      "cdp1861"
7#define CDP1864_TAG      "m3"
8#define CASSETTE_TAG   "cassette"
59
6#define CDP1802_TAG "cdp1802"
7#define CDP1861_TAG "cdp1861"
8#define CDP1864_TAG "m3"
9
1010typedef struct _tmc1800_state tmc1800_state;
1111struct _tmc1800_state
1212{
r5239r5240
2121
2222   /* devices */
2323   const device_config *cdp1861;
24   const device_config *cassette;
2425};
2526
2627typedef struct _osc1000b_state osc1000b_state;
r5239r5240
3132
3233   /* keyboard state */
3334   int keylatch;         /* key latch */
35
36   /* devices */
37   const device_config *cassette;
3438};
3539
3640typedef struct _tmc2000_state tmc2000_state;
r5239r5240
4751
4852   /* devices */
4953   const device_config *cdp1864;
54   const device_config *cassette;
5055};
5156
5257typedef struct _oscnano_state oscnano_state;
r5239r5240
6772
6873   /* devices */
6974   const device_config *cdp1864;
75   const device_config *cassette;
7076};
7177
7278/* ---------- defined in video/tmc1800.c ---------- */
src/mess/includes/crvision.h
r5239r5240
11#ifndef __CRVISION__
22#define __CRVISION__
33
4#define SCREEN_TAG   "screen"
5#define M6502_TAG   "u2"
6#define TMS9929_TAG   "u3"
7#define PIA6821_TAG   "u21"
8#define SN76489_TAG   "u22"
4#define SCREEN_TAG      "screen"
5#define M6502_TAG      "u2"
6#define TMS9929_TAG      "u3"
7#define PIA6821_TAG      "u21"
8#define SN76489_TAG      "u22"
9#define CASSETTE_TAG   "cassette"
10#define CENTRONICS_TAG   "centronics"
911
1012#define BANK_ROM1   1
1113#define BANK_ROM2   2
r5239r5240
1820
1921   /* devices */
2022   const device_config *sn76489;
23   const device_config *cassette;
2124};
2225
2326#endif
src/mess/includes/newbrain.h
r5239r5240
11#ifndef __NEWBRAIN__
22#define __NEWBRAIN__
33
4#define SCREEN_TAG         "screen"
5#define Z80_TAG            "409"
6#define COP420_TAG         "419"
7#define MC6850_TAG         "459"
8#define ADC0809_TAG         "427"
9#define DAC0808_TAG         "461"
10#define Z80CTC_TAG         "458"
11#define FDC_Z80_TAG         "416"
12#define NEC765_TAG         "418"
4#define SCREEN_TAG      "screen"
5#define Z80_TAG         "409"
6#define COP420_TAG      "419"
7#define MC6850_TAG      "459"
8#define ADC0809_TAG      "427"
9#define DAC0808_TAG      "461"
10#define Z80CTC_TAG      "458"
11#define FDC_Z80_TAG      "416"
12#define NEC765_TAG      "418"
13#define CASSETTE1_TAG   "cassette1"
14#define CASSETTE2_TAG   "cassette2"
1315
1416#define NEWBRAIN_EIM_RAM_SIZE         0x10000
1517
r5239r5240
9597   const device_config *mc6850;
9698   const device_config *z80ctc;
9799   const device_config *nec765;
100   const device_config *cassette1;
101   const device_config *cassette2;
98102};
99103
100104/* ---------- defined in video/newbrain.c ---------- */
src/mess/includes/kyocera.h
r5239r5240
22#define __KYOCERA__
33
44#define SCREEN_TAG      "screen"
5
65#define I8085_TAG      "m19"
76#define I8155_TAG      "m25"
87#define UPD1990A_TAG   "m18"
98#define IM6402_TAG      "m22"
109#define MC14412_TAG      "m31"
10#define CASSETTE_TAG   "cassette"
11#define CENTRONICS_TAG   "centronics"
1112
1213//#define I8085_TAG      "m19"
1314//#define I8155_TAG   "m12"
r5239r5240
4849   const device_config *mc14412;
4950   const device_config *centronics;
5051   const device_config *speaker;
52   const device_config *cassette;
5153};
5254
5355typedef struct _tandy200_state tandy200_state;
r5239r5240
7375   const device_config *tcm5089;
7476   const device_config *centronics;
7577   const device_config *speaker;
78   const device_config *cassette;
7679};
7780
7881/* ---------- defined in video/kyocera.c ---------- */
src/mess/includes/comx35.h
r5239r5240
6969
7070   /* timers */
7171   emu_timer *reset_timer;   /* power on reset timer */
72
73   /* devices */
74   const device_config *cassette;
7275};
7376
7477/* ---------- defined in machine/comx35.c ---------- */
src/mess/drivers/vip.c
r5239r5240
233233static QUICKLOAD_LOAD( vip );
234234static MACHINE_RESET( vip );
235235
236/* Cassette Image */
237
238static const device_config *cassette_device_image(running_machine *machine)
239{
240   return devtag_get_device(machine, "cassette");
241}
242
243236/* Sound */
244237
245238static const discrete_555_desc vip_ca555_a =
r5239r5240
495488   if (state->cdp1861_efx) flags -= EF1;
496489
497490   /* tape input */
498   if (cassette_input(cassette_device_image(device->machine)) < 0) flags -= EF2;
499   set_led_status(VIP_LED_TAPE, (cassette_input(cassette_device_image(device->machine)) > 0));
491   if (cassette_input(state->cassette) < 0) flags -= EF2;
492   set_led_status(VIP_LED_TAPE, (cassette_input(state->cassette) > 0));
500493
501494   /* keyboard */
502495   if (input_port_read(device->machine, "KEYPAD") & (1 << state->keylatch)) flags -= EF3;
r5239r5240
530523   set_led_status(VIP_LED_Q, level);
531524
532525   /* tape output */
533   cassette_output(cassette_device_image(device->machine), level ? 1.0 : -1.0);
526   cassette_output(state->cassette, level ? 1.0 : -1.0);
534527}
535528
536529static CDP1802_DMA_WRITE( vip_dma_w )
r5239r5240
577570   UINT16 addr;
578571
579572   /* RAM banking */
580
581573   memory_configure_bank(machine, 1, 0, 2, memory_region(machine, CDP1802_TAG), 0x8000);
582574
583575   /* ROM banking */
584
585576   memory_install_readwrite8_handler(cputag_get_address_space(machine, CDP1802_TAG, ADDRESS_SPACE_PROGRAM), 0x8000, 0x81ff, 0, 0x7e00, SMH_BANK(2), SMH_UNMAP);
586577   memory_configure_bank(machine, 2, 0, 1, memory_region(machine, CDP1802_TAG) + 0x8000, 0);
587578   memory_set_bank(machine, 2, 0);
588579
589580   /* randomize RAM contents */
590
591581   for (addr = 0; addr < mess_ram_size; addr++)
592582   {
593583      ram[addr] = mame_rand(machine) & 0xff;
594584   }
595585
596586   /* allocate color RAM */
597   
598587   state->colorram = auto_alloc_array(machine, UINT8, VP590_COLOR_RAM_SIZE);
599588
600589   /* enable power LED */
601
602590   set_led_status(VIP_LED_POWER, 1);
603591
604592   /* look up devices */
605
606593   state->cdp1861 = devtag_get_device(machine, CDP1861_TAG);
607594   state->cdp1862 = devtag_get_device(machine, CDP1862_TAG);
608595   state->cdp1863 = devtag_get_device(machine, CDP1863_TAG);
596   state->cassette = devtag_get_device(machine, CASSETTE_TAG);
609597
610598   /* register for state saving */
611
612599   state_save_register_global_pointer(machine, state->colorram, VP590_COLOR_RAM_SIZE);
613600
614601   state_save_register_global(machine, state->reset);
src/mess/drivers/mc1000.c
r5239r5240
3131#include "sound/ay8910.h"
3232#include "machine/ctronics.h"
3333
34static const device_config *cassette_device_image(running_machine *machine)
35{
36   return devtag_get_device(machine, CASSETTE_TAG);
37}
38
3934/* Memory Banking */
4035
4136static void mc1000_bankswitch(running_machine *machine)
r5239r5240
308303
309304   state->keylatch = data;
310305
311   cassette_output(cassette_device_image(device->machine), BIT(data, 7) ? +1.0 : -1.0);
306   cassette_output(state->cassette, BIT(data, 7) ? +1.0 : -1.0);
312307}
313308
314309static READ8_DEVICE_HANDLER( keydata_r )
r5239r5240
328323
329324   data &= ((input_port_read(device->machine, "MODIFIERS") & 0xc0) | 0x3f);
330325
331//   data &= (((cassette_input(cassette_device_image(device->machine)) < +0.0) << 7) | 0x7f);
326//   data &= (((cassette_input(state->cassette) < +0.0) << 7) | 0x7f);
332327
333328   return data;
334329}
r5239r5240
352347   /* find devices */
353348   state->mc6845 = devtag_get_device(machine, MC6845_TAG);
354349   state->centronics = devtag_get_device(machine, CENTRONICS_TAG);
350   state->cassette = devtag_get_device(machine, CASSETTE_TAG);
355351
356352   /* allocate video RAM */
357353   state->mc6845_video_ram = auto_alloc_array(machine, UINT8, MC1000_MC6845_VIDEORAM_SIZE);
src/mess/drivers/tmc600.c
r5239r5240
8888#include "sound/cdp1869.h"
8989#include "includes/tmc600.h"
9090
91static const device_config *cassette_device_image(running_machine *machine)
92{
93   return devtag_get_device(machine, "cassette");
94}
95
9691/* Read/Write Handlers */
9792
9893static WRITE8_HANDLER( keyboard_latch_w )
r5239r5240
113108
114109static ADDRESS_MAP_START( tmc600_io_map, ADDRESS_SPACE_IO, 8 )
115110   AM_RANGE(0x03, 0x03) AM_WRITE(keyboard_latch_w)
116   AM_RANGE(0x04, 0x04) AM_DEVWRITE("centronics", centronics_data_w)
111   AM_RANGE(0x04, 0x04) AM_DEVWRITE(CENTRONICS_TAG, centronics_data_w)
117112   AM_RANGE(0x05, 0x05) AM_DEVWRITE(CDP1869_TAG, tmc600_vismac_data_w)
118113//  AM_RANGE(0x06, 0x06) AM_WRITE(floppy_w)
119114   AM_RANGE(0x07, 0x07) AM_WRITE(tmc600_vismac_register_w)
r5239r5240
242237
243238   // tape in
244239
245   if (cassette_input(cassette_device_image(device->machine)) < +0.0) flags -= EF2;
240   if (cassette_input(state->cassette) < +0.0) flags -= EF2;
246241
247242   // keyboard
248243
r5239r5240
253248
254249static CDP1802_Q_WRITE( tmc600_q_w )
255250{
256   cassette_output(cassette_device_image(device->machine), level ? +1.0 : -1.0);
251   tmc600_state *state = device->machine->driver_data;
252
253   cassette_output(state->cassette, level ? +1.0 : -1.0);
257254}
258255
259256static CDP1802_INTERFACE( tmc600_cdp1802_config )
r5239r5240
273270   tmc600_state *state = machine->driver_data;
274271   const address_space *program = cputag_get_address_space(machine, CDP1802_TAG, ADDRESS_SPACE_PROGRAM);
275272
276   /* configure RAM */
273   /* find devices */
274   state->cassette = devtag_get_device(machine, CASSETTE_TAG);
277275
276   /* configure RAM */
278277   memory_configure_bank(machine, 1, 0, 1, mess_ram, 0);
279278   memory_set_bank(machine, 1, 0);
280279
r5239r5240
296295   }
297296
298297   /* register for state saving */
299
300298   state_save_register_global(machine, state->keylatch);
301299}
302300
r5239r5240
332330   MDRV_IMPORT_FROM(tmc600_video)
333331
334332   /* printer */
335   MDRV_CENTRONICS_ADD("centronics", standard_centronics)
333   MDRV_CENTRONICS_ADD(CENTRONICS_TAG, standard_centronics)
336334
337335   /* cassette */
338   MDRV_CASSETTE_ADD( "cassette", tmc600_cassette_config )
336   MDRV_CASSETTE_ADD(CASSETTE_TAG, tmc600_cassette_config)
339337MACHINE_DRIVER_END
340338
341339/* ROMs */
src/mess/drivers/abc80.c
r5239r5240
9191#include "devices/cassette.h"
9292#include "devices/printer.h"
9393
94static const device_config *cassette_device_image(running_machine *machine)
95{
96   return devtag_get_device(machine, "cassette");
97}
98
9994/* Read/Write Handlers */
10095
10196static WRITE8_HANDLER( abc80_sound_w )
r5239r5240
416411
417412   */
418413
414   abc80_state *state = device->machine->driver_data;
415
419416   /* cassette data */
420   UINT8 data = (cassette_input(cassette_device_image(device->machine)) > +1.0) ? 0x80 : 0;
417   UINT8 data = (cassette_input(state->cassette) > +1.0) ? 0x80 : 0;
421418
422419   return data;
423420};
r5239r5240
439436
440437   */
441438
439   abc80_state *state = device->machine->driver_data;
440
442441   /* cassette motor */
443   cassette_change_state(cassette_device_image(device->machine), BIT(data, 5) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR);
442   cassette_change_state(state->cassette, BIT(data, 5) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR);
444443
445444   /* cassette data */
446   cassette_output(cassette_device_image(device->machine), BIT(data, 6) ? -1.0 : +1.0);
445   cassette_output(state->cassette, BIT(data, 6) ? -1.0 : +1.0);
447446};
448447
449448static const z80pio_interface abc80_pio_intf =
r5239r5240
478477   abc80_state *state = machine->driver_data;
479478
480479   /* configure RAM expansion */
481
482480   memory_configure_bank(machine, 1, 0, 1, mess_ram, 0);
483481   memory_set_bank(machine, 1, 0);
484482
r5239r5240
494492   }
495493
496494   /* find devices */
497
498495   state->z80pio = devtag_get_device(machine, Z80PIO_TAG);
496   state->cassette = devtag_get_device(machine, CASSETTE_TAG);
499497
500498   /* initialize the ABC BUS */
501
502499   abcbus_init(machine, Z80_TAG, abcbus_config);
503500
504501   /* register for state saving */
505
506502   state_save_register_global(machine, state->key_data);
507503   state_save_register_global(machine, state->key_strobe);
508504   state_save_register_global(machine, state->z80pio_astb);
src/mess/drivers/sg1000.c
r5239r5240
7878#include "sound/sn76496.h"
7979#include "video/tms9928a.h"
8080
81static const device_config *cassette_device_image(running_machine *machine)
82{
83   return devtag_get_device(machine, "cassette");
84}
85
8681/* Terebi Oekaki (TV Draw) */
8782
8883/*
r5239r5240
536531   data |= 0x60;
537532
538533   /* tape input */
539   if (cassette_input(cassette_device_image(device->machine)) > +0.0) data |= 0x80;
534   if (cassette_input(state->cassette) > +0.0) data |= 0x80;
540535
541536   return data;
542537}
r5239r5240
562557   state->keylatch = data & 0x07;
563558
564559   /* cassette */
565   cassette_output(cassette_device_image(device->machine), BIT(data, 4) ? +1.0 : -1.0);
560   cassette_output(state->cassette, BIT(data, 4) ? +1.0 : -1.0);
566561
567562   /* printer */
568563}
r5239r5240
581576{
582577   sg1000_state *state = machine->driver_data;
583578
579   /* find devices */
580   state->cassette = devtag_get_device(machine, CASSETTE_TAG);
581
584582   /* configure VDP */
585583   TMS9928A_configure(&tms9928a_interface);
586584
r5239r5240
609607        PA7
610608    */
611609
612   const device_config *printer = devtag_get_device(device->machine, "centronics");
610   const device_config *printer = devtag_get_device(device->machine, CENTRONICS_TAG);
613611   sg1000_state *state = device->machine->driver_data;
614612   UINT8 result = 0;
615613
r5239r5240
623621static WRITE8_DEVICE_HANDLER( sf7000_ppi8255_c_w )
624622{
625623   const device_config *fdc = devtag_get_device(device->machine, NEC765_TAG);
626   const device_config *printer = devtag_get_device(device->machine, "centronics");
624   const device_config *printer = devtag_get_device(device->machine, CENTRONICS_TAG);
627625   /*
628626        Signal  Description
629627
r5239r5240
672670      DEVCB_NULL,                        // Port B read
673671      DEVCB_NULL,                        // Port C read
674672      DEVCB_NULL,                        // Port A write
675      DEVCB_DEVICE_HANDLER("centronics", centronics_data_w),   // Port B write
673      DEVCB_DEVICE_HANDLER(CENTRONICS_TAG, centronics_data_w),   // Port B write
676674      DEVCB_HANDLER(sf7000_ppi8255_c_w)      // Port C write
677675   }
678676};
679677
680/* callback for /INT output from FDC */
681678static NEC765_INTERRUPT( sf7000_fdc_interrupt )
682679{
683   sg1000_state *driver_state = device->machine->driver_data; // TODO
680   sg1000_state *driver_state = device->machine->driver_data;
684681
685682   driver_state->fdc_irq = state;
686683}
r5239r5240
705702{
706703   sg1000_state *state = machine->driver_data;
707704
705   /* find devices */
706   state->cassette = devtag_get_device(machine, CASSETTE_TAG);
707
708708   /* configure VDP */
709709   TMS9928A_configure(&tms9928a_interface);
710710
r5239r5240
897897   MDRV_PRINTER_ADD("sp400") /* serial printer */
898898
899899   /* cassette */
900   MDRV_CASSETTE_ADD( "cassette", sc3000_cassette_config )
900   MDRV_CASSETTE_ADD(CASSETTE_TAG, sc3000_cassette_config)
901901
902902   /* cartridge */
903903   MDRV_CARTSLOT_ADD("cart")
r5239r5240
933933   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
934934
935935   /* printer */
936   MDRV_CENTRONICS_ADD("centronics", standard_centronics)
936   MDRV_CENTRONICS_ADD(CENTRONICS_TAG, standard_centronics)
937937   MDRV_PRINTER_ADD("sp400") /* serial printer */
938938
939939   /* cassette */
940   MDRV_CASSETTE_ADD("cassette", sc3000_cassette_config)
940   MDRV_CASSETTE_ADD(CASSETTE_TAG, sc3000_cassette_config)
941941
942942   /* uart */
943943   MDRV_MSM8251_ADD("uart", default_msm8251_interface)
src/mess/drivers/osi.c
r5239r5240
186186#include "devices/basicdsk.h"
187187#include "devices/cassette.h"
188188
189static const device_config *cassette_device_image(running_machine *machine)
190{
191   return devtag_get_device(machine, "cassette");
192}
193
194189/* Sound */
195190
196191static const discrete_dac_r1_ladder osi600_dac =
r5239r5240
618613
619614static READ_LINE_DEVICE_HANDLER( cassette_rx )
620615{
621   const device_config *cassette = cassette_device_image(device->machine);
616   osi_state *driver_state = device->machine->driver_data;
622617
623   return (cassette_input(cassette) > 0.0) ? 1 : 0;
618   return (cassette_input(driver_state->cassette) > 0.0) ? 1 : 0;
624619}
625620
626621static WRITE_LINE_DEVICE_HANDLER( cassette_tx )
627622{
628   const device_config *cassette = cassette_device_image(device->machine);
623   osi_state *driver_state = device->machine->driver_data;
629624
630   cassette_output(cassette, state ? +1.0 : -1.0);
625   cassette_output(driver_state->cassette, state ? +1.0 : -1.0);
631626}
632627
633628static ACIA6850_INTERFACE( osi600_acia_intf )
r5239r5240
672667
673668   const address_space *program = cputag_get_address_space(machine, M6502_TAG, ADDRESS_SPACE_PROGRAM);
674669
670   /* find devices */
671   state->cassette = devtag_get_device(machine, CASSETTE_TAG);
672
675673   /* configure RAM banking */
676674   memory_configure_bank(machine, 1, 0, 1, memory_region(machine, M6502_TAG), 0);
677675   memory_set_bank(machine, 1, 0);
src/mess/drivers/abc80x.c
r5239r5240
8686
8787static const device_config *cassette_device_image(running_machine *machine)
8888{
89   return devtag_get_device(machine, "cassette");
89   return devtag_get_device(machine, CASSETTE_TAG);
9090}
9191
9292/* Discrete Sound */
r5239r5240
10431043   state->z80dart = devtag_get_device(machine, Z80DART_TAG);
10441044   state->z80sio = devtag_get_device(machine, Z80SIO_TAG);
10451045   //state->abc77 = devtag_get_device(machine, ABC77_TAG);
1046   state->cassette = devtag_get_device(machine, CASSETTE_TAG);
10461047
10471048   /* initialize the ABC BUS */
10481049
r5239r5240
10781079   state->z80dart = devtag_get_device(machine, Z80DART_TAG);
10791080   state->z80sio = devtag_get_device(machine, Z80SIO_TAG);
10801081//   state->abc77 = devtag_get_device(machine, ABC77_TAG);
1082   state->cassette = devtag_get_device(machine, CASSETTE_TAG);
10811083
10821084   /* initialize the ABC BUS */
10831085
r5239r5240
11321134   state->z80sio = devtag_get_device(machine, Z80SIO_TAG);
11331135   state->e0516 = devtag_get_device(machine, E0516_TAG);
11341136   //state->abc77 = devtag_get_device(machine, ABC77_TAG);
1137   state->cassette = devtag_get_device(machine, CASSETTE_TAG);
11351138
11361139   /* initialize the ABC BUS */
11371140
src/mess/drivers/tmc1800.c
r5239r5240
136136static MACHINE_RESET( tmc2000 );
137137static MACHINE_RESET( oscnano );
138138
139static const device_config *cassette_device_image(running_machine *machine)
140{
141   return devtag_get_device(machine, "cassette");
142}
143
144139/* Read/Write Handlers */
145140
146141static WRITE8_HANDLER( tmc1800_keylatch_w )
r5239r5240
482477   if (state->cdp1861_efx) flags -= EF1;
483478
484479   /* tape input */
485   if (cassette_input(cassette_device_image(device->machine)) < 0) flags -= EF2;
480   if (cassette_input(state->cassette) < 0) flags -= EF2;
486481
487482   /* keyboard */
488483   if (~input_port_read(device->machine, keynames[state->keylatch / 8]) & (1 << (state->keylatch % 8))) flags -= EF3;
r5239r5240
492487
493488static CDP1802_Q_WRITE( tmc1800_q_w )
494489{
490   tmc1800_state *state = device->machine->driver_data;
491
495492   /* tape output */
496   cassette_output(cassette_device_image(device->machine), level ? 1.0 : -1.0);
493   cassette_output(state->cassette, level ? 1.0 : -1.0);
497494}
498495
499496static CDP1802_DMA_WRITE( tmc1800_dma_w )
r5239r5240
567564   if (state->cdp1864_efx) flags -= EF1;
568565
569566   /* tape input */
570   if (cassette_input(cassette_device_image(device->machine)) < 0) flags -= EF2;
567   if (cassette_input(state->cassette) < 0) flags -= EF2;
571568
572569   /* keyboard */
573570   if (~input_port_read(device->machine, keynames[state->keylatch / 8]) & (1 << (state->keylatch % 8))) flags -= EF3;
r5239r5240
586583   set_led_status(1, level);
587584
588585   /* tape output */
589   cassette_output(cassette_device_image(device->machine), level ? 1.0 : -1.0);
586   cassette_output(state->cassette, level ? 1.0 : -1.0);
590587}
591588
592589static CDP1802_DMA_WRITE( tmc2000_dma_w )
r5239r5240
680677   if (state->cdp1864_efx) flags -= EF1;
681678
682679   /* tape input */
683   if (cassette_input(cassette_device_image(device->machine)) < 0) flags -= EF2;
680   if (cassette_input(state->cassette) < 0) flags -= EF2;
684681
685682   /* keyboard */
686683   if (~input_port_read(device->machine, keynames[state->keylatch / 8]) & (1 << (state->keylatch % 8))) flags -= EF3;
r5239r5240
702699   set_led_status(1, level);
703700
704701   /* tape output */
705   cassette_output(cassette_device_image(device->machine), level ? 1.0 : -1.0);
702   cassette_output(state->cassette, level ? 1.0 : -1.0);
706703}
707704
708705static CDP1802_DMA_WRITE( oscnano_dma_w )
r5239r5240
731728   tmc1800_state *state = machine->driver_data;
732729
733730   /* find devices */
734
735731   state->cdp1861 = devtag_get_device(machine, CDP1861_TAG);
732   state->cassette = devtag_get_device(machine, CASSETTE_TAG);
736733
737734   /* register for state saving */
738
739735   state_save_register_global(machine, state->cdp1861_efx);
740736   state_save_register_global(machine, state->keylatch);
741737   state_save_register_global(machine, state->reset);
r5239r5240
746742   tmc1800_state *state = machine->driver_data;
747743
748744   /* reset CDP1864 */
749
750745   device_reset(state->cdp1861);
751746}
752747
r5239r5240
756751{
757752   osc1000b_state *state = machine->driver_data;
758753
759   /* register for state saving */
754   /* find devices */
755   state->cassette = devtag_get_device(machine, CASSETTE_TAG);
760756
757   /* register for state saving */
761758   state_save_register_global(machine, state->keylatch);
762759   state_save_register_global(machine, state->reset);
763760}
r5239r5240
775772   UINT16 addr;
776773
777774   /* RAM banking */
778
779775   memory_configure_bank(machine, 1, 0, 2, memory_region(machine, CDP1802_TAG), 0x8000);
780776
781777   /* ROM/colorram banking */
782
783778   state->colorram = auto_alloc_array(machine, UINT8, TMC2000_COLORRAM_SIZE);
784779
785780   memory_configure_bank(machine, 2, TMC2000_BANK_MONITOR, 1, memory_region(machine, CDP1802_TAG) + 0x8000, 0);
786781   memory_configure_bank(machine, 2, TMC2000_BANK_COLORRAM, 1, state->colorram, 0);
787782
788783   /* randomize color RAM contents */
789
790784   for (addr = 0; addr < TMC2000_COLORRAM_SIZE; addr++)
791785   {
792786      state->colorram[addr] = mame_rand(machine) & 0xff;
793787   }
794788
795789   /* find devices */
796
797790   state->cdp1864 = devtag_get_device(machine, CDP1864_TAG);
791   state->cassette = devtag_get_device(machine, CASSETTE_TAG);
798792
799793   /* register for state saving */
800
801794   state_save_register_global_pointer(machine, state->colorram, TMC2000_COLORRAM_SIZE);
802795   state_save_register_global(machine, state->cdp1864_efx);
803796   state_save_register_global(machine, state->keylatch);
r5239r5240
809802   tmc2000_state *state = machine->driver_data;
810803
811804   /* reset CDP1864 */
812
813805   device_reset(state->cdp1864);
814806
815807   /* enable monitor mirror at 0x0000 */
816
817808   memory_set_bank(machine, 1, TMC2000_BANK_ROM);
818
819809   memory_install_readwrite8_handler(cputag_get_address_space(machine, CDP1802_TAG, ADDRESS_SPACE_PROGRAM), 0x0000, 0x01ff, 0, 0x7e00, SMH_BANK(1), SMH_UNMAP);
820810
821811   /* enable monitor */
822
823812   memory_set_bank(machine, 2, TMC2000_BANK_MONITOR);
824
825813   memory_install_readwrite8_handler(cputag_get_address_space(machine, CDP1802_TAG, ADDRESS_SPACE_PROGRAM), 0x8000, 0x81ff, 0, 0x7e00, SMH_BANK(2), SMH_UNMAP);
826814}
827815
r5239r5240
832820   oscnano_state *state = machine->driver_data;
833821
834822   /* RAM/ROM banking */
835
836823   memory_configure_bank(machine, 1, 0, 2, memory_region(machine, CDP1802_TAG), 0x8000);
837824
838825   /* allocate monitor timer */
839   
840826   state->ef4_timer = timer_alloc(machine, oscnano_ef4_tick, NULL);
841827
842828   /* initialize variables */
843   
844829   state->monitor_ef4 = 1;
845830
846831   /* find devices */
847
848832   state->cdp1864 = devtag_get_device(machine, CDP1864_TAG);
833   state->cassette = devtag_get_device(machine, CASSETTE_TAG);
849834
850835   /* register for state saving */
851
852836   state_save_register_global(machine, state->monitor_ef4);
853837   state_save_register_global(machine, state->cdp1864_efx);
854838   state_save_register_global(machine, state->keylatch);
r5239r5240
860844   oscnano_state *state = machine->driver_data;
861845
862846   /* reset CDP1864 */
863
864847   device_reset(state->cdp1864);
865848
866849   /* enable ROM */
867
868850   memory_set_bank(machine, 1, OSCNANO_BANK_ROM);
869
870851   memory_install_readwrite8_handler(cputag_get_address_space(machine, CDP1802_TAG, ADDRESS_SPACE_PROGRAM), 0x0000, 0x01ff, 0, 0x7e00, SMH_BANK(1), SMH_BANK(1));
871852}
872853
src/mess/drivers/crvision.c
r5239r5240
4141#include "sound/wave.h"
4242#include "video/tms9928a.h"
4343
44static const device_config *cassette_device_image(running_machine *machine)
45{
46   return devtag_get_device(machine, "cassette");
47}
48
4944/* Read/Write Handlers */
5045
5146static READ8_DEVICE_HANDLER( centronics_status_r )
r5239r5240
8681   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK(BANK_ROM2)
8782   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK(BANK_ROM1)
8883//   AM_RANGE(0xc000, 0xe7ff) AM_RAMBANK(3)
89   AM_RANGE(0xe800, 0xe800) AM_DEVWRITE("centronics", centronics_data_w)
90   AM_RANGE(0xe801, 0xe801) AM_DEVREADWRITE("centronics", centronics_status_r, centronics_ctrl_w)
84   AM_RANGE(0xe800, 0xe800) AM_DEVWRITE(CENTRONICS_TAG, centronics_data_w)
85   AM_RANGE(0xe801, 0xe801) AM_DEVREADWRITE(CENTRONICS_TAG, centronics_status_r, centronics_ctrl_w)
9186//   AM_RANGE(0xf000, 0xf7ff) AM_RAMBANK(4)
9287   AM_RANGE(0xf800, 0xffff) AM_ROM
9388ADDRESS_MAP_END
r5239r5240
313308   state->keylatch = ~data & 0x0f;
314309
315310   /* cassette motor */
316   cassette_change_state(cassette_device_image(device->machine), BIT(data, 6) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
311   cassette_change_state(state->cassette, BIT(data, 6) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
317312
318313   /* cassette data output */
319   cassette_output(cassette_device_image(device->machine), BIT(data, 7) ? +1.0 : -1.0);
314   cassette_output(state->cassette, BIT(data, 7) ? +1.0 : -1.0);
320315}
321316
322317static UINT8 read_keyboard(running_machine *machine, int pa)
r5239r5240
360355        PA7     Cassette data in/out
361356    */
362357
358   crvision_state *state = device->machine->driver_data;
359
363360   UINT8 data = 0x7f;
364361
365   if (cassette_input(cassette_device_image(device->machine)) > -0.1469) data |= 0x80;
362   if (cassette_input(state->cassette) > -0.1469) data |= 0x80;
366363
367364   return data;
368365}
r5239r5240
452449
453450   /* find devices */
454451   state->sn76489 = devtag_get_device(machine, SN76489_TAG);
452   state->cassette = devtag_get_device(machine, CASSETTE_TAG);
455453
456454   /* register for state saving */
457455   state_save_register_global(machine, state->keylatch);
r5239r5240
560558   MDRV_SOUND_ADD(SN76489_TAG, SN76489, XTAL_2MHz)
561559   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
562560
563   MDRV_SOUND_WAVE_ADD("wave", "cassette")
561   MDRV_SOUND_WAVE_ADD("wave", CASSETTE_TAG)
564562   MDRV_SOUND_ROUTE(1, "mono", 0.25)
565563
566564   /* peripheral hardware */
r5239r5240
573571   MDRV_CARTSLOT_LOAD(crvision_cart)
574572
575573   /* cassette */
576   MDRV_CASSETTE_ADD("cassette", crvision_cassette_config)
574   MDRV_CASSETTE_ADD(CASSETTE_TAG, crvision_cassette_config)
577575MACHINE_DRIVER_END
578576
579577static MACHINE_DRIVER_START( ntsc )
r5239r5240
607605   MDRV_CPU_PROGRAM_MAP(wizzard_map)
608606
609607   /* printer */
610   MDRV_CENTRONICS_ADD("centronics", standard_centronics)
608   MDRV_CENTRONICS_ADD(CENTRONICS_TAG, standard_centronics)
611609MACHINE_DRIVER_END
612610
613611/* ROMs */
src/mess/drivers/newbrain.c
r5239r5240
5959
6060*/
6161
62static const device_config *cassette_device_image(running_machine *machine, int index)
63{
64   if ( index )
65      return devtag_get_device(machine, "cassette2");
66   else
67      return devtag_get_device(machine, "cassette1");
68}
69
7062static void check_interrupt(running_machine *machine)
7163{
7264   newbrain_state *state = machine->driver_data;
r5239r5240
471463
472464   /* tape motor enable */
473465
474   cassette_change_state(cassette_device_image(space->machine, 0), BIT(data, 1) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
475   cassette_change_state(cassette_device_image(space->machine, 1), BIT(data, 3) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
466   cassette_change_state(state->cassette1, BIT(data, 1) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
467   cassette_change_state(state->cassette2, BIT(data, 3) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
476468}
477469
478470static READ8_HANDLER( newbrain_cop_g_r )
r5239r5240
522514
523515   state->cop_tdo = BIT(data, 1);
524516
525   cassette_output(cassette_device_image(space->machine, 0), state->cop_tdo ? -1.0 : +1.0);
526   cassette_output(cassette_device_image(space->machine, 1), state->cop_tdo ? -1.0 : +1.0);
517   cassette_output(state->cassette1, state->cop_tdo ? -1.0 : +1.0);
518   cassette_output(state->cassette2, state->cop_tdo ? -1.0 : +1.0);
527519
528520   /* keyboard and display clock */
529521
r5239r5240
585577
586578   newbrain_state *state = space->machine->driver_data;
587579
588   state->cop_tdi = ((cassette_input(cassette_device_image(space->machine, 0)) > +1.0) || (cassette_input(cassette_device_image(space->machine, 1)) > +1.0)) ^ state->cop_tdo;
580   state->cop_tdi = ((cassette_input(state->cassette1) > +1.0) || (cassette_input(state->cassette2) > +1.0)) ^ state->cop_tdo;
589581
590582   return state->cop_tdi;
591583}
r5239r5240
13811373{
13821374   newbrain_state *state = machine->driver_data;
13831375   
1376   /* find devices */
1377   state->cassette1 = devtag_get_device(machine, CASSETTE1_TAG);
1378   state->cassette2 = devtag_get_device(machine, CASSETTE2_TAG);
1379
13841380   /* allocate reset timer */
13851381   state->reset_timer = timer_alloc(machine, reset_tick, NULL);
13861382   timer_adjust_oneshot(state->reset_timer, ATTOTIME_IN_USEC(get_reset_t()), 0);
src/mess/drivers/kyocera.c
r5239r5240
8383
8484static const device_config *cassette_device_image(running_machine *machine)
8585{
86   return devtag_get_device(machine, "cassette");
86   return devtag_get_device(machine, CASSETTE_TAG);
8787}
8888
8989/* Read/Write Handlers */
r5239r5240
210210   kc85_state *state = space->machine->driver_data;
211211   
212212   /* cassette motor */
213   cassette_change_state(cassette_device_image(space->machine), BIT(data, 3) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR);
213   cassette_change_state(state->cassette, BIT(data, 3) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR);
214214
215215   /* RTC strobe */
216216   upd1990a_stb_w(state->upd1990a, BIT(data, 4));
r5239r5240
371371   upd1990a_stb_w(state->upd1990a, BIT(data, 2));
372372
373373   /* cassette motor */
374   cassette_change_state(cassette_device_image(space->machine), BIT(data, 3) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR);
374   cassette_change_state(state->cassette, BIT(data, 3) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR);
375375}
376376
377377static UINT8 read_keyboard(running_machine *machine, UINT16 keylatch)
r5239r5240
469469   centronics_strobe_w(state->centronics, BIT(data, 0));
470470
471471   /* cassette motor */
472   cassette_change_state(cassette_device_image(space->machine), BIT(data, 1) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR);
472   cassette_change_state(state->cassette, BIT(data, 1) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR);
473473}
474474
475475/* Memory Maps */
r5239r5240
11191119
11201120   /* find devices */
11211121   state->upd1990a = devtag_get_device(machine, UPD1990A_TAG);
1122   state->centronics = devtag_get_device(machine, "centronics");
1122   state->centronics = devtag_get_device(machine, CENTRONICS_TAG);
11231123   state->speaker = devtag_get_device(machine, "speaker");
1124   state->cassette = devtag_get_device(machine, CASSETTE_TAG);
11241125
11251126   /* initialize RTC */
11261127   upd1990a_cs_w(state->upd1990a, 1);
r5239r5240
11621163
11631164   /* find devices */
11641165   state->upd1990a = devtag_get_device(machine, UPD1990A_TAG);
1165   state->centronics = devtag_get_device(machine, "centronics");
1166   state->centronics = devtag_get_device(machine, CENTRONICS_TAG);
11661167   state->speaker = devtag_get_device(machine, "speaker");
1168   state->cassette = devtag_get_device(machine, CASSETTE_TAG);
11671169
11681170   /* initialize RTC */
11691171   upd1990a_cs_w(state->upd1990a, 1);
r5239r5240
11991201   
12001202   /* find devices */
12011203   state->upd1990a = devtag_get_device(machine, UPD1990A_TAG);
1202   state->centronics = devtag_get_device(machine, "centronics");
1204   state->centronics = devtag_get_device(machine, CENTRONICS_TAG);
12031205   state->speaker = devtag_get_device(machine, "speaker");
1206   state->cassette = devtag_get_device(machine, CASSETTE_TAG);
12041207
12051208   /* initialize RTC */
12061209   upd1990a_cs_w(state->upd1990a, 1);
r5239r5240
12511254   tandy200_state *state = machine->driver_data;
12521255
12531256   /* find devices */
1254   state->centronics = devtag_get_device(machine, "centronics");
1257   state->centronics = devtag_get_device(machine, CENTRONICS_TAG);
12551258   state->speaker = devtag_get_device(machine, "speaker");
1259   state->cassette = devtag_get_device(machine, CASSETTE_TAG);
12561260
12571261   /* configure ROM banking */
12581262   memory_configure_bank(machine, 1, 0, 1, memory_region(machine, I8085_TAG), 0);
r5239r5240
13301334   MDRV_UPD1990A_ADD(UPD1990A_TAG, XTAL_32_768kHz, kc85_upd1990a_intf)
13311335
13321336   /* printer */
1333   MDRV_CENTRONICS_ADD("centronics", standard_centronics)
1337   MDRV_CENTRONICS_ADD(CENTRONICS_TAG, standard_centronics)
13341338
13351339   /* cassette */
13361340   MDRV_CASSETTE_ADD("cassette", kc85_cassette_config)
r5239r5240
13651369   MDRV_UPD1990A_ADD(UPD1990A_TAG, XTAL_32_768kHz, kc85_upd1990a_intf)
13661370
13671371   /* printer */
1368   MDRV_CENTRONICS_ADD("centronics", standard_centronics)
1372   MDRV_CENTRONICS_ADD(CENTRONICS_TAG, standard_centronics)
13691373
13701374   /* cassette */
13711375   MDRV_CASSETTE_ADD("cassette", kc85_cassette_config)
r5239r5240
14191423//   MDRV_MC14412_ADD(MC14412_TAG, XTAL_1MHz)
14201424
14211425   /* printer */
1422   MDRV_CENTRONICS_ADD("centronics", standard_centronics)
1426   MDRV_CENTRONICS_ADD(CENTRONICS_TAG, standard_centronics)
14231427
14241428   /* cassette */
14251429   MDRV_CASSETTE_ADD("cassette", kc85_cassette_config)
src/mess/drivers/comx35.c
r5239r5240
2323#include "machine/wd17xx.h"
2424#include "video/mc6845.h"
2525
26static const device_config *cassette_device_image(running_machine *machine)
27{
28   return devtag_get_device(machine, CASSETTE_TAG);
29}
30
3126/* Memory Maps */
3227
3328static ADDRESS_MAP_START( comx35_map, ADDRESS_SPACE_PROGRAM, 8 )
r5239r5240
241236   if (!state->cdp1871_efxa) flags -= EF3;
242237
243238   // cassette input, expansion device flag
244   if ((cassette_input(cassette_device_image(device->machine)) < +0.0) || !state->cdp1802_ef4) flags -= EF4;
239   if ((cassette_input(state->cassette) < +0.0) || !state->cdp1802_ef4) flags -= EF4;
245240
246241   return flags;
247242}
r5239r5240
298293   }
299294
300295   // cassette output
301   cassette_output(cassette_device_image(device->machine), level ? +1.0 : -1.0);
296   cassette_output(state->cassette, level ? +1.0 : -1.0);
302297}
303298
304299static CDP1802_INTERFACE( comx35_cdp1802_config )
src/mess/drivers/lc80.c
r5239r5240
2828#include "sound/speaker.h"
2929#include "lc80.lh"
3030
31static const device_config *cassette_device_image(running_machine *machine)
32{
33   return devtag_get_device(machine, CASSETTE_TAG);
34}
35
3631/* Memory Maps */
3732
3833static ADDRESS_MAP_START( lc80_mem, ADDRESS_SPACE_PROGRAM, 8 )
r5239r5240
187182
188183   */
189184
190   return (cassette_input(cassette_device_image(device->machine)) < +0.0);
185   lc80_state *state = device->machine->driver_data;
186
187   return (cassette_input(state->cassette) < +0.0);
191188}
192189
193190static WRITE8_DEVICE_HANDLER( pio1_port_b_w )
r5239r5240
210207   lc80_state *state = device->machine->driver_data;
211208
212209   /* tape output */
213   cassette_output(cassette_device_image(device->machine), BIT(data, 1) ? +1.0 : -1.0);
210   cassette_output(state->cassette, BIT(data, 1) ? +1.0 : -1.0);
214211
215212   /* speaker */
216213   speaker_level_w(state->speaker, !BIT(data, 1));
r5239r5240
302299   /* find devices */
303300   state->z80pio2 = devtag_get_device(machine, Z80PIO2_TAG);
304301   state->speaker = devtag_get_device(machine, SPEAKER_TAG);
302   state->cassette = devtag_get_device(machine, CASSETTE_TAG);
305303
306304   /* setup memory banking */
307305   memory_configure_bank(machine, 1, 0, 1, memory_region(machine, Z80_TAG), 0); // TODO
src/mess/drivers/c80.c
r5239r5240
1414#include "devices/cassette.h"
1515#include "c80.lh"
1616
17static const device_config *cassette_device_image(running_machine *machine)
18{
19   return devtag_get_device(machine, CASSETTE_TAG);
20}
21
2217/* Memory Maps */
2318
2419static ADDRESS_MAP_START( c80_mem, ADDRESS_SPACE_PROGRAM, 8 )
r5239r5240
116111      }
117112   }
118113
119   data |= (cassette_input(cassette_device_image(device->machine)) < +0.0) << 7;
114   data |= (cassette_input(state->cassette) < +0.0) << 7;
120115
121116   return data;
122117}
r5239r5240
147142      state->digit = 0;
148143   }
149144
150   cassette_output(cassette_device_image(device->machine), BIT(data, 6) ? +1.0 : -1.0);
145   cassette_output(state->cassette, BIT(data, 6) ? +1.0 : -1.0);
151146}
152147
153148static WRITE8_DEVICE_HANDLER( pio1_port_b_w )
r5239r5240
232227{
233228   c80_state *state = machine->driver_data;
234229
230   /* find devices */
231   state->cassette = devtag_get_device(machine, CASSETTE_TAG);
232
235233   /* register for state saving */
236234   state_save_register_global(machine, state->keylatch);
237235   state_save_register_global(machine, state->digit);
src/mess/drivers/tmc2000e.c
r5239r5240
3939#include "sound/beep.h"
4040#include "machine/rescap.h"
4141
42static const device_config *cassette_device_image(running_machine *machine)
43{
44   return devtag_get_device(machine, "cassette");
45}
46
4742/* Read/Write Handlers */
4843
4944static READ8_HANDLER( vismac_r )
r5239r5240
194189
195190   // tape in
196191
197   if (cassette_input(cassette_device_image(device->machine)) > +1.0) flags -= EF2;
192   if (cassette_input(state->cassette) > +1.0) flags -= EF2;
198193   
199194   // keyboard
200195
r5239r5240
217212
218213   // tape out
219214
220   cassette_output(cassette_device_image(device->machine), level ? -1.0 : +1.0);
215   cassette_output(state->cassette, level ? -1.0 : +1.0);
221216
222217   // floppy control (FDC-6)
223218}
r5239r5240
252247   tmc2000e_state *state = machine->driver_data;
253248
254249   /* allocate color RAM */
255
256250   state->colorram = auto_alloc_array(machine, UINT8, TMC2000E_COLORRAM_SIZE);
257251
258252   /* find devices */
259
260253   state->cdp1864 = devtag_get_device(machine, CDP1864_TAG);
254   state->cassette = devtag_get_device(machine, CASSETTE_TAG);
261255
262256   /* register for state saving */
263
264257   state_save_register_global_pointer(machine, state->colorram, TMC2000E_COLORRAM_SIZE);
265258   state_save_register_global(machine, state->cdp1864_efx);
266259   state_save_register_global(machine, state->keylatch);

Previous 15994 Revisions Next


© 1998-2018 The MESS Team