Previous 15994 Revisions Next

r7305 Wednesday 10th February, 2010 at 12:26:48 UTC by Curt Coder
[C16] Cleanup.
[src/mess/drivers]c16.c
[src/mess/includes]c16.h
[src/mess/machine]c16.c

src/mess/includes/c16.h
r7304r7305
2424extern WRITE8_HANDLER(c16_6529_port_w);
2525extern  READ8_HANDLER(c16_6529_port_r);
2626
27#if 0
28extern WRITE8_HANDLER(c16_iec9_port_w);
29extern  READ8_HANDLER(c16_iec9_port_r);
30
31extern WRITE8_HANDLER(c16_iec8_port_w);
32extern  READ8_HANDLER(c16_iec8_port_r);
33
34#endif
35
3627extern WRITE8_HANDLER(c16_select_roms);
3728extern WRITE8_HANDLER(c16_switch_to_rom);
3829extern WRITE8_HANDLER(c16_switch_to_ram);
src/mess/machine/c16.c
r7304r7305
1313#include "cpu/m6502/m6502.h"
1414#include "sound/sid6581.h"
1515
16#include "machine/6525tpi.h"
1716#include "video/ted7360.h"
1817#include "machine/cbmiec.h"
1918
r7304r7305
6665static UINT8 *c16_memory_28000;
6766static UINT8 *c16_memory_2c000;
6867
69static int has_c1551, has_vc1541, has_iec8, has_iec9; // Notice that iec8 & iec9 have never been implemented
70
7168static UINT8 read_cfg1( running_machine *machine )
7269{
7370   UINT8 result;
r7304r7305
451448   c16_memory_24000 = rom + 0x24000;
452449   c16_memory_28000 = rom + 0x28000;
453450   c16_memory_2c000 = rom + 0x2c000;
454
455   /* need to recognice non available tia6523's (iec8/9) */
456   memset(messram_get_ptr(devtag_get_device(machine, "messram")) + (0xfdc0 % messram_get_size(devtag_get_device(machine, "messram"))), 0xff, 0x40);
457
458   memset(messram_get_ptr(devtag_get_device(machine, "messram")) + (0xfd40 % messram_get_size(devtag_get_device(machine, "messram"))), 0xff, 0x20);
459
460//removed   if (has_c1551)      /* C1551 */
461//removed      c1551_config(machine, "cpu_c1551");
462
463//removed   if (has_vc1541)      /* VC1541 */
464//removed      cbm_drive_config(machine, type_1541, 0, 0, "cpu_vc1540", 8);
465451}
466452
467453static void c16_driver_init( running_machine *machine )
r7304r7305
482468
483469DRIVER_INIT( c16 )
484470{
485   has_c1551 = 0;
486   has_vc1541 = 0;
487   has_iec8 = 0;
488   has_iec9 = 0;
489471   c16_driver_init(machine);
490472}
491473
492474DRIVER_INIT( c16c )
493475{
494   has_c1551 = 1;
495   has_vc1541 = 0;
496   has_iec8 = 0;
497   has_iec9 = 0;
498476   c16_driver_init(machine);
499477}
500478
501479DRIVER_INIT( c16v )
502480{
503   has_c1551 = 0;
504   has_vc1541 = 1;
505   has_iec8 = 0;
506   has_iec9 = 0;
507481   c16_driver_init(machine);
508482}
509483
r7304r7305
558532
559533      ted7360_set_dma (ted7360_dma_read, ted7360_dma_read_rom);
560534   }
561
562   if (has_c1551 || has_iec8)      /* IEC8 on || C1551 */
563   {
564      running_device *tpi = devtag_get_device(machine, "tpi6535_tpi_2");
565      memory_install_write8_device_handler(space, tpi, 0xfee0, 0xfeff, 0, 0, tpi6525_w);
566      memory_install_read8_device_handler(space, tpi, 0xfee0, 0xfeff, 0, 0, tpi6525_r);
567   }
568   else
569   {
570      memory_nop_readwrite(space, 0xfee0, 0xfeff, 0, 0);
571   }
572   if (has_iec9)               /* IEC9 on */
573   {
574      running_device *tpi = devtag_get_device(machine, "tpi6535_tpi_3");
575      memory_install_write8_device_handler(space, tpi, 0xfec0, 0xfedf, 0, 0, tpi6525_w);
576      memory_install_read8_device_handler(space, tpi, 0xfec0, 0xfedf, 0, 0, tpi6525_r);
577   }
578   else
579   {
580      memory_nop_readwrite(space, 0xfec0, 0xfedf, 0, 0);
581   }
582//removed   if (has_c1551)      /* c1551 */
583//removed   {
584//removed      c1551_drive_reset();
585//removed   }
586//removed   if (has_vc1541)      /* vc1541 */
587//removed   {
588//removed      cbm_drive_reset(machine);
589//removed   }
590//removed   else                        /* simulated drives */
591//removed   {
592//removed      cbm_drive_0_config(SERIAL, 8);
593//removed      cbm_drive_1_config(SERIAL, 9);
594//removed   }
595535}
596536
597537
src/mess/drivers/c16.c
r7304r7305
9999- Once we can add / remove devices, we shall only support c16, c116 and plus/4,
100100removing the separated drivers for different floppy drives
101101
102* Floppy drives:
103
104- Drives 8 & 9 supported, but limited compatibility. Real disk emulation is
105needed.
106
107102* Other Peripherals:
108103
109104- Lightpen support is unfinished
r7304r7305
121116#include "cpu/m6502/m6502.h"
122117#include "sound/sid6581.h"
123118
124#include "machine/6525tpi.h"
125119#include "machine/cbmipt.h"
126120#include "video/ted7360.h"
127121#include "devices/messram.h"
r7304r7305
195189   AM_RANGE(0x8000, 0xbfff) AM_WRITE( c16_write_8000)  /*configured in c16_common_init */
196190   AM_RANGE(0xc000, 0xfcff) AM_WRITE( c16_write_c000)  /*configured in c16_common_init */
197191   AM_RANGE(0xfd40, 0xfd5f) AM_DEVREADWRITE("sid6581", sid6581_r, sid6581_w)   /* sidcard, eoroidpro ... */
198   AM_RANGE(0xfec0, 0xfedf) AM_READWRITE(c16_iec9_port_r, c16_iec9_port_w)      /*configured in c16_common_init */
199   AM_RANGE(0xfee0, 0xfeff) AM_READWRITE(c16_iec8_port_r, c16_iec8_port_w)      /*configured in c16_common_init */
200192   AM_RANGE(0xff20, 0xff3d) AM_WRITE( c16_write_ff20)  /*configure in c16_common_init */
201193   AM_RANGE(0xff40, 0xffff) AM_WRITE( c16_write_ff40)  /*configure in c16_common_init */
202194#endif
r7304r7305
214206   AM_RANGE(0xfdd0, 0xfddf) AM_WRITE( c16_select_roms) /* rom chips selection */
215207#if 0
216208   AM_RANGE(0xfd40, 0xfd5f) AM_DEVREADWRITE("sid6581", sid6581_r, sid6581_w)   /* sidcard, eoroidpro ... */
217   AM_RANGE(0xfec0, 0xfedf) AM_READWRITE(c16_iec9_port_r, c16_iec9_port_w)      /*configured in c16_common_init */
218   AM_RANGE(0xfee0, 0xfeff) AM_READWRITE(c16_iec8_port_r, c16_iec8_port_w)      /*configured in c16_common_init */
219209#endif
220210   AM_RANGE(0xff00, 0xff1f) AM_READWRITE(ted7360_port_r, ted7360_port_w)
221211   AM_RANGE(0xff20, 0xffff) AM_READ_BANK("bank8")
r7304r7305
238228   AM_RANGE(0xfdd0, 0xfddf) AM_WRITE( c16_select_roms) /* rom chips selection */
239229#if 0
240230   AM_RANGE(0xfd40, 0xfd5f) AM_DEVREADWRITE("sid6581", sid6581_r, sid6581_w)   /* sidcard, eoroidpro ... */
241   AM_RANGE(0xfec0, 0xfedf) AM_READWRITE(c16_iec9_port_r, c16_iec9_port_w)      /*configured in c16_common_init */
242   AM_RANGE(0xfee0, 0xfeff) AM_READWRITE(c16_iec8_port_r, c16_iec8_port_w)      /*configured in c16_common_init */
243231#endif
244232   AM_RANGE(0xff00, 0xff1f) AM_READWRITE(ted7360_port_r, ted7360_port_w)
245233   AM_RANGE(0xff20, 0xffff) AM_READ_BANK("bank8")
r7304r7305
294282
295283   PORT_INCLUDE( c16_controls )         /* JOY0, JOY1 */
296284
297   /* no real floppy */
298
299285   PORT_INCLUDE( c16_config )            /* DSW0, CFG1 */
300286INPUT_PORTS_END
301287
r7304r7305
303289static INPUT_PORTS_START( plus4 )
304290   PORT_INCLUDE( c16 )
305291
306   /* no real floppy */
307
308292   PORT_MODIFY( "ROW0" )
309293   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE)               PORT_CHAR(0xA3)
310294   PORT_MODIFY( "ROW5" )
r7304r7305
329313static INPUT_PORTS_START (c364)
330314   PORT_INCLUDE( plus4 )
331315
332   /* no real floppy */
333
334316   PORT_MODIFY("CFG1")
335317   PORT_BIT( 0x10, 0x10, IPT_UNUSED )         /* ntsc */
336318   PORT_BIT( 0x0c, 0x08, IPT_UNUSED )         /* 364 */
r7304r7305
365347 *
366348 *************************************/
367349
368static const tpi6525_interface c16_tpi6525_tpi_2_intf =
369{
370   NULL, //removed c1551_0_read_data,
371   NULL, //removed c1551_0_read_status,
372   NULL, //removed c1551_0_read_handshake,
373   NULL, //removed c1551_0_write_data,
374   NULL,
375   NULL, //removed c1551_0_write_handshake,
376   NULL,
377   NULL,
378   NULL
379};
380
381static const tpi6525_interface c16_tpi6525_tpi_2_c1551_intf =
382{
383   NULL, //removed c1551x_read_data,
384   NULL, //removed c1551x_read_status,
385   NULL, //removed c1551x_read_handshake,
386   NULL, //removed c1551x_write_data,
387   NULL,
388   NULL, //removed c1551x_write_handshake,
389   NULL,
390   NULL,
391   NULL
392};
393
394static const tpi6525_interface c16_tpi6525_tpi_3_intf =
395{
396   NULL, //removed c1551_1_read_data,
397   NULL, //removed c1551_1_read_status,
398   NULL, //removed c1551_1_read_handshake,
399   NULL, //removed c1551_1_write_data,
400   NULL,
401   NULL, //removed c1551_1_write_handshake,
402   NULL,
403   NULL,
404   NULL
405};
406
407350static const m6502_interface c16_m7501_interface =
408351{
409352   NULL,               /* read_indexed_func */
r7304r7305
427370
428371static MACHINE_DRIVER_START( c16 )
429372   /* basic machine hardware */
430   MDRV_CPU_ADD("maincpu", M7501, 1400000)        /* 7.8336 MHz */
373   MDRV_CPU_ADD("maincpu", M7501, XTAL_17_73447MHz/20)
431374   MDRV_CPU_PROGRAM_MAP(c16_map)
432375   MDRV_CPU_CONFIG( c16_m7501_interface )
433376   MDRV_CPU_VBLANK_INT("screen", c16_frame_interrupt)
r7304r7305
462405   /* cassette */
463406   MDRV_CASSETTE_ADD( "cassette", cbm_cassette_config )
464407
465   /* tpi */
466   MDRV_TPI6525_ADD("tpi6535_tpi_2", c16_tpi6525_tpi_2_intf)
467   MDRV_TPI6525_ADD("tpi6535_tpi_3", c16_tpi6525_tpi_3_intf)
468
469408   MDRV_IMPORT_FROM(c16_cartslot)
470409
471410   /* IEC serial bus */
r7304r7305
481420static MACHINE_DRIVER_START( c16c )
482421   MDRV_IMPORT_FROM( c16 )
483422
484   /* c16c uses 'real' floppy drive emulation from machine/vc1541.c...
485    still in progress, atm */
486   MDRV_DEVICE_REMOVE("tpi6535_tpi_2")
487   MDRV_TPI6525_ADD("tpi6535_tpi_2", c16_tpi6525_tpi_2_c1551_intf)
423   //MDRV_C1551_ADD("c1551", "maincpu", 8)
488424
489   /* emulation code currently supports only one drive */
490   MDRV_DEVICE_REMOVE("tpi6535_tpi_3")
491
492//removed    MDRV_IMPORT_FROM( cpu_c1551 )
493425#ifdef CPU_SYNC
494426   MDRV_QUANTUM_TIME(HZ(60))
495427#else
r7304r7305
510442#else
511443   MDRV_QUANTUM_TIME(HZ(300000))
512444#endif
513
514   /* no c1551 in this driver */
515   MDRV_DEVICE_REMOVE("tpi6535_tpi_2")
516   MDRV_DEVICE_REMOVE("tpi6535_tpi_3")
517445MACHINE_DRIVER_END
518446
519447
520448static MACHINE_DRIVER_START( plus4 )
521449   MDRV_IMPORT_FROM( c16 )
522   MDRV_CPU_REPLACE( "maincpu", M7501, 1200000)
450   MDRV_CPU_REPLACE( "maincpu", M7501, XTAL_14_31818MHz/16)
523451   MDRV_CPU_PROGRAM_MAP(plus4_map)
524452   MDRV_CPU_CONFIG( c16_m7501_interface )
525453   MDRV_SCREEN_MODIFY("screen")
r7304r7305
536464static MACHINE_DRIVER_START( plus4c )
537465   MDRV_IMPORT_FROM( plus4 )
538466
539   /* plus4c uses 'real' floppy drive emulation from machine/vc1541.c...
540    still in progress, atm */
541   MDRV_DEVICE_REMOVE("tpi6535_tpi_2")
542   MDRV_TPI6525_ADD("tpi6535_tpi_2", c16_tpi6525_tpi_2_c1551_intf)
467   //MDRV_C1551_ADD("c1551", "maincpu", 8)
543468
544   /* emulation code currently supports only one drive */
545   MDRV_DEVICE_REMOVE("tpi6535_tpi_3")
546
547//removed   MDRV_IMPORT_FROM( cpu_c1551 )
548
549469   MDRV_SCREEN_MODIFY("screen")
550470   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
551471#ifdef CPU_SYNC
r7304r7305
571491#else
572492   MDRV_QUANTUM_TIME(HZ(300000))
573493#endif
574
575   /* no c1551 in this driver */
576   MDRV_DEVICE_REMOVE("tpi6535_tpi_2")
577   MDRV_DEVICE_REMOVE("tpi6535_tpi_3")
578494MACHINE_DRIVER_END
579495
580496
r7304r7305
599515 *  ROM definition(s)
600516 *
601517 *************************************/
602#define C1551_ROM( cpu )   \
603   ROM_REGION( 0x10000, cpu, 0 )   \
604   ROM_LOAD( "318008-01.u4", 0xc000, 0x4000, CRC(6d16d024) SHA1(fae3c788ad9a6cc2dbdfbcf6c0264b2ca921d55e) )
605
606518ROM_START( c232 )
607519   ROM_REGION( 0x40000, "maincpu", 0 )
608520   ROM_LOAD( "318006-01.bin", 0x10000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) )
r7304r7305
646558   ROMX_LOAD( "318004-03.bin", 0x14000, 0x4000, CRC(77bab934) SHA1(97814dab9d757fe5a3a61d357a9a81da588a9783), ROM_BIOS(2) )
647559   ROM_SYSTEM_BIOS( 2, "rev4", "rev. 4" )
648560   ROMX_LOAD( "318004-04.bin", 0x14000, 0x4000, CRC(be54ed79) SHA1(514ad3c29d01a2c0a3b143d9c1d4143b1912b793), ROM_BIOS(3) )
649
650   C1551_ROM("cpu_c1551")
651561ROM_END
652562
653563ROM_START( c16v )
r7304r7305
688598
689599   ROM_LOAD( "317053-01.bin", 0x18000, 0x4000, CRC(4fd1d8cb) SHA1(3b69f6e7cb4c18bb08e203fb18b7dabfa853390f) )
690600   ROM_LOAD( "317054-01.bin", 0x1c000, 0x4000, CRC(109de2fc) SHA1(0ad7ac2db7da692d972e586ca0dfd747d82c7693) )
691
692   C1551_ROM("cpu_c1551")
693601ROM_END
694602
695603ROM_START( plus4v )
r7304r7305
711619
712620COMP( 1984, c16,     0,     0,  c16,    c16,    c16,   "Commodore Business Machines Co.",  "Commodore 16 (PAL)", 0)
713621COMP( 1984, c16c,    c16,   0,  c16c,   c16,    c16c,  "Commodore Business Machines Co.",  "Commodore 16 (PAL, 1551)", 0 )
714COMP( 1984, c16v,    c16,   0,  c16v,   c16,    c16v,  "Commodore Business Machines Co.",  "Commodore 16 (PAL, VC1541)", GAME_NOT_WORKING)
622COMP( 1984, c16v,    c16,   0,  c16v,   c16,    c16v,  "Commodore Business Machines Co.",  "Commodore 16 (PAL, VC1541)", 0)
715623COMP( 1984, c16hun,  c16,   0,  c16,    c16,    c16,   "Commodore Business Machines Co.",  "Commodore 16 Novotrade (PAL, Hungary)", 0)
716624
717625COMP( 1984, c116,    c16,   0,  c16,    c16,    c16,   "Commodore Business Machines Co.",  "Commodore 116 (PAL)", 0)
718626COMP( 1984, c116c,    c16,   0,  c16c,   c16,    c16c,  "Commodore Business Machines Co.",  "Commodore 116 (PAL, 1551)", 0 )
719COMP( 1984, c116v,   c16,   0,  c16v,   c16,    c16v,  "Commodore Business Machines Co.",  "Commodore 116 (PAL, VC1541)", GAME_NOT_WORKING)
627COMP( 1984, c116v,   c16,   0,  c16v,   c16,    c16v,  "Commodore Business Machines Co.",  "Commodore 116 (PAL, VC1541)", 0)
720628
721629COMP( 1984, plus4,   c16,   0,  plus4,  plus4,  c16,   "Commodore Business Machines Co.",  "Commodore Plus/4 (NTSC)", 0)
722630COMP( 1984, plus4c,  c16,   0,  plus4c, plus4,  c16c,  "Commodore Business Machines Co.",  "Commodore Plus/4 (NTSC, 1551)", 0 )
723COMP( 1984, plus4v,  c16,   0,  plus4v, plus4,  c16v,  "Commodore Business Machines Co.",  "Commodore Plus/4 (NTSC, VC1541)", GAME_NOT_WORKING)
631COMP( 1984, plus4v,  c16,   0,  plus4v, plus4,  c16v,  "Commodore Business Machines Co.",  "Commodore Plus/4 (NTSC, VC1541)", 0)
724632
725633COMP( 1984, c232,    c16,   0,  c16,    c16,    c16,   "Commodore Business Machines Co.",  "Commodore 232 (Prototype)", 0)
726634COMP( 1984, c264,    c16,   0,  c264,   plus4,  c16,   "Commodore Business Machines Co.",  "Commodore 264 (Prototype)", 0)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team