src/mess/machine/coco.c
| r7241 | r7242 | |
| 2845 | 2845 | generic_init_machine(machine, init); |
| 2846 | 2846 | } |
| 2847 | 2847 | |
| 2848 | /******* Lightgun Setup **********/ |
| 2849 | |
| 2850 | static 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 | |
| 2859 | INPUT_CHANGED( coco_joystick_mode_changed ) |
| 2860 | { |
| 2861 | update_lightgun(field->port->machine); |
| 2862 | } |
| 2863 | |
| 2864 | static TIMER_CALLBACK( update_lightgun_timer_callback ) |
| 2865 | { |
| 2866 | update_lightgun(machine); |
| 2867 | } |
| 2868 | |
| 2848 | 2869 | /******* Machine Setups Dragons **********/ |
| 2849 | 2870 | |
| 2850 | 2871 | MACHINE_START( dragon32 ) |
| r7241 | r7242 | |
| 2857 | 2878 | init.printer_out_ = printer_out_dragon; |
| 2858 | 2879 | |
| 2859 | 2880 | 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); |
| 2860 | 2884 | } |
| 2861 | 2885 | |
| 2862 | 2886 | MACHINE_START( dragon64 ) |
| r7241 | r7242 | |
| 2869 | 2893 | init.printer_out_ = printer_out_dragon; |
| 2870 | 2894 | |
| 2871 | 2895 | 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); |
| 2872 | 2899 | } |
| 2873 | 2900 | |
| 2874 | 2901 | MACHINE_START( tanodr64 ) |
| r7241 | r7242 | |
| 2881 | 2908 | init.printer_out_ = printer_out_dragon; |
| 2882 | 2909 | |
| 2883 | 2910 | 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); |
| 2884 | 2914 | } |
| 2885 | 2915 | |
| 2886 | 2916 | MACHINE_START( dgnalpha ) |
| r7241 | r7242 | |
| 2893 | 2923 | init.printer_out_ = printer_out_dragon; |
| 2894 | 2924 | |
| 2895 | 2925 | 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); |
| 2896 | 2929 | } |
| 2897 | 2930 | |
| 2898 | 2931 | MACHINE_RESET( dgnalpha ) |
| r7241 | r7242 | |
| 2900 | 2933 | running_device *fdc = devtag_get_device(machine, "wd2797"); |
| 2901 | 2934 | wd17xx_set_complete_command_delay(fdc,20); |
| 2902 | 2935 | |
| 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 */ |
| 2904 | 2937 | /* by the WD2797, it is reset to 0 after the first inurrupt */ |
| 2905 | 2938 | dgnalpha_just_reset=1; |
| 2939 | |
| 2940 | /* need to specify lightgun crosshairs */ |
| 2941 | timer_set(machine, attotime_zero, NULL, 0, update_lightgun_timer_callback); |
| 2906 | 2942 | } |
| 2907 | 2943 | |
| 2908 | 2944 | const wd17xx_interface dgnalpha_wd17xx_interface = |
| r7241 | r7242 | |
| 2936 | 2972 | init.printer_out_ = printer_out_coco; |
| 2937 | 2973 | |
| 2938 | 2974 | 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); |
| 2939 | 2978 | } |
| 2940 | 2979 | |
| 2941 | 2980 | MACHINE_RESET( coco3 ) |
| r7241 | r7242 | |
| 2959 | 2998 | coco3_mmu_update(machine, 0, 8); |
| 2960 | 2999 | } |
| 2961 | 3000 | |
| 2962 | | static 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 | | |
| 2971 | | INPUT_CHANGED( coco_joystick_mode_changed ) |
| 2972 | | { |
| 2973 | | update_lightgun(field->port->machine); |
| 2974 | | } |
| 2975 | | |
| 2976 | | static TIMER_CALLBACK( update_lightgun_timer_callback ) |
| 2977 | | { |
| 2978 | | update_lightgun(machine); |
| 2979 | | } |
| 2980 | | |
| 2981 | 3001 | MACHINE_START( coco3 ) |
| 2982 | 3002 | { |
| 2983 | 3003 | machine_init_interface init; |