Previous 15994 Revisions Next

r6167 Thursday 22nd October, 2009 at 07:33:18 UTC by Fabio Priuli
[COCO/COCO3] Moved back Hi-Res Interface selection to Driver Configs and made buttons specific of each input device
[DRAGON] Added same input devices as CoCo. To my knowledge they were compatible (even if no known software uses them)
[docs]messnew.txt
[src/mess/drivers]coco.c
[src/mess/machine]coco.c

src/mess/machine/coco.c
r6166r6167
10931093static attotime coco_hiresjoy_xtransitiontime;
10941094static attotime coco_hiresjoy_ytransitiontime;
10951095
1096static attotime coco_hiresjoy_computetransitiontime(running_machine *machine, UINT8 port, UINT8 axis)
1096static attotime coco_hiresjoy_computetransitiontime( running_machine *machine, UINT8 port, UINT8 axis )
10971097{
10981098   double val;
1099   UINT8 ctrl = input_port_read_safe(machine, "ctrl_sel", 0x00);
1100   /* this function gets only called for hi-res joystick. hence, ctrl can only take values
1101       0x04, 0x40 (hi-res) or 0x05, 0x50 (hi-res coco3max) */
1102   UINT8 coco3max = ((ctrl & 0x0f) == 0x05 || (ctrl & 0xf0) == 0x50) ? 1 : 0;
1099   UINT8 hires = input_port_read_safe(machine, "hires_intf", 0x00);
1100   /* this function gets only called for hi-res joystick. hence, hires can only take values
1101       0x01, 0x03 (hi-res) or 0x02, 0x04 (hi-res coco3max) */
1102   UINT8 coco3max = (hires == 0x02 || hires == 0x04) ? 1 : 0;
11031103
1104   static const char *const port_tags[2][4] =
1105         {
1106            {"joystick_hires_rx", "joystick_hires_ry", "joystick_hires_max_rx", "joystick_hires_max_ry"},   /* right ports */
1107            {"joystick_hires_lx", "joystick_hires_ly", "joystick_hires_max_lx", "joystick_hires_max_ly" }   /* left ports */
1108         };
1104   static const char *const port_tags[4] = {"joystick_rx", "joystick_ry", "joystick_lx", "joystick_ly"};
11091105
1110   val = input_port_read_safe(machine, port_tags[port][axis + 2 * coco3max], 0) / 255.0;
1106   val = input_port_read_safe(machine, port_tags[axis + 2 * port], 0) / 255.0;
11111107
11121108   if (coco3max)
11131109   {
r6166r6167
11231119   return attotime_add(timer_get_time(machine), attotime_mul(COCO_CPU_SPEED, val));
11241120}
11251121
1126static void coco_hiresjoy_w(running_machine *machine, int data, UINT8 port)
1122static void coco_hiresjoy_w( running_machine *machine, int data, UINT8 port )
11271123{
11281124   if (!data && coco_hiresjoy_ca)
11291125   {
r6166r6167
11411137   (*update_keyboard)(machine);
11421138}
11431139
1144static int coco_hiresjoy_readone(running_machine *machine, attotime transitiontime)
1140static int coco_hiresjoy_readone( running_machine *machine, attotime transitiontime )
11451141{
11461142   return attotime_compare(timer_get_time(machine), transitiontime) >= 0;
11471143}
11481144
1149static int coco_hiresjoy_rx(running_machine *machine)
1145static int coco_hiresjoy_rx( running_machine *machine )
11501146{
11511147   return coco_hiresjoy_readone(machine, coco_hiresjoy_xtransitiontime);
11521148}
11531149
1154static int coco_hiresjoy_ry(running_machine *machine)
1150static int coco_hiresjoy_ry( running_machine *machine )
11551151{
11561152   return coco_hiresjoy_readone(machine, coco_hiresjoy_ytransitiontime);
11571153}
r6166r6167
12841280   return 0;
12851281}
12861282
1287WRITE8_HANDLER ( dgnalpha_psg_porta_write )
1283WRITE8_HANDLER( dgnalpha_psg_porta_write )
12881284{
12891285   const device_config *fdc = devtag_get_device(space->machine, "wd2797");
12901286   /* Bits 0..3 are the drive select lines for the internal floppy interface */
r6166r6167
13181314  PIA0 CB2      - SEL2 (Used by sound mux and joystick)
13191315***************************************************************************/
13201316
1321static WRITE8_DEVICE_HANDLER ( d_pia0_ca2_w )
1317static WRITE8_DEVICE_HANDLER( d_pia0_ca2_w )
13221318{
13231319   timer_adjust_oneshot(mux_sel1_timer, JOYSTICK_MUX_DELAY, data);
13241320}
13251321
1326static TIMER_CALLBACK(coco_update_sel1_timerproc)
1322static TIMER_CALLBACK( coco_update_sel1_timerproc )
13271323{
13281324   mux_sel1 = param;
13291325   (*update_keyboard)(machine);
13301326   soundmux_update(machine);
13311327}
13321328
1333static WRITE8_DEVICE_HANDLER ( d_pia0_cb2_w )
1329static WRITE8_DEVICE_HANDLER( d_pia0_cb2_w )
13341330{
13351331   timer_adjust_oneshot(mux_sel2_timer, JOYSTICK_MUX_DELAY, data);
13361332}
13371333
1338static TIMER_CALLBACK(coco_update_sel2_timerproc)
1334static TIMER_CALLBACK( coco_update_sel2_timerproc )
13391335{
13401336   mux_sel2 = param;
13411337   (*update_keyboard)(machine);
r6166r6167
13431339}
13441340
13451341
1346static attotime get_relative_time(running_machine *machine, attotime absolute_time)
1342static attotime get_relative_time( running_machine *machine, attotime absolute_time )
13471343{
13481344   attotime result;
13491345   attotime now = timer_get_time(machine);
r6166r6167
13571353
13581354
13591355
1360static UINT8 coco_update_keyboard(running_machine *machine)
1356static UINT8 coco_update_keyboard( running_machine *machine )
13611357{
13621358   coco_state *state = machine->driver_data;
13631359   UINT8 porta = 0x7f, port_za = 0x7f;
r6166r6167
13671363   attotime dclg_time = attotime_zero;
13681364   UINT8 pia0_pb;
13691365   UINT8 dac = pia6821_get_output_a(state->pia_1) & 0xfc;
1370   int joystick_axis, joystick, joy_mask, joy_shift, ctrl;
1366   UINT8 hires = input_port_read_safe(machine, "hires_intf", 0x00);
1367   int joystick_axis, joystick, joy_mask, joy_shift, ctrl, hires_val, ccm3_val;
13711368
1372   static const char *const portnames[2][6][2] =
1369   static const char *const portnames[2][4][2] =
13731370         {
1374            { {0}, {"joystick_rx", "joystick_ry"}, {"rat_mouse_rx", "rat_mouse_ry"}, {"dclg_rx", "dclg_ry"},
1375               {"joystick_hires_rx", "joystick_hires_ry"}, {"joystick_hires_max_rx", "joystick_hires_max_ry"} },   /* right ports */
1376            { {0}, {"joystick_lx", "joystick_ly"}, {"rat_mouse_lx", "rat_mouse_ly"}, {"dclg_lx", "dclg_ly"},
1377               {"joystick_hires_lx", "joystick_hires_ly"}, {"joystick_hires_max_lx", "joystick_hires_max_ly"} },   /* left ports */
1371            { {0}, {"joystick_rx", "joystick_ry"}, {"rat_mouse_rx", "rat_mouse_ry"}, {"dclg_rx", "dclg_ry"} },   /* right ports */
1372            { {0}, {"joystick_lx", "joystick_ly"}, {"rat_mouse_lx", "rat_mouse_ly"}, {"dclg_lx", "dclg_ly"} },   /* left ports */
13781373         };
1374   static const char *const button_names[4] = { "empty", "joystick_buttons", "rat_mouse_buttons", "dclg_triggers" };
13791375
1376
1377
13801378   pia0_pb = pia6821_get_output_b(state->pia_0);
13811379   joystick_axis = mux_sel1;
13821380   joystick = mux_sel2;
1381
1382   /* which kind of controller is selected? */
13831383   joy_mask = joystick ? 0xf0 : 0x0f;
13841384   joy_shift = joystick ? 4 : 0;
13851385   ctrl = (input_port_read_safe(machine, "ctrl_sel", 0x00) & joy_mask) >> joy_shift;
13861386
1387   /* is any Hi-Res Interface turned on? prepare masks to check it */
1388   hires_val = joystick ? 0x03 : 0x01;
1389   ccm3_val = joystick ? 0x04 : 0x02;
1390
13871391   /* poll keyboard keys */
13881392   if ((input_port_read(machine, "row0") | pia0_pb) != 0xff) porta &= ~0x01;
13891393   if ((input_port_read(machine, "row1") | pia0_pb) != 0xff) porta &= ~0x02;
r6166r6167
14041408   switch (ctrl)
14051409   {
14061410      case 0x01: /* Joystick */
1407         joyval = input_port_read_safe(machine, portnames[joystick][ctrl][joystick_axis], 0x00);
1408         if (dac <= joyval)
1409            porta |= 0x80;
1411         if (hires == hires_val || hires == ccm3_val)
1412         {
1413            /* Hi-Res Joystick or Hi-Res CoCo3Max Joystick */
1414            if (joystick_axis ? coco_hiresjoy_ry(machine) : coco_hiresjoy_rx(machine))
1415               porta |= 0x80;
1416         }
1417         else
1418         {
1419            joyval = input_port_read_safe(machine, portnames[joystick][ctrl][joystick_axis], 0x00);
1420            if (dac <= joyval)
1421               porta |= 0x80;
1422         }
14101423         break;
14111424
1412      case 0x04: /* Hi-Res Joystick */
1413      case 0x05: /* Hi-Res CC3Max Joystick */
1414         if (joystick_axis ? coco_hiresjoy_ry(machine) : coco_hiresjoy_rx(machine))
1415            porta |= 0x80;
1416         break;
1417
14181425      case 0x02: /* Rat Mouse */
14191426         joyval = input_port_read_safe(machine, portnames[joystick][ctrl][joystick_axis], 0x00);
14201427         if ((dac >> 2) <= joy_rat_table[joyval])
r6166r6167
14221429         break;
14231430
14241431      case 0x03: /* Diecom Light Gun */
1425         if( (video_screen_get_vpos(machine->primary_screen) == input_port_read_safe(machine, portnames[joystick][ctrl][1], 0)) )
1432         if ((video_screen_get_vpos(machine->primary_screen) == input_port_read_safe(machine, portnames[joystick][ctrl][1], 0)))
14261433         {
14271434            /* If gun is pointing at the current scan line, set hit bit and cache horizontal timer value */
14281435            dclg_output_h |= 0x02;
14291436            dclg_timer = input_port_read_safe(machine, portnames[joystick][ctrl][0], 0) << 1;
14301437         }
14311438
1432         if ( (dac >> 2) <= dclg_table[(joystick_axis ? dclg_output_h : dclg_output_v) & 0x03])
1439         if ((dac >> 2) <= dclg_table[(joystick_axis ? dclg_output_h : dclg_output_v) & 0x03])
14331440            porta |= 0x80;
14341441
1435         if( (dclg_state == 7) )
1442         if ((dclg_state == 7))
14361443         {
14371444            /* While in state 7, prepare to chech next video frame for a hit */
14381445            dclg_time = video_screen_get_time_until_pos(machine->primary_screen, input_port_read_safe(machine, portnames[joystick][ctrl][1], 0), 0);
r6166r6167
14441451         break;
14451452   }
14461453
1447   if( attotime_compare(dclg_time, attotime_zero) )
1454   if (attotime_compare(dclg_time, attotime_zero))
14481455   {
14491456      /* schedule lightgun events */
1450      timer_reset(update_keyboard_timer, dclg_time );
1457      timer_reset(update_keyboard_timer, dclg_time);
14511458   }
14521459   else
14531460   {
r6166r6167
14601467   }
14611468
14621469   /* sample joystick buttons */
1463   porta &= ~input_port_read_safe(machine, "joystick_buttons", 0);
1464   port_za &= ~input_port_read_safe(machine, "joystick_buttons", 0);
1470   porta &= ~input_port_read_safe(machine, button_names[ctrl], 0);
1471   port_za &= ~input_port_read_safe(machine, button_names[ctrl], 0);
14651472
14661473   pia6821_set_input_a(state->pia_0, porta, port_za);
14671474   return porta;
r6166r6167
14691476
14701477
14711478
1472static UINT8 coco3_update_keyboard(running_machine *machine)
1479static UINT8 coco3_update_keyboard( running_machine *machine )
14731480{
14741481   /* the CoCo 3 keyboard update routine must also check for the GIME EI1 interrupt */
1475   UINT8 porta;
1476   porta = coco_update_keyboard(machine);
1477   coco3_raise_interrupt(machine, COCO3_INT_EI1, ((porta & 0x7F) == 0x7F) ? CLEAR_LINE : ASSERT_LINE);
1482   UINT8 porta = coco_update_keyboard(machine);
1483   coco3_raise_interrupt(machine, COCO3_INT_EI1, ((porta & 0x7f) == 0x7f) ? CLEAR_LINE : ASSERT_LINE);
14781484   return porta;
14791485}
14801486
14811487
14821488
14831489/* three functions that update the keyboard in varying ways */
1484static WRITE8_DEVICE_HANDLER ( d_pia0_pb_w )               { (*update_keyboard)(device->machine); }
1485INPUT_CHANGED(coco_keyboard_changed)               { (*update_keyboard)(field->port->machine); }
1486static TIMER_CALLBACK(coco_update_keyboard_timerproc)   { (*update_keyboard)(machine); }
1490static WRITE8_DEVICE_HANDLER( d_pia0_pb_w )            { (*update_keyboard)(device->machine); }
1491INPUT_CHANGED( coco_keyboard_changed )                 { (*update_keyboard)(field->port->machine); }
1492static TIMER_CALLBACK( coco_update_keyboard_timerproc) { (*update_keyboard)(machine); }
14871493
1488static WRITE8_DEVICE_HANDLER ( d_pia0_pa_w )
1494static WRITE8_DEVICE_HANDLER( d_pia0_pa_w )
14891495{
1496   UINT8 ctrl = input_port_read_safe(device->machine, "ctrl_sel", 0x00);
1497   UINT8 hires = input_port_read_safe(device->machine, "hires_intf", 0x00);
1498
14901499   /* Hi-Res CC3Max Joystick (either in Left or in Right Port) writes here */
1491   if ((input_port_read_safe(device->machine, "ctrl_sel", 0x00) & 0x0f) == 0x05)
1500   if ((ctrl & 0x0f) == 0x01 && hires == 0x02)
14921501      coco_hiresjoy_w(device->machine, data & 0x04, 0);
1493   else if ((input_port_read_safe(device->machine, "ctrl_sel", 0x00) & 0xf0) == 0x50)
1502   else if ((ctrl & 0xf0) == 0x10 && hires == 0x04)
14941503      coco_hiresjoy_w(device->machine, data & 0x04, 1);
14951504}
14961505
14971506
1498
14991507/***************************************************************************
15001508  PIA1 ($FF20-$FF3F) (Chip U4)
15011509
r6166r6167
15511559     *  7-2:    DAC to speaker or cassette
15521560     *    1:    Serial out (CoCo), Printer strobe (Dragon)
15531561     */
1554   UINT8 dac = pia6821_get_output_a(device) & 0xFC;
1562   UINT8 dac = pia6821_get_output_a(device) & 0xfc;
15551563   static int dclg_previous_bit;
1564   UINT8 ctrl = input_port_read_safe(device->machine, "ctrl_sel", 0x00);
1565   UINT8 hires = input_port_read_safe(device->machine, "hires_intf", 0x00);
15561566
15571567   coco_sound_update(device->machine);
15581568
15591569   /* Diecom Light Gun (either in Left or in Right Port) writes here */
1560   if ((input_port_read_safe(device->machine, "ctrl_sel", 0x00) & 0x0f) == 0x03 ||
1561      (input_port_read_safe(device->machine, "ctrl_sel", 0x00) & 0xf0) == 0x30)
1570   if ((ctrl & 0x0f) == 0x03 || (ctrl & 0xf0) == 0x30)
15621571   {
15631572      int dclg_this_bit = ((data & 2) >> 1);
15641573
1565      if( dclg_previous_bit == 1 )
1574      if (dclg_previous_bit == 1)
15661575      {
1567         if( dclg_this_bit == 0 )
1576         if (dclg_this_bit == 0)
15681577         {
15691578            /* Clock Diecom Light gun interface on a high to low transistion */
15701579            dclg_state++;
r6166r6167
15731582            /* Clear hit bit for every transistion */
15741583            dclg_output_h &= ~0x02;
15751584
1576            if( dclg_state > 7 )
1585            if (dclg_state > 7)
15771586            {
15781587               /* Bit shift timer data on state 8 thru 15 */
1579               if (((dclg_timer >> (dclg_state-8+1)) & 0x01) == 1)
1588               if (((dclg_timer >> (dclg_state - 8 + 1)) & 0x01) == 1)
15801589                  dclg_output_v |= 0x01;
15811590               else
15821591                  dclg_output_v &= ~0x01;
15831592
15841593               /* Bit 9 of timer is only avaiable if state == 8*/
1585               if (dclg_state == 8 && (((dclg_timer >> 9) & 0x01) == 1) )
1594               if (dclg_state == 8 && (((dclg_timer >> 9) & 0x01) == 1))
15861595                  dclg_output_v |= 0x02;
15871596               else
15881597                  dclg_output_v &= ~0x02;
15891598            }
15901599
15911600            /* During state 15, this bit is high. */
1592            if( dclg_state == 15 )
1601            if (dclg_state == 15)
15931602               dclg_output_h |= 0x01;
15941603            else
15951604               dclg_output_h &= ~0x01;
r6166r6167
16071616   (*update_keyboard)(device->machine);
16081617
16091618   /* Hi-Res Joystick (either in Left or in Right Port) writes here */
1610   if ((input_port_read_safe(device->machine, "ctrl_sel", 0x00) & 0x0f) == 0x04)
1619   if ((ctrl & 0x0f) == 0x04 && hires == 0x01)
16111620      coco_hiresjoy_w(device->machine, dac >= 0x80, 0);
1612   else if ((input_port_read_safe(device->machine, "ctrl_sel", 0x00) & 0xf0) == 0x40)
1621   else if ((ctrl & 0xf0) == 0x40 && hires == 0x03)
16131622      coco_hiresjoy_w(device->machine, dac >= 0x80, 1);
16141623
16151624   /* Handle printer output, serial for CoCos, parallel for Dragons */
1616
16171625   printer_out(device->machine, data);
16181626}
16191627
r6166r6167
29442952   coco3_mmu_update(machine, 0, 8);
29452953}
29462954
2947static void update_lightgun(running_machine *machine)
2955static void update_lightgun( running_machine *machine )
29482956{
29492957   /* is there a Diecom Light Gun either in Left or in Right Port? */
2950   int is_lightgun = ((input_port_read_safe(machine, "ctrl_sel", 0x00) & 0x0f) == 0x03 ||
2951               (input_port_read_safe(machine, "ctrl_sel", 0x00) & 0xf0) == 0x30) ? 1 :0;
2958   UINT8 ctrl = input_port_read_safe(machine, "ctrl_sel", 0x00);
2959   int is_lightgun = ((ctrl & 0x0f) == 0x03 || (ctrl & 0xf0) == 0x30) ? 1 :0;
29522960
29532961   crosshair_set_screen(machine, 0, is_lightgun ? CROSSHAIR_SCREEN_ALL : CROSSHAIR_SCREEN_NONE);
29542962}
src/mess/drivers/coco.c
r6166r6167
1919    coco3p  1.2 2.0         1.1
2020    coco3h  1.2 2.0         1.1
2121
22
23    Input-related note (FP, 2009-10): currently, button inputs are shared
24    by the various controllers. This makes life easier when trying to
25    re-configure buttons (a single change modifies all the controllers),
26    but it has the undesired side effect of making the buttons available
27    for remapping also when no device is connected to the input port.
28    We should probably move buttons to separate INPUT_PORTS.
29
3022***************************************************************************/
3123
3224#include "driver.h"
r6166r6167
136128   AM_RANGE(0xff20, 0xff3f) AM_DEVREADWRITE("pia_1", pia6821_r, coco_pia_1_w)
137129   AM_RANGE(0xff40, 0xff7f) AM_DEVREADWRITE("coco_cartslot", coco_cartridge_r, coco_cartridge_w)
138130   AM_RANGE(0xff80, 0xff85) AM_DEVREADWRITE("vhd", coco_vhd_io_r, coco_vhd_io_w)
139   AM_RANGE(0xff90, 0xff9f) AM_READWRITE(coco3_gime_r,         coco3_gime_w)
140   AM_RANGE(0xffa0, 0xffaf) AM_READWRITE(coco3_mmu_r,         coco3_mmu_w)
141   AM_RANGE(0xffb0, 0xffbf) AM_READWRITE(SMH_BANK(10),         coco3_palette_w)
131   AM_RANGE(0xff90, 0xff9f) AM_READWRITE(coco3_gime_r, coco3_gime_w)
132   AM_RANGE(0xffa0, 0xffaf) AM_READWRITE(coco3_mmu_r, coco3_mmu_w)
133   AM_RANGE(0xffb0, 0xffbf) AM_READWRITE(SMH_BANK(10), coco3_palette_w)
142134   AM_RANGE(0xffc0, 0xffdf) AM_DEVWRITE("sam", sam6883_w)
143135   AM_RANGE(0xffe0, 0xffef) AM_NOP
144136   AM_RANGE(0xfff0, 0xffff) AM_ROM AM_REGION("maincpu", 0x7ff0)
r6166r6167
276268   AM_RANGE(0xE000, 0xEFFF) AM_RAMBANK(15)
277269   AM_RANGE(0xF000, 0xFEFF) AM_RAMBANK(16)
278270   AM_RANGE(0xff00, 0xff03) AM_DEVREADWRITE("pia_0", pia6821_r, pia6821_w)
279   AM_RANGE(0xff04, 0xff07) AM_DEVREADWRITE("acia", acia_6551_r,      acia_6551_w)
271   AM_RANGE(0xff04, 0xff07) AM_DEVREADWRITE("acia", acia_6551_r, acia_6551_w)
280272   AM_RANGE(0xff20, 0xff23) AM_DEVREADWRITE("pia_1", pia6821_r, coco_pia_1_w)
281273   AM_RANGE(0xff24, 0xff27) AM_DEVREADWRITE("pia_2", pia6821_r, pia6821_w)    /* Third PIA on Dragon Alpha */
282   AM_RANGE(0Xff28, 0xff2b) AM_READWRITE(alpha_modem_r,   alpha_modem_w)   /* Modem, dummy to stop eror log ! */
283   AM_RANGE(0xff2c, 0xff2f) AM_READWRITE(wd2797_r,         wd2797_w)   /* Alpha onboard disk interface */
274   AM_RANGE(0Xff28, 0xff2b) AM_READWRITE(alpha_modem_r, alpha_modem_w)      /* Modem, dummy to stop eror log ! */
275   AM_RANGE(0xff2c, 0xff2f) AM_READWRITE(wd2797_r,   wd2797_w)            /* Alpha onboard disk interface */
284276   AM_RANGE(0xff40, 0xff7f) AM_DEVREADWRITE("coco_cartslot", coco_cartridge_r, coco_cartridge_w)
285277   AM_RANGE(0xff90, 0xffbf) AM_NOP
286278   AM_RANGE(0xffc0, 0xffdf) AM_DEVWRITE("sam", sam6883_w)
r6166r6167
298290   PORT_BIT( 0xff, 0x80,  IPT_AD_STICK_X) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_4_PAD) PORT_CODE_INC(KEYCODE_6_PAD) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(2) PORT_CATEGORY(21)
299291   PORT_START("joystick_ly")
300292   PORT_BIT( 0xff, 0x80,  IPT_AD_STICK_Y) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_8_PAD) PORT_CODE_INC(KEYCODE_2_PAD) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH)   PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH)  PORT_PLAYER(2) PORT_CATEGORY(21)
301INPUT_PORTS_END
302
303static INPUT_PORTS_START( coco_hires_joystick )
304   PORT_START("joystick_hires_rx")
305   PORT_BIT( 0xff, 0x80,  IPT_AD_STICK_X) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_4_PAD) PORT_CODE_INC(KEYCODE_6_PAD) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(1) PORT_CATEGORY(14)
306   PORT_START("joystick_hires_ry")
307   PORT_BIT( 0xff, 0x80,  IPT_AD_STICK_Y) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_8_PAD) PORT_CODE_INC(KEYCODE_2_PAD) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH)   PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH)  PORT_PLAYER(1) PORT_CATEGORY(14)
308   PORT_START("joystick_hires_lx")
309   PORT_BIT( 0xff, 0x80,  IPT_AD_STICK_X) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_4_PAD) PORT_CODE_INC(KEYCODE_6_PAD) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(2) PORT_CATEGORY(24)
310   PORT_START("joystick_hires_ly")
311   PORT_BIT( 0xff, 0x80,  IPT_AD_STICK_Y) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_8_PAD) PORT_CODE_INC(KEYCODE_2_PAD) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH)   PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH)  PORT_PLAYER(2) PORT_CATEGORY(24)
312INPUT_PORTS_END
313
314
315static INPUT_PORTS_START( coco_hires_max_joystick )
316   PORT_START("joystick_hires_max_rx")
317   PORT_BIT( 0xff, 0x80,  IPT_AD_STICK_X) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_4_PAD) PORT_CODE_INC(KEYCODE_6_PAD) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(1) PORT_CATEGORY(15)
318   PORT_START("joystick_hires_max_ry")
319   PORT_BIT( 0xff, 0x80,  IPT_AD_STICK_Y) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_8_PAD) PORT_CODE_INC(KEYCODE_2_PAD) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH)   PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH)  PORT_PLAYER(1) PORT_CATEGORY(15)
320   PORT_START("joystick_hires_max_lx")
321   PORT_BIT( 0xff, 0x80,  IPT_AD_STICK_X) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_4_PAD) PORT_CODE_INC(KEYCODE_6_PAD) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(2) PORT_CATEGORY(25)
322   PORT_START("joystick_hires_max_ly")
323   PORT_BIT( 0xff, 0x80,  IPT_AD_STICK_Y) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_8_PAD) PORT_CODE_INC(KEYCODE_2_PAD) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH)   PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH)  PORT_PLAYER(2) PORT_CATEGORY(25)
324INPUT_PORTS_END
325
326static INPUT_PORTS_START( coco_joystick_buttons )
327293   PORT_START("joystick_buttons")
328   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Right Button") PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(1)
329   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Left Button")  PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(2)
294   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Right Button") PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(1) PORT_CATEGORY(11)
295   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Left Button")  PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(2) PORT_CATEGORY(21)
330296INPUT_PORTS_END
331297
332static INPUT_PORTS_START( coco3_joystick_buttons )
298static INPUT_PORTS_START( coco3_joystick )
299   PORT_START("joystick_rx")
300   PORT_BIT( 0xff, 0x80,  IPT_AD_STICK_X) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_4_PAD) PORT_CODE_INC(KEYCODE_6_PAD) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(1) PORT_CATEGORY(11)
301   PORT_START("joystick_ry")
302   PORT_BIT( 0xff, 0x80,  IPT_AD_STICK_Y) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_8_PAD) PORT_CODE_INC(KEYCODE_2_PAD) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH)   PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH)  PORT_PLAYER(1) PORT_CATEGORY(11)
303   PORT_START("joystick_lx")
304   PORT_BIT( 0xff, 0x80,  IPT_AD_STICK_X) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_4_PAD) PORT_CODE_INC(KEYCODE_6_PAD) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(2) PORT_CATEGORY(21)
305   PORT_START("joystick_ly")
306   PORT_BIT( 0xff, 0x80,  IPT_AD_STICK_Y) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_8_PAD) PORT_CODE_INC(KEYCODE_2_PAD) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH)   PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH)  PORT_PLAYER(2) PORT_CATEGORY(21)
333307   PORT_START("joystick_buttons")
334   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Right Button 1") PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(1)
335   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Right Button 2") PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_DEL_PAD) PORT_CODE(JOYCODE_BUTTON2) PORT_CODE(MOUSECODE_BUTTON2) PORT_PLAYER(1)
336   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Left Button 1")  PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(2)
337   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Left Button 2")  PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_DEL_PAD) PORT_CODE(JOYCODE_BUTTON2) PORT_CODE(MOUSECODE_BUTTON2) PORT_PLAYER(2)
308   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Right Button 1") PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(1) PORT_CATEGORY(11)
309   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Right Button 2") PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_DEL_PAD) PORT_CODE(JOYCODE_BUTTON2) PORT_CODE(MOUSECODE_BUTTON2) PORT_PLAYER(1) PORT_CATEGORY(11)
310   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Left Button 1")  PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(2) PORT_CATEGORY(21)
311   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Left Button 2")  PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_DEL_PAD) PORT_CODE(JOYCODE_BUTTON2) PORT_CODE(MOUSECODE_BUTTON2) PORT_PLAYER(2) PORT_CATEGORY(21)
338312INPUT_PORTS_END
339313
340314static INPUT_PORTS_START( coco_rat_mouse )
r6166r6167
346320   PORT_BIT( 0x03, 0x00,  IPT_MOUSE_X) PORT_NAME("Rat Mouse X (Left Port)") PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_LEFT) PORT_CODE_INC(KEYCODE_RIGHT) PORT_CODE_DEC(JOYCODE_X_LEFT_SWITCH) PORT_CODE_INC(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(2) PORT_CATEGORY(22)
347321   PORT_START("rat_mouse_ly")
348322   PORT_BIT( 0x03, 0x00,  IPT_MOUSE_Y) PORT_NAME("Rat Mouse Y (Left Port)") PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_UP) PORT_CODE_INC(KEYCODE_DOWN) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH) PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH) PORT_PLAYER(2) PORT_CATEGORY(22)
323   PORT_START("rat_mouse_buttons")
324   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Rat Mouse Button 1 (Right Port)") PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(1) PORT_CATEGORY(12)
325   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Rat Mouse Button 2 (Right Port)") PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_DEL_PAD) PORT_CODE(JOYCODE_BUTTON2) PORT_CODE(MOUSECODE_BUTTON2) PORT_PLAYER(1) PORT_CATEGORY(12)
326   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Rat Mouse Button 1 (Left Port)")  PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(2) PORT_CATEGORY(22)
327   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Rat Mouse Button 2 (Left Port)")  PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_DEL_PAD) PORT_CODE(JOYCODE_BUTTON2) PORT_CODE(MOUSECODE_BUTTON2) PORT_PLAYER(2) PORT_CATEGORY(22)
349328INPUT_PORTS_END
350329
351330static INPUT_PORTS_START( coco_lightgun )
r6166r6167
357336   PORT_BIT( 0x1ff, 266, IPT_LIGHTGUN_X ) PORT_NAME("Lightgun X (Left Port)") PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_MINMAX(116,416) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_PLAYER(1) PORT_CATEGORY(23)
358337   PORT_START("dclg_ly")
359338   PORT_BIT( 0xff, 121, IPT_LIGHTGUN_Y ) PORT_NAME("Lightgun Y (Left Port)") PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_MINMAX(0,242) PORT_SENSITIVITY(100) PORT_KEYDELTA(1) PORT_PLAYER(1) PORT_CATEGORY(23)
339   PORT_START("dclg_triggers")
340   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Lightgun Trigger (Right Port)") PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(1) PORT_CATEGORY(13)
341   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Lightgun Trigger (Left Port)")  PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(2) PORT_CATEGORY(23)
360342INPUT_PORTS_END
361343
362344
363345static INPUT_PORTS_START( cart_autostart )
364346   PORT_START("CARTAUTO")
365347   PORT_CONFNAME( 0x01, 0x01, "Cart Auto-Start" )
366   PORT_CONFSETTING(0x00, DEF_STR( Off ))
367   PORT_CONFSETTING(0x01, DEF_STR( On ))
348   PORT_CONFSETTING(    0x00, DEF_STR( Off ))
349   PORT_CONFSETTING(    0x01, DEF_STR( On ))
368350INPUT_PORTS_END
369351
370352/* Dragon keyboard
r6166r6167
379361  PA0: 0   1   2   3   4   5   6   7
380362 */
381363static INPUT_PORTS_START( dragon32 )
382   PORT_START("row0") /* KEY ROW 0 */
364   PORT_START("row0")
383365   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_0) PORT_CHAR('0')
384366   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!')
385367   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('\"')
r6166r6167
389371   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&')
390372   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'')
391373
392   PORT_START("row1") /* KEY ROW 1 */
374   PORT_START("row1")
393375   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(')
394376   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')')
395377   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_COLON) PORT_CHAR(':') PORT_CHAR('*')
r6166r6167
399381   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>')
400382   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?')
401383
402   PORT_START("row2") /* KEY ROW 2 */
384   PORT_START("row2")
403385   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR('@')
404386   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_A) PORT_CHAR('A')
405387   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_B) PORT_CHAR('B')
r6166r6167
409391   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_F) PORT_CHAR('F')
410392   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_G) PORT_CHAR('G')
411393
412   PORT_START("row3") /* KEY ROW 3 */
394   PORT_START("row3")
413395   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_H) PORT_CHAR('H')
414396   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_I) PORT_CHAR('I')
415397   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_J) PORT_CHAR('J')
r6166r6167
419401   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_N) PORT_CHAR('N')
420402   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_O) PORT_CHAR('O')
421403
422   PORT_START("row4") /* KEY ROW 4 */
404   PORT_START("row4")
423405   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_P) PORT_CHAR('P')
424406   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q')
425407   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_R) PORT_CHAR('R')
r6166r6167
429411   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_V) PORT_CHAR('V')
430412   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_W) PORT_CHAR('W')
431413
432   PORT_START("row5") /* KEY ROW 5 */
414   PORT_START("row5")
433415   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_X) PORT_CHAR('X')
434416   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y')
435417   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z')
r6166r6167
439421   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("RIGHT") PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(9)
440422   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ')
441423
442   PORT_START("row6") /* KEY ROW 6 */
424   PORT_START("row6")
443425   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("ENTER") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13)
444426   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("CLEAR") PORT_CODE(KEYCODE_HOME) PORT_CHAR(12)
445427   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("BREAK") PORT_CODE(KEYCODE_END) PORT_CODE(KEYCODE_ESC) PORT_CHAR(27)
446428   PORT_BIT(0x78, IP_ACTIVE_LOW, IPT_UNUSED)
447429   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1)
448430
449   /* Fix me: was any other controller compatible with dragon? */
431   /* Other CoCo controllers were compatible with the Dragon, even if no software is known to make use of them */
432   /* We add them here, based on this compatibility, in case anyone wants to use them in homebrew software */
450433   PORT_START("ctrl_sel")  /* Select Controller Type */
451434   PORT_CATEGORY_CLASS( 0x0f, 0x01, "Right Controller Port (P1)") PORT_CHANGED( coco_joystick_mode_changed, 0 )
452435   PORT_CATEGORY_ITEM(  0x00, "Unconnected",               10 )
453436   PORT_CATEGORY_ITEM(  0x01, "Joystick",               11 )
437   PORT_CATEGORY_ITEM(  0x02, "The Rat Graphics Mouse",         12 ) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_NOTEQUALS, 0x20)
438   PORT_CATEGORY_ITEM(  0x03, "Diecom Light Gun Adaptor",      13 ) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_NOTEQUALS, 0x30)
454439   PORT_CATEGORY_CLASS( 0xf0, 0x10, "Left Controller Port (P2)") PORT_CHANGED( coco_joystick_mode_changed, 0 )
455440   PORT_CATEGORY_ITEM(  0x00, "Unconnected",               20 )
456441   PORT_CATEGORY_ITEM(  0x10, "Joystick",               21 )
442   PORT_CATEGORY_ITEM(  0x20, "The Rat Graphics Mouse",         22 ) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_NOTEQUALS, 0x02)
443   PORT_CATEGORY_ITEM(  0x30, "Diecom Light Gun Adaptor",      23 ) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_NOTEQUALS, 0x03)
457444
445   PORT_START("hires_intf")
446   PORT_CONFNAME( 0x07, 0x00, "Hi-Res Joystick Interfaces" )
447   PORT_CONFSETTING(    0x00, "None" )
448   PORT_CONFSETTING(    0x01, "Hi-Res in Right Port" )                     PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_EQUALS, 0x01)
449   PORT_CONFSETTING(    0x02, "Hi-Res CoCoMax 3 Style in Right Port" )     PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_EQUALS, 0x01)
450   PORT_CONFSETTING(    0x03, "Hi-Res in Left Port" )                      PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_EQUALS, 0x10)
451   PORT_CONFSETTING(    0x04, "Hi-Res CoCoMax 3 Style in Left Port" )      PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_EQUALS, 0x10)
452
458453   PORT_INCLUDE( coco_joystick )
459   PORT_INCLUDE( coco_joystick_buttons )
454   PORT_INCLUDE( coco_rat_mouse )
455   PORT_INCLUDE( coco_lightgun )
456
460457   PORT_INCLUDE( coco6847_artifacting )
461458
462459   PORT_INCLUDE( cart_autostart )
r6166r6167
474471  PA0: @   A   B   C   D   E   F   G
475472 */
476473static INPUT_PORTS_START( coco )
477   PORT_START("row0") /* KEY ROW 0 */
474   PORT_START("row0")
478475   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR('@')
479476   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_A) PORT_CHAR('A')
480477   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_B) PORT_CHAR('B')
r6166r6167
484481   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_F) PORT_CHAR('F')
485482   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_G) PORT_CHAR('G')
486483
487   PORT_START("row1") /* KEY ROW 1 */
484   PORT_START("row1")
488485   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_H) PORT_CHAR('H')
489486   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_I) PORT_CHAR('I')
490487   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_J) PORT_CHAR('J')
r6166r6167
494491   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_N) PORT_CHAR('N')
495492   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_O) PORT_CHAR('O')
496493
497   PORT_START("row2") /* KEY ROW 2 */
494   PORT_START("row2")
498495   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_P) PORT_CHAR('P')
499496   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q')
500497   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_R) PORT_CHAR('R')
r6166r6167
504501   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_V) PORT_CHAR('V')
505502   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_W) PORT_CHAR('W')
506503
507   PORT_START("row3") /* KEY ROW 3 */
504   PORT_START("row3")
508505   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_X) PORT_CHAR('X')
509506   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y')
510507   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z')
r6166r6167
514511   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("RIGHT") PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(9)
515512   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ')
516513
517   PORT_START("row4") /* KEY ROW 4 */
514   PORT_START("row4")
518515   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_0) PORT_CHAR('0')
519516   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!')
520517   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('\"')
r6166r6167
524521   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&')
525522   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'')
526523
527   PORT_START("row5") /* KEY ROW 5 */
524   PORT_START("row5")
528525   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(')
529526   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')')
530527   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_COLON) PORT_CHAR(':') PORT_CHAR('*')
r6166r6167
534531   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>')
535532   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?')
536533
537   PORT_START("row6") /* KEY ROW 6 */
534   PORT_START("row6")
538535   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("ENTER") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13)
539536   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("CLEAR") PORT_CODE(KEYCODE_HOME) PORT_CHAR(12)
540537   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("BREAK") PORT_CODE(KEYCODE_END) PORT_CODE(KEYCODE_ESC) PORT_CHAR(27)
r6166r6167
543540
544541   PORT_INCLUDE( coco6847_artifacting )
545542
546   PORT_START("real_time_clock") /* 13 */
543   PORT_START("real_time_clock")
547544   PORT_CONFNAME( 0x03, 0x00, "Real Time Clock" )
548545   PORT_CONFSETTING(    0x00, "Disto" )
549546   PORT_CONFSETTING(    0x01, "Cloud-9" )
550547
551   /* Port Condition is used because you can plug Hi-Res joystick,
552    Rat Mouse and Lightgun in either ports, but not both */
553   /* Fix me: should Rat Mouse and Diecom Light Gun be available also for coco & coco2? */
548   /* Port Condition is used because you can plug Hi-Res joystick, Rat Mouse and Lightgun in either ports, but not both */
554549   PORT_START("ctrl_sel")  /* Select Controller Type */
555550   PORT_CATEGORY_CLASS( 0x0f, 0x01, "Right Controller Port (P1)") PORT_CHANGED( coco_joystick_mode_changed, 0 )
556551   PORT_CATEGORY_ITEM(  0x00, "Unconnected",               10 )
557552   PORT_CATEGORY_ITEM(  0x01, "Joystick",               11 )
558553   PORT_CATEGORY_ITEM(  0x02, "The Rat Graphics Mouse",         12 ) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_NOTEQUALS, 0x20)
559554   PORT_CATEGORY_ITEM(  0x03, "Diecom Light Gun Adaptor",      13 ) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_NOTEQUALS, 0x30)
560   PORT_CATEGORY_ITEM(  0x04, "Hi-Res Interface Joystick",      14 ) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_LESSTHAN, 0x40)
561   PORT_CATEGORY_ITEM(  0x05, "Hi-Res Interface (CoCoMax 3 Style)",   15 ) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_LESSTHAN, 0x40)
562555   PORT_CATEGORY_CLASS( 0xf0, 0x10, "Left Controller Port (P2)") PORT_CHANGED( coco_joystick_mode_changed, 0 )
563556   PORT_CATEGORY_ITEM(  0x00, "Unconnected",               20 )
564557   PORT_CATEGORY_ITEM(  0x10, "Joystick",               21 )
565558   PORT_CATEGORY_ITEM(  0x20, "The Rat Graphics Mouse",         22 ) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_NOTEQUALS, 0x02)
566559   PORT_CATEGORY_ITEM(  0x30, "Diecom Light Gun Adaptor",      23 ) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_NOTEQUALS, 0x03)
567   PORT_CATEGORY_ITEM(  0x40, "Hi-Res Interface Joystick",      24 ) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_LESSTHAN, 0x04)
568   PORT_CATEGORY_ITEM(  0x50, "Hi-Res Interface (CoCoMax 3 Style)",   25 ) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_LESSTHAN, 0x04)
569560
561   PORT_START("hires_intf")
562   PORT_CONFNAME( 0x07, 0x00, "Hi-Res Joystick Interfaces" )// PORT_CHANGED( coco_joystick_mode_changed, 0 )
563   PORT_CONFSETTING(    0x00, "None" )
564   PORT_CONFSETTING(    0x01, "Hi-Res in Right Port" )                     PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_EQUALS, 0x01)
565   PORT_CONFSETTING(    0x02, "Hi-Res CoCoMax 3 Style in Right Port" )     PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_EQUALS, 0x01)
566   PORT_CONFSETTING(    0x03, "Hi-Res in Left Port" )                      PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_EQUALS, 0x10)
567   PORT_CONFSETTING(    0x04, "Hi-Res CoCoMax 3 Style in Left Port" )      PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_EQUALS, 0x10)
568
570569   PORT_INCLUDE( coco_joystick )
571570   PORT_INCLUDE( coco_rat_mouse )
572571   PORT_INCLUDE( coco_lightgun )
573   PORT_INCLUDE( coco_hires_joystick )
574   PORT_INCLUDE( coco_hires_max_joystick )
575   /* buttons are shared among the controllers at the moment */
576   PORT_INCLUDE( coco_joystick_buttons )
577572
578573   PORT_INCLUDE( cart_autostart )
579574INPUT_PORTS_END
r6166r6167
590585  PA0: @   A   B   C   D   E   F   G
591586 */
592587static INPUT_PORTS_START( coco3 )
593   PORT_START("row0") /* KEY ROW 0 */
588   PORT_START("row0")
594589   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR('@')
595590   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_A) PORT_CHAR('A')
596591   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_B) PORT_CHAR('B')
r6166r6167
600595   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_F) PORT_CHAR('F')
601596   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_G) PORT_CHAR('G')
602597
603   PORT_START("row1") /* KEY ROW 1 */
598   PORT_START("row1")
604599   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_H) PORT_CHAR('H')
605600   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_I) PORT_CHAR('I')
606601   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_J) PORT_CHAR('J')
r6166r6167
610605   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_N) PORT_CHAR('N')
611606   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_O) PORT_CHAR('O')
612607
613   PORT_START("row2") /* KEY ROW 2 */
608   PORT_START("row2")
614609   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_P) PORT_CHAR('P')
615610   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q')
616611   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_R) PORT_CHAR('R')
r6166r6167
620615   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_V) PORT_CHAR('V')
621616   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_W) PORT_CHAR('W')
622617
623   PORT_START("row3") /* KEY ROW 3 */
618   PORT_START("row3")
624619   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_X) PORT_CHAR('X')
625620   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y')
626621   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z')
r6166r6167
630625   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("RIGHT") PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(9)
631626   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ')
632627
633   PORT_START("row4") /* KEY ROW 4 */
628   PORT_START("row4")
634629   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_0) PORT_CHAR('0')
635630   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!')
636631   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('\"')
r6166r6167
640635   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&')
641636   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'')
642637
643   PORT_START("row5") /* KEY ROW 5 */
638   PORT_START("row5")
644639   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(')
645640   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')')
646641   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_COLON) PORT_CHAR(':') PORT_CHAR('*')
r6166r6167
650645   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>')
651646   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?')
652647
653   PORT_START("row6") /* KEY ROW 6 */
648   PORT_START("row6")
654649   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("ENTER") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13)
655650   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("CLEAR") PORT_CODE(KEYCODE_HOME) PORT_CHAR(12)
656651   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHANGED(coco_keyboard_changed, NULL) PORT_NAME("BREAK") PORT_CODE(KEYCODE_END) PORT_CODE(KEYCODE_ESC) PORT_CHAR(27)
r6166r6167
667662   PORT_CONFSETTING(    0x00, "Disto" )
668663   PORT_CONFSETTING(    0x01, "Cloud-9" )
669664
670   /* Port Condition is used because you can plug Hi-Res joystick,
671    Rat Mouse and Lightgun in either ports, but not both */
672   /* Fix me: should Rat Mouse and Diecom Light Gun be available also for coco & coco2? */
665   /* Port Condition is used because you can plug Hi-Res joystick, Rat Mouse and Lightgun in either ports, but not both */
673666   PORT_START("ctrl_sel")  /* Select Controller Type */
674667   PORT_CATEGORY_CLASS( 0x0f, 0x01, "Right Controller Port (P1)") PORT_CHANGED( coco_joystick_mode_changed, 0 )
675668   PORT_CATEGORY_ITEM(  0x00, "Unconnected",               10 )
676669   PORT_CATEGORY_ITEM(  0x01, "Joystick",               11 )
677670   PORT_CATEGORY_ITEM(  0x02, "The Rat Graphics Mouse",         12 ) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_NOTEQUALS, 0x20)
678671   PORT_CATEGORY_ITEM(  0x03, "Diecom Light Gun Adaptor",      13 ) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_NOTEQUALS, 0x30)
679   PORT_CATEGORY_ITEM(  0x04, "Hi-Res Interface Joystick",      14 ) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_LESSTHAN, 0x40)
680   PORT_CATEGORY_ITEM(  0x05, "Hi-Res Interface (CoCoMax 3 Style)",   15 ) PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_LESSTHAN, 0x40)
681672   PORT_CATEGORY_CLASS( 0xf0, 0x10, "Left Controller Port (P2)") PORT_CHANGED( coco_joystick_mode_changed, 0 )
682673   PORT_CATEGORY_ITEM(  0x00, "Unconnected",               20 )
683674   PORT_CATEGORY_ITEM(  0x10, "Joystick",               21 )
684675   PORT_CATEGORY_ITEM(  0x20, "The Rat Graphics Mouse",         22 ) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_NOTEQUALS, 0x02)
685676   PORT_CATEGORY_ITEM(  0x30, "Diecom Light Gun Adaptor",      23 ) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_NOTEQUALS, 0x03)
686   PORT_CATEGORY_ITEM(  0x40, "Hi-Res Interface Joystick",      24 ) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_LESSTHAN, 0x04)
687   PORT_CATEGORY_ITEM(  0x50, "Hi-Res Interface (CoCoMax 3 Style)",   25 ) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_LESSTHAN, 0x04)
688677
689   PORT_INCLUDE( coco_joystick )
678   PORT_START("hires_intf")
679   PORT_CONFNAME( 0x07, 0x00, "Hi-Res Joystick Interfaces" )
680   PORT_CONFSETTING(    0x00, "None" )
681   PORT_CONFSETTING(    0x01, "Hi-Res in Right Port" )                     PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_EQUALS, 0x01)
682   PORT_CONFSETTING(    0x02, "Hi-Res CoCoMax 3 Style in Right Port" )     PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_EQUALS, 0x01)
683   PORT_CONFSETTING(    0x03, "Hi-Res in Left Port" )                      PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_EQUALS, 0x10)
684   PORT_CONFSETTING(    0x04, "Hi-Res CoCoMax 3 Style in Left Port" )      PORT_CONDITION("ctrl_sel", 0xf0, PORTCOND_EQUALS, 0x10)
685
686   PORT_INCLUDE( coco3_joystick )
690687   PORT_INCLUDE( coco_rat_mouse )
691688   PORT_INCLUDE( coco_lightgun )
692   PORT_INCLUDE( coco_hires_joystick )
693   PORT_INCLUDE( coco_hires_max_joystick )
694   /* buttons are shared among the controllers at the moment */
695   PORT_INCLUDE( coco3_joystick_buttons )
696689
697690   PORT_INCLUDE( cart_autostart )
698691INPUT_PORTS_END
r6166r6167
14001393/* use 64K rams, and will boot with 4k, if this is selected, so I have     */
14011394/* split these to avoid confusion -- PHS                                   */
14021395
1403/*     YEAR     NAME        PARENT  COMPAT  MACHINE    INPUT        INIT     CONFIG COMPANY                 FULLNAME */
1404COMP(  1980,   coco,      0,      0,      coco,      coco,      0,      0,      "Tandy Radio Shack",   "Color Computer" , 0)
1405COMP(  1981,   cocoe,      coco,   0,      cocoe,      coco,      0,      0,      "Tandy Radio Shack",   "Color Computer (Extended BASIC 1.0)" , 0)
1406COMP(  1983,   coco2,      coco,   0,      coco2,      coco,      0,      0,      "Tandy Radio Shack",   "Color Computer 2" , 0)
1407COMP(  1985?,   coco2b,      coco,   0,      coco2b,      coco,      0,      0,      "Tandy Radio Shack",   "Color Computer 2B" , 0)
1408COMP(  1986,   coco3,      coco,   0,       coco3,      coco3,      0,      0,      "Tandy Radio Shack",   "Color Computer 3 (NTSC)" , 0)
1409COMP(  1986,   coco3p,      coco,    0,      coco3p,      coco3,      0,      0,      "Tandy Radio Shack",   "Color Computer 3 (PAL)" , 0)
1410COMP(  19??,   coco3h,      coco,   0,      coco3h,      coco3,      0,      0,      "Tandy Radio Shack",   "Color Computer 3 (NTSC; HD6309)", GAME_COMPUTER_MODIFIED)
1411COMP(  1982,   dragon32,   coco,   0,      dragon32,   dragon32,   0,      0,   "Dragon Data Ltd",    "Dragon 32" , 0)
1412COMP(  1983,   dragon64,   coco,   0,      dragon64,   dragon32,   0,      0,   "Dragon Data Ltd",    "Dragon 64" , 0)
1413COMP(  1983,   d64plus,   coco,   0,   d64plus,   dragon32,   0,   0,   "Dragon Data Ltd",    "Dragon 64 Plus" , 0)
1414COMP(  1983,   tanodr64,   coco,   0,   tanodr64,   dragon32,   0,   0,   "Dragon Data Ltd/Tano Ltd","Tano Dragon 64 (NTSC)" , 0)
1415COMP(  1984,   dgnalpha,   coco,   0,      dgnalpha,   dragon32,   0,      0,   "Dragon Data Ltd",    "Dragon Alpha Prototype" , 0)
1416COMP(  1984,   cp400,      coco,    0,      coco,      coco,      0,      0,      "Prologica",          "CP400" , 0)
1396/*     YEAR     NAME        PARENT  COMPAT  MACHINE    INPUT      INIT    CONFIG COMPANY                 FULLNAME */
1397COMP(  1980,    coco,       0,      0,      coco,      coco,      0,      0,     "Tandy Radio Shack",            "Color Computer", 0)
1398COMP(  1981,    cocoe,      coco,   0,      cocoe,     coco,      0,      0,     "Tandy Radio Shack",            "Color Computer (Extended BASIC 1.0)", 0)
1399COMP(  1983,    coco2,      coco,   0,      coco2,     coco,      0,      0,     "Tandy Radio Shack",            "Color Computer 2", 0)
1400COMP(  1985?,   coco2b,     coco,   0,      coco2b,    coco,      0,      0,     "Tandy Radio Shack",            "Color Computer 2B", 0)
1401COMP(  1986,    coco3,      coco,   0,      coco3,     coco3,     0,      0,     "Tandy Radio Shack",            "Color Computer 3 (NTSC)", 0)
1402COMP(  1986,    coco3p,     coco,   0,      coco3p,    coco3,     0,      0,     "Tandy Radio Shack",            "Color Computer 3 (PAL)", 0)
1403COMP(  19??,    coco3h,     coco,   0,      coco3h,    coco3,     0,      0,     "Tandy Radio Shack",            "Color Computer 3 (NTSC; HD6309)", GAME_COMPUTER_MODIFIED)
1404COMP(  1982,    dragon32,   coco,   0,      dragon32,  dragon32,  0,      0,     "Dragon Data Ltd",            "Dragon 32", 0)
1405COMP(  1983,    dragon64,   coco,   0,      dragon64,  dragon32,  0,      0,     "Dragon Data Ltd",            "Dragon 64", 0)
1406COMP(  1983,    d64plus,    coco,   0,      d64plus,   dragon32,  0,      0,     "Dragon Data Ltd",            "Dragon 64 Plus", 0)
1407COMP(  1983,    tanodr64,   coco,   0,      tanodr64,  dragon32,  0,      0,     "Dragon Data Ltd / Tano Ltd", "Tano Dragon 64 (NTSC)", 0)
1408COMP(  1984,    dgnalpha,   coco,   0,      dgnalpha,  dragon32,  0,      0,     "Dragon Data Ltd",            "Dragon Alpha Prototype", 0)
1409COMP(  1984,    cp400,      coco,   0,      coco,      coco,      0,      0,     "Prologica",                  "CP400", 0)
docs/messnew.txt
r6166r6167
5151- [CBM] Fixed old regression in sx64 and c16c when trying to start
5252  emulation with a floppy inserted [Fabio Priuli]
5353
54- [COCO/COCO3/DRAGON] Converted inputs to use PORT_CATEGORY (i.e. you
55  now select controller type in the Categories submenu). When Joystick
56  is selected in either Right or Left Controller Port, Hi-Res Interface
57  becomes available in the Driver Configuration submenu. [Fabio Priuli]
58
5459- [COMPIS] Added proper ROM dumps. [Curt Coder]
5560
5661- [CPC family] Fixed screen dimensions. [Wilbert Pol]
r6166r6167
6772- [DGONE] Added proper CGA char dump. Now the system shows correct output.
6873  [Miodrag Milanovic]
6974
75- [DRAGON] Added same input devices as CoCo. [Fabio Priuli]
76
7077- [EINSTEIN] Made it possible to select single or double sided disk
7178  drives.  [Dirk Best]
7279

Previous 15994 Revisions Next


© 1998-2018 The MESS Team