Previous 15994 Revisions Next

r3364 Wednesday 1st October, 2008 at 19:44:48 UTC by Curt Coder
[ABC80X] Looked up devices in machine start, fixed memory leak in ABC77.
[src/mess/drivers]abc80x.c
[src/mess/includes]abc80x.h
[src/mess/machine]abc77.c
[src/mess/video]abc806.c abc80x.c

src/mess/video/abc80x.c
r3363r3364
205205
206206static MC6845_ON_VSYNC_CHANGED(abc800_vsync_changed)
207207{
208   const device_config *z80dart = device_list_find_by_tag(device->machine->config->devicelist, Z80DART, "z80dart");
208   abc800_state *state = device->machine->driver_data;
209209
210   z80dart_set_ri(z80dart, 1, vsync);
210   z80dart_set_ri(state->z80dart, 1, vsync);
211211}
212212
213213static MC6845_UPDATE_ROW( abc800c_update_row )
r3363r3364
309309
310310static MC6845_ON_VSYNC_CHANGED(abc802_vsync_changed)
311311{
312   const device_config *z80dart = device_list_find_by_tag(device->machine->config->devicelist, Z80DART, "z80dart");
312   abc802_state *state = device->machine->driver_data;
313313
314   z80dart_set_ri(z80dart, 1, vsync);
314   z80dart_set_ri(state->z80dart, 1, vsync);
315315}
316316
317317/* MC6845 Interfaces */
r3363r3364
356356
357357static VIDEO_START( abc800 )
358358{
359   abc800_state *state = machine->driver_data;
360
361   /* find devices */
362
363   state->mc6845 = device_list_find_by_tag(machine->config->devicelist, MC6845, MC6845_TAG);
359364}
360365
361366static VIDEO_START( abc802 )
362367{
363368   abc802_state *state = machine->driver_data;
364369
370   /* find devices */
371
372   state->mc6845 = device_list_find_by_tag(machine->config->devicelist, MC6845, MC6845_TAG);
373
365374   /* allocate timer */
366375
367376   state->flash_timer = timer_alloc(abc802_flash_tick, NULL);
r3363r3364
377386
378387static VIDEO_UPDATE( abc800m )
379388{
380   const device_config *mc6845 = device_list_find_by_tag(screen->machine->config->devicelist, MC6845, MC6845_TAG);
389   abc800_state *state = screen->machine->driver_data;
381390   
382   mc6845_update(mc6845, bitmap, cliprect);
391   mc6845_update(state->mc6845, bitmap, cliprect);
383392   
384393   return 0;
385394}
386395
387396static VIDEO_UPDATE( abc800c )
388397{
389   const device_config *mc6845 = device_list_find_by_tag(screen->machine->config->devicelist, MC6845, MC6845_TAG);
398   abc800_state *state = screen->machine->driver_data;
390399   
391   mc6845_update(mc6845, bitmap, cliprect);
400   mc6845_update(state->mc6845, bitmap, cliprect);
392401   
393402   return 0;
394403}
395404
396405static VIDEO_UPDATE( abc802 )
397406{
398   const device_config *mc6845 = device_list_find_by_tag(screen->machine->config->devicelist, MC6845, MC6845_TAG);
407   abc802_state *state = screen->machine->driver_data;
399408   
400   mc6845_update(mc6845, bitmap, cliprect);
409   mc6845_update(state->mc6845, bitmap, cliprect);
401410   
402411   return 0;
403412}
src/mess/video/abc806.c
r3363r3364
337337{
338338   abc806_state *state = device->machine->driver_data;
339339   
340   const device_config *z80dart = device_list_find_by_tag(device->machine->config->devicelist, Z80DART, "z80dart");
341 
342340   if (vsync)
343341   {
344342      state->v50_addr = 0;
345343   }
346344 
347   z80dart_set_ri(z80dart, 1, vsync);
345   z80dart_set_ri(state->z80dart, 1, vsync);
348346}
349347 
350348/* MC6845 Interfaces */
r3363r3364
424422 
425423   state->sync = 10;
426424 
425   /* find devices */
426 
427   state->mc6845 = device_list_find_by_tag(machine->config->devicelist, MC6845, MC6845_TAG);
428 
427429   /* allocate memory */
428430 
429431   state->charram = auto_malloc(ABC806_CHAR_RAM_SIZE);
r3363r3364
456458 
457459static VIDEO_UPDATE( abc806 )
458460{
459   const device_config *mc6845 = device_list_find_by_tag(screen->machine->config->devicelist, MC6845, MC6845_TAG);
460 
461   abc806_state *state = screen->machine->driver_data;
462   
461463   abc806_hr_update(screen->machine, bitmap, cliprect);
462   mc6845_update(mc6845, bitmap, cliprect);
464   mc6845_update(state->mc6845, bitmap, cliprect);
463465   
464466   return 0;
465467}
src/mess/includes/abc80x.h
r3363r3364
2121#define ABC806_VIDEO_RAM_SIZE   0x20000
2222
2323#define SCREEN_TAG   "main"
24#define Z80_TAG      "z80"
2425#define E0516_TAG   "j13"
2526#define MC6845_TAG   "b12"
27#define Z80CTC_TAG   "z80ctc"
28#define Z80SIO_TAG   "z80sio"
29#define Z80DART_TAG   "z80dart"
2630
2731#define ABC800_CHAR_WIDTH   6
2832#define ABC800_CCLK         ABC800_X01/ABC800_CHAR_WIDTH
r3363r3364
3539
3640   /* timers */
3741   emu_timer *ctc_timer;
42
43   /* devices */
44   const device_config *z80ctc;
45   const device_config *z80dart;
46   const device_config *z80sio;
47   const device_config *mc6845;
3848};
3949
4050typedef struct _abc802_state abc802_state;
r3363r3364
5060   /* timers */
5161   emu_timer *ctc_timer;
5262   emu_timer *flash_timer;
63
64   /* devices */
65   const device_config *z80ctc;
66   const device_config *z80dart;
67   const device_config *z80sio;
68   const device_config *mc6845;
5369};
5470
5571typedef struct _abc806_state abc806_state;
r3363r3364
8298   /* timers */
8399   emu_timer *ctc_timer;
84100   emu_timer *flash_timer;
101
102   /* devices */
103   const device_config *z80ctc;
104   const device_config *z80dart;
105   const device_config *z80sio;
106   const device_config *mc6845;
85107};
86108
87109/*----------- defined in video/abc80x.c -----------*/
src/mess/machine/abc77.c
r3363r3364
325325 
326326   astring_printf(tempstring, "%s:%s", device->tag, I8035_TAG);
327327   abc77->cpunum = mame_find_cpu_index(device->machine, astring_c(tempstring));
328   astring_free(tempstring);
328329 
329330   /* allocate timer */
330331 
src/mess/drivers/abc80x.c
r3363r3364
116116         UINT16 start_addr = 0x1000 * (bank - 1);
117117         UINT16 end_addr = start_addr + 0xfff;
118118         
119         logerror("%04x-%04x: Video RAM bank %u (32K)\n", start_addr, end_addr, videoram_bank);
119         //logerror("%04x-%04x: Video RAM bank %u (32K)\n", start_addr, end_addr, videoram_bank);
120120
121121         memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, start_addr, end_addr, 0, 0, SMH_BANK(bank), SMH_BANK(bank));
122122         memory_set_bank(bank, videoram_bank + 1);
r3363r3364
131131         UINT16 start_addr = 0x1000 * (bank - 1);
132132         UINT16 end_addr = start_addr + 0xfff;
133133         
134         logerror("%04x-%04x: Work RAM (32K)\n", start_addr, end_addr);
134         //logerror("%04x-%04x: Work RAM (32K)\n", start_addr, end_addr);
135135
136136         memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, start_addr, end_addr, 0, 0, SMH_BANK(bank), SMH_BANK(bank));
137137         memory_set_bank(bank, 0);
r3363r3364
152152            /* map to video RAM */
153153            int videoram_bank = map & 0x1f;
154154
155            logerror("%04x-%04x: Video RAM bank %u (4K)\n", start_addr, end_addr, videoram_bank);
155            //logerror("%04x-%04x: Video RAM bank %u (4K)\n", start_addr, end_addr, videoram_bank);
156156
157157            memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, start_addr, end_addr, 0, 0, SMH_BANK(bank), SMH_BANK(bank));
158158            memory_set_bank(bank, videoram_bank + 1);
r3363r3364
165165            {
166166            case 1: case 2: case 3: case 4: case 5: case 6: case 7:
167167               /* ROM */
168               logerror("%04x-%04x: ROM (4K)\n", start_addr, end_addr);
168               //logerror("%04x-%04x: ROM (4K)\n", start_addr, end_addr);
169169
170170               memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, start_addr, end_addr, 0, 0, SMH_BANK(bank), SMH_UNMAP);
171171               memory_set_bank(bank, 0);
r3363r3364
173173
174174            case 8:
175175               /* ROM/char RAM */
176               logerror("%04x-%04x: ROM (4K)\n", start_addr, end_addr);
176               //logerror("%04x-%04x: ROM (4K)\n", start_addr, end_addr);
177177
178178               memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7000, 0x77ff, 0, 0, SMH_BANK(bank), SMH_UNMAP);
179179               memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7800, 0x7fff, 0, 0, abc806_charram_r, abc806_charram_w);
r3363r3364
182182
183183            default:
184184               /* work RAM */
185               logerror("%04x-%04x: Work RAM (4K)\n", start_addr, end_addr);
185               //logerror("%04x-%04x: Work RAM (4K)\n", start_addr, end_addr);
186186
187187               memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, start_addr, end_addr, 0, 0, SMH_BANK(bank), SMH_BANK(bank));
188188               memory_set_bank(bank, 0);
r3363r3364
204204         UINT16 start_addr = 0x1000 * (bank - 1);
205205         UINT16 end_addr = start_addr + 0xfff;
206206         
207         logerror("%04x-%04x: Video RAM bank %u (30K)\n", start_addr, end_addr, videoram_bank);
207         //logerror("%04x-%04x: Video RAM bank %u (30K)\n", start_addr, end_addr, videoram_bank);
208208
209209         if (start_addr == 0x7000)
210210         {
r3363r3364
245245      6
246246      7      allocate block
247247
248      - extended 128KB memory is divided into 32 physical blocks of 4KB each
249      - logical CPU address space is divided into 16 logical blocks of 4KB each
250      - extended blocks can be allocated to the logical blocks
251      - logical address is provided by the offset (e.g write to port 0xc034 -> address 0xc000)
252
253248   */
254249
255250   abc806_state *state = machine->driver_data;
r3363r3364
299294   }
300295}
301296
302// Z80 DART
297// Z80 DART (SIO/0)
303298
304299static READ8_DEVICE_HANDLER( dart_r )
305300{
r3363r3364
356351   AM_RANGE(0x02, 0x05) AM_MIRROR(0x18) AM_WRITE(abcbus_command_w)
357352   AM_RANGE(0x06, 0x06) AM_MIRROR(0x18) AM_WRITE(abc800m_hrs_w)
358353   AM_RANGE(0x07, 0x07) AM_MIRROR(0x18) AM_READWRITE(abcbus_reset_r, abc800m_hrc_w)
359   AM_RANGE(0x20, 0x23) AM_MIRROR(0x0c) AM_DEVREADWRITE(Z80DART, "z80dart", dart_r, dart_w)
354   AM_RANGE(0x20, 0x23) AM_MIRROR(0x0c) AM_DEVREADWRITE(Z80DART, Z80DART_TAG, dart_r, dart_w)
360355   AM_RANGE(0x30, 0x32) AM_WRITE(abc800_ram_ctrl_w)
361356   AM_RANGE(0x31, 0x31) AM_MIRROR(0x06) AM_DEVREAD(MC6845, MC6845_TAG, mc6845_register_r)
362357   AM_RANGE(0x38, 0x38) AM_MIRROR(0x06) AM_DEVWRITE(MC6845, MC6845_TAG, mc6845_address_w)
363358   AM_RANGE(0x39, 0x39) AM_MIRROR(0x06) AM_DEVWRITE(MC6845, MC6845_TAG, mc6845_register_w)
364   AM_RANGE(0x40, 0x43) AM_MIRROR(0x1c) AM_DEVREADWRITE(Z80SIO, "z80sio", sio2_r, sio2_w)
365   AM_RANGE(0x50, 0x53) AM_MIRROR(0x1c) AM_DEVREADWRITE(Z80CTC, "z80ctc", z80ctc_r, z80ctc_w)
359   AM_RANGE(0x40, 0x43) AM_MIRROR(0x1c) AM_DEVREADWRITE(Z80SIO, Z80SIO_TAG, sio2_r, sio2_w)
360   AM_RANGE(0x50, 0x53) AM_MIRROR(0x1c) AM_DEVREADWRITE(Z80CTC, Z80CTC_TAG, z80ctc_r, z80ctc_w)
366361   AM_RANGE(0x80, 0x80) AM_MIRROR(0x7f) AM_READWRITE(abcbus_strobe_r, abcbus_strobe_w)
367362ADDRESS_MAP_END
368363
r3363r3364
384379   AM_RANGE(0x02, 0x05) AM_MIRROR(0x18) AM_WRITE(abcbus_command_w)
385380   AM_RANGE(0x06, 0x06) AM_MIRROR(0x18) AM_WRITE(abc800c_hrs_w)
386381   AM_RANGE(0x07, 0x07) AM_MIRROR(0x18) AM_READWRITE(abcbus_reset_r, abc800c_hrc_w)
387   AM_RANGE(0x20, 0x23) AM_MIRROR(0x0c) AM_DEVREADWRITE(Z80DART, "z80dart", dart_r, dart_w)
382   AM_RANGE(0x20, 0x23) AM_MIRROR(0x0c) AM_DEVREADWRITE(Z80DART, Z80DART_TAG, dart_r, dart_w)
388383   AM_RANGE(0x30, 0x32) AM_WRITE(abc800_ram_ctrl_w)
389384   AM_RANGE(0x31, 0x31) AM_MIRROR(0x06) AM_DEVREAD(MC6845, MC6845_TAG, mc6845_register_r)
390385   AM_RANGE(0x38, 0x38) AM_MIRROR(0x06) AM_DEVWRITE(MC6845, MC6845_TAG, mc6845_address_w)
391386   AM_RANGE(0x39, 0x39) AM_MIRROR(0x06) AM_DEVWRITE(MC6845, MC6845_TAG, mc6845_register_w)
392   AM_RANGE(0x40, 0x43) AM_MIRROR(0x1c) AM_DEVREADWRITE(Z80SIO, "z80sio", sio2_r, sio2_w)
393   AM_RANGE(0x50, 0x53) AM_MIRROR(0x1c) AM_DEVREADWRITE(Z80CTC, "z80ctc", z80ctc_r, z80ctc_w)
387   AM_RANGE(0x40, 0x43) AM_MIRROR(0x1c) AM_DEVREADWRITE(Z80SIO, Z80SIO_TAG, sio2_r, sio2_w)
388   AM_RANGE(0x50, 0x53) AM_MIRROR(0x1c) AM_DEVREADWRITE(Z80CTC, Z80CTC_TAG, z80ctc_r, z80ctc_w)
394389   AM_RANGE(0x80, 0x80) AM_MIRROR(0x7f) AM_READWRITE(abcbus_strobe_r, abcbus_strobe_w)
395390ADDRESS_MAP_END
396391
r3363r3364
410405   AM_RANGE(0x01, 0x01) AM_READWRITE(abcbus_status_r, abcbus_channel_w)
411406   AM_RANGE(0x02, 0x05) AM_WRITE(abcbus_command_w)
412407   AM_RANGE(0x07, 0x07) AM_READ(abcbus_reset_r)
413   AM_RANGE(0x20, 0x23) AM_DEVREADWRITE(Z80DART, "z80dart", dart_r, dart_w)
408   AM_RANGE(0x20, 0x23) AM_DEVREADWRITE(Z80DART, Z80DART_TAG, dart_r, dart_w)
414409   AM_RANGE(0x31, 0x31) AM_DEVREAD(MC6845, MC6845_TAG, mc6845_register_r)
415   AM_RANGE(0x32, 0x35) AM_DEVREADWRITE(Z80SIO, "z80sio", sio2_r, sio2_w)
410   AM_RANGE(0x32, 0x35) AM_DEVREADWRITE(Z80SIO, Z80SIO_TAG, sio2_r, sio2_w)
416411   AM_RANGE(0x38, 0x38) AM_DEVWRITE(MC6845, MC6845_TAG, mc6845_address_w)
417412   AM_RANGE(0x39, 0x39) AM_DEVWRITE(MC6845, MC6845_TAG, mc6845_register_w)
418   AM_RANGE(0x60, 0x63) AM_DEVREADWRITE(Z80CTC, "z80ctc", z80ctc_r, z80ctc_w)
413   AM_RANGE(0x60, 0x63) AM_DEVREADWRITE(Z80CTC, Z80CTC_TAG, z80ctc_r, z80ctc_w)
419414   AM_RANGE(0x80, 0xff) AM_READWRITE(abcbus_strobe_r, abcbus_strobe_w)
420415ADDRESS_MAP_END
421416
r3363r3364
449444   AM_RANGE(0x02, 0x05) AM_MIRROR(0xff18) AM_WRITE(abcbus_command_w)
450445   AM_RANGE(0x06, 0x06) AM_MIRROR(0xff18) AM_WRITE(abc806_hrs_w)
451446   AM_RANGE(0x07, 0x07) AM_MIRROR(0xff18) AM_READWRITE(abcbus_reset_r, abc806_hrc_w)
452   AM_RANGE(0x20, 0x23) AM_MIRROR(0xff0c) AM_DEVREADWRITE(Z80DART, "z80dart", dart_r, dart_w)
447   AM_RANGE(0x20, 0x23) AM_MIRROR(0xff0c) AM_DEVREADWRITE(Z80DART, Z80DART_TAG, dart_r, dart_w)
453448   AM_RANGE(0x31, 0x31) AM_MIRROR(0xff06) AM_DEVREAD(MC6845, MC6845_TAG, mc6845_register_r)
454449   AM_RANGE(0x34, 0x34) AM_MIRROR(0xff00) AM_MASK(0xff00) AM_READWRITE(abc806_mai_r, abc806_mao_w)
455450   AM_RANGE(0x35, 0x35) AM_MIRROR(0xff00) AM_READWRITE(abc806_ami_r, abc806_amo_w)
r3363r3364
457452   AM_RANGE(0x37, 0x37) AM_MIRROR(0xff00) AM_READWRITE(abc806_cli_r, abc806_sto_w)
458453   AM_RANGE(0x38, 0x38) AM_MIRROR(0xff06) AM_DEVWRITE(MC6845, MC6845_TAG, mc6845_address_w)
459454   AM_RANGE(0x39, 0x39) AM_MIRROR(0xff06) AM_DEVWRITE(MC6845, MC6845_TAG, mc6845_register_w)
460   AM_RANGE(0x40, 0x41) AM_MIRROR(0xff1c) AM_DEVREADWRITE(Z80SIO, "z80sio", sio2_r, sio2_w)
455   AM_RANGE(0x40, 0x41) AM_MIRROR(0xff1c) AM_DEVREADWRITE(Z80SIO, Z80SIO_TAG, sio2_r, sio2_w)
461456   AM_RANGE(0x60, 0x63) AM_MIRROR(0xff1c) AM_DEVREADWRITE(Z80CTC, "z80ctc", z80ctc_r, z80ctc_w)
462457   AM_RANGE(0x80, 0x80) AM_MIRROR(0xff7f) AM_READWRITE(abcbus_strobe_r, abcbus_strobe_w)
463458ADDRESS_MAP_END
r3363r3364
487482
488483static ABC77_ON_KEYDOWN_CHANGED( abc800_abc77_keydown_changed )
489484{
490   const device_config *z80dart = device_list_find_by_tag(device->machine->config->devicelist, Z80DART, "z80dart");
485   abc800_state *state = device->machine->driver_data;
491486
492   z80dart_set_dcd(z80dart, 1, level);
487   z80dart_set_dcd(state->z80dart, 1, level);
493488}
494489
495490static ABC77_INTERFACE( abc800_abc77_intf )
r3363r3364
505500
506501static const z80ctc_interface abc800_ctc_intf =
507502{
508   "main",               /* cpu */
503   Z80_TAG,               /* cpu */
509504   ABC800_X01/2/2,         /* clock */
510505   0,                    /* timer disables */
511506   0,                    /* interrupt handler */
r3363r3364
525520
526521static z80sio_interface abc800_sio_intf =
527522{
528   "main",               /* cpu */
523   Z80_TAG,               /* cpu */
529524   ABC800_X01/2/2,         /* clock */
530525   0,                  /* interrupt handler */
531526   0,                  /* DTR changed handler */
r3363r3364
546541
547542static const z80dart_interface abc800_dart_intf =
548543{
549   "main",               /* cpu */
544   Z80_TAG,               /* cpu */
550545   ABC800_X01/2/2,         /* clock */
551546   0,                  /* interrupt handler */
552547   0,                  /* DTR changed handler */
r3363r3364
559554static const z80_daisy_chain abc800_daisy_chain[] =
560555{
561556   { Z80CTC, "z80ctc" },
562   { Z80SIO, "z80sio" },
563   { Z80DART, "z80dart" },
557   { Z80SIO, Z80SIO_TAG },
558   { Z80DART, Z80DART_TAG },
564559   { NULL }
565560};
566561
r3363r3364
580575{
581576   abc800_state *state = machine->driver_data;
582577
578   /* find devices */
579
580   state->z80ctc = device_list_find_by_tag(machine->config->devicelist, Z80CTC, Z80CTC_TAG);
581   state->z80dart = device_list_find_by_tag(machine->config->devicelist, Z80DART, Z80DART_TAG);
582   state->z80sio = device_list_find_by_tag(machine->config->devicelist, Z80SIO, Z80SIO_TAG);
583
583584   /* allocate timer */
584585
585   state->ctc_timer = timer_alloc(abc800_ctc_tick, (void *)device_list_find_by_tag(machine->config->devicelist, Z80CTC, "z80ctc") );
586   state->ctc_timer = timer_alloc(abc800_ctc_tick, (void *)state->z80ctc );
586587   timer_adjust_periodic(state->ctc_timer, attotime_zero, 0, ATTOTIME_IN_HZ(ABC800_X01/2/2/2));
587588}
588589
r3363r3364
597598
598599static ABC77_ON_KEYDOWN_CHANGED( abc802_abc77_keydown_changed )
599600{
600   const device_config *z80dart = device_list_find_by_tag(device->machine->config->devicelist, Z80DART, "z80dart");
601   abc802_state *state = device->machine->driver_data;
601602
602   z80dart_set_dcd(z80dart, 1, level);
603   z80dart_set_dcd(state->z80dart, 1, level);
603604}
604605
605606static ABC77_INTERFACE( abc802_abc77_intf )
r3363r3364
628629
629630static const z80dart_interface abc802_dart_intf =
630631{
631   "main",               /* cpu */
632   Z80_TAG,               /* cpu */
632633   ABC800_X01/2/2,         /* clock */
633634   0,                  /* interrupt handler */
634635   abc802_dart_dtr_w,      /* DTR changed handler */
r3363r3364
642643{
643644   abc802_state *state = machine->driver_data;
644645
646   /* find devices */
647
648   state->z80ctc = device_list_find_by_tag(machine->config->devicelist, Z80CTC, Z80CTC_TAG);
649   state->z80dart = device_list_find_by_tag(machine->config->devicelist, Z80DART, Z80DART_TAG);
650   state->z80sio = device_list_find_by_tag(machine->config->devicelist, Z80SIO, Z80SIO_TAG);
651
645652   /* allocate timer */
646653
647   state->ctc_timer = timer_alloc(abc800_ctc_tick, (void *)device_list_find_by_tag(machine->config->devicelist, Z80CTC, "z80ctc") );
654   state->ctc_timer = timer_alloc(abc800_ctc_tick, (void *)state->z80ctc );
648655   timer_adjust_periodic(state->ctc_timer, attotime_zero, 0, ATTOTIME_IN_HZ(ABC800_X01/2/2/2));
649656
650657   /* configure memory */
651658
652   memory_configure_bank(1, 0, 1, memory_region(machine, "main"), 0);
659   memory_configure_bank(1, 0, 1, memory_region(machine, Z80_TAG), 0);
653660   memory_configure_bank(1, 1, 1, mess_ram, 0);
654661}
655662
r3363r3364
669676
670677static ABC77_ON_KEYDOWN_CHANGED( abc806_abc77_keydown_changed )
671678{
672   const device_config *z80dart = device_list_find_by_tag(device->machine->config->devicelist, Z80DART, "z80dart");
679   abc806_state *state = device->machine->driver_data;
673680
674   z80dart_set_dcd(z80dart, 1, level);
681   z80dart_set_dcd(state->z80dart, 1, level);
675682}
676683
677684static ABC77_INTERFACE( abc806_abc77_intf )
r3363r3364
697704
698705static const z80dart_interface abc806_dart_intf =
699706{
700   "main",               /* cpu */
707   Z80_TAG,               /* cpu */
701708   ABC800_X01/2/2,         /* clock */
702709   0,                  /* interrupt handler */
703710   abc806_dart_dtr_w,      /* DTR changed handler */
r3363r3364
711718{
712719   abc806_state *state = machine->driver_data;
713720
714   UINT8 *mem = memory_region(machine, "main");
721   UINT8 *mem = memory_region(machine, Z80_TAG);
715722   int bank;
716723
724   /* find devices */
725
726   state->z80ctc = device_list_find_by_tag(machine->config->devicelist, Z80CTC, Z80CTC_TAG);
727   state->z80dart = device_list_find_by_tag(machine->config->devicelist, Z80DART, Z80DART_TAG);
728   state->z80sio = device_list_find_by_tag(machine->config->devicelist, Z80SIO, Z80SIO_TAG);
729
717730   /* allocate timer */
718731
719   state->ctc_timer = timer_alloc(abc800_ctc_tick, (void *)device_list_find_by_tag(machine->config->devicelist, Z80CTC, "z80ctc") );
732   state->ctc_timer = timer_alloc(abc800_ctc_tick, (void *)state->z80ctc );
720733   timer_adjust_periodic(state->ctc_timer, attotime_zero, 0, ATTOTIME_IN_HZ(ABC800_X01/2/2/2));
721734
722735   /* setup memory banking */
r3363r3364
757770   MDRV_DRIVER_DATA(abc800_state)
758771
759772   /* basic machine hardware */
760   MDRV_CPU_ADD("main", Z80, ABC800_X01/2/2)
773   MDRV_CPU_ADD(Z80_TAG, Z80, ABC800_X01/2/2)
761774   MDRV_CPU_CONFIG(abc800_daisy_chain)
762775   MDRV_CPU_PROGRAM_MAP(abc800m_map, 0)
763776   MDRV_CPU_IO_MAP(abc800m_io_map, 0)
r3363r3364
772785   /* video hardware */
773786   MDRV_IMPORT_FROM(abc800m_video)
774787   
775   MDRV_Z80CTC_ADD( "z80ctc", abc800_ctc_intf )
776   MDRV_Z80SIO_ADD( "z80sio", abc800_sio_intf )
777   MDRV_Z80DART_ADD( "z80dart", abc800_dart_intf )
788   MDRV_Z80CTC_ADD( Z80CTC_TAG, abc800_ctc_intf )
789   MDRV_Z80SIO_ADD( Z80SIO_TAG, abc800_sio_intf )
790   MDRV_Z80DART_ADD( Z80DART_TAG, abc800_dart_intf )
778791
779792   /* printer */
780793   MDRV_DEVICE_ADD("printer", PRINTER)
r3363r3364
787800   MDRV_DRIVER_DATA(abc800_state)
788801
789802   /* basic machine hardware */
790   MDRV_CPU_ADD("main", Z80, ABC800_X01/2/2)
803   MDRV_CPU_ADD(Z80_TAG, Z80, ABC800_X01/2/2)
791804   MDRV_CPU_CONFIG(abc800_daisy_chain)
792805   MDRV_CPU_PROGRAM_MAP(abc800c_map, 0)
793806   MDRV_CPU_IO_MAP(abc800c_io_map, 0)
r3363r3364
802815   /* video hardware */
803816   MDRV_IMPORT_FROM(abc800c_video)
804817
805   MDRV_Z80CTC_ADD( "z80ctc", abc800_ctc_intf )
806   MDRV_Z80SIO_ADD( "z80sio", abc800_sio_intf )
807   MDRV_Z80DART_ADD( "z80dart", abc800_dart_intf )
818   MDRV_Z80CTC_ADD( Z80CTC_TAG, abc800_ctc_intf )
819   MDRV_Z80SIO_ADD( Z80SIO_TAG, abc800_sio_intf )
820   MDRV_Z80DART_ADD( Z80DART_TAG, abc800_dart_intf )
808821
809822   /* printer */
810823   MDRV_DEVICE_ADD("printer", PRINTER)
r3363r3364
817830   MDRV_DRIVER_DATA(abc802_state)
818831
819832   /* basic machine hardware */
820   MDRV_CPU_ADD("main", Z80, ABC800_X01/2/2)
833   MDRV_CPU_ADD(Z80_TAG, Z80, ABC800_X01/2/2)
821834   MDRV_CPU_CONFIG(abc800_daisy_chain)
822835   MDRV_CPU_PROGRAM_MAP(abc802_map, 0)
823836   MDRV_CPU_IO_MAP(abc802_io_map, 0)
r3363r3364
833846   /* video hardware */
834847   MDRV_IMPORT_FROM(abc802_video)
835848
836   MDRV_Z80CTC_ADD( "z80ctc", abc800_ctc_intf )
837   MDRV_Z80SIO_ADD( "z80sio", abc800_sio_intf )
838   MDRV_Z80DART_ADD( "z80dart", abc802_dart_intf )
849   MDRV_Z80CTC_ADD( Z80CTC_TAG, abc800_ctc_intf )
850   MDRV_Z80SIO_ADD( Z80SIO_TAG, abc800_sio_intf )
851   MDRV_Z80DART_ADD( Z80DART_TAG, abc802_dart_intf )
839852
840853   /* printer */
841854   MDRV_DEVICE_ADD("printer", PRINTER)
r3363r3364
848861   MDRV_DRIVER_DATA(abc806_state)
849862
850863   /* basic machine hardware */
851   MDRV_CPU_ADD("main", Z80, ABC800_X01/2/2)
864   MDRV_CPU_ADD(Z80_TAG, Z80, ABC800_X01/2/2)
852865   MDRV_CPU_CONFIG(abc800_daisy_chain)
853866   MDRV_CPU_PROGRAM_MAP(abc806_map, 0)
854867   MDRV_CPU_IO_MAP(abc806_io_map, 0)
r3363r3364
864877   /* video hardware */
865878   MDRV_IMPORT_FROM(abc806_video)
866879
867   MDRV_Z80CTC_ADD( "z80ctc", abc800_ctc_intf )
868   MDRV_Z80SIO_ADD( "z80sio", abc800_sio_intf )
869   MDRV_Z80DART_ADD( "z80dart", abc800_dart_intf )
880   MDRV_Z80CTC_ADD( Z80CTC_TAG, abc800_ctc_intf )
881   MDRV_Z80SIO_ADD( Z80SIO_TAG, abc800_sio_intf )
882   MDRV_Z80DART_ADD( Z80DART_TAG, abc800_dart_intf )
870883
871884   /* real time clock */
872885   MDRV_DEVICE_ADD(E0516_TAG, E0516)
r3363r3364
902915   ROM_LOAD( "abc99.bin", 0x1000, 0x0800, CRC(d48310fc) SHA1(17a2ffc0ec00d395c2b9caf3d57fed575ba2b137), BIOS(2) )
903916
904917ROM_START( abc800c )
905   ROM_REGION( 0x10000, "main", 0 )
918   ROM_REGION( 0x10000, Z80_TAG, 0 )
906919   ROM_LOAD( "abcc.1m",    0x0000, 0x1000, NO_DUMP )
907920   ROM_LOAD( "abc1-12.1l", 0x1000, 0x1000, CRC(1e99fbdc) SHA1(ec6210686dd9d03a5ed8c4a4e30e25834aeef71d) )
908921   ROM_LOAD( "abc2-12.1k", 0x2000, 0x1000, CRC(ac196ba2) SHA1(64fcc0f03fbc78e4c8056e1fa22aee12b3084ef5) )
r3363r3364
946959ROM_END
947960
948961ROM_START( abc800m )
949   ROM_REGION( 0x10000, "main", 0 )
962   ROM_REGION( 0x10000, Z80_TAG, 0 )
950963   ROM_LOAD( "abcm.1m",    0x0000, 0x1000, CRC(f85b274c) SHA1(7d0f5639a528d8d8130a22fe688d3218c77839dc) )
951964   ROM_LOAD( "abc1-12.1l", 0x1000, 0x1000, CRC(1e99fbdc) SHA1(ec6210686dd9d03a5ed8c4a4e30e25834aeef71d) )
952965   ROM_LOAD( "abc2-12.1k", 0x2000, 0x1000, CRC(ac196ba2) SHA1(64fcc0f03fbc78e4c8056e1fa22aee12b3084ef5) )
r3363r3364
961974ROM_END
962975
963976ROM_START( abc802 )
964   ROM_REGION( 0x10000, "main", 0 )
977   ROM_REGION( 0x10000, Z80_TAG, 0 )
965978   ROM_LOAD(  "abc02-11.9f",  0x0000, 0x2000, CRC(b86537b2) SHA1(4b7731ef801f9a03de0b5acd955f1e4a1828355d) )
966979   ROM_LOAD(  "abc12-11.11f", 0x2000, 0x2000, CRC(3561c671) SHA1(f12a7c0fe5670ffed53c794d96eb8959c4d9f828) )
967980   ROM_LOAD(  "abc22-11.12f", 0x4000, 0x2000, CRC(8dcb1cc7) SHA1(535cfd66c84c0370fd022d6edf702d3d1ad1b113) )
r3363r3364
980993ROM_END
981994
982995ROM_START( abc806 )
983   ROM_REGION( 0x10000, "main", 0 )
996   ROM_REGION( 0x10000, Z80_TAG, 0 )
984997   ROM_LOAD( "abc 06-11.1m",  0x0000, 0x1000, CRC(27083191) SHA1(9b45592273a5673e4952c6fe7965fc9398c49827) ) // BASIC PROM ABC 06-11 "64 90231-02"
985998   ROM_LOAD( "abc 16-11.1l",  0x1000, 0x1000, CRC(eb0a08fd) SHA1(f0b82089c5c8191fbc6a3ee2c78ce730c7dd5145) ) // BASIC PROM ABC 16-11 "64 90232-02"
986999   ROM_LOAD( "abc 26-11.1k",  0x2000, 0x1000, CRC(97a95c59) SHA1(013bc0a2661f4630c39b340965872bf607c7bd45) ) // BASIC PROM ABC 26-11 "64 90233-02"
r3363r3364
11021115{
11031116   if (address >= 0x7800 && address < 0x8000)
11041117   {
1105      opbase->rom = opbase->ram = memory_region(machine, "main");
1118      opbase->rom = opbase->ram = memory_region(machine, Z80_TAG);
11061119      return ~0;
11071120   }
11081121
r3363r3364
11151128
11161129   if (address >= 0x7800 && address < 0x8000)
11171130   {
1118      opbase->rom = opbase->ram = memory_region(machine, "main");
1131      opbase->rom = opbase->ram = memory_region(machine, Z80_TAG);
11191132
11201133      if (!state->fetch_charram)
11211134      {

Previous 15994 Revisions Next


© 1998-2018 The MESS Team