r7242 Tuesday 2nd February, 2010 at 19:17:02 UTC by Fabio Priuli
[COCO] Fixed crosshair appearance at start when no lightgun is selected (it affected coco, coco2 & dragon)
[src/mess/drivers]coco.c
[src/mess/machine]coco.c

src/mess/machine/coco.c
r7241r7242
28452845   generic_init_machine(machine, init);
28462846}
28472847
2848/******* Lightgun Setup **********/
2849
2850static void update_lightgun( running_machine *machine )
2851{
2852   /* is there a Diecom Light Gun either in Left or in Right Port? */
2853   UINT8 ctrl = input_port_read_safe(machine, "ctrl_sel", 0x00);
2854   int is_lightgun = ((ctrl & 0x0f) == 0x03 || (ctrl & 0xf0) == 0x30) ? 1 :0;
2855
2856   crosshair_set_screen(machine, 0, is_lightgun ? CROSSHAIR_SCREEN_ALL : CROSSHAIR_SCREEN_NONE);
2857}
2858
2859INPUT_CHANGED( coco_joystick_mode_changed )
2860{
2861   update_lightgun(field->port->machine);
2862}
2863
2864static TIMER_CALLBACK( update_lightgun_timer_callback )
2865{
2866   update_lightgun(machine);
2867}
2868
28482869/******* Machine Setups Dragons **********/
28492870
28502871MACHINE_START( dragon32 )
r7241r7242
28572878   init.printer_out_      = printer_out_dragon;
28582879
28592880   generic_coco12_dragon_init(machine, &init);
2881
2882   /* need to specify lightgun crosshairs */
2883   timer_set(machine, attotime_zero, NULL, 0, update_lightgun_timer_callback);
28602884}
28612885
28622886MACHINE_START( dragon64 )
r7241r7242
28692893   init.printer_out_      = printer_out_dragon;
28702894
28712895   generic_coco12_dragon_init(machine, &init);
2896
2897   /* need to specify lightgun crosshairs */
2898   timer_set(machine, attotime_zero, NULL, 0, update_lightgun_timer_callback);
28722899}
28732900
28742901MACHINE_START( tanodr64 )
r7241r7242
28812908   init.printer_out_      = printer_out_dragon;
28822909
28832910   generic_coco12_dragon_init(machine, &init);
2911
2912   /* need to specify lightgun crosshairs */
2913   timer_set(machine, attotime_zero, NULL, 0, update_lightgun_timer_callback);
28842914}
28852915
28862916MACHINE_START( dgnalpha )
r7241r7242
28932923   init.printer_out_      = printer_out_dragon;
28942924
28952925   generic_coco12_dragon_init(machine, &init);
2926
2927   /* need to specify lightgun crosshairs */
2928   timer_set(machine, attotime_zero, NULL, 0, update_lightgun_timer_callback);
28962929}
28972930
28982931MACHINE_RESET( dgnalpha )
r7241r7242
29002933   running_device *fdc = devtag_get_device(machine, "wd2797");
29012934   wd17xx_set_complete_command_delay(fdc,20);
29022935 
2903    /* dgnalpha_just_reset, is here to flag that we should ignore the first irq generated */
2936   /* dgnalpha_just_reset, is here to flag that we should ignore the first irq generated */
29042937   /* by the WD2797, it is reset to 0 after the first inurrupt */
29052938   dgnalpha_just_reset=1;
2939
2940   /* need to specify lightgun crosshairs */
2941   timer_set(machine, attotime_zero, NULL, 0, update_lightgun_timer_callback);
29062942}
29072943
29082944const wd17xx_interface dgnalpha_wd17xx_interface =
r7241r7242
29362972   init.printer_out_      = printer_out_coco;
29372973
29382974   generic_coco12_dragon_init(machine, &init);
2975
2976   /* need to specify lightgun crosshairs */
2977   timer_set(machine, attotime_zero, NULL, 0, update_lightgun_timer_callback);
29392978}
29402979
29412980MACHINE_RESET( coco3 )
r7241r7242
29592998   coco3_mmu_update(machine, 0, 8);
29602999}
29613000
2962static void update_lightgun( running_machine *machine )
2963{
2964   /* is there a Diecom Light Gun either in Left or in Right Port? */
2965   UINT8 ctrl = input_port_read_safe(machine, "ctrl_sel", 0x00);
2966   int is_lightgun = ((ctrl & 0x0f) == 0x03 || (ctrl & 0xf0) == 0x30) ? 1 :0;
2967
2968   crosshair_set_screen(machine, 0, is_lightgun ? CROSSHAIR_SCREEN_ALL : CROSSHAIR_SCREEN_NONE);
2969}
2970
2971INPUT_CHANGED( coco_joystick_mode_changed )
2972{
2973   update_lightgun(field->port->machine);
2974}
2975
2976static TIMER_CALLBACK( update_lightgun_timer_callback )
2977{
2978   update_lightgun(machine);
2979}
2980
29813001MACHINE_START( coco3 )
29823002{
29833003   machine_init_interface init;
src/mess/drivers/coco.c
r7241r7242
559559   PORT_CATEGORY_ITEM(  0x30, "Diecom Light Gun Adaptor",      23 ) PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_NOTEQUALS, 0x03)
560560
561561   PORT_START("hires_intf")
562   PORT_CONFNAME( 0x07, 0x00, "Hi-Res Joystick Interfaces" )// PORT_CHANGED( coco_joystick_mode_changed, 0 )
562   PORT_CONFNAME( 0x07, 0x00, "Hi-Res Joystick Interfaces" )
563563   PORT_CONFSETTING(    0x00, "None" )
564564   PORT_CONFSETTING(    0x01, "Hi-Res in Right Port" )                     PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_EQUALS, 0x01)
565565   PORT_CONFSETTING(    0x02, "Hi-Res CoCoMax 3 Style in Right Port" )     PORT_CONDITION("ctrl_sel", 0x0f, PORTCOND_EQUALS, 0x01)

Previous 509077 RevisionsNext 50


© 1998-2010 The MESS Team