Previous 15994 Revisions Next

r3640 Thursday 27th November, 2008 at 13:59:01 UTC by Nathan Woods
Reenabled Coleco
[src/mess]mess.mak messdriv.c
[src/mess/drivers]adam.c coleco.c
[src/mess/machine]adam.c

src/mess/messdriv.c
r3639r3640
139139//128u4   DRIVER( channelf )   /* Fairchild Channel F VES - 1976               */
140140
141141   /* COLECO */
142//128u4   DRIVER( coleco )   /* ColecoVision (Original BIOS)                  */
143//128u4   DRIVER( colecoa )   /* ColecoVision (Thick Characters)               */
144//128u4   DRIVER( colecob )   /* Spectravideo SVI-603 Coleco Game Adapter         */
145//128u4   DRIVER( czz50 )      /* Bit Corporation Chuang Zao Zhe 50            */
146//128u4   DRIVER( dina )      /* Telegames Dina                           */
147//128u4   DRIVER( prsarcde )   /* Telegames Personal Arcade                  */
148//128u4   DRIVER( adam )      /* Coleco Adam                              */
142   DRIVER( coleco )   /* ColecoVision (Original BIOS)                  */
143   DRIVER( colecoa )   /* ColecoVision (Thick Characters)               */
144   DRIVER( colecob )   /* Spectravideo SVI-603 Coleco Game Adapter         */
145   DRIVER( czz50 )      /* Bit Corporation Chuang Zao Zhe 50            */
146   DRIVER( dina )      /* Telegames Dina                           */
147   DRIVER( prsarcde )   /* Telegames Personal Arcade                  */
148   DRIVER( adam )      /* Coleco Adam                              */
149149
150150   /* NEC */
151151//128u4   DRIVER( pce )      /* PC/Engine NEC 1987-1993                     */
src/mess/machine/adam.c
r3639r3640
687687    switch (adam_upper_memory)
688688    {
689689        case 0: /* Internal RAM */
690            memory_region(machine, "main")[0x08000+offset] = data;
691            if (offset>=(adam_pcb-0x08000)) master6801_behaviour(machine, offset+0x08000, data);
690            memory_region(space->machine, "main")[0x08000+offset] = data;
691            if (offset>=(adam_pcb-0x08000)) master6801_behaviour(space->machine, offset+0x08000, data);
692692            break;
693693        case 1: /* ROM Expansion */
694694            break;
695695        case 2: /* RAM Expansion */
696            memory_region(machine, "main")[0x18000+offset] = data;
696            memory_region(space->machine, "main")[0x18000+offset] = data;
697697           break;
698698       case 3: /* Cartridge ROM */
699699           break;
r3639r3640
713713   if data bit1 is 1 -> Lower 32k = EOS otherwise Lower 32k = SmartWriter
714714   */
715715   UINT8 *BankBase;
716   BankBase = &memory_region(machine, "main")[0x00000];
716   BankBase = &memory_region(space->machine, "main")[0x00000];
717717
718718   if (data==0x0F)
719      adam_reset_pcb(machine);
719      adam_reset_pcb(space->machine);
720720   if ( (adam_lower_memory==0) && ((data&0x02)!=(adam_net_data&0x02)) )
721721   {
722722      if (data&0x02)
723723      {
724         memory_set_bankptr(machine, 1, BankBase+0x32000); /* No data here */
725         memory_set_bankptr(machine, 2, BankBase+0x34000); /* No data here */
726         memory_set_bankptr(machine, 3, BankBase+0x36000); /* No data here */
727         memory_set_bankptr(machine, 4, BankBase+0x38000); /* EOS ROM */
724         memory_set_bankptr(space->machine, 1, BankBase+0x32000); /* No data here */
725         memory_set_bankptr(space->machine, 2, BankBase+0x34000); /* No data here */
726         memory_set_bankptr(space->machine, 3, BankBase+0x36000); /* No data here */
727         memory_set_bankptr(space->machine, 4, BankBase+0x38000); /* EOS ROM */
728728
729         memory_set_bankptr(machine, 6, BankBase+0x3A000); /* Write protecting ROM */
730         memory_set_bankptr(machine, 7, BankBase+0x3A000); /* Write protecting ROM */
731         memory_set_bankptr(machine, 8, BankBase+0x3A000); /* Write protecting ROM */
732         memory_set_bankptr(machine, 9, BankBase+0x3A000); /* Write protecting ROM */
729         memory_set_bankptr(space->machine, 6, BankBase+0x3A000); /* Write protecting ROM */
730         memory_set_bankptr(space->machine, 7, BankBase+0x3A000); /* Write protecting ROM */
731         memory_set_bankptr(space->machine, 8, BankBase+0x3A000); /* Write protecting ROM */
732         memory_set_bankptr(space->machine, 9, BankBase+0x3A000); /* Write protecting ROM */
733733      }
734734      else
735735      {
736         memory_set_bankptr(machine, 1, BankBase+0x20000); /* SmartWriter ROM */
737         memory_set_bankptr(machine, 2, BankBase+0x22000);
738         memory_set_bankptr(machine, 3, BankBase+0x24000);
739         memory_set_bankptr(machine, 4, BankBase+0x26000);
736         memory_set_bankptr(space->machine, 1, BankBase+0x20000); /* SmartWriter ROM */
737         memory_set_bankptr(space->machine, 2, BankBase+0x22000);
738         memory_set_bankptr(space->machine, 3, BankBase+0x24000);
739         memory_set_bankptr(space->machine, 4, BankBase+0x26000);
740740
741         memory_set_bankptr(machine, 6, BankBase+0x3A000); /* Write protecting ROM */
742         memory_set_bankptr(machine, 7, BankBase+0x3A000); /* Write protecting ROM */
743         memory_set_bankptr(machine, 8, BankBase+0x3A000); /* Write protecting ROM */
744         memory_set_bankptr(machine, 9, BankBase+0x3A000); /* Write protecting ROM */
741         memory_set_bankptr(space->machine, 6, BankBase+0x3A000); /* Write protecting ROM */
742         memory_set_bankptr(space->machine, 7, BankBase+0x3A000); /* Write protecting ROM */
743         memory_set_bankptr(space->machine, 8, BankBase+0x3A000); /* Write protecting ROM */
744         memory_set_bankptr(space->machine, 9, BankBase+0x3A000); /* Write protecting ROM */
745745      }
746746   }
747747   adam_net_data = data;
748748}
749749
750 READ8_HANDLER( adam_memory_map_controller_r )
750READ8_HANDLER( adam_memory_map_controller_r )
751751{
752752    return (adam_upper_memory << 2) + adam_lower_memory;
753753}
r3639r3640
775775
776776    adam_lower_memory = (data & 0x03);
777777    adam_upper_memory = (data & 0x0C)>>2;
778    adam_set_memory_banks(machine);
778    adam_set_memory_banks(space->machine);
779779    //logerror("Configurando la memoria, L:%02xh, U:%02xh\n", adam_lower_memory, adam_upper_memory);
780780}
781781
782782READ8_HANDLER(adam_video_r)
783783{
784    return ((offset&0x01) ? TMS9928A_register_r(machine, 1) : TMS9928A_vram_r(machine, 0));
784    return ((offset&0x01) ? TMS9928A_register_r(space, 1) : TMS9928A_vram_r(space, 0));
785785}
786786
787787WRITE8_HANDLER(adam_video_w)
788788{
789    (offset&0x01) ? TMS9928A_register_w(machine, 1, data) : TMS9928A_vram_w(machine, 0, data);
789    (offset&0x01) ? TMS9928A_register_w(space, 1, data) : TMS9928A_vram_w(space, 0, data);
790790}
791791
792 READ8_HANDLER( master6801_ram_r )
792READ8_HANDLER( master6801_ram_r )
793793{
794794    /*logerror("Offset %04Xh = %02Xh\n",offset ,memory_region(machine, "main")[offset]);*/
795    return memory_region(machine, "main")[offset+0x4000];
795    return memory_region(space->machine, "main")[offset+0x4000];
796796}
797797
798798WRITE8_HANDLER( master6801_ram_w )
799799{
800    memory_region(machine, "main")[offset+0x4000] = data;
800    memory_region(space->machine, "main")[offset+0x4000] = data;
801801}
802802
803 READ8_HANDLER ( adam_paddle_r )
803READ8_HANDLER ( adam_paddle_r )
804804{
805805
806    if (!(input_port_read(machine, "controllers") & 0x0F)) return (0xFF); /* If no controllers enabled */
806    if (!(input_port_read(space->machine, "controllers") & 0x0F)) return (0xFF); /* If no controllers enabled */
807807   /* Player 1 */
808808   if ((offset & 0x02)==0)
809809   {
r3639r3640
812812      {
813813         int inport0,inport1,inport6,data;
814814
815         inport0 = input_port_read(machine, "controller1_keypad1");
816         inport1 = input_port_read(machine, "controller1_keypad2");
817         inport6 = input_port_read(machine, "controllers");
815         inport0 = input_port_read(space->machine, "controller1_keypad1");
816         inport1 = input_port_read(space->machine, "controller1_keypad2");
817         inport6 = input_port_read(space->machine, "controllers");
818818
819819         /* Numeric pad buttons are not independent on a real ColecoVision, if you push more
820820         than one, a real ColecoVision think that it is a third button, so we are going to emulate
r3639r3640
841841      /* Joystick and fire 2 (SAC Red Button) */
842842      else
843843      {
844         int data = input_port_read(machine, "controller1_joystick") & 0xCF;
845         int inport6 = input_port_read(machine, "controllers");
844         int data = input_port_read(space->machine, "controller1_joystick") & 0xCF;
845         int inport6 = input_port_read(space->machine, "controllers");
846846
847847         if (inport6&0x07) /* If Extra Contollers enabled */
848848         {
r3639r3640
862862      {
863863         int inport3,inport4,data;
864864
865         inport3 = input_port_read(machine, "controller2_keypad1");
866         inport4 = input_port_read(machine, "controller2_keypad2");
865         inport3 = input_port_read(space->machine, "controller2_keypad1");
866         inport4 = input_port_read(space->machine, "controller2_keypad2");
867867
868868         /* Numeric pad buttons are not independent on a real ColecoVision, if you push more
869869         than one, a real ColecoVision think that it is a third button, so we are going to emulate
r3639r3640
888888      /* Joystick and fire 2*/
889889      else
890890      {
891         int data = input_port_read(machine, "controller2_joystick") & 0xCF;
892         int inport6 = input_port_read(machine, "controllers");
891         int data = input_port_read(space->machine, "controller2_joystick") & 0xCF;
892         int inport6 = input_port_read(space->machine, "controllers");
893893
894894         if (inport6&0x02) /* If Roller Controller enabled */
895895         {
src/mess/mess.mak
r3639r3640
382382   $(MESSOBJ)/b2m.a \
383383   $(MESSOBJ)/bk.a \
384384   $(MESSOBJ)/cbmshare.a \
385   $(MESSOBJ)/coleco.a \
385386   $(MESSOBJ)/einis.a \
386387   $(MESSOBJ)/ep128.a \
387388   $(MESSOBJ)/exidy.a \
r3639r3640
431432#   $(MESSOBJ)/cbm.a \
432433#   $(MESSOBJ)/cgenie.a \
433434#   $(MESSOBJ)/coco.a \
434#   $(MESSOBJ)/coleco.a \
435435#   $(MESSOBJ)/compis.a \
436436#   $(MESSOBJ)/comx.a \
437437#   $(MESSOBJ)/concept.a \
src/mess/drivers/adam.c
r3639r3640
422422
423423static INTERRUPT_GEN( adam_interrupt )
424424{
425    TMS9928A_interrupt(machine);
426    adam_explore_keyboard(machine);
425    TMS9928A_interrupt(device->machine);
426    adam_explore_keyboard(device->machine);
427427}
428428
429429static void adam_vdp_interrupt (running_machine *machine, int state)
r3639r3640
458458      adam_joy_stat[1] = 1;
459459
460460   if (adam_joy_stat[0] || adam_joy_stat[1])
461      cpunum_set_input_line (machine, 0, 0, HOLD_LINE);
461      cpu_set_input_line(machine->cpu[0], 0, HOLD_LINE);
462462}
463463
464464void adam_set_memory_banks(running_machine *machine)
src/mess/drivers/coleco.c
r3639r3640
7474
7575static READ8_HANDLER( paddle_1_r )
7676{
77   UINT8 inport6 = input_port_read_safe(machine, "IN6", 0);
77   UINT8 inport6 = input_port_read_safe(space->machine, "IN6", 0);
7878
7979   /* Keypad and fire 1 (SAC Yellow Button) */
8080   if (joy_mode==0)
8181   {
82      UINT8 inport0 = input_port_read(machine, "IN0");
83      UINT8 inport1 = input_port_read(machine, "IN1");
82      UINT8 inport0 = input_port_read(space->machine, "IN0");
83      UINT8 inport1 = input_port_read(space->machine, "IN1");
8484
8585      /* Numeric pad buttons are not independent on a real ColecoVision, if you push more
8686      than one, a real ColecoVision think that it is a third button, so we are going to emulate
r3639r3640
108108   /* Joystick and fire 2 (SAC Red Button) */
109109   else
110110   {
111      UINT8 data = input_port_read(machine, "IN2") & 0xCF;
111      UINT8 data = input_port_read(space->machine, "IN2") & 0xCF;
112112
113113      if (inport6 & 0x07) /* If Extra Contollers enabled */
114114      {
r3639r3640
125125   /* Keypad and fire 1 */
126126   if (joy_mode == 0)
127127   {
128      UINT8 inport3 = input_port_read(machine, "IN3");
129      UINT8 inport4 = input_port_read(machine, "IN4");
128      UINT8 inport3 = input_port_read(space->machine, "IN3");
129      UINT8 inport4 = input_port_read(space->machine, "IN4");
130130
131131      /* Numeric pad buttons are not independent on a real ColecoVision, if you push more
132132      than one, a real ColecoVision think that it is a third button, so we are going to emulate
r3639r3640
152152   /* Joystick and fire 2*/
153153   else
154154   {
155      UINT8 data = input_port_read(machine, "IN5") & 0xCF;
156      UINT8 inport6 = input_port_read_safe(machine, "IN6", 0);
155      UINT8 data = input_port_read(space->machine, "IN5") & 0xCF;
156      UINT8 inport6 = input_port_read_safe(space->machine, "IN6", 0);
157157
158158      if (inport6 & 0x02) /* If Roller Controller enabled */
159159      {
r3639r3640
344344
345345static INTERRUPT_GEN( coleco_interrupt )
346346{
347    TMS9928A_interrupt(machine);
347    TMS9928A_interrupt(device->machine);
348348}
349349
350350static void coleco_vdp_interrupt(running_machine *machine, int state)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team