Previous 15994 Revisions Next

r3655 Thursday 27th November, 2008 at 16:16:47 UTC by Curt Coder
Fixed and enabled a bunch of drivers.
[src/mess]mess.mak messdriv.c
[src/mess/audio]cdp1863.c
[src/mess/drivers]bw2.c comx35.c comxpl80.c newbrain.c ql.c studio2.c tmc1800.c tmc2000e.c tmc600.c vip.c
[src/mess/includes]ql.h* tmc1800.h tmc2000e.h*
[src/mess/machine]adc080x.c cdp1871.c comx35.c zx8302.c
[src/mess/video]cdp1861.c cdp1862.c tmc1800.c tmc600.c zx8301.c

src/mess/audio/cdp1863.c
r3654r3655
132132static DEVICE_START( cdp1863 )
133133{
134134   cdp1863_t *cdp1863 = get_safe_token(device);
135   char unique_tag[30];
136135
137136   /* validate arguments */
138137   assert(device != NULL);
r3654r3655
147146   cdp1863->oe = 1;
148147
149148   /* register for state saving */
150   state_save_combine_module_and_tag(unique_tag, "CDP1863", device->tag);
149   state_save_register_item("cdp1863", device->tag, 0, cdp1863->oe);
150   state_save_register_item("cdp1863", device->tag, 0, cdp1863->latch);
151   state_save_register_item("cdp1863", device->tag, 0, cdp1863->signal);
152   state_save_register_item("cdp1863", device->tag, 0, cdp1863->incr);
151153
152   state_save_register_item(unique_tag, 0, cdp1863->oe);
153   state_save_register_item(unique_tag, 0, cdp1863->latch);
154   state_save_register_item(unique_tag, 0, cdp1863->signal);
155   state_save_register_item(unique_tag, 0, cdp1863->incr);
156
157154   return DEVICE_START_OK;
158155}
159156
src/mess/video/cdp1862.c
r3654r3655
127127static DEVICE_START( cdp1862 )
128128{
129129   cdp1862_t *cdp1862 = get_safe_token(device);
130   char unique_tag[30];
131130
132131   /* validate arguments */
133132   assert(device != NULL);
r3654r3655
150149   cdp1862_init_palette(device);
151150
152151   /* register for state saving */
153   state_save_combine_module_and_tag(unique_tag, "cdp1862", device->tag);
152   state_save_register_item("cdp1862", device->tag, 0, cdp1862->bgcolor);
153   state_save_register_item("cdp1862", device->tag, 0, cdp1862->con);
154154
155   state_save_register_item(unique_tag, 0, cdp1862->bgcolor);
156   state_save_register_item(unique_tag, 0, cdp1862->con);
155   state_save_register_bitmap("cdp1862", device->tag, 0, "cdp1862_bitmap", cdp1862->bitmap);
157156
158   state_save_register_bitmap(unique_tag, 0, "cdp1862->bitmap", cdp1862->bitmap);
159
160157   return DEVICE_START_OK;
161158}
162159
src/mess/video/tmc600.c
r3654r3655
44
55WRITE8_HANDLER( tmc600_vismac_register_w )
66{
7   tmc600_state *state = machine->driver_data;
7   tmc600_state *state = space->machine->driver_data;
88
99   state->vismac_reg_latch = data;
1010}
src/mess/video/zx8301.c
r3654r3655
105105
106106   if (zx8301->vda)
107107   {
108      cpu_spinuntil_time(device->machine->cpu[0],video_screen_get_time_until_pos(zx8301->screen, 256, 0));
108      cpu_spinuntil_time(device->machine->cpu[0], video_screen_get_time_until_pos(zx8301->screen, 256, 0));
109109   }
110110
111111   return zx8301->intf->ram_r(device, offset);
r3654r3655
119119
120120   if (zx8301->vda)
121121   {
122      cpu_spinuntil_time(device->machine->cpu[0],video_screen_get_time_until_pos(zx8301->screen, 256, 0));
122      cpu_spinuntil_time(device->machine->cpu[0], video_screen_get_time_until_pos(zx8301->screen, 256, 0));
123123   }
124124
125125   zx8301->intf->ram_w(device, offset, data);
r3654r3655
231231static DEVICE_START( zx8301 )
232232{
233233   zx8301_t *zx8301 = get_safe_token(device);
234
234235   /* validate arguments */
235236   assert(device != NULL);
236237   assert(device->tag != NULL);
r3654r3655
259260   timer_adjust_periodic(zx8301->flash_timer, ATTOTIME_IN_HZ(2), 0, ATTOTIME_IN_HZ(2));
260261
261262   /* register for state saving */
262   state_save_register_item("zx8301",NULL , 0, zx8301->dispoff);
263   state_save_register_item("zx8301",NULL , 0, zx8301->mode8);
264   state_save_register_item("zx8301",NULL , 0, zx8301->base);
265   state_save_register_item("zx8301",NULL , 0, zx8301->flash);
266   state_save_register_item("zx8301",NULL , 0, zx8301->vsync);
267   state_save_register_item("zx8301",NULL , 0, zx8301->vda);
263   state_save_register_item("zx8301", device->tag, 0, zx8301->dispoff);
264   state_save_register_item("zx8301", device->tag, 0, zx8301->mode8);
265   state_save_register_item("zx8301", device->tag, 0, zx8301->base);
266   state_save_register_item("zx8301", device->tag, 0, zx8301->flash);
267   state_save_register_item("zx8301", device->tag, 0, zx8301->vsync);
268   state_save_register_item("zx8301", device->tag, 0, zx8301->vda);
269
268270   return DEVICE_START_OK;
269271}
270272
src/mess/video/tmc1800.c
r3654r3655
3535
3636static VIDEO_UPDATE( tmc1800 )
3737{
38   const device_config *cdp1861 = device_list_find_by_tag(screen->machine->config->devicelist, CDP1861, CDP1861_TAG);
38   tmc1800_state *state = screen->machine->driver_data;
3939
40   cdp1861_update(cdp1861, bitmap, cliprect);
40   cdp1861_update(state->cdp1861, bitmap, cliprect);
4141
4242   return 0;
4343}
r3654r3655
7777
7878static VIDEO_UPDATE( tmc2000 )
7979{
80   const device_config *cdp1864 = device_list_find_by_tag(screen->machine->config->devicelist, CDP1864, CDP1864_TAG);
80   tmc2000_state *state = screen->machine->driver_data;
8181
82   cdp1864_update(cdp1864, bitmap, cliprect);
82   cdp1864_update(state->cdp1864, bitmap, cliprect);
8383
8484   return 0;
8585}
r3654r3655
119119
120120static VIDEO_UPDATE( oscnano )
121121{
122   const device_config *cdp1864 = device_list_find_by_tag(screen->machine->config->devicelist, CDP1864, CDP1864_TAG);
122   oscnano_state *state = screen->machine->driver_data;
123123
124   cdp1864_update(cdp1864, bitmap, cliprect);
124   cdp1864_update(state->cdp1864, bitmap, cliprect);
125125
126126   return 0;
127127}
src/mess/video/cdp1861.c
r3654r3655
3232
3333/* Timer Callbacks */
3434
35static TIMER_CALLBACK(cdp1861_int_tick)
35static TIMER_CALLBACK( cdp1861_int_tick )
3636{
3737   const device_config *device = ptr;
3838   cdp1861_t *cdp1861 = get_safe_token(device);
r3654r3655
5959   }
6060}
6161
62static TIMER_CALLBACK(cdp1861_efx_tick)
62static TIMER_CALLBACK( cdp1861_efx_tick )
6363{
6464   const device_config *device = ptr;
6565   cdp1861_t *cdp1861 = get_safe_token(device);
r3654r3655
9090   }
9191}
9292
93static TIMER_CALLBACK(cdp1861_dma_tick)
93static TIMER_CALLBACK( cdp1861_dma_tick )
9494{
9595   const device_config *device = ptr;
9696   cdp1861_t *cdp1861 = get_safe_token(device);
r3654r3655
187187static DEVICE_START( cdp1861 )
188188{
189189   cdp1861_t *cdp1861 = get_safe_token(device);
190   char unique_tag[30];
191190
192191   /* validate arguments */
193192   assert(device != NULL);
r3654r3655
215214   cdp1861->dma_timer = timer_alloc(cdp1861_dma_tick, (void *)device);
216215
217216   /* register for state saving */
218   state_save_combine_module_and_tag(unique_tag, "CDP1861", device->tag);
217   state_save_register_item("cdp1861", device->tag, 0, cdp1861->disp);
218   state_save_register_item("cdp1861", device->tag, 0, cdp1861->dmaout);
219   state_save_register_bitmap("cdp1861", device->tag, 0, "cdp1861->bitmap", cdp1861->bitmap);
219220
220   state_save_register_item(unique_tag, 0, cdp1861->disp);
221   state_save_register_item(unique_tag, 0, cdp1861->dmaout);
222   state_save_register_bitmap(unique_tag, 0, "cdp1861->bitmap", cdp1861->bitmap);
223
224221   return DEVICE_START_OK;
225222}
226223
src/mess/includes/ql.h
r0r3655
1#ifndef __QL__
2#define __QL__
3 
4#define SCREEN_TAG   "main"
5 
6#define ZX8301_TAG   "ic22"
7#define ZX8302_TAG   "ic23"
8 
9#define MDV1_TAG   "mdv1"
10#define MDV2_TAG   "mdv2"
11 
12#define X1 XTAL_15MHz
13#define X2 XTAL_32_768kHz
14#define X3 XTAL_4_436MHz
15#define X4 XTAL_11MHz
16 
17 
18typedef struct _ql_state ql_state;
19struct _ql_state
20{
21   /* IPC state */
22   UINT8 keylatch;
23   int ser1_txd;
24   int ser1_dtr;
25   int ser2_rxd;
26   int ser2_cts;
27   int ipl;
28   int comctl;
29   int comdata;
30   int baudx4;
31 
32   /* devices */
33   const device_config *zx8301;
34   const device_config *zx8302;
35};
36 
37#endif
src/mess/includes/tmc2000e.h
r0r3655
1#ifndef __TMC2000E__
2#define __TMC2000E__
3 
4#define SCREEN_TAG "main"
5 
6#define CDP1802_TAG "cdp1802"
7#define CDP1864_TAG "cdp1864"
8 
9#define TMC2000E_COLORRAM_SIZE 0x100 // ???
10 
11typedef struct _tmc2000e_state tmc2000e_state;
12struct _tmc2000e_state
13{
14   /* video state */
15   int cdp1864_efx;      /* EFx */
16 
17   UINT8 *colorram;      /* color memory */
18 
19   /* keyboard state */
20   int keylatch;         /* key latch */
21   int reset;            /* reset activated */
22 
23   /* devices */
24   const device_config *cdp1864;
25};
26 
27/* ---------- defined in video/tmc1800.c ---------- */
28 
29MACHINE_DRIVER_EXTERN( tmc1800_video );
30MACHINE_DRIVER_EXTERN( osc1000b_video );
31MACHINE_DRIVER_EXTERN( tmc2000_video );
32MACHINE_DRIVER_EXTERN( oscnano_video );
33 
34#endif
src/mess/includes/tmc1800.h
r3654r3655
99typedef struct _tmc1800_state tmc1800_state;
1010struct _tmc1800_state
1111{
12   /* cpu state */
13   int reset;            /* reset activated */
14
1215   /* video state */
1316   int cdp1861_efx;      /* EFx */
1417
1518   /* keyboard state */
1619   int keylatch;         /* key latch */
17   int reset;            /* reset activated */
20
21   /* devices */
22   const device_config *cdp1861;
1823};
1924
2025typedef struct _osc1000b_state osc1000b_state;
2126struct _osc1000b_state
2227{
23   /* video state */
24   int cdp1861_efx;      /* EFx */
28   /* cpu state */
29   int reset;            /* reset activated */
2530
2631   /* keyboard state */
2732   int keylatch;         /* key latch */
28   int reset;            /* reset activated */
2933};
3034
3135typedef struct _tmc2000_state tmc2000_state;
r3654r3655
3337{
3438   /* video state */
3539   int cdp1864_efx;      /* EFx */
40   int reset;            /* reset activated */
3641
3742   UINT8 *colorram;      /* color memory */
3843
3944   /* keyboard state */
4045   int keylatch;         /* key latch */
41   int reset;            /* reset activated */
46
47   /* devices */
48   const device_config *cdp1864;
4249};
4350
4451typedef struct _oscnano_state oscnano_state;
r3654r3655
4653{
4754   /* cpu state */
4855   int monitor_ef4;      /* EF4 line */
56   int reset;            /* reset activated */
4957
5058   /* video state */
5159   int cdp1864_efx;      /* EFx */
5260
5361   /* keyboard state */
5462   int keylatch;         /* key latch */
55   int reset;            /* reset activated */
5663
5764   /* timers */
5865   emu_timer *ef4_timer;   /* EF4 line RC timer */
66
67   /* devices */
68   const device_config *cdp1864;
5969};
6070
6171/* ---------- defined in video/tmc1800.c ---------- */
src/mess/messdriv.c
r3654r3655
126126//128u4   DRIVER( astrocdw )   /* Bally Astrocade (white case)                  */
127127
128128   /* RCA */
129//128u4   DRIVER( vip )      /* 1977 Cosmac VIP VP-711                     */
130//128u4   DRIVER( vp111 )      /* 1977 Cosmac VIP VP-111                     */
131//128u4   DRIVER( studio2 )   /* 1977 Studio II                           */
129   DRIVER( vip )      /* 1977 Cosmac VIP VP-711                     */
130   DRIVER( vp111 )      /* 1977 Cosmac VIP VP-111                     */
131   DRIVER( studio2 )   /* 1977 Studio II                           */
132132//   DRIVER( visicom )
133133//   DRIVER( mpt02s )
134134//   DRIVER( mpt02h )
r3654r3655
891891
892892   /* Telercas Oy */
893893//   DRIVER(tmc1800)
894//128u4   DRIVER(tmc2000)
895//128u4   DRIVER(tmc2000e)
894   DRIVER(tmc2000)
895   DRIVER(tmc2000e)
896896//   DRIVER(tmc600s1)
897//128u4   DRIVER(tmc600s2)
897   DRIVER(tmc600s2)
898898
899899   /* OSCOM Oy */
900900//   DRIVER(osc1000b)
901//128u4   DRIVER(oscnano)
901   DRIVER(oscnano)
902902
903903   /* MIT */
904904//128u4   DRIVER( tx0_64kw )   /* April 1956 MIT TX-0 (64kw RAM)               */
r3654r3655
10651065   DRIVER(pecom64)
10661066     
10671067   /* Bondwell */
1068//128u4   DRIVER( bw2 )
1068   DRIVER( bw2 )
10691069
10701070   /* Exeltel */
10711071//128u4   DRIVER( exl100 )
10721072//   DRIVER( exeltel )
10731073
10741074   /* Comx World Operations Ltd */
1075//128u4   DRIVER( comx35p )
1076//128u4   DRIVER( comx35n )
1075   DRIVER( comx35p )
1076   DRIVER( comx35n )
10771077//   DRIVER( comxpl80 )
10781078
10791079   /* Grundy Business Systems Ltd */
1080//128u4   DRIVER( newbrain )
1081//128u4   DRIVER( newbraim )
1082//128u4   DRIVER( newbraia )
1083//128u4   DRIVER( newbraiv )
1080   DRIVER( newbrain )
1081   DRIVER( newbraim )
1082   DRIVER( newbraia )
1083   DRIVER( newbraiv )
10841084
10851085   /* Votrax */
10861086//   DRIVER( votrtnt ) /* Votrax Type-N-Talk */
src/mess/machine/cdp1871.c
r3654r3655
291291static DEVICE_START( cdp1871 )
292292{
293293   cdp1871_t *cdp1871 = get_safe_token(device);
294   char unique_tag[30];
295294
296295   /* validate arguments */
297296   assert(device != NULL);
r3654r3655
313312   timer_adjust_periodic(cdp1871->scan_timer, attotime_zero, 0, ATTOTIME_IN_HZ(cdp1871->intf->clock));
314313
315314   /* register for state saving */
316   state_save_combine_module_and_tag(unique_tag, "CDP1871", device->tag);
315   state_save_register_item("cdp1871", device->tag, 0, cdp1871->inhibit);
316   state_save_register_item("cdp1871", device->tag, 0, cdp1871->sense);
317   state_save_register_item("cdp1871", device->tag, 0, cdp1871->drive);
318   state_save_register_item("cdp1871", device->tag, 0, cdp1871->modifiers);
317319
318   state_save_register_item(unique_tag, 0, cdp1871->inhibit);
319   state_save_register_item(unique_tag, 0, cdp1871->sense);
320   state_save_register_item(unique_tag, 0, cdp1871->drive);
321   state_save_register_item(unique_tag, 0, cdp1871->modifiers);
322
323   state_save_register_item(unique_tag, 0, cdp1871->da);
324   state_save_register_item(unique_tag, 0, cdp1871->next_da);
325   state_save_register_item(unique_tag, 0, cdp1871->rpt);
326   state_save_register_item(unique_tag, 0, cdp1871->next_rpt);
320   state_save_register_item("cdp1871", device->tag, 0, cdp1871->da);
321   state_save_register_item("cdp1871", device->tag, 0, cdp1871->next_da);
322   state_save_register_item("cdp1871", device->tag, 0, cdp1871->rpt);
323   state_save_register_item("cdp1871", device->tag, 0, cdp1871->next_rpt);
327324   return DEVICE_START_OK;
328325}
329326
src/mess/machine/comx35.c
r3654r3655
173173   }
174174}
175175
176static UINT8 fdc_r(running_machine *machine)
176static UINT8 fdc_r(const address_space *space)
177177{
178   comx35_state *state = machine->driver_data;
178   comx35_state *state = space->machine->driver_data;
179179
180180   UINT8 data;
181181
r3654r3655
185185   }
186186   else
187187   {
188      data = wd17xx_r(machine, state->fdc_addr);
188      data = wd17xx_r(space, state->fdc_addr);
189189   }
190190
191191   return data;
192192}
193193
194static void fdc_w(running_machine *machine, UINT8 data)
194static void fdc_w(const address_space *space, UINT8 data)
195195{
196196   /*
197197
r3654r3655
206206
207207   */
208208
209   comx35_state *state = machine->driver_data;
209   comx35_state *state = space->machine->driver_data;
210210
211211   if (state->cdp1802_q)
212212   {
r3654r3655
236236   {
237237      // write data to WD1770
238238
239      wd17xx_w(machine, state->fdc_addr, data);
239      wd17xx_w(space, state->fdc_addr, data);
240240   }
241241}
242242
r3654r3655
356356static void set_active_bank(running_machine *machine)
357357{
358358   comx35_state *state = machine->driver_data;
359   const address_space *program = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
359360   int bank = state->bank;
360361
361362   switch (state->bank)
362363   {
363364   case BANK_NONE:
364      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xc000, 0xdfff, 0, 0, SMH_UNMAP, SMH_UNMAP);
365      memory_install_readwrite8_handler(program, 0xc000, 0xdfff, 0, 0, SMH_UNMAP, SMH_UNMAP);
365366      break;
366367
367368   case BANK_FLOPPY:
368      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xc000, 0xdfff, 0, 0, SMH_BANK1, SMH_UNMAP);
369      memory_install_readwrite8_handler(program, 0xc000, 0xdfff, 0, 0, SMH_BANK1, SMH_UNMAP);
369370      break;
370371
371372   case BANK_PRINTER_PARALLEL:
372      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xc000, 0xc7ff, 0, 0, SMH_BANK1, SMH_UNMAP);
373      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xc800, 0xdfff, 0, 0, SMH_UNMAP, SMH_UNMAP);
373      memory_install_readwrite8_handler(program, 0xc000, 0xc7ff, 0, 0, SMH_BANK1, SMH_UNMAP);
374      memory_install_readwrite8_handler(program, 0xc800, 0xdfff, 0, 0, SMH_UNMAP, SMH_UNMAP);
374375      break;
375376
376377   case BANK_PRINTER_PARALLEL_FM:
377      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xc000, 0xcfff, 0, 0, SMH_BANK1, SMH_UNMAP);
378      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xd000, 0xdfff, 0, 0, SMH_UNMAP, SMH_UNMAP);
378      memory_install_readwrite8_handler(program, 0xc000, 0xcfff, 0, 0, SMH_BANK1, SMH_UNMAP);
379      memory_install_readwrite8_handler(program, 0xd000, 0xdfff, 0, 0, SMH_UNMAP, SMH_UNMAP);
379380      break;
380381
381382   case BANK_PRINTER_SERIAL:
382      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xc000, 0xc7ff, 0, 0, SMH_BANK1, SMH_UNMAP);
383      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xc800, 0xdfff, 0, 0, SMH_UNMAP, SMH_UNMAP);
383      memory_install_readwrite8_handler(program, 0xc000, 0xc7ff, 0, 0, SMH_BANK1, SMH_UNMAP);
384      memory_install_readwrite8_handler(program, 0xc800, 0xdfff, 0, 0, SMH_UNMAP, SMH_UNMAP);
384385      break;
385386
386387   case BANK_PRINTER_THERMAL:
387      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xc000, 0xcfff, 0, 0, SMH_BANK1, SMH_UNMAP);
388      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xd000, 0xdfff, 0, 0, SMH_UNMAP, SMH_UNMAP);
388      memory_install_readwrite8_handler(program, 0xc000, 0xcfff, 0, 0, SMH_BANK1, SMH_UNMAP);
389      memory_install_readwrite8_handler(program, 0xd000, 0xdfff, 0, 0, SMH_UNMAP, SMH_UNMAP);
389390      break;
390391
391392   case BANK_JOYCARD:
392      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xc000, 0xdfff, 0, 0, SMH_UNMAP, SMH_UNMAP);
393      memory_install_readwrite8_handler(program, 0xc000, 0xdfff, 0, 0, SMH_UNMAP, SMH_UNMAP);
393394      break;
394395
395396   case BANK_80_COLUMNS:
396397      {
397398         const device_config *mc6845 = devtag_get_device(machine, MC6845, MC6845_TAG);
398399
399         memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xc000, 0xc7ff, 0, 0, SMH_BANK1, SMH_UNMAP); // ROM
400         memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xc800, 0xcfff, 0, 0, SMH_UNMAP, SMH_UNMAP);
401         memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xd000, 0xd7ff, 0, 0, comx35_videoram_r, comx35_videoram_w);
402         memory_install_readwrite8_device_handler(mc6845, 0, ADDRESS_SPACE_PROGRAM, 0xd800, 0xd800, 0, 0, SMH_UNMAP, mc6845_address_w);
403         memory_install_readwrite8_device_handler(mc6845, 0, ADDRESS_SPACE_PROGRAM, 0xd801, 0xd801, 0, 0, mc6845_register_r, mc6845_register_w);
404         memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xd802, 0xdfff, 0, 0, SMH_UNMAP, SMH_UNMAP);
400         memory_install_readwrite8_handler(program, 0xc000, 0xc7ff, 0, 0, SMH_BANK1, SMH_UNMAP); // ROM
401         memory_install_readwrite8_handler(program, 0xc800, 0xcfff, 0, 0, SMH_UNMAP, SMH_UNMAP);
402         memory_install_readwrite8_handler(program, 0xd000, 0xd7ff, 0, 0, comx35_videoram_r, comx35_videoram_w);
403         memory_install_readwrite8_device_handler(program, mc6845, 0xd800, 0xd800, 0, 0, SMH_UNMAP, mc6845_address_w);
404         memory_install_readwrite8_device_handler(program, mc6845, 0xd801, 0xd801, 0, 0, mc6845_register_r, mc6845_register_w);
405         memory_install_readwrite8_handler(program, 0xd802, 0xdfff, 0, 0, SMH_UNMAP, SMH_UNMAP);
405406      }
406407      break;
407408
r3654r3655
409410      {
410411         bank = BANK_RAMCARD + state->rambank;
411412
412         memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xc000, 0xdfff, 0, 0, SMH_BANK1, SMH_BANK1);
413         memory_install_readwrite8_handler(program, 0xc000, 0xdfff, 0, 0, SMH_BANK1, SMH_BANK1);
413414      }
414415      break;
415416   }
r3654r3655
419420
420421WRITE8_HANDLER( comx35_bank_select_w )
421422{
422   get_active_bank(machine, data);
423   set_active_bank(machine);
423   get_active_bank(space->machine, data);
424   set_active_bank(space->machine);
424425}
425426
426427READ8_HANDLER( comx35_io_r )
427428{
428   comx35_state *state = machine->driver_data;
429   comx35_state *state = space->machine->driver_data;
429430
430431   UINT8 data = 0xff;
431432
r3654r3655
435436      break;
436437
437438   case BANK_FLOPPY:
438      data = fdc_r(machine);
439      data = fdc_r(space);
439440      break;
440441
441442   case BANK_PRINTER_PARALLEL:
442443   case BANK_PRINTER_PARALLEL_FM:
443444   case BANK_PRINTER_SERIAL:
444445   case BANK_PRINTER_THERMAL:
445      data = printer_r(machine);
446      data = printer_r(space->machine);
446447      break;
447448
448449   case BANK_JOYCARD:
449      data = input_port_read(machine, "JOY1");
450      data = input_port_read(space->machine, "JOY1");
450451      break;
451452
452453   case BANK_80_COLUMNS:
r3654r3655
461462
462463READ8_HANDLER( comx35_io2_r )
463464{
464   comx35_state *state = machine->driver_data;
465   comx35_state *state = space->machine->driver_data;
465466
466467   UINT8 data = 0xff;
467468
r3654r3655
480481      break;
481482
482483   case BANK_JOYCARD:
483      data = input_port_read(machine, "JOY2");
484      data = input_port_read(space->machine, "JOY2");
484485      break;
485486
486487   case BANK_80_COLUMNS:
r3654r3655
495496
496497WRITE8_HANDLER( comx35_io_w )
497498{
498   comx35_state *state = machine->driver_data;
499   comx35_state *state = space->machine->driver_data;
499500
500501   switch (state->bank)
501502   {
r3654r3655
503504      break;
504505
505506   case BANK_FLOPPY:
506      fdc_w(machine, data);
507      fdc_w(space, data);
507508      break;
508509
509510   case BANK_PRINTER_PARALLEL:
510511   case BANK_PRINTER_PARALLEL_FM:
511512   case BANK_PRINTER_SERIAL:
512513   case BANK_PRINTER_THERMAL:
513      printer_w(machine, data);
514      printer_w(space->machine, data);
514515      break;
515516
516517   case BANK_JOYCARD:
r3654r3655
537538{
538539   if (address >= 0x0dd0 && address <= 0x0ddf)
539540   {
540      if (dos_card_active(machine))
541      if (dos_card_active(space->machine))
541542      {
542543         // read opcode from DOS ROM
543         direct->raw = direct->decrypted = memory_region(machine, "fdc");
544         direct->raw = direct->decrypted = memory_region(space->machine, "fdc");
544545         return ~0;
545546      }
546547   }
r3654r3655
556557MACHINE_START( comx35p )
557558{
558559   comx35_state *state = machine->driver_data;
560   const address_space *program = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
559561
560562   /* opbase handling for DOS Card */
561563
562   memory_set_direct_update_handler(0, comx35_opbase_handler);
564   memory_set_direct_update_handler(program, comx35_opbase_handler);
563565
564566   /* BASIC ROM banking */
565567
566   memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x1000, 0x17ff, 0, 0, SMH_BANK2, SMH_UNMAP);
568   memory_install_readwrite8_handler(program, 0x1000, 0x17ff, 0, 0, SMH_BANK2, SMH_UNMAP);
567569   memory_configure_bank(machine, 2, 0, 1, memory_region(machine, CDP1802_TAG) + 0x1000, 0); // normal ROM
568570   memory_configure_bank(machine, 2, 1, 1, memory_region(machine, CDP1802_TAG) + 0xe000, 0); // expansion box ROM
569571
570572   memory_configure_bank(machine, 3, 0, 1, memory_region(machine, CDP1802_TAG) + 0xe000, 0);
571   memory_set_bank(3, 0);
573   memory_set_bank(machine, 3, 0);
572574
573575   if (expansion_box_installed(machine))
574576   {
575      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xe000, 0xefff, 0, 0, SMH_BANK3, SMH_UNMAP);
577      memory_install_readwrite8_handler(program, 0xe000, 0xefff, 0, 0, SMH_BANK3, SMH_UNMAP);
576578      memory_set_bank(machine, 2, 1);
577579   }
578580   else
579581   {
580      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xe000, 0xefff, 0, 0, SMH_UNMAP, SMH_UNMAP);
582      memory_install_readwrite8_handler(program, 0xe000, 0xefff, 0, 0, SMH_UNMAP, SMH_UNMAP);
581583      memory_set_bank(machine, 2, 0);
582584   }
583585
r3654r3655
669671
670672static void image_fread_memory(const device_config *image, UINT16 addr, UINT32 count)
671673{
672   void *ptr = memory_get_write_ptr(0, ADDRESS_SPACE_PROGRAM, addr);
674   void *ptr = memory_get_write_ptr(cpu_get_address_space(image->machine->cpu[0], ADDRESS_SPACE_PROGRAM), addr);
673675
674676   image_fread(image, ptr, count);
675677}
676678
677679QUICKLOAD_LOAD( comx35 )
678680{
681   const address_space *program = cpu_get_address_space(image->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
682
679683   UINT8 header[16] = {0};
680684   int size = image_length(image);
681685
r3654r3655
799803         image_fread(image, header, 2);
800804
801805         array_length = (header[0] << 8) | header[1];
802         start_array = (memory_read_byte(space, 0x4295) << 8) | memory_read_byte(space, 0x4296);
806         start_array = (memory_read_byte(program, 0x4295) << 8) | memory_read_byte(program, 0x4296);
803807         end_array = start_array + (size - 7);
804808
805         memory_write_byte(space, 0x4299, end_array >> 8);
806         memory_write_byte(space, 0x429a, end_array & 0xff);
809         memory_write_byte(program, 0x4299, end_array >> 8);
810         memory_write_byte(program, 0x429a, end_array & 0xff);
807811         
808812         start_string = start_array + array_length;
809813
810         memory_write_byte(space, 0x4292, start_string >> 8);
811         memory_write_byte(space, 0x4293, start_string & 0xff);
814         memory_write_byte(program, 0x4292, start_string >> 8);
815         memory_write_byte(program, 0x4293, start_string & 0xff);
812816
813817         image_fread_memory(image, start_array, size);
814818      }
src/mess/machine/adc080x.c
r3654r3655
135135static DEVICE_START( adc080x )
136136{
137137   adc080x_t *adc080x = get_safe_token(device);
138   char unique_tag[30];
139138
140139   /* validate arguments */
141140   assert(device != NULL);
r3654r3655
155154   timer_adjust_periodic(adc080x->cycle_timer, attotime_zero, 0, ATTOTIME_IN_HZ(adc080x->intf->clock));
156155
157156   /* register for state saving */
158   state_save_combine_module_and_tag(unique_tag, "adc080x", device->tag);
159
160   state_save_register_item(unique_tag, 0, adc080x->address);
161   state_save_register_item(unique_tag, 0, adc080x->ale);
162   state_save_register_item(unique_tag, 0, adc080x->start);
163   state_save_register_item(unique_tag, 0, adc080x->eoc);
164   state_save_register_item(unique_tag, 0, adc080x->next_eoc);
165   state_save_register_item(unique_tag, 0, adc080x->sar);
166   state_save_register_item(unique_tag, 0, adc080x->cycle);
167   state_save_register_item(unique_tag, 0, adc080x->bit);
157   state_save_register_item("adc080x", device->tag, 0, adc080x->address);
158   state_save_register_item("adc080x", device->tag, 0, adc080x->ale);
159   state_save_register_item("adc080x", device->tag, 0, adc080x->start);
160   state_save_register_item("adc080x", device->tag, 0, adc080x->eoc);
161   state_save_register_item("adc080x", device->tag, 0, adc080x->next_eoc);
162   state_save_register_item("adc080x", device->tag, 0, adc080x->sar);
163   state_save_register_item("adc080x", device->tag, 0, adc080x->cycle);
164   state_save_register_item("adc080x", device->tag, 0, adc080x->bit);
168165   return DEVICE_START_OK;
169166}
170167
src/mess/machine/zx8302.c
r3654r3655
606606
607607   /* register for state saving */
608608
609   state_save_register_item("zx8302",NULL , 0, zx8302->idr);
610   state_save_register_item("zx8302",NULL , 0, zx8302->tcr);
611   state_save_register_item("zx8302",NULL , 0, zx8302->tdr);
612   state_save_register_item("zx8302",NULL , 0, zx8302->irq);
613   state_save_register_item("zx8302",NULL , 0, zx8302->ctr);
614   state_save_register_item("zx8302",NULL , 0, zx8302->status);
609   state_save_register_item("zx8302", device->tag, 0, zx8302->idr);
610   state_save_register_item("zx8302", device->tag, 0, zx8302->tcr);
611   state_save_register_item("zx8302", device->tag, 0, zx8302->tdr);
612   state_save_register_item("zx8302", device->tag, 0, zx8302->irq);
613   state_save_register_item("zx8302", device->tag, 0, zx8302->ctr);
614   state_save_register_item("zx8302", device->tag, 0, zx8302->status);
615615
616   state_save_register_item("zx8302",NULL , 0, zx8302->comdata);
617   state_save_register_item("zx8302",NULL , 0, zx8302->comctl);
618   state_save_register_item("zx8302",NULL , 0, zx8302->ipc_state);
619   state_save_register_item("zx8302",NULL , 0, zx8302->ipc_rx);
620   state_save_register_item("zx8302",NULL , 0, zx8302->ipc_busy);
621   state_save_register_item("zx8302",NULL , 0, zx8302->baudx4);
616   state_save_register_item("zx8302", device->tag, 0, zx8302->comdata);
617   state_save_register_item("zx8302", device->tag, 0, zx8302->comctl);
618   state_save_register_item("zx8302", device->tag, 0, zx8302->ipc_state);
619   state_save_register_item("zx8302", device->tag, 0, zx8302->ipc_rx);
620   state_save_register_item("zx8302", device->tag, 0, zx8302->ipc_busy);
621   state_save_register_item("zx8302", device->tag, 0, zx8302->baudx4);
622622   
623   state_save_register_item("zx8302",NULL , 0, zx8302->tx_bits);
624   state_save_register_item("zx8302",NULL , 0, zx8302->ser1_rxd);
625   state_save_register_item("zx8302",NULL , 0, zx8302->ser1_cts);
626   state_save_register_item("zx8302",NULL , 0, zx8302->ser2_txd);
627   state_save_register_item("zx8302",NULL , 0, zx8302->ser2_dtr);
628   state_save_register_item("zx8302",NULL , 0, zx8302->netout);
629   state_save_register_item("zx8302",NULL , 0, zx8302->netin);
623   state_save_register_item("zx8302", device->tag, 0, zx8302->tx_bits);
624   state_save_register_item("zx8302", device->tag, 0, zx8302->ser1_rxd);
625   state_save_register_item("zx8302", device->tag, 0, zx8302->ser1_cts);
626   state_save_register_item("zx8302", device->tag, 0, zx8302->ser2_txd);
627   state_save_register_item("zx8302", device->tag, 0, zx8302->ser2_dtr);
628   state_save_register_item("zx8302", device->tag, 0, zx8302->netout);
629   state_save_register_item("zx8302", device->tag, 0, zx8302->netin);
630630
631   state_save_register_item("zx8302",NULL , 0, zx8302->mdrdw);
632   state_save_register_item("zx8302",NULL , 0, zx8302->mdselck);
633   state_save_register_item("zx8302",NULL , 0, zx8302->mdseld);
634   state_save_register_item("zx8302",NULL , 0, zx8302->erase);
631   state_save_register_item("zx8302", device->tag, 0, zx8302->mdrdw);
632   state_save_register_item("zx8302", device->tag, 0, zx8302->mdselck);
633   state_save_register_item("zx8302", device->tag, 0, zx8302->mdseld);
634   state_save_register_item("zx8302", device->tag, 0, zx8302->erase);
635635   
636   state_save_register_item("zx8302",NULL , 0, zx8302->mdv_motor);
637   state_save_register_item_array("zx8302",NULL , 0, zx8302->mdv_offset);
636   state_save_register_item("zx8302", device->tag, 0, zx8302->mdv_motor);
637   state_save_register_item_array("zx8302", device->tag, 0, zx8302->mdv_offset);
638638   return DEVICE_START_OK;
639639}
640640
src/mess/mess.mak
r3654r3655
381381   $(MESSOBJ)/avigo.a \
382382   $(MESSOBJ)/b2m.a \
383383   $(MESSOBJ)/bk.a \
384   $(MESSOBJ)/bondwell.a \
384385   $(MESSOBJ)/cbm.a \
385386   $(MESSOBJ)/cbmshare.a \
386387   $(MESSOBJ)/coleco.a \
388   $(MESSOBJ)/comx.a \
387389   $(MESSOBJ)/dai.a \
388390   $(MESSOBJ)/einis.a \
389391   $(MESSOBJ)/ep128.a \
390392   $(MESSOBJ)/exidy.a \
391393   $(MESSOBJ)/gce.a \
392394   $(MESSOBJ)/galaxy.a \
395   $(MESSOBJ)/grundy.a \
393396   $(MESSOBJ)/homelab.a \
394397   $(MESSOBJ)/intv.a \
395398   $(MESSOBJ)/irisha.a \
r3654r3655
416419   $(MESSOBJ)/pp01.a \
417420   $(MESSOBJ)/primo.a \
418421   $(MESSOBJ)/radio.a \
422   $(MESSOBJ)/rca.a \
419423   $(MESSOBJ)/rt1715.a \
420424   $(MESSOBJ)/sapi1.a \
421425   $(MESSOBJ)/sharp.a \
r3654r3655
425429   $(MESSOBJ)/special.a \
426430   $(MESSOBJ)/ssystem3.a \
427431   $(MESSOBJ)/super80.a \
432   $(MESSOBJ)/telmac.a \
428433   $(MESSOBJ)/trs80.a \
429434   $(MESSOBJ)/ut88.a \
430435   $(MESSOBJ)/vector06.a \
r3654r3655
437442#   $(MESSOBJ)/bally.a \
438443#   $(MESSOBJ)/bandai.a \
439444#   $(MESSOBJ)/be.a \
440#   $(MESSOBJ)/bondwell.a \
441445#   $(MESSOBJ)/cgenie.a \
442446#   $(MESSOBJ)/coco.a \
443447#   $(MESSOBJ)/compis.a \
444#   $(MESSOBJ)/comx.a \
445448#   $(MESSOBJ)/concept.a \
446449#   $(MESSOBJ)/cpschngr.a \
447450#   $(MESSOBJ)/cybiko.a \
r3654r3655
452455#   $(MESSOBJ)/fairch.a \
453456#   $(MESSOBJ)/glasgow.a \
454457#   $(MESSOBJ)/gmaster.a \
455#   $(MESSOBJ)/grundy.a \
456458#   $(MESSOBJ)/hp48.a \
457459#   $(MESSOBJ)/kaypro.a \
458460#   $(MESSOBJ)/kim1.a \
r3654r3655
466468#   $(MESSOBJ)/pasogo.a \
467469#   $(MESSOBJ)/pc.a \
468470#   $(MESSOBJ)/pdp1.a \
469#   $(MESSOBJ)/rca.a \
470471#   $(MESSOBJ)/rockwell.a \
471472#   $(MESSOBJ)/samcoupe.a \
472473#   $(MESSOBJ)/sega.a \
r3654r3655
478479#   $(MESSOBJ)/tangerin.a \
479480#   $(MESSOBJ)/tatung.a \
480481#   $(MESSOBJ)/teamconc.a \
481#   $(MESSOBJ)/telmac.a \
482482#   $(MESSOBJ)/thomson.a \
483483#   $(MESSOBJ)/ti85.a \
484484#   $(MESSOBJ)/ti99.a \
src/mess/drivers/vip.c
r3654r3655
265265
266266static WRITE8_HANDLER( keylatch_w )
267267{
268   vip_state *state = machine->driver_data;
268   vip_state *state = space->machine->driver_data;
269269
270270   state->keylatch = data & 0x0f;
271271}
r3654r3655
274274{
275275   /* enable RAM */
276276
277   memory_set_bank(machine, 1, VIP_BANK_RAM);
277   const address_space *program = cpu_get_address_space(space->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
278278
279   memory_set_bank(space->machine, 1, VIP_BANK_RAM);
280
279281   switch (mess_ram_size)
280282   {
281283   case 1 * 1024:
282      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x03ff, 0, 0x7c00, SMH_BANK1, SMH_BANK1);
284      memory_install_readwrite8_handler(program, 0x0000, 0x03ff, 0, 0x7c00, SMH_BANK1, SMH_BANK1);
283285      break;
284286
285287   case 2 * 1024:
286      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x07ff, 0, 0x7800, SMH_BANK1, SMH_BANK1);
288      memory_install_readwrite8_handler(program, 0x0000, 0x07ff, 0, 0x7800, SMH_BANK1, SMH_BANK1);
287289      break;
288290
289291   case 4 * 1024:
290      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x0fff, 0, 0x7000, SMH_BANK1, SMH_BANK1);
292      memory_install_readwrite8_handler(program, 0x0000, 0x0fff, 0, 0x7000, SMH_BANK1, SMH_BANK1);
291293      break;
292294
293295   case 32 * 1024:
294      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1);
296      memory_install_readwrite8_handler(program, 0x0000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1);
295297      break;
296298   }
297299}
r3654r3655
415417
416418static WRITE8_HANDLER( vip_colorram_w )
417419{
418   vip_state *state = machine->driver_data;
420   vip_state *state = space->machine->driver_data;
419421
420422   state->colorram[offset] = data;
421423
r3654r3655
448450
449451static CDP1802_MODE_READ( vip_mode_r )
450452{
451   vip_state *state = machine->driver_data;
453   vip_state *state = device->machine->driver_data;
452454
453   if (input_port_read(machine, "RUN") & 0x01)
455   if (input_port_read(device->machine, "RUN") & 0x01)
454456   {
455457      if (state->reset)
456458      {
r3654r3655
463465   {
464466      if (!state->reset)
465467      {
468         running_machine *machine = device->machine;
466469         MACHINE_RESET_CALL(vip);
467470
468471         state->reset = 1;
r3654r3655
474477
475478static CDP1802_EF_READ( vip_ef_r )
476479{
477   vip_state *state = machine->driver_data;
480   vip_state *state = device->machine->driver_data;
478481
479482   UINT8 flags = 0x0f;
480483
r3654r3655
489492   if (state->cdp1861_efx) flags -= EF1;
490493
491494   /* tape input */
492   if (cassette_input(cassette_device_image(machine)) < 0) flags -= EF2;
493   set_led_status(VIP_LED_TAPE, (cassette_input(cassette_device_image(machine)) > 0));
495   if (cassette_input(cassette_device_image(device->machine)) < 0) flags -= EF2;
496   set_led_status(VIP_LED_TAPE, (cassette_input(cassette_device_image(device->machine)) > 0));
494497
495498   /* keyboard */
496   if (input_port_read(machine, "KEYPAD") & (1 << state->keylatch)) flags -= EF3;
499   if (input_port_read(device->machine, "KEYPAD") & (1 << state->keylatch)) flags -= EF3;
497500
498501   /* extended keyboard */
499   switch (input_port_read(machine, "KEYBOARD"))
502   switch (input_port_read(device->machine, "KEYBOARD"))
500503   {
501504   case VIP_KEYBOARD_VP580:
502      if (input_port_read(machine, "VP-580") & (1 << state->keylatch)) flags -= EF4;
505      if (input_port_read(device->machine, "VP-580") & (1 << state->keylatch)) flags -= EF4;
503506      break;
504507   }
505508
r3654r3655
508511
509512static CDP1802_Q_WRITE( vip_q_w )
510513{
511   vip_state *state = machine->driver_data;
514   vip_state *state = device->machine->driver_data;
512515
513516   /* sound output */
514   discrete_sound_w(machine, NODE_01, level);
517   discrete_sound_w(cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM), NODE_01, level);
515518
516   if (input_port_read(machine, "SOUND") == VIP_SOUND_CDP1863)
519   if (input_port_read(device->machine, "SOUND") == VIP_SOUND_CDP1863)
517520   {
518521      /* CDP1863 output enable */
519522      cdp1863_oe_w(state->cdp1863, level);
r3654r3655
523526   set_led_status(VIP_LED_Q, level);
524527
525528   /* tape output */
526   cassette_output(cassette_device_image(machine), level ? 1.0 : -1.0);
529   cassette_output(cassette_device_image(device->machine), level ? 1.0 : -1.0);
527530}
528531
529532static CDP1802_DMA_WRITE( vip_dma_w )
530533{
531   vip_state *state = machine->driver_data;
534   vip_state *state = device->machine->driver_data;
532535
533   switch (input_port_read(machine, "VIDEO"))
536   switch (input_port_read(device->machine, "VIDEO"))
534537   {
535538   case VIP_VIDEO_CDP1861:
536539      cdp1861_dma_w(state->cdp1861, data);
r3654r3655
596599
597600   /* look up devices */
598601
599   state->cdp1861 = device_list_find_by_tag(machine->config->devicelist, CDP1861, CDP1861_TAG);
600   state->cdp1862 = device_list_find_by_tag(machine->config->devicelist, CDP1862, CDP1862_TAG);
601   state->cdp1863 = device_list_find_by_tag(machine->config->devicelist, CDP1863, CDP1863_TAG);
602   state->cdp1861 = devtag_get_device(machine, CDP1861, CDP1861_TAG);
603   state->cdp1862 = devtag_get_device(machine, CDP1862, CDP1862_TAG);
604   state->cdp1863 = devtag_get_device(machine, CDP1863, CDP1863_TAG);
602605
603606   /* register for state saving */
604607
r3654r3655
613616static MACHINE_RESET( vip )
614617{
615618   vip_state *state = machine->driver_data;
619   
620   const address_space *program = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
621   const address_space *io = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO);
616622
617623   /* reset auxiliary chips */
618624
r3654r3655
627633   switch (input_port_read(machine, "VIDEO"))
628634   {
629635   case VIP_VIDEO_CDP1861:
630      memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x05, 0x05, 0, 0, SMH_UNMAP);
631      memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc0ff, 0, 0, SMH_UNMAP);
636      memory_install_write8_handler(io, 0x05, 0x05, 0, 0, SMH_UNMAP);
637      memory_install_write8_handler(program, 0xc000, 0xc0ff, 0, 0, SMH_UNMAP);
632638      break;
633639
634640   case VIP_VIDEO_CDP1862:
635      memory_install_write8_device_handler(state->cdp1862, 0, ADDRESS_SPACE_IO, 0x05, 0x05, 0, 0, cdp1862_bkg_w);
636      memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc0ff, 0, 0, vip_colorram_w);
641      memory_install_write8_device_handler(io, state->cdp1862, 0x05, 0x05, 0, 0, cdp1862_bkg_w);
642      memory_install_write8_handler(program, 0xc000, 0xc0ff, 0, 0, vip_colorram_w);
637643      break;
638644   }
639645
r3654r3655
642648   switch (input_port_read(machine, "SOUND"))
643649   {
644650   case VIP_SOUND_CDP1863:
645      memory_install_write8_device_handler(state->cdp1863, 0, ADDRESS_SPACE_IO, 0x03, 0x03, 0, 0, cdp1863_str_w);
651      memory_install_write8_device_handler(io, state->cdp1863, 0x03, 0x03, 0, 0, cdp1863_str_w);
646652      break;
647653
648654   default:
649      memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x03, 0x03, 0, 0, SMH_UNMAP);
655      memory_install_write8_handler(io, 0x03, 0x03, 0, 0, SMH_UNMAP);
650656      break;
651657   }
652658
653659   /* enable ROM mirror at 0x0000 */
654660
655   memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x01ff, 0, 0x7e00, SMH_BANK1, SMH_UNMAP);
661   memory_install_readwrite8_handler(program, 0x0000, 0x01ff, 0, 0x7e00, SMH_BANK1, SMH_UNMAP);
656662   memory_set_bank(machine, 1, VIP_BANK_ROM);
657663}
658664
src/mess/drivers/comxpl80.c
r3654r3655
3535
3636   */
3737
38   comxpl80_state *state = machine->driver_data;
38   comxpl80_state *state = space->machine->driver_data;
3939
4040   state->y_motor_phase = data & 0x0f;
4141   state->font_addr = (BIT(data, 4) << 12) | (state->font_addr & 0xfff);
r3654r3655
4949   else
5050   {
5151      // read data from font ROM
52      int font_rom = (input_port_read(machine, "FONT") & 0x03) * 0x2000;
52      int font_rom = (input_port_read(space->machine, "FONT") & 0x03) * 0x2000;
5353
54      state->plotter_data = memory_region(machine, "gfx2")[font_rom | state->font_addr];
54      state->plotter_data = memory_region(space->machine, "gfx2")[font_rom | state->font_addr];
5555   }
5656   
5757   if (!BIT(data, 6))
r3654r3655
6363   if (BIT(data, 7))
6464   {
6565      // read switches
66      state->plotter_data = input_port_read(machine, "SW");
66      state->plotter_data = input_port_read(space->machine, "SW");
6767   }
6868}
6969
r3654r3655
8484
8585   */
8686
87   comxpl80_state *state = machine->driver_data;
87   comxpl80_state *state = space->machine->driver_data;
8888
8989   state->z_motor_phase = data & 0x0f;
9090
r3654r3655
108108
109109   */
110110
111   comxpl80_state *state = machine->driver_data;
111   comxpl80_state *state = space->machine->driver_data;
112112
113113   state->font_addr = (state->font_addr & 0x1f00) | data;
114114
r3654r3655
135135
136136   */
137137
138   comxpl80_state *state = machine->driver_data;
138   comxpl80_state *state = space->machine->driver_data;
139139
140140   return state->plotter_data;
141141}
src/mess/drivers/tmc600.c
r3654r3655
8888#include "includes/tmc600.h"
8989#include "video/cdp1869.h"
9090
91static QUICKLOAD_LOAD( tmc600 );
92
9391static const device_config *cassette_device_image(running_machine *machine)
9492{
9593   return devtag_get_device(machine, CASSETTE, "cassette");
r3654r3655
9997
10098static WRITE8_HANDLER( keyboard_latch_w )
10199{
102   tmc600_state *state = machine->driver_data;
100   tmc600_state *state = space->machine->driver_data;
103101
104102   state->keylatch = data;
105103}
r3654r3655
111109
112110static WRITE8_HANDLER( printer_w )
113111{
114   printer_output(printer_device(machine), data);
112   printer_output(printer_device(space->   machine), data);
115113}
116114
117115/* Memory Maps */
r3654r3655
228226
229227static CDP1802_MODE_READ( tmc600_mode_r )
230228{
231   if (input_port_read(machine, "RUN") & 0x01)
229   if (input_port_read(device->machine, "RUN") & 0x01)
232230   {
233231      return CDP1802_MODE_RESET;
234232   }
r3654r3655
240238
241239static CDP1802_EF_READ( tmc600_ef_r )
242240{
243   tmc600_state *state = machine->driver_data;
241   tmc600_state *state = device->machine->driver_data;
244242
245243   int flags = 0x0f;
246244   static const char *keynames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" };
r3654r3655
254252
255253   // tape in
256254
257   if (cassette_input(cassette_device_image(machine)) < +0.0) flags -= EF2;
255   if (cassette_input(cassette_device_image(device->machine)) < +0.0) flags -= EF2;
258256
259257   // keyboard
260258
261   flags -= (~input_port_read(machine, keynames[state->keylatch / 8]) & (1 << (state->keylatch % 8))) ? EF3 : 0;
259   flags -= (~input_port_read(device->machine, keynames[state->keylatch / 8]) & (1 << (state->keylatch % 8))) ? EF3 : 0;
262260
263261   return flags;
264262}
265263
266264static CDP1802_Q_WRITE( tmc600_q_w )
267265{
268   cassette_output(cassette_device_image(machine), level ? +1.0 : -1.0);
266   cassette_output(cassette_device_image(device->machine), level ? +1.0 : -1.0);
269267}
270268
271269static CDP1802_INTERFACE( tmc600_cdp1802_config )
r3654r3655
352350   /* printer */
353351   MDRV_DEVICE_ADD("printer", PRINTER)
354352
355   /* quickload */
356   MDRV_QUICKLOAD_ADD(tmc600, "sbp", 0)
357
358353   /* cassette */
359354   MDRV_CASSETTE_ADD( "cassette", tmc600_cassette_config )
360355MACHINE_DRIVER_END
r3654r3655
387382
388383/* System Configuration */
389384
390static QUICKLOAD_LOAD( tmc600 )
391{
392   void *ptr = memory_get_write_ptr(0, ADDRESS_SPACE_PROGRAM, 0x6300);
393
394   image_fread(image, ptr, 0x9500);
395
396   return INIT_PASS;
397}
398
399385static void tmc600_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
400386{
401387   /* floppy */
src/mess/drivers/studio2.c
r3654r3655
248248
249249static VIDEO_UPDATE( studio2 )
250250{
251   const device_config *cdp1861 = device_list_find_by_tag(screen->machine->config->devicelist, CDP1861, CDP1861_TAG);
251   const device_config *cdp1861 = devtag_get_device(screen->machine, CDP1861, CDP1861_TAG);
252252
253253   cdp1861_update(cdp1861, bitmap, cliprect);
254254
r3654r3655
288288
289289static VIDEO_UPDATE( mpt02 )
290290{
291   const device_config *cdp1864 = device_list_find_by_tag(screen->machine->config->devicelist, CDP1864, CDP1864_TAG);
291   const device_config *cdp1864 = devtag_get_device(screen->machine, CDP1864, CDP1864_TAG);
292292
293293   cdp1864_update(cdp1864, bitmap, cliprect);
294294
r3654r3655
310310
311311   if (cdp1861_efx) ef -= EF1;
312312
313   if (input_port_read(machine, "KEYPAD_L") & (1 << keylatch)) ef -= EF3;
314   if (input_port_read(machine, "KEYPAD_R") & (1 << keylatch)) ef -= EF4;
313   if (input_port_read(device->machine, "KEYPAD_L") & (1 << keylatch)) ef -= EF3;
314   if (input_port_read(device->machine, "KEYPAD_R") & (1 << keylatch)) ef -= EF4;
315315
316316   return ef;
317317}
r3654r3655
323323
324324static CDP1802_DMA_WRITE( studio2_dma_w )
325325{
326   const device_config *cdp1861 = device_list_find_by_tag(machine->config->devicelist, CDP1861, CDP1861_TAG);
326   const device_config *cdp1861 = devtag_get_device(device->machine, CDP1861, CDP1861_TAG);
327327
328328   cdp1861_dma_w(cdp1861, data);
329329}
r3654r3655
344344
345345   if (cdp1864_efx) ef -= EF1;
346346
347   if (input_port_read(machine, "KEYPAD_L") & (1 << keylatch)) ef -= EF3;
348   if (input_port_read(machine, "KEYPAD_R") & (1 << keylatch)) ef -= EF4;
347   if (input_port_read(device->machine, "KEYPAD_L") & (1 << keylatch)) ef -= EF3;
348   if (input_port_read(device->machine, "KEYPAD_R") & (1 << keylatch)) ef -= EF4;
349349
350350   return ef;
351351}
352352
353353static CDP1802_DMA_WRITE( mpt02_dma_w )
354354{
355   const device_config *cdp1864 = device_list_find_by_tag(machine->config->devicelist, CDP1864, CDP1864_TAG);
355   const device_config *cdp1864 = devtag_get_device(device->machine, CDP1864, CDP1864_TAG);
356356
357357   UINT8 color = colorram[ma / 4]; // 0x04 = R, 0x02 = B, 0x01 = G
358358
r3654r3655
384384
385385static MACHINE_RESET( studio2 )
386386{
387   const device_config *cdp1861 = device_list_find_by_tag(machine->config->devicelist, CDP1861, CDP1861_TAG);
387   const device_config *cdp1861 = devtag_get_device(machine, CDP1861, CDP1861_TAG);
388   
388389   cdp1861->reset(cdp1861);
389390}
390391
r3654r3655
397398
398399static MACHINE_RESET( mpt02 )
399400{
400   const device_config *cdp1864 = device_list_find_by_tag(machine->config->devicelist, CDP1864, CDP1864_TAG);
401   const device_config *cdp1864 = devtag_get_device(machine, CDP1864, CDP1864_TAG);
402   
401403   cdp1864->reset(cdp1864);
402404
403405   cpu_set_input_line(machine->cpu[0], INPUT_LINE_RESET, PULSE_LINE);
src/mess/drivers/bw2.c
r3654r3655
236236   UINT8 ramcard_bank = data & 0x0f;
237237   UINT32 bank_offset = ramcard_bank * 0x8000;
238238
239   if ((get_ramdisk_size(machine) == 256) && (ramcard_bank > 7))
239   if ((get_ramdisk_size(space->machine) == 256) && (ramcard_bank > 7))
240240   {
241      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x7fff, 0, 0, SMH_UNMAP, SMH_UNMAP);
241      memory_install_readwrite8_handler(cpu_get_address_space(space->machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x7fff, 0, 0, SMH_UNMAP, SMH_UNMAP);
242242   }
243243   else
244244   {
245      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1);
245      memory_install_readwrite8_handler(cpu_get_address_space(space->machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1);
246246   }
247247
248   memory_configure_bank(machine, 1, BANK_RAMCARD_RAM, 1, ramcard_ram + bank_offset, 0);
249   memory_set_bank(machine, 1, bank);
248   memory_configure_bank(space->machine, 1, BANK_RAMCARD_RAM, 1, ramcard_ram + bank_offset, 0);
249   memory_set_bank(space->machine, 1, bank);
250250}
251251
252252/* Serial */
r3654r3655
318318         break;
319319
320320      case WD17XX_DRQ_SET:
321         if (cpunum_get_reg(0, Z80_HALT))
321         if (cpu_get_reg(machine->cpu[0], Z80_HALT))
322322         {
323323            cpu_set_input_line(machine->cpu[0], INPUT_LINE_NMI, HOLD_LINE);
324324         }
r3654r3655
330330{
331331   UINT8 result = 0xff;
332332
333   switch(offset & 0x03)
333   switch (offset & 0x03)
334334   {
335335      case 0:
336         result = wd17xx_status_r(machine, 0);
336         result = wd17xx_status_r(space, 0);
337337         break;
338338      case 1:
339         result = wd17xx_track_r(machine, 0);
339         result = wd17xx_track_r(space, 0);
340340         break;
341341      case 2:
342         result = wd17xx_sector_r(machine, 0);
342         result = wd17xx_sector_r(space, 0);
343343         break;
344344      case 3:
345         result = wd17xx_data_r(machine, 0);
345         result = wd17xx_data_r(space, 0);
346346         break;
347347   }
348348
r3654r3655
351351
352352static WRITE8_HANDLER( bw2_wd2797_w )
353353{
354   switch(offset & 0x3)
354   switch (offset & 0x3)
355355   {
356356      case 0:
357357         /* disk side is encoded in bit 1 of Type II/III commands */
r3654r3655
368368            }
369369         }
370370
371         wd17xx_command_w(machine, 0, data);
371         wd17xx_command_w(space, 0, data);
372372
373373         break;
374374      case 1:
375         wd17xx_track_w(machine, 0, data);
375         wd17xx_track_w(space, 0, data);
376376         break;
377377      case 2:
378         wd17xx_sector_w(machine, 0, data);
378         wd17xx_sector_w(space, 0, data);
379379         break;
380380      case 3:
381         wd17xx_data_w(machine, 0, data);
381         wd17xx_data_w(space, 0, data);
382382         break;
383383   };
384384}
r3654r3655
616616      memory_configure_bank(machine, 1, BANK_RAM6, 1, mess_ram + 0x18000, 0);
617617      memory_configure_bank(machine, 1, BANK_ROM, 1, memory_region(machine, "ic1"), 0);
618618
619      memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x30, 0x30, 0, 0x0f, &ramcard_bank_w);
619      memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x30, 0x30, 0, 0x0f, &ramcard_bank_w);
620620   }
621621   else
622622   {
r3654r3655
627627      memory_configure_bank(machine, 1, BANK_RAM2, 5, mess_ram + 0x8000, 0x8000);
628628      memory_configure_bank(machine, 1, BANK_ROM, 1, memory_region(machine, "ic1"), 0);
629629
630      memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x30, 0x30, 0, 0x0f, SMH_UNMAP);
630      memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x30, 0x30, 0, 0x0f, SMH_UNMAP);
631631   }
632632
633633   memory_set_bank(machine, 1, BANK_ROM);
src/mess/drivers/ql.c
r3654r3655
3838*/
3939
4040#include "driver.h"
41#include "includes/ql.h"
4142#include "cpu/mcs48/mcs48.h"
4243#include "cpu/m68000/m68000.h"
4344#include "devices/basicdsk.h"
r3654r3655
4950#include "video/zx8301.h"
5051#include "machine/zx8302.h"
5152
52#define SCREEN_TAG   "main"
53#define ZX8301_TAG   "ic22"
54#define ZX8302_TAG   "ic23"
55#define MDV1_TAG   "mdv1"
56#define MDV2_TAG   "mdv2"
57
58#define X1 XTAL_15MHz
59#define X2 XTAL_32_768kHz
60#define X3 XTAL_4_436MHz
61#define X4 XTAL_11MHz
62
6353static QUICKLOAD_LOAD( ql );
6454
6555/* Intelligent Peripheral Controller (IPC) */
6656
67static struct IPC
68{
69   UINT8 keylatch;
70   int ser1_txd, ser1_dtr;
71   int ser2_rxd, ser2_cts;
72   int ipl;
73   int comctl, comdata;
74   int baudx4;
75} ipc;
76
7757static WRITE8_HANDLER( ipc_w )
7858{
59   ql_state *state = space->machine->driver_data;
60
7961   // pulse COMCTL line
8062
81   const device_config *zx8302 = device_list_find_by_tag(space->machine->config->devicelist, ZX8302, ZX8302_TAG);
82
83   zx8302_comctl_w(zx8302, 0);
84   zx8302_comctl_w(zx8302, 1);
63   zx8302_comctl_w(state->zx8302, 0);
64   zx8302_comctl_w(state->zx8302, 1);
8565}
8666
8767static WRITE8_HANDLER( ipc_port1_w )
r3654r3655
10181
10282    */
10383
104   ipc.keylatch = data;
84   ql_state *state = space->machine->driver_data;
85
86   state->keylatch = data;
10587}
10688
10789static WRITE8_HANDLER( ipc_port2_w )
r3654r3655
121103
122104    */
123105
124   const device_config *zx8302 = device_list_find_by_tag(space->machine->config->devicelist, ZX8302, ZX8302_TAG);
106   ql_state *state = space->machine->driver_data;
125107
126108   int ipl = (BIT(data, 2) << 1) | BIT(data, 3);
127109
128   if (ipl != ipc.ipl)
110   if (ipl != state->ipl)
129111   {
130112      switch (ipl)
131113      {
132114      case 0:
133         cpu_set_input_line(space->machine->cpu[0], M68K_IRQ_2, CLEAR_LINE);
134         cpu_set_input_line(space->machine->cpu[0], M68K_IRQ_5, CLEAR_LINE);
135         cpu_set_input_line(space->machine->cpu[0], M68K_IRQ_7, HOLD_LINE);
115         cpu_set_input_line(space->machine->cpu[0], M68K_IRQ_7, ASSERT_LINE);
136116         break;
137117
138118      case 1:
139119         // CTRL-ALT-7 pressed
140         cpu_set_input_line(space->machine->cpu[0], M68K_IRQ_2, CLEAR_LINE);
141         cpu_set_input_line(space->machine->cpu[0], M68K_IRQ_5, HOLD_LINE);
142         cpu_set_input_line(space->machine->cpu[0], M68K_IRQ_7, CLEAR_LINE);
120         cpu_set_input_line(space->machine->cpu[0], M68K_IRQ_5, ASSERT_LINE);
143121         break;
144122
145123      case 2:
146         cpu_set_input_line(space->machine->cpu[0], M68K_IRQ_2, HOLD_LINE);
147         cpu_set_input_line(space->machine->cpu[0], M68K_IRQ_5, CLEAR_LINE);
148         cpu_set_input_line(space->machine->cpu[0], M68K_IRQ_7, CLEAR_LINE);
124         cpu_set_input_line(space->machine->cpu[0], M68K_IRQ_2, ASSERT_LINE);
149125         break;
150126
151127      case 3:
152         cpu_set_input_line(space->machine->cpu[0], M68K_IRQ_2, CLEAR_LINE);
153         cpu_set_input_line(space->machine->cpu[0], M68K_IRQ_5, CLEAR_LINE);
154128         cpu_set_input_line(space->machine->cpu[0], M68K_IRQ_7, CLEAR_LINE);
155129         break;
156130      }
157131
158      ipc.ipl = ipl;
132      state->ipl = ipl;
159133   }
160134
161135   speaker_level_w(0, BIT(data, 1));
162136
163   ipc.ser2_cts = BIT(data, 4);
164   ipc.ser1_dtr = BIT(data, 5);
137   state->ser2_cts = BIT(data, 4);
138   state->ser1_dtr = BIT(data, 5);
165139
166   ipc.comdata = BIT(data, 7);
140   state->comdata = BIT(data, 7);
167141
168   zx8302_comdata_w(zx8302, BIT(data, 7));
142   zx8302_comdata_w(state->zx8302, BIT(data, 7));
169143}
170144
171145static READ8_HANDLER( ipc_port2_r )
r3654r3655
185159
186160    */
187161
188   int irq = (ipc.ser2_rxd | ipc.ser1_txd);
162   ql_state *state = space->machine->driver_data;
189163
164   int irq = (state->ser2_rxd | state->ser1_txd);
165
190166   cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_IRQ0, irq);
191167
192   return (ipc.comdata << 7) | irq;
168   return (state->comdata << 7) | irq;
193169}
194170
195171static READ8_HANDLER( ipc_t1_r )
196172{
197   return ipc.baudx4;
173   ql_state *state = space->machine->driver_data;
174
175   return state->baudx4;
198176}
199177
200178static READ8_HANDLER( ipc_bus_r )
201179{
180   ql_state *state = space->machine->driver_data;
181
202182   /*
203183
204184        bit     description
r3654r3655
216196
217197   UINT8 data = 0;
218198
219   if (BIT(ipc.keylatch, 0)) data |= input_port_read(space->machine, "ROW0") | input_port_read(space->machine, "JOY0");
220   if (BIT(ipc.keylatch, 1)) data |= input_port_read(space->machine, "ROW1") | input_port_read(space->machine, "JOY1");
221   if (BIT(ipc.keylatch, 2)) data |= input_port_read(space->machine, "ROW2");
222   if (BIT(ipc.keylatch, 3)) data |= input_port_read(space->machine, "ROW3");
223   if (BIT(ipc.keylatch, 4)) data |= input_port_read(space->machine, "ROW4");
224   if (BIT(ipc.keylatch, 5)) data |= input_port_read(space->machine, "ROW5");
225   if (BIT(ipc.keylatch, 6)) data |= input_port_read(space->machine, "ROW6");
226   if (BIT(ipc.keylatch, 7)) data |= input_port_read(space->machine, "ROW7");
199   if (BIT(state->keylatch, 0)) data |= input_port_read(space->machine, "ROW0") | input_port_read(space->machine, "JOY0");
200   if (BIT(state->keylatch, 1)) data |= input_port_read(space->machine, "ROW1") | input_port_read(space->machine, "JOY1");
201   if (BIT(state->keylatch, 2)) data |= input_port_read(space->machine, "ROW2");
202   if (BIT(state->keylatch, 3)) data |= input_port_read(space->machine, "ROW3");
203   if (BIT(state->keylatch, 4)) data |= input_port_read(space->machine, "ROW4");
204   if (BIT(state->keylatch, 5)) data |= input_port_read(space->machine, "ROW5");
205   if (BIT(state->keylatch, 6)) data |= input_port_read(space->machine, "ROW6");
206   if (BIT(state->keylatch, 7)) data |= input_port_read(space->machine, "ROW7");
227207
228208   return data;
229209}
r3654r3655
489469
490470static ZX8301_ON_VSYNC_CHANGED( ql_vsync_w )
491471{
492   const device_config *zx8302 = device_list_find_by_tag(device->machine->config->devicelist, ZX8302, ZX8302_TAG);
472   ql_state *state = device->machine->driver_data;
493473
494   zx8302_vsync_w(zx8302, level);
474   zx8302_vsync_w(state->zx8302, level);
495475}
496476
497477static ZX8301_RAM_READ( ql_ram_r )
r3654r3655
522502
523503static ZX8302_ON_BAUDX4_CHANGED( ql_baudx4_w )
524504{
525   ipc.baudx4 = level;
505   ql_state *state = device->machine->driver_data;
506
507   state->baudx4 = level;
526508}
527509
528510static ZX8302_COMDATA_WRITE( ql_comdata_w )
529511{
530   ipc.comdata = level;
512   ql_state *state = device->machine->driver_data;
513
514   state->comdata = level;
531515}
532516
533517static ZX8302_INTERFACE( ql_zx8302_intf )
r3654r3655
543527
544528static VIDEO_UPDATE( ql )
545529{
546   const device_config *zx8301 = device_list_find_by_tag(screen->machine->config->devicelist, ZX8301, ZX8301_TAG);
530   ql_state *state = screen->machine->driver_data;
547531
548   zx8301_update(zx8301, bitmap, cliprect);
532   zx8301_update(state->zx8301, bitmap, cliprect);
549533
550534   return 0;
551535}
r3654r3655
554538
555539static MACHINE_START( ql )
556540{
541   ql_state *state = machine->driver_data;
542
543   const address_space *program = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
544
557545   /* configure ROM cartridge */
558546
559   memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x00c000, 0x00ffff, 0, 0, SMH_UNMAP, SMH_UNMAP);
547   memory_install_readwrite8_handler(program, 0x00c000, 0x00ffff, 0, 0, SMH_UNMAP, SMH_UNMAP);
560548   memory_configure_bank(machine, 1, 0, 1, memory_region(machine, "main") + 0x00c000, 0);
561549   memory_set_bank(machine, 1, 0);
562550
r3654r3655
565553   switch (mess_ram_size)
566554   {
567555   case 128*1024:
568      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x040000, 0x0fffff, 0, 0, SMH_UNMAP, SMH_UNMAP);
556      memory_install_readwrite8_handler(program, 0x040000, 0x0fffff, 0, 0, SMH_UNMAP, SMH_UNMAP);
569557      break;
570558
571559   case 192*1024:
572      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x040000, 0x04ffff, 0, 0, SMH_BANK2, SMH_BANK2);
573      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x050000, 0x0fffff, 0, 0, SMH_UNMAP, SMH_UNMAP);
560      memory_install_readwrite8_handler(program, 0x040000, 0x04ffff, 0, 0, SMH_BANK2, SMH_BANK2);
561      memory_install_readwrite8_handler(program, 0x050000, 0x0fffff, 0, 0, SMH_UNMAP, SMH_UNMAP);
574562      break;
575563
576564   case 256*1024:
577      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x040000, 0x05ffff, 0, 0, SMH_BANK2, SMH_BANK2);
578      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x060000, 0x0fffff, 0, 0, SMH_UNMAP, SMH_UNMAP);
565      memory_install_readwrite8_handler(program, 0x040000, 0x05ffff, 0, 0, SMH_BANK2, SMH_BANK2);
566      memory_install_readwrite8_handler(program, 0x060000, 0x0fffff, 0, 0, SMH_UNMAP, SMH_UNMAP);
579567      break;
580568
581569   case 384*1024:
582      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x040000, 0x07ffff, 0, 0, SMH_BANK2, SMH_BANK2);
583      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x080000, 0x0fffff, 0, 0, SMH_UNMAP, SMH_UNMAP);
570      memory_install_readwrite8_handler(program, 0x040000, 0x07ffff, 0, 0, SMH_BANK2, SMH_BANK2);
571      memory_install_readwrite8_handler(program, 0x080000, 0x0fffff, 0, 0, SMH_UNMAP, SMH_UNMAP);
584572      break;
585573
586574   case 640*1024:
587      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x040000, 0x0bffff, 0, 0, SMH_BANK2, SMH_BANK2);
588      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0c0000, 0x0fffff, 0, 0, SMH_UNMAP, SMH_UNMAP);
575      memory_install_readwrite8_handler(program, 0x040000, 0x0bffff, 0, 0, SMH_BANK2, SMH_BANK2);
576      memory_install_readwrite8_handler(program, 0x0c0000, 0x0fffff, 0, 0, SMH_UNMAP, SMH_UNMAP);
589577      break;
590578
591579   case 896*1024:
592      memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x040000, 0x0fffff, 0, 0, SMH_BANK2, SMH_BANK2);
580      memory_install_readwrite8_handler(program, 0x040000, 0x0fffff, 0, 0, SMH_BANK2, SMH_BANK2);
593581      break;
594582   }
595583
596584   memory_configure_bank(machine, 2, 0, 1, memory_region(machine, "main") + 0x050000, 0);
597585   memory_set_bank(machine, 2, 0);
598586
599   // IPC
587   // find devices
600588
601   state_save_register_global(ipc.keylatch);
602   state_save_register_global(ipc.ser1_txd);
603   state_save_register_global(ipc.ser1_dtr);
604   state_save_register_global(ipc.ser2_rxd);
605   state_save_register_global(ipc.ser2_cts);
606   state_save_register_global(ipc.ipl);
607   state_save_register_global(ipc.comdata);
608   state_save_register_global(ipc.comctl);
609   state_save_register_global(ipc.baudx4);
589   state->zx8301 = devtag_get_device(machine, ZX8301, ZX8301_TAG);
590   state->zx8302 = devtag_get_device(machine, ZX8302, ZX8302_TAG);
610591
611   memset(&ipc, 0, sizeof(ipc));
592   // register for state saving
593
594   state_save_register_global(state->keylatch);
595   state_save_register_global(state->ser1_txd);
596   state_save_register_global(state->ser1_dtr);
597   state_save_register_global(state->ser2_rxd);
598   state_save_register_global(state->ser2_cts);
599   state_save_register_global(state->ipl);
600   state_save_register_global(state->comdata);
601   state_save_register_global(state->comctl);
602   state_save_register_global(state->baudx4);
612603}
613604
614605static MACHINE_DRIVER_START( ql )
606   MDRV_DRIVER_DATA(ql_state)
607
615608   // basic machine hardware
609
616610   MDRV_CPU_ADD("main", M68008, X1/2)
617611   MDRV_CPU_PROGRAM_MAP(ql_map, 0)
618612
r3654r3655
653647MACHINE_DRIVER_END
654648
655649static MACHINE_DRIVER_START( opd )
650   MDRV_DRIVER_DATA(ql_state)
651
656652   // basic machine hardware
657653   MDRV_CPU_ADD("main", M68008, 7500000)
658654   MDRV_CPU_PROGRAM_MAP(ql_map, 0)
r3654r3655
663659
664660static MACHINE_DRIVER_START( ql_ntsc )
665661   MDRV_IMPORT_FROM(ql)
662
666663   MDRV_SCREEN_MODIFY("main")
667664   MDRV_SCREEN_REFRESH_RATE(60)
668665   MDRV_SCREEN_SIZE(960, 262)
r3654r3655
867864   {
868865      if (image_fread(image, ptr, filesize) == filesize)
869866      {
870         memory_install_readwrite8_handler(cpu_get_address_space(image->machine->cpu[0],ADDRESS_SPACE_PROGRAM), 0x00c000, 0x00ffff, 0, 0, SMH_BANK1, SMH_UNMAP);
867         memory_install_readwrite8_handler(cpu_get_address_space(image->machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x00c000, 0x00ffff, 0, 0, SMH_BANK1, SMH_UNMAP);
871868
872869         return INIT_PASS;
873870      }
src/mess/drivers/tmc2000e.c
r3654r3655
3030*/
3131
3232#include "driver.h"
33#include "includes/tmc2000e.h"
3334#include "cpu/cdp1802/cdp1802.h"
3435#include "devices/printer.h"
3536#include "devices/basicdsk.h"
r3654r3655
3839#include "sound/beep.h"
3940#include "machine/rescap.h"
4041
41#define SCREEN_TAG "main"
42#define CDP1864_TAG "cdp1864"
43
4442static const device_config *cassette_device_image(running_machine *machine)
4543{
46   return device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette" );
44   return devtag_get_device(machine, CASSETTE, "cassette");
4745}
4846
4947/* Read/Write Handlers */
r3654r3655
8482{
8583}
8684
87static int keylatch;
88
8985static WRITE8_HANDLER( keyboard_latch_w )
9086{
91   keylatch = data;
87   tmc2000e_state *state = space->machine->driver_data;
88
89   state->keylatch = data;
9290}
9391
9492/* Memory Maps */
r3654r3655
9694static ADDRESS_MAP_START( tmc2000e_map, ADDRESS_SPACE_PROGRAM, 8 )
9795   AM_RANGE(0x0000, 0x1fff) AM_RAM
9896   AM_RANGE(0xc000, 0xdfff) AM_ROM
99   AM_RANGE(0xfc00, 0xffff) AM_WRITEONLY AM_BASE(&colorram)
97   AM_RANGE(0xfc00, 0xffff) AM_WRITEONLY AM_BASE_MEMBER(tmc2000e_state, colorram)
10098ADDRESS_MAP_END
10199
102100static ADDRESS_MAP_START( tmc2000e_io_map, ADDRESS_SPACE_IO, 8 )
r3654r3655
132130
133131/* Video */
134132
135static int cdp1864_efx;
136
137133static CDP1864_ON_INT_CHANGED( tmc2000e_int_w )
138134{
139135   cpu_set_input_line(device->machine->cpu[0], CDP1802_INPUT_LINE_INT, level);
r3654r3655
146142
147143static CDP1864_ON_EFX_CHANGED( tmc2000e_efx_w )
148144{
149   cdp1864_efx = level;
145   tmc2000e_state *state = device->machine->driver_data;
146
147   state->cdp1864_efx = level;
150148}
151149
152150static CDP1864_INTERFACE( tmc2000e_cdp1864_intf )
r3654r3655
165163
166164static VIDEO_UPDATE( tmc2000e )
167165{
168   const device_config *cdp1864 = device_list_find_by_tag(screen->machine->config->devicelist, CDP1864, CDP1864_TAG);
166   tmc2000e_state *state = screen->machine->driver_data;
169167
170   cdp1864_update(cdp1864, bitmap, cliprect);
168   cdp1864_update(state->cdp1864, bitmap, cliprect);
171169
172170   return 0;
173171}
r3654r3655
176174
177175static CDP1802_MODE_READ( tmc2000e_mode_r )
178176{
179   if (input_port_read(machine, "RUN") & 0x01)
177   if (input_port_read(device->machine, "RUN") & 0x01)
180178   {
181179      return CDP1802_MODE_RUN;
182180   }
r3654r3655
188186
189187static CDP1802_EF_READ( tmc2000e_ef_r )
190188{
189   tmc2000e_state *state = device->machine->driver_data;
190
191191   UINT8 flags = 0x0f;
192192   static const char *keynames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" };
193193
r3654r3655
200200
201201   // CDP1864
202202
203   if (!cdp1864_efx) flags -= EF1;
203   if (!state->cdp1864_efx) flags -= EF1;
204204
205205   // tape in
206206
207   if (cassette_input(cassette_device_image(machine)) > +1.0) flags -= EF2;
207   if (cassette_input(cassette_device_image(device->machine)) > +1.0) flags -= EF2;
208208   
209209   // keyboard
210210
211   if (~input_port_read(machine, keynames[keylatch / 8]) & (1 << (keylatch % 8))) flags -= EF3;
211   if (~input_port_read(device->machine, keynames[state->keylatch / 8]) & (1 << (state->keylatch % 8))) flags -= EF3;
212212
213213   return flags;
214214}
215215
216216static CDP1802_Q_WRITE( tmc2000e_q_w )
217217{
218   const device_config *cdp1864 = device_list_find_by_tag(machine->config->devicelist, CDP1864, CDP1864_TAG);
218   tmc2000e_state *state = device->machine->driver_data;
219219
220220   // turn CDP1864 sound generator on/off
221221
222   cdp1864_aoe_w(cdp1864, level);
222   cdp1864_aoe_w(state->cdp1864, level);
223223
224224   // set Q led status
225225
r3654r3655
227227
228228   // tape out
229229
230   cassette_output(cassette_device_image(machine), level ? -1.0 : +1.0);
230   cassette_output(cassette_device_image(device->machine), level ? -1.0 : +1.0);
231231
232232   // floppy control (FDC-6)
233233}
234234
235235static CDP1802_DMA_WRITE( tmc2000e_dma_w )
236236{
237   const device_config *cdp1864 = device_list_find_by_tag(machine->config->devicelist, CDP1864, CDP1864_TAG);
237   tmc2000e_state *state = device->machine->driver_data;
238238
239   UINT8 color = (colorram[ma & 0x3ff]) & 0x07; // 0x04 = R, 0x02 = B, 0x01 = G
239   UINT8 color = (state->colorram[ma & 0x3ff]) & 0x07; // 0x04 = R, 0x02 = B, 0x01 = G
240240   
241241   int rdata = BIT(color, 2);
242242   int gdata = BIT(color, 0);
243243   int bdata = BIT(color, 1);
244244
245   cdp1864_dma_w(cdp1864, data, ASSERT_LINE, rdata, gdata, bdata);
245   cdp1864_dma_w(state->cdp1864, data, ASSERT_LINE, rdata, gdata, bdata);
246246}
247247
248248static CDP1802_INTERFACE( tmc2000e_config )
r3654r3655
259259
260260static MACHINE_START( tmc2000e )
261261{
262   state_save_register_global(keylatch);
262   tmc2000e_state *state = machine->driver_data;
263
264   /* allocate color RAM */
265
266   state->colorram = auto_malloc(TMC2000E_COLORRAM_SIZE);
267
268   /* find devices */
269
270   state->cdp1864 = devtag_get_device(machine, CDP1864, CDP1864_TAG);
271
272   /* register for state saving */
273
274   state_save_register_global_pointer(state->colorram, TMC2000E_COLORRAM_SIZE);
275   state_save_register_global(state->cdp1864_efx);
276   state_save_register_global(state->keylatch);
263277}
264278
265279static MACHINE_RESET( tmc2000e )
266280{
267   const device_config *cdp1864 = device_list_find_by_tag(machine->config->devicelist, CDP1864, CDP1864_TAG);
268   cdp1864->reset(cdp1864);
281   tmc2000e_state *state = machine->driver_data;
269282
283   state->cdp1864->reset(state->cdp1864);
284
270285   cpu_set_input_line(machine->cpu[0], INPUT_LINE_RESET, PULSE_LINE);
271286
272287   // reset program counter to 0xc000
r3654r3655
282297};
283298
284299static MACHINE_DRIVER_START( tmc2000e )
300   MDRV_DRIVER_DATA(tmc2000e_state)
301
285302   // basic system hardware
286303
287304   MDRV_CPU_ADD("main", CDP1802, XTAL_1_75MHz)
src/mess/drivers/tmc1800.c
r3654r3655
138138
139139static const device_config *cassette_device_image(running_machine *machine)
140140{
141   return device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette" );
141   return devtag_get_device(machine, CASSETTE, "cassette");
142142}
143143
144144/* Read/Write Handlers */
145145
146146static WRITE8_HANDLER( tmc1800_keylatch_w )
147147{
148   tmc1800_state *state = machine->driver_data;
148   tmc1800_state *state = space->machine->driver_data;
149149
150150   state->keylatch = data;
151151}
r3654r3655
167167
168168   */
169169
170   tmc2000_state *state = machine->driver_data;
170   tmc2000_state *state = space->machine->driver_data;
171171
172172   state->keylatch = data & 0x3f;
173173}
r3654r3655
189189
190190   */
191191
192   oscnano_state *state = machine->driver_data;
192   oscnano_state *state = space->machine->driver_data;
193193
194194   state->keylatch = data & 0x0f;
195195}
r3654r3655
200200
201201   /* enable RAM */
202202
203   memory_set_bank(machine, 1, TMC2000_BANK_RAM);
203   memory_set_bank(device->machine, 1, TMC2000_BANK_RAM);
204204
205205   switch (mess_ram_size)
206206   {
207207   case 4 * 1024:
208      memory_install_readwrite8_handler(device->machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0x7000, SMH_BANK1, SMH_BANK1);
208      memory_install_readwrite8_handler(cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x0fff, 0, 0x7000, SMH_BANK1, SMH_BANK1);
209209      break;
210210
211211   case 16 * 1024:
212      memory_install_readwrite8_handler(device->machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0x4000, SMH_BANK1, SMH_BANK1);
212      memory_install_readwrite8_handler(cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x3fff, 0, 0x4000, SMH_BANK1, SMH_BANK1);
213213      break;
214214
215215   case 32 * 1024:
216      memory_install_readwrite8_handler(device->machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1);
216      memory_install_readwrite8_handler(cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1);
217217      break;
218218   }
219219
220220   /* enable monitor or color RAM */
221221
222   memory_set_bank(machine, 2, bank);
222   memory_set_bank(device->machine, 2, bank);
223223
224224   switch (bank)
225225   {
226226   case TMC2000_BANK_MONITOR:
227      memory_install_readwrite8_handler(device->machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x81ff, 0, 0x7e00, SMH_BANK2, SMH_UNMAP);
227      memory_install_readwrite8_handler(cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x8000, 0x81ff, 0, 0x7e00, SMH_BANK2, SMH_UNMAP);
228228      break;
229229
230230   case TMC2000_BANK_COLORRAM: // write-only
231      memory_install_readwrite8_handler(device->machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x81ff, 0, 0x7e00, SMH_UNMAP, SMH_BANK2);
231      memory_install_readwrite8_handler(cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x8000, 0x81ff, 0, 0x7e00, SMH_UNMAP, SMH_BANK2);
232232      break;
233233   }
234234
r3654r3655
241241{
242242   /* enable RAM */
243243
244   memory_set_bank(machine, 1, OSCNANO_BANK_RAM);
244   memory_set_bank(device->machine, 1, OSCNANO_BANK_RAM);
245245
246   memory_install_readwrite8_handler(device->machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x0fff, 0, 0x7000, SMH_BANK1, SMH_BANK1);
246   memory_install_readwrite8_handler(cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x0fff, 0, 0x7000, SMH_BANK1, SMH_BANK1);
247247
248248   /* write to CDP1864 tone latch */
249249
r3654r3655
428428
429429static CDP1802_MODE_READ( tmc1800_mode_r )
430430{
431   tmc1800_state *state = machine->driver_data;
431   tmc1800_state *state = device->machine->driver_data;
432432
433   if (input_port_read(machine, "RUN") & 0x01)
433   if (input_port_read(device->machine, "RUN") & 0x01)
434434   {
435435      if (state->reset)
436436      {
437         running_machine *machine = device->machine;
437438         MACHINE_RESET_CALL(tmc2000);
438439
439440         state->reset = 0;
r3654r3655
451452
452453static CDP1802_EF_READ( tmc1800_ef_r )
453454{
454   tmc1800_state *state = machine->driver_data;
455   tmc1800_state *state = device->machine->driver_data;
455456
456457   UINT8 flags = 0x0f;
457458   static const char *keynames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" };
r3654r3655
467468   if (state->cdp1861_efx) flags -= EF1;
468469
469470   /* tape input */
470   if (cassette_input(cassette_device_image(machine)) < 0) flags -= EF2;
471   if (cassette_input(cassette_device_image(device->machine)) < 0) flags -= EF2;
471472
472473   /* keyboard */
473   if (~input_port_read(machine, keynames[state->keylatch / 8]) & (1 << (state->keylatch % 8))) flags -= EF3;
474   if (~input_port_read(device->machine, keynames[state->keylatch / 8]) & (1 << (state->keylatch % 8))) flags -= EF3;
474475
475476   return flags;
476477}
r3654r3655
478479static CDP1802_Q_WRITE( tmc1800_q_w )
479480{
480481   /* tape output */
481   cassette_output(cassette_device_image(machine), level ? 1.0 : -1.0);
482   cassette_output(cassette_device_image(device->machine), level ? 1.0 : -1.0);
482483}
483484
484485static CDP1802_DMA_WRITE( tmc1800_dma_w )
485486{
486   const device_config *cdp1861 = device_list_find_by_tag(machine->config->devicelist, CDP1861, CDP1861_TAG);
487   tmc1800_state *state = device->machine->driver_data;
487488
488   cdp1861_dma_w(cdp1861, data);
489   cdp1861_dma_w(state->cdp1861, data);
489490}
490491
491492static CDP1802_INTERFACE( tmc1800_config )
r3654r3655
512513
513514static CDP1802_MODE_READ( tmc2000_mode_r )
514515{
515   tmc2000_state *state = machine->driver_data;
516   tmc2000_state *state = device->machine->driver_data;
516517
517   if (input_port_read(machine, "RUN") & 0x01)
518   if (input_port_read(device->machine, "RUN") & 0x01)
518519   {
519520      if (state->reset)
520521      {
522         running_machine *machine = device->machine;
521523         MACHINE_RESET_CALL(tmc2000);
522524
523525         state->reset = 0;
r3654r3655
535537
536538static CDP1802_EF_READ( tmc2000_ef_r )
537539{
538   tmc2000_state *state = machine->driver_data;
540   tmc2000_state *state = device->machine->driver_data;
539541
540542   int flags = 0x0f;
541543   static const char *keynames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" };
r3654r3655
551553   if (state->cdp1864_efx) flags -= EF1;
552554
553555   /* tape input */
554   if (cassette_input(cassette_device_image(machine)) < 0) flags -= EF2;
556   if (cassette_input(cassette_device_image(device->machine)) < 0) flags -= EF2;
555557
556558   /* keyboard */
557   if (~input_port_read(machine, keynames[state->keylatch / 8]) & (1 << (state->keylatch % 8))) flags -= EF3;
559   if (~input_port_read(device->machine, keynames[state->keylatch / 8]) & (1 << (state->keylatch % 8))) flags -= EF3;
558560
559561   return flags;
560562}
561563
562564static CDP1802_Q_WRITE( tmc2000_q_w )
563565{
564   const device_config *cdp1864 = device_list_find_by_tag(machine->config->devicelist, CDP1864, CDP1864_TAG);
566   tmc2000_state *state = device->machine->driver_data;
565567
566568   /* CDP1864 audio output enable */
567   cdp1864_aoe_w(cdp1864, level);
569   cdp1864_aoe_w(state->cdp1864, level);
568570
569571   /* set Q led status */
570572   set_led_status(1, level);
571573
572574   /* tape output */
573   cassette_output(cassette_device_image(machine), level ? 1.0 : -1.0);
575   cassette_output(cassette_device_image(device->machine), level ? 1.0 : -1.0);
574576}
575577
576578static CDP1802_DMA_WRITE( tmc2000_dma_w )
577579{
578   tmc2000_state *state = machine->driver_data;
580   tmc2000_state *state = device->machine->driver_data;
579581
580   const device_config *cdp1864 = device_list_find_by_tag(machine->config->devicelist, CDP1864, CDP1864_TAG);
581
582582   UINT8 color = ~(state->colorram[ma & 0x1ff]) & 0x07;
583583   
584584   int rdata = BIT(color, 2);
585585   int gdata = BIT(color, 0);
586586   int bdata = BIT(color, 1);
587587
588   cdp1864_dma_w(cdp1864, data, ASSERT_LINE, rdata, gdata, bdata);
588   cdp1864_dma_w(state->cdp1864, data, ASSERT_LINE, rdata, gdata, bdata);
589589}
590590
591591static CDP1802_INTERFACE( tmc2000_config )
r3654r3655
610610
611611static CDP1802_MODE_READ( oscnano_mode_r )
612612{
613   oscnano_state *state = machine->driver_data;
613   oscnano_state *state = device->machine->driver_data;
614614
615   int run = input_port_read(machine, "RUN") & 0x01;
616   int monitor = input_port_read(machine, "MONITOR") & 0x01;
615   int run = input_port_read(device->machine, "RUN") & 0x01;
616   int monitor = input_port_read(device->machine, "MONITOR") & 0x01;
617617
618618   if (run && monitor)
619619   {
620620      if (state->reset)
621621      {
622         running_machine *machine = device->machine;
622623         MACHINE_RESET_CALL(oscnano);
623624
624625         state->reset = 0;
r3654r3655
648649
649650static CDP1802_EF_READ( oscnano_ef_r )
650651{
651   oscnano_state *state = machine->driver_data;
652   oscnano_state *state = device->machine->driver_data;
652653
653654   static const char *keynames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" };
654655
r3654r3655
665666   if (state->cdp1864_efx) flags -= EF1;
666667
667668   /* tape input */
668   if (cassette_input(cassette_device_image(machine)) < 0) flags -= EF2;
669   if (cassette_input(cassette_device_image(device->machine)) < 0) flags -= EF2;
669670
670671   /* keyboard */
671   if (~input_port_read(machine, keynames[state->keylatch / 8]) & (1 << (state->keylatch % 8))) flags -= EF3;
672   if (~input_port_read(device->machine, keynames[state->keylatch / 8]) & (1 << (state->keylatch % 8))) flags -= EF3;
672673
673674   /* monitor */
674675   if (state->monitor_ef4) flags -= EF4;
r3654r3655
678679
679680static CDP1802_Q_WRITE( oscnano_q_w )
680681{
681   const device_config *cdp1864 = device_list_find_by_tag(machine->config->devicelist, CDP1864, CDP1864_TAG);
682   oscnano_state *state = device->machine->driver_data;
682683
683684   /* CDP1864 audio output enable */
684   cdp1864_aoe_w(cdp1864, level);
685   cdp1864_aoe_w(state->cdp1864, level);
685686
686687   /* set Q led status */
687688   set_led_status(1, level);
688689
689690   /* tape output */
690   cassette_output(cassette_device_image(machine), level ? 1.0 : -1.0);
691   cassette_output(cassette_device_image(device->machine), level ? 1.0 : -1.0);
691692}
692693
693694static CDP1802_DMA_WRITE( oscnano_dma_w )
694695{
695   const device_config *cdp1864 = device_list_find_by_tag(machine->config->devicelist, CDP1864, CDP1864_TAG);
696   oscnano_state *state = device->machine->driver_data;
696697
697   cdp1864_dma_w(cdp1864, data, CLEAR_LINE, 1, 1, 1);
698   cdp1864_dma_w(state->cdp1864, data, CLEAR_LINE, 1, 1, 1);
698699}
699700
700701static CDP1802_INTERFACE( oscnano_config )
r3654r3655
715716{
716717   tmc1800_state *state = machine->driver_data;
717718
719   /* find devices */
720
721   state->cdp1861 = devtag_get_device(machine, CDP1861, CDP1861_TAG);
722
718723   /* register for state saving */
719724
720725   state_save_register_global(state->cdp1861_efx);
r3654r3655
724729
725730static MACHINE_RESET( tmc1800 )
726731{
732   tmc1800_state *state = machine->driver_data;
733
727734   /* reset CDP1864 */
728735
729   const device_config *cdp1861 = device_list_find_by_tag(machine->config->devicelist, CDP1861, CDP1861_TAG);
730   cdp1861->reset(cdp1861);
736   state->cdp1861->reset(state->cdp1861);
731737}
732738
733739// OSCOM 1000B
r3654r3655
738744
739745   /* register for state saving */
740746
741   state_save_register_global(state->cdp1861_efx);
742747   state_save_register_global(state->keylatch);
743748   state_save_register_global(state->reset);
744749}
r3654r3655
773778      state->colorram[addr] = mame_rand(machine) & 0xff;
774779   }
775780
781   /* find devices */
782
783   state->cdp1864 = devtag_get_device(machine, CDP1864, CDP1864_TAG);
784
776785   /* register for state saving */
777786
778787   state_save_register_global_pointer(state->colorram, TMC2000_COLORRAM_SIZE);
r3654r3655
785794{
786795   /* reset CDP1864 */
787796
788   const device_config *cdp1864 = device_list_find_by_tag(machine->config->devicelist, CDP1864, CDP1864_TAG);
797   const device_config *cdp1864 = devtag_get_device(machine, CDP1864, CDP1864_TAG);
789798   cdp1864->reset(cdp1864);
790799
791800   /* enable monitor mirror at 0x0000 */
r3654r3655
819828   
820829   state->monitor_ef4 = 1;
821830
831   /* find devices */
832
833   state->cdp1864 = devtag_get_device(machine, CDP1864, CDP1864_TAG);
834
822835   /* register for state saving */
823836
824837   state_save_register_global(state->monitor_ef4);
r3654r3655
829842
830843static MACHINE_RESET( oscnano )
831844{
845   oscnano_state *state = machine->driver_data;
846
832847   /* reset CDP1864 */
833848
834   const device_config *cdp1864 = device_list_find_by_tag(machine->config->devicelist, CDP1864, CDP1864_TAG);
835   cdp1864->reset(cdp1864);
849   state->cdp1864->reset(state->cdp1864);
836850
837851   /* enable ROM */
838852
src/mess/drivers/newbrain.c
r3654r3655
9595
9696   */
9797
98   newbrain_state *state = machine->driver_data;
98   newbrain_state *state = space->machine->driver_data;
9999
100100   //logerror("ENRG1: %02x\n", data);
101101
r3654r3655
119119
120120   */
121121
122   newbrain_state *state = machine->driver_data;
122   newbrain_state *state = space->machine->driver_data;
123123
124124   state->enrg1 = data;
125125}
r3654r3655
141141
142142   */
143143
144   newbrain_state *state = machine->driver_data;
144   newbrain_state *state = space->machine->driver_data;
145145
146146   UINT8 data = (state->copint << 7) | (state->aciaint << 6) | (state->clkint << 5) | (state->userint << 4);
147147
r3654r3655
224224
225225   */
226226
227   newbrain_state *state = machine->driver_data;
227   newbrain_state *state = space->machine->driver_data;
228228
229229   return (state->copint << 7) | (state->clkint << 5) | (state->pwrup << 1) | 0x01;
230230}
r3654r3655
246246
247247   */
248248
249   newbrain_state *state = machine->driver_data;
249   newbrain_state *state = space->machine->driver_data;
250250
251251   state->user = 0;
252252
r3654r3655
255255
256256static WRITE8_HANDLER( user_w )
257257{
258   newbrain_state *state = machine->driver_data;
258   newbrain_state *state = space->machine->driver_data;
259259
260260   state->user = data;
261261}
r3654r3655
264264
265265static READ8_HANDLER( clclk_r )
266266{
267   newbrain_state *state = machine->driver_data;
267   newbrain_state *state = space->machine->driver_data;
268268
269269   state->clkint = 1;
270270
r3654r3655
273273
274274static WRITE8_HANDLER( clclk_w )
275275{
276   newbrain_state *state = machine->driver_data;
276   newbrain_state *state = space->machine->driver_data;
277277
278278   state->clkint = 1;
279279}
280280
281281static READ8_HANDLER( clusr_r )
282282{
283   newbrain_state *state = machine->driver_data;
283   newbrain_state *state = space->machine->driver_data;
284284
285285   state->userint = 1;
286286
r3654r3655
289289
290290static WRITE8_HANDLER( clusr_w )
291291{
292   newbrain_state *state = machine->driver_data;
292   newbrain_state *state = space->machine->driver_data;
293293
294294   state->userint = 1;
295295}
r3654r3655
300300{
301301   // connected to the Z80 data bus
302302
303   newbrain_state *state = machine->driver_data;
303   newbrain_state *state = space->machine->driver_data;
304304
305305   return state->cop_bus;
306306}
r3654r3655
309309{
310310   // connected to the Z80 data bus
311311
312   newbrain_state *state = machine->driver_data;
312   newbrain_state *state = space->machine->driver_data;
313313
314314   state->cop_bus = data;
315315}
r3654r3655
327327
328328   */
329329
330   newbrain_state *state = machine->driver_data;
330   newbrain_state *state = space->machine->driver_data;
331331
332   cpu_set_input_line(machine->cpu[0], INPUT_LINE_IRQ0, BIT(data, 0) ? HOLD_LINE : CLEAR_LINE);
332   cpu_set_input_line(space->machine->cpu[0], INPUT_LINE_IRQ0, BIT(data, 0) ? HOLD_LINE : CLEAR_LINE);
333333
334334   state->copint = BIT(data, 0);
335335
336336   /* tape motor enable */
337337
338   cassette_change_state(cassette_device_image(machine, 0), BIT(data, 1) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
339   cassette_change_state(cassette_device_image(machine, 1), BIT(data, 3) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
338   cassette_change_state(cassette_device_image(space->machine, 0), BIT(data, 1) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
339   cassette_change_state(cassette_device_image(space->machine, 1), BIT(data, 3) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
340340}
341341
342342static READ8_HANDLER( newbrain_cop_g_r )
r3654r3655
352352
353353   */
354354
355   newbrain_state *state = machine->driver_data;
355   newbrain_state *state = space->machine->driver_data;
356356
357357   return (BIT(state->keydata, 3) << 3) | (BIT(state->keydata, 0) << 2) | (BIT(state->keydata, 1) << 1);
358358}
r3654r3655
370370
371371   */
372372
373   newbrain_state *state = machine->driver_data;
373   newbrain_state *state = space->machine->driver_data;
374374   static const char *keynames[] = { "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
375375                              "D8", "D9", "D10", "D11", "D12", "D13", "D14", "D15" };
376376
r3654r3655
385385
386386   state->cop_tdo = BIT(data, 1);
387387
388   cassette_output(cassette_device_image(machine, 0), state->cop_tdo ? -1.0 : +1.0);
389   cassette_output(cassette_device_image(machine, 1), state->cop_tdo ? -1.0 : +1.0);
388   cassette_output(cassette_device_image(space->machine, 0), state->cop_tdo ? -1.0 : +1.0);
389   cassette_output(cassette_device_image(space->machine, 1), state->cop_tdo ? -1.0 : +1.0);
390390
391391   /* keyboard and display clock */
392392
r3654r3655
399399         state->keylatch = 0;
400400      }
401401
402      state->keydata = input_port_read(machine, keynames[state->keylatch]);
402      state->keydata = input_port_read(space->machine, keynames[state->keylatch]);
403403
404404      output_set_digit_value(state->keylatch, state->segment_data[state->keylatch]);
405405   }
r3654r3655
418418
419419   */
420420
421   newbrain_state *state = machine->driver_data;
421   newbrain_state *state = space->machine->driver_data;
422422
423423   return (state->cop_rd << 3) | (state->cop_access << 2) | (state->cop_rd << 1) | BIT(state->keydata, 2);
424424}
r3654r3655
427427{
428428   // connected to K1
429429
430   newbrain_state *state = machine->driver_data;
430   newbrain_state *state = space->machine->driver_data;
431431
432432   state->cop_so = data;
433433}
r3654r3655
436436{
437437   // connected to K2
438438
439   newbrain_state *state = machine->driver_data;
439   newbrain_state *state = space->machine->driver_data;
440440
441441   state->segment_data[state->keylatch] >>= 1;
442442   state->segment_data[state->keylatch] = (state->cop_so << 15) | (state->segment_data[state->keylatch] & 0x7fff);
r3654r3655
446446{
447447   // connected to TDI
448448
449   newbrain_state *state = machine->driver_data;
449   newbrain_state *state = space->machine->driver_data;
450450
451   state->cop_tdi = ((cassette_input(cassette_device_image(machine, 0)) > +1.0) || (cassette_input(cassette_device_image(machine, 1)) > +1.0)) ^ state->cop_tdo;
451   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;
452452
453453   return state->cop_tdi;
454454}
r3654r3655
489489
490490static READ8_HANDLER( tvl_r )
491491{
492   newbrain_state *state = machine->driver_data;
492   newbrain_state *state = space->machine->driver_data;
493493
494494   if (offset)
495495   {
r3654r3655
505505
506506static WRITE8_HANDLER( tvl_w )
507507{
508   newbrain_state *state = machine->driver_data;
508   newbrain_state *state = space->machine->driver_data;
509509
510510   if (offset)
511511   {
r3654r3655
534534
535535   */
536536
537   newbrain_state *state = machine->driver_data;
537   newbrain_state *state = space->machine->driver_data;
538538
539539   state->tvctl = data;
540540}
r3654r3655
561561   floppy_drive_set_motor_state(image_from_devtype_and_index(IO_FLOPPY, 0), BIT(data, 0));
562562   floppy_drive_set_ready_state(image_from_devtype_and_index(IO_FLOPPY, 0), 1, 0);
563563
564   nec765_set_reset_state(machine, BIT(data, 1));
564   nec765_set_reset_state(space->machine, BIT(data, 1));
565565
566   nec765_set_tc_state(machine, BIT(data, 2));
566   nec765_set_tc_state(space->machine, BIT(data, 2));
567567}
568568
569569static READ8_HANDLER( fdc_control_r )
r3654r3655
583583
584584   */
585585
586   newbrain_state *state = machine->driver_data;
586   newbrain_state *state = space->machine->driver_data;
587587
588588   return (state->fdc_att << 7) | (state->paging << 6) | (state->fdc_int << 5);
589589}
r3654r3655
610610
611611static READ8_HANDLER( cop_r )
612612{
613   newbrain_state *state = machine->driver_data;
613   newbrain_state *state = space->machine->driver_data;
614614   UINT8 data;
615615
616616   state->cop_rd = 0;
r3654r3655
628628
629629static WRITE8_HANDLER( cop_w )
630630{
631   newbrain_state *state = machine->driver_data;
631   newbrain_state *state = space->machine->driver_data;
632632
633633   state->cop_rd = 1;
634634   state->cop_wr = 0;
r3654r3655
660660
661661   */
662662
663   newbrain_state *state = machine->driver_data;
663   newbrain_state *state = space->machine->driver_data;
664664
665665   state->enrg2 = data;
666666}
r3654r3655
675675
676676static READ8_HANDLER( ei_user_r )
677677{
678   newbrain_state *state = machine->driver_data;
678   newbrain_state *state = space->machine->driver_data;
679679
680680   state->user = 0xff;
681681
r3654r3655
684684
685685static WRITE8_HANDLER( ei_user_w )
686686{
687   newbrain_state *state = machine->driver_data;
687   newbrain_state *state = space->machine->driver_data;
688688
689689   state->user = data;
690690}
r3654r3655
727727
728728   */
729729
730   newbrain_state *state = machine->driver_data;
730   newbrain_state *state = space->machine->driver_data;
731731
732732   return (state->copint << 7) | (state->aciaint << 6) | (state->clkint << 5) | (state->userint << 4) | (state->userint0 << 3) | (state->pwrup) << 1;
733733}
r3654r3655
749749
750750   */
751751
752   newbrain_state *state = machine->driver_data;
752   newbrain_state *state = space->machine->driver_data;
753753
754754   return (state->tvcnsl << 6) | 0x10 | 0x08 | 0x04;
755755}
r3654r3655
785785
786786static WRITE8_HANDLER( ei_paging_w )
787787{
788   newbrain_state *state = machine->driver_data;
788   newbrain_state *state = space->machine->driver_data;
789789
790790   state->paging = data;
791791
r3654r3655
827827
828828      */
829829
830      cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, BIT(data, 5) ? HOLD_LINE : CLEAR_LINE);
830      cpu_set_input_line(space->machine->cpu[2], INPUT_LINE_RESET, BIT(data, 5) ? HOLD_LINE : CLEAR_LINE);
831831
832832      state->fdc_att = BIT(data, 7);
833833   }
r3654r3655
954954   AM_RANGE(0x1c, 0x1c) AM_MIRROR(0xffc0) AM_DEVREADWRITE(Z80CTC, "z80ctc", z80ctc_r, z80ctc_w)
955955ADDRESS_MAP_END
956956
957static ADDRESS_MAP_START( newbrain_cop_map, ADDRESS_SPACE_PROGRAM, 8 )
958   AM_RANGE(0x000, 0x3ff) AM_ROM
959ADDRESS_MAP_END
960
961957static ADDRESS_MAP_START( newbrain_cop_io_map, ADDRESS_SPACE_IO, 8 )
962958   AM_RANGE(COP400_PORT_L, COP400_PORT_L) AM_READWRITE(newbrain_cop_l_r, newbrain_cop_l_w)
963959   AM_RANGE(COP400_PORT_G, COP400_PORT_G) AM_READWRITE(newbrain_cop_g_r, newbrain_cop_g_w)
r3654r3655
11521148
11531149   for (bank = 1; bank < 9; bank++)
11541150   {
1155      memory_configure_bank(bank, 0, 1, memory_region(machine, Z80_TAG) + (bank - 1) * 0x2000, 0);
1156      memory_set_bank(bank, 0);
1151      memory_configure_bank(machine, bank, 0, 1, memory_region(machine, Z80_TAG) + (bank - 1) * 0x2000, 0);
1152      memory_set_bank(machine, bank, 0);
11571153   }
11581154}
11591155
r3654r3655
11661162
11671163   for (bank = 1; bank < 9; bank++)
11681164   {
1169      memory_configure_bank(bank, 0, 1, memory_region(machine, Z80_TAG) + 0xe000, 0);
1170      memory_set_bank(bank, 0);
1165      memory_configure_bank(machine, bank, 0, 1, memory_region(machine, Z80_TAG) + 0xe000, 0);
1166      memory_set_bank(machine, bank, 0);
11711167   }
11721168
11731169   /* initialize devices */
r3654r3655
12111207
12121208static INTERRUPT_GEN( newbrain_interrupt )
12131209{
1214   newbrain_state *state = machine->driver_data;
1210   newbrain_state *state = device->machine->driver_data;
12151211   
12161212   if (!(state->enrg1 & NEWBRAIN_ENRG1_CLK))
12171213   {
1218      cpu_set_input_line(machine->cpu[0], INPUT_LINE_IRQ0, HOLD_LINE);
1214      cpu_set_input_line(device->machine->cpu[0], INPUT_LINE_IRQ0, HOLD_LINE);
12191215
12201216      state->clkint = 0;
12211217   }
r3654r3655
12491245   MDRV_CPU_VBLANK_INT(SCREEN_TAG, newbrain_interrupt)
12501246
12511247   MDRV_CPU_ADD(COP420_TAG, COP420, XTAL_16MHz/8) // COP420-GUW/M
1252   MDRV_CPU_PROGRAM_MAP(newbrain_cop_map, 0)
12531248   MDRV_CPU_IO_MAP(newbrain_cop_io_map, 0)
12541249   MDRV_CPU_CONFIG(newbrain_cop_intf)
12551250
r3654r3655
12861281   MDRV_CPU_VBLANK_INT(SCREEN_TAG, newbrain_interrupt)
12871282
12881283   MDRV_CPU_ADD(COP420_TAG, COP420, XTAL_16MHz/8) // COP420-GUW/M
1289   MDRV_CPU_PROGRAM_MAP(newbrain_cop_map, 0)
12901284   MDRV_CPU_IO_MAP(newbrain_cop_io_map, 0)
12911285   MDRV_CPU_CONFIG(newbrain_cop_intf)
12921286
r3654r3655
13141308   MDRV_CPU_VBLANK_INT(SCREEN_TAG, newbrain_interrupt)
13151309
13161310   MDRV_CPU_ADD(COP420_TAG, COP420, XTAL_16MHz/8) // COP420-GUW/M
1317   MDRV_CPU_PROGRAM_MAP(newbrain_cop_map, 0)
13181311   MDRV_CPU_IO_MAP(newbrain_cop_io_map, 0)
13191312   MDRV_CPU_CONFIG(newbrain_cop_intf)
13201313
r3654r3655
13401333   MDRV_CPU_VBLANK_INT(SCREEN_TAG, newbrain_interrupt)
13411334
13421335   MDRV_CPU_ADD(COP420_TAG, COP420, XTAL_16MHz/8) // COP420-GUW/M
1343   MDRV_CPU_PROGRAM_MAP(newbrain_cop_map, 0)
13441336   MDRV_CPU_IO_MAP(newbrain_cop_io_map, 0)
13451337   MDRV_CPU_CONFIG(newbrain_cop_intf)
13461338
src/mess/drivers/comx35.c
r3654r3655
204204
205205static CDP1802_MODE_READ( comx35_mode_r )
206206{
207   comx35_state *state = machine->driver_data;
207   comx35_state *state = device->machine->driver_data;
208208
209209   return state->cdp1802_mode;
210210}
211211
212212static CDP1802_EF_READ( comx35_ef_r )
213213{
214   comx35_state *state = machine->driver_data;
214   comx35_state *state = device->machine->driver_data;
215215
216216   int flags = 0x0f;
217217
r3654r3655
240240   if (!state->cdp1871_efxa) flags -= EF3;
241241
242242   // cassette input, expansion device flag
243   if ((cassette_input(cassette_device_image(machine)) < +0.0) || !state->cdp1802_ef4) flags -= EF4;
243   if ((cassette_input(cassette_device_image(device->machine)) < +0.0) || !state->cdp1802_ef4) flags -= EF4;
244244
245245   return flags;
246246}
247247
248248static CDP1802_SC_WRITE( comx35_sc_w )
249249{
250   comx35_state *driver_state = machine->driver_data;
250   comx35_state *driver_state = device->machine->driver_data;
251251
252252   switch (state)
253253   {
r3654r3655
263263
264264         if (!driver_state->iden)
265265         {
266            cpu_set_input_line(machine->cpu[0], CDP1802_INPUT_LINE_DMAOUT, HOLD_LINE);
266            cpu_set_input_line(device->machine->cpu[0], CDP1802_INPUT_LINE_DMAOUT, HOLD_LINE);
267267         }
268268      }
269269      else
r3654r3655
274274
275275   case CDP1802_STATE_CODE_S2_DMA:
276276      // DMA acknowledge clears the DMAOUT request
277      cpu_set_input_line(machine->cpu[0], CDP1802_INPUT_LINE_DMAOUT, CLEAR_LINE);
277      cpu_set_input_line(device->machine->cpu[0], CDP1802_INPUT_LINE_DMAOUT, CLEAR_LINE);
278278      break;
279279
280280   case CDP1802_STATE_CODE_S3_INTERRUPT:
281281      // interrupt acknowledge clears the INT request
282      cpu_set_input_line(machine->cpu[0], CDP1802_INPUT_LINE_INT, CLEAR_LINE);
282      cpu_set_input_line(device->machine->cpu[0], CDP1802_INPUT_LINE_INT, CLEAR_LINE);
283283      break;
284284   }
285285}
286286
287287static CDP1802_Q_WRITE( comx35_q_w )
288288{
289   comx35_state *state = machine->driver_data;
289   comx35_state *state = device->machine->driver_data;
290290
291291   state->cdp1802_q = level;
292292
r3654r3655
297297   }
298298
299299   // cassette output
300   cassette_output(cassette_device_image(machine), level ? +1.0 : -1.0);
300   cassette_output(cassette_device_image(device->machine), level ? +1.0 : -1.0);
301301}
302302
303303static CDP1802_INTERFACE( comx35_cdp1802_config )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team